@polyv/socket 2.0.0-rc-20250925.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/index.cjs.js +21 -0
- package/index.es.d.ts +511 -0
- package/index.es.js +11087 -0
- package/index.umd.js +21 -0
- package/package.json +17 -0
package/index.umd.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
(function(s0,f0){typeof exports=="object"&&typeof module!="undefined"?f0(exports):typeof define=="function"&&define.amd?define(["exports"],f0):(s0=typeof globalThis!="undefined"?globalThis:s0||self,f0(s0.PolyvSocket={}))})(this,function(s0){"use strict";var v1=Object.defineProperty,y1=Object.defineProperties;var g1=Object.getOwnPropertyDescriptors;var yx=Object.getOwnPropertySymbols;var m1=Object.prototype.hasOwnProperty,B1=Object.prototype.propertyIsEnumerable;var On=(s0,f0,d0)=>f0 in s0?v1(s0,f0,{enumerable:!0,configurable:!0,writable:!0,value:d0}):s0[f0]=d0,i0=(s0,f0)=>{for(var d0 in f0||(f0={}))m1.call(f0,d0)&&On(s0,d0,f0[d0]);if(yx)for(var d0 of yx(f0))B1.call(f0,d0)&&On(s0,d0,f0[d0]);return s0},Y0=(s0,f0)=>y1(s0,g1(f0));var V=(s0,f0,d0)=>On(s0,typeof f0!="symbol"?f0+"":f0,d0);var e0=(s0,f0,d0)=>new Promise((Q0,ct)=>{var Qt=X0=>{try{Fe(d0.next(X0))}catch(Ae){ct(Ae)}},Jt=X0=>{try{Fe(d0.throw(X0))}catch(Ae){ct(Ae)}},Fe=X0=>X0.done?Q0(X0.value):Promise.resolve(X0.value).then(Qt,Jt);Fe((d0=d0.apply(s0,f0)).next())});const f0=Object.prototype.hasOwnProperty;function d0(e,t){return f0.call(e,t)}function Q0(e,...t){if(e==null)throw new TypeError("Cannot convert undefined or null to object");for(let r=0;r<t.length;r++){const n=t[r];if(n!=null)for(const a in n)a!=="__proto__"&&d0(n,a)&&(e[a]=n[a])}return e}function ct(e){if(e!=null){if(Array.isArray(e))return!e.length;for(const t in e)if(d0(e,t))return!1}return!0}const Qt=Object.prototype.toString;function Jt(e){return Qt.call(e)==="[object Object]"}function Fe(e,t,r,n){r==null&&(r=""),(r!==""||!n.ignoreEmpty)&&(typeof n.encode=="function"&&(t=n.encode(t),r=["boolean","string","number"].indexOf(typeof r)!==-1?n.encode(String(r)):""),e.push(t+"="+r))}function X0(e,t,r,n){r.forEach(a=>{Fe(e,t,a,n)})}function Ae(e,t){const r=Q0({encode:encodeURIComponent},t),n=[];let a,i;for(a in e)d0(e,a)&&(i=e[a],Array.isArray(i)?X0(n,a,i,r):Fe(n,a,i,r));return n.join("&")}function gx(e){const t={leftContext:""};let r=e.indexOf("#");return r!==-1&&(t.hash=e.slice(r+1),e=e.slice(0,r)),r=e.indexOf("?"),r!==-1&&(t.search=e.slice(r+1),e=e.slice(0,r)),t.leftContext=e,t}function mx(e){let t=e.leftContext;return e.search!=null&&(t+="?"+e.search),e.hash!=null&&(t+="#"+e.hash),t}function Hn(e,t,r){if(e=String(e),t==null||!(t=typeof t=="string"?t.replace(/^[?&]/,""):Ae(t,r)))return e;const n=gx(e);let a=n.search||"";return a&&a.slice(-1)!=="&"&&(a+="&"),a+=t,n.search=a,mx(n)}function Bx(e){if(typeof document=="undefined"||typeof document.createElement!="function")return!1;let t=document.createElement("div");t.innerHTML='<a href="'+e+'"></a>';let r=t.firstChild;const n=r.host!==location.host;return t=null,r=null,n}function Cx(){return/MSIE\s+(\d+)/.test(navigator.userAgent)&&parseInt(RegExp.$1)<10}const Ex=/(?:^|;\s*)(?:application|text)\/([a-z]+)/i;function _x(e){return e&&Ex.test(e)?RegExp.$1.toLowerCase():""}function Fx(e){return!(e===void 0||e>=200&&e<300||e===1223||e===304)}function er(e,t){return e.requestWith=t,Object.freeze(e)}function Ax(e,t){const r=/^(?:(?:[a-z]+):)?\/{2,3}/;return r.test(t)?t:(/\/$/.test(e)||(e+="/"),/^\//.test(t)?r.test(e)?RegExp.lastMatch+e.replace(r,"").split("/")[0]+t:t:e+t)}function Dx(e,t,r){return e=Hn(e,t,{ignoreEmpty:!1}),r&&(e=Hn(e,{_:Date.now()})),e}function Nn(e,t,r,n=!0){const a=t.toLowerCase();Object.keys(e).some(i=>{if(i.toLowerCase()===a)return n&&(e[i]=r),!0})||(e[t]=r)}var J0;(function(e){e.NETWORK_ERROR="network error",e.TIMEOUT="timeout",e.ABORTED="aborted",e.HTTP_ERROR="http error",e.PARSE_ERROR="parse error"})(J0||(J0={}));let ft=class extends Error{constructor(t){super(t.message),this.name="RequestError",this.result=t.result,this.code=t.code,this.type=t.type,Object.freeze(this)}},wx=class{constructor(t,r){this._baseOptions=Object.create(null),this._adapter=t,this.mixBaseOptions(r)}mixBaseOptions(t){return Q0(this._baseOptions,t),Q0(Object.create(null),this._baseOptions)}send(t,r){var n;let a=Q0(Object.create(null),r,this._baseOptions);const i=a.beforeSend;return typeof i=="function"&&(a=(n=i(a))!==null&&n!==void 0?n:a),a.baseURL&&(t=Ax(a.baseURL,t)),t=Dx(t,a.params,a.preventCaching),this._adapter.send(Object.freeze({url:t,baseURL:a.baseURL,params:a.params,data:a.data,headers:a.headers||Object.create(null),method:(a.method||"GET").toUpperCase(),requestType:(a.requestType||"").toLowerCase(),responseType:(a.responseType||"json").toLowerCase(),withCredentials:a.withCredentials,timeout:a.timeout,preventCaching:a.preventCaching,username:a.username,password:a.password,beforeSend:a.beforeSend,beforeXhrSend:a.beforeXhrSend,receiveTaskId:a.receiveTaskId,onUploadProgress:a.onUploadProgress,onDownloadProgress:a.onDownloadProgress,extra:a.extra}))}get(t,r){const n=Q0(Object.create(null),r);return n.method="GET",this.send(t,n)}post(t,r){const n=Q0(Object.create(null),r);return n.method="POST",this.send(t,n)}abort(t){return this._adapter.abort(t)}};var Ge;(function(e){e.XHR="XMLHttpRequest",e.WX_REQUEST="wx.request"})(Ge||(Ge={}));class Sx{constructor(){this.__autoId=0,this.__list=Object.create(null)}addTask(t){const r=++this.__autoId;return this.__list[r]=t,r}removeTask(t){const r=this.__list[t];return delete this.__list[t],r}}const Tx="Network error",kx="Request aborted",Rx="Request timeout",Px="HTTP status error(${status})";function Ix(e,t,r,n){return function(){let a,i,d;switch(t.responseType||_x(e.getResponseHeader("Content-Type"))){case"json":try{a=JSON.parse(e.responseText)}catch(o){d=J0.PARSE_ERROR,i="Invalid JSON structure"}break;case"xml":a=e.responseXML,a&&a.documentElement||(d=J0.PARSE_ERROR,i="Invalid XML format");break;case"blob":a=e.response;break;default:a=e.responseText}const c=er({options:t,data:a,xhr:e},Ge.XHR),p=e.status;let x;Fx(p)?x=new ft({message:Px.replace("${status}",p.toString()),type:J0.HTTP_ERROR,code:p,result:c}):i&&(x=new ft({message:i,type:d,result:c})),x?n(x):r(c)}}function Mn(e,t,r,n,a){return function(){r(new ft({message:n,type:a,result:er({xhr:e,options:t},Ge.XHR)}))}}function qx(e,t,r,n){e.onload=Ix(e,t,r,n),e.ontimeout=Mn(e,t,n,Rx,J0.TIMEOUT),e.onerror=Mn(e,t,n,Tx,J0.NETWORK_ERROR),t.onDownloadProgress&&e.addEventListener("progress",t.onDownloadProgress),t.onUploadProgress&&e.upload&&e.upload.addEventListener("progress",t.onUploadProgress)}const dt=new Sx;function Ox(e,t,r,n,a){return e&&Cx()&&window.XDomainRequest&&(t==="get"||t==="post")&&!r&&!a&&ct(n)?new window.XDomainRequest:new window.XMLHttpRequest}function Hx(e,t,r,n){t.timeout!=null&&(e.timeout=t.timeout),r&&t.withCredentials!=null&&(e.withCredentials=!!t.withCredentials),r||Nn(n,"X-Request-With","XMLHttpRequest",!1),Object.keys(n).forEach(function(a){n[a]!=null&&e.setRequestHeader(a,String(n[a]))})}function Nx(e,t,r,n){if(r==null||e==="GET")return;let a,i;return n==="json"?(a=typeof r=="string"?r:JSON.stringify(r),i="application/json; charset=utf-8"):(a=Jt(r)?Ae(r,{ignoreEmpty:!1}):r,typeof a=="string"&&(i="application/x-www-form-urlencoded; charset=utf-8")),Nn(t,"Content-Type",i,!1),a}const Mx={send:e=>new Promise((t,r)=>{let n=0;const a=Bx(e.url),i=Ox(a,e.method,e.requestType,e.headers,e.withCredentials);qx(i,e,function(x){dt.removeTask(n),t(x)},function(x){n&&dt.removeTask(n),r(x)}),n=dt.addTask({xhr:i,options:e,reject:r}),e.responseType!=="blob"&&e.responseType!=="arraybuffer"||(i.responseType=e.responseType),i.open(e.method,e.url,!0,e.username,e.password);const d=Nx(e.method,e.headers,e.data,e.requestType);Hx(i,e,a,e.headers);const c=e.beforeXhrSend;typeof c=="function"&&c(i),i.send(d||"");const p=e.receiveTaskId;typeof p=="function"&&p(n)}),abort(e){const t=dt.removeTask(e);return t?(t.xhr.abort(),(0,t.reject)(new ft({message:kx,type:J0.ABORTED,result:er({xhr:t.xhr,options:t.options},Ge.XHR)})),!0):!1}},zx=/^(?:([a-z]+):)?\/{2,3}/i;function Ux(e,t){return zx.test(e)}class Lx{constructor(t){V(this,"__requestPlugins",[]);t.forEach(r=>{this.installPlugin(r)})}installPlugin(t){this.__requestPlugins.push(t),t.installPlugin&&t.installPlugin(this)}__getUsePlugin(t,r){return e0(this,null,function*(){return r.usePlugin?!!(yield r.usePlugin(t)):!0})}__forEachRequestPlugin(t,r,n){return e0(this,null,function*(){for(let a=0;a<this.__requestPlugins.length;a++){const i=this.__requestPlugins[a];(yield this.__getUsePlugin(t,i))&&i[r]&&(yield n(i))}})}interceptPluginRequest(t){return e0(this,null,function*(){let r=t;return yield this.__forEachRequestPlugin(t,"interceptIncludeParams",n=>e0(this,null,function*(){const a=yield n.interceptIncludeParams(r);a&&(r.params=i0(i0({},r.params||{}),a))})),yield this.__forEachRequestPlugin(t,"interceptAuthorizeRequest",n=>e0(this,null,function*(){r=(yield n.interceptAuthorizeRequest(r))||r})),yield this.__forEachRequestPlugin(t,"interceptEncryptRequest",n=>e0(this,null,function*(){r=(yield n.interceptEncryptRequest(r))||r})),yield this.__forEachRequestPlugin(t,"interceptRequest",n=>e0(this,null,function*(){r=(yield n.interceptRequest(r))||r})),r})}interceptPluginResponse(t,r){return e0(this,null,function*(){let n=t;return yield this.__forEachRequestPlugin(r,"interceptDecryptResponse",a=>e0(this,null,function*(){n=(yield a.interceptDecryptResponse(n,r))||n})),yield this.__forEachRequestPlugin(r,"interceptResponse",a=>e0(this,null,function*(){n=(yield a.interceptResponse(n,r))||n})),n})}}function $x(e){for(const t in e)if(e[t]instanceof File)return!0;return!1}function Kx(e){const t=new FormData;for(const r in e){const n=e[r];t.append(r,n)}return t}const Wx="json",jx="json";let tr;class zn{constructor(t={}){V(this,"__isDestroyed",!1);V(this,"__baseUrl","");V(this,"__timeout");V(this,"__requestType");V(this,"__responseType");V(this,"__withCredentials");V(this,"__xhrRequest");V(this,"__pluginCtrl");var a;const{baseUrl:r}=t;r&&this.setBaseUrl(r),this.__timeout=t.timeout||1e4,this.__requestType=t.requestType||Wx,this.__responseType=t.responseType||jx,this.__withCredentials=(a=t.withCredentials)!=null?a:!1,tr||(tr=new wx(Mx)),this.__xhrRequest=tr;const n=t.requestPlugins||[];this.__pluginCtrl=new Lx(n)}setBaseUrl(t){this.__baseUrl=t}generateUrl(t){if(t.requestUrl)return t.requestUrl;const r=t.url||"";let n="";return typeof this.__baseUrl=="string"&&(n=this.__baseUrl),!n||Ux(r)?r:n+r}_request(t){return e0(this,null,function*(){if(this.__isDestroyed)return Promise.reject(new Error("Ajax has been destroyed."));let r=i0({},t);const n=this.generateUrl(r);r.requestUrl=n,r.timeout=r.timeout||this.__timeout,r.requestType=r.requestType||this.__requestType,r.responseType=r.responseType||this.__responseType,r.withCredentials=r.withCredentials||this.__withCredentials,r=yield this.__interceptRequest(r);const a=r.requestUrl||n;r=this.__beforeSend(r);let i;try{const d=yield this.__xhrRequest.send(a,i0({},r)),c=this.__parseResponseHeaders(d.xhr.getAllResponseHeaders());i={data:d.data,headers:c}}catch(d){i={data:d.result.data}}if(!i)throw Error("result is undefined");return i=yield this.__interceptResponse(i,r),i.data})}__beforeSend(t){var n;const r=t.data||{};return t.method==="POST"&&t.requestType==="form"&&typeof r=="object"&&((n=t.useFormData)!=null?n:$x(r))&&(t.data=Kx(r)),t}__interceptRequest(t){return e0(this,null,function*(){let r=t;return r=yield this.__pluginCtrl.interceptPluginRequest(r),r})}__interceptResponse(t,r){return e0(this,null,function*(){let n=t;return n=yield this.__pluginCtrl.interceptPluginResponse(n,r),n})}__filterParamsData(t){const r={};for(const n in t){const a=t[n];typeof a!="undefined"&&(r[n]=a)}return r}get(t,r,n){return this._request(Object.assign({url:t,method:"GET",params:this.__filterParamsData(r)},n))}post(t,r,n){return this._request(Object.assign({url:t,method:"POST",data:this.__filterParamsData(r)},n))}delete(t,r,n){return this._request(Object.assign({url:t,method:"DELETE",data:this.__filterParamsData(r)},n))}put(t,r,n){return this._request(Object.assign({url:t,method:"PUT",data:this.__filterParamsData(r)},n))}__parseResponseHeaders(t){const r={};return t&&t.trim().split(`\r
|
|
2
|
+
`).forEach(a=>{const i=a.indexOf(":");if(i>0){const d=a.substring(0,i).trim().toLowerCase(),c=a.substring(i+1).trim();r[d]=c}}),r}destroy(){this.__isDestroyed=!0}}class Xx extends Error{constructor(r){const{code:n,message:a}=r;super(a);V(this,"code");this.code=n}}function Vx(e){return new Xx(e)}var de;(function(e){e.Header="header",e.Params="params"})(de||(de={}));const Gx="token",Zx=de.Params;class Un{constructor(t={}){V(this,"__useToken");V(this,"__config");V(this,"__recordToken");const{useToken:r=!0}=t;this.__config=t,this.__useToken=r}usePlugin(t){const{useToken:r=this.__useToken}=t;return r}interceptAuthorizeRequest(t){return e0(this,null,function*(){const r=yield this.__getTokenInfo(t);if(!r)return t;const n=r.token||this.__recordToken;if(!n)return t;const{tokenField:a=Gx,tokenMode:i=Zx,includeParams:d={}}=r;let c=t.params||{};const p=t.headers||{};return d&&(c=Object.assign({},c,d)),i===de.Params&&(c[a]=n),i===de.Header&&(p[a]=n),Y0(i0({},t),{params:c,headers:p})})}interceptResponse(t,r){return e0(this,null,function*(){if(!t.headers)return;const n=r.responseTokenField||this.__config.responseTokenField;if(!n)return;const i=t.headers[n];i&&(this.__recordToken=i,this.__config.responseTokenCallback&&this.__config.responseTokenCallback({token:i}))})}__getTokenInfo(t){return e0(this,null,function*(){let r=i0({},this.__config);if(typeof this.__config.getTokenInfo=="function"){const n=(yield this.__config.getTokenInfo(t))||{};r=i0(i0({},r),n)}return t.tokenInfo&&(r=i0(i0({},r),t.tokenInfo)),r})}}class rr{constructor(t={}){V(this,"__config");V(this,"__useGlobalParams");this.__config=t;const{useGlobalParams:r=!0}=t;this.__useGlobalParams=r}usePlugin(t){const{useGlobalParams:r=this.__useGlobalParams}=t;return r}interceptIncludeParams(t){return e0(this,null,function*(){let r;return typeof this.__config.globalParams=="function"?r=yield this.__config.globalParams(t):r=this.__config.globalParams,r})}}class Ln{constructor(t={}){V(this,"__fields");V(this,"__successCodes");V(this,"__errorCallback");var r;this.__successCodes=this.__formateSuccessCode((r=t.successCode)!=null?r:200),this.__errorCallback=t.errorCallback,this.__fields=i0({codeField:"code",statusField:"status",messageField:"message",dataField:"data",errorField:"error",errorCodeField:"code",errorDescField:"desc"},t.fields)}usePlugin(t){const{useStatusCode:r=!0}=t;return r}interceptResponse(t,r){var o,h;if(!t.data)throw new Error(`status-code-plugin error: result.data is undefined, url: ${r.requestUrl}`);const n=this.__formatRes(t.data),a=n.code,i=n.status;if(this.__getSuccessCodes(r).includes(a)||i==="success")return Promise.resolve(Y0(i0({},t),{data:n.data}));const c=((o=n.error)==null?void 0:o.code)||a,p=((h=n.error)==null?void 0:h.desc)||n.message||"未知错误",x=Vx({code:c,message:p});return this.__errorCallback&&this.__errorCallback(c,p),Promise.reject(x)}__formatRes(t){const r=t[this.__fields.codeField],n=t[this.__fields.statusField],a=t[this.__fields.messageField],i=t[this.__fields.dataField],d={code:r,data:i,status:n,message:a},c=t[this.__fields.errorField];if(c){const p=c[this.__fields.errorCodeField],x=c[this.__fields.errorDescField];d.error={code:p,desc:x}}return d}__formateSuccessCode(t){return typeof t=="number"?[t]:Array.isArray(t)?t:[]}__getSuccessCodes(t){const r=this.__formateSuccessCode(t.successCode);return[...this.__successCodes,...r]}}var De;(function(e){e.WholeResponse="wholeResponse",e.ResponseData="responseData"})(De||(De={}));var we;(function(e){e.Hex="hex",e.Base64="base64"})(we||(we={}));var G=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function Ze(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Yx(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var a=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,a.get?a:{enumerable:!0,get:function(){return e[n]}})}),r}var $n={exports:{}};/*! MIT License. Copyright 2015-2018 Richard Moore <me@ricmoo.com>. See LICENSE.txt. */(function(e,t){(function(r){function n(E){return parseInt(E)===E}function a(E){if(!n(E.length))return!1;for(var w=0;w<E.length;w++)if(!n(E[w])||E[w]<0||E[w]>255)return!1;return!0}function i(E,w){if(E.buffer&&E.name==="Uint8Array")return w&&(E.slice?E=E.slice():E=Array.prototype.slice.call(E)),E;if(Array.isArray(E)){if(!a(E))throw new Error("Array contains invalid value: "+E);return new Uint8Array(E)}if(n(E.length)&&a(E))return new Uint8Array(E);throw new Error("unsupported array-like object")}function d(E){return new Uint8Array(E)}function c(E,w,I,k,O){(k!=null||O!=null)&&(E.slice?E=E.slice(k,O):E=Array.prototype.slice.call(E,k,O)),w.set(E,I)}var p=function(){function E(I){var k=[],O=0;for(I=encodeURI(I);O<I.length;){var W=I.charCodeAt(O++);W===37?(k.push(parseInt(I.substr(O,2),16)),O+=2):k.push(W)}return i(k)}function w(I){for(var k=[],O=0;O<I.length;){var W=I[O];W<128?(k.push(String.fromCharCode(W)),O++):W>191&&W<224?(k.push(String.fromCharCode((W&31)<<6|I[O+1]&63)),O+=2):(k.push(String.fromCharCode((W&15)<<12|(I[O+1]&63)<<6|I[O+2]&63)),O+=3)}return k.join("")}return{toBytes:E,fromBytes:w}}(),x=function(){function E(k){for(var O=[],W=0;W<k.length;W+=2)O.push(parseInt(k.substr(W,2),16));return O}var w="0123456789abcdef";function I(k){for(var O=[],W=0;W<k.length;W++){var t0=k[W];O.push(w[(t0&240)>>4]+w[t0&15])}return O.join("")}return{toBytes:E,fromBytes:I}}(),o={16:10,24:12,32:14},h=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],s=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],f=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],v=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],m=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],C=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],_=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],y=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],B=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],b=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],F=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],D=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],T=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],P=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],H=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function S(E){for(var w=[],I=0;I<E.length;I+=4)w.push(E[I]<<24|E[I+1]<<16|E[I+2]<<8|E[I+3]);return w}var A=function(E){if(!(this instanceof A))throw Error("AES must be instanitated with `new`");Object.defineProperty(this,"key",{value:i(E,!0)}),this._prepare()};A.prototype._prepare=function(){var E=o[this.key.length];if(E==null)throw new Error("invalid key size (must be 16, 24 or 32 bytes)");this._Ke=[],this._Kd=[];for(var w=0;w<=E;w++)this._Ke.push([0,0,0,0]),this._Kd.push([0,0,0,0]);for(var I=(E+1)*4,k=this.key.length/4,O=S(this.key),W,w=0;w<k;w++)W=w>>2,this._Ke[W][w%4]=O[w],this._Kd[E-W][w%4]=O[w];for(var t0=0,j=k,o0;j<I;){if(o0=O[k-1],O[0]^=s[o0>>16&255]<<24^s[o0>>8&255]<<16^s[o0&255]<<8^s[o0>>24&255]^h[t0]<<24,t0+=1,k!=8)for(var w=1;w<k;w++)O[w]^=O[w-1];else{for(var w=1;w<k/2;w++)O[w]^=O[w-1];o0=O[k/2-1],O[k/2]^=s[o0&255]^s[o0>>8&255]<<8^s[o0>>16&255]<<16^s[o0>>24&255]<<24;for(var w=k/2+1;w<k;w++)O[w]^=O[w-1]}for(var w=0,g0,F0;w<k&&j<I;)g0=j>>2,F0=j%4,this._Ke[g0][F0]=O[w],this._Kd[E-g0][F0]=O[w++],j++}for(var g0=1;g0<E;g0++)for(var F0=0;F0<4;F0++)o0=this._Kd[g0][F0],this._Kd[g0][F0]=D[o0>>24&255]^T[o0>>16&255]^P[o0>>8&255]^H[o0&255]},A.prototype.encrypt=function(E){if(E.length!=16)throw new Error("invalid plaintext size (must be 16 bytes)");for(var w=this._Ke.length-1,I=[0,0,0,0],k=S(E),O=0;O<4;O++)k[O]^=this._Ke[0][O];for(var W=1;W<w;W++){for(var O=0;O<4;O++)I[O]=v[k[O]>>24&255]^m[k[(O+1)%4]>>16&255]^C[k[(O+2)%4]>>8&255]^_[k[(O+3)%4]&255]^this._Ke[W][O];k=I.slice()}for(var t0=d(16),j,O=0;O<4;O++)j=this._Ke[w][O],t0[4*O]=(s[k[O]>>24&255]^j>>24)&255,t0[4*O+1]=(s[k[(O+1)%4]>>16&255]^j>>16)&255,t0[4*O+2]=(s[k[(O+2)%4]>>8&255]^j>>8)&255,t0[4*O+3]=(s[k[(O+3)%4]&255]^j)&255;return t0},A.prototype.decrypt=function(E){if(E.length!=16)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var w=this._Kd.length-1,I=[0,0,0,0],k=S(E),O=0;O<4;O++)k[O]^=this._Kd[0][O];for(var W=1;W<w;W++){for(var O=0;O<4;O++)I[O]=y[k[O]>>24&255]^B[k[(O+3)%4]>>16&255]^b[k[(O+2)%4]>>8&255]^F[k[(O+1)%4]&255]^this._Kd[W][O];k=I.slice()}for(var t0=d(16),j,O=0;O<4;O++)j=this._Kd[w][O],t0[4*O]=(f[k[O]>>24&255]^j>>24)&255,t0[4*O+1]=(f[k[(O+3)%4]>>16&255]^j>>16)&255,t0[4*O+2]=(f[k[(O+2)%4]>>8&255]^j>>8)&255,t0[4*O+3]=(f[k[(O+1)%4]&255]^j)&255;return t0};var q=function(E){if(!(this instanceof q))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new A(E)};q.prototype.encrypt=function(E){if(E=i(E),E.length%16!==0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var w=d(E.length),I=d(16),k=0;k<E.length;k+=16)c(E,I,0,k,k+16),I=this._aes.encrypt(I),c(I,w,k);return w},q.prototype.decrypt=function(E){if(E=i(E),E.length%16!==0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var w=d(E.length),I=d(16),k=0;k<E.length;k+=16)c(E,I,0,k,k+16),I=this._aes.decrypt(I),c(I,w,k);return w};var N=function(E,w){if(!(this instanceof N))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Block Chaining",this.name="cbc",!w)w=d(16);else if(w.length!=16)throw new Error("invalid initialation vector size (must be 16 bytes)");this._lastCipherblock=i(w,!0),this._aes=new A(E)};N.prototype.encrypt=function(E){if(E=i(E),E.length%16!==0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var w=d(E.length),I=d(16),k=0;k<E.length;k+=16){c(E,I,0,k,k+16);for(var O=0;O<16;O++)I[O]^=this._lastCipherblock[O];this._lastCipherblock=this._aes.encrypt(I),c(this._lastCipherblock,w,k)}return w},N.prototype.decrypt=function(E){if(E=i(E),E.length%16!==0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var w=d(E.length),I=d(16),k=0;k<E.length;k+=16){c(E,I,0,k,k+16),I=this._aes.decrypt(I);for(var O=0;O<16;O++)w[k+O]=I[O]^this._lastCipherblock[O];c(E,this._lastCipherblock,0,k,k+16)}return w};var U=function(E,w,I){if(!(this instanceof U))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Feedback",this.name="cfb",!w)w=d(16);else if(w.length!=16)throw new Error("invalid initialation vector size (must be 16 size)");I||(I=1),this.segmentSize=I,this._shiftRegister=i(w,!0),this._aes=new A(E)};U.prototype.encrypt=function(E){if(E.length%this.segmentSize!=0)throw new Error("invalid plaintext size (must be segmentSize bytes)");for(var w=i(E,!0),I,k=0;k<w.length;k+=this.segmentSize){I=this._aes.encrypt(this._shiftRegister);for(var O=0;O<this.segmentSize;O++)w[k+O]^=I[O];c(this._shiftRegister,this._shiftRegister,0,this.segmentSize),c(w,this._shiftRegister,16-this.segmentSize,k,k+this.segmentSize)}return w},U.prototype.decrypt=function(E){if(E.length%this.segmentSize!=0)throw new Error("invalid ciphertext size (must be segmentSize bytes)");for(var w=i(E,!0),I,k=0;k<w.length;k+=this.segmentSize){I=this._aes.encrypt(this._shiftRegister);for(var O=0;O<this.segmentSize;O++)w[k+O]^=I[O];c(this._shiftRegister,this._shiftRegister,0,this.segmentSize),c(E,this._shiftRegister,16-this.segmentSize,k,k+this.segmentSize)}return w};var L=function(E,w){if(!(this instanceof L))throw Error("AES must be instanitated with `new`");if(this.description="Output Feedback",this.name="ofb",!w)w=d(16);else if(w.length!=16)throw new Error("invalid initialation vector size (must be 16 bytes)");this._lastPrecipher=i(w,!0),this._lastPrecipherIndex=16,this._aes=new A(E)};L.prototype.encrypt=function(E){for(var w=i(E,!0),I=0;I<w.length;I++)this._lastPrecipherIndex===16&&(this._lastPrecipher=this._aes.encrypt(this._lastPrecipher),this._lastPrecipherIndex=0),w[I]^=this._lastPrecipher[this._lastPrecipherIndex++];return w},L.prototype.decrypt=L.prototype.encrypt;var X=function(E){if(!(this instanceof X))throw Error("Counter must be instanitated with `new`");E!==0&&!E&&(E=1),typeof E=="number"?(this._counter=d(16),this.setValue(E)):this.setBytes(E)};X.prototype.setValue=function(E){if(typeof E!="number"||parseInt(E)!=E)throw new Error("invalid counter value (must be an integer)");if(E>Number.MAX_SAFE_INTEGER)throw new Error("integer value out of safe range");for(var w=15;w>=0;--w)this._counter[w]=E%256,E=parseInt(E/256)},X.prototype.setBytes=function(E){if(E=i(E,!0),E.length!=16)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=E},X.prototype.increment=function(){for(var E=15;E>=0;E--)if(this._counter[E]===255)this._counter[E]=0;else{this._counter[E]++;break}};var Y=function(E,w){if(!(this instanceof Y))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",w instanceof X||(w=new X(w)),this._counter=w,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new A(E)};Y.prototype.encrypt=function(E){for(var w=i(E,!0),I=0;I<w.length;I++)this._remainingCounterIndex===16&&(this._remainingCounter=this._aes.encrypt(this._counter._counter),this._remainingCounterIndex=0,this._counter.increment()),w[I]^=this._remainingCounter[this._remainingCounterIndex++];return w},Y.prototype.decrypt=Y.prototype.encrypt;function r0(E){E=i(E,!0);var w=16-E.length%16,I=d(E.length+w);c(E,I);for(var k=E.length;k<I.length;k++)I[k]=w;return I}function x0(E){if(E=i(E,!0),E.length<16)throw new Error("PKCS#7 invalid length");var w=E[E.length-1];if(w>16)throw new Error("PKCS#7 padding byte out of range");for(var I=E.length-w,k=0;k<w;k++)if(E[I+k]!==w)throw new Error("PKCS#7 invalid padding byte");var O=d(I);return c(E,O,0,0,I),O}var a0={AES:A,Counter:X,ModeOfOperation:{ecb:q,cbc:N,cfb:U,ofb:L,ctr:Y},utils:{hex:x,utf8:p},padding:{pkcs7:{pad:r0,strip:x0}},_arrayTest:{coerceArray:i,createArray:d,copyArray:c}};e.exports=a0})()})($n);var Qx=$n.exports;const ut=Ze(Qx);var Kn={exports:{}};function Jx(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var nr={exports:{}};const Wn=Yx(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var jn;function Q(){return jn||(jn=1,function(e,t){(function(r,n){e.exports=n()})(G,function(){var r=r||function(n,a){var i;if(typeof window!="undefined"&&window.crypto&&(i=window.crypto),typeof self!="undefined"&&self.crypto&&(i=self.crypto),typeof globalThis!="undefined"&&globalThis.crypto&&(i=globalThis.crypto),!i&&typeof window!="undefined"&&window.msCrypto&&(i=window.msCrypto),!i&&typeof G!="undefined"&&G.crypto&&(i=G.crypto),!i&&typeof Jx=="function")try{i=Wn}catch(y){}var d=function(){if(i){if(typeof i.getRandomValues=="function")try{return i.getRandomValues(new Uint32Array(1))[0]}catch(y){}if(typeof i.randomBytes=="function")try{return i.randomBytes(4).readInt32LE()}catch(y){}}throw new Error("Native crypto module could not be used to get secure random number.")},c=Object.create||function(){function y(){}return function(B){var b;return y.prototype=B,b=new y,y.prototype=null,b}}(),p={},x=p.lib={},o=x.Base=function(){return{extend:function(y){var B=c(this);return y&&B.mixIn(y),(!B.hasOwnProperty("init")||this.init===B.init)&&(B.init=function(){B.$super.init.apply(this,arguments)}),B.init.prototype=B,B.$super=this,B},create:function(){var y=this.extend();return y.init.apply(y,arguments),y},init:function(){},mixIn:function(y){for(var B in y)y.hasOwnProperty(B)&&(this[B]=y[B]);y.hasOwnProperty("toString")&&(this.toString=y.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),h=x.WordArray=o.extend({init:function(y,B){y=this.words=y||[],B!=a?this.sigBytes=B:this.sigBytes=y.length*4},toString:function(y){return(y||f).stringify(this)},concat:function(y){var B=this.words,b=y.words,F=this.sigBytes,D=y.sigBytes;if(this.clamp(),F%4)for(var T=0;T<D;T++){var P=b[T>>>2]>>>24-T%4*8&255;B[F+T>>>2]|=P<<24-(F+T)%4*8}else for(var H=0;H<D;H+=4)B[F+H>>>2]=b[H>>>2];return this.sigBytes+=D,this},clamp:function(){var y=this.words,B=this.sigBytes;y[B>>>2]&=4294967295<<32-B%4*8,y.length=n.ceil(B/4)},clone:function(){var y=o.clone.call(this);return y.words=this.words.slice(0),y},random:function(y){for(var B=[],b=0;b<y;b+=4)B.push(d());return new h.init(B,y)}}),s=p.enc={},f=s.Hex={stringify:function(y){for(var B=y.words,b=y.sigBytes,F=[],D=0;D<b;D++){var T=B[D>>>2]>>>24-D%4*8&255;F.push((T>>>4).toString(16)),F.push((T&15).toString(16))}return F.join("")},parse:function(y){for(var B=y.length,b=[],F=0;F<B;F+=2)b[F>>>3]|=parseInt(y.substr(F,2),16)<<24-F%8*4;return new h.init(b,B/2)}},v=s.Latin1={stringify:function(y){for(var B=y.words,b=y.sigBytes,F=[],D=0;D<b;D++){var T=B[D>>>2]>>>24-D%4*8&255;F.push(String.fromCharCode(T))}return F.join("")},parse:function(y){for(var B=y.length,b=[],F=0;F<B;F++)b[F>>>2]|=(y.charCodeAt(F)&255)<<24-F%4*8;return new h.init(b,B)}},m=s.Utf8={stringify:function(y){try{return decodeURIComponent(escape(v.stringify(y)))}catch(B){throw new Error("Malformed UTF-8 data")}},parse:function(y){return v.parse(unescape(encodeURIComponent(y)))}},C=x.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new h.init,this._nDataBytes=0},_append:function(y){typeof y=="string"&&(y=m.parse(y)),this._data.concat(y),this._nDataBytes+=y.sigBytes},_process:function(y){var B,b=this._data,F=b.words,D=b.sigBytes,T=this.blockSize,P=T*4,H=D/P;y?H=n.ceil(H):H=n.max((H|0)-this._minBufferSize,0);var S=H*T,A=n.min(S*4,D);if(S){for(var q=0;q<S;q+=T)this._doProcessBlock(F,q);B=F.splice(0,S),b.sigBytes-=A}return new h.init(B,A)},clone:function(){var y=o.clone.call(this);return y._data=this._data.clone(),y},_minBufferSize:0});x.Hasher=C.extend({cfg:o.extend(),init:function(y){this.cfg=this.cfg.extend(y),this.reset()},reset:function(){C.reset.call(this),this._doReset()},update:function(y){return this._append(y),this._process(),this},finalize:function(y){y&&this._append(y);var B=this._doFinalize();return B},blockSize:16,_createHelper:function(y){return function(B,b){return new y.init(b).finalize(B)}},_createHmacHelper:function(y){return function(B,b){return new _.HMAC.init(y,b).finalize(B)}}});var _=p.algo={};return p}(Math);return r})}(nr)),nr.exports}var ar={exports:{}},Xn;function ht(){return Xn||(Xn=1,function(e,t){(function(r,n){e.exports=n(Q())})(G,function(r){return function(n){var a=r,i=a.lib,d=i.Base,c=i.WordArray,p=a.x64={};p.Word=d.extend({init:function(x,o){this.high=x,this.low=o}}),p.WordArray=d.extend({init:function(x,o){x=this.words=x||[],o!=n?this.sigBytes=o:this.sigBytes=x.length*8},toX32:function(){for(var x=this.words,o=x.length,h=[],s=0;s<o;s++){var f=x[s];h.push(f.high),h.push(f.low)}return c.create(h,this.sigBytes)},clone:function(){for(var x=d.clone.call(this),o=x.words=this.words.slice(0),h=o.length,s=0;s<h;s++)o[s]=o[s].clone();return x}})}(),r})}(ar)),ar.exports}var ir={exports:{}},Vn;function eo(){return Vn||(Vn=1,function(e,t){(function(r,n){e.exports=n(Q())})(G,function(r){return function(){if(typeof ArrayBuffer=="function"){var n=r,a=n.lib,i=a.WordArray,d=i.init,c=i.init=function(p){if(p instanceof ArrayBuffer&&(p=new Uint8Array(p)),(p instanceof Int8Array||typeof Uint8ClampedArray!="undefined"&&p instanceof Uint8ClampedArray||p instanceof Int16Array||p instanceof Uint16Array||p instanceof Int32Array||p instanceof Uint32Array||p instanceof Float32Array||p instanceof Float64Array)&&(p=new Uint8Array(p.buffer,p.byteOffset,p.byteLength)),p instanceof Uint8Array){for(var x=p.byteLength,o=[],h=0;h<x;h++)o[h>>>2]|=p[h]<<24-h%4*8;d.call(this,o,x)}else d.apply(this,arguments)};c.prototype=i}}(),r.lib.WordArray})}(ir)),ir.exports}var xr={exports:{}},Gn;function to(){return Gn||(Gn=1,function(e,t){(function(r,n){e.exports=n(Q())})(G,function(r){return function(){var n=r,a=n.lib,i=a.WordArray,d=n.enc;d.Utf16=d.Utf16BE={stringify:function(p){for(var x=p.words,o=p.sigBytes,h=[],s=0;s<o;s+=2){var f=x[s>>>2]>>>16-s%4*8&65535;h.push(String.fromCharCode(f))}return h.join("")},parse:function(p){for(var x=p.length,o=[],h=0;h<x;h++)o[h>>>1]|=p.charCodeAt(h)<<16-h%2*16;return i.create(o,x*2)}},d.Utf16LE={stringify:function(p){for(var x=p.words,o=p.sigBytes,h=[],s=0;s<o;s+=2){var f=c(x[s>>>2]>>>16-s%4*8&65535);h.push(String.fromCharCode(f))}return h.join("")},parse:function(p){for(var x=p.length,o=[],h=0;h<x;h++)o[h>>>1]|=c(p.charCodeAt(h)<<16-h%2*16);return i.create(o,x*2)}};function c(p){return p<<8&4278255360|p>>>8&16711935}}(),r.enc.Utf16})}(xr)),xr.exports}var or={exports:{}},Zn;function ue(){return Zn||(Zn=1,function(e,t){(function(r,n){e.exports=n(Q())})(G,function(r){return function(){var n=r,a=n.lib,i=a.WordArray,d=n.enc;d.Base64={stringify:function(p){var x=p.words,o=p.sigBytes,h=this._map;p.clamp();for(var s=[],f=0;f<o;f+=3)for(var v=x[f>>>2]>>>24-f%4*8&255,m=x[f+1>>>2]>>>24-(f+1)%4*8&255,C=x[f+2>>>2]>>>24-(f+2)%4*8&255,_=v<<16|m<<8|C,y=0;y<4&&f+y*.75<o;y++)s.push(h.charAt(_>>>6*(3-y)&63));var B=h.charAt(64);if(B)for(;s.length%4;)s.push(B);return s.join("")},parse:function(p){var x=p.length,o=this._map,h=this._reverseMap;if(!h){h=this._reverseMap=[];for(var s=0;s<o.length;s++)h[o.charCodeAt(s)]=s}var f=o.charAt(64);if(f){var v=p.indexOf(f);v!==-1&&(x=v)}return c(p,x,h)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function c(p,x,o){for(var h=[],s=0,f=0;f<x;f++)if(f%4){var v=o[p.charCodeAt(f-1)]<<f%4*2,m=o[p.charCodeAt(f)]>>>6-f%4*2,C=v|m;h[s>>>2]|=C<<24-s%4*8,s++}return i.create(h,s)}}(),r.enc.Base64})}(or)),or.exports}var sr={exports:{}},Yn;function ro(){return Yn||(Yn=1,function(e,t){(function(r,n){e.exports=n(Q())})(G,function(r){return function(){var n=r,a=n.lib,i=a.WordArray,d=n.enc;d.Base64url={stringify:function(p,x){x===void 0&&(x=!0);var o=p.words,h=p.sigBytes,s=x?this._safe_map:this._map;p.clamp();for(var f=[],v=0;v<h;v+=3)for(var m=o[v>>>2]>>>24-v%4*8&255,C=o[v+1>>>2]>>>24-(v+1)%4*8&255,_=o[v+2>>>2]>>>24-(v+2)%4*8&255,y=m<<16|C<<8|_,B=0;B<4&&v+B*.75<h;B++)f.push(s.charAt(y>>>6*(3-B)&63));var b=s.charAt(64);if(b)for(;f.length%4;)f.push(b);return f.join("")},parse:function(p,x){x===void 0&&(x=!0);var o=p.length,h=x?this._safe_map:this._map,s=this._reverseMap;if(!s){s=this._reverseMap=[];for(var f=0;f<h.length;f++)s[h.charCodeAt(f)]=f}var v=h.charAt(64);if(v){var m=p.indexOf(v);m!==-1&&(o=m)}return c(p,o,s)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"};function c(p,x,o){for(var h=[],s=0,f=0;f<x;f++)if(f%4){var v=o[p.charCodeAt(f-1)]<<f%4*2,m=o[p.charCodeAt(f)]>>>6-f%4*2,C=v|m;h[s>>>2]|=C<<24-s%4*8,s++}return i.create(h,s)}}(),r.enc.Base64url})}(sr)),sr.exports}var cr={exports:{}},Qn;function he(){return Qn||(Qn=1,function(e,t){(function(r,n){e.exports=n(Q())})(G,function(r){return function(n){var a=r,i=a.lib,d=i.WordArray,c=i.Hasher,p=a.algo,x=[];(function(){for(var m=0;m<64;m++)x[m]=n.abs(n.sin(m+1))*4294967296|0})();var o=p.MD5=c.extend({_doReset:function(){this._hash=new d.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(m,C){for(var _=0;_<16;_++){var y=C+_,B=m[y];m[y]=(B<<8|B>>>24)&16711935|(B<<24|B>>>8)&4278255360}var b=this._hash.words,F=m[C+0],D=m[C+1],T=m[C+2],P=m[C+3],H=m[C+4],S=m[C+5],A=m[C+6],q=m[C+7],N=m[C+8],U=m[C+9],L=m[C+10],X=m[C+11],Y=m[C+12],r0=m[C+13],x0=m[C+14],a0=m[C+15],E=b[0],w=b[1],I=b[2],k=b[3];E=h(E,w,I,k,F,7,x[0]),k=h(k,E,w,I,D,12,x[1]),I=h(I,k,E,w,T,17,x[2]),w=h(w,I,k,E,P,22,x[3]),E=h(E,w,I,k,H,7,x[4]),k=h(k,E,w,I,S,12,x[5]),I=h(I,k,E,w,A,17,x[6]),w=h(w,I,k,E,q,22,x[7]),E=h(E,w,I,k,N,7,x[8]),k=h(k,E,w,I,U,12,x[9]),I=h(I,k,E,w,L,17,x[10]),w=h(w,I,k,E,X,22,x[11]),E=h(E,w,I,k,Y,7,x[12]),k=h(k,E,w,I,r0,12,x[13]),I=h(I,k,E,w,x0,17,x[14]),w=h(w,I,k,E,a0,22,x[15]),E=s(E,w,I,k,D,5,x[16]),k=s(k,E,w,I,A,9,x[17]),I=s(I,k,E,w,X,14,x[18]),w=s(w,I,k,E,F,20,x[19]),E=s(E,w,I,k,S,5,x[20]),k=s(k,E,w,I,L,9,x[21]),I=s(I,k,E,w,a0,14,x[22]),w=s(w,I,k,E,H,20,x[23]),E=s(E,w,I,k,U,5,x[24]),k=s(k,E,w,I,x0,9,x[25]),I=s(I,k,E,w,P,14,x[26]),w=s(w,I,k,E,N,20,x[27]),E=s(E,w,I,k,r0,5,x[28]),k=s(k,E,w,I,T,9,x[29]),I=s(I,k,E,w,q,14,x[30]),w=s(w,I,k,E,Y,20,x[31]),E=f(E,w,I,k,S,4,x[32]),k=f(k,E,w,I,N,11,x[33]),I=f(I,k,E,w,X,16,x[34]),w=f(w,I,k,E,x0,23,x[35]),E=f(E,w,I,k,D,4,x[36]),k=f(k,E,w,I,H,11,x[37]),I=f(I,k,E,w,q,16,x[38]),w=f(w,I,k,E,L,23,x[39]),E=f(E,w,I,k,r0,4,x[40]),k=f(k,E,w,I,F,11,x[41]),I=f(I,k,E,w,P,16,x[42]),w=f(w,I,k,E,A,23,x[43]),E=f(E,w,I,k,U,4,x[44]),k=f(k,E,w,I,Y,11,x[45]),I=f(I,k,E,w,a0,16,x[46]),w=f(w,I,k,E,T,23,x[47]),E=v(E,w,I,k,F,6,x[48]),k=v(k,E,w,I,q,10,x[49]),I=v(I,k,E,w,x0,15,x[50]),w=v(w,I,k,E,S,21,x[51]),E=v(E,w,I,k,Y,6,x[52]),k=v(k,E,w,I,P,10,x[53]),I=v(I,k,E,w,L,15,x[54]),w=v(w,I,k,E,D,21,x[55]),E=v(E,w,I,k,N,6,x[56]),k=v(k,E,w,I,a0,10,x[57]),I=v(I,k,E,w,A,15,x[58]),w=v(w,I,k,E,r0,21,x[59]),E=v(E,w,I,k,H,6,x[60]),k=v(k,E,w,I,X,10,x[61]),I=v(I,k,E,w,T,15,x[62]),w=v(w,I,k,E,U,21,x[63]),b[0]=b[0]+E|0,b[1]=b[1]+w|0,b[2]=b[2]+I|0,b[3]=b[3]+k|0},_doFinalize:function(){var m=this._data,C=m.words,_=this._nDataBytes*8,y=m.sigBytes*8;C[y>>>5]|=128<<24-y%32;var B=n.floor(_/4294967296),b=_;C[(y+64>>>9<<4)+15]=(B<<8|B>>>24)&16711935|(B<<24|B>>>8)&4278255360,C[(y+64>>>9<<4)+14]=(b<<8|b>>>24)&16711935|(b<<24|b>>>8)&4278255360,m.sigBytes=(C.length+1)*4,this._process();for(var F=this._hash,D=F.words,T=0;T<4;T++){var P=D[T];D[T]=(P<<8|P>>>24)&16711935|(P<<24|P>>>8)&4278255360}return F},clone:function(){var m=c.clone.call(this);return m._hash=this._hash.clone(),m}});function h(m,C,_,y,B,b,F){var D=m+(C&_|~C&y)+B+F;return(D<<b|D>>>32-b)+C}function s(m,C,_,y,B,b,F){var D=m+(C&y|_&~y)+B+F;return(D<<b|D>>>32-b)+C}function f(m,C,_,y,B,b,F){var D=m+(C^_^y)+B+F;return(D<<b|D>>>32-b)+C}function v(m,C,_,y,B,b,F){var D=m+(_^(C|~y))+B+F;return(D<<b|D>>>32-b)+C}a.MD5=c._createHelper(o),a.HmacMD5=c._createHmacHelper(o)}(Math),r.MD5})}(cr)),cr.exports}var fr={exports:{}},Jn;function ea(){return Jn||(Jn=1,function(e,t){(function(r,n){e.exports=n(Q())})(G,function(r){return function(){var n=r,a=n.lib,i=a.WordArray,d=a.Hasher,c=n.algo,p=[],x=c.SHA1=d.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(o,h){for(var s=this._hash.words,f=s[0],v=s[1],m=s[2],C=s[3],_=s[4],y=0;y<80;y++){if(y<16)p[y]=o[h+y]|0;else{var B=p[y-3]^p[y-8]^p[y-14]^p[y-16];p[y]=B<<1|B>>>31}var b=(f<<5|f>>>27)+_+p[y];y<20?b+=(v&m|~v&C)+1518500249:y<40?b+=(v^m^C)+1859775393:y<60?b+=(v&m|v&C|m&C)-1894007588:b+=(v^m^C)-899497514,_=C,C=m,m=v<<30|v>>>2,v=f,f=b}s[0]=s[0]+f|0,s[1]=s[1]+v|0,s[2]=s[2]+m|0,s[3]=s[3]+C|0,s[4]=s[4]+_|0},_doFinalize:function(){var o=this._data,h=o.words,s=this._nDataBytes*8,f=o.sigBytes*8;return h[f>>>5]|=128<<24-f%32,h[(f+64>>>9<<4)+14]=Math.floor(s/4294967296),h[(f+64>>>9<<4)+15]=s,o.sigBytes=h.length*4,this._process(),this._hash},clone:function(){var o=d.clone.call(this);return o._hash=this._hash.clone(),o}});n.SHA1=d._createHelper(x),n.HmacSHA1=d._createHmacHelper(x)}(),r.SHA1})}(fr)),fr.exports}var dr={exports:{}},ta;function ur(){return ta||(ta=1,function(e,t){(function(r,n){e.exports=n(Q())})(G,function(r){return function(n){var a=r,i=a.lib,d=i.WordArray,c=i.Hasher,p=a.algo,x=[],o=[];(function(){function f(_){for(var y=n.sqrt(_),B=2;B<=y;B++)if(!(_%B))return!1;return!0}function v(_){return(_-(_|0))*4294967296|0}for(var m=2,C=0;C<64;)f(m)&&(C<8&&(x[C]=v(n.pow(m,1/2))),o[C]=v(n.pow(m,1/3)),C++),m++})();var h=[],s=p.SHA256=c.extend({_doReset:function(){this._hash=new d.init(x.slice(0))},_doProcessBlock:function(f,v){for(var m=this._hash.words,C=m[0],_=m[1],y=m[2],B=m[3],b=m[4],F=m[5],D=m[6],T=m[7],P=0;P<64;P++){if(P<16)h[P]=f[v+P]|0;else{var H=h[P-15],S=(H<<25|H>>>7)^(H<<14|H>>>18)^H>>>3,A=h[P-2],q=(A<<15|A>>>17)^(A<<13|A>>>19)^A>>>10;h[P]=S+h[P-7]+q+h[P-16]}var N=b&F^~b&D,U=C&_^C&y^_&y,L=(C<<30|C>>>2)^(C<<19|C>>>13)^(C<<10|C>>>22),X=(b<<26|b>>>6)^(b<<21|b>>>11)^(b<<7|b>>>25),Y=T+X+N+o[P]+h[P],r0=L+U;T=D,D=F,F=b,b=B+Y|0,B=y,y=_,_=C,C=Y+r0|0}m[0]=m[0]+C|0,m[1]=m[1]+_|0,m[2]=m[2]+y|0,m[3]=m[3]+B|0,m[4]=m[4]+b|0,m[5]=m[5]+F|0,m[6]=m[6]+D|0,m[7]=m[7]+T|0},_doFinalize:function(){var f=this._data,v=f.words,m=this._nDataBytes*8,C=f.sigBytes*8;return v[C>>>5]|=128<<24-C%32,v[(C+64>>>9<<4)+14]=n.floor(m/4294967296),v[(C+64>>>9<<4)+15]=m,f.sigBytes=v.length*4,this._process(),this._hash},clone:function(){var f=c.clone.call(this);return f._hash=this._hash.clone(),f}});a.SHA256=c._createHelper(s),a.HmacSHA256=c._createHmacHelper(s)}(Math),r.SHA256})}(dr)),dr.exports}var hr={exports:{}},ra;function no(){return ra||(ra=1,function(e,t){(function(r,n,a){e.exports=n(Q(),ur())})(G,function(r){return function(){var n=r,a=n.lib,i=a.WordArray,d=n.algo,c=d.SHA256,p=d.SHA224=c.extend({_doReset:function(){this._hash=new i.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var x=c._doFinalize.call(this);return x.sigBytes-=4,x}});n.SHA224=c._createHelper(p),n.HmacSHA224=c._createHmacHelper(p)}(),r.SHA224})}(hr)),hr.exports}var lr={exports:{}},na;function aa(){return na||(na=1,function(e,t){(function(r,n,a){e.exports=n(Q(),ht())})(G,function(r){return function(){var n=r,a=n.lib,i=a.Hasher,d=n.x64,c=d.Word,p=d.WordArray,x=n.algo;function o(){return c.create.apply(c,arguments)}var h=[o(1116352408,3609767458),o(1899447441,602891725),o(3049323471,3964484399),o(3921009573,2173295548),o(961987163,4081628472),o(1508970993,3053834265),o(2453635748,2937671579),o(2870763221,3664609560),o(3624381080,2734883394),o(310598401,1164996542),o(607225278,1323610764),o(1426881987,3590304994),o(1925078388,4068182383),o(2162078206,991336113),o(2614888103,633803317),o(3248222580,3479774868),o(3835390401,2666613458),o(4022224774,944711139),o(264347078,2341262773),o(604807628,2007800933),o(770255983,1495990901),o(1249150122,1856431235),o(1555081692,3175218132),o(1996064986,2198950837),o(2554220882,3999719339),o(2821834349,766784016),o(2952996808,2566594879),o(3210313671,3203337956),o(3336571891,1034457026),o(3584528711,2466948901),o(113926993,3758326383),o(338241895,168717936),o(666307205,1188179964),o(773529912,1546045734),o(1294757372,1522805485),o(1396182291,2643833823),o(1695183700,2343527390),o(1986661051,1014477480),o(2177026350,1206759142),o(2456956037,344077627),o(2730485921,1290863460),o(2820302411,3158454273),o(3259730800,3505952657),o(3345764771,106217008),o(3516065817,3606008344),o(3600352804,1432725776),o(4094571909,1467031594),o(275423344,851169720),o(430227734,3100823752),o(506948616,1363258195),o(659060556,3750685593),o(883997877,3785050280),o(958139571,3318307427),o(1322822218,3812723403),o(1537002063,2003034995),o(1747873779,3602036899),o(1955562222,1575990012),o(2024104815,1125592928),o(2227730452,2716904306),o(2361852424,442776044),o(2428436474,593698344),o(2756734187,3733110249),o(3204031479,2999351573),o(3329325298,3815920427),o(3391569614,3928383900),o(3515267271,566280711),o(3940187606,3454069534),o(4118630271,4000239992),o(116418474,1914138554),o(174292421,2731055270),o(289380356,3203993006),o(460393269,320620315),o(685471733,587496836),o(852142971,1086792851),o(1017036298,365543100),o(1126000580,2618297676),o(1288033470,3409855158),o(1501505948,4234509866),o(1607167915,987167468),o(1816402316,1246189591)],s=[];(function(){for(var v=0;v<80;v++)s[v]=o()})();var f=x.SHA512=i.extend({_doReset:function(){this._hash=new p.init([new c.init(1779033703,4089235720),new c.init(3144134277,2227873595),new c.init(1013904242,4271175723),new c.init(2773480762,1595750129),new c.init(1359893119,2917565137),new c.init(2600822924,725511199),new c.init(528734635,4215389547),new c.init(1541459225,327033209)])},_doProcessBlock:function(v,m){for(var C=this._hash.words,_=C[0],y=C[1],B=C[2],b=C[3],F=C[4],D=C[5],T=C[6],P=C[7],H=_.high,S=_.low,A=y.high,q=y.low,N=B.high,U=B.low,L=b.high,X=b.low,Y=F.high,r0=F.low,x0=D.high,a0=D.low,E=T.high,w=T.low,I=P.high,k=P.low,O=H,W=S,t0=A,j=q,o0=N,g0=U,F0=L,ye=X,w0=Y,C0=r0,We=x0,ge=a0,je=E,me=w,xt=I,Be=k,S0=0;S0<80;S0++){var A0,W0,Xe=s[S0];if(S0<16)W0=Xe.high=v[m+S0*2]|0,A0=Xe.low=v[m+S0*2+1]|0;else{var Nt=s[S0-15],se=Nt.high,Ce=Nt.low,Bn=(se>>>1|Ce<<31)^(se>>>8|Ce<<24)^se>>>7,Mt=(Ce>>>1|se<<31)^(Ce>>>8|se<<24)^(Ce>>>7|se<<25),zt=s[S0-2],ce=zt.high,Ee=zt.low,Cn=(ce>>>19|Ee<<13)^(ce<<3|Ee>>>29)^ce>>>6,Ve=(Ee>>>19|ce<<13)^(Ee<<3|ce>>>29)^(Ee>>>6|ce<<26),Ut=s[S0-7],Lt=Ut.high,En=Ut.low,ot=s[S0-16],_n=ot.high,$t=ot.low;A0=Mt+En,W0=Bn+Lt+(A0>>>0<Mt>>>0?1:0),A0=A0+Ve,W0=W0+Cn+(A0>>>0<Ve>>>0?1:0),A0=A0+$t,W0=W0+_n+(A0>>>0<$t>>>0?1:0),Xe.high=W0,Xe.low=A0}var Fn=w0&We^~w0&je,Kt=C0&ge^~C0&me,An=O&t0^O&o0^t0&o0,Dn=W&j^W&g0^j&g0,wn=(O>>>28|W<<4)^(O<<30|W>>>2)^(O<<25|W>>>7),Wt=(W>>>28|O<<4)^(W<<30|O>>>2)^(W<<25|O>>>7),Sn=(w0>>>14|C0<<18)^(w0>>>18|C0<<14)^(w0<<23|C0>>>9),Tn=(C0>>>14|w0<<18)^(C0>>>18|w0<<14)^(C0<<23|w0>>>9),jt=h[S0],kn=jt.high,Xt=jt.low,E0=Be+Tn,j0=xt+Sn+(E0>>>0<Be>>>0?1:0),E0=E0+Kt,j0=j0+Fn+(E0>>>0<Kt>>>0?1:0),E0=E0+Xt,j0=j0+kn+(E0>>>0<Xt>>>0?1:0),E0=E0+A0,j0=j0+W0+(E0>>>0<A0>>>0?1:0),Vt=Wt+Dn,Rn=wn+An+(Vt>>>0<Wt>>>0?1:0);xt=je,Be=me,je=We,me=ge,We=w0,ge=C0,C0=ye+E0|0,w0=F0+j0+(C0>>>0<ye>>>0?1:0)|0,F0=o0,ye=g0,o0=t0,g0=j,t0=O,j=W,W=E0+Vt|0,O=j0+Rn+(W>>>0<E0>>>0?1:0)|0}S=_.low=S+W,_.high=H+O+(S>>>0<W>>>0?1:0),q=y.low=q+j,y.high=A+t0+(q>>>0<j>>>0?1:0),U=B.low=U+g0,B.high=N+o0+(U>>>0<g0>>>0?1:0),X=b.low=X+ye,b.high=L+F0+(X>>>0<ye>>>0?1:0),r0=F.low=r0+C0,F.high=Y+w0+(r0>>>0<C0>>>0?1:0),a0=D.low=a0+ge,D.high=x0+We+(a0>>>0<ge>>>0?1:0),w=T.low=w+me,T.high=E+je+(w>>>0<me>>>0?1:0),k=P.low=k+Be,P.high=I+xt+(k>>>0<Be>>>0?1:0)},_doFinalize:function(){var v=this._data,m=v.words,C=this._nDataBytes*8,_=v.sigBytes*8;m[_>>>5]|=128<<24-_%32,m[(_+128>>>10<<5)+30]=Math.floor(C/4294967296),m[(_+128>>>10<<5)+31]=C,v.sigBytes=m.length*4,this._process();var y=this._hash.toX32();return y},clone:function(){var v=i.clone.call(this);return v._hash=this._hash.clone(),v},blockSize:1024/32});n.SHA512=i._createHelper(f),n.HmacSHA512=i._createHmacHelper(f)}(),r.SHA512})}(lr)),lr.exports}var pr={exports:{}},ia;function ao(){return ia||(ia=1,function(e,t){(function(r,n,a){e.exports=n(Q(),ht(),aa())})(G,function(r){return function(){var n=r,a=n.x64,i=a.Word,d=a.WordArray,c=n.algo,p=c.SHA512,x=c.SHA384=p.extend({_doReset:function(){this._hash=new d.init([new i.init(3418070365,3238371032),new i.init(1654270250,914150663),new i.init(2438529370,812702999),new i.init(355462360,4144912697),new i.init(1731405415,4290775857),new i.init(2394180231,1750603025),new i.init(3675008525,1694076839),new i.init(1203062813,3204075428)])},_doFinalize:function(){var o=p._doFinalize.call(this);return o.sigBytes-=16,o}});n.SHA384=p._createHelper(x),n.HmacSHA384=p._createHmacHelper(x)}(),r.SHA384})}(pr)),pr.exports}var br={exports:{}},xa;function io(){return xa||(xa=1,function(e,t){(function(r,n,a){e.exports=n(Q(),ht())})(G,function(r){return function(n){var a=r,i=a.lib,d=i.WordArray,c=i.Hasher,p=a.x64,x=p.Word,o=a.algo,h=[],s=[],f=[];(function(){for(var C=1,_=0,y=0;y<24;y++){h[C+5*_]=(y+1)*(y+2)/2%64;var B=_%5,b=(2*C+3*_)%5;C=B,_=b}for(var C=0;C<5;C++)for(var _=0;_<5;_++)s[C+5*_]=_+(2*C+3*_)%5*5;for(var F=1,D=0;D<24;D++){for(var T=0,P=0,H=0;H<7;H++){if(F&1){var S=(1<<H)-1;S<32?P^=1<<S:T^=1<<S-32}F&128?F=F<<1^113:F<<=1}f[D]=x.create(T,P)}})();var v=[];(function(){for(var C=0;C<25;C++)v[C]=x.create()})();var m=o.SHA3=c.extend({cfg:c.cfg.extend({outputLength:512}),_doReset:function(){for(var C=this._state=[],_=0;_<25;_++)C[_]=new x.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(C,_){for(var y=this._state,B=this.blockSize/2,b=0;b<B;b++){var F=C[_+2*b],D=C[_+2*b+1];F=(F<<8|F>>>24)&16711935|(F<<24|F>>>8)&4278255360,D=(D<<8|D>>>24)&16711935|(D<<24|D>>>8)&4278255360;var T=y[b];T.high^=D,T.low^=F}for(var P=0;P<24;P++){for(var H=0;H<5;H++){for(var S=0,A=0,q=0;q<5;q++){var T=y[H+5*q];S^=T.high,A^=T.low}var N=v[H];N.high=S,N.low=A}for(var H=0;H<5;H++)for(var U=v[(H+4)%5],L=v[(H+1)%5],X=L.high,Y=L.low,S=U.high^(X<<1|Y>>>31),A=U.low^(Y<<1|X>>>31),q=0;q<5;q++){var T=y[H+5*q];T.high^=S,T.low^=A}for(var r0=1;r0<25;r0++){var S,A,T=y[r0],x0=T.high,a0=T.low,E=h[r0];E<32?(S=x0<<E|a0>>>32-E,A=a0<<E|x0>>>32-E):(S=a0<<E-32|x0>>>64-E,A=x0<<E-32|a0>>>64-E);var w=v[s[r0]];w.high=S,w.low=A}var I=v[0],k=y[0];I.high=k.high,I.low=k.low;for(var H=0;H<5;H++)for(var q=0;q<5;q++){var r0=H+5*q,T=y[r0],O=v[r0],W=v[(H+1)%5+5*q],t0=v[(H+2)%5+5*q];T.high=O.high^~W.high&t0.high,T.low=O.low^~W.low&t0.low}var T=y[0],j=f[P];T.high^=j.high,T.low^=j.low}},_doFinalize:function(){var C=this._data,_=C.words;this._nDataBytes*8;var y=C.sigBytes*8,B=this.blockSize*32;_[y>>>5]|=1<<24-y%32,_[(n.ceil((y+1)/B)*B>>>5)-1]|=128,C.sigBytes=_.length*4,this._process();for(var b=this._state,F=this.cfg.outputLength/8,D=F/8,T=[],P=0;P<D;P++){var H=b[P],S=H.high,A=H.low;S=(S<<8|S>>>24)&16711935|(S<<24|S>>>8)&4278255360,A=(A<<8|A>>>24)&16711935|(A<<24|A>>>8)&4278255360,T.push(A),T.push(S)}return new d.init(T,F)},clone:function(){for(var C=c.clone.call(this),_=C._state=this._state.slice(0),y=0;y<25;y++)_[y]=_[y].clone();return C}});a.SHA3=c._createHelper(m),a.HmacSHA3=c._createHmacHelper(m)}(Math),r.SHA3})}(br)),br.exports}var vr={exports:{}},oa;function xo(){return oa||(oa=1,function(e,t){(function(r,n){e.exports=n(Q())})(G,function(r){/** @preserve
|
|
3
|
+
(c) 2012 by Cédric Mesnil. All rights reserved.
|
|
4
|
+
|
|
5
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
|
6
|
+
|
|
7
|
+
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
|
8
|
+
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
|
9
|
+
|
|
10
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
11
|
+
*/return function(n){var a=r,i=a.lib,d=i.WordArray,c=i.Hasher,p=a.algo,x=d.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),o=d.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),h=d.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),s=d.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),f=d.create([0,1518500249,1859775393,2400959708,2840853838]),v=d.create([1352829926,1548603684,1836072691,2053994217,0]),m=p.RIPEMD160=c.extend({_doReset:function(){this._hash=d.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(D,T){for(var P=0;P<16;P++){var H=T+P,S=D[H];D[H]=(S<<8|S>>>24)&16711935|(S<<24|S>>>8)&4278255360}var A=this._hash.words,q=f.words,N=v.words,U=x.words,L=o.words,X=h.words,Y=s.words,r0,x0,a0,E,w,I,k,O,W,t0;I=r0=A[0],k=x0=A[1],O=a0=A[2],W=E=A[3],t0=w=A[4];for(var j,P=0;P<80;P+=1)j=r0+D[T+U[P]]|0,P<16?j+=C(x0,a0,E)+q[0]:P<32?j+=_(x0,a0,E)+q[1]:P<48?j+=y(x0,a0,E)+q[2]:P<64?j+=B(x0,a0,E)+q[3]:j+=b(x0,a0,E)+q[4],j=j|0,j=F(j,X[P]),j=j+w|0,r0=w,w=E,E=F(a0,10),a0=x0,x0=j,j=I+D[T+L[P]]|0,P<16?j+=b(k,O,W)+N[0]:P<32?j+=B(k,O,W)+N[1]:P<48?j+=y(k,O,W)+N[2]:P<64?j+=_(k,O,W)+N[3]:j+=C(k,O,W)+N[4],j=j|0,j=F(j,Y[P]),j=j+t0|0,I=t0,t0=W,W=F(O,10),O=k,k=j;j=A[1]+a0+W|0,A[1]=A[2]+E+t0|0,A[2]=A[3]+w+I|0,A[3]=A[4]+r0+k|0,A[4]=A[0]+x0+O|0,A[0]=j},_doFinalize:function(){var D=this._data,T=D.words,P=this._nDataBytes*8,H=D.sigBytes*8;T[H>>>5]|=128<<24-H%32,T[(H+64>>>9<<4)+14]=(P<<8|P>>>24)&16711935|(P<<24|P>>>8)&4278255360,D.sigBytes=(T.length+1)*4,this._process();for(var S=this._hash,A=S.words,q=0;q<5;q++){var N=A[q];A[q]=(N<<8|N>>>24)&16711935|(N<<24|N>>>8)&4278255360}return S},clone:function(){var D=c.clone.call(this);return D._hash=this._hash.clone(),D}});function C(D,T,P){return D^T^P}function _(D,T,P){return D&T|~D&P}function y(D,T,P){return(D|~T)^P}function B(D,T,P){return D&P|T&~P}function b(D,T,P){return D^(T|~P)}function F(D,T){return D<<T|D>>>32-T}a.RIPEMD160=c._createHelper(m),a.HmacRIPEMD160=c._createHmacHelper(m)}(),r.RIPEMD160})}(vr)),vr.exports}var yr={exports:{}},sa;function gr(){return sa||(sa=1,function(e,t){(function(r,n){e.exports=n(Q())})(G,function(r){(function(){var n=r,a=n.lib,i=a.Base,d=n.enc,c=d.Utf8,p=n.algo;p.HMAC=i.extend({init:function(x,o){x=this._hasher=new x.init,typeof o=="string"&&(o=c.parse(o));var h=x.blockSize,s=h*4;o.sigBytes>s&&(o=x.finalize(o)),o.clamp();for(var f=this._oKey=o.clone(),v=this._iKey=o.clone(),m=f.words,C=v.words,_=0;_<h;_++)m[_]^=1549556828,C[_]^=909522486;f.sigBytes=v.sigBytes=s,this.reset()},reset:function(){var x=this._hasher;x.reset(),x.update(this._iKey)},update:function(x){return this._hasher.update(x),this},finalize:function(x){var o=this._hasher,h=o.finalize(x);o.reset();var s=o.finalize(this._oKey.clone().concat(h));return s}})})()})}(yr)),yr.exports}var mr={exports:{}},ca;function oo(){return ca||(ca=1,function(e,t){(function(r,n,a){e.exports=n(Q(),ur(),gr())})(G,function(r){return function(){var n=r,a=n.lib,i=a.Base,d=a.WordArray,c=n.algo,p=c.SHA256,x=c.HMAC,o=c.PBKDF2=i.extend({cfg:i.extend({keySize:128/32,hasher:p,iterations:25e4}),init:function(h){this.cfg=this.cfg.extend(h)},compute:function(h,s){for(var f=this.cfg,v=x.create(f.hasher,h),m=d.create(),C=d.create([1]),_=m.words,y=C.words,B=f.keySize,b=f.iterations;_.length<B;){var F=v.update(s).finalize(C);v.reset();for(var D=F.words,T=D.length,P=F,H=1;H<b;H++){P=v.finalize(P),v.reset();for(var S=P.words,A=0;A<T;A++)D[A]^=S[A]}m.concat(F),y[0]++}return m.sigBytes=B*4,m}});n.PBKDF2=function(h,s,f){return o.create(f).compute(h,s)}}(),r.PBKDF2})}(mr)),mr.exports}var Br={exports:{}},fa;function ee(){return fa||(fa=1,function(e,t){(function(r,n,a){e.exports=n(Q(),ea(),gr())})(G,function(r){return function(){var n=r,a=n.lib,i=a.Base,d=a.WordArray,c=n.algo,p=c.MD5,x=c.EvpKDF=i.extend({cfg:i.extend({keySize:128/32,hasher:p,iterations:1}),init:function(o){this.cfg=this.cfg.extend(o)},compute:function(o,h){for(var s,f=this.cfg,v=f.hasher.create(),m=d.create(),C=m.words,_=f.keySize,y=f.iterations;C.length<_;){s&&v.update(s),s=v.update(o).finalize(h),v.reset();for(var B=1;B<y;B++)s=v.finalize(s),v.reset();m.concat(s)}return m.sigBytes=_*4,m}});n.EvpKDF=function(o,h,s){return x.create(s).compute(o,h)}}(),r.EvpKDF})}(Br)),Br.exports}var Cr={exports:{}},da;function l0(){return da||(da=1,function(e,t){(function(r,n,a){e.exports=n(Q(),ee())})(G,function(r){r.lib.Cipher||function(n){var a=r,i=a.lib,d=i.Base,c=i.WordArray,p=i.BufferedBlockAlgorithm,x=a.enc;x.Utf8;var o=x.Base64,h=a.algo,s=h.EvpKDF,f=i.Cipher=p.extend({cfg:d.extend(),createEncryptor:function(S,A){return this.create(this._ENC_XFORM_MODE,S,A)},createDecryptor:function(S,A){return this.create(this._DEC_XFORM_MODE,S,A)},init:function(S,A,q){this.cfg=this.cfg.extend(q),this._xformMode=S,this._key=A,this.reset()},reset:function(){p.reset.call(this),this._doReset()},process:function(S){return this._append(S),this._process()},finalize:function(S){S&&this._append(S);var A=this._doFinalize();return A},keySize:128/32,ivSize:128/32,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function S(A){return typeof A=="string"?H:D}return function(A){return{encrypt:function(q,N,U){return S(N).encrypt(A,q,N,U)},decrypt:function(q,N,U){return S(N).decrypt(A,q,N,U)}}}}()});i.StreamCipher=f.extend({_doFinalize:function(){var S=this._process(!0);return S},blockSize:1});var v=a.mode={},m=i.BlockCipherMode=d.extend({createEncryptor:function(S,A){return this.Encryptor.create(S,A)},createDecryptor:function(S,A){return this.Decryptor.create(S,A)},init:function(S,A){this._cipher=S,this._iv=A}}),C=v.CBC=function(){var S=m.extend();S.Encryptor=S.extend({processBlock:function(q,N){var U=this._cipher,L=U.blockSize;A.call(this,q,N,L),U.encryptBlock(q,N),this._prevBlock=q.slice(N,N+L)}}),S.Decryptor=S.extend({processBlock:function(q,N){var U=this._cipher,L=U.blockSize,X=q.slice(N,N+L);U.decryptBlock(q,N),A.call(this,q,N,L),this._prevBlock=X}});function A(q,N,U){var L,X=this._iv;X?(L=X,this._iv=n):L=this._prevBlock;for(var Y=0;Y<U;Y++)q[N+Y]^=L[Y]}return S}(),_=a.pad={},y=_.Pkcs7={pad:function(S,A){for(var q=A*4,N=q-S.sigBytes%q,U=N<<24|N<<16|N<<8|N,L=[],X=0;X<N;X+=4)L.push(U);var Y=c.create(L,N);S.concat(Y)},unpad:function(S){var A=S.words[S.sigBytes-1>>>2]&255;S.sigBytes-=A}};i.BlockCipher=f.extend({cfg:f.cfg.extend({mode:C,padding:y}),reset:function(){var S;f.reset.call(this);var A=this.cfg,q=A.iv,N=A.mode;this._xformMode==this._ENC_XFORM_MODE?S=N.createEncryptor:(S=N.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==S?this._mode.init(this,q&&q.words):(this._mode=S.call(N,this,q&&q.words),this._mode.__creator=S)},_doProcessBlock:function(S,A){this._mode.processBlock(S,A)},_doFinalize:function(){var S,A=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(A.pad(this._data,this.blockSize),S=this._process(!0)):(S=this._process(!0),A.unpad(S)),S},blockSize:128/32});var B=i.CipherParams=d.extend({init:function(S){this.mixIn(S)},toString:function(S){return(S||this.formatter).stringify(this)}}),b=a.format={},F=b.OpenSSL={stringify:function(S){var A,q=S.ciphertext,N=S.salt;return N?A=c.create([1398893684,1701076831]).concat(N).concat(q):A=q,A.toString(o)},parse:function(S){var A,q=o.parse(S),N=q.words;return N[0]==1398893684&&N[1]==1701076831&&(A=c.create(N.slice(2,4)),N.splice(0,4),q.sigBytes-=16),B.create({ciphertext:q,salt:A})}},D=i.SerializableCipher=d.extend({cfg:d.extend({format:F}),encrypt:function(S,A,q,N){N=this.cfg.extend(N);var U=S.createEncryptor(q,N),L=U.finalize(A),X=U.cfg;return B.create({ciphertext:L,key:q,iv:X.iv,algorithm:S,mode:X.mode,padding:X.padding,blockSize:S.blockSize,formatter:N.format})},decrypt:function(S,A,q,N){N=this.cfg.extend(N),A=this._parse(A,N.format);var U=S.createDecryptor(q,N).finalize(A.ciphertext);return U},_parse:function(S,A){return typeof S=="string"?A.parse(S,this):S}}),T=a.kdf={},P=T.OpenSSL={execute:function(S,A,q,N,U){if(N||(N=c.random(64/8)),U)var L=s.create({keySize:A+q,hasher:U}).compute(S,N);else var L=s.create({keySize:A+q}).compute(S,N);var X=c.create(L.words.slice(A),q*4);return L.sigBytes=A*4,B.create({key:L,iv:X,salt:N})}},H=i.PasswordBasedCipher=D.extend({cfg:D.cfg.extend({kdf:P}),encrypt:function(S,A,q,N){N=this.cfg.extend(N);var U=N.kdf.execute(q,S.keySize,S.ivSize,N.salt,N.hasher);N.iv=U.iv;var L=D.encrypt.call(this,S,A,U.key,N);return L.mixIn(U),L},decrypt:function(S,A,q,N){N=this.cfg.extend(N),A=this._parse(A,N.format);var U=N.kdf.execute(q,S.keySize,S.ivSize,A.salt,N.hasher);N.iv=U.iv;var L=D.decrypt.call(this,S,A,U.key,N);return L}})}()})}(Cr)),Cr.exports}var Er={exports:{}},ua;function so(){return ua||(ua=1,function(e,t){(function(r,n,a){e.exports=n(Q(),l0())})(G,function(r){return r.mode.CFB=function(){var n=r.lib.BlockCipherMode.extend();n.Encryptor=n.extend({processBlock:function(i,d){var c=this._cipher,p=c.blockSize;a.call(this,i,d,p,c),this._prevBlock=i.slice(d,d+p)}}),n.Decryptor=n.extend({processBlock:function(i,d){var c=this._cipher,p=c.blockSize,x=i.slice(d,d+p);a.call(this,i,d,p,c),this._prevBlock=x}});function a(i,d,c,p){var x,o=this._iv;o?(x=o.slice(0),this._iv=void 0):x=this._prevBlock,p.encryptBlock(x,0);for(var h=0;h<c;h++)i[d+h]^=x[h]}return n}(),r.mode.CFB})}(Er)),Er.exports}var _r={exports:{}},ha;function co(){return ha||(ha=1,function(e,t){(function(r,n,a){e.exports=n(Q(),l0())})(G,function(r){return r.mode.CTR=function(){var n=r.lib.BlockCipherMode.extend(),a=n.Encryptor=n.extend({processBlock:function(i,d){var c=this._cipher,p=c.blockSize,x=this._iv,o=this._counter;x&&(o=this._counter=x.slice(0),this._iv=void 0);var h=o.slice(0);c.encryptBlock(h,0),o[p-1]=o[p-1]+1|0;for(var s=0;s<p;s++)i[d+s]^=h[s]}});return n.Decryptor=a,n}(),r.mode.CTR})}(_r)),_r.exports}var Fr={exports:{}},la;function fo(){return la||(la=1,function(e,t){(function(r,n,a){e.exports=n(Q(),l0())})(G,function(r){/** @preserve
|
|
12
|
+
* Counter block mode compatible with Dr Brian Gladman fileenc.c
|
|
13
|
+
* derived from CryptoJS.mode.CTR
|
|
14
|
+
* Jan Hruby jhruby.web@gmail.com
|
|
15
|
+
*/return r.mode.CTRGladman=function(){var n=r.lib.BlockCipherMode.extend();function a(c){if((c>>24&255)===255){var p=c>>16&255,x=c>>8&255,o=c&255;p===255?(p=0,x===255?(x=0,o===255?o=0:++o):++x):++p,c=0,c+=p<<16,c+=x<<8,c+=o}else c+=1<<24;return c}function i(c){return(c[0]=a(c[0]))===0&&(c[1]=a(c[1])),c}var d=n.Encryptor=n.extend({processBlock:function(c,p){var x=this._cipher,o=x.blockSize,h=this._iv,s=this._counter;h&&(s=this._counter=h.slice(0),this._iv=void 0),i(s);var f=s.slice(0);x.encryptBlock(f,0);for(var v=0;v<o;v++)c[p+v]^=f[v]}});return n.Decryptor=d,n}(),r.mode.CTRGladman})}(Fr)),Fr.exports}var Ar={exports:{}},pa;function uo(){return pa||(pa=1,function(e,t){(function(r,n,a){e.exports=n(Q(),l0())})(G,function(r){return r.mode.OFB=function(){var n=r.lib.BlockCipherMode.extend(),a=n.Encryptor=n.extend({processBlock:function(i,d){var c=this._cipher,p=c.blockSize,x=this._iv,o=this._keystream;x&&(o=this._keystream=x.slice(0),this._iv=void 0),c.encryptBlock(o,0);for(var h=0;h<p;h++)i[d+h]^=o[h]}});return n.Decryptor=a,n}(),r.mode.OFB})}(Ar)),Ar.exports}var Dr={exports:{}},ba;function ho(){return ba||(ba=1,function(e,t){(function(r,n,a){e.exports=n(Q(),l0())})(G,function(r){return r.mode.ECB=function(){var n=r.lib.BlockCipherMode.extend();return n.Encryptor=n.extend({processBlock:function(a,i){this._cipher.encryptBlock(a,i)}}),n.Decryptor=n.extend({processBlock:function(a,i){this._cipher.decryptBlock(a,i)}}),n}(),r.mode.ECB})}(Dr)),Dr.exports}var wr={exports:{}},va;function lo(){return va||(va=1,function(e,t){(function(r,n,a){e.exports=n(Q(),l0())})(G,function(r){return r.pad.AnsiX923={pad:function(n,a){var i=n.sigBytes,d=a*4,c=d-i%d,p=i+c-1;n.clamp(),n.words[p>>>2]|=c<<24-p%4*8,n.sigBytes+=c},unpad:function(n){var a=n.words[n.sigBytes-1>>>2]&255;n.sigBytes-=a}},r.pad.Ansix923})}(wr)),wr.exports}var Sr={exports:{}},ya;function po(){return ya||(ya=1,function(e,t){(function(r,n,a){e.exports=n(Q(),l0())})(G,function(r){return r.pad.Iso10126={pad:function(n,a){var i=a*4,d=i-n.sigBytes%i;n.concat(r.lib.WordArray.random(d-1)).concat(r.lib.WordArray.create([d<<24],1))},unpad:function(n){var a=n.words[n.sigBytes-1>>>2]&255;n.sigBytes-=a}},r.pad.Iso10126})}(Sr)),Sr.exports}var Tr={exports:{}},ga;function bo(){return ga||(ga=1,function(e,t){(function(r,n,a){e.exports=n(Q(),l0())})(G,function(r){return r.pad.Iso97971={pad:function(n,a){n.concat(r.lib.WordArray.create([2147483648],1)),r.pad.ZeroPadding.pad(n,a)},unpad:function(n){r.pad.ZeroPadding.unpad(n),n.sigBytes--}},r.pad.Iso97971})}(Tr)),Tr.exports}var kr={exports:{}},ma;function vo(){return ma||(ma=1,function(e,t){(function(r,n,a){e.exports=n(Q(),l0())})(G,function(r){return r.pad.ZeroPadding={pad:function(n,a){var i=a*4;n.clamp(),n.sigBytes+=i-(n.sigBytes%i||i)},unpad:function(n){for(var a=n.words,i=n.sigBytes-1,i=n.sigBytes-1;i>=0;i--)if(a[i>>>2]>>>24-i%4*8&255){n.sigBytes=i+1;break}}},r.pad.ZeroPadding})}(kr)),kr.exports}var Rr={exports:{}},Ba;function yo(){return Ba||(Ba=1,function(e,t){(function(r,n,a){e.exports=n(Q(),l0())})(G,function(r){return r.pad.NoPadding={pad:function(){},unpad:function(){}},r.pad.NoPadding})}(Rr)),Rr.exports}var Pr={exports:{}},Ca;function go(){return Ca||(Ca=1,function(e,t){(function(r,n,a){e.exports=n(Q(),l0())})(G,function(r){return function(n){var a=r,i=a.lib,d=i.CipherParams,c=a.enc,p=c.Hex,x=a.format;x.Hex={stringify:function(o){return o.ciphertext.toString(p)},parse:function(o){var h=p.parse(o);return d.create({ciphertext:h})}}}(),r.format.Hex})}(Pr)),Pr.exports}var Ir={exports:{}},Ea;function mo(){return Ea||(Ea=1,function(e,t){(function(r,n,a){e.exports=n(Q(),ue(),he(),ee(),l0())})(G,function(r){return function(){var n=r,a=n.lib,i=a.BlockCipher,d=n.algo,c=[],p=[],x=[],o=[],h=[],s=[],f=[],v=[],m=[],C=[];(function(){for(var B=[],b=0;b<256;b++)b<128?B[b]=b<<1:B[b]=b<<1^283;for(var F=0,D=0,b=0;b<256;b++){var T=D^D<<1^D<<2^D<<3^D<<4;T=T>>>8^T&255^99,c[F]=T,p[T]=F;var P=B[F],H=B[P],S=B[H],A=B[T]*257^T*16843008;x[F]=A<<24|A>>>8,o[F]=A<<16|A>>>16,h[F]=A<<8|A>>>24,s[F]=A;var A=S*16843009^H*65537^P*257^F*16843008;f[T]=A<<24|A>>>8,v[T]=A<<16|A>>>16,m[T]=A<<8|A>>>24,C[T]=A,F?(F=P^B[B[B[S^P]]],D^=B[B[D]]):F=D=1}})();var _=[0,1,2,4,8,16,32,64,128,27,54],y=d.AES=i.extend({_doReset:function(){var B;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var b=this._keyPriorReset=this._key,F=b.words,D=b.sigBytes/4,T=this._nRounds=D+6,P=(T+1)*4,H=this._keySchedule=[],S=0;S<P;S++)S<D?H[S]=F[S]:(B=H[S-1],S%D?D>6&&S%D==4&&(B=c[B>>>24]<<24|c[B>>>16&255]<<16|c[B>>>8&255]<<8|c[B&255]):(B=B<<8|B>>>24,B=c[B>>>24]<<24|c[B>>>16&255]<<16|c[B>>>8&255]<<8|c[B&255],B^=_[S/D|0]<<24),H[S]=H[S-D]^B);for(var A=this._invKeySchedule=[],q=0;q<P;q++){var S=P-q;if(q%4)var B=H[S];else var B=H[S-4];q<4||S<=4?A[q]=B:A[q]=f[c[B>>>24]]^v[c[B>>>16&255]]^m[c[B>>>8&255]]^C[c[B&255]]}}},encryptBlock:function(B,b){this._doCryptBlock(B,b,this._keySchedule,x,o,h,s,c)},decryptBlock:function(B,b){var F=B[b+1];B[b+1]=B[b+3],B[b+3]=F,this._doCryptBlock(B,b,this._invKeySchedule,f,v,m,C,p);var F=B[b+1];B[b+1]=B[b+3],B[b+3]=F},_doCryptBlock:function(B,b,F,D,T,P,H,S){for(var A=this._nRounds,q=B[b]^F[0],N=B[b+1]^F[1],U=B[b+2]^F[2],L=B[b+3]^F[3],X=4,Y=1;Y<A;Y++){var r0=D[q>>>24]^T[N>>>16&255]^P[U>>>8&255]^H[L&255]^F[X++],x0=D[N>>>24]^T[U>>>16&255]^P[L>>>8&255]^H[q&255]^F[X++],a0=D[U>>>24]^T[L>>>16&255]^P[q>>>8&255]^H[N&255]^F[X++],E=D[L>>>24]^T[q>>>16&255]^P[N>>>8&255]^H[U&255]^F[X++];q=r0,N=x0,U=a0,L=E}var r0=(S[q>>>24]<<24|S[N>>>16&255]<<16|S[U>>>8&255]<<8|S[L&255])^F[X++],x0=(S[N>>>24]<<24|S[U>>>16&255]<<16|S[L>>>8&255]<<8|S[q&255])^F[X++],a0=(S[U>>>24]<<24|S[L>>>16&255]<<16|S[q>>>8&255]<<8|S[N&255])^F[X++],E=(S[L>>>24]<<24|S[q>>>16&255]<<16|S[N>>>8&255]<<8|S[U&255])^F[X++];B[b]=r0,B[b+1]=x0,B[b+2]=a0,B[b+3]=E},keySize:256/32});n.AES=i._createHelper(y)}(),r.AES})}(Ir)),Ir.exports}var qr={exports:{}},_a;function Bo(){return _a||(_a=1,function(e,t){(function(r,n,a){e.exports=n(Q(),ue(),he(),ee(),l0())})(G,function(r){return function(){var n=r,a=n.lib,i=a.WordArray,d=a.BlockCipher,c=n.algo,p=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],x=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],o=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],h=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],s=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],f=c.DES=d.extend({_doReset:function(){for(var _=this._key,y=_.words,B=[],b=0;b<56;b++){var F=p[b]-1;B[b]=y[F>>>5]>>>31-F%32&1}for(var D=this._subKeys=[],T=0;T<16;T++){for(var P=D[T]=[],H=o[T],b=0;b<24;b++)P[b/6|0]|=B[(x[b]-1+H)%28]<<31-b%6,P[4+(b/6|0)]|=B[28+(x[b+24]-1+H)%28]<<31-b%6;P[0]=P[0]<<1|P[0]>>>31;for(var b=1;b<7;b++)P[b]=P[b]>>>(b-1)*4+3;P[7]=P[7]<<5|P[7]>>>27}for(var S=this._invSubKeys=[],b=0;b<16;b++)S[b]=D[15-b]},encryptBlock:function(_,y){this._doCryptBlock(_,y,this._subKeys)},decryptBlock:function(_,y){this._doCryptBlock(_,y,this._invSubKeys)},_doCryptBlock:function(_,y,B){this._lBlock=_[y],this._rBlock=_[y+1],v.call(this,4,252645135),v.call(this,16,65535),m.call(this,2,858993459),m.call(this,8,16711935),v.call(this,1,1431655765);for(var b=0;b<16;b++){for(var F=B[b],D=this._lBlock,T=this._rBlock,P=0,H=0;H<8;H++)P|=h[H][((T^F[H])&s[H])>>>0];this._lBlock=T,this._rBlock=D^P}var S=this._lBlock;this._lBlock=this._rBlock,this._rBlock=S,v.call(this,1,1431655765),m.call(this,8,16711935),m.call(this,2,858993459),v.call(this,16,65535),v.call(this,4,252645135),_[y]=this._lBlock,_[y+1]=this._rBlock},keySize:64/32,ivSize:64/32,blockSize:64/32});function v(_,y){var B=(this._lBlock>>>_^this._rBlock)&y;this._rBlock^=B,this._lBlock^=B<<_}function m(_,y){var B=(this._rBlock>>>_^this._lBlock)&y;this._lBlock^=B,this._rBlock^=B<<_}n.DES=d._createHelper(f);var C=c.TripleDES=d.extend({_doReset:function(){var _=this._key,y=_.words;if(y.length!==2&&y.length!==4&&y.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var B=y.slice(0,2),b=y.length<4?y.slice(0,2):y.slice(2,4),F=y.length<6?y.slice(0,2):y.slice(4,6);this._des1=f.createEncryptor(i.create(B)),this._des2=f.createEncryptor(i.create(b)),this._des3=f.createEncryptor(i.create(F))},encryptBlock:function(_,y){this._des1.encryptBlock(_,y),this._des2.decryptBlock(_,y),this._des3.encryptBlock(_,y)},decryptBlock:function(_,y){this._des3.decryptBlock(_,y),this._des2.encryptBlock(_,y),this._des1.decryptBlock(_,y)},keySize:192/32,ivSize:64/32,blockSize:64/32});n.TripleDES=d._createHelper(C)}(),r.TripleDES})}(qr)),qr.exports}var Or={exports:{}},Fa;function Co(){return Fa||(Fa=1,function(e,t){(function(r,n,a){e.exports=n(Q(),ue(),he(),ee(),l0())})(G,function(r){return function(){var n=r,a=n.lib,i=a.StreamCipher,d=n.algo,c=d.RC4=i.extend({_doReset:function(){for(var o=this._key,h=o.words,s=o.sigBytes,f=this._S=[],v=0;v<256;v++)f[v]=v;for(var v=0,m=0;v<256;v++){var C=v%s,_=h[C>>>2]>>>24-C%4*8&255;m=(m+f[v]+_)%256;var y=f[v];f[v]=f[m],f[m]=y}this._i=this._j=0},_doProcessBlock:function(o,h){o[h]^=p.call(this)},keySize:256/32,ivSize:0});function p(){for(var o=this._S,h=this._i,s=this._j,f=0,v=0;v<4;v++){h=(h+1)%256,s=(s+o[h])%256;var m=o[h];o[h]=o[s],o[s]=m,f|=o[(o[h]+o[s])%256]<<24-v*8}return this._i=h,this._j=s,f}n.RC4=i._createHelper(c);var x=d.RC4Drop=c.extend({cfg:c.cfg.extend({drop:192}),_doReset:function(){c._doReset.call(this);for(var o=this.cfg.drop;o>0;o--)p.call(this)}});n.RC4Drop=i._createHelper(x)}(),r.RC4})}(Or)),Or.exports}var Hr={exports:{}},Aa;function Eo(){return Aa||(Aa=1,function(e,t){(function(r,n,a){e.exports=n(Q(),ue(),he(),ee(),l0())})(G,function(r){return function(){var n=r,a=n.lib,i=a.StreamCipher,d=n.algo,c=[],p=[],x=[],o=d.Rabbit=i.extend({_doReset:function(){for(var s=this._key.words,f=this.cfg.iv,v=0;v<4;v++)s[v]=(s[v]<<8|s[v]>>>24)&16711935|(s[v]<<24|s[v]>>>8)&4278255360;var m=this._X=[s[0],s[3]<<16|s[2]>>>16,s[1],s[0]<<16|s[3]>>>16,s[2],s[1]<<16|s[0]>>>16,s[3],s[2]<<16|s[1]>>>16],C=this._C=[s[2]<<16|s[2]>>>16,s[0]&4294901760|s[1]&65535,s[3]<<16|s[3]>>>16,s[1]&4294901760|s[2]&65535,s[0]<<16|s[0]>>>16,s[2]&4294901760|s[3]&65535,s[1]<<16|s[1]>>>16,s[3]&4294901760|s[0]&65535];this._b=0;for(var v=0;v<4;v++)h.call(this);for(var v=0;v<8;v++)C[v]^=m[v+4&7];if(f){var _=f.words,y=_[0],B=_[1],b=(y<<8|y>>>24)&16711935|(y<<24|y>>>8)&4278255360,F=(B<<8|B>>>24)&16711935|(B<<24|B>>>8)&4278255360,D=b>>>16|F&4294901760,T=F<<16|b&65535;C[0]^=b,C[1]^=D,C[2]^=F,C[3]^=T,C[4]^=b,C[5]^=D,C[6]^=F,C[7]^=T;for(var v=0;v<4;v++)h.call(this)}},_doProcessBlock:function(s,f){var v=this._X;h.call(this),c[0]=v[0]^v[5]>>>16^v[3]<<16,c[1]=v[2]^v[7]>>>16^v[5]<<16,c[2]=v[4]^v[1]>>>16^v[7]<<16,c[3]=v[6]^v[3]>>>16^v[1]<<16;for(var m=0;m<4;m++)c[m]=(c[m]<<8|c[m]>>>24)&16711935|(c[m]<<24|c[m]>>>8)&4278255360,s[f+m]^=c[m]},blockSize:128/32,ivSize:64/32});function h(){for(var s=this._X,f=this._C,v=0;v<8;v++)p[v]=f[v];f[0]=f[0]+1295307597+this._b|0,f[1]=f[1]+3545052371+(f[0]>>>0<p[0]>>>0?1:0)|0,f[2]=f[2]+886263092+(f[1]>>>0<p[1]>>>0?1:0)|0,f[3]=f[3]+1295307597+(f[2]>>>0<p[2]>>>0?1:0)|0,f[4]=f[4]+3545052371+(f[3]>>>0<p[3]>>>0?1:0)|0,f[5]=f[5]+886263092+(f[4]>>>0<p[4]>>>0?1:0)|0,f[6]=f[6]+1295307597+(f[5]>>>0<p[5]>>>0?1:0)|0,f[7]=f[7]+3545052371+(f[6]>>>0<p[6]>>>0?1:0)|0,this._b=f[7]>>>0<p[7]>>>0?1:0;for(var v=0;v<8;v++){var m=s[v]+f[v],C=m&65535,_=m>>>16,y=((C*C>>>17)+C*_>>>15)+_*_,B=((m&4294901760)*m|0)+((m&65535)*m|0);x[v]=y^B}s[0]=x[0]+(x[7]<<16|x[7]>>>16)+(x[6]<<16|x[6]>>>16)|0,s[1]=x[1]+(x[0]<<8|x[0]>>>24)+x[7]|0,s[2]=x[2]+(x[1]<<16|x[1]>>>16)+(x[0]<<16|x[0]>>>16)|0,s[3]=x[3]+(x[2]<<8|x[2]>>>24)+x[1]|0,s[4]=x[4]+(x[3]<<16|x[3]>>>16)+(x[2]<<16|x[2]>>>16)|0,s[5]=x[5]+(x[4]<<8|x[4]>>>24)+x[3]|0,s[6]=x[6]+(x[5]<<16|x[5]>>>16)+(x[4]<<16|x[4]>>>16)|0,s[7]=x[7]+(x[6]<<8|x[6]>>>24)+x[5]|0}n.Rabbit=i._createHelper(o)}(),r.Rabbit})}(Hr)),Hr.exports}var Nr={exports:{}},Da;function _o(){return Da||(Da=1,function(e,t){(function(r,n,a){e.exports=n(Q(),ue(),he(),ee(),l0())})(G,function(r){return function(){var n=r,a=n.lib,i=a.StreamCipher,d=n.algo,c=[],p=[],x=[],o=d.RabbitLegacy=i.extend({_doReset:function(){var s=this._key.words,f=this.cfg.iv,v=this._X=[s[0],s[3]<<16|s[2]>>>16,s[1],s[0]<<16|s[3]>>>16,s[2],s[1]<<16|s[0]>>>16,s[3],s[2]<<16|s[1]>>>16],m=this._C=[s[2]<<16|s[2]>>>16,s[0]&4294901760|s[1]&65535,s[3]<<16|s[3]>>>16,s[1]&4294901760|s[2]&65535,s[0]<<16|s[0]>>>16,s[2]&4294901760|s[3]&65535,s[1]<<16|s[1]>>>16,s[3]&4294901760|s[0]&65535];this._b=0;for(var C=0;C<4;C++)h.call(this);for(var C=0;C<8;C++)m[C]^=v[C+4&7];if(f){var _=f.words,y=_[0],B=_[1],b=(y<<8|y>>>24)&16711935|(y<<24|y>>>8)&4278255360,F=(B<<8|B>>>24)&16711935|(B<<24|B>>>8)&4278255360,D=b>>>16|F&4294901760,T=F<<16|b&65535;m[0]^=b,m[1]^=D,m[2]^=F,m[3]^=T,m[4]^=b,m[5]^=D,m[6]^=F,m[7]^=T;for(var C=0;C<4;C++)h.call(this)}},_doProcessBlock:function(s,f){var v=this._X;h.call(this),c[0]=v[0]^v[5]>>>16^v[3]<<16,c[1]=v[2]^v[7]>>>16^v[5]<<16,c[2]=v[4]^v[1]>>>16^v[7]<<16,c[3]=v[6]^v[3]>>>16^v[1]<<16;for(var m=0;m<4;m++)c[m]=(c[m]<<8|c[m]>>>24)&16711935|(c[m]<<24|c[m]>>>8)&4278255360,s[f+m]^=c[m]},blockSize:128/32,ivSize:64/32});function h(){for(var s=this._X,f=this._C,v=0;v<8;v++)p[v]=f[v];f[0]=f[0]+1295307597+this._b|0,f[1]=f[1]+3545052371+(f[0]>>>0<p[0]>>>0?1:0)|0,f[2]=f[2]+886263092+(f[1]>>>0<p[1]>>>0?1:0)|0,f[3]=f[3]+1295307597+(f[2]>>>0<p[2]>>>0?1:0)|0,f[4]=f[4]+3545052371+(f[3]>>>0<p[3]>>>0?1:0)|0,f[5]=f[5]+886263092+(f[4]>>>0<p[4]>>>0?1:0)|0,f[6]=f[6]+1295307597+(f[5]>>>0<p[5]>>>0?1:0)|0,f[7]=f[7]+3545052371+(f[6]>>>0<p[6]>>>0?1:0)|0,this._b=f[7]>>>0<p[7]>>>0?1:0;for(var v=0;v<8;v++){var m=s[v]+f[v],C=m&65535,_=m>>>16,y=((C*C>>>17)+C*_>>>15)+_*_,B=((m&4294901760)*m|0)+((m&65535)*m|0);x[v]=y^B}s[0]=x[0]+(x[7]<<16|x[7]>>>16)+(x[6]<<16|x[6]>>>16)|0,s[1]=x[1]+(x[0]<<8|x[0]>>>24)+x[7]|0,s[2]=x[2]+(x[1]<<16|x[1]>>>16)+(x[0]<<16|x[0]>>>16)|0,s[3]=x[3]+(x[2]<<8|x[2]>>>24)+x[1]|0,s[4]=x[4]+(x[3]<<16|x[3]>>>16)+(x[2]<<16|x[2]>>>16)|0,s[5]=x[5]+(x[4]<<8|x[4]>>>24)+x[3]|0,s[6]=x[6]+(x[5]<<16|x[5]>>>16)+(x[4]<<16|x[4]>>>16)|0,s[7]=x[7]+(x[6]<<8|x[6]>>>24)+x[5]|0}n.RabbitLegacy=i._createHelper(o)}(),r.RabbitLegacy})}(Nr)),Nr.exports}var Mr={exports:{}},wa;function Fo(){return wa||(wa=1,function(e,t){(function(r,n,a){e.exports=n(Q(),ue(),he(),ee(),l0())})(G,function(r){return function(){var n=r,a=n.lib,i=a.BlockCipher,d=n.algo;const c=16,p=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],x=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]];var o={pbox:[],sbox:[]};function h(C,_){let y=_>>24&255,B=_>>16&255,b=_>>8&255,F=_&255,D=C.sbox[0][y]+C.sbox[1][B];return D=D^C.sbox[2][b],D=D+C.sbox[3][F],D}function s(C,_,y){let B=_,b=y,F;for(let D=0;D<c;++D)B=B^C.pbox[D],b=h(C,B)^b,F=B,B=b,b=F;return F=B,B=b,b=F,b=b^C.pbox[c],B=B^C.pbox[c+1],{left:B,right:b}}function f(C,_,y){let B=_,b=y,F;for(let D=c+1;D>1;--D)B=B^C.pbox[D],b=h(C,B)^b,F=B,B=b,b=F;return F=B,B=b,b=F,b=b^C.pbox[1],B=B^C.pbox[0],{left:B,right:b}}function v(C,_,y){for(let T=0;T<4;T++){C.sbox[T]=[];for(let P=0;P<256;P++)C.sbox[T][P]=x[T][P]}let B=0;for(let T=0;T<c+2;T++)C.pbox[T]=p[T]^_[B],B++,B>=y&&(B=0);let b=0,F=0,D=0;for(let T=0;T<c+2;T+=2)D=s(C,b,F),b=D.left,F=D.right,C.pbox[T]=b,C.pbox[T+1]=F;for(let T=0;T<4;T++)for(let P=0;P<256;P+=2)D=s(C,b,F),b=D.left,F=D.right,C.sbox[T][P]=b,C.sbox[T][P+1]=F;return!0}var m=d.Blowfish=i.extend({_doReset:function(){if(this._keyPriorReset!==this._key){var C=this._keyPriorReset=this._key,_=C.words,y=C.sigBytes/4;v(o,_,y)}},encryptBlock:function(C,_){var y=s(o,C[_],C[_+1]);C[_]=y.left,C[_+1]=y.right},decryptBlock:function(C,_){var y=f(o,C[_],C[_+1]);C[_]=y.left,C[_+1]=y.right},blockSize:64/32,keySize:128/32,ivSize:64/32});n.Blowfish=i._createHelper(m)}(),r.Blowfish})}(Mr)),Mr.exports}(function(e,t){(function(r,n,a){e.exports=n(Q(),ht(),eo(),to(),ue(),ro(),he(),ea(),ur(),no(),aa(),ao(),io(),xo(),gr(),oo(),ee(),l0(),so(),co(),fo(),uo(),ho(),lo(),po(),bo(),vo(),yo(),go(),mo(),Bo(),Co(),Eo(),_o(),Fo())})(G,function(r){return r})})(Kn);var Ao=Kn.exports;const R0=Ze(Ao),Sa="3.7.8",Do=Sa,Se=typeof Buffer=="function",Ta=typeof TextDecoder=="function"?new TextDecoder:void 0,ka=typeof TextEncoder=="function"?new TextEncoder:void 0,Ye=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),lt=(e=>{let t={};return e.forEach((r,n)=>t[r]=n),t})(Ye),wo=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,v0=String.fromCharCode.bind(String),Ra=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):e=>new Uint8Array(Array.prototype.slice.call(e,0)),Pa=e=>e.replace(/=/g,"").replace(/[+\/]/g,t=>t=="+"?"-":"_"),Ia=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),qa=e=>{let t,r,n,a,i="";const d=e.length%3;for(let c=0;c<e.length;){if((r=e.charCodeAt(c++))>255||(n=e.charCodeAt(c++))>255||(a=e.charCodeAt(c++))>255)throw new TypeError("invalid character found");t=r<<16|n<<8|a,i+=Ye[t>>18&63]+Ye[t>>12&63]+Ye[t>>6&63]+Ye[t&63]}return d?i.slice(0,d-3)+"===".substring(d):i},zr=typeof btoa=="function"?e=>btoa(e):Se?e=>Buffer.from(e,"binary").toString("base64"):qa,Ur=Se?e=>Buffer.from(e).toString("base64"):e=>{let r=[];for(let n=0,a=e.length;n<a;n+=4096)r.push(v0.apply(null,e.subarray(n,n+4096)));return zr(r.join(""))},pt=(e,t=!1)=>t?Pa(Ur(e)):Ur(e),So=e=>{if(e.length<2){var t=e.charCodeAt(0);return t<128?e:t<2048?v0(192|t>>>6)+v0(128|t&63):v0(224|t>>>12&15)+v0(128|t>>>6&63)+v0(128|t&63)}else{var t=65536+(e.charCodeAt(0)-55296)*1024+(e.charCodeAt(1)-56320);return v0(240|t>>>18&7)+v0(128|t>>>12&63)+v0(128|t>>>6&63)+v0(128|t&63)}},To=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,Oa=e=>e.replace(To,So),Ha=Se?e=>Buffer.from(e,"utf8").toString("base64"):ka?e=>Ur(ka.encode(e)):e=>zr(Oa(e)),Te=(e,t=!1)=>t?Pa(Ha(e)):Ha(e),Na=e=>Te(e,!0),ko=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,Ro=e=>{switch(e.length){case 4:var t=(7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3),r=t-65536;return v0((r>>>10)+55296)+v0((r&1023)+56320);case 3:return v0((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return v0((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},Ma=e=>e.replace(ko,Ro),za=e=>{if(e=e.replace(/\s+/g,""),!wo.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(e.length&3));let t,r,n,a=[];for(let i=0;i<e.length;)t=lt[e.charAt(i++)]<<18|lt[e.charAt(i++)]<<12|(r=lt[e.charAt(i++)])<<6|(n=lt[e.charAt(i++)]),r===64?a.push(v0(t>>16&255)):n===64?a.push(v0(t>>16&255,t>>8&255)):a.push(v0(t>>16&255,t>>8&255,t&255));return a.join("")},Lr=typeof atob=="function"?e=>atob(Ia(e)):Se?e=>Buffer.from(e,"base64").toString("binary"):za,Ua=Se?e=>Ra(Buffer.from(e,"base64")):e=>Ra(Lr(e).split("").map(t=>t.charCodeAt(0))),La=e=>Ua($a(e)),Po=Se?e=>Buffer.from(e,"base64").toString("utf8"):Ta?e=>Ta.decode(Ua(e)):e=>Ma(Lr(e)),$a=e=>Ia(e.replace(/[-_]/g,t=>t=="-"?"+":"/")),V0=e=>Po($a(e)),Io=e=>{if(typeof e!="string")return!1;const t=e.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(t)||!/[^\s0-9a-zA-Z\-_]/.test(t)},Ka=e=>({value:e,enumerable:!1,writable:!0,configurable:!0}),Wa=function(){const e=(t,r)=>Object.defineProperty(String.prototype,t,Ka(r));e("fromBase64",function(){return V0(this)}),e("toBase64",function(t){return Te(this,t)}),e("toBase64URI",function(){return Te(this,!0)}),e("toBase64URL",function(){return Te(this,!0)}),e("toUint8Array",function(){return La(this)})},ja=function(){const e=(t,r)=>Object.defineProperty(Uint8Array.prototype,t,Ka(r));e("toBase64",function(t){return pt(this,t)}),e("toBase64URI",function(){return pt(this,!0)}),e("toBase64URL",function(){return pt(this,!0)})},qo={version:Sa,VERSION:Do,atob:Lr,atobPolyfill:za,btoa:zr,btoaPolyfill:qa,fromBase64:V0,toBase64:Te,encode:Te,encodeURI:Na,encodeURL:Na,utob:Oa,btou:Ma,decode:V0,isValid:Io,fromUint8Array:pt,toUint8Array:La,extendString:Wa,extendUint8Array:ja,extendBuiltins:()=>{Wa(),ja()}},Xa=(e,t)=>{const r=ut.utils.utf8.toBytes(e),n=r.length;return n>=t?r.slice(0,t):[].concat(...new Array(Math.ceil(t/n)).fill(r)).slice(0,t)};function $r(e,t,r){const{sign:n,iv:a}=t;let i="";try{r===we.Hex?i=Ho(e,n,a):i=Oo(e,n,a)}catch(c){console.error("decryptTextAES decrypt error",c,{encryptedText:e,decryptKeys:t,decryptType:r})}let d=i;try{d=JSON.parse(d)}catch(c){}return d}function Oo(e,t,r){const n=R0.enc.Utf8.parse(t),a={};return a.iv=R0.enc.Utf8.parse(r),a.mode=R0.mode.CBC,a.pad=R0.pad.Pkcs7,R0.AES.decrypt(e,n,a).toString(R0.enc.Utf8)}function Ho(e,t,r){const n=ut.utils.hex.toBytes(e),a=Xa(t,16);let i=a;r&&(i=Xa(r,16));const c=new ut.ModeOfOperation.cbc(a,i).decrypt(n),p=ut.utils.utf8.fromBytes(c);return qo.decode(p)}class Va{constructor(t={}){V(this,"__config");this.__config=t}usePlugin(t){const{useAESDecrypt:r=!1}=t;return r}interceptDecryptResponse(t,r){return e0(this,null,function*(){const n=yield this.__getDecryptInfo(r);if(!n||!n.decryptKeys)return t;let a=t.data;const i=n.decryptPosition||De.ResponseData;if(i===De.WholeResponse&&typeof t.data=="string"&&(a=$r(t.data,n.decryptKeys,we.Hex)),i===De.ResponseData&&typeof t.data=="object"&&t.data){const d=t.data;if(typeof d.data=="string"){const c=$r(d.data,n.decryptKeys,we.Hex);a=Y0(i0({},a),{data:c})}}return Y0(i0({},t),{data:a})})}__getDecryptInfo(t){return e0(this,null,function*(){let r=i0({},this.__config);if(typeof this.__config.getDecryptInfo=="function"){const n=(yield this.__config.getDecryptInfo(t))||{};r=i0(i0({},r),n)}return t.aesDecryptInfo&&(r=i0(i0({},r),t.aesDecryptInfo)),r})}}function Ga(e){return e.indexOf("/live/v4/watch/common")!==-1}function No(e){return e.indexOf("/live/v4/watch/viewer")!==-1}function Za(e){return/\/live\/v[34]\/channel/.test(e)}function Mo(e){return e.indexOf("/live/v3")!==-1}class zo{constructor(t){V(this,"__usePolyvBusiness");V(this,"__config");var r;this.__config=t,this.__usePolyvBusiness=(r=t.usePolyvBusiness)!=null?r:!0}installPlugin(t){const r=new rr({globalParams:n=>e0(this,null,function*(){const a={};if(!this.usePlugin(n))return a;const i=n.url||"",d=yield this.__getBusinessData(n);return Ga(i)&&this.__checkBusiness(d,["sourceType","sourceId"])?(a.sourceType=d.sourceType,a.sourceId=d.sourceId):No(i)&&this.__checkBusiness(d,["sourceType","sourceId","viewerId","unionId"])?(a.sourceType=d.sourceType,a.sourceId=d.sourceId,a.viewerId=d.viewerId,a.userId=d.unionId):Za(i)&&this.__checkBusiness(d,["channelId"])?a.channelId=d.channelId:this.__checkBusiness(d,["channelId","viewerId"])&&(a.channelId=d.channelId,a.viewerId=d.viewerId),a})});t.installPlugin(r)}usePlugin(t){const{usePolyvBusiness:r=this.__usePolyvBusiness}=t;return r}interceptIncludeParams(t){const r=t.url||"";if(t=t,Ga(r)){t.useToken=!1;return}if(t.tokenInfo||(t.tokenInfo={}),!t.tokenInfo.tokenField){let n="viewerToken";Za(r)?n="channelToken":Mo(r)&&(n="token"),t.tokenInfo.tokenField=n}}__checkBusiness(t,r){for(let n=0;n<r.length;n++){const a=r[n];if(!t[a])return!1}return!0}__getBusinessData(t){return e0(this,null,function*(){let r={};if(typeof this.__config.getBusinessData=="function"){const n=(yield this.__config.getBusinessData(t))||{};r=i0(i0({},r),n)}return t.businessData&&(r=i0(i0({},r),t.businessData)),r})}}function Uo(){return{watchPageDomain:"https://live.polyv.cn",watchApiDomain:"https://live.polyv.cn",backstageApiDomain:"https://live.polyv.net",liveApiDomain:"https://live.polyv.net",polyvApiDomain:"https://api.polyv.net",polyvWatchApiDomain:"https://watch-api.polyv.cn",normalApiDomain:"https://live-normal.polyv.net",rtasDomain:"https://rtas.videocc.net",rtasDomain2:"https://rtas-2.videocc.net",elogDomain:"https://elog.polyv.net",chatWsDomain:"chat.polyv.net",chatApiDomain:"https://apichat.polyv.net",staticDomain:"https://liveimages.videocc.net",resourceDomain:"https://s1.videocc.net",playerBasicDomain:"https://player.polyv.net",liveJsonDomain:"https://livejson.polyv.net",vodImgStatic:"https://img.videocc.net",vodStaticDomain:"https://static.polyv.net",vodAuthDomain:"https://v3.polyv.net",vodEncryptDomain:"https://v.polyv.net",vodBetaDomain:"https://beta.polyv.net",vodHlsDomain:"https://hls.videocc.net",vodRtasDomain:"https://prtas.videocc.net",vodRtasDomain2:"https://prtas-2.videocc.net",vodScriptDomain:" https://script.polyv.net",playerSdkDomain:"https://player.polyv.net",webSdkDomain:"https://websdk.videocc.net",webSdkTestDomain:"https://polyv-frontend-sdk-test-01.oss-cn-shenzhen.aliyuncs.com"}}function Kr(e){return i0(i0({},Uo()),e||{})}var Ya={exports:{}},Qa={exports:{}};(function(){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t={rotl:function(r,n){return r<<n|r>>>32-n},rotr:function(r,n){return r<<32-n|r>>>n},endian:function(r){if(r.constructor==Number)return t.rotl(r,8)&16711935|t.rotl(r,24)&4278255360;for(var n=0;n<r.length;n++)r[n]=t.endian(r[n]);return r},randomBytes:function(r){for(var n=[];r>0;r--)n.push(Math.floor(Math.random()*256));return n},bytesToWords:function(r){for(var n=[],a=0,i=0;a<r.length;a++,i+=8)n[i>>>5]|=r[a]<<24-i%32;return n},wordsToBytes:function(r){for(var n=[],a=0;a<r.length*32;a+=8)n.push(r[a>>>5]>>>24-a%32&255);return n},bytesToHex:function(r){for(var n=[],a=0;a<r.length;a++)n.push((r[a]>>>4).toString(16)),n.push((r[a]&15).toString(16));return n.join("")},hexToBytes:function(r){for(var n=[],a=0;a<r.length;a+=2)n.push(parseInt(r.substr(a,2),16));return n},bytesToBase64:function(r){for(var n=[],a=0;a<r.length;a+=3)for(var i=r[a]<<16|r[a+1]<<8|r[a+2],d=0;d<4;d++)a*8+d*6<=r.length*8?n.push(e.charAt(i>>>6*(3-d)&63)):n.push("=");return n.join("")},base64ToBytes:function(r){r=r.replace(/[^A-Z0-9+\/]/ig,"");for(var n=[],a=0,i=0;a<r.length;i=++a%4)i!=0&&n.push((e.indexOf(r.charAt(a-1))&Math.pow(2,-2*i+8)-1)<<i*2|e.indexOf(r.charAt(a))>>>6-i*2);return n}};Qa.exports=t})();var Lo=Qa.exports,Wr={utf8:{stringToBytes:function(e){return Wr.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(Wr.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var t=[],r=0;r<e.length;r++)t.push(e.charCodeAt(r)&255);return t},bytesToString:function(e){for(var t=[],r=0;r<e.length;r++)t.push(String.fromCharCode(e[r]));return t.join("")}}},Ja=Wr;/*!
|
|
16
|
+
* Determine if an object is a Buffer
|
|
17
|
+
*
|
|
18
|
+
* @author Feross Aboukhadijeh <https://feross.org>
|
|
19
|
+
* @license MIT
|
|
20
|
+
*/var $o=function(e){return e!=null&&(ei(e)||Ko(e)||!!e._isBuffer)};function ei(e){return!!e.constructor&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function Ko(e){return typeof e.readFloatLE=="function"&&typeof e.slice=="function"&&ei(e.slice(0,0))}(function(){var e=Lo,t=Ja.utf8,r=$o,n=Ja.bin,a=function(i,d){i.constructor==String?d&&d.encoding==="binary"?i=n.stringToBytes(i):i=t.stringToBytes(i):r(i)?i=Array.prototype.slice.call(i,0):!Array.isArray(i)&&i.constructor!==Uint8Array&&(i=i.toString());for(var c=e.bytesToWords(i),p=i.length*8,x=1732584193,o=-271733879,h=-1732584194,s=271733878,f=0;f<c.length;f++)c[f]=(c[f]<<8|c[f]>>>24)&16711935|(c[f]<<24|c[f]>>>8)&4278255360;c[p>>>5]|=128<<p%32,c[(p+64>>>9<<4)+14]=p;for(var v=a._ff,m=a._gg,C=a._hh,_=a._ii,f=0;f<c.length;f+=16){var y=x,B=o,b=h,F=s;x=v(x,o,h,s,c[f+0],7,-680876936),s=v(s,x,o,h,c[f+1],12,-389564586),h=v(h,s,x,o,c[f+2],17,606105819),o=v(o,h,s,x,c[f+3],22,-1044525330),x=v(x,o,h,s,c[f+4],7,-176418897),s=v(s,x,o,h,c[f+5],12,1200080426),h=v(h,s,x,o,c[f+6],17,-1473231341),o=v(o,h,s,x,c[f+7],22,-45705983),x=v(x,o,h,s,c[f+8],7,1770035416),s=v(s,x,o,h,c[f+9],12,-1958414417),h=v(h,s,x,o,c[f+10],17,-42063),o=v(o,h,s,x,c[f+11],22,-1990404162),x=v(x,o,h,s,c[f+12],7,1804603682),s=v(s,x,o,h,c[f+13],12,-40341101),h=v(h,s,x,o,c[f+14],17,-1502002290),o=v(o,h,s,x,c[f+15],22,1236535329),x=m(x,o,h,s,c[f+1],5,-165796510),s=m(s,x,o,h,c[f+6],9,-1069501632),h=m(h,s,x,o,c[f+11],14,643717713),o=m(o,h,s,x,c[f+0],20,-373897302),x=m(x,o,h,s,c[f+5],5,-701558691),s=m(s,x,o,h,c[f+10],9,38016083),h=m(h,s,x,o,c[f+15],14,-660478335),o=m(o,h,s,x,c[f+4],20,-405537848),x=m(x,o,h,s,c[f+9],5,568446438),s=m(s,x,o,h,c[f+14],9,-1019803690),h=m(h,s,x,o,c[f+3],14,-187363961),o=m(o,h,s,x,c[f+8],20,1163531501),x=m(x,o,h,s,c[f+13],5,-1444681467),s=m(s,x,o,h,c[f+2],9,-51403784),h=m(h,s,x,o,c[f+7],14,1735328473),o=m(o,h,s,x,c[f+12],20,-1926607734),x=C(x,o,h,s,c[f+5],4,-378558),s=C(s,x,o,h,c[f+8],11,-2022574463),h=C(h,s,x,o,c[f+11],16,1839030562),o=C(o,h,s,x,c[f+14],23,-35309556),x=C(x,o,h,s,c[f+1],4,-1530992060),s=C(s,x,o,h,c[f+4],11,1272893353),h=C(h,s,x,o,c[f+7],16,-155497632),o=C(o,h,s,x,c[f+10],23,-1094730640),x=C(x,o,h,s,c[f+13],4,681279174),s=C(s,x,o,h,c[f+0],11,-358537222),h=C(h,s,x,o,c[f+3],16,-722521979),o=C(o,h,s,x,c[f+6],23,76029189),x=C(x,o,h,s,c[f+9],4,-640364487),s=C(s,x,o,h,c[f+12],11,-421815835),h=C(h,s,x,o,c[f+15],16,530742520),o=C(o,h,s,x,c[f+2],23,-995338651),x=_(x,o,h,s,c[f+0],6,-198630844),s=_(s,x,o,h,c[f+7],10,1126891415),h=_(h,s,x,o,c[f+14],15,-1416354905),o=_(o,h,s,x,c[f+5],21,-57434055),x=_(x,o,h,s,c[f+12],6,1700485571),s=_(s,x,o,h,c[f+3],10,-1894986606),h=_(h,s,x,o,c[f+10],15,-1051523),o=_(o,h,s,x,c[f+1],21,-2054922799),x=_(x,o,h,s,c[f+8],6,1873313359),s=_(s,x,o,h,c[f+15],10,-30611744),h=_(h,s,x,o,c[f+6],15,-1560198380),o=_(o,h,s,x,c[f+13],21,1309151649),x=_(x,o,h,s,c[f+4],6,-145523070),s=_(s,x,o,h,c[f+11],10,-1120210379),h=_(h,s,x,o,c[f+2],15,718787259),o=_(o,h,s,x,c[f+9],21,-343485551),x=x+y>>>0,o=o+B>>>0,h=h+b>>>0,s=s+F>>>0}return e.endian([x,o,h,s])};a._ff=function(i,d,c,p,x,o,h){var s=i+(d&c|~d&p)+(x>>>0)+h;return(s<<o|s>>>32-o)+d},a._gg=function(i,d,c,p,x,o,h){var s=i+(d&p|c&~p)+(x>>>0)+h;return(s<<o|s>>>32-o)+d},a._hh=function(i,d,c,p,x,o,h){var s=i+(d^c^p)+(x>>>0)+h;return(s<<o|s>>>32-o)+d},a._ii=function(i,d,c,p,x,o,h){var s=i+(c^(d|~p))+(x>>>0)+h;return(s<<o|s>>>32-o)+d},a._blocksize=16,a._digestsize=16,Ya.exports=function(i,d){if(i==null)throw new Error("Illegal argument "+i);var c=e.wordsToBytes(a(i,d));return d&&d.asBytes?c:d&&d.asString?n.bytesToString(c):e.bytesToHex(c)}})();var Wo=Ya.exports;const jr=Ze(Wo),bt=/^(?:([a-z]+):)?\/{2,3}/i;function jo(e,t){return bt.test(e)}function ti(e,t){return bt.test(t)||(t+="://"),jo(e)?e.replace(bt,t):t+e}function Xo(e){return e.replace(bt,"")}var ri={exports:{}},Xr={exports:{}},ni;function Vo(){return ni||(ni=1,function(e){(function(t){var r={bytesToHex:function(i){return n(i)},hexToBytes:function(i){if(i.length%2===1)throw new Error("hexToBytes can't have a string with an odd number of characters.");return i.indexOf("0x")===0&&(i=i.slice(2)),i.match(/../g).map(function(d){return parseInt(d,16)})}};function n(i){return i.map(function(d){return a(d.toString(16),2)}).join("")}function a(i,d){return i.length>d?i:Array(d-i.length+1).join("0")+i}e.exports?e.exports=r:t.convertHex=r})(G)}(Xr)),Xr.exports}var Vr={exports:{}},ai;function Go(){return ai||(ai=1,function(e){(function(t){var r={bytesToString:function(n){return n.map(function(a){return String.fromCharCode(a)}).join("")},stringToBytes:function(n){return n.split("").map(function(a){return a.charCodeAt(0)})}};r.UTF8={bytesToString:function(n){return decodeURIComponent(escape(r.bytesToString(n)))},stringToBytes:function(n){return r.stringToBytes(unescape(encodeURIComponent(n)))}},e.exports?e.exports=r:t.convertString=r})(G)}(Vr)),Vr.exports}(function(e){(function(t){var r={};e.exports?(r.bytesToHex=Vo().bytesToHex,r.convertString=Go(),e.exports=p):(r.bytesToHex=t.convertHex.bytesToHex,r.convertString=t.convertString,t.sha256=p);var n=[];(function(){function x(f){for(var v=Math.sqrt(f),m=2;m<=v;m++)if(!(f%m))return!1;return!0}function o(f){return(f-(f|0))*4294967296|0}for(var h=2,s=0;s<64;)x(h)&&(n[s]=o(Math.pow(h,1/3)),s++),h++})();var a=function(x){for(var o=[],h=0,s=0;h<x.length;h++,s+=8)o[s>>>5]|=x[h]<<24-s%32;return o},i=function(x){for(var o=[],h=0;h<x.length*32;h+=8)o.push(x[h>>>5]>>>24-h%32&255);return o},d=[],c=function(x,o,h){for(var s=x[0],f=x[1],v=x[2],m=x[3],C=x[4],_=x[5],y=x[6],B=x[7],b=0;b<64;b++){if(b<16)d[b]=o[h+b]|0;else{var F=d[b-15],D=(F<<25|F>>>7)^(F<<14|F>>>18)^F>>>3,T=d[b-2],P=(T<<15|T>>>17)^(T<<13|T>>>19)^T>>>10;d[b]=D+d[b-7]+P+d[b-16]}var H=C&_^~C&y,S=s&f^s&v^f&v,A=(s<<30|s>>>2)^(s<<19|s>>>13)^(s<<10|s>>>22),q=(C<<26|C>>>6)^(C<<21|C>>>11)^(C<<7|C>>>25),N=B+q+H+n[b]+d[b],U=A+S;B=y,y=_,_=C,C=m+N|0,m=v,v=f,f=s,s=N+U|0}x[0]=x[0]+s|0,x[1]=x[1]+f|0,x[2]=x[2]+v|0,x[3]=x[3]+m|0,x[4]=x[4]+C|0,x[5]=x[5]+_|0,x[6]=x[6]+y|0,x[7]=x[7]+B|0};function p(x,o){x.constructor===String&&(x=r.convertString.UTF8.stringToBytes(x));var h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],s=a(x),f=x.length*8;s[f>>5]|=128<<24-f%32,s[(f+64>>9<<4)+15]=f;for(var v=0;v<s.length;v+=16)c(h,s,v);var m=i(h);return o&&o.asBytes?m:o&&o.asString?r.convertString.bytesToString(m):r.bytesToHex(m)}p.x2=function(x,o){return p(p(x,{asBytes:!0}),o)}})(G)})(ri);var Zo=ri.exports;const ii=Ze(Zo);function Yo(e,t,r){const n=Object.keys(e).filter(i=>i!=="sign").sort();let a="";return n.forEach(i=>{let d=e[i];typeof d=="object"&&(d=JSON.stringify(d)),a+=i+d}),r||(r=String(e.signatureMethod).toLowerCase()==="sha256"?"sha256":"md5"),(r==="sha256"?ii:jr)(t+a+t).toString().toUpperCase()}class Qo extends zn{constructor(t){super({baseUrl:ti(Kr(t.config.domainInfo).chatApiDomain,"https"),requestPlugins:[new Un({getTokenInfo:()=>e0(this,null,function*(){const r=yield t.getToken();if(!r)return;let n=de.Params,a="token";const i=yield t.getUserInfo();return t.isSpecialUserType(i.userType)&&(n=de.Header,a="authorization"),{token:r,tokenField:a,tokenMode:n}})}),new rr({globalParams:r=>e0(this,null,function*(){const{appendChannelId:n=!0,appendAccountId:a=!1,appendUserId:i=!0}=r,d={};if(n||a){const c=yield t.getChannelInfo();n&&(d.channelId=c.channelId),a&&(d.accountId=c.accountId)}if(i){const c=yield t.getUserInfo();d.userId=c.userId}return d})}),new Ln({successCode:200}),new rr({globalParams:r=>e0(this,null,function*(){const{appendSign:n=!1}=r;return n?{sign:yield this.getChatSign()}:{}})}),new Va({getDecryptInfo:r=>{const n=r.params||{};return{decryptKeys:{sign:Yo(n,"polyvChatClient"),iv:""},decryptPosition:De.WholeResponse}}})]}),this._plvSocket=t}getChatSign(){return e0(this,null,function*(){const t=yield this._plvSocket.getChannelInfo();return jr(`polyv_room_sign${t.channelId}`)})}}var Qe=(e=>(e.Token="token",e.Sign="sign",e))(Qe||{}),vt=(e=>(e.None="none",e.AES="aes",e.SM2="sm2",e))(vt||{});let yt;const Jo=new Uint8Array(16);function es(){if(!yt&&(yt=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!yt))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return yt(Jo)}const y0=[];for(let e=0;e<256;++e)y0.push((e+256).toString(16).slice(1));function ts(e,t=0){return y0[e[t+0]]+y0[e[t+1]]+y0[e[t+2]]+y0[e[t+3]]+"-"+y0[e[t+4]]+y0[e[t+5]]+"-"+y0[e[t+6]]+y0[e[t+7]]+"-"+y0[e[t+8]]+y0[e[t+9]]+"-"+y0[e[t+10]]+y0[e[t+11]]+y0[e[t+12]]+y0[e[t+13]]+y0[e[t+14]]+y0[e[t+15]]}const xi={randomUUID:typeof crypto!="undefined"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function rs(e,t,r){if(xi.randomUUID&&!e)return xi.randomUUID();e=e||{};const n=e.random||(e.rng||es)();return n[6]=n[6]&15|64,n[8]=n[8]&63|128,ts(n)}var Je;(function(e){e.MD5="MD5",e.SHA256="SHA256"})(Je||(Je={}));function ns(e){let t="";const r=Object.keys(e).sort();for(const n of r)e[n]&&(t+=`${n}${e[n]}`);return t}function as(e,t,r=Je.MD5){const n=ns(e),a=t+n+t;return(r===Je.MD5?jr(a):ii(a)).toUpperCase()}class is{constructor(t){V(this,"__config");V(this,"__appId");V(this,"__appSecret");V(this,"__signatureNonce");V(this,"__signatureMethod");V(this,"__getAppSign");var r,n;this.__config=t,this.__appId=t.appId||"",this.__appSecret=t.appSecret||"",this.__signatureNonce=(r=t.signatureNonce)!=null?r:!1,this.__signatureMethod=(n=t.signatureMethod)!=null?n:Je.MD5,this.__getAppSign=t.getAppSign}usePlugin(t){const{useAppSign:r=!0}=t;return r}interceptIncludeParams(t){const{signatureNonce:r=this.__signatureNonce,signatureMethod:n=this.__signatureMethod}=t,a={};return r&&(a.signatureNonce=rs()),n&&(a.signatureMethod=n),a}interceptAuthorizeRequest(t){return e0(this,null,function*(){const r=i0({},t.params||{}),n=yield this.__getAppSignData(r,t);return n?(r.appId=n.appId,r.timestamp=n.timestamp,r.sign=n.sign,n.signatureMethod&&(r.signatureMethod=n.signatureMethod)):console.error("AuthorizeAppSignRequestPlugin error, signData is undefined"),Y0(i0({},t),{params:r})})}__getAppSignData(t,r){return e0(this,null,function*(){const{signatureMethod:n=this.__signatureMethod}=r;if(this.__getAppSign)return yield this.__getAppSign({params:t,signatureMethod:n});if(this.__appId&&this.__appSecret){const a=Date.now(),i=Y0(i0({},t),{appId:this.__appId,timestamp:a}),d=as(i,this.__appSecret,n);return{appId:this.__appId,timestamp:a,sign:d,signatureMethod:n}}})}}const xs=V0("S0xmTzdabmZRQzhqSXZFWA=="),os=V0("VlRSZTdTbWRsbFJzSjdDYg=="),ss=V0("UG9seXZBcGlSZXNwb25zZQ=="),cs=V0("UG9seXZMaXZlRW5jcnlwdA==");function fs(e,t){const{sign:r,iv:n}=t,a=R0.enc.Utf8.parse(r),i=R0.enc.Utf8.parse(e);return R0.AES.encrypt(i,a,{iv:R0.enc.Utf8.parse(n),mode:R0.mode.CBC,padding:R0.pad.Pkcs7}).toString()}class ds{constructor(t={}){V(this,"__config");V(this,"__encryptPostAES");var r;this.__config=t,this.__encryptPostAES=(r=t.encryptPostAES)!=null?r:!0}usePlugin(t){const{useAES:r=!0}=t;return r}interceptIncludeParams(){return{encryptResponseType:1}}interceptEncryptRequest(t){const r=this.__handleData(t),n=this.__handleHeaders(t);return Y0(i0({},t),{data:r,headers:n})}interceptDecryptResponse(t){const r=t.data;if(!r.encryption||typeof r.data!="string")return t;const n=r.data,a=this.__getDecryptKeyInfo();return r.data=$r(n,a,we.Base64),t}__handleHeaders(t){var a;const r=t.headers||{},{encryptPostAES:n=this.__encryptPostAES}=t;return((a=t.method)==null?void 0:a.toLocaleUpperCase())==="POST"&&n&&(r["x-e-type"]=1),r}__handleData(t){var i;const r=t.data||{};if(((i=t.method)==null?void 0:i.toLocaleUpperCase())!=="POST")return r;let n=r;const{encryptPostAES:a=this.__encryptPostAES}=t;if(a){t.requestType="json";let d="";typeof r=="string"?d=r:typeof r=="object"&&(d=JSON.stringify(r));const c=this.__getEncryptKeyInfo(t);n=fs(d,c)}return n}__getDecryptKeyInfo(){return{sign:ss,iv:cs}}__getEncryptKeyInfo(t){const r=t.params||{};let n=xs;return"appId"in r&&r.appId===this.__config.appId&&this.__config.appSecret&&(n=this.__config.appSecret),{sign:n,iv:os}}}var oi={exports:{}};(function(e,t){(function(){var r,n=0xdeadbeefcafe,a=(n&16777215)==15715070;function i(u,l,g){u!=null&&(typeof u=="number"?this.fromNumber(u,l,g):l==null&&typeof u!="string"?this.fromString(u,256):this.fromString(u,l))}function d(){return new i(null)}function c(u,l,g,R,M,z){for(;--z>=0;){var $=l*this[u++]+g[R]+M;M=Math.floor($/67108864),g[R++]=$&67108863}return M}function p(u,l,g,R,M,z){for(var $=l&32767,K=l>>15;--z>=0;){var c0=this[u]&32767,b0=this[u++]>>15,q0=K*c0+b0*$;c0=$*c0+((q0&32767)<<15)+g[R]+(M&1073741823),M=(c0>>>30)+(q0>>>15)+K*b0+(M>>>30),g[R++]=c0&1073741823}return M}function x(u,l,g,R,M,z){for(var $=l&16383,K=l>>14;--z>=0;){var c0=this[u]&16383,b0=this[u++]>>14,q0=K*c0+b0*$;c0=$*c0+((q0&16383)<<14)+g[R]+M,M=(c0>>28)+(q0>>14)+K*b0,g[R++]=c0&268435455}return M}var o=typeof navigator!="undefined";o&&a&&navigator.appName=="Microsoft Internet Explorer"?(i.prototype.am=p,r=30):o&&a&&navigator.appName!="Netscape"?(i.prototype.am=c,r=26):(i.prototype.am=x,r=28),i.prototype.DB=r,i.prototype.DM=(1<<r)-1,i.prototype.DV=1<<r;var h=52;i.prototype.FV=Math.pow(2,h),i.prototype.F1=h-r,i.prototype.F2=2*r-h;var s="0123456789abcdefghijklmnopqrstuvwxyz",f=new Array,v,m;for(v=48,m=0;m<=9;++m)f[v++]=m;for(v=97,m=10;m<36;++m)f[v++]=m;for(v=65,m=10;m<36;++m)f[v++]=m;function C(u){return s.charAt(u)}function _(u,l){var g=f[u.charCodeAt(l)];return g==null?-1:g}function y(u){for(var l=this.t-1;l>=0;--l)u[l]=this[l];u.t=this.t,u.s=this.s}function B(u){this.t=1,this.s=u<0?-1:0,u>0?this[0]=u:u<-1?this[0]=u+this.DV:this.t=0}function b(u){var l=d();return l.fromInt(u),l}function F(u,l){var g;if(l==16)g=4;else if(l==8)g=3;else if(l==256)g=8;else if(l==2)g=1;else if(l==32)g=5;else if(l==4)g=2;else{this.fromRadix(u,l);return}this.t=0,this.s=0;for(var R=u.length,M=!1,z=0;--R>=0;){var $=g==8?u[R]&255:_(u,R);if($<0){u.charAt(R)=="-"&&(M=!0);continue}M=!1,z==0?this[this.t++]=$:z+g>this.DB?(this[this.t-1]|=($&(1<<this.DB-z)-1)<<z,this[this.t++]=$>>this.DB-z):this[this.t-1]|=$<<z,z+=g,z>=this.DB&&(z-=this.DB)}g==8&&u[0]&128&&(this.s=-1,z>0&&(this[this.t-1]|=(1<<this.DB-z)-1<<z)),this.clamp(),M&&i.ZERO.subTo(this,this)}function D(){for(var u=this.s&this.DM;this.t>0&&this[this.t-1]==u;)--this.t}function T(u){if(this.s<0)return"-"+this.negate().toString(u);var l;if(u==16)l=4;else if(u==8)l=3;else if(u==2)l=1;else if(u==32)l=5;else if(u==4)l=2;else return this.toRadix(u);var g=(1<<l)-1,R,M=!1,z="",$=this.t,K=this.DB-$*this.DB%l;if($-- >0)for(K<this.DB&&(R=this[$]>>K)>0&&(M=!0,z=C(R));$>=0;)K<l?(R=(this[$]&(1<<K)-1)<<l-K,R|=this[--$]>>(K+=this.DB-l)):(R=this[$]>>(K-=l)&g,K<=0&&(K+=this.DB,--$)),R>0&&(M=!0),M&&(z+=C(R));return M?z:"0"}function P(){var u=d();return i.ZERO.subTo(this,u),u}function H(){return this.s<0?this.negate():this}function S(u){var l=this.s-u.s;if(l!=0)return l;var g=this.t;if(l=g-u.t,l!=0)return this.s<0?-l:l;for(;--g>=0;)if((l=this[g]-u[g])!=0)return l;return 0}function A(u){var l=1,g;return(g=u>>>16)!=0&&(u=g,l+=16),(g=u>>8)!=0&&(u=g,l+=8),(g=u>>4)!=0&&(u=g,l+=4),(g=u>>2)!=0&&(u=g,l+=2),(g=u>>1)!=0&&(u=g,l+=1),l}function q(){return this.t<=0?0:this.DB*(this.t-1)+A(this[this.t-1]^this.s&this.DM)}function N(u,l){var g;for(g=this.t-1;g>=0;--g)l[g+u]=this[g];for(g=u-1;g>=0;--g)l[g]=0;l.t=this.t+u,l.s=this.s}function U(u,l){for(var g=u;g<this.t;++g)l[g-u]=this[g];l.t=Math.max(this.t-u,0),l.s=this.s}function L(u,l){var g=u%this.DB,R=this.DB-g,M=(1<<R)-1,z=Math.floor(u/this.DB),$=this.s<<g&this.DM,K;for(K=this.t-1;K>=0;--K)l[K+z+1]=this[K]>>R|$,$=(this[K]&M)<<g;for(K=z-1;K>=0;--K)l[K]=0;l[z]=$,l.t=this.t+z+1,l.s=this.s,l.clamp()}function X(u,l){l.s=this.s;var g=Math.floor(u/this.DB);if(g>=this.t){l.t=0;return}var R=u%this.DB,M=this.DB-R,z=(1<<R)-1;l[0]=this[g]>>R;for(var $=g+1;$<this.t;++$)l[$-g-1]|=(this[$]&z)<<M,l[$-g]=this[$]>>R;R>0&&(l[this.t-g-1]|=(this.s&z)<<M),l.t=this.t-g,l.clamp()}function Y(u,l){for(var g=0,R=0,M=Math.min(u.t,this.t);g<M;)R+=this[g]-u[g],l[g++]=R&this.DM,R>>=this.DB;if(u.t<this.t){for(R-=u.s;g<this.t;)R+=this[g],l[g++]=R&this.DM,R>>=this.DB;R+=this.s}else{for(R+=this.s;g<u.t;)R-=u[g],l[g++]=R&this.DM,R>>=this.DB;R-=u.s}l.s=R<0?-1:0,R<-1?l[g++]=this.DV+R:R>0&&(l[g++]=R),l.t=g,l.clamp()}function r0(u,l){var g=this.abs(),R=u.abs(),M=g.t;for(l.t=M+R.t;--M>=0;)l[M]=0;for(M=0;M<R.t;++M)l[M+g.t]=g.am(0,R[M],l,M,0,g.t);l.s=0,l.clamp(),this.s!=u.s&&i.ZERO.subTo(l,l)}function x0(u){for(var l=this.abs(),g=u.t=2*l.t;--g>=0;)u[g]=0;for(g=0;g<l.t-1;++g){var R=l.am(g,l[g],u,2*g,0,1);(u[g+l.t]+=l.am(g+1,2*l[g],u,2*g+1,R,l.t-g-1))>=l.DV&&(u[g+l.t]-=l.DV,u[g+l.t+1]=1)}u.t>0&&(u[u.t-1]+=l.am(g,l[g],u,2*g,0,1)),u.s=0,u.clamp()}function a0(u,l,g){var R=u.abs();if(!(R.t<=0)){var M=this.abs();if(M.t<R.t){l!=null&&l.fromInt(0),g!=null&&this.copyTo(g);return}g==null&&(g=d());var z=d(),$=this.s,K=u.s,c0=this.DB-A(R[R.t-1]);c0>0?(R.lShiftTo(c0,z),M.lShiftTo(c0,g)):(R.copyTo(z),M.copyTo(g));var b0=z.t,q0=z[b0-1];if(q0!=0){var k0=q0*(1<<this.F1)+(b0>1?z[b0-2]>>this.F2:0),Z0=this.FV/k0,Zt=(1<<this.F1)/k0,U0=1<<this.F2,L0=g.t,Yt=L0-b0,fe=l==null?d():l;for(z.dlShiftTo(Yt,fe),g.compareTo(fe)>=0&&(g[g.t++]=1,g.subTo(fe,g)),i.ONE.dlShiftTo(b0,fe),fe.subTo(z,z);z.t<b0;)z[z.t++]=0;for(;--Yt>=0;){var qn=g[--L0]==q0?this.DM:Math.floor(g[L0]*Z0+(g[L0-1]+U0)*Zt);if((g[L0]+=z.am(0,qn,g,Yt,0,b0))<qn)for(z.dlShiftTo(Yt,fe),g.subTo(fe,g);g[L0]<--qn;)g.subTo(fe,g)}l!=null&&(g.drShiftTo(b0,l),$!=K&&i.ZERO.subTo(l,l)),g.t=b0,g.clamp(),c0>0&&g.rShiftTo(c0,g),$<0&&i.ZERO.subTo(g,g)}}}function E(u){var l=d();return this.abs().divRemTo(u,null,l),this.s<0&&l.compareTo(i.ZERO)>0&&u.subTo(l,l),l}function w(u){this.m=u}function I(u){return u.s<0||u.compareTo(this.m)>=0?u.mod(this.m):u}function k(u){return u}function O(u){u.divRemTo(this.m,null,u)}function W(u,l,g){u.multiplyTo(l,g),this.reduce(g)}function t0(u,l){u.squareTo(l),this.reduce(l)}w.prototype.convert=I,w.prototype.revert=k,w.prototype.reduce=O,w.prototype.mulTo=W,w.prototype.sqrTo=t0;function j(){if(this.t<1)return 0;var u=this[0];if(!(u&1))return 0;var l=u&3;return l=l*(2-(u&15)*l)&15,l=l*(2-(u&255)*l)&255,l=l*(2-((u&65535)*l&65535))&65535,l=l*(2-u*l%this.DV)%this.DV,l>0?this.DV-l:-l}function o0(u){this.m=u,this.mp=u.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<u.DB-15)-1,this.mt2=2*u.t}function g0(u){var l=d();return u.abs().dlShiftTo(this.m.t,l),l.divRemTo(this.m,null,l),u.s<0&&l.compareTo(i.ZERO)>0&&this.m.subTo(l,l),l}function F0(u){var l=d();return u.copyTo(l),this.reduce(l),l}function ye(u){for(;u.t<=this.mt2;)u[u.t++]=0;for(var l=0;l<this.m.t;++l){var g=u[l]&32767,R=g*this.mpl+((g*this.mph+(u[l]>>15)*this.mpl&this.um)<<15)&u.DM;for(g=l+this.m.t,u[g]+=this.m.am(0,R,u,l,0,this.m.t);u[g]>=u.DV;)u[g]-=u.DV,u[++g]++}u.clamp(),u.drShiftTo(this.m.t,u),u.compareTo(this.m)>=0&&u.subTo(this.m,u)}function w0(u,l){u.squareTo(l),this.reduce(l)}function C0(u,l,g){u.multiplyTo(l,g),this.reduce(g)}o0.prototype.convert=g0,o0.prototype.revert=F0,o0.prototype.reduce=ye,o0.prototype.mulTo=C0,o0.prototype.sqrTo=w0;function We(){return(this.t>0?this[0]&1:this.s)==0}function ge(u,l){if(u>4294967295||u<1)return i.ONE;var g=d(),R=d(),M=l.convert(this),z=A(u)-1;for(M.copyTo(g);--z>=0;)if(l.sqrTo(g,R),(u&1<<z)>0)l.mulTo(R,M,g);else{var $=g;g=R,R=$}return l.revert(g)}function je(u,l){var g;return u<256||l.isEven()?g=new w(l):g=new o0(l),this.exp(u,g)}i.prototype.copyTo=y,i.prototype.fromInt=B,i.prototype.fromString=F,i.prototype.clamp=D,i.prototype.dlShiftTo=N,i.prototype.drShiftTo=U,i.prototype.lShiftTo=L,i.prototype.rShiftTo=X,i.prototype.subTo=Y,i.prototype.multiplyTo=r0,i.prototype.squareTo=x0,i.prototype.divRemTo=a0,i.prototype.invDigit=j,i.prototype.isEven=We,i.prototype.exp=ge,i.prototype.toString=T,i.prototype.negate=P,i.prototype.abs=H,i.prototype.compareTo=S,i.prototype.bitLength=q,i.prototype.mod=E,i.prototype.modPowInt=je,i.ZERO=b(0),i.ONE=b(1);function me(){var u=d();return this.copyTo(u),u}function xt(){if(this.s<0){if(this.t==1)return this[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this[0];if(this.t==0)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]}function Be(){return this.t==0?this.s:this[0]<<24>>24}function S0(){return this.t==0?this.s:this[0]<<16>>16}function A0(u){return Math.floor(Math.LN2*this.DB/Math.log(u))}function W0(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}function Xe(u){if(u==null&&(u=10),this.signum()==0||u<2||u>36)return"0";var l=this.chunkSize(u),g=Math.pow(u,l),R=b(g),M=d(),z=d(),$="";for(this.divRemTo(R,M,z);M.signum()>0;)$=(g+z.intValue()).toString(u).substr(1)+$,M.divRemTo(R,M,z);return z.intValue().toString(u)+$}function Nt(u,l){this.fromInt(0),l==null&&(l=10);for(var g=this.chunkSize(l),R=Math.pow(l,g),M=!1,z=0,$=0,K=0;K<u.length;++K){var c0=_(u,K);if(c0<0){u.charAt(K)=="-"&&this.signum()==0&&(M=!0);continue}$=l*$+c0,++z>=g&&(this.dMultiply(R),this.dAddOffset($,0),z=0,$=0)}z>0&&(this.dMultiply(Math.pow(l,z)),this.dAddOffset($,0)),M&&i.ZERO.subTo(this,this)}function se(u,l,g){if(typeof l=="number")if(u<2)this.fromInt(1);else for(this.fromNumber(u,g),this.testBit(u-1)||this.bitwiseTo(i.ONE.shiftLeft(u-1),Ve,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(l);)this.dAddOffset(2,0),this.bitLength()>u&&this.subTo(i.ONE.shiftLeft(u-1),this);else{var R=new Array,M=u&7;R.length=(u>>3)+1,l.nextBytes(R),M>0?R[0]&=(1<<M)-1:R[0]=0,this.fromString(R,256)}}function Ce(){var u=this.t,l=new Array;l[0]=this.s;var g=this.DB-u*this.DB%8,R,M=0;if(u-- >0)for(g<this.DB&&(R=this[u]>>g)!=(this.s&this.DM)>>g&&(l[M++]=R|this.s<<this.DB-g);u>=0;)g<8?(R=(this[u]&(1<<g)-1)<<8-g,R|=this[--u]>>(g+=this.DB-8)):(R=this[u]>>(g-=8)&255,g<=0&&(g+=this.DB,--u)),R&128&&(R|=-256),M==0&&(this.s&128)!=(R&128)&&++M,(M>0||R!=this.s)&&(l[M++]=R);return l}function Bn(u){return this.compareTo(u)==0}function Mt(u){return this.compareTo(u)<0?this:u}function zt(u){return this.compareTo(u)>0?this:u}function ce(u,l,g){var R,M,z=Math.min(u.t,this.t);for(R=0;R<z;++R)g[R]=l(this[R],u[R]);if(u.t<this.t){for(M=u.s&this.DM,R=z;R<this.t;++R)g[R]=l(this[R],M);g.t=this.t}else{for(M=this.s&this.DM,R=z;R<u.t;++R)g[R]=l(M,u[R]);g.t=u.t}g.s=l(this.s,u.s),g.clamp()}function Ee(u,l){return u&l}function Cn(u){var l=d();return this.bitwiseTo(u,Ee,l),l}function Ve(u,l){return u|l}function Ut(u){var l=d();return this.bitwiseTo(u,Ve,l),l}function Lt(u,l){return u^l}function En(u){var l=d();return this.bitwiseTo(u,Lt,l),l}function ot(u,l){return u&~l}function _n(u){var l=d();return this.bitwiseTo(u,ot,l),l}function $t(){for(var u=d(),l=0;l<this.t;++l)u[l]=this.DM&~this[l];return u.t=this.t,u.s=~this.s,u}function Fn(u){var l=d();return u<0?this.rShiftTo(-u,l):this.lShiftTo(u,l),l}function Kt(u){var l=d();return u<0?this.lShiftTo(-u,l):this.rShiftTo(u,l),l}function An(u){if(u==0)return-1;var l=0;return u&65535||(u>>=16,l+=16),u&255||(u>>=8,l+=8),u&15||(u>>=4,l+=4),u&3||(u>>=2,l+=2),u&1||++l,l}function Dn(){for(var u=0;u<this.t;++u)if(this[u]!=0)return u*this.DB+An(this[u]);return this.s<0?this.t*this.DB:-1}function wn(u){for(var l=0;u!=0;)u&=u-1,++l;return l}function Wt(){for(var u=0,l=this.s&this.DM,g=0;g<this.t;++g)u+=wn(this[g]^l);return u}function Sn(u){var l=Math.floor(u/this.DB);return l>=this.t?this.s!=0:(this[l]&1<<u%this.DB)!=0}function Tn(u,l){var g=i.ONE.shiftLeft(u);return this.bitwiseTo(g,l,g),g}function jt(u){return this.changeBit(u,Ve)}function kn(u){return this.changeBit(u,ot)}function Xt(u){return this.changeBit(u,Lt)}function E0(u,l){for(var g=0,R=0,M=Math.min(u.t,this.t);g<M;)R+=this[g]+u[g],l[g++]=R&this.DM,R>>=this.DB;if(u.t<this.t){for(R+=u.s;g<this.t;)R+=this[g],l[g++]=R&this.DM,R>>=this.DB;R+=this.s}else{for(R+=this.s;g<u.t;)R+=u[g],l[g++]=R&this.DM,R>>=this.DB;R+=u.s}l.s=R<0?-1:0,R>0?l[g++]=R:R<-1&&(l[g++]=this.DV+R),l.t=g,l.clamp()}function j0(u){var l=d();return this.addTo(u,l),l}function Vt(u){var l=d();return this.subTo(u,l),l}function Rn(u){var l=d();return this.multiplyTo(u,l),l}function Lf(){var u=d();return this.squareTo(u),u}function $f(u){var l=d();return this.divRemTo(u,l,null),l}function Kf(u){var l=d();return this.divRemTo(u,null,l),l}function Wf(u){var l=d(),g=d();return this.divRemTo(u,l,g),new Array(l,g)}function jf(u){this[this.t]=this.am(0,u-1,this,0,0,this.t),++this.t,this.clamp()}function Xf(u,l){if(u!=0){for(;this.t<=l;)this[this.t++]=0;for(this[l]+=u;this[l]>=this.DV;)this[l]-=this.DV,++l>=this.t&&(this[this.t++]=0),++this[l]}}function st(){}function hx(u){return u}function Vf(u,l,g){u.multiplyTo(l,g)}function Gf(u,l){u.squareTo(l)}st.prototype.convert=hx,st.prototype.revert=hx,st.prototype.mulTo=Vf,st.prototype.sqrTo=Gf;function Zf(u){return this.exp(u,new st)}function Yf(u,l,g){var R=Math.min(this.t+u.t,l);for(g.s=0,g.t=R;R>0;)g[--R]=0;var M;for(M=g.t-this.t;R<M;++R)g[R+this.t]=this.am(0,u[R],g,R,0,this.t);for(M=Math.min(u.t,l);R<M;++R)this.am(0,u[R],g,R,0,l-R);g.clamp()}function Qf(u,l,g){--l;var R=g.t=this.t+u.t-l;for(g.s=0;--R>=0;)g[R]=0;for(R=Math.max(l-this.t,0);R<u.t;++R)g[this.t+R-l]=this.am(l-R,u[R],g,0,0,this.t+R-l);g.clamp(),g.drShiftTo(1,g)}function _e(u){this.r2=d(),this.q3=d(),i.ONE.dlShiftTo(2*u.t,this.r2),this.mu=this.r2.divide(u),this.m=u}function Jf(u){if(u.s<0||u.t>2*this.m.t)return u.mod(this.m);if(u.compareTo(this.m)<0)return u;var l=d();return u.copyTo(l),this.reduce(l),l}function e1(u){return u}function t1(u){for(u.drShiftTo(this.m.t-1,this.r2),u.t>this.m.t+1&&(u.t=this.m.t+1,u.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);u.compareTo(this.r2)<0;)u.dAddOffset(1,this.m.t+1);for(u.subTo(this.r2,u);u.compareTo(this.m)>=0;)u.subTo(this.m,u)}function r1(u,l){u.squareTo(l),this.reduce(l)}function n1(u,l,g){u.multiplyTo(l,g),this.reduce(g)}_e.prototype.convert=Jf,_e.prototype.revert=e1,_e.prototype.reduce=t1,_e.prototype.mulTo=n1,_e.prototype.sqrTo=r1;function a1(u,l){var g=u.bitLength(),R,M=b(1),z;if(g<=0)return M;g<18?R=1:g<48?R=3:g<144?R=4:g<768?R=5:R=6,g<8?z=new w(l):l.isEven()?z=new _e(l):z=new o0(l);var $=new Array,K=3,c0=R-1,b0=(1<<R)-1;if($[1]=z.convert(this),R>1){var q0=d();for(z.sqrTo($[1],q0);K<=b0;)$[K]=d(),z.mulTo(q0,$[K-2],$[K]),K+=2}var k0=u.t-1,Z0,Zt=!0,U0=d(),L0;for(g=A(u[k0])-1;k0>=0;){for(g>=c0?Z0=u[k0]>>g-c0&b0:(Z0=(u[k0]&(1<<g+1)-1)<<c0-g,k0>0&&(Z0|=u[k0-1]>>this.DB+g-c0)),K=R;!(Z0&1);)Z0>>=1,--K;if((g-=K)<0&&(g+=this.DB,--k0),Zt)$[Z0].copyTo(M),Zt=!1;else{for(;K>1;)z.sqrTo(M,U0),z.sqrTo(U0,M),K-=2;K>0?z.sqrTo(M,U0):(L0=M,M=U0,U0=L0),z.mulTo(U0,$[Z0],M)}for(;k0>=0&&!(u[k0]&1<<g);)z.sqrTo(M,U0),L0=M,M=U0,U0=L0,--g<0&&(g=this.DB-1,--k0)}return z.revert(M)}function i1(u){var l=this.s<0?this.negate():this.clone(),g=u.s<0?u.negate():u.clone();if(l.compareTo(g)<0){var R=l;l=g,g=R}var M=l.getLowestSetBit(),z=g.getLowestSetBit();if(z<0)return l;for(M<z&&(z=M),z>0&&(l.rShiftTo(z,l),g.rShiftTo(z,g));l.signum()>0;)(M=l.getLowestSetBit())>0&&l.rShiftTo(M,l),(M=g.getLowestSetBit())>0&&g.rShiftTo(M,g),l.compareTo(g)>=0?(l.subTo(g,l),l.rShiftTo(1,l)):(g.subTo(l,g),g.rShiftTo(1,g));return z>0&&g.lShiftTo(z,g),g}function x1(u){if(u<=0)return 0;var l=this.DV%u,g=this.s<0?u-1:0;if(this.t>0)if(l==0)g=this[0]%u;else for(var R=this.t-1;R>=0;--R)g=(l*g+this[R])%u;return g}function o1(u){var l=u.isEven();if(this.isEven()&&l||u.signum()==0)return i.ZERO;for(var g=u.clone(),R=this.clone(),M=b(1),z=b(0),$=b(0),K=b(1);g.signum()!=0;){for(;g.isEven();)g.rShiftTo(1,g),l?((!M.isEven()||!z.isEven())&&(M.addTo(this,M),z.subTo(u,z)),M.rShiftTo(1,M)):z.isEven()||z.subTo(u,z),z.rShiftTo(1,z);for(;R.isEven();)R.rShiftTo(1,R),l?((!$.isEven()||!K.isEven())&&($.addTo(this,$),K.subTo(u,K)),$.rShiftTo(1,$)):K.isEven()||K.subTo(u,K),K.rShiftTo(1,K);g.compareTo(R)>=0?(g.subTo(R,g),l&&M.subTo($,M),z.subTo(K,z)):(R.subTo(g,R),l&&$.subTo(M,$),K.subTo(z,K))}if(R.compareTo(i.ONE)!=0)return i.ZERO;if(K.compareTo(u)>=0)return K.subtract(u);if(K.signum()<0)K.addTo(u,K);else return K;return K.signum()<0?K.add(u):K}var _0=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],s1=(1<<26)/_0[_0.length-1];function c1(u){var l,g=this.abs();if(g.t==1&&g[0]<=_0[_0.length-1]){for(l=0;l<_0.length;++l)if(g[0]==_0[l])return!0;return!1}if(g.isEven())return!1;for(l=1;l<_0.length;){for(var R=_0[l],M=l+1;M<_0.length&&R<s1;)R*=_0[M++];for(R=g.modInt(R);l<M;)if(R%_0[l++]==0)return!1}return g.millerRabin(u)}function f1(u){var l=this.subtract(i.ONE),g=l.getLowestSetBit();if(g<=0)return!1;var R=l.shiftRight(g);u=u+1>>1,u>_0.length&&(u=_0.length);for(var M=d(),z=0;z<u;++z){M.fromInt(_0[Math.floor(Math.random()*_0.length)]);var $=M.modPow(R,this);if($.compareTo(i.ONE)!=0&&$.compareTo(l)!=0){for(var K=1;K++<g&&$.compareTo(l)!=0;)if($=$.modPowInt(2,this),$.compareTo(i.ONE)==0)return!1;if($.compareTo(l)!=0)return!1}}return!0}i.prototype.chunkSize=A0,i.prototype.toRadix=Xe,i.prototype.fromRadix=Nt,i.prototype.fromNumber=se,i.prototype.bitwiseTo=ce,i.prototype.changeBit=Tn,i.prototype.addTo=E0,i.prototype.dMultiply=jf,i.prototype.dAddOffset=Xf,i.prototype.multiplyLowerTo=Yf,i.prototype.multiplyUpperTo=Qf,i.prototype.modInt=x1,i.prototype.millerRabin=f1,i.prototype.clone=me,i.prototype.intValue=xt,i.prototype.byteValue=Be,i.prototype.shortValue=S0,i.prototype.signum=W0,i.prototype.toByteArray=Ce,i.prototype.equals=Bn,i.prototype.min=Mt,i.prototype.max=zt,i.prototype.and=Cn,i.prototype.or=Ut,i.prototype.xor=En,i.prototype.andNot=_n,i.prototype.not=$t,i.prototype.shiftLeft=Fn,i.prototype.shiftRight=Kt,i.prototype.getLowestSetBit=Dn,i.prototype.bitCount=Wt,i.prototype.testBit=Sn,i.prototype.setBit=jt,i.prototype.clearBit=kn,i.prototype.flipBit=Xt,i.prototype.add=j0,i.prototype.subtract=Vt,i.prototype.multiply=Rn,i.prototype.divide=$f,i.prototype.remainder=Kf,i.prototype.divideAndRemainder=Wf,i.prototype.modPow=a1,i.prototype.modInverse=o1,i.prototype.pow=Zf,i.prototype.gcd=i1,i.prototype.isProbablePrime=c1,i.prototype.square=Lf,i.prototype.Barrett=_e;var Gt,T0,p0;function d1(u){T0[p0++]^=u&255,T0[p0++]^=u>>8&255,T0[p0++]^=u>>16&255,T0[p0++]^=u>>24&255,p0>=In&&(p0-=In)}function lx(){d1(new Date().getTime())}if(T0==null){T0=new Array,p0=0;var z0;if(typeof window!="undefined"&&window.crypto){if(window.crypto.getRandomValues){var px=new Uint8Array(32);for(window.crypto.getRandomValues(px),z0=0;z0<32;++z0)T0[p0++]=px[z0]}else if(navigator.appName=="Netscape"&&navigator.appVersion<"5"){var bx=window.crypto.random(32);for(z0=0;z0<bx.length;++z0)T0[p0++]=bx.charCodeAt(z0)&255}}for(;p0<In;)z0=Math.floor(65536*Math.random()),T0[p0++]=z0>>>8,T0[p0++]=z0&255;p0=0,lx()}function u1(){if(Gt==null){for(lx(),Gt=b1(),Gt.init(T0),p0=0;p0<T0.length;++p0)T0[p0]=0;p0=0}return Gt.next()}function h1(u){var l;for(l=0;l<u.length;++l)u[l]=u1()}function vx(){}vx.prototype.nextBytes=h1;function Pn(){this.i=0,this.j=0,this.S=new Array}function l1(u){var l,g,R;for(l=0;l<256;++l)this.S[l]=l;for(g=0,l=0;l<256;++l)g=g+this.S[l]+u[l%u.length]&255,R=this.S[l],this.S[l]=this.S[g],this.S[g]=R;this.i=0,this.j=0}function p1(){var u;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,u=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=u,this.S[u+this.S[this.i]&255]}Pn.prototype.init=l1,Pn.prototype.next=p1;function b1(){return new Pn}var In=256;e.exports={default:i,BigInteger:i,SecureRandom:vx}}).call(G)})(oi);var gt=oi.exports;const{BigInteger:ke}=gt;function us(e){let t=e.toString(16);if(t[0]!=="-")t.length%2===1?t="0"+t:t.match(/^[0-7]/)||(t="00"+t);else{t=t.substr(1);let r=t.length;r%2===1?r+=1:t.match(/^[0-7]/)||(r+=2);let n="";for(let a=0;a<r;a++)n+="f";n=new ke(n,16),t=n.xor(e).add(ke.ONE),t=t.toString(16).replace(/^-/,"")}return t}class si{constructor(){this.tlv=null,this.t="00",this.l="00",this.v=""}getEncodedHex(){return this.tlv||(this.v=this.getValue(),this.l=this.getLength(),this.tlv=this.t+this.l+this.v),this.tlv}getLength(){const t=this.v.length/2;let r=t.toString(16);return r.length%2===1&&(r="0"+r),t<128?r:(128+r.length/2).toString(16)+r}getValue(){return""}}class ci extends si{constructor(t){super(),this.t="02",t&&(this.v=us(t))}getValue(){return this.v}}class hs extends si{constructor(t){super(),this.t="30",this.asn1Array=t}getValue(){return this.v=this.asn1Array.map(t=>t.getEncodedHex()).join(""),this.v}}function fi(e,t){return+e[t+2]<8?1:+e.substr(t+2,2)&128}function di(e,t){const r=fi(e,t),n=e.substr(t+2,r*2);return n?(+n[0]<8?new ke(n,16):new ke(n.substr(2),16)).intValue():-1}function Gr(e,t){const r=fi(e,t);return t+(r+1)*2}var ls={encodeDer(e,t){const r=new ci(e),n=new ci(t);return new hs([r,n]).getEncodedHex()},decodeDer(e){const t=Gr(e,0),r=Gr(e,t),n=di(e,t),a=e.substr(r,n*2),i=r+a.length,d=Gr(e,i),c=di(e,i),p=e.substr(d,c*2),x=new ke(a,16),o=new ke(p,16);return{r:x,s:o}}};const{BigInteger:B0}=gt,ui=new B0("2"),hi=new B0("3");class te{constructor(t,r){this.x=r,this.q=t}equals(t){return t===this?!0:this.q.equals(t.q)&&this.x.equals(t.x)}toBigInteger(){return this.x}negate(){return new te(this.q,this.x.negate().mod(this.q))}add(t){return new te(this.q,this.x.add(t.toBigInteger()).mod(this.q))}subtract(t){return new te(this.q,this.x.subtract(t.toBigInteger()).mod(this.q))}multiply(t){return new te(this.q,this.x.multiply(t.toBigInteger()).mod(this.q))}divide(t){return new te(this.q,this.x.multiply(t.toBigInteger().modInverse(this.q)).mod(this.q))}square(){return new te(this.q,this.x.square().mod(this.q))}}class le{constructor(t,r,n,a){this.curve=t,this.x=r,this.y=n,this.z=a==null?B0.ONE:a,this.zinv=null}getX(){return this.zinv===null&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.x.toBigInteger().multiply(this.zinv).mod(this.curve.q))}getY(){return this.zinv===null&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.y.toBigInteger().multiply(this.zinv).mod(this.curve.q))}equals(t){return t===this?!0:this.isInfinity()?t.isInfinity():t.isInfinity()?this.isInfinity():t.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(t.z)).mod(this.curve.q).equals(B0.ZERO)?t.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(t.z)).mod(this.curve.q).equals(B0.ZERO):!1}isInfinity(){return this.x===null&&this.y===null?!0:this.z.equals(B0.ZERO)&&!this.y.toBigInteger().equals(B0.ZERO)}negate(){return new le(this.curve,this.x,this.y.negate(),this.z)}add(t){if(this.isInfinity())return t;if(t.isInfinity())return this;const r=this.x.toBigInteger(),n=this.y.toBigInteger(),a=this.z,i=t.x.toBigInteger(),d=t.y.toBigInteger(),c=t.z,p=this.curve.q,x=r.multiply(c).mod(p),o=i.multiply(a).mod(p),h=x.subtract(o),s=n.multiply(c).mod(p),f=d.multiply(a).mod(p),v=s.subtract(f);if(B0.ZERO.equals(h))return B0.ZERO.equals(v)?this.twice():this.curve.infinity;const m=x.add(o),C=a.multiply(c).mod(p),_=h.square().mod(p),y=h.multiply(_).mod(p),B=C.multiply(v.square()).subtract(m.multiply(_)).mod(p),b=h.multiply(B).mod(p),F=v.multiply(_.multiply(x).subtract(B)).subtract(s.multiply(y)).mod(p),D=y.multiply(C).mod(p);return new le(this.curve,this.curve.fromBigInteger(b),this.curve.fromBigInteger(F),D)}twice(){if(this.isInfinity())return this;if(!this.y.toBigInteger().signum())return this.curve.infinity;const t=this.x.toBigInteger(),r=this.y.toBigInteger(),n=this.z,a=this.curve.q,i=this.curve.a.toBigInteger(),d=t.square().multiply(hi).add(i.multiply(n.square())).mod(a),c=r.shiftLeft(1).multiply(n).mod(a),p=r.square().mod(a),x=p.multiply(t).multiply(n).mod(a),o=c.square().mod(a),h=d.square().subtract(x.shiftLeft(3)).mod(a),s=c.multiply(h).mod(a),f=d.multiply(x.shiftLeft(2).subtract(h)).subtract(o.shiftLeft(1).multiply(p)).mod(a),v=c.multiply(o).mod(a);return new le(this.curve,this.curve.fromBigInteger(s),this.curve.fromBigInteger(f),v)}multiply(t){if(this.isInfinity())return this;if(!t.signum())return this.curve.infinity;const r=t.multiply(hi),n=this.negate();let a=this;for(let i=r.bitLength()-2;i>0;i--){a=a.twice();const d=r.testBit(i),c=t.testBit(i);d!==c&&(a=a.add(d?this:n))}return a}}var ps={ECCurveFp:class{constructor(t,r,n){this.q=t,this.a=this.fromBigInteger(r),this.b=this.fromBigInteger(n),this.infinity=new le(this,null,null)}equals(t){return t===this?!0:this.q.equals(t.q)&&this.a.equals(t.a)&&this.b.equals(t.b)}fromBigInteger(t){return new te(this.q,t)}decodePointHex(t){switch(parseInt(t.substr(0,2),16)){case 0:return this.infinity;case 2:case 3:const r=this.fromBigInteger(new B0(t.substr(2),16));let n=this.fromBigInteger(r.multiply(r.square()).add(r.multiply(this.a)).add(this.b).toBigInteger().modPow(this.q.divide(new B0("4")).add(B0.ONE),this.q));return n.toBigInteger().mod(ui).equals(new B0(t.substr(0,2),16).subtract(ui))||(n=n.negate()),new le(this,r,n);case 4:case 6:case 7:const a=(t.length-2)/2,i=t.substr(2,a),d=t.substr(a+2,a);return new le(this,this.fromBigInteger(new B0(i,16)),this.fromBigInteger(new B0(d,16)));default:return null}}}};const{BigInteger:O0,SecureRandom:bs}=gt,{ECCurveFp:vs}=ps,ys=new bs,{curve:Re,G:gs,n:li}=pi();function ms(){return Re}function pi(){const e=new O0("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFF",16),t=new O0("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFC",16),r=new O0("28E9FA9E9D9F5E344D5A9E4BCF6509A7F39789F515AB8F92DDBCBD414D940E93",16),n=new vs(e,t,r),d=n.decodePointHex("04"+"32C4AE2C1F1981195F9904466A39C9948FE30BBFF2660BE1715A4589334C74C7"+"BC3736A2F4F6779C59BDCEE36B692153D0A9877CC62A474002DF32E52139F0A0"),c=new O0("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFF7203DF6B21C6052B53BBF40939D54123",16);return{curve:n,G:d,n:c}}function Bs(e,t,r){const a=(e?new O0(e,t,r):new O0(li.bitLength(),ys)).mod(li.subtract(O0.ONE)).add(O0.ONE),i=et(a.toString(16),64),d=gs.multiply(a),c=et(d.getX().toBigInteger().toString(16),64),p=et(d.getY().toBigInteger().toString(16),64),x="04"+c+p;return{privateKey:i,publicKey:x}}function Cs(e){if(e.length!==130)throw new Error("Invalid public key to compress");const t=(e.length-2)/2,r=e.substr(2,t),n=new O0(e.substr(t+2,t),16);let a="03";return n.mod(new O0("2")).equals(O0.ZERO)&&(a="02"),a+r}function Es(e){e=unescape(encodeURIComponent(e));const t=e.length,r=[];for(let a=0;a<t;a++)r[a>>>2]|=(e.charCodeAt(a)&255)<<24-a%4*8;const n=[];for(let a=0;a<t;a++){const i=r[a>>>2]>>>24-a%4*8&255;n.push((i>>>4).toString(16)),n.push((i&15).toString(16))}return n.join("")}function et(e,t){return e.length>=t?e:new Array(t-e.length+1).join("0")+e}function _s(e){return e.map(t=>(t=t.toString(16),t.length===1?"0"+t:t)).join("")}function Fs(e){const t=[];let r=0;for(let n=0;n<e.length*2;n+=2)t[n>>>3]|=parseInt(e[r],10)<<24-n%8*4,r++;try{const n=[];for(let a=0;a<e.length;a++){const i=t[a>>>2]>>>24-a%4*8&255;n.push(String.fromCharCode(i))}return decodeURIComponent(escape(n.join("")))}catch(n){throw new Error("Malformed UTF-8 data")}}function As(e){const t=[];let r=e.length;r%2!==0&&(e=et(e,r+1)),r=e.length;for(let n=0;n<r;n+=2)t.push(parseInt(e.substr(n,2),16));return t}function Ds(e){const t=Re.decodePointHex(e);if(!t)return!1;const r=t.getX();return t.getY().square().equals(r.multiply(r.square()).add(r.multiply(Re.a)).add(Re.b))}function ws(e,t){const r=Re.decodePointHex(e);if(!r)return!1;const n=Re.decodePointHex(t);return n?r.equals(n):!1}var Ss={getGlobalCurve:ms,generateEcparam:pi,generateKeyPairHex:Bs,compressPublicKeyHex:Cs,utf8ToHex:Es,leftPad:et,arrayToHex:_s,arrayToUtf8:Fs,hexToArray:As,verifyPublicKey:Ds,comparePublicKeyHex:ws};const H0=new Uint32Array(68),Zr=new Uint32Array(64);function P0(e,t){const r=t&31;return e<<r|e>>>32-r}function bi(e,t){const r=[];for(let n=e.length-1;n>=0;n--)r[n]=(e[n]^t[n])&255;return r}function Ts(e){return e^P0(e,9)^P0(e,17)}function ks(e){return e^P0(e,15)^P0(e,23)}function mt(e){let t=e.length*8,r=t%512;r=r>=448?512-r%448-1:448-r-1;const n=new Array((r-7)/8),a=new Array(8);for(let o=0,h=n.length;o<h;o++)n[o]=0;for(let o=0,h=a.length;o<h;o++)a[o]=0;t=t.toString(2);for(let o=7;o>=0;o--)if(t.length>8){const h=t.length-8;a[o]=parseInt(t.substr(h),2),t=t.substr(0,h)}else t.length>0&&(a[o]=parseInt(t,2),t="");const i=new Uint8Array([...e,128,...n,...a]),d=new DataView(i.buffer,0),c=i.length/64,p=new Uint32Array([1937774191,1226093241,388252375,3666478592,2842636476,372324522,3817729613,2969243214]);for(let o=0;o<c;o++){H0.fill(0),Zr.fill(0);const h=16*o;for(let A=0;A<16;A++)H0[A]=d.getUint32((h+A)*4,!1);for(let A=16;A<68;A++)H0[A]=ks(H0[A-16]^H0[A-9]^P0(H0[A-3],15))^P0(H0[A-13],7)^H0[A-6];for(let A=0;A<64;A++)Zr[A]=H0[A]^H0[A+4];const s=2043430169,f=2055708042;let v=p[0],m=p[1],C=p[2],_=p[3],y=p[4],B=p[5],b=p[6],F=p[7],D,T,P,H,S;for(let A=0;A<64;A++)S=A>=0&&A<=15?s:f,D=P0(P0(v,12)+y+P0(S,A),7),T=D^P0(v,12),P=(A>=0&&A<=15?v^m^C:v&m|v&C|m&C)+_+T+Zr[A],H=(A>=0&&A<=15?y^B^b:y&B|~y&b)+F+D+H0[A],_=C,C=P0(m,9),m=v,v=P,F=b,b=P0(B,19),B=y,y=Ts(H);p[0]^=v,p[1]^=m,p[2]^=C,p[3]^=_,p[4]^=y,p[5]^=B,p[6]^=b,p[7]^=F}const x=[];for(let o=0,h=p.length;o<h;o++){const s=p[o];x.push((s&4278190080)>>>24,(s&16711680)>>>16,(s&65280)>>>8,s&255)}return x}const tt=64,vi=new Uint8Array(tt),yi=new Uint8Array(tt);for(let e=0;e<tt;e++)vi[e]=54,yi[e]=92;function Rs(e,t){for(t.length>tt&&(t=mt(t));t.length<tt;)t.push(0);const r=bi(t,vi),n=bi(t,yi),a=mt([...r,...e]);return mt([...n,...a])}var gi={sm3:mt,hmac:Rs};const{BigInteger:D0}=gt,{encodeDer:Ps,decodeDer:Is}=ls,Z=Ss,Pe=gi.sm3,{G:pe,curve:mi,n:Ie}=Z.generateEcparam(),Bi=0;function qs(e,t,r=1){e=typeof e=="string"?Z.hexToArray(Z.utf8ToHex(e)):Array.prototype.slice.call(e),t=Z.getGlobalCurve().decodePointHex(t);const n=Z.generateKeyPairHex(),a=new D0(n.privateKey,16);let i=n.publicKey;i.length>128&&(i=i.substr(i.length-128));const d=t.multiply(a),c=Z.hexToArray(Z.leftPad(d.getX().toBigInteger().toRadix(16),64)),p=Z.hexToArray(Z.leftPad(d.getY().toBigInteger().toRadix(16),64)),x=Z.arrayToHex(Pe([].concat(c,e,p)));let o=1,h=0,s=[];const f=[].concat(c,p),v=()=>{s=Pe([...f,o>>24&255,o>>16&255,o>>8&255,o&255]),o++,h=0};v();for(let C=0,_=e.length;C<_;C++)h===s.length&&v(),e[C]^=s[h++]&255;const m=Z.arrayToHex(e);return r===Bi?i+m+x:i+x+m}function Os(e,t,r=1,{output:n="string"}={}){t=new D0(t,16);let a=e.substr(128,64),i=e.substr(192);r===Bi&&(a=e.substr(e.length-64),i=e.substr(128,e.length-128-64));const d=Z.hexToArray(i),p=Z.getGlobalCurve().decodePointHex("04"+e.substr(0,128)).multiply(t),x=Z.hexToArray(Z.leftPad(p.getX().toBigInteger().toRadix(16),64)),o=Z.hexToArray(Z.leftPad(p.getY().toBigInteger().toRadix(16),64));let h=1,s=0,f=[];const v=[].concat(x,o),m=()=>{f=Pe([...v,h>>24&255,h>>16&255,h>>8&255,h&255]),h++,s=0};m();for(let _=0,y=d.length;_<y;_++)s===f.length&&m(),d[_]^=f[s++]&255;return Z.arrayToHex(Pe([].concat(x,d,o)))===a.toLowerCase()?n==="array"?d:Z.arrayToUtf8(d):n==="array"?[]:""}function Hs(e,t,{pointPool:r,der:n,hash:a,publicKey:i,userId:d}={}){let c=typeof e=="string"?Z.utf8ToHex(e):Z.arrayToHex(e);a&&(i=i||Ei(t),c=Ci(c,i,d));const p=new D0(t,16),x=new D0(c,16);let o=null,h=null,s=null;do{do{let f;r&&r.length?f=r.pop():f=_i(),o=f.k,h=x.add(f.x1).mod(Ie)}while(h.equals(D0.ZERO)||h.add(o).equals(Ie));s=p.add(D0.ONE).modInverse(Ie).multiply(o.subtract(h.multiply(p))).mod(Ie)}while(s.equals(D0.ZERO));return n?Ps(h,s):Z.leftPad(h.toString(16),64)+Z.leftPad(s.toString(16),64)}function Ns(e,t,r,{der:n,hash:a,userId:i}={}){let d=typeof e=="string"?Z.utf8ToHex(e):Z.arrayToHex(e);a&&(d=Ci(d,r,i));let c,p;if(n){const v=Is(t);c=v.r,p=v.s}else c=new D0(t.substring(0,64),16),p=new D0(t.substring(64),16);const x=mi.decodePointHex(r),o=new D0(d,16),h=c.add(p).mod(Ie);if(h.equals(D0.ZERO))return!1;const s=pe.multiply(p).add(x.multiply(h)),f=o.add(s.getX().toBigInteger()).mod(Ie);return c.equals(f)}function Ci(e,t,r="1234567812345678"){r=Z.utf8ToHex(r);const n=Z.leftPad(pe.curve.a.toBigInteger().toRadix(16),64),a=Z.leftPad(pe.curve.b.toBigInteger().toRadix(16),64),i=Z.leftPad(pe.getX().toBigInteger().toRadix(16),64),d=Z.leftPad(pe.getY().toBigInteger().toRadix(16),64);let c,p;if(t.length===128)c=t.substr(0,64),p=t.substr(64,64);else{const s=pe.curve.decodePointHex(t);c=Z.leftPad(s.getX().toBigInteger().toRadix(16),64),p=Z.leftPad(s.getY().toBigInteger().toRadix(16),64)}const x=Z.hexToArray(r+n+a+i+d+c+p),o=r.length*4;x.unshift(o&255),x.unshift(o>>8&255);const h=Pe(x);return Z.arrayToHex(Pe(h.concat(Z.hexToArray(e))))}function Ei(e){const t=pe.multiply(new D0(e,16)),r=Z.leftPad(t.getX().toBigInteger().toString(16),64),n=Z.leftPad(t.getY().toBigInteger().toString(16),64);return"04"+r+n}function _i(){const e=Z.generateKeyPairHex(),t=mi.decodePointHex(e.publicKey);return e.k=new D0(e.privateKey,16),e.x1=t.getX().toBigInteger(),e}var Ms={generateKeyPairHex:Z.generateKeyPairHex,compressPublicKeyHex:Z.compressPublicKeyHex,comparePublicKeyHex:Z.comparePublicKeyHex,doEncrypt:qs,doDecrypt:Os,doSignature:Hs,doVerifySignature:Ns,getPublicKeyFromPrivateKey:Ei,getPoint:_i,verifyPublicKey:Z.verifyPublicKey};const{sm3:zs,hmac:Us}=gi;function Ls(e,t){return e.length>=t?e:new Array(t-e.length+1).join("0")+e}function Fi(e){return e.map(t=>(t=t.toString(16),t.length===1?"0"+t:t)).join("")}function $s(e){const t=[];let r=e.length;r%2!==0&&(e=Ls(e,r+1)),r=e.length;for(let n=0;n<r;n+=2)t.push(parseInt(e.substr(n,2),16));return t}function Ks(e){const t=[];for(let r=0,n=e.length;r<n;r++){const a=e.codePointAt(r);if(a<=127)t.push(a);else if(a<=2047)t.push(192|a>>>6),t.push(128|a&63);else if(a<=55295||a>=57344&&a<=65535)t.push(224|a>>>12),t.push(128|a>>>6&63),t.push(128|a&63);else if(a>=65536&&a<=1114111)r++,t.push(240|a>>>18&28),t.push(128|a>>>12&63),t.push(128|a>>>6&63),t.push(128|a&63);else throw t.push(a),new Error("input is not supported")}return t}var Ws=function(e,t){if(e=typeof e=="string"?Ks(e):Array.prototype.slice.call(e),t){if((t.mode||"hmac")!=="hmac")throw new Error("invalid mode");let n=t.key;if(!n)throw new Error("invalid key");return n=typeof n=="string"?$s(n):Array.prototype.slice.call(n),Fi(Us(e,n))}return Fi(zs(e))};const re=0,js=32,be=16,Bt=[214,144,233,254,204,225,61,183,22,182,20,194,40,251,44,5,43,103,154,118,42,190,4,195,170,68,19,38,73,134,6,153,156,66,80,244,145,239,152,122,51,84,11,67,237,207,172,98,228,179,28,169,201,8,232,149,128,223,148,250,117,143,63,166,71,7,167,252,243,115,23,186,131,89,60,25,230,133,79,168,104,107,129,178,113,100,218,139,248,235,15,75,112,86,157,53,30,36,14,94,99,88,209,162,37,34,124,59,1,33,120,135,212,0,70,87,159,211,39,82,76,54,2,231,160,196,200,158,234,191,138,210,64,199,56,181,163,247,242,206,249,97,21,161,224,174,93,164,155,52,26,85,173,147,50,48,245,140,177,227,29,246,226,46,130,102,202,96,192,41,35,171,13,83,78,111,213,219,55,69,222,253,142,47,3,255,106,114,109,108,91,81,141,27,175,146,187,221,188,127,17,217,92,65,31,16,90,216,10,193,49,136,165,205,123,189,45,116,208,18,184,229,180,176,137,105,151,74,12,150,119,126,101,185,241,9,197,110,198,132,24,240,125,236,58,220,77,32,121,238,95,62,215,203,57,72],Ct=[462357,472066609,943670861,1415275113,1886879365,2358483617,2830087869,3301692121,3773296373,4228057617,404694573,876298825,1347903077,1819507329,2291111581,2762715833,3234320085,3705924337,4177462797,337322537,808926789,1280531041,1752135293,2223739545,2695343797,3166948049,3638552301,4110090761,269950501,741554753,1213159005,1684763257];function Yr(e){const t=[];for(let r=0,n=e.length;r<n;r+=2)t.push(parseInt(e.substr(r,2),16));return t}function Xs(e){return e.map(t=>(t=t.toString(16),t.length===1?"0"+t:t)).join("")}function Vs(e){const t=[];for(let r=0,n=e.length;r<n;r++){const a=e.codePointAt(r);if(a<=127)t.push(a);else if(a<=2047)t.push(192|a>>>6),t.push(128|a&63);else if(a<=55295||a>=57344&&a<=65535)t.push(224|a>>>12),t.push(128|a>>>6&63),t.push(128|a&63);else if(a>=65536&&a<=1114111)r++,t.push(240|a>>>18&28),t.push(128|a>>>12&63),t.push(128|a>>>6&63),t.push(128|a&63);else throw t.push(a),new Error("input is not supported")}return t}function Gs(e){const t=[];for(let r=0,n=e.length;r<n;r++)e[r]>=240&&e[r]<=247?(t.push(String.fromCodePoint(((e[r]&7)<<18)+((e[r+1]&63)<<12)+((e[r+2]&63)<<6)+(e[r+3]&63))),r+=3):e[r]>=224&&e[r]<=239?(t.push(String.fromCodePoint(((e[r]&15)<<12)+((e[r+1]&63)<<6)+(e[r+2]&63))),r+=2):e[r]>=192&&e[r]<=223?(t.push(String.fromCodePoint(((e[r]&31)<<6)+(e[r+1]&63))),r++):t.push(String.fromCodePoint(e[r]));return t.join("")}function qe(e,t){const r=t&31;return e<<r|e>>>32-r}function ne(e){return(Bt[e>>>24&255]&255)<<24|(Bt[e>>>16&255]&255)<<16|(Bt[e>>>8&255]&255)<<8|Bt[e&255]&255}function Et(e){return e^qe(e,2)^qe(e,10)^qe(e,18)^qe(e,24)}function _t(e){return e^qe(e,13)^qe(e,23)}function Zs(e,t,r){const n=new Array(4),a=new Array(4);for(let i=0;i<4;i++)a[0]=e[4*i]&255,a[1]=e[4*i+1]&255,a[2]=e[4*i+2]&255,a[3]=e[4*i+3]&255,n[i]=a[0]<<24|a[1]<<16|a[2]<<8|a[3];for(let i=0,d;i<32;i+=4)d=n[1]^n[2]^n[3]^r[i+0],n[0]^=Et(ne(d)),d=n[2]^n[3]^n[0]^r[i+1],n[1]^=Et(ne(d)),d=n[3]^n[0]^n[1]^r[i+2],n[2]^=Et(ne(d)),d=n[0]^n[1]^n[2]^r[i+3],n[3]^=Et(ne(d));for(let i=0;i<16;i+=4)t[i]=n[3-i/4]>>>24&255,t[i+1]=n[3-i/4]>>>16&255,t[i+2]=n[3-i/4]>>>8&255,t[i+3]=n[3-i/4]&255}function Ys(e,t,r){const n=new Array(4),a=new Array(4);for(let i=0;i<4;i++)a[0]=e[0+4*i]&255,a[1]=e[1+4*i]&255,a[2]=e[2+4*i]&255,a[3]=e[3+4*i]&255,n[i]=a[0]<<24|a[1]<<16|a[2]<<8|a[3];n[0]^=2746333894,n[1]^=1453994832,n[2]^=1736282519,n[3]^=2993693404;for(let i=0,d;i<32;i+=4)d=n[1]^n[2]^n[3]^Ct[i+0],t[i+0]=n[0]^=_t(ne(d)),d=n[2]^n[3]^n[0]^Ct[i+1],t[i+1]=n[1]^=_t(ne(d)),d=n[3]^n[0]^n[1]^Ct[i+2],t[i+2]=n[2]^=_t(ne(d)),d=n[0]^n[1]^n[2]^Ct[i+3],t[i+3]=n[3]^=_t(ne(d));if(r===re)for(let i=0,d;i<16;i++)d=t[i],t[i]=t[31-i],t[31-i]=d}function Ai(e,t,r,{padding:n="pkcs#7",mode:a,iv:i=[],output:d="string"}={}){if(a==="cbc"&&(typeof i=="string"&&(i=Yr(i)),i.length!==128/8))throw new Error("iv is invalid");if(typeof t=="string"&&(t=Yr(t)),t.length!==128/8)throw new Error("key is invalid");if(typeof e=="string"?r!==re?e=Vs(e):e=Yr(e):e=[...e],(n==="pkcs#5"||n==="pkcs#7")&&r!==re){const s=be-e.length%be;for(let f=0;f<s;f++)e.push(s)}const c=new Array(js);Ys(t,c,r);const p=[];let x=i,o=e.length,h=0;for(;o>=be;){const s=e.slice(h,h+16),f=new Array(16);if(a==="cbc")for(let v=0;v<be;v++)r!==re&&(s[v]^=x[v]);Zs(s,f,c);for(let v=0;v<be;v++)a==="cbc"&&r===re&&(f[v]^=x[v]),p[h+v]=f[v];a==="cbc"&&(r!==re?x=f:x=s),o-=be,h+=be}if((n==="pkcs#5"||n==="pkcs#7")&&r===re){const s=p.length,f=p[s-1];for(let v=1;v<=f;v++)if(p[s-v]!==f)throw new Error("padding is invalid");p.splice(s-f,f)}return d!=="array"?r!==re?Xs(p):Gs(p):p}var Qs={encrypt(e,t,r){return Ai(e,t,1,r)},decrypt(e,t,r){return Ai(e,t,0,r)}},Di={sm2:Ms,sm3:Ws,sm4:Qs};const Js=["appId","signatureMethod","signatureNonce","timestamp","viewerToken","sign","encryptResponseType"],ec=V0("MDQ1QjgxNTVFOTc0N0MyODNBQ0Y4NDI4OTVEMzA0OEU2Q0E5NDNDQzQ1NEFGQTZBOUE0NTJCNTkwM0NDMzBGQ0UyNzhBNkY4OEY2MDJFREY4MDNEQUI0MEJENDVFMzVGNjYwNjc2QkY2OEZEN0NDQkUwRjZBRDMyMzg4MTM2Q0QwRA=="),tc=V0("MDBCMzE5NjE4QjRCMUJBRUI4Q0M2NzY1RDg5MDNDMDVBMEIxNkQ5RDlGQ0QxNjMyNzFCQjZGMUI4OEY2NTdBMjhF");var Ft;(function(e){e[e.C1C3C2=1]="C1C3C2",e[e.C1C2C3=0]="C1C2C3"})(Ft||(Ft={}));function wi(e,t){const r=/^04/.test(e);return r&&!t?e.substring(2):!r&&t?`04${e}`:e}class rc{constructor(t){V(this,"__platformPublicKey");V(this,"__userPrivateKey");V(this,"__ignoreEncryptFields");V(this,"__useSM2");V(this,"__encryptPostSM2");var r,n;this.__platformPublicKey=t.platformPublicKey,this.__userPrivateKey=t.userPrivateKey,this.__ignoreEncryptFields=[...Js],t.includeIgnoreEncryptFields&&this.__ignoreEncryptFields.push(...t.includeIgnoreEncryptFields),this.__useSM2=(r=t.useSM2)!=null?r:!0,this.__encryptPostSM2=(n=t.encryptPostSM2)!=null?n:!0}usePlugin(t){const{useSM2:r=this.__useSM2}=t;return r}interceptIncludeParams(){return{encryptResponseType:2}}interceptEncryptRequest(t){const r=this.__handleParams(t),n=this.__handleData(t),a=this.__handleHeaders(t);return Y0(i0({},t),{params:r,data:n,headers:a})}interceptDecryptResponse(t,r){const n=t.data;if(!n.encryption||typeof n.data!="string")return t;const a=n.data;return n.data=this.__decryptTextSM2(a,r),t}__handleHeaders(t){var a;const r=t.headers||{},{encryptPostSM2:n=this.__encryptPostSM2}=t;return((a=t.method)==null?void 0:a.toLocaleUpperCase())==="POST"&&n&&(r["x-e-type"]=2),r}__handleParams(t){var a;const{encryptPostSM2:r=this.__encryptPostSM2}=t,n=t.params||{};return((a=t.method)==null?void 0:a.toLocaleUpperCase())!=="POST"||!r?n:this.__encryptObjectSM2(n,t,"xurlparam")}__handleData(t){var i;const r=t.data||{};if(((i=t.method)==null?void 0:i.toLocaleUpperCase())!=="POST")return r;let n=r;const{encryptPostSM2:a=this.__encryptPostSM2}=t;return a&&(typeof r=="string"?n=this.__encryptTextSM2(r,t):t.requestType==="json"?n=this.__encryptTextSM2(JSON.stringify(t.data||{}),t):n=this.__encryptObjectSM2(r,t,"xparam")),n}__encryptObjectSM2(t,r,n){const a=Object.keys(t);if(a.length===0)return t;const i={},d={};a.forEach(p=>{this.__ignoreEncryptFields.includes(p)?i[p]=t[p]:d[p]=t[p]});const c=i0({},i);if(Object.keys(d).length){const p=this.__encryptTextSM2(JSON.stringify(d),r);c[n]=p}return c}__encryptTextSM2(t,r){const n=this.__getPublicKey(r);return wi(Di.sm2.doEncrypt(t,n,Ft.C1C2C3),!0)}__decryptTextSM2(t,r){const n=this.__getPrivateKey(r);let a="";try{a=Di.sm2.doDecrypt(wi(t,!1),n,Ft.C1C2C3)}catch(d){console.error("decryptTextSM2 decrypt error",d,{encryptedText:t})}let i=a;try{i=JSON.parse(i)}catch(d){}return i}__getPrivateKey(t){return"appId"in(t.params||{})?this.__userPrivateKey:tc}__getPublicKey(t){return"appId"in(t.params||{})?this.__platformPublicKey:ec}}class nc extends zn{constructor(t){var i,d,c,p;const r=[],{authorizeMethod:n=Qe.Token}=t.config;n===Qe.Token&&r.push(new Un({getTokenInfo:()=>e0(this,null,function*(){const{getChannelToken:x,getViewerToken:o}=t.config;if(x){const h=yield x();return h?{token:h.channelToken}:void 0}if(o){const h=yield o();return h?{token:h.viewerToken}:void 0}})})),n===Qe.Sign&&r.push(new is({appId:(i=t.config.appSignSecretKey)==null?void 0:i.appId,appSecret:(d=t.config.appSignSecretKey)==null?void 0:d.appSecret,signatureNonce:t.config.signatureNonce,signatureMethod:t.config.signatureMethod,getAppSign:t.config.getAppSign}));const a=t.config.securityMode;a===vt.AES&&r.push(new ds({appId:(c=t.config.appSignSecretKey)==null?void 0:c.appId,appSecret:(p=t.config.appSignSecretKey)==null?void 0:p.appSecret})),a===vt.SM2&&t.config.sm2Key&&r.push(new rc({platformPublicKey:t.config.sm2Key.platformPublicKey,userPrivateKey:t.config.sm2Key.userPrivateKey})),super({baseUrl:ti(Kr(t.config.domainInfo).polyvApiDomain,"https"),requestPlugins:[...r,new zo({getBusinessData:()=>e0(this,null,function*(){const[x,o]=yield Promise.all([t.getUserInfo(),t.getChannelInfo()]);return{channelId:o.channelId,viewerId:x.userId,unionId:x.unionId}})}),new Va({decryptKeys:{sign:"polyvInteractSdk",iv:"1111000011101101"}}),new Ln({successCode:200})]})}}var $0=(e=>(e.ConnectSuccess="ConnectSuccess",e.ReconnectSuccess="ReconnectSuccess",e.ConnectFailed="ConnectFailed",e.Disconnect="Disconnect",e.LoginSuccess="LoginSuccess",e.LoginFailed="LoginFailed",e))($0||{}),N0=(e=>(e.Student="student",e.Slice="slice",e.Viewer="viewer",e.Teacher="teacher",e.Assistant="assistant",e.Manager="manager",e.Guest="guest",e.UserTagsMonitor="userTagsMonitor",e.Attendee="attendee",e.Listener="listener",e.Host="host",e.Dummy="dummy",e))(N0||{}),Oe=(e=>(e.TokenExpired="TokenExpired",e.SocketConnectError="SocketConnectError",e.SocketConnectTimeout="SocketConnectTimeout",e))(Oe||{});class ac{constructor(){this.__eventStore={}}__addOnEvent(t,r,n,a){if(!r||!n)return;let i=this.__eventStore[r];i||(i=[]),i.push({type:t,handler:n,callbackHandler:n.bind(a)}),this.__eventStore[r]=i}on(t,r,n=this){this.__addOnEvent("normal",t,r,n)}once(t,r,n=this){this.__addOnEvent("once",t,r,n)}off(t,r){let n=this.__eventStore[t];n&&(n=n.filter(a=>a.handler!==r),this.__eventStore[t]=n)}emit(t,r){const n=this.__eventStore[t];n&&n.forEach(a=>{const{type:i,handler:d,callbackHandler:c}=a;typeof c=="function"&&c(r),i==="once"&&this.off(t,d)})}destroy(){this.__eventStore={}}}var Qr={exports:{}},ic=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,xc=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],Si=function(t){var r=t,n=t.indexOf("["),a=t.indexOf("]");n!=-1&&a!=-1&&(t=t.substring(0,n)+t.substring(n,a).replace(/:/g,";")+t.substring(a,t.length));for(var i=ic.exec(t||""),d={},c=14;c--;)d[xc[c]]=i[c]||"";return n!=-1&&a!=-1&&(d.source=r,d.host=d.host.substring(1,d.host.length-1).replace(/;/g,":"),d.authority=d.authority.replace("[","").replace("]","").replace(/;/g,":"),d.ipv6uri=!0),d.pathNames=oc(d,d.path),d.queryKey=sc(d,d.query),d};function oc(e,t){var r=/\/{2,9}/g,n=t.replace(r,"/").split("/");return(t.substr(0,1)=="/"||t.length===0)&&n.splice(0,1),t.substr(t.length-1,1)=="/"&&n.splice(n.length-1,1),n}function sc(e,t){var r={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(n,a,i){a&&(r[a]=i)}),r}var Jr={exports:{}},en={exports:{}},rt=1e3,nt=rt*60,at=nt*60,it=at*24,cc=it*365.25,fc=function(e,t){t=t||{};var r=typeof e;if(r==="string"&&e.length>0)return dc(e);if(r==="number"&&isNaN(e)===!1)return t.long?hc(e):uc(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function dc(e){if(e=String(e),!(e.length>100)){var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(t){var r=parseFloat(t[1]),n=(t[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*cc;case"days":case"day":case"d":return r*it;case"hours":case"hour":case"hrs":case"hr":case"h":return r*at;case"minutes":case"minute":case"mins":case"min":case"m":return r*nt;case"seconds":case"second":case"secs":case"sec":case"s":return r*rt;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function uc(e){return e>=it?Math.round(e/it)+"d":e>=at?Math.round(e/at)+"h":e>=nt?Math.round(e/nt)+"m":e>=rt?Math.round(e/rt)+"s":e+"ms"}function hc(e){return At(e,it,"day")||At(e,at,"hour")||At(e,nt,"minute")||At(e,rt,"second")||e+" ms"}function At(e,t,r){if(!(e<t))return e<t*1.5?Math.floor(e/t)+" "+r:Math.ceil(e/t)+" "+r+"s"}(function(e,t){t=e.exports=n.debug=n.default=n,t.coerce=p,t.disable=d,t.enable=i,t.enabled=c,t.humanize=fc,t.instances=[],t.names=[],t.skips=[],t.formatters={};function r(x){var o=0,h;for(h in x)o=(o<<5)-o+x.charCodeAt(h),o|=0;return t.colors[Math.abs(o)%t.colors.length]}function n(x){var o;function h(){if(h.enabled){var s=h,f=+new Date,v=f-(o||f);s.diff=v,s.prev=o,s.curr=f,o=f;for(var m=new Array(arguments.length),C=0;C<m.length;C++)m[C]=arguments[C];m[0]=t.coerce(m[0]),typeof m[0]!="string"&&m.unshift("%O");var _=0;m[0]=m[0].replace(/%([a-zA-Z%])/g,function(B,b){if(B==="%%")return B;_++;var F=t.formatters[b];if(typeof F=="function"){var D=m[_];B=F.call(s,D),m.splice(_,1),_--}return B}),t.formatArgs.call(s,m);var y=h.log||t.log||console.log.bind(console);y.apply(s,m)}}return h.namespace=x,h.enabled=t.enabled(x),h.useColors=t.useColors(),h.color=r(x),h.destroy=a,typeof t.init=="function"&&t.init(h),t.instances.push(h),h}function a(){var x=t.instances.indexOf(this);return x!==-1?(t.instances.splice(x,1),!0):!1}function i(x){t.save(x),t.names=[],t.skips=[];var o,h=(typeof x=="string"?x:"").split(/[\s,]+/),s=h.length;for(o=0;o<s;o++)h[o]&&(x=h[o].replace(/\*/g,".*?"),x[0]==="-"?t.skips.push(new RegExp("^"+x.substr(1)+"$")):t.names.push(new RegExp("^"+x+"$")));for(o=0;o<t.instances.length;o++){var f=t.instances[o];f.enabled=t.enabled(f.namespace)}}function d(){t.enable("")}function c(x){if(x[x.length-1]==="*")return!0;var o,h;for(o=0,h=t.skips.length;o<h;o++)if(t.skips[o].test(x))return!1;for(o=0,h=t.names.length;o<h;o++)if(t.names[o].test(x))return!0;return!1}function p(x){return x instanceof Error?x.stack||x.message:x}})(en,en.exports);var lc=en.exports;(function(e,t){t=e.exports=lc,t.log=a,t.formatArgs=n,t.save=i,t.load=d,t.useColors=r,t.storage=typeof chrome!="undefined"&&typeof chrome.storage!="undefined"?chrome.storage.local:c(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function r(){return typeof window!="undefined"&&window.process&&window.process.type==="renderer"?!0:typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document!="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}t.formatters.j=function(p){try{return JSON.stringify(p)}catch(x){return"[UnexpectedJSONParseError]: "+x.message}};function n(p){var x=this.useColors;if(p[0]=(x?"%c":"")+this.namespace+(x?" %c":" ")+p[0]+(x?"%c ":" ")+"+"+t.humanize(this.diff),!!x){var o="color: "+this.color;p.splice(1,0,o,"color: inherit");var h=0,s=0;p[0].replace(/%[a-zA-Z%]/g,function(f){f!=="%%"&&(h++,f==="%c"&&(s=h))}),p.splice(s,0,o)}}function a(){return typeof console=="object"&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function i(p){try{p==null?t.storage.removeItem("debug"):t.storage.debug=p}catch(x){}}function d(){var p;try{p=t.storage.debug}catch(x){}return!p&&typeof process!="undefined"&&"env"in process&&(p=process.env.DEBUG),p}t.enable(d());function c(){try{return window.localStorage}catch(p){}}})(Jr,Jr.exports);var G0=Jr.exports,pc=Si,Ti=G0("socket.io-client:url"),bc=vc;function vc(e,t){var r=e;t=t||typeof location!="undefined"&&location,e==null&&(e=t.protocol+"//"+t.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=t.protocol+e:e=t.host+e),/^(https?|wss?):\/\//.test(e)||(Ti("protocol-less url %s",e),typeof t!="undefined"?e=t.protocol+"//"+e:e="https://"+e),Ti("parse %s",e),r=pc(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";var n=r.host.indexOf(":")!==-1,a=n?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+a+":"+r.port,r.href=r.protocol+"://"+a+(t&&t.port===r.port?"":":"+r.port),r}var Dt={},ki={exports:{}};(function(e){e.exports=t;function t(n){if(n)return r(n)}function r(n){for(var a in t.prototype)n[a]=t.prototype[a];return n}t.prototype.on=t.prototype.addEventListener=function(n,a){return this._callbacks=this._callbacks||{},(this._callbacks["$"+n]=this._callbacks["$"+n]||[]).push(a),this},t.prototype.once=function(n,a){function i(){this.off(n,i),a.apply(this,arguments)}return i.fn=a,this.on(n,i),this},t.prototype.off=t.prototype.removeListener=t.prototype.removeAllListeners=t.prototype.removeEventListener=function(n,a){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var i=this._callbacks["$"+n];if(!i)return this;if(arguments.length==1)return delete this._callbacks["$"+n],this;for(var d,c=0;c<i.length;c++)if(d=i[c],d===a||d.fn===a){i.splice(c,1);break}return i.length===0&&delete this._callbacks["$"+n],this},t.prototype.emit=function(n){this._callbacks=this._callbacks||{};for(var a=new Array(arguments.length-1),i=this._callbacks["$"+n],d=1;d<arguments.length;d++)a[d-1]=arguments[d];if(i){i=i.slice(0);for(var d=0,c=i.length;d<c;++d)i[d].apply(this,a)}return this},t.prototype.listeners=function(n){return this._callbacks=this._callbacks||{},this._callbacks["$"+n]||[]},t.prototype.hasListeners=function(n){return!!this.listeners(n).length}})(ki);var He=ki.exports,wt={},yc={}.toString,tn=Array.isArray||function(e){return yc.call(e)=="[object Array]"},Ri=Cc,gc=typeof Buffer=="function"&&typeof Buffer.isBuffer=="function",mc=typeof ArrayBuffer=="function",Bc=function(e){return typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer};function Cc(e){return gc&&Buffer.isBuffer(e)||mc&&(e instanceof ArrayBuffer||Bc(e))}var rn=tn,Pi=Ri,Ii=Object.prototype.toString,Ec=typeof Blob=="function"||typeof Blob!="undefined"&&Ii.call(Blob)==="[object BlobConstructor]",_c=typeof File=="function"||typeof File!="undefined"&&Ii.call(File)==="[object FileConstructor]";wt.deconstructPacket=function(e){var t=[],r=e.data,n=e;return n.data=nn(r,t),n.attachments=t.length,{packet:n,buffers:t}};function nn(e,t){if(!e)return e;if(Pi(e)){var r={_placeholder:!0,num:t.length};return t.push(e),r}else if(rn(e)){for(var n=new Array(e.length),a=0;a<e.length;a++)n[a]=nn(e[a],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){var n={};for(var i in e)n[i]=nn(e[i],t);return n}return e}wt.reconstructPacket=function(e,t){return e.data=an(e.data,t),e.attachments=void 0,e};function an(e,t){if(!e)return e;if(e&&e._placeholder===!0){var r=typeof e.num=="number"&&e.num>=0&&e.num<t.length;if(r)return t[e.num];throw new Error("illegal attachments")}else if(rn(e))for(var n=0;n<e.length;n++)e[n]=an(e[n],t);else if(typeof e=="object")for(var a in e)e[a]=an(e[a],t);return e}wt.removeBlobs=function(e,t){function r(i,d,c){if(!i)return i;if(Ec&&i instanceof Blob||_c&&i instanceof File){n++;var p=new FileReader;p.onload=function(){c?c[d]=this.result:a=this.result,--n||t(a)},p.readAsArrayBuffer(i)}else if(rn(i))for(var x=0;x<i.length;x++)r(i[x],x,i);else if(typeof i=="object"&&!Pi(i))for(var o in i)r(i[o],o,i)}var n=0,a=e;r(a),n||t(a)},function(e){var t=G0("socket.io-parser"),r=He,n=wt,a=tn,i=Ri;e.protocol=4,e.types=["CONNECT","DISCONNECT","EVENT","ACK","ERROR","BINARY_EVENT","BINARY_ACK"],e.CONNECT=0,e.DISCONNECT=1,e.EVENT=2,e.ACK=3,e.ERROR=4,e.BINARY_EVENT=5,e.BINARY_ACK=6,e.Encoder=d,e.Decoder=h;function d(){}var c=e.ERROR+'"encode error"';d.prototype.encode=function(_,y){if(t("encoding packet %j",_),e.BINARY_EVENT===_.type||e.BINARY_ACK===_.type)o(_,y);else{var B=p(_);y([B])}};function p(_){var y=""+_.type;if((e.BINARY_EVENT===_.type||e.BINARY_ACK===_.type)&&(y+=_.attachments+"-"),_.nsp&&_.nsp!=="/"&&(y+=_.nsp+","),_.id!=null&&(y+=_.id),_.data!=null){var B=x(_.data);if(B!==!1)y+=B;else return c}return t("encoded %j as %s",_,y),y}function x(_){try{return JSON.stringify(_)}catch(y){return!1}}function o(_,y){function B(b){var F=n.deconstructPacket(b),D=p(F.packet),T=F.buffers;T.unshift(D),y(T)}n.removeBlobs(_,B)}function h(){this.reconstructor=null}r(h.prototype),h.prototype.add=function(_){var y;if(typeof _=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");y=f(_),e.BINARY_EVENT===y.type||e.BINARY_ACK===y.type?(this.reconstructor=new m(y),this.reconstructor.reconPack.attachments===0&&this.emit("decoded",y)):this.emit("decoded",y)}else if(i(_)||_.base64)if(this.reconstructor)y=this.reconstructor.takeBinaryData(_),y&&(this.reconstructor=null,this.emit("decoded",y));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+_)};function s(_,y){switch(_){case 0:return typeof y=="object";case 1:return y===void 0;case 4:return typeof y=="string"||typeof y=="object";case 2:case 5:return a(y)&&(typeof y[0]=="string"||typeof y[0]=="number");case 3:case 6:return a(y)}}function f(_){var y=0,B={type:Number(_.charAt(0))};if(e.types[B.type]==null)return C("unknown packet type "+B.type);if(e.BINARY_EVENT===B.type||e.BINARY_ACK===B.type){for(var b=y+1;_.charAt(++y)!=="-"&&y!=_.length;);var F=_.substring(b,y);if(F!=Number(F)||_.charAt(y)!=="-")throw new Error("Illegal attachments");B.attachments=Number(F)}if(_.charAt(y+1)==="/"){for(var b=y+1;++y;){var D=_.charAt(y);if(D===","||y===_.length)break}B.nsp=_.substring(b,y)}else B.nsp="/";var T=_.charAt(y+1);if(T!==""&&Number(T)==T){for(var b=y+1;++y;){var D=_.charAt(y);if(D==null||Number(D)!=D){--y;break}if(y===_.length)break}B.id=Number(_.substring(b,y+1))}if(_.charAt(++y)){var P=v(_.substr(y));if(s(B.type,P))B.data=P;else throw new Error("invalid payload")}return t("decoded %s as %j",_,B),B}function v(_){try{return JSON.parse(_)}catch(y){return!1}}h.prototype.destroy=function(){this.reconstructor&&this.reconstructor.finishedReconstruction()};function m(_){this.reconPack=_,this.buffers=[]}m.prototype.takeBinaryData=function(_){if(this.buffers.push(_),this.buffers.length===this.reconPack.attachments){var y=n.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),y}return null},m.prototype.finishedReconstruction=function(){this.reconPack=null,this.buffers=[]};function C(_){return{type:e.ERROR,data:"parser error: "+_}}}(Dt);var xn={exports:{}},St={},on={exports:{}};try{on.exports=typeof XMLHttpRequest!="undefined"&&"withCredentials"in new XMLHttpRequest}catch(e){on.exports=!1}var Fc=on.exports,sn=function(){return typeof self!="undefined"?self:typeof window!="undefined"?window:Function("return this")()}(),Ac=Fc,Dc=sn,cn=function(e){var t=e.xdomain,r=e.xscheme,n=e.enablesXDR;try{if(typeof XMLHttpRequest!="undefined"&&(!t||Ac))return new XMLHttpRequest}catch(a){}try{if(typeof XDomainRequest!="undefined"&&!r&&n)return new XDomainRequest}catch(a){}if(!t)try{return new Dc[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch(a){}},fn={exports:{}},ve={},wc=Object.keys||function(t){var r=[],n=Object.prototype.hasOwnProperty;for(var a in t)n.call(t,a)&&r.push(a);return r},Sc=tn,qi=Object.prototype.toString,Tc=typeof Blob=="function"||typeof Blob!="undefined"&&qi.call(Blob)==="[object BlobConstructor]",kc=typeof File=="function"||typeof File!="undefined"&&qi.call(File)==="[object FileConstructor]",Oi=Tt;function Tt(e){if(!e||typeof e!="object")return!1;if(Sc(e)){for(var t=0,r=e.length;t<r;t++)if(Tt(e[t]))return!0;return!1}if(typeof Buffer=="function"&&Buffer.isBuffer&&Buffer.isBuffer(e)||typeof ArrayBuffer=="function"&&e instanceof ArrayBuffer||Tc&&e instanceof Blob||kc&&e instanceof File)return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Tt(e.toJSON(),!0);for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&Tt(e[n]))return!0;return!1}var Rc=function(e,t,r){var n=e.byteLength;if(t=t||0,r=r||n,e.slice)return e.slice(t,r);if(t<0&&(t+=n),r<0&&(r+=n),r>n&&(r=n),t>=n||t>=r||n===0)return new ArrayBuffer(0);for(var a=new Uint8Array(e),i=new Uint8Array(r-t),d=t,c=0;d<r;d++,c++)i[c]=a[d];return i.buffer},Pc=Ic;function Ic(e,t,r){var n=!1;return r=r||qc,a.count=e,e===0?t():a;function a(i,d){if(a.count<=0)throw new Error("after called too many times");--a.count,i?(n=!0,t(i),t=r):a.count===0&&!n&&t(null,d)}}function qc(){}/*! https://mths.be/utf8js v2.1.2 by @mathias */var ae=String.fromCharCode;function Hi(e){for(var t=[],r=0,n=e.length,a,i;r<n;)a=e.charCodeAt(r++),a>=55296&&a<=56319&&r<n?(i=e.charCodeAt(r++),(i&64512)==56320?t.push(((a&1023)<<10)+(i&1023)+65536):(t.push(a),r--)):t.push(a);return t}function Oc(e){for(var t=e.length,r=-1,n,a="";++r<t;)n=e[r],n>65535&&(n-=65536,a+=ae(n>>>10&1023|55296),n=56320|n&1023),a+=ae(n);return a}function Ni(e,t){if(e>=55296&&e<=57343){if(t)throw Error("Lone surrogate U+"+e.toString(16).toUpperCase()+" is not a scalar value");return!1}return!0}function dn(e,t){return ae(e>>t&63|128)}function Hc(e,t){if(!(e&4294967168))return ae(e);var r="";return e&4294965248?e&4294901760?e&4292870144||(r=ae(e>>18&7|240),r+=dn(e,12),r+=dn(e,6)):(Ni(e,t)||(e=65533),r=ae(e>>12&15|224),r+=dn(e,6)):r=ae(e>>6&31|192),r+=ae(e&63|128),r}function Nc(e,t){t=t||{};for(var r=t.strict!==!1,n=Hi(e),a=n.length,i=-1,d,c="";++i<a;)d=n[i],c+=Hc(d,r);return c}function Ne(){if(ie>=Rt)throw Error("Invalid byte index");var e=kt[ie]&255;if(ie++,(e&192)==128)return e&63;throw Error("Invalid continuation byte")}function Mc(e){var t,r,n,a,i;if(ie>Rt)throw Error("Invalid byte index");if(ie==Rt)return!1;if(t=kt[ie]&255,ie++,!(t&128))return t;if((t&224)==192){if(r=Ne(),i=(t&31)<<6|r,i>=128)return i;throw Error("Invalid continuation byte")}if((t&240)==224){if(r=Ne(),n=Ne(),i=(t&15)<<12|r<<6|n,i>=2048)return Ni(i,e)?i:65533;throw Error("Invalid continuation byte")}if((t&248)==240&&(r=Ne(),n=Ne(),a=Ne(),i=(t&7)<<18|r<<12|n<<6|a,i>=65536&&i<=1114111))return i;throw Error("Invalid UTF-8 detected")}var kt,Rt,ie;function zc(e,t){t=t||{};var r=t.strict!==!1;kt=Hi(e),Rt=kt.length,ie=0;for(var n=[],a;(a=Mc(r))!==!1;)n.push(a);return Oc(n)}var Uc={version:"2.1.2",encode:Nc,decode:zc},Pt={},Mi;function Lc(){return Mi||(Mi=1,function(e){Pt.encode=function(t){var r=new Uint8Array(t),n,a=r.length,i="";for(n=0;n<a;n+=3)i+=e[r[n]>>2],i+=e[(r[n]&3)<<4|r[n+1]>>4],i+=e[(r[n+1]&15)<<2|r[n+2]>>6],i+=e[r[n+2]&63];return a%3===2?i=i.substring(0,i.length-1)+"=":a%3===1&&(i=i.substring(0,i.length-2)+"=="),i},Pt.decode=function(t){var r=t.length*.75,n=t.length,a,i=0,d,c,p,x;t[t.length-1]==="="&&(r--,t[t.length-2]==="="&&r--);var o=new ArrayBuffer(r),h=new Uint8Array(o);for(a=0;a<n;a+=4)d=e.indexOf(t[a]),c=e.indexOf(t[a+1]),p=e.indexOf(t[a+2]),x=e.indexOf(t[a+3]),h[i++]=d<<2|c>>4,h[i++]=(c&15)<<4|p>>2,h[i++]=(p&3)<<6|x&63;return o}}("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")),Pt}var un,zi;function $c(){if(zi)return un;zi=1;var e=typeof e!="undefined"?e:typeof WebKitBlobBuilder!="undefined"?WebKitBlobBuilder:typeof MSBlobBuilder!="undefined"?MSBlobBuilder:typeof MozBlobBuilder!="undefined"?MozBlobBuilder:!1,t=function(){try{var c=new Blob(["hi"]);return c.size===2}catch(p){return!1}}(),r=t&&function(){try{var c=new Blob([new Uint8Array([1,2])]);return c.size===2}catch(p){return!1}}(),n=e&&e.prototype.append&&e.prototype.getBlob;function a(c){return c.map(function(p){if(p.buffer instanceof ArrayBuffer){var x=p.buffer;if(p.byteLength!==x.byteLength){var o=new Uint8Array(p.byteLength);o.set(new Uint8Array(x,p.byteOffset,p.byteLength)),x=o.buffer}return x}return p})}function i(c,p){p=p||{};var x=new e;return a(c).forEach(function(o){x.append(o)}),p.type?x.getBlob(p.type):x.getBlob()}function d(c,p){return new Blob(a(c),p||{})}return typeof Blob!="undefined"&&(i.prototype=Blob.prototype,d.prototype=Blob.prototype),un=function(){return t?r?Blob:d:n?i:void 0}(),un}(function(e){var t=wc,r=Oi,n=Rc,a=Pc,i=Uc,d;typeof ArrayBuffer!="undefined"&&(d=Lc());var c=typeof navigator!="undefined"&&/Android/i.test(navigator.userAgent),p=typeof navigator!="undefined"&&/PhantomJS/i.test(navigator.userAgent),x=c||p;e.protocol=3;var o=e.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6},h=t(o),s={type:"error",data:"parser error"},f=$c();e.encodePacket=function(b,F,D,T){typeof F=="function"&&(T=F,F=!1),typeof D=="function"&&(T=D,D=null);var P=b.data===void 0?void 0:b.data.buffer||b.data;if(typeof ArrayBuffer!="undefined"&&P instanceof ArrayBuffer)return m(b,F,T);if(typeof f!="undefined"&&P instanceof f)return _(b,F,T);if(P&&P.base64)return v(b,T);var H=o[b.type];return b.data!==void 0&&(H+=D?i.encode(String(b.data),{strict:!1}):String(b.data)),T(""+H)};function v(b,F){var D="b"+e.packets[b.type]+b.data.data;return F(D)}function m(b,F,D){if(!F)return e.encodeBase64Packet(b,D);var T=b.data,P=new Uint8Array(T),H=new Uint8Array(1+T.byteLength);H[0]=o[b.type];for(var S=0;S<P.length;S++)H[S+1]=P[S];return D(H.buffer)}function C(b,F,D){if(!F)return e.encodeBase64Packet(b,D);var T=new FileReader;return T.onload=function(){e.encodePacket({type:b.type,data:T.result},F,!0,D)},T.readAsArrayBuffer(b.data)}function _(b,F,D){if(!F)return e.encodeBase64Packet(b,D);if(x)return C(b,F,D);var T=new Uint8Array(1);T[0]=o[b.type];var P=new f([T.buffer,b.data]);return D(P)}e.encodeBase64Packet=function(b,F){var D="b"+e.packets[b.type];if(typeof f!="undefined"&&b.data instanceof f){var T=new FileReader;return T.onload=function(){var q=T.result.split(",")[1];F(D+q)},T.readAsDataURL(b.data)}var P;try{P=String.fromCharCode.apply(null,new Uint8Array(b.data))}catch(q){for(var H=new Uint8Array(b.data),S=new Array(H.length),A=0;A<H.length;A++)S[A]=H[A];P=String.fromCharCode.apply(null,S)}return D+=btoa(P),F(D)},e.decodePacket=function(b,F,D){if(b===void 0)return s;if(typeof b=="string"){if(b.charAt(0)==="b")return e.decodeBase64Packet(b.substr(1),F);if(D&&(b=y(b),b===!1))return s;var P=b.charAt(0);return Number(P)!=P||!h[P]?s:b.length>1?{type:h[P],data:b.substring(1)}:{type:h[P]}}var T=new Uint8Array(b),P=T[0],H=n(b,1);return f&&F==="blob"&&(H=new f([H])),{type:h[P],data:H}};function y(b){try{b=i.decode(b,{strict:!1})}catch(F){return!1}return b}e.decodeBase64Packet=function(b,F){var D=h[b.charAt(0)];if(!d)return{type:D,data:{base64:!0,data:b.substr(1)}};var T=d.decode(b.substr(1));return F==="blob"&&f&&(T=new f([T])),{type:D,data:T}},e.encodePayload=function(b,F,D){typeof F=="function"&&(D=F,F=null);var T=r(b);if(F&&T)return f&&!x?e.encodePayloadAsBlob(b,D):e.encodePayloadAsArrayBuffer(b,D);if(!b.length)return D("0:");function P(S){return S.length+":"+S}function H(S,A){e.encodePacket(S,T?F:!1,!1,function(q){A(null,P(q))})}B(b,H,function(S,A){return D(A.join(""))})};function B(b,F,D){for(var T=new Array(b.length),P=a(b.length,D),H=function(A,q,N){F(q,function(U,L){T[A]=L,N(U,T)})},S=0;S<b.length;S++)H(S,b[S],P)}e.decodePayload=function(b,F,D){if(typeof b!="string")return e.decodePayloadAsBinary(b,F,D);typeof F=="function"&&(D=F,F=null);var T;if(b==="")return D(s,0,1);for(var P="",H,S,A=0,q=b.length;A<q;A++){var N=b.charAt(A);if(N!==":"){P+=N;continue}if(P===""||P!=(H=Number(P))||(S=b.substr(A+1,H),P!=S.length))return D(s,0,1);if(S.length){if(T=e.decodePacket(S,F,!1),s.type===T.type&&s.data===T.data)return D(s,0,1);var U=D(T,A+H,q);if(U===!1)return}A+=H,P=""}if(P!=="")return D(s,0,1)},e.encodePayloadAsArrayBuffer=function(b,F){if(!b.length)return F(new ArrayBuffer(0));function D(T,P){e.encodePacket(T,!0,!0,function(H){return P(null,H)})}B(b,D,function(T,P){var H=P.reduce(function(q,N){var U;return typeof N=="string"?U=N.length:U=N.byteLength,q+U.toString().length+U+2},0),S=new Uint8Array(H),A=0;return P.forEach(function(q){var N=typeof q=="string",U=q;if(N){for(var Y=new Uint8Array(q.length),L=0;L<q.length;L++)Y[L]=q.charCodeAt(L);U=Y.buffer}N?S[A++]=0:S[A++]=1;for(var X=U.byteLength.toString(),L=0;L<X.length;L++)S[A++]=parseInt(X[L]);S[A++]=255;for(var Y=new Uint8Array(U),L=0;L<Y.length;L++)S[A++]=Y[L]}),F(S.buffer)})},e.encodePayloadAsBlob=function(b,F){function D(T,P){e.encodePacket(T,!0,!0,function(H){var S=new Uint8Array(1);if(S[0]=1,typeof H=="string"){for(var A=new Uint8Array(H.length),q=0;q<H.length;q++)A[q]=H.charCodeAt(q);H=A.buffer,S[0]=0}for(var N=H instanceof ArrayBuffer?H.byteLength:H.size,U=N.toString(),L=new Uint8Array(U.length+1),q=0;q<U.length;q++)L[q]=parseInt(U[q]);if(L[U.length]=255,f){var X=new f([S.buffer,L.buffer,H]);P(null,X)}})}B(b,D,function(T,P){return F(new f(P))})},e.decodePayloadAsBinary=function(b,F,D){typeof F=="function"&&(D=F,F=null);for(var T=b,P=[];T.byteLength>0;){for(var H=new Uint8Array(T),S=H[0]===0,A="",q=1;H[q]!==255;q++){if(A.length>310)return D(s,0,1);A+=H[q]}T=n(T,2+A.length),A=parseInt(A);var N=n(T,0,A);if(S)try{N=String.fromCharCode.apply(null,new Uint8Array(N))}catch(X){var U=new Uint8Array(N);N="";for(var q=0;q<U.length;q++)N+=String.fromCharCode(U[q])}P.push(N),T=n(T,A)}var L=P.length;P.forEach(function(X,Y){D(e.decodePacket(X,F,!0),Y,L)})}})(ve);var hn,Ui;function ln(){if(Ui)return hn;Ui=1;var e=ve,t=He;hn=r;function r(n){this.path=n.path,this.hostname=n.hostname,this.port=n.port,this.secure=n.secure,this.query=n.query,this.timestampParam=n.timestampParam,this.timestampRequests=n.timestampRequests,this.readyState="",this.agent=n.agent||!1,this.socket=n.socket,this.enablesXDR=n.enablesXDR,this.withCredentials=n.withCredentials,this.pfx=n.pfx,this.key=n.key,this.passphrase=n.passphrase,this.cert=n.cert,this.ca=n.ca,this.ciphers=n.ciphers,this.rejectUnauthorized=n.rejectUnauthorized,this.forceNode=n.forceNode,this.isReactNative=n.isReactNative,this.extraHeaders=n.extraHeaders,this.localAddress=n.localAddress}return t(r.prototype),r.prototype.onError=function(n,a){var i=new Error(n);return i.type="TransportError",i.description=a,this.emit("error",i),this},r.prototype.open=function(){return(this.readyState==="closed"||this.readyState==="")&&(this.readyState="opening",this.doOpen()),this},r.prototype.close=function(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this},r.prototype.send=function(n){if(this.readyState==="open")this.write(n);else throw new Error("Transport not open")},r.prototype.onOpen=function(){this.readyState="open",this.writable=!0,this.emit("open")},r.prototype.onData=function(n){var a=e.decodePacket(n,this.socket.binaryType);this.onPacket(a)},r.prototype.onPacket=function(n){this.emit("packet",n)},r.prototype.onClose=function(){this.readyState="closed",this.emit("close")},hn}var Me={};Me.encode=function(e){var t="";for(var r in e)e.hasOwnProperty(r)&&(t.length&&(t+="&"),t+=encodeURIComponent(r)+"="+encodeURIComponent(e[r]));return t},Me.decode=function(e){for(var t={},r=e.split("&"),n=0,a=r.length;n<a;n++){var i=r[n].split("=");t[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return t};var It=function(e,t){var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e},Li="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),qt=64,$i={},Ki=0,xe=0,Wi;function pn(e){var t="";do t=Li[e%qt]+t,e=Math.floor(e/qt);while(e>0);return t}function Kc(e){var t=0;for(xe=0;xe<e.length;xe++)t=t*qt+$i[e.charAt(xe)];return t}function bn(){var e=pn(+new Date);return e!==Wi?(Ki=0,Wi=e):e+"."+pn(Ki++)}for(;xe<qt;xe++)$i[Li[xe]]=xe;bn.encode=pn,bn.decode=Kc;var ji=bn,Xi=ln(),Wc=Me,Vi=ve,jc=It,Xc=ji,M0=G0("engine.io-client:polling"),Gi=K0,Vc=function(){var e=cn,t=new e({xdomain:!1});return t.responseType!=null}();function K0(e){var t=e&&e.forceBase64;(!Vc||t)&&(this.supportsBinary=!1),Xi.call(this,e)}jc(K0,Xi),K0.prototype.name="polling",K0.prototype.doOpen=function(){this.poll()},K0.prototype.pause=function(e){var t=this;this.readyState="pausing";function r(){M0("paused"),t.readyState="paused",e()}if(this.polling||!this.writable){var n=0;this.polling&&(M0("we are currently polling - waiting to pause"),n++,this.once("pollComplete",function(){M0("pre-pause polling complete"),--n||r()})),this.writable||(M0("we are currently writing - waiting to pause"),n++,this.once("drain",function(){M0("pre-pause writing complete"),--n||r()}))}else r()},K0.prototype.poll=function(){M0("polling"),this.polling=!0,this.doPoll(),this.emit("poll")},K0.prototype.onData=function(e){var t=this;M0("polling got data %s",e);var r=function(n,a,i){if(t.readyState==="opening"&&n.type==="open"&&t.onOpen(),n.type==="close")return t.onClose(),!1;t.onPacket(n)};Vi.decodePayload(e,this.socket.binaryType,r),this.readyState!=="closed"&&(this.polling=!1,this.emit("pollComplete"),this.readyState==="open"?this.poll():M0('ignoring poll - transport state "%s"',this.readyState))},K0.prototype.doClose=function(){var e=this;function t(){M0("writing close packet"),e.write([{type:"close"}])}this.readyState==="open"?(M0("transport open - closing"),t()):(M0("transport not open - deferring close"),this.once("open",t))},K0.prototype.write=function(e){var t=this;this.writable=!1;var r=function(){t.writable=!0,t.emit("drain")};Vi.encodePayload(e,this.supportsBinary,function(n){t.doWrite(n,r)})},K0.prototype.uri=function(){var e=this.query||{},t=this.secure?"https":"http",r="";this.timestampRequests!==!1&&(e[this.timestampParam]=Xc()),!this.supportsBinary&&!e.sid&&(e.b64=1),e=Wc.encode(e),this.port&&(t==="https"&&Number(this.port)!==443||t==="http"&&Number(this.port)!==80)&&(r=":"+this.port),e.length&&(e="?"+e);var n=this.hostname.indexOf(":")!==-1;return t+"://"+(n?"["+this.hostname+"]":this.hostname)+r+this.path+e};var Gc=cn,Zi=Gi,Zc=He,Yc=It,vn=G0("engine.io-client:polling-xhr"),Qc=sn;fn.exports=ze,fn.exports.Request=h0;function Yi(){}function ze(e){if(Zi.call(this,e),this.requestTimeout=e.requestTimeout,this.extraHeaders=e.extraHeaders,typeof location!="undefined"){var t=location.protocol==="https:",r=location.port;r||(r=t?443:80),this.xd=typeof location!="undefined"&&e.hostname!==location.hostname||r!==e.port,this.xs=e.secure!==t}}Yc(ze,Zi),ze.prototype.supportsBinary=!0,ze.prototype.request=function(e){return e=e||{},e.uri=this.uri(),e.xd=this.xd,e.xs=this.xs,e.agent=this.agent||!1,e.supportsBinary=this.supportsBinary,e.enablesXDR=this.enablesXDR,e.withCredentials=this.withCredentials,e.pfx=this.pfx,e.key=this.key,e.passphrase=this.passphrase,e.cert=this.cert,e.ca=this.ca,e.ciphers=this.ciphers,e.rejectUnauthorized=this.rejectUnauthorized,e.requestTimeout=this.requestTimeout,e.extraHeaders=this.extraHeaders,new h0(e)},ze.prototype.doWrite=function(e,t){var r=typeof e!="string"&&e!==void 0,n=this.request({method:"POST",data:e,isBinary:r}),a=this;n.on("success",t),n.on("error",function(i){a.onError("xhr post error",i)}),this.sendXhr=n},ze.prototype.doPoll=function(){vn("xhr poll");var e=this.request(),t=this;e.on("data",function(r){t.onData(r)}),e.on("error",function(r){t.onError("xhr poll error",r)}),this.pollXhr=e};function h0(e){this.method=e.method||"GET",this.uri=e.uri,this.xd=!!e.xd,this.xs=!!e.xs,this.async=e.async!==!1,this.data=e.data!==void 0?e.data:null,this.agent=e.agent,this.isBinary=e.isBinary,this.supportsBinary=e.supportsBinary,this.enablesXDR=e.enablesXDR,this.withCredentials=e.withCredentials,this.requestTimeout=e.requestTimeout,this.pfx=e.pfx,this.key=e.key,this.passphrase=e.passphrase,this.cert=e.cert,this.ca=e.ca,this.ciphers=e.ciphers,this.rejectUnauthorized=e.rejectUnauthorized,this.extraHeaders=e.extraHeaders,this.create()}if(Zc(h0.prototype),h0.prototype.create=function(){var e={agent:this.agent,xdomain:this.xd,xscheme:this.xs,enablesXDR:this.enablesXDR};e.pfx=this.pfx,e.key=this.key,e.passphrase=this.passphrase,e.cert=this.cert,e.ca=this.ca,e.ciphers=this.ciphers,e.rejectUnauthorized=this.rejectUnauthorized;var t=this.xhr=new Gc(e),r=this;try{vn("xhr open %s: %s",this.method,this.uri),t.open(this.method,this.uri,this.async);try{if(this.extraHeaders){t.setDisableHeaderCheck&&t.setDisableHeaderCheck(!0);for(var n in this.extraHeaders)this.extraHeaders.hasOwnProperty(n)&&t.setRequestHeader(n,this.extraHeaders[n])}}catch(a){}if(this.method==="POST")try{this.isBinary?t.setRequestHeader("Content-type","application/octet-stream"):t.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(a){}try{t.setRequestHeader("Accept","*/*")}catch(a){}"withCredentials"in t&&(t.withCredentials=this.withCredentials),this.requestTimeout&&(t.timeout=this.requestTimeout),this.hasXDR()?(t.onload=function(){r.onLoad()},t.onerror=function(){r.onError(t.responseText)}):t.onreadystatechange=function(){if(t.readyState===2)try{var a=t.getResponseHeader("Content-Type");(r.supportsBinary&&a==="application/octet-stream"||a==="application/octet-stream; charset=UTF-8")&&(t.responseType="arraybuffer")}catch(i){}t.readyState===4&&(t.status===200||t.status===1223?r.onLoad():setTimeout(function(){r.onError(typeof t.status=="number"?t.status:0)},0))},vn("xhr data %s",this.data),t.send(this.data)}catch(a){setTimeout(function(){r.onError(a)},0);return}typeof document!="undefined"&&(this.index=h0.requestsCount++,h0.requests[this.index]=this)},h0.prototype.onSuccess=function(){this.emit("success"),this.cleanup()},h0.prototype.onData=function(e){this.emit("data",e),this.onSuccess()},h0.prototype.onError=function(e){this.emit("error",e),this.cleanup(!0)},h0.prototype.cleanup=function(e){if(!(typeof this.xhr=="undefined"||this.xhr===null)){if(this.hasXDR()?this.xhr.onload=this.xhr.onerror=Yi:this.xhr.onreadystatechange=Yi,e)try{this.xhr.abort()}catch(t){}typeof document!="undefined"&&delete h0.requests[this.index],this.xhr=null}},h0.prototype.onLoad=function(){var e;try{var t;try{t=this.xhr.getResponseHeader("Content-Type")}catch(r){}t==="application/octet-stream"||t==="application/octet-stream; charset=UTF-8"?e=this.xhr.response||this.xhr.responseText:e=this.xhr.responseText}catch(r){this.onError(r)}e!=null&&this.onData(e)},h0.prototype.hasXDR=function(){return typeof XDomainRequest!="undefined"&&!this.xs&&this.enablesXDR},h0.prototype.abort=function(){this.cleanup()},h0.requestsCount=0,h0.requests={},typeof document!="undefined"){if(typeof attachEvent=="function")attachEvent("onunload",Qi);else if(typeof addEventListener=="function"){var Jc="onpagehide"in Qc?"pagehide":"unload";addEventListener(Jc,Qi,!1)}}function Qi(){for(var e in h0.requests)h0.requests.hasOwnProperty(e)&&h0.requests[e].abort()}var ef=fn.exports,yn=Gi,tf=It,Ji=sn,rf=Ue,nf=/\n/g,af=/\\n/g,Ot;function xf(){}function Ue(e){yn.call(this,e),this.query=this.query||{},Ot||(Ot=Ji.___eio=Ji.___eio||[]),this.index=Ot.length;var t=this;Ot.push(function(r){t.onData(r)}),this.query.j=this.index,typeof addEventListener=="function"&&addEventListener("beforeunload",function(){t.script&&(t.script.onerror=xf)},!1)}tf(Ue,yn),Ue.prototype.supportsBinary=!1,Ue.prototype.doClose=function(){this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),this.form&&(this.form.parentNode.removeChild(this.form),this.form=null,this.iframe=null),yn.prototype.doClose.call(this)},Ue.prototype.doPoll=function(){var e=this,t=document.createElement("script");this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),t.async=!0,t.src=this.uri(),t.onerror=function(a){e.onError("jsonp poll error",a)};var r=document.getElementsByTagName("script")[0];r?r.parentNode.insertBefore(t,r):(document.head||document.body).appendChild(t),this.script=t;var n=typeof navigator!="undefined"&&/gecko/i.test(navigator.userAgent);n&&setTimeout(function(){var a=document.createElement("iframe");document.body.appendChild(a),document.body.removeChild(a)},100)},Ue.prototype.doWrite=function(e,t){var r=this;if(!this.form){var n=document.createElement("form"),a=document.createElement("textarea"),i=this.iframeId="eio_iframe_"+this.index,d;n.className="socketio",n.style.position="absolute",n.style.top="-1000px",n.style.left="-1000px",n.target=i,n.method="POST",n.setAttribute("accept-charset","utf-8"),a.name="d",n.appendChild(a),document.body.appendChild(n),this.form=n,this.area=a}this.form.action=this.uri();function c(){p(),t()}function p(){if(r.iframe)try{r.form.removeChild(r.iframe)}catch(o){r.onError("jsonp polling iframe removal error",o)}try{var x='<iframe src="javascript:0" name="'+r.iframeId+'">';d=document.createElement(x)}catch(o){d=document.createElement("iframe"),d.name=r.iframeId,d.src="javascript:0"}d.id=r.iframeId,r.form.appendChild(d),r.iframe=d}p(),e=e.replace(af,`\\
|
|
21
|
+
`),this.area.value=e.replace(nf,"\\n");try{this.form.submit()}catch(x){}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){r.iframe.readyState==="complete"&&c()}:this.iframe.onload=c};var gn=ln(),of=ve,sf=Me,cf=It,ff=ji,df=G0("engine.io-client:websocket"),Ht,mn;if(typeof WebSocket!="undefined"?Ht=WebSocket:typeof self!="undefined"&&(Ht=self.WebSocket||self.MozWebSocket),typeof window=="undefined")try{mn=Wn}catch(e){}var Le=Ht||mn,uf=I0;function I0(e){var t=e&&e.forceBase64;t&&(this.supportsBinary=!1),this.perMessageDeflate=e.perMessageDeflate,this.usingBrowserWebSocket=Ht&&!e.forceNode,this.protocols=e.protocols,this.usingBrowserWebSocket||(Le=mn),gn.call(this,e)}cf(I0,gn),I0.prototype.name="websocket",I0.prototype.supportsBinary=!0,I0.prototype.doOpen=function(){if(this.check()){var e=this.uri(),t=this.protocols,r={};this.isReactNative||(r.agent=this.agent,r.perMessageDeflate=this.perMessageDeflate,r.pfx=this.pfx,r.key=this.key,r.passphrase=this.passphrase,r.cert=this.cert,r.ca=this.ca,r.ciphers=this.ciphers,r.rejectUnauthorized=this.rejectUnauthorized),this.extraHeaders&&(r.headers=this.extraHeaders),this.localAddress&&(r.localAddress=this.localAddress);try{this.ws=this.usingBrowserWebSocket&&!this.isReactNative?t?new Le(e,t):new Le(e):new Le(e,t,r)}catch(n){return this.emit("error",n)}this.ws.binaryType===void 0&&(this.supportsBinary=!1),this.ws.supports&&this.ws.supports.binary?(this.supportsBinary=!0,this.ws.binaryType="nodebuffer"):this.ws.binaryType="arraybuffer",this.addEventListeners()}},I0.prototype.addEventListeners=function(){var e=this;this.ws.onopen=function(){e.onOpen()},this.ws.onclose=function(){e.onClose()},this.ws.onmessage=function(t){e.onData(t.data)},this.ws.onerror=function(t){e.onError("websocket error",t)}},I0.prototype.write=function(e){var t=this;this.writable=!1;for(var r=e.length,n=0,a=r;n<a;n++)(function(d){of.encodePacket(d,t.supportsBinary,function(c){if(!t.usingBrowserWebSocket){var p={};if(d.options&&(p.compress=d.options.compress),t.perMessageDeflate){var x=typeof c=="string"?Buffer.byteLength(c):c.length;x<t.perMessageDeflate.threshold&&(p.compress=!1)}}try{t.usingBrowserWebSocket?t.ws.send(c):t.ws.send(c,p)}catch(o){df("websocket closed before onclose event")}--r||i()})})(e[n]);function i(){t.emit("flush"),setTimeout(function(){t.writable=!0,t.emit("drain")},0)}},I0.prototype.onClose=function(){gn.prototype.onClose.call(this)},I0.prototype.doClose=function(){typeof this.ws!="undefined"&&this.ws.close()},I0.prototype.uri=function(){var e=this.query||{},t=this.secure?"wss":"ws",r="";this.port&&(t==="wss"&&Number(this.port)!==443||t==="ws"&&Number(this.port)!==80)&&(r=":"+this.port),this.timestampRequests&&(e[this.timestampParam]=ff()),this.supportsBinary||(e.b64=1),e=sf.encode(e),e.length&&(e="?"+e);var n=this.hostname.indexOf(":")!==-1;return t+"://"+(n?"["+this.hostname+"]":this.hostname)+r+this.path+e},I0.prototype.check=function(){return!!Le&&!("__initialize"in Le&&this.name===I0.prototype.name)};var hf=cn,lf=ef,pf=rf,bf=uf;St.polling=vf,St.websocket=bf;function vf(e){var t,r=!1,n=!1,a=e.jsonp!==!1;if(typeof location!="undefined"){var i=location.protocol==="https:",d=location.port;d||(d=i?443:80),r=e.hostname!==location.hostname||d!==e.port,n=e.secure!==i}if(e.xdomain=r,e.xscheme=n,t=new hf(e),"open"in t&&!e.forceJSONP)return new lf(e);if(!a)throw new Error("JSONP disabled");return new pf(e)}var yf=[].indexOf,ex=function(e,t){if(yf)return e.indexOf(t);for(var r=0;r<e.length;++r)if(e[r]===t)return r;return-1},gf=St,mf=He,u0=G0("engine.io-client:socket"),Bf=ex,tx=ve,rx=Si,Cf=Me,Ef=J;function J(e,t){if(!(this instanceof J))return new J(e,t);t=t||{},e&&typeof e=="object"&&(t=e,e=null),e?(e=rx(e),t.hostname=e.host,t.secure=e.protocol==="https"||e.protocol==="wss",t.port=e.port,e.query&&(t.query=e.query)):t.host&&(t.hostname=rx(t.host).host),this.secure=t.secure!=null?t.secure:typeof location!="undefined"&&location.protocol==="https:",t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.agent=t.agent||!1,this.hostname=t.hostname||(typeof location!="undefined"?location.hostname:"localhost"),this.port=t.port||(typeof location!="undefined"&&location.port?location.port:this.secure?443:80),this.query=t.query||{},typeof this.query=="string"&&(this.query=Cf.decode(this.query)),this.upgrade=t.upgrade!==!1,this.path=(t.path||"/engine.io").replace(/\/$/,"")+"/",this.forceJSONP=!!t.forceJSONP,this.jsonp=t.jsonp!==!1,this.forceBase64=!!t.forceBase64,this.enablesXDR=!!t.enablesXDR,this.withCredentials=t.withCredentials!==!1,this.timestampParam=t.timestampParam||"t",this.timestampRequests=t.timestampRequests,this.transports=t.transports||["polling","websocket"],this.transportOptions=t.transportOptions||{},this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.policyPort=t.policyPort||843,this.rememberUpgrade=t.rememberUpgrade||!1,this.binaryType=null,this.onlyBinaryUpgrades=t.onlyBinaryUpgrades,this.perMessageDeflate=t.perMessageDeflate!==!1?t.perMessageDeflate||{}:!1,this.perMessageDeflate===!0&&(this.perMessageDeflate={}),this.perMessageDeflate&&this.perMessageDeflate.threshold==null&&(this.perMessageDeflate.threshold=1024),this.pfx=t.pfx||void 0,this.key=t.key||void 0,this.passphrase=t.passphrase||void 0,this.cert=t.cert||void 0,this.ca=t.ca||void 0,this.ciphers=t.ciphers||void 0,this.rejectUnauthorized=t.rejectUnauthorized===void 0?!0:t.rejectUnauthorized,this.forceNode=!!t.forceNode,this.isReactNative=typeof navigator!="undefined"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative",(typeof self=="undefined"||this.isReactNative)&&(t.extraHeaders&&Object.keys(t.extraHeaders).length>0&&(this.extraHeaders=t.extraHeaders),t.localAddress&&(this.localAddress=t.localAddress)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingIntervalTimer=null,this.pingTimeoutTimer=null,this.open()}J.priorWebsocketSuccess=!1,mf(J.prototype),J.protocol=tx.protocol,J.Socket=J,J.Transport=ln(),J.transports=St,J.parser=ve,J.prototype.createTransport=function(e){u0('creating transport "%s"',e);var t=_f(this.query);t.EIO=tx.protocol,t.transport=e;var r=this.transportOptions[e]||{};this.id&&(t.sid=this.id);var n=new gf[e]({query:t,socket:this,agent:r.agent||this.agent,hostname:r.hostname||this.hostname,port:r.port||this.port,secure:r.secure||this.secure,path:r.path||this.path,forceJSONP:r.forceJSONP||this.forceJSONP,jsonp:r.jsonp||this.jsonp,forceBase64:r.forceBase64||this.forceBase64,enablesXDR:r.enablesXDR||this.enablesXDR,withCredentials:r.withCredentials||this.withCredentials,timestampRequests:r.timestampRequests||this.timestampRequests,timestampParam:r.timestampParam||this.timestampParam,policyPort:r.policyPort||this.policyPort,pfx:r.pfx||this.pfx,key:r.key||this.key,passphrase:r.passphrase||this.passphrase,cert:r.cert||this.cert,ca:r.ca||this.ca,ciphers:r.ciphers||this.ciphers,rejectUnauthorized:r.rejectUnauthorized||this.rejectUnauthorized,perMessageDeflate:r.perMessageDeflate||this.perMessageDeflate,extraHeaders:r.extraHeaders||this.extraHeaders,forceNode:r.forceNode||this.forceNode,localAddress:r.localAddress||this.localAddress,requestTimeout:r.requestTimeout||this.requestTimeout,protocols:r.protocols||void 0,isReactNative:this.isReactNative});return n};function _f(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return t}J.prototype.open=function(){var e;if(this.rememberUpgrade&&J.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)e="websocket";else if(this.transports.length===0){var t=this;setTimeout(function(){t.emit("error","No transports available")},0);return}else e=this.transports[0];this.readyState="opening";try{e=this.createTransport(e)}catch(r){this.transports.shift(),this.open();return}e.open(),this.setTransport(e)},J.prototype.setTransport=function(e){u0("setting transport %s",e.name);var t=this;this.transport&&(u0("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=e,e.on("drain",function(){t.onDrain()}).on("packet",function(r){t.onPacket(r)}).on("error",function(r){t.onError(r)}).on("close",function(){t.onClose("transport close")})},J.prototype.probe=function(e){u0('probing transport "%s"',e);var t=this.createTransport(e,{probe:1}),r=!1,n=this;J.priorWebsocketSuccess=!1;function a(){if(n.onlyBinaryUpgrades){var h=!this.supportsBinary&&n.transport.supportsBinary;r=r||h}r||(u0('probe transport "%s" opened',e),t.send([{type:"ping",data:"probe"}]),t.once("packet",function(s){if(!r)if(s.type==="pong"&&s.data==="probe"){if(u0('probe transport "%s" pong',e),n.upgrading=!0,n.emit("upgrading",t),!t)return;J.priorWebsocketSuccess=t.name==="websocket",u0('pausing current transport "%s"',n.transport.name),n.transport.pause(function(){r||n.readyState!=="closed"&&(u0("changing transport and sending upgrade packet"),o(),n.setTransport(t),t.send([{type:"upgrade"}]),n.emit("upgrade",t),t=null,n.upgrading=!1,n.flush())})}else{u0('probe transport "%s" failed',e);var f=new Error("probe error");f.transport=t.name,n.emit("upgradeError",f)}}))}function i(){r||(r=!0,o(),t.close(),t=null)}function d(h){var s=new Error("probe error: "+h);s.transport=t.name,i(),u0('probe transport "%s" failed because of error: %s',e,h),n.emit("upgradeError",s)}function c(){d("transport closed")}function p(){d("socket closed")}function x(h){t&&h.name!==t.name&&(u0('"%s" works - aborting "%s"',h.name,t.name),i())}function o(){t.removeListener("open",a),t.removeListener("error",d),t.removeListener("close",c),n.removeListener("close",p),n.removeListener("upgrading",x)}t.once("open",a),t.once("error",d),t.once("close",c),this.once("close",p),this.once("upgrading",x),t.open()},J.prototype.onOpen=function(){if(u0("socket open"),this.readyState="open",J.priorWebsocketSuccess=this.transport.name==="websocket",this.emit("open"),this.flush(),this.readyState==="open"&&this.upgrade&&this.transport.pause){u0("starting upgrade probes");for(var e=0,t=this.upgrades.length;e<t;e++)this.probe(this.upgrades[e])}},J.prototype.onPacket=function(e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(u0('socket receive: type "%s", data "%s"',e.type,e.data),this.emit("packet",e),this.emit("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"pong":this.setPing(),this.emit("pong");break;case"error":var t=new Error("server error");t.code=e.data,this.onError(t);break;case"message":this.emit("data",e.data),this.emit("message",e.data);break}else u0('packet received with socket readyState "%s"',this.readyState)},J.prototype.onHandshake=function(e){this.emit("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this.upgrades=this.filterUpgrades(e.upgrades),this.pingInterval=e.pingInterval,this.pingTimeout=e.pingTimeout,this.onOpen(),this.readyState!=="closed"&&(this.setPing(),this.removeListener("heartbeat",this.onHeartbeat),this.on("heartbeat",this.onHeartbeat))},J.prototype.onHeartbeat=function(e){clearTimeout(this.pingTimeoutTimer);var t=this;t.pingTimeoutTimer=setTimeout(function(){t.readyState!=="closed"&&t.onClose("ping timeout")},e||t.pingInterval+t.pingTimeout)},J.prototype.setPing=function(){var e=this;clearTimeout(e.pingIntervalTimer),e.pingIntervalTimer=setTimeout(function(){u0("writing ping packet - expecting pong within %sms",e.pingTimeout),e.ping(),e.onHeartbeat(e.pingTimeout)},e.pingInterval)},J.prototype.ping=function(){var e=this;this.sendPacket("ping",function(){e.emit("ping")})},J.prototype.onDrain=function(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emit("drain"):this.flush()},J.prototype.flush=function(){this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length&&(u0("flushing %d packets in socket",this.writeBuffer.length),this.transport.send(this.writeBuffer),this.prevBufferLen=this.writeBuffer.length,this.emit("flush"))},J.prototype.write=J.prototype.send=function(e,t,r){return this.sendPacket("message",e,t,r),this},J.prototype.sendPacket=function(e,t,r,n){if(typeof t=="function"&&(n=t,t=void 0),typeof r=="function"&&(n=r,r=null),!(this.readyState==="closing"||this.readyState==="closed")){r=r||{},r.compress=r.compress!==!1;var a={type:e,data:t,options:r};this.emit("packetCreate",a),this.writeBuffer.push(a),n&&this.once("flush",n),this.flush()}},J.prototype.close=function(){if(this.readyState==="opening"||this.readyState==="open"){this.readyState="closing";var e=this;this.writeBuffer.length?this.once("drain",function(){this.upgrading?n():t()}):this.upgrading?n():t()}function t(){e.onClose("forced close"),u0("socket closing - telling transport to close"),e.transport.close()}function r(){e.removeListener("upgrade",r),e.removeListener("upgradeError",r),t()}function n(){e.once("upgrade",r),e.once("upgradeError",r)}return this},J.prototype.onError=function(e){u0("socket error %j",e),J.priorWebsocketSuccess=!1,this.emit("error",e),this.onClose("transport error",e)},J.prototype.onClose=function(e,t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){u0('socket close with reason: "%s"',e);var r=this;clearTimeout(this.pingIntervalTimer),clearTimeout(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),this.readyState="closed",this.id=null,this.emit("close",e,t),r.writeBuffer=[],r.prevBufferLen=0}},J.prototype.filterUpgrades=function(e){for(var t=[],r=0,n=e.length;r<n;r++)~Bf(this.transports,e[r])&&t.push(e[r]);return t},xn.exports=Ef,xn.exports.parser=ve;var Ff=xn.exports,nx={exports:{}},Af=Df;function Df(e,t){var r=[];t=t||0;for(var n=t||0;n<e.length;n++)r[n-t]=e[n];return r}var ax=wf;function wf(e,t,r){return e.on(t,r),{destroy:function(){e.removeListener(t,r)}}}var ix=[].slice,xx=function(e,t){if(typeof t=="string"&&(t=e[t]),typeof t!="function")throw new Error("bind() requires a function");var r=ix.call(arguments,2);return function(){return t.apply(e,r.concat(ix.call(arguments)))}};(function(e,t){var r=Dt,n=He,a=Af,i=ax,d=xx,c=G0("socket.io-client:socket"),p=Me,x=Oi;e.exports=s;var o={connect:1,connect_error:1,connect_timeout:1,connecting:1,disconnect:1,error:1,reconnect:1,reconnect_attempt:1,reconnect_failed:1,reconnect_error:1,reconnecting:1,ping:1,pong:1},h=n.prototype.emit;function s(f,v,m){this.io=f,this.nsp=v,this.json=this,this.ids=0,this.acks={},this.receiveBuffer=[],this.sendBuffer=[],this.connected=!1,this.disconnected=!0,this.flags={},m&&m.query&&(this.query=m.query),this.io.autoConnect&&this.open()}n(s.prototype),s.prototype.subEvents=function(){if(!this.subs){var f=this.io;this.subs=[i(f,"open",d(this,"onopen")),i(f,"packet",d(this,"onpacket")),i(f,"close",d(this,"onclose"))]}},s.prototype.open=s.prototype.connect=function(){return this.connected?this:(this.subEvents(),this.io.reconnecting||this.io.open(),this.io.readyState==="open"&&this.onopen(),this.emit("connecting"),this)},s.prototype.send=function(){var f=a(arguments);return f.unshift("message"),this.emit.apply(this,f),this},s.prototype.emit=function(f){if(o.hasOwnProperty(f))return h.apply(this,arguments),this;var v=a(arguments),m={type:(this.flags.binary!==void 0?this.flags.binary:x(v))?r.BINARY_EVENT:r.EVENT,data:v};return m.options={},m.options.compress=!this.flags||this.flags.compress!==!1,typeof v[v.length-1]=="function"&&(c("emitting packet with ack id %d",this.ids),this.acks[this.ids]=v.pop(),m.id=this.ids++),this.connected?this.packet(m):this.sendBuffer.push(m),this.flags={},this},s.prototype.packet=function(f){f.nsp=this.nsp,this.io.packet(f)},s.prototype.onopen=function(){if(c("transport is open - connecting"),this.nsp!=="/")if(this.query){var f=typeof this.query=="object"?p.encode(this.query):this.query;c("sending connect packet with query %s",f),this.packet({type:r.CONNECT,query:f})}else this.packet({type:r.CONNECT})},s.prototype.onclose=function(f){c("close (%s)",f),this.connected=!1,this.disconnected=!0,delete this.id,this.emit("disconnect",f)},s.prototype.onpacket=function(f){var v=f.nsp===this.nsp,m=f.type===r.ERROR&&f.nsp==="/";if(!(!v&&!m))switch(f.type){case r.CONNECT:this.onconnect();break;case r.EVENT:this.onevent(f);break;case r.BINARY_EVENT:this.onevent(f);break;case r.ACK:this.onack(f);break;case r.BINARY_ACK:this.onack(f);break;case r.DISCONNECT:this.ondisconnect();break;case r.ERROR:this.emit("error",f.data);break}},s.prototype.onevent=function(f){var v=f.data||[];c("emitting event %j",v),f.id!=null&&(c("attaching ack callback to event"),v.push(this.ack(f.id))),this.connected?h.apply(this,v):this.receiveBuffer.push(v)},s.prototype.ack=function(f){var v=this,m=!1;return function(){if(!m){m=!0;var C=a(arguments);c("sending ack %j",C),v.packet({type:x(C)?r.BINARY_ACK:r.ACK,id:f,data:C})}}},s.prototype.onack=function(f){var v=this.acks[f.id];typeof v=="function"?(c("calling ack %s with %j",f.id,f.data),v.apply(this,f.data),delete this.acks[f.id]):c("bad ack %s",f.id)},s.prototype.onconnect=function(){this.connected=!0,this.disconnected=!1,this.emitBuffered(),this.emit("connect")},s.prototype.emitBuffered=function(){var f;for(f=0;f<this.receiveBuffer.length;f++)h.apply(this,this.receiveBuffer[f]);for(this.receiveBuffer=[],f=0;f<this.sendBuffer.length;f++)this.packet(this.sendBuffer[f]);this.sendBuffer=[]},s.prototype.ondisconnect=function(){c("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")},s.prototype.destroy=function(){if(this.subs){for(var f=0;f<this.subs.length;f++)this.subs[f].destroy();this.subs=null}this.io.destroy(this)},s.prototype.close=s.prototype.disconnect=function(){return this.connected&&(c("performing disconnect (%s)",this.nsp),this.packet({type:r.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this},s.prototype.compress=function(f){return this.flags.compress=f,this},s.prototype.binary=function(f){return this.flags.binary=f,this}})(nx);var ox=nx.exports,Sf=$e;function $e(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}$e.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),r=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+r:e-r}return Math.min(e,this.max)|0},$e.prototype.reset=function(){this.attempts=0},$e.prototype.setMin=function(e){this.ms=e},$e.prototype.setMax=function(e){this.max=e},$e.prototype.setJitter=function(e){this.jitter=e};var Tf=Ff,kf=ox,Rf=He,Pf=Dt,oe=ax,Ke=xx,m0=G0("socket.io-client:manager"),sx=ex,If=Sf,cx=Object.prototype.hasOwnProperty,fx=n0;function n0(e,t){if(!(this instanceof n0))return new n0(e,t);e&&typeof e=="object"&&(t=e,e=void 0),t=t||{},t.path=t.path||"/socket.io",this.nsps={},this.subs=[],this.opts=t,this.reconnection(t.reconnection!==!1),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor(t.randomizationFactor||.5),this.backoff=new If({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(t.timeout==null?2e4:t.timeout),this.readyState="closed",this.uri=e,this.connecting=[],this.lastPing=null,this.encoding=!1,this.packetBuffer=[];var r=t.parser||Pf;this.encoder=new r.Encoder,this.decoder=new r.Decoder,this.autoConnect=t.autoConnect!==!1,this.autoConnect&&this.open()}n0.prototype.emitAll=function(){this.emit.apply(this,arguments);for(var e in this.nsps)cx.call(this.nsps,e)&&this.nsps[e].emit.apply(this.nsps[e],arguments)},n0.prototype.updateSocketIds=function(){for(var e in this.nsps)cx.call(this.nsps,e)&&(this.nsps[e].id=this.generateId(e))},n0.prototype.generateId=function(e){return(e==="/"?"":e+"#")+this.engine.id},Rf(n0.prototype),n0.prototype.reconnection=function(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection},n0.prototype.reconnectionAttempts=function(e){return arguments.length?(this._reconnectionAttempts=e,this):this._reconnectionAttempts},n0.prototype.reconnectionDelay=function(e){return arguments.length?(this._reconnectionDelay=e,this.backoff&&this.backoff.setMin(e),this):this._reconnectionDelay},n0.prototype.randomizationFactor=function(e){return arguments.length?(this._randomizationFactor=e,this.backoff&&this.backoff.setJitter(e),this):this._randomizationFactor},n0.prototype.reconnectionDelayMax=function(e){return arguments.length?(this._reconnectionDelayMax=e,this.backoff&&this.backoff.setMax(e),this):this._reconnectionDelayMax},n0.prototype.timeout=function(e){return arguments.length?(this._timeout=e,this):this._timeout},n0.prototype.maybeReconnectOnOpen=function(){!this.reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()},n0.prototype.open=n0.prototype.connect=function(e,t){if(m0("readyState %s",this.readyState),~this.readyState.indexOf("open"))return this;m0("opening %s",this.uri),this.engine=Tf(this.uri,this.opts);var r=this.engine,n=this;this.readyState="opening",this.skipReconnect=!1;var a=oe(r,"open",function(){n.onopen(),e&&e()}),i=oe(r,"error",function(p){if(m0("connect_error"),n.cleanup(),n.readyState="closed",n.emitAll("connect_error",p),e){var x=new Error("Connection error");x.data=p,e(x)}else n.maybeReconnectOnOpen()});if(this._timeout!==!1){var d=this._timeout;m0("connect attempt will timeout after %d",d),d===0&&a.destroy();var c=setTimeout(function(){m0("connect attempt timed out after %d",d),a.destroy(),r.close(),r.emit("error","timeout"),n.emitAll("connect_timeout",d)},d);this.subs.push({destroy:function(){clearTimeout(c)}})}return this.subs.push(a),this.subs.push(i),this},n0.prototype.onopen=function(){m0("open"),this.cleanup(),this.readyState="open",this.emit("open");var e=this.engine;this.subs.push(oe(e,"data",Ke(this,"ondata"))),this.subs.push(oe(e,"ping",Ke(this,"onping"))),this.subs.push(oe(e,"pong",Ke(this,"onpong"))),this.subs.push(oe(e,"error",Ke(this,"onerror"))),this.subs.push(oe(e,"close",Ke(this,"onclose"))),this.subs.push(oe(this.decoder,"decoded",Ke(this,"ondecoded")))},n0.prototype.onping=function(){this.lastPing=new Date,this.emitAll("ping")},n0.prototype.onpong=function(){this.emitAll("pong",new Date-this.lastPing)},n0.prototype.ondata=function(e){this.decoder.add(e)},n0.prototype.ondecoded=function(e){this.emit("packet",e)},n0.prototype.onerror=function(e){m0("error",e),this.emitAll("error",e)},n0.prototype.socket=function(e,t){var r=this.nsps[e];if(!r){r=new kf(this,e,t),this.nsps[e]=r;var n=this;r.on("connecting",a),r.on("connect",function(){r.id=n.generateId(e)}),this.autoConnect&&a()}function a(){~sx(n.connecting,r)||n.connecting.push(r)}return r},n0.prototype.destroy=function(e){var t=sx(this.connecting,e);~t&&this.connecting.splice(t,1),!this.connecting.length&&this.close()},n0.prototype.packet=function(e){m0("writing packet %j",e);var t=this;e.query&&e.type===0&&(e.nsp+="?"+e.query),t.encoding?t.packetBuffer.push(e):(t.encoding=!0,this.encoder.encode(e,function(r){for(var n=0;n<r.length;n++)t.engine.write(r[n],e.options);t.encoding=!1,t.processPacketQueue()}))},n0.prototype.processPacketQueue=function(){if(this.packetBuffer.length>0&&!this.encoding){var e=this.packetBuffer.shift();this.packet(e)}},n0.prototype.cleanup=function(){m0("cleanup");for(var e=this.subs.length,t=0;t<e;t++){var r=this.subs.shift();r.destroy()}this.packetBuffer=[],this.encoding=!1,this.lastPing=null,this.decoder.destroy()},n0.prototype.close=n0.prototype.disconnect=function(){m0("disconnect"),this.skipReconnect=!0,this.reconnecting=!1,this.readyState==="opening"&&this.cleanup(),this.backoff.reset(),this.readyState="closed",this.engine&&this.engine.close()},n0.prototype.onclose=function(e){m0("onclose"),this.cleanup(),this.backoff.reset(),this.readyState="closed",this.emit("close",e),this._reconnection&&!this.skipReconnect&&this.reconnect()},n0.prototype.reconnect=function(){if(this.reconnecting||this.skipReconnect)return this;var e=this;if(this.backoff.attempts>=this._reconnectionAttempts)m0("reconnect failed"),this.backoff.reset(),this.emitAll("reconnect_failed"),this.reconnecting=!1;else{var t=this.backoff.duration();m0("will wait %dms before reconnect attempt",t),this.reconnecting=!0;var r=setTimeout(function(){e.skipReconnect||(m0("attempting reconnect"),e.emitAll("reconnect_attempt",e.backoff.attempts),e.emitAll("reconnecting",e.backoff.attempts),!e.skipReconnect&&e.open(function(n){n?(m0("reconnect attempt error"),e.reconnecting=!1,e.reconnect(),e.emitAll("reconnect_error",n.data)):(m0("reconnect success"),e.onreconnect())}))},t);this.subs.push({destroy:function(){clearTimeout(r)}})}},n0.prototype.onreconnect=function(){var e=this.backoff.attempts;this.reconnecting=!1,this.backoff.reset(),this.updateSocketIds(),this.emitAll("reconnect",e)},function(e,t){var r=bc,n=Dt,a=fx,i=G0("socket.io-client");e.exports=t=c;var d=t.managers={};function c(p,x){typeof p=="object"&&(x=p,p=void 0),x=x||{};var o=r(p),h=o.source,s=o.id,f=o.path,v=d[s]&&f in d[s].nsps,m=x.forceNew||x["force new connection"]||x.multiplex===!1||v,C;return m?(i("ignoring socket cache for %s",h),C=a(h,x)):(d[s]||(i("new io instance for %s",h),d[s]=a(h,x)),C=d[s]),o.query&&!x.query&&(x.query=o.query),C.socket(o.path,x)}t.protocol=n.protocol,t.connect=c,t.Manager=fx,t.Socket=ox}(Qr,Qr.exports);var qf=Qr.exports;const Of=Ze(qf),Hf=Object.prototype.hasOwnProperty;function dx(e,t){return Hf.call(e,t)}function Nf(){return dx(window,"WebSocket")||dx(window,"MozWebSocket")}const ux=["message","product","lottery","questionnaire","coupon","activityLottery","testQuestion","emotion","speak","customMessage","motivation"];class Mf{constructor(){V(this,"__defaultEventKey","DEFAULT_EVENT");V(this,"__allEventKey","ALL_EVENT");V(this,"__appSocketEventStore",{});V(this,"__socketListens",{});for(const t of ux)this.__socketListens[t]=this.__createSocketHandle(t)}__createSocketHandle(t){return r=>{try{if(r instanceof ArrayBuffer)return;const n=JSON.parse(r);if(n){const a=d=>{for(const c in this.__appSocketEventStore){const p=`${t}.${d}`;c.includes(p)&&this.__appSocketEventStore[c].forEach(o=>{o(n)})}},i=n.EVENT||this.__defaultEventKey;a(i),a(this.__allEventKey)}}catch(n){console.warn(n)}}}listenSocketEvent(t){return e0(this,null,function*(){for(const r in this.__socketListens){const n=this.__socketListens[r];if(!n)return;t.on(r,n)}})}addSocketHandles(t,r,n){const a=(i,d)=>{const c=`${t}.${n}.${i}`;this.__appSocketEventStore[c]||(this.__appSocketEventStore[c]=[]),this.__appSocketEventStore[c].push(d)};if(typeof r=="function"){a(this.__allEventKey,r);return}for(const i in r)a(i,r[i])}}class zf{constructor(t){V(this,"eventEmitter",new ac);V(this,"__eventStore",new Mf);V(this,"__socket");this.config=t}_afterConnect(){}getToken(){return Promise.resolve(this.config.token)}getChannelInfo(){return Promise.resolve(this.config.channelInfo)}getUserInfo(){return Promise.resolve(this.config.userInfo)}getSocket(t=!0){if(t&&!this.__socket)throw new Error("Socket 连接未初始化");return this.__socket}_initSocket(){return new Promise(t=>{e0(this,null,function*(){const r=Kr(this.config.domainInfo).chatWsDomain,n=[2e3,3e3,4e3,5e3],a=yield this.getToken();this.config.customSocket?this.__socket=this.config.customSocket:this.__socket=Of(Xo(r),{query:{token:a,version:this.config.socketVersion||"3.0"},transports:[Nf()?"websocket":"polling"],reconnectionDelay:n[Math.floor(Math.random()*n.length)],randomizationFactor:Math.random()}),this.__bindConnectEvent(),this.__eventStore.listenSocketEvent(this.__socket),t()})})}_connectSocket(){return new Promise(t=>{const r=this.getSocket(),n=()=>{t()};r.disconnected&&(r.once("connect",n),r.connect()),r.connected&&n()})}__bindConnectEvent(){const t=this.getSocket(),r={connect:()=>{this._afterConnect(),this.eventEmitter.emit($0.ConnectSuccess)},disconnect:()=>{this.eventEmitter.emit($0.Disconnect)},reconnect:()=>{this.eventEmitter.emit($0.ReconnectSuccess)},error:()=>{this.eventEmitter.emit($0.ConnectFailed,{reason:Oe.SocketConnectError})},connect_error:()=>{this.eventEmitter.emit($0.ConnectFailed,{reason:Oe.SocketConnectError})},connect_timeout:()=>{this.eventEmitter.emit($0.ConnectFailed,{reason:Oe.SocketConnectTimeout})}};for(const n in r)t.on(n,r[n])}emitSocket(t,r="message",n){return new Promise((a,i)=>{e0(this,null,function*(){const{checkCode:d=!0,directCallback:c=!1}=n||{},p=this.getSocket(),x=(...o)=>{if(c){a(o);return}const h=o[0];let s=h;if(h instanceof ArrayBuffer)return;let f=h;if(typeof h=="string")try{f=JSON.parse(h)}catch(v){}if(typeof h=="object"&&(f=h),f&&typeof f.code=="number"&&d)if(f.code===200)s=f.data;else{i(f);return}else s=f;a(s)};p==null||p.emit(r,JSON.stringify(t),x)})})}addSocketHandles(t,r,n="message"){this.__eventStore.addSocketHandles(t,r,n)}disconnect(){return new Promise(t=>{const r=this.getSocket();if(r.disconnected){t();return}r.once("disconnect",()=>{t()}),r.disconnect()})}}class Uf extends zf{constructor(r){super(r);V(this,"ConnectFailReason",Oe);V(this,"SocketUserType",N0);V(this,"chatApi",new Qo(this));V(this,"polyvApi",new nc(this))}setup(){return e0(this,null,function*(){yield this._initSocket(),this.config.customSocket||(yield this._connectSocket())})}_afterConnect(){const{autoLogin:r=!0}=this.config;r&&this.loginSocket()}loginSocket(){return e0(this,null,function*(){const r=yield this.getUserInfo(),n=yield this.getChannelInfo(),a=this.config.statisticsParams,i={EVENT:"LOGIN",values:[r.nick,r.pic,r.userId],channelId:String(n.channelId),roomId:String(n.channelId),type:r.userType};n.sessionId&&(i.sessionId=n.sessionId),(a!=null&&a.param4||r.wxUnionId)&&(i.param4=a==null?void 0:a.param4),a!=null&&a.param5&&(i.param5=a.param5),r.actor&&(i.actor=r.actor);const c=(yield this.emitSocket(i,"message",{directCallback:!0}))[0];String(c)[0]==="2"?this.eventEmitter.emit($0.LoginSuccess,{code:c}):this.eventEmitter.emit($0.LoginFailed,{code:c})})}isSpecialUserType(r,n){return r===N0.Dummy?!!n&&n!=="观众":[N0.Teacher,N0.Manager,N0.Guest,N0.Assistant,N0.Attendee,N0.Dummy,N0.UserTagsMonitor].includes(r)}isCurrentUser(r){return this.config.userInfo.userId===r}}s0.ConnectFailReason=Oe,s0.PolyvSocket=Uf,s0.PolyvSocketEvent=$0,s0.RequestAuthorizeMethod=Qe,s0.SecurityMode=vt,s0.SocketUserType=N0,s0.socketEventTypes=ux,Object.defineProperty(s0,Symbol.toStringTag,{value:"Module"})});console.log("%c@polyv/socket","background:#67C23A;padding: 2px 6px;border-radius: 3px;color: #fff","[version: 2.0.0-rc-20250925.1]","[buildTime: 2025-09-25 03:16:20]");
|