mx3d 0.0.35 → 0.0.39
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/core/mx3d.kernel.min.js +2 -16
- package/core/mx3d.loaders.min.js +7 -49
- package/index.d.ts +2304 -26
- package/mx3d.js +112 -10121
- package/mx3d.min.js +6 -6
- package/package.json +1 -1
- package/core/mx3d.dazzle.min.js +0 -85
- package/docs/.nojekyll +0 -0
- package/docs/README.md +0 -24
- package/docs/_sidebar.md +0 -18
- package/docs/camera.md +0 -24
- package/docs/css/dark.css +0 -979
- package/docs/css/local.google.fonts.css +0 -295
- package/docs/css/vue.css +0 -1025
- package/docs/fonts/6xK3dSBYKcSV-LCoeQqfX1RYOo3qOK7l.woff2 +0 -0
- package/docs/fonts/6xKydSBYKcSV-LCoeQqfX1RYOo3i54rwlxdu.woff2 +0 -0
- package/docs/fonts/6xKydSBYKcSV-LCoeQqfX1RYOo3ik4zwlxdu.woff2 +0 -0
- package/docs/gui/2D.md +0 -53
- package/docs/gui/3D.md +0 -46
- package/docs/gui/test1.png +0 -0
- package/docs/gui/test2.png +0 -0
- package/docs/gui/test3.png +0 -0
- package/docs/heatMap/heatMap.md +0 -115
- package/docs/heatMap/test1.png +0 -0
- package/docs/heatMap/test2.png +0 -0
- package/docs/index.html +0 -50
- package/docs/js/docsify@4.min.js +0 -1
- package/docs/models/modelmgr.md +0 -251
- package/docs/project/projectmgr.md +0 -73
- package/docs/project/scenetree.jpg +0 -0
- package/docs/started/environment.md +0 -42
- package/docs/started/quickstart.md +0 -89
- package/lib/App.d.ts +0 -45
- package/lib/ArrayEx.d.ts +0 -3
- package/lib/Builder/BaseNode.d.ts +0 -9
- package/lib/Builder/Builder.d.ts +0 -0
- package/lib/Builder/HeatMap.d.ts +0 -0
- package/lib/Builder/Icon.d.ts +0 -0
- package/lib/Builder/IconFromMesh.d.ts +0 -0
- package/lib/Camera.d.ts +0 -18
- package/lib/Cryptojs.d.ts +0 -3
- package/lib/Dictionary.d.ts +0 -13
- package/lib/EffectControls.d.ts +0 -42
- package/lib/EffectMgr.d.ts +0 -10
- package/lib/EffectType.d.ts +0 -5
- package/lib/Environment.d.ts +0 -22
- package/lib/EventType.d.ts +0 -8
- package/lib/GUID.d.ts +0 -3
- package/lib/HeatMapMgr.d.ts +0 -2
- package/lib/Optimized/OptimizedRegion.d.ts +0 -11
- package/lib/ReadJSON.d.ts +0 -3
- package/lib/Resources.d.ts +0 -23
- package/lib/TipsTool.d.ts +0 -15
- package/lib/ToolTip.d.ts +0 -0
- package/lib/Tools.d.ts +0 -19
- package/lib/UI.d.ts +0 -9
- package/lib/VisualAngle.d.ts +0 -13
- package/lib/components/AirFlowObject.d.ts +0 -10
- package/lib/components/BuildingObject.d.ts +0 -5
- package/lib/components/CabinetObject.d.ts +0 -3
- package/lib/components/ConduitObject.d.ts +0 -10
- package/lib/components/CornerObject.d.ts +0 -5
- package/lib/components/DefaultObject.d.ts +0 -46
- package/lib/components/DoorObject.d.ts +0 -5
- package/lib/components/FloorObject.d.ts +0 -5
- package/lib/components/IObject.d.ts +0 -27
- package/lib/components/Ibase.d.ts +0 -8
- package/lib/components/LeakWaterObject.d.ts +0 -7
- package/lib/components/ObjectType.d.ts +0 -47
- package/lib/components/OptimizedWallObject.d.ts +0 -5
- package/lib/components/Project.d.ts +0 -29
- package/lib/components/Region.d.ts +0 -14
- package/lib/components/UI3DTextObject.d.ts +0 -4
- package/lib/components/VirtualBoxObject.d.ts +0 -4
- package/lib/components/WallObject.d.ts +0 -7
- package/lib/components/WindowObject.d.ts +0 -5
- package/lib/lights/Directional.d.ts +0 -7
- package/lib/lights/Hemispheric.d.ts +0 -6
- package/lib/lights/ILightObject.d.ts +0 -10
- package/lib/lights/LightObject.d.ts +0 -15
- package/lib/lights/LightType.d.ts +0 -8
- package/lib/lights/Point.d.ts +0 -7
- package/lib/lights/Spot.d.ts +0 -10
package/mx3d.min.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("TWEEN"),require("Dazzle"),require("BABYLON"),require("babylonjs-materials"),require("BABYLON.GUI"),require("BABYLON.SceneLoader"),require("babylonjs-serializers")):"function"==typeof define&&define.amd?define(["TWEEN","Dazzle","BABYLON","babylonjs-materials","BABYLON.GUI","BABYLON.SceneLoader","babylonjs-serializers"],t):"object"==typeof exports?exports.MX3D=t(require("TWEEN"),require("Dazzle"),require("BABYLON"),require("babylonjs-materials"),require("BABYLON.GUI"),require("BABYLON.SceneLoader"),require("babylonjs-serializers")):e.MX3D=t(e.TWEEN,e.Dazzle,e.BABYLON,e["babylonjs-materials"],e["BABYLON.GUI"],e["BABYLON.SceneLoader"],e["babylonjs-serializers"])}(window,function(i,s,n,o,r,a,c){return l=[function(t,e,g){!function(f){var e;t.exports=(e=function(h){var s;if("undefined"!=typeof window&&window.crypto&&(s=window.crypto),"undefined"!=typeof self&&self.crypto&&(s=self.crypto),!(s=!(s=!(s="undefined"!=typeof globalThis&&globalThis.crypto?globalThis.crypto:s)&&"undefined"!=typeof window&&window.msCrypto?window.msCrypto:s)&&void 0!==f&&f.crypto?f.crypto:s))try{s=g(19)}catch(e){}var i=Object.create||function(e){return t.prototype=e,e=new t,t.prototype=null,e};function t(){}var e={},n=e.lib={},o=n.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=n.WordArray=o.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,s=this.sigBytes,n=e.sigBytes;if(this.clamp(),s%4)for(var o=0;o<n;o++){var r=i[o>>>2]>>>24-o%4*8&255;t[s+o>>>2]|=r<<24-(s+o)%4*8}else for(var a=0;a<n;a+=4)t[s+a>>>2]=i[a>>>2];return this.sigBytes+=n,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=o.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(s){if("function"==typeof s.getRandomValues)try{return s.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof s.randomBytes)try{return s.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)}}),r=e.enc={},a=r.Hex={stringify:function(e){for(var t=e.words,i=e.sigBytes,s=[],n=0;n<i;n++){var o=t[n>>>2]>>>24-n%4*8&255;s.push((o>>>4).toString(16)),s.push((15&o).toString(16))}return s.join("")},parse:function(e){for(var t=e.length,i=[],s=0;s<t;s+=2)i[s>>>3]|=parseInt(e.substr(s,2),16)<<24-s%8*4;return new l.init(i,t/2)}},c=r.Latin1={stringify:function(e){for(var t=e.words,i=e.sigBytes,s=[],n=0;n<i;n++){var o=t[n>>>2]>>>24-n%4*8&255;s.push(String.fromCharCode(o))}return s.join("")},parse:function(e){for(var t=e.length,i=[],s=0;s<t;s++)i[s>>>2]|=(255&e.charCodeAt(s))<<24-s%4*8;return new l.init(i,t)}},p=r.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=n.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new l.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=p.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(e){var t,i=this._data,s=i.words,n=i.sigBytes,o=this.blockSize,r=n/(4*o),a=(r=e?h.ceil(r):h.max((0|r)-this._minBufferSize,0))*o,n=h.min(4*a,n);if(a){for(var c=0;c<a;c+=o)this._doProcessBlock(s,c);t=s.splice(0,a),i.sigBytes-=n}return new l.init(t,n)},clone:function(){var e=o.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0}),u=(n.Hasher=d.extend({cfg:o.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 u.HMAC.init(i,t).finalize(e)}}}),e.algo={});return e}(Math),e)}.call(this,g(18))},function(e,t,i){var g;e.exports=(g=i(0),i(5),void(g.lib.Cipher||function(){var e=g,t=e.lib,i=t.Base,r=t.WordArray,s=t.BufferedBlockAlgorithm,n=e.enc,o=(n.Utf8,n.Base64),a=e.algo.EvpKDF,c=t.Cipher=s.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(){s.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(s){return{encrypt:function(e,t,i){return h(t).encrypt(s,e,t,i)},decrypt:function(e,t,i){return h(t).decrypt(s,e,t,i)}}}});function h(e){return"string"==typeof e?f:u}t.StreamCipher=c.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var l=e.mode={},n=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}}),n=l.CBC=((l=n.extend()).Encryptor=l.extend({processBlock:function(e,t){var i=this._cipher,s=i.blockSize;p.call(this,e,t,s),i.encryptBlock(e,t),this._prevBlock=e.slice(t,t+s)}}),l.Decryptor=l.extend({processBlock:function(e,t){var i=this._cipher,s=i.blockSize,n=e.slice(t,t+s);i.decryptBlock(e,t),p.call(this,e,t,s),this._prevBlock=n}}),l);function p(e,t,i){var s,n=this._iv;n?(s=n,this._iv=void 0):s=this._prevBlock;for(var o=0;o<i;o++)e[t+o]^=s[o]}var l=(e.pad={}).Pkcs7={pad:function(e,t){for(var t=4*t,i=t-e.sigBytes%t,s=i<<24|i<<16|i<<8|i,n=[],o=0;o<i;o+=4)n.push(s);t=r.create(n,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:n,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?r.create([1398893684,1701076831]).concat(e).concat(t):t;return t.toString(o)},parse:function(e){var t,i=o.parse(e),e=i.words;return 1398893684==e[0]&&1701076831==e[1]&&(t=r.create(e.slice(2,4)),e.splice(0,4),i.sigBytes-=16),d.create({ciphertext:i,salt:t})}},u=t.SerializableCipher=i.extend({cfg:i.extend({format:l}),encrypt:function(e,t,i,s){s=this.cfg.extend(s);var n=e.createEncryptor(i,s),t=n.finalize(t),n=n.cfg;return d.create({ciphertext:t,key:i,iv:n.iv,algorithm:e,mode:n.mode,padding:n.padding,blockSize:e.blockSize,formatter:s.format})},decrypt:function(e,t,i,s){return s=this.cfg.extend(s),t=this._parse(t,s.format),e.createDecryptor(i,s).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,s){s=s||r.random(8);e=a.create({keySize:t+i}).compute(e,s),i=r.create(e.words.slice(t),4*i);return e.sigBytes=4*t,d.create({key:e,iv:i,salt:s})}},f=t.PasswordBasedCipher=u.extend({cfg:u.cfg.extend({kdf:e}),encrypt:function(e,t,i,s){i=(s=this.cfg.extend(s)).kdf.execute(i,e.keySize,e.ivSize);s.iv=i.iv;s=u.encrypt.call(this,e,t,i.key,s);return s.mixIn(i),s},decrypt:function(e,t,i,s){s=this.cfg.extend(s),t=this._parse(t,s.format);i=s.kdf.execute(i,e.keySize,e.ivSize,t.salt);return s.iv=i.iv,u.decrypt.call(this,e,t,i.key,s)}})}()))},function(e,t){e.exports=i},function(e,t){e.exports=s},function(e,t,i){e.exports=(e=i(0),i(8),i(20),i(21),i(6),i(22),i(7),i(9),i(11),i(23),i(12),i(24),i(25),i(26),i(10),i(27),i(5),i(1),i(28),i(29),i(30),i(31),i(32),i(33),i(34),i(35),i(36),i(37),i(38),i(39),i(40),i(41),i(42),i(43),e)},function(e,t,i){var o;e.exports=(o=i(0),i(9),i(10),function(){var e=o,t=e.lib,i=t.Base,l=t.WordArray,s=e.algo,t=s.MD5,n=s.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,s=this.cfg,n=s.hasher.create(),o=l.create(),r=o.words,a=s.keySize,c=s.iterations;r.length<a;){i&&n.update(i),i=n.update(e).finalize(t),n.reset();for(var h=1;h<c;h++)i=n.finalize(i),n.reset();o.concat(i)}return o.sigBytes=4*a,o}});e.EvpKDF=function(e,t,i){return n.create(i).compute(e,t)}}(),o.EvpKDF)},function(e,t,i){var s;e.exports=(s=i(0),function(){var c=s.lib.WordArray;s.enc.Base64={stringify:function(e){var t=e.words,i=e.sigBytes,s=this._map;e.clamp();for(var n=[],o=0;o<i;o+=3)for(var r=(t[o>>>2]>>>24-o%4*8&255)<<16|(t[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|t[o+2>>>2]>>>24-(o+2)%4*8&255,a=0;a<4&&o+.75*a<i;a++)n.push(s.charAt(r>>>6*(3-a)&63));var c=s.charAt(64);if(c)for(;n.length%4;)n.push(c);return n.join("")},parse:function(e){var t=e.length,i=this._map;if(!(s=this._reverseMap))for(var s=this._reverseMap=[],n=0;n<i.length;n++)s[i.charCodeAt(n)]=n;var o=i.charAt(64);return!o||-1!==(o=e.indexOf(o))&&(t=o),function(e,t,i){for(var s=[],n=0,o=0;o<t;o++){var r,a;o%4&&(r=i[e.charCodeAt(o-1)]<<o%4*2,a=i[e.charCodeAt(o)]>>>6-o%4*2,a=r|a,s[n>>>2]|=a<<24-n%4*8,n++)}return c.create(s,n)}(e,t,s)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),s.enc.Base64)},function(e,t,i){var n;e.exports=(n=i(0),function(c){var e=n,t=e.lib,i=t.WordArray,s=t.Hasher,t=e.algo,_=[];!function(){for(var e=0;e<64;e++)_[e]=4294967296*c.abs(c.sin(e+1))|0}();t=t.MD5=s.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var i=0;i<16;i++){var s=t+i,n=e[s];e[s]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8)}var o=this._hash.words,r=e[t+0],a=e[t+1],c=e[t+2],h=e[t+3],l=e[t+4],p=e[t+5],d=e[t+6],u=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],B=e[t+14],A=e[t+15],w=k(w=o[0],T=o[1],M=o[2],x=o[3],r,7,_[0]),x=k(x,w,T,M,a,12,_[1]),M=k(M,x,w,T,c,17,_[2]),T=k(T,M,x,w,h,22,_[3]);w=k(w,T,M,x,l,7,_[4]),x=k(x,w,T,M,p,12,_[5]),M=k(M,x,w,T,d,17,_[6]),T=k(T,M,x,w,u,22,_[7]),w=k(w,T,M,x,f,7,_[8]),x=k(x,w,T,M,g,12,_[9]),M=k(M,x,w,T,m,17,_[10]),T=k(T,M,x,w,v,22,_[11]),w=k(w,T,M,x,y,7,_[12]),x=k(x,w,T,M,b,12,_[13]),M=k(M,x,w,T,B,17,_[14]),w=O(w,T=k(T,M,x,w,A,22,_[15]),M,x,a,5,_[16]),x=O(x,w,T,M,d,9,_[17]),M=O(M,x,w,T,v,14,_[18]),T=O(T,M,x,w,r,20,_[19]),w=O(w,T,M,x,p,5,_[20]),x=O(x,w,T,M,m,9,_[21]),M=O(M,x,w,T,A,14,_[22]),T=O(T,M,x,w,l,20,_[23]),w=O(w,T,M,x,g,5,_[24]),x=O(x,w,T,M,B,9,_[25]),M=O(M,x,w,T,h,14,_[26]),T=O(T,M,x,w,f,20,_[27]),w=O(w,T,M,x,b,5,_[28]),x=O(x,w,T,M,c,9,_[29]),M=O(M,x,w,T,u,14,_[30]),w=L(w,T=O(T,M,x,w,y,20,_[31]),M,x,p,4,_[32]),x=L(x,w,T,M,f,11,_[33]),M=L(M,x,w,T,v,16,_[34]),T=L(T,M,x,w,B,23,_[35]),w=L(w,T,M,x,a,4,_[36]),x=L(x,w,T,M,l,11,_[37]),M=L(M,x,w,T,u,16,_[38]),T=L(T,M,x,w,m,23,_[39]),w=L(w,T,M,x,b,4,_[40]),x=L(x,w,T,M,r,11,_[41]),M=L(M,x,w,T,h,16,_[42]),T=L(T,M,x,w,d,23,_[43]),w=L(w,T,M,x,g,4,_[44]),x=L(x,w,T,M,y,11,_[45]),M=L(M,x,w,T,A,16,_[46]),w=C(w,T=L(T,M,x,w,c,23,_[47]),M,x,r,6,_[48]),x=C(x,w,T,M,u,10,_[49]),M=C(M,x,w,T,B,15,_[50]),T=C(T,M,x,w,p,21,_[51]),w=C(w,T,M,x,y,6,_[52]),x=C(x,w,T,M,h,10,_[53]),M=C(M,x,w,T,m,15,_[54]),T=C(T,M,x,w,a,21,_[55]),w=C(w,T,M,x,f,6,_[56]),x=C(x,w,T,M,A,10,_[57]),M=C(M,x,w,T,d,15,_[58]),T=C(T,M,x,w,b,21,_[59]),w=C(w,T,M,x,l,6,_[60]),x=C(x,w,T,M,v,10,_[61]),M=C(M,x,w,T,c,15,_[62]),T=C(T,M,x,w,g,21,_[63]),o[0]=o[0]+w|0,o[1]=o[1]+T|0,o[2]=o[2]+M|0,o[3]=o[3]+x|0},_doFinalize:function(){var e=this._data,t=e.words,i=8*this._nDataBytes,s=8*e.sigBytes;t[s>>>5]|=128<<24-s%32;var n=c.floor(i/4294967296),i=i;t[15+(64+s>>>9<<4)]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),t[14+(64+s>>>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,o=t.words,r=0;r<4;r++){var a=o[r];o[r]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8)}return t},clone:function(){var e=s.clone.call(this);return e._hash=this._hash.clone(),e}});function k(e,t,i,s,n,o,r){r=e+(t&i|~t&s)+n+r;return(r<<o|r>>>32-o)+t}function O(e,t,i,s,n,o,r){r=e+(t&s|i&~s)+n+r;return(r<<o|r>>>32-o)+t}function L(e,t,i,s,n,o,r){r=e+(t^i^s)+n+r;return(r<<o|r>>>32-o)+t}function C(e,t,i,s,n,o,r){r=e+(i^(t|~s))+n+r;return(r<<o|r>>>32-o)+t}e.MD5=s._createHelper(t),e.HmacMD5=s._createHmacHelper(t)}(Math),n.MD5)},function(e,t,i){var s;e.exports=(s=i(0),function(){var e=s,t=e.lib,n=t.Base,o=t.WordArray,e=e.x64={};e.Word=n.extend({init:function(e,t){this.high=e,this.low=t}}),e.WordArray=n.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=[],s=0;s<t;s++){var n=e[s];i.push(n.high),i.push(n.low)}return o.create(i,this.sigBytes)},clone:function(){for(var e=n.clone.call(this),t=e.words=this.words.slice(0),i=t.length,s=0;s<i;s++)t[s]=t[s].clone();return e}})}(),s)},function(e,t,i){var n;e.exports=(n=i(0),function(){var e=n,t=e.lib,i=t.WordArray,s=t.Hasher,t=e.algo,l=[],t=t.SHA1=s.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var i=this._hash.words,s=i[0],n=i[1],o=i[2],r=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=(s<<5|s>>>27)+a+l[c];h+=c<20?1518500249+(n&o|~n&r):c<40?1859775393+(n^o^r):c<60?(n&o|n&r|o&r)-1894007588:(n^o^r)-899497514,a=r,r=o,o=n<<30|n>>>2,n=s,s=h}i[0]=i[0]+s|0,i[1]=i[1]+n|0,i[2]=i[2]+o|0,i[3]=i[3]+r|0,i[4]=i[4]+a|0},_doFinalize:function(){var e=this._data,t=e.words,i=8*this._nDataBytes,s=8*e.sigBytes;return t[s>>>5]|=128<<24-s%32,t[14+(64+s>>>9<<4)]=Math.floor(i/4294967296),t[15+(64+s>>>9<<4)]=i,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=s.clone.call(this);return e._hash=this._hash.clone(),e}});e.SHA1=s._createHelper(t),e.HmacSHA1=s._createHmacHelper(t)}(),n.SHA1)},function(e,t,i){var s;e.exports=(s=i(0),void function(){var e=s.lib.Base,a=s.enc.Utf8;s.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,s=4*i;(t=t.sigBytes>s?e.finalize(t):t).clamp();for(var e=this._oKey=t.clone(),t=this._iKey=t.clone(),n=e.words,o=t.words,r=0;r<i;r++)n[r]^=1549556828,o[r]^=909522486;e.sigBytes=t.sigBytes=s,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){var r;e.exports=(r=i(0),function(n){var e=r,t=e.lib,i=t.WordArray,s=t.Hasher,t=e.algo,o=[],f=[];!function(){function e(e){return 4294967296*(e-(0|e))|0}for(var t=2,i=0;i<64;)!function(e){for(var t=n.sqrt(e),i=2;i<=t;i++)if(!(e%i))return;return 1}(t)||(i<8&&(o[i]=e(n.pow(t,.5))),f[i]=e(n.pow(t,1/3)),i++),t++}();var g=[],t=t.SHA256=s.extend({_doReset:function(){this._hash=new i.init(o.slice(0))},_doProcessBlock:function(e,t){for(var i=this._hash.words,s=i[0],n=i[1],o=i[2],r=i[3],a=i[4],c=i[5],h=i[6],l=i[7],p=0;p<64;p++){p<16?g[p]=0|e[t+p]:(d=g[p-15],u=g[p-2],g[p]=((d<<25|d>>>7)^(d<<14|d>>>18)^d>>>3)+g[p-7]+((u<<15|u>>>17)^(u<<13|u>>>19)^u>>>10)+g[p-16]);var d=s&n^s&o^n&o,u=l+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&c^~a&h)+f[p]+g[p],l=h,h=c,c=a,a=r+u|0,r=o,o=n,n=s,s=u+(((s<<30|s>>>2)^(s<<19|s>>>13)^(s<<10|s>>>22))+d)|0}i[0]=i[0]+s|0,i[1]=i[1]+n|0,i[2]=i[2]+o|0,i[3]=i[3]+r|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,s=8*e.sigBytes;return t[s>>>5]|=128<<24-s%32,t[14+(64+s>>>9<<4)]=n.floor(i/4294967296),t[15+(64+s>>>9<<4)]=i,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=s.clone.call(this);return e._hash=this._hash.clone(),e}});e.SHA256=s._createHelper(t),e.HmacSHA256=s._createHmacHelper(t)}(Math),r.SHA256)},function(e,t,i){var r;e.exports=(r=i(0),i(8),function(){var e=r,t=e.lib.Hasher,i=e.x64,s=i.Word,n=i.WordArray,i=e.algo;function o(){return s.create.apply(s,arguments)}var ee=[o(1116352408,3609767458),o(1899447441,602891725),o(3049323471,3964484399),o(3921009573,2173295548),o(961987163,4081628472),o(1508970993,3053834265),o(2453635748,2937671579),o(2870763221,3664609560),o(3624381080,2734883394),o(310598401,1164996542),o(607225278,1323610764),o(1426881987,3590304994),o(1925078388,4068182383),o(2162078206,991336113),o(2614888103,633803317),o(3248222580,3479774868),o(3835390401,2666613458),o(4022224774,944711139),o(264347078,2341262773),o(604807628,2007800933),o(770255983,1495990901),o(1249150122,1856431235),o(1555081692,3175218132),o(1996064986,2198950837),o(2554220882,3999719339),o(2821834349,766784016),o(2952996808,2566594879),o(3210313671,3203337956),o(3336571891,1034457026),o(3584528711,2466948901),o(113926993,3758326383),o(338241895,168717936),o(666307205,1188179964),o(773529912,1546045734),o(1294757372,1522805485),o(1396182291,2643833823),o(1695183700,2343527390),o(1986661051,1014477480),o(2177026350,1206759142),o(2456956037,344077627),o(2730485921,1290863460),o(2820302411,3158454273),o(3259730800,3505952657),o(3345764771,106217008),o(3516065817,3606008344),o(3600352804,1432725776),o(4094571909,1467031594),o(275423344,851169720),o(430227734,3100823752),o(506948616,1363258195),o(659060556,3750685593),o(883997877,3785050280),o(958139571,3318307427),o(1322822218,3812723403),o(1537002063,2003034995),o(1747873779,3602036899),o(1955562222,1575990012),o(2024104815,1125592928),o(2227730452,2716904306),o(2361852424,442776044),o(2428436474,593698344),o(2756734187,3733110249),o(3204031479,2999351573),o(3329325298,3815920427),o(3391569614,3928383900),o(3515267271,566280711),o(3940187606,3454069534),o(4118630271,4000239992),o(116418474,1914138554),o(174292421,2731055270),o(289380356,3203993006),o(460393269,320620315),o(685471733,587496836),o(852142971,1086792851),o(1017036298,365543100),o(1126000580,2618297676),o(1288033470,3409855158),o(1501505948,4234509866),o(1607167915,987167468),o(1816402316,1246189591)],te=[];!function(){for(var e=0;e<80;e++)te[e]=o()}();i=i.SHA512=t.extend({_doReset:function(){this._hash=new n.init([new s.init(1779033703,4089235720),new s.init(3144134277,2227873595),new s.init(1013904242,4271175723),new s.init(2773480762,1595750129),new s.init(1359893119,2917565137),new s.init(2600822924,725511199),new s.init(528734635,4215389547),new s.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var i=this._hash.words,s=i[0],n=i[1],o=i[2],r=i[3],a=i[4],c=i[5],h=i[6],l=i[7],p=s.high,d=s.low,u=n.high,f=n.low,g=o.high,m=o.low,v=r.high,y=r.low,b=a.high,B=a.low,A=c.high,w=c.low,x=h.high,M=h.low,T=l.high,i=l.low,_=p,k=d,O=u,L=f,C=g,E=m,j=v,S=y,I=b,N=B,z=A,P=w,D=x,Y=M,R=T,V=i,F=0;F<80;F++){var H,G,W=te[F];F<16?(G=W.high=0|e[t+2*F],H=W.low=0|e[t+2*F+1]):($=(U=te[F-15]).high,J=U.low,K=(Z=te[F-2]).high,X=Z.low,q=(Q=te[F-7]).high,U=Q.low,Q=(Z=te[F-16]).high,G=(G=(($>>>1|J<<31)^($>>>8|J<<24)^$>>>7)+q+((H=(q=(J>>>1|$<<31)^(J>>>8|$<<24)^(J>>>7|$<<25))+U)>>>0<q>>>0?1:0))+((K>>>19|X<<13)^(K<<3|X>>>29)^K>>>6)+((H+=J=(X>>>19|K<<13)^(X<<3|K>>>29)^(X>>>6|K<<26))>>>0<J>>>0?1:0),H+=$=Z.low,W.high=G=G+Q+(H>>>0<$>>>0?1:0),W.low=H);var U=I&z^~I&D,q=N&P^~N&Y,X=_&O^_&C^O&C,K=(k>>>28|_<<4)^(k<<30|_>>>2)^(k<<25|_>>>7),J=ee[F],Z=J.high,Q=J.low,$=V+((N>>>14|I<<18)^(N>>>18|I<<14)^(N<<23|I>>>9)),W=R+((I>>>14|N<<18)^(I>>>18|N<<14)^(I<<23|N>>>9))+($>>>0<V>>>0?1:0),J=K+(k&L^k&E^L&E),R=D,V=Y,D=z,Y=P,z=I,P=N,I=j+(W=(W=(W=W+U+(($=$+q)>>>0<q>>>0?1:0))+Z+(($=$+Q)>>>0<Q>>>0?1:0))+G+(($=$+H)>>>0<H>>>0?1:0))+((N=S+$|0)>>>0<S>>>0?1:0)|0,j=C,S=E,C=O,E=L,O=_,L=k,_=W+(((_>>>28|k<<4)^(_<<30|k>>>2)^(_<<25|k>>>7))+X+(J>>>0<K>>>0?1:0))+((k=$+J|0)>>>0<$>>>0?1:0)|0}d=s.low=d+k,s.high=p+_+(d>>>0<k>>>0?1:0),f=n.low=f+L,n.high=u+O+(f>>>0<L>>>0?1:0),m=o.low=m+E,o.high=g+C+(m>>>0<E>>>0?1:0),y=r.low=y+S,r.high=v+j+(y>>>0<S>>>0?1:0),B=a.low=B+N,a.high=b+I+(B>>>0<N>>>0?1:0),w=c.low=w+P,c.high=A+z+(w>>>0<P>>>0?1:0),M=h.low=M+Y,h.high=x+D+(M>>>0<Y>>>0?1:0),i=l.low=i+V,l.high=T+R+(i>>>0<V>>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,i=8*this._nDataBytes,s=8*e.sigBytes;return t[s>>>5]|=128<<24-s%32,t[30+(128+s>>>10<<5)]=Math.floor(i/4294967296),t[31+(128+s>>>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)}(),r.SHA512)},function(e,t){e.exports=n},function(e,t){e.exports=o},function(e,t){e.exports=r},function(e,t){e.exports=a},function(e,t){e.exports=c},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){},function(e,t,i){var s;e.exports=(s=i(0),function(){var e,n;"function"==typeof ArrayBuffer&&(e=s.lib.WordArray,n=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=[],s=0;s<t;s++)i[s>>>2]|=e[s]<<24-s%4*8;n.call(this,i,t)}else n.apply(this,arguments)}).prototype=e)}(),s.lib.WordArray)},function(e,t,i){var s;e.exports=(s=i(0),function(){var n=s.lib.WordArray,e=s.enc;e.Utf16=e.Utf16BE={stringify:function(e){for(var t=e.words,i=e.sigBytes,s=[],n=0;n<i;n+=2){var o=t[n>>>2]>>>16-n%4*8&65535;s.push(String.fromCharCode(o))}return s.join("")},parse:function(e){for(var t=e.length,i=[],s=0;s<t;s++)i[s>>>1]|=e.charCodeAt(s)<<16-s%2*16;return n.create(i,2*t)}};function r(e){return e<<8&4278255360|e>>>8&16711935}e.Utf16LE={stringify:function(e){for(var t=e.words,i=e.sigBytes,s=[],n=0;n<i;n+=2){var o=r(t[n>>>2]>>>16-n%4*8&65535);s.push(String.fromCharCode(o))}return s.join("")},parse:function(e){for(var t=e.length,i=[],s=0;s<t;s++)i[s>>>1]|=r(e.charCodeAt(s)<<16-s%2*16);return n.create(i,2*t)}}}(),s.enc.Utf16)},function(e,t,i){var s;e.exports=(s=i(0),function(){var c=s.lib.WordArray;s.enc.Base64url={stringify:function(e,t=!0){var i=e.words,s=e.sigBytes,n=t?this._safe_map:this._map;e.clamp();for(var o=[],r=0;r<s;r+=3)for(var a=(i[r>>>2]>>>24-r%4*8&255)<<16|(i[r+1>>>2]>>>24-(r+1)%4*8&255)<<8|i[r+2>>>2]>>>24-(r+2)%4*8&255,c=0;c<4&&r+.75*c<s;c++)o.push(n.charAt(a>>>6*(3-c)&63));var h=n.charAt(64);if(h)for(;o.length%4;)o.push(h);return o.join("")},parse:function(e,t=!0){var i=e.length,s=t?this._safe_map:this._map;if(!(n=this._reverseMap))for(var n=this._reverseMap=[],o=0;o<s.length;o++)n[s.charCodeAt(o)]=o;t=s.charAt(64);return!t||-1!==(t=e.indexOf(t))&&(i=t),function(e,t,i){for(var s=[],n=0,o=0;o<t;o++){var r,a;o%4&&(r=i[e.charCodeAt(o-1)]<<o%4*2,a=i[e.charCodeAt(o)]>>>6-o%4*2,a=r|a,s[n>>>2]|=a<<24-n%4*8,n++)}return c.create(s,n)}(e,i,n)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"}}(),s.enc.Base64url)},function(e,t,i){var n;e.exports=(n=i(0),i(11),function(){var e=n,t=e.lib.WordArray,i=e.algo,s=i.SHA256,i=i.SHA224=s.extend({_doReset:function(){this._hash=new t.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var e=s._doFinalize.call(this);return e.sigBytes-=4,e}});e.SHA224=s._createHelper(i),e.HmacSHA224=s._createHmacHelper(i)}(),n.SHA224)},function(e,t,i){var o;e.exports=(o=i(0),i(8),i(12),function(){var e=o,t=e.x64,i=t.Word,s=t.WordArray,t=e.algo,n=t.SHA512,t=t.SHA384=n.extend({_doReset:function(){this._hash=new s.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=n._doFinalize.call(this);return e.sigBytes-=16,e}});e.SHA384=n._createHelper(t),e.HmacSHA384=n._createHmacHelper(t)}(),o.SHA384)},function(e,t,i){var n;e.exports=(n=i(0),i(8),function(l){var e=n,t=e.lib,p=t.WordArray,s=t.Hasher,d=e.x64.Word,t=e.algo,_=[],k=[],O=[];!function(){for(var e=1,t=0,i=0;i<24;i++){_[e+5*t]=(i+1)*(i+2)/2%64;var s=(2*e+3*t)%5;e=t%5,t=s}for(e=0;e<5;e++)for(t=0;t<5;t++)k[e+5*t]=t+(2*e+3*t)%5*5;for(var n=1,o=0;o<24;o++){for(var r,a=0,c=0,h=0;h<7;h++)1&n&&((r=(1<<h)-1)<32?c^=1<<r:a^=1<<r-32),128&n?n=n<<1^113:n<<=1;O[o]=d.create(a,c)}}();var L=[];!function(){for(var e=0;e<25;e++)L[e]=d.create()}();t=t.SHA3=s.extend({cfg:s.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,s=this.blockSize/2,n=0;n<s;n++){var o=e[t+2*n],r=e[t+2*n+1],o=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8);(w=i[n]).high^=r=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),w.low^=o}for(var a=0;a<24;a++){for(var c=0;c<5;c++){for(var h=0,l=0,p=0;p<5;p++)h^=(w=i[c+5*p]).high,l^=w.low;var d=L[c];d.high=h,d.low=l}for(c=0;c<5;c++)for(var u=L[(c+4)%5],f=L[(c+1)%5],g=f.high,f=f.low,h=u.high^(g<<1|f>>>31),l=u.low^(f<<1|g>>>31),p=0;p<5;p++)(w=i[c+5*p]).high^=h,w.low^=l;for(var m=1;m<25;m++){var v=(w=i[m]).high,y=w.low,b=_[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=L[k[m]];b.high=h,b.low=l}var B=L[0],A=i[0];B.high=A.high,B.low=A.low;for(c=0;c<5;c++)for(p=0;p<5;p++){var w=i[m=c+5*p],x=L[m],M=L[(c+1)%5+5*p],T=L[(c+2)%5+5*p];w.high=x.high^~M.high&T.high,w.low=x.low^~M.low&T.low}w=i[0],A=O[a];w.high^=A.high,w.low^=A.low}},_doFinalize:function(){var e=this._data,t=e.words,i=(this._nDataBytes,8*e.sigBytes),s=32*this.blockSize;t[i>>>5]|=1<<24-i%32,t[(l.ceil((1+i)/s)*s>>>5)-1]|=128,e.sigBytes=4*t.length,this._process();for(var n=this._state,t=this.cfg.outputLength/8,o=t/8,r=[],a=0;a<o;a++){var c=n[a],h=c.high,c=c.low,h=16711935&(h<<8|h>>>24)|4278255360&(h<<24|h>>>8);r.push(c=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8)),r.push(h)}return new p.init(r,t)},clone:function(){for(var e=s.clone.call(this),t=e._state=this._state.slice(0),i=0;i<25;i++)t[i]=t[i].clone();return e}});e.SHA3=s._createHelper(t),e.HmacSHA3=s._createHmacHelper(t)}(Math),n.SHA3)},function(e,t,i){var n;e.exports=(n=i(0),function(){var e=n,t=e.lib,i=t.WordArray,s=t.Hasher,t=e.algo,x=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]),M=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]),T=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]),_=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]),k=i.create([0,1518500249,1859775393,2400959708,2840853838]),O=i.create([1352829926,1548603684,1836072691,2053994217,0]),t=t.RIPEMD160=s.extend({_doReset:function(){this._hash=i.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var i=0;i<16;i++){var s=t+i,n=e[s];e[s]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8)}for(var o,r,a,c,h,l,p=this._hash.words,d=k.words,u=O.words,f=x.words,g=M.words,m=T.words,v=_.words,y=o=p[0],b=r=p[1],B=a=p[2],A=c=p[3],w=h=p[4],i=0;i<80;i+=1)l=o+e[t+f[i]]|0,l+=i<16?(r^a^c)+d[0]:i<32?L(r,a,c)+d[1]:i<48?((r|~a)^c)+d[2]:i<64?C(r,a,c)+d[3]:(r^(a|~c))+d[4],l=(l=E(l|=0,m[i]))+h|0,o=h,h=c,c=E(a,10),a=r,r=l,l=y+e[t+g[i]]|0,l+=i<16?(b^(B|~A))+u[0]:i<32?C(b,B,A)+u[1]:i<48?((b|~B)^A)+u[2]:i<64?L(b,B,A)+u[3]:(b^B^A)+u[4],l=(l=E(l|=0,v[i]))+w|0,y=w,w=A,A=E(B,10),B=b,b=l;l=p[1]+a+A|0,p[1]=p[2]+c+w|0,p[2]=p[3]+h+y|0,p[3]=p[4]+o+b|0,p[4]=p[0]+r+B|0,p[0]=l},_doFinalize:function(){var e=this._data,t=e.words,i=8*this._nDataBytes,s=8*e.sigBytes;t[s>>>5]|=128<<24-s%32,t[14+(64+s>>>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,n=t.words,o=0;o<5;o++){var r=n[o];n[o]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8)}return t},clone:function(){var e=s.clone.call(this);return e._hash=this._hash.clone(),e}});function L(e,t,i){return e&t|~e&i}function C(e,t,i){return e&i|t&~i}function E(e,t){return e<<t|e>>>32-t}e.RIPEMD160=s._createHelper(t),e.HmacRIPEMD160=s._createHmacHelper(t)}(Math),n.RIPEMD160)},function(e,t,i){var o;e.exports=(o=i(0),i(9),i(10),function(){var e=o,t=e.lib,i=t.Base,v=t.WordArray,s=e.algo,t=s.SHA1,y=s.HMAC,n=s.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,s=y.create(i.hasher,e),n=v.create(),o=v.create([1]),r=n.words,a=o.words,c=i.keySize,h=i.iterations;r.length<c;){var l=s.update(t).finalize(o);s.reset();for(var p=l.words,d=p.length,u=l,f=1;f<h;f++){u=s.finalize(u),s.reset();for(var g=u.words,m=0;m<d;m++)p[m]^=g[m]}n.concat(l),a[0]++}return n.sigBytes=4*c,n}});e.PBKDF2=function(e,t,i){return n.create(i).compute(e,t)}}(),o.PBKDF2)},function(e,t,i){var s;e.exports=(s=i(0),i(1),s.mode.CFB=function(){var e=s.lib.BlockCipherMode.extend();function o(e,t,i,s){var n,o=this._iv;o?(n=o.slice(0),this._iv=void 0):n=this._prevBlock,s.encryptBlock(n,0);for(var r=0;r<i;r++)e[t+r]^=n[r]}return e.Encryptor=e.extend({processBlock:function(e,t){var i=this._cipher,s=i.blockSize;o.call(this,e,t,s,i),this._prevBlock=e.slice(t,t+s)}}),e.Decryptor=e.extend({processBlock:function(e,t){var i=this._cipher,s=i.blockSize,n=e.slice(t,t+s);o.call(this,e,t,s,i),this._prevBlock=n}}),e}(),s.mode.CFB)},function(e,t,i){var s;e.exports=(s=i(0),i(1),s.mode.CTR=function(){var e=s.lib.BlockCipherMode.extend(),t=e.Encryptor=e.extend({processBlock:function(e,t){var i=this._cipher,s=i.blockSize,n=this._iv,o=this._counter;n&&(o=this._counter=n.slice(0),this._iv=void 0);var r=o.slice(0);i.encryptBlock(r,0),o[s-1]=o[s-1]+1|0;for(var a=0;a<s;a++)e[t+a]^=r[a]}});return e.Decryptor=t,e}(),s.mode.CTR)},function(e,t,i){var s;e.exports=(s=i(0),i(1),s.mode.CTRGladman=function(){var e=s.lib.BlockCipherMode.extend();function c(e){var t,i,s;return 255==(e>>24&255)?(i=e>>8&255,s=255&e,255===(t=e>>16&255)?(t=0,255===i?(i=0,255===s?s=0:++s):++i):++t,e=0,e+=t<<16,e+=i<<8,e+=s):e+=1<<24,e}var t=e.Encryptor=e.extend({processBlock:function(e,t){var i=this._cipher,s=i.blockSize,n=this._iv,o=this._counter;n&&(o=this._counter=n.slice(0),this._iv=void 0),0===((n=o)[0]=c(n[0]))&&(n[1]=c(n[1]));var r=o.slice(0);i.encryptBlock(r,0);for(var a=0;a<s;a++)e[t+a]^=r[a]}});return e.Decryptor=t,e}(),s.mode.CTRGladman)},function(e,t,i){var s;e.exports=(s=i(0),i(1),s.mode.OFB=function(){var e=s.lib.BlockCipherMode.extend(),t=e.Encryptor=e.extend({processBlock:function(e,t){var i=this._cipher,s=i.blockSize,n=this._iv,o=this._keystream;n&&(o=this._keystream=n.slice(0),this._iv=void 0),i.encryptBlock(o,0);for(var r=0;r<s;r++)e[t+r]^=o[r]}});return e.Decryptor=t,e}(),s.mode.OFB)},function(e,t,i){var s;e.exports=(s=i(0),i(1),s.mode.ECB=function(){var e=s.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}(),s.mode.ECB)},function(e,t,i){e.exports=(e=i(0),i(1),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 s;e.exports=(s=i(0),i(1),s.pad.Iso10126={pad:function(e,t){t*=4,t-=e.sigBytes%t;e.concat(s.lib.WordArray.random(t-1)).concat(s.lib.WordArray.create([t<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},s.pad.Iso10126)},function(e,t,i){var s;e.exports=(s=i(0),i(1),s.pad.Iso97971={pad:function(e,t){e.concat(s.lib.WordArray.create([2147483648],1)),s.pad.ZeroPadding.pad(e,t)},unpad:function(e){s.pad.ZeroPadding.unpad(e),e.sigBytes--}},s.pad.Iso97971)},function(e,t,i){e.exports=(e=i(0),i(1),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(0),i(1),e.pad.NoPadding={pad:function(){},unpad:function(){}},e.pad.NoPadding)},function(e,t,i){var s;e.exports=(s=i(0),i(1),function(){var t=s.lib.CipherParams,i=s.enc.Hex;s.format.Hex={stringify:function(e){return e.ciphertext.toString(i)},parse:function(e){e=i.parse(e);return t.create({ciphertext:e})}}}(),s.format.Hex)},function(e,t,i){var s;e.exports=(s=i(0),i(6),i(7),i(5),i(1),function(){var e=s,t=e.lib.BlockCipher,i=e.algo,h=[],l=[],p=[],d=[],u=[],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,s=0,t=0;t<256;t++){var n=s^s<<1^s<<2^s<<3^s<<4;h[i]=n=n>>>8^255&n^99;var o=e[l[n]=i],r=e[o],a=e[r],c=257*e[n]^16843008*n;p[i]=c<<24|c>>>8,d[i]=c<<16|c>>>16,u[i]=c<<8|c>>>24,f[i]=c,g[n]=(c=16843009*a^65537*r^257*o^16843008*i)<<24|c>>>8,m[n]=c<<16|c>>>16,v[n]=c<<8|c>>>24,y[n]=c,i?(i=o^e[e[e[a^o]]],s^=e[e[s]]):i=s=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,s=4*(1+(this._nRounds=6+i)),n=this._keySchedule=[],o=0;o<s;o++)o<i?n[o]=t[o]:(c=n[o-1],o%i?6<i&&o%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[o/i|0]<<24),n[o]=n[o-i]^c);for(var r=this._invKeySchedule=[],a=0;a<s;a++){var c,o=s-a;c=a%4?n[o]:n[o-4],r[a]=a<4||o<=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,p,d,u,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,s,n,o,r,a){for(var c=this._nRounds,h=e[t]^i[0],l=e[t+1]^i[1],p=e[t+2]^i[2],d=e[t+3]^i[3],u=4,f=1;f<c;f++)var g=s[h>>>24]^n[l>>>16&255]^o[p>>>8&255]^r[255&d]^i[u++],m=s[l>>>24]^n[p>>>16&255]^o[d>>>8&255]^r[255&h]^i[u++],v=s[p>>>24]^n[d>>>16&255]^o[h>>>8&255]^r[255&l]^i[u++],y=s[d>>>24]^n[h>>>16&255]^o[l>>>8&255]^r[255&p]^i[u++],h=g,l=m,p=v,d=y;g=(a[h>>>24]<<24|a[l>>>16&255]<<16|a[p>>>8&255]<<8|a[255&d])^i[u++],m=(a[l>>>24]<<24|a[p>>>16&255]<<16|a[d>>>8&255]<<8|a[255&h])^i[u++],v=(a[p>>>24]<<24|a[d>>>16&255]<<16|a[h>>>8&255]<<8|a[255&l])^i[u++],y=(a[d>>>24]<<24|a[h>>>16&255]<<16|a[l>>>8&255]<<8|a[255&p])^i[u++];e[t]=g,e[t+1]=m,e[t+2]=v,e[t+3]=y},keySize:8});e.AES=t._createHelper(i)}(),s.AES)},function(e,t,i){var o;e.exports=(o=i(0),i(6),i(7),i(5),i(1),function(){var e=o,t=e.lib,s=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],p=[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}],u=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],n=t.DES=i.extend({_doReset:function(){for(var e=this._key.words,t=[],i=0;i<56;i++){var s=h[i]-1;t[i]=e[s>>>5]>>>31-s%32&1}for(var n=this._subKeys=[],o=0;o<16;o++){for(var r=n[o]=[],a=p[o],i=0;i<24;i++)r[i/6|0]|=t[(l[i]-1+a)%28]<<31-i%6,r[4+(i/6|0)]|=t[28+(l[i+24]-1+a)%28]<<31-i%6;r[0]=r[0]<<1|r[0]>>>31;for(i=1;i<7;i++)r[i]=r[i]>>>4*(i-1)+3;r[7]=r[7]<<5|r[7]>>>27}for(var c=this._invSubKeys=[],i=0;i<16;i++)c[i]=n[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 s=0;s<16;s++){for(var n=i[s],o=this._lBlock,r=this._rBlock,a=0,c=0;c<8;c++)a|=d[c][((r^n[c])&u[c])>>>0];this._lBlock=r,this._rBlock=o^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(n);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=n.createEncryptor(s.create(t)),this._des2=n.createEncryptor(s.create(i)),this._des3=n.createEncryptor(s.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)}(),o.TripleDES)},function(e,t,i){var o;e.exports=(o=i(0),i(6),i(7),i(5),i(1),function(){var e=o,t=e.lib.StreamCipher,i=e.algo,s=i.RC4=t.extend({_doReset:function(){for(var e=this._key,t=e.words,i=e.sigBytes,s=this._S=[],n=0;n<256;n++)s[n]=n;for(var n=0,o=0;n<256;n++){var r=n%i,r=t[r>>>2]>>>24-r%4*8&255,o=(o+s[n]+r)%256,r=s[n];s[n]=s[o],s[o]=r}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=n.call(this)},keySize:8,ivSize:0});function n(){for(var e=this._S,t=this._i,i=this._j,s=0,n=0;n<4;n++){var i=(i+e[t=(t+1)%256])%256,o=e[t];e[t]=e[i],e[i]=o,s|=e[(e[t]+e[i])%256]<<24-8*n}return this._i=t,this._j=i,s}e.RC4=t._createHelper(s);i=i.RC4Drop=s.extend({cfg:s.cfg.extend({drop:192}),_doReset:function(){s._doReset.call(this);for(var e=this.cfg.drop;0<e;e--)n.call(this)}});e.RC4Drop=t._createHelper(i)}(),o.RC4)},function(e,t,i){var s;e.exports=(s=i(0),i(6),i(7),i(5),i(1),function(){var e=s,t=e.lib.StreamCipher,i=e.algo,n=[],r=[],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 s=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]],i=this._b=0;i<4;i++)c.call(this);for(i=0;i<8;i++)n[i]^=s[i+4&7];if(t){var o=t.words,r=o[0],a=o[1],t=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),o=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),r=t>>>16|4294901760&o,a=o<<16|65535&t;n[0]^=t,n[1]^=r,n[2]^=o,n[3]^=a,n[4]^=t,n[5]^=r,n[6]^=o,n[7]^=a;for(i=0;i<4;i++)c.call(this)}},_doProcessBlock:function(e,t){var i=this._X;c.call(this),n[0]=i[0]^i[5]>>>16^i[3]<<16,n[1]=i[2]^i[7]>>>16^i[5]<<16,n[2]=i[4]^i[1]>>>16^i[7]<<16,n[3]=i[6]^i[3]>>>16^i[1]<<16;for(var s=0;s<4;s++)n[s]=16711935&(n[s]<<8|n[s]>>>24)|4278255360&(n[s]<<24|n[s]>>>8),e[t+s]^=n[s]},blockSize:4,ivSize:2});function c(){for(var e=this._X,t=this._C,i=0;i<8;i++)r[i]=t[i];t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<r[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<r[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<r[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<r[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<r[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<r[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<r[6]>>>0?1:0)|0,this._b=t[7]>>>0<r[7]>>>0?1:0;for(i=0;i<8;i++){var s=e[i]+t[i],n=65535&s,o=s>>>16;a[i]=((n*n>>>17)+n*o>>>15)+o*o^((4294901760&s)*s|0)+((65535&s)*s|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)}(),s.Rabbit)},function(e,t,i){var s;e.exports=(s=i(0),i(6),i(7),i(5),i(1),function(){var e=s,t=e.lib.StreamCipher,i=e.algo,n=[],r=[],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],s=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]],n=this._b=0;n<4;n++)c.call(this);for(n=0;n<8;n++)s[n]^=i[n+4&7];if(t){var o=t.words,r=o[0],e=o[1],t=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),o=16711935&(e<<8|e>>>24)|4278255360&(e<<24|e>>>8),r=t>>>16|4294901760&o,e=o<<16|65535&t;s[0]^=t,s[1]^=r,s[2]^=o,s[3]^=e,s[4]^=t,s[5]^=r,s[6]^=o,s[7]^=e;for(n=0;n<4;n++)c.call(this)}},_doProcessBlock:function(e,t){var i=this._X;c.call(this),n[0]=i[0]^i[5]>>>16^i[3]<<16,n[1]=i[2]^i[7]>>>16^i[5]<<16,n[2]=i[4]^i[1]>>>16^i[7]<<16,n[3]=i[6]^i[3]>>>16^i[1]<<16;for(var s=0;s<4;s++)n[s]=16711935&(n[s]<<8|n[s]>>>24)|4278255360&(n[s]<<24|n[s]>>>8),e[t+s]^=n[s]},blockSize:4,ivSize:2});function c(){for(var e=this._X,t=this._C,i=0;i<8;i++)r[i]=t[i];t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<r[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<r[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<r[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<r[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<r[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<r[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<r[6]>>>0?1:0)|0,this._b=t[7]>>>0<r[7]>>>0?1:0;for(i=0;i<8;i++){var s=e[i]+t[i],n=65535&s,o=s>>>16;a[i]=((n*n>>>17)+n*o>>>15)+o*o^((4294901760&s)*s|0)+((65535&s)*s|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)}(),s.RabbitLegacy)},function(e,t,i){"use strict";i.r(t);i(13),i(14),i(15),i(16),i(17);var n,s=i(2),l=i.n(s);class o{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 l.a.Tween(this.camera),this.tw_target=new l.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.Resources.BOX.getBoundingInfo();this.camera.lowerRadiusLimit=e.maximum.y-e.minimum.y;var t=e.boundingSphere.radiusWorld;this.camera.radius=t;t=e.boundingSphere.center.clone();this.camera.target=new BABYLON.Vector3(t.x,0,t.z),this.frustrum=.6*(e.maximum.x-e.minimum.x),this.computeCameraView()}perspective(){this.focusingFromProperty(this.app.project.current.visualAngle)}focusingFromProperty(e){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.isOverLook=!1,this.camera.lowerRadiusLimit=e.minimumLimit,this.camera.upperRadiusLimit=e.maximumLimit,this.camera.panningSensibility=1e3,this.camera.lowerBetaLimit=.01,this.camera.upperBetaLimit=Math.PI/2*.98,this.camera.lowerAlphaLimit=null,this.camera.upperAlphaLimit=null,this.camera.mode=BABYLON.Camera.PERSPECTIVE_CAMERA,(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)),this.camera.alpha=e.alpha,this.tw_target.to(e.focus,500).start().onComplete(()=>{this.tw_camera.to({radius:e.radius,beta:e.beta},500).start()}),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}flyTo(e,t=300){(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)),this.tw_target.to({x:e.focus.x,y:e.focus.y,z:e.focus.z},t).start().onComplete(()=>{this.tw_camera.to({radius:e.radius,beta:e.beta,alpha:e.alpha},t).start()}),this.camera.lowerRadiusLimit=e.minimumLimit,this.camera.upperRadiusLimit=e.maximumLimit,this.camera.lowerBetaLimit=e.minBeta,this.camera.upperBetaLimit=e.maxBeta}translation(e,t=300){this.tw_target.to({x:e.focus.x,y:e.focus.y,z:e.focus.z},t).start().onComplete(()=>{this.tw_camera.to({radius:e.radius},t).start()})}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 m{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 r{static getGUID(e){var t,i,s="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),n=[],o=s.length;if(e)for(t=0;t<e;t++)n[t]=s[0|Math.random()*o];else for(n[8]=n[13]=n[18]=n[23]="-",n[14]="4",t=0;t<36;t++)n[t]||(i=0|16*Math.random(),n[t]=s[19==t?3&i|8:i]);return n.join("")}}class a{constructor(e){this.objectType="Light",this.app=e}load(){}}class c extends a{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 h extends a{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()}}(s=n=n||{}).Point="Point",s.Spot="Spot",s.Directional="Directional",s.Hemispheric="Hemispheric";class p extends a{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 d extends a{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{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 s=t[0].getBoundingInfo(),n=s.minimum.add(t[0].position),o=s.maximum.add(t[0].position),r=1;r<t.length;r++)s=t[r].getBoundingInfo(),n=BABYLON.Vector3.Minimize(n,s.minimum.add(t[r].position)),o=BABYLON.Vector3.Maximize(o,s.maximum.add(t[r].position));i=new BABYLON.BoundingInfo(n,o)}return i}static computeBoundsToARR(e){for(var t=e[0].getBoundingInfo(),i=t.minimum.add(e[0].position),s=t.maximum.add(e[0].position),n=1;n<e.length;n++)t=e[n].getBoundingInfo(),i=BABYLON.Vector3.Minimize(i,t.minimum.add(e[n].position)),s=BABYLON.Vector3.Maximize(s,t.maximum.add(e[n].position));return new BABYLON.BoundingInfo(i,s)}static Expand(s,n){let o=new Array;var r=s.length;for(let i=0;i<r;i++){var a=s[i],c=s[0==i?r-1:i-1],h=s[i==r-1?0:i+1],l=c.x-a.x,p=c.z-a.z,d=this.norm(l,p);l/=d,p/=d;c=h.x-a.x,d=h.z-a.z,h=this.norm(c,d);c/=h,d/=h;h=-n/Math.sqrt((1-(l*c+p*d))/2);let e=l+c,t=p+d;h=0==this.norm(e,t)?0:h/this.norm(e,t);e*=h,t*=h,o[i]=new BABYLON.Vector3(e+a.x,0,t+a.z)}return o}static norm(e,t){return Math.sqrt(e*e+t*t)}static MergeMeshes(o,e){let r=new BABYLON.Mesh((new Date).getDate().toString(),e.scene);return setTimeout(()=>{let t=null,i;for(let e=0;e<o.length;e++){var s,n;o[e]&&(n=(s=o[e]).computeWorldMatrix(!0),i=BABYLON.VertexData.ExtractFromMesh(s,!0,!0),i.transform(n),t?t.merge(i,!0):t=i,s.dispose(!1,!0))}t.applyToMesh(r)}),r}static DeconsTructMesh(e,t,i){if(1<e.subMeshes.length){for(var s=BABYLON.VertexData.ExtractFromMesh(e,!0,!0),n=s.indices,o=s.normals,r=s.positions,a=s.uvs,c=new Array,h=0;h<e.subMeshes.length;h++){for(var l=new BABYLON.VertexData,p=n.slice(e.subMeshes[h].indexStart,e.subMeshes[h].indexStart+e.subMeshes[h].indexCount),d=o.slice(3*e.subMeshes[h].verticesStart,3*e.subMeshes[h].verticesStart+3*e.subMeshes[h].verticesCount),u=r.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<p.length;g++)p[g]=p[g]-e.subMeshes[h].verticesStart;l.indices=p,l.normals=d,l.positions=u,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 s=e.boundingSphere.radiusWorld,n=t.engine.getAspectRatio(t.camera.camera);let o=t.camera.camera.fov/1.2;return n<1&&(o=Math.atan(n*Math.tan(t.camera.camera.fov/2))),i.radius=1.1*Math.abs(s/Math.sin(o)),i.alpha=Math.PI/2,i.beta=Math.PI/4,i.focus=e.boundingSphere.center.clone(),i}static pathTransformation(i,s){let e=new BABYLON.Path3D(i);var n=e.getTangents();let o=[];for(let t=0;t<i.length;t++)if(0<t&&t<i.length-1){var r=i[t-1],a=i[t+1],c=i[t];let e=n[t-1];var h=n[t];if(!e.equals(h)){r=BABYLON.Vector3.Lerp(c,r,s/BABYLON.Vector3.Distance(r,c)),a=BABYLON.Vector3.Lerp(c,a,s/BABYLON.Vector3.Distance(a,c));let e=BABYLON.Curve3.CreateQuadraticBezier(r,c,a,10);o=o.concat(e.getPoints())}}else o.push(i[t]);return o}static createTube(e,t,i=.05,s){return BABYLON.MeshBuilder.CreateTube(e,{path:this.pathTransformation(t,i),radius:i/2},s.scene)}static getAngleFromVector2(e,t,i){var s=(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),s=Math.atan2(t,s);return Math.PI-s}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 f{constructor(e){this.lights=new m,this.reflexEnabled=!0,this.reflexIntensity=.5,this.app=e,this.color=new BABYLON.Color4(0,.0588,.1176,1),this.reflex(this.app.rootUrl+"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("BABYLON"),require("babylonjs-materials"),require("BABYLON.GUI"),require("BABYLON.SceneLoader"),require("babylonjs-serializers")):"function"==typeof define&&define.amd?define(["TWEEN","BABYLON","babylonjs-materials","BABYLON.GUI","BABYLON.SceneLoader","babylonjs-serializers"],t):"object"==typeof exports?exports.MX3D=t(require("TWEEN"),require("BABYLON"),require("babylonjs-materials"),require("BABYLON.GUI"),require("BABYLON.SceneLoader"),require("babylonjs-serializers")):e.MX3D=t(e.TWEEN,e.BABYLON,e["babylonjs-materials"],e["BABYLON.GUI"],e["BABYLON.SceneLoader"],e["babylonjs-serializers"])}(window,function(i,n,s,r,o,a){return c=[function(e,t){e.exports=i},function(e,t,i){"use strict";var n,s=i(5),r=Object.prototype.toString,o=(n=Object.create(null),function(e){e=r.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 h(e){return Array.isArray(e)}function c(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 b(e){return"[object Function]"===r.call(e)}var A=a("URLSearchParams");function y(e,t){if(null!=e)if(h(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 s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.call(null,e[s],s,e)}var B,i=(B="undefined"!=typeof Uint8Array&&Object.getPrototypeOf(Uint8Array),function(e){return B&&e instanceof B});e.exports={isArray:h,isArrayBuffer:l,isBuffer:function(e){return null!==e&&!c(e)&&null!==e.constructor&&!c(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||r.call(e)===t||b(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:c,isDate:d,isFile:f,isBlob:g,isFunction:b,isStream:function(e){return u(e)&&b(e.pipe)},isURLSearchParams:A,isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:y,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):h(e)?n[t]=e.slice():n[t]=e}for(var t=0,s=arguments.length;t<s;t++)y(arguments[t],e);return n},extend:function(i,e,n){return y(e,function(e,t){i[t]=n&&"function"==typeof e?s(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,s,r,o={};t=t||{};do{for(s=(n=Object.getOwnPropertyNames(e)).length;0<s--;)o[r=n[s]]||(t[r]=e[r],o[r]=!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(c(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){"use strict";var a=i(1);function h(e,t,i,n,s){Error.call(this),this.message=e,this.name="AxiosError",t&&(this.code=t),i&&(this.config=i),n&&(this.request=n),s&&(this.response=s)}a.inherits(h,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 c=h.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(h,n),Object.defineProperty(c,"isAxiosError",{value:!0}),h.from=function(e,t,i,n,s,r){var o=Object.create(c);return a.toFlatObject(e,o,function(e){return e!==Error.prototype}),h.call(o,e.message,t,i,n,s),o.name=e.name,r&&Object.assign(o,r),o},e.exports=h},function(e,t,i){"use strict";var n=i(2);function s(e){n.call(this,null==e?"canceled":e,n.ERR_CANCELED),this.name="CanceledError"}i(1).inherits(s,n,{__CANCEL__:!0}),e.exports=s},function(l,e,u){"use strict";!function(e){var o=u(1),a=u(26),n=u(2),t=u(7),h=u(8),i={"Content-Type":"application/x-www-form-urlencoded"};function c(e,t){!o.isUndefined(e)&&o.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var s,r={transitional:t,adapter:s="undefined"!=typeof XMLHttpRequest||void 0!==e&&"[object process]"===Object.prototype.toString.call(e)?u(9):s,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 c(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString();var i,n=o.isObject(e),s=t&&t["Content-Type"];if((i=o.isFileList(e))||n&&"multipart/form-data"===s){var r=this.env&&this.env.FormData;return h(i?{"files[]":e}:e,r&&new r)}return n||"application/json"===s?(c(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||r.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(39)},validateStatus:function(e){return 200<=e&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};o.forEach(["delete","get","head"],function(e){r.headers[e]={}}),o.forEach(["post","put","patch"],function(e){r.headers[e]=o.merge(i)}),l.exports=r}.call(this,u(25))},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 s=i(1);function r(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):s.isURLSearchParams(t)?t.toString():(n=[],s.forEach(t,function(e,t){null!=e&&(s.isArray(e)?t+="[]":e=[e],s.forEach(e,function(e){s.isDate(e)?e=e.toISOString():s.isObject(e)&&(e=JSON.stringify(e)),n.push(r(t)+"="+r(e))}))}),n.join("&"));return i&&(-1!==(t=e.indexOf("#"))&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i),e}},function(e,t,i){"use strict";e.exports={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1}},function(e,t,n){"use strict";!function(i){var h=n(1);e.exports=function(e,o){o=o||new FormData;var t=[];function a(e){return null===e?"":h.isDate(e)?e.toISOString():h.isArrayBuffer(e)||h.isTypedArray(e)?"function"==typeof Blob?new Blob([e]):i.from(e):e}return function s(e,r){if(h.isPlainObject(e)||h.isArray(e)){if(-1!==t.indexOf(e))throw Error("Circular reference detected in "+r);t.push(e),h.forEach(e,function(e,t){if(!h.isUndefined(e)){var i,n=r?r+"."+t:t;if(e&&!r&&"object"==typeof e)if(h.endsWith(t,"{}"))e=JSON.stringify(e);else if(h.endsWith(t,"[]")&&(i=h.toArray(e)))return void i.forEach(function(e){h.isUndefined(e)||o.append(n,a(e))});s(e,n)}}),t.pop()}else o.append(r,a(e))}(e),o}}.call(this,n(27).Buffer)},function(e,t,i){"use strict";var p=i(1),d=i(32),f=i(33),g=i(6),m=i(10),b=i(36),A=i(37),y=i(7),B=i(2),v=i(3),w=i(38);e.exports=function(u){return new Promise(function(t,i){var e,n=u.data,s=u.headers,r=u.responseType;function o(){u.cancelToken&&u.cancelToken.unsubscribe(e),u.signal&&u.signal.removeEventListener("abort",e)}p.isFormData(n)&&p.isStandardBrowserEnv()&&delete s["Content-Type"];var a=new XMLHttpRequest;u.auth&&(c=u.auth.username||"",h=u.auth.password?unescape(encodeURIComponent(u.auth.password)):"",s.Authorization="Basic "+btoa(c+":"+h));var h,c=m(u.baseURL,u.url);function l(){var e;a&&(e="getAllResponseHeaders"in a?b(a.getAllResponseHeaders()):null,e={data:r&&"text"!==r&&"json"!==r?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(c,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 B("Request aborted",B.ECONNABORTED,u,a)),a=null)},a.onerror=function(){i(new B("Network Error",B.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||y;u.timeoutErrorMessage&&(e=u.timeoutErrorMessage),i(new B(e,t.clarifyTimeoutError?B.ETIMEDOUT:B.ECONNABORTED,u,a)),a=null},!p.isStandardBrowserEnv()||(h=(u.withCredentials||A(c))&&u.xsrfCookieName?f.read(u.xsrfCookieName):void 0)&&(s[u.xsrfHeaderName]=h),"setRequestHeader"in a&&p.forEach(s,function(e,t){void 0===n&&"content-type"===t.toLowerCase()?delete s[t]:a.setRequestHeader(t,e)}),p.isUndefined(u.withCredentials)||(a.withCredentials=!!u.withCredentials),r&&"json"!==r&&(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 v: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,c=w(c);c&&-1===["http","https","file"].indexOf(c)?i(new B("Unsupported protocol "+c+":",B.ERR_BAD_REQUEST,u)):a.send(n)})}},function(e,t,i){"use strict";var n=i(34),s=i(35);e.exports=function(e,t){return e&&!n(t)?s(e,t):t}},function(e,t,i){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},function(e,t,i){"use strict";var c=i(1);e.exports=function(t,i){i=i||{};var n={};function s(e,t){return c.isPlainObject(e)&&c.isPlainObject(t)?c.merge(e,t):c.isPlainObject(t)?c.merge({},t):c.isArray(t)?t.slice():t}function r(e){return c.isUndefined(i[e])?c.isUndefined(t[e])?void 0:s(void 0,t[e]):s(t[e],i[e])}function e(e){if(!c.isUndefined(i[e]))return s(void 0,i[e])}function o(e){return c.isUndefined(i[e])?c.isUndefined(t[e])?void 0:s(void 0,t[e]):s(void 0,i[e])}function a(e){return e in i?s(t[e],i[e]):e in t?s(void 0,t[e]):void 0}var h={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 c.forEach(Object.keys(t).concat(Object.keys(i)),function(e){var t=h[e]||r,i=t(e);c.isUndefined(i)&&t!==a||(n[e]=i)}),n}},function(e,t){e.exports={version:"0.27.2"}},function(e,t,i){e.exports=i(20)},function(e,t){e.exports=n},function(e,t){e.exports=s},function(e,t){e.exports=r},function(e,t){e.exports=o},function(e,t){e.exports=a},function(e,t,i){"use strict";var s=i(1),r=i(5),o=i(21),a=i(12);var n=function t(i){var e=new o(i),n=r(o.prototype.request,e);return s.extend(n,o.prototype,e),s.extend(n,e),n.create=function(e){return t(a(i,e))},n}(i(4));n.Axios=o,n.CanceledError=i(3),n.CancelToken=i(41),n.isCancel=i(11),n.VERSION=i(13).version,n.toFormData=i(8),n.AxiosError=i(2),n.Cancel=n.CanceledError,n.all=function(e){return Promise.all(e)},n.spread=i(42),n.isAxiosError=i(43),e.exports=n,e.exports.default=n},function(e,t,i){"use strict";var n=i(1),s=i(6),r=i(22),l=i(23),u=i(12),o=i(10),p=i(40),d=p.validators;function a(e){this.defaults=e,this.interceptors={request:new r,response:new r}}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 s,r=[];if(this.interceptors.response.forEach(function(e){r.push(e.fulfilled,e.rejected)}),!n){var o=[l,void 0];for(Array.prototype.unshift.apply(o,i),o=o.concat(r),s=Promise.resolve(t);o.length;)s=s.then(o.shift(),o.shift());return s}for(var a=t;i.length;){var h=i.shift(),c=i.shift();try{a=h(a)}catch(e){c(e);break}}try{s=l(a)}catch(e){return Promise.reject(e)}for(;r.length;)s=s.then(r.shift(),r.shift());return s},a.prototype.getUri=function(e){e=u(this.defaults,e);var t=o(e.baseURL,e.url);return s(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(s){function e(n){return function(e,t,i){return this.request(u(i||{},{method:s,headers:n?{"Content-Type":"multipart/form-data"}:{},url:e,data:t}))}}a.prototype[s]=e(),a.prototype[s+"Form"]=e(!0)}),e.exports=a},function(e,t,i){"use strict";var n=i(1);function s(){this.handlers=[]}s.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},s.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},s.prototype.forEach=function(t){n.forEach(this.handlers,function(e){null!==e&&t(e)})},e.exports=s},function(e,t,i){"use strict";var n=i(1),s=i(24),r=i(11),o=i(4),a=i(3);function h(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new a}e.exports=function(t){return h(t),t.headers=t.headers||{},t.data=s.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 h(t),e.data=s.call(t,e.data,e.headers,t.transformResponse),e},function(e){return r(e)||(h(t),e&&e.response&&(e.response.data=s.call(t,e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)})}},function(e,t,i){"use strict";var s=i(1),r=i(4);e.exports=function(t,i,e){var n=this||r;return s.forEach(e,function(e){t=e.call(n,t,i)}),t}},function(e,t){var i,n,e=e.exports={};function s(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function o(t){if(i===setTimeout)return setTimeout(t,0);if((i===s||!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:s}catch(e){i=s}try{n="function"==typeof clearTimeout?clearTimeout:r}catch(e){n=r}}();var a,h=[],c=!1,l=-1;function u(){c&&a&&(c=!1,a.length?h=a.concat(h):l=-1,h.length&&p())}function p(){if(!c){var e=o(u);c=!0;for(var t=h.length;t;){for(a=h,h=[];++l<t;)a&&a[l].run();l=-1,t=h.length}a=null,c=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===r||!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];h.push(new d(e,t)),1!==h.length||c||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";var s=i(1);e.exports=function(i,n){s.forEach(i,function(e,t){t!==n&&t.toUpperCase()===n.toUpperCase()&&(i[n]=e,delete i[t])})}},function(e,P,S){"use strict";!function(e){var a=S(29),r=S(30),o=S(31);function i(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(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 c(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=s(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=s(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)?s(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 h(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 c(e,t){if(h(t),e=s(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=s(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 R(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return C(e).length;default:if(n)return R(e).length;t=(""+t).toLowerCase(),n=!0}}function t(e,t,i){var n,s,r,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 s="",r=t;r<i;++r)s+=function(e){return e<16?"0"+e.toString(16):e.toString(16)}(e[r]);return s}(this,t,i);case"utf8":case"utf-8":return y(this,t,i);case"ascii":return function(e,t,i){var n="";i=Math.min(e.length,i);for(var s=t;s<i;++s)n+=String.fromCharCode(127&e[s]);return n}(this,t,i);case"latin1":case"binary":return function(e,t,i){var n="";i=Math.min(e.length,i);for(var s=t;s<i;++s)n+=String.fromCharCode(e[s]);return n}(this,t,i);case"base64":return n=this,r=i,0===(s=t)&&r===n.length?a.fromByteArray(n):a.fromByteArray(n.slice(s,r));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(e,t,i){for(var n=e.slice(t,i),s="",r=0;r<n.length;r+=2)s+=String.fromCharCode(n[r]+256*n[r+1]);return s}(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,s){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)?s?0:e.length-1:i)<0?e.length+i:i)>=e.length){if(s)return-1;i=e.length-1}else if(i<0){if(!s)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,s);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?(s?Uint8Array.prototype.indexOf:Uint8Array.prototype.lastIndexOf).call(e,t,i):m(e,[t],i,n,s);throw new TypeError("val must be string, number or Buffer")}function m(e,t,i,n,s){var r=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/=r=2,a/=2,i/=2}function h(e,t){return 1===r?e[t]:e.readUInt16BE(t*r)}if(s)for(var c=-1,l=i;l<o;l++)if(h(e,l)===h(t,-1===c?0:l-c)){if(l-(c=-1===c?l:c)+1===a)return c*r}else-1!==c&&(l-=l-c),c=-1;else for(l=i=o<i+a?o-a:i;0<=l;l--){for(var u=!0,p=0;p<a;p++)if(h(e,l+p)!==h(t,p)){u=!1;break}if(u)return l}return-1}function b(e,t,i,n){return N(function(e){for(var t=[],i=0;i<e.length;++i)t.push(255&e.charCodeAt(i));return t}(t),e,i,n)}function A(e,t,i,n){return N(function(e,t){for(var i,n,s=[],r=0;r<e.length&&!((t-=2)<0);++r)n=e.charCodeAt(r),i=n>>8,n=n%256,s.push(n),s.push(i);return s}(t,e.length-i),e,i,n)}function y(e,t,i){i=Math.min(e.length,i);for(var n=[],s=t;s<i;){var r,o,a,h,c=e[s],l=null,u=239<c?4:223<c?3:191<c?2:1;if(s+u<=i)switch(u){case 1:c<128&&(l=c);break;case 2:128==(192&(r=e[s+1]))&&127<(h=(31&c)<<6|63&r)&&(l=h);break;case 3:r=e[s+1],o=e[s+2],128==(192&r)&&128==(192&o)&&2047<(h=(15&c)<<12|(63&r)<<6|63&o)&&(h<55296||57343<h)&&(l=h);break;case 4:r=e[s+1],o=e[s+2],a=e[s+3],128==(192&r)&&128==(192&o)&&128==(192&a)&&65535<(h=(15&c)<<18|(63&r)<<12|(63&o)<<6|63&a)&&h<1114112&&(l=h)}null===l?(l=65533,u=1):65535<l&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),s+=u}return function(e){var t=e.length;if(t<=B)return String.fromCharCode.apply(String,e);var i="",n=0;for(;n<t;)i+=String.fromCharCode.apply(String,e.slice(n,n+=B));return i}(n)}P.Buffer=u,P.SlowBuffer=function(e){+e!=e&&(e=0);return u.alloc(+e)},P.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}}(),P.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,h(e=e),!(e<=0)&&void 0!==t?"string"==typeof i?s(n,e).fill(t,i):s(n,e).fill(t):s(n,e);var n},u.allocUnsafe=function(e){return c(null,e)},u.allocUnsafeSlow=function(e){return c(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,s=0,r=Math.min(i,n);s<r;++s)if(e[s]!==t[s]){i=e[s],n=t[s];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(s=t=0;s<e.length;++s)t+=e[s].length;for(var i=u.allocUnsafe(t),n=0,s=0;s<e.length;++s){var r=e[s];if(!u.isBuffer(r))throw new TypeError('"list" argument must be an Array of Buffers');r.copy(i,n),n+=r.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?y(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=P.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,s){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===s&&(s=this.length),(t=void 0===t?0:t)<0||i>e.length||n<0||s>this.length)throw new RangeError("out of range index");if(s<=n&&i<=t)return 0;if(s<=n)return-1;if(i<=t)return 1;if(this===e)return 0;for(var r=(s>>>=0)-(n>>>=0),o=(i>>>=0)-(t>>>=0),a=Math.min(r,o),h=this.slice(n,s),c=e.slice(t,i),l=0;l<a;++l)if(h[l]!==c[l]){r=h[l],o=c[l];break}return r<o?-1:o<r?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 s=this.length-t;if((void 0===i||s<i)&&(i=s),0<e.length&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n=n||"utf8";for(var r,o,a,h=!1;;)switch(n){case"hex":return function(e,t,i,n){i=Number(i)||0;var s=e.length-i;if((!n||s<(n=Number(n)))&&(n=s),(s=t.length)%2!=0)throw new TypeError("Invalid hex string");s/2<n&&(n=s/2);for(var r=0;r<n;++r){var o=parseInt(t.substr(2*r,2),16);if(isNaN(o))return r;e[i+r]=o}return r}(this,e,t,i);case"utf8":case"utf-8":return o=t,a=i,N(R(e,(r=this).length-o),r,o,a);case"ascii":return b(this,e,t,i);case"latin1":case"binary":return b(this,e,t,i);case"base64":return r=this,o=t,a=i,N(C(e),r,o,a);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,e,t,i);default:if(h)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),h=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var B=4096;function v(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 w(e,t,i,n,s,r){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(s<t||t<r)throw new RangeError('"value" argument is out of bounds');if(i+n>e.length)throw new RangeError("Index out of range")}function x(e,t,i,n){t<0&&(t=65535+t+1);for(var s=0,r=Math.min(e.length-i,2);s<r;++s)e[i+s]=(t&255<<8*(n?s:1-s))>>>8*(n?s:1-s)}function E(e,t,i,n){t<0&&(t=4294967295+t+1);for(var s=0,r=Math.min(e.length-i,4);s<r;++s)e[i+s]=t>>>8*(n?s:3-s)&255}function M(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 T(e,t,i,n,s){return s||M(e,0,i,4),r.write(e,t,i,n,23,4),i+4}function O(e,t,i,n,s){return s||M(e,0,i,8),r.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)(s=this.subarray(e,t)).__proto__=u.prototype;else for(var n=t-e,s=new u(n,void 0),r=0;r<n;++r)s[r]=this[r+e];return s},u.prototype.readUIntLE=function(e,t,i){e|=0,t|=0,i||v(e,t,this.length);for(var n=this[e],s=1,r=0;++r<t&&(s*=256);)n+=this[e+r]*s;return n},u.prototype.readUIntBE=function(e,t,i){e|=0,t|=0,i||v(e,t,this.length);for(var n=this[e+--t],s=1;0<t&&(s*=256);)n+=this[e+--t]*s;return n},u.prototype.readUInt8=function(e,t){return t||v(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||v(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||v(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||v(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||v(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||v(e,t,this.length);for(var n=this[e],s=1,r=0;++r<t&&(s*=256);)n+=this[e+r]*s;return(s*=128)<=n&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,i){e|=0,t|=0,i||v(e,t,this.length);for(var n=t,s=1,r=this[e+--n];0<n&&(s*=256);)r+=this[e+--n]*s;return(s*=128)<=r&&(r-=Math.pow(2,8*t)),r},u.prototype.readInt8=function(e,t){return t||v(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||v(e,2,this.length);e=this[e]|this[e+1]<<8;return 32768&e?4294901760|e:e},u.prototype.readInt16BE=function(e,t){t||v(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||v(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||v(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||v(e,4,this.length),r.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||v(e,4,this.length),r.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||v(e,8,this.length),r.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||v(e,8,this.length),r.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,i,n){e=+e,t|=0,i|=0,n||w(this,e,t,i,Math.pow(2,8*i)-1,0);var s=1,r=0;for(this[t]=255&e;++r<i&&(s*=256);)this[t+r]=e/s&255;return t+i},u.prototype.writeUIntBE=function(e,t,i,n){e=+e,t|=0,i|=0,n||w(this,e,t,i,Math.pow(2,8*i)-1,0);var s=i-1,r=1;for(this[t+s]=255&e;0<=--s&&(r*=256);)this[t+s]=e/r&255;return t+i},u.prototype.writeUInt8=function(e,t,i){return e=+e,t|=0,i||w(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||w(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):x(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,i){return e=+e,t|=0,i||w(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):x(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,i){return e=+e,t|=0,i||w(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):E(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,i){return e=+e,t|=0,i||w(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):E(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,i,n){e=+e,t|=0,n||w(this,e,t,i,(n=Math.pow(2,8*i-1))-1,-n);var s=0,r=1,o=0;for(this[t]=255&e;++s<i&&(r*=256);)e<0&&0===o&&0!==this[t+s-1]&&(o=1),this[t+s]=(e/r>>0)-o&255;return t+i},u.prototype.writeIntBE=function(e,t,i,n){e=+e,t|=0,n||w(this,e,t,i,(n=Math.pow(2,8*i-1))-1,-n);var s=i-1,r=1,o=0;for(this[t+s]=255&e;0<=--s&&(r*=256);)e<0&&0===o&&0!==this[t+s+1]&&(o=1),this[t+s]=(e/r>>0)-o&255;return t+i},u.prototype.writeInt8=function(e,t,i){return e=+e,t|=0,i||w(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||w(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):x(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,i){return e=+e,t|=0,i||w(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):x(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,i){return e=+e,t|=0,i||w(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):E(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,i){return e=+e,t|=0,i||w(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):E(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,i){return T(this,e,t,!0,i)},u.prototype.writeFloatBE=function(e,t,i){return T(this,e,t,!1,i)},u.prototype.writeDoubleLE=function(e,t,i){return O(this,e,t,!0,i)},u.prototype.writeDoubleBE=function(e,t,i){return O(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 s,r=(n=e.length-t<n-i?e.length-t+i:n)-i;if(this===e&&i<t&&t<n)for(s=r-1;0<=s;--s)e[s+t]=this[s+i];else if(r<1e3||!u.TYPED_ARRAY_SUPPORT)for(s=0;s<r;++s)e[s+t]=this[s+i];else Uint8Array.prototype.set.call(e,this.subarray(i,i+r),t);return r},u.prototype.fill=function(e,t,i,n){if("string"==typeof e){var s;if("string"==typeof t?(n=t,t=0,i=this.length):"string"==typeof i&&(n=i,i=this.length),1!==e.length||(s=e.charCodeAt(0))<256&&(e=s),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 r=u.isBuffer(e)?e:R(new u(e,n).toString()),o=r.length,a=0;a<i-t;++a)this[a+t]=r[a%o];return this};var L=/[^+\/0-9A-Za-z-_]/g;function R(e,t){var i;t=t||1/0;for(var n=e.length,s=null,r=[],o=0;o<n;++o){if(55295<(i=e.charCodeAt(o))&&i<57344){if(!s){if(56319<i){-1<(t-=3)&&r.push(239,191,189);continue}if(o+1===n){-1<(t-=3)&&r.push(239,191,189);continue}s=i;continue}if(i<56320){-1<(t-=3)&&r.push(239,191,189),s=i;continue}i=65536+(s-55296<<10|i-56320)}else s&&-1<(t-=3)&&r.push(239,191,189);if(s=null,i<128){if(--t<0)break;r.push(i)}else if(i<2048){if((t-=2)<0)break;r.push(i>>6|192,63&i|128)}else if(i<65536){if((t-=3)<0)break;r.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;r.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return r}function C(e){return a.toByteArray(function(e){var t;if((e=((t=e).trim?t.trim():t.replace(/^\s+|\s+$/g,"")).replace(L,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function N(e,t,i,n){for(var s=0;s<n&&!(s+i>=t.length||s>=e.length);++s)t[s+i]=e[s];return s}}.call(this,S(28))},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){"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),s=n[0],n=n[1],r=new c(function(e,t){return 3*(e+t)/4-t}(s,n)),o=0,a=0<n?s-4:s;for(i=0;i<a;i+=4)t=h[e.charCodeAt(i)]<<18|h[e.charCodeAt(i+1)]<<12|h[e.charCodeAt(i+2)]<<6|h[e.charCodeAt(i+3)],r[o++]=t>>16&255,r[o++]=t>>8&255,r[o++]=255&t;2===n&&(t=h[e.charCodeAt(i)]<<2|h[e.charCodeAt(i+1)]>>4,r[o++]=255&t);1===n&&(t=h[e.charCodeAt(i)]<<10|h[e.charCodeAt(i+1)]<<4|h[e.charCodeAt(i+2)]>>2,r[o++]=t>>8&255,r[o++]=255&t);return r},t.fromByteArray=function(e){for(var t,i=e.length,n=i%3,s=[],r=0,o=i-n;r<o;r+=16383)s.push(function(e,t,i){for(var n,s=[],r=t;r<i;r+=3)n=(e[r]<<16&16711680)+(e[r+1]<<8&65280)+(255&e[r+2]),s.push(function(e){return a[e>>18&63]+a[e>>12&63]+a[e>>6&63]+a[63&e]}(n));return s.join("")}(e,r,o<r+16383?o:r+16383));1==n?(t=e[i-1],s.push(a[t>>2]+a[t<<4&63]+"==")):2==n&&(t=(e[i-2]<<8)+e[i-1],s.push(a[t>>10]+a[t>>4&63]+a[t<<2&63]+"="));return s.join("")};for(var a=[],h=[],c="undefined"!=typeof Uint8Array?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,r=n.length;s<r;++s)a[s]=n[s],h[n.charCodeAt(s)]=s;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]}h["-".charCodeAt(0)]=62,h["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,i,n,s){var r,o,a=8*s-n-1,h=(1<<a)-1,c=h>>1,l=-7,u=i?s-1:0,p=i?-1:1,i=e[t+u];for(u+=p,r=i&(1<<-l)-1,i>>=-l,l+=a;0<l;r=256*r+e[t+u],u+=p,l-=8);for(o=r&(1<<-l)-1,r>>=-l,l+=n;0<l;o=256*o+e[t+u],u+=p,l-=8);if(0===r)r=1-c;else{if(r===h)return o?NaN:1/0*(i?-1:1);o+=Math.pow(2,n),r-=c}return(i?-1:1)*o*Math.pow(2,r-n)},t.write=function(e,t,i,n,s,r){var o,a,h=8*r-s-1,c=(1<<h)-1,l=c>>1,u=23===s?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:r-1,d=n?1:-1,r=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=c):(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),c<=o+l?(a=0,o=c):1<=o+l?(a=(t*n-1)*Math.pow(2,s),o+=l):(a=t*Math.pow(2,l-1)*Math.pow(2,s),o=0));8<=s;e[i+p]=255&a,p+=d,a/=256,s-=8);for(o=o<<s|a,h+=s;0<h;e[i+p]=255&o,p+=d,o/=256,h-=8);e[i+p-d]|=128*r}},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 s=i(2);e.exports=function(e,t,i){var n=i.config.validateStatus;i.status&&n&&!n(i.status)?t(new s("Request failed with status code "+i.status,[s.ERR_BAD_REQUEST,s.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(1);e.exports=a.isStandardBrowserEnv()?{write:function(e,t,i,n,s,r){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(s)&&o.push("domain="+s),!0===r&&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 s=i(1),r=["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&&s.forEach(e.split("\n"),function(e){i=e.indexOf(":"),t=s.trim(e.substr(0,i)).toLowerCase(),i=s.trim(e.substr(i+1)),t&&(n[t]&&0<=r.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,s,r,o=i(1);function a(e){return s&&(r.setAttribute("href",e),e=r.href),r.setAttribute("href",e),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}e.exports=o.isStandardBrowserEnv()?(s=/(msie|trident)/i.test(navigator.userAgent),r=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(13).version,h=i(2),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,s,i){function r(e,t){return"[Axios v"+o+"] Transitional option '"+e+"'"+t+(i?". "+i:"")}return function(e,t,i){if(!1===n)throw new h(r(t," has been removed"+(s?" in "+s:"")),h.ERR_DEPRECATED);return s&&!a[t]&&(a[t]=!0,console.warn(r(t," has been deprecated since v"+s+" 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 h("options must be an object",h.ERR_BAD_OPTION_VALUE);for(var n=Object.keys(e),s=n.length;0<s--;){var r=n[s],o=t[r];if(o){var a=e[r],a=void 0===a||o(a,r,e);if(!0!==a)throw new h("option "+r+" must be "+a,h.ERR_BAD_OPTION_VALUE)}else if(!0!==i)throw new h("Unknown option "+r,h.ERR_BAD_OPTION)}},validators:n}},function(e,t,i){"use strict";var s=i(3);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 s(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(1);e.exports=function(e){return n.isObject(e)&&!0===e.isAxiosError}},function(e,t,i){"use strict";i.r(t),i.d(t,"default",function(){return _});i(15),i(16),i(17),i(18),i(19);var s,t=i(0),p=i.n(t);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 p.a.Tween(this.camera),this.tw_target=new p.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.Resources.BOX.getBoundingInfo();this.camera.lowerRadiusLimit=e.maximum.y-e.minimum.y;var t=e.boundingSphere.radiusWorld;this.camera.radius=t;t=e.boundingSphere.center.clone();this.camera.target=new BABYLON.Vector3(t.x,0,t.z),this.frustrum=.6*(e.maximum.x-e.minimum.x),this.computeCameraView()}perspective(){this._perspective(this.app.Project.current.Sight)}_perspective(e){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.isOverLook=!1,this.camera.lowerRadiusLimit=e.minimumLimit,this.camera.upperRadiusLimit=e.maximumLimit,this.camera.panningSensibility=1e3,this.camera.lowerBetaLimit=.01,this.camera.upperBetaLimit=Math.PI/2*.98,this.camera.lowerAlphaLimit=null,this.camera.upperAlphaLimit=null,this.camera.mode=BABYLON.Camera.PERSPECTIVE_CAMERA,(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)),this.camera.alpha=e.alpha,this.tw_target.to(e.focus,500).start().onComplete(()=>{this.tw_camera.to({radius:e.radius,beta:e.beta},500).start()}),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}flyTo(e,t=300){(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)),this.tw_target.to({x:e.focus.x,y:e.focus.y,z:e.focus.z},t).start().onComplete(()=>{this.tw_camera.to({radius:e.radius,beta:e.beta,alpha:e.alpha},t).start()}),this.camera.lowerRadiusLimit=e.minimumLimit,this.camera.upperRadiusLimit=e.maximumLimit,this.camera.lowerBetaLimit=e.minBeta,this.camera.upperBetaLimit=e.maxBeta}translation(e,t=300){this.tw_target.to({x:e.focus.x,y:e.focus.y,z:e.focus.z},t).start().onComplete(()=>{this.tw_camera.to({radius:e.radius},t).start()})}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 r{static getGUID(e){var t,i,n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),s=[],r=n.length;if(e)for(t=0;t<e;t++)s[t]=n[0|Math.random()*r];else for(s[8]=s[13]=s[18]=s[23]="-",s[14]="4",t=0;t<36;t++)s[t]||(i=0|16*Math.random(),s[t]=n[19==t?3&i|8:i]);return s.join("")}}class o{constructor(e){this.objectType="Light",this.app=e}load(){}}class a extends o{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 h extends o{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=s=s||{}).Point="Point",t.Spot="Spot",t.Directional="Directional",t.Hemispheric="Hemispheric";var g;class c extends o{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 o{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{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(),s=n.minimum.add(t[0].position),r=n.maximum.add(t[0].position),o=1;o<t.length;o++)n=t[o].getBoundingInfo(),s=BABYLON.Vector3.Minimize(s,n.minimum.add(t[o].position)),r=BABYLON.Vector3.Maximize(r,n.maximum.add(t[o].position));i=new BABYLON.BoundingInfo(s,r)}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),s=1;s<e.length;s++)t=e[s].getBoundingInfo(),i=BABYLON.Vector3.Minimize(i,t.minimum.add(e[s].position)),n=BABYLON.Vector3.Maximize(n,t.maximum.add(e[s].position));return new BABYLON.BoundingInfo(i,n)}static Expand(n,s){let r=new Array;var o=n.length;for(let i=0;i<o;i++){var a=n[i],h=n[0==i?o-1:i-1],c=n[i==o-1?0:i+1],l=h.x-a.x,u=h.z-a.z,p=this.norm(l,u);l/=p,u/=p;h=c.x-a.x,p=c.z-a.z,c=this.norm(h,p);h/=c,p/=c;c=-s/Math.sqrt((1-(l*h+u*p))/2);let e=l+h,t=u+p;c=0==this.norm(e,t)?0:c/this.norm(e,t);e*=c,t*=c,r[i]=new BABYLON.Vector3(e+a.x,0,t+a.z)}return r}static norm(e,t){return Math.sqrt(e*e+t*t)}static MergeMeshes(r,e){let o=new BABYLON.Mesh((new Date).getDate().toString(),e.scene);return setTimeout(()=>{let t=null,i;for(let e=0;e<r.length;e++){var n,s;r[e]&&(s=(n=r[e]).computeWorldMatrix(!0),i=BABYLON.VertexData.ExtractFromMesh(n,!0,!0),i.transform(s),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),s=n.indices,r=n.normals,o=n.positions,a=n.uvs,h=new Array,c=0;c<e.subMeshes.length;c++){for(var l=new BABYLON.VertexData,u=s.slice(e.subMeshes[c].indexStart,e.subMeshes[c].indexStart+e.subMeshes[c].indexCount),p=r.slice(3*e.subMeshes[c].verticesStart,3*e.subMeshes[c].verticesStart+3*e.subMeshes[c].verticesCount),d=o.slice(3*e.subMeshes[c].verticesStart,3*e.subMeshes[c].verticesStart+3*e.subMeshes[c].verticesCount),f=a.slice(2*e.subMeshes[c].verticesStart,2*e.subMeshes[c].verticesStart+2*e.subMeshes[c].verticesCount),g=0;g<u.length;g++)u[g]=u[g]-e.subMeshes[c].verticesStart;l.indices=u,l.normals=p,l.positions=d,l.uvs=f;f=new BABYLON.Mesh(e.id+"-"+c,i.scene);l.applyToMesh(f),f.position.y=parseFloat(t),f.setEnabled(!1),h.push(f)}return e.dispose(!1,!0),h}return[e]}static getVisualAngle(e,t){let i={};var n=e.boundingSphere.radiusWorld,s=t.engine.getAspectRatio(t.Camera.camera);let r=t.Camera.camera.fov/1.2;return s<1&&(r=Math.atan(s*Math.tan(t.Camera.camera.fov/2))),i.radius=1.1*Math.abs(n/Math.sin(r)),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 s=e.getTangents();let r=[];for(let t=0;t<i.length;t++)if(0<t&&t<i.length-1){var o=i[t-1],a=i[t+1],h=i[t];let e=s[t-1];var c=s[t];if(!e.equals(c)){o=BABYLON.Vector3.Lerp(h,o,n/BABYLON.Vector3.Distance(o,h)),a=BABYLON.Vector3.Lerp(h,a,n/BABYLON.Vector3.Distance(a,h));let e=BABYLON.Curve3.CreateQuadraticBezier(o,h,a,10);r=r.concat(e.getPoints())}}else r.push(i[t]);return r}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 u{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(_.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 h(this.app);e.id=r.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 h(this.app);t.id=r.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 s=i[t];let e;s.lightType==n.Hemispheric?(e=new h(this.app),e.id=s.id,e.lightType=s.lightType,e.name=s.name,e.direction=u.ToVector3(s.direction),e.color=s.color,e.intensity=s.intensity):s.lightType==n.Directional?(e=new c(this.app),e.id=s.id,e.lightType=s.lightType,e.name=s.name,e.direction=u.ToVector3(s.direction),e.position=u.ToVector3(s.position),e.color=s.color,e.intensity=s.intensity):s.lightType==n.Spot?(e=new d(this.app),e.id=s.id,e.lightType=s.lightType,e.name=s.name,e.direction=u.ToVector3(s.direction),e.position=u.ToVector3(s.position),e.angle=s.angle,e.exponent=s.exponent,e.range=s.range,e.color=s.color,e.intensity=s.intensity):s.lightType==n.Point&&(e=new p(this.app),e.id=s.id,e.lightType=s.lightType,e.name=s.name,e.position=u.ToVector3(s.position),e.range=s.range,e.color=s.color,e.intensity=s.intensity),e&&this.lights.add(e.id,e)}this.lights.count()<1&&this.defaultLights(),this.openAllLight()}}var v,g,y,s=i(4),b=i.n(s);class B{static de(e){return b.a.AES.decrypt(b.a.enc.Base64.stringify(b.a.enc.Hex.parse(e.substring(48,e.length))),b.a.enc.Utf8.parse(e.substring(0,32)),{iv:b.a.enc.Utf8.parse(e.substring(32,48)),mode:b.a.mode.CBC,padding:b.a.pad.Pkcs7}).toString(b.a.enc.Utf8).toString()}}class A{constructor(){this.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()};let e=new l.a.Tween(this.colors[1]).to({r:1,g:0,b:0},500),t=new l.a.Tween(this.colors[1]).to({r:1,g:.5,b:.5},500);t.chain(e),e.chain(t),e.start();let i=new l.a.Tween(this.colors[2]).to({r:1,g:.55,b:0},500),s=new l.a.Tween(this.colors[2]).to({r:0,g:0,b:0},500);i.chain(s),s.chain(i),i.start();let n=new l.a.Tween(this.colors[3]).to({r:1,g:.84,b:0},500),o=new l.a.Tween(this.colors[3]).to({r:0,g:0,b:0},500);n.chain(o),o.chain(n),n.start();let r=new l.a.Tween(this.colors[4]).to({r:0,g:.75,b:1},500),a=new l.a.Tween(this.colors[4]).to({r:0,g:0,b:0},500);r.chain(a),a.chain(r),r.start();let c=new l.a.Tween(this.colors[5]).to({r:.53,g:.8,b:0},500),h=new l.a.Tween(this.colors[5]).to({r:0,g:0,b:0},500);c.chain(h),h.chain(c),c.start()}}(s=v=v||{}).Campus="Campus",s.Building="Building",s.Scene="Scene",s.Humiture="Humiture",s.Battery="Battery",s.PowerCabinet="PowerCabinet",s.Cabinet="Cabinet",s.AirCondition="AirCondition",s.UPS="UPS",s.Camera="Camera",s.NewWindMachine="NewWindMachine",s.SmokeDetector="SmokeDetector",s.AudibleVisualAlarm="AudibleVisualAlarm",s.LeakWater="LeakWater",s.Wall="Wall",s.Floor="Floor",s.Window="Window",s.Door="Door",s.AirFlow="AirFlow",s.Corner="Corner",s.FireFighting="FireFighting",s.Lighting="Lighting",s.Enclosure="Enclosure",s.ParkingLot="ParkingLot",s.Elevator="Elevator",s.Other="Other",s.InrackAsset="InrackAsset",s.GasDetection="GasDetection",s.Security="Security",s.OutDoorScene="OutDoorScene",s.Infrared="Infrared",s.SkyBox="SkyBox",s.UI3D="UI3D",s.ColdTongDoor="ColdTongDoor",s.VirtualBox="VirtualBox",s.PathPint="PathPint",s.Port="Port",s.Positioner="Positioner",s.AutoAnimation="AutoAnimation",s.MapModel="MapModel",s.radiator="radiator",s.Conduit="Conduit",s.ParkModel="ParkModel",s.Storey="Storey",s.optimizedWall="optimizedWall";class w{setVisual(e){e=JSON.parse(e);this.alpha=e.alpha,this.beta=e.beta,this.radius=e.radius,this.focus=H.Tools.ToVector3(e.focus)}setLimit(e,t){this.minimumLimit=e+.3,this.maximumLimit=t}setBeta(e,t){this.minBeta=e,this.maxBeta=t}}class x{constructor(e){this.objectDatas=new m,this.app=e}delete(){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.computeView(),this.app.scene.freezeActiveMeshes()}computeView(){this.visualAngle=new w;var e=this.getBounding(),e=H.Tools.getVisualAngle(e,this.app);this.visualAngle.alpha=e.alpha,this.visualAngle.beta=e.beta,this.visualAngle.focus=e.focus,this.visualAngle.radius=e.radius}getChildNodes(e){let t=new Array;for(const s in this.objectDatas.map){var i=this.app.project.objectDatas.find(s);i.parentId==e&&i.objectType!=v.Wall&&i.objectType!=v.Corner&&t.push(i)}return t}getTrees(){const n=(e,t)=>{for(const s in this.objectDatas.map){var i=this.app.project.objectDatas.find(s);i.isMonitor&&i.parentId==e&&(t.push({label:i.name,id:i.id,type:i.objectType,children:[]}),n(i.id,t[t.length-1].children))}};var e={label:this.root.name,id:this.root.id,type:this.root.objectType,children:[]};return n(this.root.id,e.children),e}find(e){return this.objectDatas.find(e)}findFormObjectType(e,t=!0){let i=new Array;for(const n in this.objectDatas.map){var s=this.app.project.objectDatas.find(n);t&&s.parentId!=this.current.id||s.objectType!=e||i.push(s)}return i}show(){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.scene.blockfreeActiveMeshesAndRenderingGroups=!1}getBounding(){var i,s;for(const e in this.app.project.objectDatas.map){let t=this.app.project.objectDatas.find(e);if(t.objectType!=v.ParkModel&&t.objectType!=v.Storey){let e=t.instance.getBoundingInfo();i&&s||(i=s=e.boundingBox.center.clone()),i=BABYLON.Vector3.Minimize(i,e.minimum.add(t.instance.position)),s=BABYLON.Vector3.Maximize(s,e.maximum.add(t.instance.position))}}return i&&s||(i=BABYLON.Vector3.Zero(),s=new BABYLON.Vector3(12,0,8)),new BABYLON.BoundingInfo(i,s)}flyTo(){this.app.camera.flyTo(this.visualAngle,500)}}class M{constructor(e){this.resourcePath="http://models.wodashijie.com/",this.walls=new m,this.resources=new m,this.ndoeMats=new m,this.Materials=new m,this.Textures=new m,this.MergeMaterials=new m,this.app=e;e=r.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(this.app.rootUrl+"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=r.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(this.app.rootUrl+"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(this.resourcePath+"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))}),t.objectType==v.OutDoorScene||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(this.resourcePath+"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 s;return void 0===i&&(s=this.GetTexture(e,t),i=new BABYLON.StandardMaterial(e.modelId,t),i.alphaMode=BABYLON.Engine.ALPHA_COMBINE,i.diffuseTexture=s,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(this.resourcePath+"texture/"+e.modelId+e.extension,t,!1),".png"==e.extension&&(i.hasAlpha=!0),this.Textures.add(e.modelId,i)),i}GetMergeMaterial(t,i){let s=this.MergeMaterials.find(t.modelId);if(void 0===s){s=new BABYLON.CustomMaterial(t.modelId,i),s.alphaMode=2,this.MergeMaterials.add(t.modelId,s),s.AddUniform("textureData","sampler2D",null),s.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 h(this.app);e.id=r.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 h(this.app);t.id=r.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==s.Hemispheric?(e=new h(this.app),e.id=n.id,e.lightType=n.lightType,e.name=n.name,e.direction=m.ToVector3(n.direction),e.color=n.color,e.intensity=n.intensity):n.lightType==s.Directional?(e=new a(this.app),e.id=n.id,e.lightType=n.lightType,e.name=n.name,e.direction=m.ToVector3(n.direction),e.position=m.ToVector3(n.position),e.color=n.color,e.intensity=n.intensity):n.lightType==s.Spot?(e=new l(this.app),e.id=n.id,e.lightType=n.lightType,e.name=n.name,e.direction=m.ToVector3(n.direction),e.position=m.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==s.Point&&(e=new c(this.app),e.id=n.id,e.lightType=n.lightType,e.name=n.name,e.position=m.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()}}(t=g=g||{}).Campus="Campus",t.Building="Building",t.Scene="Scene",t.Humiture="Humiture",t.Battery="Battery",t.PowerCabinet="PowerCabinet",t.Cabinet="Cabinet",t.AirCondition="AirCondition",t.UPS="UPS",t.Camera="Camera",t.NewWindMachine="NewWindMachine",t.SmokeDetector="SmokeDetector",t.AudibleVisualAlarm="AudibleVisualAlarm",t.LeakWater="LeakWater",t.Wall="Wall",t.Floor="Floor",t.Window="Window",t.Door="Door",t.AirFlow="AirFlow",t.Corner="Corner",t.FireFighting="FireFighting",t.Lighting="Lighting",t.Enclosure="Enclosure",t.ParkingLot="ParkingLot",t.Elevator="Elevator",t.Other="Other",t.InrackAsset="InrackAsset",t.GasDetection="GasDetection",t.Security="Security",t.OutDoorScene="OutDoorScene",t.Infrared="Infrared",t.SkyBox="SkyBox",t.UI3D="UI3D",t.ColdTongDoor="ColdTongDoor",t.VirtualBox="VirtualBox",t.PathPint="PathPint",t.Port="Port",t.Positioner="Positioner",t.AutoAnimation="AutoAnimation",t.MapModel="MapModel",t.radiator="radiator",t.Conduit="Conduit",t.Region="Region",t.optimizedWall="optimizedWall";class d{setVisual(e){e=JSON.parse(e);this.alpha=e.alpha,this.beta=e.beta,this.radius=e.radius,this.focus=_.Tools.ToVector3(e.focus)}setLimit(e,t){this.minimumLimit=e+.3,this.maximumLimit=t}setBeta(e,t){this.minBeta=e,this.maxBeta=t}}class b{constructor(e){this.objectDatas=new f,this.app=e}delete(){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.computeView(),this.app.scene.freezeActiveMeshes()}computeView(){this.visualAngle=new d;var e=this.getBounding(),e=m.getVisualAngle(e,this.app);this.visualAngle.alpha=e.alpha,this.visualAngle.beta=e.beta,this.visualAngle.focus=e.focus,this.visualAngle.radius=e.radius}getChildNodes(e){let t=new Array;for(const n in this.objectDatas.map){var i=this.objectDatas.find(n);i.parentId==e&&i.objectType!=g.Wall&&i.objectType!=g.Corner&&t.push(i)}return t}getTrees(){const s=(e,t)=>{for(const n in this.objectDatas.map){var i=this.objectDatas.find(n);i.parentId==e&&(t.push({label:i.name,id:i.id,type:i.objectType,children:[]}),s(i.id,t[t.length-1].children))}};var e={label:this.root.name,id:this.root.id,type:this.root.objectType,children:[]};return s(this.root.id,e.children),e}find(e){return this.objectDatas.find(e)}findFormObjectType(e,t=!0){let i=new Array;for(const s in this.objectDatas.map){var n=this.objectDatas.find(s);t&&n.parentId!=this.current.id||n.objectType!=e||i.push(n)}return i}show(){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;for(const t in this.objectDatas.map){let e=this.objectDatas.find(t);e.setEnabled(!0)}this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}getBounding(){var i,n;for(const e in this.objectDatas.map){let t=this.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,0,8)),new BABYLON.BoundingInfo(i,n)}flyTo(){this.app.Camera.flyTo(this.visualAngle,500)}}class A{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=r.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(_.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=r.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(_.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(_.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))}),t.objectType==g.OutDoorScene||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(_.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(_.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(`
|
|
9
9
|
varying vec3 localPos ;
|
|
10
|
-
varying vec3 localNrm ;`),
|
|
10
|
+
varying vec3 localNrm ;`),n.Vertex_Before_PositionUpdated(`
|
|
11
11
|
localPos = position.xyz;
|
|
12
12
|
localNrm = normal;
|
|
13
|
-
`);let e=this.GetTexture(t,i);".png"==t.extension&&(e.hasAlpha=!0,
|
|
13
|
+
`);let e=this.GetTexture(t,i);".png"==t.extension&&(e.hasAlpha=!0,n.alpha=.9),t.length=3.1,console.log(t.width),n.onBindObservable.add(()=>n.getEffect().setTexture("textureData",e)),n.Fragment_Custom_Diffuse(`
|
|
14
14
|
vec3 newUV = vec3(abs(localPos.x)/`+t.width+",abs(localPos.y)/"+t.length+",abs(localPos.z)/"+t.width+`);
|
|
15
15
|
if(abs(localNrm.z)>abs(localNrm.x)){
|
|
16
16
|
vec4 res = texture2D(textureData,newUV.xy);
|
|
@@ -22,4 +22,4 @@
|
|
|
22
22
|
diffuseColor = res.rgb;
|
|
23
23
|
alpha = res.a;
|
|
24
24
|
}
|
|
25
|
-
`),s.freeze()}return s}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 s=i.meshes[0].getChildMeshes();for(let e=0;e<s.length;e++)this.walls.add(s[e].id,s[e])}}}(s=g=g||{}).leftClick="leftClick",s.rightClick="rightClick",s.doubleClick="doubleClick",s.eover="eover",s.longPress="longPress",s.out="out",(s=y=y||{})[s.Opaque=0]="Opaque",s[s.Flash=1]="Flash",s[s.Transparent=2]="Transparent";class T{constructor(e){this.isVisible=!0,this.executes=new m,this.clickEvents=new m,this.touchtime=(new Date).getTime(),this.effectType=y.Opaque,this._isMonitor=!0,this.app=e}set isMonitor(e){this._isMonitor=e}get isMonitor(){return this._isMonitor}setEnabled(e){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.setEnabled(e),this.isEnabled=e,this.isEnabled?(this.instance.isPickable=0<this.executes.count(),this.executes.find(g.eover)||this.executes.find(g.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.parentId=e.parentId,this.modelId=e.baseModel.modelId,this.animation=e.animation,this.isAutoPlay=e.isAutoPlay,this.isloop=e.isloop,this.isMonitor=e.isMonitor,null!=e.isVisible&&(this.isVisible=e.isVisible),this.objectType=e.objectType;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=H.Tools.ToVector3(e.rotation),t.position=H.Tools.ToVector3(e.position),t.scaling=H.Tools.ToVector3(e.scaling);e=H.Tools.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(),this.isAutoPlay&&this.play()}computeView(){this.visualAngle=new w;var e=this.instance.getBoundingInfo(),t=H.Tools.getVisualAngle(e,this.app);this.visualAngle.alpha=t.alpha,this.visualAngle.beta=t.beta,this.visualAngle.focus=this.instance.getAbsolutePosition(),this.visualAngle.radius=e.boundingSphere.radiusWorld+3,this.visualAngle.minimumLimit=.3,this.visualAngle.maximumLimit=2*this.visualAngle.radius,this.visualAngle.minBeta=.01,this.visualAngle.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 s;e==g.leftClick||e==g.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(g.leftClick);t&&0==e.sourceEvent.button&&t(this,e);let i=this.clickEvents.find(g.rightClick);i&&2==e.sourceEvent.button&&i(this,e),this.touchtime=(new Date).getTime()}),e="click"):e==g.doubleClick?i=new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnDoublePickTrigger,e=>t(this,e)):e==g.eover?(i=new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPointerOverTrigger,e=>t(this,e)),this.instance.enablePointerMoveEvents=!0):e==g.longPress?i=new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnLongPressTrigger,e=>t(this,e)):e==g.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),(s=this.executes.find(e))&&this.action.unregisterAction(s),this.executes.remove(e),this.executes.add(e,i),this.action.registerAction(i)),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}removeEventListener(e){if(e==g.leftClick||e==g.rightClick||e==g.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=H.EffectMgr.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.setEnabled(this.isEnabled),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}flyTo(){this.app.camera.translation(this.visualAngle,500)}focus(){}}class _ extends T{constructor(){super(...arguments),this.baseModel=null}bind(e){this.id=r.getGUID(12),this.objectType="Wall",this.name="墙体",this.isMonitor=!1,this.instance=H.Tools.MergeMeshes(e.walls,this.app),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 k extends T{bind(e){this.id=e.id,this.name=e.name,this.parentId=e.parentId,this.modelId=e.baseModel.modelId,this.height=e.baseModel.height,this.isMonitor=e.isMonitor,this.objectType=e.objectType,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=>{(this.app.highQualityMode?e.clone(this.id):e.createInstance(this.id)).parent=this.instance});var i=H.Tools.computeBounds(this.instance);this.instance.rotation=H.Tools.ToVector3(e.rotation),this.instance.position=H.Tools.ToVector3(e.position),this.visualAngle=H.Tools.getVisualAngle(i,this.app);let s=this.app.Resources.BOX.createInstance(this.id);s.setBoundingInfo(i),s.enablePointerMoveEvents=!1,s.isPickable=!1,s.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),s.position=this.instance.position.clone(),s.position.y=(i.maximum.y-i.minimum.y)/2+this.instance.position.y,s.rotation=this.instance.rotation.clone(),this.instance.getChildMeshes().forEach(e=>e.setParent(s)),this.instance.dispose(),this.instance=s,this.alwaysActive(),this.optimization(!0),this.instance.setEnabled(!1),this.computeView()}}class O extends T{bind(e){this.id=e.id,this.name=e.name,this.parentId=e.parentId,this.modelId=e.baseModel.modelId,this.height=e.baseModel.height,this.isMonitor=e.isMonitor,this.objectType=e.objectType,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=>{(this.app.highQualityMode?e.clone(this.id):e.createInstance(this.id)).parent=this.instance});var i=H.Tools.computeBounds(this.instance);this.instance.rotation=H.Tools.ToVector3(e.rotation),this.instance.position=H.Tools.ToVector3(e.position);let s=this.app.Resources.BOX.createInstance(this.id);s.setBoundingInfo(i),s.enablePointerMoveEvents=!1,s.isPickable=!1,s.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),s.position=this.instance.position.clone(),s.position.y=(i.maximum.y-i.minimum.y)/2+this.instance.position.y,s.rotation=this.instance.rotation.clone(),this.instance.getChildMeshes().forEach(e=>e.setParent(s)),this.instance.dispose(),this.instance=s,this.alwaysActive(),this.optimization(!0),this.instance.setEnabled(!1),this.computeView()}}class L extends T{}class C extends T{bind(e){this.visualAngle=new w;let t=H.Tools.ToARRVector3(e.lines);this.visualAngle.focus=t[0].clone(),this.instance=H.Tools.createTube(e.id,t,.02,this.app),this.instance.setEnabled(!1),this.id=e.id,this.name=e.name,this.parentId=e.parentId,this.modelId=e.baseModel.modelId,this.objectType=e.objectType,this.isMonitor=e.isMonitor;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.optimization(!0),this.computeView()}computeView(){var e=this.instance.getBoundingInfo(),t=H.Tools.getVisualAngle(e,this.app);this.visualAngle.alpha=t.alpha,this.visualAngle.beta=t.beta,this.visualAngle.radius=e.boundingSphere.radiusWorld+3,this.visualAngle.minimumLimit=.3,this.visualAngle.maximumLimit=2*this.visualAngle.radius,this.visualAngle.minBeta=.01,this.visualAngle.maxBeta=Math.PI/2*.98}addEventListener(e,t){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;let i=null;var s;e==g.leftClick||e==g.rightClick||e==g.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(g.leftClick);t&&0==e.sourceEvent.button&&t(this,e);let i=this.clickEvents.find(g.rightClick);i&&2==e.sourceEvent.button&&i(this,e);let s=this.clickEvents.find(g.doubleClick);s&&0==e.sourceEvent.button&&(new Date).getTime()-this.touchtime<500&&s(this,e),this.touchtime=(new Date).getTime()}),e="click"):e==g.eover?(i=new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPointerOverTrigger,e=>t(this,e)),this.instance.enablePointerMoveEvents=!0):e==g.longPress?i=new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnLongPressTrigger,e=>t(this,e)):e==g.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),(s=this.executes.find(e))&&this.action.unregisterAction(s),this.executes.remove(e),this.executes.add(e,i),this.action.registerAction(i)),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}removeEventListener(e){if(e==g.leftClick||e==g.rightClick||e==g.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 E extends T{async bind(t){if(this.id=t.id,this.name=t.name,this.parentId=t.parentId,this.isMonitor=t.isMonitor,this.objectType=t.objectType,this.isVisible=t.isVisible,t.virtualType&&t.isVisible){"Cylinder"==t.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 e=new BABYLON.StandardMaterial(this.id,this.app.scene);e.diffuseColor=BABYLON.Color3.FromHexString(t.color),t.alpha<.98&&(e.alpha=t.alpha,e.alphaMode=2,e.useAlphaFromDiffuseTexture=!0),this.instance.material=e,t.isEdges&&(this.instance.enableEdgesRendering(),this.instance.edgesWidth=1,this.instance.edgesColor=new BABYLON.Color4(0,1,1,1)),t.edgesWidth&&0<t.edgesWidth&&(this.instance.enableEdgesRendering(),this.instance.edgesWidth=t.edgesWidth,this.instance.edgesColor=BABYLON.Color3.FromHexString(t.edgesColor).toColor4(1))}else this.instance=BABYLON.Mesh.CreateBox(this.id,1,this.app.scene),this.instance.setEnabled(!1),this.instance.id=this.id;this.instance.enablePointerMoveEvents=this.isMonitor,this.instance.isPickable=this.isMonitor,this.instance.rotation=H.Tools.ToVector3(t.rotation),this.instance.position=H.Tools.ToVector3(t.position),this.instance.scaling=H.Tools.ToVector3(t.scaling),this.alwaysActive(),this.optimization(!0),this.computeView()}}class j extends T{bind(e){this.id=e.id,this.name=e.name,this.parentId=e.parentId,this.objectType=e.objectType,this.isMonitor=e.isMonitor;let t={};t.color=e.color,e.size?(t.clearColor=null,t.position=H.Tools.ToVector3(e.position),n=H.Tools.ToVector3(e.rotation),t.rotation=new BABYLON.Vector3(n.x+Math.PI,n.y,n.z),i=Number.parseInt(e.size.replace("px",""))/40,n=e.scaling?H.Tools.ToVector3(e.scaling):BABYLON.Vector3.One(),t.scaling=new BABYLON.Vector3(14*i/50*n.x,1,14*i/50*n.z)):(t.clearColor=e.clearColor,t.position=H.Tools.ToVector3(e.position),t.rotation=H.Tools.ToVector3(e.rotation),t.scaling=H.Tools.ToVector3(e.scaling));var i="bold 100px Arial";let s=new BABYLON.DynamicTexture(this.id,64,this.app.scene,!1);var n=s.getContext();n.font=i;e=n.measureText(this.name).width+8,n=.02*e;s=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=s,t.clearColor||(s.hasAlpha=!0),s.drawText(this.name,null,null,i,t.color,t.clearColor,!1),this.instance=BABYLON.Mesh.CreateGround(this.id,n,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 S extends T{bind(e){this.id=e.id,this.name=e.name,this.parentId=e.parentId,this.isMonitor=e.isMonitor,this.objectType=e.objectType,this.isVisible=!0,this.color=e.color;var t=u.ToARRVector3(e.pints);this.instance=u.createTube(e.id,t,e.radius,this.app);let i=new BABYLON.StandardMaterial(e.id,this.app.scene);i.diffuseColor=BABYLON.Color3.FromHexString(e.color),i.alpha=e.alpha,this.alpha=e.alpha,this.instance.material=i,this.instance.enablePointerMoveEvents=this.isMonitor,this.instance.isPickable=this.isMonitor,this.instance.setEnabled(!1),this.alwaysActive(),this.optimization(!0),this.computeView()}computeView(){this.visualAngle=new w;var e=this.instance.getBoundingInfo(),e=H.Tools.getVisualAngle(e,this.app);this.alpha=e.alpha,this.visualAngle.beta=e.beta,this.visualAngle.focus=e.focus,this.visualAngle.radius=e.radius,this.visualAngle.minimumLimit=.3,this.visualAngle.maximumLimit=2*this.visualAngle.radius,this.visualAngle.minBeta=.01,this.visualAngle.maxBeta=Math.PI/2*.98}setFlash(e=1){this.effectType==y.Opaque&&(this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.optimization(!1),this.instance.material.emissiveColor=H.EffectMgr.colors[e],this.app.Glow.addIncludedOnlyMesh(this.instance),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,this.effectType=y.Flash)}setOpaque(){this.effectType!=y.Opaque&&(this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.app.Glow.removeIncludedOnlyMesh(this.instance),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.app.Glow.removeIncludedOnlyMesh(this.instance),this.optimization(!1),this.instance.material.alpha=e,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,this.effectType=y.Transparent)}}class I extends T{bind(e){this.id=e.id,this.name=e.name,this.parentId=e.parentId,this.modelId=e.baseModel.modelId,this.objectType=e.objectType,this.isMonitor=!0,this.instance=BABYLON.MeshBuilder.CreatePolygon("地板",{shape:u.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,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.visualAngle=u.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 T{bind(e){this.id=e.id,this.parentId=e.parentId,this.objectType="Wall",this.isMonitor=!1,this.instance=this.app.Resources.walls.find(e.id),this.instance&&(this.app.scene.addMesh(this.instance),this.app.Resources.walls.remove(e.id),e.baseModel?(this.modelId=e.baseModel.modelId,this.nativeMaterial=this.app.Resources.GetMergeMaterial(e.baseModel,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.alwaysActive(),this.optimization(!0),this.instance.setEnabled(!1),this.computeView())}}class z extends T{bind(i){let e=!1;this.id=r.getGUID(12),this.name="墙角",this.isMonitor=!1,this.objectType="Corner";let s=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,s.push(e)}return s.length<1||(1<s.length?this.instance=u.MergeMeshes(s,this.app):this.instance=s[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 T{focus(){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;let i=new Array;for(const t in this.app.project.objectDatas.map){let e=this.app.project.objectDatas.find(t);e.parentId==this.id&&i.push(e),e.setEnabled(!1)}for(const e in this.app.project.objectDatas.map){let t=this.app.project.objectDatas.find(e);t.objectType!=v.Wall&&t.objectType!=v.Corner&&t.objectType!=v.Floor&&t.objectType!=v.Window&&t.objectType!=v.Door||i.forEach(e=>{t.parentId==e.id&&t.setEnabled(!0)})}this.isEnabled=!0,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}restVisualAngle(){this.visualAngle=u.getVisualAngle(this.instance.getBoundingInfo(),this.app)}}class D extends T{bind(e){this.id=e.id,this.name=e.name,this.parentId=e.parentId,this.modelId=e.baseModel.modelId,this.animation=!0,this.isAutoPlay=!0,this.isloop=!0,this.isVisible=!1,this.isMonitor=e.isMonitor,null!=e.isVisible&&(this.isVisible=e.isVisible),this.objectType=e.objectType;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=H.Tools.ToVector3(e.rotation),t.position=H.Tools.ToVector3(e.position),t.scaling=H.Tools.ToVector3(e.scaling);e=H.Tools.computeBounds(t);t.setBoundingInfo(e),this.instance=t,this.alwaysActive(),this.optimization(!0),this.instance.setEnabled(!1),this.computeView(),this.isAutoPlay&&this.play()}computeView(){this.visualAngle=new w;var e=this.instance.getBoundingInfo(),t=H.Tools.getVisualAngle(e,this.app);this.visualAngle.alpha=t.alpha,this.visualAngle.beta=t.beta,this.visualAngle.focus=this.instance.getAbsolutePosition(),this.visualAngle.radius=e.boundingSphere.radiusWorld+3,this.visualAngle.minimumLimit=.3,this.visualAngle.maximumLimit=2*this.visualAngle.radius,this.visualAngle.minBeta=.01,this.visualAngle.maxBeta=Math.PI/2*.98}setFlash(e){}setTransparent(e){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.setEnabled(!1),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}setOpaque(){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.setEnabled(!0),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}play(){}stop(){}}class Y extends T{constructor(e,t){super(e),this.height=0,this.id=t.id,this.objectType=t.objectType,this.name=t.name,this.parentId=t.parentId,this.height=t.height,this.objectType==v.ParkModel&&(this.height=0),this.index=t.index}bind(n,e=0){let t=!1;for(let e=0;e<n.length;e++){var i=n[e];if(i.objectType==v.optimizedWall){t=!0;let e=new N(this.app);e.bind(i),e.instance&&this.app.project.objectDatas.add(e.id,e)}}let r=new Array;for(let t=0;t<n.length;t++){let e=n[t];e.objectType==v.Wall&&(e.height||(e.height=3.1),e.ply||(e.ply=.09),r.push(e))}let o=new m;for(let e=0;e<n.length;e++){let i=n[e];i.objectType==v.Corner&&(o.add(i.id,i.corner),2<i.pints.length&&(i.height=3.1,i.walls.forEach(t=>{r.forEach(e=>{t==e.id&&parseFloat(e.height)<i.height&&(i.height=parseFloat(e.height))})})))}if(!t){let t=new Array;for(let e=0;e<n.length;e++){var s=n[e];s.objectType==v.Corner&&t.push(s)}let e=new z(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<n.length;i++){let s=n[i];if(s.objectType==v.Floor){s.vectors=new Array;let e=n[i];e.pints.forEach(e=>{o.find(e)||console.log(e),s.vectors.push(o.find(e))}),s.buckles=new Array,e.holes&&e.holes.forEach(e=>{let t=new Array;e.forEach(e=>t.push(o.find(e))),s.buckles.push(t)}),e.middles&&e.middles.forEach(t=>{let i=Array();for(let e=0;e<n.length;e++)n[e].id==t&&n[e].pints.forEach(e=>{e=o.find(e);i.push(new BABYLON.Vector3(e.x,0,e.z))});s.buckles.push(i)});let t=new I(this.app);t.height=this.height,t.bind(s),this.app.project.objectDatas.add(t.id,t)}}o=null;for(let t=0;t<n.length;t++){var a=n[t];let e;if(a.objectType==v.Window)e=new k(this.app);else if(a.objectType==v.Door)e=new O(this.app);else if(a.objectType==v.Cabinet)e=new L(this.app);else if(a.objectType==v.LeakWater)e=new C(this.app);else if(a.objectType==v.VirtualBox)e=new E(this.app);else if(a.objectType==v.UI3D)e=new j(this.app);else if(a.objectType==v.Conduit)e=new S(this.app);else if(a.objectType==v.Building)e=new P(this.app);else{if(a.objectType==v.Wall||a.objectType==v.optimizedWall)continue;if(a.objectType==v.Corner)continue;if(a.objectType==v.Floor)continue;e=new(a.objectType==v.AirFlow?D:T)(this.app)}e.bind(a),this.app.project.objectDatas.add(e.id,e)}if(!t){let o=new m;o.add("body",{t:"",walls:new Array});for(let n=0;n<r.length;n++){let s=BABYLON.MeshBuilder.ExtrudePolygon(r[n].id,{shape:[H.Tools.ToVector3(r[n].wtop),H.Tools.ToVector3(r[n].wleft),H.Tools.ToVector3(r[n].wbottom),H.Tools.ToVector3(r[n].wright)],depth:parseFloat(r[n].height),sideOrientation:BABYLON.Mesh.FRONTSIDE},this.app.scene);s.setEnabled(!1),s.position.y=parseFloat(r[n].height),s.subMeshes=[];var c=s.getTotalVertices();s.subMeshes.push(new BABYLON.SubMesh(0,0,c,0,6,s)),s.subMeshes.push(new BABYLON.SubMesh(0,1,c,18,6,s)),s.subMeshes.push(new BABYLON.SubMesh(0,2,c,30,6,s));for(let i=0;i<r[n].wallwindows.length;i++){const d=BABYLON.CSG.FromMesh(s);let e=this.app.project.objectDatas.find(r[n].wallwindows[i]);var h=e.instance.getBoundingInfo(),l=BABYLON.MeshBuilder.CreateBox((new Date).getTime().toString(),{height:h.maximum.y-h.minimum.y,width:h.maximum.x-h.minimum.x,depth:2*parseFloat(r[n].ply)+.1},this.app.scene);l.position=e.instance.position.clone(),l.position.y=(h.maximum.y-h.minimum.y)/2+e.height,l.rotation=e.instance.rotation.clone();h=BABYLON.CSG.FromMesh(l);let t=d.subtract(h);l.dispose(),s.dispose(),s=t.toMesh(r[n].id,null,this.app.scene,!0),s.setEnabled(!1)}let t=o.find(r[n].leftMap.modelId);t||(t={t:r[n].leftMap,walls:new Array},o.add(r[n].leftMap.modelId,t));let i=o.find(r[n].rightMap.modelId);i||(i={t:r[n].rightMap,walls:new Array},o.add(r[n].rightMap.modelId,i));var p=H.Tools.DeconsTructMesh(s,parseFloat(r[n].height),this.app);for(let e=0;e<p.length;e++)(2==e||3==e?t:4==e||5==e?i:o.find("body")).walls.push(p[e])}for(const u in o.map)if(0<o.find(u).walls.length){let e=new _(this.app);e.parentId=this.id,e.height=this.height,e.bind(o.find(u)),this.app.project.objectDatas.add(e.id,e)}}r=null,this.computeView()}computeView(){this.visualAngle=new w;var e=this.getBounding(),e=H.Tools.getVisualAngle(e,this.app);this.visualAngle.alpha=e.alpha,this.visualAngle.beta=e.beta,this.visualAngle.focus=e.focus,this.visualAngle.radius=e.radius,this.visualAngle.focus.y=this.height}flyTo(){this.app.camera.flyTo(this.visualAngle,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.parentId==this.id?e.setEnabled(e.isVisible):e.setEnabled(!1)}this.isEnabled=!0,(this.app.project.current=this).app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}setEnabled(e){}getBounding(){var i,s;for(const e in this.app.project.objectDatas.map){let t=this.app.project.objectDatas.find(e);if(t.objectType!=v.ParkModel&&t.objectType!=v.Storey&&t.parentId==this.id){let e=t.instance.getBoundingInfo();i&&s||(i=s=e.boundingBox.center.clone()),i=BABYLON.Vector3.Minimize(i,e.minimum.add(t.instance.position)),s=BABYLON.Vector3.Maximize(s,e.maximum.add(t.instance.position))}}return i&&s||(i=BABYLON.Vector3.Zero(),s=new BABYLON.Vector3(12,this.height,8)),new BABYLON.BoundingInfo(i,s)}dispose(){}}class R extends T{constructor(e,t){super(e),this.height=0,this.id=t.id,this.objectType=t.objectType,this.name=t.name,this.parentId=t.parentId,this.height=t.height,this.objectType==v.ParkModel&&(this.height=0),this.index=t.index}bind(n,i=!1){let o=new Array;for(let t=0;t<n.length;t++){let e=n[t];e.objectType==v.Wall&&(e.height||(e.height=3.1),e.ply||(e.ply=.09),o.push(e))}let r=new m;for(let e=0;e<n.length;e++){let i=n[e];i.objectType==v.Corner&&(r.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<n.length;e++){var s=n[e];s.objectType==v.Corner&&t.push(s)}let e=new z(this.app);if(e.height=this.height,e.bind(t)?(e.parentId=this.id,this.app.project.objectDatas.add(e.id,e)):e=null,!i)for(let i=0;i<n.length;i++){let s=n[i];if(s.objectType==v.Floor){s.vectors=new Array;let e=n[i];e.pints.forEach(e=>{r.find(e)||console.log(e),s.vectors.push(r.find(e))}),s.buckles=new Array,e.holes&&e.holes.forEach(e=>{let t=new Array;e.forEach(e=>t.push(r.find(e))),s.buckles.push(t)}),e.middles&&e.middles.forEach(t=>{let i=Array();for(let e=0;e<n.length;e++)n[e].id==t&&n[e].pints.forEach(e=>{e=r.find(e);i.push(new BABYLON.Vector3(e.x,0,e.z))});s.buckles.push(i)});let t=new I(this.app);t.height=this.height,t.bind(s),this.app.project.objectDatas.add(t.id,t)}}r=null;for(let t=0;t<n.length;t++){var a=n[t];let e;if(a.objectType==v.Window)e=new k(this.app);else if(a.objectType==v.Door)e=new O(this.app);else if(a.objectType!=v.Cabinet||i)if(a.objectType!=v.LeakWater||i)if(a.objectType!=v.VirtualBox||i)if(a.objectType!=v.UI3D||i)if(a.objectType!=v.Conduit||i)if(a.objectType!=v.Building||i){if(a.objectType==v.Wall)continue;if(a.objectType==v.Corner)continue;if(a.objectType==v.Floor)continue;if(i)continue;e=new T(this.app)}else e=new P(this.app);else e=new S(this.app);else e=new j(this.app);else e=new E(this.app);else e=new C(this.app);else e=new L(this.app);e.bind(a),this.app.project.objectDatas.add(e.id,e)}let c=new m;c.add("body",{t:"",walls:new Array});for(let n=0;n<o.length;n++){let s=BABYLON.MeshBuilder.ExtrudePolygon(o[n].id,{shape:[H.Tools.ToVector3(o[n].wtop),H.Tools.ToVector3(o[n].wleft),H.Tools.ToVector3(o[n].wbottom),H.Tools.ToVector3(o[n].wright)],depth:parseFloat(o[n].height),sideOrientation:BABYLON.Mesh.FRONTSIDE},this.app.scene);s.setEnabled(!1),s.position.y=parseFloat(o[n].height),s.subMeshes=[];var h=s.getTotalVertices();s.subMeshes.push(new BABYLON.SubMesh(0,0,h,0,6,s)),s.subMeshes.push(new BABYLON.SubMesh(0,1,h,18,6,s)),s.subMeshes.push(new BABYLON.SubMesh(0,2,h,30,6,s));for(let i=0;i<o[n].wallwindows.length;i++){const u=BABYLON.CSG.FromMesh(s);let e=this.app.project.objectDatas.find(o[n].wallwindows[i]);var l=e.instance.getBoundingInfo(),p=BABYLON.MeshBuilder.CreateBox((new Date).getTime().toString(),{height:l.maximum.y-l.minimum.y,width:l.maximum.x-l.minimum.x,depth:2*parseFloat(o[n].ply)+.1},this.app.scene);p.position=e.instance.position.clone(),p.position.y=(l.maximum.y-l.minimum.y)/2+e.height,p.rotation=e.instance.rotation.clone();l=BABYLON.CSG.FromMesh(p);let t=u.subtract(l);p.dispose(),s.dispose(),s=t.toMesh(o[n].id,null,this.app.scene,!0),s.setEnabled(!1)}let t=c.find(o[n].leftMap.modelId);t||(t={t:o[n].leftMap,walls:new Array},c.add(o[n].leftMap.modelId,t));let i=c.find(o[n].rightMap.modelId);i||(i={t:o[n].rightMap,walls:new Array},c.add(o[n].rightMap.modelId,i));var d=H.Tools.DeconsTructMesh(s,parseFloat(o[n].height),this.app);for(let e=0;e<d.length;e++)(2==e||3==e?t:4==e||5==e?i:c.find("body")).walls.push(d[e])}for(const f in c.map)if(0<c.find(f).walls.length){let e=new _(this.app);e.parentId=this.id,e.height=this.height,e.bind(c.find(f)),this.app.project.objectDatas.add(e.id,e)}o=null,this.restVisualAngle()}focus(){this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0;for(const t in this.app.project.objectDatas.map){let e=this.app.project.objectDatas.find(t);e.parentId==this.id?e.setEnabled(!0):e.setEnabled(!1)}this.isEnabled=!0,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1}setEnabled(e){}restVisualAngle(){var i,s;for(const e in this.app.project.objectDatas.map){let t=this.app.project.objectDatas.find(e);if(t.objectType!=v.ParkModel&&t.objectType!=v.Storey&&t.parentId==this.id){let e=t.instance.getBoundingInfo();i&&s||(i=s=e.boundingBox.center.clone()),i=BABYLON.Vector3.Minimize(i,e.minimum.add(t.instance.position)),s=BABYLON.Vector3.Maximize(s,e.maximum.add(t.instance.position))}}i&&s||(i=BABYLON.Vector3.Zero(),s=new BABYLON.Vector3(12,this.height,8)),this.visualAngle=u.getVisualAngle(new BABYLON.BoundingInfo(i,s),this.app),this.visualAngle.focus.y=this.height}}var V=i(3);class F{constructor(e,t){this.isOK=!1,this.app=t,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;",e.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"}}var i={App:class{constructor(e,t){this.index=0,this.highQualityMode=!1;e=V.SceneLoader.create(e);this.canvas=e.canvas,this.engine=e.engine,this.scene=e.scene,this.rootUrl=t||"http://models.wodashijie.com/",this.Resources=new M(this),this.camera=new o(this),this.highlightLayer=new BABYLON.HighlightLayer("highlightLayer",this.scene),this.container=BABYLON.GUI.AdvancedDynamicTexture.CreateFullscreenUI("screenUI"),this.Environment=new f(this),this.project=new x(this),H.EffectMgr=new A,this.engine.runRenderLoop(()=>{this.fps&&(this.fps.innerText=this.engine.getFps().toFixed()+" fps"),this.scene.render(),l.a.update()}),window.addEventListener("resize",()=>{this.engine.resize()}),this.scene.onPointerObservable.add(e=>{switch(e.type){case BABYLON.PointerEventTypes.POINTERMOVE:if(!this.tipsTool)return;e.pickInfo&&e.pickInfo.pickedPoint?this.tipsTool.update(e):this.tipsTool.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)}}),this.scene.onKeyboardObservable.add(e=>{e.type===BABYLON.KeyboardEventTypes.KEYDOWN&&70===e.event.keyCode&&prompt("请复制输入框内的视角参数",JSON.stringify({alpha:this.camera.camera.alpha,focus:u.vector3ToJson(this.camera.camera.target),radius:this.camera.camera.radius,beta:this.camera.camera.beta}))})}create(f){return this.highQualityMode=f.highQualityMode,this.highQualityMode&&(this.Glow=new BABYLON.GlowLayer("glow",this.scene),this.Glow.addIncludedOnlyMesh(this.Resources.BOX)),f.libraryUrl&&(this.Resources.resourcePath=f.libraryUrl),new Promise(async(n,t)=>{try{var o=await class{static read(s,n){return new Promise(function(e,t){let i=new XMLHttpRequest;i.open(s,n),i.onload=function(){200<=this.status&&this.status<300?e(i.response):t({status:this.status,statusText:i.statusText})},i.onerror=function(){t({status:this.status,statusText:i.statusText})},i.send()})}}.read("GET",f.fileUrl),r=JSON.parse(B.de(o));this.project.id=r.id,this.Environment.color="#7A7A7A"==r.environmentSettings.backColor?new BABYLON.Color4(0,.0588,.1176,1):new BABYLON.Color4(...BABYLON.Color3.FromHexString(r.environmentSettings.backColor).asArray(),1),this.Environment.fogDistance=r.environmentSettings.fogDensity,this.Environment.setFlexIntensity(r.environmentSettings.reflexIntensity),this.Environment.setReflexEnabled(r.environmentSettings.reflexEnabled),this.Environment.loadLight(r.environmentSettings.lights),this.scene.blockfreeActiveMeshesAndRenderingGroups=!0,r.isOptimized&&await this.Resources.GetWalls(f.fileUrl.replace(r.id+".json",""),r.id);let t=new m;for(let e=0;e<r.scenes.length;e++){const p=r.scenes[e];!p.baseModel||".gltf"!=p.baseModel.extension||t.find(p.baseModel.modelId)||this.Resources.resources.find(p.baseModel.modelId)||(p.baseModel.objectType=p.objectType,t.add(p.baseModel.modelId,p.baseModel))}let e=0;for(const d in t.map)await this.Resources.loadModelMesh(t.find(d)),e++,f.progress&&f.progress(e/t.count()*.8);e=0,t=null;let i=new m,s=new m;for(let e=0;e<r.scenes.length;e++){var a,c=r.scenes[e];c.objectType==v.Storey||c.objectType==v.ParkModel?(a=new Y(this,c),this.project.objectDatas.add(a.id,a),i.add(a.id,a),s.add(a.id,new Array),c.objectType==v.ParkModel&&(this.project.root=a)):c.objectType==v.Floor&&i.add(c.id,c)}for(let e=0;e<r.scenes.length;e++){var h,l=r.scenes[e];l.objectType!=v.Storey&&l.objectType!=v.ParkModel&&((h=i.find(l.parentId)).objectType==v.Floor?s.find(h.parentId):s.find(l.parentId)).push(l)}for(const u in s.map)await this.project.objectDatas.find(u).bind(s.find(u)),e++,f.progress&&f.progress(.8+e/r.scenes.length*.2);i=null,s=null,this.project.optimization(),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1,n(null),this.engine.resize(),f.complete&&f.complete()}catch(e){t(e)}})}optimized(g){return g.libraryUrl&&(this.Resources.resourcePath=g.libraryUrl),new Promise(async(o,t)=>{try{let i=JSON.parse(B.de(g.file));this.project.id=i.id,this.Environment.color="#7A7A7A"==i.environmentSettings.backColor?new BABYLON.Color4(0,.0588,.1176,1):new BABYLON.Color4(...BABYLON.Color3.FromHexString(i.environmentSettings.backColor).asArray(),1),this.Environment.fogDistance=i.environmentSettings.fogDensity,this.Environment.setFlexIntensity(i.environmentSettings.reflexIntensity),this.Environment.setReflexEnabled(i.environmentSettings.reflexEnabled),this.Environment.loadLight(i.environmentSettings.lights),this.scene.blockfreeActiveMeshesAndRenderingGroups=!0;let t=new m;for(let e=0;e<i.scenes.length;e++){const p=i.scenes[e];g._isOptimized&&"Window"!=p.objectType&&"Door"!=p.objectType||!p.baseModel||".gltf"!=p.baseModel.extension||t.find(p.baseModel.modelId)||this.Resources.resources.find(p.baseModel.modelId)||(p.baseModel.objectType=p.objectType,t.add(p.baseModel.modelId,p.baseModel))}let e=0;for(const d in t.map)await this.Resources.loadModelMesh(t.find(d)),e++,g.progress&&g.progress(e/t.count()*.8);e=0,t=null;let s=new m,n=new m;for(let e=0;e<i.scenes.length;e++){var r,a=i.scenes[e];a.objectType==v.Storey||a.objectType==v.ParkModel?(r=new R(this,a),this.project.objectDatas.add(r.id,r),s.add(r.id,r),n.add(r.id,new Array),a.objectType==v.ParkModel&&(this.project.root=r)):a.objectType==v.Floor&&s.add(a.id,a)}for(let e=0;e<i.scenes.length;e++){var c,h=i.scenes[e];h.objectType!=v.Storey&&h.objectType!=v.ParkModel&&((c=s.find(h.parentId)).objectType==v.Floor?n.find(c.parentId):n.find(h.parentId)).push(h)}for(const u in n.map)await this.project.objectDatas.find(u).bind(n.find(u),g._isOptimized),e++,g.progress&&g.progress(.8+e/i.scenes.length*.2);if(s=null,n=null,this.project.optimization(),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1,g._isOptimized){let t=[];for(const f in this.project.objectDatas.map){var l=this.project.objectDatas.find(f);l.objectType!=v.Wall&&l.objectType!=v.Corner||t.push({id:l.id,parentId:l.parentId,objectType:"optimizedWall",baseModel:l.baseModel})}for(let e=0;e<i.scenes.length;e++)i.scenes[e].objectType!=v.Wall&&t.push(i.scenes[e]);i.isOptimized=!0,i.scenes=t}o(JSON.stringify(i)),g.complete&&g.complete()}catch(e){t(e)}})}outGltf(t){this.Resources.delete(!0);for(const i in this.project.objectDatas.map){let e=this.project.objectDatas.find(i);e.objectType!=v.Wall&&e.objectType!=v.Corner?(e.instance&&e.instance.dispose(),this.project.objectDatas.remove(i)):e.instance.material=null}return BABYLON.GLTF2Export.GLTFAsync(this.scene,this.project.id,{shouldExportNode:e=>{e=this.project.objectDatas.find(e.id);return e&&(e.objectType==v.Wall||e.objectType==v.Corner)}}).then(e=>{e.downloadFiles(),t&&t()})}showTips(){this.tipsTool=new F(this.canvas.parentElement,this)}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.fps||(this.fps=document.createElement("div"),this.canvas.parentElement.appendChild(this.fps)),this.fps.style.cssText=e}showMonitoringParameters(){var e=new BABYLON.EngineInstrumentation(this.engine);e.captureGPUFrameTime=!0,e.captureShaderCompilationTime=!0;let t=document.createElement("div");t.style.cssText="position: absolute;left: 5px;top: 5px;z-index:999999999;font-size: 10px;color: rgb(0, 255, 0);",this.canvas.parentElement.appendChild(t);let i=document.createElement("div");i.style.cssText="position: absolute;left: 5px;top: 25px;z-index:999999999;font-size: 10px;color: rgb(0, 255, 0);",this.canvas.parentElement.appendChild(i);let s=document.createElement("div");s.style.cssText="position: absolute;left: 5px;top: 45px;z-index:999999999;font-size: 10px;color: rgb(0, 255, 0);",this.canvas.parentElement.appendChild(s);let n=document.createElement("div");n.style.cssText="position: absolute;left: 5px;top: 65px;z-index:999999999;font-size: 10px;color: rgb(0, 255, 0);",this.canvas.parentElement.appendChild(n);let o=document.createElement("div");o.style.cssText="position: absolute;left: 5px;top: 85px;z-index:999999999;font-size: 10px;color: rgb(0, 255, 0);",this.canvas.parentElement.appendChild(o),this.scene.registerBeforeRender(()=>{t.innerText="current frame time (GPU): "+(1e-6*e.gpuFrameTimeCounter.current).toFixed(2)+"ms",i.innerText="average frame time (GPU): "+(1e-6*e.gpuFrameTimeCounter.average).toFixed(2)+"ms",s.innerText="total shader compilation time: "+e.shaderCompilationTimeCounter.total.toFixed(2)+"ms",n.innerText="average shader compilation time: "+e.shaderCompilationTimeCounter.average.toFixed(2)+"ms",o.innerText="compiler shaders count: "+e.shaderCompilationTimeCounter.count})}hideFps(){this.fps&&this.canvas.parentElement.removeChild(this.fps),this.fps=null}dispose(){this.fps&&this.canvas.parentElement.removeChild(this.fps),this.fps=null,this.project.delete(),this.Resources.delete(),this.engine.dispose()}showDebug(){this.scene.debugLayer.show()}},Tools:u,UI:class{static createIconFromMesh(e,t,i,s,n){let o=t.visualAngle.focus.clone();var r=t.instance.getBoundingInfo();return o.y+=(r.boundingBox.maximum.y-r.boundingBox.minimum.y)/2,new V.IconFromMesh(e,o,i,s,n,t.app.scene)}static createIcon(e,t,i,s){let n;t.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,n=new V.Icon(e,t.app.scene),n.size=i,n.height=s,n.pint=new BABYLON.Mesh(e+"_pint");e=t.visualAngle.focus.clone();return n.pint.position=e,n.pint.position.y+=s,n.rect=new BABYLON.GUI.Rectangle,n.rect.isPointerBlocker=!1,n.rect.width=i.width+"px",n.rect.height=i.height+"px",n.rect.thickness=0,t.app.container.addControl(n.rect),n.rect.linkWithMesh(n.pint),t.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,n}},ObjectType:v,EffectMgr:void 0,EffectType:y,EventType:g,EffectControls:class{static createCapacity(e,t,i,s="200px"){return V.Builder.createCapacity(e,t,i,s)}static createMatrixHeatMap(e,t){if(e.objectType==v.Floor)return V.Builder.createMatrixHeatMap({anchor:e.instance,rootUrl:e.app.rootUrl,FogTex:e.app.Resources.FogTex,container:e.app.container,config:t.config,displayValues:t.displayValues,height:t.height,isAlpha:t.isAlpha,isLevelRender:t.isLevelRender,isParticle:t.isParticle,radius:t.radius,range:t.range});console.error("矩阵云图对象必须为房间!")}static createColumnarHeatMap(e,t){return V.Builder.createColumnarHeatMap({anchor:e.instance,FogTex:e.app.Resources.FogTex,container:e.app.container,config:t.config,displayValues:t.displayValues,isAlpha:t.isAlpha,isLevelRender:t.isLevelRender,isParticle:t.isParticle,radius:t.radius,range:t.range})}},Dictionary:m},H=t.default=i}],p={},h.m=l,h.c=p,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 s in t)h.d(i,s,function(e){return t[e]}.bind(null,s));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=44).default;function h(e){if(p[e])return p[e].exports;var t=p[e]={i:e,l:!1,exports:{}};return l[e].call(t.exports,t,t.exports,h),t.l=!0,t.exports}var l,p});
|
|
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(14);const y=i.n(t).a.create();y.defaults.headers.post["Content-Type"]="application/json",y.interceptors.request.use(e=>{var t=localStorage.getItem("mx3d-token");return t&&(e.headers.Authorization="Bearer "+t),e},e=>Promise.reject(e)),y.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 B,v,w=y;class x{static init(){let e=new p.a.Tween(this.colors[1]).to({r:1,g:0,b:0},500),t=new p.a.Tween(this.colors[1]).to({r:1,g:.5,b:.5},500);t.chain(e),e.chain(t),e.start();let i=new p.a.Tween(this.colors[2]).to({r:1,g:.55,b:0},500),n=new p.a.Tween(this.colors[2]).to({r:0,g:0,b:0},500);i.chain(n),n.chain(i),i.start();let s=new p.a.Tween(this.colors[3]).to({r:1,g:.84,b:0},500),r=new p.a.Tween(this.colors[3]).to({r:0,g:0,b:0},500);s.chain(r),r.chain(s),s.start();let o=new p.a.Tween(this.colors[4]).to({r:0,g:.75,b:1},500),a=new p.a.Tween(this.colors[4]).to({r:0,g:0,b:0},500);o.chain(a),a.chain(o),o.start();let h=new p.a.Tween(this.colors[5]).to({r:.53,g:.8,b:0},500),c=new p.a.Tween(this.colors[5]).to({r:0,g:0,b:0},500);h.chain(c),c.chain(h),h.start();let l=new p.a.Tween(this.colors[6]).to({r:.8,g:.8,b:.8},500),u=new p.a.Tween(this.colors[6]).to({r:0,g:0,b:0},500);l.chain(u),u.chain(l),l.start()}}x.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=B=B||{})[t.Opaque=0]="Opaque",t[t.Flash=1]="Flash",t[t.Transparent=2]="Transparent",(t=v=v||{}).leftClick="leftClick",t.rightClick="rightClick",t.doubleClick="doubleClick",t.eover="eover",t.longPress="longPress",t.out="out";class E{constructor(e){this.executes=new f,this.clickEvents=new f,this.touchtime=(new Date).getTime(),this.effectType=B.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(v.eover)||this.executes.find(v.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.parentId=e.parentId,this.modelId=e.baseModel.modelId,this.animation=e.animation,this.isAutoPlay=e.isAutoPlay,this.isloop=e.isloop,this.objectType=e.objectType;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=m.ToVector3(e.rotation),t.position=m.ToVector3(e.position),t.scaling=m.ToVector3(e.scaling);e=m.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 d;var e=this.instance.getBoundingInfo(),t=m.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==v.leftClick||e==v.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(v.leftClick);t&&0==e.sourceEvent.button&&t(this,e);let i=this.clickEvents.find(v.rightClick);i&&2==e.sourceEvent.button&&i(this,e),this.touchtime=(new Date).getTime()}),e="click"):e==v.doubleClick?i=new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnDoublePickTrigger,e=>t(this,e)):e==v.eover?(i=new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPointerOverTrigger,e=>t(this,e)),this.instance.enablePointerMoveEvents=!0):e==v.longPress?i=new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnLongPressTrigger,e=>t(this,e)):e==v.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==v.leftClick||e==v.rightClick||e==v.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==B.Opaque&&(this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.instance.getChildMeshes().forEach(e=>{e.instancedBuffers&&(e.instancedBuffers.color=x.colors[t])}),this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,this.effectType=B.Flash)}setOpaque(){this.effectType!=B.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=B.Opaque)}setTransparent(e=.3){this.effectType==B.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=B.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}flyTo(){this.app.Camera.translation(this.Sight,500)}focus(){}}class M extends E{constructor(){super(...arguments),this.baseModel=null}bind(e){this.id=r.getGUID(12),this.objectType="Wall",this.name="墙体",this.instance=_.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 T extends E{bind(e){this.id=e.id,this.name=e.name,this.parentId=e.parentId,this.modelId=e.baseModel.modelId,this.height=e.baseModel.height,this.objectType=e.objectType,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=_.Tools.computeBounds(this.instance);this.instance.rotation=_.Tools.ToVector3(e.rotation),this.instance.position=_.Tools.ToVector3(e.position),this.Sight=_.Tools.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 O extends E{bind(e){this.id=e.id,this.name=e.name,this.parentId=e.parentId,this.modelId=e.baseModel.modelId,this.height=e.baseModel.height,this.objectType=e.objectType,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=m.computeBounds(this.instance);this.instance.rotation=m.ToVector3(e.rotation),this.instance.position=m.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 L extends E{}class R extends E{bind(e){this.Sight=new d;let t=m.ToARRVector3(e.lines);this.Sight.focus=t[0].clone(),this.instance=m.createTube(e.id,t,.02,this.app),this.instance.setEnabled(!1),this.id=e.id,this.name=e.name,this.parentId=e.parentId,this.modelId=e.baseModel.modelId,this.objectType=e.objectType;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(){var e=this.instance.getBoundingInfo(),t=m.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==v.leftClick||e==v.rightClick||e==v.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(v.leftClick);t&&0==e.sourceEvent.button&&t(this,e);let i=this.clickEvents.find(v.rightClick);i&&2==e.sourceEvent.button&&i(this,e);let n=this.clickEvents.find(v.doubleClick);n&&0==e.sourceEvent.button&&(new Date).getTime()-this.touchtime<500&&n(this,e),this.touchtime=(new Date).getTime()}),e="click"):e==v.eover?(i=new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPointerOverTrigger,e=>t(this,e)),this.instance.enablePointerMoveEvents=!0):e==v.longPress?i=new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnLongPressTrigger,e=>t(this,e)):e==v.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==v.leftClick||e==v.rightClick||e==v.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 C extends E{async bind(e){this.id=e.id,this.name=e.name,this.parentId=e.parentId,this.objectType=e.objectType,"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=_.Tools.ToVector3(e.rotation),this.instance.position=_.Tools.ToVector3(e.position),this.instance.scaling=_.Tools.ToVector3(e.scaling),this.alwaysActive(),this.optimization(!0),this.computeView()}}class N extends E{bind(e){this.id=e.id,this.name=e.name,this.parentId=e.parentId,this.objectType=e.objectType;let t={};t.color=e.color,e.size?(t.clearColor=null,t.position=_.Tools.ToVector3(e.position),s=_.Tools.ToVector3(e.rotation),t.rotation=new BABYLON.Vector3(s.x+Math.PI,s.y,s.z),i=Number.parseInt(e.size.replace("px",""))/40,s=e.scaling?_.Tools.ToVector3(e.scaling):BABYLON.Vector3.One(),t.scaling=new BABYLON.Vector3(14*i/50*s.x,1,14*i/50*s.z)):(t.clearColor=e.clearColor,t.position=_.Tools.ToVector3(e.position),t.rotation=_.Tools.ToVector3(e.rotation),t.scaling=_.Tools.ToVector3(e.scaling));var i="bold 100px Arial";let n=new BABYLON.DynamicTexture(this.id,64,this.app.scene,!1);var s=n.getContext();s.font=i;e=s.measureText(this.name).width+8,s=.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,s,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.parentId=e.parentId,this.objectType=e.objectType,this.color=e.color,this.instance=new BABYLON.Mesh(this.id);var t=m.ToARRVector3(e.pints);let i=m.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=m.ToVector3(e.rotation)),e.position&&(this.instance.position=m.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 d;var e=this.instance.getBoundingInfo(),e=m.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==B.Opaque&&(this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.optimization(!1),this.instance.material.emissiveColor=x.colors[e],this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,this.effectType=B.Flash)}setOpaque(){this.effectType!=B.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=B.Opaque)}setTransparent(e=.3){this.effectType==B.Opaque&&(this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!0,this.optimization(!1),this.instance.material.alpha=e,this.app.scene.blockfreeActiveMeshesAndRenderingGroups=!1,this.effectType=B.Transparent)}}class S extends E{bind(e){this.id=e.id,this.name=e.name,this.parentId=e.parentId,this.modelId=e.baseModel.modelId,this.objectType=e.objectType,this.instance=BABYLON.MeshBuilder.CreatePolygon("地板",{shape:m.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,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=m.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 k extends E{bind(e){this.id=e.id,this.parentId=e.parentId,this.objectType="Wall",this.instance=this.app.Resources.walls.find(e.id),this.instance&&(this.app.scene.addMesh(this.instance),this.app.Resources.walls.remove(e.id),e.baseModel?(this.modelId=e.baseModel.modelId,this.nativeMaterial=this.app.Resources.GetMergeMaterial(e.baseModel,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.alwaysActive(),this.optimization(!0),this.instance.setEnabled(!1),this.computeView())}}class I extends E{bind(i){let e=!1;this.id=r.getGUID(12),this.name="墙角",this.objectType="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=m.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 Y extends E{constructor(e,t){super(e),this.height=0,this.id=t.id,console.log(t),this.objectType=t.objectType,this.name=t.name,this.parentId=t.parentId,this.height=t.height,this.index=t.index}bind(s,e=0){let t=!1;for(let e=0;e<s.length;e++){var i=s[e];if(i.objectType==g.optimizedWall){t=!0;let e=new k(this.app);e.bind(i),e.instance&&this.app.Project.objectDatas.add(e.id,e)}}let o=new Array;for(let t=0;t<s.length;t++){let e=s[t];e.objectType==g.Wall&&(e.height||(e.height=3.1),e.ply||(e.ply=.09),o.push(e))}let r=new f;for(let e=0;e<s.length;e++){let i=s[e];i.objectType==g.Corner&&(r.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))})})))}if(!t){let t=new Array;for(let e=0;e<s.length;e++){var n=s[e];n.objectType==g.Corner&&t.push(n)}let e=new I(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<s.length;i++){let n=s[i];if(n.objectType==g.Floor){n.vectors=new Array;let e=s[i];e.pints.forEach(e=>{r.find(e)||console.log(e),n.vectors.push(r.find(e))}),n.buckles=new Array,e.holes&&e.holes.forEach(e=>{let t=new Array;e.forEach(e=>t.push(r.find(e))),n.buckles.push(t)}),e.middles&&e.middles.forEach(t=>{let i=Array();for(let e=0;e<s.length;e++)s[e].id==t&&s[e].pints.forEach(e=>{e=r.find(e);i.push(new BABYLON.Vector3(e.x,0,e.z))});n.buckles.push(i)});let t=new S(this.app);t.height=this.height,t.bind(n),this.app.Project.objectDatas.add(t.id,t)}}r=null;for(let t=0;t<s.length;t++){var a=s[t];let e;if(a.objectType==g.Window)e=new T(this.app);else if(a.objectType==g.Door)e=new O(this.app);else if(a.objectType==g.Cabinet)e=new L(this.app);else if(a.objectType==g.LeakWater)e=new R(this.app);else if(a.objectType==g.VirtualBox)e=new C(this.app);else if(a.objectType==g.UI3D)e=new N(this.app);else if(a.objectType==g.Conduit)e=new P(this.app);else{if(a.objectType==g.Wall||a.objectType==g.optimizedWall)continue;if(a.objectType==g.Corner)continue;if(a.objectType==g.Floor)continue;e=new E(this.app)}e.bind(a),this.app.Project.objectDatas.add(e.id,e)}if(!t){let r=new f;r.add("body",{t:"",walls:new Array});for(let s=0;s<o.length;s++){let n=BABYLON.MeshBuilder.ExtrudePolygon(o[s].id,{shape:[m.ToVector3(o[s].wtop),m.ToVector3(o[s].wleft),m.ToVector3(o[s].wbottom),m.ToVector3(o[s].wright)],depth:parseFloat(o[s].height),sideOrientation:BABYLON.Mesh.FRONTSIDE},this.app.scene);n.setEnabled(!1),n.position.y=parseFloat(o[s].height),n.subMeshes=[];var h=n.getTotalVertices();n.subMeshes.push(new BABYLON.SubMesh(0,0,h,0,6,n)),n.subMeshes.push(new BABYLON.SubMesh(0,1,h,18,6,n)),n.subMeshes.push(new BABYLON.SubMesh(0,2,h,30,6,n));for(let i=0;i<o[s].wallwindows.length;i++){const p=BABYLON.CSG.FromMesh(n);let e=this.app.Project.objectDatas.find(o[s].wallwindows[i]);var c=e.instance.getBoundingInfo(),l=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[s].ply)+.1},this.app.scene);l.position=e.instance.position.clone(),l.position.y=(c.maximum.y-c.minimum.y)/2+e.height,l.rotation=e.instance.rotation.clone();c=BABYLON.CSG.FromMesh(l);let t=p.subtract(c);l.dispose(),n.dispose(),n=t.toMesh(o[s].id,null,this.app.scene,!0),n.setEnabled(!1)}let t=r.find(o[s].leftMap.modelId);t||(t={t:o[s].leftMap,walls:new Array},r.add(o[s].leftMap.modelId,t));let i=r.find(o[s].rightMap.modelId);i||(i={t:o[s].rightMap,walls:new Array},r.add(o[s].rightMap.modelId,i));var u=m.DeconsTructMesh(n,parseFloat(o[s].height),this.app);for(let e=0;e<u.length;e++)(2==e||3==e?t:4==e||5==e?i:r.find("body")).walls.push(u[e])}for(const d in r.map)if(0<r.find(d).walls.length){let e=new M(this.app);e.parentId=this.id,e.height=this.height,e.bind(r.find(d)),this.app.Project.objectDatas.add(e.id,e)}}o=null,this.computeView()}computeView(){this.Sight=new d;var e=this.getBounding(),e=m.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(){}}class _{}_.sl="https://www.wodashijie.com/",_.rl="https://models.wodashijie.com/",_.App=class{constructor(e){e.sl&&(_.sl=e.sl),e.rl&&(_.rl=e.rl),w.defaults.baseURL=_.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 u(this),this.Environment.defaultLights(),this.Environment.openAllLight(),this.Resources=new A(this),this.Project=new b(this),_.EffectMgr.init(),this.engine.runRenderLoop(()=>{this.fps&&(this.fps.innerText=this.engine.getFps().toFixed()+" fps"),this.scene.render(),p.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)}}),this.scene.onKeyboardObservable.add(e=>{e.type===BABYLON.KeyboardEventTypes.KEYDOWN&&70===e.event.keyCode&&prompt("请复制输入框内的视角参数",JSON.stringify({alpha:this.Camera.camera.alpha,focus:m.vector3ToJson(this.Camera.camera.target),radius:this.Camera.camera.radius,beta:this.Camera.camera.beta}))})}async load(u){_.pk=u.pk;var e=await w.get(`api/Account/Developer?accessToken=${encodeURIComponent(_.accessToken)}`);if(200==e.status){localStorage.setItem("mx3d-token",e.data);e=await w.get(`api/WorkFiles/GetProject?pk=${_.pk}`);if(200==e.status){let l=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 h in t.map)await this.Resources.loadModelMesh(t.find(h)),e++,u&&u.progress&&u.progress(e/t.count()*.8);e=0,t=null;let i=new f;for(let e=0;e<l.length;e++){var s,r=l[e];r.objectType==g.Region&&(s=new Y(this,r),this.Project.objectDatas.add(s.id,s),i.add(s.id,new Array))}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 c in i.map)await this.Project.objectDatas.find(c).bind(i.find(c)),e++,u&&u.progress&&u.progress(.8+e/l.scenes.length*.2);i=null,this.Project.show(),this.scene.blockfreeActiveMeshesAndRenderingGroups=!1,n(null),this.engine.resize(),u&&u.complete&&u.complete()}catch(e){t(e)}})}}}},_.Tools=m,_.EffectMgr=x,_.IconFromMesh=class{constructor(e,t,i,n,s,r){this.id=e,this.scene=r,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+=s,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}},_.Icon=class{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(r.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}}}],l={},h.m=c,h.c=l,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=44).default;function h(e){if(l[e])return l[e].exports;var t=l[e]={i:e,l:!1,exports:{}};return c[e].call(t.exports,t,t.exports,h),t.l=!0,t.exports}var c,l});
|