fengmap.core.min.js 1.2 MB

12
  1. /*! Released Version 2.5.0,BUILD 40. Fengmap Javascript SDK, see: https://www.fengmap.com for details */
  2. !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.fengmap=t():e.fengmap=t()}(this,function(){return n=[function(e,t,n){e.exports=n(245)},function(e){function t(e){return e&&e.__esModule?e:{default:e}}e.exports=t},function(e){function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}e.exports=t},function(e,t,n){var i=n(0);function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),i(e,r.key,r)}}function a(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}e.exports=a},function(e,t,n){"use strict";var r=n(101),i={};i[n(20)("toStringTag")]="z",i+""!="[object z]"&&n(43)(Object.prototype,"toString",function(){return"[object "+r(this)+"]"},!0)},function(e,t,n){"use strict";n(323);var r=n(36),i=n(95),a=n(26),o="toString",s=/./[o],l=function(e){n(43)(RegExp.prototype,o,e,!0)};n(23)(function(){return"/a/b"!=s.call({source:"a",flags:"b"})})?l(function(){var e=r(this);return"/".concat(e.source,"/","flags"in e?e.flags:!a&&e instanceof RegExp?i.call(e):void 0)}):s.name!=o&&l(function(){return s.call(this)})},function(e,t,n){e.exports=n(344)},function(e,t,n){var r=n(55),i=n(194);function a(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?i(e):t}e.exports=a},function(t,e,n){var r=n(354),i=n(195);function a(e){return t.exports=a=i?r:function(e){return e.__proto__||r(e)},a(e)}t.exports=a},function(e,t,n){var r=n(69),i=n(360);function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=r(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&i(e,t)}e.exports=a},function(e,t,n){var r=n(38).f,i=Function.prototype,a=/^\s*function ([^ (]*)/,o="name";o in i||n(26)&&r(i,o,{configurable:!0,get:function(){try{return(""+this).match(a)[1]}catch(e){return""}}})},function(e){var t=e.exports={version:"2.6.11"};"number"==typeof __e&&(__e=t)},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(2)),o=r(n(3)),s=function(){function n(e,t){(0,a.default)(this,n),this._eid=e,this._groupId=e,this.parent=null,this._nodeType=t,this._x=0,this._y=0,this._z=0,this._height=0,this._alwaysShow=!1,this._show=!0,this.needAvoid=!0,this.renderNodeInited=!1,this.tryInit=!1}return(0,o.default)(n,[{key:"findParent",value:function(e){for(var t=this.parent;t;){if(t instanceof e)return t;t=t.parent}return!1}},{key:"avoid",value:function(e){this.needAvoid=e,e||(this.show=!0)}},{key:"alwaysShow",value:function(){var e;this._alwaysShow=!0;for(var t=this.parent;t;){if(t.isGroup){e=t;break}t=t.parent}e&&this.renderNode&&e.alwaysShowMarkers.push(this.renderNode)}},{key:"isAlwaysShow",get:function(){return this._alwaysShow}},{key:"groupID",get:function(){if(this.isGroup)return this._eid;for(var e,t=this.parent;t;){if(t.isGroup){e=t;break}t=t.parent}return e?e.eid:0}},{key:"height",set:function(e){this._height=e},get:function(){return this._height}},{key:"mapCoord",set:function(e){this._mapCoord=e},get:function(){return{x:this._x,y:this._y,z:this._height}}},{key:"nodeType",set:function(e){this._nodeType=e},get:function(){return this._nodeType}},{key:"show",set:function(e){this._show=e,this._renderNode&&(this._renderNode.visible=e)},get:function(){return this._show}},{key:"x",set:function(e){this._x=e},get:function(){return this._x}},{key:"y",set:function(e){this._y=e},get:function(){return this._y}},{key:"z",set:function(e){this._z=e},get:function(){return this._z}},{key:"eid",get:function(){return this._eid}}]),n}(),l=s;t.default=l},function(e,t,n){e.exports=n(311)},function(e,t,n){var m=n(19),v=n(11),g=n(40),y=n(48),_=n(49),x="prototype",w=function(e,t,n){var r,i,a,o=e&w.F,s=e&w.G,l=e&w.S,u=e&w.P,c=e&w.B,h=e&w.W,f=s?v:v[t]||(v[t]={}),d=f[x],p=s?m:l?m[t]:(m[t]||{})[x];for(r in s&&(n=t),n)i=!o&&p&&void 0!==p[r],i&&_(f,r)||(a=i?p[r]:n[r],f[r]=s&&"function"!=typeof p[r]?n[r]:c&&i?g(a,m):h&&p[r]==a?function(r){var e=function(e,t,n){if(this instanceof r){switch(arguments.length){case 0:return new r;case 1:return new r(e);case 2:return new r(e,t)}return new r(e,t,n)}return r.apply(this,arguments)};return e[x]=r[x],e}(a):u&&"function"==typeof a?g(Function.call,a):a,u&&((f.virtual||(f.virtual={}))[r]=a,e&w.R&&d&&!d[r]&&y(d,r,a)))};w.F=1,w.G=2,w.S=4,w.P=8,w.B=16,w.W=32,w.U=64,w.R=128,e.exports=w},function(e,t,n){e.exports=n(252)},function(e,t,n){e.exports=n(271)},function(e,t,n){e.exports=n(268)},function(e,t,n){e.exports=n(342)},function(e){var t=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=t)},function(e,t,n){var r=n(118)("wks"),i=n(78),a=n(28).Symbol,o="function"==typeof a,s=e.exports=function(e){return r[e]||(r[e]=o&&a[e]||(o?a:i)("Symbol."+e))};s.store=r},function(e,t,n){"use strict";var h=n(120),_=n(36),x=n(177),w=n(138),b=n(37),M=n(100),f=n(129),r=n(23),S=Math.min,d=[].push,o="split",p="length",m="lastIndex",E=4294967295,T=!r(function(){RegExp(E,"y")});n(102)("split",2,function(i,a,v,g){var y;return y="c"=="abbc"[o](/(b)*/)[1]||4!="test"[o](/(?:)/,-1)[p]||2!="ab"[o](/(?:ab)*/)[p]||4!="."[o](/(.?)(.?)/)[p]||1<"."[o](/()()/)[p]||""[o](/.?/)[p]?function(e,t){var n=String(this);if(void 0===e&&0===t)return[];if(!h(e))return v.call(n,e,t);for(var r,i,a,o=[],s=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),l=0,u=void 0===t?E:t>>>0,c=new RegExp(e.source,s+"g");(r=f.call(c,n))&&(i=c[m],!(l<i&&(o.push(n.slice(l,r.index)),1<r[p]&&r.index<n[p]&&d.apply(o,r.slice(1)),a=r[0][p],l=i,o[p]>=u)));)c[m]===r.index&&c[m]++;return l===n[p]?!a&&c.test("")||o.push(""):o.push(n.slice(l)),o[p]>u?o.slice(0,u):o}:"0"[o](void 0,0)[p]?function(e,t){return void 0===e&&0===t?[]:v.call(this,e,t)}:v,[function(e,t){var n=i(this),r=null==e?void 0:e[a];return void 0!==r?r.call(e,n,t):y.call(String(n),e,t)},function(e,t){var n=g(y,e,this,t,y!==v);if(n.done)return n.value;var r=_(e),i=String(this),a=x(r,RegExp),o=r.unicode,s=(r.ignoreCase?"i":"")+(r.multiline?"m":"")+(r.unicode?"u":"")+(T?"y":"g"),l=new a(T?r:"^(?:"+r.source+")",s),u=void 0===t?E:t>>>0;if(0===u)return[];if(0===i.length)return null===M(l,i)?[i]:[];for(var c=0,h=0,f=[];h<i.length;){l.lastIndex=T?h:0;var d,p=M(l,T?i:i.slice(h));if(null===p||(d=S(b(l.lastIndex+(T?0:h)),i.length))===c)h=w(i,h,o);else{if(f.push(i.slice(c,h)),f.length===u)return f;for(var m=1;m<=p.length-1;m++)if(f.push(p[m]),f.length===u)return f;h=c=d}}return f.push(i.slice(c)),f}]})},function(e){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,n){var r=n(126)("wks"),i=n(98),a=n(19).Symbol,o="function"==typeof a,s=e.exports=function(e){return r[e]||(r[e]=o&&a[e]||(o?a:i)("Symbol."+e))};s.store=r},function(e,t,n){e.exports=n(306)},function(e,t,n){e.exports=!n(23)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t,n){var m=n(28),v=n(93),g=n(39),y=n(43),_=n(88),x="prototype",w=function(e,t,n){var r,i,a,o,s=e&w.F,l=e&w.G,u=e&w.S,c=e&w.P,h=e&w.B,f=l?m:u?m[t]||(m[t]={}):(m[t]||{})[x],d=l?v:v[t]||(v[t]={}),p=d[x]||(d[x]={});for(r in l&&(n=t),n)i=!s&&f&&void 0!==f[r],a=(i?f:n)[r],o=h&&i?_(a,m):c&&"function"==typeof a?_(Function.call,a):a,f&&y(f,r,a,e&w.U),d[r]!=a&&g(d,r,o),c&&p[r]!=a&&(p[r]=a)};m.core=v,w.F=1,w.G=2,w.S=4,w.P=8,w.B=16,w.W=32,w.U=64,w.R=128,e.exports=w},function(e){var t=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=t)},function(e,t,n){var r=n(22);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t,n){e.exports=!n(41)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t,n){e.exports=n(303)},function(e,t,n){e.exports=n(321)},function(e,t,n){"use strict";var r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var i={NONE:0,EXTENT:4,FLOOR:4,MODEL:5,DYNMODEL:6,FACILITY:11,LABEL:12,LINE:21,IMAGE_MARKER:31,TEXT_MARKER:32,LOCATION_MARKER:33,SURFACEIMAGE_MARKER:34,EXTERANL_MODEL:35,EXTERNAL_MODEL:35,POLYGON_MARKER:36,ALL:65535,ELEMENT:100},a=i;t.default=a},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var s=r(n(18)),l=r(n(17)),u=r(n(16)),a=r(n(15));n(5),n(4),n(71),n(10);var R=r(n(25));n(21);var _=r(n(68)),C=r(n(13)),o=r(n(2)),c=r(n(3)),h=r(n(149)),I=r(n(57)),f=r(n(380)),m=r(n(209)),v=r(n(382)),d=r(n(384)),p=r(n(394)),k=r(n(58)),M=r(n(87)),x=r(n(86));function P(e){if(void 0===u.default||null==e[l.default]){if((0,C.default)(e)||(e=g(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i,a=!0,o=!1;return{s:function(){r=(0,s.default)(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){o=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(o)throw i}}}}function g(e,t){if(e){if("string"==typeof e)return y(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?(0,a.default)(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?y(e,t):void 0}}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var w=function(){function n(e,t){(0,o.default)(this,n),this._scenes={},this._materialManager=new f.default(e.font),this._raycaster=new fm.Raycaster,this._focusAlphaMode=e._focusAlphaMode,this._focusAlpha=e._focusAlpha,this._map=t,this._externalModelUrl=e.mapServerURL+"/models/",this._externalLoader=new d.default(this._externalModelUrl,"fengmap"==e.mapServerURL,e.key),this._dynamicLoader=new p.default,this._externalLoader.setLoadedBack(function(){t.dispatchEvent({type:"externalLoaded"}),t.dispatchEvent({type:"gltfLoaded"}),t.checkNode(),t.setRenderList()})}return(0,c.default)(n,[{key:"createCompassNode",value:function(e,t,n,r,i){var a=0<arguments.length&&void 0!==e?arguments[0]:1,o=1<arguments.length?t:void 0,s=2<arguments.length?n:void 0,l=3<arguments.length?r:void 0,u=4<arguments.length?i:void 0,c=o||"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAGhUlEQVR4nOWbzW/cRBjGn7HHY7u7m8RLojIF8SFUUQECFQqnimsF/wAgEIiWKEqgH+LjAJxRDwjU0kIEpZWASvQvAM6IEy1IILUqogiEaKZVluxu1tv1ztgeDvHSELLJfno3yU/KIfaM93kfjz2ej5fMzc2hEzjnLZUTQowCeBzAgwDuBbALAAfgAcgkxaoASgDmAFwG8AuAnwF8yzkvdySwRUg/DBBC3APgOQBPEEIeZYzVKKV1SqmklErTNEPDMGJCSAwAWmsjjmMjiiIahiFL/mwppau1Pg/gawBnOee/dSR2DXpmgBDCBPA0gGnTNB9zHGfRcZwqYyzoRqCU0gmCIBMEwUgURd8DmAVwjnMedXPdBl0bkAR+GMB7juNUtm3bVrJtu9YLcSup1+vujRs3xoIgyAF4DcDxbo3oygAhxEsATrmuW85mswuUUtWNmFYJw9DyfT9fq9VGAUxyzj/t9FqdGnAfgBnLsg6MjIxcZ4zVOxXQDVJKe3FxcbtS6jSAjzjnl9q9RicGzBBCTmaz2flsNltqt3I/8H1/zPf9Ca31K5zzj9qp264BR03TfNXzPGFZ1kDuejOUUnaxWORRFL3HOX+r1XpGG79xjDF2aHx8/M9hCx4ALMuqj4+P/8kYOyyEONZqvVYNOGHb9v58Pn/VMIy4Q419xzCMOJ/PX7Vte78Q4kRLdVooc8y27Rfy+bwghOguNfYdQojO5/PCtu0XWmkJ6xlwlDE26XnetR7pSw3P864xxiaFEEfXKreWATPJC29uI9z5lRBCtOd5c6ZpviqEmGlWrpkBDxBCTnqeJ4b5mV8PwzBiz/MEIeSkEOL+Vcs0qTudy+Xmh/Ft3y6WZdVzudw8gOnVzq9mwIxlWS9mMpmh+MjpBZlMpmRZ1gEhxOTKcys/hCgAOax9fTcopexCoXAnALp8ALWyBRx2XXdxswUPLD0KruuWsTRy/ZflLYACkBMTE3+kNapLmzAMrfn5+bsAMM55CPy3BTzrOE5lswYPAJRS5TiOD+DZxrHlBkxvphdfMzKZTBHLeoSGAfdRSnd3O321EWCMBZTS3Y3vgoYBTzuOUxmgrlRJYn0KuGnAPtu2q4OTlC5JrPuAJQPGCCF7tkLzb8AYCwghe4QQYwaAvYyxvsziDjNJzHsNAA9RSjfdh896JDE/ZADYRSmVgxaUNknMuwwAO7ewATsNALebphkOWlDaJDHfbgAY2ciTHp2SxDxqAMg1Vmm3EknM2XbWBTYVWmsCQBoAKlrrLWdEEnPFALAYx/GWMyCJuWIA+CuKIjpoQWkTx7EJ4LoB4NcwDNmgBaVNEvOvBoDLW9iAywaAn8IwtActKG2SmH8yAHwnpXQHLShtkpi/MwCUtNYXpJTOoEWlhZTS0Vpf4JyXGt3f1/V6PbNmrU1EEus3wM0psbO1Wm1kcJLSJYn1C+CmAVeiKDq/Fd4FUko3iqLznPMrwH/XBWar1erogHSlRhLjbOP/5QacC4IgF4ahlb6sdAjD0Ep2mZ5rHFtuQAjgDd/386krS4kkttcb64LA/1eHj9VqtVGl1Kb7MFJK2cnW2uPLj680IAIwVS6Xt6emLCWSmKZWbq5ebRj8iVLqdLVaHUtHWv/xfX9MKXWac/7JynPN5gFmK5XKhFJqww+SlFK27/sTAFbdQ9zMgIta60PFYnHHRp4siePYKBaLO7TWU812kq8V3Mkoit5PLkD6pLFvaK1JsVjckWyePtWs3Hp3900p5alSqXRrj/X1nVKpdKuU8hTn/M21yrXSvI8EQfBZsVjkG6ElJHeeB0HwGef8yHrlW32+DwZBcGZhYeG2YX4nxHFsLCws3BYEwRnO+cFW6rQTzBEp5QeFQuGOYewdlFKsUCjcIaX8oJU736CTlJmXCSEncrnc/LBsqqpWq2OVSmVCa32Qc/5hO3U7TZq6H8C0ZVkHRkdHrw9qY6VSyi6Xy42kqVnO+cV2r9Ft2twkgI9d113M5XJ/p7XKHEURrVQqtyQTG1NrdXPr0YvESQrgDQDvOI5TyWQypX7tN5JSOtVqtZE4+TaAd5eP7Dqhl6mzDMAzAKZM09zjuu6ibds9SZ2t1+uZWq02EkXRBQAfA/iSc96TTR39TJ5+HsCThJCHGWM3LMuqJ4nTaq3k6SiKrDAMmVLKllJu01r/COArAJ8PdfJ0M4QQY1hKn38ESxmndwPYjtXT568B+B3AJQA/YCl9vq89zT/uIvNLxH1bgwAAAABJRU5ErkJggg==",h=s||"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTExIDc5LjE1ODMyNSwgMjAxNS8wOS8xMC0wMToxMDoyMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTUgKE1hY2ludG9zaCkiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6ODc3NkExOTBBM0QwMTFFNkI4Rjk5RTE2MjhCMzFCODAiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6ODc3NkExOTFBM0QwMTFFNkI4Rjk5RTE2MjhCMzFCODAiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDozRkM2NUZGNUEzQ0MxMUU2QjhGOTlFMTYyOEIzMUI4MCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDozRkM2NUZGNkEzQ0MxMUU2QjhGOTlFMTYyOEIzMUI4MCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PvSIOBAAAAKaSURBVHja7JvLTuMwFECddNQPQEhVNMCkCJHhESqxa5o9YofEewV7EJ3Zt0gzHzDzPbPvY1vmBwZaEOqCRXeoPIqdelBTQpu0tYPta+lKIdjXV+ceG1SB1ul0kMpDR4oPAAAAAAAAAAAAAAAAAACg6vjEKnGtVhs25TOOP6lUijxv4LgZNNkwDOkM+IVjhcZv1Y6AjWOn5+tt+k4ZAIW+vXX6TgkAK33d/z/Iu1UVABTf2TcWC/QYur874Pu7dI60AApD9uRuAU8ASzj2Qswjc5ZlBFAMuR9XC3SO3d+PMH+frpEGQCHiXtws4AHgK46DEdaRNZYMAIoj7kPWnIsOwIp49oPuAktkAKT7iTHWJ1jfBTrj7h9MIM8hjkURARyN2f1eC45FBLD5QXNxA2B+0Fy+obH6+4BHy3rQm82hnzk2cbypoNXyFzk19Wzc3SVY1MnsQ1GkaW291ZpM/unpe+GOwOP8/N+JJVtYuBAOwFM6/QPpE0hPcpjmT+HuAHwEUNt1/yVLpYEX2G3QHdA7XPdSK5XSBqM6mf4m+LC2djKWBWQtycFwMDWADGzBJbbgy0gG4LUId59kEtIAzwLbHs0Cssa2T1nXx9wAasEVtmAukgGuW0fUHKENoBacRrKAU/e5GeBZkMtdJcvluVAG5HJ1VC6/3hvCG0B/IpyFsqB785/xqoubAZ4FjlNPViqzAw1wnAaqVHymSGFAKAu63f/GsyauBlALGtiCmUADHOca9RkilQHUgnygBd3u53nXw90Az4JstpGsVmd8BmSz16hanQ1MJZMBngWZTN4HiDxnMt/jqCUWA3rvAs+Ad86+tAZ4ANbXt55Ms41I4Oe46tDgf4YUHwAAAAAAAAAAAAAAAAAAQNXxIsAAkfC85URYZVgAAAAASUVORK5CYII=",f=new v.default;f.transparent=!0,f.uniforms.scale={value:a},f.uniforms.offset={value:new fm.Vector2(l,u)},f.uniforms.mapfront={},f.uniforms.mapBack={},f.uniforms.mapfront.value=this._materialManager.loadTexture(h,function(e){e.flipY=!0,f.needsUpdate=!0}),f.uniforms.mapBack.value=this._materialManager.loadTexture(c,function(e){e.flipY=!0,f.needsUpdate=!0});var d=new m.default,p=new fm.Mesh(d,f);return p.userData.coord={x:l,y:u},p.userData.width=.5*a,p.frustumCulled=!1,p}},{key:"getModel",value:function(e,t,n,r){var i=this._scenes[e];if(!i)return[];var a=i.getGroupsModels(t);this._raycaster.setFromCamera(n,r);var o=this._raycaster.intersectObjects(a);return o}},{key:"getExternalModels",value:function(e,t,n,r){var i=this._scenes[e];if(!i)return[];var a=i.getGroupsExternalModels(t);this._raycaster.setFromCamera(n,r);var o=this._raycaster.intersectObjects(a);return o}},{key:"getModelExternal",value:function(e,t,n,r){var i=this._scenes[e];if(!i)return[];var a=i.getGroupsModels(t),o=i.getGroupsExternalModels(t),s=a.concat(o);this._raycaster.setFromCamera(n,r);var l=this._raycaster.intersectObjects(s);return l}},{key:"getMarkers",value:function(e,t,n,r){var i=this._scenes[e];if(!i)return[];for(var a=[],o=0;o<t.length;o++)for(var s=i.getAllImageMarker(t[o]),l=0;l<s.length;l++)a.push(s[l]);this._raycaster.setFromCamera(n,r),this._raycaster.perspective="PerspectiveCamera"===r.type;var u=this._raycaster.intersectObjects(a);return u}},{key:"getNode",value:function(e,t,n,r,i){var a=this._scenes[e];if(!a)return[];var o=a.getNodesExceptFacility(t,i),s=a.getDynnodes(i,t);this._raycaster.setFromCamera(n,r),this._raycaster.perspective="PerspectiveCamera"===r.type;var l=this._raycaster.intersectObjects(o),u=this._raycaster.intersectObjects(s,!0);if(u[0])for(var c=u[0].object;c.parent;){if(c.parent.mapNode){u[0].object=c.parent;break}c=c.parent}return u[0]&&l[0]?u[0].distance>l.distance?l:u:u[0]?u:l[0]?l:[]}},{key:"getFacility",value:function(e,t,n,r,i){var a=this._scenes[e];if(!a)return[];var o=a.getFacilityByFilter(t,i);this._raycaster.setFromCamera(n,r),this._raycaster.perspective="PerspectiveCamera"===r.type;for(var s=this._raycaster.intersectObjects(o),l=0;l<s.length;l++)if(l){if(!(s[l].distance-s[l-1].distance<1e-6))break;if("number"==typeof s[l].object.material.priority&&"number"!=typeof s[l-1].object.material.priority){var u=s[l],c=s[l-1];s[l-1]=u,s[l]=c}else if("number"==typeof s[l].object.material.priority&&"number"==typeof s[l-1].object.material.priority)for(var h=0,f=1;f<=l&&s[l-h].object.material.priority>s[l-f].object.material.priority;f++){var d=s[l-h],p=s[l-f];s[l-f]=d,s[l]=p,h++}}return s}},{key:"getGroupLength",value:function(e){return this._scenes[""+e].groupLength}},{key:"getGroupIds",value:function(e){return this._scenes[""+e].groupIds}},{key:"getGroup",value:function(e,t){return this._scenes[""+e].groups[t+""]}},{key:"getRenderList",value:function(){if(this._scenes){var e=[];for(var t in this._scenes){var n=this._scenes[t].getRenderGroup();e.push(n)}return e}}},{key:"conformatScene",value:function(e,t,n){var r=new h.default(t,e,this);r.parent=this,this._scenes[t+""]=r,this._scenes[t+""].theme=n}},{key:"checkMaterialAlpha",value:function(e,t){if(e)if(this._focusAlphaMode&&t!==this._map.currentFocusGroup&&this._map.otherFocus.indexOf(t)<0){if((0,C.default)(e.material)){var n,r=P(e.material);try{for(r.s();!(n=r.n()).done;){var i=n.value;i.opacity=this._focusAlpha}}catch(e){r.e(e)}finally{r.f()}}else if(e.material)if(void 0===e.material.length)e.material.opacity!==this._focusAlpha&&(e.material.opacity=this._focusAlpha);else for(var a=0;a<e.material.length;a++)e.material[a].opacity!==this._focusAlpha&&(e.material[a].opacity=this._focusAlpha)}else if((0,C.default)(e.material)){var o,s=P(e.material);try{for(s.s();!(o=s.n()).done;){var l=o.value;"number"==typeof l.userData.opacity&&(l.opacity=l.userData.opacity)}}catch(e){s.e(e)}finally{s.f()}}else void 0!==e.material&&"number"==typeof e.material.userData.opacity&&(e.material.opacity=e.material.userData.opacity)}},{key:"checkNodeByFrustum",value:function(e,u,t,c,h){var f=this;if(f._scenes[h+""]){var d=f._scenes[h+""].theme,p=this._scenes[""+h].center.x,m=this._scenes[""+h].center.y,v=this._scenes[""+h].mapcenter.x,g=this._scenes[""+h].mapcenter.y,y=this._map.labelLanguage;M.default[this._map.uuid].bbox=this._scenes[""+h].bboxTh,M.default[this._map.uuid].bbox.uuid=this._map.uuid;var n,r=this._scenes[""+h].groups,i=(0,_.default)(r),a=P(i);try{var o=function(){var e=n.value,l=r[e];if(t.indexOf(l.eid)<=-1)return l.visible=!1,"continue";l.visible=!0,l.traverseByAlias(["extent","model","label","facility","externalModel"],function(r,e){var t=r.bdata,n=-1===t.minlevel||-1===t.maxlevel||0!==t.minlevel&&!t.minlevel||!t.maxlevel||t.minlevel<=c&&t.maxlevel>c;if(n){switch(e){case"extent":r.renderNodeInited?f.checkMaterialAlpha(r.renderNode,l.eid):f.createExtent(r,h,l.eid);break;case"model":r.renderNodeInited?(f.checkMaterialAlpha(r.renderNode,l.eid),f.checkMaterialAlpha(r.line,l.eid)):f.createModel(r,h,l.eid);break;case"label":r.renderNodeInited?f.checkMaterialAlpha(r._renderNode,l.eid):r.tryInit||f.createLabel(r,h,y,l.eid);break;case"facility":r.renderNodeInited?f.checkMaterialAlpha(r._renderNode,l.eid):f.createFacility(r,h,l.eid);break;case"externalModel":if(r.renderNodeInited)f.checkMaterialAlpha(r._renderNode,l.eid);else{var i=r.bdata,a=r.gdata,o=d.getExteralModelTheme(i.fid);if(!o)return;f._externalLoader.preLoadModels[o.normalid]||(f._externalLoader.preLoadModels[o.normalid]={loaded:!1,isLoading:!1,modelUrl:o.model,model:null,geometry:null,material:null});var s=f._externalLoader.preLoadModels[o.normalid];s.loaded?f.createExterModel(s.geometry,s.material,a,i,o,r,p,m,l.height,v,g,s.isGltf):(f._externalLoader.waitingBacks[o.normalid]?f._externalLoader.addWaitingBacks(o.normalid,function(e,t,n){f.createExterModel(e,t,a,i,o,r,p,m,l.height,v,g,"js"!==n)},i.fid):f._externalLoader.addWaitingBacks(o.normalid,function(e,t,n){f.createExterModel(e,t,a,i,o,r,p,m,l.height,v,g,"js"!==n)},i.fid),s.isLoading||f._externalLoader.load(o.normalid))}}r.checkByFrustum(u)}else r.visible=!1})};for(a.s();!(n=a.n()).done;)o()}catch(e){a.e(e)}finally{a.f()}}}},{key:"createModel",value:function(e,t,n){var r,i=this._scenes[""+t].center.x,a=this._scenes[""+t].center.y,o=this._scenes[""+t].mapcenter.x,s=this._scenes[""+t].mapcenter.y,l=this._scenes[""+t].theme,u=e.gdata,c=e.bdata;this._map.MapOptions.useStoreApply&&(r=l.getStoreApplyTheme(c.fid)),r=r||l.getModelTheme(c);var h=null;h=1===this._map.dataManager.file_ver?I.default.convertGeo2Geometry(u.geo):I.default.convertArray2Geometry(u.idxs,u.pts),e._data=h;var f=u.height&&-1!==u.height?u.height:2,d=this.createGeometry(h,f,t),p=this._materialManager.createNormalMaterial(r);if(e._geometry=d,e.initMesh(p,new fm.Vector3(i,a+f,0)),e.x=o,e.y=s,e.height=f,e.currHeight=f,this.checkMaterialAlpha(e.renderNode,n),e.initLine(this._materialManager.createLineMaterial(r),u.height),this.checkMaterialAlpha(e.line,n),r.image&&r.sizes){var m=r.sizes.split(",");e.addStoreImage({image:r.image?this._map.MapOptions.mapThemeURL+"/"+this._map.MapOptions.defaultThemeName+"/"+r.image:"",angle:r.angle?r.angle:0,size:[(0,R.default)(m[0]),(0,R.default)(m[1])],offset:r.offset?r.offset:[0,0]})}}},{key:"createExtent",value:function(e,t,n){var r=e.gdata,i=this._scenes[t+""].theme,a=this._scenes[""+t].center.x,o=this._scenes[""+t].center.y,s=this._scenes[""+t].mapcenter.x,l=this._scenes[""+t].mapcenter.y,u=null;u=1===this._map.dataManager.file_ver?I.default.convertGeo2Geometry(r.geo):I.default.convertArray2Geometry(r.idxs,r.pts);var c=this.createGeometry(u,r.height?r.height:1,t);e._geometry=c,e.x=s,e.y=l;var h=this._materialManager.createNormalMaterial();e.initMesh(h,new fm.Vector3(a,o,0),i.floorColor,i.floorOpacity),this.checkMaterialAlpha(e.renderNode,n)}},{key:"createLabel",value:function(e,t,n,r){var i=e.gdata,a=e.bdata,o=this._scenes[""+t].mapcenter.x,s=this._scenes[""+t].mapcenter.y,l=this._scenes[""+t].center.x,u=this._scenes[""+t].center.y,c=this._scenes[t+""].theme,h=null;h=1===this._map.dataManager.file_ver?I.default.convertGeo2Points(i.geo):I.default.convertArrayPoints(i.idxs,i.pts);var f=-1===i.height?2.2:i.height,d=new fm.Vector3(h.vertices[0].x-o,-h.vertices[0].y+s,0).applyEuler(new fm.Euler(Math.PI/2,0,0,"XYZ")).add(new fm.Vector3(l,u+f,0)),p=a.ename,m=a.name,v=n===x.default.ZH?m:p;e.x=h.vertices[0].x,e.y=h.vertices[0].y,e.height=f,e.pos=d,e.tryInit=!0;var g=c.getLabelTheme(a.type);if(g&&(e.theme=g,e.size=1.4*g.fontsize,v)){var y=this._materialManager.createLabelMaterial(v,g);e.initSprite(y,(new fm.Vector3).copy(d)),this.checkMaterialAlpha(e._renderNode,r),e.setSize()}}},{key:"createFacility",value:function(e,t,n){var r=e.gdata,i=e.bdata,a=this._scenes[""+t].center.x,o=this._scenes[""+t].center.y,s=this._scenes[""+t].mapcenter.x,l=this._scenes[""+t].mapcenter.y,u=this._scenes[t+""].theme,c=null;c=1===this._map.dataManager.file_ver?I.default.convertGeo2Points(r.geo):I.default.convertArrayPoints(r.idxs,r.pts);var h=-1===r.height?2.2:r.height,f=new fm.Vector3(c.vertices[0].x-s,-c.vertices[0].y+l,0).applyEuler(new fm.Euler(Math.PI/2,0,0,"XYZ")).add(new fm.Vector3(a,o+h,0)),d=u.getPoiTheme(i.type),p=this._materialManager.createPoiMaterial(d);e.x=c.vertices[0].x,e.y=c.vertices[0].y,e.height=h,e.pos=f,d.height&&(e.size=d.height),e.initSprite(p,(new fm.Vector3).copy(f)),this.checkMaterialAlpha(e._renderNode,n),e.setSize()}},{key:"everGroup",value:function(e,t){for(var n=0;n<e.biz.length;n++){for(var r=0;r<e.biz[n].extentLayer.length;r++)t(e.geo[n].extentLayer[r],"extentLayer",e.biz[n].extentLayer[r]);for(var i=0;i<e.biz[n].labelLayer.length;i++)t(e.geo[n].labelLayer[i],"labelLayer",e.biz[n].labelLayer[i]);for(var a=0;a<e.biz[n].modelLayer.length;a++)t(e.geo[n].modelLayer[a],"modelLayer",e.biz[n].modelLayer[a]);for(var o=0;o<e.biz[n].poiLayer.length;o++)t(e.geo[n].poiLayer[o],"poiLayer",e.biz[n].poiLayer[o]);for(var s=0;s<e.biz[n].stairLayer.length;s++)t(e.geo[n].stairLayer[s],"stairLayer",e.biz[n].stairLayer[s]);for(var l=0;l<e.biz[n].externalModelLayer.length;l++)t(e.geo[n].externalModelLayer[l],"externalModelLayer",e.biz[n].externalModelLayer[l])}}},{key:"createGeometry",value:function(e,t,n){var r=e.vertices;if(6<=r.length){var i,a=new fm.Shape,o=this._scenes[""+n].mapcenter.x,s=this._scenes[""+n].mapcenter.y;if(e.holes&&0<e.holes.length){var l={};for(var u in e.holes)for(var c=e.holes[u],h=0;h<c.length;h+=2){var f=c[h]+"-"+c[h+1];l[f]=!0}for(var u in this.forEachVertForShape(r,function(e,t,n){e?a.moveTo(t-o,n-s):l[t+"-"+n]||a.lineTo(t-o,n-s)}),e.holes){c=e.holes[u];var d=new fm.Path;this.forEachVertForShape(c,function(e,t,n){e?d.moveTo(t-o,n-s):d.lineTo(t-o,n-s)}),a.holes.push(d)}}else this.forEachVertForShape(r,function(e,t,n){e?a.moveTo(t-o,n-s):a.lineTo(t-o,n-s)});i=0==t?new fm.ShapeGeometry(a):new fm.ExtrudeGeometry(a,{depth:t,bevelEnabled:!1});var p=M.default[this._map.uuid].bbox.min.x,m=M.default[this._map.uuid].bbox.min.y,v=M.default[this._map.uuid].bbox.max.x-M.default[this._map.uuid].bbox.min.x,g=M.default[this._map.uuid].bbox.max.y-M.default[this._map.uuid].bbox.min.y,y=i.faces,_=y.length;for(u=0;u<_;u++){var x=i.vertices[y[u].a],w=i.vertices[y[u].b],b=i.vertices[y[u].c];i.faceVertexUvs[0][u][0].x=(x.x-p)/v,i.faceVertexUvs[0][u][0].y=(x.y-m)/g,i.faceVertexUvs[0][u][1].x=(w.x-p)/v,i.faceVertexUvs[0][u][1].y=(w.y-m)/g,i.faceVertexUvs[0][u][2].x=(b.x-p)/v,i.faceVertexUvs[0][u][2].y=(b.y-m)/g}return i.computeBoundingSphere(),{geometry:i,shape:a}}return null}},{key:"createExterModel",value:function(e,t,n,r,i,a,o,s,l,u,c,h){var f=I.default.convertGeo2Points(n.geo),d=new fm.Vector3(f.vertices[0].x-u,-f.vertices[0].y+c,0).applyEuler(new fm.Euler(Math.PI/2,0,0,"XYZ")).add(new fm.Vector3(o,s+(-1===n.height?2.2:n.height),0));if(h){var p=e.scene;p.traverse(function(e){if(e instanceof fm.Mesh)if(void 0!==e.material.length)for(var t=0;t<e.material.length;t++)e.material[t]=e.material[t].clone(),e.material[t].color=new fm.Color(k.default.toColor(i.color)),e.material[t].needsUpdate=!0,e.material[t].userData.opacity=e.material[t].opacity;else e.material=e.material.clone(),e.material.needsUpdate=!0,e.material.userData.opacity=e.material.opacity});var m=i.scale.split(","),v=i.rotate.split(","),g=i.translate.split(","),y=new fm.Vector3;if(y.set((0,R.default)(v[0])*fm.Math.DEG2RAD,(0,R.default)(v[2])*fm.Math.DEG2RAD,(0,R.default)(v[1])*fm.Math.DEG2RAD),p.rotation.setFromVector3(y,"YXZ"),p.scale.set((0,R.default)(m[0]),(0,R.default)(m[2]),(0,R.default)(m[1])),d.add(new fm.Vector3((0,R.default)(g[0]),(0,R.default)(g[2]),(0,R.default)(g[1]))),p.position.set(d.x,d.y,d.z),a.renderNode=p,a.x=f.vertices[0].x+(0,R.default)(g[0]),a.y=f.vertices[0].y+(0,R.default)(g[1]),a.height=-1===n.height?2.2:n.height,!a._renderNode)return;a._renderNode.frustumCulled=!1,a.renderNodeInited=!0}else{if((0,C.default)(t)){var _,x=P(t);try{for(x.s();!(_=x.n()).done;){var w=_.value;w.color=new fm.Color(k.default.toColor(i.color)),w.transparent=!0,w.map&&(w.map.wrapS=fm.RepeatWrapping,w.map.wrapT=fm.RepeatWrapping,w.color.setScalar(1)),w.userData.opacity=w.opacity}}catch(e){x.e(e)}finally{x.f()}}else t.color=new fm.Color(k.default.toColor(i.color)),t.transparent=!0,t.map&&(t.map.wrapS=fm.RepeatWrapping,t.map.wrapT=fm.RepeatWrapping,t.color.setScalar(1)),t.userData.opacity=t.opacity;var b=[];if(void 0!==t.length)for(var M=0;M<t.length;M++)b.push(t[M].clone());else b.push(t.clone());var S=new fm.Mesh(e,b),E=i.scale.split(","),T=i.rotate.split(","),A=i.translate.split(",");S.scale.set((0,R.default)(E[0]),(0,R.default)(E[2]),(0,R.default)(E[1]));var L=new fm.Vector3;if(L.set((0,R.default)(T[0])*fm.Math.DEG2RAD,(0,R.default)(T[2])*fm.Math.DEG2RAD,(0,R.default)(T[1])*fm.Math.DEG2RAD),S.rotation.setFromVector3(L,"YXZ"),d.add(new fm.Vector3((0,R.default)(A[0]),(0,R.default)(A[2]),(0,R.default)(A[1]))),S.position.set(d.x,d.y,d.z),a.renderNode=S,a.x=f.vertices[0].x+(0,R.default)(A[0]),a.y=f.vertices[0].y+(0,R.default)(A[1]),a.height=-1===n.height?2.2:n.height,!a._renderNode)return;a._renderNode.frustumCulled=!1,a.renderNodeInited=!0}}},{key:"findGltfMesh",value:function(e,t){if(e instanceof fm.Mesh)t(e);else{var n,r=P(e.children);try{for(r.s();!(n=r.n()).done;){var i=n.value;this.findGltfMesh(i,t)}}catch(e){r.e(e)}finally{r.f()}}}},{key:"getDynLoader",value:function(){return this._dynamicLoader}},{key:"getSceneCenter",value:function(e){return(new fm.Vector3).copy(this._scenes[e+""].center)}},{key:"forEachVertForShape",value:function(e,t){var n=0;for(t(!0,e[n],e[n+1]),n=2;n<e.length;n+=2)t(!1,e[n],e[n+1]);n=0,t(!1,e[n],e[n+1])}},{key:"getCurrentNodeCenter",value:function(e,t){for(var n=this._scenes[t],r=n.center,i=0,a=0;a<e.length;a++)i+=e[a]*n.space;return new fm.Vector3(r.x,r.y+i/e.length,0)}},{key:"getHeight",value:function(e,t){return this._scenes[""+e].getHeight(t)}},{key:"getSceneById",value:function(e){return this._scenes[""+e]}},{key:"dispose",value:function(){for(var e in this._materialManager.dispose(),this._scenes)this._scenes[e].dispose(),this._scenes[e].parent=void 0;this._map=void 0,this._scenes=void 0,this._materialManager=void 0}},{key:"disposeById",value:function(e){this._scenes[e].dispose(),this._scenes[e].parent=void 0,this._scenes[e]=void 0}},{key:"map",get:function(){return this._map}},{key:"materialManager",get:function(){return this._materialManager}}]),n}(),b=w;t.default=b},function(e,t,n){var r=n(29),i=n(153),a=n(113),o=Object.defineProperty;t.f=n(30)?Object.defineProperty:function(e,t,n){if(r(e),t=a(t,!0),r(n),i)try{return o(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){var r=n(42);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t,n){var r=n(51),i=Math.min;e.exports=function(e){return 0<e?i(r(e),9007199254740991):0}},function(e,t,n){var r=n(36),i=n(157),a=n(77),o=Object.defineProperty;t.f=n(26)?Object.defineProperty:function(e,t,n){if(r(e),t=a(t,!0),r(n),i)try{return o(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){var r=n(38),i=n(89);e.exports=n(26)?function(e,t,n){return r.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){var a=n(52);e.exports=function(r,i,e){if(a(r),void 0===i)return r;switch(e){case 1:return function(e){return r.call(i,e)};case 2:return function(e,t){return r.call(i,e,t)};case 3:return function(e,t,n){return r.call(i,e,t,n)}}return function(){return r.apply(i,arguments)}}},function(e){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,n){var a=n(28),o=n(39),s=n(53),l=n(78)("src"),r=n(251),i="toString",u=(""+r).split(i);n(93).inspectSource=function(e){return r.call(e)},(e.exports=function(e,t,n,r){var i="function"==typeof n;i&&(s(n,"name")||o(n,"name",t)),e[t]!==n&&(i&&(s(n,l)||o(n,l,e[t]?""+e[t]:u.join(String(t)))),e===a?e[t]=n:r?e[t]?e[t]=n:o(e,t,n):(delete e[t],o(e,t,n)))})(Function.prototype,i,function(){return"function"==typeof this&&this[l]||r.call(this)})},function(e,t,n){var r=n(50);e.exports=function(e){return Object(r(e))}},function(e,t,n){"use strict";if(n(26)){var _=n(94),x=n(28),w=n(23),b=n(27),M=n(182),r=n(292),p=n(88),S=n(184),i=n(89),E=n(39),a=n(183),o=n(51),T=n(37),A=n(185),s=n(92),l=n(77),u=n(53),L=n(101),R=n(42),m=n(44),v=n(293),C=n(130),I=n(172),k=n(91).f,g=n(294),c=n(78),h=n(20),f=n(295),d=n(160),y=n(177),P=n(62),N=n(63),D=n(299),O=n(161),F=n(140),B=n(300),U=n(38),G=n(115),z=U.f,V=G.f,H=x.RangeError,W=x.TypeError,j=x.Uint8Array,Y="ArrayBuffer",q="Shared"+Y,X="BYTES_PER_ELEMENT",Z="prototype",J=Array[Z],K=r.ArrayBuffer,Q=r.DataView,$=f(0),ee=f(2),te=f(3),ne=f(4),re=f(5),ie=f(6),ae=d(!0),oe=d(!1),se=P.values,le=P.keys,ue=P.entries,ce=J.lastIndexOf,he=J.reduce,fe=J.reduceRight,de=J.join,pe=J.sort,me=J.slice,ve=J.toString,ge=J.toLocaleString,ye=h("iterator"),_e=h("toStringTag"),xe=c("typed_constructor"),we=c("def_constructor"),be=M.CONSTR,Me=M.TYPED,Se=M.VIEW,Ee="Wrong length!",Te=f(1,function(e,t){return Ie(y(e,e[we]),t)}),Ae=w(function(){return 1===new j(new Uint16Array([1]).buffer)[0]}),Le=!!j&&!!j[Z].set&&w(function(){new j(1).set({})}),Re=function(e,t){var n=o(e);if(n<0||n%t)throw H("Wrong offset!");return n},Ce=function(e){if(R(e)&&Me in e)return e;throw W(e+" is not a typed array!")},Ie=function(e,t){if(!(R(e)&&xe in e))throw W("It is not a typed array constructor!");return new e(t)},ke=function(e,t){return Pe(y(e,e[we]),t)},Pe=function(e,t){for(var n=0,r=t.length,i=Ie(e,r);n<r;)i[n]=t[n++];return i},Ne=function(e,t,n){z(e,t,{get:function(){return this._d[n]}})},De=function(e,t,n){var r,i,a,o,s,l,u=m(e),c=arguments.length,h=1<c?t:void 0,f=void 0!==h,d=g(u);if(null!=d&&!v(d)){for(l=d.call(u),a=[],r=0;!(s=l.next()).done;r++)a.push(s.value);u=a}for(f&&2<c&&(h=p(h,n,2)),r=0,i=T(u.length),o=Ie(this,i);r<i;r++)o[r]=f?h(u[r],r):u[r];return o},Oe=function(){for(var e=0,t=arguments.length,n=Ie(this,t);e<t;)n[e]=arguments[e++];return n},Fe=!!j&&w(function(){ge.call(new j(1))}),Be=function(){return ge.apply(Fe?me.call(Ce(this)):Ce(this),arguments)},Ue={copyWithin:function(e,t,n){return B.call(Ce(this),e,t,2<arguments.length?n:void 0)},every:function(e,t){return ne(Ce(this),e,1<arguments.length?t:void 0)},fill:function(){return F.apply(Ce(this),arguments)},filter:function(e,t){return ke(this,ee(Ce(this),e,1<arguments.length?t:void 0))},find:function(e,t){return re(Ce(this),e,1<arguments.length?t:void 0)},findIndex:function(e,t){return ie(Ce(this),e,1<arguments.length?t:void 0)},forEach:function(e,t){$(Ce(this),e,1<arguments.length?t:void 0)},indexOf:function(e,t){return oe(Ce(this),e,1<arguments.length?t:void 0)},includes:function(e,t){return ae(Ce(this),e,1<arguments.length?t:void 0)},join:function(){return de.apply(Ce(this),arguments)},lastIndexOf:function(){return ce.apply(Ce(this),arguments)},map:function(e,t){return Te(Ce(this),e,1<arguments.length?t:void 0)},reduce:function(){return he.apply(Ce(this),arguments)},reduceRight:function(){return fe.apply(Ce(this),arguments)},reverse:function(){for(var e,t=this,n=Ce(t).length,r=Math.floor(n/2),i=0;i<r;)e=t[i],t[i++]=t[--n],t[n]=e;return t},some:function(e,t){return te(Ce(this),e,1<arguments.length?t:void 0)},sort:function(e){return pe.call(Ce(this),e)},subarray:function(e,t){var n=Ce(this),r=n.length,i=s(e,r);return new(y(n,n[we]))(n.buffer,n.byteOffset+i*n.BYTES_PER_ELEMENT,T((void 0===t?r:s(t,r))-i))}},Ge=function(e,t){return ke(this,me.call(Ce(this),e,t))},ze=function(e,t){Ce(this);var n=Re(t,1),r=this.length,i=m(e),a=T(i.length),o=0;if(r<a+n)throw H(Ee);for(;o<a;)this[n+o]=i[o++]},Ve={entries:function(){return ue.call(Ce(this))},keys:function(){return le.call(Ce(this))},values:function(){return se.call(Ce(this))}},He=function(e,t){return R(e)&&e[Me]&&"symbol"!=typeof t&&t in e&&String(+t)==String(t)},We=function(e,t){return He(e,t=l(t,!0))?i(2,e[t]):V(e,t)},je=function(e,t,n){return!(He(e,t=l(t,!0))&&R(n)&&u(n,"value"))||u(n,"get")||u(n,"set")||n.configurable||u(n,"writable")&&!n.writable||u(n,"enumerable")&&!n.enumerable?z(e,t,n):(e[t]=n.value,e)};be||(G.f=We,U.f=je),b(b.S+b.F*!be,"Object",{getOwnPropertyDescriptor:We,defineProperty:je}),w(function(){ve.call({})})&&(ve=ge=function(){return de.call(this)});var Ye=a({},Ue);a(Ye,Ve),E(Ye,ye,Ve.values),a(Ye,{slice:Ge,set:ze,constructor:function(){},toString:ve,toLocaleString:Be}),Ne(Ye,"buffer","b"),Ne(Ye,"byteOffset","o"),Ne(Ye,"byteLength","l"),Ne(Ye,"length","e"),z(Ye,_e,{get:function(){return this[Me]}}),e.exports=function(e,h,t,i){i=!!i;var f=e+(i?"Clamped":"")+"Array",r="get"+e,a="set"+e,d=x[f],o=d||{},n=d&&I(d),s=!d||!M.ABV,l={},u=d&&d[Z],c=function(e,t){var n=e._d;return n.v[r](t*h+n.o,Ae)},p=function(e,t,n){var r=e._d;i&&(n=(n=Math.round(n))<0?0:255<n?255:255&n),r.v[a](t*h+r.o,n,Ae)},m=function(e,t){z(e,t,{get:function(){return c(this,t)},set:function(e){return p(this,t,e)},enumerable:!0})};s?(d=t(function(e,t,n,r){S(e,d,f,"_d");var i,a,o,s,l=0,u=0;if(R(t)){if(!(t instanceof K||(s=L(t))==Y||s==q))return Me in t?Pe(d,t):De.call(d,t);i=t,u=Re(n,h);var c=t.byteLength;if(void 0===r){if(c%h)throw H(Ee);if(a=c-u,a<0)throw H(Ee)}else if(a=T(r)*h,c<a+u)throw H(Ee);o=a/h}else o=A(t),a=o*h,i=new K(a);for(E(e,"_d",{b:i,o:u,l:a,e:o,v:new Q(i)});l<o;)m(e,l++)}),u=d[Z]=C(Ye),E(u,"constructor",d)):w(function(){d(1)})&&w(function(){new d(-1)})&&D(function(e){new d,new d(null),new d(1.5),new d(e)},!0)||(d=t(function(e,t,n,r){var i;return S(e,d,f),R(t)?t instanceof K||(i=L(t))==Y||i==q?void 0!==r?new o(t,Re(n,h),r):void 0!==n?new o(t,Re(n,h)):new o(t):Me in t?Pe(d,t):De.call(d,t):new o(A(t))}),$(n!==Function.prototype?k(o).concat(k(n)):k(o),function(e){e in d||E(d,e,o[e])}),d[Z]=u,_||(u.constructor=d));var v=u[ye],g=!!v&&("values"==v.name||null==v.name),y=Ve.values;E(d,xe,!0),E(u,Me,f),E(u,Se,!0),E(u,we,d),(i?new d(1)[_e]==f:_e in u)||z(u,_e,{get:function(){return f}}),l[f]=d,b(b.G+b.W+b.F*(d!=o),l),b(b.S,f,{BYTES_PER_ELEMENT:h}),b(b.S+b.F*w(function(){o.of.call(d,1)}),f,{from:De,of:Oe}),X in u||E(u,X,h),b(b.P,f,Ue),O(f),b(b.P+b.F*Le,f,{set:ze}),b(b.P+b.F*!g,f,Ve),_||u.toString==ve||(u.toString=ve),b(b.P+b.F*w(function(){new d(1).slice()}),f,{slice:Ge}),b(b.P+b.F*(w(function(){return[1,2].toLocaleString()!=new d([1,2]).toLocaleString()})||!w(function(){u.toLocaleString.call([1,2])})),f,{toLocaleString:Be}),N[f]=g?v:y,_||g||E(u,ye,y)}}else e.exports=function(){}},function(e,t,n){n(45)("Float32",4,function(r){return function(e,t,n){return r(this,e,t,n)}})},function(e,t,n){var r=n(347),i=n(348),a=n(352),o=n(353);function s(e){return r(e)||i(e)||a(e)||o()}e.exports=s},function(e,t,n){var r=n(35),i=n(75);e.exports=n(30)?function(e,t,n){return r.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},function(e){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},function(e){var t=Math.ceil,n=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(0<e?n:t)(e)}},function(e){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t,n){var r=n(96);e.exports=function(e){return Object(r(e))}},function(t,e,n){var r=n(17),i=n(16);function a(e){return t.exports=a="function"==typeof i&&"symbol"==typeof r?function(e){return typeof e}:function(e){return e&&"function"==typeof i&&e.constructor===i&&e!==i.prototype?"symbol":typeof e},a(e)}t.exports=a},function(e,t,n){"use strict";var r=n(27),i=n(114),a=n(44),o=n(23),s=[].sort,l=[1,2,3];r(r.P+r.F*(o(function(){l.sort(void 0)})||!o(function(){l.sort(null)})||!n(288)(s)),"Array",{sort:function(e){return void 0===e?s.call(a(this)):s.call(a(this),i(e))}})},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(2)),o=r(n(3)),s=r(n(362)),l=r(n(201)),u=r(n(202)),c=function(){function e(){(0,a.default)(this,e),this._sceneRawData={},this._sceneDecodeData={},this._reader=new s.default,this.file_ver=1}return(0,o.default)(e,[{key:"putRawScene",value:function(e,t){this.sceneRawData[t+""]=e}},{key:"removeRawScene",value:function(e){this.sceneRawData[e+""]=void 0}},{key:"parseScene",value:function(e,t,n){var r;if(r=t?this._reader.sceneDecode(this.sceneRawData[e+""],n,e):this._reader.mapDecode(this.sceneRawData[e+""],n,e),r){t&&(r={scene:r,floors:[]});for(var i=r.scene.layerGroups,a=0;a<i.length;a++){var o=i[a];o.elevation=o.height}return r}}},{key:"parseFloor",value:function(e,t,n){var r=this._reader.floorGeoDecode(e),i=this._reader.floorBizDecode(t),a=this._reader.floorNaviDecode(n);return[r,i,a]}},{key:"isSceneHasZone",value:function(e){if(!e)return!1;var t=this._sceneDecodeData[e+""];if(!t)return!1;var n=!1;return t.floors.forEach(function(e){0<e.navi[0].naviZones.length&&(n=!0)}),n}},{key:"putDecodeScene",value:function(e,t){this.file_ver=e.scene.file_ver,this.sceneDecodeData[t+""]=e}},{key:"removeDecodeScene",value:function(e){this.sceneDecodeData[e+""]=void 0}},{key:"getRawScene",value:function(e){return this.sceneRawData[e+""]}},{key:"getDecodeScene",value:function(e){return this.sceneDecodeData[e+""]}},{key:"dispose",value:function(){for(var e in this._reader.dispose(),this.sceneRawData)this.sceneRawData[e]=void 0;for(var t in this.sceneDecodeData)this.sceneDecodeData[t]=void 0;this.sceneRawData=void 0,this.sceneDecodeData=void 0}},{key:"disposeById",value:function(e){this.sceneRawData[e]=void 0,this.sceneDecodeData[e]=void 0}},{key:"sceneRawData",get:function(){return this._sceneRawData},set:function(e){this._sceneRawData=e}},{key:"sceneDecodeData",get:function(){return this._sceneDecodeData},set:function(e){this._sceneDecodeData=e}}],[{key:"convertGeo2Geometry",value:function(e){var t=(new l.default).parse(e),n={vertices:t.toStrip(!0)};return t.hasHoles()&&(n.holes=t.toStripHoles(!0)),n}},{key:"convertArray2Geometry",value:function(e,t){var n=(new u.default).parseGeometry(e,t),r={vertices:n.toStrip(!0)};return n.hasHoles()&&(r.holes=n.toStripHoles(!0)),r}},{key:"convertGeo2Points",value:function(e){var t=(new l.default).parse(e),n={vertices:t.points};return n}},{key:"convertArrayPoints",value:function(e,t){var n=(new u.default).parse(e,t),r={vertices:n.points};return r}}]),e}(),h=c;t.default=h},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(31));n(21);var o=r(n(2)),s=r(n(3)),l=function(){function e(){(0,o.default)(this,e)}return(0,s.default)(e,null,[{key:"toColor",value:function(e){if("number"==typeof e)return e;var t=e.split(",");return 3<=t.length?(0,a.default)(t[0])<<16|(0,a.default)(t[1])<<8|(0,a.default)(t[2]):(console.error("color format error",e),0)}},{key:"toRgba",value:function(e){if("number"==typeof e)return"rgba("+(0,a.default)(255*new fm.Color(e).r)+","+(0,a.default)(255*new fm.Color(e).g)+","+(0,a.default)(255*new fm.Color(e).b)+",1)";var t=e.split(",");return 3<=t.length?"rgba("+(0,a.default)(t[0])+","+(0,a.default)(t[1])+","+(0,a.default)(t[2])+",1)":e}},{key:"bindEvent",value:function(e,a,t,o){e.addEventListener(t,function(e){var t=e||window.event,n=t.target||t.srcElement,r=t.currentTarget;for(Element.prototype.matches||(Element.prototype.matches=Element.prototype.matchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector||Element.prototype.oMatchesSelector||Element.prototype.webkitMatchesSelector||function(e){for(var t=(this.document||this.ownerDocument).querySelectorAll(e),n=t.length;0<=--n&&t.item(n)!==this;);return-1<n});n!==r;){if(n.matches(a)){var i=n;o.call(i,t)}n=n.parentNode}})}},{key:"toSceneCoord",value:function(e,t){var n=0;return t.groupID&&(n=e.getFMGroup(t.groupID).height),new fm.Vector3(t.x-e.center.x,e.center.y+n,-t.y+e.center.y)}},{key:"removeFormArray",value:function(e,t){var n=e.indexOf(t);-1<n&&e.splice(n,1)}},{key:"scrollTopAnFun",value:function(){var m,v=!1;return function t(n){var r=n.el,i=n.to,e=n.form,a=(n.time,i<e?"up":"bottom"),o=e<i?i-e:i==e?0:e-i,s=10,l=o/s,u=0,c=function(e){var t=e.val,n=e.nbak,r=e.n,i=e.elTop;return"up"==a?i+(n-r)*t:i-(n-r)*t};function h(){m=0,window.setTimeout(function(){var e=Object(n,{to:r.scrollTop});v=!1,t(e)},s+1)}var f=function(){v=!1,m=!1,0==e&&(r.scrollTop=0)},d=function e(){if(m--,m<=0)f();else{var t=function(){!1!==m&&(u=c({val:s,nbak:l,n:m,elTop:i,VDIRECTIONE:a}),u&&(r.scrollTop=u),e())};window.setTimeout(t,s)}};function p(){v?h():(v=!0,m=l,d())}p()}}},{key:"toVector",value:function(e){return e.hasOwnProperty("z")?new fm.Vector3(e.x,e.y,e.z):new fm.Vector2(e.x,e.y)}},{key:"sleep",value:function(e){for(var t=(new Date).getTime(),n=0;n<1e7&&!((new Date).getTime()-t>e);n++);}}]),e}(),u=l;t.default=u},function(e,t,n){"use strict";var r=n(253)(!0);n(122)(String,"String",function(e){this._t=String(e),this._i=0},function(){var e,t=this._t,n=this._i;return n>=t.length?{value:void 0,done:!0}:(e=r(t,n),this._i+=e.length,{value:e,done:!1})})},function(e){e.exports={}},function(e,t,n){var r=n(124),i=n(96);e.exports=function(e){return r(i(e))}},function(e,t,n){"use strict";var r=n(170),i=n(261),a=n(63),o=n(90);e.exports=n(171)(Array,"Array",function(e,t){this._t=o(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,i(1)):i(0,"keys"==t?n:"values"==t?e[n]:[n,e[n]])},"values"),a.Arguments=a.Array,r("keys"),r("values"),r("entries")},function(e){e.exports={}},function(e,t,n){var r=n(98)("meta"),i=n(22),a=n(49),o=n(35).f,s=0,l=Object.isExtensible||function(){return!0},u=!n(41)(function(){return l(Object.preventExtensions({}))}),c=function(e){o(e,r,{value:{i:"O"+ ++s,w:{}}})},h=function(e,t){if(!i(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!a(e,r)){if(!l(e))return"F";if(!t)return"E";c(e)}return e[r].i},f=function(e,t){if(!a(e,r)){if(!l(e))return!0;if(!t)return!1;c(e)}return e[r].w},d=function(e){return u&&p.NEED&&l(e)&&!a(e,r)&&c(e),e},p=e.exports={KEY:r,NEED:!1,fastKey:h,getWeak:f,onFreeze:d}},function(e,t,n){n(269);for(var r=n(19),i=n(48),a=n(60),o=n(24)("toStringTag"),s="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),l=0;l<s.length;l++){var u=s[l],c=r[u],h=c&&c.prototype;h&&!h[o]&&i(h,o,u),a[u]=a.Array}},function(e,t,n){"use strict";var S=n(36),r=n(44),E=n(37),T=n(51),A=n(138),L=n(100),R=Math.max,C=Math.min,f=Math.floor,d=/\$([$&`']|\d\d?|<[^>]*>)/g,p=/\$([$&`']|\d\d?)/g,I=function(e){return void 0===e?e:String(e)};n(102)("replace",2,function(i,a,w,b){return[function(e,t){var n=i(this),r=null==e?void 0:e[a];return void 0!==r?r.call(e,n,t):w.call(String(n),e,t)},function(e,t){var n=b(w,e,this,t);if(n.done)return n.value;var r=S(e),i=String(this),a="function"==typeof t;a||(t=String(t));var o=r.global;if(o){var s=r.unicode;r.lastIndex=0}for(var l=[];;){var u=L(r,i);if(null===u)break;if(l.push(u),!o)break;var c=String(u[0]);""===c&&(r.lastIndex=A(i,E(r.lastIndex),s))}for(var h="",f=0,d=0;d<l.length;d++){u=l[d];for(var p=String(u[0]),m=R(C(T(u.index),i.length),0),v=[],g=1;g<u.length;g++)v.push(I(u[g]));var y=u.groups;if(a){var _=[p].concat(v,m,i);void 0!==y&&_.push(y);var x=String(t.apply(void 0,_))}else x=M(p,i,m,v,y,t);f<=m&&(h+=i.slice(f,m)+x,f=m+p.length)}return h+i.slice(f)}];function M(a,o,s,l,u,e){var c=s+a.length,h=l.length,t=p;return void 0!==u&&(u=r(u),t=d),w.call(e,t,function(e,t){var n;switch(t.charAt(0)){case"$":return"$";case"&":return a;case"`":return o.slice(0,s);case"'":return o.slice(c);case"<":n=u[t.slice(1,-1)];break;default:var r=+t;if(0===r)return e;if(h<r){var i=f(r/10);return 0!==i&&i<=h?void 0===l[i-1]?t.charAt(1):l[i-1]+t.charAt(1):e}n=l[r-1]}return void 0===n?"":n})}})},function(e,t,n){var f=n(40),d=n(166),p=n(167),m=n(29),v=n(97),g=n(128),y={},_={};t=e.exports=function(e,t,n,r,i){var a,o,s,l,u=i?function(){return e}:g(e),c=f(n,r,t?2:1),h=0;if("function"!=typeof u)throw TypeError(e+" is not iterable!");if(p(u)){for(a=v(e.length);h<a;h++)if(l=t?c(m(o=e[h])[0],o[1]):c(e[h]),l===y||l===_)return l}else for(s=u.call(e);!(o=s.next()).done;)if(l=d(s,c,o.value,t),l===y||l===_)return l},t.BREAK=y,t.RETURN=_},function(e,t,n){e.exports=n(289)},function(e,t,n){e.exports=n(313)},function(e,t,n){"use strict";n(109)("sub",function(e){return function(){return e(this,"sub","","")}})},function(e,t,n){"use strict";n(109)("fontsize",function(t){return function(e){return t(this,"font","size",e)}})},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0,n(56),n(85);var a=r(n(2)),o=r(n(3)),C=1e-5,_=1e-5,V=.001,s=.01,l=function(){function z(){(0,a.default)(this,z)}return(0,o.default)(z,null,[{key:"epsilon",value:function(){return V}},{key:"isZero",value:function(e){return e<C&&-C<e}},{key:"gtZero",value:function(e){return C<e}},{key:"ltZero",value:function(e){return e<-C}},{key:"pointDistanceToLine",value:function(e,t,n,r){var i,a=t.x,o=t.y,s=n.x,l=n.y,u=e.x,c=e.y,h=s-a,f=l-o,d=Math.sqrt(h*h+f*f),p=u-a,m=c-o,v=Math.sqrt(p*p+m*m);if(z.isZero(d))return r.x=t.x,r.y=t.y,i=z.isZero(v)?0:v,i;var g=h/d,y=f/d,_=g*p+y*m;if(!z.gtZero(_))return r.x=t.x,r.y=t.y,i=v,i;if(!z.ltZero(_-d)){var x=u-s,w=c-l,b=Math.sqrt(x*x+w*w);return r.x=n.x,r.y=n.y,i=b,i}var M=a+_*g,S=o+_*y,E=u-M,T=c-S,A=Math.sqrt(E*E+T*T);return r.x=M,r.y=S,i=A,i}},{key:"distanceOfTwoPoints",value:function(e,t){return e&&t?Math.sqrt((e.x-t.x)*(e.x-t.x)+(e.y-t.y)*(e.y-t.y)):Number.NaN}},{key:"isSamePoint",value:function(e,t){return Math.abs(e.x-t.x)<=_&&Math.abs(e.y-t.y)<=_}},{key:"isNearlySamePoint",value:function(e,t){return Math.abs(e.x-t.x)<=s&&Math.abs(e.y-t.y)<=s}},{key:"getPolygonInnerPoint",value:function(e){if(e&&0==e.length)return{x:0,y:0};var t=e.length;if(t<3)return e[0];var n=e[0],r=e[1],i={x:(n.x+r.x)/2,y:(n.y+r.y)/2},a=Math.atan2(r.y-n.y,r.x-n.x);a-=Math.PI/2;for(var o=3;.5<o;){var s={x:i.x+o*Math.cos(a),y:i.y+o*Math.sin(a)};if(z.isInPolygon(s,e))return s;o/=2}for(a+=Math.PI,o=3;.5<o;){var l={x:i.x+o*Math.cos(a),y:i.y+o*Math.sin(a)};if(z.isInPolygon(l,e))return l;o/=2}return{x:0,y:0}}},{key:"isInPolygon",value:function(e,t){for(var n=!1,r=t.length,i=0,a=r-1;i<r;a=i,++i){var o=t[i].x,s=t[i].y,l=t[a].x,u=t[a].y;if(o==e.x&&s==e.y||l==e.x&&u==e.y)return!0;if(s<e.y&&u>=e.y||s>=e.y&&u<e.y){var c=o+(e.y-s)*(l-o)/(u-s);if(c==e.x)return!0;c>e.x&&(n=!n)}}return n}},{key:"isInCircle",value:function(e,t,n,r){if(e.x<r[0]&&e.x>r[1])return!1;if(e.y<r[2]&&e.y>r[3])return!1;var i=n*n,a=e.x,o=e.y,s=t.x,l=t.y,u=s-a,c=l-o,h=u*u+c*c;return h<i}},{key:"isRectCross",value:function(e,t,n,r){return!(Math.max(e.x,t.x)<Math.min(n.x,r.x)||Math.max(e.y,t.y)<Math.min(n.y,r.y)||Math.max(n.x,r.x)<Math.min(e.x,t.x)||Math.max(n.y,r.y)<Math.min(e.y,t.y))}},{key:"pointIsInRect",value:function(e,t,n,r){return Math.abs(e.x-t.x)<n&&Math.abs(e.y-t.y)<r}},{key:"pointIsInRect1",value:function(e,t,n){var r=Math.min(t.x,n.x),i=Math.max(t.x,n.x),a=Math.min(t.y,n.y),o=Math.max(t.y,n.y);return!(e.x<r||e.x>i||e.y<a||e.y>o)}},{key:"cross",value:function(e,t,n){return(e.x-n.x)*(t.y-n.y)-(t.x-n.x)*(e.y-n.y)}},{key:"isLineSegmentCross",value:function(e,t,n,r){return!(Math.max(e.x,t.x)<Math.min(n.x,r.x)||Math.max(e.y,t.y)<Math.min(n.y,r.y)||Math.max(n.x,r.x)<Math.min(e.x,t.x)||Math.max(n.y,r.y)<Math.min(e.y,t.y)||z.cross(n,t,e)*z.cross(t,r,e)<0||z.cross(e,r,n)*z.cross(r,t,n)<0)}},{key:"calcCrossPoint",value:function(e,t,n,r,i){return 1!=z.isLineSegmentCross(e,t,n,r)?0:(a=(r.x-n.x)*(e.y-t.y)-(t.x-e.x)*(n.y-r.y),o=(e.y-n.y)*(t.x-e.x)*(r.x-n.x)+n.x*(r.y-n.y)*(t.x-e.x)-e.x*(t.y-e.y)*(r.x-n.x),i.x=o/a,a=(e.x-t.x)*(r.y-n.y)-(t.y-e.y)*(n.x-r.x),o=t.y*(e.x-t.x)*(r.y-n.y)+(r.x-t.x)*(r.y-n.y)*(e.y-t.y)-r.y*(n.x-r.x)*(t.y-e.y),i.y=o/a,1);var a,o}},{key:"pointInPolygon2d",value:function(e,t,n){for(var r=!1,i=null,a=null,o=0;o<n;o++)i=e[o],a=e[(o+1)%n],(i.y<t.y&&a.y>=t.y||a.y<t.y&&i.y>=t.y)&&(i.x<=t.x||a.x<=t.x)&&i.x+(t.y-i.y)/(a.y-i.y)*(a.x-i.x)<t.x&&(r=!r);return r}},{key:"pointInPolygon2d1",value:function(e,t,n){for(var r=0,i=null,a=null,o=null,s=0;s<n;s++)if(i=e[s],a=e[(s+1)%n],(i.y<t.y&&a.y>=t.y||a.y<t.y&&i.y>=t.y)&&(i.x<=t.x||a.x<=t.x)){if(o=i.x+(t.y-i.y)/(a.y-i.y)*(a.x-i.x),Math.abs(o-t.x)<=V)return 2;o<t.x&&(r=!r)}return r}},{key:"pointInPolygonVector2d",value:function(e,t,n){for(var r=!1,i=null,a=null,o=0,s=n/2,l=0;l<s;l++)o=2*l,i={x:e[o],y:e[o+1]},a={x:e[(o+2)%n],y:e[(o+3)%n]},(i.y<t.y&&a.y>=t.y||a.y<t.y&&i.y>=t.y)&&(i.x<=t.x||a.x<=t.x)&&i.x+(t.y-i.y)/(a.y-i.y)*(a.x-i.x)<t.x&&(r=!r);return r}},{key:"pointToSegmentDistance",value:function(e,t,n){var r=e.x,i=e.y,a=t.x,o=t.y,s=n.x,l=n.y,u=(s-a)*(r-a)+(l-o)*(i-o);if(u<=0)return Math.sqrt((r-a)*(r-a)+(i-o)*(i-o));var c=(s-a)*(s-a)+(l-o)*(l-o);if(c<=u)return Math.sqrt((r-s)*(r-s)+(i-l)*(i-l));var h=u/c,f=a+(s-a)*h,d=o+(l-o)*h;return Math.sqrt((r-f)*(r-f)+(d-i)*(d-i))}},{key:"pointToPolygon2d",value:function(e,t,n){for(var r=null,i=null,a=Number.MAX_VALUE,o=0;o<n;o++){r=e[o],i=e[(o+1)%n];var s=z.pointToSegmentDistance(t,r,i);s<a&&(a=s)}return a}},{key:"lineInCircle2d",value:function(e,t,n,r,i){if(e.x<i[0]&&t.x<i[0])return!1;if(e.x>i[1]&&t.x>i[1])return!1;if(e.y<i[2]&&t.y<i[2])return!1;if(e.y>i[3]&&t.y>i[3])return!1;var a=r*r,o=e.x,s=e.y,l=t.x,u=t.y,c=n.x,h=n.y,f=l-o,d=u-s,p=f*f+d*d,m=c-o,v=h-s,g=m*m+v*v;if(z.isZero(p))return!!z.isZero(g)||g<a;p=Math.sqrt(p);var y=f/p,_=d/p,x=y*m+_*v;if(!z.gtZero(x))return g<a;if(!z.ltZero(x-p)){var w=c-l,b=h-u,M=w*w+b*b;return M<a}var S=o+x*y,E=s+x*_,T=c-S,A=h-E,L=T*T+A*A;return L<a}},{key:"lineInPolygon2d",value:function(e,t,n,r){if(e.x<r[0]&&t.x<r[0])return!1;if(e.x>r[1]&&t.x>r[1])return!1;if(e.y<r[2]&&t.y<r[2])return!1;if(e.y>r[3]&&t.y>r[3])return!1;var i=n.length;if(z.pointInPolygon2d(n,e,i))return!0;if(z.pointInPolygon2d(n,t,i))return!0;for(var a=0;a<i;a++){var o=(a+1)%i;if(z.isLineSegmentCross(e,t,n[a],n[o]))return!0}return!1}},{key:"calcLineCircleCrossPoints2d",value:function(e,t,n,r,i){if(e.x<i[0]&&t.x<i[0])return null;if(e.x>i[1]&&t.x>i[1])return null;if(e.y<i[2]&&t.y<i[2])return null;if(e.y>i[3]&&t.y>i[3])return null;var a={isContain:!1,crossPoints:[]},o=r*r,s=e.x,l=e.y,u=t.x,c=t.y,h=n.x,f=n.y,d=u-s,p=c-l,m=d*d+p*p,v=h-s,g=f-l,y=v*v+g*g,_=h-u,x=f-c,w=_*_+x*x;if(z.isZero(m))return(z.isZero(y)||y<o)&&(a.isContain=!0,a.crossPoints=[e,t]),a;if(y<o&&w<o)return a.isContain=!0,a.crossPoints=[e,t],a;var b=Math.sqrt(m),M=d/b,S=p/b,E=v*M+g*S,T=E*E,A=v*v+g*g;if(o-A+T<0)return null;var L=Math.sqrt(o-A+T),R=E-L;return-C<+R&&R-b<C&&a.crossPoints.push({x:s+R*M,y:l+R*S}),R=E+L,-C<+R&&R-b<C&&a.crossPoints.push({x:s+R*M,y:l+R*S}),a}},{key:"calcLinePolygonCrossPoints2d",value:function(e,t,n,r){if(e.x<r[0]&&t.x<r[0])return null;if(e.x>r[1]&&t.x>r[1])return null;if(e.y<r[2]&&t.y<r[2])return null;if(e.y>r[3]&&t.y>r[3])return null;var i={containType:0,crossPoints:[]},a=n.length;z.pointInPolygon2d(n,e,a)&&(i.containType|=1),z.pointInPolygon2d(n,t,a)&&(i.containType|=2);for(var o=[],s=0;s<a;s++){var l=(s+1)%a,u={};if(z.calcCrossPoint(e,t,n[s],n[l],u)){var c=u.x-e.x,h=u.y-e.y;o.push({dis2:c*c+h*h,point:u})}}if(0==o.length)return null;o.sort(function(e,t){return t.dis2-e.dis2});for(var f=0;f<o.length;f++)i.crossPoints.push(o[f].point);return i}},{key:"calcCenterOfGravityPoint",value:function(e,t){for(var n=0,r=0,i=0,a=0;a<t;a++){var o=e[a],s=e[(a+1)%t],l=(o.x*s.y-o.y*s.x)/2;n+=l,r+=l*(o.x+s.x)/3,i+=l*(o.y+s.y)/3}return r/=n,i/=n,{x:r,y:i}}},{key:"calcPolygonArea2d",value:function(e){var t=e.length;if(t<3)return 0;for(var n=0,r=0;r<t;++r){var i=e[r],a=e[(r+1)%t];n+=i.x*a.y-i.y*a.x}return Math.abs(n/2)}},{key:"quickRayIntersect",value:function(e,t,n,r,i){var a=Math.min(n.x,r.x),o=Math.max(n.x,r.x),s=Math.min(n.y,r.y),l=Math.max(n.y,r.y),u=e.x,c=e.y,h=n.x,f=n.y,d=r.x,p=r.y;if(90==t){if(e.x<a||e.x>o)return!1;var m=(p-f)/(d-h),v=m*(u-h)+f;return i.y=v,i.x=u,!(v<c||!z.pointIsInRect1(i,n,r))}if(270==t){if(e.x<a||e.x>o)return!1;var g=(p-f)/(d-h),y=g*(u-h)+f;return i.y=y,i.x=u,!(c<y||!z.pointIsInRect1(i,n,r))}if(270!=t&&90!=t&&o-a<V){var _=a,x=Math.tan(t/180*Math.PI),w=x*(_-u)+c;if(i.y=w,i.x=_,z.pointIsInRect1(i,n,r)){var b=_-u,M=w-c,S=b/Math.sqrt(b*b+M*M),E=Math.cos(t/180*Math.PI);return 0<S*E}}if(l-s<=1e-6){var T=s,A=Math.tan(t/180*Math.PI),L=1/A*(T-c)+u;if(i.x=L,i.y=T,z.pointIsInRect1(i,n,r)){var R=L-u,C=T-c,I=R/Math.sqrt(R*R+C*C),k=Math.cos(t/180*Math.PI);return 0<I*k}return!1}var P=Math.tan(t/180*Math.PI),N=(p-f)/(d-h),D=(f-c-(N*h-P*u))/(P-N),O=c+P*(D-u);if(i.x=D,i.y=O,z.pointIsInRect1(i,n,r)){var F=D-u,B=O-c,U=F/Math.sqrt(F*F+B*B),G=Math.cos(t/180*Math.PI);return 0<U*G}return!1}},{key:"calcFootOfUpright",value:function(e,t,n,r){var i=Math.min(t.x,n.x),a=Math.max(t.x,n.x),o=Math.min(t.y,n.y),s=Math.max(t.y,n.y),l=e.x,u=e.y,c=t.x,h=t.y,f=n.x,d=n.y;if(Math.abs(c-f)<_)return r.x=c,r.y=u,o<=u&&u<=s;if(Math.abs(h-d)<_)return r.x=l,r.y=h,i<=l&&l<=a;var p=(d-h)/(f-c),m=-1/p,v=(d-h)/(f-c),g=(h-u-(v*c-m*l))/(m-v),y=u+m*(g-l);return r.x=g,r.y=y,!!z.pointIsInRect1(r,t,n)}},{key:"vectorCross",value:function(e,t){return{x:e.y*t.z-e.z*t.y,y:e.z*t.x-e.x*t.z,z:e.x*t.y-e.y*t.x}}},{key:"vectorDot",value:function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z}},{key:"vectorLength",value:function(e){return Math.sqrt(e.x*e.x+e.y*e.y+e.z*e.z)}},{key:"vector2DDot",value:function(e,t){return e.x*t.x+e.y*t.y}},{key:"vector2DLength",value:function(e){return Math.sqrt(e.x*e.x+e.y*e.y)}},{key:"calcRotateAngle",value:function(e,t){var n={x:e.x,y:e.y,z:0},r={x:t.x,y:t.y,z:0},i=z.vectorCross(n,r),a=z.vector2DDot(e,t),o=Math.acos(a/(z.vector2DLength(e)*z.vector2DLength(t)));return 0<i.z?o/Math.PI*180:360-o/Math.PI*180}},{key:"isPointOnSegment",value:function(e,t,n){return(e.x-t.x)*(n.y-t.y)==(n.x-t.x)*(e.y-t.y)&&Math.min(t.x,n.x)<=e.x&&e.x<=Math.max(t.x,n.x)&&Math.min(t.y,n.y)<=e.y&&e.y<=Math.max(t.y,n.y)}}]),z}(),u=l;t.default=u},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var u=r(n(32)),c=r(n(2)),a=r(n(3)),o=function(){function l(e,t,n,r,i){var a=2<arguments.length&&void 0!==n?arguments[2]:1e3,o=3<arguments.length?r:void 0,s=4<arguments.length?i:void 0;(0,c.default)(this,l),this._left=(0,u.default)({},e),this._right=(0,u.default)({},t),this._time=a,this._enable=!1,this._countTime=0,this._endBack=o,this._runBack=s,this.speed=1,this._result=(0,u.default)({},e)}return(0,a.default)(l,[{key:"run",value:function(e){var t=e*this.speed,n={};if(this._countTime+t>this._time){for(var r in this._left){var i=(this._right[r]-this._left[r])*(this._time-this._countTime)/this._time;this._result[r]+=i,n[r]=i}return this._enable=!1,this._runBack(this._result,n),this._endBack(this._result,n),this._result={},void(this._countTime=0)}for(var a in this._left){var o=(this._right[a]-this._left[a])*t/this._time;this._result[a]+=o,n[a]=o}this._countTime+=t,this._runBack(this._result,n)}},{key:"pause",value:function(){return this._enable=!1,this}},{key:"resume",value:function(){return this._enable=!0,this}},{key:"stop",value:function(){return this._enable=!1,this._countTime=0,this._result=(0,u.default)({},this._left),this}},{key:"start",value:function(){return this._enable=!0,this}},{key:"enable",get:function(){return this._enable},set:function(e){this._enable=e}}]),l}(),s=o;t.default=s},function(e,t,n){"use strict";var r=n(0);r(t,"__esModule",{value:!0}),t.mapOptionMessage=t.tileMessage=t.cerityMessage=void 0;var i={warn_nokey:"key%E5%80%BC%E6%9C%AA%E9%85%8D%E7%BD%AE%EF%BC%8C%E8%AF%B7%E8%AE%BF%E9%97%AE%E8%9C%82%E9%B8%9F%E4%BA%91%E6%8E%A7%E5%88%B6%E5%8F%B0%E6%9F%A5%E7%9C%8B%E5%BA%94%E7%94%A8%E5%90%8D%E7%A7%B0%E3%80%82",warn_noappname:"%E5%BA%94%E7%94%A8%E5%90%8D%E7%A7%B0%EF%BC%88appname%EF%BC%89%E6%9C%AA%E9%85%8D%E7%BD%AE%EF%BC%8C%E8%AF%B7%E8%AE%BF%E9%97%AE%E8%9C%82%E9%B8%9F%E4%BA%91%E6%8E%A7%E5%88%B6%E5%8F%B0%E6%9F%A5%E7%9C%8B%E5%BA%94%E7%94%A8%E5%90%8D%E7%A7%B0%E3%80%82",warn_nomapid:"%E5%9C%B0%E5%9B%BEID%E6%9C%AA%E9%85%8D%E7%BD%AE%EF%BC%8C%E8%AF%B7%E8%AE%BF%E9%97%AE%E8%9C%82%E9%B8%9F%E4%BA%91%E6%8E%A7%E5%88%B6%E5%8F%B0%E6%9F%A5%E7%9C%8B%E5%9C%B0%E5%9B%BEID%E3%80%82",warn_keynotright:"%E6%82%A8%E9%85%8D%E7%BD%AE%E7%9A%84key%E5%80%BC%E4%B8%8D%E6%AD%A3%E7%A1%AE%EF%BC%8C%E8%AF%B7%E8%AE%BF%E9%97%AE%E8%9C%82%E9%B8%9F%E4%BA%91%E6%8E%A7%E5%88%B6%E5%8F%B0%E6%A3%80%E6%9F%A5%E6%AD%A4%E5%BA%94%E7%94%A8%E4%B8%8B%E7%9A%84key%E5%80%BC%E3%80%82",warn_offline:"%E6%82%A8%E9%85%8D%E7%BD%AE%E7%9A%84%E5%BA%94%E7%94%A8%E5%90%8D%E7%A7%B0%EF%BC%88appname%EF%BC%89%E6%88%96key%E5%80%BC%E4%B8%8D%E6%AD%A3%E7%A1%AE%EF%BC%8C%E8%AF%B7%E8%AE%BF%E9%97%AE%E8%9C%82%E9%B8%9F%E4%BA%91%E6%8E%A7%E5%88%B6%E5%8F%B0%E6%A3%80%E6%9F%A5%E6%82%A8%E7%9A%84%E5%BA%94%E7%94%A8%E3%80%82",warn_openerror:"%E6%96%87%E4%BB%B6%E8%A7%A3%E6%9E%90%E5%A4%B1%E8%B4%A5",warn_connecterror:"%E6%97%A0%E6%B3%95%E8%BF%9E%E6%8E%A5%E5%88%B0%E8%9C%82%E9%B8%9F%E4%BA%91",warn_downloaderror:"%E4%BB%8E%E8%9C%82%E9%B8%9F%E4%BA%91%E4%B8%8A%E8%8E%B7%E5%BE%97%E5%9C%B0%E5%9B%BE%E6%95%B0%E6%8D%AE%E5%A4%B1%E8%B4%A5",warn_local:"%E6%9C%AC%E5%9C%B0%E9%AA%8C%E8%AF%81%E5%A4%B1%E8%B4%A5"};t.cerityMessage=i;var a={noGroup:"目标楼层未初始化,请检查楼层id是否越界,或者等待楼层加载!",noFocus:"焦点层不在可视楼层中,请检查焦点层和可视楼层的参数设置!"};t.tileMessage=a;var o={defaultViewCenterError:"地图初始化中心位置错误,请检查fengmap.FMMap初始化参数defaultViewCenter的正确性"};t.mapOptionMessage=o},function(e){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e){var t={}.toString;e.exports=function(e){return t.call(e).slice(8,-1)}},function(e,t,n){var i=n(42);e.exports=function(e,t){if(!i(e))return e;var n,r;if(t&&"function"==typeof(n=e.toString)&&!i(r=n.call(e)))return r;if("function"==typeof(n=e.valueOf)&&!i(r=n.call(e)))return r;if(!t&&"function"==typeof(n=e.toString)&&!i(r=n.call(e)))return r;throw TypeError("Can't convert object to primitive value")}},function(e){var t=0,n=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++t+n).toString(36))}},function(e){e.exports=!0},function(e,t,a){var r=a(29),i=a(162),o=a(127),s=a(125)("IE_PROTO"),l=function(){},u="prototype",c=function(){var e,t=a(112)("iframe"),n=o.length,r="<",i=">";for(t.style.display="none",a(164).appendChild(t),t.src="javascript:",e=t.contentWindow.document,e.open(),e.write(r+"script"+i+"document.F=Object"+r+"/script"+i),e.close(),c=e.F;n--;)delete c[u][o[n]];return c()};e.exports=Object.create||function(e,t){var n;return null!==e?(l[u]=r(e),n=new l,l[u]=null,n[s]=e):n=c(),void 0===t?n:i(n,t)}},function(e,t,n){var r=n(163),i=n(127);e.exports=Object.keys||function(e){return r(e,i)}},function(e){var t={}.toString;e.exports=function(e){return t.call(e).slice(8,-1)}},function(e,t,n){var r=n(35).f,i=n(49),a=n(24)("toStringTag");e.exports=function(e,t,n){e&&!i(e=n?e:e.prototype,a)&&r(e,a,{configurable:!0,value:t})}},function(e,t,n){var r=n(22);e.exports=function(e,t){if(!r(e)||e._t!==t)throw TypeError("Incompatible receiver, "+t+" required!");return e}},function(e,t,n){"use strict";var r=n(28),i=n(53),a=n(76),o=n(155),c=n(77),s=n(23),l=n(91).f,u=n(115).f,h=n(38).f,f=n(332).trim,d="Number",p=r[d],m=p,v=p.prototype,g=a(n(130)(v))==d,y="trim"in String.prototype,_=function(e){var t=c(e,!1);if("string"==typeof t&&2<t.length){t=y?t.trim():f(t,3);var n,r,i,a=t.charCodeAt(0);if(43===a||45===a){if(n=t.charCodeAt(2),88===n||120===n)return NaN}else if(48===a){switch(t.charCodeAt(1)){case 66:case 98:r=2,i=49;break;case 79:case 111:r=8,i=55;break;default:return+t}for(var o,s=t.slice(2),l=0,u=s.length;l<u;l++)if(o=s.charCodeAt(l),o<48||i<o)return NaN;return parseInt(s,r)}}return+t};if(!p(" 0o1")||!p("0b1")||p("+0x1")){p=function(e){var t=arguments.length<1?0:e,n=this;return n instanceof p&&(g?s(function(){v.valueOf.call(n)}):a(n)!=d)?o(new m(_(t)),n,p):_(t)};for(var x,w=n(26)?l(m):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),b=0;w.length>b;b++)i(m,x=w[b])&&!i(p,x)&&h(p,x,u(m,x));p.prototype=v,v.constructor=p,n(43)(r,d,p)}},function(e,t,n){"use strict";var r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var i={ZH:"zh",EN:"en",CHN:"zh"},a=i;t.default=a},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(2)),o=r(n(3)),s=function(){function e(){(0,a.default)(this,e),this.currentModel=null,this.isToggleViewMode=!1,this.externalLoadingCount=0}return(0,o.default)(e,[{key:"dispose",value:function(e){for(var t in this[e])this[e][t]=void 0}}]),e}(),l=new s,u=l;t.default=u},function(e,t,n){var a=n(114);e.exports=function(r,i,e){if(a(r),void 0===i)return r;switch(e){case 1:return function(e){return r.call(i,e)};case 2:return function(e,t){return r.call(i,e,t)};case 3:return function(e,t,n){return r.call(i,e,t,n)}}return function(){return r.apply(i,arguments)}}},function(e){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,n){var r=n(116),i=n(50);e.exports=function(e){return r(i(e))}},function(e,t,n){var r=n(159),i=n(119).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,i)}},function(e,t,n){var r=n(51),i=Math.max,a=Math.min;e.exports=function(e,t){return e=r(e),e<0?i(e+t,0):a(e,t)}},function(e){var t=e.exports={version:"2.6.11"};"number"==typeof __e&&(__e=t)},function(e){e.exports=!1},function(e,t,n){"use strict";var r=n(36);e.exports=function(){var e=r(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}},function(e){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){var r=n(121),i=Math.min;e.exports=function(e){return 0<e?i(r(e),9007199254740991):0}},function(e){var t=0,n=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++t+n).toString(36))}},function(e,t,n){var i=n(82),a=n(24)("toStringTag"),o="Arguments"==i(function(){return arguments}()),s=function(e,t){try{return e[t]}catch(e){}};e.exports=function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=s(t=Object(e),a))?n:o?i(t):"Object"==(r=i(t))&&"function"==typeof t.callee?"Arguments":r}},function(e,t,n){"use strict";var i=n(101),a=RegExp.prototype.exec;e.exports=function(e,t){var n=e.exec;if("function"==typeof n){var r=n.call(e,t);if("object"!=typeof r)throw new TypeError("RegExp exec method returned something other than an Object or null");return r}if("RegExp"!==i(e))throw new TypeError("RegExp#exec called on incompatible receiver");return a.call(e,t)}},function(e,t,n){var i=n(76),a=n(20)("toStringTag"),o="Arguments"==i(function(){return arguments}()),s=function(e,t){try{return e[t]}catch(e){}};e.exports=function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=s(t=Object(e),a))?n:o?i(t):"Object"==(r=i(t))&&"function"==typeof t.callee?"Arguments":r}},function(e,t,n){"use strict";n(260);var c=n(43),h=n(39),f=n(23),d=n(50),p=n(20),m=n(129),v=p("species"),g=!f(function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}),y=function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2===n.length&&"a"===n[0]&&"b"===n[1]}();e.exports=function(n,e,t){var r=p(n),a=!f(function(){var e={};return e[r]=function(){return 7},7!=""[n](e)}),i=a?!f(function(){var e=!1,t=/a/;return t.exec=function(){return e=!0,null},"split"===n&&(t.constructor={},t.constructor[v]=function(){return t}),t[r](""),!e}):void 0;if(!a||!i||"replace"===n&&!g||"split"===n&&!y){var o=/./[r],s=t(d,r,""[n],function(e,t,n,r,i){return t.exec===m?a&&!i?{done:!0,value:o.call(t,n,r)}:{done:!0,value:e.call(n,t,r)}:{done:!1}}),l=s[0],u=s[1];c(String.prototype,n,l),h(RegExp.prototype,r,2==e?function(e,t){return u.call(e,this,t)}:function(e){return u.call(e,this)})}}},function(e,t,n){for(var r=n(62),i=n(131),a=n(43),o=n(28),s=n(39),l=n(63),u=n(20),c=u("iterator"),h=u("toStringTag"),f=l.Array,d={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},p=i(d),m=0;m<p.length;m++){var v,g=p[m],y=d[g],_=o[g],x=_&&_.prototype;if(x&&(x[c]||s(x,c,f),x[h]||s(x,h,g),l[g]=f,y))for(v in r)x[v]||a(x,v,r[v],!0)}},function(e,t){t.f={}.propertyIsEnumerable},function(){},function(e,t,n){var i=n(48);e.exports=function(e,t,n){for(var r in t)n&&e[r]?e[r]=t[r]:i(e,r,t[r]);return e}},function(e){e.exports=function(e,t,n,r){if(!(e instanceof t)||void 0!==r&&r in e)throw TypeError(n+": incorrect invocation!");return e}},function(e,t,n){e.exports=n(310)},function(e,t,n){var r=n(27),i=n(23),o=n(50),s=/"/g,a=function(e,t,n,r){var i=String(o(e)),a="<"+t;return""!==n&&(a+=" "+n+'="'+String(r).replace(s,"&quot;")+'"'),a+">"+i+"</"+t+">"};e.exports=function(t,e){var n={};n[t]=e(a),r(r.P+r.F*i(function(){var e=""[t]('"');return e!==e.toLowerCase()||3<e.split('"').length}),"String",n)}},function(e,t,n){var r=n(27);r(r.P,"Array",{fill:n(140)}),n(170)("fill")},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0,n(5),n(4);var a=r(n(6)),o=r(n(2)),s=r(n(3)),l=r(n(7)),u=r(n(8)),c=r(n(9));function h(r){return function(){var e,t=(0,u.default)(r);if(f()){var n=(0,u.default)(this).constructor;e=(0,a.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,l.default)(this,e)}}function f(){if("undefined"==typeof Reflect||!a.default)return!1;if(a.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,a.default)(Date,[],function(){})),!0}catch(e){return!1}}var d=function(e){(0,c.default)(n,e);var t=h(n);function n(e){return(0,o.default)(this,n),t.call(this,e)}return(0,s.default)(n,[{key:"raycast",value:function(o,e){var h=this,f=new fm.Vector3,d=new fm.Vector3,p=new fm.Vector3,s=new fm.Vector2,l=new fm.Vector2,m=new fm.Matrix4,v=new fm.Vector3,g=new fm.Vector3,y=new fm.Vector3,_=new fm.Vector2,x=new fm.Vector2,w=new fm.Vector2,u=new fm.Vector4,b=function(e,t,n,r,i,a){s.subVectors(e,n).addScalar(.5).multiply(r),o.perspective&&!h.material.sizeAttenuation&&(u.applyMatrix4(h.modelViewMatrix),s.multiplyScalar(Math.abs(u.z))),void 0!==i?(l.x=a*s.x-i*s.y,l.y=i*s.x+a*s.y):l.copy(s),e.copy(t),e.x+=l.x,e.y+=l.y,e.applyMatrix4(m)};!function(e,t){d.setFromMatrixScale(h.matrixWorld),m.getInverse(h.modelViewMatrix).premultiply(h.matrixWorld),p.setFromMatrixPosition(h.modelViewMatrix);var n,r,i=h.material.rotation;0!==i&&(r=Math.cos(i),n=Math.sin(i));var a=h.center;b(v.set(-.5,-.5,0),p,a,d,n,r),b(g.set(.5,-.5,0),p,a,d,n,r),b(y.set(.5,.5,0),p,a,d,n,r),_.set(0,0),x.set(1,0),w.set(1,1);var o=e.ray.intersectTriangle(v,g,y,!1,f);if(null!==o||(b(g.set(-.5,.5,0),p,a,d,n,r),x.set(0,1),o=e.ray.intersectTriangle(v,y,g,!1,f),null!==o)){var s=v.clone().project(e._camera),l=g.clone().project(e._camera),u=y.clone().project(e._camera);if(!((s.x<-1||1<s.x||s.y<-1||1<s.y)&&(l.x<-1||1<l.x||l.y<-1||1<l.y)&&(u.x<-1||1<u.x||u.y<-1||1<u.y))){var c=e.ray.origin.distanceTo(f);c<e.near||c>e.far||t.push({distance:c,point:f.clone(),uv:fm.Triangle.getUV(f,v,g,y,_,x,w,new fm.Vector2),face:null,object:h})}}}(o,e)}}]),n}(fm.Sprite),p=d;t.default=p},function(e,t,n){var r=n(22),i=n(19).document,a=r(i)&&r(i.createElement);e.exports=function(e){return a?i.createElement(e):{}}},function(e,t,n){var i=n(22);e.exports=function(e,t){if(!i(e))return e;var n,r;if(t&&"function"==typeof(n=e.toString)&&!i(r=n.call(e)))return r;if("function"==typeof(n=e.valueOf)&&!i(r=n.call(e)))return r;if(!t&&"function"==typeof(n=e.toString)&&!i(r=n.call(e)))return r;throw TypeError("Can't convert object to primitive value")}},function(e){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,n){var r=n(156),i=n(89),a=n(90),o=n(77),s=n(53),l=n(157),u=Object.getOwnPropertyDescriptor;t.f=n(26)?u:function(e,t){if(e=a(e),t=o(t,!0),l)try{return u(e,t)}catch(e){}if(s(e,t))return i(!r.f.call(e,t),e[t])}},function(e,t,n){var r=n(76);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},function(e,t,n){var r=n(118)("keys"),i=n(78);e.exports=function(e){return r[e]||(r[e]=i(e))}},function(e,t,n){var r=n(93),i=n(28),a="__core-js_shared__",o=i[a]||(i[a]={});(e.exports=function(e,t){return o[e]||(o[e]=void 0!==t?t:{})})("versions",[]).push({version:r.version,mode:n(94)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},function(e){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,n){var r=n(42),i=n(76),a=n(20)("match");e.exports=function(e){var t;return r(e)&&(void 0!==(t=e[a])?!!t:"RegExp"==i(e))}},function(e){var t=Math.ceil,n=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(0<e?n:t)(e)}},function(e,t,n){"use strict";var _=n(79),x=n(14),w=n(123),b=n(48),M=n(60),S=n(254),E=n(83),T=n(165),A=n(24)("iterator"),L=!([].keys&&"next"in[].keys()),R="@@iterator",C="keys",I="values",k=function(){return this};e.exports=function(e,t,n,r,i,a,o){S(n,t,r);var s,l,u,c=function(e){if(!L&&e in p)return p[e];switch(e){case C:case I:return function(){return new n(this,e)}}return function(){return new n(this,e)}},h=t+" Iterator",f=i==I,d=!1,p=e.prototype,m=p[A]||p[R]||i&&p[i],v=m||c(i),g=i?f?c("entries"):v:void 0,y="Array"==t&&p.entries||m;if(y&&(u=T(y.call(new e)),u!==Object.prototype&&u.next&&(E(u,h,!0),_||"function"==typeof u[A]||b(u,A,k))),f&&m&&m.name!==I&&(d=!0,v=function(){return m.call(this)}),_&&!o||!L&&!d&&p[A]||b(p,A,v),M[t]=v,M[h]=k,i)if(s={values:f?v:c(I),keys:a?v:c(C),entries:g},o)for(l in s)l in p||w(p,l,s[l]);else x(x.P+x.F*(L||d),t,s);return s}},function(e,t,n){e.exports=n(48)},function(e,t,n){var r=n(82);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},function(e,t,n){var r=n(126)("keys"),i=n(98);e.exports=function(e){return r[e]||(r[e]=i(e))}},function(e,t,n){var r=n(11),i=n(19),a="__core-js_shared__",o=i[a]||(i[a]={});(e.exports=function(e,t){return o[e]||(o[e]=void 0!==t?t:{})})("versions",[]).push({version:r.version,mode:n(79)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},function(e){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,n){var r=n(99),i=n(24)("iterator"),a=n(60);e.exports=n(11).getIteratorMethod=function(e){if(null!=e)return e[i]||e["@@iterator"]||a[r(e)]}},function(e,t,n){"use strict";var r,i,o=n(95),s=RegExp.prototype.exec,l=String.prototype.replace,a=s,u="lastIndex",c=(r=/a/,i=/b*/g,s.call(r,"a"),s.call(i,"a"),0!==r[u]||0!==i[u]),h=void 0!==/()??/.exec("")[1],f=c||h;f&&(a=function(e){var t,n,r,i,a=this;return h&&(n=new RegExp("^"+a.source+"$(?!\\s)",o.call(a))),c&&(t=a[u]),r=s.call(a,e),c&&r&&(a[u]=a.global?r.index+r[0].length:t),h&&r&&1<r.length&&l.call(r[0],n,function(){for(i=1;i<arguments.length-2;i++)void 0===arguments[i]&&(r[i]=void 0)}),r}),e.exports=a},function(e,t,a){var r=a(36),i=a(263),o=a(119),s=a(117)("IE_PROTO"),l=function(){},u="prototype",c=function(){var e,t=a(158)("iframe"),n=o.length,r="<",i=">";for(t.style.display="none",a(264).appendChild(t),t.src="javascript:",e=t.contentWindow.document,e.open(),e.write(r+"script"+i+"document.F=Object"+r+"/script"+i),e.close(),c=e.F;n--;)delete c[u][o[n]];return c()};e.exports=Object.create||function(e,t){var n;return null!==e?(l[u]=r(e),n=new l,l[u]=null,n[s]=e):n=c(),void 0===t?n:i(n,t)}},function(e,t,n){var r=n(159),i=n(119);e.exports=Object.keys||function(e){return r(e,i)}},function(e,t,n){var r=n(38).f,i=n(53),a=n(20)("toStringTag");e.exports=function(e,t,n){e&&!i(e=n?e:e.prototype,a)&&r(e,a,{configurable:!0,value:t})}},function(e,t,n){var i=n(14),a=n(11),o=n(41);e.exports=function(e,t){var n=(a.Object||{})[e]||Object[e],r={};r[e]=t(n),i(i.S+i.F*o(function(){n(1)}),"Object",r)}},function(e,t,n){t.f=n(24)},function(e,t,n){var r=n(19),i=n(11),a=n(79),o=n(134),s=n(35).f;e.exports=function(e){var t=i.Symbol||(i.Symbol=!a&&r.Symbol||{});"_"==e.charAt(0)||e in t||s(t,e,{value:o.f(e)})}},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t,n){var r=n(82);e.exports=Array.isArray||function(e){return"Array"==r(e)}},function(e,t,n){"use strict";var r=n(176)(!0);e.exports=function(e,t,n){return t+(n?r(e,t).length:1)}},function(e,t,n){var _=n(40),x=n(124),w=n(54),b=n(97),r=n(283);e.exports=function(h,e){var f=1==h,d=2==h,p=3==h,m=4==h,v=6==h,g=5==h||v,y=e||r;return function(e,t,n){for(var r,i,a=w(e),o=x(a),s=_(t,n,3),l=b(o.length),u=0,c=f?y(e,l):d?y(e,0):void 0;u<l;u++)if((g||u in o)&&(r=o[u],i=s(r,u,a),h))if(f)c[u]=i;else if(i)switch(h){case 3:return!0;case 5:return r;case 6:return u;case 2:c.push(r)}else if(m)return!1;return v?-1:p||m?m:c}}},function(e,t,n){"use strict";var u=n(44),c=n(92),h=n(37);e.exports=function(e,t,n){for(var r=u(this),i=h(r.length),a=arguments.length,o=c(1<a?t:void 0,i),s=2<a?n:void 0,l=void 0===s?i:c(s,i);o<l;)r[o++]=e;return r}},function(e,t,n){n(45)("Uint16",2,function(r){return function(e,t,n){return r(this,e,t,n)}})},function(e,t,n){n(45)("Uint8",1,function(r){return function(e,t,n){return r(this,e,t,n)}})},function(e){e.exports="\t\n\v\f\r   ᠎              \u2028\u2029\ufeff"},function(e,t,n){var r=n(27);r(r.P,"String",{repeat:n(315)})},function(e,t,n){e.exports=n(316)},function(e){var n,r,t=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function o(t){if(n===setTimeout)return setTimeout(t,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}function s(t){if(r===clearTimeout)return clearTimeout(t);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{return r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var l,u=[],c=!1,h=-1;function f(){c&&l&&(c=!1,l.length?u=l.concat(u):h=-1,u.length&&d())}function d(){if(!c){var e=o(f);c=!0;for(var t=u.length;t;){for(l=u,u=[];++h<t;)l&&l[h].run();h=-1,t=u.length}l=null,c=!1,s(e)}}function p(e,t){this.fun=e,this.array=t}function m(){}t.nextTick=function(e){var t=new Array(arguments.length-1);if(1<arguments.length)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];u.push(new p(e,t)),1!==u.length||c||o(d)},p.prototype.run=function(){this.fun.apply(null,this.array)},t.title="browser",t.browser=!0,t.env={},t.argv=[],t.version="",t.versions={},t.on=m,t.addListener=m,t.once=m,t.off=m,t.removeListener=m,t.removeAllListeners=m,t.emit=m,t.prependListener=m,t.prependOnceListener=m,t.listeners=function(){return[]},t.binding=function(){throw new Error("process.binding is not supported")},t.cwd=function(){return"/"},t.chdir=function(){throw new Error("process.chdir is not supported")},t.umask=function(){return 0}},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(2)),o=r(n(3)),s=function(){function e(){(0,a.default)(this,e),this.requestMethod="GET",this._requestHeader={},this.sendData=null}return(0,o.default)(e,[{key:"getFile",value:function(e,t,n,r,i){void 0!==this._path&&(e=this._path+e);var a=new XMLHttpRequest;for(var o in a.open(this.requestMethod,e,!0),a.addEventListener("load",function(){var e=this.response;200===this.status||0===this.status||201===this.status?(0===this.status&&console.warn("FMMap FileLoader: HTTP Status 0 received."),t(e)):n(e)},!1),a.addEventListener("progress",function(){r&&r()},!1),a.addEventListener("error",function(){n()},!1),a.addEventListener("abort",function(){i&&i()},!1),void 0!==this._responseType&&(a.responseType=this._responseType),void 0!==this._withCredentials&&(a.withCredentials=this._withCredentials),a.overrideMimeType&&a.overrideMimeType(void 0!==this._mimeType?this._mimeType:"text/plain"),this._requestHeader)a.setRequestHeader(o,this._requestHeader[o]);a.send(this.sendData)}},{key:"setPath",value:function(e){return this._path=e,this}},{key:"setResponseType",value:function(e){return this._responseType=e,this}},{key:"setWithCredentials",value:function(e){return this._withCredentials=e,this}},{key:"setMimeType",value:function(e){return this._mimeType=e,this}},{key:"setRequestHeader",value:function(e){return e&&(this._requestHeader=e),this}}]),e}(),l=s;t.default=l},function(e,ae,oe){"use strict";(function(e){var t=oe(1),n=oe(0);n(ae,"__esModule",{value:!0}),ae.ProtoBuf=void 0;var T=t(oe(108));oe(103),oe(62);var A=t(oe(68));oe(21);var L=t(oe(69)),R=t(oe(13)),c=t(oe(25));oe(66),oe(10),oe(110);var C=t(oe(55));oe(142),oe(70),oe(5),oe(4);var I=t(oe(31)),k=t(oe(0));function l(e,t,n){this.low=0|e,this.high=0|t,this.unsigned=!!n}function d(e){return!0===(e&&e.__isLong__)}l.__isLong__,(0,k.default)(l.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),l.isLong=d;var a={},o={};function r(e,t){var n,r,i;return t?(e>>>=0,(i=0<=e&&e<256)&&(r=o[e],r)?r:(n=m(e,(0|e)<0?-1:0,!0),i&&(o[e]=n),n)):(e|=0,(i=-128<=e&&e<128)&&(r=a[e],r)?r:(n=m(e,e<0?-1:0,!1),i&&(a[e]=n),n))}function p(e,t){if(isNaN(e)||!isFinite(e))return t?w:x;if(t){if(e<0)return w;if(g<=e)return P}else{if(e<=-y)return N;if(y<=e+1)return E}return e<0?p(-e,t).neg():m(e%u|0,e/u|0,t)}function m(e,t,n){return new l(e,t,n)}l.fromInt=r,l.fromNumber=p,l.fromBits=m;var h=Math.pow;function f(e,t,n){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return x;if("number"==typeof t&&(n=t,t=!1),n=n||10,n<2||36<n)throw RangeError("radix");var r;if(0<(r=e.indexOf("-")))throw Error("interior hyphen");if(0===r)return f(e.substring(1),t,n).neg();for(var i=p(h(n,8)),a=x,o=0;o<e.length;o+=8){var s=Math.min(8,e.length-o),l=(0,I.default)(e.substring(o,o+s),n);if(s<8){var u=p(h(n,s));a=a.mul(u).add(p(l))}else a=a.mul(i),a=a.add(p(l))}return a.unsigned=t,a}function v(e){return e instanceof l?e:"number"==typeof e?p(e):"string"==typeof e?f(e):m(e.low,e.high,e.unsigned)}l.fromString=f,l.fromValue=v;var i=65536,s=1<<24,u=i*i,g=u*u,y=g/2,_=r(s),x=r(0);l.ZERO=x;var w=r(0,!0);l.UZERO=w;var b=r(1);l.ONE=b;var M=r(1,!0);l.UONE=M;var S=r(-1);l.NEG_ONE=S;var E=m(-1,2147483647,!1);l.MAX_VALUE=E;var P=m(-1,-1,!0);l.MAX_UNSIGNED_VALUE=P;var N=m(0,-2147483648,!1);l.MIN_VALUE=N;var D=l.prototype;D.toInt=function(){return this.unsigned?this.low>>>0:this.low},D.toNumber=function(){return this.unsigned?(this.high>>>0)*u+(this.low>>>0):this.high*u+(this.low>>>0)},D.toString=function(e){if(e=e||10,e<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(N)){var t=p(e),n=this.div(t),r=n.mul(t).sub(this);return n.toString(e)+r.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var i=p(h(e,6),this.unsigned),a=this,o="";;){var s=a.div(i),l=a.sub(s.mul(i)).toInt()>>>0,u=l.toString(e);if(a=s,a.isZero())return u+o;for(;u.length<6;)u="0"+u;o=""+u+o}},D.getHighBits=function(){return this.high},D.getHighBitsUnsigned=function(){return this.high>>>0},D.getLowBits=function(){return this.low},D.getLowBitsUnsigned=function(){return this.low>>>0},D.getNumBitsAbs=function(){if(this.isNegative())return this.eq(N)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;0<t&&0==(e&1<<t);t--);return 0!=this.high?t+33:t+1},D.isZero=function(){return 0===this.high&&0===this.low},D.isNegative=function(){return!this.unsigned&&this.high<0},D.isPositive=function(){return this.unsigned||0<=this.high},D.isOdd=function(){return 1==(1&this.low)},D.isEven=function(){return 0==(1&this.low)},D.equals=function(e){return d(e)||(e=v(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&this.high===e.high&&this.low===e.low},D.eq=D.equals,D.notEquals=function(e){return!this.eq(e)},D.neq=D.notEquals,D.lessThan=function(e){return this.comp(e)<0},D.lt=D.lessThan,D.lessThanOrEqual=function(e){return this.comp(e)<=0},D.lte=D.lessThanOrEqual,D.greaterThan=function(e){return 0<this.comp(e)},D.gt=D.greaterThan,D.greaterThanOrEqual=function(e){return 0<=this.comp(e)},D.gte=D.greaterThanOrEqual,D.compare=function(e){if(d(e)||(e=v(e)),this.eq(e))return 0;var t=this.isNegative(),n=e.isNegative();return t&&!n?-1:!t&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},D.comp=D.compare,D.negate=function(){return!this.unsigned&&this.eq(N)?N:this.not().add(b)},D.neg=D.negate,D.add=function(e){d(e)||(e=v(e));var t=this.high>>>16,n=65535&this.high,r=this.low>>>16,i=65535&this.low,a=e.high>>>16,o=65535&e.high,s=e.low>>>16,l=65535&e.low,u=0,c=0,h=0,f=0;return f+=i+l,h+=f>>>16,f&=65535,h+=r+s,c+=h>>>16,h&=65535,c+=n+o,u+=c>>>16,c&=65535,u+=t+a,u&=65535,m(h<<16|f,u<<16|c,this.unsigned)},D.subtract=function(e){return d(e)||(e=v(e)),this.add(e.neg())},D.sub=D.subtract,D.multiply=function(e){if(this.isZero())return x;if(d(e)||(e=v(e)),e.isZero())return x;if(this.eq(N))return e.isOdd()?N:x;if(e.eq(N))return this.isOdd()?N:x;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(_)&&e.lt(_))return p(this.toNumber()*e.toNumber(),this.unsigned);var t=this.high>>>16,n=65535&this.high,r=this.low>>>16,i=65535&this.low,a=e.high>>>16,o=65535&e.high,s=e.low>>>16,l=65535&e.low,u=0,c=0,h=0,f=0;return f+=i*l,h+=f>>>16,f&=65535,h+=r*l,c+=h>>>16,h&=65535,h+=i*s,c+=h>>>16,h&=65535,c+=n*l,u+=c>>>16,c&=65535,c+=r*s,u+=c>>>16,c&=65535,c+=i*o,u+=c>>>16,c&=65535,u+=t*l+n*s+r*o+i*a,u&=65535,m(h<<16|f,u<<16|c,this.unsigned)},D.mul=D.multiply,D.divide=function(e){if(d(e)||(e=v(e)),e.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?w:x;var t,n,r;if(this.eq(N)){if(e.eq(b)||e.eq(S))return N;if(e.eq(N))return b;var i=this.shr(1);return t=i.div(e).shl(1),t.eq(x)?e.isNegative()?b:S:(n=this.sub(e.mul(t)),r=t.add(n.div(e)),r)}if(e.eq(N))return this.unsigned?w:x;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();for(r=x,n=this;n.gte(e);){t=Math.max(1,Math.floor(n.toNumber()/e.toNumber()));for(var a=Math.ceil(Math.log(t)/Math.LN2),o=a<=48?1:h(2,a-48),s=p(t),l=s.mul(e);l.isNegative()||l.gt(n);)t-=o,s=p(t,this.unsigned),l=s.mul(e);s.isZero()&&(s=b),r=r.add(s),n=n.sub(l)}return r},D.div=D.divide,D.modulo=function(e){return d(e)||(e=v(e)),this.sub(this.div(e).mul(e))},D.mod=D.modulo,D.not=function(){return m(~this.low,~this.high,this.unsigned)},D.and=function(e){return d(e)||(e=v(e)),m(this.low&e.low,this.high&e.high,this.unsigned)},D.or=function(e){return d(e)||(e=v(e)),m(this.low|e.low,this.high|e.high,this.unsigned)},D.xor=function(e){return d(e)||(e=v(e)),m(this.low^e.low,this.high^e.high,this.unsigned)},D.shiftLeft=function(e){return d(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?m(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):m(0,this.low<<e-32,this.unsigned)},D.shl=D.shiftLeft,D.shiftRight=function(e){return d(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?m(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):m(this.high>>e-32,0<=this.high?0:-1,this.unsigned)},D.shr=D.shiftRight,D.shiftRightUnsigned=function(e){if(d(e)&&(e=e.toInt()),e&=63,0===e)return this;var t=this.high;if(e<32){var n=this.low;return m(n>>>e|t<<32-e,t>>>e,this.unsigned)}return m(32===e?t:t>>>e-32,0,this.unsigned)},D.shru=D.shiftRightUnsigned,D.toSigned=function(){return this.unsigned?m(this.low,this.high,!1):this},D.toUnsigned=function(){return this.unsigned?this:m(this.low,this.high,!0)};var O=function e(t,n,r){if(void 0===t&&(t=e.DEFAULT_CAPACITY),void 0===n&&(n=e.DEFAULT_ENDIAN),void 0===r&&(r=e.DEFAULT_NOASSERT),!r){if(t|=0,t<0)throw RangeError("Illegal capacity");n=!!n,r=!!r}this.buffer=0===t?B:new ArrayBuffer(t),this.view=0===t?null:new Uint8Array(this.buffer),this.offset=0,this.markedOffset=-1,this.limit=t,this.littleEndian=n,this.noAssert=r};O.VERSION="5.0.1",O.LITTLE_ENDIAN=!0,O.BIG_ENDIAN=!1,O.DEFAULT_CAPACITY=16,O.DEFAULT_ENDIAN=O.BIG_ENDIAN,O.DEFAULT_NOASSERT=!1,O.Long=l||null;var F=O.prototype;F.__isByteBuffer__,(0,k.default)(F,"__isByteBuffer__",{value:!0,enumerable:!1,configurable:!1});var B=new ArrayBuffer(0),U=String.fromCharCode;function G(e){var t=0;return function(){return t<e.length?e.charCodeAt(t++):null}}function z(){var e=[],t=[];return function(){if(0===arguments.length)return t.join("")+U.apply(String,e);1024<e.length+arguments.length&&(t.push(U.apply(String,e)),e.length=0),Array.prototype.push.apply(e,arguments)}}function V(e,t,n,r,i){var a,o,s=8*i-r-1,l=(1<<s)-1,u=l>>1,c=-7,h=n?i-1:0,f=n?-1:1,d=e[t+h];for(h+=f,a=d&(1<<-c)-1,d>>=-c,c+=s;0<c;a=256*a+e[t+h],h+=f,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=r;0<c;o=256*o+e[t+h],h+=f,c-=8);if(0===a)a=1-u;else{if(a===l)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,r),a-=u}return(d?-1:1)*o*Math.pow(2,a-r)}function H(e,t,n,r,i,a){var o,s,l,u=8*a-i-1,c=(1<<u)-1,h=c>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:a-1,p=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),t+=1<=o+h?f/l:f*Math.pow(2,1-h),2<=t*l&&(o++,l/=2),c<=o+h?(s=0,o=c):1<=o+h?(s=(t*l-1)*Math.pow(2,i),o+=h):(s=t*Math.pow(2,h-1)*Math.pow(2,i),o=0));8<=i;e[n+d]=255&s,d+=p,s/=256,i-=8);for(o=o<<i|s,u+=i;0<u;e[n+d]=255&o,d+=p,o/=256,u-=8);e[n+d-p]|=128*m}O.accessor=function(){return Uint8Array},O.allocate=function(e,t,n){return new O(e,t,n)},O.concat=function(e,t,n,r){"boolean"!=typeof t&&"string"==typeof t||(r=n,n=t,t=void 0);for(var i,a=0,o=0,s=e.length;o<s;++o)O.isByteBuffer(e[o])||(e[o]=O.wrap(e[o],t)),i=e[o].limit-e[o].offset,0<i&&(a+=i);if(0===a)return new O(0,n,r);var l,u=new O(a,n,r);for(o=0;o<s;)l=e[o++],i=l.limit-l.offset,i<=0||(u.view.set(l.view.subarray(l.offset,l.limit),u.offset),u.offset+=i);return u.limit=u.offset,u.offset=0,u},O.isByteBuffer=function(e){return!0===(e&&e.__isByteBuffer__)},O.type=function(){return ArrayBuffer},O.wrap=function(e,t,n,r){if("string"!=typeof t&&(r=n,n=t,t=void 0),"string"==typeof e)switch(void 0===t&&(t="utf8"),t){case"base64":return O.fromBase64(e,n);case"hex":return O.fromHex(e,n);case"binary":return O.fromBinary(e,n);case"utf8":return O.fromUTF8(e,n);case"debug":return O.fromDebug(e,n);default:throw Error("Unsupported encoding: "+t)}if(null===e||"object"!==(0,C.default)(e))throw TypeError("Illegal buffer");var i;if(O.isByteBuffer(e))return i=F.clone.call(e),i.markedOffset=-1,i;if(e instanceof Uint8Array)i=new O(0,n,r),0<e.length&&(i.buffer=e.buffer,i.offset=e.byteOffset,i.limit=e.byteOffset+e.byteLength,i.view=new Uint8Array(e.buffer));else if(e instanceof ArrayBuffer)i=new O(0,n,r),0<e.byteLength&&(i.buffer=e,i.offset=0,i.limit=e.byteLength,i.view=0<e.byteLength?new Uint8Array(e):null);else{if("[object Array]"!==Object.prototype.toString.call(e))throw TypeError("Illegal buffer");i=new O(e.length,n,r),i.limit=e.length;for(var a=0;a<e.length;++a)i.view[a]=e[a]}return i},F.writeBitSet=function(e,t){var n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if(!(e instanceof Array))throw TypeError("Illegal BitSet: Not an array");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}var r,i=t,a=e.length,o=a>>3,s=0;for(t+=this.writeVarint32(a,t);o--;)r=1&!!e[s++]|(1&!!e[s++])<<1|(1&!!e[s++])<<2|(1&!!e[s++])<<3|(1&!!e[s++])<<4|(1&!!e[s++])<<5|(1&!!e[s++])<<6|(1&!!e[s++])<<7,this.writeByte(r,t++);if(s<a){var l=0;for(r=0;s<a;)r|=(1&!!e[s++])<<l++;this.writeByte(r,t++)}return n?(this.offset=t,this):t-i},F.readBitSet=function(e){var t=void 0===e;t&&(e=this.offset);var n,r=this.readVarint32(e),i=r.value,a=i>>3,o=0,s=[];for(e+=r.length;a--;)n=this.readByte(e++),s[o++]=!!(1&n),s[o++]=!!(2&n),s[o++]=!!(4&n),s[o++]=!!(8&n),s[o++]=!!(16&n),s[o++]=!!(32&n),s[o++]=!!(64&n),s[o++]=!!(128&n);if(o<i){var l=0;for(n=this.readByte(e++);o<i;)s[o++]=!!(n>>l++&1)}return t&&(this.offset=e),s},F.readBytes=function(e,t){var n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+e>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+"+e+") <= "+this.buffer.byteLength)}var r=this.slice(t,t+e);return n&&(this.offset+=e),r},F.writeBytes=F.append,F.writeInt8=function(e,t){var n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=1;var r=this.buffer.byteLength;return r<t&&this.resize((r*=2)>t?r:t),--t,this.view[t]=e,n&&(this.offset+=1),this},F.writeByte=F.writeInt8,F.readInt8=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,e<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var n=this.view[e];return 128==(128&n)&&(n=-(255-n+1)),t&&(this.offset+=1),n},F.readByte=F.readInt8,F.writeUint8=function(e,t){var n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=1;var r=this.buffer.byteLength;return r<t&&this.resize((r*=2)>t?r:t),--t,this.view[t]=e,n&&(this.offset+=1),this},F.writeUInt8=F.writeUint8,F.readUint8=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,e<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var n=this.view[e];return t&&(this.offset+=1),n},F.readUInt8=F.readUint8,F.writeInt16=function(e,t){var n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=2;var r=this.buffer.byteLength;return r<t&&this.resize((r*=2)>t?r:t),t-=2,this.littleEndian?(this.view[t+1]=(65280&e)>>>8,this.view[t]=255&e):(this.view[t]=(65280&e)>>>8,this.view[t+1]=255&e),n&&(this.offset+=2),this},F.writeShort=F.writeInt16,F.readInt16=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,e<0||e+2>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+2) <= "+this.buffer.byteLength)}var n=0;return this.littleEndian?(n=this.view[e],n|=this.view[e+1]<<8):(n=this.view[e]<<8,n|=this.view[e+1]),32768==(32768&n)&&(n=-(65535-n+1)),t&&(this.offset+=2),n},F.readShort=F.readInt16,F.writeUint16=function(e,t){var n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=2;var r=this.buffer.byteLength;return r<t&&this.resize((r*=2)>t?r:t),t-=2,this.littleEndian?(this.view[t+1]=(65280&e)>>>8,this.view[t]=255&e):(this.view[t]=(65280&e)>>>8,this.view[t+1]=255&e),n&&(this.offset+=2),this},F.writeUInt16=F.writeUint16,F.readUint16=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,e<0||e+2>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+2) <= "+this.buffer.byteLength)}var n=0;return this.littleEndian?(n=this.view[e],n|=this.view[e+1]<<8):(n=this.view[e]<<8,n|=this.view[e+1]),t&&(this.offset+=2),n},F.readUInt16=F.readUint16,F.writeInt32=function(e,t){var n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=4;var r=this.buffer.byteLength;return r<t&&this.resize((r*=2)>t?r:t),t-=4,this.littleEndian?(this.view[t+3]=e>>>24&255,this.view[t+2]=e>>>16&255,this.view[t+1]=e>>>8&255,this.view[t]=255&e):(this.view[t]=e>>>24&255,this.view[t+1]=e>>>16&255,this.view[t+2]=e>>>8&255,this.view[t+3]=255&e),n&&(this.offset+=4),this},F.writeInt=F.writeInt32,F.readInt32=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,e<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}var n=0;return this.littleEndian?(n=this.view[e+2]<<16,n|=this.view[e+1]<<8,n|=this.view[e],n+=this.view[e+3]<<24>>>0):(n=this.view[e+1]<<16,n|=this.view[e+2]<<8,n|=this.view[e+3],n+=this.view[e]<<24>>>0),n|=0,t&&(this.offset+=4),n},F.readInt=F.readInt32,F.writeUint32=function(e,t){var n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=4;var r=this.buffer.byteLength;return r<t&&this.resize((r*=2)>t?r:t),t-=4,this.littleEndian?(this.view[t+3]=e>>>24&255,this.view[t+2]=e>>>16&255,this.view[t+1]=e>>>8&255,this.view[t]=255&e):(this.view[t]=e>>>24&255,this.view[t+1]=e>>>16&255,this.view[t+2]=e>>>8&255,this.view[t+3]=255&e),n&&(this.offset+=4),this},F.writeUInt32=F.writeUint32,F.readUint32=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,e<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}var n=0;return this.littleEndian?(n=this.view[e+2]<<16,n|=this.view[e+1]<<8,n|=this.view[e],n+=this.view[e+3]<<24>>>0):(n=this.view[e+1]<<16,n|=this.view[e+2]<<8,n|=this.view[e+3],n+=this.view[e]<<24>>>0),t&&(this.offset+=4),n},F.readUInt32=F.readUint32,l&&(F.writeInt64=function(e,t){var n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("number"==typeof e)e=l.fromNumber(e);else if("string"==typeof e)e=l.fromString(e);else if(!(e&&e instanceof l))throw TypeError("Illegal value: "+e+" (not an integer or Long)");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}"number"==typeof e?e=l.fromNumber(e):"string"==typeof e&&(e=l.fromString(e)),t+=8;var r=this.buffer.byteLength;r<t&&this.resize((r*=2)>t?r:t),t-=8;var i=e.low,a=e.high;return this.littleEndian?(this.view[t+3]=i>>>24&255,this.view[t+2]=i>>>16&255,this.view[t+1]=i>>>8&255,this.view[t]=255&i,t+=4,this.view[t+3]=a>>>24&255,this.view[t+2]=a>>>16&255,this.view[t+1]=a>>>8&255,this.view[t]=255&a):(this.view[t]=a>>>24&255,this.view[t+1]=a>>>16&255,this.view[t+2]=a>>>8&255,this.view[t+3]=255&a,t+=4,this.view[t]=i>>>24&255,this.view[t+1]=i>>>16&255,this.view[t+2]=i>>>8&255,this.view[t+3]=255&i),n&&(this.offset+=8),this},F.writeLong=F.writeInt64,F.readInt64=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,e<0||e+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+8) <= "+this.buffer.byteLength)}var n=0,r=0;this.littleEndian?(n=this.view[e+2]<<16,n|=this.view[e+1]<<8,n|=this.view[e],n+=this.view[e+3]<<24>>>0,e+=4,r=this.view[e+2]<<16,r|=this.view[e+1]<<8,r|=this.view[e],r+=this.view[e+3]<<24>>>0):(r=this.view[e+1]<<16,r|=this.view[e+2]<<8,r|=this.view[e+3],r+=this.view[e]<<24>>>0,e+=4,n=this.view[e+1]<<16,n|=this.view[e+2]<<8,n|=this.view[e+3],n+=this.view[e]<<24>>>0);var i=new l(n,r,!1);return t&&(this.offset+=8),i},F.readLong=F.readInt64,F.writeUint64=function(e,t){var n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("number"==typeof e)e=l.fromNumber(e);else if("string"==typeof e)e=l.fromString(e);else if(!(e&&e instanceof l))throw TypeError("Illegal value: "+e+" (not an integer or Long)");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}"number"==typeof e?e=l.fromNumber(e):"string"==typeof e&&(e=l.fromString(e)),t+=8;var r=this.buffer.byteLength;r<t&&this.resize((r*=2)>t?r:t),t-=8;var i=e.low,a=e.high;return this.littleEndian?(this.view[t+3]=i>>>24&255,this.view[t+2]=i>>>16&255,this.view[t+1]=i>>>8&255,this.view[t]=255&i,t+=4,this.view[t+3]=a>>>24&255,this.view[t+2]=a>>>16&255,this.view[t+1]=a>>>8&255,this.view[t]=255&a):(this.view[t]=a>>>24&255,this.view[t+1]=a>>>16&255,this.view[t+2]=a>>>8&255,this.view[t+3]=255&a,t+=4,this.view[t]=i>>>24&255,this.view[t+1]=i>>>16&255,this.view[t+2]=i>>>8&255,this.view[t+3]=255&i),n&&(this.offset+=8),this},F.writeUInt64=F.writeUint64,F.readUint64=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,e<0||e+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+8) <= "+this.buffer.byteLength)}var n=0,r=0;this.littleEndian?(n=this.view[e+2]<<16,n|=this.view[e+1]<<8,n|=this.view[e],n+=this.view[e+3]<<24>>>0,e+=4,r=this.view[e+2]<<16,r|=this.view[e+1]<<8,r|=this.view[e],r+=this.view[e+3]<<24>>>0):(r=this.view[e+1]<<16,r|=this.view[e+2]<<8,r|=this.view[e+3],r+=this.view[e]<<24>>>0,e+=4,n=this.view[e+1]<<16,n|=this.view[e+2]<<8,n|=this.view[e+3],n+=this.view[e]<<24>>>0);var i=new l(n,r,!0);return t&&(this.offset+=8),i},F.readUInt64=F.readUint64),F.writeFloat32=function(e,t){var n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e)throw TypeError("Illegal value: "+e+" (not a number)");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=4;var r=this.buffer.byteLength;return r<t&&this.resize((r*=2)>t?r:t),t-=4,H(this.view,e,t,this.littleEndian,23,4),n&&(this.offset+=4),this},F.writeFloat=F.writeFloat32,F.readFloat32=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,e<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}var n=V(this.view,e,this.littleEndian,23,4);return t&&(this.offset+=4),n},F.readFloat=F.readFloat32,F.writeFloat64=function(e,t){var n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e)throw TypeError("Illegal value: "+e+" (not a number)");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=8;var r=this.buffer.byteLength;return r<t&&this.resize((r*=2)>t?r:t),t-=8,H(this.view,e,t,this.littleEndian,52,8),n&&(this.offset+=8),this},F.writeDouble=F.writeFloat64,F.readFloat64=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,e<0||e+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+8) <= "+this.buffer.byteLength)}var n=V(this.view,e,this.littleEndian,52,8);return t&&(this.offset+=8),n},F.readDouble=F.readFloat64,O.MAX_VARINT32_BYTES=5,O.calculateVarint32=function(e){return e>>>=0,e<128?1:e<16384?2:e<1<<21?3:e<1<<28?4:5},O.zigZagEncode32=function(e){return((e|=0)<<1^e>>31)>>>0},O.zigZagDecode32=function(e){return e>>>1^-(1&e)|0},F.writeVarint32=function(e,t){var n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}var r,i=O.calculateVarint32(e);t+=i;var a=this.buffer.byteLength;for(a<t&&this.resize((a*=2)>t?a:t),t-=i,e>>>=0;128<=e;)r=127&e|128,this.view[t++]=r,e>>>=7;return this.view[t++]=e,n?(this.offset=t,this):i},F.writeVarint32ZigZag=function(e,t){return this.writeVarint32(O.zigZagEncode32(e),t)},F.readVarint32=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,e<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var n,r=0,i=0;do{if(!this.noAssert&&e>this.limit){var a=Error("Truncated");throw a.truncated=!0,a}n=this.view[e++],r<5&&(i|=(127&n)<<7*r),++r}while(0!=(128&n));return i|=0,t?(this.offset=e,i):{value:i,length:r}},F.readVarint32ZigZag=function(e){var t=this.readVarint32(e);return"object"===(0,C.default)(t)?t.value=O.zigZagDecode32(t.value):t=O.zigZagDecode32(t),t},l&&(O.MAX_VARINT64_BYTES=10,O.calculateVarint64=function(e){"number"==typeof e?e=l.fromNumber(e):"string"==typeof e&&(e=l.fromString(e));var t=e.toInt()>>>0,n=e.shiftRightUnsigned(28).toInt()>>>0,r=e.shiftRightUnsigned(56).toInt()>>>0;return 0==r?0==n?t<16384?t<128?1:2:t<1<<21?3:4:n<16384?n<128?5:6:n<1<<21?7:8:r<128?9:10},O.zigZagEncode64=function(e){return"number"==typeof e?e=l.fromNumber(e,!1):"string"==typeof e?e=l.fromString(e,!1):!1!==e.unsigned&&(e=e.toSigned()),e.shiftLeft(1).xor(e.shiftRight(63)).toUnsigned()},O.zigZagDecode64=function(e){return"number"==typeof e?e=l.fromNumber(e,!1):"string"==typeof e?e=l.fromString(e,!1):!1!==e.unsigned&&(e=e.toSigned()),e.shiftRightUnsigned(1).xor(e.and(l.ONE).toSigned().negate()).toSigned()},F.writeVarint64=function(e,t){var n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("number"==typeof e)e=l.fromNumber(e);else if("string"==typeof e)e=l.fromString(e);else if(!(e&&e instanceof l))throw TypeError("Illegal value: "+e+" (not an integer or Long)");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}"number"==typeof e?e=l.fromNumber(e,!1):"string"==typeof e?e=l.fromString(e,!1):!1!==e.unsigned&&(e=e.toSigned());var r=O.calculateVarint64(e),i=e.toInt()>>>0,a=e.shiftRightUnsigned(28).toInt()>>>0,o=e.shiftRightUnsigned(56).toInt()>>>0;t+=r;var s=this.buffer.byteLength;switch(s<t&&this.resize((s*=2)>t?s:t),t-=r,r){case 10:this.view[t+9]=o>>>7&1;case 9:this.view[t+8]=9!==r?128|o:127&o;case 8:this.view[t+7]=8!==r?a>>>21|128:a>>>21&127;case 7:this.view[t+6]=7!==r?a>>>14|128:a>>>14&127;case 6:this.view[t+5]=6!==r?a>>>7|128:a>>>7&127;case 5:this.view[t+4]=5!==r?128|a:127&a;case 4:this.view[t+3]=4!==r?i>>>21|128:i>>>21&127;case 3:this.view[t+2]=3!==r?i>>>14|128:i>>>14&127;case 2:this.view[t+1]=2!==r?i>>>7|128:i>>>7&127;case 1:this.view[t]=1!==r?128|i:127&i}return n?(this.offset+=r,this):r},F.writeVarint64ZigZag=function(e,t){return this.writeVarint64(O.zigZagEncode64(e),t)},F.readVarint64=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,e<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var n=e,r=0,i=0,a=0,o=0;if(o=this.view[e++],r=127&o,128&o&&(o=this.view[e++],r|=(127&o)<<7,(128&o||this.noAssert&&void 0===o)&&(o=this.view[e++],r|=(127&o)<<14,(128&o||this.noAssert&&void 0===o)&&(o=this.view[e++],r|=(127&o)<<21,(128&o||this.noAssert&&void 0===o)&&(o=this.view[e++],i=127&o,(128&o||this.noAssert&&void 0===o)&&(o=this.view[e++],i|=(127&o)<<7,(128&o||this.noAssert&&void 0===o)&&(o=this.view[e++],i|=(127&o)<<14,(128&o||this.noAssert&&void 0===o)&&(o=this.view[e++],i|=(127&o)<<21,(128&o||this.noAssert&&void 0===o)&&(o=this.view[e++],a=127&o,(128&o||this.noAssert&&void 0===o)&&(o=this.view[e++],a|=(127&o)<<7,128&o||this.noAssert&&void 0===o))))))))))throw Error("Buffer overrun");var s=l.fromBits(r|i<<28,i>>>4|a<<24,!1);return t?(this.offset=e,s):{value:s,length:e-n}},F.readVarint64ZigZag=function(e){var t=this.readVarint64(e);return t&&t.value instanceof l?t.value=O.zigZagDecode64(t.value):t=O.zigZagDecode64(t),t}),F.writeCString=function(e,t){var n=void 0===t;n&&(t=this.offset);var r,i=e.length;if(!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");for(r=0;r<i;++r)if(0===e.charCodeAt(r))throw RangeError("Illegal str: Contains NULL-characters");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}i=Y.calculateUTF16asUTF8(G(e))[1],t+=i+1;var a=this.buffer.byteLength;return a<t&&this.resize((a*=2)>t?a:t),t-=i+1,Y.encodeUTF16toUTF8(G(e),function(e){this.view[t++]=e}.bind(this)),this.view[t++]=0,n?(this.offset=t,this):i},F.readCString=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,e<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var n,r=e,i=-1;return Y.decodeUTF8toUTF16(function(){if(0===i)return null;if(e>=this.limit)throw RangeError("Illegal range: Truncated data, "+e+" < "+this.limit);return i=this.view[e++],0===i?null:i}.bind(this),n=z(),!0),t?(this.offset=e,n()):{string:n(),length:e-r}},F.writeIString=function(e,t){var n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}var r,i=t;r=Y.calculateUTF16asUTF8(G(e),this.noAssert)[1],t+=4+r;var a=this.buffer.byteLength;if(a<t&&this.resize((a*=2)>t?a:t),t-=4+r,this.littleEndian?(this.view[t+3]=r>>>24&255,this.view[t+2]=r>>>16&255,this.view[t+1]=r>>>8&255,this.view[t]=255&r):(this.view[t]=r>>>24&255,this.view[t+1]=r>>>16&255,this.view[t+2]=r>>>8&255,this.view[t+3]=255&r),t+=4,Y.encodeUTF16toUTF8(G(e),function(e){this.view[t++]=e}.bind(this)),t!==i+4+r)throw RangeError("Illegal range: Truncated data, "+t+" == "+(t+4+r));return n?(this.offset=t,this):t-i},F.readIString=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,e<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}var n=e,r=this.readUint32(e),i=this.readUTF8String(r,O.METRICS_BYTES,e+=4);return e+=i.length,t?(this.offset=e,i.string):{string:i.string,length:e-n}},O.METRICS_CHARS="c",O.METRICS_BYTES="b",F.writeUTF8String=function(e,t){var n,r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}var i=t;n=Y.calculateUTF16asUTF8(G(e))[1],t+=n;var a=this.buffer.byteLength;return a<t&&this.resize((a*=2)>t?a:t),t-=n,Y.encodeUTF16toUTF8(G(e),function(e){this.view[t++]=e}.bind(this)),r?(this.offset=t,this):t-i},F.writeString=F.writeUTF8String,O.calculateUTF8Chars=function(e){return Y.calculateUTF16asUTF8(G(e))[0]},O.calculateUTF8Bytes=function(e){return Y.calculateUTF16asUTF8(G(e))[1]},O.calculateString=O.calculateUTF8Bytes,F.readUTF8String=function(e,t,n){"number"==typeof t&&(n=t,t=void 0);var r=void 0===n;if(r&&(n=this.offset),void 0===t&&(t=O.METRICS_CHARS),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal length: "+e+" (not an integer)");if(e|=0,"number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if(n>>>=0,n<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}var i,a=0,o=n;if(t===O.METRICS_CHARS){if(i=z(),Y.decodeUTF8(function(){return a<e&&n<this.limit?this.view[n++]:null}.bind(this),function(e){++a,Y.UTF8toUTF16(e,i)}),a!==e)throw RangeError("Illegal range: Truncated data, "+a+" == "+e);return r?(this.offset=n,i()):{string:i(),length:n-o}}if(t!==O.METRICS_BYTES)throw TypeError("Unsupported metrics: "+t);if(!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if(n>>>=0,n<0||n+e>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+"+e+") <= "+this.buffer.byteLength)}var s=n+e;if(Y.decodeUTF8toUTF16(function(){return n<s?this.view[n++]:null}.bind(this),i=z(),this.noAssert),n!==s)throw RangeError("Illegal range: Truncated data, "+n+" == "+s);return r?(this.offset=n,i()):{string:i(),length:n-o}},F.readString=F.readUTF8String,F.writeVString=function(e,t){var n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if(t>>>=0,t<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}var r,i,a=t;r=Y.calculateUTF16asUTF8(G(e),this.noAssert)[1],i=O.calculateVarint32(r),t+=i+r;var o=this.buffer.byteLength;if(o<t&&this.resize((o*=2)>t?o:t),t-=i+r,t+=this.writeVarint32(r,t),Y.encodeUTF16toUTF8(G(e),function(e){this.view[t++]=e}.bind(this)),t!==a+r+i)throw RangeError("Illegal range: Truncated data, "+t+" == "+(t+r+i));return n?(this.offset=t,this):t-a},F.readVString=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,e<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var n=e,r=this.readVarint32(e),i=this.readUTF8String(r.value,O.METRICS_BYTES,e+=r.length);return e+=i.length,t?(this.offset=e,i.string):{string:i.string,length:e-n}},F.append=function(e,t,n){"number"!=typeof t&&"string"==typeof t||(n=t,t=void 0);var r=void 0===n;if(r&&(n=this.offset),!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if(n>>>=0,n<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}e instanceof O||(e=O.wrap(e,t));var i=e.limit-e.offset;if(i<=0)return this;n+=i;var a=this.buffer.byteLength;return a<n&&this.resize((a*=2)>n?a:n),n-=i,this.view.set(e.view.subarray(e.offset,e.limit),n),e.offset+=i,r&&(this.offset+=i),this},F.appendTo=function(e,t){return e.append(this,t),this},F.assert=function(e){return this.noAssert=!e,this},F.capacity=function(){return this.buffer.byteLength},F.clear=function(){return this.offset=0,this.limit=this.buffer.byteLength,this.markedOffset=-1,this},F.clone=function(e){var t=new O(0,this.littleEndian,this.noAssert);return e?(t.buffer=new ArrayBuffer(this.buffer.byteLength),t.view=new Uint8Array(t.buffer)):(t.buffer=this.buffer,t.view=this.view),t.offset=this.offset,t.markedOffset=this.markedOffset,t.limit=this.limit,t},F.compact=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||t<e||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}if(0===e&&t===this.buffer.byteLength)return this;var n=t-e;if(0===n)return this.buffer=B,this.view=null,0<=this.markedOffset&&(this.markedOffset-=e),this.offset=0,this.limit=0,this;var r=new ArrayBuffer(n),i=new Uint8Array(r);return i.set(this.view.subarray(e,t)),this.buffer=r,this.view=i,0<=this.markedOffset&&(this.markedOffset-=e),this.offset=0,this.limit=n,this},F.copy=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||t<e||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}if(e===t)return new O(0,this.littleEndian,this.noAssert);var n=t-e,r=new O(n,this.littleEndian,this.noAssert);return r.offset=0,r.limit=n,0<=r.markedOffset&&(r.markedOffset-=e),this.copyTo(r,0,e,t),r},F.copyTo=function(e,t,n,r){var i,a;if(!this.noAssert&&!O.isByteBuffer(e))throw TypeError("Illegal target: Not a ByteBuffer");if(t=(a=void 0===t)?e.offset:0|t,n=(i=void 0===n)?this.offset:0|n,r=void 0===r?this.limit:0|r,t<0||t>e.buffer.byteLength)throw RangeError("Illegal target range: 0 <= "+t+" <= "+e.buffer.byteLength);if(n<0||r>this.buffer.byteLength)throw RangeError("Illegal source range: 0 <= "+n+" <= "+this.buffer.byteLength);var o=r-n;return 0===o?e:(e.ensureCapacity(t+o),e.view.set(this.view.subarray(n,r),t),i&&(this.offset+=o),a&&(e.offset+=o),this)},F.ensureCapacity=function(e){var t=this.buffer.byteLength;return t<e?this.resize((t*=2)>e?t:e):this},F.fill=function(e,t,n){var r=void 0===t;if(r&&(t=this.offset),"string"==typeof e&&0<e.length&&(e=e.charCodeAt(0)),void 0===t&&(t=this.offset),void 0===n&&(n=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal begin: Not an integer");if(t>>>=0,"number"!=typeof n||n%1!=0)throw TypeError("Illegal end: Not an integer");if(n>>>=0,t<0||n<t||n>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+n+" <= "+this.buffer.byteLength)}if(n<=t)return this;for(;t<n;)this.view[t++]=e;return r&&(this.offset=t),this},F.flip=function(){return this.limit=this.offset,this.offset=0,this},F.mark=function(e){if(e=void 0===e?this.offset:e,!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if(e>>>=0,e<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}return this.markedOffset=e,this},F.order=function(e){if(!this.noAssert&&"boolean"!=typeof e)throw TypeError("Illegal littleEndian: Not a boolean");return this.littleEndian=!!e,this},F.LE=function(e){return this.littleEndian=void 0===e||!!e,this},F.BE=function(e){return this.littleEndian=void 0!==e&&!e,this},F.prepend=function(e,t,n){"number"!=typeof t&&"string"==typeof t||(n=t,t=void 0);var r=void 0===n;if(r&&(n=this.offset),!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if(n>>>=0,n<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}e instanceof O||(e=O.wrap(e,t));var i=e.limit-e.offset;if(i<=0)return this;var a=i-n;if(0<a){var o=new ArrayBuffer(this.buffer.byteLength+a),s=new Uint8Array(o);s.set(this.view.subarray(n,this.buffer.byteLength),i),this.buffer=o,this.view=s,this.offset+=a,0<=this.markedOffset&&(this.markedOffset+=a),this.limit+=a,n+=a}else new Uint8Array(this.buffer);return this.view.set(e.view.subarray(e.offset,e.limit),n-i),e.offset=e.limit,r&&(this.offset-=i),this},F.prependTo=function(e,t){return e.prepend(this,t),this},F.printDebug=function(e){"function"!=typeof e&&(e=console.log.bind(console)),e(this.toString()+"\n-------------------------------------------------------------------\n"+this.toDebug(!0))},F.remaining=function(){return this.limit-this.offset},F.reset=function(){return 0<=this.markedOffset?(this.offset=this.markedOffset,this.markedOffset=-1):this.offset=0,this},F.resize=function(e){if(!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal capacity: "+e+" (not an integer)");if(e|=0,e<0)throw RangeError("Illegal capacity: 0 <= "+e)}if(this.buffer.byteLength<e){var t=new ArrayBuffer(e),n=new Uint8Array(t);n.set(this.view),this.buffer=t,this.view=n}return this},F.reverse=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||t<e||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}return e===t||Array.prototype.reverse.call(this.view.subarray(e,t)),this},F.skip=function(e){if(!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal length: "+e+" (not an integer)");e|=0}var t=this.offset+e;if(!this.noAssert&&(t<0||t>this.buffer.byteLength))throw RangeError("Illegal length: 0 <= "+this.offset+" + "+e+" <= "+this.buffer.byteLength);return this.offset=t,this},F.slice=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||t<e||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}var n=this.clone();return n.offset=e,n.limit=t,n},F.toBuffer=function(e){var t=this.offset,n=this.limit;if(!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: Not an integer");if(t>>>=0,"number"!=typeof n||n%1!=0)throw TypeError("Illegal limit: Not an integer");if(n>>>=0,t<0||n<t||n>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+n+" <= "+this.buffer.byteLength)}if(!e&&0===t&&n===this.buffer.byteLength)return this.buffer;if(t===n)return B;var r=new ArrayBuffer(n-t);return new Uint8Array(r).set(new Uint8Array(this.buffer).subarray(t,n),0),r},F.toArrayBuffer=F.toBuffer,F.toString=function(e,t,n){if(void 0===e)return"ByteBufferAB(offset="+this.offset+",markedOffset="+this.markedOffset+",limit="+this.limit+",capacity="+this.capacity()+")";switch("number"==typeof e&&(e="utf8",t=e,n=t),e){case"utf8":return this.toUTF8(t,n);case"base64":return this.toBase64(t,n);case"hex":return this.toHex(t,n);case"binary":return this.toBinary(t,n);case"debug":return this.toDebug();case"columns":return this.toColumns();default:throw Error("Unsupported encoding: "+e)}};var W=function(){for(var e={},i=[65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,48,49,50,51,52,53,54,55,56,57,43,47],o=[],t=0,n=i.length;t<n;++t)o[i[t]]=t;return e.encode=function(e,t){for(var n,r;null!==(n=e());)t(i[n>>2&63]),r=(3&n)<<4,null!==(n=e())?(r|=n>>4&15,t(i[63&(r|n>>4&15)]),r=(15&n)<<2,null!==(n=e())?(t(i[63&(r|n>>6&3)]),t(i[63&n])):(t(i[63&r]),t(61))):(t(i[63&r]),t(61),t(61))},e.decode=function(e,t){var n,r,i;function a(e){throw Error("Illegal character code: "+e)}for(;null!==(n=e());)if(r=o[n],void 0===r&&a(n),null!==(n=e())&&(i=o[n],void 0===i&&a(n),t(r<<2>>>0|(48&i)>>4),null!==(n=e()))){if(r=o[n],void 0===r){if(61===n)break;a(n)}if(t((15&i)<<4>>>0|(60&r)>>2),null!==(n=e())){if(i=o[n],void 0===i){if(61===n)break;a(n)}t((3&r)<<6>>>0|i)}}},e.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)},e}();F.toBase64=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),e|=0,t|=0,e<0||t>this.capacity||t<e)throw RangeError("begin, end");var n;return W.encode(function(){return e<t?this.view[e++]:null}.bind(this),n=z()),n()},O.fromBase64=function(e,t){if("string"!=typeof e)throw TypeError("str");var n=new O(e.length/4*3,t),r=0;return W.decode(G(e),function(e){n.view[r++]=e}),n.limit=r,n},O.btoa=function(e){return O.fromBinary(e).toBase64()},O.atob=function(e){return O.fromBase64(e).toBinary()},F.toBinary=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),e|=0,t|=0,e<0||t>this.capacity()||t<e)throw RangeError("begin, end");if(e===t)return"";for(var n=[],r=[];e<t;)n.push(this.view[e++]),1024<=n.length&&(r.push(String.fromCharCode.apply(String,n)),n=[]);return r.join("")+String.fromCharCode.apply(String,n)},O.fromBinary=function(e,t){if("string"!=typeof e)throw TypeError("str");for(var n,r=0,i=e.length,a=new O(i,t);r<i;){if(n=e.charCodeAt(r),255<n)throw RangeError("illegal char code: "+n);a.view[r++]=n}return a.limit=i,a},F.toDebug=function(e){for(var t,n=-1,r=this.buffer.byteLength,i="",a="",o="";n<r;){if(-1!==n&&(t=this.view[n],i+=t<16?"0"+t.toString(16).toUpperCase():t.toString(16).toUpperCase(),e&&(a+=32<t&&t<127?String.fromCharCode(t):".")),++n,e&&0<n&&n%16==0&&n!==r){for(;i.length<51;)i+=" ";o+=i+a+"\n",i=a=""}n===this.offset&&n===this.limit?i+=n===this.markedOffset?"!":"|":n===this.offset?i+=n===this.markedOffset?"[":"<":n===this.limit?i+=n===this.markedOffset?"]":">":i+=n===this.markedOffset?"'":e||0!==n&&n!==r?" ":""}if(e&&" "!==i){for(;i.length<51;)i+=" ";o+=i+a+"\n"}return e?o:i},O.fromDebug=function(e,t,n){for(var r,i,a=e.length,o=new O((a+1)/3|0,t,n),s=0,l=0,u=!1,c=!1,h=!1,f=!1,d=!1;s<a;){switch(r=e.charAt(s++)){case"!":if(!n){if(c||h||f){d=!0;break}c=h=f=!0}o.offset=o.markedOffset=o.limit=l,u=!1;break;case"|":if(!n){if(c||f){d=!0;break}c=f=!0}o.offset=o.limit=l,u=!1;break;case"[":if(!n){if(c||h){d=!0;break}c=h=!0}o.offset=o.markedOffset=l,u=!1;break;case"<":if(!n){if(c){d=!0;break}c=!0}o.offset=l,u=!1;break;case"]":if(!n){if(f||h){d=!0;break}f=h=!0}o.limit=o.markedOffset=l,u=!1;break;case">":if(!n){if(f){d=!0;break}f=!0}o.limit=l,u=!1;break;case"'":if(!n){if(h){d=!0;break}h=!0}o.markedOffset=l,u=!1;break;case" ":u=!1;break;default:if(!n&&u){d=!0;break}if(i=(0,I.default)(r+e.charAt(s++),16),!n&&(isNaN(i)||i<0||255<i))throw TypeError("Illegal str: Not a debug encoded string");o.view[l++]=i,u=!0}if(d)throw TypeError("Illegal str: Invalid symbol at "+s)}if(!n){if(!c||!f)throw TypeError("Illegal str: Missing offset or limit");if(l<o.buffer.byteLength)throw TypeError("Illegal str: Not a debug encoded string (is it hex?) "+l+" < "+a)}return o},F.toHex=function(e,t){if(e=void 0===e?this.offset:e,t=void 0===t?this.limit:t,!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||t<e||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}for(var n,r=new Array(t-e);e<t;)n=this.view[e++],n<16?r.push("0",n.toString(16)):r.push(n.toString(16));return r.join("")},O.fromHex=function(e,t,n){if(!n){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if(e.length%2!=0)throw TypeError("Illegal str: Length not a multiple of 2")}for(var r,i=e.length,a=new O(i/2|0,t),o=0,s=0;o<i;o+=2){if(r=(0,I.default)(e.substring(o,o+2),16),!n&&(!isFinite(r)||r<0||255<r))throw TypeError("Illegal str: Contains non-hex characters");a.view[s++]=r}return a.limit=s,a};var j,Y=(j={MAX_CODEPOINT:1114111,encodeUTF8:function(e,t){var n=null;for("number"==typeof e&&(n=e,e=function(){return null});null!==n||null!==(n=e());)n<128?t(127&n):(n<2048?t(n>>6&31|192):(n<65536?t(n>>12&15|224):(t(n>>18&7|240),t(n>>12&63|128)),t(n>>6&63|128)),t(63&n|128)),n=null},decodeUTF8:function(e,t){for(var n,r,i,a,o=function(e){e=e.slice(0,e.indexOf(null));var t=Error(e.toString());throw t.name="TruncatedError",t.bytes=e,t};null!==(n=e());)if(0==(128&n))t(n);else if(192==(224&n))null===(r=e())&&o([n,r]),t((31&n)<<6|63&r);else if(224==(240&n))null!==(r=e())&&null!==(i=e())||o([n,r,i]),t((15&n)<<12|(63&r)<<6|63&i);else{if(240!=(248&n))throw RangeError("Illegal starting byte: "+n);null!==(r=e())&&null!==(i=e())&&null!==(a=e())||o([n,r,i,a]),t((7&n)<<18|(63&r)<<12|(63&i)<<6|63&a)}},UTF16toUTF8:function(e,t){for(var n,r=null;null!==(n=null!==r?r:e());)55296<=n&&n<=57343&&null!==(r=e())&&56320<=r&&r<=57343?(t(1024*(n-55296)+r-56320+65536),r=null):t(n);null!==r&&t(r)},UTF8toUTF16:function(e,t){var n=null;for("number"==typeof e&&(n=e,e=function(){return null});null!==n||null!==(n=e());)n<=65535?t(n):(n-=65536,t(55296+(n>>10)),t(n%1024+56320)),n=null},encodeUTF16toUTF8:function(e,t){j.UTF16toUTF8(e,function(e){j.encodeUTF8(e,t)})},decodeUTF8toUTF16:function(e,t){j.decodeUTF8(e,function(e){j.UTF8toUTF16(e,t)})},calculateCodePoint:function(e){return e<128?1:e<2048?2:e<65536?3:4},calculateUTF8:function(e){for(var t,n=0;null!==(t=e());)n+=t<128?1:t<2048?2:t<65536?3:4;return n},calculateUTF16asUTF8:function(e){var t=0,n=0;return j.UTF16toUTF8(e,function(e){++t,n+=e<128?1:e<2048?2:e<65536?3:4}),[t,n]}},j);F.toUTF8=function(t,n){if(void 0===t&&(t=this.offset),void 0===n&&(n=this.limit),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal begin: Not an integer");if(t>>>=0,"number"!=typeof n||n%1!=0)throw TypeError("Illegal end: Not an integer");if(n>>>=0,t<0||n<t||n>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+n+" <= "+this.buffer.byteLength)}var e;try{Y.decodeUTF8toUTF16(function(){return t<n?this.view[t++]:null}.bind(this),e=z())}catch(e){if(t!==n)throw RangeError("Illegal range: Truncated data, "+t+" != "+n)}return e()},O.fromUTF8=function(e,t,n){if(!n&&"string"!=typeof e)throw TypeError("Illegal str: Not a string");var r=new O(Y.calculateUTF16asUTF8(G(e),!0)[1],t,n),i=0;return Y.encodeUTF16toUTF8(G(e),function(e){r.view[i++]=e}),r.limit=i,r};var q,X,Z,J,K,Q,$,ee,te,ne={};function re(t){t.messages&&t.messages.forEach(function(e){e.syntax=t.syntax,re(e)}),t.enums&&t.enums.forEach(function(e){e.syntax=t.syntax})}function ie(e){var t=0;return{next:function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}}ae.ProtoBuf=ne,ne.ByteBuffer=O,ne.Long=O.Long||null,ne.VERSION="5.0.1",ne.WIRE_TYPES={},ne.WIRE_TYPES.VARINT=0,ne.WIRE_TYPES.BITS64=1,ne.WIRE_TYPES.LDELIM=2,ne.WIRE_TYPES.STARTGROUP=3,ne.WIRE_TYPES.ENDGROUP=4,ne.WIRE_TYPES.BITS32=5,ne.PACKABLE_WIRE_TYPES=[ne.WIRE_TYPES.VARINT,ne.WIRE_TYPES.BITS64,ne.WIRE_TYPES.BITS32],ne.TYPES={int32:{name:"int32",wireType:ne.WIRE_TYPES.VARINT,defaultValue:0},uint32:{name:"uint32",wireType:ne.WIRE_TYPES.VARINT,defaultValue:0},sint32:{name:"sint32",wireType:ne.WIRE_TYPES.VARINT,defaultValue:0},int64:{name:"int64",wireType:ne.WIRE_TYPES.VARINT,defaultValue:ne.Long?ne.Long.ZERO:void 0},uint64:{name:"uint64",wireType:ne.WIRE_TYPES.VARINT,defaultValue:ne.Long?ne.Long.UZERO:void 0},sint64:{name:"sint64",wireType:ne.WIRE_TYPES.VARINT,defaultValue:ne.Long?ne.Long.ZERO:void 0},bool:{name:"bool",wireType:ne.WIRE_TYPES.VARINT,defaultValue:!1},double:{name:"double",wireType:ne.WIRE_TYPES.BITS64,defaultValue:0},string:{name:"string",wireType:ne.WIRE_TYPES.LDELIM,defaultValue:""},bytes:{name:"bytes",wireType:ne.WIRE_TYPES.LDELIM,defaultValue:null},fixed32:{name:"fixed32",wireType:ne.WIRE_TYPES.BITS32,defaultValue:0},sfixed32:{name:"sfixed32",wireType:ne.WIRE_TYPES.BITS32,defaultValue:0},fixed64:{name:"fixed64",wireType:ne.WIRE_TYPES.BITS64,defaultValue:ne.Long?ne.Long.UZERO:void 0},sfixed64:{name:"sfixed64",wireType:ne.WIRE_TYPES.BITS64,defaultValue:ne.Long?ne.Long.ZERO:void 0},float:{name:"float",wireType:ne.WIRE_TYPES.BITS32,defaultValue:0},enum:{name:"enum",wireType:ne.WIRE_TYPES.VARINT,defaultValue:0},message:{name:"message",wireType:ne.WIRE_TYPES.LDELIM,defaultValue:null},group:{name:"group",wireType:ne.WIRE_TYPES.STARTGROUP,defaultValue:null}},ne.MAP_KEY_TYPES=[ne.TYPES.int32,ne.TYPES.sint32,ne.TYPES.sfixed32,ne.TYPES.uint32,ne.TYPES.fixed32,ne.TYPES.int64,ne.TYPES.sint64,ne.TYPES.sfixed64,ne.TYPES.uint64,ne.TYPES.fixed64,ne.TYPES.bool,ne.TYPES.string,ne.TYPES.bytes],ne.ID_MIN=1,ne.ID_MAX=536870911,ne.convertFieldsToCamelCase=!1,ne.populateAccessors=!0,ne.populateDefaults=!0,ne.Util=(q={},q.IS_NODE=!("object"!==(void 0===e?"undefined":(0,C.default)(e))||e+""!="[object process]"||e.browser),q.XHR=function(){for(var e=[function(){return new XMLHttpRequest},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Msxml3.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")}],t=null,n=0;n<e.length;n++){try{t=e[n]()}catch(e){continue}break}if(!t)throw Error("XMLHttpRequest is not supported");return t},q.fetch=function(e,n){if(n&&"function"!=typeof n&&(n=null),q.IS_NODE){var t=oe(364);if(n)t.readFile(e,function(e,t){n(e?null:""+t)});else try{return t.readFileSync(e)}catch(e){return null}}else{var r=q.XHR();if(r.open("GET",e,!!n),r.setRequestHeader("Accept","text/plain"),"function"==typeof r.overrideMimeType&&r.overrideMimeType("text/plain"),!n)return r.send(null),200==r.status||0==r.status&&"string"==typeof r.responseText?r.responseText:null;if(r.onreadystatechange=function(){4==r.readyState&&(200==r.status||0==r.status&&"string"==typeof r.responseText?n(r.responseText):n(null))},4==r.readyState)return;r.send(null)}},q.toCamelCase=function(e){return e.replace(/_([a-zA-Z])/g,function(e,t){return t.toUpperCase()})},q),ne.Lang={DELIM:/[\s\{\}=;:\[\],'"\(\)<>]/g,RULE:/^(?:required|optional|repeated|map)$/,TYPE:/^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,NAME:/^[a-zA-Z_][a-zA-Z_0-9]*$/,TYPEDEF:/^[a-zA-Z][a-zA-Z_0-9]*$/,TYPEREF:/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,FQTYPEREF:/^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,NUMBER:/^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,NUMBER_DEC:/^(?:[1-9][0-9]*|0)$/,NUMBER_HEX:/^0[xX][0-9a-fA-F]+$/,NUMBER_OCT:/^0[0-7]+$/,NUMBER_FLT:/^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,BOOL:/^(?:true|false)$/i,ID:/^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,NEGID:/^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,WHITESPACE:/\s/,STRING:/(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,STRING_DQ:/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,STRING_SQ:/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g},ne.DotProto=function(i,o){var e={},t=function(e){this.source=e+"",this.index=0,this.line=1,this.stack=[],this._stringOpen=null},n=t.prototype;n._readString=function(){var e='"'===this._stringOpen?o.STRING_DQ:o.STRING_SQ;e.lastIndex=this.index-1;var t=e.exec(this.source);if(!t)throw Error("unterminated string");return this.index=e.lastIndex,this.stack.push(this._stringOpen),this._stringOpen=null,t[1]},n.next=function(){if(0<this.stack.length)return this.stack.shift();if(this.index>=this.source.length)return null;if(null!==this._stringOpen)return this._readString();var e,t,n;do{for(e=!1;o.WHITESPACE.test(n=this.source.charAt(this.index));)if("\n"===n&&++this.line,++this.index===this.source.length)return null;if("/"===this.source.charAt(this.index))if(++this.index,"/"===this.source.charAt(this.index)){for(;"\n"!==this.source.charAt(++this.index);)if(this.index==this.source.length)return null;++this.index,++this.line,e=!0}else{if("*"!==(n=this.source.charAt(this.index)))return"/";do{if("\n"===n&&++this.line,++this.index===this.source.length)return null;t=n,n=this.source.charAt(this.index)}while("*"!==t||"/"!==n);++this.index,e=!0}}while(e);if(this.index===this.source.length)return null;var r=this.index;o.DELIM.lastIndex=0;var i=o.DELIM.test(this.source.charAt(r++));if(!i)for(;r<this.source.length&&!o.DELIM.test(this.source.charAt(r));)++r;var a=this.source.substring(this.index,this.index=r);return'"'!==a&&"'"!==a||(this._stringOpen=a),a},n.peek=function(){if(0===this.stack.length){var e=this.next();if(null===e)return null;this.stack.push(e)}return this.stack[0]},n.skip=function(e){var t=this.next();if(t!==e)throw Error("illegal '"+t+"', '"+e+"' expected")},n.omit=function(e){return this.peek()===e&&(this.next(),!0)},n.toString=function(){return"Tokenizer ("+this.index+"/"+this.source.length+" at line "+this.line+")"},e.Tokenizer=t;var r=function(e){this.tn=new t(e),this.proto3=!1},a=r.prototype;function s(e,t){var n=-1,r=1;if("-"==e.charAt(0)&&(r=-1,e=e.substring(1)),o.NUMBER_DEC.test(e))n=(0,I.default)(e);else if(o.NUMBER_HEX.test(e))n=(0,I.default)(e.substring(2),16);else{if(!o.NUMBER_OCT.test(e))throw Error("illegal id value: "+(r<0?"-":"")+e);n=(0,I.default)(e.substring(1),8)}if(n=r*n|0,!t&&n<0)throw Error("illegal id value: "+(r<0?"-":"")+e);return n}function l(e){var t=1;if("-"==e.charAt(0)&&(t=-1,e=e.substring(1)),o.NUMBER_DEC.test(e))return t*(0,I.default)(e,10);if(o.NUMBER_HEX.test(e))return t*(0,I.default)(e.substring(2),16);if(o.NUMBER_OCT.test(e))return t*(0,I.default)(e.substring(1),8);if("inf"===e)return t*(1/0);if("nan"===e)return NaN;if(o.NUMBER_FLT.test(e))return t*(0,c.default)(e);throw Error("illegal number value: "+(t<0?"-":"")+e)}function u(e,t,n){void 0===e[t]?e[t]=n:((0,R.default)(e[t])||(e[t]=[e[t]]),e[t].push(n))}return a.parse=function(){var e,t,n={name:"[ROOT]",package:null,messages:[],enums:[],imports:[],options:{},services:[]},r=!0;try{for(;e=this.tn.next();)switch(e){case"package":if(!r||null!==n.package)throw Error("unexpected 'package'");if(e=this.tn.next(),!o.TYPEREF.test(e))throw Error("illegal package name: "+e);this.tn.skip(";"),n.package=e;break;case"import":if(!r)throw Error("unexpected 'import'");e=this.tn.peek(),"public"!==e&&!(t="weak"===e)||this.tn.next(),e=this._readString(),this.tn.skip(";"),t||n.imports.push(e);break;case"syntax":if(!r)throw Error("unexpected 'syntax'");this.tn.skip("="),"proto3"===(n.syntax=this._readString())&&(this.proto3=!0),this.tn.skip(";");break;case"message":this._parseMessage(n,null),r=!1;break;case"enum":this._parseEnum(n),r=!1;break;case"option":this._parseOption(n);break;case"service":this._parseService(n);break;case"extend":this._parseExtend(n);break;default:throw Error("unexpected '"+e+"'")}}catch(e){throw e.message="Parse error at line "+this.tn.line+": "+e.message,e}return delete n.name,n},r.parse=function(e){return new r(e).parse()},a._readString=function(){var e,t,n="";do{if(t=this.tn.next(),"'"!==t&&'"'!==t)throw Error("illegal string delimiter: "+t);n+=this.tn.next(),this.tn.skip(t),e=this.tn.peek()}while('"'===e||'"'===e);return n},a._readValue=function(e){var t=this.tn.peek();if('"'===t||"'"===t)return this._readString();if(this.tn.next(),o.NUMBER.test(t))return l(t);if(o.BOOL.test(t))return"true"===t.toLowerCase();if(e&&o.TYPEREF.test(t))return t;throw Error("illegal value: "+t)},a._parseOption=function(e,t){var n=this.tn.next(),r=!1;if("("===n&&(r=!0,n=this.tn.next()),!o.TYPEREF.test(n))throw Error("illegal option name: "+n);var i=n;r&&(this.tn.skip(")"),i="("+i+")",n=this.tn.peek(),o.FQTYPEREF.test(n)&&(i+=n,this.tn.next())),this.tn.skip("="),this._parseOptionValue(e,i),t||this.tn.skip(";")},a._parseOptionValue=function(e,t){var n=this.tn.peek();if("{"!==n)u(e.options,t,this._readValue(!0));else for(this.tn.skip("{");"}"!==(n=this.tn.next());){if(!o.NAME.test(n))throw Error("illegal option name: "+t+"."+n);this.tn.omit(":")?u(e.options,t+"."+n,this._readValue(!0)):this._parseOptionValue(e,t+"."+n)}},a._parseService=function(e){var t=this.tn.next();if(!o.NAME.test(t))throw Error("illegal service name at line "+this.tn.line+": "+t);var n=t,r={name:n,rpc:{},options:{}};for(this.tn.skip("{");"}"!==(t=this.tn.next());)if("option"===t)this._parseOption(r);else{if("rpc"!==t)throw Error("illegal service token: "+t);this._parseServiceRPC(r)}this.tn.omit(";"),e.services.push(r)},a._parseServiceRPC=function(e){var t="rpc",n=this.tn.next();if(!o.NAME.test(n))throw Error("illegal rpc service method name: "+n);var r=n,i={request:null,response:null,request_stream:!1,response_stream:!1,options:{}};if(this.tn.skip("("),n=this.tn.next(),"stream"===n.toLowerCase()&&(i.request_stream=!0,n=this.tn.next()),!o.TYPEREF.test(n))throw Error("illegal rpc service request type: "+n);if(i.request=n,this.tn.skip(")"),n=this.tn.next(),"returns"!==n.toLowerCase())throw Error("illegal rpc service request type delimiter: "+n);if(this.tn.skip("("),n=this.tn.next(),"stream"===n.toLowerCase()&&(i.response_stream=!0,n=this.tn.next()),i.response=n,this.tn.skip(")"),n=this.tn.peek(),"{"===n){for(this.tn.next();"}"!==(n=this.tn.next());){if("option"!==n)throw Error("illegal rpc service token: "+n);this._parseOption(i)}this.tn.omit(";")}else this.tn.skip(";");void 0===e[t]&&(e[t]={}),e[t][r]=i},a._parseMessage=function(e,t){var n=!!t,r=this.tn.next(),i={name:"",fields:[],enums:[],messages:[],options:{},services:[],oneofs:{}};if(!o.NAME.test(r))throw Error("illegal "+(n?"group":"message")+" name: "+r);for(i.name=r,n&&(this.tn.skip("="),t.id=s(this.tn.next()),i.isGroup=!0),r=this.tn.peek(),"["===r&&t&&this._parseFieldOptions(t),this.tn.skip("{");"}"!==(r=this.tn.next());)if(o.RULE.test(r))this._parseMessageField(i,r);else if("oneof"===r)this._parseMessageOneOf(i);else if("enum"===r)this._parseEnum(i);else if("message"===r)this._parseMessage(i);else if("option"===r)this._parseOption(i);else if("service"===r)this._parseService(i);else if("extensions"===r)i.extensions=this._parseExtensionRanges();else if("reserved"===r)this._parseIgnored();else if("extend"===r)this._parseExtend(i);else{if(!o.TYPEREF.test(r))throw Error("illegal message token: "+r);if(!this.proto3)throw Error("illegal field rule: "+r);this._parseMessageField(i,"optional",r)}return this.tn.omit(";"),e.messages.push(i),i},a._parseIgnored=function(){for(;";"!==this.tn.peek();)this.tn.next();this.tn.skip(";")},a._parseMessageField=function(e,t,n){if(!o.RULE.test(t))throw Error("illegal message field rule: "+t);var r,i={rule:t,type:"",name:"",options:{},id:0};if("map"===t){if(n)throw Error("illegal type: "+n);if(this.tn.skip("<"),r=this.tn.next(),!o.TYPE.test(r)&&!o.TYPEREF.test(r))throw Error("illegal message field type: "+r);if(i.keytype=r,this.tn.skip(","),r=this.tn.next(),!o.TYPE.test(r)&&!o.TYPEREF.test(r))throw Error("illegal message field: "+r);if(i.type=r,this.tn.skip(">"),r=this.tn.next(),!o.NAME.test(r))throw Error("illegal message field name: "+r);i.name=r,this.tn.skip("="),i.id=s(this.tn.next()),r=this.tn.peek(),"["===r&&this._parseFieldOptions(i),this.tn.skip(";")}else if(n=void 0!==n?n:this.tn.next(),"group"===n){var a=this._parseMessage(e,i);if(!/^[A-Z]/.test(a.name))throw Error("illegal group name: "+a.name);i.type=a.name,i.name=a.name.toLowerCase(),this.tn.omit(";")}else{if(!o.TYPE.test(n)&&!o.TYPEREF.test(n))throw Error("illegal message field type: "+n);if(i.type=n,r=this.tn.next(),!o.NAME.test(r))throw Error("illegal message field name: "+r);i.name=r,this.tn.skip("="),i.id=s(this.tn.next()),r=this.tn.peek(),"["===r&&this._parseFieldOptions(i),this.tn.skip(";")}return e.fields.push(i),i},a._parseMessageOneOf=function(e){var t=this.tn.next();if(!o.NAME.test(t))throw Error("illegal oneof name: "+t);var n,r=t,i=[];for(this.tn.skip("{");"}"!==(t=this.tn.next());)n=this._parseMessageField(e,"optional",t),n.oneof=r,i.push(n.id);this.tn.omit(";"),e.oneofs[r]=i},a._parseFieldOptions=function(e){this.tn.skip("[");for(var t=!0;"]"!==this.tn.peek();)t||this.tn.skip(","),this._parseOption(e,!0),t=!1;this.tn.next()},a._parseEnum=function(e){var t={name:"",values:[],options:{}},n=this.tn.next();if(!o.NAME.test(n))throw Error("illegal name: "+n);for(t.name=n,this.tn.skip("{");"}"!==(n=this.tn.next());)if("option"===n)this._parseOption(t);else{if(!o.NAME.test(n))throw Error("illegal name: "+n);this.tn.skip("=");var r={name:n,id:s(this.tn.next(),!0)};n=this.tn.peek(),"["===n&&this._parseFieldOptions({options:{}}),this.tn.skip(";"),t.values.push(r)}this.tn.omit(";"),e.enums.push(t)},a._parseExtensionRanges=function(){var e,t,n,r=[];do{for(t=[];;){switch(e=this.tn.next(),e){case"min":n=i.ID_MIN;break;case"max":n=i.ID_MAX;break;default:n=l(e)}if(t.push(n),2===t.length)break;if("to"!==this.tn.peek()){t.push(n);break}this.tn.next()}r.push(t)}while(this.tn.omit(","));return this.tn.skip(";"),r},a._parseExtend=function(e){var t=this.tn.next();if(!o.TYPEREF.test(t))throw Error("illegal extend reference: "+t);var n={ref:t,fields:[]};for(this.tn.skip("{");"}"!==(t=this.tn.next());)if(o.RULE.test(t))this._parseMessageField(n,t);else{if(!o.TYPEREF.test(t))throw Error("illegal extend token: "+t);if(!this.proto3)throw Error("illegal field rule: "+t);this._parseMessageField(n,"optional",t)}return this.tn.omit(";"),e.messages.push(n),n},a.toString=function(){return"Parser at line "+this.tn.line},e.Parser=r,e}(ne,ne.Lang),ne.Reflect=function(m){var o={},c=function(e,t,n){this.builder=e,this.parent=t,this.name=n,this.className},e=c.prototype;e.fqn=function(){for(var e=this.name,t=this;t=t.parent,null!=t;)e=t.name+"."+e;return e},e.toString=function(e){return(e?this.className+" ":"")+this.fqn()},e.build=function(){throw Error(this.toString(!0)+" cannot be built directly")},o.T=c;var s=function(e,t,n,r,i){c.call(this,e,t,n),this.className="Namespace",this.children=[],this.options=r||{},this.syntax=i||"proto2"},t=s.prototype=(0,L.default)(c.prototype);t.getChildren=function(e){if(e=e||null,null==e)return this.children.slice();for(var t=[],n=0,r=this.children.length;n<r;++n)this.children[n]instanceof e&&t.push(this.children[n]);return t},t.addChild=function(e){var t;if(t=this.getChild(e.name))if(t instanceof f.Field&&t.name!==t.originalName&&null===this.getChild(t.originalName))t.name=t.originalName;else{if(!(e instanceof f.Field&&e.name!==e.originalName&&null===this.getChild(e.originalName)))throw Error("Duplicate name in namespace "+this.toString(!0)+": "+e.name);e.name=e.originalName}this.children.push(e)},t.getChild=function(e){for(var t="number"==typeof e?"id":"name",n=0,r=this.children.length;n<r;++n)if(this.children[n][t]===e)return this.children[n];return null},t.resolve=function(e,t){var n,r="string"==typeof e?e.split("."):e,i=this,a=0;if(""===r[a]){for(;null!==i.parent;)i=i.parent;a++}do{do{if(!(i instanceof o.Namespace)){i=null;break}if(n=i.getChild(r[a]),!n||!(n instanceof o.T)||t&&!(n instanceof o.Namespace)){i=null;break}i=n,a++}while(a<r.length);if(null!=i)break;if(null!==this.parent)return this.parent.resolve(e,t)}while(null!=i);return i},t.qn=function(e){for(var t=[],n=e;t.unshift(n.name),n=n.parent,null!==n;);for(var r=1;r<=t.length;r++){var i=t.slice(t.length-r);if(e===this.resolve(i,e instanceof o.Namespace))return i.join(".")}return e.fqn()},t.build=function(){for(var e,t={},n=this.children,r=0,i=n.length;r<i;++r)e=n[r],e instanceof s&&(t[e.name]=e.build());return k.default&&(0,k.default)(t,"$options",{value:this.buildOpt()}),t},t.buildOpt=function(){for(var e={},t=(0,A.default)(this.options),n=0,r=t.length;n<r;++n){var i=t[n],a=this.options[t[n]];e[i]=a}return e},t.getOption=function(e){return void 0===e?this.options:void 0!==this.options[e]?this.options[e]:null},o.Namespace=s;var h=function(e,t,n,r){if(this.type=e,this.resolvedType=t,this.isMapKey=n,this.syntax=r,n&&m.MAP_KEY_TYPES.indexOf(e)<0)throw Error("Invalid map key type: "+e.name)},n=h.prototype;function r(e){if("string"==typeof e&&(e=m.TYPES[e]),void 0===e.defaultValue)throw Error("default value for type "+e.name+" is not supported");return e==m.TYPES.bytes?new O(0):e.defaultValue}function l(e,t){if(e&&"number"==typeof e.low&&"number"==typeof e.high&&"boolean"==typeof e.unsigned&&e.low==e.low&&e.high==e.high)return new m.Long(e.low,e.high,void 0===t?e.unsigned:t);if("string"==typeof e)return m.Long.fromString(e,t||!1,10);if("number"==typeof e)return m.Long.fromNumber(e,t||!1);throw Error("not convertible to Long")}h.defaultFieldValue=r,n.verifyValue=function(t){var n=this;function r(e,t){throw Error("Illegal value for "+n.toString(!0)+" of type "+n.type.name+": "+e+" ("+t+")")}switch(this.type){case m.TYPES.int32:case m.TYPES.sint32:case m.TYPES.sfixed32:return("number"!=typeof t||t==t&&t%1!=0)&&r((0,C.default)(t),"not an integer"),4294967295<t?0|t:t;case m.TYPES.uint32:case m.TYPES.fixed32:return("number"!=typeof t||t==t&&t%1!=0)&&r((0,C.default)(t),"not an integer"),t<0?t>>>0:t;case m.TYPES.int64:case m.TYPES.sint64:case m.TYPES.sfixed64:if(m.Long)try{return l(t,!1)}catch(e){r((0,C.default)(t),e.message)}else r((0,C.default)(t),"requires Long.js");case m.TYPES.uint64:case m.TYPES.fixed64:if(m.Long)try{return l(t,!0)}catch(e){r((0,C.default)(t),e.message)}else r((0,C.default)(t),"requires Long.js");case m.TYPES.bool:return"boolean"!=typeof t&&r((0,C.default)(t),"not a boolean"),t;case m.TYPES.float:case m.TYPES.double:return"number"!=typeof t&&r((0,C.default)(t),"not a number"),t;case m.TYPES.string:return"string"==typeof t||t&&t instanceof String||r((0,C.default)(t),"not a string"),""+t;case m.TYPES.bytes:return O.isByteBuffer(t)?t:O.wrap(t,"base64");case m.TYPES.enum:var e=this.resolvedType.getChildren(m.Reflect.Enum.Value);for(a=0;a<e.length;a++){if(e[a].name==t)return e[a].id;if(e[a].id==t)return e[a].id}if("proto3"===this.syntax)return("number"!=typeof t||t==t&&t%1!=0)&&r((0,C.default)(t),"not an integer"),(4294967295<t||t<0)&&r((0,C.default)(t),"not in range for uint32"),t;r(t,"not a valid enum value");case m.TYPES.group:case m.TYPES.message:if(t&&"object"===(0,C.default)(t)||r((0,C.default)(t),"object expected"),t instanceof this.resolvedType.clazz)return t;if(t instanceof m.Builder.Message){var i={};for(var a in t)t.hasOwnProperty(a)&&(i[a]=t[a]);t=i}return new this.resolvedType.clazz(t)}throw Error("[INTERNAL] Illegal value for "+this.toString(!0)+": "+t+" (undefined type "+this.type+")")},n.calculateLength=function(e,t){if(null===t)return 0;var n;switch(this.type){case m.TYPES.int32:return t<0?O.calculateVarint64(t):O.calculateVarint32(t);case m.TYPES.uint32:return O.calculateVarint32(t);case m.TYPES.sint32:return O.calculateVarint32(O.zigZagEncode32(t));case m.TYPES.fixed32:case m.TYPES.sfixed32:case m.TYPES.float:return 4;case m.TYPES.int64:case m.TYPES.uint64:return O.calculateVarint64(t);case m.TYPES.sint64:return O.calculateVarint64(O.zigZagEncode64(t));case m.TYPES.fixed64:case m.TYPES.sfixed64:return 8;case m.TYPES.bool:return 1;case m.TYPES.enum:return O.calculateVarint32(t);case m.TYPES.double:return 8;case m.TYPES.string:return n=O.calculateUTF8Bytes(t),O.calculateVarint32(n)+n;case m.TYPES.bytes:if(t.remaining()<0)throw Error("Illegal value for "+this.toString(!0)+": "+t.remaining()+" bytes remaining");return O.calculateVarint32(t.remaining())+t.remaining();case m.TYPES.message:return n=this.resolvedType.calculate(t),O.calculateVarint32(n)+n;case m.TYPES.group:return n=this.resolvedType.calculate(t),n+O.calculateVarint32(e<<3|m.WIRE_TYPES.ENDGROUP)}throw Error("[INTERNAL] Illegal value to encode in "+this.toString(!0)+": "+t+" (unknown type)")},n.encodeValue=function(e,t,n){if(null===t)return n;switch(this.type){case m.TYPES.int32:t<0?n.writeVarint64(t):n.writeVarint32(t);break;case m.TYPES.uint32:n.writeVarint32(t);break;case m.TYPES.sint32:n.writeVarint32ZigZag(t);break;case m.TYPES.fixed32:n.writeUint32(t);break;case m.TYPES.sfixed32:n.writeInt32(t);break;case m.TYPES.int64:case m.TYPES.uint64:n.writeVarint64(t);break;case m.TYPES.sint64:n.writeVarint64ZigZag(t);break;case m.TYPES.fixed64:n.writeUint64(t);break;case m.TYPES.sfixed64:n.writeInt64(t);break;case m.TYPES.bool:"string"==typeof t?n.writeVarint32("false"===t.toLowerCase()?0:!!t):n.writeVarint32(t?1:0);break;case m.TYPES.enum:n.writeVarint32(t);break;case m.TYPES.float:n.writeFloat32(t);break;case m.TYPES.double:n.writeFloat64(t);break;case m.TYPES.string:n.writeVString(t);break;case m.TYPES.bytes:if(t.remaining()<0)throw Error("Illegal value for "+this.toString(!0)+": "+t.remaining()+" bytes remaining");var r=t.offset;n.writeVarint32(t.remaining()),n.append(t),t.offset=r;break;case m.TYPES.message:var i=(new O).LE();this.resolvedType.encode(t,i),n.writeVarint32(i.offset),n.append(i.flip());break;case m.TYPES.group:this.resolvedType.encode(t,n),n.writeVarint32(e<<3|m.WIRE_TYPES.ENDGROUP);break;default:throw Error("[INTERNAL] Illegal value to encode in "+this.toString(!0)+": "+t+" (unknown type)")}return n},n.decode=function(e,t,n){if(t!=this.type.wireType)throw Error("Unexpected wire type for element");var r,i;switch(this.type){case m.TYPES.int32:return 0|e.readVarint32();case m.TYPES.uint32:return e.readVarint32()>>>0;case m.TYPES.sint32:return 0|e.readVarint32ZigZag();case m.TYPES.fixed32:return e.readUint32()>>>0;case m.TYPES.sfixed32:return 0|e.readInt32();case m.TYPES.int64:return e.readVarint64();case m.TYPES.uint64:return e.readVarint64().toUnsigned();case m.TYPES.sint64:return e.readVarint64ZigZag();case m.TYPES.fixed64:return e.readUint64();case m.TYPES.sfixed64:return e.readInt64();case m.TYPES.bool:return!!e.readVarint32();case m.TYPES.enum:return e.readVarint32();case m.TYPES.float:return e.readFloat();case m.TYPES.double:return e.readDouble();case m.TYPES.string:return e.readVString();case m.TYPES.bytes:if(i=e.readVarint32(),e.remaining()<i)throw Error("Illegal number of bytes for "+this.toString(!0)+": "+i+" required but got only "+e.remaining());return r=e.clone(),r.limit=r.offset+i,e.offset+=i,r;case m.TYPES.message:return i=e.readVarint32(),this.resolvedType.decode(e,i);case m.TYPES.group:return this.resolvedType.decode(e,-1,n)}throw Error("[INTERNAL] Illegal decode type")},n.valueFromString=function(e){if(!this.isMapKey)throw Error("valueFromString() called on non-map-key element");switch(this.type){case m.TYPES.int32:case m.TYPES.sint32:case m.TYPES.sfixed32:case m.TYPES.uint32:case m.TYPES.fixed32:return this.verifyValue((0,I.default)(e));case m.TYPES.int64:case m.TYPES.sint64:case m.TYPES.sfixed64:case m.TYPES.uint64:case m.TYPES.fixed64:return this.verifyValue(e);case m.TYPES.bool:return"true"===e;case m.TYPES.string:return this.verifyValue(e);case m.TYPES.bytes:return O.fromBinary(e)}},n.valueToString=function(e){if(!this.isMapKey)throw Error("valueToString() called on non-map-key element");return this.type===m.TYPES.bytes?e.toString("binary"):e.toString()},o.Element=h;var f=function(e,t,n,r,i,a){s.call(this,e,t,n,r,a),this.className="Message",this.extensions=void 0,this.clazz=null,this.isGroup=!!i,this._fields=null,this._fieldsById=null,this._fieldsByName=null},i=f.prototype=(0,L.default)(s.prototype);function v(e,t){var n=t.readVarint32(),r=7&n,i=n>>>3;switch(r){case m.WIRE_TYPES.VARINT:for(;n=t.readUint8(),128==(128&n););break;case m.WIRE_TYPES.BITS64:t.offset+=8;break;case m.WIRE_TYPES.LDELIM:n=t.readVarint32(),t.offset+=n;break;case m.WIRE_TYPES.STARTGROUP:v(i,t);break;case m.WIRE_TYPES.ENDGROUP:if(i===e)return!1;throw Error("Illegal GROUPEND after unknown group: "+i+" ("+e+" expected)");case m.WIRE_TYPES.BITS32:t.offset+=4;break;default:throw Error("Illegal wire type in unknown group "+e+": "+r)}return!0}i.build=function(e){if(this.clazz&&!e)return this.clazz;var t=function(h,o){var s=o.getChildren(h.Reflect.Message.Field),l=o.getChildren(h.Reflect.Message.OneOf),r=function e(t){h.Builder.Message.call(this);for(var n=0,r=l.length;n<r;++n)this[l[n].name]=null;for(n=0,r=s.length;n<r;++n){var i=s[n];this[i.name]=i.repeated?[]:i.map?new h.Map(i):null,!i.required&&"proto3"!==o.syntax||null===i.defaultValue||(this[i.name]=i.defaultValue)}var a;if(0<arguments.length)if(1!==arguments.length||null===t||"object"!==(0,C.default)(t)||!("function"!=typeof t.encode||t instanceof e)||(0,R.default)(t)||t instanceof h.Map||O.isByteBuffer(t)||t instanceof ArrayBuffer||h.Long&&t instanceof h.Long)for(n=0,r=arguments.length;n<r;++n)void 0!==(a=arguments[n])&&this.$set(s[n].name,a);else this.$set(t)},a=r.prototype=(0,L.default)(h.Builder.Message.prototype);a.add=function(e,t,n){var r=o._fieldsByName[e];if(!n){if(!r)throw Error(this+"#"+e+" is undefined");if(!(r instanceof h.Reflect.Message.Field))throw Error(this+"#"+e+" is not a field: "+r.toString(!0));if(!r.repeated)throw Error(this+"#"+e+" is not a repeated field");t=r.verifyValue(t,!0)}return null===this[e]&&(this[e]=[]),this[e].push(t),this},a.$add=a.add,a.set=function(e,t,n){if(e&&"object"===(0,C.default)(e)){for(var r in n=t,e)e.hasOwnProperty(r)&&void 0!==(t=e[r])&&this.$set(r,t,n);return this}var i=o._fieldsByName[e];if(n)this[e]=t;else{if(!i)throw Error(this+"#"+e+" is not a field: undefined");if(!(i instanceof h.Reflect.Message.Field))throw Error(this+"#"+e+" is not a field: "+i.toString(!0));this[i.name]=t=i.verifyValue(t)}if(i&&i.oneof){var a=this[i.oneof.name];null!==t?(null!==a&&a!==i.name&&(this[a]=null),this[i.oneof.name]=i.name):a===e&&(this[i.oneof.name]=null)}return this},a.$set=a.set,a.get=function(e,t){if(t)return this[e];var n=o._fieldsByName[e];if(!(n&&n instanceof h.Reflect.Message.Field))throw Error(this+"#"+e+" is not a field: undefined");if(!(n instanceof h.Reflect.Message.Field))throw Error(this+"#"+e+" is not a field: "+n.toString(!0));return this[n.name]},a.$get=a.get;for(var e=0;e<s.length;e++){var t=s[e];t instanceof h.Reflect.Message.ExtensionField||o.builder.options.populateAccessors&&function(n){var e=n.originalName.replace(/(_[a-zA-Z])/g,function(e){return e.toUpperCase().replace("_","")});e=e.substring(0,1).toUpperCase()+e.substring(1);var t=n.originalName.replace(/([A-Z])/g,function(e){return"_"+e}),r=function(e,t){return this[n.name]=t?e:n.verifyValue(e),this},i=function(){return this[n.name]};null===o.getChild("set"+e)&&(a["set"+e]=r),null===o.getChild("set_"+t)&&(a["set_"+t]=r),null===o.getChild("get"+e)&&(a["get"+e]=i),null===o.getChild("get_"+t)&&(a["get_"+t]=i)}(t)}function f(e,n,r,i){if(null===e||"object"!==(0,C.default)(e)){if(i&&i instanceof h.Reflect.Enum){var t=h.Reflect.Enum.getName(i.object,e);if(null!==t)return t}return e}if(O.isByteBuffer(e))return n?e.toBase64():e.toBuffer();if(h.Long.isLong(e))return r?e.toString():h.Long.fromValue(e);var a;if((0,R.default)(e))return a=[],e.forEach(function(e,t){a[t]=f(e,n,r,i)}),a;if(a={},e instanceof h.Map){for(var o=e.entries(),s=o.next();!s.done;s=o.next())a[e.keyElem.valueToString(s.value[0])]=f(s.value[1],n,r,e.valueElem.resolvedType);return a}var l=e.$type,u=void 0;for(var c in e)e.hasOwnProperty(c)&&(l&&(u=l.getChild(c))?a[c]=f(e[c],n,r,u.resolvedType):a[c]=f(e[c],n,r));return a}return a.encode=function(t,e){"boolean"==typeof t&&(e=t,t=void 0);var n=!1;t||(t=new O,n=!0);var r=t.littleEndian;try{return o.encode(this,t.LE(),e),(n?t.flip():t).LE(r)}catch(e){throw t.LE(r),e}},r.encode=function(e,t,n){return new r(e).encode(t,n)},a.calculate=function(){return o.calculate(this)},a.encodeDelimited=function(e,t){var n=!1;e||(e=new O,n=!0);var r=(new O).LE();return o.encode(this,r,t).flip(),e.writeVarint32(r.remaining()),e.append(r),n?e.flip():e},a.encodeAB=function(){try{return this.encode().toArrayBuffer()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toArrayBuffer()),e}},a.toArrayBuffer=a.encodeAB,a.encodeNB=function(){try{return this.encode().toBuffer()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toBuffer()),e}},a.toBuffer=a.encodeNB,a.encode64=function(){try{return this.encode().toBase64()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toBase64()),e}},a.toBase64=a.encode64,a.encodeHex=function(){try{return this.encode().toHex()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toHex()),e}},a.toHex=a.encodeHex,a.toRaw=function(e,t){return f(this,!!e,!!t,this.$type)},a.encodeJSON=function(){return(0,T.default)(f(this,!0,!0,this.$type))},r.decode=function(t,e,n){"string"==typeof e&&(n=e,e=-1),"string"==typeof t&&(t=O.wrap(t,n||"base64")),t=O.isByteBuffer(t)?t:O.wrap(t);var r=t.littleEndian;try{var i=o.decode(t.LE());return t.LE(r),i}catch(e){throw t.LE(r),e}},r.decodeDelimited=function(t,e){if("string"==typeof t&&(t=O.wrap(t,e||"base64")),t=O.isByteBuffer(t)?t:O.wrap(t),t.remaining()<1)return null;var n=t.offset,r=t.readVarint32();if(t.remaining()<r)return t.offset=n,null;try{var i=o.decode(t.slice(t.offset,t.offset+r).LE());return t.offset+=r,i}catch(e){throw t.offset+=r,e}},r.decode64=function(e){return r.decode(e,"base64")},r.decodeHex=function(e){return r.decode(e,"hex")},r.decodeJSON=function(e){return new r(JSON.parse(e))},a.toString=function(){return o.toString()},k.default&&((0,k.default)(r,"$options",{value:o.buildOpt()}),(0,k.default)(a,"$options",{value:r.$options}),(0,k.default)(r,"$type",{value:o}),(0,k.default)(a,"$type",{value:o})),r}(m,this);this._fields=[],this._fieldsById={},this._fieldsByName={};for(var n,r=0,i=this.children.length;r<i;r++)if(n=this.children[r],n instanceof g||n instanceof f||n instanceof w){if(t.hasOwnProperty(n.name))throw Error("Illegal reflect child of "+this.toString(!0)+": "+n.toString(!0)+" cannot override static property '"+n.name+"'");t[n.name]=n.build()}else if(n instanceof f.Field)n.build(),this._fields.push(n),this._fieldsById[n.id]=n,this._fieldsByName[n.name]=n;else if(!(n instanceof f.OneOf||n instanceof x))throw Error("Illegal reflect child of "+this.toString(!0)+": "+this.children[r].toString(!0));return this.clazz=t},i.encode=function(e,t,n){for(var r,i,a=null,o=0,s=this._fields.length;o<s;++o)r=this._fields[o],i=e[r.name],r.required&&null===i?null===a&&(a=r):r.encode(n?i:r.verifyValue(i),t,e);if(null===a)return t;var l=Error("Missing at least one required field for "+this.toString(!0)+": "+a);throw l.encoded=t,l},i.calculate=function(e){for(var t,n,r=0,i=0,a=this._fields.length;i<a;++i){if(t=this._fields[i],n=e[t.name],t.required&&null===n)throw Error("Missing at least one required field for "+this.toString(!0)+": "+t);r+=t.calculate(n,e)}return r},i.decode=function(e,t,n){t="number"==typeof t?t:-1;for(var r,i,a,o,s=e.offset,l=new this.clazz;e.offset<s+t||-1===t&&0<e.remaining();){if(r=e.readVarint32(),i=7&r,a=r>>>3,i===m.WIRE_TYPES.ENDGROUP){if(a!==n)throw Error("Illegal group end indicator for "+this.toString(!0)+": "+a+" ("+(n?n+" expected":"not a group")+")");break}if(o=this._fieldsById[a]){if(o.repeated&&!o.options.packed)l[o.name].push(o.decode(i,e));else if(o.map){var u=o.decode(i,e);l[o.name].set(u[0],u[1])}else if(l[o.name]=o.decode(i,e),o.oneof){var c=l[o.oneof.name];null!==c&&c!==o.name&&(l[c]=null),l[o.oneof.name]=o.name}}else switch(i){case m.WIRE_TYPES.VARINT:e.readVarint32();break;case m.WIRE_TYPES.BITS32:e.offset+=4;break;case m.WIRE_TYPES.BITS64:e.offset+=8;break;case m.WIRE_TYPES.LDELIM:var h=e.readVarint32();e.offset+=h;break;case m.WIRE_TYPES.STARTGROUP:for(;v(a,e););break;default:throw Error("Illegal wire type for unknown field "+a+" in "+this.toString(!0)+"#decode: "+i)}}for(var f=0,d=this._fields.length;f<d;++f)if(o=this._fields[f],null===l[o.name])if("proto3"===this.syntax)l[o.name]=o.defaultValue;else{if(o.required){var p=Error("Missing at least one required field for "+this.toString(!0)+": "+o.name);throw p.decoded=l,p}m.populateDefaults&&null!==o.defaultValue&&(l[o.name]=o.defaultValue)}return l},o.Message=f;var u=function(e,t,n,r,i,a,o,s,l,u){c.call(this,e,t,a),this.className="Message.Field",this.required="required"===n,this.repeated="repeated"===n,this.map="map"===n,this.keyType=r||null,this.type=i,this.resolvedType=null,this.id=o,this.options=s||{},this.defaultValue=null,this.oneof=l||null,this.syntax=u||"proto2",this.originalName=this.name,this.element=null,this.keyElement=null,!this.builder.options.convertFieldsToCamelCase||this instanceof f.ExtensionField||(this.name=m.Util.toCamelCase(this.name))},a=u.prototype=(0,L.default)(c.prototype);a.build=function(){this.element=new h(this.type,this.resolvedType,!1,this.syntax),this.map&&(this.keyElement=new h(this.keyType,void 0,!0,this.syntax)),"proto3"!==this.syntax||this.repeated||this.map?void 0!==this.options.default&&(this.defaultValue=this.verifyValue(this.options.default)):this.defaultValue=h.defaultFieldValue(this.type)},a.verifyValue=function(e,t){t=t||!1;var n,r=this;function i(e,t){throw Error("Illegal value for "+r.toString(!0)+" of type "+r.type.name+": "+e+" ("+t+")")}if(null===e)return this.required&&i((0,C.default)(e),"required"),"proto3"===this.syntax&&this.type!==m.TYPES.message&&i((0,C.default)(e),"proto3 field without field presence cannot be null"),null;if(!this.repeated||t)return this.map&&!t?e instanceof m.Map?e:(e instanceof Object||i((0,C.default)(e),"expected ProtoBuf.Map or raw object for map field"),new m.Map(this,e)):(!this.repeated&&(0,R.default)(e)&&i((0,C.default)(e),"no array expected"),this.element.verifyValue(e));(0,R.default)(e)||(e=[e]);var a=[];for(n=0;n<e.length;n++)a.push(this.element.verifyValue(e[n]));return a},a.hasWirePresence=function(e,t){if("proto3"!==this.syntax)return null!==e;if(this.oneof&&t[this.oneof.name]===this.name)return!0;switch(this.type){case m.TYPES.int32:case m.TYPES.sint32:case m.TYPES.sfixed32:case m.TYPES.uint32:case m.TYPES.fixed32:return 0!==e;case m.TYPES.int64:case m.TYPES.sint64:case m.TYPES.sfixed64:case m.TYPES.uint64:case m.TYPES.fixed64:return 0!==e.low||0!==e.high;case m.TYPES.bool:return e;case m.TYPES.float:case m.TYPES.double:return 0!==e;case m.TYPES.string:return 0<e.length;case m.TYPES.bytes:return 0<e.remaining();case m.TYPES.enum:return 0!==e;case m.TYPES.message:return null!==e;default:return!0}},a.encode=function(t,r,e){if(null===this.type||"object"!==(0,C.default)(this.type))throw Error("[INTERNAL] Unresolved type in "+this.toString(!0)+": "+this.type);if(null===t||this.repeated&&0==t.length)return r;try{var n;if(this.repeated)if(this.options.packed&&0<=m.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)){r.writeVarint32(this.id<<3|m.WIRE_TYPES.LDELIM),r.ensureCapacity(r.offset+=1);var i=r.offset;for(n=0;n<t.length;n++)this.element.encodeValue(this.id,t[n],r);var a=r.offset-i,o=O.calculateVarint32(a);if(1<o){var s=r.slice(i,r.offset);i+=o-1,r.offset=i,r.append(s)}r.writeVarint32(a,i-o)}else for(n=0;n<t.length;n++)r.writeVarint32(this.id<<3|this.type.wireType),this.element.encodeValue(this.id,t[n],r);else this.map?t.forEach(function(e,t){var n=O.calculateVarint32(8|this.keyType.wireType)+this.keyElement.calculateLength(1,t)+O.calculateVarint32(16|this.type.wireType)+this.element.calculateLength(2,e);r.writeVarint32(this.id<<3|m.WIRE_TYPES.LDELIM),r.writeVarint32(n),r.writeVarint32(8|this.keyType.wireType),this.keyElement.encodeValue(1,t,r),r.writeVarint32(16|this.type.wireType),this.element.encodeValue(2,e,r)},this):this.hasWirePresence(t,e)&&(r.writeVarint32(this.id<<3|this.type.wireType),this.element.encodeValue(this.id,t,r))}catch(e){throw Error("Illegal value for "+this.toString(!0)+": "+t+" ("+e+")")}return r},a.calculate=function(t,e){if(t=this.verifyValue(t),null===this.type||"object"!==(0,C.default)(this.type))throw Error("[INTERNAL] Unresolved type in "+this.toString(!0)+": "+this.type);if(null===t||this.repeated&&0==t.length)return 0;var r=0;try{var n,i;if(this.repeated)if(this.options.packed&&0<=m.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)){for(r+=O.calculateVarint32(this.id<<3|m.WIRE_TYPES.LDELIM),i=0,n=0;n<t.length;n++)i+=this.element.calculateLength(this.id,t[n]);r+=O.calculateVarint32(i),r+=i}else for(n=0;n<t.length;n++)r+=O.calculateVarint32(this.id<<3|this.type.wireType),r+=this.element.calculateLength(this.id,t[n]);else this.map?t.forEach(function(e,t){var n=O.calculateVarint32(8|this.keyType.wireType)+this.keyElement.calculateLength(1,t)+O.calculateVarint32(16|this.type.wireType)+this.element.calculateLength(2,e);r+=O.calculateVarint32(this.id<<3|m.WIRE_TYPES.LDELIM),r+=O.calculateVarint32(n),r+=n},this):this.hasWirePresence(t,e)&&(r+=O.calculateVarint32(this.id<<3|this.type.wireType),r+=this.element.calculateLength(this.id,t))}catch(e){throw Error("Illegal value for "+this.toString(!0)+": "+t+" ("+e+")")}return r},a.decode=function(e,t,n){var r,i,a=!this.map&&e==this.type.wireType||!n&&this.repeated&&this.options.packed&&e==m.WIRE_TYPES.LDELIM||this.map&&e==m.WIRE_TYPES.LDELIM;if(!a)throw Error("Illegal wire type for field "+this.toString(!0)+": "+e+" ("+this.type.wireType+" expected)");if(e==m.WIRE_TYPES.LDELIM&&this.repeated&&this.options.packed&&0<=m.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)&&!n){i=t.readVarint32(),i=t.offset+i;for(var o=[];t.offset<i;)o.push(this.decode(this.type.wireType,t,!0));return o}if(this.map){var s=h.defaultFieldValue(this.keyType);if(r=h.defaultFieldValue(this.type),i=t.readVarint32(),t.remaining()<i)throw Error("Illegal number of bytes for "+this.toString(!0)+": "+i+" required but got only "+t.remaining());var l=t.clone();for(l.limit=l.offset+i,t.offset+=i;0<l.remaining();){var u=l.readVarint32();e=7&u;var c=u>>>3;if(1===c)s=this.keyElement.decode(l,e,c);else{if(2!==c)throw Error("Unexpected tag in map field key/value submessage");r=this.element.decode(l,e,c)}}return[s,r]}return this.element.decode(t,e,this.id)},o.Message.Field=u;var d=function(e,t,n,r,i,a,o){u.call(this,e,t,n,null,r,i,a,o),this.extension};d.prototype=(0,L.default)(u.prototype),o.Message.ExtensionField=d;var p=function(e,t,n){c.call(this,e,t,n),this.fields=[]};o.Message.OneOf=p;var g=function(e,t,n,r,i){s.call(this,e,t,n,r,i),this.className="Enum",this.object=null};g.getName=function(e,t){for(var n,r=(0,A.default)(e),i=0;i<r.length;++i)if(e[n=r[i]]===t)return n;return null};var y=g.prototype=(0,L.default)(s.prototype);y.build=function(e){if(this.object&&!e)return this.object;for(var t=new m.Builder.Enum,n=this.getChildren(g.Value),r=0,i=n.length;r<i;++r)t[n[r].name]=n[r].id;return k.default&&(0,k.default)(t,"$options",{value:this.buildOpt(),enumerable:!1}),this.object=t},o.Enum=g;var _=function(e,t,n,r){c.call(this,e,t,n),this.className="Enum.Value",this.id=r};_.prototype=(0,L.default)(c.prototype),o.Enum.Value=_;var x=function(e,t,n,r){c.call(this,e,t,n),this.field=r};x.prototype=(0,L.default)(c.prototype),o.Extension=x;var w=function(e,t,n,r){s.call(this,e,t,n,r),this.className="Service",this.clazz=null},b=w.prototype=(0,L.default)(s.prototype);b.build=function(e){return this.clazz&&!e?this.clazz:this.clazz=function(t,i){for(var a=function(e){t.Builder.Service.call(this),this.rpcImpl=e||function(e,t,n){setTimeout(n.bind(this,Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")),0)}},e=a.prototype=(0,L.default)(t.Builder.Service.prototype),n=i.getChildren(t.Reflect.Service.RPCMethod),r=0;r<n.length;r++)!function(r){e[r.name]=function(e,n){try{try{e=r.resolvedRequestType.clazz.decode(O.wrap(e))}catch(e){if(!(e instanceof TypeError))throw e}if(null===e||"object"!==(0,C.default)(e))throw Error("Illegal arguments");e instanceof r.resolvedRequestType.clazz||(e=new r.resolvedRequestType.clazz(e)),this.rpcImpl(r.fqn(),e,function(e,t){if(e)n(e);else{null===t&&(t="");try{t=r.resolvedResponseType.clazz.decode(t)}catch(e){}t&&t instanceof r.resolvedResponseType.clazz?n(null,t):n(Error("Illegal response type received in service method "+i.name+"#"+r.name))}})}catch(e){setTimeout(n.bind(this,e),0)}},a[r.name]=function(e,t,n){new a(e)[r.name](t,n)},k.default&&((0,k.default)(a[r.name],"$options",{value:r.buildOpt()}),(0,k.default)(e[r.name],"$options",{value:a[r.name].$options}))}(n[r]);return k.default&&((0,k.default)(a,"$options",{value:i.buildOpt()}),(0,k.default)(e,"$options",{value:a.$options}),(0,k.default)(a,"$type",{value:i}),(0,k.default)(e,"$type",{value:i})),a}(m,this)},o.Service=w;var M=function(e,t,n,r){c.call(this,e,t,n),this.className="Service.Method",this.options=r||{}},S=M.prototype=(0,L.default)(c.prototype);S.buildOpt=t.buildOpt,o.Service.Method=M;var E=function(e,t,n,r,i,a,o,s){M.call(this,e,t,n,s),this.className="Service.RPCMethod",this.requestName=r,this.responseName=i,this.requestStream=a,this.responseStream=o,this.resolvedRequestType=null,this.resolvedResponseType=null};return E.prototype=(0,L.default)(M.prototype),o.Service.RPCMethod=E,o}(ne),ne.Builder=(X=ne,Z=ne.Lang,J=ne.Reflect,K=function(e){this.ns=new J.Namespace(this,null,""),this.ptr=this.ns,this.resolved=!1,this.result=null,this.files={},this.importRoot=null,this.options=e||{}},Q=K.prototype,K.isMessage=function(e){return"string"==typeof e.name&&void 0===e.values&&void 0===e.rpc},K.isMessageField=function(e){return"string"==typeof e.rule&&"string"==typeof e.name&&"string"==typeof e.type&&void 0!==e.id},K.isEnum=function(e){return"string"==typeof e.name&&!(void 0===e.values||!(0,R.default)(e.values)||0===e.values.length)},K.isService=function(e){return!("string"!=typeof e.name||"object"!==(0,C.default)(e.rpc)||!e.rpc)},K.isExtend=function(e){return"string"==typeof e.ref},Q.reset=function(){return this.ptr=this.ns,this},Q.define=function(e){if("string"!=typeof e||!Z.TYPEREF.test(e))throw Error("illegal namespace: "+e);return e.split(".").forEach(function(e){var t=this.ptr.getChild(e);null===t&&this.ptr.addChild(t=new J.Namespace(this,this.ptr,e)),this.ptr=t},this),this},Q.create=function(e){if(!e)return this;if((0,R.default)(e)){if(0===e.length)return this;e=e.slice()}else e=[e];for(var t=[e];0<t.length;){if(e=t.pop(),!(0,R.default)(e))throw Error("not a valid namespace: "+(0,T.default)(e));for(;0<e.length;){var n=e.shift();if(K.isMessage(n)){var a=new J.Message(this,this.ptr,n.name,n.options,n.isGroup,n.syntax),r={};n.oneofs&&(0,A.default)(n.oneofs).forEach(function(e){a.addChild(r[e]=new J.Message.OneOf(this,a,e))},this),n.fields&&n.fields.forEach(function(e){if(null!==a.getChild(0|e.id))throw Error("duplicate or invalid field id in "+a.name+": "+e.id);if(e.options&&"object"!==(0,C.default)(e.options))throw Error("illegal field options in "+a.name+"#"+e.name);var t=null;if("string"==typeof e.oneof&&!(t=r[e.oneof]))throw Error("illegal oneof in "+a.name+"#"+e.name+": "+e.oneof);e=new J.Message.Field(this,a,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,n.syntax),t&&t.fields.push(e),a.addChild(e)},this);var i=[];if(n.enums&&n.enums.forEach(function(e){i.push(e)}),n.messages&&n.messages.forEach(function(e){i.push(e)}),n.services&&n.services.forEach(function(e){i.push(e)}),n.extensions&&("number"==typeof n.extensions[0]?a.extensions=[n.extensions]:a.extensions=n.extensions),this.ptr.addChild(a),0<i.length){t.push(e),e=i,i=null,this.ptr=a,a=null;continue}i=null}else if(K.isEnum(n))a=new J.Enum(this,this.ptr,n.name,n.options,n.syntax),n.values.forEach(function(e){a.addChild(new J.Enum.Value(this,a,e.name,e.id))},this),this.ptr.addChild(a);else if(K.isService(n))a=new J.Service(this,this.ptr,n.name,n.options),(0,A.default)(n.rpc).forEach(function(e){var t=n.rpc[e];a.addChild(new J.Service.RPCMethod(this,a,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))},this),this.ptr.addChild(a);else{if(!K.isExtend(n))throw Error("not a valid definition: "+(0,T.default)(n));if(a=this.ptr.resolve(n.ref,!0),a)n.fields.forEach(function(t){if(null!==a.getChild(0|t.id))throw Error("duplicate extended field id in "+a.name+": "+t.id);if(a.extensions){var n=!1;if(a.extensions.forEach(function(e){t.id>=e[0]&&t.id<=e[1]&&(n=!0)}),!n)throw Error("illegal extended field id in "+a.name+": "+t.id+" (not within valid ranges)")}var e=t.name;this.options.convertFieldsToCamelCase&&(e=X.Util.toCamelCase(e));var r=new J.Message.ExtensionField(this,a,t.rule,t.type,this.ptr.fqn()+"."+e,t.id,t.options),i=new J.Extension(this,this.ptr,t.name,r);r.extension=i,this.ptr.addChild(i),a.addChild(r)},this);else if(!/\.?google\.protobuf\./.test(n.ref))throw Error("extended message "+n.ref+" is not defined")}n=null,a=null}e=null,this.ptr=this.ptr.parent}return this.resolved=!1,this.result=null,this},Q.import=function(t,e){var n="/";if("string"==typeof e){if(X.Util.IS_NODE&&(e=oe(198).resolve(e)),!0===this.files[e])return this.reset();this.files[e]=!0}else if("object"===(0,C.default)(e)){var r=e.root;X.Util.IS_NODE&&(r=oe(198).resolve(r)),(0<=r.indexOf("\\")||0<=e.file.indexOf("\\"))&&(n="\\");var i=r+n+e.file;if(!0===this.files[i])return this.reset();this.files[i]=!0}if(t.imports&&0<t.imports.length){var a,o=!1;"object"===(0,C.default)(e)?(this.importRoot=e.root,o=!0,a=this.importRoot,e=e.file,(0<=a.indexOf("\\")||0<=e.indexOf("\\"))&&(n="\\")):"string"==typeof e?this.importRoot?a=this.importRoot:0<=e.indexOf("/")?(a=e.replace(/\/[^\/]*$/,""),""===a&&(a="/")):0<=e.indexOf("\\")?(a=e.replace(/\\[^\\]*$/,""),n="\\"):a=".":a=null;for(var s=0;s<t.imports.length;s++)if("string"==typeof t.imports[s]){if(!a)throw Error("cannot determine import root");var l=t.imports[s];if("google/protobuf/descriptor.proto"===l)continue;if(l=a+n+l,!0===this.files[l])continue;/\.proto$/i.test(l)&&!X.DotProto&&(l=l.replace(/\.proto$/,".json"));var u=X.Util.fetch(l);if(null===u)throw Error("failed to import '"+l+"' in '"+e+"': file not found");/\.json$/i.test(l)?this.import(JSON.parse(u+""),l):this.import(X.DotProto.Parser.parse(u),l)}else e?/\.(\w+)$/.test(e)?this.import(t.imports[s],e.replace(/^(.+)\.(\w+)$/,function(e,t,n){return t+"_import"+s+"."+n})):this.import(t.imports[s],e+"_import"+s):this.import(t.imports[s]);o&&(this.importRoot=null)}t.package&&this.define(t.package),t.syntax&&re(t);var c=this.ptr;return t.options&&(0,A.default)(t.options).forEach(function(e){c.options[e]=t.options[e]}),t.messages&&(this.create(t.messages),this.ptr=c),t.enums&&(this.create(t.enums),this.ptr=c),t.services&&(this.create(t.services),this.ptr=c),t.extends&&this.create(t.extends),this.reset()},Q.resolveAll=function(){var e;if(null==this.ptr||"object"===(0,C.default)(this.ptr.type))return this;if(this.ptr instanceof J.Namespace)this.ptr.children.forEach(function(e){this.ptr=e,this.resolveAll()},this);else if(this.ptr instanceof J.Message.Field){if(Z.TYPE.test(this.ptr.type))this.ptr.type=X.TYPES[this.ptr.type];else{if(!Z.TYPEREF.test(this.ptr.type))throw Error("illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);if(e=(this.ptr instanceof J.Message.ExtensionField?this.ptr.extension.parent:this.ptr.parent).resolve(this.ptr.type,!0),!e)throw Error("unresolvable type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);if(this.ptr.resolvedType=e,e instanceof J.Enum){if(this.ptr.type=X.TYPES.enum,"proto3"===this.ptr.syntax&&"proto3"!==e.syntax)throw Error("proto3 message cannot reference proto2 enum")}else{if(!(e instanceof J.Message))throw Error("illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);this.ptr.type=e.isGroup?X.TYPES.group:X.TYPES.message}}if(this.ptr.map){if(!Z.TYPE.test(this.ptr.keyType))throw Error("illegal key type for map field in "+this.ptr.toString(!0)+": "+this.ptr.keyType);this.ptr.keyType=X.TYPES[this.ptr.keyType]}}else if(this.ptr instanceof X.Reflect.Service.Method){if(!(this.ptr instanceof X.Reflect.Service.RPCMethod))throw Error("illegal service type in "+this.ptr.toString(!0));if(e=this.ptr.parent.resolve(this.ptr.requestName,!0),!(e&&e instanceof X.Reflect.Message))throw Error("Illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.requestName);if(this.ptr.resolvedRequestType=e,e=this.ptr.parent.resolve(this.ptr.responseName,!0),!(e&&e instanceof X.Reflect.Message))throw Error("Illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.responseName);this.ptr.resolvedResponseType=e}else if(!(this.ptr instanceof X.Reflect.Message.OneOf||this.ptr instanceof X.Reflect.Extension||this.ptr instanceof X.Reflect.Enum.Value))throw Error("illegal object in namespace: "+(0,C.default)(this.ptr)+": "+this.ptr);return this.reset()},Q.build=function(e){if(this.reset(),this.resolved||(this.resolveAll(),this.resolved=!0,this.result=null),null===this.result&&(this.result=this.ns.build()),!e)return this.result;for(var t="string"==typeof e?e.split("."):e,n=this.result,r=0;r<t.length;r++){if(!n[t[r]]){n=null;break}n=n[t[r]]}return n},Q.lookup=function(e,t){return e?this.ns.resolve(e,t):this.ns},Q.toString=function(){return"Builder"},K.Message=function(){},K.Enum=function(){},K.Service=function(){},K),ne.Map=($=ne.Reflect,ee=function(e,t){if(!e.map)throw Error("field is not a map");if(this.field=e,this.keyElem=new $.Element(e.keyType,null,!0,e.syntax),this.valueElem=new $.Element(e.type,e.resolvedType,!1,e.syntax),this.map={},(0,k.default)(this,"size",{get:function(){return(0,A.default)(this.map).length}}),t)for(var n=(0,A.default)(t),r=0;r<n.length;r++){var i=this.keyElem.valueFromString(n[r]),a=this.valueElem.verifyValue(t[n[r]]);this.map[this.keyElem.valueToString(i)]={key:i,value:a}}},te=ee.prototype,te.clear=function(){this.map={}},te.delete=function(e){var t=this.keyElem.valueToString(this.keyElem.verifyValue(e)),n=t in this.map;return delete this.map[t],n},te.entries=function(){for(var e,t=[],n=(0,A.default)(this.map),r=0;r<n.length;r++)t.push([(e=this.map[n[r]]).key,e.value]);return ie(t)},te.keys=function(){for(var e=[],t=(0,A.default)(this.map),n=0;n<t.length;n++)e.push(this.map[t[n]].key);return ie(e)},te.values=function(){for(var e=[],t=(0,A.default)(this.map),n=0;n<t.length;n++)e.push(this.map[t[n]].value);return ie(e)},te.forEach=function(e,t){for(var n,r=(0,A.default)(this.map),i=0;i<r.length;i++)e.call(t,(n=this.map[r[i]]).value,n.key,this)},te.set=function(e,t){var n=this.keyElem.verifyValue(e),r=this.valueElem.verifyValue(t);return this.map[this.keyElem.valueToString(n)]={key:n,value:r},this},te.get=function(e){var t=this.keyElem.valueToString(this.keyElem.verifyValue(e));if(t in this.map)return this.map[t].value},te.has=function(e){var t=this.keyElem.valueToString(this.keyElem.verifyValue(e));return t in this.map},ee),ne.loadProto=function(e,t,n){return("string"==typeof t||t&&"string"==typeof t.file&&"string"==typeof t.root)&&(n=t,t=void 0),ne.loadJson(ne.DotProto.Parser.parse(e),t,n)},ne.protoFromString=ne.loadProto,ne.loadProtoFile=function(t,n,r){if(n&&"object"===(0,C.default)(n)?(r=n,n=null):n&&"function"==typeof n||(n=null),n)return ne.Util.fetch("string"==typeof t?t:t.root+"/"+t.file,function(e){if(null!==e)try{n(null,ne.loadProto(e,r,t))}catch(e){n(e)}else n(Error("Failed to fetch file"))});var e=ne.Util.fetch("object"===(0,C.default)(t)?t.root+"/"+t.file:t);return null===e?null:ne.loadProto(e,r,t)},ne.protoFromFile=ne.loadProtoFile,ne.newBuilder=function(e){return e=e||{},void 0===e.convertFieldsToCamelCase&&(e.convertFieldsToCamelCase=ne.convertFieldsToCamelCase),void 0===e.populateAccessors&&(e.populateAccessors=ne.populateAccessors),new ne.Builder(e)},ne.loadJson=function(e,t,n){return("string"==typeof t||t&&"string"==typeof t.file&&"string"==typeof t.root)&&(n=t,t=null),t&&"object"===(0,C.default)(t)||(t=ne.newBuilder()),"string"==typeof e&&(e=JSON.parse(e)),t.import(e,n),t.resolveAll(),t},ne.loadJsonFile=function(t,n,r){if(n&&"object"===(0,C.default)(n)?(r=n,n=null):n&&"function"==typeof n||(n=null),n)return ne.Util.fetch("string"==typeof t?t:t.root+"/"+t.file,function(e){if(null!==e)try{n(null,ne.loadJson(JSON.parse(e),r,t))}catch(e){n(e)}else n(Error("Failed to fetch file"))});var e=ne.Util.fetch("object"===(0,C.default)(t)?t.root+"/"+t.file:t);return null===e?null:ne.loadJson(JSON.parse(e),r,t)}}).call(this,oe(146))},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var s=r(n(18)),l=r(n(13)),u=r(n(17)),c=r(n(16)),a=r(n(15));n(5),n(4);var o=r(n(47));n(56),n(21),n(10);var h=r(n(31)),f=r(n(2)),d=r(n(3)),p=r(n(86)),m=r(n(208));function _(e){if(void 0===c.default||null==e[u.default]){if((0,l.default)(e)||(e=v(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i,a=!0,o=!1;return{s:function(){r=(0,s.default)(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){o=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(o)throw i}}}}function v(e,t){if(e){if("string"==typeof e)return g(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?(0,a.default)(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?g(e,t):void 0}}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var y=function(){function r(e,t,n){(0,f.default)(this,r),this.groups={},this._id=e,this._center=new fm.Vector2,this._mapcenter=new fm.Vector2(t.scene.x,t.scene.y),this._theme=null,this.parent=n,this.layerGroups=t.scene.layerGroups,this._bbox={max:new fm.Vector2(-1/0,-1/0),min:new fm.Vector2(1/0,1/0)},this._bboxTh={max:new fm.Vector2(-1/0,-1/0),min:new fm.Vector2(1/0,1/0)},this._bbox.max.x=t.scene.maxX,this._bbox.max.y=t.scene.maxY,this._bbox.min.x=t.scene.minX,this._bbox.min.y=t.scene.minY,this._bboxTh.max.x=t.scene.maxX-t.scene.x,this._bboxTh.max.y=t.scene.maxY-t.scene.y,this._bboxTh.min.x=t.scene.minX-t.scene.x,this._bboxTh.min.y=t.scene.minY-t.scene.y,this._groupIds=[],this.initGroupByData(t),this._spcace=(0,h.default)(t.scene.layerGroups[0].height)}return(0,d.default)(r,[{key:"getNeedLoadGroup",value:function(e,t){var n,r=[],i=_(this.layerGroups);try{for(i.s();!(n=i.n()).done;){var a=n.value,o=-1<e.indexOf(a.gid);t&&(o=!o),!a.loaded&&o&&r.push({gid:a.gid,url:this.getGroupLoadUrl(a.gname,a.gid),layerData:a})}}catch(e){i.e(e)}finally{i.f()}return r}},{key:"getGroupLoadUrl",value:function(e){return"floor."+e}},{key:"getLastAndNextName",value:function(e,t){var n,r,i,a=""+e,o=_(this.layerGroups);try{for(o.s();!(i=o.n()).done;){var s=i.value;s.gid===t-1&&(n="_"+s.gname),s.gid===t+1&&(r="_"+s.gname)}}catch(e){o.e(e)}finally{o.f()}return n=n||"_no",r=r||"_no",a+=n+r,a}},{key:"initGroupByData",value:function(e){var t=e.floors;this._groupLength=t.length;for(var n=0;n<t.length;n++)this.addGroup(t[n].gid,t[n],e.scene.layerGroups[n])}},{key:"addGroup",value:function(e,t,n){this._groupIds.push(e);var r=new m.default(e,t,n);r.hideWithFree=this.parent.map.MapOptions.autoDispose,r.parent=this;var i=(0,h.default)(e);r.height=this._space*i,-1<this.parent.map.visibleGroupIDs.indexOf(e)?r.visible=!0:r.visible=!1,this.groups[e+""]=r}},{key:"changeTheme",value:function(r){var i=this;this._theme=r;var a,e=["extent","model","label","facility"],t=function(n){i.groups[n].traverseByAlias(e,function(e,t){switch(t){case"extent":a=r;break;case"model":a=i.parent.map.MapOptions.useStoreApply?r.getStoreApplyTheme(e.bdata.fid):void 0,a=a||r.getModelTheme(e.bdata);break;case"label":a=r.getLabelTheme(e.bdata.type);break;case"facility":a=r.getPoiTheme(e.bdata.type)}e.renderNodeInited&&(e.setByTheme(a),i.parent.checkMaterialAlpha(e.renderNode,(0,h.default)(n)),"model"==t&&i.parent.checkMaterialAlpha(e.line,(0,h.default)(n)))})};for(var n in this.groups)t(n)}},{key:"getAllGroupLayerByAlias",value:function(e,t){for(var n in this.groups){var r,i=this.groups[n].layers[e],a=_(i);try{for(a.s();!(r=a.n()).done;){var o=r.value;t(o)}}catch(e){a.e(e)}finally{a.f()}}}},{key:"getFacilityByFilter",value:function(e,t){var n,r=[],i=_(e);try{for(i.s();!(n=i.n()).done;){var a=n.value,o=this.groups[a];if(o){for(var s=["imageMarker","textMarker","facility"],l=0,u=s;l<u.length;l++){var c,h=u[l],f=o.getLayers(h),d=_(f);try{for(d.s();!(c=d.n()).done;)for(var p=c.value,m=0;m<p.scene.children.length;m++)t&&!t(p.scene.children[m])||r.push(p.scene.children[m])}catch(e){d.e(e)}finally{d.f()}}for(var v=o._locationScene.children,g=0;g<v.length;g++)t&&!t(v[g])||r.push(v[g])}}}catch(e){i.e(e)}finally{i.f()}return r}},{key:"getSpriteInfo",value:function(e,t,n,r){e.updateMatrixWorld(!0);var i,a=(new fm.Vector3).setFromMatrixPosition(e.matrixWorld),o=a.applyMatrix4(n.matrixWorldInverse),s=o.applyMatrix4(n.projectionMatrix),l=e.mapNode.size/r*2;if(t){var u=this.parent._map.labelLanguage==p.default.ZH?e.mapNode.name:e.mapNode.ename;if(u){var c=u.split("%rn%").length;l*=c}i=l/e.material.userData.scaleRatio}else i=l;"PerspectiveCamera"==n.type&&(s.x*=n.aspect);var h={x:s.x-i/2,y:s.y+l/2},f={x:s.x+i/2,y:s.y-l/2};return{target:e,z:e.mapNode.eid,position:s,leftTop:h,rightDown:f}}},{key:"getMarkers",value:function(e,t,n){var r=[],i=this.groups[e];if(!i)return r;var a,o=i.getLayers("facility"),s=_(o);try{for(s.s();!(a=s.n()).done;)for(var l=a.value,u=0;u<l.scene.children.length;u++){var c=l.scene.children[u];if(l.needAvoid&&c.mapNode.needAvoid&&c.mapNode.show){var h=this.getSpriteInfo(c,!1,t,n);r.push(h)}}}catch(e){s.e(e)}finally{s.f()}var f,d=i.getLayers("label"),p=_(d);try{for(p.s();!(f=p.n()).done;)for(var m=f.value,v=0;v<m.scene.children.length;v++){var g=m.scene.children[v];if(m.needAvoid&&g.mapNode.needAvoid&&g.mapNode.show){var y=this.getSpriteInfo(g,!0,t,n);r.push(y)}}}catch(e){p.e(e)}finally{p.f()}return r.sort(function(e,t){return e.z-t.z}),r}},{key:"getAllImageMarker",value:function(e){var t=[],n=this.groups[e];if(!n)return t;for(var r=n.layers.imageMarker,i=0;i<r.length;i++)for(var a=0;a<r[i].scene.children.length;a++){var o=r[i].scene.children[a];t.push(o)}return t}},{key:"getUserMarkers",value:function(e,t,n){var r=[],i=this.groups[e];if(!i)return r;for(var a=i.layers.imageMarker,o=0;o<a.length;o++){var s=[];if(a[o].needAvoid){for(var l=0;l<a[o].scene.children.length;l++){var u=a[o].scene.children[l];if(u.mapNode.needAvoid&&u.mapNode.show){var c=this.getSpriteInfo(u,!1,t,n);s.push(c)}}r.push(s)}}for(var h=i.layers.textMarker,f=0;f<h.length;f++){var d=[];if(h[f].needAvoid){for(var p=0;p<h[f].scene.children.length;p++){var m=h[f].scene.children[p];if(m.mapNode.needAvoid&&m.mapNode.show){var v=this.getSpriteInfo(m,!0,t,n);d.push(v)}}r.push(d)}}return r}},{key:"getNodesExceptFacility",value:function(e,n){var t,r=[],i=_(e);try{for(i.s();!(t=i.n()).done;){var a=t.value,o=this.groups[a];o&&o.everyLayers(["facility","label","imageMarker","textMarker","dynmodel"],function(e){for(var t=0;t<e.children.length;t++)n&&!n(e.children[t])||r.push(e.children[t])})}}catch(e){i.e(e)}finally{i.f()}return r}},{key:"getDynnodes",value:function(n,e){var t,r=[],i=_(e);try{for(i.s();!(t=i.n()).done;){var a=t.value,o=this.groups[a];o&&o.getDynmodel(function(e){for(var t=0;t<e.children.length;t++)n&&!n(e.children[t])||r.push(e.children[t])})}}catch(e){i.e(e)}finally{i.f()}return r}},{key:"getGroupsModels",value:function(e){var t,n=[],r=_(e);try{for(r.s();!(t=r.n()).done;){var i=t.value,a=this.groups[i];if(a){var o,s=a.getLayers("model"),l=_(s);try{for(l.s();!(o=l.n()).done;){var u=o.value;u.checkSceneNode(),n=n.concat(u.scene.children)}}catch(e){l.e(e)}finally{l.f()}}}}catch(e){r.e(e)}finally{r.f()}return n}},{key:"getGroupsExternalModels",value:function(e){var t,n=[],r=_(e);try{for(r.s();!(t=r.n()).done;){var i=t.value,a=this.groups[i];if(a){var o,s=a.getLayers("externalModel"),l=_(s);try{for(l.s();!(o=l.n()).done;){var u=o.value;u.checkSceneNode();for(var c=0;c<u.scene.children.length;c++)u.scene.children[c].traverse(function(e){e instanceof fm.Mesh&&n.push(e)})}}catch(e){l.e(e)}finally{l.f()}}}}catch(e){r.e(e)}finally{r.f()}return n}},{key:"getGroupsNodelsByFilter",value:function(e,t,n){var r,i=[],a=_(e);try{for(a.s();!(r=a.n()).done;){var o=r.value,s=this.groups[o];for(var l in s.layers)if(t===l){var u,c=s.layers[l],h=_(c);try{for(h.s();!(u=h.n()).done;){var f=u.value;f.traverse(function(e){n(e)&&i.push({nodeType:e.nodeType,typeID:e.bdata&&e.bdata.type,data:e.bdata,target:e})})}}catch(e){h.e(e)}finally{h.f()}}}}catch(e){a.e(e)}finally{a.f()}return i}},{key:"getNodesExpectExtent",value:function(e){var t,n=[],r=_(e);try{for(r.s();!(t=r.n()).done;){var i=t.value,a=this.groups[i];a.everyLayers(["extent"],function(e){n.push.apply(n,(0,o.default)(e.children))})}}catch(e){r.e(e)}finally{r.f()}return n}},{key:"getRenderGroup",value:function(){var e=[];for(var t in this.groups)this.groups[t].visible&&e.push(this.groups[t]);return e.sort(function(e,t){return e.getHeight()-t.getHeight()})}},{key:"getLastRenderArray",value:function(){var e=[];for(var t in this.groups)e.push.apply(e,(0,o.default)(this.groups[t].alwaysShowMarkers));return e}},{key:"getHeight",value:function(e){var t;return t=this.groups[""+e]?this.groups[""+e].getHeight():this._space*e,t}},{key:"setLabelLanguage",value:function(t){for(var e in this.groups)this.groups[e].traverseByAlias(["label"],function(e){e.setByLanguage(t)})}},{key:"dispose",value:function(){for(var e in this.groups)this.groups[e].dispose(),this.groups[e].parent=void 0,this.groups[e]=void 0;this.groups=void 0,this._theme&&(this._theme.dispose(),this._theme=void 0)}},{key:"mapcenter",get:function(){return(new fm.Vector2).copy(this._mapcenter)}},{key:"groupLength",get:function(){return this._groupIds.length}},{key:"groupIds",get:function(){return this._groupIds}},{key:"center",get:function(){return(new fm.Vector2).copy(this._center)},set:function(e){this._center=e}},{key:"theme",set:function(e){this._theme=e},get:function(){return this._theme}},{key:"bbox",get:function(){return this._bbox}},{key:"bboxTh",get:function(){return this._bboxTh}},{key:"space",get:function(){return this._space},set:function(e){for(var t in this._space=e,this.groups){var n=(0,h.default)(t);this.groups[t].height=e*n}}}]),r}(),x=y;t.default=x},function(e,t,n){"use strict";var i=n(52);function r(e){var n,r;this.promise=new e(function(e,t){if(void 0!==n||void 0!==r)throw TypeError("Bad Promise constructor");n=e,r=t}),this.resolve=i(n),this.reject=i(r)}e.exports.f=function(e){return new r(e)}},function(e,t,n){"use strict";n(109)("anchor",function(t){return function(e){return t(this,"a","name",e)}})},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var s=r(n(18)),l=r(n(13)),u=r(n(17)),c=r(n(16)),a=r(n(15));n(10),n(5),n(4);var o=r(n(6));n(144);var m=r(n(32)),f=r(n(47)),h=r(n(2)),d=r(n(3)),p=r(n(7)),v=r(n(8)),g=r(n(9)),y=r(n(12));n(236);var _=r(n(237)),x=r(n(416)),w=r(n(239)),b=r(n(235)),M=n(74);function S(r){return function(){var e,t=(0,v.default)(r);if(E()){var n=(0,v.default)(this).constructor;e=(0,o.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,p.default)(this,e)}}function E(){if("undefined"==typeof Reflect||!o.default)return!1;if(o.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,o.default)(Date,[],function(){})),!0}catch(e){return!1}}function T(e){if(void 0===c.default||null==e[u.default]){if((0,l.default)(e)||(e=A(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i,a=!0,o=!1;return{s:function(){r=(0,s.default)(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){o=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(o)throw i}}}}function A(e,t){if(e){if("string"==typeof e)return L(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?(0,a.default)(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?L(e,t):void 0}}function L(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var R=function(e){var t,n=T(this._lineNodes);try{for(n.s();!(t=n.n()).done;){var r=t.value;r.line.material.uniforms.offset.value.y-=.001*e.delTime}}catch(e){n.e(e)}finally{n.f()}},C=function(e){(0,g.default)(n,e);var t=S(n);function n(){var e;return(0,h.default)(this,n),e=t.call(this),e._renderNode=null,e._segment=[],e._noAnimate=!0,e._lineDis=[],e._lineNodes=[],e._style=null,e._secLen=60,e._hwProp=10,e}return(0,d.default)(n,[{key:"addSegment",value:function(e){this._segment.push(e)}},{key:"convertPointByCenter",value:function(e,t){return[e.x-t.x,e.z,-e.y+t.y]}},{key:"segPointsToLinePnts",value:function(e){for(var t=[],n=0;n<this._segment.points.length;n++)if(0<n&&n<this._segment.points.length-1&&this._segment.points[n-1],t.push.apply(t,(0,f.default)(this.convertPointByCenter(this._segment.points[n],e))),0!==n){var r=new fm.Vector3(this._segment.points[n].x,this._segment.points[n].y,this._segment.points[n].z),i=new fm.Vector3(this._segment.points[n-1].x,this._segment.points[n-1].y,this._segment.points[n-1].z);this._lineDis.push(r.distanceTo(i))}return t}},{key:"getIndexDis",value:function(e){for(var t=0,n=0;n<this._lineDis.length;n++)n<e&&(t+=this._lineDis[n]);return t}},{key:"computerUVY",value:function(){for(var e=[],t=this.getIndexDis(this._lineDis.length),n=0;n<this._segment.points.length;n++)if(0===n)e.push(0);else if(n===this._segment.points.length-1)e.push(1);else{var r=this.getIndexDis(n)/t;e.push(r),e.push(r)}return e}},{key:"initLine",value:function(e,t,n){this._style=t;var r=this.getLineTextureParams(t.lineType,t.lineWidth,t.godColor,t.godEdgeColor,t.color);t.useMap=r.useMap,t.map=n.nodeManager.materialManager[r.txtureCommand](r),t.map.minFilter=fm.LinearFilter,t.map.generateMipmaps=!1,t.map.anisotropy=4;for(var i=this._segment.length-1;-1<i;i--){var a=this.createLine(this._segment[i],e,t,n),o=n.getFMGroup(this._segment[i].groupId);if(o){if(this._lineNodes.push({line:a,gid:this._segment[i].groupId,seg:this._segment[i],isCross:!1}),o.addLine(a),-1<i-1&&this._segment[i].groupId!=this._segment[i-1].groupId){var s=n.getFMGroup(this._segment[i-1].groupId);if(!s){console.warn(M.tileMessage.noGroup);continue}var l=s.height+s.offsetHeight,u=(0,m.default)({},this._segment[i-1].points[this._segment[i-1].points.length-1]),c=(0,m.default)({},this._segment[i].points[0]),h=n.getFMGroup(this._segment[i].groupId);if(!h){console.warn(M.tileMessage.noGroup);continue}u.z=l-h.height-h.offsetHeight+u.z-c.z;var f=new w.default([u,c]);f.groupId=this._segment[i].groupId;var d=this.createLine(f,e,t,n);this._lineNodes.push({line:d,gid:this._segment[i-1].groupId,gidAn:this._segment[i].groupId,seg:f,isCross:!0}),s.addLine(d)}}else console.warn(M.tileMessage.noGroup)}this._noAnimate=t.noAnimate,this._noAnimate||n.on("frameLoop",R.bind(this))}},{key:"conputeMaterialRepeat",value:function(e,t,n,r){var i=t.allLength,a=i*n.getPixelTo3DdisByGid(t.groupId),o=Math.floor(a*window.devicePixelRatio/r);e.uniforms.repeat.value.y=o}},{key:"resetRepeat",value:function(e){var t,n=T(this._lineNodes);try{for(n.s();!(t=n.n()).done;){var r=t.value;this.conputeMaterialRepeat(r.line.material,r.seg,e,this._secLen)}}catch(e){n.e(e)}finally{n.f()}}},{key:"rebuildLine",value:function(e,t,n,r){this.removeByMap(t);for(var i=this._style,a=this._segment.length-1;-1<a;a--){var o=this.createLine(this._segment[a],e,i,t),s=t.getFMGroup(this._segment[a].groupId);if(this._lineNodes.push({line:o,gid:this._segment[a].groupId,seg:this._segment[a],isCross:!1}),s.addLine(o),-1<a-1&&this._segment[a].groupId!=this._segment[a-1].groupId){var l=t.getFMGroup(this._segment[a-1].groupId),u=l.height+l.offsetHeight,c=(0,m.default)({},this._segment[a].points[this._segment[a].points.length-1]),h=(0,m.default)({},this._segment[a-1].points[0]),f=t.getFMGroup(this._segment[a].groupId);c.z=u-f.height-f.offsetHeight+c.z-h.z;var d=new w.default([c,h]);d.groupId=this._segment[a].groupId;var p=this.createLine(d,e,i,t);this._lineNodes.push({line:p,gid:this._segment[a-1].groupId,gidAn:this._segment[a].groupId,seg:d,isCross:!0}),l.addLine(p)}}this.hideOrShowBy(n,r)}},{key:"removeByMap",value:function(e,t){var n,r=T(this._lineNodes);try{for(r.s();!(n=r.n()).done;){var i=n.value;i.line.material.dispose(),i.line.geometry.dispose();var a=e.getFMGroup(i.gid);a.removeLine(i.line)}}catch(e){r.e(e)}finally{r.f()}t&&e.off("frameLoop",R),this._lineNodes.length=0}},{key:"dispose",value:function(e){this.removeByMap(e,!0)}},{key:"hideOrShowBy",value:function(e){var t,n=T(this._lineNodes);try{for(n.s();!(t=n.n()).done;){var r=t.value;r.isCross?e.indexOf(r.gid)<0||e.indexOf(r.gidAn)<0?r.line.visible=!1:r.line.visible=!0:-1<e.indexOf(r.gid)?r.line.visible=!0:r.line.visible=!1}}catch(e){n.e(e)}finally{n.f()}}},{key:"createLine",value:function(e,t,n,r){var i=r.getFMGroup(e.groupId),a=i.height+i.offsetHeight,o=new fm.Vector3(0,a,0),s=new _.default;e.needSmooth=!1!==n.smooth,e.initSegement(t,n.radius);var l=[];l.push.apply(l,(0,f.default)(e.linePoints));var u=e.uvys;s.setPositions(l),s.setUvys(u);var c=new fm.LineMaterial({color:n.color,linewidth:5,vertexColors:fm.VertexColors,dashed:!1,transparent:!0});c.resolution.set(n.resolution.x,n.resolution.y),c.linewidth=n.lineWidth,n.useMap&&(c.defines.USE_MMAP=!0,c.uniforms.mmap.value=n.map,n.map.wrapS=fm.RepeatWrapping,n.map.wrapT=fm.RepeatWrapping,this.conputeMaterialRepeat(c,e,r,this._secLen),c.needsUpdate=!0);var h=new x.default(s,c);return h.computeLineDistances(),h.position.set(o.x,o.y,o.z),h}},{key:"initLinePoints",value:function(e,t){var n=new _.default;n.setPositions(e);var r=new fm.LineMaterial({color:t.color,linewidth:t.lineWidth,vertexColors:fm.VertexColors,dashed:!1,transparent:!0});r.lineWidth=t.lineWidth,r.resolution.set(t.resolution.x,t.resolution.y),this._renderNode=new x.default(n,r),this._renderNode.computeLineDistances()}},{key:"moveUv",value:function(e){if(this._noAnimate){var t,n=T(this._lineNodes);try{for(n.s();!(t=n.n()).done;){var r=t.value;r.line.material.uniforms.offset.value.y-=e}}catch(e){n.e(e)}finally{n.f()}}}},{key:"getLineTextureParams",value:function(e,t,n,r,i){t=t||6;var a=t*this._hwProp;this._secLen=a;var o={type:"normal",width:128,height:128,color:"#ff0000",arrowHeightPercent:.6,arrowWidthPercent:1,arrowPercent:.1,lineType:null,dashArray:[2,1],txtureCommand:"createNormalLineTexture",godHeightPercent:1,godEdgePercent:.2,godArrowPercent:.15,arrawWidth:20,godColor:"#33cc61",godEdgeColor:"#4a82d2",godArrowColor:"#F4FEFB",godArrowXScale:4,godArrowWidthPercent:.9};switch(n&&(o.godColor=n),r&&(o.godEdgeColor=r),i&&(o.color=i),e){case b.default.FULL:o.useMap=!1;break;case b.default.DOTTED:o.dashArray=[1,1],o.useMap=!0;break;case b.default.DOT_DASH:o.dashArray=[2.5,1,.5,1],o.useMap=!0;break;case b.default.CENTER:o.dashArray=[3,1,1.5,1],o.useMap=!0;break;case b.default.DASH:o.dashArray=[2,1],o.useMap=!0;break;case b.default.DOUBLE_DOT_DASH:o.dashArray=[2.5,.5,.5,.5,.5,.5],o.useMap=!0;break;case b.default.TRI_DOT_DASH:o.dashArray=[2.5,.5,.5,.5,.5,.5,.5,.5],o.useMap=!0;break;case b.default.ARROW:o.dashArray=[5,0],o.useMap=!0,o.txtureCommand="createArrowLineTexture";break;case b.default.FMARROW:o.width=5*t,o.height=5*a,o.arrawWidth=o.height/12,o.dashArray=[7,0],o.useMap=!0,o.txtureCommand="createArrowWidthBackTexture";break;default:o.useMap=!1}return o}},{key:"renderNode",get:function(){return this._renderNode}},{key:"segment",get:function(){return this._segment}}]),n}(y.default),I=C,k=I;t.default=k},function(e,t,n){e.exports=!n(30)&&!n(41)(function(){return 7!=Object.defineProperty(n(112)("div"),"a",{get:function(){return 7}}).a})},function(e){var t;t=function(){return this}();try{t=t||new Function("return this")()}catch(e){"object"==typeof window&&(t=window)}e.exports=t},function(e,t,n){var a=n(42),o=n(250).set;e.exports=function(e,t,n){var r,i=t.constructor;return i!==n&&"function"==typeof i&&(r=i.prototype)!==n.prototype&&a(r)&&o&&o(e,r),e}},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,n){e.exports=!n(26)&&!n(23)(function(){return 7!=Object.defineProperty(n(158)("div"),"a",{get:function(){return 7}}).a})},function(e,t,n){var r=n(42),i=n(28).document,a=r(i)&&r(i.createElement);e.exports=function(e){return a?i.createElement(e):{}}},function(e,t,n){var o=n(53),s=n(90),l=n(160)(!1),u=n(117)("IE_PROTO");e.exports=function(e,t){var n,r=s(e),i=0,a=[];for(n in r)n!=u&&o(r,n)&&a.push(n);for(;t.length>i;)o(r,n=t[i++])&&(~l(a,n)||a.push(n));return a}},function(e,t,n){var l=n(90),u=n(37),c=n(92);e.exports=function(s){return function(e,t,n){var r,i=l(e),a=u(i.length),o=c(n,a);if(s&&t!=t){for(;o<a;)if(r=i[o++],r!=r)return!0}else for(;o<a;o++)if((s||o in i)&&i[o]===t)return s||o||0;return!s&&-1}}},function(e,t,n){"use strict";var r=n(28),i=n(38),a=n(26),o=n(20)("species");e.exports=function(e){var t=r[e];a&&t&&!t[o]&&i.f(t,o,{configurable:!0,get:function(){return this}})}},function(e,t,n){var o=n(35),s=n(29),l=n(81);e.exports=n(30)?Object.defineProperties:function(e,t){s(e);for(var n,r=l(t),i=r.length,a=0;a<i;)o.f(e,n=r[a++],t[n]);return e}},function(e,t,n){var o=n(49),s=n(61),l=n(255)(!1),u=n(125)("IE_PROTO");e.exports=function(e,t){var n,r=s(e),i=0,a=[];for(n in r)n!=u&&o(r,n)&&a.push(n);for(;t.length>i;)o(r,n=t[i++])&&(~l(a,n)||a.push(n));return a}},function(e,t,n){var r=n(19).document;e.exports=r&&r.documentElement},function(e,t,n){var r=n(49),i=n(54),a=n(125)("IE_PROTO"),o=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=i(e),r(e,a)?e[a]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?o:null}},function(e,t,n){var a=n(29);e.exports=function(t,e,n,r){try{return r?e(a(n)[0],n[1]):e(n)}catch(e){var i=t.return;throw void 0!==i&&a(i.call(t)),e}}},function(e,t,n){var r=n(60),i=n(24)("iterator"),a=Array.prototype;e.exports=function(e){return void 0!==e&&(r.Array===e||a[i]===e)}},function(e,t,n){var a=n(24)("iterator"),o=!1;try{var r=[7][a]();r.return=function(){o=!0},Array.from(r,function(){throw 2})}catch(e){}e.exports=function(e,t){if(!t&&!o)return!1;var n=!1;try{var r=[7],i=r[a]();i.next=function(){return{done:n=!0}},r[a]=function(){return i},e(r)}catch(e){}return n}},function(e,t,n){"use strict";var l=n(36),u=n(259),c=n(100);n(102)("search",1,function(r,i,o,s){return[function(e){var t=r(this),n=null==e?void 0:e[i];return void 0!==n?n.call(e,t):new RegExp(e)[i](String(t))},function(e){var t=s(o,e,this);if(t.done)return t.value;var n=l(e),r=String(this),i=n.lastIndex;u(i,0)||(n.lastIndex=0);var a=c(n,r);return u(n.lastIndex,i)||(n.lastIndex=i),null===a?-1:a.index}]})},function(e,t,n){var r=n(20)("unscopables"),i=Array.prototype;null==i[r]&&n(39)(i,r,{}),e.exports=function(e){i[r][e]=!0}},function(e,t,n){"use strict";var _=n(94),x=n(27),w=n(43),b=n(39),M=n(63),S=n(262),E=n(132),T=n(172),A=n(20)("iterator"),L=!([].keys&&"next"in[].keys()),R="@@iterator",C="keys",I="values",k=function(){return this};e.exports=function(e,t,n,r,i,a,o){S(n,t,r);var s,l,u,c=function(e){if(!L&&e in p)return p[e];switch(e){case C:case I:return function(){return new n(this,e)}}return function(){return new n(this,e)}},h=t+" Iterator",f=i==I,d=!1,p=e.prototype,m=p[A]||p[R]||i&&p[i],v=m||c(i),g=i?f?c("entries"):v:void 0,y="Array"==t&&p.entries||m;if(y&&(u=T(y.call(new e)),u!==Object.prototype&&u.next&&(E(u,h,!0),_||"function"==typeof u[A]||b(u,A,k))),f&&m&&m.name!==I&&(d=!0,v=function(){return m.call(this)}),_&&!o||!L&&!d&&p[A]||b(p,A,v),M[t]=v,M[h]=k,i)if(s={values:f?v:c(I),keys:a?v:c(C),entries:g},o)for(l in s)l in p||w(p,l,s[l]);else x(x.P+x.F*(L||d),t,s);return s}},function(e,t,n){var r=n(53),i=n(44),a=n(117)("IE_PROTO"),o=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=i(e),r(e,a)?e[a]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?o:null}},function(e){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,n){var r=n(163),i=n(127).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,i)}},function(e,t,n){var r=n(104),i=n(75),a=n(61),o=n(113),s=n(49),l=n(153),u=Object.getOwnPropertyDescriptor;t.f=n(30)?u:function(e,t){if(e=a(e),t=o(t,!0),l)try{return u(e,t)}catch(e){}if(s(e,t))return i(!r.f.call(e,t),e[t])}},function(e,t,n){var l=n(51),u=n(50);e.exports=function(s){return function(e,t){var n,r,i=String(u(e)),a=l(t),o=i.length;return a<0||o<=a?s?"":void 0:(n=i.charCodeAt(a),n<55296||56319<n||a+1===o||(r=i.charCodeAt(a+1))<56320||57343<r?s?i.charAt(a):n:s?i.slice(a,a+2):r-56320+(n-55296<<10)+65536)}}},function(e,t,n){var i=n(36),a=n(114),o=n(20)("species");e.exports=function(e,t){var n,r=i(e).constructor;return void 0===r||null==(n=i(r)[o])?t:a(n)}},function(e,t,n){"use strict";var h=n(30),f=n(81),d=n(136),p=n(104),m=n(54),v=n(124),i=Object.assign;e.exports=!i||n(41)(function(){var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach(function(e){t[e]=e}),7!=i({},e)[n]||Object.keys(i({},t)).join("")!=r})?function(e){for(var t=m(e),n=arguments.length,r=1,i=d.f,a=p.f;r<n;)for(var o,s=v(arguments[r++]),l=i?f(s).concat(i(s)):f(s),u=l.length,c=0;c<u;)o=l[c++],h&&!a.call(s,o)||(t[o]=s[o]);return t}:i},function(e,t,n){"use strict";var h=n(19),f=n(14),d=n(64),p=n(41),m=n(48),v=n(106),g=n(67),y=n(107),_=n(22),x=n(83),w=n(35).f,b=n(139)(0),M=n(30);e.exports=function(n,e,t,r,i,a){var o=h[n],s=o,l=i?"set":"add",u=s&&s.prototype,c={};return M&&"function"==typeof s&&(a||u.forEach&&!p(function(){(new s).entries().next()}))?(s=e(function(e,t){y(e,s,n,"_c"),e._c=new o,null!=t&&g(t,i,e[l],e)}),b("add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON".split(","),function(r){var i="add"==r||"set"==r;r in u&&(!a||"clear"!=r)&&m(s.prototype,r,function(e,t){if(y(this,s,r),!i&&a&&!_(e))return"get"==r&&void 0;var n=this._c[r](0===e?0:e,t);return i?this:n})}),a||w(s.prototype,"size",{get:function(){return this._c.size}})):(s=r.getConstructor(e,n,i,l),v(s.prototype,t),d.NEED=!0),x(s,n),c[n]=s,f(f.G+f.W+f.F,c),a||r.setStrong(s,n,i),s}},function(e,t,n){"use strict";var r=n(14);e.exports=function(e){r(r.S,e,{of:function(){for(var e=arguments.length,t=new Array(e);e--;)t[e]=arguments[e];return new this(t)}})}},function(e,t,n){"use strict";var r=n(14),l=n(52),u=n(40),c=n(67);e.exports=function(e){r(r.S,e,{from:function(e,t,n){var r,i,a,o,s=t;return l(this),r=void 0!==s,r&&l(s),null==e?new this:(i=[],r?(a=0,o=u(s,n,2),c(e,!1,function(e){i.push(o(e,a++))})):c(e,!1,i.push,i),new this(i))}})}},function(e,t,n){for(var r,i=n(28),a=n(39),o=n(78),s=o("typed_array"),l=o("view"),u=!(!i.ArrayBuffer||!i.DataView),c=u,h=0,f=9,d="Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array".split(",");h<f;)(r=i[d[h++]])?(a(r.prototype,s,!0),a(r.prototype,l,!0)):c=!1;e.exports={ABV:u,CONSTR:c,TYPED:s,VIEW:l}},function(e,t,n){var i=n(43);e.exports=function(e,t,n){for(var r in t)i(e,r,t[r],n);return e}},function(e){e.exports=function(e,t,n,r){if(!(e instanceof t)||void 0!==r&&r in e)throw TypeError(n+": incorrect invocation!");return e}},function(e,t,n){var r=n(51),i=n(37);e.exports=function(e){if(void 0===e)return 0;var t=r(e),n=i(t);if(t!==n)throw RangeError("Wrong length!");return n}},function(e,t,n){n(45)("Uint32",4,function(r){return function(e,t,n){return r(this,e,t,n)}})},function(e,t,n){n(45)("Int16",2,function(r){return function(e,t,n){return r(this,e,t,n)}})},function(e,t,n){n(45)("Int8",1,function(r){return function(e,t,n){return r(this,e,t,n)}})},function(e,t,n){var o=n(14),r=n(96),s=n(41),l=n(143),i="["+l+"]",u="​…",a=RegExp("^"+i+i+"*"),c=RegExp(i+i+"*$"),h=function(e,t,n){var r={},i=s(function(){return!!l[e]()||u[e]()!=u}),a=r[e]=i?t(f):l[e];n&&(r[n]=a),o(o.P+o.F*i,"String",r)},f=h.trim=function(e,t){return e=String(r(e)),1&t&&(e=e.replace(a,"")),2&t&&(e=e.replace(c,"")),e};e.exports=h},function(e,t,n){"use strict";var h=n(36),f=n(37),d=n(138),p=n(100);n(102)("match",1,function(r,i,u,c){return[function(e){var t=r(this),n=null==e?void 0:e[i];return void 0!==n?n.call(e,t):new RegExp(e)[i](String(t))},function(e){var t=c(u,e,this);if(t.done)return t.value;var n=h(e),r=String(this);if(!n.global)return p(n,r);var i=n.unicode;n.lastIndex=0;for(var a,o=[],s=0;null!==(a=p(n,r));){var l=String(a[0]);o[s]=l,""===l&&(n.lastIndex=d(r,f(n.lastIndex),i)),s++}return 0===s?null:o}]})},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var s=r(n(18)),l=r(n(17)),u=r(n(16)),a=r(n(15));n(10),n(5),n(4);var o=r(n(6)),h=r(n(47));n(21);var f=r(n(55));n(70),n(66);var d=r(n(31)),p=r(n(13)),v=r(n(25));n(169);var g,m=r(n(2)),y=r(n(3)),_=r(n(194)),c=r(n(7)),x=r(n(8)),w=r(n(9)),b=r(n(108)),M=r(n(196)),S=r(n(361)),E=r(n(57)),T=r(n(203)),A=r(n(34)),L=r(n(404)),R=r(n(73)),C=r(n(87)),I=r(n(58)),k=r(n(227)),P=r(n(228)),N=r(n(33)),D=r(n(229)),O=r(n(72)),F=r(n(406)),B=(n(74),r(n(199))),U=r(n(230)),G=r(n(231)),z=n(74),V=r(n(408));function H(e){if(void 0===u.default||null==e[l.default]){if((0,p.default)(e)||(e=W(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i,a=!0,o=!1;return{s:function(){r=(0,s.default)(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){o=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(o)throw i}}}}function W(e,t){if(e){if("string"==typeof e)return j(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?(0,a.default)(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?j(e,t):void 0}}function j(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Y(r){return function(){var e,t=(0,x.default)(r);if(q()){var n=(0,x.default)(this).constructor;e=(0,o.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,c.default)(this,e)}}function q(){if("undefined"==typeof Reflect||!o.default)return!1;if(o.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,o.default)(Date,[],function(){})),!0}catch(e){return!1}}function X(o){var e=this.MapOptions.mapThemeURL+"/"+this.MapOptions.defaultThemeName+"/"+this.MapOptions.defaultThemeName+".theme",s=this;this.fmServer.getTheme(e,function(e){s.initTheme(s.MapOptions.defaultThemeName,e,function(n){var r=null,e=s.MapOptions.mapServerURL,t="GET";if("fengmap"===s.MapOptions.mapServerURL){e="https://www.fengmap.com/FMCloud/sdk/auth/downMaps",s.MapOptions.tile&&(e="https://www.fengmap.com/FMCloud/sdk/authLayered/downMaps");var i=B.default.getCerityData(s.MapOptions.key,s.MapOptions.appName,o),a={newFlag:"2",mapId:i.mapId,keyValue:i.appKey,appName:i.appName,webUrl:i.webURL,keyType:3,isSeparate:s.MapOptions.tile};r=(0,b.default)(a),t="POST"}s.fmServer.getScene(e,o,s.MapOptions.tile,r,t,function(e,t){s.dataExcute(n,e,t,r)},function(e){g&&g(e)}),s._currentSceneId=o})})}var Z=function(e){(0,w.default)(c,e);var n=Y(c);function c(e){var t;return(0,m.default)(this,c),t=n.call(this),t.uuid=fm.Math.generateUUID(),C.default[t.uuid]={},t.MapOptions=new S.default(e),t.fmServer=new M.default,t.dataManager=new E.default,t.nodeManager=new A.default(t.MapOptions,(0,_.default)(t)),t.isMarkerTip=!1,e.isMarkerTip&&(t.isMarkerTip=!0),t.isMarkerMove=!1,e.isMarkerMove&&(t.isMarkerMove=!0),t.render=null,t.getRenderOption(),e.lightEffects?C.default.light=!0:C.default.light=!1,t.renderer=new T.default(t.MapOptions,(0,_.default)(t)),t.controls=new fm.OrbitControls("3d"===t.MapOptions.defaultViewMode?t.renderer.perspectiveCamera:t.renderer.orthographicCamera,t.renderer.canvas,(0,_.default)(t)),t.mapScaleLevels=[295829355.45,147914677.73,73957338.86,36978669.43,18489334.72,9244667.36,4622333.68,2311166.84,1155583.42,577791.71,288895.85,144447.93,72223.96,36111.98,18056,9028,4514,2257,1128,564,282,141,70,35,17,8,4,2,1],t._mapScaleLevel=20,t._mapScale=564,t._minScale=1,t._maxScale=295829355.45,t._minScaleLevel=1,t._maxScaleLevel=29,t._animaters=[],t._windowPops=[],t._currentSceneId="10347",t._currentFocusGroup=t.MapOptions.defaultFocusGroup,t._visibleGroups=t.MapOptions.defaultVisibleGroups,t._viewMode=t.MapOptions.defaultViewMode,t.renderer.viewMode=t.MapOptions.defaultViewMode,t._currentTime=(new Date).getTime(),t._showAllGroup=!1,t._lineMarkers=[],t._lastMoveEvent=null,t._mouseHoverTime=0,t._mouseHoverStart=!0,t._compassBG=t.MapOptions.compassBg,t._compassFG=t.MapOptions.compassFg,t.getMapScaleInfo(),t.scaleLevelInit(),t.controlEventInit(),t._loopHander=requestAnimationFrame(t.update.bind((0,_.default)(t))),t.allowRender=!0,t.pickFilterFunction=null,t.animationMixers=[],t.hoverFilterFunction=null,t._eventId=0,t._modelSelectColor={r:.97,g:.388,b:.196,a:1},t._fullScreen=!1,t._enterControl=new U.default,t._enterControl.enableMapHover=t.MapOptions.modelHoverEffect,t._allowfps=60,t._renderTime=0,t.controls.setEnterCtrl(t._enterControl),t.otherFocus=[],t.tileLoading=!1,t.letUpdate=!1,t.selectedObjects=[],t.isFpsDisplay=!1,t.stats=null,e.isFpsDisplay&&(t.isFpsDisplay=e.isFpsDisplay),t.isFpsDisplay&&(t.stats=new F.default,t.stats.showPanel(0),document.body.appendChild(t.stats.dom)),t.videoMemory=new V.default((0,_.default)(t)),t.getStation(),t}return(0,y.default)(c,[{key:"getRenderOption",value:function(){try{this.MapOptions.logarithmicDepthBuffer?this.render=new fm.WebGLRenderer({antialias:!0,alpha:!0,logarithmicDepthBuffer:!0}):this.render=new fm.WebGLRenderer({antialias:!0,alpha:!0})}catch(e){return console.error("WebGLRenderer ERROR: ",e),(new fengmap.MapError).noWebGL(this.renderOption.container),!1}this.canvas=this.render.domElement;var e=this.MapOptions.container.clientWidth,t=this.MapOptions.container.clientHeight;return this.perspectiveCamera=new fm.PerspectiveCamera(35,e/t,2,1e5),this.orthographicCamera=new fm.OrthographicCamera(-e/2,e/2,t/2,-t/2,1,1e5),!0}},{key:"isOnLine",value:function(e,t){var n=new Image;n.onload=function(){e&&e()},n.onerror=function(){t&&t()},n.style.display="none",n.src="http://www.baidu.com/img/baidu_sylogo1.gif?"+(""+Math.random()).slice(-6)}},{key:"openMapById",value:function(t,n){if(g=n,t)if(this.MapOptions.key){var e=/^[a-zA-z\d]{32}$/;if(e.test(this.MapOptions.key))if(this.MapOptions.appName){this._zopStep_=1;var r=this;this.MapOptions.useCompatibleOnLineCheck?this.isOnLine(i,a):(navigator.onLine?i:a)()}else console.warn(decodeURIComponent(cerityMessage.warn_noappname));else console.warn(decodeURIComponent(cerityMessage.warn_keynotright))}else console.warn(decodeURIComponent(cerityMessage.warn_nokey));else console.warn(decodeURIComponent(cerityMessage.warn_nomapid));function i(){"fengmap"===r.MapOptions.mapServerURL?B.default.checkIsOnLine(function(){B.default.checkOnLine(r.MapOptions.key,r.MapOptions.appName,t,function(){X.call(r,t,!0)},function(e){e?(console.warn(e.error_code,e.error_message),n&&n({msg:"线上验证失败!",data:e})):(console.warn("offLine 2"),X.call(r,t))},"POST")},function(){console.warn("offLine 1"),X.call(r,t)},1e3):X.call(r,t)}function a(){X.call(r,t)}}},{key:"search",value:function(e,t,n){return G.default.search(this,e,t,n)}},{key:"changeFocusToGroup",value:function(n){var r=this,e=this.nodeManager.getSceneCenter(this._currentSceneId),t=this.controls.target.y;this.currentFocusGroup=n.gid;var i=this.nodeManager.getHeight(this._currentSceneId,this.currentFocusGroup)+e.y;if(!this.MapOptions.focusAnimateMode)return this.controls.panUp(i-t),this.controls.update(),n.callback&&n.callback(),void this.setRenderList();C.default[this.uuid].currentGroupChangeAnimater&&(C.default[this.uuid].currentGroupChangeAnimater.stop(),this.removeAnimater(C.default[this.uuid].currentGroupChangeAnimater));var a=new R.default({h:t},{h:i},n.duration?1e3*n.duration:800,function(){r.removeAnimater(a),C.default[r.uuid].currentGroupChangeAnimater=null,n.callback&&n.callback()},function(e,t){r.controls.panUp(t.h),n.update&&n.update()}).start();C.default[this.uuid].currentGroupChangeAnimater=a,this._animaters.push(a)}},{key:"dataExcute",value:function(e,t,n,r){var i=this;if(this&&this.MapOptions){var a=new fm.Color(e.selectedColor);this._modelSelectColor.r=a.r,this._modelSelectColor.g=a.g,this._modelSelectColor.b=a.b,0===this.MapOptions.defaultBackgroundColor?this.MapOptions.defaultBackgroundColor=0:this.MapOptions.defaultBackgroundColor||(this.MapOptions.defaultBackgroundColor=I.default.toColor(e.data.viewtheme.clearcolor)),this.MapOptions.defaultBackgroundAlpha=(0,v.default)(e.data.viewtheme.clearalpha),this.renderer.setClearColor(this.MapOptions.defaultBackgroundColor,this.MapOptions.defaultBackgroundAlpha),this.dataManager.putRawScene(t,n);var o=this.dataManager.parseScene(n,this.MapOptions.tile,this.MapOptions.license);if(o){var s=!o.scene.key||B.default.checkOffLine(this.MapOptions.key,this.MapOptions.appName,"",o.scene.key);if(!s)return console.warn(decodeURIComponent(cerityMessage.warn_offline)),void(g&&g({message:decodeURIComponent(cerityMessage.warn_local)}));this.dataManager.putDecodeScene(o,n),this.nodeManager.conformatScene(o,n,e),this.groupSpace=this.MapOptions.defaultGroupSpace,this.initCameraPosition();var l=this.renderer.perspectiveCamera.position;l.x,l.y,l.z;var u=this.renderer.getFrustumByViewMode(this._viewMode),c=this.getVisibleGroups();if(this.MapOptions.tile){var h=this.nodeManager.getSceneById(this._currentSceneId);h.sdata=r;var f=h.getNeedLoadGroup(c),d=function(){var t=function(){var t=h.getNeedLoadGroup(c,!0);t.length<1?i.dispatchEvent({type:"loadComplete"}):i.loadAndExcuteData(t,h,0,!1,function(e){i.tileLoading=!1,e===t.length-1&&i.dispatchEvent({type:"loadComplete"})})};if(f.length<1)return i.dispatchEvent({type:"visibleGroupLoaded"}),void t();i.loadAndExcuteData(f,h,0,!1,function(e){i.nodeManager.checkNodeByFrustum(i.dataManager.getDecodeScene(i._currentSceneId),i.renderer.getFrustumByViewMode(i._viewMode),i.getVisibleGroups(),i.mapScaleLevel,n),i.setRenderList(),i.avoidMarkers(),e===f.length-1&&(i.dispatchEvent({type:"visibleGroupLoaded"}),t())})};this.tileLoading=!0;for(var p=-1,m=0;m<f.length;m++)if(f[m].gid&&f[m].gid==this._currentFocusGroup){p=m;break}if(p<0)return void console.error(z.tileMessage.noFocus);this.loadAndExcuteData(f,h,p,!0,function(){i.nodeManager.checkNodeByFrustum(i.dataManager.getDecodeScene(i._currentSceneId),i.renderer.getFrustumByViewMode(i._viewMode),i.getVisibleGroups(),i.mapScaleLevel,n),i.setRenderList(),i.avoidMarkers(),f.splice(p,1),d()})}else this.nodeManager.checkNodeByFrustum(o,u,c,this.mapScaleLevel,n),this.setRenderList(),this.avoidMarkers(),this.dispatchEvent({type:"visibleGroupLoaded"}),this.dispatchEvent({type:"loadComplete"}),this.renderer.setClearColor(this.MapOptions.defaultBackgroundColor,this.MapOptions.defaultBackgroundAlpha);this.letUpdate=!0}}}},{key:"loadAndExcuteData",value:function(o,s,l,u,c){var h=this,f=o[l];this.fmServer.getFloor(this.MapOptions.mapServerURL,f.url,this._currentSceneId,f.gid,function(e,t,n,r){var i=h.dataManager.parseFloor(e,t,n),a={geo:[i[0]],biz:[i[1]],navi:[i[2]],gid:r};h.dataManager.getDecodeScene(h._currentSceneId).floors.push(a),f.layerData.loaded=!0,s.addGroup(r,a,f.layerData),c&&c(l),u||(l++,l<o.length&&h.loadAndExcuteData(o,s,l,!1,c))},s.sdata)}},{key:"moveLinesUv",value:function(e){var t,n=H(this._lineMarkers);try{for(n.s();!(t=n.n()).done;){var r=t.value;r.moveUv(e)}}catch(e){n.e(e)}finally{n.f()}}},{key:"resetLineRepeat",value:function(){var e,t=H(this._lineMarkers);try{for(t.s();!(e=t.n()).done;){var n=e.value;n.resetRepeat(this)}}catch(e){t.e(e)}finally{t.f()}}},{key:"hideOrShowLine",value:function(){var e,t=this.groupIDs[this.groupIDs.length-1],n=H(this._lineMarkers);try{for(n.s();!(e=n.n()).done;){var r=e.value;r.hideOrShowBy(this._visibleGroups,t)}}catch(e){n.e(e)}finally{n.f()}}},{key:"getVisibleGroups",value:function(){return this._visibleGroups}},{key:"setVisibleGroups",value:function(e){this._visibleGroups=e,this.checkNode(),this.setRenderList(),this.dispatchEvent({type:"visibleGroupIDsChanged",gids:e})}},{key:"initCameraPosition",value:function(){var e=this.getCameraDistanceByScale(this.mapScale),t=this.MapOptions.defaultViewCenter;try{if(t){var n=this.nodeManager.getSceneById(this._currentSceneId).mapcenter;t.x-=n.x,t.y-=n.y}else t=this.nodeManager.getSceneById(this._currentSceneId).center;var r=this.nodeManager.getHeight(this._currentSceneId,this._currentFocusGroup);t.z=0,t.y+=r,this.controls.target=(new fm.Vector3).copy(t)}catch(e){console.error(z.mapOptionMessage.defaultViewCenterError)}if("3d"===this._viewMode){this.controls.minPolarAngle=(90-this.MapOptions.defaultMaxTiltAngle)*fm.Math.DEG2RAD,this.controls.maxPolarAngle=(90-this.MapOptions.defaultMinTiltAngle)*fm.Math.DEG2RAD;var i=(90-this.MapOptions.defaultTiltAngle)*fm.Math.DEG2RAD,a=e*Math.cos(i),o=e*Math.sin(i),s=new fm.Vector3(0,a,o);this.controls.object.position.set(t.x+s.x,t.y+s.y,t.z+s.z),this.controls.object.lookAt(t),this.renderer.orthographicCamera.position.set(t.x+s.x,t.y+s.y,t.z+s.z),this.renderer.orthographicCamera.lookAt(t)}else{var l=this.getCameraScaleByScale(this.mapScale);this.controls.minPolarAngle=0,this.controls.maxPolarAngle=0,this.controls.object.position.set(t.x,t.y+e,t.z),this.controls.object.zoom=1/l,this.controls.object.lookAt(t),this.renderer.orthographicCamera.updateProjectionMatrix()}var u=this.MapOptions.computePoseToAngle();this.controls.rotateLeft(u*fm.Math.DEG2RAD),this._changePanrange(e,t),this.controls.update()}},{key:"_changePanrange",value:function(){if(this.MapOptions.enabledPanRange){var e=.5,t=this.nodeManager.getSceneById(this._currentSceneId).bboxTh;this.controls.viewBox=new fm.Box3(new fm.Vector3(t.min.x,0,t.min.y),new fm.Vector3(t.max.x,this.getGroupHeight(this.groupIDs[this.groupIDs.length-1])+this.groupSpace,t.max.y)),this.controls.viewBox.min.multiplyScalar(e),this.controls.viewBox.max.multiplyScalar(e),this.controls.useRange=!0}}},{key:"scaleLevelInit",value:function(){if(this.MapOptions.mapScaleLevelRange&&this.setMapScaleLevelRange(this.MapOptions.mapScaleLevelRange),this.MapOptions.mapScaleRange&&this.setMapScaleRange(this.MapOptions.mapScaleRange),this.MapOptions.defaultMapScaleLevel){var e=this.MapOptions.defaultMapScaleLevel;this._mapScaleLevel=e,this._mapScale=this.levelToScale(e)}this.MapOptions.defaultMapScale&&(this.mapScale=this.MapOptions.defaultMapScale)}},{key:"setMapScaleRange",value:function(e,t){(0,p.default)(e)?(this.minScale=e[0],this.maxScale=e[1]):(this.minScale=e,this.maxScale=t)}},{key:"setMapScaleLevelRange",value:function(e,t){(0,p.default)(e)?(this.minScaleLevel=e[0],this.maxScaleLevel=e[1]):(this.minScaleLevel=e,this.maxScaleLevel=t)}},{key:"showSingerOrMultiGroup",value:function(e){this._showAllGroup=e,this.visibleGroupIDs=e?this.getCurrGroupIds().slice(0):[this._currentFocusGroup]}},{key:"removeAnimater",value:function(e){var t=this._animaters.indexOf(e);-1<t&&this._animaters.splice(t,1)}},{key:"dollyOut",value:function(){var n=this,r=1,e=new R.default({scale:1},{scale:2},500,function(){n.removeAnimater(e)},function(e){var t=e.scale/r;r=e.scale,n.controls.dollyOut(t)}).start();this._animaters.push(e)}},{key:"dollyIn",value:function(){var n=this,r=1,e=new R.default({scale:1},{scale:2},500,function(){n.removeAnimater(e)},function(e){var t=e.scale/r;r=e.scale,n.controls.dollyIn(t)}).start();this._animaters.push(e)}},{key:"zoomIn",value:function(){this.dollyIn()}},{key:"zoomOut",value:function(){this.dollyOut()}},{key:"checkNode",value:function(){if(this.renderer){var e,t=this.renderer.getFrustumByViewMode(this._viewMode),n=this._currentSceneId,r=this.dataManager.getDecodeScene(n);e="top"==this._viewMode?this.getScaleByCameraScale():this.getScaleByCameraDistance();var i=this.scaleTolevel(e);this.nodeManager.checkNodeByFrustum(r,t,this.getVisibleGroups(),i,n)}}},{key:"getCurrDecodeData",value:function(){var e=this._currentSceneId,t=this.dataManager.getDecodeScene(e);return t}},{key:"setBackgroundColor",value:function(e,t){"string"==typeof e&&(e=(0,d.default)(e.replace("#","0x"))),this.renderer.setClearColor(e,t)}},{key:"setBackground",value:function(e){this.renderer.setClearColor(0,0),this.renderer.setBackground(e)}},{key:"addAnimationMixer",value:function(e){this.animationMixers.push(e)}},{key:"setRenderList",value:function(){if(this.nodeManager){var e=this.nodeManager.getRenderList();this.renderer.renderList=e,this.renderer.resetSpriteSize()}}},{key:"rushRenderNode",value:function(){this.setRenderList(),this.renderer.resetSpriteSize()}},{key:"controlEventInit",value:function(){var i=this;this.controls.addEventListener("change",function(){var e;i.checkNode(),i.setRenderList(),i.avoidMarkers(),i.renderer.compassNode&&(i.renderer.compassNode.material.uniforms.rotation.value=-i.controls.getAzimuthalAngle()),e="top"===i._viewMode?i.getScaleByCameraScale():i.getScaleByCameraDistance(),i.dispatchEvent({type:"mapViewChanged"}),.5<Math.abs(e-i._mapScale)&&i.dispatchEvent({type:"scaleLevelChanged",scale:e}),i._mapScale=e;var t=i.scaleTolevel(e);t!==i._mapScaleLevel&&(i._mapScaleLevel=t,i.dispatchEvent({type:"mapScaleLevelChanged",mapScale:t})),i._mapScaleLevel=t,i.renderer.resetSpriteSize(),i.moveLinesUv(.01),i.resetLineRepeat(),i.renderer.resetLocationsSize()});var n=0,r=0,a=null;this.isMarkerMove&&this.MapOptions.container.addEventListener("mousedown",function(e){var t={x:2*e.offsetX/i.MapOptions.container.clientWidth-1,y:1-2*e.offsetY/i.MapOptions.container.clientHeight};n=(new Date).getTime(),a=setInterval(function(){if(r=(new Date).getTime(),500<r-n){var e=i.nodeManager.getFacility(i._currentSceneId,i.getVisibleGroups(),t,i.renderer.getCameraByViewMode(i._viewMode));0<e.length&&i.dispatchEvent({type:"press",target:e[0].object.mapNode}),clearInterval(a)}},250)}),this.controls.addEventListener("mouseup",function(e){var t=e.mousePoint,n={x:2*t.x/t.w-1,y:1-2*t.y/t.h};i._eventId++;var r=i.dispatchClickEvent(n,e.event);e.mouseButton===fm.MOUSE.LEFT&&r&&null!=r.target&&(4!=r.target._nodeType?i.modelFire(n):i.selectNull()),i.checkCompassClick(n),null!==a&&(clearInterval(a),a=null),i.dispatchEvent({type:"pressover"})}),this.controls.addEventListener("mousemove",function(e){(i.isMarkerTip||i.isMarkerMove)&&i.mouseIntoInfo(e),i._lastMoveEvent=e,i._mouseHoverTime=0,i._mouseHoverStart=!0,null!==a&&(clearInterval(a),a=null)})}},{key:"mouseIntoInfo",value:function(e){var t=e.mousePoint,n={x:2*t.x/t.w-1,y:1-2*t.y/t.h};if(!this.isMarkerTip){var r=this.nodeManager.getFacility(this._currentSceneId,this.getVisibleGroups(),n,this.renderer.getCameraByViewMode(this._viewMode));0!==r.length?this.dispatchEvent({type:"hover",target:r[0].object.mapNode}):this.dispatchEvent({type:"mouseleave"})}}},{key:"checkCompassClick",value:function(e){if(this.renderer.compassNode&&this.showCompass){var t=this.renderer.compassNode.userData;O.default.pointIsInRect(e,t.coord,t.width,t.width)&&this.dispatchEvent({type:"mapClickCompass",target:this.renderer.compassNode})}}},{key:"dispatchClickEvent",value:function(e,t){if(this._enterControl.enableMapSingleTap){var n,r=this.nodeManager.getNode(this._currentSceneId,this.getVisibleGroups(),e,this.renderer.getCameraByViewMode(this._viewMode)),i=this.nodeManager.getFacility(this._currentSceneId,this.getVisibleGroups(),e,this.renderer.getCameraByViewMode(this._viewMode)),a={type:"mapClickNode",target:null,mouse:t.mouse,domEvent:t,eventInfo:{domEvent:t,coord:null,eventID:this._eventId},nodeType:null};if(r.length<1&&i.length<1)return this.dispatchEvent(a),n={target:!0},n;if(1<=i.length){var o=0;if(this.pickFilterFunction){var s=this.pickFilterFunction({nodeType:i[0].object.mapNode.nodeType,typeID:i[0].object.mapNode.bdata&&i[0].object.mapNode.bdata.type,data:i[0].object.mapNode.bdata});s||(o=1)}n={type:"mapClickNode",target:i[0].object.mapNode,mouse:t.mouse,domEvent:t,eventInfo:{domEvent:t,coord:{x:i[0].object.mapNode.x,y:i[0].object.mapNode.y},eventID:this._eventId},mapCoord:{x:i[0].object.mapNode.x,y:i[0].object.mapNode.y},nodeType:i[0].object.mapNode.nodeType},1==o?this.dispatchEvent(a):this.dispatchEvent(n)}if(1<=r.length){var l=0;if(this.pickFilterFunction){var u=this.pickFilterFunction({nodeType:r[0].object.mapNode.nodeType,typeID:r[0].object.mapNode.bdata&&r[0].object.mapNode.bdata.type,data:r[0].object.mapNode.bdata});u||(l=1)}var c=(new fm.Vector3).copy(r[0].point);if(n={type:"mapClickNode",target:r[0].object.mapNode,mouse:t.mouse,domEvent:t,eventInfo:{domEvent:t,threeCoord:c,coord:{x:c.x+this.center.x,y:this.center.y-c.z},eventID:this._eventId},mapCoord:{x:c.x+this.center.x,y:this.center.y-c.z},nodeType:r[0].object.mapNode.nodeType},5==n.target._nodeType){for(var h in n.target.parent._models)n.target.parent._models[""+h]._renderNode&&1<n.target.parent._models[""+h]._renderNode.children.length&&(n.target.parent._models[""+h]._renderNode.children[1].renderOrder=10);1<n.target._renderNode.children.length&&(n.target._renderNode.children[1].renderOrder=11)}return 1==l?(this.dispatchEvent(a),a):(this.dispatchEvent(n),n)}}}},{key:"getDatasByAlias",value:function(e,t,n){n=n||function(){return!0};var r=this.nodeManager.getSceneById(this._currentSceneId);return r.getGroupsNodelsByFilter([e],t,n)}},{key:"mouseHoverEventFire",value:function(e){if(this._mouseHoverStart)if(this._mouseHoverTime>this.MapOptions.modelHoverTime){if(!this._enterControl.enableMapHover)return;if(!this._lastMoveEvent)return;var t=this._lastMoveEvent,n=t.mousePoint,r={x:2*n.x/n.w-1,y:1-2*n.y/n.h},i=this.nodeManager.getNode(this._currentSceneId,this.getVisibleGroups(),r,this.renderer.getCameraByViewMode(this._viewMode)),a=this.nodeManager.getFacility(this._currentSceneId,this.getVisibleGroups(),r,this.renderer.getCameraByViewMode(this._viewMode));if(i.length<1&&a.length<1)return;if(i[0]){var o=(new fm.Vector3).copy(i[0].point),s={type:"mapHoverNode",target:i[0].object.mapNode,mouse:n,eventInfo:{domEvent:t.event,threeCoord:i[0].point,eventID:t.eventID,coord:{x:o.x+this.center.x,y:i[0].object.mapNode.y-o.z}},groupID:i[0].object.mapNode.groupID,nodeType:i[0].object.mapNode.nodeType};if(this.hoverFilterFunction){var l=this.hoverFilterFunction({nodeType:i[0].object.mapNode.nodeType,typeID:i[0].object.mapNode.bdata&&i[0].object.mapNode.bdata.type,data:i[0].object.mapNode.bdata});l&&(i[0].object.mapNode.nodeType===N.default.MODEL&&this.MapOptions.modelHoverEffect&&this.storeSelect(i[0].object),this.dispatchEvent(s))}else i[0].object.mapNode.nodeType===N.default.MODEL&&this.MapOptions.modelHoverEffect&&this.storeSelect(i[0].object),this.dispatchEvent(s)}if(a[0]){var u=(new fm.Vector3).copy(a[0].point),c={type:"mapHoverNode",target:a[0].object.mapNode,mouse:n,eventInfo:{domEvent:t.event,threeCoord:a[0].point,eventID:t.eventID,coord:{x:u.x+this.center.x,y:a[0].object.mapNode.y-u.z}},groupID:a[0].object.mapNode.groupID,nodeType:a[0].object.mapNode.nodeType};if(this.hoverFilterFunction){var h=this.hoverFilterFunction({nodeType:a[0].object.mapNode.nodeType,typeID:a[0].object.mapNode.bdata&&a[0].object.mapNode.bdata.type,data:a[0].object.mapNode.bdata});h&&this.dispatchEvent(c)}else this.dispatchEvent(c)}this._mouseHoverStart=!1,this._mouseHoverTime=0}else this._mouseHoverTime+=e}},{key:"selectNull",value:function(){if(C.default[this.uuid].currentModel){C.default[this.uuid].currentAnimater&&(C.default[this.uuid].currentAnimater.stop(),C.default[this.uuid].currentAnimater=void 0);var e=C.default[this.uuid].currentModel;e.material.color=C.default[this.uuid].currentModel.material.userData.color,e.material.opacity=C.default[this.uuid].currentModel.material.userData.opacity,e.material.userData.opacity=void 0,e.material.userData.color=void 0,e.material.update=!0,C.default[this.uuid].currentModel=void 0}}},{key:"callAllLayersByAlias",value:function(e,t){this.nodeManager.getSceneById(this._currentSceneId).getAllGroupLayerByAlias(e,t)}},{key:"storeSelect",value:function(e){var t=this,n=e;if(e.nodeType&&e.nodeType===N.default.MODEL){if(!e.renderNodeInited)return;n=e.renderNode}if(C.default[this.uuid].currentModel&&C.default[this.uuid].currentModel!==n)if(C.default[this.uuid].currentAnimater&&(C.default[this.uuid].currentAnimater.stop(),C.default[this.uuid].currentAnimater=void 0),void 0===C.default[this.uuid].currentModel.material.length)C.default[this.uuid].currentModel.material.color=C.default[this.uuid].currentModel.material.userData.color,C.default[this.uuid].currentModel.material.opacity=C.default[this.uuid].currentModel.material.userData.opacity,C.default[this.uuid].currentModel.material.update=!0;else for(var r=0;r<C.default[this.uuid].currentModel.material.length;r++)C.default[this.uuid].currentModel.material[r].color=C.default[this.uuid].currentModel.material[r].userData.color,C.default[this.uuid].currentModel.material[r].opacity=C.default[this.uuid].currentModel.material[r].userData.opacity,C.default[this.uuid].currentModel.material[r].update=!0;if(C.default[this.uuid].currentModel=n,void 0===n.material.length)n.material.userData.color||(n.material.userData.color=n.material.color,n.material.userData.opacity=n.material.opacity);else for(var i=0;i<n.material.length;i++)n.material[i].userData.color||(n.material[i].userData.color=n.material[i].color,n.material[i].userData.opacity=n.material[i].opacity);if(!C.default[this.uuid].currentAnimater){var a=new R.default({r:this._modelSelectColor.r/2,g:this._modelSelectColor.g/2,b:this._modelSelectColor.b/2,a:this._modelSelectColor.a/2},this._modelSelectColor,500,function(){t.removeAnimater(a),C.default[t.uuid].currentAnimater=null},function(e){if(void 0===n.material.length)n.material.userData.color&&(n.material.color=new fm.Color(e.r,e.g,e.b),n.material.opacity=e.a,n.material.update=!0);else for(var t=0;t<n.material.length;t++)n.material[t].userData.color&&(n.material[t].color=new fm.Color(e.r,e.g,e.b),n.material[t].opacity=e.a,n.material[t].update=!0)});C.default[this.uuid].currentAnimater=a,a.start(),this._animaters.push(a)}}},{key:"modelFire",value:function(e){var t=[],n=[];if(this.MapOptions.lightEffects){t=this.nodeManager.getExternalModels(this._currentSceneId,this.getVisibleGroups(),e,this.renderer.getCameraByViewMode(this._viewMode)),n=this.nodeManager.getModel(this._currentSceneId,this.getVisibleGroups(),e,this.renderer.getCameraByViewMode(this._viewMode));var r=t.concat(n);if(r.length<1)return void this.selectNull();if(!this.MapOptions.modelSelectedEffect)return;this.storeSelect(r[0].object)}else{if(t=this.nodeManager.getModelExternal(this._currentSceneId,this.getVisibleGroups(),e,this.renderer.getCameraByViewMode(this._viewMode)),t.length<1)return void this.selectNull();if(!this.MapOptions.modelSelectedEffect)return;this.storeSelect(t[0].object)}}},{key:"setModelSelectColor",value:function(e,t){var n=new fm.Color;n.set(e),this._modelSelectColor={r:n.r,g:n.g,b:n.b,a:t}}},{key:"checkMarkerAvoid",value:function(e){if(!(e.length<1)){for(var t=e[0],n=[],r=1;r<e.length;r++)O.default.isRectCross(t.leftTop,t.rightDown,e[r].leftTop,e[r].rightDown)?e[r].target.visible=!1:(e[r].target.visible=!0,n.push(e[r]));1<n.length&&(n.reverse(),this.checkMarkerAvoid(n))}}},{key:"avoidMarkers",value:function(){var e=this.nodeManager.getSceneById(this._currentSceneId);if(e)for(var t=this.renderer.getCameraByViewMode(this._viewMode),n=0;n<this._visibleGroups.length;n++){var r=e.getMarkers(this._visibleGroups[n],t,this.renderer.domElementHeight);this.checkMarkerAvoid(r);for(var i=e.getUserMarkers(this._visibleGroups[n],t,this.renderer.domElementHeight),a=0;a<i.length;a++)this.checkMarkerAvoid(i[a])}}},{key:"addAnimater",value:function(e){this._animaters.push(e)}},{key:"initTheme",value:function(e,t,n){var r=this.MapOptions.themeFileType||t.filetype||t.fileType||t.image,i=new L.default(this.MapOptions.mapThemeURL,e);if(i.clearColor=this.MapOptions.defaultBackgroundColor,i.clearAlpha=this.MapOptions.defaultBackgroundAlpha,i.version=this.MapOptions.themeVersion,"rtheme"==r){var a=this.MapOptions.mapThemeURL+"/"+this.MapOptions.themeName+"/"+e+".rtheme";this.fmServer.getTheme(a,function(e){i.rtheme=e,i.data=t,n&&(i.fileType=r,n(i))},function(){i.rtheme=null,console.warn("以 rtheme 格式加入资源失败!")})}else i.rtheme=null,i.data=t,n&&n(i);this._modelSelectColor=i.getModelSelectColor()}},{key:"levelToScale",value:function(e){return this.mapScaleLevels[e-1]}},{key:"scaleTolevel",value:function(e){if(e>this.mapScaleLevels[0])return 1;if(e<this.mapScaleLevels[this.mapScaleLevels.length-1])return this.mapScaleLevels.length;for(var t=0;t<this.mapScaleLevels.length-1;t++)if(e>=this.mapScaleLevels[t+1]&&e<=this.mapScaleLevels[t]){var n=e-this.mapScaleLevels[t+1],r=this.mapScaleLevels[t]-e;return n<r?t+2:t+1}}},{key:"getMapScaleInfo",value:function(){for(var e,t=56;t<2e3;t++)!0===matchMedia("(max-resolution: "+t+"dpi)").matches&&(e=t/window.devicePixelRatio);if(window.screen.deviceXDPI)e=window.screen.deviceXDPI;else{var n=document.createElement("DIV");n.style.cssText="width:1in;height:1in;position:absolute;left:0px;top:0px;z-index:99;visibility:hidden",document.body.appendChild(n),e=(0,d.default)(n.offsetWidth),n.parentNode.removeChild(n)}this._pixelsPerCentimeter=e/2.54}},{key:"getOrthoCameraSizeByPerspectiveCamera",value:function(e,t,n){e instanceof c&&(n=t,t=e.controls,e=e.mapView.camera);var r=e.fov,i=e.aspect,a=null!=n?n:t.target.distanceTo(e.position),o=Math.tan(r*fm.Math.DEG2RAD/2)*a,s=2*o,l=s*i,u=l/2;return{top:o||1,right:u}}},{key:"getCameraDistanceByScale",value:function(e){var t=this.renderer.perspectiveCamera.fov,n=e/100*(this.renderer.domElementHeight/this._pixelsPerCentimeter)/2/Math.tan(t/2*fm.Math.DEG2RAD);return n}},{key:"getScaleByCameraDistance",value:function(){var e=this.renderer.perspectiveCamera.fov,t=(new fm.Vector3).copy(this.controls.object.position).sub(this.controls.target).length(),n=100*Math.tan(e/2*fm.Math.DEG2RAD)*2/(this.renderer.domElementHeight/this._pixelsPerCentimeter);return t*n}},{key:"getCameraScaleByScale",value:function(e){var t=this.renderer.orthographicCamera.top,n=this.renderer.orthographicCamera.bottom,r=Math.abs(t-n)*this._pixelsPerCentimeter*100/this.renderer.domElementHeight;return e/r}},{key:"getScaleByCameraScale",value:function(){var e=this.renderer.orthographicCamera.top,t=this.renderer.orthographicCamera.bottom,n=Math.abs(e-t)*this._pixelsPerCentimeter*100/this.renderer.domElementHeight;return n/this.renderer.orthographicCamera.zoom}},{key:"getLayerByAlias",value:function(e,t,n){var r=[],i=this.getFMGroup(e);return i.traverseByAlias([t],function(e){r.push(e),n&&n(e)},!0),r}},{key:"moveTo",value:function(e){return this._moveTo(e,!1)}},{key:"_moveTo",value:function(n,e){var t,r,i=this,a=this.center,o=n.x-a.x,s=-n.y+a.y,l=this.controls.target.x,u=this.controls.target.z,c=n.groupID;if(t=c?(r=this.controls.target.y,this.currentFocusGroup=c,this.nodeManager.getHeight(this._currentSceneId,this.currentFocusGroup)):(r=0,0),!this.MapOptions.moveToAnimateMode&&!e)return c&&this.controls.panUp(t-r),this.controls.panAdd({x:o-l,z:s-u,y:0}),this.controls.update(),null;C.default[this.uuid].currentMoveMapAnimater&&(C.default[this.uuid].currentMoveMapAnimater.stop(),this.removeAnimater(C.default[this.uuid].currentMoveMapAnimater));var h=new R.default({h:r,x:l,z:u},{h:t,x:o,z:s},n.time?1e3*n.time:500,function(){i.removeAnimater(h),C.default[i.uuid].currentMoveMapAnimater=null,n.callback&&n.callback()},function(e,t){c&&i.controls.panUp(t.h),i.controls.panAdd({x:t.x,z:t.z,y:0}),i.controls.update(),n.update&&n.update()}).start();return C.default[this.uuid].currentMoveMapAnimater=h,this._animaters.push(h),h}},{key:"moveToCenter",value:function(e){if("object"!==(0,f.default)(e)){var t=this.center;this.moveTo({x:t.x,y:t.y,groupID:e||this.focusGroupID})}else this.moveTo(e)}},{key:"rotateTo",value:function(n){var r=this,e=this.controls.getAzimuthalAngle(),t=-n.to%360*fm.Math.DEG2RAD,i=t,a=0;t-e!=0&&(a=Math.sin(t-e)/Math.abs(Math.sin(t-e))*Math.acos(Math.cos(t-e))),t=e+a,C.default[this.uuid].currentRotateAnimater&&(C.default[this.uuid].currentRotateAnimater.stop(),this.removeAnimater(C.default[this.uuid].currentRotateAnimater));var o=new R.default({theta:e},{theta:t},n.duration?1e3*n.duration:500,function(){r.removeAnimater(o),r.controls.setUpdate(void 0,void 0,void 0,i),n.callback&&n.callback()},function(e,t){r.controls.setUpdate(void 0,t.theta),n.update&&n.update()}).start();return C.default[this.uuid].currentRotateAnimater=o,this._animaters.push(o),o}},{key:"scaleTo",value:function(i,e){var a=this;if(i.scale){var t=i.scale,n=this.mapScale,r=this.getCameraDistanceByScale(t),o=this.controls.object.position.distanceTo(this.controls.target),s=(new fm.Vector3).copy(this.controls.object.position).sub(this.controls.target).normalize();if(!this.MapOptions.scaleToAnimateMode&&!e){var l=(new fm.Vector3).copy(s).multiplyScalar(r);this.controls.setUpdate(0,0,l);var u=this.getCameraScaleByScale(t);return this.renderer.orthographicCamera.zoom=1/u,this.renderer.orthographicCamera.updateProjectionMatrix(),this.renderer.resetSpriteSize(),null}var c=new R.default({phi:o,scale:n},{phi:r,scale:t},i.duration?1e3*i.duration:500,function(){a.removeAnimater(c),i.callback&&i.callback(),a.renderer.resetSpriteSize()},function(e,t){var n=(new fm.Vector3).copy(s).multiplyScalar(t.phi);a.controls.setUpdate(0,0,n),i.update&&i.update();var r=a.getCameraScaleByScale(e.scale);a.renderer.orthographicCamera.zoom=1/r,a.renderer.orthographicCamera.updateProjectionMatrix()}).start();return this._animaters.push(c),c}}},{key:"scaleLevelIn",value:function(){var e=this.scaleLevel;e--,this.scaleLevelTo({level:e})}},{key:"scaleLevelOut",value:function(){var e=this.scaleLevel;e++,this.scaleLevelTo({level:e})}},{key:"scaleLevelTo",value:function(i){var a=this;if(i.level){var e=this.levelToScale(i.level),t=this.mapScale,n=this.getCameraDistanceByScale(e),r=this.controls.object.position.distanceTo(this.controls.target),o=(new fm.Vector3).copy(this.controls.object.position).sub(this.controls.target).normalize();if(!i.duration){var s=(new fm.Vector3).copy(o).multiplyScalar(n-r);this.controls.setUpdate(0,0,s);var l=this.getCameraScaleByScale(e);return this.renderer.orthographicCamera.zoom=1/l,this.renderer.orthographicCamera.updateProjectionMatrix(),void this.controls.update()}var u=new R.default({phi:r,scale:t},{phi:n,scale:e},i.duration?1e3*i.duration:500,function(){a.removeAnimater(u),i.callback&&i.callback(),a.renderer.resetSpriteSize()},function(e,t){var n=(new fm.Vector3).copy(o).multiplyScalar(t.phi);a.controls.setUpdate(0,0,n),i.update&&i.update();var r=a.getCameraScaleByScale(e.scale);a.renderer.orthographicCamera.zoom=1/r,a.renderer.orthographicCamera.updateProjectionMatrix()}).start();return this._animaters.push(u),u}}},{key:"tiltTo",value:function(n){var r=this;if(0!==n.to&&n.to){var e=this.controls.getPolarAngle(),t=(90-n.to)*fm.Math.DEG2RAD,i=new R.default({phi:e},{phi:t},n.duration?1e3*n.duration:500,function(){r.removeAnimater(i),n.callback&&n.callback(),r.renderer.resetSpriteSize()},function(e,t){r.controls.setUpdate(t.phi),n.update&&n.update(e)}).start();return this._animaters.push(i),i}}},{key:"fullScreenAvaliable",value:function(){return!!(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}},{key:"coordMapToScreen",value:function(e,t,n){var r=this.threeCenter,i=this.center,a=this.controls.object,o=new fm.Vector3(e-i.x,r.y+n,-t+r.y+i.y);o.project(a);var s=this.renderer.container.clientWidth,l=this.renderer.container.clientHeight,u=s/2*o.x+s/2,c=-l/2*o.y+l/2;return{x:u,y:c}}},{key:"coordScreenToMap",value:function(e,t,n,r,i){var a=this.controls.object,o=1e-4,s=this.center,l=this.threeCenter,u=this.getFMGroup(this._currentFocusGroup).height;if(null!=u){n=void 0===n?u+this.MapOptions.pickCoordHeight:n;var c=null;c=r?new fm.Vector3(e,t,n):new fm.Vector3(e/this.renderer.domElementWidth*2-1,1-t/this.renderer.domElementHeight*2,.5);var h=new fm.Vector3,f=new fm.Vector3;a&&a.isPerspectiveCamera?(h.setFromMatrixPosition(a.matrixWorld),f.set(c.x,c.y,.5).unproject(a).sub(h).normalize()):a&&a.isOrthographicCamera&&(h.set(c.x,c.y,(a.near+a.far)/(a.near-a.far)).unproject(a),f.set(0,0,-1).transformDirection(a.matrixWorld));var d=new fm.Vector3(0,1,0),p=d.dot(f);if(!(Math.abs(p)<o)){var m=-h.y+n+l.y,v=m/f.y,g=(new fm.Vector3).copy(h).add((new fm.Vector3).copy(f).multiplyScalar(v));return i?g:{x:g.x+s.x,y:s.y-g.z,z:n}}}}},{key:"getScalelevelValueByVectics",value:function(e,t){return this.scaleTolevel(this.getScaleValueByVectics(e,t))}},{key:"getScaleValueByVectics",value:function(e,t){var n=Math.abs(t.x-e.x),r=Math.abs(t.y-e.y),i=this.renderer.domElementHeight,a=this.renderer.domElementWidth,o=null;if(a<=i)if(n/r<=a/i){var s=i/this._pixelsPerCentimeter;o=100*r/s}else{var l=a/this._pixelsPerCentimeter;o=100*n/l}else if(n/r<=a/i){var u=i/this._pixelsPerCentimeter;o=100*r/u}else{var c=a/this._pixelsPerCentimeter;o=100*n/c}return o}},{key:"toggleToTop",value:function(n,e){var r=this,t=1<arguments.length&&void 0!==e?arguments[1]:1e3;this.controls.minPolarAngle=0,this.controls.update();var i=this.controls.getPolarAngle();C.default[this.uuid].curPolarAngle=i,this.MapOptions.viewModeAnimateMode||(t=.001);var a=new R.default({phi:i},{phi:0},t,function(){r.removeAnimater(a),r.controls.maxPolarAngle=0;var e=r.getScaleByCameraDistance(),t=r.getCameraScaleByScale(e);r.renderer.orthographicCamera.zoom=1/t,r.renderer.orthographicCamera.quaternion.copy(r.controls.object.quaternion),r.renderer.orthographicCamera.position.copy(r.controls.object.position),r.renderer.orthographicCamera.updateProjectionMatrix(),r.controls.object=r.renderer.orthographicCamera,n&&n(),r.renderer.resetSpriteSize(),C.default[r.uuid].isToggleViewMode=!1},function(e,t){r.controls.setUpdate(t.phi)}).start();C.default[this.uuid].isToggleViewMode=!0,this._animaters.push(a)}},{key:"toggleTo3D",value:function(e,t){var n=this,r=1<arguments.length&&void 0!==t?arguments[1]:1e3;this.controls.maxPolarAngle=(90-this.MapOptions.defaultMinTiltAngle)*fm.Math.DEG2RAD;var i=this.getScaleByCameraScale(),a=this.getCameraDistanceByScale(i);this.renderer.perspectiveCamera.quaternion.copy(this.controls.object.quaternion),this.renderer.perspectiveCamera.position.copy(this.controls.object.position),this.renderer.perspectiveCamera.position.setY(this.controls.target.y+a),this.renderer.perspectiveCamera.updateMatrix(),this.controls.object=this.renderer.perspectiveCamera,this.renderer.resetSpriteSize();var o=C.default[this.uuid].curPolarAngle?C.default[this.uuid].curPolarAngle:(90-this.MapOptions.defaultTiltAngle)*fm.Math.DEG2RAD;this.MapOptions.viewModeAnimateMode||(r=.001);var s=new R.default({phi:0},{phi:o},r,function(){e&&e(),n.removeAnimater(s),C.default[n.uuid].isToggleViewMode=!1,n.renderer.resetSpriteSize()},function(e,t){n.controls.setUpdate(t.phi)}).start();C.default[this.uuid].isToggleViewMode=!0,this._animaters.push(s)}},{key:"getPixelTo3DdisByGid",value:function(e){var t,n,r=(new fm.Vector3).copy(this.controls.target),i=this.nodeManager.getSceneCenter(this._currentSceneId);if(r.y=this.getFMGroup(e).height+this.getFMGroup(e).offsetHeight+i.y,"top"===this._viewMode){var a=this.renderer.orthographicCamera.top,o=this.renderer.orthographicCamera.bottom;n=10*Math.abs(a-o)/this.renderer.domElementHeight/this.renderer.orthographicCamera.zoom}else{var s=this.renderer.perspectiveCamera.near,l=this.renderer.perspectiveCamera.fov,u=this.controls.object.position.distanceTo(r);t=10*s*Math.tan(l/2*fm.Math.DEG2RAD)*2/this.renderer.domElementHeight,n=t*u/s}return 10/n}},{key:"dispose",value:function(){cancelAnimationFrame(this._loopHander),this.dispatchEvent({type:"dispose"});var e,t=H(this._lineMarkers);try{for(t.s();!(e=t.n()).done;){var n=e.value;n.dispose(this)}}catch(e){t.e(e)}finally{t.f()}this.nodeManager.dispose(),this.dataManager.dispose(),this.controls.dispose(),this.renderer.dispose(),C.default.dispose(this.uuid),this._lineMarkers.length=0,this._windowPops.length=0,this.nodeManager=void 0,this.dataManager=void 0,this.controls=void 0,this.renderer=void 0,this.fmServer=void 0,this.MapOptions=void 0}},{key:"disposeById",value:function(e){this.nodeManager.disposeById(e),this.dataManager.disposeById(e)}},{key:"addLocationMarker",value:function(e){e.map=this,e.scene=this.nodeManager.getSceneById(this._currentSceneId),e.initSprite(this.nodeManager),this.addLocationToGroup(e,this._currentSceneId,e.groupID),e.renderNode.updateMatrixWorld(!0),this.renderer.setLocationSize(e.renderNode,e.size)}},{key:"addLocationToGroup",value:function(e,t,n){var r=this.nodeManager.getGroup(t,n);r.addLocation(e)}},{key:"removeLocationMarker",value:function(e){this.removeLocationByGroup(e,this._currentSceneId,e.groupID),e.dispose()}},{key:"removeLocationByGroup",value:function(e,t,n){var r=this.nodeManager.getGroup(t,n);r.removeLocation(e)}},{key:"addLineMarker",value:function(e,t){var n=this.center;e.initLine(n,t,this),this._lineMarkers.push(e),e.hideOrShowBy(this.visibleGroupIDs)}},{key:"removeLineMarker",value:function(e){var t=this._lineMarkers.indexOf(e);-1<t&&this._lineMarkers.splice(t,1),e.removeByMap(this)}},{key:"removeAllMarkers",value:function(){for(var e=this._lineMarkers.length-1;-1<e;e--)this._lineMarkers[e].removeByMap(this);this._lineMarkers.length=0}},{key:"clearLineMark",value:function(e){if(e)if((0,p.default)(e)){var t,n=H(e);try{for(n.s();!(t=n.n()).done;){var r=t.value;this.removeLineMarker(r)}}catch(e){n.e(e)}finally{n.f()}}else this.removeLineMarker(e);else this.removeAllMarkers()}},{key:"drawLineMark",value:function(e,t){t.resolution=new fm.Vector2(this.renderer.container.clientWidth,this.renderer.container.clientHeight);var n=this.renderer.getCameraByViewMode(this._viewMode);t.near=n.near,t.far=n.far,t.url&&(t.map=this.nodeManager.materialManager.loadTexture(t.url,function(){}),t.map.wrapS=fm.RepeatWrapping,t.map.wrapT=fm.RepeatWrapping),this.addLineMarker(e,t)}},{key:"setLastRender",value:function(){var e=this.nodeManager.getSceneById(this._currentSceneId);if(e){var t=e.getLastRenderArray();this.renderer.setBackRender(t)}}},{key:"update",value:function(){if(this._loopHander=requestAnimationFrame(this.update.bind(this)),this.letUpdate){this.isFpsDisplay&&this.stats.begin();var e=(new Date).getTime(),t=e-this._currentTime;this._currentTime=e,this.mouseHoverEventFire(t);var n,r=H(this._animaters);try{for(r.s();!(n=r.n()).done;){var i=n.value;i.enable&&i.run(t)}}catch(e){r.e(e)}finally{r.f()}var a,o=H(this.animationMixers);try{for(o.s();!(a=o.n()).done;){var s=a.value;s.update(t/1e3)}}catch(e){o.e(e)}finally{o.f()}this.dispatchEvent({type:"frameLoop",delTime:t}),this.controls.update();var l,u=!1;this._renderTime+=t,1e3/this._allowfps<this._renderTime&&(l=this._renderTime,this._renderTime=0,u=!0),this.renderer&&u&&(this.updatePopsPosition(),this.allowRender&&(this.setLastRender(),this.renderer.update(this._viewMode)),this.dispatchEvent({type:"update",fps:1e3/l})),this.isFpsDisplay&&this.stats.end()}}},{key:"on",value:function(e,t){this.addEventListener(e,t)}},{key:"off",value:function(e,t){this.removeEventListener(e,t)}},{key:"registeredPop",value:function(e){this._windowPops.push(e)}},{key:"logoutPop",value:function(e){var t=this._windowPops.indexOf(e);-1<t&&this._windowPops.splice(t,1)}},{key:"updatePopsPosition",value:function(){var e,t=this.renderer.getCameraByViewMode(this._viewMode),n=H(this._windowPops);try{for(n.s();!(e=n.n()).done;){var r=e.value;this.updatePopPosition(r,t)}}catch(e){n.e(e)}finally{n.f()}}},{key:"updatePopPosition",value:function(e,t){t=t||this.renderer.getCameraByViewMode(this._viewMode);var n=new fm.Vector3;if(e.threeCoord)n.copy(e.threeCoord);else if(e.marker)e.marker instanceof D.default?0<e.marker._meshes.length&&(e.marker._meshes[0].updateMatrixWorld(),e.marker._meshes[0].updateMatrixWorld(!0),n=(new fm.Vector3).setFromMatrixPosition(e.marker._meshes[0].matrixWorld)):(e.marker.renderNode.parent.updateMatrixWorld(),e.marker.renderNode.updateMatrixWorld(!0),n=(new fm.Vector3).setFromMatrixPosition(e.marker.renderNode.matrixWorld));else{var r=this.center;n=n.set(e.coord.x-r.x,this.getFMGroup(e.coord.groupID).getHeight()+e.coord.height,-e.coord.y+r.y)}var i=n.project(t),a=(i.x+1)/2*this.renderer.container.clientWidth,o=(1-i.y)/2*this.renderer.container.clientHeight;e.updateCoord(a,o)}},{key:"getFMGroup",value:function(e){return this.nodeManager.getGroup(this._currentSceneId,e)}},{key:"getGroupHeight",value:function(e){return this.getFMGroup(e).getHeight()}},{key:"getContainer",value:function(){return this.renderer.container}},{key:"getCurrGroupLength",value:function(){this.nodeManager.getGroupLength(this._currentSceneId)}},{key:"getCurrGroupIds",value:function(){return this.nodeManager.getGroupIds(this._currentSceneId)}},{key:"screenshot",value:function(e,t,n,l,u){var c=t.x-e.x,h=t.y-e.y,r={x:0,y:0};r.x=(t.x+e.x)/2,r.y=(t.y+e.y)/2;var i=this.renderer.container.getElementsByTagName("canvas")[0].style.width,a=this.renderer.container.getElementsByTagName("canvas")[0].style.height,o=i.split("p")[0],f=a.split("p")[0],d=null;d=(t.x-e.x)/(t.y-e.y)>o/f?o/(t.x-e.x):f/(t.y-e.y);var s=r.x-o/2,p=r.y-f/2,m=document.getElementsByTagName("canvas")[0],v=document.createElement("canvas"),g=document.createElement("canvas"),y=document.createElement("canvas"),_=window.devicePixelRatio,x=new Image;"3d"===this.viewMode?this.renderer.perspectiveCamera.setViewOffset(o*d,f*d,o*(d-1)/2+s*d,f*(d-1)/2+p*d,o,f):this.renderer.orthographicCamera.setViewOffset(o*d,f*d,o*(d-1)/2+s*d,f*(d-1)/2+p*d,o,f),this.renderer.update(),v.width=c*d*_,v.height=h*d*_,v.style.width=c*d*_+"px",v.style.height=h*d*_+"px",n?(g.width=1240*Math.pow(1.414,l-1),g.height=1754*Math.pow(1.414,l-1),g.style.width=1240*Math.pow(1.414,l-1)+"px",g.style.height=1754*Math.pow(1.414,l-1)+"px"):(g.height=1240*Math.pow(1.414,l-1),g.width=1754*Math.pow(1.414,l-1),g.style.height=1240*Math.pow(1.414,l-1)+"px",g.style.width=1754*Math.pow(1.414,l-1)+"px"),y.height=h*Math.pow(1.414,l-1),y.width=c*Math.pow(1.414,l-1),y.style.height=h*Math.pow(1.414,l-1)+"px",y.style.width=c*Math.pow(1.414,l-1)+"px",x.src=m.toDataURL("image/png"),"3d"===this.viewMode?this.renderer.perspectiveCamera.clearViewOffset():this.renderer.orthographicCamera.clearViewOffset();var w=v.getContext("2d"),b=g.getContext("2d"),M=y.getContext("2d"),S=this;x.onload=function(){S.viewMode,w.drawImage(x,-(o*_-c*d*_)/2,-(f*_-h*d*_)/2);var s=new Image;s.src=v.toDataURL("image/png"),s.onload=function(){var e=Math.min(1240*Math.pow(1.414,l-1)/(c*d),1754*Math.pow(1.414,l-1)/(h*d)),t=(g.width-c*d*e)/2,n=(g.height-h*d*e)/2;b.drawImage(s,t,n,c*d*e,h*d*e),M.drawImage(s,0,0,c*Math.pow(1.414,l-1),h*Math.pow(1.414,l-1));var r=g.toDataURL("image/png"),i=y.toDataURL("image/png");if(-1<navigator.userAgent.indexOf("Edge")||-1<navigator.userAgent.indexOf(".NET4.0C")){var a=null,o=null;u(r,a,i,o)}else g.toBlob(function(t){y.toBlob(function(e){u(r,t,i,e)})})}}}},{key:"enableKeys",value:function(e){this.controls.enableKeys=e}},{key:"getSearchObjects",value:function(e){for(var t=[],n=0;n<e.length;n++){var r=null;5===e[n].nodeType?r="model":4===e[n].nodeType?r="extent":12===e[n].nodeType?r="label":11===e[n].nodeType?r="facility":35===e[n].nodeType&&(r="externalModel"),t.push(this.getFMGroup(e[n].groupID).getNodeByLayerId(r,e[n].ID))}return t}},{key:"getEffectRenderer",value:function(){var e=new EffectRenderer(this.MapOptions,this);return this.renderer=e,e}},{key:"getCompassOffset",value:function(){return{left:this.MapOptions.compassOffset[0],top:this.MapOptions.compassOffset[1]}}},{key:"setCompassOffset",value:function(e,t){this.MapOptions.compassOffset[0]=t,this.MapOptions.compassOffset[1]=e,this.renderer.resetCompass()}},{key:"getCompassScale",value:function(){return this.MapOptions.compassSize}},{key:"setCompassScale",value:function(e){this.MapOptions.compassSize=e,this.renderer.resetCompass()}},{key:"getStation",value:function(){var e={};-1<navigator.userAgent.indexOf("Opera")&&(e.userAgent="Opera"),-1<navigator.userAgent.indexOf("Firefox")&&(e.userAgent="FF"),-1<navigator.userAgent.indexOf("Chrome")&&(e.userAgent="Chrome"),-1<navigator.userAgent.indexOf("Safari")&&0===navigator.userAgent.indexOf("Chrome")&&(e.userAgent="Safari"),-1<navigator.userAgent.indexOf("compatible")&&-1<navigator.userAgent.indexOf("MSIE")&&!isOpera&&(e.userAgent="IE"),-1<navigator.userAgent.indexOf("Trident")&&(e.userAgent="Edge"),e.sdkVersion=k.default.VERSION+"."+k.default.BUILD,e.appName=this.MapOptions.appName;var t=document.createElement("canvas"),n=t.getContext("experimental-webgl"),r=n.getExtension("WEBGL_debug_renderer_info");e.gpu=n.getParameter(r.UNMASKED_RENDERER_WEBGL),e.os=navigator.platform;for(var i=!0,a=navigator.userAgent,o=new Array("Android","iPhone","SymbianOS","Windows Phone","iPad","iPod"),s=0;s<o.length;s++)if(0<a.indexOf(o[s])){i=!1;break}i&&(e.device="pc");var l=new Date;e.time=l.getFullYear()+"-"+(l.getMonth()+1)+"-"+l.getDate()+" "+l.getHours()+":"+l.getMinutes();var u=(0,b.default)(e),c=new XMLHttpRequest;return c.open("POST","https://www.fengmap.com/FMCloud/sdk/collect",!0),c.setRequestHeader("Content-type","application/json"),c.setRequestHeader("X-Requested-With","XMLHttpRequest"),c.onreadystatechange=function(){4===c.readyState&&c.status},c.send(u),e}},{key:"getVideoMemoryAmount",value:function(e){var t=null;return t=this.videoMemory.getVideoMemoryAmount(e),t}},{key:"setThemeByJson",value:function(e,t){var n=this,r=this.nodeManager.getSceneById(this._currentSceneId);n.initTheme(e,t,function(e){n.setBackgroundColor(e.clearColor,e.clearAlpha),r.theme=e,r.changeTheme(e)})}},{key:"showAllGroup",get:function(){return this._showAllGroup}},{key:"compass",get:function(){var t=this,n=this.renderer,r=this.nodeManager.materialManager;return{setBgImage:function(e){t._compassBG=e,n.compassNode&&(n.compassNode.material.uniforms.mapBack.value=r.loadTexture(e,function(){n.compassNode.material.needsUpdate=!0}))},setFgImage:function(e){t._compassFG=e,n.compassNode&&(n.compassNode.material.uniforms.mapfront.value=r.loadTexture(e,function(){n.compassNode.material.needsUpdate=!0}))}}}},{key:"modelSelectColor",get:function(){return this._modelSelectColor}},{key:"groupIDs",get:function(){var e=[];return e.push.apply(e,(0,h.default)(this.nodeManager.getSceneById(this._currentSceneId).groupIds)),e}},{key:"visibleGroupIDs",get:function(){return this.getVisibleGroups()},set:function(e){this._visibleGroups=e,this.hideOrShowLine(),this.checkNode(),this.setRenderList(),this.renderer.resetSpriteSize(),this.dispatchEvent({type:"visibleGroupIDsChanged",gids:e})}},{key:"mapScaleLevel",set:function(e){var t,n;"object"===(0,f.default)(e)&&(t=e.duration,n=e.callback,e=e.level),e<this.minScaleLevel?e=this.minScaleLevel:e>this.maxScaleLevel&&(e=this.maxScaleLevel),this.scaleLevelTo({level:e,duration:t,callback:n}),this._mapScale=this.levelToScale(e),this._mapScaleLevel=e},get:function(){return this._mapScaleLevel}},{key:"mapScale",get:function(){return this._mapScale},set:function(e){e<this.minScale?e=this.minScale:e>this.maxScale&&(e=this.maxScale),this.scaleTo({scale:e}),this._mapScaleLevel=this.scaleTolevel(e),this._mapScale=e}},{key:"scaleLevel",get:function(){return this.mapScaleLevel}},{key:"maxScale",set:function(e){e<=this.mapScaleLevels[this.mapScaleLevels.length-1]?e=this.mapScaleLevels[this.mapScaleLevels.length-2]:e>this.mapScaleLevels[0]&&(e=this.mapScaleLevels[0]),this._minScaleLevel=this.scaleTolevel(e),this._maxScale=e,this.controls.maxDistance=this.getCameraDistanceByScale(this._maxScale)},get:function(){return this._maxScale}},{key:"minScale",set:function(e){e<this.mapScaleLevels[this.mapScaleLevels.length-1]?e=this.mapScaleLevels[this.mapScaleLevels.length-1]:e>=this.mapScaleLevels[0]&&(e=this.mapScaleLevels[1]),this._maxScaleLevel=this.scaleTolevel(e),this._minScale=e,this.controls.minDistance=this.getCameraDistanceByScale(this._minScale)},get:function(){return this._minScale}},{key:"minScaleLevel",set:function(e){e<1&&(e=1),29<=e&&(e=28),this._maxScale=this.levelToScale(e),this.controls.maxDistance=this.getCameraDistanceByScale(this._maxScale),this.controls.minZoom=1/this.getCameraScaleByScale(this._maxScale),this._minScaleLevel=e},get:function(){return this._minScaleLevel}},{key:"maxScaleLevel",set:function(e){e<=1&&(e=2),29<e&&(e=29),this._minScale=this.levelToScale(e),this._maxScaleLevel=e,this.controls.minDistance=this.getCameraDistanceByScale(this._minScale),this.controls.maxZoom=1/this.getCameraScaleByScale(this._minScale)},get:function(){return this._maxScaleLevel}},{key:"maxFps",set:function(e){this._allowfps=e},get:function(){return this._allowfps}},{key:"viewMode",get:function(){return this._viewMode},set:function(t){var n=this;if(!C.default[this.uuid].isToggleViewMode){var r=function(){n.dispatchEvent({type:"viewModeChange",mode:t})};if("3d"==t&&"3d"!=this._viewMode){this.renderer.viewMode=t,this._viewMode=t;var e=this.nodeManager.getRenderList();this.renderer.renderList=e,this.toggleTo3D(function(){r()},1e3*this.MapOptions.viewModeAnimateTime)}else"top"==t&&"top"!=this._viewMode&&this.toggleToTop(function(){n._viewMode=t,n.renderer.viewMode=t;var e=n.nodeManager.getRenderList();n.renderer.renderList=e,r()},1e3*this.MapOptions.viewModeAnimateTime)}}},{key:"showCompass",set:function(e){if(e&&!this.renderer.compassNode){var t=this.renderer.getAspect(),n=this.renderer.getScaleByPixels(1,this.MapOptions.compassSize),r=-this.renderer.getScaleByPixels(1,this.MapOptions.compassOffset[1]),i=this.renderer.getScaleByPixels(1,this.MapOptions.compassOffset[0])/t,a=this.renderer.getCompassOffset(this.MapOptions.compassPosition,n,t,i,r);this.renderer.compassNode=this.nodeManager.createCompassNode(n,this._compassBG,this._compassFG,a.ox,a.oy),this.renderer.compassNode.material.uniforms.rotation.value=-this.controls.getAzimuthalAngle()}this.renderer.showCompass=e},get:function(){return this.renderer.showCompass}},{key:"currentFocusGroup",get:function(){return this._currentFocusGroup},set:function(e){this._currentFocusGroup=e,1<this.visibleGroupIDs.length?-1<this.visibleGroupIDs.indexOf(e)||(this.visibleGroupIDs.push(e),this.visibleGroupIDs=this.visibleGroupIDs,this.checkNode(),this.setRenderList()):this.visibleGroupIDs=[e],this.dispatchEvent({type:"focusGroupIDChanged",gid:e})}},{key:"focusGroupID",set:function(e){this.changeFocusToGroup({gid:e})},get:function(){return this.currentFocusGroup}},{key:"center",get:function(){return(new fm.Vector3).copy(this.nodeManager.getSceneById(this._currentSceneId).mapcenter)}},{key:"threeCenter",get:function(){return(new fm.Vector3).copy(this.nodeManager.getSceneById(this._currentSceneId).center)}},{key:"maxX",get:function(){return this.nodeManager.getSceneById(this._currentSceneId).bbox.max.x}},{key:"maxY",get:function(){return this.nodeManager.getSceneById(this._currentSceneId).bbox.max.y}},{key:"minX",get:function(){return this.nodeManager.getSceneById(this._currentSceneId).bbox.min.x}},{key:"minY",get:function(){return this.nodeManager.getSceneById(this._currentSceneId).bbox.min.y}},{key:"groupSpace",get:function(){return this.nodeManager.getSceneById(this._currentSceneId).space},set:function(e){var t=this.nodeManager.getSceneById(this._currentSceneId);t.space=e;var n,r=t.mapcenter,i=this.groupIDs[this.groupIDs.length-1],a=H(this._lineMarkers);try{for(a.s();!(n=a.n()).done;){var o=n.value;o.rebuildLine(r,this,this._visibleGroups,i)}}catch(e){a.e(e)}finally{a.f()}}},{key:"themeName",set:function(t){var e=this.MapOptions.mapThemeURL+"/"+t+"/"+t+".theme",n=this,r=this.nodeManager.getSceneById(this._currentSceneId),i=r.theme.themeName;i!==t&&this.fmServer.getTheme(e,function(e){n.initTheme(t,e,function(e){n.setBackgroundColor(e.clearColor,e.clearAlpha),r.theme=e,r.changeTheme(e)})})},get:function(){var e=this.nodeManager.getSceneById(this._currentSceneId);return e.theme.themeName}},{key:"fullScreen",get:function(){return this._fullScreen},set:function(e){var t=this.renderer.container;t=t||document.body;try{e?(t.webkitRequestFullScreen||t.mozRequestFullScreen).call(t):(document.webkitCancelFullScreen||document.mozCancelFullScreen).call(document),this._fullScreen=e}catch(e){console.error(e)}}},{key:"rotateAngle",get:function(){return-this.controls.getAzimuthalAngle()*fm.Math.RAD2DEG},set:function(e){e=-e*fm.Math.DEG2RAD,e>Math.PI?e-=2*Math.PI:e<-Math.PI&&(e=2*Math.PI+e),e<this.controls.minAzimuthAngle&&(e=this.controls.minAzimuthAngle),e>this.controls.maxAzimuthAngle&&(e=this.controls.maxAzimuthAngle),this.controls.setUpdate(void 0,void 0,void 0,e),this.controls.update()}},{key:"maxTitleAngle",get:function(){return(Math.PI/2-this.controls.minPolarAngle)*fm.Math.RAD2DEG},set:function(e){"3d"==this._viewMode&&(this.controls.minPolarAngle=(90-e)*fm.Math.DEG2RAD),this.MapOptions.defaultMaxTiltAngle=e}},{key:"minTitleAngle",get:function(){return(Math.PI/2-this.controls.maxPolarAngle)*fm.Math.RAD2DEG},set:function(e){"3d"==this._viewMode&&(this.controls.maxPolarAngle=(90-e)*fm.Math.DEG2RAD),this.MapOptions.defaultMinTiltAngle=e}},{key:"labelLanguage",get:function(){return this.MapOptions.defaultLabelLanguage},set:function(e){if(e!==this.labelLanguage){this.MapOptions.defaultLabelLanguage=e;var t=this.nodeManager.getSceneById(this._currentSceneId);t&&t.setLabelLanguage(e)}}},{key:"backgroundColor",set:function(e){this.renderer.renderer.setClearColor((0,d.default)(e))}},{key:"tiltAngle",get:function(){return(Math.PI/2-this.controls.getPolarAngle())*fm.Math.RAD2DEG},set:function(e){e=(90-e)*fm.Math.DEG2RAD,e<this.controls.minPolarAngle&&(e=this.controls.minPolarAngle),e>this.controls.maxPolarAngle&&(e=this.controls.maxPolarAngle),this.controls.setUpdate(void 0,void 0,void 0,void 0,e)}},{key:"listGroups",get:function(){return this.dataManager.getDecodeScene(this._currentSceneId).scene.layerGroups}},{key:"layerLocalHeight",get:function(){return 0}},{key:"gestureEnableController",get:function(){return this._enterControl}}]),c}(P.default),J=Z;t.default=J},function(e){e.exports=function(e,t,n){var r=void 0===n;switch(t.length){case 0:return r?e():e.call(n);case 1:return r?e(t[0]):e.call(n,t[0]);case 2:return r?e(t[0],t[1]):e.call(n,t[0],t[1]);case 3:return r?e(t[0],t[1],t[2]):e.call(n,t[0],t[1],t[2]);case 4:return r?e(t[0],t[1],t[2],t[3]):e.call(n,t[0],t[1],t[2],t[3])}return e.apply(n,t)}},function(e){function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}e.exports=t},function(e){function t(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}e.exports=t},function(e,t,n){e.exports=n(357)},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(2)),o=r(n(3)),c=r(n(147)),s=function(){function e(){(0,a.default)(this,e)}return(0,o.default)(e,[{key:"getScene",value:function(e,t,n,r,i,a,o){var s;s=n?t+".scene":t;var l=e+"/"+s+".fmap",u=new c.default;r&&(n||(l=e),u.setRequestHeader({"X-Requested-With":"XMLHttpRequest","Content-type":"application/json;charset=utf-8"})),u.requestMethod=i||"GET",u.sendData=r,u.setResponseType("arraybuffer"),u.getFile(l,function(e){a(e,t)},function(e){console.error("网络请求错误"),o&&o(e)})}},{key:"getFloor",value:function(e,t,n,r,i,a){var o=new c.default;"fengmap"==e&&(e="https://www.fengmap.com/FMCloud/sdk/authLayered/downMaps",o.requestMethod="POST",o.sendData=a,o.setRequestHeader({"X-Requested-With":"XMLHttpRequest","Content-type":"application/json;charset=utf-8"}));var s=e+"/"+n+"."+t+".biz.fmap",l=e+"/"+n+"."+t+".geo.fmap",u=e+"/"+n+"."+t+".navi.fmap";o.setResponseType("arraybuffer"),o.getFile(l,function(n){o.getFile(s,function(t){o.getFile(u,function(e){i(n,t,e,r)},function(){console.error("网络请求错误")})},function(){console.error("网络请求错误")})},function(){console.error("网络请求错误")})}},{key:"getTheme",value:function(e,n){var t=new c.default;t.getFile(e,function(e){var t=JSON.parse(e);n(t)},function(){})}},{key:"getData",value:function(e,t,n,r,i,a){var o=new c.default;o.requestMethod=r||"GET",o.sendData=i,o.setRequestHeader(a),o.getFile(e,function(e){e=JSON.parse(e),t(e)},function(e){n(e)})}}]),e}(),l=s;t.default=l},function(e,t,n){"use strict";var r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var i={NORTH:"n",n:0,SOUTH:"s",s:180,WEST:"w",w:-90,EAST:"e",e:90,NORTH_EAST:"ne",ne:45,NORTH_WEST:"nw",nw:-45,SOUTH_EAST:"se",se:135,SOUTH_WEST:"sw",sw:-135},a=i;t.default=a},function(e,u,t){(function(i){function a(e,t){for(var n=0,r=e.length-1;0<=r;r--){var i=e[r];"."===i?e.splice(r,1):".."===i?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;)e.unshift("..");return e}function r(e){"string"!=typeof e&&(e+="");var t,n=0,r=-1,i=!0;for(t=e.length-1;0<=t;--t)if(47===e.charCodeAt(t)){if(!i){n=t+1;break}}else-1===r&&(i=!1,r=t+1);return-1===r?"":e.slice(n,r)}function o(e,t){if(e.filter)return e.filter(t);for(var n=[],r=0;r<e.length;r++)t(e[r],r,e)&&n.push(e[r]);return n}u.resolve=function(){for(var e="",t=!1,n=arguments.length-1;-1<=n&&!t;n--){var r=0<=n?arguments[n]:i.cwd();if("string"!=typeof r)throw new TypeError("Arguments to path.resolve must be strings");r&&(e=r+"/"+e,t="/"===r.charAt(0))}return e=a(o(e.split("/"),function(e){return!!e}),!t).join("/"),(t?"/":"")+e||"."},u.normalize=function(e){var t=u.isAbsolute(e),n="/"===s(e,-1);return e=a(o(e.split("/"),function(e){return!!e}),!t).join("/"),e||t||(e="."),e&&n&&(e+="/"),(t?"/":"")+e},u.isAbsolute=function(e){return"/"===e.charAt(0)},u.join=function(){var e=Array.prototype.slice.call(arguments,0);return u.normalize(o(e,function(e){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))},u.relative=function(e,t){function n(e){for(var t=0;t<e.length&&""===e[t];t++);for(var n=e.length-1;0<=n&&""===e[n];n--);return n<t?[]:e.slice(t,n-t+1)}e=u.resolve(e).substr(1),t=u.resolve(t).substr(1);for(var r=n(e.split("/")),i=n(t.split("/")),a=Math.min(r.length,i.length),o=a,s=0;s<a;s++)if(r[s]!==i[s]){o=s;break}var l=[];for(s=o;s<r.length;s++)l.push("..");return l=l.concat(i.slice(o)),l.join("/")},u.sep="/",u.delimiter=":",u.dirname=function(e){if("string"!=typeof e&&(e+=""),0===e.length)return".";for(var t=e.charCodeAt(0),n=47===t,r=-1,i=!0,a=e.length-1;1<=a;--a)if(t=e.charCodeAt(a),47===t){if(!i){r=a;break}}else i=!1;return-1===r?n?"/":".":n&&1===r?"/":e.slice(0,r)},u.basename=function(e,t){var n=r(e);return t&&n.substr(-1*t.length)===t&&(n=n.substr(0,n.length-t.length)),n},u.extname=function(e){"string"!=typeof e&&(e+="");for(var t=-1,n=0,r=-1,i=!0,a=0,o=e.length-1;0<=o;--o){var s=e.charCodeAt(o);if(47===s){if(i)continue;n=o+1;break}-1===r&&(i=!1,r=o+1),46===s?-1===t?t=o:1!==a&&(a=1):-1!==t&&(a=-1)}return-1===t||-1===r||0===a||1===a&&t===r-1&&t===n+1?"":e.slice(t,r)};var s="b"==="ab".substr(-1)?function(e,t,n){return e.substr(t,n)}:function(e,t,n){return t<0&&(t=e.length+t),e.substr(t,n)}}).call(this,t(146))},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var l=r(n(108)),a=r(n(200)),o=r(n(367)),s=r(n(196)),u="https://www.fengmap.com/FMCloud",c={check:u+"/sdk/check",onlineCheck:u+"/sdk/auth/web",fmFileServer:u+"/sdk/auth/downMaps"},h="026685bf295f587b5dffc1f18d5dc27c",f=function(e,t,n){if(!e||"string"!=typeof t||32!=t.length)return!1;if(null==e||""==e)return!0;var r=a.default.decryption(t,h),i=o.default.encryption(n);return r=a.default.decryption(r,i),r==e},d=function(e,t,n){n=n||"fengmap.localhost:";var r=o.default.encryption(n+t),i=a.default.decryption(e,r);return i},p=function(){var e=new Date,t=(e.getFullYear(),e.getMonth()+1),n=(e=e.getDate(),e%2==0?1:-1),r=Math.max(Math.pow(e%10+ +n,2)+n*t,0),i=Math.abs(2*e+n*t);return""+r+i},m=(p(),function(e,t,n){d(e,t);var r=window.location.host,i=r.indexOf(":");-1<i&&(r=r.slice(0,i));var a=r||"0.0.0.0";return{webURL:a,appKey:e,mapId:n,appName:t}}),v=new s.default,g={checkOffLine:function(e,t,n,r){n=n||r;var i=d(e,t);return n==i},checkIsOnLine:function(e,t){v.getData(c.check,function(){e&&e()},function(){t&&t()})},checkOnLine:function(e,t,n,r,i,a){var o=c.onlineCheck,s=m(e,t,n);s=(0,l.default)(s),v.getData(o,function(e){e?e.success?r&&r(e):i&&i(e):i&&i()},function(e){e?(e=JSON.parse(e),i&&i(e)):i&&i()},a,s,{"X-Requested-With":"XMLHttpRequest","Content-type":"application/json;charset=utf-8"})},checkLicense:f,getCerityData:m,ls:0},y=g;t.default=y},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0,n(5),n(4);var a,o,p,m,v,g,y,_,x,w,b,s=r(n(31)),l=(a=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],o=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],p=0,m=0,v=[2,0,0,0],g=function(e,t){var n=0,r=0,i=0;for(r=0;r<8;r++)1&t&&(n^=e),i=128&e,e<<=1,i&&(e^=27),t>>=1;return n},y=function(e,t,n){var r;for(r=0;r<4;r++)e[0+r]^=t[16*n+4*r],e[4+r]^=t[16*n+4*r+1],e[8+r]^=t[16*n+4*r+2],e[12+r]^=t[16*n+4*r+3]},_=function(e){var t,n,r,i;for(t=1;t<4;t++)for(r=0;r<t;){for(i=e[4*t+4-1],n=3;0<n;n--)e[4*t+n]=e[4*t+n-1];e[4*t+0]=i,r++}},x=function(e){var t,n,r,i;for(t=0;t<4;t++)for(n=0;n<4;n++)r=(240&e[4*t+n])>>4,i=15&e[4*t+n],e[4*t+n]=o[16*r+i]},w=function(e){var t;for(t=0;t<4;t++)e[t]=a[16*((240&e[t])>>4)+(15&e[t])]},b=function(e){return(0,s.default)(e,16)},{decryption:function(e,t){var n,r=Array(16);for(n=0;n<16;n++)r[n]=16*b(t.substr(2*n,1))+b(t.substr(2*n+1,1));var i=Array(16);for(n=0;n<16;n++)i[n]=16*b(e.substr(2*n,1))+b(e.substr(2*n+1,1));var a=Array(16);switch(n=[],r.length){default:case 16:p=4,m=10;break;case 24:p=6,m=12;break;case 32:p=8,m=14}var o,s=n=Array(16*(m+1)),l=Array(4),u=4*(m+1);for(o=0;o<p;o++)s[4*o+0]=r[4*o+0],s[4*o+1]=r[4*o+1],s[4*o+2]=r[4*o+2],s[4*o+3]=r[4*o+3];for(o=p;o<u;o++){if(l[0]=s[4*(o-1)+0],l[1]=s[4*(o-1)+1],l[2]=s[4*(o-1)+2],l[3]=s[4*(o-1)+3],0==o%p){r=l;var c=void 0,h=void 0;for(c=r[0],h=0;h<3;h++)r[h]=r[h+1];if(r[3]=c,w(l),r=o/p,1==r)v[0]=1;else if(1<r)for(v[0]=2,r--;0<r-1;)v[0]=g(v[0],2),r--;r=l,c=v,h=l,h[0]=r[0]^c[0],h[1]=r[1]^c[1],h[2]=r[2]^c[2],h[3]=r[3]^c[3]}else 6<p&&4==o%p&&w(l);s[4*o+0]=s[4*(o-p)+0]^l[0],s[4*o+1]=s[4*(o-p)+1]^l[1],s[4*o+2]=s[4*(o-p)+2]^l[2],s[4*o+3]=s[4*(o-p)+3]^l[3]}for(s=Array(16),l=0;l<4;l++)for(o=0;o<4;o++)s[4*l+o]=i[l+4*o];for(y(s,n,m),i=m-1;1<=i;i--)for(_(s),x(s),y(s,n,i),l=s,o=[14,9,13,11],u=h=void 0,r=Array(4),c=Array(4),u=0;u<4;u++){for(h=0;h<4;h++)r[h]=l[4*h+u];h=o;var f=r,d=c;for(d[0]=g(h[0],f[0])^g(h[3],f[1])^g(h[2],f[2])^g(h[1],f[3]),d[1]=g(h[1],f[0])^g(h[0],f[1])^g(h[3],f[2])^g(h[2],f[3]),d[2]=g(h[2],f[0])^g(h[1],f[1])^g(h[0],f[2])^g(h[3],f[3]),d[3]=g(h[3],f[0])^g(h[2],f[1])^g(h[1],f[2])^g(h[0],f[3]),h=0;h<4;h++)l[4*h+u]=c[h]}for(_(s),x(s),y(s,n,0),l=0;l<4;l++)for(o=0;o<4;o++)a[l+4*o]=s[4*l+o];for(i="",n=0;n<16;++n)s=a[n].toString(16),s.length<2&&(s="0"+s),i+=s;return i}}),u=l;t.default=u},function(e,n,r){"use strict";var i=r(1),a=r(0);a(n,"__esModule",{value:!0}),n.default=void 0;var s=i(r(25));r(21);var o=i(r(2)),l=i(r(3)),u=u||{};u.GLEN1="MULTIPOLYGON(((".length,u.GLEN2="POINT(".length,u.GLEN3="MULTILINESTRING((".length;var c=function(){function e(){(0,o.default)(this,e),this._points,this._holes}return(0,l.default)(e,[{key:"parse",value:function(e){if(this._points=[],this._holes=[],0==e.indexOf("MULTIPOLYGON((("))for(var t=e.substring(u.GLEN1,e.length-3).split(/\),\(/),n=0;n<t.length;n++){var r=t[n].split(/,/);if(0==n)for(var i=0;i<r.length;i++){var a=r[i].split(" ");this._points.push({x:(0,s.default)(a[0]),y:(0,s.default)(a[1])})}else{var o=[];for(i=0;i<r.length;i++)a=r[i].split(" "),o.push({x:(0,s.default)(a[0]),y:(0,s.default)(a[1])});this._holes.push(o)}}else if(0==e.indexOf("POINT("))a=e.substring(u.GLEN2,e.length-1).split(" "),this._points.push({x:(0,s.default)(a[0]),y:(0,s.default)(a[1])});else if(0==e.indexOf("MULTILINESTRING(("))for(r=e.substring(u.GLEN3,e.length-2).split(","),i=0;i<r.length;i++)a=r[i].split(" "),this._points.push({x:(0,s.default)(a[0]),y:(0,s.default)(a[1])});return this}},{key:"toFixed",value:function(e){return+e.toFixed(2)}},{key:"parsePnt",value:function(e){if(this._points=[],0==e.indexOf("MULTIPOLYGON((("))for(var t=e.substring(u.GLEN1,e.length-3).split(","),n=0;n<t.length;n++){var r=t[n].split(" ");this._points.push({x:(0,s.default)(r[0]),y:(0,s.default)(r[1])})}else if(0==e.indexOf("POINT("))r=e.substring(u.GLEN2,e.length-1).split(" "),this._points.push({x:(0,s.default)(r[0]),y:(0,s.default)(r[1])});else if(0==e.indexOf("MULTILINESTRING(("))for(t=e.substring(u.GLEN3,e.length-2).split(","),n=0;n<t.length;n++)r=t[n].split(" "),this._points.push({x:(0,s.default)(r[0]),y:(0,s.default)(r[1])});return this}},{key:"toPntStrip",value:function(e){var t=[],n=this._points.length;if(!0===e){if(1<=n)for(var r=0;r<n-1;r++){var i=this._points[r];t.push(i.x,i.y)}}else for(r=0;r<n;r++)i=this._points[r],t.push(i.x,i.y);return t}},{key:"mergePnts",value:function(e){for(var t=[],n=e.length,r=0;r<n;r++){for(var i=e[r],a={x:this.toFixed(i.x),y:this.toFixed(i.y)},o=t.length,s=!1,l=0;l<o;l++){var u=t[l];if(u.x==a.x&&u.y==a.y){s=!0;break}}s||t.push(a)}return t}},{key:"toStrip",value:function(e){var n=[],r=this._points.length;if(r<=0)return n;for(var i=this._points.splice(r-1,1)[0],a=this.mergePnts(this._points),o=a.length,s=0;s<o;s++){var l=a[s];n.push(l.x,l.y)}return!0===e||(t={x:this.toFixed(i.x),y:this.toFixed(i.y)},n.push(t.x,t.y),this._points.push(i)),n}},{key:"hasHoles",value:function(){return null!=this._holes&&0<this._holes.length}},{key:"toStripHoles",value:function(e){for(var n=[],r=0;r<this._holes.length;r++){for(var i=this._holes[r],a=[],o=i.length,s=i.splice(o-1,1)[0],l=this.mergePnts(i),u=l.length,c=0;c<u;c++){var h=l[c];a.push(h.x,h.y)}!0===e||(t={x:this.toFixed(s.x),y:this.toFixed(s.y)},a.push(t.x,t.y)),n.push(a)}return n}},{key:"holes",set:function(e){this._holes=e},get:function(){return this._holes}},{key:"points",get:function(){return this._points},set:function(e){this._points=e}}]),e}(),h=c;n.default=h},function(e,n,r){"use strict";var i=r(1),a=r(0);a(n,"__esModule",{value:!0}),n.default=void 0;var o=i(r(2)),s=i(r(3)),l=function(){function e(){(0,o.default)(this,e),this._points,this._holes}return(0,s.default)(e,[{key:"parse",value:function(e,t){this._points=[],this._holes=[];for(var n=0,r=0;r<e.length;r++){var i=e[r].idxs;if(i=i||e[r],"number"==typeof i)for(;n<i;)this._points.push({x:t[n],y:t[n+1]}),n+=2;else for(var a=0;a<i.length;a++)for(var o=i[a];n<o;)this._points.push({x:t[n],y:t[n+1]}),n+=2}return this}},{key:"parseGeometry",value:function(e,t){this._points=[],this._holes=[];for(var n=0,r=0;r<e.length;r++){var i=e[r].idxs;if(i=i||e[r],"number"==typeof i)for(;n<i;)this._points.push({x:t[n],y:t[n+1]}),n+=2;else for(var a=0;a<i.length;a++)if(0===a)for(var o=i[a];n<o;)this._points.push({x:t[n],y:t[n+1]}),n+=2;else{for(var s=[],l=i[a];n<l;)s.push({x:t[n],y:t[n+1]}),n+=2;this._holes.push(s)}}return this}},{key:"mergePnts",value:function(e){for(var t=[],n=e.length,r=0;r<n;r++){for(var i=e[r],a={x:this.toFixed(i.x),y:this.toFixed(i.y)},o=t.length,s=!1,l=0;l<o;l++){var u=t[l];if(u.x==a.x&&u.y==a.y){s=!0;break}}s||t.push(a)}return t}},{key:"toStrip",value:function(e){var n=[],r=this._points.length;if(r<=0)return n;for(var i=this._points.splice(r-1,1)[0],a=this._points,o=a.length,s=0;s<o;s++){var l=a[s];n.push(l.x,l.y)}return!0===e||(t={x:this.toFixed(i.x),y:this.toFixed(i.y)},n.push(t.x,t.y),this._points.push(i)),n}},{key:"toFixed",value:function(e){return+e.toFixed(2)}},{key:"hasHoles",value:function(){return null!=this._holes&&0<this._holes.length}},{key:"toStripHoles",value:function(e){for(var n=[],r=0;r<this._holes.length;r++){for(var i=this._holes[r],a=[],o=i.length,s=i.splice(o-1,1)[0],l=this.mergePnts(i),u=l.length,c=0;c<u;c++){var h=l[c];a.push(h.x,h.y)}!0===e||(t={x:this.toFixed(s.x),y:this.toFixed(s.y)},a.push(t.x,t.y)),n.push(a)}return n}},{key:"holes",set:function(e){this._holes=e},get:function(){return this._holes}},{key:"points",get:function(){return this._points},set:function(e){this._points=e}}]),e}(),u=l;n.default=u},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var s=r(n(18)),l=r(n(13)),u=r(n(17)),c=r(n(16)),a=r(n(15));n(10),n(5),n(4),n(66);var o=r(n(31));n(56);var h=r(n(2)),f=r(n(3)),d=n(204),p=r(n(209)),m=r(n(402)),v=r(n(87));function g(e){if(void 0===c.default||null==e[u.default]){if((0,l.default)(e)||(e=y(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i,a=!0,o=!1;return{s:function(){r=(0,s.default)(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){o=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(o)throw i}}}}function y(e,t){if(e){if("string"==typeof e)return _(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?(0,a.default)(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_(e,t):void 0}}function _(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function x(e,t){if(v.default.d){var n=v.default.d();n.minFilter=fm.LinearFilter,n.generateMipmaps=!1;var r=.4,i=new fm.Vector2(r,.12*r/.5),a=new m.default;a.transparent=!0,a.uniforms.scale={value:i};var o=-1*(.5*i.x/e-1),s=-1*(1-.5*i.y);a.uniforms.offset={value:new fm.Vector2(o,s)},a.uniforms.mmap={value:n},a.needsUpdate=!0;var l=new p.default,u=new fm.Mesh(l,a);u.frustumCulled=!1,v.default[t.uuid].f=u}}var w=function(){function n(e,t){(0,h.default)(this,n),this.container=e.container,this.renderer=null,this._map=t,this._clearColor=16777215,this._clearAlpha=1,this._viewMode=t._viewMode,this._w=this.container.clientWidth,this._h=this.container.clientHeight,this._spriteRenderHeight=15,this._poiSpriteHeight=15,this._logarithmicDepthBuffer="boolean"==typeof e.logarithmicDepthBuffer&&e.logarithmicDepthBuffer,this.init(),this._envMap=null,this._renderList=[],this._showCompass=!1,this._compassNode=null,this._lineMarkerScene=new fm.Scene,this._backrenderScene=new fm.Scene,this.background=new fm.Scene,this._backrenderScene.userData.type="lastScene",this._fristRender=!1,x(this._w/this._h,t)}return(0,f.default)(n,[{key:"getFrustumByViewMode",value:function(e){var t="3d"==e?this.perspectiveCamera:this.orthographicCamera;return t.updateMatrixWorld(!0),(new fm.Frustum).setFromMatrix((new fm.Matrix4).multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse))}},{key:"getScaleByPixels",value:function(e,t){return t/(e/2*this.domElementHeight)}},{key:"setBackground",value:function(e){var t=(new fm.TextureLoader).load(e);this.background.background=t}},{key:"resetCompass",value:function(){if(this.compassNode){var e=this.getAspect(),t=this.getScaleByPixels(1,this._map.MapOptions.compassSize),n=-this.getScaleByPixels(1,this._map.MapOptions.compassOffset[1]),r=this.getScaleByPixels(1,this._map.MapOptions.compassOffset[0])/e,i=this.getCompassOffset(this._map.MapOptions.compassPosition,t,e,r,n);this.compassNode.material.uniforms.scale={value:t},this.compassNode.material.uniforms.offset={value:new fm.Vector2(i.ox,i.oy)},this.compassNode.userData.coord={x:i.ox,y:i.oy},this.compassNode.userData.width=.5*t}}},{key:"getCompassOffset",value:function(e,t,n,r,i){var a=1,o=1;switch(e){case 3:a=-1;break;case 2:o=-1;break;case 4:o=-1,a=-1}var s=a*(.5*t/n-1),l=o*(1-.5*t);return{ox:s+r,oy:l+i}}},{key:"resetLocationsSize",value:function(){var e,t=this.renderList,n=g(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;if("location"==r.userData.type){var i,a=g(r.children);try{for(a.s();!(i=a.n()).done;){var o=i.value;this.setLocationSize(o,o.mapNode.size)}}catch(e){a.e(e)}finally{a.f()}}}}catch(e){n.e(e)}finally{n.f()}}},{key:"setLocationSize",value:function(e,t){if("3d"==this._viewMode){var n=new fm.Matrix4;n.multiplyMatrices(this.perspectiveCamera.matrixWorldInverse,e.matrixWorld);var r=(new fm.Vector3).applyMatrix4(n),i=t/(this.container.clientHeight/(2*Math.tan(this.perspectiveCamera.fov*fm.Math.DEG2RAD/2)))*Math.abs(r.z);e.scale.set(i,i,i)}else{var a=t*Math.abs(this.orthographicCamera.top-this.orthographicCamera.bottom)/this.orthographicCamera.zoom/this.container.clientHeight;e.scale.set(a,a,a)}}},{key:"setLabelSize",value:function(e,t){if("3d"==this._viewMode){var n=t/(this.container.clientHeight/(2*Math.tan(this.perspectiveCamera.fov*fm.Math.DEG2RAD/2)));e.scale.set(n,n,n),e.scale.multiplyScalar(e.material.userData.mspriteScale),e.scale.setX(e.scale.x/e.material.userData.scaleRatio)}else{var r=t*Math.abs(this.orthographicCamera.top-this.orthographicCamera.bottom)/this.orthographicCamera.zoom/this.container.clientHeight;e.scale.set(r,r,r),e.scale.multiplyScalar(e.material.userData.mspriteScale),e.scale.setX(e.scale.x/e.material.userData.scaleRatio)}}},{key:"setFacilitySize",value:function(e,t){if("3d"==this._viewMode){var n=t/(this.container.clientHeight/(2*Math.tan(this.perspectiveCamera.fov*fm.Math.DEG2RAD/2)));e.scale.set(n,n,n)}else{var r=t*Math.abs(this.orthographicCamera.top-this.orthographicCamera.bottom)/this.orthographicCamera.zoom/this.container.clientHeight;e.scale.set(r,r,r)}}},{key:"setImageMarkerSize",value:function(e){if("3d"==this._viewMode){var t=e.material.userData.size/(this.container.clientHeight/(2*Math.tan(this.perspectiveCamera.fov*fm.Math.DEG2RAD/2)));e.scale.set(t,t,t)}else{var n=e.material.userData.size*Math.abs(this.orthographicCamera.top-this.orthographicCamera.bottom)/this.orthographicCamera.zoom/this.container.clientHeight;e.scale.set(n,n,n)}}},{key:"parseGroup",value:function(e){var t=[],n=e._getLayers(!1);this.getShadowScene();var r=this.shadowscene.children;for(var i in n){var a=n[i];if(!this.needshadow||"model"!==i&&"extent"!==i){var o,s=g(a);try{for(s.s();!(o=s.n()).done;){var l=o.value;l.renderOrder=d.LayerOrder[i],t.push(l)}}catch(e){s.e(e)}finally{s.f()}}else{var u,c=g(a[0].children);try{for(c.s();!(u=c.n()).done;){var h=u.value;h instanceof fm.Mesh&&r.push(h)}}catch(e){c.e(e)}finally{c.f()}}}return this.needshadow&&(this.shadowscene.renderOrder=d.LayerOrder.model,t.push(this.shadowscene)),e.locationScene.renderOrder=d.LayerOrder.location,t.push(e.locationScene),e.lineScene.renderOrder=d.LayerOrder.line,t.push(e.lineScene),t}},{key:"getShadowScene",value:function(){this.shadowscene=new fm.Scene;var e=new fm.AmbientLight(7631988),t=new fm.Object3D,n=new fm.DirectionalLight(8947848,1.2);n.position.set(-1,1,1),n.target=t,n.castShadow=!0,n.shadow.camera=new fm.OrthographicCamera(-100,100,100,-100,.5,1e3),n.shadow.mapSize.width=720*window.devicePixelRatio,n.shadow.mapSize.height=610*window.devicePixelRatio;var r=new fm.DirectionalLight(3355443);r.position.set(-.5,1,-1).normalize(),r.target=t,this.shadowscene.add(n),this.shadowscene.add(e),this.shadowscene.add(r),this.shadowscene.add(t)}},{key:"parseList",value:function(e){var t=[];if(e){var n,r=g(e);try{for(r.s();!(n=r.n()).done;){var i,a=n.value,o=g(a);try{for(o.s();!(i=o.n()).done;){var s=i.value,l=this.parseGroup(s);l.sort(function(e,t){return e.renderOrder-t.renderOrder}),t=t.concat(l)}}catch(e){o.e(e)}finally{o.f()}}}catch(e){r.e(e)}finally{r.f()}}return t}},{key:"setBackRender",value:function(e){this._backrenderScene.children=e}},{key:"init",value:function(){this.renderer=this._map.render,this.renderer.setClearColor(this._clearColor,this._clearAlpha);var e=this.container.clientWidth,t=this.container.clientHeight;return this.renderer.setSize(e,t),this.renderer.setPixelRatio(window.devicePixelRatio),this.renderer.shadowMap.enabled=!0,this.renderer.shadowMap.type=fm.PCFSoftShadowMap,this.renderer.autoClear=!1,this.canvas=this._map.canvas,this.container.appendChild(this.canvas),this.orthographicCamera=this._map.orthographicCamera,this.perspectiveCamera=this._map.perspectiveCamera,!0}},{key:"getCameraByViewMode",value:function(e){return"3d"==e?this.perspectiveCamera:this.orthographicCamera}},{key:"getCurrentCamera",value:function(){return this.getCameraByViewMode(this._viewMode)}},{key:"resetSpriteSize",value:function(){var e,t=this.renderList,n=g(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;if("facility"==r.userData.type){var i,a=g(r.children);try{for(a.s();!(i=a.n()).done;){var o=i.value;this.setFacilitySize(o,o.mapNode.size)}}catch(e){a.e(e)}finally{a.f()}}else if("label"==r.userData.type){var s,l=g(r.children);try{for(l.s();!(s=l.n()).done;){var u=s.value;this.setLabelSize(u,u.mapNode.size)}}catch(e){l.e(e)}finally{l.f()}}else if("imageMarker"==r.userData.type){var c,h=g(r.children);try{for(h.s();!(c=h.n()).done;){var f=c.value;this.setImageMarkerSize(f)}}catch(e){h.e(e)}finally{h.f()}}else if("textMarker"==r.userData.type){var d,p=g(r.children);try{for(p.s();!(d=p.n()).done;){var m=d.value;this.setLabelSize(m,m.mapNode.size)}}catch(e){p.e(e)}finally{p.f()}}}}catch(e){n.e(e)}finally{n.f()}}},{key:"getAspect",value:function(){return this._w/this._h}},{key:"resize",value:function(){this.renderer.setSize(this._w,this._h),this.perspectiveCamera.aspect=this._w/this._h,this.resizeWater(this._w/this._h),this.perspectiveCamera.updateProjectionMatrix(),this.orthographicCamera.left=-this._w/2,this.orthographicCamera.right=this._w/2,this.orthographicCamera.top=this._h/2,this.orthographicCamera.bottom=-this._h/2,this.orthographicCamera.updateProjectionMatrix()}},{key:"resizeWater",value:function(e){if(v.default[this._map.uuid].f){var t=.4,n=new fm.Vector2(t,.12*t/.5);v.default[this._map.uuid].f.material.uniforms.scale={value:n},isNaN(e);var r=-1*(.5*n.x/e-1),i=-1*(1-.5*n.y);v.default[this._map.uuid].f.material.uniforms.offset={value:new fm.Vector2(r,i)}}}},{key:"resizeLine",value:function(){var e,t=this.renderList,n=g(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;if("line"==r.userData.type){var i,a=g(r.children);try{for(a.s();!(i=a.n()).done;){var o=i.value;o.material.resolution.set(this.domElementWidth,this.domElementHeight)}}catch(e){a.e(e)}finally{a.f()}}}}catch(e){n.e(e)}finally{n.f()}}},{key:"update",value:function(){this._fristRender||(this._map.dispatchEvent({type:"fristRender"}),this._fristRender=!0),(5<Math.abs(this._w-this.container.clientWidth)||5<Math.abs(this._h-this.container.clientHeight))&&(this._w=this.container.clientWidth,this._h=this.container.clientHeight,this.resize(),this.resetSpriteSize(),this.resetLocationsSize(),this._map.updatePopsPosition(),this.resizeLine(),this.resetCompass());var e="3d"==this._viewMode?this.perspectiveCamera:this.orthographicCamera,t=this.renderList;if(t&&this.renderer){if(this.renderer.clear(),this.renderer.clearDepth(),this._envMap&&this.renderer.render(this._envMap,e),this.lightEffects)this.bloomRender(e);else{void 0!==this.background.background&&this.renderer.render(this.background,e);var n,r=g(t);try{for(r.s();!(n=r.n()).done;){var i=n.value;this.renderer.render(i,e)}}catch(e){r.e(e)}finally{r.f()}e.layers.set(0),this._showCompass&&this._compassNode&&this.renderer.render(this._compassNode,e)}v.default[this._map.uuid].f&&this.renderer.render(v.default[this._map.uuid].f,e)}}},{key:"setSceneNodeLayers",value:function(e,t){var n,r=g(e.children);try{for(r.s();!(n=r.n()).done;){var i=n.value;i.mapNode&&!i.mapNode.picLoading&&i.layers.set(t)}}catch(e){r.e(e)}finally{r.f()}}},{key:"setClearColor",value:function(e,t){"string"==typeof e&&0<=e.indexOf("#")?this._clearColor=(0,o.default)(e.replace("#","0x")):this._clearColor=e,this._clearAlpha="number"==typeof t?t:1,this.renderer.setClearColor(this._clearColor,this._clearAlpha)}},{key:"setEnvMap",value:function(e){if(e&&e.path&&e.format){var t=e.path,n=e.format,r=(new fm.CubeTextureLoader).load([t+"px"+n,t+"nx"+n,t+"py"+n,t+"ny"+n,t+"pz"+n,t+"nz"+n]);this._envMap||(this._envMap=new fm.Scene),this._envMap.background=r}}},{key:"dispose",value:function(){this._envMap&&(this._envMap=void 0);var e=this.renderList;if(e){var t,n=g(e);try{for(n.s();!(t=n.n()).done;){var r=t.value;if(r){for(var i=r.children.length-1;-1<i;i--)r.remove(r.children[i]);r.children.length=0,r=void 0}}}catch(e){n.e(e)}finally{n.f()}}this._compassNode&&(this._compassNode.material.dispose(),this._compassNode.geometry.dispose());for(var a=this._lineMarkerScene.children.length-1;-1<a;a--)this._lineMarkerScene.remove(this._lineMarkerScene.children[a]);this._map=void 0,this.renderer.dispose(),this.renderer.forceContextLoss(),this.container.removeChild(this.canvas),this.canvas=void 0,this.renderer=void 0,this.container=void 0}},{key:"renderList",set:function(e){this._renderList=this.parseList(e)},get:function(){return this._renderList}},{key:"domElementHeight",get:function(){return this.container.clientHeight}},{key:"domElementWidth",get:function(){return this.container.clientWidth}},{key:"viewMode",set:function(e){this._viewMode=e}},{key:"showCompass",set:function(e){this._showCompass=e},get:function(){return this._showCompass}},{key:"compassNode",get:function(){return this._compassNode},set:function(e){this._compassNode=e}},{key:"lineMarkerScene",get:function(){return this._lineMarkerScene}}]),n}(),b=w;t.default=b},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.LayerOrder=t.Prop2Alias=t.AliasLayerMap=t.LayerAlias=void 0;var a=r(n(368)),o=r(n(206)),s=r(n(378)),l=r(n(395)),u=r(n(216)),c=r(n(218)),h=r(n(220)),f=r(n(221)),d=r(n(222)),p=r(n(399)),m=r(n(223)),v=r(n(401)),g=r(n(225)),y=r(n(226)),_=["extent","model","label","facility","line","locationMarker","text","textMarker","polygonMarker","imageMarker","stair","externalModel","heatmap","dynmodel","symbol","domMarker"];t.LayerAlias=_;var x=new a.default;t.AliasLayerMap=x,x.set("extent",o.default),x.set("externalModel",s.default),x.set("model",l.default),x.set("label",u.default),x.set("facility",c.default),x.set("imageMarker",h.default),x.set("polygonMarker",f.default),x.set("textMarker",d.default),x.set("stair",p.default),x.set("heatmap",m.default),x.set("symbol",v.default),x.set("domMarker",g.default),x.set("dynmodel",y.default);var w={extentLayer:"extent",externalModelLayer:"externalModel",labelLayer:"label",modelLayer:"model",poiLayer:"facility",stairLayer:"stair"};t.Prop2Alias=w;var b={extent:0,line:2,model:1,externalModel:.5,heatmap:3,polygonMarker:3,location:4,facility:4,label:4,imageMarker:4,textMarker:4,domMarker:4,dynmodel:.5};t.LayerOrder=b},function(e,t,n){"use strict";var r=n(19),i=n(11),a=n(35),o=n(30),s=n(24)("species");e.exports=function(e){var t="function"==typeof i[e]?i[e]:r[e];o&&t&&!t[s]&&a.f(t,s,{configurable:!0,get:function(){return this}})}},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0,n(5),n(4);var a=r(n(6));n(10);var o=r(n(2)),s=r(n(3)),l=r(n(7)),u=r(n(8)),c=r(n(9)),h=r(n(12)),f=r(n(377));function d(r){return function(){var e,t=(0,u.default)(r);if(p()){var n=(0,u.default)(this).constructor;e=(0,a.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,l.default)(this,e)}}function p(){if("undefined"==typeof Reflect||!a.default)return!1;if(a.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,a.default)(Date,[],function(){})),!0}catch(e){return!1}}var m=function(e){(0,c.default)(i,e);var r=d(i);function i(e,t){var n;return(0,o.default)(this,i),n=r.call(this,"extentLayer"),n._scene=new fm.Scene,n._scene.name="extent",n._scene.userData.type="extent",n._extents={},n.initNode(e,t),n._visible=!0,n.initLight(),n.putLight(),n}return(0,s.default)(i,[{key:"initLight",value:function(){this._ambientLight=new fm.AmbientLight(7631988),this._target=new fm.Object3D,this._mainLight=new fm.DirectionalLight(8947848,1.2),this._mainLight.position.set(-1,1,1).normalize(),this._mainLight.castShadow=!1,this._mainLight.target=this._target,this._secondLight=new fm.DirectionalLight(3355443),this._secondLight.position.set(-.5,1,-1).normalize(),this._secondLight.target=this._target}},{key:"initNode",value:function(e,t){for(var n=0;n<e.length;n++)this.createNode(e[n],t[n])}},{key:"createNode",value:function(e,t){var n=new f.default(e,t);n.parent=this,this._extents[""+n.eid]=n}},{key:"addNodes",value:function(e){e.parent=this,e.renderNode&&this._scene.add(e.renderNode),this._extents[""+e.eid]=e}},{key:"putLight",value:function(){var e=this;this.scene.add(this._mainLight),this.scene.add(this._ambientLight),this.scene.add(this._secondLight),this.scene.add(this._target),this.scene.removeLight=function(){e.removeLight()}}},{key:"removeLight",value:function(){this.scene.remove(this._mainLight),this.scene.remove(this._ambientLight),this.scene.remove(this._secondLight)}},{key:"disposeLight",value:function(){this._mainLight=void 0,this._ambientLight=void 0,this._secondLight=void 0}},{key:"getNodeById",value:function(e){return this._extents[""+e]}},{key:"traverse",value:function(e){for(var t in this._extents)e&&e(this._extents[t])}},{key:"getVideoMemoryAmount",value:function(){var t=null;return this.traverse(function(e){e._renderNode&&e._renderNode.geometry&&e._renderNode.geometry._bufferGeometry&&(t+=e._renderNode.geometry._bufferGeometry.attributes.position.array.byteLength,t+=e._renderNode.geometry._bufferGeometry.attributes.color.array.byteLength,t+=e._renderNode.geometry._bufferGeometry.attributes.normal.array.byteLength,t+=e._renderNode.geometry._bufferGeometry.attributes.uv.array.byteLength)}),t}},{key:"checkSceneNode",value:function(){for(var e in this._scene.children.length=0,this._extents)this._extents[e].visible&&this._extents[e].renderNode&&this._scene.add(this._extents[e].renderNode);this.putLight()}},{key:"getAllMesh",value:function(){var e=[];for(var t in this._extents)this._extents[t].renderNode&&e.push(this._extents[t].renderNode);return e}},{key:"dispose",value:function(){for(var e in this._extents)this._extents[e].dispose(),this._scene.remove(this._extents[e].renderNode),this._extents[e].parent=void 0,this._extents[e]=void 0;this.removeLight(),this.disposeLight(),this._scene.length=0,this._scene=void 0}},{key:"extents",get:function(){return this._extents},set:function(e){this._extents=e}},{key:"scene",get:function(){return this._scene}},{key:"visible",get:function(){return this._visible},set:function(e){this._visible=e,this.parent&&this.parent.parent&&this.parent.parent.parent&&this.parent.parent.parent.map.setRenderList()}},{key:"show",get:function(){return this.visible},set:function(e){this.visible=e}}]),i}(h.default),v=m;t.default=v},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var s=r(n(18)),l=r(n(17)),u=r(n(16)),a=r(n(15));n(5),n(4);var o=r(n(6)),c=r(n(31));n(21);var h=r(n(13));n(10);var f=r(n(2)),d=r(n(3)),p=r(n(7)),m=r(n(8)),v=r(n(9)),g=r(n(12)),y=r(n(33)),_=r(n(58));function x(e){if(void 0===u.default||null==e[l.default]){if((0,h.default)(e)||(e=w(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i,a=!0,o=!1;return{s:function(){r=(0,s.default)(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){o=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(o)throw i}}}}function w(e,t){if(e){if("string"==typeof e)return b(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?(0,a.default)(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?b(e,t):void 0}}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function M(r){return function(){var e,t=(0,m.default)(r);if(S()){var n=(0,m.default)(this).constructor;e=(0,o.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,p.default)(this,e)}}function S(){if("undefined"==typeof Reflect||!o.default)return!1;if(o.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,o.default)(Date,[],function(){})),!0}catch(e){return!1}}var E=function(e){(0,v.default)(i,e);var r=M(i);function i(e,t){var n;return(0,f.default)(this,i),n=r.call(this,t.eid,y.default.EXTERANL_MODEL),n._parseData=null,n._isInitMesh=!0,n._visible=!0,n._renderNode=null,n._geometry=void 0,n._line=null,n._bdata=t,n._selected=!1,n._preColor=null,n._preOpacity=null,n.name=t.name,n.FID=t.fid,n.ID=t.eid,n.typeID=t.type,n.gdata=e,n}return(0,d.default)(i,[{key:"initMesh",value:function(e,t){this._geometry&&(this._renderNode=new fm.Mesh(this._geometry.geometry,e),this._renderNode.mapNode=this,this._renderNode.scale.set(-1,1,1),this._renderNode.rotation.set(Math.PI/2,0,0,"XYZ"),this._renderNode.position.copy(t),this._renderNode.parent=this.parent.scene,this._renderNode.visible=this.show)}},{key:"setByTheme",value:function(e){var t=this._renderNode.material,n=this._renderNode;if((0,h.default)(t)){var r,i=x(t);try{for(i.s();!(r=i.n()).done;){var a=r.value;a.color=new fm.Color(_.default.toColor(e.color)),a.userData.opacity=t.opacity}}catch(e){i.e(e)}finally{i.f()}}else t.color=new fm.Color(_.default.toColor(e.color)),t.userData.opacity=t.opacity;var o=e.scale.split(","),s=e.rotate.split(",");e.translate.split(","),n.scale.set((0,c.default)(o[0]),(0,c.default)(o[1]),(0,c.default)(o[2])),n.rotation.set((0,c.default)(s[0])*fm.Math.DEG2RAD,(0,c.default)(s[2])*fm.Math.DEG2RAD,(0,c.default)(s[1])*fm.Math.DEG2RAD)}},{key:"checkByFrustum",value:function(){var e=!0;this._renderNode&&("Mesh"===this._renderNode.type||"Scene"===this._renderNode.type&&this._renderNode.traverse(function(){fm.Mesh}),this._renderNode.updateMatrixWorld(!0),this.visible=e)}},{key:"setColor",value:function(n,r){var i=this;this._renderNode.traverse(function(e){if(e instanceof fm.Mesh)if(void 0!==e.material.length)for(var t=0;t<e.material.length;t++)i._preColor=e.material[t].color,e.material[t].color=new fm.Color(_.default.toRgba(n)),i._preOpacity=e.material[t].opacity,"number"==typeof r&&(e.material[t].opacity=r),e.material[t].needsUpdate=!0;else i._preColor=e.material.color,e.material.color=new fm.Color(_.default.toRgba(n)),i._preOpacity=e.material.opacity,"number"==typeof r&&(e.material.opacity=r),e.material.needsUpdate=!0})}},{key:"setColorToDefault",value:function(){var n=this;this._renderNode.traverse(function(e){if(e instanceof fm.Mesh)if(void 0!==e.material.length)for(var t=0;t<e.material.length;t++)e.material[t].color=n._preColor,e.material[t].opacity=n._preOpacity,e.material[t].needsUpdate=!0;else e.material.color=n._preColor,e.material.opacity=n._preOpacity,e.material.needsUpdate=!0})}},{key:"gradientColor",value:function(){var t=this;if(this._renderNode){this._renderNode.material.userData.color=this._renderNode.material.color;var e=this.findParent(NodeManager),n=e.map,r=n.modelSelectColor;animater=new Animater({r:r.r/2,g:r.g/2,b:r.b/2,a:r.a/2},r,500,function(){n.removeAnimater(animater),animater=void 0},function(e){t._renderNode.material.color=new fm.Color(e.r,e.g,e.b),t._renderNode.material.alpha=e.a,t._renderNode.material.update=!0}).start(),n.addAnimater(animater)}}},{key:"clearGradient",value:function(){if(this._renderNode){var e=this.findParent(NodeManager),t=e.map;animater&&t.removeAnimater(animater),this._renderNode.material.color=this._renderNode.material.userData.color,this._renderNode.material.userData.color=void 0}}},{key:"dispose",value:function(){if(this._renderNode&&"Mesh"===this._renderNode.type){for(var e in this._renderNode.material.uniforms)e.value instanceof fm.Texture&&e.value.dispose();if((0,h.default)(this._renderNode.material)){var t,n=x(this._renderNode.material);try{for(n.s();!(t=n.n()).done;){var r=t.value;r.dispose()}}catch(e){n.e(e)}finally{n.f()}}else this._renderNode.material.dispose();this._renderNode.geometry.dispose(),this._renderNode.material=void 0,this._renderNode.geometry=void 0,this._geometry=void 0,this._renderNode.mapNode=void 0,this._renderNode=void 0}}},{key:"visible",set:function(e){e?this.parent.scene.children.indexOf(this._renderNode)<0&&this._renderNode&&this.parent.scene.add(this._renderNode):(this._renderNode&&this.parent.scene.remove(this._renderNode),this._renderNode.parent=this.parent.scene),this._visible=e},get:function(){return this._visible}},{key:"renderNode",get:function(){return this._renderNode},set:function(e){this.parent&&(this._renderNode=e,this._renderNode.mapNode=this,this.parent.scene.children.indexOf(this._renderNode)<0&&this._renderNode&&this.parent.scene.add(this._renderNode))}},{key:"bdata",get:function(){return this._bdata},set:function(e){this._bdata=e}}]),i}(g.default),T=E;t.default=T},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var s=r(n(18)),l=r(n(13)),u=r(n(17)),c=r(n(16)),a=r(n(15));n(10),n(5),n(4);var o=r(n(6));n(85);var h=r(n(68)),f=r(n(47)),d=r(n(2)),p=r(n(3)),m=r(n(7)),v=r(n(8)),g=r(n(9)),y=r(n(12)),_=n(204),x=(r(n(379)),r(n(72))),w=r(n(57));function b(e){if(void 0===c.default||null==e[u.default]){if((0,l.default)(e)||(e=M(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i,a=!0,o=!1;return{s:function(){r=(0,s.default)(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){o=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(o)throw i}}}}function M(e,t){if(e){if("string"==typeof e)return S(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?(0,a.default)(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?S(e,t):void 0}}function S(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function E(r){return function(){var e,t=(0,v.default)(r);if(T()){var n=(0,v.default)(this).constructor;e=(0,o.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,m.default)(this,e)}}function T(){if("undefined"==typeof Reflect||!o.default)return!1;if(o.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,o.default)(Date,[],function(){})),!0}catch(e){return!1}}var A=function(e){(0,g.default)(a,e);var i=E(a);function a(e,t,n){var r;return(0,d.default)(this,a),r=i.call(this,e),r._layers={},r.initLayers(),r.initLayersByData(t),r._visible=!0,r._groupMessage=n,r._locations=[],r._height=n.height,r._locationScene=new fm.Scene,r._locationScene.userData.type="location",r._locationScene.position.setY(r._height),r._locationScene.updateMatrix(),r._locationScene.updateWorldMatrix(),r._offsetHeight=0,r._lineScene=new fm.Scene,r._lineScene.userData.type="line",r.externalModels={},r.isGroup=!0,r.alwaysShowMarkers=[],r._groupAlias=n.alias,r._groupDesc=n.desc,r._groupName=n.gname,r._hideWithFree=!1,r.modelShadow={},r._group=new fm.Scene,r._mainLight=null,r.initScene(),r}return(0,p.default)(a,[{key:"initScene",value:function(){this._layers.extent[0]&&this._group.add(this._layers.extent[0]._scene),this._layers.model[0]&&this._group.add(this._layers.model[0]._scene)}},{key:"getHeight",value:function(){return this.height+this._offsetHeight}},{key:"getOrCreateLayer",value:function(e){if(this._layers[e][0])return this._layers[e][0];var t=_.AliasLayerMap.get(e),n=new t;return n.scene.position.setY(this._height),n.scene.updateMatrix(),n.scene.updateWorldMatrix(),n.parent=this,this._layers[e].push(n),this.parent.parent.map.setRenderList(),this._layers[e][0]}},{key:"getLayers",value:function(e){var t=[],n=this._layers[e];return t.push.apply(t,(0,f.default)(n)),t}},{key:"getDynmodel",value:function(e){for(var t=this._layers.dynmodel,n=0;n<t.length;n++){var r=t[n].scene;r&&e(r)}}},{key:"everyLayers",value:function(e,t){if(this._layers)for(var n in this._layers)if(!(-1<e.indexOf(n)))for(var r=this._layers[n],i=0;i<r.length;i++){var a=r[i].scene;a&&t(a)}}},{key:"getNodeByLayerId",value:function(e,t){if(this._layers)return this._layers[e][0]?this._layers[e][0].getNodeById(t):void 0}},{key:"bcross",value:function(e,t){var n=e.renderNode.boundingBox.min,r=e.renderNode.boundingBox.max,i=t.renderNode.boundingBox.min,a=t.renderNode.boundingBox.max;return x.default.isRectCross(new vector2(n.x,n.z),new vector2(r.x,r.z),new vector2(i.x,i.z),new vector2(a.x,a.z))}},{key:"mergeModels",value:function(e){var t=this._layers.model[0],n=[];for(var r in t._models)t._models[r].FID in e&&n.push(t._models[r]);var i,a=this.checkModelsNearly(n),o=b(a.l);try{for(o.s();!(i=o.n()).done;){var s=i.value;t.removeNode(s)}}catch(e){o.e(e)}finally{o.f()}}},{key:"mergeModel",value:function(e,t){var n=new ThreeBSP(e.renderNode.geometry),r=new ThreeBSP(t.renderNode.geometry),i=n.union(r.tree),a=i.toMesh(e.material);return e._renderNode=a}},{key:"couldMerge",value:function(e,t){var n=new ThreeBSP(e.renderNode.geometry),r=new ThreeBSP(t.renderNode.geometry),i=n.intersect(r.tree);return 0<i.tree.polygons.length}},{key:"checkModelsNearly",value:function(e){for(var t=[],n=0;n<e.length;n++){for(var r=0,i=0;i<e.length;i++)this.bcross(e[n],e[i])&&r++;r||t.push(n)}for(var a=t.length-1;-1<a;a--){var o=e.indexOf(e[t[a]]);-1<o&&e.splice(o,1)}for(var s=0,l=1,u=[],c=[];0<e.length;)if(this.couldMerge(e[s],e[l])){var h=this.mergeM(e[s],e[l]);c.push(e[l]),e.splice(l,1),e.splice(s,1),e.push(h),s=0,l=1}else{if(l!==e.length-1)return l++,{e:u,l:c};var f=e.splice(s,1);u.push(f),s=0,l=1}}},{key:"traverse",value:function(e){if(this._layers)for(var t in this._layers)for(var n=this._layers[t],r=0;r<n.length;r++)e(n[r])}},{key:"traverseByAlias",value:function(r,i,a){var o=this;if(this._layers){var e=function(t){if(-1<r.indexOf(t))for(var e=o._layers[t],n=0;n<e.length;n++)a?i(e[n],t):e[n].traverse(function(e){i(e,t)})};for(var t in this._layers)e(t)}}},{key:"setExtentImage",value:function(e){var t,n=this.parent.parent.materialManager.loadTexture(e,function(){}),r=this.getLayers("extent"),i=b(r);try{for(i.s();!(t=i.n()).done;){var a=t.value;for(var o in a.extents){var s=a.extents[o];s.renderNode.material.map&&s.renderNode.material.map.dispose(),s.renderNode.material.map=n,s.renderNode.material.needsUpdate=!0}}}catch(e){i.e(e)}finally{i.f()}}},{key:"clearExtentImage",value:function(){var e,t=this.getLayers("extent"),n=b(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;for(var i in r.extents){var a=r.extents[i];a.renderNode.material.map.dispose(),a.renderNode.material.map=null,a.renderNode.material.needsUpdate=!0}}}catch(e){n.e(e)}finally{n.f()}}},{key:"_getLayers",value:function(e){if(this._layers){var t={};for(var n in this._layers){for(var r=this._layers[n],i=[],a=0;a<r.length;a++){e&&r[a].checkSceneNode();var o=r[a].scene;r[a].visible&&o&&i.push(o)}t[n]=i}return t}}},{key:"initLayers",value:function(){var e,t=b(_.LayerAlias);try{for(t.s();!(e=t.n()).done;){var n=e.value;this._layers[n]=[]}}catch(e){t.e(e)}finally{t.f()}}},{key:"initLayersByData",value:function(e){var t,n=e.geo[0],r=e.biz[0],i=(0,h.default)(n),a=b(i);try{for(a.s();!(t=a.n()).done;){var o=t.value;if(n[o]&&0<n[o].length&&_.Prop2Alias[o]){var s=_.AliasLayerMap.get(_.Prop2Alias[o]),l=new s(n[o],r[o]);l.scene.position.setY(this._height),l.scene.updateMatrix(),l.scene.updateWorldMatrix(),l.parent=this,this._layers[_.Prop2Alias[o]].push(l)}}}catch(e){a.e(e)}finally{a.f()}}},{key:"removeAlwaysShowMarker",value:function(e){var t=this.alwaysShowMarkers.indexOf(e);-1<t&&this.alwaysShowMarkers.splice(t,1)}},{key:"dispose",value:function(){for(var e in this.alwaysShowMarkers.length=0,this.layers){for(var t=this.layers[e],n=0;n<t.length;n++)t[n].dispose(),t[n].parent=void 0;t.length=0,this._layers[e]=void 0}for(var r=this._locationScene.children.length-1;-1<r;r--)this._locationScene.remove(this._locationScene.children[r]);var i,a=b(this._locations);try{for(a.s();!(i=a.n()).done;){var o=i.value;o.parent=void 0,o.dispose()}}catch(e){a.e(e)}finally{a.f()}this._groupMessage=void 0,this._layers=void 0}},{key:"addLayer",value:function(e){e.parent=this,e.scene.position.setY(this._height),e.scene.updateMatrix(),e.scene.updateWorldMatrix(),this._layers[e.alias].push(e),this.parent.parent.map.setRenderList(),(e.prepareInited||0<e.prepareInitObjects.length)&&e.initPrepare()}},{key:"removeLayer",value:function(e){e.removeAll&&e.removeAll(),e.parent=void 0;var t=this._layers[e.alias].indexOf(e);-1<t&&this._layers[e.alias].splice(t,1),this.parent.parent.map.setRenderList()}},{key:"getLayer",value:function(e){var t=this._layers[e];if(1<t.length){var n=[];return n.push.apply(n,(0,f.default)(t)),n}return t[0]}},{key:"getFirstLayer",value:function(){var e=this._layers[layer.alias];return e[0]}},{key:"addLocation",value:function(e){e.parent=this,this._locations.push(e),this._locationScene.add(e.renderNode)}},{key:"removeLocation",value:function(e){var t=this._locations.indexOf(e);e.isAlwaysShow&&this.removeAlwaysShowMarker(e),e.parent=void 0,-1<t&&this._locations.splice(t,1),this._locationScene.remove(e.renderNode)}},{key:"getCenterPosition",value:function(){return new fm.Vector3(this.parent.center.x,this.parent.center.y+this._height,0)}},{key:"getModelMeshs",value:function(){var e,t=[],n=b(this._layers.model);try{for(n.s();!(e=n.n()).done;){var r=e.value;t.push.apply(t,(0,f.default)(r.getAllMesh()))}}catch(e){n.e(e)}finally{n.f()}return t}},{key:"getExtentMeshs",value:function(){var e,t=[],n=b(this._layers.extent);try{for(n.s();!(e=n.n()).done;){var r=e.value;t.push.apply(t,(0,f.default)(r.getAllMesh()))}}catch(e){n.e(e)}finally{n.f()}return t}},{key:"applyHeatMap",value:function(e){e&&(e.renderToMap(this._groupId),this.heatmap_=e)}},{key:"removeHeatMap",value:function(e){e.disposeHeatMap(this._groupId),this.heatmap_=null}},{key:"addLine",value:function(e){this._lineScene.add(e)}},{key:"removeLine",value:function(e){this._lineScene.remove(e)}},{key:"locationScene",get:function(){return this._locationScene}},{key:"lineScene",get:function(){return this._lineScene}},{key:"groupAlias",get:function(){return this._groupAlias}},{key:"groupDesc",get:function(){return this._groupDesc}},{key:"groupName",get:function(){return this._groupName}},{key:"groupHeight",get:function(){return this._groupHeight}},{key:"height",set:function(t){this._height=t,this.traverse(function(e){e.scene.position.setY(t),e.scene.updateMatrix(),e.scene.updateWorldMatrix()}),this._locationScene.position.setY(t),this._locationScene.updateMatrix(),this._locationScene.updateWorldMatrix()},get:function(){return this._height}},{key:"layers",get:function(){return this._layers}},{key:"visible",get:function(){return this._visible},set:function(e){this._hideWithFree&&(e||this.traverseByAlias(["extent","label","facility","model"],function(e){e.releaseGpuMemory()})),this._visible=e}},{key:"offsetHeight",set:function(e){this._offsetHeight=e},get:function(){return this._offsetHeight}},{key:"hideWithFree",set:function(e){this._hideWithFree=e}},{key:"mapCoord",get:function(){return(new fm.Vector2).copy(this.parent.mapcenter)}},{key:"mapCoordRange",get:function(){for(var e=[{x:Number.MAX_VALUE,y:Number.MAX_VALUE},{x:-Number.MAX_VALUE,y:-Number.MAX_VALUE}],t=this._layers.extent,n=0;n<t.length;n++){var r=t[n],i=r._extents;for(var a in i)for(var o=i[a],s=o.gdata.geo,l=w.default.convertGeo2Geometry(s).vertices,u=0;u<l.length;u++)u%2==0?(l[u]<e[0].x&&(e[0].x=l[u]),l[u]>e[1].x&&(e[1].x=l[u])):(l[u]<e[0].y&&(e[0].y=l[u]),l[u]>e[1].y&&(e[1].y=l[u]))}return e}}]),a}(y.default),L=A;t.default=L},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0,n(5),n(4);var a=r(n(6));n(46);var o=r(n(2)),s=r(n(7)),l=r(n(8)),u=r(n(9));function c(r){return function(){var e,t=(0,l.default)(r);if(h()){var n=(0,l.default)(this).constructor;e=(0,a.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,s.default)(this,e)}}function h(){if("undefined"==typeof Reflect||!a.default)return!1;if(a.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,a.default)(Date,[],function(){})),!0}catch(e){return!1}}var f=function(e){(0,u.default)(i,e);var r=c(i);function i(){var e;(0,o.default)(this,i),e=r.call(this);var t=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),n=new fm.InterleavedBuffer(t,5);return e.setIndex([0,1,2,0,2,3]),e.addAttribute("position",new fm.InterleavedBufferAttribute(n,3,0,!1)),e.addAttribute("uv",new fm.InterleavedBufferAttribute(n,2,3,!1)),e}return i}(fm.BufferGeometry),d=f;t.default=d},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var p=r(n(68));n(56);var a=r(n(32)),o=r(n(55));n(46),n(186),n(141),n(187),n(188);var s=r(n(69));n(66),n(144),n(103),n(62),n(4),n(386);var m=r(n(13)),g=r(n(387));function l(e){this.manager=void 0!==e?e:fm.DefaultLoadingManager,this.dracoLoader=null,this.ddsLoader=null}function u(){var n={};return{get:function(e){return n[e]},add:function(e,t){n[e]=t},remove:function(e){delete n[e]},removeAll:function(){n={}}}}n(10),n(142),l.prototype={constructor:l,crossOrigin:"anonymous",load:function(n,r,e,t){var i,a=this;i=void 0!==this.resourcePath?this.resourcePath:void 0!==this.path?this.path:fm.LoaderUtils.extractUrlBase(n),a.manager.itemStart(n);var o=function(e){t?t(e):console.error(e),a.manager.itemError(n),a.manager.itemEnd(n)},s=new fm.FileLoader(a.manager);s.setPath(this.path),s.setResponseType("arraybuffer"),"use-credentials"===a.crossOrigin&&s.setWithCredentials(!0),s.load(n,function(t){try{a.parse(t,i,function(e){r(e,t),a.manager.itemEnd(n)},o)}catch(e){o(e)}},e,o)},setCrossOrigin:function(e){return this.crossOrigin=e,this},setPath:function(e){return this.path=e,this},setResourcePath:function(e){return this.resourcePath=e,this},setDRACOLoader:function(e){return this.dracoLoader=e,this},setDDSLoader:function(e){return this.ddsLoader=e,this},parse:function(e,t,n,r){var i,a={};if("string"==typeof e)i=e;else{var o=fm.LoaderUtils.decodeText(new Uint8Array(e,0,4));if(o===_){try{a[v.KHR_BINARY_GLTF]=new x(e)}catch(e){return void(r&&r(e))}i=a[v.KHR_BINARY_GLTF].content}else i=fm.LoaderUtils.decodeText(new Uint8Array(e))}var s=JSON.parse(i);if(void 0===s.asset||s.asset.version[0]<2)r&&r(new Error("fm.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported. Use LegacyGLTFLoader instead."));else{if(s.extensionsUsed)for(var l=0;l<s.extensionsUsed.length;++l){var u=s.extensionsUsed[l],c=s.extensionsRequired||[];switch(u){case v.KHR_LIGHTS_PUNCTUAL:a[u]=new d(s);break;case v.KHR_MATERIALS_UNLIT:a[u]=new y;break;case v.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:a[u]=new M;break;case v.KHR_DRACO_MESH_COMPRESSION:a[u]=new w(s,this.dracoLoader);break;case v.MSFT_TEXTURE_DDS:a[v.MSFT_TEXTURE_DDS]=new f(this.ddsLoader);break;case v.KHR_TEXTURE_TRANSFORM:a[v.KHR_TEXTURE_TRANSFORM]=new b;break;default:0<=c.indexOf(u)&&console.warn('fm.GLTFLoader: Unknown extension "'+u+'".')}}var h=new j(s,a,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,manager:this.manager});h.parse(n,r)}}};var v={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",MSFT_TEXTURE_DDS:"MSFT_texture_dds"};function f(e){if(!e)throw new Error("fm.GLTFLoader: Attempting to load .dds texture without importing fm.DDSLoader");this.name=v.MSFT_TEXTURE_DDS,this.ddsLoader=e}function d(e){this.name=v.KHR_LIGHTS_PUNCTUAL;var t=e.extensions&&e.extensions[v.KHR_LIGHTS_PUNCTUAL]||{};this.lightDefs=t.lights||[]}function y(){this.name=v.KHR_MATERIALS_UNLIT}d.prototype.loadLight=function(e){var t,n=this.lightDefs[e],r=new fm.Color(16777215);void 0!==n.color&&r.fromArray(n.color);var i=void 0!==n.range?n.range:0;switch(n.type){case"directional":t=new fm.DirectionalLight(r),t.target.position.set(0,0,-1),t.add(t.target);break;case"point":t=new fm.PointLight(r),t.distance=i;break;case"spot":t=new fm.SpotLight(r),t.distance=i,n.spot=n.spot||{},n.spot.innerConeAngle=void 0!==n.spot.innerConeAngle?n.spot.innerConeAngle:0,n.spot.outerConeAngle=void 0!==n.spot.outerConeAngle?n.spot.outerConeAngle:Math.PI/4,t.angle=n.spot.outerConeAngle,t.penumbra=1-n.spot.innerConeAngle/n.spot.outerConeAngle,t.target.position.set(0,0,-1),t.add(t.target);break;default:throw new Error('fm.GLTFLoader: Unexpected light type, "'+n.type+'".')}return t.position.set(0,0,0),t.decay=2,void 0!==n.intensity&&(t.intensity=n.intensity),t.name=n.name||"light_"+e,g.default.resolve(t)},y.prototype.getMaterialType=function(){return fm.MeshBasicMaterial},y.prototype.extendParams=function(e,t,n){var r=[];e.color=new fm.Color(1,1,1),e.opacity=1;var i=t.pbrMetallicRoughness;if(i){if((0,m.default)(i.baseColorFactor)){var a=i.baseColorFactor;e.color.fromArray(a),e.opacity=a[3]}void 0!==i.baseColorTexture&&r.push(n.assignTexture(e,"map",i.baseColorTexture))}return g.default.all(r)};var _="glTF",c=12,h={JSON:1313821514,BIN:5130562};function x(e){this.name=v.KHR_BINARY_GLTF,this.content=null,this.body=null;var t=new DataView(e,0,c);if(this.header={magic:fm.LoaderUtils.decodeText(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==_)throw new Error("fm.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("fm.GLTFLoader: Legacy binary file detected. Use LegacyGLTFLoader instead.");for(var n=new DataView(e,c),r=0;r<n.byteLength;){var i=n.getUint32(r,!0);r+=4;var a=n.getUint32(r,!0);if(r+=4,a===h.JSON){var o=new Uint8Array(e,c+r,i);this.content=fm.LoaderUtils.decodeText(o)}else if(a===h.BIN){var s=c+r;this.body=e.slice(s,s+i)}r+=i}if(null===this.content)throw new Error("fm.GLTFLoader: JSON content not found.")}function w(e,t){if(!t)throw new Error("fm.GLTFLoader: No DRACOLoader instance provided.");this.name=v.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t}function b(){this.name=v.KHR_TEXTURE_TRANSFORM}function M(){return{name:v.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,specularGlossinessParams:["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity","refractionRatio"],getMaterialType:function(){return fm.ShaderMaterial},extendParams:function(e,t,n){var r=t.extensions[this.name],i=fm.ShaderLib.standard,a=fm.UniformsUtils.clone(i.uniforms),o=["#ifdef USE_SPECULARMAP","\tuniform sampler2D specularMap;","#endif"].join("\n"),s=["#ifdef USE_GLOSSINESSMAP","\tuniform sampler2D glossinessMap;","#endif"].join("\n"),l=["vec3 specularFactor = specular;","#ifdef USE_SPECULARMAP","\tvec4 texelSpecular = texture2D( specularMap, vUv );","\ttexelSpecular = sRGBToLinear( texelSpecular );","\t// reads channel RGB, compatible with a glTF Specular-Glossiness (RGBA) texture","\tspecularFactor *= texelSpecular.rgb;","#endif"].join("\n"),u=["float glossinessFactor = glossiness;","#ifdef USE_GLOSSINESSMAP","\tvec4 texelGlossiness = texture2D( glossinessMap, vUv );","\t// reads channel A, compatible with a glTF Specular-Glossiness (RGBA) texture","\tglossinessFactor *= texelGlossiness.a;","#endif"].join("\n"),c=["PhysicalMaterial material;","material.diffuseColor = diffuseColor.rgb;","material.specularRoughness = clamp( 1.0 - glossinessFactor, 0.04, 1.0 );","material.specularColor = specularFactor.rgb;"].join("\n"),h=i.fragmentShader.replace("uniform float roughness;","uniform vec3 specular;").replace("uniform float metalness;","uniform float glossiness;").replace("#include <roughnessmap_pars_fragment>",o).replace("#include <metalnessmap_pars_fragment>",s).replace("#include <roughnessmap_fragment>",l).replace("#include <metalnessmap_fragment>",u).replace("#include <lights_physical_fragment>",c);delete a.roughness,delete a.metalness,delete a.roughnessMap,delete a.metalnessMap,a.specular={value:(new fm.Color).setHex(1118481)},a.glossiness={value:.5},a.specularMap={value:null},a.glossinessMap={value:null},e.vertexShader=i.vertexShader,e.fragmentShader=h,e.uniforms=a,e.defines={STANDARD:""},e.color=new fm.Color(1,1,1),e.opacity=1;var f=[];if((0,m.default)(r.diffuseFactor)){var d=r.diffuseFactor;e.color.fromArray(d),e.opacity=d[3]}if(void 0!==r.diffuseTexture&&f.push(n.assignTexture(e,"map",r.diffuseTexture)),e.emissive=new fm.Color(0,0,0),e.glossiness=void 0!==r.glossinessFactor?r.glossinessFactor:1,e.specular=new fm.Color(1,1,1),(0,m.default)(r.specularFactor)&&e.specular.fromArray(r.specularFactor),void 0!==r.specularGlossinessTexture){var p=r.specularGlossinessTexture;f.push(n.assignTexture(e,"glossinessMap",p)),f.push(n.assignTexture(e,"specularMap",p))}return g.default.all(f)},createMaterial:function(e){var t=new fm.ShaderMaterial({defines:e.defines,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader,uniforms:e.uniforms,fog:!0,lights:!0,opacity:e.opacity,transparent:e.transparent});return t.isGLTFSpecularGlossinessMaterial=!0,t.color=e.color,t.map=void 0===e.map?null:e.map,t.lightMap=null,t.lightMapIntensity=1,t.aoMap=void 0===e.aoMap?null:e.aoMap,t.aoMapIntensity=1,t.emissive=e.emissive,t.emissiveIntensity=1,t.emissiveMap=void 0===e.emissiveMap?null:e.emissiveMap,t.bumpMap=void 0===e.bumpMap?null:e.bumpMap,t.bumpScale=1,t.normalMap=void 0===e.normalMap?null:e.normalMap,e.normalScale&&(t.normalScale=e.normalScale),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.specularMap=void 0===e.specularMap?null:e.specularMap,t.specular=e.specular,t.glossinessMap=void 0===e.glossinessMap?null:e.glossinessMap,t.glossiness=e.glossiness,t.alphaMap=null,t.envMap=void 0===e.envMap?null:e.envMap,t.envMapIntensity=1,t.refractionRatio=.98,t.extensions.derivatives=!0,t},cloneMaterial:function(e){var t=e.clone();t.isGLTFSpecularGlossinessMaterial=!0;for(var n=this.specularGlossinessParams,r=0,i=n.length;r<i;r++){var a=e[n[r]];t[n[r]]=a&&a.isColor?a.clone():a}return t},refreshUniforms:function(e,t,n,r,i){if(!0===i.isGLTFSpecularGlossinessMaterial){var a,o=i.uniforms,s=i.defines;o.opacity.value=i.opacity,o.diffuse.value.copy(i.color),o.emissive.value.copy(i.emissive).multiplyScalar(i.emissiveIntensity),o.map.value=i.map,o.specularMap.value=i.specularMap,o.alphaMap.value=i.alphaMap,o.lightMap.value=i.lightMap,o.lightMapIntensity.value=i.lightMapIntensity,o.aoMap.value=i.aoMap,o.aoMapIntensity.value=i.aoMapIntensity,i.map?a=i.map:i.specularMap?a=i.specularMap:i.displacementMap?a=i.displacementMap:i.normalMap?a=i.normalMap:i.bumpMap?a=i.bumpMap:i.glossinessMap?a=i.glossinessMap:i.alphaMap?a=i.alphaMap:i.emissiveMap&&(a=i.emissiveMap),void 0!==a&&(a.isWebGLRenderTarget&&(a=a.texture),!0===a.matrixAutoUpdate&&a.updateMatrix(),o.uvTransform.value.copy(a.matrix)),i.envMap&&(o.envMap.value=i.envMap,o.envMapIntensity.value=i.envMapIntensity,o.flipEnvMap.value=i.envMap.isCubeTexture?-1:1,o.reflectivity.value=i.reflectivity,o.refractionRatio.value=i.refractionRatio,o.maxMipLevel.value=e.properties.get(i.envMap).__maxMipLevel),o.specular.value.copy(i.specular),o.glossiness.value=i.glossiness,o.glossinessMap.value=i.glossinessMap,o.emissiveMap.value=i.emissiveMap,o.bumpMap.value=i.bumpMap,o.normalMap.value=i.normalMap,o.displacementMap.value=i.displacementMap,o.displacementScale.value=i.displacementScale,o.displacementBias.value=i.displacementBias,null!==o.glossinessMap.value&&void 0===s.USE_GLOSSINESSMAP&&(s.USE_GLOSSINESSMAP="",s.USE_ROUGHNESSMAP=""),null===o.glossinessMap.value&&void 0!==s.USE_GLOSSINESSMAP&&(delete s.USE_GLOSSINESSMAP,delete s.USE_ROUGHNESSMAP)}}}}function A(e,t,n,r){fm.Interpolant.call(this,e,t,n,r)}w.prototype.decodePrimitive=function(e,t){var n=this.json,r=this.dracoLoader,i=e.extensions[this.name].bufferView,a=e.extensions[this.name].attributes,o={},s={},l={};for(var u in a){var c=I[u]||u.toLowerCase();o[c]=a[u]}for(u in e.attributes)if(c=I[u]||u.toLowerCase(),void 0!==a[u]){var h=n.accessors[e.attributes[u]],f=T[h.componentType];l[c]=f,s[c]=!0===h.normalized}return t.getDependency("bufferView",i).then(function(e){return new g.default(function(i){r.decodeDracoFile(e,function(e){for(var t in e.attributes){var n=e.attributes[t],r=s[t];void 0!==r&&(n.normalized=r)}i(e)},o,l)})})},b.prototype.extendTexture=function(e,t){return e=e.clone(),void 0!==t.offset&&e.offset.fromArray(t.offset),void 0!==t.rotation&&(e.rotation=t.rotation),void 0!==t.scale&&e.repeat.fromArray(t.scale),void 0!==t.texCoord&&console.warn('fm.GLTFLoader: Custom UV sets in "'+this.name+'" extension not yet supported.'),e.needsUpdate=!0,e},A.prototype=(0,s.default)(fm.Interpolant.prototype),A.prototype.constructor=A,A.prototype.copySampleValue_=function(e){for(var t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,i=e*r*3+r,a=0;a!==r;a++)t[a]=n[i+a];return t},A.prototype.beforeStart_=A.prototype.copySampleValue_,A.prototype.afterEnd_=A.prototype.copySampleValue_,A.prototype.interpolate_=function(e,t,n,r){for(var i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=2*o,l=3*o,u=r-t,c=(n-t)/u,h=c*c,f=h*c,d=e*l,p=d-l,m=-2*f+3*h,v=f-h,g=1-m,y=v-h+c,_=0;_!==o;_++){var x=a[p+_+o],w=a[p+_+s]*u,b=a[d+_+o],M=a[d+_]*u;i[_]=g*x+y*w+m*b+v*M}return i};var S,E={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},T={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},L={9728:fm.NearestFilter,9729:fm.LinearFilter,9984:fm.NearestMipmapNearestFilter,9985:fm.LinearMipmapNearestFilter,9986:fm.NearestMipmapLinearFilter,9987:fm.LinearMipmapLinearFilter},R={33071:fm.ClampToEdgeWrapping,33648:fm.MirroredRepeatWrapping,10497:fm.RepeatWrapping},C={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},I={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},k={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},P={CUBICSPLINE:void 0,LINEAR:fm.InterpolateLinear,STEP:fm.InterpolateDiscrete},N={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"},D={"image/png":fm.RGBAFormat,"image/jpeg":fm.RGBFormat};function O(e,t){return"string"!=typeof e||""===e?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}function F(){return S=S||new fm.MeshStandardMaterial({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:fm.FrontSide}),S}function B(e,t,n){for(var r in n.extensions)void 0===e[r]&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[r]=n.extensions[r])}function U(e,t){void 0!==t.extras&&("object"===(0,o.default)(t.extras)?(0,a.default)(e.userData,t.extras):console.warn("fm.GLTFLoader: Ignoring primitive type .extras, "+t.extras))}function G(d,p,e){for(var m=!1,v=!1,t=0,n=p.length;t<n;t++){var r=p[t];if(void 0!==r.POSITION&&(m=!0),void 0!==r.NORMAL&&(v=!0),m&&v)break}if(!m&&!v)return g.default.resolve(d);var i=[],a=[];for(t=0,n=p.length;t<n;t++){if(r=p[t],m){var o=void 0!==r.POSITION?e.getDependency("accessor",r.POSITION):d.attributes.position;i.push(o)}v&&(o=void 0!==r.NORMAL?e.getDependency("accessor",r.NORMAL):d.attributes.normal,a.push(o))}return g.default.all([g.default.all(i),g.default.all(a)]).then(function(e){for(var t=e[0],n=e[1],r=0,i=t.length;r<i;r++)d.attributes.position!==t[r]&&(t[r]=W(t[r]));for(r=0,i=n.length;r<i;r++)d.attributes.normal!==n[r]&&(n[r]=W(n[r]));for(r=0,i=p.length;r<i;r++){var a=p[r],o="morphTarget"+r;if(m&&void 0!==a.POSITION){var s=t[r];s.name=o;for(var l=d.attributes.position,u=0,c=s.count;u<c;u++)s.setXYZ(u,s.getX(u)+l.getX(u),s.getY(u)+l.getY(u),s.getZ(u)+l.getZ(u))}if(v&&void 0!==a.NORMAL){var h=n[r];h.name=o;var f=d.attributes.normal;for(u=0,c=h.count;u<c;u++)h.setXYZ(u,h.getX(u)+f.getX(u),h.getY(u)+f.getY(u),h.getZ(u)+f.getZ(u))}}return m&&(d.morphAttributes.position=t),v&&(d.morphAttributes.normal=n),d})}function z(e,t){if(e.updateMorphTargets(),void 0!==t.weights)for(var n=0,r=t.weights.length;n<r;n++)e.morphTargetInfluences[n]=t.weights[n];if(t.extras&&(0,m.default)(t.extras.targetNames)){var i=t.extras.targetNames;if(e.morphTargetInfluences.length===i.length)for(e.morphTargetDictionary={},n=0,r=i.length;n<r;n++)e.morphTargetDictionary[i[n]]=n;else console.warn("fm.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function V(e){var t,n=e.extensions&&e.extensions[v.KHR_DRACO_MESH_COMPRESSION];return t=n?"draco:"+n.bufferView+":"+n.indices+":"+H(n.attributes):e.indices+":"+H(e.attributes)+":"+e.mode,t}function H(e){for(var t="",n=(0,p.default)(e).sort(),r=0,i=n.length;r<i;r++)t+=n[r]+":"+e[n[r]]+";";return t}function W(e){if(e.isInterleavedBufferAttribute){for(var t=e.count,n=e.itemSize,r=e.array.slice(0,t*n),i=0,a=0;i<t;++i)r[a++]=e.getX(i),2<=n&&(r[a++]=e.getY(i)),3<=n&&(r[a++]=e.getZ(i)),4<=n&&(r[a++]=e.getW(i));return new fm.BufferAttribute(r,n,e.normalized)}return e.clone()}function j(e,t,n){this.json=e||{},this.extensions=t||{},this.options=n||{},this.cache=new u,this.primitiveCache={},this.textureLoader=new fm.TextureLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.fileLoader=new fm.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),"use-credentials"===this.options.crossOrigin&&this.fileLoader.setWithCredentials(!0)}function Y(n,e,r){var t=e.attributes,i=[];function a(e,t){return r.getDependency("accessor",e).then(function(e){n.addAttribute(t,e)})}for(var o in t){var s=I[o]||o.toLowerCase();s in n.attributes||i.push(a(t[o],s))}if(void 0!==e.indices&&!n.index){var l=r.getDependency("accessor",e.indices).then(function(e){n.setIndex(e)});i.push(l)}return U(n,e),g.default.all(i).then(function(){return void 0!==e.targets?G(n,e.targets,r):n})}function q(e,o,s,u){var c=s.nodes[e];return u.getDependency("node",e).then(function(e){return void 0===c.skin?e:u.getDependency("skin",c.skin).then(function(e){l=e;for(var t=[],n=0,r=l.joints.length;n<r;n++)t.push(u.getDependency("node",l.joints[n]));return g.default.all(t)}).then(function(s){return e.traverse(function(e){if(e.isMesh){for(var t=[],n=[],r=0,i=s.length;r<i;r++){var a=s[r];if(a){t.push(a);var o=new fm.Matrix4;void 0!==l.inverseBindMatrices&&o.fromArray(l.inverseBindMatrices.array,16*r),n.push(o)}else console.warn('fm.GLTFLoader: Joint "%s" could not be found.',l.joints[r])}e.bind(new fm.Skeleton(t,n),e.matrixWorld)}}),e});var l}).then(function(e){o.add(e);var t=[];if(c.children)for(var n=c.children,r=0,i=n.length;r<i;r++){var a=n[r];t.push(q(a,e,s,u))}return g.default.all(t)})}j.prototype.parse=function(n,e){var r=this,i=this.json,a=this.extensions;this.cache.removeAll(),this.markDefs(),g.default.all([this.getDependencies("scene"),this.getDependencies("animation"),this.getDependencies("camera")]).then(function(e){var t={scene:e[0][i.scene||0],scenes:e[0],animations:e[1],cameras:e[2],asset:i.asset,parser:r,userData:{}};B(a,t,i),U(t,i),n(t)}).catch(e)},j.prototype.markDefs=function(){for(var e=this.json.nodes||[],t=this.json.skins||[],n=this.json.meshes||[],r={},i={},a=0,o=t.length;a<o;a++)for(var s=t[a].joints,l=0,u=s.length;l<u;l++)e[s[l]].isBone=!0;for(var c=0,h=e.length;c<h;c++){var f=e[c];void 0!==f.mesh&&(void 0===r[f.mesh]&&(r[f.mesh]=i[f.mesh]=0),r[f.mesh]++,void 0!==f.skin&&(n[f.mesh].isSkinnedMesh=!0))}this.json.meshReferences=r,this.json.meshUses=i},j.prototype.getDependency=function(e,t){var n=e+":"+t,r=this.cache.get(n);if(!r){switch(e){case"scene":r=this.loadScene(t);break;case"node":r=this.loadNode(t);break;case"mesh":r=this.loadMesh(t);break;case"accessor":r=this.loadAccessor(t);break;case"bufferView":r=this.loadBufferView(t);break;case"buffer":r=this.loadBuffer(t);break;case"material":r=this.loadMaterial(t);break;case"texture":r=this.loadTexture(t);break;case"skin":r=this.loadSkin(t);break;case"animation":r=this.loadAnimation(t);break;case"camera":r=this.loadCamera(t);break;case"light":r=this.extensions[v.KHR_LIGHTS_PUNCTUAL].loadLight(t);break;default:throw new Error("Unknown type: "+e)}this.cache.add(n,r)}return r},j.prototype.getDependencies=function(n){var e=this.cache.get(n);if(!e){var r=this,t=this.json[n+("mesh"===n?"es":"s")]||[];e=g.default.all(t.map(function(e,t){return r.getDependency(n,t)})),this.cache.add(n,e)}return e},j.prototype.loadBuffer=function(e){var n=this.json.buffers[e],r=this.fileLoader;if(n.type&&"arraybuffer"!==n.type)throw new Error("fm.GLTFLoader: "+n.type+" buffer type is not supported.");if(void 0===n.uri&&0===e)return g.default.resolve(this.extensions[v.KHR_BINARY_GLTF].body);var i=this.options;return new g.default(function(e,t){r.load(O(n.uri,i.path),e,void 0,function(){t(new Error('fm.GLTFLoader: Failed to load buffer "'+n.uri+'".'))})})},j.prototype.loadBufferView=function(e){var r=this.json.bufferViews[e];return this.getDependency("buffer",r.buffer).then(function(e){var t=r.byteLength||0,n=r.byteOffset||0;return e.slice(n,n+t)})},j.prototype.loadAccessor=function(e){var M=this,S=this.json,E=this.json.accessors[e];if(void 0===E.bufferView&&void 0===E.sparse)return g.default.resolve(null);var t=[];return void 0!==E.bufferView?t.push(this.getDependency("bufferView",E.bufferView)):t.push(null),void 0!==E.sparse&&(t.push(this.getDependency("bufferView",E.sparse.indices.bufferView)),t.push(this.getDependency("bufferView",E.sparse.values.bufferView))),g.default.all(t).then(function(e){var t,n,r=e[0],i=C[E.type],a=T[E.componentType],o=a.BYTES_PER_ELEMENT,s=o*i,l=E.byteOffset||0,u=void 0!==E.bufferView?S.bufferViews[E.bufferView].byteStride:void 0,c=!0===E.normalized;if(u&&u!==s){var h=Math.floor(l/u),f="InterleavedBuffer:"+E.bufferView+":"+E.componentType+":"+h+":"+E.count,d=M.cache.get(f);d||(t=new a(r,h*u,E.count*u/o),d=new fm.InterleavedBuffer(t,u/o),M.cache.add(f,d)),n=new fm.InterleavedBufferAttribute(d,i,l%u/o,c)}else t=null===r?new a(E.count*i):new a(r,l,E.count*i),n=new fm.BufferAttribute(t,i,c);if(void 0!==E.sparse){var p=C.SCALAR,m=T[E.sparse.indices.componentType],v=E.sparse.indices.byteOffset||0,g=E.sparse.values.byteOffset||0,y=new m(e[1],v,E.sparse.count*p),_=new a(e[2],g,E.sparse.count*i);null!==r&&n.setArray(n.array.slice());for(var x=0,w=y.length;x<w;x++){var b=y[x];if(n.setX(b,_[x*i]),2<=i&&n.setY(b,_[x*i+1]),3<=i&&n.setZ(b,_[x*i+2]),4<=i&&n.setW(b,_[x*i+3]),5<=i)throw new Error("fm.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return n})},j.prototype.loadTexture=function(e){var r,t=this,i=this.json,a=this.options,o=this.textureLoader,s=window.URL||window.webkitURL,l=i.textures[e],u=l.extensions||{};r=u[v.MSFT_TEXTURE_DDS]?i.images[u[v.MSFT_TEXTURE_DDS].source]:i.images[l.source];var c=r.uri,h=!1;return void 0!==r.bufferView&&(c=t.getDependency("bufferView",r.bufferView).then(function(e){h=!0;var t=new Blob([e],{type:r.mimeType});return c=s.createObjectURL(t),c})),g.default.resolve(c).then(function(n){var r=fm.Loader.Handlers.get(n);return r=r||(u[v.MSFT_TEXTURE_DDS]?t.extensions[v.MSFT_TEXTURE_DDS].ddsLoader:o),new g.default(function(e,t){r.load(O(n,a.path),e,void 0,t)})}).then(function(e){!0===h&&s.revokeObjectURL(c),e.flipY=!1,void 0!==l.name&&(e.name=l.name),r.mimeType in D&&(e.format=D[r.mimeType]);var t=i.samplers||{},n=t[l.sampler]||{};return e.magFilter=L[n.magFilter]||fm.LinearFilter,e.minFilter=L[n.minFilter]||fm.LinearMipmapLinearFilter,e.wrapS=R[n.wrapS]||fm.RepeatWrapping,e.wrapT=R[n.wrapT]||fm.RepeatWrapping,e})},j.prototype.assignTexture=function(n,r,i){var a=this;return this.getDependency("texture",i.index).then(function(e){if(!e.isCompressedTexture)switch(r){case"aoMap":case"emissiveMap":case"metalnessMap":case"normalMap":case"roughnessMap":e.format=fm.RGBFormat}if(a.extensions[v.KHR_TEXTURE_TRANSFORM]){var t=void 0!==i.extensions?i.extensions[v.KHR_TEXTURE_TRANSFORM]:void 0;t&&(e=a.extensions[v.KHR_TEXTURE_TRANSFORM].extendTexture(e,t))}n[r]=e})},j.prototype.assignFinalMaterial=function(e){var t=e.geometry,n=e.material,r=this.extensions,i=void 0!==t.attributes.tangent,a=void 0!==t.attributes.color,o=void 0===t.attributes.normal,s=!0===e.isSkinnedMesh,l=0<(0,p.default)(t.morphAttributes).length,u=l&&void 0!==t.morphAttributes.normal;if(e.isPoints){var c="PointsMaterial:"+n.uuid,h=this.cache.get(c);h||(h=new fm.PointsMaterial,fm.Material.prototype.copy.call(h,n),h.color.copy(n.color),h.map=n.map,h.lights=!1,this.cache.add(c,h)),n=h}else if(e.isLine){c="LineBasicMaterial:"+n.uuid;var f=this.cache.get(c);f||(f=new fm.LineBasicMaterial,fm.Material.prototype.copy.call(f,n),f.color.copy(n.color),f.lights=!1,this.cache.add(c,f)),n=f}if(i||a||o||s||l){c="ClonedMaterial:"+n.uuid+":",n.isGLTFSpecularGlossinessMaterial&&(c+="specular-glossiness:"),s&&(c+="skinning:"),i&&(c+="vertex-tangents:"),a&&(c+="vertex-colors:"),o&&(c+="flat-shading:"),l&&(c+="morph-targets:"),u&&(c+="morph-normals:");var d=this.cache.get(c);d||(d=n.isGLTFSpecularGlossinessMaterial?r[v.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].cloneMaterial(n):n.clone(),s&&(d.skinning=!0),i&&(d.vertexTangents=!0),a&&(d.vertexColors=fm.VertexColors),o&&(d.flatShading=!0),l&&(d.morphTargets=!0),u&&(d.morphNormals=!0),this.cache.add(c,d)),n=d}n.aoMap&&void 0===t.attributes.uv2&&void 0!==t.attributes.uv&&t.addAttribute("uv2",new fm.BufferAttribute(t.attributes.uv.array,2)),n.isGLTFSpecularGlossinessMaterial&&(e.onBeforeRender=r[v.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].refreshUniforms),e.material=n},j.prototype.loadMaterial=function(e){var t,n=this,r=this.json,i=this.extensions,a=r.materials[e],o={},s=a.extensions||{},l=[];if(s[v.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){var u=i[v.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];t=u.getMaterialType(),l.push(u.extendParams(o,a,n))}else if(s[v.KHR_MATERIALS_UNLIT]){var c=i[v.KHR_MATERIALS_UNLIT];t=c.getMaterialType(),l.push(c.extendParams(o,a,n))}else{t=fm.MeshStandardMaterial;var h=a.pbrMetallicRoughness||{};if(o.color=new fm.Color(1,1,1),o.opacity=1,(0,m.default)(h.baseColorFactor)){var f=h.baseColorFactor;o.color.fromArray(f),o.opacity=f[3]}void 0!==h.baseColorTexture&&l.push(n.assignTexture(o,"map",h.baseColorTexture)),o.metalness=void 0!==h.metallicFactor?h.metallicFactor:1,o.roughness=void 0!==h.roughnessFactor?h.roughnessFactor:1,void 0!==h.metallicRoughnessTexture&&(l.push(n.assignTexture(o,"metalnessMap",h.metallicRoughnessTexture)),l.push(n.assignTexture(o,"roughnessMap",h.metallicRoughnessTexture)))}!0===a.doubleSided&&(o.side=fm.DoubleSide);var d=a.alphaMode||N.OPAQUE;return d===N.BLEND?o.transparent=!0:(o.transparent=!1,d===N.MASK&&(o.alphaTest=void 0!==a.alphaCutoff?a.alphaCutoff:.5)),void 0!==a.normalTexture&&t!==fm.MeshBasicMaterial&&(l.push(n.assignTexture(o,"normalMap",a.normalTexture)),o.normalScale=new fm.Vector2(1,1),void 0!==a.normalTexture.scale&&o.normalScale.set(a.normalTexture.scale,a.normalTexture.scale)),void 0!==a.occlusionTexture&&t!==fm.MeshBasicMaterial&&(l.push(n.assignTexture(o,"aoMap",a.occlusionTexture)),void 0!==a.occlusionTexture.strength&&(o.aoMapIntensity=a.occlusionTexture.strength)),void 0!==a.emissiveFactor&&t!==fm.MeshBasicMaterial&&(o.emissive=(new fm.Color).fromArray(a.emissiveFactor)),void 0!==a.emissiveTexture&&t!==fm.MeshBasicMaterial&&l.push(n.assignTexture(o,"emissiveMap",a.emissiveTexture)),g.default.all(l).then(function(){var e;return e=t===fm.ShaderMaterial?i[v.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(o):new t(o),void 0!==a.name&&(e.name=a.name),e.map&&(e.map.encoding=fm.sRGBEncoding),e.emissiveMap&&(e.emissiveMap.encoding=fm.sRGBEncoding),e.specularMap&&(e.specularMap.encoding=fm.sRGBEncoding),U(e,a),a.extensions&&B(i,e,a),e})},j.prototype.loadGeometries=function(e){var n=this,r=this.extensions,t=this.primitiveCache;function i(t){return r[v.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(t,n).then(function(e){return Y(e,t,n)})}for(var a=[],o=0,s=e.length;o<s;o++){var l,u=e[o],c=V(u),h=t[c];h?a.push(h.promise):(l=u.extensions&&u.extensions[v.KHR_DRACO_MESH_COMPRESSION]?i(u):Y(new fm.BufferGeometry,u,n),t[c]={primitive:u,promise:l},a.push(l))}return g.default.all(a)},j.prototype.loadMesh=function(c){for(var h=this,e=this.json,f=e.meshes[c],d=f.primitives,t=[],n=0,r=d.length;n<r;n++){var i=void 0===d[n].material?F():this.getDependency("material",d[n].material);t.push(i)}return g.default.all(t).then(function(u){return h.loadGeometries(d).then(function(e){for(var t=[],n=0,r=e.length;n<r;n++){var i,a=e[n],o=d[n],s=u[n];if(o.mode===E.TRIANGLES||o.mode===E.TRIANGLE_STRIP||o.mode===E.TRIANGLE_FAN||void 0===o.mode)i=!0===f.isSkinnedMesh?new fm.SkinnedMesh(a,s):new fm.Mesh(a,s),!0!==i.isSkinnedMesh||i.geometry.attributes.skinWeight.normalized||i.normalizeSkinWeights(),o.mode===E.TRIANGLE_STRIP?i.drawMode=fm.TriangleStripDrawMode:o.mode===E.TRIANGLE_FAN&&(i.drawMode=fm.TriangleFanDrawMode);else if(o.mode===E.LINES)i=new fm.LineSegments(a,s);else if(o.mode===E.LINE_STRIP)i=new fm.Line(a,s);else if(o.mode===E.LINE_LOOP)i=new fm.LineLoop(a,s);else{if(o.mode!==E.POINTS)throw new Error("fm.GLTFLoader: Primitive mode unsupported: "+o.mode);i=new fm.Points(a,s)}0<(0,p.default)(i.geometry.morphAttributes).length&&z(i,f),i.name=f.name||"mesh_"+c,1<e.length&&(i.name+="_"+n),U(i,f),h.assignFinalMaterial(i),t.push(i)}if(1===t.length)return t[0];var l=new fm.Group;for(n=0,r=t.length;n<r;n++)l.add(t[n]);return l})})},j.prototype.loadCamera=function(e){var t,n=this.json.cameras[e],r=n[n.type];if(r)return"perspective"===n.type?t=new fm.PerspectiveCamera(fm.Math.radToDeg(r.yfov),r.aspectRatio||1,r.znear||1,r.zfar||2e6):"orthographic"===n.type&&(t=new fm.OrthographicCamera(r.xmag/-2,r.xmag/2,r.ymag/2,r.ymag/-2,r.znear,r.zfar)),void 0!==n.name&&(t.name=n.name),U(t,n),g.default.resolve(t);console.warn("fm.GLTFLoader: Missing camera parameters.")},j.prototype.loadSkin=function(e){var t=this.json.skins[e],n={joints:t.joints};return void 0===t.inverseBindMatrices?g.default.resolve(n):this.getDependency("accessor",t.inverseBindMatrices).then(function(e){return n.inverseBindMatrices=e,n})},j.prototype.loadAnimation=function(E){for(var e=this.json,T=e.animations[E],t=[],n=[],r=[],i=[],a=[],o=0,s=T.channels.length;o<s;o++){var l=T.channels[o],u=T.samplers[l.sampler],c=l.target,h=void 0!==c.node?c.node:c.id,f=void 0!==T.parameters?T.parameters[u.input]:u.input,d=void 0!==T.parameters?T.parameters[u.output]:u.output;t.push(this.getDependency("node",h)),n.push(this.getDependency("accessor",f)),r.push(this.getDependency("accessor",d)),i.push(u),a.push(c)}return g.default.all([g.default.all(t),g.default.all(n),g.default.all(r),g.default.all(i),g.default.all(a)]).then(function(e){for(var t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=[],s=0,l=t.length;s<l;s++){var u=t[s],c=n[s],h=r[s],f=i[s],d=a[s];if(void 0!==u){var p;switch(u.updateMatrix(),u.matrixAutoUpdate=!0,k[d.path]){case k.weights:p=fm.NumberKeyframeTrack;break;case k.rotation:p=fm.QuaternionKeyframeTrack;break;case k.position:case k.scale:default:p=fm.VectorKeyframeTrack}var m=u.name?u.name:u.uuid,v=void 0!==f.interpolation?P[f.interpolation]:fm.InterpolateLinear,g=[];k[d.path]===k.weights?u.traverse(function(e){!0===e.isMesh&&e.morphTargetInfluences&&g.push(e.name?e.name:e.uuid)}):g.push(m);var y=h.array;if(h.normalized){var _;if(y.constructor===Int8Array)_=1/127;else if(y.constructor===Uint8Array)_=1/255;else if(y.constructor==Int16Array)_=1/32767;else{if(y.constructor!==Uint16Array)throw new Error("fm.GLTFLoader: Unsupported output accessor component type.");_=1/65535}for(var x=new Float32Array(y.length),w=0,b=y.length;w<b;w++)x[w]=y[w]*_;y=x}for(w=0,b=g.length;w<b;w++){var M=new p(g[w]+"."+k[d.path],c.array,y,v);"CUBICSPLINE"===f.interpolation&&(M.createInterpolant=function(e){return new A(this.times,this.values,this.getValueSize()/3,e)},M.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0),o.push(M)}}}var S=void 0!==T.name?T.name:"animation_"+E;return new fm.AnimationClip(S,void 0,o)})},j.prototype.loadNode=function(e){var t,n=this.json,a=this.extensions,r=this,o=n.meshReferences,s=n.meshUses,l=n.nodes[e];return t=[],void 0!==l.mesh&&t.push(r.getDependency("mesh",l.mesh).then(function(e){var t;if(1<o[l.mesh]){var n=s[l.mesh]++;t=e.clone(),t.name+="_instance_"+n,t.onBeforeRender=e.onBeforeRender;for(var r=0,i=t.children.length;r<i;r++)t.children[r].name+="_instance_"+n,t.children[r].onBeforeRender=e.children[r].onBeforeRender}else t=e;return void 0!==l.weights&&t.traverse(function(e){if(e.isMesh)for(var t=0,n=l.weights.length;t<n;t++)e.morphTargetInfluences[t]=l.weights[t]}),t})),void 0!==l.camera&&t.push(r.getDependency("camera",l.camera)),l.extensions&&l.extensions[v.KHR_LIGHTS_PUNCTUAL]&&void 0!==l.extensions[v.KHR_LIGHTS_PUNCTUAL].light&&t.push(r.getDependency("light",l.extensions[v.KHR_LIGHTS_PUNCTUAL].light)),g.default.all(t).then(function(e){var t;if(t=!0===l.isBone?new fm.Bone:1<e.length?new fm.Group:1===e.length?e[0]:new fm.Object3D,t!==e[0])for(var n=0,r=e.length;n<r;n++)t.add(e[n]);if(void 0!==l.name&&(t.userData.name=l.name,t.name=fm.PropertyBinding.sanitizeNodeName(l.name)),U(t,l),l.extensions&&B(a,t,l),void 0!==l.matrix){var i=new fm.Matrix4;i.fromArray(l.matrix),t.applyMatrix(i)}else void 0!==l.translation&&t.position.fromArray(l.translation),void 0!==l.rotation&&t.quaternion.fromArray(l.rotation),void 0!==l.scale&&t.scale.fromArray(l.scale);return t})},j.prototype.loadScene=function(e){var t=this.json,n=this.extensions,r=this.json.scenes[e],i=this,a=new fm.Scene;void 0!==r.name&&(a.name=r.name),U(a,r),r.extensions&&B(n,a,r);for(var o=r.nodes||[],s=[],l=0,u=o.length;l<u;l++)s.push(q(o[l],a,t,i));return g.default.all(s).then(function(){return a})};var X=l;t.default=X},function(e,t,n){var i=n(29),a=n(52),o=n(24)("species");e.exports=function(e,t){var n,r=i(e).constructor;return void 0===r||null==(n=i(r)[o])?t:a(n)}},function(e,t,n){var r,i,a,o=n(40),s=n(192),l=n(164),u=n(112),c=n(19),h=c.process,f=c.setImmediate,d=c.clearImmediate,p=c.MessageChannel,m=c.Dispatch,v=0,g={},y="onreadystatechange",_=function(){var e=+this;if(g.hasOwnProperty(e)){var t=g[e];delete g[e],t()}},x=function(e){_.call(e.data)};f&&d||(f=function(e){for(var t=[],n=1;n<arguments.length;)t.push(arguments[n++]);return g[++v]=function(){s("function"==typeof e?e:Function(e),t)},r(v),v},d=function(e){delete g[e]},"process"==n(82)(h)?r=function(e){h.nextTick(o(_,e,1))}:m&&m.now?r=function(e){m.now(o(_,e,1))}:p?(i=new p,a=i.port2,i.port1.onmessage=x,r=o(a.postMessage,a,1)):c.addEventListener&&"function"==typeof postMessage&&!c.importScripts?(r=function(e){c.postMessage(e+"","*")},c.addEventListener("message",x,!1)):r=y in u("script")?function(e){l.appendChild(u("script"))[y]=function(){l.removeChild(this),_.call(e)}}:function(e){setTimeout(o(_,e,1),0)}),e.exports={set:f,clear:d}},function(e){e.exports=function(e){try{return{e:!1,v:e()}}catch(e){return{e:!0,v:e}}}},function(e,t,n){var i=n(29),a=n(22),o=n(150);e.exports=function(e,t){if(i(e),a(t)&&t.constructor===e)return t;var n=o.f(e),r=n.resolve;return r(t),n.promise}},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0,n(5),n(4);var a=r(n(6)),o=r(n(396)),l=r(n(32));n(10);var s,u,c=r(n(2)),h=r(n(3)),f=r(n(7)),d=r(n(8)),p=r(n(9)),m=r(n(12)),v=r(n(33)),g=r(n(34)),y=r(n(73)),_=r(n(57)),x=r(n(72));function w(r){return function(){var e,t=(0,d.default)(r);if(b()){var n=(0,d.default)(this).constructor;e=(0,a.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,f.default)(this,e)}}function b(){if("undefined"==typeof Reflect||!a.default)return!1;if(a.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,a.default)(Date,[],function(){})),!0}catch(e){return!1}}var M=function(e){(0,p.default)(i,e);var r=w(i);function i(e,t){var n;return(0,c.default)(this,i),n=r.call(this,t.eid,v.default.MODEL),n._parseData=null,n._isInitMesh=!0,n._visible=!0,n._renderNode=null,n._data=null,n._geometry,n._shape,n.currHeight=2,n._line=null,n._modelColor=null,n._modeAlpha=1,n._lineColor=null,n._lineAlpha=1,n._selected=!1,n._sgstat=!1,n._card={top:null,left:null,right:null,front:null,back:null},n.precolor={useModel:!1,useStroke:!1,mcolor:null,strokeColor:null,malpha:1,strokeAlpha:1},n.FID=t.fid,n.ID=t.eid,n.ename=t.ename,n.name=t.name,n.typeID=t.type,n.minlevel=t.minlevel,n.maxlevel=t.maxlevel,n.bdata=t,n.gdata=e,n.preSelect=!1,n}return(0,h.default)(i,[{key:"initMesh",value:function(e,t){this._geometry&&(this._renderNode=new fm.Mesh(this._geometry.geometry,e),this._renderNode.mapNode=this,this._modelColor=e.color,this._modelAlpha=e.opacity,this._renderNode.scale.set(1,-1,1),this._renderNode.rotation.set(Math.PI/2,0,0,"XYZ"),this._renderNode.position.copy(t),this._renderNode.frustumCulled=!1,this._renderNode.parent=this.parent.scene,this._renderNode.castShadow=!0,this.renderNodeInited=!0,this.precolor.useModel&&(this.precolor.mcolor&&(e.color=this.precolor.mcolor),"number"==typeof this.precolor.malpha&&(e.opacity=this.precolor.malpha)),this.preSelect&&(this.selected=!0,this.preSelect=!1))}},{key:"releaseGpuMemory",value:function(){this.renderNode&&(this._geometry=null,this._data=null,this.renderNodeInited=!1,this.renderNode.parent.remove(this.renderNode),this.dispose())}},{key:"restoreGpuMemeory",value:function(){}},{key:"getBbox",value:function(){}},{key:"getRadius1",value:function(){return this._renderNode.geometry.boundingSphere.radius}},{key:"getRadius",value:function(){for(var e=null,t={x:this._renderNode._x-this.parent.parent.parent.mapcenter.x,y:this._renderNode._y-this.parent.parent.parent.mapcenter.y},n=[],r=this._renderNode.geometry.vertices,i=0;i<r.length;i++){var a={};if(a.vertex=r[i],a.distance=Math.abs(Math.sqrt(Math.pow(r[i].x-t.x,2)+Math.pow(r[i].y-t.y,2))),n.length<2)n.push(a);else if(2===n.length){if(n[0].distance>n[1].distance){var o=null;o=n.shift(),n.push(o)}}else if(a.distance<n[1].distance)if(a.distance<n[0].distance){var s=null;n.pop(),s=n.shift(),n.push(a),n.push(s)}else n.pop(),n.push(a)}var l={x:(n[0].vertex.x+n[1].vertex.x)/2,y:(n[0].vertex.y+n[1].vertex.y)/2},u=Math.abs(Math.sqrt(Math.pow(l.x-t.x,2)+Math.pow(l.y-t.y,2)));return e=n[0].distance<u?n[0].distance:u,e}},{key:"setByTheme",value:function(e){if(this._renderNode){var t=this.findParent(g.default),n=t.materialManager.createNormalMaterial(e),r=t.materialManager.createLineMaterial(e);this._lineColor=r.color,this._lineAlpha=r.opacity,this._modelColor=n.color,this._modeAlpha=n.opacity,this._renderNode.material=n,this._line&&(this._line.material=r)}}},{key:"initLine",value:function(e,t){if(this._geometry){var n=(new fm.Geometry).setFromPoints(this._geometry.shape.getPoints());n&&0<n.vertices.length&&n.vertices.push(n.vertices[0]);for(var r=[],i=n.vertices.length,a=0;a<i;a++)0==a||a==i-1?r.push(n.vertices[a]):r.push(n.vertices[a],n.vertices[a]);n.vertices=r;var o=new fm.LineSegments(n,e);this._lineColor=e.color,this._lineAlpha=e.opacity,o.castShadow=!1,o.position.setZ(.005*-t),o.geometry.computeBoundingSphere(),this.precolor.useStroke&&(e.color=this.precolor.strokeColor,e.opacity=this.precolor.strokeAlpha),this._line=o,this._line.frustumCulled=!1,this._line.matrixAutoUpdate=!1,this._renderNode.add(o),this._shape=this._geometry.shape,this._geometry=null}}},{key:"setHeight",value:function(e){this.currHeight&&(this._renderNode.scale.z*=e/this.currHeight,this._renderNode.position.y+=e-this.currHeight),this.currHeight=e}},{key:"checkByFrustum",value:function(e){var t=!0;this._renderNode&&(this._renderNode.updateMatrixWorld(!0),t=e.intersectsObject(this._renderNode)),this.visible=t}},{key:"setColor",value:function(e,t){if(!this._renderNode)return this.precolor.mcolor=e?new fm.Color(e):e,this.precolor.malpha=t,void(this.precolor.useModel=!0);e&&(this._renderNode.material.color=new fm.Color(e)),"number"==typeof t&&(this._renderNode.material.opacity=t,t!==this._renderNode.material.userData.opacity&&(this._renderNode.material.userData.opacity=t))}},{key:"setStrokeColor",value:function(e,t){if(!this._renderNode)return this.precolor.strokeColor=new fm.Color(e),this.precolor.strokeAlpha=t,void(this.precolor.useStroke=!0);this._line.material.color=new fm.Color(e),this._line.material.opacity=t}},{key:"setColorToDefault",value:function(){this._renderNode&&(this._renderNode.material.color=this._modelColor,this._renderNode.material.opacity=this._modeAlpha)}},{key:"setStrokeColorToDefault",value:function(){this._line.material.color=this._lineColor,this._line.material.opacity=this._lineAlpha}},{key:"addStoreImage",value:function(e){var t=this.findParent(g.default),n=this.parent.parent.parent,r=n.mapcenter,i=e.mapCoord?e.mapCoord:this.mapCoord;if(this._renderNode&&e.image){e=(0,l.default)({size:[5,5],height:.1,angle:0,offset:[0,0]},e),this._card.top&&this.removeStoreImage();var a=new fm.PlaneBufferGeometry(1,1,1,1),o=new fm.MeshLambertMaterial({transparent:!0,depthWrite:!1});t.materialManager.loadTexture(e.image,function(e){e.anisotropy=4,e.minFilter=fm.LinearFilter,o.map=e,o.needsUpdate=!0});var s=new fm.Mesh(a,o);s.scale.set(e.size[0],e.size[1],-1),s.position.set(e.offset[0]+i.x-r.x,e.offset[1]+i.y-r.y,-e.height),s.rotation.z=-e.angle*fm.Math.DEG2RAD,s.renderOrder=10,this._renderNode.add(s),this._card.top=s}}},{key:"getUvTransForm",value:function(){var e=this.parent.parent.parent,t=(e.center,e.bbox);t.max.x,t.min.x,t.max.y,t.min.y,this.renderNode}},{key:"removeStoreImage",value:function(){this._card.top&&(this._renderNode.remove(this._card.top),this._card.top.geometry.dispose(),this._card.top.material.map&&this._card.top.material.map.dispose(),this._card.top.material.dispose(),this._card.top=null)}},{key:"dispose",value:function(){this._renderNode&&(this._line&&(this._renderNode.remove(this._line),this._line.material.dispose(),this._line.geometry.dispose(),this._line=void 0),this.removeStoreImage(),this._renderNode.material.dispose(),this._renderNode.geometry.dispose(),this._renderNode.material=void 0,this._renderNode.geometry=void 0,this._geometry=void 0,this._data=void 0,this._renderNode.mapNode=void 0,this._renderNode=void 0)}},{key:"flash",value:function(){var t=this;if(this._renderNode){this._renderNode.material.userData.color=this._renderNode.material.color;var e=this.findParent(g.default),n=e.map,r=n.modelSelectColor,i={r:r.r/2,g:r.g/2,b:r.b/2,a:r.a/2};s=function(){var e=(Math.sin((new Date).getTime()/180)+1)/2;t._renderNode.material.color=new fm.Color(i.r*(1+e),i.g*(1+e),i.b*(1+e))},n.on("frameLoop",s)}}},{key:"stopFlash",value:function(){this._renderNode&&(map.off("frameLoop",s),this._renderNode.material.color=this._renderNode.material.userData.color)}},{key:"gradientColor",value:function(){var t=this;if(this._renderNode){this._renderNode.material.userData.color=this._renderNode.material.color;var e=this.findParent(g.default),n=e.map,r=n.modelSelectColor;u=new y.default({r:r.r/2,g:r.g/2,b:r.b/2,a:r.a/2},r,500,function(){n.removeAnimater(u),u=void 0},function(e){t._renderNode.material.color=new fm.Color(e.r,e.g,e.b),t._renderNode.material.alpha=e.a,t._renderNode.material.update=!0}).start(),n.addAnimater(u)}}},{key:"clearGradient",value:function(){if(this._renderNode){var e=this.findParent(g.default),t=e.map;u&&t.removeAnimater(u),this._renderNode.material.color=this._renderNode.material.userData.color,this._renderNode.material.userData.color=void 0}}},{key:"distanceToPoint",value:function(e){var t=this._shape.getPoints(),n=x.default.isInPolygon(e,t);if(n)return 0;for(var r=o.default,i=0;i<t.length-1;i++){var a=x.default.pointDistanceToLine(e,t[i],t[i+1],new fm.Vector2);a<r&&(r=a)}return r}},{key:"selected",set:function(e){if(e!==this._selected){if(this._selected=e,!this.renderNodeInited)return void(this.preSelect=!0);e?this.gradientColor():this.clearGradient()}},get:function(){return this._selected}},{key:"visible",set:function(e){e?this.parent.scene.children.indexOf(this._renderNode)<0&&this._renderNode&&this.parent.scene.add(this._renderNode):this._renderNode&&(this.parent.scene.remove(this._renderNode),this._renderNode.parent=this.parent.scene),this._visible=e},get:function(){return this._visible}},{key:"renderNode",get:function(){return this._renderNode},set:function(e){this._renderNode=e}},{key:"mapCoord",get:function(){var e=this.parent.parent.parent.parent.map.dataManager.file_ver,t=this.parent.parent.layers.label[0].labels[""+this._eid];if(t){if(t.renderNodeInited)return{x:t.x,y:t.y,z:this.height};var n=null;return n=1===e?_.default.convertGeo2Points(t.gdata.geo):_.default.convertArrayPoints(t.gdata.idxs,t.gdata.pts),{x:n.vertices[0].x,y:n.vertices[0].y,z:this.height}}return{x:null,y:null,z:null}}},{key:"label",get:function(){return this.parent.parent.layers.label[0].labels[""+this._eid]}},{key:"height",set:function(e){this._height=e},get:function(){return this.renderNodeInited?this._height:this.gdata.height}},{key:"line",get:function(){return this._line}}]),i}(m.default),S=M;t.default=S},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0,n(5),n(4);var a=r(n(6)),o=r(n(2)),s=r(n(3)),l=r(n(7)),u=r(n(8)),c=r(n(9)),h=r(n(12)),f=r(n(217));function d(r){return function(){var e,t=(0,u.default)(r);if(p()){var n=(0,u.default)(this).constructor;e=(0,a.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,l.default)(this,e)}}function p(){if("undefined"==typeof Reflect||!a.default)return!1;if(a.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,a.default)(Date,[],function(){})),!0}catch(e){return!1}}var m=function(e){(0,c.default)(i,e);var r=d(i);function i(e,t){var n;return(0,o.default)(this,i),n=r.call(this),n._scene=new fm.Scene,n._scene.userData.type="label",n.alias="label",n._labels={},n.initNode(e,t),n.needAvoid=!0,n._visible=!0,n}return(0,s.default)(i,[{key:"traverse",value:function(e){for(var t in this._labels)e&&e(this._labels[t])}},{key:"getVideoMemoryAmount",value:function(){var n=null;return this.traverse(function(e){if(e._renderNode&&(n+=e._renderNode.geometry.attributes.position.array.byteLength,n+=e._renderNode.geometry.attributes.uv.array.byteLength,e._renderNode.material.map)){var t=null;t=e._renderNode.material.map.image.width*e._renderNode.material.map.image.height*32/8,n+=t}}),n}},{key:"initNode",value:function(e,t){for(var n=0;n<e.length;n++)this.createNode(e[n],t[n])}},{key:"createNode",value:function(e,t){var n=new f.default(e,t);n.parent=this,this._labels[""+n.eid]=n}},{key:"addNodes",value:function(e){e.parent=this,e.renderNode&&this._scene.add(e.renderNode),this._labels[""+e.eid]=e}},{key:"getNodeById",value:function(e){return this._labels[""+e]}},{key:"checkSceneNode",value:function(){for(var e in this._scene.children.length=0,this._labels)this._labels[e].visible&&this._labels[e].renderNode&&this._scene.add(this._labels[e].renderNode)}},{key:"dispose",value:function(){for(var e in this._labels)this._labels[e].dispose(),this._scene.remove(this._labels[e].renderNode),this._labels[e].parent=void 0,this._labels[e]=void 0;this._scene=void 0}},{key:"scene",get:function(){return this._scene}},{key:"visible",get:function(){return this._visible},set:function(e){this._visible=e,this.parent&&this.parent.parent&&this.parent.parent.parent&&this.parent.parent.parent.map.rushRenderNode()}},{key:"show",get:function(){return this.visible},set:function(e){this.visible=e}},{key:"labels",get:function(){return this._labels}}]),i}(h.default),v=m;t.default=v},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0,n(5),n(4);var a=r(n(6));n(71),n(10);var o=r(n(2)),s=r(n(3)),l=r(n(7)),u=r(n(8)),c=r(n(9)),h=r(n(12)),f=r(n(33)),d=r(n(34)),p=r(n(111)),m=r(n(86)),v=r(n(57));function g(r){return function(){var e,t=(0,u.default)(r);if(y()){var n=(0,u.default)(this).constructor;e=(0,a.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,l.default)(this,e)}}function y(){if("undefined"==typeof Reflect||!a.default)return!1;if(a.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,a.default)(Date,[],function(){})),!0}catch(e){return!1}}var _=function(e){(0,c.default)(i,e);var r=g(i);function i(e,t){var n;return(0,o.default)(this,i),n=r.call(this,t.eid,f.default.LABEL),n._isInitSprite=!0,n._visible=!0,n._renderNode=null,n._geometry=void 0,n._size=20,n._theme=void 0,n.bdata=t,n.ename=t.ename,n._text=t.name,n.gdata=e,n.FID=t.fid,n.ID=t.eid,n.name=t.name,n.typeID=t.type,n.minlevel=t.minlevel,n.maxlevel=t.maxlevel,n}return(0,s.default)(i,[{key:"checkByFrustum",value:function(e){var t=!0;this._renderNode&&(this._renderNode.updateMatrixWorld(!0),t=e.intersectsSprite(this._renderNode)),this.visible=t}},{key:"initSprite",value:function(e,t){e&&(this._renderNode=new p.default(e),this._renderNode.position.copy(t),this._renderNode.mapNode=this,this._renderNode.frustumCulled=!0,this.renderNodeInited=!0,this._renderNode.parent=this.parent.scene,this._renderNode.visible=this.show)}},{key:"setText",value:function(e){if(this._renderNode&&this._theme){var t=this.findParent(d.default);this._renderNode.material=t.materialManager.createLabelMaterial(e,this._theme),this._text=e,this.setSize()}}},{key:"releaseGpuMemory",value:function(){this.renderNode&&(this.renderNodeInited=!1,this._isInitSprite=!1,this.tryInit=!1,this.renderNode.parent.remove(this.renderNode),this.dispose())}},{key:"setByLanguage",value:function(e){var t;if(t=e===m.default.EN?this.bdata.ename:this.bdata.name,!t)return this.visible=!1,void this.dispose();if(this._renderNode)this.setText(t);else if(this.tryInit){var n=this.findParent(d.default),r=this.parent.parent.parent.theme.getLabelTheme(this.bdata.type);this._theme=r;var i=n.materialManager.createLabelMaterial(t,r);this.initSprite(i,this.pos),this.setSize()}this.visible=!0}},{key:"setByTheme",value:function(e){var t=this.findParent(d.default);this._theme=e,this._size=1.4*e.fontsize,this._renderNode&&(this._renderNode.material=t.materialManager.createLabelMaterial(this._text,this._theme)),this.setSize()}},{key:"setSize",value:function(){var e=this.findParent(d.default);e.map.renderer.setLabelSize(this._renderNode,this._size)}},{key:"dispose",value:function(){this._renderNode&&(this._renderNode.material.dispose(),this._renderNode.geometry.dispose(),this._renderNode.material=void 0,this._renderNode.geometry=void 0,this.geometry=void 0,this._renderNode.mapNode=void 0,this._renderNode=void 0)}},{key:"mapCoord",get:function(){var e=this.parent.parent.parent.parent.map.dataManager.file_ver,t=this;if(t){if(t.renderNodeInited)return{x:t.x,y:t.y,z:this.height};var n=null;return n=1===e?v.default.convertGeo2Points(t.gdata.geo):v.default.convertArrayPoints(t.gdata.idxs,t.gdata.pts),{x:n.vertices[0].x,y:n.vertices[0].y,z:this.height}}return{x:null,y:null,z:null}}},{key:"model",get:function(){return this.parent.parent.layers.model[0].models[""+this._eid]}},{key:"visible",set:function(e){this._renderNode&&(e?this.parent.scene.children.indexOf(this._renderNode)<0&&this._renderNode&&this.parent.scene.add(this._renderNode):(this.parent.scene.remove(this._renderNode),this._renderNode.parent=this.parent.scene)),this._visible=e},get:function(){return this._visible}},{key:"renderNode",get:function(){return this._renderNode},set:function(e){this._renderNode=e}},{key:"size",get:function(){return this._size},set:function(e){this._size=e}},{key:"theme",set:function(e){this._theme=e}}]),i}(h.default),x=_;t.default=x},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0,n(5),n(4);var a=r(n(6)),o=r(n(2)),s=r(n(3)),l=r(n(7)),u=r(n(8)),c=r(n(9)),h=r(n(12)),f=r(n(219));function d(r){return function(){var e,t=(0,u.default)(r);if(p()){var n=(0,u.default)(this).constructor;e=(0,a.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,l.default)(this,e)}}function p(){if("undefined"==typeof Reflect||!a.default)return!1;if(a.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,a.default)(Date,[],function(){})),!0}catch(e){return!1}}var m=function(e){(0,c.default)(i,e);var r=d(i);function i(e,t){var n;return(0,o.default)(this,i),n=r.call(this),n._scene=new fm.Scene,n._scene.userData.type="facility",n.alias="facility",n._facility={},n.needAvoid=!0,n.initNode(e,t),n._visible=!0,n}return(0,s.default)(i,[{key:"initNode",value:function(e,t){if(e)for(var n=0;n<e.length;n++)this.createNode(e[n],t[n])}},{key:"createNode",value:function(e,t){var n=new f.default(e,t);n.parent=this,this._facility[""+n.eid]=n}},{key:"addNodes",value:function(e){e.parent=this,e.renderNode&&this._scene.add(e.renderNode),this._facility[""+e.eid]=e}},{key:"traverse",value:function(e){for(var t in this._facility)e&&e(this._facility[t])}},{key:"getNodeById",value:function(e){return this._facility[""+e]}},{key:"getVideoMemoryAmount",value:function(){var n=null;return this.traverse(function(e){if(e._renderNode&&(n+=e._renderNode.geometry.attributes.position.array.byteLength,n+=e._renderNode.geometry.attributes.uv.array.byteLength,e._renderNode.material.map)){var t=null;t=e._renderNode.material.map.image.width*e._renderNode.material.map.image.height*32/8,n+=t}}),n}},{key:"checkSceneNode",value:function(){for(var e in this._scene.children.length=0,this._facility)this._facility[e].visible&&this._facility[e].renderNode&&this._scene.add(this._facility[e].renderNode)}},{key:"dispose",value:function(){for(var e in this._facility)this._facility[e].dispose(),this._scene.remove(this._facility[e].renderNode),this._facility[e].parent=void 0,this._facility[e]=void 0;this._scene=void 0}},{key:"scene",get:function(){return this._scene}},{key:"visible",get:function(){return this._visible},set:function(e){this._visible=e,this.parent&&this.parent.parent&&this.parent.parent.parent&&this.parent.parent.parent.map.setRenderList()}},{key:"show",get:function(){return this.visible},set:function(e){this.visible=e}}]),i}(h.default),v=m;t.default=v},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0,n(5),n(4);var a=r(n(6));n(10);var o=r(n(2)),s=r(n(3)),l=r(n(7)),u=r(n(8)),c=r(n(9)),h=r(n(12)),f=r(n(33)),d=r(n(34)),p=r(n(111)),m=r(n(57));function v(r){return function(){var e,t=(0,u.default)(r);if(g()){var n=(0,u.default)(this).constructor;e=(0,a.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,l.default)(this,e)}}function g(){if("undefined"==typeof Reflect||!a.default)return!1;if(a.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,a.default)(Date,[],function(){})),!0}catch(e){return!1}}var y=function(e){(0,c.default)(i,e);var r=v(i);function i(e,t){var n;return(0,o.default)(this,i),n=r.call(this,t.eid,f.default.FACILITY),n._isInitSprite=!0,n._visible=!0,n._renderNode=null,n._geometry=void 0,n._size=20,n.bdata=t,n.gdata=e,n.FID=t.fid,n.ID=t.eid,n.ename=t.ename,n.name=t.name,n.typeID=t.type,n.minlevel=t.minlevel,n.maxlevel=t.maxlevel,n}return(0,s.default)(i,[{key:"checkByFrustum",value:function(e){var t=!0;this._renderNode&&(this._renderNode.updateMatrixWorld(!0),t=e.intersectsObject(this._renderNode)),this.visible=t}},{key:"initSprite",value:function(e,t){this._renderNode=new p.default(e),this._renderNode.mapNode=this,this._renderNode.frustumCulled=!1,this._renderNode.position.copy(t),this._renderNode.parent=this.parent.scene,this.renderNodeInited=!0,this._renderNode.visible=this.show}},{key:"releaseGpuMemory",value:function(){this.renderNode&&(this.renderNodeInited=!1,this.renderNode.parent.remove(this.renderNode),this.dispose())}},{key:"setByTheme",value:function(e){if(this._renderNode){var t=this.findParent(d.default),n=t.materialManager.createPoiMaterial(e);this._renderNode.material=n}}},{key:"setSize",value:function(){var e=this.findParent(d.default);e.map.renderer.setFacilitySize(this._renderNode,this._size)}},{key:"dispose",value:function(){this._renderNode&&(this._renderNode.material.dispose(),this._renderNode.geometry.dispose(),this._renderNode.material=void 0,this._renderNode.geometry=void 0,this.geometry=void 0,this._renderNode.mapNode=void 0,this._renderNode=void 0)}},{key:"visible",set:function(e){e?this.parent.scene.children.indexOf(this._renderNode)<0&&(this._renderNode&&this.parent.scene.add(this._renderNode),this.setSize()):(this._renderNode&&this.parent.scene.remove(this._renderNode),this._renderNode&&(this._renderNode.parent=this.parent.scene)),this._visible=e,this._visible=e},get:function(){return this._visible}},{key:"renderNode",get:function(){return this._renderNode},set:function(e){this._renderNode=e}},{key:"size",get:function(){return this._size},set:function(e){this._size=e}},{key:"mapCoord",get:function(){var e=this.parent.parent.parent.parent.map.dataManager.file_ver,t=this;if(t){if(t.renderNodeInited)return{x:t.x,y:t.y,z:this.height};var n=null;return n=1===e?m.default.convertGeo2Points(t.gdata.geo):m.default.convertArrayPoints(t.gdata.idxs,t.gdata.pts),{x:n.vertices[0].x,y:n.vertices[0].y,z:this.height}}return{x:null,y:null,z:null}}}]),i}(h.default),_=y,x=_;t.default=x},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var s=r(n(18)),l=r(n(13)),u=r(n(17)),c=r(n(16)),a=r(n(15));n(10),n(5),n(4);var o=r(n(6)),h=r(n(47)),f=r(n(2)),d=r(n(3)),p=r(n(7)),m=r(n(8)),v=r(n(9)),g=r(n(12));function y(e){if(void 0===c.default||null==e[u.default]){if((0,l.default)(e)||(e=_(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i,a=!0,o=!1;return{s:function(){r=(0,s.default)(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){o=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(o)throw i}}}}function _(e,t){if(e){if("string"==typeof e)return x(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?(0,a.default)(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?x(e,t):void 0}}function x(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function w(r){return function(){var e,t=(0,m.default)(r);if(b()){var n=(0,m.default)(this).constructor;e=(0,o.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,p.default)(this,e)}}function b(){if("undefined"==typeof Reflect||!o.default)return!1;if(o.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,o.default)(Date,[],function(){})),!0}catch(e){return!1}}var M=function(e){(0,v.default)(n,e);var t=w(n);function n(){var e;return(0,f.default)(this,n),e=t.call(this),e._scene=new fm.Scene,e._scene.userData.type="imageMarker",e.alias="imageMarker",e.imageMarkers=[],e._visible=!0,e.needAvoid=!0,e.prepareInitObjects=[],e}return(0,d.default)(n,[{key:"addMarker",value:function(e){e.parent=this,e.isInitSprite||e.initSprite()?this.pushImageMarker(e):this.prepareInitObjects.push(e)}},{key:"initPrepare",value:function(){var e,t=y(this.prepareInitObjects);try{for(t.s();!(e=t.n()).done;){var n=e.value;if(n.initSprite()){var r=this.prepareInitObjects.indexOf(n);-1<r&&this.prepareInitObjects.splice(r,1),this.pushImageMarker(n)}}}catch(e){t.e(e)}finally{t.f()}}},{key:"pushImageMarker",value:function(e){this.imageMarkers.push(e),e.renderNode&&this._scene.add(e.renderNode)}},{key:"removeAll",value:function(){var e,t=y(this.imageMarkers);try{for(t.s();!(e=t.n()).done;){var n=e.value;this.removeNode(n,!0)}}catch(e){t.e(e)}finally{t.f()}this.imageMarkers.length=0}},{key:"untiedMarker",value:function(e){e.parent=void 0,this._scene.remove(e.renderNode)}},{key:"removeNode",value:function(e,t){if(e.parent=void 0,this._scene.remove(e.renderNode),e.isAlwaysShow&&(this.parent.removeAlwaysShowMarker(e.renderNode),e.show=!1),e.dispose(),!t){var n=this.imageMarkers.indexOf(e);-1<n&&this.imageMarkers.splice(n,1)}}},{key:"removeMarker",value:function(e){this.removeNode(e)}},{key:"checkSceneNode",value:function(){this._scene.children.length=0;var e,t=y(this.imageMarkers);try{for(t.s();!(e=t.n()).done;){var n=e.value;n.visible&&n.renderNode&&this._scene.add(n.renderNode)}}catch(e){t.e(e)}finally{t.f()}}},{key:"traverse",value:function(e){var t,n=y(this.imageMarkers);try{for(n.s();!(t=n.n()).done;){var r=t.value;e&&e(r)}}catch(e){n.e(e)}finally{n.f()}}},{key:"dispose",value:function(){var e,t=y(this.imageMarkers);try{for(t.s();!(e=t.n()).done;){var n=e.value;n.dispose(),this._scene.remove(n.renderNode),n.parent=void 0}}catch(e){t.e(e)}finally{t.f()}this.imageMarkers.length=0,this._scene=void 0}},{key:"scene",get:function(){return this._scene}},{key:"visible",get:function(){return this._visible},set:function(e){this._visible=e,this.parent&&this.parent.parent&&this.parent.parent.parent&&this.parent.parent.parent.map.setRenderList()}},{key:"show",get:function(){return this.visible},set:function(e){this.visible=e}},{key:"markers",get:function(){var e=[];return e.push.apply(e,(0,h.default)(this.imageMarkers)),e}}]),n}(g.default),S=M;t.default=S},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var s=r(n(18)),l=r(n(13)),u=r(n(17)),c=r(n(16)),a=r(n(15));n(10),n(5),n(4);var o=r(n(6)),h=r(n(2)),f=r(n(3)),d=r(n(7)),p=r(n(8)),m=r(n(9)),v=r(n(12));function g(e){if(void 0===c.default||null==e[u.default]){if((0,l.default)(e)||(e=y(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i,a=!0,o=!1;return{s:function(){r=(0,s.default)(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){o=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(o)throw i}}}}function y(e,t){if(e){if("string"==typeof e)return _(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?(0,a.default)(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_(e,t):void 0}}function _(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function x(r){return function(){var e,t=(0,p.default)(r);if(w()){var n=(0,p.default)(this).constructor;e=(0,o.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,d.default)(this,e)}}function w(){if("undefined"==typeof Reflect||!o.default)return!1;if(o.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,o.default)(Date,[],function(){})),!0}catch(e){return!1}}var b=function(e){(0,m.default)(n,e);var t=x(n);function n(){var e;return(0,h.default)(this,n),e=t.call(this),e._scene=new fm.Scene,e._scene.userData.type="polygonMarker",e.alias="polygonMarker",e.polygonMarkers=[],e._visible=!0,e.prepareInitObjects=[],e}return(0,f.default)(n,[{key:"addMarker",value:function(e){e.parent=this,e.isInitPolygon||e.initPolygon()?this.pushPolygonMarker(e):this.prepareInitObjects.push(e)}},{key:"traverse",value:function(e){var t,n=g(this.polygonMarkers);try{for(n.s();!(t=n.n()).done;){var r=t.value;e&&e(r)}}catch(e){n.e(e)}finally{n.f()}}},{key:"initPrepare",value:function(){var e,t=g(this.prepareInitObjects);try{for(t.s();!(e=t.n()).done;){var n=e.value;if(n.initPolygon()){var r=this.prepareInitObjects.indexOf(n);-1<r&&this.prepareInitObjects.splice(r,1),this.pushPolygonMarker(n)}}}catch(e){t.e(e)}finally{t.f()}}},{key:"pushPolygonMarker",value:function(e){this.polygonMarkers.push(e),e.renderNode&&this._scene.add(e.renderNode)}},{key:"removeAll",value:function(){var e,t=g(this.polygonMarkers);try{for(t.s();!(e=t.n()).done;){var n=e.value;n.parent=void 0,this._scene.remove(n.renderNode),n.dispose()}}catch(e){t.e(e)}finally{t.f()}this.polygonMarkers.length=0}},{key:"removeNode",value:function(e){e.parent=void 0,this._scene.remove(e.renderNode),e.dispose();var t=this.polygonMarkers.indexOf(e);-1<t&&this.polygonMarkers.splice(t,1)}},{key:"removeMarker",value:function(e){this.removeNode(e)}},{key:"checkSceneNode",value:function(){this._scene.children.length=0;var e,t=g(this.polygonMarkers);try{for(t.s();!(e=t.n()).done;){var n=e.value;n.visible&&n.renderNode&&this._scene.add(n.renderNode)}}catch(e){t.e(e)}finally{t.f()}}},{key:"dispose",value:function(){var e,t=g(this.polygonMarkers);try{for(t.s();!(e=t.n()).done;){var n=e.value;n.dispose(),this._scene.remove(n.renderNode),n.parent=void 0}}catch(e){t.e(e)}finally{t.f()}this.polygonMarkers.length=0,this._scene=void 0}},{key:"markers",get:function(){return this.polygonMarkers}},{key:"scene",get:function(){return this._scene}},{key:"visible",get:function(){return this._visible},set:function(e){this._visible=e,this.parent&&this.parent.parent&&this.parent.parent.parent&&this.parent.parent.parent.map.setRenderList()}},{key:"show",get:function(){return this.visible},set:function(e){this.visible=e}}]),n}(v.default),M=b;t.default=M},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var s=r(n(18)),l=r(n(13)),u=r(n(17)),c=r(n(16)),a=r(n(15));n(10),n(5),n(4);var o=r(n(6)),h=r(n(2)),f=r(n(3)),d=r(n(7)),p=r(n(8)),m=r(n(9)),v=r(n(12));function g(e){if(void 0===c.default||null==e[u.default]){if((0,l.default)(e)||(e=y(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i,a=!0,o=!1;return{s:function(){r=(0,s.default)(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){o=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(o)throw i}}}}function y(e,t){if(e){if("string"==typeof e)return _(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?(0,a.default)(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_(e,t):void 0}}function _(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function x(r){return function(){var e,t=(0,p.default)(r);if(w()){var n=(0,p.default)(this).constructor;e=(0,o.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,d.default)(this,e)}}function w(){if("undefined"==typeof Reflect||!o.default)return!1;if(o.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,o.default)(Date,[],function(){})),!0}catch(e){return!1}}var b=function(e){(0,m.default)(n,e);var t=x(n);function n(){var e;return(0,h.default)(this,n),e=t.call(this),e._scene=new fm.Scene,e._scene.userData.type="textMarker",e.alias="textMarker",e.textMarkers=[],e._visible=!0,e.prepareInitObjects=[],e}return(0,f.default)(n,[{key:"addMarker",value:function(e){e.parent=this,e.isInitSprite||e.initSprite()?this.pushImageMarker(e):this.prepareInitObjects.push(e)}},{key:"traverse",value:function(e){var t,n=g(this.textMarkers);try{for(n.s();!(t=n.n()).done;){var r=t.value;e&&e(r)}}catch(e){n.e(e)}finally{n.f()}}},{key:"initPrepare",value:function(){var e,t=g(this.prepareInitObjects);try{for(t.s();!(e=t.n()).done;){var n=e.value;if(n.initSprite()){var r=this.prepareInitObjects.indexOf(n);-1<r&&this.prepareInitObjects.splice(r,1),this.pushImageMarker(n)}}}catch(e){t.e(e)}finally{t.f()}}},{key:"pushImageMarker",value:function(e){this.textMarkers.push(e),e.renderNode&&this._scene.add(e.renderNode)}},{key:"removeAll",value:function(){var e,t=g(this.textMarkers);try{for(t.s();!(e=t.n()).done;){var n=e.value;this.removeNode(n,!0)}}catch(e){t.e(e)}finally{t.f()}this.textMarkers.length=0}},{key:"untiedMarker",value:function(e){e.parent=void 0,this._scene.remove(e.renderNode)}},{key:"removeNode",value:function(e,t){if(e.parent=void 0,this._scene.remove(e.renderNode),e.isAlwaysShow&&(this.parent.removeAlwaysShowMarker(e.renderNode),e.show=!1),e.dispose(),!t){var n=this.textMarkers.indexOf(e);-1<n&&this.textMarkers.splice(n,1)}}},{key:"removeMarker",value:function(e){this.removeNode(e)}},{key:"checkSceneNode",value:function(){this._scene.children.length=0;var e,t=g(this.textMarkers);try{for(t.s();!(e=t.n()).done;){var n=e.value;n.visible&&n.renderNode&&this._scene.add(n.renderNode)}}catch(e){t.e(e)}finally{t.f()}}},{key:"dispose",value:function(){var e,t=g(this.textMarkers);try{for(t.s();!(e=t.n()).done;){var n=e.value;n.dispose(),this._scene.remove(n.renderNode),n.parent=void 0}}catch(e){t.e(e)}finally{t.f()}this.textMarkers.length=0,this._scene=void 0}},{key:"markers",get:function(){return this.textMarkers}},{key:"scene",get:function(){return this._scene}},{key:"visible",get:function(){return this._visible},set:function(e){this._visible=e,this.parent&&this.parent.parent&&this.parent.parent.parent&&this.parent.parent.parent.map.setRenderList()}},{key:"show",get:function(){return this.visible},set:function(e){this.visible=e}}]),n}(v.default),M=b;t.default=M},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var s=r(n(18)),l=r(n(13)),u=r(n(17)),c=r(n(16)),a=r(n(15));n(10),n(5),n(4);var o=r(n(6)),h=r(n(2)),f=r(n(3)),d=r(n(7)),p=r(n(8)),m=r(n(9)),v=r(n(12)),g=r(n(34)),y=r(n(400));function _(e){if(void 0===c.default||null==e[u.default]){if((0,l.default)(e)||(e=x(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i,a=!0,o=!1;return{s:function(){r=(0,s.default)(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){o=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(o)throw i}}}}function x(e,t){if(e){if("string"==typeof e)return w(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?(0,a.default)(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?w(e,t):void 0}}function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function b(r){return function(){var e,t=(0,p.default)(r);if(M()){var n=(0,p.default)(this).constructor;e=(0,o.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,d.default)(this,e)}}function M(){if("undefined"==typeof Reflect||!o.default)return!1;if(o.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,o.default)(Date,[],function(){})),!0}catch(e){return!1}}var S=function(e){(0,m.default)(r,e);var n=b(r);function r(e){var t;return(0,h.default)(this,r),t=n.call(this),t._scene=new fm.Scene,t._scene.userData.type="heatmap",t.alias="heatmap",t._prepareInited=!1,t._randomInited=!0,t._randomNum=0,t._gradient=null==e.gradient?{.45:"rgb(0,0,255)",.55:"rgb(0,255,255)",.65:"rgb(0,255,0)",.95:"yellow",1:"rgb(255,0,0)"}:e.gradient,t._points=null,t._opacity="number"==typeof e.opacity?e.opacity:.5,t._prepareInitObjects=[],t._visible=!0,t}return(0,f.default)(r,[{key:"init",value:function(){var e=this.findParent(g.default);if(e&&this._points){var t=this.parent.parent,n=this.parent.getHeight(),r=t.center,i=e.materialManager,a=i.getHeatMapGradient(this._gradient),o=new y.default({},{},a);o.material.opacity=this._opacity;var s,l=_(this._points);try{for(l.s();!(s=l.n()).done;){var u=s.value,c=o.clone();c.position.set(u.x,r.y+3+n,u.y-r.y),c.mapNode=this,this._scene.add(c)}}catch(e){l.e(e)}finally{l.f()}this._prepareInited=!1}else this._prepareInited=!0}},{key:"initPrepare",value:function(){this._randomInited||(this.randomPoints(this._randomNum,!0),this._randomInited=!0,this._randomNum=0),this._points,this.init()}},{key:"removeAll",value:function(){var e=this._scene;if(e){for(var t=e.children.length-1;-1<t;t--){var n=e.children[t];e.remove(n),n.mapNode=void 0,n.geometry.dispose(),n.material.dispose(),n.material.map.dispose()}e.children.length=0}this._points.length=0}},{key:"clearPoints",value:function(){this.removeAll()}},{key:"addPoints",value:function(e){this._points=e,this.init()}},{key:"randomPoints",value:function(e,t){var n=this.findParent(g.default);if(!n)return this._prepareInited=!0,this._randomInited=!1,void(this._randomNum=e);for(var r=this.parent.parent,i=r.bbox,a=i.max.x-i.min.x,o=i.max.y-i.min.y,s=[],l=0;l<e;l++)s.push({x:Math.random()*a+i.min.x,y:Math.random()*o+i.min.y});this._points=s,t||this.init()}},{key:"dispose",value:function(){this.removeAll(),this._scene=void 0,this._gradient=void 0}},{key:"scene",get:function(){return this._scene}},{key:"prepareInited",get:function(){return this._prepareInited}},{key:"prepareInitObjects",get:function(){return this._prepareInitObjects}},{key:"visible",get:function(){return this._visible}}]),r}(v.default),E=S;t.default=E},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0,n(70),n(141),n(46);var a=r(n(2)),o=r(n(3)),s=(r(n(200)),function(){function e(){(0,a.default)(this,e)}return(0,o.default)(e,[{key:"createGeometry",value:function(e,t,n,r){for(var i=new Float32Array((t+1)*n*3),a=new Float32Array((t+1)*n*2),o=new Uint16Array(t*n*2*3),s=0;s<t+1;s++)for(var l=s/t*e,u=4/Math.sqrt(2*Math.PI)*Math.exp(-l*l/2/r)/Math.sqrt(r),c=0;c<n;c++){var h=c/n*Math.PI*2,f=l*Math.sin(h),d=l*Math.cos(h),p=s*n*3+3*c;i[p]=d,i[p+1]=u,i[p+2]=f;var m=s*n*2+2*c;if(a[m]=c/n,a[m+1]=s/t,s<t){var v=void 0,g=void 0,y=void 0,_=void 0,x=s*n*6+6*c;v=s*n+c,g=c+1===n?s*n:v+1,y=v+n,_=g+n,o[x]=v,o[x+1]=g,o[x+2]=y,o[x+3]=g,o[x+4]=_,o[x+5]=y}}return{index:o,uv:a,vertice:i}}},{key:"computerArcLineByPoints",value:function(e,t,n,r,i){var a=(new fm.Vector3).copy(e).distanceTo(t),o=(new fm.Vector3).copy(n).distanceTo(t),s=(new fm.Vector3).copy(e),l=(new fm.Vector3).copy(e),u=[];r<a&&(s=(new fm.Vector3).copy(t).add((new fm.Vector3).copy(e).sub(t).normalize().multiplyScalar(r)),u.push(s)),r<o&&(l=(new fm.Vector3).copy(t).add((new fm.Vector3).copy(n).sub(t).normalize().multiplyScalar(r)));for(var c=new fm.QuadraticBezierCurve3(s,t,l),h=0;h<i-1;h++){var f=(h+1)/i,d=c.getPoint(f);u.push(d)}return r<o&&u.push(l),u}}]),e}()),l=s;t.default=l},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var s=r(n(18)),l=r(n(13)),u=r(n(17)),c=r(n(16)),a=r(n(15));n(10),n(5),n(4);var o=r(n(6));n(151);var h=r(n(2)),f=r(n(3)),d=r(n(7)),p=r(n(8)),m=r(n(9)),v=r(n(12)),g=r(n(34));function y(e){if(void 0===c.default||null==e[u.default]){if((0,l.default)(e)||(e=_(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i,a=!0,o=!1;return{s:function(){r=(0,s.default)(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){o=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(o)throw i}}}}function _(e,t){if(e){if("string"==typeof e)return x(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?(0,a.default)(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?x(e,t):void 0}}function x(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function w(r){return function(){var e,t=(0,p.default)(r);if(b()){var n=(0,p.default)(this).constructor;e=(0,o.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,d.default)(this,e)}}function b(){if("undefined"==typeof Reflect||!o.default)return!1;if(o.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,o.default)(Date,[],function(){})),!0}catch(e){return!1}}var M=function(e){(0,m.default)(n,e);var t=w(n);function n(){var e;return(0,h.default)(this,n),e=t.call(this),e._scene=new fm.Scene,e._scene.userData.type="domMarker",e.alias="domMarker",e._visible=!0,e.domMarkers=[],e.anchor=9,e}return(0,f.default)(n,[{key:"addMarker",value:function(e){e.parent=this,this.domMarkers.push(e);var t=new Date,n=t.getTime(),r=Math.random();e._param.id="domMarker"+n+r,e.initDom(e._param);var i=this.findParent(g.default);i&&i._map.on("update",this._moveMarker.bind(this))}},{key:"_moveMarker",value:function(){var e=this.findParent(g.default);if(e){var t,n=y(this.domMarkers);try{for(n.s();!(t=n.n()).done;){var r=t.value,i=document.getElementById(r._param.id);if(i){var a=null;a=r.height?r.height+this.height:this.height;var o=e._map.coordMapToScreen(r.x,r.y,a);i.style.left=this._anchor(r,o).left,i.style.top=this._anchor(r,o).top}}}catch(e){n.e(e)}finally{n.f()}}}},{key:"_anchor",value:function(e,t){var n=null,r=null;switch(e.anchor){case 9:n=t.x-e.domWidth/2+"px",r=t.y-e.domHeight/2+"px";break;case 5:n=t.x-e.domWidth+"px",r=t.y-e.domHeight+"px";break;case 6:n=t.x+"px",r=t.y-e.domHeight+"px";break;case 7:n=t.x-e.domWidth+"px",r=t.y+"px";break;case 8:n=t.x+"px",r=t.y+"px";break;case 1:n=t.x-e.domWidth+"px",r=t.y-e.domHeight/2+"px";break;case 2:n=t.x+"px",r=t.y-e.domHeight/2+"px";break;case 3:n=t.x-e.domWidth/2+"px",r=t.y-e.domHeight+"px";break;case 4:n=t.x-e.domWidth/2+"px",r=t.y+"px";break;default:n=t.x-e.domWidth/2+"px",r=t.y-e.domHeight/2+"px"}return{left:n,top:r}}},{key:"removeMarker",value:function(e){if(void 0!==e){e.parent=null;var t=document.getElementById(e._param.id);t&&(t.parentNode.removeChild(t),t=null)}}},{key:"removeAll",value:function(){if(void 0!==this.domMarkers.length)for(var e=0;e<this.domMarkers.length;e++){var t=document.getElementById(this.domMarkers[e]._param.id);t&&(t.parentNode.removeChild(t),t=null)}}},{key:"dispose",value:function(){this.removeAll()}},{key:"scene",get:function(){return this._scene}},{key:"height",get:function(){return this.parent._height}},{key:"show",get:function(){return this.show},set:function(e){if(void 0!==this.domMarkers.length)for(var t=0;t<this.domMarkers.length;t++){var n=document.getElementById(this.domMarkers[t]._param.id);n&&(n.style.display=e?"block":"none")}}}]),n}(v.default),S=M;t.default=S},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0,n(5),n(4);var a=r(n(6)),o=r(n(2)),s=r(n(3)),l=r(n(7)),u=r(n(8)),c=r(n(9)),h=r(n(12));function f(r){return function(){var e,t=(0,u.default)(r);if(d()){var n=(0,u.default)(this).constructor;e=(0,a.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,l.default)(this,e)}}function d(){if("undefined"==typeof Reflect||!a.default)return!1;if(a.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,a.default)(Date,[],function(){})),!0}catch(e){return!1}}var p=function(e){(0,c.default)(n,e);var t=f(n);function n(){var e;return(0,o.default)(this,n),e=t.call(this,"dynmodel"),e._scene=new fm.Scene,e._scene.userData.type="dynmodel",e.alias="dynmodel",e._models={},e.prepareInitObjects=[],e._visible=!0,e.initLight(),e.putLight(),e}return(0,s.default)(n,[{key:"initLight",value:function(){this._ambientLight=new fm.AmbientLight(7631988),this._target=new fm.Object3D,this._mainLight=new fm.DirectionalLight(8947848,1.2),this._mainLight.position.set(-1,1,1).normalize(),this._mainLight.target=this._target,this._secondLight=new fm.DirectionalLight(3355443),this._secondLight.position.set(-.5,1,-1).normalize(),this._secondLight.target=this._target}},{key:"addNodes",value:function(e){e.parent=this,e.renderNode&&this._scene.add(e.renderNode),this._models[""+e.eid]=e}},{key:"removeNode",value:function(n){n.parent=void 0;var r=this;n.renderNode.traverse(function(e){if(e instanceof fm.Mesh)if(e.material.transparent=!0,n.fadeOut)var t=setInterval(function(){.05<e.material.opacity?e.material.opacity-=.05:(clearInterval(t),r._scene.remove(n.renderNode))},200);else r._scene.remove(n.renderNode)}),n.dispose()}},{key:"putLight",value:function(){var e=this;this.scene.add(this._mainLight),this.scene.add(this._ambientLight),this.scene.add(this._secondLight),this.scene.add(this._target),this.scene.removeLight=function(){e.removeLight()}}},{key:"removeLight",value:function(){this.scene.remove(this._mainLight),this.scene.remove(this._ambientLight),this.scene.remove(this._secondLight)}},{key:"disposeLight",value:function(){this._mainLight=void 0,this._ambientLight=void 0,this._secondLight=void 0}},{key:"getNodeById",value:function(e){return this._models[""+e]}},{key:"traverse",value:function(e){for(var t in this._models)e&&e(this._models[t])}},{key:"checkSceneNode",value:function(){for(var e in this._scene.children.length=0,this._models)this._models[e].visible&&this._models[e].renderNode&&this._scene.add(this._models[e].renderNode);this.putLight()}},{key:"getAllMesh",value:function(){var e=[];for(var t in this._models)this._models[t].renderNode&&e.push(this._models[t].renderNode);return e}},{key:"dispose",value:function(){for(var e in this._models)this._models[e].dispose(),this._scene.remove(this._models[e].renderNode),this._models[e].parent=void 0,this._models[e]=void 0;this.removeLight(),this.disposeLight(),this._scene.length=0,this._scene=void 0}},{key:"models",get:function(){return this._models},set:function(e){this._models=e}},{key:"scene",get:function(){return this._scene}},{key:"visible",get:function(){return this._visible},set:function(e){this._visible=e,this.parent&&this.parent.parent&&this.parent.parent.parent&&this.parent.parent.parent.map.setRenderList()}},{key:"show",get:function(){return this.visible},set:function(e){this.visible=e}}]),n}(h.default),m=p;t.default=m},function(e,t,n){"use strict";var r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var i={VERSION:"2.5.0",BUILD:40},a=i;t.default=a},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(2)),o=r(n(3)),s=function(){function e(){(0,a.default)(this,e)}return(0,o.default)(e,[{key:"addEventListener",value:function(e,t){void 0===this._listeners&&(this._listeners={});var n=this._listeners;void 0===n[e]&&(n[e]=[]),-1===n[e].indexOf(t)&&n[e].push(t)}},{key:"hasEventListener",value:function(e,t){if(void 0===this._listeners)return!1;var n=this._listeners;return void 0!==n[e]&&-1!==n[e].indexOf(t)}},{key:"removeEventListener",value:function(e,t){if(void 0!==this._listeners){var n=this._listeners,r=n[e];if(void 0!==r){var i=r.indexOf(t);-1!==i&&r.splice(i,1)}}}},{key:"dispatchEvent",value:function(e){if(void 0!==this._listeners){var t=this._listeners,n=t[e.type];if(void 0!==n)for(var r=n.slice(0),i=0,a=r.length;i<a;i++)r[i].call(this,e)}}}]),e}(),l=s;t.default=l},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var s=r(n(18)),l=r(n(13)),u=r(n(17)),c=r(n(16)),a=r(n(15));n(5),n(4);var o=r(n(6));n(56);var h=r(n(68));n(10);var f=r(n(2)),d=r(n(3)),p=r(n(7)),m=r(n(8)),v=r(n(9)),g=r(n(12)),y=r(n(34)),_=r(n(73)),x=r(n(33));function w(e){if(void 0===c.default||null==e[u.default]){if((0,l.default)(e)||(e=b(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i,a=!0,o=!1;return{s:function(){r=(0,s.default)(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){o=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(o)throw i}}}}function b(e,t){if(e){if("string"==typeof e)return M(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?(0,a.default)(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?M(e,t):void 0}}function M(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function S(r){return function(){var e,t=(0,m.default)(r);if(E()){var n=(0,m.default)(this).constructor;e=(0,o.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,p.default)(this,e)}}function E(){if("undefined"==typeof Reflect||!o.default)return!1;if(o.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,o.default)(Date,[],function(){})),!0}catch(e){return!1}}var T=function(e){(0,v.default)(i,e);var r=S(i);function i(e,t){var n;return(0,f.default)(this,i),n=r.call(this,t.id?t.id:fm.Math.generateUUID(),x.default.DYNMODEL),n._url=t.url,n._url=n._url+"?"+n.getRandomNumber()+(new Date).getTime()+n.getRandomNumber(),n._loader=e.nodeManager.getDynLoader(),n._mixer=null,n._renderNode=null,n._gltf=null,n._visible=!0,n._actions={},n._color=t.color,n._scale=t.scale,n._moveAnimater=null,n._isMoving=!1,n._map=e,n._mapCenter=(new fm.Vector2).copy(e.center),n._meshes=[],n.fadeIn=t.fadeIn,n.fadeOut=t.fadeOut,n.init(e,t.coord,t.callback),n}return(0,d.default)(i,[{key:"init",value:function(a,o,s){var l=this;this._loader?(this._height="number"==typeof o.z?o.z:5,this._loader.load(this._url,function(e){l.fadeIn&&l.fadeIn(e.scene),l._gltf=e,l._renderNode=e.scene,l._getMeshes(l._renderNode,l._meshes),l._color&&l.setColor(l._color),l._scale&&l.setScale(l._scale),l._renderNode.scale.z*=-1,l._renderNode.mapNode=l,l._mixer=new fm.AnimationMixer(l._renderNode),a.addAnimationMixer(l._mixer);var t,n=w(e.animations);try{for(n.s();!(t=n.n()).done;){var r=t.value,i=l._mixer.clipAction(r);l._actions[r.name]=i}}catch(e){n.e(e)}finally{n.f()}l.setPosition(o.x,o.y,0,l._height),l.renderNodeInited=!0,l.visible=!0,s&&s(l)})):console.error("外部模型加载器缺失")}},{key:"lookAt",value:function(e){if(this.parent&&this.parent.parent){var t=this._map.center,n=this.parent.parent.height,r=new fm.Vector3(e.x-t.x,n+e.z,-e.y+t.y);this._renderNode.lookAt(r)}else console.warn("请将模型加载进入地图!")}},{key:"setPosition",value:function(e,t,n,r){var i=this._mapCenter;this._height=r,this._x=e,this._y=t,this._renderNode.position.set(this._x-i.x,this._height,i.y-this._y)}},{key:"rotateTo",value:function(t){var n=this,e=this._renderNode.rotation.y,r=t.to%360*fm.Math.DEG2RAD;this.rotateAnimater&&(this.rotateAnimater.stop(),this._map.removeAnimater(this.rotateAnimater));var i=new _.default({angle:e},{angle:r},t.duration?1e3*t.duration:500,function(){n._map.removeAnimater(i),n.rotateAnimater=null,t.callback&&t.callback()},function(e){n._renderNode.rotation.y=e.angle,t.update&&t.update()}).start();this._map.addAnimater(i),this.rotateAnimater=i}},{key:"setRotate",value:function(e){var t=e%360*fm.Math.DEG2RAD;this._renderNode.rotation.y=t}},{key:"setScale",value:function(e){for(var t=this._renderNode.children,n=0;n<t.length;n++)t[n].scale.x=e,t[n].scale.y=e,t[n].scale.z=e}},{key:"setColor",value:function(e){for(var t=new fm.Color(e),n=this._meshes,r=0;r<n.length;r++){var i=n[r];i.material.color.r=t.r,i.material.color.g=t.g,i.material.color.b=t.b}}},{key:"fadeIn",value:function(e){e.traverse(function(e){if(e instanceof fm.Mesh){e.material.transparent=!0,e.material.opacity=0;var t=setInterval(function(){e.material.opacity<1?e.material.opacity+=.05:clearInterval(t)},200)}})}},{key:"setHeight",value:function(e){this.setPosition(this._x,this._y,0,e)}},{key:"setAngle",value:function(e){this._renderNode&&(this._renderNode.rotation.y=e*fm.Math.DEG2RAD)}},{key:"startAction",value:function(e,t,n){var r=1<arguments.length&&void 0!==t?arguments[1]:.2,i=2<arguments.length?n:void 0,a=this._actions[e];a&&(i&&(a.clampWhenFinished=!0,a.loop=fm.LoopOnce),a.reset().setEffectiveTimeScale(1).setEffectiveWeight(1).fadeIn(r).play())}},{key:"stopAction",value:function(e,t){var n=1<arguments.length&&void 0!==t?arguments[1]:.2,r=this._actions[e];r&&r.fadeOut(n)}},{key:"getActionList",value:function(){return(0,h.default)(this._actions)}},{key:"moveTo",value:function(t){var n=this;if(!this._isMoving){var e=this.findParent(y.default),r=t.x,i=t.y;t.time||(t.time=.5);var a=new _.default({x:this.x,y:this.y},{x:r,y:i},1e3*t.time,function(){e.map.removeAnimater(a),n._moveAnimater=null,n._isMoving=!1,t.callback&&t.callback()},function(e){n.setPosition(e.x,e.y,0,n._height),t.update&&t.update(e)}).start();this._isMoving=!0,e.map.addAnimater(a),this._moveAnimater=a}}},{key:"stopMoveTo",value:function(){var e=this.findParent(y.default);this._moveAnimater&&this._moveAnimater.stop(),e.map.removeAnimater(this._moveAnimater),this._isMoving=!1,this._moveAnimater=null}},{key:"_getMeshes",value:function(e,t){if(e instanceof fm.Mesh)e.material=e.material.clone(),t.push(e);else if(e.children)for(var n=0;n<e.children.length;n++)this._getMeshes(e.children[n],t)}},{key:"getRandomNumber",value:function(){for(var e=100,t=new Array,n=0;n<e;n++)t[n]=n+1;return t.sort(function(){return.5-Math.random()}),t[Math.floor(Math.random()*e)]}},{key:"dispose",value:function(){this._renderNode.mapNode=null}},{key:"visible",set:function(e){e?this.parent&&this.parent.scene.children.indexOf(this._renderNode)<0&&this._renderNode&&this.parent.scene.add(this._renderNode):(this._renderNode&&this.parent.scene.remove(this._renderNode),this._renderNode.parent=this.parent.scene),this._visible=e},get:function(){return this._visible}},{key:"renderNode",get:function(){return this._renderNode},set:function(e){this._renderNode=e,this._renderNode.mapNode=this,this.parent.scene.children.indexOf(this._renderNode)<0&&this._renderNode&&this.parent.scene.add(this._renderNode)}},{key:"mapCoord",get:function(){if(this.parent&&this.parent.parent){var e=this._map.center,t=this.parent.parent.height,n=this._renderNode.position;return new fm.Vector3(n.x+e.x,e.y-n.z,-t+n.y)}console.warn("请将模型加载进入地图!")}}]),i}(g.default),A=T;t.default=A},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(2)),o=function e(){(0,a.default)(this,e),this.enableMapPan=!0,this.enableMapRotate=!0,this.enableMapIncline=!0,this.enableMapPinch=!0,this.enableMapSingleTap=!0,this.enableMapHover=!1},s=o;t.default=s},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(2)),o=r(n(3)),s=r(n(407)),g=(r(n(191)),r(n(232))),l=function(){function e(){(0,a.default)(this,e)}return(0,o.default)(e,null,[{key:"search",value:function(){}},{key:"drawNaviRoads",value:function(e){if(e&&e._currentSceneId&&e.dataManager){var t=e.dataManager._sceneDecodeData[e._currentSceneId];if(t){var n=t.floors;if(0!=n.length){var r=[{lineWidth:1,alpha:1,lineType:fengmap.FMLineType.FULL,color:"#00FFFF"},{lineWidth:1,alpha:1,lineType:fengmap.FMLineType.FULL,color:"#00FF00"},{lineWidth:1,alpha:1,lineType:fengmap.FMLineType.FULL,color:"#FF00FF"},{lineWidth:1,alpha:1,lineType:fengmap.FMLineType.FULL,color:"#FF0000"}],i=1,a=[];for(var o in n){var s=n[o].gid;if(null!=s){var l=n[o].geo[0],u=n[o].biz[0],c=n[o].navi[0],h=new g.default({}),f=h.convertToGroup(s,l,u,c);for(var d in f.naviSegments){var p=f.naviSegments[d],m=new fengmap.FMLineMarker,v=new fengmap.FMSegment;v.groupId=s,v.points=p.geoArr,v.points.forEach(function(e){e.z=i}),m.addSegment(v),e.drawLineMark(m,r[p.entry]),a.push(m)}}}return a}}}}}]),e}();(0,s.default)(l,"getLayerByAlias",function(e,t,n,r){var i=e.getFMGroup(t);if(i&&i.layers){n=[].concat(n);for(var a=[],o=0;o<i.layers.length;o++){var s=i.layers[o];if(s._type_)-1<n.indexOf(s._type_)&&(r&&r(s,s._type_)&&o--,a.push(s));else for(var l=0;l<n.length;l++){var u=n[l];fengmap.Map.layerAlias[u]&&s instanceof fengmap.Map.layerAlias[u]&&(r&&r(s,u)&&o--,a.push(s))}}return 0==a.length?null:1==a.length?a[0]:a}});var u=l;t.default=u},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0,n(21);var a=r(n(2)),o=r(n(3)),l=r(n(147)),s=r(n(201)),u=r(n(202)),c=function(){function t(e){(0,a.default)(this,t),this._options=e,this._staticNaviScene=null,this._wktReader=new s.default,this._scene=null}return(0,o.default)(t,[{key:"setScene",value:function(e){this._scene=e}},{key:"queryScene",value:function(e,n){var t,r=this;this._options.useStatic?(t=this._options.naviServerURL+"/"+e+".fmap",new l.default(t,function(e){var t=r._convertStatic1(e);n(t.scene_data)},!0)):(t=this._options.naviServerURL+"/"+e,new l.default(t,function(e){var t=r._convertSite1(e);n(t.scene_data)},!0))}},{key:"queryNaviData",value:function(e,n,r){var i=this;if(this._options.useStatic){var t=i._convertStatic2(n);r(t)}else{var a=null,o=null,s=null;i=this,new l.default(this._options.naviServerURL+"/group_v2/"+e+"/"+n+"/geo",function(e){if(a=e,null!=a&&null!=o&&null!=s){var t=i._convertSite2(n,a,o,s);r(t)}},!0),new l.default(this._options.naviServerURL+"/group_v2/"+e+"/"+n+"/biz",function(e){if(o=e,null!=a&&null!=o&&null!=s){var t=i._convertSite2(n,a,o,s);r(t)}},!0),new l.default(this._options.naviServerURL+"/group_v2/"+e+"/"+n+"/navi",function(e){if(s=e,null!=a&&null!=o&&null!=s){var t=i._convertSite2(n,a,o,s);r(t)}},!0)}}},{key:"convertToGroup",value:function(e,t,n,r){return this._convertToGroup(e,t,n,r)}},{key:"convertGeo2Geometry",value:function(e,t){return this._convertGeo2Geometry(e,t)}},{key:"convertArray2Geometry",value:function(e,t){return this._convertArray2Geometry(e,t)}},{key:"_convertSite1",value:function(e){var t=fmSceneDecode(e);return e={scene_data:t},e}},{key:"_convertSite2",value:function(e,t,n,r){var i=fmFloorGeoDecode(t),a=fmFloorBizDecode(n),o=fmFloorNaviDecode(r);return this._convertToGroup(e,i,a,o)}},{key:"_convertGeo2Geometry",value:function(e){var t=this._wktReader.parse(e);return{points:t._points,holes:t._holes}}},{key:"_convertArray2Geometry",value:function(e,t){var n=(new u.default).parseGeometry(e,t);return{points:n._points,holes:n._holes}}},{key:"_tempFlipX",value:function(e){if(e&&"string"!=typeof e)for(var t in e){var n=e[t];if("vertices"==t||"vertex"==t)for(var r in n)r%2==0&&(n[r]=-n[r]);else"scene_data"==t?(n.x=-n.x,n.defCenX=-n.defCenX):this._tempFlipX(n)}}},{key:"_convertStringToArray",value:function(e){if(""==e||!e)return[];var t=[],n=e,r=[];return 0<=n.indexOf("|")||0<=n.indexOf("-")||0<=n.indexOf(",")?(r=n.split(/[|,-]/),t.push.apply(t,r)):t.push(n),t}},{key:"_convertStatic1",value:function(e){return this._staticNaviScene=fmMapDecode(e,!1),e={scene_data:this._staticNaviScene.scene},e}},{key:"_convertStatic2",value:function(e){for(var t=this._staticNaviScene.floors,n=0;n<t.length;n++){var r=t[n];if(r.gid==e)return this._convertToGroup(e,r.geo[0],r.biz[0],r.navi[0])}return null}},{key:"_convertToGroup",value:function(e,t,n,r){for(var i={},a=[],o=[],s=[],l=[],u=[],c=this._scene.scene.file_ver,h=0,f=t.extentLayer.length;h<f;h++){var d=t.extentLayer[h],p=null;p=1===c?this._convertGeo2Geometry(d.geo):this._convertArray2Geometry(d.idxs,d.pts),d.geoArr=p.points,d.holes=p.holes,o.push(d)}for(var m=0,v=t.labelLayer.length;m<v;m++)i[t.labelLayer[m].eid]=t.labelLayer[m];for(var g=0,y=t.modelLayer.length;g<y;g++){var _=t.modelLayer[g],x=n.modelLayer[g],w={};w.fid=x.fid,w.eid=_.eid,w.pass=x.pass,w.center=1===c?this._convertGeo2Geometry(i[_.eid].geo).points[0]:this._convertArray2Geometry(i[_.eid].idxs,i[_.eid].pts).points[0];var b=null;b=1===c?this._convertGeo2Geometry(_.geo):this._convertArray2Geometry(_.idxs,_.pts),w.geoArr=b.points,w.holes=b.holes,a.push(w)}for(var M=0,S=r.naviNodes.length;M<S;M++){var E=r.naviNodes[M];E.geoArr=1===c?this._convertGeo2Geometry(E.geo).points[0]:this._convertArray2Geometry(E.idxs,E.pts).points[0],E.linkSegArr=this._convertStringToArray(E.linkSeg),E.liftFloorArr=this._convertStringToArray(E.liftFloor),s.push(E)}for(var T=0,A=r.naviSegments.length;T<A;T++){var L=r.naviSegments[T];L.geoArr=1===c?this._convertGeo2Geometry(L.geo).points:this._convertArray2Geometry(L.idxs,L.pts).points,L.m_Id=r.mid,l.push(L)}if(r.naviZones){var R=0;for(A=r.naviZones.length;R<A;R++){var C=r.naviZones[R],I=null;I=1===c?this._convertGeo2Geometry(C.geo):this._convertArray2Geometry(C.idxs,C.pts),C.geoArr=I.points,C.holes=I.holes,C.m_Id=r.mid,u.push(C)}}var k={gid:e,extentLayer:o,modelLayer:a,naviSegments:l,naviNodes:s,naviZones:u};return k}}]),t}(),h=c;t.default=h},function(e,t,n){"use strict";var r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var i={LEFT_TOP:1,LEFT_BOTTOM:2,RIGHT_TOP:3,RIGHT_BOTTOM:4},a=i;t.default=a},function(e,t,n){"use strict";var r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var i={RIGHT:1,LEFT:2,BOTTOM:3,TOP:4,RIGHT_BOTTOM:5,LEFT_BOTTOM:6,RIGHT_TOP:7,LEFT_TOP:8,CENTER:9},a=i;t.default=a},function(e,t,n){"use strict";var r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var i={FULL:"full",DOTTED:"dotted",DOT_DASH:"dotDash",CENTER:"center",DASH:"dash",DOUBLE_DOT_DASH:"doubleDotDash",TRI_DOT_DASH:"triDotDash",NORMAL:"normal",ARROW:"arrow",RAW:"raw",FMARROW:"fmarrow",TEXTURE:"texture"},a=i;t.default=a},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(69)),o=r(n(145));fm.UniformsLib.line={linewidth:{value:1},resolution:{value:new fm.Vector2(1,1)},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1},mmap:{value:null},offset:{value:new fm.Vector2(0,0)},repeat:{value:new fm.Vector2(1,1)}},fm.ShaderLib.line={uniforms:fm.UniformsUtils.merge([fm.UniformsLib.common,fm.UniformsLib.fog,fm.UniformsLib.line]),vertexShader:"\n\t\t#include <common>\n\t\t#include <color_pars_vertex>\n\t\t#include <fog_pars_vertex>\n\t\t#include <logdepthbuf_pars_vertex>\n\t\t#include <clipping_planes_pars_vertex>\n\n\t\tuniform float linewidth;\n\t\tuniform vec2 resolution;\n\n\t\tattribute float uvyStart;\n\t\tattribute float uvyEnd;\n\n\t\tattribute vec3 instanceStart;\n\t\tattribute vec3 instanceEnd;\n\n\t\tattribute vec3 instanceColorStart;\n\t\tattribute vec3 instanceColorEnd;\n\t\tattribute vec2 uv2;\n\n\n\t\tvarying vec2 vUv;\n\t\tvarying vec2 vUv2;\n\t\tvarying float uvScale;\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashScale;\n\t\t\tattribute float instanceDistanceStart;\n\t\t\tattribute float instanceDistanceEnd;\n\t\t\tvarying float vLineDistance;\n\n\t\t#endif\n\n\t\tvoid trimSegment( const in vec4 start, inout vec4 end ) {\n\n\t\t\t// trim end segment so it terminates between the camera plane and the near plane\n\n\t\t\t// conservative estimate of the near plane\n\t\t\tfloat a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column\n\t\t\tfloat b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column\n\t\t\tfloat nearEstimate = - 0.5 * b / a;\n\n\t\t\tfloat alpha = ( nearEstimate - start.z ) / ( end.z - start.z );\n\n\t\t\tend.xyz = mix( start.xyz, end.xyz, alpha );\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\t#ifdef USE_COLOR\n\n\t\t\t\tvColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd;\n\n\t\t\t#endif\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tvLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd;\n\n\t\t\t#endif\n\n\t\t\tfloat aspect = resolution.x / resolution.y;\n\n\t\t\tvUv = uv;\n\t\t\t\n\t\t\tfloat duvy = uvyEnd - uvyStart;\n\t\t\tfloat uvy = uvyStart + duvy * uv2.y;\n\t\t\t// vUv2 = vec2(uv2.x ,uvy);\n\t\t\tvUv2 = ( position.y < 0.5 ) ? vec2(uv2.x ,uvyStart) : vec2(uv2.x ,uvyEnd);\n\t\t\t// camera space\n\t\t\tvec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );\n\t\t\tvec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 );\n\n\t\t\t// special case for perspective projection, and segments that terminate either in, or behind, the camera plane\n\t\t\t// clearly the gpu firmware has a way of addressing this issue when projecting into ndc space\n\t\t\t// but we need to perform ndc-space calculations in the shader, so we must address this issue directly\n\t\t\t// perhaps there is a more elegant solution -- WestLangley\n\n\t\t\tbool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column\n\n\t\t\tif ( perspective ) {\n\n\t\t\t\tif ( start.z < 0.0 && end.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( start, end );\n\n\t\t\t\t} else if ( end.z < 0.0 && start.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( end, start );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// clip space\n\t\t\tvec4 clipStart = projectionMatrix * start;\n\t\t\tvec4 clipEnd = projectionMatrix * end;\n\n\t\t\t// ndc space\n\t\t\tvec2 ndcStart = clipStart.xy / clipStart.w;\n\t\t\tvec2 ndcEnd = clipEnd.xy / clipEnd.w;\n\n\t\t\t// direction\n\t\t\tvec2 dir = ndcEnd - ndcStart;\n\n\t\t\t// account for clip-space aspect ratio\n\t\t\tdir.x *= aspect;\n\t\t\tfloat scaleDir = length(dir);\n\t\t\tuvScale = 0.05/scaleDir;\n\t\t\tdir = normalize( dir );\n\n\t\t\t// perpendicular to dir\n\t\t\tvec2 offset = vec2( dir.y, - dir.x );\n\n\t\t\t// undo aspect ratio adjustment\n\t\t\tdir.x /= aspect;\n\t\t\toffset.x /= aspect;\n\n\t\t\t// sign flip\n\t\t\tif ( position.x < 0.0 ) offset *= - 1.0;\n\n\t\t\t// endcaps\n\t\t\tif ( position.y < 0.0 ) {\n\n\t\t\t\toffset += - dir;\n\n\t\t\t} else if ( position.y > 1.0 ) {\n\n\t\t\t\toffset += dir;\n\n\t\t\t}\n\n\t\t\t// adjust for linewidth\n\t\t\toffset *= linewidth;\n\n\t\t\t// adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ...\n\t\t\toffset /= resolution.y;\n\n\t\t\t// select end\n\t\t\tvec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;\n\n\t\t\t// back to clip space\n\t\t\toffset *= clip.w;\n\n\t\t\tclip.xy += offset;\n\n\t\t\tgl_Position = clip;\n\n\t\t\tvec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation\n\n\t\t\t#include <logdepthbuf_vertex>\n\t\t\t\n\t\t\t#include <fog_vertex>\n\n\t\t}\n\t\t",fragmentShader:"\n\t\tuniform vec3 diffuse;\n\t\tuniform float opacity;\n\t\tuniform vec2 repeat;\n\t\tuniform vec2 offset;\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashSize;\n\t\t\tuniform float gapSize;\n\n\t\t#endif\n\t\t\n\t\t\n\n\t\t\tuniform sampler2D mmap;\n\n\t\n\n\t\tvarying float vLineDistance;\n\n\t\t#include <common>\n\t\t#include <color_pars_fragment>\n\t\t#include <fog_pars_fragment>\n\t\t#include <logdepthbuf_pars_fragment>\n\t\t#include <clipping_planes_pars_fragment>\n\n\t\tvarying float uvScale;\n\t\tvarying vec2 vUv;\n\t\tvarying vec2 vUv2;\n\n\t\tvoid main() {\n\n\t\t\t#include <clipping_planes_fragment>\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tif ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps\n\n\t\t\t\tif ( mod( vLineDistance, dashSize + gapSize ) > dashSize ) discard; // todo - FIX\n\n\t\t\t#endif\n\n\t\t\t// if ( abs( vUv.y ) > 1.0 ) {\n\n\t\t\t// \tfloat a = vUv.x;\n\t\t\t// \tfloat b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;\n\t\t\t// \tfloat len2 = a * a + b * b;\n\n\t\t\t// \tif ( len2 > 1.0 ) discard;\n\n\t\t\t// }\n\n\t\t\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t\n\t\t\t#ifdef USE_MMAP\n\t\t\t\n\t\t\t\tdiffuseColor = texture2D( mmap, vUv2 * repeat + offset );\n\t\t\t#endif\n\n\t\t\t#include <logdepthbuf_fragment>\n\t\t\tgl_FragColor = diffuseColor;\n\n\t\t\t#include <premultiplied_alpha_fragment>\n\t\t\t#include <tonemapping_fragment>\n\t\t\t#include <encodings_fragment>\n\t\t\t#include <fog_fragment>\n\n\t\t}\n\t\t"},fm.LineMaterial=function(e){fm.ShaderMaterial.call(this,{type:"LineMaterial",uniforms:fm.UniformsUtils.clone(fm.ShaderLib.line.uniforms),vertexShader:fm.ShaderLib.line.vertexShader,fragmentShader:fm.ShaderLib.line.fragmentShader}),this.dashed=!1,(0,o.default)(this,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(e){this.uniforms.diffuse.value=e}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(e){this.uniforms.linewidth.value=e}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(e){this.uniforms.dashScale.value=e}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(e){this.uniforms.dashSize.value=e}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(e){this.uniforms.gapSize.value=e}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(e){this.uniforms.resolution.value.copy(e)}}}),this.setValues(e)},fm.LineMaterial.prototype=(0,a.default)(fm.ShaderMaterial.prototype),fm.LineMaterial.prototype.constructor=fm.LineMaterial,fm.LineMaterial.prototype.isLineMaterial=!0,fm.LineMaterial.prototype.copy=function(e){return fm.ShaderMaterial.prototype.copy.call(this,e),this.color.copy(e.color),this.linewidth=e.linewidth,this.resolution=e.resolution,this};var s=fm.LineMaterial;t.default=s},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0,n(5),n(4);var a=r(n(6));n(46);var o=r(n(2)),s=r(n(3)),l=r(n(7)),u=r(n(8)),c=r(n(9)),h=r(n(238));function f(r){return function(){var e,t=(0,u.default)(r);if(d()){var n=(0,u.default)(this).constructor;e=(0,a.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,l.default)(this,e)}}function d(){if("undefined"==typeof Reflect||!a.default)return!1;if(a.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,a.default)(Date,[],function(){})),!0}catch(e){return!1}}var p=function(e){(0,c.default)(n,e);var t=f(n);function n(){var e;return(0,o.default)(this,n),e=t.call(this),e.type="LineGeometry",e.isLineGeometry=!0,e}return(0,s.default)(n,[{key:"setPositions",value:function(e){for(var t=e.length-3,n=new Float32Array(2*t),r=0;r<t;r+=3)n[2*r]=e[r],n[2*r+1]=e[r+1],n[2*r+2]=e[r+2],n[2*r+3]=e[r+3],n[2*r+4]=e[r+4],n[2*r+5]=e[r+5];return this.test="ddd",(new h.default).setPositions.call(this,n),this}},{key:"setColors",value:function(e){for(var t=e.length-3,n=new Float32Array(2*t),r=0;r<t;r+=3)n[2*r]=e[r],n[2*r+1]=e[r+1],n[2*r+2]=e[r+2],n[2*r+3]=e[r+3],n[2*r+4]=e[r+4],n[2*r+5]=e[r+5];return(new h.default).setColors.call(this,n),this}},{key:"fromLine",value:function(e){var t=e.geometry;return t.isGeometry?this.setPositions(t.vertices):t.isBufferGeometry&&this.setPositions(t.position.array),this}},{key:"copy",value:function(){return this}}]),n}(h.default),m=p;t.default=m},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0,n(5),n(4);var a=r(n(6)),s=r(n(13));n(46);var l=r(n(2)),u=r(n(3)),o=r(n(7)),c=r(n(8)),h=r(n(9));function f(r){return function(){var e,t=(0,c.default)(r);if(d()){var n=(0,c.default)(this).constructor;e=(0,a.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,o.default)(this,e)}}function d(){if("undefined"==typeof Reflect||!a.default)return!1;if(a.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,a.default)(Date,[],function(){})),!0}catch(e){return!1}}var p=function(e){(0,h.default)(o,e);var a=f(o);function o(){var e;(0,l.default)(this,o),e=a.call(this),e.type="LineSegmentsGeometry",new fm.BufferGeometry;var t=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],n=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],r=[0,0,1,0,0,1/3,1,1/3,0,2/3,1,2/3,0,1,1,1],i=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];return e.isLineSegmentsGeometry=!0,e.setIndex(i),e.addAttribute("position",new fm.Float32BufferAttribute(t,3)),e.addAttribute("uv",new fm.Float32BufferAttribute(n,2)),e.addAttribute("uv2",new fm.Float32BufferAttribute(r,2)),e}return(0,u.default)(o,[{key:"applyMatrix",value:function(e){var t=this.attributes.instanceStart,n=this.attributes.instanceEnd;return void 0!==t&&(e.applyToBufferAttribute(t),e.applyToBufferAttribute(n),t.data.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}},{key:"setPositions",value:function(e){var t;e instanceof Float32Array?t=e:(0,s.default)(e)&&(t=new Float32Array(e));var n=new fm.InstancedInterleavedBuffer(t,6,1);return this.addAttribute("instanceStart",new fm.InterleavedBufferAttribute(n,3,0)),this.addAttribute("instanceEnd",new fm.InterleavedBufferAttribute(n,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}},{key:"setColors",value:function(e){var t;e instanceof Float32Array?t=e:(0,s.default)(e)&&(t=new Float32Array(e));var n=new fm.InstancedInterleavedBuffer(t,6,1);return this.addAttribute("instanceColorStart",new fm.InterleavedBufferAttribute(n,3,0)),this.addAttribute("instanceColorEnd",new fm.InterleavedBufferAttribute(n,3,3)),this}},{key:"setUvys",value:function(e){var t;e instanceof Float32Array?t=e:(0,s.default)(e)&&(t=new Float32Array(e));var n=new fm.InstancedInterleavedBuffer(t,2,1);return this.addAttribute("uvyStart",new fm.InterleavedBufferAttribute(n,1,0)),this.addAttribute("uvyEnd",new fm.InterleavedBufferAttribute(n,1,1)),this}},{key:"fromWireframeGeometry",value:function(e){return this.setPositions(e.attributes.position.array),this}},{key:"fromEdgesGeometry",value:function(e){return this.setPositions(e.attributes.position.array),this}},{key:"fromMesh",value:function(e){return this.fromWireframeGeometry(new fm.WireframeGeometry(e.geometry)),this}},{key:"fromLineSegements",value:function(e){var t=e.geometry;return t.isGeometry?this.setPositions(t.vertices):t.isBufferGeometry&&this.setPositions(t.position.array),this}},{key:"computeBoundingBox",value:function(){var e=new fm.Box3;null===this.boundingBox&&(this.boundingBox=new fm.Box3);var t=this.attributes.instanceStart,n=this.attributes.instanceEnd;void 0!==t&&void 0!==n&&(this.boundingBox.setFromBufferAttribute(t),e.setFromBufferAttribute(n),this.boundingBox.union(e))}},{key:"computeBoundingSphere",value:function(){var e=new fm.Vector3;null===this.boundingSphere&&(this.boundingSphere=new fm.Sphere),null===this.boundingBox&&this.computeBoundingBox();var t=this.attributes.instanceStart,n=this.attributes.instanceEnd;if(void 0!==t&&void 0!==n){var r=this.boundingSphere.center;this.boundingBox.getCenter(r);for(var i=0,a=0,o=t.count;a<o;a++)e.fromBufferAttribute(t,a),i=Math.max(i,r.distanceToSquared(e)),e.fromBufferAttribute(n,a),i=Math.max(i,r.distanceToSquared(e));this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error("fm.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}},{key:"toJSON",value:function(){}},{key:"clone",value:function(){}},{key:"copy",value:function(){return this}}]),o}(fm.InstancedBufferGeometry),m=p;t.default=m},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var c=r(n(47)),a=r(n(2)),o=r(n(3)),l=r(n(224)),u=r(n(72)),s=function(){function t(e){(0,a.default)(this,t),this._points=e||null,this._groupId=0,this._lineDis=[],this._linePoints=null,this._screenPoints=[],this._screenDis=[],this._radiusPoint=[],this._radiuInit=!1,this._uvys=null,this._minRadius=1,this.needSmooth=!0}return(0,o.default)(t,[{key:"initSegement",value:function(e,t){"number"!=typeof t&&(t=this._minRadius),this._linePoints=this.pointsToLinePnts(e,t),this._uvys=this.computerUVY()}},{key:"pointsToRadius",value:function(e){for(var t=[],n=new l.default,r=0;r<this._points.length;r++)if(0<r&&r<this._points.length-1){var i=u.default.distanceOfTwoPoints(t[t.length-1],this._points[r]),a=u.default.distanceOfTwoPoints(this._points[r],this._points[r+1]),o=.5*(a<i?a:i),s=e;o<s&&(s=o),t.push.apply(t,(0,c.default)(n.computerArcLineByPoints(t[t.length-1],this._points[r],this._points[r+1],s||1,12)))}else t.push(this._points[r]);this._radiusPoint=t,this._radiuInit=!0}},{key:"pointsToLinePnts",value:function(e,t){if(this.needSmooth)this._radiuInit||this.pointsToRadius(t);else{var n=[];n.push.apply(n,(0,c.default)(this._points)),this._radiusPoint=n}for(var r=[],i=0;i<this._radiusPoint.length;i++){var a=this._radiusPoint[i].x-e.x,o=this._radiusPoint[i].z,s=-this._radiusPoint[i].y+e.y;if(r.push(a,o,s),0!==i){var l=new fm.Vector3(this._radiusPoint[i].x,this._radiusPoint[i].y,this._radiusPoint[i].z),u=new fm.Vector3(this._radiusPoint[i-1].x,this._radiusPoint[i-1].y,this._radiusPoint[i-1].z);this._lineDis.push(l.distanceTo(u))}}return r}},{key:"getIndexDis",value:function(e){for(var t=0,n=0;n<this._lineDis.length;n++)n<e&&(t+=this._lineDis[n]);return t}},{key:"computerUVY",value:function(){for(var e=[],t=this.getIndexDis(this._lineDis.length),n=0;n<this._radiusPoint.length;n++)if(0===n)e.push(0);else if(n===this._radiusPoint.length-1)e.push(1);else{var r=this.getIndexDis(n)/t;e.push(r),e.push(r)}return e}},{key:"computeScreenCoord",value:function(e,t,n,r){for(var i=[],a=0,o=[],s=e.matrixWorldInverse,l=0;l<this._linePoints.length;l+=3){var u=this._linePoints[l],c=this._linePoints[l+1],h=this._linePoints[l+2],f=new fm.Vector3(u+r.x,c+r.y,h+r.z),d=f.applyMatrix4(s);d.z,e.near;var p=d.applyMatrix4(e.projectionMatrix),m=new fm.Vector2(t/2+t/2*p.x,n/2-n/2*p.y);if(i.push(m),2<l){var v=m.distanceTo(i[Math.round(l/3)-1]);a+=v,o.push(v)}}return this._screenPoints=i,this._screenDis=o,a}},{key:"_calcMinRadius",value:function(){if(this.points){this._minRadius=1;for(var e=0;e<this._points.length-1;e++){var t=this._points[e],n=this._points[e+1],r=.368*u.default.distanceOfTwoPoints(t,n);this._minRadius>r&&(this._minRadius=r)}}}},{key:"points",get:function(){return this._points},set:function(e){this._points=e}},{key:"groupId",get:function(){return this._groupId},set:function(e){this._groupId=e}},{key:"allLength",get:function(){return this.getIndexDis(this._lineDis.length)}},{key:"linePoints",get:function(){return this._linePoints}},{key:"uvys",get:function(){return this._uvys}}]),t}(),h=s;t.default=h},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0,n(10);var a=r(n(2)),o=function e(){(0,a.default)(this,e),this.circle,this.polygon,this.eName,this.FID,this.groupID,this.ID,this.keyword,this.name,this.typeID,this.nodeType,this.startPoint,this.pathPoins,this.bufferRadius},s=o;t.default=s},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var G=r(n(25));n(21),n(5),n(4);var z=r(n(13)),V=r(n(31));n(10);var a=r(n(2)),o=r(n(3)),s=function(){function t(e){(0,a.default)(this,t),this._data=e,this.Graphics=new fengmap.inner.Graphics}return(0,o.default)(t,[{key:"check2",value:function(e,t,n,r,i,a,o){var s,l,u="",c="",h="";n.name&&(u=n.name),n.eName&&(c=n.eName),n.keyword&&(h=n.keyword),n.circle&&(s=n.circle),n.polygon&&(l=2<n.polygon.length?new SearchPolygon(n.polygon,!0):null);var f,d,p=e.name,m=e.ename,v=e.type;f=void 0===n.typeID||!(!n.typeID||!v)&&(d="number"==typeof n.typeID?[n.typeID]:n.typeID,-1<d.indexOf((0,V.default)(v)));var g,y,_=!1;if(m&&c&&-1<m.toLowerCase().indexOf(c.toLowerCase())&&(_=!0),m&&h&&-1<m.toLowerCase().indexOf(h.toLowerCase())&&(_=!0),p&&h&&-1<p.toLowerCase().indexOf(h.toLowerCase())&&(_=!0),p&&u&&-1<p.toLowerCase().indexOf(u.toLowerCase())&&(_=!0),h||c||u||(_=!0),void 0!==n.FID)if(e.fid&&n.FID){var x=n.FID;x=(0,z.default)(x)?x.map(function(e){return e.toString()}):[x.toString()],g=-1<x.indexOf(e.fid.toString())}else g=!1;else g=!0;if(void 0!==n.ID)if(e.eid&&n.ID){var w=n.ID;(0,z.default)(w)?fids=fids.map(function(e){return e.toString()}):w=[w.toString()],y=-1<w.indexOf(e.eid.toString())}else y=!1;else y=!0;var b=_&&f&&g&&y;if(b){if(s){var M=t.geo;"model"===r&&i&&(M=i);var S=M.substring(6,M.length-1).split(" "),E=(0,G.default)(S[0]),T=(0,G.default)(S[1]),A=s.center,L=Math.sqrt((E-A.x)*(E-A.x)+(T-A.y)*(T-A.y));if(L<s.radius)return o&&(o.distance=L),!0;if("model"==r){var R=0,C=null,I=this._map.getFMGroup(a).getNodeByLayerId("model",e.eid);o.target=I,I&&I._data&&(C=I._data.vertices),null==C&&(C=DataManager.convertGeo2Geometry(t.geo).vertices);for(var k=C.length/2,P=0;P<k-1;P++){var N=2*P;if(R=Graphics.pointDistanceToLine(A,{x:C[N],y:C[N+1]},{x:C[N+2],y:C[N+3]},{}),R<s.radius)return o&&(o.distance=L),!0}if(Graphics.pointInPolygonVector2d(C,A,C.length))return o.distance=L,!0}return!1}if(!l)return!0;var D=t.geo;"model"===r&&i&&(D=i);var O=D.substring(6,D.length-1).split(" "),F={x:(0,G.default)(O[0]),y:(0,G.default)(O[1])};if(l.contain(F))return o.distance=l.distanceToPoint(F),!0;if("model"==r){var B=null,U=this._map.getFMGroup(a).getNodeByLayerId("model",e.eid);if(o.target=U,U&&U._data&&(B=U._data.vertices),null==B&&(B=DataManager.convertGeo2Geometry(t.geo).vertices),l.containXYArray(B))return o.distance=l.distanceToPoint(F),!0}}return!1}},{key:"check",value:function(e,t,n,r,i,a){if(void 0!==n.FID&&n.FID!==e.fid)return!1;if(void 0!==n.groupID&&n.groupID!==a)return!1;if(void 0!==n.ID&&n.ID!==e.eid)return!1;if(void 0!==n.name&&n.name!==e.name)return!1;if(void 0!==n.eName&&n.eName!==e.ename)return!1;if(void 0!==n.typeID&&n.typeID!==e.type)return!1;if(void 0!==n.keyword)if(e.name&&e.ename){if(e.name.toLowerCase().indexOf(n.keyword.toLowerCase())<0&&e.ename&&e.ename.toLowerCase().indexOf(n.keyword.toLowerCase())<0)return!1}else if(e.name&&!e.ename){if(e.name.toLowerCase().indexOf(n.keyword.toLowerCase())<0)return!1}else if(!e.name&&e.ename){if(e.ename.toLowerCase().indexOf(n.keyword.toLowerCase())<0)return!1}else if(!e.name&&!e.ename)return!1;return!0}},{key:"everyModel",value:function(e,t){for(var n=e.biz[0].modelLayer.length,r=0;r<n;r++)t(e.biz[0].modelLayer[r],e.geo[0].modelLayer[r],"model",e.geo[0].labelLayer[r])}},{key:"everyExternalModel",value:function(e,t){for(var n=e.biz[0].externalModelLayer.length,r=0;r<n;r++)e.gid,t(e.biz[0].externalModelLayer[r],e.geo[0].externalModelLayer[r],"externalModel",e.geo[0].labelLayer[r])}},{key:"everyFacility",value:function(e,t){for(var n=e.biz[0].poiLayer.length,r=0;r<n;r++)t(e.biz[0].poiLayer[r],e.geo[0].poiLayer[r],"poi")}},{key:"everyLabel",value:function(e,t){for(var n=e.biz[0].labelLayer.length,r=0;r<n;r++)t(e.biz[0].labelLayer[r],e.geo[0].labelLayer[r],"label")}}]),t}(),l=s;t.default=l},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(2)),o=function e(t){(0,a.default)(this,e),this._data=t},s=o;t.default=s},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0,n(5),n(4);var a=r(n(6)),o=r(n(2)),s=r(n(7)),l=r(n(8)),u=r(n(9)),c=r(n(242));function h(r){return function(){var e,t=(0,l.default)(r);if(f()){var n=(0,l.default)(this).constructor;e=(0,a.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,s.default)(this,e)}}function f(){if("undefined"==typeof Reflect||!a.default)return!1;if(a.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,a.default)(Date,[],function(){})),!0}catch(e){return!1}}var d=function(e){(0,u.default)(i,e);var r=h(i);function i(e,t){var n;return(0,o.default)(this,i),n=r.call(this,e),n._map=t,n.Graphics=fengmap.inner.Graphics,n}return i}(c.default),p=d;t.default=p},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0,n(247),n(338),n(340),n(341);var a=r(n(191)),o=r(n(231)),s=r(n(206)),l=r(n(233)),u=(r(n(409)),r(n(33))),c=r(n(412)),h=r(n(220)),f=r(n(216)),d=r(n(218)),p=r(n(413)),m=r(n(414)),v=r(n(235)),g=r(n(152)),y=r(n(239)),_=r(n(418)),x=r(n(221)),w=r(n(229)),b=r(n(226)),M=r(n(223)),S=r(n(222)),E=r(n(225)),T=r(n(419)),A=r(n(420)),L=r(n(421)),R=r(n(240)),C=r(n(430)),I=r(n(431)),k=r(n(432)),P=r(n(433)),N=r(n(86)),D=r(n(197)),O=r(n(434)),F=r(n(435)),B=r(n(217)),U=r(n(215)),G=r(n(219)),z=r(n(207)),V=r(n(208)),H=r(n(12)),W=r(n(436)),j=r(n(230)),Y=r(n(437)),q=r(n(227)),X=r(n(234)),Z=r(n(203)),J=r(n(72)),K=r(n(228)),Q=r(n(57)),$=r(n(58)),ee=r(n(152)),te=r(n(438)),ne=r(n(232)),re=r(n(439));n(440);var ie={VERSION:q.default.VERSION,BUILD:q.default.BUILD,Map:a.default,FMMap:a.default,MapUtil:o.default,controlPositon:l.default,FMControlPosition:l.default,FMViewMode:P.default,FMDynamicModel:w.default,FMDynamicModelLayer:b.default,FMLanguageType:N.default,FMNodeType:u.default,FMImageMarker:c.default,FMTextMarker:p.default,FMLocationMarker:m.default,FMLineMarker:g.default,FMExtentLayer:s.default,FMSegment:y.default,FMPolygonMarker:_.default,FMPolygonMarkerLayer:x.default,FMImageMarkerLayer:h.default,FMLabelLayer:f.default,FMFacilityLayer:d.default,FMHeatMapLayer:M.default,FMHeatMap:A.default,FMSearchRequest:R.default,FMSearchAnalyser:L.default,FMLineType:v.default,FMNaviModule:C.default,FMNaviMode:C.default,FMTextAlign:I.default,FMNaviPriority:k.default,FMRouteCalcuResult:O.default,FMMapCoord:F.default,FMGroup:V.default,FMLabel:B.default,FMStoreModel:U.default,FMElement:z.default,FMExternalModel:z.default,FMFacility:G.default,FMNode:H.default,FMDirection:D.default,FMScreenCoord:W.default,FMMapGestureEnableController:j.default,FMTextMarkerLayer:S.default,FMDomMarkerLayer:E.default,FMDomMarker:T.default,FMMapCoordTransformer:Y.default,MapCoordTransform:Y.default,FMMarkerAnchor:X.default,FMRenderer:Z.default,inner:{Graphics:J.default,FMSegment:y.default,FMNaviMode:C.default,FMNaviPriority:k.default,FMRouteCalcuResult:O.default,EventDispatcher:K.default,DataManager:Q.default,FMUtil:$.default,FMImageMarker:c.default,FMLineMarker:ee.default,FMLocationMarker:m.default,FMLanguageType:N.default,NaviDataType:te.default,NaviService:ne.default,FMMapCoord:F.default,BoundingBox:re.default}};window.fm=fm,window.fengmap=ie;var ae=ie;t.default=ae},function(e,t,n){n(246);var r=n(11).Object;e.exports=function(e,t,n){return r.defineProperty(e,t,n)}},function(e,t,n){var r=n(14);r(r.S+r.F*!n(30),"Object",{defineProperty:n(35).f})},function(t,e,n){(function(e){t.exports=e.fm=n(248)}).call(this,n(154))},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.AmbientLight=lp,t.AmbientLightProbe=nm,t.AnimationClip=ud,t.AnimationLoader=gd,t.AnimationMixer=$m,t.AnimationObjectGroup=Km,t.ArcCurve=Ed,t.ArrayCamera=vc,t.ArrowHelper=Lv,t.Audio=om,t.AudioAnalyser=lm,t.AudioListener=am,t.AudioLoader=Qp,t.AxesHelper=Rv,t.AxisHelper=ng,t.BinaryTextureLoader=sg,t.Bone=sh,t.BooleanKeyframeTrack=nd,t.BoundingBoxHelper=rg,t.Box2=sv,t.Box3=vi,t.Box3Helper=Tv,t.BoxBufferGeometry=Oa,t.CubeGeometry=t.BoxGeometry=Da,t.BoxHelper=Ev,t.BufferAttribute=Ni,t.BufferGeometry=ba,t.BufferGeometryLoader=pp,t.Camera=Ha,t.CameraHelper=Mv,t.CanvasRenderer=ug,t.CanvasTexture=vh,t.CatmullRomCurve3=Id,t.CircleBufferGeometry=Ff,t.CircleGeometry=Of,t.Clock=im,t.ClosedSplineCurve3=$v,t.Color=Ti,t.ColorKeyframeTrack=rd,t.CompressedTexture=mh,t.CompressedTextureLoader=yd,t.ConeBufferGeometry=Df,t.ConeGeometry=Nf,t.CubeCamera=to,t.CubeTexture=Ol,t.CubeTextureLoader=wd,t.CubicBezierCurve=Vd,t.CubicBezierCurve3=Hd,t.CubicInterpolant=Qf,t.Curve=Md,t.CurvePath=Jd,t.CylinderBufferGeometry=Pf,t.CylinderGeometry=kf,t.Cylindrical=ov,t.DataTexture=ro,t.DataTexture2DArray=Fl,t.DataTexture3D=Bl,t.DataTextureLoader=_d,t.DepthTexture=gh,t.DirectionalLight=sp,t.DirectionalLightHelper=bv,t.DirectionalLightShadow=op,t.DiscreteInterpolant=ed,t.DodecahedronBufferGeometry=Ch,t.DodecahedronGeometry=Rh,t.DynamicBufferAttribute=Hv,t.EdgesGeometry=If,t.EdgesHelper=ig,t.EllipseCurve=Sd,t.Euler=$n,t.EventDispatcher=c,t.ExtrudeBufferGeometry=gf,t.ExtrudeGeometry=vf,t.Face3=Ci,t.Face4=Cv,t.FaceNormalsHelper=wv,t.FileLoader=vd,t.Float32Attribute=Kv,t.Float32BufferAttribute=Vi,t.Float64Attribute=Qv,t.Float64BufferAttribute=Hi,t.Fog=Qc,t.FogExp2=Kc,t.Font=Ap,t.FontLoader=Cp,t.Frustum=ao,t.Geometry=Na,t.GridHelper=yv,t.Group=mc,t.HemisphereLight=ep,t.HemisphereLightHelper=vv,t.HemisphereLightProbe=tm,t.IcosahedronBufferGeometry=Lh,t.IcosahedronGeometry=Ah,t.ImageBitmapLoader=Ep,t.ImageLoader=xd,t.ImmediateRenderObject=uv,t.InstancedBufferAttribute=dp,t.InstancedBufferGeometry=fp,t.InstancedInterleavedBuffer=tv,t.Int16Attribute=qv,t.Int16BufferAttribute=Bi,t.Int32Attribute=Zv,t.Int32BufferAttribute=Gi,t.Int8Attribute=Wv,t.Int8BufferAttribute=Di,t.InterleavedBuffer=$c,t.InterleavedBufferAttribute=eh,t.Interpolant=Kf,t.JSONLoader=cg,t.KeyframeTrack=td,t.LOD=ih,t.LatheBufferGeometry=Af,t.LatheGeometry=Tf,t.Layers=er,t.LensFlare=fg,t.Light=$d,t.LightProbe=em,t.LightProbeHelper=gv,t.LightShadow=tp,t.Line=uh,t.Line3=lv,t.LineBasicMaterial=lh,t.LineCurve=Wd,t.LineCurve3=jd,t.LineDashedMaterial=Xf,t.LineLoop=hh,t.LineSegments=ch,t.LinearInterpolant=$f,t.Loader=Ip,t.LoadingManager=dd,t.Material=ki,t.MaterialLoader=cp,t.Matrix3=Nn,t.Matrix4=Qn,t.Mesh=Ma,t.MeshBasicMaterial=Pi,t.MeshDepthMaterial=uc,t.MeshDistanceMaterial=cc,t.MeshFaceMaterial=Nv,t.MeshLambertMaterial=Yf,t.MeshMatcapMaterial=qf,t.MeshNormalMaterial=jf,t.MeshPhongMaterial=Hf,t.MeshPhysicalMaterial=Vf,t.MeshStandardMaterial=zf,t.MeshToonMaterial=Wf,t.MultiMaterial=Dv,t.NumberKeyframeTrack=id,t.Object3D=pi,t.ObjectLoader=vp,t.OctahedronBufferGeometry=Th,t.OctahedronGeometry=Eh,t.OrthographicCamera=ap,t.ParametricBufferGeometry=xh,t.ParametricGeometry=_h,t.Particle=Fv,t.ParticleBasicMaterial=Gv,t.ParticleSystem=Bv,t.ParticleSystemMaterial=zv,t.Path=Kd,t.PerspectiveCamera=Wa,t.Plane=io,t.PlaneBufferGeometry=Sl,t.PlaneGeometry=Ml,t.PlaneHelper=Av,t.PointCloud=Ov,t.PointCloudMaterial=Uv,t.PointLight=ip,t.PointLightHelper=pv,t.Points=dh,t.PointsMaterial=fh,t.PolarGridHelper=_v,t.PolyhedronBufferGeometry=bh,t.PolyhedronGeometry=wh,t.PositionalAudio=sm,t.PositionalAudioHelper=xv,t.PropertyBinding=Jm,t.PropertyMixer=um,t.QuadraticBezierCurve=Yd,t.QuadraticBezierCurve3=qd,t.Quaternion=kn,t.QuaternionKeyframeTrack=od,t.QuaternionLinearInterpolant=ad,t.RawShaderMaterial=Gf,t.Ray=xi,t.Raycaster=nv,t.RectAreaLight=up,t.RectAreaLightHelper=mv,t.RingBufferGeometry=Ef,t.RingGeometry=Sf,t.Scene=mi,t.ShaderMaterial=Va,t.ShadowMaterial=Uf,t.Shape=Qd,t.ShapeBufferGeometry=Rf,t.ShapeGeometry=Lf,t.ShapePath=Tp,t.Skeleton=oh,t.SkeletonHelper=dv,t.SkinnedMesh=ah,t.Sphere=_i,t.SphereBufferGeometry=Mf,t.SphereGeometry=bf,t.Spherical=av,t.SphericalHarmonics3=$p,t.Spline=tg,t.SplineCurve=Xd,t.SplineCurve3=eg,t.SpotLight=rp,t.SpotLightHelper=hv,t.SpotLightShadow=np,t.Sprite=nh,t.SpriteMaterial=th,t.StereoCamera=rm,t.StringKeyframeTrack=sd,t.TetrahedronBufferGeometry=Sh,t.TetrahedronGeometry=Mh,t.TextBufferGeometry=wf,t.TextGeometry=xf,t.Texture=Xn,t.TextureLoader=bd,t.TorusBufferGeometry=Oh,t.TorusGeometry=Dh,t.TorusKnotBufferGeometry=Nh,t.TorusKnotGeometry=Ph,t.Triangle=wi,t.TubeBufferGeometry=kh,t.TubeGeometry=Ih,t.Uint16Attribute=Xv,t.Uint16BufferAttribute=Ui,t.Uint32Attribute=Jv,t.Uint32BufferAttribute=zi,t.Uint8Attribute=jv,t.Uint8BufferAttribute=Oi,t.Uint8ClampedAttribute=Yv,t.Uint8ClampedBufferAttribute=Fi,t.Uniform=ev,t.Vector2=In,t.Vector3=Pn,t.Vector4=Zn,t.VectorKeyframeTrack=ld,t.Vertex=Vv,t.VertexNormalsHelper=cv,t.VideoTexture=ph,t.WebGLMultisampleRenderTarget=Kn,t.WebGLRenderTarget=Jn,t.WebGLRenderTargetCube=no,t.WebGLRenderer=Jc,t.WebGLUtils=pc,t.WireframeGeometry=yh,t.WireframeHelper=ag,t.XHRLoader=og,t.NotEqualStencilFunc=t.NotEqualDepth=t.NormalBlending=t.NoToneMapping=t.NoColors=t.NoBlending=t.NeverStencilFunc=t.NeverDepth=t.NearestMipmapNearestFilter=t.NearestMipmapLinearFilter=t.NearestMipMapNearestFilter=t.NearestMipMapLinearFilter=t.NearestFilter=t.MultiplyOperation=t.MultiplyBlending=t.MixOperation=t.MirroredRepeatWrapping=t.MinEquation=t.MaxEquation=t.Math=t.MOUSE=t.LuminanceFormat=t.LuminanceAlphaFormat=t.LoopRepeat=t.LoopPingPong=t.LoopOnce=t.LogLuvEncoding=t.LoaderUtils=t.LinearToneMapping=t.LinearMipmapNearestFilter=t.LinearMipmapLinearFilter=t.LinearMipMapNearestFilter=t.LinearMipMapLinearFilter=t.LinearFilter=t.LinearEncoding=t.LineStrip=t.LinePieces=t.LessStencilFunc=t.LessEqualStencilFunc=t.LessEqualDepth=t.LessDepth=t.KeepStencilOp=t.InvertStencilOp=t.InterpolateSmooth=t.InterpolateLinear=t.InterpolateDiscrete=t.IntType=t.IncrementWrapStencilOp=t.IncrementStencilOp=t.ImageUtils=t.HalfFloatType=t.GreaterStencilFunc=t.GreaterEqualStencilFunc=t.GreaterEqualDepth=t.GreaterDepth=t.GeometryUtils=t.GammaEncoding=t.FrontSide=t.FrontFaceDirectionCW=t.FrontFaceDirectionCCW=t.FloatType=t.FlatShading=t.FaceColors=t.EquirectangularRefractionMapping=t.EquirectangularReflectionMapping=t.EqualStencilFunc=t.EqualDepth=t.DstColorFactor=t.DstAlphaFactor=t.DoubleSide=t.DepthStencilFormat=t.DepthFormat=t.DefaultLoadingManager=t.DecrementWrapStencilOp=t.DecrementStencilOp=t.CustomBlending=t.CullFaceNone=t.CullFaceFrontBack=t.CullFaceFront=t.CullFaceBack=t.CubeUVRefractionMapping=t.CubeUVReflectionMapping=t.CubeRefractionMapping=t.CubeReflectionMapping=t.ClampToEdgeWrapping=t.CineonToneMapping=t.Cache=t.ByteType=t.BasicShadowMap=t.BasicDepthPacking=t.BackSide=t.AudioContext=t.AnimationUtils=t.AlwaysStencilFunc=t.AlwaysDepth=t.AlphaFormat=t.AdditiveBlending=t.AddOperation=t.AddEquation=t.ACESFilmicToneMapping=void 0,t.sRGBEncoding=t.ZeroStencilOp=t.ZeroSlopeEnding=t.ZeroFactor=t.ZeroCurvatureEnding=t.WrapAroundEnding=t.VertexColors=t.UnsignedShortType=t.UnsignedShort565Type=t.UnsignedShort5551Type=t.UnsignedShort4444Type=t.UnsignedIntType=t.UnsignedInt248Type=t.UnsignedByteType=t.UniformsUtils=t.UniformsLib=t.Uncharted2ToneMapping=t.UVMapping=t.TrianglesDrawMode=t.TriangleStripDrawMode=t.TriangleFanDrawMode=t.TangentSpaceNormalMap=t.TOUCH=t.SubtractiveBlending=t.SubtractEquation=t.SrcColorFactor=t.SrcAlphaSaturateFactor=t.SrcAlphaFactor=t.SphericalReflectionMapping=t.SmoothShading=t.ShortType=t.ShapeUtils=t.ShaderLib=t.ShaderChunk=t.SceneUtils=t.ReverseSubtractEquation=t.ReplaceStencilOp=t.RepeatWrapping=t.ReinhardToneMapping=t.RedFormat=t.RGB_S3TC_DXT1_Format=t.RGB_PVRTC_4BPPV1_Format=t.RGB_PVRTC_2BPPV1_Format=t.RGB_ETC1_Format=t.RGBM7Encoding=t.RGBM16Encoding=t.RGBFormat=t.RGBEFormat=t.RGBEEncoding=t.RGBDEncoding=t.RGBA_S3TC_DXT5_Format=t.RGBA_S3TC_DXT3_Format=t.RGBA_S3TC_DXT1_Format=t.RGBA_PVRTC_4BPPV1_Format=t.RGBA_PVRTC_2BPPV1_Format=t.RGBA_ASTC_8x8_Format=t.RGBA_ASTC_8x6_Format=t.RGBA_ASTC_8x5_Format=t.RGBA_ASTC_6x6_Format=t.RGBA_ASTC_6x5_Format=t.RGBA_ASTC_5x5_Format=t.RGBA_ASTC_5x4_Format=t.RGBA_ASTC_4x4_Format=t.RGBA_ASTC_12x12_Format=t.RGBA_ASTC_12x10_Format=t.RGBA_ASTC_10x8_Format=t.RGBA_ASTC_10x6_Format=t.RGBA_ASTC_10x5_Format=t.RGBA_ASTC_10x10_Format=t.RGBAFormat=t.RGBADepthPacking=t.REVISION=t.PCFSoftShadowMap=t.PCFShadowMap=t.OneMinusSrcColorFactor=t.OneMinusSrcAlphaFactor=t.OneMinusDstColorFactor=t.OneMinusDstAlphaFactor=t.OneFactor=t.ObjectSpaceNormalMap=void 0,n(249);var f=r(n(15));n(169),n(103),n(62);var a=r(n(265)),o=r(n(55));n(277),n(66),n(21);var s=r(n(280));n(56);var m=r(n(68));n(291),n(46),n(186),n(301),n(141),n(187),n(302),n(142),n(188);var h=r(n(31)),ce=r(n(25));n(309);var v=r(n(108)),Ue=r(n(13)),l=r(n(69));n(144),n(10),n(70);var u=r(n(145));n(318);var p=r(n(32));n(5),n(4),n(190);var g=r(n(0));n(324),n(326);var y=r(n(328));n(85),n(334);var ie=r(n(335));function c(){}void 0===ie.default&&(Number.EPSILON=Math.pow(2,-52)),void 0===y.default&&(Number.isInteger=function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}),void 0===Math.sign&&(Math.sign=function(e){return e<0?-1:0<e?1:+e}),"name"in Function.prototype==0&&(0,g.default)(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}}),void 0===p.default&&(Object.assign=function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];if(null!=r)for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t}),(0,p.default)(c.prototype,{addEventListener:function(e,t){void 0===this._listeners&&(this._listeners={});var n=this._listeners;void 0===n[e]&&(n[e]=[]),-1===n[e].indexOf(t)&&n[e].push(t)},hasEventListener:function(e,t){if(void 0===this._listeners)return!1;var n=this._listeners;return void 0!==n[e]&&-1!==n[e].indexOf(t)},removeEventListener:function(e,t){if(void 0!==this._listeners){var n=this._listeners,r=n[e];if(void 0!==r){var i=r.indexOf(t);-1!==i&&r.splice(i,1)}}},dispatchEvent:function(e){if(void 0!==this._listeners){var t=this._listeners,n=t[e.type];if(void 0!==n){e.target=this;for(var r=n.slice(0),i=0,a=r.length;i<a;i++)r[i].call(this,e)}}}});var d="107";t.REVISION=d;var _={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2};t.MOUSE=_;var x={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3};t.TOUCH=x;var he=0;t.CullFaceNone=he;var fe=1;t.CullFaceBack=fe;var de=2;t.CullFaceFront=de;var w=3;t.CullFaceFrontBack=w;var b=0;t.FrontFaceDirectionCW=b;var M=1;t.FrontFaceDirectionCCW=M;var S=0;t.BasicShadowMap=S;var O=1;t.PCFShadowMap=O;var F=2;t.PCFSoftShadowMap=F;var B=0;t.FrontSide=B;var Ge=1;t.BackSide=Ge;var pe=2;t.DoubleSide=pe;var E=1;t.FlatShading=E;var T=2;t.SmoothShading=T;var A=0;t.NoColors=A;var L=1;t.FaceColors=L;var R=2;t.VertexColors=R;var me=0;t.NoBlending=me;var ve=1;t.NormalBlending=ve;var ge=2;t.AdditiveBlending=ge;var ye=3;t.SubtractiveBlending=ye;var _e=4;t.MultiplyBlending=_e;var xe=5;t.CustomBlending=xe;var we=100;t.AddEquation=we;var C=101;t.SubtractEquation=C;var I=102;t.ReverseSubtractEquation=I;var k=103;t.MinEquation=k;var P=104;t.MaxEquation=P;var N=200;t.ZeroFactor=N;var D=201;t.OneFactor=D;var U=202;t.SrcColorFactor=U;var G=203;t.OneMinusSrcColorFactor=G;var z=204;t.SrcAlphaFactor=z;var V=205;t.OneMinusSrcAlphaFactor=V;var H=206;t.DstAlphaFactor=H;var W=207;t.OneMinusDstAlphaFactor=W;var j=208;t.DstColorFactor=j;var Y=209;t.OneMinusDstColorFactor=Y;var q=210;t.SrcAlphaSaturateFactor=q;var be=0;t.NeverDepth=be;var Me=1;t.AlwaysDepth=Me;var Se=2;t.LessDepth=Se;var Ee=3;t.LessEqualDepth=Ee;var Te=4;t.EqualDepth=Te;var Ae=5;t.GreaterEqualDepth=Ae;var Le=6;t.GreaterDepth=Le;var Re=7;t.NotEqualDepth=Re;var X=0;t.MultiplyOperation=X;var Z=1;t.MixOperation=Z;var J=2;t.AddOperation=J;var K=0;t.NoToneMapping=K;var ze=1;t.LinearToneMapping=ze;var Q=2;t.ReinhardToneMapping=Q;var $=3;t.Uncharted2ToneMapping=$;var ee=4;t.CineonToneMapping=ee;var te=5;t.ACESFilmicToneMapping=te;var ne=300;t.UVMapping=ne;var re=301;t.CubeReflectionMapping=re;var ae=302;t.CubeRefractionMapping=ae;var oe=303;t.EquirectangularReflectionMapping=oe;var se=304;t.EquirectangularRefractionMapping=se;var le=305;t.SphericalReflectionMapping=le;var ue=306;t.CubeUVReflectionMapping=ue;var Ce=307;t.CubeUVRefractionMapping=Ce;var Ie=1e3;t.RepeatWrapping=Ie;var ke=1001;t.ClampToEdgeWrapping=ke;var Pe=1002;t.MirroredRepeatWrapping=Pe;var Ne=1003;t.NearestFilter=Ne;var De=1004;t.NearestMipmapNearestFilter=De;var Oe=1004;t.NearestMipMapNearestFilter=Oe;var Fe=1005;t.NearestMipmapLinearFilter=Fe;var Be=1005;t.NearestMipMapLinearFilter=Be;var Ve=1006;t.LinearFilter=Ve;var He=1007;t.LinearMipmapNearestFilter=He;var We=1007;t.LinearMipMapNearestFilter=We;var je=1008;t.LinearMipmapLinearFilter=je;var Ye=1008;t.LinearMipMapLinearFilter=Ye;var qe=1009;t.UnsignedByteType=qe;var Xe=1010;t.ByteType=Xe;var Ze=1011;t.ShortType=Ze;var Je=1012;t.UnsignedShortType=Je;var Ke=1013;t.IntType=Ke;var Qe=1014;t.UnsignedIntType=Qe;var $e=1015;t.FloatType=$e;var et=1016;t.HalfFloatType=et;var tt=1017;t.UnsignedShort4444Type=tt;var nt=1018;t.UnsignedShort5551Type=nt;var rt=1019;t.UnsignedShort565Type=rt;var it=1020;t.UnsignedInt248Type=it;var at=1021;t.AlphaFormat=at;var ot=1022;t.RGBFormat=ot;var st=1023;t.RGBAFormat=st;var lt=1024;t.LuminanceFormat=lt;var ut=1025;t.LuminanceAlphaFormat=ut;var ct=st;t.RGBEFormat=ct;var ht=1026;t.DepthFormat=ht;var ft=1027;t.DepthStencilFormat=ft;var dt=1028;t.RedFormat=dt;var pt=33776;t.RGB_S3TC_DXT1_Format=pt;var mt=33777;t.RGBA_S3TC_DXT1_Format=mt;var vt=33778;t.RGBA_S3TC_DXT3_Format=vt;var gt=33779;t.RGBA_S3TC_DXT5_Format=gt;var yt=35840;t.RGB_PVRTC_4BPPV1_Format=yt;var _t=35841;t.RGB_PVRTC_2BPPV1_Format=_t;var xt=35842;t.RGBA_PVRTC_4BPPV1_Format=xt;var wt=35843;t.RGBA_PVRTC_2BPPV1_Format=wt;var bt=36196;t.RGB_ETC1_Format=bt;var Mt=37808;t.RGBA_ASTC_4x4_Format=Mt;var St=37809;t.RGBA_ASTC_5x4_Format=St;var Et=37810;t.RGBA_ASTC_5x5_Format=Et;var Tt=37811;t.RGBA_ASTC_6x5_Format=Tt;var At=37812;t.RGBA_ASTC_6x6_Format=At;var Lt=37813;t.RGBA_ASTC_8x5_Format=Lt;var Rt=37814;t.RGBA_ASTC_8x6_Format=Rt;var Ct=37815;t.RGBA_ASTC_8x8_Format=Ct;var It=37816;t.RGBA_ASTC_10x5_Format=It;var kt=37817;t.RGBA_ASTC_10x6_Format=kt;var Pt=37818;t.RGBA_ASTC_10x8_Format=Pt;var Nt=37819;t.RGBA_ASTC_10x10_Format=Nt;var Dt=37820;t.RGBA_ASTC_12x10_Format=Dt;var Ot=37821;t.RGBA_ASTC_12x12_Format=Ot;var Ft=2200;t.LoopOnce=Ft;var Bt=2201;t.LoopRepeat=Bt;var Ut=2202;t.LoopPingPong=Ut;var Gt=2300;t.InterpolateDiscrete=Gt;var zt=2301;t.InterpolateLinear=zt;var Vt=2302;t.InterpolateSmooth=Vt;var Ht=2400;t.ZeroCurvatureEnding=Ht;var Wt=2401;t.ZeroSlopeEnding=Wt;var jt=2402;t.WrapAroundEnding=jt;var Yt=0;t.TrianglesDrawMode=Yt;var qt=1;t.TriangleStripDrawMode=qt;var Xt=2;t.TriangleFanDrawMode=Xt;var Zt=3e3;t.LinearEncoding=Zt;var Jt=3001;t.sRGBEncoding=Jt;var Kt=3007;t.GammaEncoding=Kt;var Qt=3002;t.RGBEEncoding=Qt;var $t=3003;t.LogLuvEncoding=$t;var en=3004;t.RGBM7Encoding=en;var tn=3005;t.RGBM16Encoding=tn;var nn=3006;t.RGBDEncoding=nn;var rn=3200;t.BasicDepthPacking=rn;var an=3201;t.RGBADepthPacking=an;var on=0;t.TangentSpaceNormalMap=on;var sn=1;t.ObjectSpaceNormalMap=sn;var ln=0;t.ZeroStencilOp=ln;var un=7680;t.KeepStencilOp=un;var cn=7681;t.ReplaceStencilOp=cn;var hn=7682;t.IncrementStencilOp=hn;var fn=7683;t.DecrementStencilOp=fn;var dn=34055;t.IncrementWrapStencilOp=dn;var pn=34056;t.DecrementWrapStencilOp=pn;var mn=5386;t.InvertStencilOp=mn;var vn=512;t.NeverStencilFunc=vn;var gn=513;t.LessStencilFunc=gn;var yn=514;t.EqualStencilFunc=yn;var _n=515;t.LessEqualStencilFunc=_n;var xn=516;t.GreaterStencilFunc=xn;var wn=517;t.NotEqualStencilFunc=wn;var bn=518;t.GreaterEqualStencilFunc=bn;var Mn=519;t.AlwaysStencilFunc=Mn;var Sn,En,Tn,An,Ln,Rn,Cn={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){for(var a=[],e=0;e<256;e++)a[e]=(e<16?"0":"")+e.toString(16);return function(){var e=4294967295*Math.random()|0,t=4294967295*Math.random()|0,n=4294967295*Math.random()|0,r=4294967295*Math.random()|0,i=a[255&e]+a[e>>8&255]+a[e>>16&255]+a[e>>24&255]+"-"+a[255&t]+a[t>>8&255]+"-"+a[t>>16&15|64]+a[t>>24&255]+"-"+a[63&n|128]+a[n>>8&255]+"-"+a[n>>16&255]+a[n>>24&255]+a[255&r]+a[r>>8&255]+a[r>>16&255]+a[r>>24&255];return i.toUpperCase()}}(),clamp:function(e,t,n){return Math.max(t,Math.min(n,e))},euclideanModulo:function(e,t){return(e%t+t)%t},mapLinear:function(e,t,n,r,i){return r+(e-t)*(i-r)/(n-t)},lerp:function(e,t,n){return(1-n)*e+n*t},smoothstep:function(e,t,n){return e<=t?0:n<=e?1:(e=(e-t)/(n-t),e*e*(3-2*e))},smootherstep:function(e,t,n){return e<=t?0:n<=e?1:(e=(e-t)/(n-t),e*e*e*(e*(6*e-15)+10))},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},degToRad:function(e){return e*Cn.DEG2RAD},radToDeg:function(e){return e*Cn.RAD2DEG},isPowerOfTwo:function(e){return 0==(e&e-1)&&0!==e},ceilPowerOfTwo:function(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},floorPowerOfTwo:function(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))}};function In(e,t){this.x=e||0,this.y=t||0}function kn(e,t,n,r){this._x=e||0,this._y=t||0,this._z=n||0,this._w=void 0!==r?r:1}function Pn(e,t,n){this.x=e||0,this.y=t||0,this.z=n||0}function Nn(){this.elements=[1,0,0,0,1,0,0,0,1],0<arguments.length&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}t.Math=Cn,(0,u.default)(In.prototype,{width:{get:function(){return this.x},set:function(e){this.x=e}},height:{get:function(){return this.y},set:function(e){this.y=e}}}),(0,p.default)(In.prototype,{isVector2:!0,set:function(e,t){return this.x=e,this.y=t,this},setScalar:function(e){return this.x=e,this.y=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(e){return this.x=e.x,this.y=e.y,this},add:function(e,t){return void 0!==t?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)},addScalar:function(e){return this.x+=e,this.y+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this},sub:function(e,t){return void 0!==t?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)},subScalar:function(e){return this.x-=e,this.y-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this},multiply:function(e){return this.x*=e.x,this.y*=e.y,this},multiplyScalar:function(e){return this.x*=e,this.y*=e,this},divide:function(e){return this.x/=e.x,this.y/=e.y,this},divideScalar:function(e){return this.multiplyScalar(1/e)},applyMatrix3:function(e){var t=this.x,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[7],this},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this},clamp:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this},clampScalar:function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this},clampLength:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(e){return this.x*e.x+this.y*e.y},cross:function(e){return this.x*e.y-this.y*e.x},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length()||1)},angle:function(){var e=Math.atan2(this.y,this.x);return e<0&&(e+=2*Math.PI),e},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,n=this.y-e.y;return t*t+n*n},manhattanDistanceTo:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this},lerpVectors:function(e,t,n){return this.subVectors(t,e).multiplyScalar(n).add(e)},equals:function(e){return e.x===this.x&&e.y===this.y},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e},fromBufferAttribute:function(e,t,n){return void 0!==n&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this},rotateAround:function(e,t){var n=Math.cos(t),r=Math.sin(t),i=this.x-e.x,a=this.y-e.y;return this.x=i*n-a*r+e.x,this.y=i*r+a*n+e.y,this}}),(0,p.default)(kn,{slerp:function(e,t,n,r){return n.copy(e).slerp(t,r)},slerpFlat:function(e,t,n,r,i,a,o){var s=n[r+0],l=n[r+1],u=n[r+2],c=n[r+3],h=i[a+0],f=i[a+1],d=i[a+2],p=i[a+3];if(c!==p||s!==h||l!==f||u!==d){var m=1-o,v=s*h+l*f+u*d+c*p,g=0<=v?1:-1,y=1-v*v;if(y>ie.default){var _=Math.sqrt(y),x=Math.atan2(_,v*g);m=Math.sin(m*x)/_,o=Math.sin(o*x)/_}var w=o*g;if(s=s*m+h*w,l=l*m+f*w,u=u*m+d*w,c=c*m+p*w,m===1-o){var b=1/Math.sqrt(s*s+l*l+u*u+c*c);s*=b,l*=b,u*=b,c*=b}}e[t]=s,e[t+1]=l,e[t+2]=u,e[t+3]=c}}),(0,u.default)(kn.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._onChangeCallback()}},y:{get:function(){return this._y},set:function(e){this._y=e,this._onChangeCallback()}},z:{get:function(){return this._z},set:function(e){this._z=e,this._onChangeCallback()}},w:{get:function(){return this._w},set:function(e){this._w=e,this._onChangeCallback()}}}),(0,p.default)(kn.prototype,{isQuaternion:!0,set:function(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._w=r,this._onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this},setFromEuler:function(e,t){if(!e||!e.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var n=e._x,r=e._y,i=e._z,a=e.order,o=Math.cos,s=Math.sin,l=o(n/2),u=o(r/2),c=o(i/2),h=s(n/2),f=s(r/2),d=s(i/2);return"XYZ"===a?(this._x=h*u*c+l*f*d,this._y=l*f*c-h*u*d,this._z=l*u*d+h*f*c,this._w=l*u*c-h*f*d):"YXZ"===a?(this._x=h*u*c+l*f*d,this._y=l*f*c-h*u*d,this._z=l*u*d-h*f*c,this._w=l*u*c+h*f*d):"ZXY"===a?(this._x=h*u*c-l*f*d,this._y=l*f*c+h*u*d,this._z=l*u*d+h*f*c,this._w=l*u*c-h*f*d):"ZYX"===a?(this._x=h*u*c-l*f*d,this._y=l*f*c+h*u*d,this._z=l*u*d-h*f*c,this._w=l*u*c+h*f*d):"YZX"===a?(this._x=h*u*c+l*f*d,this._y=l*f*c+h*u*d,this._z=l*u*d-h*f*c,this._w=l*u*c-h*f*d):"XZY"===a&&(this._x=h*u*c-l*f*d,this._y=l*f*c-h*u*d,this._z=l*u*d+h*f*c,this._w=l*u*c+h*f*d),!1!==t&&this._onChangeCallback(),this},setFromAxisAngle:function(e,t){var n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this},setFromRotationMatrix:function(e){var t,n=e.elements,r=n[0],i=n[4],a=n[8],o=n[1],s=n[5],l=n[9],u=n[2],c=n[6],h=n[10],f=r+s+h;return 0<f?(t=.5/Math.sqrt(f+1),this._w=.25/t,this._x=(c-l)*t,this._y=(a-u)*t,this._z=(o-i)*t):s<r&&h<r?(t=2*Math.sqrt(1+r-s-h),this._w=(c-l)/t,this._x=.25*t,this._y=(i+o)/t,this._z=(a+u)/t):h<s?(t=2*Math.sqrt(1+s-r-h),this._w=(a-u)/t,this._x=(i+o)/t,this._y=.25*t,this._z=(l+c)/t):(t=2*Math.sqrt(1+h-r-s),this._w=(o-i)/t,this._x=(a+u)/t,this._y=(l+c)/t,this._z=.25*t),this._onChangeCallback(),this},setFromUnitVectors:function(e,t){var n=1e-6,r=e.dot(t)+1;return r<n?(r=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0):(this._x=0,this._y=-e.z,this._z=e.y)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x),this._w=r,this.normalize()},angleTo:function(e){return 2*Math.acos(Math.abs(Cn.clamp(this.dot(e),-1,1)))},rotateTowards:function(e,t){var n=this.angleTo(e);if(0===n)return this;var r=Math.min(1,t/n);return this.slerp(e,r),this},inverse:function(){return this.conjugate()},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this},dot:function(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this},multiply:function(e,t){return void 0!==t?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)},premultiply:function(e){return this.multiplyQuaternions(e,this)},multiplyQuaternions:function(e,t){var n=e._x,r=e._y,i=e._z,a=e._w,o=t._x,s=t._y,l=t._z,u=t._w;return this._x=n*u+a*o+r*l-i*s,this._y=r*u+a*s+i*o-n*l,this._z=i*u+a*l+n*s-r*o,this._w=a*u-n*o-r*s-i*l,this._onChangeCallback(),this},slerp:function(e,t){if(0===t)return this;if(1===t)return this.copy(e);var n=this._x,r=this._y,i=this._z,a=this._w,o=a*e._w+n*e._x+r*e._y+i*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),1<=o)return this._w=a,this._x=n,this._y=r,this._z=i,this;var s=1-o*o;if(s<=ie.default){var l=1-t;return this._w=l*a+t*this._w,this._x=l*n+t*this._x,this._y=l*r+t*this._y,this._z=l*i+t*this._z,this.normalize(),this._onChangeCallback(),this}var u=Math.sqrt(s),c=Math.atan2(u,o),h=Math.sin((1-t)*c)/u,f=Math.sin(t*c)/u;return this._w=a*h+this._w*f,this._x=n*h+this._x*f,this._y=r*h+this._y*f,this._z=i*h+this._z*f,this._onChangeCallback(),this},equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w},fromArray:function(e,t){return void 0===t&&(t=0),this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e},_onChange:function(e){return this._onChangeCallback=e,this},_onChangeCallback:function(){}}),(0,p.default)(Pn.prototype,{isVector3:!0,set:function(e,t,n){return this.x=e,this.y=t,this.z=n,this},setScalar:function(e){return this.x=e,this.y=e,this.z=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this},add:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)},addScalar:function(e){return this.x+=e,this.y+=e,this.z+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this},sub:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)},subScalar:function(e){return this.x-=e,this.y-=e,this.z-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this},multiply:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)},multiplyScalar:function(e){return this.x*=e,this.y*=e,this.z*=e,this},multiplyVectors:function(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this},applyEuler:(An=new kn,function(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(An.setFromEuler(e))}),applyAxisAngle:(Tn=new kn,function(e,t){return this.applyQuaternion(Tn.setFromAxisAngle(e,t))}),applyMatrix3:function(e){var t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6]*r,this.y=i[1]*t+i[4]*n+i[7]*r,this.z=i[2]*t+i[5]*n+i[8]*r,this},applyMatrix4:function(e){var t=this.x,n=this.y,r=this.z,i=e.elements,a=1/(i[3]*t+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*t+i[4]*n+i[8]*r+i[12])*a,this.y=(i[1]*t+i[5]*n+i[9]*r+i[13])*a,this.z=(i[2]*t+i[6]*n+i[10]*r+i[14])*a,this},applyQuaternion:function(e){var t=this.x,n=this.y,r=this.z,i=e.x,a=e.y,o=e.z,s=e.w,l=s*t+a*r-o*n,u=s*n+o*t-i*r,c=s*r+i*n-a*t,h=-i*t-a*n-o*r;return this.x=l*s+h*-i+u*-o-c*-a,this.y=u*s+h*-a+c*-i-l*-o,this.z=c*s+h*-o+l*-a-u*-i,this},project:function(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)},unproject:function(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)},transformDirection:function(e){var t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[4]*n+i[8]*r,this.y=i[1]*t+i[5]*n+i[9]*r,this.z=i[2]*t+i[6]*n+i[10]*r,this.normalize()},divide:function(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this},divideScalar:function(e){return this.multiplyScalar(1/e)},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this},clamp:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this},clampScalar:function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this},clampLength:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this},lerpVectors:function(e,t,n){return this.subVectors(t,e).multiplyScalar(n).add(e)},cross:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)},crossVectors:function(e,t){var n=e.x,r=e.y,i=e.z,a=t.x,o=t.y,s=t.z;return this.x=r*s-i*o,this.y=i*a-n*s,this.z=n*o-r*a,this},projectOnVector:function(e){var t=e.dot(this)/e.lengthSq();return this.copy(e).multiplyScalar(t)},projectOnPlane:(En=new Pn,function(e){return En.copy(this).projectOnVector(e),this.sub(En)}),reflect:(Sn=new Pn,function(e){return this.sub(Sn.copy(e).multiplyScalar(2*this.dot(e)))}),angleTo:function(e){var t=this.dot(e)/Math.sqrt(this.lengthSq()*e.lengthSq());return Math.acos(Cn.clamp(t,-1,1))},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r},manhattanDistanceTo:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)},setFromSpherical:function(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)},setFromSphericalCoords:function(e,t,n){var r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*Math.cos(n),this},setFromCylindrical:function(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)},setFromCylindricalCoords:function(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this},setFromMatrixPosition:function(e){var t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this},setFromMatrixScale:function(e){var t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,this},setFromMatrixColumn:function(e,t){return this.fromArray(e.elements,4*t)},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e},fromBufferAttribute:function(e,t,n){return void 0!==n&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}}),(0,p.default)(Nn.prototype,{isMatrix3:!0,set:function(e,t,n,r,i,a,o,s,l){var u=this.elements;return u[0]=e,u[1]=r,u[2]=o,u[3]=t,u[4]=i,u[5]=s,u[6]=n,u[7]=a,u[8]=l,this},identity:function(){return this.set(1,0,0,0,1,0,0,0,1),this},clone:function(){return(new this.constructor).fromArray(this.elements)},copy:function(e){var t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this},setFromMatrix4:function(e){var t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this},applyToBufferAttribute:function(e){void 0===Ln&&(Ln=new Pn);for(var t=0,n=e.count;t<n;t++)Ln.x=e.getX(t),Ln.y=e.getY(t),Ln.z=e.getZ(t),Ln.applyMatrix3(this),e.setXYZ(t,Ln.x,Ln.y,Ln.z);return e},multiply:function(e){return this.multiplyMatrices(this,e)},premultiply:function(e){return this.multiplyMatrices(e,this)},multiplyMatrices:function(e,t){var n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[3],s=n[6],l=n[1],u=n[4],c=n[7],h=n[2],f=n[5],d=n[8],p=r[0],m=r[3],v=r[6],g=r[1],y=r[4],_=r[7],x=r[2],w=r[5],b=r[8];return i[0]=a*p+o*g+s*x,i[3]=a*m+o*y+s*w,i[6]=a*v+o*_+s*b,i[1]=l*p+u*g+c*x,i[4]=l*m+u*y+c*w,i[7]=l*v+u*_+c*b,i[2]=h*p+f*g+d*x,i[5]=h*m+f*y+d*w,i[8]=h*v+f*_+d*b,this},multiplyScalar:function(e){var t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this},determinant:function(){var e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],l=e[7],u=e[8];return t*a*u-t*o*l-n*i*u+n*o*s+r*i*l-r*a*s},getInverse:function(e,t){e&&e.isMatrix4&&console.error("THREE.Matrix3: .getInverse() no longer takes a Matrix4 argument.");var n=e.elements,r=this.elements,i=n[0],a=n[1],o=n[2],s=n[3],l=n[4],u=n[5],c=n[6],h=n[7],f=n[8],d=f*l-u*h,p=u*c-f*s,m=h*s-l*c,v=i*d+a*p+o*m;if(0===v){var g="THREE.Matrix3: .getInverse() can't invert matrix, determinant is 0";if(!0===t)throw new Error(g);return console.warn(g),this.identity()}var y=1/v;return r[0]=d*y,r[1]=(o*h-f*a)*y,r[2]=(u*a-o*l)*y,r[3]=p*y,r[4]=(f*i-o*c)*y,r[5]=(o*s-u*i)*y,r[6]=m*y,r[7]=(a*c-h*i)*y,r[8]=(l*i-a*s)*y,this},transpose:function(){var e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this},getNormalMatrix:function(e){return this.setFromMatrix4(e).getInverse(this).transpose()},transposeIntoArray:function(e){var t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this},setUvTransform:function(e,t,n,r,i,a,o){var s=Math.cos(i),l=Math.sin(i);this.set(n*s,n*l,-n*(s*a+l*o)+a+e,-r*l,r*s,-r*(-l*a+s*o)+o+t,0,0,1)},scale:function(e,t){var n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=t,n[4]*=t,n[7]*=t,this},rotate:function(e){var t=Math.cos(e),n=Math.sin(e),r=this.elements,i=r[0],a=r[3],o=r[6],s=r[1],l=r[4],u=r[7];return r[0]=t*i+n*s,r[3]=t*a+n*l,r[6]=t*o+n*u,r[1]=-n*i+t*s,r[4]=-n*a+t*l,r[7]=-n*o+t*u,this},translate:function(e,t){var n=this.elements;return n[0]+=e*n[2],n[3]+=e*n[5],n[6]+=e*n[8],n[1]+=t*n[2],n[4]+=t*n[5],n[7]+=t*n[8],this},equals:function(e){for(var t=this.elements,n=e.elements,r=0;r<9;r++)if(t[r]!==n[r])return!1;return!0},fromArray:function(e,t){void 0===t&&(t=0);for(var n=0;n<9;n++)this.elements[n]=e[n+t];return this},toArray:function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);var n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}});var Dn={getDataURL:function(e){var t;if("undefined"==typeof HTMLCanvasElement)return e.src;if(e instanceof HTMLCanvasElement)t=e;else{void 0===Rn&&(Rn=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),Rn.width=e.width,Rn.height=e.height;var n=Rn.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=Rn}return 2048<t.width||2048<t.height?t.toDataURL("image/jpeg",.6):t.toDataURL("image/png")}};t.ImageUtils=Dn;var On,Fn,Bn,Un,Gn,zn,Vn,Hn,Wn,jn,Yn,qn=0;function Xn(e,t,n,r,i,a,o,s,l,u){(0,g.default)(this,"id",{value:qn++}),this.uuid=Cn.generateUUID(),this.name="",this.image=void 0!==e?e:Xn.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==t?t:Xn.DEFAULT_MAPPING,this.wrapS=void 0!==n?n:ke,this.wrapT=void 0!==r?r:ke,this.magFilter=void 0!==i?i:Ve,this.minFilter=void 0!==a?a:je,this.anisotropy=void 0!==l?l:1,this.format=void 0!==o?o:st,this.type=void 0!==s?s:qe,this.offset=new In(0,0),this.repeat=new In(1,1),this.center=new In(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Nn,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==u?u:Zt,this.version=0,this.onUpdate=null}function Zn(e,t,n,r){this.x=e||0,this.y=t||0,this.z=n||0,this.w=void 0!==r?r:1}function Jn(e,t,n){this.width=e,this.height=t,this.scissor=new Zn(0,0,e,t),this.scissorTest=!1,this.viewport=new Zn(0,0,e,t),n=n||{},this.texture=new Xn(void 0,void 0,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.texture.image={},this.texture.image.width=e,this.texture.image.height=t,this.texture.generateMipmaps=void 0!==n.generateMipmaps&&n.generateMipmaps,this.texture.minFilter=void 0!==n.minFilter?n.minFilter:Ve,this.depthBuffer=void 0===n.depthBuffer||n.depthBuffer,this.stencilBuffer=void 0===n.stencilBuffer||n.stencilBuffer,this.depthTexture=void 0!==n.depthTexture?n.depthTexture:null}function Kn(e,t,n){Jn.call(this,e,t,n),this.samples=4}function Qn(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],0<arguments.length&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}function $n(e,t,n,r){this._x=e||0,this._y=t||0,this._z=n||0,this._order=r||$n.DefaultOrder}function er(){this.mask=1}Xn.DEFAULT_IMAGE=void 0,Xn.DEFAULT_MAPPING=ne,Xn.prototype=(0,p.default)((0,l.default)(c.prototype),{constructor:Xn,isTexture:!0,updateMatrix:function(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.name=e.name,this.image=e.image,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this},toJSON:function(e){var t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];var n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(void 0!==this.image){var r=this.image;if(void 0===r.uuid&&(r.uuid=Cn.generateUUID()),!t&&void 0===e.images[r.uuid]){var i;if((0,Ue.default)(r)){i=[];for(var a=0,o=r.length;a<o;a++)i.push(Dn.getDataURL(r[a]))}else i=Dn.getDataURL(r);e.images[r.uuid]={uuid:r.uuid,url:i}}n.image=r.uuid}return t||(e.textures[this.uuid]=n),n},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(e){if(this.mapping!==ne)return e;if(e.applyMatrix3(this.matrix),e.x<0||1<e.x)switch(this.wrapS){case Ie:e.x=e.x-Math.floor(e.x);break;case ke:e.x=e.x<0?0:1;break;case Pe:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||1<e.y)switch(this.wrapT){case Ie:e.y=e.y-Math.floor(e.y);break;case ke:e.y=e.y<0?0:1;break;case Pe:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}}),(0,g.default)(Xn.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),(0,u.default)(Zn.prototype,{width:{get:function(){return this.z},set:function(e){this.z=e}},height:{get:function(){return this.w},set:function(e){this.w=e}}}),(0,p.default)(Zn.prototype,{isVector4:!0,set:function(e,t,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,this},setScalar:function(e){return this.x=e,this.y=e,this.z=e,this.w=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setW:function(e){return this.w=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this},add:function(e,t){return void 0!==t?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)},addScalar:function(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this},sub:function(e,t){return void 0!==t?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)},subScalar:function(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this},multiplyScalar:function(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this},applyMatrix4:function(e){var t=this.x,n=this.y,r=this.z,i=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*r+a[12]*i,this.y=a[1]*t+a[5]*n+a[9]*r+a[13]*i,this.z=a[2]*t+a[6]*n+a[10]*r+a[14]*i,this.w=a[3]*t+a[7]*n+a[11]*r+a[15]*i,this},divideScalar:function(e){return this.multiplyScalar(1/e)},setAxisAngleFromQuaternion:function(e){this.w=2*Math.acos(e.w);var t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this},setAxisAngleFromRotationMatrix:function(e){var t,n,r,i,a=.01,o=.1,s=e.elements,l=s[0],u=s[4],c=s[8],h=s[1],f=s[5],d=s[9],p=s[2],m=s[6],v=s[10];if(Math.abs(u-h)<a&&Math.abs(c-p)<a&&Math.abs(d-m)<a){if(Math.abs(u+h)<o&&Math.abs(c+p)<o&&Math.abs(d+m)<o&&Math.abs(l+f+v-3)<o)return this.set(1,0,0,0),this;t=Math.PI;var g=(l+1)/2,y=(f+1)/2,_=(v+1)/2,x=(u+h)/4,w=(c+p)/4,b=(d+m)/4;return y<g&&_<g?i=g<a?(n=0,r=.707106781,.707106781):(n=Math.sqrt(g),r=x/n,w/n):_<y?i=y<a?(n=.707106781,r=0,.707106781):(r=Math.sqrt(y),n=x/r,b/r):_<a?(n=.707106781,r=.707106781,i=0):(i=Math.sqrt(_),n=w/i,r=b/i),this.set(n,r,i,t),this}var M=Math.sqrt((m-d)*(m-d)+(c-p)*(c-p)+(h-u)*(h-u));return Math.abs(M)<.001&&(M=1),this.x=(m-d)/M,this.y=(c-p)/M,this.z=(h-u)/M,this.w=Math.acos((l+f+v-1)/2),this},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this},clamp:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this},clampScalar:function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this},clampLength:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this},lerpVectors:function(e,t,n){return this.subVectors(t,e).multiplyScalar(n).add(e)},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e},fromBufferAttribute:function(e,t,n){return void 0!==n&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}}),Jn.prototype=(0,p.default)((0,l.default)(c.prototype),{constructor:Jn,isWebGLRenderTarget:!0,setSize:function(e,t){this.width===e&&this.height===t||(this.width=e,this.height=t,this.texture.image.width=e,this.texture.image.height=t,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.width=e.width,this.height=e.height,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Kn.prototype=(0,p.default)((0,l.default)(Jn.prototype),{constructor:Kn,isWebGLMultisampleRenderTarget:!0,copy:function(e){return Jn.prototype.copy.call(this,e),this.samples=e.samples,this}}),(0,p.default)(Qn.prototype,{isMatrix4:!0,set:function(e,t,n,r,i,a,o,s,l,u,c,h,f,d,p,m){var v=this.elements;return v[0]=e,v[4]=t,v[8]=n,v[12]=r,v[1]=i,v[5]=a,v[9]=o,v[13]=s,v[2]=l,v[6]=u,v[10]=c,v[14]=h,v[3]=f,v[7]=d,v[11]=p,v[15]=m,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},clone:function(){return(new Qn).fromArray(this.elements)},copy:function(e){var t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this},copyPosition:function(e){var t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this},extractBasis:function(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this},makeBasis:function(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this},extractRotation:(Wn=new Pn,function(e){var t=this.elements,n=e.elements,r=1/Wn.setFromMatrixColumn(e,0).length(),i=1/Wn.setFromMatrixColumn(e,1).length(),a=1/Wn.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=0,t[4]=n[4]*i,t[5]=n[5]*i,t[6]=n[6]*i,t[7]=0,t[8]=n[8]*a,t[9]=n[9]*a,t[10]=n[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}),makeRotationFromEuler:function(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var t=this.elements,n=e.x,r=e.y,i=e.z,a=Math.cos(n),o=Math.sin(n),s=Math.cos(r),l=Math.sin(r),u=Math.cos(i),c=Math.sin(i);if("XYZ"===e.order){var h=a*u,f=a*c,d=o*u,p=o*c;t[0]=s*u,t[4]=-s*c,t[8]=l,t[1]=f+d*l,t[5]=h-p*l,t[9]=-o*s,t[2]=p-h*l,t[6]=d+f*l,t[10]=a*s}else if("YXZ"===e.order){var m=s*u,v=s*c,g=l*u,y=l*c;t[0]=m+y*o,t[4]=g*o-v,t[8]=a*l,t[1]=a*c,t[5]=a*u,t[9]=-o,t[2]=v*o-g,t[6]=y+m*o,t[10]=a*s}else if("ZXY"===e.order)m=s*u,v=s*c,g=l*u,y=l*c,t[0]=m-y*o,t[4]=-a*c,t[8]=g+v*o,t[1]=v+g*o,t[5]=a*u,t[9]=y-m*o,t[2]=-a*l,t[6]=o,t[10]=a*s;else if("ZYX"===e.order)h=a*u,f=a*c,d=o*u,p=o*c,t[0]=s*u,t[4]=d*l-f,t[8]=h*l+p,t[1]=s*c,t[5]=p*l+h,t[9]=f*l-d,t[2]=-l,t[6]=o*s,t[10]=a*s;else if("YZX"===e.order){var _=a*s,x=a*l,w=o*s,b=o*l;t[0]=s*u,t[4]=b-_*c,t[8]=w*c+x,t[1]=c,t[5]=a*u,t[9]=-o*u,t[2]=-l*u,t[6]=x*c+w,t[10]=_-b*c}else"XZY"===e.order&&(_=a*s,x=a*l,w=o*s,b=o*l,t[0]=s*u,t[4]=-c,t[8]=l*u,t[1]=_*c+b,t[5]=a*u,t[9]=x*c-w,t[2]=w*c-x,t[6]=o*u,t[10]=b*c+_);return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},makeRotationFromQuaternion:(Vn=new Pn(0,0,0),Hn=new Pn(1,1,1),function(e){return this.compose(Vn,e,Hn)}),lookAt:(Un=new Pn,Gn=new Pn,zn=new Pn,function(e,t,n){var r=this.elements;return zn.subVectors(e,t),0===zn.lengthSq()&&(zn.z=1),zn.normalize(),Un.crossVectors(n,zn),0===Un.lengthSq()&&(1===Math.abs(n.z)?zn.x+=1e-4:zn.z+=1e-4,zn.normalize(),Un.crossVectors(n,zn)),Un.normalize(),Gn.crossVectors(zn,Un),r[0]=Un.x,r[4]=Gn.x,r[8]=zn.x,r[1]=Un.y,r[5]=Gn.y,r[9]=zn.y,r[2]=Un.z,r[6]=Gn.z,r[10]=zn.z,this}),multiply:function(e,t){return void 0!==t?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)},premultiply:function(e){return this.multiplyMatrices(e,this)},multiplyMatrices:function(e,t){var n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[4],s=n[8],l=n[12],u=n[1],c=n[5],h=n[9],f=n[13],d=n[2],p=n[6],m=n[10],v=n[14],g=n[3],y=n[7],_=n[11],x=n[15],w=r[0],b=r[4],M=r[8],S=r[12],E=r[1],T=r[5],A=r[9],L=r[13],R=r[2],C=r[6],I=r[10],k=r[14],P=r[3],N=r[7],D=r[11],O=r[15];return i[0]=a*w+o*E+s*R+l*P,i[4]=a*b+o*T+s*C+l*N,i[8]=a*M+o*A+s*I+l*D,i[12]=a*S+o*L+s*k+l*O,i[1]=u*w+c*E+h*R+f*P,i[5]=u*b+c*T+h*C+f*N,i[9]=u*M+c*A+h*I+f*D,i[13]=u*S+c*L+h*k+f*O,i[2]=d*w+p*E+m*R+v*P,i[6]=d*b+p*T+m*C+v*N,i[10]=d*M+p*A+m*I+v*D,i[14]=d*S+p*L+m*k+v*O,i[3]=g*w+y*E+_*R+x*P,i[7]=g*b+y*T+_*C+x*N,i[11]=g*M+y*A+_*I+x*D,i[15]=g*S+y*L+_*k+x*O,this},multiplyScalar:function(e){var t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this},applyToBufferAttribute:(Bn=new Pn,function(e){for(var t=0,n=e.count;t<n;t++)Bn.x=e.getX(t),Bn.y=e.getY(t),Bn.z=e.getZ(t),Bn.applyMatrix4(this),e.setXYZ(t,Bn.x,Bn.y,Bn.z);return e}),determinant:function(){var e=this.elements,t=e[0],n=e[4],r=e[8],i=e[12],a=e[1],o=e[5],s=e[9],l=e[13],u=e[2],c=e[6],h=e[10],f=e[14],d=e[3],p=e[7],m=e[11],v=e[15];return d*(i*s*c-r*l*c-i*o*h+n*l*h+r*o*f-n*s*f)+p*(t*s*f-t*l*h+i*a*h-r*a*f+r*l*u-i*s*u)+m*(t*l*c-t*o*f-i*a*c+n*a*f+i*o*u-n*l*u)+v*(-r*o*u-t*s*c+t*o*h+r*a*c-n*a*h+n*s*u)},transpose:function(){var e,t=this.elements;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this},setPosition:function(e,t,n){var r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=n),this},getInverse:function(e,t){var n=this.elements,r=e.elements,i=r[0],a=r[1],o=r[2],s=r[3],l=r[4],u=r[5],c=r[6],h=r[7],f=r[8],d=r[9],p=r[10],m=r[11],v=r[12],g=r[13],y=r[14],_=r[15],x=d*y*h-g*p*h+g*c*m-u*y*m-d*c*_+u*p*_,w=v*p*h-f*y*h-v*c*m+l*y*m+f*c*_-l*p*_,b=f*g*h-v*d*h+v*u*m-l*g*m-f*u*_+l*d*_,M=v*d*c-f*g*c-v*u*p+l*g*p+f*u*y-l*d*y,S=i*x+a*w+o*b+s*M;if(0===S){var E="THREE.Matrix4: .getInverse() can't invert matrix, determinant is 0";if(!0===t)throw new Error(E);return console.warn(E),this.identity()}var T=1/S;return n[0]=x*T,n[1]=(g*p*s-d*y*s-g*o*m+a*y*m+d*o*_-a*p*_)*T,n[2]=(u*y*s-g*c*s+g*o*h-a*y*h-u*o*_+a*c*_)*T,n[3]=(d*c*s-u*p*s-d*o*h+a*p*h+u*o*m-a*c*m)*T,n[4]=w*T,n[5]=(f*y*s-v*p*s+v*o*m-i*y*m-f*o*_+i*p*_)*T,n[6]=(v*c*s-l*y*s-v*o*h+i*y*h+l*o*_-i*c*_)*T,n[7]=(l*p*s-f*c*s+f*o*h-i*p*h-l*o*m+i*c*m)*T,n[8]=b*T,n[9]=(v*d*s-f*g*s-v*a*m+i*g*m+f*a*_-i*d*_)*T,n[10]=(l*g*s-v*u*s+v*a*h-i*g*h-l*a*_+i*u*_)*T,n[11]=(f*u*s-l*d*s-f*a*h+i*d*h+l*a*m-i*u*m)*T,n[12]=M*T,n[13]=(f*g*o-v*d*o+v*a*p-i*g*p-f*a*y+i*d*y)*T,n[14]=(v*u*o-l*g*o-v*a*c+i*g*c+l*a*y-i*u*y)*T,n[15]=(l*d*o-f*u*o+f*a*c-i*d*c-l*a*p+i*u*p)*T,this},scale:function(e){var t=this.elements,n=e.x,r=e.y,i=e.z;return t[0]*=n,t[4]*=r,t[8]*=i,t[1]*=n,t[5]*=r,t[9]*=i,t[2]*=n,t[6]*=r,t[10]*=i,t[3]*=n,t[7]*=r,t[11]*=i,this},getMaxScaleOnAxis:function(){var e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))},makeTranslation:function(e,t,n){return this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this},makeRotationX:function(e){var t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this},makeRotationY:function(e){var t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this},makeRotationZ:function(e){var t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(e,t){var n=Math.cos(t),r=Math.sin(t),i=1-n,a=e.x,o=e.y,s=e.z,l=i*a,u=i*o;return this.set(l*a+n,l*o-r*s,l*s+r*o,0,l*o+r*s,u*o+n,u*s-r*a,0,l*s-r*o,u*s+r*a,i*s*s+n,0,0,0,0,1),this},makeScale:function(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this},makeShear:function(e,t,n){return this.set(1,t,n,0,e,1,n,0,e,t,1,0,0,0,0,1),this},compose:function(e,t,n){var r=this.elements,i=t._x,a=t._y,o=t._z,s=t._w,l=i+i,u=a+a,c=o+o,h=i*l,f=i*u,d=i*c,p=a*u,m=a*c,v=o*c,g=s*l,y=s*u,_=s*c,x=n.x,w=n.y,b=n.z;return r[0]=(1-(p+v))*x,r[1]=(f+_)*x,r[2]=(d-y)*x,r[3]=0,r[4]=(f-_)*w,r[5]=(1-(h+v))*w,r[6]=(m+g)*w,r[7]=0,r[8]=(d+y)*b,r[9]=(m-g)*b,r[10]=(1-(h+p))*b,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this},decompose:(On=new Pn,Fn=new Qn,function(e,t,n){var r=this.elements,i=On.set(r[0],r[1],r[2]).length(),a=On.set(r[4],r[5],r[6]).length(),o=On.set(r[8],r[9],r[10]).length(),s=this.determinant();s<0&&(i=-i),e.x=r[12],e.y=r[13],e.z=r[14],Fn.copy(this);var l=1/i,u=1/a,c=1/o;return Fn.elements[0]*=l,Fn.elements[1]*=l,Fn.elements[2]*=l,Fn.elements[4]*=u,Fn.elements[5]*=u,Fn.elements[6]*=u,Fn.elements[8]*=c,Fn.elements[9]*=c,Fn.elements[10]*=c,t.setFromRotationMatrix(Fn),n.x=i,n.y=a,n.z=o,this}),makePerspective:function(e,t,n,r,i,a){void 0===a&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");var o=this.elements,s=2*i/(t-e),l=2*i/(n-r),u=(t+e)/(t-e),c=(n+r)/(n-r),h=-(a+i)/(a-i),f=-2*a*i/(a-i);return o[0]=s,o[4]=0,o[8]=u,o[12]=0,o[1]=0,o[5]=l,o[9]=c,o[13]=0,o[2]=0,o[6]=0,o[10]=h,o[14]=f,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this},makeOrthographic:function(e,t,n,r,i,a){var o=this.elements,s=1/(t-e),l=1/(n-r),u=1/(a-i),c=(t+e)*s,h=(n+r)*l,f=(a+i)*u;return o[0]=2*s,o[4]=0,o[8]=0,o[12]=-c,o[1]=0,o[5]=2*l,o[9]=0,o[13]=-h,o[2]=0,o[6]=0,o[10]=-2*u,o[14]=-f,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this},equals:function(e){for(var t=this.elements,n=e.elements,r=0;r<16;r++)if(t[r]!==n[r])return!1;return!0},fromArray:function(e,t){void 0===t&&(t=0);for(var n=0;n<16;n++)this.elements[n]=e[n+t];return this},toArray:function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);var n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}}),$n.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],$n.DefaultOrder="XYZ",(0,u.default)($n.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._onChangeCallback()}},y:{get:function(){return this._y},set:function(e){this._y=e,this._onChangeCallback()}},z:{get:function(){return this._z},set:function(e){this._z=e,this._onChangeCallback()}},order:{get:function(){return this._order},set:function(e){this._order=e,this._onChangeCallback()}}}),(0,p.default)($n.prototype,{isEuler:!0,set:function(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._order=r||this._order,this._onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this},setFromRotationMatrix:function(e,t,n){var r=Cn.clamp,i=e.elements,a=i[0],o=i[4],s=i[8],l=i[1],u=i[5],c=i[9],h=i[2],f=i[6],d=i[10];return t=t||this._order,"XYZ"===t?(this._y=Math.asin(r(s,-1,1)),Math.abs(s)<.99999?(this._x=Math.atan2(-c,d),this._z=Math.atan2(-o,a)):(this._x=Math.atan2(f,u),this._z=0)):"YXZ"===t?(this._x=Math.asin(-r(c,-1,1)),Math.abs(c)<.99999?(this._y=Math.atan2(s,d),this._z=Math.atan2(l,u)):(this._y=Math.atan2(-h,a),this._z=0)):"ZXY"===t?(this._x=Math.asin(r(f,-1,1)),Math.abs(f)<.99999?(this._y=Math.atan2(-h,d),this._z=Math.atan2(-o,u)):(this._y=0,this._z=Math.atan2(l,a))):"ZYX"===t?(this._y=Math.asin(-r(h,-1,1)),Math.abs(h)<.99999?(this._x=Math.atan2(f,d),this._z=Math.atan2(l,a)):(this._x=0,this._z=Math.atan2(-o,u))):"YZX"===t?(this._z=Math.asin(r(l,-1,1)),Math.abs(l)<.99999?(this._x=Math.atan2(-c,u),this._y=Math.atan2(-h,a)):(this._x=0,this._y=Math.atan2(s,d))):"XZY"===t?(this._z=Math.asin(-r(o,-1,1)),Math.abs(o)<.99999?(this._x=Math.atan2(f,u),this._y=Math.atan2(s,a)):(this._x=Math.atan2(-c,d),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+t),this._order=t,!1!==n&&this._onChangeCallback(),this},setFromQuaternion:function(e,t,n){return void 0===jn&&(jn=new Qn),jn.makeRotationFromQuaternion(e),this.setFromRotationMatrix(jn,t,n)},setFromVector3:function(e,t){return this.set(e.x,e.y,e.z,t||this._order)},reorder:function(e){return void 0===Yn&&(Yn=new kn),Yn.setFromEuler(this),this.setFromQuaternion(Yn,e)},equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order},fromArray:function(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this._onChangeCallback(),this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e},toVector3:function(e){return e?e.set(this._x,this._y,this._z):new Pn(this._x,this._y,this._z)},_onChange:function(e){return this._onChangeCallback=e,this},_onChangeCallback:function(){}}),(0,p.default)(er.prototype,{set:function(e){this.mask=1<<e|0},enable:function(e){this.mask|=1<<e|0},toggle:function(e){this.mask^=1<<e|0},disable:function(e){this.mask&=~(1<<e|0)},test:function(e){return 0!=(this.mask&e.mask)}});var tr,nr,rr,ir,ar,or,sr,lr,ur,cr,hr,fr,dr,pr,mr,vr,gr,yr,_r,xr,wr,br,Mr,Sr,Er,Tr,Ar,Lr,Rr,Cr,Ir,kr,Pr,Nr,Dr,Or,Fr,Br,Ur,Gr,zr,Vr,Hr,Wr,jr,Yr,qr,Xr,Zr,Jr,Kr,Qr,$r,ei,ti,ni,ri,ii,ai,oi,si,li,ui,ci,hi,fi,di=0;function pi(){(0,g.default)(this,"id",{value:di++}),this.uuid=Cn.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=pi.DefaultUp.clone();var e=new Pn,t=new $n,n=new kn,r=new Pn(1,1,1);function i(){n.setFromEuler(t,!1)}function a(){t.setFromQuaternion(n,void 0,!1)}t._onChange(i),n._onChange(a),(0,u.default)(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new Qn},normalMatrix:{value:new Nn}}),this.matrix=new Qn,this.matrixWorld=new Qn,this.matrixAutoUpdate=pi.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new er,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}}function mi(){pi.call(this),this.type="Scene",this.background=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}function vi(e,t){this.min=void 0!==e?e:new Pn(1/0,1/0,1/0),this.max=void 0!==t?t:new Pn(-1/0,-1/0,-1/0)}function gi(e){var t,n;for(t=0,n=e.length-3;t<=n;t+=3){Rr.fromArray(e,t);var r=Ir.x*Math.abs(Rr.x)+Ir.y*Math.abs(Rr.y)+Ir.z*Math.abs(Rr.z),i=Mr.dot(Rr),a=Sr.dot(Rr),o=Er.dot(Rr);if(Math.max(-Math.max(i,a,o),Math.min(i,a,o))>r)return!1}return!0}function yi(e){var t=e.geometry;if(void 0!==t)if(t.isGeometry){var n=t.vertices;for(Dr=0,Or=n.length;Dr<Or;Dr++)Fr.copy(n[Dr]),Fr.applyMatrix4(e.matrixWorld),Nr.expandByPoint(Fr)}else if(t.isBufferGeometry){var r=t.attributes.position;if(void 0!==r)for(Dr=0,Or=r.count;Dr<Or;Dr++)Fr.fromBufferAttribute(r,Dr).applyMatrix4(e.matrixWorld),Nr.expandByPoint(Fr)}}function _i(e,t){this.center=void 0!==e?e:new Pn,this.radius=void 0!==t?t:0}function xi(e,t){this.origin=void 0!==e?e:new Pn,this.direction=void 0!==t?t:new Pn}function wi(e,t,n){this.a=void 0!==e?e:new Pn,this.b=void 0!==t?t:new Pn,this.c=void 0!==n?n:new Pn}pi.DefaultUp=new Pn(0,1,0),pi.DefaultMatrixAutoUpdate=!0,pi.prototype=(0,p.default)((0,l.default)(c.prototype),{constructor:pi,isObject3D:!0,onBeforeRender:function(){},onAfterRender:function(){},applyMatrix:function(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)},applyQuaternion:function(e){return this.quaternion.premultiply(e),this},setRotationFromAxisAngle:function(e,t){this.quaternion.setFromAxisAngle(e,t)},setRotationFromEuler:function(e){this.quaternion.setFromEuler(e,!0)},setRotationFromMatrix:function(e){this.quaternion.setFromRotationMatrix(e)},setRotationFromQuaternion:function(e){this.quaternion.copy(e)},rotateOnAxis:(_r=new kn,function(e,t){return _r.setFromAxisAngle(e,t),this.quaternion.multiply(_r),this}),rotateOnWorldAxis:(yr=new kn,function(e,t){return yr.setFromAxisAngle(e,t),this.quaternion.premultiply(yr),this}),rotateX:(gr=new Pn(1,0,0),function(e){return this.rotateOnAxis(gr,e)}),rotateY:(vr=new Pn(0,1,0),function(e){return this.rotateOnAxis(vr,e)}),rotateZ:(mr=new Pn(0,0,1),function(e){return this.rotateOnAxis(mr,e)}),translateOnAxis:(pr=new Pn,function(e,t){return pr.copy(e).applyQuaternion(this.quaternion),this.position.add(pr.multiplyScalar(t)),this}),translateX:(dr=new Pn(1,0,0),function(e){return this.translateOnAxis(dr,e)}),translateY:(fr=new Pn(0,1,0),function(e){return this.translateOnAxis(fr,e)}),translateZ:(hr=new Pn(0,0,1),function(e){return this.translateOnAxis(hr,e)}),localToWorld:function(e){return e.applyMatrix4(this.matrixWorld)},worldToLocal:(cr=new Qn,function(e){return e.applyMatrix4(cr.getInverse(this.matrixWorld))}),lookAt:(or=new kn,sr=new Qn,lr=new Pn,ur=new Pn,function(e,t,n){e.isVector3?lr.copy(e):lr.set(e,t,n);var r=this.parent;this.updateWorldMatrix(!0,!1),ur.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?sr.lookAt(ur,lr,this.up):sr.lookAt(lr,ur,this.up),this.quaternion.setFromRotationMatrix(sr),r&&(sr.extractRotation(r.matrixWorld),or.setFromRotationMatrix(sr),this.quaternion.premultiply(or.inverse()))}),add:function(e){if(1<arguments.length){for(var t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?console.error("THREE.Object3D.add: object can't be added as a child of itself.",e):e&&e.isObject3D?(null!==e.parent&&e.parent.remove(e),e.parent=this,this.children.push(e),e.dispatchEvent({type:"added"})):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this},remove:function(e){if(1<arguments.length){for(var t=0;t<arguments.length;t++)this.remove(arguments[t]);return this}var n=this.children.indexOf(e);return-1!==n&&(e.parent=null,this.children.splice(n,1),e.dispatchEvent({type:"removed"})),this},attach:(ar=new Qn,function(e){return this.updateWorldMatrix(!0,!1),ar.getInverse(this.matrixWorld),null!==e.parent&&(e.parent.updateWorldMatrix(!0,!1),ar.multiply(e.parent.matrixWorld)),e.applyMatrix(ar),e.updateWorldMatrix(!1,!1),this.add(e),this}),getObjectById:function(e){return this.getObjectByProperty("id",e)},getObjectByName:function(e){return this.getObjectByProperty("name",e)},getObjectByProperty:function(e,t){if(this[e]===t)return this;for(var n=0,r=this.children.length;n<r;n++){var i=this.children[n],a=i.getObjectByProperty(e,t);if(void 0!==a)return a}},getWorldPosition:function(e){return void 0===e&&(console.warn("THREE.Object3D: .getWorldPosition() target is now required"),e=new Pn),this.updateMatrixWorld(!0),e.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:(rr=new Pn,ir=new Pn,function(e){return void 0===e&&(console.warn("THREE.Object3D: .getWorldQuaternion() target is now required"),e=new kn),this.updateMatrixWorld(!0),this.matrixWorld.decompose(rr,e,ir),e}),getWorldScale:(tr=new Pn,nr=new kn,function(e){return void 0===e&&(console.warn("THREE.Object3D: .getWorldScale() target is now required"),e=new Pn),this.updateMatrixWorld(!0),this.matrixWorld.decompose(tr,nr,e),e}),getWorldDirection:function(e){void 0===e&&(console.warn("THREE.Object3D: .getWorldDirection() target is now required"),e=new Pn),this.updateMatrixWorld(!0);var t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()},raycast:function(){},traverse:function(e){e(this);for(var t=this.children,n=0,r=t.length;n<r;n++)t[n].traverse(e)},traverseVisible:function(e){if(!1!==this.visible){e(this);for(var t=this.children,n=0,r=t.length;n<r;n++)t[n].traverseVisible(e)}},traverseAncestors:function(e){var t=this.parent;null!==t&&(e(t),t.traverseAncestors(e))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,e=!0);for(var t=this.children,n=0,r=t.length;n<r;n++)t[n].updateMatrixWorld(e)},updateWorldMatrix:function(e,t){var n=this.parent;if(!0===e&&null!==n&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===t)for(var r=this.children,i=0,a=r.length;i<a;i++)r[i].updateWorldMatrix(!1,!0)},toJSON:function(n){var e=void 0===n||"string"==typeof n,t={};e&&(n={geometries:{},materials:{},textures:{},images:{},shapes:{}},t.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});var r={};function i(e,t){return void 0===e[t.uuid]&&(e[t.uuid]=t.toJSON(n)),t.uuid}if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),!0===this.castShadow&&(r.castShadow=!0),!0===this.receiveShadow&&(r.receiveShadow=!0),!1===this.visible&&(r.visible=!1),!1===this.frustumCulled&&(r.frustumCulled=!1),0!==this.renderOrder&&(r.renderOrder=this.renderOrder),"{}"!==(0,v.default)(this.userData)&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),!1===this.matrixAutoUpdate&&(r.matrixAutoUpdate=!1),this.isMesh&&this.drawMode!==Yt&&(r.drawMode=this.drawMode),this.isMesh||this.isLine||this.isPoints){r.geometry=i(n.geometries,this.geometry);var a=this.geometry.parameters;if(void 0!==a&&void 0!==a.shapes){var o=a.shapes;if((0,Ue.default)(o))for(var s=0,l=o.length;s<l;s++){var u=o[s];i(n.shapes,u)}else i(n.shapes,o)}}if(void 0!==this.material)if((0,Ue.default)(this.material)){var c=[];for(s=0,l=this.material.length;s<l;s++)c.push(i(n.materials,this.material[s]));r.material=c}else r.material=i(n.materials,this.material);if(0<this.children.length)for(r.children=[],s=0;s<this.children.length;s++)r.children.push(this.children[s].toJSON(n).object);if(e){var h=m(n.geometries),f=m(n.materials),d=m(n.textures),p=m(n.images);o=m(n.shapes),0<h.length&&(t.geometries=h),0<f.length&&(t.materials=f),0<d.length&&(t.textures=d),0<p.length&&(t.images=p),0<o.length&&(t.shapes=o)}return t.object=r,t;function m(e){var t=[];for(var n in e){var r=e[n];delete r.metadata,t.push(r)}return t}},clone:function(e){return(new this.constructor).copy(this,e)},copy:function(e,t){if(void 0===t&&(t=!0),this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse((0,v.default)(e.userData)),!0===t)for(var n=0;n<e.children.length;n++){var r=e.children[n];this.add(r.clone())}return this}}),mi.prototype=(0,p.default)((0,l.default)(pi.prototype),{constructor:mi,isScene:!0,copy:function(e,t){return pi.prototype.copy.call(this,e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.fog&&(this.fog=e.fog.clone()),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this},toJSON:function(e){var t=pi.prototype.toJSON.call(this,e);return null!==this.background&&(t.object.background=this.background.toJSON(e)),null!==this.fog&&(t.object.fog=this.fog.toJSON()),t},dispose:function(){this.dispatchEvent({type:"dispose"})}}),(0,p.default)(vi.prototype,{isBox3:!0,set:function(e,t){return this.min.copy(e),this.max.copy(t),this},setFromArray:function(e){for(var t=1/0,n=1/0,r=1/0,i=-1/0,a=-1/0,o=-1/0,s=0,l=e.length;s<l;s+=3){var u=e[s],c=e[s+1],h=e[s+2];u<t&&(t=u),c<n&&(n=c),h<r&&(r=h),i<u&&(i=u),a<c&&(a=c),o<h&&(o=h)}return this.min.set(t,n,r),this.max.set(i,a,o),this},setFromBufferAttribute:function(e){for(var t=1/0,n=1/0,r=1/0,i=-1/0,a=-1/0,o=-1/0,s=0,l=e.count;s<l;s++){var u=e.getX(s),c=e.getY(s),h=e.getZ(s);u<t&&(t=u),c<n&&(n=c),h<r&&(r=h),i<u&&(i=u),a<c&&(a=c),o<h&&(o=h)}return this.min.set(t,n,r),this.max.set(i,a,o),this},setFromPoints:function(e){this.makeEmpty();for(var t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this},setFromCenterAndSize:(Br=new Pn,function(e,t){var n=Br.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}),setFromObject:function(e){return this.makeEmpty(),this.expandByObject(e)},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.min.copy(e.min),this.max.copy(e.max),this},makeEmpty:function(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z},getCenter:function(e){return void 0===e&&(console.warn("THREE.Box3: .getCenter() target is now required"),e=new Pn),this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(e){return void 0===e&&(console.warn("THREE.Box3: .getSize() target is now required"),e=new Pn),this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)},expandByPoint:function(e){return this.min.min(e),this.max.max(e),this},expandByVector:function(e){return this.min.sub(e),this.max.add(e),this},expandByScalar:function(e){return this.min.addScalar(-e),this.max.addScalar(e),this},expandByObject:(Fr=new Pn,function(e){return Nr=this,e.updateMatrixWorld(!0),e.traverse(yi),this}),containsPoint:function(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.max.z)},containsBox:function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z},getParameter:function(e,t){return void 0===t&&(console.warn("THREE.Box3: .getParameter() target is now required"),t=new Pn),t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z)},intersectsSphere:(Pr=new Pn,function(e){return this.clampPoint(e.center,Pr),Pr.distanceToSquared(e.center)<=e.radius*e.radius}),intersectsPlane:function(e){var t,n;return n=0<e.normal.x?(t=e.normal.x*this.min.x,e.normal.x*this.max.x):(t=e.normal.x*this.max.x,e.normal.x*this.min.x),0<e.normal.y?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),0<e.normal.z?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant},intersectsTriangle:(Mr=new Pn,Sr=new Pn,Er=new Pn,Tr=new Pn,Ar=new Pn,Lr=new Pn,Rr=new Pn,Cr=new Pn,Ir=new Pn,kr=new Pn,function(e){if(this.isEmpty())return!1;this.getCenter(Cr),Ir.subVectors(this.max,Cr),Mr.subVectors(e.a,Cr),Sr.subVectors(e.b,Cr),Er.subVectors(e.c,Cr),Tr.subVectors(Sr,Mr),Ar.subVectors(Er,Sr),Lr.subVectors(Mr,Er);var t=[0,-Tr.z,Tr.y,0,-Ar.z,Ar.y,0,-Lr.z,Lr.y,Tr.z,0,-Tr.x,Ar.z,0,-Ar.x,Lr.z,0,-Lr.x,-Tr.y,Tr.x,0,-Ar.y,Ar.x,0,-Lr.y,Lr.x,0];return!!gi(t)&&(t=[1,0,0,0,1,0,0,0,1],!!gi(t)&&(kr.crossVectors(Tr,Ar),t=[kr.x,kr.y,kr.z],gi(t)))}),clampPoint:function(e,t){return void 0===t&&(console.warn("THREE.Box3: .clampPoint() target is now required"),t=new Pn),t.copy(e).clamp(this.min,this.max)},distanceToPoint:(br=new Pn,function(e){var t=br.copy(e).clamp(this.min,this.max);return t.sub(e).length()}),getBoundingSphere:(wr=new Pn,function(e){return void 0===e&&console.error("THREE.Box3: .getBoundingSphere() target is now required"),this.getCenter(e.center),e.radius=.5*this.getSize(wr).length(),e}),intersect:function(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this},union:function(e){return this.min.min(e.min),this.max.max(e.max),this},applyMatrix4:(xr=[new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn,new Pn],function(e){return this.isEmpty()||(xr[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),xr[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),xr[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),xr[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),xr[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),xr[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),xr[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),xr[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(xr)),this}),translate:function(e){return this.min.add(e),this.max.add(e),this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}),(0,p.default)(_i.prototype,{set:function(e,t){return this.center.copy(e),this.radius=t,this},setFromPoints:function(e,t){void 0===Ur&&(Ur=new vi);var n=this.center;void 0!==t?n.copy(t):Ur.setFromPoints(e).getCenter(n);for(var r=0,i=0,a=e.length;i<a;i++)r=Math.max(r,n.distanceToSquared(e[i]));return this.radius=Math.sqrt(r),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.center.copy(e.center),this.radius=e.radius,this},empty:function(){return this.radius<=0},containsPoint:function(e){return e.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(e){return e.distanceTo(this.center)-this.radius},intersectsSphere:function(e){var t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t},intersectsBox:function(e){return e.intersectsSphere(this)},intersectsPlane:function(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius},clampPoint:function(e,t){var n=this.center.distanceToSquared(e);return void 0===t&&(console.warn("THREE.Sphere: .clampPoint() target is now required"),t=new Pn),t.copy(e),n>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t},getBoundingBox:function(e){return void 0===e&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),e=new vi),e.set(this.center,this.center),e.expandByScalar(this.radius),e},applyMatrix4:function(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this},translate:function(e){return this.center.add(e),this},equals:function(e){return e.center.equals(this.center)&&e.radius===this.radius}}),(0,p.default)(xi.prototype,{set:function(e,t){return this.origin.copy(e),this.direction.copy(t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this},at:function(e,t){return void 0===t&&(console.warn("THREE.Ray: .at() target is now required"),t=new Pn),t.copy(this.direction).multiplyScalar(e).add(this.origin)},lookAt:function(e){return this.direction.copy(e).sub(this.origin).normalize(),this},recast:(Jr=new Pn,function(e){return this.origin.copy(this.at(e,Jr)),this}),closestPointToPoint:function(e,t){void 0===t&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),t=new Pn),t.subVectors(e,this.origin);var n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(n).add(this.origin)},distanceToPoint:function(e){return Math.sqrt(this.distanceSqToPoint(e))},distanceSqToPoint:(Zr=new Pn,function(e){var t=Zr.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Zr.copy(this.direction).multiplyScalar(t).add(this.origin),Zr.distanceToSquared(e))}),distanceSqToSegment:(Yr=new Pn,qr=new Pn,Xr=new Pn,function(e,t,n,r){Yr.copy(e).add(t).multiplyScalar(.5),qr.copy(t).sub(e).normalize(),Xr.copy(this.origin).sub(Yr);var i,a,o,s,l=.5*e.distanceTo(t),u=-this.direction.dot(qr),c=Xr.dot(this.direction),h=-Xr.dot(qr),f=Xr.lengthSq(),d=Math.abs(1-u*u);if(0<d)if(i=u*h-c,a=u*c-h,s=l*d,0<=i)if(-s<=a)if(a<=s){var p=1/d;i*=p,a*=p,o=i*(i+u*a+2*c)+a*(u*i+a+2*h)+f}else a=l,i=Math.max(0,-(u*a+c)),o=-i*i+a*(a+2*h)+f;else a=-l,i=Math.max(0,-(u*a+c)),o=-i*i+a*(a+2*h)+f;else o=a<=-s?(i=Math.max(0,-(-u*l+c)),a=0<i?-l:Math.min(Math.max(-l,-h),l),-i*i+a*(a+2*h)+f):a<=s?(i=0,a=Math.min(Math.max(-l,-h),l),a*(a+2*h)+f):(i=Math.max(0,-(u*l+c)),a=0<i?l:Math.min(Math.max(-l,-h),l),-i*i+a*(a+2*h)+f);else a=0<u?-l:l,i=Math.max(0,-(u*a+c)),o=-i*i+a*(a+2*h)+f;return n&&n.copy(this.direction).multiplyScalar(i).add(this.origin),r&&r.copy(qr).multiplyScalar(a).add(Yr),o}),intersectSphere:(jr=new Pn,function(e,t){jr.subVectors(e.center,this.origin);var n=jr.dot(this.direction),r=jr.dot(jr)-n*n,i=e.radius*e.radius;if(i<r)return null;var a=Math.sqrt(i-r),o=n-a,s=n+a;return o<0&&s<0?null:o<0?this.at(s,t):this.at(o,t)}),intersectsSphere:function(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius},distanceToPlane:function(e){var t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;var n=-(this.origin.dot(e.normal)+e.constant)/t;return 0<=n?n:null},intersectPlane:function(e,t){var n=this.distanceToPlane(e);return null===n?null:this.at(n,t)},intersectsPlane:function(e){var t=e.distanceToPoint(this.origin);if(0===t)return!0;var n=e.normal.dot(this.direction);return n*t<0},intersectBox:function(e,t){var n,r,i,a,o,s,l=1/this.direction.x,u=1/this.direction.y,c=1/this.direction.z,h=this.origin;return r=0<=l?(n=(e.min.x-h.x)*l,(e.max.x-h.x)*l):(n=(e.max.x-h.x)*l,(e.min.x-h.x)*l),a=0<=u?(i=(e.min.y-h.y)*u,(e.max.y-h.y)*u):(i=(e.max.y-h.y)*u,(e.min.y-h.y)*u),a<n||r<i?null:((n<i||n!=n)&&(n=i),(a<r||r!=r)&&(r=a),s=0<=c?(o=(e.min.z-h.z)*c,(e.max.z-h.z)*c):(o=(e.max.z-h.z)*c,(e.min.z-h.z)*c),s<n||r<o?null:((n<o||n!=n)&&(n=o),(s<r||r!=r)&&(r=s),r<0?null:this.at(0<=n?n:r,t)))},intersectsBox:(Wr=new Pn,function(e){return null!==this.intersectBox(e,Wr)}),intersectTriangle:(Gr=new Pn,zr=new Pn,Vr=new Pn,Hr=new Pn,function(e,t,n,r,i){zr.subVectors(t,e),Vr.subVectors(n,e),Hr.crossVectors(zr,Vr);var a,o=this.direction.dot(Hr);if(0<o){if(r)return null;a=1}else{if(!(o<0))return null;a=-1,o=-o}Gr.subVectors(this.origin,e);var s=a*this.direction.dot(Vr.crossVectors(Gr,Vr));if(s<0)return null;var l=a*this.direction.dot(zr.cross(Gr));if(l<0)return null;if(o<s+l)return null;var u=-a*Gr.dot(Hr);return u<0?null:this.at(u/o,i)}),applyMatrix4:function(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this},equals:function(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}}),(0,p.default)(wi,{getNormal:(ii=new Pn,function(e,t,n,r){void 0===r&&(console.warn("THREE.Triangle: .getNormal() target is now required"),r=new Pn),r.subVectors(n,t),ii.subVectors(e,t),r.cross(ii);var i=r.lengthSq();return 0<i?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)}),getBarycoord:(ti=new Pn,ni=new Pn,ri=new Pn,function(e,t,n,r,i){ti.subVectors(r,t),ni.subVectors(n,t),ri.subVectors(e,t);var a=ti.dot(ti),o=ti.dot(ni),s=ti.dot(ri),l=ni.dot(ni),u=ni.dot(ri),c=a*l-o*o;if(void 0===i&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),i=new Pn),0===c)return i.set(-2,-1,-1);var h=1/c,f=(l*s-o*u)*h,d=(a*u-o*s)*h;return i.set(1-f-d,d,f)}),containsPoint:(ei=new Pn,function(e,t,n,r){return wi.getBarycoord(e,t,n,r,ei),0<=ei.x&&0<=ei.y&&ei.x+ei.y<=1}),getUV:($r=new Pn,function(e,t,n,r,i,a,o,s){return this.getBarycoord(e,t,n,r,$r),s.set(0,0),s.addScaledVector(i,$r.x),s.addScaledVector(a,$r.y),s.addScaledVector(o,$r.z),s}),isFrontFacing:(Kr=new Pn,Qr=new Pn,function(e,t,n,r){return Kr.subVectors(n,t),Qr.subVectors(e,t),Kr.cross(Qr).dot(r)<0})}),(0,p.default)(wi.prototype,{set:function(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this},setFromPointsAndIndices:function(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this},getArea:(hi=new Pn,fi=new Pn,function(){return hi.subVectors(this.c,this.b),fi.subVectors(this.a,this.b),.5*hi.cross(fi).length()}),getMidpoint:function(e){return void 0===e&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),e=new Pn),e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},getNormal:function(e){return wi.getNormal(this.a,this.b,this.c,e)},getPlane:function(e){return void 0===e&&(console.warn("THREE.Triangle: .getPlane() target is now required"),e=new Pn),e.setFromCoplanarPoints(this.a,this.b,this.c)},getBarycoord:function(e,t){return wi.getBarycoord(e,this.a,this.b,this.c,t)},getUV:function(e,t,n,r,i){return wi.getUV(e,this.a,this.b,this.c,t,n,r,i)},containsPoint:function(e){return wi.containsPoint(e,this.a,this.b,this.c)},isFrontFacing:function(e){return wi.isFrontFacing(this.a,this.b,this.c,e)},intersectsBox:function(e){return e.intersectsTriangle(this)},closestPointToPoint:(ai=new Pn,oi=new Pn,si=new Pn,li=new Pn,ui=new Pn,ci=new Pn,function(e,t){void 0===t&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),t=new Pn);var n,r,i=this.a,a=this.b,o=this.c;ai.subVectors(a,i),oi.subVectors(o,i),li.subVectors(e,i);var s=ai.dot(li),l=oi.dot(li);if(s<=0&&l<=0)return t.copy(i);ui.subVectors(e,a);var u=ai.dot(ui),c=oi.dot(ui);if(0<=u&&c<=u)return t.copy(a);var h=s*c-u*l;if(h<=0&&0<=s&&u<=0)return n=s/(s-u),t.copy(i).addScaledVector(ai,n);ci.subVectors(e,o);var f=ai.dot(ci),d=oi.dot(ci);if(0<=d&&f<=d)return t.copy(o);var p=f*l-s*d;if(p<=0&&0<=l&&d<=0)return r=l/(l-d),t.copy(i).addScaledVector(oi,r);var m=u*d-f*c;if(m<=0&&0<=c-u&&0<=f-d)return si.subVectors(o,a),r=(c-u)/(c-u+(f-d)),t.copy(a).addScaledVector(si,r);var v=1/(m+p+h);return n=p*v,r=h*v,t.copy(i).addScaledVector(ai,n).addScaledVector(oi,r)}),equals:function(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}});var bi,Mi,Si,Ei={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function Ti(e,t,n){return void 0===t&&void 0===n?this.set(e):this.setRGB(e,t,n)}function Ai(e,t,n){return n<0&&(n+=1),1<n&&--n,n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+6*(t-e)*(2/3-n):e}function Li(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function Ri(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}function Ci(e,t,n,r,i,a){this.a=e,this.b=t,this.c=n,this.normal=r&&r.isVector3?r:new Pn,this.vertexNormals=(0,Ue.default)(r)?r:[],this.color=i&&i.isColor?i:new Ti,this.vertexColors=(0,Ue.default)(i)?i:[],this.materialIndex=void 0!==a?a:0}(0,p.default)(Ti.prototype,{isColor:!0,r:1,g:1,b:1,set:function(e){return e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e),this},setScalar:function(e){return this.r=e,this.g=e,this.b=e,this},setHex:function(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,this},setRGB:function(e,t,n){return this.r=e,this.g=t,this.b=n,this},setHSL:function(e,t,n){if(e=Cn.euclideanModulo(e,1),t=Cn.clamp(t,0,1),n=Cn.clamp(n,0,1),0===t)this.r=this.g=this.b=n;else{var r=n<=.5?n*(1+t):n+t-n*t,i=2*n-r;this.r=Ai(i,r,e+1/3),this.g=Ai(i,r,e),this.b=Ai(i,r,e-1/3)}return this},setStyle:function(t){function e(e){void 0!==e&&(0,ce.default)(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}var n;if(n=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(t)){var r,i=n[1],a=n[2];switch(i){case"rgb":case"rgba":if(r=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(255,(0,h.default)(r[1],10))/255,this.g=Math.min(255,(0,h.default)(r[2],10))/255,this.b=Math.min(255,(0,h.default)(r[3],10))/255,e(r[5]),this;if(r=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(100,(0,h.default)(r[1],10))/100,this.g=Math.min(100,(0,h.default)(r[2],10))/100,this.b=Math.min(100,(0,h.default)(r[3],10))/100,e(r[5]),this;break;case"hsl":case"hsla":if(r=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a)){var o=(0,ce.default)(r[1])/360,s=(0,h.default)(r[2],10)/100,l=(0,h.default)(r[3],10)/100;return e(r[5]),this.setHSL(o,s,l)}}}else if(n=/^\#([A-Fa-f0-9]+)$/.exec(t)){var u=n[1],c=u.length;if(3===c)return this.r=(0,h.default)(u.charAt(0)+u.charAt(0),16)/255,this.g=(0,h.default)(u.charAt(1)+u.charAt(1),16)/255,this.b=(0,h.default)(u.charAt(2)+u.charAt(2),16)/255,this;if(6===c)return this.r=(0,h.default)(u.charAt(0)+u.charAt(1),16)/255,this.g=(0,h.default)(u.charAt(2)+u.charAt(3),16)/255,this.b=(0,h.default)(u.charAt(4)+u.charAt(5),16)/255,this}return t&&0<t.length&&(u=Ei[t],void 0!==u?this.setHex(u):console.warn("THREE.Color: Unknown color "+t)),this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(e){return this.r=e.r,this.g=e.g,this.b=e.b,this},copyGammaToLinear:function(e,t){return void 0===t&&(t=2),this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this},copyLinearToGamma:function(e,t){void 0===t&&(t=2);var n=0<t?1/t:1;return this.r=Math.pow(e.r,n),this.g=Math.pow(e.g,n),this.b=Math.pow(e.b,n),this},convertGammaToLinear:function(e){return this.copyGammaToLinear(this,e),this},convertLinearToGamma:function(e){return this.copyLinearToGamma(this,e),this},copySRGBToLinear:function(e){return this.r=Li(e.r),this.g=Li(e.g),this.b=Li(e.b),this},copyLinearToSRGB:function(e){return this.r=Ri(e.r),this.g=Ri(e.g),this.b=Ri(e.b),this},convertSRGBToLinear:function(){return this.copySRGBToLinear(this),this},convertLinearToSRGB:function(){return this.copyLinearToSRGB(this),this},getHex:function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(e){void 0===e&&(console.warn("THREE.Color: .getHSL() target is now required"),e={h:0,s:0,l:0});var t,n,r=this.r,i=this.g,a=this.b,o=Math.max(r,i,a),s=Math.min(r,i,a),l=(s+o)/2;if(s===o)t=0,n=0;else{var u=o-s;switch(n=l<=.5?u/(o+s):u/(2-o-s),o){case r:t=(i-a)/u+(i<a?6:0);break;case i:t=(a-r)/u+2;break;case a:t=(r-i)/u+4}t/=6}return e.h=t,e.s=n,e.l=l,e},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:(Si={},function(e,t,n){return this.getHSL(Si),Si.h+=e,Si.s+=t,Si.l+=n,this.setHSL(Si.h,Si.s,Si.l),this}),add:function(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this},addColors:function(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this},addScalar:function(e){return this.r+=e,this.g+=e,this.b+=e,this},sub:function(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this},multiply:function(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this},multiplyScalar:function(e){return this.r*=e,this.g*=e,this.b*=e,this},lerp:function(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this},lerpHSL:(bi={h:0,s:0,l:0},Mi={h:0,s:0,l:0},function(e,t){this.getHSL(bi),e.getHSL(Mi);var n=Cn.lerp(bi.h,Mi.h,t),r=Cn.lerp(bi.s,Mi.s,t),i=Cn.lerp(bi.l,Mi.l,t);return this.setHSL(n,r,i),this}),equals:function(e){return e.r===this.r&&e.g===this.g&&e.b===this.b},fromArray:function(e,t){return void 0===t&&(t=0),this.r=e[t],this.g=e[t+1],this.b=e[t+2],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e},toJSON:function(){return this.getHex()}}),(0,p.default)(Ci.prototype,{clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.a=e.a,this.b=e.b,this.c=e.c,this.normal.copy(e.normal),this.color.copy(e.color),this.materialIndex=e.materialIndex;for(var t=0,n=e.vertexNormals.length;t<n;t++)this.vertexNormals[t]=e.vertexNormals[t].clone();for(t=0,n=e.vertexColors.length;t<n;t++)this.vertexColors[t]=e.vertexColors[t].clone();return this}});var Ii=0;function ki(){(0,g.default)(this,"id",{value:Ii++}),this.uuid=Cn.generateUUID(),this.name="",this.type="Material",this.fog=!0,this.lights=!0,this.blending=ve,this.side=B,this.flatShading=!1,this.vertexTangents=!1,this.vertexColors=A,this.opacity=1,this.transparent=!1,this.blendSrc=z,this.blendDst=V,this.blendEquation=we,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=Ee,this.depthTest=!0,this.depthWrite=!0,this.stencilFunc=Mn,this.stencilRef=0,this.stencilMask=255,this.stencilFail=un,this.stencilZFail=un,this.stencilZPass=un,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaTest=0,this.premultipliedAlpha=!1,this.visible=!0,this.userData={},this.needsUpdate=!0}function Pi(e){ki.call(this),this.type="MeshBasicMaterial",this.color=new Ti(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=X,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.lights=!1,this.setValues(e)}function Ni(e,t,n){if((0,Ue.default)(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=!0===n,this.dynamic=!1,this.updateRange={offset:0,count:-1},this.version=0}function Di(e,t,n){Ni.call(this,new Int8Array(e),t,n)}function Oi(e,t,n){Ni.call(this,new Uint8Array(e),t,n)}function Fi(e,t,n){Ni.call(this,new Uint8ClampedArray(e),t,n)}function Bi(e,t,n){Ni.call(this,new Int16Array(e),t,n)}function Ui(e,t,n){Ni.call(this,new Uint16Array(e),t,n)}function Gi(e,t,n){Ni.call(this,new Int32Array(e),t,n)}function zi(e,t,n){Ni.call(this,new Uint32Array(e),t,n)}function Vi(e,t,n){Ni.call(this,new Float32Array(e),t,n)}function Hi(e,t,n){Ni.call(this,new Float64Array(e),t,n)}function Wi(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}function ji(e){if(0===e.length)return-1/0;for(var t=e[0],n=1,r=e.length;n<r;++n)e[n]>t&&(t=e[n]);return t}ki.prototype=(0,p.default)((0,l.default)(c.prototype),{constructor:ki,isMaterial:!0,onBeforeCompile:function(){},setValues:function(e){if(void 0!==e)for(var t in e){var n=e[t];if(void 0!==n)if("shading"!==t){var r=this[t];void 0!==r?r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[t]=n:console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.")}else console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=n===E;else console.warn("THREE.Material: '"+t+"' parameter is undefined.")}},toJSON:function(e){var t=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{}});var n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function r(e){var t=[];for(var n in e){var r=e[n];delete r.metadata,t.push(r)}return t}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearCoat&&(n.clearCoat=this.clearCoat),void 0!==this.clearCoatRoughness&&(n.clearCoatRoughness=this.clearCoatRoughness),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,n.reflectivity=this.reflectivity,n.refractionRatio=this.refractionRatio,void 0!==this.combine&&(n.combine=this.combine),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity)),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.size&&(n.size=this.size),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==ve&&(n.blending=this.blending),!0===this.flatShading&&(n.flatShading=this.flatShading),this.side!==B&&(n.side=this.side),this.vertexColors!==A&&(n.vertexColors=this.vertexColors),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,n.stencilWrite=this.stencilWrite,n.stencilFunc=this.stencilFunc,n.stencilRef=this.stencilRef,n.stencilMask=this.stencilMask,n.stencilFail=this.stencilFail,n.stencilZFail=this.stencilZFail,n.stencilZPass=this.stencilZPass,this.rotation&&0!==this.rotation&&(n.rotation=this.rotation),!0===this.polygonOffset&&(n.polygonOffset=!0),0!==this.polygonOffsetFactor&&(n.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),0<this.alphaTest&&(n.alphaTest=this.alphaTest),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(n.wireframe=this.wireframe),1<this.wireframeLinewidth&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.morphTargets&&(n.morphTargets=!0),!0===this.morphNormals&&(n.morphNormals=!0),!0===this.skinning&&(n.skinning=!0),!1===this.visible&&(n.visible=!1),"{}"!==(0,v.default)(this.userData)&&(n.userData=this.userData),t){var i=r(e.textures),a=r(e.images);0<i.length&&(n.textures=i),0<a.length&&(n.images=a)}return n},clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.name=e.name,this.fog=e.fog,this.lights=e.lights,this.blending=e.blending,this.side=e.side,this.flatShading=e.flatShading,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWrite=e.stencilWrite,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilMask=e.stencilMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.userData=JSON.parse((0,v.default)(e.userData)),this.clipShadows=e.clipShadows,this.clipIntersection=e.clipIntersection;var t=e.clippingPlanes,n=null;if(null!==t){var r=t.length;n=new Array(r);for(var i=0;i!==r;++i)n[i]=t[i].clone()}return this.clippingPlanes=n,this.shadowSide=e.shadowSide,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Pi.prototype=(0,l.default)(ki.prototype),Pi.prototype.constructor=Pi,Pi.prototype.isMeshBasicMaterial=!0,Pi.prototype.copy=function(e){return ki.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this},(0,g.default)(Ni.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),(0,p.default)(Ni.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setArray:function(e){if((0,Ue.default)(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");return this.count=void 0!==e?e.length/this.itemSize:0,this.array=e,this},setDynamic:function(e){return this.dynamic=e,this},copy:function(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.dynamic=e.dynamic,this},copyAt:function(e,t,n){e*=this.itemSize,n*=t.itemSize;for(var r=0,i=this.itemSize;r<i;r++)this.array[e+r]=t.array[n+r];return this},copyArray:function(e){return this.array.set(e),this},copyColorsArray:function(e){for(var t=this.array,n=0,r=0,i=e.length;r<i;r++){var a=e[r];void 0===a&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",r),a=new Ti),t[n++]=a.r,t[n++]=a.g,t[n++]=a.b}return this},copyVector2sArray:function(e){for(var t=this.array,n=0,r=0,i=e.length;r<i;r++){var a=e[r];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",r),a=new In),t[n++]=a.x,t[n++]=a.y}return this},copyVector3sArray:function(e){for(var t=this.array,n=0,r=0,i=e.length;r<i;r++){var a=e[r];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",r),a=new Pn),t[n++]=a.x,t[n++]=a.y,t[n++]=a.z}return this},copyVector4sArray:function(e){for(var t=this.array,n=0,r=0,i=e.length;r<i;r++){var a=e[r];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",r),a=new Zn),t[n++]=a.x,t[n++]=a.y,t[n++]=a.z,t[n++]=a.w}return this},set:function(e,t){return void 0===t&&(t=0),this.array.set(e,t),this},getX:function(e){return this.array[e*this.itemSize]},setX:function(e,t){return this.array[e*this.itemSize]=t,this},getY:function(e){return this.array[e*this.itemSize+1]},setY:function(e,t){return this.array[e*this.itemSize+1]=t,this},getZ:function(e){return this.array[e*this.itemSize+2]},setZ:function(e,t){return this.array[e*this.itemSize+2]=t,this},getW:function(e){return this.array[e*this.itemSize+3]},setW:function(e,t){return this.array[e*this.itemSize+3]=t,this},setXY:function(e,t,n){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this},setXYZ:function(e,t,n,r){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this},setXYZW:function(e,t,n,r,i){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this.array[e+3]=i,this},onUpload:function(e){return this.onUploadCallback=e,this},clone:function(){return new this.constructor(this.array,this.itemSize).copy(this)},toJSON:function(){return{itemSize:this.itemSize,type:this.array.constructor.name,array:Array.prototype.slice.call(this.array),normalized:this.normalized}}}),Di.prototype=(0,l.default)(Ni.prototype),Di.prototype.constructor=Di,Oi.prototype=(0,l.default)(Ni.prototype),Oi.prototype.constructor=Oi,Fi.prototype=(0,l.default)(Ni.prototype),Fi.prototype.constructor=Fi,Bi.prototype=(0,l.default)(Ni.prototype),Bi.prototype.constructor=Bi,Ui.prototype=(0,l.default)(Ni.prototype),Ui.prototype.constructor=Ui,Gi.prototype=(0,l.default)(Ni.prototype),Gi.prototype.constructor=Gi,zi.prototype=(0,l.default)(Ni.prototype),zi.prototype.constructor=zi,Vi.prototype=(0,l.default)(Ni.prototype),Vi.prototype.constructor=Vi,Hi.prototype=(0,l.default)(Ni.prototype),Hi.prototype.constructor=Hi,(0,p.default)(Wi.prototype,{computeGroups:function(e){for(var t,n=[],r=void 0,i=e.faces,a=0;a<i.length;a++){var o=i[a];o.materialIndex!==r&&(r=o.materialIndex,void 0!==t&&(t.count=3*a-t.start,n.push(t)),t={start:3*a,materialIndex:r})}void 0!==t&&(t.count=3*a-t.start,n.push(t)),this.groups=n},fromGeometry:function(e){var t,n=e.faces,r=e.vertices,i=e.faceVertexUvs,a=i[0]&&0<i[0].length,o=i[1]&&0<i[1].length,s=e.morphTargets,l=s.length;if(0<l){t=[];for(var u=0;u<l;u++)t[u]={name:s[u].name,data:[]};this.morphTargets.position=t}var c,h=e.morphNormals,f=h.length;if(0<f){for(c=[],u=0;u<f;u++)c[u]={name:h[u].name,data:[]};this.morphTargets.normal=c}var d=e.skinIndices,p=e.skinWeights,m=d.length===r.length,v=p.length===r.length;for(0<r.length&&0===n.length&&console.error("THREE.DirectGeometry: Faceless geometries are not supported."),u=0;u<n.length;u++){var g=n[u];this.vertices.push(r[g.a],r[g.b],r[g.c]);var y=g.vertexNormals;if(3===y.length)this.normals.push(y[0],y[1],y[2]);else{var _=g.normal;this.normals.push(_,_,_)}var x=g.vertexColors;if(3===x.length)this.colors.push(x[0],x[1],x[2]);else{var w=g.color;this.colors.push(w,w,w)}if(!0===a){var b=i[0][u];void 0!==b?this.uvs.push(b[0],b[1],b[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",u),this.uvs.push(new In,new In,new In))}!0===o&&(b=i[1][u],void 0!==b?this.uvs2.push(b[0],b[1],b[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",u),this.uvs2.push(new In,new In,new In)));for(var M=0;M<l;M++){var S=s[M].vertices;t[M].data.push(S[g.a],S[g.b],S[g.c])}for(M=0;M<f;M++){var E=h[M].vertexNormals[u];c[M].data.push(E.a,E.b,E.c)}m&&this.skinIndices.push(d[g.a],d[g.b],d[g.c]),v&&this.skinWeights.push(p[g.a],p[g.b],p[g.c])}return this.computeGroups(e),this.verticesNeedUpdate=e.verticesNeedUpdate,this.normalsNeedUpdate=e.normalsNeedUpdate,this.colorsNeedUpdate=e.colorsNeedUpdate,this.uvsNeedUpdate=e.uvsNeedUpdate,this.groupsNeedUpdate=e.groupsNeedUpdate,null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),this}});var Yi,qi,Xi,Zi,Ji,Ki,Qi,$i,ea,ta,na,ra,ia,aa,oa,sa,la,ua,ca,ha,fa,da,pa,ma,va,ga,ya,_a,xa,wa=1;function ba(){(0,g.default)(this,"id",{value:wa+=2}),this.uuid=Cn.generateUUID(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}function Ma(e,t){pi.call(this),this.type="Mesh",this.geometry=void 0!==e?e:new ba,this.material=void 0!==t?t:new Pi({color:16777215*Math.random()}),this.drawMode=Yt,this.updateMorphTargets()}function Sa(e,t,n,r,i,a,o,s){var l;if(l=t.side===Ge?r.intersectTriangle(o,a,i,!0,s):r.intersectTriangle(i,a,o,t.side!==pe,s),null===l)return null;xa.copy(s),xa.applyMatrix4(e.matrixWorld);var u=n.ray.origin.distanceTo(xa);return u<n.near||u>n.far?null:{distance:u,point:xa.clone(),object:e}}function Ea(e,t,n,r,i,a,o,s,l,u,c){sa.fromBufferAttribute(i,l),la.fromBufferAttribute(i,u),ua.fromBufferAttribute(i,c);var h=e.morphTargetInfluences;if(t.morphTargets&&a&&h){da.set(0,0,0),pa.set(0,0,0),ma.set(0,0,0);for(var f=0,d=a.length;f<d;f++){var p=h[f],m=a[f];0!==p&&(ca.fromBufferAttribute(m,l),ha.fromBufferAttribute(m,u),fa.fromBufferAttribute(m,c),da.addScaledVector(ca.sub(sa),p),pa.addScaledVector(ha.sub(la),p),ma.addScaledVector(fa.sub(ua),p))}sa.add(da),la.add(pa),ua.add(ma)}var v=Sa(e,t,n,r,sa,la,ua,_a);if(v){o&&(va.fromBufferAttribute(o,l),ga.fromBufferAttribute(o,u),ya.fromBufferAttribute(o,c),v.uv=wi.getUV(_a,sa,la,ua,va,ga,ya,new In)),s&&(va.fromBufferAttribute(s,l),ga.fromBufferAttribute(s,u),ya.fromBufferAttribute(s,c),v.uv2=wi.getUV(_a,sa,la,ua,va,ga,ya,new In));var g=new Ci(l,u,c);wi.getNormal(sa,la,ua,g.normal),v.face=g}return v}ba.prototype=(0,p.default)((0,l.default)(c.prototype),{constructor:ba,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(e){(0,Ue.default)(e)?this.index=new(65535<ji(e)?zi:Ui)(e,1):this.index=e},addAttribute:function(e,t,n){return t&&t.isBufferAttribute||t&&t.isInterleavedBufferAttribute?("index"===e?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(t)):this.attributes[e]=t,this):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.addAttribute(e,new Ni(arguments[1],n)))},getAttribute:function(e){return this.attributes[e]},removeAttribute:function(e){return delete this.attributes[e],this},addGroup:function(e,t,n){this.groups.push({start:e,count:t,materialIndex:void 0!==n?n:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(e,t){this.drawRange.start=e,this.drawRange.count=t},applyMatrix:function(e){var t=this.attributes.position;void 0!==t&&(e.applyToBufferAttribute(t),t.needsUpdate=!0);var n=this.attributes.normal;if(void 0!==n){var r=(new Nn).getNormalMatrix(e);r.applyToBufferAttribute(n),n.needsUpdate=!0}var i=this.attributes.tangent;return void 0!==i&&(r=(new Nn).getNormalMatrix(e),r.applyToBufferAttribute(i),i.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:(ra=new Qn,function(e){return ra.makeRotationX(e),this.applyMatrix(ra),this}),rotateY:(na=new Qn,function(e){return na.makeRotationY(e),this.applyMatrix(na),this}),rotateZ:(ta=new Qn,function(e){return ta.makeRotationZ(e),this.applyMatrix(ta),this}),translate:(ea=new Qn,function(e,t,n){return ea.makeTranslation(e,t,n),this.applyMatrix(ea),this}),scale:($i=new Qn,function(e,t,n){return $i.makeScale(e,t,n),this.applyMatrix($i),this}),lookAt:(Qi=new pi,function(e){Qi.lookAt(e),Qi.updateMatrix(),this.applyMatrix(Qi.matrix)}),center:(Ki=new Pn,function(){return this.computeBoundingBox(),this.boundingBox.getCenter(Ki).negate(),this.translate(Ki.x,Ki.y,Ki.z),this}),setFromObject:function(e){var t=e.geometry;if(e.isPoints||e.isLine){var n=new Vi(3*t.vertices.length,3),r=new Vi(3*t.colors.length,3);if(this.addAttribute("position",n.copyVector3sArray(t.vertices)),this.addAttribute("color",r.copyColorsArray(t.colors)),t.lineDistances&&t.lineDistances.length===t.vertices.length){var i=new Vi(t.lineDistances.length,1);this.addAttribute("lineDistance",i.copyArray(t.lineDistances))}null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone())}else e.isMesh&&t&&t.isGeometry&&this.fromGeometry(t);return this},setFromPoints:function(e){for(var t=[],n=0,r=e.length;n<r;n++){var i=e[n];t.push(i.x,i.y,i.z||0)}return this.addAttribute("position",new Vi(t,3)),this},updateFromObject:function(e){var t,n=e.geometry;if(e.isMesh){var r=n.__directGeometry;if(!0===n.elementsNeedUpdate&&(r=void 0,n.elementsNeedUpdate=!1),void 0===r)return this.fromGeometry(n);r.verticesNeedUpdate=n.verticesNeedUpdate,r.normalsNeedUpdate=n.normalsNeedUpdate,r.colorsNeedUpdate=n.colorsNeedUpdate,r.uvsNeedUpdate=n.uvsNeedUpdate,r.groupsNeedUpdate=n.groupsNeedUpdate,n.verticesNeedUpdate=!1,n.normalsNeedUpdate=!1,n.colorsNeedUpdate=!1,n.uvsNeedUpdate=!1,n.groupsNeedUpdate=!1,n=r}return!0===n.verticesNeedUpdate&&(t=this.attributes.position,void 0!==t&&(t.copyVector3sArray(n.vertices),t.needsUpdate=!0),n.verticesNeedUpdate=!1),!0===n.normalsNeedUpdate&&(t=this.attributes.normal,void 0!==t&&(t.copyVector3sArray(n.normals),t.needsUpdate=!0),n.normalsNeedUpdate=!1),!0===n.colorsNeedUpdate&&(t=this.attributes.color,void 0!==t&&(t.copyColorsArray(n.colors),t.needsUpdate=!0),n.colorsNeedUpdate=!1),n.uvsNeedUpdate&&(t=this.attributes.uv,void 0!==t&&(t.copyVector2sArray(n.uvs),t.needsUpdate=!0),n.uvsNeedUpdate=!1),n.lineDistancesNeedUpdate&&(t=this.attributes.lineDistance,void 0!==t&&(t.copyArray(n.lineDistances),t.needsUpdate=!0),n.lineDistancesNeedUpdate=!1),n.groupsNeedUpdate&&(n.computeGroups(e.geometry),this.groups=n.groups,n.groupsNeedUpdate=!1),this},fromGeometry:function(e){return e.__directGeometry=(new Wi).fromGeometry(e),this.fromDirectGeometry(e.__directGeometry)},fromDirectGeometry:function(e){var t=new Float32Array(3*e.vertices.length);if(this.addAttribute("position",new Ni(t,3).copyVector3sArray(e.vertices)),0<e.normals.length){var n=new Float32Array(3*e.normals.length);this.addAttribute("normal",new Ni(n,3).copyVector3sArray(e.normals))}if(0<e.colors.length){var r=new Float32Array(3*e.colors.length);this.addAttribute("color",new Ni(r,3).copyColorsArray(e.colors))}if(0<e.uvs.length){var i=new Float32Array(2*e.uvs.length);this.addAttribute("uv",new Ni(i,2).copyVector2sArray(e.uvs))}if(0<e.uvs2.length){var a=new Float32Array(2*e.uvs2.length);this.addAttribute("uv2",new Ni(a,2).copyVector2sArray(e.uvs2))}for(var o in this.groups=e.groups,e.morphTargets){for(var s=[],l=e.morphTargets[o],u=0,c=l.length;u<c;u++){var h=l[u],f=new Vi(3*h.data.length,3);f.name=h.name,s.push(f.copyVector3sArray(h.data))}this.morphAttributes[o]=s}if(0<e.skinIndices.length){var d=new Vi(4*e.skinIndices.length,4);this.addAttribute("skinIndex",d.copyVector4sArray(e.skinIndices))}if(0<e.skinWeights.length){var p=new Vi(4*e.skinWeights.length,4);this.addAttribute("skinWeight",p.copyVector4sArray(e.skinWeights))}return null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),this},computeBoundingBox:(Ji=new vi,function(){null===this.boundingBox&&(this.boundingBox=new vi);var e=this.attributes.position,t=this.morphAttributes.position;if(void 0!==e){if(this.boundingBox.setFromBufferAttribute(e),t)for(var n=0,r=t.length;n<r;n++){var i=t[n];Ji.setFromBufferAttribute(i),this.boundingBox.expandByPoint(Ji.min),this.boundingBox.expandByPoint(Ji.max)}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}),computeBoundingSphere:(qi=new vi,Xi=new vi,Zi=new Pn,function(){null===this.boundingSphere&&(this.boundingSphere=new _i);var e=this.attributes.position,t=this.morphAttributes.position;if(e){var n=this.boundingSphere.center;if(qi.setFromBufferAttribute(e),t)for(var r=0,i=t.length;r<i;r++){var a=t[r];Xi.setFromBufferAttribute(a),qi.expandByPoint(Xi.min),qi.expandByPoint(Xi.max)}qi.getCenter(n);var o=0;for(r=0,i=e.count;r<i;r++)Zi.fromBufferAttribute(e,r),o=Math.max(o,n.distanceToSquared(Zi));if(t)for(r=0,i=t.length;r<i;r++){a=t[r];for(var s=0,l=a.count;s<l;s++)Zi.fromBufferAttribute(a,s),o=Math.max(o,n.distanceToSquared(Zi))}this.boundingSphere.radius=Math.sqrt(o),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}),computeFaceNormals:function(){},computeVertexNormals:function(){var e=this.index,t=this.attributes;if(t.position){var n=t.position.array;if(void 0===t.normal)this.addAttribute("normal",new Ni(new Float32Array(n.length),3));else for(var r=t.normal.array,i=0,a=r.length;i<a;i++)r[i]=0;var o,s,l,u=t.normal.array,c=new Pn,h=new Pn,f=new Pn,d=new Pn,p=new Pn;if(e){var m=e.array;for(i=0,a=e.count;i<a;i+=3)o=3*m[i+0],s=3*m[i+1],l=3*m[i+2],c.fromArray(n,o),h.fromArray(n,s),f.fromArray(n,l),d.subVectors(f,h),p.subVectors(c,h),d.cross(p),u[o]+=d.x,u[o+1]+=d.y,u[o+2]+=d.z,u[s]+=d.x,u[s+1]+=d.y,u[s+2]+=d.z,u[l]+=d.x,u[l+1]+=d.y,u[l+2]+=d.z}else for(i=0,a=n.length;i<a;i+=9)c.fromArray(n,i),h.fromArray(n,i+3),f.fromArray(n,i+6),d.subVectors(f,h),p.subVectors(c,h),d.cross(p),u[i]=d.x,u[i+1]=d.y,u[i+2]=d.z,u[i+3]=d.x,u[i+4]=d.y,u[i+5]=d.z,u[i+6]=d.x,u[i+7]=d.y,u[i+8]=d.z;this.normalizeNormals(),t.normal.needsUpdate=!0}},merge:function(e,t){if(e&&e.isBufferGeometry){void 0===t&&(t=0,console.warn("THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge."));var n=this.attributes;for(var r in n)if(void 0!==e.attributes[r])for(var i=n[r],a=i.array,o=e.attributes[r],s=o.array,l=o.itemSize*t,u=Math.min(s.length,a.length-l),c=0,h=l;c<u;c++,h++)a[h]=s[c];return this}console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",e)},normalizeNormals:(Yi=new Pn,function(){for(var e=this.attributes.normal,t=0,n=e.count;t<n;t++)Yi.x=e.getX(t),Yi.y=e.getY(t),Yi.z=e.getZ(t),Yi.normalize(),e.setXYZ(t,Yi.x,Yi.y,Yi.z)}),toNonIndexed:function(){function e(e,t){for(var n=e.array,r=e.itemSize,i=new n.constructor(t.length*r),a=0,o=0,s=0,l=t.length;s<l;s++){a=t[s]*r;for(var u=0;u<r;u++)i[o++]=n[a++]}return new Ni(i,r)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),this;var t=new ba,n=this.index.array,r=this.attributes;for(var i in r){var a=r[i],o=e(a,n);t.addAttribute(i,o)}var s=this.morphAttributes;for(i in s){for(var l=[],u=s[i],c=0,h=u.length;c<h;c++)a=u[c],o=e(a,n),l.push(o);t.morphAttributes[i]=l}for(var f=this.groups,d=(c=0,f.length);c<d;c++){var p=f[c];t.addGroup(p.start,p.count,p.materialIndex)}return t},toJSON:function(){var e={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),0<(0,m.default)(this.userData).length&&(e.userData=this.userData),void 0!==this.parameters){var t=this.parameters;for(var n in t)void 0!==t[n]&&(e[n]=t[n]);return e}e.data={attributes:{}};var r=this.index;null!==r&&(e.data.index={type:r.array.constructor.name,array:Array.prototype.slice.call(r.array)});var i=this.attributes;for(var n in i){var a=i[n],o=a.toJSON();""!==a.name&&(o.name=a.name),e.data.attributes[n]=o}var s={},l=!1;for(var n in this.morphAttributes){for(var u=this.morphAttributes[n],c=[],h=0,f=u.length;h<f;h++)a=u[h],o=a.toJSON(),""!==a.name&&(o.name=a.name),c.push(o);0<c.length&&(s[n]=c,l=!0)}l&&(e.data.morphAttributes=s);var d=this.groups;0<d.length&&(e.data.groups=JSON.parse((0,v.default)(d)));var p=this.boundingSphere;return null!==p&&(e.data.boundingSphere={center:p.center.toArray(),radius:p.radius}),e},clone:function(){return(new ba).copy(this)},copy:function(e){var t,n,r;this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.name=e.name;var i=e.index;null!==i&&this.setIndex(i.clone());var a=e.attributes;for(t in a){var o=a[t];this.addAttribute(t,o.clone())}var s=e.morphAttributes;for(t in s){var l=[],u=s[t];for(n=0,r=u.length;n<r;n++)l.push(u[n].clone());this.morphAttributes[t]=l}var c=e.groups;for(n=0,r=c.length;n<r;n++){var h=c[n];this.addGroup(h.start,h.count,h.materialIndex)}var f=e.boundingBox;null!==f&&(this.boundingBox=f.clone());var d=e.boundingSphere;return null!==d&&(this.boundingSphere=d.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Ma.prototype=(0,p.default)((0,l.default)(pi.prototype),{constructor:Ma,isMesh:!0,setDrawMode:function(e){this.drawMode=e},copy:function(e){return pi.prototype.copy.call(this,e),this.drawMode=e.drawMode,void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=(0,p.default)({},e.morphTargetDictionary)),this},updateMorphTargets:function(){var e,t,n,r=this.geometry;if(r.isBufferGeometry){var i=r.morphAttributes,a=(0,m.default)(i);if(0<a.length){var o=i[a[0]];if(void 0!==o)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},e=0,t=o.length;e<t;e++)n=o[e].name||String(e),this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=e}}else{var s=r.morphTargets;void 0!==s&&0<s.length&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},raycast:(ia=new Qn,aa=new xi,oa=new _i,sa=new Pn,la=new Pn,ua=new Pn,ca=new Pn,ha=new Pn,fa=new Pn,da=new Pn,pa=new Pn,ma=new Pn,va=new In,ga=new In,ya=new In,_a=new Pn,xa=new Pn,function(e,t){var n,r=this.geometry,i=this.material,a=this.matrixWorld;if(void 0!==i&&(null===r.boundingSphere&&r.computeBoundingSphere(),oa.copy(r.boundingSphere),oa.applyMatrix4(a),!1!==e.ray.intersectsSphere(oa)&&(ia.getInverse(a),aa.copy(e.ray).applyMatrix4(ia),null===r.boundingBox||!1!==aa.intersectsBox(r.boundingBox))))if(r.isBufferGeometry){var o,s,l,u,c,h,f,d,p,m,v,g=r.index,y=r.attributes.position,_=r.morphAttributes.position,x=r.attributes.uv,w=r.attributes.uv2,b=r.groups,M=r.drawRange;if(null!==g)if((0,Ue.default)(i))for(u=0,h=b.length;u<h;u++)for(d=b[u],p=i[d.materialIndex],m=Math.max(d.start,M.start),v=Math.min(d.start+d.count,M.start+M.count),c=m,f=v;c<f;c+=3)o=g.getX(c),s=g.getX(c+1),l=g.getX(c+2),n=Ea(this,p,e,aa,y,_,x,w,o,s,l),n&&(n.faceIndex=Math.floor(c/3),n.face.materialIndex=d.materialIndex,t.push(n));else for(m=Math.max(0,M.start),v=Math.min(g.count,M.start+M.count),u=m,h=v;u<h;u+=3)o=g.getX(u),s=g.getX(u+1),l=g.getX(u+2),n=Ea(this,i,e,aa,y,_,x,w,o,s,l),n&&(n.faceIndex=Math.floor(u/3),t.push(n));else if(void 0!==y)if((0,Ue.default)(i))for(u=0,h=b.length;u<h;u++)for(d=b[u],p=i[d.materialIndex],m=Math.max(d.start,M.start),v=Math.min(d.start+d.count,M.start+M.count),c=m,f=v;c<f;c+=3)o=c,s=c+1,l=c+2,n=Ea(this,p,e,aa,y,_,x,w,o,s,l),n&&(n.faceIndex=Math.floor(c/3),n.face.materialIndex=d.materialIndex,t.push(n));else for(m=Math.max(0,M.start),v=Math.min(y.count,M.start+M.count),u=m,h=v;u<h;u+=3)o=u,s=u+1,l=u+2,n=Ea(this,i,e,aa,y,_,x,w,o,s,l),n&&(n.faceIndex=Math.floor(u/3),t.push(n))}else if(r.isGeometry){var S,E,T,A,L=(0,Ue.default)(i),R=r.vertices,C=r.faces,I=r.faceVertexUvs[0];0<I.length&&(A=I);for(var k=0,P=C.length;k<P;k++){var N=C[k],D=L?i[N.materialIndex]:i;if(void 0!==D&&(S=R[N.a],E=R[N.b],T=R[N.c],n=Sa(this,D,e,aa,S,E,T,_a),n)){if(A&&A[k]){var O=A[k];va.copy(O[0]),ga.copy(O[1]),ya.copy(O[2]),n.uv=wi.getUV(_a,S,E,T,va,ga,ya,new In)}n.face=N,n.faceIndex=k,t.push(n)}}}}),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var Ta,Aa,La,Ra,Ca,Ia,ka,Pa=0;function Na(){(0,g.default)(this,"id",{value:Pa+=2}),this.uuid=Cn.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1}function Da(e,t,n,r,i,a){Na.call(this),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:r,heightSegments:i,depthSegments:a},this.fromBufferGeometry(new Oa(e,t,n,r,i,a)),this.mergeVertices()}function Oa(e,t,n,r,i,a){ba.call(this),this.type="BoxBufferGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:r,heightSegments:i,depthSegments:a};var R=this;e=e||1,t=t||1,n=n||1,r=Math.floor(r)||1,i=Math.floor(i)||1,a=Math.floor(a)||1;var C=[],I=[],k=[],P=[],N=0,D=0;function o(e,t,n,r,i,a,o,s,l,u,c){var h,f,d=a/l,p=o/u,m=a/2,v=o/2,g=s/2,y=l+1,_=u+1,x=0,w=0,b=new Pn;for(f=0;f<_;f++){var M=f*p-v;for(h=0;h<y;h++){var S=h*d-m;b[e]=S*r,b[t]=M*i,b[n]=g,I.push(b.x,b.y,b.z),b[e]=0,b[t]=0,b[n]=0<s?1:-1,k.push(b.x,b.y,b.z),P.push(h/l),P.push(1-f/u),x+=1}}for(f=0;f<u;f++)for(h=0;h<l;h++){var E=N+h+y*f,T=N+h+y*(f+1),A=N+(h+1)+y*(f+1),L=N+(h+1)+y*f;C.push(E,T,L),C.push(T,A,L),w+=6}R.addGroup(D,w,c),D+=w,N+=x}o("z","y","x",-1,-1,n,t,e,a,i,0),o("z","y","x",1,-1,n,t,-e,a,i,1),o("x","z","y",1,1,e,n,t,r,a,2),o("x","z","y",1,-1,e,n,-t,r,a,3),o("x","y","z",1,-1,e,t,n,r,i,4),o("x","y","z",-1,-1,e,t,-n,r,i,5),this.setIndex(C),this.addAttribute("position",new Vi(I,3)),this.addAttribute("normal",new Vi(k,3)),this.addAttribute("uv",new Vi(P,2))}function Fa(e){var t={};for(var n in e)for(var r in t[n]={},e[n]){var i=e[n][r];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture)?t[n][r]=i.clone():(0,Ue.default)(i)?t[n][r]=i.slice():t[n][r]=i}return t}function Ba(e){for(var t={},n=0;n<e.length;n++){var r=Fa(e[n]);for(var i in r)t[i]=r[i]}return t}Na.prototype=(0,p.default)((0,l.default)(c.prototype),{constructor:Na,isGeometry:!0,applyMatrix:function(e){for(var t=(new Nn).getNormalMatrix(e),n=0,r=this.vertices.length;n<r;n++){var i=this.vertices[n];i.applyMatrix4(e)}for(n=0,r=this.faces.length;n<r;n++){var a=this.faces[n];a.normal.applyMatrix3(t).normalize();for(var o=0,s=a.vertexNormals.length;o<s;o++)a.vertexNormals[o].applyMatrix3(t).normalize()}return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},rotateX:(ka=new Qn,function(e){return ka.makeRotationX(e),this.applyMatrix(ka),this}),rotateY:(Ia=new Qn,function(e){return Ia.makeRotationY(e),this.applyMatrix(Ia),this}),rotateZ:(Ca=new Qn,function(e){return Ca.makeRotationZ(e),this.applyMatrix(Ca),this}),translate:(Ra=new Qn,function(e,t,n){return Ra.makeTranslation(e,t,n),this.applyMatrix(Ra),this}),scale:(La=new Qn,function(e,t,n){return La.makeScale(e,t,n),this.applyMatrix(La),this}),lookAt:(Aa=new pi,function(e){Aa.lookAt(e),Aa.updateMatrix(),this.applyMatrix(Aa.matrix)}),fromBufferGeometry:function(e){var s=this,t=null!==e.index?e.index.array:void 0,n=e.attributes,r=n.position.array,l=void 0!==n.normal?n.normal.array:void 0,u=void 0!==n.color?n.color.array:void 0,c=void 0!==n.uv?n.uv.array:void 0,h=void 0!==n.uv2?n.uv2.array:void 0;void 0!==h&&(this.faceVertexUvs[1]=[]);for(var i=0;i<r.length;i+=3)s.vertices.push((new Pn).fromArray(r,i)),void 0!==u&&s.colors.push((new Ti).fromArray(u,i));function a(e,t,n,r){var i=void 0===u?[]:[s.colors[e].clone(),s.colors[t].clone(),s.colors[n].clone()],a=void 0===l?[]:[(new Pn).fromArray(l,3*e),(new Pn).fromArray(l,3*t),(new Pn).fromArray(l,3*n)],o=new Ci(e,t,n,a,i,r);s.faces.push(o),void 0!==c&&s.faceVertexUvs[0].push([(new In).fromArray(c,2*e),(new In).fromArray(c,2*t),(new In).fromArray(c,2*n)]),void 0!==h&&s.faceVertexUvs[1].push([(new In).fromArray(h,2*e),(new In).fromArray(h,2*t),(new In).fromArray(h,2*n)])}var o=e.groups;if(0<o.length)for(i=0;i<o.length;i++)for(var f=o[i],d=f.start,p=f.count,m=d,v=d+p;m<v;m+=3)void 0!==t?a(t[m],t[m+1],t[m+2],f.materialIndex):a(m,m+1,m+2,f.materialIndex);else if(void 0!==t)for(i=0;i<t.length;i+=3)a(t[i],t[i+1],t[i+2]);else for(i=0;i<r.length/3;i+=3)a(i,i+1,i+2);return this.computeFaceNormals(),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),this},center:(Ta=new Pn,function(){return this.computeBoundingBox(),this.boundingBox.getCenter(Ta).negate(),this.translate(Ta.x,Ta.y,Ta.z),this}),normalize:function(){this.computeBoundingSphere();var e=this.boundingSphere.center,t=this.boundingSphere.radius,n=0===t?1:1/t,r=new Qn;return r.set(n,0,0,-n*e.x,0,n,0,-n*e.y,0,0,n,-n*e.z,0,0,0,1),this.applyMatrix(r),this},computeFaceNormals:function(){for(var e=new Pn,t=new Pn,n=0,r=this.faces.length;n<r;n++){var i=this.faces[n],a=this.vertices[i.a],o=this.vertices[i.b],s=this.vertices[i.c];e.subVectors(s,o),t.subVectors(a,o),e.cross(t),e.normalize(),i.normal.copy(e)}},computeVertexNormals:function(e){var t,n,r,i,a,o;for(void 0===e&&(e=!0),o=new Array(this.vertices.length),t=0,n=this.vertices.length;t<n;t++)o[t]=new Pn;if(e){var s,l,u,c=new Pn,h=new Pn;for(r=0,i=this.faces.length;r<i;r++)a=this.faces[r],s=this.vertices[a.a],l=this.vertices[a.b],u=this.vertices[a.c],c.subVectors(u,l),h.subVectors(s,l),c.cross(h),o[a.a].add(c),o[a.b].add(c),o[a.c].add(c)}else for(this.computeFaceNormals(),r=0,i=this.faces.length;r<i;r++)a=this.faces[r],o[a.a].add(a.normal),o[a.b].add(a.normal),o[a.c].add(a.normal);for(t=0,n=this.vertices.length;t<n;t++)o[t].normalize();for(r=0,i=this.faces.length;r<i;r++){a=this.faces[r];var f=a.vertexNormals;3===f.length?(f[0].copy(o[a.a]),f[1].copy(o[a.b]),f[2].copy(o[a.c])):(f[0]=o[a.a].clone(),f[1]=o[a.b].clone(),f[2]=o[a.c].clone())}0<this.faces.length&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){var e,t,n;for(this.computeFaceNormals(),e=0,t=this.faces.length;e<t;e++){n=this.faces[e];var r=n.vertexNormals;3===r.length?(r[0].copy(n.normal),r[1].copy(n.normal),r[2].copy(n.normal)):(r[0]=n.normal.clone(),r[1]=n.normal.clone(),r[2]=n.normal.clone())}0<this.faces.length&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){var e,t,n,r,i;for(n=0,r=this.faces.length;n<r;n++)for(i=this.faces[n],i.__originalFaceNormal?i.__originalFaceNormal.copy(i.normal):i.__originalFaceNormal=i.normal.clone(),i.__originalVertexNormals||(i.__originalVertexNormals=[]),e=0,t=i.vertexNormals.length;e<t;e++)i.__originalVertexNormals[e]?i.__originalVertexNormals[e].copy(i.vertexNormals[e]):i.__originalVertexNormals[e]=i.vertexNormals[e].clone();var a=new Na;for(a.faces=this.faces,e=0,t=this.morphTargets.length;e<t;e++){if(!this.morphNormals[e]){this.morphNormals[e]={},this.morphNormals[e].faceNormals=[],this.morphNormals[e].vertexNormals=[];var o=this.morphNormals[e].faceNormals,s=this.morphNormals[e].vertexNormals;for(n=0,r=this.faces.length;n<r;n++)l=new Pn,u={a:new Pn,b:new Pn,c:new Pn},o.push(l),s.push(u)}var l,u,c=this.morphNormals[e];for(a.vertices=this.morphTargets[e].vertices,a.computeFaceNormals(),a.computeVertexNormals(),n=0,r=this.faces.length;n<r;n++)i=this.faces[n],l=c.faceNormals[n],u=c.vertexNormals[n],l.copy(i.normal),u.a.copy(i.vertexNormals[0]),u.b.copy(i.vertexNormals[1]),u.c.copy(i.vertexNormals[2])}for(n=0,r=this.faces.length;n<r;n++)i=this.faces[n],i.normal=i.__originalFaceNormal,i.vertexNormals=i.__originalVertexNormals},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new vi),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new _i),this.boundingSphere.setFromPoints(this.vertices)},merge:function(e,t,n){if(e&&e.isGeometry){var r,i=this.vertices.length,a=this.vertices,o=e.vertices,s=this.faces,l=e.faces,u=this.colors,c=e.colors;void 0===n&&(n=0),void 0!==t&&(r=(new Nn).getNormalMatrix(t));for(var h=0,f=o.length;h<f;h++){var d=o[h],p=d.clone();void 0!==t&&p.applyMatrix4(t),a.push(p)}for(h=0,f=c.length;h<f;h++)u.push(c[h].clone());for(h=0,f=l.length;h<f;h++){var m,v,g,y=l[h],_=y.vertexNormals,x=y.vertexColors;m=new Ci(y.a+i,y.b+i,y.c+i),m.normal.copy(y.normal),void 0!==r&&m.normal.applyMatrix3(r).normalize();for(var w=0,b=_.length;w<b;w++)v=_[w].clone(),void 0!==r&&v.applyMatrix3(r).normalize(),m.vertexNormals.push(v);for(m.color.copy(y.color),w=0,b=x.length;w<b;w++)g=x[w],m.vertexColors.push(g.clone());m.materialIndex=y.materialIndex+n,s.push(m)}for(h=0,f=e.faceVertexUvs.length;h<f;h++){var M=e.faceVertexUvs[h];for(void 0===this.faceVertexUvs[h]&&(this.faceVertexUvs[h]=[]),w=0,b=M.length;w<b;w++){for(var S=M[w],E=[],T=0,A=S.length;T<A;T++)E.push(S[T].clone());this.faceVertexUvs[h].push(E)}}}else console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",e)},mergeMesh:function(e){e&&e.isMesh?(e.matrixAutoUpdate&&e.updateMatrix(),this.merge(e.geometry,e.matrix)):console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",e)},mergeVertices:function(){var e,t,n,r,i,a,o,s,l={},u=[],c=[],h=4,f=Math.pow(10,h);for(n=0,r=this.vertices.length;n<r;n++)e=this.vertices[n],t=Math.round(e.x*f)+"_"+Math.round(e.y*f)+"_"+Math.round(e.z*f),void 0===l[t]?(l[t]=n,u.push(this.vertices[n]),c[n]=u.length-1):c[n]=c[l[t]];var d=[];for(n=0,r=this.faces.length;n<r;n++){i=this.faces[n],i.a=c[i.a],i.b=c[i.b],i.c=c[i.c],a=[i.a,i.b,i.c];for(var p=0;p<3;p++)if(a[p]===a[(p+1)%3]){d.push(n);break}}for(n=d.length-1;0<=n;n--){var m=d[n];for(this.faces.splice(m,1),o=0,s=this.faceVertexUvs.length;o<s;o++)this.faceVertexUvs[o].splice(m,1)}var v=this.vertices.length-u.length;return this.vertices=u,v},setFromPoints:function(e){this.vertices=[];for(var t=0,n=e.length;t<n;t++){var r=e[t];this.vertices.push(new Pn(r.x,r.y,r.z||0))}return this},sortFacesByMaterialIndex:function(){for(var e=this.faces,t=e.length,n=0;n<t;n++)e[n]._id=n;function r(e,t){return e.materialIndex-t.materialIndex}e.sort(r);var i,a,o=this.faceVertexUvs[0],s=this.faceVertexUvs[1];for(o&&o.length===t&&(i=[]),s&&s.length===t&&(a=[]),n=0;n<t;n++){var l=e[n]._id;i&&i.push(o[l]),a&&a.push(s[l])}i&&(this.faceVertexUvs[0]=i),a&&(this.faceVertexUvs[1]=a)},toJSON:function(){var e={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),void 0!==this.parameters){var t=this.parameters;for(var n in t)void 0!==t[n]&&(e[n]=t[n]);return e}for(var r=[],i=0;i<this.vertices.length;i++){var a=this.vertices[i];r.push(a.x,a.y,a.z)}var o=[],s=[],l={},u=[],c={},h=[],f={};for(i=0;i<this.faces.length;i++){var d=this.faces[i],p=!0,m=!1,v=void 0!==this.faceVertexUvs[0][i],g=0<d.normal.length(),y=0<d.vertexNormals.length,_=1!==d.color.r||1!==d.color.g||1!==d.color.b,x=0<d.vertexColors.length,w=0;if(w=E(w,0,0),w=E(w,1,p),w=E(w,2,m),w=E(w,3,v),w=E(w,4,g),w=E(w,5,y),w=E(w,6,_),w=E(w,7,x),o.push(w),o.push(d.a,d.b,d.c),o.push(d.materialIndex),v){var b=this.faceVertexUvs[0][i];o.push(L(b[0]),L(b[1]),L(b[2]))}if(g&&o.push(T(d.normal)),y){var M=d.vertexNormals;o.push(T(M[0]),T(M[1]),T(M[2]))}if(_&&o.push(A(d.color)),x){var S=d.vertexColors;o.push(A(S[0]),A(S[1]),A(S[2]))}}function E(e,t,n){return n?e|1<<t:e&~(1<<t)}function T(e){var t=e.x.toString()+e.y.toString()+e.z.toString();return void 0!==l[t]||(l[t]=s.length/3,s.push(e.x,e.y,e.z)),l[t]}function A(e){var t=e.r.toString()+e.g.toString()+e.b.toString();return void 0!==c[t]||(c[t]=u.length,u.push(e.getHex())),c[t]}function L(e){var t=e.x.toString()+e.y.toString();return void 0!==f[t]||(f[t]=h.length/2,h.push(e.x,e.y)),f[t]}return e.data={},e.data.vertices=r,e.data.normals=s,0<u.length&&(e.data.colors=u),0<h.length&&(e.data.uvs=[h]),e.data.faces=o,e},clone:function(){return(new Na).copy(this)},copy:function(e){var t,n,r,i,a,o;this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=e.name;var s=e.vertices;for(t=0,n=s.length;t<n;t++)this.vertices.push(s[t].clone());var l=e.colors;for(t=0,n=l.length;t<n;t++)this.colors.push(l[t].clone());var u=e.faces;for(t=0,n=u.length;t<n;t++)this.faces.push(u[t].clone());for(t=0,n=e.faceVertexUvs.length;t<n;t++){var c=e.faceVertexUvs[t];for(void 0===this.faceVertexUvs[t]&&(this.faceVertexUvs[t]=[]),r=0,i=c.length;r<i;r++){var h=c[r],f=[];for(a=0,o=h.length;a<o;a++){var d=h[a];f.push(d.clone())}this.faceVertexUvs[t].push(f)}}var p=e.morphTargets;for(t=0,n=p.length;t<n;t++){var m={};if(m.name=p[t].name,void 0!==p[t].vertices)for(m.vertices=[],r=0,i=p[t].vertices.length;r<i;r++)m.vertices.push(p[t].vertices[r].clone());if(void 0!==p[t].normals)for(m.normals=[],r=0,i=p[t].normals.length;r<i;r++)m.normals.push(p[t].normals[r].clone());this.morphTargets.push(m)}var v=e.morphNormals;for(t=0,n=v.length;t<n;t++){var g={};if(void 0!==v[t].vertexNormals)for(g.vertexNormals=[],r=0,i=v[t].vertexNormals.length;r<i;r++){var y=v[t].vertexNormals[r],_={};_.a=y.a.clone(),_.b=y.b.clone(),_.c=y.c.clone(),g.vertexNormals.push(_)}if(void 0!==v[t].faceNormals)for(g.faceNormals=[],r=0,i=v[t].faceNormals.length;r<i;r++)g.faceNormals.push(v[t].faceNormals[r].clone());this.morphNormals.push(g)}var x=e.skinWeights;for(t=0,n=x.length;t<n;t++)this.skinWeights.push(x[t].clone());var w=e.skinIndices;for(t=0,n=w.length;t<n;t++)this.skinIndices.push(w[t].clone());var b=e.lineDistances;for(t=0,n=b.length;t<n;t++)this.lineDistances.push(b[t]);var M=e.boundingBox;null!==M&&(this.boundingBox=M.clone());var S=e.boundingSphere;return null!==S&&(this.boundingSphere=S.clone()),this.elementsNeedUpdate=e.elementsNeedUpdate,this.verticesNeedUpdate=e.verticesNeedUpdate,this.uvsNeedUpdate=e.uvsNeedUpdate,this.normalsNeedUpdate=e.normalsNeedUpdate,this.colorsNeedUpdate=e.colorsNeedUpdate,this.lineDistancesNeedUpdate=e.lineDistancesNeedUpdate,this.groupsNeedUpdate=e.groupsNeedUpdate,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Da.prototype=(0,l.default)(Na.prototype),Da.prototype.constructor=Da,Oa.prototype=(0,l.default)(ba.prototype),Oa.prototype.constructor=Oa;var Ua={clone:Fa,merge:Ba};t.UniformsUtils=Ua;var Ga="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",za="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}";function Va(e){ki.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader=Ga,this.fragmentShader=za,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,void 0!==e&&(void 0!==e.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(e))}function Ha(){pi.call(this),this.type="Camera",this.matrixWorldInverse=new Qn,this.projectionMatrix=new Qn,this.projectionMatrixInverse=new Qn}function Wa(e,t,n,r){Ha.call(this),this.type="PerspectiveCamera",this.fov=void 0!==e?e:50,this.zoom=1,this.near=void 0!==n?n:.1,this.far=void 0!==r?r:2e3,this.focus=10,this.aspect=void 0!==t?t:1,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}Va.prototype=(0,l.default)(ki.prototype),Va.prototype.constructor=Va,Va.prototype.isShaderMaterial=!0,Va.prototype.copy=function(e){return ki.prototype.copy.call(this,e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=Fa(e.uniforms),this.defines=(0,p.default)({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.lights=e.lights,this.clipping=e.clipping,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.extensions=e.extensions,this},Va.prototype.toJSON=function(e){var t=ki.prototype.toJSON.call(this,e);for(var n in t.uniforms={},this.uniforms){var r=this.uniforms[n],i=r.value;i&&i.isTexture?t.uniforms[n]={type:"t",value:i.toJSON(e).uuid}:i&&i.isColor?t.uniforms[n]={type:"c",value:i.getHex()}:i&&i.isVector2?t.uniforms[n]={type:"v2",value:i.toArray()}:i&&i.isVector3?t.uniforms[n]={type:"v3",value:i.toArray()}:i&&i.isVector4?t.uniforms[n]={type:"v4",value:i.toArray()}:i&&i.isMatrix3?t.uniforms[n]={type:"m3",value:i.toArray()}:i&&i.isMatrix4?t.uniforms[n]={type:"m4",value:i.toArray()}:t.uniforms[n]={value:i}}0<(0,m.default)(this.defines).length&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;var a={};for(var o in this.extensions)!0===this.extensions[o]&&(a[o]=!0);return 0<(0,m.default)(a).length&&(t.extensions=a),t},Ha.prototype=(0,p.default)((0,l.default)(pi.prototype),{constructor:Ha,isCamera:!0,copy:function(e,t){return pi.prototype.copy.call(this,e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this},getWorldDirection:function(e){void 0===e&&(console.warn("THREE.Camera: .getWorldDirection() target is now required"),e=new Pn),this.updateMatrixWorld(!0);var t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()},updateMatrixWorld:function(e){pi.prototype.updateMatrixWorld.call(this,e),this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return(new this.constructor).copy(this)}}),Wa.prototype=(0,p.default)((0,l.default)(Ha.prototype),{constructor:Wa,isPerspectiveCamera:!0,copy:function(e,t){return Ha.prototype.copy.call(this,e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:(0,p.default)({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this},setFocalLength:function(e){var t=.5*this.getFilmHeight()/e;this.fov=2*Cn.RAD2DEG*Math.atan(t),this.updateProjectionMatrix()},getFocalLength:function(){var e=Math.tan(.5*Cn.DEG2RAD*this.fov);return.5*this.getFilmHeight()/e},getEffectiveFOV:function(){return 2*Cn.RAD2DEG*Math.atan(Math.tan(.5*Cn.DEG2RAD*this.fov)/this.zoom)},getFilmWidth:function(){return this.filmGauge*Math.min(this.aspect,1)},getFilmHeight:function(){return this.filmGauge/Math.max(this.aspect,1)},setViewOffset:function(e,t,n,r,i,a){this.aspect=e/t,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var e=this.near,t=e*Math.tan(.5*Cn.DEG2RAD*this.fov)/this.zoom,n=2*t,r=this.aspect*n,i=-.5*r,a=this.view;if(null!==this.view&&this.view.enabled){var o=a.fullWidth,s=a.fullHeight;i+=a.offsetX*r/o,t-=a.offsetY*n/s,r*=a.width/o,n*=a.height/s}var l=this.filmOffset;0!==l&&(i+=e*l/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+r,t,t-n,e,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(e){var t=pi.prototype.toJSON.call(this,e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=(0,p.default)({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}});var ja,Ya,qa,Xa,Za,Ja,Ka,Qa,$a=90,eo=1;function to(e,t,n,r){pi.call(this),this.type="CubeCamera";var a=new Wa($a,eo,e,t);a.up.set(0,-1,0),a.lookAt(new Pn(1,0,0)),this.add(a);var o=new Wa($a,eo,e,t);o.up.set(0,-1,0),o.lookAt(new Pn(-1,0,0)),this.add(o);var s=new Wa($a,eo,e,t);s.up.set(0,0,1),s.lookAt(new Pn(0,1,0)),this.add(s);var l=new Wa($a,eo,e,t);l.up.set(0,0,-1),l.lookAt(new Pn(0,-1,0)),this.add(l);var u=new Wa($a,eo,e,t);u.up.set(0,-1,0),u.lookAt(new Pn(0,0,1)),this.add(u);var c=new Wa($a,eo,e,t);c.up.set(0,-1,0),c.lookAt(new Pn(0,0,-1)),this.add(c),r=r||{format:ot,magFilter:Ve,minFilter:Ve},this.renderTarget=new no(n,n,r),this.renderTarget.texture.name="CubeCamera",this.update=function(e,t){null===this.parent&&this.updateMatrixWorld();var n=e.getRenderTarget(),r=this.renderTarget,i=r.texture.generateMipmaps;r.texture.generateMipmaps=!1,e.setRenderTarget(r,0),e.render(t,a),e.setRenderTarget(r,1),e.render(t,o),e.setRenderTarget(r,2),e.render(t,s),e.setRenderTarget(r,3),e.render(t,l),e.setRenderTarget(r,4),e.render(t,u),r.texture.generateMipmaps=i,e.setRenderTarget(r,5),e.render(t,c),e.setRenderTarget(n)},this.clear=function(e,t,n,r){for(var i=e.getRenderTarget(),a=this.renderTarget,o=0;o<6;o++)e.setRenderTarget(a,o),e.clear(t,n,r);e.setRenderTarget(i)}}function no(e,t,n){Jn.call(this,e,t,n)}function ro(e,t,n,r,i,a,o,s,l,u,c,h){Xn.call(this,null,a,o,s,l,u,r,i,c,h),this.image={data:e,width:t,height:n},this.magFilter=void 0!==l?l:Ne,this.minFilter=void 0!==u?u:Ne,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}function io(e,t){this.normal=void 0!==e?e:new Pn(1,0,0),this.constant=void 0!==t?t:0}function ao(e,t,n,r,i,a){this.planes=[void 0!==e?e:new io,void 0!==t?t:new io,void 0!==n?n:new io,void 0!==r?r:new io,void 0!==i?i:new io,void 0!==a?a:new io]}to.prototype=(0,l.default)(pi.prototype),to.prototype.constructor=to,no.prototype=(0,l.default)(Jn.prototype),no.prototype.constructor=no,no.prototype.isWebGLRenderTargetCube=!0,no.prototype.fromEquirectangularTexture=function(e,t){this.texture.type=t.type,this.texture.format=t.format,this.texture.encoding=t.encoding;var n=new mi,r={uniforms:{tEquirect:{value:null}},vertexShader:["varying vec3 vWorldDirection;","vec3 transformDirection( in vec3 dir, in mat4 matrix ) {","\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );","}","void main() {","\tvWorldDirection = transformDirection( position, modelMatrix );","\t#include <begin_vertex>","\t#include <project_vertex>","}"].join("\n"),fragmentShader:["uniform sampler2D tEquirect;","varying vec3 vWorldDirection;","#define RECIPROCAL_PI 0.31830988618","#define RECIPROCAL_PI2 0.15915494","void main() {","\tvec3 direction = normalize( vWorldDirection );","\tvec2 sampleUV;","\tsampleUV.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;","\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;","\tgl_FragColor = texture2D( tEquirect, sampleUV );","}"].join("\n")},i=new Va({type:"CubemapFromEquirect",uniforms:Fa(r.uniforms),vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,side:Ge,blending:me});i.uniforms.tEquirect.value=t;var a=new Ma(new Oa(5,5,5),i);n.add(a);var o=new to(1,10,1);return o.renderTarget=this,o.renderTarget.texture.name="CubeCameraTexture",o.update(e,n),a.geometry.dispose(),a.material.dispose(),this},ro.prototype=(0,l.default)(Xn.prototype),ro.prototype.constructor=ro,ro.prototype.isDataTexture=!0,(0,p.default)(io.prototype,{isPlane:!0,set:function(e,t){return this.normal.copy(e),this.constant=t,this},setComponents:function(e,t,n,r){return this.normal.set(e,t,n),this.constant=r,this},setFromNormalAndCoplanarPoint:function(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this},setFromCoplanarPoints:(Xa=new Pn,Za=new Pn,function(e,t,n){var r=Xa.subVectors(n,t).cross(Za.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}),clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.normal.copy(e.normal),this.constant=e.constant,this},normalize:function(){var e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(e){return this.normal.dot(e)+this.constant},distanceToSphere:function(e){return this.distanceToPoint(e.center)-e.radius},projectPoint:function(e,t){return void 0===t&&(console.warn("THREE.Plane: .projectPoint() target is now required"),t=new Pn),t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)},intersectLine:(qa=new Pn,function(e,t){void 0===t&&(console.warn("THREE.Plane: .intersectLine() target is now required"),t=new Pn);var n=e.delta(qa),r=this.normal.dot(n);if(0===r)return 0===this.distanceToPoint(e.start)?t.copy(e.start):void 0;var i=-(e.start.dot(this.normal)+this.constant)/r;return i<0||1<i?void 0:t.copy(n).multiplyScalar(i).add(e.start)}),intersectsLine:function(e){var t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&0<n||n<0&&0<t},intersectsBox:function(e){return e.intersectsPlane(this)},intersectsSphere:function(e){return e.intersectsPlane(this)},coplanarPoint:function(e){return void 0===e&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),e=new Pn),e.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:(ja=new Pn,Ya=new Nn,function(e,t){var n=t||Ya.getNormalMatrix(e),r=this.coplanarPoint(ja).applyMatrix4(e),i=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(i),this}),translate:function(e){return this.constant-=e.dot(this.normal),this},equals:function(e){return e.normal.equals(this.normal)&&e.constant===this.constant}}),(0,p.default)(ao.prototype,{set:function(e,t,n,r,i,a){var o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(n),o[3].copy(r),o[4].copy(i),o[5].copy(a),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){for(var t=this.planes,n=0;n<6;n++)t[n].copy(e.planes[n]);return this},setFromMatrix:function(e){var t=this.planes,n=e.elements,r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],l=n[5],u=n[6],c=n[7],h=n[8],f=n[9],d=n[10],p=n[11],m=n[12],v=n[13],g=n[14],y=n[15];return t[0].setComponents(o-r,c-s,p-h,y-m).normalize(),t[1].setComponents(o+r,c+s,p+h,y+m).normalize(),t[2].setComponents(o+i,c+l,p+f,y+v).normalize(),t[3].setComponents(o-i,c-l,p-f,y-v).normalize(),t[4].setComponents(o-a,c-u,p-d,y-g).normalize(),t[5].setComponents(o+a,c+u,p+d,y+g).normalize(),this},intersectsObject:(Qa=new _i,function(e){var t=e.geometry;return null===t.boundingSphere&&t.computeBoundingSphere(),Qa.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(Qa)}),intersectsSprite:(Ka=new _i,function(e){return Ka.center.set(0,0,0),Ka.radius=.7071067811865476,Ka.applyMatrix4(e.matrixWorld),this.intersectsSphere(Ka)}),intersectsSphere:function(e){for(var t=this.planes,n=e.center,r=-e.radius,i=0;i<6;i++){var a=t[i].distanceToPoint(n);if(a<r)return!1}return!0},intersectsBox:(Ja=new Pn,function(e){for(var t=this.planes,n=0;n<6;n++){var r=t[n];if(Ja.x=0<r.normal.x?e.max.x:e.min.x,Ja.y=0<r.normal.y?e.max.y:e.min.y,Ja.z=0<r.normal.z?e.max.z:e.min.z,r.distanceToPoint(Ja)<0)return!1}return!0}),containsPoint:function(e){for(var t=this.planes,n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}});var oo="#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif",so="#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",lo="#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif",uo="#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( PHYSICAL )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\t#endif\n#endif",co="#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",ho="vec3 transformed = vec3( position );",fo="vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",po="vec2 integrateSpecularBRDF( const in float dotNV, const in float roughness ) {\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\treturn vec2( -1.04, 1.04 ) * a004 + r.zw;\n}\nfloat punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\tif( cutoffDistance > 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n#else\n\tif( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t}\n\treturn 1.0;\n#endif\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nvec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV );\n\tvec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0;\n\treturn Fr * fresnel + F0;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nvec3 BRDF_Specular_GGX_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\treturn specularColor * brdf.x + brdf.y;\n}\nvoid BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tvec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\tvec3 FssEss = F * brdf.x + brdf.y;\n\tfloat Ess = brdf.x + brdf.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}",mo="#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tfDet *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",vo="#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vViewPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vViewPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",go="#if NUM_CLIPPING_PLANES > 0\n\t#if ! defined( PHYSICAL ) && ! defined( PHONG ) && ! defined( MATCAP )\n\t\tvarying vec3 vViewPosition;\n\t#endif\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",yo="#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG ) && ! defined( MATCAP )\n\tvarying vec3 vViewPosition;\n#endif",_o="#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG ) && ! defined( MATCAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif",xo="#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",wo="#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",bo="#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",Mo="#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",So="#define PI 3.14159265359\n#define PI2 6.28318530718\n#define PI_HALF 1.5707963267949\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#define whiteCompliment(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract(sin(sn) * c);\n}\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\n}",Eo="#ifdef ENVMAP_TYPE_CUBE_UV\n#define cubeUV_textureSize (1024.0)\nint getFaceFromDirection(vec3 direction) {\n\tvec3 absDirection = abs(direction);\n\tint face = -1;\n\tif( absDirection.x > absDirection.z ) {\n\t\tif(absDirection.x > absDirection.y )\n\t\t\tface = direction.x > 0.0 ? 0 : 3;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\telse {\n\t\tif(absDirection.z > absDirection.y )\n\t\t\tface = direction.z > 0.0 ? 2 : 5;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\treturn face;\n}\n#define cubeUV_maxLods1 (log2(cubeUV_textureSize*0.25) - 1.0)\n#define cubeUV_rangeClamp (exp2((6.0 - 1.0) * 2.0))\nvec2 MipLevelInfo( vec3 vec, float roughnessLevel, float roughness ) {\n\tfloat scale = exp2(cubeUV_maxLods1 - roughnessLevel);\n\tfloat dxRoughness = dFdx(roughness);\n\tfloat dyRoughness = dFdy(roughness);\n\tvec3 dx = dFdx( vec * scale * dxRoughness );\n\tvec3 dy = dFdy( vec * scale * dyRoughness );\n\tfloat d = max( dot( dx, dx ), dot( dy, dy ) );\n\td = clamp(d, 1.0, cubeUV_rangeClamp);\n\tfloat mipLevel = 0.5 * log2(d);\n\treturn vec2(floor(mipLevel), fract(mipLevel));\n}\n#define cubeUV_maxLods2 (log2(cubeUV_textureSize*0.25) - 2.0)\n#define cubeUV_rcpTextureSize (1.0 / cubeUV_textureSize)\nvec2 getCubeUV(vec3 direction, float roughnessLevel, float mipLevel) {\n\tmipLevel = roughnessLevel > cubeUV_maxLods2 - 3.0 ? 0.0 : mipLevel;\n\tfloat a = 16.0 * cubeUV_rcpTextureSize;\n\tvec2 exp2_packed = exp2( vec2( roughnessLevel, mipLevel ) );\n\tvec2 rcp_exp2_packed = vec2( 1.0 ) / exp2_packed;\n\tfloat powScale = exp2_packed.x * exp2_packed.y;\n\tfloat scale = rcp_exp2_packed.x * rcp_exp2_packed.y * 0.25;\n\tfloat mipOffset = 0.75*(1.0 - rcp_exp2_packed.y) * rcp_exp2_packed.x;\n\tbool bRes = mipLevel == 0.0;\n\tscale = bRes && (scale < a) ? a : scale;\n\tvec3 r;\n\tvec2 offset;\n\tint face = getFaceFromDirection(direction);\n\tfloat rcpPowScale = 1.0 / powScale;\n\tif( face == 0) {\n\t\tr = vec3(direction.x, -direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 1) {\n\t\tr = vec3(direction.y, direction.x, direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 2) {\n\t\tr = vec3(direction.z, direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 3) {\n\t\tr = vec3(direction.x, direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse if( face == 4) {\n\t\tr = vec3(direction.y, direction.x, -direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse {\n\t\tr = vec3(direction.z, -direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\tr = normalize(r);\n\tfloat texelOffset = 0.5 * cubeUV_rcpTextureSize;\n\tvec2 s = ( r.yz / abs( r.x ) + vec2( 1.0 ) ) * 0.5;\n\tvec2 base = offset + vec2( texelOffset );\n\treturn base + s * ( scale - 2.0 * texelOffset );\n}\n#define cubeUV_maxLods3 (log2(cubeUV_textureSize*0.25) - 3.0)\nvec4 textureCubeUV( sampler2D envMap, vec3 reflectedDirection, float roughness ) {\n\tfloat roughnessVal = roughness* cubeUV_maxLods3;\n\tfloat r1 = floor(roughnessVal);\n\tfloat r2 = r1 + 1.0;\n\tfloat t = fract(roughnessVal);\n\tvec2 mipInfo = MipLevelInfo(reflectedDirection, r1, roughness);\n\tfloat s = mipInfo.y;\n\tfloat level0 = mipInfo.x;\n\tfloat level1 = level0 + 1.0;\n\tlevel1 = level1 > 5.0 ? 5.0 : level1;\n\tlevel0 += min( floor( s + 0.5 ), 5.0 );\n\tvec2 uv_10 = getCubeUV(reflectedDirection, r1, level0);\n\tvec4 color10 = envMapTexelToLinear(texture2D(envMap, uv_10));\n\tvec2 uv_20 = getCubeUV(reflectedDirection, r2, level0);\n\tvec4 color20 = envMapTexelToLinear(texture2D(envMap, uv_20));\n\tvec4 result = mix(color10, color20, t);\n\treturn vec4(result.rgb, 1.0);\n}\n#endif",To="vec3 transformedNormal = normalMatrix * objectNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = normalMatrix * objectTangent;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",Ao="#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",Lo="#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif",Ro="#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",Co="#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",Io="gl_FragColor = linearToOutputTexel( gl_FragColor );",ko="\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * value.a * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\tD = min( floor( D ) / 255.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n\tvec3 Xp_Y_XYZp = cLogLuvM * value.rgb;\n\tXp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) );\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract( Le );\n\tvResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0;\n\treturn vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 );\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;\n\treturn vec4( max( vRGB, 0.0 ), 1.0 );\n}",Po="#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\tvec2 sampleUV;\n\t\treflectVec = normalize( reflectVec );\n\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\treflectVec = normalize( reflectVec );\n\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) );\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\tenvColor = envMapTexelToLinear( envColor );\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",No="#if defined( USE_ENVMAP ) || defined( PHYSICAL )\n\tuniform float reflectivity;\n\tuniform float envMapIntensity;\n#endif\n#ifdef USE_ENVMAP\n\t#if ! defined( PHYSICAL ) && ( defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) )\n\t\tvarying vec3 vWorldPosition;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( PHYSICAL )\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",Do="#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",Oo="#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",Fo="#ifdef USE_FOG\n\tfogDepth = -mvPosition.z;\n#endif",Bo="#ifdef USE_FOG\n\tvarying float fogDepth;\n#endif",Uo="#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * fogDepth * fogDepth * LOG2 ) );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",Go="#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float fogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",zo="#ifdef TOON\n\tuniform sampler2D gradientMap;\n\tvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\t\tfloat dotNL = dot( normal, lightDirection );\n\t\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t\t#ifdef USE_GRADIENTMAP\n\t\t\treturn texture2D( gradientMap, coord ).rgb;\n\t\t#else\n\t\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t\t#endif\n\t}\n#endif",Vo="#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif",Ho="#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",Wo="vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n#endif",jo="uniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) {\n\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t\tfloat shadowCameraNear;\n\t\tfloat shadowCameraFar;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tdirectLight.color = pointLight.color;\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( angleCos > spotLight.coneCos ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif",Yo="#if defined( USE_ENVMAP ) && defined( PHYSICAL )\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, queryVec, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + 0.79248 - 0.5 * log2( pow2( blinnShininessExponent ) + 1.0 );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in GeometricContext geometry, const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -geometry.viewDir, geometry.normal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -geometry.viewDir, geometry.normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( blinnShininessExponent, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, queryReflectVec, BlinnExponentToGGXRoughness(blinnShininessExponent ));\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\t\tvec2 sampleUV;\n\t\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\t\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0,0.0,1.0 ) );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif",qo="BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",Xo="varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\t#ifdef TOON\n\t\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\t#else\n\t\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\t\tvec3 irradiance = dotNL * directLight.color;\n\t#endif\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)",Zo="PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nmaterial.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );\n#ifdef STANDARD\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.clearCoat = saturate( clearCoat );\tmaterial.clearCoatRoughness = clamp( clearCoatRoughness, 0.04, 1.0 );\n#endif",Jo="struct PhysicalMaterial {\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n\t#ifndef STANDARD\n\t\tfloat clearCoat;\n\t\tfloat clearCoatRoughness;\n\t#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearCoatDHRApprox( const in float roughness, const in float dotNL ) {\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.specularRoughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\t#ifndef STANDARD\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\n\t#else\n\t\tfloat clearCoatDHR = 0.0;\n\t#endif\n\treflectedLight.directSpecular += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry, material.specularColor, material.specularRoughness );\n\treflectedLight.directDiffuse += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\t#ifndef STANDARD\n\t\treflectedLight.directSpecular += irradiance * material.clearCoat * BRDF_Specular_GGX( directLight, geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\n\t#endif\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t#ifndef ENVMAP_TYPE_CUBE_UV\n\t\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\t#endif\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearCoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifndef STANDARD\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\tfloat dotNL = dotNV;\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\n\t#else\n\t\tfloat clearCoatDHR = 0.0;\n\t#endif\n\tfloat clearCoatInv = 1.0 - clearCoatDHR;\n\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec3 singleScattering = vec3( 0.0 );\n\t\tvec3 multiScattering = vec3( 0.0 );\n\t\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\t\tBRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering );\n\t\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\t\treflectedLight.indirectSpecular += clearCoatInv * radiance * singleScattering;\n\t\treflectedLight.indirectDiffuse += multiScattering * cosineWeightedIrradiance;\n\t\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n\t#else\n\t\treflectedLight.indirectSpecular += clearCoatInv * radiance * BRDF_Specular_GGX_Environment( geometry, material.specularColor, material.specularRoughness );\n\t#endif\n\t#ifndef STANDARD\n\t\treflectedLight.indirectSpecular += clearCoatRadiance * material.clearCoat * BRDF_Specular_GGX_Environment( geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\n\t#endif\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\n#define Material_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.specularRoughness )\n#define Material_ClearCoat_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.clearCoatRoughness )\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",Ko="\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = normalize( vViewPosition );\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( pointLight.shadow, directLight.visible ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( spotLight.shadow, directLight.visible ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( directionalLight.shadow, directLight.visible ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearCoatRadiance = vec3( 0.0 );\n#endif",Qo="#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec3 lightMapIrradiance = texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( PHYSICAL ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tirradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getLightProbeIndirectRadiance( geometry, Material_BlinnShininessExponent( material ), maxMipLevel );\n\t#ifndef STANDARD\n\t\tclearCoatRadiance += getLightProbeIndirectRadiance( geometry, Material_ClearCoat_BlinnShininessExponent( material ), maxMipLevel );\n\t#endif\n#endif",$o="#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, irradiance, clearCoatRadiance, geometry, material, reflectedLight );\n#endif",es="#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",ts="#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n#endif",ns="#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",rs="#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t#else\n\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\tgl_Position.z *= gl_Position.w;\n\t#endif\n#endif",is="#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\t#ifdef USE_MAP_MIXCOLOR\n diffuseColor = texelColor*texelColor.a + diffuseColor*(1.0-texelColor.a);\n #else\n diffuseColor *= texelColor;\n #endif\n #endif\n",as="#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",os="#ifdef USE_MAP\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif",ss="#ifdef USE_MAP\n\tuniform mat3 uvTransform;\n\tuniform sampler2D map;\n#endif",ls="float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",us="#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",cs="#ifdef USE_MORPHNORMALS\n\tobjectNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\n\tobjectNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\n\tobjectNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\n\tobjectNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\n#endif",hs="#ifdef USE_MORPHTARGETS\n\t#ifndef USE_MORPHNORMALS\n\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",fs="#ifdef USE_MORPHTARGETS\n\ttransformed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\n\ttransformed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\n\ttransformed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\n\ttransformed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\ttransformed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\n\ttransformed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\n\ttransformed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\n\ttransformed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\n\t#endif\n#endif",ds="#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t\tbitangent = bitangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#endif\n\t#endif\n#endif",ps="#ifdef USE_NORMALMAP\n\t#ifdef OBJECTSPACE_NORMALMAP\n\t\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\t#ifdef FLIP_SIDED\n\t\t\tnormal = - normal;\n\t\t#endif\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#endif\n\t\tnormal = normalize( normalMatrix * normal );\n\t#else\n\t\t#ifdef USE_TANGENT\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\t\tmapN.xy = normalScale * mapN.xy;\n\t\t\tnormal = normalize( vTBN * mapN );\n\t\t#else\n\t\t\tnormal = perturbNormal2Arb( -vViewPosition, normal );\n\t\t#endif\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif",ms="#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\t#ifdef OBJECTSPACE_NORMALMAP\n\t\tuniform mat3 normalMatrix;\n\t#else\n\t\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\n\t\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\t\tvec2 st0 = dFdx( vUv.st );\n\t\t\tvec2 st1 = dFdy( vUv.st );\n\t\t\tfloat scale = sign( st1.t * st0.s - st0.t * st1.s );\n\t\t\tvec3 S = normalize( ( q0 * st1.t - q1 * st0.t ) * scale );\n\t\t\tvec3 T = normalize( ( - q0 * st1.s + q1 * st0.s ) * scale );\n\t\t\tvec3 N = normalize( surf_norm );\n\t\t\tmat3 tsn = mat3( S, T, N );\n\t\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\t\tmapN.xy *= normalScale;\n\t\t\tmapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t\treturn normalize( tsn * mapN );\n\t\t}\n\t#endif\n#endif",vs="vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}",gs="#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",ys="vec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\ngl_Position = projectionMatrix * mvPosition;",_s="#if defined( DITHERING )\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",xs="#if defined( DITHERING )\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",ws="float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",bs="#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",Ms="#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\t float result=0.0;\n\t if(step( compare,unpackRGBAToDepth( texture2D( depths, uv ) )) >=1.0){\n\t result=1.0;\n\t}else{\n\t result = 0.8-unpackRGBAToDepth( texture2D( depths, uv ) );\n\t}\n\t return result;\n\t}\n\tfloat texture2DShadowLerp( sampler2D depths, vec2 size, vec2 uv, float compare ) {\n\t\tconst vec2 offset = vec2( 0.0, 1.0 );\n\t\tvec2 texelSize = vec2( 1.0 ) / size;\n\t\tvec2 centroidUV = floor( uv * size + 0.5 ) / size;\n\t\tfloat lb = texture2DCompare( depths, centroidUV + texelSize * offset.xx, compare );\n\t\tfloat lt = texture2DCompare( depths, centroidUV + texelSize * offset.xy, compare );\n\t\tfloat rb = texture2DCompare( depths, centroidUV + texelSize * offset.yx, compare );\n\t\tfloat rt = texture2DCompare( depths, centroidUV + texelSize * offset.yy, compare );\n\t\tvec2 f = fract( uv * size + 0.5 );\n\t\tfloat a = mix( lb, lt, f.y );\n\t\tfloat b = mix( rb, rt, f.y );\n\t\tfloat c = mix( a, b, f.x );\n\t\treturn c;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tshadow = (\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",Ss="#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n#endif",Es="#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n#endif",Ts="float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tDirectionalLight directionalLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tshadow *= bool( directionalLight.shadow ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tSpotLight spotLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tshadow *= bool( spotLight.shadow ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tPointLight pointLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tshadow *= bool( pointLight.shadow ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#endif\n\t#endif\n\treturn shadow;\n}",As="#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",Ls="#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform highp sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif",Rs="#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",Cs="#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",Is="float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",ks="#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",Ps="#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",Ns="#ifndef saturate\n\t#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nuniform float toneMappingWhitePoint;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\nvec3 Uncharted2ToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( ( color * ( 2.51 * color + 0.03 ) ) / ( color * ( 2.43 * color + 0.59 ) + 0.14 ) );\n}",Ds="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n#endif",Os="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif",Fs="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",Bs="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",Us="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",Gs="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",zs="#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n\tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\n#endif",Vs="uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",Hs="varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",Ws="uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",js="varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",Ys="#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <logdepthbuf_fragment>\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - gl_FragCoord.z ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( gl_FragCoord.z );\n\t#endif\n}",qs="#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n}",Xs="#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",Zs="#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}",Js="uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV;\n\tsampleUV.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n\tvec4 texColor = texture2D( tEquirect, sampleUV );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",Ks="varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}",Qs="uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",$s="uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\tvLineDistance = scale * lineDistance;\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",el="uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\treflectedLight.indirectDiffuse += texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",tl="#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_ENVMAP\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}",nl="uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <emissivemap_fragment>\n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\t#else\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\t#endif\n\t#include <lightmap_fragment>\n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",rl="#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_lambert_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",il="#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t\tmatcapColor = matcapTexelToLinear( matcapColor );\n\t#else\n\t\tvec4 matcapColor = vec4( 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",al="#define MATCAP\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#ifndef FLAT_SHADED\n\t\tvNormal = normalize( transformedNormal );\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}",ol="#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",sl="#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",ll="#define PHYSICAL\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifndef STANDARD\n\tuniform float clearCoat;\n\tuniform float clearCoatRoughness;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <envmap_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <lights_physical_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",ul="#define PHYSICAL\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",cl="#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || ( defined( USE_NORMALMAP ) && ! defined( OBJECTSPACE_NORMALMAP ) )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}",hl="#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || ( defined( USE_NORMALMAP ) && ! defined( OBJECTSPACE_NORMALMAP ) )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || ( defined( USE_NORMALMAP ) && ! defined( OBJECTSPACE_NORMALMAP ) )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",fl="uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",dl="uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}",pl="uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <fog_fragment>\n}",ml="#include <fog_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",vl="uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",gl="uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",yl={alphamap_fragment:oo,alphamap_pars_fragment:so,alphatest_fragment:lo,aomap_fragment:uo,aomap_pars_fragment:co,begin_vertex:ho,beginnormal_vertex:fo,bsdfs:po,bumpmap_pars_fragment:mo,clipping_planes_fragment:vo,clipping_planes_pars_fragment:go,clipping_planes_pars_vertex:yo,clipping_planes_vertex:_o,color_fragment:xo,color_pars_fragment:wo,color_pars_vertex:bo,color_vertex:Mo,common:So,cube_uv_reflection_fragment:Eo,defaultnormal_vertex:To,displacementmap_pars_vertex:Ao,displacementmap_vertex:Lo,emissivemap_fragment:Ro,emissivemap_pars_fragment:Co,encodings_fragment:Io,encodings_pars_fragment:ko,envmap_fragment:Po,envmap_pars_fragment:No,envmap_pars_vertex:Do,envmap_physical_pars_fragment:Yo,envmap_vertex:Oo,fog_vertex:Fo,fog_pars_vertex:Bo,fog_fragment:Uo,fog_pars_fragment:Go,gradientmap_pars_fragment:zo,lightmap_fragment:Vo,lightmap_pars_fragment:Ho,lights_lambert_vertex:Wo,lights_pars_begin:jo,lights_phong_fragment:qo,lights_phong_pars_fragment:Xo,lights_physical_fragment:Zo,lights_physical_pars_fragment:Jo,lights_fragment_begin:Ko,lights_fragment_maps:Qo,lights_fragment_end:$o,logdepthbuf_fragment:es,logdepthbuf_pars_fragment:ts,logdepthbuf_pars_vertex:ns,logdepthbuf_vertex:rs,map_fragment:is,map_pars_fragment:as,map_particle_fragment:os,map_particle_pars_fragment:ss,metalnessmap_fragment:ls,metalnessmap_pars_fragment:us,morphnormal_vertex:cs,morphtarget_pars_vertex:hs,morphtarget_vertex:fs,normal_fragment_begin:ds,normal_fragment_maps:ps,normalmap_pars_fragment:ms,packing:vs,premultiplied_alpha_fragment:gs,project_vertex:ys,dithering_fragment:_s,dithering_pars_fragment:xs,roughnessmap_fragment:ws,roughnessmap_pars_fragment:bs,shadowmap_pars_fragment:Ms,shadowmap_pars_vertex:Ss,shadowmap_vertex:Es,shadowmask_pars_fragment:Ts,skinbase_vertex:As,skinning_pars_vertex:Ls,skinning_vertex:Rs,skinnormal_vertex:Cs,specularmap_fragment:Is,specularmap_pars_fragment:ks,tonemapping_fragment:Ps,tonemapping_pars_fragment:Ns,uv_pars_fragment:Ds,uv_pars_vertex:Os,uv_vertex:Fs,uv2_pars_fragment:Bs,uv2_pars_vertex:Us,uv2_vertex:Gs,worldpos_vertex:zs,background_frag:Vs,background_vert:Hs,cube_frag:Ws,cube_vert:js,depth_frag:Ys,depth_vert:qs,distanceRGBA_frag:Xs,distanceRGBA_vert:Zs,equirect_frag:Js,equirect_vert:Ks,linedashed_frag:Qs,linedashed_vert:$s,meshbasic_frag:el,meshbasic_vert:tl,meshlambert_frag:nl,meshlambert_vert:rl,meshmatcap_frag:il,meshmatcap_vert:al,meshphong_frag:ol,meshphong_vert:sl,meshphysical_frag:ll,meshphysical_vert:ul,normal_frag:cl,normal_vert:hl,points_frag:fl,points_vert:dl,shadow_frag:pl,shadow_vert:ml,sprite_frag:vl,sprite_vert:gl};t.ShaderChunk=yl;var _l={common:{diffuse:{value:new Ti(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new Nn},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new In(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Ti(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}}},points:{diffuse:{value:new Ti(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},uvTransform:{value:new Nn}},sprite:{diffuse:{value:new Ti(15658734)},opacity:{value:1},center:{value:new In(.5,.5)},rotation:{value:0},map:{value:null},uvTransform:{value:new Nn}}};t.UniformsLib=_l;var xl={basic:{uniforms:Ba([_l.common,_l.specularmap,_l.envmap,_l.aomap,_l.lightmap,_l.fog]),vertexShader:yl.meshbasic_vert,fragmentShader:yl.meshbasic_frag},lambert:{uniforms:Ba([_l.common,_l.specularmap,_l.envmap,_l.aomap,_l.lightmap,_l.emissivemap,_l.fog,_l.lights,{emissive:{value:new Ti(0)}}]),vertexShader:yl.meshlambert_vert,fragmentShader:yl.meshlambert_frag},phong:{uniforms:Ba([_l.common,_l.specularmap,_l.envmap,_l.aomap,_l.lightmap,_l.emissivemap,_l.bumpmap,_l.normalmap,_l.displacementmap,_l.gradientmap,_l.fog,_l.lights,{emissive:{value:new Ti(0)},specular:{value:new Ti(1118481)},shininess:{value:30}}]),vertexShader:yl.meshphong_vert,fragmentShader:yl.meshphong_frag},standard:{uniforms:Ba([_l.common,_l.envmap,_l.aomap,_l.lightmap,_l.emissivemap,_l.bumpmap,_l.normalmap,_l.displacementmap,_l.roughnessmap,_l.metalnessmap,_l.fog,_l.lights,{emissive:{value:new Ti(0)},roughness:{value:.5},metalness:{value:.5},envMapIntensity:{value:1}}]),vertexShader:yl.meshphysical_vert,fragmentShader:yl.meshphysical_frag},matcap:{uniforms:Ba([_l.common,_l.bumpmap,_l.normalmap,_l.displacementmap,_l.fog,{matcap:{value:null}}]),vertexShader:yl.meshmatcap_vert,fragmentShader:yl.meshmatcap_frag},points:{uniforms:Ba([_l.points,_l.fog]),vertexShader:yl.points_vert,fragmentShader:yl.points_frag},dashed:{uniforms:Ba([_l.common,_l.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:yl.linedashed_vert,fragmentShader:yl.linedashed_frag},depth:{uniforms:Ba([_l.common,_l.displacementmap]),vertexShader:yl.depth_vert,fragmentShader:yl.depth_frag},normal:{uniforms:Ba([_l.common,_l.bumpmap,_l.normalmap,_l.displacementmap,{opacity:{value:1}}]),vertexShader:yl.normal_vert,fragmentShader:yl.normal_frag},sprite:{uniforms:Ba([_l.sprite,_l.fog]),vertexShader:yl.sprite_vert,fragmentShader:yl.sprite_frag},background:{uniforms:{uvTransform:{value:new Nn},t2D:{value:null}},vertexShader:yl.background_vert,fragmentShader:yl.background_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:yl.cube_vert,fragmentShader:yl.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:yl.equirect_vert,fragmentShader:yl.equirect_frag},distanceRGBA:{uniforms:Ba([_l.common,_l.displacementmap,{referencePosition:{value:new Pn},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:yl.distanceRGBA_vert,fragmentShader:yl.distanceRGBA_frag},shadow:{uniforms:Ba([_l.lights,_l.fog,{color:{value:new Ti(0)},opacity:{value:1}}]),vertexShader:yl.shadow_vert,fragmentShader:yl.shadow_frag}};function wl(){var n=null,r=!1,i=null;function a(e,t){!1!==r&&(i(e,t),n.requestAnimationFrame(a))}return{start:function(){!0!==r&&null!==i&&(n.requestAnimationFrame(a),r=!0)},stop:function(){r=!1},setAnimationLoop:function(e){i=e},setContext:function(e){n=e}}}function bl(o){var r=new s.default;function i(e,t){var n=e.array,r=e.dynamic?35048:35044,i=o.createBuffer();o.bindBuffer(t,i),o.bufferData(t,n,r),e.onUploadCallback();var a=5126;return n instanceof Float32Array?a=5126:n instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):n instanceof Uint16Array?a=5123:n instanceof Int16Array?a=5122:n instanceof Uint32Array?a=5125:n instanceof Int32Array?a=5124:n instanceof Int8Array?a=5120:n instanceof Uint8Array&&(a=5121),{buffer:i,type:a,bytesPerElement:n.BYTES_PER_ELEMENT,version:e.version}}function a(e,t,n){var r=t.array,i=t.updateRange;o.bindBuffer(n,e),!1===t.dynamic?o.bufferData(n,r,35044):-1===i.count?o.bufferSubData(n,0,r):0===i.count?console.error("THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually."):(o.bufferSubData(n,i.offset*r.BYTES_PER_ELEMENT,r.subarray(i.offset,i.offset+i.count)),i.count=-1)}function e(e){return e.isInterleavedBufferAttribute&&(e=e.data),r.get(e)}function t(e){e.isInterleavedBufferAttribute&&(e=e.data);var t=r.get(e);t&&(o.deleteBuffer(t.buffer),r.delete(e))}function n(e,t){e.isInterleavedBufferAttribute&&(e=e.data);var n=r.get(e);void 0===n?r.set(e,i(e,t)):n.version<e.version&&(a(n.buffer,e,t),n.version=e.version)}return{get:e,remove:t,update:n}}function Ml(e,t,n,r){Na.call(this),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:r},this.fromBufferGeometry(new Sl(e,t,n,r)),this.mergeVertices()}function Sl(e,t,n,r){ba.call(this),this.type="PlaneBufferGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:r},e=e||1,t=t||1;var i,a,o=e/2,s=t/2,l=Math.floor(n)||1,u=Math.floor(r)||1,c=l+1,h=u+1,f=e/l,d=t/u,p=[],m=[],v=[],g=[];for(a=0;a<h;a++){var y=a*d-s;for(i=0;i<c;i++){var _=i*f-o;m.push(_,-y,0),v.push(0,0,1),g.push(i/l),g.push(1-a/u)}}for(a=0;a<u;a++)for(i=0;i<l;i++){var x=i+c*a,w=i+c*(a+1),b=i+1+c*(a+1),M=i+1+c*a;p.push(x,w,M),p.push(w,b,M)}this.setIndex(p),this.addAttribute("position",new Vi(m,3)),this.addAttribute("normal",new Vi(v,3)),this.addAttribute("uv",new Vi(g,2))}function El(l,n,u,r){var c,h,f=new Ti(0),d=0,p=null,m=0;function e(e,t,n,r){var i=t.background,a=l.vr,o=a.getSession&&a.getSession();if(o&&"additive"===o.environmentBlendMode&&(i=null),null===i?(v(f,d),p=null,m=0):i&&i.isColor&&(v(i,1),r=!0,p=null,m=0),(l.autoClear||r)&&l.clear(l.autoClearColor,l.autoClearDepth,l.autoClearStencil),i&&(i.isCubeTexture||i.isWebGLRenderTargetCube)){void 0===h&&(h=new Ma(new Oa(1,1,1),new Va({type:"BackgroundCubeMaterial",uniforms:Fa(xl.cube.uniforms),vertexShader:xl.cube.vertexShader,fragmentShader:xl.cube.fragmentShader,side:Ge,depthTest:!1,depthWrite:!1,fog:!1})),h.geometry.removeAttribute("normal"),h.geometry.removeAttribute("uv"),h.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},(0,g.default)(h.material,"map",{get:function(){return this.uniforms.tCube.value}}),u.update(h));var s=i.isWebGLRenderTargetCube?i.texture:i;h.material.uniforms.tCube.value=s,h.material.uniforms.tFlip.value=i.isWebGLRenderTargetCube?1:-1,p===i&&m===s.version||(h.material.needsUpdate=!0,p=i,m=s.version),e.unshift(h,h.geometry,h.material,0,0,null)}else i&&i.isTexture&&(void 0===c&&(c=new Ma(new Sl(2,2),new Va({type:"BackgroundMaterial",uniforms:Fa(xl.background.uniforms),vertexShader:xl.background.vertexShader,fragmentShader:xl.background.fragmentShader,side:B,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.removeAttribute("normal"),(0,g.default)(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),u.update(c)),c.material.uniforms.t2D.value=i,!0===i.matrixAutoUpdate&&i.updateMatrix(),c.material.uniforms.uvTransform.value.copy(i.matrix),p===i&&m===i.version||(c.material.needsUpdate=!0,p=i,m=i.version),e.unshift(c,c.geometry,c.material,0,0,null))}function v(e,t){n.buffers.color.setClear(e.r,e.g,e.b,t,r)}return{getClearColor:function(){return f},setClearColor:function(e,t){f.set(e),d=void 0!==t?t:1,v(f,d)},getClearAlpha:function(){return d},setClearAlpha:function(e){d=e,v(f,d)},render:e}}function Tl(i,a,o,s){var l;function e(e){l=e}function t(e,t){i.drawArrays(l,e,t),o.update(t,l)}function n(e,t,n){var r;if(s.isWebGL2)r=i;else if(r=a.get("ANGLE_instanced_arrays"),null===r)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");r[s.isWebGL2?"drawArraysInstanced":"drawArraysInstancedANGLE"](l,t,n,e.maxInstancedCount),o.update(n,l,e.maxInstancedCount)}this.setMode=e,this.render=t,this.renderInstances=n}function Al(t,n,e){var r;function i(){if(void 0!==r)return r;var e=n.get("EXT_texture_filter_anisotropic");return r=null!==e?t.getParameter(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0,r}function a(e){if("highp"===e){if(0<t.getShaderPrecisionFormat(35633,36338).precision&&0<t.getShaderPrecisionFormat(35632,36338).precision)return"highp";e="mediump"}return"mediump"===e&&0<t.getShaderPrecisionFormat(35633,36337).precision&&0<t.getShaderPrecisionFormat(35632,36337).precision?"mediump":"lowp"}var o="undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext,s=void 0!==e.precision?e.precision:"highp",l=a(s);l!==s&&(console.warn("THREE.WebGLRenderer:",s,"not supported, using",l,"instead."),s=l);var u=!0===e.logarithmicDepthBuffer,c=t.getParameter(34930),h=t.getParameter(35660),f=t.getParameter(3379),d=t.getParameter(34076),p=t.getParameter(34921),m=t.getParameter(36347),v=t.getParameter(36348),g=t.getParameter(36349),y=0<h,_=o||!!n.get("OES_texture_float"),x=y&&_,w=o?t.getParameter(36183):0;return{isWebGL2:o,getMaxAnisotropy:i,getMaxPrecision:a,precision:s,logarithmicDepthBuffer:u,maxTextures:c,maxVertexTextures:h,maxTextureSize:f,maxCubemapSize:d,maxAttributes:p,maxVertexUniforms:m,maxVaryings:v,maxFragmentUniforms:g,vertexTextures:y,floatFragmentTextures:_,floatVertexTextures:x,maxSamples:w}}function Ll(){var c=this,h=null,f=0,d=!1,p=!1,m=new io,v=new Nn,g={value:null,needsUpdate:!1};function y(){g.value!==h&&(g.value=h,g.needsUpdate=0<f),c.numPlanes=f,c.numIntersection=0}function _(e,t,n,r){var i=null!==e?e.length:0,a=null;if(0!==i){if(a=g.value,!0!==r||null===a){var o=n+4*i,s=t.matrixWorldInverse;v.getNormalMatrix(s),(null===a||a.length<o)&&(a=new Float32Array(o));for(var l=0,u=n;l!==i;++l,u+=4)m.copy(e[l]).applyMatrix4(s,v),m.normal.toArray(a,u),a[u+3]=m.constant}g.value=a,g.needsUpdate=!0}return c.numPlanes=i,a}this.uniform=g,this.numPlanes=0,this.numIntersection=0,this.init=function(e,t,n){var r=0!==e.length||t||0!==f||d;return d=t,h=_(e,n,0),f=e.length,r},this.beginShadows=function(){p=!0,_(null)},this.endShadows=function(){p=!1,y()},this.setState=function(e,t,n,r,i,a){if(!d||null===e||0===e.length||p&&!n)p?_(null):y();else{var o=p?0:f,s=4*o,l=i.clippingState||null;g.value=l,l=_(e,r,s,a);for(var u=0;u!==s;++u)l[u]=h[u];i.clippingState=l,this.numIntersection=t?this.numPlanes:0,this.numPlanes+=o}}}function Rl(n){var r={};return{get:function(e){if(void 0!==r[e])return r[e];var t;switch(e){case"WEBGL_depth_texture":t=n.getExtension("WEBGL_depth_texture")||n.getExtension("MOZ_WEBGL_depth_texture")||n.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":t=n.getExtension("EXT_texture_filter_anisotropic")||n.getExtension("MOZ_EXT_texture_filter_anisotropic")||n.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":t=n.getExtension("WEBGL_compressed_texture_s3tc")||n.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||n.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":t=n.getExtension("WEBGL_compressed_texture_pvrtc")||n.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:t=n.getExtension(e)}return null===t&&console.warn("THREE.WebGLRenderer: "+e+" extension not supported."),r[e]=t,t}}}function Cl(e,d,a){var o={},p={};function s(e){var t=e.target,n=o[t.id];for(var r in null!==n.index&&d.remove(n.index),n.attributes)d.remove(n.attributes[r]);t.removeEventListener("dispose",s),delete o[t.id];var i=p[n.id];i&&(d.remove(i),delete p[n.id]),a.memory.geometries--}function t(e,t){var n=o[t.id];return n||(t.addEventListener("dispose",s),t.isBufferGeometry?n=t:t.isGeometry&&(void 0===t._bufferGeometry&&(t._bufferGeometry=(new ba).setFromObject(e)),n=t._bufferGeometry),o[t.id]=n,a.memory.geometries++,n)}function n(e){var t=e.index,n=e.attributes;for(var r in null!==t&&d.update(t,34963),n)d.update(n[r],34962);var i=e.morphAttributes;for(var r in i)for(var a=i[r],o=0,s=a.length;o<s;o++)d.update(a[o],34962)}function r(e){var t=[],n=e.index,r=e.attributes.position,i=0;if(null!==n){var a=n.array;i=n.version;for(var o=0,s=a.length;o<s;o+=3){var l=a[o+0],u=a[o+1],c=a[o+2];t.push(l,u,u,c,c,l)}}else for(a=r.array,i=r.version,o=0,s=a.length/3-1;o<s;o+=3)l=o+0,u=o+1,c=o+2,t.push(l,u,u,c,c,l);var h=new(65535<ji(t)?zi:Ui)(t,1);h.version=i,d.update(h,34963);var f=p[e.id];f&&d.remove(f),p[e.id]=h}function i(e){var t=p[e.id];if(t){var n=e.index;null!==n&&t.version<n.version&&r(e)}else r(e);return p[e.id]}return{get:t,update:n,getWireframeAttribute:i}}function Il(i,a,o,s){var l,u,c;function e(e){l=e}function t(e){u=e.type,c=e.bytesPerElement}function n(e,t){i.drawElements(l,t,u,e*c),o.update(t,l)}function r(e,t,n){if(s.isWebGL2)r=i;else{var r=a.get("ANGLE_instanced_arrays");if(null===r)return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.")}r[s.isWebGL2?"drawElementsInstanced":"drawElementsInstancedANGLE"](l,n,u,t*c,e.maxInstancedCount),o.update(n,l,e.maxInstancedCount)}this.setMode=e,this.setIndex=t,this.render=n,this.renderInstances=r}function kl(){var e={geometries:0,textures:0},r={frame:0,calls:0,triangles:0,points:0,lines:0};function t(e,t,n){switch(n=n||1,r.calls++,t){case 4:r.triangles+=n*(e/3);break;case 5:case 6:r.triangles+=n*(e-2);break;case 1:r.lines+=n*(e/2);break;case 3:r.lines+=n*(e-1);break;case 2:r.lines+=n*e;break;case 0:r.points+=n*e;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",t)}}function n(){r.frame++,r.calls=0,r.triangles=0,r.points=0,r.lines=0}return{memory:e,render:r,programs:null,autoReset:!0,reset:n,update:t}}function Pl(e,t){return Math.abs(t[1])-Math.abs(e[1])}function Nl(d){var p={},m=new Float32Array(8);function e(e,t,n,r){var i=e.morphTargetInfluences,a=i.length,o=p[t.id];if(void 0===o){o=[];for(var s=0;s<a;s++)o[s]=[s,0];p[t.id]=o}var l=n.morphTargets&&t.morphAttributes.position,u=n.morphNormals&&t.morphAttributes.normal;for(s=0;s<a;s++){var c=o[s];0!==c[1]&&(l&&t.removeAttribute("morphTarget"+s),u&&t.removeAttribute("morphNormal"+s))}for(s=0;s<a;s++)c=o[s],c[0]=s,c[1]=i[s];for(o.sort(Pl),s=0;s<8;s++){if(c=o[s],c){var h=c[0],f=c[1];if(f){l&&t.addAttribute("morphTarget"+s,l[h]),u&&t.addAttribute("morphNormal"+s,u[h]),m[s]=f;continue}}m[s]=0}r.getUniforms().setValue(d,"morphTargetInfluences",m)}return{update:e}}function Dl(i,a){var o={};function e(e){var t=a.render.frame,n=e.geometry,r=i.get(e,n);return o[r.id]!==t&&(n.isGeometry&&r.updateFromObject(e),i.update(r),o[r.id]=t),r}function t(){o={}}return{update:e,dispose:t}}function Ol(e,t,n,r,i,a,o,s,l,u){e=void 0!==e?e:[],t=void 0!==t?t:re,o=void 0!==o?o:ot,Xn.call(this,e,t,n,r,i,a,o,s,l,u),this.flipY=!1}function Fl(e,t,n,r){Xn.call(this,null),this.image={data:e,width:t,height:n,depth:r},this.magFilter=Ne,this.minFilter=Ne,this.wrapR=ke,this.generateMipmaps=!1,this.flipY=!1}function Bl(e,t,n,r){Xn.call(this,null),this.image={data:e,width:t,height:n,depth:r},this.magFilter=Ne,this.minFilter=Ne,this.wrapR=ke,this.generateMipmaps=!1,this.flipY=!1}t.ShaderLib=xl,xl.physical={uniforms:Ba([xl.standard.uniforms,{clearCoat:{value:0},clearCoatRoughness:{value:0}}]),vertexShader:yl.meshphysical_vert,fragmentShader:yl.meshphysical_frag},Ml.prototype=(0,l.default)(Na.prototype),Ml.prototype.constructor=Ml,Sl.prototype=(0,l.default)(ba.prototype),Sl.prototype.constructor=Sl,Ol.prototype=(0,l.default)(Xn.prototype),Ol.prototype.constructor=Ol,Ol.prototype.isCubeTexture=!0,(0,g.default)(Ol.prototype,"images",{get:function(){return this.image},set:function(e){this.image=e}}),Fl.prototype=(0,l.default)(Xn.prototype),Fl.prototype.constructor=Fl,Fl.prototype.isDataTexture2DArray=!0,Bl.prototype=(0,l.default)(Xn.prototype),Bl.prototype.constructor=Bl,Bl.prototype.isDataTexture3D=!0;var Ul=new Xn,Gl=new Fl,zl=new Bl,Vl=new Ol,Hl=[],Wl=[],jl=new Float32Array(16),Yl=new Float32Array(9),ql=new Float32Array(4);function Xl(e,t,n){var r=e[0];if(r<=0||0<r)return e;var i=t*n,a=Hl[i];if(void 0===a&&(a=new Float32Array(i),Hl[i]=a),0!==t){r.toArray(a,0);for(var o=1,s=0;o!==t;++o)s+=n,e[o].toArray(a,s)}return a}function Zl(e,t){if(e.length!==t.length)return!1;for(var n=0,r=e.length;n<r;n++)if(e[n]!==t[n])return!1;return!0}function Jl(e,t){for(var n=0,r=t.length;n<r;n++)e[n]=t[n]}function Kl(e,t){var n=Wl[t];void 0===n&&(n=new Int32Array(t),Wl[t]=n);for(var r=0;r!==t;++r)n[r]=e.allocateTextureUnit();return n}function Ql(e,t){var n=this.cache;n[0]!==t&&(e.uniform1f(this.addr,t),n[0]=t)}function $l(e,t){var n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y||(e.uniform2f(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(Zl(n,t))return;e.uniform2fv(this.addr,t),Jl(n,t)}}function eu(e,t){var n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z||(e.uniform3f(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else if(void 0!==t.r)n[0]===t.r&&n[1]===t.g&&n[2]===t.b||(e.uniform3f(this.addr,t.r,t.g,t.b),n[0]=t.r,n[1]=t.g,n[2]=t.b);else{if(Zl(n,t))return;e.uniform3fv(this.addr,t),Jl(n,t)}}function tu(e,t){var n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z&&n[3]===t.w||(e.uniform4f(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(Zl(n,t))return;e.uniform4fv(this.addr,t),Jl(n,t)}}function nu(e,t){var n=this.cache,r=t.elements;if(void 0===r){if(Zl(n,t))return;e.uniformMatrix2fv(this.addr,!1,t),Jl(n,t)}else{if(Zl(n,r))return;ql.set(r),e.uniformMatrix2fv(this.addr,!1,ql),Jl(n,r)}}function ru(e,t){var n=this.cache,r=t.elements;if(void 0===r){if(Zl(n,t))return;e.uniformMatrix3fv(this.addr,!1,t),Jl(n,t)}else{if(Zl(n,r))return;Yl.set(r),e.uniformMatrix3fv(this.addr,!1,Yl),Jl(n,r)}}function iu(e,t){var n=this.cache,r=t.elements;if(void 0===r){if(Zl(n,t))return;e.uniformMatrix4fv(this.addr,!1,t),Jl(n,t)}else{if(Zl(n,r))return;jl.set(r),e.uniformMatrix4fv(this.addr,!1,jl),Jl(n,r)}}function au(e,t,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.safeSetTexture2D(t||Ul,i)}function ou(e,t,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTexture2DArray(t||Gl,i)}function su(e,t,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTexture3D(t||zl,i)}function lu(e,t,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.safeSetTextureCube(t||Vl,i)}function uu(e,t){var n=this.cache;n[0]!==t&&(e.uniform1i(this.addr,t),n[0]=t)}function cu(e,t){var n=this.cache;Zl(n,t)||(e.uniform2iv(this.addr,t),Jl(n,t))}function hu(e,t){var n=this.cache;Zl(n,t)||(e.uniform3iv(this.addr,t),Jl(n,t))}function fu(e,t){var n=this.cache;Zl(n,t)||(e.uniform4iv(this.addr,t),Jl(n,t))}function du(e){switch(e){case 5126:return Ql;case 35664:return $l;case 35665:return eu;case 35666:return tu;case 35674:return nu;case 35675:return ru;case 35676:return iu;case 35678:case 36198:return au;case 35679:return su;case 35680:return lu;case 36289:return ou;case 5124:case 35670:return uu;case 35667:case 35671:return cu;case 35668:case 35672:return hu;case 35669:case 35673:return fu}}function pu(e,t){e.uniform1fv(this.addr,t)}function mu(e,t){e.uniform1iv(this.addr,t)}function vu(e,t){e.uniform2iv(this.addr,t)}function gu(e,t){e.uniform3iv(this.addr,t)}function yu(e,t){e.uniform4iv(this.addr,t)}function _u(e,t){var n=Xl(t,this.size,2);e.uniform2fv(this.addr,n)}function xu(e,t){var n=Xl(t,this.size,3);e.uniform3fv(this.addr,n)}function wu(e,t){var n=Xl(t,this.size,4);e.uniform4fv(this.addr,n)}function bu(e,t){var n=Xl(t,this.size,4);e.uniformMatrix2fv(this.addr,!1,n)}function Mu(e,t){var n=Xl(t,this.size,9);e.uniformMatrix3fv(this.addr,!1,n)}function Su(e,t){var n=Xl(t,this.size,16);e.uniformMatrix4fv(this.addr,!1,n)}function Eu(e,t,n){var r=t.length,i=Kl(n,r);e.uniform1iv(this.addr,i);for(var a=0;a!==r;++a)n.safeSetTexture2D(t[a]||Ul,i[a])}function Tu(e,t,n){var r=t.length,i=Kl(n,r);e.uniform1iv(this.addr,i);for(var a=0;a!==r;++a)n.safeSetTextureCube(t[a]||Vl,i[a])}function Au(e){switch(e){case 5126:return pu;case 35664:return _u;case 35665:return xu;case 35666:return wu;case 35674:return bu;case 35675:return Mu;case 35676:return Su;case 35678:return Eu;case 35680:return Tu;case 5124:case 35670:return mu;case 35667:case 35671:return vu;case 35668:case 35672:return gu;case 35669:case 35673:return yu}}function Lu(e,t,n){this.id=e,this.addr=n,this.cache=[],this.setValue=du(t.type)}function Ru(e,t,n){this.id=e,this.addr=n,this.cache=[],this.size=t.size,this.setValue=Au(t.type)}function Cu(e){this.id=e,this.seq=[],this.map={}}Ru.prototype.updateCache=function(e){var t=this.cache;e instanceof Float32Array&&t.length!==e.length&&(this.cache=new Float32Array(e.length)),Jl(t,e)},Cu.prototype.setValue=function(e,t,n){for(var r=this.seq,i=0,a=r.length;i!==a;++i){var o=r[i];o.setValue(e,t[o.id],n)}};var Iu=/([\w\d_]+)(\])?(\[|\.)?/g;function ku(e,t){e.seq.push(t),e.map[t.id]=t}function Pu(e,t,n){var r=e.name,i=r.length;for(Iu.lastIndex=0;;){var a=Iu.exec(r),o=Iu.lastIndex,s=a[1],l="]"===a[2],u=a[3];if(l&&(s|=0),void 0===u||"["===u&&o+2===i){ku(n,new(void 0===u?Lu:Ru)(s,e,t));break}var c=n.map,h=c[s];void 0===h&&(h=new Cu(s),ku(n,h)),n=h}}function Nu(e,t){this.seq=[],this.map={};for(var n=e.getProgramParameter(t,35718),r=0;r<n;++r){var i=e.getActiveUniform(t,r),a=e.getUniformLocation(t,i.name);Pu(i,a,this)}}function Du(e,t,n){var r=e.createShader(t);return e.shaderSource(r,n),e.compileShader(r),r}Nu.prototype.setValue=function(e,t,n,r){var i=this.map[t];void 0!==i&&i.setValue(e,n,r)},Nu.prototype.setOptional=function(e,t,n){var r=t[n];void 0!==r&&this.setValue(e,n,r)},Nu.upload=function(e,t,n,r){for(var i=0,a=t.length;i!==a;++i){var o=t[i],s=n[o.id];!1!==s.needsUpdate&&o.setValue(e,s.value,r)}},Nu.seqWithValue=function(e,t){for(var n=[],r=0,i=e.length;r!==i;++r){var a=e[r];a.id in t&&n.push(a)}return n};var Ou=0;function Fu(e){for(var t=e.split("\n"),n=0;n<t.length;n++)t[n]=n+1+": "+t[n];return t.join("\n")}function Bu(e){switch(e){case Zt:return["Linear","( value )"];case Jt:return["sRGB","( value )"];case Qt:return["RGBE","( value )"];case en:return["RGBM","( value, 7.0 )"];case tn:return["RGBM","( value, 16.0 )"];case nn:return["RGBD","( value, 256.0 )"];case Kt:return["Gamma","( value, float( GAMMA_FACTOR ) )"];default:throw new Error("unsupported encoding: "+e)}}function Uu(e,t,n){var r=e.getShaderParameter(t,35713),i=e.getShaderInfoLog(t).trim();if(r&&""===i)return"";var a=e.getShaderSource(t);return"THREE.WebGLShader: gl.getShaderInfoLog() "+n+"\n"+i+Fu(a)}function Gu(e,t){var n=Bu(t);return"vec4 "+e+"( vec4 value ) { return "+n[0]+"ToLinear"+n[1]+"; }"}function zu(e,t){var n=Bu(t);return"vec4 "+e+"( vec4 value ) { return LinearTo"+n[0]+n[1]+"; }"}function Vu(e,t){var n;switch(t){case ze:n="Linear";break;case Q:n="Reinhard";break;case $:n="Uncharted2";break;case ee:n="OptimizedCineon";break;case te:n="ACESFilmic";break;default:throw new Error("unsupported toneMapping: "+t)}return"vec3 "+e+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function Hu(e,t,n){e=e||{};var r=[e.derivatives||t.envMapCubeUV||t.bumpMap||t.normalMap&&!t.objectSpaceNormalMap||t.flatShading?"#extension GL_OES_standard_derivatives : enable":"",(e.fragDepth||t.logarithmicDepthBuffer)&&n.get("EXT_frag_depth")?"#extension GL_EXT_frag_depth : enable":"",e.drawBuffers&&n.get("WEBGL_draw_buffers")?"#extension GL_EXT_draw_buffers : require":"",(e.shaderTextureLOD||t.envMap)&&n.get("EXT_shader_texture_lod")?"#extension GL_EXT_shader_texture_lod : enable":""];return r.filter(Yu).join("\n")}function Wu(e){var t=[];for(var n in e){var r=e[n];!1!==r&&t.push("#define "+n+" "+r)}return t.join("\n")}function ju(e,t){for(var n={},r=e.getProgramParameter(t,35721),i=0;i<r;i++){var a=e.getActiveAttrib(t,i),o=a.name;n[o]=e.getAttribLocation(t,o)}return n}function Yu(e){return""!==e}function qu(e,t){return e.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights)}function Xu(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}function Zu(e){var t=/^[ \t]*#include +<([\w\d./]+)>/gm;function n(e,t){var n=yl[t];if(void 0===n)throw new Error("Can not resolve #include <"+t+">");return Zu(n)}return e.replace(t,n)}function Ju(e){var t=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g;function n(e,t,n,r){for(var i="",a=(0,h.default)(t);a<(0,h.default)(n);a++)i+=r.replace(/\[ i \]/g,"[ "+a+" ]");return i}return e.replace(t,n)}function Ku(e,t,n,r,i,a,o){var s=e.getContext(),l=r.defines,u=i.vertexShader,c=i.fragmentShader,h="SHADOWMAP_TYPE_BASIC";a.shadowMapType===O?h="SHADOWMAP_TYPE_PCF":a.shadowMapType===F&&(h="SHADOWMAP_TYPE_PCF_SOFT");var f="ENVMAP_TYPE_CUBE",d="ENVMAP_MODE_REFLECTION",p="ENVMAP_BLENDING_MULTIPLY";if(a.envMap){switch(r.envMap.mapping){case re:case ae:f="ENVMAP_TYPE_CUBE";break;case ue:case Ce:f="ENVMAP_TYPE_CUBE_UV";break;case oe:case se:f="ENVMAP_TYPE_EQUIREC";break;case le:f="ENVMAP_TYPE_SPHERE"}switch(r.envMap.mapping){case ae:case se:d="ENVMAP_MODE_REFRACTION"}switch(r.combine){case X:p="ENVMAP_BLENDING_MULTIPLY";break;case Z:p="ENVMAP_BLENDING_MIX";break;case J:p="ENVMAP_BLENDING_ADD"}}var m,v,g=0<e.gammaFactor?e.gammaFactor:1,y=o.isWebGL2?"":Hu(r.extensions,a,t),_=Wu(l),x=s.createProgram();if(r.isRawShaderMaterial?(m=[_].filter(Yu).join("\n"),0<m.length&&(m+="\n"),v=[y,_].filter(Yu).join("\n"),0<v.length&&(v+="\n")):(m=["precision "+a.precision+" float;","precision "+a.precision+" int;","#define SHADER_NAME "+i.name,_,a.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+g,"#define MAX_BONES "+a.maxBones,a.useFog&&a.fog?"#define USE_FOG":"",a.useFog&&a.fogExp?"#define FOG_EXP2":"",a.map?"#define USE_MAP":"",a.mapMixColor?"#define USE_MAP_MIXCOLOR":"",a.envMap?"#define USE_ENVMAP":"",a.envMap?"#define "+d:"",a.lightMap?"#define USE_LIGHTMAP":"",a.aoMap?"#define USE_AOMAP":"",a.emissiveMap?"#define USE_EMISSIVEMAP":"",a.bumpMap?"#define USE_BUMPMAP":"",a.normalMap?"#define USE_NORMALMAP":"",a.normalMap&&a.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",a.displacementMap&&a.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",a.specularMap?"#define USE_SPECULARMAP":"",a.roughnessMap?"#define USE_ROUGHNESSMAP":"",a.metalnessMap?"#define USE_METALNESSMAP":"",a.alphaMap?"#define USE_ALPHAMAP":"",a.vertexTangents?"#define USE_TANGENT":"",a.vertexColors?"#define USE_COLOR":"",a.flatShading?"#define FLAT_SHADED":"",a.skinning?"#define USE_SKINNING":"",a.useVertexTexture?"#define BONE_TEXTURE":"",a.morphTargets?"#define USE_MORPHTARGETS":"",a.morphNormals&&!1===a.flatShading?"#define USE_MORPHNORMALS":"",a.doubleSided?"#define DOUBLE_SIDED":"",a.flipSided?"#define FLIP_SIDED":"",a.shadowMapEnabled?"#define USE_SHADOWMAP":"",a.shadowMapEnabled?"#define "+h:"",a.sizeAttenuation?"#define USE_SIZEATTENUATION":"",a.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",a.logarithmicDepthBuffer&&(o.isWebGL2||t.get("EXT_frag_depth"))?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(Yu).join("\n"),v=[y,"precision "+a.precision+" float;","precision "+a.precision+" int;","#define SHADER_NAME "+i.name,_,a.alphaTest?"#define ALPHATEST "+a.alphaTest+(a.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+g,a.useFog&&a.fog?"#define USE_FOG":"",a.useFog&&a.fogExp?"#define FOG_EXP2":"",a.map?"#define USE_MAP":"",a.mapMixColor?"#define USE_MAP_MIXCOLOR":"",a.matcap?"#define USE_MATCAP":"",a.envMap?"#define USE_ENVMAP":"",a.envMap?"#define "+f:"",a.envMap?"#define "+d:"",a.envMap?"#define "+p:"",a.lightMap?"#define USE_LIGHTMAP":"",a.aoMap?"#define USE_AOMAP":"",a.emissiveMap?"#define USE_EMISSIVEMAP":"",a.bumpMap?"#define USE_BUMPMAP":"",a.normalMap?"#define USE_NORMALMAP":"",a.normalMap&&a.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",a.specularMap?"#define USE_SPECULARMAP":"",a.roughnessMap?"#define USE_ROUGHNESSMAP":"",a.metalnessMap?"#define USE_METALNESSMAP":"",a.alphaMap?"#define USE_ALPHAMAP":"",a.vertexTangents?"#define USE_TANGENT":"",a.vertexColors?"#define USE_COLOR":"",a.gradientMap?"#define USE_GRADIENTMAP":"",a.flatShading?"#define FLAT_SHADED":"",a.doubleSided?"#define DOUBLE_SIDED":"",a.flipSided?"#define FLIP_SIDED":"",a.shadowMapEnabled?"#define USE_SHADOWMAP":"",a.shadowMapEnabled?"#define "+h:"",a.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",a.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",a.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",a.logarithmicDepthBuffer&&(o.isWebGL2||t.get("EXT_frag_depth"))?"#define USE_LOGDEPTHBUF_EXT":"",a.envMap&&(o.isWebGL2||t.get("EXT_shader_texture_lod"))?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;",a.toneMapping!==K?"#define TONE_MAPPING":"",a.toneMapping!==K?yl.tonemapping_pars_fragment:"",a.toneMapping!==K?Vu("toneMapping",a.toneMapping):"",a.dithering?"#define DITHERING":"",a.outputEncoding||a.mapEncoding||a.matcapEncoding||a.envMapEncoding||a.emissiveMapEncoding?yl.encodings_pars_fragment:"",a.mapEncoding?Gu("mapTexelToLinear",a.mapEncoding):"",a.matcapEncoding?Gu("matcapTexelToLinear",a.matcapEncoding):"",a.envMapEncoding?Gu("envMapTexelToLinear",a.envMapEncoding):"",a.emissiveMapEncoding?Gu("emissiveMapTexelToLinear",a.emissiveMapEncoding):"",a.outputEncoding?zu("linearToOutputTexel",a.outputEncoding):"",a.depthPacking?"#define DEPTH_PACKING "+r.depthPacking:"","\n"].filter(Yu).join("\n")),u=Zu(u),u=qu(u,a),u=Xu(u,a),c=Zu(c),c=qu(c,a),c=Xu(c,a),u=Ju(u),c=Ju(c),o.isWebGL2&&!r.isRawShaderMaterial){var w=!1,b=/^\s*#version\s+300\s+es\s*\n/;r.isShaderMaterial&&null!==u.match(b)&&null!==c.match(b)&&(w=!0,u=u.replace(b,""),c=c.replace(b,"")),m=["#version 300 es\n","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+m,v=["#version 300 es\n","#define varying in",w?"":"out highp vec4 pc_fragColor;",w?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+v}var M,S,E=m+u,T=v+c,A=Du(s,35633,E),L=Du(s,35632,T);if(s.attachShader(x,A),s.attachShader(x,L),void 0!==r.index0AttributeName?s.bindAttribLocation(x,0,r.index0AttributeName):!0===a.morphTargets&&s.bindAttribLocation(x,0,"position"),s.linkProgram(x),e.debug.checkShaderErrors){var R=s.getProgramInfoLog(x).trim(),C=s.getShaderInfoLog(A).trim(),I=s.getShaderInfoLog(L).trim(),k=!0,P=!0;if(!1===s.getProgramParameter(x,35714)){k=!1;var N=Uu(s,A,"vertex"),D=Uu(s,L,"fragment");console.error("THREE.WebGLProgram: shader error: ",s.getError(),"35715",s.getProgramParameter(x,35715),"gl.getProgramInfoLog",R,N,D)}else""!==R?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",R):""!==C&&""!==I||(P=!1);P&&(this.diagnostics={runnable:k,material:r,programLog:R,vertexShader:{log:C,prefix:m},fragmentShader:{log:I,prefix:v}})}return s.deleteShader(A),s.deleteShader(L),this.getUniforms=function(){return void 0===M&&(M=new Nu(s,x)),M},this.getAttributes=function(){return void 0===S&&(S=ju(s,x)),S},this.destroy=function(){s.deleteProgram(x),this.program=void 0},this.name=i.name,this.id=Ou++,this.code=n,this.usedTimes=1,this.program=x,this.vertexShader=A,this.fragmentShader=L,this}function Qu(f,l,d){var u=[],p={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"phong",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"},a=["precision","supportsVertexTextures","map","mapMixColor","mapEncoding","matcap","matcapEncoding","envMap","envMapMode","envMapEncoding","lightMap","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","displacementMap","specularMap","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","vertexTangents","fog","useFog","fogExp","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","maxMorphTargets","maxMorphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering"];function m(e){var t=e.skeleton,n=t.bones;if(d.floatVertexTextures)return 1024;var r=d.maxVertexUniforms,i=Math.floor((r-20)/4),a=Math.min(i,n.length);return a<n.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+n.length+" bones. This GPU supports "+a+"."),0):a}function v(e,t){var n;return e?e.isTexture?n=e.encoding:e.isWebGLRenderTarget&&(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),n=e.texture.encoding):n=Zt,n===Zt&&t&&(n=Kt),n}this.getParameters=function(e,t,n,r,i,a,o){var s=p[e.type],l=o.isSkinnedMesh?m(o):0,u=d.precision;null!==e.precision&&(u=d.getMaxPrecision(e.precision),u!==e.precision&&console.warn("THREE.WebGLProgram.getParameters:",e.precision,"not supported, using",u,"instead."));var c=f.getRenderTarget(),h={shaderID:s,precision:u,supportsVertexTextures:d.vertexTextures,outputEncoding:v(c?c.texture:null,f.gammaOutput),map:!!e.map,mapMixColor:!!e.mapMixColor,mapEncoding:v(e.map,f.gammaInput),matcap:!!e.matcap,matcapEncoding:v(e.matcap,f.gammaInput),envMap:!!e.envMap,envMapMode:e.envMap&&e.envMap.mapping,envMapEncoding:v(e.envMap,f.gammaInput),envMapCubeUV:!!e.envMap&&(e.envMap.mapping===ue||e.envMap.mapping===Ce),lightMap:!!e.lightMap,aoMap:!!e.aoMap,emissiveMap:!!e.emissiveMap,emissiveMapEncoding:v(e.emissiveMap,f.gammaInput),bumpMap:!!e.bumpMap,normalMap:!!e.normalMap,objectSpaceNormalMap:e.normalMapType===sn,displacementMap:!!e.displacementMap,roughnessMap:!!e.roughnessMap,metalnessMap:!!e.metalnessMap,specularMap:!!e.specularMap,alphaMap:!!e.alphaMap,gradientMap:!!e.gradientMap,combine:e.combine,vertexTangents:e.normalMap&&e.vertexTangents,vertexColors:e.vertexColors,fog:!!r,useFog:e.fog,fogExp:r&&r.isFogExp2,flatShading:e.flatShading,sizeAttenuation:e.sizeAttenuation,logarithmicDepthBuffer:d.logarithmicDepthBuffer,skinning:e.skinning&&0<l,maxBones:l,useVertexTexture:d.floatVertexTextures,morphTargets:e.morphTargets,morphNormals:e.morphNormals,maxMorphTargets:f.maxMorphTargets,maxMorphNormals:f.maxMorphNormals,numDirLights:t.directional.length,numPointLights:t.point.length,numSpotLights:t.spot.length,numRectAreaLights:t.rectArea.length,numHemiLights:t.hemi.length,numClippingPlanes:i,numClipIntersection:a,dithering:e.dithering,shadowMapEnabled:f.shadowMap.enabled&&o.receiveShadow&&0<n.length,shadowMapType:f.shadowMap.type,toneMapping:f.toneMapping,physicallyCorrectLights:f.physicallyCorrectLights,premultipliedAlpha:e.premultipliedAlpha,alphaTest:e.alphaTest,doubleSided:e.side===pe,flipSided:e.side===Ge,depthPacking:void 0!==e.depthPacking&&e.depthPacking};return h},this.getProgramCode=function(e,t){var n=[];if(t.shaderID?n.push(t.shaderID):(n.push(e.fragmentShader),n.push(e.vertexShader)),void 0!==e.defines)for(var r in e.defines)n.push(r),n.push(e.defines[r]);for(var i=0;i<a.length;i++)n.push(t[a[i]]);return n.push(e.onBeforeCompile.toString()),n.push(f.gammaOutput),n.push(f.gammaFactor),n.join()},this.acquireProgram=function(e,t,n,r){for(var i,a=0,o=u.length;a<o;a++){var s=u[a];if(s.code===r){i=s,++i.usedTimes;break}}return void 0===i&&(i=new Ku(f,l,r,e,t,n,d),u.push(i)),i},this.releaseProgram=function(e){if(0==--e.usedTimes){var t=u.indexOf(e);u[t]=u[u.length-1],u.pop(),e.destroy()}},this.programs=u}function $u(){var r=new s.default;function e(e){var t=r.get(e);return void 0===t&&(t={},r.set(e,t)),t}function t(e){r.delete(e)}function n(e,t,n){r.get(e)[t]=n}function i(){r=new s.default}return{get:e,remove:t,update:n,dispose:i}}function ec(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.program!==t.program?e.program.id-t.program.id:e.material.id!==t.material.id?e.material.id-t.material.id:e.z!==t.z?e.z-t.z:e.id-t.id}function tc(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:e.id-t.id}function nc(){var s=[],l=0,u=[],c=[],h={id:-1};function e(){l=0,u.length=0,c.length=0}function f(e,t,n,r,i,a){var o=s[l];return void 0===o?(o={id:e.id,object:e,geometry:t,material:n,program:n.program||h,groupOrder:r,renderOrder:e.renderOrder,z:i,group:a},s[l]=o):(o.id=e.id,o.object=e,o.geometry=t,o.material=n,o.program=n.program||h,o.groupOrder=r,o.renderOrder=e.renderOrder,o.z=i,o.group=a),l++,o}function t(e,t,n,r,i,a){var o=f(e,t,n,r,i,a);(!0===n.transparent?c:u).push(o)}function n(e,t,n,r,i,a){var o=f(e,t,n,r,i,a);(!0===n.transparent?c:u).unshift(o)}function r(){1<u.length&&u.sort(ec),1<c.length&&c.sort(tc)}return{opaque:u,transparent:c,init:e,push:t,unshift:n,sort:r}}function rc(){var i={};function a(e){var t=e.target;t.removeEventListener("dispose",a),delete i[t.id]}function e(e,t){var n,r=i[e.id];return void 0===r?(n=new nc,i[e.id]={},i[e.id][t.id]=n,e.addEventListener("dispose",a)):(n=r[t.id],void 0===n&&(n=new nc,r[t.id]=n)),n}function t(){i={}}return{get:e,dispose:t}}function ic(){var n={};return{get:function(e){if(void 0!==n[e.id])return n[e.id];var t;switch(e.type){case"DirectionalLight":t={direction:new Pn,color:new Ti,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new In};break;case"SpotLight":t={position:new Pn,direction:new Pn,color:new Ti,distance:0,coneCos:0,penumbraCos:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new In};break;case"PointLight":t={position:new Pn,color:new Ti,distance:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new In,shadowCameraNear:1,shadowCameraFar:1e3};break;case"HemisphereLight":t={direction:new Pn,skyColor:new Ti,groundColor:new Ti};break;case"RectAreaLight":t={color:new Ti,position:new Pn,halfWidth:new Pn,halfHeight:new Pn}}return n[e.id]=t,t}}}var ac=0;function oc(){for(var M=new ic,S={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,shadowsLength:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],point:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]},e=0;e<9;e++)S.probe.push(new Pn);var E=new Pn,T=new Qn,A=new Qn;function t(e,t,n){for(var r=0,i=0,a=0,o=0;o<9;o++)S.probe[o].set(0,0,0);for(var s=0,l=0,u=0,c=0,h=0,f=n.matrixWorldInverse,d=(o=0,e.length);o<d;o++){var p=e[o],m=p.color,v=p.intensity,g=p.distance,y=p.shadow&&p.shadow.map?p.shadow.map.texture:null;if(p.isAmbientLight)r+=m.r*v,i+=m.g*v,a+=m.b*v;else if(p.isLightProbe)for(var _=0;_<9;_++)S.probe[_].addScaledVector(p.sh.coefficients[_],v);else if(p.isDirectionalLight){var x=M.get(p);if(x.color.copy(p.color).multiplyScalar(p.intensity),x.direction.setFromMatrixPosition(p.matrixWorld),E.setFromMatrixPosition(p.target.matrixWorld),x.direction.sub(E),x.direction.transformDirection(f),x.shadow=p.castShadow,p.castShadow){var w=p.shadow;x.shadowBias=w.bias,x.shadowRadius=w.radius,x.shadowMapSize=w.mapSize}S.directionalShadowMap[s]=y,S.directionalShadowMatrix[s]=p.shadow.matrix,S.directional[s]=x,s++}else p.isSpotLight?(x=M.get(p),x.position.setFromMatrixPosition(p.matrixWorld),x.position.applyMatrix4(f),x.color.copy(m).multiplyScalar(v),x.distance=g,x.direction.setFromMatrixPosition(p.matrixWorld),E.setFromMatrixPosition(p.target.matrixWorld),x.direction.sub(E),x.direction.transformDirection(f),x.coneCos=Math.cos(p.angle),x.penumbraCos=Math.cos(p.angle*(1-p.penumbra)),x.decay=p.decay,x.shadow=p.castShadow,p.castShadow&&(w=p.shadow,x.shadowBias=w.bias,x.shadowRadius=w.radius,x.shadowMapSize=w.mapSize),S.spotShadowMap[u]=y,S.spotShadowMatrix[u]=p.shadow.matrix,S.spot[u]=x,u++):p.isRectAreaLight?(x=M.get(p),x.color.copy(m).multiplyScalar(v),x.position.setFromMatrixPosition(p.matrixWorld),x.position.applyMatrix4(f),A.identity(),T.copy(p.matrixWorld),T.premultiply(f),A.extractRotation(T),x.halfWidth.set(.5*p.width,0,0),x.halfHeight.set(0,.5*p.height,0),x.halfWidth.applyMatrix4(A),x.halfHeight.applyMatrix4(A),S.rectArea[c]=x,c++):p.isPointLight?(x=M.get(p),x.position.setFromMatrixPosition(p.matrixWorld),x.position.applyMatrix4(f),x.color.copy(p.color).multiplyScalar(p.intensity),x.distance=p.distance,x.decay=p.decay,x.shadow=p.castShadow,p.castShadow&&(w=p.shadow,x.shadowBias=w.bias,x.shadowRadius=w.radius,x.shadowMapSize=w.mapSize,x.shadowCameraNear=w.camera.near,x.shadowCameraFar=w.camera.far),S.pointShadowMap[l]=y,S.pointShadowMatrix[l]=p.shadow.matrix,S.point[l]=x,l++):p.isHemisphereLight&&(x=M.get(p),x.direction.setFromMatrixPosition(p.matrixWorld),x.direction.transformDirection(f),x.direction.normalize(),x.skyColor.copy(p.color).multiplyScalar(v),x.groundColor.copy(p.groundColor).multiplyScalar(v),S.hemi[h]=x,h++)}S.ambient[0]=r,S.ambient[1]=i,S.ambient[2]=a;var b=S.hash;b.directionalLength===s&&b.pointLength===l&&b.spotLength===u&&b.rectAreaLength===c&&b.hemiLength===h&&b.shadowsLength===t.length||(S.directional.length=s,S.spot.length=u,S.rectArea.length=c,S.point.length=l,S.hemi.length=h,b.directionalLength=s,b.pointLength=l,b.spotLength=u,b.rectAreaLength=c,b.hemiLength=h,b.shadowsLength=t.length,S.version=ac++)}return{setup:t,state:S}}function sc(){var t=new oc,n=[],r=[];function e(){n.length=0,r.length=0}function i(e){n.push(e)}function a(e){r.push(e)}function o(e){t.setup(n,r,e)}var s={lightsArray:n,shadowsArray:r,lights:t};return{init:e,state:s,setupLights:o,pushLight:i,pushShadow:a}}function lc(){var r={};function i(e){var t=e.target;t.removeEventListener("dispose",i),delete r[t.id]}function e(e,t){var n;return void 0===r[e.id]?(n=new sc,r[e.id]={},r[e.id][t.id]=n,e.addEventListener("dispose",i)):void 0===r[e.id][t.id]?(n=new sc,r[e.id][t.id]=n):n=r[e.id][t.id],n}function t(){r={}}return{get:e,dispose:t}}function uc(e){ki.call(this),this.type="MeshDepthMaterial",this.depthPacking=rn,this.skinning=!1,this.morphTargets=!1,this.map=null,this.mapMixColor=!1,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.setValues(e)}function cc(e){ki.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new Pn,this.nearDistance=1,this.farDistance=1e3,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.lights=!1,this.setValues(e)}function hc(w,v,e){for(var b=new ao,M=new Qn,S=new In,E=new In(e,e),T=new Pn,A=new Pn,g=1,y=2,t=1+(g|y),_=new Array(t),x=new Array(t),L={},R={0:Ge,1:B,2:pe},C=[new Pn(1,0,0),new Pn(-1,0,0),new Pn(0,0,1),new Pn(0,0,-1),new Pn(0,1,0),new Pn(0,-1,0)],I=[new Pn(0,1,0),new Pn(0,1,0),new Pn(0,1,0),new Pn(0,1,0),new Pn(0,0,1),new Pn(0,0,-1)],k=[new Zn,new Zn,new Zn,new Zn,new Zn,new Zn],n=0;n!==t;++n){var r=0!=(n&g),i=0!=(n&y),a=new uc({depthPacking:an,morphTargets:r,skinning:i});_[n]=a;var o=new cc({morphTargets:r,skinning:i});x[n]=o}var P=this;function N(e,t,n,r,i,a){var o=e.geometry,s=null,l=_,u=e.customDepthMaterial;if(n&&(l=x,u=e.customDistanceMaterial),u)s=u;else{var c=!1;t.morphTargets&&(o&&o.isBufferGeometry?c=o.morphAttributes&&o.morphAttributes.position&&0<o.morphAttributes.position.length:o&&o.isGeometry&&(c=o.morphTargets&&0<o.morphTargets.length)),e.isSkinnedMesh&&!1===t.skinning&&console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",e);var h=e.isSkinnedMesh&&t.skinning,f=0;c&&(f|=g),h&&(f|=y),s=l[f]}if(w.localClippingEnabled&&!0===t.clipShadows&&0!==t.clippingPlanes.length){var d=s.uuid,p=t.uuid,m=L[d];void 0===m&&(m={},L[d]=m);var v=m[p];void 0===v&&(v=s.clone(),m[p]=v),s=v}return s.visible=t.visible,s.wireframe=t.wireframe,s.side=null!=t.shadowSide?t.shadowSide:R[t.side],s.clipShadows=t.clipShadows,s.clippingPlanes=t.clippingPlanes,s.clipIntersection=t.clipIntersection,s.wireframeLinewidth=t.wireframeLinewidth,s.linewidth=t.linewidth,n&&s.isMeshDistanceMaterial&&(s.referencePosition.copy(r),s.nearDistance=i,s.farDistance=a),s}function D(e,t,n,r){if(!1!==e.visible){var i=e.layers.test(t.layers);if(i&&(e.isMesh||e.isLine||e.isPoints)&&e.castShadow&&(!e.frustumCulled||b.intersectsObject(e))){e.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,e.matrixWorld);var a=v.update(e),o=e.material;if((0,Ue.default)(o))for(var s=a.groups,l=0,u=s.length;l<u;l++){var c=s[l],h=o[c.materialIndex];if(h&&h.visible){var f=N(e,h,r,A,n.near,n.far);w.renderBufferDirect(n,null,a,f,e,c)}}else o.visible&&(f=N(e,o,r,A,n.near,n.far),w.renderBufferDirect(n,null,a,f,e,null))}for(var d=e.children,p=0,m=d.length;p<m;p++)D(d[p],t,n,r)}}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=O,this.render=function(e,t,n){if(!1!==P.enabled&&(!1!==P.autoUpdate||!1!==P.needsUpdate)&&0!==e.length){var r,i=w.getRenderTarget(),a=w.getActiveCubeFace(),o=w.getActiveMipmapLevel(),s=w.state;s.setBlending(me),s.buffers.color.setClear(1,1,1,1),s.buffers.depth.setTest(!0),s.setScissorTest(!1);for(var l=0,u=e.length;l<u;l++){var c=e[l],h=c.shadow,f=c&&c.isPointLight;if(void 0!==h){var d=h.camera;if(S.copy(h.mapSize),S.min(E),f){var p=S.x,m=S.y;k[0].set(2*p,m,p,m),k[1].set(0,m,p,m),k[2].set(3*p,m,p,m),k[3].set(p,m,p,m),k[4].set(3*p,0,p,m),k[5].set(p,0,p,m),S.x*=4,S.y*=2}if(null===h.map){var v={minFilter:Ne,magFilter:Ne,format:st};h.map=new Jn(S.x,S.y,v),h.map.texture.name=c.name+".shadowMap",d.updateProjectionMatrix()}h.isSpotLightShadow&&h.update(c);var g=h.map,y=h.matrix;A.setFromMatrixPosition(c.matrixWorld),d.position.copy(A),f?(r=6,y.makeTranslation(-A.x,-A.y,-A.z)):(r=1,T.setFromMatrixPosition(c.target.matrixWorld),d.lookAt(T),d.updateMatrixWorld(),y.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),y.multiply(d.projectionMatrix),y.multiply(d.matrixWorldInverse)),w.setRenderTarget(g),w.clear();for(var _=0;_<r;_++){if(f){T.copy(d.position),T.add(C[_]),d.up.copy(I[_]),d.lookAt(T),d.updateMatrixWorld();var x=k[_];s.viewport(x)}M.multiplyMatrices(d.projectionMatrix,d.matrixWorldInverse),b.setFromMatrix(M),D(t,n,d,f)}}else console.warn("THREE.WebGLShadowMap:",c,"has no shadow.")}P.needsUpdate=!1,w.setRenderTarget(i,a,o)}}}function fc(c,r,l,i){function e(){var t=!1,a=new Zn,n=null,o=new Zn(0,0,0,0);return{setMask:function(e){n===e||t||(c.colorMask(e,e,e,e),n=e)},setLocked:function(e){t=e},setClear:function(e,t,n,r,i){!0===i&&(e*=r,t*=r,n*=r),a.set(e,t,n,r),!1===o.equals(a)&&(c.clearColor(e,t,n,r),o.copy(a))},reset:function(){t=!1,n=null,o.set(-1,0,0,0)}}}function t(){var t=!1,n=null,r=null,i=null;return{setTest:function(e){(e?j:Y)(2929)},setMask:function(e){n===e||t||(c.depthMask(e),n=e)},setFunc:function(e){if(r!==e){if(e)switch(e){case be:c.depthFunc(512);break;case Me:c.depthFunc(519);break;case Se:c.depthFunc(513);break;case Ee:c.depthFunc(515);break;case Te:c.depthFunc(514);break;case Ae:c.depthFunc(518);break;case Le:c.depthFunc(516);break;case Re:c.depthFunc(517);break;default:c.depthFunc(515)}else c.depthFunc(515);r=e}},setLocked:function(e){t=e},setClear:function(e){i!==e&&(c.clearDepth(e),i=e)},reset:function(){t=!1,n=null,r=null,i=null}}}function n(){var t=!1,n=null,r=null,i=null,a=null,o=null,s=null,l=null,u=null;return{setTest:function(e){(e?j:Y)(2960)},setMask:function(e){n===e||t||(c.stencilMask(e),n=e)},setFunc:function(e,t,n){r===e&&i===t&&a===n||(c.stencilFunc(e,t,n),r=e,i=t,a=n)},setOp:function(e,t,n){o===e&&s===t&&l===n||(c.stencilOp(e,t,n),o=e,s=t,l=n)},setLocked:function(e){t=e},setClear:function(e){u!==e&&(c.clearStencil(e),u=e)},reset:function(){t=!1,n=null,r=null,i=null,a=null,o=null,s=null,l=null,u=null}}}var a=new e,o=new t,s=new n,u=c.getParameter(34921),h=new Uint8Array(u),f=new Uint8Array(u),d=new Uint8Array(u),p={},m=null,v=null,g=null,y=null,_=null,x=null,w=null,b=null,M=null,S=null,E=!1,T=null,A=null,L=null,R=null,C=null,I=c.getParameter(35661),k=!1,P=0,N=c.getParameter(7938);-1!==N.indexOf("WebGL")?(P=(0,ce.default)(/^WebGL\ ([0-9])/.exec(N)[1]),k=1<=P):-1!==N.indexOf("OpenGL ES")&&(P=(0,ce.default)(/^OpenGL\ ES\ ([0-9])/.exec(N)[1]),k=2<=P);var D=null,O={},F=new Zn,B=new Zn;function U(e,t,n){var r=new Uint8Array(4),i=c.createTexture();c.bindTexture(e,i),c.texParameteri(e,10241,9728),c.texParameteri(e,10240,9728);for(var a=0;a<n;a++)c.texImage2D(t+a,0,6408,1,1,0,6408,5121,r);return i}var G={};function z(){for(var e=0,t=h.length;e<t;e++)h[e]=0}function V(e){H(e,0)}function H(e,t){if(h[e]=1,0===f[e]&&(c.enableVertexAttribArray(e),f[e]=1),d[e]!==t){var n=i.isWebGL2?c:r.get("ANGLE_instanced_arrays");n[i.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](e,t),d[e]=t}}function W(){for(var e=0,t=f.length;e!==t;++e)f[e]!==h[e]&&(c.disableVertexAttribArray(e),f[e]=0)}function j(e){!0!==p[e]&&(c.enable(e),p[e]=!0)}function Y(e){!1!==p[e]&&(c.disable(e),p[e]=!1)}function q(){if(null===m&&(m=[],r.get("WEBGL_compressed_texture_pvrtc")||r.get("WEBGL_compressed_texture_s3tc")||r.get("WEBGL_compressed_texture_etc1")||r.get("WEBGL_compressed_texture_astc")))for(var e=c.getParameter(34467),t=0;t<e.length;t++)m.push(e[t]);return m}function X(e){return v!==e&&(c.useProgram(e),v=e,!0)}function Z(e,t,n,r,i,a,o,s){if(e!==me){if(g||(j(3042),g=!0),e===xe)i=i||t,a=a||n,o=o||r,t===_&&i===b||(c.blendEquationSeparate(l.convert(t),l.convert(i)),_=t,b=i),n===x&&r===w&&a===M&&o===S||(c.blendFuncSeparate(l.convert(n),l.convert(r),l.convert(a),l.convert(o)),x=n,w=r,M=a,S=o),y=e,E=null;else if(e!==y||s!==E){if(_===we&&b===we||(c.blendEquation(32774),_=we,b=we),s)switch(e){case ve:c.blendFuncSeparate(1,771,1,771);break;case ge:c.blendFunc(1,1);break;case ye:c.blendFuncSeparate(0,0,769,771);break;case _e:c.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",e)}else switch(e){case ve:c.blendFuncSeparate(770,771,1,771);break;case ge:c.blendFunc(770,1);break;case ye:c.blendFunc(0,769);break;case _e:c.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",e)}x=null,w=null,M=null,S=null,y=e,E=s}}else g&&(Y(3042),g=!1)}function J(e,t){(e.side===pe?Y:j)(2884);var n=e.side===Ge;t&&(n=!n),K(n),e.blending===ve&&!1===e.transparent?Z(me):Z(e.blending,e.blendEquation,e.blendSrc,e.blendDst,e.blendEquationAlpha,e.blendSrcAlpha,e.blendDstAlpha,e.premultipliedAlpha),o.setFunc(e.depthFunc),o.setTest(e.depthTest),o.setMask(e.depthWrite),a.setMask(e.colorWrite);var r=e.stencilWrite;s.setTest(r),r&&(s.setFunc(e.stencilFunc,e.stencilRef,e.stencilMask),s.setOp(e.stencilFail,e.stencilZFail,e.stencilZPass)),ee(e.polygonOffset,e.polygonOffsetFactor,e.polygonOffsetUnits)}function K(e){T!==e&&(e?c.frontFace(2304):c.frontFace(2305),T=e)}function Q(e){e!==he?(j(2884),e!==A&&(e===fe?c.cullFace(1029):e===de?c.cullFace(1028):c.cullFace(1032))):Y(2884),A=e}function $(e){e!==L&&(k&&c.lineWidth(e),L=e)}function ee(e,t,n){e?(j(32823),R===t&&C===n||(c.polygonOffset(t,n),R=t,C=n)):Y(32823)}function te(e){(e?j:Y)(3089)}function ne(e){void 0===e&&(e=33984+I-1),D!==e&&(c.activeTexture(e),D=e)}function re(e,t){null===D&&ne();var n=O[D];void 0===n&&(n={type:void 0,texture:void 0},O[D]=n),n.type===e&&n.texture===t||(c.bindTexture(e,t||G[e]),n.type=e,n.texture=t)}function ie(){try{c.compressedTexImage2D.apply(c,arguments)}catch(e){console.error("THREE.WebGLState:",e)}}function ae(){try{c.texImage2D.apply(c,arguments)}catch(e){console.error("THREE.WebGLState:",e)}}function oe(){try{c.texImage3D.apply(c,arguments)}catch(e){console.error("THREE.WebGLState:",e)}}function se(e){!1===F.equals(e)&&(c.scissor(e.x,e.y,e.z,e.w),F.copy(e))}function le(e){!1===B.equals(e)&&(c.viewport(e.x,e.y,e.z,e.w),B.copy(e))}function ue(){for(var e=0;e<f.length;e++)1===f[e]&&(c.disableVertexAttribArray(e),f[e]=0);p={},m=null,D=null,O={},v=null,y=null,T=null,A=null,a.reset(),o.reset(),s.reset()}return G[3553]=U(3553,3553,1),G[34067]=U(34067,34069,6),a.setClear(0,0,0,1),o.setClear(1),s.setClear(0),j(2929),o.setFunc(Ee),K(!1),Q(fe),j(2884),Z(me),{buffers:{color:a,depth:o,stencil:s},initAttributes:z,enableAttribute:V,enableAttributeAndDivisor:H,disableUnusedAttributes:W,enable:j,disable:Y,getCompressedTextureFormats:q,useProgram:X,setBlending:Z,setMaterial:J,setFlipSided:K,setCullFace:Q,setLineWidth:$,setPolygonOffset:ee,setScissorTest:te,activeTexture:ne,bindTexture:re,compressedTexImage2D:ie,texImage2D:ae,texImage3D:oe,scissor:se,viewport:le,reset:ue}}function dc(v,i,g,y,_,x,h){var c,r={},n="undefined"!=typeof OffscreenCanvas;function f(e,t){return n?new OffscreenCanvas(e,t):document.createElementNS("http://www.w3.org/1999/xhtml","canvas")}function w(e,t,n,r){var i=1;if((e.width>r||e.height>r)&&(i=r/Math.max(e.width,e.height)),i<1||!0===t){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){var a=t?Cn.floorPowerOfTwo:Math.floor,o=a(i*e.width),s=a(i*e.height);void 0===c&&(c=f(o,s));var l=n?f(o,s):c;l.width=o,l.height=s;var u=l.getContext("2d");return u.drawImage(e,0,0,o,s),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+e.width+"x"+e.height+") to ("+o+"x"+s+")."),l}return"data"in e&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+e.width+"x"+e.height+")."),e}return e}function b(e){return Cn.isPowerOfTwo(e.width)&&Cn.isPowerOfTwo(e.height)}function p(e){return!_.isWebGL2&&(e.wrapS!==ke||e.wrapT!==ke||e.minFilter!==Ne&&e.minFilter!==Ve)}function M(e,t){return e.generateMipmaps&&t&&e.minFilter!==Ne&&e.minFilter!==Ve}function S(e,t,n,r){v.generateMipmap(e);var i=y.get(t);i.__maxMipLevel=Math.log(Math.max(n,r))*Math.LOG2E}function E(e,t){if(!_.isWebGL2)return e;var n=e;return 6403===e&&(5126===t&&(n=33326),5131===t&&(n=33325),5121===t&&(n=33321)),6407===e&&(5126===t&&(n=34837),5131===t&&(n=34843),5121===t&&(n=32849)),6408===e&&(5126===t&&(n=34836),5131===t&&(n=34842),5121===t&&(n=32856)),33325===n||33326===n||34842===n||34836===n?i.get("EXT_color_buffer_float"):34843!==n&&34837!==n||console.warn("THREE.WebGLRenderer: Floating point textures with RGB format not supported. Please use RGBA instead."),n}function a(e){return e===Ne||e===De||e===Fe?9728:9729}function o(e){var t=e.target;t.removeEventListener("dispose",o),s(t),t.isVideoTexture&&delete r[t.id],h.memory.textures--}function d(e){var t=e.target;t.removeEventListener("dispose",d),l(t),h.memory.textures--}function s(e){var t=y.get(e);void 0!==t.__webglInit&&(v.deleteTexture(t.__webglTexture),y.remove(e))}function l(e){var t=y.get(e),n=y.get(e.texture);if(e){if(void 0!==n.__webglTexture&&v.deleteTexture(n.__webglTexture),e.depthTexture&&e.depthTexture.dispose(),e.isWebGLRenderTargetCube)for(var r=0;r<6;r++)v.deleteFramebuffer(t.__webglFramebuffer[r]),t.__webglDepthbuffer&&v.deleteRenderbuffer(t.__webglDepthbuffer[r]);else v.deleteFramebuffer(t.__webglFramebuffer),t.__webglDepthbuffer&&v.deleteRenderbuffer(t.__webglDepthbuffer);y.remove(e.texture),y.remove(e)}}var t=0;function e(){t=0}function u(){var e=t;return e>=_.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+_.maxTextures),t+=1,e}function m(e,t){var n=y.get(e);if(e.isVideoTexture&&z(e),0<e.version&&n.__version!==e.version){var r=e.image;if(void 0===r)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else if(!1!==r.complete)return void k(n,e,t)}g.activeTexture(33984+t),g.bindTexture(3553,n.__webglTexture)}function T(e,t){var n=y.get(e);0<e.version&&n.__version!==e.version?k(n,e,t):(g.activeTexture(33984+t),g.bindTexture(35866,n.__webglTexture))}function A(e,t){var n=y.get(e);0<e.version&&n.__version!==e.version?k(n,e,t):(g.activeTexture(33984+t),g.bindTexture(32879,n.__webglTexture))}function L(e,t){var n=y.get(e);if(6===e.image.length)if(0<e.version&&n.__version!==e.version){I(n,e),g.activeTexture(33984+t),g.bindTexture(34067,n.__webglTexture),v.pixelStorei(37440,e.flipY);for(var r=e&&e.isCompressedTexture,i=e.image[0]&&e.image[0].isDataTexture,a=[],o=0;o<6;o++)a[o]=r||i?i?e.image[o].image:e.image[o]:w(e.image[o],!1,!0,_.maxCubemapSize);var s=a[0],l=b(s)||_.isWebGL2,u=x.convert(e.format),c=x.convert(e.type),h=E(u,c);for(C(34067,e,l),o=0;o<6;o++)if(r)for(var f,d=a[o].mipmaps,p=0,m=d.length;p<m;p++)f=d[p],e.format!==st&&e.format!==ot?-1<g.getCompressedTextureFormats().indexOf(u)?g.compressedTexImage2D(34069+o,p,h,f.width,f.height,0,f.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):g.texImage2D(34069+o,p,h,f.width,f.height,0,u,c,f.data);else i?g.texImage2D(34069+o,0,h,a[o].width,a[o].height,0,u,c,a[o].data):g.texImage2D(34069+o,0,h,u,c,a[o]);n.__maxMipLevel=r?d.length-1:0,M(e,l)&&S(34067,e,s.width,s.height),n.__version=e.version,e.onUpdate&&e.onUpdate(e)}else g.activeTexture(33984+t),g.bindTexture(34067,n.__webglTexture)}function R(e,t){g.activeTexture(33984+t),g.bindTexture(34067,y.get(e).__webglTexture)}function C(e,t,n){var r;if(n?(v.texParameteri(e,10242,x.convert(t.wrapS)),v.texParameteri(e,10243,x.convert(t.wrapT)),32879!==e&&35866!==e||v.texParameteri(e,32882,x.convert(t.wrapR)),v.texParameteri(e,10240,x.convert(t.magFilter)),v.texParameteri(e,10241,x.convert(t.minFilter))):(v.texParameteri(e,10242,33071),v.texParameteri(e,10243,33071),32879!==e&&35866!==e||v.texParameteri(e,32882,33071),t.wrapS===ke&&t.wrapT===ke||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),v.texParameteri(e,10240,a(t.magFilter)),v.texParameteri(e,10241,a(t.minFilter)),t.minFilter!==Ne&&t.minFilter!==Ve&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),r=i.get("EXT_texture_filter_anisotropic"),r){if(t.type===$e&&null===i.get("OES_texture_float_linear"))return;if(t.type===et&&null===(_.isWebGL2||i.get("OES_texture_half_float_linear")))return;(1<t.anisotropy||y.get(t).__currentAnisotropy)&&(v.texParameterf(e,r.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(t.anisotropy,_.getMaxAnisotropy())),y.get(t).__currentAnisotropy=t.anisotropy)}}function I(e,t){void 0===e.__webglInit&&(e.__webglInit=!0,t.addEventListener("dispose",o),e.__webglTexture=v.createTexture(),h.memory.textures++)}function k(e,t,n){var r=3553;t.isDataTexture2DArray&&(r=35866),t.isDataTexture3D&&(r=32879),I(e,t),g.activeTexture(33984+n),g.bindTexture(r,e.__webglTexture),v.pixelStorei(37440,t.flipY),v.pixelStorei(37441,t.premultiplyAlpha),v.pixelStorei(3317,t.unpackAlignment);var i=p(t)&&!1===b(t.image),a=w(t.image,i,!1,_.maxTextureSize),o=b(a)||_.isWebGL2,s=x.convert(t.format),l=x.convert(t.type),u=E(s,l);C(r,t,o);var c,h=t.mipmaps;if(t.isDepthTexture){if(u=6402,t.type===$e){if(!_.isWebGL2)throw new Error("Float Depth Texture only supported in WebGL2.0");u=36012}else _.isWebGL2&&(u=33189);t.format===ht&&6402===u&&t.type!==Je&&t.type!==Qe&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),t.type=Je,l=x.convert(t.type)),t.format===ft&&(u=34041,t.type!==it&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),t.type=it,l=x.convert(t.type))),g.texImage2D(3553,0,u,a.width,a.height,0,s,l,null)}else if(t.isDataTexture)if(0<h.length&&o){for(var f=0,d=h.length;f<d;f++)c=h[f],g.texImage2D(3553,f,u,c.width,c.height,0,s,l,c.data);t.generateMipmaps=!1,e.__maxMipLevel=h.length-1}else g.texImage2D(3553,0,u,a.width,a.height,0,s,l,a.data),e.__maxMipLevel=0;else if(t.isCompressedTexture){for(f=0,d=h.length;f<d;f++)c=h[f],t.format!==st&&t.format!==ot?-1<g.getCompressedTextureFormats().indexOf(s)?g.compressedTexImage2D(3553,f,u,c.width,c.height,0,c.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):g.texImage2D(3553,f,u,c.width,c.height,0,s,l,c.data);e.__maxMipLevel=h.length-1}else if(t.isDataTexture2DArray)g.texImage3D(35866,0,u,a.width,a.height,a.depth,0,s,l,a.data),e.__maxMipLevel=0;else if(t.isDataTexture3D)g.texImage3D(32879,0,u,a.width,a.height,a.depth,0,s,l,a.data),e.__maxMipLevel=0;else if(0<h.length&&o){for(f=0,d=h.length;f<d;f++)c=h[f],g.texImage2D(3553,f,u,s,l,c);t.generateMipmaps=!1,e.__maxMipLevel=h.length-1}else g.texImage2D(3553,0,u,s,l,a),e.__maxMipLevel=0;M(t,o)&&S(3553,t,a.width,a.height),e.__version=t.version,t.onUpdate&&t.onUpdate(t)}function P(e,t,n,r){var i=x.convert(t.texture.format),a=x.convert(t.texture.type),o=E(i,a);g.texImage2D(r,0,o,t.width,t.height,0,i,a,null),v.bindFramebuffer(36160,e),v.framebufferTexture2D(36160,n,r,y.get(t.texture).__webglTexture,0),v.bindFramebuffer(36160,null)}function N(e,t,n){if(v.bindRenderbuffer(36161,e),t.depthBuffer&&!t.stencilBuffer){if(n){var r=G(t);v.renderbufferStorageMultisample(36161,r,33189,t.width,t.height)}else v.renderbufferStorage(36161,33189,t.width,t.height);v.framebufferRenderbuffer(36160,36096,36161,e)}else if(t.depthBuffer&&t.stencilBuffer)n?(r=G(t),v.renderbufferStorageMultisample(36161,r,35056,t.width,t.height)):v.renderbufferStorage(36161,34041,t.width,t.height),v.framebufferRenderbuffer(36160,33306,36161,e);else{var i=x.convert(t.texture.format),a=x.convert(t.texture.type),o=E(i,a);n?(r=G(t),v.renderbufferStorageMultisample(36161,r,o,t.width,t.height)):v.renderbufferStorage(36161,o,t.width,t.height)}v.bindRenderbuffer(36161,null)}function D(e,t){var n=t&&t.isWebGLRenderTargetCube;if(n)throw new Error("Depth Texture with cube render targets is not supported");if(v.bindFramebuffer(36160,e),!t.depthTexture||!t.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");y.get(t.depthTexture).__webglTexture&&t.depthTexture.image.width===t.width&&t.depthTexture.image.height===t.height||(t.depthTexture.image.width=t.width,t.depthTexture.image.height=t.height,t.depthTexture.needsUpdate=!0),m(t.depthTexture,0);var r=y.get(t.depthTexture).__webglTexture;if(t.depthTexture.format===ht)v.framebufferTexture2D(36160,36096,3553,r,0);else{if(t.depthTexture.format!==ft)throw new Error("Unknown depthTexture format");v.framebufferTexture2D(36160,33306,3553,r,0)}}function O(e){var t=y.get(e),n=!0===e.isWebGLRenderTargetCube;if(e.depthTexture){if(n)throw new Error("target.depthTexture not supported in Cube render targets");D(t.__webglFramebuffer,e)}else if(n){t.__webglDepthbuffer=[];for(var r=0;r<6;r++)v.bindFramebuffer(36160,t.__webglFramebuffer[r]),t.__webglDepthbuffer[r]=v.createRenderbuffer(),N(t.__webglDepthbuffer[r],e)}else v.bindFramebuffer(36160,t.__webglFramebuffer),t.__webglDepthbuffer=v.createRenderbuffer(),N(t.__webglDepthbuffer,e);v.bindFramebuffer(36160,null)}function F(e){var t=y.get(e),n=y.get(e.texture);e.addEventListener("dispose",d),n.__webglTexture=v.createTexture(),h.memory.textures++;var r=!0===e.isWebGLRenderTargetCube,i=!0===e.isWebGLMultisampleRenderTarget,a=b(e)||_.isWebGL2;if(r){t.__webglFramebuffer=[];for(var o=0;o<6;o++)t.__webglFramebuffer[o]=v.createFramebuffer()}else if(t.__webglFramebuffer=v.createFramebuffer(),i)if(_.isWebGL2){t.__webglMultisampledFramebuffer=v.createFramebuffer(),t.__webglColorRenderbuffer=v.createRenderbuffer(),v.bindRenderbuffer(36161,t.__webglColorRenderbuffer);var s=x.convert(e.texture.format),l=x.convert(e.texture.type),u=E(s,l),c=G(e);v.renderbufferStorageMultisample(36161,c,u,e.width,e.height),v.bindFramebuffer(36160,t.__webglMultisampledFramebuffer),v.framebufferRenderbuffer(36160,36064,36161,t.__webglColorRenderbuffer),v.bindRenderbuffer(36161,null),e.depthBuffer&&(t.__webglDepthRenderbuffer=v.createRenderbuffer(),N(t.__webglDepthRenderbuffer,e,!0)),v.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(r){for(g.bindTexture(34067,n.__webglTexture),C(34067,e.texture,a),o=0;o<6;o++)P(t.__webglFramebuffer[o],e,36064,34069+o);M(e.texture,a)&&S(34067,e.texture,e.width,e.height),g.bindTexture(34067,null)}else g.bindTexture(3553,n.__webglTexture),C(3553,e.texture,a),P(t.__webglFramebuffer,e,36064,3553),M(e.texture,a)&&S(3553,e.texture,e.width,e.height),g.bindTexture(3553,null);e.depthBuffer&&O(e)}function B(e){var t=e.texture,n=b(e)||_.isWebGL2;if(M(t,n)){var r=e.isWebGLRenderTargetCube?34067:3553,i=y.get(t).__webglTexture;g.bindTexture(r,i),S(r,t,e.width,e.height),g.bindTexture(r,null)}}function U(e){if(e.isWebGLMultisampleRenderTarget)if(_.isWebGL2){var t=y.get(e);v.bindFramebuffer(36008,t.__webglMultisampledFramebuffer),v.bindFramebuffer(36009,t.__webglFramebuffer);var n=e.width,r=e.height,i=16384;e.depthBuffer&&(i|=256),e.stencilBuffer&&(i|=1024),v.blitFramebuffer(0,0,n,r,0,0,n,r,i,9728)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")}function G(e){return _.isWebGL2&&e.isWebGLMultisampleRenderTarget?Math.min(_.maxSamples,e.samples):0}function z(e){var t=e.id,n=h.render.frame;r[t]!==n&&(r[t]=n,e.update())}var V=!1,H=!1;function W(e,t){e&&e.isWebGLRenderTarget&&(!1===V&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),V=!0),e=e.texture),m(e,t)}function j(e,t){e&&e.isWebGLRenderTargetCube&&(!1===H&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),H=!0),e=e.texture),(e&&e.isCubeTexture||(0,Ue.default)(e.image)&&6===e.image.length?L:R)(e,t)}this.allocateTextureUnit=u,this.resetTextureUnits=e,this.setTexture2D=m,this.setTexture2DArray=T,this.setTexture3D=A,this.setTextureCube=L,this.setTextureCubeDynamic=R,this.setupRenderTarget=F,this.updateRenderTargetMipmap=B,this.updateMultisampleRenderTarget=U,this.safeSetTexture2D=W,this.safeSetTextureCube=j}function pc(e,n,r){function t(e){var t;if(e===Ie)return 10497;if(e===ke)return 33071;if(e===Pe)return 33648;if(e===Ne)return 9728;if(e===De)return 9984;if(e===Fe)return 9986;if(e===Ve)return 9729;if(e===He)return 9985;if(e===je)return 9987;if(e===qe)return 5121;if(e===tt)return 32819;if(e===nt)return 32820;if(e===rt)return 33635;if(e===Xe)return 5120;if(e===Ze)return 5122;if(e===Je)return 5123;if(e===Ke)return 5124;if(e===Qe)return 5125;if(e===$e)return 5126;if(e===et){if(r.isWebGL2)return 5131;if(t=n.get("OES_texture_half_float"),null!==t)return t.HALF_FLOAT_OES}if(e===at)return 6406;if(e===ot)return 6407;if(e===st)return 6408;if(e===lt)return 6409;if(e===ut)return 6410;if(e===ht)return 6402;if(e===ft)return 34041;if(e===dt)return 6403;if(e===we)return 32774;if(e===C)return 32778;if(e===I)return 32779;if(e===N)return 0;if(e===D)return 1;if(e===U)return 768;if(e===G)return 769;if(e===z)return 770;if(e===V)return 771;if(e===H)return 772;if(e===W)return 773;if(e===j)return 774;if(e===Y)return 775;if(e===q)return 776;if((e===pt||e===mt||e===vt||e===gt)&&(t=n.get("WEBGL_compressed_texture_s3tc"),null!==t)){if(e===pt)return t.COMPRESSED_RGB_S3TC_DXT1_EXT;if(e===mt)return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(e===vt)return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(e===gt)return t.COMPRESSED_RGBA_S3TC_DXT5_EXT}if((e===yt||e===_t||e===xt||e===wt)&&(t=n.get("WEBGL_compressed_texture_pvrtc"),null!==t)){if(e===yt)return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(e===_t)return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(e===xt)return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(e===wt)return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(e===bt&&(t=n.get("WEBGL_compressed_texture_etc1"),null!==t))return t.COMPRESSED_RGB_ETC1_WEBGL;if((e===Mt||e===St||e===Et||e===Tt||e===At||e===Lt||e===Rt||e===Ct||e===It||e===kt||e===Pt||e===Nt||e===Dt||e===Ot)&&(t=n.get("WEBGL_compressed_texture_astc"),null!==t))return e;if(e===k||e===P){if(r.isWebGL2){if(e===k)return 32775;if(e===P)return 32776}if(t=n.get("EXT_blend_minmax"),null!==t){if(e===k)return t.MIN_EXT;if(e===P)return t.MAX_EXT}}if(e===it){if(r.isWebGL2)return 34042;if(t=n.get("WEBGL_depth_texture"),null!==t)return t.UNSIGNED_INT_24_8_WEBGL}return 0}return{convert:t}}function mc(){pi.call(this),this.type="Group"}function vc(e){Wa.call(this),this.cameras=e||[]}uc.prototype=(0,l.default)(ki.prototype),uc.prototype.constructor=uc,uc.prototype.isMeshDepthMaterial=!0,uc.prototype.copy=function(e){return ki.prototype.copy.call(this,e),this.depthPacking=e.depthPacking,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this},cc.prototype=(0,l.default)(ki.prototype),cc.prototype.constructor=cc,cc.prototype.isMeshDistanceMaterial=!0,cc.prototype.copy=function(e){return ki.prototype.copy.call(this,e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this},mc.prototype=(0,p.default)((0,l.default)(pi.prototype),{constructor:mc,isGroup:!0}),vc.prototype=(0,p.default)((0,l.default)(Wa.prototype),{constructor:vc,isArrayCamera:!0});var gc,yc,_c,xc,wc,bc,Mc,Sc,Ec,Tc,Ac,Lc,Rc,Cc,Ic,kc,Pc,Nc,Dc,Oc,Fc,Bc,Uc,Gc,zc,Vc,Hc,Wc,jc=new Pn,Yc=new Pn;function qc(e,t,n){jc.setFromMatrixPosition(t.matrixWorld),Yc.setFromMatrixPosition(n.matrixWorld);var r=jc.distanceTo(Yc),i=t.projectionMatrix.elements,a=n.projectionMatrix.elements,o=i[14]/(i[10]-1),s=i[14]/(i[10]+1),l=(i[9]+1)/i[5],u=(i[9]-1)/i[5],c=(i[8]-1)/i[0],h=(a[8]+1)/a[0],f=o*c,d=o*h,p=r/(-c+h),m=p*-c;t.matrixWorld.decompose(e.position,e.quaternion,e.scale),e.translateX(m),e.translateZ(p),e.matrixWorld.compose(e.position,e.quaternion,e.scale),e.matrixWorldInverse.getInverse(e.matrixWorld);var v=o+p,g=s+p,y=f-m,_=d+(r-m),x=l*s/g*v,w=u*s/g*v;e.projectionMatrix.makePerspective(y,_,x,w,v,g)}function Xc(t){var n,r,i=this,l=null,u=null,c=null,a=[],h=new Qn,f=new Qn,o=1,d="local-floor";"undefined"!=typeof window&&"VRFrameData"in window&&(u=new window.VRFrameData,window.addEventListener("vrdisplaypresentchange",e,!1));var p=new Qn,m=new kn,v=new Pn,g=new Wa;g.viewport=new Zn,g.layers.enable(1);var y=new Wa;y.viewport=new Zn,y.layers.enable(2);var _=new vc([g,y]);function x(){return null!==l&&!0===l.isPresenting}_.layers.enable(1),_.layers.enable(2);var s,w=new In;function e(){if(x()){var e=l.getEyeParameters("left");n=2*e.renderWidth*o,r=e.renderHeight*o,s=t.getPixelRatio(),t.getSize(w),t.setDrawingBufferSize(n,r,1),g.viewport.set(0,0,n/2,r),y.viewport.set(n/2,0,n/2,r),T.start(),i.dispatchEvent({type:"sessionstart"})}else i.enabled&&t.setDrawingBufferSize(w.width,w.height,s),T.stop(),i.dispatchEvent({type:"sessionend"})}var b=[];function M(e){for(var t=navigator.getGamepads&&navigator.getGamepads(),n=0,r=0,i=t.length;n<i;n++){var a=t[n];if(a&&("Daydream Controller"===a.id||"Gear VR Controller"===a.id||"Oculus Go Controller"===a.id||"OpenVR Gamepad"===a.id||a.id.startsWith("Oculus Touch")||a.id.startsWith("HTC Vive Focus")||a.id.startsWith("Spatial Controller"))){if(r===e)return a;r++}}}function S(){for(var e=0;e<a.length;e++){var t=a[e],n=M(e);if(void 0!==n&&void 0!==n.pose){if(null===n.pose)return;var r=n.pose;!1===r.hasPosition&&t.position.set(.2,-.6,-.05),null!==r.position&&t.position.fromArray(r.position),null!==r.orientation&&t.quaternion.fromArray(r.orientation),t.matrix.compose(t.position,t.quaternion,t.scale),t.matrix.premultiply(h),t.matrix.decompose(t.position,t.quaternion,t.scale),t.matrixWorldNeedsUpdate=!0,t.visible=!0;var i="Daydream Controller"===n.id?0:1;void 0===b[e]&&(b[e]=!1),b[e]!==n.buttons[i].pressed&&(b[e]=n.buttons[i].pressed,!0===b[e]?t.dispatchEvent({type:"selectstart"}):(t.dispatchEvent({type:"selectend"}),t.dispatchEvent({type:"select"})))}else t.visible=!1}}function E(e,t){null!==t&&4===t.length&&e.set(t[0]*n,t[1]*r,t[2]*n,t[3]*r)}this.enabled=!1,this.getController=function(e){var t=a[e];return void 0===t&&(t=new mc,t.matrixAutoUpdate=!1,t.visible=!1,a[e]=t),t},this.getDevice=function(){return l},this.setDevice=function(e){void 0!==e&&(l=e),T.setContext(e)},this.setFramebufferScaleFactor=function(e){o=e},this.setReferenceSpaceType=function(e){d=e},this.setPoseTarget=function(e){void 0!==e&&(c=e)},this.getCamera=function(e){var t="local-floor"===d?1.6:0;if(!1===x())return e.position.set(0,t,0),e.rotation.set(0,0,0),e;if(l.depthNear=e.near,l.depthFar=e.far,l.getFrameData(u),"local-floor"===d){var n=l.stageParameters;n?h.fromArray(n.sittingToStandingTransform):h.makeTranslation(0,t,0)}var r=u.pose,i=null!==c?c:e;i.matrix.copy(h),i.matrix.decompose(i.position,i.quaternion,i.scale),null!==r.orientation&&(m.fromArray(r.orientation),i.quaternion.multiply(m)),null!==r.position&&(m.setFromRotationMatrix(h),v.fromArray(r.position),v.applyQuaternion(m),i.position.add(v)),i.updateMatrixWorld(),g.near=e.near,y.near=e.near,g.far=e.far,y.far=e.far,g.matrixWorldInverse.fromArray(u.leftViewMatrix),y.matrixWorldInverse.fromArray(u.rightViewMatrix),f.getInverse(h),"local-floor"===d&&(g.matrixWorldInverse.multiply(f),y.matrixWorldInverse.multiply(f));var a=i.parent;null!==a&&(p.getInverse(a.matrixWorld),g.matrixWorldInverse.multiply(p),y.matrixWorldInverse.multiply(p)),g.matrixWorld.getInverse(g.matrixWorldInverse),y.matrixWorld.getInverse(y.matrixWorldInverse),g.projectionMatrix.fromArray(u.leftProjectionMatrix),y.projectionMatrix.fromArray(u.rightProjectionMatrix),qc(_,g,y);var o=l.getLayers();if(o.length){var s=o[0];E(g.viewport,s.leftBounds),E(y.viewport,s.rightBounds)}return S(),_},this.getStandingMatrix=function(){return h},this.isPresenting=x;var T=new wl;this.setAnimationLoop=function(e){T.setAnimationLoop(e),x()&&T.start()},this.submitFrame=function(){x()&&l.submitFrame()},this.dispose=function(){"undefined"!=typeof window&&window.removeEventListener("vrdisplaypresentchange",e)},this.setFrameOfReferenceType=function(){console.warn("THREE.WebVRManager: setFrameOfReferenceType() has been deprecated.")}}function Zc(f,t){var n=this,d=null,p=null,r="local-floor",m=null,v=[],g=[];function o(){return null!==d&&null!==p}var s=new Wa;s.layers.enable(1),s.viewport=new Zn;var l=new Wa;l.layers.enable(2),l.viewport=new Zn;var y=new vc([s,l]);function i(e){for(var t=0;t<v.length;t++)g[t]===e.inputSource&&v[t].dispatchEvent({type:e.type})}function a(){f.setFramebuffer(null),f.setRenderTarget(f.getRenderTarget()),h.stop(),n.dispatchEvent({type:"sessionend"})}function u(e){p=e,h.setContext(d),h.start(),n.dispatchEvent({type:"sessionstart"})}function c(e,t){null===t?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.getInverse(e.matrixWorld)}y.layers.enable(1),y.layers.enable(2),this.enabled=!1,this.getController=function(e){var t=v[e];return void 0===t&&(t=new mc,t.matrixAutoUpdate=!1,t.visible=!1,v[e]=t),t},this.setFramebufferScaleFactor=function(){},this.setReferenceSpaceType=function(e){r=e},this.getSession=function(){return d},this.setSession=function(e){d=e,null!==d&&(d.addEventListener("select",i),d.addEventListener("selectstart",i),d.addEventListener("selectend",i),d.addEventListener("end",a),d.updateRenderState({baseLayer:new XRWebGLLayer(d,t)}),d.requestReferenceSpace(r).then(u),g=d.inputSources,d.addEventListener("inputsourceschange",function(){g=d.inputSources;for(var e=0;e<v.length;e++){var t=v[e];t.userData.inputSource=g[e]}}))},this.getCamera=function(e){if(o()){var t=e.parent,n=y.cameras;c(y,t);for(var r=0;r<n.length;r++)c(n[r],t);e.matrixWorld.copy(y.matrixWorld);for(var i=e.children,a=(r=0,i.length);r<a;r++)i[r].updateMatrixWorld(!0);return qc(y,s,l),y}return e},this.isPresenting=o;var _=null;function e(e,t){if(m=t.getViewerPose(p),null!==m){var n=m.views,r=d.renderState.baseLayer;f.setFramebuffer(r.framebuffer);for(var i=0;i<n.length;i++){var a=n[i],o=r.getViewport(a),s=a.transform.inverse.matrix,l=y.cameras[i];l.matrix.fromArray(s).getInverse(l.matrix),l.projectionMatrix.fromArray(a.projectionMatrix),l.viewport.set(o.x,o.y,o.width,o.height),0===i&&y.matrix.copy(l.matrix)}}for(i=0;i<v.length;i++){var u=v[i],c=g[i];if(c){var h=t.getPose(c.targetRaySpace,p);if(null!==h){u.matrix.fromArray(h.transform.matrix),u.matrix.decompose(u.position,u.rotation,u.scale),u.visible=!0;continue}}u.visible=!1}_&&_(e)}var h=new wl;h.setAnimationLoop(e),this.setAnimationLoop=function(e){_=e},this.dispose=function(){},this.getStandingMatrix=function(){return console.warn("THREE.WebXRManager: getStandingMatrix() is no longer needed."),new Qn},this.getDevice=function(){console.warn("THREE.WebXRManager: getDevice() has been deprecated.")},this.setDevice=function(){console.warn("THREE.WebXRManager: setDevice() has been deprecated.")},this.setFrameOfReferenceType=function(){console.warn("THREE.WebXRManager: setFrameOfReferenceType() has been deprecated.")},this.submitFrame=function(){}}function Jc(e){e=e||{};var r=void 0!==e.canvas?e.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),t=void 0!==e.context?e.context:null,n=void 0!==e.alpha&&e.alpha,i=void 0===e.depth||e.depth,a=void 0===e.stencil||e.stencil,o=void 0!==e.antialias&&e.antialias,s=void 0===e.premultipliedAlpha||e.premultipliedAlpha,l=void 0!==e.preserveDrawingBuffer&&e.preserveDrawingBuffer,u=void 0!==e.powerPreference?e.powerPreference:"default",c=void 0!==e.failIfMajorPerformanceCaveat&&e.failIfMajorPerformanceCaveat,d=null,_=null;this.domElement=r,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.gammaInput=!1,this.gammaOutput=!1,this.physicallyCorrectLights=!1,this.toneMapping=ze,this.toneMappingExposure=1,this.toneMappingWhitePoint=1,this.maxMorphTargets=8,this.maxMorphNormals=4;var M,x,w,S,h,b,E,T,A,p,g,f,m,v,L,R,C,y,I=this,k=!1,P=null,N=0,D=0,O=null,F=null,B=-1,U={geometry:null,program:null,wireframe:!1},G=null,z=null,V=new Zn,H=new Zn,W=null,j=r.width,Y=r.height,q=1,X=new Zn(0,0,j,Y),Z=new Zn(0,0,j,Y),J=!1,K=new ao,Q=new Ll,$=!1,ee=!1,te=new Qn,ne=new Pn;function re(){return null===O?q:1}try{var ie={alpha:n,depth:i,stencil:a,antialias:o,premultipliedAlpha:s,preserveDrawingBuffer:l,powerPreference:u,failIfMajorPerformanceCaveat:c,xrCompatible:!0};if(r.addEventListener("webglcontextlost",le,!1),r.addEventListener("webglcontextrestored",ue,!1),M=t||r.getContext("webgl",ie)||r.getContext("experimental-webgl",ie),null===M)throw null!==r.getContext("webgl")?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.");void 0===M.getShaderPrecisionFormat&&(M.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(e){throw console.error("THREE.WebGLRenderer: "+e.message),e}function ae(){x=new Rl(M),w=new Al(M,x,e),w.isWebGL2||(x.get("WEBGL_depth_texture"),x.get("OES_texture_float"),x.get("OES_texture_half_float"),x.get("OES_texture_half_float_linear"),x.get("OES_standard_derivatives"),x.get("OES_element_index_uint"),x.get("ANGLE_instanced_arrays")),x.get("OES_texture_float_linear"),y=new pc(M,x,w),S=new fc(M,x,y,w),S.scissor(H.copy(Z).multiplyScalar(q).floor()),S.viewport(V.copy(X).multiplyScalar(q).floor()),h=new kl(M),b=new $u,E=new dc(M,x,S,b,w,y,h),T=new bl(M),A=new Cl(M,T,h),p=new Dl(A,h),L=new Nl(M),g=new Qu(I,x,w),f=new rc,m=new lc,v=new El(I,S,p,s),R=new Tl(M,x,h,w),C=new Il(M,x,h,w),h.programs=g.programs,I.capabilities=w,I.extensions=x,I.properties=b,I.renderLists=f,I.state=S,I.info=h}ae();var oe="undefined"!=typeof navigator&&"xr"in navigator&&"supportsSession"in navigator.xr?new Zc(I,M):new Xc(I);this.vr=oe;var se=new hc(I,p,w.maxTextureSize);function le(e){e.preventDefault(),k=!0}function ue(){k=!1,ae()}function ce(e){var t=e.target;t.removeEventListener("dispose",ce),he(t)}function he(e){fe(e),b.remove(e)}function fe(e){var t=b.get(e).program;e.program=void 0,void 0!==t&&g.releaseProgram(t)}function de(e,t){e.render(function(e){I.renderBufferImmediate(e,t)})}function pe(e,t,n){if(n&&n.isInstancedBufferGeometry&&!w.isWebGL2&&null===x.get("ANGLE_instanced_arrays"))console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");else{S.initAttributes();var r=n.attributes,i=t.getAttributes(),a=e.defaultAttributeValues;for(var o in i){var s=i[o];if(0<=s){var l=r[o];if(void 0!==l){var u=l.normalized,c=l.itemSize,h=T.get(l);if(void 0===h)continue;var f=h.buffer,d=h.type,p=h.bytesPerElement;if(l.isInterleavedBufferAttribute){var m=l.data,v=m.stride,g=l.offset;m&&m.isInstancedInterleavedBuffer?(S.enableAttributeAndDivisor(s,m.meshPerAttribute),void 0===n.maxInstancedCount&&(n.maxInstancedCount=m.meshPerAttribute*m.count)):S.enableAttribute(s),M.bindBuffer(34962,f),M.vertexAttribPointer(s,c,d,u,v*p,g*p)}else l.isInstancedBufferAttribute?(S.enableAttributeAndDivisor(s,l.meshPerAttribute),void 0===n.maxInstancedCount&&(n.maxInstancedCount=l.meshPerAttribute*l.count)):S.enableAttribute(s),M.bindBuffer(34962,f),M.vertexAttribPointer(s,c,d,u,0,0)}else if(void 0!==a){var y=a[o];if(void 0!==y)switch(y.length){case 2:M.vertexAttrib2fv(s,y);break;case 3:M.vertexAttrib3fv(s,y);break;case 4:M.vertexAttrib4fv(s,y);break;default:M.vertexAttrib1fv(s,y)}}}}S.disableUnusedAttributes()}}this.shadowMap=se,this.getContext=function(){return M},this.getContextAttributes=function(){return M.getContextAttributes()},this.forceContextLoss=function(){var e=x.get("WEBGL_lose_context");e&&e.loseContext()},this.forceContextRestore=function(){var e=x.get("WEBGL_lose_context");e&&e.restoreContext()},this.getPixelRatio=function(){return q},this.setPixelRatio=function(e){void 0!==e&&(q=e,this.setSize(j,Y,!1))},this.getSize=function(e){return void 0===e&&(console.warn("WebGLRenderer: .getsize() now requires a Vector2 as an argument"),e=new In),e.set(j,Y)},this.setSize=function(e,t,n){oe.isPresenting()?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(j=e,Y=t,r.width=Math.floor(e*q),r.height=Math.floor(t*q),!1!==n&&(r.style.width=e+"px",r.style.height=t+"px"),this.setViewport(0,0,e,t))},this.getDrawingBufferSize=function(e){return void 0===e&&(console.warn("WebGLRenderer: .getdrawingBufferSize() now requires a Vector2 as an argument"),e=new In),e.set(j*q,Y*q).floor()},this.setDrawingBufferSize=function(e,t,n){j=e,Y=t,q=n,r.width=Math.floor(e*n),r.height=Math.floor(t*n),this.setViewport(0,0,e,t)},this.getCurrentViewport=function(e){return void 0===e&&(console.warn("WebGLRenderer: .getCurrentViewport() now requires a Vector4 as an argument"),e=new Zn),e.copy(V)},this.getViewport=function(e){return e.copy(X)},this.setViewport=function(e,t,n,r){e.isVector4?X.set(e.x,e.y,e.z,e.w):X.set(e,t,n,r),S.viewport(V.copy(X).multiplyScalar(q).floor())},this.getScissor=function(e){return e.copy(Z)},this.setScissor=function(e,t,n,r){e.isVector4?Z.set(e.x,e.y,e.z,e.w):Z.set(e,t,n,r),S.scissor(H.copy(Z).multiplyScalar(q).floor())},this.getScissorTest=function(){return J},this.setScissorTest=function(e){S.setScissorTest(J=e)},this.getClearColor=function(){return v.getClearColor()},this.setClearColor=function(){v.setClearColor.apply(v,arguments)},this.getClearAlpha=function(){return v.getClearAlpha()},this.setClearAlpha=function(){v.setClearAlpha.apply(v,arguments)},this.clear=function(e,t,n){var r=0;void 0!==e&&!e||(r|=16384),void 0!==t&&!t||(r|=256),void 0!==n&&!n||(r|=1024),M.clear(r)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){r.removeEventListener("webglcontextlost",le,!1),r.removeEventListener("webglcontextrestored",ue,!1),f.dispose(),m.dispose(),b.dispose(),p.dispose(),oe.dispose(),ge.stop()},this.renderBufferImmediate=function(e,t){S.initAttributes();var n=b.get(e);e.hasPositions&&!n.position&&(n.position=M.createBuffer()),e.hasNormals&&!n.normal&&(n.normal=M.createBuffer()),e.hasUvs&&!n.uv&&(n.uv=M.createBuffer()),e.hasColors&&!n.color&&(n.color=M.createBuffer());var r=t.getAttributes();e.hasPositions&&(M.bindBuffer(34962,n.position),M.bufferData(34962,e.positionArray,35048),S.enableAttribute(r.position),M.vertexAttribPointer(r.position,3,5126,!1,0,0)),e.hasNormals&&(M.bindBuffer(34962,n.normal),M.bufferData(34962,e.normalArray,35048),S.enableAttribute(r.normal),M.vertexAttribPointer(r.normal,3,5126,!1,0,0)),e.hasUvs&&(M.bindBuffer(34962,n.uv),M.bufferData(34962,e.uvArray,35048),S.enableAttribute(r.uv),M.vertexAttribPointer(r.uv,2,5126,!1,0,0)),e.hasColors&&(M.bindBuffer(34962,n.color),M.bufferData(34962,e.colorArray,35048),S.enableAttribute(r.color),M.vertexAttribPointer(r.color,3,5126,!1,0,0)),S.disableUnusedAttributes(),M.drawArrays(4,0,e.count),e.count=0},this.renderBufferDirect=function(e,t,n,r,i,a){var o=i.isMesh&&i.matrixWorld.determinant()<0;S.setMaterial(r,o);var s=be(e,t,r,i),l=!1;U.geometry===n.id&&U.program===s.id&&U.wireframe===(!0===r.wireframe)||(U.geometry=n.id,U.program=s.id,U.wireframe=!0===r.wireframe,l=!0),i.morphTargetInfluences&&(L.update(i,n,r,s),l=!0);var u,c=n.index,h=n.attributes.position,f=1;!0===r.wireframe&&(c=A.getWireframeAttribute(n),f=2);var d=R;null!==c&&(u=T.get(c),d=C,d.setIndex(u)),l&&(pe(r,s,n),null!==c&&M.bindBuffer(34963,u.buffer));var p=1/0;null!==c?p=c.count:void 0!==h&&(p=h.count);var m=n.drawRange.start*f,v=n.drawRange.count*f,g=null!==a?a.start*f:0,y=null!==a?a.count*f:1/0,_=Math.max(m,g),x=Math.min(p,m+v,g+y)-1,w=Math.max(0,x-_+1);if(0!==w){if(i.isMesh)if(!0===r.wireframe)S.setLineWidth(r.wireframeLinewidth*re()),d.setMode(1);else switch(i.drawMode){case Yt:d.setMode(4);break;case qt:d.setMode(5);break;case Xt:d.setMode(6)}else if(i.isLine){var b=r.linewidth;void 0===b&&(b=1),S.setLineWidth(b*re()),i.isLineSegments?d.setMode(1):i.isLineLoop?d.setMode(2):d.setMode(3)}else i.isPoints?d.setMode(0):i.isSprite&&d.setMode(4);n&&n.isInstancedBufferGeometry?0<n.maxInstancedCount&&d.renderInstances(n,_,w):d.render(_,w)}},this.compile=function(n,e){_=m.get(n,e),_.init(),n.traverse(function(e){e.isLight&&(_.pushLight(e),e.castShadow&&_.pushShadow(e))}),_.setupLights(e),n.traverse(function(e){if(e.material)if((0,Ue.default)(e.material))for(var t=0;t<e.material.length;t++)we(e.material[t],n.fog,e);else we(e.material,n.fog,e)})};var me=null;function ve(e){oe.isPresenting()||me&&me(e)}var ge=new wl;function ye(e,t,n,r){if(!1!==e.visible){var i=e.layers.test(t.layers);if(i)if(e.isGroup)n=e.renderOrder;else if(e.isLOD)!0===e.autoUpdate&&e.update(t);else if(e.isLight)_.pushLight(e),e.castShadow&&_.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||K.intersectsSprite(e)){r&&ne.setFromMatrixPosition(e.matrixWorld).applyMatrix4(te);var a=p.update(e),o=e.material;o.visible&&d.push(e,a,o,n,ne.z,null)}}else if(e.isImmediateRenderObject)r&&ne.setFromMatrixPosition(e.matrixWorld).applyMatrix4(te),d.push(e,null,e.material,n,ne.z,null);else if((e.isMesh||e.isLine||e.isPoints)&&(e.isSkinnedMesh&&e.skeleton.update(),!e.frustumCulled||K.intersectsObject(e)))if(r&&ne.setFromMatrixPosition(e.matrixWorld).applyMatrix4(te),a=p.update(e),o=e.material,(0,Ue.default)(o))for(var s=a.groups,l=0,u=s.length;l<u;l++){var c=s[l],h=o[c.materialIndex];h&&h.visible&&d.push(e,a,h,n,ne.z,c)}else o.visible&&d.push(e,a,o,n,ne.z,null);var f=e.children;for(l=0,u=f.length;l<u;l++)ye(f[l],t,n,r)}}function _e(e,t,n,r){for(var i=0,a=e.length;i<a;i++){var o=e[i],s=o.object,l=o.geometry,u=void 0===r?o.material:r,c=o.group;if(n.isArrayCamera){z=n;for(var h=n.cameras,f=0,d=h.length;f<d;f++){var p=h[f];s.layers.test(p.layers)&&(S.viewport(V.copy(p.viewport)),_.setupLights(p),xe(s,t,p,l,u,c))}}else z=null,xe(s,t,n,l,u,c)}}function xe(e,t,n,r,i,a){if(e.onBeforeRender(I,t,n,r,i,a),_=m.get(t,z||n),e.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,e.matrixWorld),e.normalMatrix.getNormalMatrix(e.modelViewMatrix),e.isImmediateRenderObject){S.setMaterial(i);var o=be(n,t.fog,i,e);U.geometry=null,U.program=null,U.wireframe=!1,de(e,o)}else I.renderBufferDirect(n,t.fog,r,i,e,a);e.onAfterRender(I,t,n,r,i,a),_=m.get(t,z||n)}function we(e,t,n){var r=b.get(e),i=_.state.lights,a=_.state.shadowsArray,o=i.state.version,s=g.getParameters(e,i.state,a,t,Q.numPlanes,Q.numIntersection,n),l=g.getProgramCode(e,s),u=r.program,c=!0;if(void 0===u)e.addEventListener("dispose",ce);else if(u.code!==l)fe(e);else if(r.lightsStateVersion!==o)r.lightsStateVersion=o,c=!1;else{if(void 0!==s.shaderID)return;c=!1}if(c){if(s.shaderID){var h=xl[s.shaderID];r.shader={name:e.type,uniforms:Fa(h.uniforms),vertexShader:h.vertexShader,fragmentShader:h.fragmentShader}}else r.shader={name:e.type,uniforms:e.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader};e.onBeforeCompile(r.shader,I),l=g.getProgramCode(e,s),u=g.acquireProgram(e,r.shader,s,l),r.program=u,e.program=u}var f=u.getAttributes();if(e.morphTargets){e.numSupportedMorphTargets=0;for(var d=0;d<I.maxMorphTargets;d++)0<=f["morphTarget"+d]&&e.numSupportedMorphTargets++}if(e.morphNormals)for(e.numSupportedMorphNormals=0,d=0;d<I.maxMorphNormals;d++)0<=f["morphNormal"+d]&&e.numSupportedMorphNormals++;var p=r.shader.uniforms;(e.isShaderMaterial||e.isRawShaderMaterial)&&!0!==e.clipping||(r.numClippingPlanes=Q.numPlanes,r.numIntersection=Q.numIntersection,p.clippingPlanes=Q.uniform),r.fog=t,r.lightsStateVersion=o,e.lights&&(p.ambientLightColor.value=i.state.ambient,p.lightProbe.value=i.state.probe,p.directionalLights.value=i.state.directional,p.spotLights.value=i.state.spot,p.rectAreaLights.value=i.state.rectArea,p.pointLights.value=i.state.point,p.hemisphereLights.value=i.state.hemi,p.directionalShadowMap.value=i.state.directionalShadowMap,p.directionalShadowMatrix.value=i.state.directionalShadowMatrix,p.spotShadowMap.value=i.state.spotShadowMap,p.spotShadowMatrix.value=i.state.spotShadowMatrix,p.pointShadowMap.value=i.state.pointShadowMap,p.pointShadowMatrix.value=i.state.pointShadowMatrix);var m=r.program.getUniforms(),v=Nu.seqWithValue(m.seq,p);r.uniformsList=v}function be(e,t,n,r){E.resetTextureUnits();var i=b.get(n),a=_.state.lights;if($&&(ee||e!==G)){var o=e===G&&n.id===B;Q.setState(n.clippingPlanes,n.clipIntersection,n.clipShadows,e,i,o)}!1===n.needsUpdate&&(void 0===i.program||n.fog&&i.fog!==t||n.lights&&i.lightsStateVersion!==a.state.version||void 0!==i.numClippingPlanes&&(i.numClippingPlanes!==Q.numPlanes||i.numIntersection!==Q.numIntersection))&&(n.needsUpdate=!0),n.needsUpdate&&(we(n,t,r),n.needsUpdate=!1);var s=!1,l=!1,u=!1,c=i.program,h=c.getUniforms(),f=i.shader.uniforms;if(S.useProgram(c.program)&&(s=!0,l=!0,u=!0),n.id!==B&&(B=n.id,l=!0),s||G!==e){if(h.setValue(M,"projectionMatrix",e.projectionMatrix),w.logarithmicDepthBuffer&&h.setValue(M,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),G!==e&&(G=e,l=!0,u=!0),n.isShaderMaterial||n.isMeshPhongMaterial||n.isMeshStandardMaterial||n.envMap){var d=h.map.cameraPosition;void 0!==d&&d.setValue(M,ne.setFromMatrixPosition(e.matrixWorld))}(n.isMeshPhongMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial||n.skinning)&&h.setValue(M,"viewMatrix",e.matrixWorldInverse)}if(n.skinning){h.setOptional(M,r,"bindMatrix"),h.setOptional(M,r,"bindMatrixInverse");var p=r.skeleton;if(p){var m=p.bones;if(w.floatVertexTextures){if(void 0===p.boneTexture){var v=Math.sqrt(4*m.length);v=Cn.ceilPowerOfTwo(v),v=Math.max(v,4);var g=new Float32Array(v*v*4);g.set(p.boneMatrices);var y=new ro(g,v,v,st,$e);y.needsUpdate=!0,p.boneMatrices=g,p.boneTexture=y,p.boneTextureSize=v}h.setValue(M,"boneTexture",p.boneTexture,E),h.setValue(M,"boneTextureSize",p.boneTextureSize)}else h.setOptional(M,p,"boneMatrices")}}return l&&(h.setValue(M,"toneMappingExposure",I.toneMappingExposure),h.setValue(M,"toneMappingWhitePoint",I.toneMappingWhitePoint),n.lights&&Be(f,u),t&&n.fog&&Le(f,t),n.isMeshBasicMaterial?Me(f,n):n.isMeshLambertMaterial?(Me(f,n),Re(f,n)):n.isMeshPhongMaterial?(Me(f,n),(n.isMeshToonMaterial?Ie:Ce)(f,n)):n.isMeshStandardMaterial?(Me(f,n),(n.isMeshPhysicalMaterial?Pe:ke)(f,n)):n.isMeshMatcapMaterial?(Me(f,n),Ne(f,n)):n.isMeshDepthMaterial?(Me(f,n),De(f,n)):n.isMeshDistanceMaterial?(Me(f,n),Oe(f,n)):n.isMeshNormalMaterial?(Me(f,n),Fe(f,n)):n.isLineBasicMaterial?(Se(f,n),n.isLineDashedMaterial&&Ee(f,n)):n.isPointsMaterial?Te(f,n):n.isSpriteMaterial?Ae(f,n):n.isShadowMaterial&&(f.color.value.copy(n.color),f.opacity.value=n.opacity),void 0!==f.ltc_1&&(f.ltc_1.value=_l.LTC_1),void 0!==f.ltc_2&&(f.ltc_2.value=_l.LTC_2),Nu.upload(M,i.uniformsList,f,E)),n.isShaderMaterial&&!0===n.uniformsNeedUpdate&&(Nu.upload(M,i.uniformsList,f,E),n.uniformsNeedUpdate=!1),n.isSpriteMaterial&&h.setValue(M,"center",r.center),h.setValue(M,"modelViewMatrix",r.modelViewMatrix),h.setValue(M,"normalMatrix",r.normalMatrix),h.setValue(M,"modelMatrix",r.matrixWorld),c}function Me(e,t){var n;e.opacity.value=t.opacity,t.color&&e.diffuse.value.copy(t.color),t.emissive&&e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),t.map&&(e.map.value=t.map),t.alphaMap&&(e.alphaMap.value=t.alphaMap),t.specularMap&&(e.specularMap.value=t.specularMap),t.envMap&&(e.envMap.value=t.envMap,e.flipEnvMap.value=t.envMap.isCubeTexture?-1:1,e.reflectivity.value=t.reflectivity,e.refractionRatio.value=t.refractionRatio,e.maxMipLevel.value=b.get(t.envMap).__maxMipLevel),t.lightMap&&(e.lightMap.value=t.lightMap,e.lightMapIntensity.value=t.lightMapIntensity),t.aoMap&&(e.aoMap.value=t.aoMap,e.aoMapIntensity.value=t.aoMapIntensity),t.map?n=t.map:t.specularMap?n=t.specularMap:t.displacementMap?n=t.displacementMap:t.normalMap?n=t.normalMap:t.bumpMap?n=t.bumpMap:t.roughnessMap?n=t.roughnessMap:t.metalnessMap?n=t.metalnessMap:t.alphaMap?n=t.alphaMap:t.emissiveMap&&(n=t.emissiveMap),void 0!==n&&(n.isWebGLRenderTarget&&(n=n.texture),!0===n.matrixAutoUpdate&&n.updateMatrix(),e.uvTransform.value.copy(n.matrix))}function Se(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity}function Ee(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}function Te(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.size.value=t.size*q,e.scale.value=.5*Y,e.map.value=t.map,null!==t.map&&(!0===t.map.matrixAutoUpdate&&t.map.updateMatrix(),e.uvTransform.value.copy(t.map.matrix))}function Ae(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.rotation.value=t.rotation,e.map.value=t.map,null!==t.map&&(!0===t.map.matrixAutoUpdate&&t.map.updateMatrix(),e.uvTransform.value.copy(t.map.matrix))}function Le(e,t){e.fogColor.value.copy(t.color),t.isFog?(e.fogNear.value=t.near,e.fogFar.value=t.far):t.isFogExp2&&(e.fogDensity.value=t.density)}function Re(e,t){t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap)}function Ce(e,t){e.specular.value.copy(t.specular),e.shininess.value=Math.max(t.shininess,1e-4),t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===Ge&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===Ge&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}function Ie(e,t){Ce(e,t),t.gradientMap&&(e.gradientMap.value=t.gradientMap)}function ke(e,t){e.roughness.value=t.roughness,e.metalness.value=t.metalness,t.roughnessMap&&(e.roughnessMap.value=t.roughnessMap),t.metalnessMap&&(e.metalnessMap.value=t.metalnessMap),t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===Ge&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===Ge&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias),t.envMap&&(e.envMapIntensity.value=t.envMapIntensity)}function Pe(e,t){ke(e,t),e.reflectivity.value=t.reflectivity,e.clearCoat.value=t.clearCoat,e.clearCoatRoughness.value=t.clearCoatRoughness}function Ne(e,t){t.matcap&&(e.matcap.value=t.matcap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===Ge&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===Ge&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}function De(e,t){t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}function Oe(e,t){t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias),e.referencePosition.value.copy(t.referencePosition),e.nearDistance.value=t.nearDistance,e.farDistance.value=t.farDistance}function Fe(e,t){t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===Ge&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===Ge&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}function Be(e,t){e.ambientLightColor.needsUpdate=t,e.lightProbe.needsUpdate=t,e.directionalLights.needsUpdate=t,e.pointLights.needsUpdate=t,e.spotLights.needsUpdate=t,e.rectAreaLights.needsUpdate=t,e.hemisphereLights.needsUpdate=t}ge.setAnimationLoop(ve),"undefined"!=typeof window&&ge.setContext(window),this.setAnimationLoop=function(e){me=e,oe.setAnimationLoop(e),ge.start()},this.render=function(e,t,n,r){var i,a;if(void 0!==n&&(console.warn("THREE.WebGLRenderer.render(): the renderTarget argument has been removed. Use .setRenderTarget() instead."),i=arguments[2]),void 0!==r&&(console.warn("THREE.WebGLRenderer.render(): the forceClear argument has been removed. Use .clear() instead."),a=arguments[3]),t&&t.isCamera){if(!k){U.geometry=null,U.program=null,U.wireframe=!1,B=-1,G=null,!0===e.autoUpdate&&e.updateMatrixWorld(),null===t.parent&&t.updateMatrixWorld(),oe.enabled&&(t=oe.getCamera(t)),_=m.get(e,t),_.init(),e.onBeforeRender(I,e,t,i||O),te.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),K.setFromMatrix(te),ee=this.localClippingEnabled,$=Q.init(this.clippingPlanes,ee,t),d=f.get(e,t),d.init(),ye(e,t,0,I.sortObjects),!0===I.sortObjects&&d.sort(),$&&Q.beginShadows();var o=_.state.shadowsArray;se.render(o,e,t),_.setupLights(t),$&&Q.endShadows(),this.info.autoReset&&this.info.reset(),void 0!==i&&this.setRenderTarget(i),v.render(d,e,t,a);var s=d.opaque,l=d.transparent;if(e.overrideMaterial){var u=e.overrideMaterial;s.length&&_e(s,e,t,u),l.length&&_e(l,e,t,u)}else s.length&&_e(s,e,t),l.length&&_e(l,e,t);e.onAfterRender(I,e,t),null!==O&&(E.updateRenderTargetMipmap(O),E.updateMultisampleRenderTarget(O)),S.buffers.depth.setTest(!0),S.buffers.depth.setMask(!0),S.buffers.color.setMask(!0),S.setPolygonOffset(!1),oe.enabled&&oe.submitFrame(),d=null,_=null}}else console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")},this.setFramebuffer=function(e){P!==e&&M.bindFramebuffer(36160,e),P=e},this.getActiveCubeFace=function(){return N},this.getActiveMipmapLevel=function(){return D},this.getRenderTarget=function(){return O},this.setRenderTarget=function(e,t,n){O=e,N=t,D=n,e&&void 0===b.get(e).__webglFramebuffer&&E.setupRenderTarget(e);var r=P,i=!1;if(e){var a=b.get(e).__webglFramebuffer;e.isWebGLRenderTargetCube?(r=a[t||0],i=!0):r=e.isWebGLMultisampleRenderTarget?b.get(e).__webglMultisampledFramebuffer:a,V.copy(e.viewport),H.copy(e.scissor),W=e.scissorTest}else V.copy(X).multiplyScalar(q).floor(),H.copy(Z).multiplyScalar(q).floor(),W=J;if(F!==r&&(M.bindFramebuffer(36160,r),F=r),S.viewport(V),S.scissor(H),S.setScissorTest(W),i){var o=b.get(e.texture);M.framebufferTexture2D(36160,36064,34069+(t||0),o.__webglTexture,n||0)}},this.readRenderTargetPixels=function(e,t,n,r,i,a,o){if(e&&e.isWebGLRenderTarget){var s=b.get(e).__webglFramebuffer;if(e.isWebGLRenderTargetCube&&void 0!==o&&(s=s[o]),s){var l=!1;s!==F&&(M.bindFramebuffer(36160,s),l=!0);try{var u=e.texture,c=u.format,h=u.type;if(c!==st&&y.convert(c)!==M.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!(h===qe||y.convert(h)===M.getParameter(35738)||h===$e&&(w.isWebGL2||x.get("OES_texture_float")||x.get("WEBGL_color_buffer_float"))||h===et&&(w.isWebGL2?x.get("EXT_color_buffer_float"):x.get("EXT_color_buffer_half_float"))))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");36053===M.checkFramebufferStatus(36160)?0<=t&&t<=e.width-r&&0<=n&&n<=e.height-i&&M.readPixels(t,n,r,i,y.convert(c),y.convert(h),a):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{l&&M.bindFramebuffer(36160,F)}}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")},this.copyFramebufferToTexture=function(e,t,n){var r=t.image.width,i=t.image.height,a=y.convert(t.format);E.setTexture2D(t,0),M.copyTexImage2D(3553,n||0,a,e.x,e.y,r,i,0)},this.copyTextureToTexture=function(e,t,n,r){var i=t.image.width,a=t.image.height,o=y.convert(n.format),s=y.convert(n.type);E.setTexture2D(n,0),t.isDataTexture?M.texSubImage2D(3553,r||0,e.x,e.y,i,a,o,s,t.image.data):M.texSubImage2D(3553,r||0,e.x,e.y,o,s,t.image)},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}function Kc(e,t){this.name="",this.color=new Ti(e),this.density=void 0!==t?t:25e-5}function Qc(e,t,n){this.name="",this.color=new Ti(e),this.near=void 0!==t?t:1,this.far=void 0!==n?n:1e3}function $c(e,t){this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.dynamic=!1,this.updateRange={offset:0,count:-1},this.version=0}function eh(e,t,n,r){this.data=e,this.itemSize=t,this.offset=n,this.normalized=!0===r}function th(e){ki.call(this),this.type="SpriteMaterial",this.color=new Ti(16777215),this.map=null,this.rotation=0,this.sizeAttenuation=!0,this.lights=!1,this.transparent=!0,this.setValues(e)}function nh(e){if(pi.call(this),this.type="Sprite",void 0===gc){gc=new ba;var t=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),n=new $c(t,5);gc.setIndex([0,1,2,0,2,3]),gc.addAttribute("position",new eh(n,3,0,!1)),gc.addAttribute("uv",new eh(n,2,3,!1))}this.geometry=gc,this.material=void 0!==e?e:new th,this.center=new In(.5,.5)}function rh(e,t,n,r,i,a){wc.subVectors(e,n).addScalar(.5).multiply(r),void 0!==i?(bc.x=a*wc.x-i*wc.y,bc.y=i*wc.x+a*wc.y):bc.copy(wc),e.copy(t),e.x+=bc.x,e.y+=bc.y,e.applyMatrix4(Mc)}function ih(){pi.call(this),this.type="LOD",(0,u.default)(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}function ah(e,t){e&&e.isGeometry&&console.error("THREE.SkinnedMesh no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."),Ma.call(this,e,t),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new Qn,this.bindMatrixInverse=new Qn}function oh(e,t){if(e=e||[],this.bones=e.slice(0),this.boneMatrices=new Float32Array(16*this.bones.length),void 0===t)this.calculateInverses();else if(this.bones.length===t.length)this.boneInverses=t.slice(0);else{console.warn("THREE.Skeleton boneInverses is the wrong length."),this.boneInverses=[];for(var n=0,r=this.bones.length;n<r;n++)this.boneInverses.push(new Qn)}}function sh(){pi.call(this),this.type="Bone"}function lh(e){ki.call(this),this.type="LineBasicMaterial",this.color=new Ti(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.lights=!1,this.setValues(e)}function uh(e,t,n){1===n&&console.error("THREE.Line: parameter THREE.LinePieces no longer supported. Use THREE.LineSegments instead."),pi.call(this),this.type="Line",this.geometry=void 0!==e?e:new ba,this.material=void 0!==t?t:new lh({color:16777215*Math.random()})}function ch(e,t){uh.call(this,e,t),this.type="LineSegments"}function hh(e,t){uh.call(this,e,t),this.type="LineLoop"}function fh(e){ki.call(this),this.type="PointsMaterial",this.color=new Ti(16777215),this.map=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.lights=!1,this.setValues(e)}function dh(e,t){pi.call(this),this.type="Points",this.geometry=void 0!==e?e:new ba,this.material=void 0!==t?t:new fh({color:16777215*Math.random()}),this.updateMorphTargets()}function ph(e,t,n,r,i,a,o,s,l){Xn.call(this,e,t,n,r,i,a,o,s,l),this.format=void 0!==o?o:ot,this.minFilter=void 0!==a?a:Ve,this.magFilter=void 0!==i?i:Ve,this.generateMipmaps=!1}function mh(e,t,n,r,i,a,o,s,l,u,c,h){Xn.call(this,null,a,o,s,l,u,r,i,c,h),this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}function vh(e,t,n,r,i,a,o,s,l){Xn.call(this,e,t,n,r,i,a,o,s,l),this.needsUpdate=!0}function gh(e,t,n,r,i,a,o,s,l,u){if(u=void 0!==u?u:ht,u!==ht&&u!==ft)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&u===ht&&(n=Je),void 0===n&&u===ft&&(n=it),Xn.call(this,null,r,i,a,o,s,u,n,l),this.image={width:e,height:t},this.magFilter=void 0!==o?o:Ne,this.minFilter=void 0!==s?s:Ne,this.flipY=!1,this.generateMipmaps=!1}function yh(e){ba.call(this),this.type="WireframeGeometry";var t,n,r,i,a,o,s,l,u,c,h=[],f=[0,0],d={},p=["a","b","c"];if(e&&e.isGeometry){var m=e.faces;for(t=0,r=m.length;t<r;t++){var v=m[t];for(n=0;n<3;n++)s=v[p[n]],l=v[p[(n+1)%3]],f[0]=Math.min(s,l),f[1]=Math.max(s,l),u=f[0]+","+f[1],void 0===d[u]&&(d[u]={index1:f[0],index2:f[1]})}for(u in d)o=d[u],c=e.vertices[o.index1],h.push(c.x,c.y,c.z),c=e.vertices[o.index2],h.push(c.x,c.y,c.z)}else if(e&&e.isBufferGeometry){var g,y,_,x,w,b,M,S;if(c=new Pn,null!==e.index){for(g=e.attributes.position,y=e.index,_=e.groups,0===_.length&&(_=[{start:0,count:y.count,materialIndex:0}]),i=0,a=_.length;i<a;++i)for(x=_[i],w=x.start,b=x.count,t=w,r=w+b;t<r;t+=3)for(n=0;n<3;n++)s=y.getX(t+n),l=y.getX(t+(n+1)%3),f[0]=Math.min(s,l),f[1]=Math.max(s,l),u=f[0]+","+f[1],void 0===d[u]&&(d[u]={index1:f[0],index2:f[1]});for(u in d)o=d[u],c.fromBufferAttribute(g,o.index1),h.push(c.x,c.y,c.z),c.fromBufferAttribute(g,o.index2),h.push(c.x,c.y,c.z)}else for(g=e.attributes.position,t=0,r=g.count/3;t<r;t++)for(n=0;n<3;n++)M=3*t+n,c.fromBufferAttribute(g,M),h.push(c.x,c.y,c.z),S=3*t+(n+1)%3,c.fromBufferAttribute(g,S),h.push(c.x,c.y,c.z)}this.addAttribute("position",new Vi(h,3))}function _h(e,t,n){Na.call(this),this.type="ParametricGeometry",this.parameters={func:e,slices:t,stacks:n},this.fromBufferGeometry(new xh(e,t,n)),this.mergeVertices()}function xh(e,t,n){ba.call(this),this.type="ParametricBufferGeometry",this.parameters={func:e,slices:t,stacks:n};var r,i,a=[],o=[],s=[],l=[],u=1e-5,c=new Pn,h=new Pn,f=new Pn,d=new Pn,p=new Pn;e.length<3&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");var m=t+1;for(r=0;r<=n;r++){var v=r/n;for(i=0;i<=t;i++){var g=i/t;e(g,v,h),o.push(h.x,h.y,h.z),0<=g-u?(e(g-u,v,f),d.subVectors(h,f)):(e(g+u,v,f),d.subVectors(f,h)),0<=v-u?(e(g,v-u,f),p.subVectors(h,f)):(e(g,v+u,f),p.subVectors(f,h)),c.crossVectors(d,p).normalize(),s.push(c.x,c.y,c.z),l.push(g,v)}}for(r=0;r<n;r++)for(i=0;i<t;i++){var y=r*m+i,_=r*m+i+1,x=(r+1)*m+i+1,w=(r+1)*m+i;a.push(y,_,w),a.push(_,x,w)}this.setIndex(a),this.addAttribute("position",new Vi(o,3)),this.addAttribute("normal",new Vi(s,3)),this.addAttribute("uv",new Vi(l,2))}function wh(e,t,n,r){Na.call(this),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:r},this.fromBufferGeometry(new bh(e,t,n,r)),this.mergeVertices()}function bh(r,a,e,t){ba.call(this),this.type="PolyhedronBufferGeometry",this.parameters={vertices:r,indices:a,radius:e,detail:t},e=e||1,t=t||0;var c=[],h=[];function n(e){for(var t=new Pn,n=new Pn,r=new Pn,i=0;i<a.length;i+=3)u(a[i+0],t),u(a[i+1],n),u(a[i+2],r),o(t,n,r,e)}function o(e,t,n,r){var i,a,o=Math.pow(2,r),s=[];for(i=0;i<=o;i++){s[i]=[];var l=e.clone().lerp(n,i/o),u=t.clone().lerp(n,i/o),c=o-i;for(a=0;a<=c;a++)s[i][a]=0===a&&i===o?l:l.clone().lerp(u,a/c)}for(i=0;i<o;i++)for(a=0;a<2*(o-i)-1;a++){var h=Math.floor(a/2);a%2==0?(f(s[i][h+1]),f(s[i+1][h]),f(s[i][h])):(f(s[i][h+1]),f(s[i+1][h+1]),f(s[i+1][h]))}}function i(e){for(var t=new Pn,n=0;n<c.length;n+=3)t.x=c[n+0],t.y=c[n+1],t.z=c[n+2],t.normalize().multiplyScalar(e),c[n+0]=t.x,c[n+1]=t.y,c[n+2]=t.z}function s(){for(var e=new Pn,t=0;t<c.length;t+=3){e.x=c[t+0],e.y=c[t+1],e.z=c[t+2];var n=m(e)/2/Math.PI+.5,r=v(e)/Math.PI+.5;h.push(n,1-r)}d(),l()}function l(){for(var e=0;e<h.length;e+=6){var t=h[e+0],n=h[e+2],r=h[e+4],i=Math.max(t,n,r),a=Math.min(t,n,r);.9<i&&a<.1&&(t<.2&&(h[e+0]+=1),n<.2&&(h[e+2]+=1),r<.2&&(h[e+4]+=1))}}function f(e){c.push(e.x,e.y,e.z)}function u(e,t){var n=3*e;t.x=r[n+0],t.y=r[n+1],t.z=r[n+2]}function d(){for(var e=new Pn,t=new Pn,n=new Pn,r=new Pn,i=new In,a=new In,o=new In,s=0,l=0;s<c.length;s+=9,l+=6){e.set(c[s+0],c[s+1],c[s+2]),t.set(c[s+3],c[s+4],c[s+5]),n.set(c[s+6],c[s+7],c[s+8]),i.set(h[l+0],h[l+1]),a.set(h[l+2],h[l+3]),o.set(h[l+4],h[l+5]),r.copy(e).add(t).add(n).divideScalar(3);var u=m(r);p(i,l+0,e,u),p(a,l+2,t,u),p(o,l+4,n,u)}}function p(e,t,n,r){r<0&&1===e.x&&(h[t]=e.x-1),0===n.x&&0===n.z&&(h[t]=r/2/Math.PI+.5)}function m(e){return Math.atan2(e.z,-e.x)}function v(e){return Math.atan2(-e.y,Math.sqrt(e.x*e.x+e.z*e.z))}n(t),i(e),s(),this.addAttribute("position",new Vi(c,3)),this.addAttribute("normal",new Vi(c.slice(),3)),this.addAttribute("uv",new Vi(h,2)),0===t?this.computeVertexNormals():this.normalizeNormals()}function Mh(e,t){Na.call(this),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new Sh(e,t)),this.mergeVertices()}function Sh(e,t){var n=[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],r=[2,1,0,0,3,2,1,3,0,2,3,1];bh.call(this,n,r,e,t),this.type="TetrahedronBufferGeometry",this.parameters={radius:e,detail:t}}function Eh(e,t){Na.call(this),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new Th(e,t)),this.mergeVertices()}function Th(e,t){var n=[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],r=[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2];bh.call(this,n,r,e,t),this.type="OctahedronBufferGeometry",this.parameters={radius:e,detail:t}}function Ah(e,t){Na.call(this),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new Lh(e,t)),this.mergeVertices()}function Lh(e,t){var n=(1+Math.sqrt(5))/2,r=[-1,n,0,1,n,0,-1,-n,0,1,-n,0,0,-1,n,0,1,n,0,-1,-n,0,1,-n,n,0,-1,n,0,1,-n,0,-1,-n,0,1],i=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1];bh.call(this,r,i,e,t),this.type="IcosahedronBufferGeometry",this.parameters={radius:e,detail:t}}function Rh(e,t){Na.call(this),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new Ch(e,t)),this.mergeVertices()}function Ch(e,t){var n=(1+Math.sqrt(5))/2,r=1/n,i=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-r,-n,0,-r,n,0,r,-n,0,r,n,-r,-n,0,-r,n,0,r,-n,0,r,n,0,-n,0,-r,n,0,-r,-n,0,r,n,0,r],a=[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9];bh.call(this,i,a,e,t),this.type="DodecahedronBufferGeometry",this.parameters={radius:e,detail:t}}function Ih(e,t,n,r,i,a){Na.call(this),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:r,closed:i},void 0!==a&&console.warn("THREE.TubeGeometry: taper has been removed.");var o=new kh(e,t,n,r,i);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals,this.fromBufferGeometry(o),this.mergeVertices()}function kh(o,s,l,u,e){ba.call(this),this.type="TubeBufferGeometry",this.parameters={path:o,tubularSegments:s,radius:l,radialSegments:u,closed:e},s=s||64,l=l||1,u=u||8,e=e||!1;var c=o.computeFrenetFrames(s,e);this.tangents=c.tangents,this.normals=c.normals,this.binormals=c.binormals;var i,h,f=new Pn,d=new Pn,t=new In,p=new Pn,m=[],v=[],n=[],a=[];function r(){for(i=0;i<s;i++)g(i);g(!1===e?s:0),_(),y()}function g(e){p=o.getPointAt(e/s,p);var t=c.normals[e],n=c.binormals[e];for(h=0;h<=u;h++){var r=h/u*Math.PI*2,i=Math.sin(r),a=-Math.cos(r);d.x=a*t.x+i*n.x,d.y=a*t.y+i*n.y,d.z=a*t.z+i*n.z,d.normalize(),v.push(d.x,d.y,d.z),f.x=p.x+l*d.x,f.y=p.y+l*d.y,f.z=p.z+l*d.z,m.push(f.x,f.y,f.z)}}function y(){for(h=1;h<=s;h++)for(i=1;i<=u;i++){var e=(u+1)*(h-1)+(i-1),t=(u+1)*h+(i-1),n=(u+1)*h+i,r=(u+1)*(h-1)+i;a.push(e,t,r),a.push(t,n,r)}}function _(){for(i=0;i<=s;i++)for(h=0;h<=u;h++)t.x=i/s,t.y=h/u,n.push(t.x,t.y)}r(),this.setIndex(a),this.addAttribute("position",new Vi(m,3)),this.addAttribute("normal",new Vi(v,3)),this.addAttribute("uv",new Vi(n,2))}function Ph(e,t,n,r,i,a,o){Na.call(this),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:n,radialSegments:r,p:i,q:a},void 0!==o&&console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),this.fromBufferGeometry(new Nh(e,t,n,r,i,a)),this.mergeVertices()}function Nh(e,t,n,r,i,a){ba.call(this),this.type="TorusKnotBufferGeometry",this.parameters={radius:e,tube:t,tubularSegments:n,radialSegments:r,p:i,q:a},e=e||1,t=t||.4,n=Math.floor(n)||64,r=Math.floor(r)||8,i=i||2,a=a||3;var o,s,l=[],u=[],c=[],h=[],f=new Pn,d=new Pn,p=new Pn,m=new Pn,v=new Pn,g=new Pn,y=new Pn;for(o=0;o<=n;++o){var _=o/n*i*Math.PI*2;for(A(_,i,a,e,p),A(_+.01,i,a,e,m),g.subVectors(m,p),y.addVectors(m,p),v.crossVectors(g,y),y.crossVectors(v,g),v.normalize(),y.normalize(),s=0;s<=r;++s){var x=s/r*Math.PI*2,w=-t*Math.cos(x),b=t*Math.sin(x);f.x=p.x+(w*y.x+b*v.x),f.y=p.y+(w*y.y+b*v.y),f.z=p.z+(w*y.z+b*v.z),u.push(f.x,f.y,f.z),d.subVectors(f,p).normalize(),c.push(d.x,d.y,d.z),h.push(o/n),h.push(s/r)}}for(s=1;s<=n;s++)for(o=1;o<=r;o++){var M=(r+1)*(s-1)+(o-1),S=(r+1)*s+(o-1),E=(r+1)*s+o,T=(r+1)*(s-1)+o;l.push(M,S,T),l.push(S,E,T)}function A(e,t,n,r,i){var a=Math.cos(e),o=Math.sin(e),s=n/t*e,l=Math.cos(s);i.x=r*(2+l)*.5*a,i.y=r*(2+l)*o*.5,i.z=r*Math.sin(s)*.5}this.setIndex(l),this.addAttribute("position",new Vi(u,3)),this.addAttribute("normal",new Vi(c,3)),this.addAttribute("uv",new Vi(h,2))}function Dh(e,t,n,r,i){Na.call(this),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:r,arc:i},this.fromBufferGeometry(new Oh(e,t,n,r,i)),this.mergeVertices()}function Oh(e,t,n,r,i){ba.call(this),this.type="TorusBufferGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:r,arc:i},e=e||1,t=t||.4,n=Math.floor(n)||8,r=Math.floor(r)||6,i=i||2*Math.PI;var a,o,s=[],l=[],u=[],c=[],h=new Pn,f=new Pn,d=new Pn;for(a=0;a<=n;a++)for(o=0;o<=r;o++){var p=o/r*i,m=a/n*Math.PI*2;f.x=(e+t*Math.cos(m))*Math.cos(p),f.y=(e+t*Math.cos(m))*Math.sin(p),f.z=t*Math.sin(m),l.push(f.x,f.y,f.z),h.x=e*Math.cos(p),h.y=e*Math.sin(p),d.subVectors(f,h).normalize(),u.push(d.x,d.y,d.z),c.push(o/r),c.push(a/n)}for(a=1;a<=n;a++)for(o=1;o<=r;o++){var v=(r+1)*a+o-1,g=(r+1)*(a-1)+o-1,y=(r+1)*(a-1)+o,_=(r+1)*a+o;s.push(v,g,_),s.push(g,y,_)}this.setIndex(s),this.addAttribute("position",new Vi(l,3)),this.addAttribute("normal",new Vi(u,3)),this.addAttribute("uv",new Vi(c,2))}(0,p.default)(Xc.prototype,c.prototype),(0,p.default)(Zc.prototype,c.prototype),(0,p.default)(Kc.prototype,{isFogExp2:!0,clone:function(){return new Kc(this.color,this.density)},toJSON:function(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}),(0,p.default)(Qc.prototype,{isFog:!0,clone:function(){return new Qc(this.color,this.near,this.far)},toJSON:function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}),(0,g.default)($c.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),(0,p.default)($c.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setArray:function(e){if((0,Ue.default)(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");return this.count=void 0!==e?e.length/this.stride:0,this.array=e,this},setDynamic:function(e){return this.dynamic=e,this},copy:function(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.dynamic=e.dynamic,this},copyAt:function(e,t,n){e*=this.stride,n*=t.stride;for(var r=0,i=this.stride;r<i;r++)this.array[e+r]=t.array[n+r];return this},set:function(e,t){return void 0===t&&(t=0),this.array.set(e,t),this},clone:function(){return(new this.constructor).copy(this)},onUpload:function(e){return this.onUploadCallback=e,this}}),(0,u.default)(eh.prototype,{count:{get:function(){return this.data.count}},array:{get:function(){return this.data.array}}}),(0,p.default)(eh.prototype,{isInterleavedBufferAttribute:!0,setX:function(e,t){return this.data.array[e*this.data.stride+this.offset]=t,this},setY:function(e,t){return this.data.array[e*this.data.stride+this.offset+1]=t,this},setZ:function(e,t){return this.data.array[e*this.data.stride+this.offset+2]=t,this},setW:function(e,t){return this.data.array[e*this.data.stride+this.offset+3]=t,this},getX:function(e){return this.data.array[e*this.data.stride+this.offset]},getY:function(e){return this.data.array[e*this.data.stride+this.offset+1]},getZ:function(e){return this.data.array[e*this.data.stride+this.offset+2]},getW:function(e){return this.data.array[e*this.data.stride+this.offset+3]},setXY:function(e,t,n){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this},setXYZ:function(e,t,n,r){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this},setXYZW:function(e,t,n,r,i){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this.data.array[e+3]=i,this}}),th.prototype=(0,l.default)(ki.prototype),th.prototype.constructor=th,th.prototype.isSpriteMaterial=!0,th.prototype.copy=function(e){return ki.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this},nh.prototype=(0,p.default)((0,l.default)(pi.prototype),{constructor:nh,isSprite:!0,raycast:(yc=new Pn,_c=new Pn,xc=new Pn,wc=new In,bc=new In,Mc=new Qn,Sc=new Pn,Ec=new Pn,Tc=new Pn,Ac=new In,Lc=new In,Rc=new In,function(e,t){_c.setFromMatrixScale(this.matrixWorld),Mc.copy(e._camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e._camera.matrixWorldInverse,this.matrixWorld),xc.setFromMatrixPosition(this.modelViewMatrix),e._camera.isPerspectiveCamera&&!1===this.material.sizeAttenuation&&_c.multiplyScalar(-xc.z);var n,r,i=this.material.rotation;0!==i&&(r=Math.cos(i),n=Math.sin(i));var a=this.center;rh(Sc.set(-.5,-.5,0),xc,a,_c,n,r),rh(Ec.set(.5,-.5,0),xc,a,_c,n,r),rh(Tc.set(.5,.5,0),xc,a,_c,n,r),Ac.set(0,0),Lc.set(1,0),Rc.set(1,1);var o=e.ray.intersectTriangle(Sc,Ec,Tc,!1,yc);if(null!==o||(rh(Ec.set(-.5,.5,0),xc,a,_c,n,r),Lc.set(0,1),o=e.ray.intersectTriangle(Sc,Tc,Ec,!1,yc),null!==o)){var s=e.ray.origin.distanceTo(yc);s<e.near||s>e.far||t.push({distance:s,point:yc.clone(),uv:wi.getUV(yc,Sc,Ec,Tc,Ac,Lc,Rc,new In),face:null,object:this})}}),clone:function(){return new this.constructor(this.material).copy(this)},copy:function(e){return pi.prototype.copy.call(this,e),void 0!==e.center&&this.center.copy(e.center),this}}),ih.prototype=(0,p.default)((0,l.default)(pi.prototype),{constructor:ih,isLOD:!0,copy:function(e){pi.prototype.copy.call(this,e,!1);for(var t=e.levels,n=0,r=t.length;n<r;n++){var i=t[n];this.addLevel(i.object.clone(),i.distance)}return this},addLevel:function(e,t){void 0===t&&(t=0),t=Math.abs(t);for(var n=this.levels,r=0;r<n.length&&!(t<n[r].distance);r++);return n.splice(r,0,{distance:t,object:e}),this.add(e),this},getObjectForDistance:function(e){for(var t=this.levels,n=1,r=t.length;n<r&&!(e<t[n].distance);n++);return t[n-1].object},raycast:(kc=new Pn,function(e,t){kc.setFromMatrixPosition(this.matrixWorld);var n=e.ray.origin.distanceTo(kc);this.getObjectForDistance(n).raycast(e,t)}),update:(Cc=new Pn,Ic=new Pn,function(e){var t=this.levels;if(1<t.length){Cc.setFromMatrixPosition(e.matrixWorld),Ic.setFromMatrixPosition(this.matrixWorld);var n=Cc.distanceTo(Ic);t[0].object.visible=!0;for(var r=1,i=t.length;r<i&&n>=t[r].distance;r++)t[r-1].object.visible=!1,t[r].object.visible=!0;for(;r<i;r++)t[r].object.visible=!1}}),toJSON:function(e){var t=pi.prototype.toJSON.call(this,e);t.object.levels=[];for(var n=this.levels,r=0,i=n.length;r<i;r++){var a=n[r];t.object.levels.push({object:a.object.uuid,distance:a.distance})}return t}}),ah.prototype=(0,p.default)((0,l.default)(Ma.prototype),{constructor:ah,isSkinnedMesh:!0,bind:function(e,t){this.skeleton=e,void 0===t&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.getInverse(t)},pose:function(){this.skeleton.pose()},normalizeSkinWeights:function(){for(var e=new Zn,t=this.geometry.attributes.skinWeight,n=0,r=t.count;n<r;n++){e.x=t.getX(n),e.y=t.getY(n),e.z=t.getZ(n),e.w=t.getW(n);var i=1/e.manhattanLength();i!==1/0?e.multiplyScalar(i):e.set(1,0,0,0),t.setXYZW(n,e.x,e.y,e.z,e.w)}},updateMatrixWorld:function(e){Ma.prototype.updateMatrixWorld.call(this,e),"attached"===this.bindMode?this.bindMatrixInverse.getInverse(this.matrixWorld):"detached"===this.bindMode?this.bindMatrixInverse.getInverse(this.bindMatrix):console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),(0,p.default)(oh.prototype,{calculateInverses:function(){this.boneInverses=[];for(var e=0,t=this.bones.length;e<t;e++){var n=new Qn;this.bones[e]&&n.getInverse(this.bones[e].matrixWorld),this.boneInverses.push(n)}},pose:function(){var e,t,n;for(t=0,n=this.bones.length;t<n;t++)e=this.bones[t],e&&e.matrixWorld.getInverse(this.boneInverses[t]);for(t=0,n=this.bones.length;t<n;t++)e=this.bones[t],e&&(e.parent&&e.parent.isBone?(e.matrix.getInverse(e.parent.matrixWorld),e.matrix.multiply(e.matrixWorld)):e.matrix.copy(e.matrixWorld),e.matrix.decompose(e.position,e.quaternion,e.scale))},update:(Pc=new Qn,Nc=new Qn,function(){for(var e=this.bones,t=this.boneInverses,n=this.boneMatrices,r=this.boneTexture,i=0,a=e.length;i<a;i++){var o=e[i]?e[i].matrixWorld:Nc;Pc.multiplyMatrices(o,t[i]),Pc.toArray(n,16*i)}void 0!==r&&(r.needsUpdate=!0)}),clone:function(){return new oh(this.bones,this.boneInverses)},getBoneByName:function(e){for(var t=0,n=this.bones.length;t<n;t++){var r=this.bones[t];if(r.name===e)return r}}}),sh.prototype=(0,p.default)((0,l.default)(pi.prototype),{constructor:sh,isBone:!0}),lh.prototype=(0,l.default)(ki.prototype),lh.prototype.constructor=lh,lh.prototype.isLineBasicMaterial=!0,lh.prototype.copy=function(e){return ki.prototype.copy.call(this,e),this.color.copy(e.color),this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this},uh.prototype=(0,p.default)((0,l.default)(pi.prototype),{constructor:uh,isLine:!0,computeLineDistances:(Bc=new Pn,Uc=new Pn,function(){var e=this.geometry;if(e.isBufferGeometry)if(null===e.index){for(var t=e.attributes.position,n=[0],r=1,i=t.count;r<i;r++)Bc.fromBufferAttribute(t,r-1),Uc.fromBufferAttribute(t,r),n[r]=n[r-1],n[r]+=Bc.distanceTo(Uc);e.addAttribute("lineDistance",new Vi(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(e.isGeometry){var a=e.vertices;for(n=e.lineDistances,n[0]=0,r=1,i=a.length;r<i;r++)n[r]=n[r-1],n[r]+=a[r-1].distanceTo(a[r])}return this}),raycast:(Dc=new Qn,Oc=new xi,Fc=new _i,function(e,t){var n=e.linePrecision,r=this.geometry,i=this.matrixWorld;if(null===r.boundingSphere&&r.computeBoundingSphere(),Fc.copy(r.boundingSphere),Fc.applyMatrix4(i),Fc.radius+=n,!1!==e.ray.intersectsSphere(Fc)){Dc.getInverse(i),Oc.copy(e.ray).applyMatrix4(Dc);var a=n/((this.scale.x+this.scale.y+this.scale.z)/3),o=a*a,s=new Pn,l=new Pn,u=new Pn,c=new Pn,h=this&&this.isLineSegments?2:1;if(r.isBufferGeometry){var f=r.index,d=r.attributes,p=d.position.array;if(null!==f)for(var m=f.array,v=0,g=m.length-1;v<g;v+=h){var y=m[v],_=m[v+1];s.fromArray(p,3*y),l.fromArray(p,3*_);var x=Oc.distanceSqToSegment(s,l,c,u);if(!(o<x)){c.applyMatrix4(this.matrixWorld);var w=e.ray.origin.distanceTo(c);w<e.near||w>e.far||t.push({distance:w,point:u.clone().applyMatrix4(this.matrixWorld),index:v,face:null,faceIndex:null,object:this})}}else for(v=0,g=p.length/3-1;v<g;v+=h)s.fromArray(p,3*v),l.fromArray(p,3*v+3),x=Oc.distanceSqToSegment(s,l,c,u),o<x||(c.applyMatrix4(this.matrixWorld),w=e.ray.origin.distanceTo(c),w<e.near||w>e.far||t.push({distance:w,point:u.clone().applyMatrix4(this.matrixWorld),index:v,face:null,faceIndex:null,object:this}))}else if(r.isGeometry){var b=r.vertices,M=b.length;for(v=0;v<M-1;v+=h)x=Oc.distanceSqToSegment(b[v],b[v+1],c,u),o<x||(c.applyMatrix4(this.matrixWorld),w=e.ray.origin.distanceTo(c),w<e.near||w>e.far||t.push({distance:w,point:u.clone().applyMatrix4(this.matrixWorld),index:v,face:null,faceIndex:null,object:this}))}}}),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),ch.prototype=(0,p.default)((0,l.default)(uh.prototype),{constructor:ch,isLineSegments:!0,computeLineDistances:(Gc=new Pn,zc=new Pn,function(){var e=this.geometry;if(e.isBufferGeometry)if(null===e.index){for(var t=e.attributes.position,n=[],r=0,i=t.count;r<i;r+=2)Gc.fromBufferAttribute(t,r),zc.fromBufferAttribute(t,r+1),n[r]=0===r?0:n[r-1],n[r+1]=n[r]+Gc.distanceTo(zc);e.addAttribute("lineDistance",new Vi(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(e.isGeometry){var a=e.vertices;for(n=e.lineDistances,r=0,i=a.length;r<i;r+=2)Gc.copy(a[r]),zc.copy(a[r+1]),n[r]=0===r?0:n[r-1],n[r+1]=n[r]+Gc.distanceTo(zc)}return this})}),hh.prototype=(0,p.default)((0,l.default)(uh.prototype),{constructor:hh,isLineLoop:!0}),fh.prototype=(0,l.default)(ki.prototype),fh.prototype.constructor=fh,fh.prototype.isPointsMaterial=!0,fh.prototype.copy=function(e){return ki.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.morphTargets=e.morphTargets,this},dh.prototype=(0,p.default)((0,l.default)(pi.prototype),{constructor:dh,isPoints:!0,raycast:(Vc=new Qn,Hc=new xi,Wc=new _i,function(i,a){var o=this,e=this.geometry,s=this.matrixWorld,t=i.params.Points.threshold;if(null===e.boundingSphere&&e.computeBoundingSphere(),Wc.copy(e.boundingSphere),Wc.applyMatrix4(s),Wc.radius+=t,!1!==i.ray.intersectsSphere(Wc)){Vc.getInverse(s),Hc.copy(i.ray).applyMatrix4(Vc);var n=t/((this.scale.x+this.scale.y+this.scale.z)/3),l=n*n,r=new Pn,u=new Pn;if(e.isBufferGeometry){var c=e.index,h=e.attributes,f=h.position.array;if(null!==c)for(var d=c.array,p=0,m=d.length;p<m;p++){var v=d[p];r.fromArray(f,3*v),_(r,v)}else{p=0;for(var g=f.length/3;p<g;p++)r.fromArray(f,3*p),_(r,p)}}else{var y=e.vertices;for(p=0,g=y.length;p<g;p++)_(y[p],p)}}function _(e,t){var n=Hc.distanceSqToPoint(e);if(n<l){Hc.closestPointToPoint(e,u),u.applyMatrix4(s);var r=i.ray.origin.distanceTo(u);if(r<i.near||r>i.far)return;a.push({distance:r,distanceToRay:Math.sqrt(n),point:u.clone(),index:t,face:null,object:o})}}}),updateMorphTargets:function(){var e,t,n,r=this.geometry;if(r.isBufferGeometry){var i=r.morphAttributes,a=(0,m.default)(i);if(0<a.length){var o=i[a[0]];if(void 0!==o)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},e=0,t=o.length;e<t;e++)n=o[e].name||String(e),this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=e}}else{var s=r.morphTargets;void 0!==s&&0<s.length&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),ph.prototype=(0,p.default)((0,l.default)(Xn.prototype),{constructor:ph,isVideoTexture:!0,update:function(){var e=this.image;e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}),mh.prototype=(0,l.default)(Xn.prototype),mh.prototype.constructor=mh,mh.prototype.isCompressedTexture=!0,vh.prototype=(0,l.default)(Xn.prototype),vh.prototype.constructor=vh,vh.prototype.isCanvasTexture=!0,gh.prototype=(0,l.default)(Xn.prototype),gh.prototype.constructor=gh,gh.prototype.isDepthTexture=!0,yh.prototype=(0,l.default)(ba.prototype),yh.prototype.constructor=yh,_h.prototype=(0,l.default)(Na.prototype),_h.prototype.constructor=_h,xh.prototype=(0,l.default)(ba.prototype),xh.prototype.constructor=xh,wh.prototype=(0,l.default)(Na.prototype),wh.prototype.constructor=wh,bh.prototype=(0,l.default)(ba.prototype),bh.prototype.constructor=bh,Mh.prototype=(0,l.default)(Na.prototype),Mh.prototype.constructor=Mh,Sh.prototype=(0,l.default)(bh.prototype),Sh.prototype.constructor=Sh,Eh.prototype=(0,l.default)(Na.prototype),Eh.prototype.constructor=Eh,Th.prototype=(0,l.default)(bh.prototype),Th.prototype.constructor=Th,Ah.prototype=(0,l.default)(Na.prototype),Ah.prototype.constructor=Ah,Lh.prototype=(0,l.default)(bh.prototype),Lh.prototype.constructor=Lh,Rh.prototype=(0,l.default)(Na.prototype),Rh.prototype.constructor=Rh,Ch.prototype=(0,l.default)(bh.prototype),Ch.prototype.constructor=Ch,Ih.prototype=(0,l.default)(Na.prototype),Ih.prototype.constructor=Ih,kh.prototype=(0,l.default)(ba.prototype),kh.prototype.constructor=kh,kh.prototype.toJSON=function(){var e=ba.prototype.toJSON.call(this);return e.path=this.parameters.path.toJSON(),e},Ph.prototype=(0,l.default)(Na.prototype),Ph.prototype.constructor=Ph,Nh.prototype=(0,l.default)(ba.prototype),Nh.prototype.constructor=Nh,Dh.prototype=(0,l.default)(Na.prototype),Dh.prototype.constructor=Dh,Oh.prototype=(0,l.default)(ba.prototype),Oh.prototype.constructor=Oh;var Fh={triangulate:function(e,t,n){n=n||2;var r,i,a,o,s,l,u,c=t&&t.length,h=c?t[0]*n:e.length,f=Bh(e,0,h,n,!0),d=[];if(!f||f.next===f.prev)return d;if(c&&(f=jh(e,t,f,n)),e.length>80*n){r=a=e[0],i=o=e[1];for(var p=n;p<h;p+=n)s=e[p],l=e[p+1],s<r&&(r=s),l<i&&(i=l),a<s&&(a=s),o<l&&(o=l);u=Math.max(a-r,o-i),u=0!==u?1/u:0}return Gh(f,d,n,r,i,u),d}};function Bh(e,t,n,r,i){var a,o;if(i===0<ff(e,t,n,r))for(a=t;a<n;a+=r)o=uf(a,e[a],e[a+1],o);else for(a=n-r;t<=a;a-=r)o=uf(a,e[a],e[a+1],o);return o&&nf(o,o.next)&&(cf(o),o=o.next),o}function Uh(e,t){if(!e)return e;t=t||e;var n,r=e;do{if(n=!1,r.steiner||!nf(r,r.next)&&0!==tf(r.prev,r,r.next))r=r.next;else{if(cf(r),r=t=r.prev,r===r.next)break;n=!0}}while(n||r!==t);return t}function Gh(e,t,n,r,i,a,o){if(e){!o&&a&&Zh(e,r,i,a);for(var s,l,u=e;e.prev!==e.next;)if(s=e.prev,l=e.next,a?Vh(e,r,i,a):zh(e))t.push(s.i/n),t.push(e.i/n),t.push(l.i/n),cf(e),e=l.next,u=l.next;else if(e=l,e===u){o?1===o?(e=Hh(e,t,n),Gh(e,t,n,r,i,a,2)):2===o&&Wh(e,t,n,r,i,a):Gh(Uh(e),t,n,r,i,a,1);break}}}function zh(e){var t=e.prev,n=e,r=e.next;if(0<=tf(t,n,r))return!1;for(var i=e.next.next;i!==e.prev;){if($h(t.x,t.y,n.x,n.y,r.x,r.y,i.x,i.y)&&0<=tf(i.prev,i,i.next))return!1;i=i.next}return!0}function Vh(e,t,n,r){var i=e.prev,a=e,o=e.next;if(0<=tf(i,a,o))return!1;for(var s=i.x<a.x?i.x<o.x?i.x:o.x:a.x<o.x?a.x:o.x,l=i.y<a.y?i.y<o.y?i.y:o.y:a.y<o.y?a.y:o.y,u=i.x>a.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,c=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,h=Kh(s,l,t,n,r),f=Kh(u,c,t,n,r),d=e.prevZ,p=e.nextZ;d&&d.z>=h&&p&&p.z<=f;){if(d!==e.prev&&d!==e.next&&$h(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&0<=tf(d.prev,d,d.next))return!1;if(d=d.prevZ,p!==e.prev&&p!==e.next&&$h(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&0<=tf(p.prev,p,p.next))return!1;p=p.nextZ}for(;d&&d.z>=h;){if(d!==e.prev&&d!==e.next&&$h(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&0<=tf(d.prev,d,d.next))return!1;d=d.prevZ}for(;p&&p.z<=f;){if(p!==e.prev&&p!==e.next&&$h(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&0<=tf(p.prev,p,p.next))return!1;p=p.nextZ}return!0}function Hh(e,t,n){var r=e;do{var i=r.prev,a=r.next.next;!nf(i,a)&&rf(i,r,r.next,a)&&of(i,a)&&of(a,i)&&(t.push(i.i/n),t.push(r.i/n),t.push(a.i/n),cf(r),cf(r.next),r=e=a),r=r.next}while(r!==e);return r}function Wh(e,t,n,r,i,a){var o=e;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&ef(o,s)){var l=lf(o,s);return o=Uh(o,o.next),l=Uh(l,l.next),Gh(o,t,n,r,i,a),void Gh(l,t,n,r,i,a)}s=s.next}o=o.next}while(o!==e)}function jh(e,t,n,r){var i,a,o,s,l,u=[];for(i=0,a=t.length;i<a;i++)o=t[i]*r,s=i<a-1?t[i+1]*r:e.length,l=Bh(e,o,s,r,!1),l===l.next&&(l.steiner=!0),u.push(Qh(l));for(u.sort(Yh),i=0;i<u.length;i++)qh(u[i],n),n=Uh(n,n.next);return n}function Yh(e,t){return e.x-t.x}function qh(e,t){if(t=Xh(e,t),t){var n=lf(t,e);Uh(n,n.next)}}function Xh(e,t){var n,r=t,i=e.x,a=e.y,o=-1/0;do{if(a<=r.y&&a>=r.next.y&&r.next.y!==r.y){var s=r.x+(a-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=i&&o<s){if(o=s,s===i){if(a===r.y)return r;if(a===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!n)return null;if(i===o)return n.prev;var l,u=n,c=n.x,h=n.y,f=1/0;for(r=n.next;r!==u;)i>=r.x&&r.x>=c&&i!==r.x&&$h(a<h?i:o,a,c,h,a<h?o:i,a,r.x,r.y)&&(l=Math.abs(a-r.y)/(i-r.x),(l<f||l===f&&r.x>n.x)&&of(r,e)&&(n=r,f=l)),r=r.next;return n}function Zh(e,t,n,r){for(var i=e;null===i.z&&(i.z=Kh(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next,i!==e;);i.prevZ.nextZ=null,i.prevZ=null,Jh(i)}function Jh(e){var t,n,r,i,a,o,s,l,u=1;do{for(n=e,e=null,a=null,o=0;n;){for(o++,r=n,s=0,t=0;t<u&&(s++,r=r.nextZ,r);t++);for(l=u;0<s||0<l&&r;)0!==s&&(0===l||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,l--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;n=r}a.nextZ=null,u*=2}while(1<o);return e}function Kh(e,t,n,r,i){return e=32767*(e-n)*i,t=32767*(t-r)*i,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e|t<<1}function Qh(e){for(var t=e,n=e;(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next,t!==e;);return n}function $h(e,t,n,r,i,a,o,s){return 0<=(i-o)*(t-s)-(e-o)*(a-s)&&0<=(e-o)*(r-s)-(n-o)*(t-s)&&0<=(n-o)*(a-s)-(i-o)*(r-s)}function ef(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!af(e,t)&&of(e,t)&&of(t,e)&&sf(e,t)}function tf(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function nf(e,t){return e.x===t.x&&e.y===t.y}function rf(e,t,n,r){return!!(nf(e,n)&&nf(t,r)||nf(e,r)&&nf(n,t))||0<tf(e,t,n)!=0<tf(e,t,r)&&0<tf(n,r,e)!=0<tf(n,r,t)}function af(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&rf(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function of(e,t){return tf(e.prev,e,e.next)<0?0<=tf(e,t,e.next)&&0<=tf(e,e.prev,t):tf(e,t,e.prev)<0||tf(e,e.next,t)<0}function sf(e,t){for(var n=e,r=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;n.y>a!=n.next.y>a&&n.next.y!==n.y&&i<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next,n!==e;);return r}function lf(e,t){var n=new hf(e.i,e.x,e.y),r=new hf(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,a.next=r,r.prev=a,r}function uf(e,t,n,r){var i=new hf(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function cf(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function hf(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function ff(e,t,n,r){for(var i=0,a=t,o=n-r;a<n;a+=r)i+=(e[o]-e[a])*(e[a+1]+e[o+1]),o=a;return i}var df={area:function(e){for(var t=e.length,n=0,r=t-1,i=0;i<t;r=i++)n+=e[r].x*e[i].y-e[i].x*e[r].y;return.5*n},isClockWise:function(e){return df.area(e)<0},triangulateShape:function(e,t){var n=[],r=[],i=[];pf(e),mf(n,e);var a=e.length;t.forEach(pf);for(var o=0;o<t.length;o++)r.push(a),a+=t[o].length,mf(n,t[o]);var s=Fh.triangulate(n,r);for(o=0;o<s.length;o+=3)i.push(s.slice(o,o+3));return i}};function pf(e){var t=e.length;2<t&&e[t-1].equals(e[0])&&e.pop()}function mf(e,t){for(var n=0;n<t.length;n++)e.push(t[n].x),e.push(t[n].y)}function vf(e,t){Na.call(this),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},this.fromBufferGeometry(new gf(e,t)),this.mergeVertices()}function gf(e,ee){ba.call(this),this.type="ExtrudeBufferGeometry",this.parameters={shapes:e,options:ee},e=(0,Ue.default)(e)?e:[e];for(var te=this,ne=[],re=[],t=0,n=e.length;t<n;t++){var r=e[t];i(r)}function i(e){var r=[],t=void 0!==ee.curveSegments?ee.curveSegments:12,f=void 0!==ee.steps?ee.steps:1,n=void 0!==ee.depth?ee.depth:100,i=void 0===ee.bevelEnabled||ee.bevelEnabled,a=void 0!==ee.bevelThickness?ee.bevelThickness:6,o=void 0!==ee.bevelSize?ee.bevelSize:a-2,s=void 0!==ee.bevelOffset?ee.bevelOffset:0,d=void 0!==ee.bevelSegments?ee.bevelSegments:3,l=ee.extrudePath,u=void 0!==ee.UVGenerator?ee.UVGenerator:yf;void 0!==ee.amount&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),n=ee.amount);var c,h,p,m,v,g,y,_,x=!1;l&&(c=l.getSpacedPoints(f),x=!0,i=!1,h=l.computeFrenetFrames(f,!1),p=new Pn,m=new Pn,v=new Pn),i||(d=0,a=0,o=0,s=0);var w=e.extractPoints(t),b=w.shape,M=w.holes,S=!df.isClockWise(b);if(S)for(b=b.reverse(),y=0,_=M.length;y<_;y++)g=M[y],df.isClockWise(g)&&(M[y]=g.reverse());var E=df.triangulateShape(b,M),T=b;for(y=0,_=M.length;y<_;y++)g=M[y],b=b.concat(g);function A(e,t,n){return t||console.error("THREE.ExtrudeGeometry: vec does not exist"),t.clone().multiplyScalar(n).add(e)}var L,R,C,I,k,P,N=b.length,D=E.length;function O(e,t,n){var r,i,a,o=e.x-t.x,s=e.y-t.y,l=n.x-e.x,u=n.y-e.y,c=o*o+s*s,h=o*u-s*l;if(Math.abs(h)>ie.default){var f=Math.sqrt(c),d=Math.sqrt(l*l+u*u),p=t.x-s/f,m=t.y+o/f,v=n.x-u/d,g=n.y+l/d,y=((v-p)*u-(g-m)*l)/(o*u-s*l);r=p+o*y-e.x,i=m+s*y-e.y;var _=r*r+i*i;if(_<=2)return new In(r,i);a=Math.sqrt(_/2)}else{var x=!1;o>ie.default?l>ie.default&&(x=!0):o<-ie.default?l<-ie.default&&(x=!0):Math.sign(s)===Math.sign(u)&&(x=!0),a=x?(r=-s,i=o,Math.sqrt(c)):(r=o,i=s,Math.sqrt(c/2))}return new In(r/a,i/a)}for(var F=[],B=0,U=T.length,G=U-1,z=B+1;B<U;B++,G++,z++)G===U&&(G=0),z===U&&(z=0),F[B]=O(T[B],T[G],T[z]);var V,H,W=[],j=F.concat();for(y=0,_=M.length;y<_;y++){for(g=M[y],V=[],B=0,U=g.length,G=U-1,z=B+1;B<U;B++,G++,z++)G===U&&(G=0),z===U&&(z=0),V[B]=O(g[B],g[G],g[z]);W.push(V),j=j.concat(V)}for(L=0;L<d;L++){for(C=L/d,I=a*Math.cos(C*Math.PI/2),R=o*Math.sin(C*Math.PI/2)+s,B=0,U=T.length;B<U;B++)k=A(T[B],F[B],R),Z(k.x,k.y,-I);for(y=0,_=M.length;y<_;y++)for(g=M[y],V=W[y],B=0,U=g.length;B<U;B++)k=A(g[B],V[B],R),Z(k.x,k.y,-I)}for(R=o+s,B=0;B<N;B++)k=i?A(b[B],j[B],R):b[B],x?(m.copy(h.normals[0]).multiplyScalar(k.x),p.copy(h.binormals[0]).multiplyScalar(k.y),v.copy(c[0]).add(m).add(p),Z(v.x,v.y,v.z)):Z(k.x,k.y,0);for(H=1;H<=f;H++)for(B=0;B<N;B++)k=i?A(b[B],j[B],R):b[B],x?(m.copy(h.normals[H]).multiplyScalar(k.x),p.copy(h.binormals[H]).multiplyScalar(k.y),v.copy(c[H]).add(m).add(p),Z(v.x,v.y,v.z)):Z(k.x,k.y,n/f*H);for(L=d-1;0<=L;L--){for(C=L/d,I=a*Math.cos(C*Math.PI/2),R=o*Math.sin(C*Math.PI/2)+s,B=0,U=T.length;B<U;B++)k=A(T[B],F[B],R),Z(k.x,k.y,n+I);for(y=0,_=M.length;y<_;y++)for(g=M[y],V=W[y],B=0,U=g.length;B<U;B++)k=A(g[B],V[B],R),x?Z(k.x,k.y+c[f-1].y,c[f-1].x+I):Z(k.x,k.y,n+I)}function Y(){var e=ne.length/3;if(i){var t=0,n=N*t;for(B=0;B<D;B++)P=E[B],J(P[2]+n,P[1]+n,P[0]+n);for(t=f+2*d,n=N*t,B=0;B<D;B++)P=E[B],J(P[0]+n,P[1]+n,P[2]+n)}else{for(B=0;B<D;B++)P=E[B],J(P[2],P[1],P[0]);for(B=0;B<D;B++)P=E[B],J(P[0]+N*f,P[1]+N*f,P[2]+N*f)}te.addGroup(e,ne.length/3-e,0)}function q(){var e=ne.length/3,t=0;for(X(T,t),t+=T.length,y=0,_=M.length;y<_;y++)g=M[y],X(g,t),t+=g.length;te.addGroup(e,ne.length/3-e,1)}function X(e,t){var n,r;for(B=e.length;0<=--B;){n=B,r=B-1,r<0&&(r=e.length-1);var i=0,a=f+2*d;for(i=0;i<a;i++){var o=N*i,s=N*(i+1),l=t+n+o,u=t+r+o,c=t+r+s,h=t+n+s;K(l,u,c,h)}}}function Z(e,t,n){r.push(e),r.push(t),r.push(n)}function J(e,t,n){Q(e),Q(t),Q(n);var r=ne.length/3,i=u.generateTopUV(te,ne,r-3,r-2,r-1);$(i[0]),$(i[1]),$(i[2])}function K(e,t,n,r){Q(e),Q(t),Q(r),Q(t),Q(n),Q(r);var i=ne.length/3,a=u.generateSideWallUV(te,ne,i-6,i-3,i-2,i-1);$(a[0]),$(a[1]),$(a[3]),$(a[1]),$(a[2]),$(a[3])}function Q(e){ne.push(r[3*e+0]),ne.push(r[3*e+1]),ne.push(r[3*e+2])}function $(e){re.push(e.x),re.push(e.y)}Y(),q()}this.addAttribute("position",new Vi(ne,3)),this.addAttribute("uv",new Vi(re,2)),this.computeVertexNormals()}t.ShapeUtils=df,vf.prototype=(0,l.default)(Na.prototype),vf.prototype.constructor=vf,vf.prototype.toJSON=function(){var e=Na.prototype.toJSON.call(this),t=this.parameters.shapes,n=this.parameters.options;return _f(t,n,e)},gf.prototype=(0,l.default)(ba.prototype),gf.prototype.constructor=gf,gf.prototype.toJSON=function(){var e=ba.prototype.toJSON.call(this),t=this.parameters.shapes,n=this.parameters.options;return _f(t,n,e)};var yf={generateTopUV:function(e,t,n,r,i){var a=t[3*n],o=t[3*n+1],s=t[3*r],l=t[3*r+1],u=t[3*i],c=t[3*i+1];return[new In(a,o),new In(s,l),new In(u,c)]},generateSideWallUV:function(e,t,n,r,i,a){var o=t[3*n],s=t[3*n+1],l=t[3*n+2],u=t[3*r],c=t[3*r+1],h=t[3*r+2],f=t[3*i],d=t[3*i+1],p=t[3*i+2],m=t[3*a],v=t[3*a+1],g=t[3*a+2];return Math.abs(s-c)<.01?[new In(o,1-l),new In(u,1-h),new In(f,1-p),new In(m,1-g)]:[new In(s,1-l),new In(c,1-h),new In(d,1-p),new In(v,1-g)]}};function _f(e,t,n){if(n.shapes=[],(0,Ue.default)(e))for(var r=0,i=e.length;r<i;r++){var a=e[r];n.shapes.push(a.uuid)}else n.shapes.push(e.uuid);return void 0!==t.extrudePath&&(n.options.extrudePath=t.extrudePath.toJSON()),n}function xf(e,t){Na.call(this),this.type="TextGeometry",this.parameters={text:e,parameters:t},this.fromBufferGeometry(new wf(e,t)),this.mergeVertices()}function wf(e,t){t=t||{};var n=t.font;if(!n||!n.isFont)return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new Na;var r=n.generateShapes(e,t.size);t.depth=void 0!==t.height?t.height:50,void 0===t.bevelThickness&&(t.bevelThickness=10),void 0===t.bevelSize&&(t.bevelSize=8),void 0===t.bevelEnabled&&(t.bevelEnabled=!1),gf.call(this,r,t),this.type="TextBufferGeometry"}function bf(e,t,n,r,i,a,o){Na.call(this),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:r,phiLength:i,thetaStart:a,thetaLength:o},this.fromBufferGeometry(new Mf(e,t,n,r,i,a,o)),this.mergeVertices()}function Mf(e,t,n,r,i,a,o){ba.call(this),this.type="SphereBufferGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:r,phiLength:i,thetaStart:a,thetaLength:o},e=e||1,t=Math.max(3,Math.floor(t)||8),n=Math.max(2,Math.floor(n)||6),r=void 0!==r?r:0,i=void 0!==i?i:2*Math.PI,a=void 0!==a?a:0,o=void 0!==o?o:Math.PI;var s,l,u=Math.min(a+o,Math.PI),c=0,h=[],f=new Pn,d=new Pn,p=[],m=[],v=[],g=[];for(l=0;l<=n;l++){var y=[],_=l/n,x=0;for(0==l&&0==a?x=.5/t:l==n&&u==Math.PI&&(x=-.5/t),s=0;s<=t;s++){var w=s/t;f.x=-e*Math.cos(r+w*i)*Math.sin(a+_*o),f.y=e*Math.cos(a+_*o),f.z=e*Math.sin(r+w*i)*Math.sin(a+_*o),m.push(f.x,f.y,f.z),d.copy(f).normalize(),v.push(d.x,d.y,d.z),g.push(w+x,1-_),y.push(c++)}h.push(y)}for(l=0;l<n;l++)for(s=0;s<t;s++){var b=h[l][s+1],M=h[l][s],S=h[l+1][s],E=h[l+1][s+1];(0!==l||0<a)&&p.push(b,M,E),(l!==n-1||u<Math.PI)&&p.push(M,S,E)}this.setIndex(p),this.addAttribute("position",new Vi(m,3)),this.addAttribute("normal",new Vi(v,3)),this.addAttribute("uv",new Vi(g,2))}function Sf(e,t,n,r,i,a){Na.call(this),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:r,thetaStart:i,thetaLength:a},this.fromBufferGeometry(new Ef(e,t,n,r,i,a)),this.mergeVertices()}function Ef(e,t,n,r,i,a){ba.call(this),this.type="RingBufferGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:r,thetaStart:i,thetaLength:a},e=e||.5,t=t||1,i=void 0!==i?i:0,a=void 0!==a?a:2*Math.PI,n=void 0!==n?Math.max(3,n):8,r=void 0!==r?Math.max(1,r):1;var o,s,l,u=[],c=[],h=[],f=[],d=e,p=(t-e)/r,m=new Pn,v=new In;for(s=0;s<=r;s++){for(l=0;l<=n;l++)o=i+l/n*a,m.x=d*Math.cos(o),m.y=d*Math.sin(o),c.push(m.x,m.y,m.z),h.push(0,0,1),v.x=(m.x/t+1)/2,v.y=(m.y/t+1)/2,f.push(v.x,v.y);d+=p}for(s=0;s<r;s++){var g=s*(n+1);for(l=0;l<n;l++){o=l+g;var y=o,_=o+n+1,x=o+n+2,w=o+1;u.push(y,_,w),u.push(_,x,w)}}this.setIndex(u),this.addAttribute("position",new Vi(c,3)),this.addAttribute("normal",new Vi(h,3)),this.addAttribute("uv",new Vi(f,2))}function Tf(e,t,n,r){Na.call(this),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:r},this.fromBufferGeometry(new Af(e,t,n,r)),this.mergeVertices()}function Af(e,t,n,r){ba.call(this),this.type="LatheBufferGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:r},t=Math.floor(t)||12,n=n||0,r=r||2*Math.PI,r=Cn.clamp(r,0,2*Math.PI);var i,a,o,s=[],l=[],u=[],c=1/t,h=new Pn,f=new In;for(a=0;a<=t;a++){var d=n+a*c*r,p=Math.sin(d),m=Math.cos(d);for(o=0;o<=e.length-1;o++)h.x=e[o].x*p,h.y=e[o].y,h.z=e[o].x*m,l.push(h.x,h.y,h.z),f.x=a/t,f.y=o/(e.length-1),u.push(f.x,f.y)}for(a=0;a<t;a++)for(o=0;o<e.length-1;o++){i=o+a*e.length;var v=i,g=i+e.length,y=i+e.length+1,_=i+1;s.push(v,g,_),s.push(g,y,_)}if(this.setIndex(s),this.addAttribute("position",new Vi(l,3)),this.addAttribute("uv",new Vi(u,2)),this.computeVertexNormals(),r===2*Math.PI){var x=this.attributes.normal.array,w=new Pn,b=new Pn,M=new Pn;for(i=t*e.length*3,a=0,o=0;a<e.length;a++,o+=3)w.x=x[o+0],w.y=x[o+1],w.z=x[o+2],b.x=x[i+o+0],b.y=x[i+o+1],b.z=x[i+o+2],M.addVectors(w,b).normalize(),x[o+0]=x[i+o+0]=M.x,x[o+1]=x[i+o+1]=M.y,x[o+2]=x[i+o+2]=M.z}}function Lf(e,t){Na.call(this),this.type="ShapeGeometry","object"===(0,o.default)(t)&&(console.warn("THREE.ShapeGeometry: Options parameter has been removed."),t=t.curveSegments),this.parameters={shapes:e,curveSegments:t},this.fromBufferGeometry(new Rf(e,t)),this.mergeVertices()}function Rf(e,p){ba.call(this),this.type="ShapeBufferGeometry",this.parameters={shapes:e,curveSegments:p},p=p||12;var m=[],v=[],g=[],y=[],t=0,_=0;if(!1===(0,Ue.default)(e))r(e);else for(var n=0;n<e.length;n++)r(e[n]),this.addGroup(t,_,n),t+=_,_=0;function r(e){var t,n,r,i=v.length/3,a=e.extractPoints(p),o=a.shape,s=a.holes;for(!1===df.isClockWise(o)&&(o=o.reverse()),t=0,n=s.length;t<n;t++)r=s[t],!0===df.isClockWise(r)&&(s[t]=r.reverse());var l=df.triangulateShape(o,s);for(t=0,n=s.length;t<n;t++)r=s[t],o=o.concat(r);for(t=0,n=o.length;t<n;t++){var u=o[t];v.push(u.x,u.y,0),g.push(0,0,1),y.push(u.x,u.y)}for(t=0,n=l.length;t<n;t++){var c=l[t],h=c[0]+i,f=c[1]+i,d=c[2]+i;m.push(h,f,d),_+=3}}this.setIndex(m),this.addAttribute("position",new Vi(v,3)),this.addAttribute("normal",new Vi(g,3)),this.addAttribute("uv",new Vi(y,2))}function Cf(e,t){if(t.shapes=[],(0,Ue.default)(e))for(var n=0,r=e.length;n<r;n++){var i=e[n];t.shapes.push(i.uuid)}else t.shapes.push(e.uuid);return t}function If(e,t){ba.call(this),this.type="EdgesGeometry",this.parameters={thresholdAngle:t},t=void 0!==t?t:1;var n,r,i,a,o=[],s=Math.cos(Cn.DEG2RAD*t),l=[0,0],u={},c=["a","b","c"];e.isBufferGeometry?(a=new Na,a.fromBufferGeometry(e)):a=e.clone(),a.mergeVertices(),a.computeFaceNormals();for(var h=a.vertices,f=a.faces,d=0,p=f.length;d<p;d++)for(var m=f[d],v=0;v<3;v++)n=m[c[v]],r=m[c[(v+1)%3]],l[0]=Math.min(n,r),l[1]=Math.max(n,r),i=l[0]+","+l[1],void 0===u[i]?u[i]={index1:l[0],index2:l[1],face1:d,face2:void 0}:u[i].face2=d;for(i in u){var g=u[i];if(void 0===g.face2||f[g.face1].normal.dot(f[g.face2].normal)<=s){var y=h[g.index1];o.push(y.x,y.y,y.z),y=h[g.index2],o.push(y.x,y.y,y.z)}}this.addAttribute("position",new Vi(o,3))}function kf(e,t,n,r,i,a,o,s){Na.call(this),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:r,heightSegments:i,openEnded:a,thetaStart:o,thetaLength:s},this.fromBufferGeometry(new Pf(e,t,n,r,i,a,o,s)),this.mergeVertices()}function Pf(g,y,_,x,w,e,b,M){ba.call(this),this.type="CylinderBufferGeometry",this.parameters={radiusTop:g,radiusBottom:y,height:_,radialSegments:x,heightSegments:w,openEnded:e,thetaStart:b,thetaLength:M};var S=this;g=void 0!==g?g:1,y=void 0!==y?y:1,_=_||1,x=Math.floor(x)||8,w=Math.floor(w)||1,e=void 0!==e&&e,b=void 0!==b?b:0,M=void 0!==M?M:2*Math.PI;var E=[],T=[],A=[],L=[],R=0,C=[],I=_/2,k=0;function t(){var e,t,n=new Pn,r=new Pn,i=0,a=(y-g)/_;for(t=0;t<=w;t++){var o=[],s=t/w,l=s*(y-g)+g;for(e=0;e<=x;e++){var u=e/x,c=u*M+b,h=Math.sin(c),f=Math.cos(c);r.x=l*h,r.y=-s*_+I,r.z=l*f,T.push(r.x,r.y,r.z),n.set(h,a,f).normalize(),A.push(n.x,n.y,n.z),L.push(u,1-s),o.push(R++)}C.push(o)}for(e=0;e<x;e++)for(t=0;t<w;t++){var d=C[t][e],p=C[t+1][e],m=C[t+1][e+1],v=C[t][e+1];E.push(d,p,v),E.push(p,m,v),i+=6}S.addGroup(k,i,0),k+=i}function n(e){var t,n,r,i=new In,a=new Pn,o=0,s=!0===e?g:y,l=!0===e?1:-1;for(n=R,t=1;t<=x;t++)T.push(0,I*l,0),A.push(0,l,0),L.push(.5,.5),R++;for(r=R,t=0;t<=x;t++){var u=t/x,c=u*M+b,h=Math.cos(c),f=Math.sin(c);a.x=s*f,a.y=I*l,a.z=s*h,T.push(a.x,a.y,a.z),A.push(0,l,0),i.x=.5*h+.5,i.y=.5*f*l+.5,L.push(i.x,i.y),R++}for(t=0;t<x;t++){var d=n+t,p=r+t;!0===e?E.push(p,p+1,d):E.push(p+1,p,d),o+=3}S.addGroup(k,o,!0===e?1:2),k+=o}t(),!1===e&&(0<g&&n(!0),0<y&&n(!1)),this.setIndex(E),this.addAttribute("position",new Vi(T,3)),this.addAttribute("normal",new Vi(A,3)),this.addAttribute("uv",new Vi(L,2))}function Nf(e,t,n,r,i,a,o){kf.call(this,0,e,t,n,r,i,a,o),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:r,openEnded:i,thetaStart:a,thetaLength:o}}function Df(e,t,n,r,i,a,o){Pf.call(this,0,e,t,n,r,i,a,o),this.type="ConeBufferGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:r,openEnded:i,thetaStart:a,thetaLength:o}}function Of(e,t,n,r){Na.call(this),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:r},this.fromBufferGeometry(new Ff(e,t,n,r)),this.mergeVertices()}function Ff(e,t,n,r){ba.call(this),this.type="CircleBufferGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:r},e=e||1,t=void 0!==t?Math.max(3,t):8,n=void 0!==n?n:0,r=void 0!==r?r:2*Math.PI;var i,a,o=[],s=[],l=[],u=[],c=new Pn,h=new In;for(s.push(0,0,0),l.push(0,0,1),u.push(.5,.5),a=0,i=3;a<=t;a++,i+=3){var f=n+a/t*r;c.x=e*Math.cos(f),c.y=e*Math.sin(f),s.push(c.x,c.y,c.z),l.push(0,0,1),h.x=(s[i]/e+1)/2,h.y=(s[i+1]/e+1)/2,u.push(h.x,h.y)}for(i=1;i<=t;i++)o.push(i,i+1,0);this.setIndex(o),this.addAttribute("position",new Vi(s,3)),this.addAttribute("normal",new Vi(l,3)),this.addAttribute("uv",new Vi(u,2))}xf.prototype=(0,l.default)(Na.prototype),xf.prototype.constructor=xf,wf.prototype=(0,l.default)(gf.prototype),wf.prototype.constructor=wf,bf.prototype=(0,l.default)(Na.prototype),bf.prototype.constructor=bf,Mf.prototype=(0,l.default)(ba.prototype),Mf.prototype.constructor=Mf,Sf.prototype=(0,l.default)(Na.prototype),Sf.prototype.constructor=Sf,Ef.prototype=(0,l.default)(ba.prototype),Ef.prototype.constructor=Ef,Tf.prototype=(0,l.default)(Na.prototype),Tf.prototype.constructor=Tf,Af.prototype=(0,l.default)(ba.prototype),Af.prototype.constructor=Af,Lf.prototype=(0,l.default)(Na.prototype),Lf.prototype.constructor=Lf,Lf.prototype.toJSON=function(){var e=Na.prototype.toJSON.call(this),t=this.parameters.shapes;return Cf(t,e)},Rf.prototype=(0,l.default)(ba.prototype),Rf.prototype.constructor=Rf,Rf.prototype.toJSON=function(){var e=ba.prototype.toJSON.call(this),t=this.parameters.shapes;return Cf(t,e)},If.prototype=(0,l.default)(ba.prototype),If.prototype.constructor=If,kf.prototype=(0,l.default)(Na.prototype),kf.prototype.constructor=kf,Pf.prototype=(0,l.default)(ba.prototype),Pf.prototype.constructor=Pf,Nf.prototype=(0,l.default)(kf.prototype),Nf.prototype.constructor=Nf,Df.prototype=(0,l.default)(Pf.prototype),Df.prototype.constructor=Df,Of.prototype=(0,l.default)(Na.prototype),Of.prototype.constructor=Of,Ff.prototype=(0,l.default)(ba.prototype),Ff.prototype.constructor=Ff;var Bf=(0,a.default)({WireframeGeometry:yh,ParametricGeometry:_h,ParametricBufferGeometry:xh,TetrahedronGeometry:Mh,TetrahedronBufferGeometry:Sh,OctahedronGeometry:Eh,OctahedronBufferGeometry:Th,IcosahedronGeometry:Ah,IcosahedronBufferGeometry:Lh,DodecahedronGeometry:Rh,DodecahedronBufferGeometry:Ch,PolyhedronGeometry:wh,PolyhedronBufferGeometry:bh,TubeGeometry:Ih,TubeBufferGeometry:kh,TorusKnotGeometry:Ph,TorusKnotBufferGeometry:Nh,TorusGeometry:Dh,TorusBufferGeometry:Oh,TextGeometry:xf,TextBufferGeometry:wf,SphereGeometry:bf,SphereBufferGeometry:Mf,RingGeometry:Sf,RingBufferGeometry:Ef,PlaneGeometry:Ml,PlaneBufferGeometry:Sl,LatheGeometry:Tf,LatheBufferGeometry:Af,ShapeGeometry:Lf,ShapeBufferGeometry:Rf,ExtrudeGeometry:vf,ExtrudeBufferGeometry:gf,EdgesGeometry:If,ConeGeometry:Nf,ConeBufferGeometry:Df,CylinderGeometry:kf,CylinderBufferGeometry:Pf,CircleGeometry:Of,CircleBufferGeometry:Ff,BoxGeometry:Da,BoxBufferGeometry:Oa});function Uf(e){ki.call(this),this.type="ShadowMaterial",this.color=new Ti(0),this.transparent=!0,this.setValues(e)}function Gf(e){Va.call(this,e),this.type="RawShaderMaterial"}function zf(e){ki.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Ti(16777215),this.roughness=.5,this.metalness=.5,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ti(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=on,this.normalScale=new In(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function Vf(e){zf.call(this),this.defines={PHYSICAL:""},this.type="MeshPhysicalMaterial",this.reflectivity=.5,this.clearCoat=0,this.clearCoatRoughness=0,this.setValues(e)}function Hf(e){ki.call(this),this.type="MeshPhongMaterial",this.color=new Ti(16777215),this.specular=new Ti(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ti(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=on,this.normalScale=new In(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=X,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function Wf(e){Hf.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.gradientMap=null,this.setValues(e)}function jf(e){ki.call(this),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=on,this.normalScale=new In(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function Yf(e){ki.call(this),this.type="MeshLambertMaterial",this.color=new Ti(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ti(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=X,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function qf(e){ki.call(this),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Ti(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=on,this.normalScale=new In(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.lights=!1,this.setValues(e)}function Xf(e){lh.call(this),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}Uf.prototype=(0,l.default)(ki.prototype),Uf.prototype.constructor=Uf,Uf.prototype.isShadowMaterial=!0,Uf.prototype.copy=function(e){return ki.prototype.copy.call(this,e),this.color.copy(e.color),this},Gf.prototype=(0,l.default)(Va.prototype),Gf.prototype.constructor=Gf,Gf.prototype.isRawShaderMaterial=!0,zf.prototype=(0,l.default)(ki.prototype),zf.prototype.constructor=zf,zf.prototype.isMeshStandardMaterial=!0,zf.prototype.copy=function(e){return ki.prototype.copy.call(this,e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},Vf.prototype=(0,l.default)(zf.prototype),Vf.prototype.constructor=Vf,Vf.prototype.isMeshPhysicalMaterial=!0,Vf.prototype.copy=function(e){return zf.prototype.copy.call(this,e),this.defines={PHYSICAL:""},this.reflectivity=e.reflectivity,this.clearCoat=e.clearCoat,this.clearCoatRoughness=e.clearCoatRoughness,this},Hf.prototype=(0,l.default)(ki.prototype),Hf.prototype.constructor=Hf,Hf.prototype.isMeshPhongMaterial=!0,Hf.prototype.copy=function(e){return ki.prototype.copy.call(this,e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},Wf.prototype=(0,l.default)(Hf.prototype),Wf.prototype.constructor=Wf,Wf.prototype.isMeshToonMaterial=!0,Wf.prototype.copy=function(e){return Hf.prototype.copy.call(this,e),this.gradientMap=e.gradientMap,this},jf.prototype=(0,l.default)(ki.prototype),jf.prototype.constructor=jf,jf.prototype.isMeshNormalMaterial=!0,jf.prototype.copy=function(e){return ki.prototype.copy.call(this,e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},Yf.prototype=(0,l.default)(ki.prototype),Yf.prototype.constructor=Yf,Yf.prototype.isMeshLambertMaterial=!0,Yf.prototype.copy=function(e){return ki.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},qf.prototype=(0,l.default)(ki.prototype),qf.prototype.constructor=qf,qf.prototype.isMeshMatcapMaterial=!0,qf.prototype.copy=function(e){return ki.prototype.copy.call(this,e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},Xf.prototype=(0,l.default)(lh.prototype),Xf.prototype.constructor=Xf,Xf.prototype.isLineDashedMaterial=!0,Xf.prototype.copy=function(e){return lh.prototype.copy.call(this,e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this};var Zf=(0,a.default)({ShadowMaterial:Uf,SpriteMaterial:th,RawShaderMaterial:Gf,ShaderMaterial:Va,PointsMaterial:fh,MeshPhysicalMaterial:Vf,MeshStandardMaterial:zf,MeshPhongMaterial:Hf,MeshToonMaterial:Wf,MeshNormalMaterial:jf,MeshLambertMaterial:Yf,MeshDepthMaterial:uc,MeshDistanceMaterial:cc,MeshBasicMaterial:Pi,MeshMatcapMaterial:qf,LineDashedMaterial:Xf,LineBasicMaterial:lh,Material:ki}),Jf={arraySlice:function(e,t,n){return Jf.isTypedArray(e)?new e.constructor(e.subarray(t,void 0!==n?n:e.length)):e.slice(t,n)},convertArray:function(e,t,n){return!e||!n&&e.constructor===t?e:"number"==typeof t.BYTES_PER_ELEMENT?new t(e):Array.prototype.slice.call(e)},isTypedArray:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)},getKeyframeOrder:function(n){function e(e,t){return n[e]-n[t]}for(var t=n.length,r=new Array(t),i=0;i!==t;++i)r[i]=i;return r.sort(e),r},sortedArray:function(e,t,n){for(var r=e.length,i=new e.constructor(r),a=0,o=0;o!==r;++a)for(var s=n[a]*t,l=0;l!==t;++l)i[o++]=e[s+l];return i},flattenJSON:function(e,t,n,r){for(var i=1,a=e[0];void 0!==a&&void 0===a[r];)a=e[i++];if(void 0!==a){var o=a[r];if(void 0!==o)if((0,Ue.default)(o))for(;o=a[r],void 0!==o&&(t.push(a.time),n.push.apply(n,o)),a=e[i++],void 0!==a;);else if(void 0!==o.toArray)for(;o=a[r],void 0!==o&&(t.push(a.time),o.toArray(n,n.length)),a=e[i++],void 0!==a;);else for(;o=a[r],void 0!==o&&(t.push(a.time),n.push(o)),a=e[i++],void 0!==a;);}}};function Kf(e,t,n,r){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=void 0!==r?r:new t.constructor(n),this.sampleValues=t,this.valueSize=n}function Qf(e,t,n,r){Kf.call(this,e,t,n,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0}function $f(e,t,n,r){Kf.call(this,e,t,n,r)}function ed(e,t,n,r){Kf.call(this,e,t,n,r)}function td(e,t,n,r){if(void 0===e)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===t||0===t.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=Jf.convertArray(t,this.TimeBufferType),this.values=Jf.convertArray(n,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}function nd(e,t,n){td.call(this,e,t,n)}function rd(e,t,n,r){td.call(this,e,t,n,r)}function id(e,t,n,r){td.call(this,e,t,n,r)}function ad(e,t,n,r){Kf.call(this,e,t,n,r)}function od(e,t,n,r){td.call(this,e,t,n,r)}function sd(e,t,n,r){td.call(this,e,t,n,r)}function ld(e,t,n,r){td.call(this,e,t,n,r)}function ud(e,t,n){this.name=e,this.tracks=n,this.duration=void 0!==t?t:-1,this.uuid=Cn.generateUUID(),this.duration<0&&this.resetDuration()}function cd(e){switch(e.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return id;case"vector":case"vector2":case"vector3":case"vector4":return ld;case"color":return rd;case"quaternion":return od;case"bool":case"boolean":return nd;case"string":return sd}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+e)}function hd(e){if(void 0===e.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");var t=cd(e.type);if(void 0===e.times){var n=[],r=[];Jf.flattenJSON(e.keys,n,r,"value"),e.times=n,e.values=r}return void 0!==t.parse?t.parse(e):new t(e.name,e.times,e.values,e.interpolation)}t.AnimationUtils=Jf,(0,p.default)(Kf.prototype,{evaluate:function(e){var t=this.parameterPositions,n=this._cachedIndex,r=t[n],i=t[n-1];e:{t:{var a;n:{r:if(!(e<r)){for(var o=n+2;;){if(void 0===r){if(e<i)break r;return n=t.length,this._cachedIndex=n,this.afterEnd_(n-1,e,i)}if(n===o)break;if(i=r,r=t[++n],e<r)break t}a=t.length;break n}if(i<=e)break e;var s=t[1];for(e<s&&(n=2,i=s),o=n-2;;){if(void 0===i)return this._cachedIndex=0,this.beforeStart_(0,e,r);if(n===o)break;if(r=i,i=t[--n-1],i<=e)break t}a=n,n=0}for(;n<a;){var l=n+a>>>1;e<t[l]?a=l:n=l+1}if(r=t[n],i=t[n-1],void 0===i)return this._cachedIndex=0,this.beforeStart_(0,e,r);if(void 0===r)return n=t.length,this._cachedIndex=n,this.afterEnd_(n-1,i,e)}this._cachedIndex=n,this.intervalChanged_(n,i,r)}return this.interpolate_(n,i,e,r)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings||this.DefaultSettings_},copySampleValue_:function(e){for(var t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,i=e*r,a=0;a!==r;++a)t[a]=n[i+a];return t},interpolate_:function(){throw new Error("call to abstract method")},intervalChanged_:function(){}}),(0,p.default)(Kf.prototype,{beforeStart_:Kf.prototype.copySampleValue_,afterEnd_:Kf.prototype.copySampleValue_}),Qf.prototype=(0,p.default)((0,l.default)(Kf.prototype),{constructor:Qf,DefaultSettings_:{endingStart:Ht,endingEnd:Ht},intervalChanged_:function(e,t,n){var r=this.parameterPositions,i=e-2,a=e+1,o=r[i],s=r[a];if(void 0===o)switch(this.getSettings_().endingStart){case Wt:i=e,o=2*t-n;break;case jt:i=r.length-2,o=t+r[i]-r[i+1];break;default:i=e,o=n}if(void 0===s)switch(this.getSettings_().endingEnd){case Wt:a=e,s=2*n-t;break;case jt:a=1,s=n+r[1]-r[0];break;default:a=e-1,s=t}var l=.5*(n-t),u=this.valueSize;this._weightPrev=l/(t-o),this._weightNext=l/(s-n),this._offsetPrev=i*u,this._offsetNext=a*u},interpolate_:function(e,t,n,r){for(var i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,l=s-o,u=this._offsetPrev,c=this._offsetNext,h=this._weightPrev,f=this._weightNext,d=(n-t)/(r-t),p=d*d,m=p*d,v=-h*m+2*h*p-h*d,g=(1+h)*m+(-1.5-2*h)*p+(-.5+h)*d+1,y=(-1-f)*m+(1.5+f)*p+.5*d,_=f*m-f*p,x=0;x!==o;++x)i[x]=v*a[u+x]+g*a[l+x]+y*a[s+x]+_*a[c+x];return i}}),$f.prototype=(0,p.default)((0,l.default)(Kf.prototype),{constructor:$f,interpolate_:function(e,t,n,r){for(var i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,l=s-o,u=(n-t)/(r-t),c=1-u,h=0;h!==o;++h)i[h]=a[l+h]*c+a[s+h]*u;return i}}),ed.prototype=(0,p.default)((0,l.default)(Kf.prototype),{constructor:ed,interpolate_:function(e){return this.copySampleValue_(e-1)}}),(0,p.default)(td,{toJSON:function(e){var t,n=e.constructor;if(void 0!==n.toJSON)t=n.toJSON(e);else{t={name:e.name,times:Jf.convertArray(e.times,Array),values:Jf.convertArray(e.values,Array)};var r=e.getInterpolation();r!==e.DefaultInterpolation&&(t.interpolation=r)}return t.type=e.ValueTypeName,t}}),(0,p.default)(td.prototype,{constructor:td,TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:zt,InterpolantFactoryMethodDiscrete:function(e){return new ed(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodLinear:function(e){return new $f(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:function(e){return new Qf(this.times,this.values,this.getValueSize(),e)},setInterpolation:function(e){var t;switch(e){case Gt:t=this.InterpolantFactoryMethodDiscrete;break;case zt:t=this.InterpolantFactoryMethodLinear;break;case Vt:t=this.InterpolantFactoryMethodSmooth}if(void 0!==t)return this.createInterpolant=t,this;var n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(e===this.DefaultInterpolation)throw new Error(n);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",n),this},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Gt;case this.InterpolantFactoryMethodLinear:return zt;case this.InterpolantFactoryMethodSmooth:return Vt}},getValueSize:function(){return this.values.length/this.times.length},shift:function(e){if(0!==e)for(var t=this.times,n=0,r=t.length;n!==r;++n)t[n]+=e;return this},scale:function(e){if(1!==e)for(var t=this.times,n=0,r=t.length;n!==r;++n)t[n]*=e;return this},trim:function(e,t){for(var n=this.times,r=n.length,i=0,a=r-1;i!==r&&n[i]<e;)++i;for(;-1!==a&&n[a]>t;)--a;if(++a,0!==i||a!==r){a<=i&&(a=Math.max(a,1),i=a-1);var o=this.getValueSize();this.times=Jf.arraySlice(n,i,a),this.values=Jf.arraySlice(this.values,i*o,a*o)}return this},validate:function(){var e=!0,t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);var n=this.times,r=this.values,i=n.length;0===i&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);for(var a=null,o=0;o!==i;o++){var s=n[o];if("number"==typeof s&&isNaN(s)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,o,s),e=!1;break}if(null!==a&&s<a){console.error("THREE.KeyframeTrack: Out of order keys.",this,o,s,a),e=!1;break}a=s}if(void 0!==r&&Jf.isTypedArray(r)){o=0;for(var l=r.length;o!==l;++o){var u=r[o];if(isNaN(u)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,o,u),e=!1;break}}}return e},optimize:function(){for(var e=this.times,t=this.values,n=this.getValueSize(),r=this.getInterpolation()===Vt,i=1,a=e.length-1,o=1;o<a;++o){var s=!1,l=e[o],u=e[o+1];if(l!==u&&(1!==o||l!==l[0]))if(r)s=!0;else for(var c=o*n,h=c-n,f=c+n,d=0;d!==n;++d){var p=t[c+d];if(p!==t[h+d]||p!==t[f+d]){s=!0;break}}if(s){if(o!==i){e[i]=e[o];var m=o*n,v=i*n;for(d=0;d!==n;++d)t[v+d]=t[m+d]}++i}}if(0<a){for(e[i]=e[a],m=a*n,v=i*n,d=0;d!==n;++d)t[v+d]=t[m+d];++i}return i!==e.length&&(this.times=Jf.arraySlice(e,0,i),this.values=Jf.arraySlice(t,0,i*n)),this},clone:function(){var e=Jf.arraySlice(this.times,0),t=Jf.arraySlice(this.values,0),n=this.constructor,r=new n(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}}),nd.prototype=(0,p.default)((0,l.default)(td.prototype),{constructor:nd,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:Gt,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),rd.prototype=(0,p.default)((0,l.default)(td.prototype),{constructor:rd,ValueTypeName:"color"}),id.prototype=(0,p.default)((0,l.default)(td.prototype),{constructor:id,ValueTypeName:"number"}),ad.prototype=(0,p.default)((0,l.default)(Kf.prototype),{constructor:ad,interpolate_:function(e,t,n,r){for(var i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,l=(n-t)/(r-t),u=s+o;s!==u;s+=4)kn.slerpFlat(i,0,a,s-o,a,s,l);return i}}),od.prototype=(0,p.default)((0,l.default)(td.prototype),{constructor:od,ValueTypeName:"quaternion",DefaultInterpolation:zt,InterpolantFactoryMethodLinear:function(e){return new ad(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:void 0}),sd.prototype=(0,p.default)((0,l.default)(td.prototype),{constructor:sd,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:Gt,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),ld.prototype=(0,p.default)((0,l.default)(td.prototype),{constructor:ld,ValueTypeName:"vector"}),(0,p.default)(ud,{parse:function(e){for(var t=[],n=e.tracks,r=1/(e.fps||1),i=0,a=n.length;i!==a;++i)t.push(hd(n[i]).scale(r));return new ud(e.name,e.duration,t)},toJSON:function(e){for(var t=[],n=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid},i=0,a=n.length;i!==a;++i)t.push(td.toJSON(n[i]));return r},CreateFromMorphTargetSequence:function(e,t,n,r){for(var i=t.length,a=[],o=0;o<i;o++){var s=[],l=[];s.push((o+i-1)%i,o,(o+1)%i),l.push(0,1,0);var u=Jf.getKeyframeOrder(s);s=Jf.sortedArray(s,1,u),l=Jf.sortedArray(l,1,u),r||0!==s[0]||(s.push(i),l.push(l[0])),a.push(new id(".morphTargetInfluences["+t[o].name+"]",s,l).scale(1/n))}return new ud(e,-1,a)},findByName:function(e,t){var n=e;if(!(0,Ue.default)(e)){var r=e;n=r.geometry&&r.geometry.animations||r.animations}for(var i=0;i<n.length;i++)if(n[i].name===t)return n[i];return null},CreateClipsFromMorphTargetSequences:function(e,t,n){for(var r={},i=/^([\w-]*?)([\d]+)$/,a=0,o=e.length;a<o;a++){var s=e[a],l=s.name.match(i);if(l&&1<l.length){var u=l[1],c=r[u];c||(r[u]=c=[]),c.push(s)}}var h=[];for(var u in r)h.push(ud.CreateFromMorphTargetSequence(u,r[u],t,n));return h},parseAnimation:function(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;for(var n=function(e,t,n,r,i){if(0!==n.length){var a=[],o=[];Jf.flattenJSON(n,a,o,r),0!==a.length&&i.push(new e(t,a,o))}},r=[],i=e.name||"default",a=e.length||-1,o=e.fps||30,s=e.hierarchy||[],l=0;l<s.length;l++){var u=s[l].keys;if(u&&0!==u.length)if(u[0].morphTargets){for(var c={},h=0;h<u.length;h++)if(u[h].morphTargets)for(var f=0;f<u[h].morphTargets.length;f++)c[u[h].morphTargets[f]]=-1;for(var d in c){var p=[],m=[];for(f=0;f!==u[h].morphTargets.length;++f){var v=u[h];p.push(v.time),m.push(v.morphTarget===d?1:0)}r.push(new id(".morphTargetInfluence["+d+"]",p,m))}a=c.length*(o||1)}else{var g=".bones["+t[l].name+"]";n(ld,g+".position",u,"pos",r),n(od,g+".quaternion",u,"rot",r),n(ld,g+".scale",u,"scl",r)}}if(0===r.length)return null;var y=new ud(i,a,r);return y}}),(0,p.default)(ud.prototype,{resetDuration:function(){for(var e=this.tracks,t=0,n=0,r=e.length;n!==r;++n){var i=this.tracks[n];t=Math.max(t,i.times[i.times.length-1])}return this.duration=t,this},trim:function(){for(var e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this},validate:function(){for(var e=!0,t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e},optimize:function(){for(var e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this},clone:function(){for(var e=[],t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new ud(this.name,this.duration,e)}});var fd={enabled:!1,files:{},add:function(e,t){!1!==this.enabled&&(this.files[e]=t)},get:function(e){if(!1!==this.enabled)return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}};function dd(e,t,n){var r=this,i=!1,a=0,o=0,s=void 0;this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(e){o++,!1===i&&void 0!==r.onStart&&r.onStart(e,a,o),i=!0},this.itemEnd=function(e){a++,void 0!==r.onProgress&&r.onProgress(e,a,o),a===o&&(i=!1,void 0!==r.onLoad&&r.onLoad())},this.itemError=function(e){void 0!==r.onError&&r.onError(e)},this.resolveURL=function(e){return s?s(e):e},this.setURLModifier=function(e){return s=e,this}}t.Cache=fd;var pd=new dd;t.DefaultLoadingManager=pd;var md={};function vd(e){this.manager=void 0!==e?e:pd}function gd(e){this.manager=void 0!==e?e:pd}function yd(e){this.manager=void 0!==e?e:pd,this._parser=null}function _d(e){this.manager=void 0!==e?e:pd,this._parser=null}function xd(e){this.manager=void 0!==e?e:pd}function wd(e){this.manager=void 0!==e?e:pd}function bd(e){this.manager=void 0!==e?e:pd}function Md(){this.type="Curve",this.arcLengthDivisions=200}function Sd(e,t,n,r,i,a,o,s){Md.call(this),this.type="EllipseCurve",this.aX=e||0,this.aY=t||0,this.xRadius=n||1,this.yRadius=r||1,this.aStartAngle=i||0,this.aEndAngle=a||2*Math.PI,this.aClockwise=o||!1,this.aRotation=s||0}function Ed(e,t,n,r,i,a){Sd.call(this,e,t,n,n,r,i,a),this.type="ArcCurve"}function Td(){var i=0,a=0,o=0,s=0;function u(e,t,n,r){i=e,a=n,o=-3*e+3*t-2*n-r,s=2*e-2*t+n+r}return{initCatmullRom:function(e,t,n,r,i){u(t,n,i*(n-e),i*(r-t))},initNonuniformCatmullRom:function(e,t,n,r,i,a,o){var s=(t-e)/i-(n-e)/(i+a)+(n-t)/a,l=(n-t)/a-(r-t)/(a+o)+(r-n)/o;s*=a,l*=a,u(t,n,s,l)},calc:function(e){var t=e*e,n=t*e;return i+a*e+o*t+s*n}}}(0,p.default)(vd.prototype,{load:function(o,e,t,n){void 0===o&&(o=""),void 0!==this.path&&(o=this.path+o),o=this.manager.resolveURL(o);var s=this,r=fd.get(o);if(void 0!==r)return s.manager.itemStart(o),setTimeout(function(){e&&e(r),s.manager.itemEnd(o)},0),r;if(void 0===md[o]){var i=/^data:(.*?)(;base64)?,(.*)$/,a=o.match(i);if(a){var l=a[1],u=!!a[2],c=a[3];c=decodeURIComponent(c),u&&(c=atob(c));try{var h,f=(this.responseType||"").toLowerCase();switch(f){case"arraybuffer":case"blob":for(var d=new Uint8Array(c.length),p=0;p<c.length;p++)d[p]=c.charCodeAt(p);h="blob"===f?new Blob([d.buffer],{type:l}):d.buffer;break;case"document":var m=new DOMParser;h=m.parseFromString(c,l);break;case"json":h=JSON.parse(c);break;default:h=c}setTimeout(function(){e&&e(h),s.manager.itemEnd(o)},0)}catch(e){setTimeout(function(){n&&n(e),s.manager.itemError(o),s.manager.itemEnd(o)},0)}}else{md[o]=[],md[o].push({onLoad:e,onProgress:t,onError:n});var v=new XMLHttpRequest;for(var g in v.open("GET",o,!0),v.addEventListener("load",function(e){var t=this.response;fd.add(o,t);var n=md[o];if(delete md[o],200===this.status||0===this.status){0===this.status&&console.warn("THREE.FileLoader: HTTP Status 0 received.");for(var r=0,i=n.length;r<i;r++){var a=n[r];a.onLoad&&a.onLoad(t)}s.manager.itemEnd(o)}else{for(r=0,i=n.length;r<i;r++)a=n[r],a.onError&&a.onError(e);s.manager.itemError(o),s.manager.itemEnd(o)}},!1),v.addEventListener("progress",function(e){for(var t=md[o],n=0,r=t.length;n<r;n++){var i=t[n];i.onProgress&&i.onProgress(e)}},!1),v.addEventListener("error",function(e){var t=md[o];delete md[o];for(var n=0,r=t.length;n<r;n++){var i=t[n];i.onError&&i.onError(e)}s.manager.itemError(o),s.manager.itemEnd(o)},!1),v.addEventListener("abort",function(e){var t=md[o];delete md[o];for(var n=0,r=t.length;n<r;n++){var i=t[n];i.onError&&i.onError(e)}s.manager.itemError(o),s.manager.itemEnd(o)},!1),void 0!==this.responseType&&(v.responseType=this.responseType),void 0!==this.withCredentials&&(v.withCredentials=this.withCredentials),v.overrideMimeType&&v.overrideMimeType(void 0!==this.mimeType?this.mimeType:"text/plain"),this.requestHeader)v.setRequestHeader(g,this.requestHeader[g]);v.send(null)}return s.manager.itemStart(o),v}md[o].push({onLoad:e,onProgress:t,onError:n})},setPath:function(e){return this.path=e,this},setResponseType:function(e){return this.responseType=e,this},setWithCredentials:function(e){return this.withCredentials=e,this},setMimeType:function(e){return this.mimeType=e,this},setRequestHeader:function(e){return this.requestHeader=e,this}}),(0,p.default)(gd.prototype,{load:function(e,t,n,r){var i=this,a=new vd(i.manager);a.setPath(i.path),a.load(e,function(e){t(i.parse(JSON.parse(e)))},n,r)},parse:function(e){for(var t=[],n=0;n<e.length;n++){var r=ud.parse(e[n]);t.push(r)}return t},setPath:function(e){return this.path=e,this}}),(0,p.default)(yd.prototype,{load:function(e,a,t,r){var o=this,s=[],l=new mh;l.image=s;var i=new vd(this.manager);function n(n){i.load(e[n],function(e){var t=o._parser(e,!0);s[n]={width:t.width,height:t.height,format:t.format,mipmaps:t.mipmaps},u+=1,6===u&&(1===t.mipmapCount&&(l.minFilter=Ve),l.format=t.format,l.needsUpdate=!0,a&&a(l))},t,r)}if(i.setPath(this.path),i.setResponseType("arraybuffer"),(0,Ue.default)(e))for(var u=0,c=0,h=e.length;c<h;++c)n(c);else i.load(e,function(e){var t=o._parser(e,!0);if(t.isCubemap)for(var n=t.mipmaps.length/t.mipmapCount,r=0;r<n;r++){s[r]={mipmaps:[]};for(var i=0;i<t.mipmapCount;i++)s[r].mipmaps.push(t.mipmaps[r*t.mipmapCount+i]),s[r].format=t.format,s[r].width=t.width,s[r].height=t.height}else l.image.width=t.width,l.image.height=t.height,l.mipmaps=t.mipmaps;1===t.mipmapCount&&(l.minFilter=Ve),l.format=t.format,l.needsUpdate=!0,a&&a(l)},t,r);return l},setPath:function(e){return this.path=e,this}}),(0,p.default)(_d.prototype,{load:function(e,n,t,r){var i=this,a=new ro,o=new vd(this.manager);return o.setResponseType("arraybuffer"),o.setPath(this.path),o.load(e,function(e){var t=i._parser(e);t&&(void 0!==t.image?a.image=t.image:void 0!==t.data&&(a.image.width=t.width,a.image.height=t.height,a.image.data=t.data),a.wrapS=void 0!==t.wrapS?t.wrapS:ke,a.wrapT=void 0!==t.wrapT?t.wrapT:ke,a.magFilter=void 0!==t.magFilter?t.magFilter:Ve,a.minFilter=void 0!==t.minFilter?t.minFilter:je,a.anisotropy=void 0!==t.anisotropy?t.anisotropy:1,void 0!==t.format&&(a.format=t.format),void 0!==t.type&&(a.type=t.type),void 0!==t.mipmaps&&(a.mipmaps=t.mipmaps),1===t.mipmapCount&&(a.minFilter=Ve),a.needsUpdate=!0,n&&n(a,t))},t,r),a},setPath:function(e){return this.path=e,this}}),(0,p.default)(xd.prototype,{crossOrigin:"anonymous",load:function(t,e,n,r){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);var i=this,a=fd.get(t);if(void 0!==a)return i.manager.itemStart(t),setTimeout(function(){e&&e(a),i.manager.itemEnd(t)},0),a;var o=document.createElementNS("http://www.w3.org/1999/xhtml","img");function s(){o.removeEventListener("load",s,!1),o.removeEventListener("error",l,!1),fd.add(t,this),e&&e(this),i.manager.itemEnd(t)}function l(e){o.removeEventListener("load",s,!1),o.removeEventListener("error",l,!1),r&&r(e),i.manager.itemError(t),i.manager.itemEnd(t)}return o.addEventListener("load",s,!1),o.addEventListener("error",l,!1),"data:"!==t.substr(0,5)&&void 0!==this.crossOrigin&&(o.crossOrigin=this.crossOrigin),i.manager.itemStart(t),o.src=t,o},setCrossOrigin:function(e){return this.crossOrigin=e,this},setPath:function(e){return this.path=e,this}}),(0,p.default)(wd.prototype,{crossOrigin:"anonymous",load:function(e,n,t,r){var i=new Ol,a=new xd(this.manager);a.setCrossOrigin(this.crossOrigin),a.setPath(this.path);var o=0;function s(t){a.load(e[t],function(e){i.images[t]=e,o++,6===o&&(i.needsUpdate=!0,n&&n(i))},void 0,r)}for(var l=0;l<e.length;++l)s(l);return i},setCrossOrigin:function(e){return this.crossOrigin=e,this},setPath:function(e){return this.path=e,this}}),(0,p.default)(bd.prototype,{crossOrigin:"anonymous",load:function(n,r,e,t){var i=new Xn,a=new xd(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(n,function(e){i.image=e;var t=0<n.search(/\.jpe?g($|\?)/i)||0===n.search(/^data\:image\/jpeg/);i.format=t?ot:st,i.needsUpdate=!0,void 0!==r&&r(i)},e,t),i},setCrossOrigin:function(e){return this.crossOrigin=e,this},setPath:function(e){return this.path=e,this}}),(0,p.default)(Md.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(e,t){var n=this.getUtoTmapping(e);return this.getPoint(n,t)},getPoints:function(e){void 0===e&&(e=5);for(var t=[],n=0;n<=e;n++)t.push(this.getPoint(n/e));return t},getSpacedPoints:function(e){void 0===e&&(e=5);for(var t=[],n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t},getLength:function(){var e=this.getLengths();return e[e.length-1]},getLengths:function(e){if(void 0===e&&(e=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var t,n,r=[],i=this.getPoint(0),a=0;for(r.push(0),n=1;n<=e;n++)t=this.getPoint(n/e),a+=t.distanceTo(i),r.push(a),i=t;return this.cacheArcLengths=r,r},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(e,t){var n,r=this.getLengths(),i=0,a=r.length;n=t||e*r[a-1];for(var o,s=0,l=a-1;s<=l;)if(i=Math.floor(s+(l-s)/2),o=r[i]-n,o<0)s=i+1;else{if(!(0<o)){l=i;break}l=i-1}if(i=l,r[i]===n)return i/(a-1);var u=r[i],c=r[i+1],h=c-u,f=(n-u)/h,d=(i+f)/(a-1);return d},getTangent:function(e){var t=1e-4,n=e-t,r=e+t;n<0&&(n=0),1<r&&(r=1);var i=this.getPoint(n),a=this.getPoint(r),o=a.clone().sub(i);return o.normalize()},getTangentAt:function(e){var t=this.getUtoTmapping(e);return this.getTangent(t)},computeFrenetFrames:function(e,t){var n,r,i,a=new Pn,o=[],s=[],l=[],u=new Pn,c=new Qn;for(n=0;n<=e;n++)r=n/e,o[n]=this.getTangentAt(r),o[n].normalize();s[0]=new Pn,l[0]=new Pn;var h=Number.MAX_VALUE,f=Math.abs(o[0].x),d=Math.abs(o[0].y),p=Math.abs(o[0].z);for(f<=h&&(h=f,a.set(1,0,0)),d<=h&&(h=d,a.set(0,1,0)),p<=h&&a.set(0,0,1),u.crossVectors(o[0],a).normalize(),s[0].crossVectors(o[0],u),l[0].crossVectors(o[0],s[0]),n=1;n<=e;n++)s[n]=s[n-1].clone(),l[n]=l[n-1].clone(),u.crossVectors(o[n-1],o[n]),u.length()>ie.default&&(u.normalize(),i=Math.acos(Cn.clamp(o[n-1].dot(o[n]),-1,1)),s[n].applyMatrix4(c.makeRotationAxis(u,i))),l[n].crossVectors(o[n],s[n]);if(!0===t)for(i=Math.acos(Cn.clamp(s[0].dot(s[e]),-1,1)),i/=e,0<o[0].dot(u.crossVectors(s[0],s[e]))&&(i=-i),n=1;n<=e;n++)s[n].applyMatrix4(c.makeRotationAxis(o[n],i*n)),l[n].crossVectors(o[n],s[n]);return{tangents:o,normals:s,binormals:l}},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this},toJSON:function(){var e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e},fromJSON:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}),Sd.prototype=(0,l.default)(Md.prototype),Sd.prototype.constructor=Sd,Sd.prototype.isEllipseCurve=!0,Sd.prototype.getPoint=function(e,t){for(var n=t||new In,r=2*Math.PI,i=this.aEndAngle-this.aStartAngle,a=Math.abs(i)<ie.default;i<0;)i+=r;for(;r<i;)i-=r;i<ie.default&&(i=a?0:r),!0!==this.aClockwise||a||(i===r?i=-r:i-=r);var o=this.aStartAngle+e*i,s=this.aX+this.xRadius*Math.cos(o),l=this.aY+this.yRadius*Math.sin(o);if(0!==this.aRotation){var u=Math.cos(this.aRotation),c=Math.sin(this.aRotation),h=s-this.aX,f=l-this.aY;s=h*u-f*c+this.aX,l=h*c+f*u+this.aY}return n.set(s,l)},Sd.prototype.copy=function(e){return Md.prototype.copy.call(this,e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this},Sd.prototype.toJSON=function(){var e=Md.prototype.toJSON.call(this);return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e},Sd.prototype.fromJSON=function(e){return Md.prototype.fromJSON.call(this,e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this},Ed.prototype=(0,l.default)(Sd.prototype),Ed.prototype.constructor=Ed,Ed.prototype.isArcCurve=!0;var Ad=new Pn,Ld=new Td,Rd=new Td,Cd=new Td;function Id(e,t,n,r){Md.call(this),this.type="CatmullRomCurve3",this.points=e||[],this.closed=t||!1,this.curveType=n||"centripetal",this.tension=r||.5}function kd(e,t,n,r,i){var a=.5*(r-t),o=.5*(i-n),s=e*e,l=e*s;return(2*n-2*r+a+o)*l+(-3*n+3*r-2*a-o)*s+a*e+n}function Pd(e,t){var n=1-e;return n*n*t}function Nd(e,t){return 2*(1-e)*e*t}function Dd(e,t){return e*e*t}function Od(e,t,n,r){return Pd(e,t)+Nd(e,n)+Dd(e,r)}function Fd(e,t){var n=1-e;return n*n*n*t}function Bd(e,t){var n=1-e;return 3*n*n*e*t}function Ud(e,t){return 3*(1-e)*e*e*t}function Gd(e,t){return e*e*e*t}function zd(e,t,n,r,i){return Fd(e,t)+Bd(e,n)+Ud(e,r)+Gd(e,i)}function Vd(e,t,n,r){Md.call(this),this.type="CubicBezierCurve",this.v0=e||new In,this.v1=t||new In,this.v2=n||new In,this.v3=r||new In}function Hd(e,t,n,r){Md.call(this),this.type="CubicBezierCurve3",this.v0=e||new Pn,this.v1=t||new Pn,this.v2=n||new Pn,this.v3=r||new Pn}function Wd(e,t){Md.call(this),this.type="LineCurve",this.v1=e||new In,this.v2=t||new In}function jd(e,t){Md.call(this),this.type="LineCurve3",this.v1=e||new Pn,this.v2=t||new Pn}function Yd(e,t,n){Md.call(this),this.type="QuadraticBezierCurve",this.v0=e||new In,this.v1=t||new In,this.v2=n||new In}function qd(e,t,n){Md.call(this),this.type="QuadraticBezierCurve3",this.v0=e||new Pn,this.v1=t||new Pn,this.v2=n||new Pn}function Xd(e){Md.call(this),this.type="SplineCurve",this.points=e||[]}Id.prototype=(0,l.default)(Md.prototype),Id.prototype.constructor=Id,Id.prototype.isCatmullRomCurve3=!0,Id.prototype.getPoint=function(e,t){var n,r,i,a,o=t||new Pn,s=this.points,l=s.length,u=(l-(this.closed?0:1))*e,c=Math.floor(u),h=u-c;if(this.closed?c+=0<c?0:(Math.floor(Math.abs(c)/l)+1)*l:0===h&&c===l-1&&(c=l-2,h=1),n=this.closed||0<c?s[(c-1)%l]:(Ad.subVectors(s[0],s[1]).add(s[0]),Ad),r=s[c%l],i=s[(c+1)%l],a=this.closed||c+2<l?s[(c+2)%l]:(Ad.subVectors(s[l-1],s[l-2]).add(s[l-1]),Ad),"centripetal"===this.curveType||"chordal"===this.curveType){var f="chordal"===this.curveType?.5:.25,d=Math.pow(n.distanceToSquared(r),f),p=Math.pow(r.distanceToSquared(i),f),m=Math.pow(i.distanceToSquared(a),f);p<1e-4&&(p=1),d<1e-4&&(d=p),m<1e-4&&(m=p),Ld.initNonuniformCatmullRom(n.x,r.x,i.x,a.x,d,p,m),Rd.initNonuniformCatmullRom(n.y,r.y,i.y,a.y,d,p,m),Cd.initNonuniformCatmullRom(n.z,r.z,i.z,a.z,d,p,m)}else"catmullrom"===this.curveType&&(Ld.initCatmullRom(n.x,r.x,i.x,a.x,this.tension),Rd.initCatmullRom(n.y,r.y,i.y,a.y,this.tension),Cd.initCatmullRom(n.z,r.z,i.z,a.z,this.tension));return o.set(Ld.calc(h),Rd.calc(h),Cd.calc(h)),o},Id.prototype.copy=function(e){Md.prototype.copy.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var r=e.points[t];this.points.push(r.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this},Id.prototype.toJSON=function(){var e=Md.prototype.toJSON.call(this);e.points=[];for(var t=0,n=this.points.length;t<n;t++){var r=this.points[t];e.points.push(r.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e},Id.prototype.fromJSON=function(e){Md.prototype.fromJSON.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var r=e.points[t];this.points.push((new Pn).fromArray(r))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this},Vd.prototype=(0,l.default)(Md.prototype),Vd.prototype.constructor=Vd,Vd.prototype.isCubicBezierCurve=!0,Vd.prototype.getPoint=function(e,t){var n=t||new In,r=this.v0,i=this.v1,a=this.v2,o=this.v3;return n.set(zd(e,r.x,i.x,a.x,o.x),zd(e,r.y,i.y,a.y,o.y)),n},Vd.prototype.copy=function(e){return Md.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this},Vd.prototype.toJSON=function(){var e=Md.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e},Vd.prototype.fromJSON=function(e){return Md.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this},Hd.prototype=(0,l.default)(Md.prototype),Hd.prototype.constructor=Hd,Hd.prototype.isCubicBezierCurve3=!0,Hd.prototype.getPoint=function(e,t){var n=t||new Pn,r=this.v0,i=this.v1,a=this.v2,o=this.v3;return n.set(zd(e,r.x,i.x,a.x,o.x),zd(e,r.y,i.y,a.y,o.y),zd(e,r.z,i.z,a.z,o.z)),n},Hd.prototype.copy=function(e){return Md.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this},Hd.prototype.toJSON=function(){var e=Md.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e},Hd.prototype.fromJSON=function(e){return Md.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this},Wd.prototype=(0,l.default)(Md.prototype),Wd.prototype.constructor=Wd,Wd.prototype.isLineCurve=!0,Wd.prototype.getPoint=function(e,t){var n=t||new In;return 1===e?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n},Wd.prototype.getPointAt=function(e,t){return this.getPoint(e,t)},Wd.prototype.getTangent=function(){var e=this.v2.clone().sub(this.v1);return e.normalize()},Wd.prototype.copy=function(e){return Md.prototype.copy.call(this,e),this.v1.copy(e.v1),this.v2.copy(e.v2),this},Wd.prototype.toJSON=function(){var e=Md.prototype.toJSON.call(this);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},Wd.prototype.fromJSON=function(e){return Md.prototype.fromJSON.call(this,e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},jd.prototype=(0,l.default)(Md.prototype),jd.prototype.constructor=jd,jd.prototype.isLineCurve3=!0,jd.prototype.getPoint=function(e,t){var n=t||new Pn;return 1===e?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n},jd.prototype.getPointAt=function(e,t){return this.getPoint(e,t)},jd.prototype.copy=function(e){return Md.prototype.copy.call(this,e),this.v1.copy(e.v1),this.v2.copy(e.v2),this},jd.prototype.toJSON=function(){var e=Md.prototype.toJSON.call(this);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},jd.prototype.fromJSON=function(e){return Md.prototype.fromJSON.call(this,e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},Yd.prototype=(0,l.default)(Md.prototype),Yd.prototype.constructor=Yd,Yd.prototype.isQuadraticBezierCurve=!0,Yd.prototype.getPoint=function(e,t){var n=t||new In,r=this.v0,i=this.v1,a=this.v2;return n.set(Od(e,r.x,i.x,a.x),Od(e,r.y,i.y,a.y)),n},Yd.prototype.copy=function(e){return Md.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this},Yd.prototype.toJSON=function(){var e=Md.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},Yd.prototype.fromJSON=function(e){return Md.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},qd.prototype=(0,l.default)(Md.prototype),qd.prototype.constructor=qd,qd.prototype.isQuadraticBezierCurve3=!0,qd.prototype.getPoint=function(e,t){var n=t||new Pn,r=this.v0,i=this.v1,a=this.v2;return n.set(Od(e,r.x,i.x,a.x),Od(e,r.y,i.y,a.y),Od(e,r.z,i.z,a.z)),n},qd.prototype.copy=function(e){return Md.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this},qd.prototype.toJSON=function(){var e=Md.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},qd.prototype.fromJSON=function(e){return Md.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},Xd.prototype=(0,l.default)(Md.prototype),Xd.prototype.constructor=Xd,Xd.prototype.isSplineCurve=!0,Xd.prototype.getPoint=function(e,t){var n=t||new In,r=this.points,i=(r.length-1)*e,a=Math.floor(i),o=i-a,s=r[0===a?a:a-1],l=r[a],u=r[a>r.length-2?r.length-1:a+1],c=r[a>r.length-3?r.length-1:a+2];return n.set(kd(o,s.x,l.x,u.x,c.x),kd(o,s.y,l.y,u.y,c.y)),n},Xd.prototype.copy=function(e){Md.prototype.copy.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var r=e.points[t];this.points.push(r.clone())}return this},Xd.prototype.toJSON=function(){var e=Md.prototype.toJSON.call(this);e.points=[];for(var t=0,n=this.points.length;t<n;t++){var r=this.points[t];e.points.push(r.toArray())}return e},Xd.prototype.fromJSON=function(e){Md.prototype.fromJSON.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var r=e.points[t];this.points.push((new In).fromArray(r))}return this};var Zd=(0,a.default)({ArcCurve:Ed,CatmullRomCurve3:Id,CubicBezierCurve:Vd,CubicBezierCurve3:Hd,EllipseCurve:Sd,LineCurve:Wd,LineCurve3:jd,QuadraticBezierCurve:Yd,QuadraticBezierCurve3:qd,SplineCurve:Xd});function Jd(){Md.call(this),this.type="CurvePath",this.curves=[],this.autoClose=!1}function Kd(e){Jd.call(this),this.type="Path",this.currentPoint=new In,e&&this.setFromPoints(e)}function Qd(e){Kd.call(this,e),this.uuid=Cn.generateUUID(),this.type="Shape",this.holes=[]}function $d(e,t){pi.call(this),this.type="Light",this.color=new Ti(e),this.intensity=void 0!==t?t:1,this.receiveShadow=void 0}function ep(e,t,n){$d.call(this,e,n),this.type="HemisphereLight",this.castShadow=void 0,this.position.copy(pi.DefaultUp),this.updateMatrix(),this.groundColor=new Ti(t)}function tp(e){this.camera=e,this.bias=0,this.radius=1,this.mapSize=new In(512,512),this.map=null,this.matrix=new Qn}function np(){tp.call(this,new Wa(50,1,.5,500))}function rp(e,t,n,r,i,a){$d.call(this,e,t),this.type="SpotLight",this.position.copy(pi.DefaultUp),this.updateMatrix(),this.target=new pi,(0,g.default)(this,"power",{get:function(){return this.intensity*Math.PI},set:function(e){this.intensity=e/Math.PI}}),this.distance=void 0!==n?n:0,this.angle=void 0!==r?r:Math.PI/3,this.penumbra=void 0!==i?i:0,this.decay=void 0!==a?a:1,this.shadow=new np}function ip(e,t,n,r){$d.call(this,e,t),this.type="PointLight",(0,g.default)(this,"power",{get:function(){return 4*this.intensity*Math.PI},set:function(e){this.intensity=e/(4*Math.PI)}}),this.distance=void 0!==n?n:0,this.decay=void 0!==r?r:1,this.shadow=new tp(new Wa(90,1,.5,500))}function ap(e,t,n,r,i,a){Ha.call(this),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=void 0!==e?e:-1,this.right=void 0!==t?t:1,this.top=void 0!==n?n:1,this.bottom=void 0!==r?r:-1,this.near=void 0!==i?i:.1,this.far=void 0!==a?a:2e3,this.updateProjectionMatrix()}function op(){tp.call(this,new ap(-5,5,5,-5,.5,500))}function sp(e,t){$d.call(this,e,t),this.type="DirectionalLight",this.position.copy(pi.DefaultUp),this.updateMatrix(),this.target=new pi,this.shadow=new op}function lp(e,t){$d.call(this,e,t),this.type="AmbientLight",this.castShadow=void 0}function up(e,t,n,r){$d.call(this,e,t),this.type="RectAreaLight",this.width=void 0!==n?n:10,this.height=void 0!==r?r:10}function cp(e){this.manager=void 0!==e?e:pd,this.textures={}}Jd.prototype=(0,p.default)((0,l.default)(Md.prototype),{constructor:Jd,add:function(e){this.curves.push(e)},closePath:function(){var e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new Wd(t,e))},getPoint:function(e){for(var t=e*this.getLength(),n=this.getCurveLengths(),r=0;r<n.length;){if(n[r]>=t){var i=n[r]-t,a=this.curves[r],o=a.getLength(),s=0===o?0:1-i/o;return a.getPointAt(s)}r++}return null},getLength:function(){var e=this.getCurveLengths();return e[e.length-1]},updateArcLengths:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var e=[],t=0,n=0,r=this.curves.length;n<r;n++)t+=this.curves[n].getLength(),e.push(t);return this.cacheLengths=e,e},getSpacedPoints:function(e){void 0===e&&(e=40);for(var t=[],n=0;n<=e;n++)t.push(this.getPoint(n/e));return this.autoClose&&t.push(t[0]),t},getPoints:function(e){e=e||12;for(var t,n=[],r=0,i=this.curves;r<i.length;r++)for(var a=i[r],o=a&&a.isEllipseCurve?2*e:a&&(a.isLineCurve||a.isLineCurve3)?1:a&&a.isSplineCurve?e*a.points.length:e,s=a.getPoints(o),l=0;l<s.length;l++){var u=s[l];t&&t.equals(u)||(n.push(u),t=u)}return this.autoClose&&1<n.length&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n},copy:function(e){Md.prototype.copy.call(this,e),this.curves=[];for(var t=0,n=e.curves.length;t<n;t++){var r=e.curves[t];this.curves.push(r.clone())}return this.autoClose=e.autoClose,this},toJSON:function(){var e=Md.prototype.toJSON.call(this);e.autoClose=this.autoClose,e.curves=[];for(var t=0,n=this.curves.length;t<n;t++){var r=this.curves[t];e.curves.push(r.toJSON())}return e},fromJSON:function(e){Md.prototype.fromJSON.call(this,e),this.autoClose=e.autoClose,this.curves=[];for(var t=0,n=e.curves.length;t<n;t++){var r=e.curves[t];this.curves.push((new Zd[r.type]).fromJSON(r))}return this}}),Kd.prototype=(0,p.default)((0,l.default)(Jd.prototype),{constructor:Kd,setFromPoints:function(e){this.moveTo(e[0].x,e[0].y);for(var t=1,n=e.length;t<n;t++)this.lineTo(e[t].x,e[t].y)},moveTo:function(e,t){this.currentPoint.set(e,t)},lineTo:function(e,t){var n=new Wd(this.currentPoint.clone(),new In(e,t));this.curves.push(n),this.currentPoint.set(e,t)},quadraticCurveTo:function(e,t,n,r){var i=new Yd(this.currentPoint.clone(),new In(e,t),new In(n,r));this.curves.push(i),this.currentPoint.set(n,r)},bezierCurveTo:function(e,t,n,r,i,a){var o=new Vd(this.currentPoint.clone(),new In(e,t),new In(n,r),new In(i,a));this.curves.push(o),this.currentPoint.set(i,a)},splineThru:function(e){var t=[this.currentPoint.clone()].concat(e),n=new Xd(t);this.curves.push(n),this.currentPoint.copy(e[e.length-1])},arc:function(e,t,n,r,i,a){var o=this.currentPoint.x,s=this.currentPoint.y;this.absarc(e+o,t+s,n,r,i,a)},absarc:function(e,t,n,r,i,a){this.absellipse(e,t,n,n,r,i,a)},ellipse:function(e,t,n,r,i,a,o,s){var l=this.currentPoint.x,u=this.currentPoint.y;this.absellipse(e+l,t+u,n,r,i,a,o,s)},absellipse:function(e,t,n,r,i,a,o,s){var l=new Sd(e,t,n,r,i,a,o,s);if(0<this.curves.length){var u=l.getPoint(0);u.equals(this.currentPoint)||this.lineTo(u.x,u.y)}this.curves.push(l);var c=l.getPoint(1);this.currentPoint.copy(c)},copy:function(e){return Jd.prototype.copy.call(this,e),this.currentPoint.copy(e.currentPoint),this},toJSON:function(){var e=Jd.prototype.toJSON.call(this);return e.currentPoint=this.currentPoint.toArray(),e},fromJSON:function(e){return Jd.prototype.fromJSON.call(this,e),this.currentPoint.fromArray(e.currentPoint),this}}),Qd.prototype=(0,p.default)((0,l.default)(Kd.prototype),{constructor:Qd,getPointsHoles:function(e){for(var t=[],n=0,r=this.holes.length;n<r;n++)t[n]=this.holes[n].getPoints(e);return t},extractPoints:function(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}},copy:function(e){Kd.prototype.copy.call(this,e),this.holes=[];for(var t=0,n=e.holes.length;t<n;t++){var r=e.holes[t];this.holes.push(r.clone())}return this},toJSON:function(){var e=Kd.prototype.toJSON.call(this);e.uuid=this.uuid,e.holes=[];for(var t=0,n=this.holes.length;t<n;t++){var r=this.holes[t];e.holes.push(r.toJSON())}return e},fromJSON:function(e){Kd.prototype.fromJSON.call(this,e),this.uuid=e.uuid,this.holes=[];for(var t=0,n=e.holes.length;t<n;t++){var r=e.holes[t];this.holes.push((new Kd).fromJSON(r))}return this}}),$d.prototype=(0,p.default)((0,l.default)(pi.prototype),{constructor:$d,isLight:!0,copy:function(e){return pi.prototype.copy.call(this,e),this.color.copy(e.color),this.intensity=e.intensity,this},toJSON:function(e){var t=pi.prototype.toJSON.call(this,e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,void 0!==this.groundColor&&(t.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(t.object.distance=this.distance),void 0!==this.angle&&(t.object.angle=this.angle),void 0!==this.decay&&(t.object.decay=this.decay),void 0!==this.penumbra&&(t.object.penumbra=this.penumbra),void 0!==this.shadow&&(t.object.shadow=this.shadow.toJSON()),t}}),ep.prototype=(0,p.default)((0,l.default)($d.prototype),{constructor:ep,isHemisphereLight:!0,copy:function(e){return $d.prototype.copy.call(this,e),this.groundColor.copy(e.groundColor),this}}),(0,p.default)(tp.prototype,{copy:function(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var e={};return 0!==this.bias&&(e.bias=this.bias),1!==this.radius&&(e.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}),np.prototype=(0,p.default)((0,l.default)(tp.prototype),{constructor:np,isSpotLightShadow:!0,update:function(e){var t=this.camera,n=2*Cn.RAD2DEG*e.angle,r=this.mapSize.width/this.mapSize.height,i=e.distance||t.far;n===t.fov&&r===t.aspect&&i===t.far||(t.fov=n,t.aspect=r,t.far=i,t.updateProjectionMatrix())}}),rp.prototype=(0,p.default)((0,l.default)($d.prototype),{constructor:rp,isSpotLight:!0,copy:function(e){return $d.prototype.copy.call(this,e),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}),ip.prototype=(0,p.default)((0,l.default)($d.prototype),{constructor:ip,isPointLight:!0,copy:function(e){return $d.prototype.copy.call(this,e),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}),ap.prototype=(0,p.default)((0,l.default)(Ha.prototype),{constructor:ap,isOrthographicCamera:!0,copy:function(e,t){return Ha.prototype.copy.call(this,e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=null===e.view?null:(0,p.default)({},e.view),this},setViewOffset:function(e,t,n,r,i,a){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,r=(this.top+this.bottom)/2,i=n-e,a=n+e,o=r+t,s=r-t;if(null!==this.view&&this.view.enabled){var l=this.zoom/(this.view.width/this.view.fullWidth),u=this.zoom/(this.view.height/this.view.fullHeight),c=(this.right-this.left)/this.view.width,h=(this.top-this.bottom)/this.view.height;i+=c*(this.view.offsetX/l),a=i+c*(this.view.width/l),o-=h*(this.view.offsetY/u),s=o-h*(this.view.height/u)}this.projectionMatrix.makeOrthographic(i,a,o,s,this.near,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(e){var t=pi.prototype.toJSON.call(this,e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,null!==this.view&&(t.object.view=(0,p.default)({},this.view)),t}}),op.prototype=(0,p.default)((0,l.default)(tp.prototype),{constructor:op}),sp.prototype=(0,p.default)((0,l.default)($d.prototype),{constructor:sp,isDirectionalLight:!0,copy:function(e){return $d.prototype.copy.call(this,e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}),lp.prototype=(0,p.default)((0,l.default)($d.prototype),{constructor:lp,isAmbientLight:!0}),up.prototype=(0,p.default)((0,l.default)($d.prototype),{constructor:up,isRectAreaLight:!0,copy:function(e){return $d.prototype.copy.call(this,e),this.width=e.width,this.height=e.height,this},toJSON:function(e){var t=$d.prototype.toJSON.call(this,e);return t.object.width=this.width,t.object.height=this.height,t}}),(0,p.default)(cp.prototype,{load:function(e,t,n,r){var i=this,a=new vd(i.manager);a.setPath(i.path),a.load(e,function(e){t(i.parse(JSON.parse(e)))},n,r)},parse:function(e){var t=this.textures;function n(e){return void 0===t[e]&&console.warn("THREE.MaterialLoader: Undefined texture",e),t[e]}var r=new Zf[e.type];if(void 0!==e.uuid&&(r.uuid=e.uuid),void 0!==e.name&&(r.name=e.name),void 0!==e.color&&r.color.setHex(e.color),void 0!==e.roughness&&(r.roughness=e.roughness),void 0!==e.metalness&&(r.metalness=e.metalness),void 0!==e.emissive&&r.emissive.setHex(e.emissive),void 0!==e.specular&&r.specular.setHex(e.specular),void 0!==e.shininess&&(r.shininess=e.shininess),void 0!==e.clearCoat&&(r.clearCoat=e.clearCoat),void 0!==e.clearCoatRoughness&&(r.clearCoatRoughness=e.clearCoatRoughness),void 0!==e.vertexColors&&(r.vertexColors=e.vertexColors),void 0!==e.fog&&(r.fog=e.fog),void 0!==e.flatShading&&(r.flatShading=e.flatShading),void 0!==e.blending&&(r.blending=e.blending),void 0!==e.combine&&(r.combine=e.combine),void 0!==e.side&&(r.side=e.side),void 0!==e.opacity&&(r.opacity=e.opacity),void 0!==e.transparent&&(r.transparent=e.transparent),void 0!==e.alphaTest&&(r.alphaTest=e.alphaTest),void 0!==e.depthTest&&(r.depthTest=e.depthTest),void 0!==e.depthWrite&&(r.depthWrite=e.depthWrite),void 0!==e.colorWrite&&(r.colorWrite=e.colorWrite),void 0!==e.wireframe&&(r.wireframe=e.wireframe),void 0!==e.wireframeLinewidth&&(r.wireframeLinewidth=e.wireframeLinewidth),void 0!==e.wireframeLinecap&&(r.wireframeLinecap=e.wireframeLinecap),void 0!==e.wireframeLinejoin&&(r.wireframeLinejoin=e.wireframeLinejoin),void 0!==e.rotation&&(r.rotation=e.rotation),1!==e.linewidth&&(r.linewidth=e.linewidth),void 0!==e.dashSize&&(r.dashSize=e.dashSize),void 0!==e.gapSize&&(r.gapSize=e.gapSize),void 0!==e.scale&&(r.scale=e.scale),void 0!==e.polygonOffset&&(r.polygonOffset=e.polygonOffset),void 0!==e.polygonOffsetFactor&&(r.polygonOffsetFactor=e.polygonOffsetFactor),void 0!==e.polygonOffsetUnits&&(r.polygonOffsetUnits=e.polygonOffsetUnits),void 0!==e.skinning&&(r.skinning=e.skinning),void 0!==e.morphTargets&&(r.morphTargets=e.morphTargets),void 0!==e.morphNormals&&(r.morphNormals=e.morphNormals),void 0!==e.dithering&&(r.dithering=e.dithering),void 0!==e.visible&&(r.visible=e.visible),void 0!==e.userData&&(r.userData=e.userData),void 0!==e.uniforms)for(var i in e.uniforms){var a=e.uniforms[i];switch(r.uniforms[i]={},a.type){case"t":r.uniforms[i].value=n(a.value);break;case"c":r.uniforms[i].value=(new Ti).setHex(a.value);break;case"v2":r.uniforms[i].value=(new In).fromArray(a.value);break;case"v3":r.uniforms[i].value=(new Pn).fromArray(a.value);break;case"v4":r.uniforms[i].value=(new Zn).fromArray(a.value);break;case"m3":r.uniforms[i].value=(new Nn).fromArray(a.value);case"m4":r.uniforms[i].value=(new Qn).fromArray(a.value);break;default:r.uniforms[i].value=a.value}}if(void 0!==e.defines&&(r.defines=e.defines),void 0!==e.vertexShader&&(r.vertexShader=e.vertexShader),void 0!==e.fragmentShader&&(r.fragmentShader=e.fragmentShader),void 0!==e.extensions)for(var o in e.extensions)r.extensions[o]=e.extensions[o];if(void 0!==e.shading&&(r.flatShading=1===e.shading),void 0!==e.size&&(r.size=e.size),void 0!==e.sizeAttenuation&&(r.sizeAttenuation=e.sizeAttenuation),void 0!==e.map&&(r.map=n(e.map)),void 0!==e.matcap&&(r.matcap=n(e.matcap)),void 0!==e.alphaMap&&(r.alphaMap=n(e.alphaMap),r.transparent=!0),void 0!==e.bumpMap&&(r.bumpMap=n(e.bumpMap)),void 0!==e.bumpScale&&(r.bumpScale=e.bumpScale),void 0!==e.normalMap&&(r.normalMap=n(e.normalMap)),void 0!==e.normalMapType&&(r.normalMapType=e.normalMapType),void 0!==e.normalScale){var s=e.normalScale;!1===(0,Ue.default)(s)&&(s=[s,s]),r.normalScale=(new In).fromArray(s)}return void 0!==e.displacementMap&&(r.displacementMap=n(e.displacementMap)),void 0!==e.displacementScale&&(r.displacementScale=e.displacementScale),void 0!==e.displacementBias&&(r.displacementBias=e.displacementBias),void 0!==e.roughnessMap&&(r.roughnessMap=n(e.roughnessMap)),void 0!==e.metalnessMap&&(r.metalnessMap=n(e.metalnessMap)),void 0!==e.emissiveMap&&(r.emissiveMap=n(e.emissiveMap)),void 0!==e.emissiveIntensity&&(r.emissiveIntensity=e.emissiveIntensity),void 0!==e.specularMap&&(r.specularMap=n(e.specularMap)),void 0!==e.envMap&&(r.envMap=n(e.envMap)),void 0!==e.envMapIntensity&&(r.envMapIntensity=e.envMapIntensity),void 0!==e.reflectivity&&(r.reflectivity=e.reflectivity),void 0!==e.refractionRatio&&(r.refractionRatio=e.refractionRatio),void 0!==e.lightMap&&(r.lightMap=n(e.lightMap)),void 0!==e.lightMapIntensity&&(r.lightMapIntensity=e.lightMapIntensity),void 0!==e.aoMap&&(r.aoMap=n(e.aoMap)),void 0!==e.aoMapIntensity&&(r.aoMapIntensity=e.aoMapIntensity),void 0!==e.gradientMap&&(r.gradientMap=n(e.gradientMap)),r},setPath:function(e){return this.path=e,this},setTextures:function(e){return this.textures=e,this}});var hp={decodeText:function(e){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);for(var t="",n=0,r=e.length;n<r;n++)t+=String.fromCharCode(e[n]);try{return decodeURIComponent(escape(t))}catch(e){return t}},extractUrlBase:function(e){var t=e.lastIndexOf("/");return-1===t?"./":e.substr(0,t+1)}};function fp(){ba.call(this),this.type="InstancedBufferGeometry",this.maxInstancedCount=void 0}function dp(e,t,n,r){"number"==typeof n&&(r=n,n=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),Ni.call(this,e,t,n),this.meshPerAttribute=r||1}function pp(e){this.manager=void 0!==e?e:pd}t.LoaderUtils=hp,fp.prototype=(0,p.default)((0,l.default)(ba.prototype),{constructor:fp,isInstancedBufferGeometry:!0,copy:function(e){return ba.prototype.copy.call(this,e),this.maxInstancedCount=e.maxInstancedCount,this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var e=ba.prototype.toJSON.call(this);return e.maxInstancedCount=this.maxInstancedCount,e.isInstancedBufferGeometry=!0,e}}),dp.prototype=(0,p.default)((0,l.default)(Ni.prototype),{constructor:dp,isInstancedBufferAttribute:!0,copy:function(e){return Ni.prototype.copy.call(this,e),this.meshPerAttribute=e.meshPerAttribute,this},toJSON:function(){var e=Ni.prototype.toJSON.call(this);return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}),(0,p.default)(pp.prototype,{load:function(e,t,n,r){var i=this,a=new vd(i.manager);a.setPath(i.path),a.load(e,function(e){t(i.parse(JSON.parse(e)))},n,r)},parse:function(e){var t=new(e.isInstancedBufferGeometry?fp:ba),n=e.data.index;if(void 0!==n){var r=new mp[n.type](n.array);t.setIndex(new Ni(r,1))}var i=e.data.attributes;for(var a in i){var o=i[a],s=(r=new mp[o.type](o.array),o.isInstancedBufferAttribute?dp:Ni),l=new s(r,o.itemSize,o.normalized);void 0!==o.name&&(l.name=o.name),t.addAttribute(a,l)}var u=e.data.morphAttributes;if(u)for(var a in u){for(var c=u[a],h=[],f=0,d=c.length;f<d;f++)o=c[f],r=new mp[o.type](o.array),l=new Ni(r,o.itemSize,o.normalized),void 0!==o.name&&(l.name=o.name),h.push(l);t.morphAttributes[a]=h}var p=e.data.groups||e.data.drawcalls||e.data.offsets;if(void 0!==p){f=0;for(var m=p.length;f!==m;++f){var v=p[f];t.addGroup(v.start,v.count,v.materialIndex)}}var g=e.data.boundingSphere;if(void 0!==g){var y=new Pn;void 0!==g.center&&y.fromArray(g.center),t.boundingSphere=new _i(y,g.radius)}return e.name&&(t.name=e.name),e.userData&&(t.userData=e.userData),t},setPath:function(e){return this.path=e,this}});var mp={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:"undefined"!=typeof Uint8ClampedArray?Uint8ClampedArray:Uint8Array,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function vp(e){this.manager=void 0!==e?e:pd,this.resourcePath=""}(0,p.default)(vp.prototype,{crossOrigin:"anonymous",load:function(r,i,e,a){var o=this,t=void 0===this.path?hp.extractUrlBase(r):this.path;this.resourcePath=this.resourcePath||t;var n=new vd(o.manager);n.setPath(this.path),n.load(r,function(e){var t=null;try{t=JSON.parse(e)}catch(e){return void 0!==a&&a(e),void console.error("THREE:ObjectLoader: Can't parse "+r+".",e.message)}var n=t.metadata;void 0!==n&&void 0!==n.type&&"geometry"!==n.type.toLowerCase()?o.parse(t,i):console.error("THREE.ObjectLoader: Can't load "+r)},e,a)},setPath:function(e){return this.path=e,this},setResourcePath:function(e){return this.resourcePath=e,this},setCrossOrigin:function(e){return this.crossOrigin=e,this},parse:function(e,t){var n=this.parseShape(e.shapes),r=this.parseGeometries(e.geometries,n),i=this.parseImages(e.images,function(){void 0!==t&&t(s)}),a=this.parseTextures(e.textures,i),o=this.parseMaterials(e.materials,a),s=this.parseObject(e.object,r,o);return e.animations&&(s.animations=this.parseAnimations(e.animations)),void 0!==e.images&&0!==e.images.length||void 0!==t&&t(s),s},parseShape:function(e){var t={};if(void 0!==e)for(var n=0,r=e.length;n<r;n++){var i=(new Qd).fromJSON(e[n]);t[i.uuid]=i}return t},parseGeometries:function(e,t){var n={};if(void 0!==e)for(var r=new pp,i=0,a=e.length;i<a;i++){var o,s=e[i];switch(s.type){case"PlaneGeometry":case"PlaneBufferGeometry":o=new Bf[s.type](s.width,s.height,s.widthSegments,s.heightSegments);break;case"BoxGeometry":case"BoxBufferGeometry":case"CubeGeometry":o=new Bf[s.type](s.width,s.height,s.depth,s.widthSegments,s.heightSegments,s.depthSegments);break;case"CircleGeometry":case"CircleBufferGeometry":o=new Bf[s.type](s.radius,s.segments,s.thetaStart,s.thetaLength);break;case"CylinderGeometry":case"CylinderBufferGeometry":o=new Bf[s.type](s.radiusTop,s.radiusBottom,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"ConeGeometry":case"ConeBufferGeometry":o=new Bf[s.type](s.radius,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"SphereGeometry":case"SphereBufferGeometry":o=new Bf[s.type](s.radius,s.widthSegments,s.heightSegments,s.phiStart,s.phiLength,s.thetaStart,s.thetaLength);break;case"DodecahedronGeometry":case"DodecahedronBufferGeometry":case"IcosahedronGeometry":case"IcosahedronBufferGeometry":case"OctahedronGeometry":case"OctahedronBufferGeometry":case"TetrahedronGeometry":case"TetrahedronBufferGeometry":o=new Bf[s.type](s.radius,s.detail);break;case"RingGeometry":case"RingBufferGeometry":o=new Bf[s.type](s.innerRadius,s.outerRadius,s.thetaSegments,s.phiSegments,s.thetaStart,s.thetaLength);break;case"TorusGeometry":case"TorusBufferGeometry":o=new Bf[s.type](s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc);break;case"TorusKnotGeometry":case"TorusKnotBufferGeometry":o=new Bf[s.type](s.radius,s.tube,s.tubularSegments,s.radialSegments,s.p,s.q);break;case"TubeGeometry":case"TubeBufferGeometry":o=new Bf[s.type]((new Zd[s.path.type]).fromJSON(s.path),s.tubularSegments,s.radius,s.radialSegments,s.closed);break;case"LatheGeometry":case"LatheBufferGeometry":o=new Bf[s.type](s.points,s.segments,s.phiStart,s.phiLength);break;case"PolyhedronGeometry":case"PolyhedronBufferGeometry":o=new Bf[s.type](s.vertices,s.indices,s.radius,s.details);break;case"ShapeGeometry":case"ShapeBufferGeometry":for(var l=[],u=0,c=s.shapes.length;u<c;u++){var h=t[s.shapes[u]];l.push(h)}o=new Bf[s.type](l,s.curveSegments);break;case"ExtrudeGeometry":case"ExtrudeBufferGeometry":for(l=[],u=0,c=s.shapes.length;u<c;u++)h=t[s.shapes[u]],l.push(h);var f=s.options.extrudePath;void 0!==f&&(s.options.extrudePath=(new Zd[f.type]).fromJSON(f)),o=new Bf[s.type](l,s.options);break;case"BufferGeometry":case"InstancedBufferGeometry":o=r.parse(s);break;case"Geometry":if("THREE"in window&&"LegacyJSONLoader"in THREE){var d=new THREE.LegacyJSONLoader;o=d.parse(s,this.resourcePath).geometry}else console.error('THREE.ObjectLoader: You have to import LegacyJSONLoader in order load geometry data of type "Geometry".');break;default:console.warn('THREE.ObjectLoader: Unsupported geometry type "'+s.type+'"');continue}o.uuid=s.uuid,void 0!==s.name&&(o.name=s.name),!0===o.isBufferGeometry&&void 0!==s.userData&&(o.userData=s.userData),n[s.uuid]=o}return n},parseMaterials:function(e,t){var n={},r={};if(void 0!==e){var i=new cp;i.setTextures(t);for(var a=0,o=e.length;a<o;a++){var s=e[a];if("MultiMaterial"===s.type){for(var l=[],u=0;u<s.materials.length;u++){var c=s.materials[u];void 0===n[c.uuid]&&(n[c.uuid]=i.parse(c)),l.push(n[c.uuid])}r[s.uuid]=l}else void 0===n[s.uuid]&&(n[s.uuid]=i.parse(s)),r[s.uuid]=n[s.uuid]}}return r},parseAnimations:function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n],i=ud.parse(r);void 0!==r.uuid&&(i.uuid=r.uuid),t.push(i)}return t},parseImages:function(e,t){var n=this,r={};function i(e){return n.manager.itemStart(e),o.load(e,function(){n.manager.itemEnd(e)},void 0,function(){n.manager.itemError(e),n.manager.itemEnd(e)})}if(void 0!==e&&0<e.length){var a=new dd(t),o=new xd(a);o.setCrossOrigin(this.crossOrigin);for(var s=0,l=e.length;s<l;s++){var u=e[s],c=u.url;if((0,Ue.default)(c)){r[u.uuid]=[];for(var h=0,f=c.length;h<f;h++){var d=c[h],p=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(d)?d:n.resourcePath+d;r[u.uuid].push(i(p))}}else p=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(u.url)?u.url:n.resourcePath+u.url,r[u.uuid]=i(p)}}return r},parseTextures:function(e,t){function n(e,t){return"number"==typeof e?e:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",e),t[e])}var r={};if(void 0!==e)for(var i=0,a=e.length;i<a;i++){var o,s=e[i];void 0===s.image&&console.warn('THREE.ObjectLoader: No "image" specified for',s.uuid),void 0===t[s.image]&&console.warn("THREE.ObjectLoader: Undefined image",s.image),o=new((0,Ue.default)(t[s.image])?Ol:Xn)(t[s.image]),o.needsUpdate=!0,o.uuid=s.uuid,void 0!==s.name&&(o.name=s.name),void 0!==s.mapping&&(o.mapping=n(s.mapping,bp)),void 0!==s.offset&&o.offset.fromArray(s.offset),void 0!==s.repeat&&o.repeat.fromArray(s.repeat),void 0!==s.center&&o.center.fromArray(s.center),void 0!==s.rotation&&(o.rotation=s.rotation),void 0!==s.wrap&&(o.wrapS=n(s.wrap[0],Mp),o.wrapT=n(s.wrap[1],Mp)),void 0!==s.format&&(o.format=s.format),void 0!==s.type&&(o.type=s.type),void 0!==s.encoding&&(o.encoding=s.encoding),void 0!==s.minFilter&&(o.minFilter=n(s.minFilter,Sp)),void 0!==s.magFilter&&(o.magFilter=n(s.magFilter,Sp)),void 0!==s.anisotropy&&(o.anisotropy=s.anisotropy),void 0!==s.flipY&&(o.flipY=s.flipY),void 0!==s.premultiplyAlpha&&(o.premultiplyAlpha=s.premultiplyAlpha),void 0!==s.unpackAlignment&&(o.unpackAlignment=s.unpackAlignment),r[s.uuid]=o}return r},parseObject:function(e,t,a){var n;function r(e){return void 0===t[e]&&console.warn("THREE.ObjectLoader: Undefined geometry",e),t[e]}function i(e){if(void 0!==e){if((0,Ue.default)(e)){for(var t=[],n=0,r=e.length;n<r;n++){var i=e[n];void 0===a[i]&&console.warn("THREE.ObjectLoader: Undefined material",i),t.push(a[i])}return t}return void 0===a[e]&&console.warn("THREE.ObjectLoader: Undefined material",e),a[e]}}switch(e.type){case"Scene":n=new mi,void 0!==e.background&&(0,y.default)(e.background)&&(n.background=new Ti(e.background)),void 0!==e.fog&&("Fog"===e.fog.type?n.fog=new Qc(e.fog.color,e.fog.near,e.fog.far):"FogExp2"===e.fog.type&&(n.fog=new Kc(e.fog.color,e.fog.density)));break;case"PerspectiveCamera":n=new Wa(e.fov,e.aspect,e.near,e.far),void 0!==e.focus&&(n.focus=e.focus),void 0!==e.zoom&&(n.zoom=e.zoom),void 0!==e.filmGauge&&(n.filmGauge=e.filmGauge),void 0!==e.filmOffset&&(n.filmOffset=e.filmOffset),void 0!==e.view&&(n.view=(0,p.default)({},e.view));break;case"OrthographicCamera":n=new ap(e.left,e.right,e.top,e.bottom,e.near,e.far),void 0!==e.zoom&&(n.zoom=e.zoom),void 0!==e.view&&(n.view=(0,p.default)({},e.view));break;case"AmbientLight":n=new lp(e.color,e.intensity);break;case"DirectionalLight":n=new sp(e.color,e.intensity);break;case"PointLight":n=new ip(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":n=new up(e.color,e.intensity,e.width,e.height);break;case"SpotLight":n=new rp(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);break;case"HemisphereLight":n=new ep(e.color,e.groundColor,e.intensity);break;case"SkinnedMesh":console.warn("THREE.ObjectLoader.parseObject() does not support SkinnedMesh yet.");case"Mesh":var o=r(e.geometry),s=i(e.material);n=new(o.bones&&0<o.bones.length?ah:Ma)(o,s),void 0!==e.drawMode&&n.setDrawMode(e.drawMode);break;case"LOD":n=new ih;break;case"Line":n=new uh(r(e.geometry),i(e.material),e.mode);break;case"LineLoop":n=new hh(r(e.geometry),i(e.material));break;case"LineSegments":n=new ch(r(e.geometry),i(e.material));break;case"PointCloud":case"Points":n=new dh(r(e.geometry),i(e.material));break;case"Sprite":n=new nh(i(e.material));break;case"Group":n=new mc;break;default:n=new pi}if(n.uuid=e.uuid,void 0!==e.name&&(n.name=e.name),void 0!==e.matrix?(n.matrix.fromArray(e.matrix),void 0!==e.matrixAutoUpdate&&(n.matrixAutoUpdate=e.matrixAutoUpdate),n.matrixAutoUpdate&&n.matrix.decompose(n.position,n.quaternion,n.scale)):(void 0!==e.position&&n.position.fromArray(e.position),void 0!==e.rotation&&n.rotation.fromArray(e.rotation),void 0!==e.quaternion&&n.quaternion.fromArray(e.quaternion),void 0!==e.scale&&n.scale.fromArray(e.scale)),void 0!==e.castShadow&&(n.castShadow=e.castShadow),void 0!==e.receiveShadow&&(n.receiveShadow=e.receiveShadow),e.shadow&&(void 0!==e.shadow.bias&&(n.shadow.bias=e.shadow.bias),void 0!==e.shadow.radius&&(n.shadow.radius=e.shadow.radius),void 0!==e.shadow.mapSize&&n.shadow.mapSize.fromArray(e.shadow.mapSize),void 0!==e.shadow.camera&&(n.shadow.camera=this.parseObject(e.shadow.camera))),void 0!==e.visible&&(n.visible=e.visible),void 0!==e.frustumCulled&&(n.frustumCulled=e.frustumCulled),void 0!==e.renderOrder&&(n.renderOrder=e.renderOrder),void 0!==e.userData&&(n.userData=e.userData),void 0!==e.layers&&(n.layers.mask=e.layers),void 0!==e.children)for(var l=e.children,u=0;u<l.length;u++)n.add(this.parseObject(l[u],t,a));if("LOD"===e.type)for(var c=e.levels,h=0;h<c.length;h++){var f=c[h],d=n.getObjectByProperty("uuid",f.object);void 0!==d&&n.addLevel(d,f.distance)}return n}});var gp,yp,_p,xp,wp,bp={UVMapping:ne,CubeReflectionMapping:re,CubeRefractionMapping:ae,EquirectangularReflectionMapping:oe,EquirectangularRefractionMapping:se,SphericalReflectionMapping:le,CubeUVReflectionMapping:ue,CubeUVRefractionMapping:Ce},Mp={RepeatWrapping:Ie,ClampToEdgeWrapping:ke,MirroredRepeatWrapping:Pe},Sp={NearestFilter:Ne,NearestMipmapNearestFilter:De,NearestMipmapLinearFilter:Fe,LinearFilter:Ve,LinearMipmapNearestFilter:He,LinearMipmapLinearFilter:je};function Ep(e){"undefined"==typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"==typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.manager=void 0!==e?e:pd,this.options=void 0}function Tp(){this.type="ShapePath",this.color=new Ti,this.subPaths=[],this.currentPath=null}function Ap(e){this.type="Font",this.data=e}function Lp(e,t,n){for(var r=f.default?(0,f.default)(e):String(e).split(""),i=t/n.resolution,a=(n.boundingBox.yMax-n.boundingBox.yMin+n.underlineThickness)*i,o=[],s=0,l=0,u=0;u<r.length;u++){var c=r[u];if("\n"===c)s=0,l-=a;else{var h=Rp(c,i,s,l,n);s+=h.offsetX,o.push(h.path)}}return o}function Rp(e,t,n,r,i){var a=i.glyphs[e]||i.glyphs["?"];if(a){var o,s,l,u,c,h,f,d,p=new Tp;if(a.o)for(var m=a._cachedOutline||(a._cachedOutline=a.o.split(" ")),v=0,g=m.length;v<g;){var y=m[v++];switch(y){case"m":o=m[v++]*t+n,s=m[v++]*t+r,p.moveTo(o,s);break;case"l":o=m[v++]*t+n,s=m[v++]*t+r,p.lineTo(o,s);break;case"q":l=m[v++]*t+n,u=m[v++]*t+r,c=m[v++]*t+n,h=m[v++]*t+r,p.quadraticCurveTo(c,h,l,u);break;case"b":l=m[v++]*t+n,u=m[v++]*t+r,c=m[v++]*t+n,h=m[v++]*t+r,f=m[v++]*t+n,d=m[v++]*t+r,p.bezierCurveTo(c,h,f,d,l,u)}}return{offsetX:a.ha*t,path:p}}console.error('THREE.Font: character "'+e+'" does not exists in font family '+i.familyName+".")}function Cp(e){this.manager=void 0!==e?e:pd}function Ip(){}Ep.prototype={constructor:Ep,setOptions:function(e){return this.options=e,this},load:function(t,n,e,r){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);var i=this,a=fd.get(t);if(void 0!==a)return i.manager.itemStart(t),setTimeout(function(){n&&n(a),i.manager.itemEnd(t)},0),a;fetch(t).then(function(e){return e.blob()}).then(function(e){return void 0===i.options?createImageBitmap(e):createImageBitmap(e,i.options)}).then(function(e){fd.add(t,e),n&&n(e),i.manager.itemEnd(t)}).catch(function(e){r&&r(e),i.manager.itemError(t),i.manager.itemEnd(t)}),i.manager.itemStart(t)},setCrossOrigin:function(){return this},setPath:function(e){return this.path=e,this}},(0,p.default)(Tp.prototype,{moveTo:function(e,t){this.currentPath=new Kd,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t)},lineTo:function(e,t){this.currentPath.lineTo(e,t)},quadraticCurveTo:function(e,t,n,r){this.currentPath.quadraticCurveTo(e,t,n,r)},bezierCurveTo:function(e,t,n,r,i,a){this.currentPath.bezierCurveTo(e,t,n,r,i,a)},splineThru:function(e){this.currentPath.splineThru(e)},toShapes:function(e,t){function n(e){for(var t=[],n=0,r=e.length;n<r;n++){var i=e[n],a=new Qd;a.curves=i.curves,t.push(a)}return t}function r(e,t){for(var n=t.length,r=!1,i=n-1,a=0;a<n;i=a++){var o=t[i],s=t[a],l=s.x-o.x,u=s.y-o.y;if(Math.abs(u)>ie.default){if(u<0&&(o=t[a],l=-l,s=t[i],u=-u),e.y<o.y||e.y>s.y)continue;if(e.y===o.y){if(e.x===o.x)return!0}else{var c=u*(e.x-o.x)-l*(e.y-o.y);if(0===c)return!0;if(c<0)continue;r=!r}}else{if(e.y!==o.y)continue;if(s.x<=e.x&&e.x<=o.x||o.x<=e.x&&e.x<=s.x)return!0}}return r}var i=df.isClockWise,a=this.subPaths;if(0===a.length)return[];if(!0===t)return n(a);var o,s,l,u=[];if(1===a.length)return s=a[0],l=new Qd,l.curves=s.curves,u.push(l),u;var c=!i(a[0].getPoints());c=e?!c:c;var h,f,d=[],p=[],m=[],v=0;p[v]=void 0,m[v]=[];for(var g=0,y=a.length;g<y;g++)s=a[g],h=s.getPoints(),o=i(h),o=e?!o:o,o?(!c&&p[v]&&v++,p[v]={s:new Qd,p:h},p[v].s.curves=s.curves,c&&v++,m[v]=[]):m[v].push({h:s,p:h[0]});if(!p[0])return n(a);if(1<p.length){for(var _=!1,x=[],w=0,b=p.length;w<b;w++)d[w]=[];for(w=0,b=p.length;w<b;w++)for(var M=m[w],S=0;S<M.length;S++){for(var E=M[S],T=!0,A=0;A<p.length;A++)r(E.p,p[A].p)&&(w!==A&&x.push({froms:w,tos:A,hole:S}),T?(T=!1,d[A].push(E)):_=!0);T&&d[w].push(E)}0<x.length&&(_||(m=d))}g=0;for(var L=p.length;g<L;g++){l=p[g].s,u.push(l),f=m[g];for(var R=0,C=f.length;R<C;R++)l.holes.push(f[R].h)}return u}}),(0,p.default)(Ap.prototype,{isFont:!0,generateShapes:function(e,t){void 0===t&&(t=100);for(var n=[],r=Lp(e,t,this.data),i=0,a=r.length;i<a;i++)Array.prototype.push.apply(n,r[i].toShapes());return n}}),(0,p.default)(Cp.prototype,{load:function(e,r,t,n){var i=this,a=new vd(this.manager);a.setPath(this.path),a.load(e,function(t){var n;try{n=JSON.parse(t)}catch(e){console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),n=JSON.parse(t.substring(65,t.length-2))}var e=i.parse(n);r&&r(e)},t,n)},parse:function(e){return new Ap(e)},setPath:function(e){return this.path=e,this}}),Ip.Handlers={handlers:[],add:function(e,t){this.handlers.push(e,t)},get:function(e){for(var t=this.handlers,n=0,r=t.length;n<r;n+=2){var i=t[n],a=t[n+1];if(i.test(e))return a}return null}},(0,p.default)(Ip.prototype,{crossOrigin:"anonymous",onLoadStart:function(){},onLoadProgress:function(){},onLoadComplete:function(){},initMaterials:function(e,t,n){for(var r=[],i=0;i<e.length;++i)r[i]=this.createMaterial(e[i],t,n);return r},createMaterial:(gp={NoBlending:me,NormalBlending:ve,AdditiveBlending:ge,SubtractiveBlending:ye,MultiplyBlending:_e,CustomBlending:xe},yp=new Ti,_p=new bd,xp=new cp,function(e,u,c){var h={};function t(e,t,n,r,i){var a,o=u+e,s=Ip.Handlers.get(o);a=null!==s?s.load(o):(_p.setCrossOrigin(c),_p.load(o)),void 0!==t&&(a.repeat.fromArray(t),1!==t[0]&&(a.wrapS=Ie),1!==t[1]&&(a.wrapT=Ie)),void 0!==n&&a.offset.fromArray(n),void 0!==r&&("repeat"===r[0]&&(a.wrapS=Ie),"mirror"===r[0]&&(a.wrapS=Pe),"repeat"===r[1]&&(a.wrapT=Ie),"mirror"===r[1]&&(a.wrapT=Pe)),void 0!==i&&(a.anisotropy=i);var l=Cn.generateUUID();return h[l]=a,l}var n={uuid:Cn.generateUUID(),type:"MeshLambertMaterial"};for(var r in e){var i=e[r];switch(r){case"DbgColor":case"DbgIndex":case"opticalDensity":case"illumination":break;case"DbgName":n.name=i;break;case"blending":n.blending=gp[i];break;case"colorAmbient":case"mapAmbient":break;case"colorDiffuse":n.color=yp.fromArray(i).getHex();break;case"colorSpecular":n.specular=yp.fromArray(i).getHex();break;case"colorEmissive":n.emissive=yp.fromArray(i).getHex();break;case"specularCoef":n.shininess=i;break;case"shading":"basic"===i.toLowerCase()&&(n.type="MeshBasicMaterial"),"phong"===i.toLowerCase()&&(n.type="MeshPhongMaterial"),"standard"===i.toLowerCase()&&(n.type="MeshStandardMaterial");break;case"mapDiffuse":n.map=t(i,e.mapDiffuseRepeat,e.mapDiffuseOffset,e.mapDiffuseWrap,e.mapDiffuseAnisotropy);break;case"mapDiffuseRepeat":case"mapDiffuseOffset":case"mapDiffuseWrap":case"mapDiffuseAnisotropy":break;case"mapEmissive":n.emissiveMap=t(i,e.mapEmissiveRepeat,e.mapEmissiveOffset,e.mapEmissiveWrap,e.mapEmissiveAnisotropy);break;case"mapEmissiveRepeat":case"mapEmissiveOffset":case"mapEmissiveWrap":case"mapEmissiveAnisotropy":break;case"mapLight":n.lightMap=t(i,e.mapLightRepeat,e.mapLightOffset,e.mapLightWrap,e.mapLightAnisotropy);break;case"mapLightRepeat":case"mapLightOffset":case"mapLightWrap":case"mapLightAnisotropy":break;case"mapAO":n.aoMap=t(i,e.mapAORepeat,e.mapAOOffset,e.mapAOWrap,e.mapAOAnisotropy);break;case"mapAORepeat":case"mapAOOffset":case"mapAOWrap":case"mapAOAnisotropy":break;case"mapBump":n.bumpMap=t(i,e.mapBumpRepeat,e.mapBumpOffset,e.mapBumpWrap,e.mapBumpAnisotropy);break;case"mapBumpScale":n.bumpScale=i;break;case"mapBumpRepeat":case"mapBumpOffset":case"mapBumpWrap":case"mapBumpAnisotropy":break;case"mapNormal":n.normalMap=t(i,e.mapNormalRepeat,e.mapNormalOffset,e.mapNormalWrap,e.mapNormalAnisotropy);break;case"mapNormalFactor":n.normalScale=i;break;case"mapNormalRepeat":case"mapNormalOffset":case"mapNormalWrap":case"mapNormalAnisotropy":break;case"mapSpecular":n.specularMap=t(i,e.mapSpecularRepeat,e.mapSpecularOffset,e.mapSpecularWrap,e.mapSpecularAnisotropy);break;case"mapSpecularRepeat":case"mapSpecularOffset":case"mapSpecularWrap":case"mapSpecularAnisotropy":break;case"mapMetalness":n.metalnessMap=t(i,e.mapMetalnessRepeat,e.mapMetalnessOffset,e.mapMetalnessWrap,e.mapMetalnessAnisotropy);break;case"mapMetalnessRepeat":case"mapMetalnessOffset":case"mapMetalnessWrap":case"mapMetalnessAnisotropy":break;case"mapRoughness":n.roughnessMap=t(i,e.mapRoughnessRepeat,e.mapRoughnessOffset,e.mapRoughnessWrap,e.mapRoughnessAnisotropy);break;case"mapRoughnessRepeat":case"mapRoughnessOffset":case"mapRoughnessWrap":case"mapRoughnessAnisotropy":break;case"mapAlpha":n.alphaMap=t(i,e.mapAlphaRepeat,e.mapAlphaOffset,e.mapAlphaWrap,e.mapAlphaAnisotropy);break;case"mapAlphaRepeat":case"mapAlphaOffset":case"mapAlphaWrap":case"mapAlphaAnisotropy":break;case"flipSided":n.side=Ge;break;case"doubleSided":n.side=pe;break;case"transparency":n.opacity=i;break;case"depthTest":case"depthWrite":case"colorWrite":case"opacity":case"reflectivity":case"transparent":case"visible":case"wireframe":n[r]=i;break;case"vertexColors":!0===i&&(n.vertexColors=R),"face"===i&&(n.vertexColors=L)}}return"MeshBasicMaterial"===n.type&&delete n.emissive,"MeshPhongMaterial"!==n.type&&delete n.specular,n.opacity<1&&(n.transparent=!0),xp.setTextures(h),xp.parse(n)})});var kp,Pp,Np,Dp,Op,Fp,Bp,Up,Gp,zp,Vp,Hp,Wp,jp,Yp,qp,Xp,Zp,Jp,Kp={getContext:function(){return void 0===wp&&(wp=new(window.AudioContext||window.webkitAudioContext)),wp},setContext:function(e){wp=e}};function Qp(e){this.manager=void 0!==e?e:pd}function $p(){this.coefficients=[];for(var e=0;e<9;e++)this.coefficients.push(new Pn)}function em(e,t){$d.call(this,void 0,t),this.sh=void 0!==e?e:new $p}function tm(e,t,n){em.call(this,void 0,n);var r=(new Ti).set(e),i=(new Ti).set(t),a=new Pn(r.r,r.g,r.b),o=new Pn(i.r,i.g,i.b),s=Math.sqrt(Math.PI),l=s*Math.sqrt(.75);this.sh.coefficients[0].copy(a).add(o).multiplyScalar(s),this.sh.coefficients[1].copy(a).sub(o).multiplyScalar(l)}function nm(e,t){em.call(this,void 0,t);var n=(new Ti).set(e);this.sh.coefficients[0].set(n.r,n.g,n.b).multiplyScalar(2*Math.sqrt(Math.PI))}function rm(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Wa,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Wa,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1}function im(e){this.autoStart=void 0===e||e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}function am(){pi.call(this),this.type="AudioListener",this.context=Kp.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0}function om(e){pi.call(this),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.startTime=0,this.offset=0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.sourceType="empty",this.filters=[]}function sm(e){om.call(this,e),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}function lm(e,t){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=void 0!==t?t:2048,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}function um(e,t,n){this.binding=e,this.valueSize=n;var r,i=Float64Array;switch(t){case"quaternion":r=this._slerp;break;case"string":case"bool":i=Array,r=this._select;break;default:r=this._lerp}this.buffer=new i(4*n),this._mixBufferRegion=r,this.cumulativeWeight=0,this.useCount=0,this.referenceCount=0}t.AudioContext=Kp,(0,p.default)(Qp.prototype,{load:function(e,r,t,n){var i=new vd(this.manager);i.setResponseType("arraybuffer"),i.setPath(this.path),i.load(e,function(e){var t=e.slice(0),n=Kp.getContext();n.decodeAudioData(t,function(e){r(e)})},t,n)},setPath:function(e){return this.path=e,this}}),(0,p.default)($p.prototype,{isSphericalHarmonics3:!0,set:function(e){for(var t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this},zero:function(){for(var e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this},getAt:function(e,t){var n=e.x,r=e.y,i=e.z,a=this.coefficients;return t.copy(a[0]).multiplyScalar(.282095),t.addScale(a[1],.488603*r),t.addScale(a[2],.488603*i),t.addScale(a[3],.488603*n),t.addScale(a[4],n*r*1.092548),t.addScale(a[5],r*i*1.092548),t.addScale(a[6],.315392*(3*i*i-1)),t.addScale(a[7],n*i*1.092548),t.addScale(a[8],.546274*(n*n-r*r)),t},getIrradianceAt:function(e,t){var n=e.x,r=e.y,i=e.z,a=this.coefficients;return t.copy(a[0]).multiplyScalar(.886227),t.addScale(a[1],1.023328*r),t.addScale(a[2],1.023328*i),t.addScale(a[3],1.023328*n),t.addScale(a[4],.858086*n*r),t.addScale(a[5],.858086*r*i),t.addScale(a[6],.743125*i*i-.247708),t.addScale(a[7],.858086*n*i),t.addScale(a[8],.429043*(n*n-r*r)),t},add:function(e){for(var t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this},scale:function(e){for(var t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this},lerp:function(e,t){for(var n=0;n<9;n++)this.coefficients[n].lerp(e.coefficients[n],t);return this},equals:function(e){for(var t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0},copy:function(e){return this.set(e.coefficients)},clone:function(){return(new this.constructor).copy(this)},fromArray:function(e){for(var t=this.coefficients,n=0;n<9;n++)t[n].fromArray(e,3*n);return this},toArray:function(){for(var e=[],t=this.coefficients,n=0;n<9;n++)t[n].toArray(e,3*n);return e}}),(0,p.default)($p,{getBasisAt:function(e,t){var n=e.x,r=e.y,i=e.z;t[0]=.282095,t[1]=.488603*r,t[2]=.488603*i,t[3]=.488603*n,t[4]=1.092548*n*r,t[5]=1.092548*r*i,t[6]=.315392*(3*i*i-1),t[7]=1.092548*n*i,t[8]=.546274*(n*n-r*r)}}),em.prototype=(0,p.default)((0,l.default)($d.prototype),{constructor:em,isLightProbe:!0,copy:function(e){return $d.prototype.copy.call(this,e),this.sh.copy(e.sh),this.intensity=e.intensity,this},toJSON:function(e){var t=$d.prototype.toJSON.call(this,e);return t}}),tm.prototype=(0,p.default)((0,l.default)(em.prototype),{constructor:tm,isHemisphereLightProbe:!0,copy:function(e){return em.prototype.copy.call(this,e),this},toJSON:function(e){var t=em.prototype.toJSON.call(this,e);return t}}),nm.prototype=(0,p.default)((0,l.default)(em.prototype),{constructor:nm,isAmbientLightProbe:!0,copy:function(e){return em.prototype.copy.call(this,e),this},toJSON:function(e){var t=em.prototype.toJSON.call(this,e);return t}}),(0,p.default)(rm.prototype,{update:(Gp=new Qn,zp=new Qn,function(e){var t=kp!==this||Pp!==e.focus||Np!==e.fov||Dp!==e.aspect*this.aspect||Op!==e.near||Fp!==e.far||Bp!==e.zoom||Up!==this.eyeSep;if(t){kp=this,Pp=e.focus,Np=e.fov,Dp=e.aspect*this.aspect,Op=e.near,Fp=e.far,Bp=e.zoom;var n=e.projectionMatrix.clone();Up=this.eyeSep/2;var r,i,a=Up*Op/Pp,o=Op*Math.tan(Cn.DEG2RAD*Np*.5)/Bp;zp.elements[12]=-Up,Gp.elements[12]=Up,r=-o*Dp+a,i=o*Dp+a,n.elements[0]=2*Op/(i-r),n.elements[8]=(i+r)/(i-r),this.cameraL.projectionMatrix.copy(n),r=-o*Dp-a,i=o*Dp-a,n.elements[0]=2*Op/(i-r),n.elements[8]=(i+r)/(i-r),this.cameraR.projectionMatrix.copy(n)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(zp),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(Gp)})}),(0,p.default)(im.prototype,{start:function(){this.startTime=("undefined"==typeof performance?Date:performance).now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0},stop:function(){this.getElapsedTime(),this.running=!1,this.autoStart=!1},getElapsedTime:function(){return this.getDelta(),this.elapsedTime},getDelta:function(){var e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){var t=("undefined"==typeof performance?Date:performance).now();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}),am.prototype=(0,p.default)((0,l.default)(pi.prototype),{constructor:am,getInput:function(){return this.gain},removeFilter:function(){return null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this},getFilter:function(){return this.filter},setFilter:function(e){return null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this},getMasterVolume:function(){return this.gain.gain.value},setMasterVolume:function(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this},updateMatrixWorld:(Vp=new Pn,Hp=new kn,Wp=new Pn,jp=new Pn,Yp=new im,function(e){pi.prototype.updateMatrixWorld.call(this,e);var t=this.context.listener,n=this.up;if(this.timeDelta=Yp.getDelta(),this.matrixWorld.decompose(Vp,Hp,Wp),jp.set(0,0,-1).applyQuaternion(Hp),t.positionX){var r=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(Vp.x,r),t.positionY.linearRampToValueAtTime(Vp.y,r),t.positionZ.linearRampToValueAtTime(Vp.z,r),t.forwardX.linearRampToValueAtTime(jp.x,r),t.forwardY.linearRampToValueAtTime(jp.y,r),t.forwardZ.linearRampToValueAtTime(jp.z,r),t.upX.linearRampToValueAtTime(n.x,r),t.upY.linearRampToValueAtTime(n.y,r),t.upZ.linearRampToValueAtTime(n.z,r)}else t.setPosition(Vp.x,Vp.y,Vp.z),t.setOrientation(jp.x,jp.y,jp.z,n.x,n.y,n.z)})}),om.prototype=(0,p.default)((0,l.default)(pi.prototype),{constructor:om,getOutput:function(){return this.gain},setNodeSource:function(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this},setMediaElementSource:function(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this},setBuffer:function(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this},play:function(){if(!0!==this.isPlaying){if(!1!==this.hasPlaybackControl){var e=this.context.createBufferSource();return e.buffer=this.buffer,e.loop=this.loop,e.onended=this.onEnded.bind(this),this.startTime=this.context.currentTime,e.start(this.startTime,this.offset),this.isPlaying=!0,this.source=e,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}console.warn("THREE.Audio: this Audio has no playback control.")}else console.warn("THREE.Audio: Audio is already playing.")},pause:function(){if(!1!==this.hasPlaybackControl)return!0===this.isPlaying&&(this.source.stop(),this.source.onended=null,this.offset+=(this.context.currentTime-this.startTime)*this.playbackRate,this.isPlaying=!1),this;console.warn("THREE.Audio: this Audio has no playback control.")},stop:function(){if(!1!==this.hasPlaybackControl)return this.source.stop(),this.source.onended=null,this.offset=0,this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")},connect:function(){if(0<this.filters.length){this.source.connect(this.filters[0]);for(var e=1,t=this.filters.length;e<t;e++)this.filters[e-1].connect(this.filters[e]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this},disconnect:function(){if(0<this.filters.length){this.source.disconnect(this.filters[0]);for(var e=1,t=this.filters.length;e<t;e++)this.filters[e-1].disconnect(this.filters[e]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this},getFilters:function(){return this.filters},setFilters:function(e){return e=e||[],!0===this.isPlaying?(this.disconnect(),this.filters=e,this.connect()):this.filters=e,this},setDetune:function(e){if(this.detune=e,void 0!==this.source.detune)return!0===this.isPlaying&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this},getDetune:function(){return this.detune},getFilter:function(){return this.getFilters()[0]},setFilter:function(e){return this.setFilters(e?[e]:[])},setPlaybackRate:function(e){if(!1!==this.hasPlaybackControl)return this.playbackRate=e,!0===this.isPlaying&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this;console.warn("THREE.Audio: this Audio has no playback control.")},getPlaybackRate:function(){return this.playbackRate},onEnded:function(){this.isPlaying=!1},getLoop:function(){return!1===this.hasPlaybackControl?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop},setLoop:function(e){if(!1!==this.hasPlaybackControl)return this.loop=e,!0===this.isPlaying&&(this.source.loop=this.loop),this;console.warn("THREE.Audio: this Audio has no playback control.")},getVolume:function(){return this.gain.gain.value},setVolume:function(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}}),sm.prototype=(0,p.default)((0,l.default)(om.prototype),{constructor:sm,getOutput:function(){return this.panner},getRefDistance:function(){return this.panner.refDistance},setRefDistance:function(e){return this.panner.refDistance=e,this},getRolloffFactor:function(){return this.panner.rolloffFactor},setRolloffFactor:function(e){return this.panner.rolloffFactor=e,this},getDistanceModel:function(){return this.panner.distanceModel},setDistanceModel:function(e){return this.panner.distanceModel=e,this},getMaxDistance:function(){return this.panner.maxDistance},setMaxDistance:function(e){return this.panner.maxDistance=e,this},setDirectionalCone:function(e,t,n){return this.panner.coneInnerAngle=e,this.panner.coneOuterAngle=t,this.panner.coneOuterGain=n,this},updateMatrixWorld:(qp=new Pn,Xp=new kn,Zp=new Pn,Jp=new Pn,function(e){if(pi.prototype.updateMatrixWorld.call(this,e),!0!==this.hasPlaybackControl||!1!==this.isPlaying){this.matrixWorld.decompose(qp,Xp,Zp),Jp.set(0,0,1).applyQuaternion(Xp);var t=this.panner;if(t.positionX){var n=this.context.currentTime+this.listener.timeDelta;t.positionX.linearRampToValueAtTime(qp.x,n),t.positionY.linearRampToValueAtTime(qp.y,n),t.positionZ.linearRampToValueAtTime(qp.z,n),t.orientationX.linearRampToValueAtTime(Jp.x,n),t.orientationY.linearRampToValueAtTime(Jp.y,n),t.orientationZ.linearRampToValueAtTime(Jp.z,n)}else t.setPosition(qp.x,qp.y,qp.z),t.setOrientation(Jp.x,Jp.y,Jp.z)}})}),(0,p.default)(lm.prototype,{getFrequencyData:function(){return this.analyser.getByteFrequencyData(this.data),this.data},getAverageFrequency:function(){for(var e=0,t=this.getFrequencyData(),n=0;n<t.length;n++)e+=t[n];return e/t.length}}),(0,p.default)(um.prototype,{accumulate:function(e,t){var n=this.buffer,r=this.valueSize,i=e*r+r,a=this.cumulativeWeight;if(0===a){for(var o=0;o!==r;++o)n[i+o]=n[o];a=t}else{a+=t;var s=t/a;this._mixBufferRegion(n,i,0,s,r)}this.cumulativeWeight=a},apply:function(e){var t=this.valueSize,n=this.buffer,r=e*t+t,i=this.cumulativeWeight,a=this.binding;if(this.cumulativeWeight=0,i<1){var o=3*t;this._mixBufferRegion(n,r,o,1-i,t)}for(var s=t,l=t+t;s!==l;++s)if(n[s]!==n[s+t]){a.setValue(n,r);break}},saveOriginalState:function(){var e=this.binding,t=this.buffer,n=this.valueSize,r=3*n;e.getValue(t,r);for(var i=n,a=r;i!==a;++i)t[i]=t[r+i%n];this.cumulativeWeight=0},restoreOriginalState:function(){var e=3*this.valueSize;this.binding.setValue(this.buffer,e)},_select:function(e,t,n,r,i){if(.5<=r)for(var a=0;a!==i;++a)e[t+a]=e[n+a]},_slerp:function(e,t,n,r){kn.slerpFlat(e,t,e,t,e,n,r)},_lerp:function(e,t,n,r,i){for(var a=1-r,o=0;o!==i;++o){var s=t+o;e[s]=e[s]*a+e[n+o]*r}}});var cm,hm,fm,dm,pm,mm,vm,gm,ym,_m,xm,wm,bm,Mm,Sm,Em,Tm,Am,Lm,Rm,Cm,Im,km,Pm,Nm,Dm,Om,Fm,Bm,Um,Gm,zm,Vm,Hm,Wm,jm,Ym,qm,Xm="\\[\\]\\.:\\/";function Zm(e,t,n){var r=n||Jm.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}function Jm(e,t,n){this.path=t,this.parsedPath=n||Jm.parseTrackName(t),this.node=Jm.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e}function Km(){this.uuid=Cn.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;var e={};this._indicesByUUID=e;for(var t=0,n=arguments.length;t!==n;++t)e[arguments[t].uuid]=t;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};var r=this;this.stats={objects:{get total(){return r._objects.length},get inUse(){return this.total-r.nCachedObjects_}},get bindingsPerObject(){return r._bindings.length}}}function Qm(e,t,n){this._mixer=e,this._clip=t,this._localRoot=n||null;for(var r=t.tracks,i=r.length,a=new Array(i),o={endingStart:Ht,endingEnd:Ht},s=0;s!==i;++s){var l=r[s].createInterpolant(null);a[s]=l,l.settings=o}this._interpolantSettings=o,this._interpolants=a,this._propertyBindings=new Array(i),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=Bt,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}function $m(e){this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}function ev(e,t){"string"==typeof e&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),e=t),this.value=e}function tv(e,t,n){$c.call(this,e,t),this.meshPerAttribute=n||1}function nv(e,t,n,r){this.ray=new xi(e,t),this.near=n||0,this.far=r||1/0,this.params={Mesh:{},Line:{},LOD:{},Points:{threshold:1},Sprite:{}},(0,u.default)(this.params,{PointCloud:{get:function(){return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),this.Points}}})}function rv(e,t){return e.distance-t.distance}function iv(e,t,n,r){if(!1!==e.visible&&(e.raycast(t,n),!0===r))for(var i=e.children,a=0,o=i.length;a<o;a++)iv(i[a],t,n,!0)}function av(e,t,n){return this.radius=void 0!==e?e:1,this.phi=void 0!==t?t:0,this.theta=void 0!==n?n:0,this}function ov(e,t,n){return this.radius=void 0!==e?e:1,this.theta=void 0!==t?t:0,this.y=void 0!==n?n:0,this}function sv(e,t){this.min=void 0!==e?e:new In(1/0,1/0),this.max=void 0!==t?t:new In(-1/0,-1/0)}function lv(e,t){this.start=void 0!==e?e:new Pn,this.end=void 0!==t?t:new Pn}function uv(e){pi.call(this),this.material=e,this.render=function(){}}function cv(e,t,n,r){this.object=e,this.size=void 0!==t?t:1;var i=void 0!==n?n:16711680,a=void 0!==r?r:1,o=0,s=this.object.geometry;s&&s.isGeometry?o=3*s.faces.length:s&&s.isBufferGeometry&&(o=s.attributes.normal.count);var l=new ba,u=new Vi(2*o*3,3);l.addAttribute("position",u),ch.call(this,l,new lh({color:i,linewidth:a})),this.matrixAutoUpdate=!1,this.update()}function hv(e,t){pi.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;for(var n=new ba,r=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1],i=0,a=1,o=32;i<o;i++,a++){var s=i/o*Math.PI*2,l=a/o*Math.PI*2;r.push(Math.cos(s),Math.sin(s),1,Math.cos(l),Math.sin(l),1)}n.addAttribute("position",new Vi(r,3));var u=new lh({fog:!1});this.cone=new ch(n,u),this.add(this.cone),this.update()}function fv(e){var t=[];e&&e.isBone&&t.push(e);for(var n=0;n<e.children.length;n++)t.push.apply(t,fv(e.children[n]));return t}function dv(e){for(var t=fv(e),n=new ba,r=[],i=[],a=new Ti(0,0,1),o=new Ti(0,1,0),s=0;s<t.length;s++){var l=t[s];l.parent&&l.parent.isBone&&(r.push(0,0,0),r.push(0,0,0),i.push(a.r,a.g,a.b),i.push(o.r,o.g,o.b))}n.addAttribute("position",new Vi(r,3)),n.addAttribute("color",new Vi(i,3));var u=new lh({vertexColors:R,depthTest:!1,depthWrite:!1,transparent:!0});ch.call(this,n,u),this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}function pv(e,t,n){this.light=e,this.light.updateMatrixWorld(),this.color=n;var r=new Mf(t,4,2),i=new Pi({wireframe:!0,fog:!1});Ma.call(this,r,i),this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}function mv(e,t){this.type="RectAreaLightHelper",this.light=e,this.color=t;var n=[1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],r=new ba;r.addAttribute("position",new Vi(n,3)),r.computeBoundingSphere();var i=new lh({fog:!1});uh.call(this,r,i);var a=[1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],o=new ba;o.addAttribute("position",new Vi(a,3)),o.computeBoundingSphere(),this.add(new Ma(o,new Pi({side:Ge,fog:!1}))),this.update()}function vv(e,t,n){pi.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n;var r=new Th(t);r.rotateY(.5*Math.PI),this.material=new Pi({wireframe:!0,fog:!1}),void 0===this.color&&(this.material.vertexColors=R);var i=r.getAttribute("position"),a=new Float32Array(3*i.count);r.addAttribute("color",new Ni(a,3)),this.add(new Ma(r,this.material)),this.update()}function gv(e,t){this.lightProbe=e,this.size=t;var n={GAMMA_OUTPUT:""},r=new Va({defines:n,uniforms:{sh:{value:this.lightProbe.sh.coefficients},intensity:{value:this.lightProbe.intensity}},vertexShader:["varying vec3 vNormal;","void main() {","\tvNormal = normalize( normalMatrix * normal );","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#define RECIPROCAL_PI 0.318309886","vec3 inverseTransformDirection( in vec3 normal, in mat4 matrix ) {","\t// matrix is assumed to be orthogonal","\treturn normalize( ( vec4( normal, 0.0 ) * matrix ).xyz );","}","vec3 linearToOutput( in vec3 a ) {","\t#ifdef GAMMA_OUTPUT","\t\treturn pow( a, vec3( 1.0 / float( GAMMA_FACTOR ) ) );","\t#else","\t\treturn a;","\t#endif","}","// source: https://graphics.stanford.edu/papers/envmap/envmap.pdf","vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {","\t// normal is assumed to have unit length","\tfloat x = normal.x, y = normal.y, z = normal.z;","\t// band 0","\tvec3 result = shCoefficients[ 0 ] * 0.886227;","\t// band 1","\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;","\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;","\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;","\t// band 2","\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;","\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;","\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );","\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;","\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );","\treturn result;","}","uniform vec3 sh[ 9 ]; // sh coefficients","uniform float intensity; // light probe intensity","varying vec3 vNormal;","void main() {","\tvec3 normal = normalize( vNormal );","\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );","\tvec3 irradiance = shGetIrradianceAt( worldNormal, sh );","\tvec3 outgoingLight = RECIPROCAL_PI * irradiance * intensity;","\toutgoingLight = linearToOutput( outgoingLight );","\tgl_FragColor = vec4( outgoingLight, 1.0 );","}"].join("\n")}),i=new Mf(1,32,16);Ma.call(this,i,r),this.onBeforeRender()}function yv(e,t,n,r){e=e||10,t=t||10,n=new Ti(void 0!==n?n:4473924),r=new Ti(void 0!==r?r:8947848);for(var i=t/2,a=e/t,o=e/2,s=[],l=[],u=0,c=0,h=-o;u<=t;u++,h+=a){s.push(-o,0,h,o,0,h),s.push(h,0,-o,h,0,o);var f=u===i?n:r;f.toArray(l,c),c+=3,f.toArray(l,c),c+=3,f.toArray(l,c),c+=3,f.toArray(l,c),c+=3}var d=new ba;d.addAttribute("position",new Vi(s,3)),d.addAttribute("color",new Vi(l,3));var p=new lh({vertexColors:R});ch.call(this,d,p)}function _v(e,t,n,r,i,a){e=e||10,t=t||16,n=n||8,r=r||64,i=new Ti(void 0!==i?i:4473924),a=new Ti(void 0!==a?a:8947848);var o,s,l,u,c,h,f,d=[],p=[];for(u=0;u<=t;u++)l=u/t*(2*Math.PI),o=Math.sin(l)*e,s=Math.cos(l)*e,d.push(0,0,0),d.push(o,0,s),f=1&u?i:a,p.push(f.r,f.g,f.b),p.push(f.r,f.g,f.b);for(u=0;u<=n;u++)for(f=1&u?i:a,h=e-e/n*u,c=0;c<r;c++)l=c/r*(2*Math.PI),o=Math.sin(l)*h,s=Math.cos(l)*h,d.push(o,0,s),p.push(f.r,f.g,f.b),l=(c+1)/r*(2*Math.PI),o=Math.sin(l)*h,s=Math.cos(l)*h,d.push(o,0,s),p.push(f.r,f.g,f.b);var m=new ba;m.addAttribute("position",new Vi(d,3)),m.addAttribute("color",new Vi(p,3));var v=new lh({vertexColors:R});ch.call(this,m,v)}function xv(e,t,n,r){this.audio=e,this.range=t||1,this.divisionsInnerAngle=n||16,this.divisionsOuterAngle=r||2;var i=new ba,a=this.divisionsInnerAngle+2*this.divisionsOuterAngle,o=new Float32Array(3*(3*a+3));i.addAttribute("position",new Ni(o,3));var s=new lh({color:65280}),l=new lh({color:16776960});uh.call(this,i,[l,s]),this.update()}function wv(e,t,n,r){this.object=e,this.size=void 0!==t?t:1;var i=void 0!==n?n:16776960,a=void 0!==r?r:1,o=0,s=this.object.geometry;s&&s.isGeometry?o=s.faces.length:console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");var l=new ba,u=new Vi(2*o*3,3);l.addAttribute("position",u),ch.call(this,l,new lh({color:i,linewidth:a})),this.matrixAutoUpdate=!1,this.update()}function bv(e,t,n){pi.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,void 0===t&&(t=1);var r=new ba;r.addAttribute("position",new Vi([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));var i=new lh({fog:!1});this.lightPlane=new uh(r,i),this.add(this.lightPlane),r=new ba,r.addAttribute("position",new Vi([0,0,0,0,0,1],3)),this.targetLine=new uh(r,i),this.add(this.targetLine),this.update()}function Mv(e){var t=new ba,n=new lh({color:16777215,vertexColors:L}),r=[],i=[],a={},o=new Ti(16755200),s=new Ti(16711680),l=new Ti(43775),u=new Ti(16777215),c=new Ti(3355443);function h(e,t,n){f(e,n),f(t,n)}function f(e,t){r.push(0,0,0),i.push(t.r,t.g,t.b),void 0===a[e]&&(a[e]=[]),a[e].push(r.length/3-1)}h("n1","n2",o),h("n2","n4",o),h("n4","n3",o),h("n3","n1",o),h("f1","f2",o),h("f2","f4",o),h("f4","f3",o),h("f3","f1",o),h("n1","f1",o),h("n2","f2",o),h("n3","f3",o),h("n4","f4",o),h("p","n1",s),h("p","n2",s),h("p","n3",s),h("p","n4",s),h("u1","u2",l),h("u2","u3",l),h("u3","u1",l),h("c","t",u),h("p","c",c),h("cn1","cn2",c),h("cn3","cn4",c),h("cf1","cf2",c),h("cf3","cf4",c),t.addAttribute("position",new Vi(r,3)),t.addAttribute("color",new Vi(i,3)),ch.call(this,t,n),this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=a,this.update()}function Sv(e,t,n,r){zm.set(t,n,r).unproject(Vm);var i=Gm[e];if(void 0!==i)for(var a=Um.getAttribute("position"),o=0,s=i.length;o<s;o++)a.setXYZ(i[o],zm.x,zm.y,zm.z)}function Ev(e,t){this.object=e,void 0===t&&(t=16776960);var n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new Float32Array(24),i=new ba;i.setIndex(new Ni(n,1)),i.addAttribute("position",new Ni(r,3)),ch.call(this,i,new lh({color:t})),this.matrixAutoUpdate=!1,this.update()}function Tv(e,t){this.type="Box3Helper",this.box=e,t=t||16776960;var n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=[1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],i=new ba;i.setIndex(new Ni(n,1)),i.addAttribute("position",new Vi(r,3)),ch.call(this,i,new lh({color:t})),this.geometry.computeBoundingSphere()}function Av(e,t,n){this.type="PlaneHelper",this.plane=e,this.size=void 0===t?1:t;var r=void 0!==n?n:16776960,i=[1,-1,1,-1,1,1,-1,-1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,0,0,1,0,0,0],a=new ba;a.addAttribute("position",new Vi(i,3)),a.computeBoundingSphere(),uh.call(this,a,new lh({color:r}));var o=[1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],s=new ba;s.addAttribute("position",new Vi(o,3)),s.computeBoundingSphere(),this.add(new Ma(s,new Pi({color:r,opacity:.2,transparent:!0,depthWrite:!1})))}function Lv(e,t,n,r,i,a){pi.call(this),void 0===e&&(e=new Pn(0,0,1)),void 0===t&&(t=new Pn(0,0,0)),void 0===n&&(n=1),void 0===r&&(r=16776960),void 0===i&&(i=.2*n),void 0===a&&(a=.2*i),void 0===Wm&&(Wm=new ba,Wm.addAttribute("position",new Vi([0,0,0,0,1,0],3)),jm=new Pf(0,.5,1,5,1),jm.translate(0,-.5,0)),this.position.copy(t),this.line=new uh(Wm,new lh({color:r})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new Ma(jm,new Pi({color:r})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(n,i,a)}function Rv(e){e=e||1;var t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],n=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],r=new ba;r.addAttribute("position",new Vi(t,3)),r.addAttribute("color",new Vi(n,3));var i=new lh({vertexColors:R});ch.call(this,r,i)}function Cv(e,t,n,r,i,a,o){return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),new Ci(e,t,n,i,a,o)}(0,p.default)(Zm.prototype,{getValue:function(e,t){this.bind();var n=this._targetGroup.nCachedObjects_,r=this._bindings[n];void 0!==r&&r.getValue(e,t)},setValue:function(e,t){for(var n=this._bindings,r=this._targetGroup.nCachedObjects_,i=n.length;r!==i;++r)n[r].setValue(e,t)},bind:function(){for(var e=this._bindings,t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()},unbind:function(){for(var e=this._bindings,t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}}),(0,p.default)(Jm,{Composite:Zm,create:function(e,t,n){return e&&e.isAnimationObjectGroup?new Jm.Composite(e,t,n):new Jm(e,t,n)},sanitizeNodeName:(ym=new RegExp("["+Xm+"]","g"),function(e){return e.replace(/\s/g,"_").replace(ym,"")}),parseTrackName:(cm="[^"+Xm+"]",hm="[^"+Xm.replace("\\.","")+"]",fm=/((?:WC+[\/:])*)/.source.replace("WC",cm),dm=/(WCOD+)?/.source.replace("WCOD",hm),pm=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",cm),mm=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",cm),vm=new RegExp("^"+fm+dm+pm+mm+"$"),gm=["material","materials","bones"],function(e){var t=vm.exec(e);if(!t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);var n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},r=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==r&&-1!==r){var i=n.nodeName.substring(r+1);-1!==gm.indexOf(i)&&(n.nodeName=n.nodeName.substring(0,r),n.objectName=i)}if(null===n.propertyName||0===n.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}),findNode:function(e,a){if(!a||""===a||"root"===a||"."===a||-1===a||a===e.name||a===e.uuid)return e;if(e.skeleton){var t=e.skeleton.getBoneByName(a);if(void 0!==t)return t}if(e.children){var n=function e(t){for(var n=0;n<t.length;n++){var r=t[n];if(r.name===a||r.uuid===a)return r;var i=e(r.children);if(i)return i}return null},r=n(e.children);if(r)return r}return null}}),(0,p.default)(Jm.prototype,{_getValue_unavailable:function(){},_setValue_unavailable:function(){},BindingType:{Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Versioning:{None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},GetterByBindingType:[function(e,t){e[t]=this.node[this.propertyName]},function(e,t){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)e[t++]=n[r]},function(e,t){e[t]=this.resolvedProperty[this.propertyIndex]},function(e,t){this.resolvedProperty.toArray(e,t)}],SetterByBindingTypeAndVersioning:[[function(e,t){this.targetObject[this.propertyName]=e[t]},function(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0},function(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=e[t++]},function(e,t){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=e[t++];this.targetObject.needsUpdate=!0},function(e,t){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){this.resolvedProperty[this.propertyIndex]=e[t]},function(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0},function(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){this.resolvedProperty.fromArray(e,t)},function(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0},function(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}]],getValue:function(e,t){this.bind(),this.getValue(e,t)},setValue:function(e,t){this.bind(),this.setValue(e,t)},bind:function(){var e=this.node,t=this.parsedPath,n=t.objectName,r=t.propertyName,i=t.propertyIndex;if(e||(e=Jm.findNode(this.rootNode,t.nodeName)||this.rootNode,this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,e){if(n){var a=t.objectIndex;switch(n){case"materials":if(!e.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!e.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);e=e.material.materials;break;case"bones":if(!e.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);e=e.skeleton.bones;for(var o=0;o<e.length;o++)if(e[o].name===a){a=o;break}break;default:if(void 0===e[n])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);e=e[n]}if(void 0!==a){if(void 0===e[a])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);e=e[a]}}var s=e[r];if(void 0!==s){var l=this.Versioning.None;this.targetObject=e,void 0!==e.needsUpdate?l=this.Versioning.NeedsUpdate:void 0!==e.matrixWorldNeedsUpdate&&(l=this.Versioning.MatrixWorldNeedsUpdate);var u=this.BindingType.Direct;if(void 0!==i){if("morphTargetInfluences"===r){if(!e.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(e.geometry.isBufferGeometry){if(!e.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);for(o=0;o<this.node.geometry.morphAttributes.position.length;o++)if(e.geometry.morphAttributes.position[o].name===i){i=o;break}}else{if(!e.geometry.morphTargets)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphTargets.",this);for(o=0;o<this.node.geometry.morphTargets.length;o++)if(e.geometry.morphTargets[o].name===i){i=o;break}}}u=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=i}else void 0!==s.fromArray&&void 0!==s.toArray?(u=this.BindingType.HasFromToArray,this.resolvedProperty=s):(0,Ue.default)(s)?(u=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=r;this.getValue=this.GetterByBindingType[u],this.setValue=this.SetterByBindingTypeAndVersioning[u][l]}else{var c=t.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+c+"."+r+" but it wasn't found.",e)}}else console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.")},unbind:function(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}),(0,p.default)(Jm.prototype,{_getValue_unbound:Jm.prototype.getValue,_setValue_unbound:Jm.prototype.setValue}),(0,p.default)(Km.prototype,{isAnimationObjectGroup:!0,add:function(){for(var e=this._objects,t=e.length,n=this.nCachedObjects_,r=this._indicesByUUID,i=this._paths,a=this._parsedPaths,o=this._bindings,s=o.length,l=void 0,u=0,c=arguments.length;u!==c;++u){var h=arguments[u],f=h.uuid,d=r[f];if(void 0===d){d=t++,r[f]=d,e.push(h);for(var p=0,m=s;p!==m;++p)o[p].push(new Jm(h,i[p],a[p]))}else if(d<n){l=e[d];var v=--n,g=e[v];for(r[g.uuid]=d,e[d]=g,r[f]=v,e[v]=h,p=0,m=s;p!==m;++p){var y=o[p],_=y[v],x=y[d];y[d]=_,void 0===x&&(x=new Jm(h,i[p],a[p])),y[v]=x}}else e[d]!==l&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=n},remove:function(){for(var e=this._objects,t=this.nCachedObjects_,n=this._indicesByUUID,r=this._bindings,i=r.length,a=0,o=arguments.length;a!==o;++a){var s=arguments[a],l=s.uuid,u=n[l];if(void 0!==u&&t<=u){var c=t++,h=e[c];n[h.uuid]=u,e[u]=h,n[l]=c,e[c]=s;for(var f=0,d=i;f!==d;++f){var p=r[f],m=p[c],v=p[u];p[u]=m,p[c]=v}}}this.nCachedObjects_=t},uncache:function(){for(var e=this._objects,t=e.length,n=this.nCachedObjects_,r=this._indicesByUUID,i=this._bindings,a=i.length,o=0,s=arguments.length;o!==s;++o){var l=arguments[o],u=l.uuid,c=r[u];if(void 0!==c)if(delete r[u],c<n){var h=--n,f=e[h],d=--t,p=e[d];r[f.uuid]=c,e[c]=f,r[p.uuid]=h,e[h]=p,e.pop();for(var m=0,v=a;m!==v;++m){var g=i[m],y=g[h],_=g[d];g[c]=y,g[h]=_,g.pop()}}else for(d=--t,p=e[d],r[p.uuid]=c,e[c]=p,e.pop(),m=0,v=a;m!==v;++m)g=i[m],g[c]=g[d],g.pop()}this.nCachedObjects_=n},subscribe_:function(e,t){var n=this._bindingsIndicesByPath,r=n[e],i=this._bindings;if(void 0!==r)return i[r];var a=this._paths,o=this._parsedPaths,s=this._objects,l=s.length,u=this.nCachedObjects_,c=new Array(l);r=i.length,n[e]=r,a.push(e),o.push(t),i.push(c);for(var h=u,f=s.length;h!==f;++h){var d=s[h];c[h]=new Jm(d,e,t)}return c},unsubscribe_:function(e){var t=this._bindingsIndicesByPath,n=t[e];if(void 0!==n){var r=this._paths,i=this._parsedPaths,a=this._bindings,o=a.length-1,s=a[o],l=e[o];t[l]=n,a[n]=s,a.pop(),i[n]=i[o],i.pop(),r[n]=r[o],r.pop()}}}),(0,p.default)(Qm.prototype,{play:function(){return this._mixer._activateAction(this),this},stop:function(){return this._mixer._deactivateAction(this),this.reset()},reset:function(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()},isRunning:function(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)},isScheduled:function(){return this._mixer._isActiveAction(this)},startAt:function(e){return this._startTime=e,this},setLoop:function(e,t){return this.loop=e,this.repetitions=t,this},setEffectiveWeight:function(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()},getEffectiveWeight:function(){return this._effectiveWeight},fadeIn:function(e){return this._scheduleFading(e,0,1)},fadeOut:function(e){return this._scheduleFading(e,1,0)},crossFadeFrom:function(e,t,n){if(e.fadeOut(t),this.fadeIn(t),n){var r=this._clip.duration,i=e._clip.duration,a=i/r,o=r/i;e.warp(1,a,t),this.warp(o,1,t)}return this},crossFadeTo:function(e,t,n){return e.crossFadeFrom(this,t,n)},stopFading:function(){var e=this._weightInterpolant;return null!==e&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this},setEffectiveTimeScale:function(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()},getEffectiveTimeScale:function(){return this._effectiveTimeScale},setDuration:function(e){return this.timeScale=this._clip.duration/e,this.stopWarping()},syncWith:function(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()},halt:function(e){return this.warp(this._effectiveTimeScale,0,e)},warp:function(e,t,n){var r=this._mixer,i=r.time,a=this._timeScaleInterpolant,o=this.timeScale;null===a&&(a=r._lendControlInterpolant(),this._timeScaleInterpolant=a);var s=a.parameterPositions,l=a.sampleValues;return s[0]=i,s[1]=i+n,l[0]=e/o,l[1]=t/o,this},stopWarping:function(){var e=this._timeScaleInterpolant;return null!==e&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this},getMixer:function(){return this._mixer},getClip:function(){return this._clip},getRoot:function(){return this._localRoot||this._mixer._root},_update:function(e,t,n,r){if(this.enabled){var i=this._startTime;if(null!==i){var a=(e-i)*n;if(a<0||0===n)return;this._startTime=null,t=n*a}t*=this._updateTimeScale(e);var o=this._updateTime(t),s=this._updateWeight(e);if(0<s)for(var l=this._interpolants,u=this._propertyBindings,c=0,h=l.length;c!==h;++c)l[c].evaluate(o),u[c].accumulate(r,s)}else this._updateWeight(e)},_updateWeight:function(e){var t=0;if(this.enabled){t=this.weight;var n=this._weightInterpolant;if(null!==n){var r=n.evaluate(e)[0];t*=r,e>n.parameterPositions[1]&&(this.stopFading(),0===r&&(this.enabled=!1))}}return this._effectiveWeight=t,t},_updateTimeScale:function(e){var t=0;if(!this.paused){t=this.timeScale;var n=this._timeScaleInterpolant;if(null!==n){var r=n.evaluate(e)[0];t*=r,e>n.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t},_updateTime:function(e){var t=this.time+e,n=this._clip.duration,r=this.loop,i=this._loopCount,a=r===Ut;if(0===e)return-1!==i&&a&&1==(1&i)?n-t:t;if(r===Ft){-1===i&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(n<=t)t=n;else{if(!(t<0)){this.time=t;break e}t=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=t,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(-1===i&&(0<=e?(i=0,this._setEndings(!0,0===this.repetitions,a)):this._setEndings(0===this.repetitions,!0,a)),n<=t||t<0){var o=Math.floor(t/n);t-=n*o,i+=Math.abs(o);var s=this.repetitions-i;if(s<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,t=0<e?n:0,this.time=t,this._mixer.dispatchEvent({type:"finished",action:this,direction:0<e?1:-1});else{if(1===s){var l=e<0;this._setEndings(l,!l,a)}else this._setEndings(!1,!1,a);this._loopCount=i,this.time=t,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:o})}}else this.time=t;if(a&&1==(1&i))return n-t}return t},_setEndings:function(e,t,n){var r=this._interpolantSettings;n?(r.endingStart=Wt,r.endingEnd=Wt):(r.endingStart=e?this.zeroSlopeAtStart?Wt:Ht:jt,r.endingEnd=t?this.zeroSlopeAtEnd?Wt:Ht:jt)},_scheduleFading:function(e,t,n){var r=this._mixer,i=r.time,a=this._weightInterpolant;null===a&&(a=r._lendControlInterpolant(),this._weightInterpolant=a);var o=a.parameterPositions,s=a.sampleValues;return o[0]=i,s[0]=t,o[1]=i+e,s[1]=n,this}}),$m.prototype=(0,p.default)((0,l.default)(c.prototype),{constructor:$m,_bindAction:function(e,t){var n=e._localRoot||this._root,r=e._clip.tracks,i=r.length,a=e._propertyBindings,o=e._interpolants,s=n.uuid,l=this._bindingsByRootAndName,u=l[s];void 0===u&&(u={},l[s]=u);for(var c=0;c!==i;++c){var h=r[c],f=h.name,d=u[f];if(void 0!==d)a[c]=d;else{if(d=a[c],void 0!==d){null===d._cacheIndex&&(++d.referenceCount,this._addInactiveBinding(d,s,f));continue}var p=t&&t._propertyBindings[c].binding.parsedPath;d=new um(Jm.create(n,f,p),h.ValueTypeName,h.getValueSize()),++d.referenceCount,this._addInactiveBinding(d,s,f),a[c]=d}o[c].resultBuffer=d.buffer}},_activateAction:function(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){var t=(e._localRoot||this._root).uuid,n=e._clip.uuid,r=this._actionsByClip[n];this._bindAction(e,r&&r.knownActions[0]),this._addInactiveAction(e,n,t)}for(var i=e._propertyBindings,a=0,o=i.length;a!==o;++a){var s=i[a];0==s.useCount++&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}},_deactivateAction:function(e){if(this._isActiveAction(e)){for(var t=e._propertyBindings,n=0,r=t.length;n!==r;++n){var i=t[n];0==--i.useCount&&(i.restoreOriginalState(),this._takeBackBinding(i))}this._takeBackAction(e)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}},_isActiveAction:function(e){var t=e._cacheIndex;return null!==t&&t<this._nActiveActions},_addInactiveAction:function(e,t,n){var r=this._actions,i=this._actionsByClip,a=i[t];if(void 0===a)a={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,i[t]=a;else{var o=a.knownActions;e._byClipCacheIndex=o.length,o.push(e)}e._cacheIndex=r.length,r.push(e),a.actionByRoot[n]=e},_removeInactiveAction:function(e){var t=this._actions,n=t[t.length-1],r=e._cacheIndex;n._cacheIndex=r,t[r]=n,t.pop(),e._cacheIndex=null;var i=e._clip.uuid,a=this._actionsByClip,o=a[i],s=o.knownActions,l=s[s.length-1],u=e._byClipCacheIndex;l._byClipCacheIndex=u,s[u]=l,s.pop(),e._byClipCacheIndex=null;var c=o.actionByRoot,h=(e._localRoot||this._root).uuid;delete c[h],0===s.length&&delete a[i],this._removeInactiveBindingsForAction(e)},_removeInactiveBindingsForAction:function(e){for(var t=e._propertyBindings,n=0,r=t.length;n!==r;++n){var i=t[n];0==--i.referenceCount&&this._removeInactiveBinding(i)}},_lendAction:function(e){var t=this._actions,n=e._cacheIndex,r=this._nActiveActions++,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i},_takeBackAction:function(e){var t=this._actions,n=e._cacheIndex,r=--this._nActiveActions,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i},_addInactiveBinding:function(e,t,n){var r=this._bindingsByRootAndName,i=r[t],a=this._bindings;void 0===i&&(i={},r[t]=i),i[n]=e,e._cacheIndex=a.length,a.push(e)},_removeInactiveBinding:function(e){var t=this._bindings,n=e.binding,r=n.rootNode.uuid,i=n.path,a=this._bindingsByRootAndName,o=a[r],s=t[t.length-1],l=e._cacheIndex;s._cacheIndex=l,t[l]=s,t.pop(),delete o[i],0===(0,m.default)(o).length&&delete a[r]},_lendBinding:function(e){var t=this._bindings,n=e._cacheIndex,r=this._nActiveBindings++,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i},_takeBackBinding:function(e){var t=this._bindings,n=e._cacheIndex,r=--this._nActiveBindings,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i},_lendControlInterpolant:function(){var e=this._controlInterpolants,t=this._nActiveControlInterpolants++,n=e[t];return void 0===n&&(n=new $f(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),n.__cacheIndex=t,e[t]=n),n},_takeBackControlInterpolant:function(e){var t=this._controlInterpolants,n=e.__cacheIndex,r=--this._nActiveControlInterpolants,i=t[r];e.__cacheIndex=r,t[r]=e,i.__cacheIndex=n,t[n]=i},_controlInterpolantsResultBuffer:new Float32Array(1),clipAction:function(e,t){var n=t||this._root,r=n.uuid,i="string"==typeof e?ud.findByName(n,e):e,a=null!==i?i.uuid:e,o=this._actionsByClip[a],s=null;if(void 0!==o){var l=o.actionByRoot[r];if(void 0!==l)return l;s=o.knownActions[0],null===i&&(i=s._clip)}if(null===i)return null;var u=new Qm(this,i,t);return this._bindAction(u,s),this._addInactiveAction(u,a,r),u},existingAction:function(e,t){var n=t||this._root,r=n.uuid,i="string"==typeof e?ud.findByName(n,e):e,a=i?i.uuid:e,o=this._actionsByClip[a];return void 0!==o&&o.actionByRoot[r]||null},stopAllAction:function(){var e=this._actions,t=this._nActiveActions,n=this._bindings,r=this._nActiveBindings;this._nActiveActions=0,this._nActiveBindings=0;for(var i=0;i!==t;++i)e[i].reset();for(i=0;i!==r;++i)n[i].useCount=0;return this},update:function(e){e*=this.timeScale;for(var t=this._actions,n=this._nActiveActions,r=this.time+=e,i=Math.sign(e),a=this._accuIndex^=1,o=0;o!==n;++o){var s=t[o];s._update(r,e,i,a)}var l=this._bindings,u=this._nActiveBindings;for(o=0;o!==u;++o)l[o].apply(a);return this},getRoot:function(){return this._root},uncacheClip:function(e){var t=this._actions,n=e.uuid,r=this._actionsByClip,i=r[n];if(void 0!==i){for(var a=i.knownActions,o=0,s=a.length;o!==s;++o){var l=a[o];this._deactivateAction(l);var u=l._cacheIndex,c=t[t.length-1];l._cacheIndex=null,l._byClipCacheIndex=null,c._cacheIndex=u,t[u]=c,t.pop(),this._removeInactiveBindingsForAction(l)}delete r[n]}},uncacheRoot:function(e){var t=e.uuid,n=this._actionsByClip;for(var r in n){var i=n[r].actionByRoot,a=i[t];void 0!==a&&(this._deactivateAction(a),this._removeInactiveAction(a))}var o=this._bindingsByRootAndName,s=o[t];if(void 0!==s)for(var l in s){var u=s[l];u.restoreOriginalState(),this._removeInactiveBinding(u)}},uncacheAction:function(e,t){var n=this.existingAction(e,t);null!==n&&(this._deactivateAction(n),this._removeInactiveAction(n))}}),ev.prototype.clone=function(){return new ev(void 0===this.value.clone?this.value:this.value.clone())},tv.prototype=(0,p.default)((0,l.default)($c.prototype),{constructor:tv,isInstancedInterleavedBuffer:!0,copy:function(e){return $c.prototype.copy.call(this,e),this.meshPerAttribute=e.meshPerAttribute,this}}),(0,p.default)(nv.prototype,{linePrecision:1,set:function(e,t){this.ray.set(e,t)},setFromCamera:function(e,t){t&&t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this._camera=t):t&&t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this._camera=t):console.error("THREE.Raycaster: Unsupported camera type.")},intersectObject:function(e,t,n){var r=n||[];return iv(e,this,r,t),r.sort(rv),r},intersectObjects:function(e,t,n){var r=n||[];if(!1===(0,Ue.default)(e))return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),r;for(var i=0,a=e.length;i<a;i++)iv(e[i],this,r,t);return r.sort(rv),r}}),(0,p.default)(av.prototype,{set:function(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this},makeSafe:function(){var e=1e-6;return this.phi=Math.max(e,Math.min(Math.PI-e,this.phi)),this},setFromVector3:function(e){return this.setFromCartesianCoords(e.x,e.y,e.z)},setFromCartesianCoords:function(e,t,n){return this.radius=Math.sqrt(e*e+t*t+n*n),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,n),this.phi=Math.acos(Cn.clamp(t/this.radius,-1,1))),this}}),(0,p.default)(ov.prototype,{set:function(e,t,n){return this.radius=e,this.theta=t,this.y=n,this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.radius=e.radius,this.theta=e.theta,this.y=e.y,this},setFromVector3:function(e){return this.setFromCartesianCoords(e.x,e.y,e.z)},setFromCartesianCoords:function(e,t,n){return this.radius=Math.sqrt(e*e+n*n),this.theta=Math.atan2(e,n),this.y=t,this}}),(0,p.default)(sv.prototype,{set:function(e,t){return this.min.copy(e),this.max.copy(t),this},setFromPoints:function(e){this.makeEmpty();for(var t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this},setFromCenterAndSize:(xm=new In,function(e,t){var n=xm.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}),clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.min.copy(e.min),this.max.copy(e.max),this},makeEmpty:function(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y},getCenter:function(e){return void 0===e&&(console.warn("THREE.Box2: .getCenter() target is now required"),e=new In),this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(e){return void 0===e&&(console.warn("THREE.Box2: .getSize() target is now required"),e=new In),this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)},expandByPoint:function(e){return this.min.min(e),this.max.max(e),this},expandByVector:function(e){return this.min.sub(e),this.max.add(e),this},expandByScalar:function(e){return this.min.addScalar(-e),this.max.addScalar(e),this},containsPoint:function(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y)},containsBox:function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y},getParameter:function(e,t){return void 0===t&&(console.warn("THREE.Box2: .getParameter() target is now required"),t=new In),t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y)},clampPoint:function(e,t){return void 0===t&&(console.warn("THREE.Box2: .clampPoint() target is now required"),t=new In),t.copy(e).clamp(this.min,this.max)},distanceToPoint:(_m=new In,function(e){var t=_m.copy(e).clamp(this.min,this.max);return t.sub(e).length()}),intersect:function(e){return this.min.max(e.min),this.max.min(e.max),this},union:function(e){return this.min.min(e.min),this.max.max(e.max),this},translate:function(e){return this.min.add(e),this.max.add(e),this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}),(0,p.default)(lv.prototype,{set:function(e,t){return this.start.copy(e),this.end.copy(t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.start.copy(e.start),this.end.copy(e.end),this},getCenter:function(e){return void 0===e&&(console.warn("THREE.Line3: .getCenter() target is now required"),e=new Pn),e.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(e){return void 0===e&&(console.warn("THREE.Line3: .delta() target is now required"),e=new Pn),e.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(e,t){return void 0===t&&(console.warn("THREE.Line3: .at() target is now required"),t=new Pn),this.delta(t).multiplyScalar(e).add(this.start)},closestPointToPointParameter:function(e,t){void 0===wm&&(wm=new Pn,bm=new Pn),wm.subVectors(e,this.start),bm.subVectors(this.end,this.start);var n=bm.dot(bm),r=bm.dot(wm),i=r/n;return t&&(i=Cn.clamp(i,0,1)),i},closestPointToPoint:function(e,t,n){var r=this.closestPointToPointParameter(e,t);return void 0===n&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),n=new Pn),this.delta(n).multiplyScalar(r).add(this.start)},applyMatrix4:function(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this},equals:function(e){return e.start.equals(this.start)&&e.end.equals(this.end)}}),uv.prototype=(0,l.default)(pi.prototype),uv.prototype.constructor=uv,uv.prototype.isImmediateRenderObject=!0,cv.prototype=(0,l.default)(ch.prototype),cv.prototype.constructor=cv,cv.prototype.update=(Mm=new Pn,Sm=new Pn,Em=new Nn,function(){var e=["a","b","c"];this.object.updateMatrixWorld(!0),Em.getNormalMatrix(this.object.matrixWorld);var t=this.object.matrixWorld,n=this.geometry.attributes.position,r=this.object.geometry;if(r&&r.isGeometry)for(var i=r.vertices,a=r.faces,o=0,s=0,l=a.length;s<l;s++)for(var u=a[s],c=0,h=u.vertexNormals.length;c<h;c++){var f=i[u[e[c]]],d=u.vertexNormals[c];Mm.copy(f).applyMatrix4(t),Sm.copy(d).applyMatrix3(Em).normalize().multiplyScalar(this.size).add(Mm),n.setXYZ(o,Mm.x,Mm.y,Mm.z),o+=1,n.setXYZ(o,Sm.x,Sm.y,Sm.z),o+=1}else if(r&&r.isBufferGeometry){var p=r.attributes.position,m=r.attributes.normal;for(o=0,c=0,h=p.count;c<h;c++)Mm.set(p.getX(c),p.getY(c),p.getZ(c)).applyMatrix4(t),Sm.set(m.getX(c),m.getY(c),m.getZ(c)),Sm.applyMatrix3(Em).normalize().multiplyScalar(this.size).add(Mm),n.setXYZ(o,Mm.x,Mm.y,Mm.z),o+=1,n.setXYZ(o,Sm.x,Sm.y,Sm.z),o+=1}n.needsUpdate=!0}),hv.prototype=(0,l.default)(pi.prototype),hv.prototype.constructor=hv,hv.prototype.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},hv.prototype.update=(Tm=new Pn,function(){this.light.updateMatrixWorld();var e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),Tm.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(Tm),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}),dv.prototype=(0,l.default)(ch.prototype),dv.prototype.constructor=dv,dv.prototype.updateMatrixWorld=(Am=new Pn,Lm=new Qn,Rm=new Qn,function(e){var t=this.bones,n=this.geometry,r=n.getAttribute("position");Rm.getInverse(this.root.matrixWorld);for(var i=0,a=0;i<t.length;i++){var o=t[i];o.parent&&o.parent.isBone&&(Lm.multiplyMatrices(Rm,o.matrixWorld),Am.setFromMatrixPosition(Lm),r.setXYZ(a,Am.x,Am.y,Am.z),Lm.multiplyMatrices(Rm,o.parent.matrixWorld),Am.setFromMatrixPosition(Lm),r.setXYZ(a+1,Am.x,Am.y,Am.z),a+=2)}n.getAttribute("position").needsUpdate=!0,pi.prototype.updateMatrixWorld.call(this,e)}),pv.prototype=(0,l.default)(Ma.prototype),pv.prototype.constructor=pv,pv.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},pv.prototype.update=function(){void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)},mv.prototype=(0,l.default)(uh.prototype),mv.prototype.constructor=mv,mv.prototype.update=function(){if(this.scale.set(.5*this.light.width,.5*this.light.height,1),void 0!==this.color)this.material.color.set(this.color),this.children[0].material.color.set(this.color);else{this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity);var e=this.material.color,t=Math.max(e.r,e.g,e.b);1<t&&e.multiplyScalar(1/t),this.children[0].material.color.copy(this.material.color)}},mv.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()},vv.prototype=(0,l.default)(pi.prototype),vv.prototype.constructor=vv,vv.prototype.dispose=function(){this.children[0].geometry.dispose(),this.children[0].material.dispose()},vv.prototype.update=(Cm=new Pn,Im=new Ti,km=new Ti,function(){var e=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{var t=e.geometry.getAttribute("color");Im.copy(this.light.color),km.copy(this.light.groundColor);for(var n=0,r=t.count;n<r;n++){var i=n<r/2?Im:km;t.setXYZ(n,i.r,i.g,i.b)}t.needsUpdate=!0}e.lookAt(Cm.setFromMatrixPosition(this.light.matrixWorld).negate())}),gv.prototype=(0,l.default)(Ma.prototype),gv.prototype.constructor=gv,gv.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},gv.prototype.onBeforeRender=function(){this.position.copy(this.lightProbe.position),this.scale.set(1,1,1).multiplyScalar(this.size),this.material.uniforms.intensity.value=this.lightProbe.intensity},yv.prototype=(0,p.default)((0,l.default)(ch.prototype),{constructor:yv,copy:function(e){return ch.prototype.copy.call(this,e),this.geometry.copy(e.geometry),this.material.copy(e.material),this},clone:function(){return(new this.constructor).copy(this)}}),_v.prototype=(0,l.default)(ch.prototype),_v.prototype.constructor=_v,xv.prototype=(0,l.default)(uh.prototype),xv.prototype.constructor=xv,xv.prototype.update=function(){var a,o,e=this.audio,s=this.range,t=this.divisionsInnerAngle,n=this.divisionsOuterAngle,r=Cn.degToRad(e.panner.coneInnerAngle),i=Cn.degToRad(e.panner.coneOuterAngle),l=r/2,u=i/2,c=0,h=0,f=this.geometry,d=f.attributes.position;function p(e,t,n,r){var i=(t-e)/n;for(d.setXYZ(c,0,0,0),h++,a=e;a<t;a+=i)o=c+h,d.setXYZ(o,Math.sin(a)*s,0,Math.cos(a)*s),d.setXYZ(o+1,Math.sin(Math.min(a+i,t))*s,0,Math.cos(Math.min(a+i,t))*s),d.setXYZ(o+2,0,0,0),h+=3;f.addGroup(c,h,r),c+=h,h=0}f.clearGroups(),p(-u,-l,n,0),p(-l,l,t,1),p(l,u,n,0),d.needsUpdate=!0,r===i&&(this.material[0].visible=!1)},xv.prototype.dispose=function(){this.geometry.dispose(),this.material[0].dispose(),this.material[1].dispose()},wv.prototype=(0,l.default)(ch.prototype),wv.prototype.constructor=wv,wv.prototype.update=(Pm=new Pn,Nm=new Pn,Dm=new Nn,function(){this.object.updateMatrixWorld(!0),Dm.getNormalMatrix(this.object.matrixWorld);for(var e=this.object.matrixWorld,t=this.geometry.attributes.position,n=this.object.geometry,r=n.vertices,i=n.faces,a=0,o=0,s=i.length;o<s;o++){var l=i[o],u=l.normal;Pm.copy(r[l.a]).add(r[l.b]).add(r[l.c]).divideScalar(3).applyMatrix4(e),Nm.copy(u).applyMatrix3(Dm).normalize().multiplyScalar(this.size).add(Pm),t.setXYZ(a,Pm.x,Pm.y,Pm.z),a+=1,t.setXYZ(a,Nm.x,Nm.y,Nm.z),a+=1}t.needsUpdate=!0}),bv.prototype=(0,l.default)(pi.prototype),bv.prototype.constructor=bv,bv.prototype.dispose=function(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()},bv.prototype.update=(Om=new Pn,Fm=new Pn,Bm=new Pn,function(){Om.setFromMatrixPosition(this.light.matrixWorld),Fm.setFromMatrixPosition(this.light.target.matrixWorld),Bm.subVectors(Fm,Om),this.lightPlane.lookAt(Fm),void 0!==this.color?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(Fm),this.targetLine.scale.z=Bm.length()}),Mv.prototype=(0,l.default)(ch.prototype),Mv.prototype.constructor=Mv,Mv.prototype.update=(zm=new Pn,Vm=new Ha,function(){Um=this.geometry,Gm=this.pointMap;var e=1,t=1;Vm.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),Sv("c",0,0,-1),Sv("t",0,0,1),Sv("n1",-e,-t,-1),Sv("n2",e,-t,-1),Sv("n3",-e,t,-1),Sv("n4",e,t,-1),Sv("f1",-e,-t,1),Sv("f2",e,-t,1),Sv("f3",-e,t,1),Sv("f4",e,t,1),Sv("u1",.7*e,1.1*t,-1),Sv("u2",.7*-e,1.1*t,-1),Sv("u3",0,2*t,-1),Sv("cf1",-e,0,1),Sv("cf2",e,0,1),Sv("cf3",0,-t,1),Sv("cf4",0,t,1),Sv("cn1",-e,0,-1),Sv("cn2",e,0,-1),Sv("cn3",0,-t,-1),Sv("cn4",0,t,-1),Um.getAttribute("position").needsUpdate=!0}),Ev.prototype=(0,l.default)(ch.prototype),Ev.prototype.constructor=Ev,Ev.prototype.update=(Hm=new vi,function(e){if(void 0!==e&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&Hm.setFromObject(this.object),!Hm.isEmpty()){var t=Hm.min,n=Hm.max,r=this.geometry.attributes.position,i=r.array;i[0]=n.x,i[1]=n.y,i[2]=n.z,i[3]=t.x,i[4]=n.y,i[5]=n.z,i[6]=t.x,i[7]=t.y,i[8]=n.z,i[9]=n.x,i[10]=t.y,i[11]=n.z,i[12]=n.x,i[13]=n.y,i[14]=t.z,i[15]=t.x,i[16]=n.y,i[17]=t.z,i[18]=t.x,i[19]=t.y,i[20]=t.z,i[21]=n.x,i[22]=t.y,i[23]=t.z,r.needsUpdate=!0,this.geometry.computeBoundingSphere()}}),Ev.prototype.setFromObject=function(e){return this.object=e,this.update(),this},Ev.prototype.copy=function(e){return ch.prototype.copy.call(this,e),this.object=e.object,this},Ev.prototype.clone=function(){return(new this.constructor).copy(this)},Tv.prototype=(0,l.default)(ch.prototype),Tv.prototype.constructor=Tv,Tv.prototype.updateMatrixWorld=function(e){var t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),pi.prototype.updateMatrixWorld.call(this,e))},Av.prototype=(0,l.default)(uh.prototype),Av.prototype.constructor=Av,Av.prototype.updateMatrixWorld=function(e){var t=-this.plane.constant;Math.abs(t)<1e-8&&(t=1e-8),this.scale.set(.5*this.size,.5*this.size,t),this.children[0].material.side=t<0?Ge:B,this.lookAt(this.plane.normal),pi.prototype.updateMatrixWorld.call(this,e)},Lv.prototype=(0,l.default)(pi.prototype),Lv.prototype.constructor=Lv,Lv.prototype.setDirection=(qm=new Pn,function(e){.99999<e.y?this.quaternion.set(0,0,0,1):e.y<-.99999?this.quaternion.set(1,0,0,0):(qm.set(e.z,0,-e.x).normalize(),Ym=Math.acos(e.y),this.quaternion.setFromAxisAngle(qm,Ym))}),Lv.prototype.setLength=function(e,t,n){void 0===t&&(t=.2*e),void 0===n&&(n=.2*t),this.line.scale.set(1,Math.max(0,e-t),1),this.line.updateMatrix(),this.cone.scale.set(n,t,n),this.cone.position.y=e,this.cone.updateMatrix()},Lv.prototype.setColor=function(e){this.line.material.color.set(e),this.cone.material.color.set(e)},Lv.prototype.copy=function(e){return pi.prototype.copy.call(this,e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this},Lv.prototype.clone=function(){return(new this.constructor).copy(this)},Rv.prototype=(0,l.default)(ch.prototype),Rv.prototype.constructor=Rv;var Iv=0;t.LineStrip=Iv;var kv,Pv=1;function Nv(e){return console.warn("THREE.MeshFaceMaterial has been removed. Use an Array instead."),e}function Dv(e){return void 0===e&&(e=[]),console.warn("THREE.MultiMaterial has been removed. Use an Array instead."),e.isMultiMaterial=!0,e.materials=e,e.clone=function(){return e.slice()},e}function Ov(e,t){return console.warn("THREE.PointCloud has been renamed to THREE.Points."),new dh(e,t)}function Fv(e){return console.warn("THREE.Particle has been renamed to THREE.Sprite."),new nh(e)}function Bv(e,t){return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),new dh(e,t)}function Uv(e){return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),new fh(e)}function Gv(e){return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),new fh(e)}function zv(e){return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),new fh(e)}function Vv(e,t,n){return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),new Pn(e,t,n)}function Hv(e,t){return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),new Ni(e,t).setDynamic(!0)}function Wv(e,t){return console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead."),new Di(e,t)}function jv(e,t){return console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead."),new Oi(e,t)}function Yv(e,t){return console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead."),new Fi(e,t)}function qv(e,t){return console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead."),new Bi(e,t)}function Xv(e,t){return console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead."),new Ui(e,t)}function Zv(e,t){return console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead."),new Gi(e,t)}function Jv(e,t){return console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead."),new zi(e,t)}function Kv(e,t){return console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead."),new Vi(e,t)}function Qv(e,t){return console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead."),new Hi(e,t)}function $v(e){console.warn("THREE.ClosedSplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),Id.call(this,e),this.type="catmullrom",this.closed=!0}function eg(e){console.warn("THREE.SplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),Id.call(this,e),this.type="catmullrom"}function tg(e){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead."),Id.call(this,e),this.type="catmullrom"}function ng(e){return console.warn("THREE.AxisHelper has been renamed to THREE.AxesHelper."),new Rv(e)}function rg(e,t){return console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead."),new Ev(e,t)}function ig(e,t){return console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead."),new ch(new If(e.geometry),new lh({color:void 0!==t?t:16777215}))}function ag(e,t){return console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead."),new ch(new yh(e.geometry),new lh({color:void 0!==t?t:16777215}))}function og(e){return console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader."),new vd(e)}function sg(e){return console.warn("THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader."),new _d(e)}t.LinePieces=Pv,Md.create=function(e,t){return e.prototype=(0,l.default)(Md.prototype),e.prototype.constructor=e,e.prototype.getPoint=t,e},(0,p.default)(Jd.prototype,{createPointsGeometry:function(e){console.warn("THREE.CurvePath: .createPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var t=this.getPoints(e);return this.createGeometry(t)},createSpacedPointsGeometry:function(e){console.warn("THREE.CurvePath: .createSpacedPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var t=this.getSpacedPoints(e);return this.createGeometry(t)},createGeometry:function(e){console.warn("THREE.CurvePath: .createGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");for(var t=new Na,n=0,r=e.length;n<r;n++){var i=e[n];t.vertices.push(new Pn(i.x,i.y,i.z||0))}return t}}),(0,p.default)(Kd.prototype,{fromPoints:function(e){console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(e)}}),$v.prototype=(0,l.default)(Id.prototype),eg.prototype=(0,l.default)(Id.prototype),tg.prototype=(0,l.default)(Id.prototype),(0,p.default)(tg.prototype,{initFromArray:function(){console.error("THREE.Spline: .initFromArray() has been removed.")},getControlPointsArray:function(){console.error("THREE.Spline: .getControlPointsArray() has been removed.")},reparametrizeByArcLength:function(){console.error("THREE.Spline: .reparametrizeByArcLength() has been removed.")}}),yv.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},dv.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")},(0,p.default)(Ip.prototype,{extractUrlBase:function(e){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),hp.extractUrlBase(e)}}),(0,p.default)(vp.prototype,{setTexturePath:function(e){return console.warn("THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath()."),this.setResourcePath(e)}}),(0,p.default)(sv.prototype,{center:function(e){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(e)},empty:function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(e){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},size:function(e){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(e)}}),(0,p.default)(vi.prototype,{center:function(e){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(e)},empty:function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(e){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},isIntersectionSphere:function(e){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)},size:function(e){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(e)}}),lv.prototype.center=function(e){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(e)},(0,p.default)(Cn,{random16:function(){return console.warn("THREE.Math: .random16() has been deprecated. Use Math.random() instead."),Math.random()},nearestPowerOfTwo:function(e){return console.warn("THREE.Math: .nearestPowerOfTwo() has been renamed to .floorPowerOfTwo()."),Cn.floorPowerOfTwo(e)},nextPowerOfTwo:function(e){return console.warn("THREE.Math: .nextPowerOfTwo() has been renamed to .ceilPowerOfTwo()."),Cn.ceilPowerOfTwo(e)}}),(0,p.default)(Nn.prototype,{flattenToArrayOffset:function(e,t){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},multiplyVector3:function(e){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},multiplyVector3Array:function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},applyToBuffer:function(e){return console.warn("THREE.Matrix3: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead."),this.applyToBufferAttribute(e)},applyToVector3Array:function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")}}),(0,p.default)(Qn.prototype,{extractPosition:function(e){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(e)},flattenToArrayOffset:function(e,t){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},getPosition:function(){return void 0===kv&&(kv=new Pn),console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),kv.setFromMatrixColumn(this,3)},setRotationFromQuaternion:function(e){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(e)},multiplyToArray:function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},multiplyVector3:function(e){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},multiplyVector4:function(e){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},multiplyVector3Array:function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},rotateAxis:function(e){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),e.transformDirection(this)},crossVector:function(e){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},translate:function(){console.error("THREE.Matrix4: .translate() has been removed.")},rotateX:function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},applyToBuffer:function(e){return console.warn("THREE.Matrix4: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead."),this.applyToBufferAttribute(e)},applyToVector3Array:function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},makeFrustum:function(e,t,n,r,i,a){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(e,t,r,n,i,a)}}),io.prototype.isIntersectionLine=function(e){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(e)},kn.prototype.multiplyVector3=function(e){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),e.applyQuaternion(this)},(0,p.default)(xi.prototype,{isIntersectionBox:function(e){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},isIntersectionPlane:function(e){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(e)},isIntersectionSphere:function(e){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)}}),(0,p.default)(wi.prototype,{area:function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},barycoordFromPoint:function(e,t){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(e,t)},midpoint:function(e){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(e)},normal:function(e){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(e)},plane:function(e){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(e)}}),(0,p.default)(wi,{barycoordFromPoint:function(e,t,n,r,i){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),wi.getBarycoord(e,t,n,r,i)},normal:function(e,t,n,r){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),wi.getNormal(e,t,n,r)}}),(0,p.default)(Qd.prototype,{extractAllPoints:function(e){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(e)},extrude:function(e){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new vf(this,e)},makeGeometry:function(e){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new Lf(this,e)}}),(0,p.default)(In.prototype,{fromAttribute:function(e,t,n){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},distanceToManhattan:function(e){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},lengthManhattan:function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),(0,p.default)(Pn.prototype,{setEulerFromRotationMatrix:function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(e){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(e)},getScaleFromMatrix:function(e){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(e)},getColumnFromMatrix:function(e,t){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(t,e)},applyProjection:function(e){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(e)},fromAttribute:function(e,t,n){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},distanceToManhattan:function(e){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},lengthManhattan:function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),(0,p.default)(Zn.prototype,{fromAttribute:function(e,t,n){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},lengthManhattan:function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),(0,p.default)(Na.prototype,{computeTangents:function(){console.error("THREE.Geometry: .computeTangents() has been removed.")},computeLineDistances:function(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")}}),(0,p.default)(pi.prototype,{getChildByName:function(e){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(e)},renderDepth:function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},translate:function(e,t){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(t,e)},getWorldRotation:function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")}}),(0,u.default)(pi.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(e){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=e}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),(0,u.default)(ih.prototype,{objects:{get:function(){return console.warn("THREE.LOD: .objects has been renamed to .levels."),this.levels}}}),(0,g.default)(oh.prototype,"useVertexTexture",{get:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")},set:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")}}),ah.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},(0,g.default)(Md.prototype,"__arcLengthDivisions",{get:function(){return console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions},set:function(e){console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions=e}}),Wa.prototype.setLens=function(e,t){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==t&&(this.filmGauge=t),this.setFocalLength(e)},(0,u.default)($d.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(e){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=e}},shadowCameraLeft:{set:function(e){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=e}},shadowCameraRight:{set:function(e){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=e}},shadowCameraTop:{set:function(e){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=e}},shadowCameraBottom:{set:function(e){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=e}},shadowCameraNear:{set:function(e){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=e}},shadowCameraFar:{set:function(e){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=e}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(e){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=e}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(e){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=e}},shadowMapHeight:{set:function(e){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=e}}}),(0,u.default)(Ni.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},copyIndicesArray:function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")}}),(0,p.default)(ba.prototype,{addIndex:function(e){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(e)},addDrawCall:function(e,t,n){void 0!==n&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(e,t)},clearDrawCalls:function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},computeTangents:function(){console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")},computeOffsets:function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")}}),(0,u.default)(ba.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}}),(0,p.default)(gf.prototype,{getArrays:function(){console.error("THREE.ExtrudeBufferGeometry: .getArrays() has been removed.")},addShapeList:function(){console.error("THREE.ExtrudeBufferGeometry: .addShapeList() has been removed.")},addShape:function(){console.error("THREE.ExtrudeBufferGeometry: .addShape() has been removed.")}}),(0,u.default)(ev.prototype,{dynamic:{set:function(){console.warn("THREE.Uniform: .dynamic has been removed. Use object.onBeforeRender() instead.")}},onUpdate:{value:function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this}}}),(0,u.default)(ki.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")},set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},overdraw:{get:function(){console.warn("THREE.Material: .overdraw has been removed.")},set:function(){console.warn("THREE.Material: .overdraw has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new Ti}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(e){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=e===E}}}),(0,u.default)(Hf.prototype,{metal:{get:function(){return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),!1},set:function(){console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")}}}),(0,u.default)(Va.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(e){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=e}}}),(0,p.default)(Jc.prototype,{clearTarget:function(e,t,n,r){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(e),this.clear(t,n,r)},animate:function(e){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(e)},getCurrentRenderTarget:function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},getMaxAnisotropy:function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},getPrecision:function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},resetGLState:function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},supportsFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},supportsHalfFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},supportsStandardDerivatives:function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},supportsCompressedTextureS3TC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},supportsCompressedTexturePVRTC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},supportsBlendMinMax:function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},supportsVertexTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},supportsInstancedArrays:function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},enableScissorTest:function(e){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(e)},initMaterial:function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},addPrePlugin:function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},addPostPlugin:function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},updateShadowMap:function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},setFaceCulling:function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")},allocTextureUnit:function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")},setTexture:function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")},setTexture2D:function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")},setTextureCube:function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")},getActiveMipMapLevel:function(){return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."),this.getActiveMipmapLevel()}}),(0,u.default)(Jc.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=e}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=e}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}},context:{get:function(){return console.warn("THREE.WebGLRenderer: .context has been removed. Use .getContext() instead."),this.getContext()}}}),(0,u.default)(hc.prototype,{cullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},renderReverseSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},renderSingleSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}}),(0,u.default)(no.prototype,{activeCubeFace:{set:function(){console.warn("THREE.WebGLRenderTargetCube: .activeCubeFace has been removed. It is now the second parameter of WebGLRenderer.setRenderTarget().")}},activeMipMapLevel:{set:function(){console.warn("THREE.WebGLRenderTargetCube: .activeMipMapLevel has been removed. It is now the third parameter of WebGLRenderer.setRenderTarget().")}}}),(0,u.default)(Jn.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=e}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=e}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=e}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=e}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(e){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=e}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(e){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=e}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(e){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=e}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(e){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=e}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(e){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=e}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(e){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=e}}}),(0,u.default)(Xc.prototype,{standing:{set:function(){console.warn("THREE.WebVRManager: .standing has been removed.")}},userHeight:{set:function(){console.warn("THREE.WebVRManager: .userHeight has been removed.")}}}),om.prototype.load=function(e){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");var t=this,n=new Qp;return n.load(e,function(e){t.setBuffer(e)}),this},lm.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()},to.prototype.updateCubeMap=function(e,t){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(e,t)};var lg={merge:function(e,t,n){var r;console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead."),t.isMesh&&(t.matrixAutoUpdate&&t.updateMatrix(),r=t.matrix,t=t.geometry),e.merge(t,r,n)},center:function(e){return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),e.center()}};function ug(){console.error("THREE.CanvasRenderer has been removed")}function cg(){console.error("THREE.JSONLoader has been removed.")}t.GeometryUtils=lg,Dn.crossOrigin=void 0,Dn.loadTexture=function(e,t,n,r){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");var i=new bd;i.setCrossOrigin(this.crossOrigin);var a=i.load(e,n,void 0,r);return t&&(a.mapping=t),a},Dn.loadTextureCube=function(e,t,n,r){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");var i=new wd;i.setCrossOrigin(this.crossOrigin);var a=i.load(e,n,void 0,r);return t&&(a.mapping=t),a},Dn.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},Dn.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")};var hg={createMultiMaterialObject:function(){console.error("THREE.SceneUtils has been moved to /examples/js/utils/SceneUtils.js")},detach:function(){console.error("THREE.SceneUtils has been moved to /examples/js/utils/SceneUtils.js")},attach:function(){console.error("THREE.SceneUtils has been moved to /examples/js/utils/SceneUtils.js")}};function fg(){console.error("THREE.LensFlare has been moved to /examples/js/objects/Lensflare.js")}t.SceneUtils=hg},function(e,t,n){var r=n(28),a=n(155),i=n(38).f,o=n(91).f,s=n(120),l=n(95),u=r.RegExp,c=u,h=u.prototype,f=/a/g,d=/a/g,p=new u(f)!==f;if(n(26)&&(!p||n(23)(function(){return d[n(20)("match")]=!1,u(f)!=f||u(d)==d||"/a/i"!=u(f,"i")}))){u=function(e,t){var n=this instanceof u,r=s(e),i=void 0===t;return!n&&r&&e.constructor===u&&i?e:a(p?new c(r&&!i?e.source:e,t):c((r=e instanceof u)?e.source:e,r&&i?l.call(e):t),n?this:h,u)};for(var m=function(t){t in u||i(u,t,{configurable:!0,get:function(){return c[t]},set:function(e){c[t]=e}})},v=o(c),g=0;v.length>g;)m(v[g++]);h.constructor=u,u.prototype=h,n(43)(r,"RegExp",u)}n(161)("RegExp")},function(e,t,i){var n=i(42),r=i(36),a=function(e,t){if(r(e),!n(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,n,r){try{r=i(88)(Function.call,i(115).f(Object.prototype,"__proto__").set,2),r(e,[]),n=!(e instanceof Array)}catch(e){n=!0}return function(e,t){return a(e,t),n?e.__proto__=t:r(e,t),e}}({},!1):void 0),check:a}},function(e,t,n){e.exports=n(118)("native-function-to-string",Function.toString)},function(e,t,n){n(59),n(257),e.exports=n(11).Array.from},function(e,t,n){var l=n(121),u=n(96);e.exports=function(s){return function(e,t){var n,r,i=String(u(e)),a=l(t),o=i.length;return a<0||o<=a?s?"":void 0:(n=i.charCodeAt(a),n<55296||56319<n||a+1===o||(r=i.charCodeAt(a+1))<56320||57343<r?s?i.charAt(a):n:s?i.slice(a,a+2):r-56320+(n-55296<<10)+65536)}}},function(e,t,n){"use strict";var r=n(80),i=n(75),a=n(83),o={};n(48)(o,n(24)("iterator"),function(){return this}),e.exports=function(e,t,n){e.prototype=r(o,{next:i(1,n)}),a(e,t+" Iterator")}},function(e,t,n){var l=n(61),u=n(97),c=n(256);e.exports=function(s){return function(e,t,n){var r,i=l(e),a=u(i.length),o=c(n,a);if(s&&t!=t){for(;o<a;)if(r=i[o++],r!=r)return!0}else for(;o<a;o++)if((s||o in i)&&i[o]===t)return s||o||0;return!s&&-1}}},function(e,t,n){var r=n(121),i=Math.max,a=Math.min;e.exports=function(e,t){return e=r(e),e<0?i(e+t,0):a(e,t)}},function(e,t,n){"use strict";var p=n(40),r=n(14),m=n(54),v=n(166),g=n(167),y=n(97),_=n(258),x=n(128);r(r.S+r.F*!n(168)(function(e){Array.from(e)}),"Array",{from:function(e,t,n){var r,i,a,o,s=m(e),l="function"==typeof this?this:Array,u=arguments.length,c=1<u?t:void 0,h=void 0!==c,f=0,d=x(s);if(h&&(c=p(c,2<u?n:void 0,2)),null==d||l==Array&&g(d))for(r=y(s.length),i=new l(r);f<r;f++)_(i,f,h?c(s[f],f):s[f]);else for(o=d.call(s),i=new l;!(a=o.next()).done;f++)_(i,f,h?v(o,c,[a.value,f],!0):a.value);return i.length=f,i}})},function(e,t,n){"use strict";var r=n(35),i=n(75);e.exports=function(e,t,n){t in e?r.f(e,t,i(0,n)):e[t]=n}},function(e){e.exports=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}},function(e,t,n){"use strict";var r=n(129);n(27)({target:"RegExp",proto:!0,forced:r!==/./.exec},{exec:r})},function(e){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,n){"use strict";var r=n(130),i=n(89),a=n(132),o={};n(39)(o,n(20)("iterator"),function(){return this}),e.exports=function(e,t,n){e.prototype=r(o,{next:i(1,n)}),a(e,t+" Iterator")}},function(e,t,n){var o=n(38),s=n(36),l=n(131);e.exports=n(26)?Object.defineProperties:function(e,t){s(e);for(var n,r=l(t),i=r.length,a=0;a<i;)o.f(e,n=r[a++],t[n]);return e}},function(e,t,n){var r=n(28).document;e.exports=r&&r.documentElement},function(e,t,n){e.exports=n(266)},function(e,t,n){n(267),e.exports=n(11).Object.freeze},function(e,t,n){var r=n(22),i=n(64).onFreeze;n(133)("freeze",function(t){return function(e){return t&&r(e)?t(i(e)):e}})},function(e,t,n){n(59),n(65),e.exports=n(134).f("iterator")},function(e,t,n){"use strict";var r=n(270),i=n(173),a=n(60),o=n(61);e.exports=n(122)(Array,"Array",function(e,t){this._t=o(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,i(1)):i(0,"keys"==t?n:"values"==t?e[n]:[n,e[n]])},"values"),a.Arguments=a.Array,r("keys"),r("values"),r("entries")},function(e){e.exports=function(){}},function(e,t,n){n(272),n(105),n(275),n(276),e.exports=n(11).Symbol},function(e,t,n){"use strict";var r=n(19),o=n(49),i=n(30),a=n(14),s=n(123),l=n(64).KEY,u=n(41),c=n(126),h=n(83),f=n(98),d=n(24),p=n(134),m=n(135),v=n(273),g=n(137),y=n(29),_=n(22),x=n(54),w=n(61),b=n(113),M=n(75),S=n(80),E=n(274),T=n(175),A=n(136),L=n(35),R=n(81),C=T.f,I=L.f,k=E.f,P=r.Symbol,N=r.JSON,D=N&&N.stringify,O="prototype",F=d("_hidden"),B=d("toPrimitive"),U={}.propertyIsEnumerable,G=c("symbol-registry"),z=c("symbols"),V=c("op-symbols"),H=Object[O],W="function"==typeof P&&!!A.f,j=r.QObject,Y=!j||!j[O]||!j[O].findChild,q=i&&u(function(){return 7!=S(I({},"a",{get:function(){return I(this,"a",{value:7}).a}})).a})?function(e,t,n){var r=C(H,t);r&&delete H[t],I(e,t,n),r&&e!==H&&I(H,t,r)}:I,X=function(e){var t=z[e]=S(P[O]);return t._k=e,t},Z=W&&"symbol"==typeof P.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof P},J=function(e,t,n){return e===H&&J(V,t,n),y(e),t=b(t,!0),y(n),o(z,t)?(n.enumerable?(o(e,F)&&e[F][t]&&(e[F][t]=!1),n=S(n,{enumerable:M(0,!1)})):(o(e,F)||I(e,F,M(1,{})),e[F][t]=!0),q(e,t,n)):I(e,t,n)},K=function(e,t){y(e);for(var n,r=v(t=w(t)),i=0,a=r.length;i<a;)J(e,n=r[i++],t[n]);return e},Q=function(e,t){return void 0===t?S(e):K(S(e),t)},$=function(e){var t=U.call(this,e=b(e,!0));return!(this===H&&o(z,e)&&!o(V,e))&&(!(t||!o(this,e)||!o(z,e)||o(this,F)&&this[F][e])||t)},ee=function(e,t){if(e=w(e),t=b(t,!0),e!==H||!o(z,t)||o(V,t)){var n=C(e,t);return!n||!o(z,t)||o(e,F)&&e[F][t]||(n.enumerable=!0),n}},te=function(e){for(var t,n=k(w(e)),r=[],i=0;n.length>i;)o(z,t=n[i++])||t==F||t==l||r.push(t);return r},ne=function(e){for(var t,n=e===H,r=k(n?V:w(e)),i=[],a=0;r.length>a;)!o(z,t=r[a++])||n&&!o(H,t)||i.push(z[t]);return i};W||(P=function(e){if(this instanceof P)throw TypeError("Symbol is not a constructor!");var t=f(0<arguments.length?e:void 0),n=function(e){this===H&&n.call(V,e),o(this,F)&&o(this[F],t)&&(this[F][t]=!1),q(this,t,M(1,e))};return i&&Y&&q(H,t,{configurable:!0,set:n}),X(t)},s(P[O],"toString",function(){return this._k}),T.f=ee,L.f=J,n(174).f=E.f=te,n(104).f=$,A.f=ne,i&&!n(79)&&s(H,"propertyIsEnumerable",$,!0),p.f=function(e){return X(d(e))}),a(a.G+a.W+a.F*!W,{Symbol:P});for(var re="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),ie=0;re.length>ie;)d(re[ie++]);for(var ae=R(d.store),oe=0;ae.length>oe;)m(ae[oe++]);a(a.S+a.F*!W,"Symbol",{for:function(e){return o(G,e+="")?G[e]:G[e]=P(e)},keyFor:function(e){if(!Z(e))throw TypeError(e+" is not a symbol!");for(var t in G)if(G[t]===e)return t},useSetter:function(){Y=!0},useSimple:function(){Y=!1}}),a(a.S+a.F*!W,"Object",{create:Q,defineProperty:J,defineProperties:K,getOwnPropertyDescriptor:ee,getOwnPropertyNames:te,getOwnPropertySymbols:ne});var se=u(function(){A.f(1)});a(a.S+a.F*se,"Object",{getOwnPropertySymbols:function(e){return A.f(x(e))}}),N&&a(a.S+a.F*(!W||u(function(){var e=P();return"[null]"!=D([e])||"{}"!=D({a:e})||"{}"!=D(Object(e))})),"JSON",{stringify:function(e){for(var t,n,r=[e],i=1;i<arguments.length;)r.push(arguments[i++]);if(n=t=r[1],(_(t)||void 0!==e)&&!Z(e))return g(t)||(t=function(e,t){if("function"==typeof n&&(t=n.call(this,e,t)),!Z(t))return t}),r[1]=t,D.apply(N,r)}}),P[O][B]||n(48)(P[O],B,P[O].valueOf),h(P,"Symbol"),h(Math,"Math",!0),h(r.JSON,"JSON",!0)},function(e,t,n){var s=n(81),l=n(136),u=n(104);e.exports=function(e){var t=s(e),n=l.f;if(n)for(var r,i=n(e),a=u.f,o=0;i.length>o;)a.call(e,r=i[o++])&&t.push(r);return t}},function(e,t,n){var r=n(61),i=n(174).f,a={}.toString,o="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],s=function(e){try{return i(e)}catch(e){return o.slice()}};e.exports.f=function(e){return o&&"[object Window]"==a.call(e)?s(e):i(r(e))}},function(e,t,n){n(135)("asyncIterator")},function(e,t,n){n(135)("observable")},function(e,t,n){"use strict";var r=n(27),a=n(37),o=n(278),s="startsWith",l=""[s];r(r.P+r.F*n(279)(s),"String",{startsWith:function(e,t){var n=o(this,e,s),r=a(Math.min(1<arguments.length?t:void 0,n.length)),i=String(e);return l?l.call(n,i,r):n.slice(r,r+i.length)===i}})},function(e,t,n){var r=n(120),i=n(50);e.exports=function(e,t,n){if(r(t))throw TypeError("String#"+n+" doesn't accept regex!");return String(i(e))}},function(e,t,n){var r=n(20)("match");e.exports=function(t){var n=/./;try{"/./"[t](n)}catch(e){try{return n[r]=!1,!"/./"[t](n)}catch(e){}}return!0}},function(e,t,n){e.exports=n(281)},function(e,t,n){n(105),n(65),n(282),n(286),n(287),e.exports=n(11).WeakMap},function(e,t,n){"use strict";var a,r=n(19),i=n(139)(0),o=n(123),s=n(64),l=n(178),u=n(285),c=n(22),h=n(84),f=n(84),d=!r.ActiveXObject&&"ActiveXObject"in r,p="WeakMap",m=s.getWeak,v=Object.isExtensible,g=u.ufstore,y=function(t){return function(e){return t(this,0<arguments.length?e:void 0)}},_={get:function(e){if(c(e)){var t=m(e);return!0===t?g(h(this,p)).get(e):t?t[this._i]:void 0}},set:function(e,t){return u.def(h(this,p),e,t)}},x=e.exports=n(179)(p,y,_,u,!0,!0);f&&d&&(a=u.getConstructor(y,p),l(a.prototype,_),s.NEED=!0,i(["delete","has","get","set"],function(r){var e=x.prototype,i=e[r];o(e,r,function(e,t){if(!c(e)||v(e))return i.call(this,e,t);this._f||(this._f=new a);var n=this._f[r](e,t);return"set"==r?this:n})}))},function(e,t,n){var r=n(284);e.exports=function(e,t){return new(r(e))(t)}},function(e,t,n){var r=n(22),i=n(137),a=n(24)("species");e.exports=function(e){var t;return i(e)&&(t=e.constructor,"function"!=typeof t||t!==Array&&!i(t.prototype)||(t=void 0),r(t)&&(t=t[a],null===t&&(t=void 0))),void 0===t?Array:t}},function(e,t,n){"use strict";var o=n(106),s=n(64).getWeak,i=n(29),l=n(22),u=n(107),c=n(67),r=n(139),h=n(49),f=n(84),a=r(5),d=r(6),p=0,m=function(e){return e._l||(e._l=new v)},v=function(){this.a=[]},g=function(e,t){return a(e.a,function(e){return e[0]===t})};v.prototype={get:function(e){var t=g(this,e);if(t)return t[1]},has:function(e){return!!g(this,e)},set:function(e,t){var n=g(this,e);n?n[1]=t:this.a.push([e,t])},delete:function(t){var e=d(this.a,function(e){return e[0]===t});return~e&&this.a.splice(e,1),!!~e}},e.exports={getConstructor:function(e,n,r,i){var a=e(function(e,t){u(e,a,n,"_i"),e._t=n,e._i=p++,e._l=void 0,null!=t&&c(t,r,e[i],e)});return o(a.prototype,{delete:function(e){if(!l(e))return!1;var t=s(e);return!0===t?m(f(this,n)).delete(e):t&&h(t,this._i)&&delete t[this._i]},has:function(e){if(!l(e))return!1;var t=s(e);return!0===t?m(f(this,n)).has(e):t&&h(t,this._i)}}),a},def:function(e,t,n){var r=s(i(t),!0);return!0===r?m(e).set(t,n):r[e._i]=n,e},ufstore:m}},function(e,t,n){n(180)("WeakMap")},function(e,t,n){n(181)("WeakMap")},function(e,t,n){"use strict";var r=n(23);e.exports=function(e,t){return!!e&&r(function(){t?e.call(null,function(){},1):e.call(null)})}},function(e,t,n){n(290),e.exports=n(11).Object.keys},function(e,t,n){var r=n(54),i=n(81);n(133)("keys",function(){return function(e){return i(r(e))}})},function(e,t,n){n(45)("Float64",8,function(r){return function(e,t,n){return r(this,e,t,n)}})},function(e,t,n){"use strict";var r=n(28),i=n(26),a=n(94),o=n(182),s=n(39),l=n(183),u=n(23),c=n(184),h=n(51),f=n(37),d=n(185),p=n(91).f,m=n(38).f,v=n(140),g=n(132),y="ArrayBuffer",_="DataView",x="prototype",w="Wrong length!",b="Wrong index!",M=r[y],S=r[_],E=r.Math,T=r.RangeError,A=r.Infinity,L=M,R=E.abs,C=E.pow,I=E.floor,k=E.log,P=E.LN2,N="buffer",D="byteLength",O="byteOffset",F=i?"_b":N,B=i?"_l":D,U=i?"_o":O;function G(e,t,n){var r,i,a,o=new Array(n),s=8*n-t-1,l=(1<<s)-1,u=l>>1,c=23===t?C(2,-24)-C(2,-77):0,h=0,f=e<0||0===e&&1/e<0?1:0;for(e=R(e),e!=e||e===A?(i=e!=e?1:0,r=l):(r=I(k(e)/P),e*(a=C(2,-r))<1&&(r--,a*=2),e+=1<=r+u?c/a:c*C(2,1-u),2<=e*a&&(r++,a/=2),l<=r+u?(i=0,r=l):1<=r+u?(i=(e*a-1)*C(2,t),r+=u):(i=e*C(2,u-1)*C(2,t),r=0));8<=t;o[h++]=255&i,i/=256,t-=8);for(r=r<<t|i,s+=t;0<s;o[h++]=255&r,r/=256,s-=8);return o[--h]|=128*f,o}function z(e,t,n){var r,i=8*n-t-1,a=(1<<i)-1,o=a>>1,s=i-7,l=n-1,u=e[l--],c=127&u;for(u>>=7;0<s;c=256*c+e[l],l--,s-=8);for(r=c&(1<<-s)-1,c>>=-s,s+=t;0<s;r=256*r+e[l],l--,s-=8);if(0===c)c=1-o;else{if(c===a)return r?NaN:u?-A:A;r+=C(2,t),c-=o}return(u?-1:1)*r*C(2,c-t)}function V(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]}function H(e){return[255&e]}function W(e){return[255&e,e>>8&255]}function j(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]}function Y(e){return G(e,52,8)}function q(e){return G(e,23,4)}function X(e,t,n){m(e[x],t,{get:function(){return this[n]}})}function Z(e,t,n,r){var i=+n,a=d(i);if(a+t>e[B])throw T(b);var o=e[F]._b,s=a+e[U],l=o.slice(s,s+t);return r?l:l.reverse()}function J(e,t,n,r,i,a){var o=+n,s=d(o);if(s+t>e[B])throw T(b);for(var l=e[F]._b,u=s+e[U],c=r(+i),h=0;h<t;h++)l[u+h]=c[a?h:t-h-1]}if(o.ABV){if(!u(function(){M(1)})||!u(function(){new M(-1)})||u(function(){return new M,new M(1.5),new M(NaN),M.name!=y})){M=function(e){return c(this,M),new L(d(e))};for(var K,Q=M[x]=L[x],$=p(L),ee=0;$.length>ee;)(K=$[ee++])in M||s(M,K,L[K]);a||(Q.constructor=M)}var te=new S(new M(2)),ne=S[x].setInt8;te.setInt8(0,2147483648),te.setInt8(1,2147483649),!te.getInt8(0)&&te.getInt8(1)||l(S[x],{setInt8:function(e,t){ne.call(this,e,t<<24>>24)},setUint8:function(e,t){ne.call(this,e,t<<24>>24)}},!0)}else M=function(e){c(this,M,y);var t=d(e);this._b=v.call(new Array(t),0),this[B]=t},S=function(e,t,n){c(this,S,_),c(e,M,_);var r=e[B],i=h(t);if(i<0||r<i)throw T("Wrong offset!");if(n=void 0===n?r-i:f(n),r<i+n)throw T(w);this[F]=e,this[U]=i,this[B]=n},i&&(X(M,D,"_l"),X(S,N,"_b"),X(S,D,"_l"),X(S,O,"_o")),l(S[x],{getInt8:function(e){return Z(this,1,e)[0]<<24>>24},getUint8:function(e){return Z(this,1,e)[0]},getInt16:function(e,t){var n=Z(this,2,e,t);return(n[1]<<8|n[0])<<16>>16},getUint16:function(e,t){var n=Z(this,2,e,t);return n[1]<<8|n[0]},getInt32:function(e,t){return V(Z(this,4,e,t))},getUint32:function(e,t){return V(Z(this,4,e,t))>>>0},getFloat32:function(e,t){return z(Z(this,4,e,t),23,4)},getFloat64:function(e,t){return z(Z(this,8,e,t),52,8)},setInt8:function(e,t){J(this,1,e,H,t)},setUint8:function(e,t){J(this,1,e,H,t)},setInt16:function(e,t,n){J(this,2,e,W,t,n)},setUint16:function(e,t,n){J(this,2,e,W,t,n)},setInt32:function(e,t,n){J(this,4,e,j,t,n)},setUint32:function(e,t,n){J(this,4,e,j,t,n)},setFloat32:function(e,t,n){J(this,4,e,q,t,n)},setFloat64:function(e,t,n){J(this,8,e,Y,t,n)}});g(M,y),g(S,_),s(S[x],o.VIEW,!0),t[y]=M,t[_]=S},function(e,t,n){var r=n(63),i=n(20)("iterator"),a=Array.prototype;e.exports=function(e){return void 0!==e&&(r.Array===e||a[i]===e)}},function(e,t,n){var r=n(101),i=n(20)("iterator"),a=n(63);e.exports=n(93).getIteratorMethod=function(e){if(null!=e)return e[i]||e["@@iterator"]||a[r(e)]}},function(e,t,n){var _=n(88),x=n(116),w=n(44),b=n(37),r=n(296);e.exports=function(h,e){var f=1==h,d=2==h,p=3==h,m=4==h,v=6==h,g=5==h||v,y=e||r;return function(e,t,n){for(var r,i,a=w(e),o=x(a),s=_(t,n,3),l=b(o.length),u=0,c=f?y(e,l):d?y(e,0):void 0;u<l;u++)if((g||u in o)&&(r=o[u],i=s(r,u,a),h))if(f)c[u]=i;else if(i)switch(h){case 3:return!0;case 5:return r;case 6:return u;case 2:c.push(r)}else if(m)return!1;return v?-1:p||m?m:c}}},function(e,t,n){var r=n(297);e.exports=function(e,t){return new(r(e))(t)}},function(e,t,n){var r=n(42),i=n(298),a=n(20)("species");e.exports=function(e){var t;return i(e)&&(t=e.constructor,"function"!=typeof t||t!==Array&&!i(t.prototype)||(t=void 0),r(t)&&(t=t[a],null===t&&(t=void 0))),void 0===t?Array:t}},function(e,t,n){var r=n(76);e.exports=Array.isArray||function(e){return"Array"==r(e)}},function(e,t,n){var a=n(20)("iterator"),o=!1;try{var r=[7][a]();r.return=function(){o=!0},Array.from(r,function(){throw 2})}catch(e){}e.exports=function(e,t){if(!t&&!o)return!1;var n=!1;try{var r=[7],i=r[a]();i.next=function(){return{done:n=!0}},r[a]=function(){return i},e(r)}catch(e){}return n}},function(e,t,n){"use strict";var c=n(44),h=n(92),f=n(37);e.exports=[].copyWithin||function(e,t,n){var r=c(this),i=f(r.length),a=h(e,i),o=h(t,i),s=2<arguments.length?n:void 0,l=Math.min((void 0===s?i:h(s,i))-o,i-a),u=1;for(o<a&&a<o+l&&(u=-1,o+=l-1,a+=l-1);0<l--;)o in r?r[a]=r[o]:delete r[a],a+=u,o+=u;return r}},function(e,t,n){n(45)("Int32",4,function(r){return function(e,t,n){return r(this,e,t,n)}})},function(e,t,n){n(45)("Uint8",1,function(r){return function(e,t,n){return r(this,e,t,n)}},!0)},function(e,t,n){n(304),e.exports=n(11).parseInt},function(e,t,n){var r=n(14),i=n(305);r(r.G+r.F*(parseInt!=i),{parseInt:i})},function(e,t,n){var r=n(19).parseInt,i=n(189).trim,a=n(143),o=/^[-+]?0[xX]/;e.exports=8!==r(a+"08")||22!==r(a+"0x16")?function(e,t){var n=i(String(e),3);return r(n,t>>>0||(o.test(n)?16:10))}:r},function(e,t,n){n(307),e.exports=n(11).parseFloat},function(e,t,n){var r=n(14),i=n(308);r(r.G+r.F*(parseFloat!=i),{parseFloat:i})},function(e,t,n){var r=n(19).parseFloat,i=n(189).trim;e.exports=1/r(n(143)+"-0")!=-1/0?function(e){var t=i(String(e),3),n=r(t);return 0===n&&"-"==t.charAt(0)?-0:n}:r},function(e,t,n){"use strict";var r=n(27),i=n(44),a=n(77);r(r.P+r.F*n(23)(function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})}),"Date",{toJSON:function(){var e=i(this),t=a(e);return"number"!=typeof t||isFinite(t)?e.toISOString():null}})},function(e,t,n){var r=n(11),i=r.JSON||(r.JSON={stringify:JSON.stringify});e.exports=function(e){return i.stringify.apply(i,arguments)}},function(e,t,n){n(312),e.exports=n(11).Array.isArray},function(e,t,n){var r=n(14);r(r.S,"Array",{isArray:n(137)})},function(e,t,n){n(314);var r=n(11).Object;e.exports=function(e,t){return r.create(e,t)}},function(e,t,n){var r=n(14);r(r.S,"Object",{create:n(80)})},function(e,t,n){"use strict";var i=n(51),a=n(50);e.exports=function(e){var t=String(a(this)),n="",r=i(e);if(r<0||r==1/0)throw RangeError("Count can't be negative");for(;0<r;(r>>>=1)&&(t+=t))1&r&&(n+=t);return n}},function(e,t,n){n(317);var r=n(11).Object;e.exports=function(e,t){return r.defineProperties(e,t)}},function(e,t,n){var r=n(14);r(r.S+r.F*!n(30),"Object",{defineProperties:n(162)})},function(e,t,n){var r=n(27);r(r.S+r.F,"Object",{assign:n(319)})},function(e,t,n){"use strict";var h=n(26),f=n(131),d=n(320),p=n(156),m=n(44),v=n(116),i=Object.assign;e.exports=!i||n(23)(function(){var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach(function(e){t[e]=e}),7!=i({},e)[n]||Object.keys(i({},t)).join("")!=r})?function(e){for(var t=m(e),n=arguments.length,r=1,i=d.f,a=p.f;r<n;)for(var o,s=v(arguments[r++]),l=i?f(s).concat(i(s)):f(s),u=l.length,c=0;c<u;)o=l[c++],h&&!a.call(s,o)||(t[o]=s[o]);return t}:i},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t,n){n(322),e.exports=n(11).Object.assign},function(e,t,n){var r=n(14);r(r.S+r.F,"Object",{assign:n(178)})},function(e,t,n){n(26)&&"g"!=/./g.flags&&n(38).f(RegExp.prototype,"flags",{configurable:!0,get:n(95)})},function(e,t,n){var r=n(27);r(r.S,"Math",{sign:n(325)})},function(e){e.exports=Math.sign||function(e){return 0==(e=+e)||e!=e?e:e<0?-1:1}},function(e,t,n){var r=n(27);r(r.S,"Number",{isInteger:n(327)})},function(e,t,n){var r=n(42),i=Math.floor;e.exports=function(e){return!r(e)&&isFinite(e)&&i(e)===e}},function(e,t,n){e.exports=n(329)},function(e,t,n){n(330),e.exports=n(11).Number.isInteger},function(e,t,n){var r=n(14);r(r.S,"Number",{isInteger:n(331)})},function(e,t,n){var r=n(22),i=Math.floor;e.exports=function(e){return!r(e)&&isFinite(e)&&i(e)===e}},function(e,t,n){var o=n(27),r=n(50),s=n(23),l=n(333),i="["+l+"]",u="​…",a=RegExp("^"+i+i+"*"),c=RegExp(i+i+"*$"),h=function(e,t,n){var r={},i=s(function(){return!!l[e]()||u[e]()!=u}),a=r[e]=i?t(f):l[e];n&&(r[n]=a),o(o.P+o.F*i,"String",r)},f=h.trim=function(e,t){return e=String(r(e)),1&t&&(e=e.replace(a,"")),2&t&&(e=e.replace(c,"")),e};e.exports=h},function(e){e.exports="\t\n\v\f\r   ᠎              \u2028\u2029\ufeff"},function(e,t,n){var r=n(27);r(r.S,"Number",{EPSILON:Math.pow(2,-52)})},function(e,t,n){e.exports=n(336)},function(e,t,n){n(337),e.exports=Math.pow(2,-52)},function(e,t,n){var r=n(14);r(r.S,"Number",{EPSILON:Math.pow(2,-52)})},function(t,e,n){(function(e){t.exports=e.TWEEN=n(339)}).call(this,n(154))},function(a,o,e){(function(t){var e,n,r=function(){this._tweens={},this._tweensAddedDuringUpdate={}};r.prototype={getAll:function(){return Object.keys(this._tweens).map(function(e){return this._tweens[e]}.bind(this))},removeAll:function(){this._tweens={}},add:function(e){this._tweens[e.getId()]=e,this._tweensAddedDuringUpdate[e.getId()]=e},remove:function(e){delete this._tweens[e.getId()],delete this._tweensAddedDuringUpdate[e.getId()]},update:function(e,t){var n=Object.keys(this._tweens);if(0===n.length)return!1;for(e=void 0!==e?e:s.now();0<n.length;){this._tweensAddedDuringUpdate={};for(var r=0;r<n.length;r++){var i=this._tweens[n[r]];i&&!1===i.update(e)&&(i._isPlaying=!1,t||delete this._tweens[n[r]])}n=Object.keys(this._tweensAddedDuringUpdate)}return!0}};var i,s=new r;s.Group=r,s._nextId=0,s.nextId=function(){return s._nextId++},"undefined"==typeof self&&void 0!==t&&t.hrtime?s.now=function(){var e=t.hrtime();return 1e3*e[0]+e[1]/1e6}:void 0!==self.performance&&void 0!==self.performance.now?s.now=self.performance.now.bind(self.performance):void 0!==Date.now?s.now=Date.now:s.now=function(){return(new Date).getTime()},s.Tween=function(e,t){this._object=e,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._repeat=0,this._repeatDelayTime=void 0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=null,this._easingFunction=s.Easing.Linear.None,this._interpolationFunction=s.Interpolation.Linear,this._chainedTweens=[],this._onStartCallback=null,this._onStartCallbackFired=!1,this._onUpdateCallback=null,this._onRepeatCallback=null,this._onCompleteCallback=null,this._onStopCallback=null,this._group=t||s,this._id=s.nextId()},s.Tween.prototype={getId:function(){return this._id},isPlaying:function(){return this._isPlaying},to:function(e,t){return this._valuesEnd=Object.create(e),void 0!==t&&(this._duration=t),this},duration:function(e){return this._duration=e,this},start:function(e){for(var t in this._group.add(this),this._isPlaying=!0,this._onStartCallbackFired=!1,this._startTime=void 0!==e?"string"==typeof e?s.now()+parseFloat(e):e:s.now(),this._startTime+=this._delayTime,this._valuesEnd){if(this._valuesEnd[t]instanceof Array){if(0===this._valuesEnd[t].length)continue;this._valuesEnd[t]=[this._object[t]].concat(this._valuesEnd[t])}void 0!==this._object[t]&&(this._valuesStart[t]=this._object[t],this._valuesStart[t]instanceof Array==0&&(this._valuesStart[t]*=1),this._valuesStartRepeat[t]=this._valuesStart[t]||0)}return this},stop:function(){return this._isPlaying&&(this._group.remove(this),this._isPlaying=!1,null!==this._onStopCallback&&this._onStopCallback(this._object),this.stopChainedTweens()),this},end:function(){return this.update(1/0),this},stopChainedTweens:function(){for(var e=0,t=this._chainedTweens.length;e<t;e++)this._chainedTweens[e].stop()},group:function(e){return this._group=e,this},delay:function(e){return this._delayTime=e,this},repeat:function(e){return this._repeat=e,this},repeatDelay:function(e){return this._repeatDelayTime=e,this},yoyo:function(e){return this._yoyo=e,this},easing:function(e){return this._easingFunction=e,this},interpolation:function(e){return this._interpolationFunction=e,this},chain:function(){return this._chainedTweens=arguments,this},onStart:function(e){return this._onStartCallback=e,this},onUpdate:function(e){return this._onUpdateCallback=e,this},onRepeat:function(e){return this._onRepeatCallback=e,this},onComplete:function(e){return this._onCompleteCallback=e,this},onStop:function(e){return this._onStopCallback=e,this},update:function(e){var t,n,r;if(e<this._startTime)return!0;for(t in!1===this._onStartCallbackFired&&(null!==this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),n=(e-this._startTime)/this._duration,n=0===this._duration||1<n?1:n,r=this._easingFunction(n),this._valuesEnd)if(void 0!==this._valuesStart[t]){var i=this._valuesStart[t]||0,a=this._valuesEnd[t];a instanceof Array?this._object[t]=this._interpolationFunction(a,r):("string"==typeof a&&(a="+"===a.charAt(0)||"-"===a.charAt(0)?i+parseFloat(a):parseFloat(a)),"number"==typeof a&&(this._object[t]=i+(a-i)*r))}if(null!==this._onUpdateCallback&&this._onUpdateCallback(this._object,n),1!==n)return!0;if(0<this._repeat){for(t in isFinite(this._repeat)&&this._repeat--,this._valuesStartRepeat){if("string"==typeof this._valuesEnd[t]&&(this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(this._valuesEnd[t])),this._yoyo){var o=this._valuesStartRepeat[t];this._valuesStartRepeat[t]=this._valuesEnd[t],this._valuesEnd[t]=o}this._valuesStart[t]=this._valuesStartRepeat[t]}return this._yoyo&&(this._reversed=!this._reversed),void 0!==this._repeatDelayTime?this._startTime=e+this._repeatDelayTime:this._startTime=e+this._delayTime,null!==this._onRepeatCallback&&this._onRepeatCallback(this._object),!0}null!==this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var s=0,l=this._chainedTweens.length;s<l;s++)this._chainedTweens[s].start(this._startTime+this._duration);return!1}},s.Easing={Linear:{None:function(e){return e}},Quadratic:{In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}},Cubic:{In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}},Quartic:{In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}},Quintic:{In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}},Sinusoidal:{In:function(e){return 1-Math.cos(e*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return.5*(1-Math.cos(Math.PI*e))}},Exponential:{In:function(e){return 0===e?0:Math.pow(1024,e-1)},Out:function(e){return 1===e?1:1-Math.pow(2,-10*e)},InOut:function(e){return 0===e?0:1===e?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(2-Math.pow(2,-10*(e-1)))}},Circular:{In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}},Elastic:{In:function(e){return 0===e?0:1===e?1:-Math.pow(2,10*(e-1))*Math.sin(5*(e-1.1)*Math.PI)},Out:function(e){return 0===e?0:1===e?1:Math.pow(2,-10*e)*Math.sin(5*(e-.1)*Math.PI)+1},InOut:function(e){return 0===e?0:1===e?1:(e*=2,e<1?-.5*Math.pow(2,10*(e-1))*Math.sin(5*(e-1.1)*Math.PI):.5*Math.pow(2,-10*(e-1))*Math.sin(5*(e-1.1)*Math.PI)+1)}},Back:{In:function(e){var t=1.70158;return e*e*((t+1)*e-t)},Out:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},InOut:function(e){var t=2.5949095;return(e*=2)<1?e*e*((t+1)*e-t)*.5:.5*((e-=2)*e*((t+1)*e+t)+2)}},Bounce:{In:function(e){return 1-s.Easing.Bounce.Out(1-e)},Out:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},InOut:function(e){return e<.5?.5*s.Easing.Bounce.In(2*e):.5*s.Easing.Bounce.Out(2*e-1)+.5}}},s.Interpolation={Linear:function(e,t){var n=e.length-1,r=n*t,i=Math.floor(r),a=s.Interpolation.Utils.Linear;return t<0?a(e[0],e[1],r):1<t?a(e[n],e[n-1],n-r):a(e[i],e[n<i+1?n:i+1],r-i)},Bezier:function(e,t){for(var n=0,r=e.length-1,i=Math.pow,a=s.Interpolation.Utils.Bernstein,o=0;o<=r;o++)n+=i(1-t,r-o)*i(t,o)*e[o]*a(r,o);return n},CatmullRom:function(e,t){var n=e.length-1,r=n*t,i=Math.floor(r),a=s.Interpolation.Utils.CatmullRom;return e[0]===e[n]?(t<0&&(i=Math.floor(r=n*(1+t))),a(e[(i-1+n)%n],e[i],e[(i+1)%n],e[(i+2)%n],r-i)):t<0?e[0]-(a(e[0],e[0],e[1],e[1],-r)-e[0]):1<t?e[n]-(a(e[n],e[n],e[n-1],e[n-1],r-n)-e[n]):a(e[i?i-1:0],e[i],e[n<i+1?n:i+1],e[n<i+2?n:i+2],r-i)},Utils:{Linear:function(e,t,n){return(t-e)*n+e},Bernstein:function(e,t){var n=s.Interpolation.Utils.Factorial;return n(e)/n(t)/n(e-t)},Factorial:(i=[1],function(e){var t=1;if(i[e])return i[e];for(var n=e;1<n;n--)t*=n;return i[e]=t,t}),CatmullRom:function(e,t,n,r,i){var a=.5*(n-e),o=.5*(r-t),s=i*i,l=i*s;return(2*t-2*n+a+o)*l+(-3*t+3*n-2*a-o)*s+a*i+t}}},e=[],n=function(){return s}.apply(o,e),void 0===n||(a.exports=n)}).call(this,e(146))},function(e,t,n){"use strict";var r=n(1),i=r(n(145)),a=r(n(69));n(70),n(103),n(62),n(4),r(n(2)),r(n(3)),fm.OrbitControls=function(e,t,n){var c,h,f,d,p,m,v,g,y,_;this.object=e,this.map=n,this.domElement=void 0!==t?t:document,this.enabled=!0,this.target=new fm.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.25,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!1,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.enableKeys=!0,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},this.mouseButtons={LEFT:fm.MOUSE.LEFT,MIDDLE:fm.MOUSE.MIDDLE,RIGHT:fm.MOUSE.RIGHT},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.rangeCenter=new fm.Vector3,this.rangeRadius=500,this.useRange=!1,this.enterCtrl=null,this.setEnterCtrl=function(e){this.enterCtrl=e},this.getPolarAngle=function(){return E.phi},this.getAzimuthalAngle=function(){return E.theta},this.setPolarAngle=function(e){E.phi=e},this.setAzimuthalAngle=function(e){E.theta=e},this.addPolarAngle=function(e){E.phi+=e},this.addAzimuthalAngle=function(e){E.theta+=e},this.panAdd=function(e){L.add(e)},this.saveState=function(){x.target0.copy(x.target),x.position0.copy(x.object.position),x.zoom0=x.object.zoom},this.reset=function(){x.target.copy(x.target0),x.object.position.copy(x.position0),x.object.zoom=x.zoom0,x.object.updateProjectionMatrix(),x.dispatchEvent(w),x.update(),M=b.NONE},this.setUpdate=function(e,t,n,r,i){c=e,h=t,f=n,d=r,p=i},this.update=(m=new fm.Vector3,v=(new fm.Quaternion).setFromUnitVectors(e.up,new fm.Vector3(0,1,0)),g=v.clone().inverse(),y=new fm.Vector3,_=new fm.Quaternion,function(){var e=x.object.position;m.copy(e).sub(x.target),m.applyQuaternion(v);var t=E.theta;if(E.setFromVector3(m),E.theta=t,x.autoRotate&&M===b.NONE&&V(z()),E.theta+=T.theta,E.phi+=T.phi,"number"==typeof d&&(E.theta=d),"number"==typeof p&&(E.phi=p),"number"==typeof c&&(E.phi+=c),h&&"number"==typeof h&&(E.theta+=h),E.theta=Math.max(x.minAzimuthAngle,Math.min(x.maxAzimuthAngle,E.theta)),E.phi=Math.max(x.minPolarAngle,Math.min(x.maxPolarAngle,E.phi)),E.makeSafe(),E.radius*=A,E.radius=Math.max(x.minDistance,Math.min(x.maxDistance,E.radius)),this.useRange){var n=(new fm.Vector3).setFromMatrixPosition(x.object.matrixWorld);n.add(L);var r=(new fm.Matrix4).copy(x.object.matrixWorld).setPosition(n),i=(new fm.Matrix4).getInverse(r),a=(new fm.Frustum).setFromMatrix((new fm.Matrix4).multiplyMatrices(x.object.projectionMatrix,i));a.intersectsBox(x.viewBox)&&x.target.add(L)}else x.target.add(L);if(m.setFromSpherical(E),m.applyQuaternion(g),f&&m.add(f),this.useRange){var o=(new fm.Vector3).setFromMatrixPosition(x.object.matrixWorld);o.add(m);var s=(new fm.Matrix4).copy(x.object.matrixWorld).setPosition(o),l=(new fm.Matrix4).getInverse(s),u=(new fm.Frustum).setFromMatrix((new fm.Matrix4).multiplyMatrices(x.object.projectionMatrix,l));u.intersectsBox(x.viewBox)&&e.copy(x.target).add(m)}else e.copy(x.target).add(m);return x.object.lookAt(x.target),!0===x.enableDamping?(T.theta*=1-x.dampingFactor,T.phi*=1-x.dampingFactor,L.multiplyScalar(1-x.dampingFactor)):(T.set(0,0,0),L.set(0,0,0)),c=void 0,h=void 0,f=void 0,d=void 0,p=void 0,A=1,!!(R||y.distanceToSquared(x.object.position)>S||8*(1-_.dot(x.object.quaternion))>S)&&(x.dispatchEvent(w),y.copy(x.object.position),_.copy(x.object.quaternion),R=!1,!0)}),this.dispose=function(){x.domElement.removeEventListener("contextmenu",me,!1),x.domElement.removeEventListener("mousedown",ae,!1),x.domElement.removeEventListener("wheel",ce,!1),x.domElement.removeEventListener("touchstart",fe,!1),x.domElement.removeEventListener("touchend",pe,!1),x.domElement.removeEventListener("touchmove",de,!1),x.domElement.removeEventListener("mouseup",se,!1),x.domElement.removeEventListener("mousemove",le,!1),window.PointerEvent&&!window.TouchEvent&&(x.domElement.removeEventListener("pointerdown",ye,!1),x.domElement.removeEventListener("pointermove",_e,!1),x.domElement.removeEventListener("pointerup",xe,!1)),document.removeEventListener("mousemove",oe,!1),document.removeEventListener("mouseup",ue,!1),window.removeEventListener("keydown",he,!1),this.enterCtrl=void 0,this.domElement=void 0,this.object=void 0};var x=this,w={type:"change"},l={type:"start"},r={type:"end"},b={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_DOLLY_PAN:4,TOUCH_PAN:5,TOUCH_DOLLY_ROTATE:6},M=b.NONE,S=1e-6,E=new fm.Spherical,T=new fm.Spherical,A=1,L=new fm.Vector3,R=!1,C=new fm.Vector2,I=new fm.Vector2,k=new fm.Vector2,P=new fm.Vector2,N=new fm.Vector2,D=(new fm.Vector2,new fm.Vector2),O=new fm.Vector2,F=new fm.Vector2,B=new fm.Vector2,U=new fm.Vector2,G=new fm.Vector2,u=new fm.Vector2;function z(){return 2*Math.PI/60/60*x.autoRotateSpeed}function i(){return Math.pow(.95,x.zoomSpeed)}function V(e){x.enterCtrl&&!x.enterCtrl.enableMapRotate||(T.theta-=e)}function H(e){x.enterCtrl&&!x.enterCtrl.enableMapIncline||(T.phi-=e)}this.rotateLeft=function(e){V(e)};var a,o,s=(a=new fm.Vector3,function(e,t){a.setFromMatrixColumn(t,0),a.multiplyScalar(-e),L.add(a)}),W=(o=new fm.Vector3,function(e,t){!0===x.screenSpacePanning?o.setFromMatrixColumn(t,1):(o.setFromMatrixColumn(t,0),o.crossVectors(x.object.up,o)),o.multiplyScalar(e),L.add(o)});this.panUp=function(e){var t=new fm.Vector3;t.y=1,t.multiplyScalar(e),L.add(t)};var j,Y=(j=new fm.Vector3,function(e,t){if(!x.enterCtrl||x.enterCtrl.enableMapPan){var n=x.domElement===document?x.domElement.body:x.domElement;if(x.object.isPerspectiveCamera){var r=x.object.position;j.copy(r).sub(x.target);var i=j.length();i*=Math.tan(x.object.fov/2*Math.PI/180),s(2*e*i/n.clientHeight,x.object.matrix),W(2*t*i/n.clientHeight,x.object.matrix)}else x.object.isOrthographicCamera?(s(e*(x.object.right-x.object.left)/x.object.zoom/n.clientWidth,x.object.matrix),W(t*(x.object.top-x.object.bottom)/x.object.zoom/n.clientHeight,x.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),x.enablePan=!1)}});function q(e){x.enterCtrl&&!x.enterCtrl.enableMapPinch||(x.object.isPerspectiveCamera?A/=e:x.object.isOrthographicCamera?(x.object.zoom=Math.max(x.minZoom,Math.min(x.maxZoom,x.object.zoom*e)),x.object.updateProjectionMatrix(),A/=e,R=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),x.enableZoom=!1))}function X(e){x.enterCtrl&&!x.enterCtrl.enableMapPinch||(x.object.isPerspectiveCamera?A*=e:x.object.isOrthographicCamera?(x.object.zoom=Math.max(x.minZoom,Math.min(x.maxZoom,x.object.zoom/e)),x.object.updateProjectionMatrix(),R=!0,A*=e):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),x.enableZoom=!1))}function Z(e){C.set(e.clientX,e.clientY)}function J(e){B.set(e.clientX,e.clientY)}function K(e){D.set(e.clientX,e.clientY)}function Q(e){I.set(e.clientX,e.clientY),k.subVectors(I,C).multiplyScalar(x.rotateSpeed);var t=x.domElement===document?x.domElement.body:x.domElement;V(2*Math.PI*k.x/t.clientHeight),H(2*Math.PI*k.y/t.clientHeight),C.copy(I)}function $(e){U.set(e.clientX,e.clientY),G.subVectors(U,B),0<G.y?q(i()):G.y<0&&X(i()),B.copy(U)}function ee(e){O.set(e.clientX,e.clientY),F.subVectors(O,D).multiplyScalar(x.panSpeed),Y(F.x,F.y),D.copy(O)}function te(){}function ne(e){e.deltaY<0?X(i()):0<e.deltaY&&q(i())}function re(e){switch(e.keyCode){case x.keys.UP:Y(0,x.keyPanSpeed),x.update();break;case x.keys.BOTTOM:Y(0,-x.keyPanSpeed),x.update();break;case x.keys.LEFT:Y(x.keyPanSpeed,0),x.update();break;case x.keys.RIGHT:Y(-x.keyPanSpeed,0),x.update()}}function ie(){}function ae(e){if(u.set(e.clientX,e.clientY,x.enabled),!1!==x.enabled){switch(e.preventDefault(),e.button){case x.mouseButtons.LEFT:if(!1===x.enablePan)return;K(e),M=b.PAN;break;case x.mouseButtons.MIDDLE:if(!1===x.enableZoom)return;J(e),M=b.DOLLY;break;case x.mouseButtons.RIGHT:if(e.ctrlKey||e.metaKey||e.shiftKey){if(!1===x.enablePan)return;K(e),M=b.PAN}else{if(!1===x.enableRotate)return;Z(e),M=b.ROTATE}}M!==b.NONE&&(document.addEventListener("mousemove",oe,!1),document.addEventListener("mouseup",ue,!1),x.dispatchEvent(l))}}function oe(e){if(!1!==x.enabled)switch(e.preventDefault(),M){case b.ROTATE:if(!1===x.enableRotate)return;Q(e);break;case b.DOLLY:if(!1===x.enableZoom)return;$(e);break;case b.PAN:if(!1===x.enablePan)return;ee(e)}}function se(e){var t=u.distanceTo(new fm.Vector2(e.clientX,e.clientY));t<5&&x.dispatchEvent({type:"mouseup",mousePoint:{x:e.offsetX,y:e.offsetY,w:x.domElement.clientWidth,h:x.domElement.clientHeight},event:e,mouseButton:e.button})}function le(e){x.dispatchEvent({type:"mousemove",mousePoint:{x:e.offsetX,y:e.offsetY,w:x.domElement.clientWidth,h:x.domElement.clientHeight},event:e})}function ue(e){!1!==x.enabled&&(te(e),document.removeEventListener("mousemove",oe,!1),document.removeEventListener("mouseup",ue,!1),x.dispatchEvent(r),M=b.NONE)}function ce(e){!1===x.enabled||!1===x.enableZoom||M!==b.NONE&&M!==b.ROTATE||(e.preventDefault(),e.stopPropagation(),x.dispatchEvent(l),ne(e),x.dispatchEvent(r))}function he(e){!1!==x.enabled&&!1!==x.enableKeys&&!1!==x.enablePan&&re(e)}function fe(e){if(!1!==x.enabled){switch(e.preventDefault(),x.map&&x.map.eventTransform&&(e=x.map.eventTransform(e)),u.set(e.changedTouches[0].pageX,e.changedTouches[0].pageY),e.touches.length){case 1:if(x.enablePan){var t=e.touches[0].pageX,n=e.touches[0].pageY;D.set(t,n)}M=b.TOUCH_PAN;break;case 2:if(!1===x.enableZoom&&!1===x.enableRotate)return;if(M=b.TOUCH_DOLLY_ROTATE,x.enableZoom){var r=e.touches[0].pageX-e.touches[1].pageX,i=e.touches[0].pageY-e.touches[1].pageY,a=Math.sqrt(r*r+i*i);B.set(0,a)}if(x.enableRotate){t=.5*(e.touches[0].pageX+e.touches[1].pageX),n=.5*(e.touches[0].pageY+e.touches[1].pageY),C.set(t,n);var o=e.touches[0].pageX-e.touches[1].pageX,s=e.touches[0].pageY-e.touches[1].pageY;P.set(o,s)}break;default:M=b.NONE}M!==b.NONE&&x.dispatchEvent(l)}}function de(e){if(!1!==x.enabled)switch(e.preventDefault(),e.stopPropagation(),x.map&&x.map.eventTransform&&(e=x.map.eventTransform(e)),e.touches.length){case 1:if(M!==b.TOUCH_PAN)return;if(x.enablePan){var t=e.touches[0].pageX,n=e.touches[0].pageY;O.set(t,n),F.subVectors(O,D).multiplyScalar(x.panSpeed),Y(F.x,F.y),D.copy(O)}break;case 2:if(!1===x.enableRotate&&!1===x.enableZoom)return;if(M!==b.TOUCH_DOLLY_ROTATE)return;if(x.enableZoom){var r=e.touches[0].pageX-e.touches[1].pageX,i=e.touches[0].pageY-e.touches[1].pageY,a=Math.sqrt(r*r+i*i);U.set(0,a),G.set(0,Math.pow(U.y/B.y,x.zoomSpeed)),q(G.y),B.copy(U)}if(x.enableRotate){var o=e.touches[0].pageX-e.touches[1].pageX,s=e.touches[0].pageY-e.touches[1].pageY;N.set(o,s);var l=P.angle(),u=N.angle();I.set(.5*(e.touches[0].pageX+e.touches[1].pageX),.5*(e.touches[0].pageY+e.touches[1].pageY)),k.subVectors(I,C).multiplyScalar(x.rotateSpeed);var c=x.domElement===document?x.domElement.body:x.domElement;V((-u+l)*x.rotateSpeed),H(2*Math.PI*k.y/c.clientHeight),C.copy(I),P.copy(N)}break;default:M=b.NONE}}function pe(e){if(!1!==x.enabled){x.map&&x.map.eventTransform&&(e=x.map.eventTransform(e));var t=u.distanceTo(new fm.Vector2(e.changedTouches[0].pageX,e.changedTouches[0].pageY)),n=x.domElement.getBoundingClientRect();t<5&&x.dispatchEvent({type:"mouseup",mousePoint:{x:e.changedTouches[0].pageX-n.left,y:e.changedTouches[0].pageY-n.top,w:x.domElement.clientWidth,h:x.domElement.clientHeight},event:e,mouseButton:fm.MOUSE.LEFT}),ie(e),x.dispatchEvent(r),M=b.NONE}}function me(e){!1!==x.enabled&&e.preventDefault()}this.dollyIn=function(e){q(e)},this.dollyOut=function(e){X(e)},x.domElement.addEventListener("contextmenu",me,!1),x.domElement.addEventListener("mouseup",se,!1),x.domElement.addEventListener("mousemove",le,!1),x.domElement.addEventListener("mousedown",ae,!1),x.domElement.addEventListener("wheel",ce,!1);var ve={touches:[],changedTouches:[],preventDefault:function(){},stopPropagation:function(){}};function ge(e){return{pointerId:e.pointerId,clientX:e.clientX,clientY:e.clientY,pageX:e.clientX,pageY:e.clientY}}function ye(e){if("touch"==e.pointerType){switch(ve.touches.length){case 0:var t={startClientX:e.clientX,startClientY:e.clientY,clientX:e.clientX,clientY:e.clientY,pageY:e.clientY,pageX:e.clientX,pointerId:e.pointerId};ve.touches.push(ge(t)),ve.changedTouches.push(ge(t)),M=b.TOUCH_PAN;break;case 1:var n={startClientX:e.clientX,startClientY:e.clientY,clientX:e.clientX,clientY:e.clientY,pageY:e.clientY,pageX:e.clientX,pointerId:e.pointerId};ve.touches.push(ge(n)),ve.changedTouches.push(ge(n)),M=b.TOUCH_DOLLY_ROTATE;break;default:M=b.NONE}1<ve.touches.length&&fe(ve,!0)}else ve={touches:[],changedTouches:[],preventDefault:function(){},stopPropagation:function(){}}}function _e(e){if(!("touch"!=e.pointerType&&ve.touches.length<2)){for(var t=0,n=ve.touches.length;t<n;t++)ve.touches[t].pointerId==e.pointerId&&(ve.touches[t].clientX=e.clientX,ve.touches[t].clientY=e.clientY,ve.touches[t].pageY=e.clientY,ve.touches[t].pageX=e.clientX,ve.changedTouches[t].clientX=e.clientX,ve.changedTouches[t].clientY=e.clientY,ve.changedTouches[t].pageY=e.clientY,ve.changedTouches[t].pageX=e.clientX);1<ve.touches.length&&de(ve)}}function xe(e){if("touch"==e.pointerType){1<ve.touches.length&&pe(ve);for(var t=ve.touches.length-1;-1<t;t--)ve.touches[t].pointerId==e.pointerId&&(ve.touches.splice(t,1),ve.changedTouches.splice(t,1))}else ve={touches:[],changedTouches:[],preventDefault:function(){},stopPropagation:function(){}}}window.PointerEvent&&!window.TouchEvent&&(x.domElement.addEventListener("pointerdown",ye,!1),x.domElement.addEventListener("pointermove",_e,!1),x.domElement.addEventListener("pointerup",xe,!1)),x.domElement.addEventListener("touchstart",fe,!1),x.domElement.addEventListener("touchend",pe,!1),x.domElement.addEventListener("touchmove",de,!1),window.addEventListener("keydown",he,!1),this.update()},fm.OrbitControls.prototype=(0,a.default)(fm.EventDispatcher.prototype),fm.OrbitControls.prototype.constructor=fm.OrbitControls,(0,i.default)(fm.OrbitControls.prototype,{center:{get:function(){return console.warn("fm.OrbitControls: .center has been renamed to .target"),this.target}},noZoom:{get:function(){return console.warn("fm.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),!this.enableZoom},set:function(e){console.warn("fm.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),this.enableZoom=!e}},noRotate:{get:function(){return console.warn("fm.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),!this.enableRotate},set:function(e){console.warn("fm.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),this.enableRotate=!e}},noPan:{get:function(){return console.warn("fm.OrbitControls: .noPan has been deprecated. Use .enablePan instead."),!this.enablePan},set:function(e){console.warn("fm.OrbitControls: .noPan has been deprecated. Use .enablePan instead."),this.enablePan=!e}},noKeys:{get:function(){return console.warn("fm.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),!this.enableKeys},set:function(e){console.warn("fm.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),this.enableKeys=!e}},staticMoving:{get:function(){return console.warn("fm.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),!this.enableDamping},set:function(e){console.warn("fm.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),this.enableDamping=!e}},dynamicDampingFactor:{get:function(){return console.warn("fm.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor},set:function(e){console.warn("fm.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor=e}}})},function(){"use strict";fm.Evento={convert:function(i,a){return a=a||{},i.on=function(e,t){return(a[e]=a[e]||[]).push(t),i},i.getHandlers=function(e){return a[e]},i.once=function(e,t){function n(){t.apply(i.off(e,n),arguments)}return n.h=t,i.on(e,n)},i.off=function(e,t){for(var n=a[e],r=0;t&&n&&n[r];r++)n[r]!=t&&n[r].h!=t||n.splice(r--,1);return t||delete a[e],i},i.emit=function(e){for(var t=a[e],n=0;t&&t[n];)t[n++].apply(i,t.slice.call(arguments,1));return i},i.offAll=function(){for(var e in a)a[e]=[],delete a[e];a=void 0},i}}},function(e,t,n){n(65),n(59),e.exports=n(343)},function(e,t,n){var r=n(29),i=n(128);e.exports=n(11).getIterator=function(e){var t=i(e);if("function"!=typeof t)throw TypeError(e+" is not iterable!");return r(t.call(e))}},function(e,t,n){n(345),e.exports=n(11).Reflect.construct},function(e,t,n){var r=n(14),l=n(80),u=n(52),c=n(29),h=n(22),i=n(41),f=n(346),d=(n(19).Reflect||{}).construct,p=i(function(){function e(){}return!(d(function(){},[],e)instanceof e)}),m=!i(function(){d(function(){})});r(r.S+r.F*(p||m),"Reflect",{construct:function(e,t,n){u(e),c(t);var r=arguments.length<3?e:u(n);if(m&&!p)return d(e,t,r);if(e==r){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var i=[null];return i.push.apply(i,t),new(f.apply(e,i))}var a=r.prototype,o=l(h(a)?a:Object.prototype),s=Function.apply.call(e,o,t);return h(s)?s:o}})},function(e,t,n){"use strict";var a=n(52),o=n(22),s=n(192),l=[].slice,u={},c=function(e,t,n){if(!(t in u)){for(var r=[],i=0;i<t;i++)r[i]="a["+i+"]";u[t]=Function("F,a","return new F("+r.join(",")+")")}return u[t](e,n)};e.exports=Function.bind||function(t){var n=a(this),r=l.call(arguments,1),i=function(){var e=r.concat(l.call(arguments));return this instanceof i?c(n,e.length,e):s(n,e,t)};return o(n.prototype)&&(i.prototype=n.prototype),i}},function(e,t,n){var r=n(13),i=n(193);function a(e){if(r(e))return i(e)}e.exports=a},function(e,t,n){var r=n(15),i=n(349),a=n(16);function o(e){if(void 0!==a&&i(Object(e)))return r(e)}e.exports=o},function(e,t,n){e.exports=n(350)},function(e,t,n){n(65),n(59),e.exports=n(351)},function(e,t,n){var r=n(99),i=n(24)("iterator"),a=n(60);e.exports=n(11).isIterable=function(e){var t=Object(e);return void 0!==t[i]||"@@iterator"in t||a.hasOwnProperty(r(t))}},function(e,t,n){var r=n(15),i=n(193);function a(e,t){if(e){if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?r(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}e.exports=a},function(e){function t(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}e.exports=t},function(e,t,n){e.exports=n(355)},function(e,t,n){n(356),e.exports=n(11).Object.getPrototypeOf},function(e,t,n){var r=n(54),i=n(165);n(133)("getPrototypeOf",function(){return function(e){return i(r(e))}})},function(e,t,n){n(358),e.exports=n(11).Object.setPrototypeOf},function(e,t,n){var r=n(14);r(r.S,"Object",{setPrototypeOf:n(359).set})},function(e,t,i){var n=i(22),r=i(29),a=function(e,t){if(r(e),!n(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,n,r){try{r=i(40)(Function.call,i(175).f(Object.prototype,"__proto__").set,2),r(e,[]),n=!(e instanceof Array)}catch(e){n=!0}return function(e,t){return a(e,t),n?e.__proto__=t:r(e,t),e}}({},!1):void 0),check:a}},function(n,e,t){var r=t(195);function i(e,t){return n.exports=i=r||function(e,t){return e.__proto__=t,e},i(e,t)}n.exports=i},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(32)),o=r(n(2)),s=r(n(3)),l=r(n(86)),u=r(n(197)),c=function(){function r(e){(0,o.default)(this,r);var t="https:"===window.location.protocol?"https://":"http://",n=t+"source.fengmap.com/webtheme";this._key=null,this._appName=null,this._mapServerURL="fengmap",this._mapThemeURL=n,this._container=document.body,this._compassOffset=[28,20],this._compassSize=50,this._compassFg=null,this._compassBg=null,this.compassPosition=1,this._defaultThemeName="2001",this._focusAnimateMode=!0,this._focusAnimateTime=.3,this._focusAlphaMode=!0,this._focusAlpha=.1,this._viewModeAnimateMode=!0,this._viewModeAnimateTime=.3,this._moveToAnimateMode=!0,this._moveToAnimateTime=.3,this._scaleToAnimateMode=!0,this._modelSelectedEffect=!0,this._modelHoverEffect=!1,this._modelHoverTime=1e3,this.minScaleLevel=0,this.maxScaleLevel=6,this.defaultScaleLevel=3,this.mapScaleLevelRange=[16,23],this.mapScaleRange=null,this.defaultMapScaleLevel=20,this.defaultMapScale=null,this.minViewDistance=2e3,this.defaultVisibleGroups=[1],this.defaultFocusGroup=1,this.defaultViewMode="3d",this.shadowEnabled=!1,this.lightAngleX=45,this.lightAngleY=45,this.shadowSize=2048,this.shadowAlpha=.6,this.storeImageAngle=0,this.naviLineAnimation=!0,this.controlsRotateThreshold=.03,this.controlsScaleThreshold=.03,this.defaultGroupSpace=50,this.passiveMode=!1,this.themeVersion=null,this.themeFileType=null,this.cornerRoundLimit=1,this.stairsConfig={},this.defaultControlsPose=-15,this.defaultTiltAngle=30,this.defaultMaxTiltAngle=90,this.defaultMinTiltAngle=0,this.extentHeight=0,this.poiLabelFadeMode=!1,this.poiLabelFadeSpeed=5,this.defaultBackgroundColor=null,this.defaultBackgroundAlpha=null,this.storeImageDistanceEnabled=!1,this.storeImageDistance=500,this.useStoreApply=!0,this.frameRate=12,this.defaultViewCenter=null,this.pickCoordHeight=1,this.modelFileSuffix="js",this.enabledFXAA=!1,this.dynamicTextureScale=1,this.enabledPanRange=!1,this.tile=!1,this.levelShowOffset=0,this.lightEffects=!1,this.defaultLabelLanguage=l.default.ZH,this.font={family:'"Microsoft Yahei","微软雅黑",Tahoma,Arial'},(0,a.default)(this,e)}return(0,s.default)(r,[{key:"computePoseToAngle",value:function(){if("number"==typeof this.defaultControlsPose)return this.defaultControlsPose;if(this.defaultControlsPose){var e=u.default[this.defaultControlsPose];return e||-15}}},{key:"key",set:function(e){this._key=e},get:function(){return this._key}},{key:"appName",set:function(e){this._appName=e},get:function(){return this._appName}},{key:"mapServerURL",get:function(){return this._mapServerURL},set:function(e){this._mapServerURL=e}},{key:"mapThemeURL",get:function(){return this._mapThemeURL},set:function(e){this._mapThemeURL=e}},{key:"container",get:function(){return this._container},set:function(e){this._container=e}},{key:"compassOffset",get:function(){return this._compassOffset},set:function(e){this._compassOffset=e}},{key:"compassSize",get:function(){return this._compassSize},set:function(e){this._compassSize=e}},{key:"compassFg",set:function(e){this._compassFg=e},get:function(){return this._compassFg}},{key:"compassBg",set:function(e){this._compassBg=e},get:function(){return this._compassBg}},{key:"defaultThemeName",get:function(){return this._defaultThemeName},set:function(e){this._defaultThemeName=e}},{key:"focusAnimateMode",get:function(){return this._focusAnimateMode},set:function(e){this._focusAnimateMode=e}},{key:"focusAnimateTime",get:function(){return this._focusAnimateTime},set:function(e){this._focusAnimateTime=e}},{key:"focusAlphaMode",get:function(){this._focusAlphaMode},set:function(e){this._focusAlphaMode=e}},{key:"focusAlpha",set:function(e){this._focusAlpha=e},get:function(){return this._focusAlpha}},{key:"viewModeAnimateMode",set:function(e){this._viewModeAnimateMode=e},get:function(){return this._viewModeAnimateMode}},{key:"moveToAnimateMode",set:function(e){this._moveToAnimateMode=e},get:function(){return this._moveToAnimateMode}},{key:"scaleToAnimateMode",set:function(e){this._scaleToAnimateMode=e},get:function(){return this._scaleToAnimateMode}},{key:"viewModeAnimateTime",set:function(e){this._viewModeAnimateTime=e},get:function(){return this._viewModeAnimateTime}},{key:"modelHoverTime",get:function(){return this._modelHoverTime},set:function(e){e<300&&(e=300),this._modelHoverTime=e}},{key:"modelHoverEffect",get:function(){return this._modelHoverEffect},set:function(e){this._modelHoverEffect=e}},{key:"modelSelectedEffect",get:function(){return this._modelSelectedEffect},set:function(e){this._modelSelectedEffect=e}}]),r}(),h=c;t.default=h},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var s=r(n(18)),l=r(n(13)),u=r(n(17)),c=r(n(16)),a=r(n(15));n(10),n(5),n(4);var o=r(n(2)),h=r(n(3)),x=r(n(363)),w=r(n(365)),b=r(n(366)),M=r(n(199));function f(e){if(void 0===c.default||null==e[u.default]){if((0,l.default)(e)||(e=d(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i,a=!0,o=!1;return{s:function(){r=(0,s.default)(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){o=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(o)throw i}}}}function d(e,t){if(e){if("string"==typeof e)return p(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?(0,a.default)(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?p(e,t):void 0}}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var m=function(){function e(){(0,o.default)(this,e)}return(0,h.default)(e,[{key:"mapDecode",value:function(e,t,n){var r=x.default.build("Map").decode(e),i="%E8%AF%B7%E8%BE%93%E5%85%A5%E6%AD%A3%E7%A1%AE%E7%9A%84license.";if(M.default.ls&&!M.default.checkLicense(r.key,t,n))return console.warn(decodeURIComponent(i)),null;for(var a={scene:null,floors:[]},o=0,s=r.buffers.length;o<s;o++){var l=r.buffers[o],u=l.len,c=l.data.offset,h=l.data.offset+u.low,f=l.data.buffer;if(1==l.btype){var d=b.default.build("Scene").decode(f.slice(c,h));a.scene=d}else{var p=l.gid,m=this.containsFloor(p,a.floors),v=m.floor;if(m.index<0&&(v.gid=p,v.biz=[],v.navi=[],v.geo=[]),2==l.btype){var g=w.default.build("FloorGeo").decode(f.slice(c,h));v.geo.push(g)}if(3==l.btype){var y=w.default.build("FloorBiz").decode(f.slice(c,h));v.biz.push(y)}if(4==l.btype){var _=w.default.build("FloorNavi").decode(f.slice(c,h));v.navi.push(_)}m.index<0?a.floors.push(v):a.floors[m.index]=v}}return a}},{key:"containsFloor",value:function(e,t){for(var n=0,r=t.length;n<r;n++)if(t[n].gid==e)return{index:n,floor:t[n]};return{index:-1,floor:{}}}},{key:"sceneDecode",value:function(e,t,n){var r=b.default.build("Scene").decode(e),i="%E8%AF%B7%E8%BE%93%E5%85%A5%E6%AD%A3%E7%A1%AE%E7%9A%84license.";return M.default.ls&&!M.default.checkLicense(r.key,t,n)?(console.warn(decodeURIComponent(i)),null):r}},{key:"floorGeoDecode",value:function(e){var t=w.default.build("FloorGeo").decode(e);return t}},{key:"floorBizDecode",value:function(e){var t=w.default.build("FloorBiz").decode(e);return t}},{key:"floorNaviDecode",value:function(e){var t=w.default.build("FloorNavi").decode(e);return t}},{key:"disposeRoot",value:function(e){var t,n=e.ns,r=f(n.children);try{for(r.s();!(t=r.n()).done;){var i=t.value;i.builder=void 0,i.parent=void 0,i.children.length=0,i._fields.length=0,i._fieldsById=void 0,i._fieldsByName=void 0}}catch(e){r.e(e)}finally{r.f()}n.children.length=0,e.ns=void 0,e.ptr=void 0}},{key:"dispose",value:function(){}}]),e}(),v=m;t.default=v},function(e,t,n){"use strict";var r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var i=n(148),a=i.ProtoBuf.newBuilder({}).import({messages:[{name:"Map",fields:[{rule:"required",type:"string",name:"mid",id:1},{rule:"required",type:"int32",name:"file_ver",id:2},{rule:"required",type:"uint64",name:"date_ver",id:3},{rule:"required",type:"string",name:"mname",id:4},{rule:"required",type:"string",name:"hash_code",id:5},{rule:"optional",type:"string",name:"key",id:6},{rule:"optional",type:"string",name:"file_date",id:7},{rule:"optional",type:"string",name:"desc",id:8},{rule:"optional",type:"bool",name:"read_only",id:9,options:{default:!1}},{rule:"repeated",type:"Buffer",name:"buffers",id:10}],messages:[{name:"Buffer",fields:[{rule:"required",type:"int32",name:"gid",id:1},{rule:"required",type:"int32",name:"file_ver",id:2},{rule:"required",type:"int32",name:"btype",id:3},{rule:"required",type:"uint64",name:"len",id:4},{rule:"required",type:"bytes",name:"data",id:5}]}]}]});t.default=a},function(){},function(e,t,n){"use strict";var r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var i=n(148),a=i.ProtoBuf.newBuilder({}).import({messages:[{name:"FloorGeo",syntax:"proto2",fields:[{rule:"required",type:"string",name:"mid",id:1},{rule:"required",type:"int32",name:"gid",id:2},{rule:"optional",type:"float",name:"height",id:3},{rule:"repeated",type:"GeneralGeoInfo",name:"extentLayer",id:4},{rule:"repeated",type:"GeneralGeoInfo",name:"modelLayer",id:5},{rule:"repeated",type:"GeneralGeoInfo",name:"labelLayer",id:6},{rule:"repeated",type:"GeneralGeoInfo",name:"poiLayer",id:7},{rule:"repeated",type:"GeneralGeoInfo",name:"polygonLayer",id:8},{rule:"repeated",type:"GeneralGeoInfo",name:"polygonLabelLayer",id:9},{rule:"repeated",type:"GeneralGeoInfo",name:"liftLayer",id:10},{rule:"repeated",type:"GeneralGeoInfo",name:"stairLayer",id:11},{rule:"repeated",type:"GeneralGeoInfo",name:"escalatorLayer",id:12},{rule:"repeated",type:"GeneralGeoInfo",name:"externalModelLayer",id:13}],messages:[{name:"GeneralGeoInfo",syntax:"proto2",fields:[{rule:"required",type:"int32",name:"eid",id:1},{rule:"optional",type:"string",name:"geo",id:2},{rule:"optional",type:"float",name:"height",id:3},{rule:"optional",type:"float",name:"area",id:4},{rule:"repeated",type:"Indexinfo",name:"idxs",id:5},{rule:"repeated",type:"double",name:"pts",id:6}],messages:[{name:"Indexinfo",syntax:"proto2",fields:[{rule:"repeated",type:"int32",name:"idxs",id:1}]}]}]},{name:"FloorBiz",syntax:"proto2",fields:[{rule:"required",type:"string",name:"mid",id:1},{rule:"required",type:"int32",name:"gid",id:2},{rule:"repeated",type:"ExtentBizInfo",name:"extentLayer",id:3},{rule:"repeated",type:"ModelBizInfo",name:"modelLayer",id:4},{rule:"repeated",type:"LabelBizInfo",name:"labelLayer",id:5},{rule:"repeated",type:"POIBizInfo",name:"poiLayer",id:6},{rule:"repeated",type:"PolygonBizInfo",name:"polygonLayer",id:7},{rule:"repeated",type:"LiftBizInfo",name:"liftLayer",id:8},{rule:"repeated",type:"StairBizInfo",name:"stairLayer",id:9},{rule:"repeated",type:"PolygonLabelBizInfo",name:"polygonLabelLayer",id:10},{rule:"repeated",type:"ExternalModelBizInfo",name:"externalModelLayer",id:11}],messages:[{name:"ExtentBizInfo",syntax:"proto2",fields:[{rule:"required",type:"int32",name:"eid",id:1},{rule:"optional",type:"string",name:"fid",id:2},{rule:"optional",type:"int32",name:"type",id:3},{rule:"optional",type:"string",name:"name",id:4},{rule:"optional",type:"string",name:"ename",id:5}]},{name:"ModelBizInfo",syntax:"proto2",fields:[{rule:"required",type:"int32",name:"eid",id:1},{rule:"optional",type:"string",name:"fid",id:2},{rule:"optional",type:"int32",name:"type",id:3},{rule:"optional",type:"string",name:"name",id:4},{rule:"optional",type:"string",name:"ename",id:5},{rule:"optional",type:"int32",name:"minlevel",id:6},{rule:"optional",type:"int32",name:"maxlevel",id:7},{rule:"optional",type:"int32",name:"pass",id:8}]},{name:"LabelBizInfo",syntax:"proto2",fields:[{rule:"required",type:"int32",name:"eid",id:1},{rule:"optional",type:"string",name:"fid",id:2},{rule:"optional",type:"int32",name:"type",id:3},{rule:"optional",type:"string",name:"name",id:4},{rule:"optional",type:"string",name:"ename",id:5},{rule:"optional",type:"int32",name:"minlevel",id:6},{rule:"optional",type:"int32",name:"maxlevel",id:7}]},{name:"PolygonBizInfo",syntax:"proto2",fields:[{rule:"required",type:"int32",name:"eid",id:1},{rule:"optional",type:"string",name:"fid",id:2},{rule:"optional",type:"int32",name:"type",id:3},{rule:"optional",type:"string",name:"name",id:4},{rule:"optional",type:"string",name:"ename",id:5}]},{name:"POIBizInfo",syntax:"proto2",fields:[{rule:"required",type:"int32",name:"eid",id:1},{rule:"optional",type:"string",name:"fid",id:2},{rule:"optional",type:"int32",name:"type",id:3},{rule:"optional",type:"string",name:"name",id:4},{rule:"optional",type:"string",name:"ename",id:5},{rule:"optional",type:"int32",name:"minlevel",id:6},{rule:"optional",type:"int32",name:"maxlevel",id:7}]},{name:"LiftBizInfo",syntax:"proto2",fields:[{rule:"required",type:"int32",name:"eid",id:1},{rule:"optional",type:"string",name:"fid",id:2},{rule:"optional",type:"int32",name:"type",id:3},{rule:"optional",type:"int32",name:"flag",id:4},{rule:"optional",type:"string",name:"floor",id:5},{rule:"optional",type:"int32",name:"minlevel",id:6},{rule:"optional",type:"int32",name:"maxlevel",id:7}]},{name:"StairBizInfo",syntax:"proto2",fields:[{rule:"required",type:"int32",name:"eid",id:1},{rule:"optional",type:"string",name:"fid",id:2},{rule:"optional",type:"int32",name:"type",id:3},{rule:"optional",type:"int32",name:"flag",id:4},{rule:"optional",type:"int32",name:"minlevel",id:5},{rule:"optional",type:"int32",name:"maxlevel",id:6}]},{name:"PolygonLabelBizInfo",syntax:"proto2",fields:[{rule:"required",type:"int32",name:"eid",id:1},{rule:"optional",type:"string",name:"fid",id:2},{rule:"optional",type:"int32",name:"type",id:3},{rule:"optional",type:"float",name:"width",id:4},{rule:"optional",type:"string",name:"name",id:5},{rule:"optional",type:"string",name:"ename",id:6},{rule:"optional",type:"float",name:"angle",id:7}]},{name:"ExternalModelBizInfo",syntax:"proto2",fields:[{rule:"required",type:"int32",name:"eid",id:1},{rule:"optional",type:"string",name:"fid",id:2},{rule:"optional",type:"int32",name:"type",id:3},{rule:"optional",type:"string",name:"name",id:4},{rule:"optional",type:"string",name:"ename",id:5}]}]},{name:"FloorNavi",syntax:"proto2",fields:[{rule:"required",type:"string",name:"mid",id:1},{rule:"required",type:"int32",name:"gid",id:2},{rule:"repeated",type:"NaviNode",name:"naviNodes",id:3},{rule:"repeated",type:"NaviSegment",name:"naviSegments",id:4},{rule:"repeated",type:"NaviZone",name:"naviZones",id:5},{rule:"repeated",type:"NaviModel",name:"naviModels",id:6},{rule:"repeated",type:"int32",name:"nextFloors",id:7}],messages:[{name:"NaviNode",syntax:"proto2",fields:[{rule:"optional",type:"int32",name:"nodeId",id:1},{rule:"optional",type:"int32",name:"nodeType",id:2},{rule:"optional",type:"int32",name:"liftType",id:3},{rule:"optional",type:"int32",name:"liftFlag",id:4},{rule:"optional",type:"int32",name:"liftEntry",id:5},{rule:"optional",type:"string",name:"liftFloor",id:6},{rule:"optional",type:"string",name:"linkSeg",id:7},{rule:"optional",type:"string",name:"geo",id:8},{rule:"optional",type:"int32",name:"entranceType",id:9},{rule:"optional",type:"string",name:"entranceFloor",id:10},{rule:"optional",type:"int32",name:"doortype",id:11},{rule:"repeated",type:"int32",name:"idxs",id:12},{rule:"repeated",type:"double",name:"pts",id:13}]},{name:"NaviSegment",syntax:"proto2",fields:[{rule:"optional",type:"int32",name:"segmentId",id:1},{rule:"optional",type:"int32",name:"snode",id:2},{rule:"optional",type:"int32",name:"enode",id:3},{rule:"optional",type:"double",name:"length",id:4},{rule:"optional",type:"int32",name:"rank",id:5},{rule:"optional",type:"string",name:"name",id:6},{rule:"optional",type:"int32",name:"entry",id:7},{rule:"optional",type:"string",name:"desc",id:8},{rule:"optional",type:"string",name:"geo",id:9},{rule:"optional",type:"int32",name:"through",id:10},{rule:"repeated",type:"int32",name:"idxs",id:11},{rule:"repeated",type:"double",name:"pts",id:12}]},{name:"NaviZone",syntax:"proto2",fields:[{rule:"required",type:"int32",name:"id",id:1},{rule:"required",type:"int32",name:"type",id:2,options:{default:0}},{rule:"required",type:"string",name:"geo",id:3},{rule:"repeated",type:"int32",name:"rejects",id:4}]},{name:"NaviModel",syntax:"proto2",fields:[{rule:"required",type:"int32",name:"id",id:1},{rule:"repeated",type:"int32",name:"doorids",id:2},{rule:"repeated",type:"int32",name:"nodetypes",id:3},{rule:"repeated",type:"int32",name:"entrytypes",id:4}]}]}]});t.default=a},function(e,t,n){"use strict";var r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var i=n(148),a=i.ProtoBuf.newBuilder({}).import({messages:[{name:"Scene",fields:[{rule:"required",type:"string",name:"mid",id:19},{rule:"required",type:"int32",name:"file_ver",id:20},{rule:"required",type:"uint64",name:"date_ver",id:21},{rule:"required",type:"string",name:"mname",id:22},{rule:"required",type:"string",name:"hash_code",id:23},{rule:"optional",type:"string",name:"key",id:24},{rule:"optional",type:"string",name:"desc",id:25},{rule:"optional",type:"bool",name:"read_only",id:26,options:{default:!1}},{rule:"optional",type:"float",name:"x",id:1},{rule:"optional",type:"float",name:"y",id:2},{rule:"optional",type:"float",name:"z",id:3},{rule:"optional",type:"float",name:"minX",id:4},{rule:"optional",type:"float",name:"minY",id:5},{rule:"optional",type:"float",name:"maxX",id:6},{rule:"optional",type:"float",name:"maxY",id:7},{rule:"optional",type:"string",name:"defGid",id:8},{rule:"optional",type:"float",name:"defCenX",id:9},{rule:"optional",type:"float",name:"defCenY",id:10},{rule:"optional",type:"float",name:"defCenZ",id:11},{rule:"optional",type:"float",name:"height",id:12},{rule:"optional",type:"float",name:"rotateAngleX",id:13},{rule:"optional",type:"float",name:"rotateAngleY",id:14},{rule:"optional",type:"float",name:"rotateAngleZ",id:15},{rule:"optional",type:"float",name:"scale",id:16},{rule:"optional",type:"string",name:"scaleLevel",id:17},{rule:"repeated",type:"LayerGroup",name:"layerGroups",id:18}],messages:[{name:"Layer",fields:[{rule:"optional",type:"int32",name:"lid",id:1},{rule:"optional",type:"string",name:"lname",id:2},{rule:"optional",type:"string",name:"alias",id:3},{rule:"optional",type:"Type",name:"ltype",id:4},{rule:"optional",type:"float",name:"offsetX",id:5},{rule:"optional",type:"float",name:"offsetY",id:6},{rule:"optional",type:"float",name:"height",id:7},{rule:"optional",type:"float",name:"rotateAngleX",id:8},{rule:"optional",type:"float",name:"rotateAngleY",id:9},{rule:"optional",type:"float",name:"rotateAngleZ",id:10},{rule:"optional",type:"float",name:"minScaleLevel",id:11},{rule:"optional",type:"float",name:"maxScaleLevel",id:12},{rule:"optional",type:"bool",name:"isVisible",id:13},{rule:"optional",type:"bool",name:"isSelectable",id:14},{rule:"optional",type:"bool",name:"isEditable",id:15},{rule:"optional",type:"string",name:"desc",id:16}],enums:[{name:"Type",values:[{name:"GEOPOINT",id:1},{name:"GEOPOINT_ESCALATOR",id:2},{name:"GEOPOINT_LIFT",id:3},{name:"GEOPOINT_STAIR",id:4},{name:"GEOPOINT_PANORAMA",id:5},{name:"GEOPOINT_POI",id:6},{name:"GEOPOINT_STORELABEL",id:7},{name:"GEOPOINT_NAVINODE",id:8},{name:"GEOPOINT_MODEL",id:9},{name:"GEOLINE",id:20},{name:"GEOLINE_NAVISEGMENT",id:21},{name:"GEOLINE_BORDER",id:22},{name:"GEOPOLYGON",id:30},{name:"GEOPOLYGON_EXTENT",id:31},{name:"GEOPOLYGON_STORE",id:32},{name:"GEOPOLYGON_LABEL",id:33},{name:"RASTERATA",id:40},{name:"OVERLAYDATA",id:50}]}]},{name:"LayerGroup",fields:[{rule:"optional",type:"int32",name:"gid",id:1},{rule:"optional",type:"string",name:"gname",id:2},{rule:"optional",type:"string",name:"alias",id:3},{rule:"optional",type:"float",name:"height",id:4},{rule:"optional",type:"string",name:"desc",id:5},{rule:"repeated",type:"Layer",name:"layers",id:6}]}]}]});t.default=a},function(e,t,n){"use strict";var r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var i,a=(i=function(e){return S(e)},{encryption:function(e){return i(e)}});function h(e,t){var n=(65535&e)+(65535&t),r=(e>>16)+(t>>16)+(n>>16);return r<<16|65535&n}function o(e,t){return e<<t|e>>>32-t}function s(e,t,n,r,i,a){return h(o(h(h(t,e),h(r,a)),i),n)}function f(e,t,n,r,i,a,o){return s(t&n|~t&r,e,t,i,a,o)}function d(e,t,n,r,i,a,o){return s(t&r|n&~r,e,t,i,a,o)}function p(e,t,n,r,i,a,o){return s(t^n^r,e,t,i,a,o)}function m(e,t,n,r,i,a,o){return s(n^(t|~r),e,t,i,a,o)}function l(e,t){var n,r,i,a,o;e[t>>5]|=128<<t%32,e[14+(t+64>>>9<<4)]=t;var s=1732584193,l=-271733879,u=-1732584194,c=271733878;for(n=0;n<e.length;n+=16)r=s,i=l,a=u,o=c,s=f(s,l,u,c,e[n],7,-680876936),c=f(c,s,l,u,e[n+1],12,-389564586),u=f(u,c,s,l,e[n+2],17,606105819),l=f(l,u,c,s,e[n+3],22,-1044525330),s=f(s,l,u,c,e[n+4],7,-176418897),c=f(c,s,l,u,e[n+5],12,1200080426),u=f(u,c,s,l,e[n+6],17,-1473231341),l=f(l,u,c,s,e[n+7],22,-45705983),s=f(s,l,u,c,e[n+8],7,1770035416),c=f(c,s,l,u,e[n+9],12,-1958414417),u=f(u,c,s,l,e[n+10],17,-42063),l=f(l,u,c,s,e[n+11],22,-1990404162),s=f(s,l,u,c,e[n+12],7,1804603682),c=f(c,s,l,u,e[n+13],12,-40341101),u=f(u,c,s,l,e[n+14],17,-1502002290),l=f(l,u,c,s,e[n+15],22,1236535329),s=d(s,l,u,c,e[n+1],5,-165796510),c=d(c,s,l,u,e[n+6],9,-1069501632),u=d(u,c,s,l,e[n+11],14,643717713),l=d(l,u,c,s,e[n],20,-373897302),s=d(s,l,u,c,e[n+5],5,-701558691),c=d(c,s,l,u,e[n+10],9,38016083),u=d(u,c,s,l,e[n+15],14,-660478335),l=d(l,u,c,s,e[n+4],20,-405537848),s=d(s,l,u,c,e[n+9],5,568446438),c=d(c,s,l,u,e[n+14],9,-1019803690),u=d(u,c,s,l,e[n+3],14,-187363961),l=d(l,u,c,s,e[n+8],20,1163531501),s=d(s,l,u,c,e[n+13],5,-1444681467),c=d(c,s,l,u,e[n+2],9,-51403784),u=d(u,c,s,l,e[n+7],14,1735328473),l=d(l,u,c,s,e[n+12],20,-1926607734),s=p(s,l,u,c,e[n+5],4,-378558),c=p(c,s,l,u,e[n+8],11,-2022574463),u=p(u,c,s,l,e[n+11],16,1839030562),l=p(l,u,c,s,e[n+14],23,-35309556),s=p(s,l,u,c,e[n+1],4,-1530992060),c=p(c,s,l,u,e[n+4],11,1272893353),u=p(u,c,s,l,e[n+7],16,-155497632),l=p(l,u,c,s,e[n+10],23,-1094730640),s=p(s,l,u,c,e[n+13],4,681279174),c=p(c,s,l,u,e[n],11,-358537222),u=p(u,c,s,l,e[n+3],16,-722521979),l=p(l,u,c,s,e[n+6],23,76029189),s=p(s,l,u,c,e[n+9],4,-640364487),c=p(c,s,l,u,e[n+12],11,-421815835),u=p(u,c,s,l,e[n+15],16,530742520),l=p(l,u,c,s,e[n+2],23,-995338651),s=m(s,l,u,c,e[n],6,-198630844),c=m(c,s,l,u,e[n+7],10,1126891415),u=m(u,c,s,l,e[n+14],15,-1416354905),l=m(l,u,c,s,e[n+5],21,-57434055),s=m(s,l,u,c,e[n+12],6,1700485571),c=m(c,s,l,u,e[n+3],10,-1894986606),u=m(u,c,s,l,e[n+10],15,-1051523),l=m(l,u,c,s,e[n+1],21,-2054922799),s=m(s,l,u,c,e[n+8],6,1873313359),c=m(c,s,l,u,e[n+15],10,-30611744),u=m(u,c,s,l,e[n+6],15,-1560198380),l=m(l,u,c,s,e[n+13],21,1309151649),s=m(s,l,u,c,e[n+4],6,-145523070),c=m(c,s,l,u,e[n+11],10,-1120210379),u=m(u,c,s,l,e[n+2],15,718787259),l=m(l,u,c,s,e[n+9],21,-343485551),s=h(s,r),l=h(l,i),u=h(u,a),c=h(c,o);return[s,l,u,c]}function u(e){var t,n="",r=32*e.length;for(t=0;t<r;t+=8)n+=String.fromCharCode(e[t>>5]>>>t%32&255);return n}function c(e){var t,n=[];for(n[(e.length>>2)-1]=void 0,t=0;t<n.length;t+=1)n[t]=0;var r=8*e.length;for(t=0;t<r;t+=8)n[t>>5]|=(255&e.charCodeAt(t/8))<<t%32;return n}function v(e){return u(l(c(e),8*e.length))}function g(e,t){var n,r,i=c(e),a=[],o=[];for(a[15]=o[15]=void 0,16<i.length&&(i=l(i,8*e.length)),n=0;n<16;n+=1)a[n]=909522486^i[n],o[n]=1549556828^i[n];return r=l(a.concat(c(t)),512+8*t.length),u(l(o.concat(r),640))}function y(e){var t,n,r="0123456789abcdef",i="";for(n=0;n<e.length;n+=1)t=e.charCodeAt(n),i+=r.charAt(t>>>4&15)+r.charAt(15&t);return i}function _(e){return unescape(encodeURIComponent(e))}function x(e){return v(_(e))}function w(e){return y(x(e))}function b(e,t){return g(_(e),_(t))}function M(e,t){return y(b(e,t))}function S(e,t,n){return t?(n?b:M)(t,e):(n?x:w)(e)}var E=a;t.default=E},function(e,t,n){e.exports=n(369)},function(e,t,n){n(105),n(59),n(65),n(370),n(372),n(375),n(376),e.exports=n(11).Map},function(e,t,n){"use strict";var r=n(371),i=n(84),a="Map";e.exports=n(179)(a,function(t){return function(e){return t(this,0<arguments.length?e:void 0)}},{get:function(e){var t=r.getEntry(i(this,a),e);return t&&t.v},set:function(e,t){return r.def(i(this,a),0===e?0:e,t)}},r,!0)},function(e,t,n){"use strict";var o=n(35).f,s=n(80),l=n(106),u=n(40),c=n(107),h=n(67),r=n(122),i=n(173),a=n(205),f=n(30),d=n(64).fastKey,p=n(84),m=f?"_s":"size",v=function(e,t){var n,r=d(t);if("F"!==r)return e._i[r];for(n=e._f;n;n=n.n)if(n.k==t)return n};e.exports={getConstructor:function(e,a,n,r){var i=e(function(e,t){c(e,i,a,"_i"),e._t=a,e._i=s(null),e._f=void 0,e._l=void 0,e[m]=0,null!=t&&h(t,n,e[r],e)});return l(i.prototype,{clear:function(){for(var e=p(this,a),t=e._i,n=e._f;n;n=n.n)n.r=!0,n.p&&(n.p=n.p.n=void 0),delete t[n.i];e._f=e._l=void 0,e[m]=0},delete:function(e){var t=p(this,a),n=v(t,e);if(n){var r=n.n,i=n.p;delete t._i[n.i],n.r=!0,i&&(i.n=r),r&&(r.p=i),t._f==n&&(t._f=r),t._l==n&&(t._l=i),t[m]--}return!!n},forEach:function(e,t){p(this,a);for(var n,r=u(e,1<arguments.length?t:void 0,3);n=n?n.n:this._f;)for(r(n.v,n.k,this);n&&n.r;)n=n.p},has:function(e){return!!v(p(this,a),e)}}),f&&o(i.prototype,"size",{get:function(){return p(this,a)[m]}}),i},def:function(e,t,n){var r,i,a=v(e,t);return a?a.v=n:(e._l=a={i:i=d(t,!0),k:t,v:n,p:r=e._l,n:void 0,r:!1},e._f||(e._f=a),r&&(r.n=a),e[m]++,"F"!==i&&(e._i[i]=a)),e},getEntry:v,setStrong:function(e,n,t){r(e,n,function(e,t){this._t=p(e,n),this._k=t,this._l=void 0},function(){for(var e=this,t=e._k,n=e._l;n&&n.r;)n=n.p;return e._t&&(e._l=n=n?n.n:e._t._f)?i(0,"keys"==t?n.k:"values"==t?n.v:[n.k,n.v]):(e._t=void 0,i(1))},t?"entries":"values",!t,!0),a(n)}}},function(e,t,n){var r=n(14);r(r.P+r.R,"Map",{toJSON:n(373)("Map")})},function(e,t,n){var r=n(99),i=n(374);e.exports=function(e){return function(){if(r(this)!=e)throw TypeError(e+"#toJSON isn't generic");return i(this)}}},function(e,t,n){var r=n(67);e.exports=function(e,t){var n=[];return r(e,!1,n.push,n,t),n}},function(e,t,n){n(180)("Map")},function(e,t,n){n(181)("Map")},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0,n(5),n(4);var a=r(n(6)),o=r(n(25)),s=r(n(2)),l=r(n(3)),u=r(n(7)),c=r(n(8)),h=r(n(9)),f=r(n(12)),d=r(n(33));function p(r){return function(){var e,t=(0,c.default)(r);if(m()){var n=(0,c.default)(this).constructor;e=(0,a.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,u.default)(this,e)}}function m(){if("undefined"==typeof Reflect||!a.default)return!1;if(a.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,a.default)(Date,[],function(){})),!0}catch(e){return!1}}var v=function(e){(0,h.default)(i,e);var r=p(i);function i(e,t){var n;return(0,s.default)(this,i),n=r.call(this,t.eid,d.default.FLOOR),n._parseData=null,n._isInitMesh=!0,n._visible=!0,n._renderNode=null,n._geometry=void 0,n.bdata=t,n.gdata=e,n}return(0,l.default)(i,[{key:"initMesh",value:function(e,t,n,r){this._geometry&&(this._renderNode=new fm.Mesh(this._geometry.geometry,e),this._renderNode.mapNode=this,e.color=new fm.Color(n),r=(0,o.default)(r),e.opacity=r,e.userData.opacity=r,e.transparent=!0,this._renderNode.scale.set(1,-1,1),this._renderNode.rotation.set(Math.PI/2,0,0,"XYZ"),this._renderNode.position.copy(t),this._renderNode.frustumCulled=!1,this._renderNode.parent=this.parent.scene,this._renderNode.visible=this.show,this._renderNode.receiveShadow=!0,this.renderNodeInited=!0,this._geometry=null)}},{key:"setByTheme",value:function(e){this._renderNode&&(this._renderNode.material.color=new fm.Color(e.floorColor),this._renderNode.material.alpha=e.floorOpacity,this._renderNode.material.userData.opacity=e.floorOpacity)}},{key:"checkByFrustum",value:function(){var e=!0;this._renderNode&&this._renderNode.updateMatrixWorld(!0),this.visible=e}},{key:"releaseGpuMemory",value:function(){this.renderNode&&(this._geometry=null,this.renderNodeInited=!1,this.renderNode.parent.remove(this.renderNode),this.dispose())}},{key:"restoreGpuMemeory",value:function(){}},{key:"getBbox",value:function(){}},{key:"dispose",value:function(){this._renderNode&&(this._renderNode.material.dispose(),this._renderNode.geometry.dispose(),this._renderNode.material=void 0,this._renderNode.geometry=void 0,this._geometry=void 0,this._renderNode.mapNode=void 0,this._renderNode=void 0)}},{key:"isInitMesh",set:function(e){this._isInitMesh=e},get:function(){return this._isInitMesh}},{key:"visible",set:function(e){e?this.parent.scene.children.indexOf(this._renderNode)<0&&this._renderNode&&this.parent.scene.add(this._renderNode):(this._renderNode&&this.parent.scene.remove(this._renderNode),this._renderNode.parent=this.parent.scene),this._visible=e},get:function(){return this._visible}},{key:"renderNode",get:function(){return this._renderNode},set:function(e){this._renderNode=e}}]),i}(f.default),g=v;t.default=g},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0,n(5),n(4);var a=r(n(6)),o=r(n(2)),s=r(n(3)),l=r(n(7)),u=r(n(8)),c=r(n(9)),h=r(n(12)),f=r(n(207)),d=r(n(87));function p(r){return function(){var e,t=(0,u.default)(r);if(m()){var n=(0,u.default)(this).constructor;e=(0,a.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,l.default)(this,e)}}function m(){if("undefined"==typeof Reflect||!a.default)return!1;if(a.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,a.default)(Date,[],function(){})),!0}catch(e){return!1}}r(n(34));var v=function(e){(0,c.default)(i,e);var r=p(i);function i(e,t){var n;return(0,o.default)(this,i),n=r.call(this,"externalModelLayer"),n._scene=new fm.Scene,n._scene,n._scene.userData.type="externalModel",n.alias="externalModel",n._models={},n.initNode(e,t),n._visible=!0,n.initLight(),n.putLight(),n}return(0,s.default)(i,[{key:"initNode",value:function(e,t){for(var n=0;n<e.length;n++)this.createNode(e[n],t[n])}},{key:"createNode",value:function(e,t){var n=new f.default(e,t);n.parent=this,this._models[""+n.eid]=n}},{key:"addNodes",value:function(e){e.parent=this,e.renderNode&&this._scene.add(e.renderNode),this._models[""+e.eid]=e}},{key:"traverse",value:function(e){for(var t in this._models)e&&e(this._models[t])}},{key:"initLight",value:function(){this._target=new fm.Object3D,this._mainLight=new fm.DirectionalLight(8947848,1.2),this._mainLight.position.set(-1,1,1).normalize(),this._mainLight.target=this._target,this._secondLight=new fm.DirectionalLight(3355443),this._secondLight.position.set(-.5,1,-1).normalize(),this._secondLight.target=this._target}},{key:"putLight",value:function(){d.default.light?this._ambientLight=new fm.AmbientLight(4210752):(this._ambientLight=new fm.AmbientLight(7631988),this.scene.add(this._mainLight),this.scene.add(this._secondLight),this.scene.add(this._target)),this.scene.add(this._ambientLight),this.scene.removeLight=function(){}}},{key:"removeLight",value:function(){this.scene.remove(this._mainLight),this.scene.remove(this._ambientLight),this.scene.remove(this._secondLight),this.scene.add(this._target)}},{key:"disposeLight",value:function(){this._mainLight=void 0,this._ambientLight=void 0}},{key:"getNodeById",value:function(e){return this._models[""+e]}},{key:"checkSceneNode",value:function(){for(var e in this._scene.children.length=0,this._models)this._models[e].visible&&this._models[e].renderNode&&this._scene.add(this._models[e].renderNode);this.putLight()}},{key:"dispose",value:function(){for(var e in this._models)this._models[e].dispose(),this._scene.remove(this._models[e].renderNode),this._models[e].parent=void 0,this._models[e]=void 0;this.removeLight(),this.disposeLight(),this._scene.length=0,this._scene=void 0}},{key:"scene",get:function(){return this._scene}},{key:"visible",get:function(){return this._visible},set:function(e){this._visible=e,this.parent&&this.parent.parent&&this.parent.parent.parent&&this.parent.parent.parent.map.setRenderList()}},{key:"show",get:function(){return this.visible},set:function(e){this.visible=e}}]),i}(h.default),g=v;t.default=g},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0,n(70);var c=r(n(55)),h=r(n(2)),o=r(n(3)),a=1e-5,y=0,_=1,x=2,w=3,s=function(){function u(e){(0,h.default)(this,u);var t,n,r,i,a,o,s,l=[];if(this.Polygon=f,this.Vertex=d,this.Node=p,e instanceof fm.Geometry)this.matrix=new fm.Matrix4;else{if(!(e instanceof fm.Mesh)){if(e instanceof p)return this.tree=e,this.matrix=new fm.Matrix4,this;throw"ThreeBSP: Given geometry is unsupported"}e.updateMatrix(),this.matrix=e.matrix.clone(),e=e.geometry}for(t=0,n=e.faces.length;t<n;t++){if(r=e.faces[t],a=e.faceVertexUvs[0][t],s=new f,r instanceof fm.Face3)i=e.vertices[r.a],o=a?new fm.Vector2(a[0].x,a[0].y):null,i=new d(i.x,i.y,i.z,r.vertexNormals[0],o),i.applyMatrix4(this.matrix),s.vertices.push(i),i=e.vertices[r.b],o=a?new fm.Vector2(a[1].x,a[1].y):null,i=new d(i.x,i.y,i.z,r.vertexNormals[1],o),i.applyMatrix4(this.matrix),s.vertices.push(i),i=e.vertices[r.c],o=a?new fm.Vector2(a[2].x,a[2].y):null,i=new d(i.x,i.y,i.z,r.vertexNormals[2],o),i.applyMatrix4(this.matrix),s.vertices.push(i);else{if(!(0,c.default)(fm.Face4))throw"Invalid face type at index "+t;i=e.vertices[r.a],o=a?new fm.Vector2(a[0].x,a[0].y):null,i=new d(i.x,i.y,i.z,r.vertexNormals[0],o),i.applyMatrix4(this.matrix),s.vertices.push(i),i=e.vertices[r.b],o=a?new fm.Vector2(a[1].x,a[1].y):null,i=new d(i.x,i.y,i.z,r.vertexNormals[1],o),i.applyMatrix4(this.matrix),s.vertices.push(i),i=e.vertices[r.c],o=a?new fm.Vector2(a[2].x,a[2].y):null,i=new d(i.x,i.y,i.z,r.vertexNormals[2],o),i.applyMatrix4(this.matrix),s.vertices.push(i),i=e.vertices[r.d],o=a?new fm.Vector2(a[3].x,a[3].y):null,i=new d(i.x,i.y,i.z,r.vertexNormals[3],o),i.applyMatrix4(this.matrix),s.vertices.push(i)}s.calculateProperties(),l.push(s)}this.tree=new p(l)}return(0,o.default)(u,[{key:"subtract",value:function(e){var t=this.tree.clone(),n=e.tree.clone();return t.invert(),t.clipTo(n),n.clipTo(t),n.invert(),n.clipTo(t),n.invert(),t.build(n.allPolygons()),t.invert(),t=new u(t),t.matrix=this.matrix,t}},{key:"union",value:function(e){var t=this.tree.clone(),n=e.tree.clone();return t.clipTo(n),n.clipTo(t),n.invert(),n.clipTo(t),n.invert(),t.build(n.allPolygons()),t=new u(t),t.matrix=this.matrix,t}},{key:"intersect",value:function(e){var t=this.tree.clone(),n=e.tree.clone();return t.invert(),n.clipTo(t),n.invert(),t.clipTo(n),n.clipTo(t),t.build(n.allPolygons()),t.invert(),t=new u(t),t.matrix=this.matrix,t}},{key:"toGeometry",value:function(){var e,t,n,r,i,a,o,s,l,u,c=(new fm.Matrix4).getInverse(this.matrix),h=new fm.Geometry,f=this.tree.allPolygons(),d=f.length,p={};for(e=0;e<d;e++)for(n=f[e],r=n.vertices.length,t=2;t<r;t++)u=[],s=n.vertices[0],u.push(new fm.Vector2(s.uv.x,s.uv.y)),s=new fm.Vector3(s.x,s.y,s.z),s.applyMatrix4(c),i=void 0!==p[s.x+","+s.y+","+s.z]?p[s.x+","+s.y+","+s.z]:(h.vertices.push(s),p[s.x+","+s.y+","+s.z]=h.vertices.length-1),s=n.vertices[t-1],u.push(new fm.Vector2(s.uv.x,s.uv.y)),s=new fm.Vector3(s.x,s.y,s.z),s.applyMatrix4(c),a=void 0!==p[s.x+","+s.y+","+s.z]?p[s.x+","+s.y+","+s.z]:(h.vertices.push(s),p[s.x+","+s.y+","+s.z]=h.vertices.length-1),s=n.vertices[t],u.push(new fm.Vector2(s.uv.x,s.uv.y)),s=new fm.Vector3(s.x,s.y,s.z),s.applyMatrix4(c),o=void 0!==p[s.x+","+s.y+","+s.z]?p[s.x+","+s.y+","+s.z]:(h.vertices.push(s),p[s.x+","+s.y+","+s.z]=h.vertices.length-1),l=new fm.Face3(i,a,o,new fm.Vector3(n.normal.x,n.normal.y,n.normal.z)),h.faces.push(l),h.faceVertexUvs[0].push(u);return h}},{key:"toMesh",value:function(e){var t=this.toGeometry(),n=new fm.Mesh(t,e);return n.position.setFromMatrixPosition(this.matrix),n.rotation.setFromRotationMatrix(this.matrix),n}}]),u}();t.default=s;var f=function(){function g(e){(0,h.default)(this,g),e instanceof Array||(e=[]),this.vertices=e,0<e.length?this.calculateProperties():this.normal=this.w=void 0}return(0,o.default)(g,[{key:"calculateProperties",value:function(){var e=this.vertices[0],t=this.vertices[1],n=this.vertices[2];return this.normal=t.clone().subtract(e).cross(n.clone().subtract(e)).normalize(),this.w=this.normal.clone().dot(e),this}},{key:"clone",value:function(){var e,t,n=new g;for(e=0,t=this.vertices.length;e<t;e++)n.vertices.push(this.vertices[e].clone());return n.calculateProperties(),n}},{key:"flip",value:function(){var e,t=[];for(this.normal.multiplyScalar(-1),this.w*=-1,e=this.vertices.length-1;0<=e;e--)t.push(this.vertices[e]);return this.vertices=t,this}},{key:"classifyVertex",value:function(e){var t=this.normal.dot(e)-this.w;return t<-a?x:a<t?_:y}},{key:"classifySide",value:function(e){var t,n,r,i=0,a=0,o=e.vertices.length;for(t=0;t<o;t++)n=e.vertices[t],r=this.classifyVertex(n),r===_?i++:r===x&&a++;return i===o&&0===a?_:0===i&&a===o?x:0<i&&0<a?w:y}},{key:"splitPolygon",value:function(e,t,n,r,i){var a=this.classifySide(e);if(a===y)(0<this.normal.dot(e.normal)?t:n).push(e);else if(a===_)r.push(e);else if(a===x)i.push(e);else{var o,s,l,u,c,h,f,d,p,m=[],v=[];for(s=0,o=e.vertices.length;s<o;s++)l=(s+1)%o,h=e.vertices[s],f=e.vertices[l],u=this.classifyVertex(h),c=this.classifyVertex(f),u!=x&&m.push(h),u!=_&&v.push(h),(u|c)===w&&(d=(this.w-this.normal.dot(h))/this.normal.dot(f.clone().subtract(h)),p=h.interpolate(f,d),m.push(p),v.push(p));3<=m.length&&r.push(new g(m).calculateProperties()),3<=v.length&&i.push(new g(v).calculateProperties())}}}]),g}(),d=function(){function a(e,t,n,r,i){(0,h.default)(this,a),this.x=e,this.y=t,this.z=n,this.normal=r||new fm.Vector3,this.uv=i||new fm.Vector2}return(0,o.default)(a,[{key:"clone",value:function(){return new a(this.x,this.y,this.z,this.normal.clone(),this.uv.clone())}},{key:"add",value:function(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}},{key:"subtract",value:function(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}},{key:"multiplyScalar",value:function(e){return this.x*=e,this.y*=e,this.z*=e,this}},{key:"cross",value:function(e){var t=this.x,n=this.y,r=this.z;return this.x=n*e.z-r*e.y,this.y=r*e.x-t*e.z,this.z=t*e.y-n*e.x,this}},{key:"normalize",value:function(){var e=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z);return this.x/=e,this.y/=e,this.z/=e,this}},{key:"dot",value:function(e){return this.x*e.x+this.y*e.y+this.z*e.z}},{key:"lerp",value:function(e,t){return this.add(e.clone().subtract(this).multiplyScalar(t)),this.normal.add(e.normal.clone().sub(this.normal).multiplyScalar(t)),this.uv.add(e.uv.clone().sub(this.uv).multiplyScalar(t)),this}},{key:"interpolate",value:function(e,t){return this.clone().lerp(e,t)}},{key:"applyMatrix4",value:function(e){var t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[4]*n+i[8]*r+i[12],this.y=i[1]*t+i[5]*n+i[9]*r+i[13],this.z=i[2]*t+i[6]*n+i[10]*r+i[14],this}}]),a}(),p=function(){function a(e){(0,h.default)(this,a);var t,n,r=[],i=[];if(this.polygons=[],this.front=this.back=void 0,e instanceof Array&&0!==e.length){for(this.divider=e[0].clone(),t=0,n=e.length;t<n;t++)this.divider.splitPolygon(e[t],this.polygons,this.polygons,r,i);0<r.length&&(this.front=new a(r)),0<i.length&&(this.back=new a(i))}}return(0,o.default)(a,[{key:"isConvex",value:function(e){var t,n;for(t=0;t<e.length;t++)for(n=0;n<e.length;n++)if(t!==n&&e[t].classifySide(e[n])!==x)return!1;return!0}},{key:"build",value:function(e){var t,n,r=[],i=[];for(this.divider||(this.divider=e[0].clone()),t=0,n=e.length;t<n;t++)this.divider.splitPolygon(e[t],this.polygons,this.polygons,r,i);0<r.length&&(this.front||(this.front=new a),this.front.build(r)),0<i.length&&(this.back||(this.back=new a),this.back.build(i))}},{key:"allPolygons",value:function(){var e=this.polygons.slice();return this.front&&(e=e.concat(this.front.allPolygons())),this.back&&(e=e.concat(this.back.allPolygons())),e}},{key:"clone",value:function(){var e=new a;return e.divider=this.divider.clone(),e.polygons=this.polygons.map(function(e){return e.clone()}),e.front=this.front&&this.front.clone(),e.back=this.back&&this.back.clone(),e}},{key:"invert",value:function(){var e,t,n;for(e=0,t=this.polygons.length;e<t;e++)this.polygons[e].flip();return this.divider.flip(),this.front&&this.front.invert(),this.back&&this.back.invert(),n=this.front,this.front=this.back,this.back=n,this}},{key:"clipPolygons",value:function(e){var t,n,r,i;if(!this.divider)return e.slice();for(r=[],i=[],t=0,n=e.length;t<n;t++)this.divider.splitPolygon(e[t],r,i,r,i);return this.front&&(r=this.front.clipPolygons(r)),i=this.back?this.back.clipPolygons(i):[],r.concat(i)}},{key:"clipTo",value:function(e){this.polygons=e.clipPolygons(this.polygons),this.front&&this.front.clipTo(e),this.back&&this.back.clipTo(e)}}]),a}()},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var s=r(n(18)),l=r(n(13)),u=r(n(17)),c=r(n(16)),a=r(n(15));n(10),n(5),n(4),n(381),n(71),n(190),n(110);var G=r(n(31));n(21);var z=r(n(25)),o=r(n(2)),h=r(n(3)),V=r(n(58));function H(e){if(void 0===c.default||null==e[u.default]){if((0,l.default)(e)||(e=f(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i,a=!0,o=!1;return{s:function(){r=(0,s.default)(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){o=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(o)throw i}}}}function f(e,t){if(e){if("string"==typeof e)return d(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?(0,a.default)(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(e,t):void 0}}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}r(n(147));var p=function(){function t(e){(0,o.default)(this,t),this._data={},this._textureData={},this._textureArray=[],this.font=e,this._textData={}}return(0,h.default)(t,[{key:"createBasicMaterial",value:function(e){var t=new fm.MeshBasicMaterial;return e?(t.color=new fm.Color(e.color),t.transparent=!0,t.depthWrite=!0,t.opacity=(0,z.default)(e.alpha),t.userData.opacity=(0,z.default)(e.alpha)):t.userData.opacity=1,t}},{key:"createNormalMaterial",value:function(e){var t=new fm.MeshLambertMaterial;return e?(t.color=new fm.Color(e.color),t.transparent=!0,t.depthWrite=!0,t.opacity=(0,z.default)(e.alpha),t.userData.opacity=(0,z.default)(e.alpha)):t.userData.opacity=1,t}},{key:"createPhysicMaterial",value:function(e){var t=new fm.MeshStandardMaterial({roughness:.5,metalness:.5});return e?(t.color=new fm.Color(e.color),t.transparent=!0,t.depthWrite=!0,t.opacity=(0,z.default)(e.alpha),t.userData.opacity=(0,z.default)(e.alpha)):t.userData.opacity=1,t}},{key:"createMeshPhongMaterial",value:function(e){var t=new fm.MeshPhongMaterial({shininess:50,specular:16777215});return e?(t.color=new fm.Color(e.color),t.transparent=!0,t.depthWrite=!0,t.opacity=(0,z.default)(e.alpha),t.userData.opacity=(0,z.default)(e.alpha)):t.userData.opacity=1,t}},{key:"createLineMaterial",value:function(e){if(!e)return new fm.LineBasicMaterial({color:"#ff0000",linewidth:1,transparent:!0,opacity:1});0===e.strokeColor&&(e.strokeColor="#000000");var t={color:e.strokeColor?e.strokeColor:"#ff0000",linewidth:1,transparent:!0,opacity:(0,z.default)(e.alpha)},n=new fm.LineBasicMaterial(t);return n.userData.opacity=(0,z.default)(e.alpha),n}},{key:"createPoiMaterial",value:function(t,n,e,r){var i=this,a=new fm.SpriteMaterial;if(a.sizeAttenuation=!1,a.opacity=1,a.userData.opacity=1,a.depthTest=!!e,a.depthWrite=!!e,a.transparent=!0,a.side=2,a.priority=r,this._textureData[t.imageUrl]){var o=this._textureData[t.imageUrl];o.minFilter=fm.LinearFilter,o.generateMipmaps=!1,o.needsUpdate=!0,a.map=o,a.needsUpdate=!0,n&&n()}else{var s=new Image;s.crossOrigin="Anonymous";var l=navigator.userAgent,u=/(msie\s|trident.*rv:)([\w.]+)/,c=u.exec(l.toLowerCase());s.onload=null!==c?new function(){var e=new fm.Texture(s);e.minFilter=fm.LinearFilter,e.generateMipmaps=!1,e.needsUpdate=!0,a.map=e,a.needsUpdate=!0,i._textureData[t.imageUrl]=e,i._textureArray.push(e),n&&n()}:function(){var e=new fm.Texture(s);e.minFilter=fm.LinearFilter,e.generateMipmaps=!1,e.needsUpdate=!0,a.map=e,a.needsUpdate=!0,i._textureData[t.imageUrl]=e,i._textureArray.push(e),n&&n()},s.src=t.imageSrc}return a}},{key:"createLabelMaterial",value:function(t,n,e){var r=this,i=new fm.SpriteMaterial;if(i.sizeAttenuation=!1,i.opacity=(0,z.default)(n.alpha),i.userData.opacity=(0,z.default)(n.alpha),i.depthTest=!!e,i.depthWrite=!!e,i.transparent=!0,i.side=2,i.opacity=1,n.imageSrc)if(this._data[n.imageUrl]){var a=this._data[n.imageUrl],o=this.excuteLabelTexture(t,a,n);i.map=o,this._textureArray.push(o),i.userData.scaleRatio=i.map.scaleRatio,i.userData.mspriteScale=i.map.mspriteScale,i.needsUpdate=!0}else{var s=new Image,l=r.excuteLabelTexture(t,!0,n,!0);s.crossOrigin="Anonymous",i.userData.scaleRatio=l.scaleRatio,i.userData.mspriteScale=l.mspriteScale;var u=navigator.userAgent,c=/(msie\s|trident.*rv:)([\w.]+)/,h=c.exec(u.toLowerCase());s.onload=null!==h?new function(){var e=r.excuteLabelTexture(t,s,n);i.map=e,r._textureArray.push(e),i.needsUpdate=!0,r._data[n.imageUrl]=s}:function(){var e=r.excuteLabelTexture(t,s,n);i.map=e,r._textureArray.push(e),i.needsUpdate=!0,r._data[n.imageUrl]=s},s.src=n.imageSrc}else{var f=this.excuteLabelTexture(t,!1,n);i.map=f,this._textureArray.push(f),i.userData.scaleRatio=i.map.scaleRatio,i.userData.mspriteScale=i.map.mspriteScale,i.needsUpdate=!0}return i}},{key:"excuteSDFLabelTexture",value:function(e,t,n,r){var i=1,a=1.5*i,o=12*i,s=2*i;t||(o=0,s=0);var l=2*i,u=3*i,c=3*i,h=14*i,f=1,d=2*i,p=document.createElement("canvas"),m=p.getContext("2d"),v=this.font.family;m.font=h+"px "+v;var g,y,_,x=-1<e.indexOf("%rn%");if(x){_=e.split("%rn%");var w,b=0,M=0,S=H(_);try{for(S.s();!(w=S.n()).done;){var E=w.value;b=Math.max(m.measureText(E).width,b),M+=h}}catch(e){S.e(e)}finally{S.f()}M+=(_.length-1)*l,f=_.length,g=b+s+o+2*c,y=Math.max(M,o)+2*u}else{var T=m.measureText(e).width;g=T+s+o+2*c,y=Math.max(h,o)+2*u}if(r)return{scaleRatio:y/g,mspriteScale:f};if(p.width=g,p.height=y,p.style.width=g+"px",p.style.height=y+"px",n.platecolor||n.platestrokecolor){var A=n.platecolor.split(",");if(n.platecolor&&(m.fillStyle="rgb(".concat((0,G.default)(A[0]),",").concat((0,G.default)(A[1]),",").concat((0,G.default)(A[2]),")")),m.lineWidth=i,this.drawRadiuRect(m,g,y,5*i,{x:0,y:0}),n.platecolor&&m.fill(),n.platestrokecolor){var L=n.platestrokecolor.split(",");m.strokeStyle="rgb(".concat((0,G.default)(L[0]),",").concat((0,G.default)(L[1]),",").concat((0,G.default)(L[2]),")"),m.stroke()}m.beginPath()}var R=o+s,C=(y-o)/2,I=(y-h)/2;m.font=h+"px "+v,m.textBaseline="top",m.strokeStyle=V.default.toRgba(n.strokecolor),m.lineWidth=d;var k=0,P=!!navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),N=navigator.vendor&&-1<navigator.vendor.indexOf("Apple")&&navigator.userAgent&&-1==navigator.userAgent.indexOf("CriOS")&&-1==navigator.userAgent.indexOf("FxiOS");if((-1<navigator.userAgent.indexOf("Edge")||P||N)&&(k=-4),k*=i,x)for(var D=u,O=0;O<_.length;O++)O&&(D+=h+l),m.strokeText(_[O],R,D);else m.strokeText(e,R,I+a+k);if(m.fillStyle=V.default.toRgba(n.fillcolor),x)for(var F=u,B=0;B<_.length;B++)B&&(F+=h+l),m.fillText(_[B],R,F);else m.fillText(e,R,I+a+k);t&&m.drawImage(t,0,C,o,o);var U=new fm.CanvasTexture(p);return U.minFilter=fm.LinearFilter,U.generateMipmaps=!1,U.scaleRatio=p.height/p.width,U.mspriteScale=f,U}},{key:"excuteLabelTexture",value:function(e,t,n,r){var i=2,a=1.5*i,o=1.2*n.fontsize*i,s=2*i;t||(o=0,s=5*i);var l=2*i,u=3*i,c=3*i,h=n.fontsize*i*1.2,f=1,d=2*i,p=document.createElement("canvas"),m=p.getContext("2d"),v=this.font.family;m.font=h+"px "+v;var g,y,_,x=-1<e.indexOf("%rn%");if(x){_=e.split("%rn%");var w,b=0,M=0,S=H(_);try{for(S.s();!(w=S.n()).done;){var E=w.value;b=Math.max(m.measureText(E).width,b),M+=h}}catch(e){S.e(e)}finally{S.f()}M+=(_.length-1)*l,f=_.length,g=b+s+o+2*c,y=Math.max(M,o)+2*u}else{var T=m.measureText(e).width;g=T+s+o+2*c,y=Math.max(h,o)+2*u}if(r)return{scaleRatio:y/g,mspriteScale:f};p.width=g,p.height=y,p.style.width=g+"px",p.style.height=y+"px",(n.platecolor||n.platestrokecolor)&&(n.platecolor&&(m.fillStyle=V.default.toRgba(n.platecolor)),m.lineWidth=i,this.drawRadiuRect(m,g-o,y,5*i,{x:0+o,y:0}),n.platecolor&&m.fill(),n.platestrokecolor&&(m.strokeStyle=V.default.toRgba(n.platestrokecolor),m.stroke()),m.beginPath());var A=o+s,L=(y-o)/2,R=(y-h)/2;m.font=h+"px "+v,m.textBaseline="top",m.lineWidth=d*(n.strokewidth?n.strokewidth:1);var C=1;n.strokewidth&&(C=(0,z.default)(n.strokewidth));var I=0,k=!1,P=navigator.mimeTypes;for(var N in P)"application/vnd.chromium.remoting-viewer"==P[N].type&&(k=!0);k&&(I=-4-(h-28)/6);var D=!!navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),O=navigator.vendor&&-1<navigator.vendor.indexOf("Apple")&&navigator.userAgent&&-1==navigator.userAgent.indexOf("CriOS")&&-1==navigator.userAgent.indexOf("FxiOS");if((-1<navigator.userAgent.indexOf("Edge")||D||O)&&(I=-4-(h-28)/6),(-1<navigator.userAgent.indexOf("QQBrowser")||D||O)&&(I=-4-(h-28)/6),(-1<navigator.userAgent.indexOf(".NET4.0C")||D||O)&&(I=-4-(h-28)/6),I*=i,n.strokecolor&&0!==C)if(m.strokeStyle=V.default.toRgba(n.strokecolor),x)for(var F=0;F<_.length;F++)t?m.strokeText(_[F],A,(y-h*_.length)/2+h*F):"left"==n.textAlign?(m.textAlign="left",m.strokeText(_[F],0,(y-h*_.length)/2+h*F)):"right"==n.textAlign?(m.textAlign="right",m.strokeText(_[F],g,(y-h*_.length)/2+h*F)):(m.textAlign="center",m.strokeText(_[F],g/2,(y-h*_.length)/2+h*F));else t?m.strokeText(e,A,R+a+I):"left"==n.textAlign?m.strokeText(e,0,R+a+I):"right"==n.textAlign?(m.textAlign="right",m.strokeText(e,g,R+a+I)):(m.textAlign="center",m.strokeText(e,g/2,R+a+I));if(m.fillStyle=V.default.toRgba(n.fillcolor),x)for(var B=0;B<_.length;B++)t?m.fillText(_[B],A,(y-h*_.length)/2+h*B):"left"==n.textAlign?(m.textAlign="left",m.fillText(_[B],0,(y-h*_.length)/2+h*B)):"right"==n.textAlign?(m.textAlign="right",m.fillText(_[B],g,(y-h*_.length)/2+h*B)):(m.textAlign="center",m.fillText(_[B],g/2,(y-h*_.length)/2+h*B));else t?m.fillText(e,A,R+a+I):"left"==n.textAlign?(m.textAlign="left",m.fillText(e,0,R+a+I)):"right"==n.textAlign?(m.textAlign="right",m.fillText(e,g,R+a+I)):(m.textAlign="center",m.fillText(e,g/2,R+a+I));t&&m.drawImage(t,0,L,o,o);var U=new fm.CanvasTexture(p);return U.minFilter=fm.LinearFilter,U.generateMipmaps=!1,U.scaleRatio=p.height/p.width,U.mspriteScale=f,U}},{key:"createTextMaterial",value:function(e,t){var n=new fm.SpriteMaterial;n.sizeAttenuation=!1,n.opacity=(0,z.default)(1),n.userData.opacity=(0,z.default)(1),n.depthTest=!1,n.depthWrite=!1,n.transparent=!0,n.side=2;var r=this.executeTexTexture(e,t);return n.map=r,n.size=r.size,n.userData.scaleRatio=n.map.scaleRatio,n.userData.mspriteScale=n.map.mspriteScale,n.needsUpdate=!0,n}},{key:"executeTexTexture",value:function(e,t,n,r){this.parent;var i=2,a=12*i,o=2*i;n||(a=0,o=0);var s,l,u,c=2*i,h=3*i,f=3*i,d=1,p=2*i,m=document.createElement("canvas"),v=m.getContext("2d"),g=this.font.family,y=0,_=0,x=H(e);try{for(x.s();!(u=x.n()).done;){var w=u.value,b=w.fontsize*i;v.font=b+"px "+g,y=Math.max(v.measureText(w.text).width,y),_+=b}}catch(e){x.e(e)}finally{x.f()}if(_+=(e.length-1)*c,d=e.length,s=y+o+a+2*f,l=Math.max(_,a)+2*h,r)return{scaleRatio:l/s,mspriteScale:d};m.width=s,m.height=l,m.style.width=s+"px",m.style.height=l+"px",t.platecolor&&(v.fillStyle=V.default.toRgba(t.platecolor),v.lineWidth=i,this.drawRadiuRect(v,s,l,5*i,{x:0,y:0}),v.fill(),t.platestrokecolor&&(v.strokeStyle=V.default.toRgba(t.platestrokecolor),v.stroke()),v.beginPath());var M=4,S=!1,E=navigator.mimeTypes;for(var T in E)"application/vnd.chromium.remoting-viewer"==E[T].type&&(S=!0);var A=-6;A+=8*(e.length-1),S&&(M=A-(_-28)/6);var L=!!navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),R=navigator.vendor&&-1<navigator.vendor.indexOf("Apple")&&navigator.userAgent&&-1==navigator.userAgent.indexOf("CriOS")&&-1==navigator.userAgent.indexOf("FxiOS");(-1<navigator.userAgent.indexOf("Edge")||L||R)&&(M=A-(_-28)/6),(-1<navigator.userAgent.indexOf("QQBrowser")||L||R)&&(M=A-(_-28)/6),(-1<navigator.userAgent.indexOf(".NET4.0C")||L||R)&&(M=A-(_-28)/6),v.textBaseline="top";for(var C=h,I=0;I<e.length;I++)if(e[I].strokecolor){v.lineWidth=p;var k=e[I].fontsize*i;v.font=k+"px "+g,v.strokeStyle=V.default.toRgba(e[I].strokecolor),I&&(C+=e[I-1].fontsize*i+c),0==t.textAlign?(v.textAlign="left",v.strokeText(e[I].text,0,C+M)):2==t.textAlign?(v.textAlign="right",v.strokeText(e[I].text,s,C+M)):(v.textAlign="center",v.strokeText(e[I].text,s/2,C+M))}C=h;for(var P=0;P<e.length;P++){var N=e[P].fontsize*i;v.font=N+"px "+g,v.fillStyle=V.default.toRgba(e[P].fontcolor),P&&(C+=e[P-1].fontsize*i+c),0==t.textAlign?(v.textAlign="left",v.fillText(e[P].text,0,C+M)):2==t.textAlign?(v.textAlign="right",v.fillText(e[P].text,s,C+M)):(v.textAlign="center",v.fillText(e[P].text,s/2,C+M))}var D=new fm.CanvasTexture(m);D.minFilter=fm.LinearFilter,D.generateMipmaps=!1,D.scaleRatio=m.height/m.width,D.mspriteScale=d;for(var O=0,F=null,B=0;B<e.length;B++)O+=e[B].fontsize;return F=1<e.length?(O+c*(e.length-1)+h)/e.length:O+h,D.size=F,D}},{key:"drawRadiuRect",value:function(e,t,n,r,i){var a=i,o={x:i.x+t,y:i.y},s={x:i.x,y:i.y+n},l={x:i.x+t,y:i.y+n},u={x:a.x+r,y:a.y},c={x:o.x-r,y:o.y},h={x:o.x,y:o.y+r},f={x:l.x,y:l.y-r},d={x:l.x-r,y:l.y},p={x:s.x+r,y:s.y},m={x:s.x,y:s.y-r},v={x:a.x,y:a.y+r};e.beginPath(),e.moveTo(u.x,u.y),e.lineTo(c.x,c.y),e.arcTo(o.x,o.y,h.x,h.y,r),e.lineTo(f.x,f.y),e.arcTo(l.x,l.y,d.x,d.y,r),e.lineTo(p.x,p.y),e.arcTo(s.x,s.y,m.x,m.y,r),e.lineTo(v.x,v.y),e.arcTo(a.x,a.y,u.x,u.y,r),e.closePath()}},{key:"measureText",value:function(e,t,n){var r=document.createElement("div");r.style.fontSize=n+"px",r.style.position="absolute",r.style.fontStyle=e,r.style.whiteSpace="nowrap",r.innerHTML=t;var i={width:r.clientWidth,height:r.clientHeight};return document.body.removeChild(r),i}},{key:"loadTexture",value:function(e,t){var n=this,r=new fm.Texture;if("string"!=typeof e)return r.image=e,r.needsUpdate=!0,t(r),r;"data"!==e.substring(0,4)&&this._textureData[e]&&t(this._textureData[e]);var i=new Image;return i.crossOrigin="Anonymous",this._textureArray.push(r),i.onload=function(){r.image=i,"data"!==e.substring(0,4)&&(n._textureData[e]=r),r.needsUpdate=!0,t(r)},i.src=e,r}},{key:"getHeatMapGradient",value:function(e){var t=document.createElement("canvas"),n=t.getContext("2d"),r=8,i=128;t.width=r,t.height=i,t.style.width=r+"px",t.style.height=i+"px";var a=n.createLinearGradient(0,0,8,128);for(var o in e)a.addColorStop(o,e[o]);n.fillStyle=a,n.fillRect(0,0,8,128);var s=new fm.CanvasTexture(t);return this._textureArray.push(s),s}},{key:"createNormalLineTexture",value:function(n){var e=document.createElement("canvas"),r=e.getContext("2d"),t=n.width,i=n.height;e.width=t,e.height=i,e.style.width=t+"px",e.style.height=i+"px";var a=0,o=n.dashArray,s=o.reduce(function(e,t){return e+t}),l=new fm.Matrix3;l.set(Math.cos(Math.PI/2),-Math.sin(Math.PI/2),t/2,Math.sin(Math.PI/2),Math.cos(Math.PI/2),i/2,0,0,1);var u=new fm.Matrix3;u.set(1,0,-t/2,0,1,-i/2,0,0,1),l.multiply(u);var c=l.elements;r.transform(c[0],c[3],c[1],c[4],c[2],c[6]),o.forEach(function(e,t){t%2==0&&(r.fillStyle=n.color,r.fillRect(a/s*n.width,0,e/s*n.width,n.height)),a+=e});var h=new fm.CanvasTexture(e);return h}},{key:"createArrowLineTexture",value:function(e){var t=e,n=document.createElement("canvas"),r=n.getContext("2d"),i=e.width,a=e.height;n.width=i,n.height=a,n.style.width=i+"px",n.style.height=a+"px";var o=(1-t.arrowHeightPercent)*t.height/2,s=t.height*t.arrowHeightPercent,l=new fm.Matrix3;l.set(Math.cos(Math.PI/2),-Math.sin(Math.PI/2),i/2,Math.sin(Math.PI/2),Math.cos(Math.PI/2),a/2,0,0,1);var u=new fm.Matrix3;u.set(1,0,-i/2,0,1,-a/2,0,0,1),l.multiply(u);var c=l.elements;r.transform(c[0],c[3],c[1],c[4],c[2],c[6]),r.beginPath(),r.moveTo(0,o);var h=t.width*(t.arrowWidthPercent-t.arrowPercent);r.lineTo(h,o),r.lineTo(t.width*t.arrowWidthPercent,o+s/2),r.lineTo(h,o+s),r.lineTo(0,o+s),r.lineTo(t.width*t.arrowPercent,o+s/2),r.closePath(),r.fillStyle=t.color,r.fill();var f=new fm.CanvasTexture(n);return f}},{key:"createArrowWidthBackTexture",value:function(e){var t=e,n=document.createElement("canvas"),r=n.getContext("2d"),i=e.width,a=e.height;n.width=i,n.height=a,n.style.width=i+"px",n.style.height=a+"px",r.fillStyle=t.godEdgeColor,r.fillRect(0,0,t.width,t.height);var o=t.width*(1-t.godEdgePercent);r.fillStyle=t.godColor,r.fillRect((t.width-o)/2,0,o,t.height),r.fillStyle="#ffffff",r.shadowOffsetX=-2,r.shadowOffsetY=2,r.shadowBlur=4,r.shadowColor="rgba(0,0,0,0.5)";var s={x:t.width/2,y:t.height/2},l=t.height*t.godArrowPercent,u=o*t.godArrowWidthPercent,c=t.arrawWidth||10,h=s.x-u/2,f=s.y+l/2;r.beginPath(),r.moveTo(h,f),r.lineTo(h,f+c),r.lineTo(h+u/2,f-l+c),r.lineTo(h+u,f+c),r.lineTo(h+u,f),r.lineTo(h+u/2,f-l),r.closePath(),r.fillStyle=t.godArrowColor,r.fill();var d=new fm.CanvasTexture(n);return d}},{key:"rotateCanvas",value:function(e,t,n,r){var i=document.createElement("canvas"),a=i.getContext("2d");i.width=n,i.height=r,i.style.width=n+"px",i.style.height=r+"px",a.drawImage(e,0,0,n,r)}},{key:"dispose",value:function(){var e,t=H(this._textureArray);try{for(t.s();!(e=t.n()).done;){var n=e.value;n.dispose()}}catch(e){t.e(e)}finally{t.f()}for(var r in this._textureArray.length=0,this._textureData)this._textureData[r]=void 0;for(var i in this.data)this._data[i]=void 0}},{key:"data",get:function(){return this._data},set:function(e){this._data=e}},{key:"textureData",get:function(){return this._textureData},set:function(e){this._textureData=e}},{key:"textureArray",get:function(){return this._textureArray},set:function(e){this._textureArray=e}}]),t}(),m=p;t.default=m},function(e,t,n){"use strict";n(109)("fontcolor",function(t){return function(e){return t(this,"font","color",e)}})},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0,n(5),n(4);var a=r(n(6)),o=r(n(2)),s=r(n(7)),l=r(n(8)),u=r(n(9)),c=r(n(383));function h(r){return function(){var e,t=(0,l.default)(r);if(f()){var n=(0,l.default)(this).constructor;e=(0,a.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,s.default)(this,e)}}function f(){if("undefined"==typeof Reflect||!a.default)return!1;if(a.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,a.default)(Date,[],function(){})),!0}catch(e){return!1}}var d=function(e){(0,u.default)(r,e);var n=h(r);function r(e){var t;return(0,o.default)(this,r),t=n.call(this,e),t.uniforms.diffuse={value:new fm.Vector3(1,1,1)},t.uniforms.offset={value:new fm.Vector2},t.uniforms.rotation={value:0},t.uniforms.scale={value:1},t.depthTest=!1,t.vertexShader=c.default.vert,t.fragmentShader=c.default.frag,t}return r}(fm.ShaderMaterial),p=d;t.default=p},function(e,t,n){"use strict";var r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var i={vert:"\n \n uniform vec2 offset;\n uniform float rotation;\n uniform float scale;\n varying vec2 vUv;\n void main() {\n vUv = uv;\n \n \n vec2 rotatedPosition;\n rotatedPosition.x = cos( rotation ) * position.x - sin( rotation ) * position.y;\n rotatedPosition.y = sin( rotation ) * position.x + cos( rotation ) * position.y;\n \n \n rotatedPosition.x *= scale * abs(projectionMatrix[0][0] / projectionMatrix[1][1]);\n rotatedPosition.y *= scale;\n \n rotatedPosition.xy += offset;\n gl_Position = vec4(rotatedPosition,0.0,1.0);\n }\n ",frag:"\n uniform vec3 diffuse;\n uniform sampler2D mapBack;\n uniform sampler2D mapfront;\n #include <common>\n varying vec2 vUv;\n \n void main() {\n vec4 diffuseColor = vec4( diffuse, 1.0 );\n vec2 muv = vec2(vUv.x , 1.0 - vUv.y);\n diffuseColor = texture2D( mapfront, muv );\n \n vec4 backColor = vec4(1.0 , 0.0 ,0.0 ,1.0);\n backColor = texture2D( mapBack, muv );\n\n float alphacomp = backColor.a + diffuseColor.a * (1.0 -backColor.a);\n vec3 resultColor = diffuseColor.rgb * diffuseColor.a + backColor.rgb * (1.0 - diffuseColor.a);\n gl_FragColor = vec4(resultColor , alphacomp);\n }\n "},a=i;t.default=a},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var s=r(n(18)),l=r(n(13)),u=r(n(17)),c=r(n(16)),a=r(n(15));n(10),n(5),n(4),n(21);var o=r(n(2)),h=r(n(3)),f=r(n(385)),d=r(n(210));function p(e){if(void 0===c.default||null==e[u.default]){if((0,l.default)(e)||(e=m(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i,a=!0,o=!1;return{s:function(){r=(0,s.default)(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){o=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(o)throw i}}}}function m(e,t){if(e){if("string"==typeof e)return v(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?(0,a.default)(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?v(e,t):void 0}}function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var g=function(){function r(e,t,n){(0,o.default)(this,r),this.preLoadModels={},this.waitingBacks={},this.waitingNodes=[],this._path=e,this.isRemote=t,this.key=n,this.externalLoadingCount=0}return(0,h.default)(r,[{key:"load",value:function(i){var e,t,n,a=this;this.externalLoadingCount++,n=this.isRemote?"https://www.fengmap.com/FMCloud/webmodel/":this._path;var o=this.preLoadModels[i].modelUrl.split(".");t="js"===o[1]?(e=new f.default,o[0]+".js?keyValue="+this.key):(e=new d.default,o[0]+".glb?keyValue="+this.key),this.isRemote&&(t=o[0]+"/"+t),e.setPath(n),this.preLoadModels[i].isLoading=!0,e.load(t,function(e,t){for(var n in a.waitingBacks[i]){var r=a.waitingBacks[i][n];r(e,t,o[1])}a.externalLoadingCount--,a.externalLoadingCount<1&&a.loaded&&a.loaded(),a.preLoadModels[i].isGltf="js"!==o[1],a.preLoadModels[i].geometry=e,a.preLoadModels[i].material=t,a.waitingBacks[i].length=0,a.preLoadModels[i].isLoading=!1,a.preLoadModels[i].loaded=!0},function(){},function(){a.externalLoadingCount--,a.externalLoadingCount<1&&a.loaded&&a.loaded(),a.preLoadModels[i].isLoading=!1})}},{key:"addWaitingBacks",value:function(e,t,n){this.waitingBacks[e]||(this.waitingBacks[e]={}),this.waitingBacks[e][n]||(this.waitingBacks[e][n]=t)}},{key:"setLoadedBack",value:function(e){this.loaded=e}},{key:"checkAndLoadwaiting",value:function(){var e,t=p(this.waitingNodes);try{for(t.s();!(e=t.n()).done;)e.value}catch(e){t.e(e)}finally{t.f()}}}]),r}(),y=g;t.default=y},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0,n(10);var a=r(n(32));function o(e){"boolean"==typeof e&&(console.warn("fm.JSONLoader: showStatus parameter has been removed from constructor."),e=void 0),this.manager=void 0!==e?e:fm.DefaultLoadingManager,this.withCredentials=!1}function s(e,t){function n(e,t){return e&1<<t}var r,i,a,o,s,l,u,c,h,f,d,p,m,v,g,y,_,x,w,b,M,S,E,T,A,L,R,C=e.faces,I=e.vertices,k=e.normals,P=e.colors,N=e.scale,D=0;if(void 0!==e.uvs){for(r=0;r<e.uvs.length;r++)e.uvs[r].length&&D++;for(r=0;r<D;r++)t.faceVertexUvs[r]=[]}for(o=0,s=I.length;o<s;)x=new fm.Vector3,x.x=I[o++]*N,x.y=I[o++]*N,x.z=I[o++]*N,t.vertices.push(x);for(o=0,s=C.length;o<s;)if(f=C[o++],d=n(f,0),p=n(f,1),m=n(f,3),v=n(f,4),g=n(f,5),y=n(f,6),_=n(f,7),d){if(b=new fm.Face3,b.a=C[o],b.b=C[o+1],b.c=C[o+3],M=new fm.Face3,M.a=C[o+1],M.b=C[o+2],M.c=C[o+3],o+=4,p&&(h=C[o++],b.materialIndex=h,M.materialIndex=h),a=t.faces.length,m)for(r=0;r<D;r++)for(T=e.uvs[r],t.faceVertexUvs[r][a]=[],t.faceVertexUvs[r][a+1]=[],i=0;i<4;i++)c=C[o++],L=T[2*c],R=T[2*c+1],A=new fm.Vector2(L,R),2!==i&&t.faceVertexUvs[r][a].push(A),0!==i&&t.faceVertexUvs[r][a+1].push(A);if(v&&(u=3*C[o++],b.normal.set(k[u++],k[u++],k[u]),M.normal.copy(b.normal)),g)for(r=0;r<4;r++)u=3*C[o++],E=new fm.Vector3(k[u++],k[u++],k[u]),2!==r&&b.vertexNormals.push(E),0!==r&&M.vertexNormals.push(E);if(y&&(l=C[o++],S=P[l],b.color.setHex(S),M.color.setHex(S)),_)for(r=0;r<4;r++)l=C[o++],S=P[l],2!==r&&b.vertexColors.push(new fm.Color(S)),0!==r&&M.vertexColors.push(new fm.Color(S));t.faces.push(b),t.faces.push(M)}else{if(w=new fm.Face3,w.a=C[o++],w.b=C[o++],w.c=C[o++],p&&(h=C[o++],w.materialIndex=h),a=t.faces.length,m)for(r=0;r<D;r++)for(T=e.uvs[r],t.faceVertexUvs[r][a]=[],i=0;i<3;i++)c=C[o++],L=T[2*c],R=T[2*c+1],A=new fm.Vector2(L,R),t.faceVertexUvs[r][a].push(A);if(v&&(u=3*C[o++],w.normal.set(k[u++],k[u++],k[u])),g)for(r=0;r<3;r++)u=3*C[o++],E=new fm.Vector3(k[u++],k[u++],k[u]),w.vertexNormals.push(E);if(y&&(l=C[o++],w.color.setHex(P[l])),_)for(r=0;r<3;r++)l=C[o++],w.vertexColors.push(new fm.Color(P[l]));t.faces.push(w)}}function l(e,t){var n=void 0!==e.influencesPerVertex?e.influencesPerVertex:2;if(e.skinWeights)for(var r=0,i=e.skinWeights.length;r<i;r+=n){var a=e.skinWeights[r],o=1<n?e.skinWeights[r+1]:0,s=2<n?e.skinWeights[r+2]:0,l=3<n?e.skinWeights[r+3]:0;t.skinWeights.push(new fm.Vector4(a,o,s,l))}if(e.skinIndices)for(r=0,i=e.skinIndices.length;r<i;r+=n){var u=e.skinIndices[r],c=1<n?e.skinIndices[r+1]:0,h=2<n?e.skinIndices[r+2]:0,f=3<n?e.skinIndices[r+3]:0;t.skinIndices.push(new fm.Vector4(u,c,h,f))}t.bones=e.bones,t.bones&&0<t.bones.length&&(t.skinWeights.length!==t.skinIndices.length||t.skinIndices.length!==t.vertices.length)&&console.warn("When skinning, number of vertices ("+t.vertices.length+"), skinIndices ("+t.skinIndices.length+"), and skinWeights ("+t.skinWeights.length+") should match.")}function u(e,t){var n=e.scale;if(void 0!==e.morphTargets)for(var r=0,i=e.morphTargets.length;r<i;r++){t.morphTargets[r]={},t.morphTargets[r].name=e.morphTargets[r].name,t.morphTargets[r].vertices=[];for(var a=t.morphTargets[r].vertices,o=e.morphTargets[r].vertices,s=0,l=o.length;s<l;s+=3){var u=new fm.Vector3;u.x=o[s]*n,u.y=o[s+1]*n,u.z=o[s+2]*n,a.push(u)}}if(void 0!==e.morphColors&&0<e.morphColors.length){console.warn('fm.JSONLoader: "morphColors" no longer supported. Using them as face colors.');var c=t.faces,h=e.morphColors[0].colors;for(r=0,i=c.length;r<i;r++)c[r].color.fromArray(h,3*r)}}function c(e,t){var n=[],r=[];void 0!==e.animation&&r.push(e.animation),void 0!==e.animations&&(e.animations.length?r=r.concat(e.animations):r.push(e.animations));for(var i=0;i<r.length;i++){var a=fm.AnimationClip.parseAnimation(r[i],t.bones);a&&n.push(a)}if(t.morphTargets){var o=fm.AnimationClip.CreateClipsFromMorphTargetSequences(t.morphTargets,10);n=n.concat(o)}0<n.length&&(t.animations=n)}(0,a.default)(o.prototype,{crossOrigin:"anonymous",load:function(a,o,e,t){var s=this,l=void 0===this.path?fm.LoaderUtils.extractUrlBase(a):this.path;this.resourcePath=l+"maps/";var n=new fm.FileLoader(this.manager);n.setPath(this.path),n.setWithCredentials(this.withCredentials),n.load(a,function(e){var t=JSON.parse(e),n=t.metadata;if(void 0!==n){var r=n.type;if(void 0!==r&&"object"===r.toLowerCase())return void console.error("fm.JSONLoader: "+a+" should be loaded with fm.ObjectLoader instead.")}var i=s.parse(t,l);o(i.geometry,i.materials)},e,t)},setPath:function(e){return this.path=e,this},setResourcePath:function(e){return this.resourcePath=e,this},setCrossOrigin:function(e){return this.crossOrigin=e,this},parse:function(e,t){void 0!==e.data&&(e=e.data),void 0!==e.scale?e.scale=1/e.scale:e.scale=1;var n=new fm.Geometry;if(s(e,n),l(e,n),u(e,n),c(e,n),n.computeFaceNormals(),n.computeBoundingSphere(),void 0===e.materials||0===e.materials.length)return{geometry:n};var r=fm.Loader.prototype.initMaterials(e.materials,this.resourcePath||t,this.crossOrigin);return{geometry:n,materials:r}}});var h=o;t.default=h},function(e,t,n){"use strict";var r=n(176)(!0);n(171)(String,"String",function(e){this._t=String(e),this._i=0},function(){var e,t=this._t,n=this._i;return n>=t.length?{value:void 0,done:!0}:(e=r(t,n),this._i+=e.length,{value:e,done:!1})})},function(e,t,n){e.exports=n(388)},function(e,t,n){n(105),n(59),n(65),n(389),n(392),n(393),e.exports=n(11).Promise},function(e,t,n){"use strict";var r,i,a,o,s=n(79),l=n(19),u=n(40),c=n(99),h=n(14),f=n(22),d=n(52),p=n(107),m=n(67),v=n(211),g=n(212).set,y=n(390)(),_=n(150),x=n(213),w=n(391),b=n(214),M="Promise",S=l.TypeError,E=l.process,T=E&&E.versions,A=T&&T.v8||"",L=l[M],R="process"==c(E),C=function(){},I=i=_.f,k=!!function(){try{var e=L.resolve(1),t=(e.constructor={})[n(24)("species")]=function(e){e(C,C)};return(R||"function"==typeof PromiseRejectionEvent)&&e.then(C)instanceof t&&0!==A.indexOf("6.6")&&-1===w.indexOf("Chrome/66")}catch(e){}}(),P=function(e){var t;return!(!f(e)||"function"!=typeof(t=e.then))&&t},N=function(c,n){if(!c._n){c._n=!0;var r=c._c;y(function(){for(var l=c._v,u=1==c._s,e=0,t=function(e){var t,n,r,i=u?e.ok:e.fail,a=e.resolve,o=e.reject,s=e.domain;try{i?(u||(2==c._h&&F(c),c._h=1),!0===i?t=l:(s&&s.enter(),t=i(l),s&&(s.exit(),r=!0)),t===e.promise?o(S("Promise-chain cycle")):(n=P(t))?n.call(t,a,o):a(t)):o(l)}catch(e){s&&!r&&s.exit(),o(e)}};r.length>e;)t(r[e++]);c._c=[],c._n=!1,n&&!c._h&&D(c)})}},D=function(a){g.call(l,function(){var e,t,n,r=a._v,i=O(a);if(i&&(e=x(function(){R?E.emit("unhandledRejection",r,a):(t=l.onunhandledrejection)?t({promise:a,reason:r}):(n=l.console)&&n.error&&n.error("Unhandled promise rejection",r)}),a._h=R||O(a)?2:1),a._a=void 0,i&&e.e)throw e.v})},O=function(e){return 1!==e._h&&0===(e._a||e._c).length},F=function(t){g.call(l,function(){var e;R?E.emit("rejectionHandled",t):(e=l.onrejectionhandled)&&e({promise:t,reason:t._v})})},B=function(e){var t=this;t._d||(t._d=!0,t=t._w||t,t._v=e,t._s=2,t._a||(t._a=t._c.slice()),N(t,!0))},U=function(e){var n,r=this;if(!r._d){r._d=!0,r=r._w||r;try{if(r===e)throw S("Promise can't be resolved itself");(n=P(e))?y(function(){var t={_w:r,_d:!1};try{n.call(e,u(U,t,1),u(B,t,1))}catch(e){B.call(t,e)}}):(r._v=e,r._s=1,N(r,!1))}catch(e){B.call({_w:r,_d:!1},e)}}};k||(L=function(e){p(this,L,M,"_h"),d(e),r.call(this);try{e(u(U,this,1),u(B,this,1))}catch(e){B.call(this,e)}},r=function(){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},r.prototype=n(106)(L.prototype,{then:function(e,t){var n=I(v(this,L));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=R?E.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&N(this,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),a=function(){var e=new r;this.promise=e,this.resolve=u(U,e,1),this.reject=u(B,e,1)},_.f=I=function(e){return e===L||e===o?new a(e):i(e)}),h(h.G+h.W+h.F*!k,{Promise:L}),n(83)(L,M),n(205)(M),o=n(11)[M],h(h.S+h.F*!k,M,{reject:function(e){var t=I(this),n=t.reject;return n(e),t.promise}}),h(h.S+h.F*(s||!k),M,{resolve:function(e){return b(s&&this===o?L:this,e)}}),h(h.S+h.F*!(k&&n(168)(function(e){L.all(e).catch(C)})),M,{all:function(e){var o=this,t=I(o),s=t.resolve,l=t.reject,n=x(function(){var r=[],i=0,a=1;m(e,!1,function(e){var t=i++,n=!1;r.push(void 0),a++,o.resolve(e).then(function(e){n||(n=!0,r[t]=e,--a||s(r))},l)}),--a||s(r)});return n.e&&l(n.v),t.promise},race:function(e){var t=this,n=I(t),r=n.reject,i=x(function(){m(e,!1,function(e){t.resolve(e).then(n.resolve,r)})});return i.e&&r(i.v),n.promise}})},function(e,t,n){var s=n(19),l=n(212).set,u=s.MutationObserver||s.WebKitMutationObserver,c=s.process,h=s.Promise,f="process"==n(82)(c);e.exports=function(){var n,r,i,e=function(){var e,t;for(f&&(e=c.domain)&&e.exit();n;){t=n.fn,n=n.next;try{t()}catch(e){throw n?i():r=void 0,e}}r=void 0,e&&e.enter()};if(f)i=function(){c.nextTick(e)};else if(!u||s.navigator&&s.navigator.standalone)if(h&&h.resolve){var t=h.resolve(void 0);i=function(){t.then(e)}}else i=function(){l.call(s,e)};else{var a=!0,o=document.createTextNode("");new u(e).observe(o,{characterData:!0}),i=function(){o.data=a=!a}}return function(e){var t={fn:e,next:void 0};r&&(r.next=t),n||(n=t,i()),r=t}}},function(e,t,n){var r=n(19),i=r.navigator;e.exports=i&&i.userAgent||""},function(e,t,n){"use strict";var r=n(14),i=n(11),a=n(19),o=n(211),s=n(214);r(r.P+r.R,"Promise",{finally:function(t){var n=o(this,i.Promise||a.Promise),e="function"==typeof t;return this.then(e?function(e){return s(n,t()).then(function(){return e})}:t,e?function(e){return s(n,t()).then(function(){throw e})}:t)}})},function(e,t,n){"use strict";var r=n(14),i=n(150),a=n(213);r(r.S,"Promise",{try:function(e){var t=i.f(this),n=a(e);return(n.e?t.reject:t.resolve)(n.v),t.promise}})},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(2)),o=r(n(3)),s=r(n(210)),l=function(){function e(){(0,a.default)(this,e),this.dynamicModel={},this.loader=new s.default}return(0,o.default)(e,[{key:"load",value:function(i,t,e){var a=this;this.dynamicModel[i]?0==this.dynamicModel[i].loadComplete?(this.dynamicModel[i].scbs.push(t),this.dynamicModel[i].fcbs.push(e)):this.dynamicModel[i].error?e&&e(this.dynamicModel[i].error):t&&this.loader.parse(this.dynamicModel[i].data,fm.LoaderUtils.extractUrlBase(i),function(e){t(e)},function(){}):(this.dynamicModel[i]={gltf:null,loadComplete:!1,error:null,scbs:[],fcbs:[]},this.dynamicModel[i].scbs.push(t),this.dynamicModel[i].fcbs.push(e),this.loader.load(i,function(e,t){a.dynamicModel[i].gltf=e,a.dynamicModel[i].data=t,a.dynamicModel[i].loadComplete=!0;for(var n=a.dynamicModel[i].scbs,r=0;r<n.length;r++)n[r]&&n[r](e)},void 0,function(e){a.dynamicModel[i].error=e,a.dynamicModel[i].loadComplete=!0;for(var t=a.dynamicModel[i].fcbs,n=0;n<t.length;n++)t[n]&&t[n](e)}))}},{key:"dispose",value:function(){this.dynamicModel={},this.loader=null}}]),e}(),u=l;t.default=u},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0,n(5),n(4);var a=r(n(6));n(10);var o=r(n(2)),s=r(n(3)),l=r(n(7)),u=r(n(8)),c=r(n(9)),h=r(n(12)),f=r(n(215));function d(r){return function(){var e,t=(0,u.default)(r);if(p()){var n=(0,u.default)(this).constructor;e=(0,a.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,l.default)(this,e)}}function p(){if("undefined"==typeof Reflect||!a.default)return!1;if(a.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,a.default)(Date,[],function(){})),!0}catch(e){return!1}}var m=function(e){(0,c.default)(i,e);var r=d(i);function i(e,t){var n;return(0,o.default)(this,i),n=r.call(this,"modelLayer"),n._scene=new fm.Scene,n._scene.name="model",n._scene.userData.type="model",n.alias="model",n._models={},n.initNode(e,t),n._visible=!0,n.initLight(),n.putLight(),n}return(0,s.default)(i,[{key:"initNode",value:function(e,t){for(var n=0;n<e.length;n++)this.createNode(e[n],t[n])}},{key:"createNode",value:function(e,t){var n=new f.default(e,t);n.parent=this,this._models[""+n.eid]=n}},{key:"addNodes",value:function(e){e.parent=this,e.renderNode&&this._scene.add(e.renderNode),this._models[""+e.eid]=e}},{key:"removeNode",value:function(e){e.renderNode&&this._scene.remove(e.renderNode)}},{key:"traverse",value:function(e){for(var t in this._models)e&&e(this._models[t])}},{key:"initLight",value:function(){this._ambientLight=new fm.AmbientLight(7631988),this._target=new fm.Object3D,this._mainLight=new fm.DirectionalLight(8947848,1.2),this._mainLight.name="directionalLight",this._mainLight.position.set(-1,1,1).normalize(),this._mainLight.target=this._target,this._secondLight=new fm.DirectionalLight(3355443),this._secondLight.position.set(-.5,1,-1).normalize(),this._secondLight.target=this._target}},{key:"putLight",value:function(){var e=this;this.scene.add(this._mainLight),this.scene.add(this._secondLight),this.scene.add(this._ambientLight),this.scene.add(this._target),this.scene.removeLight=function(){e.removeLight()}}},{key:"removeLight",value:function(){this.scene.remove(this._mainLight),this.scene.remove(this._ambientLight),this.scene.remove(this._secondLight)}},{key:"disposeLight",value:function(){this._mainLight=void 0,this._ambientLight=void 0}},{key:"getNodeById",value:function(e){return this._models[""+e]}},{key:"checkSceneNode",value:function(){for(var e in this._scene.children.length=0,this._models)this._models[e].visible&&this._models[e].renderNode&&this._scene.add(this._models[e].renderNode);this.putLight()}},{key:"getAllMesh",value:function(){var e=[];for(var t in this._models)this._models[t].renderNode&&e.push(this._models[t].renderNode);return e}},{key:"getVideoMemoryAmount",value:function(){var t=null;return this.traverse(function(e){e._renderNode&&e._renderNode.geometry&&e._renderNode.geometry._bufferGeometry&&(t+=e._renderNode.geometry._bufferGeometry.attributes.position.array.byteLength,t+=e._renderNode.geometry._bufferGeometry.attributes.color.array.byteLength,t+=e._renderNode.geometry._bufferGeometry.attributes.normal.array.byteLength,t+=e._renderNode.geometry._bufferGeometry.attributes.uv.array.byteLength)}),t}},{key:"dispose",value:function(){for(var e in this._models)this._models[e].dispose(),this._scene.remove(this._models[e].renderNode),this._models[e].parent=void 0,this._models[e]=void 0;this.removeLight(),this.disposeLight(),this._scene.length=0,this._scene=void 0}},{key:"scene",get:function(){return this._scene}},{key:"visible",get:function(){return this._visible},set:function(e){this._visible=e,this.parent&&this.parent.parent&&this.parent.parent.parent&&this.parent.parent.parent.map.setRenderList()}},{key:"show",get:function(){return this.visible},set:function(e){this.visible=e}}]),i}(h.default),v=m;t.default=v},function(e,t,n){e.exports=n(397)},function(e,t,n){n(398),e.exports=9007199254740991},function(e,t,n){var r=n(14);r(r.S,"Number",{MAX_SAFE_INTEGER:9007199254740991})},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0,n(5),n(4);var a=r(n(6)),o=r(n(2)),s=r(n(3)),l=r(n(7)),u=r(n(8)),c=r(n(9)),h=r(n(12));function f(r){return function(){var e,t=(0,u.default)(r);if(d()){var n=(0,u.default)(this).constructor;e=(0,a.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,l.default)(this,e)}}function d(){if("undefined"==typeof Reflect||!a.default)return!1;if(a.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,a.default)(Date,[],function(){})),!0}catch(e){return!1}}var p=function(e){(0,c.default)(n,e);var t=f(n);function n(){var e;return(0,o.default)(this,n),e=t.call(this),e._scene=new fm.Scene,e}return(0,s.default)(n,[{key:"checkSceneNode",value:function(){}},{key:"dispose",value:function(){}},{key:"scene",get:function(){return this._scene}}]),n}(h.default),m=p;t.default=m},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0,n(5),n(4);var a=r(n(6)),u=r(n(2)),o=r(n(7)),s=r(n(8)),c=r(n(9)),h=r(n(224));function f(r){return function(){var e,t=(0,s.default)(r);if(l()){var n=(0,s.default)(this).constructor;e=(0,a.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,o.default)(this,e)}}function l(){if("undefined"==typeof Reflect||!a.default)return!1;if(a.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,a.default)(Date,[],function(){})),!0}catch(e){return!1}}var d=function(e){(0,c.default)(l,e);var s=f(l);function l(e,t,n){var r;if((0,u.default)(this,l),r=s.call(this,e,t),n){var i=new h.default,a=i.createGeometry(1.5,20,24,.5),o=new fm.BufferGeometry;o.addAttribute("position",new fm.Float32BufferAttribute(a.vertice,3)),o.addAttribute("uv",new fm.Float32BufferAttribute(a.uv,2)),o.setIndex(new fm.Uint16BufferAttribute(a.index,1)),r.geometry=o,r.material=new fm.MeshBasicMaterial({map:n,depthTest:!1}),r.material.side=2,r.material.transparent=!0}return r}return l}(fm.Mesh),p=d;t.default=p},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0,n(5),n(4);var a=r(n(6)),o=r(n(2)),s=r(n(7)),l=r(n(8)),u=r(n(9)),c=r(n(12));function h(r){return function(){var e,t=(0,l.default)(r);if(f()){var n=(0,l.default)(this).constructor;e=(0,a.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,s.default)(this,e)}}function f(){if("undefined"==typeof Reflect||!a.default)return!1;if(a.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,a.default)(Date,[],function(){})),!0}catch(e){return!1}}var d=function(e){(0,u.default)(n,e);var t=h(n);function n(){return(0,o.default)(this,n),t.call(this)}return n}(c.default),p=d;t.default=p},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0,n(5),n(4);var a=r(n(6)),o=r(n(2)),s=r(n(7)),l=r(n(8)),u=r(n(9)),c=r(n(403));function h(r){return function(){var e,t=(0,l.default)(r);if(f()){var n=(0,l.default)(this).constructor;e=(0,a.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,s.default)(this,e)}}function f(){if("undefined"==typeof Reflect||!a.default)return!1;if(a.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,a.default)(Date,[],function(){})),!0}catch(e){return!1}}var d=function(e){(0,u.default)(r,e);var n=h(r);function r(e){var t;return(0,o.default)(this,r),t=n.call(this,e),t.uniforms.offset={value:new fm.Vector2},t.uniforms.rotation={value:0},t.uniforms.scale={value:new fm.Vector2(1,1)},t.depthTest=!1,t.vertexShader=c.default.vert,t.fragmentShader=c.default.frag,t}return r}(fm.ShaderMaterial),p=d;t.default=p},function(e,t,n){"use strict";var r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var i={vert:"\n \n uniform vec2 offset;\n uniform float rotation;\n uniform vec2 scale;\n varying vec2 vUv;\n void main() {\n vUv = uv;\n \n \n vec2 rotatedPosition;\n rotatedPosition.x = cos( rotation ) * position.x - sin( rotation ) * position.y;\n rotatedPosition.y = sin( rotation ) * position.x + cos( rotation ) * position.y;\n \n \n rotatedPosition.x *= scale.x * abs(projectionMatrix[0][0] / projectionMatrix[1][1]);\n rotatedPosition.y *= scale.y;\n \n rotatedPosition.xy += offset;\n gl_Position = vec4(rotatedPosition,0.0,1.0);\n }\n ",frag:"\n uniform vec3 diffuse;\n uniform sampler2D mmap;\n #include <common>\n varying vec2 vUv;\n \n void main() {\n \n // vec2 muv = vec2(vUv.x , 1.0 - vUv.y);\n vec4 diffuseColor = texture2D( mmap, vUv );\n \n \n gl_FragColor = diffuseColor;\n }\n "},a=i;t.default=a},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var s=r(n(18)),l=r(n(13)),u=r(n(17)),c=r(n(16)),a=r(n(15));n(5),n(4),n(71),n(10);var h=r(n(25)),f=r(n(32));n(21);var o=r(n(2)),d=r(n(3)),p=r(n(58));function m(e){if(void 0===c.default||null==e[u.default]){if((0,l.default)(e)||(e=v(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i,a=!0,o=!1;return{s:function(){r=(0,s.default)(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){o=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(o)throw i}}}}function v(e,t){if(e){if("string"==typeof e)return g(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?(0,a.default)(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?g(e,t):void 0}}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}r(n(405));var y=function(){function n(e,t){(0,o.default)(this,n),this._themeName=t,this._themeUrl=e,this._data=null,this._type2theme={},this._poiimagetheme={},this._storePoiThemes={},this._storeLabelTypeDic={},this._storeLabelThemeDic={},this._storethemes={},this._externalModelTheme={},this._defaultTheme={color:16777215,alpha:1,strokeColor:16777215,strokeWidth:2},this._labelDefaultTheme={alpha:"0.9",fillcolor:"30,30,30",fontsize:"14.0",id:"109",image:!1,strokecolor:"255,255,255"},this.clearColor=16777215,this.clearAlpha=1,this._modelOpacity=.875,this._floorColor=16776960,this._floorOpacity=.875,this._selectedColor=16750950,this._labelStyle,this._labelSelectedStyle,this._facilitySize,this._poiMatClones={},this._storeApply={},this.navigateStyle_={color:16711680,lineWidth:8,alpha:.8,dash:{size:1,gap:1}}}return(0,d.default)(n,[{key:"initExteralModelTheme",value:function(){if(this._data.externalmodelapply){var e,t=m(this._data.externalmodelapply);try{for(t.s();!(e=t.n()).done;){var n,r=e.value,i=r.fids.split(","),a=m(i);try{for(a.s();!(n=a.n()).done;){var o,s=n.value,l=void 0,u=m(this._data.externalmodeltheme);try{for(u.s();!(o=u.n()).done;){var c=o.value;if(c.id===r.normalid){l=c;break}}}catch(e){u.e(e)}finally{u.f()}this._externalModelTheme[s]=(0,f.default)({color:l.color,model:l.model},r),this._externalModelTheme[s].fids=void 0}}catch(e){a.e(e)}finally{a.f()}}}catch(e){t.e(e)}finally{t.f()}}}},{key:"initStoreTheme",value:function(){var e={};this._defaultTheme=this._data.storetheme[0],this.storeThemes=e;for(var t=0;t<this._data.storetheme.length;t++){var n=this._data.storetheme[t];n.color=p.default.toColor(n.color),n.strokeColor=p.default.toColor(n.strokecolor),n.strokeWidth=n.strokewidth,n.alpha=n.alpha,e[n.id]=n}var r=this._data.floorapply;for(var t in r){var i=r[t];if(i.typeapply)for(var a in i.typeapply){var o=i.typeapply[a];if(o.normalid){n=e[o.normalid];var s=e[o.selectedid];s&&(this._selectedColor=p.default.toColor(s.color));var l=o.type.split(",");for(var u in l)this._type2theme[l[u]]=n}}}var c=this._data.extenttheme;this._floorColor=p.default.toColor(c[0].color),this._floorOpacity=(0,h.default)(c[0].alpha)}},{key:"initLabelTheme",value:function(){var e=this._data.storelabeltheme;if(this.storeLabelThemeDic={},this.storeLabelTypeDic={},e){0<e.length&&(this._labelStyle=e[0],1<e.length&&(this._labelSelectedStyle=e[1]));for(var t=0;t<e.length;t++)this.storeLabelThemeDic[e[t].id]=e[t];var n=this._data.floorstorelabelapply;if(n)for(t=0;t<n.length;t++){var r=n[t].typeapply;if("0"==n[t].floorid)for(var i=0;i<r.length;i++)for(var a=r[i],o=a.type.split(","),s=0;s<o.length;s++)this.storeLabelTypeDic[o[s]]=a}}}},{key:"initPoiTheme",value:function(){this._poiimagetheme={};var e=this._data.poiimagetheme,t={};for(var n in this.storePoiThemes=t,e){var r=e[n];r.imagename&&(t[r.id]=r)}var i=this.data.floorpoiimageapply;for(var a in i){var o=i[a];if(o.typeapply)for(var s in o.typeapply){var l=o.typeapply[s];if(l.normalid){var u=t[l.normalid],c=l.type.split(",");for(var h in c)this._poiimagetheme[c[h]]=u}}}}},{key:"getStoreApplyTheme",value:function(e){var t,n,r=m(this._data.storeapply);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(i.fids===e){var a,o=m(this._data.storetheme);try{for(o.s();!(a=o.n()).done;){var s=a.value;if(s.id==i.normalid)return t=(0,f.default)({},s),t.sizes=i.sizes,t}}catch(e){o.e(e)}finally{o.f()}}}}catch(e){r.e(e)}finally{r.f()}return null}},{key:"getRThemeTexture",value:function(e){if(this.rtheme)for(var t,n=0;n<this.rtheme.fmis.length;n++)if(t=this.rtheme.fmis[n],t.name==e)return t.content;return null}},{key:"getModelSelectColor",value:function(){var e=this._data.storetheme[1],t=e.color,n=(0,h.default)(e.alpha);return{r:(t>>16&255)/255,g:(t>>8&255)/255,b:(255&t)/255,a:n}}},{key:"getModelTheme",value:function(e){if(!e)return this._defaultTheme;var t=this._type2theme[e.type];return t||this._defaultTheme}},{key:"getPoiTheme",value:function(e){var t=(0,f.default)(this._poiimagetheme[e]||this._poiimagetheme[0],{});return"rtheme"==this.fileType?t.imageSrc=this.getRThemeTexture(t.imagename):t.imageSrc=this._themeUrl+"/"+this.themeName+"/"+t.imagename,t.imageUrl=this._themeUrl+"/"+this.themeName+"/"+t.imagename,t.imagehead=this._themeUrl+"/"+this.themeName+"/",t}},{key:"getLabelTheme",value:function(e){var t,n=this.storeLabelTypeDic[e];if(t=n&&this.storeLabelThemeDic[n.normalid]?this.storeLabelThemeDic[n.normalid]:this._labelStyle,t=t||this._labelDefaultTheme,!t.fillcolor||!t.alpha||!t.fontsize){var r={fillcolor:"0,0,0",alpha:"1.0",fontsize:"12.0"};t=(0,f.default)(t,r)}return t.image?("rtheme"==this.fileType?t.imageSrc=this.getRThemeTexture(t.image):t.imageSrc=this._themeUrl+"/"+this.themeName+"/"+t.image,t.imageUrl=this._themeUrl+"/"+this.themeName+"/"+t.image):t.imageSrc=!1,t}},{key:"getExteralModelTheme",value:function(e){return this._externalModelTheme[e]}},{key:"dispose",value:function(){this._type2theme=void 0,this._poiimagetheme=void 0,this._storePoiThemes=void 0,this._storeLabelTypeDic=void 0,this._storeLabelThemeDic=void 0,this._storethemes=void 0,this._data=void 0}},{key:"themeName",get:function(){return this._themeName}},{key:"data",set:function(e){this._data=e,this.initStoreTheme(),this.initLabelTheme(),this.initPoiTheme(),this.initExteralModelTheme(),this.clearColor=p.default.toColor(this._data.viewtheme.clearcolor),this.clearAlpha=(0,h.default)(this._data.viewtheme.clearalpha)},get:function(){return this._data}},{key:"storeLabelTypeDic",get:function(){return this._storeLabelTypeDic},set:function(e){this._storeLabelTypeDic=e}},{key:"storeLabelThemeDic",get:function(){return this._storeLabelThemeDic},set:function(e){this._storeLabelThemeDic=e}},{key:"storePoiThemes",get:function(){return this._storePoiThemes},set:function(e){this._storePoiThemes=e}},{key:"storethemes",get:function(){return this._storethemes},set:function(e){this._storethemes=e}},{key:"themeUrl",get:function(){return this._themeUrl},set:function(e){this.themeUrl=e}},{key:"floorColor",set:function(e){this._floorColor=e},get:function(){return this._floorColor}},{key:"floorOpacity",set:function(e){this._floorOpacity=e},get:function(){return this._floorOpacity}},{key:"selectedColor",get:function(){return this._selectedColor}}]),n}(),_=y;t.default=_},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var s=r(n(18)),l=r(n(13)),u=r(n(17)),c=r(n(16)),a=r(n(15));n(10),n(5),n(4);var o=r(n(32)),h=r(n(2)),f=r(n(3));function d(e){if(void 0===c.default||null==e[u.default]){if((0,l.default)(e)||(e=p(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i,a=!0,o=!1;return{s:function(){r=(0,s.default)(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){o=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(o)throw i}}}}function p(e,t){if(e){if("string"==typeof e)return m(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?(0,a.default)(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?m(e,t):void 0}}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var v=function(){function t(e){(0,h.default)(this,t),this._data=e,this._Nodes=[]}return(0,f.default)(t,[{key:"updateNodes",value:function(){var e,t=d(this._Nodes);try{for(t.s();!(e=t.n()).done;){var n=e.value;n.setByTheme(this._data)}}catch(e){t.e(e)}finally{t.f()}}},{key:"addNodes",value:function(e){this._Nodes.push(e)}},{key:"removeNodes",value:function(e){var t=this._Nodes.indexOf(e);-1<t&&this._Nodes.splice(t,1)}},{key:"changeData",value:function(e){(0,o.default)(this._data,e)}}]),t}(),g=v;t.default=g},function(e,t,n){"use strict";var r,i,a,o=n(1),s=o(n(55));a=function(){var e=function e(){var n=0,r=document.createElement("div");function t(e){return r.appendChild(e.dom),e}function i(e){for(var t=0;t<r.children.length;t++)r.children[t].style.display=t===e?"block":"none";n=e}r.style.cssText="position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000",r.addEventListener("click",function(e){e.preventDefault(),i(++n%r.children.length)},!1);var a=(performance||Date).now(),o=a,s=0,l=t(new e.Panel("FPS","#0ff","#002")),u=t(new e.Panel("MS","#0f0","#020"));if(self.performance&&self.performance.memory)var c=t(new e.Panel("MB","#f08","#201"));return i(0),{REVISION:16,dom:r,addPanel:t,showPanel:i,begin:function(){a=(performance||Date).now()},end:function(){s++;var e=(performance||Date).now();if(u.update(e-a,200),o+1e3<=e&&(l.update(1e3*s/(e-o),100),o=e,s=0,c)){var t=performance.memory;c.update(t.usedJSHeapSize/1048576,t.jsHeapSizeLimit/1048576)}return e},update:function(){a=this.end()},domElement:r,setMode:i}};return e.Panel=function(n,r,i){var a=1/0,o=0,s=Math.round,l=s(window.devicePixelRatio||1),u=80*l,e=48*l,c=3*l,h=2*l,f=3*l,d=15*l,p=74*l,m=30*l,v=document.createElement("canvas");v.width=u,v.height=e,v.style.cssText="width:80px;height:48px";var g=v.getContext("2d");return g.font="bold "+9*l+"px Helvetica,Arial,sans-serif",g.textBaseline="top",g.fillStyle=i,g.fillRect(0,0,u,e),g.fillStyle=r,g.fillText(n,c,h),g.fillRect(f,d,p,m),g.fillStyle=i,g.globalAlpha=.9,g.fillRect(f,d,p,m),{dom:v,update:function(e,t){a=Math.min(a,e),o=Math.max(o,e),g.fillStyle=i,g.globalAlpha=1,g.fillRect(0,0,u,d),g.fillStyle=r,g.fillText(s(e)+" "+n+" ("+s(a)+"-"+s(o)+")",c,h),g.drawImage(v,f+l,d,p-l,m,f,d,p-l,m),g.fillRect(f+p-l,d,l,m),g.fillStyle=i,g.globalAlpha=.9,g.fillRect(f+p-l,d,l,s((1-e/t)*m))}}},e},"object"===(0,s.default)(t)&&void 0!==e?e.exports=a():(r=a,i="function"==typeof r?r.call(t,n,t,e):r,void 0===i||(e.exports=i))},function(e,t,n){var r=n(0);function i(e,t,n){return t in e?r(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}e.exports=i},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(2)),o=r(n(3)),s=function(){function t(e){(0,a.default)(this,t),this.videoMemoryAmount=null,this._map=e}return(0,o.default)(t,[{key:"getVideoMemoryAmount",value:function(e){if(this._map.nodeManager){var t=this._map.nodeManager._scenes[""+e].groups;for(var n in t)this.videoMemoryAmount+=t[""+n].layers.facility[0].getVideoMemoryAmount(),this.videoMemoryAmount+=t[""+n].layers.model[0].getVideoMemoryAmount(),this.videoMemoryAmount+=t[""+n].layers.extent[0].getVideoMemoryAmount(),this.videoMemoryAmount+=t[""+n].layers.label[0].getVideoMemoryAmount();return this.videoMemoryAmount}}},{key:"_addAmount",value:function(e){this.videoMemoryAmount+=e}},{key:"_subtractAmount",value:function(e){this.videoMemoryAmount-=e}}]),t}(),l=s;t.default=l},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(47)),o=r(n(31));n(66);var s,l=r(n(2)),u=r(n(3)),c=r(n(58)),h=r(n(233)),f=r(n(410)),d=function(){function n(e,t){(0,l.default)(this,n),this._map=e,this._ctlOpt=new f.default(t),this._btnWidth=42,this._showBtnCount=this._ctlOpt.showBtnCount||5,this._foucusId=this._map.currentFocusGroup,this._scrollSpeed=10,this._btnPanel=null,this._mainPanel=null,this._ctlOpt.offset||(this._ctlOpt.offset={x:0,y:0}),this._ctlOpt.needAllLayerBtn=null==this._ctlOpt.needAllLayerBtn||this._ctlOpt.needAllLayerBtn,this._allLayer=!!this._ctlOpt.allLayer&&this._ctlOpt.allLayer,this._allLayer&&this._map.showSingerOrMultiGroup(this._allLayer),this.uuid=null,this.init(),this.scrollTopAn_=new c.default.scrollTopAnFun}return(0,u.default)(n,[{key:"init",value:function(){var n=this,e=new Date,t=e.getFullYear(),r=e.getMonth(),i=e.getDate(),a=e.getHours(),o=e.getMinutes(),s=e.getSeconds();a<10&&(a="0"+a),o<10&&(o="0"+o),s<10&&(s="0"+s);var l=t+"/"+r+"/"+i+"/"+a+":"+o+":"+s;this.uuid=String(5*Math.random()).replace(/^(.*\..{4}).*$/,"$1")+l;var u=this.createPanel(this._btnWidth);this._mainPanel=u,this.checkPosition(this._ctlOpt.position,this._ctlOpt.offset,u),this._map.getContainer().appendChild(u);var c=this._map.listGroups.map(function(e){return e.gid}),h=c.length,f=this._showBtnCount,d=!0;h<=this._showBtnCount&&(f=h,d=!1);var p=this.createMultiSwitchButton(this._ctlOpt.imgURL+(this._ctlOpt.allLayer?"layers.png":"layer.png"));this._ctlOpt.needAllLayerBtn&&u.appendChild(p),this._switchBtn=p,d&&u.appendChild(this.createScrollButton(this._ctlOpt.imgURL+"arrow1.png","top"));var m=this.createGroupBtnPanel(f*this._btnWidth+2*(f-1));u.appendChild(m),this._btnPanel=m;for(var v=this._map.listGroups,g=v.length-1;-1<g;g--)m.appendChild(this.createGroupButton(v[g],this._btnWidth)),0<g&&m.appendChild(this.createHr());d&&u.appendChild(this.createScrollButton(this._ctlOpt.imgURL+"arrow2.png","buttom")),m.scrollTop=this.getCenterScrolltopById(this._foucusId,c.length),document.getElementById("gid_"+this._foucusId+this.uuid).style.color="rgb(30, 130, 250)",this.eventBtnPanelInit(m),this.eventPanelInit(u,m,c),this.eventSwitchBtn(p);var y=function(e){var t=n._map.listGroups.map(function(e){return e.gid});e.gid<t[0]||e.gid>t[t.length-1]||(m.scrollTop=n.getCenterScrolltopById(e.gid,t.length),n.setFocusStaus(e.gid))},_=function(e){1<e.gids.length?n.setLayerStatus(!0):n.setLayerStatus(!1)};this._map.on("focusGroupIDChanged",y),this._map.on("visibleGroupIDsChanged",_),this._map.on("dispose",function(){n._map.off("focusGroupIDChanged",y),n._map.off("visibleGroupIDsChanged",_),n._map.getContainer().removeChild(u)}),this._$=function(e){return n.map?n.map.mapView.container_.querySelector(e):document.querySelector(e)}}},{key:"eventSwitchBtn",value:function(e){var t=this;e.addEventListener("click",function(){t._allLayer=!t._allLayer,t._allLayer?e.firstElementChild.src=t._ctlOpt.imgURL+"layers.png":e.firstElementChild.src=t._ctlOpt.imgURL+"layer.png",t._map.showSingerOrMultiGroup(t._allLayer)})}},{key:"eventBtnPanelInit",value:function(n){var r=this,i=this;i.changeScrollBtnPic(),c.default.bindEvent(n,"label","click",function(){i.foucusId=(0,o.default)(this.dataset.gid),i.setFocusStaus(this.dataset.gid)});var e=function(e){i.changeScrollBtnPic();var t=0;e.wheelDelta?t+=-e.wheelDelta:e.detail&&(t+=e.detail),r.scrollTopAn_({el:n,to:n.scrollTop,form:n.scrollTop+t})};n.addEventListener("mousewheel",e,{passive:!0}),n.addEventListener("MozMousePixelScroll",e,!1),n.addEventListener("touchstart",this.touchstart.bind(this),!1),n.addEventListener("touchmove",this.touchmove.bind(this),!1),n.addEventListener("touchend",this.touchend.bind(this),!0)}},{key:"touchstart",value:function(e){e.preventDefault(),this.touchStartPointY=e.touches[0].pageY,this.touchPointX=e.touches[0].pageX,this.touchPointY=e.touches[0].pageY}},{key:"touchmove",value:function(e){e.preventDefault(),this.touchEndPointX=e.touches[0].pageX,this.touchEndPointY=e.touches[0].pageY,this.handleTouchEnd(e)}},{key:"handleTouchEnd",value:function(e){e=e||window.event;var t=this,n=null,r=0;0<e.changedTouches.length&&(t.touchEndPointX=e.changedTouches[0].pageX,t.touchEndPointY=e.changedTouches[0].pageY),n=e.target,n instanceof HTMLSpanElement==1&&(n=n.parentElement);var i=t.touchEndPointY-t.touchPointY;if(r=-i,0!=r){t.touchPointX=t.touchEndPointX,t.touchPointY=t.touchEndPointY;var a=t._$(".fm-layer-list");this.scrollTopAn_({el:a,to:a.scrollTop,form:a.scrollTop+r})}}},{key:"touchend",value:function(e){e=e||window.event;var t=this,n=null;0<e.changedTouches.length&&(t.touchEndPointX=e.changedTouches[0].pageX,t.touchEndPointY=e.changedTouches[0].pageY),n=e.target,n instanceof HTMLSpanElement==1&&(n=n.parentElement);var r=Math.abs(t.touchEndPointY-t.touchStartPointY);if(r<5&&0<=r&&n){var i=(0,o.default)(n.dataset.gid);isNaN(i)||(t.foucusId=i,t.setFocusStaus(i))}}},{key:"eventPanelInit",value:function(e,o,s){var l=this;e.onselectstart=function(){return!1},e.style.MozUserSelect="none",c.default.bindEvent(e,".scroll","click",function(){var e=s.length-Math.floor(o.scrollTop/44)-(l._showBtnCount-1),t=o.scrollTop%44,n=e+l._showBtnCount-1+(0<t?1:0),r=0;if(this.id==="scroll_top"+l.uuid){var i=l._foucusId+1;if(i=Math.min(s[s.length-1],i),l.foucusId==i)return;l.foucusId=i,i<e?r-=0<t?44-t:0:i<=n+1&&i===n+1&&(r-=44+(0<t?44-t:0))}else{var a=l._foucusId-1;if(a=Math.max(s[0],a),l.foucusId==a)return;l.foucusId=a,n<a?r+=0<t?t:0:e-1<=a&&a===e-1&&(r+=44+(0<t?t:0))}0!=r&&l.scrollTopAn_({el:o,to:o.scrollTop,form:o.scrollTop+r})})}},{key:"getCenterScrolltopById",value:function(e,t){var n=t-e-Math.floor(this._showBtnCount/2);return n*(this._btnWidth+2)}},{key:"createPanel",value:function(){var e=document.createElement("div"),t='\n <div class="fm-control-groups" style ="width: 42px; position: absolute; background-color: white; box-shadow: rgba(0, 0, 0, 0.3) 2px 2px 3px; border-radius: 2px; top: 30px; right: 30px;"></div>\n ';return e.innerHTML=t.trim(),e.firstChild}},{key:"createGroupBtnPanel",value:function(e){var t=document.createElement("div"),n='\n <div style = "overflow: hidden; height: '.concat(e,'px;" class="fm-layer-list"> </div\n ');return t.innerHTML=n.trim(),t.firstChild}},{key:"createMultiSwitchButton",value:function(e){var t=document.createElement("div"),n='\n <div class="fm-control-groups-layer fm-btn-layer" style="padding: 10px; cursor: pointer;">\n <img src="'.concat(e,'" style="width: 22px; height: 22px;">\n </div>\n ');return t.innerHTML=n.trim(),t.firstChild}},{key:"createHr",value:function(){var e=document.createElement("div"),t='\n <hr style="height: 1px; border-top: 1px solid rgba(153, 153, 153, 0.45); border-right: none; border-bottom: none; border-left: none; border-image: initial; width: 60%; margin: 0px 20%;">\n ';return e.innerHTML=t.trim(),e.firstChild}},{key:"createScrollButton",value:function(e,t){var n=document.createElement("div"),r='\n <div class="scroll" id="scroll_'.concat(t+this.uuid,'" style="height: 18px; background: url(&quot;').concat(e,'&quot;) 50% 50% no-repeat; cursor: pointer;"></div>\n ');return n.innerHTML=r.trim(),n.firstChild}},{key:"createGroupButton",value:function(e,t){var n=document.createElement("div"),r="<label data-gid=".concat(e.gid,' id="gid_').concat(e.gid+this.uuid,'" style="display: inline-block; text-align: center; width: ').concat(t,"px; height: ").concat(t,"px; line-height: ").concat(t,'px; margin: 0px; cursor: pointer; font-size: 0.8em; font-weight: bold; color: rgb(102, 102, 102);">\n <span>').concat(e.alias&&e.alias.toUpperCase()||e.gname.toUpperCase(),"</span>\n </label>");return n.innerHTML=r.trim(),n.firstChild}},{key:"changeScrollBtnPic",value:function(){var e=this._foucusId,t=this._map.listGroups.map(function(e){return e.gid}),n=document.getElementById("scroll_buttom"+this.uuid),r=document.getElementById("scroll_top"+this.uuid);e==t[0]?n&&(n.style.backgroundImage="url("+this._ctlOpt.imgURL+"arrow4.png)"):n&&(n.style.backgroundImage="url("+this._ctlOpt.imgURL+"arrow2.png)"),e==t[t.length-1]?r&&(r.style.backgroundImage="url("+this._ctlOpt.imgURL+"arrow3.png)"):r&&(r.style.backgroundImage="url("+this._ctlOpt.imgURL+"arrow1.png)")}},{key:"changeFocusGroup",value:function(e){this.foucusId=e}},{key:"changeGroupsSelect",value:function(e){this.setLayerStatus(e),this._map.showSingerOrMultiGroup(e)}},{key:"setLayerStatus",value:function(e){this._allLayer=e,this._allLayer?this._switchBtn.firstElementChild.src=this._ctlOpt.imgURL+"layers.png":this._switchBtn.firstElementChild.src=this._ctlOpt.imgURL+"layer.png"}},{key:"checkPosition",value:function(e,t,n){switch(n.style.left="",n.style.right="",n.style.top="",n.style.bottom="",e){case h.default.LEFT_TOP:n.style.left=t.x+"px",n.style.top=t.y+"px";break;case h.default.RIGHT_TOP:n.style.right=-t.x+"px",n.style.top=t.y+"px";break;case h.default.LEFT_BOTTOM:n.style.left=t.x+"px",n.style.bottom=-t.y+"px";break;case h.default.RIGHT_BOTTOM:n.style.right=-t.x+"px",n.style.bottom=-t.y+"px";break;default:n.style.left=t.x+"px",n.style.top=t.y+"px"}}},{key:"onChange",value:function(e){s=e}},{key:"setFocusStaus",value:function(e){document.getElementById("gid_"+this._foucusId+this.uuid).style.color="rgb(102, 102, 102)",this._foucusId=(0,o.default)(e),document.getElementById("gid_"+this._foucusId+this.uuid).style.color="rgb(30, 130, 250)",this.changeScrollBtnPic()}},{key:"foucusId",set:function(e){var t=[];t.push.apply(t,(0,a.default)(this._map.visibleGroupIDs)),1==t.length?this._map.visibleGroupIDs=[e]:-1<this._map.visibleGroupIDs.indexOf(e)||(t.push(e),this._map.visibleGroupIDs=t),this._map.changeFocusToGroup({gid:e}),s&&s([e],1<this._map.visibleGroupIDs.length)},get:function(){return this._map.currentFocusGroup}},{key:"allLayer",get:function(){return this._map.showAllGroup}}]),n}(),p=d;t.default=p},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(32)),o=r(n(2)),s=r(n(411)),l=function e(t){(0,o.default)(this,e),this.size=s.default.FMMap_CONTROL_NORMAL,this.position=null,this.offset=new fm.Vector2(0,0),this.imgURL="resource/style/wedgets/img/",(0,a.default)(this,t)},u=l;t.default=u},function(e,t,n){"use strict";var r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var i={FMMap_CONTROL_SMALL:"small",FMMap_CONTROL_NORMAL:"normal"},a=i;t.default=a},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0,n(5),n(4);var a=r(n(6)),s=r(n(32));n(10),n(151);var o=r(n(2)),l=r(n(3)),u=r(n(7)),c=r(n(8)),h=r(n(9)),f=r(n(12)),d=r(n(34)),p=r(n(149)),m=r(n(73)),v=r(n(33)),g=r(n(111)),y=r(n(234)),_=n(74);function x(r){return function(){var e,t=(0,c.default)(r);if(w()){var n=(0,c.default)(this).constructor;e=(0,a.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,u.default)(this,e)}}function w(){if("undefined"==typeof Reflect||!a.default)return!1;if(a.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,a.default)(Date,[],function(){})),!0}catch(e){return!1}}var b=function(e){(0,h.default)(r,e);var n=x(r);function r(e){var t;return(0,o.default)(this,r),t=n.call(this,0,v.default.IMAGE_MARKER),t.isInitSprite=!1,t._url=e.url,t._size=e.size,t._height=0,t._offsetHeight=e.height?e.height:0,t._renderNode=null,t._visible=!0,t._opx=e.x||0,t._opy=e.y||0,t._callBack=e.callback,t._moveAnimater=null,t._isMoving=!1,t._depth=e.depth,t._isJumping=!1,t._origonY=0,t.center=t.getCenterByAnchor(e.anchor),t.picLoading=!1,t.needAvoid=!0,t.markername=e.name,t}return(0,l.default)(r,[{key:"initSprite",value:function(){var e=this,t=this.findParent(d.default);if(!t)return!1;var n=!0,r=t.materialManager.createPoiMaterial({imageUrl:this._url,imageSrc:this._url,alpha:1},function(){e._renderNode?(e.picLoading=!1,e._renderNode.layers.set(0),e._renderNode.frustumCulled=!1):n=!1},this._depth,this._priority);r.userData.size=this._size,this._renderNode=new g.default(r),this._renderNode.markername=this.markername,n&&(this.picLoading=!0,this._renderNode.layers.set(2)),this._renderNode.mapNode=this,this._renderNode.parent=this.parent.scene,this._renderNode.center.set(this.center.x,this.center.y),t.map.renderer.setImageMarkerSize(this._renderNode),this._renderNode.visible=this.show,this.isInitSprite=!0;var i=this.parent.parent.groupID,a=this.parent.parent.parent.mapcenter;return this._opx&&this._opy?(this._x=this._opx,this._y=this._opy):(this._x=a.x,this._y=a.y),this.setPosition(this.x,this.y,i,this._offsetHeight),this._callBack&&this._callBack(this),!0}},{key:"setPosition",value:function(e,t,n,r){var i=this.findParent(p.default);if(i){"number"==typeof n&&0<n&&this.moveToGroup(n);var a=i.center,o=i.mapcenter;this._height=r,this._x=e,this._y=t,this._renderNode.position.set(this._x-o.x,a.y+this._height,a.y-this._y+o.y)}else console.error("Can't change position before map init Marker")}},{key:"getPosition",value:function(){return{x:this._y,y:this._y,z:this._height,groupID:this.parent.parent.groupID}}},{key:"moveTo",value:function(t){var n=this;if(!this._isMoving){var e=this.findParent(d.default),r=t.x,i=t.y,a=null;a=t.height?t.height:this._height;var o=new m.default({x:this.x,y:this.y,height:this._height},{x:r,y:i,height:a},1e3*t.time,function(){e.map.removeAnimater(o),n._moveAnimater=null,n._isMoving=!1,t.callback()},function(e){n.setPosition(e.x,e.y,0,e.height),t.update(e)}).start();this._isMoving=!0,e.map.addAnimater(o),this._moveAnimater=o}}},{key:"moveToGroup",value:function(e){var t=this.findParent(d.default),n=this.parent.parent.groupID;if(n!==e)if(this.parent.parent.parent.groups[""+e]){this._groupId=e;var r=this.parent.parent.parent.groups[""+e].getOrCreateLayer("imageMarker");this.parent.untiedMarker(this),r.addMarker(this),t.map.renderer.setImageMarkerSize(this._renderNode)}else console.warn(_.tileMessage.noGroup)}},{key:"stopMoveTo",value:function(){var e=this.findParent(d.default);this._moveAnimater&&this._moveAnimater.stop(),e.map.removeAnimater(this._moveAnimater),this._isMoving=!1,this._moveAnimater=null}},{key:"jump",value:function(e){var n=this;if(this._renderNode&&!this._isJumping){this._isJumping=!0;var r=(0,s.default)({height:8,times:0,duration:1,delay:0},e);if("number"==typeof r.height&&"number"==typeof r.times&&"number"==typeof r.duration&&"number"==typeof r.delay){r.duration*=1e3,r.delay*=1e3,r.all=r.duration+r.delay,r.halfDuration=r.duration/2;var i=r.height-this._height;this._origonY=this._renderNode.position.y;var a=(new Date).getTime(),t=this.findParent(d.default),o=t.map;this.jumpEvent=function(){if(n._renderNode){var e=(new Date).getTime()-a;if(0!=r.times&&e/r.all>r.times)n.stopJump();else if(e%=r.all,e>r.duration)n._renderNode.position.y!=n._origonY&&(n._renderNode.position.y=n._origonY);else{var t=e/r.halfDuration-1;t=1-t*t,n._renderNode.position.y=n._origonY+i*t}}else o.off("frameLoop",n.jumpEvent)},o.on("frameLoop",this.jumpEvent)}}}},{key:"stopJump",value:function(){if(this._renderNode&&this.jumpEvent){this._renderNode.position.y=this._origonY,this._isJumping=!1;var e=this.findParent(d.default),t=e.map;t.off("frameLoop",this.jumpEvent)}}},{key:"setSize",value:function(){var e=this.findParent(d.default);e.map.renderer.setFacilitySize(this._renderNode,this._size)}},{key:"dispose",value:function(){this.parent&&this.parent.removeMarker(this),this._renderNode&&(this._renderNode.material.dispose(),this._renderNode.geometry.dispose(),this._renderNode.material=void 0,this._renderNode.geometry=void 0,this._renderNode.mapNode=void 0,this._renderNode=void 0)}},{key:"getCenterByAnchor",value:function(e){var t=new fm.Vector2(.5,.5);switch(e){case y.default.LEFT:t.setX(0);break;case y.default.RIGHT:t.setX(1);break;case y.default.TOP:t.setY(1);break;case y.default.BOTTOM:t.setY(0);break;case y.default.LEFT_TOP:t.set(0,1);break;case y.default.RIGHT_TOP:t.set(1,1);break;case y.default.LEFT_BOTTOM:t.set(0,0);break;case y.default.RIGHT_BOTTOM:t.set(1,0)}return t}},{key:"url",set:function(e){var t=this.findParent(d.default);if(!t)return!1;var n=t.materialManager.createPoiMaterial({imageUrl:e,imageSrc:e,alpha:1});n.userData.size=this._size,this._renderNode.material.dispose(),this._renderNode.material=n,this._url=e},get:function(){return this._url}},{key:"renderNode",get:function(){return this._renderNode}},{key:"visible",set:function(e){e?this.parent.scene.children.indexOf(this._renderNode)<0&&this._renderNode&&this.parent.scene.add(this._renderNode):this._renderNode&&this.parent.scene.remove(this._renderNode),this._visible=e},get:function(){return this._visible}},{key:"size",get:function(){return this._size},set:function(e){this._size=e}}]),r}(f.default),M=b;t.default=M},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0,n(5),n(4);var a=r(n(6)),l=r(n(32));n(21),n(71),n(10);var u=r(n(2)),c=r(n(3)),o=r(n(7)),s=r(n(8)),h=r(n(9)),f=r(n(12)),d=r(n(34)),p=r(n(111)),m=r(n(149)),v=r(n(73)),g=r(n(33)),y=n(74);function _(r){return function(){var e,t=(0,s.default)(r);if(x()){var n=(0,s.default)(this).constructor;e=(0,a.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,o.default)(this,e)}}function x(){if("undefined"==typeof Reflect||!a.default)return!1;if(a.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,a.default)(Date,[],function(){})),!0}catch(e){return!1}}var w=function(e){(0,h.default)(s,e);var o=_(s);function s(e,t){var n;if((0,u.default)(this,s),n=o.call(this,0,g.default.TEXT_MARKER),n._text=e.name,n._param=e,n.isInitSprite=!1,n._opx=e.x||0,n._opy=e.y||0,n._height=e.height||0,n._renderNode=null,n._visible=!0,n._isRuning=!1,n._size=1.4*e.fontsize,n._callBack=e.callback,n._fillcolor=e.fillcolor,n._platecolor=e.platecolor,n._platestrokecolor=e.platestrokecolor,n._fontsize=e.fontsize,n._strokecolor=e.strokecolor,n._content=e.content,n.needAvoid=!1,!n._content){n.needAvoid=!0;for(var r=n._text.split("%rn%"),i=[],a=0;a<r.length;a++)i.push({text:r[a],fontsize:n._fontsize,fontcolor:n._fillcolor,strokecolor:n._strokecolor});n._content=i}return n._scale=e.scale,n._target=t,n._moveAnimater,n.picLoading=!1,n}return(0,c.default)(s,[{key:"initSprite",value:function(){var e=this.findParent(d.default);if(!e)return!1;var t=e.materialManager.createTextMaterial(this._content,(0,l.default)({alpha:1},this._param),this._param.depth);this._size=t.size,t.userData.size=t.size,this._renderNode=new p.default(t),this._renderNode.mapNode=this,this._renderNode.frustumCulled=!1,this._target?this.setTsize():e.map.renderer.setLabelSize(this._renderNode,t.size),this.isInitSprite=!0;var n=this.parent.parent.parent.mapcenter;if(this._target){var r=this._target.mapCoord;this._x=r.x,this._y=r.y}else this._opx&&this._opy?(this._x=this._opx,this._y=this._opy):(this._x=n.x,this._y=n.y);return this._height,this.setPosition(this.x,this.y,0,this._height),this._callBack&&this._callBack(),this._renderNode.visible=this.show,!0}},{key:"redraw",value:function(){var e=this.findParent(d.default);if(!e)return!1;if(this.renderNode){var t=e.materialManager.createTextMaterial(this._content,(0,l.default)({alpha:1},this._param));this.renderNode.material.map.dispose(),this.renderNode.material.dispose(),this.renderNode.material=t}}},{key:"setTsize",value:function(){var e=this._target,t=e.getNearestDis();this.renderNode&&(this.setSize(t*this._scale),this.renderNode.material.sizeAttenuation=!0)}},{key:"setSize",value:function(e){var t=this.findParent(d.default);this._size=e,t.map.renderer.setLabelSize(this._renderNode,e||this._size,!!e)}},{key:"setPosition",value:function(e,t,n,r){var i=this.findParent(m.default);if(i){"number"==typeof n&&0<n&&this.moveToGroup(n);var a=i.mapcenter;this._height=r,this._x=e,this._y=t,this._renderNode.position.set(this._x-a.x,this._height,-this._y+a.y)}else console.error("Can't change position before map init Marker")}},{key:"getPosition",value:function(){return{x:this._y,y:this._y,z:this._height,groupID:this.parent.parent.groupID}}},{key:"moveTo",value:function(t){var n=this;if(!this._isRuning){var e=this.findParent(d.default),r=t.x,i=t.y,a=new v.default({x:this.x,y:this.y},{x:r,y:i},1e3*t.time,function(){e.map.removeAnimater(a),n._moveAnimater=null,n._isRuning=!1,t.callback()},function(e){n.setPosition(e.x,e.y,0,0),t.update(e)}).start();this._isRuning=!0,e.map.addAnimater(a),this._moveAnimater=a}}},{key:"moveToGroup",value:function(e){var t=this.findParent(d.default),n=this.parent.parent.groupID;if(n!==e)if(this.parent.parent.parent.groups[""+e]){var r=this.parent.parent.parent.groups[""+e].getOrCreateLayer("textMarker");this._groupId=e,this.parent.untiedMarker(this),r.addMarker(this),t.map.renderer.setLabelSize(this._renderNode)}else console.warn(y.tileMessage.noGroup)}},{key:"stopMoveTo",value:function(){var e=this.findParent(d.default);this._moveAnimater&&this._moveAnimater.stop(),e.map.removeAnimater(this._moveAnimater)}},{key:"dispose",value:function(){this._renderNode&&(this._renderNode.material.dispose(),this._renderNode.geometry.dispose(),this._renderNode.material=void 0,this._renderNode.geometry=void 0,this._renderNode.mapNode=void 0,this._renderNode=void 0)}},{key:"reDraw",value:function(){var e=this.findParent(d.default);if(!e)return!1;var t=e.materialManager.createLabelMaterial(this._text,(0,l.default)({alpha:1},this._param));t.userData.size=this._size,this._renderNode.material.dispose(),this._renderNode.material=void 0,this._renderNode.material=t,e.map.renderer.setLabelSize(this._renderNode,this._size)}},{key:"name",set:function(e){this._text=e,this.reDraw()},get:function(){return this._text}},{key:"renderNode",get:function(){return this._renderNode}},{key:"visible",set:function(e){e?this.parent.scene.children.indexOf(this._renderNode)<0&&this._renderNode&&this.parent.scene.add(this._renderNode):this._renderNode&&this.parent.scene.remove(this._renderNode),this._visible=e},get:function(){return this._visible}},{key:"size",get:function(){return this._size}},{key:"fillcolor",get:function(){return this._fillcolor},set:function(e){this._fillcolor=e,this._param.fillcolor=e,this.reDraw()}},{key:"fontsize",get:function(){return this._fontsize}},{key:"strokecolor",get:function(){return this._strokecolor},set:function(e){this._strokecolor=e,this._param.strokecolor=e,this.reDraw()}},{key:"content",set:function(e){this._content=e}}]),s}(f.default),b=w;t.default=b},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0,n(5),n(4);var a=r(n(6)),o=r(n(2)),s=r(n(3)),l=r(n(7)),u=r(n(8)),c=r(n(9)),h=r(n(12)),f=r(n(415)),d=r(n(33)),p=r(n(73)),m=n(74);function v(r){return function(){var e,t=(0,u.default)(r);if(g()){var n=(0,u.default)(this).constructor;e=(0,a.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,l.default)(this,e)}}function g(){if("undefined"==typeof Reflect||!a.default)return!1;if(a.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,a.default)(Date,[],function(){})),!0}catch(e){return!1}}var y=function(e){(0,c.default)(r,e);var n=v(r);function r(e){var t;return(0,o.default)(this,r),t=n.call(this,0,d.default.LOCATION_MARKER),t._size=e.size||20,t._url=e.url,t._groupId=e.groupID||1,t._x=e.x||t._x,t._y=e.y||t._y,t._dheight=e.height||2.1,t._gid=e.groupID||1,t._scene=null,t._renderNode=null,t._map=null,t._callBack=e.callback,t.rotateAnimater=null,t}return(0,s.default)(r,[{key:"initSprite",value:function(e){var t=this,n=new f.default,r=new fm.MeshBasicMaterial,i=!0;e.materialManager.loadTexture(this._url,function(e){e.minFilter=fm.LinearFilter,e.generateMipmaps=!1,e.flipY=!1,r.map=e,r.needsUpdate=!0,t._renderNode?(t.picLoading=!1,t._renderNode.layers.set(0)):i=!1}),r.side=2,r.transparent=!0,this._renderNode=new fm.Mesh(n,r),this._renderNode.mapNode=this,i&&(this.picLoading=!0,this._renderNode.layers.set(2));var a=this._scene.mapcenter;return this._x&&this._y||(this._x=a.x,this._y=a.y),this._callBack&&this._callBack(this),this.setPosition({x:this._x,y:this._y}),!0}},{key:"setPosition",value:function(e){if(this._scene){void 0!==e.zOffset&&(this._dheight=e.zOffset),void 0!==e.height&&(this._dheight=e.height);var t=this._scene.groups[this._gid];if(e.groupID&&e.groupID!==this._gid){var n=t,r=this._scene.groups[e.groupID];if(!r)return void console.warn(m.tileMessage.noGroup);n.removeLocation(this),r.addLocation(this),t=r,this.isAlwaysShow&&this.alwaysShow(),this._gid=e.groupID,this._groupId=this._gid}var i=this._scene.mapcenter;this._x=e.x,this._y=e.y,this._renderNode.position.set(this._x-i.x,this._dheight,-this._y+i.y)}else console.error("Can't change position before map init Marker")}},{key:"rotate",value:function(e){this._renderNode.rotation.y=e*fm.Math.DEG2RAD}},{key:"rotateTo",value:function(t){var n=this,e=this.renderNode.rotation.y,r=t.to%360*fm.Math.DEG2RAD,i=r,a=0;r-e!=0&&(a=Math.sin(r-e)/Math.abs(Math.sin(r-e))*Math.acos(Math.cos(r-e)));var o=e+a,s=e;this.rotateAnimater&&(this.rotateAnimater.stop(),this._map.removeAnimater(this.rotateAnimater));var l=new p.default({angle:s},{angle:o},t.duration?1e3*t.duration:500,function(){n._map.removeAnimater(l),n.rotateAnimater=null,n._renderNode.rotation.y=i,t.callback&&t.callback()},function(e){n._renderNode.rotation.y=e.angle,t.update&&t.update()}).start();this._map.addAnimater(l),this.rotateAnimater=l}},{key:"moveTo",value:function(t){var n=this;if(!this._isRuning){var e=t.x,r=t.y,i=new p.default({x:this._x,y:this._y},{x:e,y:r},t.time?1e3*t.time:500,function(){n._map.removeAnimater(i),n._isRuning=!1,t.callback&&t.callback()},function(e){n.setPosition({x:e.x,y:e.y,groupID:0,height:n._dheight}),t.update&&t.update(e)}).start();this._isRuning=!0,this._map.addAnimater(i)}}},{key:"alwaysShow",value:function(){var e;this._alwaysShow=!0;for(var t=this.parent;t;){if(t.isGroup){e=t;break}t=t.parent}e&&this.renderNode&&(this.renderNode.material.depthTest=!1,e.alwaysShowMarkers.push(this.renderNode))}},{key:"dispose",value:function(){this.parent&&this.parent.removeLocation(this),this.parent=null,this._renderNode&&(this._renderNode.material.dispose(),this._renderNode.geometry.dispose(),this._renderNode.material=void 0,this._renderNode.geometry=void 0,this._renderNode.mapNode=void 0,this._renderNode=void 0)}},{key:"direction",get:function(){return this.renderNode.rotation.y},set:function(e){this.renderNode.rotation.y=e*fm.Math.DEG2RAD}},{key:"scene",set:function(e){this._scene=e}},{key:"map",set:function(e){this._map=e}},{key:"size",get:function(){return this._size}},{key:"renderNode",get:function(){return this._renderNode}},{key:"groupID",get:function(){return this._groupId}},{key:"height",get:function(){return this._dheight}}]),r}(h.default),_=y;t.default=_},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0,n(5),n(4);var a=r(n(6));n(46);var o=r(n(2)),s=r(n(7)),l=r(n(8)),u=r(n(9));function c(r){return function(){var e,t=(0,l.default)(r);if(h()){var n=(0,l.default)(this).constructor;e=(0,a.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,s.default)(this,e)}}function h(){if("undefined"==typeof Reflect||!a.default)return!1;if(a.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,a.default)(Date,[],function(){})),!0}catch(e){return!1}}var f=function(e){(0,u.default)(i,e);var r=c(i);function i(){var e;(0,o.default)(this,i),e=r.call(this);var t=new Float32Array([-.5,0,-.5,0,0,.5,0,-.5,1,0,.5,0,.5,1,1,-.5,0,.5,0,1]),n=new fm.InterleavedBuffer(t,5);return e.setIndex([0,1,2,0,2,3]),e.addAttribute("position",new fm.InterleavedBufferAttribute(n,3,0,!1)),e.addAttribute("uv",new fm.InterleavedBufferAttribute(n,2,3,!1)),e}return i}(fm.BufferGeometry),d=f;t.default=d},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0,n(5),n(4);var a=r(n(6)),o=r(n(2)),s=r(n(3)),l=r(n(7)),u=r(n(8)),c=r(n(9)),h=r(n(417));function f(r){return function(){var e,t=(0,u.default)(r);if(d()){var n=(0,u.default)(this).constructor;e=(0,a.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,l.default)(this,e)}}function d(){if("undefined"==typeof Reflect||!a.default)return!1;if(a.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,a.default)(Date,[],function(){})),!0}catch(e){return!1}}r(n(237)),r(n(236));var p=function(e){(0,c.default)(i,e);var r=f(i);function i(e,t){var n;return(0,o.default)(this,i),n=r.call(this,e,t),n.type="Line2",n.isLine2=!0,n}return(0,s.default)(i,[{key:"copy",value:function(){}}]),i}(h.default),m=p;t.default=m},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0,n(5),n(4);var a=r(n(6));n(46);var o=r(n(2)),s=r(n(3)),l=r(n(7)),u=r(n(8)),c=r(n(9));function h(r){return function(){var e,t=(0,u.default)(r);if(f()){var n=(0,u.default)(this).constructor;e=(0,a.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,l.default)(this,e)}}function f(){if("undefined"==typeof Reflect||!a.default)return!1;if(a.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,a.default)(Date,[],function(){})),!0}catch(e){return!1}}r(n(238));var d=function(e){(0,c.default)(i,e);var r=h(i);function i(e,t){var n;return(0,o.default)(this,i),n=r.call(this,e,t),n.type="LineSegments2",n.isLineSegments2=!0,n}return(0,s.default)(i,[{key:"computeLineDistances",value:function(){for(var e=new fm.Vector3,t=new fm.Vector3,n=this.geometry,r=n.attributes.instanceStart,i=n.attributes.instanceEnd,a=new Float32Array(2*r.data.count),o=0,s=0,l=r.data.count;o<l;o++,s+=2)e.fromBufferAttribute(r,o),t.fromBufferAttribute(i,o),a[s]=0===s?0:a[s-1],a[s+1]=a[s]+e.distanceTo(t);var u=new fm.InstancedInterleavedBuffer(a,2,1);return n.addAttribute("instanceDistanceStart",new fm.InterleavedBufferAttribute(u,1,0)),n.addAttribute("instanceDistanceEnd",new fm.InterleavedBufferAttribute(u,1,1)),this}},{key:"copy",value:function(){return this}}]),i}(fm.Mesh),p=d;t.default=p},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0,n(5),n(4);var a=r(n(6));n(46);var o=r(n(2)),s=r(n(3)),l=r(n(7)),u=r(n(8)),c=r(n(9)),h=r(n(12)),f=r(n(33)),m=r(n(34)),v=r(n(152)),d=r(n(72));function p(r){return function(){var e,t=(0,u.default)(r);if(g()){var n=(0,u.default)(this).constructor;e=(0,a.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,l.default)(this,e)}}function g(){if("undefined"==typeof Reflect||!a.default)return!1;if(a.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,a.default)(Date,[],function(){})),!0}catch(e){return!1}}var y=function(e){(0,c.default)(r,e);var n=p(r);function r(e){var t;return(0,o.default)(this,r),t=n.call(this,0,f.default.POLYGON_MARKER),t._visible=!0,t._isInitPolygon=!1,t._color=e.color||"#FF0000",t._alpha="number"==typeof e.alpha?e.alpha:1,e.points.type&&("rectangle"==e.points.type&&e.points.startPoint&&e.points.startPoint.x&&e.points.startPoint.y?(t._x=e.points.startPoint.x+e.points.width/2,t._y=e.points.startPoint.y-e.points.height/2):(t._x=e.points.center.x,t._y=e.points.center.y)),t._dheight=e.height||0,t._lineWidth="number"==typeof e.lineWidth?e.lineWidth:2,t._points=e.points,t._renderNode,t._line,t}return(0,s.default)(r,[{key:"initPolygon",value:function(){if(!this._points)return!1;if(!this.parent)return!1;if(!this.parent.parent)return!1;var e=this.findParent(m.default);if(!e)return!1;var t={};t.resolution=new fm.Vector2(e.map.renderer.container.clientWidth,e.map.renderer.container.clientHeight);var n=e.map.renderer.getCameraByViewMode(e.map._viewMode);t.near=n.near,t.far=n.far,t.color=this._color,t.alpha=1,t.lineWidth=this._lineWidth;var r=this.parent.parent,i=new fm.MeshBasicMaterial;i.transparent=!0,i.opacity=this._alpha,i.color=new fm.Color(this._color),i.side=2,i.depthTest=!1,r.getCenterPosition();var a,o,s=r.parent.mapcenter,l=new v.default;switch(this._line=l,this._x||(this._x=s.x),this._y||(this._y=s.y),this._dheight?this._height=this._dheight:this._height=0,this._points.type){case"circle":a=this.createCircleGeometry(this._points.radius,this._points.segments),o=new Float32Array(a.attributes.position.array.length-3);for(var u=0;u<a.attributes.position.array.length;u++)2<u&&(o[u-3]=a.attributes.position.array[u]);break;case"rectangle":a=this.createReactGeometry(this._points.width,this._points.height);var c=a.attributes.position.array.length,h=a.attributes.position.array;o=new Float32Array(c+3);for(var f=0;f<c;f++)o[f]=a.attributes.position.array[f];o[c-6]=h[c-3],o[c-5]=h[c-2],o[c-4]=h[c-1],o[c-3]=h[c-6],o[c-2]=h[c-5],o[c-1]=h[c-4],o[c]=h[0],o[c+1]=h[1],o[c+2]=h[2];break;default:a=this.createPolygonGeometry(this._points,s);var d=a.attributes.position.array.length;o=new Float32Array(d+3);for(var p=0;p<d;p++)o[p]=a.attributes.position.array[p];o[d]=a.attributes.position.array[0],o[d+1]=a.attributes.position.array[1],o[d+2]=a.attributes.position.array[2]}return l.initLinePoints(o,t),this._renderNode=new fm.Mesh(a,i),this._renderNode.mapNode=this,this._renderNode.add(l.renderNode),this._renderNode.rotation.set(Math.PI/2,0,0,"XYZ"),this._renderNode.position.set(this._x-s.x,this._height,-this._y+s.y),!0}},{key:"contain",value:function(e){if(!this._points)return!1;if(!this.parent)return!1;if(!this.parent.parent)return!1;var t=this.parent.parent;switch(t.getCenterPosition(),t.parent.center,this._points.type){case"circle":var n=Math.sqrt((e.x-this._x)*(e.x-this._x)+(e.y-this._y)*(e.y-this._y));if(n<this._points.r)return!0;break;case"rectangle":if(Math.abs(e.x-this._x)<this._points.width/2&&Math.abs(e.y-this._y)<this._points.height/2)return!0;break;default:return d.default.pointInPolygon2d(this._points,e,this._points.length)}return!1}},{key:"createReactGeometry",value:function(e,t){return new fm.PlaneBufferGeometry(e,t)}},{key:"createCircleGeometry",value:function(e,t){return new fm.CircleBufferGeometry(e,t)}},{key:"createPolygonGeometry",value:function(e,t){for(var n=new fm.Shape,r=0;r<e.length;r++)0==r?n.moveTo(e[r].x-t.x,-e[r].y+t.y):n.lineTo(e[r].x-t.x,-e[r].y+t.y);return n.lineTo(e[0].x-t.x,-e[0].y+t.y),new fm.ShapeBufferGeometry(n)}},{key:"setColor",value:function(e){this._renderNode.material.color=new fm.Color(e)}},{key:"setLineWidth",value:function(e){this._renderNode.children[0].material.linewidth=e}},{key:"setAlpha",value:function(e){this._renderNode.material.opacity=e}},{key:"dispose",value:function(){this._renderNode&&(this._renderNode.material.dispose(),this._renderNode.geometry.dispose(),this._renderNode.material=void 0,this._renderNode.geometry=void 0,this._geometry=void 0,this._renderNode.mapNode=void 0,this._renderNode=void 0)}},{key:"isInitPolygon",get:function(){return this._isInitPolygon}},{key:"renderNode",get:function(){return this._renderNode}},{key:"visible",get:function(){return this._visible}}]),r}(h.default),_=y;t.default=_},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0,n(5),n(4);var a=r(n(6));n(10),n(151),n(71);var o=r(n(2)),s=r(n(3)),l=r(n(7)),u=r(n(8)),c=r(n(9)),h=r(n(12)),f=r(n(34));function d(r){return function(){var e,t=(0,u.default)(r);if(p()){var n=(0,u.default)(this).constructor;e=(0,a.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,l.default)(this,e)}}function p(){if("undefined"==typeof Reflect||!a.default)return!1;if(a.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,a.default)(Date,[],function(){})),!0}catch(e){return!1}}var m=function(e){(0,c.default)(r,e);var n=d(r);function r(e){var t;return(0,o.default)(this,r),t=n.call(this,e),t._visible=!0,t.x=e.x,t.y=e.y,t.domContent=e.domContent,t.fontSize=e.fontsize,t._id=null,t.anchor=e.anchor,t.domWidth=e.domWidth,t.domHeight=e.domHeight,t.height=e.height,t._param=e,t.alpha=e.alpha,t}return(0,s.default)(r,[{key:"initDom",value:function(e){var t=this.findParent(f.default);if(t){var n=document.createElement("div"),r=t._map.renderer.renderer.domElement.parentNode;r.style.position="absolute",r.appendChild(n);var i=null;i=e.height?e.height+this.parent.height:this.parent.height;var a=t._map.coordMapToScreen(e.x,e.y,i);n.name="domMarker",n.id=e.id,n.setAttribute("class","domMarker"),this._id=e.id,n.style.fontSize=e.fontSize,n.innerHTML=e.domContent,n.style.width=e.domWidth+"px",n.style.height=e.domHeight+"px",n.style.left=this._anchor(e,a).left,n.style.top=this._anchor(e,a).top,n.style.position="absolute"}}},{key:"_anchor",value:function(e,t){var n=null,r=null;switch(e.anchor){case 9:n=t.x-e.domWidth/2+"px",r=t.y-e.domHeight/2+"px";break;case 5:n=t.x+"px",r=t.y+"px";break;case 6:n=t.x-e.domWidth+"px",r=t.y+"px";break;case 7:n=t.x+"px",r=t.y-e.domHeight+"px";break;case 8:n=t.x-e.domWidth+"px",r=t.y-e.domHeight+"px";break;case 1:n=t.x+"px",r=t.y-e.domHeight/2+"px";break;case 2:n=t.x-e.domWidth+"px",r=t.y-e.domHeight/2+"px";break;case 3:n=t.x-e.domWidth/2+"px",r=t.y+"px";break;case 4:n=t.x-e.domWidth/2+"px",r=t.y-e.domHeight+"px";break;default:n=t.x-e.domWidth/2+"px",r=t.y-e.domHeight/2+"px"}return{left:n,top:r}}},{key:"show",get:function(){return this.show},set:function(e){this._visible=e;var t=document.getElementById(this._id);t&&(t.style.display=e?"block":"none")}}]),r}(h.default),v=m;t.default=v},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0,n(10),n(110);var l=r(n(25)),s=r(n(31));function a(e,t){this.map_=e,this.texture_=null,this.config(t)}a.create=function(e,t){return new a(e,t)},a.prototype={getDeviceDPI:function(){var e=new Array;if(null!=window.screen.deviceXDPI)e[0]=window.screen.deviceXDPI,e[1]=window.screen.deviceYDPI;else{var t=document.createElement("DIV");t.style.cssText="width:1in;height:1in;position:absolute;left:0px;top:0px;z-index:99;visibility:hidden",document.body.appendChild(t),e[0]=(0,s.default)(t.offsetWidth),e[1]=(0,s.default)(t.offsetHeight),t.parentNode.removeChild(t)}return e},getDeviceWH:function(e){e=e||{};var t=this.map_.maxX-this.map_.minX,n=this.map_.maxY-this.map_.minY,r={w:Math.round(t),h:Math.round(n)},i=this.getDeviceDPI();r.w=(0,s.default)(r.w*i[0]/25.4),r.h=(0,s.default)(r.h*i[1]/25.4);var a=1,o=e.maxSize||2048;return(r.w>=o||r.h>=o)&&(r.w>=r.h?(a=r.h/r.w,r.w=o,r.h=(0,s.default)(o*a)):(a=r.w/r.h,r.h=o,r.w=(0,s.default)(o*a))),r},getPixXY:function(e,t){var n=(e-this.map_.minX)/(this.map_.maxX-this.map_.minX),r=(this.map_.maxY-t)/(this.map_.maxY-this.map_.minY),i={x:n,y:r};return i.x=i.x*this.options.width,i.y=i.y*this.options.height,i},config:function(e){var t=this,n=t.getDeviceWH(e),r=n.w,i=n.h;t.options={width:r,height:i,opacity:e.opacity?255*e.opacity:25500,radius:e.radius?e.radius:30,bshadow:e.radius?e.radius/20:1.5,maxSize:e.mapSize||2048,boundVal:15e3,shadowBlur:Math.ceil(.3*e.radius),points:{max:e.max?e.max:100,data:[]},gradient:e.gradient?e.gradient:{.45:"rgb(0,0,255)",.55:"rgb(0,255,255)",.65:"rgb(0,255,0)",.95:"yellow",1:"rgb(255,0,0)"},isHeatPlan:e.isHeatPlan,heatHeight:e.heatHeight};var a=document.createElement("canvas"),o=a.getContext("2d");a.width=r,a.height=i,t.options.ctx=o,t.options.canvas=a},renderShadow:function(e,t,n,r){var i=this,a=i.options.ctx,o=(i.options.radius,i.options.boundVal),s=(0,l.default)(n/i.options.points.max,10);a.shadowColor="rgba(0, 0, 0, "+s+")",a.shadowOffsetX=o,a.shadowOffsetY=o,a.shadowBlur=i.options.shadowBlur,a.beginPath(),a.arc(e-o,t-o,i.options.radius,0,2*Math.PI,!0),a.closePath(),a.fill(),r||i.cachePoint(e,t,n)},colorize:function(){for(var e=this,t=e.options.width,n=e.options.height,r=e.options.ctx,i=r.getImageData(0,0,t,n),a=i.data,o=a.length,s=e.getPalette(),l=e.options.opacity,u=3;u<o;u+=4){var c=a[u],h=4*c;if(h){h=Math.floor(h);var f=l<c?l:c;f<.8&&(f=.8),a[u-3]=s[h],a[u-2]=s[h+1],a[u-1]=s[h+2],a[u]=f}}r.putImageData(i,0,0)},renderToMap:function(e){var t=this,n=t.options.canvas,r=new fm.Texture(n);this.setTexture(e,r)},disposeHeatMap:function(e){if(e){var t=this.map_.getFMGroup(e).getExtentMeshs()[0];if(t._hasHeatMap)if(t._hasHeatMap=!1,t.material.map&&t.material.map.dispose(),this.options.isHeatPlan)t.material.map=null,t.material.mapMixColor=!1,t.material.transparent=!0,t.material.needsUpdate=!0,this.map_.getFMGroup(e)._layers.model[0]._scene.getObjectByName("directionalLight").remove(this.map_.getFMGroup(e)._layers.model[0]._scene.getObjectByName("heatMap"));else{var n=this.map_.getFMGroup(e).getModelMeshs();this.map_.getFMGroup(e)._layers.model[0]._scene.traverse(function(e){"heatmap"==e.name&&e.parent.remove(e)}),n.forEach(function(e){if("MultiMaterial"==e.material.type)for(var t=e.material.materials.length,n=0,r=3;n<t;){var i=e.material.materials[n];i.map=null,i.mapMixColor=!1,i.transparent=!0,i.needsUpdate=!0,r=0==n?3:2,n+=r}else i=e.material,i.map=null,i.mapMixColor=!1,i.transparent=!0,i.needsUpdate=!0})}}},getPalette:function(){var e=document.createElement("canvas"),t=e.getContext("2d");e.width=1,e.height=256;var n=this,r=n.options.gradient,i=t.createLinearGradient(0,0,1,256);for(var a in r)i.addColorStop(a,r[a]);return t.fillStyle=i,t.fillRect(0,0,1,256),t.getImageData(0,0,1,256).data}},a.prototype.cachePoint=function(e,t,n){var r=this,i=r.options.points,a=i.data;n>i.max&&(i.max=n),a.push([e,t,n])},a.prototype.clearPoints=function(){this.options.points.data=[],this.clear()},a.prototype.addPoint=function(e,t,n){if(e&&t&&n){var r=this.getPixXY(e,t);if(r){var i=this;i.clear();for(var a=i.options.points.data,o=a.length,s=0;s<o;s++)i.renderShadow(a[s][0],a[s][1],a[s][2],!0);i.renderShadow(r.x,r.y,n,!1),i.colorize()}}},a.prototype.getTexture=function(e){this.clearPoints(),this.addPoints(e);var t=this.options.canvas.cloneNode();return t.getContext("2d").drawImage(this.options.canvas,0,0),new fm.CanvasTexture(t)},a.prototype.setTexture=function(e,l){var t=this.map_.getFMGroup(e).getExtentMeshs()[0];t._hasHeatMap&&this.disposeHeatMap(e);var n=t.material.color;if(this.options.isHeatPlan){t._hasHeatMap=!0,t.material.map=l,t.material.map.needsUpdate=!0,t.material.needsUpdate=!0;var r=t.clone();r.name="heatMap",r.material.transparent=!0,r.material.color=new fm.Color(16777215),r.material.depthTest=!1,r.renderOrder=12,r.material.needsUpdate=!0,r.scale.z=.001,this.options.heatHeight?r.position.y+=this.options.heatHeight:r.position.y+=4,t.material=new fm.MeshLambertMaterial({color:n}),this.map_.getFMGroup(e)._layers.model[0]._scene.getObjectByName("directionalLight").add(r)}else{t._hasHeatMap=!0,t.material.mapMixColor=!0,t.material.map=l,t.material.map.needsUpdate=!0,t.material.needsUpdate=!0;var i=this.map_.getFMGroup(e).getModelMeshs();this.map_.getFMGroup(e)._layers.model[0]._scene.traverse(function(e){if(e instanceof fm.Mesh)for(var t=0;t<e.children.length;t++)if(null!==e.children[t].material.map&&void 0!==e.children[t].material.map){var n=e.geometry,r=e.material;r.opacity=.8,r.needsUpdate=!0;var i=new fm.MeshLambertMaterial({map:l,transparent:!0,blending:fm.CustomBlending,blendEquation:fm.AddEquation,blendSrc:fm.SrcAlphaFactor,blendDst:fm.OneMinusSrcAlphaFactor});i.opacity=.9;var a=[r,i],o=new fm.Group;for(t=0;t<a.length;t++)o.add(new fm.Mesh(n,a[t]));var s=new fm.Mesh(n,i);s.name="heatmap",s.renderOrder=11,s.material.depthTest=!1,s.material.depthWrite=!1,e.add(s)}}),i.forEach(function(e){if("MultiMaterial"==e.material.type)for(var t=e.material.materials.length,n=0,r=3;n<t;)e.material.materials[n].map=l,e.material.mapMixColor=!0,e.material.materials[n]._color=e.material.materials[n].color.clone(),e.material.materials[n].color=new fm.Color(16777215),e.material.materials[n].map.needsUpdate=!0,e.material.materials[n].needsUpdate=!0,r=0==n?3:2,n+=r;else e.material.mapMixColor=!0,e.material.map=l,e.material._color=e.material.color.clone(),1===e.material.opacity&&(e.material.transparent=!1),e.material.map.needsUpdate=!0,e.material.needsUpdate=!0})}},a.prototype.setModelMeshTexture=function(e){if(e&&texture_)if("MultiMaterial"==e.material.type)for(var t=e.material.materials.length,n=0,r=3;n<t;)e.material.materials[n].map=texture_,e.material.materials[n]._color=e.material.materials[n].color.clone(),e.material.materials[n].color=new fm.Color(16777215),e.material.materials[n].transparent=!1,e.material.materials[n].map.needsUpdate=!0,e.material.materials[n].needsUpdate=!0,r=0==n?3:2,n+=r;else e.material.map=texture_,e.material._color=e.material.color.clone(),e.material.color=new fm.Color(16777215),e.material.transparent=!1,e.material.map.needsUpdate=!0,e.material.needsUpdate=!0},a.prototype.clear=function(){var e=this.options.ctx;e.clearRect(0,0,this.options.width,this.options.height)},a.prototype.addPoints=function(e){var t=this;t.clear();for(var n=t.options.points.data,r=n.length,i=0;i<r;i++)t.renderShadow(n[i][0],n[i][1],n[i][2],!0);for(var a=e.length,o=0;o<a;o++){var s=this.getPixXY(e[o].x,e[o].y);if(!s)return!0;t.renderShadow(s.x,s.y,e[o].value,!1)}t.colorize()},a.prototype.randomPoints=function(e){var t=this,n=t.options.width,r=t.options.height,i=t.options.points.max;t.clear();for(var a=0;a<e;a++){var o=Math.floor(Math.random()*n+1),s=Math.floor(Math.random()*r+1),l=Math.floor(Math.random()*i+1);t.renderShadow(o,s,l)}t.colorize()};var o=a;t.default=o},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(2)),o=r(n(3)),s=(r(n(240)),r(n(422))),l=r(n(423)),u=r(n(424)),c=r(n(426)),h=r(n(427)),f=function(){function n(e,t){(0,a.default)(this,n),this._data=t||e.getCurrDecodeData(),this._map=e,this.Graphics=fengmap.Graphics,this.DataManager=new fengmap.inner.DataManager,this.singleAttrQuery=new s.default(this._data,this._map),this.bufferQuery=new u.default(this._data),this.multiAttrQuery=new l.default(this._data,this._map),this.circleQuery=new c.default(this._data),this.polygonQuery=new h.default(this._data)}return(0,o.default)(n,[{key:"query",value:function(e,t){var n=null;return n=e.queryTypes?this.getQueryResult(e,e.queryTypes,this._map):e.circle?this.getQueryResult(e,["SINGLE","CIRCLE"],this._map):this.getQueryResult(e,["SINGLE"],this._map),t(n),n}},{key:"getQueryResult",value:function(e,t,n){for(var r=[],i=null,a=0;a<t.length;a++)switch(t[a]){case"SINGLE":r.push(this.singleAttrQuery.query(e));break;case"MULTI":r.push(this.multiAttrQuery.query(e));break;case"BUFFER":r.push(this.bufferQuery.query(e,n));break;case"CIRCLE":i=this.circleQuery.query(r,e,n),r=[],r.push(i);break;case"POLYGON":i=this.polygonQuery.query(r,e,n),r=[],r.push(i);break;default:r.push(this.singleAttrQuery.query(e))}var o=this.duplicateCheck(r);return o}},{key:"duplicateCheck",value:function(e){return e[0]}}]),n}(),d=f;t.default=d},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var s=r(n(18)),l=r(n(13)),u=r(n(17)),c=r(n(16)),a=r(n(15));n(5),n(4);var o=r(n(6));n(10);var p=r(n(25));n(21);var h=r(n(47)),f=r(n(2)),d=r(n(3)),m=r(n(7)),v=r(n(8)),g=r(n(9)),y=r(n(241));function _(e){if(void 0===c.default||null==e[u.default]){if((0,l.default)(e)||(e=x(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i,a=!0,o=!1;return{s:function(){r=(0,s.default)(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){o=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(o)throw i}}}}function x(e,t){if(e){if("string"==typeof e)return w(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?(0,a.default)(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?w(e,t):void 0}}function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function b(r){return function(){var e,t=(0,v.default)(r);if(M()){var n=(0,v.default)(this).constructor;e=(0,o.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,m.default)(this,e)}}function M(){if("undefined"==typeof Reflect||!o.default)return!1;if(o.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,o.default)(Date,[],function(){})),!0}catch(e){return!1}}var S=function(e){(0,g.default)(i,e);var r=b(i);function i(e,t){var n;return(0,f.default)(this,i),n=r.call(this,e),n._map=t,n}return(0,d.default)(i,[{key:"query",value:function(e){var t=[],n=e.groupID;n&&"number"==typeof n&&(n=[n]);var r,i=_(this._data.floors);try{for(i.s();!(r=i.n()).done;){var a=r.value;(!n||-1<n.indexOf(a.gid))&&t.push.apply(t,(0,h.default)(this.queryGroup(a,e)))}}catch(e){i.e(e)}finally{i.f()}return t}},{key:"queryGroup",value:function(u,c){var h=this,f=this._data.scene.file_ver,e=c.nodeType?c.nodeType:fengmap.FMNodeType.ALL;"all"==e&&(e=fengmap.FMNodeType.ALL);var d=[];return e!==fengmap.FMNodeType.EXTERNAL_MODEL&&e!==fengmap.FMNodeType.ALL||this.everyExternalModel(u,function(e,t,n,r){var i=null,a=.1,o=.1;o=1===f?(i=r.geo.substring(6,r.geo.length-1).split(" "),a=(0,p.default)(i[0]),(0,p.default)(i[1])):(i=r.pts,a=i[0],i[1]);var s=t.height,l={};u.gid,h.check(e,t,c,n,r.geo,u.gid,l)&&d.push({ID:e.eid,name:e.name,ename:e.ename,groupID:u.gid,FID:e.fid,typeID:e.type,nodeType:fengmap.FMNodeType.MODEL,gdata:t,target:l.target?l.target:h._map.getFMGroup(u.gid).getNodeByLayerId("externalModel",e.eid),mapCoord:{x:a,y:o,z:s}})}),e!==fengmap.FMNodeType.MODEL&&e!==fengmap.FMNodeType.ALL||this.everyModel(u,function(e,t,n,r){var i=null,a=0,o=0;o=1===f?(i=r.geo.substring(6,r.geo.length-1).split(" "),a=(0,p.default)(i[0]),(0,p.default)(i[1])):(i=r.pts,a=i[0],i[1]);var s=t.height,l={};h.check(e,t,c,n,r.geo,u.gid,l)&&d.push({ID:e.eid,name:e.name,ename:e.ename,groupID:u.gid,FID:e.fid,typeID:e.type,nodeType:fengmap.FMNodeType.MODEL,gdata:t,target:l.target?l.target:h._map.getFMGroup(u.gid).getNodeByLayerId("model",e.eid),mapCoord:{x:a,y:o,z:s}})}),e!==fengmap.FMNodeType.FACILITY&&e!==fengmap.FMNodeType.ALL||this.everyFacility(u,function(e,t,n){var r=null,i=0,a=0;a=1===f?(r=t.geo.substring(6,t.geo.length-1).split(" "),i=(0,p.default)(r[0]),(0,p.default)(r[1])):(r=t.pts,i=r[0],r[1]);var o=t.height;h.check(e,t,c,n,null,u.gid)&&d.push({ID:e.eid,name:e.name,ename:e.ename,groupID:u.gid,FID:e.fid,typeID:e.type,nodeType:fengmap.FMNodeType.FACILITY,gdata:t,target:h._map.getFMGroup(u.gid).getNodeByLayerId("facility",e.eid),mapCoord:{x:i,y:a,z:o}})}),e!==fengmap.FMNodeType.LABEL&&e!==fengmap.FMNodeType.ALL||this.everyLabel(u,function(e,t,n){var r=null,i=0,a=0;a=1===f?(r=t.geo.substring(6,t.geo.length-1).split(" "),i=(0,p.default)(r[0]),(0,p.default)(r[1])):(r=t.pts,i=r[0],r[1]);var o=t.height;h.check(e,t,c,n,null,u.gid)&&d.push({ID:e.eid,name:e.name,ename:e.ename,groupID:u.gid,FID:e.fid,typeID:e.type,nodeType:fengmap.FMNodeType.LABEL,gdata:t,target:h._map.getFMGroup(u.gid).getNodeByLayerId("label",e.eid),mapCoord:{x:i,y:a,z:o}})}),d}}]),i}(y.default),E=S;t.default=E},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var s=r(n(18)),l=r(n(13)),u=r(n(17)),c=r(n(16)),a=r(n(15));n(5),n(4);var o=r(n(6));n(56),n(10);var p=r(n(25));n(21);var h=r(n(47)),f=r(n(2)),d=r(n(3)),m=r(n(7)),v=r(n(8)),g=r(n(9)),y=r(n(241));function _(e){if(void 0===c.default||null==e[u.default]){if((0,l.default)(e)||(e=x(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i,a=!0,o=!1;return{s:function(){r=(0,s.default)(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){o=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(o)throw i}}}}function x(e,t){if(e){if("string"==typeof e)return w(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?(0,a.default)(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?w(e,t):void 0}}function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function b(r){return function(){var e,t=(0,v.default)(r);if(M()){var n=(0,v.default)(this).constructor;e=(0,o.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,m.default)(this,e)}}function M(){if("undefined"==typeof Reflect||!o.default)return!1;if(o.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,o.default)(Date,[],function(){})),!0}catch(e){return!1}}var S=function(e){(0,g.default)(i,e);var r=b(i);function i(e,t){var n;return(0,f.default)(this,i),n=r.call(this,e),n._map=t,n}return(0,d.default)(i,[{key:"query",value:function(e){if(e.pathPoints){var t=this.distanceSorting(e.groupID,e.pathPoints,e.startPoint,e.bufferRadius);return t}var n=[],r=e.groupID;r&&"number"==typeof r&&(r=[r]),this._data;var i,a=_(this._data.floors);try{for(a.s();!(i=a.n()).done;){var o=i.value;(!r||-1<r.indexOf(o.gid))&&n.push.apply(n,(0,h.default)(this.queryGroup(o,e)))}}catch(e){a.e(e)}finally{a.f()}return n}},{key:"queryGroup",value:function(u,c){var h=this,f=this._data.scene.file_ver,e=c.nodeType?c.nodeType:fengmap.FMNodeType.ALL;"all"==e&&(e=fengmap.FMNodeType.ALL);var d=[];return e!==fengmap.FMNodeType.EXTERNAL_MODEL&&e!==fengmap.FMNodeType.ALL||this.everyExternalModel(u,function(e,t,n,r){var i=null,a=.1,o=.1;o=1===f?(i=r.geo.substring(6,r.geo.length-1).split(" "),a=(0,p.default)(i[0]),(0,p.default)(i[1])):(i=r.pts,a=i[0],i[1]);var s=t.height,l={};h.check(e,t,c,n,r.geo,u.gid,l)&&d.push({ID:e.eid,name:e.name,ename:e.ename,groupID:u.gid,FID:e.fid,typeID:e.type,nodeType:fengmap.FMNodeType.MODEL,distance:"number"==typeof l.distance?l.distance:null,target:l.target?l.target:h._map.getFMGroup(u.gid).getNodeByLayerId("externalModel",e.eid),mapCoord:{x:a,y:o,z:s}})}),e!==fengmap.FMNodeType.MODEL&&e!==fengmap.FMNodeType.ALL||this.everyModel(u,function(e,t,n,r){var i=null,a=0,o=0;o=1===f?(i=r.geo.substring(6,r.geo.length-1).split(" "),a=(0,p.default)(i[0]),(0,p.default)(i[1])):(i=r.pts,a=i[0],i[1]);var s=t.height,l={};h.check(e,t,c,n,r.geo,u.gid,l)&&d.push({ID:e.eid,name:e.name,ename:e.ename,groupID:u.gid,FID:e.fid,typeID:e.type,nodeType:fengmap.FMNodeType.MODEL,distance:"number"==typeof l.distance?l.distance:null,target:l.target?l.target:h._map.getFMGroup(u.gid).getNodeByLayerId("model",e.eid),mapCoord:{x:a,y:o,z:s}})}),e!==fengmap.FMNodeType.FACILITY&&e!==fengmap.FMNodeType.ALL||this.everyFacility(u,function(e,t,n){var r=null,i=0,a=0;a=1===f?(r=t.geo.substring(6,t.geo.length-1).split(" "),i=(0,p.default)(r[0]),(0,p.default)(r[1])):(r=t.pts,i=r[0],r[1]);var o=t.height,s={};h.check(e,t,c,n,null,u.gid,s)&&d.push({ID:e.eid,name:e.name,ename:e.ename,groupID:u.gid,FID:e.fid,typeID:e.type,nodeType:fengmap.FMNodeType.FACILITY,distance:"number"==typeof s.distance?s.distance:null,target:h._map.getFMGroup(u.gid).getNodeByLayerId("facility",e.eid),mapCoord:{x:i,y:a,z:o}})}),e!==fengmap.FMNodeType.LABEL&&e!==fengmap.FMNodeType.ALL||this.everyLabel(u,function(e,t,n){var r=null,i=0,a=0;a=1===f?(r=t.geo.substring(6,t.geo.length-1).split(" "),i=(0,p.default)(r[0]),(0,p.default)(r[1])):(r=t.pts,i=r[0],r[1]);var o=t.height,s={};h.check(e,t,c,n,null,u.gid,s)&&d.push({ID:e.eid,name:e.name,ename:e.ename,groupID:u.gid,FID:e.fid,typeID:e.type,nodeType:fengmap.FMNodeType.LABEL,distance:"number"==typeof s.distance?s.distance:null,target:h._map.getFMGroup(u.gid).getNodeByLayerId("label",e.eid),mapCoord:{x:i,y:a,z:o}})}),(c.circle||c.polygon)&&d.sort(function(e,t){return"number"==typeof e.distance&&"number"==typeof t.distance?e.distance-t.distance:0}),d}}]),i}(y.default),E=S;t.default=E},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0,n(5),n(4);var a=r(n(6)),o=r(n(2)),s=r(n(3)),l=r(n(7)),u=r(n(8)),c=r(n(9)),h=r(n(425));function f(r){return function(){var e,t=(0,u.default)(r);if(d()){var n=(0,u.default)(this).constructor;e=(0,a.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,l.default)(this,e)}}function d(){if("undefined"==typeof Reflect||!a.default)return!1;if(a.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,a.default)(Date,[],function(){})),!0}catch(e){return!1}}var p=function(e){(0,c.default)(r,e);var n=f(r);function r(e){var t;return(0,o.default)(this,r),t=n.call(this,e),t._map=null,t}return(0,s.default)(r,[{key:"query",value:function(e,t){this._map=t;var n=this.distanceSorting(e.groupID,e.pathPoints,e.startPoint,e.bufferRadius);return n}},{key:"_calcBuffer",value:function(e,t){for(var n=0;n<e.length;n++){var r=[];r.push(e[n].x),r.push(e[n].y),e.splice(n,1,r)}var i=geotool.straightenPoints(e),a=geotool.polylineSegBuffers(i,t);return a}},{key:"_BMIntersect",value:function(e,t,n){for(var r=0;r<n.length;r++){var i=[];i.push(n[r].x+e.x),i.push(n[r].y+e.y),n.splice(r,1,i)}var a=geotool.isSegBuffersIntersecots(t,n);return a}},{key:"_BFIntersect",value:function(e,t,n){var r=[n.x+e.x,n.y+e.y],i=geotool.isSegBuffersIntersecots(t,r);return i}},{key:"distanceSorting",value:function(e,t,n,r){var i=map.getFMGroup(e).mapCoord,a=[],o=[],s=[],l=[],u=[],c=[],h=this._map.nodeManager.getGroupAllModel(this._map._currentSceneId,e),f=this._map.nodeManager.getGroupAllFacility(this._map._currentSceneId,e),d=this._calcBuffer(t,r);for(var p in h){var m=h[p]._renderNode.children[0].geometry.vertices.concat(),v=this._BMIntersect(i,d,m);if(v){s.push(h[p]);var g={model:m,fid:h[p].FID,target:s[s.length-1]};a.push(g)}}for(var y in f){var _=f[y]._renderNode.position.clone(),x=this._BFIntersect(i,d,_);if(x){l.push(h[y]);var w={facility:_,fid:f[y].FID,target:l[l.length-1]};o.push(w)}}for(var b=0;b<a.length;b++){var M=a[b].model,S=geotool.distPointToPolygon([n.x,n.y],M),E={distance:S,fid:a[b].fid,target:s[b]};u.push(E)}for(var T=0;T<o.length;T++){var A=o[T].facility,L=Math.sqrt(Math.pow(n.x-A.x,2)+Math.pow(n.y-A.y,2)),R={distance:L,fid:o[T].fid,target:l[T]};c.push(R)}return this._quickSort(u,0,u.length-1),this._quickSort(c,0,c.length-1),a=null,o=null,s=null,l=null,{model:u,facility:c}}},{key:"_quickSort",value:function(e,t,n){for(var r=[[t,n]];0<r.length;){var i=r.pop();if(!(i[0]>=i[1])){for(var a=i[0],o=i[1],s=i[0];a<o;){for(;e[o].distance>=e[s].distance&&s<o;)o--;if(o<=a)break;for(;e[a].distance<=e[s].distance&&a<o;)a++;var l=e[s];e[s]=e[o],e[o]=e[a],e[a]=l,s=a}r.push([i[0],s-1]),r.push([s+1,i[1]])}}}}]),r}(h.default),m=p;t.default=m},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0,n(5),n(4);var a=r(n(6)),o=r(n(2)),s=r(n(7)),l=r(n(8)),u=r(n(9)),c=r(n(242));function h(r){return function(){var e,t=(0,l.default)(r);if(f()){var n=(0,l.default)(this).constructor;e=(0,a.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,s.default)(this,e)}}function f(){if("undefined"==typeof Reflect||!a.default)return!1;if(a.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,a.default)(Date,[],function(){})),!0}catch(e){return!1}}var d=function(e){(0,u.default)(n,e);var t=h(n);function n(e){return(0,o.default)(this,n),t.call(this,e)}return n}(c.default),p=d;t.default=p},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0,n(5),n(4);var a=r(n(6)),x=r(n(25));n(21);var o=r(n(2)),s=r(n(3)),l=r(n(7)),u=r(n(8)),c=r(n(9)),h=r(n(243));function f(r){return function(){var e,t=(0,u.default)(r);if(d()){var n=(0,u.default)(this).constructor;e=(0,a.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,l.default)(this,e)}}function d(){if("undefined"==typeof Reflect||!a.default)return!1;if(a.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,a.default)(Date,[],function(){})),!0}catch(e){return!1}}var p=function(e){(0,c.default)(n,e);var t=f(n);function n(e){return(0,o.default)(this,n),t.call(this,e)}return(0,s.default)(n,[{key:"query",value:function(e,t,n){var r=t.circle,i=[],a=this._data.scene.file_ver;e:for(var o=0;o<e[0].length;o++){var s=e[0][o].gdata;e[0][o].nodeType;var l=null,u=0,c=0;if(1===a){var h=s.geo;l=h.substring(6,h.length-1).split(" "),u=(0,x.default)(l[0]),c=(0,x.default)(l[1])}else l=s.pts,u=l[0],c=l[1];var f=r.center,d=Math.sqrt((u-f.x)*(u-f.x)+(c-f.y)*(c-f.y));if(d<r.radius)e[0][o].distance=d,i.push(e[0][o]);else if(5===e[0][o].nodeType){var p=0,m=null,v=n.getFMGroup(e[0][o].groupID).getNodeByLayerId("model",e[0][o].ID);v&&v._data&&(m=v._data.vertices),null==m&&(m=DataManager.convertGeo2Geometry(s.geo).vertices);for(var g=m.length/2,y=0;y<g-1;y++){var _=2*y;if(p=this.Graphics.pointDistanceToLine(f,{x:m[_],y:m[_+1]},{x:m[_+2],y:m[_+3]},{}),p<r.radius){e[0][o].distance=d,i.push(e[0][o]);continue e}}if(this.Graphics.pointInPolygonVector2d(m,f,m.length)){e[0][o].distance=d,i.push(e[0][o]);continue}}}return i}}]),n}(h.default),m=p;t.default=m},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0,n(5),n(4);var a=r(n(6)),d=r(n(25));n(21);var o=r(n(2)),s=r(n(3)),l=r(n(7)),u=r(n(8)),c=r(n(9)),p=r(n(428)),h=r(n(243));function f(r){return function(){var e,t=(0,u.default)(r);if(m()){var n=(0,u.default)(this).constructor;e=(0,a.default)(t,arguments,n)}else e=t.apply(this,arguments);return(0,l.default)(this,e)}}function m(){if("undefined"==typeof Reflect||!a.default)return!1;if(a.default.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call((0,a.default)(Date,[],function(){})),!0}catch(e){return!1}}var v=function(e){(0,c.default)(n,e);var t=f(n);function n(e){return(0,o.default)(this,n),t.call(this,e)}return(0,s.default)(n,[{key:"query",value:function(e,t,n){for(var r=this._data.scene.file_ver,i=2<t.polygon.length?new p.default(t.polygon,!0):null,a=[],o=0;o<e[0].length;o++){var s=e[0][o].gdata;e[0][o].nodeType;var l=null,u=null;if(1===r){var c=s.geo;l=c.substring(6,c.length-1).split(" "),u={x:(0,d.default)(l[0]),y:(0,d.default)(l[1])}}else l=s.pts,u={x:(0,d.default)(l[0]),y:(0,d.default)(l[1])};if(i.contain(u))e[0][o].distance=i.distanceToPoint(u),a.push(e[0][o]);else if(5===e[0][o].nodeType){var h=null,f=n.getFMGroup(e[0][o].groupID).getNodeByLayerId("model",e[0][o].ID);if(f&&f._data&&(h=f._data.vertices),null==h&&(h=DataManager.convertGeo2Geometry(s.geo).vertices),i.containXYArray(h)){e[0][o].distance=i.distanceToPoint(u),a.push(e[0][o]);continue}}}return a}}]),n}(h.default),g=v;t.default=g},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(2)),o=r(n(3)),s=r(n(429)),l=function(){function u(e){(0,a.default)(this,u),this._points=e,this._bb=new s.default(e);var t=e.length;e[0].x==e[t-1].x&&e[0].y==e[t-1].y&&t--,this._count=t,this._center=fengmap.inner.Graphics.calcCenterOfGravityPoint(e,this._count)}return(0,o.default)(u,[{key:"contain",value:function(e){return!!this._bb.contain(e)&&fengmap.inner.Graphics.pointInPolygon2d(this._points,e,this._count)}},{key:"containXYArray",value:function(e){for(var t=e.length/2,n=[],r=!1,i=0;i<t;i++){var a=2*i,o={x:e[a],y:e[a+1]};if(this.contain(o)){r=!0;break}n.push(o)}if(r)return!0;var s=new u(n);if(fengmap.inner.Graphics.isRectCross(this._bb._min,this._bb._max,s._bb._min,s._bb._max))for(var l=0;l<this._count;l++)if(s.contain(this._points[l])){r=!0;break}return!!r}},{key:"distanceToPoint",value:function(e){return fengmap.inner.Graphics.distanceOfTwoPoints(this._center,e)}}]),u}(),u=l;t.default=u},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0,n(85);var a=r(n(2)),o=r(n(3)),s=function(){function r(e){if((0,a.default)(this,r),this._min={x:Number.MAX_VALUE,y:Number.MAX_VALUE},this._max={x:-Number.MAX_VALUE,y:-Number.MAX_VALUE},e)for(var t=e.length,n=0;n<t;n++)this.expandBy(e[n])}return(0,o.default)(r,[{key:"expandBy",value:function(e){e.x<this._min.x&&(this._min.x=e.x),e.y<this._min.y&&(this._min.y=e.y),e.x>this._max.x&&(this._max.x=e.x),e.y>this._max.y&&(this._max.y=e.y)}},{key:"contain",value:function(e){return!(e.x<this._min.x||e.x>this._max.x||e.y<this._min.y||e.y>this._max.y)}}]),r}(),l=s;t.default=l},function(e,t,n){"use strict";var r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var i={MODULE_SHORTEST:1,MODULE_BEST:2},a=i;t.default=a},function(e,t,n){"use strict";var r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var i={Left:0,Center:1,Right:2},a=i;t.default=a},function(e,t,n){"use strict";var r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var i={PRIORITY_DEFAULT:1,PRIORITY_LIFTFIRST:2,PRIORITY_ESCALATORFIRST:3,PRIORITY_STAIRFIRST:4,PRIORITY_LIFTONLY:5,PRIORITY_ESCALATORONLY:6,PRIORITY_STAIRONLY:7,PRIORITY_ACCESSIBLEONLY:8,PRIORITY_LIFTFIRST1:9,PRIORITY_ESCALATORFIRST1:10,PRIORITY_STAIRFIRST1:11},a=i;t.default=a},function(e,t,n){"use strict";var r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var i={MODE_2D:"top",MODE_3D:"3d"},a=i;t.default=a},function(e,t,n){"use strict";var r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var i={ROUTE_SUCCESS:1,ROUTE_FAILED_NO_FMDBDATA:2,ROUTE_FAILED_TOO_CLOSE:3,ROUTE_FAILED_NO_DATA_START:4,ROUTE_FAILED_NO_DATA_END:5,ROUTE_FAILED_NO_STAIR:6,ROUTE_FAILED_NOTSUPPORT:7,ROUTE_FAILED_CANNOT_CALCULATE:8,ROUTE_FAILED_CANNOT_ARRIVE:9,ROUTE_FAILED_WAYPOINT_CALCULATE_ERROR:10,ROUTE_FAILED_NO_STAIR_ARRIVAL:11,ROUTE_FAILED_NO_END_ARRIVAL:12,ROUTE_FAILED_OUTLINE:13,ROUTE_FAILED_NO_DOOR_START:14,ROUTE_FAILED_NO_DOOR_END:15},a=i;t.default=a},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(2)),o=r(n(3)),s=function(){function e(){(0,a.default)(this,e),this.x=void 0,this.y=void 0,this.z=void 0,this.gid=void 0}return(0,o.default)(e,[{key:"setGeoPoint",value:function(e){this.x=e.x,this.y=e.y}}]),e}(),l=s;t.default=l},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(2)),o=function e(t,n){(0,a.default)(this,e),this.x=void 0===t?0:t,this.y=void 0===n?0:n},s=o;t.default=s},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(2)),o=r(n(3)),s=function(){function r(e,t,n){(0,a.default)(this,r),this._locOrigion=null,this._locRange=null,this._mapOrigion=null,this._mapAxisX=null,this._mapAxisY=null,this._mapRange=null,e&&t&&n&&this.init(e,t,n)}return(0,o.default)(r,[{key:"init",value:function(e,t,n){if(4!=n.length)return!1;this._locOrigion=e,this._locRange=t,this._mapOrigion=n[0],this._mapAxisX={x:n[1].x-n[0].x,y:n[1].y-n[0].y},this._mapAxisY={x:n[3].x-n[0].x,y:n[3].y-n[0].y},this._mapRange={x:this._getVectorLen(this._mapAxisX),y:this._getVectorLen(this._mapAxisY)},this._mapAxisX.x/=this._mapRange.x,this._mapAxisX.y/=this._mapRange.x,this._mapAxisY.x/=this._mapRange.y,this._mapAxisY.y/=this._mapRange.y}},{key:"transform",value:function(e){var t={x:(e.x-this._locOrigion.x)/this._locRange.x,y:(e.y-this._locOrigion.y)/this._locRange.y},n={x:t.x*this._mapRange.x,y:t.y*this._mapRange.y},r={x:this._mapOrigion.x+this._mapAxisX.x*n.x+this._mapAxisY.x*n.y,y:this._mapOrigion.y+this._mapAxisX.y*n.x+this._mapAxisY.y*n.y};return r}},{key:"_getVectorLen",value:function(e){return Math.sqrt(e.x*e.x+e.y*e.y)}}]),r}(),l=s;t.default=l},function(e,t,n){"use strict";var r=n(0);r(t,"__esModule",{value:!0}),t.default=void 0;var i={NaviNodeType_NULL:-1,NaviNodeType_COMMON:0,NaviNodeType_SIDE:1,NaviNodeType_FLOOR:2,NaviNodeType_EXTENT:3,NaviLiftType_NULL:0,NaviLiftType_Lift:1,NaviLiftType_Stair:2,NaviLiftType_Escalator:3,NaviLiftType_Accessible:4,NaviLiftEntry_BOTH:0,NaviLiftEntry_UP:1,NaviLiftEntry_DOWN:2,NaviLiftEntry_FORBID:3,NaviEntranceType_NULL:0,NaviEntranceType_EXIT:1,NaviEntranceType_ENTRANCE:2,NaviEntranceType_ACCESS:3,NaviRoadRank_MAIN:1,NaviRoadRank_MINOR:2,NaviRoadRank_NARROW:3,NaviRoadEntry_BOTH:0,NaviRoadEntry_FORWARD:1,NaviRoadEntry_BACK:2,NaviRoadEntry_FORBID:3,NaviRoadPass_NULL:-1,NaviRoadPass_NOT_THROUGH:0,NaviRoadPass_THROUGH:1,NaviZoneType_NULL:-1,NaviZoneType_PASS_UNRESTRAINT:0,NaviZoneType_PASS_THROUGH:1,NaviZoneType_PASS_NOT_THROUGH:2,NaviZoneType_NO_ENTRY:3,NaviZoneType_CORRIDOR:4,NaviModelPassType_PASS_THROUGH:0,NaviModelPassType_PASS_NOT_THROUGH:1,NaviModelPassType_NOT_PASS:2,NaviModelPassType_DECORATE:3,NaviRoadHinderType_HINDER_GENERAL:0,NaviRoadHinderType_HINDER_HIGH:1,NaviObstructType_MODEL:0,NaviObstructType_EXTENT:1};t.default=i},function(e,t,n){"use strict";var r=n(1),i=n(0);i(t,"__esModule",{value:!0}),t.default=void 0,n(85);var a=r(n(2)),o=r(n(3)),s=function(){function e(){(0,a.default)(this,e),this.minX=Number.MAX_VALUE,this.minY=Number.MAX_VALUE,this.maxX=-Number.MAX_VALUE,this.maxY=-Number.MAX_VALUE}return(0,o.default)(e,[{key:"init",value:function(){this.minX=Number.MAX_VALUE,this.minY=Number.MAX_VALUE,this.maxX=-Number.MAX_VALUE,this.maxY=-Number.MAX_VALUE}},{key:"expandBy",value:function(e){e&&e.x&&e.y&&(this.minX>e.x&&(this.minX=e.x),this.maxX<e.x&&(this.maxX=e.x),this.minY>e.y&&(this.minY=e.y),this.maxY<e.y&&(this.maxY=e.y))}},{key:"isSeparate",value:function(e){return this.minX>e.maxX||this.minY>e.maxY||this.maxX<e.minX||this.maxY<e.minY}}]),e}(),l=s;t.default=l},function(e,t,n){"use strict";var r=n(1);n(110);var p=r(n(25)),i=r(n(87));function m(e,t,n,r,i,a){var o=(e+n)/2,s=(t+r)/2,l=((e-n)*(e-n)+(t-r)*(t-r))/4,u=Math.sqrt(l),c=Math.sqrt(i*i-l),h=u/c,f=u*h,d=Math.PI/2,p=1,m=(n-e)/(t-r),v=-1,g=(e-n)/(t-r),y=Math.sqrt(p*p+m*m),_=Math.sqrt(v*v+g*g),x=p/y,w=m/y,b=v/_,M=g/_,S={x:o+f*x,y:s+f*w,theta:d},E={x:o+f*b,y:s+f*M,theta:d};return 0<(n-e)*(S.y-t)-(r-t)*(S.x-e)?0===a?S:E:0===a?E:S}function s(e,t,n,r){for(var i=0;i<e.length;i++)switch(e[i]){case"m":t.moveTo(r.x+(0,p.default)(e[i+1]),r.y+(0,p.default)(e[i+2])),n.x=r.x+(0,p.default)(e[i+1]),n.y=r.y+(0,p.default)(e[i+2]),r.x=n.x,r.y=n.y,i+=2;break;case"M":t.moveTo((0,p.default)(e[i+1]),(0,p.default)(e[i+2])),n.x=(0,p.default)(e[i+1]),n.y=(0,p.default)(e[i+2]),r.x=n.x,r.y=n.y,i+=2;break;case"l":t.lineTo(n.x+(0,p.default)(e[i+1]),n.y+(0,p.default)(e[i+2])),n.x=n.x+(0,p.default)(e[i+1]),n.y=n.y+(0,p.default)(e[i+2]),i+=2;break;case"L":t.lineTo((0,p.default)(e[i+1]),(0,p.default)(e[i+2])),n.x=(0,p.default)(e[i+1]),n.y=(0,p.default)(e[i+2]),i+=2;break;case"A":var a=(0,p.default)(e[i+1]),o=(0,p.default)(e[i+2]),s=((0,p.default)(e[i+3]),Math.PI,(0,p.default)(e[i+4]),(0,p.default)(e[i+5])),l=n.x,u=n.y,c=(0,p.default)(e[i+6]),h=(0,p.default)(e[i+7]);if(a===o){var f=m(l,u,c,h,a,s);t.arcTo(f.x,f.y,c,h,f.theta),n.x=c,n.y=h}i+=7;break;case"a":if(a=(0,p.default)(e[i+1]),o=(0,p.default)(e[i+2]),(0,p.default)(e[i+3]),Math.PI,(0,p.default)(e[i+4]),s=(0,p.default)(e[i+5]),l=n.x,u=n.y,c=l+(0,p.default)(e[i+6]),h=u+(0,p.default)(e[i+7]),a===o){var d=m(l,u,c,h,a,s);t.arcTo(d.x,d.y,c,h,d.theta),n.x=c,n.y=h}i+=7;break;case"h":t.lineTo(n.x+(0,p.default)(e[i+1]),n.y),n.x=n.x+(0,p.default)(e[i+1]),i+=1;break;case"H":t.lineTo((0,p.default)(e[i+1]),n.y),n.x=(0,p.default)(e[i+1]),i+=1;break;case"z":case"Z":t.lineTo(r.x,r.y)}}var l=["M","0","15.07","L","0.69","1.92","A","2","2","0","0","1","2.66","0","L","11.8","0","l","-0.07","1.37","H","3.09","A","1.09","1.09","0","0","0","2","2.44","l","-0.2","4.44","h","9.37","l","-0.07","1.37","H","1.72","l","-0.36","6.82","Z"],u=["M","13.79","11","l","-0.08","1.63","a","1","1","0","0","0","1","1.08","h","8.53","l","-0.07","1.36","h","-9","A","1.84","1.84","0","0","1","12.31","13","l","0.48","-9.16","h","8.9","a","2","2","0","0","1","2","2","L","23.53","9","A","2.11","2.11","0","0","1","21.47","11","Z","m","8.4","-2.49","l","0.08","-2.16","a","1.07","1.07","0","0","0","-1.09","-1.09","H","14.09","l","-0.22","4.33","H","21","A","1.15","1.15","0","0","0","22.19","8.51","Z"],c=["M","33.94","3.86","a","1.93","1.93","0","0","1","2","1.95","l","-0.47","9.27","H","34.07","l","0.45","-8.72","a","1.09","1.09","0","0","0","-1.09","-1.1","H","26.3","l","-0.51","9.82","H","24.41","L","25","3.85","Z"],h=["M","36.48","17.72","H","45","a","1.16","1.16","0","0","0","1.16","-1.22","l","0.07","-1.43","H","38.72","a","2","2","0","0","1","-2","-2.06","l","0.37","-7.19","a","2","2","0","0","1","2.15","-2","H","48.2","l","-0.69","13.28","a","2.09","2.09","0","0","1","-2.06","2","h","-9","Z","m","9.85","-4.05","l","0.44","-8.45","H","39.53","a","1.07","1.07","0","0","0","-1.08","1.1","l","-0.32","6.27","a","1.16","1.16","0","0","0","1.1","1.1","Z"],f=["M","57.43","11.59","L","63.48","0","h","1.83","l","-0.79","15.05","H","63.15","l","0.67","-12.79","L","57.67","14","h","-0.75","L","52.07","2.34","l","-0.64","12.72","H","50","L","50.83","0","H","52.6","Z"],d=["M","69.6","10.2","l","-2.37","4.87","h","-1.5","L","73.09","0","h","1.49","l","5.77","15.05","h","-1.5","L","77","10.2","Z","m","6.86","-1.39","L","73.74","1.73","L","70.28","8.81","Z"],v=["M","82.95","15.07","H","81.57","L","82.35","0","h","10","a","1.94","1.94","0","0","1","1.85","2","L","93.89","7.4","a","2","2","0","0","1","-2","1.92","H","83.25","Z","m","8.43","-7.15","a","1.13","1.13","0","0","0","1.09","-1.09","l","0.35","-4.37","a","1.1","1.1","0","0","0","-1.08","-1.06","H","83.66","l","-0.34","6.53","Z"];function a(){var e=document.createElement("canvas"),t=e.getContext("2d");e.width=500,e.height=120,e.style.width="500px",e.style.height="120px";var n={x:0,y:0},r={x:0,y:0};t.transform(5,0,0,5,10,10);var i=t.createLinearGradient(5.9,15.07,5.9,0);i.addColorStop(0,"#232323"),i.addColorStop(1,"#585858"),t.fillStyle=i,t.beginPath(),s(l,t,r,n),t.closePath(),t.fill(),t.beginPath(),s(u,t,r,n),t.closePath(),t.fill(),t.beginPath(),s(c,t,r,n),t.closePath(),t.fill(),t.beginPath(),s(h,t,r,n),t.closePath(),t.fill();var a=t.createLinearGradient(57.68,15.07,57.68,0);a.addColorStop(0,"#77bf00"),a.addColorStop(1,"#addc0c"),t.fillStyle=a,t.beginPath(),s(f,t,r,n),t.closePath(),t.fill(),t.beginPath(),s(d,t,r,n),t.closePath(),t.fill(),t.beginPath(),s(v,t,r,n),t.closePath(),t.fill();var o=new fm.CanvasTexture(e);return o}i.default.f=l,i.default.e=u,i.default.n=c,i.default.g=h,i.default.m=f,i.default.a=d,i.default.p=v,i.default.d=a}],r={},i.m=n,i.c=r,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)i.d(n,r,function(e){return t[e]}.bind(null,r));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=244).default;function i(e){if(r[e])return r[e].exports;var t=r[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,i),t.l=!0,t.exports}var n,r});