coinrayjs 2.0.0 → 2.0.1
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 +3090 -2952
- package/dist/coinrayjs.es.js.map +1 -1
- package/dist/coinrayjs.js +28 -28
- package/dist/coinrayjs.js.map +1 -1
- package/package.json +1 -1
package/dist/coinrayjs.js
CHANGED
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
var Coinray=(function(Wt){"use strict";function wc(e,t){return function(){return e.apply(t,arguments)}}const{toString:wp}=Object.prototype,{getPrototypeOf:Ua}=Object,{iterator:rs,toStringTag:bc}=Symbol,ns=(e=>t=>{const n=wp.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),rr=e=>(e=e.toLowerCase(),t=>ns(t)===e),is=e=>t=>typeof t===e,{isArray:Rn}=Array,Pn=is("undefined");function li(e){return e!==null&&!Pn(e)&&e.constructor!==null&&!Pn(e.constructor)&&St(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const vc=rr("ArrayBuffer");function bp(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&vc(e.buffer),t}const vp=is("string"),St=is("function"),Sc=is("number"),fi=e=>e!==null&&typeof e=="object",Sp=e=>e===!0||e===!1,ss=e=>{if(ns(e)!=="object")return!1;const t=Ua(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(bc in e)&&!(rs in e)},Tp=e=>{if(!fi(e)||li(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Ep=rr("Date"),Ap=rr("File"),Op=rr("Blob"),xp=rr("FileList"),Cp=e=>fi(e)&&St(e.pipe),kp=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||St(e.append)&&((t=ns(e))==="formdata"||t==="object"&&St(e.toString)&&e.toString()==="[object FormData]"))},Rp=rr("URLSearchParams"),[Pp,Dp,Mp,Lp]=["ReadableStream","Request","Response","Headers"].map(rr),Np=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function hi(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let s,a;if(typeof e!="object"&&(e=[e]),Rn(e))for(s=0,a=e.length;s<a;s++)t.call(null,e[s],s,e);else{if(li(e))return;const c=n?Object.getOwnPropertyNames(e):Object.keys(e),u=c.length;let l;for(s=0;s<u;s++)l=c[s],t.call(null,e[l],l,e)}}function Tc(e,t){if(li(e))return null;t=t.toLowerCase();const n=Object.keys(e);let s=n.length,a;for(;s-- >0;)if(a=n[s],t===a.toLowerCase())return a;return null}const hn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Ec=e=>!Pn(e)&&e!==hn;function Ia(){const{caseless:e,skipUndefined:t}=Ec(this)&&this||{},n={},s=(a,c)=>{const u=e&&Tc(n,c)||c;ss(n[u])&&ss(a)?n[u]=Ia(n[u],a):ss(a)?n[u]=Ia({},a):Rn(a)?n[u]=a.slice():(!t||!Pn(a))&&(n[u]=a)};for(let a=0,c=arguments.length;a<c;a++)arguments[a]&&hi(arguments[a],s);return n}const Up=(e,t,n,{allOwnKeys:s}={})=>(hi(t,(a,c)=>{n&&St(a)?e[c]=wc(a,n):e[c]=a},{allOwnKeys:s}),e),Ip=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Bp=(e,t,n,s)=>{e.prototype=Object.create(t.prototype,s),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},Fp=(e,t,n,s)=>{let a,c,u;const l={};if(t=t||{},e==null)return t;do{for(a=Object.getOwnPropertyNames(e),c=a.length;c-- >0;)u=a[c],(!s||s(u,e,t))&&!l[u]&&(t[u]=e[u],l[u]=!0);e=n!==!1&&Ua(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Wp=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const s=e.indexOf(t,n);return s!==-1&&s===n},Hp=e=>{if(!e)return null;if(Rn(e))return e;let t=e.length;if(!Sc(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Yp=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Ua(Uint8Array)),Kp=(e,t)=>{const s=(e&&e[rs]).call(e);let a;for(;(a=s.next())&&!a.done;){const c=a.value;t.call(e,c[0],c[1])}},qp=(e,t)=>{let n;const s=[];for(;(n=e.exec(t))!==null;)s.push(n);return s},$p=rr("HTMLFormElement"),Gp=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,s,a){return s.toUpperCase()+a}),Ac=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),zp=rr("RegExp"),Oc=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),s={};hi(n,(a,c)=>{let u;(u=t(a,c,e))!==!1&&(s[c]=u||a)}),Object.defineProperties(e,s)},Vp=e=>{Oc(e,(t,n)=>{if(St(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const s=e[n];if(St(s)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},jp=(e,t)=>{const n={},s=a=>{a.forEach(c=>{n[c]=!0})};return Rn(e)?s(e):s(String(e).split(t)),n},Jp=()=>{},Qp=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Zp(e){return!!(e&&St(e.append)&&e[bc]==="FormData"&&e[rs])}const Xp=e=>{const t=new Array(10),n=(s,a)=>{if(fi(s)){if(t.indexOf(s)>=0)return;if(li(s))return s;if(!("toJSON"in s)){t[a]=s;const c=Rn(s)?[]:{};return hi(s,(u,l)=>{const h=n(u,a+1);!Pn(h)&&(c[l]=h)}),t[a]=void 0,c}}return s};return n(e,0)},em=rr("AsyncFunction"),tm=e=>e&&(fi(e)||St(e))&&St(e.then)&&St(e.catch),xc=((e,t)=>e?setImmediate:t?((n,s)=>(hn.addEventListener("message",({source:a,data:c})=>{a===hn&&c===n&&s.length&&s.shift()()},!1),a=>{s.push(a),hn.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",St(hn.postMessage)),rm=typeof queueMicrotask<"u"?queueMicrotask.bind(hn):typeof process<"u"&&process.nextTick||xc,U={isArray:Rn,isArrayBuffer:vc,isBuffer:li,isFormData:kp,isArrayBufferView:bp,isString:vp,isNumber:Sc,isBoolean:Sp,isObject:fi,isPlainObject:ss,isEmptyObject:Tp,isReadableStream:Pp,isRequest:Dp,isResponse:Mp,isHeaders:Lp,isUndefined:Pn,isDate:Ep,isFile:Ap,isBlob:Op,isRegExp:zp,isFunction:St,isStream:Cp,isURLSearchParams:Rp,isTypedArray:Yp,isFileList:xp,forEach:hi,merge:Ia,extend:Up,trim:Np,stripBOM:Ip,inherits:Bp,toFlatObject:Fp,kindOf:ns,kindOfTest:rr,endsWith:Wp,toArray:Hp,forEachEntry:Kp,matchAll:qp,isHTMLForm:$p,hasOwnProperty:Ac,hasOwnProp:Ac,reduceDescriptors:Oc,freezeMethods:Vp,toObjectSet:jp,toCamelCase:Gp,noop:Jp,toFiniteNumber:Qp,findKey:Tc,global:hn,isContextDefined:Ec,isSpecCompliantForm:Zp,toJSONObject:Xp,isAsyncFn:em,isThenable:tm,setImmediate:xc,asap:rm,isIterable:e=>e!=null&&St(e[rs])};function fe(e,t,n,s,a){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),s&&(this.request=s),a&&(this.response=a,this.status=a.status?a.status:null)}U.inherits(fe,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 Cc=fe.prototype,kc={};["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(e=>{kc[e]={value:e}}),Object.defineProperties(fe,kc),Object.defineProperty(Cc,"isAxiosError",{value:!0}),fe.from=(e,t,n,s,a,c)=>{const u=Object.create(Cc);U.toFlatObject(e,u,function(b){return b!==Error.prototype},m=>m!=="isAxiosError");const l=e&&e.message?e.message:"Error",h=t==null&&e?e.code:t;return fe.call(u,l,h,n,s,a),e&&u.cause==null&&Object.defineProperty(u,"cause",{value:e,configurable:!0}),u.name=e&&e.name||"Error",c&&Object.assign(u,c),u};const nm=null;function Ba(e){return U.isPlainObject(e)||U.isArray(e)}function Rc(e){return U.endsWith(e,"[]")?e.slice(0,-2):e}function Pc(e,t,n){return e?e.concat(t).map(function(a,c){return a=Rc(a),!n&&c?"["+a+"]":a}).join(n?".":""):t}function im(e){return U.isArray(e)&&!e.some(Ba)}const sm=U.toFlatObject(U,{},null,function(t){return/^is[A-Z]/.test(t)});function as(e,t,n){if(!U.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=U.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(B,F){return!U.isUndefined(F[B])});const s=n.metaTokens,a=n.visitor||b,c=n.dots,u=n.indexes,h=(n.Blob||typeof Blob<"u"&&Blob)&&U.isSpecCompliantForm(t);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 fe("Blob is not supported. Use a Buffer instead.");return U.isArrayBuffer(O)||U.isTypedArray(O)?h&&typeof Blob=="function"?new Blob([O]):Buffer.from(O):O}function b(O,B,F){let re=O;if(O&&!F&&typeof O=="object"){if(U.endsWith(B,"{}"))B=s?B:B.slice(0,-2),O=JSON.stringify(O);else if(U.isArray(O)&&im(O)||(U.isFileList(O)||U.endsWith(B,"[]"))&&(re=U.toArray(O)))return B=Rc(B),re.forEach(function(Ee,ve){!(U.isUndefined(Ee)||Ee===null)&&t.append(u===!0?Pc([B],ve,c):u===null?B:B+"[]",m(Ee))}),!1}return Ba(O)?!0:(t.append(Pc(F,B,c),m(O)),!1)}const T=[],R=Object.assign(sm,{defaultVisitor:b,convertValue:m,isVisitable:Ba});function $(O,B){if(!U.isUndefined(O)){if(T.indexOf(O)!==-1)throw Error("Circular reference detected in "+B.join("."));T.push(O),U.forEach(O,function(re,Y){(!(U.isUndefined(re)||re===null)&&a.call(t,re,U.isString(Y)?Y.trim():Y,B,R))===!0&&$(re,B?B.concat(Y):[Y])}),T.pop()}}if(!U.isObject(e))throw new TypeError("data must be an object");return $(e),t}function Dc(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(s){return t[s]})}function Fa(e,t){this._pairs=[],e&&as(e,this,t)}const Mc=Fa.prototype;Mc.append=function(t,n){this._pairs.push([t,n])},Mc.toString=function(t){const n=t?function(s){return t.call(this,s,Dc)}:Dc;return this._pairs.map(function(a){return n(a[0])+"="+n(a[1])},"").join("&")};function am(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Lc(e,t,n){if(!t)return e;const s=n&&n.encode||am;U.isFunction(n)&&(n={serialize:n});const a=n&&n.serialize;let c;if(a?c=a(t,n):c=U.isURLSearchParams(t)?t.toString():new Fa(t,n).toString(s),c){const u=e.indexOf("#");u!==-1&&(e=e.slice(0,u)),e+=(e.indexOf("?")===-1?"?":"&")+c}return e}class Nc{constructor(){this.handlers=[]}use(t,n,s){return this.handlers.push({fulfilled:t,rejected:n,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){U.forEach(this.handlers,function(s){s!==null&&t(s)})}}const Uc={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},om={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Fa,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Wa=typeof window<"u"&&typeof document<"u",Ha=typeof navigator=="object"&&navigator||void 0,um=Wa&&(!Ha||["ReactNative","NativeScript","NS"].indexOf(Ha.product)<0),cm=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",lm=Wa&&window.location.href||"http://localhost",ft={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Wa,hasStandardBrowserEnv:um,hasStandardBrowserWebWorkerEnv:cm,navigator:Ha,origin:lm},Symbol.toStringTag,{value:"Module"})),...om};function fm(e,t){return as(e,new ft.classes.URLSearchParams,{visitor:function(n,s,a,c){return ft.isNode&&U.isBuffer(n)?(this.append(s,n.toString("base64")),!1):c.defaultVisitor.apply(this,arguments)},...t})}function hm(e){return U.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function dm(e){const t={},n=Object.keys(e);let s;const a=n.length;let c;for(s=0;s<a;s++)c=n[s],t[c]=e[c];return t}function Ic(e){function t(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]=[]),t(n,s,a[u],c)&&U.isArray(a[u])&&(a[u]=dm(a[u])),!l)}if(U.isFormData(e)&&U.isFunction(e.entries)){const n={};return U.forEachEntry(e,(s,a)=>{t(hm(s),a,n,0)}),n}return null}function pm(e,t,n){if(U.isString(e))try{return(t||JSON.parse)(e),U.trim(e)}catch(s){if(s.name!=="SyntaxError")throw s}return(n||JSON.stringify)(e)}const di={transitional:Uc,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const s=n.getContentType()||"",a=s.indexOf("application/json")>-1,c=U.isObject(t);if(c&&U.isHTMLForm(t)&&(t=new FormData(t)),U.isFormData(t))return a?JSON.stringify(Ic(t)):t;if(U.isArrayBuffer(t)||U.isBuffer(t)||U.isStream(t)||U.isFile(t)||U.isBlob(t)||U.isReadableStream(t))return t;if(U.isArrayBufferView(t))return t.buffer;if(U.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(c){if(s.indexOf("application/x-www-form-urlencoded")>-1)return fm(t,this.formSerializer).toString();if((l=U.isFileList(t))||s.indexOf("multipart/form-data")>-1){const h=this.env&&this.env.FormData;return as(l?{"files[]":t}:t,h&&new h,this.formSerializer)}}return c||a?(n.setContentType("application/json",!1),pm(t)):t}],transformResponse:[function(t){const n=this.transitional||di.transitional,s=n&&n.forcedJSONParsing,a=this.responseType==="json";if(U.isResponse(t)||U.isReadableStream(t))return t;if(t&&U.isString(t)&&(s&&!this.responseType||a)){const u=!(n&&n.silentJSONParsing)&&a;try{return JSON.parse(t,this.parseReviver)}catch(l){if(u)throw l.name==="SyntaxError"?fe.from(l,fe.ERR_BAD_RESPONSE,this,null,this.response):l}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ft.classes.FormData,Blob:ft.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};U.forEach(["delete","get","head","post","put","patch"],e=>{di.headers[e]={}});const mm=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"]),gm=e=>{const t={};let n,s,a;return e&&e.split(`
|
|
2
|
-
`).forEach(function(u){a=u.indexOf(":"),n=u.substring(0,a).trim().toLowerCase(),s=u.substring(a+1).trim(),!(!n||t[n]&&
|
|
3
|
-
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const s=new this(t);return n.forEach(a=>s.set(a)),s}static accessor(t){const s=(this[Bc]=this[Bc]={accessors:{}}).accessors,a=this.prototype;function c(u){const l=pi(u);s[l]||(bm(a,u),s[l]=!0)}return U.isArray(t)?t.forEach(c):c(t),this}};Tt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),U.reduceDescriptors(Tt.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(s){this[n]=s}}}),U.freezeMethods(Tt);function Ka(e,t){const n=this||di,s=t||n,a=Tt.from(s.headers);let c=s.data;return U.forEach(e,function(l){c=l.call(n,c,a.normalize(),t?t.status:void 0)}),a.normalize(),c}function Fc(e){return!!(e&&e.__CANCEL__)}function Dn(e,t,n){fe.call(this,e??"canceled",fe.ERR_CANCELED,t,n),this.name="CanceledError"}U.inherits(Dn,fe,{__CANCEL__:!0});function Wc(e,t,n){const s=n.config.validateStatus;!n.status||!s||s(n.status)?e(n):t(new fe("Request failed with status code "+n.status,[fe.ERR_BAD_REQUEST,fe.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function vm(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Sm(e,t){e=e||10;const n=new Array(e),s=new Array(e);let a=0,c=0,u;return t=t!==void 0?t:1e3,function(h){const m=Date.now(),b=s[c];u||(u=m),n[a]=h,s[a]=m;let T=c,R=0;for(;T!==a;)R+=n[T++],T=T%e;if(a=(a+1)%e,a===c&&(c=(c+1)%e),m-u<t)return;const $=b&&m-b;return $?Math.round(R*1e3/$):void 0}}function Tm(e,t){let n=0,s=1e3/t,a,c;const u=(m,b=Date.now())=>{n=b,a=null,c&&(clearTimeout(c),c=null),e(...m)};return[(...m)=>{const b=Date.now(),T=b-n;T>=s?u(m,b):(a=m,c||(c=setTimeout(()=>{c=null,u(a)},s-T)))},()=>a&&u(a)]}const us=(e,t,n=3)=>{let s=0;const a=Sm(50,250);return Tm(c=>{const u=c.loaded,l=c.lengthComputable?c.total:void 0,h=u-s,m=a(h),b=u<=l;s=u;const T={loaded:u,total:l,progress:l?u/l:void 0,bytes:h,rate:m||void 0,estimated:m&&l&&b?(l-u)/m:void 0,event:c,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(T)},n)},Hc=(e,t)=>{const n=e!=null;return[s=>t[0]({lengthComputable:n,total:e,loaded:s}),t[1]]},Yc=e=>(...t)=>U.asap(()=>e(...t)),Em=ft.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,ft.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(ft.origin),ft.navigator&&/(msie|trident)/i.test(ft.navigator.userAgent)):()=>!0,Am=ft.hasStandardBrowserEnv?{write(e,t,n,s,a,c){const u=[e+"="+encodeURIComponent(t)];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(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Om(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function xm(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Kc(e,t,n){let s=!Om(t);return e&&(s||n==!1)?xm(e,t):t}const qc=e=>e instanceof Tt?{...e}:e;function dn(e,t){t=t||{};const n={};function s(m,b,T,R){return U.isPlainObject(m)&&U.isPlainObject(b)?U.merge.call({caseless:R},m,b):U.isPlainObject(b)?U.merge({},b):U.isArray(b)?b.slice():b}function a(m,b,T,R){if(U.isUndefined(b)){if(!U.isUndefined(m))return s(void 0,m,T,R)}else return s(m,b,T,R)}function c(m,b){if(!U.isUndefined(b))return s(void 0,b)}function u(m,b){if(U.isUndefined(b)){if(!U.isUndefined(m))return s(void 0,m)}else return s(void 0,b)}function l(m,b,T){if(T in t)return s(m,b);if(T in e)return s(void 0,m)}const h={url:c,method:c,data:c,baseURL:u,transformRequest:u,transformResponse:u,paramsSerializer:u,timeout:u,timeoutMessage:u,withCredentials:u,withXSRFToken:u,adapter:u,responseType:u,xsrfCookieName:u,xsrfHeaderName:u,onUploadProgress:u,onDownloadProgress:u,decompress:u,maxContentLength:u,maxBodyLength:u,beforeRedirect:u,transport:u,httpAgent:u,httpsAgent:u,cancelToken:u,socketPath:u,responseEncoding:u,validateStatus:l,headers:(m,b,T)=>a(qc(m),qc(b),T,!0)};return U.forEach(Object.keys({...e,...t}),function(b){const T=h[b]||a,R=T(e[b],t[b],b);U.isUndefined(R)&&T!==l||(n[b]=R)}),n}const $c=e=>{const t=dn({},e);let{data:n,withXSRFToken:s,xsrfHeaderName:a,xsrfCookieName:c,headers:u,auth:l}=t;if(t.headers=u=Tt.from(u),t.url=Lc(Kc(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),l&&u.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),U.isFormData(n)){if(ft.hasStandardBrowserEnv||ft.hasStandardBrowserWebWorkerEnv)u.setContentType(void 0);else if(U.isFunction(n.getHeaders)){const h=n.getHeaders(),m=["content-type","content-length"];Object.entries(h).forEach(([b,T])=>{m.includes(b.toLowerCase())&&u.set(b,T)})}}if(ft.hasStandardBrowserEnv&&(s&&U.isFunction(s)&&(s=s(t)),s||s!==!1&&Em(t.url))){const h=a&&c&&Am.read(c);h&&u.set(a,h)}return t},Cm=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,s){const a=$c(e);let c=a.data;const u=Tt.from(a.headers).normalize();let{responseType:l,onUploadProgress:h,onDownloadProgress:m}=a,b,T,R,$,O;function B(){$&&$(),O&&O(),a.cancelToken&&a.cancelToken.unsubscribe(b),a.signal&&a.signal.removeEventListener("abort",b)}let F=new XMLHttpRequest;F.open(a.method.toUpperCase(),a.url,!0),F.timeout=a.timeout;function re(){if(!F)return;const Ee=Tt.from("getAllResponseHeaders"in F&&F.getAllResponseHeaders()),ye={data:!l||l==="text"||l==="json"?F.responseText:F.response,status:F.status,statusText:F.statusText,headers:Ee,config:e,request:F};Wc(function(ke){n(ke),B()},function(ke){s(ke),B()},ye),F=null}"onloadend"in F?F.onloadend=re:F.onreadystatechange=function(){!F||F.readyState!==4||F.status===0&&!(F.responseURL&&F.responseURL.indexOf("file:")===0)||setTimeout(re)},F.onabort=function(){F&&(s(new fe("Request aborted",fe.ECONNABORTED,e,F)),F=null)},F.onerror=function(ve){const ye=ve&&ve.message?ve.message:"Network Error",Be=new fe(ye,fe.ERR_NETWORK,e,F);Be.event=ve||null,s(Be),F=null},F.ontimeout=function(){let ve=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded";const ye=a.transitional||Uc;a.timeoutErrorMessage&&(ve=a.timeoutErrorMessage),s(new fe(ve,ye.clarifyTimeoutError?fe.ETIMEDOUT:fe.ECONNABORTED,e,F)),F=null},c===void 0&&u.setContentType(null),"setRequestHeader"in F&&U.forEach(u.toJSON(),function(ve,ye){F.setRequestHeader(ye,ve)}),U.isUndefined(a.withCredentials)||(F.withCredentials=!!a.withCredentials),l&&l!=="json"&&(F.responseType=a.responseType),m&&([R,O]=us(m,!0),F.addEventListener("progress",R)),h&&F.upload&&([T,$]=us(h),F.upload.addEventListener("progress",T),F.upload.addEventListener("loadend",$)),(a.cancelToken||a.signal)&&(b=Ee=>{F&&(s(!Ee||Ee.type?new Dn(null,e,F):Ee),F.abort(),F=null)},a.cancelToken&&a.cancelToken.subscribe(b),a.signal&&(a.signal.aborted?b():a.signal.addEventListener("abort",b)));const Y=vm(a.url);if(Y&&ft.protocols.indexOf(Y)===-1){s(new fe("Unsupported protocol "+Y+":",fe.ERR_BAD_REQUEST,e));return}F.send(c||null)})},km=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let s=new AbortController,a;const c=function(m){if(!a){a=!0,l();const b=m instanceof Error?m:this.reason;s.abort(b instanceof fe?b:new Dn(b instanceof Error?b.message:b))}};let u=t&&setTimeout(()=>{u=null,c(new fe(`timeout ${t} of ms exceeded`,fe.ETIMEDOUT))},t);const l=()=>{e&&(u&&clearTimeout(u),u=null,e.forEach(m=>{m.unsubscribe?m.unsubscribe(c):m.removeEventListener("abort",c)}),e=null)};e.forEach(m=>m.addEventListener("abort",c));const{signal:h}=s;return h.unsubscribe=()=>U.asap(l),h}},Rm=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let s=0,a;for(;s<n;)a=s+t,yield e.slice(s,a),s=a},Pm=async function*(e,t){for await(const n of Dm(e))yield*Rm(n,t)},Dm=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:s}=await t.read();if(n)break;yield s}}finally{await t.cancel()}},Gc=(e,t,n,s)=>{const a=Pm(e,t);let c=0,u,l=h=>{u||(u=!0,s&&s(h))};return new ReadableStream({async pull(h){try{const{done:m,value:b}=await a.next();if(m){l(),h.close();return}let T=b.byteLength;if(n){let R=c+=T;n(R)}h.enqueue(new Uint8Array(b))}catch(m){throw l(m),m}},cancel(h){return l(h),a.return()}},{highWaterMark:2})},zc=64*1024,{isFunction:cs}=U,Mm=(({Request:e,Response:t})=>({Request:e,Response:t}))(U.global),{ReadableStream:Vc,TextEncoder:jc}=U.global,Jc=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Lm=e=>{e=U.merge.call({skipUndefined:!0},Mm,e);const{fetch:t,Request:n,Response:s}=e,a=t?cs(t):typeof fetch=="function",c=cs(n),u=cs(s);if(!a)return!1;const l=a&&cs(Vc),h=a&&(typeof jc=="function"?(O=>B=>O.encode(B))(new jc):async O=>new Uint8Array(await new n(O).arrayBuffer())),m=c&&l&&Jc(()=>{let O=!1;const B=new n(ft.origin,{body:new Vc,method:"POST",get duplex(){return O=!0,"half"}}).headers.has("Content-Type");return O&&!B}),b=u&&l&&Jc(()=>U.isReadableStream(new s("").body)),T={stream:b&&(O=>O.body)};a&&["text","arrayBuffer","blob","formData","stream"].forEach(O=>{!T[O]&&(T[O]=(B,F)=>{let re=B&&B[O];if(re)return re.call(B);throw new fe(`Response type '${O}' is not supported`,fe.ERR_NOT_SUPPORT,F)})});const R=async O=>{if(O==null)return 0;if(U.isBlob(O))return O.size;if(U.isSpecCompliantForm(O))return(await new n(ft.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,B)=>{const F=U.toFiniteNumber(O.getContentLength());return F??R(B)};return async O=>{let{url:B,method:F,data:re,signal:Y,cancelToken:Ee,timeout:ve,onDownloadProgress:ye,onUploadProgress:Be,responseType:ke,headers:y,withCredentials:_="same-origin",fetchOptions:v}=$c(O),M=t||fetch;ke=ke?(ke+"").toLowerCase():"text";let x=km([Y,Ee&&Ee.toAbortSignal()],ve),P=null;const N=x&&x.unsubscribe&&(()=>{x.unsubscribe()});let E;try{if(Be&&m&&F!=="get"&&F!=="head"&&(E=await $(y,re))!==0){let J=new n(B,{method:"POST",body:re,duplex:"half"}),de;if(U.isFormData(re)&&(de=J.headers.get("content-type"))&&y.setContentType(de),J.body){const[Le,Fe]=Hc(E,us(Yc(Be)));re=Gc(J.body,zc,Le,Fe)}}U.isString(_)||(_=_?"include":"omit");const C=c&&"credentials"in n.prototype,L={...v,signal:x,method:F.toUpperCase(),headers:y.normalize().toJSON(),body:re,duplex:"half",credentials:C?_:void 0};P=c&&new n(B,L);let D=await(c?M(P,v):M(B,L));const q=b&&(ke==="stream"||ke==="response");if(b&&(ye||q&&N)){const J={};["status","statusText","headers"].forEach(ce=>{J[ce]=D[ce]});const de=U.toFiniteNumber(D.headers.get("content-length")),[Le,Fe]=ye&&Hc(de,us(Yc(ye),!0))||[];D=new s(Gc(D.body,zc,Le,()=>{Fe&&Fe(),N&&N()}),J)}ke=ke||"text";let X=await T[U.findKey(T,ke)||"text"](D,O);return!q&&N&&N(),await new Promise((J,de)=>{Wc(J,de,{data:X,headers:Tt.from(D.headers),status:D.status,statusText:D.statusText,config:O,request:P})})}catch(C){throw N&&N(),C&&C.name==="TypeError"&&/Load failed|fetch/i.test(C.message)?Object.assign(new fe("Network Error",fe.ERR_NETWORK,O,P),{cause:C.cause||C}):fe.from(C,C&&C.code,O,P)}}},Nm=new Map,Qc=e=>{let t=e?e.env:{};const{fetch:n,Request:s,Response:a}=t,c=[s,a,n];let u=c.length,l=u,h,m,b=Nm;for(;l--;)h=c[l],m=b.get(h),m===void 0&&b.set(h,m=l?new Map:Lm(t)),b=m;return m};Qc();const qa={http:nm,xhr:Cm,fetch:{get:Qc}};U.forEach(qa,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Zc=e=>`- ${e}`,Um=e=>U.isFunction(e)||e===null||e===!1,Xc={getAdapter:(e,t)=>{e=U.isArray(e)?e:[e];const{length:n}=e;let s,a;const c={};for(let u=0;u<n;u++){s=e[u];let l;if(a=s,!Um(s)&&(a=qa[(l=String(s)).toLowerCase()],a===void 0))throw new fe(`Unknown adapter '${l}'`);if(a&&(U.isFunction(a)||(a=a.get(t))))break;c[l||"#"+u]=a}if(!a){const u=Object.entries(c).map(([h,m])=>`adapter ${h} `+(m===!1?"is not supported by the environment":"is not available in the build"));let l=n?u.length>1?`since :
|
|
4
|
-
`+u.map(
|
|
5
|
-
`):" "+
|
|
6
|
-
`+c):s.stack=c}catch{}}throw s}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=dn(this.defaults,n);const{transitional:s,paramsSerializer:a,headers:c}=n;s!==void 0&&fs.assertOptions(s,{silentJSONParsing:pr.transitional(pr.boolean),forcedJSONParsing:pr.transitional(pr.boolean),clarifyTimeoutError:pr.transitional(pr.boolean)},!1),a!=null&&(U.isFunction(a)?n.paramsSerializer={serialize:a}:fs.assertOptions(a,{encode:pr.function,serialize:pr.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),fs.assertOptions(n,{baseUrl:pr.spelling("baseURL"),withXsrfToken:pr.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=Tt.concat(u,c);const l=[];let h=!0;this.interceptors.request.forEach(function(B){typeof B.runWhen=="function"&&B.runWhen(n)===!1||(h=h&&B.synchronous,l.unshift(B.fulfilled,B.rejected))});const m=[];this.interceptors.response.forEach(function(B){m.push(B.fulfilled,B.rejected)});let b,T=0,R;if(!h){const O=[el.bind(this),void 0];for(O.unshift(...l),O.push(...m),R=O.length,b=Promise.resolve(n);T<R;)b=b.then(O[T++],O[T++]);return b}R=l.length;let $=n;for(;T<R;){const O=l[T++],B=l[T++];try{$=O($)}catch(F){B.call(this,F);break}}try{b=el.call(this,$)}catch(O){return Promise.reject(O)}for(T=0,R=m.length;T<R;)b=b.then(m[T++],m[T++]);return b}getUri(t){t=dn(this.defaults,t);const n=Kc(t.baseURL,t.url,t.allowAbsoluteUrls);return Lc(n,t.params,t.paramsSerializer)}};U.forEach(["delete","get","head","options"],function(t){pn.prototype[t]=function(n,s){return this.request(dn(s||{},{method:t,url:n,data:(s||{}).data}))}}),U.forEach(["post","put","patch"],function(t){function n(s){return function(c,u,l){return this.request(dn(l||{},{method:t,headers:s?{"Content-Type":"multipart/form-data"}:{},url:c,data:u}))}}pn.prototype[t]=n(),pn.prototype[t+"Form"]=n(!0)});let Bm=class _p{constructor(t){if(typeof t!="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},t(function(c,u,l){s.reason||(s.reason=new Dn(c,u,l),n(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=s=>{t.abort(s)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new _p(function(a){t=a}),cancel:t}}};function Fm(e){return function(n){return e.apply(null,n)}}function Wm(e){return U.isObject(e)&&e.isAxiosError===!0}const Ga={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(Ga).forEach(([e,t])=>{Ga[t]=e});function nl(e){const t=new pn(e),n=wc(pn.prototype.request,t);return U.extend(n,pn.prototype,t,{allOwnKeys:!0}),U.extend(n,t,null,{allOwnKeys:!0}),n.create=function(a){return nl(dn(e,a))},n}const Je=nl(di);Je.Axios=pn,Je.CanceledError=Dn,Je.CancelToken=Bm,Je.isCancel=Fc,Je.VERSION=tl,Je.toFormData=as,Je.AxiosError=fe,Je.Cancel=Je.CanceledError,Je.all=function(t){return Promise.all(t)},Je.spread=Fm,Je.isAxiosError=Wm,Je.mergeConfig=dn,Je.AxiosHeaders=Tt,Je.formToJSON=e=>Ic(U.isHTMLForm(e)?new FormData(e):e),Je.getAdapter=Xc.getAdapter,Je.HttpStatusCode=Ga,Je.default=Je;const{Axios:ax,AxiosError:ox,CanceledError:ux,isCancel:cx,CancelToken:lx,VERSION:fx,all:hx,Cancel:dx,isAxiosError:px,spread:mx,toFormData:gx,AxiosHeaders:yx,HttpStatusCode:_x,formToJSON:wx,getAdapter:bx,mergeConfig:vx}=Je;var mi=e=>typeof e=="function"?e:function(){return e},Hm=typeof self<"u"?self:null,gi=typeof window<"u"?window:null,mr=Hm||gi||globalThis,Ym="2.0.0",gr={connecting:0,open:1,closing:2,closed:3},Km=1e4,qm=1e3,Rt={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},xr={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave"},za={longpoll:"longpoll",websocket:"websocket"},$m={complete:4},Va="base64url.bearer.phx.",hs=class{constructor(e,t,n,s){this.channel=e,this.event=t,this.payload=n||function(){return{}},this.receivedResp=null,this.timeout=s,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(s=>s.status===e).forEach(s=>s.callback(t))}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,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})}},il=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=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}},Gm=class{constructor(e,t,n){this.state=Rt.closed,this.topic=e,this.params=mi(t||{}),this.socket=n,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new hs(this,xr.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new il(()=>{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=Rt.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(s=>s.send()),this.pushBuffer=[]}),this.joinPush.receive("error",()=>{this.state=Rt.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=Rt.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=Rt.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 hs(this,xr.leave,mi({}),this.timeout).send(),this.state=Rt.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(xr.reply,(s,a)=>{this.trigger(this.replyEventName(a),s)})}join(e=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=e,this.joinedOnce=!0,this.rejoin(),this.joinPush}onClose(e){this.on(xr.close,e)}onError(e){return this.on(xr.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&&(typeof t>"u"||t===n.ref)))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(e,t,n=this.timeout){if(t=t||{},!this.joinedOnce)throw new Error(`tried to push '${e}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let s=new hs(this,e,function(){return t},n);return this.canPush()?s.send():(s.startTimeout(),this.pushBuffer.push(s)),s}leave(e=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=Rt.leaving;let t=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(xr.close,"leave")},n=new hs(this,xr.leave,mi({}),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,s){return this.topic!==e?!1:s&&s!==this.joinRef()?(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:e,event:t,payload:n,joinRef:s}),!1):!0}joinRef(){return this.joinPush.ref}rejoin(e=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=Rt.joining,this.joinPush.resend(e))}trigger(e,t,n,s){let a=this.onMessage(e,t,n,s);if(t&&!a)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let c=this.bindings.filter(u=>u.event===e);for(let u=0;u<c.length;u++)c[u].callback(a,n,s||this.joinRef())}replyEventName(e){return`chan_reply_${e}`}isClosed(){return this.state===Rt.closed}isErrored(){return this.state===Rt.errored}isJoined(){return this.state===Rt.joined}isJoining(){return this.state===Rt.joining}isLeaving(){return this.state===Rt.leaving}},ds=class{static request(e,t,n,s,a,c,u){if(mr.XDomainRequest){let l=new mr.XDomainRequest;return this.xdomainRequest(l,e,t,s,a,c,u)}else if(mr.XMLHttpRequest){let l=new mr.XMLHttpRequest;return this.xhrRequest(l,e,t,n,s,a,c,u)}else{if(mr.fetch&&mr.AbortController)return this.fetchRequest(e,t,n,s,a,c,u);throw new Error("No suitable XMLHttpRequest implementation found")}}static fetchRequest(e,t,n,s,a,c,u){let l={method:e,headers:n,body:s},h=null;return a&&(h=new AbortController,setTimeout(()=>h.abort(),a),l.signal=h.signal),mr.fetch(t,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(e,t,n,s,a,c,u){return e.timeout=a,e.open(t,n),e.onload=()=>{let l=this.parseJSON(e.responseText);u&&u(l)},c&&(e.ontimeout=c),e.onprogress=()=>{},e.send(s),e}static xhrRequest(e,t,n,s,a,c,u,l){e.open(t,n,!0),e.timeout=c;for(let[h,m]of Object.entries(s))e.setRequestHeader(h,m);return e.onerror=()=>l&&l(null),e.onreadystatechange=()=>{if(e.readyState===$m.complete&&l){let h=this.parseJSON(e.responseText);l(h)}},u&&(e.ontimeout=u),e.send(a),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 s in e){if(!Object.prototype.hasOwnProperty.call(e,s))continue;let a=t?`${t}[${s}]`:s,c=e[s];typeof c=="object"?n.push(this.serialize(c,a)):n.push(encodeURIComponent(a)+"="+encodeURIComponent(c))}return n.join("&")}static appendParams(e,t){if(Object.keys(t).length===0)return e;let n=e.match(/\?/)?"&":"?";return`${e}${n}${this.serialize(t)}`}},zm=e=>{let t="",n=new Uint8Array(e),s=n.byteLength;for(let a=0;a<s;a++)t+=String.fromCharCode(n[a]);return btoa(t)},yi=class{constructor(e,t){t&&t.length===2&&t[1].startsWith(Va)&&(this.authToken=atob(t[1].slice(Va.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=gr.connecting,setTimeout(()=>this.poll(),0)}normalizeEndpoint(e){return e.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+za.websocket),"$1/"+za.longpoll)}endpointURL(){return ds.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(e,t,n){this.close(e,t,n),this.readyState=gr.connecting}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return this.readyState===gr.open||this.readyState===gr.connecting}poll(){const e={Accept:"application/json"};this.authToken&&(e["X-Phoenix-AuthToken"]=this.authToken),this.ajax("GET",e,null,()=>this.ontimeout(),t=>{if(t){var{status:n,token:s,messages:a}=t;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=gr.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(e){typeof e!="string"&&(e=zm(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){this.awaitingBatchAck=!0,this.ajax("POST",{"Content-Type":"application/x-ndjson"},e.join(`
|
|
7
|
-
`),()=>this.onerror("timeout"),t=>{this.awaitingBatchAck=!1,!t||t.status!==200?(this.onerror(t&&t.status),this.closeAndRetry(1011,"internal server error",!1)):this.batchBuffer.length>0&&(this.batchSend(this.batchBuffer),this.batchBuffer=[])})}close(e,t,n){for(let a of this.reqs)a.abort();this.readyState=gr.closed;let s=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:e,reason:t,wasClean:n});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,typeof CloseEvent<"u"?this.onclose(new CloseEvent("close",s)):this.onclose(s)}ajax(e,t,n,s,a){let c,u=()=>{this.reqs.delete(c),s()};c=ds.request(e,this.endpointURL(),t,n,this.timeout,u,l=>{this.reqs.delete(c),this.isActive()&&a(l)}),this.reqs.add(c)}},ps={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,s,a,c,u]=JSON.parse(e);return t({join_ref:n,ref:s,topic:a,event:c,payload:u})}},binaryEncode(e){let{join_ref:t,ref:n,event:s,topic:a,payload:c}=e,u=this.META_LENGTH+t.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++,t.length),h.setUint8(m++,n.length),h.setUint8(m++,a.length),h.setUint8(m++,s.length),Array.from(t,T=>h.setUint8(m++,T.charCodeAt(0))),Array.from(n,T=>h.setUint8(m++,T.charCodeAt(0))),Array.from(a,T=>h.setUint8(m++,T.charCodeAt(0))),Array.from(s,T=>h.setUint8(m++,T.charCodeAt(0)));var b=new Uint8Array(l.byteLength+c.byteLength);return b.set(new Uint8Array(l),0),b.set(new Uint8Array(c),l.byteLength),b.buffer},binaryDecode(e){let t=new DataView(e),n=t.getUint8(0),s=new TextDecoder;switch(n){case this.KINDS.push:return this.decodePush(e,t,s);case this.KINDS.reply:return this.decodeReply(e,t,s);case this.KINDS.broadcast:return this.decodeBroadcast(e,t,s)}},decodePush(e,t,n){let s=t.getUint8(1),a=t.getUint8(2),c=t.getUint8(3),u=this.HEADER_LENGTH+this.META_LENGTH-1,l=n.decode(e.slice(u,u+s));u=u+s;let h=n.decode(e.slice(u,u+a));u=u+a;let m=n.decode(e.slice(u,u+c));u=u+c;let b=e.slice(u,e.byteLength);return{join_ref:l,ref:null,topic:h,event:m,payload:b}},decodeReply(e,t,n){let s=t.getUint8(1),a=t.getUint8(2),c=t.getUint8(3),u=t.getUint8(4),l=this.HEADER_LENGTH+this.META_LENGTH,h=n.decode(e.slice(l,l+s));l=l+s;let m=n.decode(e.slice(l,l+a));l=l+a;let b=n.decode(e.slice(l,l+c));l=l+c;let T=n.decode(e.slice(l,l+u));l=l+u;let R=e.slice(l,e.byteLength),$={status:T,response:R};return{join_ref:h,ref:m,topic:b,event:xr.reply,payload:$}},decodeBroadcast(e,t,n){let s=t.getUint8(1),a=t.getUint8(2),c=this.HEADER_LENGTH+2,u=n.decode(e.slice(c,c+s));c=c+s;let l=n.decode(e.slice(c,c+a));c=c+a;let h=e.slice(c,e.byteLength);return{join_ref:null,ref:null,topic:u,event:l,payload:h}}},Vm=class{constructor(e,t={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.timeout=t.timeout||Km,this.transport=t.transport||mr.WebSocket||yi,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=t.longPollFallbackMs,this.fallbackTimer=null,this.sessionStore=t.sessionStorage||mr&&mr.sessionStorage,this.establishedConnections=0,this.defaultEncoder=ps.encode.bind(ps),this.defaultDecoder=ps.decode.bind(ps),this.closeWasClean=!1,this.disconnecting=!1,this.binaryType=t.binaryType||"arraybuffer",this.connectClock=1,this.transport!==yi?(this.encode=t.encode||this.defaultEncoder,this.decode=t.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let n=null;gi&&gi.addEventListener&&(gi.addEventListener("pagehide",s=>{this.conn&&(this.disconnect(),n=this.connectClock)}),gi.addEventListener("pageshow",s=>{n===this.connectClock&&(n=null,this.connect())})),this.heartbeatIntervalMs=t.heartbeatIntervalMs||3e4,this.rejoinAfterMs=s=>t.rejoinAfterMs?t.rejoinAfterMs(s):[1e3,2e3,5e3][s-1]||1e4,this.reconnectAfterMs=s=>t.reconnectAfterMs?t.reconnectAfterMs(s):[10,50,100,150,200,250,500,1e3,2e3][s-1]||5e3,this.logger=t.logger||null,!this.logger&&t.debug&&(this.logger=(s,a,c)=>{console.log(`${s}: ${a}`,c)}),this.longpollerTimeout=t.longpollerTimeout||2e4,this.params=mi(t.params||{}),this.endPoint=`${e}/${za.websocket}`,this.vsn=t.vsn||Ym,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new il(()=>{this.teardown(()=>this.connect())},this.reconnectAfterMs),this.authToken=t.authToken}getLongPollTransport(){return yi}replaceTransport(e){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&(this.conn.close(),this.conn=null),this.transport=e}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let e=ds.appendParams(ds.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return e.charAt(0)!=="/"?e:e.charAt(1)==="/"?`${this.protocol()}:${e}`:`${this.protocol()}://${location.host}${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=mi(e)),!(this.conn&&!this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==yi?this.connectWithFallback(yi,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 s=this.onMessage(a=>{a.ref===t&&(this.off([s]),e(Date.now()-n))});return!0}transportConnect(){this.connectClock++,this.closeWasClean=!1;let e;this.authToken&&(e=["phoenix",`${Va}${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=t=>this.onConnError(t),this.conn.onmessage=t=>this.onConnMessage(t),this.conn.onclose=t=>this.onConnClose(t)}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,s=!0,a,c,u=l=>{this.log("transport",`falling back to ${e.name}...`,l),this.off([a,c]),s=!1,this.replaceTransport(e),this.transportConnect()};if(this.getSession(`phx:fallback:${e.name}`))return u("memorized");this.fallbackTimer=setTimeout(u,t),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:${e.name}`,"true"),this.log("transport",`established ${e.name} fallback`);clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(u,t),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(([,e])=>e())}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(),qm,"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 s=this.connectClock;this.waitForBufferDone(()=>{s===this.connectClock&&(this.conn&&(t?this.conn.close(t,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),e&&e())}))})}waitForBufferDone(e,t=1){if(t===5||!this.conn||!this.conn.bufferedAmount){e();return}setTimeout(()=>{this.waitForBufferDone(e,t+1)},150*t)}waitForSocketClosed(e,t=1){if(t===5||!this.conn||this.conn.readyState===gr.closed){e();return}setTimeout(()=>{this.waitForSocketClosed(e,t+1)},150*t)}onConnClose(e){let t=e&&e.code;this.hasLogger()&&this.log("transport","close",e),this.triggerChanError(),this.clearHeartbeats(),!this.closeWasClean&&t!==1e3&&this.reconnectTimer.scheduleTimeout(),this.stateChangeCallbacks.close.forEach(([,n])=>n(e))}onConnError(e){this.hasLogger()&&this.log("transport",e);let t=this.transport,n=this.establishedConnections;this.stateChangeCallbacks.error.forEach(([,s])=>{s(e,t,n)}),(t===this.transport||n>0)&&this.triggerChanError()}triggerChanError(){this.channels.forEach(e=>{e.isErrored()||e.isLeaving()||e.isClosed()||e.trigger(xr.error)})}connectionState(){switch(this.conn&&this.conn.readyState){case gr.connecting:return"connecting";case gr.open:return"open";case gr.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(([n])=>e.indexOf(n)===-1)}channel(e,t={}){let n=new Gm(e,t,this);return this.channels.push(n),n}push(e){if(this.hasLogger()){let{topic:t,event:n,payload:s,ref:a,join_ref:c}=e;this.log("push",`${t} ${n} (${c}, ${a})`,s)}this.isConnected()?this.encode(e,t=>this.conn.send(t)):this.sendBuffer.push(()=>this.encode(e,t=>this.conn.send(t)))}makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=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,t=>{let{topic:n,event:s,payload:a,ref:c,join_ref:u}=t;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(t)}})}leaveOpenTopic(e){let t=this.channels.find(n=>n.topic===e&&(n.isJoined()||n.isJoining()));t&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${e}"`),t.leave())}},ms=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function sl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var _i={exports:{}};/**
|
|
1
|
+
var Coinray=(function(ee){"use strict";function Lc(e,t){return function(){return e.apply(t,arguments)}}const{toString:Lp}=Object.prototype,{getPrototypeOf:Ka}=Object,{iterator:is,toStringTag:Nc}=Symbol,ss=(e=>t=>{const n=Lp.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),ir=e=>(e=e.toLowerCase(),t=>ss(t)===e),as=e=>t=>typeof t===e,{isArray:Ln}=Array,Nn=as("undefined");function fi(e){return e!==null&&!Nn(e)&&e.constructor!==null&&!Nn(e.constructor)&&Tt(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Uc=ir("ArrayBuffer");function Np(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Uc(e.buffer),t}const Up=as("string"),Tt=as("function"),Bc=as("number"),hi=e=>e!==null&&typeof e=="object",Bp=e=>e===!0||e===!1,os=e=>{if(ss(e)!=="object")return!1;const t=Ka(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Nc in e)&&!(is in e)},Ip=e=>{if(!hi(e)||fi(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Fp=ir("Date"),Wp=ir("File"),Hp=ir("Blob"),Yp=ir("FileList"),Kp=e=>hi(e)&&Tt(e.pipe),qp=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Tt(e.append)&&((t=ss(e))==="formdata"||t==="object"&&Tt(e.toString)&&e.toString()==="[object FormData]"))},$p=ir("URLSearchParams"),[Gp,Vp,zp,jp]=["ReadableStream","Request","Response","Headers"].map(ir),Jp=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function di(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let s,a;if(typeof e!="object"&&(e=[e]),Ln(e))for(s=0,a=e.length;s<a;s++)t.call(null,e[s],s,e);else{if(fi(e))return;const c=n?Object.getOwnPropertyNames(e):Object.keys(e),u=c.length;let l;for(s=0;s<u;s++)l=c[s],t.call(null,e[l],l,e)}}function Ic(e,t){if(fi(e))return null;t=t.toLowerCase();const n=Object.keys(e);let s=n.length,a;for(;s-- >0;)if(a=n[s],t===a.toLowerCase())return a;return null}const dn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Fc=e=>!Nn(e)&&e!==dn;function qa(){const{caseless:e,skipUndefined:t}=Fc(this)&&this||{},n={},s=(a,c)=>{const u=e&&Ic(n,c)||c;os(n[u])&&os(a)?n[u]=qa(n[u],a):os(a)?n[u]=qa({},a):Ln(a)?n[u]=a.slice():(!t||!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=(e,t,n,{allOwnKeys:s}={})=>(di(t,(a,c)=>{n&&Tt(a)?e[c]=Lc(a,n):e[c]=a},{allOwnKeys:s}),e),Zp=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Xp=(e,t,n,s)=>{e.prototype=Object.create(t.prototype,s),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},em=(e,t,n,s)=>{let a,c,u;const l={};if(t=t||{},e==null)return t;do{for(a=Object.getOwnPropertyNames(e),c=a.length;c-- >0;)u=a[c],(!s||s(u,e,t))&&!l[u]&&(t[u]=e[u],l[u]=!0);e=n!==!1&&Ka(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},tm=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const s=e.indexOf(t,n);return s!==-1&&s===n},rm=e=>{if(!e)return null;if(Ln(e))return e;let t=e.length;if(!Bc(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},nm=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Ka(Uint8Array)),im=(e,t)=>{const s=(e&&e[is]).call(e);let a;for(;(a=s.next())&&!a.done;){const c=a.value;t.call(e,c[0],c[1])}},sm=(e,t)=>{let n;const s=[];for(;(n=e.exec(t))!==null;)s.push(n);return s},am=ir("HTMLFormElement"),om=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,s,a){return s.toUpperCase()+a}),Wc=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),um=ir("RegExp"),Hc=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),s={};di(n,(a,c)=>{let u;(u=t(a,c,e))!==!1&&(s[c]=u||a)}),Object.defineProperties(e,s)},cm=e=>{Hc(e,(t,n)=>{if(Tt(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const s=e[n];if(Tt(s)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},lm=(e,t)=>{const n={},s=a=>{a.forEach(c=>{n[c]=!0})};return Ln(e)?s(e):s(String(e).split(t)),n},fm=()=>{},hm=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function dm(e){return!!(e&&Tt(e.append)&&e[Nc]==="FormData"&&e[is])}const pm=e=>{const t=new Array(10),n=(s,a)=>{if(hi(s)){if(t.indexOf(s)>=0)return;if(fi(s))return s;if(!("toJSON"in s)){t[a]=s;const c=Ln(s)?[]:{};return di(s,(u,l)=>{const h=n(u,a+1);!Nn(h)&&(c[l]=h)}),t[a]=void 0,c}}return s};return n(e,0)},mm=ir("AsyncFunction"),gm=e=>e&&(hi(e)||Tt(e))&&Tt(e.then)&&Tt(e.catch),Yc=((e,t)=>e?setImmediate:t?((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",Tt(dn.postMessage)),ym=typeof queueMicrotask<"u"?queueMicrotask.bind(dn):typeof process<"u"&&process.nextTick||Yc,U={isArray:Ln,isArrayBuffer:Uc,isBuffer:fi,isFormData:qp,isArrayBufferView:Np,isString:Up,isNumber:Bc,isBoolean:Bp,isObject:hi,isPlainObject:os,isEmptyObject:Ip,isReadableStream:Gp,isRequest:Vp,isResponse:zp,isHeaders:jp,isUndefined:Nn,isDate:Fp,isFile:Wp,isBlob:Hp,isRegExp:um,isFunction:Tt,isStream:Kp,isURLSearchParams:$p,isTypedArray:nm,isFileList:Yp,forEach:di,merge:qa,extend:Qp,trim:Jp,stripBOM:Zp,inherits:Xp,toFlatObject:em,kindOf:ss,kindOfTest:ir,endsWith:tm,toArray:rm,forEachEntry:im,matchAll:sm,isHTMLForm:am,hasOwnProperty:Wc,hasOwnProp:Wc,reduceDescriptors:Hc,freezeMethods:cm,toObjectSet:lm,toCamelCase:om,noop:fm,toFiniteNumber:hm,findKey:Ic,global:dn,isContextDefined:Fc,isSpecCompliantForm:dm,toJSONObject:pm,isAsyncFn:mm,isThenable:gm,setImmediate:Yc,asap:ym,isIterable:e=>e!=null&&Tt(e[is])};function he(e,t,n,s,a){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),s&&(this.request=s),a&&(this.response=a,this.status=a.status?a.status:null)}U.inherits(he,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:U.toJSONObject(this.config),code:this.code,status:this.status}}});const Kc=he.prototype,qc={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{qc[e]={value:e}}),Object.defineProperties(he,qc),Object.defineProperty(Kc,"isAxiosError",{value:!0}),he.from=(e,t,n,s,a,c)=>{const u=Object.create(Kc);U.toFlatObject(e,u,function(b){return b!==Error.prototype},m=>m!=="isAxiosError");const l=e&&e.message?e.message:"Error",h=t==null&&e?e.code:t;return he.call(u,l,h,n,s,a),e&&u.cause==null&&Object.defineProperty(u,"cause",{value:e,configurable:!0}),u.name=e&&e.name||"Error",c&&Object.assign(u,c),u};const _m=null;function $a(e){return U.isPlainObject(e)||U.isArray(e)}function $c(e){return U.endsWith(e,"[]")?e.slice(0,-2):e}function Gc(e,t,n){return e?e.concat(t).map(function(a,c){return a=$c(a),!n&&c?"["+a+"]":a}).join(n?".":""):t}function wm(e){return U.isArray(e)&&!e.some($a)}const bm=U.toFlatObject(U,{},null,function(t){return/^is[A-Z]/.test(t)});function us(e,t,n){if(!U.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=U.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(I,F){return!U.isUndefined(F[I])});const s=n.metaTokens,a=n.visitor||b,c=n.dots,u=n.indexes,h=(n.Blob||typeof Blob<"u"&&Blob)&&U.isSpecCompliantForm(t);if(!U.isFunction(a))throw new TypeError("visitor must be a function");function m(O){if(O===null)return"";if(U.isDate(O))return O.toISOString();if(U.isBoolean(O))return O.toString();if(!h&&U.isBlob(O))throw new he("Blob is not supported. Use a Buffer instead.");return U.isArrayBuffer(O)||U.isTypedArray(O)?h&&typeof Blob=="function"?new Blob([O]):Buffer.from(O):O}function b(O,I,F){let ne=O;if(O&&!F&&typeof O=="object"){if(U.endsWith(I,"{}"))I=s?I:I.slice(0,-2),O=JSON.stringify(O);else if(U.isArray(O)&&wm(O)||(U.isFileList(O)||U.endsWith(I,"[]"))&&(ne=U.toArray(O)))return I=$c(I),ne.forEach(function(Ae,Se){!(U.isUndefined(Ae)||Ae===null)&&t.append(u===!0?Gc([I],Se,c):u===null?I:I+"[]",m(Ae))}),!1}return $a(O)?!0:(t.append(Gc(F,I,c),m(O)),!1)}const E=[],R=Object.assign(bm,{defaultVisitor:b,convertValue:m,isVisitable:$a});function $(O,I){if(!U.isUndefined(O)){if(E.indexOf(O)!==-1)throw Error("Circular reference detected in "+I.join("."));E.push(O),U.forEach(O,function(ne,Y){(!(U.isUndefined(ne)||ne===null)&&a.call(t,ne,U.isString(Y)?Y.trim():Y,I,R))===!0&&$(ne,I?I.concat(Y):[Y])}),E.pop()}}if(!U.isObject(e))throw new TypeError("data must be an object");return $(e),t}function Vc(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(s){return t[s]})}function Ga(e,t){this._pairs=[],e&&us(e,this,t)}const zc=Ga.prototype;zc.append=function(t,n){this._pairs.push([t,n])},zc.toString=function(t){const n=t?function(s){return t.call(this,s,Vc)}:Vc;return this._pairs.map(function(a){return n(a[0])+"="+n(a[1])},"").join("&")};function vm(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function jc(e,t,n){if(!t)return e;const s=n&&n.encode||vm;U.isFunction(n)&&(n={serialize:n});const a=n&&n.serialize;let c;if(a?c=a(t,n):c=U.isURLSearchParams(t)?t.toString():new Ga(t,n).toString(s),c){const u=e.indexOf("#");u!==-1&&(e=e.slice(0,u)),e+=(e.indexOf("?")===-1?"?":"&")+c}return e}class Jc{constructor(){this.handlers=[]}use(t,n,s){return this.handlers.push({fulfilled:t,rejected:n,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){U.forEach(this.handlers,function(s){s!==null&&t(s)})}}const Qc={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"]},Va=typeof window<"u"&&typeof document<"u",za=typeof navigator=="object"&&navigator||void 0,Em=Va&&(!za||["ReactNative","NativeScript","NS"].indexOf(za.product)<0),Tm=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Am=Va&&window.location.href||"http://localhost",dt={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Va,hasStandardBrowserEnv:Em,hasStandardBrowserWebWorkerEnv:Tm,navigator:za,origin:Am},Symbol.toStringTag,{value:"Module"})),...Sm};function Om(e,t){return us(e,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)},...t})}function Cm(e){return U.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function km(e){const t={},n=Object.keys(e);let s;const a=n.length;let c;for(s=0;s<a;s++)c=n[s],t[c]=e[c];return t}function Zc(e){function t(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]=[]),t(n,s,a[u],c)&&U.isArray(a[u])&&(a[u]=km(a[u])),!l)}if(U.isFormData(e)&&U.isFunction(e.entries)){const n={};return U.forEachEntry(e,(s,a)=>{t(Cm(s),a,n,0)}),n}return null}function xm(e,t,n){if(U.isString(e))try{return(t||JSON.parse)(e),U.trim(e)}catch(s){if(s.name!=="SyntaxError")throw s}return(n||JSON.stringify)(e)}const pi={transitional:Qc,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const s=n.getContentType()||"",a=s.indexOf("application/json")>-1,c=U.isObject(t);if(c&&U.isHTMLForm(t)&&(t=new FormData(t)),U.isFormData(t))return a?JSON.stringify(Zc(t)):t;if(U.isArrayBuffer(t)||U.isBuffer(t)||U.isStream(t)||U.isFile(t)||U.isBlob(t)||U.isReadableStream(t))return t;if(U.isArrayBufferView(t))return t.buffer;if(U.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(c){if(s.indexOf("application/x-www-form-urlencoded")>-1)return Om(t,this.formSerializer).toString();if((l=U.isFileList(t))||s.indexOf("multipart/form-data")>-1){const h=this.env&&this.env.FormData;return us(l?{"files[]":t}:t,h&&new h,this.formSerializer)}}return c||a?(n.setContentType("application/json",!1),xm(t)):t}],transformResponse:[function(t){const n=this.transitional||pi.transitional,s=n&&n.forcedJSONParsing,a=this.responseType==="json";if(U.isResponse(t)||U.isReadableStream(t))return t;if(t&&U.isString(t)&&(s&&!this.responseType||a)){const u=!(n&&n.silentJSONParsing)&&a;try{return JSON.parse(t,this.parseReviver)}catch(l){if(u)throw l.name==="SyntaxError"?he.from(l,he.ERR_BAD_RESPONSE,this,null,this.response):l}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:dt.classes.FormData,Blob:dt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};U.forEach(["delete","get","head","post","put","patch"],e=>{pi.headers[e]={}});const Rm=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"]),Pm=e=>{const t={};let n,s,a;return e&&e.split(`
|
|
2
|
+
`).forEach(function(u){a=u.indexOf(":"),n=u.substring(0,a).trim().toLowerCase(),s=u.substring(a+1).trim(),!(!n||t[n]&&Rm[n])&&(n==="set-cookie"?t[n]?t[n].push(s):t[n]=[s]:t[n]=t[n]?t[n]+", "+s:s)}),t},Xc=Symbol("internals");function mi(e){return e&&String(e).trim().toLowerCase()}function cs(e){return e===!1||e==null?e:U.isArray(e)?e.map(cs):String(e)}function Dm(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=n.exec(e);)t[s[1]]=s[2];return t}const Mm=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function ja(e,t,n,s,a){if(U.isFunction(s))return s.call(this,t,n);if(a&&(t=n),!!U.isString(t)){if(U.isString(s))return t.indexOf(s)!==-1;if(U.isRegExp(s))return s.test(t)}}function Lm(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,s)=>n.toUpperCase()+s)}function Nm(e,t){const n=U.toCamelCase(" "+t);["get","set","has"].forEach(s=>{Object.defineProperty(e,s+n,{value:function(a,c,u){return this[s].call(this,t,a,c,u)},configurable:!0})})}let At=class{constructor(t){t&&this.set(t)}set(t,n,s){const a=this;function c(l,h,m){const b=mi(h);if(!b)throw new Error("header name must be a non-empty string");const E=U.findKey(a,b);(!E||a[E]===void 0||m===!0||m===void 0&&a[E]!==!1)&&(a[E||h]=cs(l))}const u=(l,h)=>U.forEach(l,(m,b)=>c(m,b,h));if(U.isPlainObject(t)||t instanceof this.constructor)u(t,n);else if(U.isString(t)&&(t=t.trim())&&!Mm(t))u(Pm(t),n);else if(U.isObject(t)&&U.isIterable(t)){let l={},h,m;for(const b of t){if(!U.isArray(b))throw TypeError("Object iterator must return a key-value pair");l[m=b[0]]=(h=l[m])?U.isArray(h)?[...h,b[1]]:[h,b[1]]:b[1]}u(l,n)}else t!=null&&c(n,t,s);return this}get(t,n){if(t=mi(t),t){const s=U.findKey(this,t);if(s){const a=this[s];if(!n)return a;if(n===!0)return Dm(a);if(U.isFunction(n))return n.call(this,a,s);if(U.isRegExp(n))return n.exec(a);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=mi(t),t){const s=U.findKey(this,t);return!!(s&&this[s]!==void 0&&(!n||ja(this,this[s],s,n)))}return!1}delete(t,n){const s=this;let a=!1;function c(u){if(u=mi(u),u){const l=U.findKey(s,u);l&&(!n||ja(s,s[l],l,n))&&(delete s[l],a=!0)}}return U.isArray(t)?t.forEach(c):c(t),a}clear(t){const n=Object.keys(this);let s=n.length,a=!1;for(;s--;){const c=n[s];(!t||ja(this,this[c],c,t,!0))&&(delete this[c],a=!0)}return a}normalize(t){const n=this,s={};return U.forEach(this,(a,c)=>{const u=U.findKey(s,c);if(u){n[u]=cs(a),delete n[c];return}const l=t?Lm(c):String(c).trim();l!==c&&delete n[c],n[l]=cs(a),s[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return U.forEach(this,(s,a)=>{s!=null&&s!==!1&&(n[a]=t&&U.isArray(s)?s.join(", "):s)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
|
|
3
|
+
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const s=new this(t);return n.forEach(a=>s.set(a)),s}static accessor(t){const s=(this[Xc]=this[Xc]={accessors:{}}).accessors,a=this.prototype;function c(u){const l=mi(u);s[l]||(Nm(a,u),s[l]=!0)}return U.isArray(t)?t.forEach(c):c(t),this}};At.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),U.reduceDescriptors(At.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(s){this[n]=s}}}),U.freezeMethods(At);function Ja(e,t){const n=this||pi,s=t||n,a=At.from(s.headers);let c=s.data;return U.forEach(e,function(l){c=l.call(n,c,a.normalize(),t?t.status:void 0)}),a.normalize(),c}function el(e){return!!(e&&e.__CANCEL__)}function Un(e,t,n){he.call(this,e??"canceled",he.ERR_CANCELED,t,n),this.name="CanceledError"}U.inherits(Un,he,{__CANCEL__:!0});function tl(e,t,n){const s=n.config.validateStatus;!n.status||!s||s(n.status)?e(n):t(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(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Bm(e,t){e=e||10;const n=new Array(e),s=new Array(e);let a=0,c=0,u;return t=t!==void 0?t:1e3,function(h){const m=Date.now(),b=s[c];u||(u=m),n[a]=h,s[a]=m;let E=c,R=0;for(;E!==a;)R+=n[E++],E=E%e;if(a=(a+1)%e,a===c&&(c=(c+1)%e),m-u<t)return;const $=b&&m-b;return $?Math.round(R*1e3/$):void 0}}function Im(e,t){let n=0,s=1e3/t,a,c;const u=(m,b=Date.now())=>{n=b,a=null,c&&(clearTimeout(c),c=null),e(...m)};return[(...m)=>{const b=Date.now(),E=b-n;E>=s?u(m,b):(a=m,c||(c=setTimeout(()=>{c=null,u(a)},s-E)))},()=>a&&u(a)]}const ls=(e,t,n=3)=>{let s=0;const a=Bm(50,250);return Im(c=>{const u=c.loaded,l=c.lengthComputable?c.total:void 0,h=u-s,m=a(h),b=u<=l;s=u;const E={loaded:u,total:l,progress:l?u/l:void 0,bytes:h,rate:m||void 0,estimated:m&&l&&b?(l-u)/m:void 0,event:c,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(E)},n)},rl=(e,t)=>{const n=e!=null;return[s=>t[0]({lengthComputable:n,total:e,loaded:s}),t[1]]},nl=e=>(...t)=>U.asap(()=>e(...t)),Fm=dt.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,dt.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(dt.origin),dt.navigator&&/(msie|trident)/i.test(dt.navigator.userAgent)):()=>!0,Wm=dt.hasStandardBrowserEnv?{write(e,t,n,s,a,c){const u=[e+"="+encodeURIComponent(t)];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(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Hm(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Ym(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function il(e,t,n){let s=!Hm(t);return e&&(s||n==!1)?Ym(e,t):t}const sl=e=>e instanceof At?{...e}:e;function pn(e,t){t=t||{};const n={};function s(m,b,E,R){return U.isPlainObject(m)&&U.isPlainObject(b)?U.merge.call({caseless:R},m,b):U.isPlainObject(b)?U.merge({},b):U.isArray(b)?b.slice():b}function a(m,b,E,R){if(U.isUndefined(b)){if(!U.isUndefined(m))return s(void 0,m,E,R)}else return s(m,b,E,R)}function c(m,b){if(!U.isUndefined(b))return s(void 0,b)}function u(m,b){if(U.isUndefined(b)){if(!U.isUndefined(m))return s(void 0,m)}else return s(void 0,b)}function l(m,b,E){if(E in t)return s(m,b);if(E in e)return s(void 0,m)}const h={url:c,method:c,data:c,baseURL:u,transformRequest:u,transformResponse:u,paramsSerializer:u,timeout:u,timeoutMessage:u,withCredentials:u,withXSRFToken:u,adapter:u,responseType:u,xsrfCookieName:u,xsrfHeaderName:u,onUploadProgress:u,onDownloadProgress:u,decompress:u,maxContentLength:u,maxBodyLength:u,beforeRedirect:u,transport:u,httpAgent:u,httpsAgent:u,cancelToken:u,socketPath:u,responseEncoding:u,validateStatus:l,headers:(m,b,E)=>a(sl(m),sl(b),E,!0)};return U.forEach(Object.keys({...e,...t}),function(b){const E=h[b]||a,R=E(e[b],t[b],b);U.isUndefined(R)&&E!==l||(n[b]=R)}),n}const al=e=>{const t=pn({},e);let{data:n,withXSRFToken:s,xsrfHeaderName:a,xsrfCookieName:c,headers:u,auth:l}=t;if(t.headers=u=At.from(u),t.url=jc(il(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),l&&u.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),U.isFormData(n)){if(dt.hasStandardBrowserEnv||dt.hasStandardBrowserWebWorkerEnv)u.setContentType(void 0);else if(U.isFunction(n.getHeaders)){const h=n.getHeaders(),m=["content-type","content-length"];Object.entries(h).forEach(([b,E])=>{m.includes(b.toLowerCase())&&u.set(b,E)})}}if(dt.hasStandardBrowserEnv&&(s&&U.isFunction(s)&&(s=s(t)),s||s!==!1&&Fm(t.url))){const h=a&&c&&Wm.read(c);h&&u.set(a,h)}return t},Km=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,s){const a=al(e);let c=a.data;const u=At.from(a.headers).normalize();let{responseType:l,onUploadProgress:h,onDownloadProgress:m}=a,b,E,R,$,O;function I(){$&&$(),O&&O(),a.cancelToken&&a.cancelToken.unsubscribe(b),a.signal&&a.signal.removeEventListener("abort",b)}let F=new XMLHttpRequest;F.open(a.method.toUpperCase(),a.url,!0),F.timeout=a.timeout;function ne(){if(!F)return;const Ae=At.from("getAllResponseHeaders"in F&&F.getAllResponseHeaders()),_e={data:!l||l==="text"||l==="json"?F.responseText:F.response,status:F.status,statusText:F.statusText,headers:Ae,config:e,request:F};tl(function(Re){n(Re),I()},function(Re){s(Re),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,e,F)),F=null)},F.onerror=function(Se){const _e=Se&&Se.message?Se.message:"Network Error",Fe=new he(_e,he.ERR_NETWORK,e,F);Fe.event=Se||null,s(Fe),F=null},F.ontimeout=function(){let Se=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded";const _e=a.transitional||Qc;a.timeoutErrorMessage&&(Se=a.timeoutErrorMessage),s(new he(Se,_e.clarifyTimeoutError?he.ETIMEDOUT:he.ECONNABORTED,e,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&&([R,O]=ls(m,!0),F.addEventListener("progress",R)),h&&F.upload&&([E,$]=ls(h),F.upload.addEventListener("progress",E),F.upload.addEventListener("loadend",$)),(a.cancelToken||a.signal)&&(b=Ae=>{F&&(s(!Ae||Ae.type?new Un(null,e,F):Ae),F.abort(),F=null)},a.cancelToken&&a.cancelToken.subscribe(b),a.signal&&(a.signal.aborted?b():a.signal.addEventListener("abort",b)));const Y=Um(a.url);if(Y&&dt.protocols.indexOf(Y)===-1){s(new he("Unsupported protocol "+Y+":",he.ERR_BAD_REQUEST,e));return}F.send(c||null)})},qm=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let s=new AbortController,a;const c=function(m){if(!a){a=!0,l();const b=m instanceof Error?m:this.reason;s.abort(b instanceof he?b:new Un(b instanceof Error?b.message:b))}};let u=t&&setTimeout(()=>{u=null,c(new he(`timeout ${t} of ms exceeded`,he.ETIMEDOUT))},t);const l=()=>{e&&(u&&clearTimeout(u),u=null,e.forEach(m=>{m.unsubscribe?m.unsubscribe(c):m.removeEventListener("abort",c)}),e=null)};e.forEach(m=>m.addEventListener("abort",c));const{signal:h}=s;return h.unsubscribe=()=>U.asap(l),h}},$m=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let s=0,a;for(;s<n;)a=s+t,yield e.slice(s,a),s=a},Gm=async function*(e,t){for await(const n of Vm(e))yield*$m(n,t)},Vm=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:s}=await t.read();if(n)break;yield s}}finally{await t.cancel()}},ol=(e,t,n,s)=>{const a=Gm(e,t);let c=0,u,l=h=>{u||(u=!0,s&&s(h))};return new ReadableStream({async pull(h){try{const{done:m,value:b}=await a.next();if(m){l(),h.close();return}let E=b.byteLength;if(n){let R=c+=E;n(R)}h.enqueue(new Uint8Array(b))}catch(m){throw l(m),m}},cancel(h){return l(h),a.return()}},{highWaterMark:2})},ul=64*1024,{isFunction:fs}=U,zm=(({Request:e,Response:t})=>({Request:e,Response:t}))(U.global),{ReadableStream:cl,TextEncoder:ll}=U.global,fl=(e,...t)=>{try{return!!e(...t)}catch{return!1}},jm=e=>{e=U.merge.call({skipUndefined:!0},zm,e);const{fetch:t,Request:n,Response:s}=e,a=t?fs(t):typeof fetch=="function",c=fs(n),u=fs(s);if(!a)return!1;const l=a&&fs(cl),h=a&&(typeof ll=="function"?(O=>I=>O.encode(I))(new ll):async O=>new Uint8Array(await new n(O).arrayBuffer())),m=c&&l&&fl(()=>{let O=!1;const I=new n(dt.origin,{body:new cl,method:"POST",get duplex(){return O=!0,"half"}}).headers.has("Content-Type");return O&&!I}),b=u&&l&&fl(()=>U.isReadableStream(new s("").body)),E={stream:b&&(O=>O.body)};a&&["text","arrayBuffer","blob","formData","stream"].forEach(O=>{!E[O]&&(E[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 R=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??R(I)};return async O=>{let{url:I,method:F,data:ne,signal:Y,cancelToken:Ae,timeout:Se,onDownloadProgress:_e,onUploadProgress:Fe,responseType:Re,headers:y,withCredentials:_="same-origin",fetchOptions:v}=al(O),M=t||fetch;Re=Re?(Re+"").toLowerCase():"text";let C=qm([Y,Ae&&Ae.toAbortSignal()],Se),P=null;const N=C&&C.unsubscribe&&(()=>{C.unsubscribe()});let T;try{if(Fe&&m&&F!=="get"&&F!=="head"&&(T=await $(y,ne))!==0){let J=new n(I,{method:"POST",body:ne,duplex:"half"}),pe;if(U.isFormData(ne)&&(pe=J.headers.get("content-type"))&&y.setContentType(pe),J.body){const[Ne,We]=rl(T,ls(nl(Fe)));ne=ol(J.body,ul,Ne,We)}}U.isString(_)||(_=_?"include":"omit");const k=c&&"credentials"in n.prototype,L={...v,signal:C,method:F.toUpperCase(),headers:y.normalize().toJSON(),body:ne,duplex:"half",credentials:k?_:void 0};P=c&&new n(I,L);let D=await(c?M(P,v):M(I,L));const q=b&&(Re==="stream"||Re==="response");if(b&&(_e||q&&N)){const J={};["status","statusText","headers"].forEach(le=>{J[le]=D[le]});const pe=U.toFiniteNumber(D.headers.get("content-length")),[Ne,We]=_e&&rl(pe,ls(nl(_e),!0))||[];D=new s(ol(D.body,ul,Ne,()=>{We&&We(),N&&N()}),J)}Re=Re||"text";let te=await E[U.findKey(E,Re)||"text"](D,O);return!q&&N&&N(),await new Promise((J,pe)=>{tl(J,pe,{data:te,headers:At.from(D.headers),status:D.status,statusText:D.statusText,config:O,request:P})})}catch(k){throw N&&N(),k&&k.name==="TypeError"&&/Load failed|fetch/i.test(k.message)?Object.assign(new he("Network Error",he.ERR_NETWORK,O,P),{cause:k.cause||k}):he.from(k,k&&k.code,O,P)}}},Jm=new Map,hl=e=>{let t=e?e.env:{};const{fetch:n,Request:s,Response:a}=t,c=[s,a,n];let u=c.length,l=u,h,m,b=Jm;for(;l--;)h=c[l],m=b.get(h),m===void 0&&b.set(h,m=l?new Map:jm(t)),b=m;return m};hl();const Qa={http:_m,xhr:Km,fetch:{get:hl}};U.forEach(Qa,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const dl=e=>`- ${e}`,Qm=e=>U.isFunction(e)||e===null||e===!1,pl={getAdapter:(e,t)=>{e=U.isArray(e)?e:[e];const{length:n}=e;let s,a;const c={};for(let u=0;u<n;u++){s=e[u];let l;if(a=s,!Qm(s)&&(a=Qa[(l=String(s)).toLowerCase()],a===void 0))throw new he(`Unknown adapter '${l}'`);if(a&&(U.isFunction(a)||(a=a.get(t))))break;c[l||"#"+u]=a}if(!a){const u=Object.entries(c).map(([h,m])=>`adapter ${h} `+(m===!1?"is not supported by the environment":"is not available in the build"));let l=n?u.length>1?`since :
|
|
4
|
+
`+u.map(dl).join(`
|
|
5
|
+
`):" "+dl(u[0]):"as no adapter specified";throw new he("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return a},adapters:Qa};function Za(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Un(null,e)}function ml(e){return Za(e),e.headers=At.from(e.headers),e.data=Ja.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),pl.getAdapter(e.adapter||pi.adapter,e)(e).then(function(s){return Za(e),s.data=Ja.call(e,e.transformResponse,s),s.headers=At.from(s.headers),s},function(s){return el(s)||(Za(e),s&&s.response&&(s.response.data=Ja.call(e,e.transformResponse,s.response),s.response.headers=At.from(s.response.headers))),Promise.reject(s)})}const gl="1.12.2",hs={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{hs[e]=function(s){return typeof s===e||"a"+(t<1?"n ":" ")+e}});const yl={};hs.transitional=function(t,n,s){function a(c,u){return"[Axios v"+gl+"] Transitional option '"+c+"'"+u+(s?". "+s:"")}return(c,u,l)=>{if(t===!1)throw new he(a(u," has been removed"+(n?" in "+n:"")),he.ERR_DEPRECATED);return n&&!yl[u]&&(yl[u]=!0,console.warn(a(u," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(c,u,l):!0}},hs.spelling=function(t){return(n,s)=>(console.warn(`${s} is likely a misspelling of ${t}`),!0)};function Zm(e,t,n){if(typeof e!="object")throw new he("options must be an object",he.ERR_BAD_OPTION_VALUE);const s=Object.keys(e);let a=s.length;for(;a-- >0;){const c=s[a],u=t[c];if(u){const l=e[c],h=l===void 0||u(l,c,e);if(h!==!0)throw new he("option "+c+" must be "+h,he.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new he("Unknown option "+c,he.ERR_BAD_OPTION)}}const ds={assertOptions:Zm,validators:hs},mr=ds.validators;let mn=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Jc,response:new Jc}}async request(t,n){try{return await this._request(t,n)}catch(s){if(s instanceof Error){let a={};Error.captureStackTrace?Error.captureStackTrace(a):a=new Error;const c=a.stack?a.stack.replace(/^.+\n/,""):"";try{s.stack?c&&!String(s.stack).endsWith(c.replace(/^.+\n.+\n/,""))&&(s.stack+=`
|
|
6
|
+
`+c):s.stack=c}catch{}}throw s}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=pn(this.defaults,n);const{transitional:s,paramsSerializer:a,headers:c}=n;s!==void 0&&ds.assertOptions(s,{silentJSONParsing:mr.transitional(mr.boolean),forcedJSONParsing:mr.transitional(mr.boolean),clarifyTimeoutError:mr.transitional(mr.boolean)},!1),a!=null&&(U.isFunction(a)?n.paramsSerializer={serialize:a}:ds.assertOptions(a,{encode:mr.function,serialize:mr.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),ds.assertOptions(n,{baseUrl:mr.spelling("baseURL"),withXsrfToken:mr.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let u=c&&U.merge(c.common,c[n.method]);c&&U.forEach(["delete","get","head","post","put","patch","common"],O=>{delete c[O]}),n.headers=At.concat(u,c);const l=[];let h=!0;this.interceptors.request.forEach(function(I){typeof I.runWhen=="function"&&I.runWhen(n)===!1||(h=h&&I.synchronous,l.unshift(I.fulfilled,I.rejected))});const m=[];this.interceptors.response.forEach(function(I){m.push(I.fulfilled,I.rejected)});let b,E=0,R;if(!h){const O=[ml.bind(this),void 0];for(O.unshift(...l),O.push(...m),R=O.length,b=Promise.resolve(n);E<R;)b=b.then(O[E++],O[E++]);return b}R=l.length;let $=n;for(;E<R;){const O=l[E++],I=l[E++];try{$=O($)}catch(F){I.call(this,F);break}}try{b=ml.call(this,$)}catch(O){return Promise.reject(O)}for(E=0,R=m.length;E<R;)b=b.then(m[E++],m[E++]);return b}getUri(t){t=pn(this.defaults,t);const n=il(t.baseURL,t.url,t.allowAbsoluteUrls);return jc(n,t.params,t.paramsSerializer)}};U.forEach(["delete","get","head","options"],function(t){mn.prototype[t]=function(n,s){return this.request(pn(s||{},{method:t,url:n,data:(s||{}).data}))}}),U.forEach(["post","put","patch"],function(t){function n(s){return function(c,u,l){return this.request(pn(l||{},{method:t,headers:s?{"Content-Type":"multipart/form-data"}:{},url:c,data:u}))}}mn.prototype[t]=n(),mn.prototype[t+"Form"]=n(!0)});let Xm=class Mp{constructor(t){if(typeof t!="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},t(function(c,u,l){s.reason||(s.reason=new Un(c,u,l),n(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=s=>{t.abort(s)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Mp(function(a){t=a}),cancel:t}}};function eg(e){return function(n){return e.apply(null,n)}}function tg(e){return U.isObject(e)&&e.isAxiosError===!0}const Xa={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Xa).forEach(([e,t])=>{Xa[t]=e});function _l(e){const t=new mn(e),n=Lc(mn.prototype.request,t);return U.extend(n,mn.prototype,t,{allOwnKeys:!0}),U.extend(n,t,null,{allOwnKeys:!0}),n.create=function(a){return _l(pn(e,a))},n}const Qe=_l(pi);Qe.Axios=mn,Qe.CanceledError=Un,Qe.CancelToken=Xm,Qe.isCancel=el,Qe.VERSION=gl,Qe.toFormData=us,Qe.AxiosError=he,Qe.Cancel=Qe.CanceledError,Qe.all=function(t){return Promise.all(t)},Qe.spread=eg,Qe.isAxiosError=tg,Qe.mergeConfig=pn,Qe.AxiosHeaders=At,Qe.formToJSON=e=>Zc(U.isHTMLForm(e)?new FormData(e):e),Qe.getAdapter=pl.getAdapter,Qe.HttpStatusCode=Xa,Qe.default=Qe;const{Axios:dC,AxiosError:pC,CanceledError:mC,isCancel:gC,CancelToken:yC,VERSION:_C,all:wC,Cancel:bC,isAxiosError:vC,spread:SC,toFormData:EC,AxiosHeaders:TC,HttpStatusCode:AC,formToJSON:OC,getAdapter:CC,mergeConfig:kC}=Qe;var gi=e=>typeof e=="function"?e:function(){return e},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"},kr={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave"},eo={longpoll:"longpoll",websocket:"websocket"},ag={complete:4},to="base64url.bearer.phx.",ps=class{constructor(e,t,n,s){this.channel=e,this.event=t,this.payload=n||function(){return{}},this.receivedResp=null,this.timeout=s,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(s=>s.status===e).forEach(s=>s.callback(t))}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,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})}},wl=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=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}},og=class{constructor(e,t,n){this.state=Lt.closed,this.topic=e,this.params=gi(t||{}),this.socket=n,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new ps(this,kr.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new wl(()=>{this.socket.isConnected()&&this.rejoin()},this.socket.rejoinAfterMs),this.stateChangeRefs.push(this.socket.onError(()=>this.rejoinTimer.reset())),this.stateChangeRefs.push(this.socket.onOpen(()=>{this.rejoinTimer.reset(),this.isErrored()&&this.rejoin()})),this.joinPush.receive("ok",()=>{this.state=Lt.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(s=>s.send()),this.pushBuffer=[]}),this.joinPush.receive("error",()=>{this.state=Lt.errored,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel",`close ${this.topic} ${this.joinRef()}`),this.state=Lt.closed,this.socket.remove(this)}),this.onError(s=>{this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,s),this.isJoining()&&this.joinPush.reset(),this.state=Lt.errored,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.joinPush.receive("timeout",()=>{this.socket.hasLogger()&&this.socket.log("channel",`timeout ${this.topic} (${this.joinRef()})`,this.joinPush.timeout),new ps(this,kr.leave,gi({}),this.timeout).send(),this.state=Lt.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(kr.reply,(s,a)=>{this.trigger(this.replyEventName(a),s)})}join(e=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=e,this.joinedOnce=!0,this.rejoin(),this.joinPush}onClose(e){this.on(kr.close,e)}onError(e){return this.on(kr.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&&(typeof t>"u"||t===n.ref)))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(e,t,n=this.timeout){if(t=t||{},!this.joinedOnce)throw new Error(`tried to push '${e}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let s=new ps(this,e,function(){return t},n);return this.canPush()?s.send():(s.startTimeout(),this.pushBuffer.push(s)),s}leave(e=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=Lt.leaving;let t=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(kr.close,"leave")},n=new ps(this,kr.leave,gi({}),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,s){return this.topic!==e?!1:s&&s!==this.joinRef()?(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:e,event:t,payload:n,joinRef:s}),!1):!0}joinRef(){return this.joinPush.ref}rejoin(e=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=Lt.joining,this.joinPush.resend(e))}trigger(e,t,n,s){let a=this.onMessage(e,t,n,s);if(t&&!a)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let c=this.bindings.filter(u=>u.event===e);for(let u=0;u<c.length;u++)c[u].callback(a,n,s||this.joinRef())}replyEventName(e){return`chan_reply_${e}`}isClosed(){return this.state===Lt.closed}isErrored(){return this.state===Lt.errored}isJoined(){return this.state===Lt.joined}isJoining(){return this.state===Lt.joining}isLeaving(){return this.state===Lt.leaving}},ms=class{static request(e,t,n,s,a,c,u){if(gr.XDomainRequest){let l=new gr.XDomainRequest;return this.xdomainRequest(l,e,t,s,a,c,u)}else if(gr.XMLHttpRequest){let l=new gr.XMLHttpRequest;return this.xhrRequest(l,e,t,n,s,a,c,u)}else{if(gr.fetch&&gr.AbortController)return this.fetchRequest(e,t,n,s,a,c,u);throw new Error("No suitable XMLHttpRequest implementation found")}}static fetchRequest(e,t,n,s,a,c,u){let l={method:e,headers:n,body:s},h=null;return a&&(h=new AbortController,setTimeout(()=>h.abort(),a),l.signal=h.signal),gr.fetch(t,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(e,t,n,s,a,c,u){return e.timeout=a,e.open(t,n),e.onload=()=>{let l=this.parseJSON(e.responseText);u&&u(l)},c&&(e.ontimeout=c),e.onprogress=()=>{},e.send(s),e}static xhrRequest(e,t,n,s,a,c,u,l){e.open(t,n,!0),e.timeout=c;for(let[h,m]of Object.entries(s))e.setRequestHeader(h,m);return e.onerror=()=>l&&l(null),e.onreadystatechange=()=>{if(e.readyState===ag.complete&&l){let h=this.parseJSON(e.responseText);l(h)}},u&&(e.ontimeout=u),e.send(a),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 s in e){if(!Object.prototype.hasOwnProperty.call(e,s))continue;let a=t?`${t}[${s}]`:s,c=e[s];typeof c=="object"?n.push(this.serialize(c,a)):n.push(encodeURIComponent(a)+"="+encodeURIComponent(c))}return n.join("&")}static appendParams(e,t){if(Object.keys(t).length===0)return e;let n=e.match(/\?/)?"&":"?";return`${e}${n}${this.serialize(t)}`}},ug=e=>{let t="",n=new Uint8Array(e),s=n.byteLength;for(let a=0;a<s;a++)t+=String.fromCharCode(n[a]);return btoa(t)},_i=class{constructor(e,t){t&&t.length===2&&t[1].startsWith(to)&&(this.authToken=atob(t[1].slice(to.length))),this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.reqs=new Set,this.awaitingBatchAck=!1,this.currentBatch=null,this.currentBatchTimer=null,this.batchBuffer=[],this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(e),this.readyState=yr.connecting,setTimeout(()=>this.poll(),0)}normalizeEndpoint(e){return e.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+eo.websocket),"$1/"+eo.longpoll)}endpointURL(){return ms.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(e,t,n){this.close(e,t,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 e={Accept:"application/json"};this.authToken&&(e["X-Phoenix-AuthToken"]=this.authToken),this.ajax("GET",e,null,()=>this.ontimeout(),t=>{if(t){var{status:n,token:s,messages:a}=t;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(e){typeof e!="string"&&(e=ug(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){this.awaitingBatchAck=!0,this.ajax("POST",{"Content-Type":"application/x-ndjson"},e.join(`
|
|
7
|
+
`),()=>this.onerror("timeout"),t=>{this.awaitingBatchAck=!1,!t||t.status!==200?(this.onerror(t&&t.status),this.closeAndRetry(1011,"internal server error",!1)):this.batchBuffer.length>0&&(this.batchSend(this.batchBuffer),this.batchBuffer=[])})}close(e,t,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:e,reason:t,wasClean:n});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,typeof CloseEvent<"u"?this.onclose(new CloseEvent("close",s)):this.onclose(s)}ajax(e,t,n,s,a){let c,u=()=>{this.reqs.delete(c),s()};c=ms.request(e,this.endpointURL(),t,n,this.timeout,u,l=>{this.reqs.delete(c),this.isActive()&&a(l)}),this.reqs.add(c)}},gs={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(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,s,a,c,u]=JSON.parse(e);return t({join_ref:n,ref:s,topic:a,event:c,payload:u})}},binaryEncode(e){let{join_ref:t,ref:n,event:s,topic:a,payload:c}=e,u=this.META_LENGTH+t.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++,t.length),h.setUint8(m++,n.length),h.setUint8(m++,a.length),h.setUint8(m++,s.length),Array.from(t,E=>h.setUint8(m++,E.charCodeAt(0))),Array.from(n,E=>h.setUint8(m++,E.charCodeAt(0))),Array.from(a,E=>h.setUint8(m++,E.charCodeAt(0))),Array.from(s,E=>h.setUint8(m++,E.charCodeAt(0)));var b=new Uint8Array(l.byteLength+c.byteLength);return b.set(new Uint8Array(l),0),b.set(new Uint8Array(c),l.byteLength),b.buffer},binaryDecode(e){let t=new DataView(e),n=t.getUint8(0),s=new TextDecoder;switch(n){case this.KINDS.push:return this.decodePush(e,t,s);case this.KINDS.reply:return this.decodeReply(e,t,s);case this.KINDS.broadcast:return this.decodeBroadcast(e,t,s)}},decodePush(e,t,n){let s=t.getUint8(1),a=t.getUint8(2),c=t.getUint8(3),u=this.HEADER_LENGTH+this.META_LENGTH-1,l=n.decode(e.slice(u,u+s));u=u+s;let h=n.decode(e.slice(u,u+a));u=u+a;let m=n.decode(e.slice(u,u+c));u=u+c;let b=e.slice(u,e.byteLength);return{join_ref:l,ref:null,topic:h,event:m,payload:b}},decodeReply(e,t,n){let s=t.getUint8(1),a=t.getUint8(2),c=t.getUint8(3),u=t.getUint8(4),l=this.HEADER_LENGTH+this.META_LENGTH,h=n.decode(e.slice(l,l+s));l=l+s;let m=n.decode(e.slice(l,l+a));l=l+a;let b=n.decode(e.slice(l,l+c));l=l+c;let E=n.decode(e.slice(l,l+u));l=l+u;let R=e.slice(l,e.byteLength),$={status:E,response:R};return{join_ref:h,ref:m,topic:b,event:kr.reply,payload:$}},decodeBroadcast(e,t,n){let s=t.getUint8(1),a=t.getUint8(2),c=this.HEADER_LENGTH+2,u=n.decode(e.slice(c,c+s));c=c+s;let l=n.decode(e.slice(c,c+a));c=c+a;let h=e.slice(c,e.byteLength);return{join_ref:null,ref:null,topic:u,event:l,payload:h}}},cg=class{constructor(e,t={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.timeout=t.timeout||ig,this.transport=t.transport||gr.WebSocket||_i,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=t.longPollFallbackMs,this.fallbackTimer=null,this.sessionStore=t.sessionStorage||gr&&gr.sessionStorage,this.establishedConnections=0,this.defaultEncoder=gs.encode.bind(gs),this.defaultDecoder=gs.decode.bind(gs),this.closeWasClean=!1,this.disconnecting=!1,this.binaryType=t.binaryType||"arraybuffer",this.connectClock=1,this.transport!==_i?(this.encode=t.encode||this.defaultEncoder,this.decode=t.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=t.heartbeatIntervalMs||3e4,this.rejoinAfterMs=s=>t.rejoinAfterMs?t.rejoinAfterMs(s):[1e3,2e3,5e3][s-1]||1e4,this.reconnectAfterMs=s=>t.reconnectAfterMs?t.reconnectAfterMs(s):[10,50,100,150,200,250,500,1e3,2e3][s-1]||5e3,this.logger=t.logger||null,!this.logger&&t.debug&&(this.logger=(s,a,c)=>{console.log(`${s}: ${a}`,c)}),this.longpollerTimeout=t.longpollerTimeout||2e4,this.params=gi(t.params||{}),this.endPoint=`${e}/${eo.websocket}`,this.vsn=t.vsn||ng,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new wl(()=>{this.teardown(()=>this.connect())},this.reconnectAfterMs),this.authToken=t.authToken}getLongPollTransport(){return _i}replaceTransport(e){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&(this.conn.close(),this.conn=null),this.transport=e}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let e=ms.appendParams(ms.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return e.charAt(0)!=="/"?e:e.charAt(1)==="/"?`${this.protocol()}:${e}`:`${this.protocol()}://${location.host}${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=gi(e)),!(this.conn&&!this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==_i?this.connectWithFallback(_i,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 s=this.onMessage(a=>{a.ref===t&&(this.off([s]),e(Date.now()-n))});return!0}transportConnect(){this.connectClock++,this.closeWasClean=!1;let e;this.authToken&&(e=["phoenix",`${to}${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=t=>this.onConnError(t),this.conn.onmessage=t=>this.onConnMessage(t),this.conn.onclose=t=>this.onConnClose(t)}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,s=!0,a,c,u=l=>{this.log("transport",`falling back to ${e.name}...`,l),this.off([a,c]),s=!1,this.replaceTransport(e),this.transportConnect()};if(this.getSession(`phx:fallback:${e.name}`))return u("memorized");this.fallbackTimer=setTimeout(u,t),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:${e.name}`,"true"),this.log("transport",`established ${e.name} fallback`);clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(u,t),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(([,e])=>e())}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(e,t,n){if(!this.conn)return e&&e();let s=this.connectClock;this.waitForBufferDone(()=>{s===this.connectClock&&(this.conn&&(t?this.conn.close(t,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),e&&e())}))})}waitForBufferDone(e,t=1){if(t===5||!this.conn||!this.conn.bufferedAmount){e();return}setTimeout(()=>{this.waitForBufferDone(e,t+1)},150*t)}waitForSocketClosed(e,t=1){if(t===5||!this.conn||this.conn.readyState===yr.closed){e();return}setTimeout(()=>{this.waitForSocketClosed(e,t+1)},150*t)}onConnClose(e){let t=e&&e.code;this.hasLogger()&&this.log("transport","close",e),this.triggerChanError(),this.clearHeartbeats(),!this.closeWasClean&&t!==1e3&&this.reconnectTimer.scheduleTimeout(),this.stateChangeCallbacks.close.forEach(([,n])=>n(e))}onConnError(e){this.hasLogger()&&this.log("transport",e);let t=this.transport,n=this.establishedConnections;this.stateChangeCallbacks.error.forEach(([,s])=>{s(e,t,n)}),(t===this.transport||n>0)&&this.triggerChanError()}triggerChanError(){this.channels.forEach(e=>{e.isErrored()||e.isLeaving()||e.isClosed()||e.trigger(kr.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(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(([n])=>e.indexOf(n)===-1)}channel(e,t={}){let n=new og(e,t,this);return this.channels.push(n),n}push(e){if(this.hasLogger()){let{topic:t,event:n,payload:s,ref:a,join_ref:c}=e;this.log("push",`${t} ${n} (${c}, ${a})`,s)}this.isConnected()?this.encode(e,t=>this.conn.send(t)):this.sendBuffer.push(()=>this.encode(e,t=>this.conn.send(t)))}makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=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,t=>{let{topic:n,event:s,payload:a,ref:c,join_ref:u}=t;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(t)}})}leaveOpenTopic(e){let t=this.channels.find(n=>n.topic===e&&(n.isJoined()||n.isJoining()));t&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${e}"`),t.leave())}},ys=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function bl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var wi={exports:{}};/**
|
|
8
8
|
* @license
|
|
9
9
|
* Lodash <https://lodash.com/>
|
|
10
10
|
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
11
11
|
* Released under MIT license <https://lodash.com/license>
|
|
12
12
|
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
13
13
|
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
14
|
-
*/var jm=_i.exports,al;function Jm(){return al||(al=1,(function(e,t){(function(){var n,s="4.17.21",a=200,c="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",u="Expected a function",l="Invalid `variable` option passed into `_.template`",h="__lodash_hash_undefined__",m=500,b="__lodash_placeholder__",T=1,R=2,$=4,O=1,B=2,F=1,re=2,Y=4,Ee=8,ve=16,ye=32,Be=64,ke=128,y=256,_=512,v=30,M="...",x=800,P=16,N=1,E=2,C=3,L=1/0,D=9007199254740991,q=17976931348623157e292,X=NaN,J=4294967295,de=J-1,Le=J>>>1,Fe=[["ary",ke],["bind",F],["bindKey",re],["curry",Ee],["curryRight",ve],["flip",_],["partial",ye],["partialRight",Be],["rearg",y]],ce="[object Arguments]",Ae="[object Array]",st="[object AsyncFunction]",Sr="[object Boolean]",Fr="[object Date]",Ui="[object DOMException]",yt="[object Error]",Tr="[object Function]",_t="[object GeneratorFunction]",Ue="[object Map]",Ne="[object Number]",y1="[object Null]",Wr="[object Object]",Yf="[object Promise]",_1="[object Proxy]",Ii="[object RegExp]",cr="[object Set]",Bi="[object String]",zs="[object Symbol]",w1="[object Undefined]",Fi="[object WeakMap]",b1="[object WeakSet]",Wi="[object ArrayBuffer]",jn="[object DataView]",Zo="[object Float32Array]",Xo="[object Float64Array]",eu="[object Int8Array]",tu="[object Int16Array]",ru="[object Int32Array]",nu="[object Uint8Array]",iu="[object Uint8ClampedArray]",su="[object Uint16Array]",au="[object Uint32Array]",v1=/\b__p \+= '';/g,S1=/\b(__p \+=) '' \+/g,T1=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Kf=/&(?:amp|lt|gt|quot|#39);/g,qf=/[&<>"']/g,E1=RegExp(Kf.source),A1=RegExp(qf.source),O1=/<%-([\s\S]+?)%>/g,x1=/<%([\s\S]+?)%>/g,$f=/<%=([\s\S]+?)%>/g,C1=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,k1=/^\w*$/,R1=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ou=/[\\^$.*+?()[\]{}|]/g,P1=RegExp(ou.source),uu=/^\s+/,D1=/\s/,M1=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,L1=/\{\n\/\* \[wrapped with (.+)\] \*/,N1=/,? & /,U1=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,I1=/[()=,{}\[\]\/\s]/,B1=/\\(\\)?/g,F1=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Gf=/\w*$/,W1=/^[-+]0x[0-9a-f]+$/i,H1=/^0b[01]+$/i,Y1=/^\[object .+?Constructor\]$/,K1=/^0o[0-7]+$/i,q1=/^(?:0|[1-9]\d*)$/,$1=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Vs=/($^)/,G1=/['\n\r\u2028\u2029\\]/g,js="\\ud800-\\udfff",z1="\\u0300-\\u036f",V1="\\ufe20-\\ufe2f",j1="\\u20d0-\\u20ff",zf=z1+V1+j1,Vf="\\u2700-\\u27bf",jf="a-z\\xdf-\\xf6\\xf8-\\xff",J1="\\xac\\xb1\\xd7\\xf7",Q1="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Z1="\\u2000-\\u206f",X1=" \\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",Jf="A-Z\\xc0-\\xd6\\xd8-\\xde",Qf="\\ufe0e\\ufe0f",Zf=J1+Q1+Z1+X1,cu="['’]",eb="["+js+"]",Xf="["+Zf+"]",Js="["+zf+"]",eh="\\d+",tb="["+Vf+"]",th="["+jf+"]",rh="[^"+js+Zf+eh+Vf+jf+Jf+"]",lu="\\ud83c[\\udffb-\\udfff]",rb="(?:"+Js+"|"+lu+")",nh="[^"+js+"]",fu="(?:\\ud83c[\\udde6-\\uddff]){2}",hu="[\\ud800-\\udbff][\\udc00-\\udfff]",Jn="["+Jf+"]",ih="\\u200d",sh="(?:"+th+"|"+rh+")",nb="(?:"+Jn+"|"+rh+")",ah="(?:"+cu+"(?:d|ll|m|re|s|t|ve))?",oh="(?:"+cu+"(?:D|LL|M|RE|S|T|VE))?",uh=rb+"?",ch="["+Qf+"]?",ib="(?:"+ih+"(?:"+[nh,fu,hu].join("|")+")"+ch+uh+")*",sb="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ab="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",lh=ch+uh+ib,ob="(?:"+[tb,fu,hu].join("|")+")"+lh,ub="(?:"+[nh+Js+"?",Js,fu,hu,eb].join("|")+")",cb=RegExp(cu,"g"),lb=RegExp(Js,"g"),du=RegExp(lu+"(?="+lu+")|"+ub+lh,"g"),fb=RegExp([Jn+"?"+th+"+"+ah+"(?="+[Xf,Jn,"$"].join("|")+")",nb+"+"+oh+"(?="+[Xf,Jn+sh,"$"].join("|")+")",Jn+"?"+sh+"+"+ah,Jn+"+"+oh,ab,sb,eh,ob].join("|"),"g"),hb=RegExp("["+ih+js+zf+Qf+"]"),db=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,pb=["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"],mb=-1,Ke={};Ke[Zo]=Ke[Xo]=Ke[eu]=Ke[tu]=Ke[ru]=Ke[nu]=Ke[iu]=Ke[su]=Ke[au]=!0,Ke[ce]=Ke[Ae]=Ke[Wi]=Ke[Sr]=Ke[jn]=Ke[Fr]=Ke[yt]=Ke[Tr]=Ke[Ue]=Ke[Ne]=Ke[Wr]=Ke[Ii]=Ke[cr]=Ke[Bi]=Ke[Fi]=!1;var We={};We[ce]=We[Ae]=We[Wi]=We[jn]=We[Sr]=We[Fr]=We[Zo]=We[Xo]=We[eu]=We[tu]=We[ru]=We[Ue]=We[Ne]=We[Wr]=We[Ii]=We[cr]=We[Bi]=We[zs]=We[nu]=We[iu]=We[su]=We[au]=!0,We[yt]=We[Tr]=We[Fi]=!1;var gb={À:"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"},yb={"&":"&","<":"<",">":">",'"':""","'":"'"},_b={"&":"&","<":"<",">":">",""":'"',"'":"'"},wb={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},bb=parseFloat,vb=parseInt,fh=typeof ms=="object"&&ms&&ms.Object===Object&&ms,Sb=typeof self=="object"&&self&&self.Object===Object&&self,ct=fh||Sb||Function("return this")(),pu=t&&!t.nodeType&&t,vn=pu&&!0&&e&&!e.nodeType&&e,hh=vn&&vn.exports===pu,mu=hh&&fh.process,Vt=(function(){try{var A=vn&&vn.require&&vn.require("util").types;return A||mu&&mu.binding&&mu.binding("util")}catch{}})(),dh=Vt&&Vt.isArrayBuffer,ph=Vt&&Vt.isDate,mh=Vt&&Vt.isMap,gh=Vt&&Vt.isRegExp,yh=Vt&&Vt.isSet,_h=Vt&&Vt.isTypedArray;function Lt(A,W,I){switch(I.length){case 0:return A.call(W);case 1:return A.call(W,I[0]);case 2:return A.call(W,I[0],I[1]);case 3:return A.call(W,I[0],I[1],I[2])}return A.apply(W,I)}function Tb(A,W,I,Z){for(var oe=-1,Re=A==null?0:A.length;++oe<Re;){var rt=A[oe];W(Z,rt,I(rt),A)}return Z}function jt(A,W){for(var I=-1,Z=A==null?0:A.length;++I<Z&&W(A[I],I,A)!==!1;);return A}function Eb(A,W){for(var I=A==null?0:A.length;I--&&W(A[I],I,A)!==!1;);return A}function wh(A,W){for(var I=-1,Z=A==null?0:A.length;++I<Z;)if(!W(A[I],I,A))return!1;return!0}function rn(A,W){for(var I=-1,Z=A==null?0:A.length,oe=0,Re=[];++I<Z;){var rt=A[I];W(rt,I,A)&&(Re[oe++]=rt)}return Re}function Qs(A,W){var I=A==null?0:A.length;return!!I&&Qn(A,W,0)>-1}function gu(A,W,I){for(var Z=-1,oe=A==null?0:A.length;++Z<oe;)if(I(W,A[Z]))return!0;return!1}function $e(A,W){for(var I=-1,Z=A==null?0:A.length,oe=Array(Z);++I<Z;)oe[I]=W(A[I],I,A);return oe}function nn(A,W){for(var I=-1,Z=W.length,oe=A.length;++I<Z;)A[oe+I]=W[I];return A}function yu(A,W,I,Z){var oe=-1,Re=A==null?0:A.length;for(Z&&Re&&(I=A[++oe]);++oe<Re;)I=W(I,A[oe],oe,A);return I}function Ab(A,W,I,Z){var oe=A==null?0:A.length;for(Z&&oe&&(I=A[--oe]);oe--;)I=W(I,A[oe],oe,A);return I}function _u(A,W){for(var I=-1,Z=A==null?0:A.length;++I<Z;)if(W(A[I],I,A))return!0;return!1}var Ob=wu("length");function xb(A){return A.split("")}function Cb(A){return A.match(U1)||[]}function bh(A,W,I){var Z;return I(A,function(oe,Re,rt){if(W(oe,Re,rt))return Z=Re,!1}),Z}function Zs(A,W,I,Z){for(var oe=A.length,Re=I+(Z?1:-1);Z?Re--:++Re<oe;)if(W(A[Re],Re,A))return Re;return-1}function Qn(A,W,I){return W===W?Wb(A,W,I):Zs(A,vh,I)}function kb(A,W,I,Z){for(var oe=I-1,Re=A.length;++oe<Re;)if(Z(A[oe],W))return oe;return-1}function vh(A){return A!==A}function Sh(A,W){var I=A==null?0:A.length;return I?vu(A,W)/I:X}function wu(A){return function(W){return W==null?n:W[A]}}function bu(A){return function(W){return A==null?n:A[W]}}function Th(A,W,I,Z,oe){return oe(A,function(Re,rt,Ie){I=Z?(Z=!1,Re):W(I,Re,rt,Ie)}),I}function Rb(A,W){var I=A.length;for(A.sort(W);I--;)A[I]=A[I].value;return A}function vu(A,W){for(var I,Z=-1,oe=A.length;++Z<oe;){var Re=W(A[Z]);Re!==n&&(I=I===n?Re:I+Re)}return I}function Su(A,W){for(var I=-1,Z=Array(A);++I<A;)Z[I]=W(I);return Z}function Pb(A,W){return $e(W,function(I){return[I,A[I]]})}function Eh(A){return A&&A.slice(0,Ch(A)+1).replace(uu,"")}function Nt(A){return function(W){return A(W)}}function Tu(A,W){return $e(W,function(I){return A[I]})}function Hi(A,W){return A.has(W)}function Ah(A,W){for(var I=-1,Z=A.length;++I<Z&&Qn(W,A[I],0)>-1;);return I}function Oh(A,W){for(var I=A.length;I--&&Qn(W,A[I],0)>-1;);return I}function Db(A,W){for(var I=A.length,Z=0;I--;)A[I]===W&&++Z;return Z}var Mb=bu(gb),Lb=bu(yb);function Nb(A){return"\\"+wb[A]}function Ub(A,W){return A==null?n:A[W]}function Zn(A){return hb.test(A)}function Ib(A){return db.test(A)}function Bb(A){for(var W,I=[];!(W=A.next()).done;)I.push(W.value);return I}function Eu(A){var W=-1,I=Array(A.size);return A.forEach(function(Z,oe){I[++W]=[oe,Z]}),I}function xh(A,W){return function(I){return A(W(I))}}function sn(A,W){for(var I=-1,Z=A.length,oe=0,Re=[];++I<Z;){var rt=A[I];(rt===W||rt===b)&&(A[I]=b,Re[oe++]=I)}return Re}function Xs(A){var W=-1,I=Array(A.size);return A.forEach(function(Z){I[++W]=Z}),I}function Fb(A){var W=-1,I=Array(A.size);return A.forEach(function(Z){I[++W]=[Z,Z]}),I}function Wb(A,W,I){for(var Z=I-1,oe=A.length;++Z<oe;)if(A[Z]===W)return Z;return-1}function Hb(A,W,I){for(var Z=I+1;Z--;)if(A[Z]===W)return Z;return Z}function Xn(A){return Zn(A)?Kb(A):Ob(A)}function lr(A){return Zn(A)?qb(A):xb(A)}function Ch(A){for(var W=A.length;W--&&D1.test(A.charAt(W)););return W}var Yb=bu(_b);function Kb(A){for(var W=du.lastIndex=0;du.test(A);)++W;return W}function qb(A){return A.match(du)||[]}function $b(A){return A.match(fb)||[]}var Gb=(function A(W){W=W==null?ct:ei.defaults(ct.Object(),W,ei.pick(ct,pb));var I=W.Array,Z=W.Date,oe=W.Error,Re=W.Function,rt=W.Math,Ie=W.Object,Au=W.RegExp,zb=W.String,Jt=W.TypeError,ea=I.prototype,Vb=Re.prototype,ti=Ie.prototype,ta=W["__core-js_shared__"],ra=Vb.toString,De=ti.hasOwnProperty,jb=0,kh=(function(){var r=/[^.]+$/.exec(ta&&ta.keys&&ta.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""})(),na=ti.toString,Jb=ra.call(Ie),Qb=ct._,Zb=Au("^"+ra.call(De).replace(ou,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ia=hh?W.Buffer:n,an=W.Symbol,sa=W.Uint8Array,Rh=ia?ia.allocUnsafe:n,aa=xh(Ie.getPrototypeOf,Ie),Ph=Ie.create,Dh=ti.propertyIsEnumerable,oa=ea.splice,Mh=an?an.isConcatSpreadable:n,Yi=an?an.iterator:n,Sn=an?an.toStringTag:n,ua=(function(){try{var r=xn(Ie,"defineProperty");return r({},"",{}),r}catch{}})(),Xb=W.clearTimeout!==ct.clearTimeout&&W.clearTimeout,ev=Z&&Z.now!==ct.Date.now&&Z.now,tv=W.setTimeout!==ct.setTimeout&&W.setTimeout,ca=rt.ceil,la=rt.floor,Ou=Ie.getOwnPropertySymbols,rv=ia?ia.isBuffer:n,Lh=W.isFinite,nv=ea.join,iv=xh(Ie.keys,Ie),nt=rt.max,pt=rt.min,sv=Z.now,av=W.parseInt,Nh=rt.random,ov=ea.reverse,xu=xn(W,"DataView"),Ki=xn(W,"Map"),Cu=xn(W,"Promise"),ri=xn(W,"Set"),qi=xn(W,"WeakMap"),$i=xn(Ie,"create"),fa=qi&&new qi,ni={},uv=Cn(xu),cv=Cn(Ki),lv=Cn(Cu),fv=Cn(ri),hv=Cn(qi),ha=an?an.prototype:n,Gi=ha?ha.valueOf:n,Uh=ha?ha.toString:n;function p(r){if(je(r)&&!le(r)&&!(r instanceof be)){if(r instanceof Qt)return r;if(De.call(r,"__wrapped__"))return Id(r)}return new Qt(r)}var ii=(function(){function r(){}return function(i){if(!Ve(i))return{};if(Ph)return Ph(i);r.prototype=i;var o=new r;return r.prototype=n,o}})();function da(){}function Qt(r,i){this.__wrapped__=r,this.__actions__=[],this.__chain__=!!i,this.__index__=0,this.__values__=n}p.templateSettings={escape:O1,evaluate:x1,interpolate:$f,variable:"",imports:{_:p}},p.prototype=da.prototype,p.prototype.constructor=p,Qt.prototype=ii(da.prototype),Qt.prototype.constructor=Qt;function be(r){this.__wrapped__=r,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=J,this.__views__=[]}function dv(){var r=new be(this.__wrapped__);return r.__actions__=Ot(this.__actions__),r.__dir__=this.__dir__,r.__filtered__=this.__filtered__,r.__iteratees__=Ot(this.__iteratees__),r.__takeCount__=this.__takeCount__,r.__views__=Ot(this.__views__),r}function pv(){if(this.__filtered__){var r=new be(this);r.__dir__=-1,r.__filtered__=!0}else r=this.clone(),r.__dir__*=-1;return r}function mv(){var r=this.__wrapped__.value(),i=this.__dir__,o=le(r),f=i<0,d=o?r.length:0,g=xS(0,d,this.__views__),w=g.start,S=g.end,k=S-w,H=f?S:w-1,K=this.__iteratees__,G=K.length,j=0,te=pt(k,this.__takeCount__);if(!o||!f&&d==k&&te==k)return ad(r,this.__actions__);var se=[];e:for(;k--&&j<te;){H+=i;for(var me=-1,ae=r[H];++me<G;){var _e=K[me],Se=_e.iteratee,Bt=_e.type,vt=Se(ae);if(Bt==E)ae=vt;else if(!vt){if(Bt==N)continue e;break e}}se[j++]=ae}return se}be.prototype=ii(da.prototype),be.prototype.constructor=be;function Tn(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 gv(){this.__data__=$i?$i(null):{},this.size=0}function yv(r){var i=this.has(r)&&delete this.__data__[r];return this.size-=i?1:0,i}function _v(r){var i=this.__data__;if($i){var o=i[r];return o===h?n:o}return De.call(i,r)?i[r]:n}function wv(r){var i=this.__data__;return $i?i[r]!==n:De.call(i,r)}function bv(r,i){var o=this.__data__;return this.size+=this.has(r)?0:1,o[r]=$i&&i===n?h:i,this}Tn.prototype.clear=gv,Tn.prototype.delete=yv,Tn.prototype.get=_v,Tn.prototype.has=wv,Tn.prototype.set=bv;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 vv(){this.__data__=[],this.size=0}function Sv(r){var i=this.__data__,o=pa(i,r);if(o<0)return!1;var f=i.length-1;return o==f?i.pop():oa.call(i,o,1),--this.size,!0}function Tv(r){var i=this.__data__,o=pa(i,r);return o<0?n:i[o][1]}function Ev(r){return pa(this.__data__,r)>-1}function Av(r,i){var o=this.__data__,f=pa(o,r);return f<0?(++this.size,o.push([r,i])):o[f][1]=i,this}Hr.prototype.clear=vv,Hr.prototype.delete=Sv,Hr.prototype.get=Tv,Hr.prototype.has=Ev,Hr.prototype.set=Av;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 Ov(){this.size=0,this.__data__={hash:new Tn,map:new(Ki||Hr),string:new Tn}}function xv(r){var i=Oa(this,r).delete(r);return this.size-=i?1:0,i}function Cv(r){return Oa(this,r).get(r)}function kv(r){return Oa(this,r).has(r)}function Rv(r,i){var o=Oa(this,r),f=o.size;return o.set(r,i),this.size+=o.size==f?0:1,this}Yr.prototype.clear=Ov,Yr.prototype.delete=xv,Yr.prototype.get=Cv,Yr.prototype.has=kv,Yr.prototype.set=Rv;function En(r){var i=-1,o=r==null?0:r.length;for(this.__data__=new Yr;++i<o;)this.add(r[i])}function Pv(r){return this.__data__.set(r,h),this}function Dv(r){return this.__data__.has(r)}En.prototype.add=En.prototype.push=Pv,En.prototype.has=Dv;function fr(r){var i=this.__data__=new Hr(r);this.size=i.size}function Mv(){this.__data__=new Hr,this.size=0}function Lv(r){var i=this.__data__,o=i.delete(r);return this.size=i.size,o}function Nv(r){return this.__data__.get(r)}function Uv(r){return this.__data__.has(r)}function Iv(r,i){var o=this.__data__;if(o instanceof Hr){var f=o.__data__;if(!Ki||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}fr.prototype.clear=Mv,fr.prototype.delete=Lv,fr.prototype.get=Nv,fr.prototype.has=Uv,fr.prototype.set=Iv;function Ih(r,i){var o=le(r),f=!o&&kn(r),d=!o&&!f&&fn(r),g=!o&&!f&&!d&&ui(r),w=o||f||d||g,S=w?Su(r.length,zb):[],k=S.length;for(var H in r)(i||De.call(r,H))&&!(w&&(H=="length"||d&&(H=="offset"||H=="parent")||g&&(H=="buffer"||H=="byteLength"||H=="byteOffset")||Gr(H,k)))&&S.push(H);return S}function Bh(r){var i=r.length;return i?r[Fu(0,i-1)]:n}function Bv(r,i){return xa(Ot(r),An(i,0,r.length))}function Fv(r){return xa(Ot(r))}function ku(r,i,o){(o!==n&&!hr(r[i],o)||o===n&&!(i in r))&&Kr(r,i,o)}function zi(r,i,o){var f=r[i];(!(De.call(r,i)&&hr(f,o))||o===n&&!(i in r))&&Kr(r,i,o)}function pa(r,i){for(var o=r.length;o--;)if(hr(r[o][0],i))return o;return-1}function Wv(r,i,o,f){return on(r,function(d,g,w){i(f,d,o(d),w)}),f}function Fh(r,i){return r&&Ar(i,at(i),r)}function Hv(r,i){return r&&Ar(i,Ct(i),r)}function Kr(r,i,o){i=="__proto__"&&ua?ua(r,i,{configurable:!0,enumerable:!0,value:o,writable:!0}):r[i]=o}function Ru(r,i){for(var o=-1,f=i.length,d=I(f),g=r==null;++o<f;)d[o]=g?n:lc(r,i[o]);return d}function An(r,i,o){return r===r&&(o!==n&&(r=r<=o?r:o),i!==n&&(r=r>=i?r:i)),r}function Zt(r,i,o,f,d,g){var w,S=i&T,k=i&R,H=i&$;if(o&&(w=d?o(r,f,d,g):o(r)),w!==n)return w;if(!Ve(r))return r;var K=le(r);if(K){if(w=kS(r),!S)return Ot(r,w)}else{var G=mt(r),j=G==Tr||G==_t;if(fn(r))return cd(r,S);if(G==Wr||G==ce||j&&!d){if(w=k||j?{}:Cd(r),!S)return k?_S(r,Hv(w,r)):yS(r,Fh(w,r))}else{if(!We[G])return d?r:{};w=RS(r,G,S)}}g||(g=new fr);var te=g.get(r);if(te)return te;g.set(r,w),np(r)?r.forEach(function(ae){w.add(Zt(ae,i,o,ae,r,g))}):tp(r)&&r.forEach(function(ae,_e){w.set(_e,Zt(ae,i,o,_e,r,g))});var se=H?k?Ju:ju:k?Ct:at,me=K?n:se(r);return jt(me||r,function(ae,_e){me&&(_e=ae,ae=r[_e]),zi(w,_e,Zt(ae,i,o,_e,r,g))}),w}function Yv(r){var i=at(r);return function(o){return Wh(o,r,i)}}function Wh(r,i,o){var f=o.length;if(r==null)return!f;for(r=Ie(r);f--;){var d=o[f],g=i[d],w=r[d];if(w===n&&!(d in r)||!g(w))return!1}return!0}function Hh(r,i,o){if(typeof r!="function")throw new Jt(u);return es(function(){r.apply(n,o)},i)}function Vi(r,i,o,f){var d=-1,g=Qs,w=!0,S=r.length,k=[],H=i.length;if(!S)return k;o&&(i=$e(i,Nt(o))),f?(g=gu,w=!1):i.length>=a&&(g=Hi,w=!1,i=new En(i));e:for(;++d<S;){var K=r[d],G=o==null?K:o(K);if(K=f||K!==0?K:0,w&&G===G){for(var j=H;j--;)if(i[j]===G)continue e;k.push(K)}else g(i,G,f)||k.push(K)}return k}var on=pd(Er),Yh=pd(Du,!0);function Kv(r,i){var o=!0;return on(r,function(f,d,g){return o=!!i(f,d,g),o}),o}function ma(r,i,o){for(var f=-1,d=r.length;++f<d;){var g=r[f],w=i(g);if(w!=null&&(S===n?w===w&&!It(w):o(w,S)))var S=w,k=g}return k}function qv(r,i,o,f){var d=r.length;for(o=pe(o),o<0&&(o=-o>d?0:d+o),f=f===n||f>d?d:pe(f),f<0&&(f+=d),f=o>f?0:sp(f);o<f;)r[o++]=i;return r}function Kh(r,i){var o=[];return on(r,function(f,d,g){i(f,d,g)&&o.push(f)}),o}function lt(r,i,o,f,d){var g=-1,w=r.length;for(o||(o=DS),d||(d=[]);++g<w;){var S=r[g];i>0&&o(S)?i>1?lt(S,i-1,o,f,d):nn(d,S):f||(d[d.length]=S)}return d}var Pu=md(),qh=md(!0);function Er(r,i){return r&&Pu(r,i,at)}function Du(r,i){return r&&qh(r,i,at)}function ga(r,i){return rn(i,function(o){return zr(r[o])})}function On(r,i){i=cn(i,r);for(var o=0,f=i.length;r!=null&&o<f;)r=r[Or(i[o++])];return o&&o==f?r:n}function $h(r,i,o){var f=i(r);return le(r)?f:nn(f,o(r))}function wt(r){return r==null?r===n?w1:y1:Sn&&Sn in Ie(r)?OS(r):FS(r)}function Mu(r,i){return r>i}function $v(r,i){return r!=null&&De.call(r,i)}function Gv(r,i){return r!=null&&i in Ie(r)}function zv(r,i,o){return r>=pt(i,o)&&r<nt(i,o)}function Lu(r,i,o){for(var f=o?gu:Qs,d=r[0].length,g=r.length,w=g,S=I(g),k=1/0,H=[];w--;){var K=r[w];w&&i&&(K=$e(K,Nt(i))),k=pt(K.length,k),S[w]=!o&&(i||d>=120&&K.length>=120)?new En(w&&K):n}K=r[0];var G=-1,j=S[0];e:for(;++G<d&&H.length<k;){var te=K[G],se=i?i(te):te;if(te=o||te!==0?te:0,!(j?Hi(j,se):f(H,se,o))){for(w=g;--w;){var me=S[w];if(!(me?Hi(me,se):f(r[w],se,o)))continue e}j&&j.push(se),H.push(te)}}return H}function Vv(r,i,o,f){return Er(r,function(d,g,w){i(f,o(d),g,w)}),f}function ji(r,i,o){i=cn(i,r),r=Dd(r,i);var f=r==null?r:r[Or(er(i))];return f==null?n:Lt(f,r,o)}function Gh(r){return je(r)&&wt(r)==ce}function jv(r){return je(r)&&wt(r)==Wi}function Jv(r){return je(r)&&wt(r)==Fr}function Ji(r,i,o,f,d){return r===i?!0:r==null||i==null||!je(r)&&!je(i)?r!==r&&i!==i:Qv(r,i,o,f,Ji,d)}function Qv(r,i,o,f,d,g){var w=le(r),S=le(i),k=w?Ae:mt(r),H=S?Ae:mt(i);k=k==ce?Wr:k,H=H==ce?Wr:H;var K=k==Wr,G=H==Wr,j=k==H;if(j&&fn(r)){if(!fn(i))return!1;w=!0,K=!1}if(j&&!K)return g||(g=new fr),w||ui(r)?Ad(r,i,o,f,d,g):ES(r,i,k,o,f,d,g);if(!(o&O)){var te=K&&De.call(r,"__wrapped__"),se=G&&De.call(i,"__wrapped__");if(te||se){var me=te?r.value():r,ae=se?i.value():i;return g||(g=new fr),d(me,ae,o,f,g)}}return j?(g||(g=new fr),AS(r,i,o,f,d,g)):!1}function Zv(r){return je(r)&&mt(r)==Ue}function Nu(r,i,o,f){var d=o.length,g=d,w=!f;if(r==null)return!g;for(r=Ie(r);d--;){var S=o[d];if(w&&S[2]?S[1]!==r[S[0]]:!(S[0]in r))return!1}for(;++d<g;){S=o[d];var k=S[0],H=r[k],K=S[1];if(w&&S[2]){if(H===n&&!(k in r))return!1}else{var G=new fr;if(f)var j=f(H,K,k,r,i,G);if(!(j===n?Ji(K,H,O|B,f,G):j))return!1}}return!0}function zh(r){if(!Ve(r)||LS(r))return!1;var i=zr(r)?Zb:Y1;return i.test(Cn(r))}function Xv(r){return je(r)&&wt(r)==Ii}function eS(r){return je(r)&&mt(r)==cr}function tS(r){return je(r)&&Ma(r.length)&&!!Ke[wt(r)]}function Vh(r){return typeof r=="function"?r:r==null?kt:typeof r=="object"?le(r)?Qh(r[0],r[1]):Jh(r):gp(r)}function Uu(r){if(!Xi(r))return iv(r);var i=[];for(var o in Ie(r))De.call(r,o)&&o!="constructor"&&i.push(o);return i}function rS(r){if(!Ve(r))return BS(r);var i=Xi(r),o=[];for(var f in r)f=="constructor"&&(i||!De.call(r,f))||o.push(f);return o}function Iu(r,i){return r<i}function jh(r,i){var o=-1,f=xt(r)?I(r.length):[];return on(r,function(d,g,w){f[++o]=i(d,g,w)}),f}function Jh(r){var i=Zu(r);return i.length==1&&i[0][2]?Rd(i[0][0],i[0][1]):function(o){return o===r||Nu(o,r,i)}}function Qh(r,i){return ec(r)&&kd(i)?Rd(Or(r),i):function(o){var f=lc(o,r);return f===n&&f===i?fc(o,r):Ji(i,f,O|B)}}function ya(r,i,o,f,d){r!==i&&Pu(i,function(g,w){if(d||(d=new fr),Ve(g))nS(r,i,w,o,ya,f,d);else{var S=f?f(rc(r,w),g,w+"",r,i,d):n;S===n&&(S=g),ku(r,w,S)}},Ct)}function nS(r,i,o,f,d,g,w){var S=rc(r,o),k=rc(i,o),H=w.get(k);if(H){ku(r,o,H);return}var K=g?g(S,k,o+"",r,i,w):n,G=K===n;if(G){var j=le(k),te=!j&&fn(k),se=!j&&!te&&ui(k);K=k,j||te||se?le(S)?K=S:Ze(S)?K=Ot(S):te?(G=!1,K=cd(k,!0)):se?(G=!1,K=ld(k,!0)):K=[]:ts(k)||kn(k)?(K=S,kn(S)?K=ap(S):(!Ve(S)||zr(S))&&(K=Cd(k))):G=!1}G&&(w.set(k,K),d(K,k,f,g,w),w.delete(k)),ku(r,o,K)}function Zh(r,i){var o=r.length;if(o)return i+=i<0?o:0,Gr(i,o)?r[i]:n}function Xh(r,i,o){i.length?i=$e(i,function(g){return le(g)?function(w){return On(w,g.length===1?g[0]:g)}:g}):i=[kt];var f=-1;i=$e(i,Nt(ie()));var d=jh(r,function(g,w,S){var k=$e(i,function(H){return H(g)});return{criteria:k,index:++f,value:g}});return Rb(d,function(g,w){return gS(g,w,o)})}function iS(r,i){return ed(r,i,function(o,f){return fc(r,f)})}function ed(r,i,o){for(var f=-1,d=i.length,g={};++f<d;){var w=i[f],S=On(r,w);o(S,w)&&Qi(g,cn(w,r),S)}return g}function sS(r){return function(i){return On(i,r)}}function Bu(r,i,o,f){var d=f?kb:Qn,g=-1,w=i.length,S=r;for(r===i&&(i=Ot(i)),o&&(S=$e(r,Nt(o)));++g<w;)for(var k=0,H=i[g],K=o?o(H):H;(k=d(S,K,k,f))>-1;)S!==r&&oa.call(S,k,1),oa.call(r,k,1);return r}function td(r,i){for(var o=r?i.length:0,f=o-1;o--;){var d=i[o];if(o==f||d!==g){var g=d;Gr(d)?oa.call(r,d,1):Yu(r,d)}}return r}function Fu(r,i){return r+la(Nh()*(i-r+1))}function aS(r,i,o,f){for(var d=-1,g=nt(ca((i-r)/(o||1)),0),w=I(g);g--;)w[f?g:++d]=r,r+=o;return w}function Wu(r,i){var o="";if(!r||i<1||i>D)return o;do i%2&&(o+=r),i=la(i/2),i&&(r+=r);while(i);return o}function ge(r,i){return nc(Pd(r,i,kt),r+"")}function oS(r){return Bh(ci(r))}function uS(r,i){var o=ci(r);return xa(o,An(i,0,o.length))}function Qi(r,i,o,f){if(!Ve(r))return r;i=cn(i,r);for(var d=-1,g=i.length,w=g-1,S=r;S!=null&&++d<g;){var k=Or(i[d]),H=o;if(k==="__proto__"||k==="constructor"||k==="prototype")return r;if(d!=w){var K=S[k];H=f?f(K,k,S):n,H===n&&(H=Ve(K)?K:Gr(i[d+1])?[]:{})}zi(S,k,H),S=S[k]}return r}var rd=fa?function(r,i){return fa.set(r,i),r}:kt,cS=ua?function(r,i){return ua(r,"toString",{configurable:!0,enumerable:!1,value:dc(i),writable:!0})}:kt;function lS(r){return xa(ci(r))}function Xt(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=I(d);++f<d;)g[f]=r[f+i];return g}function fS(r,i){var o;return on(r,function(f,d,g){return o=i(f,d,g),!o}),!!o}function _a(r,i,o){var f=0,d=r==null?f:r.length;if(typeof i=="number"&&i===i&&d<=Le){for(;f<d;){var g=f+d>>>1,w=r[g];w!==null&&!It(w)&&(o?w<=i:w<i)?f=g+1:d=g}return d}return Hu(r,i,kt,o)}function Hu(r,i,o,f){var d=0,g=r==null?0:r.length;if(g===0)return 0;i=o(i);for(var w=i!==i,S=i===null,k=It(i),H=i===n;d<g;){var K=la((d+g)/2),G=o(r[K]),j=G!==n,te=G===null,se=G===G,me=It(G);if(w)var ae=f||se;else H?ae=se&&(f||j):S?ae=se&&j&&(f||!te):k?ae=se&&j&&!te&&(f||!me):te||me?ae=!1:ae=f?G<=i:G<i;ae?d=K+1:g=K}return pt(g,de)}function nd(r,i){for(var o=-1,f=r.length,d=0,g=[];++o<f;){var w=r[o],S=i?i(w):w;if(!o||!hr(S,k)){var k=S;g[d++]=w===0?0:w}}return g}function id(r){return typeof r=="number"?r:It(r)?X:+r}function Ut(r){if(typeof r=="string")return r;if(le(r))return $e(r,Ut)+"";if(It(r))return Uh?Uh.call(r):"";var i=r+"";return i=="0"&&1/r==-L?"-0":i}function un(r,i,o){var f=-1,d=Qs,g=r.length,w=!0,S=[],k=S;if(o)w=!1,d=gu;else if(g>=a){var H=i?null:SS(r);if(H)return Xs(H);w=!1,d=Hi,k=new En}else k=i?[]:S;e:for(;++f<g;){var K=r[f],G=i?i(K):K;if(K=o||K!==0?K:0,w&&G===G){for(var j=k.length;j--;)if(k[j]===G)continue e;i&&k.push(G),S.push(K)}else d(k,G,o)||(k!==S&&k.push(G),S.push(K))}return S}function Yu(r,i){return i=cn(i,r),r=Dd(r,i),r==null||delete r[Or(er(i))]}function sd(r,i,o,f){return Qi(r,i,o(On(r,i)),f)}function wa(r,i,o,f){for(var d=r.length,g=f?d:-1;(f?g--:++g<d)&&i(r[g],g,r););return o?Xt(r,f?0:g,f?g+1:d):Xt(r,f?g+1:0,f?d:g)}function ad(r,i){var o=r;return o instanceof be&&(o=o.value()),yu(i,function(f,d){return d.func.apply(d.thisArg,nn([f],d.args))},o)}function Ku(r,i,o){var f=r.length;if(f<2)return f?un(r[0]):[];for(var d=-1,g=I(f);++d<f;)for(var w=r[d],S=-1;++S<f;)S!=d&&(g[d]=Vi(g[d]||w,r[S],i,o));return un(lt(g,1),i,o)}function od(r,i,o){for(var f=-1,d=r.length,g=i.length,w={};++f<d;){var S=f<g?i[f]:n;o(w,r[f],S)}return w}function qu(r){return Ze(r)?r:[]}function $u(r){return typeof r=="function"?r:kt}function cn(r,i){return le(r)?r:ec(r,i)?[r]:Ud(Pe(r))}var hS=ge;function ln(r,i,o){var f=r.length;return o=o===n?f:o,!i&&o>=f?r:Xt(r,i,o)}var ud=Xb||function(r){return ct.clearTimeout(r)};function cd(r,i){if(i)return r.slice();var o=r.length,f=Rh?Rh(o):new r.constructor(o);return r.copy(f),f}function Gu(r){var i=new r.constructor(r.byteLength);return new sa(i).set(new sa(r)),i}function dS(r,i){var o=i?Gu(r.buffer):r.buffer;return new r.constructor(o,r.byteOffset,r.byteLength)}function pS(r){var i=new r.constructor(r.source,Gf.exec(r));return i.lastIndex=r.lastIndex,i}function mS(r){return Gi?Ie(Gi.call(r)):{}}function ld(r,i){var o=i?Gu(r.buffer):r.buffer;return new r.constructor(o,r.byteOffset,r.length)}function fd(r,i){if(r!==i){var o=r!==n,f=r===null,d=r===r,g=It(r),w=i!==n,S=i===null,k=i===i,H=It(i);if(!S&&!H&&!g&&r>i||g&&w&&k&&!S&&!H||f&&w&&k||!o&&k||!d)return 1;if(!f&&!g&&!H&&r<i||H&&o&&d&&!f&&!g||S&&o&&d||!w&&d||!k)return-1}return 0}function gS(r,i,o){for(var f=-1,d=r.criteria,g=i.criteria,w=d.length,S=o.length;++f<w;){var k=fd(d[f],g[f]);if(k){if(f>=S)return k;var H=o[f];return k*(H=="desc"?-1:1)}}return r.index-i.index}function hd(r,i,o,f){for(var d=-1,g=r.length,w=o.length,S=-1,k=i.length,H=nt(g-w,0),K=I(k+H),G=!f;++S<k;)K[S]=i[S];for(;++d<w;)(G||d<g)&&(K[o[d]]=r[d]);for(;H--;)K[S++]=r[d++];return K}function dd(r,i,o,f){for(var d=-1,g=r.length,w=-1,S=o.length,k=-1,H=i.length,K=nt(g-S,0),G=I(K+H),j=!f;++d<K;)G[d]=r[d];for(var te=d;++k<H;)G[te+k]=i[k];for(;++w<S;)(j||d<g)&&(G[te+o[w]]=r[d++]);return G}function Ot(r,i){var o=-1,f=r.length;for(i||(i=I(f));++o<f;)i[o]=r[o];return i}function Ar(r,i,o,f){var d=!o;o||(o={});for(var g=-1,w=i.length;++g<w;){var S=i[g],k=f?f(o[S],r[S],S,o,r):n;k===n&&(k=r[S]),d?Kr(o,S,k):zi(o,S,k)}return o}function yS(r,i){return Ar(r,Xu(r),i)}function _S(r,i){return Ar(r,Od(r),i)}function ba(r,i){return function(o,f){var d=le(o)?Tb:Wv,g=i?i():{};return d(o,r,ie(f,2),g)}}function si(r){return ge(function(i,o){var f=-1,d=o.length,g=d>1?o[d-1]:n,w=d>2?o[2]:n;for(g=r.length>3&&typeof g=="function"?(d--,g):n,w&&bt(o[0],o[1],w)&&(g=d<3?n:g,d=1),i=Ie(i);++f<d;){var S=o[f];S&&r(i,S,f,g)}return i})}function pd(r,i){return function(o,f){if(o==null)return o;if(!xt(o))return r(o,f);for(var d=o.length,g=i?d:-1,w=Ie(o);(i?g--:++g<d)&&f(w[g],g,w)!==!1;);return o}}function md(r){return function(i,o,f){for(var d=-1,g=Ie(i),w=f(i),S=w.length;S--;){var k=w[r?S:++d];if(o(g[k],k,g)===!1)break}return i}}function wS(r,i,o){var f=i&F,d=Zi(r);function g(){var w=this&&this!==ct&&this instanceof g?d:r;return w.apply(f?o:this,arguments)}return g}function gd(r){return function(i){i=Pe(i);var o=Zn(i)?lr(i):n,f=o?o[0]:i.charAt(0),d=o?ln(o,1).join(""):i.slice(1);return f[r]()+d}}function ai(r){return function(i){return yu(pp(dp(i).replace(cb,"")),r,"")}}function Zi(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=ii(r.prototype),f=r.apply(o,i);return Ve(f)?f:o}}function bS(r,i,o){var f=Zi(r);function d(){for(var g=arguments.length,w=I(g),S=g,k=oi(d);S--;)w[S]=arguments[S];var H=g<3&&w[0]!==k&&w[g-1]!==k?[]:sn(w,k);if(g-=H.length,g<o)return vd(r,i,va,d.placeholder,n,w,H,n,n,o-g);var K=this&&this!==ct&&this instanceof d?f:r;return Lt(K,this,w)}return d}function yd(r){return function(i,o,f){var d=Ie(i);if(!xt(i)){var g=ie(o,3);i=at(i),o=function(S){return g(d[S],S,d)}}var w=r(i,o,f);return w>-1?d[g?i[w]:w]:n}}function _d(r){return $r(function(i){var o=i.length,f=o,d=Qt.prototype.thru;for(r&&i.reverse();f--;){var g=i[f];if(typeof g!="function")throw new Jt(u);if(d&&!w&&Aa(g)=="wrapper")var w=new Qt([],!0)}for(f=w?f:o;++f<o;){g=i[f];var S=Aa(g),k=S=="wrapper"?Qu(g):n;k&&tc(k[0])&&k[1]==(ke|Ee|ye|y)&&!k[4].length&&k[9]==1?w=w[Aa(k[0])].apply(w,k[3]):w=g.length==1&&tc(g)?w[S]():w.thru(g)}return function(){var H=arguments,K=H[0];if(w&&H.length==1&&le(K))return w.plant(K).value();for(var G=0,j=o?i[G].apply(this,H):K;++G<o;)j=i[G].call(this,j);return j}})}function va(r,i,o,f,d,g,w,S,k,H){var K=i&ke,G=i&F,j=i&re,te=i&(Ee|ve),se=i&_,me=j?n:Zi(r);function ae(){for(var _e=arguments.length,Se=I(_e),Bt=_e;Bt--;)Se[Bt]=arguments[Bt];if(te)var vt=oi(ae),Ft=Db(Se,vt);if(f&&(Se=hd(Se,f,d,te)),g&&(Se=dd(Se,g,w,te)),_e-=Ft,te&&_e<H){var Xe=sn(Se,vt);return vd(r,i,va,ae.placeholder,o,Se,Xe,S,k,H-_e)}var dr=G?o:this,jr=j?dr[r]:r;return _e=Se.length,S?Se=WS(Se,S):se&&_e>1&&Se.reverse(),K&&k<_e&&(Se.length=k),this&&this!==ct&&this instanceof ae&&(jr=me||Zi(jr)),jr.apply(dr,Se)}return ae}function wd(r,i){return function(o,f){return Vv(o,r,i(f),{})}}function Sa(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=Ut(o),f=Ut(f)):(o=id(o),f=id(f)),d=r(o,f)}return d}}function zu(r){return $r(function(i){return i=$e(i,Nt(ie())),ge(function(o){var f=this;return r(i,function(d){return Lt(d,f,o)})})})}function Ta(r,i){i=i===n?" ":Ut(i);var o=i.length;if(o<2)return o?Wu(i,r):i;var f=Wu(i,ca(r/Xn(i)));return Zn(i)?ln(lr(f),0,r).join(""):f.slice(0,r)}function vS(r,i,o,f){var d=i&F,g=Zi(r);function w(){for(var S=-1,k=arguments.length,H=-1,K=f.length,G=I(K+k),j=this&&this!==ct&&this instanceof w?g:r;++H<K;)G[H]=f[H];for(;k--;)G[H++]=arguments[++S];return Lt(j,d?o:this,G)}return w}function bd(r){return function(i,o,f){return f&&typeof f!="number"&&bt(i,o,f)&&(o=f=n),i=Vr(i),o===n?(o=i,i=0):o=Vr(o),f=f===n?i<o?1:-1:Vr(f),aS(i,o,f,r)}}function Ea(r){return function(i,o){return typeof i=="string"&&typeof o=="string"||(i=tr(i),o=tr(o)),r(i,o)}}function vd(r,i,o,f,d,g,w,S,k,H){var K=i&Ee,G=K?w:n,j=K?n:w,te=K?g:n,se=K?n:g;i|=K?ye:Be,i&=~(K?Be:ye),i&Y||(i&=-4);var me=[r,i,d,te,G,se,j,S,k,H],ae=o.apply(n,me);return tc(r)&&Md(ae,me),ae.placeholder=f,Ld(ae,r,i)}function Vu(r){var i=rt[r];return function(o,f){if(o=tr(o),f=f==null?0:pt(pe(f),292),f&&Lh(o)){var d=(Pe(o)+"e").split("e"),g=i(d[0]+"e"+(+d[1]+f));return d=(Pe(g)+"e").split("e"),+(d[0]+"e"+(+d[1]-f))}return i(o)}}var SS=ri&&1/Xs(new ri([,-0]))[1]==L?function(r){return new ri(r)}:gc;function Sd(r){return function(i){var o=mt(i);return o==Ue?Eu(i):o==cr?Fb(i):Pb(i,r(i))}}function qr(r,i,o,f,d,g,w,S){var k=i&re;if(!k&&typeof r!="function")throw new Jt(u);var H=f?f.length:0;if(H||(i&=-97,f=d=n),w=w===n?w:nt(pe(w),0),S=S===n?S:pe(S),H-=d?d.length:0,i&Be){var K=f,G=d;f=d=n}var j=k?n:Qu(r),te=[r,i,o,f,d,K,G,g,w,S];if(j&&IS(te,j),r=te[0],i=te[1],o=te[2],f=te[3],d=te[4],S=te[9]=te[9]===n?k?0:r.length:nt(te[9]-H,0),!S&&i&(Ee|ve)&&(i&=-25),!i||i==F)var se=wS(r,i,o);else i==Ee||i==ve?se=bS(r,i,S):(i==ye||i==(F|ye))&&!d.length?se=vS(r,i,o,f):se=va.apply(n,te);var me=j?rd:Md;return Ld(me(se,te),r,i)}function Td(r,i,o,f){return r===n||hr(r,ti[o])&&!De.call(f,o)?i:r}function Ed(r,i,o,f,d,g){return Ve(r)&&Ve(i)&&(g.set(i,r),ya(r,i,n,Ed,g),g.delete(i)),r}function TS(r){return ts(r)?n:r}function Ad(r,i,o,f,d,g){var w=o&O,S=r.length,k=i.length;if(S!=k&&!(w&&k>S))return!1;var H=g.get(r),K=g.get(i);if(H&&K)return H==i&&K==r;var G=-1,j=!0,te=o&B?new En:n;for(g.set(r,i),g.set(i,r);++G<S;){var se=r[G],me=i[G];if(f)var ae=w?f(me,se,G,i,r,g):f(se,me,G,r,i,g);if(ae!==n){if(ae)continue;j=!1;break}if(te){if(!_u(i,function(_e,Se){if(!Hi(te,Se)&&(se===_e||d(se,_e,o,f,g)))return te.push(Se)})){j=!1;break}}else if(!(se===me||d(se,me,o,f,g))){j=!1;break}}return g.delete(r),g.delete(i),j}function ES(r,i,o,f,d,g,w){switch(o){case jn:if(r.byteLength!=i.byteLength||r.byteOffset!=i.byteOffset)return!1;r=r.buffer,i=i.buffer;case Wi:return!(r.byteLength!=i.byteLength||!g(new sa(r),new sa(i)));case Sr:case Fr:case Ne:return hr(+r,+i);case yt:return r.name==i.name&&r.message==i.message;case Ii:case Bi:return r==i+"";case Ue:var S=Eu;case cr:var k=f&O;if(S||(S=Xs),r.size!=i.size&&!k)return!1;var H=w.get(r);if(H)return H==i;f|=B,w.set(r,i);var K=Ad(S(r),S(i),f,d,g,w);return w.delete(r),K;case zs:if(Gi)return Gi.call(r)==Gi.call(i)}return!1}function AS(r,i,o,f,d,g){var w=o&O,S=ju(r),k=S.length,H=ju(i),K=H.length;if(k!=K&&!w)return!1;for(var G=k;G--;){var j=S[G];if(!(w?j in i:De.call(i,j)))return!1}var te=g.get(r),se=g.get(i);if(te&&se)return te==i&&se==r;var me=!0;g.set(r,i),g.set(i,r);for(var ae=w;++G<k;){j=S[G];var _e=r[j],Se=i[j];if(f)var Bt=w?f(Se,_e,j,i,r,g):f(_e,Se,j,r,i,g);if(!(Bt===n?_e===Se||d(_e,Se,o,f,g):Bt)){me=!1;break}ae||(ae=j=="constructor")}if(me&&!ae){var vt=r.constructor,Ft=i.constructor;vt!=Ft&&"constructor"in r&&"constructor"in i&&!(typeof vt=="function"&&vt instanceof vt&&typeof Ft=="function"&&Ft instanceof Ft)&&(me=!1)}return g.delete(r),g.delete(i),me}function $r(r){return nc(Pd(r,n,Wd),r+"")}function ju(r){return $h(r,at,Xu)}function Ju(r){return $h(r,Ct,Od)}var Qu=fa?function(r){return fa.get(r)}:gc;function Aa(r){for(var i=r.name+"",o=ni[i],f=De.call(ni,i)?o.length:0;f--;){var d=o[f],g=d.func;if(g==null||g==r)return d.name}return i}function oi(r){var i=De.call(p,"placeholder")?p:r;return i.placeholder}function ie(){var r=p.iteratee||pc;return r=r===pc?Vh:r,arguments.length?r(arguments[0],arguments[1]):r}function Oa(r,i){var o=r.__data__;return MS(i)?o[typeof i=="string"?"string":"hash"]:o.map}function Zu(r){for(var i=at(r),o=i.length;o--;){var f=i[o],d=r[f];i[o]=[f,d,kd(d)]}return i}function xn(r,i){var o=Ub(r,i);return zh(o)?o:n}function OS(r){var i=De.call(r,Sn),o=r[Sn];try{r[Sn]=n;var f=!0}catch{}var d=na.call(r);return f&&(i?r[Sn]=o:delete r[Sn]),d}var Xu=Ou?function(r){return r==null?[]:(r=Ie(r),rn(Ou(r),function(i){return Dh.call(r,i)}))}:yc,Od=Ou?function(r){for(var i=[];r;)nn(i,Xu(r)),r=aa(r);return i}:yc,mt=wt;(xu&&mt(new xu(new ArrayBuffer(1)))!=jn||Ki&&mt(new Ki)!=Ue||Cu&&mt(Cu.resolve())!=Yf||ri&&mt(new ri)!=cr||qi&&mt(new qi)!=Fi)&&(mt=function(r){var i=wt(r),o=i==Wr?r.constructor:n,f=o?Cn(o):"";if(f)switch(f){case uv:return jn;case cv:return Ue;case lv:return Yf;case fv:return cr;case hv:return Fi}return i});function xS(r,i,o){for(var f=-1,d=o.length;++f<d;){var g=o[f],w=g.size;switch(g.type){case"drop":r+=w;break;case"dropRight":i-=w;break;case"take":i=pt(i,r+w);break;case"takeRight":r=nt(r,i-w);break}}return{start:r,end:i}}function CS(r){var i=r.match(L1);return i?i[1].split(N1):[]}function xd(r,i,o){i=cn(i,r);for(var f=-1,d=i.length,g=!1;++f<d;){var w=Or(i[f]);if(!(g=r!=null&&o(r,w)))break;r=r[w]}return g||++f!=d?g:(d=r==null?0:r.length,!!d&&Ma(d)&&Gr(w,d)&&(le(r)||kn(r)))}function kS(r){var i=r.length,o=new r.constructor(i);return i&&typeof r[0]=="string"&&De.call(r,"index")&&(o.index=r.index,o.input=r.input),o}function Cd(r){return typeof r.constructor=="function"&&!Xi(r)?ii(aa(r)):{}}function RS(r,i,o){var f=r.constructor;switch(i){case Wi:return Gu(r);case Sr:case Fr:return new f(+r);case jn:return dS(r,o);case Zo:case Xo:case eu:case tu:case ru:case nu:case iu:case su:case au:return ld(r,o);case Ue:return new f;case Ne:case Bi:return new f(r);case Ii:return pS(r);case cr:return new f;case zs:return mS(r)}}function PS(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(M1,`{
|
|
14
|
+
*/var lg=wi.exports,vl;function fg(){return vl||(vl=1,(function(e,t){(function(){var n,s="4.17.21",a=200,c="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",u="Expected a function",l="Invalid `variable` option passed into `_.template`",h="__lodash_hash_undefined__",m=500,b="__lodash_placeholder__",E=1,R=2,$=4,O=1,I=2,F=1,ne=2,Y=4,Ae=8,Se=16,_e=32,Fe=64,Re=128,y=256,_=512,v=30,M="...",C=800,P=16,N=1,T=2,k=3,L=1/0,D=9007199254740991,q=17976931348623157e292,te=NaN,J=4294967295,pe=J-1,Ne=J>>>1,We=[["ary",Re],["bind",F],["bindKey",ne],["curry",Ae],["curryRight",Se],["flip",_],["partial",_e],["partialRight",Fe],["rearg",y]],le="[object Arguments]",Oe="[object Array]",at="[object AsyncFunction]",Er="[object Boolean]",Fr="[object Date]",Ii="[object DOMException]",wt="[object Error]",Tr="[object Function]",bt="[object GeneratorFunction]",Be="[object Map]",Ue="[object Number]",T1="[object Null]",Wr="[object Object]",nh="[object Promise]",A1="[object Proxy]",Fi="[object RegExp]",lr="[object Set]",Wi="[object String]",ea="[object Symbol]",O1="[object Undefined]",Hi="[object WeakMap]",C1="[object WeakSet]",Yi="[object ArrayBuffer]",Jn="[object DataView]",du="[object Float32Array]",pu="[object Float64Array]",mu="[object Int8Array]",gu="[object Int16Array]",yu="[object Int32Array]",_u="[object Uint8Array]",wu="[object Uint8ClampedArray]",bu="[object Uint16Array]",vu="[object Uint32Array]",k1=/\b__p \+= '';/g,x1=/\b(__p \+=) '' \+/g,R1=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ih=/&(?:amp|lt|gt|quot|#39);/g,sh=/[&<>"']/g,P1=RegExp(ih.source),D1=RegExp(sh.source),M1=/<%-([\s\S]+?)%>/g,L1=/<%([\s\S]+?)%>/g,ah=/<%=([\s\S]+?)%>/g,N1=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,U1=/^\w*$/,B1=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Su=/[\\^$.*+?()[\]{}|]/g,I1=RegExp(Su.source),Eu=/^\s+/,F1=/\s/,W1=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,H1=/\{\n\/\* \[wrapped with (.+)\] \*/,Y1=/,? & /,K1=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,q1=/[()=,{}\[\]\/\s]/,$1=/\\(\\)?/g,G1=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,oh=/\w*$/,V1=/^[-+]0x[0-9a-f]+$/i,z1=/^0b[01]+$/i,j1=/^\[object .+?Constructor\]$/,J1=/^0o[0-7]+$/i,Q1=/^(?:0|[1-9]\d*)$/,Z1=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ta=/($^)/,X1=/['\n\r\u2028\u2029\\]/g,ra="\\ud800-\\udfff",eb="\\u0300-\\u036f",tb="\\ufe20-\\ufe2f",rb="\\u20d0-\\u20ff",uh=eb+tb+rb,ch="\\u2700-\\u27bf",lh="a-z\\xdf-\\xf6\\xf8-\\xff",nb="\\xac\\xb1\\xd7\\xf7",ib="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",sb="\\u2000-\\u206f",ab=" \\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=nb+ib+sb+ab,Tu="['’]",ob="["+ra+"]",ph="["+dh+"]",na="["+uh+"]",mh="\\d+",ub="["+ch+"]",gh="["+lh+"]",yh="[^"+ra+dh+mh+ch+lh+fh+"]",Au="\\ud83c[\\udffb-\\udfff]",cb="(?:"+na+"|"+Au+")",_h="[^"+ra+"]",Ou="(?:\\ud83c[\\udde6-\\uddff]){2}",Cu="[\\ud800-\\udbff][\\udc00-\\udfff]",Qn="["+fh+"]",wh="\\u200d",bh="(?:"+gh+"|"+yh+")",lb="(?:"+Qn+"|"+yh+")",vh="(?:"+Tu+"(?:d|ll|m|re|s|t|ve))?",Sh="(?:"+Tu+"(?:D|LL|M|RE|S|T|VE))?",Eh=cb+"?",Th="["+hh+"]?",fb="(?:"+wh+"(?:"+[_h,Ou,Cu].join("|")+")"+Th+Eh+")*",hb="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",db="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Ah=Th+Eh+fb,pb="(?:"+[ub,Ou,Cu].join("|")+")"+Ah,mb="(?:"+[_h+na+"?",na,Ou,Cu,ob].join("|")+")",gb=RegExp(Tu,"g"),yb=RegExp(na,"g"),ku=RegExp(Au+"(?="+Au+")|"+mb+Ah,"g"),_b=RegExp([Qn+"?"+gh+"+"+vh+"(?="+[ph,Qn,"$"].join("|")+")",lb+"+"+Sh+"(?="+[ph,Qn+bh,"$"].join("|")+")",Qn+"?"+bh+"+"+vh,Qn+"+"+Sh,db,hb,mh,pb].join("|"),"g"),wb=RegExp("["+wh+ra+uh+hh+"]"),bb=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,vb=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Sb=-1,qe={};qe[du]=qe[pu]=qe[mu]=qe[gu]=qe[yu]=qe[_u]=qe[wu]=qe[bu]=qe[vu]=!0,qe[le]=qe[Oe]=qe[Yi]=qe[Er]=qe[Jn]=qe[Fr]=qe[wt]=qe[Tr]=qe[Be]=qe[Ue]=qe[Wr]=qe[Fi]=qe[lr]=qe[Wi]=qe[Hi]=!1;var He={};He[le]=He[Oe]=He[Yi]=He[Jn]=He[Er]=He[Fr]=He[du]=He[pu]=He[mu]=He[gu]=He[yu]=He[Be]=He[Ue]=He[Wr]=He[Fi]=He[lr]=He[Wi]=He[ea]=He[_u]=He[wu]=He[bu]=He[vu]=!0,He[wt]=He[Tr]=He[Hi]=!1;var Eb={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Tb={"&":"&","<":"<",">":">",'"':""","'":"'"},Ab={"&":"&","<":"<",">":">",""":'"',"'":"'"},Ob={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Cb=parseFloat,kb=parseInt,Oh=typeof ys=="object"&&ys&&ys.Object===Object&&ys,xb=typeof self=="object"&&self&&self.Object===Object&&self,ft=Oh||xb||Function("return this")(),xu=t&&!t.nodeType&&t,An=xu&&!0&&e&&!e.nodeType&&e,Ch=An&&An.exports===xu,Ru=Ch&&Oh.process,Jt=(function(){try{var A=An&&An.require&&An.require("util").types;return A||Ru&&Ru.binding&&Ru.binding("util")}catch{}})(),kh=Jt&&Jt.isArrayBuffer,xh=Jt&&Jt.isDate,Rh=Jt&&Jt.isMap,Ph=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,Pe=A==null?0:A.length;++ue<Pe;){var nt=A[ue];W(Z,nt,B(nt),A)}return Z}function Qt(A,W){for(var B=-1,Z=A==null?0:A.length;++B<Z&&W(A[B],B,A)!==!1;);return A}function Pb(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,Pe=[];++B<Z;){var nt=A[B];W(nt,B,A)&&(Pe[ue++]=nt)}return Pe}function ia(A,W){var B=A==null?0:A.length;return!!B&&Zn(A,W,0)>-1}function Pu(A,W,B){for(var Z=-1,ue=A==null?0:A.length;++Z<ue;)if(B(W,A[Z]))return!0;return!1}function Ve(A,W){for(var B=-1,Z=A==null?0:A.length,ue=Array(Z);++B<Z;)ue[B]=W(A[B],B,A);return ue}function sn(A,W){for(var B=-1,Z=W.length,ue=A.length;++B<Z;)A[ue+B]=W[B];return A}function Du(A,W,B,Z){var ue=-1,Pe=A==null?0:A.length;for(Z&&Pe&&(B=A[++ue]);++ue<Pe;)B=W(B,A[ue],ue,A);return B}function Db(A,W,B,Z){var ue=A==null?0:A.length;for(Z&&ue&&(B=A[--ue]);ue--;)B=W(B,A[ue],ue,A);return B}function Mu(A,W){for(var B=-1,Z=A==null?0:A.length;++B<Z;)if(W(A[B],B,A))return!0;return!1}var Mb=Lu("length");function Lb(A){return A.split("")}function Nb(A){return A.match(K1)||[]}function Nh(A,W,B){var Z;return B(A,function(ue,Pe,nt){if(W(ue,Pe,nt))return Z=Pe,!1}),Z}function sa(A,W,B,Z){for(var ue=A.length,Pe=B+(Z?1:-1);Z?Pe--:++Pe<ue;)if(W(A[Pe],Pe,A))return Pe;return-1}function Zn(A,W,B){return W===W?Vb(A,W,B):sa(A,Uh,B)}function Ub(A,W,B,Z){for(var ue=B-1,Pe=A.length;++ue<Pe;)if(Z(A[ue],W))return ue;return-1}function Uh(A){return A!==A}function Bh(A,W){var B=A==null?0:A.length;return B?Uu(A,W)/B:te}function Lu(A){return function(W){return W==null?n:W[A]}}function Nu(A){return function(W){return A==null?n:A[W]}}function Ih(A,W,B,Z,ue){return ue(A,function(Pe,nt,Ie){B=Z?(Z=!1,Pe):W(B,Pe,nt,Ie)}),B}function Bb(A,W){var B=A.length;for(A.sort(W);B--;)A[B]=A[B].value;return A}function Uu(A,W){for(var B,Z=-1,ue=A.length;++Z<ue;){var Pe=W(A[Z]);Pe!==n&&(B=B===n?Pe:B+Pe)}return B}function Bu(A,W){for(var B=-1,Z=Array(A);++B<A;)Z[B]=W(B);return Z}function Ib(A,W){return Ve(W,function(B){return[B,A[B]]})}function Fh(A){return A&&A.slice(0,Kh(A)+1).replace(Eu,"")}function Bt(A){return function(W){return A(W)}}function Iu(A,W){return Ve(W,function(B){return A[B]})}function Ki(A,W){return A.has(W)}function Wh(A,W){for(var B=-1,Z=A.length;++B<Z&&Zn(W,A[B],0)>-1;);return B}function Hh(A,W){for(var B=A.length;B--&&Zn(W,A[B],0)>-1;);return B}function Fb(A,W){for(var B=A.length,Z=0;B--;)A[B]===W&&++Z;return Z}var Wb=Nu(Eb),Hb=Nu(Tb);function Yb(A){return"\\"+Ob[A]}function Kb(A,W){return A==null?n:A[W]}function Xn(A){return wb.test(A)}function qb(A){return bb.test(A)}function $b(A){for(var W,B=[];!(W=A.next()).done;)B.push(W.value);return B}function Fu(A){var W=-1,B=Array(A.size);return A.forEach(function(Z,ue){B[++W]=[ue,Z]}),B}function Yh(A,W){return function(B){return A(W(B))}}function an(A,W){for(var B=-1,Z=A.length,ue=0,Pe=[];++B<Z;){var nt=A[B];(nt===W||nt===b)&&(A[B]=b,Pe[ue++]=B)}return Pe}function aa(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 Vb(A,W,B){for(var Z=B-1,ue=A.length;++Z<ue;)if(A[Z]===W)return Z;return-1}function zb(A,W,B){for(var Z=B+1;Z--;)if(A[Z]===W)return Z;return Z}function ei(A){return Xn(A)?Jb(A):Mb(A)}function fr(A){return Xn(A)?Qb(A):Lb(A)}function Kh(A){for(var W=A.length;W--&&F1.test(A.charAt(W)););return W}var jb=Nu(Ab);function Jb(A){for(var W=ku.lastIndex=0;ku.test(A);)++W;return W}function Qb(A){return A.match(ku)||[]}function Zb(A){return A.match(_b)||[]}var Xb=(function A(W){W=W==null?ft:ti.defaults(ft.Object(),W,ti.pick(ft,vb));var B=W.Array,Z=W.Date,ue=W.Error,Pe=W.Function,nt=W.Math,Ie=W.Object,Wu=W.RegExp,ev=W.String,Zt=W.TypeError,oa=B.prototype,tv=Pe.prototype,ri=Ie.prototype,ua=W["__core-js_shared__"],ca=tv.toString,Me=ri.hasOwnProperty,rv=0,qh=(function(){var r=/[^.]+$/.exec(ua&&ua.keys&&ua.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""})(),la=ri.toString,nv=ca.call(Ie),iv=ft._,sv=Wu("^"+ca.call(Me).replace(Su,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),fa=Ch?W.Buffer:n,on=W.Symbol,ha=W.Uint8Array,$h=fa?fa.allocUnsafe:n,da=Yh(Ie.getPrototypeOf,Ie),Gh=Ie.create,Vh=ri.propertyIsEnumerable,pa=oa.splice,zh=on?on.isConcatSpreadable:n,qi=on?on.iterator:n,On=on?on.toStringTag:n,ma=(function(){try{var r=Pn(Ie,"defineProperty");return r({},"",{}),r}catch{}})(),av=W.clearTimeout!==ft.clearTimeout&&W.clearTimeout,ov=Z&&Z.now!==ft.Date.now&&Z.now,uv=W.setTimeout!==ft.setTimeout&&W.setTimeout,ga=nt.ceil,ya=nt.floor,Hu=Ie.getOwnPropertySymbols,cv=fa?fa.isBuffer:n,jh=W.isFinite,lv=oa.join,fv=Yh(Ie.keys,Ie),it=nt.max,mt=nt.min,hv=Z.now,dv=W.parseInt,Jh=nt.random,pv=oa.reverse,Yu=Pn(W,"DataView"),$i=Pn(W,"Map"),Ku=Pn(W,"Promise"),ni=Pn(W,"Set"),Gi=Pn(W,"WeakMap"),Vi=Pn(Ie,"create"),_a=Gi&&new Gi,ii={},mv=Dn(Yu),gv=Dn($i),yv=Dn(Ku),_v=Dn(ni),wv=Dn(Gi),wa=on?on.prototype:n,zi=wa?wa.valueOf:n,Qh=wa?wa.toString:n;function p(r){if(Je(r)&&!fe(r)&&!(r instanceof ve)){if(r instanceof Xt)return r;if(Me.call(r,"__wrapped__"))return Zd(r)}return new Xt(r)}var si=(function(){function r(){}return function(i){if(!je(i))return{};if(Gh)return Gh(i);r.prototype=i;var o=new r;return r.prototype=n,o}})();function ba(){}function Xt(r,i){this.__wrapped__=r,this.__actions__=[],this.__chain__=!!i,this.__index__=0,this.__values__=n}p.templateSettings={escape:M1,evaluate:L1,interpolate:ah,variable:"",imports:{_:p}},p.prototype=ba.prototype,p.prototype.constructor=p,Xt.prototype=si(ba.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 bv(){var r=new ve(this.__wrapped__);return r.__actions__=Rt(this.__actions__),r.__dir__=this.__dir__,r.__filtered__=this.__filtered__,r.__iteratees__=Rt(this.__iteratees__),r.__takeCount__=this.__takeCount__,r.__views__=Rt(this.__views__),r}function vv(){if(this.__filtered__){var r=new ve(this);r.__dir__=-1,r.__filtered__=!0}else r=this.clone(),r.__dir__*=-1;return r}function Sv(){var r=this.__wrapped__.value(),i=this.__dir__,o=fe(r),f=i<0,d=o?r.length:0,g=LS(0,d,this.__views__),w=g.start,S=g.end,x=S-w,H=f?S:w-1,K=this.__iteratees__,G=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<G;){var we=K[ge],Ee=we.iteratee,Wt=we.type,Et=Ee(oe);if(Wt==T)oe=Et;else if(!Et){if(Wt==N)continue e;break e}}ae[j++]=oe}return ae}ve.prototype=si(ba.prototype),ve.prototype.constructor=ve;function Cn(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__=Vi?Vi(null):{},this.size=0}function Tv(r){var i=this.has(r)&&delete this.__data__[r];return this.size-=i?1:0,i}function Av(r){var i=this.__data__;if(Vi){var o=i[r];return o===h?n:o}return Me.call(i,r)?i[r]:n}function Ov(r){var i=this.__data__;return Vi?i[r]!==n:Me.call(i,r)}function Cv(r,i){var o=this.__data__;return this.size+=this.has(r)?0:1,o[r]=Vi&&i===n?h:i,this}Cn.prototype.clear=Ev,Cn.prototype.delete=Tv,Cn.prototype.get=Av,Cn.prototype.has=Ov,Cn.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 kv(){this.__data__=[],this.size=0}function xv(r){var i=this.__data__,o=va(i,r);if(o<0)return!1;var f=i.length-1;return o==f?i.pop():pa.call(i,o,1),--this.size,!0}function Rv(r){var i=this.__data__,o=va(i,r);return o<0?n:i[o][1]}function Pv(r){return va(this.__data__,r)>-1}function Dv(r,i){var o=this.__data__,f=va(o,r);return f<0?(++this.size,o.push([r,i])):o[f][1]=i,this}Hr.prototype.clear=kv,Hr.prototype.delete=xv,Hr.prototype.get=Rv,Hr.prototype.has=Pv,Hr.prototype.set=Dv;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 Mv(){this.size=0,this.__data__={hash:new Cn,map:new($i||Hr),string:new Cn}}function Lv(r){var i=Ma(this,r).delete(r);return this.size-=i?1:0,i}function Nv(r){return Ma(this,r).get(r)}function Uv(r){return Ma(this,r).has(r)}function Bv(r,i){var o=Ma(this,r),f=o.size;return o.set(r,i),this.size+=o.size==f?0:1,this}Yr.prototype.clear=Mv,Yr.prototype.delete=Lv,Yr.prototype.get=Nv,Yr.prototype.has=Uv,Yr.prototype.set=Bv;function kn(r){var i=-1,o=r==null?0:r.length;for(this.__data__=new Yr;++i<o;)this.add(r[i])}function Iv(r){return this.__data__.set(r,h),this}function Fv(r){return this.__data__.has(r)}kn.prototype.add=kn.prototype.push=Iv,kn.prototype.has=Fv;function hr(r){var i=this.__data__=new Hr(r);this.size=i.size}function Wv(){this.__data__=new Hr,this.size=0}function Hv(r){var i=this.__data__,o=i.delete(r);return this.size=i.size,o}function Yv(r){return this.__data__.get(r)}function Kv(r){return this.__data__.has(r)}function qv(r,i){var o=this.__data__;if(o instanceof Hr){var f=o.__data__;if(!$i||f.length<a-1)return f.push([r,i]),this.size=++o.size,this;o=this.__data__=new Yr(f)}return o.set(r,i),this.size=o.size,this}hr.prototype.clear=Wv,hr.prototype.delete=Hv,hr.prototype.get=Yv,hr.prototype.has=Kv,hr.prototype.set=qv;function Zh(r,i){var o=fe(r),f=!o&&Mn(r),d=!o&&!f&&hn(r),g=!o&&!f&&!d&&ci(r),w=o||f||d||g,S=w?Bu(r.length,ev):[],x=S.length;for(var H in r)(i||Me.call(r,H))&&!(w&&(H=="length"||d&&(H=="offset"||H=="parent")||g&&(H=="buffer"||H=="byteLength"||H=="byteOffset")||Gr(H,x)))&&S.push(H);return S}function Xh(r){var i=r.length;return i?r[ec(0,i-1)]:n}function $v(r,i){return La(Rt(r),xn(i,0,r.length))}function Gv(r){return La(Rt(r))}function qu(r,i,o){(o!==n&&!dr(r[i],o)||o===n&&!(i in r))&&Kr(r,i,o)}function ji(r,i,o){var f=r[i];(!(Me.call(r,i)&&dr(f,o))||o===n&&!(i in r))&&Kr(r,i,o)}function va(r,i){for(var o=r.length;o--;)if(dr(r[o][0],i))return o;return-1}function Vv(r,i,o,f){return un(r,function(d,g,w){i(f,d,o(d),w)}),f}function ed(r,i){return r&&Or(i,ot(i),r)}function zv(r,i){return r&&Or(i,Dt(i),r)}function Kr(r,i,o){i=="__proto__"&&ma?ma(r,i,{configurable:!0,enumerable:!0,value:o,writable:!0}):r[i]=o}function $u(r,i){for(var o=-1,f=i.length,d=B(f),g=r==null;++o<f;)d[o]=g?n:Ac(r,i[o]);return d}function xn(r,i,o){return r===r&&(o!==n&&(r=r<=o?r:o),i!==n&&(r=r>=i?r:i)),r}function er(r,i,o,f,d,g){var w,S=i&E,x=i&R,H=i&$;if(o&&(w=d?o(r,f,d,g):o(r)),w!==n)return w;if(!je(r))return r;var K=fe(r);if(K){if(w=US(r),!S)return Rt(r,w)}else{var G=gt(r),j=G==Tr||G==bt;if(hn(r))return Td(r,S);if(G==Wr||G==le||j&&!d){if(w=x||j?{}:Kd(r),!S)return x?AS(r,zv(w,r)):TS(r,ed(w,r))}else{if(!He[G])return d?r:{};w=BS(r,G,S)}}g||(g=new hr);var re=g.get(r);if(re)return re;g.set(r,w),_p(r)?r.forEach(function(oe){w.add(er(oe,i,o,oe,r,g))}):gp(r)&&r.forEach(function(oe,we){w.set(we,er(oe,i,o,we,r,g))});var ae=H?x?fc:lc:x?Dt:ot,ge=K?n:ae(r);return Qt(ge||r,function(oe,we){ge&&(we=oe,oe=r[we]),ji(w,we,er(oe,i,o,we,r,g))}),w}function jv(r){var i=ot(r);return function(o){return td(o,r,i)}}function td(r,i,o){var f=o.length;if(r==null)return!f;for(r=Ie(r);f--;){var d=o[f],g=i[d],w=r[d];if(w===n&&!(d in r)||!g(w))return!1}return!0}function rd(r,i,o){if(typeof r!="function")throw new Zt(u);return rs(function(){r.apply(n,o)},i)}function Ji(r,i,o,f){var d=-1,g=ia,w=!0,S=r.length,x=[],H=i.length;if(!S)return x;o&&(i=Ve(i,Bt(o))),f?(g=Pu,w=!1):i.length>=a&&(g=Ki,w=!1,i=new kn(i));e:for(;++d<S;){var K=r[d],G=o==null?K:o(K);if(K=f||K!==0?K:0,w&&G===G){for(var j=H;j--;)if(i[j]===G)continue e;x.push(K)}else g(i,G,f)||x.push(K)}return x}var un=xd(Ar),nd=xd(Vu,!0);function Jv(r,i){var o=!0;return un(r,function(f,d,g){return o=!!i(f,d,g),o}),o}function Sa(r,i,o){for(var f=-1,d=r.length;++f<d;){var g=r[f],w=i(g);if(w!=null&&(S===n?w===w&&!Ft(w):o(w,S)))var S=w,x=g}return x}function Qv(r,i,o,f){var d=r.length;for(o=me(o),o<0&&(o=-o>d?0:d+o),f=f===n||f>d?d:me(f),f<0&&(f+=d),f=o>f?0:bp(f);o<f;)r[o++]=i;return r}function id(r,i){var o=[];return un(r,function(f,d,g){i(f,d,g)&&o.push(f)}),o}function ht(r,i,o,f,d){var g=-1,w=r.length;for(o||(o=FS),d||(d=[]);++g<w;){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=Rd(),sd=Rd(!0);function Ar(r,i){return r&&Gu(r,i,ot)}function Vu(r,i){return r&&sd(r,i,ot)}function Ea(r,i){return nn(i,function(o){return Vr(r[o])})}function Rn(r,i){i=ln(i,r);for(var o=0,f=i.length;r!=null&&o<f;)r=r[Cr(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 vt(r){return r==null?r===n?O1:T1:On&&On in Ie(r)?MS(r):GS(r)}function zu(r,i){return r>i}function Zv(r,i){return r!=null&&Me.call(r,i)}function Xv(r,i){return r!=null&&i in Ie(r)}function eS(r,i,o){return r>=mt(i,o)&&r<it(i,o)}function ju(r,i,o){for(var f=o?Pu:ia,d=r[0].length,g=r.length,w=g,S=B(g),x=1/0,H=[];w--;){var K=r[w];w&&i&&(K=Ve(K,Bt(i))),x=mt(K.length,x),S[w]=!o&&(i||d>=120&&K.length>=120)?new kn(w&&K):n}K=r[0];var G=-1,j=S[0];e:for(;++G<d&&H.length<x;){var re=K[G],ae=i?i(re):re;if(re=o||re!==0?re:0,!(j?Ki(j,ae):f(H,ae,o))){for(w=g;--w;){var ge=S[w];if(!(ge?Ki(ge,ae):f(r[w],ae,o)))continue e}j&&j.push(ae),H.push(re)}}return H}function tS(r,i,o,f){return Ar(r,function(d,g,w){i(f,o(d),g,w)}),f}function Qi(r,i,o){i=ln(i,r),r=Vd(r,i);var f=r==null?r:r[Cr(rr(i))];return f==null?n:Ut(f,r,o)}function od(r){return Je(r)&&vt(r)==le}function rS(r){return Je(r)&&vt(r)==Yi}function nS(r){return Je(r)&&vt(r)==Fr}function Zi(r,i,o,f,d){return r===i?!0:r==null||i==null||!Je(r)&&!Je(i)?r!==r&&i!==i:iS(r,i,o,f,Zi,d)}function iS(r,i,o,f,d,g){var w=fe(r),S=fe(i),x=w?Oe:gt(r),H=S?Oe:gt(i);x=x==le?Wr:x,H=H==le?Wr:H;var K=x==Wr,G=H==Wr,j=x==H;if(j&&hn(r)){if(!hn(i))return!1;w=!0,K=!1}if(j&&!K)return g||(g=new hr),w||ci(r)?Wd(r,i,o,f,d,g):PS(r,i,x,o,f,d,g);if(!(o&O)){var re=K&&Me.call(r,"__wrapped__"),ae=G&&Me.call(i,"__wrapped__");if(re||ae){var ge=re?r.value():r,oe=ae?i.value():i;return g||(g=new hr),d(ge,oe,o,f,g)}}return j?(g||(g=new hr),DS(r,i,o,f,d,g)):!1}function sS(r){return Je(r)&>(r)==Be}function Ju(r,i,o,f){var d=o.length,g=d,w=!f;if(r==null)return!g;for(r=Ie(r);d--;){var S=o[d];if(w&&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(w&&S[2]){if(H===n&&!(x in r))return!1}else{var G=new hr;if(f)var j=f(H,K,x,r,i,G);if(!(j===n?Zi(K,H,O|I,f,G):j))return!1}}return!0}function ud(r){if(!je(r)||HS(r))return!1;var i=Vr(r)?sv:j1;return i.test(Dn(r))}function aS(r){return Je(r)&&vt(r)==Fi}function oS(r){return Je(r)&>(r)==lr}function uS(r){return Je(r)&&Wa(r.length)&&!!qe[vt(r)]}function cd(r){return typeof r=="function"?r:r==null?Mt:typeof r=="object"?fe(r)?hd(r[0],r[1]):fd(r):Pp(r)}function Qu(r){if(!ts(r))return fv(r);var i=[];for(var o in Ie(r))Me.call(r,o)&&o!="constructor"&&i.push(o);return i}function cS(r){if(!je(r))return $S(r);var i=ts(r),o=[];for(var f in r)f=="constructor"&&(i||!Me.call(r,f))||o.push(f);return o}function Zu(r,i){return r<i}function ld(r,i){var o=-1,f=Pt(r)?B(r.length):[];return un(r,function(d,g,w){f[++o]=i(d,g,w)}),f}function fd(r){var i=dc(r);return i.length==1&&i[0][2]?$d(i[0][0],i[0][1]):function(o){return o===r||Ju(o,r,i)}}function hd(r,i){return mc(r)&&qd(i)?$d(Cr(r),i):function(o){var f=Ac(o,r);return f===n&&f===i?Oc(o,r):Zi(i,f,O|I)}}function Ta(r,i,o,f,d){r!==i&&Gu(i,function(g,w){if(d||(d=new hr),je(g))lS(r,i,w,o,Ta,f,d);else{var S=f?f(yc(r,w),g,w+"",r,i,d):n;S===n&&(S=g),qu(r,w,S)}},Dt)}function lS(r,i,o,f,d,g,w){var S=yc(r,o),x=yc(i,o),H=w.get(x);if(H){qu(r,o,H);return}var K=g?g(S,x,o+"",r,i,w):n,G=K===n;if(G){var j=fe(x),re=!j&&hn(x),ae=!j&&!re&&ci(x);K=x,j||re||ae?fe(S)?K=S:et(S)?K=Rt(S):re?(G=!1,K=Td(x,!0)):ae?(G=!1,K=Ad(x,!0)):K=[]:ns(x)||Mn(x)?(K=S,Mn(S)?K=vp(S):(!je(S)||Vr(S))&&(K=Kd(x))):G=!1}G&&(w.set(x,K),d(K,x,f,g,w),w.delete(x)),qu(r,o,K)}function dd(r,i){var o=r.length;if(o)return i+=i<0?o:0,Gr(i,o)?r[i]:n}function pd(r,i,o){i.length?i=Ve(i,function(g){return fe(g)?function(w){return Rn(w,g.length===1?g[0]:g)}:g}):i=[Mt];var f=-1;i=Ve(i,Bt(se()));var d=ld(r,function(g,w,S){var x=Ve(i,function(H){return H(g)});return{criteria:x,index:++f,value:g}});return Bb(d,function(g,w){return ES(g,w,o)})}function fS(r,i){return md(r,i,function(o,f){return Oc(r,f)})}function md(r,i,o){for(var f=-1,d=i.length,g={};++f<d;){var w=i[f],S=Rn(r,w);o(S,w)&&Xi(g,ln(w,r),S)}return g}function hS(r){return function(i){return Rn(i,r)}}function Xu(r,i,o,f){var d=f?Ub:Zn,g=-1,w=i.length,S=r;for(r===i&&(i=Rt(i)),o&&(S=Ve(r,Bt(o)));++g<w;)for(var x=0,H=i[g],K=o?o(H):H;(x=d(S,K,x,f))>-1;)S!==r&&pa.call(S,x,1),pa.call(r,x,1);return r}function gd(r,i){for(var o=r?i.length:0,f=o-1;o--;){var d=i[o];if(o==f||d!==g){var g=d;Gr(d)?pa.call(r,d,1):nc(r,d)}}return r}function ec(r,i){return r+ya(Jh()*(i-r+1))}function dS(r,i,o,f){for(var d=-1,g=it(ga((i-r)/(o||1)),0),w=B(g);g--;)w[f?g:++d]=r,r+=o;return w}function tc(r,i){var o="";if(!r||i<1||i>D)return o;do i%2&&(o+=r),i=ya(i/2),i&&(r+=r);while(i);return o}function ye(r,i){return _c(Gd(r,i,Mt),r+"")}function pS(r){return Xh(li(r))}function mS(r,i){var o=li(r);return La(o,xn(i,0,o.length))}function Xi(r,i,o,f){if(!je(r))return r;i=ln(i,r);for(var d=-1,g=i.length,w=g-1,S=r;S!=null&&++d<g;){var x=Cr(i[d]),H=o;if(x==="__proto__"||x==="constructor"||x==="prototype")return r;if(d!=w){var K=S[x];H=f?f(K,x,S):n,H===n&&(H=je(K)?K:Gr(i[d+1])?[]:{})}ji(S,x,H),S=S[x]}return r}var yd=_a?function(r,i){return _a.set(r,i),r}:Mt,gS=ma?function(r,i){return ma(r,"toString",{configurable:!0,enumerable:!1,value:kc(i),writable:!0})}:Mt;function yS(r){return La(li(r))}function tr(r,i,o){var f=-1,d=r.length;i<0&&(i=-i>d?0:d+i),o=o>d?d:o,o<0&&(o+=d),d=i>o?0:o-i>>>0,i>>>=0;for(var g=B(d);++f<d;)g[f]=r[f+i];return g}function _S(r,i){var o;return un(r,function(f,d,g){return o=i(f,d,g),!o}),!!o}function Aa(r,i,o){var f=0,d=r==null?f:r.length;if(typeof i=="number"&&i===i&&d<=Ne){for(;f<d;){var g=f+d>>>1,w=r[g];w!==null&&!Ft(w)&&(o?w<=i:w<i)?f=g+1:d=g}return d}return rc(r,i,Mt,o)}function rc(r,i,o,f){var d=0,g=r==null?0:r.length;if(g===0)return 0;i=o(i);for(var w=i!==i,S=i===null,x=Ft(i),H=i===n;d<g;){var K=ya((d+g)/2),G=o(r[K]),j=G!==n,re=G===null,ae=G===G,ge=Ft(G);if(w)var oe=f||ae;else H?oe=ae&&(f||j):S?oe=ae&&j&&(f||!re):x?oe=ae&&j&&!re&&(f||!ge):re||ge?oe=!1:oe=f?G<=i:G<i;oe?d=K+1:g=K}return mt(g,pe)}function _d(r,i){for(var o=-1,f=r.length,d=0,g=[];++o<f;){var w=r[o],S=i?i(w):w;if(!o||!dr(S,x)){var x=S;g[d++]=w===0?0:w}}return g}function wd(r){return typeof r=="number"?r:Ft(r)?te:+r}function It(r){if(typeof r=="string")return r;if(fe(r))return Ve(r,It)+"";if(Ft(r))return Qh?Qh.call(r):"";var i=r+"";return i=="0"&&1/r==-L?"-0":i}function cn(r,i,o){var f=-1,d=ia,g=r.length,w=!0,S=[],x=S;if(o)w=!1,d=Pu;else if(g>=a){var H=i?null:xS(r);if(H)return aa(H);w=!1,d=Ki,x=new kn}else x=i?[]:S;e:for(;++f<g;){var K=r[f],G=i?i(K):K;if(K=o||K!==0?K:0,w&&G===G){for(var j=x.length;j--;)if(x[j]===G)continue e;i&&x.push(G),S.push(K)}else d(x,G,o)||(x!==S&&x.push(G),S.push(K))}return S}function nc(r,i){return i=ln(i,r),r=Vd(r,i),r==null||delete r[Cr(rr(i))]}function bd(r,i,o,f){return Xi(r,i,o(Rn(r,i)),f)}function Oa(r,i,o,f){for(var d=r.length,g=f?d:-1;(f?g--:++g<d)&&i(r[g],g,r););return o?tr(r,f?0:g,f?g+1:d):tr(r,f?g+1:0,f?d:g)}function vd(r,i){var o=r;return o instanceof ve&&(o=o.value()),Du(i,function(f,d){return d.func.apply(d.thisArg,sn([f],d.args))},o)}function ic(r,i,o){var f=r.length;if(f<2)return f?cn(r[0]):[];for(var d=-1,g=B(f);++d<f;)for(var w=r[d],S=-1;++S<f;)S!=d&&(g[d]=Ji(g[d]||w,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,w={};++f<d;){var S=f<g?i[f]:n;o(w,r[f],S)}return w}function sc(r){return et(r)?r:[]}function ac(r){return typeof r=="function"?r:Mt}function ln(r,i){return fe(r)?r:mc(r,i)?[r]:Qd(De(r))}var wS=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 Ed=av||function(r){return ft.clearTimeout(r)};function Td(r,i){if(i)return r.slice();var o=r.length,f=$h?$h(o):new r.constructor(o);return r.copy(f),f}function oc(r){var i=new r.constructor(r.byteLength);return new ha(i).set(new ha(r)),i}function bS(r,i){var o=i?oc(r.buffer):r.buffer;return new r.constructor(o,r.byteOffset,r.byteLength)}function vS(r){var i=new r.constructor(r.source,oh.exec(r));return i.lastIndex=r.lastIndex,i}function SS(r){return zi?Ie(zi.call(r)):{}}function Ad(r,i){var o=i?oc(r.buffer):r.buffer;return new r.constructor(o,r.byteOffset,r.length)}function Od(r,i){if(r!==i){var o=r!==n,f=r===null,d=r===r,g=Ft(r),w=i!==n,S=i===null,x=i===i,H=Ft(i);if(!S&&!H&&!g&&r>i||g&&w&&x&&!S&&!H||f&&w&&x||!o&&x||!d)return 1;if(!f&&!g&&!H&&r<i||H&&o&&d&&!f&&!g||S&&o&&d||!w&&d||!x)return-1}return 0}function ES(r,i,o){for(var f=-1,d=r.criteria,g=i.criteria,w=d.length,S=o.length;++f<w;){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 Cd(r,i,o,f){for(var d=-1,g=r.length,w=o.length,S=-1,x=i.length,H=it(g-w,0),K=B(x+H),G=!f;++S<x;)K[S]=i[S];for(;++d<w;)(G||d<g)&&(K[o[d]]=r[d]);for(;H--;)K[S++]=r[d++];return K}function kd(r,i,o,f){for(var d=-1,g=r.length,w=-1,S=o.length,x=-1,H=i.length,K=it(g-S,0),G=B(K+H),j=!f;++d<K;)G[d]=r[d];for(var re=d;++x<H;)G[re+x]=i[x];for(;++w<S;)(j||d<g)&&(G[re+o[w]]=r[d++]);return G}function Rt(r,i){var o=-1,f=r.length;for(i||(i=B(f));++o<f;)i[o]=r[o];return i}function Or(r,i,o,f){var d=!o;o||(o={});for(var g=-1,w=i.length;++g<w;){var 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 TS(r,i){return Or(r,pc(r),i)}function AS(r,i){return Or(r,Hd(r),i)}function Ca(r,i){return function(o,f){var d=fe(o)?Rb:Vv,g=i?i():{};return d(o,r,se(f,2),g)}}function ai(r){return ye(function(i,o){var f=-1,d=o.length,g=d>1?o[d-1]:n,w=d>2?o[2]:n;for(g=r.length>3&&typeof g=="function"?(d--,g):n,w&&St(o[0],o[1],w)&&(g=d<3?n:g,d=1),i=Ie(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(!Pt(o))return r(o,f);for(var d=o.length,g=i?d:-1,w=Ie(o);(i?g--:++g<d)&&f(w[g],g,w)!==!1;);return o}}function Rd(r){return function(i,o,f){for(var d=-1,g=Ie(i),w=f(i),S=w.length;S--;){var x=w[r?S:++d];if(o(g[x],x,g)===!1)break}return i}}function OS(r,i,o){var f=i&F,d=es(r);function g(){var w=this&&this!==ft&&this instanceof g?d:r;return w.apply(f?o:this,arguments)}return g}function Pd(r){return function(i){i=De(i);var o=Xn(i)?fr(i):n,f=o?o[0]:i.charAt(0),d=o?fn(o,1).join(""):i.slice(1);return f[r]()+d}}function oi(r){return function(i){return Du(xp(kp(i).replace(gb,"")),r,"")}}function es(r){return function(){var i=arguments;switch(i.length){case 0:return new r;case 1:return new r(i[0]);case 2:return new r(i[0],i[1]);case 3:return new r(i[0],i[1],i[2]);case 4:return new r(i[0],i[1],i[2],i[3]);case 5:return new r(i[0],i[1],i[2],i[3],i[4]);case 6:return new r(i[0],i[1],i[2],i[3],i[4],i[5]);case 7:return new r(i[0],i[1],i[2],i[3],i[4],i[5],i[6])}var o=si(r.prototype),f=r.apply(o,i);return je(f)?f:o}}function CS(r,i,o){var f=es(r);function d(){for(var g=arguments.length,w=B(g),S=g,x=ui(d);S--;)w[S]=arguments[S];var H=g<3&&w[0]!==x&&w[g-1]!==x?[]:an(w,x);if(g-=H.length,g<o)return Ud(r,i,ka,d.placeholder,n,w,H,n,n,o-g);var K=this&&this!==ft&&this instanceof d?f:r;return Ut(K,this,w)}return d}function Dd(r){return function(i,o,f){var d=Ie(i);if(!Pt(i)){var g=se(o,3);i=ot(i),o=function(S){return g(d[S],S,d)}}var w=r(i,o,f);return w>-1?d[g?i[w]:w]:n}}function Md(r){return $r(function(i){var o=i.length,f=o,d=Xt.prototype.thru;for(r&&i.reverse();f--;){var g=i[f];if(typeof g!="function")throw new Zt(u);if(d&&!w&&Da(g)=="wrapper")var w=new Xt([],!0)}for(f=w?f:o;++f<o;){g=i[f];var S=Da(g),x=S=="wrapper"?hc(g):n;x&&gc(x[0])&&x[1]==(Re|Ae|_e|y)&&!x[4].length&&x[9]==1?w=w[Da(x[0])].apply(w,x[3]):w=g.length==1&&gc(g)?w[S]():w.thru(g)}return function(){var H=arguments,K=H[0];if(w&&H.length==1&&fe(K))return w.plant(K).value();for(var G=0,j=o?i[G].apply(this,H):K;++G<o;)j=i[G].call(this,j);return j}})}function ka(r,i,o,f,d,g,w,S,x,H){var K=i&Re,G=i&F,j=i&ne,re=i&(Ae|Se),ae=i&_,ge=j?n:es(r);function oe(){for(var we=arguments.length,Ee=B(we),Wt=we;Wt--;)Ee[Wt]=arguments[Wt];if(re)var Et=ui(oe),Ht=Fb(Ee,Et);if(f&&(Ee=Cd(Ee,f,d,re)),g&&(Ee=kd(Ee,g,w,re)),we-=Ht,re&&we<H){var tt=an(Ee,Et);return Ud(r,i,ka,oe.placeholder,o,Ee,tt,S,x,H-we)}var pr=G?o:this,jr=j?pr[r]:r;return we=Ee.length,S?Ee=VS(Ee,S):ae&&we>1&&Ee.reverse(),K&&x<we&&(Ee.length=x),this&&this!==ft&&this instanceof oe&&(jr=ge||es(jr)),jr.apply(pr,Ee)}return oe}function Ld(r,i){return function(o,f){return tS(o,r,i(f),{})}}function xa(r,i){return function(o,f){var d;if(o===n&&f===n)return i;if(o!==n&&(d=o),f!==n){if(d===n)return f;typeof o=="string"||typeof f=="string"?(o=It(o),f=It(f)):(o=wd(o),f=wd(f)),d=r(o,f)}return d}}function uc(r){return $r(function(i){return i=Ve(i,Bt(se())),ye(function(o){var f=this;return r(i,function(d){return Ut(d,f,o)})})})}function Ra(r,i){i=i===n?" ":It(i);var o=i.length;if(o<2)return o?tc(i,r):i;var f=tc(i,ga(r/ei(i)));return Xn(i)?fn(fr(f),0,r).join(""):f.slice(0,r)}function kS(r,i,o,f){var d=i&F,g=es(r);function w(){for(var S=-1,x=arguments.length,H=-1,K=f.length,G=B(K+x),j=this&&this!==ft&&this instanceof w?g:r;++H<K;)G[H]=f[H];for(;x--;)G[H++]=arguments[++S];return Ut(j,d?o:this,G)}return w}function Nd(r){return function(i,o,f){return f&&typeof f!="number"&&St(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),dS(i,o,f,r)}}function Pa(r){return function(i,o){return typeof i=="string"&&typeof o=="string"||(i=nr(i),o=nr(o)),r(i,o)}}function Ud(r,i,o,f,d,g,w,S,x,H){var K=i&Ae,G=K?w:n,j=K?n:w,re=K?g:n,ae=K?n:g;i|=K?_e:Fe,i&=~(K?Fe:_e),i&Y||(i&=-4);var ge=[r,i,d,re,G,ae,j,S,x,H],oe=o.apply(n,ge);return gc(r)&&zd(oe,ge),oe.placeholder=f,jd(oe,r,i)}function cc(r){var i=nt[r];return function(o,f){if(o=nr(o),f=f==null?0:mt(me(f),292),f&&jh(o)){var d=(De(o)+"e").split("e"),g=i(d[0]+"e"+(+d[1]+f));return d=(De(g)+"e").split("e"),+(d[0]+"e"+(+d[1]-f))}return i(o)}}var xS=ni&&1/aa(new ni([,-0]))[1]==L?function(r){return new ni(r)}:Pc;function Bd(r){return function(i){var o=gt(i);return o==Be?Fu(i):o==lr?Gb(i):Ib(i,r(i))}}function qr(r,i,o,f,d,g,w,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),w=w===n?w:it(me(w),0),S=S===n?S:me(S),H-=d?d.length:0,i&Fe){var K=f,G=d;f=d=n}var j=x?n:hc(r),re=[r,i,o,f,d,K,G,g,w,S];if(j&&qS(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:it(re[9]-H,0),!S&&i&(Ae|Se)&&(i&=-25),!i||i==F)var ae=OS(r,i,o);else i==Ae||i==Se?ae=CS(r,i,S):(i==_e||i==(F|_e))&&!d.length?ae=kS(r,i,o,f):ae=ka.apply(n,re);var ge=j?yd:zd;return jd(ge(ae,re),r,i)}function Id(r,i,o,f){return r===n||dr(r,ri[o])&&!Me.call(f,o)?i:r}function Fd(r,i,o,f,d,g){return je(r)&&je(i)&&(g.set(i,r),Ta(r,i,n,Fd,g),g.delete(i)),r}function RS(r){return ns(r)?n:r}function Wd(r,i,o,f,d,g){var w=o&O,S=r.length,x=i.length;if(S!=x&&!(w&&x>S))return!1;var H=g.get(r),K=g.get(i);if(H&&K)return H==i&&K==r;var G=-1,j=!0,re=o&I?new kn:n;for(g.set(r,i),g.set(i,r);++G<S;){var ae=r[G],ge=i[G];if(f)var oe=w?f(ge,ae,G,i,r,g):f(ae,ge,G,r,i,g);if(oe!==n){if(oe)continue;j=!1;break}if(re){if(!Mu(i,function(we,Ee){if(!Ki(re,Ee)&&(ae===we||d(ae,we,o,f,g)))return re.push(Ee)})){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 PS(r,i,o,f,d,g,w){switch(o){case Jn:if(r.byteLength!=i.byteLength||r.byteOffset!=i.byteOffset)return!1;r=r.buffer,i=i.buffer;case Yi:return!(r.byteLength!=i.byteLength||!g(new ha(r),new ha(i)));case Er:case Fr:case Ue:return dr(+r,+i);case wt:return r.name==i.name&&r.message==i.message;case Fi:case Wi:return r==i+"";case Be:var S=Fu;case lr:var x=f&O;if(S||(S=aa),r.size!=i.size&&!x)return!1;var H=w.get(r);if(H)return H==i;f|=I,w.set(r,i);var K=Wd(S(r),S(i),f,d,g,w);return w.delete(r),K;case ea:if(zi)return zi.call(r)==zi.call(i)}return!1}function DS(r,i,o,f,d,g){var w=o&O,S=lc(r),x=S.length,H=lc(i),K=H.length;if(x!=K&&!w)return!1;for(var G=x;G--;){var j=S[G];if(!(w?j in i:Me.call(i,j)))return!1}var re=g.get(r),ae=g.get(i);if(re&&ae)return re==i&&ae==r;var ge=!0;g.set(r,i),g.set(i,r);for(var oe=w;++G<x;){j=S[G];var we=r[j],Ee=i[j];if(f)var Wt=w?f(Ee,we,j,i,r,g):f(we,Ee,j,r,i,g);if(!(Wt===n?we===Ee||d(we,Ee,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 _c(Gd(r,n,tp),r+"")}function lc(r){return ad(r,ot,pc)}function fc(r){return ad(r,Dt,Hd)}var hc=_a?function(r){return _a.get(r)}:Pc;function Da(r){for(var i=r.name+"",o=ii[i],f=Me.call(ii,i)?o.length:0;f--;){var d=o[f],g=d.func;if(g==null||g==r)return d.name}return i}function ui(r){var i=Me.call(p,"placeholder")?p:r;return i.placeholder}function se(){var r=p.iteratee||xc;return r=r===xc?cd:r,arguments.length?r(arguments[0],arguments[1]):r}function Ma(r,i){var o=r.__data__;return WS(i)?o[typeof i=="string"?"string":"hash"]:o.map}function dc(r){for(var i=ot(r),o=i.length;o--;){var f=i[o],d=r[f];i[o]=[f,d,qd(d)]}return i}function Pn(r,i){var o=Kb(r,i);return ud(o)?o:n}function MS(r){var i=Me.call(r,On),o=r[On];try{r[On]=n;var f=!0}catch{}var d=la.call(r);return f&&(i?r[On]=o:delete r[On]),d}var pc=Hu?function(r){return r==null?[]:(r=Ie(r),nn(Hu(r),function(i){return Vh.call(r,i)}))}:Dc,Hd=Hu?function(r){for(var i=[];r;)sn(i,pc(r)),r=da(r);return i}:Dc,gt=vt;(Yu&>(new Yu(new ArrayBuffer(1)))!=Jn||$i&>(new $i)!=Be||Ku&>(Ku.resolve())!=nh||ni&>(new ni)!=lr||Gi&>(new Gi)!=Hi)&&(gt=function(r){var i=vt(r),o=i==Wr?r.constructor:n,f=o?Dn(o):"";if(f)switch(f){case mv:return Jn;case gv:return Be;case yv:return nh;case _v:return lr;case wv:return Hi}return i});function LS(r,i,o){for(var f=-1,d=o.length;++f<d;){var g=o[f],w=g.size;switch(g.type){case"drop":r+=w;break;case"dropRight":i-=w;break;case"take":i=mt(i,r+w);break;case"takeRight":r=it(r,i-w);break}}return{start:r,end:i}}function NS(r){var i=r.match(H1);return i?i[1].split(Y1):[]}function Yd(r,i,o){i=ln(i,r);for(var f=-1,d=i.length,g=!1;++f<d;){var w=Cr(i[f]);if(!(g=r!=null&&o(r,w)))break;r=r[w]}return g||++f!=d?g:(d=r==null?0:r.length,!!d&&Wa(d)&&Gr(w,d)&&(fe(r)||Mn(r)))}function US(r){var i=r.length,o=new r.constructor(i);return i&&typeof r[0]=="string"&&Me.call(r,"index")&&(o.index=r.index,o.input=r.input),o}function Kd(r){return typeof r.constructor=="function"&&!ts(r)?si(da(r)):{}}function BS(r,i,o){var f=r.constructor;switch(i){case Yi:return oc(r);case Er:case Fr:return new f(+r);case Jn:return bS(r,o);case du:case pu:case mu:case gu:case yu:case _u:case wu:case bu:case vu:return Ad(r,o);case Be:return new f;case Ue:case Wi:return new f(r);case Fi:return vS(r);case lr:return new f;case ea:return SS(r)}}function IS(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(W1,`{
|
|
15
15
|
/* [wrapped with `+i+`] */
|
|
16
|
-
`)}function DS(r){return le(r)||kn(r)||!!(Mh&&r&&r[Mh])}function Gr(r,i){var o=typeof r;return i=i??D,!!i&&(o=="number"||o!="symbol"&&q1.test(r))&&r>-1&&r%1==0&&r<i}function bt(r,i,o){if(!Ve(o))return!1;var f=typeof i;return(f=="number"?xt(o)&&Gr(i,o.length):f=="string"&&i in o)?hr(o[i],r):!1}function ec(r,i){if(le(r))return!1;var o=typeof r;return o=="number"||o=="symbol"||o=="boolean"||r==null||It(r)?!0:k1.test(r)||!C1.test(r)||i!=null&&r in Ie(i)}function MS(r){var i=typeof r;return i=="string"||i=="number"||i=="symbol"||i=="boolean"?r!=="__proto__":r===null}function tc(r){var i=Aa(r),o=p[i];if(typeof o!="function"||!(i in be.prototype))return!1;if(r===o)return!0;var f=Qu(o);return!!f&&r===f[0]}function LS(r){return!!kh&&kh in r}var NS=ta?zr:_c;function Xi(r){var i=r&&r.constructor,o=typeof i=="function"&&i.prototype||ti;return r===o}function kd(r){return r===r&&!Ve(r)}function Rd(r,i){return function(o){return o==null?!1:o[r]===i&&(i!==n||r in Ie(o))}}function US(r){var i=Pa(r,function(f){return o.size===m&&o.clear(),f}),o=i.cache;return i}function IS(r,i){var o=r[1],f=i[1],d=o|f,g=d<(F|re|ke),w=f==ke&&o==Ee||f==ke&&o==y&&r[7].length<=i[8]||f==(ke|y)&&i[7].length<=i[8]&&o==Ee;if(!(g||w))return r;f&F&&(r[2]=i[2],d|=o&F?0:Y);var S=i[3];if(S){var k=r[3];r[3]=k?hd(k,S,i[4]):S,r[4]=k?sn(r[3],b):i[4]}return S=i[5],S&&(k=r[5],r[5]=k?dd(k,S,i[6]):S,r[6]=k?sn(r[5],b):i[6]),S=i[7],S&&(r[7]=S),f&ke&&(r[8]=r[8]==null?i[8]:pt(r[8],i[8])),r[9]==null&&(r[9]=i[9]),r[0]=i[0],r[1]=d,r}function BS(r){var i=[];if(r!=null)for(var o in Ie(r))i.push(o);return i}function FS(r){return na.call(r)}function Pd(r,i,o){return i=nt(i===n?r.length-1:i,0),function(){for(var f=arguments,d=-1,g=nt(f.length-i,0),w=I(g);++d<g;)w[d]=f[i+d];d=-1;for(var S=I(i+1);++d<i;)S[d]=f[d];return S[i]=o(w),Lt(r,this,S)}}function Dd(r,i){return i.length<2?r:On(r,Xt(i,0,-1))}function WS(r,i){for(var o=r.length,f=pt(i.length,o),d=Ot(r);f--;){var g=i[f];r[f]=Gr(g,o)?d[g]:n}return r}function rc(r,i){if(!(i==="constructor"&&typeof r[i]=="function")&&i!="__proto__")return r[i]}var Md=Nd(rd),es=tv||function(r,i){return ct.setTimeout(r,i)},nc=Nd(cS);function Ld(r,i,o){var f=i+"";return nc(r,PS(f,HS(CS(f),o)))}function Nd(r){var i=0,o=0;return function(){var f=sv(),d=P-(f-o);if(o=f,d>0){if(++i>=x)return arguments[0]}else i=0;return r.apply(n,arguments)}}function xa(r,i){var o=-1,f=r.length,d=f-1;for(i=i===n?f:i;++o<i;){var g=Fu(o,d),w=r[g];r[g]=r[o],r[o]=w}return r.length=i,r}var Ud=US(function(r){var i=[];return r.charCodeAt(0)===46&&i.push(""),r.replace(R1,function(o,f,d,g){i.push(d?g.replace(B1,"$1"):f||o)}),i});function Or(r){if(typeof r=="string"||It(r))return r;var i=r+"";return i=="0"&&1/r==-L?"-0":i}function Cn(r){if(r!=null){try{return ra.call(r)}catch{}try{return r+""}catch{}}return""}function HS(r,i){return jt(Fe,function(o){var f="_."+o[0];i&o[1]&&!Qs(r,f)&&r.push(f)}),r.sort()}function Id(r){if(r instanceof be)return r.clone();var i=new Qt(r.__wrapped__,r.__chain__);return i.__actions__=Ot(r.__actions__),i.__index__=r.__index__,i.__values__=r.__values__,i}function YS(r,i,o){(o?bt(r,i,o):i===n)?i=1:i=nt(pe(i),0);var f=r==null?0:r.length;if(!f||i<1)return[];for(var d=0,g=0,w=I(ca(f/i));d<f;)w[g++]=Xt(r,d,d+=i);return w}function KS(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 qS(){var r=arguments.length;if(!r)return[];for(var i=I(r-1),o=arguments[0],f=r;f--;)i[f-1]=arguments[f];return nn(le(o)?Ot(o):[o],lt(i,1))}var $S=ge(function(r,i){return Ze(r)?Vi(r,lt(i,1,Ze,!0)):[]}),GS=ge(function(r,i){var o=er(i);return Ze(o)&&(o=n),Ze(r)?Vi(r,lt(i,1,Ze,!0),ie(o,2)):[]}),zS=ge(function(r,i){var o=er(i);return Ze(o)&&(o=n),Ze(r)?Vi(r,lt(i,1,Ze,!0),n,o):[]});function VS(r,i,o){var f=r==null?0:r.length;return f?(i=o||i===n?1:pe(i),Xt(r,i<0?0:i,f)):[]}function jS(r,i,o){var f=r==null?0:r.length;return f?(i=o||i===n?1:pe(i),i=f-i,Xt(r,0,i<0?0:i)):[]}function JS(r,i){return r&&r.length?wa(r,ie(i,3),!0,!0):[]}function QS(r,i){return r&&r.length?wa(r,ie(i,3),!0):[]}function ZS(r,i,o,f){var d=r==null?0:r.length;return d?(o&&typeof o!="number"&&bt(r,i,o)&&(o=0,f=d),qv(r,i,o,f)):[]}function Bd(r,i,o){var f=r==null?0:r.length;if(!f)return-1;var d=o==null?0:pe(o);return d<0&&(d=nt(f+d,0)),Zs(r,ie(i,3),d)}function Fd(r,i,o){var f=r==null?0:r.length;if(!f)return-1;var d=f-1;return o!==n&&(d=pe(o),d=o<0?nt(f+d,0):pt(d,f-1)),Zs(r,ie(i,3),d,!0)}function Wd(r){var i=r==null?0:r.length;return i?lt(r,1):[]}function XS(r){var i=r==null?0:r.length;return i?lt(r,L):[]}function eT(r,i){var o=r==null?0:r.length;return o?(i=i===n?1:pe(i),lt(r,i)):[]}function tT(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 Hd(r){return r&&r.length?r[0]:n}function rT(r,i,o){var f=r==null?0:r.length;if(!f)return-1;var d=o==null?0:pe(o);return d<0&&(d=nt(f+d,0)),Qn(r,i,d)}function nT(r){var i=r==null?0:r.length;return i?Xt(r,0,-1):[]}var iT=ge(function(r){var i=$e(r,qu);return i.length&&i[0]===r[0]?Lu(i):[]}),sT=ge(function(r){var i=er(r),o=$e(r,qu);return i===er(o)?i=n:o.pop(),o.length&&o[0]===r[0]?Lu(o,ie(i,2)):[]}),aT=ge(function(r){var i=er(r),o=$e(r,qu);return i=typeof i=="function"?i:n,i&&o.pop(),o.length&&o[0]===r[0]?Lu(o,n,i):[]});function oT(r,i){return r==null?"":nv.call(r,i)}function er(r){var i=r==null?0:r.length;return i?r[i-1]:n}function uT(r,i,o){var f=r==null?0:r.length;if(!f)return-1;var d=f;return o!==n&&(d=pe(o),d=d<0?nt(f+d,0):pt(d,f-1)),i===i?Hb(r,i,d):Zs(r,vh,d,!0)}function cT(r,i){return r&&r.length?Zh(r,pe(i)):n}var lT=ge(Yd);function Yd(r,i){return r&&r.length&&i&&i.length?Bu(r,i):r}function fT(r,i,o){return r&&r.length&&i&&i.length?Bu(r,i,ie(o,2)):r}function hT(r,i,o){return r&&r.length&&i&&i.length?Bu(r,i,n,o):r}var dT=$r(function(r,i){var o=r==null?0:r.length,f=Ru(r,i);return td(r,$e(i,function(d){return Gr(d,o)?+d:d}).sort(fd)),f});function pT(r,i){var o=[];if(!(r&&r.length))return o;var f=-1,d=[],g=r.length;for(i=ie(i,3);++f<g;){var w=r[f];i(w,f,r)&&(o.push(w),d.push(f))}return td(r,d),o}function ic(r){return r==null?r:ov.call(r)}function mT(r,i,o){var f=r==null?0:r.length;return f?(o&&typeof o!="number"&&bt(r,i,o)?(i=0,o=f):(i=i==null?0:pe(i),o=o===n?f:pe(o)),Xt(r,i,o)):[]}function gT(r,i){return _a(r,i)}function yT(r,i,o){return Hu(r,i,ie(o,2))}function _T(r,i){var o=r==null?0:r.length;if(o){var f=_a(r,i);if(f<o&&hr(r[f],i))return f}return-1}function wT(r,i){return _a(r,i,!0)}function bT(r,i,o){return Hu(r,i,ie(o,2),!0)}function vT(r,i){var o=r==null?0:r.length;if(o){var f=_a(r,i,!0)-1;if(hr(r[f],i))return f}return-1}function ST(r){return r&&r.length?nd(r):[]}function TT(r,i){return r&&r.length?nd(r,ie(i,2)):[]}function ET(r){var i=r==null?0:r.length;return i?Xt(r,1,i):[]}function AT(r,i,o){return r&&r.length?(i=o||i===n?1:pe(i),Xt(r,0,i<0?0:i)):[]}function OT(r,i,o){var f=r==null?0:r.length;return f?(i=o||i===n?1:pe(i),i=f-i,Xt(r,i<0?0:i,f)):[]}function xT(r,i){return r&&r.length?wa(r,ie(i,3),!1,!0):[]}function CT(r,i){return r&&r.length?wa(r,ie(i,3)):[]}var kT=ge(function(r){return un(lt(r,1,Ze,!0))}),RT=ge(function(r){var i=er(r);return Ze(i)&&(i=n),un(lt(r,1,Ze,!0),ie(i,2))}),PT=ge(function(r){var i=er(r);return i=typeof i=="function"?i:n,un(lt(r,1,Ze,!0),n,i)});function DT(r){return r&&r.length?un(r):[]}function MT(r,i){return r&&r.length?un(r,ie(i,2)):[]}function LT(r,i){return i=typeof i=="function"?i:n,r&&r.length?un(r,n,i):[]}function sc(r){if(!(r&&r.length))return[];var i=0;return r=rn(r,function(o){if(Ze(o))return i=nt(o.length,i),!0}),Su(i,function(o){return $e(r,wu(o))})}function Kd(r,i){if(!(r&&r.length))return[];var o=sc(r);return i==null?o:$e(o,function(f){return Lt(i,n,f)})}var NT=ge(function(r,i){return Ze(r)?Vi(r,i):[]}),UT=ge(function(r){return Ku(rn(r,Ze))}),IT=ge(function(r){var i=er(r);return Ze(i)&&(i=n),Ku(rn(r,Ze),ie(i,2))}),BT=ge(function(r){var i=er(r);return i=typeof i=="function"?i:n,Ku(rn(r,Ze),n,i)}),FT=ge(sc);function WT(r,i){return od(r||[],i||[],zi)}function HT(r,i){return od(r||[],i||[],Qi)}var YT=ge(function(r){var i=r.length,o=i>1?r[i-1]:n;return o=typeof o=="function"?(r.pop(),o):n,Kd(r,o)});function qd(r){var i=p(r);return i.__chain__=!0,i}function KT(r,i){return i(r),r}function Ca(r,i){return i(r)}var qT=$r(function(r){var i=r.length,o=i?r[0]:0,f=this.__wrapped__,d=function(g){return Ru(g,r)};return i>1||this.__actions__.length||!(f instanceof be)||!Gr(o)?this.thru(d):(f=f.slice(o,+o+(i?1:0)),f.__actions__.push({func:Ca,args:[d],thisArg:n}),new Qt(f,this.__chain__).thru(function(g){return i&&!g.length&&g.push(n),g}))});function $T(){return qd(this)}function GT(){return new Qt(this.value(),this.__chain__)}function zT(){this.__values__===n&&(this.__values__=ip(this.value()));var r=this.__index__>=this.__values__.length,i=r?n:this.__values__[this.__index__++];return{done:r,value:i}}function VT(){return this}function jT(r){for(var i,o=this;o instanceof da;){var f=Id(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 JT(){var r=this.__wrapped__;if(r instanceof be){var i=r;return this.__actions__.length&&(i=new be(this)),i=i.reverse(),i.__actions__.push({func:Ca,args:[ic],thisArg:n}),new Qt(i,this.__chain__)}return this.thru(ic)}function QT(){return ad(this.__wrapped__,this.__actions__)}var ZT=ba(function(r,i,o){De.call(r,o)?++r[o]:Kr(r,o,1)});function XT(r,i,o){var f=le(r)?wh:Kv;return o&&bt(r,i,o)&&(i=n),f(r,ie(i,3))}function eE(r,i){var o=le(r)?rn:Kh;return o(r,ie(i,3))}var tE=yd(Bd),rE=yd(Fd);function nE(r,i){return lt(ka(r,i),1)}function iE(r,i){return lt(ka(r,i),L)}function sE(r,i,o){return o=o===n?1:pe(o),lt(ka(r,i),o)}function $d(r,i){var o=le(r)?jt:on;return o(r,ie(i,3))}function Gd(r,i){var o=le(r)?Eb:Yh;return o(r,ie(i,3))}var aE=ba(function(r,i,o){De.call(r,o)?r[o].push(i):Kr(r,o,[i])});function oE(r,i,o,f){r=xt(r)?r:ci(r),o=o&&!f?pe(o):0;var d=r.length;return o<0&&(o=nt(d+o,0)),La(r)?o<=d&&r.indexOf(i,o)>-1:!!d&&Qn(r,i,o)>-1}var uE=ge(function(r,i,o){var f=-1,d=typeof i=="function",g=xt(r)?I(r.length):[];return on(r,function(w){g[++f]=d?Lt(i,w,o):ji(w,i,o)}),g}),cE=ba(function(r,i,o){Kr(r,o,i)});function ka(r,i){var o=le(r)?$e:jh;return o(r,ie(i,3))}function lE(r,i,o,f){return r==null?[]:(le(i)||(i=i==null?[]:[i]),o=f?n:o,le(o)||(o=o==null?[]:[o]),Xh(r,i,o))}var fE=ba(function(r,i,o){r[o?0:1].push(i)},function(){return[[],[]]});function hE(r,i,o){var f=le(r)?yu:Th,d=arguments.length<3;return f(r,ie(i,4),o,d,on)}function dE(r,i,o){var f=le(r)?Ab:Th,d=arguments.length<3;return f(r,ie(i,4),o,d,Yh)}function pE(r,i){var o=le(r)?rn:Kh;return o(r,Da(ie(i,3)))}function mE(r){var i=le(r)?Bh:oS;return i(r)}function gE(r,i,o){(o?bt(r,i,o):i===n)?i=1:i=pe(i);var f=le(r)?Bv:uS;return f(r,i)}function yE(r){var i=le(r)?Fv:lS;return i(r)}function _E(r){if(r==null)return 0;if(xt(r))return La(r)?Xn(r):r.length;var i=mt(r);return i==Ue||i==cr?r.size:Uu(r).length}function wE(r,i,o){var f=le(r)?_u:fS;return o&&bt(r,i,o)&&(i=n),f(r,ie(i,3))}var bE=ge(function(r,i){if(r==null)return[];var o=i.length;return o>1&&bt(r,i[0],i[1])?i=[]:o>2&&bt(i[0],i[1],i[2])&&(i=[i[0]]),Xh(r,lt(i,1),[])}),Ra=ev||function(){return ct.Date.now()};function vE(r,i){if(typeof i!="function")throw new Jt(u);return r=pe(r),function(){if(--r<1)return i.apply(this,arguments)}}function zd(r,i,o){return i=o?n:i,i=r&&i==null?r.length:i,qr(r,ke,n,n,n,n,i)}function Vd(r,i){var o;if(typeof i!="function")throw new Jt(u);return r=pe(r),function(){return--r>0&&(o=i.apply(this,arguments)),r<=1&&(i=n),o}}var ac=ge(function(r,i,o){var f=F;if(o.length){var d=sn(o,oi(ac));f|=ye}return qr(r,f,i,o,d)}),jd=ge(function(r,i,o){var f=F|re;if(o.length){var d=sn(o,oi(jd));f|=ye}return qr(i,f,r,o,d)});function Jd(r,i,o){i=o?n:i;var f=qr(r,Ee,n,n,n,n,n,i);return f.placeholder=Jd.placeholder,f}function Qd(r,i,o){i=o?n:i;var f=qr(r,ve,n,n,n,n,n,i);return f.placeholder=Qd.placeholder,f}function Zd(r,i,o){var f,d,g,w,S,k,H=0,K=!1,G=!1,j=!0;if(typeof r!="function")throw new Jt(u);i=tr(i)||0,Ve(o)&&(K=!!o.leading,G="maxWait"in o,g=G?nt(tr(o.maxWait)||0,i):g,j="trailing"in o?!!o.trailing:j);function te(Xe){var dr=f,jr=d;return f=d=n,H=Xe,w=r.apply(jr,dr),w}function se(Xe){return H=Xe,S=es(_e,i),K?te(Xe):w}function me(Xe){var dr=Xe-k,jr=Xe-H,yp=i-dr;return G?pt(yp,g-jr):yp}function ae(Xe){var dr=Xe-k,jr=Xe-H;return k===n||dr>=i||dr<0||G&&jr>=g}function _e(){var Xe=Ra();if(ae(Xe))return Se(Xe);S=es(_e,me(Xe))}function Se(Xe){return S=n,j&&f?te(Xe):(f=d=n,w)}function Bt(){S!==n&&ud(S),H=0,f=k=d=S=n}function vt(){return S===n?w:Se(Ra())}function Ft(){var Xe=Ra(),dr=ae(Xe);if(f=arguments,d=this,k=Xe,dr){if(S===n)return se(k);if(G)return ud(S),S=es(_e,i),te(k)}return S===n&&(S=es(_e,i)),w}return Ft.cancel=Bt,Ft.flush=vt,Ft}var SE=ge(function(r,i){return Hh(r,1,i)}),TE=ge(function(r,i,o){return Hh(r,tr(i)||0,o)});function EE(r){return qr(r,_)}function Pa(r,i){if(typeof r!="function"||i!=null&&typeof i!="function")throw new Jt(u);var o=function(){var f=arguments,d=i?i.apply(this,f):f[0],g=o.cache;if(g.has(d))return g.get(d);var w=r.apply(this,f);return o.cache=g.set(d,w)||g,w};return o.cache=new(Pa.Cache||Yr),o}Pa.Cache=Yr;function Da(r){if(typeof r!="function")throw new Jt(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 AE(r){return Vd(2,r)}var OE=hS(function(r,i){i=i.length==1&&le(i[0])?$e(i[0],Nt(ie())):$e(lt(i,1),Nt(ie()));var o=i.length;return ge(function(f){for(var d=-1,g=pt(f.length,o);++d<g;)f[d]=i[d].call(this,f[d]);return Lt(r,this,f)})}),oc=ge(function(r,i){var o=sn(i,oi(oc));return qr(r,ye,n,i,o)}),Xd=ge(function(r,i){var o=sn(i,oi(Xd));return qr(r,Be,n,i,o)}),xE=$r(function(r,i){return qr(r,y,n,n,n,i)});function CE(r,i){if(typeof r!="function")throw new Jt(u);return i=i===n?i:pe(i),ge(r,i)}function kE(r,i){if(typeof r!="function")throw new Jt(u);return i=i==null?0:nt(pe(i),0),ge(function(o){var f=o[i],d=ln(o,0,i);return f&&nn(d,f),Lt(r,this,d)})}function RE(r,i,o){var f=!0,d=!0;if(typeof r!="function")throw new Jt(u);return Ve(o)&&(f="leading"in o?!!o.leading:f,d="trailing"in o?!!o.trailing:d),Zd(r,i,{leading:f,maxWait:i,trailing:d})}function PE(r){return zd(r,1)}function DE(r,i){return oc($u(i),r)}function ME(){if(!arguments.length)return[];var r=arguments[0];return le(r)?r:[r]}function LE(r){return Zt(r,$)}function NE(r,i){return i=typeof i=="function"?i:n,Zt(r,$,i)}function UE(r){return Zt(r,T|$)}function IE(r,i){return i=typeof i=="function"?i:n,Zt(r,T|$,i)}function BE(r,i){return i==null||Wh(r,i,at(i))}function hr(r,i){return r===i||r!==r&&i!==i}var FE=Ea(Mu),WE=Ea(function(r,i){return r>=i}),kn=Gh((function(){return arguments})())?Gh:function(r){return je(r)&&De.call(r,"callee")&&!Dh.call(r,"callee")},le=I.isArray,HE=dh?Nt(dh):jv;function xt(r){return r!=null&&Ma(r.length)&&!zr(r)}function Ze(r){return je(r)&&xt(r)}function YE(r){return r===!0||r===!1||je(r)&&wt(r)==Sr}var fn=rv||_c,KE=ph?Nt(ph):Jv;function qE(r){return je(r)&&r.nodeType===1&&!ts(r)}function $E(r){if(r==null)return!0;if(xt(r)&&(le(r)||typeof r=="string"||typeof r.splice=="function"||fn(r)||ui(r)||kn(r)))return!r.length;var i=mt(r);if(i==Ue||i==cr)return!r.size;if(Xi(r))return!Uu(r).length;for(var o in r)if(De.call(r,o))return!1;return!0}function GE(r,i){return Ji(r,i)}function zE(r,i,o){o=typeof o=="function"?o:n;var f=o?o(r,i):n;return f===n?Ji(r,i,n,o):!!f}function uc(r){if(!je(r))return!1;var i=wt(r);return i==yt||i==Ui||typeof r.message=="string"&&typeof r.name=="string"&&!ts(r)}function VE(r){return typeof r=="number"&&Lh(r)}function zr(r){if(!Ve(r))return!1;var i=wt(r);return i==Tr||i==_t||i==st||i==_1}function ep(r){return typeof r=="number"&&r==pe(r)}function Ma(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=D}function Ve(r){var i=typeof r;return r!=null&&(i=="object"||i=="function")}function je(r){return r!=null&&typeof r=="object"}var tp=mh?Nt(mh):Zv;function jE(r,i){return r===i||Nu(r,i,Zu(i))}function JE(r,i,o){return o=typeof o=="function"?o:n,Nu(r,i,Zu(i),o)}function QE(r){return rp(r)&&r!=+r}function ZE(r){if(NS(r))throw new oe(c);return zh(r)}function XE(r){return r===null}function eA(r){return r==null}function rp(r){return typeof r=="number"||je(r)&&wt(r)==Ne}function ts(r){if(!je(r)||wt(r)!=Wr)return!1;var i=aa(r);if(i===null)return!0;var o=De.call(i,"constructor")&&i.constructor;return typeof o=="function"&&o instanceof o&&ra.call(o)==Jb}var cc=gh?Nt(gh):Xv;function tA(r){return ep(r)&&r>=-D&&r<=D}var np=yh?Nt(yh):eS;function La(r){return typeof r=="string"||!le(r)&&je(r)&&wt(r)==Bi}function It(r){return typeof r=="symbol"||je(r)&&wt(r)==zs}var ui=_h?Nt(_h):tS;function rA(r){return r===n}function nA(r){return je(r)&&mt(r)==Fi}function iA(r){return je(r)&&wt(r)==b1}var sA=Ea(Iu),aA=Ea(function(r,i){return r<=i});function ip(r){if(!r)return[];if(xt(r))return La(r)?lr(r):Ot(r);if(Yi&&r[Yi])return Bb(r[Yi]());var i=mt(r),o=i==Ue?Eu:i==cr?Xs:ci;return o(r)}function Vr(r){if(!r)return r===0?r:0;if(r=tr(r),r===L||r===-L){var i=r<0?-1:1;return i*q}return r===r?r:0}function pe(r){var i=Vr(r),o=i%1;return i===i?o?i-o:i:0}function sp(r){return r?An(pe(r),0,J):0}function tr(r){if(typeof r=="number")return r;if(It(r))return X;if(Ve(r)){var i=typeof r.valueOf=="function"?r.valueOf():r;r=Ve(i)?i+"":i}if(typeof r!="string")return r===0?r:+r;r=Eh(r);var o=H1.test(r);return o||K1.test(r)?vb(r.slice(2),o?2:8):W1.test(r)?X:+r}function ap(r){return Ar(r,Ct(r))}function oA(r){return r?An(pe(r),-D,D):r===0?r:0}function Pe(r){return r==null?"":Ut(r)}var uA=si(function(r,i){if(Xi(i)||xt(i)){Ar(i,at(i),r);return}for(var o in i)De.call(i,o)&&zi(r,o,i[o])}),op=si(function(r,i){Ar(i,Ct(i),r)}),Na=si(function(r,i,o,f){Ar(i,Ct(i),r,f)}),cA=si(function(r,i,o,f){Ar(i,at(i),r,f)}),lA=$r(Ru);function fA(r,i){var o=ii(r);return i==null?o:Fh(o,i)}var hA=ge(function(r,i){r=Ie(r);var o=-1,f=i.length,d=f>2?i[2]:n;for(d&&bt(i[0],i[1],d)&&(f=1);++o<f;)for(var g=i[o],w=Ct(g),S=-1,k=w.length;++S<k;){var H=w[S],K=r[H];(K===n||hr(K,ti[H])&&!De.call(r,H))&&(r[H]=g[H])}return r}),dA=ge(function(r){return r.push(n,Ed),Lt(up,n,r)});function pA(r,i){return bh(r,ie(i,3),Er)}function mA(r,i){return bh(r,ie(i,3),Du)}function gA(r,i){return r==null?r:Pu(r,ie(i,3),Ct)}function yA(r,i){return r==null?r:qh(r,ie(i,3),Ct)}function _A(r,i){return r&&Er(r,ie(i,3))}function wA(r,i){return r&&Du(r,ie(i,3))}function bA(r){return r==null?[]:ga(r,at(r))}function vA(r){return r==null?[]:ga(r,Ct(r))}function lc(r,i,o){var f=r==null?n:On(r,i);return f===n?o:f}function SA(r,i){return r!=null&&xd(r,i,$v)}function fc(r,i){return r!=null&&xd(r,i,Gv)}var TA=wd(function(r,i,o){i!=null&&typeof i.toString!="function"&&(i=na.call(i)),r[i]=o},dc(kt)),EA=wd(function(r,i,o){i!=null&&typeof i.toString!="function"&&(i=na.call(i)),De.call(r,i)?r[i].push(o):r[i]=[o]},ie),AA=ge(ji);function at(r){return xt(r)?Ih(r):Uu(r)}function Ct(r){return xt(r)?Ih(r,!0):rS(r)}function OA(r,i){var o={};return i=ie(i,3),Er(r,function(f,d,g){Kr(o,i(f,d,g),f)}),o}function xA(r,i){var o={};return i=ie(i,3),Er(r,function(f,d,g){Kr(o,d,i(f,d,g))}),o}var CA=si(function(r,i,o){ya(r,i,o)}),up=si(function(r,i,o,f){ya(r,i,o,f)}),kA=$r(function(r,i){var o={};if(r==null)return o;var f=!1;i=$e(i,function(g){return g=cn(g,r),f||(f=g.length>1),g}),Ar(r,Ju(r),o),f&&(o=Zt(o,T|R|$,TS));for(var d=i.length;d--;)Yu(o,i[d]);return o});function RA(r,i){return cp(r,Da(ie(i)))}var PA=$r(function(r,i){return r==null?{}:iS(r,i)});function cp(r,i){if(r==null)return{};var o=$e(Ju(r),function(f){return[f]});return i=ie(i),ed(r,o,function(f,d){return i(f,d[0])})}function DA(r,i,o){i=cn(i,r);var f=-1,d=i.length;for(d||(d=1,r=n);++f<d;){var g=r==null?n:r[Or(i[f])];g===n&&(f=d,g=o),r=zr(g)?g.call(r):g}return r}function MA(r,i,o){return r==null?r:Qi(r,i,o)}function LA(r,i,o,f){return f=typeof f=="function"?f:n,r==null?r:Qi(r,i,o,f)}var lp=Sd(at),fp=Sd(Ct);function NA(r,i,o){var f=le(r),d=f||fn(r)||ui(r);if(i=ie(i,4),o==null){var g=r&&r.constructor;d?o=f?new g:[]:Ve(r)?o=zr(g)?ii(aa(r)):{}:o={}}return(d?jt:Er)(r,function(w,S,k){return i(o,w,S,k)}),o}function UA(r,i){return r==null?!0:Yu(r,i)}function IA(r,i,o){return r==null?r:sd(r,i,$u(o))}function BA(r,i,o,f){return f=typeof f=="function"?f:n,r==null?r:sd(r,i,$u(o),f)}function ci(r){return r==null?[]:Tu(r,at(r))}function FA(r){return r==null?[]:Tu(r,Ct(r))}function WA(r,i,o){return o===n&&(o=i,i=n),o!==n&&(o=tr(o),o=o===o?o:0),i!==n&&(i=tr(i),i=i===i?i:0),An(tr(r),i,o)}function HA(r,i,o){return i=Vr(i),o===n?(o=i,i=0):o=Vr(o),r=tr(r),zv(r,i,o)}function YA(r,i,o){if(o&&typeof o!="boolean"&&bt(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=Vr(r),i===n?(i=r,r=0):i=Vr(i)),r>i){var f=r;r=i,i=f}if(o||r%1||i%1){var d=Nh();return pt(r+d*(i-r+bb("1e-"+((d+"").length-1))),i)}return Fu(r,i)}var KA=ai(function(r,i,o){return i=i.toLowerCase(),r+(o?hp(i):i)});function hp(r){return hc(Pe(r).toLowerCase())}function dp(r){return r=Pe(r),r&&r.replace($1,Mb).replace(lb,"")}function qA(r,i,o){r=Pe(r),i=Ut(i);var f=r.length;o=o===n?f:An(pe(o),0,f);var d=o;return o-=i.length,o>=0&&r.slice(o,d)==i}function $A(r){return r=Pe(r),r&&A1.test(r)?r.replace(qf,Lb):r}function GA(r){return r=Pe(r),r&&P1.test(r)?r.replace(ou,"\\$&"):r}var zA=ai(function(r,i,o){return r+(o?"-":"")+i.toLowerCase()}),VA=ai(function(r,i,o){return r+(o?" ":"")+i.toLowerCase()}),jA=gd("toLowerCase");function JA(r,i,o){r=Pe(r),i=pe(i);var f=i?Xn(r):0;if(!i||f>=i)return r;var d=(i-f)/2;return Ta(la(d),o)+r+Ta(ca(d),o)}function QA(r,i,o){r=Pe(r),i=pe(i);var f=i?Xn(r):0;return i&&f<i?r+Ta(i-f,o):r}function ZA(r,i,o){r=Pe(r),i=pe(i);var f=i?Xn(r):0;return i&&f<i?Ta(i-f,o)+r:r}function XA(r,i,o){return o||i==null?i=0:i&&(i=+i),av(Pe(r).replace(uu,""),i||0)}function eO(r,i,o){return(o?bt(r,i,o):i===n)?i=1:i=pe(i),Wu(Pe(r),i)}function tO(){var r=arguments,i=Pe(r[0]);return r.length<3?i:i.replace(r[1],r[2])}var rO=ai(function(r,i,o){return r+(o?"_":"")+i.toLowerCase()});function nO(r,i,o){return o&&typeof o!="number"&&bt(r,i,o)&&(i=o=n),o=o===n?J:o>>>0,o?(r=Pe(r),r&&(typeof i=="string"||i!=null&&!cc(i))&&(i=Ut(i),!i&&Zn(r))?ln(lr(r),0,o):r.split(i,o)):[]}var iO=ai(function(r,i,o){return r+(o?" ":"")+hc(i)});function sO(r,i,o){return r=Pe(r),o=o==null?0:An(pe(o),0,r.length),i=Ut(i),r.slice(o,o+i.length)==i}function aO(r,i,o){var f=p.templateSettings;o&&bt(r,i,o)&&(i=n),r=Pe(r),i=Na({},i,f,Td);var d=Na({},i.imports,f.imports,Td),g=at(d),w=Tu(d,g),S,k,H=0,K=i.interpolate||Vs,G="__p += '",j=Au((i.escape||Vs).source+"|"+K.source+"|"+(K===$f?F1:Vs).source+"|"+(i.evaluate||Vs).source+"|$","g"),te="//# sourceURL="+(De.call(i,"sourceURL")?(i.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++mb+"]")+`
|
|
17
|
-
`;r.replace(j,function(
|
|
18
|
-
__e(`+
|
|
19
|
-
'`),
|
|
20
|
-
`+
|
|
21
|
-
__p += '`),
|
|
22
|
-
((__t = (`+
|
|
23
|
-
'`),H=
|
|
24
|
-
`;var
|
|
16
|
+
`)}function FS(r){return fe(r)||Mn(r)||!!(zh&&r&&r[zh])}function Gr(r,i){var o=typeof r;return i=i??D,!!i&&(o=="number"||o!="symbol"&&Q1.test(r))&&r>-1&&r%1==0&&r<i}function St(r,i,o){if(!je(o))return!1;var f=typeof i;return(f=="number"?Pt(o)&&Gr(i,o.length):f=="string"&&i in o)?dr(o[i],r):!1}function mc(r,i){if(fe(r))return!1;var o=typeof r;return o=="number"||o=="symbol"||o=="boolean"||r==null||Ft(r)?!0:U1.test(r)||!N1.test(r)||i!=null&&r in Ie(i)}function WS(r){var i=typeof r;return i=="string"||i=="number"||i=="symbol"||i=="boolean"?r!=="__proto__":r===null}function gc(r){var i=Da(r),o=p[i];if(typeof o!="function"||!(i in ve.prototype))return!1;if(r===o)return!0;var f=hc(o);return!!f&&r===f[0]}function HS(r){return!!qh&&qh in r}var YS=ua?Vr:Mc;function ts(r){var i=r&&r.constructor,o=typeof i=="function"&&i.prototype||ri;return r===o}function qd(r){return r===r&&!je(r)}function $d(r,i){return function(o){return o==null?!1:o[r]===i&&(i!==n||r in Ie(o))}}function KS(r){var i=Ia(r,function(f){return o.size===m&&o.clear(),f}),o=i.cache;return i}function qS(r,i){var o=r[1],f=i[1],d=o|f,g=d<(F|ne|Re),w=f==Re&&o==Ae||f==Re&&o==y&&r[7].length<=i[8]||f==(Re|y)&&i[7].length<=i[8]&&o==Ae;if(!(g||w))return r;f&F&&(r[2]=i[2],d|=o&F?0:Y);var S=i[3];if(S){var x=r[3];r[3]=x?Cd(x,S,i[4]):S,r[4]=x?an(r[3],b):i[4]}return S=i[5],S&&(x=r[5],r[5]=x?kd(x,S,i[6]):S,r[6]=x?an(r[5],b):i[6]),S=i[7],S&&(r[7]=S),f&Re&&(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 $S(r){var i=[];if(r!=null)for(var o in Ie(r))i.push(o);return i}function GS(r){return la.call(r)}function Gd(r,i,o){return i=it(i===n?r.length-1:i,0),function(){for(var f=arguments,d=-1,g=it(f.length-i,0),w=B(g);++d<g;)w[d]=f[i+d];d=-1;for(var S=B(i+1);++d<i;)S[d]=f[d];return S[i]=o(w),Ut(r,this,S)}}function Vd(r,i){return i.length<2?r:Rn(r,tr(i,0,-1))}function VS(r,i){for(var o=r.length,f=mt(i.length,o),d=Rt(r);f--;){var g=i[f];r[f]=Gr(g,o)?d[g]:n}return r}function yc(r,i){if(!(i==="constructor"&&typeof r[i]=="function")&&i!="__proto__")return r[i]}var zd=Jd(yd),rs=uv||function(r,i){return ft.setTimeout(r,i)},_c=Jd(gS);function jd(r,i,o){var f=i+"";return _c(r,IS(f,zS(NS(f),o)))}function Jd(r){var i=0,o=0;return function(){var f=hv(),d=P-(f-o);if(o=f,d>0){if(++i>=C)return arguments[0]}else i=0;return r.apply(n,arguments)}}function La(r,i){var o=-1,f=r.length,d=f-1;for(i=i===n?f:i;++o<i;){var g=ec(o,d),w=r[g];r[g]=r[o],r[o]=w}return r.length=i,r}var Qd=KS(function(r){var i=[];return r.charCodeAt(0)===46&&i.push(""),r.replace(B1,function(o,f,d,g){i.push(d?g.replace($1,"$1"):f||o)}),i});function Cr(r){if(typeof r=="string"||Ft(r))return r;var i=r+"";return i=="0"&&1/r==-L?"-0":i}function Dn(r){if(r!=null){try{return ca.call(r)}catch{}try{return r+""}catch{}}return""}function zS(r,i){return Qt(We,function(o){var f="_."+o[0];i&o[1]&&!ia(r,f)&&r.push(f)}),r.sort()}function Zd(r){if(r instanceof ve)return r.clone();var i=new Xt(r.__wrapped__,r.__chain__);return i.__actions__=Rt(r.__actions__),i.__index__=r.__index__,i.__values__=r.__values__,i}function jS(r,i,o){(o?St(r,i,o):i===n)?i=1:i=it(me(i),0);var f=r==null?0:r.length;if(!f||i<1)return[];for(var d=0,g=0,w=B(ga(f/i));d<f;)w[g++]=tr(r,d,d+=i);return w}function JS(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 QS(){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)?Rt(o):[o],ht(i,1))}var ZS=ye(function(r,i){return et(r)?Ji(r,ht(i,1,et,!0)):[]}),XS=ye(function(r,i){var o=rr(i);return et(o)&&(o=n),et(r)?Ji(r,ht(i,1,et,!0),se(o,2)):[]}),eE=ye(function(r,i){var o=rr(i);return et(o)&&(o=n),et(r)?Ji(r,ht(i,1,et,!0),n,o):[]});function tE(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 rE(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 nE(r,i){return r&&r.length?Oa(r,se(i,3),!0,!0):[]}function iE(r,i){return r&&r.length?Oa(r,se(i,3),!0):[]}function sE(r,i,o,f){var d=r==null?0:r.length;return d?(o&&typeof o!="number"&&St(r,i,o)&&(o=0,f=d),Qv(r,i,o,f)):[]}function Xd(r,i,o){var f=r==null?0:r.length;if(!f)return-1;var d=o==null?0:me(o);return d<0&&(d=it(f+d,0)),sa(r,se(i,3),d)}function ep(r,i,o){var f=r==null?0:r.length;if(!f)return-1;var d=f-1;return o!==n&&(d=me(o),d=o<0?it(f+d,0):mt(d,f-1)),sa(r,se(i,3),d,!0)}function tp(r){var i=r==null?0:r.length;return i?ht(r,1):[]}function aE(r){var i=r==null?0:r.length;return i?ht(r,L):[]}function oE(r,i){var o=r==null?0:r.length;return o?(i=i===n?1:me(i),ht(r,i)):[]}function uE(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 cE(r,i,o){var f=r==null?0:r.length;if(!f)return-1;var d=o==null?0:me(o);return d<0&&(d=it(f+d,0)),Zn(r,i,d)}function lE(r){var i=r==null?0:r.length;return i?tr(r,0,-1):[]}var fE=ye(function(r){var i=Ve(r,sc);return i.length&&i[0]===r[0]?ju(i):[]}),hE=ye(function(r){var i=rr(r),o=Ve(r,sc);return i===rr(o)?i=n:o.pop(),o.length&&o[0]===r[0]?ju(o,se(i,2)):[]}),dE=ye(function(r){var i=rr(r),o=Ve(r,sc);return i=typeof i=="function"?i:n,i&&o.pop(),o.length&&o[0]===r[0]?ju(o,n,i):[]});function pE(r,i){return r==null?"":lv.call(r,i)}function rr(r){var i=r==null?0:r.length;return i?r[i-1]:n}function mE(r,i,o){var f=r==null?0:r.length;if(!f)return-1;var d=f;return o!==n&&(d=me(o),d=d<0?it(f+d,0):mt(d,f-1)),i===i?zb(r,i,d):sa(r,Uh,d,!0)}function gE(r,i){return r&&r.length?dd(r,me(i)):n}var yE=ye(np);function np(r,i){return r&&r.length&&i&&i.length?Xu(r,i):r}function _E(r,i,o){return r&&r.length&&i&&i.length?Xu(r,i,se(o,2)):r}function wE(r,i,o){return r&&r.length&&i&&i.length?Xu(r,i,n,o):r}var bE=$r(function(r,i){var o=r==null?0:r.length,f=$u(r,i);return gd(r,Ve(i,function(d){return Gr(d,o)?+d:d}).sort(Od)),f});function vE(r,i){var o=[];if(!(r&&r.length))return o;var f=-1,d=[],g=r.length;for(i=se(i,3);++f<g;){var w=r[f];i(w,f,r)&&(o.push(w),d.push(f))}return gd(r,d),o}function wc(r){return r==null?r:pv.call(r)}function SE(r,i,o){var f=r==null?0:r.length;return f?(o&&typeof o!="number"&&St(r,i,o)?(i=0,o=f):(i=i==null?0:me(i),o=o===n?f:me(o)),tr(r,i,o)):[]}function EE(r,i){return Aa(r,i)}function TE(r,i,o){return rc(r,i,se(o,2))}function AE(r,i){var o=r==null?0:r.length;if(o){var f=Aa(r,i);if(f<o&&dr(r[f],i))return f}return-1}function OE(r,i){return Aa(r,i,!0)}function CE(r,i,o){return rc(r,i,se(o,2),!0)}function kE(r,i){var o=r==null?0:r.length;if(o){var f=Aa(r,i,!0)-1;if(dr(r[f],i))return f}return-1}function xE(r){return r&&r.length?_d(r):[]}function RE(r,i){return r&&r.length?_d(r,se(i,2)):[]}function PE(r){var i=r==null?0:r.length;return i?tr(r,1,i):[]}function DE(r,i,o){return r&&r.length?(i=o||i===n?1:me(i),tr(r,0,i<0?0:i)):[]}function ME(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 LE(r,i){return r&&r.length?Oa(r,se(i,3),!1,!0):[]}function NE(r,i){return r&&r.length?Oa(r,se(i,3)):[]}var UE=ye(function(r){return cn(ht(r,1,et,!0))}),BE=ye(function(r){var i=rr(r);return et(i)&&(i=n),cn(ht(r,1,et,!0),se(i,2))}),IE=ye(function(r){var i=rr(r);return i=typeof i=="function"?i:n,cn(ht(r,1,et,!0),n,i)});function FE(r){return r&&r.length?cn(r):[]}function WE(r,i){return r&&r.length?cn(r,se(i,2)):[]}function HE(r,i){return i=typeof i=="function"?i:n,r&&r.length?cn(r,n,i):[]}function bc(r){if(!(r&&r.length))return[];var i=0;return r=nn(r,function(o){if(et(o))return i=it(o.length,i),!0}),Bu(i,function(o){return Ve(r,Lu(o))})}function ip(r,i){if(!(r&&r.length))return[];var o=bc(r);return i==null?o:Ve(o,function(f){return Ut(i,n,f)})}var YE=ye(function(r,i){return et(r)?Ji(r,i):[]}),KE=ye(function(r){return ic(nn(r,et))}),qE=ye(function(r){var i=rr(r);return et(i)&&(i=n),ic(nn(r,et),se(i,2))}),$E=ye(function(r){var i=rr(r);return i=typeof i=="function"?i:n,ic(nn(r,et),n,i)}),GE=ye(bc);function VE(r,i){return Sd(r||[],i||[],ji)}function zE(r,i){return Sd(r||[],i||[],Xi)}var jE=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 JE(r,i){return i(r),r}function Na(r,i){return i(r)}var QE=$r(function(r){var i=r.length,o=i?r[0]:0,f=this.__wrapped__,d=function(g){return $u(g,r)};return i>1||this.__actions__.length||!(f instanceof ve)||!Gr(o)?this.thru(d):(f=f.slice(o,+o+(i?1:0)),f.__actions__.push({func:Na,args:[d],thisArg:n}),new Xt(f,this.__chain__).thru(function(g){return i&&!g.length&&g.push(n),g}))});function ZE(){return sp(this)}function XE(){return new Xt(this.value(),this.__chain__)}function eT(){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 tT(){return this}function rT(r){for(var i,o=this;o instanceof ba;){var f=Zd(o);f.__index__=0,f.__values__=n,i?d.__wrapped__=f:i=f;var d=f;o=o.__wrapped__}return d.__wrapped__=r,i}function nT(){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:Na,args:[wc],thisArg:n}),new Xt(i,this.__chain__)}return this.thru(wc)}function iT(){return vd(this.__wrapped__,this.__actions__)}var sT=Ca(function(r,i,o){Me.call(r,o)?++r[o]:Kr(r,o,1)});function aT(r,i,o){var f=fe(r)?Lh:Jv;return o&&St(r,i,o)&&(i=n),f(r,se(i,3))}function oT(r,i){var o=fe(r)?nn:id;return o(r,se(i,3))}var uT=Dd(Xd),cT=Dd(ep);function lT(r,i){return ht(Ua(r,i),1)}function fT(r,i){return ht(Ua(r,i),L)}function hT(r,i,o){return o=o===n?1:me(o),ht(Ua(r,i),o)}function ap(r,i){var o=fe(r)?Qt:un;return o(r,se(i,3))}function op(r,i){var o=fe(r)?Pb:nd;return o(r,se(i,3))}var dT=Ca(function(r,i,o){Me.call(r,o)?r[o].push(i):Kr(r,o,[i])});function pT(r,i,o,f){r=Pt(r)?r:li(r),o=o&&!f?me(o):0;var d=r.length;return o<0&&(o=it(d+o,0)),Ha(r)?o<=d&&r.indexOf(i,o)>-1:!!d&&Zn(r,i,o)>-1}var mT=ye(function(r,i,o){var f=-1,d=typeof i=="function",g=Pt(r)?B(r.length):[];return un(r,function(w){g[++f]=d?Ut(i,w,o):Qi(w,i,o)}),g}),gT=Ca(function(r,i,o){Kr(r,o,i)});function Ua(r,i){var o=fe(r)?Ve:ld;return o(r,se(i,3))}function yT(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 _T=Ca(function(r,i,o){r[o?0:1].push(i)},function(){return[[],[]]});function wT(r,i,o){var f=fe(r)?Du:Ih,d=arguments.length<3;return f(r,se(i,4),o,d,un)}function bT(r,i,o){var f=fe(r)?Db:Ih,d=arguments.length<3;return f(r,se(i,4),o,d,nd)}function vT(r,i){var o=fe(r)?nn:id;return o(r,Fa(se(i,3)))}function ST(r){var i=fe(r)?Xh:pS;return i(r)}function ET(r,i,o){(o?St(r,i,o):i===n)?i=1:i=me(i);var f=fe(r)?$v:mS;return f(r,i)}function TT(r){var i=fe(r)?Gv:yS;return i(r)}function AT(r){if(r==null)return 0;if(Pt(r))return Ha(r)?ei(r):r.length;var i=gt(r);return i==Be||i==lr?r.size:Qu(r).length}function OT(r,i,o){var f=fe(r)?Mu:_S;return o&&St(r,i,o)&&(i=n),f(r,se(i,3))}var CT=ye(function(r,i){if(r==null)return[];var o=i.length;return o>1&&St(r,i[0],i[1])?i=[]:o>2&&St(i[0],i[1],i[2])&&(i=[i[0]]),pd(r,ht(i,1),[])}),Ba=ov||function(){return ft.Date.now()};function kT(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,Re,n,n,n,n,i)}function cp(r,i){var o;if(typeof i!="function")throw new Zt(u);return r=me(r),function(){return--r>0&&(o=i.apply(this,arguments)),r<=1&&(i=n),o}}var vc=ye(function(r,i,o){var f=F;if(o.length){var d=an(o,ui(vc));f|=_e}return qr(r,f,i,o,d)}),lp=ye(function(r,i,o){var f=F|ne;if(o.length){var d=an(o,ui(lp));f|=_e}return qr(i,f,r,o,d)});function fp(r,i,o){i=o?n:i;var f=qr(r,Ae,n,n,n,n,n,i);return f.placeholder=fp.placeholder,f}function hp(r,i,o){i=o?n:i;var f=qr(r,Se,n,n,n,n,n,i);return f.placeholder=hp.placeholder,f}function dp(r,i,o){var f,d,g,w,S,x,H=0,K=!1,G=!1,j=!0;if(typeof r!="function")throw new Zt(u);i=nr(i)||0,je(o)&&(K=!!o.leading,G="maxWait"in o,g=G?it(nr(o.maxWait)||0,i):g,j="trailing"in o?!!o.trailing:j);function re(tt){var pr=f,jr=d;return f=d=n,H=tt,w=r.apply(jr,pr),w}function ae(tt){return H=tt,S=rs(we,i),K?re(tt):w}function ge(tt){var pr=tt-x,jr=tt-H,Dp=i-pr;return G?mt(Dp,g-jr):Dp}function oe(tt){var pr=tt-x,jr=tt-H;return x===n||pr>=i||pr<0||G&&jr>=g}function we(){var tt=Ba();if(oe(tt))return Ee(tt);S=rs(we,ge(tt))}function Ee(tt){return S=n,j&&f?re(tt):(f=d=n,w)}function Wt(){S!==n&&Ed(S),H=0,f=x=d=S=n}function Et(){return S===n?w:Ee(Ba())}function Ht(){var tt=Ba(),pr=oe(tt);if(f=arguments,d=this,x=tt,pr){if(S===n)return ae(x);if(G)return Ed(S),S=rs(we,i),re(x)}return S===n&&(S=rs(we,i)),w}return Ht.cancel=Wt,Ht.flush=Et,Ht}var xT=ye(function(r,i){return rd(r,1,i)}),RT=ye(function(r,i,o){return rd(r,nr(i)||0,o)});function PT(r){return qr(r,_)}function Ia(r,i){if(typeof r!="function"||i!=null&&typeof i!="function")throw new Zt(u);var o=function(){var f=arguments,d=i?i.apply(this,f):f[0],g=o.cache;if(g.has(d))return g.get(d);var w=r.apply(this,f);return o.cache=g.set(d,w)||g,w};return o.cache=new(Ia.Cache||Yr),o}Ia.Cache=Yr;function Fa(r){if(typeof r!="function")throw new Zt(u);return function(){var i=arguments;switch(i.length){case 0:return!r.call(this);case 1:return!r.call(this,i[0]);case 2:return!r.call(this,i[0],i[1]);case 3:return!r.call(this,i[0],i[1],i[2])}return!r.apply(this,i)}}function DT(r){return cp(2,r)}var MT=wS(function(r,i){i=i.length==1&&fe(i[0])?Ve(i[0],Bt(se())):Ve(ht(i,1),Bt(se()));var o=i.length;return ye(function(f){for(var d=-1,g=mt(f.length,o);++d<g;)f[d]=i[d].call(this,f[d]);return Ut(r,this,f)})}),Sc=ye(function(r,i){var o=an(i,ui(Sc));return qr(r,_e,n,i,o)}),pp=ye(function(r,i){var o=an(i,ui(pp));return qr(r,Fe,n,i,o)}),LT=$r(function(r,i){return qr(r,y,n,n,n,i)});function NT(r,i){if(typeof r!="function")throw new Zt(u);return i=i===n?i:me(i),ye(r,i)}function UT(r,i){if(typeof r!="function")throw new Zt(u);return i=i==null?0:it(me(i),0),ye(function(o){var f=o[i],d=fn(o,0,i);return f&&sn(d,f),Ut(r,this,d)})}function BT(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 IT(r){return up(r,1)}function FT(r,i){return Sc(ac(i),r)}function WT(){if(!arguments.length)return[];var r=arguments[0];return fe(r)?r:[r]}function HT(r){return er(r,$)}function YT(r,i){return i=typeof i=="function"?i:n,er(r,$,i)}function KT(r){return er(r,E|$)}function qT(r,i){return i=typeof i=="function"?i:n,er(r,E|$,i)}function $T(r,i){return i==null||td(r,i,ot(i))}function dr(r,i){return r===i||r!==r&&i!==i}var GT=Pa(zu),VT=Pa(function(r,i){return r>=i}),Mn=od((function(){return arguments})())?od:function(r){return Je(r)&&Me.call(r,"callee")&&!Vh.call(r,"callee")},fe=B.isArray,zT=kh?Bt(kh):rS;function Pt(r){return r!=null&&Wa(r.length)&&!Vr(r)}function et(r){return Je(r)&&Pt(r)}function jT(r){return r===!0||r===!1||Je(r)&&vt(r)==Er}var hn=cv||Mc,JT=xh?Bt(xh):nS;function QT(r){return Je(r)&&r.nodeType===1&&!ns(r)}function ZT(r){if(r==null)return!0;if(Pt(r)&&(fe(r)||typeof r=="string"||typeof r.splice=="function"||hn(r)||ci(r)||Mn(r)))return!r.length;var i=gt(r);if(i==Be||i==lr)return!r.size;if(ts(r))return!Qu(r).length;for(var o in r)if(Me.call(r,o))return!1;return!0}function XT(r,i){return Zi(r,i)}function eA(r,i,o){o=typeof o=="function"?o:n;var f=o?o(r,i):n;return f===n?Zi(r,i,n,o):!!f}function Ec(r){if(!Je(r))return!1;var i=vt(r);return i==wt||i==Ii||typeof r.message=="string"&&typeof r.name=="string"&&!ns(r)}function tA(r){return typeof r=="number"&&jh(r)}function Vr(r){if(!je(r))return!1;var i=vt(r);return i==Tr||i==bt||i==at||i==A1}function mp(r){return typeof r=="number"&&r==me(r)}function Wa(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=D}function je(r){var i=typeof r;return r!=null&&(i=="object"||i=="function")}function Je(r){return r!=null&&typeof r=="object"}var gp=Rh?Bt(Rh):sS;function rA(r,i){return r===i||Ju(r,i,dc(i))}function nA(r,i,o){return o=typeof o=="function"?o:n,Ju(r,i,dc(i),o)}function iA(r){return yp(r)&&r!=+r}function sA(r){if(YS(r))throw new ue(c);return ud(r)}function aA(r){return r===null}function oA(r){return r==null}function yp(r){return typeof r=="number"||Je(r)&&vt(r)==Ue}function ns(r){if(!Je(r)||vt(r)!=Wr)return!1;var i=da(r);if(i===null)return!0;var o=Me.call(i,"constructor")&&i.constructor;return typeof o=="function"&&o instanceof o&&ca.call(o)==nv}var Tc=Ph?Bt(Ph):aS;function uA(r){return mp(r)&&r>=-D&&r<=D}var _p=Dh?Bt(Dh):oS;function Ha(r){return typeof r=="string"||!fe(r)&&Je(r)&&vt(r)==Wi}function Ft(r){return typeof r=="symbol"||Je(r)&&vt(r)==ea}var ci=Mh?Bt(Mh):uS;function cA(r){return r===n}function lA(r){return Je(r)&>(r)==Hi}function fA(r){return Je(r)&&vt(r)==C1}var hA=Pa(Zu),dA=Pa(function(r,i){return r<=i});function wp(r){if(!r)return[];if(Pt(r))return Ha(r)?fr(r):Rt(r);if(qi&&r[qi])return $b(r[qi]());var i=gt(r),o=i==Be?Fu:i==lr?aa:li;return o(r)}function zr(r){if(!r)return r===0?r:0;if(r=nr(r),r===L||r===-L){var i=r<0?-1:1;return i*q}return r===r?r:0}function me(r){var i=zr(r),o=i%1;return i===i?o?i-o:i:0}function bp(r){return r?xn(me(r),0,J):0}function nr(r){if(typeof r=="number")return r;if(Ft(r))return te;if(je(r)){var i=typeof r.valueOf=="function"?r.valueOf():r;r=je(i)?i+"":i}if(typeof r!="string")return r===0?r:+r;r=Fh(r);var o=z1.test(r);return o||J1.test(r)?kb(r.slice(2),o?2:8):V1.test(r)?te:+r}function vp(r){return Or(r,Dt(r))}function pA(r){return r?xn(me(r),-D,D):r===0?r:0}function De(r){return r==null?"":It(r)}var mA=ai(function(r,i){if(ts(i)||Pt(i)){Or(i,ot(i),r);return}for(var o in i)Me.call(i,o)&&ji(r,o,i[o])}),Sp=ai(function(r,i){Or(i,Dt(i),r)}),Ya=ai(function(r,i,o,f){Or(i,Dt(i),r,f)}),gA=ai(function(r,i,o,f){Or(i,ot(i),r,f)}),yA=$r($u);function _A(r,i){var o=si(r);return i==null?o:ed(o,i)}var wA=ye(function(r,i){r=Ie(r);var o=-1,f=i.length,d=f>2?i[2]:n;for(d&&St(i[0],i[1],d)&&(f=1);++o<f;)for(var g=i[o],w=Dt(g),S=-1,x=w.length;++S<x;){var H=w[S],K=r[H];(K===n||dr(K,ri[H])&&!Me.call(r,H))&&(r[H]=g[H])}return r}),bA=ye(function(r){return r.push(n,Fd),Ut(Ep,n,r)});function vA(r,i){return Nh(r,se(i,3),Ar)}function SA(r,i){return Nh(r,se(i,3),Vu)}function EA(r,i){return r==null?r:Gu(r,se(i,3),Dt)}function TA(r,i){return r==null?r:sd(r,se(i,3),Dt)}function AA(r,i){return r&&Ar(r,se(i,3))}function OA(r,i){return r&&Vu(r,se(i,3))}function CA(r){return r==null?[]:Ea(r,ot(r))}function kA(r){return r==null?[]:Ea(r,Dt(r))}function Ac(r,i,o){var f=r==null?n:Rn(r,i);return f===n?o:f}function xA(r,i){return r!=null&&Yd(r,i,Zv)}function Oc(r,i){return r!=null&&Yd(r,i,Xv)}var RA=Ld(function(r,i,o){i!=null&&typeof i.toString!="function"&&(i=la.call(i)),r[i]=o},kc(Mt)),PA=Ld(function(r,i,o){i!=null&&typeof i.toString!="function"&&(i=la.call(i)),Me.call(r,i)?r[i].push(o):r[i]=[o]},se),DA=ye(Qi);function ot(r){return Pt(r)?Zh(r):Qu(r)}function Dt(r){return Pt(r)?Zh(r,!0):cS(r)}function MA(r,i){var o={};return i=se(i,3),Ar(r,function(f,d,g){Kr(o,i(f,d,g),f)}),o}function LA(r,i){var o={};return i=se(i,3),Ar(r,function(f,d,g){Kr(o,d,i(f,d,g))}),o}var NA=ai(function(r,i,o){Ta(r,i,o)}),Ep=ai(function(r,i,o,f){Ta(r,i,o,f)}),UA=$r(function(r,i){var o={};if(r==null)return o;var f=!1;i=Ve(i,function(g){return g=ln(g,r),f||(f=g.length>1),g}),Or(r,fc(r),o),f&&(o=er(o,E|R|$,RS));for(var d=i.length;d--;)nc(o,i[d]);return o});function BA(r,i){return Tp(r,Fa(se(i)))}var IA=$r(function(r,i){return r==null?{}:fS(r,i)});function Tp(r,i){if(r==null)return{};var o=Ve(fc(r),function(f){return[f]});return i=se(i),md(r,o,function(f,d){return i(f,d[0])})}function FA(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[Cr(i[f])];g===n&&(f=d,g=o),r=Vr(g)?g.call(r):g}return r}function WA(r,i,o){return r==null?r:Xi(r,i,o)}function HA(r,i,o,f){return f=typeof f=="function"?f:n,r==null?r:Xi(r,i,o,f)}var Ap=Bd(ot),Op=Bd(Dt);function YA(r,i,o){var f=fe(r),d=f||hn(r)||ci(r);if(i=se(i,4),o==null){var g=r&&r.constructor;d?o=f?new g:[]:je(r)?o=Vr(g)?si(da(r)):{}:o={}}return(d?Qt:Ar)(r,function(w,S,x){return i(o,w,S,x)}),o}function KA(r,i){return r==null?!0:nc(r,i)}function qA(r,i,o){return r==null?r:bd(r,i,ac(o))}function $A(r,i,o,f){return f=typeof f=="function"?f:n,r==null?r:bd(r,i,ac(o),f)}function li(r){return r==null?[]:Iu(r,ot(r))}function GA(r){return r==null?[]:Iu(r,Dt(r))}function VA(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 zA(r,i,o){return i=zr(i),o===n?(o=i,i=0):o=zr(o),r=nr(r),eS(r,i,o)}function jA(r,i,o){if(o&&typeof o!="boolean"&&St(r,i,o)&&(i=o=n),o===n&&(typeof i=="boolean"?(o=i,i=n):typeof r=="boolean"&&(o=r,r=n)),r===n&&i===n?(r=0,i=1):(r=zr(r),i===n?(i=r,r=0):i=zr(i)),r>i){var f=r;r=i,i=f}if(o||r%1||i%1){var d=Jh();return mt(r+d*(i-r+Cb("1e-"+((d+"").length-1))),i)}return ec(r,i)}var JA=oi(function(r,i,o){return i=i.toLowerCase(),r+(o?Cp(i):i)});function Cp(r){return Cc(De(r).toLowerCase())}function kp(r){return r=De(r),r&&r.replace(Z1,Wb).replace(yb,"")}function QA(r,i,o){r=De(r),i=It(i);var f=r.length;o=o===n?f:xn(me(o),0,f);var d=o;return o-=i.length,o>=0&&r.slice(o,d)==i}function ZA(r){return r=De(r),r&&D1.test(r)?r.replace(sh,Hb):r}function XA(r){return r=De(r),r&&I1.test(r)?r.replace(Su,"\\$&"):r}var eO=oi(function(r,i,o){return r+(o?"-":"")+i.toLowerCase()}),tO=oi(function(r,i,o){return r+(o?" ":"")+i.toLowerCase()}),rO=Pd("toLowerCase");function nO(r,i,o){r=De(r),i=me(i);var f=i?ei(r):0;if(!i||f>=i)return r;var d=(i-f)/2;return Ra(ya(d),o)+r+Ra(ga(d),o)}function iO(r,i,o){r=De(r),i=me(i);var f=i?ei(r):0;return i&&f<i?r+Ra(i-f,o):r}function sO(r,i,o){r=De(r),i=me(i);var f=i?ei(r):0;return i&&f<i?Ra(i-f,o)+r:r}function aO(r,i,o){return o||i==null?i=0:i&&(i=+i),dv(De(r).replace(Eu,""),i||0)}function oO(r,i,o){return(o?St(r,i,o):i===n)?i=1:i=me(i),tc(De(r),i)}function uO(){var r=arguments,i=De(r[0]);return r.length<3?i:i.replace(r[1],r[2])}var cO=oi(function(r,i,o){return r+(o?"_":"")+i.toLowerCase()});function lO(r,i,o){return o&&typeof o!="number"&&St(r,i,o)&&(i=o=n),o=o===n?J:o>>>0,o?(r=De(r),r&&(typeof i=="string"||i!=null&&!Tc(i))&&(i=It(i),!i&&Xn(r))?fn(fr(r),0,o):r.split(i,o)):[]}var fO=oi(function(r,i,o){return r+(o?" ":"")+Cc(i)});function hO(r,i,o){return r=De(r),o=o==null?0:xn(me(o),0,r.length),i=It(i),r.slice(o,o+i.length)==i}function dO(r,i,o){var f=p.templateSettings;o&&St(r,i,o)&&(i=n),r=De(r),i=Ya({},i,f,Id);var d=Ya({},i.imports,f.imports,Id),g=ot(d),w=Iu(d,g),S,x,H=0,K=i.interpolate||ta,G="__p += '",j=Wu((i.escape||ta).source+"|"+K.source+"|"+(K===ah?G1:ta).source+"|"+(i.evaluate||ta).source+"|$","g"),re="//# sourceURL="+(Me.call(i,"sourceURL")?(i.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Sb+"]")+`
|
|
17
|
+
`;r.replace(j,function(oe,we,Ee,Wt,Et,Ht){return Ee||(Ee=Wt),G+=r.slice(H,Ht).replace(X1,Yb),we&&(S=!0,G+=`' +
|
|
18
|
+
__e(`+we+`) +
|
|
19
|
+
'`),Et&&(x=!0,G+=`';
|
|
20
|
+
`+Et+`;
|
|
21
|
+
__p += '`),Ee&&(G+=`' +
|
|
22
|
+
((__t = (`+Ee+`)) == null ? '' : __t) +
|
|
23
|
+
'`),H=Ht+oe.length,oe}),G+=`';
|
|
24
|
+
`;var ae=Me.call(i,"variable")&&i.variable;if(!ae)G=`with (obj) {
|
|
25
25
|
`+G+`
|
|
26
26
|
}
|
|
27
|
-
`;else if(
|
|
28
|
-
`+(
|
|
29
|
-
`)+"var __t, __p = ''"+(S?", __e = _.escape":"")+(
|
|
27
|
+
`;else if(q1.test(ae))throw new ue(l);G=(x?G.replace(k1,""):G).replace(x1,"$1").replace(R1,"$1;"),G="function("+(ae||"obj")+`) {
|
|
28
|
+
`+(ae?"":`obj || (obj = {});
|
|
29
|
+
`)+"var __t, __p = ''"+(S?", __e = _.escape":"")+(x?`, __j = Array.prototype.join;
|
|
30
30
|
function print() { __p += __j.call(arguments, '') }
|
|
31
31
|
`:`;
|
|
32
32
|
`)+G+`return __p
|
|
33
|
-
}`;var me=mp(function(){return Re(g,te+"return "+G).apply(n,w)});if(me.source=G,uc(me))throw me;return me}function oO(r){return Pe(r).toLowerCase()}function uO(r){return Pe(r).toUpperCase()}function cO(r,i,o){if(r=Pe(r),r&&(o||i===n))return Eh(r);if(!r||!(i=Ut(i)))return r;var f=lr(r),d=lr(i),g=Ah(f,d),w=Oh(f,d)+1;return ln(f,g,w).join("")}function lO(r,i,o){if(r=Pe(r),r&&(o||i===n))return r.slice(0,Ch(r)+1);if(!r||!(i=Ut(i)))return r;var f=lr(r),d=Oh(f,lr(i))+1;return ln(f,0,d).join("")}function fO(r,i,o){if(r=Pe(r),r&&(o||i===n))return r.replace(uu,"");if(!r||!(i=Ut(i)))return r;var f=lr(r),d=Ah(f,lr(i));return ln(f,d).join("")}function hO(r,i){var o=v,f=M;if(Ve(i)){var d="separator"in i?i.separator:d;o="length"in i?pe(i.length):o,f="omission"in i?Ut(i.omission):f}r=Pe(r);var g=r.length;if(Zn(r)){var w=lr(r);g=w.length}if(o>=g)return r;var S=o-Xn(f);if(S<1)return f;var k=w?ln(w,0,S).join(""):r.slice(0,S);if(d===n)return k+f;if(w&&(S+=k.length-S),cc(d)){if(r.slice(S).search(d)){var H,K=k;for(d.global||(d=Au(d.source,Pe(Gf.exec(d))+"g")),d.lastIndex=0;H=d.exec(K);)var G=H.index;k=k.slice(0,G===n?S:G)}}else if(r.indexOf(Ut(d),S)!=S){var j=k.lastIndexOf(d);j>-1&&(k=k.slice(0,j))}return k+f}function dO(r){return r=Pe(r),r&&E1.test(r)?r.replace(Kf,Yb):r}var pO=ai(function(r,i,o){return r+(o?" ":"")+i.toUpperCase()}),hc=gd("toUpperCase");function pp(r,i,o){return r=Pe(r),i=o?n:i,i===n?Ib(r)?$b(r):Cb(r):r.match(i)||[]}var mp=ge(function(r,i){try{return Lt(r,n,i)}catch(o){return uc(o)?o:new oe(o)}}),mO=$r(function(r,i){return jt(i,function(o){o=Or(o),Kr(r,o,ac(r[o],r))}),r});function gO(r){var i=r==null?0:r.length,o=ie();return r=i?$e(r,function(f){if(typeof f[1]!="function")throw new Jt(u);return[o(f[0]),f[1]]}):[],ge(function(f){for(var d=-1;++d<i;){var g=r[d];if(Lt(g[0],this,f))return Lt(g[1],this,f)}})}function yO(r){return Yv(Zt(r,T))}function dc(r){return function(){return r}}function _O(r,i){return r==null||r!==r?i:r}var wO=_d(),bO=_d(!0);function kt(r){return r}function pc(r){return Vh(typeof r=="function"?r:Zt(r,T))}function vO(r){return Jh(Zt(r,T))}function SO(r,i){return Qh(r,Zt(i,T))}var TO=ge(function(r,i){return function(o){return ji(o,r,i)}}),EO=ge(function(r,i){return function(o){return ji(r,o,i)}});function mc(r,i,o){var f=at(i),d=ga(i,f);o==null&&!(Ve(i)&&(d.length||!f.length))&&(o=i,i=r,r=this,d=ga(i,at(i)));var g=!(Ve(o)&&"chain"in o)||!!o.chain,w=zr(r);return jt(d,function(S){var k=i[S];r[S]=k,w&&(r.prototype[S]=function(){var H=this.__chain__;if(g||H){var K=r(this.__wrapped__),G=K.__actions__=Ot(this.__actions__);return G.push({func:k,args:arguments,thisArg:r}),K.__chain__=H,K}return k.apply(r,nn([this.value()],arguments))})}),r}function AO(){return ct._===this&&(ct._=Qb),this}function gc(){}function OO(r){return r=pe(r),ge(function(i){return Zh(i,r)})}var xO=zu($e),CO=zu(wh),kO=zu(_u);function gp(r){return ec(r)?wu(Or(r)):sS(r)}function RO(r){return function(i){return r==null?n:On(r,i)}}var PO=bd(),DO=bd(!0);function yc(){return[]}function _c(){return!1}function MO(){return{}}function LO(){return""}function NO(){return!0}function UO(r,i){if(r=pe(r),r<1||r>D)return[];var o=J,f=pt(r,J);i=ie(i),r-=J;for(var d=Su(f,i);++o<r;)i(o);return d}function IO(r){return le(r)?$e(r,Or):It(r)?[r]:Ot(Ud(Pe(r)))}function BO(r){var i=++jb;return Pe(r)+i}var FO=Sa(function(r,i){return r+i},0),WO=Vu("ceil"),HO=Sa(function(r,i){return r/i},1),YO=Vu("floor");function KO(r){return r&&r.length?ma(r,kt,Mu):n}function qO(r,i){return r&&r.length?ma(r,ie(i,2),Mu):n}function $O(r){return Sh(r,kt)}function GO(r,i){return Sh(r,ie(i,2))}function zO(r){return r&&r.length?ma(r,kt,Iu):n}function VO(r,i){return r&&r.length?ma(r,ie(i,2),Iu):n}var jO=Sa(function(r,i){return r*i},1),JO=Vu("round"),QO=Sa(function(r,i){return r-i},0);function ZO(r){return r&&r.length?vu(r,kt):0}function XO(r,i){return r&&r.length?vu(r,ie(i,2)):0}return p.after=vE,p.ary=zd,p.assign=uA,p.assignIn=op,p.assignInWith=Na,p.assignWith=cA,p.at=lA,p.before=Vd,p.bind=ac,p.bindAll=mO,p.bindKey=jd,p.castArray=ME,p.chain=qd,p.chunk=YS,p.compact=KS,p.concat=qS,p.cond=gO,p.conforms=yO,p.constant=dc,p.countBy=ZT,p.create=fA,p.curry=Jd,p.curryRight=Qd,p.debounce=Zd,p.defaults=hA,p.defaultsDeep=dA,p.defer=SE,p.delay=TE,p.difference=$S,p.differenceBy=GS,p.differenceWith=zS,p.drop=VS,p.dropRight=jS,p.dropRightWhile=JS,p.dropWhile=QS,p.fill=ZS,p.filter=eE,p.flatMap=nE,p.flatMapDeep=iE,p.flatMapDepth=sE,p.flatten=Wd,p.flattenDeep=XS,p.flattenDepth=eT,p.flip=EE,p.flow=wO,p.flowRight=bO,p.fromPairs=tT,p.functions=bA,p.functionsIn=vA,p.groupBy=aE,p.initial=nT,p.intersection=iT,p.intersectionBy=sT,p.intersectionWith=aT,p.invert=TA,p.invertBy=EA,p.invokeMap=uE,p.iteratee=pc,p.keyBy=cE,p.keys=at,p.keysIn=Ct,p.map=ka,p.mapKeys=OA,p.mapValues=xA,p.matches=vO,p.matchesProperty=SO,p.memoize=Pa,p.merge=CA,p.mergeWith=up,p.method=TO,p.methodOf=EO,p.mixin=mc,p.negate=Da,p.nthArg=OO,p.omit=kA,p.omitBy=RA,p.once=AE,p.orderBy=lE,p.over=xO,p.overArgs=OE,p.overEvery=CO,p.overSome=kO,p.partial=oc,p.partialRight=Xd,p.partition=fE,p.pick=PA,p.pickBy=cp,p.property=gp,p.propertyOf=RO,p.pull=lT,p.pullAll=Yd,p.pullAllBy=fT,p.pullAllWith=hT,p.pullAt=dT,p.range=PO,p.rangeRight=DO,p.rearg=xE,p.reject=pE,p.remove=pT,p.rest=CE,p.reverse=ic,p.sampleSize=gE,p.set=MA,p.setWith=LA,p.shuffle=yE,p.slice=mT,p.sortBy=bE,p.sortedUniq=ST,p.sortedUniqBy=TT,p.split=nO,p.spread=kE,p.tail=ET,p.take=AT,p.takeRight=OT,p.takeRightWhile=xT,p.takeWhile=CT,p.tap=KT,p.throttle=RE,p.thru=Ca,p.toArray=ip,p.toPairs=lp,p.toPairsIn=fp,p.toPath=IO,p.toPlainObject=ap,p.transform=NA,p.unary=PE,p.union=kT,p.unionBy=RT,p.unionWith=PT,p.uniq=DT,p.uniqBy=MT,p.uniqWith=LT,p.unset=UA,p.unzip=sc,p.unzipWith=Kd,p.update=IA,p.updateWith=BA,p.values=ci,p.valuesIn=FA,p.without=NT,p.words=pp,p.wrap=DE,p.xor=UT,p.xorBy=IT,p.xorWith=BT,p.zip=FT,p.zipObject=WT,p.zipObjectDeep=HT,p.zipWith=YT,p.entries=lp,p.entriesIn=fp,p.extend=op,p.extendWith=Na,mc(p,p),p.add=FO,p.attempt=mp,p.camelCase=KA,p.capitalize=hp,p.ceil=WO,p.clamp=WA,p.clone=LE,p.cloneDeep=UE,p.cloneDeepWith=IE,p.cloneWith=NE,p.conformsTo=BE,p.deburr=dp,p.defaultTo=_O,p.divide=HO,p.endsWith=qA,p.eq=hr,p.escape=$A,p.escapeRegExp=GA,p.every=XT,p.find=tE,p.findIndex=Bd,p.findKey=pA,p.findLast=rE,p.findLastIndex=Fd,p.findLastKey=mA,p.floor=YO,p.forEach=$d,p.forEachRight=Gd,p.forIn=gA,p.forInRight=yA,p.forOwn=_A,p.forOwnRight=wA,p.get=lc,p.gt=FE,p.gte=WE,p.has=SA,p.hasIn=fc,p.head=Hd,p.identity=kt,p.includes=oE,p.indexOf=rT,p.inRange=HA,p.invoke=AA,p.isArguments=kn,p.isArray=le,p.isArrayBuffer=HE,p.isArrayLike=xt,p.isArrayLikeObject=Ze,p.isBoolean=YE,p.isBuffer=fn,p.isDate=KE,p.isElement=qE,p.isEmpty=$E,p.isEqual=GE,p.isEqualWith=zE,p.isError=uc,p.isFinite=VE,p.isFunction=zr,p.isInteger=ep,p.isLength=Ma,p.isMap=tp,p.isMatch=jE,p.isMatchWith=JE,p.isNaN=QE,p.isNative=ZE,p.isNil=eA,p.isNull=XE,p.isNumber=rp,p.isObject=Ve,p.isObjectLike=je,p.isPlainObject=ts,p.isRegExp=cc,p.isSafeInteger=tA,p.isSet=np,p.isString=La,p.isSymbol=It,p.isTypedArray=ui,p.isUndefined=rA,p.isWeakMap=nA,p.isWeakSet=iA,p.join=oT,p.kebabCase=zA,p.last=er,p.lastIndexOf=uT,p.lowerCase=VA,p.lowerFirst=jA,p.lt=sA,p.lte=aA,p.max=KO,p.maxBy=qO,p.mean=$O,p.meanBy=GO,p.min=zO,p.minBy=VO,p.stubArray=yc,p.stubFalse=_c,p.stubObject=MO,p.stubString=LO,p.stubTrue=NO,p.multiply=jO,p.nth=cT,p.noConflict=AO,p.noop=gc,p.now=Ra,p.pad=JA,p.padEnd=QA,p.padStart=ZA,p.parseInt=XA,p.random=YA,p.reduce=hE,p.reduceRight=dE,p.repeat=eO,p.replace=tO,p.result=DA,p.round=JO,p.runInContext=A,p.sample=mE,p.size=_E,p.snakeCase=rO,p.some=wE,p.sortedIndex=gT,p.sortedIndexBy=yT,p.sortedIndexOf=_T,p.sortedLastIndex=wT,p.sortedLastIndexBy=bT,p.sortedLastIndexOf=vT,p.startCase=iO,p.startsWith=sO,p.subtract=QO,p.sum=ZO,p.sumBy=XO,p.template=aO,p.times=UO,p.toFinite=Vr,p.toInteger=pe,p.toLength=sp,p.toLower=oO,p.toNumber=tr,p.toSafeInteger=oA,p.toString=Pe,p.toUpper=uO,p.trim=cO,p.trimEnd=lO,p.trimStart=fO,p.truncate=hO,p.unescape=dO,p.uniqueId=BO,p.upperCase=pO,p.upperFirst=hc,p.each=$d,p.eachRight=Gd,p.first=Hd,mc(p,(function(){var r={};return Er(p,function(i,o){De.call(p.prototype,o)||(r[o]=i)}),r})(),{chain:!1}),p.VERSION=s,jt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(r){p[r].placeholder=p}),jt(["drop","take"],function(r,i){be.prototype[r]=function(o){o=o===n?1:nt(pe(o),0);var f=this.__filtered__&&!i?new be(this):this.clone();return f.__filtered__?f.__takeCount__=pt(o,f.__takeCount__):f.__views__.push({size:pt(o,J),type:r+(f.__dir__<0?"Right":"")}),f},be.prototype[r+"Right"]=function(o){return this.reverse()[r](o).reverse()}}),jt(["filter","map","takeWhile"],function(r,i){var o=i+1,f=o==N||o==C;be.prototype[r]=function(d){var g=this.clone();return g.__iteratees__.push({iteratee:ie(d,3),type:o}),g.__filtered__=g.__filtered__||f,g}}),jt(["head","last"],function(r,i){var o="take"+(i?"Right":"");be.prototype[r]=function(){return this[o](1).value()[0]}}),jt(["initial","tail"],function(r,i){var o="drop"+(i?"":"Right");be.prototype[r]=function(){return this.__filtered__?new be(this):this[o](1)}}),be.prototype.compact=function(){return this.filter(kt)},be.prototype.find=function(r){return this.filter(r).head()},be.prototype.findLast=function(r){return this.reverse().find(r)},be.prototype.invokeMap=ge(function(r,i){return typeof r=="function"?new be(this):this.map(function(o){return ji(o,r,i)})}),be.prototype.reject=function(r){return this.filter(Da(ie(r)))},be.prototype.slice=function(r,i){r=pe(r);var o=this;return o.__filtered__&&(r>0||i<0)?new be(o):(r<0?o=o.takeRight(-r):r&&(o=o.drop(r)),i!==n&&(i=pe(i),o=i<0?o.dropRight(-i):o.take(i-r)),o)},be.prototype.takeRightWhile=function(r){return this.reverse().takeWhile(r).reverse()},be.prototype.toArray=function(){return this.take(J)},Er(be.prototype,function(r,i){var o=/^(?:filter|find|map|reject)|While$/.test(i),f=/^(?:head|last)$/.test(i),d=p[f?"take"+(i=="last"?"Right":""):i],g=f||/^find/.test(i);d&&(p.prototype[i]=function(){var w=this.__wrapped__,S=f?[1]:arguments,k=w instanceof be,H=S[0],K=k||le(w),G=function(_e){var Se=d.apply(p,nn([_e],S));return f&&j?Se[0]:Se};K&&o&&typeof H=="function"&&H.length!=1&&(k=K=!1);var j=this.__chain__,te=!!this.__actions__.length,se=g&&!j,me=k&&!te;if(!g&&K){w=me?w:new be(this);var ae=r.apply(w,S);return ae.__actions__.push({func:Ca,args:[G],thisArg:n}),new Qt(ae,j)}return se&&me?r.apply(this,S):(ae=this.thru(G),se?f?ae.value()[0]:ae.value():ae)})}),jt(["pop","push","shift","sort","splice","unshift"],function(r){var i=ea[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(le(g)?g:[],d)}return this[o](function(w){return i.apply(le(w)?w:[],d)})}}),Er(be.prototype,function(r,i){var o=p[i];if(o){var f=o.name+"";De.call(ni,f)||(ni[f]=[]),ni[f].push({name:i,func:o})}}),ni[va(n,re).name]=[{name:"wrapper",func:n}],be.prototype.clone=dv,be.prototype.reverse=pv,be.prototype.value=mv,p.prototype.at=qT,p.prototype.chain=$T,p.prototype.commit=GT,p.prototype.next=zT,p.prototype.plant=jT,p.prototype.reverse=JT,p.prototype.toJSON=p.prototype.valueOf=p.prototype.value=QT,p.prototype.first=p.prototype.head,Yi&&(p.prototype[Yi]=VT),p}),ei=Gb();vn?((vn.exports=ei)._=ei,pu._=ei):ct._=ei}).call(jm)})(_i,_i.exports)),_i.exports}var ol=Jm();const ot=sl(ol);var Qm=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,ja=Math.ceil,Ht=Math.floor,Et="[BigNumber Error] ",ul=Et+"Number primitive has more than 15 significant digits: ",nr=1e14,ue=14,Ja=9007199254740991,Qa=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],Jr=1e7,it=1e9;function cl(e){var t,n,s,a=Y.prototype={constructor:Y,toString:null,valueOf:null},c=new Y(1),u=20,l=4,h=-7,m=21,b=-1e7,T=1e7,R=!1,$=1,O=0,B={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},F="0123456789abcdefghijklmnopqrstuvwxyz",re=!0;function Y(y,_){var v,M,x,P,N,E,C,L,D=this;if(!(D instanceof Y))return new Y(y,_);if(_==null){if(y&&y._isBigNumber===!0){D.s=y.s,!y.c||y.e>T?D.c=D.e=null:y.e<b?D.c=[D.e=0]:(D.e=y.e,D.c=y.c.slice());return}if((E=typeof y=="number")&&y*0==0){if(D.s=1/y<0?(y=-y,-1):1,y===~~y){for(P=0,N=y;N>=10;N/=10,P++);P>T?D.c=D.e=null:(D.e=P,D.c=[y]);return}L=String(y)}else{if(!Qm.test(L=String(y)))return s(D,L,E);D.s=L.charCodeAt(0)==45?(L=L.slice(1),-1):1}(P=L.indexOf("."))>-1&&(L=L.replace(".","")),(N=L.search(/e/i))>0?(P<0&&(P=N),P+=+L.slice(N+1),L=L.substring(0,N)):P<0&&(P=L.length)}else{if(Ge(_,2,F.length,"Base"),_==10&&re)return D=new Y(y),Be(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(ul+y)}else D.s=L.charCodeAt(0)===45?(L=L.slice(1),-1):1;for(v=F.slice(0,_),P=N=0,C=L.length;N<C;N++)if(v.indexOf(M=L.charAt(N))<0){if(M=="."){if(N>P){P=C;continue}}else if(!x&&(L==L.toUpperCase()&&(L=L.toLowerCase())||L==L.toLowerCase()&&(L=L.toUpperCase()))){x=!0,N=-1,P=0;continue}return s(D,String(y),E,_)}E=!1,L=n(L,_,10,D.s),(P=L.indexOf("."))>-1?L=L.replace(".",""):P=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>Ja||y!==Ht(y)))throw Error(ul+D.s*y);if((P=P-N-1)>T)D.c=D.e=null;else if(P<b)D.c=[D.e=0];else{if(D.e=P,D.c=[],N=(P+1)%ue,P<0&&(N+=ue),N<C){for(N&&D.c.push(+L.slice(0,N)),C-=ue;N<C;)D.c.push(+L.slice(N,N+=ue));N=ue-(L=L.slice(N)).length}else N-=C;for(;N--;L+="0");D.c.push(+L)}}else D.c=[D.e=0]}Y.clone=cl,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[_],Ge(v,0,it,_),u=v),y.hasOwnProperty(_="ROUNDING_MODE")&&(v=y[_],Ge(v,0,8,_),l=v),y.hasOwnProperty(_="EXPONENTIAL_AT")&&(v=y[_],v&&v.pop?(Ge(v[0],-it,0,_),Ge(v[1],0,it,_),h=v[0],m=v[1]):(Ge(v,-it,it,_),h=-(m=v<0?-v:v))),y.hasOwnProperty(_="RANGE"))if(v=y[_],v&&v.pop)Ge(v[0],-it,-1,_),Ge(v[1],1,it,_),b=v[0],T=v[1];else if(Ge(v,-it,it,_),v)b=-(T=v<0?-v:v);else throw Error(Et+_+" cannot be zero: "+v);if(y.hasOwnProperty(_="CRYPTO"))if(v=y[_],v===!!v)if(v)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))R=v;else throw R=!v,Error(Et+"crypto unavailable");else R=v;else throw Error(Et+_+" not true or false: "+v);if(y.hasOwnProperty(_="MODULO_MODE")&&(v=y[_],Ge(v,0,9,_),$=v),y.hasOwnProperty(_="POW_PRECISION")&&(v=y[_],Ge(v,0,it,_),O=v),y.hasOwnProperty(_="FORMAT"))if(v=y[_],typeof v=="object")B=v;else throw Error(Et+_+" not an object: "+v);if(y.hasOwnProperty(_="ALPHABET"))if(v=y[_],typeof v=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(v))re=v.slice(0,10)=="0123456789",F=v;else throw Error(Et+_+" invalid: "+v)}else throw Error(Et+"Object expected: "+y);return{DECIMAL_PLACES:u,ROUNDING_MODE:l,EXPONENTIAL_AT:[h,m],RANGE:[b,T],CRYPTO:R,MODULO_MODE:$,POW_PRECISION:O,FORMAT:B,ALPHABET:F}},Y.isBigNumber=function(y){if(!y||y._isBigNumber!==!0)return!1;if(!Y.DEBUG)return!0;var _,v,M=y.c,x=y.e,P=y.s;e:if({}.toString.call(M)=="[object Array]"){if((P===1||P===-1)&&x>=-it&&x<=it&&x===Ht(x)){if(M[0]===0){if(x===0&&M.length===1)return!0;break e}if(_=(x+1)%ue,_<1&&(_+=ue),String(M[0]).length==_){for(_=0;_<M.length;_++)if(v=M[_],v<0||v>=nr||v!==Ht(v))break e;if(v!==0)return!0}}}else if(M===null&&x===null&&(P===null||P===1||P===-1))return!0;throw Error(Et+"Invalid BigNumber: "+y)},Y.maximum=Y.max=function(){return ve(arguments,-1)},Y.minimum=Y.min=function(){return ve(arguments,1)},Y.random=(function(){var y=9007199254740992,_=Math.random()*y&2097151?function(){return Ht(Math.random()*y)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(v){var M,x,P,N,E,C=0,L=[],D=new Y(c);if(v==null?v=u:Ge(v,0,it),N=ja(v/ue),R)if(crypto.getRandomValues){for(M=crypto.getRandomValues(new Uint32Array(N*=2));C<N;)E=M[C]*131072+(M[C+1]>>>11),E>=9e15?(x=crypto.getRandomValues(new Uint32Array(2)),M[C]=x[0],M[C+1]=x[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 R=!1,Error(Et+"crypto unavailable");if(!R)for(;C<N;)E=_(),E<9e15&&(L[C++]=E%1e14);for(N=L[--C],v%=ue,N&&v&&(E=Qa[ue-v],L[C]=Ht(N/E)*E);L[C]===0;L.pop(),C--);if(C<0)L=[P=0];else{for(P=-1;L[0]===0;L.splice(0,1),P-=ue);for(C=1,E=L[0];E>=10;E/=10,C++);C<ue&&(P-=ue-C)}return D.e=P,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,x,P){for(var N,E=[0],C,L=0,D=v.length;L<D;){for(C=E.length;C--;E[C]*=M);for(E[0]+=P.indexOf(v.charAt(L++)),N=0;N<E.length;N++)E[N]>x-1&&(E[N+1]==null&&(E[N+1]=0),E[N+1]+=E[N]/x|0,E[N]%=x)}return E.reverse()}return function(v,M,x,P,N){var E,C,L,D,q,X,J,de,Le=v.indexOf("."),Fe=u,ce=l;for(Le>=0&&(D=O,O=0,v=v.replace(".",""),de=new Y(M),X=de.pow(v.length-Le),O=D,de.c=_(Cr(Kt(X.c),X.e,"0"),10,x,y),de.e=de.c.length),J=_(v,M,x,N?(E=F,y):(E=y,F)),L=D=J.length;J[--D]==0;J.pop());if(!J[0])return E.charAt(0);if(Le<0?--L:(X.c=J,X.e=L,X.s=P,X=t(X,de,Fe,ce,x),J=X.c,q=X.r,L=X.e),C=L+Fe+1,Le=J[C],D=x/2,q=q||C<0||J[C+1]!=null,q=ce<4?(Le!=null||q)&&(ce==0||ce==(X.s<0?3:2)):Le>D||Le==D&&(ce==4||q||ce==6&&J[C-1]&1||ce==(X.s<0?8:7)),C<1||!J[0])v=q?Cr(E.charAt(1),-Fe,E.charAt(0)):E.charAt(0);else{if(J.length=C,q)for(--x;++J[--C]>x;)J[C]=0,C||(++L,J=[1].concat(J));for(D=J.length;!J[--D];);for(Le=0,v="";Le<=D;v+=E.charAt(J[Le++]));v=Cr(v,L,E.charAt(0))}return v}})(),t=(function(){function y(M,x,P){var N,E,C,L,D=0,q=M.length,X=x%Jr,J=x/Jr|0;for(M=M.slice();q--;)C=M[q]%Jr,L=M[q]/Jr|0,N=J*C+L*X,E=X*C+N%Jr*Jr+D,D=(E/P|0)+(N/Jr|0)+J*L,M[q]=E%P;return D&&(M=[D].concat(M)),M}function _(M,x,P,N){var E,C;if(P!=N)C=P>N?1:-1;else for(E=C=0;E<P;E++)if(M[E]!=x[E]){C=M[E]>x[E]?1:-1;break}return C}function v(M,x,P,N){for(var E=0;P--;)M[P]-=E,E=M[P]<x[P]?1:0,M[P]=E*N+M[P]-x[P];for(;!M[0]&&M.length>1;M.splice(0,1));}return function(M,x,P,N,E){var C,L,D,q,X,J,de,Le,Fe,ce,Ae,st,Sr,Fr,Ui,yt,Tr,_t=M.s==x.s?1:-1,Ue=M.c,Ne=x.c;if(!Ue||!Ue[0]||!Ne||!Ne[0])return new Y(!M.s||!x.s||(Ue?Ne&&Ue[0]==Ne[0]:!Ne)?NaN:Ue&&Ue[0]==0||!Ne?_t*0:_t/0);for(Le=new Y(_t),Fe=Le.c=[],L=M.e-x.e,_t=P+L+1,E||(E=nr,L=Yt(M.e/ue)-Yt(x.e/ue),_t=_t/ue|0),D=0;Ne[D]==(Ue[D]||0);D++);if(Ne[D]>(Ue[D]||0)&&L--,_t<0)Fe.push(1),q=!0;else{for(Fr=Ue.length,yt=Ne.length,D=0,_t+=2,X=Ht(E/(Ne[0]+1)),X>1&&(Ne=y(Ne,X,E),Ue=y(Ue,X,E),yt=Ne.length,Fr=Ue.length),Sr=yt,ce=Ue.slice(0,yt),Ae=ce.length;Ae<yt;ce[Ae++]=0);Tr=Ne.slice(),Tr=[0].concat(Tr),Ui=Ne[0],Ne[1]>=E/2&&Ui++;do{if(X=0,C=_(Ne,ce,yt,Ae),C<0){if(st=ce[0],yt!=Ae&&(st=st*E+(ce[1]||0)),X=Ht(st/Ui),X>1)for(X>=E&&(X=E-1),J=y(Ne,X,E),de=J.length,Ae=ce.length;_(J,ce,de,Ae)==1;)X--,v(J,yt<de?Tr:Ne,de,E),de=J.length,C=1;else X==0&&(C=X=1),J=Ne.slice(),de=J.length;if(de<Ae&&(J=[0].concat(J)),v(ce,J,Ae,E),Ae=ce.length,C==-1)for(;_(Ne,ce,yt,Ae)<1;)X++,v(ce,yt<Ae?Tr:Ne,Ae,E),Ae=ce.length}else C===0&&(X++,ce=[0]);Fe[D++]=X,ce[0]?ce[Ae++]=Ue[Sr]||0:(ce=[Ue[Sr]],Ae=1)}while((Sr++<Fr||ce[0]!=null)&&_t--);q=ce[0]!=null,Fe[0]||Fe.splice(0,1)}if(E==nr){for(D=1,_t=Fe[0];_t>=10;_t/=10,D++);Be(Le,P+(Le.e=D+L*ue-1)+1,N,q)}else Le.e=L,Le.r=+q;return Le}})();function Ee(y,_,v,M){var x,P,N,E,C;if(v==null?v=l:Ge(v,0,8),!y.c)return y.toString();if(x=y.c[0],N=y.e,_==null)C=Kt(y.c),C=M==1||M==2&&(N<=h||N>=m)?ys(C,N):Cr(C,N,"0");else if(y=Be(new Y(y),_,v),P=y.e,C=Kt(y.c),E=C.length,M==1||M==2&&(_<=P||P<=h)){for(;E<_;C+="0",E++);C=ys(C,P)}else if(_-=N+(M===2&&P>N),C=Cr(C,P,"0"),P+1>E){if(--_>0)for(C+=".";_--;C+="0");}else if(_+=P-E,_>0)for(P+1==E&&(C+=".");_--;C+="0");return y.s<0&&x?"-"+C:C}function ve(y,_){for(var v,M,x=1,P=new Y(y[0]);x<y.length;x++)M=new Y(y[x]),(!M.s||(v=mn(P,M))===_||v===0&&P.s===_)&&(P=M);return P}function ye(y,_,v){for(var M=1,x=_.length;!_[--x];_.pop());for(x=_[0];x>=10;x/=10,M++);return(v=M+v*ue-1)>T?y.c=y.e=null:v<b?y.c=[y.e=0]:(y.e=v,y.c=_),y}s=(function(){var y=/^(-?)0([xbo])(?=\w[\w.]*$)/i,_=/^([^.]+)\.$/,v=/^\.([^.]+)$/,M=/^-?(Infinity|NaN)$/,x=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(P,N,E,C){var L,D=E?N:N.replace(x,"");if(M.test(D))P.s=isNaN(D)?null:D<0?-1:1;else{if(!E&&(D=D.replace(y,function(q,X,J){return L=(J=J.toLowerCase())=="x"?16:J=="b"?2:8,!C||C==L?X:q}),C&&(L=C,D=D.replace(_,"$1").replace(v,"0.$1")),N!=D))return new Y(D,L);if(Y.DEBUG)throw Error(Et+"Not a"+(C?" base "+C:"")+" number: "+N);P.s=null}P.c=P.e=null}})();function Be(y,_,v,M){var x,P,N,E,C,L,D,q=y.c,X=Qa;if(q){e:{for(x=1,E=q[0];E>=10;E/=10,x++);if(P=_-x,P<0)P+=ue,N=_,C=q[L=0],D=Ht(C/X[x-N-1]%10);else if(L=ja((P+1)/ue),L>=q.length)if(M){for(;q.length<=L;q.push(0));C=D=0,x=1,P%=ue,N=P-ue+1}else break e;else{for(C=E=q[L],x=1;E>=10;E/=10,x++);P%=ue,N=P-ue+x,D=N<0?0:Ht(C/X[x-N-1]%10)}if(M=M||_<0||q[L+1]!=null||(N<0?C:C%X[x-N-1]),M=v<4?(D||M)&&(v==0||v==(y.s<0?3:2)):D>5||D==5&&(v==4||M||v==6&&(P>0?N>0?C/X[x-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]=X[(ue-_%ue)%ue],y.e=-_||0):q[0]=y.e=0,y;if(P==0?(q.length=L,E=1,L--):(q.length=L+1,E=X[ue-P],q[L]=N>0?Ht(C/X[x-N]%X[N])*E:0),M)for(;;)if(L==0){for(P=1,N=q[0];N>=10;N/=10,P++);for(N=q[0]+=E,E=1;N>=10;N/=10,E++);P!=E&&(y.e++,q[0]==nr&&(q[0]=1));break}else{if(q[L]+=E,q[L]!=nr)break;q[L--]=0,E=1}for(P=q.length;q[--P]===0;q.pop());}y.e>T?y.c=y.e=null:y.e<b&&(y.c=[y.e=0])}return y}function ke(y){var _,v=y.e;return v===null?y.toString():(_=Kt(y.c),_=v<=h||v>=m?ys(_,v):Cr(_,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 mn(this,new Y(y,_))},a.decimalPlaces=a.dp=function(y,_){var v,M,x,P=this;if(y!=null)return Ge(y,0,it),_==null?_=l:Ge(_,0,8),Be(new Y(P),y+P.e+1,_);if(!(v=P.c))return null;if(M=((x=v.length-1)-Yt(this.e/ue))*ue,x=v[x])for(;x%10==0;x/=10,M--);return M<0&&(M=0),M},a.dividedBy=a.div=function(y,_){return t(this,new Y(y,_),u,l)},a.dividedToIntegerBy=a.idiv=function(y,_){return t(this,new Y(y,_),0,1)},a.exponentiatedBy=a.pow=function(y,_){var v,M,x,P,N,E,C,L,D,q=this;if(y=new Y(y),y.c&&!y.isInteger())throw Error(Et+"Exponent not an integer: "+ke(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(+ke(q),E?y.s*(2-gs(y)):+ke(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 P=q.s<0&&gs(y)?-0:0,q.e>-1&&(P=1/P),new Y(C?1/P:P);O&&(P=ja(O/ue+2))}for(E?(v=new Y(.5),C&&(y.s=1),L=gs(y)):(x=Math.abs(+ke(y)),L=x%2),D=new Y(c);;){if(L){if(D=D.times(q),!D.c)break;P?D.c.length>P&&(D.c.length=P):M&&(D=D.mod(_))}if(x){if(x=Ht(x/2),x===0)break;L=x%2}else if(y=y.times(v),Be(y,y.e+1,1),y.e>14)L=gs(y);else{if(x=+ke(y),x===0)break;L=x%2}q=q.times(q),P?q.c&&q.c.length>P&&(q.c.length=P):M&&(q=q.mod(_))}return M?D:(C&&(D=c.div(D)),_?D.mod(_):P?Be(D,O,l,N):D)},a.integerValue=function(y){var _=new Y(this);return y==null?y=l:Ge(y,0,8),Be(_,_.e+1,y)},a.isEqualTo=a.eq=function(y,_){return mn(this,new Y(y,_))===0},a.isFinite=function(){return!!this.c},a.isGreaterThan=a.gt=function(y,_){return mn(this,new Y(y,_))>0},a.isGreaterThanOrEqualTo=a.gte=function(y,_){return(_=mn(this,new Y(y,_)))===1||_===0},a.isInteger=function(){return!!this.c&&Yt(this.e/ue)>this.c.length-2},a.isLessThan=a.lt=function(y,_){return mn(this,new Y(y,_))<0},a.isLessThanOrEqualTo=a.lte=function(y,_){return(_=mn(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,x,P,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/ue,L=y.e/ue,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=Yt(C),L=Yt(L),D=D.slice(),E=C-L){for((P=E<0)?(E=-E,x=D):(L=C,x=q),x.reverse(),_=E;_--;x.push(0));x.reverse()}else for(M=(P=(E=D.length)<(_=q.length))?E:_,E=_=0;_<M;_++)if(D[_]!=q[_]){P=D[_]<q[_];break}if(P&&(x=D,D=q,q=x,y.s=-y.s),_=(M=q.length)-(v=D.length),_>0)for(;_--;D[v++]=0);for(_=nr-1;M>E;){if(D[--M]<q[M]){for(v=M;v&&!D[--v];D[v]=_);--D[v],D[M]+=nr}D[M]-=q[M]}for(;D[0]==0;D.splice(0,1),--L);return D[0]?ye(y,D,L):(y.s=l==3?-1:1,y.c=[y.e=0],y)},a.modulo=a.mod=function(y,_){var v,M,x=this;return y=new Y(y,_),!x.c||!y.s||y.c&&!y.c[0]?new Y(NaN):!y.c||x.c&&!x.c[0]?new Y(x):($==9?(M=y.s,y.s=1,v=t(x,y,0,3),y.s=M,v.s*=M):v=t(x,y,0,$),y=x.minus(v.times(y)),!y.c[0]&&$==1&&(y.s=x.s),y)},a.multipliedBy=a.times=function(y,_){var v,M,x,P,N,E,C,L,D,q,X,J,de,Le,Fe,ce=this,Ae=ce.c,st=(y=new Y(y,_)).c;if(!Ae||!st||!Ae[0]||!st[0])return!ce.s||!y.s||Ae&&!Ae[0]&&!st||st&&!st[0]&&!Ae?y.c=y.e=y.s=null:(y.s*=ce.s,!Ae||!st?y.c=y.e=null:(y.c=[0],y.e=0)),y;for(M=Yt(ce.e/ue)+Yt(y.e/ue),y.s*=ce.s,C=Ae.length,q=st.length,C<q&&(de=Ae,Ae=st,st=de,x=C,C=q,q=x),x=C+q,de=[];x--;de.push(0));for(Le=nr,Fe=Jr,x=q;--x>=0;){for(v=0,X=st[x]%Fe,J=st[x]/Fe|0,N=C,P=x+N;P>x;)L=Ae[--N]%Fe,D=Ae[N]/Fe|0,E=J*L+D*X,L=X*L+E%Fe*Fe+de[P]+v,v=(L/Le|0)+(E/Fe|0)+J*D,de[P--]=L%Le;de[P]=v}return v?++M:de.splice(0,1),ye(y,de,M)},a.negated=function(){var y=new Y(this);return y.s=-y.s||null,y},a.plus=function(y,_){var v,M=this,x=M.s;if(y=new Y(y,_),_=y.s,!x||!_)return new Y(NaN);if(x!=_)return y.s=-_,M.minus(y);var P=M.e/ue,N=y.e/ue,E=M.c,C=y.c;if(!P||!N){if(!E||!C)return new Y(x/0);if(!E[0]||!C[0])return C[0]?y:new Y(E[0]?M:x*0)}if(P=Yt(P),N=Yt(N),E=E.slice(),x=P-N){for(x>0?(N=P,v=C):(x=-x,v=E),v.reverse();x--;v.push(0));v.reverse()}for(x=E.length,_=C.length,x-_<0&&(v=C,C=E,E=v,_=x),x=0;_;)x=(E[--_]=E[_]+C[_]+x)/nr|0,E[_]=nr===E[_]?0:E[_]%nr;return x&&(E=[x].concat(E),++N),ye(y,E,N)},a.precision=a.sd=function(y,_){var v,M,x,P=this;if(y!=null&&y!==!!y)return Ge(y,1,it),_==null?_=l:Ge(_,0,8),Be(new Y(P),y,_);if(!(v=P.c))return null;if(x=v.length-1,M=x*ue+1,x=v[x]){for(;x%10==0;x/=10,M--);for(x=v[0];x>=10;x/=10,M++);}return y&&P.e+1>M&&(M=P.e+1),M},a.shiftedBy=function(y){return Ge(y,-Ja,Ja),this.times("1e"+y)},a.squareRoot=a.sqrt=function(){var y,_,v,M,x,P=this,N=P.c,E=P.s,C=P.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?P:1/0);if(E=Math.sqrt(+ke(P)),E==0||E==1/0?(_=Kt(N),(_.length+C)%2==0&&(_+="0"),E=Math.sqrt(+_),C=Yt((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(x=v,v=D.times(x.plus(t(P,x,L,1))),Kt(x.c).slice(0,E)===(_=Kt(v.c)).slice(0,E))if(v.e<C&&--E,_=_.slice(E-3,E+1),_=="9999"||!M&&_=="4999"){if(!M&&(Be(x,x.e+u+2,0),x.times(x).eq(P))){v=x;break}L+=4,E+=4,M=1}else{(!+_||!+_.slice(1)&&_.charAt(0)=="5")&&(Be(v,v.e+u+2,1),y=!v.times(v).eq(P));break}}return Be(v,v.e+u+1,l,y)},a.toExponential=function(y,_){return y!=null&&(Ge(y,0,it),y++),Ee(this,y,_,1)},a.toFixed=function(y,_){return y!=null&&(Ge(y,0,it),y=y+this.e+1),Ee(this,y,_)},a.toFormat=function(y,_,v){var M,x=this;if(v==null)y!=null&&_&&typeof _=="object"?(v=_,_=null):y&&typeof y=="object"?(v=y,y=_=null):v=B;else if(typeof v!="object")throw Error(Et+"Argument not an object: "+v);if(M=x.toFixed(y,_),x.c){var P,N=M.split("."),E=+v.groupSize,C=+v.secondaryGroupSize,L=v.groupSeparator||"",D=N[0],q=N[1],X=x.s<0,J=X?D.slice(1):D,de=J.length;if(C&&(P=E,E=C,C=P,de-=P),E>0&&de>0){for(P=de%E||E,D=J.substr(0,P);P<de;P+=E)D+=L+J.substr(P,E);C>0&&(D+=L+J.slice(P)),X&&(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,x,P,N,E,C,L,D,q,X,J=this,de=J.c;if(y!=null&&(E=new Y(y),!E.isInteger()&&(E.c||E.s!==1)||E.lt(c)))throw Error(Et+"Argument "+(E.isInteger()?"out of range: ":"not an integer: ")+ke(E));if(!de)return new Y(J);for(_=new Y(c),L=v=new Y(c),M=C=new Y(c),X=Kt(de),P=_.e=X.length-J.e-1,_.c[0]=Qa[(N=P%ue)<0?ue+N:N],y=!y||E.comparedTo(_)>0?P>0?_:L:E,N=T,T=1/0,E=new Y(X),C.c[0]=0;D=t(E,_,0,1),x=v.plus(D.times(M)),x.comparedTo(y)!=1;)v=M,M=x,L=C.plus(D.times(x=L)),C=x,_=E.minus(D.times(x=_)),E=x;return x=t(y.minus(v),M,0,1),C=C.plus(x.times(L)),v=v.plus(x.times(M)),C.s=L.s=J.s,P=P*2,q=t(L,M,P,l).minus(J).abs().comparedTo(t(C,v,P,l).minus(J).abs())<1?[L,M]:[C,v],T=N,q},a.toNumber=function(){return+ke(this)},a.toPrecision=function(y,_){return y!=null&&Ge(y,1,it),Ee(this,y,_,2)},a.toString=function(y){var _,v=this,M=v.s,x=v.e;return x===null?M?(_="Infinity",M<0&&(_="-"+_)):_="NaN":(y==null?_=x<=h||x>=m?ys(Kt(v.c),x):Cr(Kt(v.c),x,"0"):y===10&&re?(v=Be(new Y(v),u+x+1,l),_=Cr(Kt(v.c),v.e,"0")):(Ge(y,2,F.length,"Base"),_=n(Cr(Kt(v.c),x,"0"),10,y,M,!0)),M<0&&v.c[0]&&(_="-"+_)),_},a.valueOf=a.toJSON=function(){return ke(this)},a._isBigNumber=!0,a[Symbol.toStringTag]="BigNumber",a[Symbol.for("nodejs.util.inspect.custom")]=a.valueOf,e!=null&&Y.set(e),Y}function Yt(e){var t=e|0;return e>0||e===t?t:t-1}function Kt(e){for(var t,n,s=1,a=e.length,c=e[0]+"";s<a;){for(t=e[s++]+"",n=ue-t.length;n--;t="0"+t);c+=t}for(a=c.length;c.charCodeAt(--a)===48;);return c.slice(0,a+1||1)}function mn(e,t){var n,s,a=e.c,c=t.c,u=e.s,l=t.s,h=e.e,m=t.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 Ge(e,t,n,s){if(e<t||e>n||e!==Ht(e))throw Error(Et+(s||"Argument")+(typeof e=="number"?e<t||e>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function gs(e){var t=e.c.length-1;return Yt(e.e/ue)==t&&e.c[t]%2!=0}function ys(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function Cr(e,t,n){var s,a;if(t<0){for(a=n+".";++t;a+=n);e=a+e}else if(s=e.length,++t>s){for(a=n,t-=s;--t;a+=n);e+=a}else t<s&&(e=e.slice(0,t)+"."+e.slice(t));return e}var et=cl();const gn=new TextEncoder,Za=new TextDecoder,_s=2**32;function wi(...e){const t=e.reduce((a,{length:c})=>a+c,0),n=new Uint8Array(t);let s=0;for(const a of e)n.set(a,s),s+=a.length;return n}function Xa(e,t,n){if(t<0||t>=_s)throw new RangeError(`value must be >= 0 and <= ${_s-1}. Received ${t}`);e.set([t>>>24,t>>>16,t>>>8,t&255],n)}function Zm(e){const t=Math.floor(e/_s),n=e%_s,s=new Uint8Array(8);return Xa(s,t,0),Xa(s,n,4),s}function eo(e){const t=new Uint8Array(4);return Xa(t,e),t}function Xm(e){if(Uint8Array.prototype.toBase64)return e.toBase64();const t=32768,n=[];for(let s=0;s<e.length;s+=t)n.push(String.fromCharCode.apply(null,e.subarray(s,s+t)));return btoa(n.join(""))}function eg(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(e);const t=atob(e),n=new Uint8Array(t.length);for(let s=0;s<t.length;s++)n[s]=t.charCodeAt(s);return n}function ll(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(typeof e=="string"?e:Za.decode(e),{alphabet:"base64url"});let t=e;t instanceof Uint8Array&&(t=Za.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return eg(t)}catch{throw new TypeError("The input to be decoded is not correctly encoded.")}}function qt(e){let t=e;return typeof t=="string"&&(t=gn.encode(t)),Uint8Array.prototype.toBase64?t.toBase64({alphabet:"base64url",omitPadding:!0}):Xm(t).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}class fl extends Error{static code="ERR_JOSE_GENERIC";code="ERR_JOSE_GENERIC";constructor(t,n){super(t,n),this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}}class gt extends fl{static code="ERR_JOSE_NOT_SUPPORTED";code="ERR_JOSE_NOT_SUPPORTED"}class Qr extends fl{static code="ERR_JWE_INVALID";code="ERR_JWE_INVALID"}function hl(e){switch(e){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 gt(`Unsupported JWE Algorithm: ${e}`)}}const tg=e=>crypto.getRandomValues(new Uint8Array(hl(e)>>3)),rg=(e,t)=>{if(t.length<<3!==hl(e))throw new Qr("Invalid Initialization Vector length")},dl=(e,t)=>{const n=e.byteLength<<3;if(n!==t)throw new Qr(`Invalid Content Encryption Key length. Expected ${t} bits, got ${n} bits`)};function Zr(e,t="algorithm.name"){return new TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`)}function ws(e,t){return e.name===t}function ng(e){return parseInt(e.name.slice(4),10)}function ig(e,t){if(t&&!e.usages.includes(t))throw new TypeError(`CryptoKey does not support this operation, its usages must include ${t}.`)}function Mn(e,t,n){switch(t){case"A128GCM":case"A192GCM":case"A256GCM":{if(!ws(e.algorithm,"AES-GCM"))throw Zr("AES-GCM");const s=parseInt(t.slice(1,4),10);if(e.algorithm.length!==s)throw Zr(s,"algorithm.length");break}case"A128KW":case"A192KW":case"A256KW":{if(!ws(e.algorithm,"AES-KW"))throw Zr("AES-KW");const s=parseInt(t.slice(1,4),10);if(e.algorithm.length!==s)throw Zr(s,"algorithm.length");break}case"ECDH":{switch(e.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(!ws(e.algorithm,"PBKDF2"))throw Zr("PBKDF2");break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":{if(!ws(e.algorithm,"RSA-OAEP"))throw Zr("RSA-OAEP");const s=parseInt(t.slice(9),10)||1;if(ng(e.algorithm.hash)!==s)throw Zr(`SHA-${s}`,"algorithm.hash");break}default:throw new TypeError("CryptoKey does not support this operation")}ig(e,n)}function pl(e,t,...n){if(n=n.filter(Boolean),n.length>2){const s=n.pop();e+=`one of type ${n.join(", ")}, or ${s}.`}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!=null&&t.constructor?.name&&(e+=` Received an instance of ${t.constructor.name}`),e}const to=(e,...t)=>pl("Key must be ",e,...t);function ml(e,t,...n){return pl(`Key for the ${e} algorithm must be `,t,...n)}function gl(e){if(!bi(e))throw new Error("CryptoKey instance expected")}function bi(e){return e?.[Symbol.toStringTag]==="CryptoKey"}function ro(e){return e?.[Symbol.toStringTag]==="KeyObject"}const yl=e=>bi(e)||ro(e),sg=(...e)=>{const t=e.filter(Boolean);if(t.length===0||t.length===1)return!0;let n;for(const s of t){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 ag(e){return typeof e=="object"&&e!==null}const _l=e=>{if(!ag(e)||Object.prototype.toString.call(e)!=="[object Object]")return!1;if(Object.getPrototypeOf(e)===null)return!0;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t};function og(e,t){if(e.algorithm.length!==parseInt(t.slice(1,4),10))throw new TypeError(`Invalid key size for alg: ${t}`)}function ug(e,t,n){return e instanceof Uint8Array?crypto.subtle.importKey("raw",e,"AES-KW",!0,[n]):(Mn(e,t,n),e)}async function no(e,t,n){const s=await ug(t,e,"wrapKey");og(s,e);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 cg=async(e,t)=>{const n=`SHA-${e.slice(-3)}`;return new Uint8Array(await crypto.subtle.digest(n,t))};function io(e){return wi(eo(e.length),e)}async function lg(e,t,n){const s=t>>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+e.length+n.length);h.set(eo(l),0),h.set(e,4),h.set(n,4+e.length);const m=await cg("sha256",h);u.set(m,(l-1)*a)}return u.slice(0,s)}async function fg(e,t,n,s,a=new Uint8Array(0),c=new Uint8Array(0)){Mn(e,"ECDH"),Mn(t,"ECDH","deriveBits");const u=io(gn.encode(n)),l=io(a),h=io(c),m=eo(s),b=new Uint8Array(0),T=wi(u,l,h,m,b),R=new Uint8Array(await crypto.subtle.deriveBits({name:e.algorithm.name,public:e},t,hg(e)));return lg(R,s,T)}function hg(e){return e.algorithm.name==="X25519"?256:Math.ceil(parseInt(e.algorithm.namedCurve.slice(-3),10)/8)<<3}function dg(e){switch(e.algorithm.namedCurve){case"P-256":case"P-384":case"P-521":return!0;default:return e.algorithm.name==="X25519"}}function pg(e,t){return e instanceof Uint8Array?crypto.subtle.importKey("raw",e,"PBKDF2",!1,["deriveBits"]):(Mn(e,t,"deriveBits"),e)}const mg=(e,t)=>wi(gn.encode(e),new Uint8Array([0]),t);async function gg(e,t,n,s){if(!(e instanceof Uint8Array)||e.length<8)throw new Qr("PBES2 Salt Input must be 8 or more octets");const a=mg(t,e),c=parseInt(t.slice(13,16),10),u={hash:`SHA-${t.slice(8,11)}`,iterations:n,name:"PBKDF2",salt:a},l=await pg(s,t);return new Uint8Array(await crypto.subtle.deriveBits(u,l,c))}async function yg(e,t,n,s=2048,a=crypto.getRandomValues(new Uint8Array(16))){const c=await gg(a,e,s,t);return{encryptedKey:await no(e.slice(-6),c,n),p2c:s,p2s:qt(a)}}const _g=(e,t)=>{if(e.startsWith("RS")||e.startsWith("PS")){const{modulusLength:n}=t.algorithm;if(typeof n!="number"||n<2048)throw new TypeError(`${e} requires key modulusLength to be 2048 bits or larger`)}},wg=e=>{switch(e){case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":return"RSA-OAEP";default:throw new gt(`alg ${e} is not supported either by JOSE or your javascript runtime`)}};async function bg(e,t,n){return Mn(t,e,"encrypt"),_g(e,t),new Uint8Array(await crypto.subtle.encrypt(wg(e),t,n))}function wl(e){switch(e){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 gt(`Unsupported JWE Algorithm: ${e}`)}}const vi=e=>crypto.getRandomValues(new Uint8Array(wl(e)>>3));function vg(e){let t,n;switch(e.kty){case"AKP":{switch(e.alg){case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":t={name:e.alg},n=e.priv?["sign"]:["verify"];break;default:throw new gt('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}case"RSA":{switch(e.alg){case"PS256":case"PS384":case"PS512":t={name:"RSA-PSS",hash:`SHA-${e.alg.slice(-3)}`},n=e.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":t={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${e.alg.slice(-3)}`},n=e.d?["sign"]:["verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":t={name:"RSA-OAEP",hash:`SHA-${parseInt(e.alg.slice(-3),10)||1}`},n=e.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new gt('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}case"EC":{switch(e.alg){case"ES256":t={name:"ECDSA",namedCurve:"P-256"},n=e.d?["sign"]:["verify"];break;case"ES384":t={name:"ECDSA",namedCurve:"P-384"},n=e.d?["sign"]:["verify"];break;case"ES512":t={name:"ECDSA",namedCurve:"P-521"},n=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:"ECDH",namedCurve:e.crv},n=e.d?["deriveBits"]:[];break;default:throw new gt('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}case"OKP":{switch(e.alg){case"Ed25519":case"EdDSA":t={name:"Ed25519"},n=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:e.crv},n=e.d?["deriveBits"]:[];break;default:throw new gt('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}default:throw new gt('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:t,keyUsages:n}}const bs=async e=>{if(!e.alg)throw new TypeError('"alg" argument is required when "jwk.alg" is not present');const{algorithm:t,keyUsages:n}=vg(e),s={...e};return s.kty!=="AKP"&&delete s.alg,delete s.use,crypto.subtle.importKey("jwk",s,t,e.ext??!(e.d||e.priv),e.key_ops??n)};async function Sg(e,t,n){if(!_l(e))throw new TypeError("JWK must be an object");let s;switch(t??=e.alg,s??=e.ext,e.kty){case"oct":if(typeof e.k!="string"||!e.k)throw new TypeError('missing "k" (Key Value) Parameter value');return ll(e.k);case"RSA":if("oth"in e&&e.oth!==void 0)throw new gt('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');return bs({...e,alg:t,ext:s});case"AKP":{if(typeof e.alg!="string"||!e.alg)throw new TypeError('missing "alg" (Algorithm) Parameter value');if(t!==void 0&&t!==e.alg)throw new TypeError("JWK alg and alg option value mismatch");return bs({...e,ext:s})}case"EC":case"OKP":return bs({...e,alg:t,ext:s});default:throw new gt('Unsupported "kty" (Key Type) Parameter value')}}async function Tg(e,t,n,s,a){if(!(n instanceof Uint8Array))throw new TypeError(to(n,"Uint8Array"));const c=parseInt(e.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,t)),m=wi(a,s,h,Zm(a.length<<3)),b=new Uint8Array((await crypto.subtle.sign("HMAC",l,m)).slice(0,c>>3));return{ciphertext:h,tag:b,iv:s}}async function Eg(e,t,n,s,a){let c;n instanceof Uint8Array?c=await crypto.subtle.importKey("raw",n,"AES-GCM",!1,["encrypt"]):(Mn(n,e,"encrypt"),c=n);const u=new Uint8Array(await crypto.subtle.encrypt({additionalData:a,iv:s,name:"AES-GCM",tagLength:128},c,t)),l=u.slice(-16);return{ciphertext:u.slice(0,-16),tag:l,iv:s}}const bl=async(e,t,n,s,a)=>{if(!bi(n)&&!(n instanceof Uint8Array))throw new TypeError(to(n,"CryptoKey","KeyObject","Uint8Array","JSON Web Key"));switch(s?rg(e,s):s=tg(e),e){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return n instanceof Uint8Array&&dl(n,parseInt(e.slice(-3),10)),Tg(e,t,n,s,a);case"A128GCM":case"A192GCM":case"A256GCM":return n instanceof Uint8Array&&dl(n,parseInt(e.slice(1,4),10)),Eg(e,t,n,s,a);default:throw new gt("Unsupported JWE Content Encryption Algorithm")}};async function Ag(e,t,n,s){const a=e.slice(0,7),c=await bl(a,n,t,s,new Uint8Array(0));return{encryptedKey:c.ciphertext,iv:qt(c.iv),tag:qt(c.tag)}}const Og=(e,t,n,s,a)=>{if(a.crit!==void 0&&s?.crit===void 0)throw new e('"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 e('"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),...t.entries()]):c=t;for(const u of s.crit){if(!c.has(u))throw new gt(`Extension Header Parameter "${u}" is not recognized`);if(a[u]===void 0)throw new e(`Extension Header Parameter "${u}" is missing`);if(c.get(u)&&s[u]===void 0)throw new e(`Extension Header Parameter "${u}" MUST be integrity protected`)}return new Set(s.crit)};function so(e){return _l(e)&&typeof e.kty=="string"}function xg(e){return e.kty!=="oct"&&(e.kty==="AKP"&&typeof e.priv=="string"||typeof e.d=="string")}function Cg(e){return e.kty!=="oct"&&typeof e.d>"u"&&typeof e.priv>"u"}function kg(e){return e.kty==="oct"&&typeof e.k=="string"}let Ln;const vl=async(e,t,n,s=!1)=>{Ln||=new WeakMap;let a=Ln.get(e);if(a?.[n])return a[n];const c=await bs({...t,alg:n});return s&&Object.freeze(e),a?a[n]=c:Ln.set(e,{[n]:c}),c},Rg=(e,t)=>{Ln||=new WeakMap;let n=Ln.get(e);if(n?.[t])return n[t];const s=e.type==="public",a=!!s;let c;if(e.asymmetricKeyType==="x25519"){switch(t){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=e.toCryptoKey(e.asymmetricKeyType,a,s?[]:["deriveBits"])}if(e.asymmetricKeyType==="ed25519"){if(t!=="EdDSA"&&t!=="Ed25519")throw new TypeError("given KeyObject instance cannot be used for this algorithm");c=e.toCryptoKey(e.asymmetricKeyType,a,[s?"verify":"sign"])}switch(e.asymmetricKeyType){case"ml-dsa-44":case"ml-dsa-65":case"ml-dsa-87":{if(t!==e.asymmetricKeyType.toUpperCase())throw new TypeError("given KeyObject instance cannot be used for this algorithm");c=e.toCryptoKey(e.asymmetricKeyType,a,[s?"verify":"sign"])}}if(e.asymmetricKeyType==="rsa"){let u;switch(t){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(t.startsWith("RSA-OAEP"))return e.toCryptoKey({name:"RSA-OAEP",hash:u},a,s?["encrypt"]:["decrypt"]);c=e.toCryptoKey({name:t.startsWith("PS")?"RSA-PSS":"RSASSA-PKCS1-v1_5",hash:u},a,[s?"verify":"sign"])}if(e.asymmetricKeyType==="ec"){const l=new Map([["prime256v1","P-256"],["secp384r1","P-384"],["secp521r1","P-521"]]).get(e.asymmetricKeyDetails?.namedCurve);if(!l)throw new TypeError("given KeyObject instance cannot be used for this algorithm");t==="ES256"&&l==="P-256"&&(c=e.toCryptoKey({name:"ECDSA",namedCurve:l},a,[s?"verify":"sign"])),t==="ES384"&&l==="P-384"&&(c=e.toCryptoKey({name:"ECDSA",namedCurve:l},a,[s?"verify":"sign"])),t==="ES512"&&l==="P-521"&&(c=e.toCryptoKey({name:"ECDSA",namedCurve:l},a,[s?"verify":"sign"])),t.startsWith("ECDH-ES")&&(c=e.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[t]=c:Ln.set(e,{[t]:c}),c},Sl=async(e,t)=>{if(e instanceof Uint8Array||bi(e))return e;if(ro(e)){if(e.type==="secret")return e.export();if("toCryptoKey"in e&&typeof e.toCryptoKey=="function")try{return Rg(e,t)}catch(s){if(s instanceof TypeError)throw s}let n=e.export({format:"jwk"});return vl(e,n,t)}if(so(e))return e.k?ll(e.k):vl(e,e,t,!0);throw new Error("unreachable")},Nn=e=>e?.[Symbol.toStringTag],ao=(e,t,n)=>{if(t.use!==void 0){let s;switch(n){case"sign":case"verify":s="sig";break;case"encrypt":case"decrypt":s="enc";break}if(t.use!==s)throw new TypeError(`Invalid key for this operation, its "use" must be "${s}" when present`)}if(t.alg!==void 0&&t.alg!==e)throw new TypeError(`Invalid key for this operation, its "alg" must be "${e}" when present`);if(Array.isArray(t.key_ops)){let s;switch(!0){case n==="verify":case e==="dir":case e.includes("CBC-HS"):s=n;break;case e.startsWith("PBES2"):s="deriveBits";break;case/^A\d{3}(?:GCM)?(?:KW)?$/.test(e):!e.includes("GCM")&&e.endsWith("KW")?s="wrapKey":s=n;break;case e.startsWith("RSA"):s="wrapKey";break;case n==="decrypt":s=e.startsWith("RSA")?"unwrapKey":"deriveBits";break}if(s&&t.key_ops?.includes?.(s)===!1)throw new TypeError(`Invalid key for this operation, its "key_ops" must include "${s}" when present`)}return!0},Pg=(e,t,n)=>{if(!(t instanceof Uint8Array)){if(so(t)){if(kg(t)&&ao(e,t,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(!yl(t))throw new TypeError(ml(e,t,"CryptoKey","KeyObject","JSON Web Key","Uint8Array"));if(t.type!=="secret")throw new TypeError(`${Nn(t)} instances for symmetric algorithms must be of type "secret"`)}},Dg=(e,t,n)=>{if(so(t))switch(n){case"decrypt":case"sign":if(xg(t)&&ao(e,t,n))return;throw new TypeError("JSON Web Key for this operation be a private JWK");case"encrypt":case"verify":if(Cg(t)&&ao(e,t,n))return;throw new TypeError("JSON Web Key for this operation be a public JWK")}if(!yl(t))throw new TypeError(ml(e,t,"CryptoKey","KeyObject","JSON Web Key"));if(t.type==="secret")throw new TypeError(`${Nn(t)} instances for asymmetric algorithms must not be of type "secret"`);if(t.type==="public")switch(n){case"sign":throw new TypeError(`${Nn(t)} instances for asymmetric algorithm signing must be of type "private"`);case"decrypt":throw new TypeError(`${Nn(t)} instances for asymmetric algorithm decryption must be of type "private"`)}if(t.type==="private")switch(n){case"verify":throw new TypeError(`${Nn(t)} instances for asymmetric algorithm verifying must be of type "public"`);case"encrypt":throw new TypeError(`${Nn(t)} instances for asymmetric algorithm encryption must be of type "public"`)}},Mg=(e,t,n)=>{e.startsWith("HS")||e==="dir"||e.startsWith("PBES2")||/^A(?:128|192|256)(?:GCM)?(?:KW)?$/.test(e)||/^A(?:128|192|256)CBC-HS(?:256|384|512)$/.test(e)?Pg(e,t,n):Dg(e,t,n)},Lg=Symbol();async function Ng(e){if(ro(e))if(e.type==="secret")e=e.export();else return e.export({format:"jwk"});if(e instanceof Uint8Array)return{kty:"oct",k:qt(e)};if(!bi(e))throw new TypeError(to(e,"CryptoKey","KeyObject","Uint8Array"));if(!e.extractable)throw new TypeError("non-extractable CryptoKey cannot be exported as a JWK");const{ext:t,key_ops:n,alg:s,use:a,...c}=await crypto.subtle.exportKey("jwk",e);return c.kty==="AKP"&&(c.alg=s),c}async function Ug(e){return Ng(e)}const Ig=async(e,t,n,s,a={})=>{let c,u,l;switch(e){case"dir":{l=n;break}case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{if(gl(n),!dg(n))throw new gt("ECDH with the provided key is not allowed or not supported by your javascript runtime");const{apu:h,apv:m}=a;let b;a.epk?b=await Sl(a.epk,e):b=(await crypto.subtle.generateKey(n.algorithm,!0,["deriveBits"])).privateKey;const{x:T,y:R,crv:$,kty:O}=await Ug(b),B=await fg(n,b,e==="ECDH-ES"?t:e,e==="ECDH-ES"?wl(t):parseInt(e.slice(-5,-2),10),h,m);if(u={epk:{x:T,crv:$,kty:O}},O==="EC"&&(u.epk.y=R),h&&(u.apu=qt(h)),m&&(u.apv=qt(m)),e==="ECDH-ES"){l=B;break}l=s||vi(t);const F=e.slice(-6);c=await no(F,B,l);break}case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":{l=s||vi(t),gl(n),c=await bg(e,n,l);break}case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":{l=s||vi(t);const{p2c:h,p2s:m}=a;({encryptedKey:c,...u}=await yg(e,n,l,h,m));break}case"A128KW":case"A192KW":case"A256KW":{l=s||vi(t),c=await no(e,n,l);break}case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":{l=s||vi(t);const{iv:h}=a;({encryptedKey:c,...u}=await Ag(e,n,l,h));break}default:throw new gt('Invalid or unsupported "alg" (JWE Algorithm) header value')}return{cek:l,encryptedKey:c,parameters:u}};class Bg{#r;#e;#n;#t;#s;#i;#a;#o;constructor(t){if(!(t instanceof Uint8Array))throw new TypeError("plaintext must be an instance of Uint8Array");this.#r=t}setKeyManagementParameters(t){if(this.#o)throw new TypeError("setKeyManagementParameters can only be called once");return this.#o=t,this}setProtectedHeader(t){if(this.#e)throw new TypeError("setProtectedHeader can only be called once");return this.#e=t,this}setSharedUnprotectedHeader(t){if(this.#n)throw new TypeError("setSharedUnprotectedHeader can only be called once");return this.#n=t,this}setUnprotectedHeader(t){if(this.#t)throw new TypeError("setUnprotectedHeader can only be called once");return this.#t=t,this}setAdditionalAuthenticatedData(t){return this.#s=t,this}setContentEncryptionKey(t){if(this.#i)throw new TypeError("setContentEncryptionKey can only be called once");return this.#i=t,this}setInitializationVector(t){if(this.#a)throw new TypeError("setInitializationVector can only be called once");return this.#a=t,this}async encrypt(t,n){if(!this.#e&&!this.#t&&!this.#n)throw new Qr("either setProtectedHeader, setUnprotectedHeader, or sharedUnprotectedHeader must be called before #encrypt()");if(!sg(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(Og(Qr,new Map,n?.crit,this.#e,s),s.zip!==void 0)throw new gt('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}`);Mg(a==="dir"?c:a,t,"encrypt");let l;{let B;const F=await Sl(t,a);({cek:l,encryptedKey:u,parameters:B}=await Ig(a,c,F,this.#i,this.#o)),B&&(n&&Lg in n?this.#t?this.#t={...this.#t,...B}:this.setUnprotectedHeader(B):this.#e?this.#e={...this.#e,...B}:this.setProtectedHeader(B))}let h,m,b;this.#e?m=gn.encode(qt(JSON.stringify(this.#e))):m=gn.encode(""),this.#s?(b=qt(this.#s),h=wi(m,gn.encode("."),gn.encode(b))):h=m;const{ciphertext:T,tag:R,iv:$}=await bl(c,this.#r,l,this.#a,h),O={ciphertext:qt(T)};return $&&(O.iv=qt($)),R&&(O.tag=qt(R)),u&&(O.encrypted_key=qt(u)),b&&(O.aad=b),this.#e&&(O.protected=Za.decode(m)),this.#n&&(O.unprotected=this.#n),this.#t&&(O.header=this.#t),O}}class Fg{#r;constructor(t){this.#r=new Bg(t)}setContentEncryptionKey(t){return this.#r.setContentEncryptionKey(t),this}setInitializationVector(t){return this.#r.setInitializationVector(t),this}setProtectedHeader(t){return this.#r.setProtectedHeader(t),this}setKeyManagementParameters(t){return this.#r.setKeyManagementParameters(t),this}async encrypt(t,n){const s=await this.#r.encrypt(t,n);return[s.protected,s.encrypted_key,s.iv,s.ciphertext,s.tag].join(".")}}let yr;yr={jwkToPublicKey:async e=>await Sg(e,"RSA-OAEP"),encryptPayload:async(e,t)=>{const n=new TextEncoder().encode(e);return await new Fg(n).setProtectedHeader({alg:"RSA-OAEP",enc:"A256GCM"}).encrypt(t)}},yr.createJWT=async(e,t=void 0)=>{const n=Yo(JSON.stringify(e));let s,a="";if(t){a=Yo(JSON.stringify({typ:"JWT",kid:Kw(t),alg:"HS256"}));const c=[a,n].join(".");s=Tf(c,t,"base64url")}else a=Yo(JSON.stringify({typ:"JWT",alg:"none"}));return[a,n,s].join(".")},yr.parseJWT=e=>{const[t,n,s]=e.split("."),a=JSON.parse(Ko(t)),c=JSON.parse(Ko(n));return{header:a,body:c,signature:s}};//! moment.js
|
|
33
|
+
}`;var ge=Rp(function(){return Pe(g,re+"return "+G).apply(n,w)});if(ge.source=G,Ec(ge))throw ge;return ge}function pO(r){return De(r).toLowerCase()}function mO(r){return De(r).toUpperCase()}function gO(r,i,o){if(r=De(r),r&&(o||i===n))return Fh(r);if(!r||!(i=It(i)))return r;var f=fr(r),d=fr(i),g=Wh(f,d),w=Hh(f,d)+1;return fn(f,g,w).join("")}function yO(r,i,o){if(r=De(r),r&&(o||i===n))return r.slice(0,Kh(r)+1);if(!r||!(i=It(i)))return r;var f=fr(r),d=Hh(f,fr(i))+1;return fn(f,0,d).join("")}function _O(r,i,o){if(r=De(r),r&&(o||i===n))return r.replace(Eu,"");if(!r||!(i=It(i)))return r;var f=fr(r),d=Wh(f,fr(i));return fn(f,d).join("")}function wO(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=De(r);var g=r.length;if(Xn(r)){var w=fr(r);g=w.length}if(o>=g)return r;var S=o-ei(f);if(S<1)return f;var x=w?fn(w,0,S).join(""):r.slice(0,S);if(d===n)return x+f;if(w&&(S+=x.length-S),Tc(d)){if(r.slice(S).search(d)){var H,K=x;for(d.global||(d=Wu(d.source,De(oh.exec(d))+"g")),d.lastIndex=0;H=d.exec(K);)var G=H.index;x=x.slice(0,G===n?S:G)}}else if(r.indexOf(It(d),S)!=S){var j=x.lastIndexOf(d);j>-1&&(x=x.slice(0,j))}return x+f}function bO(r){return r=De(r),r&&P1.test(r)?r.replace(ih,jb):r}var vO=oi(function(r,i,o){return r+(o?" ":"")+i.toUpperCase()}),Cc=Pd("toUpperCase");function xp(r,i,o){return r=De(r),i=o?n:i,i===n?qb(r)?Zb(r):Nb(r):r.match(i)||[]}var Rp=ye(function(r,i){try{return Ut(r,n,i)}catch(o){return Ec(o)?o:new ue(o)}}),SO=$r(function(r,i){return Qt(i,function(o){o=Cr(o),Kr(r,o,vc(r[o],r))}),r});function EO(r){var i=r==null?0:r.length,o=se();return r=i?Ve(r,function(f){if(typeof f[1]!="function")throw new Zt(u);return[o(f[0]),f[1]]}):[],ye(function(f){for(var d=-1;++d<i;){var g=r[d];if(Ut(g[0],this,f))return Ut(g[1],this,f)}})}function TO(r){return jv(er(r,E))}function kc(r){return function(){return r}}function AO(r,i){return r==null||r!==r?i:r}var OO=Md(),CO=Md(!0);function Mt(r){return r}function xc(r){return cd(typeof r=="function"?r:er(r,E))}function kO(r){return fd(er(r,E))}function xO(r,i){return hd(r,er(i,E))}var RO=ye(function(r,i){return function(o){return Qi(o,r,i)}}),PO=ye(function(r,i){return function(o){return Qi(r,o,i)}});function Rc(r,i,o){var f=ot(i),d=Ea(i,f);o==null&&!(je(i)&&(d.length||!f.length))&&(o=i,i=r,r=this,d=Ea(i,ot(i)));var g=!(je(o)&&"chain"in o)||!!o.chain,w=Vr(r);return Qt(d,function(S){var x=i[S];r[S]=x,w&&(r.prototype[S]=function(){var H=this.__chain__;if(g||H){var K=r(this.__wrapped__),G=K.__actions__=Rt(this.__actions__);return G.push({func:x,args:arguments,thisArg:r}),K.__chain__=H,K}return x.apply(r,sn([this.value()],arguments))})}),r}function DO(){return ft._===this&&(ft._=iv),this}function Pc(){}function MO(r){return r=me(r),ye(function(i){return dd(i,r)})}var LO=uc(Ve),NO=uc(Lh),UO=uc(Mu);function Pp(r){return mc(r)?Lu(Cr(r)):hS(r)}function BO(r){return function(i){return r==null?n:Rn(r,i)}}var IO=Nd(),FO=Nd(!0);function Dc(){return[]}function Mc(){return!1}function WO(){return{}}function HO(){return""}function YO(){return!0}function KO(r,i){if(r=me(r),r<1||r>D)return[];var o=J,f=mt(r,J);i=se(i),r-=J;for(var d=Bu(f,i);++o<r;)i(o);return d}function qO(r){return fe(r)?Ve(r,Cr):Ft(r)?[r]:Rt(Qd(De(r)))}function $O(r){var i=++rv;return De(r)+i}var GO=xa(function(r,i){return r+i},0),VO=cc("ceil"),zO=xa(function(r,i){return r/i},1),jO=cc("floor");function JO(r){return r&&r.length?Sa(r,Mt,zu):n}function QO(r,i){return r&&r.length?Sa(r,se(i,2),zu):n}function ZO(r){return Bh(r,Mt)}function XO(r,i){return Bh(r,se(i,2))}function eC(r){return r&&r.length?Sa(r,Mt,Zu):n}function tC(r,i){return r&&r.length?Sa(r,se(i,2),Zu):n}var rC=xa(function(r,i){return r*i},1),nC=cc("round"),iC=xa(function(r,i){return r-i},0);function sC(r){return r&&r.length?Uu(r,Mt):0}function aC(r,i){return r&&r.length?Uu(r,se(i,2)):0}return p.after=kT,p.ary=up,p.assign=mA,p.assignIn=Sp,p.assignInWith=Ya,p.assignWith=gA,p.at=yA,p.before=cp,p.bind=vc,p.bindAll=SO,p.bindKey=lp,p.castArray=WT,p.chain=sp,p.chunk=jS,p.compact=JS,p.concat=QS,p.cond=EO,p.conforms=TO,p.constant=kc,p.countBy=sT,p.create=_A,p.curry=fp,p.curryRight=hp,p.debounce=dp,p.defaults=wA,p.defaultsDeep=bA,p.defer=xT,p.delay=RT,p.difference=ZS,p.differenceBy=XS,p.differenceWith=eE,p.drop=tE,p.dropRight=rE,p.dropRightWhile=nE,p.dropWhile=iE,p.fill=sE,p.filter=oT,p.flatMap=lT,p.flatMapDeep=fT,p.flatMapDepth=hT,p.flatten=tp,p.flattenDeep=aE,p.flattenDepth=oE,p.flip=PT,p.flow=OO,p.flowRight=CO,p.fromPairs=uE,p.functions=CA,p.functionsIn=kA,p.groupBy=dT,p.initial=lE,p.intersection=fE,p.intersectionBy=hE,p.intersectionWith=dE,p.invert=RA,p.invertBy=PA,p.invokeMap=mT,p.iteratee=xc,p.keyBy=gT,p.keys=ot,p.keysIn=Dt,p.map=Ua,p.mapKeys=MA,p.mapValues=LA,p.matches=kO,p.matchesProperty=xO,p.memoize=Ia,p.merge=NA,p.mergeWith=Ep,p.method=RO,p.methodOf=PO,p.mixin=Rc,p.negate=Fa,p.nthArg=MO,p.omit=UA,p.omitBy=BA,p.once=DT,p.orderBy=yT,p.over=LO,p.overArgs=MT,p.overEvery=NO,p.overSome=UO,p.partial=Sc,p.partialRight=pp,p.partition=_T,p.pick=IA,p.pickBy=Tp,p.property=Pp,p.propertyOf=BO,p.pull=yE,p.pullAll=np,p.pullAllBy=_E,p.pullAllWith=wE,p.pullAt=bE,p.range=IO,p.rangeRight=FO,p.rearg=LT,p.reject=vT,p.remove=vE,p.rest=NT,p.reverse=wc,p.sampleSize=ET,p.set=WA,p.setWith=HA,p.shuffle=TT,p.slice=SE,p.sortBy=CT,p.sortedUniq=xE,p.sortedUniqBy=RE,p.split=lO,p.spread=UT,p.tail=PE,p.take=DE,p.takeRight=ME,p.takeRightWhile=LE,p.takeWhile=NE,p.tap=JE,p.throttle=BT,p.thru=Na,p.toArray=wp,p.toPairs=Ap,p.toPairsIn=Op,p.toPath=qO,p.toPlainObject=vp,p.transform=YA,p.unary=IT,p.union=UE,p.unionBy=BE,p.unionWith=IE,p.uniq=FE,p.uniqBy=WE,p.uniqWith=HE,p.unset=KA,p.unzip=bc,p.unzipWith=ip,p.update=qA,p.updateWith=$A,p.values=li,p.valuesIn=GA,p.without=YE,p.words=xp,p.wrap=FT,p.xor=KE,p.xorBy=qE,p.xorWith=$E,p.zip=GE,p.zipObject=VE,p.zipObjectDeep=zE,p.zipWith=jE,p.entries=Ap,p.entriesIn=Op,p.extend=Sp,p.extendWith=Ya,Rc(p,p),p.add=GO,p.attempt=Rp,p.camelCase=JA,p.capitalize=Cp,p.ceil=VO,p.clamp=VA,p.clone=HT,p.cloneDeep=KT,p.cloneDeepWith=qT,p.cloneWith=YT,p.conformsTo=$T,p.deburr=kp,p.defaultTo=AO,p.divide=zO,p.endsWith=QA,p.eq=dr,p.escape=ZA,p.escapeRegExp=XA,p.every=aT,p.find=uT,p.findIndex=Xd,p.findKey=vA,p.findLast=cT,p.findLastIndex=ep,p.findLastKey=SA,p.floor=jO,p.forEach=ap,p.forEachRight=op,p.forIn=EA,p.forInRight=TA,p.forOwn=AA,p.forOwnRight=OA,p.get=Ac,p.gt=GT,p.gte=VT,p.has=xA,p.hasIn=Oc,p.head=rp,p.identity=Mt,p.includes=pT,p.indexOf=cE,p.inRange=zA,p.invoke=DA,p.isArguments=Mn,p.isArray=fe,p.isArrayBuffer=zT,p.isArrayLike=Pt,p.isArrayLikeObject=et,p.isBoolean=jT,p.isBuffer=hn,p.isDate=JT,p.isElement=QT,p.isEmpty=ZT,p.isEqual=XT,p.isEqualWith=eA,p.isError=Ec,p.isFinite=tA,p.isFunction=Vr,p.isInteger=mp,p.isLength=Wa,p.isMap=gp,p.isMatch=rA,p.isMatchWith=nA,p.isNaN=iA,p.isNative=sA,p.isNil=oA,p.isNull=aA,p.isNumber=yp,p.isObject=je,p.isObjectLike=Je,p.isPlainObject=ns,p.isRegExp=Tc,p.isSafeInteger=uA,p.isSet=_p,p.isString=Ha,p.isSymbol=Ft,p.isTypedArray=ci,p.isUndefined=cA,p.isWeakMap=lA,p.isWeakSet=fA,p.join=pE,p.kebabCase=eO,p.last=rr,p.lastIndexOf=mE,p.lowerCase=tO,p.lowerFirst=rO,p.lt=hA,p.lte=dA,p.max=JO,p.maxBy=QO,p.mean=ZO,p.meanBy=XO,p.min=eC,p.minBy=tC,p.stubArray=Dc,p.stubFalse=Mc,p.stubObject=WO,p.stubString=HO,p.stubTrue=YO,p.multiply=rC,p.nth=gE,p.noConflict=DO,p.noop=Pc,p.now=Ba,p.pad=nO,p.padEnd=iO,p.padStart=sO,p.parseInt=aO,p.random=jA,p.reduce=wT,p.reduceRight=bT,p.repeat=oO,p.replace=uO,p.result=FA,p.round=nC,p.runInContext=A,p.sample=ST,p.size=AT,p.snakeCase=cO,p.some=OT,p.sortedIndex=EE,p.sortedIndexBy=TE,p.sortedIndexOf=AE,p.sortedLastIndex=OE,p.sortedLastIndexBy=CE,p.sortedLastIndexOf=kE,p.startCase=fO,p.startsWith=hO,p.subtract=iC,p.sum=sC,p.sumBy=aC,p.template=dO,p.times=KO,p.toFinite=zr,p.toInteger=me,p.toLength=bp,p.toLower=pO,p.toNumber=nr,p.toSafeInteger=pA,p.toString=De,p.toUpper=mO,p.trim=gO,p.trimEnd=yO,p.trimStart=_O,p.truncate=wO,p.unescape=bO,p.uniqueId=$O,p.upperCase=vO,p.upperFirst=Cc,p.each=ap,p.eachRight=op,p.first=rp,Rc(p,(function(){var r={};return Ar(p,function(i,o){Me.call(p.prototype,o)||(r[o]=i)}),r})(),{chain:!1}),p.VERSION=s,Qt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(r){p[r].placeholder=p}),Qt(["drop","take"],function(r,i){ve.prototype[r]=function(o){o=o===n?1:it(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==k;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 Qi(o,r,i)})}),ve.prototype.reject=function(r){return this.filter(Fa(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 w=this.__wrapped__,S=f?[1]:arguments,x=w instanceof ve,H=S[0],K=x||fe(w),G=function(we){var Ee=d.apply(p,sn([we],S));return f&&j?Ee[0]:Ee};K&&o&&typeof H=="function"&&H.length!=1&&(x=K=!1);var j=this.__chain__,re=!!this.__actions__.length,ae=g&&!j,ge=x&&!re;if(!g&&K){w=ge?w:new ve(this);var oe=r.apply(w,S);return oe.__actions__.push({func:Na,args:[G],thisArg:n}),new Xt(oe,j)}return ae&&ge?r.apply(this,S):(oe=this.thru(G),ae?f?oe.value()[0]:oe.value():oe)})}),Qt(["pop","push","shift","sort","splice","unshift"],function(r){var i=oa[r],o=/^(?:push|sort|unshift)$/.test(r)?"tap":"thru",f=/^(?:pop|shift)$/.test(r);p.prototype[r]=function(){var d=arguments;if(f&&!this.__chain__){var g=this.value();return i.apply(fe(g)?g:[],d)}return this[o](function(w){return i.apply(fe(w)?w:[],d)})}}),Ar(ve.prototype,function(r,i){var o=p[i];if(o){var f=o.name+"";Me.call(ii,f)||(ii[f]=[]),ii[f].push({name:i,func:o})}}),ii[ka(n,ne).name]=[{name:"wrapper",func:n}],ve.prototype.clone=bv,ve.prototype.reverse=vv,ve.prototype.value=Sv,p.prototype.at=QE,p.prototype.chain=ZE,p.prototype.commit=XE,p.prototype.next=eT,p.prototype.plant=rT,p.prototype.reverse=nT,p.prototype.toJSON=p.prototype.valueOf=p.prototype.value=iT,p.prototype.first=p.prototype.head,qi&&(p.prototype[qi]=tT),p}),ti=Xb();An?((An.exports=ti)._=ti,xu._=ti):ft._=ti}).call(lg)})(wi,wi.exports)),wi.exports}var ro=fg();const ut=bl(ro);var hg=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,no=Math.ceil,Yt=Math.floor,Ot="[BigNumber Error] ",Sl=Ot+"Number primitive has more than 15 significant digits: ",sr=1e14,ce=14,io=9007199254740991,so=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],Jr=1e7,st=1e9;function El(e){var t,n,s,a=Y.prototype={constructor:Y,toString:null,valueOf:null},c=new Y(1),u=20,l=4,h=-7,m=21,b=-1e7,E=1e7,R=!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,C,P,N,T,k,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>E?D.c=D.e=null:y.e<b?D.c=[D.e=0]:(D.e=y.e,D.c=y.c.slice());return}if((T=typeof y=="number")&&y*0==0){if(D.s=1/y<0?(y=-y,-1):1,y===~~y){for(P=0,N=y;N>=10;N/=10,P++);P>E?D.c=D.e=null:(D.e=P,D.c=[y]);return}L=String(y)}else{if(!hg.test(L=String(y)))return s(D,L,T);D.s=L.charCodeAt(0)==45?(L=L.slice(1),-1):1}(P=L.indexOf("."))>-1&&(L=L.replace(".","")),(N=L.search(/e/i))>0?(P<0&&(P=N),P+=+L.slice(N+1),L=L.substring(0,N)):P<0&&(P=L.length)}else{if(ze(_,2,F.length,"Base"),_==10&&ne)return D=new Y(y),Fe(D,u+D.e+1,l);if(L=String(y),T=typeof y=="number"){if(y*0!=0)return s(D,L,T,_);if(D.s=1/y<0?(L=L.slice(1),-1):1,Y.DEBUG&&L.replace(/^0\.0*|\./,"").length>15)throw Error(Sl+y)}else D.s=L.charCodeAt(0)===45?(L=L.slice(1),-1):1;for(v=F.slice(0,_),P=N=0,k=L.length;N<k;N++)if(v.indexOf(M=L.charAt(N))<0){if(M=="."){if(N>P){P=k;continue}}else if(!C&&(L==L.toUpperCase()&&(L=L.toLowerCase())||L==L.toLowerCase()&&(L=L.toUpperCase()))){C=!0,N=-1,P=0;continue}return s(D,String(y),T,_)}T=!1,L=n(L,_,10,D.s),(P=L.indexOf("."))>-1?L=L.replace(".",""):P=L.length}for(N=0;L.charCodeAt(N)===48;N++);for(k=L.length;L.charCodeAt(--k)===48;);if(L=L.slice(N,++k)){if(k-=N,T&&Y.DEBUG&&k>15&&(y>io||y!==Yt(y)))throw Error(Sl+D.s*y);if((P=P-N-1)>E)D.c=D.e=null;else if(P<b)D.c=[D.e=0];else{if(D.e=P,D.c=[],N=(P+1)%ce,P<0&&(N+=ce),N<k){for(N&&D.c.push(+L.slice(0,N)),k-=ce;N<k;)D.c.push(+L.slice(N,N+=ce));N=ce-(L=L.slice(N)).length}else N-=k;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,st,_),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],-st,0,_),ze(v[1],0,st,_),h=v[0],m=v[1]):(ze(v,-st,st,_),h=-(m=v<0?-v:v))),y.hasOwnProperty(_="RANGE"))if(v=y[_],v&&v.pop)ze(v[0],-st,-1,_),ze(v[1],1,st,_),b=v[0],E=v[1];else if(ze(v,-st,st,_),v)b=-(E=v<0?-v:v);else throw Error(Ot+_+" cannot be zero: "+v);if(y.hasOwnProperty(_="CRYPTO"))if(v=y[_],v===!!v)if(v)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))R=v;else throw R=!v,Error(Ot+"crypto unavailable");else R=v;else throw Error(Ot+_+" 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,st,_),O=v),y.hasOwnProperty(_="FORMAT"))if(v=y[_],typeof v=="object")I=v;else throw Error(Ot+_+" 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(Ot+_+" invalid: "+v)}else throw Error(Ot+"Object expected: "+y);return{DECIMAL_PLACES:u,ROUNDING_MODE:l,EXPONENTIAL_AT:[h,m],RANGE:[b,E],CRYPTO:R,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,C=y.e,P=y.s;e:if({}.toString.call(M)=="[object Array]"){if((P===1||P===-1)&&C>=-st&&C<=st&&C===Yt(C)){if(M[0]===0){if(C===0&&M.length===1)return!0;break e}if(_=(C+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&&C===null&&(P===null||P===1||P===-1))return!0;throw Error(Ot+"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,C,P,N,T,k=0,L=[],D=new Y(c);if(v==null?v=u:ze(v,0,st),N=no(v/ce),R)if(crypto.getRandomValues){for(M=crypto.getRandomValues(new Uint32Array(N*=2));k<N;)T=M[k]*131072+(M[k+1]>>>11),T>=9e15?(C=crypto.getRandomValues(new Uint32Array(2)),M[k]=C[0],M[k+1]=C[1]):(L.push(T%1e14),k+=2);k=N/2}else if(crypto.randomBytes){for(M=crypto.randomBytes(N*=7);k<N;)T=(M[k]&31)*281474976710656+M[k+1]*1099511627776+M[k+2]*4294967296+M[k+3]*16777216+(M[k+4]<<16)+(M[k+5]<<8)+M[k+6],T>=9e15?crypto.randomBytes(7).copy(M,k):(L.push(T%1e14),k+=7);k=N/7}else throw R=!1,Error(Ot+"crypto unavailable");if(!R)for(;k<N;)T=_(),T<9e15&&(L[k++]=T%1e14);for(N=L[--k],v%=ce,N&&v&&(T=so[ce-v],L[k]=Yt(N/T)*T);L[k]===0;L.pop(),k--);if(k<0)L=[P=0];else{for(P=-1;L[0]===0;L.splice(0,1),P-=ce);for(k=1,T=L[0];T>=10;T/=10,k++);k<ce&&(P-=ce-k)}return D.e=P,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,C,P){for(var N,T=[0],k,L=0,D=v.length;L<D;){for(k=T.length;k--;T[k]*=M);for(T[0]+=P.indexOf(v.charAt(L++)),N=0;N<T.length;N++)T[N]>C-1&&(T[N+1]==null&&(T[N+1]=0),T[N+1]+=T[N]/C|0,T[N]%=C)}return T.reverse()}return function(v,M,C,P,N){var T,k,L,D,q,te,J,pe,Ne=v.indexOf("."),We=u,le=l;for(Ne>=0&&(D=O,O=0,v=v.replace(".",""),pe=new Y(M),te=pe.pow(v.length-Ne),O=D,pe.c=_(xr(qt(te.c),te.e,"0"),10,C,y),pe.e=pe.c.length),J=_(v,M,C,N?(T=F,y):(T=y,F)),L=D=J.length;J[--D]==0;J.pop());if(!J[0])return T.charAt(0);if(Ne<0?--L:(te.c=J,te.e=L,te.s=P,te=t(te,pe,We,le,C),J=te.c,q=te.r,L=te.e),k=L+We+1,Ne=J[k],D=C/2,q=q||k<0||J[k+1]!=null,q=le<4?(Ne!=null||q)&&(le==0||le==(te.s<0?3:2)):Ne>D||Ne==D&&(le==4||q||le==6&&J[k-1]&1||le==(te.s<0?8:7)),k<1||!J[0])v=q?xr(T.charAt(1),-We,T.charAt(0)):T.charAt(0);else{if(J.length=k,q)for(--C;++J[--k]>C;)J[k]=0,k||(++L,J=[1].concat(J));for(D=J.length;!J[--D];);for(Ne=0,v="";Ne<=D;v+=T.charAt(J[Ne++]));v=xr(v,L,T.charAt(0))}return v}})(),t=(function(){function y(M,C,P){var N,T,k,L,D=0,q=M.length,te=C%Jr,J=C/Jr|0;for(M=M.slice();q--;)k=M[q]%Jr,L=M[q]/Jr|0,N=J*k+L*te,T=te*k+N%Jr*Jr+D,D=(T/P|0)+(N/Jr|0)+J*L,M[q]=T%P;return D&&(M=[D].concat(M)),M}function _(M,C,P,N){var T,k;if(P!=N)k=P>N?1:-1;else for(T=k=0;T<P;T++)if(M[T]!=C[T]){k=M[T]>C[T]?1:-1;break}return k}function v(M,C,P,N){for(var T=0;P--;)M[P]-=T,T=M[P]<C[P]?1:0,M[P]=T*N+M[P]-C[P];for(;!M[0]&&M.length>1;M.splice(0,1));}return function(M,C,P,N,T){var k,L,D,q,te,J,pe,Ne,We,le,Oe,at,Er,Fr,Ii,wt,Tr,bt=M.s==C.s?1:-1,Be=M.c,Ue=C.c;if(!Be||!Be[0]||!Ue||!Ue[0])return new Y(!M.s||!C.s||(Be?Ue&&Be[0]==Ue[0]:!Ue)?NaN:Be&&Be[0]==0||!Ue?bt*0:bt/0);for(Ne=new Y(bt),We=Ne.c=[],L=M.e-C.e,bt=P+L+1,T||(T=sr,L=Kt(M.e/ce)-Kt(C.e/ce),bt=bt/ce|0),D=0;Ue[D]==(Be[D]||0);D++);if(Ue[D]>(Be[D]||0)&&L--,bt<0)We.push(1),q=!0;else{for(Fr=Be.length,wt=Ue.length,D=0,bt+=2,te=Yt(T/(Ue[0]+1)),te>1&&(Ue=y(Ue,te,T),Be=y(Be,te,T),wt=Ue.length,Fr=Be.length),Er=wt,le=Be.slice(0,wt),Oe=le.length;Oe<wt;le[Oe++]=0);Tr=Ue.slice(),Tr=[0].concat(Tr),Ii=Ue[0],Ue[1]>=T/2&&Ii++;do{if(te=0,k=_(Ue,le,wt,Oe),k<0){if(at=le[0],wt!=Oe&&(at=at*T+(le[1]||0)),te=Yt(at/Ii),te>1)for(te>=T&&(te=T-1),J=y(Ue,te,T),pe=J.length,Oe=le.length;_(J,le,pe,Oe)==1;)te--,v(J,wt<pe?Tr:Ue,pe,T),pe=J.length,k=1;else te==0&&(k=te=1),J=Ue.slice(),pe=J.length;if(pe<Oe&&(J=[0].concat(J)),v(le,J,Oe,T),Oe=le.length,k==-1)for(;_(Ue,le,wt,Oe)<1;)te++,v(le,wt<Oe?Tr:Ue,Oe,T),Oe=le.length}else k===0&&(te++,le=[0]);We[D++]=te,le[0]?le[Oe++]=Be[Er]||0:(le=[Be[Er]],Oe=1)}while((Er++<Fr||le[0]!=null)&&bt--);q=le[0]!=null,We[0]||We.splice(0,1)}if(T==sr){for(D=1,bt=We[0];bt>=10;bt/=10,D++);Fe(Ne,P+(Ne.e=D+L*ce-1)+1,N,q)}else Ne.e=L,Ne.r=+q;return Ne}})();function Ae(y,_,v,M){var C,P,N,T,k;if(v==null?v=l:ze(v,0,8),!y.c)return y.toString();if(C=y.c[0],N=y.e,_==null)k=qt(y.c),k=M==1||M==2&&(N<=h||N>=m)?ws(k,N):xr(k,N,"0");else if(y=Fe(new Y(y),_,v),P=y.e,k=qt(y.c),T=k.length,M==1||M==2&&(_<=P||P<=h)){for(;T<_;k+="0",T++);k=ws(k,P)}else if(_-=N+(M===2&&P>N),k=xr(k,P,"0"),P+1>T){if(--_>0)for(k+=".";_--;k+="0");}else if(_+=P-T,_>0)for(P+1==T&&(k+=".");_--;k+="0");return y.s<0&&C?"-"+k:k}function Se(y,_){for(var v,M,C=1,P=new Y(y[0]);C<y.length;C++)M=new Y(y[C]),(!M.s||(v=gn(P,M))===_||v===0&&P.s===_)&&(P=M);return P}function _e(y,_,v){for(var M=1,C=_.length;!_[--C];_.pop());for(C=_[0];C>=10;C/=10,M++);return(v=M+v*ce-1)>E?y.c=y.e=null:v<b?y.c=[y.e=0]:(y.e=v,y.c=_),y}s=(function(){var y=/^(-?)0([xbo])(?=\w[\w.]*$)/i,_=/^([^.]+)\.$/,v=/^\.([^.]+)$/,M=/^-?(Infinity|NaN)$/,C=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(P,N,T,k){var L,D=T?N:N.replace(C,"");if(M.test(D))P.s=isNaN(D)?null:D<0?-1:1;else{if(!T&&(D=D.replace(y,function(q,te,J){return L=(J=J.toLowerCase())=="x"?16:J=="b"?2:8,!k||k==L?te:q}),k&&(L=k,D=D.replace(_,"$1").replace(v,"0.$1")),N!=D))return new Y(D,L);if(Y.DEBUG)throw Error(Ot+"Not a"+(k?" base "+k:"")+" number: "+N);P.s=null}P.c=P.e=null}})();function Fe(y,_,v,M){var C,P,N,T,k,L,D,q=y.c,te=so;if(q){e:{for(C=1,T=q[0];T>=10;T/=10,C++);if(P=_-C,P<0)P+=ce,N=_,k=q[L=0],D=Yt(k/te[C-N-1]%10);else if(L=no((P+1)/ce),L>=q.length)if(M){for(;q.length<=L;q.push(0));k=D=0,C=1,P%=ce,N=P-ce+1}else break e;else{for(k=T=q[L],C=1;T>=10;T/=10,C++);P%=ce,N=P-ce+C,D=N<0?0:Yt(k/te[C-N-1]%10)}if(M=M||_<0||q[L+1]!=null||(N<0?k:k%te[C-N-1]),M=v<4?(D||M)&&(v==0||v==(y.s<0?3:2)):D>5||D==5&&(v==4||M||v==6&&(P>0?N>0?k/te[C-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(P==0?(q.length=L,T=1,L--):(q.length=L+1,T=te[ce-P],q[L]=N>0?Yt(k/te[C-N]%te[N])*T:0),M)for(;;)if(L==0){for(P=1,N=q[0];N>=10;N/=10,P++);for(N=q[0]+=T,T=1;N>=10;N/=10,T++);P!=T&&(y.e++,q[0]==sr&&(q[0]=1));break}else{if(q[L]+=T,q[L]!=sr)break;q[L--]=0,T=1}for(P=q.length;q[--P]===0;q.pop());}y.e>E?y.c=y.e=null:y.e<b&&(y.c=[y.e=0])}return y}function Re(y){var _,v=y.e;return v===null?y.toString():(_=qt(y.c),_=v<=h||v>=m?ws(_,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,C,P=this;if(y!=null)return ze(y,0,st),_==null?_=l:ze(_,0,8),Fe(new Y(P),y+P.e+1,_);if(!(v=P.c))return null;if(M=((C=v.length-1)-Kt(this.e/ce))*ce,C=v[C])for(;C%10==0;C/=10,M--);return M<0&&(M=0),M},a.dividedBy=a.div=function(y,_){return t(this,new Y(y,_),u,l)},a.dividedToIntegerBy=a.idiv=function(y,_){return t(this,new Y(y,_),0,1)},a.exponentiatedBy=a.pow=function(y,_){var v,M,C,P,N,T,k,L,D,q=this;if(y=new Y(y),y.c&&!y.isInteger())throw Error(Ot+"Exponent not an integer: "+Re(y));if(_!=null&&(_=new Y(_)),T=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(+Re(q),T?y.s*(2-_s(y)):+Re(y))),_?D.mod(_):D;if(k=y.s<0,_){if(_.c?!_.c[0]:!_.s)return new Y(NaN);M=!k&&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||T&&q.c[1]>=24e7:q.c[0]<8e13||T&&q.c[0]<=9999975e7)))return P=q.s<0&&_s(y)?-0:0,q.e>-1&&(P=1/P),new Y(k?1/P:P);O&&(P=no(O/ce+2))}for(T?(v=new Y(.5),k&&(y.s=1),L=_s(y)):(C=Math.abs(+Re(y)),L=C%2),D=new Y(c);;){if(L){if(D=D.times(q),!D.c)break;P?D.c.length>P&&(D.c.length=P):M&&(D=D.mod(_))}if(C){if(C=Yt(C/2),C===0)break;L=C%2}else if(y=y.times(v),Fe(y,y.e+1,1),y.e>14)L=_s(y);else{if(C=+Re(y),C===0)break;L=C%2}q=q.times(q),P?q.c&&q.c.length>P&&(q.c.length=P):M&&(q=q.mod(_))}return M?D:(k&&(D=c.div(D)),_?D.mod(_):P?Fe(D,O,l,N):D)},a.integerValue=function(y){var _=new Y(this);return y==null?y=l:ze(y,0,8),Fe(_,_.e+1,y)},a.isEqualTo=a.eq=function(y,_){return gn(this,new Y(y,_))===0},a.isFinite=function(){return!!this.c},a.isGreaterThan=a.gt=function(y,_){return gn(this,new Y(y,_))>0},a.isGreaterThanOrEqualTo=a.gte=function(y,_){return(_=gn(this,new Y(y,_)))===1||_===0},a.isInteger=function(){return!!this.c&&Kt(this.e/ce)>this.c.length-2},a.isLessThan=a.lt=function(y,_){return gn(this,new Y(y,_))<0},a.isLessThanOrEqualTo=a.lte=function(y,_){return(_=gn(this,new Y(y,_)))===-1||_===0},a.isNaN=function(){return!this.s},a.isNegative=function(){return this.s<0},a.isPositive=function(){return this.s>0},a.isZero=function(){return!!this.c&&this.c[0]==0},a.minus=function(y,_){var v,M,C,P,N=this,T=N.s;if(y=new Y(y,_),_=y.s,!T||!_)return new Y(NaN);if(T!=_)return y.s=-_,N.plus(y);var k=N.e/ce,L=y.e/ce,D=N.c,q=y.c;if(!k||!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(k=Kt(k),L=Kt(L),D=D.slice(),T=k-L){for((P=T<0)?(T=-T,C=D):(L=k,C=q),C.reverse(),_=T;_--;C.push(0));C.reverse()}else for(M=(P=(T=D.length)<(_=q.length))?T:_,T=_=0;_<M;_++)if(D[_]!=q[_]){P=D[_]<q[_];break}if(P&&(C=D,D=q,q=C,y.s=-y.s),_=(M=q.length)-(v=D.length),_>0)for(;_--;D[v++]=0);for(_=sr-1;M>T;){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,C=this;return y=new Y(y,_),!C.c||!y.s||y.c&&!y.c[0]?new Y(NaN):!y.c||C.c&&!C.c[0]?new Y(C):($==9?(M=y.s,y.s=1,v=t(C,y,0,3),y.s=M,v.s*=M):v=t(C,y,0,$),y=C.minus(v.times(y)),!y.c[0]&&$==1&&(y.s=C.s),y)},a.multipliedBy=a.times=function(y,_){var v,M,C,P,N,T,k,L,D,q,te,J,pe,Ne,We,le=this,Oe=le.c,at=(y=new Y(y,_)).c;if(!Oe||!at||!Oe[0]||!at[0])return!le.s||!y.s||Oe&&!Oe[0]&&!at||at&&!at[0]&&!Oe?y.c=y.e=y.s=null:(y.s*=le.s,!Oe||!at?y.c=y.e=null:(y.c=[0],y.e=0)),y;for(M=Kt(le.e/ce)+Kt(y.e/ce),y.s*=le.s,k=Oe.length,q=at.length,k<q&&(pe=Oe,Oe=at,at=pe,C=k,k=q,q=C),C=k+q,pe=[];C--;pe.push(0));for(Ne=sr,We=Jr,C=q;--C>=0;){for(v=0,te=at[C]%We,J=at[C]/We|0,N=k,P=C+N;P>C;)L=Oe[--N]%We,D=Oe[N]/We|0,T=J*L+D*te,L=te*L+T%We*We+pe[P]+v,v=(L/Ne|0)+(T/We|0)+J*D,pe[P--]=L%Ne;pe[P]=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,C=M.s;if(y=new Y(y,_),_=y.s,!C||!_)return new Y(NaN);if(C!=_)return y.s=-_,M.minus(y);var P=M.e/ce,N=y.e/ce,T=M.c,k=y.c;if(!P||!N){if(!T||!k)return new Y(C/0);if(!T[0]||!k[0])return k[0]?y:new Y(T[0]?M:C*0)}if(P=Kt(P),N=Kt(N),T=T.slice(),C=P-N){for(C>0?(N=P,v=k):(C=-C,v=T),v.reverse();C--;v.push(0));v.reverse()}for(C=T.length,_=k.length,C-_<0&&(v=k,k=T,T=v,_=C),C=0;_;)C=(T[--_]=T[_]+k[_]+C)/sr|0,T[_]=sr===T[_]?0:T[_]%sr;return C&&(T=[C].concat(T),++N),_e(y,T,N)},a.precision=a.sd=function(y,_){var v,M,C,P=this;if(y!=null&&y!==!!y)return ze(y,1,st),_==null?_=l:ze(_,0,8),Fe(new Y(P),y,_);if(!(v=P.c))return null;if(C=v.length-1,M=C*ce+1,C=v[C]){for(;C%10==0;C/=10,M--);for(C=v[0];C>=10;C/=10,M++);}return y&&P.e+1>M&&(M=P.e+1),M},a.shiftedBy=function(y){return ze(y,-io,io),this.times("1e"+y)},a.squareRoot=a.sqrt=function(){var y,_,v,M,C,P=this,N=P.c,T=P.s,k=P.e,L=u+4,D=new Y("0.5");if(T!==1||!N||!N[0])return new Y(!T||T<0&&(!N||N[0])?NaN:N?P:1/0);if(T=Math.sqrt(+Re(P)),T==0||T==1/0?(_=qt(N),(_.length+k)%2==0&&(_+="0"),T=Math.sqrt(+_),k=Kt((k+1)/2)-(k<0||k%2),T==1/0?_="5e"+k:(_=T.toExponential(),_=_.slice(0,_.indexOf("e")+1)+k),v=new Y(_)):v=new Y(T+""),v.c[0]){for(k=v.e,T=k+L,T<3&&(T=0);;)if(C=v,v=D.times(C.plus(t(P,C,L,1))),qt(C.c).slice(0,T)===(_=qt(v.c)).slice(0,T))if(v.e<k&&--T,_=_.slice(T-3,T+1),_=="9999"||!M&&_=="4999"){if(!M&&(Fe(C,C.e+u+2,0),C.times(C).eq(P))){v=C;break}L+=4,T+=4,M=1}else{(!+_||!+_.slice(1)&&_.charAt(0)=="5")&&(Fe(v,v.e+u+2,1),y=!v.times(v).eq(P));break}}return Fe(v,v.e+u+1,l,y)},a.toExponential=function(y,_){return y!=null&&(ze(y,0,st),y++),Ae(this,y,_,1)},a.toFixed=function(y,_){return y!=null&&(ze(y,0,st),y=y+this.e+1),Ae(this,y,_)},a.toFormat=function(y,_,v){var M,C=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(Ot+"Argument not an object: "+v);if(M=C.toFixed(y,_),C.c){var P,N=M.split("."),T=+v.groupSize,k=+v.secondaryGroupSize,L=v.groupSeparator||"",D=N[0],q=N[1],te=C.s<0,J=te?D.slice(1):D,pe=J.length;if(k&&(P=T,T=k,k=P,pe-=P),T>0&&pe>0){for(P=pe%T||T,D=J.substr(0,P);P<pe;P+=T)D+=L+J.substr(P,T);k>0&&(D+=L+J.slice(P)),te&&(D="-"+D)}M=q?D+(v.decimalSeparator||"")+((k=+v.fractionGroupSize)?q.replace(new RegExp("\\d{"+k+"}\\B","g"),"$&"+(v.fractionGroupSeparator||"")):q):D}return(v.prefix||"")+M+(v.suffix||"")},a.toFraction=function(y){var _,v,M,C,P,N,T,k,L,D,q,te,J=this,pe=J.c;if(y!=null&&(T=new Y(y),!T.isInteger()&&(T.c||T.s!==1)||T.lt(c)))throw Error(Ot+"Argument "+(T.isInteger()?"out of range: ":"not an integer: ")+Re(T));if(!pe)return new Y(J);for(_=new Y(c),L=v=new Y(c),M=k=new Y(c),te=qt(pe),P=_.e=te.length-J.e-1,_.c[0]=so[(N=P%ce)<0?ce+N:N],y=!y||T.comparedTo(_)>0?P>0?_:L:T,N=E,E=1/0,T=new Y(te),k.c[0]=0;D=t(T,_,0,1),C=v.plus(D.times(M)),C.comparedTo(y)!=1;)v=M,M=C,L=k.plus(D.times(C=L)),k=C,_=T.minus(D.times(C=_)),T=C;return C=t(y.minus(v),M,0,1),k=k.plus(C.times(L)),v=v.plus(C.times(M)),k.s=L.s=J.s,P=P*2,q=t(L,M,P,l).minus(J).abs().comparedTo(t(k,v,P,l).minus(J).abs())<1?[L,M]:[k,v],E=N,q},a.toNumber=function(){return+Re(this)},a.toPrecision=function(y,_){return y!=null&&ze(y,1,st),Ae(this,y,_,2)},a.toString=function(y){var _,v=this,M=v.s,C=v.e;return C===null?M?(_="Infinity",M<0&&(_="-"+_)):_="NaN":(y==null?_=C<=h||C>=m?ws(qt(v.c),C):xr(qt(v.c),C,"0"):y===10&&ne?(v=Fe(new Y(v),u+C+1,l),_=xr(qt(v.c),v.e,"0")):(ze(y,2,F.length,"Base"),_=n(xr(qt(v.c),C,"0"),10,y,M,!0)),M<0&&v.c[0]&&(_="-"+_)),_},a.valueOf=a.toJSON=function(){return Re(this)},a._isBigNumber=!0,a[Symbol.toStringTag]="BigNumber",a[Symbol.for("nodejs.util.inspect.custom")]=a.valueOf,e!=null&&Y.set(e),Y}function Kt(e){var t=e|0;return e>0||e===t?t:t-1}function qt(e){for(var t,n,s=1,a=e.length,c=e[0]+"";s<a;){for(t=e[s++]+"",n=ce-t.length;n--;t="0"+t);c+=t}for(a=c.length;c.charCodeAt(--a)===48;);return c.slice(0,a+1||1)}function gn(e,t){var n,s,a=e.c,c=t.c,u=e.s,l=t.s,h=e.e,m=t.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(e,t,n,s){if(e<t||e>n||e!==Yt(e))throw Error(Ot+(s||"Argument")+(typeof e=="number"?e<t||e>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function _s(e){var t=e.c.length-1;return Kt(e.e/ce)==t&&e.c[t]%2!=0}function ws(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function xr(e,t,n){var s,a;if(t<0){for(a=n+".";++t;a+=n);e=a+e}else if(s=e.length,++t>s){for(a=n,t-=s;--t;a+=n);e+=a}else t<s&&(e=e.slice(0,t)+"."+e.slice(t));return e}var Ze=El();const yn=new TextEncoder,ao=new TextDecoder,bs=2**32;function bi(...e){const t=e.reduce((a,{length:c})=>a+c,0),n=new Uint8Array(t);let s=0;for(const a of e)n.set(a,s),s+=a.length;return n}function oo(e,t,n){if(t<0||t>=bs)throw new RangeError(`value must be >= 0 and <= ${bs-1}. Received ${t}`);e.set([t>>>24,t>>>16,t>>>8,t&255],n)}function dg(e){const t=Math.floor(e/bs),n=e%bs,s=new Uint8Array(8);return oo(s,t,0),oo(s,n,4),s}function uo(e){const t=new Uint8Array(4);return oo(t,e),t}function pg(e){if(Uint8Array.prototype.toBase64)return e.toBase64();const t=32768,n=[];for(let s=0;s<e.length;s+=t)n.push(String.fromCharCode.apply(null,e.subarray(s,s+t)));return btoa(n.join(""))}function mg(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(e);const t=atob(e),n=new Uint8Array(t.length);for(let s=0;s<t.length;s++)n[s]=t.charCodeAt(s);return n}function Tl(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(typeof e=="string"?e:ao.decode(e),{alphabet:"base64url"});let t=e;t instanceof Uint8Array&&(t=ao.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return mg(t)}catch{throw new TypeError("The input to be decoded is not correctly encoded.")}}function $t(e){let t=e;return typeof t=="string"&&(t=yn.encode(t)),Uint8Array.prototype.toBase64?t.toBase64({alphabet:"base64url",omitPadding:!0}):pg(t).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}class Al extends Error{static code="ERR_JOSE_GENERIC";code="ERR_JOSE_GENERIC";constructor(t,n){super(t,n),this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}}class yt extends Al{static code="ERR_JOSE_NOT_SUPPORTED";code="ERR_JOSE_NOT_SUPPORTED"}class Qr extends Al{static code="ERR_JWE_INVALID";code="ERR_JWE_INVALID"}function Ol(e){switch(e){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: ${e}`)}}const gg=e=>crypto.getRandomValues(new Uint8Array(Ol(e)>>3)),yg=(e,t)=>{if(t.length<<3!==Ol(e))throw new Qr("Invalid Initialization Vector length")},Cl=(e,t)=>{const n=e.byteLength<<3;if(n!==t)throw new Qr(`Invalid Content Encryption Key length. Expected ${t} bits, got ${n} bits`)};function Zr(e,t="algorithm.name"){return new TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`)}function vs(e,t){return e.name===t}function _g(e){return parseInt(e.name.slice(4),10)}function wg(e,t){if(t&&!e.usages.includes(t))throw new TypeError(`CryptoKey does not support this operation, its usages must include ${t}.`)}function Bn(e,t,n){switch(t){case"A128GCM":case"A192GCM":case"A256GCM":{if(!vs(e.algorithm,"AES-GCM"))throw Zr("AES-GCM");const s=parseInt(t.slice(1,4),10);if(e.algorithm.length!==s)throw Zr(s,"algorithm.length");break}case"A128KW":case"A192KW":case"A256KW":{if(!vs(e.algorithm,"AES-KW"))throw Zr("AES-KW");const s=parseInt(t.slice(1,4),10);if(e.algorithm.length!==s)throw Zr(s,"algorithm.length");break}case"ECDH":{switch(e.algorithm.name){case"ECDH":case"X25519":break;default:throw Zr("ECDH or X25519")}break}case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":if(!vs(e.algorithm,"PBKDF2"))throw Zr("PBKDF2");break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":{if(!vs(e.algorithm,"RSA-OAEP"))throw Zr("RSA-OAEP");const s=parseInt(t.slice(9),10)||1;if(_g(e.algorithm.hash)!==s)throw Zr(`SHA-${s}`,"algorithm.hash");break}default:throw new TypeError("CryptoKey does not support this operation")}wg(e,n)}function kl(e,t,...n){if(n=n.filter(Boolean),n.length>2){const s=n.pop();e+=`one of type ${n.join(", ")}, or ${s}.`}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!=null&&t.constructor?.name&&(e+=` Received an instance of ${t.constructor.name}`),e}const co=(e,...t)=>kl("Key must be ",e,...t);function xl(e,t,...n){return kl(`Key for the ${e} algorithm must be `,t,...n)}function Rl(e){if(!vi(e))throw new Error("CryptoKey instance expected")}function vi(e){return e?.[Symbol.toStringTag]==="CryptoKey"}function lo(e){return e?.[Symbol.toStringTag]==="KeyObject"}const Pl=e=>vi(e)||lo(e),bg=(...e)=>{const t=e.filter(Boolean);if(t.length===0||t.length===1)return!0;let n;for(const s of t){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(e){return typeof e=="object"&&e!==null}const Dl=e=>{if(!vg(e)||Object.prototype.toString.call(e)!=="[object Object]")return!1;if(Object.getPrototypeOf(e)===null)return!0;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t};function Sg(e,t){if(e.algorithm.length!==parseInt(t.slice(1,4),10))throw new TypeError(`Invalid key size for alg: ${t}`)}function Eg(e,t,n){return e instanceof Uint8Array?crypto.subtle.importKey("raw",e,"AES-KW",!0,[n]):(Bn(e,t,n),e)}async function fo(e,t,n){const s=await Eg(t,e,"wrapKey");Sg(s,e);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 Tg=async(e,t)=>{const n=`SHA-${e.slice(-3)}`;return new Uint8Array(await crypto.subtle.digest(n,t))};function ho(e){return bi(uo(e.length),e)}async function Ag(e,t,n){const s=t>>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+e.length+n.length);h.set(uo(l),0),h.set(e,4),h.set(n,4+e.length);const m=await Tg("sha256",h);u.set(m,(l-1)*a)}return u.slice(0,s)}async function Og(e,t,n,s,a=new Uint8Array(0),c=new Uint8Array(0)){Bn(e,"ECDH"),Bn(t,"ECDH","deriveBits");const u=ho(yn.encode(n)),l=ho(a),h=ho(c),m=uo(s),b=new Uint8Array(0),E=bi(u,l,h,m,b),R=new Uint8Array(await crypto.subtle.deriveBits({name:e.algorithm.name,public:e},t,Cg(e)));return Ag(R,s,E)}function Cg(e){return e.algorithm.name==="X25519"?256:Math.ceil(parseInt(e.algorithm.namedCurve.slice(-3),10)/8)<<3}function kg(e){switch(e.algorithm.namedCurve){case"P-256":case"P-384":case"P-521":return!0;default:return e.algorithm.name==="X25519"}}function xg(e,t){return e instanceof Uint8Array?crypto.subtle.importKey("raw",e,"PBKDF2",!1,["deriveBits"]):(Bn(e,t,"deriveBits"),e)}const Rg=(e,t)=>bi(yn.encode(e),new Uint8Array([0]),t);async function Pg(e,t,n,s){if(!(e instanceof Uint8Array)||e.length<8)throw new Qr("PBES2 Salt Input must be 8 or more octets");const a=Rg(t,e),c=parseInt(t.slice(13,16),10),u={hash:`SHA-${t.slice(8,11)}`,iterations:n,name:"PBKDF2",salt:a},l=await xg(s,t);return new Uint8Array(await crypto.subtle.deriveBits(u,l,c))}async function Dg(e,t,n,s=2048,a=crypto.getRandomValues(new Uint8Array(16))){const c=await Pg(a,e,s,t);return{encryptedKey:await fo(e.slice(-6),c,n),p2c:s,p2s:$t(a)}}const Mg=(e,t)=>{if(e.startsWith("RS")||e.startsWith("PS")){const{modulusLength:n}=t.algorithm;if(typeof n!="number"||n<2048)throw new TypeError(`${e} requires key modulusLength to be 2048 bits or larger`)}},Lg=e=>{switch(e){case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":return"RSA-OAEP";default:throw new yt(`alg ${e} is not supported either by JOSE or your javascript runtime`)}};async function Ng(e,t,n){return Bn(t,e,"encrypt"),Mg(e,t),new Uint8Array(await crypto.subtle.encrypt(Lg(e),t,n))}function Ml(e){switch(e){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: ${e}`)}}const Si=e=>crypto.getRandomValues(new Uint8Array(Ml(e)>>3));function Ug(e){let t,n;switch(e.kty){case"AKP":{switch(e.alg){case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":t={name:e.alg},n=e.priv?["sign"]:["verify"];break;default:throw new yt('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}case"RSA":{switch(e.alg){case"PS256":case"PS384":case"PS512":t={name:"RSA-PSS",hash:`SHA-${e.alg.slice(-3)}`},n=e.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":t={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${e.alg.slice(-3)}`},n=e.d?["sign"]:["verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":t={name:"RSA-OAEP",hash:`SHA-${parseInt(e.alg.slice(-3),10)||1}`},n=e.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new yt('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}case"EC":{switch(e.alg){case"ES256":t={name:"ECDSA",namedCurve:"P-256"},n=e.d?["sign"]:["verify"];break;case"ES384":t={name:"ECDSA",namedCurve:"P-384"},n=e.d?["sign"]:["verify"];break;case"ES512":t={name:"ECDSA",namedCurve:"P-521"},n=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:"ECDH",namedCurve:e.crv},n=e.d?["deriveBits"]:[];break;default:throw new yt('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}case"OKP":{switch(e.alg){case"Ed25519":case"EdDSA":t={name:"Ed25519"},n=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:e.crv},n=e.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:t,keyUsages:n}}const Ss=async e=>{if(!e.alg)throw new TypeError('"alg" argument is required when "jwk.alg" is not present');const{algorithm:t,keyUsages:n}=Ug(e),s={...e};return s.kty!=="AKP"&&delete s.alg,delete s.use,crypto.subtle.importKey("jwk",s,t,e.ext??!(e.d||e.priv),e.key_ops??n)};async function Bg(e,t,n){if(!Dl(e))throw new TypeError("JWK must be an object");let s;switch(t??=e.alg,s??=e.ext,e.kty){case"oct":if(typeof e.k!="string"||!e.k)throw new TypeError('missing "k" (Key Value) Parameter value');return Tl(e.k);case"RSA":if("oth"in e&&e.oth!==void 0)throw new yt('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');return Ss({...e,alg:t,ext:s});case"AKP":{if(typeof e.alg!="string"||!e.alg)throw new TypeError('missing "alg" (Algorithm) Parameter value');if(t!==void 0&&t!==e.alg)throw new TypeError("JWK alg and alg option value mismatch");return Ss({...e,ext:s})}case"EC":case"OKP":return Ss({...e,alg:t,ext:s});default:throw new yt('Unsupported "kty" (Key Type) Parameter value')}}async function Ig(e,t,n,s,a){if(!(n instanceof Uint8Array))throw new TypeError(co(n,"Uint8Array"));const c=parseInt(e.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,t)),m=bi(a,s,h,dg(a.length<<3)),b=new Uint8Array((await crypto.subtle.sign("HMAC",l,m)).slice(0,c>>3));return{ciphertext:h,tag:b,iv:s}}async function Fg(e,t,n,s,a){let c;n instanceof Uint8Array?c=await crypto.subtle.importKey("raw",n,"AES-GCM",!1,["encrypt"]):(Bn(n,e,"encrypt"),c=n);const u=new Uint8Array(await crypto.subtle.encrypt({additionalData:a,iv:s,name:"AES-GCM",tagLength:128},c,t)),l=u.slice(-16);return{ciphertext:u.slice(0,-16),tag:l,iv:s}}const Ll=async(e,t,n,s,a)=>{if(!vi(n)&&!(n instanceof Uint8Array))throw new TypeError(co(n,"CryptoKey","KeyObject","Uint8Array","JSON Web Key"));switch(s?yg(e,s):s=gg(e),e){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return n instanceof Uint8Array&&Cl(n,parseInt(e.slice(-3),10)),Ig(e,t,n,s,a);case"A128GCM":case"A192GCM":case"A256GCM":return n instanceof Uint8Array&&Cl(n,parseInt(e.slice(1,4),10)),Fg(e,t,n,s,a);default:throw new yt("Unsupported JWE Content Encryption Algorithm")}};async function Wg(e,t,n,s){const a=e.slice(0,7),c=await Ll(a,n,t,s,new Uint8Array(0));return{encryptedKey:c.ciphertext,iv:$t(c.iv),tag:$t(c.tag)}}const Hg=(e,t,n,s,a)=>{if(a.crit!==void 0&&s?.crit===void 0)throw new e('"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 e('"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),...t.entries()]):c=t;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 e(`Extension Header Parameter "${u}" is missing`);if(c.get(u)&&s[u]===void 0)throw new e(`Extension Header Parameter "${u}" MUST be integrity protected`)}return new Set(s.crit)};function po(e){return Dl(e)&&typeof e.kty=="string"}function Yg(e){return e.kty!=="oct"&&(e.kty==="AKP"&&typeof e.priv=="string"||typeof e.d=="string")}function Kg(e){return e.kty!=="oct"&&typeof e.d>"u"&&typeof e.priv>"u"}function qg(e){return e.kty==="oct"&&typeof e.k=="string"}let In;const Nl=async(e,t,n,s=!1)=>{In||=new WeakMap;let a=In.get(e);if(a?.[n])return a[n];const c=await Ss({...t,alg:n});return s&&Object.freeze(e),a?a[n]=c:In.set(e,{[n]:c}),c},$g=(e,t)=>{In||=new WeakMap;let n=In.get(e);if(n?.[t])return n[t];const s=e.type==="public",a=!!s;let c;if(e.asymmetricKeyType==="x25519"){switch(t){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=e.toCryptoKey(e.asymmetricKeyType,a,s?[]:["deriveBits"])}if(e.asymmetricKeyType==="ed25519"){if(t!=="EdDSA"&&t!=="Ed25519")throw new TypeError("given KeyObject instance cannot be used for this algorithm");c=e.toCryptoKey(e.asymmetricKeyType,a,[s?"verify":"sign"])}switch(e.asymmetricKeyType){case"ml-dsa-44":case"ml-dsa-65":case"ml-dsa-87":{if(t!==e.asymmetricKeyType.toUpperCase())throw new TypeError("given KeyObject instance cannot be used for this algorithm");c=e.toCryptoKey(e.asymmetricKeyType,a,[s?"verify":"sign"])}}if(e.asymmetricKeyType==="rsa"){let u;switch(t){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(t.startsWith("RSA-OAEP"))return e.toCryptoKey({name:"RSA-OAEP",hash:u},a,s?["encrypt"]:["decrypt"]);c=e.toCryptoKey({name:t.startsWith("PS")?"RSA-PSS":"RSASSA-PKCS1-v1_5",hash:u},a,[s?"verify":"sign"])}if(e.asymmetricKeyType==="ec"){const l=new Map([["prime256v1","P-256"],["secp384r1","P-384"],["secp521r1","P-521"]]).get(e.asymmetricKeyDetails?.namedCurve);if(!l)throw new TypeError("given KeyObject instance cannot be used for this algorithm");t==="ES256"&&l==="P-256"&&(c=e.toCryptoKey({name:"ECDSA",namedCurve:l},a,[s?"verify":"sign"])),t==="ES384"&&l==="P-384"&&(c=e.toCryptoKey({name:"ECDSA",namedCurve:l},a,[s?"verify":"sign"])),t==="ES512"&&l==="P-521"&&(c=e.toCryptoKey({name:"ECDSA",namedCurve:l},a,[s?"verify":"sign"])),t.startsWith("ECDH-ES")&&(c=e.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[t]=c:In.set(e,{[t]:c}),c},Ul=async(e,t)=>{if(e instanceof Uint8Array||vi(e))return e;if(lo(e)){if(e.type==="secret")return e.export();if("toCryptoKey"in e&&typeof e.toCryptoKey=="function")try{return $g(e,t)}catch(s){if(s instanceof TypeError)throw s}let n=e.export({format:"jwk"});return Nl(e,n,t)}if(po(e))return e.k?Tl(e.k):Nl(e,e,t,!0);throw new Error("unreachable")},Fn=e=>e?.[Symbol.toStringTag],mo=(e,t,n)=>{if(t.use!==void 0){let s;switch(n){case"sign":case"verify":s="sig";break;case"encrypt":case"decrypt":s="enc";break}if(t.use!==s)throw new TypeError(`Invalid key for this operation, its "use" must be "${s}" when present`)}if(t.alg!==void 0&&t.alg!==e)throw new TypeError(`Invalid key for this operation, its "alg" must be "${e}" when present`);if(Array.isArray(t.key_ops)){let s;switch(!0){case n==="verify":case e==="dir":case e.includes("CBC-HS"):s=n;break;case e.startsWith("PBES2"):s="deriveBits";break;case/^A\d{3}(?:GCM)?(?:KW)?$/.test(e):!e.includes("GCM")&&e.endsWith("KW")?s="wrapKey":s=n;break;case e.startsWith("RSA"):s="wrapKey";break;case n==="decrypt":s=e.startsWith("RSA")?"unwrapKey":"deriveBits";break}if(s&&t.key_ops?.includes?.(s)===!1)throw new TypeError(`Invalid key for this operation, its "key_ops" must include "${s}" when present`)}return!0},Gg=(e,t,n)=>{if(!(t instanceof Uint8Array)){if(po(t)){if(qg(t)&&mo(e,t,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(!Pl(t))throw new TypeError(xl(e,t,"CryptoKey","KeyObject","JSON Web Key","Uint8Array"));if(t.type!=="secret")throw new TypeError(`${Fn(t)} instances for symmetric algorithms must be of type "secret"`)}},Vg=(e,t,n)=>{if(po(t))switch(n){case"decrypt":case"sign":if(Yg(t)&&mo(e,t,n))return;throw new TypeError("JSON Web Key for this operation be a private JWK");case"encrypt":case"verify":if(Kg(t)&&mo(e,t,n))return;throw new TypeError("JSON Web Key for this operation be a public JWK")}if(!Pl(t))throw new TypeError(xl(e,t,"CryptoKey","KeyObject","JSON Web Key"));if(t.type==="secret")throw new TypeError(`${Fn(t)} instances for asymmetric algorithms must not be of type "secret"`);if(t.type==="public")switch(n){case"sign":throw new TypeError(`${Fn(t)} instances for asymmetric algorithm signing must be of type "private"`);case"decrypt":throw new TypeError(`${Fn(t)} instances for asymmetric algorithm decryption must be of type "private"`)}if(t.type==="private")switch(n){case"verify":throw new TypeError(`${Fn(t)} instances for asymmetric algorithm verifying must be of type "public"`);case"encrypt":throw new TypeError(`${Fn(t)} instances for asymmetric algorithm encryption must be of type "public"`)}},zg=(e,t,n)=>{e.startsWith("HS")||e==="dir"||e.startsWith("PBES2")||/^A(?:128|192|256)(?:GCM)?(?:KW)?$/.test(e)||/^A(?:128|192|256)CBC-HS(?:256|384|512)$/.test(e)?Gg(e,t,n):Vg(e,t,n)},jg=Symbol();async function Jg(e){if(lo(e))if(e.type==="secret")e=e.export();else return e.export({format:"jwk"});if(e instanceof Uint8Array)return{kty:"oct",k:$t(e)};if(!vi(e))throw new TypeError(co(e,"CryptoKey","KeyObject","Uint8Array"));if(!e.extractable)throw new TypeError("non-extractable CryptoKey cannot be exported as a JWK");const{ext:t,key_ops:n,alg:s,use:a,...c}=await crypto.subtle.exportKey("jwk",e);return c.kty==="AKP"&&(c.alg=s),c}async function Qg(e){return Jg(e)}const Zg=async(e,t,n,s,a={})=>{let c,u,l;switch(e){case"dir":{l=n;break}case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{if(Rl(n),!kg(n))throw new yt("ECDH with the provided key is not allowed or not supported by your javascript runtime");const{apu:h,apv:m}=a;let b;a.epk?b=await Ul(a.epk,e):b=(await crypto.subtle.generateKey(n.algorithm,!0,["deriveBits"])).privateKey;const{x:E,y:R,crv:$,kty:O}=await Qg(b),I=await Og(n,b,e==="ECDH-ES"?t:e,e==="ECDH-ES"?Ml(t):parseInt(e.slice(-5,-2),10),h,m);if(u={epk:{x:E,crv:$,kty:O}},O==="EC"&&(u.epk.y=R),h&&(u.apu=$t(h)),m&&(u.apv=$t(m)),e==="ECDH-ES"){l=I;break}l=s||Si(t);const F=e.slice(-6);c=await fo(F,I,l);break}case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":{l=s||Si(t),Rl(n),c=await Ng(e,n,l);break}case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":{l=s||Si(t);const{p2c:h,p2s:m}=a;({encryptedKey:c,...u}=await Dg(e,n,l,h,m));break}case"A128KW":case"A192KW":case"A256KW":{l=s||Si(t),c=await fo(e,n,l);break}case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":{l=s||Si(t);const{iv:h}=a;({encryptedKey:c,...u}=await Wg(e,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(t){if(!(t instanceof Uint8Array))throw new TypeError("plaintext must be an instance of Uint8Array");this.#r=t}setKeyManagementParameters(t){if(this.#o)throw new TypeError("setKeyManagementParameters can only be called once");return this.#o=t,this}setProtectedHeader(t){if(this.#e)throw new TypeError("setProtectedHeader can only be called once");return this.#e=t,this}setSharedUnprotectedHeader(t){if(this.#n)throw new TypeError("setSharedUnprotectedHeader can only be called once");return this.#n=t,this}setUnprotectedHeader(t){if(this.#t)throw new TypeError("setUnprotectedHeader can only be called once");return this.#t=t,this}setAdditionalAuthenticatedData(t){return this.#s=t,this}setContentEncryptionKey(t){if(this.#i)throw new TypeError("setContentEncryptionKey can only be called once");return this.#i=t,this}setInitializationVector(t){if(this.#a)throw new TypeError("setInitializationVector can only be called once");return this.#a=t,this}async encrypt(t,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,t,"encrypt");let l;{let I;const F=await Ul(t,a);({cek:l,encryptedKey:u,parameters:I}=await Zg(a,c,F,this.#i,this.#o)),I&&(n&&jg in n?this.#t?this.#t={...this.#t,...I}:this.setUnprotectedHeader(I):this.#e?this.#e={...this.#e,...I}:this.setProtectedHeader(I))}let h,m,b;this.#e?m=yn.encode($t(JSON.stringify(this.#e))):m=yn.encode(""),this.#s?(b=$t(this.#s),h=bi(m,yn.encode("."),yn.encode(b))):h=m;const{ciphertext:E,tag:R,iv:$}=await Ll(c,this.#r,l,this.#a,h),O={ciphertext:$t(E)};return $&&(O.iv=$t($)),R&&(O.tag=$t(R)),u&&(O.encrypted_key=$t(u)),b&&(O.aad=b),this.#e&&(O.protected=ao.decode(m)),this.#n&&(O.unprotected=this.#n),this.#t&&(O.header=this.#t),O}}class e0{#r;constructor(t){this.#r=new Xg(t)}setContentEncryptionKey(t){return this.#r.setContentEncryptionKey(t),this}setInitializationVector(t){return this.#r.setInitializationVector(t),this}setProtectedHeader(t){return this.#r.setProtectedHeader(t),this}setKeyManagementParameters(t){return this.#r.setKeyManagementParameters(t),this}async encrypt(t,n){const s=await this.#r.encrypt(t,n);return[s.protected,s.encrypted_key,s.iv,s.ciphertext,s.tag].join(".")}}let _n;_n={jwkToPublicKey:async e=>await Bg(e,"RSA-OAEP"),encryptPayload:async(e,t)=>{const n=new TextEncoder().encode(e);return await new e0(n).setProtectedHeader({alg:"RSA-OAEP",enc:"A256GCM"}).encrypt(t)}},_n.createJWT=async(e,t=void 0)=>{const n=$s(JSON.stringify(e));let s,a="";if(t){a=$s(JSON.stringify({typ:"JWT",kid:Ff(t),alg:"HS256"}));const c=[a,n].join(".");s=jo(c,t,"base64url")}else a=$s(JSON.stringify({typ:"JWT",alg:"none"}));return[a,n,s].join(".")},_n.parseJWT=e=>{const[t,n,s]=e.split("."),a=JSON.parse(Gs(t)),c=JSON.parse(Gs(n));return{header:a,body:c,signature:s}};//! moment.js
|
|
34
34
|
//! version : 2.30.1
|
|
35
35
|
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
|
|
36
36
|
//! license : MIT
|
|
37
37
|
//! momentjs.com
|
|
38
|
-
var
|
|
39
|
-
[`+c+"] ";for(u in arguments[0])
|
|
38
|
+
var Bl;function z(){return Bl.apply(null,arguments)}function t0(e){Bl=e}function ar(e){return e instanceof Array||Object.prototype.toString.call(e)==="[object Array]"}function wn(e){return e!=null&&Object.prototype.toString.call(e)==="[object Object]"}function Ce(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function go(e){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(e).length===0;var t;for(t in e)if(Ce(e,t))return!1;return!0}function Ct(e){return e===void 0}function Rr(e){return typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]"}function Ei(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function Il(e,t){var n=[],s,a=e.length;for(s=0;s<a;++s)n.push(t(e[s],s));return n}function Xr(e,t){for(var n in t)Ce(t,n)&&(e[n]=t[n]);return Ce(t,"toString")&&(e.toString=t.toString),Ce(t,"valueOf")&&(e.valueOf=t.valueOf),e}function _r(e,t,n,s){return hf(e,t,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(e){return e._pf==null&&(e._pf=r0()),e._pf}var yo;Array.prototype.some?yo=Array.prototype.some:yo=function(e){var t=Object(this),n=t.length>>>0,s;for(s=0;s<n;s++)if(s in t&&e.call(this,t[s],s,t))return!0;return!1};function _o(e){var t=null,n=!1,s=e._d&&!isNaN(e._d.getTime());if(s&&(t=de(e),n=yo.call(t.parsedDateParts,function(a){return a!=null}),s=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&&(s=s&&t.charsLeftOver===0&&t.unusedTokens.length===0&&t.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(e))e._isValid=s;else return s;return e._isValid}function Es(e){var t=_r(NaN);return e!=null?Xr(de(t),e):de(t).userInvalidated=!0,t}var Fl=z.momentProperties=[],wo=!1;function bo(e,t){var n,s,a,c=Fl.length;if(Ct(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),Ct(t._i)||(e._i=t._i),Ct(t._f)||(e._f=t._f),Ct(t._l)||(e._l=t._l),Ct(t._strict)||(e._strict=t._strict),Ct(t._tzm)||(e._tzm=t._tzm),Ct(t._isUTC)||(e._isUTC=t._isUTC),Ct(t._offset)||(e._offset=t._offset),Ct(t._pf)||(e._pf=de(t)),Ct(t._locale)||(e._locale=t._locale),c>0)for(n=0;n<c;n++)s=Fl[n],a=t[s],Ct(a)||(e[s]=a);return e}function Ti(e){bo(this,e),this._d=new Date(e._d!=null?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),wo===!1&&(wo=!0,z.updateOffset(this),wo=!1)}function or(e){return e instanceof Ti||e!=null&&e._isAMomentObject!=null}function Wl(e){z.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+e)}function Gt(e,t){var n=!0;return Xr(function(){if(z.deprecationHandler!=null&&z.deprecationHandler(null,e),n){var s=[],a,c,u,l=arguments.length;for(c=0;c<l;c++){if(a="",typeof arguments[c]=="object"){a+=`
|
|
39
|
+
[`+c+"] ";for(u in arguments[0])Ce(arguments[0],u)&&(a+=u+": "+arguments[0][u]+", ");a=a.slice(0,-2)}else a=arguments[c];s.push(a)}Wl(e+`
|
|
40
40
|
Arguments: `+Array.prototype.slice.call(s).join("")+`
|
|
41
|
-
`+new Error().stack),n=!1}return t.apply(this,arguments)},t)}var xl={};function Cl(e,t){V.deprecationHandler!=null&&V.deprecationHandler(e,t),xl[e]||(Ol(t),xl[e]=!0)}V.suppressDeprecationWarnings=!1,V.deprecationHandler=null;function wr(e){return typeof Function<"u"&&e instanceof Function||Object.prototype.toString.call(e)==="[object Function]"}function Yg(e){var t,n;for(n in e)Oe(e,n)&&(t=e[n],wr(t)?this[n]=t:this["_"+n]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function ho(e,t){var n=Xr({},e),s;for(s in t)Oe(t,s)&&(yn(e[s])&&yn(t[s])?(n[s]={},Xr(n[s],e[s]),Xr(n[s],t[s])):t[s]!=null?n[s]=t[s]:delete n[s]);for(s in e)Oe(e,s)&&!Oe(t,s)&&yn(e[s])&&(n[s]=Xr({},n[s]));return n}function po(e){e!=null&&this.set(e)}var mo;Object.keys?mo=Object.keys:mo=function(e){var t,n=[];for(t in e)Oe(e,t)&&n.push(t);return n};var Kg={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function qg(e,t,n){var s=this._calendar[e]||this._calendar.sameElse;return wr(s)?s.call(t,n):s}function br(e,t,n){var s=""+Math.abs(e),a=t-s.length,c=e>=0;return(c?n?"+":"":"-")+Math.pow(10,Math.max(0,a)).toString().substr(1)+s}var go=/(\[[^\[]*\])|(\\)?([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,Ss=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,yo={},Un={};function ne(e,t,n,s){var a=s;typeof s=="string"&&(a=function(){return this[s]()}),e&&(Un[e]=a),t&&(Un[t[0]]=function(){return br(a.apply(this,arguments),t[1],t[2])}),n&&(Un[n]=function(){return this.localeData().ordinal(a.apply(this,arguments),e)})}function $g(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function Gg(e){var t=e.match(go),n,s;for(n=0,s=t.length;n<s;n++)Un[t[n]]?t[n]=Un[t[n]]:t[n]=$g(t[n]);return function(a){var c="",u;for(u=0;u<s;u++)c+=wr(t[u])?t[u].call(a,e):t[u];return c}}function Ts(e,t){return e.isValid()?(t=kl(t,e.localeData()),yo[t]=yo[t]||Gg(t),yo[t](e)):e.localeData().invalidDate()}function kl(e,t){var n=5;function s(a){return t.longDateFormat(a)||a}for(Ss.lastIndex=0;n>=0&&Ss.test(e);)e=e.replace(Ss,s),Ss.lastIndex=0,n-=1;return e}var zg={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 Vg(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(go).map(function(s){return s==="MMMM"||s==="MM"||s==="DD"||s==="dddd"?s.slice(1):s}).join(""),this._longDateFormat[e])}var jg="Invalid date";function Jg(){return this._invalidDate}var Qg="%d",Zg=/\d{1,2}/;function Xg(e){return this._ordinal.replace("%d",e)}var e0={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 t0(e,t,n,s){var a=this._relativeTime[n];return wr(a)?a(e,t,n,s):a.replace(/%d/i,e)}function r0(e,t){var n=this._relativeTime[e>0?"future":"past"];return wr(n)?n(t):n.replace(/%s/i,t)}var Rl={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(e){return typeof e=="string"?Rl[e]||Rl[e.toLowerCase()]:void 0}function _o(e){var t={},n,s;for(s in e)Oe(e,s)&&(n=Gt(s),n&&(t[n]=e[s]));return t}var n0={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 i0(e){var t=[],n;for(n in e)Oe(e,n)&&t.push({unit:n,priority:n0[n]});return t.sort(function(s,a){return s.priority-a.priority}),t}var Pl=/\d/,Pt=/\d\d/,Dl=/\d{3}/,wo=/\d{4}/,Es=/[+-]?\d{6}/,He=/\d\d?/,Ml=/\d\d\d\d?/,Ll=/\d\d\d\d\d\d?/,As=/\d{1,3}/,bo=/\d{1,4}/,Os=/[+-]?\d{1,6}/,In=/\d+/,xs=/[+-]?\d+/,s0=/Z|[+-]\d\d:?\d\d/gi,Cs=/Z|[+-]\d\d(?::?\d\d)?/gi,a0=/[+-]?\d+(\.\d{1,3})?/,Ei=/[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,Bn=/^[1-9]\d?/,vo=/^([1-9]\d|\d)/,ks;ks={};function Q(e,t,n){ks[e]=wr(t)?t:function(s,a){return s&&n?n:t}}function o0(e,t){return Oe(ks,e)?ks[e](t._strict,t._locale):new RegExp(u0(e))}function u0(e){return Rr(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,n,s,a,c){return n||s||a||c}))}function Rr(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function zt(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function we(e){var t=+e,n=0;return t!==0&&isFinite(t)&&(n=zt(t)),n}var So={};function Me(e,t){var n,s=t,a;for(typeof e=="string"&&(e=[e]),kr(t)&&(s=function(c,u){u[t]=we(c)}),a=e.length,n=0;n<a;n++)So[e[n]]=s}function Ai(e,t){Me(e,function(n,s,a,c){a._w=a._w||{},t(n,a._w,a,c)})}function c0(e,t,n){t!=null&&Oe(So,e)&&So[e](t,n._a,n,e)}function Rs(e){return e%4===0&&e%100!==0||e%400===0}var ht=0,Pr=1,vr=2,tt=3,ar=4,Dr=5,_n=6,l0=7,f0=8;ne("Y",0,0,function(){var e=this.year();return e<=9999?br(e,4):"+"+e}),ne(0,["YY",2],0,function(){return this.year()%100}),ne(0,["YYYY",4],0,"year"),ne(0,["YYYYY",5],0,"year"),ne(0,["YYYYYY",6,!0],0,"year"),Q("Y",xs),Q("YY",He,Pt),Q("YYYY",bo,wo),Q("YYYYY",Os,Es),Q("YYYYYY",Os,Es),Me(["YYYYY","YYYYYY"],ht),Me("YYYY",function(e,t){t[ht]=e.length===2?V.parseTwoDigitYear(e):we(e)}),Me("YY",function(e,t){t[ht]=V.parseTwoDigitYear(e)}),Me("Y",function(e,t){t[ht]=parseInt(e,10)});function Oi(e){return Rs(e)?366:365}V.parseTwoDigitYear=function(e){return we(e)+(we(e)>68?1900:2e3)};var Nl=Fn("FullYear",!0);function h0(){return Rs(this.year())}function Fn(e,t){return function(n){return n!=null?(Ul(this,e,n),V.updateOffset(this,t),this):xi(this,e)}}function xi(e,t){if(!e.isValid())return NaN;var n=e._d,s=e._isUTC;switch(t){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 Ul(e,t,n){var s,a,c,u,l;if(!(!e.isValid()||isNaN(n))){switch(s=e._d,a=e._isUTC,t){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=e.month(),l=e.date(),l=l===29&&u===1&&!Rs(c)?28:l,a?s.setUTCFullYear(c,u,l):s.setFullYear(c,u,l)}}function d0(e){return e=Gt(e),wr(this[e])?this[e]():this}function p0(e,t){if(typeof e=="object"){e=_o(e);var n=i0(e),s,a=n.length;for(s=0;s<a;s++)this[n[s].unit](e[n[s].unit])}else if(e=Gt(e),wr(this[e]))return this[e](t);return this}function m0(e,t){return(e%t+t)%t}var Qe;Array.prototype.indexOf?Qe=Array.prototype.indexOf:Qe=function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1};function To(e,t){if(isNaN(e)||isNaN(t))return NaN;var n=m0(t,12);return e+=(t-n)/12,n===1?Rs(e)?29:28:31-n%7%2}ne("M",["MM",2],"Mo",function(){return this.month()+1}),ne("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),ne("MMMM",0,0,function(e){return this.localeData().months(this,e)}),Q("M",He,Bn),Q("MM",He,Pt),Q("MMM",function(e,t){return t.monthsShortRegex(e)}),Q("MMMM",function(e,t){return t.monthsRegex(e)}),Me(["M","MM"],function(e,t){t[Pr]=we(e)-1}),Me(["MMM","MMMM"],function(e,t,n,s){var a=n._locale.monthsParse(e,s,n._strict);a!=null?t[Pr]=a:he(n).invalidMonth=e});var g0="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Il="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Bl=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,y0=Ei,_0=Ei;function w0(e,t){return e?ir(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||Bl).test(t)?"format":"standalone"][e.month()]:ir(this._months)?this._months:this._months.standalone}function b0(e,t){return e?ir(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[Bl.test(t)?"format":"standalone"][e.month()]:ir(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function v0(e,t,n){var s,a,c,u=e.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?t==="MMM"?(a=Qe.call(this._shortMonthsParse,u),a!==-1?a:null):(a=Qe.call(this._longMonthsParse,u),a!==-1?a:null):t==="MMM"?(a=Qe.call(this._shortMonthsParse,u),a!==-1?a:(a=Qe.call(this._longMonthsParse,u),a!==-1?a:null)):(a=Qe.call(this._longMonthsParse,u),a!==-1?a:(a=Qe.call(this._shortMonthsParse,u),a!==-1?a:null))}function S0(e,t,n){var s,a,c;if(this._monthsParseExact)return v0.call(this,e,t,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&&t==="MMMM"&&this._longMonthsParse[s].test(e))return s;if(n&&t==="MMM"&&this._shortMonthsParse[s].test(e))return s;if(!n&&this._monthsParse[s].test(e))return s}}function Fl(e,t){if(!e.isValid())return e;if(typeof t=="string"){if(/^\d+$/.test(t))t=we(t);else if(t=e.localeData().monthsParse(t),!kr(t))return e}var n=t,s=e.date();return s=s<29?s:Math.min(s,To(e.year(),n)),e._isUTC?e._d.setUTCMonth(n,s):e._d.setMonth(n,s),e}function Wl(e){return e!=null?(Fl(this,e),V.updateOffset(this,!0),this):xi(this,"Month")}function T0(){return To(this.year(),this.month())}function E0(e){return this._monthsParseExact?(Oe(this,"_monthsRegex")||Hl.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(Oe(this,"_monthsShortRegex")||(this._monthsShortRegex=y0),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)}function A0(e){return this._monthsParseExact?(Oe(this,"_monthsRegex")||Hl.call(this),e?this._monthsStrictRegex:this._monthsRegex):(Oe(this,"_monthsRegex")||(this._monthsRegex=_0),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)}function Hl(){function e(h,m){return m.length-h.length}var t=[],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,"")),t.push(u),n.push(l),s.push(l),s.push(u);t.sort(e),n.sort(e),s.sort(e),this._monthsRegex=new RegExp("^("+s.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+t.join("|")+")","i")}function O0(e,t,n,s,a,c,u){var l;return e<100&&e>=0?(l=new Date(e+400,t,n,s,a,c,u),isFinite(l.getFullYear())&&l.setFullYear(e)):l=new Date(e,t,n,s,a,c,u),l}function Ci(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 Ps(e,t,n){var s=7+t-n,a=(7+Ci(e,0,s).getUTCDay()-t)%7;return-a+s-1}function Yl(e,t,n,s,a){var c=(7+n-s)%7,u=Ps(e,s,a),l=1+7*(t-1)+c+u,h,m;return l<=0?(h=e-1,m=Oi(h)+l):l>Oi(e)?(h=e+1,m=l-Oi(e)):(h=e,m=l),{year:h,dayOfYear:m}}function ki(e,t,n){var s=Ps(e.year(),t,n),a=Math.floor((e.dayOfYear()-s-1)/7)+1,c,u;return a<1?(u=e.year()-1,c=a+Mr(u,t,n)):a>Mr(e.year(),t,n)?(c=a-Mr(e.year(),t,n),u=e.year()+1):(u=e.year(),c=a),{week:c,year:u}}function Mr(e,t,n){var s=Ps(e,t,n),a=Ps(e+1,t,n);return(Oi(e)-s+a)/7}ne("w",["ww",2],"wo","week"),ne("W",["WW",2],"Wo","isoWeek"),Q("w",He,Bn),Q("ww",He,Pt),Q("W",He,Bn),Q("WW",He,Pt),Ai(["w","ww","W","WW"],function(e,t,n,s){t[s.substr(0,1)]=we(e)});function x0(e){return ki(e,this._week.dow,this._week.doy).week}var C0={dow:0,doy:6};function k0(){return this._week.dow}function R0(){return this._week.doy}function P0(e){var t=this.localeData().week(this);return e==null?t:this.add((e-t)*7,"d")}function D0(e){var t=ki(this,1,4).week;return e==null?t:this.add((e-t)*7,"d")}ne("d",0,"do","day"),ne("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),ne("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),ne("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),ne("e",0,0,"weekday"),ne("E",0,0,"isoWeekday"),Q("d",He),Q("e",He),Q("E",He),Q("dd",function(e,t){return t.weekdaysMinRegex(e)}),Q("ddd",function(e,t){return t.weekdaysShortRegex(e)}),Q("dddd",function(e,t){return t.weekdaysRegex(e)}),Ai(["dd","ddd","dddd"],function(e,t,n,s){var a=n._locale.weekdaysParse(e,s,n._strict);a!=null?t.d=a:he(n).invalidWeekday=e}),Ai(["d","e","E"],function(e,t,n,s){t[s]=we(e)});function M0(e,t){return typeof e!="string"?e:isNaN(e)?(e=t.weekdaysParse(e),typeof e=="number"?e:null):parseInt(e,10)}function L0(e,t){return typeof e=="string"?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function Eo(e,t){return e.slice(t,7).concat(e.slice(0,t))}var N0="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Kl="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),U0="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),I0=Ei,B0=Ei,F0=Ei;function W0(e,t){var n=ir(this._weekdays)?this._weekdays:this._weekdays[e&&e!==!0&&this._weekdays.isFormat.test(t)?"format":"standalone"];return e===!0?Eo(n,this._week.dow):e?n[e.day()]:n}function H0(e){return e===!0?Eo(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function Y0(e){return e===!0?Eo(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function K0(e,t,n){var s,a,c,u=e.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?t==="dddd"?(a=Qe.call(this._weekdaysParse,u),a!==-1?a:null):t==="ddd"?(a=Qe.call(this._shortWeekdaysParse,u),a!==-1?a:null):(a=Qe.call(this._minWeekdaysParse,u),a!==-1?a:null):t==="dddd"?(a=Qe.call(this._weekdaysParse,u),a!==-1||(a=Qe.call(this._shortWeekdaysParse,u),a!==-1)?a:(a=Qe.call(this._minWeekdaysParse,u),a!==-1?a:null)):t==="ddd"?(a=Qe.call(this._shortWeekdaysParse,u),a!==-1||(a=Qe.call(this._weekdaysParse,u),a!==-1)?a:(a=Qe.call(this._minWeekdaysParse,u),a!==-1?a:null)):(a=Qe.call(this._minWeekdaysParse,u),a!==-1||(a=Qe.call(this._weekdaysParse,u),a!==-1)?a:(a=Qe.call(this._shortWeekdaysParse,u),a!==-1?a:null))}function q0(e,t,n){var s,a,c;if(this._weekdaysParseExact)return K0.call(this,e,t,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&&t==="dddd"&&this._fullWeekdaysParse[s].test(e))return s;if(n&&t==="ddd"&&this._shortWeekdaysParse[s].test(e))return s;if(n&&t==="dd"&&this._minWeekdaysParse[s].test(e))return s;if(!n&&this._weekdaysParse[s].test(e))return s}}function $0(e){if(!this.isValid())return e!=null?this:NaN;var t=xi(this,"Day");return e!=null?(e=M0(e,this.localeData()),this.add(e-t,"d")):t}function G0(e){if(!this.isValid())return e!=null?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return e==null?t:this.add(e-t,"d")}function z0(e){if(!this.isValid())return e!=null?this:NaN;if(e!=null){var t=L0(e,this.localeData());return this.day(this.day()%7?t:t-7)}else return this.day()||7}function V0(e){return this._weekdaysParseExact?(Oe(this,"_weekdaysRegex")||Ao.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(Oe(this,"_weekdaysRegex")||(this._weekdaysRegex=I0),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function j0(e){return this._weekdaysParseExact?(Oe(this,"_weekdaysRegex")||Ao.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(Oe(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=B0),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function J0(e){return this._weekdaysParseExact?(Oe(this,"_weekdaysRegex")||Ao.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(Oe(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=F0),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Ao(){function e(b,T){return T.length-b.length}var t=[],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,"")),t.push(l),n.push(h),s.push(m),a.push(l),a.push(h),a.push(m);t.sort(e),n.sort(e),s.sort(e),a.sort(e),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("^("+t.join("|")+")","i")}function Oo(){return this.hours()%12||12}function Q0(){return this.hours()||24}ne("H",["HH",2],0,"hour"),ne("h",["hh",2],0,Oo),ne("k",["kk",2],0,Q0),ne("hmm",0,0,function(){return""+Oo.apply(this)+br(this.minutes(),2)}),ne("hmmss",0,0,function(){return""+Oo.apply(this)+br(this.minutes(),2)+br(this.seconds(),2)}),ne("Hmm",0,0,function(){return""+this.hours()+br(this.minutes(),2)}),ne("Hmmss",0,0,function(){return""+this.hours()+br(this.minutes(),2)+br(this.seconds(),2)});function ql(e,t){ne(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}ql("a",!0),ql("A",!1);function $l(e,t){return t._meridiemParse}Q("a",$l),Q("A",$l),Q("H",He,vo),Q("h",He,Bn),Q("k",He,Bn),Q("HH",He,Pt),Q("hh",He,Pt),Q("kk",He,Pt),Q("hmm",Ml),Q("hmmss",Ll),Q("Hmm",Ml),Q("Hmmss",Ll),Me(["H","HH"],tt),Me(["k","kk"],function(e,t,n){var s=we(e);t[tt]=s===24?0:s}),Me(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),Me(["h","hh"],function(e,t,n){t[tt]=we(e),he(n).bigHour=!0}),Me("hmm",function(e,t,n){var s=e.length-2;t[tt]=we(e.substr(0,s)),t[ar]=we(e.substr(s)),he(n).bigHour=!0}),Me("hmmss",function(e,t,n){var s=e.length-4,a=e.length-2;t[tt]=we(e.substr(0,s)),t[ar]=we(e.substr(s,2)),t[Dr]=we(e.substr(a)),he(n).bigHour=!0}),Me("Hmm",function(e,t,n){var s=e.length-2;t[tt]=we(e.substr(0,s)),t[ar]=we(e.substr(s))}),Me("Hmmss",function(e,t,n){var s=e.length-4,a=e.length-2;t[tt]=we(e.substr(0,s)),t[ar]=we(e.substr(s,2)),t[Dr]=we(e.substr(a))});function Z0(e){return(e+"").toLowerCase().charAt(0)==="p"}var X0=/[ap]\.?m?\.?/i,ey=Fn("Hours",!0);function ty(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"}var Gl={calendar:Kg,longDateFormat:zg,invalidDate:jg,ordinal:Qg,dayOfMonthOrdinalParse:Zg,relativeTime:e0,months:g0,monthsShort:Il,week:C0,weekdays:N0,weekdaysMin:U0,weekdaysShort:Kl,meridiemParse:X0},qe={},Ri={},Pi;function ry(e,t){var n,s=Math.min(e.length,t.length);for(n=0;n<s;n+=1)if(e[n]!==t[n])return n;return s}function zl(e){return e&&e.toLowerCase().replace("_","-")}function ny(e){for(var t=0,n,s,a,c;t<e.length;){for(c=zl(e[t]).split("-"),n=c.length,s=zl(e[t+1]),s=s?s.split("-"):null;n>0;){if(a=Ds(c.slice(0,n).join("-")),a)return a;if(s&&s.length>=n&&ry(c,s)>=n-1)break;n--}t++}return Pi}function iy(e){return!!(e&&e.match("^[^/\\\\]*$"))}function Ds(e){var t=null,n;if(qe[e]===void 0&&typeof module<"u"&&module&&module.exports&&iy(e))try{t=Pi._abbr,n=require,n("./locale/"+e),en(t)}catch{qe[e]=null}return qe[e]}function en(e,t){var n;return e&&(At(t)?n=Lr(e):n=xo(e,t),n?Pi=n:typeof console<"u"&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),Pi._abbr}function xo(e,t){if(t!==null){var n,s=Gl;if(t.abbr=e,qe[e]!=null)Cl("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=qe[e]._config;else if(t.parentLocale!=null)if(qe[t.parentLocale]!=null)s=qe[t.parentLocale]._config;else if(n=Ds(t.parentLocale),n!=null)s=n._config;else return Ri[t.parentLocale]||(Ri[t.parentLocale]=[]),Ri[t.parentLocale].push({name:e,config:t}),null;return qe[e]=new po(ho(s,t)),Ri[e]&&Ri[e].forEach(function(a){xo(a.name,a.config)}),en(e),qe[e]}else return delete qe[e],null}function sy(e,t){if(t!=null){var n,s,a=Gl;qe[e]!=null&&qe[e].parentLocale!=null?qe[e].set(ho(qe[e]._config,t)):(s=Ds(e),s!=null&&(a=s._config),t=ho(a,t),s==null&&(t.abbr=e),n=new po(t),n.parentLocale=qe[e],qe[e]=n),en(e)}else qe[e]!=null&&(qe[e].parentLocale!=null?(qe[e]=qe[e].parentLocale,e===en()&&en(e)):qe[e]!=null&&delete qe[e]);return qe[e]}function Lr(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return Pi;if(!ir(e)){if(t=Ds(e),t)return t;e=[e]}return ny(e)}function ay(){return mo(qe)}function Co(e){var t,n=e._a;return n&&he(e).overflow===-2&&(t=n[Pr]<0||n[Pr]>11?Pr:n[vr]<1||n[vr]>To(n[ht],n[Pr])?vr:n[tt]<0||n[tt]>24||n[tt]===24&&(n[ar]!==0||n[Dr]!==0||n[_n]!==0)?tt:n[ar]<0||n[ar]>59?ar:n[Dr]<0||n[Dr]>59?Dr:n[_n]<0||n[_n]>999?_n:-1,he(e)._overflowDayOfYear&&(t<ht||t>vr)&&(t=vr),he(e)._overflowWeeks&&t===-1&&(t=l0),he(e)._overflowWeekday&&t===-1&&(t=f0),he(e).overflow=t),e}var oy=/^\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)?)?$/,uy=/^\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)?)?$/,cy=/Z|[+-]\d\d(?::?\d\d)?/,Ms=[["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]],ko=[["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/]],ly=/^\/?Date\((-?\d+)/i,fy=/^(?:(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}))$/,hy={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Vl(e){var t,n,s=e._i,a=oy.exec(s)||uy.exec(s),c,u,l,h,m=Ms.length,b=ko.length;if(a){for(he(e).iso=!0,t=0,n=m;t<n;t++)if(Ms[t][1].exec(a[1])){u=Ms[t][0],c=Ms[t][2]!==!1;break}if(u==null){e._isValid=!1;return}if(a[3]){for(t=0,n=b;t<n;t++)if(ko[t][1].exec(a[3])){l=(a[2]||" ")+ko[t][0];break}if(l==null){e._isValid=!1;return}}if(!c&&l!=null){e._isValid=!1;return}if(a[4])if(cy.exec(a[4]))h="Z";else{e._isValid=!1;return}e._f=u+(l||"")+(h||""),Po(e)}else e._isValid=!1}function dy(e,t,n,s,a,c){var u=[py(e),Il.indexOf(t),parseInt(n,10),parseInt(s,10),parseInt(a,10)];return c&&u.push(parseInt(c,10)),u}function py(e){var t=parseInt(e,10);return t<=49?2e3+t:t<=999?1900+t:t}function my(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function gy(e,t,n){if(e){var s=Kl.indexOf(e),a=new Date(t[0],t[1],t[2]).getDay();if(s!==a)return he(n).weekdayMismatch=!0,n._isValid=!1,!1}return!0}function yy(e,t,n){if(e)return hy[e];if(t)return 0;var s=parseInt(n,10),a=s%100,c=(s-a)/100;return c*60+a}function jl(e){var t=fy.exec(my(e._i)),n;if(t){if(n=dy(t[4],t[3],t[2],t[5],t[6],t[7]),!gy(t[1],n,e))return;e._a=n,e._tzm=yy(t[8],t[9],t[10]),e._d=Ci.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),he(e).rfc2822=!0}else e._isValid=!1}function _y(e){var t=ly.exec(e._i);if(t!==null){e._d=new Date(+t[1]);return}if(Vl(e),e._isValid===!1)delete e._isValid;else return;if(jl(e),e._isValid===!1)delete e._isValid;else return;e._strict?e._isValid=!1:V.createFromInputFallback(e)}V.createFromInputFallback=$t("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 Wn(e,t,n){return e??t??n}function wy(e){var t=new Date(V.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function Ro(e){var t,n,s=[],a,c,u;if(!e._d){for(a=wy(e),e._w&&e._a[vr]==null&&e._a[Pr]==null&&by(e),e._dayOfYear!=null&&(u=Wn(e._a[ht],a[ht]),(e._dayOfYear>Oi(u)||e._dayOfYear===0)&&(he(e)._overflowDayOfYear=!0),n=Ci(u,0,e._dayOfYear),e._a[Pr]=n.getUTCMonth(),e._a[vr]=n.getUTCDate()),t=0;t<3&&e._a[t]==null;++t)e._a[t]=s[t]=a[t];for(;t<7;t++)e._a[t]=s[t]=e._a[t]==null?t===2?1:0:e._a[t];e._a[tt]===24&&e._a[ar]===0&&e._a[Dr]===0&&e._a[_n]===0&&(e._nextDay=!0,e._a[tt]=0),e._d=(e._useUTC?Ci:O0).apply(null,s),c=e._useUTC?e._d.getUTCDay():e._d.getDay(),e._tzm!=null&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[tt]=24),e._w&&typeof e._w.d<"u"&&e._w.d!==c&&(he(e).weekdayMismatch=!0)}}function by(e){var t,n,s,a,c,u,l,h,m;t=e._w,t.GG!=null||t.W!=null||t.E!=null?(c=1,u=4,n=Wn(t.GG,e._a[ht],ki(Ye(),1,4).year),s=Wn(t.W,1),a=Wn(t.E,1),(a<1||a>7)&&(h=!0)):(c=e._locale._week.dow,u=e._locale._week.doy,m=ki(Ye(),c,u),n=Wn(t.gg,e._a[ht],m.year),s=Wn(t.w,m.week),t.d!=null?(a=t.d,(a<0||a>6)&&(h=!0)):t.e!=null?(a=t.e+c,(t.e<0||t.e>6)&&(h=!0)):a=c),s<1||s>Mr(n,c,u)?he(e)._overflowWeeks=!0:h!=null?he(e)._overflowWeekday=!0:(l=Yl(n,s,a,c,u),e._a[ht]=l.year,e._dayOfYear=l.dayOfYear)}V.ISO_8601=function(){},V.RFC_2822=function(){};function Po(e){if(e._f===V.ISO_8601){Vl(e);return}if(e._f===V.RFC_2822){jl(e);return}e._a=[],he(e).empty=!0;var t=""+e._i,n,s,a,c,u,l=t.length,h=0,m,b;for(a=kl(e._f,e._locale).match(go)||[],b=a.length,n=0;n<b;n++)c=a[n],s=(t.match(o0(c,e))||[])[0],s&&(u=t.substr(0,t.indexOf(s)),u.length>0&&he(e).unusedInput.push(u),t=t.slice(t.indexOf(s)+s.length),h+=s.length),Un[c]?(s?he(e).empty=!1:he(e).unusedTokens.push(c),c0(c,s,e)):e._strict&&!s&&he(e).unusedTokens.push(c);he(e).charsLeftOver=l-h,t.length>0&&he(e).unusedInput.push(t),e._a[tt]<=12&&he(e).bigHour===!0&&e._a[tt]>0&&(he(e).bigHour=void 0),he(e).parsedDateParts=e._a.slice(0),he(e).meridiem=e._meridiem,e._a[tt]=vy(e._locale,e._a[tt],e._meridiem),m=he(e).era,m!==null&&(e._a[ht]=e._locale.erasConvertYear(m,e._a[ht])),Ro(e),Co(e)}function vy(e,t,n){var s;return n==null?t:e.meridiemHour!=null?e.meridiemHour(t,n):(e.isPM!=null&&(s=e.isPM(n),s&&t<12&&(t+=12),!s&&t===12&&(t=0)),t)}function Sy(e){var t,n,s,a,c,u,l=!1,h=e._f.length;if(h===0){he(e).invalidFormat=!0,e._d=new Date(NaN);return}for(a=0;a<h;a++)c=0,u=!1,t=fo({},e),e._useUTC!=null&&(t._useUTC=e._useUTC),t._f=e._f[a],Po(t),co(t)&&(u=!0),c+=he(t).charsLeftOver,c+=he(t).unusedTokens.length*10,he(t).score=c,l?c<s&&(s=c,n=t):(s==null||c<s||u)&&(s=c,n=t,u&&(l=!0));Xr(e,n||t)}function Ty(e){if(!e._d){var t=_o(e._i),n=t.day===void 0?t.date:t.day;e._a=El([t.year,t.month,n,t.hour,t.minute,t.second,t.millisecond],function(s){return s&&parseInt(s,10)}),Ro(e)}}function Ey(e){var t=new Ti(Co(Jl(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function Jl(e){var t=e._i,n=e._f;return e._locale=e._locale||Lr(e._l),t===null||n===void 0&&t===""?vs({nullInput:!0}):(typeof t=="string"&&(e._i=t=e._locale.preparse(t)),sr(t)?new Ti(Co(t)):(Si(t)?e._d=t:ir(n)?Sy(e):n?Po(e):Ay(e),co(e)||(e._d=null),e))}function Ay(e){var t=e._i;At(t)?e._d=new Date(V.now()):Si(t)?e._d=new Date(t.valueOf()):typeof t=="string"?_y(e):ir(t)?(e._a=El(t.slice(0),function(n){return parseInt(n,10)}),Ro(e)):yn(t)?Ty(e):kr(t)?e._d=new Date(t):V.createFromInputFallback(e)}function Ql(e,t,n,s,a){var c={};return(t===!0||t===!1)&&(s=t,t=void 0),(n===!0||n===!1)&&(s=n,n=void 0),(yn(e)&&oo(e)||ir(e)&&e.length===0)&&(e=void 0),c._isAMomentObject=!0,c._useUTC=c._isUTC=a,c._l=n,c._i=e,c._f=t,c._strict=s,Ey(c)}function Ye(e,t,n,s){return Ql(e,t,n,s,!1)}var Oy=$t("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Ye.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:vs()}),xy=$t("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Ye.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:vs()});function Zl(e,t){var n,s;if(t.length===1&&ir(t[0])&&(t=t[0]),!t.length)return Ye();for(n=t[0],s=1;s<t.length;++s)(!t[s].isValid()||t[s][e](n))&&(n=t[s]);return n}function Cy(){var e=[].slice.call(arguments,0);return Zl("isBefore",e)}function ky(){var e=[].slice.call(arguments,0);return Zl("isAfter",e)}var Ry=function(){return Date.now?Date.now():+new Date},Di=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Py(e){var t,n=!1,s,a=Di.length;for(t in e)if(Oe(e,t)&&!(Qe.call(Di,t)!==-1&&(e[t]==null||!isNaN(e[t]))))return!1;for(s=0;s<a;++s)if(e[Di[s]]){if(n)return!1;parseFloat(e[Di[s]])!==we(e[Di[s]])&&(n=!0)}return!0}function Dy(){return this._isValid}function My(){return or(NaN)}function Ls(e){var t=_o(e),n=t.year||0,s=t.quarter||0,a=t.month||0,c=t.week||t.isoWeek||0,u=t.day||0,l=t.hour||0,h=t.minute||0,m=t.second||0,b=t.millisecond||0;this._isValid=Py(t),this._milliseconds=+b+m*1e3+h*6e4+l*1e3*60*60,this._days=+u+c*7,this._months=+a+s*3+n*12,this._data={},this._locale=Lr(),this._bubble()}function Ns(e){return e instanceof Ls}function Do(e){return e<0?Math.round(-1*e)*-1:Math.round(e)}function Ly(e,t,n){var s=Math.min(e.length,t.length),a=Math.abs(e.length-t.length),c=0,u;for(u=0;u<s;u++)we(e[u])!==we(t[u])&&c++;return c+a}function Xl(e,t){ne(e,0,0,function(){var n=this.utcOffset(),s="+";return n<0&&(n=-n,s="-"),s+br(~~(n/60),2)+t+br(~~n%60,2)})}Xl("Z",":"),Xl("ZZ",""),Q("Z",Cs),Q("ZZ",Cs),Me(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=Mo(Cs,e)});var Ny=/([\+\-]|\d\d)/gi;function Mo(e,t){var n=(t||"").match(e),s,a,c;return n===null?null:(s=n[n.length-1]||[],a=(s+"").match(Ny)||["-",0,0],c=+(a[1]*60)+we(a[2]),c===0?0:a[0]==="+"?c:-c)}function Lo(e,t){var n,s;return t._isUTC?(n=t.clone(),s=(sr(e)||Si(e)?e.valueOf():Ye(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+s),V.updateOffset(n,!1),n):Ye(e).local()}function No(e){return-Math.round(e._d.getTimezoneOffset())}V.updateOffset=function(){};function Uy(e,t,n){var s=this._offset||0,a;if(!this.isValid())return e!=null?this:NaN;if(e!=null){if(typeof e=="string"){if(e=Mo(Cs,e),e===null)return this}else Math.abs(e)<16&&!n&&(e=e*60);return!this._isUTC&&t&&(a=No(this)),this._offset=e,this._isUTC=!0,a!=null&&this.add(a,"m"),s!==e&&(!t||this._changeInProgress?nf(this,or(e-s,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,V.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?s:No(this)}function Iy(e,t){return e!=null?(typeof e!="string"&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}function By(e){return this.utcOffset(0,e)}function Fy(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(No(this),"m")),this}function Wy(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var e=Mo(s0,this._i);e!=null?this.utcOffset(e):this.utcOffset(0,!0)}return this}function Hy(e){return this.isValid()?(e=e?Ye(e).utcOffset():0,(this.utcOffset()-e)%60===0):!1}function Yy(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Ky(){if(!At(this._isDSTShifted))return this._isDSTShifted;var e={},t;return fo(e,this),e=Jl(e),e._a?(t=e._isUTC?_r(e._a):Ye(e._a),this._isDSTShifted=this.isValid()&&Ly(e._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function qy(){return this.isValid()?!this._isUTC:!1}function $y(){return this.isValid()?this._isUTC:!1}function ef(){return this.isValid()?this._isUTC&&this._offset===0:!1}var Gy=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,zy=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function or(e,t){var n=e,s=null,a,c,u;return Ns(e)?n={ms:e._milliseconds,d:e._days,M:e._months}:kr(e)||!isNaN(+e)?(n={},t?n[t]=+e:n.milliseconds=+e):(s=Gy.exec(e))?(a=s[1]==="-"?-1:1,n={y:0,d:we(s[vr])*a,h:we(s[tt])*a,m:we(s[ar])*a,s:we(s[Dr])*a,ms:we(Do(s[_n]*1e3))*a}):(s=zy.exec(e))?(a=s[1]==="-"?-1:1,n={y:wn(s[2],a),M:wn(s[3],a),w:wn(s[4],a),d:wn(s[5],a),h:wn(s[6],a),m:wn(s[7],a),s:wn(s[8],a)}):n==null?n={}:typeof n=="object"&&("from"in n||"to"in n)&&(u=Vy(Ye(n.from),Ye(n.to)),n={},n.ms=u.milliseconds,n.M=u.months),c=new Ls(n),Ns(e)&&Oe(e,"_locale")&&(c._locale=e._locale),Ns(e)&&Oe(e,"_isValid")&&(c._isValid=e._isValid),c}or.fn=Ls.prototype,or.invalid=My;function wn(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function tf(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 Vy(e,t){var n;return e.isValid()&&t.isValid()?(t=Lo(t,e),e.isBefore(t)?n=tf(e,t):(n=tf(t,e),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function rf(e,t){return function(n,s){var a,c;return s!==null&&!isNaN(+s)&&(Cl(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."),c=n,n=s,s=c),a=or(n,s),nf(this,a,e),this}}function nf(e,t,n,s){var a=t._milliseconds,c=Do(t._days),u=Do(t._months);e.isValid()&&(s=s??!0,u&&Fl(e,xi(e,"Month")+u*n),c&&Ul(e,"Date",xi(e,"Date")+c*n),a&&e._d.setTime(e._d.valueOf()+a*n),s&&V.updateOffset(e,c||u))}var jy=rf(1,"add"),Jy=rf(-1,"subtract");function sf(e){return typeof e=="string"||e instanceof String}function Qy(e){return sr(e)||Si(e)||sf(e)||kr(e)||Xy(e)||Zy(e)||e===null||e===void 0}function Zy(e){var t=yn(e)&&!oo(e),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||Oe(e,c);return t&&n}function Xy(e){var t=ir(e),n=!1;return t&&(n=e.filter(function(s){return!kr(s)&&sf(e)}).length===0),t&&n}function e_(e){var t=yn(e)&&!oo(e),n=!1,s=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],a,c;for(a=0;a<s.length;a+=1)c=s[a],n=n||Oe(e,c);return t&&n}function t_(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 r_(e,t){arguments.length===1&&(arguments[0]?Qy(arguments[0])?(e=arguments[0],t=void 0):e_(arguments[0])&&(t=arguments[0],e=void 0):(e=void 0,t=void 0));var n=e||Ye(),s=Lo(n,this).startOf("day"),a=V.calendarFormat(this,s)||"sameElse",c=t&&(wr(t[a])?t[a].call(this,n):t[a]);return this.format(c||this.localeData().calendar(a,this,Ye(n)))}function n_(){return new Ti(this)}function i_(e,t){var n=sr(e)?e:Ye(e);return this.isValid()&&n.isValid()?(t=Gt(t)||"millisecond",t==="millisecond"?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf()):!1}function s_(e,t){var n=sr(e)?e:Ye(e);return this.isValid()&&n.isValid()?(t=Gt(t)||"millisecond",t==="millisecond"?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf()):!1}function a_(e,t,n,s){var a=sr(e)?e:Ye(e),c=sr(t)?t:Ye(t);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 o_(e,t){var n=sr(e)?e:Ye(e),s;return this.isValid()&&n.isValid()?(t=Gt(t)||"millisecond",t==="millisecond"?this.valueOf()===n.valueOf():(s=n.valueOf(),this.clone().startOf(t).valueOf()<=s&&s<=this.clone().endOf(t).valueOf())):!1}function u_(e,t){return this.isSame(e,t)||this.isAfter(e,t)}function c_(e,t){return this.isSame(e,t)||this.isBefore(e,t)}function l_(e,t,n){var s,a,c;if(!this.isValid())return NaN;if(s=Lo(e,this),!s.isValid())return NaN;switch(a=(s.utcOffset()-this.utcOffset())*6e4,t=Gt(t),t){case"year":c=Us(this,s)/12;break;case"month":c=Us(this,s);break;case"quarter":c=Us(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 Us(e,t){if(e.date()<t.date())return-Us(t,e);var n=(t.year()-e.year())*12+(t.month()-e.month()),s=e.clone().add(n,"months"),a,c;return t-s<0?(a=e.clone().add(n-1,"months"),c=(t-s)/(s-a)):(a=e.clone().add(n+1,"months"),c=(t-s)/(a-s)),-(n+c)||0}V.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",V.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function f_(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function h_(e){if(!this.isValid())return null;var t=e!==!0,n=t?this.clone().utc():this;return n.year()<0||n.year()>9999?Ts(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):wr(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",Ts(n,"Z")):Ts(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function d_(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="",n,s,a,c;return this.isLocal()||(e=this.utcOffset()===0?"moment.utc":"moment.parseZone",t="Z"),n="["+e+'("]',s=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",a="-MM-DD[T]HH:mm:ss.SSS",c=t+'[")]',this.format(n+s+a+c)}function p_(e){e||(e=this.isUtc()?V.defaultFormatUtc:V.defaultFormat);var t=Ts(this,e);return this.localeData().postformat(t)}function m_(e,t){return this.isValid()&&(sr(e)&&e.isValid()||Ye(e).isValid())?or({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function g_(e){return this.from(Ye(),e)}function y_(e,t){return this.isValid()&&(sr(e)&&e.isValid()||Ye(e).isValid())?or({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function __(e){return this.to(Ye(),e)}function af(e){var t;return e===void 0?this._locale._abbr:(t=Lr(e),t!=null&&(this._locale=t),this)}var of=$t("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 uf(){return this._locale}var Is=1e3,Hn=60*Is,Bs=60*Hn,cf=(365*400+97)*24*Bs;function Yn(e,t){return(e%t+t)%t}function lf(e,t,n){return e<100&&e>=0?new Date(e+400,t,n)-cf:new Date(e,t,n).valueOf()}function ff(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-cf:Date.UTC(e,t,n)}function w_(e){var t,n;if(e=Gt(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?ff:lf,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-=Yn(t+(this._isUTC?0:this.utcOffset()*Hn),Bs);break;case"minute":t=this._d.valueOf(),t-=Yn(t,Hn);break;case"second":t=this._d.valueOf(),t-=Yn(t,Is);break}return this._d.setTime(t),V.updateOffset(this,!0),this}function b_(e){var t,n;if(e=Gt(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?ff:lf,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+=Bs-Yn(t+(this._isUTC?0:this.utcOffset()*Hn),Bs)-1;break;case"minute":t=this._d.valueOf(),t+=Hn-Yn(t,Hn)-1;break;case"second":t=this._d.valueOf(),t+=Is-Yn(t,Is)-1;break}return this._d.setTime(t),V.updateOffset(this,!0),this}function v_(){return this._d.valueOf()-(this._offset||0)*6e4}function S_(){return Math.floor(this.valueOf()/1e3)}function T_(){return new Date(this.valueOf())}function E_(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function A_(){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 O_(){return this.isValid()?this.toISOString():null}function x_(){return co(this)}function C_(){return Xr({},he(this))}function k_(){return he(this).overflow}function R_(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}ne("N",0,0,"eraAbbr"),ne("NN",0,0,"eraAbbr"),ne("NNN",0,0,"eraAbbr"),ne("NNNN",0,0,"eraName"),ne("NNNNN",0,0,"eraNarrow"),ne("y",["y",1],"yo","eraYear"),ne("y",["yy",2],0,"eraYear"),ne("y",["yyy",3],0,"eraYear"),ne("y",["yyyy",4],0,"eraYear"),Q("N",Uo),Q("NN",Uo),Q("NNN",Uo),Q("NNNN",H_),Q("NNNNN",Y_),Me(["N","NN","NNN","NNNN","NNNNN"],function(e,t,n,s){var a=n._locale.erasParse(e,s,n._strict);a?he(n).era=a:he(n).invalidEra=e}),Q("y",In),Q("yy",In),Q("yyy",In),Q("yyyy",In),Q("yo",K_),Me(["y","yy","yyy","yyyy"],ht),Me(["yo"],function(e,t,n,s){var a;n._locale._eraYearOrdinalRegex&&(a=e.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?t[ht]=n._locale.eraYearOrdinalParse(e,a):t[ht]=parseInt(e,10)});function P_(e,t){var n,s,a,c=this._eras||Lr("en")._eras;for(n=0,s=c.length;n<s;++n){switch(typeof c[n].since){case"string":a=V(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=V(c[n].until).startOf("day").valueOf(),c[n].until=a.valueOf();break}}return c}function D_(e,t,n){var s,a,c=this.eras(),u,l,h;for(e=e.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(t){case"N":case"NN":case"NNN":if(l===e)return c[s];break;case"NNNN":if(u===e)return c[s];break;case"NNNNN":if(h===e)return c[s];break}else if([u,l,h].indexOf(e)>=0)return c[s]}function M_(e,t){var n=e.since<=e.until?1:-1;return t===void 0?V(e.since).year():V(e.since).year()+(t-e.offset)*n}function L_(){var e,t,n,s=this.localeData().eras();for(e=0,t=s.length;e<t;++e)if(n=this.clone().startOf("day").valueOf(),s[e].since<=n&&n<=s[e].until||s[e].until<=n&&n<=s[e].since)return s[e].name;return""}function N_(){var e,t,n,s=this.localeData().eras();for(e=0,t=s.length;e<t;++e)if(n=this.clone().startOf("day").valueOf(),s[e].since<=n&&n<=s[e].until||s[e].until<=n&&n<=s[e].since)return s[e].narrow;return""}function U_(){var e,t,n,s=this.localeData().eras();for(e=0,t=s.length;e<t;++e)if(n=this.clone().startOf("day").valueOf(),s[e].since<=n&&n<=s[e].until||s[e].until<=n&&n<=s[e].since)return s[e].abbr;return""}function I_(){var e,t,n,s,a=this.localeData().eras();for(e=0,t=a.length;e<t;++e)if(n=a[e].since<=a[e].until?1:-1,s=this.clone().startOf("day").valueOf(),a[e].since<=s&&s<=a[e].until||a[e].until<=s&&s<=a[e].since)return(this.year()-V(a[e].since).year())*n+a[e].offset;return this.year()}function B_(e){return Oe(this,"_erasNameRegex")||Io.call(this),e?this._erasNameRegex:this._erasRegex}function F_(e){return Oe(this,"_erasAbbrRegex")||Io.call(this),e?this._erasAbbrRegex:this._erasRegex}function W_(e){return Oe(this,"_erasNarrowRegex")||Io.call(this),e?this._erasNarrowRegex:this._erasRegex}function Uo(e,t){return t.erasAbbrRegex(e)}function H_(e,t){return t.erasNameRegex(e)}function Y_(e,t){return t.erasNarrowRegex(e)}function K_(e,t){return t._eraYearOrdinalRegex||In}function Io(){var e=[],t=[],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),t.push(u),e.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("^("+t.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+e.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+n.join("|")+")","i")}ne(0,["gg",2],0,function(){return this.weekYear()%100}),ne(0,["GG",2],0,function(){return this.isoWeekYear()%100});function Fs(e,t){ne(0,[e,e.length],0,t)}Fs("gggg","weekYear"),Fs("ggggg","weekYear"),Fs("GGGG","isoWeekYear"),Fs("GGGGG","isoWeekYear"),Q("G",xs),Q("g",xs),Q("GG",He,Pt),Q("gg",He,Pt),Q("GGGG",bo,wo),Q("gggg",bo,wo),Q("GGGGG",Os,Es),Q("ggggg",Os,Es),Ai(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,s){t[s.substr(0,2)]=we(e)}),Ai(["gg","GG"],function(e,t,n,s){t[s]=V.parseTwoDigitYear(e)});function q_(e){return hf.call(this,e,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function $_(e){return hf.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)}function G_(){return Mr(this.year(),1,4)}function z_(){return Mr(this.isoWeekYear(),1,4)}function V_(){var e=this.localeData()._week;return Mr(this.year(),e.dow,e.doy)}function j_(){var e=this.localeData()._week;return Mr(this.weekYear(),e.dow,e.doy)}function hf(e,t,n,s,a){var c;return e==null?ki(this,s,a).year:(c=Mr(e,s,a),t>c&&(t=c),J_.call(this,e,t,n,s,a))}function J_(e,t,n,s,a){var c=Yl(e,t,n,s,a),u=Ci(c.year,0,c.dayOfYear);return this.year(u.getUTCFullYear()),this.month(u.getUTCMonth()),this.date(u.getUTCDate()),this}ne("Q",0,"Qo","quarter"),Q("Q",Pl),Me("Q",function(e,t){t[Pr]=(we(e)-1)*3});function Q_(e){return e==null?Math.ceil((this.month()+1)/3):this.month((e-1)*3+this.month()%3)}ne("D",["DD",2],"Do","date"),Q("D",He,Bn),Q("DD",He,Pt),Q("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),Me(["D","DD"],vr),Me("Do",function(e,t){t[vr]=we(e.match(He)[0])});var df=Fn("Date",!0);ne("DDD",["DDDD",3],"DDDo","dayOfYear"),Q("DDD",As),Q("DDDD",Dl),Me(["DDD","DDDD"],function(e,t,n){n._dayOfYear=we(e)});function Z_(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return e==null?t:this.add(e-t,"d")}ne("m",["mm",2],0,"minute"),Q("m",He,vo),Q("mm",He,Pt),Me(["m","mm"],ar);var X_=Fn("Minutes",!1);ne("s",["ss",2],0,"second"),Q("s",He,vo),Q("ss",He,Pt),Me(["s","ss"],Dr);var ew=Fn("Seconds",!1);ne("S",0,0,function(){return~~(this.millisecond()/100)}),ne(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),ne(0,["SSS",3],0,"millisecond"),ne(0,["SSSS",4],0,function(){return this.millisecond()*10}),ne(0,["SSSSS",5],0,function(){return this.millisecond()*100}),ne(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),ne(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),ne(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),ne(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),Q("S",As,Pl),Q("SS",As,Pt),Q("SSS",As,Dl);var tn,pf;for(tn="SSSS";tn.length<=9;tn+="S")Q(tn,In);function tw(e,t){t[_n]=we(("0."+e)*1e3)}for(tn="S";tn.length<=9;tn+="S")Me(tn,tw);pf=Fn("Milliseconds",!1),ne("z",0,0,"zoneAbbr"),ne("zz",0,0,"zoneName");function rw(){return this._isUTC?"UTC":""}function nw(){return this._isUTC?"Coordinated Universal Time":""}var z=Ti.prototype;z.add=jy,z.calendar=r_,z.clone=n_,z.diff=l_,z.endOf=b_,z.format=p_,z.from=m_,z.fromNow=g_,z.to=y_,z.toNow=__,z.get=d0,z.invalidAt=k_,z.isAfter=i_,z.isBefore=s_,z.isBetween=a_,z.isSame=o_,z.isSameOrAfter=u_,z.isSameOrBefore=c_,z.isValid=x_,z.lang=of,z.locale=af,z.localeData=uf,z.max=xy,z.min=Oy,z.parsingFlags=C_,z.set=p0,z.startOf=w_,z.subtract=Jy,z.toArray=E_,z.toObject=A_,z.toDate=T_,z.toISOString=h_,z.inspect=d_,typeof Symbol<"u"&&Symbol.for!=null&&(z[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),z.toJSON=O_,z.toString=f_,z.unix=S_,z.valueOf=v_,z.creationData=R_,z.eraName=L_,z.eraNarrow=N_,z.eraAbbr=U_,z.eraYear=I_,z.year=Nl,z.isLeapYear=h0,z.weekYear=q_,z.isoWeekYear=$_,z.quarter=z.quarters=Q_,z.month=Wl,z.daysInMonth=T0,z.week=z.weeks=P0,z.isoWeek=z.isoWeeks=D0,z.weeksInYear=V_,z.weeksInWeekYear=j_,z.isoWeeksInYear=G_,z.isoWeeksInISOWeekYear=z_,z.date=df,z.day=z.days=$0,z.weekday=G0,z.isoWeekday=z0,z.dayOfYear=Z_,z.hour=z.hours=ey,z.minute=z.minutes=X_,z.second=z.seconds=ew,z.millisecond=z.milliseconds=pf,z.utcOffset=Uy,z.utc=By,z.local=Fy,z.parseZone=Wy,z.hasAlignedHourOffset=Hy,z.isDST=Yy,z.isLocal=qy,z.isUtcOffset=$y,z.isUtc=ef,z.isUTC=ef,z.zoneAbbr=rw,z.zoneName=nw,z.dates=$t("dates accessor is deprecated. Use date instead.",df),z.months=$t("months accessor is deprecated. Use month instead",Wl),z.years=$t("years accessor is deprecated. Use year instead",Nl),z.zone=$t("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Iy),z.isDSTShifted=$t("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Ky);function iw(e){return Ye(e*1e3)}function sw(){return Ye.apply(null,arguments).parseZone()}function mf(e){return e}var xe=po.prototype;xe.calendar=qg,xe.longDateFormat=Vg,xe.invalidDate=Jg,xe.ordinal=Xg,xe.preparse=mf,xe.postformat=mf,xe.relativeTime=t0,xe.pastFuture=r0,xe.set=Yg,xe.eras=P_,xe.erasParse=D_,xe.erasConvertYear=M_,xe.erasAbbrRegex=F_,xe.erasNameRegex=B_,xe.erasNarrowRegex=W_,xe.months=w0,xe.monthsShort=b0,xe.monthsParse=S0,xe.monthsRegex=A0,xe.monthsShortRegex=E0,xe.week=x0,xe.firstDayOfYear=R0,xe.firstDayOfWeek=k0,xe.weekdays=W0,xe.weekdaysMin=Y0,xe.weekdaysShort=H0,xe.weekdaysParse=q0,xe.weekdaysRegex=V0,xe.weekdaysShortRegex=j0,xe.weekdaysMinRegex=J0,xe.isPM=Z0,xe.meridiem=ty;function Ws(e,t,n,s){var a=Lr(),c=_r().set(s,t);return a[n](c,e)}function gf(e,t,n){if(kr(e)&&(t=e,e=void 0),e=e||"",t!=null)return Ws(e,t,n,"month");var s,a=[];for(s=0;s<12;s++)a[s]=Ws(e,s,n,"month");return a}function Bo(e,t,n,s){typeof e=="boolean"?(kr(t)&&(n=t,t=void 0),t=t||""):(t=e,n=t,e=!1,kr(t)&&(n=t,t=void 0),t=t||"");var a=Lr(),c=e?a._week.dow:0,u,l=[];if(n!=null)return Ws(t,(n+c)%7,s,"day");for(u=0;u<7;u++)l[u]=Ws(t,(u+c)%7,s,"day");return l}function aw(e,t){return gf(e,t,"months")}function ow(e,t){return gf(e,t,"monthsShort")}function uw(e,t,n){return Bo(e,t,n,"weekdays")}function cw(e,t,n){return Bo(e,t,n,"weekdaysShort")}function lw(e,t,n){return Bo(e,t,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(e){var t=e%10,n=we(e%100/10)===1?"th":t===1?"st":t===2?"nd":t===3?"rd":"th";return e+n}}),V.lang=$t("moment.lang is deprecated. Use moment.locale instead.",en),V.langData=$t("moment.langData is deprecated. Use moment.localeData instead.",Lr);var Nr=Math.abs;function fw(){var e=this._data;return this._milliseconds=Nr(this._milliseconds),this._days=Nr(this._days),this._months=Nr(this._months),e.milliseconds=Nr(e.milliseconds),e.seconds=Nr(e.seconds),e.minutes=Nr(e.minutes),e.hours=Nr(e.hours),e.months=Nr(e.months),e.years=Nr(e.years),this}function yf(e,t,n,s){var a=or(t,n);return e._milliseconds+=s*a._milliseconds,e._days+=s*a._days,e._months+=s*a._months,e._bubble()}function hw(e,t){return yf(this,e,t,1)}function dw(e,t){return yf(this,e,t,-1)}function _f(e){return e<0?Math.floor(e):Math.ceil(e)}function pw(){var e=this._milliseconds,t=this._days,n=this._months,s=this._data,a,c,u,l,h;return e>=0&&t>=0&&n>=0||e<=0&&t<=0&&n<=0||(e+=_f(Fo(n)+t)*864e5,t=0,n=0),s.milliseconds=e%1e3,a=zt(e/1e3),s.seconds=a%60,c=zt(a/60),s.minutes=c%60,u=zt(c/60),s.hours=u%24,t+=zt(u/24),h=zt(wf(t)),n+=h,t-=_f(Fo(h)),l=zt(n/12),n%=12,s.days=t,s.months=n,s.years=l,this}function wf(e){return e*4800/146097}function Fo(e){return e*146097/4800}function mw(e){if(!this.isValid())return NaN;var t,n,s=this._milliseconds;if(e=Gt(e),e==="month"||e==="quarter"||e==="year")switch(t=this._days+s/864e5,n=this._months+wf(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(Fo(this._months)),e){case"week":return t/7+s/6048e5;case"day":return t+s/864e5;case"hour":return t*24+s/36e5;case"minute":return t*1440+s/6e4;case"second":return t*86400+s/1e3;case"millisecond":return Math.floor(t*864e5)+s;default:throw new Error("Unknown unit "+e)}}function Ur(e){return function(){return this.as(e)}}var bf=Ur("ms"),gw=Ur("s"),yw=Ur("m"),_w=Ur("h"),ww=Ur("d"),bw=Ur("w"),vw=Ur("M"),Sw=Ur("Q"),Tw=Ur("y"),Ew=bf;function Aw(){return or(this)}function Ow(e){return e=Gt(e),this.isValid()?this[e+"s"]():NaN}function bn(e){return function(){return this.isValid()?this._data[e]:NaN}}var xw=bn("milliseconds"),Cw=bn("seconds"),kw=bn("minutes"),Rw=bn("hours"),Pw=bn("days"),Dw=bn("months"),Mw=bn("years");function Lw(){return zt(this.days()/7)}var Ir=Math.round,Kn={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function Nw(e,t,n,s,a){return a.relativeTime(t||1,!!n,e,s)}function Uw(e,t,n,s){var a=or(e).abs(),c=Ir(a.as("s")),u=Ir(a.as("m")),l=Ir(a.as("h")),h=Ir(a.as("d")),m=Ir(a.as("M")),b=Ir(a.as("w")),T=Ir(a.as("y")),R=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&&(R=R||b<=1&&["w"]||b<n.w&&["ww",b]),R=R||m<=1&&["M"]||m<n.M&&["MM",m]||T<=1&&["y"]||["yy",T],R[2]=t,R[3]=+e>0,R[4]=s,Nw.apply(null,R)}function Iw(e){return e===void 0?Ir:typeof e=="function"?(Ir=e,!0):!1}function Bw(e,t){return Kn[e]===void 0?!1:t===void 0?Kn[e]:(Kn[e]=t,e==="s"&&(Kn.ss=t-1),!0)}function Fw(e,t){if(!this.isValid())return this.localeData().invalidDate();var n=!1,s=Kn,a,c;return typeof e=="object"&&(t=e,e=!1),typeof e=="boolean"&&(n=e),typeof t=="object"&&(s=Object.assign({},Kn,t),t.s!=null&&t.ss==null&&(s.ss=t.s-1)),a=this.localeData(),c=Uw(this,!n,s,a),n&&(c=a.pastFuture(+this,c)),a.postformat(c)}var Wo=Math.abs;function qn(e){return(e>0)-(e<0)||+e}function Hs(){if(!this.isValid())return this.localeData().invalidDate();var e=Wo(this._milliseconds)/1e3,t=Wo(this._days),n=Wo(this._months),s,a,c,u,l=this.asSeconds(),h,m,b,T;return l?(s=zt(e/60),a=zt(s/60),e%=60,s%=60,c=zt(n/12),n%=12,u=e?e.toFixed(3).replace(/\.?0+$/,""):"",h=l<0?"-":"",m=qn(this._months)!==qn(l)?"-":"",b=qn(this._days)!==qn(l)?"-":"",T=qn(this._milliseconds)!==qn(l)?"-":"",h+"P"+(c?m+c+"Y":"")+(n?m+n+"M":"")+(t?b+t+"D":"")+(a||s||e?"T":"")+(a?T+a+"H":"")+(s?T+s+"M":"")+(e?T+u+"S":"")):"P0D"}var Te=Ls.prototype;Te.isValid=Dy,Te.abs=fw,Te.add=hw,Te.subtract=dw,Te.as=mw,Te.asMilliseconds=bf,Te.asSeconds=gw,Te.asMinutes=yw,Te.asHours=_w,Te.asDays=ww,Te.asWeeks=bw,Te.asMonths=vw,Te.asQuarters=Sw,Te.asYears=Tw,Te.valueOf=Ew,Te._bubble=pw,Te.clone=Aw,Te.get=Ow,Te.milliseconds=xw,Te.seconds=Cw,Te.minutes=kw,Te.hours=Rw,Te.days=Pw,Te.weeks=Lw,Te.months=Dw,Te.years=Mw,Te.humanize=Fw,Te.toISOString=Hs,Te.toString=Hs,Te.toJSON=Hs,Te.locale=af,Te.localeData=uf,Te.toIsoString=$t("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Hs),Te.lang=of,ne("X",0,0,"unix"),ne("x",0,0,"valueOf"),Q("x",xs),Q("X",a0),Me("X",function(e,t,n){n._d=new Date(parseFloat(e)*1e3)}),Me("x",function(e,t,n){n._d=new Date(we(e))});//! moment.js
|
|
42
|
-
|
|
43
|
-
`+JSON.stringify(t))}function ee(e){return et.isBigNumber(e)?e:e?new et(e):new et("0")}function Gn(e,t){return new et(t).toFixed(e>0?e:0)}function qs(e){return typeof e=="number"?e:parseFloat(e)}function Mi(e){return typeof e=="number"?e:parseInt(e)}function kf(e){let t=qs(e);return t<1e10&&(t=t*1e3),new Date(t)}function zw(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 Dt;case"2":return Dt*2;case"3":return Dt*3;case"5":return Dt*5;case"10":return Dt*10;case"15":return Dt*15;case"30":return Dt*30;case"60":return Dt*60;case"120":return Dt*120;case"240":return Dt*240;case"360":return Dt*360;case"720":return Dt*720;case"D":case"1D":return Ys;case"3D":return Ys*3;case"W":return Ho;case"1W":return Ho;case"2W":return Ho*2;case"1M":return Ys*30}}const Rf=e=>typeof e=="object"?e:new Date(e*1e3),Vw=(e,t)=>{switch(e=V.utc(Rf(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()}};function jw(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 new Error(`Unsupported resolution: ${e}`)}}function Jw(e,t){let n=V(Rf(t)),s;switch(e){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: ${e}`)}return s}function Qw(e,t,n){const s=[];let a=V.utc(t*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(V.utc(e*1e3));for(;l>=h;)s.push(l.clone()),l=u(l);return s}function $o(e,t,n){let s=zw(t),a=typeof n=="object"?n.getTime()/1e3:n;return Math.floor(a/s)*s-s*(e-1)}function Zw(e,t){let n=t;if(typeof t=="string"?n=[{query:t,marketProperty:"fullDisplayName"}]:Array.isArray(t)?n=t.map(a=>{if(typeof a=="string")return{query:a,marketProperty:"fullDisplayName"};if(!Array.isArray(a))return a}):n=[t],n.length===0||!n.find(({query:a})=>!!a&&!!a.length))return e;let s=e;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=ot.pickBy(s,(h,m)=>{const b=h[c].toLowerCase();return u&&c==="fullDisplayName"?!!u.exec(h[c]):l.filter(T=>b.includes(T)).length===l.length})}),s}let Go;class Xw{static initialize=t=>{Go=t,console.log("Coinray I18n initialized")};static t=(t,n)=>Go?Go.t(`coinray:${t}`,n):`i18n uninitialized. Set the Coinray.I18n.instance. Key: ${t}`}const Pf="1.9.12";class e1 extends Error{errorCode;errorMessage;exchange;constructor({code:t,message:n,exchange:s}){super("Request failed"),this.name="CoinrayError",this.errorCode=t,this.errorMessage=n,this.exchange=s}}class Ce{static I18n=Xw;config;_token;_sessionKey;_credential;_firstOpen;_onTokenExpired;_tokenCheckTimeout;_onError;_onOpen;_socket;_transport;_tickerListeners;_tickerSymbols;_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(t,{apiEndpoint:n,orderEndpoint:s,websocketEndpoint:a}={apiEndpoint:"https://api.coinray.eu",orderEndpoint:"https://api.coinray.eu",websocketEndpoint:"wss://ws.coinray.eu/v1"}){this._token=t,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=(t,n)=>{this._credential=t,this._sessionKey=n};destroy=()=>{this._tradeListeners={},this._orderbookListeners={},this._tickerListeners=new Map,this._tickerSymbols=new Map,this._channels={},this._timeOffsetTimeout&&clearTimeout(this._timeOffsetTimeout),this._tokenCheckTimeout&&clearInterval(this._tokenCheckTimeout),this.disconnect()};checkToken=async(t=!0)=>{try{if(Ks(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,!Ks(this._token))this.reconnect();else return!1}}catch(n){console.error(n)}return t&&(this._tokenCheckTimeout=setTimeout(this.checkToken,5e3)),!0};setTransport=t=>{this._transport=t};onTokenExpired=t=>{this._tokenCheckTimeout&&clearInterval(this._tokenCheckTimeout),this._onTokenExpired=t,this._tokenCheckTimeout=setTimeout(this.checkToken,5e3)};refreshToken=t=>{this._token=t};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:t}=await this.get("/coinray/time");this._timeOffset=t.time-new Date().getTime()}catch(t){console.error(t)}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(t=>{this.markConnected=t});this.socket.onOpen(t=>{this._onOpen&&this._onOpen(t)}),this.socket.onError(t=>{this._onError&&this._onError(t)}),this.socket.connect(),this.markConnected()};onOpen=t=>{this._onOpen=t};onError=t=>{this._onError=t};resubscribe=()=>{if(this._firstOpen){this._firstOpen=!1;return}Object.keys(this._tickerListeners).forEach(t=>{this._tickerListeners[t].length>0&&this.getChannel("tickers").push("subscribe",{exchangeCodes:[t]},5e3)}),Object.keys(this._tradeListeners).forEach(t=>{this._tradeListeners[t].length>0&&this.getChannel("trades").push("subscribe",{symbols:t,snapshots:!0},5e3)}),Object.keys(this._orderbookListeners).forEach(t=>{this._orderbookListeners[t].length>0&&this.getChannel("orderbooks").push("subscribe",{symbols:t,snapshots:!0},5e3)})};subscribeTickers=async(t,n)=>{if(this._tickerListeners.has(n)){let a=this._tickerListeners.get(n);t.forEach(c=>a.add(c))}else this._tickerListeners.set(n,new Set(t));t.forEach(a=>{this._tickerSymbols.has(a)||this._tickerSymbols.set(a,new Set),this._tickerSymbols.get(a).add(n)}),await this.connect();const s=this.getChannel("tickers");return s.push("subscribe",{coinraySymbols:t},5e3),this.tickersSubscribed||(this.tickersSubscribed=!0,s.on("update",a=>{let{exchange_code:c,tickers:u}=a;const l=u.map(Ce._parseTicker);this._tickerListeners.forEach((h,m)=>{const b=l.filter(T=>h.has(T.coinraySymbol));m({type:"tickers:update",exchangeCode:c,tickers:b})})}),s.on("error",a=>console.error(a))),n};unsubscribeTickers=(t,n)=>{if(n&&this._tickerListeners.has(n)){let s=this._tickerListeners.get(n),a=[];t.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("trades").push("unsubscribe",{coinraySymbols:a},5e3)}else this._tradeListeners.get(n).clear()};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();const s=this.getChannel("trades");return s.push("subscribe",{symbols:t,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(Ce._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(Ce._parseTrade),h=[...l,...this._tradeSnapshots[a]],m=new Date(new Date().getTime()-12e4),b=h.filter(({time:T})=>T>m);b.length>100?this._tradeSnapshots[a]=b:this._tradeSnapshots[a]=h.slice(0,100),u.map(T=>T({type:"trades:update",coinraySymbol:a,trades:l}))}),s.on("error",a=>console.error(a))),n};unsubscribeTrades=({coinraySymbol:t},n)=>{n&&this._tradeListeners[t]?(this._tradeListeners[t]=this._tradeListeners[t].filter(s=>s!==n),this._tradeListeners[t].length===0&&this.getChannel("trades").push("unsubscribe",{symbols:t},5e3)):(this._tradeSnapshots[t]=[],this._tradeListeners[t]=[])};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();const s=this.getChannel("orderbooks");return s.push("subscribe",{symbols:t},1e4),this.orderBookSubscribed||(this.orderBookSubscribed=!0,s.on("snapshot",({orderbooks:a})=>{Object.keys(a).forEach(u=>{const l=Object.values(this._orderbookListeners[u]),h=Ce._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=Ce._parseOrderBookUpdate(a[u]);this._orderbookSnapshots[u]=Ce._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:t},n)=>{n&&this._orderbookListeners[t]?(this._orderbookListeners[t]=this._orderbookListeners[t].filter(s=>s!==n),this._orderbookListeners[t].length===0&&this.getChannel("orderbooks").push("unsubscribe",{symbols:t},5e3)):(this._orderbookSnapshots[t]={minSeq:0,maxSeq:0,bids:{},asks:{}},this._orderbookListeners[t]=[])};subscribeCandles=async({coinraySymbol:t,resolution:n,lastCandle:s},a)=>{const c=`${t}-${n}`;if(this._candleListeners[c]&&this._candleListeners[c].length>0)return this._candleListeners[c].push(a),a;this._candleListeners[c]=[a];const u=({type:l,coinraySymbol:h,trades:m})=>{const b=Object.values(this._candleListeners[c]),T=Ce._tradesToLastCandle(n,m),R=T[T.length-1];R&&(this._candles[c]&&l==="trades:snapshot"&&(this._candles[c].skipVolume=!0),this._candles[c]=Ce._mergeCandle(this._candles[c],R),b.map($=>$({coinraySymbol:h,resolution:n,candle:this._candles[c],previousCandles:T})))};return this._candleTradeListeners[t]?this._candleTradeListeners[t][c]=u:this._candleTradeListeners[t]={[c]:u},this._candles[c]=s||{time:new Date(0)},await this.subscribeTrades({coinraySymbol:t},u),this.startNewCandleTimer({candleId:c,resolution:n,coinraySymbol:t}),a};startNewCandleTimer=({candleId:t,resolution:n,coinraySymbol:s})=>{this._timers[t]&&clearTimeout(this._timers[t]);let a=$o(0,n,new Date)-new Date().getTime()/1e3;const c=Object.values(this._candleListeners[t]);this._timers[t]=setTimeout(()=>{let u=$o(1,n,new Date)*1e3,l=this._candles[t];l&&u>l.time.getTime()&&(this._candles[t]={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[t],previousCandles:[]}))),this.startNewCandleTimer({candleId:t,resolution:n,coinraySymbol:s})},a*1e3)};unsubscribeCandles=({coinraySymbol:t,resolution:n},s)=>{const a=`${t}-${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:t},this._candleTradeListeners[t][a]),this._timers[a]&&(clearTimeout(this._timers[a]),delete this._timers[a]),delete this._candles[a],delete this._candleTradeListeners[t][a])};fetchFirstCandleTime=async({coinraySymbol:t,resolution:n})=>{let{result:{startTime:s}}=await this.get("candles/start-time",{version:"v1",params:{symbol:t,resolution:n}});return s};fetchCandles=async({coinraySymbol:t,resolution:n,start:s,end:a,useWebSocket:c})=>{if(this.flushCache(),n.endsWith("S"))return(await this.getWebsocketCandles(t,n)).filter($=>{let O=$.time.getTime()/1e3;return O>=s&&O<=a});const u=jw(n),l=new Date().getTime()/1e3,h=[];let m=a;if(Vw(a,n)>=l){let R=await this.getOpenCandles(c,{version:"v2",params:{symbol:t,resolution:n}});if(R.length>0)m=Math.min(R[0].time.getTime()/1e3,m),h.push(...R);else return[]}let b=$o(2,n,m),T=ol.chunk(Qw(s,b,u),10);for(let R=0;R<T.length;R+=1){let $=T[R].map(F=>{let re=Jw(u,F),Y={version:"v2",params:{symbol:t,resolution:n,...re}};return this.getHistoryCandles(Y)}),O=await Promise.all($),B=[];for(let F=0;F<O.length;F+=1)B=O[F].filter(({time:re})=>re.getTime()/1e3<m),B.length>0&&(m=Math.min(B[0].time.getTime()/1e3,m),h.unshift(...B));if(B.length===0)break}return h.filter(({time:R})=>{let $=R.getTime()/1e3;return $>=s&&$<=a}).sort((R,$)=>R.time.getTime()-$.time.getTime())};flushCache=()=>{let t=new Date().getTime()/1e3;(!this._candleCacheCreatedAt||t-this._candleCacheCreatedAt>600)&&(this._candleCacheCreatedAt=t,this._candleCache=new Map)};getWebsocketCandles=async(t,n)=>await new Promise(a=>{let c=setTimeout(()=>{this.unsubscribeCandles({coinraySymbol:t,resolution:n},u),a([])},0);const u=({previousCandles:l})=>{clearTimeout(c),this.unsubscribeCandles({coinraySymbol:t,resolution:n},u),a(l)};this.subscribeCandles({coinraySymbol:t,resolution:n},u)});getOpenCandles=async(t,n)=>{const s=this.candleCacheKey({prefix:"O",...n.params});let a=this._candleCache.get(s);if(!t&&a)return a;const c=await this.getWebsocketCandles(n.params.symbol,n.params.resolution),u=ot.keyBy(c,({time:h})=>h.getTime());let{result:l}=await this.get("candles/open",n);if(l.candles){let m=l.candles.map(Ce._parseCandle).map(b=>{const T=u[b.time.getTime()];return T?Ce._mergeCandle(b,T):b});return this._candleCache.set(s,m),m}else return[]};getHistoryCandles=async t=>{const n=this.candleCacheKey(t.params);let s=this._candleCache.get(n);if(s)return s;{if(t.params.year<2018)return new Promise(c=>c([]));let{result:a}=await this.get("candles/history",t);if(a.candles){let c=a.candles.map(Ce._parseCandle);return this._candleCache.set(n,c),c}else return[]}};candleCacheKey=({symbol:t,resolution:n,year:s,month:a="",day:c="",week:u="",prefix:l="C"})=>`${l}/${t}/${n}/${s}/${a}/${c}/${u}`;fetchExchanges=async(t,n)=>{let s=n;return s||({result:{exchanges:s}}=await this.get("exchanges",{version:"v1"})),s.map(t)};fetchMarkets=async(t,n)=>{let s=n;return s||({result:{markets:s}}=await this.get("markets",{version:"v1",params:{exchange:t.code}})),s};createCredential=async(t,n)=>{const s=await this.publicKey();try{const a=await Af(await Ef({password:n}),s),{result:c}=await this.post("credentials",{secret:n,body:{deviceId:t,encryptedPassword:a}});return c}catch(a){throw a}};wrapApiKey=async(t,n)=>{const s=await this.publicKey();let a;try{if(n)a=t;else{const u=JSON.stringify(t);a=await Af(await Ef({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 t=>{try{const{result:n}=await this.post("account/test",{secret:this._sessionKey,apiEndpoint:this.config.orderEndpoint,body:{...t,credential:this._credential}});return n}catch(n){throw n}};createSmartOrderSignature=async t=>{try{const{result:n}=await this.post("order/smart_order_signature",{secret:this._sessionKey,apiEndpoint:this.config.orderEndpoint,body:{smartOrder:t,credential:this._credential}});return n}catch(n){throw n}};createOrder=async t=>{try{const{result:n}=await this.post("order",{secret:this._sessionKey,apiEndpoint:this.config.orderEndpoint,body:{...t,credential:this._credential}});return n}catch(n){throw n}};updateOrder=async t=>{try{const{result:n}=await this.patch("order",{secret:this._sessionKey,apiEndpoint:this.config.orderEndpoint,body:{...t,credential:this._credential}});return n}catch(n){throw n}};cancelOrder=async t=>{try{const{result:n}=await this.delete("order",{secret:this._sessionKey,apiEndpoint:this.config.orderEndpoint,body:{...t,orderId:t.orderId.toString(),credential:this._credential}});return n}catch(n){throw n}};createWebSocketToken=async({exchangeCode:t,encryptedApiKey:n})=>{try{const{result:s}=await this.post("exchanges/ws_token",{secret:this._sessionKey,apiEndpoint:this.config.orderEndpoint,body:{encryptedApiKey:n,exchangeCode:t,credential:this._credential}});return s}catch(s){throw s}};fetchPositions=async({exchangeCode:t,encryptedApiKey:n})=>{try{const{result:s}=await this.get("futures/positions",{secret:this._sessionKey,apiEndpoint:this.config.orderEndpoint,params:{credential:this._credential,exchangeCode:t,encryptedApiKey:n}});return s}catch(s){throw s}};getBalances=async({exchangeCode:t,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:t,encryptedApiKey:n}});return{balances:s.map(Ce._parseBalance),positions:a}}catch(s){throw s}};setLeverage=async({coinraySymbol:t,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:t,leverage:n,encryptedApiKey:s}});return a}catch(a){throw a}};setMarginType=async({coinraySymbol:t,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:t,marginType:n,encryptedApiKey:s}});return a}catch(a){throw a}};async getProxyList({exchangeCode:t,credentialVersion:n}){let s="";t&&(s+=`?exchange=${t.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:t}}=await this.get("credentials/certificate");this._publicKey=await $w(t)}return this._publicKey}get clientId(){return qw(this._token).header.kid}get socket(){if(!this._token)throw new Error("Token not present");return this._socket||(this._socket=new Vm(this.config.websocketEndpoint,{heartbeatIntervalMs:5e3,transport:this._transport,reconnectAfterMs:()=>Ks(this._token)?3e4:1e3}),this.onOpen(this.resubscribe)),this._socket.params=()=>({reconnect:!0,token:this._token,client:"coinrayjs",version:Pf}),this._socket}getChannel(t){if(this.connect(),this._channels[t])return this._channels[t];const n=this.socket.channel(t,{});return this._channels[t]=n,n.join(),n}get=async(t,{apiEndpoint:n=void 0,version:s="v2",headers:a={},params:c={},secret:u=""}={})=>await this._request(t,"GET",{version:s,apiEndpoint:n,headers:a,secret:u,params:c});post=async(t,n)=>await this._request(t,"POST",n);patch=async(t,n)=>await this._request(t,"PATCH",n);delete=async(t,n)=>await this._request(t,"delete",n);async _request(t,n,{apiEndpoint:s,version:a="v2",headers:c={},params:u={},body:l={},secret:h=""}){const m=await this.getToken(),b=Object.entries(u).length>0?"?"+Object.entries(u).map(([O,B])=>B?`${O}=${B}`:void 0).filter(Boolean).join("&"):"",T=this.getNonce(),R=`/api/${a}/${t}${b}`;if(a==="v2"&&!t.startsWith("candles")){const O=[T,n.toUpperCase(),R,n==="GET"?"":JSON.stringify(l)].join(""),B=await Tf(O,h);c={...c,"Cr-Access-Token":`${m}`,"Cr-Nonce":T,"Cr-Signature":B}}const $={method:n,url:(s||this.config.apiEndpoint)+R,timeout:2e4,headers:{Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${m}`,"Cr-Client-version":Pf,...c},data:n==="GET"?void 0:JSON.stringify(l)};try{const O=await Je($);let B;O.status===200?B=O.data:O.status===204?B={}:B=O.data;const F=Object.fromEntries(Object.entries(O.headers).map(([re,Y])=>[re,Array.isArray(Y)?Y.join(", "):String(Y)]));return{result:B,_headers:F}}catch(O){const{response:B}=O;if(B){const{error:F}=B.data;throw new e1(F)}else throw O}}static _parseOrderBookSnapshot({asks:t,bids:n,min_seq:s,max_seq:a}){return{minSeq:s,maxSeq:a,asks:Ce._parseBidAsk(t),bids:Ce._parseBidAsk(n)}}static _parseOrderBookUpdate({asks_diff:t,bids_diff:n,min_seq:s,max_seq:a}){return{minSeq:s,maxSeq:a,asks:Ce._parseBidAsk(t),bids:Ce._parseBidAsk(n)}}static _updateOrderBook(t,{asks:n,bids:s,min_seq:a,max_seq:c}){const u=(l,h)=>{ot.forEach(h,(m,b)=>{m>0?l[b]=m:delete l[b]})};return t.minSeq=a,t.maxSeq=c,u(t.bids,s),u(t.asks,n),t}static _parseBidAsk(t){return Array.isArray(t)?t.reduce((n,[s,a])=>(n[s]=parseFloat(a),n),{}):Object.keys(t).reduce((n,s)=>(n[s]=parseFloat(t[s]),n),{})}static _parseCandle(t){if(t){const[n,s,a,c,u,l,h]=t;return{time:kf(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([t,n,s,a,c]){return{id:t,time:kf(n),price:parseFloat(s),quantity:parseFloat(a),type:["1","buy"].includes(c.toString())?"buy":"sell"}}static _parseTicker(t){return{askPrice:ee(t.a),baseVolume:ee(t.bv),bidPrice:ee(t.b),btcVolume:ee(t.B),coinraySymbol:t.s,highPrice1s:ee(t.h),highPrice24h:ee(t.H),lastPrice:ee(t.c),lowPrice1s:ee(t.l),lowPrice24h:ee(t.L),openPrice1s:ee(t.o),openPrice24h:ee(t.O),quoteVolume:ee(t.qv),usdVolume:ee(t.U)}}static _parseBalance(t){let n={currency:t.currency,available:ee(t.available),inOrders:ee(t.inOrders),total:ee(t.inOrders)};return t.initialMargin&&(n={...n,initialMargin:ee(t.initialMargin),openOrderInitialMargin:ee(t.openOrderInitialMargin),positionInitialMargin:ee(t.positionInitialMargin),unrealizedProfit:ee(t.unrealizedProfit),crossWalletBalance:ee(t.crossWalletBalance),crossUnrealizedProfit:ee(t.crossUnrealizedProfit)}),n}static _tradesToLastCandle(t,n){n.length>0&&n[0].time>n[n.length-1].time&&(n=n.reverse());const s=Ce._resolutionToSeconds(t),a=ot.groupBy(n.reverse(),({time:c})=>Math.floor(c.getTime()/s)*s);return ot.sortBy(Object.keys(a),c=>parseInt(c)).reduce((c,u)=>{const l=a[u],h=l[0].time.getTime(),m=new Date(h-h%s);if(l.length===0)return c;let b=l[0],T,R,$,O,B=0,F=0;return c.length===0?T=R=$=O=b.price:T=R=$=O=c[c.length-1].close,l.reverse().map(({price:re,quantity:Y})=>{R=Math.min(R,re),$=Math.max($,re),O=re,B+=Y,F+=Y*re}),c.push({time:new Date(m),open:T,high:$,low:R,close:O,baseVolume:B,quoteVolume:F,numTrades:l.length}),c},[])}static _mergeCandle(t,n){return!t||t.time<n.time?n:(t.numTrades+=n.numTrades,t.high=Math.max(t.high,n.high),t.low=Math.min(t.low,n.low),t.close=n.close,t.skipVolume?t.skipVolume=!1:(t.baseVolume+=n.baseVolume,t.quoteVolume+=n.quoteVolume),t)}static _resolutionToSeconds(t){return t.indexOf("W")>0||t.indexOf("D")>0?parseInt(t)*24*60*60*1e3:t.indexOf("S")>0?parseInt(t)*1e3:t==="D"?864e5:parseInt(t)*60*1e3}}class $s{getExchange;api;id;coinraySymbol;symbol;symbolAlt;quoteCurrency;underlyingQuoteCurrency;baseLogoUrl;baseCurrency;exchangeCode;volume;quoteVolume;btcVolume;usdVolume;websocket;openPrice;highPrice;lowPrice;precisionBase;precisionQuote;precisionPrice;minBase;maxBase;maxBaseMarket;minQuote;maxQuote;minTrade;maxTrade;makerFee;takerFee;change;delistedOn;exchangeUrl;baseToUsd;quoteToUsd;status;note;_supportedOrderTypes;_lastPrice;_askPrice;_bidPrice;updatedAt;getPriceOverrides;static Create(t,n,s){return t==null?Of(t):typeof t!="object"?xf(t,!1):Array.isArray(t)&&Cf(t,!1),Mt(t.id,!1,"id"),ze(t.coinraySymbol,!1,"coinraySymbol"),ze(t.symbol,!1,"symbol"),ze(t.symbolAlt,!1,"symbolAlt"),ze(t.quoteCurrency,!1,"quoteCurrency"),ze(t.underlyingQuoteCurrency,!1,"underlyingQuoteCurrency"),ze(t.baseLogoUrl,!0,"baseLogoUrl"),ze(t.baseCurrency,!1,"baseCurrency"),ze(t.exchangeCode,!1,"exchangeCode"),ze(t.status||"",!1,"status"),ze(t.note||"",!1,"note"),dt(t.volume,!0,"volume"),dt(t.quoteVolume,!0,"quoteVolume"),dt(t.btcVolume,!0,"btcVolume"),dt(t.usdVolume,!0,"usdVolume"),$n(t.websocket,!1,"websocket"),dt(t.openPrice,!0,"openPrice"),dt(t.highPrice,!0,"highPrice"),dt(t.lowPrice,!0,"lowPrice"),Mt(t.precisionBase,!1,"precisionBase"),Mt(t.precisionPrice,!1,"precisionPrice"),Mt(t.precisionBase,!1,"precisionBase"),Mt(t.minBase,!0,"minBase"),Mt(t.precisionQuote,!1,"precisionQuote"),Mt(t.minQuote,!0,"minQuote"),dt(t.maxBase,!0,"maxBase"),dt(t.maxBaseMarket,!0,"maxBaseMarket"),dt(t.maxQuote,!0,"maxQuote"),dt(t.minTrade,!1,"minTrade"),Mt(t.maxTrade,!0,"maxTrade"),t.maxTrade===void 0&&(t.maxTrade=null),Mt(t.makerFee,!1,"makerFee"),Mt(t.takerFee,!1,"takerFee"),Mt(t.change,!1,"change"),Gw(t.delistedOn,"delistedOn"),t.delistedOn===void 0&&(t.delistedOn=null),ze(t.exchangeUrl,!1,"exchangeUrl"),dt(t.lastPrice,!0,"lastPrice"),dt(t.baseToUsd,!1,"baseToUsd"),dt(t.quoteToUsd,!1,"quoteToUsd"),dt(t.askPrice,!0,"askPrice"),dt(t.bidPrice,!0,"bidPrice"),ze(t.updatedAt,!1,"updatedAt"),new $s(t,n,s)}constructor(t,n,s){this.getExchange=()=>s,this.api=n,this.id=t.id,this.coinraySymbol=t.coinraySymbol,this.symbol=t.symbol,this.symbolAlt=t.symbolAlt,this.quoteCurrency=t.quoteCurrency.toUpperCase(),this.underlyingQuoteCurrency=t.underlyingQuoteCurrency.toUpperCase(),this.baseLogoUrl=t.baseLogoUrl,this.baseCurrency=t.baseCurrency.toUpperCase(),this.exchangeCode=t.exchangeCode,this.status=t.status,this.note=t.note,this.volume=ee(t.volume),this.quoteVolume=ee(t.quoteVolume),this.btcVolume=ee(t.btcVolume),this.usdVolume=ee(t.usdVolume),this.websocket=t.websocket,this.openPrice=ee(t.openPrice),this.highPrice=ee(t.highPrice),this.lowPrice=ee(t.lowPrice),this.precisionBase=t.precisionBase,this.precisionPrice=t.precisionPrice,this.precisionQuote=t.precisionQuote,this.minQuote=t.minQuote,this.precisionBase=t.precisionBase,this.minBase=t.minBase,this.maxBase=ee(t.maxBase),this.maxBaseMarket=ee(t.maxBaseMarket).isZero()?this.maxBase:ee(t.maxBaseMarket),this.maxQuote=ee(t.maxQuote),this.minTrade=ee(t.minTrade),this.maxTrade=ee(t.maxTrade),this.makerFee=qs(t.makerFee),this.takerFee=qs(t.takerFee),this.change=qs(t.change),this.delistedOn=t.delistedOn,this.exchangeUrl=t.exchangeUrl,this._lastPrice=ee(t.lastPrice),this.baseToUsd=ee(t.baseToUsd),this.quoteToUsd=ee(t.quoteToUsd),this._askPrice=ee(t.askPrice),this._bidPrice=ee(t.bidPrice),this._supportedOrderTypes=t.supportedOrderTypes,this.updatedAt=t.updatedAt}get tradingDisabled(){return this.status==="INACTIVE"}get tradingEnabled(){return!this.tradingDisabled}get quoteLogoUrl(){return`https://api.coinray.eu/api/v2/explorer/currencies/${this.quoteCurrency}/thumb`}get supportedOrderTypes(){return this._supportedOrderTypes.length>0?this._supportedOrderTypes:this.getExchange().supportedOrderTypes}get isFutures(){return this.getExchange().isFutures}get fullDisplayName(){return[this.exchangeCode,this.displayName].join(": ")}get displayName(){return[this.baseCurrency,this.quoteCurrency].join("/")}get priceOverrides(){return this.getPriceOverrides?this.getPriceOverrides():{}}get lastPrice(){return this.priceOverrides.lastPrice||this._lastPrice}get askPrice(){return this.priceOverrides.askPrice||this._askPrice}get bidPrice(){return this.priceOverrides.bidPrice||this._bidPrice}overridePrices=t=>{this.getPriceOverrides=t};updateTicker=({lastPrice:t,bidPrice:n,askPrice:s})=>{t&&(this._lastPrice=t),s&&(this._askPrice=s),n&&(this._bidPrice=n)}}class Li{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){if(t==null?Of(t):typeof t!="object"?xf(t,!1):Array.isArray(t)&&Cf(t,!1),Mt(t.id,!1,"id"),ze(t.name,!1,"name"),ze(t.code,!1,"code"),$n(t.websocket,!1,"websocket"),$n(t.active,!1,"active"),$n(t.tradingEnabled,!1,"tradingEnabled"),ze(t.tradingEnabledFrom,!1,"tradingEnabledFrom"),$n(t.isFutures,!0,"isFutures"),$n(t.isDex,!0,"isDex"),ze(t.logo,!1,"logo"),ze(t.btcVolume,!1,"btcVolume"),ze(t.usdVolume,!1,"usdVolume"),Mt(t.totalMarkets,!1,"totalMarkets"),qo(t.quoteCurrencies,"quoteCurrencies"),ze(t.apiEndpoint,!0,"apiEndpoint"),ze(t.websocketEndpoint,!0,"websocketEndpoint"),ze(t.aliasedTo,!0,"aliasedTo"),t.quoteCurrencies)for(let s=0;s<t.quoteCurrencies.length;s++)ze(t.quoteCurrencies[s],!1,"quoteCurrencies["+s+"]");if(t.quoteCurrencies===void 0&&(t.quoteCurrencies=null),qo(t.supportedResolutions,"supportedResolutions"),qo(t.supportedFeatures,"supportedFeatures"),t.supportedResolutions)for(let s=0;s<t.supportedResolutions.length;s++)ze(t.supportedResolutions[s],!1,"supportedResolutions["+s+"]");return t.supportedResolutions===void 0&&(t.supportedResolutions=null),new Li(t,n)}constructor(t,n){this.api=n,this.id=t.id,this.name=t.name,this.code=t.code,this.websocket=t.websocket,this.isFutures=!!t.isFutures,this.isDex=!!t.isDex,this.active=t.active,this.tradingEnabled=t.tradingEnabled,this.tradingEnabledFrom=t.tradingEnabledFrom,this.logo=t.logo,this.btcVolume=ee(t.btcVolume),this.usdVolume=ee(t.usdVolume),this.totalMarkets=Mi(t.totalMarkets),this.quoteCurrencies=t.quoteCurrencies,this.supportedResolutions=t.supportedResolutions,this.supportedFeatures=t.supportedFeatures,this.supportedOrderTypes=t.supportedOrderTypes,this.baseCurrencyDominance=t.baseCurrencyDominance,this.apiKeySettings=t.apiKeySettings,this.markets={},this.exchangeSymbols={},this.apiEndpoint=t.apiEndpoint||n.config.apiEndpoint,this.websocketEndpoint=t.websocketEndpoint||n.config.websocketEndpoint,this.aliasedTo=t.aliasedTo}clone(){return new Li({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(t=void 0){const n=await this.api.fetchMarkets(this,t),s=n.map(a=>{try{return $s.Create(a,this.api,this)}catch{return new $s(a,this.api,this)}});return s.length>0&&(this.markets=ot.keyBy(s,"coinraySymbol"),this.exchangeSymbols=ot.keyBy(s,"symbol")),n}getBaseCurrencyDominance(t){return this.baseCurrencyDominance[t]}getMarketByExchangeSymbol(t){return this.exchangeSymbols[t]}getCurrencyPrice(t,n){for(let[s,a]of Object.entries(this.markets)){if(a.baseCurrency===n)return ee(t).dividedBy(a.baseToUsd);if(a.quoteCurrency===n)return ee(t).dividedBy(a.quoteToUsd)}return new et(0)}getUsdPrice(t,n){for(let[s,a]of Object.entries(this.markets)){if(a.baseCurrency===n)return a.baseToUsd.multipliedBy(t);if(a.quoteCurrency===n)return a.quoteToUsd.multipliedBy(t)}return new et(0)}getMarket(t){return this.markets[t]}}class Df{listeners;constructor(){this.listeners={}}removeAllListeners(){this.listeners={}}on=(t,n)=>(t in this.listeners||(this.listeners[t]=[]),this.listeners[t].push(n),n);off=(t,n)=>{t in this.listeners&&(n?this.listeners[t]=this.listeners[t].filter(s=>s!==n):this.listeners[t]=[])};hasListeners=t=>this.listeners[t]&&this.listeners[t].length>0;dispatchEvent=(t,n={})=>{const s=this.listeners[t];s&&s.length>0&&s.map(a=>a({eventName:t,data:n}))}}class t1 extends Df{rootApi;apis;exchanges;initialized;refreshRate;refreshTimeout;_refreshingToken;_onTokenExpired;onStoreCache;apiCache;constructor(t,n,s=3e4,a=void 0){super(),this.rootApi=new Ce(t,n),this.apis=new Map,this.exchanges={},this.initialized=!1,this.refreshRate=s,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(t,n){this.rootApi.authenticateDevice(t,n)}refreshToken=async()=>{if(this._onTokenExpired){if(this._refreshingToken)return await this._refreshingToken;{this._refreshingToken=this._onTokenExpired();let t=await this._refreshingToken;this._refreshingToken=void 0;for(const n of this.apis.values())n.refreshToken(t);return t}}};onTokenExpired(t){this._onTokenExpired=t}async start(){this.refreshTimeout&&clearTimeout(this.refreshTimeout);try{this.apiCache?(await this.refreshExchanges(this.apiCache),this.refreshExchanges()):await this.refreshExchanges()}catch(t){console.error(t)}this.refreshTimeout=setTimeout(this.refreshExchangeInterval,this.refreshRate)}refreshExchangeInterval=async()=>{try{await this.refreshExchanges()}catch(t){console.error(t)}this.refreshTimeout=setTimeout(this.refreshExchangeInterval,this.refreshRate)};destroy(){for(const t of this.apis.values())try{t.destroy()}catch(n){console.error("Could not destroy coinray",n)}this.refreshTimeout&&clearTimeout(this.refreshTimeout),this.initialized=!1}refreshExchanges=async(t=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),Li.Create(c,this.apis.get(c.code))),t?.exchanges),a=await Promise.all(s.map(async c=>({[c.code]:await c.loadMarkets(t?.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"),!t&&this.onStoreCache&&this.onStoreCache(n)};getProxyList=async(t={})=>await this.rootApi.getProxyList(t);getExchanges(){if(!this.initialized)throw"The cache is not initialized yet";return this.exchanges}getExchange(t){return this.getExchanges()[t]||Li.Create({id:-1,name:t,code:t,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 t=>{await this.exchanges[t].loadMarkets()};searchMarkets(t){return Object.values(this.exchanges).reduce((n,s)=>(n={...n,...
|
|
41
|
+
`+new Error().stack),n=!1}return t.apply(this,arguments)},t)}var Hl={};function Yl(e,t){z.deprecationHandler!=null&&z.deprecationHandler(e,t),Hl[e]||(Wl(t),Hl[e]=!0)}z.suppressDeprecationWarnings=!1,z.deprecationHandler=null;function wr(e){return typeof Function<"u"&&e instanceof Function||Object.prototype.toString.call(e)==="[object Function]"}function n0(e){var t,n;for(n in e)Ce(e,n)&&(t=e[n],wr(t)?this[n]=t:this["_"+n]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function vo(e,t){var n=Xr({},e),s;for(s in t)Ce(t,s)&&(wn(e[s])&&wn(t[s])?(n[s]={},Xr(n[s],e[s]),Xr(n[s],t[s])):t[s]!=null?n[s]=t[s]:delete n[s]);for(s in e)Ce(e,s)&&!Ce(t,s)&&wn(e[s])&&(n[s]=Xr({},n[s]));return n}function So(e){e!=null&&this.set(e)}var Eo;Object.keys?Eo=Object.keys:Eo=function(e){var t,n=[];for(t in e)Ce(e,t)&&n.push(t);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(e,t,n){var s=this._calendar[e]||this._calendar.sameElse;return wr(s)?s.call(t,n):s}function br(e,t,n){var s=""+Math.abs(e),a=t-s.length,c=e>=0;return(c?n?"+":"":"-")+Math.pow(10,Math.max(0,a)).toString().substr(1)+s}var To=/(\[[^\[]*\])|(\\)?([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,Ts=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Ao={},Wn={};function ie(e,t,n,s){var a=s;typeof s=="string"&&(a=function(){return this[s]()}),e&&(Wn[e]=a),t&&(Wn[t[0]]=function(){return br(a.apply(this,arguments),t[1],t[2])}),n&&(Wn[n]=function(){return this.localeData().ordinal(a.apply(this,arguments),e)})}function a0(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function o0(e){var t=e.match(To),n,s;for(n=0,s=t.length;n<s;n++)Wn[t[n]]?t[n]=Wn[t[n]]:t[n]=a0(t[n]);return function(a){var c="",u;for(u=0;u<s;u++)c+=wr(t[u])?t[u].call(a,e):t[u];return c}}function As(e,t){return e.isValid()?(t=Kl(t,e.localeData()),Ao[t]=Ao[t]||o0(t),Ao[t](e)):e.localeData().invalidDate()}function Kl(e,t){var n=5;function s(a){return t.longDateFormat(a)||a}for(Ts.lastIndex=0;n>=0&&Ts.test(e);)e=e.replace(Ts,s),Ts.lastIndex=0,n-=1;return e}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(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(To).map(function(s){return s==="MMMM"||s==="MM"||s==="DD"||s==="dddd"?s.slice(1):s}).join(""),this._longDateFormat[e])}var l0="Invalid date";function f0(){return this._invalidDate}var h0="%d",d0=/\d{1,2}/;function p0(e){return this._ordinal.replace("%d",e)}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(e,t,n,s){var a=this._relativeTime[n];return wr(a)?a(e,t,n,s):a.replace(/%d/i,e)}function y0(e,t){var n=this._relativeTime[e>0?"future":"past"];return wr(n)?n(t):n.replace(/%s/i,t)}var ql={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function Vt(e){return typeof e=="string"?ql[e]||ql[e.toLowerCase()]:void 0}function Oo(e){var t={},n,s;for(s in e)Ce(e,s)&&(n=Vt(s),n&&(t[n]=e[s]));return t}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(e){var t=[],n;for(n in e)Ce(e,n)&&t.push({unit:n,priority:_0[n]});return t.sort(function(s,a){return s.priority-a.priority}),t}var $l=/\d/,Nt=/\d\d/,Gl=/\d{3}/,Co=/\d{4}/,Os=/[+-]?\d{6}/,Ye=/\d\d?/,Vl=/\d\d\d\d?/,zl=/\d\d\d\d\d\d?/,Cs=/\d{1,3}/,ko=/\d{1,4}/,ks=/[+-]?\d{1,6}/,Hn=/\d+/,xs=/[+-]?\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?/,xo=/^([1-9]\d|\d)/,Ps;Ps={};function Q(e,t,n){Ps[e]=wr(t)?t:function(s,a){return s&&n?n:t}}function S0(e,t){return Ce(Ps,e)?Ps[e](t._strict,t._locale):new RegExp(E0(e))}function E0(e){return Pr(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,n,s,a,c){return n||s||a||c}))}function Pr(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function zt(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function be(e){var t=+e,n=0;return t!==0&&isFinite(t)&&(n=zt(t)),n}var Ro={};function Le(e,t){var n,s=t,a;for(typeof e=="string"&&(e=[e]),Rr(t)&&(s=function(c,u){u[t]=be(c)}),a=e.length,n=0;n<a;n++)Ro[e[n]]=s}function Oi(e,t){Le(e,function(n,s,a,c){a._w=a._w||{},t(n,a._w,a,c)})}function T0(e,t,n){t!=null&&Ce(Ro,e)&&Ro[e](t,n._a,n,e)}function Ds(e){return e%4===0&&e%100!==0||e%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 e=this.year();return e<=9999?br(e,4):"+"+e}),ie(0,["YY",2],0,function(){return this.year()%100}),ie(0,["YYYY",4],0,"year"),ie(0,["YYYYY",5],0,"year"),ie(0,["YYYYYY",6,!0],0,"year"),Q("Y",xs),Q("YY",Ye,Nt),Q("YYYY",ko,Co),Q("YYYYY",ks,Os),Q("YYYYYY",ks,Os),Le(["YYYYY","YYYYYY"],pt),Le("YYYY",function(e,t){t[pt]=e.length===2?z.parseTwoDigitYear(e):be(e)}),Le("YY",function(e,t){t[pt]=z.parseTwoDigitYear(e)}),Le("Y",function(e,t){t[pt]=parseInt(e,10)});function Ci(e){return Ds(e)?366:365}z.parseTwoDigitYear=function(e){return be(e)+(be(e)>68?1900:2e3)};var jl=Kn("FullYear",!0);function C0(){return Ds(this.year())}function Kn(e,t){return function(n){return n!=null?(Jl(this,e,n),z.updateOffset(this,t),this):ki(this,e)}}function ki(e,t){if(!e.isValid())return NaN;var n=e._d,s=e._isUTC;switch(t){case"Milliseconds":return s?n.getUTCMilliseconds():n.getMilliseconds();case"Seconds":return s?n.getUTCSeconds():n.getSeconds();case"Minutes":return s?n.getUTCMinutes():n.getMinutes();case"Hours":return s?n.getUTCHours():n.getHours();case"Date":return s?n.getUTCDate():n.getDate();case"Day":return s?n.getUTCDay():n.getDay();case"Month":return s?n.getUTCMonth():n.getMonth();case"FullYear":return s?n.getUTCFullYear():n.getFullYear();default:return NaN}}function Jl(e,t,n){var s,a,c,u,l;if(!(!e.isValid()||isNaN(n))){switch(s=e._d,a=e._isUTC,t){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=e.month(),l=e.date(),l=l===29&&u===1&&!Ds(c)?28:l,a?s.setUTCFullYear(c,u,l):s.setFullYear(c,u,l)}}function k0(e){return e=Vt(e),wr(this[e])?this[e]():this}function x0(e,t){if(typeof e=="object"){e=Oo(e);var n=w0(e),s,a=n.length;for(s=0;s<a;s++)this[n[s].unit](e[n[s].unit])}else if(e=Vt(e),wr(this[e]))return this[e](t);return this}function R0(e,t){return(e%t+t)%t}var Xe;Array.prototype.indexOf?Xe=Array.prototype.indexOf:Xe=function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1};function Po(e,t){if(isNaN(e)||isNaN(t))return NaN;var n=R0(t,12);return e+=(t-n)/12,n===1?Ds(e)?29:28:31-n%7%2}ie("M",["MM",2],"Mo",function(){return this.month()+1}),ie("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),ie("MMMM",0,0,function(e){return this.localeData().months(this,e)}),Q("M",Ye,Yn),Q("MM",Ye,Nt),Q("MMM",function(e,t){return t.monthsShortRegex(e)}),Q("MMMM",function(e,t){return t.monthsRegex(e)}),Le(["M","MM"],function(e,t){t[Dr]=be(e)-1}),Le(["MMM","MMMM"],function(e,t,n,s){var a=n._locale.monthsParse(e,s,n._strict);a!=null?t[Dr]=a:de(n).invalidMonth=e});var P0="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Ql="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Zl=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,D0=Ai,M0=Ai;function L0(e,t){return e?ar(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||Zl).test(t)?"format":"standalone"][e.month()]:ar(this._months)?this._months:this._months.standalone}function N0(e,t){return e?ar(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[Zl.test(t)?"format":"standalone"][e.month()]:ar(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function U0(e,t,n){var s,a,c,u=e.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?t==="MMM"?(a=Xe.call(this._shortMonthsParse,u),a!==-1?a:null):(a=Xe.call(this._longMonthsParse,u),a!==-1?a:null):t==="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(e,t,n){var s,a,c;if(this._monthsParseExact)return U0.call(this,e,t,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&&t==="MMMM"&&this._longMonthsParse[s].test(e))return s;if(n&&t==="MMM"&&this._shortMonthsParse[s].test(e))return s;if(!n&&this._monthsParse[s].test(e))return s}}function Xl(e,t){if(!e.isValid())return e;if(typeof t=="string"){if(/^\d+$/.test(t))t=be(t);else if(t=e.localeData().monthsParse(t),!Rr(t))return e}var n=t,s=e.date();return s=s<29?s:Math.min(s,Po(e.year(),n)),e._isUTC?e._d.setUTCMonth(n,s):e._d.setMonth(n,s),e}function ef(e){return e!=null?(Xl(this,e),z.updateOffset(this,!0),this):ki(this,"Month")}function I0(){return Po(this.year(),this.month())}function F0(e){return this._monthsParseExact?(Ce(this,"_monthsRegex")||tf.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(Ce(this,"_monthsShortRegex")||(this._monthsShortRegex=D0),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)}function W0(e){return this._monthsParseExact?(Ce(this,"_monthsRegex")||tf.call(this),e?this._monthsStrictRegex:this._monthsRegex):(Ce(this,"_monthsRegex")||(this._monthsRegex=M0),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)}function tf(){function e(h,m){return m.length-h.length}var t=[],n=[],s=[],a,c,u,l;for(a=0;a<12;a++)c=_r([2e3,a]),u=Pr(this.monthsShort(c,"")),l=Pr(this.months(c,"")),t.push(u),n.push(l),s.push(l),s.push(u);t.sort(e),n.sort(e),s.sort(e),this._monthsRegex=new RegExp("^("+s.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+t.join("|")+")","i")}function H0(e,t,n,s,a,c,u){var l;return e<100&&e>=0?(l=new Date(e+400,t,n,s,a,c,u),isFinite(l.getFullYear())&&l.setFullYear(e)):l=new Date(e,t,n,s,a,c,u),l}function xi(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 Ms(e,t,n){var s=7+t-n,a=(7+xi(e,0,s).getUTCDay()-t)%7;return-a+s-1}function rf(e,t,n,s,a){var c=(7+n-s)%7,u=Ms(e,s,a),l=1+7*(t-1)+c+u,h,m;return l<=0?(h=e-1,m=Ci(h)+l):l>Ci(e)?(h=e+1,m=l-Ci(e)):(h=e,m=l),{year:h,dayOfYear:m}}function Ri(e,t,n){var s=Ms(e.year(),t,n),a=Math.floor((e.dayOfYear()-s-1)/7)+1,c,u;return a<1?(u=e.year()-1,c=a+Lr(u,t,n)):a>Lr(e.year(),t,n)?(c=a-Lr(e.year(),t,n),u=e.year()+1):(u=e.year(),c=a),{week:c,year:u}}function Lr(e,t,n){var s=Ms(e,t,n),a=Ms(e+1,t,n);return(Ci(e)-s+a)/7}ie("w",["ww",2],"wo","week"),ie("W",["WW",2],"Wo","isoWeek"),Q("w",Ye,Yn),Q("ww",Ye,Nt),Q("W",Ye,Yn),Q("WW",Ye,Nt),Oi(["w","ww","W","WW"],function(e,t,n,s){t[s.substr(0,1)]=be(e)});function Y0(e){return Ri(e,this._week.dow,this._week.doy).week}var K0={dow:0,doy:6};function q0(){return this._week.dow}function $0(){return this._week.doy}function G0(e){var t=this.localeData().week(this);return e==null?t:this.add((e-t)*7,"d")}function V0(e){var t=Ri(this,1,4).week;return e==null?t:this.add((e-t)*7,"d")}ie("d",0,"do","day"),ie("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),ie("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),ie("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),ie("e",0,0,"weekday"),ie("E",0,0,"isoWeekday"),Q("d",Ye),Q("e",Ye),Q("E",Ye),Q("dd",function(e,t){return t.weekdaysMinRegex(e)}),Q("ddd",function(e,t){return t.weekdaysShortRegex(e)}),Q("dddd",function(e,t){return t.weekdaysRegex(e)}),Oi(["dd","ddd","dddd"],function(e,t,n,s){var a=n._locale.weekdaysParse(e,s,n._strict);a!=null?t.d=a:de(n).invalidWeekday=e}),Oi(["d","e","E"],function(e,t,n,s){t[s]=be(e)});function z0(e,t){return typeof e!="string"?e:isNaN(e)?(e=t.weekdaysParse(e),typeof e=="number"?e:null):parseInt(e,10)}function j0(e,t){return typeof e=="string"?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function Do(e,t){return e.slice(t,7).concat(e.slice(0,t))}var J0="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),nf="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Q0="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Z0=Ai,X0=Ai,ey=Ai;function ty(e,t){var n=ar(this._weekdays)?this._weekdays:this._weekdays[e&&e!==!0&&this._weekdays.isFormat.test(t)?"format":"standalone"];return e===!0?Do(n,this._week.dow):e?n[e.day()]:n}function ry(e){return e===!0?Do(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function ny(e){return e===!0?Do(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function iy(e,t,n){var s,a,c,u=e.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?t==="dddd"?(a=Xe.call(this._weekdaysParse,u),a!==-1?a:null):t==="ddd"?(a=Xe.call(this._shortWeekdaysParse,u),a!==-1?a:null):(a=Xe.call(this._minWeekdaysParse,u),a!==-1?a:null):t==="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)):t==="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(e,t,n){var s,a,c;if(this._weekdaysParseExact)return iy.call(this,e,t,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&&t==="dddd"&&this._fullWeekdaysParse[s].test(e))return s;if(n&&t==="ddd"&&this._shortWeekdaysParse[s].test(e))return s;if(n&&t==="dd"&&this._minWeekdaysParse[s].test(e))return s;if(!n&&this._weekdaysParse[s].test(e))return s}}function ay(e){if(!this.isValid())return e!=null?this:NaN;var t=ki(this,"Day");return e!=null?(e=z0(e,this.localeData()),this.add(e-t,"d")):t}function oy(e){if(!this.isValid())return e!=null?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return e==null?t:this.add(e-t,"d")}function uy(e){if(!this.isValid())return e!=null?this:NaN;if(e!=null){var t=j0(e,this.localeData());return this.day(this.day()%7?t:t-7)}else return this.day()||7}function cy(e){return this._weekdaysParseExact?(Ce(this,"_weekdaysRegex")||Mo.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(Ce(this,"_weekdaysRegex")||(this._weekdaysRegex=Z0),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function ly(e){return this._weekdaysParseExact?(Ce(this,"_weekdaysRegex")||Mo.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(Ce(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=X0),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function fy(e){return this._weekdaysParseExact?(Ce(this,"_weekdaysRegex")||Mo.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(Ce(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=ey),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Mo(){function e(b,E){return E.length-b.length}var t=[],n=[],s=[],a=[],c,u,l,h,m;for(c=0;c<7;c++)u=_r([2e3,1]).day(c),l=Pr(this.weekdaysMin(u,"")),h=Pr(this.weekdaysShort(u,"")),m=Pr(this.weekdays(u,"")),t.push(l),n.push(h),s.push(m),a.push(l),a.push(h),a.push(m);t.sort(e),n.sort(e),s.sort(e),a.sort(e),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("^("+t.join("|")+")","i")}function Lo(){return this.hours()%12||12}function hy(){return this.hours()||24}ie("H",["HH",2],0,"hour"),ie("h",["hh",2],0,Lo),ie("k",["kk",2],0,hy),ie("hmm",0,0,function(){return""+Lo.apply(this)+br(this.minutes(),2)}),ie("hmmss",0,0,function(){return""+Lo.apply(this)+br(this.minutes(),2)+br(this.seconds(),2)}),ie("Hmm",0,0,function(){return""+this.hours()+br(this.minutes(),2)}),ie("Hmmss",0,0,function(){return""+this.hours()+br(this.minutes(),2)+br(this.seconds(),2)});function sf(e,t){ie(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}sf("a",!0),sf("A",!1);function af(e,t){return t._meridiemParse}Q("a",af),Q("A",af),Q("H",Ye,xo),Q("h",Ye,Yn),Q("k",Ye,Yn),Q("HH",Ye,Nt),Q("hh",Ye,Nt),Q("kk",Ye,Nt),Q("hmm",Vl),Q("hmmss",zl),Q("Hmm",Vl),Q("Hmmss",zl),Le(["H","HH"],rt),Le(["k","kk"],function(e,t,n){var s=be(e);t[rt]=s===24?0:s}),Le(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),Le(["h","hh"],function(e,t,n){t[rt]=be(e),de(n).bigHour=!0}),Le("hmm",function(e,t,n){var s=e.length-2;t[rt]=be(e.substr(0,s)),t[ur]=be(e.substr(s)),de(n).bigHour=!0}),Le("hmmss",function(e,t,n){var s=e.length-4,a=e.length-2;t[rt]=be(e.substr(0,s)),t[ur]=be(e.substr(s,2)),t[Mr]=be(e.substr(a)),de(n).bigHour=!0}),Le("Hmm",function(e,t,n){var s=e.length-2;t[rt]=be(e.substr(0,s)),t[ur]=be(e.substr(s))}),Le("Hmmss",function(e,t,n){var s=e.length-4,a=e.length-2;t[rt]=be(e.substr(0,s)),t[ur]=be(e.substr(s,2)),t[Mr]=be(e.substr(a))});function dy(e){return(e+"").toLowerCase().charAt(0)==="p"}var py=/[ap]\.?m?\.?/i,my=Kn("Hours",!0);function gy(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"}var of={calendar:i0,longDateFormat:u0,invalidDate:l0,ordinal:h0,dayOfMonthOrdinalParse:d0,relativeTime:m0,months:P0,monthsShort:Ql,week:K0,weekdays:J0,weekdaysMin:Q0,weekdaysShort:nf,meridiemParse:py},$e={},Pi={},Di;function yy(e,t){var n,s=Math.min(e.length,t.length);for(n=0;n<s;n+=1)if(e[n]!==t[n])return n;return s}function uf(e){return e&&e.toLowerCase().replace("_","-")}function _y(e){for(var t=0,n,s,a,c;t<e.length;){for(c=uf(e[t]).split("-"),n=c.length,s=uf(e[t+1]),s=s?s.split("-"):null;n>0;){if(a=Ls(c.slice(0,n).join("-")),a)return a;if(s&&s.length>=n&&yy(c,s)>=n-1)break;n--}t++}return Di}function wy(e){return!!(e&&e.match("^[^/\\\\]*$"))}function Ls(e){var t=null,n;if($e[e]===void 0&&typeof module<"u"&&module&&module.exports&&wy(e))try{t=Di._abbr,n=require,n("./locale/"+e),en(t)}catch{$e[e]=null}return $e[e]}function en(e,t){var n;return e&&(Ct(t)?n=Nr(e):n=No(e,t),n?Di=n:typeof console<"u"&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),Di._abbr}function No(e,t){if(t!==null){var n,s=of;if(t.abbr=e,$e[e]!=null)Yl("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),s=$e[e]._config;else if(t.parentLocale!=null)if($e[t.parentLocale]!=null)s=$e[t.parentLocale]._config;else if(n=Ls(t.parentLocale),n!=null)s=n._config;else return Pi[t.parentLocale]||(Pi[t.parentLocale]=[]),Pi[t.parentLocale].push({name:e,config:t}),null;return $e[e]=new So(vo(s,t)),Pi[e]&&Pi[e].forEach(function(a){No(a.name,a.config)}),en(e),$e[e]}else return delete $e[e],null}function by(e,t){if(t!=null){var n,s,a=of;$e[e]!=null&&$e[e].parentLocale!=null?$e[e].set(vo($e[e]._config,t)):(s=Ls(e),s!=null&&(a=s._config),t=vo(a,t),s==null&&(t.abbr=e),n=new So(t),n.parentLocale=$e[e],$e[e]=n),en(e)}else $e[e]!=null&&($e[e].parentLocale!=null?($e[e]=$e[e].parentLocale,e===en()&&en(e)):$e[e]!=null&&delete $e[e]);return $e[e]}function Nr(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return Di;if(!ar(e)){if(t=Ls(e),t)return t;e=[e]}return _y(e)}function vy(){return Eo($e)}function Uo(e){var t,n=e._a;return n&&de(e).overflow===-2&&(t=n[Dr]<0||n[Dr]>11?Dr:n[vr]<1||n[vr]>Po(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(e)._overflowDayOfYear&&(t<pt||t>vr)&&(t=vr),de(e)._overflowWeeks&&t===-1&&(t=A0),de(e)._overflowWeekday&&t===-1&&(t=O0),de(e).overflow=t),e}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)?)?$/,Ey=/^\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=/Z|[+-]\d\d(?::?\d\d)?/,Ns=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],Bo=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Ay=/^\/?Date\((-?\d+)/i,Oy=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,Cy={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function cf(e){var t,n,s=e._i,a=Sy.exec(s)||Ey.exec(s),c,u,l,h,m=Ns.length,b=Bo.length;if(a){for(de(e).iso=!0,t=0,n=m;t<n;t++)if(Ns[t][1].exec(a[1])){u=Ns[t][0],c=Ns[t][2]!==!1;break}if(u==null){e._isValid=!1;return}if(a[3]){for(t=0,n=b;t<n;t++)if(Bo[t][1].exec(a[3])){l=(a[2]||" ")+Bo[t][0];break}if(l==null){e._isValid=!1;return}}if(!c&&l!=null){e._isValid=!1;return}if(a[4])if(Ty.exec(a[4]))h="Z";else{e._isValid=!1;return}e._f=u+(l||"")+(h||""),Fo(e)}else e._isValid=!1}function ky(e,t,n,s,a,c){var u=[xy(e),Ql.indexOf(t),parseInt(n,10),parseInt(s,10),parseInt(a,10)];return c&&u.push(parseInt(c,10)),u}function xy(e){var t=parseInt(e,10);return t<=49?2e3+t:t<=999?1900+t:t}function Ry(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function Py(e,t,n){if(e){var s=nf.indexOf(e),a=new Date(t[0],t[1],t[2]).getDay();if(s!==a)return de(n).weekdayMismatch=!0,n._isValid=!1,!1}return!0}function Dy(e,t,n){if(e)return Cy[e];if(t)return 0;var s=parseInt(n,10),a=s%100,c=(s-a)/100;return c*60+a}function lf(e){var t=Oy.exec(Ry(e._i)),n;if(t){if(n=ky(t[4],t[3],t[2],t[5],t[6],t[7]),!Py(t[1],n,e))return;e._a=n,e._tzm=Dy(t[8],t[9],t[10]),e._d=xi.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),de(e).rfc2822=!0}else e._isValid=!1}function My(e){var t=Ay.exec(e._i);if(t!==null){e._d=new Date(+t[1]);return}if(cf(e),e._isValid===!1)delete e._isValid;else return;if(lf(e),e._isValid===!1)delete e._isValid;else return;e._strict?e._isValid=!1:z.createFromInputFallback(e)}z.createFromInputFallback=Gt("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))});function qn(e,t,n){return e??t??n}function Ly(e){var t=new Date(z.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function Io(e){var t,n,s=[],a,c,u;if(!e._d){for(a=Ly(e),e._w&&e._a[vr]==null&&e._a[Dr]==null&&Ny(e),e._dayOfYear!=null&&(u=qn(e._a[pt],a[pt]),(e._dayOfYear>Ci(u)||e._dayOfYear===0)&&(de(e)._overflowDayOfYear=!0),n=xi(u,0,e._dayOfYear),e._a[Dr]=n.getUTCMonth(),e._a[vr]=n.getUTCDate()),t=0;t<3&&e._a[t]==null;++t)e._a[t]=s[t]=a[t];for(;t<7;t++)e._a[t]=s[t]=e._a[t]==null?t===2?1:0:e._a[t];e._a[rt]===24&&e._a[ur]===0&&e._a[Mr]===0&&e._a[bn]===0&&(e._nextDay=!0,e._a[rt]=0),e._d=(e._useUTC?xi:H0).apply(null,s),c=e._useUTC?e._d.getUTCDay():e._d.getDay(),e._tzm!=null&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[rt]=24),e._w&&typeof e._w.d<"u"&&e._w.d!==c&&(de(e).weekdayMismatch=!0)}}function Ny(e){var t,n,s,a,c,u,l,h,m;t=e._w,t.GG!=null||t.W!=null||t.E!=null?(c=1,u=4,n=qn(t.GG,e._a[pt],Ri(Ke(),1,4).year),s=qn(t.W,1),a=qn(t.E,1),(a<1||a>7)&&(h=!0)):(c=e._locale._week.dow,u=e._locale._week.doy,m=Ri(Ke(),c,u),n=qn(t.gg,e._a[pt],m.year),s=qn(t.w,m.week),t.d!=null?(a=t.d,(a<0||a>6)&&(h=!0)):t.e!=null?(a=t.e+c,(t.e<0||t.e>6)&&(h=!0)):a=c),s<1||s>Lr(n,c,u)?de(e)._overflowWeeks=!0:h!=null?de(e)._overflowWeekday=!0:(l=rf(n,s,a,c,u),e._a[pt]=l.year,e._dayOfYear=l.dayOfYear)}z.ISO_8601=function(){},z.RFC_2822=function(){};function Fo(e){if(e._f===z.ISO_8601){cf(e);return}if(e._f===z.RFC_2822){lf(e);return}e._a=[],de(e).empty=!0;var t=""+e._i,n,s,a,c,u,l=t.length,h=0,m,b;for(a=Kl(e._f,e._locale).match(To)||[],b=a.length,n=0;n<b;n++)c=a[n],s=(t.match(S0(c,e))||[])[0],s&&(u=t.substr(0,t.indexOf(s)),u.length>0&&de(e).unusedInput.push(u),t=t.slice(t.indexOf(s)+s.length),h+=s.length),Wn[c]?(s?de(e).empty=!1:de(e).unusedTokens.push(c),T0(c,s,e)):e._strict&&!s&&de(e).unusedTokens.push(c);de(e).charsLeftOver=l-h,t.length>0&&de(e).unusedInput.push(t),e._a[rt]<=12&&de(e).bigHour===!0&&e._a[rt]>0&&(de(e).bigHour=void 0),de(e).parsedDateParts=e._a.slice(0),de(e).meridiem=e._meridiem,e._a[rt]=Uy(e._locale,e._a[rt],e._meridiem),m=de(e).era,m!==null&&(e._a[pt]=e._locale.erasConvertYear(m,e._a[pt])),Io(e),Uo(e)}function Uy(e,t,n){var s;return n==null?t:e.meridiemHour!=null?e.meridiemHour(t,n):(e.isPM!=null&&(s=e.isPM(n),s&&t<12&&(t+=12),!s&&t===12&&(t=0)),t)}function By(e){var t,n,s,a,c,u,l=!1,h=e._f.length;if(h===0){de(e).invalidFormat=!0,e._d=new Date(NaN);return}for(a=0;a<h;a++)c=0,u=!1,t=bo({},e),e._useUTC!=null&&(t._useUTC=e._useUTC),t._f=e._f[a],Fo(t),_o(t)&&(u=!0),c+=de(t).charsLeftOver,c+=de(t).unusedTokens.length*10,de(t).score=c,l?c<s&&(s=c,n=t):(s==null||c<s||u)&&(s=c,n=t,u&&(l=!0));Xr(e,n||t)}function Iy(e){if(!e._d){var t=Oo(e._i),n=t.day===void 0?t.date:t.day;e._a=Il([t.year,t.month,n,t.hour,t.minute,t.second,t.millisecond],function(s){return s&&parseInt(s,10)}),Io(e)}}function Fy(e){var t=new Ti(Uo(ff(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function ff(e){var t=e._i,n=e._f;return e._locale=e._locale||Nr(e._l),t===null||n===void 0&&t===""?Es({nullInput:!0}):(typeof t=="string"&&(e._i=t=e._locale.preparse(t)),or(t)?new Ti(Uo(t)):(Ei(t)?e._d=t:ar(n)?By(e):n?Fo(e):Wy(e),_o(e)||(e._d=null),e))}function Wy(e){var t=e._i;Ct(t)?e._d=new Date(z.now()):Ei(t)?e._d=new Date(t.valueOf()):typeof t=="string"?My(e):ar(t)?(e._a=Il(t.slice(0),function(n){return parseInt(n,10)}),Io(e)):wn(t)?Iy(e):Rr(t)?e._d=new Date(t):z.createFromInputFallback(e)}function hf(e,t,n,s,a){var c={};return(t===!0||t===!1)&&(s=t,t=void 0),(n===!0||n===!1)&&(s=n,n=void 0),(wn(e)&&go(e)||ar(e)&&e.length===0)&&(e=void 0),c._isAMomentObject=!0,c._useUTC=c._isUTC=a,c._l=n,c._i=e,c._f=t,c._strict=s,Fy(c)}function Ke(e,t,n,s){return hf(e,t,n,s,!1)}var Hy=Gt("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Ke.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:Es()}),Yy=Gt("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Ke.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:Es()});function df(e,t){var n,s;if(t.length===1&&ar(t[0])&&(t=t[0]),!t.length)return Ke();for(n=t[0],s=1;s<t.length;++s)(!t[s].isValid()||t[s][e](n))&&(n=t[s]);return n}function Ky(){var e=[].slice.call(arguments,0);return df("isBefore",e)}function qy(){var e=[].slice.call(arguments,0);return df("isAfter",e)}var $y=function(){return Date.now?Date.now():+new Date},Mi=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Gy(e){var t,n=!1,s,a=Mi.length;for(t in e)if(Ce(e,t)&&!(Xe.call(Mi,t)!==-1&&(e[t]==null||!isNaN(e[t]))))return!1;for(s=0;s<a;++s)if(e[Mi[s]]){if(n)return!1;parseFloat(e[Mi[s]])!==be(e[Mi[s]])&&(n=!0)}return!0}function Vy(){return this._isValid}function zy(){return cr(NaN)}function Us(e){var t=Oo(e),n=t.year||0,s=t.quarter||0,a=t.month||0,c=t.week||t.isoWeek||0,u=t.day||0,l=t.hour||0,h=t.minute||0,m=t.second||0,b=t.millisecond||0;this._isValid=Gy(t),this._milliseconds=+b+m*1e3+h*6e4+l*1e3*60*60,this._days=+u+c*7,this._months=+a+s*3+n*12,this._data={},this._locale=Nr(),this._bubble()}function Bs(e){return e instanceof Us}function Wo(e){return e<0?Math.round(-1*e)*-1:Math.round(e)}function jy(e,t,n){var s=Math.min(e.length,t.length),a=Math.abs(e.length-t.length),c=0,u;for(u=0;u<s;u++)be(e[u])!==be(t[u])&&c++;return c+a}function pf(e,t){ie(e,0,0,function(){var n=this.utcOffset(),s="+";return n<0&&(n=-n,s="-"),s+br(~~(n/60),2)+t+br(~~n%60,2)})}pf("Z",":"),pf("ZZ",""),Q("Z",Rs),Q("ZZ",Rs),Le(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=Ho(Rs,e)});var Jy=/([\+\-]|\d\d)/gi;function Ho(e,t){var n=(t||"").match(e),s,a,c;return n===null?null:(s=n[n.length-1]||[],a=(s+"").match(Jy)||["-",0,0],c=+(a[1]*60)+be(a[2]),c===0?0:a[0]==="+"?c:-c)}function Yo(e,t){var n,s;return t._isUTC?(n=t.clone(),s=(or(e)||Ei(e)?e.valueOf():Ke(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+s),z.updateOffset(n,!1),n):Ke(e).local()}function Ko(e){return-Math.round(e._d.getTimezoneOffset())}z.updateOffset=function(){};function Qy(e,t,n){var s=this._offset||0,a;if(!this.isValid())return e!=null?this:NaN;if(e!=null){if(typeof e=="string"){if(e=Ho(Rs,e),e===null)return this}else Math.abs(e)<16&&!n&&(e=e*60);return!this._isUTC&&t&&(a=Ko(this)),this._offset=e,this._isUTC=!0,a!=null&&this.add(a,"m"),s!==e&&(!t||this._changeInProgress?_f(this,cr(e-s,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,z.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?s:Ko(this)}function Zy(e,t){return e!=null?(typeof e!="string"&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}function Xy(e){return this.utcOffset(0,e)}function e_(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Ko(this),"m")),this}function t_(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var e=Ho(b0,this._i);e!=null?this.utcOffset(e):this.utcOffset(0,!0)}return this}function r_(e){return this.isValid()?(e=e?Ke(e).utcOffset():0,(this.utcOffset()-e)%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 e={},t;return bo(e,this),e=ff(e),e._a?(t=e._isUTC?_r(e._a):Ke(e._a),this._isDSTShifted=this.isValid()&&jy(e._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function s_(){return this.isValid()?!this._isUTC:!1}function a_(){return this.isValid()?this._isUTC:!1}function mf(){return this.isValid()?this._isUTC&&this._offset===0:!1}var o_=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,u_=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function cr(e,t){var n=e,s=null,a,c,u;return Bs(e)?n={ms:e._milliseconds,d:e._days,M:e._months}:Rr(e)||!isNaN(+e)?(n={},t?n[t]=+e:n.milliseconds=+e):(s=o_.exec(e))?(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(Wo(s[bn]*1e3))*a}):(s=u_.exec(e))?(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_(Ke(n.from),Ke(n.to)),n={},n.ms=u.milliseconds,n.M=u.months),c=new Us(n),Bs(e)&&Ce(e,"_locale")&&(c._locale=e._locale),Bs(e)&&Ce(e,"_isValid")&&(c._isValid=e._isValid),c}cr.fn=Us.prototype,cr.invalid=zy;function vn(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function gf(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 c_(e,t){var n;return e.isValid()&&t.isValid()?(t=Yo(t,e),e.isBefore(t)?n=gf(e,t):(n=gf(t,e),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function yf(e,t){return function(n,s){var a,c;return s!==null&&!isNaN(+s)&&(Yl(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."),c=n,n=s,s=c),a=cr(n,s),_f(this,a,e),this}}function _f(e,t,n,s){var a=t._milliseconds,c=Wo(t._days),u=Wo(t._months);e.isValid()&&(s=s??!0,u&&Xl(e,ki(e,"Month")+u*n),c&&Jl(e,"Date",ki(e,"Date")+c*n),a&&e._d.setTime(e._d.valueOf()+a*n),s&&z.updateOffset(e,c||u))}var l_=yf(1,"add"),f_=yf(-1,"subtract");function wf(e){return typeof e=="string"||e instanceof String}function h_(e){return or(e)||Ei(e)||wf(e)||Rr(e)||p_(e)||d_(e)||e===null||e===void 0}function d_(e){var t=wn(e)&&!go(e),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(e,c);return t&&n}function p_(e){var t=ar(e),n=!1;return t&&(n=e.filter(function(s){return!Rr(s)&&wf(e)}).length===0),t&&n}function m_(e){var t=wn(e)&&!go(e),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(e,c);return t&&n}function g_(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 y_(e,t){arguments.length===1&&(arguments[0]?h_(arguments[0])?(e=arguments[0],t=void 0):m_(arguments[0])&&(t=arguments[0],e=void 0):(e=void 0,t=void 0));var n=e||Ke(),s=Yo(n,this).startOf("day"),a=z.calendarFormat(this,s)||"sameElse",c=t&&(wr(t[a])?t[a].call(this,n):t[a]);return this.format(c||this.localeData().calendar(a,this,Ke(n)))}function __(){return new Ti(this)}function w_(e,t){var n=or(e)?e:Ke(e);return this.isValid()&&n.isValid()?(t=Vt(t)||"millisecond",t==="millisecond"?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf()):!1}function b_(e,t){var n=or(e)?e:Ke(e);return this.isValid()&&n.isValid()?(t=Vt(t)||"millisecond",t==="millisecond"?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf()):!1}function v_(e,t,n,s){var a=or(e)?e:Ke(e),c=or(t)?t:Ke(t);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_(e,t){var n=or(e)?e:Ke(e),s;return this.isValid()&&n.isValid()?(t=Vt(t)||"millisecond",t==="millisecond"?this.valueOf()===n.valueOf():(s=n.valueOf(),this.clone().startOf(t).valueOf()<=s&&s<=this.clone().endOf(t).valueOf())):!1}function E_(e,t){return this.isSame(e,t)||this.isAfter(e,t)}function T_(e,t){return this.isSame(e,t)||this.isBefore(e,t)}function A_(e,t,n){var s,a,c;if(!this.isValid())return NaN;if(s=Yo(e,this),!s.isValid())return NaN;switch(a=(s.utcOffset()-this.utcOffset())*6e4,t=Vt(t),t){case"year":c=Is(this,s)/12;break;case"month":c=Is(this,s);break;case"quarter":c=Is(this,s)/3;break;case"second":c=(this-s)/1e3;break;case"minute":c=(this-s)/6e4;break;case"hour":c=(this-s)/36e5;break;case"day":c=(this-s-a)/864e5;break;case"week":c=(this-s-a)/6048e5;break;default:c=this-s}return n?c:zt(c)}function Is(e,t){if(e.date()<t.date())return-Is(t,e);var n=(t.year()-e.year())*12+(t.month()-e.month()),s=e.clone().add(n,"months"),a,c;return t-s<0?(a=e.clone().add(n-1,"months"),c=(t-s)/(s-a)):(a=e.clone().add(n+1,"months"),c=(t-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 C_(e){if(!this.isValid())return null;var t=e!==!0,n=t?this.clone().utc():this;return n.year()<0||n.year()>9999?As(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):wr(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",As(n,"Z")):As(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function k_(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="",n,s,a,c;return this.isLocal()||(e=this.utcOffset()===0?"moment.utc":"moment.parseZone",t="Z"),n="["+e+'("]',s=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",a="-MM-DD[T]HH:mm:ss.SSS",c=t+'[")]',this.format(n+s+a+c)}function x_(e){e||(e=this.isUtc()?z.defaultFormatUtc:z.defaultFormat);var t=As(this,e);return this.localeData().postformat(t)}function R_(e,t){return this.isValid()&&(or(e)&&e.isValid()||Ke(e).isValid())?cr({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function P_(e){return this.from(Ke(),e)}function D_(e,t){return this.isValid()&&(or(e)&&e.isValid()||Ke(e).isValid())?cr({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function M_(e){return this.to(Ke(),e)}function bf(e){var t;return e===void 0?this._locale._abbr:(t=Nr(e),t!=null&&(this._locale=t),this)}var vf=Gt("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 Sf(){return this._locale}var Fs=1e3,$n=60*Fs,Ws=60*$n,Ef=(365*400+97)*24*Ws;function Gn(e,t){return(e%t+t)%t}function Tf(e,t,n){return e<100&&e>=0?new Date(e+400,t,n)-Ef:new Date(e,t,n).valueOf()}function Af(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-Ef:Date.UTC(e,t,n)}function L_(e){var t,n;if(e=Vt(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?Af:Tf,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-=Gn(t+(this._isUTC?0:this.utcOffset()*$n),Ws);break;case"minute":t=this._d.valueOf(),t-=Gn(t,$n);break;case"second":t=this._d.valueOf(),t-=Gn(t,Fs);break}return this._d.setTime(t),z.updateOffset(this,!0),this}function N_(e){var t,n;if(e=Vt(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?Af:Tf,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+=Ws-Gn(t+(this._isUTC?0:this.utcOffset()*$n),Ws)-1;break;case"minute":t=this._d.valueOf(),t+=$n-Gn(t,$n)-1;break;case"second":t=this._d.valueOf(),t+=Fs-Gn(t,Fs)-1;break}return this._d.setTime(t),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 e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function W_(){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 H_(){return this.isValid()?this.toISOString():null}function Y_(){return _o(this)}function K_(){return Xr({},de(this))}function q_(){return de(this).overflow}function $_(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}ie("N",0,0,"eraAbbr"),ie("NN",0,0,"eraAbbr"),ie("NNN",0,0,"eraAbbr"),ie("NNNN",0,0,"eraName"),ie("NNNNN",0,0,"eraNarrow"),ie("y",["y",1],"yo","eraYear"),ie("y",["yy",2],0,"eraYear"),ie("y",["yyy",3],0,"eraYear"),ie("y",["yyyy",4],0,"eraYear"),Q("N",qo),Q("NN",qo),Q("NNN",qo),Q("NNNN",rw),Q("NNNNN",nw),Le(["N","NN","NNN","NNNN","NNNNN"],function(e,t,n,s){var a=n._locale.erasParse(e,s,n._strict);a?de(n).era=a:de(n).invalidEra=e}),Q("y",Hn),Q("yy",Hn),Q("yyy",Hn),Q("yyyy",Hn),Q("yo",iw),Le(["y","yy","yyy","yyyy"],pt),Le(["yo"],function(e,t,n,s){var a;n._locale._eraYearOrdinalRegex&&(a=e.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?t[pt]=n._locale.eraYearOrdinalParse(e,a):t[pt]=parseInt(e,10)});function G_(e,t){var n,s,a,c=this._eras||Nr("en")._eras;for(n=0,s=c.length;n<s;++n){switch(typeof c[n].since){case"string":a=z(c[n].since).startOf("day"),c[n].since=a.valueOf();break}switch(typeof c[n].until){case"undefined":c[n].until=1/0;break;case"string":a=z(c[n].until).startOf("day").valueOf(),c[n].until=a.valueOf();break}}return c}function V_(e,t,n){var s,a,c=this.eras(),u,l,h;for(e=e.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(t){case"N":case"NN":case"NNN":if(l===e)return c[s];break;case"NNNN":if(u===e)return c[s];break;case"NNNNN":if(h===e)return c[s];break}else if([u,l,h].indexOf(e)>=0)return c[s]}function z_(e,t){var n=e.since<=e.until?1:-1;return t===void 0?z(e.since).year():z(e.since).year()+(t-e.offset)*n}function j_(){var e,t,n,s=this.localeData().eras();for(e=0,t=s.length;e<t;++e)if(n=this.clone().startOf("day").valueOf(),s[e].since<=n&&n<=s[e].until||s[e].until<=n&&n<=s[e].since)return s[e].name;return""}function J_(){var e,t,n,s=this.localeData().eras();for(e=0,t=s.length;e<t;++e)if(n=this.clone().startOf("day").valueOf(),s[e].since<=n&&n<=s[e].until||s[e].until<=n&&n<=s[e].since)return s[e].narrow;return""}function Q_(){var e,t,n,s=this.localeData().eras();for(e=0,t=s.length;e<t;++e)if(n=this.clone().startOf("day").valueOf(),s[e].since<=n&&n<=s[e].until||s[e].until<=n&&n<=s[e].since)return s[e].abbr;return""}function Z_(){var e,t,n,s,a=this.localeData().eras();for(e=0,t=a.length;e<t;++e)if(n=a[e].since<=a[e].until?1:-1,s=this.clone().startOf("day").valueOf(),a[e].since<=s&&s<=a[e].until||a[e].until<=s&&s<=a[e].since)return(this.year()-z(a[e].since).year())*n+a[e].offset;return this.year()}function X_(e){return Ce(this,"_erasNameRegex")||$o.call(this),e?this._erasNameRegex:this._erasRegex}function ew(e){return Ce(this,"_erasAbbrRegex")||$o.call(this),e?this._erasAbbrRegex:this._erasRegex}function tw(e){return Ce(this,"_erasNarrowRegex")||$o.call(this),e?this._erasNarrowRegex:this._erasRegex}function qo(e,t){return t.erasAbbrRegex(e)}function rw(e,t){return t.erasNameRegex(e)}function nw(e,t){return t.erasNarrowRegex(e)}function iw(e,t){return t._eraYearOrdinalRegex||Hn}function $o(){var e=[],t=[],n=[],s=[],a,c,u,l,h,m=this.eras();for(a=0,c=m.length;a<c;++a)u=Pr(m[a].name),l=Pr(m[a].abbr),h=Pr(m[a].narrow),t.push(u),e.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("^("+t.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+e.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+n.join("|")+")","i")}ie(0,["gg",2],0,function(){return this.weekYear()%100}),ie(0,["GG",2],0,function(){return this.isoWeekYear()%100});function Hs(e,t){ie(0,[e,e.length],0,t)}Hs("gggg","weekYear"),Hs("ggggg","weekYear"),Hs("GGGG","isoWeekYear"),Hs("GGGGG","isoWeekYear"),Q("G",xs),Q("g",xs),Q("GG",Ye,Nt),Q("gg",Ye,Nt),Q("GGGG",ko,Co),Q("gggg",ko,Co),Q("GGGGG",ks,Os),Q("ggggg",ks,Os),Oi(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,s){t[s.substr(0,2)]=be(e)}),Oi(["gg","GG"],function(e,t,n,s){t[s]=z.parseTwoDigitYear(e)});function sw(e){return Of.call(this,e,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function aw(e){return Of.call(this,e,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 e=this.localeData()._week;return Lr(this.year(),e.dow,e.doy)}function lw(){var e=this.localeData()._week;return Lr(this.weekYear(),e.dow,e.doy)}function Of(e,t,n,s,a){var c;return e==null?Ri(this,s,a).year:(c=Lr(e,s,a),t>c&&(t=c),fw.call(this,e,t,n,s,a))}function fw(e,t,n,s,a){var c=rf(e,t,n,s,a),u=xi(c.year,0,c.dayOfYear);return this.year(u.getUTCFullYear()),this.month(u.getUTCMonth()),this.date(u.getUTCDate()),this}ie("Q",0,"Qo","quarter"),Q("Q",$l),Le("Q",function(e,t){t[Dr]=(be(e)-1)*3});function hw(e){return e==null?Math.ceil((this.month()+1)/3):this.month((e-1)*3+this.month()%3)}ie("D",["DD",2],"Do","date"),Q("D",Ye,Yn),Q("DD",Ye,Nt),Q("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),Le(["D","DD"],vr),Le("Do",function(e,t){t[vr]=be(e.match(Ye)[0])});var Cf=Kn("Date",!0);ie("DDD",["DDDD",3],"DDDo","dayOfYear"),Q("DDD",Cs),Q("DDDD",Gl),Le(["DDD","DDDD"],function(e,t,n){n._dayOfYear=be(e)});function dw(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return e==null?t:this.add(e-t,"d")}ie("m",["mm",2],0,"minute"),Q("m",Ye,xo),Q("mm",Ye,Nt),Le(["m","mm"],ur);var pw=Kn("Minutes",!1);ie("s",["ss",2],0,"second"),Q("s",Ye,xo),Q("ss",Ye,Nt),Le(["s","ss"],Mr);var mw=Kn("Seconds",!1);ie("S",0,0,function(){return~~(this.millisecond()/100)}),ie(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),ie(0,["SSS",3],0,"millisecond"),ie(0,["SSSS",4],0,function(){return this.millisecond()*10}),ie(0,["SSSSS",5],0,function(){return this.millisecond()*100}),ie(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),ie(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),ie(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),ie(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),Q("S",Cs,$l),Q("SS",Cs,Nt),Q("SSS",Cs,Gl);var tn,kf;for(tn="SSSS";tn.length<=9;tn+="S")Q(tn,Hn);function gw(e,t){t[bn]=be(("0."+e)*1e3)}for(tn="S";tn.length<=9;tn+="S")Le(tn,gw);kf=Kn("Milliseconds",!1),ie("z",0,0,"zoneAbbr"),ie("zz",0,0,"zoneName");function yw(){return this._isUTC?"UTC":""}function _w(){return this._isUTC?"Coordinated Universal Time":""}var V=Ti.prototype;V.add=l_,V.calendar=y_,V.clone=__,V.diff=A_,V.endOf=N_,V.format=x_,V.from=R_,V.fromNow=P_,V.to=D_,V.toNow=M_,V.get=k0,V.invalidAt=q_,V.isAfter=w_,V.isBefore=b_,V.isBetween=v_,V.isSame=S_,V.isSameOrAfter=E_,V.isSameOrBefore=T_,V.isValid=Y_,V.lang=vf,V.locale=bf,V.localeData=Sf,V.max=Yy,V.min=Hy,V.parsingFlags=K_,V.set=x0,V.startOf=L_,V.subtract=f_,V.toArray=F_,V.toObject=W_,V.toDate=I_,V.toISOString=C_,V.inspect=k_,typeof Symbol<"u"&&Symbol.for!=null&&(V[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),V.toJSON=H_,V.toString=O_,V.unix=B_,V.valueOf=U_,V.creationData=$_,V.eraName=j_,V.eraNarrow=J_,V.eraAbbr=Q_,V.eraYear=Z_,V.year=jl,V.isLeapYear=C0,V.weekYear=sw,V.isoWeekYear=aw,V.quarter=V.quarters=hw,V.month=ef,V.daysInMonth=I0,V.week=V.weeks=G0,V.isoWeek=V.isoWeeks=V0,V.weeksInYear=cw,V.weeksInWeekYear=lw,V.isoWeeksInYear=ow,V.isoWeeksInISOWeekYear=uw,V.date=Cf,V.day=V.days=ay,V.weekday=oy,V.isoWeekday=uy,V.dayOfYear=dw,V.hour=V.hours=my,V.minute=V.minutes=pw,V.second=V.seconds=mw,V.millisecond=V.milliseconds=kf,V.utcOffset=Qy,V.utc=Xy,V.local=e_,V.parseZone=t_,V.hasAlignedHourOffset=r_,V.isDST=n_,V.isLocal=s_,V.isUtcOffset=a_,V.isUtc=mf,V.isUTC=mf,V.zoneAbbr=yw,V.zoneName=_w,V.dates=Gt("dates accessor is deprecated. Use date instead.",Cf),V.months=Gt("months accessor is deprecated. Use month instead",ef),V.years=Gt("years accessor is deprecated. Use year instead",jl),V.zone=Gt("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Zy),V.isDSTShifted=Gt("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",i_);function ww(e){return Ke(e*1e3)}function bw(){return Ke.apply(null,arguments).parseZone()}function xf(e){return e}var ke=So.prototype;ke.calendar=s0,ke.longDateFormat=c0,ke.invalidDate=f0,ke.ordinal=p0,ke.preparse=xf,ke.postformat=xf,ke.relativeTime=g0,ke.pastFuture=y0,ke.set=n0,ke.eras=G_,ke.erasParse=V_,ke.erasConvertYear=z_,ke.erasAbbrRegex=ew,ke.erasNameRegex=X_,ke.erasNarrowRegex=tw,ke.months=L0,ke.monthsShort=N0,ke.monthsParse=B0,ke.monthsRegex=W0,ke.monthsShortRegex=F0,ke.week=Y0,ke.firstDayOfYear=$0,ke.firstDayOfWeek=q0,ke.weekdays=ty,ke.weekdaysMin=ny,ke.weekdaysShort=ry,ke.weekdaysParse=sy,ke.weekdaysRegex=cy,ke.weekdaysShortRegex=ly,ke.weekdaysMinRegex=fy,ke.isPM=dy,ke.meridiem=gy;function Ys(e,t,n,s){var a=Nr(),c=_r().set(s,t);return a[n](c,e)}function Rf(e,t,n){if(Rr(e)&&(t=e,e=void 0),e=e||"",t!=null)return Ys(e,t,n,"month");var s,a=[];for(s=0;s<12;s++)a[s]=Ys(e,s,n,"month");return a}function Go(e,t,n,s){typeof e=="boolean"?(Rr(t)&&(n=t,t=void 0),t=t||""):(t=e,n=t,e=!1,Rr(t)&&(n=t,t=void 0),t=t||"");var a=Nr(),c=e?a._week.dow:0,u,l=[];if(n!=null)return Ys(t,(n+c)%7,s,"day");for(u=0;u<7;u++)l[u]=Ys(t,(u+c)%7,s,"day");return l}function vw(e,t){return Rf(e,t,"months")}function Sw(e,t){return Rf(e,t,"monthsShort")}function Ew(e,t,n){return Go(e,t,n,"weekdays")}function Tw(e,t,n){return Go(e,t,n,"weekdaysShort")}function Aw(e,t,n){return Go(e,t,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(e){var t=e%10,n=be(e%100/10)===1?"th":t===1?"st":t===2?"nd":t===3?"rd":"th";return e+n}}),z.lang=Gt("moment.lang is deprecated. Use moment.locale instead.",en),z.langData=Gt("moment.langData is deprecated. Use moment.localeData instead.",Nr);var Ur=Math.abs;function Ow(){var e=this._data;return this._milliseconds=Ur(this._milliseconds),this._days=Ur(this._days),this._months=Ur(this._months),e.milliseconds=Ur(e.milliseconds),e.seconds=Ur(e.seconds),e.minutes=Ur(e.minutes),e.hours=Ur(e.hours),e.months=Ur(e.months),e.years=Ur(e.years),this}function Pf(e,t,n,s){var a=cr(t,n);return e._milliseconds+=s*a._milliseconds,e._days+=s*a._days,e._months+=s*a._months,e._bubble()}function Cw(e,t){return Pf(this,e,t,1)}function kw(e,t){return Pf(this,e,t,-1)}function Df(e){return e<0?Math.floor(e):Math.ceil(e)}function xw(){var e=this._milliseconds,t=this._days,n=this._months,s=this._data,a,c,u,l,h;return e>=0&&t>=0&&n>=0||e<=0&&t<=0&&n<=0||(e+=Df(Vo(n)+t)*864e5,t=0,n=0),s.milliseconds=e%1e3,a=zt(e/1e3),s.seconds=a%60,c=zt(a/60),s.minutes=c%60,u=zt(c/60),s.hours=u%24,t+=zt(u/24),h=zt(Mf(t)),n+=h,t-=Df(Vo(h)),l=zt(n/12),n%=12,s.days=t,s.months=n,s.years=l,this}function Mf(e){return e*4800/146097}function Vo(e){return e*146097/4800}function Rw(e){if(!this.isValid())return NaN;var t,n,s=this._milliseconds;if(e=Vt(e),e==="month"||e==="quarter"||e==="year")switch(t=this._days+s/864e5,n=this._months+Mf(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(Vo(this._months)),e){case"week":return t/7+s/6048e5;case"day":return t+s/864e5;case"hour":return t*24+s/36e5;case"minute":return t*1440+s/6e4;case"second":return t*86400+s/1e3;case"millisecond":return Math.floor(t*864e5)+s;default:throw new Error("Unknown unit "+e)}}function Br(e){return function(){return this.as(e)}}var Lf=Br("ms"),Pw=Br("s"),Dw=Br("m"),Mw=Br("h"),Lw=Br("d"),Nw=Br("w"),Uw=Br("M"),Bw=Br("Q"),Iw=Br("y"),Fw=Lf;function Ww(){return cr(this)}function Hw(e){return e=Vt(e),this.isValid()?this[e+"s"]():NaN}function Sn(e){return function(){return this.isValid()?this._data[e]:NaN}}var Yw=Sn("milliseconds"),Kw=Sn("seconds"),qw=Sn("minutes"),$w=Sn("hours"),Gw=Sn("days"),Vw=Sn("months"),zw=Sn("years");function jw(){return zt(this.days()/7)}var Ir=Math.round,Vn={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function Jw(e,t,n,s,a){return a.relativeTime(t||1,!!n,e,s)}function Qw(e,t,n,s){var a=cr(e).abs(),c=Ir(a.as("s")),u=Ir(a.as("m")),l=Ir(a.as("h")),h=Ir(a.as("d")),m=Ir(a.as("M")),b=Ir(a.as("w")),E=Ir(a.as("y")),R=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&&(R=R||b<=1&&["w"]||b<n.w&&["ww",b]),R=R||m<=1&&["M"]||m<n.M&&["MM",m]||E<=1&&["y"]||["yy",E],R[2]=t,R[3]=+e>0,R[4]=s,Jw.apply(null,R)}function Zw(e){return e===void 0?Ir:typeof e=="function"?(Ir=e,!0):!1}function Xw(e,t){return Vn[e]===void 0?!1:t===void 0?Vn[e]:(Vn[e]=t,e==="s"&&(Vn.ss=t-1),!0)}function e1(e,t){if(!this.isValid())return this.localeData().invalidDate();var n=!1,s=Vn,a,c;return typeof e=="object"&&(t=e,e=!1),typeof e=="boolean"&&(n=e),typeof t=="object"&&(s=Object.assign({},Vn,t),t.s!=null&&t.ss==null&&(s.ss=t.s-1)),a=this.localeData(),c=Qw(this,!n,s,a),n&&(c=a.pastFuture(+this,c)),a.postformat(c)}var zo=Math.abs;function zn(e){return(e>0)-(e<0)||+e}function Ks(){if(!this.isValid())return this.localeData().invalidDate();var e=zo(this._milliseconds)/1e3,t=zo(this._days),n=zo(this._months),s,a,c,u,l=this.asSeconds(),h,m,b,E;return l?(s=zt(e/60),a=zt(s/60),e%=60,s%=60,c=zt(n/12),n%=12,u=e?e.toFixed(3).replace(/\.?0+$/,""):"",h=l<0?"-":"",m=zn(this._months)!==zn(l)?"-":"",b=zn(this._days)!==zn(l)?"-":"",E=zn(this._milliseconds)!==zn(l)?"-":"",h+"P"+(c?m+c+"Y":"")+(n?m+n+"M":"")+(t?b+t+"D":"")+(a||s||e?"T":"")+(a?E+a+"H":"")+(s?E+s+"M":"")+(e?E+u+"S":"")):"P0D"}var Te=Us.prototype;Te.isValid=Vy,Te.abs=Ow,Te.add=Cw,Te.subtract=kw,Te.as=Rw,Te.asMilliseconds=Lf,Te.asSeconds=Pw,Te.asMinutes=Dw,Te.asHours=Mw,Te.asDays=Lw,Te.asWeeks=Nw,Te.asMonths=Uw,Te.asQuarters=Bw,Te.asYears=Iw,Te.valueOf=Fw,Te._bubble=xw,Te.clone=Ww,Te.get=Hw,Te.milliseconds=Yw,Te.seconds=Kw,Te.minutes=qw,Te.hours=$w,Te.days=Gw,Te.weeks=jw,Te.months=Vw,Te.years=zw,Te.humanize=e1,Te.toISOString=Ks,Te.toString=Ks,Te.toJSON=Ks,Te.locale=bf,Te.localeData=Sf,Te.toIsoString=Gt("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Ks),Te.lang=vf,ie("X",0,0,"unix"),ie("x",0,0,"valueOf"),Q("x",xs),Q("X",v0),Le("X",function(e,t,n){n._d=new Date(parseFloat(e)*1e3)}),Le("x",function(e,t,n){n._d=new Date(be(e))});//! moment.js
|
|
42
|
+
z.version="2.30.1",t0(Ke),z.fn=V,z.min=Ky,z.max=qy,z.now=$y,z.utc=_r,z.unix=ww,z.months=vw,z.isDate=Ei,z.locale=en,z.invalid=Es,z.duration=cr,z.isMoment=or,z.weekdays=Ew,z.parseZone=bw,z.localeData=Nr,z.isDuration=Bs,z.monthsShort=Sw,z.weekdaysMin=Aw,z.defineLocale=No,z.updateLocale=by,z.locales=vy,z.weekdaysShort=Tw,z.normalizeUnits=Vt,z.relativeTimeRounding=Zw,z.relativeTimeThreshold=Xw,z.calendarFormat=g_,z.prototype=V,z.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};function Nf(e){return e.replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/g,"")}function t1(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=t.length%4===0?"":"=".repeat(4-t.length%4);return t+n}function Uf(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function r1(e){const t=atob(e),n=new Uint8Array(t.length);for(let s=0;s<t.length;s++)n[s]=t.charCodeAt(s);return n}const kt=60,Bf=60*kt,Li=24*Bf,qs=7*Li;function If(){return new Date().getTime()/1e3}function n1(e){return e.split("").map(t=>t.charCodeAt(0))}function $s(e){const t=new TextEncoder().encode(e);return Nf(Uf(t))}function Gs(e){const t=r1(t1(e));return new TextDecoder().decode(t)}async function Ff(e){const t=new TextEncoder().encode(e),n=await crypto.subtle.digest("SHA-256",t),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(e,t,n="hex"){const s=await crypto.subtle.importKey("raw",new TextEncoder().encode(t),{name:"HMAC",hash:"SHA-256"},!1,["sign"]),a=await crypto.subtle.sign("HMAC",s,new TextEncoder().encode(e)),c=new Uint8Array(a);if(n==="base64url")return Nf(Uf(c));let u="";for(let l=0;l<c.length;l++)u+=c[l].toString(16).padStart(2,"0");return u}function Jo(e,t=void 0){return _n.createJWT(e,t)}function Wf(e){return _n.parseJWT(e)}function Hf(e){return _n.jwkToPublicKey(e)}function Qo(e,t){return _n.encryptPayload(e,t)}function Zo(e){if(Array.isArray(e))return e.map(Zo);if(e&&typeof e=="object"&&e.constructor===Object){const t={},n=Object.keys(e),s=n.length;for(let a=0;a<s;a+=1)t[ro.camelCase(n[a])]=Zo(e[n[a]]);return t}return e}function Vs(e){if(!e)return!0;try{return JSON.parse(Gs(e.split(".")[1])).exp<If()}catch{return!0}}function Xo(e){return jt("root",e,"non-nullable object",!1)}function eu(e,t){return jt("root",e,"object",t)}function tu(e,t){return jt("root",e,"object",t)}function zs(e,t){!Array.isArray(e)&&e!==null&&e!==void 0&&jt(t,e,"array",!0)}function xt(e,t,n){typeof e=="string"?e.match(/\d+(\.\d+)?/)||jt(n,e,"string",t):typeof e!="number"&&(!t||t&&e!==null&&e!==void 0)&&jt(n,e,"number",t)}function ct(e,t,n){typeof e=="string"?e.match(/\d+(\.\d+)?/)||jt(n,e,"number",t):typeof e!="number"&&(!t||t&&e!==null&&e!==void 0)&&jt(n,e,"number",t)}function En(e,t,n){typeof e!="boolean"&&(!t||t&&e!==null&&e!==void 0)&&jt(n,e,"boolean",t)}function Ge(e,t,n){typeof e!="string"&&(!t||t&&e!==null&&e!==void 0)&&jt(n,e,"string",t)}function Yf(e,t){e!=null&&jt(t,e,"null or undefined",!1)}function jt(e,t,n,s){throw s&&(n+=", null, or undefined"),new TypeError("Expected "+n+" at "+e+` but found:
|
|
43
|
+
`+JSON.stringify(t))}function X(e){return Ze.isBigNumber(e)?e:e?new Ze(e):new Ze("0")}function Tn(e,t){return new Ze(t).toFixed(e>0?e:0)}function Ni(e){return typeof e=="number"?e:parseFloat(e)}function jn(e){return typeof e=="number"?e:parseInt(e)}function ru(e){let t=Ni(e);return t<1e10&&(t=t*1e3),new Date(t)}function Kf(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 kt;case"2":return kt*2;case"3":return kt*3;case"5":return kt*5;case"10":return kt*10;case"15":return kt*15;case"30":return kt*30;case"60":return kt*60;case"120":return kt*120;case"240":return kt*240;case"360":return kt*360;case"720":return kt*720;case"D":case"1D":return Li;case"3D":return Li*3;case"W":return qs;case"1W":return qs;case"2W":return qs*2;case"1M":return Li*30}}const js=e=>typeof e=="object"?e:new Date(e*1e3),qf=(e,t)=>{switch(e=z.utc(js(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()}},i1=(e,t)=>{switch(e=z.utc(js(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 $f(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 new Error(`Unsupported resolution: ${e}`)}}function Gf(e,t){let n=z(js(t)),s;switch(e){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: ${e}`)}return s}function Vf(e,t,n){const s=[];let a=z.utc(t*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(e*1e3));for(;l>=h;)s.push(l.clone()),l=u(l);return s}function Js(e,t,n){let s=Kf(t),a=typeof n=="object"?n.getTime()/1e3:n;return Math.floor(a/s)*s-s*(e-1)}function zf(e,t){let n=t;if(typeof t=="string"?n=[{query:t,marketProperty:"fullDisplayName"}]:Array.isArray(t)?n=t.map(a=>{if(typeof a=="string")return{query:a,marketProperty:"fullDisplayName"};if(!Array.isArray(a))return a}):n=[t],n.length===0||!n.find(({query:a})=>!!a&&!!a.length))return e;let s=e;return n.forEach(({query:a,marketProperty:c})=>{let u;if(a.match(/[-_:\/\\]+/))try{u=new RegExp(a.replace(/\*/g,".*"),"i")}catch{}const l=a.toLowerCase().split(/[\s]+/).filter(Boolean);s=ut.pickBy(s,(h,m)=>{const b=h[c].toLowerCase();return u&&c==="fullDisplayName"?!!u.exec(h[c]):l.filter(E=>b.includes(E)).length===l.length})}),s}let nu;class s1{static initialize=t=>{nu=t,console.log("Coinray I18n initialized")};static t=(t,n)=>nu?nu.t(`coinray:${t}`,n):`i18n uninitialized. Set the Coinray.I18n.instance. Key: ${t}`}const jf="2.0.1";class a1 extends Error{errorCode;errorMessage;exchange;constructor({code:t,message:n,exchange:s}){super("Request failed"),this.name="CoinrayError",this.errorCode=t,this.errorMessage=n,this.exchange=s}}class xe{static I18n=s1;config;_token;_sessionKey;_credential;_firstOpen;_onTokenExpired;_tokenCheckTimeout;_onError;_onOpen;_socket;_transport;_tickerListeners;_tickerSymbols;_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(t,{apiEndpoint:n,orderEndpoint:s,websocketEndpoint:a}={apiEndpoint:"https://api.coinray.eu",orderEndpoint:"https://api.coinray.eu",websocketEndpoint:"wss://ws.coinray.eu/v1"}){this._token=t,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=(t,n)=>{this._credential=t,this._sessionKey=n};destroy=()=>{this._tradeListeners={},this._orderbookListeners={},this._tickerListeners=new Map,this._tickerSymbols=new Map,this._channels={},this._timeOffsetTimeout&&clearTimeout(this._timeOffsetTimeout),this._tokenCheckTimeout&&clearInterval(this._tokenCheckTimeout),this.disconnect()};checkToken=async(t=!0)=>{try{if(Vs(this._token)){if(console.log("Coinray token expired. Can refresh:",!!this._onTokenExpired),!this._onTokenExpired)return!1;this._refreshingToken||(this._refreshingToken=this._onTokenExpired());try{this._token=await this._refreshingToken}catch(n){return console.log("Coinray token could not be refreshed",n),this._refreshingToken=void 0,!1}if(this._refreshingToken=void 0,!Vs(this._token))this.reconnect();else return!1}}catch(n){console.error(n)}return t&&(this._tokenCheckTimeout=setTimeout(this.checkToken,5e3)),!0};setTransport=t=>{this._transport=t};onTokenExpired=t=>{this._tokenCheckTimeout&&clearInterval(this._tokenCheckTimeout),this._onTokenExpired=t,this._tokenCheckTimeout=setTimeout(this.checkToken,5e3)};refreshToken=t=>{this._token=t};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:t}=await this.get("/coinray/time");this._timeOffset=t.time-new Date().getTime()}catch(t){console.error(t)}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(t=>{this.markConnected=t});this.socket.onOpen(t=>{this._onOpen&&this._onOpen(t)}),this.socket.onError(t=>{this._onError&&this._onError(t)}),this.socket.connect(),this.markConnected()};onOpen=t=>{this._onOpen=t};onError=t=>{this._onError=t};resubscribe=()=>{if(this._firstOpen){this._firstOpen=!1;return}Object.keys(this._tickerListeners).forEach(t=>{this._tickerListeners[t].length>0&&this.getChannel("tickers").push("subscribe",{exchangeCodes:[t]},5e3)}),Object.keys(this._tradeListeners).forEach(t=>{this._tradeListeners[t].length>0&&this.getChannel("trades").push("subscribe",{symbols:t,snapshots:!0},5e3)}),Object.keys(this._orderbookListeners).forEach(t=>{this._orderbookListeners[t].length>0&&this.getChannel("orderbooks").push("subscribe",{symbols:t,snapshots:!0},5e3)})};subscribeTickers=async(t,n)=>{if(this._tickerListeners.has(n)){let a=this._tickerListeners.get(n);t.forEach(c=>a.add(c))}else this._tickerListeners.set(n,new Set(t));t.forEach(a=>{this._tickerSymbols.has(a)||this._tickerSymbols.set(a,new Set),this._tickerSymbols.get(a).add(n)}),await this.connect();const s=this.getChannel("tickers");return s.push("subscribe",{coinraySymbols:t},5e3),this.tickersSubscribed||(this.tickersSubscribed=!0,s.on("update",a=>{let{exchange_code:c,tickers:u}=a;const l=u.map(xe._parseTicker);this._tickerListeners.forEach((h,m)=>{const b=l.filter(E=>h.has(E.coinraySymbol));m({type:"tickers:update",exchangeCode:c,tickers:b})})}),s.on("error",a=>console.error(a))),n};unsubscribeTickers=(t,n)=>{if(n&&this._tickerListeners.has(n)){let s=this._tickerListeners.get(n),a=[];t.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("trades").push("unsubscribe",{coinraySymbols:a},5e3)}else this._tradeListeners.get(n).clear()};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();const s=this.getChannel("trades");return s.push("subscribe",{symbols:t,snapshots:!0},5e3),this.tradesSubscribed||(this.tradesSubscribed=!0,s.on("snapshot",({symbol:a,trades:c})=>{const u=Object.values(this._tradeListeners[a]),l=c.map(xe._parseTrade);this._tradeSnapshots[a]=l,u.map(h=>h({type:"trades:snapshot",coinraySymbol:a,trades:l}))}),s.on("update",({symbol:a,trades:c})=>{const u=Object.values(this._tradeListeners[a]),l=c.map(xe._parseTrade),h=[...l,...this._tradeSnapshots[a]],m=new Date(new Date().getTime()-12e4),b=h.filter(({time:E})=>E>m);b.length>100?this._tradeSnapshots[a]=b:this._tradeSnapshots[a]=h.slice(0,100),u.map(E=>E({type:"trades:update",coinraySymbol:a,trades:l}))}),s.on("error",a=>console.error(a))),n};unsubscribeTrades=({coinraySymbol:t},n)=>{n&&this._tradeListeners[t]?(this._tradeListeners[t]=this._tradeListeners[t].filter(s=>s!==n),this._tradeListeners[t].length===0&&this.getChannel("trades").push("unsubscribe",{symbols:t},5e3)):(this._tradeSnapshots[t]=[],this._tradeListeners[t]=[])};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();const s=this.getChannel("orderbooks");return s.push("subscribe",{symbols:t},1e4),this.orderBookSubscribed||(this.orderBookSubscribed=!0,s.on("snapshot",({orderbooks:a})=>{Object.keys(a).forEach(u=>{const l=Object.values(this._orderbookListeners[u]),h=xe._parseOrderBookSnapshot(a[u]);this._orderbookSnapshots[u]=h,l.map(m=>m({type:"orderBook:snapshot",coinraySymbol:u,orderBook:h}))})}),s.on("update",({orderbooks:a})=>{const c=Object.keys(a);c.length!==0&&c.forEach(u=>{const l=Object.values(this._orderbookListeners[u]),h=xe._parseOrderBookUpdate(a[u]);this._orderbookSnapshots[u]=xe._updateOrderBook(this._orderbookSnapshots[u],h),l.map(m=>m({type:"orderBook:update",coinraySymbol:u,orderBook:h}))})}),s.on("error",a=>console.error(a))),n};unsubscribeOrderBook=({coinraySymbol:t},n)=>{n&&this._orderbookListeners[t]?(this._orderbookListeners[t]=this._orderbookListeners[t].filter(s=>s!==n),this._orderbookListeners[t].length===0&&this.getChannel("orderbooks").push("unsubscribe",{symbols:t},5e3)):(this._orderbookSnapshots[t]={minSeq:0,maxSeq:0,bids:{},asks:{}},this._orderbookListeners[t]=[])};subscribeCandles=async({coinraySymbol:t,resolution:n,lastCandle:s},a)=>{const c=`${t}-${n}`;if(this._candleListeners[c]&&this._candleListeners[c].length>0)return this._candleListeners[c].push(a),a;this._candleListeners[c]=[a];const u=({type:l,coinraySymbol:h,trades:m})=>{const b=Object.values(this._candleListeners[c]),E=xe._tradesToLastCandle(n,m),R=E[E.length-1];R&&(this._candles[c]&&l==="trades:snapshot"&&(this._candles[c].skipVolume=!0),this._candles[c]=xe._mergeCandle(this._candles[c],R),b.map($=>$({coinraySymbol:h,resolution:n,candle:this._candles[c],previousCandles:E})))};return this._candleTradeListeners[t]?this._candleTradeListeners[t][c]=u:this._candleTradeListeners[t]={[c]:u},this._candles[c]=s||{time:new Date(0)},await this.subscribeTrades({coinraySymbol:t},u),this.startNewCandleTimer({candleId:c,resolution:n,coinraySymbol:t}),a};startNewCandleTimer=({candleId:t,resolution:n,coinraySymbol:s})=>{this._timers[t]&&clearTimeout(this._timers[t]);let a=Js(0,n,new Date)-new Date().getTime()/1e3;const c=Object.values(this._candleListeners[t]);this._timers[t]=setTimeout(()=>{let u=Js(1,n,new Date)*1e3,l=this._candles[t];l&&u>l.time.getTime()&&(this._candles[t]={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[t],previousCandles:[]}))),this.startNewCandleTimer({candleId:t,resolution:n,coinraySymbol:s})},a*1e3)};unsubscribeCandles=({coinraySymbol:t,resolution:n},s)=>{const a=`${t}-${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:t},this._candleTradeListeners[t][a]),this._timers[a]&&(clearTimeout(this._timers[a]),delete this._timers[a]),delete this._candles[a],delete this._candleTradeListeners[t][a])};fetchFirstCandleTime=async({coinraySymbol:t,resolution:n})=>{let{result:{startTime:s}}=await this.get("candles/start-time",{version:"v1",params:{symbol:t,resolution:n}});return s};fetchCandles=async({coinraySymbol:t,resolution:n,start:s,end:a,useWebSocket:c})=>{if(this.flushCache(),n.endsWith("S"))return(await this.getWebsocketCandles(t,n)).filter($=>{let O=$.time.getTime()/1e3;return O>=s&&O<=a});const u=$f(n),l=new Date().getTime()/1e3,h=[];let m=a;if(qf(a,n)>=l){let R=await this.getOpenCandles(c,{version:"v2",params:{symbol:t,resolution:n}});if(R.length>0)m=Math.min(R[0].time.getTime()/1e3,m),h.push(...R);else return[]}let b=Js(2,n,m),E=ro.chunk(Vf(s,b,u),10);for(let R=0;R<E.length;R+=1){let $=E[R].map(F=>{let ne=Gf(u,F),Y={version:"v2",params:{symbol:t,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:R})=>{let $=R.getTime()/1e3;return $>=s&&$<=a}).sort((R,$)=>R.time.getTime()-$.time.getTime())};flushCache=()=>{let t=new Date().getTime()/1e3;(!this._candleCacheCreatedAt||t-this._candleCacheCreatedAt>600)&&(this._candleCacheCreatedAt=t,this._candleCache=new Map)};getWebsocketCandles=async(t,n)=>await new Promise(a=>{let c=setTimeout(()=>{this.unsubscribeCandles({coinraySymbol:t,resolution:n},u),a([])},0);const u=({previousCandles:l})=>{clearTimeout(c),this.unsubscribeCandles({coinraySymbol:t,resolution:n},u),a(l)};this.subscribeCandles({coinraySymbol:t,resolution:n},u)});getOpenCandles=async(t,n)=>{const s=this.candleCacheKey({prefix:"O",...n.params});let a=this._candleCache.get(s);if(!t&&a)return a;const c=await this.getWebsocketCandles(n.params.symbol,n.params.resolution),u=ut.keyBy(c,({time:h})=>h.getTime());let{result:l}=await this.get("candles/open",n);if(l.candles){let m=l.candles.map(xe._parseCandle).map(b=>{const E=u[b.time.getTime()];return E?xe._mergeCandle(b,E):b});return this._candleCache.set(s,m),m}else return[]};getHistoryCandles=async t=>{const n=this.candleCacheKey(t.params);let s=this._candleCache.get(n);if(s)return s;{if(t.params.year<2018)return new Promise(c=>c([]));let{result:a}=await this.get("candles/history",t);if(a.candles){let c=a.candles.map(xe._parseCandle);return this._candleCache.set(n,c),c}else return[]}};candleCacheKey=({symbol:t,resolution:n,year:s,month:a="",day:c="",week:u="",prefix:l="C"})=>`${l}/${t}/${n}/${s}/${a}/${c}/${u}`;fetchExchanges=async(t,n)=>{let s=n;return s||({result:{exchanges:s}}=await this.get("exchanges",{version:"v1"})),s.map(t)};fetchMarkets=async(t,n)=>{let s=n;return s||({result:{markets:s}}=await this.get("markets",{version:"v1",params:{exchange:t.code}})),s};createCredential=async(t,n)=>{const s=await this.publicKey();try{const a=await Qo(await Jo({password:n}),s),{result:c}=await this.post("credentials",{secret:n,body:{deviceId:t,encryptedPassword:a}});return c}catch(a){throw a}};wrapApiKey=async(t,n)=>{const s=await this.publicKey();let a;try{if(n)a=t;else{const u=JSON.stringify(t);a=await Qo(await Jo({apiKey:u}),s)}const{result:c}=await this.post("credentials/wrap_api_key",{secret:this._sessionKey,body:{encryptedApiKey:a,credential:this._credential}});return c}catch(c){throw c}};testAccount=async t=>{try{const{result:n}=await this.post("account/test",{secret:this._sessionKey,apiEndpoint:this.config.orderEndpoint,body:{...t,credential:this._credential}});return n}catch(n){throw n}};createSmartOrderSignature=async t=>{try{const{result:n}=await this.post("order/smart_order_signature",{secret:this._sessionKey,apiEndpoint:this.config.orderEndpoint,body:{smartOrder:t,credential:this._credential}});return n}catch(n){throw n}};createOrder=async t=>{try{const{result:n}=await this.post("order",{secret:this._sessionKey,apiEndpoint:this.config.orderEndpoint,body:{...t,credential:this._credential}});return n}catch(n){throw n}};updateOrder=async t=>{try{const{result:n}=await this.patch("order",{secret:this._sessionKey,apiEndpoint:this.config.orderEndpoint,body:{...t,credential:this._credential}});return n}catch(n){throw n}};cancelOrder=async t=>{try{const{result:n}=await this.delete("order",{secret:this._sessionKey,apiEndpoint:this.config.orderEndpoint,body:{...t,orderId:t.orderId.toString(),credential:this._credential}});return n}catch(n){throw n}};createWebSocketToken=async({exchangeCode:t,encryptedApiKey:n})=>{try{const{result:s}=await this.post("exchanges/ws_token",{secret:this._sessionKey,apiEndpoint:this.config.orderEndpoint,body:{encryptedApiKey:n,exchangeCode:t,credential:this._credential}});return s}catch(s){throw s}};fetchPositions=async({exchangeCode:t,encryptedApiKey:n})=>{try{const{result:s}=await this.get("futures/positions",{secret:this._sessionKey,apiEndpoint:this.config.orderEndpoint,params:{credential:this._credential,exchangeCode:t,encryptedApiKey:n}});return s}catch(s){throw s}};getBalances=async({exchangeCode:t,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:t,encryptedApiKey:n}});return{balances:s.map(xe._parseBalance),positions:a}}catch(s){throw s}};setLeverage=async({coinraySymbol:t,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:t,leverage:n,encryptedApiKey:s}});return a}catch(a){throw a}};setMarginType=async({coinraySymbol:t,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:t,marginType:n,encryptedApiKey:s}});return a}catch(a){throw a}};async getProxyList({exchangeCode:t,credentialVersion:n}){let s="";t&&(s+=`?exchange=${t.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:t}}=await this.get("credentials/certificate");this._publicKey=await Hf(t)}return this._publicKey}get clientId(){return Wf(this._token).header.kid}get socket(){if(!this._token)throw new Error("Token not present");return this._socket||(this._socket=new cg(this.config.websocketEndpoint,{heartbeatIntervalMs:5e3,transport:this._transport,reconnectAfterMs:()=>Vs(this._token)?3e4:1e3}),this.onOpen(this.resubscribe)),this._socket.params=()=>({reconnect:!0,token:this._token,client:"coinrayjs",version:jf}),this._socket}getChannel(t){if(this.connect(),this._channels[t])return this._channels[t];const n=this.socket.channel(t,{});return this._channels[t]=n,n.join(),n}get=async(t,{apiEndpoint:n=void 0,version:s="v2",headers:a={},params:c={},secret:u=""}={})=>await this._request(t,"GET",{version:s,apiEndpoint:n,headers:a,secret:u,params:c});post=async(t,n)=>await this._request(t,"POST",n);patch=async(t,n)=>await this._request(t,"PATCH",n);delete=async(t,n)=>await this._request(t,"delete",n);async _request(t,n,{apiEndpoint:s,version:a="v2",headers:c={},params:u={},body:l={},secret:h=""}){const m=await this.getToken(),b=Object.entries(u).length>0?"?"+Object.entries(u).map(([O,I])=>I?`${O}=${I}`:void 0).filter(Boolean).join("&"):"",E=this.getNonce(),R=`/api/${a}/${t}${b}`;if(a==="v2"&&!t.startsWith("candles")){const O=[E,n.toUpperCase(),R,n==="GET"?"":JSON.stringify(l)].join(""),I=h!=""?await jo(O,h):"";c={...c,"Cr-Access-Token":`${m}`,"Cr-Nonce":E,"Cr-Signature":I}}const $={method:n,url:(s||this.config.apiEndpoint)+R,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:t,bids:n,min_seq:s,max_seq:a}){return{minSeq:s,maxSeq:a,asks:xe._parseBidAsk(t),bids:xe._parseBidAsk(n)}}static _parseOrderBookUpdate({asks_diff:t,bids_diff:n,min_seq:s,max_seq:a}){return{minSeq:s,maxSeq:a,asks:xe._parseBidAsk(t),bids:xe._parseBidAsk(n)}}static _updateOrderBook(t,{asks:n,bids:s,min_seq:a,max_seq:c}){const u=(l,h)=>{ut.forEach(h,(m,b)=>{m>0?l[b]=m:delete l[b]})};return t.minSeq=a,t.maxSeq=c,u(t.bids,s),u(t.asks,n),t}static _parseBidAsk(t){return Array.isArray(t)?t.reduce((n,[s,a])=>(n[s]=parseFloat(a),n),{}):Object.keys(t).reduce((n,s)=>(n[s]=parseFloat(t[s]),n),{})}static _parseCandle(t){if(t){const[n,s,a,c,u,l,h]=t;return{time:ru(n),open:parseFloat(s),high:parseFloat(a),low:parseFloat(c),close:parseFloat(u),baseVolume:parseFloat(l),quoteVolume:parseFloat(h),numTrades:0}}else throw new Error("Candle")}static _parseTrade([t,n,s,a,c]){return{id:t,time:ru(n),price:parseFloat(s),quantity:parseFloat(a),type:["1","buy"].includes(c.toString())?"buy":"sell"}}static _parseTicker(t){return{askPrice:X(t.a),baseVolume:X(t.bv),bidPrice:X(t.b),btcVolume:X(t.B),coinraySymbol:t.s,highPrice1s:X(t.h),highPrice24h:X(t.H),lastPrice:X(t.c),lowPrice1s:X(t.l),lowPrice24h:X(t.L),openPrice1s:X(t.o),openPrice24h:X(t.O),quoteVolume:X(t.qv),usdVolume:X(t.U)}}static _parseBalance(t){let n={currency:t.currency,available:X(t.available),inOrders:X(t.inOrders),total:X(t.inOrders)};return t.initialMargin&&(n={...n,initialMargin:X(t.initialMargin),openOrderInitialMargin:X(t.openOrderInitialMargin),positionInitialMargin:X(t.positionInitialMargin),unrealizedProfit:X(t.unrealizedProfit),crossWalletBalance:X(t.crossWalletBalance),crossUnrealizedProfit:X(t.crossUnrealizedProfit)}),n}static _tradesToLastCandle(t,n){n.length>0&&n[0].time>n[n.length-1].time&&(n=n.reverse());const s=xe._resolutionToSeconds(t),a=ut.groupBy(n.reverse(),({time:c})=>Math.floor(c.getTime()/s)*s);return ut.sortBy(Object.keys(a),c=>parseInt(c)).reduce((c,u)=>{const l=a[u],h=l[0].time.getTime(),m=new Date(h-h%s);if(l.length===0)return c;let b=l[0],E,R,$,O,I=0,F=0;return c.length===0?E=R=$=O=b.price:E=R=$=O=c[c.length-1].close,l.reverse().map(({price:ne,quantity:Y})=>{R=Math.min(R,ne),$=Math.max($,ne),O=ne,I+=Y,F+=Y*ne}),c.push({time:new Date(m),open:E,high:$,low:R,close:O,baseVolume:I,quoteVolume:F,numTrades:l.length}),c},[])}static _mergeCandle(t,n){return!t||t.time<n.time?n:(t.numTrades+=n.numTrades,t.high=Math.max(t.high,n.high),t.low=Math.min(t.low,n.low),t.close=n.close,t.skipVolume?t.skipVolume=!1:(t.baseVolume+=n.baseVolume,t.quoteVolume+=n.quoteVolume),t)}static _resolutionToSeconds(t){return t.indexOf("W")>0||t.indexOf("D")>0?parseInt(t)*24*60*60*1e3:t.indexOf("S")>0?parseInt(t)*1e3:t==="D"?864e5:parseInt(t)*60*1e3}}class Qs{getExchange;api;id;coinraySymbol;symbol;symbolAlt;quoteCurrency;underlyingQuoteCurrency;baseLogoUrl;baseCurrency;exchangeCode;volume;quoteVolume;btcVolume;usdVolume;websocket;openPrice;highPrice;lowPrice;precisionBase;precisionQuote;precisionPrice;minBase;maxBase;maxBaseMarket;minQuote;maxQuote;minTrade;maxTrade;makerFee;takerFee;change;delistedOn;exchangeUrl;baseToUsd;quoteToUsd;status;note;_supportedOrderTypes;_lastPrice;_askPrice;_bidPrice;updatedAt;getPriceOverrides;static Create(t,n,s){return t==null?Xo(t):typeof t!="object"?eu(t,!1):Array.isArray(t)&&tu(t,!1),xt(t.id,!1,"id"),Ge(t.coinraySymbol,!1,"coinraySymbol"),Ge(t.symbol,!1,"symbol"),Ge(t.symbolAlt,!1,"symbolAlt"),Ge(t.quoteCurrency,!1,"quoteCurrency"),Ge(t.underlyingQuoteCurrency,!1,"underlyingQuoteCurrency"),Ge(t.baseLogoUrl,!0,"baseLogoUrl"),Ge(t.baseCurrency,!1,"baseCurrency"),Ge(t.exchangeCode,!1,"exchangeCode"),Ge(t.status||"",!1,"status"),Ge(t.note||"",!1,"note"),ct(t.volume,!0,"volume"),ct(t.quoteVolume,!0,"quoteVolume"),ct(t.btcVolume,!0,"btcVolume"),ct(t.usdVolume,!0,"usdVolume"),En(t.websocket,!1,"websocket"),ct(t.openPrice,!0,"openPrice"),ct(t.highPrice,!0,"highPrice"),ct(t.lowPrice,!0,"lowPrice"),xt(t.precisionBase,!1,"precisionBase"),xt(t.precisionPrice,!1,"precisionPrice"),xt(t.precisionBase,!1,"precisionBase"),xt(t.minBase,!0,"minBase"),xt(t.precisionQuote,!1,"precisionQuote"),xt(t.minQuote,!0,"minQuote"),ct(t.maxBase,!0,"maxBase"),ct(t.maxBaseMarket,!0,"maxBaseMarket"),ct(t.maxQuote,!0,"maxQuote"),ct(t.minTrade,!1,"minTrade"),xt(t.maxTrade,!0,"maxTrade"),t.maxTrade===void 0&&(t.maxTrade=null),xt(t.makerFee,!1,"makerFee"),xt(t.takerFee,!1,"takerFee"),xt(t.change,!1,"change"),Yf(t.delistedOn,"delistedOn"),t.delistedOn===void 0&&(t.delistedOn=null),Ge(t.exchangeUrl,!1,"exchangeUrl"),ct(t.lastPrice,!0,"lastPrice"),ct(t.baseToUsd,!1,"baseToUsd"),ct(t.quoteToUsd,!1,"quoteToUsd"),ct(t.askPrice,!0,"askPrice"),ct(t.bidPrice,!0,"bidPrice"),Ge(t.updatedAt,!1,"updatedAt"),new Qs(t,n,s)}constructor(t,n,s){this.getExchange=()=>s,this.api=n,this.id=t.id,this.coinraySymbol=t.coinraySymbol,this.symbol=t.symbol,this.symbolAlt=t.symbolAlt,this.quoteCurrency=t.quoteCurrency.toUpperCase(),this.underlyingQuoteCurrency=t.underlyingQuoteCurrency.toUpperCase(),this.baseLogoUrl=t.baseLogoUrl,this.baseCurrency=t.baseCurrency.toUpperCase(),this.exchangeCode=t.exchangeCode,this.status=t.status,this.note=t.note,this.volume=X(t.volume),this.quoteVolume=X(t.quoteVolume),this.btcVolume=X(t.btcVolume),this.usdVolume=X(t.usdVolume),this.websocket=t.websocket,this.openPrice=X(t.openPrice),this.highPrice=X(t.highPrice),this.lowPrice=X(t.lowPrice),this.precisionBase=t.precisionBase,this.precisionPrice=t.precisionPrice,this.precisionQuote=t.precisionQuote,this.minQuote=t.minQuote,this.precisionBase=t.precisionBase,this.minBase=t.minBase,this.maxBase=X(t.maxBase),this.maxBaseMarket=X(t.maxBaseMarket).isZero()?this.maxBase:X(t.maxBaseMarket),this.maxQuote=X(t.maxQuote),this.minTrade=X(t.minTrade),this.maxTrade=X(t.maxTrade),this.makerFee=Ni(t.makerFee),this.takerFee=Ni(t.takerFee),this.change=Ni(t.change),this.delistedOn=t.delistedOn,this.exchangeUrl=t.exchangeUrl,this._lastPrice=X(t.lastPrice),this.baseToUsd=X(t.baseToUsd),this.quoteToUsd=X(t.quoteToUsd),this._askPrice=X(t.askPrice),this._bidPrice=X(t.bidPrice),this._supportedOrderTypes=t.supportedOrderTypes,this.updatedAt=t.updatedAt}get tradingDisabled(){return this.status==="INACTIVE"}get tradingEnabled(){return!this.tradingDisabled}get quoteLogoUrl(){return`https://api.coinray.eu/api/v2/explorer/currencies/${this.quoteCurrency}/thumb`}get supportedOrderTypes(){return this._supportedOrderTypes.length>0?this._supportedOrderTypes:this.getExchange().supportedOrderTypes}get isFutures(){return this.getExchange().isFutures}get fullDisplayName(){return[this.exchangeCode,this.displayName].join(": ")}get displayName(){return[this.baseCurrency,this.quoteCurrency].join("/")}get priceOverrides(){return this.getPriceOverrides?this.getPriceOverrides():{}}get lastPrice(){return this.priceOverrides.lastPrice||this._lastPrice}get askPrice(){return this.priceOverrides.askPrice||this._askPrice}get bidPrice(){return this.priceOverrides.bidPrice||this._bidPrice}overridePrices=t=>{this.getPriceOverrides=t};updateTicker=({lastPrice:t,bidPrice:n,askPrice:s})=>{t&&(this._lastPrice=t),s&&(this._askPrice=s),n&&(this._bidPrice=n)}}class Ui{api;id;name;code;websocket;active;aliasedTo;tradingEnabled;tradingEnabledFrom;isFutures;isDex;logo;btcVolume;usdVolume;totalMarkets;quoteCurrencies;supportedFeatures;supportedResolutions;supportedOrderTypes;baseCurrencyDominance;apiKeySettings;apiEndpoint;websocketEndpoint;markets;exchangeSymbols;static Create(t,n){if(t==null?Xo(t):typeof t!="object"?eu(t,!1):Array.isArray(t)&&tu(t,!1),xt(t.id,!1,"id"),Ge(t.name,!1,"name"),Ge(t.code,!1,"code"),En(t.websocket,!1,"websocket"),En(t.active,!1,"active"),En(t.tradingEnabled,!1,"tradingEnabled"),Ge(t.tradingEnabledFrom,!1,"tradingEnabledFrom"),En(t.isFutures,!0,"isFutures"),En(t.isDex,!0,"isDex"),Ge(t.logo,!1,"logo"),Ge(t.btcVolume,!1,"btcVolume"),Ge(t.usdVolume,!1,"usdVolume"),xt(t.totalMarkets,!1,"totalMarkets"),zs(t.quoteCurrencies,"quoteCurrencies"),Ge(t.apiEndpoint,!0,"apiEndpoint"),Ge(t.websocketEndpoint,!0,"websocketEndpoint"),Ge(t.aliasedTo,!0,"aliasedTo"),t.quoteCurrencies)for(let s=0;s<t.quoteCurrencies.length;s++)Ge(t.quoteCurrencies[s],!1,"quoteCurrencies["+s+"]");if(t.quoteCurrencies===void 0&&(t.quoteCurrencies=null),zs(t.supportedResolutions,"supportedResolutions"),zs(t.supportedFeatures,"supportedFeatures"),t.supportedResolutions)for(let s=0;s<t.supportedResolutions.length;s++)Ge(t.supportedResolutions[s],!1,"supportedResolutions["+s+"]");return t.supportedResolutions===void 0&&(t.supportedResolutions=null),new Ui(t,n)}constructor(t,n){this.api=n,this.id=t.id,this.name=t.name,this.code=t.code,this.websocket=t.websocket,this.isFutures=!!t.isFutures,this.isDex=!!t.isDex,this.active=t.active,this.tradingEnabled=t.tradingEnabled,this.tradingEnabledFrom=t.tradingEnabledFrom,this.logo=t.logo,this.btcVolume=X(t.btcVolume),this.usdVolume=X(t.usdVolume),this.totalMarkets=jn(t.totalMarkets),this.quoteCurrencies=t.quoteCurrencies,this.supportedResolutions=t.supportedResolutions,this.supportedFeatures=t.supportedFeatures,this.supportedOrderTypes=t.supportedOrderTypes,this.baseCurrencyDominance=t.baseCurrencyDominance,this.apiKeySettings=t.apiKeySettings,this.markets={},this.exchangeSymbols={},this.apiEndpoint=t.apiEndpoint||n.config.apiEndpoint,this.websocketEndpoint=t.websocketEndpoint||n.config.websocketEndpoint,this.aliasedTo=t.aliasedTo}clone(){return new Ui({api:this.api,id:this.id,name:this.name,code:this.code,websocket:this.websocket,isFutures:this.isFutures,isDex:this.isDex,logo:this.logo,btcVolume:this.btcVolume,usdVolume:this.usdVolume,totalMarkets:this.totalMarkets,quoteCurrencies:this.quoteCurrencies,supportedResolutions:this.supportedResolutions,supportedFeatures:this.supportedFeatures,baseCurrencyDominance:this.baseCurrencyDominance,apiKeySettings:this.apiKeySettings,aliasedTo:this.aliasedTo},this.api)}async loadMarkets(t=void 0){const n=await this.api.fetchMarkets(this,t),s=n.map(a=>{try{return Qs.Create(a,this.api,this)}catch{return new Qs(a,this.api,this)}});return s.length>0&&(this.markets=ut.keyBy(s,"coinraySymbol"),this.exchangeSymbols=ut.keyBy(s,"symbol")),n}getBaseCurrencyDominance(t){return this.baseCurrencyDominance[t]}getMarketByExchangeSymbol(t){return this.exchangeSymbols[t]}getCurrencyPrice(t,n){for(let[s,a]of Object.entries(this.markets)){if(a.baseCurrency===n)return X(t).dividedBy(a.baseToUsd);if(a.quoteCurrency===n)return X(t).dividedBy(a.quoteToUsd)}return new Ze(0)}getUsdPrice(t,n){for(let[s,a]of Object.entries(this.markets)){if(a.baseCurrency===n)return a.baseToUsd.multipliedBy(t);if(a.quoteCurrency===n)return a.quoteToUsd.multipliedBy(t)}return new Ze(0)}getMarket(t){return this.markets[t]}}class Jf{listeners;constructor(){this.listeners={}}removeAllListeners(){this.listeners={}}on=(t,n)=>(t in this.listeners||(this.listeners[t]=[]),this.listeners[t].push(n),n);off=(t,n)=>{t in this.listeners&&(n?this.listeners[t]=this.listeners[t].filter(s=>s!==n):this.listeners[t]=[])};hasListeners=t=>this.listeners[t]&&this.listeners[t].length>0;dispatchEvent=(t,n={})=>{const s=this.listeners[t];s&&s.length>0&&s.map(a=>a({eventName:t,data:n}))}}class o1 extends Jf{rootApi;apis;exchanges;initialized;refreshRate;refreshTimeout;_refreshingToken;_onTokenExpired;onStoreCache;apiCache;constructor(t,n,s=3e4,a=void 0){super(),this.rootApi=new xe(t,n),this.apis=new Map,this.exchanges={},this.initialized=!1,this.refreshRate=s,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(t,n){this.rootApi.authenticateDevice(t,n)}refreshToken=async()=>{if(this._onTokenExpired){if(this._refreshingToken)return await this._refreshingToken;{this._refreshingToken=this._onTokenExpired();let t=await this._refreshingToken;this._refreshingToken=void 0;for(const n of this.apis.values())n.refreshToken(t);return t}}};onTokenExpired(t){this._onTokenExpired=t}async start(){this.refreshTimeout&&clearTimeout(this.refreshTimeout);try{this.apiCache?(await this.refreshExchanges(this.apiCache),this.refreshExchanges()):await this.refreshExchanges()}catch(t){console.error(t)}this.refreshTimeout=setTimeout(this.refreshExchangeInterval,this.refreshRate)}refreshExchangeInterval=async()=>{try{await this.refreshExchanges()}catch(t){console.error(t)}this.refreshTimeout=setTimeout(this.refreshExchangeInterval,this.refreshRate)};destroy(){for(const t of this.apis.values())try{t.destroy()}catch(n){console.error("Could not destroy coinray",n)}this.refreshTimeout&&clearTimeout(this.refreshTimeout),this.initialized=!1}refreshExchanges=async(t=void 0)=>{const n={exchanges:[],markets:{}},s=await this.rootApi.fetchExchanges(c=>(n.exchanges.push(c),this.apis.has(c.code)||this.apis.set(c.code,this.rootApi),Ui.Create(c,this.apis.get(c.code))),t?.exchanges),a=await Promise.all(s.map(async c=>({[c.code]:await c.loadMarkets(t?.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"),!t&&this.onStoreCache&&this.onStoreCache(n)};getProxyList=async(t={})=>await this.rootApi.getProxyList(t);getExchanges(){if(!this.initialized)throw"The cache is not initialized yet";return this.exchanges}getExchange(t){return this.getExchanges()[t]||Ui.Create({id:-1,name:t,code:t,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 t=>{await this.exchanges[t].loadMarkets()};searchMarkets(t){return Object.values(this.exchanges).reduce((n,s)=>(n={...n,...zf(s.markets,t)},n),{})}getMarkets(t){switch(typeof t){case"string":return this.getExchange(t).markets;default:return t.reduce((n,s)=>{const a=this.getMarket(s);return a&&(n[s]=a),n},{})}}getMarket=t=>{const n=`${t}`.split("_");if(n.length<3)return;const s=this.getExchange(n[0]);if(s)return s.getMarket(t)};async fetchCandles({coinraySymbol:t,resolution:n,start:s,end:a,useWebSocket:c}){return this.apiForSymbol(t).fetchCandles({coinraySymbol:t,resolution:n,start:s,end:a,useWebSocket:c})}async fetchFirstCandleTime({coinraySymbol:t,resolution:n}){return this.apiForSymbol(t).fetchFirstCandleTime({coinraySymbol:t,resolution:n})}async subscribeCandles({coinraySymbol:t,resolution:n,lastCandle:s},a){return this.apiForSymbol(t).subscribeCandles({coinraySymbol:t,resolution:n,lastCandle:s},a)}async unsubscribeCandles({coinraySymbol:t,resolution:n},s){await this.apiForSymbol(t).unsubscribeCandles({coinraySymbol:t,resolution:n},s)}async subscribeOrderBook({coinraySymbol:t},n){await this.apiForSymbol(t).subscribeOrderBook({coinraySymbol:t},n)}async unsubscribeOrderBook({coinraySymbol:t},n){await this.apiForSymbol(t).unsubscribeOrderBook({coinraySymbol:t},n)}async subscribeTrades({coinraySymbol:t},n){await this.apiForSymbol(t).subscribeTrades({coinraySymbol:t},n)}async unsubscribeTrades({coinraySymbol:t},n){await this.apiForSymbol(t).unsubscribeTrades({coinraySymbol:t},n)}apiForSymbol(t){const n=`${t}`.split("_");if(n.length<3)return;const s=n[0];return this.apis.get(s)}}class u1 extends Error{constructor(t){super(t),this.name="MarketNotFoundError"}}const Qf=30*1e3;class c1 extends Jf{coinrayCache;getPriceOverrides;coinraySymbol;orderBook;trades;tradesDelayed;maxTrades;prevTickers={lastPrice:new Ze(0),askPrice:new Ze(0),bidPrice:new Ze(0)};constructor(t,n={}){super(),this.coinrayCache=t,this.maxTrades=n.maxTrades||100,n.getPriceOverrides&&(this.getPriceOverrides=n.getPriceOverrides),this.destroy()}setCoinraySymbol(t){this.dispatchEvent("coinraySymbolWillChange",{coinraySymbol:t}),this.stop(),this.coinraySymbol=t,this.startOrderBook(),this.startTrades(),this.dispatchEvent("coinraySymbolChanged",{coinraySymbol:t})}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 t=this.coinrayCache.getMarket(this.coinraySymbol);return t.overridePrices(this.getPriceOverrides),t}else throw new u1(`Market not found: ${this.coinraySymbol}`)}subscribeCoinraySymbolWillChange(t){return this.on("coinraySymbolWillChange",t)}unsubscribeCoinraySymbolWillChange(t){this.off("coinraySymbolWillChange",t)}subscribeCoinraySymbolChange(t){return this.on("coinraySymbolChanged",t)}unsubscribeCoinraySymbolChange(t){this.off("coinraySymbolChanged",t)}subscribeMarketUpdates=t=>(this.on("marketUpdated",t),this.subscribeOrderBook(this.handleMarketUpdate),this.subscribeTrades(this.handleMarketUpdate),t);updatePrevTicker=({lastPrice:t,bidPrice:n,askPrice:s})=>{t&&(this.prevTickers.lastPrice=X(t)),s&&(this.prevTickers.askPrice=X(s)),n&&(this.prevTickers.bidPrice=X(n))};handleMarketUpdate=({data:{type:t,coinraySymbol:n,...s}})=>{if(this.coinraySymbol!==n){this.unsubscribeOrderBook(this.handleOrderBook),this.unsubscribeTrades(this.handleOrderBook);return}switch(t){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.updateTicker({lastPrice:u}),this.updatePrevTicker({lastPrice:u}),this.dispatchEvent("marketUpdated",{market:c}));break}case"orderBook:snapshot":case"orderBook:update":{const{orderBook:{bids:a,asks:c}}=s,u=this.getMarket();if(a.length===0||c.length===0)break;const l=c[0].price,h=a[0].price,m=!u._askPrice.eq(l)||!u._bidPrice.eq(h),b=!this.prevTickers.askPrice.eq(l)||!this.prevTickers.bidPrice.eq(h);(m||b)&&(u.updateTicker({askPrice:l,bidPrice:h}),this.updatePrevTicker({askPrice:l,bidPrice:h}),this.dispatchEvent("marketUpdated",{market:u}));break}}};unsubscribeMarketUpdates=t=>{this.off("marketUpdated",t),this.hasListeners("marketUpdated")||(this.unsubscribeOrderBook(this.handleMarketUpdate),this.unsubscribeTrades(this.handleMarketUpdate))};subscribeOrderBook=t=>(this.on("orderBookUpdated",t),this.startOrderBook(),t);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:t,coinraySymbol:n,orderBook:s})=>{if(this.coinraySymbol!==n){this.coinrayCache.unsubscribeOrderBook({coinraySymbol:n},this.handleOrderBook);return}t==="orderBook:snapshot"&&(this.orderBook={minSeq:void 0,maxSeq:void 0,bids:{},asks:{}});const{minSeq:a,maxSeq:c,bids:u,asks:l}=s,h=(m,b)=>{ut.forEach(b,(E,R)=>{E>0?m[R]={price:new Ze(R),quantity:E}:delete m[R]})};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:t,coinraySymbol:n,orderBook:{minSeq:a,maxSeq:c,bids:Object.values(this.orderBook.bids).sort(({price:m},{price:b})=>b.minus(m)),asks:Object.values(this.orderBook.asks).sort(({price:m},{price:b})=>m.minus(b))}})};unsubscribeOrderBook=t=>{this.off("orderBookUpdated",t),this.hasListeners("orderBookUpdated")||this.stopOrderBook()};subscribeTrades=t=>(this.on("tradesUpdated",t),this.startTrades(),t);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:t,coinraySymbol:n,trades:s})=>{if(this.coinraySymbol!==n){this.coinrayCache.unsubscribeTrades({coinraySymbol:n},this.handleTrades);return}if(t==="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:t,coinraySymbol:n,trades:this.trades}),!this.trades.length)return;const a=Date.now()-this.trades[0].time.getTime();t==="trades:snapshot"&&this.tradesDelayed?this.dispatchTradesDelayed({type:t,coinraySymbol:n,tradesDelayed:!1,delayInMs:a}):t==="trades:update"&&(this.tradesDelayed&&a<Qf?this.dispatchTradesDelayed({type:t,coinraySymbol:n,tradesDelayed:!1,delayInMs:a}):!this.tradesDelayed&&a>=Qf&&this.dispatchTradesDelayed({type:t,coinraySymbol:n,tradesDelayed:!0,delayInMs:a}))};dispatchTradesDelayed=({type:t,coinraySymbol:n,tradesDelayed:s,delayInMs:a})=>{this.tradesDelayed=s,this.dispatchEvent("tradesDelayed",{type:t,coinraySymbol:n,tradesDelayed:s,delayInMs:a})};unsubscribeTrades=t=>{this.off("tradesUpdated",t),this.hasListeners("tradesUpdated")||this.stopTrades()};subscribeTradesDelayed=t=>(this.on("tradesDelayed",t),t);unsubscribeTradesDelayed=t=>{this.off("tradesDelayed",t)}}const l1={"en-US":{validation:{notGreaterThanOrEqualTo:"Can't be less than {{min}}",insufficientFunds:"Insufficient funds"}},nl:{validation:{notGreaterThanOrEqualTo:"Kan niet minder zijn dan {{min}}",insufficientFunds:"Onvoldoende balans"}},ru:{validation:{notGreaterThanOrEqualTo:"Не может быть меньше {{min}}",insufficientFunds:"Недостаточно средств"}}};var Bi={exports:{}};/*!
|
|
45
45
|
* validate.js 0.13.1
|
|
46
46
|
*
|
|
47
47
|
* (c) 2013-2019 Nicklas Ansman, 2013 Wrapp
|
|
48
48
|
* Validate.js may be freely distributed under the MIT license.
|
|
49
49
|
* For all details and documentation:
|
|
50
50
|
* http://validatejs.org/
|
|
51
|
-
*/var i1=Ni.exports,Lf;function s1(){return Lf||(Lf=1,(function(e,t){(function(n,s,a){var c=function(l,h,m){m=u.extend({},u.options,m);var b=u.runValidations(l,h,m);if(b.some(function(T){return u.isPromise(T.error)}))throw new Error("Use validate.async if you want support for promises");return c.processValidationResults(b,m)},u=c;u.extend=function(l){return[].slice.call(arguments,1).forEach(function(h){for(var m in h)l[m]=h[m]}),l},u.extend(c,{version:{major:0,minor:13,patch:1,metadata:null,toString:function(){var l=u.format("%{major}.%{minor}.%{patch}",u.version);return u.isEmpty(u.version.metadata)||(l+="+"+u.version.metadata),l}},Promise:typeof Promise<"u"?Promise:null,EMPTY_STRING_REGEXP:/^\s*$/,runValidations:function(l,h,m){var b=[],T,R,$,O,B,F,re;(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(R in O){if(B=u.validators[R],!B)throw re=u.format("Unknown validator %{name}",{name:R}),new Error(re);F=O[R],F=u.result(F,$,l,T,m,h),F&&b.push({attribute:T,value:$,validator:R,globalOptions:m,attributes:l,options:F,error:B.call(B,$,F,T,l,m)})}}return b},processValidationResults:function(l,h){l=u.pruneEmptyErrors(l,h),l=u.expandMultipleErrors(l,h),l=u.convertErrorMessages(l,h);var m=h.format||"grouped";if(typeof u.formatters[m]=="function")l=u.formatters[m](l);else throw new Error(u.format("Unknown format %{format}",h));return u.isEmpty(l)?void 0:l},async:function(l,h,m){m=u.extend({},u.async.options,m);var b=m.wrapErrors||function(R){return R};m.cleanAttributes!==!1&&(l=u.cleanAttributes(l,h));var T=u.runValidations(l,h,m);return new u.Promise(function(R,$){u.waitForResults(T).then(function(){var O=u.processValidationResults(T,m);O?$(new b(O,m,l,h)):R(l)},function(O){$(O)})})},single:function(l,h,m){return m=u.extend({},u.single.options,m,{format:"flat",fullMessages:!1}),u({single:l},{single:h},m)},waitForResults:function(l){return l.reduce(function(h,m){return u.isPromise(m.error)?h.then(function(){return m.error.then(function(b){m.error=b||null})}):h},new u.Promise(function(h){h()}))},result:function(l){var h=[].slice.call(arguments,1);return typeof l=="function"&&(l=l.apply(null,h)),l},isNumber:function(l){return typeof l=="number"&&!isNaN(l)},isFunction:function(l){return typeof l=="function"},isInteger:function(l){return u.isNumber(l)&&l%1===0},isBoolean:function(l){return typeof l=="boolean"},isObject:function(l){return l===Object(l)},isDate:function(l){return l instanceof Date},isDefined:function(l){return l!=null},isPromise:function(l){return!!l&&u.isFunction(l.then)},isJqueryElement:function(l){return l&&u.isString(l.jquery)},isDomElement:function(l){return!l||!l.querySelectorAll||!l.querySelector?!1:u.isObject(document)&&l===document?!0:typeof HTMLElement=="object"?l instanceof HTMLElement:l&&typeof l=="object"&&l!==null&&l.nodeType===1&&typeof l.nodeName=="string"},isEmpty:function(l){var h;if(!u.isDefined(l))return!0;if(u.isFunction(l))return!1;if(u.isString(l))return u.EMPTY_STRING_REGEXP.test(l);if(u.isArray(l))return l.length===0;if(u.isDate(l))return!1;if(u.isObject(l)){for(h in l)return!1;return!0}return!1},format:u.extend(function(l,h){return u.isString(l)?l.replace(u.format.FORMAT_REGEXP,function(m,b,T){return b==="%"?"%{"+T+"}":String(h[T])}):l},{FORMAT_REGEXP:/(%?)%\{([^\}]+)\}/g}),prettify:function(l){return u.isNumber(l)?l*100%1===0?""+l:parseFloat(Math.round(l*100)/100).toFixed(2):u.isArray(l)?l.map(function(h){return u.prettify(h)}).join(", "):u.isObject(l)?u.isDefined(l.toString)?l.toString():JSON.stringify(l):(l=""+l,l.replace(/([^\s])\.([^\s])/g,"$1 $2").replace(/\\+/g,"").replace(/[_-]/g," ").replace(/([a-z])([A-Z])/g,function(h,m,b){return""+m+" "+b.toLowerCase()}).toLowerCase())},stringifyValue:function(l,h){var m=h&&h.prettify||u.prettify;return m(l)},isString:function(l){return typeof l=="string"},isArray:function(l){return{}.toString.call(l)==="[object Array]"},isHash:function(l){return u.isObject(l)&&!u.isArray(l)&&!u.isFunction(l)},contains:function(l,h){return u.isDefined(l)?u.isArray(l)?l.indexOf(h)!==-1:h in l:!1},unique:function(l){return u.isArray(l)?l.filter(function(h,m,b){return b.indexOf(h)==m}):l},forEachKeyInKeypath:function(l,h,m){if(u.isString(h)){var b="",T,R=!1;for(T=0;T<h.length;++T)switch(h[T]){case".":R?(R=!1,b+="."):(l=m(l,b,!1),b="");break;case"\\":R?(R=!1,b+="\\"):R=!0;break;default:R=!1,b+=h[T];break}return m(l,b,!0)}},getDeepObjectValue:function(l,h){if(u.isObject(l))return u.forEachKeyInKeypath(l,h,function(m,b){if(u.isObject(m))return m[b]})},collectFormValues:function(l,h){var m={},b,T,R,$,O,B;if(u.isJqueryElement(l)&&(l=l[0]),!l)return m;for(h=h||{},$=l.querySelectorAll("input[name], textarea[name]"),b=0;b<$.length;++b)if(R=$.item(b),!u.isDefined(R.getAttribute("data-ignored"))){var F=R.name.replace(/\./g,"\\\\.");B=u.sanitizeFormValue(R.value,h),R.type==="number"?B=B?+B:null:R.type==="checkbox"?R.attributes.value?R.checked||(B=m[F]||null):B=R.checked:R.type==="radio"&&(R.checked||(B=m[F]||null)),m[F]=B}for($=l.querySelectorAll("select[name]"),b=0;b<$.length;++b)if(R=$.item(b),!u.isDefined(R.getAttribute("data-ignored"))){if(R.multiple){B=[];for(T in R.options)O=R.options[T],O&&O.selected&&B.push(u.sanitizeFormValue(O.value,h))}else{var re=typeof R.options[R.selectedIndex]<"u"?R.options[R.selectedIndex].value:"";B=u.sanitizeFormValue(re,h)}m[R.name]=B}return m},sanitizeFormValue:function(l,h){return h.trim&&u.isString(l)&&(l=l.trim()),h.nullify!==!1&&l===""?null:l},capitalize:function(l){return u.isString(l)?l[0].toUpperCase()+l.slice(1):l},pruneEmptyErrors:function(l){return l.filter(function(h){return!u.isEmpty(h.error)})},expandMultipleErrors:function(l){var h=[];return l.forEach(function(m){u.isArray(m.error)?m.error.forEach(function(b){h.push(u.extend({},m,{error:b}))}):h.push(m)}),h},convertErrorMessages:function(l,h){h=h||{};var m=[],b=h.prettify||u.prettify;return l.forEach(function(T){var R=u.result(T.error,T.value,T.attribute,T.options,T.attributes,T.globalOptions);if(!u.isString(R)){m.push(T);return}R[0]==="^"?R=R.slice(1):h.fullMessages!==!1&&(R=u.capitalize(b(T.attribute))+" "+R),R=R.replace(/\\\^/g,"^"),R=u.format(R,{value:u.stringifyValue(T.value,h)}),m.push(u.extend({},T,{error:R}))}),m},groupErrorsByAttribute:function(l){var h={};return l.forEach(function(m){var b=h[m.attribute];b?b.push(m):h[m.attribute]=[m]}),h},flattenErrorsToArray:function(l){return l.map(function(h){return h.error}).filter(function(h,m,b){return b.indexOf(h)===m})},cleanAttributes:function(l,h){function m(R,$,O){return u.isObject(R[$])?R[$]:R[$]=O?!0:{}}function b(R){var $={},O;for(O in R)R[O]&&u.forEachKeyInKeypath($,O,m);return $}function T(R,$){if(!u.isObject(R))return R;var O=u.extend({},R),B,F;for(F in R)B=$[F],u.isObject(B)?O[F]=T(O[F],B):B||delete O[F];return O}return!u.isObject(h)||!u.isObject(l)?{}:(h=b(h),T(l,h))},exposeModule:function(l,h,m,b,T){m?(b&&b.exports&&(m=b.exports=l),m.validate=l):(h.validate=l,l.isFunction(T)&&T.amd&&T([],function(){return l}))},warn:function(l){typeof console<"u"&&console.warn&&console.warn("[validate.js] "+l)},error:function(l){typeof console<"u"&&console.error&&console.error("[validate.js] "+l)}}),c.validators={presence:function(l,h){if(h=u.extend({},this.options,h),h.allowEmpty!==!1?!u.isDefined(l):u.isEmpty(l))return h.message||this.message||"can't be blank"},length:function(l,h,m){if(u.isDefined(l)){h=u.extend({},this.options,h);var b=h.is,T=h.maximum,R=h.minimum,$=h.tokenizer||function(re){return re},O,B=[];l=$(l);var F=l.length;if(!u.isNumber(F))return h.message||this.notValid||"has an incorrect length";if(u.isNumber(b)&&F!==b&&(O=h.wrongLength||this.wrongLength||"is the wrong length (should be %{count} characters)",B.push(u.format(O,{count:b}))),u.isNumber(R)&&F<R&&(O=h.tooShort||this.tooShort||"is too short (minimum is %{count} characters)",B.push(u.format(O,{count:R}))),u.isNumber(T)&&F>T&&(O=h.tooLong||this.tooLong||"is too long (maximum is %{count} characters)",B.push(u.format(O,{count:T}))),B.length>0)return h.message||B}},numericality:function(l,h,m,b,T){if(u.isDefined(l)){h=u.extend({},this.options,h);var R=[],$,O,B={greaterThan:function(ve,ye){return ve>ye},greaterThanOrEqualTo:function(ve,ye){return ve>=ye},equalTo:function(ve,ye){return ve===ye},lessThan:function(ve,ye){return ve<ye},lessThanOrEqualTo:function(ve,ye){return ve<=ye},divisibleBy:function(ve,ye){return ve%ye===0}},F=h.prettify||T&&T.prettify||u.prettify;if(u.isString(l)&&h.strict){var re="^-?(0|[1-9]\\d*)";if(h.onlyInteger||(re+="(\\.\\d+)?"),re+="$",!new RegExp(re).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 B)if(O=h[$],u.isNumber(O)&&!B[$](l,O)){var Y="not"+u.capitalize($),Ee=h[Y]||this[Y]||this.message||"must be %{type} %{count}";R.push(u.format(Ee,{count:O,type:F($)}))}if(h.odd&&l%2!==1&&R.push(h.notOdd||this.notOdd||this.message||"must be odd"),h.even&&l%2!==0&&R.push(h.notEven||this.notEven||this.message||"must be even"),R.length)return h.message||R}},datetime:u.extend(function(l,h){if(!u.isFunction(this.parse)||!u.isFunction(this.format))throw new Error("Both the parse and format functions needs to be set to use the datetime/date validator");if(u.isDefined(l)){h=u.extend({},this.options,h);var m,b=[],T=h.earliest?this.parse(h.earliest,h):NaN,R=h.latest?this.parse(h.latest,h):NaN;if(l=this.parse(l,h),isNaN(l)||h.dateOnly&&l%864e5!==0)return m=h.notValid||h.message||this.notValid||"must be a valid date",u.format(m,{value:arguments[0]});if(!isNaN(T)&&l<T&&(m=h.tooEarly||h.message||this.tooEarly||"must be no earlier than %{date}",m=u.format(m,{value:this.format(l,h),date:this.format(T,h)}),b.push(m)),!isNaN(R)&&l>R&&(m=h.tooLate||h.message||this.tooLate||"must be no later than %{date}",m=u.format(m,{date:this.format(R,h),value:this.format(l,h)}),b.push(m)),b.length)return u.unique(b)}},{parse:null,format:null}),date:function(l,h){return h=u.extend({},h,{dateOnly:!0}),u.validators.datetime.call(u.validators.datetime,l,h)},format:function(l,h){(u.isString(h)||h instanceof RegExp)&&(h={pattern:h}),h=u.extend({},this.options,h);var m=h.message||this.message||"is invalid",b=h.pattern,T;if(u.isDefined(l)&&(!u.isString(l)||(u.isString(b)&&(b=new RegExp(h.pattern,h.flags)),T=b.exec(l),!T||T[0].length!=l.length)))return m},inclusion:function(l,h){if(u.isDefined(l)&&(u.isArray(h)&&(h={within:h}),h=u.extend({},this.options,h),!u.contains(h.within,l))){var m=h.message||this.message||"^%{value} is not included in the list";return u.format(m,{value:l})}},exclusion:function(l,h){if(u.isDefined(l)&&(u.isArray(h)&&(h={within:h}),h=u.extend({},this.options,h),!!u.contains(h.within,l))){var m=h.message||this.message||"^%{value} is restricted";return u.isString(h.within[l])&&(l=h.within[l]),u.format(m,{value:l})}},email:u.extend(function(l,h){h=u.extend({},this.options,h);var m=h.message||this.message||"is not a valid email";if(u.isDefined(l)&&(!u.isString(l)||!this.PATTERN.exec(l)))return m},{PATTERN:/^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i}),equality:function(l,h,m,b,T){if(u.isDefined(l)){u.isString(h)&&(h={attribute:h}),h=u.extend({},this.options,h);var R=h.message||this.message||"is not equal to %{attribute}";if(u.isEmpty(h.attribute)||!u.isString(h.attribute))throw new Error("The attribute must be a non empty string");var $=u.getDeepObjectValue(b,h.attribute),O=h.comparator||function(F,re){return F===re},B=h.prettify||T&&T.prettify||u.prettify;if(!O(l,$,h,m,b))return u.format(R,{attribute:B(h.attribute)})}},url:function(l,h){if(u.isDefined(l)){h=u.extend({},this.options,h);var m=h.message||this.message||"is not a valid url",b=h.schemes||this.schemes||["http","https"],T=h.allowLocal||this.allowLocal||!1,R=h.allowDataUrl||this.allowDataUrl||!1;if(!u.isString(l))return m;var $="^(?:(?:"+b.join("|")+")://)(?:\\S+(?::\\S*)?@)?(?:",O="(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))";if(T?O+="?":$+="(?!(?:10|127)(?:\\.\\d{1,3}){3})(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})",$+="(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*"+O+")(?::\\d{2,5})?(?:[/?#]\\S*)?$",R){var B="\\w+\\/[-+.\\w]+(?:;[\\w=]+)*",F="[A-Za-z0-9-_.!~\\*'();\\/?:@&=+$,%]*",re="data:(?:"+B+")?(?:;base64)?,"+F;$="(?:"+$+")|(?:^"+re+"$)"}var Y=new RegExp($,"i");if(!Y.exec(l))return m}},type:u.extend(function(l,h,m,b,T){if(u.isString(h)&&(h={type:h}),!!u.isDefined(l)){var R=u.extend({},this.options,h),$=R.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,R,m,b,T)){var B=h.message||this.messages[$]||this.message||R.message||(u.isFunction($)?"must be of the correct type":"must be of type %{type}");return u.isFunction(B)&&(B=B(l,h,m,b,T)),u.format(B,{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(i1,t,e,null)})(Ni,Ni.exports)),Ni.exports}var a1=s1();const zo=sl(a1);zo.validators.bigNumericality=(e,t,n,s)=>zo.validators.numericality(e&&e.toNumber(),t,s);var zn=(e=>(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))(zn||{}),Nf=(e=>(e.HEDGE_MODE="hedgeMode",e.ORDER_QUOTE_AMOUNT="orderQuoteAmount",e.MARKET_BUY_QUOTE_ONLY="marketBuyQuoteOnly",e.UPDATE_LEVERAGE_ONLY_ON_OPEN_POSITIONS="updateLeverageOnlyOnOpenPositions",e.FAST_CONNECT="fastConnect",e.UNIFIED_BALANCE="unifiedBalance",e))(Nf||{}),Uf=(e=>(e.NONE="NONE",e.LIST="LIST",e.COMMA="COMMA",e.COMMA_SPACE="COMMA_SPACE",e.SPACE="SPACE",e))(Uf||{}),If=(e=>(e.CROSSED="CROSSED",e.ISOLATED="ISOLATED",e))(If||{}),Bf=(e=>(e.OPEN="open",e.CLOSED="closed",e.CANCELED="canceled",e))(Bf||{}),Vn=(e=>(e.BUY="buy",e.SELL="sell",e))(Vn||{}),Ff=(e=>(e.GTC="gtc",e.FOK="fok",e.IOC="ioc",e))(Ff||{}),Br=(e=>(e.QUOTE="quote",e.BASE="base",e.NONE="none",e))(Br||{});const o1=Object.freeze(Object.defineProperty({__proto__:null,BalanceLimit:Br,ExchangeFeatures:Nf,IpWhiteList:Uf,MarginType:If,OrderSide:Vn,OrderStatus:Bf,OrderType:zn,TimeInForce:Ff},Symbol.toStringTag,{value:"Module"})),ut=[];for(let e=0;e<256;++e)ut.push((e+256).toString(16).slice(1));function u1(e,t=0){return(ut[e[t+0]]+ut[e[t+1]]+ut[e[t+2]]+ut[e[t+3]]+"-"+ut[e[t+4]]+ut[e[t+5]]+"-"+ut[e[t+6]]+ut[e[t+7]]+"-"+ut[e[t+8]]+ut[e[t+9]]+"-"+ut[e[t+10]]+ut[e[t+11]]+ut[e[t+12]]+ut[e[t+13]]+ut[e[t+14]]+ut[e[t+15]]).toLowerCase()}let Vo;const c1=new Uint8Array(16);function l1(){if(!Vo){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Vo=crypto.getRandomValues.bind(crypto)}return Vo(c1)}const Wf={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function f1(e,t,n){e=e||{};const s=e.random??e.rng?.()??l1();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,u1(s)}function h1(e,t,n){return Wf.randomUUID&&!e?Wf.randomUUID():f1(e)}class jo{id=h1();coinraySymbol;precisionBase;precisionQuote;precisionPrice;minBase;minQuote;makerFee;takerFee;balances;balanceLimit;side;errors;isValid;orderExternalId;reduceOnly;postOnly;timeInForce;constructor(t){this.coinraySymbol=t.coinraySymbol,this.precisionBase=Mi(t.precisionBase),this.precisionQuote=Mi(t.precisionQuote),this.precisionPrice=Mi(t.precisionPrice),this.minBase=ee(t.minBase),this.minQuote=ee(t.minQuote),this.makerFee=ee(t.makerFee),this.takerFee=ee(t.takerFee),this.balances=t.balances,this.balanceLimit=t.balanceLimit||Br.NONE,this.side=t.side,this.orderExternalId=t.externalId,this.errors={},this.isValid=!0,this.reduceOnly=t.reduceOnly,this.postOnly=t.postOnly,this.timeInForce=t.timeInForce}startEdit(t){this.orderExternalId=t}updateLockedOn(t){}resetError(){this.errors={},this.isValid=!0}validate(){const t=zo(this,this.constraints());return t?(this.errors=t,this.isValid=!1):this.resetError(),!t}}class Jo extends jo{baseAmount;quoteAmount;price;lockedOn;orderType=zn.LIMIT;constraints(){let t,n;return this.balanceLimit===Br.QUOTE?n=this.balances.quote||0:this.balanceLimit===Br.BASE&&(t=this.balances.base||0),{baseAmount:{bigNumericality:{greaterThanOrEqualTo:this.minBase.toNumber(),notGreaterThanOrEqualTo:`^${Ce.I18n.t("validation.notGreaterThanOrEqualTo",{min:Gn(this.precisionBase,this.minBase)})}`,lessThanOrEqualTo:t?t.toNumber():void 0,notLessThanOrEqualTo:`^${Ce.I18n.t("validation.insufficientFunds")}`}},quoteAmount:{bigNumericality:{greaterThanOrEqualTo:this.minQuote.toNumber(),notGreaterThanOrEqualTo:`^${Ce.I18n.t("validation.notGreaterThanOrEqualTo",{min:Gn(this.precisionQuote,this.minQuote)})}`,lessThanOrEqualTo:n?n.toNumber():void 0,notLessThanOrEqualTo:`^${Ce.I18n.t("validation.insufficientFunds")}`}},price:{bigNumericality:{greaterThan:0}}}}constructor(t,n=!0){super(t),this.price=ee(t.price||"0"),this.lockedOn=t.lockedOn,this.baseAmount=ee(t.baseAmount),this.quoteAmount=ee(t.quoteAmount),n&&(this.quoteAmount.gt(0)&&this.lockedOn==="quoteAmount"?this.updateQuoteAmount(this.quoteAmount):this.updateBaseAmount(this.baseAmount))}updateBaseAmount(t){this.baseAmount=t,this.quoteAmount=this.price.multipliedBy(this.baseAmount).decimalPlaces(this.precisionQuote>0?this.precisionQuote:0,et.ROUND_DOWN),this.validate()}updateQuoteAmount(t){this.quoteAmount=t,this.baseAmount=t.dividedBy(this.price).decimalPlaces(this.precisionBase>0?this.precisionBase:0,et.ROUND_DOWN),this.validate()}updateLockedOn(t){this.lockedOn=t,this.validate()}quoteFee(){return this.quoteAmount.multipliedBy(this.takerFee)}updatePrice(t){this.price=t.decimalPlaces(this.precisionPrice),this.lockedOn==="baseAmount"?this.updateBaseAmount(this.baseAmount):this.updateQuoteAmount(this.quoteAmount)}getOrders(){return[this]}}class d1 extends jo{baseAmount;quoteAmount;price;orderType=zn.MARKET;constraints=()=>{let t,n;return this.balanceLimit===Br.QUOTE?n=this.balances.quote||0:this.balanceLimit===Br.BASE&&(t=this.balances.base||0),{baseAmount:{bigNumericality:{greaterThanOrEqualTo:t?this.minBase.toNumber():void 0,notGreaterThanOrEqualTo:`^${Ce.I18n.t("validation.notGreaterThanOrEqualTo",{min:Gn(this.precisionBase,this.minBase)})}`,lessThanOrEqualTo:t?t.toNumber():void 0,notLessThanOrEqualTo:`^${Ce.I18n.t("validation.insufficientFunds")}`}},quoteAmount:{bigNumericality:{greaterThanOrEqualTo:n?this.minQuote.toNumber():void 0,notGreaterThanOrEqualTo:`^${Ce.I18n.t("validation.notGreaterThanOrEqualTo",{min:Gn(this.precisionQuote,this.minQuote)})}`,lessThanOrEqualTo:n?n.toNumber():void 0,notLessThanOrEqualTo:`^${Ce.I18n.t("validation.insufficientFunds")}`}}}};constructor(t){super(t),this.updateQuoteAmount(t.quoteAmount),this.updateBaseAmount(t.baseAmount)}updateBaseAmount(t){this.baseAmount=t,t&&(this.quoteAmount=this.price.multipliedBy(this.baseAmount).decimalPlaces(this.precisionQuote>0?this.precisionQuote:0,et.ROUND_DOWN)),this.validate()}updateQuoteAmount(t){this.quoteAmount=t,t&&(this.baseAmount=t.dividedBy(this.price).decimalPlaces(this.precisionBase>0?this.precisionBase:0,et.ROUND_DOWN)),this.validate()}updatePrice(t){this.price=t.decimalPlaces(this.precisionPrice)}getOrders(){return[this]}}const Hf={LINEAR:e=>ot.times(e,t=>1/(e-1)*t),EXPONENTIAL:e=>{const t=2**(e-1);return ot.times(e,n=>n==0?0:2**n/t)},FIBONACCI:e=>[0,.09,.146,.236,.382,.5,.618,.788,.886].slice(0,e-1).concat([1]),CUSTOM:e=>[]},Qo=e=>{const t=ot.sum(e);return e.map(n=>n/t)},Gs={EQUAL:e=>{const t=ot.times(e,()=>1);return Qo(t)},LINEAR:e=>{const t=ot.times(e,n=>1/e*(n+1));return Qo(t)},EXPONENTIAL:e=>{const t=2**e-1,n=ot.times(e,s=>2**s/t);return Qo(n)},LINEAR_REVERSE:e=>Gs.LINEAR(e).reverse(),EXPONENTIAL_REVERSE:e=>Gs.EXPONENTIAL(e).reverse(),CUSTOM:e=>[]};class p1 extends jo{baseAmount;quoteAmount;price;lockedOn;otherPrice;numOrders;priceScale;sizeScale;priceScales;sizeScales;orderType=zn.LIMIT_LADDER;constraints(){let t,n;return this.balanceLimit===Br.QUOTE?n=this.balances.quote:this.balanceLimit===Br.BASE&&(t=this.balances.base),{baseAmount:{bigNumericality:{greaterThanOrEqualTo:this.minBase.toNumber(),notGreaterThanOrEqualTo:`^${Ce.I18n.t("validation.notGreaterThanOrEqualTo",{min:Gn(this.precisionBase,this.minBase)})}`,lessThanOrEqualTo:t?t.toNumber():void 0,notLessThanOrEqualTo:`^${Ce.I18n.t("validation.insufficientFunds")}`}},quoteAmount:{bigNumericality:{greaterThanOrEqualTo:this.minQuote.toNumber(),notGreaterThanOrEqualTo:`^${Ce.I18n.t("validation.notGreaterThanOrEqualTo",{min:Gn(this.precisionQuote,this.minQuote)})}`,lessThanOrEqualTo:n?n.toNumber():void 0,notLessThanOrEqualTo:`^${Ce.I18n.t("validation.insufficientFunds")}`}},price:{bigNumericality:{greaterThan:0}},otherPrice:{bigNumericality:{greaterThan:0}},numOrders:{numericality:{greaterThanOrEqualTo:2}}}}constructor(t){super(t),this.otherPrice=ee(t.otherPrice),this.numOrders=Mi(t.numOrders),this.priceScale=t.priceScale||"CUSTOM",this.sizeScale=t.sizeScale||"CUSTOM",this.price=ee(t.price||"0"),this.lockedOn=t.lockedOn,this.baseAmount=ee(t.baseAmount||"0"),this.quoteAmount=ee(t.quoteAmount||"0"),this.priceScales=t.priceScales||Hf[this.priceScale](this.numOrders),this.sizeScales=t.sizeScales||Gs[this.sizeScale](this.numOrders),this.quoteAmount.gt(0)&&this.lockedOn==="quoteAmount"?this.updateQuoteAmount(this.quoteAmount):this.updateBaseAmount(this.baseAmount)}updateNumOrders(t){this.numOrders=t}updatePrice(t,n=.05){if(this.price=t.decimalPlaces(this.precisionPrice),t&&this.otherPrice.eq(0)){const s=this.side===Vn.BUY?1+n:1-n;this.otherPrice=t.multipliedBy(s).decimalPlaces(this.precisionPrice>0?this.precisionPrice:0)}this.recalculate()}updateOtherPrice(t,n=.05){if(this.otherPrice=t.decimalPlaces(this.precisionPrice),t&&this.price.eq(0)){const s=this.side===Vn.BUY?1-n:1+n;this.price=t.multipliedBy(s).decimalPlaces(this.precisionPrice>0?this.precisionPrice:0)}this.recalculate()}updatePriceScales(t){this.priceScales=t,this.priceScale="CUSTOM",this.recalculate()}updatePriceScale(t){this.priceScales=Hf[t](this.numOrders),this.priceScale=t,this.recalculate()}updateSizeScales(t){this.sizeScales=t,this.sizeScale="CUSTOM",this.recalculate()}updateSizeScale(t){this.sizeScales=Gs[t](this.numOrders),this.sizeScale=t,this.recalculate()}updateLockedOn(t){this.lockedOn=t}recalculate(){this.lockedOn==="baseAmount"?this.updateBaseAmount(this.baseAmount):this.updateQuoteAmount(this.quoteAmount),this.validate()}updateQuoteAmount(t){this.quoteAmount=t,this.numOrders=Math.max(2,+this.numOrders);const n=this.getOrders("quoteAmount");n.length>0?this.baseAmount=ot.reduce(n,(s,a)=>s.plus(a.baseAmount),new et(0)):this.baseAmount=new et(0)}updateBaseAmount(t){this.baseAmount=t,this.numOrders=Math.max(2,+this.numOrders);const n=this.getOrders("baseAmount");n.length>0?this.quoteAmount=ot.reduce(n,(s,a)=>s.plus(a.quoteAmount),new et(0)):this.quoteAmount=new et(0)}getOrders(t=this.lockedOn){const n=t==="baseAmount"?this.baseAmount:this.quoteAmount,s=t==="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 ot.times(this.numOrders,h=>{let m=n.multipliedBy(c[h]).decimalPlaces(s>0?s:0,et.ROUND_DOWN);return l=l.minus(m),h===this.numOrders-1&&(m=m.plus(l)),new Jo({...this,[t]:m,lockedOn:t,price:this.price.plus(u.multipliedBy(a[h])).decimalPlaces(this.precisionPrice>0?this.precisionPrice:0)})})}}class m1 extends Jo{stopPrice;orderType=zn.STOP_LOSS_LIMIT;constraints(){return{...super.constraints(),stopPrice:{bigNumericality:{greaterThan:0}}}}constructor(t){super(t),this.stopPrice=ee(t.stopPrice)}updatePrice(t,n=.05){if(super.updatePrice(t),t&&this.stopPrice.eq(0)){const s=this.side===Vn.BUY?1-n:1+n;this.stopPrice=t.multipliedBy(s).decimalPlaces(this.precisionPrice>0?this.precisionPrice:0)}}updateStopPrice(t,n=.05){if(this.stopPrice=t.decimalPlaces(this.precisionPrice),t&&this.price.eq(0)){const s=this.side===Vn.BUY?1+n:1-n;this.price=t.multipliedBy(s).decimalPlaces(this.precisionPrice>0?this.precisionPrice:0)}}}const g1={"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:"Недостаточно средств"}}};return Wt.CoinrayCache=t1,Wt.CurrentMarket=n1,Wt.LimitLadderOrder=p1,Wt.LimitOrder=Jo,Wt.MarketOrder=d1,Wt.StopLimitOrder=m1,Wt.default=Ce,Wt.jwtExpired=Ks,Wt.locales=g1,Wt.types=o1,Object.defineProperties(Wt,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),Wt})({});
|
|
51
|
+
*/var f1=Bi.exports,Zf;function h1(){return Zf||(Zf=1,(function(e,t){(function(n,s,a){var c=function(l,h,m){m=u.extend({},u.options,m);var b=u.runValidations(l,h,m);if(b.some(function(E){return u.isPromise(E.error)}))throw new Error("Use validate.async if you want support for promises");return c.processValidationResults(b,m)},u=c;u.extend=function(l){return[].slice.call(arguments,1).forEach(function(h){for(var m in h)l[m]=h[m]}),l},u.extend(c,{version:{major:0,minor:13,patch:1,metadata:null,toString:function(){var l=u.format("%{major}.%{minor}.%{patch}",u.version);return u.isEmpty(u.version.metadata)||(l+="+"+u.version.metadata),l}},Promise:typeof Promise<"u"?Promise:null,EMPTY_STRING_REGEXP:/^\s*$/,runValidations:function(l,h,m){var b=[],E,R,$,O,I,F,ne;(u.isDomElement(l)||u.isJqueryElement(l))&&(l=u.collectFormValues(l));for(E in h){$=u.getDeepObjectValue(l,E),O=u.result(h[E],$,l,E,m,h);for(R in O){if(I=u.validators[R],!I)throw ne=u.format("Unknown validator %{name}",{name:R}),new Error(ne);F=O[R],F=u.result(F,$,l,E,m,h),F&&b.push({attribute:E,value:$,validator:R,globalOptions:m,attributes:l,options:F,error:I.call(I,$,F,E,l,m)})}}return b},processValidationResults:function(l,h){l=u.pruneEmptyErrors(l,h),l=u.expandMultipleErrors(l,h),l=u.convertErrorMessages(l,h);var m=h.format||"grouped";if(typeof u.formatters[m]=="function")l=u.formatters[m](l);else throw new Error(u.format("Unknown format %{format}",h));return u.isEmpty(l)?void 0:l},async:function(l,h,m){m=u.extend({},u.async.options,m);var b=m.wrapErrors||function(R){return R};m.cleanAttributes!==!1&&(l=u.cleanAttributes(l,h));var E=u.runValidations(l,h,m);return new u.Promise(function(R,$){u.waitForResults(E).then(function(){var O=u.processValidationResults(E,m);O?$(new b(O,m,l,h)):R(l)},function(O){$(O)})})},single:function(l,h,m){return m=u.extend({},u.single.options,m,{format:"flat",fullMessages:!1}),u({single:l},{single:h},m)},waitForResults:function(l){return l.reduce(function(h,m){return u.isPromise(m.error)?h.then(function(){return m.error.then(function(b){m.error=b||null})}):h},new u.Promise(function(h){h()}))},result:function(l){var h=[].slice.call(arguments,1);return typeof l=="function"&&(l=l.apply(null,h)),l},isNumber:function(l){return typeof l=="number"&&!isNaN(l)},isFunction:function(l){return typeof l=="function"},isInteger:function(l){return u.isNumber(l)&&l%1===0},isBoolean:function(l){return typeof l=="boolean"},isObject:function(l){return l===Object(l)},isDate:function(l){return l instanceof Date},isDefined:function(l){return l!=null},isPromise:function(l){return!!l&&u.isFunction(l.then)},isJqueryElement:function(l){return l&&u.isString(l.jquery)},isDomElement:function(l){return!l||!l.querySelectorAll||!l.querySelector?!1:u.isObject(document)&&l===document?!0:typeof HTMLElement=="object"?l instanceof HTMLElement:l&&typeof l=="object"&&l!==null&&l.nodeType===1&&typeof l.nodeName=="string"},isEmpty:function(l){var h;if(!u.isDefined(l))return!0;if(u.isFunction(l))return!1;if(u.isString(l))return u.EMPTY_STRING_REGEXP.test(l);if(u.isArray(l))return l.length===0;if(u.isDate(l))return!1;if(u.isObject(l)){for(h in l)return!1;return!0}return!1},format:u.extend(function(l,h){return u.isString(l)?l.replace(u.format.FORMAT_REGEXP,function(m,b,E){return b==="%"?"%{"+E+"}":String(h[E])}):l},{FORMAT_REGEXP:/(%?)%\{([^\}]+)\}/g}),prettify:function(l){return u.isNumber(l)?l*100%1===0?""+l:parseFloat(Math.round(l*100)/100).toFixed(2):u.isArray(l)?l.map(function(h){return u.prettify(h)}).join(", "):u.isObject(l)?u.isDefined(l.toString)?l.toString():JSON.stringify(l):(l=""+l,l.replace(/([^\s])\.([^\s])/g,"$1 $2").replace(/\\+/g,"").replace(/[_-]/g," ").replace(/([a-z])([A-Z])/g,function(h,m,b){return""+m+" "+b.toLowerCase()}).toLowerCase())},stringifyValue:function(l,h){var m=h&&h.prettify||u.prettify;return m(l)},isString:function(l){return typeof l=="string"},isArray:function(l){return{}.toString.call(l)==="[object Array]"},isHash:function(l){return u.isObject(l)&&!u.isArray(l)&&!u.isFunction(l)},contains:function(l,h){return u.isDefined(l)?u.isArray(l)?l.indexOf(h)!==-1:h in l:!1},unique:function(l){return u.isArray(l)?l.filter(function(h,m,b){return b.indexOf(h)==m}):l},forEachKeyInKeypath:function(l,h,m){if(u.isString(h)){var b="",E,R=!1;for(E=0;E<h.length;++E)switch(h[E]){case".":R?(R=!1,b+="."):(l=m(l,b,!1),b="");break;case"\\":R?(R=!1,b+="\\"):R=!0;break;default:R=!1,b+=h[E];break}return m(l,b,!0)}},getDeepObjectValue:function(l,h){if(u.isObject(l))return u.forEachKeyInKeypath(l,h,function(m,b){if(u.isObject(m))return m[b]})},collectFormValues:function(l,h){var m={},b,E,R,$,O,I;if(u.isJqueryElement(l)&&(l=l[0]),!l)return m;for(h=h||{},$=l.querySelectorAll("input[name], textarea[name]"),b=0;b<$.length;++b)if(R=$.item(b),!u.isDefined(R.getAttribute("data-ignored"))){var F=R.name.replace(/\./g,"\\\\.");I=u.sanitizeFormValue(R.value,h),R.type==="number"?I=I?+I:null:R.type==="checkbox"?R.attributes.value?R.checked||(I=m[F]||null):I=R.checked:R.type==="radio"&&(R.checked||(I=m[F]||null)),m[F]=I}for($=l.querySelectorAll("select[name]"),b=0;b<$.length;++b)if(R=$.item(b),!u.isDefined(R.getAttribute("data-ignored"))){if(R.multiple){I=[];for(E in R.options)O=R.options[E],O&&O.selected&&I.push(u.sanitizeFormValue(O.value,h))}else{var ne=typeof R.options[R.selectedIndex]<"u"?R.options[R.selectedIndex].value:"";I=u.sanitizeFormValue(ne,h)}m[R.name]=I}return m},sanitizeFormValue:function(l,h){return h.trim&&u.isString(l)&&(l=l.trim()),h.nullify!==!1&&l===""?null:l},capitalize:function(l){return u.isString(l)?l[0].toUpperCase()+l.slice(1):l},pruneEmptyErrors:function(l){return l.filter(function(h){return!u.isEmpty(h.error)})},expandMultipleErrors:function(l){var h=[];return l.forEach(function(m){u.isArray(m.error)?m.error.forEach(function(b){h.push(u.extend({},m,{error:b}))}):h.push(m)}),h},convertErrorMessages:function(l,h){h=h||{};var m=[],b=h.prettify||u.prettify;return l.forEach(function(E){var R=u.result(E.error,E.value,E.attribute,E.options,E.attributes,E.globalOptions);if(!u.isString(R)){m.push(E);return}R[0]==="^"?R=R.slice(1):h.fullMessages!==!1&&(R=u.capitalize(b(E.attribute))+" "+R),R=R.replace(/\\\^/g,"^"),R=u.format(R,{value:u.stringifyValue(E.value,h)}),m.push(u.extend({},E,{error:R}))}),m},groupErrorsByAttribute:function(l){var h={};return l.forEach(function(m){var b=h[m.attribute];b?b.push(m):h[m.attribute]=[m]}),h},flattenErrorsToArray:function(l){return l.map(function(h){return h.error}).filter(function(h,m,b){return b.indexOf(h)===m})},cleanAttributes:function(l,h){function m(R,$,O){return u.isObject(R[$])?R[$]:R[$]=O?!0:{}}function b(R){var $={},O;for(O in R)R[O]&&u.forEachKeyInKeypath($,O,m);return $}function E(R,$){if(!u.isObject(R))return R;var O=u.extend({},R),I,F;for(F in R)I=$[F],u.isObject(I)?O[F]=E(O[F],I):I||delete O[F];return O}return!u.isObject(h)||!u.isObject(l)?{}:(h=b(h),E(l,h))},exposeModule:function(l,h,m,b,E){m?(b&&b.exports&&(m=b.exports=l),m.validate=l):(h.validate=l,l.isFunction(E)&&E.amd&&E([],function(){return l}))},warn:function(l){typeof console<"u"&&console.warn&&console.warn("[validate.js] "+l)},error:function(l){typeof console<"u"&&console.error&&console.error("[validate.js] "+l)}}),c.validators={presence:function(l,h){if(h=u.extend({},this.options,h),h.allowEmpty!==!1?!u.isDefined(l):u.isEmpty(l))return h.message||this.message||"can't be blank"},length:function(l,h,m){if(u.isDefined(l)){h=u.extend({},this.options,h);var b=h.is,E=h.maximum,R=h.minimum,$=h.tokenizer||function(ne){return ne},O,I=[];l=$(l);var F=l.length;if(!u.isNumber(F))return h.message||this.notValid||"has an incorrect length";if(u.isNumber(b)&&F!==b&&(O=h.wrongLength||this.wrongLength||"is the wrong length (should be %{count} characters)",I.push(u.format(O,{count:b}))),u.isNumber(R)&&F<R&&(O=h.tooShort||this.tooShort||"is too short (minimum is %{count} characters)",I.push(u.format(O,{count:R}))),u.isNumber(E)&&F>E&&(O=h.tooLong||this.tooLong||"is too long (maximum is %{count} characters)",I.push(u.format(O,{count:E}))),I.length>0)return h.message||I}},numericality:function(l,h,m,b,E){if(u.isDefined(l)){h=u.extend({},this.options,h);var R=[],$,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||E&&E.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}";R.push(u.format(Ae,{count:O,type:F($)}))}if(h.odd&&l%2!==1&&R.push(h.notOdd||this.notOdd||this.message||"must be odd"),h.even&&l%2!==0&&R.push(h.notEven||this.notEven||this.message||"must be even"),R.length)return h.message||R}},datetime:u.extend(function(l,h){if(!u.isFunction(this.parse)||!u.isFunction(this.format))throw new Error("Both the parse and format functions needs to be set to use the datetime/date validator");if(u.isDefined(l)){h=u.extend({},this.options,h);var m,b=[],E=h.earliest?this.parse(h.earliest,h):NaN,R=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(E)&&l<E&&(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(E,h)}),b.push(m)),!isNaN(R)&&l>R&&(m=h.tooLate||h.message||this.tooLate||"must be no later than %{date}",m=u.format(m,{date:this.format(R,h),value:this.format(l,h)}),b.push(m)),b.length)return u.unique(b)}},{parse:null,format:null}),date:function(l,h){return h=u.extend({},h,{dateOnly:!0}),u.validators.datetime.call(u.validators.datetime,l,h)},format:function(l,h){(u.isString(h)||h instanceof RegExp)&&(h={pattern:h}),h=u.extend({},this.options,h);var m=h.message||this.message||"is invalid",b=h.pattern,E;if(u.isDefined(l)&&(!u.isString(l)||(u.isString(b)&&(b=new RegExp(h.pattern,h.flags)),E=b.exec(l),!E||E[0].length!=l.length)))return m},inclusion:function(l,h){if(u.isDefined(l)&&(u.isArray(h)&&(h={within:h}),h=u.extend({},this.options,h),!u.contains(h.within,l))){var m=h.message||this.message||"^%{value} is not included in the list";return u.format(m,{value:l})}},exclusion:function(l,h){if(u.isDefined(l)&&(u.isArray(h)&&(h={within:h}),h=u.extend({},this.options,h),!!u.contains(h.within,l))){var m=h.message||this.message||"^%{value} is restricted";return u.isString(h.within[l])&&(l=h.within[l]),u.format(m,{value:l})}},email:u.extend(function(l,h){h=u.extend({},this.options,h);var m=h.message||this.message||"is not a valid email";if(u.isDefined(l)&&(!u.isString(l)||!this.PATTERN.exec(l)))return m},{PATTERN:/^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i}),equality:function(l,h,m,b,E){if(u.isDefined(l)){u.isString(h)&&(h={attribute:h}),h=u.extend({},this.options,h);var R=h.message||this.message||"is not equal to %{attribute}";if(u.isEmpty(h.attribute)||!u.isString(h.attribute))throw new Error("The attribute must be a non empty string");var $=u.getDeepObjectValue(b,h.attribute),O=h.comparator||function(F,ne){return F===ne},I=h.prettify||E&&E.prettify||u.prettify;if(!O(l,$,h,m,b))return u.format(R,{attribute:I(h.attribute)})}},url:function(l,h){if(u.isDefined(l)){h=u.extend({},this.options,h);var m=h.message||this.message||"is not a valid url",b=h.schemes||this.schemes||["http","https"],E=h.allowLocal||this.allowLocal||!1,R=h.allowDataUrl||this.allowDataUrl||!1;if(!u.isString(l))return m;var $="^(?:(?:"+b.join("|")+")://)(?:\\S+(?::\\S*)?@)?(?:",O="(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))";if(E?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*)?$",R){var I="\\w+\\/[-+.\\w]+(?:;[\\w=]+)*",F="[A-Za-z0-9-_.!~\\*'();\\/?:@&=+$,%]*",ne="data:(?:"+I+")?(?:;base64)?,"+F;$="(?:"+$+")|(?:^"+ne+"$)"}var Y=new RegExp($,"i");if(!Y.exec(l))return m}},type:u.extend(function(l,h,m,b,E){if(u.isString(h)&&(h={type:h}),!!u.isDefined(l)){var R=u.extend({},this.options,h),$=R.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,R,m,b,E)){var I=h.message||this.messages[$]||this.message||R.message||(u.isFunction($)?"must be of the correct type":"must be of type %{type}");return u.isFunction(I)&&(I=I(l,h,m,b,E)),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(f1,t,e,null)})(Bi,Bi.exports)),Bi.exports}var d1=h1();const iu=bl(d1);iu.validators.bigNumericality=(e,t,n,s)=>iu.validators.numericality(e&&e.toNumber(),t,s);var rn=(e=>(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))(rn||{}),su=(e=>(e.HEDGE_MODE="hedgeMode",e.ORDER_QUOTE_AMOUNT="orderQuoteAmount",e.MARKET_BUY_QUOTE_ONLY="marketBuyQuoteOnly",e.UPDATE_LEVERAGE_ONLY_ON_OPEN_POSITIONS="updateLeverageOnlyOnOpenPositions",e.FAST_CONNECT="fastConnect",e.UNIFIED_BALANCE="unifiedBalance",e))(su||{}),au=(e=>(e.NONE="NONE",e.LIST="LIST",e.COMMA="COMMA",e.COMMA_SPACE="COMMA_SPACE",e.SPACE="SPACE",e))(au||{}),ou=(e=>(e.CROSSED="CROSSED",e.ISOLATED="ISOLATED",e))(ou||{}),uu=(e=>(e.OPEN="open",e.CLOSED="closed",e.CANCELED="canceled",e))(uu||{}),_t=(e=>(e.BUY="buy",e.SELL="sell",e))(_t||{}),cu=(e=>(e.GTC="gtc",e.FOK="fok",e.IOC="ioc",e))(cu||{}),Sr=(e=>(e.QUOTE="quote",e.BASE="base",e.NONE="none",e))(Sr||{});const p1=Object.freeze(Object.defineProperty({__proto__:null,BalanceLimit:Sr,ExchangeFeatures:su,IpWhiteList:au,MarginType:ou,OrderSide:_t,OrderStatus:uu,OrderType:rn,TimeInForce:cu},Symbol.toStringTag,{value:"Module"})),lt=[];for(let e=0;e<256;++e)lt.push((e+256).toString(16).slice(1));function m1(e,t=0){return(lt[e[t+0]]+lt[e[t+1]]+lt[e[t+2]]+lt[e[t+3]]+"-"+lt[e[t+4]]+lt[e[t+5]]+"-"+lt[e[t+6]]+lt[e[t+7]]+"-"+lt[e[t+8]]+lt[e[t+9]]+"-"+lt[e[t+10]]+lt[e[t+11]]+lt[e[t+12]]+lt[e[t+13]]+lt[e[t+14]]+lt[e[t+15]]).toLowerCase()}let lu;const g1=new Uint8Array(16);function y1(){if(!lu){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");lu=crypto.getRandomValues.bind(crypto)}return lu(g1)}const Xf={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function _1(e,t,n){e=e||{};const s=e.random??e.rng?.()??y1();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,m1(s)}function w1(e,t,n){return Xf.randomUUID&&!e?Xf.randomUUID():_1(e)}class fu{id=w1();coinraySymbol;precisionBase;precisionQuote;precisionPrice;minBase;minQuote;makerFee;takerFee;balances;balanceLimit;side;errors;isValid;orderExternalId;reduceOnly;postOnly;timeInForce;constructor(t){this.coinraySymbol=t.coinraySymbol,this.precisionBase=jn(t.precisionBase),this.precisionQuote=jn(t.precisionQuote),this.precisionPrice=jn(t.precisionPrice),this.minBase=X(t.minBase),this.minQuote=X(t.minQuote),this.makerFee=X(t.makerFee),this.takerFee=X(t.takerFee),this.balances=t.balances,this.balanceLimit=t.balanceLimit||Sr.NONE,this.side=t.side,this.orderExternalId=t.externalId,this.errors={},this.isValid=!0,this.reduceOnly=t.reduceOnly,this.postOnly=t.postOnly,this.timeInForce=t.timeInForce}startEdit(t){this.orderExternalId=t}updateLockedOn(t){}resetError(){this.errors={},this.isValid=!0}validate(){const t=iu(this,this.constraints());return t?(this.errors=t,this.isValid=!1):this.resetError(),!t}}class Zs extends fu{baseAmount;quoteAmount;price;lockedOn;orderType=rn.LIMIT;constraints(){let t,n;return this.balanceLimit===Sr.QUOTE?n=this.balances.quote||0:this.balanceLimit===Sr.BASE&&(t=this.balances.base||0),{baseAmount:{bigNumericality:{greaterThanOrEqualTo:this.minBase.toNumber(),notGreaterThanOrEqualTo:`^${xe.I18n.t("validation.notGreaterThanOrEqualTo",{min:Tn(this.precisionBase,this.minBase)})}`,lessThanOrEqualTo:t?t.toNumber():void 0,notLessThanOrEqualTo:`^${xe.I18n.t("validation.insufficientFunds")}`}},quoteAmount:{bigNumericality:{greaterThanOrEqualTo:this.minQuote.toNumber(),notGreaterThanOrEqualTo:`^${xe.I18n.t("validation.notGreaterThanOrEqualTo",{min:Tn(this.precisionQuote,this.minQuote)})}`,lessThanOrEqualTo:n?n.toNumber():void 0,notLessThanOrEqualTo:`^${xe.I18n.t("validation.insufficientFunds")}`}},price:{bigNumericality:{greaterThan:0}}}}constructor(t,n=!0){super(t),this.price=X(t.price||"0"),this.lockedOn=t.lockedOn,this.baseAmount=X(t.baseAmount),this.quoteAmount=X(t.quoteAmount),n&&(this.quoteAmount.gt(0)&&this.lockedOn==="quoteAmount"?this.updateQuoteAmount(this.quoteAmount):this.updateBaseAmount(this.baseAmount))}updateBaseAmount(t){this.baseAmount=t,this.quoteAmount=this.price.multipliedBy(this.baseAmount).decimalPlaces(this.precisionQuote>0?this.precisionQuote:0,Ze.ROUND_DOWN),this.validate()}updateQuoteAmount(t){this.quoteAmount=t,this.baseAmount=t.dividedBy(this.price).decimalPlaces(this.precisionBase>0?this.precisionBase:0,Ze.ROUND_DOWN),this.validate()}updateLockedOn(t){this.lockedOn=t,this.validate()}quoteFee(){return this.quoteAmount.multipliedBy(this.takerFee)}updatePrice(t){this.price=t.decimalPlaces(this.precisionPrice),this.lockedOn==="baseAmount"?this.updateBaseAmount(this.baseAmount):this.updateQuoteAmount(this.quoteAmount)}getOrders(){return[this]}}class b1 extends fu{baseAmount;quoteAmount;price;orderType=rn.MARKET;constraints=()=>{let t,n;return this.balanceLimit===Sr.QUOTE?n=this.balances.quote||0:this.balanceLimit===Sr.BASE&&(t=this.balances.base||0),{baseAmount:{bigNumericality:{greaterThanOrEqualTo:t?this.minBase.toNumber():void 0,notGreaterThanOrEqualTo:`^${xe.I18n.t("validation.notGreaterThanOrEqualTo",{min:Tn(this.precisionBase,this.minBase)})}`,lessThanOrEqualTo:t?t.toNumber():void 0,notLessThanOrEqualTo:`^${xe.I18n.t("validation.insufficientFunds")}`}},quoteAmount:{bigNumericality:{greaterThanOrEqualTo:n?this.minQuote.toNumber():void 0,notGreaterThanOrEqualTo:`^${xe.I18n.t("validation.notGreaterThanOrEqualTo",{min:Tn(this.precisionQuote,this.minQuote)})}`,lessThanOrEqualTo:n?n.toNumber():void 0,notLessThanOrEqualTo:`^${xe.I18n.t("validation.insufficientFunds")}`}}}};constructor(t){super(t),this.updateQuoteAmount(t.quoteAmount),this.updateBaseAmount(t.baseAmount)}updateBaseAmount(t){this.baseAmount=t,t&&(this.quoteAmount=this.price.multipliedBy(this.baseAmount).decimalPlaces(this.precisionQuote>0?this.precisionQuote:0,Ze.ROUND_DOWN)),this.validate()}updateQuoteAmount(t){this.quoteAmount=t,t&&(this.baseAmount=t.dividedBy(this.price).decimalPlaces(this.precisionBase>0?this.precisionBase:0,Ze.ROUND_DOWN)),this.validate()}updatePrice(t){this.price=t.decimalPlaces(this.precisionPrice)}getOrders(){return[this]}}var eh=(e=>(e.LINEAR="LINEAR",e.EXPONENTIAL="EXPONENTIAL",e.FIBONACCI="FIBONACCI",e.CUSTOM="CUSTOM",e))(eh||{}),th=(e=>(e.EQUAL="EQUAL",e.LINEAR="LINEAR",e.LINEAR_REVERSE="LINEAR_REVERSE",e.EXPONENTIAL="EXPONENTIAL",e.EXPONENTIAL_REVERSE="EXPONENTIAL_REVERSE",e.CUSTOM="CUSTOM",e))(th||{});const rh={LINEAR:e=>ut.times(e,t=>1/(e-1)*t),EXPONENTIAL:e=>{const t=2**(e-1);return ut.times(e,n=>n==0?0:2**n/t)},FIBONACCI:e=>[0,.09,.146,.236,.382,.5,.618,.788,.886].slice(0,e-1).concat([1]),CUSTOM:e=>[]},hu=e=>{const t=ut.sum(e);return e.map(n=>n/t)},Xs={EQUAL:e=>{const t=ut.times(e,()=>1);return hu(t)},LINEAR:e=>{const t=ut.times(e,n=>1/e*(n+1));return hu(t)},EXPONENTIAL:e=>{const t=2**e-1,n=ut.times(e,s=>2**s/t);return hu(n)},LINEAR_REVERSE:e=>Xs.LINEAR(e).reverse(),EXPONENTIAL_REVERSE:e=>Xs.EXPONENTIAL(e).reverse(),CUSTOM:e=>[]};class v1 extends fu{baseAmount;quoteAmount;price;lockedOn;otherPrice;numOrders;priceScale;sizeScale;priceScales;sizeScales;orderType=rn.LIMIT_LADDER;constraints(){let t,n;return this.balanceLimit===Sr.QUOTE?n=this.balances.quote:this.balanceLimit===Sr.BASE&&(t=this.balances.base),{baseAmount:{bigNumericality:{greaterThanOrEqualTo:this.minBase.toNumber(),notGreaterThanOrEqualTo:`^${xe.I18n.t("validation.notGreaterThanOrEqualTo",{min:Tn(this.precisionBase,this.minBase)})}`,lessThanOrEqualTo:t?t.toNumber():void 0,notLessThanOrEqualTo:`^${xe.I18n.t("validation.insufficientFunds")}`}},quoteAmount:{bigNumericality:{greaterThanOrEqualTo:this.minQuote.toNumber(),notGreaterThanOrEqualTo:`^${xe.I18n.t("validation.notGreaterThanOrEqualTo",{min:Tn(this.precisionQuote,this.minQuote)})}`,lessThanOrEqualTo:n?n.toNumber():void 0,notLessThanOrEqualTo:`^${xe.I18n.t("validation.insufficientFunds")}`}},price:{bigNumericality:{greaterThan:0}},otherPrice:{bigNumericality:{greaterThan:0}},numOrders:{numericality:{greaterThanOrEqualTo:2}}}}constructor(t){super(t),this.otherPrice=X(t.otherPrice),this.numOrders=jn(t.numOrders),this.priceScale=t.priceScale||"CUSTOM",this.sizeScale=t.sizeScale||"CUSTOM",this.price=X(t.price||"0"),this.lockedOn=t.lockedOn,this.baseAmount=X(t.baseAmount||"0"),this.quoteAmount=X(t.quoteAmount||"0"),this.priceScales=t.priceScales||rh[this.priceScale](this.numOrders),this.sizeScales=t.sizeScales||Xs[this.sizeScale](this.numOrders),this.quoteAmount.gt(0)&&this.lockedOn==="quoteAmount"?this.updateQuoteAmount(this.quoteAmount):this.updateBaseAmount(this.baseAmount)}updateNumOrders(t){this.numOrders=t}updatePrice(t,n=.05){if(this.price=t.decimalPlaces(this.precisionPrice),t&&this.otherPrice.eq(0)){const s=this.side===_t.BUY?1+n:1-n;this.otherPrice=t.multipliedBy(s).decimalPlaces(this.precisionPrice>0?this.precisionPrice:0)}this.recalculate()}updateOtherPrice(t,n=.05){if(this.otherPrice=t.decimalPlaces(this.precisionPrice),t&&this.price.eq(0)){const s=this.side===_t.BUY?1-n:1+n;this.price=t.multipliedBy(s).decimalPlaces(this.precisionPrice>0?this.precisionPrice:0)}this.recalculate()}updatePriceScales(t){this.priceScales=t,this.priceScale="CUSTOM",this.recalculate()}updatePriceScale(t){this.priceScales=rh[t](this.numOrders),this.priceScale=t,this.recalculate()}updateSizeScales(t){this.sizeScales=t,this.sizeScale="CUSTOM",this.recalculate()}updateSizeScale(t){this.sizeScales=Xs[t](this.numOrders),this.sizeScale=t,this.recalculate()}updateLockedOn(t){this.lockedOn=t}recalculate(){this.lockedOn==="baseAmount"?this.updateBaseAmount(this.baseAmount):this.updateQuoteAmount(this.quoteAmount),this.validate()}updateQuoteAmount(t){this.quoteAmount=t,this.numOrders=Math.max(2,+this.numOrders);const n=this.getOrders("quoteAmount");n.length>0?this.baseAmount=ut.reduce(n,(s,a)=>s.plus(a.baseAmount),new Ze(0)):this.baseAmount=new Ze(0)}updateBaseAmount(t){this.baseAmount=t,this.numOrders=Math.max(2,+this.numOrders);const n=this.getOrders("baseAmount");n.length>0?this.quoteAmount=ut.reduce(n,(s,a)=>s.plus(a.quoteAmount),new Ze(0)):this.quoteAmount=new Ze(0)}getOrders(t=this.lockedOn){const n=t==="baseAmount"?this.baseAmount:this.quoteAmount,s=t==="baseAmount"?this.precisionBase:this.precisionQuote;if(!(this.priceScales&&this.priceScales.length>0&&this.sizeScales.length>0&&n.gt(0)))return[];const a=this.priceScales.slice(0,this.numOrders),c=this.sizeScales.slice(0,this.numOrders),u=this.otherPrice.minus(this.price);let l=n;return ut.times(this.numOrders,h=>{let m=n.multipliedBy(c[h]).decimalPlaces(s>0?s:0,Ze.ROUND_DOWN);return l=l.minus(m),h===this.numOrders-1&&(m=m.plus(l)),new Zs({...this,[t]:m,lockedOn:t,price:this.price.plus(u.multipliedBy(a[h])).decimalPlaces(this.precisionPrice>0?this.precisionPrice:0)})})}}class S1 extends Zs{stopPrice;orderType=rn.STOP_LOSS_LIMIT;constraints(){return{...super.constraints(),stopPrice:{bigNumericality:{greaterThan:0}}}}constructor(t){super(t),this.stopPrice=X(t.stopPrice)}updatePrice(t,n=.05){if(super.updatePrice(t),t&&this.stopPrice.eq(0)){const s=this.side===_t.BUY?1-n:1+n;this.stopPrice=t.multipliedBy(s).decimalPlaces(this.precisionPrice>0?this.precisionPrice:0)}}updateStopPrice(t,n=.05){if(this.stopPrice=t.decimalPlaces(this.precisionPrice),t&&this.price.eq(0)){const s=this.side===_t.BUY?1+n:1-n;this.price=t.multipliedBy(s).decimalPlaces(this.precisionPrice>0?this.precisionPrice:0)}}}class E1 extends Zs{linkedOrderId;otherPrice;stopPrice;orderType=rn.OCO;constraints(){return{...super.constraints(),otherPrice:{bigNumericality:{greaterThan:0}},stopPrice:{bigNumericality:{greaterThan:0}}}}constructor(t){super(t,!1),this.otherPrice=X(t.otherPrice),this.stopPrice=X(t.stopPrice),this.quoteAmount.gt(0)&&this.lockedOn==="quoteAmount"?this.updateQuoteAmount(this.quoteAmount):this.updateBaseAmount(this.baseAmount)}updateQuoteAmount(t){this.quoteAmount=t;let n=this.side===_t.BUY?this.otherPrice:this.price;this.baseAmount=t.dividedBy(n).decimalPlaces(this.precisionBase>0?this.precisionBase:0,Ze.ROUND_DOWN),this.validate()}updateBaseAmount(t){this.baseAmount=t;let n=this.side===_t.BUY?this.otherPrice:this.price;this.quoteAmount=n.multipliedBy(this.baseAmount).decimalPlaces(this.precisionQuote>0?this.precisionQuote:0,Ze.ROUND_DOWN),this.validate()}updatePrice(t,n=.05){if(super.updatePrice(t),t&&this.otherPrice.eq(0)){const s=this.side===_t.BUY?1+n*2:1-n*2,a=this.side===_t.BUY?1+n:1-n;this.otherPrice=t.multipliedBy(s).decimalPlaces(this.precisionPrice>0?this.precisionPrice:0),this.stopPrice=t.multipliedBy(a).decimalPlaces(this.precisionPrice>0?this.precisionPrice:0)}}updateOtherPrice(t,n=.05){if(this.otherPrice=t.decimalPlaces(this.precisionPrice),t&&this.price.eq(0)){const s=this.side===_t.BUY?1-n*2:1+n*2,a=this.side===_t.BUY?1-n:1+n;this.price=t.multipliedBy(s).decimalPlaces(this.precisionPrice>0?this.precisionPrice:0),this.stopPrice=t.multipliedBy(a).decimalPlaces(this.precisionPrice>0?this.precisionPrice:0)}}updateStopPrice(t,n=.05){if(this.stopPrice=t.decimalPlaces(this.precisionPrice),t&&this.price.eq(0)){const s=this.side===_t.BUY?1-n:1+n,a=this.side===_t.BUY?1+n:1-n;this.price=t.multipliedBy(s).decimalPlaces(this.precisionPrice>0?this.precisionPrice:0),this.otherPrice=t.multipliedBy(a).decimalPlaces(this.precisionPrice>0?this.precisionPrice:0)}}}return ee.BalanceLimit=Sr,ee.CoinrayCache=o1,ee.CurrentMarket=c1,ee.DAYS=Li,ee.ExchangeFeatures=su,ee.HOURS=Bf,ee.IpWhiteList=au,ee.LimitLadderOrder=v1,ee.LimitOrder=Zs,ee.MINUTES=kt,ee.MarginType=ou,ee.MarketOrder=b1,ee.OcoOrder=E1,ee.OrderSide=_t,ee.OrderStatus=uu,ee.OrderType=rn,ee.PriceScales=eh,ee.SizeScales=th,ee.StopLimitOrder=S1,ee.TimeInForce=cu,ee.WEEK=qs,ee.base64UrlDecode=Gs,ee.base64UrlEncode=$s,ee.camelize=Zo,ee.candleTime=Js,ee.checkArray=zs,ee.checkBigNumber=ct,ee.checkBoolean=En,ee.checkNull=Yf,ee.checkNumber=xt,ee.checkString=Ge,ee.correctNumberPrecision=Tn,ee.createJWT=Jo,ee.default=xe,ee.encryptPayload=Qo,ee.errorHelper=jt,ee.filterMarkets=zf,ee.getBucketStartDates=Vf,ee.getTimeParams=Gf,ee.jwkToPublicKey=Hf,ee.jwtExpired=Vs,ee.locales=l1,ee.parseJWT=Wf,ee.resolutionToBucketType=$f,ee.resolutionToDuration=Kf,ee.safeBigNumber=X,ee.safeFloat=Ni,ee.safeInteger=jn,ee.safeTime=ru,ee.sha256hexdigest=Ff,ee.signHMAC=jo,ee.strToArray=n1,ee.throwIsArray=tu,ee.throwNotObject=eu,ee.throwNull2NonNull=Xo,ee.toBucketEnd=qf,ee.toBucketStart=i1,ee.toSafeDate=js,ee.types=p1,ee.unix=If,Object.defineProperties(ee,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),ee})({});
|
|
52
52
|
//# sourceMappingURL=coinrayjs.js.map
|