mx3d 0.0.49 → 0.1.0

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/mx3d.min.js CHANGED
@@ -1,8 +1,8 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("TWEEN"),require("h337"),require("BABYLON"),require("babylonjs-materials"),require("BABYLON.GUI"),require("BABYLON.SceneLoader"),require("babylonjs-serializers")):"function"==typeof define&&define.amd?define(["TWEEN","h337","BABYLON","babylonjs-materials","BABYLON.GUI","BABYLON.SceneLoader","babylonjs-serializers"],t):"object"==typeof exports?exports.MX3D=t(require("TWEEN"),require("h337"),require("BABYLON"),require("babylonjs-materials"),require("BABYLON.GUI"),require("BABYLON.SceneLoader"),require("babylonjs-serializers")):e.MX3D=t(e.TWEEN,e.h337,e.BABYLON,e["babylonjs-materials"],e["BABYLON.GUI"],e["BABYLON.SceneLoader"],e["babylonjs-serializers"])}(window,function(i,n,r,s,o,a,c){return l=[function(e,t,i){"use strict";var n;i.d(t,"a",function(){return n}),(t=n=n||{})[t.Trace=0]="Trace",t[t.Debug=1]="Debug",t[t.Information=2]="Information",t[t.Warning=3]="Warning",t[t.Error=4]="Error",t[t.Critical=5]="Critical",t[t.None=6]="None"},function(e,m,v){"use strict";!function(t,e){v.d(m,"a",function(){return r}),v.d(m,"c",function(){return s}),v.d(m,"f",function(){return l}),v.d(m,"j",function(){return u}),v.d(m,"k",function(){return o}),v.d(m,"e",function(){return a}),v.d(m,"d",function(){return c}),v.d(m,"b",function(){return d}),v.d(m,"i",function(){return p}),v.d(m,"g",function(){return f}),v.d(m,"h",function(){return g});var h=v(0),i=v(11);const n="6.0.7";class r{static isRequired(e,t){if(null==e)throw new Error(`The '${t}' argument is required.`)}static isNotEmpty(e,t){if(!e||e.match(/^\s*$/))throw new Error(`The '${t}' argument should not be empty.`)}static isIn(e,t,i){if(!(e in t))throw new Error(`Unknown ${i} value: ${e}.`)}}class s{static get isBrowser(){return"object"==typeof window&&"object"==typeof window.document}static get isWebWorker(){return"object"==typeof self&&"importScripts"in self}static get isReactNative(){return"object"==typeof window&&void 0===window.document}static get isNode(){return!this.isBrowser&&!this.isWebWorker&&!this.isReactNative}}function l(e,t){let i="";return u(e)?(i=`Binary data of length ${e.byteLength}`,t&&(i+=`. Content: '${function(e){const t=new Uint8Array(e);let i="";return t.forEach(e=>{var t=e<16?"0":"";i+=`0x${t}${e.toString(16)} `}),i.substr(0,i.length-1)}(e)}'`)):"string"==typeof e&&(i=`String data of length ${e.length}`,t&&(i+=`. Content: '${e}'`)),i}function u(e){return e&&"undefined"!=typeof ArrayBuffer&&(e instanceof ArrayBuffer||e.constructor&&"ArrayBuffer"===e.constructor.name)}async function o(e,t,i,n,r,s,o){let a={};!r||(c=await r())&&(a={Authorization:`Bearer ${c}`});var[r,c]=p();a[r]=c,e.log(h.a.Trace,`(${t} transport) sending data. ${l(s,o.logMessageContent)}.`);c=u(s)?"arraybuffer":"text",o=await i.post(n,{content:s,headers:{...a,...o.headers},responseType:c,timeout:o.timeout,withCredentials:o.withCredentials});e.log(h.a.Trace,`(${t} transport) request complete. Response status: ${o.statusCode}.`)}function a(e){return void 0===e?new d(h.a.Information):null===e?i.a.instance:void 0!==e.log?e:new d(e)}class c{constructor(e,t){this._subject=e,this._observer=t}dispose(){var e=this._subject.observers.indexOf(this._observer);-1<e&&this._subject.observers.splice(e,1),0===this._subject.observers.length&&this._subject.cancelCallback&&this._subject.cancelCallback().catch(e=>{})}}class d{constructor(e){this._minLevel=e,this.out=console}log(e,t){if(e>=this._minLevel){var i=`[${(new Date).toISOString()}] ${h.a[e]}: ${t}`;switch(e){case h.a.Critical:case h.a.Error:this.out.error(i);break;case h.a.Warning:this.out.warn(i);break;case h.a.Information:this.out.info(i);break;default:this.out.log(i)}}}}function p(){let e="X-SignalR-User-Agent";return s.isNode&&(e="User-Agent"),[e,function(e,t,i,n){let r="Microsoft SignalR/";var s=e.split(".");r+=`${s[0]}.${s[1]}`,r+=` (${e}; `,r+=t&&""!==t?`${t}; `:"Unknown OS; ";r+=`${i}`,r+=n?`; ${n}`:"; Unknown Runtime Version";return r+=")",r}(n,function(){{if(!s.isNode)return"";switch(t.platform){case"win32":return"Windows NT";case"darwin":return"macOS";case"linux":return"Linux";default:return t.platform}}}(),s.isNode?"NodeJS":"Browser",function(){if(s.isNode)return t.versions.node;return}())]}function f(e){return e.stack||e.message||`${e}`}function g(){if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==e)return e;throw new Error("could not find global")}}.call(this,v(21),v(16))},function(t,e,g){!function(f){var e;t.exports=(e=function(h){var n;if("undefined"!=typeof window&&window.crypto&&(n=window.crypto),"undefined"!=typeof self&&self.crypto&&(n=self.crypto),!(n=!(n=!(n="undefined"!=typeof globalThis&&globalThis.crypto?globalThis.crypto:n)&&"undefined"!=typeof window&&window.msCrypto?window.msCrypto:n)&&void 0!==f&&f.crypto?f.crypto:n))try{n=g(59)}catch(e){}var i=Object.create||function(e){return t.prototype=e,e=new t,t.prototype=null,e};function t(){}var e={},r=e.lib={},s=r.Base={extend:function(e){var t=i(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),(t.init.prototype=t).$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},l=r.WordArray=s.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||a).stringify(this)},concat:function(e){var t=this.words,i=e.words,n=this.sigBytes,r=e.sigBytes;if(this.clamp(),n%4)for(var s=0;s<r;s++){var o=i[s>>>2]>>>24-s%4*8&255;t[n+s>>>2]|=o<<24-(n+s)%4*8}else for(var a=0;a<r;a+=4)t[n+a>>>2]=i[a>>>2];return this.sigBytes+=r,this},clamp:function(){var e=this.words,t=this.sigBytes;e[t>>>2]&=4294967295<<32-t%4*8,e.length=h.ceil(t/4)},clone:function(){var e=s.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],i=0;i<e;i+=4)t.push(function(){if(n){if("function"==typeof n.getRandomValues)try{return n.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof n.randomBytes)try{return n.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")}());return new l.init(t,e)}}),o=e.enc={},a=o.Hex={stringify:function(e){for(var t=e.words,i=e.sigBytes,n=[],r=0;r<i;r++){var s=t[r>>>2]>>>24-r%4*8&255;n.push((s>>>4).toString(16)),n.push((15&s).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,i=[],n=0;n<t;n+=2)i[n>>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new l.init(i,t/2)}},c=o.Latin1={stringify:function(e){for(var t=e.words,i=e.sigBytes,n=[],r=0;r<i;r++){var s=t[r>>>2]>>>24-r%4*8&255;n.push(String.fromCharCode(s))}return n.join("")},parse:function(e){for(var t=e.length,i=[],n=0;n<t;n++)i[n>>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new l.init(i,t)}},u=o.Utf8={stringify:function(e){try{return decodeURIComponent(escape(c.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return c.parse(unescape(encodeURIComponent(e)))}},d=r.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new l.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=u.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(e){var t,i=this._data,n=i.words,r=i.sigBytes,s=this.blockSize,o=r/(4*s),a=(o=e?h.ceil(o):h.max((0|o)-this._minBufferSize,0))*s,r=h.min(4*a,r);if(a){for(var c=0;c<a;c+=s)this._doProcessBlock(n,c);t=n.splice(0,a),i.sigBytes-=r}return new l.init(t,r)},clone:function(){var e=s.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0}),p=(r.Hasher=d.extend({cfg:s.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){d.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(i){return function(e,t){return new i.init(t).finalize(e)}},_createHmacHelper:function(i){return function(e,t){return new p.HMAC.init(i,t).finalize(e)}}}),e.algo={});return e}(Math),e)}.call(this,g(16))},function(e,t){e.exports=i},function(e,t,i){"use strict";var n,r=i(19),s=Object.prototype.toString,o=(n=Object.create(null),function(e){e=s.call(e);return n[e]||(n[e]=e.slice(8,-1).toLowerCase())});function a(t){return t=t.toLowerCase(),function(e){return o(e)===t}}function c(e){return Array.isArray(e)}function h(e){return void 0===e}var l=a("ArrayBuffer");function u(e){return null!==e&&"object"==typeof e}function d(e){if("object"!==o(e))return!1;e=Object.getPrototypeOf(e);return null===e||e===Object.prototype}var p=a("Date"),f=a("File"),g=a("Blob"),m=a("FileList");function v(e){return"[object Function]"===s.call(e)}var y=a("URLSearchParams");function b(e,t){if(null!=e)if(c(e="object"!=typeof e?[e]:e))for(var i=0,n=e.length;i<n;i++)t.call(null,e[i],i,e);else for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.call(null,e[r],r,e)}var w,i=(w="undefined"!=typeof Uint8Array&&Object.getPrototypeOf(Uint8Array),function(e){return w&&e instanceof w});e.exports={isArray:c,isArrayBuffer:l,isBuffer:function(e){return null!==e&&!h(e)&&null!==e.constructor&&!h(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){var t="[object FormData]";return e&&("function"==typeof FormData&&e instanceof FormData||s.call(e)===t||v(e.toString)&&e.toString()===t)},isArrayBufferView:function(e){return e="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&l(e.buffer)},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:u,isPlainObject:d,isUndefined:h,isDate:p,isFile:f,isBlob:g,isFunction:v,isStream:function(e){return u(e)&&v(e.pipe)},isURLSearchParams:y,isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:b,merge:function i(){var n={};function e(e,t){d(n[t])&&d(e)?n[t]=i(n[t],e):d(e)?n[t]=i({},e):c(e)?n[t]=e.slice():n[t]=e}for(var t=0,r=arguments.length;t<r;t++)b(arguments[t],e);return n},extend:function(i,e,n){return b(e,function(e,t){i[t]=n&&"function"==typeof e?r(e,n):e}),i},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},stripBOM:function(e){return e=65279===e.charCodeAt(0)?e.slice(1):e},inherits:function(e,t,i,n){e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,i&&Object.assign(e.prototype,i)},toFlatObject:function(e,t,i){var n,r,s,o={};t=t||{};do{for(r=(n=Object.getOwnPropertyNames(e)).length;0<r--;)o[s=n[r]]||(t[s]=e[s],o[s]=!0)}while((e=Object.getPrototypeOf(e))&&(!i||i(e,t))&&e!==Object.prototype);return t},kindOf:o,kindOfTest:a,endsWith:function(e,t,i){return e=String(e),(void 0===i||i>e.length)&&(i=e.length),i-=t.length,-1!==(t=e.indexOf(t,i))&&t===i},toArray:function(e){if(!e)return null;var t=e.length;if(h(t))return null;for(var i=new Array(t);0<t--;)i[t]=e[t];return i},isTypedArray:i,isFileList:m}},function(e,t,i){var g;e.exports=(g=i(2),i(7),void(g.lib.Cipher||function(){var e=g,t=e.lib,i=t.Base,o=t.WordArray,n=t.BufferedBlockAlgorithm,r=e.enc,s=(r.Utf8,r.Base64),a=e.algo.EvpKDF,c=t.Cipher=n.extend({cfg:i.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,i){this.cfg=this.cfg.extend(i),this._xformMode=e,this._key=t,this.reset()},reset:function(){n.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(n){return{encrypt:function(e,t,i){return h(t).encrypt(n,e,t,i)},decrypt:function(e,t,i){return h(t).decrypt(n,e,t,i)}}}});function h(e){return"string"==typeof e?f:p}t.StreamCipher=c.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var l=e.mode={},r=t.BlockCipherMode=i.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),r=l.CBC=((l=r.extend()).Encryptor=l.extend({processBlock:function(e,t){var i=this._cipher,n=i.blockSize;u.call(this,e,t,n),i.encryptBlock(e,t),this._prevBlock=e.slice(t,t+n)}}),l.Decryptor=l.extend({processBlock:function(e,t){var i=this._cipher,n=i.blockSize,r=e.slice(t,t+n);i.decryptBlock(e,t),u.call(this,e,t,n),this._prevBlock=r}}),l);function u(e,t,i){var n,r=this._iv;r?(n=r,this._iv=void 0):n=this._prevBlock;for(var s=0;s<i;s++)e[t+s]^=n[s]}var l=(e.pad={}).Pkcs7={pad:function(e,t){for(var t=4*t,i=t-e.sigBytes%t,n=i<<24|i<<16|i<<8|i,r=[],s=0;s<i;s+=4)r.push(n);t=o.create(r,i);e.concat(t)},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},d=(t.BlockCipher=c.extend({cfg:c.cfg.extend({mode:r,padding:l}),reset:function(){var e;c.reset.call(this);var t=this.cfg,i=t.iv,t=t.mode;this._xformMode==this._ENC_XFORM_MODE?e=t.createEncryptor:(e=t.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==e?this._mode.init(this,i&&i.words):(this._mode=e.call(t,this,i&&i.words),this._mode.__creator=e)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e,t=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(t.pad(this._data,this.blockSize),e=this._process(!0)):(e=this._process(!0),t.unpad(e)),e},blockSize:4}),t.CipherParams=i.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}})),l=(e.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,e=e.salt,t=e?o.create([1398893684,1701076831]).concat(e).concat(t):t;return t.toString(s)},parse:function(e){var t,i=s.parse(e),e=i.words;return 1398893684==e[0]&&1701076831==e[1]&&(t=o.create(e.slice(2,4)),e.splice(0,4),i.sigBytes-=16),d.create({ciphertext:i,salt:t})}},p=t.SerializableCipher=i.extend({cfg:i.extend({format:l}),encrypt:function(e,t,i,n){n=this.cfg.extend(n);var r=e.createEncryptor(i,n),t=r.finalize(t),r=r.cfg;return d.create({ciphertext:t,key:i,iv:r.iv,algorithm:e,mode:r.mode,padding:r.padding,blockSize:e.blockSize,formatter:n.format})},decrypt:function(e,t,i,n){return n=this.cfg.extend(n),t=this._parse(t,n.format),e.createDecryptor(i,n).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),e=(e.kdf={}).OpenSSL={execute:function(e,t,i,n){n=n||o.random(8);e=a.create({keySize:t+i}).compute(e,n),i=o.create(e.words.slice(t),4*i);return e.sigBytes=4*t,d.create({key:e,iv:i,salt:n})}},f=t.PasswordBasedCipher=p.extend({cfg:p.cfg.extend({kdf:e}),encrypt:function(e,t,i,n){i=(n=this.cfg.extend(n)).kdf.execute(i,e.keySize,e.ivSize);n.iv=i.iv;n=p.encrypt.call(this,e,t,i.key,n);return n.mixIn(i),n},decrypt:function(e,t,i,n){n=this.cfg.extend(n),t=this._parse(t,n.format);i=n.kdf.execute(i,e.keySize,e.ivSize,t.salt);return n.iv=i.iv,p.decrypt.call(this,e,t,i.key,n)}})}()))},function(e,t,i){e.exports=(e=i(2),i(13),i(60),i(61),i(9),i(62),i(10),i(17),i(29),i(63),i(30),i(64),i(65),i(66),i(18),i(67),i(7),i(5),i(68),i(69),i(70),i(71),i(72),i(73),i(74),i(75),i(76),i(77),i(78),i(79),i(80),i(81),i(82),i(83),e)},function(e,t,i){var s;e.exports=(s=i(2),i(17),i(18),function(){var e=s,t=e.lib,i=t.Base,l=t.WordArray,n=e.algo,t=n.MD5,r=n.EvpKDF=i.extend({cfg:i.extend({keySize:4,hasher:t,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var i,n=this.cfg,r=n.hasher.create(),s=l.create(),o=s.words,a=n.keySize,c=n.iterations;o.length<a;){i&&r.update(i),i=r.update(e).finalize(t),r.reset();for(var h=1;h<c;h++)i=r.finalize(i),r.reset();s.concat(i)}return s.sigBytes=4*a,s}});e.EvpKDF=function(e,t,i){return r.create(i).compute(e,t)}}(),s.EvpKDF)},function(e,t,i){"use strict";var a=i(4);function c(e,t,i,n,r){Error.call(this),this.message=e,this.name="AxiosError",t&&(this.code=t),i&&(this.config=i),n&&(this.request=n),r&&(this.response=r)}a.inherits(c,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var h=c.prototype,n={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED"].forEach(function(e){n[e]={value:e}}),Object.defineProperties(c,n),Object.defineProperty(h,"isAxiosError",{value:!0}),c.from=function(e,t,i,n,r,s){var o=Object.create(h);return a.toFlatObject(e,o,function(e){return e!==Error.prototype}),c.call(o,e.message,t,i,n,r),o.name=e.name,s&&Object.assign(o,s),o},e.exports=c},function(e,t,i){var n;e.exports=(n=i(2),function(){var c=n.lib.WordArray;n.enc.Base64={stringify:function(e){var t=e.words,i=e.sigBytes,n=this._map;e.clamp();for(var r=[],s=0;s<i;s+=3)for(var o=(t[s>>>2]>>>24-s%4*8&255)<<16|(t[s+1>>>2]>>>24-(s+1)%4*8&255)<<8|t[s+2>>>2]>>>24-(s+2)%4*8&255,a=0;a<4&&s+.75*a<i;a++)r.push(n.charAt(o>>>6*(3-a)&63));var c=n.charAt(64);if(c)for(;r.length%4;)r.push(c);return r.join("")},parse:function(e){var t=e.length,i=this._map;if(!(n=this._reverseMap))for(var n=this._reverseMap=[],r=0;r<i.length;r++)n[i.charCodeAt(r)]=r;var s=i.charAt(64);return!s||-1!==(s=e.indexOf(s))&&(t=s),function(e,t,i){for(var n=[],r=0,s=0;s<t;s++){var o,a;s%4&&(o=i[e.charCodeAt(s-1)]<<s%4*2,a=i[e.charCodeAt(s)]>>>6-s%4*2,a=o|a,n[r>>>2]|=a<<24-r%4*8,r++)}return c.create(n,r)}(e,t,n)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),n.enc.Base64)},function(e,t,i){var r;e.exports=(r=i(2),function(c){var e=r,t=e.lib,i=t.WordArray,n=t.Hasher,t=e.algo,C=[];!function(){for(var e=0;e<64;e++)C[e]=4294967296*c.abs(c.sin(e+1))|0}();t=t.MD5=n.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var i=0;i<16;i++){var n=t+i,r=e[n];e[n]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8)}var s=this._hash.words,o=e[t+0],a=e[t+1],c=e[t+2],h=e[t+3],l=e[t+4],u=e[t+5],d=e[t+6],p=e[t+7],f=e[t+8],g=e[t+9],m=e[t+10],v=e[t+11],y=e[t+12],b=e[t+13],w=e[t+14],_=e[t+15],A=S(A=s[0],E=s[1],x=s[2],B=s[3],o,7,C[0]),B=S(B,A,E,x,a,12,C[1]),x=S(x,B,A,E,c,17,C[2]),E=S(E,x,B,A,h,22,C[3]);A=S(A,E,x,B,l,7,C[4]),B=S(B,A,E,x,u,12,C[5]),x=S(x,B,A,E,d,17,C[6]),E=S(E,x,B,A,p,22,C[7]),A=S(A,E,x,B,f,7,C[8]),B=S(B,A,E,x,g,12,C[9]),x=S(x,B,A,E,m,17,C[10]),E=S(E,x,B,A,v,22,C[11]),A=S(A,E,x,B,y,7,C[12]),B=S(B,A,E,x,b,12,C[13]),x=S(x,B,A,E,w,17,C[14]),A=T(A,E=S(E,x,B,A,_,22,C[15]),x,B,a,5,C[16]),B=T(B,A,E,x,d,9,C[17]),x=T(x,B,A,E,v,14,C[18]),E=T(E,x,B,A,o,20,C[19]),A=T(A,E,x,B,u,5,C[20]),B=T(B,A,E,x,m,9,C[21]),x=T(x,B,A,E,_,14,C[22]),E=T(E,x,B,A,l,20,C[23]),A=T(A,E,x,B,g,5,C[24]),B=T(B,A,E,x,w,9,C[25]),x=T(x,B,A,E,h,14,C[26]),E=T(E,x,B,A,f,20,C[27]),A=T(A,E,x,B,b,5,C[28]),B=T(B,A,E,x,c,9,C[29]),x=T(x,B,A,E,p,14,C[30]),A=k(A,E=T(E,x,B,A,y,20,C[31]),x,B,u,4,C[32]),B=k(B,A,E,x,f,11,C[33]),x=k(x,B,A,E,v,16,C[34]),E=k(E,x,B,A,w,23,C[35]),A=k(A,E,x,B,a,4,C[36]),B=k(B,A,E,x,l,11,C[37]),x=k(x,B,A,E,p,16,C[38]),E=k(E,x,B,A,m,23,C[39]),A=k(A,E,x,B,b,4,C[40]),B=k(B,A,E,x,o,11,C[41]),x=k(x,B,A,E,h,16,C[42]),E=k(E,x,B,A,d,23,C[43]),A=k(A,E,x,B,g,4,C[44]),B=k(B,A,E,x,y,11,C[45]),x=k(x,B,A,E,_,16,C[46]),A=M(A,E=k(E,x,B,A,c,23,C[47]),x,B,o,6,C[48]),B=M(B,A,E,x,p,10,C[49]),x=M(x,B,A,E,w,15,C[50]),E=M(E,x,B,A,u,21,C[51]),A=M(A,E,x,B,y,6,C[52]),B=M(B,A,E,x,h,10,C[53]),x=M(x,B,A,E,m,15,C[54]),E=M(E,x,B,A,a,21,C[55]),A=M(A,E,x,B,f,6,C[56]),B=M(B,A,E,x,_,10,C[57]),x=M(x,B,A,E,d,15,C[58]),E=M(E,x,B,A,b,21,C[59]),A=M(A,E,x,B,l,6,C[60]),B=M(B,A,E,x,v,10,C[61]),x=M(x,B,A,E,c,15,C[62]),E=M(E,x,B,A,g,21,C[63]),s[0]=s[0]+A|0,s[1]=s[1]+E|0,s[2]=s[2]+x|0,s[3]=s[3]+B|0},_doFinalize:function(){var e=this._data,t=e.words,i=8*this._nDataBytes,n=8*e.sigBytes;t[n>>>5]|=128<<24-n%32;var r=c.floor(i/4294967296),i=i;t[15+(64+n>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),t[14+(64+n>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),e.sigBytes=4*(t.length+1),this._process();for(var t=this._hash,s=t.words,o=0;o<4;o++){var a=s[o];s[o]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8)}return t},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e}});function S(e,t,i,n,r,s,o){o=e+(t&i|~t&n)+r+o;return(o<<s|o>>>32-s)+t}function T(e,t,i,n,r,s,o){o=e+(t&n|i&~n)+r+o;return(o<<s|o>>>32-s)+t}function k(e,t,i,n,r,s,o){o=e+(t^i^n)+r+o;return(o<<s|o>>>32-s)+t}function M(e,t,i,n,r,s,o){o=e+(i^(t|~n))+r+o;return(o<<s|o>>>32-s)+t}e.MD5=n._createHelper(t),e.HmacMD5=n._createHmacHelper(t)}(Math),r.MD5)},function(e,t,i){"use strict";i.d(t,"a",function(){return n});class n{constructor(){}log(e,t){}}n.instance=new n},function(e,t,i){"use strict";var n=i(8);function r(e){n.call(this,null==e?"canceled":e,n.ERR_CANCELED),this.name="CanceledError"}i(4).inherits(r,n,{__CANCEL__:!0}),e.exports=r},function(e,t,i){var n;e.exports=(n=i(2),function(){var e=n,t=e.lib,r=t.Base,s=t.WordArray,e=e.x64={};e.Word=r.extend({init:function(e,t){this.high=e,this.low=t}}),e.WordArray=r.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:8*e.length},toX32:function(){for(var e=this.words,t=e.length,i=[],n=0;n<t;n++){var r=e[n];i.push(r.high),i.push(r.low)}return s.create(i,this.sigBytes)},clone:function(){for(var e=r.clone.call(this),t=e.words=this.words.slice(0),i=t.length,n=0;n<i;n++)t[n]=t[n].clone();return e}})}(),n)},function(e,t){e.exports=n},function(l,e,u){"use strict";!function(e){var o=u(4),a=u(42),n=u(8),t=u(22),c=u(23),i={"Content-Type":"application/x-www-form-urlencoded"};function h(e,t){!o.isUndefined(e)&&o.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var r,s={transitional:t,adapter:r="undefined"!=typeof XMLHttpRequest||void 0!==e&&"[object process]"===Object.prototype.toString.call(e)?u(24):r,transformRequest:[function(e,t){if(a(t,"Accept"),a(t,"Content-Type"),o.isFormData(e)||o.isArrayBuffer(e)||o.isBuffer(e)||o.isStream(e)||o.isFile(e)||o.isBlob(e))return e;if(o.isArrayBufferView(e))return e.buffer;if(o.isURLSearchParams(e))return h(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString();var i,n=o.isObject(e),r=t&&t["Content-Type"];if((i=o.isFileList(e))||n&&"multipart/form-data"===r){var s=this.env&&this.env.FormData;return c(i?{"files[]":e}:e,s&&new s)}return n||"application/json"===r?(h(t,"application/json"),function(e,t,i){if(o.isString(e))try{return(t||JSON.parse)(e),o.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(i||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||s.transitional,i=t&&t.silentJSONParsing,t=t&&t.forcedJSONParsing,i=!i&&"json"===this.responseType;if(i||t&&o.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(i){if("SyntaxError"===e.name)throw n.from(e,n.ERR_BAD_RESPONSE,this,null,this.response);throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:u(54)},validateStatus:function(e){return 200<=e&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};o.forEach(["delete","get","head"],function(e){s.headers[e]={}}),o.forEach(["post","put","patch"],function(e){s.headers[e]=o.merge(i)}),l.exports=s}.call(this,u(21))},function(e,t){var i=function(){return this}();try{i=i||new Function("return this")()}catch(e){"object"==typeof window&&(i=window)}e.exports=i},function(e,t,i){var r;e.exports=(r=i(2),function(){var e=r,t=e.lib,i=t.WordArray,n=t.Hasher,t=e.algo,l=[],t=t.SHA1=n.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var i=this._hash.words,n=i[0],r=i[1],s=i[2],o=i[3],a=i[4],c=0;c<80;c++){c<16?l[c]=0|e[t+c]:(h=l[c-3]^l[c-8]^l[c-14]^l[c-16],l[c]=h<<1|h>>>31);var h=(n<<5|n>>>27)+a+l[c];h+=c<20?1518500249+(r&s|~r&o):c<40?1859775393+(r^s^o):c<60?(r&s|r&o|s&o)-1894007588:(r^s^o)-899497514,a=o,o=s,s=r<<30|r>>>2,r=n,n=h}i[0]=i[0]+n|0,i[1]=i[1]+r|0,i[2]=i[2]+s|0,i[3]=i[3]+o|0,i[4]=i[4]+a|0},_doFinalize:function(){var e=this._data,t=e.words,i=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[14+(64+n>>>9<<4)]=Math.floor(i/4294967296),t[15+(64+n>>>9<<4)]=i,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e}});e.SHA1=n._createHelper(t),e.HmacSHA1=n._createHmacHelper(t)}(),r.SHA1)},function(e,t,i){var n;e.exports=(n=i(2),void function(){var e=n.lib.Base,a=n.enc.Utf8;n.algo.HMAC=e.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=a.parse(t));var i=e.blockSize,n=4*i;(t=t.sigBytes>n?e.finalize(t):t).clamp();for(var e=this._oKey=t.clone(),t=this._iKey=t.clone(),r=e.words,s=t.words,o=0;o<i;o++)r[o]^=1549556828,s[o]^=909522486;e.sigBytes=t.sigBytes=n,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher,e=t.finalize(e);return t.reset(),t.finalize(this._oKey.clone().concat(e))}})}())},function(e,t,i){"use strict";e.exports=function(i,n){return function(){for(var e=new Array(arguments.length),t=0;t<e.length;t++)e[t]=arguments[t];return i.apply(n,e)}}},function(e,t,i){"use strict";var r=i(4);function s(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,i){if(!t)return e;var n,i=i?i(t):r.isURLSearchParams(t)?t.toString():(n=[],r.forEach(t,function(e,t){null!=e&&(r.isArray(e)?t+="[]":e=[e],r.forEach(e,function(e){r.isDate(e)?e=e.toISOString():r.isObject(e)&&(e=JSON.stringify(e)),n.push(s(t)+"="+s(e))}))}),n.join("&"));return i&&(-1!==(t=e.indexOf("#"))&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i),e}},function(e,t){var i,n,e=e.exports={};function r(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function o(t){if(i===setTimeout)return setTimeout(t,0);if((i===r||!i)&&setTimeout)return i=setTimeout,setTimeout(t,0);try{return i(t,0)}catch(e){try{return i.call(null,t,0)}catch(e){return i.call(this,t,0)}}}!function(){try{i="function"==typeof setTimeout?setTimeout:r}catch(e){i=r}try{n="function"==typeof clearTimeout?clearTimeout:s}catch(e){n=s}}();var a,c=[],h=!1,l=-1;function u(){h&&a&&(h=!1,a.length?c=a.concat(c):l=-1,c.length&&d())}function d(){if(!h){var e=o(u);h=!0;for(var t=c.length;t;){for(a=c,c=[];++l<t;)a&&a[l].run();l=-1,t=c.length}a=null,h=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===s||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function f(){}e.nextTick=function(e){var t=new Array(arguments.length-1);if(1<arguments.length)for(var i=1;i<arguments.length;i++)t[i-1]=arguments[i];c.push(new p(e,t)),1!==c.length||h||o(d)},p.prototype.run=function(){this.fun.apply(null,this.array)},e.title="browser",e.browser=!0,e.env={},e.argv=[],e.version="",e.versions={},e.on=f,e.addListener=f,e.once=f,e.off=f,e.removeListener=f,e.removeAllListeners=f,e.emit=f,e.prependListener=f,e.prependOnceListener=f,e.listeners=function(e){return[]},e.binding=function(e){throw new Error("process.binding is not supported")},e.cwd=function(){return"/"},e.chdir=function(e){throw new Error("process.chdir is not supported")},e.umask=function(){return 0}},function(e,t,i){"use strict";e.exports={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1}},function(e,t,n){"use strict";!function(i){var c=n(4);e.exports=function(e,o){o=o||new FormData;var t=[];function a(e){return null===e?"":c.isDate(e)?e.toISOString():c.isArrayBuffer(e)||c.isTypedArray(e)?"function"==typeof Blob?new Blob([e]):i.from(e):e}return function r(e,s){if(c.isPlainObject(e)||c.isArray(e)){if(-1!==t.indexOf(e))throw Error("Circular reference detected in "+s);t.push(e),c.forEach(e,function(e,t){if(!c.isUndefined(e)){var i,n=s?s+"."+t:t;if(e&&!s&&"object"==typeof e)if(c.endsWith(t,"{}"))e=JSON.stringify(e);else if(c.endsWith(t,"[]")&&(i=c.toArray(e)))return void i.forEach(function(e){c.isUndefined(e)||o.append(n,a(e))});r(e,n)}}),t.pop()}else o.append(s,a(e))}(e),o}}.call(this,n(43).Buffer)},function(e,t,i){"use strict";var d=i(4),p=i(47),f=i(48),g=i(20),m=i(25),v=i(51),y=i(52),b=i(22),w=i(8),_=i(12),A=i(53);e.exports=function(u){return new Promise(function(t,i){var e,n=u.data,r=u.headers,s=u.responseType;function o(){u.cancelToken&&u.cancelToken.unsubscribe(e),u.signal&&u.signal.removeEventListener("abort",e)}d.isFormData(n)&&d.isStandardBrowserEnv()&&delete r["Content-Type"];var a=new XMLHttpRequest;u.auth&&(h=u.auth.username||"",c=u.auth.password?unescape(encodeURIComponent(u.auth.password)):"",r.Authorization="Basic "+btoa(h+":"+c));var c,h=m(u.baseURL,u.url);function l(){var e;a&&(e="getAllResponseHeaders"in a?v(a.getAllResponseHeaders()):null,e={data:s&&"text"!==s&&"json"!==s?a.response:a.responseText,status:a.status,statusText:a.statusText,headers:e,config:u,request:a},p(function(e){t(e),o()},function(e){i(e),o()},e),a=null)}a.open(u.method.toUpperCase(),g(h,u.params,u.paramsSerializer),!0),a.timeout=u.timeout,"onloadend"in a?a.onloadend=l:a.onreadystatechange=function(){a&&4===a.readyState&&(0!==a.status||a.responseURL&&0===a.responseURL.indexOf("file:"))&&setTimeout(l)},a.onabort=function(){a&&(i(new w("Request aborted",w.ECONNABORTED,u,a)),a=null)},a.onerror=function(){i(new w("Network Error",w.ERR_NETWORK,u,a,a)),a=null},a.ontimeout=function(){var e=u.timeout?"timeout of "+u.timeout+"ms exceeded":"timeout exceeded",t=u.transitional||b;u.timeoutErrorMessage&&(e=u.timeoutErrorMessage),i(new w(e,t.clarifyTimeoutError?w.ETIMEDOUT:w.ECONNABORTED,u,a)),a=null},!d.isStandardBrowserEnv()||(c=(u.withCredentials||y(h))&&u.xsrfCookieName?f.read(u.xsrfCookieName):void 0)&&(r[u.xsrfHeaderName]=c),"setRequestHeader"in a&&d.forEach(r,function(e,t){void 0===n&&"content-type"===t.toLowerCase()?delete r[t]:a.setRequestHeader(t,e)}),d.isUndefined(u.withCredentials)||(a.withCredentials=!!u.withCredentials),s&&"json"!==s&&(a.responseType=u.responseType),"function"==typeof u.onDownloadProgress&&a.addEventListener("progress",u.onDownloadProgress),"function"==typeof u.onUploadProgress&&a.upload&&a.upload.addEventListener("progress",u.onUploadProgress),(u.cancelToken||u.signal)&&(e=function(e){a&&(i(!e||e.type?new _:e),a.abort(),a=null)},u.cancelToken&&u.cancelToken.subscribe(e),u.signal&&(u.signal.aborted?e():u.signal.addEventListener("abort",e)));n=n||null,h=A(h);h&&-1===["http","https","file"].indexOf(h)?i(new w("Unsupported protocol "+h+":",w.ERR_BAD_REQUEST,u)):a.send(n)})}},function(e,t,i){"use strict";var n=i(49),r=i(50);e.exports=function(e,t){return e&&!n(t)?r(e,t):t}},function(e,t,i){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},function(e,t,i){"use strict";var h=i(4);e.exports=function(t,i){i=i||{};var n={};function r(e,t){return h.isPlainObject(e)&&h.isPlainObject(t)?h.merge(e,t):h.isPlainObject(t)?h.merge({},t):h.isArray(t)?t.slice():t}function s(e){return h.isUndefined(i[e])?h.isUndefined(t[e])?void 0:r(void 0,t[e]):r(t[e],i[e])}function e(e){if(!h.isUndefined(i[e]))return r(void 0,i[e])}function o(e){return h.isUndefined(i[e])?h.isUndefined(t[e])?void 0:r(void 0,t[e]):r(void 0,i[e])}function a(e){return e in i?r(t[e],i[e]):e in t?r(void 0,t[e]):void 0}var c={url:e,method:e,data:e,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a};return h.forEach(Object.keys(t).concat(Object.keys(i)),function(e){var t=c[e]||s,i=t(e);h.isUndefined(i)&&t!==a||(n[e]=i)}),n}},function(e,t){e.exports={version:"0.27.2"}},function(e,t,i){var o;e.exports=(o=i(2),function(r){var e=o,t=e.lib,i=t.WordArray,n=t.Hasher,t=e.algo,s=[],f=[];!function(){function e(e){return 4294967296*(e-(0|e))|0}for(var t=2,i=0;i<64;)!function(e){for(var t=r.sqrt(e),i=2;i<=t;i++)if(!(e%i))return;return 1}(t)||(i<8&&(s[i]=e(r.pow(t,.5))),f[i]=e(r.pow(t,1/3)),i++),t++}();var g=[],t=t.SHA256=n.extend({_doReset:function(){this._hash=new i.init(s.slice(0))},_doProcessBlock:function(e,t){for(var i=this._hash.words,n=i[0],r=i[1],s=i[2],o=i[3],a=i[4],c=i[5],h=i[6],l=i[7],u=0;u<64;u++){u<16?g[u]=0|e[t+u]:(d=g[u-15],p=g[u-2],g[u]=((d<<25|d>>>7)^(d<<14|d>>>18)^d>>>3)+g[u-7]+((p<<15|p>>>17)^(p<<13|p>>>19)^p>>>10)+g[u-16]);var d=n&r^n&s^r&s,p=l+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&c^~a&h)+f[u]+g[u],l=h,h=c,c=a,a=o+p|0,o=s,s=r,r=n,n=p+(((n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22))+d)|0}i[0]=i[0]+n|0,i[1]=i[1]+r|0,i[2]=i[2]+s|0,i[3]=i[3]+o|0,i[4]=i[4]+a|0,i[5]=i[5]+c|0,i[6]=i[6]+h|0,i[7]=i[7]+l|0},_doFinalize:function(){var e=this._data,t=e.words,i=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[14+(64+n>>>9<<4)]=r.floor(i/4294967296),t[15+(64+n>>>9<<4)]=i,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e}});e.SHA256=n._createHelper(t),e.HmacSHA256=n._createHmacHelper(t)}(Math),o.SHA256)},function(e,t,i){var o;e.exports=(o=i(2),i(13),function(){var e=o,t=e.lib.Hasher,i=e.x64,n=i.Word,r=i.WordArray,i=e.algo;function s(){return n.create.apply(n,arguments)}var ee=[s(1116352408,3609767458),s(1899447441,602891725),s(3049323471,3964484399),s(3921009573,2173295548),s(961987163,4081628472),s(1508970993,3053834265),s(2453635748,2937671579),s(2870763221,3664609560),s(3624381080,2734883394),s(310598401,1164996542),s(607225278,1323610764),s(1426881987,3590304994),s(1925078388,4068182383),s(2162078206,991336113),s(2614888103,633803317),s(3248222580,3479774868),s(3835390401,2666613458),s(4022224774,944711139),s(264347078,2341262773),s(604807628,2007800933),s(770255983,1495990901),s(1249150122,1856431235),s(1555081692,3175218132),s(1996064986,2198950837),s(2554220882,3999719339),s(2821834349,766784016),s(2952996808,2566594879),s(3210313671,3203337956),s(3336571891,1034457026),s(3584528711,2466948901),s(113926993,3758326383),s(338241895,168717936),s(666307205,1188179964),s(773529912,1546045734),s(1294757372,1522805485),s(1396182291,2643833823),s(1695183700,2343527390),s(1986661051,1014477480),s(2177026350,1206759142),s(2456956037,344077627),s(2730485921,1290863460),s(2820302411,3158454273),s(3259730800,3505952657),s(3345764771,106217008),s(3516065817,3606008344),s(3600352804,1432725776),s(4094571909,1467031594),s(275423344,851169720),s(430227734,3100823752),s(506948616,1363258195),s(659060556,3750685593),s(883997877,3785050280),s(958139571,3318307427),s(1322822218,3812723403),s(1537002063,2003034995),s(1747873779,3602036899),s(1955562222,1575990012),s(2024104815,1125592928),s(2227730452,2716904306),s(2361852424,442776044),s(2428436474,593698344),s(2756734187,3733110249),s(3204031479,2999351573),s(3329325298,3815920427),s(3391569614,3928383900),s(3515267271,566280711),s(3940187606,3454069534),s(4118630271,4000239992),s(116418474,1914138554),s(174292421,2731055270),s(289380356,3203993006),s(460393269,320620315),s(685471733,587496836),s(852142971,1086792851),s(1017036298,365543100),s(1126000580,2618297676),s(1288033470,3409855158),s(1501505948,4234509866),s(1607167915,987167468),s(1816402316,1246189591)],te=[];!function(){for(var e=0;e<80;e++)te[e]=s()}();i=i.SHA512=t.extend({_doReset:function(){this._hash=new r.init([new n.init(1779033703,4089235720),new n.init(3144134277,2227873595),new n.init(1013904242,4271175723),new n.init(2773480762,1595750129),new n.init(1359893119,2917565137),new n.init(2600822924,725511199),new n.init(528734635,4215389547),new n.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var i=this._hash.words,n=i[0],r=i[1],s=i[2],o=i[3],a=i[4],c=i[5],h=i[6],l=i[7],u=n.high,d=n.low,p=r.high,f=r.low,g=s.high,m=s.low,v=o.high,y=o.low,b=a.high,w=a.low,_=c.high,A=c.low,B=h.high,x=h.low,E=l.high,i=l.low,C=u,S=d,T=p,k=f,M=g,O=m,L=v,P=y,R=b,N=w,I=_,D=A,Y=B,j=x,z=E,U=i,H=0;H<80;H++){var F,V,G=te[H];H<16?(V=G.high=0|e[t+2*H],F=G.low=0|e[t+2*H+1]):(Z=(W=te[H-15]).high,K=W.low,X=(J=te[H-2]).high,q=J.low,$=(Q=te[H-7]).high,W=Q.low,Q=(J=te[H-16]).high,V=(V=((Z>>>1|K<<31)^(Z>>>8|K<<24)^Z>>>7)+$+((F=($=(K>>>1|Z<<31)^(K>>>8|Z<<24)^(K>>>7|Z<<25))+W)>>>0<$>>>0?1:0))+((X>>>19|q<<13)^(X<<3|q>>>29)^X>>>6)+((F+=K=(q>>>19|X<<13)^(q<<3|X>>>29)^(q>>>6|X<<26))>>>0<K>>>0?1:0),F+=Z=J.low,G.high=V=V+Q+(F>>>0<Z>>>0?1:0),G.low=F);var W=R&I^~R&Y,$=N&D^~N&j,q=C&T^C&M^T&M,X=(S>>>28|C<<4)^(S<<30|C>>>2)^(S<<25|C>>>7),K=ee[H],J=K.high,Q=K.low,Z=U+((N>>>14|R<<18)^(N>>>18|R<<14)^(N<<23|R>>>9)),G=z+((R>>>14|N<<18)^(R>>>18|N<<14)^(R<<23|N>>>9))+(Z>>>0<U>>>0?1:0),K=X+(S&k^S&O^k&O),z=Y,U=j,Y=I,j=D,I=R,D=N,R=L+(G=(G=(G=G+W+((Z=Z+$)>>>0<$>>>0?1:0))+J+((Z=Z+Q)>>>0<Q>>>0?1:0))+V+((Z=Z+F)>>>0<F>>>0?1:0))+((N=P+Z|0)>>>0<P>>>0?1:0)|0,L=M,P=O,M=T,O=k,T=C,k=S,C=G+(((C>>>28|S<<4)^(C<<30|S>>>2)^(C<<25|S>>>7))+q+(K>>>0<X>>>0?1:0))+((S=Z+K|0)>>>0<Z>>>0?1:0)|0}d=n.low=d+S,n.high=u+C+(d>>>0<S>>>0?1:0),f=r.low=f+k,r.high=p+T+(f>>>0<k>>>0?1:0),m=s.low=m+O,s.high=g+M+(m>>>0<O>>>0?1:0),y=o.low=y+P,o.high=v+L+(y>>>0<P>>>0?1:0),w=a.low=w+N,a.high=b+R+(w>>>0<N>>>0?1:0),A=c.low=A+D,c.high=_+I+(A>>>0<D>>>0?1:0),x=h.low=x+j,h.high=B+Y+(x>>>0<j>>>0?1:0),i=l.low=i+U,l.high=E+z+(i>>>0<U>>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,i=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[30+(128+n>>>10<<5)]=Math.floor(i/4294967296),t[31+(128+n>>>10<<5)]=i,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=t.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});e.SHA512=t._createHelper(i),e.HmacSHA512=t._createHmacHelper(i)}(),o.SHA512)},function(e,t,i){e.exports=i(37)},function(e,t){e.exports=r},function(e,t){e.exports=s},function(e,t){e.exports=o},function(e,t){e.exports=a},function(e,t){e.exports=c},function(e,t,i){"use strict";var r=i(4),s=i(19),o=i(38),a=i(27);var n=function t(i){var e=new o(i),n=s(o.prototype.request,e);return r.extend(n,o.prototype,e),r.extend(n,e),n.create=function(e){return t(a(i,e))},n}(i(15));n.Axios=o,n.CanceledError=i(12),n.CancelToken=i(56),n.isCancel=i(26),n.VERSION=i(28).version,n.toFormData=i(23),n.AxiosError=i(8),n.Cancel=n.CanceledError,n.all=function(e){return Promise.all(e)},n.spread=i(57),n.isAxiosError=i(58),e.exports=n,e.exports.default=n},function(e,t,i){"use strict";var n=i(4),r=i(20),s=i(39),l=i(40),u=i(27),o=i(25),d=i(55),p=d.validators;function a(e){this.defaults=e,this.interceptors={request:new s,response:new s}}a.prototype.request=function(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},(t=u(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";e=t.transitional;void 0!==e&&d.assertOptions(e,{silentJSONParsing:p.transitional(p.boolean),forcedJSONParsing:p.transitional(p.boolean),clarifyTimeoutError:p.transitional(p.boolean)},!1);var i=[],n=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(n=n&&e.synchronous,i.unshift(e.fulfilled,e.rejected))});var r,s=[];if(this.interceptors.response.forEach(function(e){s.push(e.fulfilled,e.rejected)}),!n){var o=[l,void 0];for(Array.prototype.unshift.apply(o,i),o=o.concat(s),r=Promise.resolve(t);o.length;)r=r.then(o.shift(),o.shift());return r}for(var a=t;i.length;){var c=i.shift(),h=i.shift();try{a=c(a)}catch(e){h(e);break}}try{r=l(a)}catch(e){return Promise.reject(e)}for(;s.length;)r=r.then(s.shift(),s.shift());return r},a.prototype.getUri=function(e){e=u(this.defaults,e);var t=o(e.baseURL,e.url);return r(t,e.params,e.paramsSerializer)},n.forEach(["delete","get","head","options"],function(i){a.prototype[i]=function(e,t){return this.request(u(t||{},{method:i,url:e,data:(t||{}).data}))}}),n.forEach(["post","put","patch"],function(r){function e(n){return function(e,t,i){return this.request(u(i||{},{method:r,headers:n?{"Content-Type":"multipart/form-data"}:{},url:e,data:t}))}}a.prototype[r]=e(),a.prototype[r+"Form"]=e(!0)}),e.exports=a},function(e,t,i){"use strict";var n=i(4);function r(){this.handlers=[]}r.prototype.use=function(e,t,i){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!i&&i.synchronous,runWhen:i?i.runWhen:null}),this.handlers.length-1},r.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},r.prototype.forEach=function(t){n.forEach(this.handlers,function(e){null!==e&&t(e)})},e.exports=r},function(e,t,i){"use strict";var n=i(4),r=i(41),s=i(26),o=i(15),a=i(12);function c(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new a}e.exports=function(t){return c(t),t.headers=t.headers||{},t.data=r.call(t,t.data,t.headers,t.transformRequest),t.headers=n.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),n.forEach(["delete","get","head","post","put","patch","common"],function(e){delete t.headers[e]}),(t.adapter||o.adapter)(t).then(function(e){return c(t),e.data=r.call(t,e.data,e.headers,t.transformResponse),e},function(e){return s(e)||(c(t),e&&e.response&&(e.response.data=r.call(t,e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)})}},function(e,t,i){"use strict";var r=i(4),s=i(15);e.exports=function(t,i,e){var n=this||s;return r.forEach(e,function(e){t=e.call(n,t,i)}),t}},function(e,t,i){"use strict";var r=i(4);e.exports=function(i,n){r.forEach(i,function(e,t){t!==n&&t.toUpperCase()===n.toUpperCase()&&(i[n]=e,delete i[t])})}},function(e,L,P){"use strict";!function(e){var a=P(44),s=P(45),o=P(46);function i(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function r(e,t){if(i()<t)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=u.prototype:(e=null===e?new u(t):e).length=t,e}function u(e,t,i){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(e,t,i);if("number"!=typeof e)return n(this,e,t,i);if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return h(this,e)}function n(e,t,i,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,i,n){if(t.byteLength,i<0||t.byteLength<i)throw new RangeError("'offset' is out of bounds");if(t.byteLength<i+(n||0))throw new RangeError("'length' is out of bounds");t=void 0===i&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,i):new Uint8Array(t,i,n);u.TYPED_ARRAY_SUPPORT?(e=t).__proto__=u.prototype:e=l(e,t);return e}(e,t,i,n):"string"==typeof t?function(e,t,i){"string"==typeof i&&""!==i||(i="utf8");if(!u.isEncoding(i))throw new TypeError('"encoding" must be a valid string encoding');var n=0|p(t,i),i=(e=r(e,n)).write(t,i);i!==n&&(e=e.slice(0,i));return e}(e,t,i):function(e,t){if(u.isBuffer(t)){var i=0|d(t.length);return 0===(e=r(e,i)).length?e:(t.copy(e,0,0,i),e)}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||function(e){return e!=e}(t.length)?r(e,0):l(e,t);if("Buffer"===t.type&&o(t.data))return l(e,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function h(e,t){if(c(t),e=r(e,t<0?0:0|d(t)),!u.TYPED_ARRAY_SUPPORT)for(var i=0;i<t;++i)e[i]=0;return e}function l(e,t){var i=t.length<0?0:0|d(t.length);e=r(e,i);for(var n=0;n<i;n+=1)e[n]=255&t[n];return e}function d(e){if(e>=i())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|e}function p(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;var i=(e="string"!=typeof e?""+e:e).length;if(0===i)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":case void 0:return k(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return M(e).length;default:if(n)return k(e).length;t=(""+t).toLowerCase(),n=!0}}function t(e,t,i){var n,r,s,o=!1;if((t=void 0===t||t<0?0:t)>this.length)return"";if((i=void 0===i||i>this.length?this.length:i)<=0)return"";if((i>>>=0)<=(t>>>=0))return"";for(e=e||"utf8";;)switch(e){case"hex":return function(e,t,i){var n=e.length;(!t||t<0)&&(t=0);(!i||i<0||n<i)&&(i=n);for(var r="",s=t;s<i;++s)r+=function(e){return e<16?"0"+e.toString(16):e.toString(16)}(e[s]);return r}(this,t,i);case"utf8":case"utf-8":return b(this,t,i);case"ascii":return function(e,t,i){var n="";i=Math.min(e.length,i);for(var r=t;r<i;++r)n+=String.fromCharCode(127&e[r]);return n}(this,t,i);case"latin1":case"binary":return function(e,t,i){var n="";i=Math.min(e.length,i);for(var r=t;r<i;++r)n+=String.fromCharCode(e[r]);return n}(this,t,i);case"base64":return n=this,s=i,0===(r=t)&&s===n.length?a.fromByteArray(n):a.fromByteArray(n.slice(r,s));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(e,t,i){for(var n=e.slice(t,i),r="",s=0;s<n.length;s+=2)r+=String.fromCharCode(n[s]+256*n[s+1]);return r}(this,t,i);default:if(o)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),o=!0}}function f(e,t,i){var n=e[t];e[t]=e[i],e[i]=n}function g(e,t,i,n,r){if(0===e.length)return-1;if("string"==typeof i?(n=i,i=0):2147483647<i?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,(i=(i=isNaN(i)?r?0:e.length-1:i)<0?e.length+i:i)>=e.length){if(r)return-1;i=e.length-1}else if(i<0){if(!r)return-1;i=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:m(e,t,i,n,r);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?(r?Uint8Array.prototype.indexOf:Uint8Array.prototype.lastIndexOf).call(e,t,i):m(e,[t],i,n,r);throw new TypeError("val must be string, number or Buffer")}function m(e,t,i,n,r){var s=1,o=e.length,a=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o/=s=2,a/=2,i/=2}function c(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(r)for(var h=-1,l=i;l<o;l++)if(c(e,l)===c(t,-1===h?0:l-h)){if(l-(h=-1===h?l:h)+1===a)return h*s}else-1!==h&&(l-=l-h),h=-1;else for(l=i=o<i+a?o-a:i;0<=l;l--){for(var u=!0,d=0;d<a;d++)if(c(e,l+d)!==c(t,d)){u=!1;break}if(u)return l}return-1}function v(e,t,i,n){return O(function(e){for(var t=[],i=0;i<e.length;++i)t.push(255&e.charCodeAt(i));return t}(t),e,i,n)}function y(e,t,i,n){return O(function(e,t){for(var i,n,r=[],s=0;s<e.length&&!((t-=2)<0);++s)n=e.charCodeAt(s),i=n>>8,n=n%256,r.push(n),r.push(i);return r}(t,e.length-i),e,i,n)}function b(e,t,i){i=Math.min(e.length,i);for(var n=[],r=t;r<i;){var s,o,a,c,h=e[r],l=null,u=239<h?4:223<h?3:191<h?2:1;if(r+u<=i)switch(u){case 1:h<128&&(l=h);break;case 2:128==(192&(s=e[r+1]))&&127<(c=(31&h)<<6|63&s)&&(l=c);break;case 3:s=e[r+1],o=e[r+2],128==(192&s)&&128==(192&o)&&2047<(c=(15&h)<<12|(63&s)<<6|63&o)&&(c<55296||57343<c)&&(l=c);break;case 4:s=e[r+1],o=e[r+2],a=e[r+3],128==(192&s)&&128==(192&o)&&128==(192&a)&&65535<(c=(15&h)<<18|(63&s)<<12|(63&o)<<6|63&a)&&c<1114112&&(l=c)}null===l?(l=65533,u=1):65535<l&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),r+=u}return function(e){var t=e.length;if(t<=w)return String.fromCharCode.apply(String,e);var i="",n=0;for(;n<t;)i+=String.fromCharCode.apply(String,e.slice(n,n+=w));return i}(n)}L.Buffer=u,L.SlowBuffer=function(e){+e!=e&&(e=0);return u.alloc(+e)},L.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),L.kMaxLength=i(),u.poolSize=8192,u._augment=function(e){return e.__proto__=u.prototype,e},u.from=function(e,t,i){return n(null,e,t,i)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(e,t,i){return n=null,t=t,i=i,c(e=e),!(e<=0)&&void 0!==t?"string"==typeof i?r(n,e).fill(t,i):r(n,e).fill(t):r(n,e);var n},u.allocUnsafe=function(e){return h(null,e)},u.allocUnsafeSlow=function(e){return h(null,e)},u.isBuffer=function(e){return!(null==e||!e._isBuffer)},u.compare=function(e,t){if(!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var i=e.length,n=t.length,r=0,s=Math.min(i,n);r<s;++r)if(e[r]!==t[r]){i=e[r],n=t[r];break}return i<n?-1:n<i?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!o(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);if(void 0===t)for(r=t=0;r<e.length;++r)t+=e[r].length;for(var i=u.allocUnsafe(t),n=0,r=0;r<e.length;++r){var s=e[r];if(!u.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(i,n),n+=s.length}return i},u.byteLength=p,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)f(this,t,t+1);return this},u.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)f(this,t,t+3),f(this,t+1,t+2);return this},u.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)f(this,t,t+7),f(this,t+1,t+6),f(this,t+2,t+5),f(this,t+3,t+4);return this},u.prototype.toString=function(){var e=0|this.length;return 0==e?"":0===arguments.length?b(this,0,e):t.apply(this,arguments)},u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){var e="",t=L.INSPECT_MAX_BYTES;return 0<this.length&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),"<Buffer "+e+">"},u.prototype.compare=function(e,t,i,n,r){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===i&&(i=e?e.length:0),void 0===n&&(n=0),void 0===r&&(r=this.length),(t=void 0===t?0:t)<0||i>e.length||n<0||r>this.length)throw new RangeError("out of range index");if(r<=n&&i<=t)return 0;if(r<=n)return-1;if(i<=t)return 1;if(this===e)return 0;for(var s=(r>>>=0)-(n>>>=0),o=(i>>>=0)-(t>>>=0),a=Math.min(s,o),c=this.slice(n,r),h=e.slice(t,i),l=0;l<a;++l)if(c[l]!==h[l]){s=c[l],o=h[l];break}return s<o?-1:o<s?1:0},u.prototype.includes=function(e,t,i){return-1!==this.indexOf(e,t,i)},u.prototype.indexOf=function(e,t,i){return g(this,e,t,i,!0)},u.prototype.lastIndexOf=function(e,t,i){return g(this,e,t,i,!1)},u.prototype.write=function(e,t,i,n){if(void 0===t)n="utf8",i=this.length,t=0;else if(void 0===i&&"string"==typeof t)n=t,i=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(i)?(i|=0,void 0===n&&(n="utf8")):(n=i,i=void 0)}var r=this.length-t;if((void 0===i||r<i)&&(i=r),0<e.length&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n=n||"utf8";for(var s,o,a,c=!1;;)switch(n){case"hex":return function(e,t,i,n){i=Number(i)||0;var r=e.length-i;if((!n||r<(n=Number(n)))&&(n=r),(r=t.length)%2!=0)throw new TypeError("Invalid hex string");r/2<n&&(n=r/2);for(var s=0;s<n;++s){var o=parseInt(t.substr(2*s,2),16);if(isNaN(o))return s;e[i+s]=o}return s}(this,e,t,i);case"utf8":case"utf-8":return o=t,a=i,O(k(e,(s=this).length-o),s,o,a);case"ascii":return v(this,e,t,i);case"latin1":case"binary":return v(this,e,t,i);case"base64":return s=this,o=t,a=i,O(M(e),s,o,a);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return y(this,e,t,i);default:if(c)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),c=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var w=4096;function _(e,t,i){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(i<e+t)throw new RangeError("Trying to access beyond buffer length")}function A(e,t,i,n,r,s){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(r<t||t<s)throw new RangeError('"value" argument is out of bounds');if(i+n>e.length)throw new RangeError("Index out of range")}function B(e,t,i,n){t<0&&(t=65535+t+1);for(var r=0,s=Math.min(e.length-i,2);r<s;++r)e[i+r]=(t&255<<8*(n?r:1-r))>>>8*(n?r:1-r)}function x(e,t,i,n){t<0&&(t=4294967295+t+1);for(var r=0,s=Math.min(e.length-i,4);r<s;++r)e[i+r]=t>>>8*(n?r:3-r)&255}function E(e,t,i,n){if(i+n>e.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function C(e,t,i,n,r){return r||E(e,0,i,4),s.write(e,t,i,n,23,4),i+4}function S(e,t,i,n,r){return r||E(e,0,i,8),s.write(e,t,i,n,52,8),i+8}u.prototype.slice=function(e,t){var i=this.length;if((e=~~e)<0?(e+=i)<0&&(e=0):i<e&&(e=i),(t=void 0===t?i:~~t)<0?(t+=i)<0&&(t=0):i<t&&(t=i),t<e&&(t=e),u.TYPED_ARRAY_SUPPORT)(r=this.subarray(e,t)).__proto__=u.prototype;else for(var n=t-e,r=new u(n,void 0),s=0;s<n;++s)r[s]=this[s+e];return r},u.prototype.readUIntLE=function(e,t,i){e|=0,t|=0,i||_(e,t,this.length);for(var n=this[e],r=1,s=0;++s<t&&(r*=256);)n+=this[e+s]*r;return n},u.prototype.readUIntBE=function(e,t,i){e|=0,t|=0,i||_(e,t,this.length);for(var n=this[e+--t],r=1;0<t&&(r*=256);)n+=this[e+--t]*r;return n},u.prototype.readUInt8=function(e,t){return t||_(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||_(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||_(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||_(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||_(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,i){e|=0,t|=0,i||_(e,t,this.length);for(var n=this[e],r=1,s=0;++s<t&&(r*=256);)n+=this[e+s]*r;return(r*=128)<=n&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,i){e|=0,t|=0,i||_(e,t,this.length);for(var n=t,r=1,s=this[e+--n];0<n&&(r*=256);)s+=this[e+--n]*r;return(r*=128)<=s&&(s-=Math.pow(2,8*t)),s},u.prototype.readInt8=function(e,t){return t||_(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||_(e,2,this.length);e=this[e]|this[e+1]<<8;return 32768&e?4294901760|e:e},u.prototype.readInt16BE=function(e,t){t||_(e,2,this.length);e=this[e+1]|this[e]<<8;return 32768&e?4294901760|e:e},u.prototype.readInt32LE=function(e,t){return t||_(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||_(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||_(e,4,this.length),s.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||_(e,4,this.length),s.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||_(e,8,this.length),s.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||_(e,8,this.length),s.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,i,n){e=+e,t|=0,i|=0,n||A(this,e,t,i,Math.pow(2,8*i)-1,0);var r=1,s=0;for(this[t]=255&e;++s<i&&(r*=256);)this[t+s]=e/r&255;return t+i},u.prototype.writeUIntBE=function(e,t,i,n){e=+e,t|=0,i|=0,n||A(this,e,t,i,Math.pow(2,8*i)-1,0);var r=i-1,s=1;for(this[t+r]=255&e;0<=--r&&(s*=256);)this[t+r]=e/s&255;return t+i},u.prototype.writeUInt8=function(e,t,i){return e=+e,t|=0,i||A(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,i){return e=+e,t|=0,i||A(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):B(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,i){return e=+e,t|=0,i||A(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):B(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,i){return e=+e,t|=0,i||A(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):x(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,i){return e=+e,t|=0,i||A(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):x(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,i,n){e=+e,t|=0,n||A(this,e,t,i,(n=Math.pow(2,8*i-1))-1,-n);var r=0,s=1,o=0;for(this[t]=255&e;++r<i&&(s*=256);)e<0&&0===o&&0!==this[t+r-1]&&(o=1),this[t+r]=(e/s>>0)-o&255;return t+i},u.prototype.writeIntBE=function(e,t,i,n){e=+e,t|=0,n||A(this,e,t,i,(n=Math.pow(2,8*i-1))-1,-n);var r=i-1,s=1,o=0;for(this[t+r]=255&e;0<=--r&&(s*=256);)e<0&&0===o&&0!==this[t+r+1]&&(o=1),this[t+r]=(e/s>>0)-o&255;return t+i},u.prototype.writeInt8=function(e,t,i){return e=+e,t|=0,i||A(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&(e=e<0?255+e+1:e),t+1},u.prototype.writeInt16LE=function(e,t,i){return e=+e,t|=0,i||A(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):B(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,i){return e=+e,t|=0,i||A(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):B(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,i){return e=+e,t|=0,i||A(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):x(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,i){return e=+e,t|=0,i||A(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):x(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,i){return C(this,e,t,!0,i)},u.prototype.writeFloatBE=function(e,t,i){return C(this,e,t,!1,i)},u.prototype.writeDoubleLE=function(e,t,i){return S(this,e,t,!0,i)},u.prototype.writeDoubleBE=function(e,t,i){return S(this,e,t,!1,i)},u.prototype.copy=function(e,t,i,n){if(i=i||0,n||0===n||(n=this.length),t>=e.length&&(t=e.length),(n=0<n&&n<i?i:n)===i)return 0;if(0===e.length||0===this.length)return 0;if((t=t||0)<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length);var r,s=(n=e.length-t<n-i?e.length-t+i:n)-i;if(this===e&&i<t&&t<n)for(r=s-1;0<=r;--r)e[r+t]=this[r+i];else if(s<1e3||!u.TYPED_ARRAY_SUPPORT)for(r=0;r<s;++r)e[r+t]=this[r+i];else Uint8Array.prototype.set.call(e,this.subarray(i,i+s),t);return s},u.prototype.fill=function(e,t,i,n){if("string"==typeof e){var r;if("string"==typeof t?(n=t,t=0,i=this.length):"string"==typeof i&&(n=i,i=this.length),1!==e.length||(r=e.charCodeAt(0))<256&&(e=r),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<i)throw new RangeError("Out of range index");if(i<=t)return this;if(t>>>=0,i=void 0===i?this.length:i>>>0,"number"==typeof(e=e||0))for(a=t;a<i;++a)this[a]=e;else for(var s=u.isBuffer(e)?e:k(new u(e,n).toString()),o=s.length,a=0;a<i-t;++a)this[a+t]=s[a%o];return this};var T=/[^+\/0-9A-Za-z-_]/g;function k(e,t){var i;t=t||1/0;for(var n=e.length,r=null,s=[],o=0;o<n;++o){if(55295<(i=e.charCodeAt(o))&&i<57344){if(!r){if(56319<i){-1<(t-=3)&&s.push(239,191,189);continue}if(o+1===n){-1<(t-=3)&&s.push(239,191,189);continue}r=i;continue}if(i<56320){-1<(t-=3)&&s.push(239,191,189),r=i;continue}i=65536+(r-55296<<10|i-56320)}else r&&-1<(t-=3)&&s.push(239,191,189);if(r=null,i<128){if(--t<0)break;s.push(i)}else if(i<2048){if((t-=2)<0)break;s.push(i>>6|192,63&i|128)}else if(i<65536){if((t-=3)<0)break;s.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;s.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return s}function M(e){return a.toByteArray(function(e){var t;if((e=((t=e).trim?t.trim():t.replace(/^\s+|\s+$/g,"")).replace(T,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function O(e,t,i,n){for(var r=0;r<n&&!(r+i>=t.length||r>=e.length);++r)t[r+i]=e[r];return r}}.call(this,P(16))},function(e,t,i){"use strict";t.byteLength=function(e){var t=l(e),e=t[0],t=t[1];return 3*(e+t)/4-t},t.toByteArray=function(e){var t,i,n=l(e),r=n[0],n=n[1],s=new h(function(e,t){return 3*(e+t)/4-t}(r,n)),o=0,a=0<n?r-4:r;for(i=0;i<a;i+=4)t=c[e.charCodeAt(i)]<<18|c[e.charCodeAt(i+1)]<<12|c[e.charCodeAt(i+2)]<<6|c[e.charCodeAt(i+3)],s[o++]=t>>16&255,s[o++]=t>>8&255,s[o++]=255&t;2===n&&(t=c[e.charCodeAt(i)]<<2|c[e.charCodeAt(i+1)]>>4,s[o++]=255&t);1===n&&(t=c[e.charCodeAt(i)]<<10|c[e.charCodeAt(i+1)]<<4|c[e.charCodeAt(i+2)]>>2,s[o++]=t>>8&255,s[o++]=255&t);return s},t.fromByteArray=function(e){for(var t,i=e.length,n=i%3,r=[],s=0,o=i-n;s<o;s+=16383)r.push(function(e,t,i){for(var n,r=[],s=t;s<i;s+=3)n=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),r.push(function(e){return a[e>>18&63]+a[e>>12&63]+a[e>>6&63]+a[63&e]}(n));return r.join("")}(e,s,o<s+16383?o:s+16383));1==n?(t=e[i-1],r.push(a[t>>2]+a[t<<4&63]+"==")):2==n&&(t=(e[i-2]<<8)+e[i-1],r.push(a[t>>10]+a[t>>4&63]+a[t<<2&63]+"="));return r.join("")};for(var a=[],c=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,s=n.length;r<s;++r)a[r]=n[r],c[n.charCodeAt(r)]=r;function l(e){var t=e.length;if(0<t%4)throw new Error("Invalid string. Length must be a multiple of 4");e=e.indexOf("=");return[e=-1===e?t:e,e===t?0:4-e%4]}c["-".charCodeAt(0)]=62,c["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,i,n,r){var s,o,a=8*r-n-1,c=(1<<a)-1,h=c>>1,l=-7,u=i?r-1:0,d=i?-1:1,i=e[t+u];for(u+=d,s=i&(1<<-l)-1,i>>=-l,l+=a;0<l;s=256*s+e[t+u],u+=d,l-=8);for(o=s&(1<<-l)-1,s>>=-l,l+=n;0<l;o=256*o+e[t+u],u+=d,l-=8);if(0===s)s=1-h;else{if(s===c)return o?NaN:1/0*(i?-1:1);o+=Math.pow(2,n),s-=h}return(i?-1:1)*o*Math.pow(2,s-n)},t.write=function(e,t,i,n,r,s){var o,a,c=8*s-r-1,h=(1<<c)-1,l=h>>1,u=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:s-1,p=n?1:-1,s=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,o=h):(o=Math.floor(Math.log(t)/Math.LN2),t*(n=Math.pow(2,-o))<1&&(o--,n*=2),2<=(t+=1<=o+l?u/n:u*Math.pow(2,1-l))*n&&(o++,n/=2),h<=o+l?(a=0,o=h):1<=o+l?(a=(t*n-1)*Math.pow(2,r),o+=l):(a=t*Math.pow(2,l-1)*Math.pow(2,r),o=0));8<=r;e[i+d]=255&a,d+=p,a/=256,r-=8);for(o=o<<r|a,c+=r;0<c;e[i+d]=255&o,d+=p,o/=256,c-=8);e[i+d-p]|=128*s}},function(e,t){var i={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==i.call(e)}},function(e,t,i){"use strict";var r=i(8);e.exports=function(e,t,i){var n=i.config.validateStatus;i.status&&n&&!n(i.status)?t(new r("Request failed with status code "+i.status,[r.ERR_BAD_REQUEST,r.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i)):e(i)}},function(e,t,i){"use strict";var a=i(4);e.exports=a.isStandardBrowserEnv()?{write:function(e,t,i,n,r,s){var o=[];o.push(e+"="+encodeURIComponent(t)),a.isNumber(i)&&o.push("expires="+new Date(i).toGMTString()),a.isString(n)&&o.push("path="+n),a.isString(r)&&o.push("domain="+r),!0===s&&o.push("secure"),document.cookie=o.join("; ")},read:function(e){e=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(e,t,i){"use strict";e.exports=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}},function(e,t,i){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},function(e,t,i){"use strict";var r=i(4),s=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,i,n={};return e&&r.forEach(e.split("\n"),function(e){i=e.indexOf(":"),t=r.trim(e.substr(0,i)).toLowerCase(),i=r.trim(e.substr(i+1)),t&&(n[t]&&0<=s.indexOf(t)||(n[t]="set-cookie"===t?(n[t]||[]).concat([i]):n[t]?n[t]+", "+i:i))}),n}},function(e,t,i){"use strict";var n,r,s,o=i(4);function a(e){return r&&(s.setAttribute("href",e),e=s.href),s.setAttribute("href",e),{href:s.href,protocol:s.protocol?s.protocol.replace(/:$/,""):"",host:s.host,search:s.search?s.search.replace(/^\?/,""):"",hash:s.hash?s.hash.replace(/^#/,""):"",hostname:s.hostname,port:s.port,pathname:"/"===s.pathname.charAt(0)?s.pathname:"/"+s.pathname}}e.exports=o.isStandardBrowserEnv()?(r=/(msie|trident)/i.test(navigator.userAgent),s=document.createElement("a"),n=a(window.location.href),function(e){e=o.isString(e)?a(e):e;return e.protocol===n.protocol&&e.host===n.host}):function(){return!0}},function(e,t,i){"use strict";e.exports=function(e){e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return e&&e[1]||""}},function(e,t){e.exports=null},function(e,t,i){"use strict";var o=i(28).version,c=i(8),n={};["object","boolean","number","function","string","symbol"].forEach(function(t,i){n[t]=function(e){return typeof e===t||"a"+(i<1?"n ":" ")+t}});var a={};n.transitional=function(n,r,i){function s(e,t){return"[Axios v"+o+"] Transitional option '"+e+"'"+t+(i?". "+i:"")}return function(e,t,i){if(!1===n)throw new c(s(t," has been removed"+(r?" in "+r:"")),c.ERR_DEPRECATED);return r&&!a[t]&&(a[t]=!0,console.warn(s(t," has been deprecated since v"+r+" and will be removed in the near future"))),!n||n(e,t,i)}},e.exports={assertOptions:function(e,t,i){if("object"!=typeof e)throw new c("options must be an object",c.ERR_BAD_OPTION_VALUE);for(var n=Object.keys(e),r=n.length;0<r--;){var s=n[r],o=t[s];if(o){var a=e[s],a=void 0===a||o(a,s,e);if(!0!==a)throw new c("option "+s+" must be "+a,c.ERR_BAD_OPTION_VALUE)}else if(!0!==i)throw new c("Unknown option "+s,c.ERR_BAD_OPTION)}},validators:n}},function(e,t,i){"use strict";var r=i(12);function n(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise(function(e){t=e});var n=this;this.promise.then(function(e){if(n._listeners){for(var t=n._listeners.length,i=0;i<t;i++)n._listeners[i](e);n._listeners=null}}),this.promise.then=function(e){var t,e=new Promise(function(e){n.subscribe(e),t=e}).then(e);return e.cancel=function(){n.unsubscribe(t)},e},e(function(e){n.reason||(n.reason=new r(e),t(n.reason))})}n.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},n.prototype.subscribe=function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]},n.prototype.unsubscribe=function(e){!this._listeners||-1!==(e=this._listeners.indexOf(e))&&this._listeners.splice(e,1)},n.source=function(){var t;return{token:new n(function(e){t=e}),cancel:t}},e.exports=n},function(e,t,i){"use strict";e.exports=function(t){return function(e){return t.apply(null,e)}}},function(e,t,i){"use strict";var n=i(4);e.exports=function(e){return n.isObject(e)&&!0===e.isAxiosError}},function(e,t){},function(e,t,i){var n;e.exports=(n=i(2),function(){var e,r;"function"==typeof ArrayBuffer&&(e=n.lib.WordArray,r=e.init,(e.init=function(e){if((e=(e=e instanceof ArrayBuffer?new Uint8Array(e):e)instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e)instanceof Uint8Array){for(var t=e.byteLength,i=[],n=0;n<t;n++)i[n>>>2]|=e[n]<<24-n%4*8;r.call(this,i,t)}else r.apply(this,arguments)}).prototype=e)}(),n.lib.WordArray)},function(e,t,i){var n;e.exports=(n=i(2),function(){var r=n.lib.WordArray,e=n.enc;e.Utf16=e.Utf16BE={stringify:function(e){for(var t=e.words,i=e.sigBytes,n=[],r=0;r<i;r+=2){var s=t[r>>>2]>>>16-r%4*8&65535;n.push(String.fromCharCode(s))}return n.join("")},parse:function(e){for(var t=e.length,i=[],n=0;n<t;n++)i[n>>>1]|=e.charCodeAt(n)<<16-n%2*16;return r.create(i,2*t)}};function o(e){return e<<8&4278255360|e>>>8&16711935}e.Utf16LE={stringify:function(e){for(var t=e.words,i=e.sigBytes,n=[],r=0;r<i;r+=2){var s=o(t[r>>>2]>>>16-r%4*8&65535);n.push(String.fromCharCode(s))}return n.join("")},parse:function(e){for(var t=e.length,i=[],n=0;n<t;n++)i[n>>>1]|=o(e.charCodeAt(n)<<16-n%2*16);return r.create(i,2*t)}}}(),n.enc.Utf16)},function(e,t,i){var n;e.exports=(n=i(2),function(){var c=n.lib.WordArray;n.enc.Base64url={stringify:function(e,t=!0){var i=e.words,n=e.sigBytes,r=t?this._safe_map:this._map;e.clamp();for(var s=[],o=0;o<n;o+=3)for(var a=(i[o>>>2]>>>24-o%4*8&255)<<16|(i[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|i[o+2>>>2]>>>24-(o+2)%4*8&255,c=0;c<4&&o+.75*c<n;c++)s.push(r.charAt(a>>>6*(3-c)&63));var h=r.charAt(64);if(h)for(;s.length%4;)s.push(h);return s.join("")},parse:function(e,t=!0){var i=e.length,n=t?this._safe_map:this._map;if(!(r=this._reverseMap))for(var r=this._reverseMap=[],s=0;s<n.length;s++)r[n.charCodeAt(s)]=s;t=n.charAt(64);return!t||-1!==(t=e.indexOf(t))&&(i=t),function(e,t,i){for(var n=[],r=0,s=0;s<t;s++){var o,a;s%4&&(o=i[e.charCodeAt(s-1)]<<s%4*2,a=i[e.charCodeAt(s)]>>>6-s%4*2,a=o|a,n[r>>>2]|=a<<24-r%4*8,r++)}return c.create(n,r)}(e,i,r)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"}}(),n.enc.Base64url)},function(e,t,i){var r;e.exports=(r=i(2),i(29),function(){var e=r,t=e.lib.WordArray,i=e.algo,n=i.SHA256,i=i.SHA224=n.extend({_doReset:function(){this._hash=new t.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var e=n._doFinalize.call(this);return e.sigBytes-=4,e}});e.SHA224=n._createHelper(i),e.HmacSHA224=n._createHmacHelper(i)}(),r.SHA224)},function(e,t,i){var s;e.exports=(s=i(2),i(13),i(30),function(){var e=s,t=e.x64,i=t.Word,n=t.WordArray,t=e.algo,r=t.SHA512,t=t.SHA384=r.extend({_doReset:function(){this._hash=new n.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 e=r._doFinalize.call(this);return e.sigBytes-=16,e}});e.SHA384=r._createHelper(t),e.HmacSHA384=r._createHmacHelper(t)}(),s.SHA384)},function(e,t,i){var r;e.exports=(r=i(2),i(13),function(l){var e=r,t=e.lib,u=t.WordArray,n=t.Hasher,d=e.x64.Word,t=e.algo,C=[],S=[],T=[];!function(){for(var e=1,t=0,i=0;i<24;i++){C[e+5*t]=(i+1)*(i+2)/2%64;var n=(2*e+3*t)%5;e=t%5,t=n}for(e=0;e<5;e++)for(t=0;t<5;t++)S[e+5*t]=t+(2*e+3*t)%5*5;for(var r=1,s=0;s<24;s++){for(var o,a=0,c=0,h=0;h<7;h++)1&r&&((o=(1<<h)-1)<32?c^=1<<o:a^=1<<o-32),128&r?r=r<<1^113:r<<=1;T[s]=d.create(a,c)}}();var k=[];!function(){for(var e=0;e<25;e++)k[e]=d.create()}();t=t.SHA3=n.extend({cfg:n.cfg.extend({outputLength:512}),_doReset:function(){for(var e=this._state=[],t=0;t<25;t++)e[t]=new d.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(e,t){for(var i=this._state,n=this.blockSize/2,r=0;r<n;r++){var s=e[t+2*r],o=e[t+2*r+1],s=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8);(A=i[r]).high^=o=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),A.low^=s}for(var a=0;a<24;a++){for(var c=0;c<5;c++){for(var h=0,l=0,u=0;u<5;u++)h^=(A=i[c+5*u]).high,l^=A.low;var d=k[c];d.high=h,d.low=l}for(c=0;c<5;c++)for(var p=k[(c+4)%5],f=k[(c+1)%5],g=f.high,f=f.low,h=p.high^(g<<1|f>>>31),l=p.low^(f<<1|g>>>31),u=0;u<5;u++)(A=i[c+5*u]).high^=h,A.low^=l;for(var m=1;m<25;m++){var v=(A=i[m]).high,y=A.low,b=C[m];l=b<32?(h=v<<b|y>>>32-b,y<<b|v>>>32-b):(h=y<<b-32|v>>>64-b,v<<b-32|y>>>64-b);b=k[S[m]];b.high=h,b.low=l}var w=k[0],_=i[0];w.high=_.high,w.low=_.low;for(c=0;c<5;c++)for(u=0;u<5;u++){var A=i[m=c+5*u],B=k[m],x=k[(c+1)%5+5*u],E=k[(c+2)%5+5*u];A.high=B.high^~x.high&E.high,A.low=B.low^~x.low&E.low}A=i[0],_=T[a];A.high^=_.high,A.low^=_.low}},_doFinalize:function(){var e=this._data,t=e.words,i=(this._nDataBytes,8*e.sigBytes),n=32*this.blockSize;t[i>>>5]|=1<<24-i%32,t[(l.ceil((1+i)/n)*n>>>5)-1]|=128,e.sigBytes=4*t.length,this._process();for(var r=this._state,t=this.cfg.outputLength/8,s=t/8,o=[],a=0;a<s;a++){var c=r[a],h=c.high,c=c.low,h=16711935&(h<<8|h>>>24)|4278255360&(h<<24|h>>>8);o.push(c=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8)),o.push(h)}return new u.init(o,t)},clone:function(){for(var e=n.clone.call(this),t=e._state=this._state.slice(0),i=0;i<25;i++)t[i]=t[i].clone();return e}});e.SHA3=n._createHelper(t),e.HmacSHA3=n._createHmacHelper(t)}(Math),r.SHA3)},function(e,t,i){var r;e.exports=(r=i(2),function(){var e=r,t=e.lib,i=t.WordArray,n=t.Hasher,t=e.algo,B=i.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]),x=i.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]),E=i.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]),C=i.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]),S=i.create([0,1518500249,1859775393,2400959708,2840853838]),T=i.create([1352829926,1548603684,1836072691,2053994217,0]),t=t.RIPEMD160=n.extend({_doReset:function(){this._hash=i.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var i=0;i<16;i++){var n=t+i,r=e[n];e[n]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8)}for(var s,o,a,c,h,l,u=this._hash.words,d=S.words,p=T.words,f=B.words,g=x.words,m=E.words,v=C.words,y=s=u[0],b=o=u[1],w=a=u[2],_=c=u[3],A=h=u[4],i=0;i<80;i+=1)l=s+e[t+f[i]]|0,l+=i<16?(o^a^c)+d[0]:i<32?k(o,a,c)+d[1]:i<48?((o|~a)^c)+d[2]:i<64?M(o,a,c)+d[3]:(o^(a|~c))+d[4],l=(l=O(l|=0,m[i]))+h|0,s=h,h=c,c=O(a,10),a=o,o=l,l=y+e[t+g[i]]|0,l+=i<16?(b^(w|~_))+p[0]:i<32?M(b,w,_)+p[1]:i<48?((b|~w)^_)+p[2]:i<64?k(b,w,_)+p[3]:(b^w^_)+p[4],l=(l=O(l|=0,v[i]))+A|0,y=A,A=_,_=O(w,10),w=b,b=l;l=u[1]+a+_|0,u[1]=u[2]+c+A|0,u[2]=u[3]+h+y|0,u[3]=u[4]+s+b|0,u[4]=u[0]+o+w|0,u[0]=l},_doFinalize:function(){var e=this._data,t=e.words,i=8*this._nDataBytes,n=8*e.sigBytes;t[n>>>5]|=128<<24-n%32,t[14+(64+n>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),e.sigBytes=4*(t.length+1),this._process();for(var t=this._hash,r=t.words,s=0;s<5;s++){var o=r[s];r[s]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8)}return t},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e}});function k(e,t,i){return e&t|~e&i}function M(e,t,i){return e&i|t&~i}function O(e,t){return e<<t|e>>>32-t}e.RIPEMD160=n._createHelper(t),e.HmacRIPEMD160=n._createHmacHelper(t)}(Math),r.RIPEMD160)},function(e,t,i){var s;e.exports=(s=i(2),i(17),i(18),function(){var e=s,t=e.lib,i=t.Base,v=t.WordArray,n=e.algo,t=n.SHA1,y=n.HMAC,r=n.PBKDF2=i.extend({cfg:i.extend({keySize:4,hasher:t,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var i=this.cfg,n=y.create(i.hasher,e),r=v.create(),s=v.create([1]),o=r.words,a=s.words,c=i.keySize,h=i.iterations;o.length<c;){var l=n.update(t).finalize(s);n.reset();for(var u=l.words,d=u.length,p=l,f=1;f<h;f++){p=n.finalize(p),n.reset();for(var g=p.words,m=0;m<d;m++)u[m]^=g[m]}r.concat(l),a[0]++}return r.sigBytes=4*c,r}});e.PBKDF2=function(e,t,i){return r.create(i).compute(e,t)}}(),s.PBKDF2)},function(e,t,i){var n;e.exports=(n=i(2),i(5),n.mode.CFB=function(){var e=n.lib.BlockCipherMode.extend();function s(e,t,i,n){var r,s=this._iv;s?(r=s.slice(0),this._iv=void 0):r=this._prevBlock,n.encryptBlock(r,0);for(var o=0;o<i;o++)e[t+o]^=r[o]}return e.Encryptor=e.extend({processBlock:function(e,t){var i=this._cipher,n=i.blockSize;s.call(this,e,t,n,i),this._prevBlock=e.slice(t,t+n)}}),e.Decryptor=e.extend({processBlock:function(e,t){var i=this._cipher,n=i.blockSize,r=e.slice(t,t+n);s.call(this,e,t,n,i),this._prevBlock=r}}),e}(),n.mode.CFB)},function(e,t,i){var n;e.exports=(n=i(2),i(5),n.mode.CTR=function(){var e=n.lib.BlockCipherMode.extend(),t=e.Encryptor=e.extend({processBlock:function(e,t){var i=this._cipher,n=i.blockSize,r=this._iv,s=this._counter;r&&(s=this._counter=r.slice(0),this._iv=void 0);var o=s.slice(0);i.encryptBlock(o,0),s[n-1]=s[n-1]+1|0;for(var a=0;a<n;a++)e[t+a]^=o[a]}});return e.Decryptor=t,e}(),n.mode.CTR)},function(e,t,i){var n;e.exports=(n=i(2),i(5),n.mode.CTRGladman=function(){var e=n.lib.BlockCipherMode.extend();function c(e){var t,i,n;return 255==(e>>24&255)?(i=e>>8&255,n=255&e,255===(t=e>>16&255)?(t=0,255===i?(i=0,255===n?n=0:++n):++i):++t,e=0,e+=t<<16,e+=i<<8,e+=n):e+=1<<24,e}var t=e.Encryptor=e.extend({processBlock:function(e,t){var i=this._cipher,n=i.blockSize,r=this._iv,s=this._counter;r&&(s=this._counter=r.slice(0),this._iv=void 0),0===((r=s)[0]=c(r[0]))&&(r[1]=c(r[1]));var o=s.slice(0);i.encryptBlock(o,0);for(var a=0;a<n;a++)e[t+a]^=o[a]}});return e.Decryptor=t,e}(),n.mode.CTRGladman)},function(e,t,i){var n;e.exports=(n=i(2),i(5),n.mode.OFB=function(){var e=n.lib.BlockCipherMode.extend(),t=e.Encryptor=e.extend({processBlock:function(e,t){var i=this._cipher,n=i.blockSize,r=this._iv,s=this._keystream;r&&(s=this._keystream=r.slice(0),this._iv=void 0),i.encryptBlock(s,0);for(var o=0;o<n;o++)e[t+o]^=s[o]}});return e.Decryptor=t,e}(),n.mode.OFB)},function(e,t,i){var n;e.exports=(n=i(2),i(5),n.mode.ECB=function(){var e=n.lib.BlockCipherMode.extend();return e.Encryptor=e.extend({processBlock:function(e,t){this._cipher.encryptBlock(e,t)}}),e.Decryptor=e.extend({processBlock:function(e,t){this._cipher.decryptBlock(e,t)}}),e}(),n.mode.ECB)},function(e,t,i){e.exports=(e=i(2),i(5),e.pad.AnsiX923={pad:function(e,t){var i=e.sigBytes,t=4*t,t=t-i%t,i=i+t-1;e.clamp(),e.words[i>>>2]|=t<<24-i%4*8,e.sigBytes+=t},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},e.pad.Ansix923)},function(e,t,i){var n;e.exports=(n=i(2),i(5),n.pad.Iso10126={pad:function(e,t){t*=4,t-=e.sigBytes%t;e.concat(n.lib.WordArray.random(t-1)).concat(n.lib.WordArray.create([t<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},n.pad.Iso10126)},function(e,t,i){var n;e.exports=(n=i(2),i(5),n.pad.Iso97971={pad:function(e,t){e.concat(n.lib.WordArray.create([2147483648],1)),n.pad.ZeroPadding.pad(e,t)},unpad:function(e){n.pad.ZeroPadding.unpad(e),e.sigBytes--}},n.pad.Iso97971)},function(e,t,i){e.exports=(e=i(2),i(5),e.pad.ZeroPadding={pad:function(e,t){t*=4;e.clamp(),e.sigBytes+=t-(e.sigBytes%t||t)},unpad:function(e){for(var t=e.words,i=e.sigBytes-1,i=e.sigBytes-1;0<=i;i--)if(t[i>>>2]>>>24-i%4*8&255){e.sigBytes=i+1;break}}},e.pad.ZeroPadding)},function(e,t,i){e.exports=(e=i(2),i(5),e.pad.NoPadding={pad:function(){},unpad:function(){}},e.pad.NoPadding)},function(e,t,i){var n;e.exports=(n=i(2),i(5),function(){var t=n.lib.CipherParams,i=n.enc.Hex;n.format.Hex={stringify:function(e){return e.ciphertext.toString(i)},parse:function(e){e=i.parse(e);return t.create({ciphertext:e})}}}(),n.format.Hex)},function(e,t,i){var n;e.exports=(n=i(2),i(9),i(10),i(7),i(5),function(){var e=n,t=e.lib.BlockCipher,i=e.algo,h=[],l=[],u=[],d=[],p=[],f=[],g=[],m=[],v=[],y=[];!function(){for(var e=[],t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;for(var i=0,n=0,t=0;t<256;t++){var r=n^n<<1^n<<2^n<<3^n<<4;h[i]=r=r>>>8^255&r^99;var s=e[l[r]=i],o=e[s],a=e[o],c=257*e[r]^16843008*r;u[i]=c<<24|c>>>8,d[i]=c<<16|c>>>16,p[i]=c<<8|c>>>24,f[i]=c,g[r]=(c=16843009*a^65537*o^257*s^16843008*i)<<24|c>>>8,m[r]=c<<16|c>>>16,v[r]=c<<8|c>>>24,y[r]=c,i?(i=s^e[e[e[a^s]]],n^=e[e[n]]):i=n=1}}();var b=[0,1,2,4,8,16,32,64,128,27,54],i=i.AES=t.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,i=e.sigBytes/4,n=4*(1+(this._nRounds=6+i)),r=this._keySchedule=[],s=0;s<n;s++)s<i?r[s]=t[s]:(c=r[s-1],s%i?6<i&&s%i==4&&(c=h[c>>>24]<<24|h[c>>>16&255]<<16|h[c>>>8&255]<<8|h[255&c]):(c=h[(c=c<<8|c>>>24)>>>24]<<24|h[c>>>16&255]<<16|h[c>>>8&255]<<8|h[255&c],c^=b[s/i|0]<<24),r[s]=r[s-i]^c);for(var o=this._invKeySchedule=[],a=0;a<n;a++){var c,s=n-a;c=a%4?r[s]:r[s-4],o[a]=a<4||s<=4?c:g[h[c>>>24]]^m[h[c>>>16&255]]^v[h[c>>>8&255]]^y[h[255&c]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,u,d,p,f,h)},decryptBlock:function(e,t){var i=e[t+1];e[t+1]=e[t+3],e[t+3]=i,this._doCryptBlock(e,t,this._invKeySchedule,g,m,v,y,l);i=e[t+1];e[t+1]=e[t+3],e[t+3]=i},_doCryptBlock:function(e,t,i,n,r,s,o,a){for(var c=this._nRounds,h=e[t]^i[0],l=e[t+1]^i[1],u=e[t+2]^i[2],d=e[t+3]^i[3],p=4,f=1;f<c;f++)var g=n[h>>>24]^r[l>>>16&255]^s[u>>>8&255]^o[255&d]^i[p++],m=n[l>>>24]^r[u>>>16&255]^s[d>>>8&255]^o[255&h]^i[p++],v=n[u>>>24]^r[d>>>16&255]^s[h>>>8&255]^o[255&l]^i[p++],y=n[d>>>24]^r[h>>>16&255]^s[l>>>8&255]^o[255&u]^i[p++],h=g,l=m,u=v,d=y;g=(a[h>>>24]<<24|a[l>>>16&255]<<16|a[u>>>8&255]<<8|a[255&d])^i[p++],m=(a[l>>>24]<<24|a[u>>>16&255]<<16|a[d>>>8&255]<<8|a[255&h])^i[p++],v=(a[u>>>24]<<24|a[d>>>16&255]<<16|a[h>>>8&255]<<8|a[255&l])^i[p++],y=(a[d>>>24]<<24|a[h>>>16&255]<<16|a[l>>>8&255]<<8|a[255&u])^i[p++];e[t]=g,e[t+1]=m,e[t+2]=v,e[t+3]=y},keySize:8});e.AES=t._createHelper(i)}(),n.AES)},function(e,t,i){var s;e.exports=(s=i(2),i(9),i(10),i(7),i(5),function(){var e=s,t=e.lib,n=t.WordArray,i=t.BlockCipher,t=e.algo,h=[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],l=[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],u=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],d=[{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}],p=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],r=t.DES=i.extend({_doReset:function(){for(var e=this._key.words,t=[],i=0;i<56;i++){var n=h[i]-1;t[i]=e[n>>>5]>>>31-n%32&1}for(var r=this._subKeys=[],s=0;s<16;s++){for(var o=r[s]=[],a=u[s],i=0;i<24;i++)o[i/6|0]|=t[(l[i]-1+a)%28]<<31-i%6,o[4+(i/6|0)]|=t[28+(l[i+24]-1+a)%28]<<31-i%6;o[0]=o[0]<<1|o[0]>>>31;for(i=1;i<7;i++)o[i]=o[i]>>>4*(i-1)+3;o[7]=o[7]<<5|o[7]>>>27}for(var c=this._invSubKeys=[],i=0;i<16;i++)c[i]=r[15-i]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._subKeys)},decryptBlock:function(e,t){this._doCryptBlock(e,t,this._invSubKeys)},_doCryptBlock:function(e,t,i){this._lBlock=e[t],this._rBlock=e[t+1],f.call(this,4,252645135),f.call(this,16,65535),g.call(this,2,858993459),g.call(this,8,16711935),f.call(this,1,1431655765);for(var n=0;n<16;n++){for(var r=i[n],s=this._lBlock,o=this._rBlock,a=0,c=0;c<8;c++)a|=d[c][((o^r[c])&p[c])>>>0];this._lBlock=o,this._rBlock=s^a}var h=this._lBlock;this._lBlock=this._rBlock,this._rBlock=h,f.call(this,1,1431655765),g.call(this,8,16711935),g.call(this,2,858993459),f.call(this,16,65535),f.call(this,4,252645135),e[t]=this._lBlock,e[t+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function f(e,t){t=(this._lBlock>>>e^this._rBlock)&t;this._rBlock^=t,this._lBlock^=t<<e}function g(e,t){t=(this._rBlock>>>e^this._lBlock)&t;this._lBlock^=t,this._rBlock^=t<<e}e.DES=i._createHelper(r);t=t.TripleDES=i.extend({_doReset:function(){var e=this._key.words;if(2!==e.length&&4!==e.length&&e.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var t=e.slice(0,2),i=e.length<4?e.slice(0,2):e.slice(2,4),e=e.length<6?e.slice(0,2):e.slice(4,6);this._des1=r.createEncryptor(n.create(t)),this._des2=r.createEncryptor(n.create(i)),this._des3=r.createEncryptor(n.create(e))},encryptBlock:function(e,t){this._des1.encryptBlock(e,t),this._des2.decryptBlock(e,t),this._des3.encryptBlock(e,t)},decryptBlock:function(e,t){this._des3.decryptBlock(e,t),this._des2.encryptBlock(e,t),this._des1.decryptBlock(e,t)},keySize:6,ivSize:2,blockSize:2});e.TripleDES=i._createHelper(t)}(),s.TripleDES)},function(e,t,i){var s;e.exports=(s=i(2),i(9),i(10),i(7),i(5),function(){var e=s,t=e.lib.StreamCipher,i=e.algo,n=i.RC4=t.extend({_doReset:function(){for(var e=this._key,t=e.words,i=e.sigBytes,n=this._S=[],r=0;r<256;r++)n[r]=r;for(var r=0,s=0;r<256;r++){var o=r%i,o=t[o>>>2]>>>24-o%4*8&255,s=(s+n[r]+o)%256,o=n[r];n[r]=n[s],n[s]=o}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=r.call(this)},keySize:8,ivSize:0});function r(){for(var e=this._S,t=this._i,i=this._j,n=0,r=0;r<4;r++){var i=(i+e[t=(t+1)%256])%256,s=e[t];e[t]=e[i],e[i]=s,n|=e[(e[t]+e[i])%256]<<24-8*r}return this._i=t,this._j=i,n}e.RC4=t._createHelper(n);i=i.RC4Drop=n.extend({cfg:n.cfg.extend({drop:192}),_doReset:function(){n._doReset.call(this);for(var e=this.cfg.drop;0<e;e--)r.call(this)}});e.RC4Drop=t._createHelper(i)}(),s.RC4)},function(e,t,i){var n;e.exports=(n=i(2),i(9),i(10),i(7),i(5),function(){var e=n,t=e.lib.StreamCipher,i=e.algo,r=[],o=[],a=[],i=i.Rabbit=t.extend({_doReset:function(){for(var e=this._key.words,t=this.cfg.iv,i=0;i<4;i++)e[i]=16711935&(e[i]<<8|e[i]>>>24)|4278255360&(e[i]<<24|e[i]>>>8);for(var n=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],r=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]],i=this._b=0;i<4;i++)c.call(this);for(i=0;i<8;i++)r[i]^=n[i+4&7];if(t){var s=t.words,o=s[0],a=s[1],t=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),s=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),o=t>>>16|4294901760&s,a=s<<16|65535&t;r[0]^=t,r[1]^=o,r[2]^=s,r[3]^=a,r[4]^=t,r[5]^=o,r[6]^=s,r[7]^=a;for(i=0;i<4;i++)c.call(this)}},_doProcessBlock:function(e,t){var i=this._X;c.call(this),r[0]=i[0]^i[5]>>>16^i[3]<<16,r[1]=i[2]^i[7]>>>16^i[5]<<16,r[2]=i[4]^i[1]>>>16^i[7]<<16,r[3]=i[6]^i[3]>>>16^i[1]<<16;for(var n=0;n<4;n++)r[n]=16711935&(r[n]<<8|r[n]>>>24)|4278255360&(r[n]<<24|r[n]>>>8),e[t+n]^=r[n]},blockSize:4,ivSize:2});function c(){for(var e=this._X,t=this._C,i=0;i<8;i++)o[i]=t[i];t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<o[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<o[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<o[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<o[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<o[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<o[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<o[6]>>>0?1:0)|0,this._b=t[7]>>>0<o[7]>>>0?1:0;for(i=0;i<8;i++){var n=e[i]+t[i],r=65535&n,s=n>>>16;a[i]=((r*r>>>17)+r*s>>>15)+s*s^((4294901760&n)*n|0)+((65535&n)*n|0)}e[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,e[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,e[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,e[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,e[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,e[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,e[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,e[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}e.Rabbit=t._createHelper(i)}(),n.Rabbit)},function(e,t,i){var n;e.exports=(n=i(2),i(9),i(10),i(7),i(5),function(){var e=n,t=e.lib.StreamCipher,i=e.algo,r=[],o=[],a=[],i=i.RabbitLegacy=t.extend({_doReset:function(){for(var e=this._key.words,t=this.cfg.iv,i=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],n=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]],r=this._b=0;r<4;r++)c.call(this);for(r=0;r<8;r++)n[r]^=i[r+4&7];if(t){var s=t.words,o=s[0],e=s[1],t=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),s=16711935&(e<<8|e>>>24)|4278255360&(e<<24|e>>>8),o=t>>>16|4294901760&s,e=s<<16|65535&t;n[0]^=t,n[1]^=o,n[2]^=s,n[3]^=e,n[4]^=t,n[5]^=o,n[6]^=s,n[7]^=e;for(r=0;r<4;r++)c.call(this)}},_doProcessBlock:function(e,t){var i=this._X;c.call(this),r[0]=i[0]^i[5]>>>16^i[3]<<16,r[1]=i[2]^i[7]>>>16^i[5]<<16,r[2]=i[4]^i[1]>>>16^i[7]<<16,r[3]=i[6]^i[3]>>>16^i[1]<<16;for(var n=0;n<4;n++)r[n]=16711935&(r[n]<<8|r[n]>>>24)|4278255360&(r[n]<<24|r[n]>>>8),e[t+n]^=r[n]},blockSize:4,ivSize:2});function c(){for(var e=this._X,t=this._C,i=0;i<8;i++)o[i]=t[i];t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<o[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<o[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<o[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<o[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<o[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<o[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<o[6]>>>0?1:0)|0,this._b=t[7]>>>0<o[7]>>>0?1:0;for(i=0;i<8;i++){var n=e[i]+t[i],r=65535&n,s=n>>>16;a[i]=((r*r>>>17)+r*s>>>15)+s*s^((4294901760&n)*n|0)+((65535&n)*n|0)}e[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,e[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,e[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,e[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,e[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,e[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,e[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,e[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}e.RabbitLegacy=t._createHelper(i)}(),n.RabbitLegacy)},function(e,t,i){"use strict";i.r(t),i.d(t,"default",function(){return ke});i(32),i(33),i(34),i(35),i(36);var r,t=i(3),d=i.n(t);class p{static vector3ToJson(e){return{x:Math.floor(1e3*e.x)/1e3,y:Math.floor(1e3*e.y)/1e3,z:Math.floor(1e3*e.z)/1e3}}static vector3ARRToJson(e){let t=[];return e.forEach(e=>t.push({x:Math.floor(1e3*e.x)/1e3,y:Math.floor(1e3*e.y)/1e3,z:Math.floor(1e3*e.z)/1e3})),t}static ToVector3(e){return new BABYLON.Vector3(Math.floor(1e3*e.x)/1e3,Math.floor(1e3*e.y)/1e3,Math.floor(1e3*e.z)/1e3)}static ToARRVector3(e){let t=[];return e.forEach(e=>t.push(new BABYLON.Vector3(Math.floor(1e3*e.x)/1e3,Math.floor(1e3*e.y)/1e3,Math.floor(1e3*e.z)/1e3))),t}static computeBounds(e){let t=e.getChildMeshes(),i=e.getBoundingInfo();if(0<t.length){for(var n=t[0].getBoundingInfo(),r=n.minimum.add(t[0].position),s=n.maximum.add(t[0].position),o=1;o<t.length;o++)n=t[o].getBoundingInfo(),r=BABYLON.Vector3.Minimize(r,n.minimum.add(t[o].position)),s=BABYLON.Vector3.Maximize(s,n.maximum.add(t[o].position));i=new BABYLON.BoundingInfo(r,s)}return i}static computeBoundsToARR(e){for(var t=e[0].getBoundingInfo(),i=t.minimum.add(e[0].position),n=t.maximum.add(e[0].position),r=1;r<e.length;r++)t=e[r].getBoundingInfo(),i=BABYLON.Vector3.Minimize(i,t.minimum.add(e[r].position)),n=BABYLON.Vector3.Maximize(n,t.maximum.add(e[r].position));return new BABYLON.BoundingInfo(i,n)}static Expand(n,r){let s=new Array;var o=n.length;for(let i=0;i<o;i++){var a=n[i],c=n[0==i?o-1:i-1],h=n[i==o-1?0:i+1],l=c.x-a.x,u=c.z-a.z,d=this.norm(l,u);l/=d,u/=d;c=h.x-a.x,d=h.z-a.z,h=this.norm(c,d);c/=h,d/=h;h=-r/Math.sqrt((1-(l*c+u*d))/2);let e=l+c,t=u+d;h=0==this.norm(e,t)?0:h/this.norm(e,t);e*=h,t*=h,s[i]=new BABYLON.Vector3(e+a.x,0,t+a.z)}return s}static norm(e,t){return Math.sqrt(e*e+t*t)}static MergeMeshes(s,e){let o=new BABYLON.Mesh((new Date).getDate().toString(),e.scene);return setTimeout(()=>{let t=null,i;for(let e=0;e<s.length;e++){var n,r;s[e]&&(r=(n=s[e]).computeWorldMatrix(!0),i=BABYLON.VertexData.ExtractFromMesh(n,!0,!0),i.transform(r),t?t.merge(i,!0):t=i,n.dispose(!1,!0))}t.applyToMesh(o)}),o}static DeconsTructMesh(e,t,i){if(1<e.subMeshes.length){for(var n=BABYLON.VertexData.ExtractFromMesh(e,!0,!0),r=n.indices,s=n.normals,o=n.positions,a=n.uvs,c=new Array,h=0;h<e.subMeshes.length;h++){for(var l=new BABYLON.VertexData,u=r.slice(e.subMeshes[h].indexStart,e.subMeshes[h].indexStart+e.subMeshes[h].indexCount),d=s.slice(3*e.subMeshes[h].verticesStart,3*e.subMeshes[h].verticesStart+3*e.subMeshes[h].verticesCount),p=o.slice(3*e.subMeshes[h].verticesStart,3*e.subMeshes[h].verticesStart+3*e.subMeshes[h].verticesCount),f=a.slice(2*e.subMeshes[h].verticesStart,2*e.subMeshes[h].verticesStart+2*e.subMeshes[h].verticesCount),g=0;g<u.length;g++)u[g]=u[g]-e.subMeshes[h].verticesStart;l.indices=u,l.normals=d,l.positions=p,l.uvs=f;f=new BABYLON.Mesh(e.id+"-"+h,i.scene);l.applyToMesh(f),f.position.y=parseFloat(t),f.setEnabled(!1),c.push(f)}return e.dispose(!1,!0),c}return[e]}static getVisualAngle(e,t){let i={};var n=e.boundingSphere.radiusWorld,r=t.engine.getAspectRatio(t.Camera.camera);let s=t.Camera.camera.fov/1.2;return r<1&&(s=Math.atan(r*Math.tan(t.Camera.camera.fov/2))),i.radius=1.1*Math.abs(n/Math.sin(s)),i.alpha=Math.PI/2,i.beta=Math.PI/4,i.focus=e.boundingSphere.center.clone(),i}static pathTransformation(i,n){let e=new BABYLON.Path3D(i);var r=e.getTangents();let s=[];for(let t=0;t<i.length;t++)if(0<t&&t<i.length-1){var o=i[t-1],a=i[t+1],c=i[t];let e=r[t-1];var h=r[t];if(!e.equals(h)){o=BABYLON.Vector3.Lerp(c,o,n/BABYLON.Vector3.Distance(o,c)),a=BABYLON.Vector3.Lerp(c,a,n/BABYLON.Vector3.Distance(a,c));let e=BABYLON.Curve3.CreateQuadraticBezier(o,c,a,10);s=s.concat(e.getPoints())}}else s.push(i[t]);return s}static createTube(e,t,i=.05,n){return BABYLON.MeshBuilder.CreateTube(e,{path:this.pathTransformation(t,i),radius:i/2},n.scene)}static getAngleFromVector2(e,t,i){var n=(e.x-t.x)*(i.x-t.x)+(e.y-t.y)*(i.y-t.y),t=(e.x-t.x)*(i.y-t.y)-(e.y-t.y)*(i.x-t.x),n=Math.atan2(t,n);return Math.PI-n}static getAngleFromVector3(e,t,i){return this.getAngleFromVector2(new BABYLON.Vector2(e.x,e.z),new BABYLON.Vector2(t.x,t.z),new BABYLON.Vector2(i.x,i.z))}static RandomNumBoth(e,t){var i=t-e,t=Math.random();return e+Math.round(t*i)}}class n{constructor(e){this.app=e,this.camera=new BABYLON.ArcRotateCamera("camera",-Math.PI/4,Math.PI/4,50,new BABYLON.Vector3(0,0,0),this.app.scene),this.camera.pinchPrecision=200,this.app.scene.activeCamera=this.camera,this.camera.attachControl(this.app.canvas,!0,!0),this.camera.minZ=.3,this.camera.wheelDeltaPercentage=.01,this.frustrum=5,this.isOverLook=!1,this.tw_camera=new d.a.Tween(this.camera),this.tw_target=new d.a.Tween(this.camera.target)}orthographic(){this.isOverLook=!0,this.camera.lowerBetaLimit=0,this.camera.upperBetaLimit=0,this.camera.lowerAlphaLimit=Math.PI/2,this.camera.upperAlphaLimit=Math.PI/2,this.camera.mode=BABYLON.Camera.ORTHOGRAPHIC_CAMERA;var e=this.app.Project.current.Sight;this.camera.lowerRadiusLimit=2*e.radius,this.camera.radius=e.radius,this.camera.target=e.focus.clone(),this.frustrum=.5*e.radius,this.computeCameraView()}perspective(e){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,e=e||this.app.Project.current.Sight,this.isOverLook=!1,this.camera.lowerRadiusLimit=e.minimumLimit||1,this.camera.upperRadiusLimit=e.maximumLimit||3e3,this.camera.panningSensibility=1e3,this.camera.lowerBetaLimit=e.minBeta||.01,this.camera.upperBetaLimit=e.maxBeta||Math.PI/2*.98,this.camera.lowerAlphaLimit=null,this.camera.upperAlphaLimit=null,this.camera.mode=BABYLON.Camera.PERSPECTIVE_CAMERA,this.camera.target=e.focus.clone(),(this.camera.alpha>2*Math.PI||this.camera.alpha<-2*Math.PI)&&(this.camera.alpha=this.camera.alpha-Math.floor(this.camera.alpha/(2*Math.PI))*(2*Math.PI));var t=new BABYLON.Animation("camAlpha","alpha",30,BABYLON.Animation.ANIMATIONTYPE_FLOAT,BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE);t.setKeys([{frame:0,value:this.camera.alpha},{frame:30,value:e.alpha}]);var i=new BABYLON.Animation("camRadius","radius",30,BABYLON.Animation.ANIMATIONTYPE_FLOAT,BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE);i.setKeys([{frame:0,value:this.camera.radius},{frame:30,value:e.radius}]);var n=new BABYLON.Animation("camBeta","beta",30,BABYLON.Animation.ANIMATIONTYPE_FLOAT,BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE);n.setKeys([{frame:0,value:this.camera.beta},{frame:30,value:e.beta}]),this.app.scene.beginDirectAnimation(this.camera,[t,i,n],0,60,!1),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}flyTo(e,t=.5){e=e||this.app.Project.current.Sight,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;var i=new BABYLON.Animation("camtarget","target",30,BABYLON.Animation.ANIMATIONTYPE_VECTOR3,BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE);i.setKeys([{frame:0,value:this.camera.target},{frame:30*t,value:e.focus.clone()}]);var n=new BABYLON.Animation("camradius","radius",30,BABYLON.Animation.ANIMATIONTYPE_FLOAT,BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE);n.setKeys([{frame:0,value:this.camera.radius},{frame:30*t,value:e.radius}]),this.app.scene.beginDirectAnimation(this.camera,[i,n],0,30*t,!1),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}lookToTheFront(e,t=.5){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;var i=Math.atan2(-e.instance.forward.z,-e.instance.forward.x);(this.camera.alpha>2*Math.PI||this.camera.alpha<-2*Math.PI)&&(this.camera.alpha=this.camera.alpha-Math.floor(this.camera.alpha/(2*Math.PI))*(2*Math.PI));var n=new BABYLON.Animation("camtarget","target",30,BABYLON.Animation.ANIMATIONTYPE_VECTOR3,BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE);n.setKeys([{frame:0,value:this.camera.target},{frame:30*t,value:e.Sight.focus.clone()}]);var r=new BABYLON.Animation("camAlpha","alpha",30,BABYLON.Animation.ANIMATIONTYPE_FLOAT,BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE);r.setKeys([{frame:0,value:this.camera.alpha},{frame:30*t,value:i}]);i=new BABYLON.Animation("camRadius","radius",30,BABYLON.Animation.ANIMATIONTYPE_FLOAT,BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE);i.setKeys([{frame:0,value:this.camera.radius},{frame:30*t,value:e.Sight.radius/1.2}]);e=new BABYLON.Animation("camBeta","beta",30,BABYLON.Animation.ANIMATIONTYPE_FLOAT,BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE);e.setKeys([{frame:0,value:this.camera.beta},{frame:30*t,value:Math.PI/2}]),this.app.scene.beginDirectAnimation(this.camera,[n,r,i,e],0,30*t,!1),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}getSightJson(){return JSON.stringify({alpha:this.camera.alpha,focus:p.vector3ToJson(this.camera.target),radius:this.camera.radius,beta:this.camera.beta,minimumLimit:this.camera.lowerRadiusLimit,maximumLimit:this.camera.upperRadiusLimit,minBeta:this.camera.lowerBetaLimit,maxBeta:this.camera.upperBetaLimit})}computeCameraView(){var e=this.app.canvas.clientWidth/this.app.canvas.clientHeight;this.camera.orthoLeft=-e*this.frustrum,this.camera.orthoRight=e*this.frustrum,this.camera.orthoTop=this.frustrum,this.camera.orthoBottom=-this.frustrum;e=1e3/(this.frustrum/20);this.camera.panningSensibility=2e3<e?2e3:e<10?10:e}_wheel(e){this.isOverLook&&(e=(e.wheelDelta||24*-e.detail)<0?1.1:.9,this.frustrum*=e,this.computeCameraView())}}class f{constructor(){this.map={}}add(e,t){this.map[e]=t}find(e){return this.map[e]}remove(e){delete this.map[e]}termRemove(e){for(var t in this.map)e(this.map[t])&&delete this.map[t]}showAll(){for(var e in this.map)this.map[e]}count(){var e,t=0;for(e in Object.keys(this.map))++t;return t}clear(){for(var e in this.map)delete this.map[e]}}class o{static getGUID(e){var t,i,n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),r=[],s=n.length;if(e)for(t=0;t<e;t++)r[t]=n[0|Math.random()*s];else for(r[8]=r[13]=r[18]=r[23]="-",r[14]="4",t=0;t<36;t++)r[t]||(i=0|16*Math.random(),r[t]=n[19==t?3&i|8:i]);return r.join("")}}class s{constructor(e){this.objectType="Light",this.app=e}load(){}}class a extends s{load(){this.light=new BABYLON.DirectionalLight(this.id,this.direction,this.app.scene),this.light.position=this.position,this.light.intensity=this.intensity,this.light.diffuse=BABYLON.Color3.FromHexString(this.color),this.light.specular=BABYLON.Color3.Black()}}class c extends s{load(){this.light=new BABYLON.HemisphericLight(this.id,this.direction,this.app.scene),this.light.intensity=this.intensity,this.light.diffuse=BABYLON.Color3.FromHexString(this.color),this.light.specular=BABYLON.Color3.Black()}}(t=r=r||{}).Point="Point",t.Spot="Spot",t.Directional="Directional",t.Hemispheric="Hemispheric";var g;class h extends s{load(){this.light=new BABYLON.PointLight(this.id,this.position.clone(),this.app.scene),this.light.range=this.range,this.light.intensity=this.intensity,this.light.diffuse=BABYLON.Color3.FromHexString(this.color),this.light.specular=BABYLON.Color3.Black()}}class l extends s{load(){this.light=new BABYLON.SpotLight(this.id,this.position.clone(),this.direction.clone(),this.angle*Math.PI/180,this.exponent,this.app.scene),this.light.range=this.range,this.light.position=this.position,this.light.intensity=this.intensity,this.light.diffuse=BABYLON.Color3.FromHexString(this.color),this.light.specular=BABYLON.Color3.Black()}}class u{constructor(e){this.isOK=!1,this.app=e,this.ele=document.createElement("div"),this.ele.style.cssText="position: absolute;z-index:999999999; font-size: 10px;color: rgb(211, 211, 211);text-shadow:rgba(0, 0, 0, 0.2) 1px 1px 0; padding: 5px 8px;",this.app.canvas.parentElement.appendChild(this.ele),this.close(),setInterval(()=>{var e;1e3<(new Date).getTime()-this.time&&this.isOK&&!this.text&&((e=this.app.Project.objectDatas.find(this.id))&&(this.text=e.name))},100)}set text(e){this._text=e,(this.ele.innerText=e)&&(this.ele.style.display=null)}update(e){e.pickInfo.pickedMesh?e.pickInfo.pickedMesh.id!=this.id?(this.close(),this.id=e.pickInfo.pickedMesh.id,this.time=(new Date).getTime()):this.isOK=!0:this.close(),this.ele.style.top=e.event.offsetY+"px",this.ele.style.left=e.event.offsetX+20+"px"}close(){this.isOK=!1,this.time=(new Date).getTime(),this.ele.style.display="none",this.text=""}setBackground(e){this.url=e,this.ele.style.background="url("+this.url+") no-repeat",this.ele.style.backgroundSize="cover"}dispose(){clearInterval(this.interval),this.app.canvas.parentElement.removeChild(this.ele),this.ele=null}}class m{constructor(e){this.lights=new f,this.reflexEnabled=!0,this.reflexIntensity=.5,this.app=e,this.color=new BABYLON.Color4(0,.0588,.1176,1),this.reflex(ke.rl+"resources/environment.env",.5),this.app.scene.fogEnabled=!0,this.app.scene.fogMode=2,this.fogDistance=500,BABYLON.Effect.IncludesShadersStore.fogVertex=`
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("TWEEN"),require("h337"),require("BABYLON"),require("babylonjs-materials"),require("BABYLON.GUI"),require("BABYLON.SceneLoader"),require("babylonjs-serializers")):"function"==typeof define&&define.amd?define(["TWEEN","h337","BABYLON","babylonjs-materials","BABYLON.GUI","BABYLON.SceneLoader","babylonjs-serializers"],t):"object"==typeof exports?exports.MX3D=t(require("TWEEN"),require("h337"),require("BABYLON"),require("babylonjs-materials"),require("BABYLON.GUI"),require("BABYLON.SceneLoader"),require("babylonjs-serializers")):e.MX3D=t(e.TWEEN,e.h337,e.BABYLON,e["babylonjs-materials"],e["BABYLON.GUI"],e["BABYLON.SceneLoader"],e["babylonjs-serializers"])}(window,function(i,n,r,s,o,a,c){return l=[function(e,t,i){"use strict";var n;i.d(t,"a",function(){return n}),(t=n=n||{})[t.Trace=0]="Trace",t[t.Debug=1]="Debug",t[t.Information=2]="Information",t[t.Warning=3]="Warning",t[t.Error=4]="Error",t[t.Critical=5]="Critical",t[t.None=6]="None"},function(e,m,v){"use strict";!function(t,e){v.d(m,"a",function(){return r}),v.d(m,"c",function(){return s}),v.d(m,"f",function(){return l}),v.d(m,"j",function(){return u}),v.d(m,"k",function(){return o}),v.d(m,"e",function(){return a}),v.d(m,"d",function(){return c}),v.d(m,"b",function(){return p}),v.d(m,"i",function(){return d}),v.d(m,"g",function(){return f}),v.d(m,"h",function(){return g});var h=v(0),i=v(11);const n="6.0.7";class r{static isRequired(e,t){if(null==e)throw new Error(`The '${t}' argument is required.`)}static isNotEmpty(e,t){if(!e||e.match(/^\s*$/))throw new Error(`The '${t}' argument should not be empty.`)}static isIn(e,t,i){if(!(e in t))throw new Error(`Unknown ${i} value: ${e}.`)}}class s{static get isBrowser(){return"object"==typeof window&&"object"==typeof window.document}static get isWebWorker(){return"object"==typeof self&&"importScripts"in self}static get isReactNative(){return"object"==typeof window&&void 0===window.document}static get isNode(){return!this.isBrowser&&!this.isWebWorker&&!this.isReactNative}}function l(e,t){let i="";return u(e)?(i=`Binary data of length ${e.byteLength}`,t&&(i+=`. Content: '${function(e){const t=new Uint8Array(e);let i="";return t.forEach(e=>{var t=e<16?"0":"";i+=`0x${t}${e.toString(16)} `}),i.substr(0,i.length-1)}(e)}'`)):"string"==typeof e&&(i=`String data of length ${e.length}`,t&&(i+=`. Content: '${e}'`)),i}function u(e){return e&&"undefined"!=typeof ArrayBuffer&&(e instanceof ArrayBuffer||e.constructor&&"ArrayBuffer"===e.constructor.name)}async function o(e,t,i,n,r,s,o){let a={};!r||(c=await r())&&(a={Authorization:`Bearer ${c}`});var[r,c]=d();a[r]=c,e.log(h.a.Trace,`(${t} transport) sending data. ${l(s,o.logMessageContent)}.`);c=u(s)?"arraybuffer":"text",o=await i.post(n,{content:s,headers:{...a,...o.headers},responseType:c,timeout:o.timeout,withCredentials:o.withCredentials});e.log(h.a.Trace,`(${t} transport) request complete. Response status: ${o.statusCode}.`)}function a(e){return void 0===e?new p(h.a.Information):null===e?i.a.instance:void 0!==e.log?e:new p(e)}class c{constructor(e,t){this._subject=e,this._observer=t}dispose(){var e=this._subject.observers.indexOf(this._observer);-1<e&&this._subject.observers.splice(e,1),0===this._subject.observers.length&&this._subject.cancelCallback&&this._subject.cancelCallback().catch(e=>{})}}class p{constructor(e){this._minLevel=e,this.out=console}log(e,t){if(e>=this._minLevel){var i=`[${(new Date).toISOString()}] ${h.a[e]}: ${t}`;switch(e){case h.a.Critical:case h.a.Error:this.out.error(i);break;case h.a.Warning:this.out.warn(i);break;case h.a.Information:this.out.info(i);break;default:this.out.log(i)}}}}function d(){let e="X-SignalR-User-Agent";return s.isNode&&(e="User-Agent"),[e,function(e,t,i,n){let r="Microsoft SignalR/";var s=e.split(".");r+=`${s[0]}.${s[1]}`,r+=` (${e}; `,r+=t&&""!==t?`${t}; `:"Unknown OS; ";r+=`${i}`,r+=n?`; ${n}`:"; Unknown Runtime Version";return r+=")",r}(n,function(){{if(!s.isNode)return"";switch(t.platform){case"win32":return"Windows NT";case"darwin":return"macOS";case"linux":return"Linux";default:return t.platform}}}(),s.isNode?"NodeJS":"Browser",function(){if(s.isNode)return t.versions.node;return}())]}function f(e){return e.stack||e.message||`${e}`}function g(){if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==e)return e;throw new Error("could not find global")}}.call(this,v(21),v(16))},function(t,e,g){!function(f){var e;t.exports=(e=function(h){var n;if("undefined"!=typeof window&&window.crypto&&(n=window.crypto),"undefined"!=typeof self&&self.crypto&&(n=self.crypto),!(n=!(n=!(n="undefined"!=typeof globalThis&&globalThis.crypto?globalThis.crypto:n)&&"undefined"!=typeof window&&window.msCrypto?window.msCrypto:n)&&void 0!==f&&f.crypto?f.crypto:n))try{n=g(59)}catch(e){}var i=Object.create||function(e){return t.prototype=e,e=new t,t.prototype=null,e};function t(){}var e={},r=e.lib={},s=r.Base={extend:function(e){var t=i(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),(t.init.prototype=t).$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},l=r.WordArray=s.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||a).stringify(this)},concat:function(e){var t=this.words,i=e.words,n=this.sigBytes,r=e.sigBytes;if(this.clamp(),n%4)for(var s=0;s<r;s++){var o=i[s>>>2]>>>24-s%4*8&255;t[n+s>>>2]|=o<<24-(n+s)%4*8}else for(var a=0;a<r;a+=4)t[n+a>>>2]=i[a>>>2];return this.sigBytes+=r,this},clamp:function(){var e=this.words,t=this.sigBytes;e[t>>>2]&=4294967295<<32-t%4*8,e.length=h.ceil(t/4)},clone:function(){var e=s.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],i=0;i<e;i+=4)t.push(function(){if(n){if("function"==typeof n.getRandomValues)try{return n.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof n.randomBytes)try{return n.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")}());return new l.init(t,e)}}),o=e.enc={},a=o.Hex={stringify:function(e){for(var t=e.words,i=e.sigBytes,n=[],r=0;r<i;r++){var s=t[r>>>2]>>>24-r%4*8&255;n.push((s>>>4).toString(16)),n.push((15&s).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,i=[],n=0;n<t;n+=2)i[n>>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new l.init(i,t/2)}},c=o.Latin1={stringify:function(e){for(var t=e.words,i=e.sigBytes,n=[],r=0;r<i;r++){var s=t[r>>>2]>>>24-r%4*8&255;n.push(String.fromCharCode(s))}return n.join("")},parse:function(e){for(var t=e.length,i=[],n=0;n<t;n++)i[n>>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new l.init(i,t)}},u=o.Utf8={stringify:function(e){try{return decodeURIComponent(escape(c.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return c.parse(unescape(encodeURIComponent(e)))}},p=r.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new l.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=u.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(e){var t,i=this._data,n=i.words,r=i.sigBytes,s=this.blockSize,o=r/(4*s),a=(o=e?h.ceil(o):h.max((0|o)-this._minBufferSize,0))*s,r=h.min(4*a,r);if(a){for(var c=0;c<a;c+=s)this._doProcessBlock(n,c);t=n.splice(0,a),i.sigBytes-=r}return new l.init(t,r)},clone:function(){var e=s.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0}),d=(r.Hasher=p.extend({cfg:s.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){p.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(i){return function(e,t){return new i.init(t).finalize(e)}},_createHmacHelper:function(i){return function(e,t){return new d.HMAC.init(i,t).finalize(e)}}}),e.algo={});return e}(Math),e)}.call(this,g(16))},function(e,t,i){"use strict";var n,r=i(19),s=Object.prototype.toString,o=(n=Object.create(null),function(e){e=s.call(e);return n[e]||(n[e]=e.slice(8,-1).toLowerCase())});function a(t){return t=t.toLowerCase(),function(e){return o(e)===t}}function c(e){return Array.isArray(e)}function h(e){return void 0===e}var l=a("ArrayBuffer");function u(e){return null!==e&&"object"==typeof e}function p(e){if("object"!==o(e))return!1;e=Object.getPrototypeOf(e);return null===e||e===Object.prototype}var d=a("Date"),f=a("File"),g=a("Blob"),m=a("FileList");function v(e){return"[object Function]"===s.call(e)}var y=a("URLSearchParams");function b(e,t){if(null!=e)if(c(e="object"!=typeof e?[e]:e))for(var i=0,n=e.length;i<n;i++)t.call(null,e[i],i,e);else for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.call(null,e[r],r,e)}var w,i=(w="undefined"!=typeof Uint8Array&&Object.getPrototypeOf(Uint8Array),function(e){return w&&e instanceof w});e.exports={isArray:c,isArrayBuffer:l,isBuffer:function(e){return null!==e&&!h(e)&&null!==e.constructor&&!h(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){var t="[object FormData]";return e&&("function"==typeof FormData&&e instanceof FormData||s.call(e)===t||v(e.toString)&&e.toString()===t)},isArrayBufferView:function(e){return e="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&l(e.buffer)},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:u,isPlainObject:p,isUndefined:h,isDate:d,isFile:f,isBlob:g,isFunction:v,isStream:function(e){return u(e)&&v(e.pipe)},isURLSearchParams:y,isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:b,merge:function i(){var n={};function e(e,t){p(n[t])&&p(e)?n[t]=i(n[t],e):p(e)?n[t]=i({},e):c(e)?n[t]=e.slice():n[t]=e}for(var t=0,r=arguments.length;t<r;t++)b(arguments[t],e);return n},extend:function(i,e,n){return b(e,function(e,t){i[t]=n&&"function"==typeof e?r(e,n):e}),i},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},stripBOM:function(e){return e=65279===e.charCodeAt(0)?e.slice(1):e},inherits:function(e,t,i,n){e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,i&&Object.assign(e.prototype,i)},toFlatObject:function(e,t,i){var n,r,s,o={};t=t||{};do{for(r=(n=Object.getOwnPropertyNames(e)).length;0<r--;)o[s=n[r]]||(t[s]=e[s],o[s]=!0)}while((e=Object.getPrototypeOf(e))&&(!i||i(e,t))&&e!==Object.prototype);return t},kindOf:o,kindOfTest:a,endsWith:function(e,t,i){return e=String(e),(void 0===i||i>e.length)&&(i=e.length),i-=t.length,-1!==(t=e.indexOf(t,i))&&t===i},toArray:function(e){if(!e)return null;var t=e.length;if(h(t))return null;for(var i=new Array(t);0<t--;)i[t]=e[t];return i},isTypedArray:i,isFileList:m}},function(e,t,i){var g;e.exports=(g=i(2),i(7),void(g.lib.Cipher||function(){var e=g,t=e.lib,i=t.Base,o=t.WordArray,n=t.BufferedBlockAlgorithm,r=e.enc,s=(r.Utf8,r.Base64),a=e.algo.EvpKDF,c=t.Cipher=n.extend({cfg:i.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,i){this.cfg=this.cfg.extend(i),this._xformMode=e,this._key=t,this.reset()},reset:function(){n.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(n){return{encrypt:function(e,t,i){return h(t).encrypt(n,e,t,i)},decrypt:function(e,t,i){return h(t).decrypt(n,e,t,i)}}}});function h(e){return"string"==typeof e?f:d}t.StreamCipher=c.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var l=e.mode={},r=t.BlockCipherMode=i.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),r=l.CBC=((l=r.extend()).Encryptor=l.extend({processBlock:function(e,t){var i=this._cipher,n=i.blockSize;u.call(this,e,t,n),i.encryptBlock(e,t),this._prevBlock=e.slice(t,t+n)}}),l.Decryptor=l.extend({processBlock:function(e,t){var i=this._cipher,n=i.blockSize,r=e.slice(t,t+n);i.decryptBlock(e,t),u.call(this,e,t,n),this._prevBlock=r}}),l);function u(e,t,i){var n,r=this._iv;r?(n=r,this._iv=void 0):n=this._prevBlock;for(var s=0;s<i;s++)e[t+s]^=n[s]}var l=(e.pad={}).Pkcs7={pad:function(e,t){for(var t=4*t,i=t-e.sigBytes%t,n=i<<24|i<<16|i<<8|i,r=[],s=0;s<i;s+=4)r.push(n);t=o.create(r,i);e.concat(t)},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},p=(t.BlockCipher=c.extend({cfg:c.cfg.extend({mode:r,padding:l}),reset:function(){var e;c.reset.call(this);var t=this.cfg,i=t.iv,t=t.mode;this._xformMode==this._ENC_XFORM_MODE?e=t.createEncryptor:(e=t.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==e?this._mode.init(this,i&&i.words):(this._mode=e.call(t,this,i&&i.words),this._mode.__creator=e)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e,t=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(t.pad(this._data,this.blockSize),e=this._process(!0)):(e=this._process(!0),t.unpad(e)),e},blockSize:4}),t.CipherParams=i.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}})),l=(e.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,e=e.salt,t=e?o.create([1398893684,1701076831]).concat(e).concat(t):t;return t.toString(s)},parse:function(e){var t,i=s.parse(e),e=i.words;return 1398893684==e[0]&&1701076831==e[1]&&(t=o.create(e.slice(2,4)),e.splice(0,4),i.sigBytes-=16),p.create({ciphertext:i,salt:t})}},d=t.SerializableCipher=i.extend({cfg:i.extend({format:l}),encrypt:function(e,t,i,n){n=this.cfg.extend(n);var r=e.createEncryptor(i,n),t=r.finalize(t),r=r.cfg;return p.create({ciphertext:t,key:i,iv:r.iv,algorithm:e,mode:r.mode,padding:r.padding,blockSize:e.blockSize,formatter:n.format})},decrypt:function(e,t,i,n){return n=this.cfg.extend(n),t=this._parse(t,n.format),e.createDecryptor(i,n).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),e=(e.kdf={}).OpenSSL={execute:function(e,t,i,n){n=n||o.random(8);e=a.create({keySize:t+i}).compute(e,n),i=o.create(e.words.slice(t),4*i);return e.sigBytes=4*t,p.create({key:e,iv:i,salt:n})}},f=t.PasswordBasedCipher=d.extend({cfg:d.cfg.extend({kdf:e}),encrypt:function(e,t,i,n){i=(n=this.cfg.extend(n)).kdf.execute(i,e.keySize,e.ivSize);n.iv=i.iv;n=d.encrypt.call(this,e,t,i.key,n);return n.mixIn(i),n},decrypt:function(e,t,i,n){n=this.cfg.extend(n),t=this._parse(t,n.format);i=n.kdf.execute(i,e.keySize,e.ivSize,t.salt);return n.iv=i.iv,d.decrypt.call(this,e,t,i.key,n)}})}()))},function(e,t){e.exports=i},function(e,t,i){e.exports=(e=i(2),i(13),i(60),i(61),i(9),i(62),i(10),i(17),i(29),i(63),i(30),i(64),i(65),i(66),i(18),i(67),i(7),i(4),i(68),i(69),i(70),i(71),i(72),i(73),i(74),i(75),i(76),i(77),i(78),i(79),i(80),i(81),i(82),i(83),e)},function(e,t,i){var s;e.exports=(s=i(2),i(17),i(18),function(){var e=s,t=e.lib,i=t.Base,l=t.WordArray,n=e.algo,t=n.MD5,r=n.EvpKDF=i.extend({cfg:i.extend({keySize:4,hasher:t,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var i,n=this.cfg,r=n.hasher.create(),s=l.create(),o=s.words,a=n.keySize,c=n.iterations;o.length<a;){i&&r.update(i),i=r.update(e).finalize(t),r.reset();for(var h=1;h<c;h++)i=r.finalize(i),r.reset();s.concat(i)}return s.sigBytes=4*a,s}});e.EvpKDF=function(e,t,i){return r.create(i).compute(e,t)}}(),s.EvpKDF)},function(e,t,i){"use strict";var a=i(3);function c(e,t,i,n,r){Error.call(this),this.message=e,this.name="AxiosError",t&&(this.code=t),i&&(this.config=i),n&&(this.request=n),r&&(this.response=r)}a.inherits(c,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var h=c.prototype,n={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED"].forEach(function(e){n[e]={value:e}}),Object.defineProperties(c,n),Object.defineProperty(h,"isAxiosError",{value:!0}),c.from=function(e,t,i,n,r,s){var o=Object.create(h);return a.toFlatObject(e,o,function(e){return e!==Error.prototype}),c.call(o,e.message,t,i,n,r),o.name=e.name,s&&Object.assign(o,s),o},e.exports=c},function(e,t,i){var n;e.exports=(n=i(2),function(){var c=n.lib.WordArray;n.enc.Base64={stringify:function(e){var t=e.words,i=e.sigBytes,n=this._map;e.clamp();for(var r=[],s=0;s<i;s+=3)for(var o=(t[s>>>2]>>>24-s%4*8&255)<<16|(t[s+1>>>2]>>>24-(s+1)%4*8&255)<<8|t[s+2>>>2]>>>24-(s+2)%4*8&255,a=0;a<4&&s+.75*a<i;a++)r.push(n.charAt(o>>>6*(3-a)&63));var c=n.charAt(64);if(c)for(;r.length%4;)r.push(c);return r.join("")},parse:function(e){var t=e.length,i=this._map;if(!(n=this._reverseMap))for(var n=this._reverseMap=[],r=0;r<i.length;r++)n[i.charCodeAt(r)]=r;var s=i.charAt(64);return!s||-1!==(s=e.indexOf(s))&&(t=s),function(e,t,i){for(var n=[],r=0,s=0;s<t;s++){var o,a;s%4&&(o=i[e.charCodeAt(s-1)]<<s%4*2,a=i[e.charCodeAt(s)]>>>6-s%4*2,a=o|a,n[r>>>2]|=a<<24-r%4*8,r++)}return c.create(n,r)}(e,t,n)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),n.enc.Base64)},function(e,t,i){var r;e.exports=(r=i(2),function(c){var e=r,t=e.lib,i=t.WordArray,n=t.Hasher,t=e.algo,E=[];!function(){for(var e=0;e<64;e++)E[e]=4294967296*c.abs(c.sin(e+1))|0}();t=t.MD5=n.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var i=0;i<16;i++){var n=t+i,r=e[n];e[n]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8)}var s=this._hash.words,o=e[t+0],a=e[t+1],c=e[t+2],h=e[t+3],l=e[t+4],u=e[t+5],p=e[t+6],d=e[t+7],f=e[t+8],g=e[t+9],m=e[t+10],v=e[t+11],y=e[t+12],b=e[t+13],w=e[t+14],_=e[t+15],A=S(A=s[0],x=s[1],C=s[2],B=s[3],o,7,E[0]),B=S(B,A,x,C,a,12,E[1]),C=S(C,B,A,x,c,17,E[2]),x=S(x,C,B,A,h,22,E[3]);A=S(A,x,C,B,l,7,E[4]),B=S(B,A,x,C,u,12,E[5]),C=S(C,B,A,x,p,17,E[6]),x=S(x,C,B,A,d,22,E[7]),A=S(A,x,C,B,f,7,E[8]),B=S(B,A,x,C,g,12,E[9]),C=S(C,B,A,x,m,17,E[10]),x=S(x,C,B,A,v,22,E[11]),A=S(A,x,C,B,y,7,E[12]),B=S(B,A,x,C,b,12,E[13]),C=S(C,B,A,x,w,17,E[14]),A=T(A,x=S(x,C,B,A,_,22,E[15]),C,B,a,5,E[16]),B=T(B,A,x,C,p,9,E[17]),C=T(C,B,A,x,v,14,E[18]),x=T(x,C,B,A,o,20,E[19]),A=T(A,x,C,B,u,5,E[20]),B=T(B,A,x,C,m,9,E[21]),C=T(C,B,A,x,_,14,E[22]),x=T(x,C,B,A,l,20,E[23]),A=T(A,x,C,B,g,5,E[24]),B=T(B,A,x,C,w,9,E[25]),C=T(C,B,A,x,h,14,E[26]),x=T(x,C,B,A,f,20,E[27]),A=T(A,x,C,B,b,5,E[28]),B=T(B,A,x,C,c,9,E[29]),C=T(C,B,A,x,d,14,E[30]),A=M(A,x=T(x,C,B,A,y,20,E[31]),C,B,u,4,E[32]),B=M(B,A,x,C,f,11,E[33]),C=M(C,B,A,x,v,16,E[34]),x=M(x,C,B,A,w,23,E[35]),A=M(A,x,C,B,a,4,E[36]),B=M(B,A,x,C,l,11,E[37]),C=M(C,B,A,x,d,16,E[38]),x=M(x,C,B,A,m,23,E[39]),A=M(A,x,C,B,b,4,E[40]),B=M(B,A,x,C,o,11,E[41]),C=M(C,B,A,x,h,16,E[42]),x=M(x,C,B,A,p,23,E[43]),A=M(A,x,C,B,g,4,E[44]),B=M(B,A,x,C,y,11,E[45]),C=M(C,B,A,x,_,16,E[46]),A=k(A,x=M(x,C,B,A,c,23,E[47]),C,B,o,6,E[48]),B=k(B,A,x,C,d,10,E[49]),C=k(C,B,A,x,w,15,E[50]),x=k(x,C,B,A,u,21,E[51]),A=k(A,x,C,B,y,6,E[52]),B=k(B,A,x,C,h,10,E[53]),C=k(C,B,A,x,m,15,E[54]),x=k(x,C,B,A,a,21,E[55]),A=k(A,x,C,B,f,6,E[56]),B=k(B,A,x,C,_,10,E[57]),C=k(C,B,A,x,p,15,E[58]),x=k(x,C,B,A,b,21,E[59]),A=k(A,x,C,B,l,6,E[60]),B=k(B,A,x,C,v,10,E[61]),C=k(C,B,A,x,c,15,E[62]),x=k(x,C,B,A,g,21,E[63]),s[0]=s[0]+A|0,s[1]=s[1]+x|0,s[2]=s[2]+C|0,s[3]=s[3]+B|0},_doFinalize:function(){var e=this._data,t=e.words,i=8*this._nDataBytes,n=8*e.sigBytes;t[n>>>5]|=128<<24-n%32;var r=c.floor(i/4294967296),i=i;t[15+(64+n>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),t[14+(64+n>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),e.sigBytes=4*(t.length+1),this._process();for(var t=this._hash,s=t.words,o=0;o<4;o++){var a=s[o];s[o]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8)}return t},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e}});function S(e,t,i,n,r,s,o){o=e+(t&i|~t&n)+r+o;return(o<<s|o>>>32-s)+t}function T(e,t,i,n,r,s,o){o=e+(t&n|i&~n)+r+o;return(o<<s|o>>>32-s)+t}function M(e,t,i,n,r,s,o){o=e+(t^i^n)+r+o;return(o<<s|o>>>32-s)+t}function k(e,t,i,n,r,s,o){o=e+(i^(t|~n))+r+o;return(o<<s|o>>>32-s)+t}e.MD5=n._createHelper(t),e.HmacMD5=n._createHmacHelper(t)}(Math),r.MD5)},function(e,t,i){"use strict";i.d(t,"a",function(){return n});class n{constructor(){}log(e,t){}}n.instance=new n},function(e,t,i){"use strict";var n=i(8);function r(e){n.call(this,null==e?"canceled":e,n.ERR_CANCELED),this.name="CanceledError"}i(3).inherits(r,n,{__CANCEL__:!0}),e.exports=r},function(e,t,i){var n;e.exports=(n=i(2),function(){var e=n,t=e.lib,r=t.Base,s=t.WordArray,e=e.x64={};e.Word=r.extend({init:function(e,t){this.high=e,this.low=t}}),e.WordArray=r.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:8*e.length},toX32:function(){for(var e=this.words,t=e.length,i=[],n=0;n<t;n++){var r=e[n];i.push(r.high),i.push(r.low)}return s.create(i,this.sigBytes)},clone:function(){for(var e=r.clone.call(this),t=e.words=this.words.slice(0),i=t.length,n=0;n<i;n++)t[n]=t[n].clone();return e}})}(),n)},function(e,t){e.exports=n},function(l,e,u){"use strict";!function(e){var o=u(3),a=u(42),n=u(8),t=u(22),c=u(23),i={"Content-Type":"application/x-www-form-urlencoded"};function h(e,t){!o.isUndefined(e)&&o.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var r,s={transitional:t,adapter:r="undefined"!=typeof XMLHttpRequest||void 0!==e&&"[object process]"===Object.prototype.toString.call(e)?u(24):r,transformRequest:[function(e,t){if(a(t,"Accept"),a(t,"Content-Type"),o.isFormData(e)||o.isArrayBuffer(e)||o.isBuffer(e)||o.isStream(e)||o.isFile(e)||o.isBlob(e))return e;if(o.isArrayBufferView(e))return e.buffer;if(o.isURLSearchParams(e))return h(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString();var i,n=o.isObject(e),r=t&&t["Content-Type"];if((i=o.isFileList(e))||n&&"multipart/form-data"===r){var s=this.env&&this.env.FormData;return c(i?{"files[]":e}:e,s&&new s)}return n||"application/json"===r?(h(t,"application/json"),function(e,t,i){if(o.isString(e))try{return(t||JSON.parse)(e),o.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(i||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||s.transitional,i=t&&t.silentJSONParsing,t=t&&t.forcedJSONParsing,i=!i&&"json"===this.responseType;if(i||t&&o.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(i){if("SyntaxError"===e.name)throw n.from(e,n.ERR_BAD_RESPONSE,this,null,this.response);throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:u(54)},validateStatus:function(e){return 200<=e&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};o.forEach(["delete","get","head"],function(e){s.headers[e]={}}),o.forEach(["post","put","patch"],function(e){s.headers[e]=o.merge(i)}),l.exports=s}.call(this,u(21))},function(e,t){var i=function(){return this}();try{i=i||new Function("return this")()}catch(e){"object"==typeof window&&(i=window)}e.exports=i},function(e,t,i){var r;e.exports=(r=i(2),function(){var e=r,t=e.lib,i=t.WordArray,n=t.Hasher,t=e.algo,l=[],t=t.SHA1=n.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var i=this._hash.words,n=i[0],r=i[1],s=i[2],o=i[3],a=i[4],c=0;c<80;c++){c<16?l[c]=0|e[t+c]:(h=l[c-3]^l[c-8]^l[c-14]^l[c-16],l[c]=h<<1|h>>>31);var h=(n<<5|n>>>27)+a+l[c];h+=c<20?1518500249+(r&s|~r&o):c<40?1859775393+(r^s^o):c<60?(r&s|r&o|s&o)-1894007588:(r^s^o)-899497514,a=o,o=s,s=r<<30|r>>>2,r=n,n=h}i[0]=i[0]+n|0,i[1]=i[1]+r|0,i[2]=i[2]+s|0,i[3]=i[3]+o|0,i[4]=i[4]+a|0},_doFinalize:function(){var e=this._data,t=e.words,i=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[14+(64+n>>>9<<4)]=Math.floor(i/4294967296),t[15+(64+n>>>9<<4)]=i,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e}});e.SHA1=n._createHelper(t),e.HmacSHA1=n._createHmacHelper(t)}(),r.SHA1)},function(e,t,i){var n;e.exports=(n=i(2),void function(){var e=n.lib.Base,a=n.enc.Utf8;n.algo.HMAC=e.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=a.parse(t));var i=e.blockSize,n=4*i;(t=t.sigBytes>n?e.finalize(t):t).clamp();for(var e=this._oKey=t.clone(),t=this._iKey=t.clone(),r=e.words,s=t.words,o=0;o<i;o++)r[o]^=1549556828,s[o]^=909522486;e.sigBytes=t.sigBytes=n,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher,e=t.finalize(e);return t.reset(),t.finalize(this._oKey.clone().concat(e))}})}())},function(e,t,i){"use strict";e.exports=function(i,n){return function(){for(var e=new Array(arguments.length),t=0;t<e.length;t++)e[t]=arguments[t];return i.apply(n,e)}}},function(e,t,i){"use strict";var r=i(3);function s(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,i){if(!t)return e;var n,i=i?i(t):r.isURLSearchParams(t)?t.toString():(n=[],r.forEach(t,function(e,t){null!=e&&(r.isArray(e)?t+="[]":e=[e],r.forEach(e,function(e){r.isDate(e)?e=e.toISOString():r.isObject(e)&&(e=JSON.stringify(e)),n.push(s(t)+"="+s(e))}))}),n.join("&"));return i&&(-1!==(t=e.indexOf("#"))&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i),e}},function(e,t){var i,n,e=e.exports={};function r(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function o(t){if(i===setTimeout)return setTimeout(t,0);if((i===r||!i)&&setTimeout)return i=setTimeout,setTimeout(t,0);try{return i(t,0)}catch(e){try{return i.call(null,t,0)}catch(e){return i.call(this,t,0)}}}!function(){try{i="function"==typeof setTimeout?setTimeout:r}catch(e){i=r}try{n="function"==typeof clearTimeout?clearTimeout:s}catch(e){n=s}}();var a,c=[],h=!1,l=-1;function u(){h&&a&&(h=!1,a.length?c=a.concat(c):l=-1,c.length&&p())}function p(){if(!h){var e=o(u);h=!0;for(var t=c.length;t;){for(a=c,c=[];++l<t;)a&&a[l].run();l=-1,t=c.length}a=null,h=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===s||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(e)}}function d(e,t){this.fun=e,this.array=t}function f(){}e.nextTick=function(e){var t=new Array(arguments.length-1);if(1<arguments.length)for(var i=1;i<arguments.length;i++)t[i-1]=arguments[i];c.push(new d(e,t)),1!==c.length||h||o(p)},d.prototype.run=function(){this.fun.apply(null,this.array)},e.title="browser",e.browser=!0,e.env={},e.argv=[],e.version="",e.versions={},e.on=f,e.addListener=f,e.once=f,e.off=f,e.removeListener=f,e.removeAllListeners=f,e.emit=f,e.prependListener=f,e.prependOnceListener=f,e.listeners=function(e){return[]},e.binding=function(e){throw new Error("process.binding is not supported")},e.cwd=function(){return"/"},e.chdir=function(e){throw new Error("process.chdir is not supported")},e.umask=function(){return 0}},function(e,t,i){"use strict";e.exports={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1}},function(e,t,n){"use strict";!function(i){var c=n(3);e.exports=function(e,o){o=o||new FormData;var t=[];function a(e){return null===e?"":c.isDate(e)?e.toISOString():c.isArrayBuffer(e)||c.isTypedArray(e)?"function"==typeof Blob?new Blob([e]):i.from(e):e}return function r(e,s){if(c.isPlainObject(e)||c.isArray(e)){if(-1!==t.indexOf(e))throw Error("Circular reference detected in "+s);t.push(e),c.forEach(e,function(e,t){if(!c.isUndefined(e)){var i,n=s?s+"."+t:t;if(e&&!s&&"object"==typeof e)if(c.endsWith(t,"{}"))e=JSON.stringify(e);else if(c.endsWith(t,"[]")&&(i=c.toArray(e)))return void i.forEach(function(e){c.isUndefined(e)||o.append(n,a(e))});r(e,n)}}),t.pop()}else o.append(s,a(e))}(e),o}}.call(this,n(43).Buffer)},function(e,t,i){"use strict";var p=i(3),d=i(47),f=i(48),g=i(20),m=i(25),v=i(51),y=i(52),b=i(22),w=i(8),_=i(12),A=i(53);e.exports=function(u){return new Promise(function(t,i){var e,n=u.data,r=u.headers,s=u.responseType;function o(){u.cancelToken&&u.cancelToken.unsubscribe(e),u.signal&&u.signal.removeEventListener("abort",e)}p.isFormData(n)&&p.isStandardBrowserEnv()&&delete r["Content-Type"];var a=new XMLHttpRequest;u.auth&&(h=u.auth.username||"",c=u.auth.password?unescape(encodeURIComponent(u.auth.password)):"",r.Authorization="Basic "+btoa(h+":"+c));var c,h=m(u.baseURL,u.url);function l(){var e;a&&(e="getAllResponseHeaders"in a?v(a.getAllResponseHeaders()):null,e={data:s&&"text"!==s&&"json"!==s?a.response:a.responseText,status:a.status,statusText:a.statusText,headers:e,config:u,request:a},d(function(e){t(e),o()},function(e){i(e),o()},e),a=null)}a.open(u.method.toUpperCase(),g(h,u.params,u.paramsSerializer),!0),a.timeout=u.timeout,"onloadend"in a?a.onloadend=l:a.onreadystatechange=function(){a&&4===a.readyState&&(0!==a.status||a.responseURL&&0===a.responseURL.indexOf("file:"))&&setTimeout(l)},a.onabort=function(){a&&(i(new w("Request aborted",w.ECONNABORTED,u,a)),a=null)},a.onerror=function(){i(new w("Network Error",w.ERR_NETWORK,u,a,a)),a=null},a.ontimeout=function(){var e=u.timeout?"timeout of "+u.timeout+"ms exceeded":"timeout exceeded",t=u.transitional||b;u.timeoutErrorMessage&&(e=u.timeoutErrorMessage),i(new w(e,t.clarifyTimeoutError?w.ETIMEDOUT:w.ECONNABORTED,u,a)),a=null},!p.isStandardBrowserEnv()||(c=(u.withCredentials||y(h))&&u.xsrfCookieName?f.read(u.xsrfCookieName):void 0)&&(r[u.xsrfHeaderName]=c),"setRequestHeader"in a&&p.forEach(r,function(e,t){void 0===n&&"content-type"===t.toLowerCase()?delete r[t]:a.setRequestHeader(t,e)}),p.isUndefined(u.withCredentials)||(a.withCredentials=!!u.withCredentials),s&&"json"!==s&&(a.responseType=u.responseType),"function"==typeof u.onDownloadProgress&&a.addEventListener("progress",u.onDownloadProgress),"function"==typeof u.onUploadProgress&&a.upload&&a.upload.addEventListener("progress",u.onUploadProgress),(u.cancelToken||u.signal)&&(e=function(e){a&&(i(!e||e.type?new _:e),a.abort(),a=null)},u.cancelToken&&u.cancelToken.subscribe(e),u.signal&&(u.signal.aborted?e():u.signal.addEventListener("abort",e)));n=n||null,h=A(h);h&&-1===["http","https","file"].indexOf(h)?i(new w("Unsupported protocol "+h+":",w.ERR_BAD_REQUEST,u)):a.send(n)})}},function(e,t,i){"use strict";var n=i(49),r=i(50);e.exports=function(e,t){return e&&!n(t)?r(e,t):t}},function(e,t,i){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},function(e,t,i){"use strict";var h=i(3);e.exports=function(t,i){i=i||{};var n={};function r(e,t){return h.isPlainObject(e)&&h.isPlainObject(t)?h.merge(e,t):h.isPlainObject(t)?h.merge({},t):h.isArray(t)?t.slice():t}function s(e){return h.isUndefined(i[e])?h.isUndefined(t[e])?void 0:r(void 0,t[e]):r(t[e],i[e])}function e(e){if(!h.isUndefined(i[e]))return r(void 0,i[e])}function o(e){return h.isUndefined(i[e])?h.isUndefined(t[e])?void 0:r(void 0,t[e]):r(void 0,i[e])}function a(e){return e in i?r(t[e],i[e]):e in t?r(void 0,t[e]):void 0}var c={url:e,method:e,data:e,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a};return h.forEach(Object.keys(t).concat(Object.keys(i)),function(e){var t=c[e]||s,i=t(e);h.isUndefined(i)&&t!==a||(n[e]=i)}),n}},function(e,t){e.exports={version:"0.27.2"}},function(e,t,i){var o;e.exports=(o=i(2),function(r){var e=o,t=e.lib,i=t.WordArray,n=t.Hasher,t=e.algo,s=[],f=[];!function(){function e(e){return 4294967296*(e-(0|e))|0}for(var t=2,i=0;i<64;)!function(e){for(var t=r.sqrt(e),i=2;i<=t;i++)if(!(e%i))return;return 1}(t)||(i<8&&(s[i]=e(r.pow(t,.5))),f[i]=e(r.pow(t,1/3)),i++),t++}();var g=[],t=t.SHA256=n.extend({_doReset:function(){this._hash=new i.init(s.slice(0))},_doProcessBlock:function(e,t){for(var i=this._hash.words,n=i[0],r=i[1],s=i[2],o=i[3],a=i[4],c=i[5],h=i[6],l=i[7],u=0;u<64;u++){u<16?g[u]=0|e[t+u]:(p=g[u-15],d=g[u-2],g[u]=((p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3)+g[u-7]+((d<<15|d>>>17)^(d<<13|d>>>19)^d>>>10)+g[u-16]);var p=n&r^n&s^r&s,d=l+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&c^~a&h)+f[u]+g[u],l=h,h=c,c=a,a=o+d|0,o=s,s=r,r=n,n=d+(((n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22))+p)|0}i[0]=i[0]+n|0,i[1]=i[1]+r|0,i[2]=i[2]+s|0,i[3]=i[3]+o|0,i[4]=i[4]+a|0,i[5]=i[5]+c|0,i[6]=i[6]+h|0,i[7]=i[7]+l|0},_doFinalize:function(){var e=this._data,t=e.words,i=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[14+(64+n>>>9<<4)]=r.floor(i/4294967296),t[15+(64+n>>>9<<4)]=i,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e}});e.SHA256=n._createHelper(t),e.HmacSHA256=n._createHmacHelper(t)}(Math),o.SHA256)},function(e,t,i){var o;e.exports=(o=i(2),i(13),function(){var e=o,t=e.lib.Hasher,i=e.x64,n=i.Word,r=i.WordArray,i=e.algo;function s(){return n.create.apply(n,arguments)}var ee=[s(1116352408,3609767458),s(1899447441,602891725),s(3049323471,3964484399),s(3921009573,2173295548),s(961987163,4081628472),s(1508970993,3053834265),s(2453635748,2937671579),s(2870763221,3664609560),s(3624381080,2734883394),s(310598401,1164996542),s(607225278,1323610764),s(1426881987,3590304994),s(1925078388,4068182383),s(2162078206,991336113),s(2614888103,633803317),s(3248222580,3479774868),s(3835390401,2666613458),s(4022224774,944711139),s(264347078,2341262773),s(604807628,2007800933),s(770255983,1495990901),s(1249150122,1856431235),s(1555081692,3175218132),s(1996064986,2198950837),s(2554220882,3999719339),s(2821834349,766784016),s(2952996808,2566594879),s(3210313671,3203337956),s(3336571891,1034457026),s(3584528711,2466948901),s(113926993,3758326383),s(338241895,168717936),s(666307205,1188179964),s(773529912,1546045734),s(1294757372,1522805485),s(1396182291,2643833823),s(1695183700,2343527390),s(1986661051,1014477480),s(2177026350,1206759142),s(2456956037,344077627),s(2730485921,1290863460),s(2820302411,3158454273),s(3259730800,3505952657),s(3345764771,106217008),s(3516065817,3606008344),s(3600352804,1432725776),s(4094571909,1467031594),s(275423344,851169720),s(430227734,3100823752),s(506948616,1363258195),s(659060556,3750685593),s(883997877,3785050280),s(958139571,3318307427),s(1322822218,3812723403),s(1537002063,2003034995),s(1747873779,3602036899),s(1955562222,1575990012),s(2024104815,1125592928),s(2227730452,2716904306),s(2361852424,442776044),s(2428436474,593698344),s(2756734187,3733110249),s(3204031479,2999351573),s(3329325298,3815920427),s(3391569614,3928383900),s(3515267271,566280711),s(3940187606,3454069534),s(4118630271,4000239992),s(116418474,1914138554),s(174292421,2731055270),s(289380356,3203993006),s(460393269,320620315),s(685471733,587496836),s(852142971,1086792851),s(1017036298,365543100),s(1126000580,2618297676),s(1288033470,3409855158),s(1501505948,4234509866),s(1607167915,987167468),s(1816402316,1246189591)],te=[];!function(){for(var e=0;e<80;e++)te[e]=s()}();i=i.SHA512=t.extend({_doReset:function(){this._hash=new r.init([new n.init(1779033703,4089235720),new n.init(3144134277,2227873595),new n.init(1013904242,4271175723),new n.init(2773480762,1595750129),new n.init(1359893119,2917565137),new n.init(2600822924,725511199),new n.init(528734635,4215389547),new n.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var i=this._hash.words,n=i[0],r=i[1],s=i[2],o=i[3],a=i[4],c=i[5],h=i[6],l=i[7],u=n.high,p=n.low,d=r.high,f=r.low,g=s.high,m=s.low,v=o.high,y=o.low,b=a.high,w=a.low,_=c.high,A=c.low,B=h.high,C=h.low,x=l.high,i=l.low,E=u,S=p,T=d,M=f,k=g,O=m,R=v,L=y,P=b,N=w,I=_,D=A,Y=B,j=C,z=x,U=i,F=0;F<80;F++){var H,V,G=te[F];F<16?(V=G.high=0|e[t+2*F],H=G.low=0|e[t+2*F+1]):(Q=(W=te[F-15]).high,K=W.low,X=(J=te[F-2]).high,q=J.low,$=(Z=te[F-7]).high,W=Z.low,Z=(J=te[F-16]).high,V=(V=((Q>>>1|K<<31)^(Q>>>8|K<<24)^Q>>>7)+$+((H=($=(K>>>1|Q<<31)^(K>>>8|Q<<24)^(K>>>7|Q<<25))+W)>>>0<$>>>0?1:0))+((X>>>19|q<<13)^(X<<3|q>>>29)^X>>>6)+((H+=K=(q>>>19|X<<13)^(q<<3|X>>>29)^(q>>>6|X<<26))>>>0<K>>>0?1:0),H+=Q=J.low,G.high=V=V+Z+(H>>>0<Q>>>0?1:0),G.low=H);var W=P&I^~P&Y,$=N&D^~N&j,q=E&T^E&k^T&k,X=(S>>>28|E<<4)^(S<<30|E>>>2)^(S<<25|E>>>7),K=ee[F],J=K.high,Z=K.low,Q=U+((N>>>14|P<<18)^(N>>>18|P<<14)^(N<<23|P>>>9)),G=z+((P>>>14|N<<18)^(P>>>18|N<<14)^(P<<23|N>>>9))+(Q>>>0<U>>>0?1:0),K=X+(S&M^S&O^M&O),z=Y,U=j,Y=I,j=D,I=P,D=N,P=R+(G=(G=(G=G+W+((Q=Q+$)>>>0<$>>>0?1:0))+J+((Q=Q+Z)>>>0<Z>>>0?1:0))+V+((Q=Q+H)>>>0<H>>>0?1:0))+((N=L+Q|0)>>>0<L>>>0?1:0)|0,R=k,L=O,k=T,O=M,T=E,M=S,E=G+(((E>>>28|S<<4)^(E<<30|S>>>2)^(E<<25|S>>>7))+q+(K>>>0<X>>>0?1:0))+((S=Q+K|0)>>>0<Q>>>0?1:0)|0}p=n.low=p+S,n.high=u+E+(p>>>0<S>>>0?1:0),f=r.low=f+M,r.high=d+T+(f>>>0<M>>>0?1:0),m=s.low=m+O,s.high=g+k+(m>>>0<O>>>0?1:0),y=o.low=y+L,o.high=v+R+(y>>>0<L>>>0?1:0),w=a.low=w+N,a.high=b+P+(w>>>0<N>>>0?1:0),A=c.low=A+D,c.high=_+I+(A>>>0<D>>>0?1:0),C=h.low=C+j,h.high=B+Y+(C>>>0<j>>>0?1:0),i=l.low=i+U,l.high=x+z+(i>>>0<U>>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,i=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[30+(128+n>>>10<<5)]=Math.floor(i/4294967296),t[31+(128+n>>>10<<5)]=i,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=t.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});e.SHA512=t._createHelper(i),e.HmacSHA512=t._createHmacHelper(i)}(),o.SHA512)},function(e,t,i){e.exports=i(37)},function(e,t){e.exports=r},function(e,t){e.exports=s},function(e,t){e.exports=o},function(e,t){e.exports=a},function(e,t){e.exports=c},function(e,t,i){"use strict";var r=i(3),s=i(19),o=i(38),a=i(27);var n=function t(i){var e=new o(i),n=s(o.prototype.request,e);return r.extend(n,o.prototype,e),r.extend(n,e),n.create=function(e){return t(a(i,e))},n}(i(15));n.Axios=o,n.CanceledError=i(12),n.CancelToken=i(56),n.isCancel=i(26),n.VERSION=i(28).version,n.toFormData=i(23),n.AxiosError=i(8),n.Cancel=n.CanceledError,n.all=function(e){return Promise.all(e)},n.spread=i(57),n.isAxiosError=i(58),e.exports=n,e.exports.default=n},function(e,t,i){"use strict";var n=i(3),r=i(20),s=i(39),l=i(40),u=i(27),o=i(25),p=i(55),d=p.validators;function a(e){this.defaults=e,this.interceptors={request:new s,response:new s}}a.prototype.request=function(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},(t=u(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";e=t.transitional;void 0!==e&&p.assertOptions(e,{silentJSONParsing:d.transitional(d.boolean),forcedJSONParsing:d.transitional(d.boolean),clarifyTimeoutError:d.transitional(d.boolean)},!1);var i=[],n=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(n=n&&e.synchronous,i.unshift(e.fulfilled,e.rejected))});var r,s=[];if(this.interceptors.response.forEach(function(e){s.push(e.fulfilled,e.rejected)}),!n){var o=[l,void 0];for(Array.prototype.unshift.apply(o,i),o=o.concat(s),r=Promise.resolve(t);o.length;)r=r.then(o.shift(),o.shift());return r}for(var a=t;i.length;){var c=i.shift(),h=i.shift();try{a=c(a)}catch(e){h(e);break}}try{r=l(a)}catch(e){return Promise.reject(e)}for(;s.length;)r=r.then(s.shift(),s.shift());return r},a.prototype.getUri=function(e){e=u(this.defaults,e);var t=o(e.baseURL,e.url);return r(t,e.params,e.paramsSerializer)},n.forEach(["delete","get","head","options"],function(i){a.prototype[i]=function(e,t){return this.request(u(t||{},{method:i,url:e,data:(t||{}).data}))}}),n.forEach(["post","put","patch"],function(r){function e(n){return function(e,t,i){return this.request(u(i||{},{method:r,headers:n?{"Content-Type":"multipart/form-data"}:{},url:e,data:t}))}}a.prototype[r]=e(),a.prototype[r+"Form"]=e(!0)}),e.exports=a},function(e,t,i){"use strict";var n=i(3);function r(){this.handlers=[]}r.prototype.use=function(e,t,i){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!i&&i.synchronous,runWhen:i?i.runWhen:null}),this.handlers.length-1},r.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},r.prototype.forEach=function(t){n.forEach(this.handlers,function(e){null!==e&&t(e)})},e.exports=r},function(e,t,i){"use strict";var n=i(3),r=i(41),s=i(26),o=i(15),a=i(12);function c(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new a}e.exports=function(t){return c(t),t.headers=t.headers||{},t.data=r.call(t,t.data,t.headers,t.transformRequest),t.headers=n.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),n.forEach(["delete","get","head","post","put","patch","common"],function(e){delete t.headers[e]}),(t.adapter||o.adapter)(t).then(function(e){return c(t),e.data=r.call(t,e.data,e.headers,t.transformResponse),e},function(e){return s(e)||(c(t),e&&e.response&&(e.response.data=r.call(t,e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)})}},function(e,t,i){"use strict";var r=i(3),s=i(15);e.exports=function(t,i,e){var n=this||s;return r.forEach(e,function(e){t=e.call(n,t,i)}),t}},function(e,t,i){"use strict";var r=i(3);e.exports=function(i,n){r.forEach(i,function(e,t){t!==n&&t.toUpperCase()===n.toUpperCase()&&(i[n]=e,delete i[t])})}},function(e,R,L){"use strict";!function(e){var a=L(44),s=L(45),o=L(46);function i(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function r(e,t){if(i()<t)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=u.prototype:(e=null===e?new u(t):e).length=t,e}function u(e,t,i){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(e,t,i);if("number"!=typeof e)return n(this,e,t,i);if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return h(this,e)}function n(e,t,i,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,i,n){if(t.byteLength,i<0||t.byteLength<i)throw new RangeError("'offset' is out of bounds");if(t.byteLength<i+(n||0))throw new RangeError("'length' is out of bounds");t=void 0===i&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,i):new Uint8Array(t,i,n);u.TYPED_ARRAY_SUPPORT?(e=t).__proto__=u.prototype:e=l(e,t);return e}(e,t,i,n):"string"==typeof t?function(e,t,i){"string"==typeof i&&""!==i||(i="utf8");if(!u.isEncoding(i))throw new TypeError('"encoding" must be a valid string encoding');var n=0|d(t,i),i=(e=r(e,n)).write(t,i);i!==n&&(e=e.slice(0,i));return e}(e,t,i):function(e,t){if(u.isBuffer(t)){var i=0|p(t.length);return 0===(e=r(e,i)).length?e:(t.copy(e,0,0,i),e)}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||function(e){return e!=e}(t.length)?r(e,0):l(e,t);if("Buffer"===t.type&&o(t.data))return l(e,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function h(e,t){if(c(t),e=r(e,t<0?0:0|p(t)),!u.TYPED_ARRAY_SUPPORT)for(var i=0;i<t;++i)e[i]=0;return e}function l(e,t){var i=t.length<0?0:0|p(t.length);e=r(e,i);for(var n=0;n<i;n+=1)e[n]=255&t[n];return e}function p(e){if(e>=i())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|e}function d(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;var i=(e="string"!=typeof e?""+e:e).length;if(0===i)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":case void 0:return M(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return k(e).length;default:if(n)return M(e).length;t=(""+t).toLowerCase(),n=!0}}function t(e,t,i){var n,r,s,o=!1;if((t=void 0===t||t<0?0:t)>this.length)return"";if((i=void 0===i||i>this.length?this.length:i)<=0)return"";if((i>>>=0)<=(t>>>=0))return"";for(e=e||"utf8";;)switch(e){case"hex":return function(e,t,i){var n=e.length;(!t||t<0)&&(t=0);(!i||i<0||n<i)&&(i=n);for(var r="",s=t;s<i;++s)r+=function(e){return e<16?"0"+e.toString(16):e.toString(16)}(e[s]);return r}(this,t,i);case"utf8":case"utf-8":return b(this,t,i);case"ascii":return function(e,t,i){var n="";i=Math.min(e.length,i);for(var r=t;r<i;++r)n+=String.fromCharCode(127&e[r]);return n}(this,t,i);case"latin1":case"binary":return function(e,t,i){var n="";i=Math.min(e.length,i);for(var r=t;r<i;++r)n+=String.fromCharCode(e[r]);return n}(this,t,i);case"base64":return n=this,s=i,0===(r=t)&&s===n.length?a.fromByteArray(n):a.fromByteArray(n.slice(r,s));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(e,t,i){for(var n=e.slice(t,i),r="",s=0;s<n.length;s+=2)r+=String.fromCharCode(n[s]+256*n[s+1]);return r}(this,t,i);default:if(o)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),o=!0}}function f(e,t,i){var n=e[t];e[t]=e[i],e[i]=n}function g(e,t,i,n,r){if(0===e.length)return-1;if("string"==typeof i?(n=i,i=0):2147483647<i?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,(i=(i=isNaN(i)?r?0:e.length-1:i)<0?e.length+i:i)>=e.length){if(r)return-1;i=e.length-1}else if(i<0){if(!r)return-1;i=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:m(e,t,i,n,r);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?(r?Uint8Array.prototype.indexOf:Uint8Array.prototype.lastIndexOf).call(e,t,i):m(e,[t],i,n,r);throw new TypeError("val must be string, number or Buffer")}function m(e,t,i,n,r){var s=1,o=e.length,a=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o/=s=2,a/=2,i/=2}function c(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(r)for(var h=-1,l=i;l<o;l++)if(c(e,l)===c(t,-1===h?0:l-h)){if(l-(h=-1===h?l:h)+1===a)return h*s}else-1!==h&&(l-=l-h),h=-1;else for(l=i=o<i+a?o-a:i;0<=l;l--){for(var u=!0,p=0;p<a;p++)if(c(e,l+p)!==c(t,p)){u=!1;break}if(u)return l}return-1}function v(e,t,i,n){return O(function(e){for(var t=[],i=0;i<e.length;++i)t.push(255&e.charCodeAt(i));return t}(t),e,i,n)}function y(e,t,i,n){return O(function(e,t){for(var i,n,r=[],s=0;s<e.length&&!((t-=2)<0);++s)n=e.charCodeAt(s),i=n>>8,n=n%256,r.push(n),r.push(i);return r}(t,e.length-i),e,i,n)}function b(e,t,i){i=Math.min(e.length,i);for(var n=[],r=t;r<i;){var s,o,a,c,h=e[r],l=null,u=239<h?4:223<h?3:191<h?2:1;if(r+u<=i)switch(u){case 1:h<128&&(l=h);break;case 2:128==(192&(s=e[r+1]))&&127<(c=(31&h)<<6|63&s)&&(l=c);break;case 3:s=e[r+1],o=e[r+2],128==(192&s)&&128==(192&o)&&2047<(c=(15&h)<<12|(63&s)<<6|63&o)&&(c<55296||57343<c)&&(l=c);break;case 4:s=e[r+1],o=e[r+2],a=e[r+3],128==(192&s)&&128==(192&o)&&128==(192&a)&&65535<(c=(15&h)<<18|(63&s)<<12|(63&o)<<6|63&a)&&c<1114112&&(l=c)}null===l?(l=65533,u=1):65535<l&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),r+=u}return function(e){var t=e.length;if(t<=w)return String.fromCharCode.apply(String,e);var i="",n=0;for(;n<t;)i+=String.fromCharCode.apply(String,e.slice(n,n+=w));return i}(n)}R.Buffer=u,R.SlowBuffer=function(e){+e!=e&&(e=0);return u.alloc(+e)},R.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),R.kMaxLength=i(),u.poolSize=8192,u._augment=function(e){return e.__proto__=u.prototype,e},u.from=function(e,t,i){return n(null,e,t,i)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(e,t,i){return n=null,t=t,i=i,c(e=e),!(e<=0)&&void 0!==t?"string"==typeof i?r(n,e).fill(t,i):r(n,e).fill(t):r(n,e);var n},u.allocUnsafe=function(e){return h(null,e)},u.allocUnsafeSlow=function(e){return h(null,e)},u.isBuffer=function(e){return!(null==e||!e._isBuffer)},u.compare=function(e,t){if(!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var i=e.length,n=t.length,r=0,s=Math.min(i,n);r<s;++r)if(e[r]!==t[r]){i=e[r],n=t[r];break}return i<n?-1:n<i?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!o(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);if(void 0===t)for(r=t=0;r<e.length;++r)t+=e[r].length;for(var i=u.allocUnsafe(t),n=0,r=0;r<e.length;++r){var s=e[r];if(!u.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(i,n),n+=s.length}return i},u.byteLength=d,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)f(this,t,t+1);return this},u.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)f(this,t,t+3),f(this,t+1,t+2);return this},u.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)f(this,t,t+7),f(this,t+1,t+6),f(this,t+2,t+5),f(this,t+3,t+4);return this},u.prototype.toString=function(){var e=0|this.length;return 0==e?"":0===arguments.length?b(this,0,e):t.apply(this,arguments)},u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){var e="",t=R.INSPECT_MAX_BYTES;return 0<this.length&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),"<Buffer "+e+">"},u.prototype.compare=function(e,t,i,n,r){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===i&&(i=e?e.length:0),void 0===n&&(n=0),void 0===r&&(r=this.length),(t=void 0===t?0:t)<0||i>e.length||n<0||r>this.length)throw new RangeError("out of range index");if(r<=n&&i<=t)return 0;if(r<=n)return-1;if(i<=t)return 1;if(this===e)return 0;for(var s=(r>>>=0)-(n>>>=0),o=(i>>>=0)-(t>>>=0),a=Math.min(s,o),c=this.slice(n,r),h=e.slice(t,i),l=0;l<a;++l)if(c[l]!==h[l]){s=c[l],o=h[l];break}return s<o?-1:o<s?1:0},u.prototype.includes=function(e,t,i){return-1!==this.indexOf(e,t,i)},u.prototype.indexOf=function(e,t,i){return g(this,e,t,i,!0)},u.prototype.lastIndexOf=function(e,t,i){return g(this,e,t,i,!1)},u.prototype.write=function(e,t,i,n){if(void 0===t)n="utf8",i=this.length,t=0;else if(void 0===i&&"string"==typeof t)n=t,i=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(i)?(i|=0,void 0===n&&(n="utf8")):(n=i,i=void 0)}var r=this.length-t;if((void 0===i||r<i)&&(i=r),0<e.length&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n=n||"utf8";for(var s,o,a,c=!1;;)switch(n){case"hex":return function(e,t,i,n){i=Number(i)||0;var r=e.length-i;if((!n||r<(n=Number(n)))&&(n=r),(r=t.length)%2!=0)throw new TypeError("Invalid hex string");r/2<n&&(n=r/2);for(var s=0;s<n;++s){var o=parseInt(t.substr(2*s,2),16);if(isNaN(o))return s;e[i+s]=o}return s}(this,e,t,i);case"utf8":case"utf-8":return o=t,a=i,O(M(e,(s=this).length-o),s,o,a);case"ascii":return v(this,e,t,i);case"latin1":case"binary":return v(this,e,t,i);case"base64":return s=this,o=t,a=i,O(k(e),s,o,a);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return y(this,e,t,i);default:if(c)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),c=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var w=4096;function _(e,t,i){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(i<e+t)throw new RangeError("Trying to access beyond buffer length")}function A(e,t,i,n,r,s){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(r<t||t<s)throw new RangeError('"value" argument is out of bounds');if(i+n>e.length)throw new RangeError("Index out of range")}function B(e,t,i,n){t<0&&(t=65535+t+1);for(var r=0,s=Math.min(e.length-i,2);r<s;++r)e[i+r]=(t&255<<8*(n?r:1-r))>>>8*(n?r:1-r)}function C(e,t,i,n){t<0&&(t=4294967295+t+1);for(var r=0,s=Math.min(e.length-i,4);r<s;++r)e[i+r]=t>>>8*(n?r:3-r)&255}function x(e,t,i,n){if(i+n>e.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function E(e,t,i,n,r){return r||x(e,0,i,4),s.write(e,t,i,n,23,4),i+4}function S(e,t,i,n,r){return r||x(e,0,i,8),s.write(e,t,i,n,52,8),i+8}u.prototype.slice=function(e,t){var i=this.length;if((e=~~e)<0?(e+=i)<0&&(e=0):i<e&&(e=i),(t=void 0===t?i:~~t)<0?(t+=i)<0&&(t=0):i<t&&(t=i),t<e&&(t=e),u.TYPED_ARRAY_SUPPORT)(r=this.subarray(e,t)).__proto__=u.prototype;else for(var n=t-e,r=new u(n,void 0),s=0;s<n;++s)r[s]=this[s+e];return r},u.prototype.readUIntLE=function(e,t,i){e|=0,t|=0,i||_(e,t,this.length);for(var n=this[e],r=1,s=0;++s<t&&(r*=256);)n+=this[e+s]*r;return n},u.prototype.readUIntBE=function(e,t,i){e|=0,t|=0,i||_(e,t,this.length);for(var n=this[e+--t],r=1;0<t&&(r*=256);)n+=this[e+--t]*r;return n},u.prototype.readUInt8=function(e,t){return t||_(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||_(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||_(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||_(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||_(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,i){e|=0,t|=0,i||_(e,t,this.length);for(var n=this[e],r=1,s=0;++s<t&&(r*=256);)n+=this[e+s]*r;return(r*=128)<=n&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,i){e|=0,t|=0,i||_(e,t,this.length);for(var n=t,r=1,s=this[e+--n];0<n&&(r*=256);)s+=this[e+--n]*r;return(r*=128)<=s&&(s-=Math.pow(2,8*t)),s},u.prototype.readInt8=function(e,t){return t||_(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||_(e,2,this.length);e=this[e]|this[e+1]<<8;return 32768&e?4294901760|e:e},u.prototype.readInt16BE=function(e,t){t||_(e,2,this.length);e=this[e+1]|this[e]<<8;return 32768&e?4294901760|e:e},u.prototype.readInt32LE=function(e,t){return t||_(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||_(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||_(e,4,this.length),s.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||_(e,4,this.length),s.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||_(e,8,this.length),s.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||_(e,8,this.length),s.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,i,n){e=+e,t|=0,i|=0,n||A(this,e,t,i,Math.pow(2,8*i)-1,0);var r=1,s=0;for(this[t]=255&e;++s<i&&(r*=256);)this[t+s]=e/r&255;return t+i},u.prototype.writeUIntBE=function(e,t,i,n){e=+e,t|=0,i|=0,n||A(this,e,t,i,Math.pow(2,8*i)-1,0);var r=i-1,s=1;for(this[t+r]=255&e;0<=--r&&(s*=256);)this[t+r]=e/s&255;return t+i},u.prototype.writeUInt8=function(e,t,i){return e=+e,t|=0,i||A(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,i){return e=+e,t|=0,i||A(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):B(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,i){return e=+e,t|=0,i||A(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):B(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,i){return e=+e,t|=0,i||A(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):C(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,i){return e=+e,t|=0,i||A(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):C(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,i,n){e=+e,t|=0,n||A(this,e,t,i,(n=Math.pow(2,8*i-1))-1,-n);var r=0,s=1,o=0;for(this[t]=255&e;++r<i&&(s*=256);)e<0&&0===o&&0!==this[t+r-1]&&(o=1),this[t+r]=(e/s>>0)-o&255;return t+i},u.prototype.writeIntBE=function(e,t,i,n){e=+e,t|=0,n||A(this,e,t,i,(n=Math.pow(2,8*i-1))-1,-n);var r=i-1,s=1,o=0;for(this[t+r]=255&e;0<=--r&&(s*=256);)e<0&&0===o&&0!==this[t+r+1]&&(o=1),this[t+r]=(e/s>>0)-o&255;return t+i},u.prototype.writeInt8=function(e,t,i){return e=+e,t|=0,i||A(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&(e=e<0?255+e+1:e),t+1},u.prototype.writeInt16LE=function(e,t,i){return e=+e,t|=0,i||A(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):B(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,i){return e=+e,t|=0,i||A(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):B(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,i){return e=+e,t|=0,i||A(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):C(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,i){return e=+e,t|=0,i||A(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):C(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,i){return E(this,e,t,!0,i)},u.prototype.writeFloatBE=function(e,t,i){return E(this,e,t,!1,i)},u.prototype.writeDoubleLE=function(e,t,i){return S(this,e,t,!0,i)},u.prototype.writeDoubleBE=function(e,t,i){return S(this,e,t,!1,i)},u.prototype.copy=function(e,t,i,n){if(i=i||0,n||0===n||(n=this.length),t>=e.length&&(t=e.length),(n=0<n&&n<i?i:n)===i)return 0;if(0===e.length||0===this.length)return 0;if((t=t||0)<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length);var r,s=(n=e.length-t<n-i?e.length-t+i:n)-i;if(this===e&&i<t&&t<n)for(r=s-1;0<=r;--r)e[r+t]=this[r+i];else if(s<1e3||!u.TYPED_ARRAY_SUPPORT)for(r=0;r<s;++r)e[r+t]=this[r+i];else Uint8Array.prototype.set.call(e,this.subarray(i,i+s),t);return s},u.prototype.fill=function(e,t,i,n){if("string"==typeof e){var r;if("string"==typeof t?(n=t,t=0,i=this.length):"string"==typeof i&&(n=i,i=this.length),1!==e.length||(r=e.charCodeAt(0))<256&&(e=r),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<i)throw new RangeError("Out of range index");if(i<=t)return this;if(t>>>=0,i=void 0===i?this.length:i>>>0,"number"==typeof(e=e||0))for(a=t;a<i;++a)this[a]=e;else for(var s=u.isBuffer(e)?e:M(new u(e,n).toString()),o=s.length,a=0;a<i-t;++a)this[a+t]=s[a%o];return this};var T=/[^+\/0-9A-Za-z-_]/g;function M(e,t){var i;t=t||1/0;for(var n=e.length,r=null,s=[],o=0;o<n;++o){if(55295<(i=e.charCodeAt(o))&&i<57344){if(!r){if(56319<i){-1<(t-=3)&&s.push(239,191,189);continue}if(o+1===n){-1<(t-=3)&&s.push(239,191,189);continue}r=i;continue}if(i<56320){-1<(t-=3)&&s.push(239,191,189),r=i;continue}i=65536+(r-55296<<10|i-56320)}else r&&-1<(t-=3)&&s.push(239,191,189);if(r=null,i<128){if(--t<0)break;s.push(i)}else if(i<2048){if((t-=2)<0)break;s.push(i>>6|192,63&i|128)}else if(i<65536){if((t-=3)<0)break;s.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;s.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return s}function k(e){return a.toByteArray(function(e){var t;if((e=((t=e).trim?t.trim():t.replace(/^\s+|\s+$/g,"")).replace(T,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function O(e,t,i,n){for(var r=0;r<n&&!(r+i>=t.length||r>=e.length);++r)t[r+i]=e[r];return r}}.call(this,L(16))},function(e,t,i){"use strict";t.byteLength=function(e){var t=l(e),e=t[0],t=t[1];return 3*(e+t)/4-t},t.toByteArray=function(e){var t,i,n=l(e),r=n[0],n=n[1],s=new h(function(e,t){return 3*(e+t)/4-t}(r,n)),o=0,a=0<n?r-4:r;for(i=0;i<a;i+=4)t=c[e.charCodeAt(i)]<<18|c[e.charCodeAt(i+1)]<<12|c[e.charCodeAt(i+2)]<<6|c[e.charCodeAt(i+3)],s[o++]=t>>16&255,s[o++]=t>>8&255,s[o++]=255&t;2===n&&(t=c[e.charCodeAt(i)]<<2|c[e.charCodeAt(i+1)]>>4,s[o++]=255&t);1===n&&(t=c[e.charCodeAt(i)]<<10|c[e.charCodeAt(i+1)]<<4|c[e.charCodeAt(i+2)]>>2,s[o++]=t>>8&255,s[o++]=255&t);return s},t.fromByteArray=function(e){for(var t,i=e.length,n=i%3,r=[],s=0,o=i-n;s<o;s+=16383)r.push(function(e,t,i){for(var n,r=[],s=t;s<i;s+=3)n=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),r.push(function(e){return a[e>>18&63]+a[e>>12&63]+a[e>>6&63]+a[63&e]}(n));return r.join("")}(e,s,o<s+16383?o:s+16383));1==n?(t=e[i-1],r.push(a[t>>2]+a[t<<4&63]+"==")):2==n&&(t=(e[i-2]<<8)+e[i-1],r.push(a[t>>10]+a[t>>4&63]+a[t<<2&63]+"="));return r.join("")};for(var a=[],c=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,s=n.length;r<s;++r)a[r]=n[r],c[n.charCodeAt(r)]=r;function l(e){var t=e.length;if(0<t%4)throw new Error("Invalid string. Length must be a multiple of 4");e=e.indexOf("=");return[e=-1===e?t:e,e===t?0:4-e%4]}c["-".charCodeAt(0)]=62,c["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,i,n,r){var s,o,a=8*r-n-1,c=(1<<a)-1,h=c>>1,l=-7,u=i?r-1:0,p=i?-1:1,i=e[t+u];for(u+=p,s=i&(1<<-l)-1,i>>=-l,l+=a;0<l;s=256*s+e[t+u],u+=p,l-=8);for(o=s&(1<<-l)-1,s>>=-l,l+=n;0<l;o=256*o+e[t+u],u+=p,l-=8);if(0===s)s=1-h;else{if(s===c)return o?NaN:1/0*(i?-1:1);o+=Math.pow(2,n),s-=h}return(i?-1:1)*o*Math.pow(2,s-n)},t.write=function(e,t,i,n,r,s){var o,a,c=8*s-r-1,h=(1<<c)-1,l=h>>1,u=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:s-1,d=n?1:-1,s=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,o=h):(o=Math.floor(Math.log(t)/Math.LN2),t*(n=Math.pow(2,-o))<1&&(o--,n*=2),2<=(t+=1<=o+l?u/n:u*Math.pow(2,1-l))*n&&(o++,n/=2),h<=o+l?(a=0,o=h):1<=o+l?(a=(t*n-1)*Math.pow(2,r),o+=l):(a=t*Math.pow(2,l-1)*Math.pow(2,r),o=0));8<=r;e[i+p]=255&a,p+=d,a/=256,r-=8);for(o=o<<r|a,c+=r;0<c;e[i+p]=255&o,p+=d,o/=256,c-=8);e[i+p-d]|=128*s}},function(e,t){var i={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==i.call(e)}},function(e,t,i){"use strict";var r=i(8);e.exports=function(e,t,i){var n=i.config.validateStatus;i.status&&n&&!n(i.status)?t(new r("Request failed with status code "+i.status,[r.ERR_BAD_REQUEST,r.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i)):e(i)}},function(e,t,i){"use strict";var a=i(3);e.exports=a.isStandardBrowserEnv()?{write:function(e,t,i,n,r,s){var o=[];o.push(e+"="+encodeURIComponent(t)),a.isNumber(i)&&o.push("expires="+new Date(i).toGMTString()),a.isString(n)&&o.push("path="+n),a.isString(r)&&o.push("domain="+r),!0===s&&o.push("secure"),document.cookie=o.join("; ")},read:function(e){e=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(e,t,i){"use strict";e.exports=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}},function(e,t,i){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},function(e,t,i){"use strict";var r=i(3),s=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,i,n={};return e&&r.forEach(e.split("\n"),function(e){i=e.indexOf(":"),t=r.trim(e.substr(0,i)).toLowerCase(),i=r.trim(e.substr(i+1)),t&&(n[t]&&0<=s.indexOf(t)||(n[t]="set-cookie"===t?(n[t]||[]).concat([i]):n[t]?n[t]+", "+i:i))}),n}},function(e,t,i){"use strict";var n,r,s,o=i(3);function a(e){return r&&(s.setAttribute("href",e),e=s.href),s.setAttribute("href",e),{href:s.href,protocol:s.protocol?s.protocol.replace(/:$/,""):"",host:s.host,search:s.search?s.search.replace(/^\?/,""):"",hash:s.hash?s.hash.replace(/^#/,""):"",hostname:s.hostname,port:s.port,pathname:"/"===s.pathname.charAt(0)?s.pathname:"/"+s.pathname}}e.exports=o.isStandardBrowserEnv()?(r=/(msie|trident)/i.test(navigator.userAgent),s=document.createElement("a"),n=a(window.location.href),function(e){e=o.isString(e)?a(e):e;return e.protocol===n.protocol&&e.host===n.host}):function(){return!0}},function(e,t,i){"use strict";e.exports=function(e){e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return e&&e[1]||""}},function(e,t){e.exports=null},function(e,t,i){"use strict";var o=i(28).version,c=i(8),n={};["object","boolean","number","function","string","symbol"].forEach(function(t,i){n[t]=function(e){return typeof e===t||"a"+(i<1?"n ":" ")+t}});var a={};n.transitional=function(n,r,i){function s(e,t){return"[Axios v"+o+"] Transitional option '"+e+"'"+t+(i?". "+i:"")}return function(e,t,i){if(!1===n)throw new c(s(t," has been removed"+(r?" in "+r:"")),c.ERR_DEPRECATED);return r&&!a[t]&&(a[t]=!0,console.warn(s(t," has been deprecated since v"+r+" and will be removed in the near future"))),!n||n(e,t,i)}},e.exports={assertOptions:function(e,t,i){if("object"!=typeof e)throw new c("options must be an object",c.ERR_BAD_OPTION_VALUE);for(var n=Object.keys(e),r=n.length;0<r--;){var s=n[r],o=t[s];if(o){var a=e[s],a=void 0===a||o(a,s,e);if(!0!==a)throw new c("option "+s+" must be "+a,c.ERR_BAD_OPTION_VALUE)}else if(!0!==i)throw new c("Unknown option "+s,c.ERR_BAD_OPTION)}},validators:n}},function(e,t,i){"use strict";var r=i(12);function n(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise(function(e){t=e});var n=this;this.promise.then(function(e){if(n._listeners){for(var t=n._listeners.length,i=0;i<t;i++)n._listeners[i](e);n._listeners=null}}),this.promise.then=function(e){var t,e=new Promise(function(e){n.subscribe(e),t=e}).then(e);return e.cancel=function(){n.unsubscribe(t)},e},e(function(e){n.reason||(n.reason=new r(e),t(n.reason))})}n.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},n.prototype.subscribe=function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]},n.prototype.unsubscribe=function(e){!this._listeners||-1!==(e=this._listeners.indexOf(e))&&this._listeners.splice(e,1)},n.source=function(){var t;return{token:new n(function(e){t=e}),cancel:t}},e.exports=n},function(e,t,i){"use strict";e.exports=function(t){return function(e){return t.apply(null,e)}}},function(e,t,i){"use strict";var n=i(3);e.exports=function(e){return n.isObject(e)&&!0===e.isAxiosError}},function(e,t){},function(e,t,i){var n;e.exports=(n=i(2),function(){var e,r;"function"==typeof ArrayBuffer&&(e=n.lib.WordArray,r=e.init,(e.init=function(e){if((e=(e=e instanceof ArrayBuffer?new Uint8Array(e):e)instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e)instanceof Uint8Array){for(var t=e.byteLength,i=[],n=0;n<t;n++)i[n>>>2]|=e[n]<<24-n%4*8;r.call(this,i,t)}else r.apply(this,arguments)}).prototype=e)}(),n.lib.WordArray)},function(e,t,i){var n;e.exports=(n=i(2),function(){var r=n.lib.WordArray,e=n.enc;e.Utf16=e.Utf16BE={stringify:function(e){for(var t=e.words,i=e.sigBytes,n=[],r=0;r<i;r+=2){var s=t[r>>>2]>>>16-r%4*8&65535;n.push(String.fromCharCode(s))}return n.join("")},parse:function(e){for(var t=e.length,i=[],n=0;n<t;n++)i[n>>>1]|=e.charCodeAt(n)<<16-n%2*16;return r.create(i,2*t)}};function o(e){return e<<8&4278255360|e>>>8&16711935}e.Utf16LE={stringify:function(e){for(var t=e.words,i=e.sigBytes,n=[],r=0;r<i;r+=2){var s=o(t[r>>>2]>>>16-r%4*8&65535);n.push(String.fromCharCode(s))}return n.join("")},parse:function(e){for(var t=e.length,i=[],n=0;n<t;n++)i[n>>>1]|=o(e.charCodeAt(n)<<16-n%2*16);return r.create(i,2*t)}}}(),n.enc.Utf16)},function(e,t,i){var n;e.exports=(n=i(2),function(){var c=n.lib.WordArray;n.enc.Base64url={stringify:function(e,t=!0){var i=e.words,n=e.sigBytes,r=t?this._safe_map:this._map;e.clamp();for(var s=[],o=0;o<n;o+=3)for(var a=(i[o>>>2]>>>24-o%4*8&255)<<16|(i[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|i[o+2>>>2]>>>24-(o+2)%4*8&255,c=0;c<4&&o+.75*c<n;c++)s.push(r.charAt(a>>>6*(3-c)&63));var h=r.charAt(64);if(h)for(;s.length%4;)s.push(h);return s.join("")},parse:function(e,t=!0){var i=e.length,n=t?this._safe_map:this._map;if(!(r=this._reverseMap))for(var r=this._reverseMap=[],s=0;s<n.length;s++)r[n.charCodeAt(s)]=s;t=n.charAt(64);return!t||-1!==(t=e.indexOf(t))&&(i=t),function(e,t,i){for(var n=[],r=0,s=0;s<t;s++){var o,a;s%4&&(o=i[e.charCodeAt(s-1)]<<s%4*2,a=i[e.charCodeAt(s)]>>>6-s%4*2,a=o|a,n[r>>>2]|=a<<24-r%4*8,r++)}return c.create(n,r)}(e,i,r)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"}}(),n.enc.Base64url)},function(e,t,i){var r;e.exports=(r=i(2),i(29),function(){var e=r,t=e.lib.WordArray,i=e.algo,n=i.SHA256,i=i.SHA224=n.extend({_doReset:function(){this._hash=new t.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var e=n._doFinalize.call(this);return e.sigBytes-=4,e}});e.SHA224=n._createHelper(i),e.HmacSHA224=n._createHmacHelper(i)}(),r.SHA224)},function(e,t,i){var s;e.exports=(s=i(2),i(13),i(30),function(){var e=s,t=e.x64,i=t.Word,n=t.WordArray,t=e.algo,r=t.SHA512,t=t.SHA384=r.extend({_doReset:function(){this._hash=new n.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 e=r._doFinalize.call(this);return e.sigBytes-=16,e}});e.SHA384=r._createHelper(t),e.HmacSHA384=r._createHmacHelper(t)}(),s.SHA384)},function(e,t,i){var r;e.exports=(r=i(2),i(13),function(l){var e=r,t=e.lib,u=t.WordArray,n=t.Hasher,p=e.x64.Word,t=e.algo,E=[],S=[],T=[];!function(){for(var e=1,t=0,i=0;i<24;i++){E[e+5*t]=(i+1)*(i+2)/2%64;var n=(2*e+3*t)%5;e=t%5,t=n}for(e=0;e<5;e++)for(t=0;t<5;t++)S[e+5*t]=t+(2*e+3*t)%5*5;for(var r=1,s=0;s<24;s++){for(var o,a=0,c=0,h=0;h<7;h++)1&r&&((o=(1<<h)-1)<32?c^=1<<o:a^=1<<o-32),128&r?r=r<<1^113:r<<=1;T[s]=p.create(a,c)}}();var M=[];!function(){for(var e=0;e<25;e++)M[e]=p.create()}();t=t.SHA3=n.extend({cfg:n.cfg.extend({outputLength:512}),_doReset:function(){for(var e=this._state=[],t=0;t<25;t++)e[t]=new p.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(e,t){for(var i=this._state,n=this.blockSize/2,r=0;r<n;r++){var s=e[t+2*r],o=e[t+2*r+1],s=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8);(A=i[r]).high^=o=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),A.low^=s}for(var a=0;a<24;a++){for(var c=0;c<5;c++){for(var h=0,l=0,u=0;u<5;u++)h^=(A=i[c+5*u]).high,l^=A.low;var p=M[c];p.high=h,p.low=l}for(c=0;c<5;c++)for(var d=M[(c+4)%5],f=M[(c+1)%5],g=f.high,f=f.low,h=d.high^(g<<1|f>>>31),l=d.low^(f<<1|g>>>31),u=0;u<5;u++)(A=i[c+5*u]).high^=h,A.low^=l;for(var m=1;m<25;m++){var v=(A=i[m]).high,y=A.low,b=E[m];l=b<32?(h=v<<b|y>>>32-b,y<<b|v>>>32-b):(h=y<<b-32|v>>>64-b,v<<b-32|y>>>64-b);b=M[S[m]];b.high=h,b.low=l}var w=M[0],_=i[0];w.high=_.high,w.low=_.low;for(c=0;c<5;c++)for(u=0;u<5;u++){var A=i[m=c+5*u],B=M[m],C=M[(c+1)%5+5*u],x=M[(c+2)%5+5*u];A.high=B.high^~C.high&x.high,A.low=B.low^~C.low&x.low}A=i[0],_=T[a];A.high^=_.high,A.low^=_.low}},_doFinalize:function(){var e=this._data,t=e.words,i=(this._nDataBytes,8*e.sigBytes),n=32*this.blockSize;t[i>>>5]|=1<<24-i%32,t[(l.ceil((1+i)/n)*n>>>5)-1]|=128,e.sigBytes=4*t.length,this._process();for(var r=this._state,t=this.cfg.outputLength/8,s=t/8,o=[],a=0;a<s;a++){var c=r[a],h=c.high,c=c.low,h=16711935&(h<<8|h>>>24)|4278255360&(h<<24|h>>>8);o.push(c=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8)),o.push(h)}return new u.init(o,t)},clone:function(){for(var e=n.clone.call(this),t=e._state=this._state.slice(0),i=0;i<25;i++)t[i]=t[i].clone();return e}});e.SHA3=n._createHelper(t),e.HmacSHA3=n._createHmacHelper(t)}(Math),r.SHA3)},function(e,t,i){var r;e.exports=(r=i(2),function(){var e=r,t=e.lib,i=t.WordArray,n=t.Hasher,t=e.algo,B=i.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]),C=i.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]),x=i.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]),E=i.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]),S=i.create([0,1518500249,1859775393,2400959708,2840853838]),T=i.create([1352829926,1548603684,1836072691,2053994217,0]),t=t.RIPEMD160=n.extend({_doReset:function(){this._hash=i.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var i=0;i<16;i++){var n=t+i,r=e[n];e[n]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8)}for(var s,o,a,c,h,l,u=this._hash.words,p=S.words,d=T.words,f=B.words,g=C.words,m=x.words,v=E.words,y=s=u[0],b=o=u[1],w=a=u[2],_=c=u[3],A=h=u[4],i=0;i<80;i+=1)l=s+e[t+f[i]]|0,l+=i<16?(o^a^c)+p[0]:i<32?M(o,a,c)+p[1]:i<48?((o|~a)^c)+p[2]:i<64?k(o,a,c)+p[3]:(o^(a|~c))+p[4],l=(l=O(l|=0,m[i]))+h|0,s=h,h=c,c=O(a,10),a=o,o=l,l=y+e[t+g[i]]|0,l+=i<16?(b^(w|~_))+d[0]:i<32?k(b,w,_)+d[1]:i<48?((b|~w)^_)+d[2]:i<64?M(b,w,_)+d[3]:(b^w^_)+d[4],l=(l=O(l|=0,v[i]))+A|0,y=A,A=_,_=O(w,10),w=b,b=l;l=u[1]+a+_|0,u[1]=u[2]+c+A|0,u[2]=u[3]+h+y|0,u[3]=u[4]+s+b|0,u[4]=u[0]+o+w|0,u[0]=l},_doFinalize:function(){var e=this._data,t=e.words,i=8*this._nDataBytes,n=8*e.sigBytes;t[n>>>5]|=128<<24-n%32,t[14+(64+n>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),e.sigBytes=4*(t.length+1),this._process();for(var t=this._hash,r=t.words,s=0;s<5;s++){var o=r[s];r[s]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8)}return t},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e}});function M(e,t,i){return e&t|~e&i}function k(e,t,i){return e&i|t&~i}function O(e,t){return e<<t|e>>>32-t}e.RIPEMD160=n._createHelper(t),e.HmacRIPEMD160=n._createHmacHelper(t)}(Math),r.RIPEMD160)},function(e,t,i){var s;e.exports=(s=i(2),i(17),i(18),function(){var e=s,t=e.lib,i=t.Base,v=t.WordArray,n=e.algo,t=n.SHA1,y=n.HMAC,r=n.PBKDF2=i.extend({cfg:i.extend({keySize:4,hasher:t,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var i=this.cfg,n=y.create(i.hasher,e),r=v.create(),s=v.create([1]),o=r.words,a=s.words,c=i.keySize,h=i.iterations;o.length<c;){var l=n.update(t).finalize(s);n.reset();for(var u=l.words,p=u.length,d=l,f=1;f<h;f++){d=n.finalize(d),n.reset();for(var g=d.words,m=0;m<p;m++)u[m]^=g[m]}r.concat(l),a[0]++}return r.sigBytes=4*c,r}});e.PBKDF2=function(e,t,i){return r.create(i).compute(e,t)}}(),s.PBKDF2)},function(e,t,i){var n;e.exports=(n=i(2),i(4),n.mode.CFB=function(){var e=n.lib.BlockCipherMode.extend();function s(e,t,i,n){var r,s=this._iv;s?(r=s.slice(0),this._iv=void 0):r=this._prevBlock,n.encryptBlock(r,0);for(var o=0;o<i;o++)e[t+o]^=r[o]}return e.Encryptor=e.extend({processBlock:function(e,t){var i=this._cipher,n=i.blockSize;s.call(this,e,t,n,i),this._prevBlock=e.slice(t,t+n)}}),e.Decryptor=e.extend({processBlock:function(e,t){var i=this._cipher,n=i.blockSize,r=e.slice(t,t+n);s.call(this,e,t,n,i),this._prevBlock=r}}),e}(),n.mode.CFB)},function(e,t,i){var n;e.exports=(n=i(2),i(4),n.mode.CTR=function(){var e=n.lib.BlockCipherMode.extend(),t=e.Encryptor=e.extend({processBlock:function(e,t){var i=this._cipher,n=i.blockSize,r=this._iv,s=this._counter;r&&(s=this._counter=r.slice(0),this._iv=void 0);var o=s.slice(0);i.encryptBlock(o,0),s[n-1]=s[n-1]+1|0;for(var a=0;a<n;a++)e[t+a]^=o[a]}});return e.Decryptor=t,e}(),n.mode.CTR)},function(e,t,i){var n;e.exports=(n=i(2),i(4),n.mode.CTRGladman=function(){var e=n.lib.BlockCipherMode.extend();function c(e){var t,i,n;return 255==(e>>24&255)?(i=e>>8&255,n=255&e,255===(t=e>>16&255)?(t=0,255===i?(i=0,255===n?n=0:++n):++i):++t,e=0,e+=t<<16,e+=i<<8,e+=n):e+=1<<24,e}var t=e.Encryptor=e.extend({processBlock:function(e,t){var i=this._cipher,n=i.blockSize,r=this._iv,s=this._counter;r&&(s=this._counter=r.slice(0),this._iv=void 0),0===((r=s)[0]=c(r[0]))&&(r[1]=c(r[1]));var o=s.slice(0);i.encryptBlock(o,0);for(var a=0;a<n;a++)e[t+a]^=o[a]}});return e.Decryptor=t,e}(),n.mode.CTRGladman)},function(e,t,i){var n;e.exports=(n=i(2),i(4),n.mode.OFB=function(){var e=n.lib.BlockCipherMode.extend(),t=e.Encryptor=e.extend({processBlock:function(e,t){var i=this._cipher,n=i.blockSize,r=this._iv,s=this._keystream;r&&(s=this._keystream=r.slice(0),this._iv=void 0),i.encryptBlock(s,0);for(var o=0;o<n;o++)e[t+o]^=s[o]}});return e.Decryptor=t,e}(),n.mode.OFB)},function(e,t,i){var n;e.exports=(n=i(2),i(4),n.mode.ECB=function(){var e=n.lib.BlockCipherMode.extend();return e.Encryptor=e.extend({processBlock:function(e,t){this._cipher.encryptBlock(e,t)}}),e.Decryptor=e.extend({processBlock:function(e,t){this._cipher.decryptBlock(e,t)}}),e}(),n.mode.ECB)},function(e,t,i){e.exports=(e=i(2),i(4),e.pad.AnsiX923={pad:function(e,t){var i=e.sigBytes,t=4*t,t=t-i%t,i=i+t-1;e.clamp(),e.words[i>>>2]|=t<<24-i%4*8,e.sigBytes+=t},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},e.pad.Ansix923)},function(e,t,i){var n;e.exports=(n=i(2),i(4),n.pad.Iso10126={pad:function(e,t){t*=4,t-=e.sigBytes%t;e.concat(n.lib.WordArray.random(t-1)).concat(n.lib.WordArray.create([t<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},n.pad.Iso10126)},function(e,t,i){var n;e.exports=(n=i(2),i(4),n.pad.Iso97971={pad:function(e,t){e.concat(n.lib.WordArray.create([2147483648],1)),n.pad.ZeroPadding.pad(e,t)},unpad:function(e){n.pad.ZeroPadding.unpad(e),e.sigBytes--}},n.pad.Iso97971)},function(e,t,i){e.exports=(e=i(2),i(4),e.pad.ZeroPadding={pad:function(e,t){t*=4;e.clamp(),e.sigBytes+=t-(e.sigBytes%t||t)},unpad:function(e){for(var t=e.words,i=e.sigBytes-1,i=e.sigBytes-1;0<=i;i--)if(t[i>>>2]>>>24-i%4*8&255){e.sigBytes=i+1;break}}},e.pad.ZeroPadding)},function(e,t,i){e.exports=(e=i(2),i(4),e.pad.NoPadding={pad:function(){},unpad:function(){}},e.pad.NoPadding)},function(e,t,i){var n;e.exports=(n=i(2),i(4),function(){var t=n.lib.CipherParams,i=n.enc.Hex;n.format.Hex={stringify:function(e){return e.ciphertext.toString(i)},parse:function(e){e=i.parse(e);return t.create({ciphertext:e})}}}(),n.format.Hex)},function(e,t,i){var n;e.exports=(n=i(2),i(9),i(10),i(7),i(4),function(){var e=n,t=e.lib.BlockCipher,i=e.algo,h=[],l=[],u=[],p=[],d=[],f=[],g=[],m=[],v=[],y=[];!function(){for(var e=[],t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;for(var i=0,n=0,t=0;t<256;t++){var r=n^n<<1^n<<2^n<<3^n<<4;h[i]=r=r>>>8^255&r^99;var s=e[l[r]=i],o=e[s],a=e[o],c=257*e[r]^16843008*r;u[i]=c<<24|c>>>8,p[i]=c<<16|c>>>16,d[i]=c<<8|c>>>24,f[i]=c,g[r]=(c=16843009*a^65537*o^257*s^16843008*i)<<24|c>>>8,m[r]=c<<16|c>>>16,v[r]=c<<8|c>>>24,y[r]=c,i?(i=s^e[e[e[a^s]]],n^=e[e[n]]):i=n=1}}();var b=[0,1,2,4,8,16,32,64,128,27,54],i=i.AES=t.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,i=e.sigBytes/4,n=4*(1+(this._nRounds=6+i)),r=this._keySchedule=[],s=0;s<n;s++)s<i?r[s]=t[s]:(c=r[s-1],s%i?6<i&&s%i==4&&(c=h[c>>>24]<<24|h[c>>>16&255]<<16|h[c>>>8&255]<<8|h[255&c]):(c=h[(c=c<<8|c>>>24)>>>24]<<24|h[c>>>16&255]<<16|h[c>>>8&255]<<8|h[255&c],c^=b[s/i|0]<<24),r[s]=r[s-i]^c);for(var o=this._invKeySchedule=[],a=0;a<n;a++){var c,s=n-a;c=a%4?r[s]:r[s-4],o[a]=a<4||s<=4?c:g[h[c>>>24]]^m[h[c>>>16&255]]^v[h[c>>>8&255]]^y[h[255&c]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,u,p,d,f,h)},decryptBlock:function(e,t){var i=e[t+1];e[t+1]=e[t+3],e[t+3]=i,this._doCryptBlock(e,t,this._invKeySchedule,g,m,v,y,l);i=e[t+1];e[t+1]=e[t+3],e[t+3]=i},_doCryptBlock:function(e,t,i,n,r,s,o,a){for(var c=this._nRounds,h=e[t]^i[0],l=e[t+1]^i[1],u=e[t+2]^i[2],p=e[t+3]^i[3],d=4,f=1;f<c;f++)var g=n[h>>>24]^r[l>>>16&255]^s[u>>>8&255]^o[255&p]^i[d++],m=n[l>>>24]^r[u>>>16&255]^s[p>>>8&255]^o[255&h]^i[d++],v=n[u>>>24]^r[p>>>16&255]^s[h>>>8&255]^o[255&l]^i[d++],y=n[p>>>24]^r[h>>>16&255]^s[l>>>8&255]^o[255&u]^i[d++],h=g,l=m,u=v,p=y;g=(a[h>>>24]<<24|a[l>>>16&255]<<16|a[u>>>8&255]<<8|a[255&p])^i[d++],m=(a[l>>>24]<<24|a[u>>>16&255]<<16|a[p>>>8&255]<<8|a[255&h])^i[d++],v=(a[u>>>24]<<24|a[p>>>16&255]<<16|a[h>>>8&255]<<8|a[255&l])^i[d++],y=(a[p>>>24]<<24|a[h>>>16&255]<<16|a[l>>>8&255]<<8|a[255&u])^i[d++];e[t]=g,e[t+1]=m,e[t+2]=v,e[t+3]=y},keySize:8});e.AES=t._createHelper(i)}(),n.AES)},function(e,t,i){var s;e.exports=(s=i(2),i(9),i(10),i(7),i(4),function(){var e=s,t=e.lib,n=t.WordArray,i=t.BlockCipher,t=e.algo,h=[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],l=[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],u=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],p=[{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}],d=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],r=t.DES=i.extend({_doReset:function(){for(var e=this._key.words,t=[],i=0;i<56;i++){var n=h[i]-1;t[i]=e[n>>>5]>>>31-n%32&1}for(var r=this._subKeys=[],s=0;s<16;s++){for(var o=r[s]=[],a=u[s],i=0;i<24;i++)o[i/6|0]|=t[(l[i]-1+a)%28]<<31-i%6,o[4+(i/6|0)]|=t[28+(l[i+24]-1+a)%28]<<31-i%6;o[0]=o[0]<<1|o[0]>>>31;for(i=1;i<7;i++)o[i]=o[i]>>>4*(i-1)+3;o[7]=o[7]<<5|o[7]>>>27}for(var c=this._invSubKeys=[],i=0;i<16;i++)c[i]=r[15-i]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._subKeys)},decryptBlock:function(e,t){this._doCryptBlock(e,t,this._invSubKeys)},_doCryptBlock:function(e,t,i){this._lBlock=e[t],this._rBlock=e[t+1],f.call(this,4,252645135),f.call(this,16,65535),g.call(this,2,858993459),g.call(this,8,16711935),f.call(this,1,1431655765);for(var n=0;n<16;n++){for(var r=i[n],s=this._lBlock,o=this._rBlock,a=0,c=0;c<8;c++)a|=p[c][((o^r[c])&d[c])>>>0];this._lBlock=o,this._rBlock=s^a}var h=this._lBlock;this._lBlock=this._rBlock,this._rBlock=h,f.call(this,1,1431655765),g.call(this,8,16711935),g.call(this,2,858993459),f.call(this,16,65535),f.call(this,4,252645135),e[t]=this._lBlock,e[t+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function f(e,t){t=(this._lBlock>>>e^this._rBlock)&t;this._rBlock^=t,this._lBlock^=t<<e}function g(e,t){t=(this._rBlock>>>e^this._lBlock)&t;this._lBlock^=t,this._rBlock^=t<<e}e.DES=i._createHelper(r);t=t.TripleDES=i.extend({_doReset:function(){var e=this._key.words;if(2!==e.length&&4!==e.length&&e.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var t=e.slice(0,2),i=e.length<4?e.slice(0,2):e.slice(2,4),e=e.length<6?e.slice(0,2):e.slice(4,6);this._des1=r.createEncryptor(n.create(t)),this._des2=r.createEncryptor(n.create(i)),this._des3=r.createEncryptor(n.create(e))},encryptBlock:function(e,t){this._des1.encryptBlock(e,t),this._des2.decryptBlock(e,t),this._des3.encryptBlock(e,t)},decryptBlock:function(e,t){this._des3.decryptBlock(e,t),this._des2.encryptBlock(e,t),this._des1.decryptBlock(e,t)},keySize:6,ivSize:2,blockSize:2});e.TripleDES=i._createHelper(t)}(),s.TripleDES)},function(e,t,i){var s;e.exports=(s=i(2),i(9),i(10),i(7),i(4),function(){var e=s,t=e.lib.StreamCipher,i=e.algo,n=i.RC4=t.extend({_doReset:function(){for(var e=this._key,t=e.words,i=e.sigBytes,n=this._S=[],r=0;r<256;r++)n[r]=r;for(var r=0,s=0;r<256;r++){var o=r%i,o=t[o>>>2]>>>24-o%4*8&255,s=(s+n[r]+o)%256,o=n[r];n[r]=n[s],n[s]=o}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=r.call(this)},keySize:8,ivSize:0});function r(){for(var e=this._S,t=this._i,i=this._j,n=0,r=0;r<4;r++){var i=(i+e[t=(t+1)%256])%256,s=e[t];e[t]=e[i],e[i]=s,n|=e[(e[t]+e[i])%256]<<24-8*r}return this._i=t,this._j=i,n}e.RC4=t._createHelper(n);i=i.RC4Drop=n.extend({cfg:n.cfg.extend({drop:192}),_doReset:function(){n._doReset.call(this);for(var e=this.cfg.drop;0<e;e--)r.call(this)}});e.RC4Drop=t._createHelper(i)}(),s.RC4)},function(e,t,i){var n;e.exports=(n=i(2),i(9),i(10),i(7),i(4),function(){var e=n,t=e.lib.StreamCipher,i=e.algo,r=[],o=[],a=[],i=i.Rabbit=t.extend({_doReset:function(){for(var e=this._key.words,t=this.cfg.iv,i=0;i<4;i++)e[i]=16711935&(e[i]<<8|e[i]>>>24)|4278255360&(e[i]<<24|e[i]>>>8);for(var n=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],r=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]],i=this._b=0;i<4;i++)c.call(this);for(i=0;i<8;i++)r[i]^=n[i+4&7];if(t){var s=t.words,o=s[0],a=s[1],t=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),s=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),o=t>>>16|4294901760&s,a=s<<16|65535&t;r[0]^=t,r[1]^=o,r[2]^=s,r[3]^=a,r[4]^=t,r[5]^=o,r[6]^=s,r[7]^=a;for(i=0;i<4;i++)c.call(this)}},_doProcessBlock:function(e,t){var i=this._X;c.call(this),r[0]=i[0]^i[5]>>>16^i[3]<<16,r[1]=i[2]^i[7]>>>16^i[5]<<16,r[2]=i[4]^i[1]>>>16^i[7]<<16,r[3]=i[6]^i[3]>>>16^i[1]<<16;for(var n=0;n<4;n++)r[n]=16711935&(r[n]<<8|r[n]>>>24)|4278255360&(r[n]<<24|r[n]>>>8),e[t+n]^=r[n]},blockSize:4,ivSize:2});function c(){for(var e=this._X,t=this._C,i=0;i<8;i++)o[i]=t[i];t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<o[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<o[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<o[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<o[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<o[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<o[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<o[6]>>>0?1:0)|0,this._b=t[7]>>>0<o[7]>>>0?1:0;for(i=0;i<8;i++){var n=e[i]+t[i],r=65535&n,s=n>>>16;a[i]=((r*r>>>17)+r*s>>>15)+s*s^((4294901760&n)*n|0)+((65535&n)*n|0)}e[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,e[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,e[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,e[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,e[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,e[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,e[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,e[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}e.Rabbit=t._createHelper(i)}(),n.Rabbit)},function(e,t,i){var n;e.exports=(n=i(2),i(9),i(10),i(7),i(4),function(){var e=n,t=e.lib.StreamCipher,i=e.algo,r=[],o=[],a=[],i=i.RabbitLegacy=t.extend({_doReset:function(){for(var e=this._key.words,t=this.cfg.iv,i=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],n=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]],r=this._b=0;r<4;r++)c.call(this);for(r=0;r<8;r++)n[r]^=i[r+4&7];if(t){var s=t.words,o=s[0],e=s[1],t=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),s=16711935&(e<<8|e>>>24)|4278255360&(e<<24|e>>>8),o=t>>>16|4294901760&s,e=s<<16|65535&t;n[0]^=t,n[1]^=o,n[2]^=s,n[3]^=e,n[4]^=t,n[5]^=o,n[6]^=s,n[7]^=e;for(r=0;r<4;r++)c.call(this)}},_doProcessBlock:function(e,t){var i=this._X;c.call(this),r[0]=i[0]^i[5]>>>16^i[3]<<16,r[1]=i[2]^i[7]>>>16^i[5]<<16,r[2]=i[4]^i[1]>>>16^i[7]<<16,r[3]=i[6]^i[3]>>>16^i[1]<<16;for(var n=0;n<4;n++)r[n]=16711935&(r[n]<<8|r[n]>>>24)|4278255360&(r[n]<<24|r[n]>>>8),e[t+n]^=r[n]},blockSize:4,ivSize:2});function c(){for(var e=this._X,t=this._C,i=0;i<8;i++)o[i]=t[i];t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<o[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<o[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<o[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<o[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<o[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<o[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<o[6]>>>0?1:0)|0,this._b=t[7]>>>0<o[7]>>>0?1:0;for(i=0;i<8;i++){var n=e[i]+t[i],r=65535&n,s=n>>>16;a[i]=((r*r>>>17)+r*s>>>15)+s*s^((4294901760&n)*n|0)+((65535&n)*n|0)}e[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,e[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,e[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,e[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,e[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,e[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,e[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,e[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}e.RabbitLegacy=t._createHelper(i)}(),n.RabbitLegacy)},function(e,t,i){"use strict";i.r(t),i.d(t,"default",function(){return Oe});var r;i(32),i(33),i(34),i(35),i(36);class n{constructor(e){this.app=e}runRender(){}onPointer(e){switch(e.type){case BABYLON.PointerEventTypes.POINTERMOVE:if(!this.app.ToolTips)return;e.pickInfo&&e.pickInfo.pickedPoint?this.app.ToolTips.update(e):this.app.ToolTips.close();break;case BABYLON.PointerEventTypes.POINTERWHEEL:this.app.CameraController._wheel(e.event),e.event.preventDefault()}}onKeyboard(e){e.type===BABYLON.KeyboardEventTypes.KEYDOWN&&70===e.event.keyCode&&prompt("请复制输入框内的视角参数",this.app.CameraController.getSightJson())}}class s{constructor(e){this.isFPS=!1,this.angle=Math.PI/2,this.direction=new BABYLON.Vector3(Math.cos(this.angle),0,Math.sin(this.angle)),this.isMoveLeft=!1,this.isMoveRight=!1,this.isMoveDown=!1,this.isMoveUp=!1,this.app=e,this.isFPS=!1}runRender(){var e;this.app.scene.activeCamera instanceof BABYLON.FreeCamera&&(this.isMoveDown||this.isMoveLeft||this.isMoveRight||this.isMoveUp)&&(e=this.app.CameraController.freeCamera.speed,this.isMoveLeft?(this.app.CameraController.freeCamera.rotation.y+=e,this.direction.copyFromFloats(0,0,0)):this.isMoveUp?this.direction.copyFromFloats(0,0,e):this.isMoveRight?(this.app.CameraController.freeCamera.rotation.y-=e,this.direction.copyFromFloats(0,0,0)):this.isMoveDown&&this.direction.copyFromFloats(0,0,-e),this.app.CameraController.freeCamera.getScene().useRightHandedSystem&&(this.direction.z*=-1),this.app.CameraController.freeCamera.getViewMatrix().invertToRef(this.app.CameraController.freeCamera._cameraTransformMatrix),BABYLON.Vector3.TransformNormalToRef(this.direction,this.app.CameraController.freeCamera._cameraTransformMatrix,this.app.CameraController.freeCamera._transformedDirection),this.app.CameraController.freeCamera.cameraDirection.addInPlace(this.app.CameraController.freeCamera._transformedDirection))}onPointer(e){switch(e.type){case BABYLON.PointerEventTypes.POINTERUP:if(this.isFPS)return;this.app.CameraController.freeCamera.position=BABYLON.Vector3.Zero(),this.app.CameraController.freeCamera.position.y=this.app.Project.current.height+1.5,this.app.scene.activeCamera=this.app.CameraController.freeCamera,this.app.CameraController.freeCamera.attachControl(this.app.canvas,!0),this.isFPS=!0;break;case BABYLON.PointerEventTypes.POINTERMOVE:break;case BABYLON.PointerEventTypes.POINTERWHEEL:e.event.preventDefault()}}onKeyboard(e){}}class p{static vector3ToJson(e){return{x:Math.floor(1e3*e.x)/1e3,y:Math.floor(1e3*e.y)/1e3,z:Math.floor(1e3*e.z)/1e3}}static vector3ARRToJson(e){let t=[];return e.forEach(e=>t.push({x:Math.floor(1e3*e.x)/1e3,y:Math.floor(1e3*e.y)/1e3,z:Math.floor(1e3*e.z)/1e3})),t}static ToVector3(e){return new BABYLON.Vector3(Math.floor(1e3*e.x)/1e3,Math.floor(1e3*e.y)/1e3,Math.floor(1e3*e.z)/1e3)}static ToARRVector3(e){let t=[];return e.forEach(e=>t.push(new BABYLON.Vector3(Math.floor(1e3*e.x)/1e3,Math.floor(1e3*e.y)/1e3,Math.floor(1e3*e.z)/1e3))),t}static computeBounds(e){let t=e.getChildMeshes(),i=e.getBoundingInfo();if(0<t.length){for(var n=t[0].getBoundingInfo(),r=n.minimum.add(t[0].position),s=n.maximum.add(t[0].position),o=1;o<t.length;o++)n=t[o].getBoundingInfo(),r=BABYLON.Vector3.Minimize(r,n.minimum.add(t[o].position)),s=BABYLON.Vector3.Maximize(s,n.maximum.add(t[o].position));i=new BABYLON.BoundingInfo(r,s)}return i}static computeBoundsToARR(e){for(var t=e[0].getBoundingInfo(),i=t.minimum.add(e[0].position),n=t.maximum.add(e[0].position),r=1;r<e.length;r++)t=e[r].getBoundingInfo(),i=BABYLON.Vector3.Minimize(i,t.minimum.add(e[r].position)),n=BABYLON.Vector3.Maximize(n,t.maximum.add(e[r].position));return new BABYLON.BoundingInfo(i,n)}static Expand(n,r){let s=new Array;var o=n.length;for(let i=0;i<o;i++){var a=n[i],c=n[0==i?o-1:i-1],h=n[i==o-1?0:i+1],l=c.x-a.x,u=c.z-a.z,p=this.norm(l,u);l/=p,u/=p;c=h.x-a.x,p=h.z-a.z,h=this.norm(c,p);c/=h,p/=h;h=-r/Math.sqrt((1-(l*c+u*p))/2);let e=l+c,t=u+p;h=0==this.norm(e,t)?0:h/this.norm(e,t);e*=h,t*=h,s[i]=new BABYLON.Vector3(e+a.x,0,t+a.z)}return s}static norm(e,t){return Math.sqrt(e*e+t*t)}static MergeMeshes(s,e){let o=new BABYLON.Mesh((new Date).getDate().toString(),e.scene);return setTimeout(()=>{let t=null,i;for(let e=0;e<s.length;e++){var n,r;s[e]&&(r=(n=s[e]).computeWorldMatrix(!0),i=BABYLON.VertexData.ExtractFromMesh(n,!0,!0),i.transform(r),t?t.merge(i,!0):t=i,n.dispose(!1,!0))}t.applyToMesh(o)}),o}static DeconsTructMesh(e,t,i){if(1<e.subMeshes.length){for(var n=BABYLON.VertexData.ExtractFromMesh(e,!0,!0),r=n.indices,s=n.normals,o=n.positions,a=n.uvs,c=new Array,h=0;h<e.subMeshes.length;h++){for(var l=new BABYLON.VertexData,u=r.slice(e.subMeshes[h].indexStart,e.subMeshes[h].indexStart+e.subMeshes[h].indexCount),p=s.slice(3*e.subMeshes[h].verticesStart,3*e.subMeshes[h].verticesStart+3*e.subMeshes[h].verticesCount),d=o.slice(3*e.subMeshes[h].verticesStart,3*e.subMeshes[h].verticesStart+3*e.subMeshes[h].verticesCount),f=a.slice(2*e.subMeshes[h].verticesStart,2*e.subMeshes[h].verticesStart+2*e.subMeshes[h].verticesCount),g=0;g<u.length;g++)u[g]=u[g]-e.subMeshes[h].verticesStart;l.indices=u,l.normals=p,l.positions=d,l.uvs=f;f=new BABYLON.Mesh(e.id+"-"+h,i.scene);l.applyToMesh(f),f.position.y=parseFloat(t),f.setEnabled(!1),c.push(f)}return e.dispose(!1,!0),c}return[e]}static getVisualAngle(e,t){let i={};var n=e.boundingSphere.radiusWorld,r=t.engine.getAspectRatio(t.CameraController.arcRotateCamera);let s=t.CameraController.arcRotateCamera.fov/1.2;return r<1&&(s=Math.atan(r*Math.tan(t.CameraController.arcRotateCamera.fov/2))),i.radius=1.1*Math.abs(n/Math.sin(s)),i.alpha=Math.PI/2,i.beta=Math.PI/4,i.focus=e.boundingSphere.center.clone(),i}static pathTransformation(i,n){let e=new BABYLON.Path3D(i);var r=e.getTangents();let s=[];for(let t=0;t<i.length;t++)if(0<t&&t<i.length-1){var o=i[t-1],a=i[t+1],c=i[t];let e=r[t-1];var h=r[t];if(!e.equals(h)){o=BABYLON.Vector3.Lerp(c,o,n/BABYLON.Vector3.Distance(o,c)),a=BABYLON.Vector3.Lerp(c,a,n/BABYLON.Vector3.Distance(a,c));let e=BABYLON.Curve3.CreateQuadraticBezier(o,c,a,10);s=s.concat(e.getPoints())}}else s.push(i[t]);return s}static createTube(e,t,i=.05,n){return BABYLON.MeshBuilder.CreateTube(e,{path:this.pathTransformation(t,i),radius:i/2},n.scene)}static getAngleFromVector2(e,t,i){var n=(e.x-t.x)*(i.x-t.x)+(e.y-t.y)*(i.y-t.y),t=(e.x-t.x)*(i.y-t.y)-(e.y-t.y)*(i.x-t.x),n=Math.atan2(t,n);return Math.PI-n}static getAngleFromVector3(e,t,i){return this.getAngleFromVector2(new BABYLON.Vector2(e.x,e.z),new BABYLON.Vector2(t.x,t.z),new BABYLON.Vector2(i.x,i.z))}static RandomNumBoth(e,t){var i=t-e,t=Math.random();return e+Math.round(t*i)}}class o{constructor(e){this.app=e,this.arcRotateCamera=new BABYLON.ArcRotateCamera("arcRotateCamera",-Math.PI/4,Math.PI/4,50,new BABYLON.Vector3(0,0,0),this.app.scene),this.arcRotateCamera.pinchPrecision=200,this.arcRotateCamera.minZ=.3,this.arcRotateCamera.wheelDeltaPercentage=.01,this.frustrum=5,this.freeCamera=new BABYLON.FreeCamera("FreeCamera",BABYLON.Vector3.Zero(),this.app.scene),this.freeCamera.minZ=.45,this.freeCamera.speed=.01,this.freeCamera.keysUp=[87],this.freeCamera.keysDown=[83],this.freeCamera.keysLeft=[65],this.freeCamera.keysRight=[68],this.switchArcRotateCamera()}orthographic(){this.arcRotateCamera.lowerBetaLimit=0,this.arcRotateCamera.upperBetaLimit=0,this.arcRotateCamera.lowerAlphaLimit=Math.PI/2,this.arcRotateCamera.upperAlphaLimit=Math.PI/2,this.arcRotateCamera.mode=BABYLON.Camera.ORTHOGRAPHIC_CAMERA;var e=this.app.Project.current.Sight;this.arcRotateCamera.lowerRadiusLimit=2*e.radius,this.arcRotateCamera.radius=e.radius,this.arcRotateCamera.target=e.focus.clone(),this.frustrum=.5*e.radius,this.computeCameraView()}perspective(e){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,e=e||this.app.Project.current.Sight,this.arcRotateCamera.lowerRadiusLimit=e.minimumLimit||1,this.arcRotateCamera.upperRadiusLimit=e.maximumLimit||3e3,this.arcRotateCamera.panningSensibility=1e3,this.arcRotateCamera.lowerBetaLimit=e.minBeta||.01,this.arcRotateCamera.upperBetaLimit=e.maxBeta||Math.PI/2*.98,this.arcRotateCamera.lowerAlphaLimit=null,this.arcRotateCamera.upperAlphaLimit=null,this.arcRotateCamera.mode=BABYLON.Camera.PERSPECTIVE_CAMERA,this.arcRotateCamera.target=e.focus.clone(),(this.arcRotateCamera.alpha>2*Math.PI||this.arcRotateCamera.alpha<-2*Math.PI)&&(this.arcRotateCamera.alpha=this.arcRotateCamera.alpha-Math.floor(this.arcRotateCamera.alpha/(2*Math.PI))*(2*Math.PI));var t=new BABYLON.Animation("camAlpha","alpha",30,BABYLON.Animation.ANIMATIONTYPE_FLOAT,BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE);t.setKeys([{frame:0,value:this.arcRotateCamera.alpha},{frame:30,value:e.alpha}]);var i=new BABYLON.Animation("camRadius","radius",30,BABYLON.Animation.ANIMATIONTYPE_FLOAT,BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE);i.setKeys([{frame:0,value:this.arcRotateCamera.radius},{frame:30,value:e.radius}]);var n=new BABYLON.Animation("camBeta","beta",30,BABYLON.Animation.ANIMATIONTYPE_FLOAT,BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE);n.setKeys([{frame:0,value:this.arcRotateCamera.beta},{frame:30,value:e.beta}]),this.app.scene.beginDirectAnimation(this.arcRotateCamera,[t,i,n],0,60,!1),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}flyTo(e,t=.5){e=e||this.app.Project.current.Sight,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.arcRotateCamera.lowerRadiusLimit=e.minimumLimit||1,this.arcRotateCamera.upperRadiusLimit=e.maximumLimit||3e3,this.arcRotateCamera.panningSensibility=1e3,this.arcRotateCamera.lowerBetaLimit=e.minBeta||.01,this.arcRotateCamera.upperBetaLimit=e.maxBeta||Math.PI/2*.98,this.arcRotateCamera.lowerAlphaLimit=null,this.arcRotateCamera.upperAlphaLimit=null,this.arcRotateCamera.mode=BABYLON.Camera.PERSPECTIVE_CAMERA;var i=new BABYLON.Animation("camtarget","target",30,BABYLON.Animation.ANIMATIONTYPE_VECTOR3,BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE);i.setKeys([{frame:0,value:this.arcRotateCamera.target},{frame:30*t,value:e.focus.clone()}]);var n=new BABYLON.Animation("camradius","radius",30,BABYLON.Animation.ANIMATIONTYPE_FLOAT,BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE);n.setKeys([{frame:0,value:this.arcRotateCamera.radius},{frame:30*t,value:e.radius}]),this.app.scene.beginDirectAnimation(this.arcRotateCamera,[i,n],0,30*t,!1),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}lookToTheFront(e,t=.5){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.arcRotateCamera.lowerRadiusLimit=e.Sight.minimumLimit||1,this.arcRotateCamera.upperRadiusLimit=e.Sight.maximumLimit||3e3,this.arcRotateCamera.panningSensibility=1e3,this.arcRotateCamera.lowerBetaLimit=e.Sight.minBeta||.01,this.arcRotateCamera.upperBetaLimit=e.Sight.maxBeta||Math.PI/2*.98,this.arcRotateCamera.lowerAlphaLimit=null,this.arcRotateCamera.upperAlphaLimit=null,this.arcRotateCamera.mode=BABYLON.Camera.PERSPECTIVE_CAMERA;var i=Math.atan2(-e.instance.forward.z,-e.instance.forward.x);(this.arcRotateCamera.alpha>2*Math.PI||this.arcRotateCamera.alpha<-2*Math.PI)&&(this.arcRotateCamera.alpha=this.arcRotateCamera.alpha-Math.floor(this.arcRotateCamera.alpha/(2*Math.PI))*(2*Math.PI));var n=new BABYLON.Animation("camtarget","target",30,BABYLON.Animation.ANIMATIONTYPE_VECTOR3,BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE);n.setKeys([{frame:0,value:this.arcRotateCamera.target},{frame:30*t,value:e.Sight.focus.clone()}]);var r=new BABYLON.Animation("camAlpha","alpha",30,BABYLON.Animation.ANIMATIONTYPE_FLOAT,BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE);r.setKeys([{frame:0,value:this.arcRotateCamera.alpha},{frame:30*t,value:i}]);i=new BABYLON.Animation("camRadius","radius",30,BABYLON.Animation.ANIMATIONTYPE_FLOAT,BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE);i.setKeys([{frame:0,value:this.arcRotateCamera.radius},{frame:30*t,value:e.Sight.radius/1.2}]);e=new BABYLON.Animation("camBeta","beta",30,BABYLON.Animation.ANIMATIONTYPE_FLOAT,BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE);e.setKeys([{frame:0,value:this.arcRotateCamera.beta},{frame:30*t,value:Math.PI/2}]),this.app.scene.beginDirectAnimation(this.arcRotateCamera,[n,r,i,e],0,30*t,!1),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}getSightJson(){return JSON.stringify({alpha:this.arcRotateCamera.alpha,focus:p.vector3ToJson(this.arcRotateCamera.target),radius:this.arcRotateCamera.radius,beta:this.arcRotateCamera.beta,minimumLimit:this.arcRotateCamera.lowerRadiusLimit,maximumLimit:this.arcRotateCamera.upperRadiusLimit,minBeta:this.arcRotateCamera.lowerBetaLimit,maxBeta:this.arcRotateCamera.upperBetaLimit})}computeCameraView(){var e=this.app.canvas.clientWidth/this.app.canvas.clientHeight;this.arcRotateCamera.orthoLeft=-e*this.frustrum,this.arcRotateCamera.orthoRight=e*this.frustrum,this.arcRotateCamera.orthoTop=this.frustrum,this.arcRotateCamera.orthoBottom=-this.frustrum;e=1e3/(this.frustrum/20);this.arcRotateCamera.panningSensibility=2e3<e?2e3:e<10?10:e}_wheel(e){var t;this.arcRotateCamera.mode!=BABYLON.Camera.PERSPECTIVE_CAMERA?(t=(e.wheelDelta||24*-e.detail)<0?1.1:.9,this.frustrum*=t,this.computeCameraView()):(t=1e3/(this.app.CameraController.arcRotateCamera.radius/20),this.app.CameraController.arcRotateCamera.panningSensibility=2e3<t?2e3:t<10?10:t)}switchArcRotateCamera(){this.app.scene.activeCamera=this.arcRotateCamera,this.arcRotateCamera.attachControl(this.app.canvas,!0,!0),this.app.IEvent=new n(this.app)}switchFPSCamera(){this.app.IEvent=new s(this.app)}}class d{constructor(){this.map={}}add(e,t){this.map[e]=t}find(e){return this.map[e]}remove(e){delete this.map[e]}termRemove(e){for(var t in this.map)e(this.map[t])&&delete this.map[t]}showAll(){for(var e in this.map)this.map[e]}count(){var e,t=0;for(e in Object.keys(this.map))++t;return t}clear(){for(var e in this.map)delete this.map[e]}}class a{static getGUID(e){var t,i,n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),r=[],s=n.length;if(e)for(t=0;t<e;t++)r[t]=n[0|Math.random()*s];else for(r[8]=r[13]=r[18]=r[23]="-",r[14]="4",t=0;t<36;t++)r[t]||(i=0|16*Math.random(),r[t]=n[19==t?3&i|8:i]);return r.join("")}}class c{constructor(e){this.objectType="Light",this.app=e}load(){}}class h extends c{load(){this.light=new BABYLON.DirectionalLight(this.id,this.direction,this.app.scene),this.light.position=this.position,this.light.intensity=this.intensity,this.light.diffuse=BABYLON.Color3.FromHexString(this.color),this.light.specular=BABYLON.Color3.Black()}}class l extends c{load(){this.light=new BABYLON.HemisphericLight(this.id,this.direction,this.app.scene),this.light.intensity=this.intensity,this.light.diffuse=BABYLON.Color3.FromHexString(this.color),this.light.specular=BABYLON.Color3.Black()}}(t=r=r||{}).Point="Point",t.Spot="Spot",t.Directional="Directional",t.Hemispheric="Hemispheric";var f;class u extends c{load(){this.light=new BABYLON.PointLight(this.id,this.position.clone(),this.app.scene),this.light.range=this.range,this.light.intensity=this.intensity,this.light.diffuse=BABYLON.Color3.FromHexString(this.color),this.light.specular=BABYLON.Color3.Black()}}class g extends c{load(){this.light=new BABYLON.SpotLight(this.id,this.position.clone(),this.direction.clone(),this.angle*Math.PI/180,this.exponent,this.app.scene),this.light.range=this.range,this.light.position=this.position,this.light.intensity=this.intensity,this.light.diffuse=BABYLON.Color3.FromHexString(this.color),this.light.specular=BABYLON.Color3.Black()}}class m{constructor(e){this.isOK=!1,this.app=e,this.ele=document.createElement("div"),this.ele.style.cssText="position: absolute;z-index:999999999; font-size: 10px;color: rgb(211, 211, 211);text-shadow:rgba(0, 0, 0, 0.2) 1px 1px 0; padding: 5px 8px;",this.app.canvas.parentElement.appendChild(this.ele),this.close(),setInterval(()=>{var e;1e3<(new Date).getTime()-this.time&&this.isOK&&!this.text&&((e=this.app.Project.objectDatas.find(this.id))&&(this.text=e.name))},100)}set text(e){this._text=e,(this.ele.innerText=e)&&(this.ele.style.display=null)}update(e){e.pickInfo.pickedMesh?e.pickInfo.pickedMesh.id!=this.id?(this.close(),this.id=e.pickInfo.pickedMesh.id,this.time=(new Date).getTime()):this.isOK=!0:this.close(),this.ele.style.top=e.event.offsetY+"px",this.ele.style.left=e.event.offsetX+20+"px"}close(){this.isOK=!1,this.time=(new Date).getTime(),this.ele.style.display="none",this.text=""}setBackground(e){this.url=e,this.ele.style.background="url("+this.url+") no-repeat",this.ele.style.backgroundSize="cover"}dispose(){clearInterval(this.interval),this.app.canvas.parentElement.removeChild(this.ele),this.ele=null}}class v{constructor(e){this.lights=new d,this.reflexEnabled=!0,this.reflexIntensity=.5,this.app=e,this.color=new BABYLON.Color4(0,.0588,.1176,1),this.reflex(Oe.rl+"resources/environment.env",.5),this.app.scene.fogEnabled=!0,this.app.scene.fogMode=2,this.fogDistance=500,BABYLON.Effect.IncludesShadersStore.fogVertex=`
2
2
        #ifdef FOG
3
3
          vFogDistance=(worldPos).xyz;
4
4
        #endif
5
-     `}set fogDistance(e){this.app.scene.fogDensity=1/e}set color(e){this._color=new BABYLON.Color4(e.r,e.g,e.b,e.a),this.app.scene.clearColor=this._color,this.app.scene.fogColor=new BABYLON.Color3(...this._color.asArray())}reflex(e,t){e=new BABYLON.CubeTexture(e,this.app.scene);this.app.scene.environmentTexture=e,this.app.scene.environmentIntensity=t}setBackground(e){this.background&&this.background.dispose(),this.background=new BABYLON.Layer("background",e,this.app.scene),this.background.isBackground=!0}setReflexEnabled(e){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.reflexEnabled=e,this.app.scene.environmentIntensity=this.reflexEnabled?this.reflexIntensity:0,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}setFlexIntensity(e){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.reflexIntensity=e,this.app.scene.environmentIntensity=this.reflexIntensity,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}defaultLights(){let e=new c(this.app);e.id=o.getGUID(12),e.lightType="Hemispheric",e.name="半球光_"+this.lights.count(),e.direction=new BABYLON.Vector3(1,1,0),e.color="#FFFFFF",e.intensity=1,this.lights.add(e.id,e);let t=new c(this.app);t.id=o.getGUID(12),t.lightType="Hemispheric",t.name="半球光_"+this.lights.count(),t.direction=new BABYLON.Vector3(-1,1,0),t.color="#FFFFFF",t.intensity=.7,this.lights.add(t.id,t)}offAllLight(){for(const e in this.lights.map)this.lights.find(e).light&&(this.lights.find(e).light.intensity=0,this.app.scene.removeLight(this.lights.find(e).light),this.lights.find(e).light.dispose()),this.lights.find(e).light=null}openAllLight(){for(const e in this.lights.map)this.lights.find(e).load()}loadLight(i){for(let t=0;t<i.length;t++){var n=i[t];let e;n.lightType==r.Hemispheric?(e=new c(this.app),e.id=n.id,e.lightType=n.lightType,e.name=n.name,e.direction=p.ToVector3(n.direction),e.color=n.color,e.intensity=n.intensity):n.lightType==r.Directional?(e=new a(this.app),e.id=n.id,e.lightType=n.lightType,e.name=n.name,e.direction=p.ToVector3(n.direction),e.position=p.ToVector3(n.position),e.color=n.color,e.intensity=n.intensity):n.lightType==r.Spot?(e=new l(this.app),e.id=n.id,e.lightType=n.lightType,e.name=n.name,e.direction=p.ToVector3(n.direction),e.position=p.ToVector3(n.position),e.angle=n.angle,e.exponent=n.exponent,e.range=n.range,e.color=n.color,e.intensity=n.intensity):n.lightType==r.Point&&(e=new h(this.app),e.id=n.id,e.lightType=n.lightType,e.name=n.name,e.position=p.ToVector3(n.position),e.range=n.range,e.color=n.color,e.intensity=n.intensity),e&&this.lights.add(e.id,e)}this.lights.count()<1&&this.defaultLights(),this.openAllLight()}setLightIntensity(e=1){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;for(const t in this.lights.map)this.lights.find(t).light.intensity=this.lights.find(t).intensity*e;this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}showTips(){this.app.ToolTips=new u(this.app)}closeTips(){this.app.ToolTips&&this.app.ToolTips.dispose(),this.app.ToolTips=null}showFps(e="position: absolute;left: 5px;bottom: 5px;z-index:999999999; font-size: 10px;color: rgb(0, 255, 0);text-shadow:rgba(0, 0, 0, 0.2) 1px 1px 0;"){this.app.fps||(this.app.fps=document.createElement("div"),this.app.canvas.parentElement.appendChild(this.app.fps)),this.app.fps.style.cssText=e}hideFps(){this.app.fps&&this.app.canvas.parentElement.removeChild(this.app.fps),this.app.fps=null}showDebug(){this.app.scene.debugLayer.show()}}(t=g=g||{}).Region="Region",t.Cabinet="Cabinet",t.Corner="Corner",t.Other="Other",t.Door="Door",t.Floor="Floor",t.LeakWater="LeakWater",t.UI3D="UI3D",t.VirtualBox="VirtualBox",t.Wall="Wall",t.Window="Window",t.Conduit="Conduit";class v{constructor(e){this.objectDatas=new f,this.app=e}clear(){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;for(const e in this.objectDatas.map)this.objectDatas.find(e).instance&&this.objectDatas.find(e).instance.dispose();this.objectDatas.clear(),this.current=null,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}optimization(){this.app.scene.freezeActiveMeshes()}getChildsById(e=this.root.id,n=!1){e=e||this.root.id;let r=new Array;const s=e=>{for(const i in this.objectDatas.map){var t=this.objectDatas.find(i);t.parentId==e&&(r.push(t),n&&s(t.id))}};return s(e),r}getSceneTree(e=this.root.id,r=[]){e=e||this.root.id;const s=(e,i)=>{for(const t in this.objectDatas.map){var n=this.objectDatas.find(t);if(n.parentId==e){let t=!1;for(let e=0;e<r.length;e++)n.customType!=r[e]||(t=!0);t||(i.push({name:n.name,id:n.id,customNumber:n.customNumber,modelType:n.objectType,customType:n.customType,children:[]}),s(n.id,i[i.length-1].children))}}};e=this.objectDatas.find(e);if(e){e={name:e.name,id:e.id,customNumber:e.customNumber,modelType:e.objectType,customType:e.customType,children:[]};return s(this.root.id,e.children),e}console.error("指定的层级不存在")}findObjectById(e){return this.objectDatas.find(e)}findObjectByCustomNumber(e){let t=[];for(const n in this.objectDatas.map){var i=this.objectDatas.find(n);i.customNumber==e&&t.push(i)}return 0==t.length?null:(1<t.length&&console.log("存在编号重复对象,重复个数:"+t.length),t[0])}findObjectsByCustomType(t,i={isCurrent:!1,isEnabled:!1}){let n=[];for(const r in this.objectDatas.map){let e=this.objectDatas.find(r);e.customType==t&&(i.isCurrent&&e.parentId!=this.current.id||i.isEnabled&&1!=e.instance.isEnabled()||n.push(e))}return n}findObjectsByType(e){let t=new Array;for(const n in this.objectDatas.map){var i=this.objectDatas.find(n);i.objectType==e&&t.push(i)}return t}computeSight(i){var n=BABYLON.Vector3.Zero(),r=BABYLON.Vector3.Zero();for(let e=0;e<i.length;e++){let t=i[e];if(t.objectType!=g.Region){let e=t.instance.getBoundingInfo();n&&r||(n=r=e.boundingBox.center.clone()),n=BABYLON.Vector3.Minimize(n,e.minimum.add(t.instance.position)),r=BABYLON.Vector3.Maximize(r,e.maximum.add(t.instance.position))}}return n&&r||(n=BABYLON.Vector3.Zero(),r=new BABYLON.Vector3(12,0,8)),p.getVisualAngle(new BABYLON.BoundingInfo(n,r),this.app)}switchLevel(t=this.root.id,i=!1,n=!0){t=t||this.root.id;var r=this.objectDatas.find(t);if(r){let e=this.getChildsById(t,n);e.forEach(e=>e.setEnabled(!0)),this.current=r,i&&this.app.Camera.perspective(this.computeSight(e))}else console.error("对象不存在")}}class y{constructor(e){this.walls=new f,this.resources=new f,this.ndoeMats=new f,this.Materials=new f,this.Textures=new f,this.MergeMaterials=new f,this.app=e;e=o.getGUID(12);this.transparentBox=BABYLON.MeshBuilder.CreateBox(e,{size:1},this.app.scene),this.transparentBox.alwaysSelectAsActiveMesh=!0;let t=new BABYLON.StandardMaterial(e,this.app.scene);t.diffuseTexture=new BABYLON.Texture(ke.rl+"resources/white.jpg",this.app.scene,!0,!1),t.alphaMode=BABYLON.Engine.ALPHA_COMBINE,t.emissiveColor=BABYLON.Color3.Green(),this.transparentBox.material=t,this.transparentBox.setEnabled(!1),this.transparentBox.visibility=.3;e=o.getGUID(12);this.BOX=BABYLON.MeshBuilder.CreateBox(e,{size:1},this.app.scene),this.BOX.edgesColor=BABYLON.Color4.FromHexString("#4ba3fff2"),this.BOX.setEnabled(!1),this.BOX.visibility=0,this.FogTex=new BABYLON.Texture(ke.rl+"resources/fogtex.png",this.app.scene,!0,!1)}async loadModelMesh(t){let i=this.resources.find(t.modelId);if(!i)try{i=await BABYLON.SceneLoader.LoadAssetContainerAsync(ke.rl+"bundle/"+t.modelId+"/",t.modelId+t.extension,this.app.scene),0<i.animationGroups.length&&i.animationGroups[0].stop(),i.addAllToScene(),i.meshes[0].setEnabled(!1),i.meshes[0].getChildMeshes().forEach(e=>{e.metadata&&e.metadata.gltf&&e.metadata.gltf.extras&&(i.isExtras=!0,e.metadata.gltf.extras.U&&BABYLON.Animation.CreateAndStartAnimation("u",e.material.albedoTexture,"uOffset",30*e.metadata.gltf.extras.Uspeed,30,0,1,1),e.metadata.gltf.extras.V&&BABYLON.Animation.CreateAndStartAnimation("v",e.material.albedoTexture,"vOffset",30*e.metadata.gltf.extras.Vspeed,30,0,1,1))}),i.isExtras||i.meshes[0].getChildMeshes().forEach(e=>{e.registerInstancedBuffer("color",4),e.instancedBuffers.color=new BABYLON.Color4(1,1,1,1)}),this.resources.add(t.modelId,i)}catch(e){console.error("模型下载失败!模型编号:"+t.modelId+";错误信息:"+e)}return i}loadModelMeshAsync(t,i){var e=this.resources.find(t.modelId);e?i(e):BABYLON.SceneLoader.LoadAssetContainerAsync(ke.rl+"bundle/"+t.modelId+"/",t.modelId+t.extension,this.app.scene).then(e=>{0<e.animationGroups.length&&e.animationGroups[0].stop(),this.resources.add(t.modelId,e),i(e)}).catch(()=>{console.error("模型下载失败!模型编号:"+t.modelId)})}GetMaterial(e,t){let i=this.Materials.find(e.modelId);var n;return void 0===i&&(n=this.GetTexture(e,t),i=new BABYLON.StandardMaterial(e.modelId,t),i.alphaMode=BABYLON.Engine.ALPHA_COMBINE,i.diffuseTexture=n,this.Materials.add(e.modelId,i)),i}GetTexture(e,t){let i=this.Textures.find(e.modelId);return void 0===i&&(i=new BABYLON.Texture(ke.rl+"texture/"+e.modelId+e.extension,t,!1),".png"==e.extension&&(i.hasAlpha=!0),this.Textures.add(e.modelId,i)),i}GetMergeMaterial(t,i){let n=this.MergeMaterials.find(t.modelId);if(void 0===n){n=new BABYLON.CustomMaterial(t.modelId,i),n.alphaMode=2,this.MergeMaterials.add(t.modelId,n),n.AddUniform("textureData","sampler2D",null),n.Vertex_Definitions(`
5
+     `}set fogDistance(e){this.app.scene.fogDensity=1/e}set color(e){this._color=new BABYLON.Color4(e.r,e.g,e.b,e.a),this.app.scene.clearColor=this._color,this.app.scene.fogColor=new BABYLON.Color3(...this._color.asArray())}reflex(e,t){e=new BABYLON.CubeTexture(e,this.app.scene);this.app.scene.environmentTexture=e,this.app.scene.environmentIntensity=t}setBackground(e){this.background&&this.background.dispose(),this.background=new BABYLON.Layer("background",e,this.app.scene),this.background.isBackground=!0}setReflexEnabled(e){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.reflexEnabled=e,this.app.scene.environmentIntensity=this.reflexEnabled?this.reflexIntensity:0,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}setFlexIntensity(e){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.reflexIntensity=e,this.app.scene.environmentIntensity=this.reflexIntensity,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}defaultLights(){let e=new l(this.app);e.id=a.getGUID(12),e.lightType="Hemispheric",e.name="半球光_"+this.lights.count(),e.direction=new BABYLON.Vector3(1,1,0),e.color="#FFFFFF",e.intensity=1,this.lights.add(e.id,e);let t=new l(this.app);t.id=a.getGUID(12),t.lightType="Hemispheric",t.name="半球光_"+this.lights.count(),t.direction=new BABYLON.Vector3(-1,1,0),t.color="#FFFFFF",t.intensity=.7,this.lights.add(t.id,t)}offAllLight(){for(const e in this.lights.map)this.lights.find(e).light&&(this.lights.find(e).light.intensity=0,this.app.scene.removeLight(this.lights.find(e).light),this.lights.find(e).light.dispose()),this.lights.find(e).light=null}openAllLight(){for(const e in this.lights.map)this.lights.find(e).load()}loadLight(i){for(let t=0;t<i.length;t++){var n=i[t];let e;n.lightType==r.Hemispheric?(e=new l(this.app),e.id=n.id,e.lightType=n.lightType,e.name=n.name,e.direction=p.ToVector3(n.direction),e.color=n.color,e.intensity=n.intensity):n.lightType==r.Directional?(e=new h(this.app),e.id=n.id,e.lightType=n.lightType,e.name=n.name,e.direction=p.ToVector3(n.direction),e.position=p.ToVector3(n.position),e.color=n.color,e.intensity=n.intensity):n.lightType==r.Spot?(e=new g(this.app),e.id=n.id,e.lightType=n.lightType,e.name=n.name,e.direction=p.ToVector3(n.direction),e.position=p.ToVector3(n.position),e.angle=n.angle,e.exponent=n.exponent,e.range=n.range,e.color=n.color,e.intensity=n.intensity):n.lightType==r.Point&&(e=new u(this.app),e.id=n.id,e.lightType=n.lightType,e.name=n.name,e.position=p.ToVector3(n.position),e.range=n.range,e.color=n.color,e.intensity=n.intensity),e&&this.lights.add(e.id,e)}this.lights.count()<1&&this.defaultLights(),this.openAllLight()}setLightIntensity(e=1){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;for(const t in this.lights.map)this.lights.find(t).light.intensity=this.lights.find(t).intensity*e;this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}showTips(){this.app.ToolTips=new m(this.app)}closeTips(){this.app.ToolTips&&this.app.ToolTips.dispose(),this.app.ToolTips=null}showFps(e="position: absolute;left: 5px;bottom: 5px;z-index:999999999; font-size: 10px;color: rgb(0, 255, 0);text-shadow:rgba(0, 0, 0, 0.2) 1px 1px 0;"){this.app.fps||(this.app.fps=document.createElement("div"),this.app.canvas.parentElement.appendChild(this.app.fps)),this.app.fps.style.cssText=e}hideFps(){this.app.fps&&this.app.canvas.parentElement.removeChild(this.app.fps),this.app.fps=null}showDebug(){this.app.scene.debugLayer.show()}}(t=f=f||{}).Region="Region",t.Cabinet="Cabinet",t.Corner="Corner",t.Other="Other",t.Door="Door",t.Floor="Floor",t.LeakWater="LeakWater",t.UI3D="UI3D",t.VirtualBox="VirtualBox",t.Wall="Wall",t.Window="Window",t.Conduit="Conduit";var y,b,t=i(5),w=i.n(t);class _{static init(){let e=new w.a.Tween(this.colors[1]).to({r:1,g:0,b:0},500),t=new w.a.Tween(this.colors[1]).to({r:1,g:.5,b:.5},500);t.chain(e),e.chain(t),e.start();let i=new w.a.Tween(this.colors[2]).to({r:1,g:.55,b:0},500),n=new w.a.Tween(this.colors[2]).to({r:0,g:0,b:0},500);i.chain(n),n.chain(i),i.start();let r=new w.a.Tween(this.colors[3]).to({r:1,g:.84,b:0},500),s=new w.a.Tween(this.colors[3]).to({r:0,g:0,b:0},500);r.chain(s),s.chain(r),r.start();let o=new w.a.Tween(this.colors[4]).to({r:0,g:.75,b:1},500),a=new w.a.Tween(this.colors[4]).to({r:0,g:0,b:0},500);o.chain(a),a.chain(o),o.start();let c=new w.a.Tween(this.colors[5]).to({r:.53,g:.8,b:0},500),h=new w.a.Tween(this.colors[5]).to({r:0,g:0,b:0},500);c.chain(h),h.chain(c),c.start();let l=new w.a.Tween(this.colors[6]).to({r:.8,g:.8,b:.8},500),u=new w.a.Tween(this.colors[6]).to({r:0,g:0,b:0},500);l.chain(u),u.chain(l),l.start()}}_.colors={1:BABYLON.Color3.Red(),2:new BABYLON.Color3(1,.5,0),3:BABYLON.Color3.Yellow(),4:new BABYLON.Color3(0,1,1),5:BABYLON.Color3.Green(),6:BABYLON.Color3.Gray()},(t=y=y||{})[t.Opaque=0]="Opaque",t[t.Flash=1]="Flash",t[t.Transparent=2]="Transparent",(t=b=b||{}).leftClick="leftClick",t.rightClick="rightClick",t.doubleClick="doubleClick",t.eover="eover",t.longPress="longPress",t.out="out";class A{toJosn(e){e=JSON.parse(e);this.alpha=e.alpha,this.beta=e.beta,this.radius=e.radius,this.minimumLimit=e.minimumLimit,this.maximumLimit=e.maximumLimit,this.minBeta=e.minBeta,this.maxBeta=e.maxBeta,this.focus=p.ToVector3(e.focus)}toString(){return JSON.stringify({alpha:this.alpha,focus:p.vector3ToJson(this.focus),radius:this.radius,beta:this.beta,minimumLimit:this.minimumLimit,maximumLimit:this.maximumLimit,minBeta:this.minBeta,maxBeta:this.maxBeta})}setLimit(e,t){this.minimumLimit=e+.3,this.maximumLimit=t}setBeta(e,t){this.minBeta=e,this.maxBeta=t}}class B{constructor(e){this.executes=new d,this.clickEvents=new d,this.touchtime=(new Date).getTime(),this.effectType=y.Opaque,this.app=e}setEnabled(e){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.setEnabled(e),e?(this.instance.isPickable=0<this.executes.count(),this.executes.find(b.eover)||this.executes.find(b.out)?this.instance.enablePointerMoveEvents=!0:this.instance.enablePointerMoveEvents=!1):(this.instance.isPickable=!1,this.instance.enablePointerMoveEvents=!1),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}set showBoundingBox(e){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.showBoundingBox=e,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}get showBoundingBox(){return this.instance.showBoundingBox}bind(e){this.id=e.id,this.name=e.name,this.customNumber=e.customNumber,this.customType=e.customType,this.parentId=e.parentId,this.modelId=e.baseModel.modelId,this.animation=e.animation,this.isAutoPlay=e.isAutoPlay,this.isloop=e.isloop,this.objectType=f.Other;let t=new BABYLON.Mesh(this.id,this.app.scene),i=this.app.Resources.resources.find(this.modelId);i.meshes[0].getChildMeshes().forEach(e=>{e=e.createInstance(this.id);e.isPickable=!1,e.enablePointerMoveEvents=!1,e.parent=t}),t.rotation=p.ToVector3(e.rotation),t.position=p.ToVector3(e.position),t.scaling=p.ToVector3(e.scaling);e=p.computeBounds(t);t.setBoundingInfo(e),this.instance=this.app.Resources.BOX.clone(this.id),this.instance.id=this.id,this.instance.enablePointerMoveEvents=!1,this.instance.isPickable=!1,this.instance.scaling=new BABYLON.Vector3((e.maximum.x-e.minimum.x)*t.scaling.x,(e.maximum.y-e.minimum.y)*t.scaling.y,(e.maximum.z-e.minimum.z)*t.scaling.z),0==this.instance.scaling.y&&(this.instance.scaling.y=.01),this.instance.position=t.position.clone(),this.instance.position.y=(e.maximum.y-e.minimum.y)/2+t.position.y,this.instance.rotation=t.rotation.clone(),t.setParent(this.instance),this.alwaysActive(),this.optimization(!0),this.instance.setEnabled(!1),this.computeView()}computeView(){this.Sight=new A;var e=this.instance.getBoundingInfo(),t=p.getVisualAngle(e,this.app);this.Sight.alpha=t.alpha,this.Sight.beta=t.beta,this.Sight.focus=this.instance.getAbsolutePosition(),this.Sight.radius=e.boundingSphere.radiusWorld+3,this.Sight.minimumLimit=.3,this.Sight.maximumLimit=2*this.Sight.radius,this.Sight.minBeta=.01,this.Sight.maxBeta=Math.PI/2*.98}optimization(t){this.instance.getChildMeshes().forEach(e=>{t?e.freezeWorldMatrix():e.unfreezeWorldMatrix()}),t?this.instance.freezeWorldMatrix():this.instance.unfreezeWorldMatrix(),this.instance.material&&(t?this.instance.material.freeze():this.instance.material.unfreeze())}alwaysActive(){this.instance.getChildMeshes().forEach(e=>{e.alwaysSelectAsActiveMesh=!0,e.doNotSyncBoundingInfo=!1,e.ignoreNonUniformScaling=!0}),this.instance.alwaysSelectAsActiveMesh=!0,this.instance.doNotSyncBoundingInfo=!1}addEventListener(e,t){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;let i=null;var n;e==b.leftClick||e==b.rightClick?(this.clickEvents.remove(e),this.clickEvents.add(e,t),this.instance.isPickable=!0,i=new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPickTrigger,e=>{let t=this.clickEvents.find(b.leftClick);t&&0==e.sourceEvent.button&&t(this,e);let i=this.clickEvents.find(b.rightClick);i&&2==e.sourceEvent.button&&i(this,e),this.touchtime=(new Date).getTime()}),e="click"):e==b.doubleClick?i=new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnDoublePickTrigger,e=>t(this,e)):e==b.eover?(i=new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPointerOverTrigger,e=>t(this,e)),this.instance.enablePointerMoveEvents=!0):e==b.longPress?i=new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnLongPressTrigger,e=>t(this,e)):e==b.out&&(i=new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPointerOutTrigger,e=>t(this,e)),this.instance.enablePointerMoveEvents=!0),i&&(this.action||(this.action=new BABYLON.ActionManager(this.app.scene),this.instance.actionManager=this.action),(n=this.executes.find(e))&&this.action.unregisterAction(n),this.executes.remove(e),this.executes.add(e,i),this.action.registerAction(i)),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}removeEventListener(e){if(e==b.leftClick||e==b.rightClick||e==b.doubleClick){if(this.clickEvents.remove(e),0<this.clickEvents.count())return;e="click"}this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;var t=this.executes.find(e);t&&this.action.unregisterAction(t),this.executes.remove(e),0==this.executes.count()&&(this.action=null,this.instance.actionManager=this.action),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}setFlash(t){this.effectType==y.Opaque&&(this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.getChildMeshes().forEach(e=>{e.instancedBuffers&&(e.instancedBuffers.color=_.colors[t])}),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,this.effectType=y.Flash)}setOpaque(){this.effectType!=y.Opaque&&(this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.getChildMeshes().forEach(e=>{e.setEnabled(!0),e.instancedBuffers&&(e.instancedBuffers.color=new BABYLON.Color4(1,1,1,1))}),this.instance.disableEdgesRendering(),this.instance.visibility=0,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,this.effectType=y.Opaque)}setTransparent(e=.3){this.effectType==y.Opaque&&(this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.getChildMeshes().forEach(e=>e.setEnabled(!1)),this.instance.visibility=e,this.instance.enableEdgesRendering(),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,this.effectType=y.Transparent)}play(){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.getChildMeshes().forEach(t=>{let i;t.animations.forEach(e=>{-1!=e.name.indexOf("open")&&(i=e)}),i?this.app.scene.beginDirectAnimation(t,[i],0,10*i.getKeys().length,this.isloop):t.animations.forEach(e=>this.app.scene.beginDirectAnimation(t,[e],0,10*e.getKeys().length,this.isloop))}),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}stop(){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.getChildMeshes().forEach(t=>{let i;t.animations.forEach(e=>{-1!=e.name.indexOf("close")&&(i=e)}),i?this.app.scene.beginDirectAnimation(t,[i],0,10*i.getKeys().length,!1):t.animations.forEach(e=>this.app.scene.beginDirectAnimation(t,[e],10*e.getKeys().length,0,!1))}),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}}class C extends B{constructor(){super(...arguments),this.baseModel=null}bind(e){this.id=a.getGUID(12),this.objectType=f.Wall,this.name="墙体",this.instance=Oe.Tools.MergeMeshes(e.walls,this.app),this.instance.setEnabled(!1),this.instance.receiveShadows=!0,e.t&&""!=e.t?(this.modelId=e.t.modelId,this.baseModel=e.t,this.baseModel.length||(this.baseModel.length=3.1),this.nativeMaterial=this.app.Resources.GetMergeMaterial(e.t,this.app.scene)):this.nativeMaterial=null,this.instance.material=this.nativeMaterial,this.instance.id=this.id,this.instance.name=this.id,this.instance.isPickable=!1,this.instance.enablePointerMoveEvents=!1,this.instance.position.y=this.height,this.alwaysActive(),this.optimization(!0)}}class x extends B{bind(e){this.id=e.id,this.name=e.name,this.customNumber=e.customNumber,this.customType=e.customType,this.parentId=e.parentId,this.modelId=e.baseModel.modelId,this.height=e.baseModel.height,this.objectType=f.Window,this.instance=new BABYLON.Mesh(this.id,this.app.scene);let t=this.app.Resources.resources.find(this.modelId);t.meshes[0].getChildMeshes().forEach(e=>{e.createInstance(this.id).parent=this.instance});var i=p.computeBounds(this.instance);this.instance.rotation=p.ToVector3(e.rotation),this.instance.position=p.ToVector3(e.position),this.Sight=p.getVisualAngle(i,this.app);let n=this.app.Resources.BOX.createInstance(this.id);n.setBoundingInfo(i),n.enablePointerMoveEvents=!1,n.isPickable=!1,n.scaling=new BABYLON.Vector3((i.maximum.x-i.minimum.x)*this.instance.scaling.x,(i.maximum.y-i.minimum.y)*this.instance.scaling.y,(i.maximum.z-i.minimum.z)*this.instance.scaling.z),n.position=this.instance.position.clone(),n.position.y=(i.maximum.y-i.minimum.y)/2+this.instance.position.y,n.rotation=this.instance.rotation.clone(),this.instance.getChildMeshes().forEach(e=>e.setParent(n)),this.instance.dispose(),this.instance=n,this.alwaysActive(),this.optimization(!0),this.instance.setEnabled(!1),this.computeView()}}class E extends B{bind(e){this.id=e.id,this.name=e.name,this.customNumber=e.customNumber,this.customType=e.customType,this.parentId=e.parentId,this.modelId=e.baseModel.modelId,this.height=e.baseModel.height,this.objectType=f.Door,this.instance=new BABYLON.Mesh(this.id,this.app.scene);let t=this.app.Resources.resources.find(this.modelId);t.meshes[0].getChildMeshes().forEach(e=>{e.createInstance(this.id).parent=this.instance});var i=p.computeBounds(this.instance);this.instance.rotation=p.ToVector3(e.rotation),this.instance.position=p.ToVector3(e.position);let n=this.app.Resources.BOX.createInstance(this.id);n.setBoundingInfo(i),n.enablePointerMoveEvents=!1,n.isPickable=!1,n.scaling=new BABYLON.Vector3((i.maximum.x-i.minimum.x)*this.instance.scaling.x,(i.maximum.y-i.minimum.y)*this.instance.scaling.y,(i.maximum.z-i.minimum.z)*this.instance.scaling.z),n.position=this.instance.position.clone(),n.position.y=(i.maximum.y-i.minimum.y)/2+this.instance.position.y,n.rotation=this.instance.rotation.clone(),this.instance.getChildMeshes().forEach(e=>e.setParent(n)),this.instance.dispose(),this.instance=n,this.alwaysActive(),this.optimization(!0),this.instance.setEnabled(!1),this.computeView()}}class S extends B{computeView(){this.objectType=f.Cabinet,this.Sight=new A;var e=this.instance.getBoundingInfo(),t=p.getVisualAngle(e,this.app);this.Sight.alpha=t.alpha,this.Sight.beta=t.beta,this.Sight.focus=this.instance.getAbsolutePosition(),this.Sight.radius=e.boundingSphere.radiusWorld+3,this.Sight.minimumLimit=.3,this.Sight.maximumLimit=2*this.Sight.radius,this.Sight.minBeta=.01,this.Sight.maxBeta=Math.PI/2*.98}}class T extends B{bind(e){let t=p.ToARRVector3(e.lines);this.Sight.focus=t[0].clone(),this.instance=p.createTube(e.id,t,.02,this.app),this.instance.setEnabled(!1),this.id=e.id,this.name=e.name,this.customNumber=e.customNumber,this.customType=e.customType,this.parentId=e.parentId,this.modelId=e.baseModel.modelId,this.objectType=f.LeakWater;e=this.app.Resources.GetMaterial(e.baseModel,this.app.scene).clone(this.id);BABYLON.Animation.CreateAndStartAnimation("u",e.diffuseTexture,"vOffset",15,30,0,1,1),e.diffuseTexture.vScale=this.instance.getTotalVertices()/50,this.instance.material=e,this.alwaysActive(),this.computeView()}computeView(){this.Sight=new A;var e=this.instance.getBoundingInfo(),t=p.getVisualAngle(e,this.app);this.Sight.alpha=t.alpha,this.Sight.beta=t.beta,this.Sight.radius=e.boundingSphere.radiusWorld+3,this.Sight.minimumLimit=.3,this.Sight.maximumLimit=2*this.Sight.radius,this.Sight.minBeta=.01,this.Sight.maxBeta=Math.PI/2*.98}addEventListener(e,t){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;let i=null;var n;e==b.leftClick||e==b.rightClick||e==b.doubleClick?(this.clickEvents.remove(e),this.clickEvents.add(e,t),this.instance.isPickable=!0,i=new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPickTrigger,e=>{let t=this.clickEvents.find(b.leftClick);t&&0==e.sourceEvent.button&&t(this,e);let i=this.clickEvents.find(b.rightClick);i&&2==e.sourceEvent.button&&i(this,e);let n=this.clickEvents.find(b.doubleClick);n&&0==e.sourceEvent.button&&(new Date).getTime()-this.touchtime<500&&n(this,e),this.touchtime=(new Date).getTime()}),e="click"):e==b.eover?(i=new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPointerOverTrigger,e=>t(this,e)),this.instance.enablePointerMoveEvents=!0):e==b.longPress?i=new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnLongPressTrigger,e=>t(this,e)):e==b.out&&(i=new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPointerOutTrigger,e=>t(this,e)),this.instance.enablePointerMoveEvents=!0),i&&(this.action||(this.action=new BABYLON.ActionManager(this.app.scene),this.instance.actionManager=this.action),(n=this.executes.find(e))&&this.action.unregisterAction(n),this.executes.remove(e),this.executes.add(e,i),this.action.registerAction(i)),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}removeEventListener(e){if(e==b.leftClick||e==b.rightClick||e==b.doubleClick){if(this.clickEvents.remove(e),0<this.clickEvents.count())return;e="click"}this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;var t=this.executes.find(e);t&&this.action.unregisterAction(t),this.executes.remove(e),0==this.executes.count()&&(this.action=null,this.instance.actionManager=this.action,this.instance.getChildMeshes().forEach(e=>e.actionManager=this.action)),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}}class M extends B{async bind(e){this.id=e.id,this.name=e.name,this.customNumber=e.customNumber,this.customType=e.customType,this.parentId=e.parentId,this.objectType=f.VirtualBox,"Cylinder"==e.virtualType?this.instance=BABYLON.MeshBuilder.CreateCylinder(this.id,{height:1,diameterTop:1,diameterBottom:1},this.app.scene):this.instance=BABYLON.MeshBuilder.CreateBox(this.id,{size:1},this.app.scene),this.instance.setEnabled(!1),this.instance.id=this.id;let t=new BABYLON.StandardMaterial(this.id,this.app.scene);t.diffuseColor=BABYLON.Color3.FromHexString(e.color),e.alpha<.98&&(t.alpha=e.alpha,t.alphaMode=2,t.useAlphaFromDiffuseTexture=!0),this.instance.material=t,e.isEdges&&(this.instance.enableEdgesRendering(),this.instance.edgesWidth=1,this.instance.edgesColor=new BABYLON.Color4(0,1,1,1)),e.edgesWidth&&0<e.edgesWidth&&(this.instance.enableEdgesRendering(),this.instance.edgesWidth=e.edgesWidth,this.instance.edgesColor=BABYLON.Color3.FromHexString(e.edgesColor).toColor4(1)),this.instance.enablePointerMoveEvents=!1,this.instance.isPickable=!1,this.instance.rotation=Oe.Tools.ToVector3(e.rotation),this.instance.position=Oe.Tools.ToVector3(e.position),this.instance.scaling=Oe.Tools.ToVector3(e.scaling),this.alwaysActive(),this.optimization(!0),this.computeView()}}class k extends B{bind(e){this.id=e.id,this.name=e.name,this.customNumber=e.customNumber,this.customType=e.customType,this.parentId=e.parentId,this.objectType=f.UI3D;let t={};t.color=e.color,e.size?(t.clearColor=null,t.position=Oe.Tools.ToVector3(e.position),r=Oe.Tools.ToVector3(e.rotation),t.rotation=new BABYLON.Vector3(r.x+Math.PI,r.y,r.z),i=Number.parseInt(e.size.replace("px",""))/40,r=e.scaling?Oe.Tools.ToVector3(e.scaling):BABYLON.Vector3.One(),t.scaling=new BABYLON.Vector3(14*i/50*r.x,1,14*i/50*r.z)):(t.clearColor=e.clearColor,t.position=Oe.Tools.ToVector3(e.position),t.rotation=Oe.Tools.ToVector3(e.rotation),t.scaling=Oe.Tools.ToVector3(e.scaling));var i="bold 100px Arial";let n=new BABYLON.DynamicTexture(this.id,64,this.app.scene,!1);var r=n.getContext();r.font=i;e=r.measureText(this.name).width+8,r=.02*e;n=new BABYLON.DynamicTexture(this.id,{width:e,height:150},this.app.scene,!1);e=new BABYLON.StandardMaterial(this.id,this.app.scene);e.backFaceCulling=!1,e.diffuseTexture=n,t.clearColor||(n.hasAlpha=!0),n.drawText(this.name,null,null,i,t.color,t.clearColor,!1),this.instance=BABYLON.Mesh.CreateGround(this.id,r,3,1,this.app.scene),this.instance.setEnabled(!1),this.instance.scaling=t.scaling,this.instance.position=t.position,this.instance.rotation=t.rotation,this.instance.material=e,this.alwaysActive(),this.optimization(!0),this.computeView()}}class O extends B{bind(e){this.id=e.id,this.name=e.name,this.customNumber=e.customNumber,this.customType=e.customType,this.parentId=e.parentId,this.objectType=f.Conduit,this.color=e.color,this.instance=new BABYLON.Mesh(this.id);var t=p.ToARRVector3(e.pints);let i=p.createTube(e.id,t,e.radius,this.app);this.instance.position=i.getBoundingInfo().boundingBox.center.clone(),this.instance.addChild(i),e.rotation&&(this.instance.rotation=p.ToVector3(e.rotation)),e.position&&(this.instance.position=p.ToVector3(e.position)),i.setParent(this.instance.parent),this.instance.dispose(),this.instance=i;let n=new BABYLON.StandardMaterial(e.id,this.app.scene);n.diffuseColor=BABYLON.Color3.FromHexString(e.color),n.alpha=e.alpha,this.alpha=e.alpha,this.instance.material=n,this.instance.enablePointerMoveEvents=!1,this.instance.isPickable=!1,this.instance.setEnabled(!1),this.alwaysActive(),this.optimization(!0),this.computeView()}setColor(e,t,i){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.optimization(!1),this.instance.material.diffuseColor=new BABYLON.Color3(e/255,i/255,t/255),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}reColor(){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.optimization(!1),this.instance.material.diffuseColor=BABYLON.Color3.FromHexString(this.color),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}computeView(){this.Sight=new A;var e=this.instance.getBoundingInfo(),e=p.getVisualAngle(e,this.app);this.alpha=e.alpha,this.Sight.beta=e.beta,this.Sight.focus=e.focus,this.Sight.radius=e.radius,this.Sight.minimumLimit=.3,this.Sight.maximumLimit=2*this.Sight.radius,this.Sight.minBeta=.01,this.Sight.maxBeta=Math.PI/2*.98}setFlash(e=1){this.effectType==y.Opaque&&(this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.optimization(!1),this.instance.material.emissiveColor=_.colors[e],this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,this.effectType=y.Flash)}setOpaque(){this.effectType!=y.Opaque&&(this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.optimization(!0),this.instance.material.alpha=this.alpha,this.instance.material.emissiveColor=null,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,this.effectType=y.Opaque)}setTransparent(e=.3){this.effectType==y.Opaque&&(this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.optimization(!1),this.instance.material.alpha=e,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,this.effectType=y.Transparent)}}class R extends B{bind(e){this.id=e.id,this.name=e.name,this.customNumber=e.customNumber,this.customType=e.customType,this.parentId=e.parentId,this.modelId=e.baseModel.modelId,this.objectType=f.Floor,this.instance=BABYLON.MeshBuilder.CreatePolygon("地板",{shape:p.Expand(e.vectors,-.01),holes:e.buckles,sideOrientation:BABYLON.Mesh.DOUBLESIDE},this.app.scene),this.alwaysActive(),this.instance.setEnabled(!1),this.instance.isPickable=!1,this.instance.enablePointerMoveEvents=!1,this.instance.position.y=this.height-.01,this.instance.id=e.id,this.instance.name="地板";var t=this.app.Resources.GetMaterial(e.baseModel,this.app.scene).clone(e.id),i=this.instance.getBoundingInfo();this.Sight=p.getVisualAngle(i,this.app),e.baseModel.isTiling&&(t.diffuseTexture.uScale=(i.maximum.x-i.minimum.x)/e.baseModel.width,t.diffuseTexture.vScale=(i.maximum.z-i.minimum.z)/e.baseModel.length),this.instance.material=t,this.optimization(!0),this.computeView()}}class L extends B{bind(i){let e=!1;this.id=a.getGUID(12),this.name="墙角",this.objectType=f.Corner;let n=new Array;for(let t=0;t<i.length;t++)if(2<i[t].pints.length){let e=BABYLON.MeshBuilder.CreatePolygon(this.id,{shape:i[t].pints,sideOrientation:BABYLON.Mesh.FRONTSIDE},this.app.scene);e.setEnabled(!1),e.position.y=i[t].height,e.isPickable=!0,e.enablePointerMoveEvents=!1,n.push(e)}return n.length<1||(1<n.length?this.instance=p.MergeMeshes(n,this.app):this.instance=n[0],this.instance.id=this.id,this.instance.name=this.id,this.instance.position.y=this.height,this.instance.setEnabled(!1),this.instance.isPickable=!1,this.instance.enablePointerMoveEvents=!1,this.alwaysActive(),this.optimization(!0),e=!0),e}}class P extends B{constructor(e,t){super(e),this.height=0,this.id=t.id,this.objectType=t.objectType,this.customNumber=t.customNumber,this.customType=t.customType,this.name=t.name,this.parentId=t.parentId,this.height=t.height,this.index=t.index}bind(r,e=0){let o=new Array;for(let t=0;t<r.length;t++){let e=r[t];e.objectType==f.Wall&&(e.height||(e.height=3.1),e.ply||(e.ply=.09),o.push(e))}let s=new d;for(let e=0;e<r.length;e++){let i=r[e];i.objectType==f.Corner&&(s.add(i.id,i.corner),2<i.pints.length&&(i.height=3.1,i.walls.forEach(t=>{o.forEach(e=>{t==e.id&&parseFloat(e.height)<i.height&&(i.height=parseFloat(e.height))})})))}{let t=new Array;for(let e=0;e<r.length;e++){var i=r[e];i.objectType==f.Corner&&t.push(i)}let e=new L(this.app);e.height=this.height,e.bind(t)?(e.parentId=this.id,this.app.Project.objectDatas.add(e.id,e)):e=null}for(let i=0;i<r.length;i++){let n=r[i];if(n.objectType==f.Floor){n.vectors=new Array;let e=r[i];e.pints.forEach(e=>{s.find(e)||console.log(e),n.vectors.push(s.find(e))}),n.buckles=new Array,e.holes&&e.holes.forEach(e=>{let t=new Array;e.forEach(e=>t.push(s.find(e))),n.buckles.push(t)}),e.middles&&e.middles.forEach(t=>{let i=Array();for(let e=0;e<r.length;e++)r[e].id==t&&r[e].pints.forEach(e=>{e=s.find(e);i.push(new BABYLON.Vector3(e.x,0,e.z))});n.buckles.push(i)});let t=new R(this.app);t.height=this.height,t.bind(n),this.app.Project.objectDatas.add(t.id,t)}}s=null;for(let t=0;t<r.length;t++){var n=r[t];let e;if(n.objectType==f.Window)e=new x(this.app);else if(n.objectType==f.Door)e=new E(this.app);else if(n.objectType==f.Cabinet)e=new S(this.app);else if(n.objectType==f.LeakWater)e=new T(this.app);else if(n.objectType==f.VirtualBox)e=new M(this.app);else if(n.objectType==f.UI3D)e=new k(this.app);else if(n.objectType==f.Conduit)e=new O(this.app);else{if(n.objectType==f.Wall)continue;if(n.objectType==f.Corner)continue;if(n.objectType==f.Floor)continue;e=new B(this.app)}e.bind(n),this.app.Project.objectDatas.add(e.id,e)}{let s=new d;s.add("body",{t:"",walls:new Array});for(let r=0;r<o.length;r++){let n=BABYLON.MeshBuilder.ExtrudePolygon(o[r].id,{shape:[p.ToVector3(o[r].wtop),p.ToVector3(o[r].wleft),p.ToVector3(o[r].wbottom),p.ToVector3(o[r].wright)],depth:parseFloat(o[r].height),sideOrientation:BABYLON.Mesh.FRONTSIDE},this.app.scene);n.setEnabled(!1),n.position.y=parseFloat(o[r].height),n.subMeshes=[];var a=n.getTotalVertices();n.subMeshes.push(new BABYLON.SubMesh(0,0,a,0,6,n)),n.subMeshes.push(new BABYLON.SubMesh(0,1,a,18,6,n)),n.subMeshes.push(new BABYLON.SubMesh(0,2,a,30,6,n));for(let i=0;i<o[r].wallwindows.length;i++){const u=BABYLON.CSG.FromMesh(n);let e=this.app.Project.objectDatas.find(o[r].wallwindows[i]);var c=e.instance.getBoundingInfo(),h=BABYLON.MeshBuilder.CreateBox((new Date).getTime().toString(),{height:c.maximum.y-c.minimum.y,width:c.maximum.x-c.minimum.x,depth:2*parseFloat(o[r].ply)+.1},this.app.scene);h.position=e.instance.position.clone(),h.position.y=(c.maximum.y-c.minimum.y)/2+e.height,h.rotation=e.instance.rotation.clone();c=BABYLON.CSG.FromMesh(h);let t=u.subtract(c);h.dispose(),n.dispose(),n=t.toMesh(o[r].id,null,this.app.scene,!0),n.setEnabled(!1)}let t=s.find(o[r].leftMap.modelId);t||(t={t:o[r].leftMap,walls:new Array},s.add(o[r].leftMap.modelId,t));let i=s.find(o[r].rightMap.modelId);i||(i={t:o[r].rightMap,walls:new Array},s.add(o[r].rightMap.modelId,i));var l=p.DeconsTructMesh(n,parseFloat(o[r].height),this.app);for(let e=0;e<l.length;e++)(2==e||3==e?t:4==e||5==e?i:s.find("body")).walls.push(l[e])}for(const t in s.map)if(0<s.find(t).walls.length){let e=new C(this.app);e.parentId=this.id,e.height=this.height,e.bind(s.find(t)),this.app.Project.objectDatas.add(e.id,e)}}o=null,this.computeView()}computeView(){this.Sight=new A;var e=this.getBounding(),e=p.getVisualAngle(e,this.app);this.Sight.alpha=e.alpha,this.Sight.beta=e.beta,this.Sight.focus=e.focus,this.Sight.radius=e.radius,this.Sight.focus.y=this.height}flyTo(){this.app.CameraController.flyTo(this.Sight,500)}focus(){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;for(const t in this.app.Project.objectDatas.map){let e=this.app.Project.objectDatas.find(t);e.setEnabled(!0)}(this.app.Project.current=this).app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}setEnabled(e){}getBounding(){var i,n;for(const e in this.app.Project.objectDatas.map){let t=this.app.Project.objectDatas.find(e);if(t.objectType!=f.Region){let e=t.instance.getBoundingInfo();i&&n||(i=n=e.boundingBox.center.clone()),i=BABYLON.Vector3.Minimize(i,e.minimum.add(t.instance.position)),n=BABYLON.Vector3.Maximize(n,e.maximum.add(t.instance.position))}}return i&&n||(i=BABYLON.Vector3.Zero(),n=new BABYLON.Vector3(12,this.height,8)),new BABYLON.BoundingInfo(i,n)}dispose(){}}class N{constructor(e){this.objectDatas=new d,this.app=e}clear(){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;for(const e in this.objectDatas.map)this.objectDatas.find(e).instance&&this.objectDatas.find(e).instance.dispose();this.objectDatas.clear(),this.current=null,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}optimization(){this.app.scene.freezeActiveMeshes()}getChildsById(e=this.root.id,n=!1){e=e||this.root.id;let r=new Array;const s=e=>{for(const i in this.objectDatas.map){var t=this.objectDatas.find(i);t.parentId==e&&(r.push(t),n&&s(t.id))}};return s(e),r}getSceneTree(e=this.root.id,r=[]){e=e||this.root.id;const s=(e,i)=>{for(const t in this.objectDatas.map){var n=this.objectDatas.find(t);if(n.parentId==e){let t=!1;for(let e=0;e<r.length;e++)n.customType!=r[e]||(t=!0);t||(i.push({name:n.name,id:n.id,customNumber:n.customNumber,modelType:n.objectType,customType:n.customType,children:[]}),s(n.id,i[i.length-1].children))}}};e=this.objectDatas.find(e);if(e){e={name:e.name,id:e.id,customNumber:e.customNumber,modelType:e.objectType,customType:e.customType,children:[]};return s(this.root.id,e.children),e}console.error("指定的层级不存在")}findObjectById(e){return this.objectDatas.find(e)}findObjectByCustomNumber(e){let t=[];for(const n in this.objectDatas.map){var i=this.objectDatas.find(n);i.customNumber==e&&t.push(i)}return 0==t.length?null:(1<t.length&&console.log("存在编号重复对象,重复个数:"+t.length),t[0])}findObjectsByCustomType(t,i={isCurrent:!1,isEnabled:!1}){let n=[];for(const r in this.objectDatas.map){let e=this.objectDatas.find(r);e.customType==t&&(i.isCurrent&&e.parentId!=this.current.id||i.isEnabled&&1!=e.instance.isEnabled()||n.push(e))}return n}findObjectsByType(e){let t=new Array;for(const n in this.objectDatas.map){var i=this.objectDatas.find(n);i.objectType==e&&t.push(i)}return t}computeSight(i){var n=BABYLON.Vector3.Zero(),r=BABYLON.Vector3.Zero();for(let e=0;e<i.length;e++){let t=i[e];if(t.objectType!=f.Region){let e=t.instance.getBoundingInfo();n&&r||(n=r=e.boundingBox.center.clone()),n=BABYLON.Vector3.Minimize(n,e.minimum.add(t.instance.position)),r=BABYLON.Vector3.Maximize(r,e.maximum.add(t.instance.position))}}return n&&r||(n=BABYLON.Vector3.Zero(),r=new BABYLON.Vector3(12,0,8)),p.getVisualAngle(new BABYLON.BoundingInfo(n,r),this.app)}switchLevel(t=this.root.id,i=!1,n=!0){t=t||this.root.id;var r=this.objectDatas.find(t);if(r&&r instanceof P){let e=this.getChildsById(t,n);e.forEach(e=>e.setEnabled(!0)),this.current=r,i&&this.app.CameraController.perspective(this.computeSight(e))}else console.error("层级不存在")}}class I{constructor(e){this.walls=new d,this.resources=new d,this.ndoeMats=new d,this.Materials=new d,this.Textures=new d,this.MergeMaterials=new d,this.app=e;e=a.getGUID(12);this.transparentBox=BABYLON.MeshBuilder.CreateBox(e,{size:1},this.app.scene),this.transparentBox.alwaysSelectAsActiveMesh=!0;let t=new BABYLON.StandardMaterial(e,this.app.scene);t.diffuseTexture=new BABYLON.Texture(Oe.rl+"resources/white.jpg",this.app.scene,!0,!1),t.alphaMode=BABYLON.Engine.ALPHA_COMBINE,t.emissiveColor=BABYLON.Color3.Green(),this.transparentBox.material=t,this.transparentBox.setEnabled(!1),this.transparentBox.visibility=.3;e=a.getGUID(12);this.BOX=BABYLON.MeshBuilder.CreateBox(e,{size:1},this.app.scene),this.BOX.edgesColor=BABYLON.Color4.FromHexString("#4ba3fff2"),this.BOX.setEnabled(!1),this.BOX.visibility=0,this.FogTex=new BABYLON.Texture(Oe.rl+"resources/fogtex.png",this.app.scene,!0,!1)}async loadModelMesh(t){let i=this.resources.find(t.modelId);if(!i)try{i=await BABYLON.SceneLoader.LoadAssetContainerAsync(Oe.rl+"bundle/"+t.modelId+"/",t.modelId+t.extension,this.app.scene),0<i.animationGroups.length&&i.animationGroups[0].stop(),i.addAllToScene(),i.meshes[0].setEnabled(!1),i.meshes[0].getChildMeshes().forEach(e=>{e.metadata&&e.metadata.gltf&&e.metadata.gltf.extras&&(i.isExtras=!0,e.metadata.gltf.extras.U&&BABYLON.Animation.CreateAndStartAnimation("u",e.material.albedoTexture,"uOffset",30*e.metadata.gltf.extras.Uspeed,30,0,1,1),e.metadata.gltf.extras.V&&BABYLON.Animation.CreateAndStartAnimation("v",e.material.albedoTexture,"vOffset",30*e.metadata.gltf.extras.Vspeed,30,0,1,1))}),i.isExtras||i.meshes[0].getChildMeshes().forEach(e=>{e.registerInstancedBuffer("color",4),e.instancedBuffers.color=new BABYLON.Color4(1,1,1,1)}),this.resources.add(t.modelId,i)}catch(e){console.error("模型下载失败!模型编号:"+t.modelId+";错误信息:"+e)}return i}loadModelMeshAsync(t,i){var e=this.resources.find(t.modelId);e?i(e):BABYLON.SceneLoader.LoadAssetContainerAsync(Oe.rl+"bundle/"+t.modelId+"/",t.modelId+t.extension,this.app.scene).then(e=>{0<e.animationGroups.length&&e.animationGroups[0].stop(),this.resources.add(t.modelId,e),i(e)}).catch(()=>{console.error("模型下载失败!模型编号:"+t.modelId)})}GetMaterial(e,t){let i=this.Materials.find(e.modelId);var n;return void 0===i&&(n=this.GetTexture(e,t),i=new BABYLON.StandardMaterial(e.modelId,t),i.alphaMode=BABYLON.Engine.ALPHA_COMBINE,i.diffuseTexture=n,this.Materials.add(e.modelId,i)),i}GetTexture(e,t){let i=this.Textures.find(e.modelId);return void 0===i&&(i=new BABYLON.Texture(Oe.rl+"texture/"+e.modelId+e.extension,t,!1),".png"==e.extension&&(i.hasAlpha=!0),this.Textures.add(e.modelId,i)),i}GetMergeMaterial(t,i){let n=this.MergeMaterials.find(t.modelId);if(void 0===n){n=new BABYLON.CustomMaterial(t.modelId,i),n.alphaMode=2,this.MergeMaterials.add(t.modelId,n),n.AddUniform("textureData","sampler2D",null),n.Vertex_Definitions(`
6
6
  varying vec3 localPos ;
7
7
  varying vec3 localNrm ;
8
8
  `),n.Fragment_Definitions(`
@@ -22,7 +22,7 @@
22
22
  diffuseColor = res.rgb;
23
23
  alpha = res.a;
24
24
  }
25
- `),n.freeze()}return n}delete(e=!1){if(this.BOX&&this.BOX.dispose(),this.transparentBox&&this.transparentBox.dispose(!0,!0),this.BOX=null,this.transparentBox=null,e){for(const t in this.resources.map)this.resources.find(t).removeAllFromScene(),this.resources.remove(t);this.resources.clear()}}async GetWalls(e,t){let i=await BABYLON.SceneLoader.LoadAssetContainerAsync(e,t+".gltf",this.app.scene);if(i.meshes){var n=i.meshes[0].getChildMeshes();for(let e=0;e<n.length;e++)this.walls.add(n[e].id,n[e])}}}t=i(31);const b=i.n(t).a.create();b.defaults.headers.post["Content-Type"]="application/json",b.interceptors.request.use(e=>{var t=localStorage.getItem("mx3d-token");return t&&(e.headers.Authorization="Bearer "+t),e},e=>Promise.reject(e)),b.interceptors.response.use(e=>e,e=>{if(e.response)switch(e.response.status){case 401:console.error("开发者授权码异常");break;case 403:console.error("当前用户没有权限");break;case 400:console.error(e.response.data.message)}return Promise.reject(e)});var w,_,A=b;class B{static init(){let e=new d.a.Tween(this.colors[1]).to({r:1,g:0,b:0},500),t=new d.a.Tween(this.colors[1]).to({r:1,g:.5,b:.5},500);t.chain(e),e.chain(t),e.start();let i=new d.a.Tween(this.colors[2]).to({r:1,g:.55,b:0},500),n=new d.a.Tween(this.colors[2]).to({r:0,g:0,b:0},500);i.chain(n),n.chain(i),i.start();let r=new d.a.Tween(this.colors[3]).to({r:1,g:.84,b:0},500),s=new d.a.Tween(this.colors[3]).to({r:0,g:0,b:0},500);r.chain(s),s.chain(r),r.start();let o=new d.a.Tween(this.colors[4]).to({r:0,g:.75,b:1},500),a=new d.a.Tween(this.colors[4]).to({r:0,g:0,b:0},500);o.chain(a),a.chain(o),o.start();let c=new d.a.Tween(this.colors[5]).to({r:.53,g:.8,b:0},500),h=new d.a.Tween(this.colors[5]).to({r:0,g:0,b:0},500);c.chain(h),h.chain(c),c.start();let l=new d.a.Tween(this.colors[6]).to({r:.8,g:.8,b:.8},500),u=new d.a.Tween(this.colors[6]).to({r:0,g:0,b:0},500);l.chain(u),u.chain(l),l.start()}}B.colors={1:BABYLON.Color3.Red(),2:new BABYLON.Color3(1,.5,0),3:BABYLON.Color3.Yellow(),4:new BABYLON.Color3(0,1,1),5:BABYLON.Color3.Green(),6:BABYLON.Color3.Gray()},(t=w=w||{})[t.Opaque=0]="Opaque",t[t.Flash=1]="Flash",t[t.Transparent=2]="Transparent",(t=_=_||{}).leftClick="leftClick",t.rightClick="rightClick",t.doubleClick="doubleClick",t.eover="eover",t.longPress="longPress",t.out="out";class x{toJosn(e){e=JSON.parse(e);this.alpha=e.alpha,this.beta=e.beta,this.radius=e.radius,this.minimumLimit=e.minimumLimit,this.maximumLimit=e.maximumLimit,this.minBeta=e.minBeta,this.maxBeta=e.maxBeta,this.focus=p.ToVector3(e.focus)}toString(){return JSON.stringify({alpha:this.alpha,focus:p.vector3ToJson(this.focus),radius:this.radius,beta:this.beta,minimumLimit:this.minimumLimit,maximumLimit:this.maximumLimit,minBeta:this.minBeta,maxBeta:this.maxBeta})}setLimit(e,t){this.minimumLimit=e+.3,this.maximumLimit=t}setBeta(e,t){this.minBeta=e,this.maxBeta=t}}class E{constructor(e){this.executes=new f,this.clickEvents=new f,this.touchtime=(new Date).getTime(),this.effectType=w.Opaque,this.app=e}setEnabled(e){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.setEnabled(e),e?(this.instance.isPickable=0<this.executes.count(),this.executes.find(_.eover)||this.executes.find(_.out)?this.instance.enablePointerMoveEvents=!0:this.instance.enablePointerMoveEvents=!1):(this.instance.isPickable=!1,this.instance.enablePointerMoveEvents=!1),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}set showBoundingBox(e){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.showBoundingBox=e,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}get showBoundingBox(){return this.instance.showBoundingBox}bind(e){this.id=e.id,this.name=e.name,this.customNumber=e.customNumber,this.customType=e.customType,this.parentId=e.parentId,this.modelId=e.baseModel.modelId,this.animation=e.animation,this.isAutoPlay=e.isAutoPlay,this.isloop=e.isloop,this.objectType=g.Other;let t=new BABYLON.Mesh(this.id,this.app.scene),i=this.app.Resources.resources.find(this.modelId);i.meshes[0].getChildMeshes().forEach(e=>{e=e.createInstance(this.id);e.isPickable=!1,e.enablePointerMoveEvents=!1,e.parent=t}),t.rotation=p.ToVector3(e.rotation),t.position=p.ToVector3(e.position),t.scaling=p.ToVector3(e.scaling);e=p.computeBounds(t);t.setBoundingInfo(e),this.instance=this.app.Resources.BOX.clone(this.id),this.instance.id=this.id,this.instance.enablePointerMoveEvents=!1,this.instance.isPickable=!1,this.instance.scaling=new BABYLON.Vector3((e.maximum.x-e.minimum.x)*t.scaling.x,(e.maximum.y-e.minimum.y)*t.scaling.y,(e.maximum.z-e.minimum.z)*t.scaling.z),0==this.instance.scaling.y&&(this.instance.scaling.y=.01),this.instance.position=t.position.clone(),this.instance.position.y=(e.maximum.y-e.minimum.y)/2+t.position.y,this.instance.rotation=t.rotation.clone(),t.setParent(this.instance),this.alwaysActive(),this.optimization(!0),this.instance.setEnabled(!1),this.computeView()}computeView(){this.Sight=new x;var e=this.instance.getBoundingInfo(),t=p.getVisualAngle(e,this.app);this.Sight.alpha=t.alpha,this.Sight.beta=t.beta,this.Sight.focus=this.instance.getAbsolutePosition(),this.Sight.radius=e.boundingSphere.radiusWorld+3,this.Sight.minimumLimit=.3,this.Sight.maximumLimit=2*this.Sight.radius,this.Sight.minBeta=.01,this.Sight.maxBeta=Math.PI/2*.98}optimization(t){this.instance.getChildMeshes().forEach(e=>{t?e.freezeWorldMatrix():e.unfreezeWorldMatrix()}),t?this.instance.freezeWorldMatrix():this.instance.unfreezeWorldMatrix(),this.instance.material&&(t?this.instance.material.freeze():this.instance.material.unfreeze())}alwaysActive(){this.instance.getChildMeshes().forEach(e=>{e.alwaysSelectAsActiveMesh=!0,e.doNotSyncBoundingInfo=!1,e.ignoreNonUniformScaling=!0}),this.instance.alwaysSelectAsActiveMesh=!0,this.instance.doNotSyncBoundingInfo=!1}addEventListener(e,t){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;let i=null;var n;e==_.leftClick||e==_.rightClick?(this.clickEvents.remove(e),this.clickEvents.add(e,t),this.instance.isPickable=!0,i=new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPickTrigger,e=>{let t=this.clickEvents.find(_.leftClick);t&&0==e.sourceEvent.button&&t(this,e);let i=this.clickEvents.find(_.rightClick);i&&2==e.sourceEvent.button&&i(this,e),this.touchtime=(new Date).getTime()}),e="click"):e==_.doubleClick?i=new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnDoublePickTrigger,e=>t(this,e)):e==_.eover?(i=new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPointerOverTrigger,e=>t(this,e)),this.instance.enablePointerMoveEvents=!0):e==_.longPress?i=new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnLongPressTrigger,e=>t(this,e)):e==_.out&&(i=new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPointerOutTrigger,e=>t(this,e)),this.instance.enablePointerMoveEvents=!0),i&&(this.action||(this.action=new BABYLON.ActionManager(this.app.scene),this.instance.actionManager=this.action),(n=this.executes.find(e))&&this.action.unregisterAction(n),this.executes.remove(e),this.executes.add(e,i),this.action.registerAction(i)),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}removeEventListener(e){if(e==_.leftClick||e==_.rightClick||e==_.doubleClick){if(this.clickEvents.remove(e),0<this.clickEvents.count())return;e="click"}this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;var t=this.executes.find(e);t&&this.action.unregisterAction(t),this.executes.remove(e),0==this.executes.count()&&(this.action=null,this.instance.actionManager=this.action),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}setFlash(t){this.effectType==w.Opaque&&(this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.getChildMeshes().forEach(e=>{e.instancedBuffers&&(e.instancedBuffers.color=B.colors[t])}),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,this.effectType=w.Flash)}setOpaque(){this.effectType!=w.Opaque&&(this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.getChildMeshes().forEach(e=>{e.setEnabled(!0),e.instancedBuffers&&(e.instancedBuffers.color=new BABYLON.Color4(1,1,1,1))}),this.instance.disableEdgesRendering(),this.instance.visibility=0,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,this.effectType=w.Opaque)}setTransparent(e=.3){this.effectType==w.Opaque&&(this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.getChildMeshes().forEach(e=>e.setEnabled(!1)),this.instance.visibility=e,this.instance.enableEdgesRendering(),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,this.effectType=w.Transparent)}play(){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.getChildMeshes().forEach(t=>{let i;t.animations.forEach(e=>{-1!=e.name.indexOf("open")&&(i=e)}),i?this.app.scene.beginDirectAnimation(t,[i],0,10*i.getKeys().length,this.isloop):t.animations.forEach(e=>this.app.scene.beginDirectAnimation(t,[e],0,10*e.getKeys().length,this.isloop))}),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}stop(){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.getChildMeshes().forEach(t=>{let i;t.animations.forEach(e=>{-1!=e.name.indexOf("close")&&(i=e)}),i?this.app.scene.beginDirectAnimation(t,[i],0,10*i.getKeys().length,!1):t.animations.forEach(e=>this.app.scene.beginDirectAnimation(t,[e],10*e.getKeys().length,0,!1))}),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}}class C extends E{constructor(){super(...arguments),this.baseModel=null}bind(e){this.id=o.getGUID(12),this.objectType=g.Wall,this.name="墙体",this.instance=ke.Tools.MergeMeshes(e.walls,this.app),this.instance.setEnabled(!1),this.instance.receiveShadows=!0,e.t&&""!=e.t?(this.modelId=e.t.modelId,this.baseModel=e.t,this.baseModel.length||(this.baseModel.length=3.1),this.nativeMaterial=this.app.Resources.GetMergeMaterial(e.t,this.app.scene)):this.nativeMaterial=null,this.instance.material=this.nativeMaterial,this.instance.id=this.id,this.instance.name=this.id,this.instance.isPickable=!1,this.instance.enablePointerMoveEvents=!1,this.instance.position.y=this.height,this.alwaysActive(),this.optimization(!0)}}class S extends E{bind(e){this.id=e.id,this.name=e.name,this.customNumber=e.customNumber,this.customType=e.customType,this.parentId=e.parentId,this.modelId=e.baseModel.modelId,this.height=e.baseModel.height,this.objectType=g.Window,this.instance=new BABYLON.Mesh(this.id,this.app.scene);let t=this.app.Resources.resources.find(this.modelId);t.meshes[0].getChildMeshes().forEach(e=>{e.createInstance(this.id).parent=this.instance});var i=p.computeBounds(this.instance);this.instance.rotation=p.ToVector3(e.rotation),this.instance.position=p.ToVector3(e.position),this.Sight=p.getVisualAngle(i,this.app);let n=this.app.Resources.BOX.createInstance(this.id);n.setBoundingInfo(i),n.enablePointerMoveEvents=!1,n.isPickable=!1,n.scaling=new BABYLON.Vector3((i.maximum.x-i.minimum.x)*this.instance.scaling.x,(i.maximum.y-i.minimum.y)*this.instance.scaling.y,(i.maximum.z-i.minimum.z)*this.instance.scaling.z),n.position=this.instance.position.clone(),n.position.y=(i.maximum.y-i.minimum.y)/2+this.instance.position.y,n.rotation=this.instance.rotation.clone(),this.instance.getChildMeshes().forEach(e=>e.setParent(n)),this.instance.dispose(),this.instance=n,this.alwaysActive(),this.optimization(!0),this.instance.setEnabled(!1),this.computeView()}}class T extends E{bind(e){this.id=e.id,this.name=e.name,this.customNumber=e.customNumber,this.customType=e.customType,this.parentId=e.parentId,this.modelId=e.baseModel.modelId,this.height=e.baseModel.height,this.objectType=g.Door,this.instance=new BABYLON.Mesh(this.id,this.app.scene);let t=this.app.Resources.resources.find(this.modelId);t.meshes[0].getChildMeshes().forEach(e=>{e.createInstance(this.id).parent=this.instance});var i=p.computeBounds(this.instance);this.instance.rotation=p.ToVector3(e.rotation),this.instance.position=p.ToVector3(e.position);let n=this.app.Resources.BOX.createInstance(this.id);n.setBoundingInfo(i),n.enablePointerMoveEvents=!1,n.isPickable=!1,n.scaling=new BABYLON.Vector3((i.maximum.x-i.minimum.x)*this.instance.scaling.x,(i.maximum.y-i.minimum.y)*this.instance.scaling.y,(i.maximum.z-i.minimum.z)*this.instance.scaling.z),n.position=this.instance.position.clone(),n.position.y=(i.maximum.y-i.minimum.y)/2+this.instance.position.y,n.rotation=this.instance.rotation.clone(),this.instance.getChildMeshes().forEach(e=>e.setParent(n)),this.instance.dispose(),this.instance=n,this.alwaysActive(),this.optimization(!0),this.instance.setEnabled(!1),this.computeView()}}class k extends E{computeView(){this.objectType=g.Cabinet,this.Sight=new x;var e=this.instance.getBoundingInfo(),t=p.getVisualAngle(e,this.app);this.Sight.alpha=t.alpha,this.Sight.beta=t.beta,this.Sight.focus=this.instance.getAbsolutePosition(),this.Sight.radius=e.boundingSphere.radiusWorld+3,this.Sight.minimumLimit=.3,this.Sight.maximumLimit=2*this.Sight.radius,this.Sight.minBeta=.01,this.Sight.maxBeta=Math.PI/2*.98}}class M extends E{bind(e){let t=p.ToARRVector3(e.lines);this.Sight.focus=t[0].clone(),this.instance=p.createTube(e.id,t,.02,this.app),this.instance.setEnabled(!1),this.id=e.id,this.name=e.name,this.customNumber=e.customNumber,this.customType=e.customType,this.parentId=e.parentId,this.modelId=e.baseModel.modelId,this.objectType=g.LeakWater;e=this.app.Resources.GetMaterial(e.baseModel,this.app.scene).clone(this.id);BABYLON.Animation.CreateAndStartAnimation("u",e.diffuseTexture,"vOffset",15,30,0,1,1),e.diffuseTexture.vScale=this.instance.getTotalVertices()/50,this.instance.material=e,this.alwaysActive(),this.computeView()}computeView(){this.Sight=new x;var e=this.instance.getBoundingInfo(),t=p.getVisualAngle(e,this.app);this.Sight.alpha=t.alpha,this.Sight.beta=t.beta,this.Sight.radius=e.boundingSphere.radiusWorld+3,this.Sight.minimumLimit=.3,this.Sight.maximumLimit=2*this.Sight.radius,this.Sight.minBeta=.01,this.Sight.maxBeta=Math.PI/2*.98}addEventListener(e,t){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;let i=null;var n;e==_.leftClick||e==_.rightClick||e==_.doubleClick?(this.clickEvents.remove(e),this.clickEvents.add(e,t),this.instance.isPickable=!0,i=new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPickTrigger,e=>{let t=this.clickEvents.find(_.leftClick);t&&0==e.sourceEvent.button&&t(this,e);let i=this.clickEvents.find(_.rightClick);i&&2==e.sourceEvent.button&&i(this,e);let n=this.clickEvents.find(_.doubleClick);n&&0==e.sourceEvent.button&&(new Date).getTime()-this.touchtime<500&&n(this,e),this.touchtime=(new Date).getTime()}),e="click"):e==_.eover?(i=new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPointerOverTrigger,e=>t(this,e)),this.instance.enablePointerMoveEvents=!0):e==_.longPress?i=new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnLongPressTrigger,e=>t(this,e)):e==_.out&&(i=new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPointerOutTrigger,e=>t(this,e)),this.instance.enablePointerMoveEvents=!0),i&&(this.action||(this.action=new BABYLON.ActionManager(this.app.scene),this.instance.actionManager=this.action),(n=this.executes.find(e))&&this.action.unregisterAction(n),this.executes.remove(e),this.executes.add(e,i),this.action.registerAction(i)),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}removeEventListener(e){if(e==_.leftClick||e==_.rightClick||e==_.doubleClick){if(this.clickEvents.remove(e),0<this.clickEvents.count())return;e="click"}this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;var t=this.executes.find(e);t&&this.action.unregisterAction(t),this.executes.remove(e),0==this.executes.count()&&(this.action=null,this.instance.actionManager=this.action,this.instance.getChildMeshes().forEach(e=>e.actionManager=this.action)),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}}class O extends E{async bind(e){this.id=e.id,this.name=e.name,this.customNumber=e.customNumber,this.customType=e.customType,this.parentId=e.parentId,this.objectType=g.VirtualBox,"Cylinder"==e.virtualType?this.instance=BABYLON.MeshBuilder.CreateCylinder(this.id,{height:1,diameterTop:1,diameterBottom:1},this.app.scene):this.instance=BABYLON.MeshBuilder.CreateBox(this.id,{size:1},this.app.scene),this.instance.setEnabled(!1),this.instance.id=this.id;let t=new BABYLON.StandardMaterial(this.id,this.app.scene);t.diffuseColor=BABYLON.Color3.FromHexString(e.color),e.alpha<.98&&(t.alpha=e.alpha,t.alphaMode=2,t.useAlphaFromDiffuseTexture=!0),this.instance.material=t,e.isEdges&&(this.instance.enableEdgesRendering(),this.instance.edgesWidth=1,this.instance.edgesColor=new BABYLON.Color4(0,1,1,1)),e.edgesWidth&&0<e.edgesWidth&&(this.instance.enableEdgesRendering(),this.instance.edgesWidth=e.edgesWidth,this.instance.edgesColor=BABYLON.Color3.FromHexString(e.edgesColor).toColor4(1)),this.instance.enablePointerMoveEvents=!1,this.instance.isPickable=!1,this.instance.rotation=ke.Tools.ToVector3(e.rotation),this.instance.position=ke.Tools.ToVector3(e.position),this.instance.scaling=ke.Tools.ToVector3(e.scaling),this.alwaysActive(),this.optimization(!0),this.computeView()}}class L extends E{bind(e){this.id=e.id,this.name=e.name,this.customNumber=e.customNumber,this.customType=e.customType,this.parentId=e.parentId,this.objectType=g.UI3D;let t={};t.color=e.color,e.size?(t.clearColor=null,t.position=ke.Tools.ToVector3(e.position),r=ke.Tools.ToVector3(e.rotation),t.rotation=new BABYLON.Vector3(r.x+Math.PI,r.y,r.z),i=Number.parseInt(e.size.replace("px",""))/40,r=e.scaling?ke.Tools.ToVector3(e.scaling):BABYLON.Vector3.One(),t.scaling=new BABYLON.Vector3(14*i/50*r.x,1,14*i/50*r.z)):(t.clearColor=e.clearColor,t.position=ke.Tools.ToVector3(e.position),t.rotation=ke.Tools.ToVector3(e.rotation),t.scaling=ke.Tools.ToVector3(e.scaling));var i="bold 100px Arial";let n=new BABYLON.DynamicTexture(this.id,64,this.app.scene,!1);var r=n.getContext();r.font=i;e=r.measureText(this.name).width+8,r=.02*e;n=new BABYLON.DynamicTexture(this.id,{width:e,height:150},this.app.scene,!1);e=new BABYLON.StandardMaterial(this.id,this.app.scene);e.backFaceCulling=!1,e.diffuseTexture=n,t.clearColor||(n.hasAlpha=!0),n.drawText(this.name,null,null,i,t.color,t.clearColor,!1),this.instance=BABYLON.Mesh.CreateGround(this.id,r,3,1,this.app.scene),this.instance.setEnabled(!1),this.instance.scaling=t.scaling,this.instance.position=t.position,this.instance.rotation=t.rotation,this.instance.material=e,this.alwaysActive(),this.optimization(!0),this.computeView()}}class P extends E{bind(e){this.id=e.id,this.name=e.name,this.customNumber=e.customNumber,this.customType=e.customType,this.parentId=e.parentId,this.objectType=g.Conduit,this.color=e.color,this.instance=new BABYLON.Mesh(this.id);var t=p.ToARRVector3(e.pints);let i=p.createTube(e.id,t,e.radius,this.app);this.instance.position=i.getBoundingInfo().boundingBox.center.clone(),this.instance.addChild(i),e.rotation&&(this.instance.rotation=p.ToVector3(e.rotation)),e.position&&(this.instance.position=p.ToVector3(e.position)),i.setParent(this.instance.parent),this.instance.dispose(),this.instance=i;let n=new BABYLON.StandardMaterial(e.id,this.app.scene);n.diffuseColor=BABYLON.Color3.FromHexString(e.color),n.alpha=e.alpha,this.alpha=e.alpha,this.instance.material=n,this.instance.enablePointerMoveEvents=!1,this.instance.isPickable=!1,this.instance.setEnabled(!1),this.alwaysActive(),this.optimization(!0),this.computeView()}setColor(e,t,i){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.optimization(!1),this.instance.material.diffuseColor=new BABYLON.Color3(e/255,i/255,t/255),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}reColor(){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.optimization(!1),this.instance.material.diffuseColor=BABYLON.Color3.FromHexString(this.color),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}computeView(){this.Sight=new x;var e=this.instance.getBoundingInfo(),e=p.getVisualAngle(e,this.app);this.alpha=e.alpha,this.Sight.beta=e.beta,this.Sight.focus=e.focus,this.Sight.radius=e.radius,this.Sight.minimumLimit=.3,this.Sight.maximumLimit=2*this.Sight.radius,this.Sight.minBeta=.01,this.Sight.maxBeta=Math.PI/2*.98}setFlash(e=1){this.effectType==w.Opaque&&(this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.optimization(!1),this.instance.material.emissiveColor=B.colors[e],this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,this.effectType=w.Flash)}setOpaque(){this.effectType!=w.Opaque&&(this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.optimization(!0),this.instance.material.alpha=this.alpha,this.instance.material.emissiveColor=null,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,this.effectType=w.Opaque)}setTransparent(e=.3){this.effectType==w.Opaque&&(this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.optimization(!1),this.instance.material.alpha=e,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,this.effectType=w.Transparent)}}class R extends E{bind(e){this.id=e.id,this.name=e.name,this.customNumber=e.customNumber,this.customType=e.customType,this.parentId=e.parentId,this.modelId=e.baseModel.modelId,this.objectType=g.Floor,this.instance=BABYLON.MeshBuilder.CreatePolygon("地板",{shape:p.Expand(e.vectors,-.01),holes:e.buckles,sideOrientation:BABYLON.Mesh.DOUBLESIDE},this.app.scene),this.alwaysActive(),this.instance.setEnabled(!1),this.instance.isPickable=!1,this.instance.enablePointerMoveEvents=!1,this.instance.position.y=this.height-.01,this.instance.id=e.id,this.instance.name="地板";var t=this.app.Resources.GetMaterial(e.baseModel,this.app.scene).clone(e.id),i=this.instance.getBoundingInfo();this.Sight=p.getVisualAngle(i,this.app),e.baseModel.isTiling&&(t.diffuseTexture.uScale=(i.maximum.x-i.minimum.x)/e.baseModel.width,t.diffuseTexture.vScale=(i.maximum.z-i.minimum.z)/e.baseModel.length),this.instance.material=t,this.optimization(!0),this.computeView()}}class N extends E{bind(i){let e=!1;this.id=o.getGUID(12),this.name="墙角",this.objectType=g.Corner;let n=new Array;for(let t=0;t<i.length;t++)if(2<i[t].pints.length){let e=BABYLON.MeshBuilder.CreatePolygon(this.id,{shape:i[t].pints,sideOrientation:BABYLON.Mesh.FRONTSIDE},this.app.scene);e.setEnabled(!1),e.position.y=i[t].height,e.isPickable=!0,e.enablePointerMoveEvents=!1,n.push(e)}return n.length<1||(1<n.length?this.instance=p.MergeMeshes(n,this.app):this.instance=n[0],this.instance.id=this.id,this.instance.name=this.id,this.instance.position.y=this.height,this.instance.setEnabled(!1),this.instance.isPickable=!1,this.instance.enablePointerMoveEvents=!1,this.alwaysActive(),this.optimization(!0),e=!0),e}}class I extends E{constructor(e,t){super(e),this.height=0,this.id=t.id,this.objectType=t.objectType,this.customNumber=t.customNumber,this.customType=t.customType,this.name=t.name,this.parentId=t.parentId,this.height=t.height,this.index=t.index}bind(r,e=0){let o=new Array;for(let t=0;t<r.length;t++){let e=r[t];e.objectType==g.Wall&&(e.height||(e.height=3.1),e.ply||(e.ply=.09),o.push(e))}let s=new f;for(let e=0;e<r.length;e++){let i=r[e];i.objectType==g.Corner&&(s.add(i.id,i.corner),2<i.pints.length&&(i.height=3.1,i.walls.forEach(t=>{o.forEach(e=>{t==e.id&&parseFloat(e.height)<i.height&&(i.height=parseFloat(e.height))})})))}{let t=new Array;for(let e=0;e<r.length;e++){var i=r[e];i.objectType==g.Corner&&t.push(i)}let e=new N(this.app);e.height=this.height,e.bind(t)?(e.parentId=this.id,this.app.Project.objectDatas.add(e.id,e)):e=null}for(let i=0;i<r.length;i++){let n=r[i];if(n.objectType==g.Floor){n.vectors=new Array;let e=r[i];e.pints.forEach(e=>{s.find(e)||console.log(e),n.vectors.push(s.find(e))}),n.buckles=new Array,e.holes&&e.holes.forEach(e=>{let t=new Array;e.forEach(e=>t.push(s.find(e))),n.buckles.push(t)}),e.middles&&e.middles.forEach(t=>{let i=Array();for(let e=0;e<r.length;e++)r[e].id==t&&r[e].pints.forEach(e=>{e=s.find(e);i.push(new BABYLON.Vector3(e.x,0,e.z))});n.buckles.push(i)});let t=new R(this.app);t.height=this.height,t.bind(n),this.app.Project.objectDatas.add(t.id,t)}}s=null;for(let t=0;t<r.length;t++){var n=r[t];let e;if(n.objectType==g.Window)e=new S(this.app);else if(n.objectType==g.Door)e=new T(this.app);else if(n.objectType==g.Cabinet)e=new k(this.app);else if(n.objectType==g.LeakWater)e=new M(this.app);else if(n.objectType==g.VirtualBox)e=new O(this.app);else if(n.objectType==g.UI3D)e=new L(this.app);else if(n.objectType==g.Conduit)e=new P(this.app);else{if(n.objectType==g.Wall)continue;if(n.objectType==g.Corner)continue;if(n.objectType==g.Floor)continue;e=new E(this.app)}e.bind(n),this.app.Project.objectDatas.add(e.id,e)}{let s=new f;s.add("body",{t:"",walls:new Array});for(let r=0;r<o.length;r++){let n=BABYLON.MeshBuilder.ExtrudePolygon(o[r].id,{shape:[p.ToVector3(o[r].wtop),p.ToVector3(o[r].wleft),p.ToVector3(o[r].wbottom),p.ToVector3(o[r].wright)],depth:parseFloat(o[r].height),sideOrientation:BABYLON.Mesh.FRONTSIDE},this.app.scene);n.setEnabled(!1),n.position.y=parseFloat(o[r].height),n.subMeshes=[];var a=n.getTotalVertices();n.subMeshes.push(new BABYLON.SubMesh(0,0,a,0,6,n)),n.subMeshes.push(new BABYLON.SubMesh(0,1,a,18,6,n)),n.subMeshes.push(new BABYLON.SubMesh(0,2,a,30,6,n));for(let i=0;i<o[r].wallwindows.length;i++){const u=BABYLON.CSG.FromMesh(n);let e=this.app.Project.objectDatas.find(o[r].wallwindows[i]);var c=e.instance.getBoundingInfo(),h=BABYLON.MeshBuilder.CreateBox((new Date).getTime().toString(),{height:c.maximum.y-c.minimum.y,width:c.maximum.x-c.minimum.x,depth:2*parseFloat(o[r].ply)+.1},this.app.scene);h.position=e.instance.position.clone(),h.position.y=(c.maximum.y-c.minimum.y)/2+e.height,h.rotation=e.instance.rotation.clone();c=BABYLON.CSG.FromMesh(h);let t=u.subtract(c);h.dispose(),n.dispose(),n=t.toMesh(o[r].id,null,this.app.scene,!0),n.setEnabled(!1)}let t=s.find(o[r].leftMap.modelId);t||(t={t:o[r].leftMap,walls:new Array},s.add(o[r].leftMap.modelId,t));let i=s.find(o[r].rightMap.modelId);i||(i={t:o[r].rightMap,walls:new Array},s.add(o[r].rightMap.modelId,i));var l=p.DeconsTructMesh(n,parseFloat(o[r].height),this.app);for(let e=0;e<l.length;e++)(2==e||3==e?t:4==e||5==e?i:s.find("body")).walls.push(l[e])}for(const t in s.map)if(0<s.find(t).walls.length){let e=new C(this.app);e.parentId=this.id,e.height=this.height,e.bind(s.find(t)),this.app.Project.objectDatas.add(e.id,e)}}o=null,this.computeView()}computeView(){this.Sight=new x;var e=this.getBounding(),e=p.getVisualAngle(e,this.app);this.Sight.alpha=e.alpha,this.Sight.beta=e.beta,this.Sight.focus=e.focus,this.Sight.radius=e.radius,this.Sight.focus.y=this.height}flyTo(){this.app.Camera.flyTo(this.Sight,500)}focus(){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;for(const t in this.app.Project.objectDatas.map){let e=this.app.Project.objectDatas.find(t);e.setEnabled(!0)}(this.app.Project.current=this).app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}setEnabled(e){}getBounding(){var i,n;for(const e in this.app.Project.objectDatas.map){let t=this.app.Project.objectDatas.find(e);if(t.objectType!=g.Region){let e=t.instance.getBoundingInfo();i&&n||(i=n=e.boundingBox.center.clone()),i=BABYLON.Vector3.Minimize(i,e.minimum.add(t.instance.position)),n=BABYLON.Vector3.Maximize(n,e.maximum.add(t.instance.position))}}return i&&n||(i=BABYLON.Vector3.Zero(),n=new BABYLON.Vector3(12,this.height,8)),new BABYLON.BoundingInfo(i,n)}dispose(){}}var t=i(6),D=i.n(t);class Y{constructor(e,t){this.textDics=new Array,this.id=e,this.scene=t}set background(e){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this._background&&this._background.dispose(),this._background=new BABYLON.GUI.Image(o.getGUID(12)+"_Image",e),this._background.width=this.size.width+"px",this._background.height=this.size.height+"px",this.rect.addControl(this._background),this.onPointerClick&&(this._background.isPointerBlocker=!1,this._background.onPointerClickObservable.add(()=>{this.onPointerClick()})),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}setTexts(i){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.textDics.forEach(e=>e.dispose());for(let t=this.textDics.length=0;t<i.length;t++){let e=new BABYLON.GUI.TextBlock;e.text=i[t].text,e.fontSize=i[t].fontSize||"20px",e.color=i[t].color||"white",e.top=i[t].top||0,e.left=i[t].left||0,this.rect.addControl(e),this.textDics.push(e)}this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}line(e){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this._line&&this._line.dispose(),this._line=new BABYLON.GUI.Line,this._line.lineWidth=e.width||1.5,this._line.color=e.color||"green",this._line.y2=this.size.height/2,this.container.addControl(this._line),this._line.linkWithMesh(this.pint),this._line.connectedControl=this.rect,this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}dispose(){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.rect&&this.rect.dispose(),this._line&&this._line.dispose(),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}isEnabled(e){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.rect&&(this.rect.isVisible=e),this._line&&(this._line.isVisible=e),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}}class j{constructor(e,t,i,n,r,s){this.id=e,this.scene=s,this.url=i,this.scaling=n,this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance=BABYLON.Mesh.CreatePlane(this.id,n,this.scene,!0,BABYLON.Mesh.DOUBLESIDE),this.instance.alwaysSelectAsActiveMesh=!0,this.instance.position=t.clone(),this.instance.position.y+=r,this.instance.billboardMode=BABYLON.Mesh.BILLBOARDMODE_Y;let o=new BABYLON.StandardMaterial("Mat_"+this.id,this.scene);o.diffuseColor=BABYLON.Color3.White(),o.emissiveColor=BABYLON.Color3.White(),this.instance.material=o,this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}setBackground(){let i=new Image;i.src=this.url,i.onload=()=>{this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.scaling.y=this.scaling/(i.width/i.height)/this.scaling;let e=new BABYLON.DynamicTexture(this.id,{width:i.width,height:i.height},this.scene,!1);e.hasAlpha=!0,this.instance.material.diffuseTexture=e;let t=e.getContext();t.drawImage(i,0,0),e.update(),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}}addEventListener(t){if(this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.actionManager&&this.instance.actionManager.dispose(),this.instance.isPickable=!1,this.instance.enablePointerMoveEvents=!1,t){this.instance.isPickable=!0,this.instance.enablePointerMoveEvents=!0;let e=new BABYLON.ActionManager(this.scene);e.registerAction(new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPickTrigger,e=>t(this.id))),this.instance.actionManager=e}this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}setColor(e){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.material.diffuseColor=BABYLON.Color3.FromHexString(e),this.instance.material.emissiveColor=BABYLON.Color3.FromHexString(e),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}setContents(i){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0;let n=new Image;n.src=this.url,n.onload=()=>{this.instance.scaling.y=this.scaling/(n.width/n.height)/this.scaling;let t=new BABYLON.DynamicTexture(this.id,{width:n.width,height:n.height},this.scene,!1);t.hasAlpha=!0,this.instance.material.diffuseTexture=t;let e=t.getContext();e.drawImage(n,0,0),i.forEach(e=>t.drawText(e.text,e.left,e.top,"bold "+e.fontSize+" monospace",e.color||"#fffffb","",!0,!0)),t.update(),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}}dispose(){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.dispose(),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}isEnabled(e){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.setEnabled(e),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}}class z{constructor(){this.color="#00ff00",this.width=5,this.isDotted=!1}update(){this.objs[0].app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance&&this.instance.dispose(),this.instance=new BABYLON.GUI.MultiLine,this.objs[0].app.container.addControl(this.instance),this.instance.lineWidth=this.width,this.instance.color=this.color,this.isDotted&&(this.instance.dash=[1]),this.objs.forEach(e=>this.instance.add(e.instance)),this.objs[0].app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}addEventListener(e){this.objs[0].app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,e&&(this.instance.isPointerBlocker=!1,this.instance.onPointerClickObservable.add(()=>{e(this.id)})),this.objs[0].app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}isEnabled(e){this.instance&&(this.objs[0].app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.isVisible=e,this.objs[0].app.scene.blockfreeActiveMeshesAndRenderingGroups=!1)}dispose(){this.objs[0].app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance&&this.instance.dispose(),this.objs[0].app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}}class U{constructor(){this.color="#00ff00",this.width=1}update(){this.objs[0].app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance&&this.instance.dispose();let t=[];this.objs.forEach(e=>t.push(e.instance.getAbsolutePosition().clone())),this.instance=p.createTube(this.id,t,this.width/100,this.objs[0].app);let e=new BABYLON.StandardMaterial("mat_"+this.id,this.objs[0].app.scene);e.diffuseColor=BABYLON.Color3.FromHexString(this.color),this.instance.material=e,this.objs[0].app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}addEventListener(t){if(this.objs[0].app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.actionManager&&this.instance.actionManager.dispose(),this.instance.isPickable=!1,this.instance.enablePointerMoveEvents=!1,t){this.instance.isPickable=!0,this.instance.enablePointerMoveEvents=!0;let e=new BABYLON.ActionManager(this.objs[0].app.scene);e.registerAction(new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPickTrigger,e=>t(this.id))),this.instance.actionManager=e}this.objs[0].app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}isEnabled(e){this.instance&&(this.objs[0].app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.setEnabled(e),this.objs[0].app.scene.blockfreeActiveMeshesAndRenderingGroups=!1)}dispose(){this.objs[0].app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance&&this.instance.dispose(),this.objs[0].app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}}class H{constructor(e){this.displayValue=!1,this.anchor=e,this.id=o.getGUID(12),this.texts=new Array}isEnabled(t){this.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.mesh.setEnabled(t),this.texts.forEach(e=>e.isVisible=!!t&&this.displayValue),this.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}set displayValues(t){this.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.texts.forEach(e=>e.isVisible=t),this.displayValue=t,this.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}dispose(){this.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.mesh&&this.mesh.dispose();for(let e=0;e<this.texts.length;e++)this.texts[e].linkedMesh&&this.texts[e].linkedMesh.dispose(),this.texts[e].dispose();this.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}}var F=i(14);class V{constructor(e,t){this.anchor=e,this.ratio=t}dispose(){this.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.mesh&&this.mesh.dispose(),this.textMesh&&this.textMesh.dispose(),this.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}}const G=[0,2e3,1e4,3e4,null];class W{constructor(e){this._retryDelays=void 0!==e?[...e,null]:G}nextRetryDelayInMilliseconds(e){return this._retryDelays[e.previousRetryCount]}}class $ extends Error{constructor(e,t){var i=new.target.prototype;super(`${e}: Status code '${t}'`),this.statusCode=t,this.__proto__=i}}class q extends Error{constructor(e="A timeout occurred."){var t=new.target.prototype;super(e),this.__proto__=t}}class X extends Error{constructor(e="An abort occurred."){var t=new.target.prototype;super(e),this.__proto__=t}}class K extends Error{constructor(e,t){var i=new.target.prototype;super(e),this.transport=t,this.errorType="UnsupportedTransportError",this.__proto__=i}}class J extends Error{constructor(e,t){var i=new.target.prototype;super(e),this.transport=t,this.errorType="DisabledTransportError",this.__proto__=i}}class Q extends Error{constructor(e,t){var i=new.target.prototype;super(e),this.transport=t,this.errorType="FailedToStartTransportError",this.__proto__=i}}class Z extends Error{constructor(e){var t=new.target.prototype;super(e),this.errorType="FailedToNegotiateWithServerError",this.__proto__=t}}class ee extends Error{constructor(e,t){var i=new.target.prototype;super(e),this.innerErrors=t,this.__proto__=i}}class te{constructor(e,t,i){this.statusCode=e,this.statusText=t,this.content=i}}class ie{get(e,t){return this.send({...t,method:"GET",url:e})}post(e,t){return this.send({...t,method:"POST",url:e})}delete(e,t){return this.send({...t,method:"DELETE",url:e})}getCookieString(e){return""}}var ne,re,se,oe,ae=i(0),ce=i(1);class he extends ie{constructor(e){if(super(),this._logger=e,"undefined"==typeof fetch){const t=require;this._jar=new(t("tough-cookie").CookieJar),this._fetchType=t("node-fetch"),this._fetchType=t("fetch-cookie")(this._fetchType,this._jar)}else this._fetchType=fetch.bind(Object(ce.h)());if("undefined"==typeof AbortController){const i=require;this._abortControllerType=i("abort-controller")}else this._abortControllerType=AbortController}async send(e){if(e.abortSignal&&e.abortSignal.aborted)throw new X;if(!e.method)throw new Error("No method defined.");if(!e.url)throw new Error("No url defined.");const t=new this._abortControllerType;let i;e.abortSignal&&(e.abortSignal.onabort=()=>{t.abort(),i=new X});let n=null;e.timeout&&(s=e.timeout,n=setTimeout(()=>{t.abort(),this._logger.log(ae.a.Warning,"Timeout from HTTP request."),i=new q},s));let r;try{r=await this._fetchType(e.url,{body:e.content,cache:"no-cache",credentials:!0===e.withCredentials?"include":"same-origin",headers:{"Content-Type":"text/plain;charset=UTF-8","X-Requested-With":"XMLHttpRequest",...e.headers},method:e.method,mode:"cors",redirect:"follow",signal:t.signal})}catch(e){if(i)throw i;throw this._logger.log(ae.a.Warning,`Error from HTTP request. ${e}.`),e}finally{n&&clearTimeout(n),e.abortSignal&&(e.abortSignal.onabort=null)}if(!r.ok){var s=await le(r,"text");throw new $(s||r.statusText,r.status)}e=await le(r,e.responseType);return new te(r.status,r.statusText,e)}getCookieString(e){let i="";return ce.c.isNode&&this._jar&&this._jar.getCookies(e,(e,t)=>i=t.join("; ")),i}}function le(e,t){let i;switch(t){case"arraybuffer":i=e.arrayBuffer();break;case"text":i=e.text();break;case"blob":case"document":case"json":throw new Error(`${t} is not supported.`);default:i=e.text()}return i}class ue extends ie{constructor(e){super(),this._logger=e}send(r){return r.abortSignal&&r.abortSignal.aborted?Promise.reject(new X):r.method?r.url?new Promise((e,t)=>{const i=new XMLHttpRequest;i.open(r.method,r.url,!0),i.withCredentials=void 0===r.withCredentials||r.withCredentials,i.setRequestHeader("X-Requested-With","XMLHttpRequest"),i.setRequestHeader("Content-Type","text/plain;charset=UTF-8");const n=r.headers;n&&Object.keys(n).forEach(e=>{i.setRequestHeader(e,n[e])}),r.responseType&&(i.responseType=r.responseType),r.abortSignal&&(r.abortSignal.onabort=()=>{i.abort(),t(new X)}),r.timeout&&(i.timeout=r.timeout),i.onload=()=>{r.abortSignal&&(r.abortSignal.onabort=null),200<=i.status&&i.status<300?e(new te(i.status,i.statusText,i.response||i.responseText)):t(new $(i.response||i.responseText||i.statusText,i.status))},i.onerror=()=>{this._logger.log(ae.a.Warning,`Error from HTTP request. ${i.status}: ${i.statusText}.`),t(new $(i.statusText,i.status))},i.ontimeout=()=>{this._logger.log(ae.a.Warning,"Timeout from HTTP request."),t(new q)},i.send(r.content||"")}):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}}class de extends ie{constructor(e){if(super(),"undefined"!=typeof fetch||ce.c.isNode)this._httpClient=new he(e);else{if("undefined"==typeof XMLHttpRequest)throw new Error("No usable HttpClient found.");this._httpClient=new ue(e)}}send(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new X):e.method?e.url?this._httpClient.send(e):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}getCookieString(e){return this._httpClient.getCookieString(e)}}class pe{}pe.Authorization="Authorization",pe.Cookie="Cookie",(t=ne=ne||{})[t.None=0]="None",t[t.WebSockets=1]="WebSockets",t[t.ServerSentEvents=2]="ServerSentEvents",t[t.LongPolling=4]="LongPolling",(t=re=re||{})[t.Text=1]="Text",t[t.Binary=2]="Binary";class fe{constructor(){this._isAborted=!1,this.onabort=null}abort(){this._isAborted||(this._isAborted=!0,this.onabort&&this.onabort())}get signal(){return this}get aborted(){return this._isAborted}}class ge{constructor(e,t,i,n){this._httpClient=e,this._accessTokenFactory=t,this._logger=i,this._pollAbort=new fe,this._options=n,this._running=!1,this.onreceive=null,this.onclose=null}get pollAborted(){return this._pollAbort.aborted}async connect(e,t){if(ce.a.isRequired(e,"url"),ce.a.isRequired(t,"transferFormat"),ce.a.isIn(t,re,"transferFormat"),this._url=e,this._logger.log(ae.a.Trace,"(LongPolling transport) Connecting."),t===re.Binary&&"undefined"!=typeof XMLHttpRequest&&"string"!=typeof(new XMLHttpRequest).responseType)throw new Error("Binary protocols over XmlHttpRequest not implementing advanced features are not supported.");var[i,n]=Object(ce.i)(),n={[i]:n,...this._options.headers};const r={abortSignal:this._pollAbort.signal,headers:n,timeout:1e5,withCredentials:this._options.withCredentials};t===re.Binary&&(r.responseType="arraybuffer");t=await this._getAccessToken();this._updateHeaderToken(r,t);e=`${e}&_=${Date.now()}`;this._logger.log(ae.a.Trace,`(LongPolling transport) polling: ${e}.`);e=await this._httpClient.get(e,r);200!==e.statusCode?(this._logger.log(ae.a.Error,`(LongPolling transport) Unexpected response code: ${e.statusCode}.`),this._closeError=new $(e.statusText||"",e.statusCode),this._running=!1):this._running=!0,this._receiving=this._poll(this._url,r)}async _getAccessToken(){return this._accessTokenFactory?this._accessTokenFactory():null}_updateHeaderToken(e,t){e.headers||(e.headers={}),t?e.headers[pe.Authorization]=`Bearer ${t}`:e.headers[pe.Authorization]&&delete e.headers[pe.Authorization]}async _poll(e,t){try{for(;this._running;){var i=await this._getAccessToken();this._updateHeaderToken(t,i);try{var n=`${e}&_=${Date.now()}`;this._logger.log(ae.a.Trace,`(LongPolling transport) polling: ${n}.`);var r=await this._httpClient.get(n,t);204===r.statusCode?(this._logger.log(ae.a.Information,"(LongPolling transport) Poll terminated by server."),this._running=!1):200!==r.statusCode?(this._logger.log(ae.a.Error,`(LongPolling transport) Unexpected response code: ${r.statusCode}.`),this._closeError=new $(r.statusText||"",r.statusCode),this._running=!1):r.content?(this._logger.log(ae.a.Trace,`(LongPolling transport) data received. ${Object(ce.f)(r.content,this._options.logMessageContent)}.`),this.onreceive&&this.onreceive(r.content)):this._logger.log(ae.a.Trace,"(LongPolling transport) Poll timed out, reissuing.")}catch(e){this._running?e instanceof q?this._logger.log(ae.a.Trace,"(LongPolling transport) Poll timed out, reissuing."):(this._closeError=e,this._running=!1):this._logger.log(ae.a.Trace,`(LongPolling transport) Poll errored after shutdown: ${e.message}`)}}}finally{this._logger.log(ae.a.Trace,"(LongPolling transport) Polling complete."),this.pollAborted||this._raiseOnClose()}}async send(e){return this._running?Object(ce.k)(this._logger,"LongPolling",this._httpClient,this._url,this._accessTokenFactory,e,this._options):Promise.reject(new Error("Cannot send until the transport is connected"))}async stop(){this._logger.log(ae.a.Trace,"(LongPolling transport) Stopping polling."),this._running=!1,this._pollAbort.abort();try{await this._receiving,this._logger.log(ae.a.Trace,`(LongPolling transport) sending DELETE request to ${this._url}.`);const r={};var[e,t]=Object(ce.i)();r[e]=t;var i={headers:{...r,...this._options.headers},timeout:this._options.timeout,withCredentials:this._options.withCredentials},n=await this._getAccessToken();this._updateHeaderToken(i,n),await this._httpClient.delete(this._url,i),this._logger.log(ae.a.Trace,"(LongPolling transport) DELETE request sent.")}finally{this._logger.log(ae.a.Trace,"(LongPolling transport) Stop finished."),this._raiseOnClose()}}_raiseOnClose(){if(this.onclose){let e="(LongPolling transport) Firing onclose event.";this._closeError&&(e+=" Error: "+this._closeError),this._logger.log(ae.a.Trace,e),this.onclose(this._closeError)}}}class me{constructor(e,t,i,n){this._httpClient=e,this._accessTokenFactory=t,this._logger=i,this._options=n,this.onreceive=null,this.onclose=null}async connect(a,e){var t;return ce.a.isRequired(a,"url"),ce.a.isRequired(e,"transferFormat"),ce.a.isIn(e,re,"transferFormat"),this._logger.log(ae.a.Trace,"(SSE transport) Connecting."),this._url=a,!this._accessTokenFactory||(t=await this._accessTokenFactory())&&(a+=(a.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(t)}`),new Promise((t,i)=>{let n=!1;if(e===re.Text){let e;if(ce.c.isBrowser||ce.c.isWebWorker)e=new this._options.EventSource(a,{withCredentials:this._options.withCredentials});else{var r=this._httpClient.getCookieString(a);const o={};o.Cookie=r;var[s,r]=Object(ce.i)();o[s]=r,e=new this._options.EventSource(a,{withCredentials:this._options.withCredentials,headers:{...o,...this._options.headers}})}try{e.onmessage=e=>{if(this.onreceive)try{this._logger.log(ae.a.Trace,`(SSE transport) data received. ${Object(ce.f)(e.data,this._options.logMessageContent)}.`),this.onreceive(e.data)}catch(e){return void this._close(e)}},e.onerror=e=>{n?this._close():i(new Error("EventSource failed to connect. The connection could not be found on the server, either the connection ID is not present on the server, or a proxy is refusing/buffering the connection. If you have multiple servers check that sticky sessions are enabled."))},e.onopen=()=>{this._logger.log(ae.a.Information,`SSE connected to ${this._url}`),this._eventSource=e,n=!0,t()}}catch(e){return void i(e)}}else i(new Error("The Server-Sent Events transport only supports the 'Text' transfer format"))})}async send(e){return this._eventSource?Object(ce.k)(this._logger,"SSE",this._httpClient,this._url,this._accessTokenFactory,e,this._options):Promise.reject(new Error("Cannot send until the transport is connected"))}stop(){return this._close(),Promise.resolve()}_close(e){this._eventSource&&(this._eventSource.close(),this._eventSource=void 0,this.onclose&&this.onclose(e))}}class ve{constructor(e,t,i,n,r,s){this._logger=i,this._accessTokenFactory=t,this._logMessageContent=n,this._webSocketConstructor=r,this._httpClient=e,this.onreceive=null,this.onclose=null,this._headers=s}async connect(c,h){var e;return ce.a.isRequired(c,"url"),ce.a.isRequired(h,"transferFormat"),ce.a.isIn(h,re,"transferFormat"),this._logger.log(ae.a.Trace,"(WebSockets transport) Connecting."),!this._accessTokenFactory||(e=await this._accessTokenFactory())&&(c+=(c.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(e)}`),new Promise((t,i)=>{c=c.replace(/^http/,"ws");let n;var e=this._httpClient.getCookieString(c);let r=!1;if(ce.c.isNode){const a={};var[s,o]=Object(ce.i)();a[s]=o,e&&(a[pe.Cookie]=`${e}`),n=new this._webSocketConstructor(c,void 0,{headers:{...a,...this._headers}})}n=n||new this._webSocketConstructor(c),h===re.Binary&&(n.binaryType="arraybuffer"),n.onopen=e=>{this._logger.log(ae.a.Information,`WebSocket connected to ${c}.`),this._webSocket=n,r=!0,t()},n.onerror=e=>{let t=null;t="undefined"!=typeof ErrorEvent&&e instanceof ErrorEvent?e.error:"There was an error with the transport",this._logger.log(ae.a.Information,`(WebSockets transport) ${t}.`)},n.onmessage=e=>{if(this._logger.log(ae.a.Trace,`(WebSockets transport) data received. ${Object(ce.f)(e.data,this._logMessageContent)}.`),this.onreceive)try{this.onreceive(e.data)}catch(e){return void this._close(e)}},n.onclose=t=>{if(r)this._close(t);else{let e=null;e="undefined"!=typeof ErrorEvent&&t instanceof ErrorEvent?t.error:"WebSocket failed to connect. The connection could not be found on the server, either the endpoint may not be a SignalR endpoint, the connection ID is not present on the server, or there is a proxy blocking WebSockets. If you have multiple servers check that sticky sessions are enabled.",i(new Error(e))}}})}send(e){return this._webSocket&&this._webSocket.readyState===this._webSocketConstructor.OPEN?(this._logger.log(ae.a.Trace,`(WebSockets transport) sending data. ${Object(ce.f)(e,this._logMessageContent)}.`),this._webSocket.send(e),Promise.resolve()):Promise.reject("WebSocket is not in the OPEN state")}stop(){return this._webSocket&&this._close(void 0),Promise.resolve()}_close(e){this._webSocket&&(this._webSocket.onclose=()=>{},this._webSocket.onmessage=()=>{},this._webSocket.onerror=()=>{},this._webSocket.close(),this._webSocket=void 0),this._logger.log(ae.a.Trace,"(WebSockets transport) socket closed."),this.onclose&&(!this._isCloseEvent(e)||!1!==e.wasClean&&1e3===e.code?e instanceof Error?this.onclose(e):this.onclose():this.onclose(new Error(`WebSocket closed with status code: ${e.code} (${e.reason||"no reason given"}).`)))}_isCloseEvent(e){return e&&"boolean"==typeof e.wasClean&&"number"==typeof e.code}}class ye{constructor(e,t={}){if(this._stopPromiseResolver=()=>{},this.features={},this._negotiateVersion=1,ce.a.isRequired(e,"url"),this._logger=Object(ce.e)(t.logger),this.baseUrl=this._resolveUrl(e),(t=t||{}).logMessageContent=void 0!==t.logMessageContent&&t.logMessageContent,"boolean"!=typeof t.withCredentials&&void 0!==t.withCredentials)throw new Error("withCredentials option was not a 'boolean' or 'undefined' value");t.withCredentials=void 0===t.withCredentials||t.withCredentials,t.timeout=void 0===t.timeout?1e5:t.timeout;let i=null,n=null;if(ce.c.isNode){const r=require;i=r("ws"),n=r("eventsource")}ce.c.isNode||"undefined"==typeof WebSocket||t.WebSocket?ce.c.isNode&&!t.WebSocket&&i&&(t.WebSocket=i):t.WebSocket=WebSocket,ce.c.isNode||"undefined"==typeof EventSource||t.EventSource?ce.c.isNode&&!t.EventSource&&void 0!==n&&(t.EventSource=n):t.EventSource=EventSource,this._httpClient=t.httpClient||new de(this._logger),this._connectionState="Disconnected",this._connectionStarted=!1,this._options=t,this.onreceive=null,this.onclose=null}async start(e){if(e=e||re.Binary,ce.a.isIn(e,re,"transferFormat"),this._logger.log(ae.a.Debug,`Starting connection with transfer format '${re[e]}'.`),"Disconnected"!==this._connectionState)return Promise.reject(new Error("Cannot start an HttpConnection that is not in the 'Disconnected' state."));if(this._connectionState="Connecting",this._startInternalPromise=this._startInternal(e),await this._startInternalPromise,"Disconnecting"===this._connectionState){var t="Failed to start the HttpConnection before stop() was called.";return this._logger.log(ae.a.Error,t),await this._stopPromise,Promise.reject(new Error(t))}if("Connected"!==this._connectionState){t="HttpConnection.startInternal completed gracefully but didn't enter the connection into the connected state!";return this._logger.log(ae.a.Error,t),Promise.reject(new Error(t))}this._connectionStarted=!0}send(e){return"Connected"!==this._connectionState?Promise.reject(new Error("Cannot send data if the connection is not in the 'Connected' State.")):(this._sendQueue||(this._sendQueue=new be(this.transport)),this._sendQueue.send(e))}async stop(e){return"Disconnected"===this._connectionState?(this._logger.log(ae.a.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnected state.`),Promise.resolve()):"Disconnecting"===this._connectionState?(this._logger.log(ae.a.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnecting state.`),this._stopPromise):(this._connectionState="Disconnecting",this._stopPromise=new Promise(e=>{this._stopPromiseResolver=e}),await this._stopInternal(e),void await this._stopPromise)}async _stopInternal(e){this._stopError=e;try{await this._startInternalPromise}catch(e){}if(this.transport){try{await this.transport.stop()}catch(e){this._logger.log(ae.a.Error,`HttpConnection.transport.stop() threw error '${e}'.`),this._stopConnection()}this.transport=void 0}else this._logger.log(ae.a.Debug,"HttpConnection.transport is undefined in HttpConnection.stop() because start() failed.")}async _startInternal(i){let n=this.baseUrl;this._accessTokenFactory=this._options.accessTokenFactory;try{if(this._options.skipNegotiation){if(this._options.transport!==ne.WebSockets)throw new Error("Negotiation can only be skipped when using the WebSocket transport directly.");this.transport=this._constructTransport(ne.WebSockets),await this._startTransport(n,i)}else{let e=null,t=0;do{if(e=await this._getNegotiationResponse(n),"Disconnecting"===this._connectionState||"Disconnected"===this._connectionState)throw new Error("The connection was stopped during negotiation.");if(e.error)throw new Error(e.error);if(e.ProtocolVersion)throw new Error("Detected a connection attempt to an ASP.NET SignalR Server. This client only supports connecting to an ASP.NET Core SignalR Server. See https://aka.ms/signalr-core-differences for details.");if(e.url&&(n=e.url),e.accessToken){const r=e.accessToken;this._accessTokenFactory=()=>r}}while(t++,e.url&&t<100);if(100===t&&e.url)throw new Error("Negotiate redirection limit exceeded.");await this._createTransport(n,this._options.transport,e,i)}this.transport instanceof ge&&(this.features.inherentKeepAlive=!0),"Connecting"===this._connectionState&&(this._logger.log(ae.a.Debug,"The HttpConnection connected successfully."),this._connectionState="Connected")}catch(e){return this._logger.log(ae.a.Error,"Failed to start the connection: "+e),this._connectionState="Disconnected",this.transport=void 0,this._stopPromiseResolver(),Promise.reject(e)}}async _getNegotiationResponse(e){const t={};!this._accessTokenFactory||(n=await this._accessTokenFactory())&&(t[pe.Authorization]=`Bearer ${n}`);var[i,n]=Object(ce.i)();t[i]=n;e=this._resolveNegotiateUrl(e);this._logger.log(ae.a.Debug,`Sending negotiation request: ${e}.`);try{var r=await this._httpClient.post(e,{content:"",headers:{...t,...this._options.headers},timeout:this._options.timeout,withCredentials:this._options.withCredentials});if(200!==r.statusCode)return Promise.reject(new Error(`Unexpected status code returned from negotiate '${r.statusCode}'`));const s=JSON.parse(r.content);return(!s.negotiateVersion||s.negotiateVersion<1)&&(s.connectionToken=s.connectionId),s}catch(e){let t="Failed to complete negotiation with the server: "+e;return e instanceof $&&404===e.statusCode&&(t+=" Either this is not a SignalR endpoint or there is a proxy blocking the connection."),this._logger.log(ae.a.Error,t),Promise.reject(new Z(t))}}_createConnectUrl(e,t){return t?e+(-1===e.indexOf("?")?"?":"&")+`id=${t}`:e}async _createTransport(e,t,i,n){let r=this._createConnectUrl(e,i.connectionToken);if(this._isITransport(t))return this._logger.log(ae.a.Debug,"Connection was provided an instance of ITransport, using that directly."),this.transport=t,await this._startTransport(r,n),void(this.connectionId=i.connectionId);const s=[];let o=i;for(const c of i.availableTransports||[]){var a=this._resolveTransportOrError(c,t,n);if(a instanceof Error)s.push(`${c.transport} failed:`),s.push(a);else if(this._isITransport(a)){if(this.transport=a,!o){try{o=await this._getNegotiationResponse(e)}catch(e){return Promise.reject(e)}r=this._createConnectUrl(e,o.connectionToken)}try{return await this._startTransport(r,n),void(this.connectionId=o.connectionId)}catch(e){if(this._logger.log(ae.a.Error,`Failed to start the transport '${c.transport}': ${e}`),o=void 0,s.push(new Q(`${c.transport} failed: ${e}`,ne[c.transport])),"Connecting"!==this._connectionState){a="Failed to select transport before stop() was called.";return this._logger.log(ae.a.Debug,a),Promise.reject(new Error(a))}}}}return 0<s.length?Promise.reject(new ee(`Unable to connect to the server with any of the available transports. ${s.join(" ")}`,s)):Promise.reject(new Error("None of the transports supported by the client are supported by the server."))}_constructTransport(e){switch(e){case ne.WebSockets:if(!this._options.WebSocket)throw new Error("'WebSocket' is not supported in your environment.");return new ve(this._httpClient,this._accessTokenFactory,this._logger,this._options.logMessageContent,this._options.WebSocket,this._options.headers||{});case ne.ServerSentEvents:if(!this._options.EventSource)throw new Error("'EventSource' is not supported in your environment.");return new me(this._httpClient,this._accessTokenFactory,this._logger,this._options);case ne.LongPolling:return new ge(this._httpClient,this._accessTokenFactory,this._logger,this._options);default:throw new Error(`Unknown transport: ${e}.`)}}_startTransport(e,t){return this.transport.onreceive=this.onreceive,this.transport.onclose=e=>this._stopConnection(e),this.transport.connect(e,t)}_resolveTransportOrError(e,t,i){var n,r=ne[e.transport];if(null==r)return this._logger.log(ae.a.Debug,`Skipping transport '${e.transport}' because it is not supported by this client.`),new Error(`Skipping transport '${e.transport}' because it is not supported by this client.`);if(n=r,(t=t)&&0==(n&t))return this._logger.log(ae.a.Debug,`Skipping transport '${ne[r]}' because it was disabled by the client.`),new J(`'${ne[r]}' is disabled by the client.`,r);{const s=e.transferFormats.map(e=>re[e]);if(!(0<=s.indexOf(i)))return this._logger.log(ae.a.Debug,`Skipping transport '${ne[r]}' because it does not support the requested transfer format '${re[i]}'.`),new Error(`'${ne[r]}' does not support ${re[i]}.`);if(r===ne.WebSockets&&!this._options.WebSocket||r===ne.ServerSentEvents&&!this._options.EventSource)return this._logger.log(ae.a.Debug,`Skipping transport '${ne[r]}' because it is not supported in your environment.'`),new K(`'${ne[r]}' is not supported in your environment.`,r);this._logger.log(ae.a.Debug,`Selecting transport '${ne[r]}'.`);try{return this._constructTransport(r)}catch(e){return e}}}_isITransport(e){return e&&"object"==typeof e&&"connect"in e}_stopConnection(t){if(this._logger.log(ae.a.Debug,`HttpConnection.stopConnection(${t}) called while in state ${this._connectionState}.`),this.transport=void 0,t=this._stopError||t,this._stopError=void 0,"Disconnected"!==this._connectionState){if("Connecting"===this._connectionState)throw this._logger.log(ae.a.Warning,`Call to HttpConnection.stopConnection(${t}) was ignored because the connection is still in the connecting state.`),new Error(`HttpConnection.stopConnection(${t}) was called while the connection is still in the connecting state.`);if("Disconnecting"===this._connectionState&&this._stopPromiseResolver(),t?this._logger.log(ae.a.Error,`Connection disconnected with error '${t}'.`):this._logger.log(ae.a.Information,"Connection disconnected."),this._sendQueue&&(this._sendQueue.stop().catch(e=>{this._logger.log(ae.a.Error,`TransportSendQueue.stop() threw error '${e}'.`)}),this._sendQueue=void 0),this.connectionId=void 0,this._connectionState="Disconnected",this._connectionStarted){this._connectionStarted=!1;try{this.onclose&&this.onclose(t)}catch(e){this._logger.log(ae.a.Error,`HttpConnection.onclose(${t}) threw error '${e}'.`)}}}else this._logger.log(ae.a.Debug,`Call to HttpConnection.stopConnection(${t}) was ignored because the connection is already in the disconnected state.`)}_resolveUrl(e){if(0===e.lastIndexOf("https://",0)||0===e.lastIndexOf("http://",0))return e;if(!ce.c.isBrowser)throw new Error(`Cannot resolve '${e}'.`);const t=window.document.createElement("a");return t.href=e,this._logger.log(ae.a.Information,`Normalizing '${e}' to '${t.href}'.`),t.href}_resolveNegotiateUrl(e){var t=e.indexOf("?");let i=e.substring(0,-1===t?e.length:t);return"/"!==i[i.length-1]&&(i+="/"),i+="negotiate",i+=-1===t?"":e.substring(t),-1===i.indexOf("negotiateVersion")&&(i+=-1===t?"?":"&",i+="negotiateVersion="+this._negotiateVersion),i}}class be{constructor(e){this._transport=e,this._buffer=[],this._executing=!0,this._sendBufferedData=new we,this._transportResult=new we,this._sendLoopPromise=this._sendLoop()}send(e){return this._bufferData(e),this._transportResult||(this._transportResult=new we),this._transportResult.promise}stop(){return this._executing=!1,this._sendBufferedData.resolve(),this._sendLoopPromise}_bufferData(e){if(this._buffer.length&&typeof this._buffer[0]!=typeof e)throw new Error(`Expected data to be of type ${typeof this._buffer} but was of type ${typeof e}`);this._buffer.push(e),this._sendBufferedData.resolve()}async _sendLoop(){for(;;){if(await this._sendBufferedData.promise,!this._executing){this._transportResult&&this._transportResult.reject("Connection stopped.");break}this._sendBufferedData=new we;const t=this._transportResult;this._transportResult=void 0;var e="string"==typeof this._buffer[0]?this._buffer.join(""):be._concatBuffers(this._buffer);this._buffer.length=0;try{await this._transport.send(e),t.resolve()}catch(e){t.reject(e)}}}static _concatBuffers(e){var t=e.map(e=>e.byteLength).reduce((e,t)=>e+t);const i=new Uint8Array(t);let n=0;for(const r of e)i.set(new Uint8Array(r),n),n+=r.byteLength;return i.buffer}}class we{constructor(){this.promise=new Promise((e,t)=>[this._resolver,this._rejecter]=[e,t])}resolve(){this._resolver()}reject(e){this._rejecter(e)}}class _e{static write(e){return`${e}${_e.RecordSeparator}`}static parse(e){if(e[e.length-1]!==_e.RecordSeparator)throw new Error("Message is incomplete.");const t=e.split(_e.RecordSeparator);return t.pop(),t}}_e.RecordSeparatorCode=30,_e.RecordSeparator=String.fromCharCode(_e.RecordSeparatorCode);class Ae{writeHandshakeRequest(e){return _e.write(JSON.stringify(e))}parseHandshakeResponse(e){let t,i;if(Object(ce.j)(e)){const s=new Uint8Array(e);var n=s.indexOf(_e.RecordSeparatorCode);if(-1===n)throw new Error("Message is incomplete.");n=n+1;t=String.fromCharCode.apply(null,Array.prototype.slice.call(s.slice(0,n))),i=s.byteLength>n?s.slice(n).buffer:null}else{const o=e;var r=o.indexOf(_e.RecordSeparator);if(-1===r)throw new Error("Message is incomplete.");r=r+1;t=o.substring(0,r),i=o.length>r?o.substring(r):null}r=_e.parse(t),r=JSON.parse(r[0]);if(r.type)throw new Error("Expected a handshake response from the server.");return[i,r]}}(t=se=se||{})[t.Invocation=1]="Invocation",t[t.StreamItem=2]="StreamItem",t[t.Completion=3]="Completion",t[t.StreamInvocation=4]="StreamInvocation",t[t.CancelInvocation=5]="CancelInvocation",t[t.Ping=6]="Ping",t[t.Close=7]="Close";class Be{constructor(){this.observers=[]}next(e){for(const t of this.observers)t.next(e)}error(e){for(const t of this.observers)t.error&&t.error(e)}complete(){for(const e of this.observers)e.complete&&e.complete()}subscribe(e){return this.observers.push(e),new ce.d(this,e)}}(t=oe=oe||{}).Disconnected="Disconnected",t.Connecting="Connecting",t.Connected="Connected",t.Disconnecting="Disconnecting",t.Reconnecting="Reconnecting";class xe{constructor(e,t,i,n){this._nextKeepAlive=0,this._freezeEventListener=()=>{this._logger.log(ae.a.Warning,"The page is being frozen, this will likely lead to the connection being closed and messages being lost. For more information see the docs at https://docs.microsoft.com/aspnet/core/signalr/javascript-client#bsleep")},ce.a.isRequired(e,"connection"),ce.a.isRequired(t,"logger"),ce.a.isRequired(i,"protocol"),this.serverTimeoutInMilliseconds=3e4,this.keepAliveIntervalInMilliseconds=15e3,this._logger=t,this._protocol=i,this.connection=e,this._reconnectPolicy=n,this._handshakeProtocol=new Ae,this.connection.onreceive=e=>this._processIncomingData(e),this.connection.onclose=e=>this._connectionClosed(e),this._callbacks={},this._methods={},this._closedCallbacks=[],this._reconnectingCallbacks=[],this._reconnectedCallbacks=[],this._invocationId=0,this._receivedHandshakeResponse=!1,this._connectionState=oe.Disconnected,this._connectionStarted=!1,this._cachedPingMessage=this._protocol.writeMessage({type:se.Ping})}static create(e,t,i,n){return new xe(e,t,i,n)}get state(){return this._connectionState}get connectionId(){return this.connection&&this.connection.connectionId||null}get baseUrl(){return this.connection.baseUrl||""}set baseUrl(e){if(this._connectionState!==oe.Disconnected&&this._connectionState!==oe.Reconnecting)throw new Error("The HubConnection must be in the Disconnected or Reconnecting state to change the url.");if(!e)throw new Error("The HubConnection url must be a valid url.");this.connection.baseUrl=e}start(){return this._startPromise=this._startWithStateTransitions(),this._startPromise}async _startWithStateTransitions(){if(this._connectionState!==oe.Disconnected)return Promise.reject(new Error("Cannot start a HubConnection that is not in the 'Disconnected' state."));this._connectionState=oe.Connecting,this._logger.log(ae.a.Debug,"Starting HubConnection.");try{await this._startInternal(),ce.c.isBrowser&&window.document.addEventListener("freeze",this._freezeEventListener),this._connectionState=oe.Connected,this._connectionStarted=!0,this._logger.log(ae.a.Debug,"HubConnection connected successfully.")}catch(e){return this._connectionState=oe.Disconnected,this._logger.log(ae.a.Debug,`HubConnection failed to start successfully because of error '${e}'.`),Promise.reject(e)}}async _startInternal(){this._stopDuringStartError=void 0,this._receivedHandshakeResponse=!1;var e=new Promise((e,t)=>{this._handshakeResolver=e,this._handshakeRejecter=t});await this.connection.start(this._protocol.transferFormat);try{var t={protocol:this._protocol.name,version:this._protocol.version};if(this._logger.log(ae.a.Debug,"Sending handshake request."),await this._sendMessage(this._handshakeProtocol.writeHandshakeRequest(t)),this._logger.log(ae.a.Information,`Using HubProtocol '${this._protocol.name}'.`),this._cleanupTimeout(),this._resetTimeoutPeriod(),this._resetKeepAliveInterval(),await e,this._stopDuringStartError)throw this._stopDuringStartError}catch(e){throw this._logger.log(ae.a.Debug,`Hub handshake failed with error '${e}' during start(). Stopping HubConnection.`),this._cleanupTimeout(),this._cleanupPingTimer(),await this.connection.stop(e),e}}async stop(){var e=this._startPromise;this._stopPromise=this._stopInternal(),await this._stopPromise;try{await e}catch(e){}}_stopInternal(e){return this._connectionState===oe.Disconnected?(this._logger.log(ae.a.Debug,`Call to HubConnection.stop(${e}) ignored because it is already in the disconnected state.`),Promise.resolve()):this._connectionState===oe.Disconnecting?(this._logger.log(ae.a.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnecting state.`),this._stopPromise):(this._connectionState=oe.Disconnecting,this._logger.log(ae.a.Debug,"Stopping HubConnection."),this._reconnectDelayHandle?(this._logger.log(ae.a.Debug,"Connection stopped during reconnect delay. Done reconnecting."),clearTimeout(this._reconnectDelayHandle),this._reconnectDelayHandle=void 0,this._completeClose(),Promise.resolve()):(this._cleanupTimeout(),this._cleanupPingTimer(),this._stopDuringStartError=e||new Error("The connection was stopped before the hub handshake could complete."),this.connection.stop(e)))}stream(e,...t){var[i,n]=this._replaceStreamingParams(t);const r=this._createStreamInvocation(e,t,n);let s;const o=new Be;return o.cancelCallback=()=>{const e=this._createCancelInvocation(r.invocationId);return delete this._callbacks[r.invocationId],s.then(()=>this._sendWithProtocol(e))},this._callbacks[r.invocationId]=(e,t)=>{t?o.error(t):e&&(e.type===se.Completion?e.error?o.error(new Error(e.error)):o.complete():o.next(e.item))},s=this._sendWithProtocol(r).catch(e=>{o.error(e),delete this._callbacks[r.invocationId]}),this._launchStreams(i,s),o}_sendMessage(e){return this._resetKeepAliveInterval(),this.connection.send(e)}_sendWithProtocol(e){return this._sendMessage(this._protocol.writeMessage(e))}send(e,...t){var[i,n]=this._replaceStreamingParams(t),n=this._sendWithProtocol(this._createInvocation(e,t,!0,n));return this._launchStreams(i,n),n}invoke(e,...t){const[r,i]=this._replaceStreamingParams(t),s=this._createInvocation(e,t,!1,i);return new Promise((i,n)=>{this._callbacks[s.invocationId]=(e,t)=>{t?n(t):e&&(e.type===se.Completion?e.error?n(new Error(e.error)):i(e.result):n(new Error(`Unexpected message type: ${e.type}`)))};var e=this._sendWithProtocol(s).catch(e=>{n(e),delete this._callbacks[s.invocationId]});this._launchStreams(r,e)})}on(e,t){e&&t&&(e=e.toLowerCase(),this._methods[e]||(this._methods[e]=[]),-1===this._methods[e].indexOf(t)&&this._methods[e].push(t))}off(e,t){if(e){e=e.toLowerCase();const i=this._methods[e];i&&(t?-1!==(t=i.indexOf(t))&&(i.splice(t,1),0===i.length&&delete this._methods[e]):delete this._methods[e])}}onclose(e){e&&this._closedCallbacks.push(e)}onreconnecting(e){e&&this._reconnectingCallbacks.push(e)}onreconnected(e){e&&this._reconnectedCallbacks.push(e)}_processIncomingData(e){if(this._cleanupTimeout(),this._receivedHandshakeResponse||(e=this._processHandshakeResponse(e),this._receivedHandshakeResponse=!0),e)for(const i of this._protocol.parseMessages(e,this._logger))switch(i.type){case se.Invocation:this._invokeClientMethod(i);break;case se.StreamItem:case se.Completion:{const n=this._callbacks[i.invocationId];if(n){i.type===se.Completion&&delete this._callbacks[i.invocationId];try{n(i)}catch(e){this._logger.log(ae.a.Error,`Stream callback threw error: ${Object(ce.g)(e)}`)}}break}case se.Ping:break;case se.Close:this._logger.log(ae.a.Information,"Close message received from server.");var t=i.error?new Error("Server returned an error on close: "+i.error):void 0;!0===i.allowReconnect?this.connection.stop(t):this._stopPromise=this._stopInternal(t);break;default:this._logger.log(ae.a.Warning,`Invalid message type: ${i.type}.`)}this._resetTimeoutPeriod()}_processHandshakeResponse(e){let t,i;try{[i,t]=this._handshakeProtocol.parseHandshakeResponse(e)}catch(e){var n="Error parsing handshake response: "+e;this._logger.log(ae.a.Error,n);n=new Error(n);throw this._handshakeRejecter(n),n}if(t.error){n="Server returned handshake error: "+t.error;this._logger.log(ae.a.Error,n);n=new Error(n);throw this._handshakeRejecter(n),n}return this._logger.log(ae.a.Debug,"Server handshake complete."),this._handshakeResolver(),i}_resetKeepAliveInterval(){this.connection.features.inherentKeepAlive||(this._nextKeepAlive=(new Date).getTime()+this.keepAliveIntervalInMilliseconds,this._cleanupPingTimer())}_resetTimeoutPeriod(){if(!(this.connection.features&&this.connection.features.inherentKeepAlive||(this._timeoutHandle=setTimeout(()=>this.serverTimeout(),this.serverTimeoutInMilliseconds),void 0!==this._pingServerHandle))){let e=this._nextKeepAlive-(new Date).getTime();e<0&&(e=0),this._pingServerHandle=setTimeout(async()=>{if(this._connectionState===oe.Connected)try{await this._sendMessage(this._cachedPingMessage)}catch{this._cleanupPingTimer()}},e)}}serverTimeout(){this.connection.stop(new Error("Server timeout elapsed without receiving a message from the server."))}_invokeClientMethod(t){const e=this._methods[t.target.toLowerCase()];if(e){try{e.forEach(e=>e.apply(this,t.arguments))}catch(e){this._logger.log(ae.a.Error,`A callback for the method ${t.target.toLowerCase()} threw error '${e}'.`)}var i;t.invocationId&&(this._logger.log(ae.a.Error,i="Server requested a response, which is not supported in this version of the client."),this._stopPromise=this._stopInternal(new Error(i)))}else this._logger.log(ae.a.Warning,`No client method with the name '${t.target}' found.`)}_connectionClosed(e){this._logger.log(ae.a.Debug,`HubConnection.connectionClosed(${e}) called while in state ${this._connectionState}.`),this._stopDuringStartError=this._stopDuringStartError||e||new Error("The underlying connection was closed before the hub handshake could complete."),this._handshakeResolver&&this._handshakeResolver(),this._cancelCallbacksWithError(e||new Error("Invocation canceled due to the underlying connection being closed.")),this._cleanupTimeout(),this._cleanupPingTimer(),this._connectionState===oe.Disconnecting?this._completeClose(e):this._connectionState===oe.Connected&&this._reconnectPolicy?this._reconnect(e):this._connectionState===oe.Connected&&this._completeClose(e)}_completeClose(t){if(this._connectionStarted){this._connectionState=oe.Disconnected,this._connectionStarted=!1,ce.c.isBrowser&&window.document.removeEventListener("freeze",this._freezeEventListener);try{this._closedCallbacks.forEach(e=>e.apply(this,[t]))}catch(e){this._logger.log(ae.a.Error,`An onclose callback called with error '${t}' threw error '${e}'.`)}}}async _reconnect(t){var i=Date.now();let n=0;var r=void 0!==t?t:new Error("Attempting to reconnect due to a unknown error.");let s=this._getNextRetryDelay(n++,0,r);if(null===s)return this._logger.log(ae.a.Debug,"Connection not reconnecting because the IRetryPolicy returned null on the first reconnect attempt."),void this._completeClose(t);if(this._connectionState=oe.Reconnecting,t?this._logger.log(ae.a.Information,`Connection reconnecting because of error '${t}'.`):this._logger.log(ae.a.Information,"Connection reconnecting."),0!==this._reconnectingCallbacks.length){try{this._reconnectingCallbacks.forEach(e=>e.apply(this,[t]))}catch(e){this._logger.log(ae.a.Error,`An onreconnecting callback called with error '${t}' threw error '${e}'.`)}if(this._connectionState!==oe.Reconnecting)return void this._logger.log(ae.a.Debug,"Connection left the reconnecting state in onreconnecting callback. Done reconnecting.")}for(;null!==s;){if(this._logger.log(ae.a.Information,`Reconnect attempt number ${n} will start in ${s} ms.`),await new Promise(e=>{this._reconnectDelayHandle=setTimeout(e,s)}),this._reconnectDelayHandle=void 0,this._connectionState!==oe.Reconnecting)return void this._logger.log(ae.a.Debug,"Connection left the reconnecting state during reconnect delay. Done reconnecting.");try{if(await this._startInternal(),this._connectionState=oe.Connected,this._logger.log(ae.a.Information,"HubConnection reconnected successfully."),0!==this._reconnectedCallbacks.length)try{this._reconnectedCallbacks.forEach(e=>e.apply(this,[this.connection.connectionId]))}catch(e){this._logger.log(ae.a.Error,`An onreconnected callback called with connectionId '${this.connection.connectionId}; threw error '${e}'.`)}return}catch(e){if(this._logger.log(ae.a.Information,`Reconnect attempt failed because of error '${e}'.`),this._connectionState!==oe.Reconnecting)return this._logger.log(ae.a.Debug,`Connection moved to the '${this._connectionState}' from the reconnecting state during reconnect attempt. Done reconnecting.`),void(this._connectionState===oe.Disconnecting&&this._completeClose());r=e instanceof Error?e:new Error(e.toString()),s=this._getNextRetryDelay(n++,Date.now()-i,r)}}this._logger.log(ae.a.Information,`Reconnect retries have been exhausted after ${Date.now()-i} ms and ${n} failed attempts. Connection disconnecting.`),this._completeClose()}_getNextRetryDelay(t,i,e){try{return this._reconnectPolicy.nextRetryDelayInMilliseconds({elapsedMilliseconds:i,previousRetryCount:t,retryReason:e})}catch(e){return this._logger.log(ae.a.Error,`IRetryPolicy.nextRetryDelayInMilliseconds(${t}, ${i}) threw error '${e}'.`),null}}_cancelCallbacksWithError(i){const n=this._callbacks;this._callbacks={},Object.keys(n).forEach(e=>{const t=n[e];try{t(null,i)}catch(e){this._logger.log(ae.a.Error,`Stream 'error' callback called with '${i}' threw error: ${Object(ce.g)(e)}`)}})}_cleanupPingTimer(){this._pingServerHandle&&(clearTimeout(this._pingServerHandle),this._pingServerHandle=void 0)}_cleanupTimeout(){this._timeoutHandle&&clearTimeout(this._timeoutHandle)}_createInvocation(e,t,i,n){if(i)return 0!==n.length?{arguments:t,streamIds:n,target:e,type:se.Invocation}:{arguments:t,target:e,type:se.Invocation};{const r=this._invocationId;return this._invocationId++,0!==n.length?{arguments:t,invocationId:r.toString(),streamIds:n,target:e,type:se.Invocation}:{arguments:t,invocationId:r.toString(),target:e,type:se.Invocation}}}_launchStreams(e,i){if(0!==e.length){i=i||Promise.resolve();for(const n in e)e[n].subscribe({complete:()=>{i=i.then(()=>this._sendWithProtocol(this._createCompletionMessage(n)))},error:e=>{let t;t=e instanceof Error?e.message:e&&e.toString?e.toString():"Unknown error",i=i.then(()=>this._sendWithProtocol(this._createCompletionMessage(n,t)))},next:e=>{i=i.then(()=>this._sendWithProtocol(this._createStreamItemMessage(n,e)))}})}}_replaceStreamingParams(t){const i=[],n=[];for(let e=0;e<t.length;e++){var r=t[e];if(this._isObservable(r)){const s=this._invocationId;this._invocationId++,i[s]=r,n.push(s.toString()),t.splice(e,1)}}return[i,n]}_isObservable(e){return e&&e.subscribe&&"function"==typeof e.subscribe}_createStreamInvocation(e,t,i){const n=this._invocationId;return this._invocationId++,0!==i.length?{arguments:t,invocationId:n.toString(),streamIds:i,target:e,type:se.StreamInvocation}:{arguments:t,invocationId:n.toString(),target:e,type:se.StreamInvocation}}_createCancelInvocation(e){return{invocationId:e,type:se.CancelInvocation}}_createStreamItemMessage(e,t){return{invocationId:e,item:t,type:se.StreamItem}}_createCompletionMessage(e,t,i){return t?{error:t,invocationId:e,type:se.Completion}:{invocationId:e,result:i,type:se.Completion}}}var Ee=i(11);class Ce{constructor(){this.name="json",this.version=1,this.transferFormat=re.Text}parseMessages(e,t){if("string"!=typeof e)throw new Error("Invalid input for JSON hub protocol. Expected a string.");if(!e)return[];null===t&&(t=Ee.a.instance);const i=[];for(const r of _e.parse(e)){var n=JSON.parse(r);if("number"!=typeof n.type)throw new Error("Invalid payload.");switch(n.type){case se.Invocation:this._isInvocationMessage(n);break;case se.StreamItem:this._isStreamItemMessage(n);break;case se.Completion:this._isCompletionMessage(n);break;case se.Ping:case se.Close:break;default:t.log(ae.a.Information,"Unknown message type '"+n.type+"' ignored.");continue}i.push(n)}return i}writeMessage(e){return _e.write(JSON.stringify(e))}_isInvocationMessage(e){this._assertNotEmptyString(e.target,"Invalid payload for Invocation message."),void 0!==e.invocationId&&this._assertNotEmptyString(e.invocationId,"Invalid payload for Invocation message.")}_isStreamItemMessage(e){if(this._assertNotEmptyString(e.invocationId,"Invalid payload for StreamItem message."),void 0===e.item)throw new Error("Invalid payload for StreamItem message.")}_isCompletionMessage(e){if(e.result&&e.error)throw new Error("Invalid payload for Completion message.");!e.result&&e.error&&this._assertNotEmptyString(e.error,"Invalid payload for Completion message."),this._assertNotEmptyString(e.invocationId,"Invalid payload for Completion message.")}_assertNotEmptyString(e,t){if("string"!=typeof e||""===e)throw new Error(t)}}const Se={trace:ae.a.Trace,debug:ae.a.Debug,info:ae.a.Information,information:ae.a.Information,warn:ae.a.Warning,warning:ae.a.Warning,error:ae.a.Error,critical:ae.a.Critical,none:ae.a.None};class Te{configureLogging(e){var t;return ce.a.isRequired(e,"logging"),void 0!==e.log?this.logger=e:"string"==typeof e?(t=function(e){var t=Se[e.toLowerCase()];if(void 0!==t)return t;throw new Error(`Unknown log level: ${e}`)}(e),this.logger=new ce.b(t)):this.logger=new ce.b(e),this}withUrl(e,t){return ce.a.isRequired(e,"url"),ce.a.isNotEmpty(e,"url"),this.url=e,this.httpConnectionOptions="object"==typeof t?{...this.httpConnectionOptions,...t}:{...this.httpConnectionOptions,transport:t},this}withHubProtocol(e){return ce.a.isRequired(e,"protocol"),this.protocol=e,this}withAutomaticReconnect(e){if(this.reconnectPolicy)throw new Error("A reconnectPolicy has already been set.");return e?Array.isArray(e)?this.reconnectPolicy=new W(e):this.reconnectPolicy=e:this.reconnectPolicy=new W,this}build(){const e=this.httpConnectionOptions||{};if(void 0===e.logger&&(e.logger=this.logger),!this.url)throw new Error("The 'HubConnectionBuilder.withUrl' method must be called before building the connection.");var t=new ye(this.url,e);return xe.create(t,this.logger||Ee.a.instance,this.protocol||new Ce,this.reconnectPolicy)}}class ke{}ke.sl="https://www.wodashijie.com/",ke.rl="https://models.wodashijie.com/",ke.App=class{constructor(e){e.sl&&(ke.sl=e.sl),e.rl&&(ke.rl=e.rl),A.defaults.baseURL=ke.sl,this.canvas=document.createElement("canvas"),this.canvas.style.cssText="width: 100%;height: 100%;background-color: transparent;outline-width: 0;-webkit-tap-highlight-color:transparent;",e.container.appendChild(this.canvas),this.engine=new BABYLON.Engine(this.canvas,!0,{premultipliedAlpha:!0,preserveDrawingBuffer:!0,stencil:!0}),this.engine.setHardwareScalingLevel(.5),this.engine.enableOfflineSupport=!1,this.scene=new BABYLON.Scene(this.engine,{useGeometryUniqueIdsMap:!0,useClonedMeshMap:!0,useMaterialMeshMap:!0}),this.scene.useRightHandedSystem=!0,this.scene.getBoundingBoxRenderer().frontColor=BABYLON.Color3.Green(),this.scene.getBoundingBoxRenderer().showBackLines=!1,this.Camera=new n(this),this.HighlightLayer=new BABYLON.HighlightLayer("highlightLayer",this.scene),this.container=BABYLON.GUI.AdvancedDynamicTexture.CreateFullscreenUI("screenUI"),this.Environment=new m(this),this.Environment.defaultLights(),this.Environment.openAllLight(),this.Resources=new y(this),this.Project=new v(this),ke.EffectMgr.init(),this.engine.runRenderLoop(()=>{this.fps&&(this.fps.innerText=this.engine.getFps().toFixed()+" fps"),this.scene.render(),d.a.update()}),window.addEventListener("resize",()=>{this.engine.resize()}),this.scene.onPointerObservable.add(e=>{switch(e.type){case BABYLON.PointerEventTypes.POINTERMOVE:if(!this.ToolTips)return;e.pickInfo&&e.pickInfo.pickedPoint?this.ToolTips.update(e):this.ToolTips.close();break;case BABYLON.PointerEventTypes.POINTERWHEEL:var t;this.Camera.isOverLook?this.Camera._wheel(e.event):(t=1e3/(this.Camera.camera.radius/20),this.Camera.camera.panningSensibility=2e3<t?2e3:t<10?10:t),e.event.preventDefault()}}),this.scene.onKeyboardObservable.add(e=>{e.type===BABYLON.KeyboardEventTypes.KEYDOWN&&70===e.event.keyCode&&prompt("请复制输入框内的视角参数",JSON.stringify({alpha:this.Camera.camera.alpha,focus:p.vector3ToJson(this.Camera.camera.target),radius:this.Camera.camera.radius,beta:this.Camera.camera.beta,minimumLimit:this.Camera.camera.lowerRadiusLimit,maximumLimit:this.Camera.camera.upperRadiusLimit,minBeta:this.Camera.camera.lowerBetaLimit,maxBeta:this.Camera.camera.upperBetaLimit}))})}async load(u){if(u){u.isDefaultLevel=null==u.isDefaultLevel||u.isDefaultLevel,ke.pk=u.pk;var e=await A.get(`api/service/GetToken?accessToken=${ke.accessToken}`);if(200==e.status){localStorage.setItem("mx3d-token",e.data);e=await A.get("api/service");if(200==e.status){localStorage.setItem("mx3d-long",e.data);e=await A.get(`api/service/${ke.pk}`);if(200==e.status){let l=JSON.parse(class{static de(e){let t=localStorage.getItem("mx3d-long");var i=D.a.enc.Utf8.parse(t.substring(0,32)),n=D.a.enc.Utf8.parse(t.substring(32,48)),e=D.a.enc.Hex.parse(e),e=D.a.enc.Base64.stringify(e);return D.a.AES.decrypt(e,i,{iv:n,mode:D.a.mode.CBC,padding:D.a.pad.Pkcs7}).toString(D.a.enc.Utf8).toString()}}.de(e.data));return new Promise(async(n,t)=>{try{this.scene.blockfreeActiveMeshesAndRenderingGroups=!0;let t=new f;for(let e=0;e<l.length;e++){const a=l[e];!a.baseModel||".gltf"!=a.baseModel.extension||t.find(a.baseModel.modelId)||this.Resources.resources.find(a.baseModel.modelId)||(a.baseModel.objectType=a.objectType,t.add(a.baseModel.modelId,a.baseModel))}let e=0;for(const c in t.map)await this.Resources.loadModelMesh(t.find(c)),e++,u&&u.progress&&u.progress(e/t.count()*.3);e=0,t=null;let i=new f;for(let e=0;e<l.length;e++){var r,s=l[e];s.objectType==g.Region&&(r=new I(this,s),this.Project.objectDatas.add(r.id,r),i.add(r.id,new Array),"0"==r.parentId&&(this.Project.root=r))}for(let e=0;e<l.length;e++){var o=l[e];if(o.objectType!=g.Region){let e=i.find(o.parentId);e.push(o)}}for(const h in i.map)await this.Project.objectDatas.find(h).bind(i.find(h)),e++,u&&u.progress&&u.progress(.3+e/i.count()*.7);i=null,this.Project.optimization(),u.isDefaultLevel&&this.Project.switchLevel(),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1,n(null),this.engine.resize(),u&&u.complete&&u.complete()}catch(e){t(e)}})}}}}else console.error("场景编号不能为空!")}dispose(){this.Environment.hideFps(),this.Project.clear(),this.Resources.delete(),this.engine.dispose()}},ke.Tools=p,ke.EffectMgr=B,ke.HubService=class{static async listener(e){this.connection=(new Te).withUrl(e).configureLogging(ae.a.Error).build(),this.connection.onclose(async()=>{await this.start()}),await this.start()}static async start(){try{await this.connection.start()}catch(e){console.log("无法连接服务器"),setTimeout(this.start,5e3)}}},ke.UI=class{static createIconFromMesh(e,t,i,n,r){let s=t.Sight.focus.clone();var o=t.instance.getBoundingInfo();return s.y+=(o.boundingBox.maximum.y-o.boundingBox.minimum.y)/2,new j(e,s,i,n,r,t.app.scene)}static createIcon(e,t,i,n){let r;t.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,r=new Y(e,t.app.scene),r.size=i,r.height=n,r.pint=new BABYLON.Mesh(e+"_pint");e=t.Sight.focus.clone();return r.pint.position=e,r.pint.position.y+=n,r.rect=new BABYLON.GUI.Rectangle,r.rect.isPointerBlocker=!1,r.rect.width=i.width+"px",r.rect.height=i.height+"px",r.rect.thickness=0,t.app.container.addControl(r.rect),r.rect.linkWithMesh(r.pint),t.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,r}static create2DLine(t,i,n){if(!(i.length<2)){let e=new z;return e.id=t,e.objs=i,n&&n.width&&(e.width=n.width),n&&n.color&&(e.color=n.color),n&&n.isDotted&&(e.isDotted=n.isDotted),e.update(),e}console.error("要连线的对象不能少于2个。")}static create3DLine(t,i,n){if(!(i.length<2)){let e=new U;return e.id=t,e.objs=i,n&&n.width&&(e.width=n.width),n&&n.color&&(e.color=n.color),e.update(),e}console.error("要连线的对象不能少于2个。")}},ke.HeatMapBuilder=class{static createMatrixCloud(r){r.displayValues=null!=r.displayValues&&r.displayValues,r.isAlpha=null==r.isAlpha||r.isAlpha,r.isParticle=null==r.isParticle||r.isParticle,r.height=r.height||.5,r.radius=r.radius||2.8,r.isLevelRender=null==r.isLevelRender||r.isLevelRender,r.range=r.range||{max:30,min:16};let s;if(!(r.value||r.value.maxX||r.value.maxY||r.value.data||r.anchor))return s;r.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,s=new H(r.anchor);var o=r.anchor.instance.getBoundingInfo();s.mesh=r.anchor.instance.clone(s.id),s.mesh.position.y+=r.height;var a=o.maximum.x-o.minimum.x,c=a/(2*r.value.maxX),h=o.maximum.z-o.minimum.z,l=h/(2*r.value.maxY);let e=new Array;for(let n=0;n<2*r.value.maxX;n++)for(let i=0;i<2*r.value.maxY;i++){let t={x:n,y:i,value:r.range.min};for(let e=0;e<r.value.data.length;e++){var u=r.value.data[e];2*u.x+1==n&&2*u.y+1==i&&(t.value=u.value,u=new BABYLON.Vector3(o.boundingSphere.center.x-(a/2-c*n),s.mesh.position.y,o.boundingSphere.center.z-(h/2-l*i)),s.texts.push(this.createTempVlaue(t.value+"℃",u,r.anchor.app.scene,r.anchor.app.container)))}e.push(t)}s.displayValues=r.displayValues;let t=F.create({width:2*r.value.maxX,height:2*r.value.maxY,radius:r.radius});t.setData({min:r.range.min,max:r.range.max,data:e});let i=new BABYLON.StandardMaterial(s.id,r.anchor.app.scene);return i.diffuseTexture=new BABYLON.Texture(t.getDataURL(),r.anchor.app.scene,!1,!1),i.specularColor=new BABYLON.Color3(0,0,0),i.alpha=.5,r.isAlpha&&(i.diffuseTexture.hasAlpha=!0),r.isParticle&&BABYLON.GPUParticleSystem.IsSupported&&(this._getMatrixParticleTex(ke.rl,r.anchor.app.Resources.FogTex,i.diffuseTexture,s.mesh,r.anchor.app.scene,r.isLevelRender),s.mesh.isVisible=!1),r.isLevelRender&&(s.mesh.renderingGroupId=1),s.mesh.material=i,s.mesh.alwaysSelectAsActiveMesh=!0,s.mesh.freezeWorldMatrix(),r.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,s}static _getMatrixParticleTex(e,t,i,n,r,s){let o,a=t.clone(),c=n.getBoundingInfo().boundingBox;var h=(c.extendSizeWorld.x+c.extendSizeWorld.z)/9,t=1500*h*h;c.minimumWorld.subtract(new BABYLON.Vector3(-0,0,-0)),c.maximumWorld.subtract(new BABYLON.Vector3(0,0,0));o&&o.dispose(),BABYLON.GPUParticleSystem.IsSupported&&(o=new BABYLON.GPUParticleSystem("particles",{capacity:t},r),o.activeParticleCount=t,o.manualEmitCount=o.activeParticleCount,o.minEmitBox=c.minimumWorld,o.maxEmitBox=c.maximumWorld),o.particleTexture=a,o.emitter=n,s&&(o.renderingGroupId=1),o.isLocal=!0;let l=new BABYLON.NodeMaterial("nm_heatmapBox_"+n.id,r);return l.loadAsync(e+"resources/horizontalNodeMat.json").then(()=>{l.build(!1),l.getBlockByName("boxTex").texture=i,l.getBlockByName("emitXMin").value=o.minEmitBox.x,l.getBlockByName("emitXMax").value=o.maxEmitBox.x,l.getBlockByName("emitYMin").value=o.minEmitBox.z,l.getBlockByName("emitYMax").value=o.maxEmitBox.z,l.createEffectForParticles(o)}),n.onDispose=()=>{o&&o.dispose()},o.onDispose=()=>{l&&l.dispose(),a&&a.dispose()},o.color1=new BABYLON.Color4(.8,.8,.8,.1),o.color2=new BABYLON.Color4(.95,.95,.95,.15),o.colorDead=new BABYLON.Color4(.9,.9,.9,.1),o.minSize=1.4,o.maxSize=2,o.minLifeTime=Number.MAX_SAFE_INTEGER,o.emitRate=5e4*h,o.blendMode=BABYLON.ParticleSystem.BLENDMODE_STANDARD,o.gravity=new BABYLON.Vector3(0,0,0),o.direction1=new BABYLON.Vector3(0,0,0),o.direction2=new BABYLON.Vector3(0,0,0),o.minAngularSpeed=-2,o.maxAngularSpeed=2,o.minEmitPower=.5,o.maxEmitPower=1,o.updateSpeed=.005,o.start(),o}static createPunctateCloud(n){if(n.displayValues=null!=n.displayValues&&n.displayValues,n.isAlpha=null==n.isAlpha||n.isAlpha,n.isParticle=null==n.isParticle||n.isParticle,n.radius=n.radius||1,n.isLevelRender=null==n.isLevelRender||n.isLevelRender,n.range=n.range||{max:30,min:16},!n.value&&!n.anchor)return console.error("要创建的云图数值为空!"),null;let e;n.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,e=new H(n.anchor),e.mesh=BABYLON.MeshBuilder.CreatePlane(e.id,{width:1,height:1,sideOrientation:2},n.anchor.app.scene),e.mesh.scaling=new BABYLON.Vector3(n.radius,n.radius,n.radius),e.mesh.alwaysSelectAsActiveMesh=!0,e.mesh.enablePointerMoveEvents=!1,e.mesh.isPickable=!1,e.mesh.position=n.anchor.instance.position.clone(),e.mesh.rotation.x=Math.PI/2;let r=[];for(let i=0;i<6;i++)for(let t=0;t<6;t++){let e={x:i,y:t,value:n.range.min};2==i&&2==t||3==i&&2==t||2==i&&3==t||3==i&&3==t?e.value=n.value:e.value=n.value-2*(Math.abs(2-i)+Math.abs(2-t)),r.push(e)}e.displayValues=n.displayValues;let t=F.create({width:5,height:5,radius:2});t.setData({min:n.range.min,max:n.range.max,data:r});let i=new BABYLON.StandardMaterial(e.id,n.anchor.app.scene);return i.diffuseTexture=new BABYLON.Texture(t.getDataURL(),n.anchor.app.scene,!1,!1),i.specularColor=new BABYLON.Color3(0,0,0),i.alpha=.5,n.isAlpha&&(i.diffuseTexture.hasAlpha=!0),n.isParticle&&BABYLON.GPUParticleSystem.IsSupported&&(this._getColumnarParticleTex(i.diffuseTexture,e.mesh,n.anchor.app.scene,e.anchor.app.Resources.FogTex,n.isLevelRender),e.mesh.isVisible=!1),n.isLevelRender&&(e.mesh.renderingGroupId=1),e.mesh.material=i,e.mesh.alwaysSelectAsActiveMesh=!0,e.mesh.freezeWorldMatrix(),n.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,e}static createColumnCloud(r){if(r.displayValues=null!=r.displayValues&&r.displayValues,r.isAlpha=null==r.isAlpha||r.isAlpha,r.isParticle=null==r.isParticle||r.isParticle,r.radius=r.radius||4,r.isLevelRender=null==r.isLevelRender||r.isLevelRender,r.range=r.range||{max:30,min:16},!r.data&&r.data.length<1&&!r.anchor)return console.error("要创建的云图数值为空!"),null;let i;r.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,i=new H(r.anchor);var n=.98*r.anchor.instance.scaling.y;i.mesh=BABYLON.MeshBuilder.CreatePlane(i.id,{width:.98*r.anchor.instance.scaling.x,height:n,sideOrientation:2},r.anchor.app.scene),i.mesh.alwaysSelectAsActiveMesh=!0,i.mesh.enablePointerMoveEvents=!1,i.mesh.isPickable=!1,i.mesh.position=r.anchor.instance.position.clone(),i.mesh.rotation.z=Math.PI,i.mesh.rotation.y=r.anchor.instance.rotation.y,r.isLevelRender&&(i.mesh.renderingGroupId=1);let e=[];for(let n=0;n<4;n++)for(let i=0;i<3*r.data.length;i++){let t={x:n,y:i,value:r.range.min};for(let e=0;e<r.data.length;e++){var s=r.data[e];2==n&&3*e+2==i&&(t.value=s.value)}e.push(t)}var o=n/r.data.length;for(let t=0;t<r.data.length;t++){let e=i.mesh.position.clone();e.y=e.y-n/2+(n-o*t-o/2),i.texts.push(this.createTempVlaue(r.data[t].value+"℃",e,r.anchor.app.scene,i.anchor.app.container))}i.displayValues=r.displayValues;let t=F.create({width:4,height:3*r.data.length,radius:r.radius});t.setData({min:r.range.min,max:r.range.max,data:e});let a=new BABYLON.StandardMaterial(i.id,r.anchor.app.scene);return a.diffuseTexture=new BABYLON.Texture(t.getDataURL(),r.anchor.app.scene,!1,!1),a.specularColor=new BABYLON.Color3(0,0,0),a.alpha=.5,r.isAlpha&&(a.diffuseTexture.hasAlpha=!0),r.isParticle&&BABYLON.GPUParticleSystem.IsSupported&&(this._getColumnarParticleTex(a.diffuseTexture,i.mesh,r.anchor.app.scene,i.anchor.app.Resources.FogTex,r.isLevelRender),i.mesh.isVisible=!1),i.mesh.material=a,i.mesh.alwaysSelectAsActiveMesh=!0,i.mesh.freezeWorldMatrix(),r.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,i}static _getColumnarParticleTex(e,t,i,n,r){let s,o=n.clone();n=t.getBoundingInfo().boundingBox,n.extendSizeWorld.x,n.extendSizeWorld.z;BABYLON.Effect.ShadersStore.particlesVertexShader=`
25
+ `),n.freeze()}return n}delete(e=!1){if(this.BOX&&this.BOX.dispose(),this.transparentBox&&this.transparentBox.dispose(!0,!0),this.BOX=null,this.transparentBox=null,e){for(const t in this.resources.map)this.resources.find(t).removeAllFromScene(),this.resources.remove(t);this.resources.clear()}}async GetWalls(e,t){let i=await BABYLON.SceneLoader.LoadAssetContainerAsync(e,t+".gltf",this.app.scene);if(i.meshes){var n=i.meshes[0].getChildMeshes();for(let e=0;e<n.length;e++)this.walls.add(n[e].id,n[e])}}}t=i(31);const D=i.n(t).a.create();D.defaults.headers.post["Content-Type"]="application/json",D.interceptors.request.use(e=>{var t=localStorage.getItem("mx3d-token");return t&&(e.headers.Authorization="Bearer "+t),e},e=>Promise.reject(e)),D.interceptors.response.use(e=>e,e=>{if(e.response)switch(e.response.status){case 401:console.error("开发者授权码异常");break;case 403:console.error("当前用户没有权限");break;case 400:console.error(e.response.data.message)}return Promise.reject(e)});var Y=D,t=i(6),j=i.n(t);class z{constructor(e,t){this.textDics=new Array,this.id=e,this.scene=t}set background(e){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this._background&&this._background.dispose(),this._background=new BABYLON.GUI.Image(a.getGUID(12)+"_Image",e),this._background.width=this.size.width+"px",this._background.height=this.size.height+"px",this.rect.addControl(this._background),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}addEventListener(e){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,e?(this._background.isPointerBlocker=!1,this._background.onPointerClickObservable.add(()=>{e(this.id)})):this._background.onPointerClickObservable.clear(),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}setTexts(i){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.textDics.forEach(e=>e.dispose());for(let t=this.textDics.length=0;t<i.length;t++){let e=new BABYLON.GUI.TextBlock;e.text=i[t].text,e.fontSize=i[t].fontSize||"20px",e.color=i[t].color||"white",e.top=i[t].top||0,e.left=i[t].left||0,this.rect.addControl(e),this.textDics.push(e)}this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}line(e){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this._line&&this._line.dispose(),this._line=new BABYLON.GUI.Line,this._line.lineWidth=e.width||1.5,this._line.color=e.color||"green",this._line.y2=this.size.height/2,this.container.addControl(this._line),this._line.linkWithMesh(this.pint),this._line.connectedControl=this.rect,this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}dispose(){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.rect&&this.rect.dispose(),this._line&&this._line.dispose(),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}isEnabled(e){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.rect&&(this.rect.isVisible=e),this._line&&(this._line.isVisible=e),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}}class U{constructor(e,t,i,n,r,s){this.id=e,this.scene=s,this.url=i,this.scaling=n,this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance=BABYLON.Mesh.CreatePlane(this.id,n,this.scene,!0,BABYLON.Mesh.DOUBLESIDE),this.instance.alwaysSelectAsActiveMesh=!0,this.instance.position=t.clone(),this.instance.position.y+=r,this.instance.billboardMode=BABYLON.Mesh.BILLBOARDMODE_Y;let o=new BABYLON.StandardMaterial("Mat_"+this.id,this.scene);o.diffuseColor=BABYLON.Color3.White(),o.emissiveColor=BABYLON.Color3.White(),this.instance.material=o,this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}setBackground(){let i=new Image;i.src=this.url,i.onload=()=>{this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.scaling.y=this.scaling/(i.width/i.height)/this.scaling;let e=new BABYLON.DynamicTexture(this.id,{width:i.width,height:i.height},this.scene,!1);e.hasAlpha=!0,this.instance.material.diffuseTexture=e;let t=e.getContext();t.drawImage(i,0,0),e.update(),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}}addEventListener(t){if(this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.actionManager&&this.instance.actionManager.dispose(),this.instance.isPickable=!1,this.instance.enablePointerMoveEvents=!1,t){this.instance.isPickable=!0,this.instance.enablePointerMoveEvents=!0;let e=new BABYLON.ActionManager(this.scene);e.registerAction(new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPickTrigger,e=>t(this.id))),this.instance.actionManager=e}this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}setColor(e){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.material.diffuseColor=BABYLON.Color3.FromHexString(e),this.instance.material.emissiveColor=BABYLON.Color3.FromHexString(e),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}setContents(i){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0;let n=new Image;n.src=this.url,n.onload=()=>{this.instance.scaling.y=this.scaling/(n.width/n.height)/this.scaling;let t=new BABYLON.DynamicTexture(this.id,{width:n.width,height:n.height},this.scene,!1);t.hasAlpha=!0,this.instance.material.diffuseTexture=t;let e=t.getContext();e.drawImage(n,0,0),i.forEach(e=>t.drawText(e.text,e.left,e.top,"bold "+e.fontSize+" monospace",e.color||"#fffffb","",!0,!0)),t.update(),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}}dispose(){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.dispose(),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}isEnabled(e){this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.setEnabled(e),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1}}class F{constructor(){this.color="#00ff00",this.width=5,this.isDotted=!1}update(){this.objs[0].app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance&&this.instance.dispose(),this.instance=new BABYLON.GUI.MultiLine,this.objs[0].app.container.addControl(this.instance),this.instance.lineWidth=this.width,this.instance.color=this.color,this.isDotted&&(this.instance.dash=[1]),this.objs.forEach(e=>this.instance.add(e.instance)),this.objs[0].app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}addEventListener(e){this.objs[0].app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,e?(this.instance.isPointerBlocker=!1,this.instance.onPointerClickObservable.add(()=>{e(this.id)})):this.instance.onPointerClickObservable.clear(),this.objs[0].app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}isEnabled(e){this.instance&&(this.objs[0].app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.isVisible=e,this.objs[0].app.scene.blockfreeActiveMeshesAndRenderingGroups=!1)}dispose(){this.objs[0].app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance&&this.instance.dispose(),this.objs[0].app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}}class H{constructor(){this.color="#00ff00",this.width=1}update(){this.objs[0].app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance&&this.instance.dispose();let t=[];this.objs.forEach(e=>t.push(e.instance.getAbsolutePosition().clone())),this.instance=p.createTube(this.id,t,this.width/100,this.objs[0].app);let e=new BABYLON.StandardMaterial("mat_"+this.id,this.objs[0].app.scene);e.diffuseColor=BABYLON.Color3.FromHexString(this.color),this.instance.material=e,this.objs[0].app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}addEventListener(t){if(this.objs[0].app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.actionManager&&this.instance.actionManager.dispose(),this.instance.isPickable=!1,this.instance.enablePointerMoveEvents=!1,t){this.instance.isPickable=!0,this.instance.enablePointerMoveEvents=!0;let e=new BABYLON.ActionManager(this.objs[0].app.scene);e.registerAction(new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPickTrigger,e=>t(this.id))),this.instance.actionManager=e}this.objs[0].app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}isEnabled(e){this.instance&&(this.objs[0].app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.setEnabled(e),this.objs[0].app.scene.blockfreeActiveMeshesAndRenderingGroups=!1)}dispose(){this.objs[0].app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance&&this.instance.dispose(),this.objs[0].app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}}class V{constructor(e){this.displayValue=!1,this.anchor=e,this.id=a.getGUID(12),this.texts=new Array}isEnabled(t){this.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.mesh.setEnabled(t),this.texts.forEach(e=>e.isVisible=!!t&&this.displayValue),this.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}set displayValues(t){this.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.texts.forEach(e=>e.isVisible=t),this.displayValue=t,this.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}dispose(){this.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.mesh&&this.mesh.dispose();for(let e=0;e<this.texts.length;e++)this.texts[e].linkedMesh&&this.texts[e].linkedMesh.dispose(),this.texts[e].dispose();this.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}}var G=i(14);class W{constructor(e,t){this.anchor=e,this.ratio=t}dispose(){this.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.mesh&&this.mesh.dispose(),this.textMesh&&this.textMesh.dispose(),this.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}}const $=[0,2e3,1e4,3e4,null];class q{constructor(e){this._retryDelays=void 0!==e?[...e,null]:$}nextRetryDelayInMilliseconds(e){return this._retryDelays[e.previousRetryCount]}}class X extends Error{constructor(e,t){var i=new.target.prototype;super(`${e}: Status code '${t}'`),this.statusCode=t,this.__proto__=i}}class K extends Error{constructor(e="A timeout occurred."){var t=new.target.prototype;super(e),this.__proto__=t}}class J extends Error{constructor(e="An abort occurred."){var t=new.target.prototype;super(e),this.__proto__=t}}class Z extends Error{constructor(e,t){var i=new.target.prototype;super(e),this.transport=t,this.errorType="UnsupportedTransportError",this.__proto__=i}}class Q extends Error{constructor(e,t){var i=new.target.prototype;super(e),this.transport=t,this.errorType="DisabledTransportError",this.__proto__=i}}class ee extends Error{constructor(e,t){var i=new.target.prototype;super(e),this.transport=t,this.errorType="FailedToStartTransportError",this.__proto__=i}}class te extends Error{constructor(e){var t=new.target.prototype;super(e),this.errorType="FailedToNegotiateWithServerError",this.__proto__=t}}class ie extends Error{constructor(e,t){var i=new.target.prototype;super(e),this.innerErrors=t,this.__proto__=i}}class ne{constructor(e,t,i){this.statusCode=e,this.statusText=t,this.content=i}}class re{get(e,t){return this.send({...t,method:"GET",url:e})}post(e,t){return this.send({...t,method:"POST",url:e})}delete(e,t){return this.send({...t,method:"DELETE",url:e})}getCookieString(e){return""}}var se,oe,ae,ce,he=i(0),le=i(1);class ue extends re{constructor(e){if(super(),this._logger=e,"undefined"==typeof fetch){const t=require;this._jar=new(t("tough-cookie").CookieJar),this._fetchType=t("node-fetch"),this._fetchType=t("fetch-cookie")(this._fetchType,this._jar)}else this._fetchType=fetch.bind(Object(le.h)());if("undefined"==typeof AbortController){const i=require;this._abortControllerType=i("abort-controller")}else this._abortControllerType=AbortController}async send(e){if(e.abortSignal&&e.abortSignal.aborted)throw new J;if(!e.method)throw new Error("No method defined.");if(!e.url)throw new Error("No url defined.");const t=new this._abortControllerType;let i;e.abortSignal&&(e.abortSignal.onabort=()=>{t.abort(),i=new J});let n=null;e.timeout&&(s=e.timeout,n=setTimeout(()=>{t.abort(),this._logger.log(he.a.Warning,"Timeout from HTTP request."),i=new K},s));let r;try{r=await this._fetchType(e.url,{body:e.content,cache:"no-cache",credentials:!0===e.withCredentials?"include":"same-origin",headers:{"Content-Type":"text/plain;charset=UTF-8","X-Requested-With":"XMLHttpRequest",...e.headers},method:e.method,mode:"cors",redirect:"follow",signal:t.signal})}catch(e){if(i)throw i;throw this._logger.log(he.a.Warning,`Error from HTTP request. ${e}.`),e}finally{n&&clearTimeout(n),e.abortSignal&&(e.abortSignal.onabort=null)}if(!r.ok){var s=await pe(r,"text");throw new X(s||r.statusText,r.status)}e=await pe(r,e.responseType);return new ne(r.status,r.statusText,e)}getCookieString(e){let i="";return le.c.isNode&&this._jar&&this._jar.getCookies(e,(e,t)=>i=t.join("; ")),i}}function pe(e,t){let i;switch(t){case"arraybuffer":i=e.arrayBuffer();break;case"text":i=e.text();break;case"blob":case"document":case"json":throw new Error(`${t} is not supported.`);default:i=e.text()}return i}class de extends re{constructor(e){super(),this._logger=e}send(r){return r.abortSignal&&r.abortSignal.aborted?Promise.reject(new J):r.method?r.url?new Promise((e,t)=>{const i=new XMLHttpRequest;i.open(r.method,r.url,!0),i.withCredentials=void 0===r.withCredentials||r.withCredentials,i.setRequestHeader("X-Requested-With","XMLHttpRequest"),i.setRequestHeader("Content-Type","text/plain;charset=UTF-8");const n=r.headers;n&&Object.keys(n).forEach(e=>{i.setRequestHeader(e,n[e])}),r.responseType&&(i.responseType=r.responseType),r.abortSignal&&(r.abortSignal.onabort=()=>{i.abort(),t(new J)}),r.timeout&&(i.timeout=r.timeout),i.onload=()=>{r.abortSignal&&(r.abortSignal.onabort=null),200<=i.status&&i.status<300?e(new ne(i.status,i.statusText,i.response||i.responseText)):t(new X(i.response||i.responseText||i.statusText,i.status))},i.onerror=()=>{this._logger.log(he.a.Warning,`Error from HTTP request. ${i.status}: ${i.statusText}.`),t(new X(i.statusText,i.status))},i.ontimeout=()=>{this._logger.log(he.a.Warning,"Timeout from HTTP request."),t(new K)},i.send(r.content||"")}):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}}class fe extends re{constructor(e){if(super(),"undefined"!=typeof fetch||le.c.isNode)this._httpClient=new ue(e);else{if("undefined"==typeof XMLHttpRequest)throw new Error("No usable HttpClient found.");this._httpClient=new de(e)}}send(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new J):e.method?e.url?this._httpClient.send(e):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}getCookieString(e){return this._httpClient.getCookieString(e)}}class ge{}ge.Authorization="Authorization",ge.Cookie="Cookie",(t=se=se||{})[t.None=0]="None",t[t.WebSockets=1]="WebSockets",t[t.ServerSentEvents=2]="ServerSentEvents",t[t.LongPolling=4]="LongPolling",(t=oe=oe||{})[t.Text=1]="Text",t[t.Binary=2]="Binary";class me{constructor(){this._isAborted=!1,this.onabort=null}abort(){this._isAborted||(this._isAborted=!0,this.onabort&&this.onabort())}get signal(){return this}get aborted(){return this._isAborted}}class ve{constructor(e,t,i,n){this._httpClient=e,this._accessTokenFactory=t,this._logger=i,this._pollAbort=new me,this._options=n,this._running=!1,this.onreceive=null,this.onclose=null}get pollAborted(){return this._pollAbort.aborted}async connect(e,t){if(le.a.isRequired(e,"url"),le.a.isRequired(t,"transferFormat"),le.a.isIn(t,oe,"transferFormat"),this._url=e,this._logger.log(he.a.Trace,"(LongPolling transport) Connecting."),t===oe.Binary&&"undefined"!=typeof XMLHttpRequest&&"string"!=typeof(new XMLHttpRequest).responseType)throw new Error("Binary protocols over XmlHttpRequest not implementing advanced features are not supported.");var[i,n]=Object(le.i)(),n={[i]:n,...this._options.headers};const r={abortSignal:this._pollAbort.signal,headers:n,timeout:1e5,withCredentials:this._options.withCredentials};t===oe.Binary&&(r.responseType="arraybuffer");t=await this._getAccessToken();this._updateHeaderToken(r,t);e=`${e}&_=${Date.now()}`;this._logger.log(he.a.Trace,`(LongPolling transport) polling: ${e}.`);e=await this._httpClient.get(e,r);200!==e.statusCode?(this._logger.log(he.a.Error,`(LongPolling transport) Unexpected response code: ${e.statusCode}.`),this._closeError=new X(e.statusText||"",e.statusCode),this._running=!1):this._running=!0,this._receiving=this._poll(this._url,r)}async _getAccessToken(){return this._accessTokenFactory?this._accessTokenFactory():null}_updateHeaderToken(e,t){e.headers||(e.headers={}),t?e.headers[ge.Authorization]=`Bearer ${t}`:e.headers[ge.Authorization]&&delete e.headers[ge.Authorization]}async _poll(e,t){try{for(;this._running;){var i=await this._getAccessToken();this._updateHeaderToken(t,i);try{var n=`${e}&_=${Date.now()}`;this._logger.log(he.a.Trace,`(LongPolling transport) polling: ${n}.`);var r=await this._httpClient.get(n,t);204===r.statusCode?(this._logger.log(he.a.Information,"(LongPolling transport) Poll terminated by server."),this._running=!1):200!==r.statusCode?(this._logger.log(he.a.Error,`(LongPolling transport) Unexpected response code: ${r.statusCode}.`),this._closeError=new X(r.statusText||"",r.statusCode),this._running=!1):r.content?(this._logger.log(he.a.Trace,`(LongPolling transport) data received. ${Object(le.f)(r.content,this._options.logMessageContent)}.`),this.onreceive&&this.onreceive(r.content)):this._logger.log(he.a.Trace,"(LongPolling transport) Poll timed out, reissuing.")}catch(e){this._running?e instanceof K?this._logger.log(he.a.Trace,"(LongPolling transport) Poll timed out, reissuing."):(this._closeError=e,this._running=!1):this._logger.log(he.a.Trace,`(LongPolling transport) Poll errored after shutdown: ${e.message}`)}}}finally{this._logger.log(he.a.Trace,"(LongPolling transport) Polling complete."),this.pollAborted||this._raiseOnClose()}}async send(e){return this._running?Object(le.k)(this._logger,"LongPolling",this._httpClient,this._url,this._accessTokenFactory,e,this._options):Promise.reject(new Error("Cannot send until the transport is connected"))}async stop(){this._logger.log(he.a.Trace,"(LongPolling transport) Stopping polling."),this._running=!1,this._pollAbort.abort();try{await this._receiving,this._logger.log(he.a.Trace,`(LongPolling transport) sending DELETE request to ${this._url}.`);const r={};var[e,t]=Object(le.i)();r[e]=t;var i={headers:{...r,...this._options.headers},timeout:this._options.timeout,withCredentials:this._options.withCredentials},n=await this._getAccessToken();this._updateHeaderToken(i,n),await this._httpClient.delete(this._url,i),this._logger.log(he.a.Trace,"(LongPolling transport) DELETE request sent.")}finally{this._logger.log(he.a.Trace,"(LongPolling transport) Stop finished."),this._raiseOnClose()}}_raiseOnClose(){if(this.onclose){let e="(LongPolling transport) Firing onclose event.";this._closeError&&(e+=" Error: "+this._closeError),this._logger.log(he.a.Trace,e),this.onclose(this._closeError)}}}class ye{constructor(e,t,i,n){this._httpClient=e,this._accessTokenFactory=t,this._logger=i,this._options=n,this.onreceive=null,this.onclose=null}async connect(a,e){var t;return le.a.isRequired(a,"url"),le.a.isRequired(e,"transferFormat"),le.a.isIn(e,oe,"transferFormat"),this._logger.log(he.a.Trace,"(SSE transport) Connecting."),this._url=a,!this._accessTokenFactory||(t=await this._accessTokenFactory())&&(a+=(a.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(t)}`),new Promise((t,i)=>{let n=!1;if(e===oe.Text){let e;if(le.c.isBrowser||le.c.isWebWorker)e=new this._options.EventSource(a,{withCredentials:this._options.withCredentials});else{var r=this._httpClient.getCookieString(a);const o={};o.Cookie=r;var[s,r]=Object(le.i)();o[s]=r,e=new this._options.EventSource(a,{withCredentials:this._options.withCredentials,headers:{...o,...this._options.headers}})}try{e.onmessage=e=>{if(this.onreceive)try{this._logger.log(he.a.Trace,`(SSE transport) data received. ${Object(le.f)(e.data,this._options.logMessageContent)}.`),this.onreceive(e.data)}catch(e){return void this._close(e)}},e.onerror=e=>{n?this._close():i(new Error("EventSource failed to connect. The connection could not be found on the server, either the connection ID is not present on the server, or a proxy is refusing/buffering the connection. If you have multiple servers check that sticky sessions are enabled."))},e.onopen=()=>{this._logger.log(he.a.Information,`SSE connected to ${this._url}`),this._eventSource=e,n=!0,t()}}catch(e){return void i(e)}}else i(new Error("The Server-Sent Events transport only supports the 'Text' transfer format"))})}async send(e){return this._eventSource?Object(le.k)(this._logger,"SSE",this._httpClient,this._url,this._accessTokenFactory,e,this._options):Promise.reject(new Error("Cannot send until the transport is connected"))}stop(){return this._close(),Promise.resolve()}_close(e){this._eventSource&&(this._eventSource.close(),this._eventSource=void 0,this.onclose&&this.onclose(e))}}class be{constructor(e,t,i,n,r,s){this._logger=i,this._accessTokenFactory=t,this._logMessageContent=n,this._webSocketConstructor=r,this._httpClient=e,this.onreceive=null,this.onclose=null,this._headers=s}async connect(c,h){var e;return le.a.isRequired(c,"url"),le.a.isRequired(h,"transferFormat"),le.a.isIn(h,oe,"transferFormat"),this._logger.log(he.a.Trace,"(WebSockets transport) Connecting."),!this._accessTokenFactory||(e=await this._accessTokenFactory())&&(c+=(c.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(e)}`),new Promise((t,i)=>{c=c.replace(/^http/,"ws");let n;var e=this._httpClient.getCookieString(c);let r=!1;if(le.c.isNode){const a={};var[s,o]=Object(le.i)();a[s]=o,e&&(a[ge.Cookie]=`${e}`),n=new this._webSocketConstructor(c,void 0,{headers:{...a,...this._headers}})}n=n||new this._webSocketConstructor(c),h===oe.Binary&&(n.binaryType="arraybuffer"),n.onopen=e=>{this._logger.log(he.a.Information,`WebSocket connected to ${c}.`),this._webSocket=n,r=!0,t()},n.onerror=e=>{let t=null;t="undefined"!=typeof ErrorEvent&&e instanceof ErrorEvent?e.error:"There was an error with the transport",this._logger.log(he.a.Information,`(WebSockets transport) ${t}.`)},n.onmessage=e=>{if(this._logger.log(he.a.Trace,`(WebSockets transport) data received. ${Object(le.f)(e.data,this._logMessageContent)}.`),this.onreceive)try{this.onreceive(e.data)}catch(e){return void this._close(e)}},n.onclose=t=>{if(r)this._close(t);else{let e=null;e="undefined"!=typeof ErrorEvent&&t instanceof ErrorEvent?t.error:"WebSocket failed to connect. The connection could not be found on the server, either the endpoint may not be a SignalR endpoint, the connection ID is not present on the server, or there is a proxy blocking WebSockets. If you have multiple servers check that sticky sessions are enabled.",i(new Error(e))}}})}send(e){return this._webSocket&&this._webSocket.readyState===this._webSocketConstructor.OPEN?(this._logger.log(he.a.Trace,`(WebSockets transport) sending data. ${Object(le.f)(e,this._logMessageContent)}.`),this._webSocket.send(e),Promise.resolve()):Promise.reject("WebSocket is not in the OPEN state")}stop(){return this._webSocket&&this._close(void 0),Promise.resolve()}_close(e){this._webSocket&&(this._webSocket.onclose=()=>{},this._webSocket.onmessage=()=>{},this._webSocket.onerror=()=>{},this._webSocket.close(),this._webSocket=void 0),this._logger.log(he.a.Trace,"(WebSockets transport) socket closed."),this.onclose&&(!this._isCloseEvent(e)||!1!==e.wasClean&&1e3===e.code?e instanceof Error?this.onclose(e):this.onclose():this.onclose(new Error(`WebSocket closed with status code: ${e.code} (${e.reason||"no reason given"}).`)))}_isCloseEvent(e){return e&&"boolean"==typeof e.wasClean&&"number"==typeof e.code}}class we{constructor(e,t={}){if(this._stopPromiseResolver=()=>{},this.features={},this._negotiateVersion=1,le.a.isRequired(e,"url"),this._logger=Object(le.e)(t.logger),this.baseUrl=this._resolveUrl(e),(t=t||{}).logMessageContent=void 0!==t.logMessageContent&&t.logMessageContent,"boolean"!=typeof t.withCredentials&&void 0!==t.withCredentials)throw new Error("withCredentials option was not a 'boolean' or 'undefined' value");t.withCredentials=void 0===t.withCredentials||t.withCredentials,t.timeout=void 0===t.timeout?1e5:t.timeout;let i=null,n=null;if(le.c.isNode){const r=require;i=r("ws"),n=r("eventsource")}le.c.isNode||"undefined"==typeof WebSocket||t.WebSocket?le.c.isNode&&!t.WebSocket&&i&&(t.WebSocket=i):t.WebSocket=WebSocket,le.c.isNode||"undefined"==typeof EventSource||t.EventSource?le.c.isNode&&!t.EventSource&&void 0!==n&&(t.EventSource=n):t.EventSource=EventSource,this._httpClient=t.httpClient||new fe(this._logger),this._connectionState="Disconnected",this._connectionStarted=!1,this._options=t,this.onreceive=null,this.onclose=null}async start(e){if(e=e||oe.Binary,le.a.isIn(e,oe,"transferFormat"),this._logger.log(he.a.Debug,`Starting connection with transfer format '${oe[e]}'.`),"Disconnected"!==this._connectionState)return Promise.reject(new Error("Cannot start an HttpConnection that is not in the 'Disconnected' state."));if(this._connectionState="Connecting",this._startInternalPromise=this._startInternal(e),await this._startInternalPromise,"Disconnecting"===this._connectionState){var t="Failed to start the HttpConnection before stop() was called.";return this._logger.log(he.a.Error,t),await this._stopPromise,Promise.reject(new Error(t))}if("Connected"!==this._connectionState){t="HttpConnection.startInternal completed gracefully but didn't enter the connection into the connected state!";return this._logger.log(he.a.Error,t),Promise.reject(new Error(t))}this._connectionStarted=!0}send(e){return"Connected"!==this._connectionState?Promise.reject(new Error("Cannot send data if the connection is not in the 'Connected' State.")):(this._sendQueue||(this._sendQueue=new _e(this.transport)),this._sendQueue.send(e))}async stop(e){return"Disconnected"===this._connectionState?(this._logger.log(he.a.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnected state.`),Promise.resolve()):"Disconnecting"===this._connectionState?(this._logger.log(he.a.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnecting state.`),this._stopPromise):(this._connectionState="Disconnecting",this._stopPromise=new Promise(e=>{this._stopPromiseResolver=e}),await this._stopInternal(e),void await this._stopPromise)}async _stopInternal(e){this._stopError=e;try{await this._startInternalPromise}catch(e){}if(this.transport){try{await this.transport.stop()}catch(e){this._logger.log(he.a.Error,`HttpConnection.transport.stop() threw error '${e}'.`),this._stopConnection()}this.transport=void 0}else this._logger.log(he.a.Debug,"HttpConnection.transport is undefined in HttpConnection.stop() because start() failed.")}async _startInternal(i){let n=this.baseUrl;this._accessTokenFactory=this._options.accessTokenFactory;try{if(this._options.skipNegotiation){if(this._options.transport!==se.WebSockets)throw new Error("Negotiation can only be skipped when using the WebSocket transport directly.");this.transport=this._constructTransport(se.WebSockets),await this._startTransport(n,i)}else{let e=null,t=0;do{if(e=await this._getNegotiationResponse(n),"Disconnecting"===this._connectionState||"Disconnected"===this._connectionState)throw new Error("The connection was stopped during negotiation.");if(e.error)throw new Error(e.error);if(e.ProtocolVersion)throw new Error("Detected a connection attempt to an ASP.NET SignalR Server. This client only supports connecting to an ASP.NET Core SignalR Server. See https://aka.ms/signalr-core-differences for details.");if(e.url&&(n=e.url),e.accessToken){const r=e.accessToken;this._accessTokenFactory=()=>r}}while(t++,e.url&&t<100);if(100===t&&e.url)throw new Error("Negotiate redirection limit exceeded.");await this._createTransport(n,this._options.transport,e,i)}this.transport instanceof ve&&(this.features.inherentKeepAlive=!0),"Connecting"===this._connectionState&&(this._logger.log(he.a.Debug,"The HttpConnection connected successfully."),this._connectionState="Connected")}catch(e){return this._logger.log(he.a.Error,"Failed to start the connection: "+e),this._connectionState="Disconnected",this.transport=void 0,this._stopPromiseResolver(),Promise.reject(e)}}async _getNegotiationResponse(e){const t={};!this._accessTokenFactory||(n=await this._accessTokenFactory())&&(t[ge.Authorization]=`Bearer ${n}`);var[i,n]=Object(le.i)();t[i]=n;e=this._resolveNegotiateUrl(e);this._logger.log(he.a.Debug,`Sending negotiation request: ${e}.`);try{var r=await this._httpClient.post(e,{content:"",headers:{...t,...this._options.headers},timeout:this._options.timeout,withCredentials:this._options.withCredentials});if(200!==r.statusCode)return Promise.reject(new Error(`Unexpected status code returned from negotiate '${r.statusCode}'`));const s=JSON.parse(r.content);return(!s.negotiateVersion||s.negotiateVersion<1)&&(s.connectionToken=s.connectionId),s}catch(e){let t="Failed to complete negotiation with the server: "+e;return e instanceof X&&404===e.statusCode&&(t+=" Either this is not a SignalR endpoint or there is a proxy blocking the connection."),this._logger.log(he.a.Error,t),Promise.reject(new te(t))}}_createConnectUrl(e,t){return t?e+(-1===e.indexOf("?")?"?":"&")+`id=${t}`:e}async _createTransport(e,t,i,n){let r=this._createConnectUrl(e,i.connectionToken);if(this._isITransport(t))return this._logger.log(he.a.Debug,"Connection was provided an instance of ITransport, using that directly."),this.transport=t,await this._startTransport(r,n),void(this.connectionId=i.connectionId);const s=[];let o=i;for(const c of i.availableTransports||[]){var a=this._resolveTransportOrError(c,t,n);if(a instanceof Error)s.push(`${c.transport} failed:`),s.push(a);else if(this._isITransport(a)){if(this.transport=a,!o){try{o=await this._getNegotiationResponse(e)}catch(e){return Promise.reject(e)}r=this._createConnectUrl(e,o.connectionToken)}try{return await this._startTransport(r,n),void(this.connectionId=o.connectionId)}catch(e){if(this._logger.log(he.a.Error,`Failed to start the transport '${c.transport}': ${e}`),o=void 0,s.push(new ee(`${c.transport} failed: ${e}`,se[c.transport])),"Connecting"!==this._connectionState){a="Failed to select transport before stop() was called.";return this._logger.log(he.a.Debug,a),Promise.reject(new Error(a))}}}}return 0<s.length?Promise.reject(new ie(`Unable to connect to the server with any of the available transports. ${s.join(" ")}`,s)):Promise.reject(new Error("None of the transports supported by the client are supported by the server."))}_constructTransport(e){switch(e){case se.WebSockets:if(!this._options.WebSocket)throw new Error("'WebSocket' is not supported in your environment.");return new be(this._httpClient,this._accessTokenFactory,this._logger,this._options.logMessageContent,this._options.WebSocket,this._options.headers||{});case se.ServerSentEvents:if(!this._options.EventSource)throw new Error("'EventSource' is not supported in your environment.");return new ye(this._httpClient,this._accessTokenFactory,this._logger,this._options);case se.LongPolling:return new ve(this._httpClient,this._accessTokenFactory,this._logger,this._options);default:throw new Error(`Unknown transport: ${e}.`)}}_startTransport(e,t){return this.transport.onreceive=this.onreceive,this.transport.onclose=e=>this._stopConnection(e),this.transport.connect(e,t)}_resolveTransportOrError(e,t,i){var n,r=se[e.transport];if(null==r)return this._logger.log(he.a.Debug,`Skipping transport '${e.transport}' because it is not supported by this client.`),new Error(`Skipping transport '${e.transport}' because it is not supported by this client.`);if(n=r,(t=t)&&0==(n&t))return this._logger.log(he.a.Debug,`Skipping transport '${se[r]}' because it was disabled by the client.`),new Q(`'${se[r]}' is disabled by the client.`,r);{const s=e.transferFormats.map(e=>oe[e]);if(!(0<=s.indexOf(i)))return this._logger.log(he.a.Debug,`Skipping transport '${se[r]}' because it does not support the requested transfer format '${oe[i]}'.`),new Error(`'${se[r]}' does not support ${oe[i]}.`);if(r===se.WebSockets&&!this._options.WebSocket||r===se.ServerSentEvents&&!this._options.EventSource)return this._logger.log(he.a.Debug,`Skipping transport '${se[r]}' because it is not supported in your environment.'`),new Z(`'${se[r]}' is not supported in your environment.`,r);this._logger.log(he.a.Debug,`Selecting transport '${se[r]}'.`);try{return this._constructTransport(r)}catch(e){return e}}}_isITransport(e){return e&&"object"==typeof e&&"connect"in e}_stopConnection(t){if(this._logger.log(he.a.Debug,`HttpConnection.stopConnection(${t}) called while in state ${this._connectionState}.`),this.transport=void 0,t=this._stopError||t,this._stopError=void 0,"Disconnected"!==this._connectionState){if("Connecting"===this._connectionState)throw this._logger.log(he.a.Warning,`Call to HttpConnection.stopConnection(${t}) was ignored because the connection is still in the connecting state.`),new Error(`HttpConnection.stopConnection(${t}) was called while the connection is still in the connecting state.`);if("Disconnecting"===this._connectionState&&this._stopPromiseResolver(),t?this._logger.log(he.a.Error,`Connection disconnected with error '${t}'.`):this._logger.log(he.a.Information,"Connection disconnected."),this._sendQueue&&(this._sendQueue.stop().catch(e=>{this._logger.log(he.a.Error,`TransportSendQueue.stop() threw error '${e}'.`)}),this._sendQueue=void 0),this.connectionId=void 0,this._connectionState="Disconnected",this._connectionStarted){this._connectionStarted=!1;try{this.onclose&&this.onclose(t)}catch(e){this._logger.log(he.a.Error,`HttpConnection.onclose(${t}) threw error '${e}'.`)}}}else this._logger.log(he.a.Debug,`Call to HttpConnection.stopConnection(${t}) was ignored because the connection is already in the disconnected state.`)}_resolveUrl(e){if(0===e.lastIndexOf("https://",0)||0===e.lastIndexOf("http://",0))return e;if(!le.c.isBrowser)throw new Error(`Cannot resolve '${e}'.`);const t=window.document.createElement("a");return t.href=e,this._logger.log(he.a.Information,`Normalizing '${e}' to '${t.href}'.`),t.href}_resolveNegotiateUrl(e){var t=e.indexOf("?");let i=e.substring(0,-1===t?e.length:t);return"/"!==i[i.length-1]&&(i+="/"),i+="negotiate",i+=-1===t?"":e.substring(t),-1===i.indexOf("negotiateVersion")&&(i+=-1===t?"?":"&",i+="negotiateVersion="+this._negotiateVersion),i}}class _e{constructor(e){this._transport=e,this._buffer=[],this._executing=!0,this._sendBufferedData=new Ae,this._transportResult=new Ae,this._sendLoopPromise=this._sendLoop()}send(e){return this._bufferData(e),this._transportResult||(this._transportResult=new Ae),this._transportResult.promise}stop(){return this._executing=!1,this._sendBufferedData.resolve(),this._sendLoopPromise}_bufferData(e){if(this._buffer.length&&typeof this._buffer[0]!=typeof e)throw new Error(`Expected data to be of type ${typeof this._buffer} but was of type ${typeof e}`);this._buffer.push(e),this._sendBufferedData.resolve()}async _sendLoop(){for(;;){if(await this._sendBufferedData.promise,!this._executing){this._transportResult&&this._transportResult.reject("Connection stopped.");break}this._sendBufferedData=new Ae;const t=this._transportResult;this._transportResult=void 0;var e="string"==typeof this._buffer[0]?this._buffer.join(""):_e._concatBuffers(this._buffer);this._buffer.length=0;try{await this._transport.send(e),t.resolve()}catch(e){t.reject(e)}}}static _concatBuffers(e){var t=e.map(e=>e.byteLength).reduce((e,t)=>e+t);const i=new Uint8Array(t);let n=0;for(const r of e)i.set(new Uint8Array(r),n),n+=r.byteLength;return i.buffer}}class Ae{constructor(){this.promise=new Promise((e,t)=>[this._resolver,this._rejecter]=[e,t])}resolve(){this._resolver()}reject(e){this._rejecter(e)}}class Be{static write(e){return`${e}${Be.RecordSeparator}`}static parse(e){if(e[e.length-1]!==Be.RecordSeparator)throw new Error("Message is incomplete.");const t=e.split(Be.RecordSeparator);return t.pop(),t}}Be.RecordSeparatorCode=30,Be.RecordSeparator=String.fromCharCode(Be.RecordSeparatorCode);class Ce{writeHandshakeRequest(e){return Be.write(JSON.stringify(e))}parseHandshakeResponse(e){let t,i;if(Object(le.j)(e)){const s=new Uint8Array(e);var n=s.indexOf(Be.RecordSeparatorCode);if(-1===n)throw new Error("Message is incomplete.");n=n+1;t=String.fromCharCode.apply(null,Array.prototype.slice.call(s.slice(0,n))),i=s.byteLength>n?s.slice(n).buffer:null}else{const o=e;var r=o.indexOf(Be.RecordSeparator);if(-1===r)throw new Error("Message is incomplete.");r=r+1;t=o.substring(0,r),i=o.length>r?o.substring(r):null}r=Be.parse(t),r=JSON.parse(r[0]);if(r.type)throw new Error("Expected a handshake response from the server.");return[i,r]}}(t=ae=ae||{})[t.Invocation=1]="Invocation",t[t.StreamItem=2]="StreamItem",t[t.Completion=3]="Completion",t[t.StreamInvocation=4]="StreamInvocation",t[t.CancelInvocation=5]="CancelInvocation",t[t.Ping=6]="Ping",t[t.Close=7]="Close";class xe{constructor(){this.observers=[]}next(e){for(const t of this.observers)t.next(e)}error(e){for(const t of this.observers)t.error&&t.error(e)}complete(){for(const e of this.observers)e.complete&&e.complete()}subscribe(e){return this.observers.push(e),new le.d(this,e)}}(t=ce=ce||{}).Disconnected="Disconnected",t.Connecting="Connecting",t.Connected="Connected",t.Disconnecting="Disconnecting",t.Reconnecting="Reconnecting";class Ee{constructor(e,t,i,n){this._nextKeepAlive=0,this._freezeEventListener=()=>{this._logger.log(he.a.Warning,"The page is being frozen, this will likely lead to the connection being closed and messages being lost. For more information see the docs at https://docs.microsoft.com/aspnet/core/signalr/javascript-client#bsleep")},le.a.isRequired(e,"connection"),le.a.isRequired(t,"logger"),le.a.isRequired(i,"protocol"),this.serverTimeoutInMilliseconds=3e4,this.keepAliveIntervalInMilliseconds=15e3,this._logger=t,this._protocol=i,this.connection=e,this._reconnectPolicy=n,this._handshakeProtocol=new Ce,this.connection.onreceive=e=>this._processIncomingData(e),this.connection.onclose=e=>this._connectionClosed(e),this._callbacks={},this._methods={},this._closedCallbacks=[],this._reconnectingCallbacks=[],this._reconnectedCallbacks=[],this._invocationId=0,this._receivedHandshakeResponse=!1,this._connectionState=ce.Disconnected,this._connectionStarted=!1,this._cachedPingMessage=this._protocol.writeMessage({type:ae.Ping})}static create(e,t,i,n){return new Ee(e,t,i,n)}get state(){return this._connectionState}get connectionId(){return this.connection&&this.connection.connectionId||null}get baseUrl(){return this.connection.baseUrl||""}set baseUrl(e){if(this._connectionState!==ce.Disconnected&&this._connectionState!==ce.Reconnecting)throw new Error("The HubConnection must be in the Disconnected or Reconnecting state to change the url.");if(!e)throw new Error("The HubConnection url must be a valid url.");this.connection.baseUrl=e}start(){return this._startPromise=this._startWithStateTransitions(),this._startPromise}async _startWithStateTransitions(){if(this._connectionState!==ce.Disconnected)return Promise.reject(new Error("Cannot start a HubConnection that is not in the 'Disconnected' state."));this._connectionState=ce.Connecting,this._logger.log(he.a.Debug,"Starting HubConnection.");try{await this._startInternal(),le.c.isBrowser&&window.document.addEventListener("freeze",this._freezeEventListener),this._connectionState=ce.Connected,this._connectionStarted=!0,this._logger.log(he.a.Debug,"HubConnection connected successfully.")}catch(e){return this._connectionState=ce.Disconnected,this._logger.log(he.a.Debug,`HubConnection failed to start successfully because of error '${e}'.`),Promise.reject(e)}}async _startInternal(){this._stopDuringStartError=void 0,this._receivedHandshakeResponse=!1;var e=new Promise((e,t)=>{this._handshakeResolver=e,this._handshakeRejecter=t});await this.connection.start(this._protocol.transferFormat);try{var t={protocol:this._protocol.name,version:this._protocol.version};if(this._logger.log(he.a.Debug,"Sending handshake request."),await this._sendMessage(this._handshakeProtocol.writeHandshakeRequest(t)),this._logger.log(he.a.Information,`Using HubProtocol '${this._protocol.name}'.`),this._cleanupTimeout(),this._resetTimeoutPeriod(),this._resetKeepAliveInterval(),await e,this._stopDuringStartError)throw this._stopDuringStartError}catch(e){throw this._logger.log(he.a.Debug,`Hub handshake failed with error '${e}' during start(). Stopping HubConnection.`),this._cleanupTimeout(),this._cleanupPingTimer(),await this.connection.stop(e),e}}async stop(){var e=this._startPromise;this._stopPromise=this._stopInternal(),await this._stopPromise;try{await e}catch(e){}}_stopInternal(e){return this._connectionState===ce.Disconnected?(this._logger.log(he.a.Debug,`Call to HubConnection.stop(${e}) ignored because it is already in the disconnected state.`),Promise.resolve()):this._connectionState===ce.Disconnecting?(this._logger.log(he.a.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnecting state.`),this._stopPromise):(this._connectionState=ce.Disconnecting,this._logger.log(he.a.Debug,"Stopping HubConnection."),this._reconnectDelayHandle?(this._logger.log(he.a.Debug,"Connection stopped during reconnect delay. Done reconnecting."),clearTimeout(this._reconnectDelayHandle),this._reconnectDelayHandle=void 0,this._completeClose(),Promise.resolve()):(this._cleanupTimeout(),this._cleanupPingTimer(),this._stopDuringStartError=e||new Error("The connection was stopped before the hub handshake could complete."),this.connection.stop(e)))}stream(e,...t){var[i,n]=this._replaceStreamingParams(t);const r=this._createStreamInvocation(e,t,n);let s;const o=new xe;return o.cancelCallback=()=>{const e=this._createCancelInvocation(r.invocationId);return delete this._callbacks[r.invocationId],s.then(()=>this._sendWithProtocol(e))},this._callbacks[r.invocationId]=(e,t)=>{t?o.error(t):e&&(e.type===ae.Completion?e.error?o.error(new Error(e.error)):o.complete():o.next(e.item))},s=this._sendWithProtocol(r).catch(e=>{o.error(e),delete this._callbacks[r.invocationId]}),this._launchStreams(i,s),o}_sendMessage(e){return this._resetKeepAliveInterval(),this.connection.send(e)}_sendWithProtocol(e){return this._sendMessage(this._protocol.writeMessage(e))}send(e,...t){var[i,n]=this._replaceStreamingParams(t),n=this._sendWithProtocol(this._createInvocation(e,t,!0,n));return this._launchStreams(i,n),n}invoke(e,...t){const[r,i]=this._replaceStreamingParams(t),s=this._createInvocation(e,t,!1,i);return new Promise((i,n)=>{this._callbacks[s.invocationId]=(e,t)=>{t?n(t):e&&(e.type===ae.Completion?e.error?n(new Error(e.error)):i(e.result):n(new Error(`Unexpected message type: ${e.type}`)))};var e=this._sendWithProtocol(s).catch(e=>{n(e),delete this._callbacks[s.invocationId]});this._launchStreams(r,e)})}on(e,t){e&&t&&(e=e.toLowerCase(),this._methods[e]||(this._methods[e]=[]),-1===this._methods[e].indexOf(t)&&this._methods[e].push(t))}off(e,t){if(e){e=e.toLowerCase();const i=this._methods[e];i&&(t?-1!==(t=i.indexOf(t))&&(i.splice(t,1),0===i.length&&delete this._methods[e]):delete this._methods[e])}}onclose(e){e&&this._closedCallbacks.push(e)}onreconnecting(e){e&&this._reconnectingCallbacks.push(e)}onreconnected(e){e&&this._reconnectedCallbacks.push(e)}_processIncomingData(e){if(this._cleanupTimeout(),this._receivedHandshakeResponse||(e=this._processHandshakeResponse(e),this._receivedHandshakeResponse=!0),e)for(const i of this._protocol.parseMessages(e,this._logger))switch(i.type){case ae.Invocation:this._invokeClientMethod(i);break;case ae.StreamItem:case ae.Completion:{const n=this._callbacks[i.invocationId];if(n){i.type===ae.Completion&&delete this._callbacks[i.invocationId];try{n(i)}catch(e){this._logger.log(he.a.Error,`Stream callback threw error: ${Object(le.g)(e)}`)}}break}case ae.Ping:break;case ae.Close:this._logger.log(he.a.Information,"Close message received from server.");var t=i.error?new Error("Server returned an error on close: "+i.error):void 0;!0===i.allowReconnect?this.connection.stop(t):this._stopPromise=this._stopInternal(t);break;default:this._logger.log(he.a.Warning,`Invalid message type: ${i.type}.`)}this._resetTimeoutPeriod()}_processHandshakeResponse(e){let t,i;try{[i,t]=this._handshakeProtocol.parseHandshakeResponse(e)}catch(e){var n="Error parsing handshake response: "+e;this._logger.log(he.a.Error,n);n=new Error(n);throw this._handshakeRejecter(n),n}if(t.error){n="Server returned handshake error: "+t.error;this._logger.log(he.a.Error,n);n=new Error(n);throw this._handshakeRejecter(n),n}return this._logger.log(he.a.Debug,"Server handshake complete."),this._handshakeResolver(),i}_resetKeepAliveInterval(){this.connection.features.inherentKeepAlive||(this._nextKeepAlive=(new Date).getTime()+this.keepAliveIntervalInMilliseconds,this._cleanupPingTimer())}_resetTimeoutPeriod(){if(!(this.connection.features&&this.connection.features.inherentKeepAlive||(this._timeoutHandle=setTimeout(()=>this.serverTimeout(),this.serverTimeoutInMilliseconds),void 0!==this._pingServerHandle))){let e=this._nextKeepAlive-(new Date).getTime();e<0&&(e=0),this._pingServerHandle=setTimeout(async()=>{if(this._connectionState===ce.Connected)try{await this._sendMessage(this._cachedPingMessage)}catch{this._cleanupPingTimer()}},e)}}serverTimeout(){this.connection.stop(new Error("Server timeout elapsed without receiving a message from the server."))}_invokeClientMethod(t){const e=this._methods[t.target.toLowerCase()];if(e){try{e.forEach(e=>e.apply(this,t.arguments))}catch(e){this._logger.log(he.a.Error,`A callback for the method ${t.target.toLowerCase()} threw error '${e}'.`)}var i;t.invocationId&&(this._logger.log(he.a.Error,i="Server requested a response, which is not supported in this version of the client."),this._stopPromise=this._stopInternal(new Error(i)))}else this._logger.log(he.a.Warning,`No client method with the name '${t.target}' found.`)}_connectionClosed(e){this._logger.log(he.a.Debug,`HubConnection.connectionClosed(${e}) called while in state ${this._connectionState}.`),this._stopDuringStartError=this._stopDuringStartError||e||new Error("The underlying connection was closed before the hub handshake could complete."),this._handshakeResolver&&this._handshakeResolver(),this._cancelCallbacksWithError(e||new Error("Invocation canceled due to the underlying connection being closed.")),this._cleanupTimeout(),this._cleanupPingTimer(),this._connectionState===ce.Disconnecting?this._completeClose(e):this._connectionState===ce.Connected&&this._reconnectPolicy?this._reconnect(e):this._connectionState===ce.Connected&&this._completeClose(e)}_completeClose(t){if(this._connectionStarted){this._connectionState=ce.Disconnected,this._connectionStarted=!1,le.c.isBrowser&&window.document.removeEventListener("freeze",this._freezeEventListener);try{this._closedCallbacks.forEach(e=>e.apply(this,[t]))}catch(e){this._logger.log(he.a.Error,`An onclose callback called with error '${t}' threw error '${e}'.`)}}}async _reconnect(t){var i=Date.now();let n=0;var r=void 0!==t?t:new Error("Attempting to reconnect due to a unknown error.");let s=this._getNextRetryDelay(n++,0,r);if(null===s)return this._logger.log(he.a.Debug,"Connection not reconnecting because the IRetryPolicy returned null on the first reconnect attempt."),void this._completeClose(t);if(this._connectionState=ce.Reconnecting,t?this._logger.log(he.a.Information,`Connection reconnecting because of error '${t}'.`):this._logger.log(he.a.Information,"Connection reconnecting."),0!==this._reconnectingCallbacks.length){try{this._reconnectingCallbacks.forEach(e=>e.apply(this,[t]))}catch(e){this._logger.log(he.a.Error,`An onreconnecting callback called with error '${t}' threw error '${e}'.`)}if(this._connectionState!==ce.Reconnecting)return void this._logger.log(he.a.Debug,"Connection left the reconnecting state in onreconnecting callback. Done reconnecting.")}for(;null!==s;){if(this._logger.log(he.a.Information,`Reconnect attempt number ${n} will start in ${s} ms.`),await new Promise(e=>{this._reconnectDelayHandle=setTimeout(e,s)}),this._reconnectDelayHandle=void 0,this._connectionState!==ce.Reconnecting)return void this._logger.log(he.a.Debug,"Connection left the reconnecting state during reconnect delay. Done reconnecting.");try{if(await this._startInternal(),this._connectionState=ce.Connected,this._logger.log(he.a.Information,"HubConnection reconnected successfully."),0!==this._reconnectedCallbacks.length)try{this._reconnectedCallbacks.forEach(e=>e.apply(this,[this.connection.connectionId]))}catch(e){this._logger.log(he.a.Error,`An onreconnected callback called with connectionId '${this.connection.connectionId}; threw error '${e}'.`)}return}catch(e){if(this._logger.log(he.a.Information,`Reconnect attempt failed because of error '${e}'.`),this._connectionState!==ce.Reconnecting)return this._logger.log(he.a.Debug,`Connection moved to the '${this._connectionState}' from the reconnecting state during reconnect attempt. Done reconnecting.`),void(this._connectionState===ce.Disconnecting&&this._completeClose());r=e instanceof Error?e:new Error(e.toString()),s=this._getNextRetryDelay(n++,Date.now()-i,r)}}this._logger.log(he.a.Information,`Reconnect retries have been exhausted after ${Date.now()-i} ms and ${n} failed attempts. Connection disconnecting.`),this._completeClose()}_getNextRetryDelay(t,i,e){try{return this._reconnectPolicy.nextRetryDelayInMilliseconds({elapsedMilliseconds:i,previousRetryCount:t,retryReason:e})}catch(e){return this._logger.log(he.a.Error,`IRetryPolicy.nextRetryDelayInMilliseconds(${t}, ${i}) threw error '${e}'.`),null}}_cancelCallbacksWithError(i){const n=this._callbacks;this._callbacks={},Object.keys(n).forEach(e=>{const t=n[e];try{t(null,i)}catch(e){this._logger.log(he.a.Error,`Stream 'error' callback called with '${i}' threw error: ${Object(le.g)(e)}`)}})}_cleanupPingTimer(){this._pingServerHandle&&(clearTimeout(this._pingServerHandle),this._pingServerHandle=void 0)}_cleanupTimeout(){this._timeoutHandle&&clearTimeout(this._timeoutHandle)}_createInvocation(e,t,i,n){if(i)return 0!==n.length?{arguments:t,streamIds:n,target:e,type:ae.Invocation}:{arguments:t,target:e,type:ae.Invocation};{const r=this._invocationId;return this._invocationId++,0!==n.length?{arguments:t,invocationId:r.toString(),streamIds:n,target:e,type:ae.Invocation}:{arguments:t,invocationId:r.toString(),target:e,type:ae.Invocation}}}_launchStreams(e,i){if(0!==e.length){i=i||Promise.resolve();for(const n in e)e[n].subscribe({complete:()=>{i=i.then(()=>this._sendWithProtocol(this._createCompletionMessage(n)))},error:e=>{let t;t=e instanceof Error?e.message:e&&e.toString?e.toString():"Unknown error",i=i.then(()=>this._sendWithProtocol(this._createCompletionMessage(n,t)))},next:e=>{i=i.then(()=>this._sendWithProtocol(this._createStreamItemMessage(n,e)))}})}}_replaceStreamingParams(t){const i=[],n=[];for(let e=0;e<t.length;e++){var r=t[e];if(this._isObservable(r)){const s=this._invocationId;this._invocationId++,i[s]=r,n.push(s.toString()),t.splice(e,1)}}return[i,n]}_isObservable(e){return e&&e.subscribe&&"function"==typeof e.subscribe}_createStreamInvocation(e,t,i){const n=this._invocationId;return this._invocationId++,0!==i.length?{arguments:t,invocationId:n.toString(),streamIds:i,target:e,type:ae.StreamInvocation}:{arguments:t,invocationId:n.toString(),target:e,type:ae.StreamInvocation}}_createCancelInvocation(e){return{invocationId:e,type:ae.CancelInvocation}}_createStreamItemMessage(e,t){return{invocationId:e,item:t,type:ae.StreamItem}}_createCompletionMessage(e,t,i){return t?{error:t,invocationId:e,type:ae.Completion}:{invocationId:e,result:i,type:ae.Completion}}}var Se=i(11);class Te{constructor(){this.name="json",this.version=1,this.transferFormat=oe.Text}parseMessages(e,t){if("string"!=typeof e)throw new Error("Invalid input for JSON hub protocol. Expected a string.");if(!e)return[];null===t&&(t=Se.a.instance);const i=[];for(const r of Be.parse(e)){var n=JSON.parse(r);if("number"!=typeof n.type)throw new Error("Invalid payload.");switch(n.type){case ae.Invocation:this._isInvocationMessage(n);break;case ae.StreamItem:this._isStreamItemMessage(n);break;case ae.Completion:this._isCompletionMessage(n);break;case ae.Ping:case ae.Close:break;default:t.log(he.a.Information,"Unknown message type '"+n.type+"' ignored.");continue}i.push(n)}return i}writeMessage(e){return Be.write(JSON.stringify(e))}_isInvocationMessage(e){this._assertNotEmptyString(e.target,"Invalid payload for Invocation message."),void 0!==e.invocationId&&this._assertNotEmptyString(e.invocationId,"Invalid payload for Invocation message.")}_isStreamItemMessage(e){if(this._assertNotEmptyString(e.invocationId,"Invalid payload for StreamItem message."),void 0===e.item)throw new Error("Invalid payload for StreamItem message.")}_isCompletionMessage(e){if(e.result&&e.error)throw new Error("Invalid payload for Completion message.");!e.result&&e.error&&this._assertNotEmptyString(e.error,"Invalid payload for Completion message."),this._assertNotEmptyString(e.invocationId,"Invalid payload for Completion message.")}_assertNotEmptyString(e,t){if("string"!=typeof e||""===e)throw new Error(t)}}const Me={trace:he.a.Trace,debug:he.a.Debug,info:he.a.Information,information:he.a.Information,warn:he.a.Warning,warning:he.a.Warning,error:he.a.Error,critical:he.a.Critical,none:he.a.None};class ke{configureLogging(e){var t;return le.a.isRequired(e,"logging"),void 0!==e.log?this.logger=e:"string"==typeof e?(t=function(e){var t=Me[e.toLowerCase()];if(void 0!==t)return t;throw new Error(`Unknown log level: ${e}`)}(e),this.logger=new le.b(t)):this.logger=new le.b(e),this}withUrl(e,t){return le.a.isRequired(e,"url"),le.a.isNotEmpty(e,"url"),this.url=e,this.httpConnectionOptions="object"==typeof t?{...this.httpConnectionOptions,...t}:{...this.httpConnectionOptions,transport:t},this}withHubProtocol(e){return le.a.isRequired(e,"protocol"),this.protocol=e,this}withAutomaticReconnect(e){if(this.reconnectPolicy)throw new Error("A reconnectPolicy has already been set.");return e?Array.isArray(e)?this.reconnectPolicy=new q(e):this.reconnectPolicy=e:this.reconnectPolicy=new q,this}build(){const e=this.httpConnectionOptions||{};if(void 0===e.logger&&(e.logger=this.logger),!this.url)throw new Error("The 'HubConnectionBuilder.withUrl' method must be called before building the connection.");var t=new we(this.url,e);return Ee.create(t,this.logger||Se.a.instance,this.protocol||new Te,this.reconnectPolicy)}}class Oe{}Oe.sl="https://www.wodashijie.com/",Oe.rl="https://models.wodashijie.com/",Oe.App=class{constructor(e){e.sl&&(Oe.sl=e.sl),e.rl&&(Oe.rl=e.rl),Y.defaults.baseURL=Oe.sl,this.canvas=document.createElement("canvas"),this.canvas.style.cssText="width: 100%;height: 100%;background-color: transparent;outline-width: 0;-webkit-tap-highlight-color:transparent;",e.container.appendChild(this.canvas),this.engine=new BABYLON.Engine(this.canvas,!0,{premultipliedAlpha:!0,preserveDrawingBuffer:!0,stencil:!0}),this.engine.setHardwareScalingLevel(.5),this.engine.enableOfflineSupport=!1,this.scene=new BABYLON.Scene(this.engine,{useGeometryUniqueIdsMap:!0,useClonedMeshMap:!0,useMaterialMeshMap:!0}),this.scene.useRightHandedSystem=!0,this.scene.getBoundingBoxRenderer().frontColor=BABYLON.Color3.Green(),this.scene.getBoundingBoxRenderer().showBackLines=!1,this.CameraController=new o(this),this.HighlightLayer=new BABYLON.HighlightLayer("highlightLayer",this.scene),this.IEvent=new n(this),this.container=BABYLON.GUI.AdvancedDynamicTexture.CreateFullscreenUI("screenUI"),this.Environment=new v(this),this.Environment.defaultLights(),this.Environment.openAllLight(),this.Resources=new I(this),this.Project=new N(this),Oe.EffectMgr.init(),this.engine.runRenderLoop(()=>{this.fps&&(this.fps.innerText=this.engine.getFps().toFixed()+" fps"),this.scene.render(),w.a.update(),this.IEvent&&this.IEvent.runRender()}),window.addEventListener("resize",()=>{this.engine.resize()}),this.scene.onPointerObservable.add(e=>{this.IEvent&&this.IEvent.onPointer(e)}),this.scene.onKeyboardObservable.add(e=>{this.IEvent&&this.IEvent.onKeyboard(e)})}async load(u){if(u){u.isDefaultLevel=null==u.isDefaultLevel||u.isDefaultLevel,Oe.pk=u.pk;var e=await Y.get(`api/service/GetToken?accessToken=${Oe.accessToken}`);if(200==e.status){localStorage.setItem("mx3d-token",e.data);e=await Y.get("api/service");if(200==e.status){localStorage.setItem("mx3d-long",e.data);e=await Y.get(`api/service/${Oe.pk}`);if(200==e.status){let l=JSON.parse(class{static de(e){let t=localStorage.getItem("mx3d-long");var i=j.a.enc.Utf8.parse(t.substring(0,32)),n=j.a.enc.Utf8.parse(t.substring(32,48)),e=j.a.enc.Hex.parse(e),e=j.a.enc.Base64.stringify(e);return j.a.AES.decrypt(e,i,{iv:n,mode:j.a.mode.CBC,padding:j.a.pad.Pkcs7}).toString(j.a.enc.Utf8).toString()}}.de(e.data));return new Promise(async(n,t)=>{try{this.scene.blockfreeActiveMeshesAndRenderingGroups=!0;let t=new d;for(let e=0;e<l.length;e++){const a=l[e];!a.baseModel||".gltf"!=a.baseModel.extension||t.find(a.baseModel.modelId)||this.Resources.resources.find(a.baseModel.modelId)||(a.baseModel.objectType=a.objectType,t.add(a.baseModel.modelId,a.baseModel))}let e=0;for(const c in t.map)await this.Resources.loadModelMesh(t.find(c)),e++,u&&u.progress&&u.progress(e/t.count()*.3);e=0,t=null;let i=new d;for(let e=0;e<l.length;e++){var r,s=l[e];s.objectType==f.Region&&(r=new P(this,s),this.Project.objectDatas.add(r.id,r),i.add(r.id,new Array),"0"==r.parentId&&(this.Project.root=r))}for(let e=0;e<l.length;e++){var o=l[e];if(o.objectType!=f.Region){let e=i.find(o.parentId);e.push(o)}}for(const h in i.map)await this.Project.objectDatas.find(h).bind(i.find(h)),e++,u&&u.progress&&u.progress(.3+e/i.count()*.7);i=null,this.Project.optimization(),u.isDefaultLevel&&this.Project.switchLevel(),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1,n(null),this.engine.resize(),u&&u.complete&&u.complete()}catch(e){t(e)}})}}}}else console.error("场景编号不能为空!")}dispose(){this.Environment.hideFps(),this.Project.clear(),this.Resources.delete(),this.engine.dispose()}},Oe.Tools=p,Oe.EffectMgr=_,Oe.HubService=class{static async listener(e){this.connection=(new ke).withUrl(e).configureLogging(he.a.Error).build(),this.connection.onclose(async()=>{await this.start()}),await this.start()}static async start(){try{await this.connection.start()}catch(e){console.log("无法连接服务器"),setTimeout(this.start,5e3)}}},Oe.UI=class{static createIconFromMesh(e,t,i,n,r){let s=t.Sight.focus.clone();var o=t.instance.getBoundingInfo();return s.y+=(o.boundingBox.maximum.y-o.boundingBox.minimum.y)/2,new U(e,s,i,n,r,t.app.scene)}static createIcon(e,t,i,n){let r;t.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,r=new z(e,t.app.scene),r.size=i,r.height=n,r.pint=new BABYLON.Mesh(e+"_pint");e=t.Sight.focus.clone();return r.pint.position=e,r.pint.position.y+=n,r.rect=new BABYLON.GUI.Rectangle,r.rect.isPointerBlocker=!1,r.rect.width=i.width+"px",r.rect.height=i.height+"px",r.rect.thickness=0,t.app.container.addControl(r.rect),r.rect.linkWithMesh(r.pint),t.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,r}static create2DLine(t,i,n){if(!(i.length<2)){let e=new F;return e.id=t,e.objs=i,n&&n.width&&(e.width=n.width),n&&n.color&&(e.color=n.color),n&&n.isDotted&&(e.isDotted=n.isDotted),e.update(),e}console.error("要连线的对象不能少于2个。")}static create3DLine(t,i,n){if(!(i.length<2)){let e=new H;return e.id=t,e.objs=i,n&&n.width&&(e.width=n.width),n&&n.color&&(e.color=n.color),e.update(),e}console.error("要连线的对象不能少于2个。")}},Oe.HeatMapBuilder=class{static createMatrixCloud(r){r.displayValues=null!=r.displayValues&&r.displayValues,r.isAlpha=null==r.isAlpha||r.isAlpha,r.isParticle=null==r.isParticle||r.isParticle,r.height=r.height||.5,r.radius=r.radius||2.8,r.isLevelRender=null==r.isLevelRender||r.isLevelRender,r.range=r.range||{max:30,min:16};let s;if(!(r.value||r.value.maxX||r.value.maxY||r.value.data||r.anchor))return s;r.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,s=new V(r.anchor);var o=r.anchor.instance.getBoundingInfo();s.mesh=r.anchor.instance.clone(s.id),s.mesh.position.y+=r.height;var a=o.maximum.x-o.minimum.x,c=a/(2*r.value.maxX),h=o.maximum.z-o.minimum.z,l=h/(2*r.value.maxY);let e=new Array;for(let n=0;n<2*r.value.maxX;n++)for(let i=0;i<2*r.value.maxY;i++){let t={x:n,y:i,value:r.range.min};for(let e=0;e<r.value.data.length;e++){var u=r.value.data[e];2*u.x+1==n&&2*u.y+1==i&&(t.value=u.value,u=new BABYLON.Vector3(o.boundingSphere.center.x-(a/2-c*n),s.mesh.position.y,o.boundingSphere.center.z-(h/2-l*i)),s.texts.push(this.createTempVlaue(t.value+"℃",u,r.anchor.app.scene,r.anchor.app.container)))}e.push(t)}s.displayValues=r.displayValues;let t=G.create({width:2*r.value.maxX,height:2*r.value.maxY,radius:r.radius});t.setData({min:r.range.min,max:r.range.max,data:e});let i=new BABYLON.StandardMaterial(s.id,r.anchor.app.scene);return i.diffuseTexture=new BABYLON.Texture(t.getDataURL(),r.anchor.app.scene,!1,!1),i.specularColor=new BABYLON.Color3(0,0,0),i.alpha=.5,r.isAlpha&&(i.diffuseTexture.hasAlpha=!0),r.isParticle&&BABYLON.GPUParticleSystem.IsSupported&&(this._getMatrixParticleTex(Oe.rl,r.anchor.app.Resources.FogTex,i.diffuseTexture,s.mesh,r.anchor.app.scene,r.isLevelRender),s.mesh.isVisible=!1),r.isLevelRender&&(s.mesh.renderingGroupId=1),s.mesh.material=i,s.mesh.alwaysSelectAsActiveMesh=!0,s.mesh.freezeWorldMatrix(),r.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,s}static _getMatrixParticleTex(e,t,i,n,r,s){let o,a=t.clone(),c=n.getBoundingInfo().boundingBox;var h=(c.extendSizeWorld.x+c.extendSizeWorld.z)/9,t=1500*h*h;c.minimumWorld.subtract(new BABYLON.Vector3(-0,0,-0)),c.maximumWorld.subtract(new BABYLON.Vector3(0,0,0));o&&o.dispose(),BABYLON.GPUParticleSystem.IsSupported&&(o=new BABYLON.GPUParticleSystem("particles",{capacity:t},r),o.activeParticleCount=t,o.manualEmitCount=o.activeParticleCount,o.minEmitBox=c.minimumWorld,o.maxEmitBox=c.maximumWorld),o.particleTexture=a,o.emitter=n,s&&(o.renderingGroupId=1),o.isLocal=!0;let l=new BABYLON.NodeMaterial("nm_heatmapBox_"+n.id,r);return l.loadAsync(e+"resources/horizontalNodeMat.json").then(()=>{l.build(!1),l.getBlockByName("boxTex").texture=i,l.getBlockByName("emitXMin").value=o.minEmitBox.x,l.getBlockByName("emitXMax").value=o.maxEmitBox.x,l.getBlockByName("emitYMin").value=o.minEmitBox.z,l.getBlockByName("emitYMax").value=o.maxEmitBox.z,l.createEffectForParticles(o)}),n.onDispose=()=>{o&&o.dispose()},o.onDispose=()=>{l&&l.dispose(),a&&a.dispose()},o.color1=new BABYLON.Color4(.8,.8,.8,.1),o.color2=new BABYLON.Color4(.95,.95,.95,.15),o.colorDead=new BABYLON.Color4(.9,.9,.9,.1),o.minSize=1.4,o.maxSize=2,o.minLifeTime=Number.MAX_SAFE_INTEGER,o.emitRate=5e4*h,o.blendMode=BABYLON.ParticleSystem.BLENDMODE_STANDARD,o.gravity=new BABYLON.Vector3(0,0,0),o.direction1=new BABYLON.Vector3(0,0,0),o.direction2=new BABYLON.Vector3(0,0,0),o.minAngularSpeed=-2,o.maxAngularSpeed=2,o.minEmitPower=.5,o.maxEmitPower=1,o.updateSpeed=.005,o.start(),o}static createPunctateCloud(n){if(n.displayValues=null!=n.displayValues&&n.displayValues,n.isAlpha=null==n.isAlpha||n.isAlpha,n.isParticle=null==n.isParticle||n.isParticle,n.radius=n.radius||1,n.isLevelRender=null==n.isLevelRender||n.isLevelRender,n.range=n.range||{max:30,min:16},!n.value&&!n.anchor)return console.error("要创建的云图数值为空!"),null;let e;n.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,e=new V(n.anchor),e.mesh=BABYLON.MeshBuilder.CreatePlane(e.id,{width:1,height:1,sideOrientation:2},n.anchor.app.scene),e.mesh.scaling=new BABYLON.Vector3(n.radius,n.radius,n.radius),e.mesh.alwaysSelectAsActiveMesh=!0,e.mesh.enablePointerMoveEvents=!1,e.mesh.isPickable=!1,e.mesh.position=n.anchor.instance.position.clone(),e.mesh.rotation.x=Math.PI/2;let r=[];for(let i=0;i<6;i++)for(let t=0;t<6;t++){let e={x:i,y:t,value:n.range.min};2==i&&2==t||3==i&&2==t||2==i&&3==t||3==i&&3==t?e.value=n.value:e.value=n.value-2*(Math.abs(2-i)+Math.abs(2-t)),r.push(e)}e.displayValues=n.displayValues;let t=G.create({width:5,height:5,radius:2});t.setData({min:n.range.min,max:n.range.max,data:r});let i=new BABYLON.StandardMaterial(e.id,n.anchor.app.scene);return i.diffuseTexture=new BABYLON.Texture(t.getDataURL(),n.anchor.app.scene,!1,!1),i.specularColor=new BABYLON.Color3(0,0,0),i.alpha=.5,n.isAlpha&&(i.diffuseTexture.hasAlpha=!0),n.isParticle&&BABYLON.GPUParticleSystem.IsSupported&&(this._getColumnarParticleTex(i.diffuseTexture,e.mesh,n.anchor.app.scene,e.anchor.app.Resources.FogTex,n.isLevelRender),e.mesh.isVisible=!1),n.isLevelRender&&(e.mesh.renderingGroupId=1),e.mesh.material=i,e.mesh.alwaysSelectAsActiveMesh=!0,e.mesh.freezeWorldMatrix(),n.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,e}static createColumnCloud(r){if(r.displayValues=null!=r.displayValues&&r.displayValues,r.isAlpha=null==r.isAlpha||r.isAlpha,r.isParticle=null==r.isParticle||r.isParticle,r.radius=r.radius||4,r.isLevelRender=null==r.isLevelRender||r.isLevelRender,r.range=r.range||{max:30,min:16},!r.data&&r.data.length<1&&!r.anchor)return console.error("要创建的云图数值为空!"),null;let i;r.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,i=new V(r.anchor);var n=.98*r.anchor.instance.scaling.y;i.mesh=BABYLON.MeshBuilder.CreatePlane(i.id,{width:.98*r.anchor.instance.scaling.x,height:n,sideOrientation:2},r.anchor.app.scene),i.mesh.alwaysSelectAsActiveMesh=!0,i.mesh.enablePointerMoveEvents=!1,i.mesh.isPickable=!1,i.mesh.position=r.anchor.instance.position.clone(),i.mesh.rotation.z=Math.PI,i.mesh.rotation.y=r.anchor.instance.rotation.y,r.isLevelRender&&(i.mesh.renderingGroupId=1);let e=[];for(let n=0;n<4;n++)for(let i=0;i<3*r.data.length;i++){let t={x:n,y:i,value:r.range.min};for(let e=0;e<r.data.length;e++){var s=r.data[e];2==n&&3*e+2==i&&(t.value=s.value)}e.push(t)}var o=n/r.data.length;for(let t=0;t<r.data.length;t++){let e=i.mesh.position.clone();e.y=e.y-n/2+(n-o*t-o/2),i.texts.push(this.createTempVlaue(r.data[t].value+"℃",e,r.anchor.app.scene,i.anchor.app.container))}i.displayValues=r.displayValues;let t=G.create({width:4,height:3*r.data.length,radius:r.radius});t.setData({min:r.range.min,max:r.range.max,data:e});let a=new BABYLON.StandardMaterial(i.id,r.anchor.app.scene);return a.diffuseTexture=new BABYLON.Texture(t.getDataURL(),r.anchor.app.scene,!1,!1),a.specularColor=new BABYLON.Color3(0,0,0),a.alpha=.5,r.isAlpha&&(a.diffuseTexture.hasAlpha=!0),r.isParticle&&BABYLON.GPUParticleSystem.IsSupported&&(this._getColumnarParticleTex(a.diffuseTexture,i.mesh,r.anchor.app.scene,i.anchor.app.Resources.FogTex,r.isLevelRender),i.mesh.isVisible=!1),i.mesh.material=a,i.mesh.alwaysSelectAsActiveMesh=!0,i.mesh.freezeWorldMatrix(),r.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,i}static _getColumnarParticleTex(e,t,i,n,r){let s,o=n.clone();n=t.getBoundingInfo().boundingBox,n.extendSizeWorld.x,n.extendSizeWorld.z;BABYLON.Effect.ShadersStore.particlesVertexShader=`
26
26
  precision highp float;
27
27
  in vec3 position;
28
28
  in vec4 color;
@@ -106,4 +106,4 @@
106
106
 
107
107
  gl_FragColor = vec4(baseTex.xyz, resAlpha.a);
108
108
  }
109
- `;var a=i.getEngine().createEffectForParticles(t.id+"myParticle",["time","u_emitXMin","u_emitYMin","u_emitXMax","u_emitYMax","emitBox_WorldM"],["boxTexSampler"],"");return t.onAfterWorldMatrixUpdateObservable.add(()=>{}),a.onCompileObservable.add(()=>{a.setMatrix("emitBox_WorldM",t.getWorldMatrix()),a.setFloat("u_emitXMin",s.minEmitBox.x),a.setFloat("u_emitYMin",s.minEmitBox.y),a.setFloat("u_emitXMax",s.maxEmitBox.x),a.setFloat("u_emitYMax",s.maxEmitBox.y)}),a.onBind=function(){a.setTexture("boxTexSampler",e)},s&&s.dispose(),BABYLON.GPUParticleSystem.IsSupported&&(s=new BABYLON.ParticleSystem("particles",200,i,a),s.manualEmitCount=s.getCapacity(),s.minEmitBox=n.minimum,s.maxEmitBox=n.maximum),t.onDispose=()=>{s&&s.dispose()},s.onDispose=()=>{o&&o.dispose()},s.particleTexture=o.clone(),s.emitter=t,r&&(s.renderingGroupId=1),s.isLocal=!0,s.color1=new BABYLON.Color4(.8,.8,.8,.1),s.color2=new BABYLON.Color4(.95,.95,.95,.15),s.colorDead=new BABYLON.Color4(.9,.9,.9,.1),s.minSize=.7,s.maxSize=1,s.minLifeTime=Number.MAX_SAFE_INTEGER,s.emitRate=50,s.blendMode=BABYLON.ParticleSystem.BLENDMODE_STANDARD,s.gravity=new BABYLON.Vector3(0,0,0),s.direction1=new BABYLON.Vector3(0,0,0),s.direction2=new BABYLON.Vector3(0,0,0),s.minAngularSpeed=-2,s.maxAngularSpeed=2,s.minEmitPower=.5,s.maxEmitPower=1,s.updateSpeed=.005,s.start(),s}static createTempVlaue(e,t,i,n){let r=new BABYLON.Mesh("temp_"+o.getGUID(12),i);r.position=t;let s=new BABYLON.GUI.TextBlock;return s.isPointerBlocker=!1,s.text="默认提示",s.color="white",s.resizeToFit=!0,s.fontSize="20px",s.text=e,n.addControl(s),s.linkWithMesh(r),s}},ke.CapacityBuilder=class{static createCapacity(e,t,i,n="200px"){let r=new V(e,t);r.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,r.mesh=BABYLON.MeshBuilder.CreateBox("RATIO_"+r.anchor.id,{size:1}),r.mesh.position=r.anchor.instance.position.clone(),r.mesh.position.y-=r.mesh.scaling.y/2,r.mesh.scaling=r.anchor.instance.scaling.clone(),r.mesh.scaling.x=.98*r.mesh.scaling.x,r.mesh.scaling.z=.98*r.mesh.scaling.z,r.mesh.rotation=r.anchor.instance.rotation.clone(),r.mesh.alwaysSelectAsActiveMesh=!0,r.mesh.visibility=1;let s=t<.25?BABYLON.Color3.Blue():.25<=t&&t<.5?BABYLON.Color3.Green():.5<=t&&t<.75?BABYLON.Color3.Yellow():BABYLON.Color3.Red();r.color=s.toHexString(),t*=r.mesh.scaling.y;var o=new BABYLON.Vector3(0,-.5,0);r.mesh.setPivotPoint(o);let a=new BABYLON.StandardMaterial(r.mesh.id,r.anchor.instance._scene);return a.diffuseColor=s,r.mesh.material=a,BABYLON.Animation.CreateAndStartAnimation(r.mesh.id,r.mesh,"scaling.y",15,30,.02,t,0,null),r.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,i&&(r.textMesh=this.createTextMesh(e,i,t,n,"#fff")),r}static createTextMesh(e,t,i,n="200px",r="white"){e.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;let s=BABYLON.Mesh.CreatePlane("text_"+e.id,e.instance.scaling.x,e.app.scene,!0,BABYLON.Mesh.DOUBLESIDE);s.alwaysSelectAsActiveMesh=!0,s.position=e.instance.position.clone(),s.position.y=i+.05,s.rotation.y=Math.PI-e.instance.rotation.y,s.rotation.x=-Math.PI/2;let o=new BABYLON.StandardMaterial("text_mat_"+e.id,e.app.scene);o.diffuseColor=BABYLON.Color3.White(),o.emissiveColor=BABYLON.Color3.White();let a=new BABYLON.DynamicTexture("text_tex_"+e.id,{width:1e3*e.instance.scaling.x,height:500*e.instance.scaling.x},e.app.scene,!1);return a.hasAlpha=!0,o.diffuseTexture=a,o.opacityTexture=a,a.drawText(t,1e3*e.instance.scaling.x/2,500*e.instance.scaling.x/2,"bold "+n+" NexaBold",r,"",!0,!0),a.update(),s.material=o,e.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,s}},ke.EffectType=w,ke.EventType=_}],u={},h.m=l,h.c=u,h.d=function(e,t,i){h.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},h.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},h.t=function(t,e){if(1&e&&(t=h(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(h.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)h.d(i,n,function(e){return t[e]}.bind(null,n));return i},h.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return h.d(t,"a",t),t},h.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},h.p="",h(h.s=84).default;function h(e){if(u[e])return u[e].exports;var t=u[e]={i:e,l:!1,exports:{}};return l[e].call(t.exports,t,t.exports,h),t.l=!0,t.exports}var l,u});
109
+ `;var a=i.getEngine().createEffectForParticles(t.id+"myParticle",["time","u_emitXMin","u_emitYMin","u_emitXMax","u_emitYMax","emitBox_WorldM"],["boxTexSampler"],"");return t.onAfterWorldMatrixUpdateObservable.add(()=>{}),a.onCompileObservable.add(()=>{a.setMatrix("emitBox_WorldM",t.getWorldMatrix()),a.setFloat("u_emitXMin",s.minEmitBox.x),a.setFloat("u_emitYMin",s.minEmitBox.y),a.setFloat("u_emitXMax",s.maxEmitBox.x),a.setFloat("u_emitYMax",s.maxEmitBox.y)}),a.onBind=function(){a.setTexture("boxTexSampler",e)},s&&s.dispose(),BABYLON.GPUParticleSystem.IsSupported&&(s=new BABYLON.ParticleSystem("particles",200,i,a),s.manualEmitCount=s.getCapacity(),s.minEmitBox=n.minimum,s.maxEmitBox=n.maximum),t.onDispose=()=>{s&&s.dispose()},s.onDispose=()=>{o&&o.dispose()},s.particleTexture=o.clone(),s.emitter=t,r&&(s.renderingGroupId=1),s.isLocal=!0,s.color1=new BABYLON.Color4(.8,.8,.8,.1),s.color2=new BABYLON.Color4(.95,.95,.95,.15),s.colorDead=new BABYLON.Color4(.9,.9,.9,.1),s.minSize=.7,s.maxSize=1,s.minLifeTime=Number.MAX_SAFE_INTEGER,s.emitRate=50,s.blendMode=BABYLON.ParticleSystem.BLENDMODE_STANDARD,s.gravity=new BABYLON.Vector3(0,0,0),s.direction1=new BABYLON.Vector3(0,0,0),s.direction2=new BABYLON.Vector3(0,0,0),s.minAngularSpeed=-2,s.maxAngularSpeed=2,s.minEmitPower=.5,s.maxEmitPower=1,s.updateSpeed=.005,s.start(),s}static createTempVlaue(e,t,i,n){let r=new BABYLON.Mesh("temp_"+a.getGUID(12),i);r.position=t;let s=new BABYLON.GUI.TextBlock;return s.isPointerBlocker=!1,s.text="默认提示",s.color="white",s.resizeToFit=!0,s.fontSize="20px",s.text=e,n.addControl(s),s.linkWithMesh(r),s}},Oe.CapacityBuilder=class{static createCapacity(e,t,i,n="200px"){let r=new W(e,t);r.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,r.mesh=BABYLON.MeshBuilder.CreateBox("RATIO_"+r.anchor.id,{size:1}),r.mesh.position=r.anchor.instance.position.clone(),r.mesh.position.y-=r.mesh.scaling.y/2,r.mesh.scaling=r.anchor.instance.scaling.clone(),r.mesh.scaling.x=.98*r.mesh.scaling.x,r.mesh.scaling.z=.98*r.mesh.scaling.z,r.mesh.rotation=r.anchor.instance.rotation.clone(),r.mesh.alwaysSelectAsActiveMesh=!0,r.mesh.visibility=1;let s=t<.25?BABYLON.Color3.Blue():.25<=t&&t<.5?BABYLON.Color3.Green():.5<=t&&t<.75?BABYLON.Color3.Yellow():BABYLON.Color3.Red();r.color=s.toHexString(),t*=r.mesh.scaling.y;var o=new BABYLON.Vector3(0,-.5,0);r.mesh.setPivotPoint(o);let a=new BABYLON.StandardMaterial(r.mesh.id,r.anchor.instance._scene);return a.diffuseColor=s,r.mesh.material=a,BABYLON.Animation.CreateAndStartAnimation(r.mesh.id,r.mesh,"scaling.y",15,30,.02,t,0,null),r.anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,i&&(r.textMesh=this.createTextMesh(e,i,t,n,"#fff")),r}static createTextMesh(e,t,i,n="200px",r="white"){e.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;let s=BABYLON.Mesh.CreatePlane("text_"+e.id,e.instance.scaling.x,e.app.scene,!0,BABYLON.Mesh.DOUBLESIDE);s.alwaysSelectAsActiveMesh=!0,s.position=e.instance.position.clone(),s.position.y=i+.05,s.rotation.y=Math.PI-e.instance.rotation.y,s.rotation.x=-Math.PI/2;let o=new BABYLON.StandardMaterial("text_mat_"+e.id,e.app.scene);o.diffuseColor=BABYLON.Color3.White(),o.emissiveColor=BABYLON.Color3.White();let a=new BABYLON.DynamicTexture("text_tex_"+e.id,{width:1e3*e.instance.scaling.x,height:500*e.instance.scaling.x},e.app.scene,!1);return a.hasAlpha=!0,o.diffuseTexture=a,o.opacityTexture=a,a.drawText(t,1e3*e.instance.scaling.x/2,500*e.instance.scaling.x/2,"bold "+n+" NexaBold",r,"",!0,!0),a.update(),s.material=o,e.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,s}},Oe.EffectType=y,Oe.EventType=b}],u={},h.m=l,h.c=u,h.d=function(e,t,i){h.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},h.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},h.t=function(t,e){if(1&e&&(t=h(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(h.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)h.d(i,n,function(e){return t[e]}.bind(null,n));return i},h.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return h.d(t,"a",t),t},h.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},h.p="",h(h.s=84).default;function h(e){if(u[e])return u[e].exports;var t=u[e]={i:e,l:!1,exports:{}};return l[e].call(t.exports,t,t.exports,h),t.l=!0,t.exports}var l,u});