fengmap.map.min.js
1.1 MB
/**Released Version v3.1.2,BUILD 9,Time 1681293328552. Fengmap Javascript SDK , see: https://www.fengmap.com for details**/
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.fengmap=n():t.fengmap=n()}(this,function(){return d=[function(t,n,e){"use strict";var i,r,o=t.exports=e(2),s=e(16);o.codegen=e(40),o.fetch=e(41),o.path=e(42),o.fs=o.inquire("fs"),o.toArray=function(t){if(t){for(var n=Object.keys(t),e=new Array(n.length),i=0;i<n.length;)e[i]=t[n[i++]];return e}return[]},o.toObject=function(t){for(var n={},e=0;e<t.length;){var i=t[e++],r=t[e++];void 0!==r&&(n[i]=r)}return n};var a=/\\/g,u=/"/g;o.isReserved=function(t){return/^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(t)},o.safeProp=function(t){return!/^[$\w_]+$/.test(t)||o.isReserved(t)?'["'+t.replace(a,"\\\\").replace(u,'\\"')+'"]':"."+t},o.ucFirst=function(t){return t.charAt(0).toUpperCase()+t.substring(1)};var h=/_([a-z])/g;o.camelCase=function(t){return t.substring(0,1)+t.substring(1).replace(h,function(t,n){return n.toUpperCase()})},o.compareFieldsById=function(t,n){return t.id-n.id},o.decorateType=function(t,n){if(t.$type)return n&&t.$type.name!==n&&(o.decorateRoot.remove(t.$type),t.$type.name=n,o.decorateRoot.add(t.$type)),t.$type;n=new(i=i||e(18))(n||t.name);return o.decorateRoot.add(n),n.ctor=t,Object.defineProperty(t,"$type",{value:n,enumerable:!1}),Object.defineProperty(t.prototype,"$type",{value:n,enumerable:!1}),n};var c=0;o.decorateEnum=function(t){if(t.$type)return t.$type;var n=new(r=r||e(3))("Enum"+c++,t);return o.decorateRoot.add(n),Object.defineProperty(t,"$type",{value:n,enumerable:!1}),n},o.setProperty=function(t,n,e){if("object"!=typeof t)throw TypeError("dst must be an object");if(!n)throw TypeError("path must be specified");return function t(n,e,i){var r=e.shift();return 0<e.length?n[r]=t(n[r]||{},e,i):((e=n[r])&&(i=[].concat(e).concat(i)),n[r]=i),n}(t,n=n.split("."),e)},Object.defineProperty(o,"decorateRoot",{get:function(){return s.decorated||(s.decorated=new(e(26)))}})},function(t,n,e){"use strict";!function(s){function a(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var u=null;n.a=function(){function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t)}var n,e,i,r;function o(){return r.apply(this,arguments)}return n=t,e=null,i=[{key:"global",value:(r=function(){if("undefined"!=typeof self&&null!==self&&0!==Object.keys(self).length)return self;if("undefined"!=typeof window&&null!==window&&0!==Object.keys(window).length)return window;if(null!=s&&0!==Object.keys(s).length)return s;if("undefined"==typeof my)throw new Error("unable to locate global object");var t;return u||(t=my.getAppIdSync(),u={location:{host:t.appId+".hybrid.alipay-eco.com"}}),u},o.toString=function(){return r.toString()},o)}],e&&a(n.prototype,e),i&&a(n,i),t}()}.call(this,e(12))},function(t,e,o){"use strict";!function(t){var i=e;function r(t,n,e){for(var i=Object.keys(n),r=0;r<i.length;++r)void 0!==t[i[r]]&&e||(t[i[r]]=n[i[r]]);return t}function n(t){function e(t,n){if(!(this instanceof e))return new e(t,n);Object.defineProperty(this,"message",{get:function(){return t}}),Error.captureStackTrace?Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),n&&r(this,n)}return(e.prototype=Object.create(Error.prototype)).constructor=e,Object.defineProperty(e.prototype,"name",{get:function(){return t}}),e.prototype.toString=function(){return this.name+": "+this.message},e}i.asPromise=o(13),i.base64=o(31),i.EventEmitter=o(32),i.float=o(33),i.inquire=o(14),i.utf8=o(34),i.pool=o(35),i.LongBits=o(36),i.isNode=Boolean(void 0!==t&&t&&t.process&&t.process.versions&&t.process.versions.node),i.global=i.isNode&&t||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||this,i.emptyArray=Object.freeze?Object.freeze([]):[],i.emptyObject=Object.freeze?Object.freeze({}):{},i.isInteger=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t},i.isString=function(t){return"string"==typeof t||t instanceof String},i.isObject=function(t){return t&&"object"==typeof t},i.isset=i.isSet=function(t,n){var e=t[n];return!(null==e||!t.hasOwnProperty(n))&&("object"!=typeof e||0<(Array.isArray(e)?e:Object.keys(e)).length)},i.Buffer=function(){try{var t=i.inquire("buffer").Buffer;return t.prototype.utf8Write?t:null}catch(t){return null}}(),i.u=null,i._=null,i.newBuffer=function(t){return"number"==typeof t?i.Buffer?i._(t):new i.Array(t):i.Buffer?i.u(t):"undefined"==typeof Uint8Array?t:new Uint8Array(t)},i.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,i.Long=i.global.dcodeIO&&i.global.dcodeIO.Long||i.global.Long||i.inquire("long"),i.key2Re=/^true|false|0|1$/,i.key32Re=/^-?(?:0|[1-9][0-9]*)$/,i.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,i.longToHash=function(t){return t?i.LongBits.from(t).toHash():i.LongBits.zeroHash},i.longFromHash=function(t,n){t=i.LongBits.fromHash(t);return i.Long?i.Long.fromBits(t.lo,t.hi,n):t.toNumber(Boolean(n))},i.merge=r,i.lcFirst=function(t){return t.charAt(0).toLowerCase()+t.substring(1)},i.newError=n,i.ProtocolError=n("ProtocolError"),i.oneOfGetter=function(t){for(var e={},n=0;n<t.length;++n)e[t[n]]=1;return function(){for(var t=Object.keys(this),n=t.length-1;-1<n;--n)if(1===e[t[n]]&&void 0!==this[t[n]]&&null!==this[t[n]])return t[n]}},i.oneOfSetter=function(e){return function(t){for(var n=0;n<e.length;++n)e[n]!==t&&delete this[e[n]]}},i.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},i.M=function(){var e=i.Buffer;e?(i.u=e.from!==Uint8Array.from&&e.from||function(t,n){return new e(t,n)},i._=e.allocUnsafe||function(t){return new e(t)}):i.u=i._=null}}.call(this,o(12))},function(t,n,e){"use strict";t.exports=o;var a=e(4);((o.prototype=Object.create(a.prototype)).constructor=o).className="Enum";var i=e(6),r=e(0);function o(t,n,e,i,r){if(a.call(this,t,e),n&&"object"!=typeof n)throw TypeError("values must be an object");if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=i,this.comments=r||{},this.reserved=void 0,n)for(var o=Object.keys(n),s=0;s<o.length;++s)"number"==typeof n[o[s]]&&(this.valuesById[this.values[o[s]]=n[o[s]]]=o[s])}o.fromJSON=function(t,n){t=new o(t,n.values,n.options,n.comment,n.comments);return t.reserved=n.reserved,t},o.prototype.toJSON=function(t){t=!!t&&Boolean(t.keepComments);return r.toObject(["options",this.options,"values",this.values,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"comment",t?this.comment:void 0,"comments",t?this.comments:void 0])},o.prototype.add=function(t,n,e){if(!r.isString(t))throw TypeError("name must be a string");if(!r.isInteger(n))throw TypeError("id must be an integer");if(void 0!==this.values[t])throw Error("duplicate name '"+t+"' in "+this);if(this.isReservedId(n))throw Error("id "+n+" is reserved in "+this);if(this.isReservedName(t))throw Error("name '"+t+"' is reserved in "+this);if(void 0!==this.valuesById[n]){if(!this.options||!this.options.allow_alias)throw Error("duplicate id "+n+" in "+this);this.values[t]=n}else this.valuesById[this.values[t]=n]=t;return this.comments[t]=e||null,this},o.prototype.remove=function(t){if(!r.isString(t))throw TypeError("name must be a string");var n=this.values[t];if(null==n)throw Error("name '"+t+"' does not exist in "+this);return delete this.valuesById[n],delete this.values[t],delete this.comments[t],this},o.prototype.isReservedId=function(t){return i.isReservedId(this.reserved,t)},o.prototype.isReservedName=function(t){return i.isReservedName(this.reserved,t)}},function(t,n,e){"use strict";(t.exports=r).className="ReflectionObject";var i,s=e(0);function r(t,n){if(!s.isString(t))throw TypeError("name must be a string");if(n&&!s.isObject(n))throw TypeError("options must be an object");this.options=n,this.parsedOptions=null,this.name=t,this.parent=null,this.resolved=!1,this.comment=null,this.filename=null}Object.defineProperties(r.prototype,{root:{get:function(){for(var t=this;null!==t.parent;)t=t.parent;return t}},fullName:{get:function(){for(var t=[this.name],n=this.parent;n;)t.unshift(n.name),n=n.parent;return t.join(".")}}}),r.prototype.toJSON=function(){throw Error()},r.prototype.onAdd=function(t){this.parent&&this.parent!==t&&this.parent.remove(this),this.parent=t,this.resolved=!1;t=t.root;t instanceof i&&t.S(this)},r.prototype.onRemove=function(t){t=t.root;t instanceof i&&t.T(this),this.parent=null,this.resolved=!1},r.prototype.resolve=function(){return this.resolved||this.root instanceof i&&(this.resolved=!0),this},r.prototype.getOption=function(t){if(this.options)return this.options[t]},r.prototype.setOption=function(t,n,e){return e&&this.options&&void 0!==this.options[t]||((this.options||(this.options={}))[t]=n),this},r.prototype.setParsedOption=function(n,t,e){this.parsedOptions||(this.parsedOptions=[]);var i,r,o=this.parsedOptions;return e?(r=o.find(function(t){return Object.prototype.hasOwnProperty.call(t,n)}))?(i=r[n],s.setProperty(i,e,t)):((r={})[n]=s.setProperty({},e,t),o.push(r)):((r={})[n]=t,o.push(r)),this},r.prototype.setOptions=function(t,n){if(t)for(var e=Object.keys(t),i=0;i<e.length;++i)this.setOption(e[i],t[e[i]],n);return this},r.prototype.toString=function(){var t=this.constructor.className,n=this.fullName;return n.length?t+" "+n:t},r.M=function(t){i=t}},function(t,n,e){"use strict";t.exports=s;var a=e(4);((s.prototype=Object.create(a.prototype)).constructor=s).className="Field";var i,r=e(3),u=e(7),h=e(0),c=/^required|optional|repeated$/;function s(t,n,e,i,r,o,s){if(h.isObject(i)?(s=r,o=i,i=r=void 0):h.isObject(r)&&(s=o,o=r,r=void 0),a.call(this,t,o),!h.isInteger(n)||n<0)throw TypeError("id must be a non-negative integer");if(!h.isString(e))throw TypeError("type must be a string");if(void 0!==i&&!c.test(i=i.toString().toLowerCase()))throw TypeError("rule must be a string rule");if(void 0!==r&&!h.isString(r))throw TypeError("extend must be a string");this.rule=i&&"optional"!==i?i:void 0,this.type=e,this.id=n,this.extend=r||void 0,this.required="required"===i,this.optional=!this.required,this.repeated="repeated"===i,this.map=!1,this.message=null,this.partOf=null,this.typeDefault=null,this.defaultValue=null,this.long=!!h.Long&&void 0!==u.long[e],this.bytes="bytes"===e,this.resolvedType=null,this.extensionField=null,this.declaringField=null,this.L=null,this.comment=s}s.fromJSON=function(t,n){return new s(t,n.id,n.type,n.rule,n.extend,n.options,n.comment)},Object.defineProperty(s.prototype,"packed",{get:function(){return null===this.L&&(this.L=!1!==this.getOption("packed")),this.L}}),s.prototype.setOption=function(t,n,e){return"packed"===t&&(this.L=null),a.prototype.setOption.call(this,t,n,e)},s.prototype.toJSON=function(t){t=!!t&&Boolean(t.keepComments);return h.toObject(["rule","optional"!==this.rule&&this.rule||void 0,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},s.prototype.resolve=function(){return this.resolved?this:(void 0===(this.typeDefault=u.defaults[this.type])&&(this.resolvedType=(this.declaringField||this).parent.lookupTypeOrEnum(this.type),this.resolvedType instanceof i?this.typeDefault=null:this.typeDefault=this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]),this.options&&null!=this.options.default&&(this.typeDefault=this.options.default,this.resolvedType instanceof r&&"string"==typeof this.typeDefault&&(this.typeDefault=this.resolvedType.values[this.typeDefault])),this.options&&(!0!==this.options.packed&&(void 0===this.options.packed||!this.resolvedType||this.resolvedType instanceof r)||delete this.options.packed,Object.keys(this.options).length||(this.options=void 0)),this.long?(this.typeDefault=h.Long.fromNumber(this.typeDefault,"u"===this.type.charAt(0)),Object.freeze&&Object.freeze(this.typeDefault)):this.bytes&&"string"==typeof this.typeDefault&&(h.base64.test(this.typeDefault)?h.base64.decode(this.typeDefault,t=h.newBuffer(h.base64.length(this.typeDefault)),0):h.utf8.write(this.typeDefault,t=h.newBuffer(h.utf8.length(this.typeDefault)),0),this.typeDefault=t),this.map?this.defaultValue=h.emptyObject:this.repeated?this.defaultValue=h.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof i&&(this.parent.ctor.prototype[this.name]=this.defaultValue),a.prototype.resolve.call(this));var t},s.d=function(e,i,r,o){return"function"==typeof i?i=h.decorateType(i).name:i&&"object"==typeof i&&(i=h.decorateEnum(i).name),function(t,n){h.decorateType(t.constructor).add(new s(n,e,i,r,{default:o}))}},s.M=function(t){i=t}},function(t,n,e){"use strict";t.exports=c;var i=e(4);((c.prototype=Object.create(i.prototype)).constructor=c).className="Namespace";var r,o,s,a=e(5),u=e(0);function h(t,n){if(t&&t.length){for(var e={},i=0;i<t.length;++i)e[t[i].name]=t[i].toJSON(n);return e}}function c(t,n){i.call(this,t,n),this.nested=void 0,this.R=null}function f(t){return t.R=null,t}c.fromJSON=function(t,n){return new c(t,n.options).addJSON(n.nested)},c.arrayToJSON=h,c.isReservedId=function(t,n){if(t)for(var e=0;e<t.length;++e)if("string"!=typeof t[e]&&t[e][0]<=n&&t[e][1]>n)return!0;return!1},c.isReservedName=function(t,n){if(t)for(var e=0;e<t.length;++e)if(t[e]===n)return!0;return!1},Object.defineProperty(c.prototype,"nestedArray",{get:function(){return this.R||(this.R=u.toArray(this.nested))}}),c.prototype.toJSON=function(t){return u.toObject(["options",this.options,"nested",h(this.nestedArray,t)])},c.prototype.addJSON=function(t){if(t)for(var n,e=Object.keys(t),i=0;i<e.length;++i)n=t[e[i]],this.add((void 0!==n.fields?r:void 0!==n.values?s:void 0!==n.methods?o:void 0!==n.id?a:c).fromJSON(e[i],n));return this},c.prototype.get=function(t){return this.nested&&this.nested[t]||null},c.prototype.getEnum=function(t){if(this.nested&&this.nested[t]instanceof s)return this.nested[t].values;throw Error("no such enum: "+t)},c.prototype.add=function(t){if(!(t instanceof a&&void 0!==t.extend||t instanceof r||t instanceof s||t instanceof o||t instanceof c))throw TypeError("object must be a valid nested object");if(this.nested){var n=this.get(t.name);if(n){if(!(n instanceof c&&t instanceof c)||n instanceof r||n instanceof o)throw Error("duplicate name '"+t.name+"' in "+this);for(var e=n.nestedArray,i=0;i<e.length;++i)t.add(e[i]);this.remove(n),this.nested||(this.nested={}),t.setOptions(n.options,!0)}}else this.nested={};return(this.nested[t.name]=t).onAdd(this),f(this)},c.prototype.remove=function(t){if(!(t instanceof i))throw TypeError("object must be a ReflectionObject");if(t.parent!==this)throw Error(t+" is not a member of "+this);return delete this.nested[t.name],Object.keys(this.nested).length||(this.nested=void 0),t.onRemove(this),f(this)},c.prototype.define=function(t,n){if(u.isString(t))t=t.split(".");else if(!Array.isArray(t))throw TypeError("illegal path");if(t&&t.length&&""===t[0])throw Error("path must be relative");for(var e=this;0<t.length;){var i=t.shift();if(e.nested&&e.nested[i]){if(!((e=e.nested[i])instanceof c))throw Error("path conflicts with non-namespace objects")}else e.add(e=new c(i))}return n&&e.addJSON(n),e},c.prototype.resolveAll=function(){for(var t=this.nestedArray,n=0;n<t.length;)t[n]instanceof c?t[n++].resolveAll():t[n++].resolve();return this.resolve()},c.prototype.lookup=function(t,n,e){if("boolean"==typeof n?(e=n,n=void 0):n&&!Array.isArray(n)&&(n=[n]),u.isString(t)&&t.length){if("."===t)return this.root;t=t.split(".")}else if(!t.length)return this;if(""===t[0])return this.root.lookup(t.slice(1),n);var i=this.get(t[0]);if(i){if(1===t.length){if(!n||-1<n.indexOf(i.constructor))return i}else if(i instanceof c&&(i=i.lookup(t.slice(1),n,!0)))return i}else for(var r=0;r<this.nestedArray.length;++r)if(this.R[r]instanceof c&&(i=this.R[r].lookup(t,n,!0)))return i;return null===this.parent||e?null:this.parent.lookup(t,n)},c.prototype.lookupType=function(t){var n=this.lookup(t,[r]);if(!n)throw Error("no such type: "+t);return n},c.prototype.lookupEnum=function(t){var n=this.lookup(t,[s]);if(!n)throw Error("no such Enum '"+t+"' in "+this);return n},c.prototype.lookupTypeOrEnum=function(t){var n=this.lookup(t,[r,s]);if(!n)throw Error("no such Type or Enum '"+t+"' in "+this);return n},c.prototype.lookupService=function(t){var n=this.lookup(t,[o]);if(!n)throw Error("no such Service '"+t+"' in "+this);return n},c.M=function(t,n,e){r=t,o=n,s=e}},function(t,n,e){"use strict";var n=n,e=e(0),r=["double","float","int32","uint32","sint32","fixed32","sfixed32","int64","uint64","sint64","fixed64","sfixed64","bool","string","bytes"];function i(t,n){var e=0,i={};for(n|=0;e<t.length;)i[r[e+n]]=t[e++];return i}n.basic=i([1,5,0,0,0,5,5,0,0,0,1,1,0,2,2]),n.defaults=i([0,0,0,0,0,0,0,0,0,0,0,0,!1,"",e.emptyArray,null]),n.long=i([0,0,0,1,1],7),n.mapKey=i([0,0,0,5,5,0,0,0,1,1,0,2],2),n.packed=i([1,5,0,0,0,5,5,0,0,0,1,1,0])},function(t,n,e){"use strict";t.exports=f;var i,r=e(2),o=r.LongBits,s=r.base64,a=r.utf8;function u(t,n,e){this.fn=t,this.len=n,this.next=void 0,this.val=e}function h(){}function c(t){this.head=t.head,this.tail=t.tail,this.len=t.len,this.next=t.states}function f(){this.len=0,this.head=new u(h,0,0),this.tail=this.head,this.states=null}function l(){return r.Buffer?function(){return(f.create=function(){return new i})()}:function(){return new f}}function d(t,n,e){n[e]=255&t}function v(t,n){this.len=t,this.next=void 0,this.val=n}function p(t,n,e){for(;t.hi;)n[e++]=127&t.lo|128,t.lo=(t.lo>>>7|t.hi<<25)>>>0,t.hi>>>=7;for(;127<t.lo;)n[e++]=127&t.lo|128,t.lo=t.lo>>>7;n[e++]=t.lo}function m(t,n,e){n[e]=255&t,n[e+1]=t>>>8&255,n[e+2]=t>>>16&255,n[e+3]=t>>>24}f.create=l(),f.alloc=function(t){return new r.Array(t)},r.Array!==Array&&(f.alloc=r.pool(f.alloc,r.Array.prototype.subarray)),f.prototype.O=function(t,n,e){return this.tail=this.tail.next=new u(t,n,e),this.len+=n,this},(v.prototype=Object.create(u.prototype)).fn=function(t,n,e){for(;127<t;)n[e++]=127&t|128,t>>>=7;n[e]=t},f.prototype.uint32=function(t){return this.len+=(this.tail=this.tail.next=new v((t>>>=0)<128?1:t<16384?2:t<2097152?3:t<268435456?4:5,t)).len,this},f.prototype.int32=function(t){return t<0?this.O(p,10,o.fromNumber(t)):this.uint32(t)},f.prototype.sint32=function(t){return this.uint32((t<<1^t>>31)>>>0)},f.prototype.int64=f.prototype.uint64=function(t){t=o.from(t);return this.O(p,t.length(),t)},f.prototype.sint64=function(t){t=o.from(t).zzEncode();return this.O(p,t.length(),t)},f.prototype.bool=function(t){return this.O(d,1,t?1:0)},f.prototype.sfixed32=f.prototype.fixed32=function(t){return this.O(m,4,t>>>0)},f.prototype.sfixed64=f.prototype.fixed64=function(t){t=o.from(t);return this.O(m,4,t.lo).O(m,4,t.hi)},f.prototype.float=function(t){return this.O(r.float.writeFloatLE,4,t)},f.prototype.double=function(t){return this.O(r.float.writeDoubleLE,8,t)};var g=r.Array.prototype.set?function(t,n,e){n.set(t,e)}:function(t,n,e){for(var i=0;i<t.length;++i)n[e+i]=t[i]};f.prototype.bytes=function(t){var n,e=t.length>>>0;return e?(r.isString(t)&&(n=f.alloc(e=s.length(t)),s.decode(t,n,0),t=n),this.uint32(e).O(g,e,t)):this.O(d,1,0)},f.prototype.string=function(t){var n=a.length(t);return n?this.uint32(n).O(a.write,n,t):this.O(d,1,0)},f.prototype.fork=function(){return this.states=new c(this),this.head=this.tail=new u(h,0,0),this.len=0,this},f.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new u(h,0,0),this.len=0),this},f.prototype.ldelim=function(){var t=this.head,n=this.tail,e=this.len;return this.reset().uint32(e),e&&(this.tail.next=t.next,this.tail=n,this.len+=e),this},f.prototype.finish=function(){for(var t=this.head.next,n=this.constructor.alloc(this.len),e=0;t;)t.fn(t.val,n,e),e+=t.len,t=t.next;return n},f.M=function(t){i=t,f.create=l(),i.M()}},function(t,n,e){"use strict";t.exports=u;var i,r=e(2),o=r.LongBits,s=r.utf8;function a(t,n){return RangeError("index out of range: "+t.pos+" + "+(n||1)+" > "+t.len)}function u(t){this.buf=t,this.pos=0,this.len=t.length}function h(){return r.Buffer?function(t){return(u.create=function(t){return r.Buffer.isBuffer(t)?new i(t):f(t)})(t)}:f}var c,f="undefined"!=typeof Uint8Array?function(t){if(t instanceof Uint8Array||Array.isArray(t))return new u(t);throw Error("illegal buffer")}:function(t){if(Array.isArray(t))return new u(t);throw Error("illegal buffer")};function l(){var t=new o(0,0),n=0;if(!(4<this.len-this.pos)){for(;n<3;++n){if(this.pos>=this.len)throw a(this);if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*n)>>>0,this.buf[this.pos++]<128)return t}return t.lo=(t.lo|(127&this.buf[this.pos++])<<7*n)>>>0,t}for(;n<4;++n)if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*n)>>>0,this.buf[this.pos++]<128)return t;if(t.lo=(t.lo|(127&this.buf[this.pos])<<28)>>>0,t.hi=(t.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return t;if(n=0,4<this.len-this.pos){for(;n<5;++n)if(t.hi=(t.hi|(127&this.buf[this.pos])<<7*n+3)>>>0,this.buf[this.pos++]<128)return t}else for(;n<5;++n){if(this.pos>=this.len)throw a(this);if(t.hi=(t.hi|(127&this.buf[this.pos])<<7*n+3)>>>0,this.buf[this.pos++]<128)return t}throw Error("invalid varint encoding")}function d(t,n){return(t[n-4]|t[n-3]<<8|t[n-2]<<16|t[n-1]<<24)>>>0}function v(){if(this.pos+8>this.len)throw a(this,8);return new o(d(this.buf,this.pos+=4),d(this.buf,this.pos+=4))}u.create=h(),u.prototype.A=r.Array.prototype.subarray||r.Array.prototype.slice,u.prototype.uint32=(c=4294967295,function(){if(c=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return c;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return c}),u.prototype.int32=function(){return 0|this.uint32()},u.prototype.sint32=function(){var t=this.uint32();return t>>>1^-(1&t)|0},u.prototype.bool=function(){return 0!==this.uint32()},u.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return d(this.buf,this.pos+=4)},u.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return 0|d(this.buf,this.pos+=4)},u.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var t=r.float.readFloatLE(this.buf,this.pos);return this.pos+=4,t},u.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var t=r.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,t},u.prototype.bytes=function(){var t=this.uint32(),n=this.pos,e=this.pos+t;if(e>this.len)throw a(this,t);return this.pos+=t,Array.isArray(this.buf)?this.buf.slice(n,e):n===e?new this.buf.constructor(0):this.A.call(this.buf,n,e)},u.prototype.string=function(){var t=this.bytes();return s.read(t,0,t.length)},u.prototype.skip=function(t){if("number"==typeof t){if(this.pos+t>this.len)throw a(this,t);this.pos+=t}else do{if(this.pos>=this.len)throw a(this)}while(128&this.buf[this.pos++]);return this},u.prototype.skipType=function(t){switch(t){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(t=7&this.uint32());)this.skipType(t);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+t+" at offset "+this.pos)}return this},u.M=function(t){i=t,u.create=h(),i.M();var n=r.Long?"toLong":"toNumber";r.merge(u.prototype,{int64:function(){return l.call(this)[n](!1)},uint64:function(){return l.call(this)[n](!0)},sint64:function(){return l.call(this).zzDecode()[n](!1)},fixed64:function(){return v.call(this)[n](!0)},sfixed64:function(){return v.call(this)[n](!1)}})}},function(t,n,e){"use strict";t.exports=s;var r=e(4);((s.prototype=Object.create(r.prototype)).constructor=s).className="OneOf";var i=e(5),o=e(0);function s(t,n,e,i){if(Array.isArray(n)||(e=n,n=void 0),r.call(this,t,e),void 0!==n&&!Array.isArray(n))throw TypeError("fieldNames must be an Array");this.oneof=n||[],this.fieldsArray=[],this.comment=i}function a(t){if(t.parent)for(var n=0;n<t.fieldsArray.length;++n)t.fieldsArray[n].parent||t.parent.add(t.fieldsArray[n])}s.fromJSON=function(t,n){return new s(t,n.oneof,n.options,n.comment)},s.prototype.toJSON=function(t){t=!!t&&Boolean(t.keepComments);return o.toObject(["options",this.options,"oneof",this.oneof,"comment",t?this.comment:void 0])},s.prototype.add=function(t){if(!(t instanceof i))throw TypeError("field must be a Field");return t.parent&&t.parent!==this.parent&&t.parent.remove(t),this.oneof.push(t.name),this.fieldsArray.push(t),a(t.partOf=this),this},s.prototype.remove=function(t){if(!(t instanceof i))throw TypeError("field must be a Field");var n=this.fieldsArray.indexOf(t);if(n<0)throw Error(t+" is not a member of "+this);return this.fieldsArray.splice(n,1),-1<(n=this.oneof.indexOf(t.name))&&this.oneof.splice(n,1),t.partOf=null,this},s.prototype.onAdd=function(t){r.prototype.onAdd.call(this,t);for(var n=0;n<this.oneof.length;++n){var e=t.get(this.oneof[n]);e&&!e.partOf&&(e.partOf=this).fieldsArray.push(e)}a(this)},s.prototype.onRemove=function(t){for(var n,e=0;e<this.fieldsArray.length;++e)(n=this.fieldsArray[e]).parent&&n.parent.remove(n);r.prototype.onRemove.call(this,t)},s.d=function(){for(var e=new Array(arguments.length),t=0;t<arguments.length;)e[t]=arguments[t++];return function(t,n){o.decorateType(t.constructor).add(new s(n,e)),Object.defineProperty(t,n,{get:o.oneOfGetter(e),set:o.oneOfSetter(e)})}}},function(t,n,e){"use strict";t.exports=r;var i=e(2);function r(t){if(t)for(var n=Object.keys(t),e=0;e<n.length;++e)this[n[e]]=t[n[e]]}r.create=function(t){return this.$type.create(t)},r.encode=function(t,n){return this.$type.encode(t,n)},r.encodeDelimited=function(t,n){return this.$type.encodeDelimited(t,n)},r.decode=function(t){return this.$type.decode(t)},r.decodeDelimited=function(t){return this.$type.decodeDelimited(t)},r.verify=function(t){return this.$type.verify(t)},r.fromObject=function(t){return this.$type.fromObject(t)},r.toObject=function(t,n){return this.$type.toObject(t,n)},r.prototype.toJSON=function(){return this.$type.toObject(this,i.toJSONOptions)}},function(t,n){var e=function(){return this}();try{e=e||new Function("return this")()}catch(t){"object"==typeof window&&(e=window)}t.exports=e},function(t,n,e){"use strict";t.exports=function(t,n){var e=new Array(arguments.length-1),o=0,i=2,s=!0;for(;i<arguments.length;)e[o++]=arguments[i++];return new Promise(function(i,r){e[o]=function(t){if(s)if(s=!1,t)r(t);else{for(var n=new Array(arguments.length-1),e=0;e<n.length;)n[e++]=arguments[e];i.apply(null,n)}};try{t.apply(n||null,e)}catch(t){s&&(s=!1,r(t))}})}},function(module,exports,__webpack_require__){"use strict";function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}module.exports=inquire},function(t,n,e){"use strict";n.Service=e(39)},function(t,n,e){"use strict";t.exports={}},function(t,n,e){"use strict";t.exports=function(t){for(var n,e=f.codegen(["m","w"],t.name+"$encode")("if(!w)")("w=Writer.create()"),i=t.fieldsArray.slice().sort(f.compareFieldsById),r=0;r<i.length;++r){var o=i[r].resolve(),s=t.k.indexOf(o),a=o.resolvedType instanceof h?"int32":o.type,u=c.basic[a];n="m"+f.safeProp(o.name),o.map?(e("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){",n,o.name)("for(var ks=Object.keys(%s),i=0;i<ks.length;++i){",n)("w.uint32(%i).fork().uint32(%i).%s(ks[i])",(o.id<<3|2)>>>0,8|c.mapKey[o.keyType],o.keyType),void 0===u?e("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",s,n):e(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|u,a,n),e("}")("}")):o.repeated?(e("if(%s!=null&&%s.length){",n,n),o.packed&&void 0!==c.packed[a]?e("w.uint32(%i).fork()",(o.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",n)("w.%s(%s[i])",a,n)("w.ldelim()"):(e("for(var i=0;i<%s.length;++i)",n),void 0===u?l(e,o,s,n+"[i]"):e("w.uint32(%i).%s(%s[i])",(o.id<<3|u)>>>0,a,n)),e("}")):(o.optional&&e("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",n,o.name),void 0===u?l(e,o,s,n):e("w.uint32(%i).%s(%s)",(o.id<<3|u)>>>0,a,n))}return e("return w")};var h=e(3),c=e(7),f=e(0);function l(t,n,e,i){return n.resolvedType.group?t("types[%i].encode(%s,w.uint32(%i)).uint32(%i)",e,i,(n.id<<3|3)>>>0,(n.id<<3|4)>>>0):t("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",e,i,(n.id<<3|2)>>>0)}},function(t,n,e){"use strict";t.exports=b;var s=e(6);((b.prototype=Object.create(s.prototype)).constructor=b).className="Type";var a=e(3),u=e(10),h=e(5),c=e(19),f=e(20),r=e(11),o=e(9),l=e(8),d=e(0),v=e(17),p=e(22),m=e(23),g=e(24),y=e(25);function b(t,n){s.call(this,t,n),this.fields={},this.oneofs=void 0,this.extensions=void 0,this.reserved=void 0,this.group=void 0,this.C=null,this.k=null,this.j=null,this.P=null}function i(t){return t.C=t.k=t.j=null,delete t.encode,delete t.decode,delete t.verify,t}Object.defineProperties(b.prototype,{fieldsById:{get:function(){if(this.C)return this.C;this.C={};for(var t=Object.keys(this.fields),n=0;n<t.length;++n){var e=this.fields[t[n]],i=e.id;if(this.C[i])throw Error("duplicate id "+i+" in "+this);this.C[i]=e}return this.C}},fieldsArray:{get:function(){return this.k||(this.k=d.toArray(this.fields))}},oneofsArray:{get:function(){return this.j||(this.j=d.toArray(this.oneofs))}},ctor:{get:function(){return this.P||(this.ctor=b.generateConstructor(this)())},set:function(t){var n=t.prototype;n instanceof r||((t.prototype=new r).constructor=t,d.merge(t.prototype,n)),t.$type=t.prototype.$type=this,d.merge(t,r,!0),this.P=t;for(var e=0;e<this.fieldsArray.length;++e)this.k[e].resolve();for(var i={},e=0;e<this.oneofsArray.length;++e)i[this.j[e].resolve().name]={get:d.oneOfGetter(this.j[e].oneof),set:d.oneOfSetter(this.j[e].oneof)};e&&Object.defineProperties(t.prototype,i)}}}),b.generateConstructor=function(t){for(var n,e=d.codegen(["p"],t.name),i=0;i<t.fieldsArray.length;++i)(n=t.k[i]).map?e("this%s={}",d.safeProp(n.name)):n.repeated&&e("this%s=[]",d.safeProp(n.name));return e("if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null)")("this[ks[i]]=p[ks[i]]")},b.fromJSON=function(t,n){var e=new b(t,n.options);e.extensions=n.extensions,e.reserved=n.reserved;for(var i=Object.keys(n.fields),r=0;r<i.length;++r)e.add((void 0!==n.fields[i[r]].keyType?c:h).fromJSON(i[r],n.fields[i[r]]));if(n.oneofs)for(i=Object.keys(n.oneofs),r=0;r<i.length;++r)e.add(u.fromJSON(i[r],n.oneofs[i[r]]));if(n.nested)for(i=Object.keys(n.nested),r=0;r<i.length;++r){var o=n.nested[i[r]];e.add((void 0!==o.id?h:void 0!==o.fields?b:void 0!==o.values?a:void 0!==o.methods?f:s).fromJSON(i[r],o))}return n.extensions&&n.extensions.length&&(e.extensions=n.extensions),n.reserved&&n.reserved.length&&(e.reserved=n.reserved),n.group&&(e.group=!0),n.comment&&(e.comment=n.comment),e},b.prototype.toJSON=function(t){var n=s.prototype.toJSON.call(this,t),e=!!t&&Boolean(t.keepComments);return d.toObject(["options",n&&n.options||void 0,"oneofs",s.arrayToJSON(this.oneofsArray,t),"fields",s.arrayToJSON(this.fieldsArray.filter(function(t){return!t.declaringField}),t)||{},"extensions",this.extensions&&this.extensions.length?this.extensions:void 0,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"group",this.group||void 0,"nested",n&&n.nested||void 0,"comment",e?this.comment:void 0])},b.prototype.resolveAll=function(){for(var t=this.fieldsArray,n=0;n<t.length;)t[n++].resolve();for(var e=this.oneofsArray,n=0;n<e.length;)e[n++].resolve();return s.prototype.resolveAll.call(this)},b.prototype.get=function(t){return this.fields[t]||this.oneofs&&this.oneofs[t]||this.nested&&this.nested[t]||null},b.prototype.add=function(t){if(this.get(t.name))throw Error("duplicate name '"+t.name+"' in "+this);if(t instanceof h&&void 0===t.extend){if((this.C||this.fieldsById)[t.id])throw Error("duplicate id "+t.id+" in "+this);if(this.isReservedId(t.id))throw Error("id "+t.id+" is reserved in "+this);if(this.isReservedName(t.name))throw Error("name '"+t.name+"' is reserved in "+this);return t.parent&&t.parent.remove(t),(this.fields[t.name]=t).message=this,t.onAdd(this),i(this)}return t instanceof u?(this.oneofs||(this.oneofs={}),(this.oneofs[t.name]=t).onAdd(this),i(this)):s.prototype.add.call(this,t)},b.prototype.remove=function(t){if(t instanceof h&&void 0===t.extend){if(!this.fields||this.fields[t.name]!==t)throw Error(t+" is not a member of "+this);return delete this.fields[t.name],t.parent=null,t.onRemove(this),i(this)}if(t instanceof u){if(!this.oneofs||this.oneofs[t.name]!==t)throw Error(t+" is not a member of "+this);return delete this.oneofs[t.name],t.parent=null,t.onRemove(this),i(this)}return s.prototype.remove.call(this,t)},b.prototype.isReservedId=function(t){return s.isReservedId(this.reserved,t)},b.prototype.isReservedName=function(t){return s.isReservedName(this.reserved,t)},b.prototype.create=function(t){return new this.ctor(t)},b.prototype.setup=function(){for(var t=this.fullName,n=[],e=0;e<this.fieldsArray.length;++e)n.push(this.k[e].resolve().resolvedType);this.encode=v(this)({Writer:l,types:n,util:d}),this.decode=p(this)({Reader:o,types:n,util:d}),this.verify=m(this)({types:n,util:d}),this.fromObject=g.fromObject(this)({types:n,util:d}),this.toObject=g.toObject(this)({types:n,util:d});var i=y[t];return i&&((t=Object.create(this)).fromObject=this.fromObject,this.fromObject=i.fromObject.bind(t),t.toObject=this.toObject,this.toObject=i.toObject.bind(t)),this},b.prototype.encode=function(t,n){return this.setup().encode(t,n)},b.prototype.encodeDelimited=function(t,n){return this.encode(t,n&&n.len?n.fork():n).ldelim()},b.prototype.decode=function(t,n){return this.setup().decode(t,n)},b.prototype.decodeDelimited=function(t){return t instanceof o||(t=o.create(t)),this.decode(t,t.uint32())},b.prototype.verify=function(t){return this.setup().verify(t)},b.prototype.fromObject=function(t){return this.setup().fromObject(t)},b.prototype.toObject=function(t,n){return this.setup().toObject(t,n)},b.d=function(n){return function(t){d.decorateType(t,n)}}},function(t,n,e){"use strict";t.exports=o;var s=e(5);((o.prototype=Object.create(s.prototype)).constructor=o).className="MapField";var i=e(7),a=e(0);function o(t,n,e,i,r,o){if(s.call(this,t,n,i,void 0,void 0,r,o),!a.isString(e))throw TypeError("keyType must be a string");this.keyType=e,this.resolvedKeyType=null,this.map=!0}o.fromJSON=function(t,n){return new o(t,n.id,n.keyType,n.type,n.options,n.comment)},o.prototype.toJSON=function(t){t=!!t&&Boolean(t.keepComments);return a.toObject(["keyType",this.keyType,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},o.prototype.resolve=function(){if(this.resolved)return this;if(void 0===i.mapKey[this.keyType])throw Error("invalid key type: "+this.keyType);return s.prototype.resolve.call(this)},o.d=function(e,i,r){return"function"==typeof r?r=a.decorateType(r).name:r&&"object"==typeof r&&(r=a.decorateEnum(r).name),function(t,n){a.decorateType(t.constructor).add(new o(n,e,i,r))}}},function(t,n,e){"use strict";t.exports=s;var i=e(6);((s.prototype=Object.create(i.prototype)).constructor=s).className="Service";var o=e(21),a=e(0),u=e(15);function s(t,n){i.call(this,t,n),this.methods={},this.D=null}function r(t){return t.D=null,t}s.fromJSON=function(t,n){var e=new s(t,n.options);if(n.methods)for(var i=Object.keys(n.methods),r=0;r<i.length;++r)e.add(o.fromJSON(i[r],n.methods[i[r]]));return n.nested&&e.addJSON(n.nested),e.comment=n.comment,e},s.prototype.toJSON=function(t){var n=i.prototype.toJSON.call(this,t),e=!!t&&Boolean(t.keepComments);return a.toObject(["options",n&&n.options||void 0,"methods",i.arrayToJSON(this.methodsArray,t)||{},"nested",n&&n.nested||void 0,"comment",e?this.comment:void 0])},Object.defineProperty(s.prototype,"methodsArray",{get:function(){return this.D||(this.D=a.toArray(this.methods))}}),s.prototype.get=function(t){return this.methods[t]||i.prototype.get.call(this,t)},s.prototype.resolveAll=function(){for(var t=this.methodsArray,n=0;n<t.length;++n)t[n].resolve();return i.prototype.resolve.call(this)},s.prototype.add=function(t){if(this.get(t.name))throw Error("duplicate name '"+t.name+"' in "+this);return t instanceof o?r((this.methods[t.name]=t).parent=this):i.prototype.add.call(this,t)},s.prototype.remove=function(t){if(t instanceof o){if(this.methods[t.name]!==t)throw Error(t+" is not a member of "+this);return delete this.methods[t.name],t.parent=null,r(this)}return i.prototype.remove.call(this,t)},s.prototype.create=function(t,n,e){for(var i,r=new u.Service(t,n,e),o=0;o<this.methodsArray.length;++o){var s=a.lcFirst((i=this.D[o]).resolve().name).replace(/[^$\w_]/g,"");r[s]=a.codegen(["r","c"],a.isReserved(s)?s+"_":s)("return this.rpcCall(m,q,s,r,c)")({m:i,q:i.resolvedRequestType.ctor,s:i.resolvedResponseType.ctor})}return r}},function(t,n,e){"use strict";t.exports=i;var h=e(4);((i.prototype=Object.create(h.prototype)).constructor=i).className="Method";var c=e(0);function i(t,n,e,i,r,o,s,a,u){if(c.isObject(r)?(s=r,r=o=void 0):c.isObject(o)&&(s=o,o=void 0),void 0!==n&&!c.isString(n))throw TypeError("type must be a string");if(!c.isString(e))throw TypeError("requestType must be a string");if(!c.isString(i))throw TypeError("responseType must be a string");h.call(this,t,s),this.type=n||"rpc",this.requestType=e,this.requestStream=!!r||void 0,this.responseType=i,this.responseStream=!!o||void 0,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=a,this.parsedOptions=u}i.fromJSON=function(t,n){return new i(t,n.type,n.requestType,n.responseType,n.requestStream,n.responseStream,n.options,n.comment,n.parsedOptions)},i.prototype.toJSON=function(t){t=!!t&&Boolean(t.keepComments);return c.toObject(["type","rpc"!==this.type&&this.type||void 0,"requestType",this.requestType,"requestStream",this.requestStream,"responseType",this.responseType,"responseStream",this.responseStream,"options",this.options,"comment",t?this.comment:void 0,"parsedOptions",this.parsedOptions])},i.prototype.resolve=function(){return this.resolved?this:(this.resolvedRequestType=this.parent.lookupType(this.requestType),this.resolvedResponseType=this.parent.lookupType(this.responseType),h.prototype.resolve.call(this))}},function(t,n,e){"use strict";t.exports=function(t){var n=h.codegen(["r","l"],t.name+"$decode")("if(!(r instanceof Reader))")("r=Reader.create(r)")("var c=l===undefined?r.len:r.pos+l,m=new this.ctor"+(t.fieldsArray.filter(function(t){return t.map}).length?",k,value":""))("while(r.pos<c){")("var t=r.uint32()");t.group&&n("if((t&7)===4)")("break");n("switch(t>>>3){");for(var e=0;e<t.fieldsArray.length;++e){var i=t.k[e].resolve(),r=i.resolvedType instanceof a?"int32":i.type,o="m"+h.safeProp(i.name);n("case %i:",i.id),i.map?(n("if(%s===util.emptyObject)",o)("%s={}",o)("var c2 = r.uint32()+r.pos"),void 0!==u.defaults[i.keyType]?n("k=%j",u.defaults[i.keyType]):n("k=null"),void 0!==u.defaults[r]?n("value=%j",u.defaults[r]):n("value=null"),n("while(r.pos<c2){")("var tag2=r.uint32()")("switch(tag2>>>3){")("case 1: k=r.%s(); break",i.keyType)("case 2:"),void 0===u.basic[r]?n("value=types[%i].decode(r,r.uint32())",e):n("value=r.%s()",r),n("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"),void 0!==u.long[i.keyType]?n('%s[typeof k==="object"?util.longToHash(k):k]=value',o):n("%s[k]=value",o)):i.repeated?(n("if(!(%s&&%s.length))",o,o)("%s=[]",o),void 0!==u.packed[r]&&n("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos<c2)")("%s.push(r.%s())",o,r)("}else"),void 0===u.basic[r]?n(i.resolvedType.group?"%s.push(types[%i].decode(r))":"%s.push(types[%i].decode(r,r.uint32()))",o,e):n("%s.push(r.%s())",o,r)):void 0===u.basic[r]?n(i.resolvedType.group?"%s=types[%i].decode(r)":"%s=types[%i].decode(r,r.uint32())",o,e):n("%s=r.%s()",o,r),n("break")}for(n("default:")("r.skipType(t&7)")("break")("}")("}"),e=0;e<t.k.length;++e){var s=t.k[e];s.required&&n("if(!m.hasOwnProperty(%j))",s.name)("throw util.ProtocolError(%j,{instance:m})","missing required '"+s.name+"'")}return n("return m")};var a=e(3),u=e(7),h=e(0)},function(t,n,e){"use strict";t.exports=function(t){var n=u.codegen(["m"],t.name+"$verify")('if(typeof m!=="object"||m===null)')("return%j","object expected"),e=t.oneofsArray,i={};e.length&&n("var p={}");for(var r=0;r<t.fieldsArray.length;++r){var o,s=t.k[r].resolve(),a="m"+u.safeProp(s.name);s.optional&&n("if(%s!=null&&m.hasOwnProperty(%j)){",a,s.name),s.map?(n("if(!util.isObject(%s))",a)("return%j",h(s,"object"))("var k=Object.keys(%s)",a)("for(var i=0;i<k.length;++i){"),function(t,n,e){switch(n.keyType){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":t("if(!util.key32Re.test(%s))",e)("return%j",h(n,"integer key"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":t("if(!util.key64Re.test(%s))",e)("return%j",h(n,"integer|Long key"));break;case"bool":t("if(!util.key2Re.test(%s))",e)("return%j",h(n,"boolean key"))}}(n,s,"k[i]"),c(n,s,r,a+"[k[i]]")("}")):s.repeated?(n("if(!Array.isArray(%s))",a)("return%j",h(s,"array"))("for(var i=0;i<%s.length;++i){",a),c(n,s,r,a+"[i]")("}")):(s.partOf&&(o=u.safeProp(s.partOf.name),1===i[s.partOf.name]&&n("if(p%s===1)",o)("return%j",s.partOf.name+": multiple values"),i[s.partOf.name]=1,n("p%s=1",o)),c(n,s,r,a)),s.optional&&n("}")}return n("return null")};var s=e(3),u=e(0);function h(t,n){return t.name+": "+n+(t.repeated&&"array"!==n?"[]":t.map&&"object"!==n?"{k:"+t.keyType+"}":"")+" expected"}function c(t,n,e,i){if(n.resolvedType)if(n.resolvedType instanceof s){t("switch(%s){",i)("default:")("return%j",h(n,"enum value"));for(var r=Object.keys(n.resolvedType.values),o=0;o<r.length;++o)t("case %i:",n.resolvedType.values[r[o]]);t("break")("}")}else t("{")("var e=types[%i].verify(%s);",e,i)("if(e)")("return%j+e",n.name+".")("}");else switch(n.type){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":t("if(!util.isInteger(%s))",i)("return%j",h(n,"integer"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":t("if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))",i,i,i,i)("return%j",h(n,"integer|Long"));break;case"float":case"double":t('if(typeof %s!=="number")',i)("return%j",h(n,"number"));break;case"bool":t('if(typeof %s!=="boolean")',i)("return%j",h(n,"boolean"));break;case"string":t("if(!util.isString(%s))",i)("return%j",h(n,"string"));break;case"bytes":t('if(!(%s&&typeof %s.length==="number"||util.isString(%s)))',i,i,i)("return%j",h(n,"buffer"))}return t}},function(t,n,e){"use strict";var n=n,l=e(3),d=e(0);function s(t,n,e,i){if(n.resolvedType)if(n.resolvedType instanceof l){t("switch(d%s){",i);for(var r=n.resolvedType.values,o=Object.keys(r),s=0;s<o.length;++s)n.repeated&&r[o[s]]===n.typeDefault&&t("default:"),t("case%j:",o[s])("case %i:",r[o[s]])("m%s=%j",i,r[o[s]])("break");t("}")}else t('if(typeof d%s!=="object")',i)("throw TypeError(%j)",n.fullName+": object expected")("m%s=types[%i].fromObject(d%s)",i,e,i);else{var a=!1;switch(n.type){case"double":case"float":t("m%s=Number(d%s)",i,i);break;case"uint32":case"fixed32":t("m%s=d%s>>>0",i,i);break;case"int32":case"sint32":case"sfixed32":t("m%s=d%s|0",i,i);break;case"uint64":a=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":t("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j",i,i,a)('else if(typeof d%s==="string")',i)("m%s=parseInt(d%s,10)",i,i)('else if(typeof d%s==="number")',i)("m%s=d%s",i,i)('else if(typeof d%s==="object")',i)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",i,i,i,a?"true":"");break;case"bytes":t('if(typeof d%s==="string")',i)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",i,i,i)("else if(d%s.length)",i)("m%s=d%s",i,i);break;case"string":t("m%s=String(d%s)",i,i);break;case"bool":t("m%s=Boolean(d%s)",i,i)}}return t}function v(t,n,e,i){if(n.resolvedType)n.resolvedType instanceof l?t("d%s=o.enums===String?types[%i].values[m%s]:m%s",i,e,i,i):t("d%s=types[%i].toObject(m%s,o)",i,e,i);else{var r=!1;switch(n.type){case"double":case"float":t("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",i,i,i,i);break;case"uint64":r=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":t('if(typeof m%s==="number")',i)("d%s=o.longs===String?String(m%s):m%s",i,i,i)("else")("d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s",i,i,i,i,r?"true":"",i);break;case"bytes":t("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s",i,i,i,i,i);break;default:t("d%s=m%s",i,i)}}return t}n.fromObject=function(t){var n=t.fieldsArray,e=d.codegen(["d"],t.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!n.length)return e("return new this.ctor");e("var m=new this.ctor");for(var i=0;i<n.length;++i){var r=n[i].resolve(),o=d.safeProp(r.name);r.map?(e("if(d%s){",o)('if(typeof d%s!=="object")',o)("throw TypeError(%j)",r.fullName+": object expected")("m%s={}",o)("for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){",o),s(e,r,i,o+"[ks[i]]")("}")("}")):r.repeated?(e("if(d%s){",o)("if(!Array.isArray(d%s))",o)("throw TypeError(%j)",r.fullName+": array expected")("m%s=[]",o)("for(var i=0;i<d%s.length;++i){",o),s(e,r,i,o+"[i]")("}")("}")):(r.resolvedType instanceof l||e("if(d%s!=null){",o),s(e,r,i,o),r.resolvedType instanceof l||e("}"))}return e("return m")},n.toObject=function(t){var n=t.fieldsArray.slice().sort(d.compareFieldsById);if(!n.length)return d.codegen()("return {}");for(var e=d.codegen(["m","o"],t.name+"$toObject")("if(!o)")("o={}")("var d={}"),i=[],r=[],o=[],s=0;s<n.length;++s)n[s].partOf||(n[s].resolve().repeated?i:n[s].map?r:o).push(n[s]);if(i.length){for(e("if(o.arrays||o.defaults){"),s=0;s<i.length;++s)e("d%s=[]",d.safeProp(i[s].name));e("}")}if(r.length){for(e("if(o.objects||o.defaults){"),s=0;s<r.length;++s)e("d%s={}",d.safeProp(r[s].name));e("}")}if(o.length){for(e("if(o.defaults){"),s=0;s<o.length;++s){var a,u=o[s],h=d.safeProp(u.name);u.resolvedType instanceof l?e("d%s=o.enums===String?%j:%j",h,u.resolvedType.valuesById[u.typeDefault],u.typeDefault):u.long?e("if(util.Long){")("var n=new util.Long(%i,%i,%j)",u.typeDefault.low,u.typeDefault.high,u.typeDefault.unsigned)("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n",h)("}else")("d%s=o.longs===String?%j:%i",h,u.typeDefault.toString(),u.typeDefault.toNumber()):u.bytes?(a="["+Array.prototype.slice.call(u.typeDefault).join(",")+"]",e("if(o.bytes===String)d%s=%j",h,String.fromCharCode.apply(String,u.typeDefault))("else{")("d%s=%s",h,a)("if(o.bytes!==Array)d%s=util.newBuffer(d%s)",h,h)("}")):e("d%s=%j",h,u.typeDefault)}e("}")}for(var c=!1,s=0;s<n.length;++s){var u=n[s],f=t.k.indexOf(u),h=d.safeProp(u.name);u.map?(c||(c=!0,e("var ks2")),e("if(m%s&&(ks2=Object.keys(m%s)).length){",h,h)("d%s={}",h)("for(var j=0;j<ks2.length;++j){"),v(e,u,f,h+"[ks2[j]]")("}")):u.repeated?(e("if(m%s&&m%s.length){",h,h)("d%s=[]",h)("for(var j=0;j<m%s.length;++j){",h),v(e,u,f,h+"[j]")("}")):(e("if(m%s!=null&&m.hasOwnProperty(%j)){",h,u.name),v(e,u,f,h),u.partOf&&e("if(o.oneofs)")("d%s=%j",d.safeProp(u.partOf.name),u.name)),e("}")}return e("return d")}},function(t,n,e){"use strict";var n=n,o=e(11);n[".google.protobuf.Any"]={fromObject:function(t){if(t&&t["@type"]){var n=t["@type"].substring(t["@type"].lastIndexOf("/")+1),e=this.lookup(n);if(e){n="."===t["@type"].charAt(0)?t["@type"].substr(1):t["@type"];return-1===n.indexOf("/")&&(n="/"+n),this.create({type_url:n,value:e.encode(e.fromObject(t)).finish()})}}return this.fromObject(t)},toObject:function(t,n){var e,i="",r="";if(n&&n.json&&t.type_url&&t.value&&(r=t.type_url.substring(t.type_url.lastIndexOf("/")+1),i=t.type_url.substring(0,t.type_url.lastIndexOf("/")+1),(e=this.lookup(r))&&(t=e.decode(t.value))),t instanceof this.ctor||!(t instanceof o))return this.toObject(t,n);n=t.$type.toObject(t,n),t="."===t.$type.fullName[0]?t.$type.fullName.substr(1):t.$type.fullName;return n["@type"]=r=(i=""===i?"type.googleapis.com/":i)+t,n}}},function(t,n,e){"use strict";t.exports=u;var i=e(6);((u.prototype=Object.create(i.prototype)).constructor=u).className="Root";var r,d,v,o=e(5),s=e(3),a=e(10),p=e(0);function u(t){i.call(this,"",t),this.deferred=[],this.files=[]}function m(){}u.fromJSON=function(t,n){return n=n||new u,t.options&&n.setOptions(t.options),n.addJSON(t.nested)},u.prototype.resolvePath=p.path.resolve,u.prototype.fetch=p.fetch,u.prototype.load=function t(n,o,r){"function"==typeof o&&(r=o,o=void 0);var s=this;if(!r)return p.asPromise(t,s,n,o);var a=r===m;function u(t,n){if(r){var e=r;if(r=null,a)throw t;e(t,n)}}function h(t){var n=t.lastIndexOf("google/protobuf/");if(-1<n){n=t.substring(n);if(n in v)return n}return null}function c(t,n){try{if(p.isString(n)&&"{"===n.charAt(0)&&(n=JSON.parse(n)),p.isString(n)){d.filename=t;var e,i=d(n,s,o),r=0;if(i.imports)for(;r<i.imports.length;++r)(e=h(i.imports[r])||s.resolvePath(t,i.imports[r]))&&f(e);if(i.weakImports)for(r=0;r<i.weakImports.length;++r)(e=h(i.weakImports[r])||s.resolvePath(t,i.weakImports[r]))&&f(e,!0)}else s.setOptions(n.options).addJSON(n.nested)}catch(t){u(t)}a||l||u(null,s)}function f(e,i){if(!(-1<s.files.indexOf(e)))if(s.files.push(e),e in v)a?c(e,v[e]):(++l,setTimeout(function(){--l,c(e,v[e])}));else if(a){var t;try{t=p.fs.readFileSync(e).toString("utf8")}catch(t){return void(i||u(t))}c(e,t)}else++l,s.fetch(e,function(t,n){--l,r&&(t?i?l||u(null,s):u(t):c(e,n))})}var l=0;p.isString(n)&&(n=[n]);for(var e,i=0;i<n.length;++i)(e=s.resolvePath("",n[i]))&&f(e);if(a)return s;l||u(null,s)},u.prototype.loadSync=function(t,n){if(!p.isNode)throw Error("not supported");return this.load(t,n,m)},u.prototype.resolveAll=function(){if(this.deferred.length)throw Error("unresolvable extensions: "+this.deferred.map(function(t){return"'extend "+t.extend+"' in "+t.parent.fullName}).join(", "));return i.prototype.resolveAll.call(this)};var h=/^[A-Z]/;function c(t,n){var e=n.parent.lookup(n.extend);if(e){var i=new o(n.fullName,n.id,n.type,n.rule,void 0,n.options);return(i.declaringField=n).extensionField=i,e.add(i),1}}u.prototype.S=function(t){if(t instanceof o)void 0===t.extend||t.extensionField||c(0,t)||this.deferred.push(t);else if(t instanceof s)h.test(t.name)&&(t.parent[t.name]=t.values);else if(!(t instanceof a)){if(t instanceof r)for(var n=0;n<this.deferred.length;)c(0,this.deferred[n])?this.deferred.splice(n,1):++n;for(var e=0;e<t.nestedArray.length;++e)this.S(t.R[e]);h.test(t.name)&&(t.parent[t.name]=t)}},u.prototype.T=function(t){var n;if(t instanceof o)void 0!==t.extend&&(t.extensionField?(t.extensionField.parent.remove(t.extensionField),t.extensionField=null):-1<(n=this.deferred.indexOf(t))&&this.deferred.splice(n,1));else if(t instanceof s)h.test(t.name)&&delete t.parent[t.name];else if(t instanceof i){for(var e=0;e<t.nestedArray.length;++e)this.T(t.R[e]);h.test(t.name)&&delete t.parent[t.name]}},u.M=function(t,n,e){r=t,d=n,v=e}},function(t,n,e){"use strict";t.exports=e(29)},function(t,n,e){var i;void 0===(i="function"==typeof(i=function(){var c=function t(n){return n.reduce(function(t,n){return t*2+n},0)},f=function t(n){var e=[];for(var i=7;i>=0;i--)e.push(!!(n&1<<i));return e},nt=function t(n){this.data=n;this.len=this.data.length;this.pos=0;this.readByte=function(){if(this.pos>=this.data.length)throw new Error("Attempted to read past end of stream.");if(n instanceof Uint8Array)return n[this.pos++];else return n.charCodeAt(this.pos++)&255};this.readBytes=function(t){var n=[];for(var e=0;e<t;e++)n.push(this.readByte());return n};this.read=function(t){var n="";for(var e=0;e<t;e++)n+=String.fromCharCode(this.readByte());return n};this.readUnsigned=function(){var t=this.readBytes(2);return(t[1]<<8)+t[0]}},l=function t(e,r){var o=0;var n=function t(n){var e=0;for(var i=0;i<n;i++){if(r.charCodeAt(o>>3)&1<<(o&7))e|=1<<i;o++}return e};var i=[];var s=1<<e;var a=s+1;var u=e+1;var h=[];var c=function t(){h=[];u=e+1;for(var n=0;n<s;n++)h[n]=[n];h[s]=[];h[a]=null};var f;var l;while(true){l=f;f=n(u);if(f===s){c();continue}if(f===a)break;if(f<h.length){if(l!==s)h.push(h[l].concat(h[f][0]))}else{if(f!==h.length)throw new Error("Invalid LZW code.");h.push(h[l].concat(h[l][0]))}i.push.apply(i,h[f]);if(h.length===1<<u&&u<12)u++}return i},et=function t(a,u){u||(u={});var o=function t(n){var e=[];for(var i=0;i<n;i++)e.push(a.readBytes(3));return e};var h=function t(){var n,e;e="";do{n=a.readByte();e+=a.read(n)}while(n!==0);return e};var n=function t(){var n={};n.sig=a.read(3);n.ver=a.read(3);if(n.sig!=="GIF")throw new Error("Not a GIF file.");n.width=a.readUnsigned();n.height=a.readUnsigned();var e=f(a.readByte());n.gctFlag=e.shift();n.colorRes=c(e.splice(0,3));n.sorted=e.shift();n.gctSize=c(e.splice(0,3));n.bgColor=a.readByte();n.pixelAspectRatio=a.readByte();if(n.gctFlag)n.gct=o(1<<n.gctSize+1);u.hdr&&u.hdr(n)};var e=function t(n){var e=function t(n){var e=a.readByte();var i=f(a.readByte());n.reserved=i.splice(0,3);n.disposalMethod=c(i.splice(0,3));n.userInput=i.shift();n.transparencyGiven=i.shift();n.delayTime=a.readUnsigned();n.transparencyIndex=a.readByte();n.terminator=a.readByte();u.gce&&u.gce(n)};var i=function t(n){n.comment=h();u.com&&u.com(n)};var r=function t(n){var e=a.readByte();n.ptHeader=a.readBytes(12);n.ptData=h();u.pte&&u.pte(n)};var o=function t(n){var e=function t(n){var e=a.readByte();n.unknown=a.readByte();n.iterations=a.readUnsigned();n.terminator=a.readByte();u.app&&u.app.NETSCAPE&&u.app.NETSCAPE(n)};var i=function t(n){n.appData=h();u.app&&u.app[n.identifier]&&u.app[n.identifier](n)};var r=a.readByte();n.identifier=a.read(8);n.authCode=a.read(3);switch(n.identifier){case"NETSCAPE":e(n);break;default:i(n);break}};var s=function t(n){n.data=h();u.unknown&&u.unknown(n)};n.label=a.readByte();switch(n.label){case 249:n.extType="gce";e(n);break;case 254:n.extType="com";i(n);break;case 1:n.extType="pte";r(n);break;case 255:n.extType="app";o(n);break;default:n.extType="unknown";s(n);break}};var i=function t(n){var e=function t(r,o){var s=new Array(r.length);var n=r.length/o;var e=function t(n,e){var i=r.slice(e*o,(e+1)*o);s.splice.apply(s,[n*o,o].concat(i))};var i=[0,4,2,1];var a=[8,8,4,2];var u=0;for(var h=0;h<4;h++)for(var c=i[h];c<n;c+=a[h]){e(c,u);u++}return s};n.leftPos=a.readUnsigned();n.topPos=a.readUnsigned();n.width=a.readUnsigned();n.height=a.readUnsigned();var i=f(a.readByte());n.lctFlag=i.shift();n.interlaced=i.shift();n.sorted=i.shift();n.reserved=i.splice(0,2);n.lctSize=c(i.splice(0,3));if(n.lctFlag)n.lct=o(1<<n.lctSize+1);n.lzwMinCodeSize=a.readByte();var r=h();n.pixels=l(n.lzwMinCodeSize,r);if(n.interlaced)n.pixels=e(n.pixels,n.width);u.img&&u.img(n)};var r=function t(){var n={};n.sentinel=a.readByte();switch(String.fromCharCode(n.sentinel)){case"!":n.type="ext";e(n);break;case",":n.type="img";i(n);break;case";":n.type="eof";u.eof&&u.eof(n);break;default:throw new Error("Unknown block: 0x"+n.sentinel.toString(16))}if(n.type!=="eof")setTimeout(t,0)};var s=function t(){n();setTimeout(r,0)};s()},t;return function t(n){var d={vp_l:0,vp_t:0,vp_w:null,vp_h:null,c_w:null,c_h:null};for(var e in n)d[e]=n[e];if(d.vp_w&&d.vp_h)d.is_vp=true;var r;var o;var c=null;var i=false;var s=null;var a=null;var u=null;var h=null;var f=null;var l=null;var v=null;var p=true;var m=true;var g=false;var y=[];var b=[];var w=d.gif;if(typeof d.auto_play=="undefined")d.auto_play=!w.getAttribute("rel:auto_play")||w.getAttribute("rel:auto_play")=="1";var _=d.hasOwnProperty("on_end")?d.on_end:null;var x=d.hasOwnProperty("loop_delay")?d.loop_delay:0;var M=d.hasOwnProperty("loop_mode")?d.loop_mode:"auto";var S=d.hasOwnProperty("draw_while_loading")?d.draw_while_loading:true;var E=S?d.hasOwnProperty("show_progress_bar")?d.show_progress_bar:true:false;var T=d.hasOwnProperty("progressbar_height")?d.progressbar_height:25;var L=d.hasOwnProperty("progressbar_background_color")?d.progressbar_background_color:"rgba(255,255,255,0.4)";var R=d.hasOwnProperty("progressbar_foreground_color")?d.progressbar_foreground_color:"rgba(255,0,22,.8)";var O=function t(){s=null;a=null;f=u;u=null;l=null};var A=function t(){try{et(r,z)}catch(t){D("parse")}};var k=function t(n){q.innerHTML=n;q.style.visibility="visible"};var C=function t(n,e){Z.width=n*X();Z.height=e*X();q.style.minWidth=n*X()+"px";K.width=n;K.height=e;K.style.width=n+"px";K.style.height=e+"px";K.getContext("2d").setTransform(1,0,0,1,0,0)};var j=function t(n,e){if(!b[n]){b[n]=e;return}if(typeof e.x!=="undefined")b[n].x=e.x;if(typeof e.y!=="undefined")b[n].y=e.y};var P=function t(n,e,i){if(i&&E){var r=T;var o,s,a,u;if(d.is_vp){if(!g){a=d.vp_t+d.vp_h-r;r=r;o=d.vp_l;s=o+n/e*d.vp_w;u=Z.width}else{a=(d.vp_t+d.vp_h-r)/X();r=r/X();o=d.vp_l/X();s=o+n/e*(d.vp_w/X());u=Z.width/X()}if(false)var h,c,f,l}else{a=(Z.height-r)/(g?X():1);s=n/e*Z.width/(g?X():1);u=Z.width/(g?X():1);r/=g?X():1}Y.fillStyle=L;Y.fillRect(s,a,u-s,r);Y.fillStyle=R;Y.fillRect(0,a,s,r)}};var D=function t(n){var e=function t(){Y.fillStyle="black";Y.fillRect(0,0,d.c_w?d.c_w:o.width,d.c_h?d.c_h:o.height);Y.strokeStyle="red";Y.lineWidth=3;Y.moveTo(0,0);Y.lineTo(d.c_w?d.c_w:o.width,d.c_h?d.c_h:o.height);Y.moveTo(0,d.c_h?d.c_h:o.height);Y.lineTo(d.c_w?d.c_w:o.width,0);Y.stroke()};c=n;o={width:w.width,height:w.height};y=[];e()};var I=function t(n){o=n;C(o.width,o.height)};var N=function t(n){F();O();s=n.transparencyGiven?n.transparencyIndex:null;a=n.delayTime;u=n.disposalMethod};var F=function t(){if(!l)return;y.push({data:l.getImageData(0,0,o.width,o.height),delay:a});b.push({x:0,y:0})};var U=function t(n){if(!l)l=K.getContext("2d");var e=y.length;var i=n.lctFlag?n.lct:o.gct;if(e>0){if(f===3)if(h!==null)l.putImageData(y[h].data,0,0);else l.clearRect(v.leftPos,v.topPos,v.width,v.height);else h=e-1;if(f===2)l.clearRect(v.leftPos,v.topPos,v.width,v.height)}var r=l.getImageData(n.leftPos,n.topPos,n.width,n.height);n.pixels.forEach(function(t,n){if(t!==s){r.data[n*4+0]=i[t][0];r.data[n*4+1]=i[t][1];r.data[n*4+2]=i[t][2];r.data[n*4+3]=255}});l.putImageData(r,n.leftPos,n.topPos);if(!g){Y.scale(X(),X());g=true}if(S){Y.drawImage(K,0,0);S=d.auto_play}v=n};var B=function(){var o=-1;var e=0;var t=false;var n=false;var s=function t(){var n=m?1:-1;return(o+n+y.length)%y.length};var a=function t(n){o=o+n;r()};var i=function(){var i=false;var r=function t(){if(_!==null)_(w);e++;if(M!==false||e<0)n();else{i=false;p=false}};var n=function t(){i=p;if(!i)return;a(1);var n=y[o].delay*10;if(!n)n=100;var e=s();if(e===0){n+=x;setTimeout(r,n)}else setTimeout(t,n)};return function(){if(!i)setTimeout(n,0)}}();var r=function t(){var n;o=parseInt(o,10);if(o>y.length-1)o=0;if(o<0)o=0;n=b[o];K.getContext("2d").putImageData(y[o].data,n.x,n.y);Y.globalCompositeOperation="copy";Y.drawImage(K,0,0)};var u=function t(){p=true;i()};var h=function t(){p=false};return{init:function t(){if(c)return;if(!(d.c_w&&d.c_h))Y.scale(X(),X());if(d.auto_play)i();else{o=0;r()}},step:i,play:u,pause:h,playing:p,move_relative:a,current_frame:function t(){return o},length:function t(){return y.length},move_to:function t(n){o=n;r()}}}();var G=function t(n){P(r.pos,r.data.length,n)};var H=function t(){};var V=function t(n,e){return function(t){n(t);G(e)}};var z={hdr:V(I),gce:V(N),com:V(H),app:{NETSCAPE:V(H)},img:V(U,true),eof:function t(n){F();G(false);if(!(d.c_w&&d.c_h)){Z.width=o.width*X();Z.height=o.height*X()}B.init();i=false;if(Q)Q(w)}};var W=function t(){var n=w.parentNode;var e=document.createElement("div");Z=document.createElement("canvas");Y=Z.getContext("2d");q=document.createElement("div");K=document.createElement("canvas");e.width=Z.width=w.width;e.height=Z.height=w.height;q.style.minWidth=w.width+"px";e.className="jsgif";q.className="jsgif_toolbar";e.appendChild(Z);e.appendChild(q);n.insertBefore(e,w);n.removeChild(w);if(d.c_w&&d.c_h)C(d.c_w,d.c_h);J=true};var X=function t(){var n;if(d.max_width&&o&&o.width>d.max_width)n=d.max_width/o.width;else n=1;return n};var Z,Y,q,K;var J=false;var Q=false;var $=function t(n){if(i)return false;if(n)Q=n;else Q=false;i=true;y=[];O();h=null;f=null;l=null;v=null;return true};var tt=function t(){return y.reduce(function(t,n){return t+n.delay},0)};return{play:B.play,pause:B.pause,move_relative:B.move_relative,move_to:B.move_to,get_playing:function t(){return p},get_canvas:function t(){return Z},get_canvas_scale:function t(){return X()},get_loading:function t(){return i},get_auto_play:function t(){return d.auto_play},get_length:function t(){return B.length()},get_frames:function t(){return y},get_duration:function t(){return tt()},get_duration_ms:function t(){return tt()*10},get_current_frame:function t(){return B.current_frame()},load_url:function t(n,e){if(!$(e))return;var i=new XMLHttpRequest;i.open("GET",n,true);if("overrideMimeType"in i)i.overrideMimeType("text/plain; charset=x-user-defined");else if("responseType"in i)i.responseType="arraybuffer";else i.setRequestHeader("Accept-Charset","x-user-defined");i.onloadstart=function(){if(!J)W()};i.onload=function(t){if(this.status!=200)D("xhr - response");if(!("response"in this))this.response=new VBArray(this.responseText).toArray().map(String.fromCharCode).join("");var n=this.response;if(n.toString().indexOf("ArrayBuffer")>0)n=new Uint8Array(n);r=new nt(n);setTimeout(A,0)};i.onprogress=function(t){if(t.lengthComputable)P(t.loaded,t.total,true)};i.onerror=function(){D("xhr")};i.send()},load:function t(n){this.load_url(w.getAttribute("rel:animated_src")||w.src,n)},load_raw:function t(n,e){if(!$(e))return;if(!J)W();r=new nt(n);setTimeout(A,0)},set_frame_offset:j}}})?i.apply(n,[]):i)||(t.exports=i)},function(t,n,e){"use strict";var i=t.exports=e(30);i.build="light",i.load=function(t,n,e){return(n="function"==typeof n?(e=n,new i.Root):n||new i.Root).load(t,e)},i.loadSync=function(t,n){return(n=n||new i.Root).loadSync(t)},i.encoder=e(17),i.decoder=e(22),i.verifier=e(23),i.converter=e(24),i.ReflectionObject=e(4),i.Namespace=e(6),i.Root=e(26),i.Enum=e(3),i.Type=e(18),i.Field=e(5),i.OneOf=e(10),i.MapField=e(19),i.Service=e(20),i.Method=e(21),i.Message=e(11),i.wrappers=e(25),i.types=e(7),i.util=e(0),i.ReflectionObject.M(i.Root),i.Namespace.M(i.Type,i.Service,i.Enum),i.Root.M(i.Type),i.Field.M(i.Type)},function(t,n,e){"use strict";var i=n;function r(){i.util.M(),i.Writer.M(i.BufferWriter),i.Reader.M(i.BufferReader)}i.build="minimal",i.Writer=e(8),i.BufferWriter=e(37),i.Reader=e(9),i.BufferReader=e(38),i.util=e(2),i.rpc=e(15),i.roots=e(16),i.configure=r,r()},function(t,n,e){"use strict";n.length=function(t){var n=t.length;if(!n)return 0;for(var e=0;1<--n%4&&"="===t.charAt(n);)++e;return Math.ceil(3*t.length)/4-e};for(var h=new Array(64),u=new Array(123),i=0;i<64;)u[h[i]=i<26?i+65:i<52?i+71:i<62?i-4:i-59|43]=i++;n.encode=function(t,n,e){for(var i,r=null,o=[],s=0,a=0;n<e;){var u=t[n++];switch(a){case 0:o[s++]=h[u>>2],i=(3&u)<<4,a=1;break;case 1:o[s++]=h[i|u>>4],i=(15&u)<<2,a=2;break;case 2:o[s++]=h[i|u>>6],o[s++]=h[63&u],a=0}8191<s&&((r=r||[]).push(String.fromCharCode.apply(String,o)),s=0)}return a&&(o[s++]=h[i],o[s++]=61,1===a&&(o[s++]=61)),r?(s&&r.push(String.fromCharCode.apply(String,o.slice(0,s))),r.join("")):String.fromCharCode.apply(String,o.slice(0,s))};var c="invalid encoding";n.decode=function(t,n,e){for(var i,r=e,o=0,s=0;s<t.length;){var a=t.charCodeAt(s++);if(61===a&&1<o)break;if(void 0===(a=u[a]))throw Error(c);switch(o){case 0:i=a,o=1;break;case 1:n[e++]=i<<2|(48&a)>>4,i=a,o=2;break;case 2:n[e++]=(15&i)<<4|(60&a)>>2,i=a,o=3;break;case 3:n[e++]=(3&i)<<6|a,o=0}}if(1===o)throw Error(c);return e-r},n.test=function(t){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t)}},function(t,n,e){"use strict";function i(){this.I={}}(t.exports=i).prototype.on=function(t,n,e){return(this.I[t]||(this.I[t]=[])).push({fn:n,ctx:e||this}),this},i.prototype.off=function(t,n){if(void 0===t)this.I={};else if(void 0===n)this.I[t]=[];else for(var e=this.I[t],i=0;i<e.length;)e[i].fn===n?e.splice(i,1):++i;return this},i.prototype.emit=function(t){var n=this.I[t];if(n){for(var e=[],i=1;i<arguments.length;)e.push(arguments[i++]);for(i=0;i<n.length;)n[i].fn.apply(n[i++].ctx,e)}return this}},function(t,n,e){"use strict";function i(t){function n(t,n,e,i){var r=n<0?1:0;0===(n=r?-n:n)?t(0<1/n?0:2147483648,e,i):isNaN(n)?t(2143289344,e,i):t(34028234663852886e22<n?(r<<31|2139095040)>>>0:n<11754943508222875e-54?(r<<31|Math.round(n/1401298464324817e-60))>>>0:(r<<31|(r=Math.floor(Math.log(n)/Math.LN2))+127<<23|8388607&Math.round(n*Math.pow(2,-r)*8388608))>>>0,e,i)}function e(t,n,e){t=t(n,e),n=2*(t>>31)+1,e=t>>>23&255,t&=8388607;return 255==e?t?NaN:1/0*n:0==e?1401298464324817e-60*n*t:n*Math.pow(2,e-150)*(8388608+t)}function i(t,n,e){a[0]=t,n[e]=u[0],n[e+1]=u[1],n[e+2]=u[2],n[e+3]=u[3]}function r(t,n,e){a[0]=t,n[e]=u[3],n[e+1]=u[2],n[e+2]=u[1],n[e+3]=u[0]}function o(t,n){return u[0]=t[n],u[1]=t[n+1],u[2]=t[n+2],u[3]=t[n+3],a[0]}function s(t,n){return u[3]=t[n],u[2]=t[n+1],u[1]=t[n+2],u[0]=t[n+3],a[0]}var a,u,h,c,f;function l(t,n,e,i,r,o){var s,a,u=i<0?1:0;0===(i=u?-i:i)?(t(0,r,o+n),t(0<1/i?0:2147483648,r,o+e)):isNaN(i)?(t(0,r,o+n),t(2146959360,r,o+e)):17976931348623157e292<i?(t(0,r,o+n),t((u<<31|2146435072)>>>0,r,o+e)):i<22250738585072014e-324?(t((s=i/5e-324)>>>0,r,o+n),t((u<<31|s/4294967296)>>>0,r,o+e)):(1024===(a=Math.floor(Math.log(i)/Math.LN2))&&(a=1023),t(4503599627370496*(s=i*Math.pow(2,-a))>>>0,r,o+n),t((u<<31|a+1023<<20|1048576*s&1048575)>>>0,r,o+e))}function d(t,n,e,i,r){n=t(i,r+n),i=t(i,r+e),r=2*(i>>31)+1,e=i>>>20&2047,n=4294967296*(1048575&i)+n;return 2047==e?n?NaN:1/0*r:0==e?5e-324*r*n:r*Math.pow(2,e-1075)*(n+4503599627370496)}function v(t,n,e){h[0]=t,n[e]=c[0],n[e+1]=c[1],n[e+2]=c[2],n[e+3]=c[3],n[e+4]=c[4],n[e+5]=c[5],n[e+6]=c[6],n[e+7]=c[7]}function p(t,n,e){h[0]=t,n[e]=c[7],n[e+1]=c[6],n[e+2]=c[5],n[e+3]=c[4],n[e+4]=c[3],n[e+5]=c[2],n[e+6]=c[1],n[e+7]=c[0]}function m(t,n){return c[0]=t[n],c[1]=t[n+1],c[2]=t[n+2],c[3]=t[n+3],c[4]=t[n+4],c[5]=t[n+5],c[6]=t[n+6],c[7]=t[n+7],h[0]}function g(t,n){return c[7]=t[n],c[6]=t[n+1],c[5]=t[n+2],c[4]=t[n+3],c[3]=t[n+4],c[2]=t[n+5],c[1]=t[n+6],c[0]=t[n+7],h[0]}return"undefined"!=typeof Float32Array?(a=new Float32Array([-0]),u=new Uint8Array(a.buffer),f=128===u[3],t.writeFloatLE=f?i:r,t.writeFloatBE=f?r:i,t.readFloatLE=f?o:s,t.readFloatBE=f?s:o):(t.writeFloatLE=n.bind(null,y),t.writeFloatBE=n.bind(null,b),t.readFloatLE=e.bind(null,w),t.readFloatBE=e.bind(null,_)),"undefined"!=typeof Float64Array?(h=new Float64Array([-0]),c=new Uint8Array(h.buffer),f=128===c[7],t.writeDoubleLE=f?v:p,t.writeDoubleBE=f?p:v,t.readDoubleLE=f?m:g,t.readDoubleBE=f?g:m):(t.writeDoubleLE=l.bind(null,y,0,4),t.writeDoubleBE=l.bind(null,b,4,0),t.readDoubleLE=d.bind(null,w,0,4),t.readDoubleBE=d.bind(null,_,4,0)),t}function y(t,n,e){n[e]=255&t,n[e+1]=t>>>8&255,n[e+2]=t>>>16&255,n[e+3]=t>>>24}function b(t,n,e){n[e]=t>>>24,n[e+1]=t>>>16&255,n[e+2]=t>>>8&255,n[e+3]=255&t}function w(t,n){return(t[n]|t[n+1]<<8|t[n+2]<<16|t[n+3]<<24)>>>0}function _(t,n){return(t[n]<<24|t[n+1]<<16|t[n+2]<<8|t[n+3])>>>0}t.exports=i(i)},function(t,n,e){"use strict";n.length=function(t){for(var n,e=0,i=0;i<t.length;++i)(n=t.charCodeAt(i))<128?e+=1:n<2048?e+=2:55296==(64512&n)&&56320==(64512&t.charCodeAt(i+1))?(++i,e+=4):e+=3;return e},n.read=function(t,n,e){if(e-n<1)return"";for(var i,r=null,o=[],s=0;n<e;)(i=t[n++])<128?o[s++]=i:191<i&&i<224?o[s++]=(31&i)<<6|63&t[n++]:239<i&&i<365?(i=((7&i)<<18|(63&t[n++])<<12|(63&t[n++])<<6|63&t[n++])-65536,o[s++]=55296+(i>>10),o[s++]=56320+(1023&i)):o[s++]=(15&i)<<12|(63&t[n++])<<6|63&t[n++],8191<s&&((r=r||[]).push(String.fromCharCode.apply(String,o)),s=0);return r?(s&&r.push(String.fromCharCode.apply(String,o.slice(0,s))),r.join("")):String.fromCharCode.apply(String,o.slice(0,s))},n.write=function(t,n,e){for(var i,r,o=e,s=0;s<t.length;++s)(i=t.charCodeAt(s))<128?n[e++]=i:(i<2048?n[e++]=i>>6|192:(55296==(64512&i)&&56320==(64512&(r=t.charCodeAt(s+1)))?(++s,n[e++]=(i=65536+((1023&i)<<10)+(1023&r))>>18|240,n[e++]=i>>12&63|128):n[e++]=i>>12|224,n[e++]=i>>6&63|128),n[e++]=63&i|128);return e-o}},function(t,n,e){"use strict";t.exports=function(n,e,t){var i=t||8192,r=i>>>1,o=null,s=i;return function(t){if(t<1||r<t)return n(t);i<s+t&&(o=n(i),s=0);t=e.call(o,s,s+=t);return 7&s&&(s=1+(7|s)),t}}},function(t,n,e){"use strict";t.exports=r;var i=e(2);function r(t,n){this.lo=t>>>0,this.hi=n>>>0}var o=r.zero=new r(0,0);o.toNumber=function(){return 0},o.zzEncode=o.zzDecode=function(){return this},o.length=function(){return 1};r.zeroHash="\0\0\0\0\0\0\0\0";r.fromNumber=function(t){if(0===t)return o;var n=t<0,e=(t=n?-t:t)>>>0,t=(t-e)/4294967296>>>0;return n&&(t=~t>>>0,e=~e>>>0,4294967295<++e&&(e=0,4294967295<++t&&(t=0))),new r(e,t)},r.from=function(t){if("number"==typeof t)return r.fromNumber(t);if(i.isString(t)){if(!i.Long)return r.fromNumber(parseInt(t,10));t=i.Long.fromString(t)}return t.low||t.high?new r(t.low>>>0,t.high>>>0):o},r.prototype.toNumber=function(t){if(!t&&this.hi>>>31){var n=1+~this.lo>>>0,t=~this.hi>>>0;return-(n+4294967296*(t=!n?t+1>>>0:t))}return this.lo+4294967296*this.hi},r.prototype.toLong=function(t){return i.Long?new i.Long(0|this.lo,0|this.hi,Boolean(t)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(t)}};var s=String.prototype.charCodeAt;r.fromHash=function(t){return"\0\0\0\0\0\0\0\0"===t?o:new r((s.call(t,0)|s.call(t,1)<<8|s.call(t,2)<<16|s.call(t,3)<<24)>>>0,(s.call(t,4)|s.call(t,5)<<8|s.call(t,6)<<16|s.call(t,7)<<24)>>>0)},r.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},r.prototype.zzEncode=function(){var t=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^t)>>>0,this.lo=(this.lo<<1^t)>>>0,this},r.prototype.zzDecode=function(){var t=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^t)>>>0,this.hi=(this.hi>>>1^t)>>>0,this},r.prototype.length=function(){var t=this.lo,n=(this.lo>>>28|this.hi<<4)>>>0,e=this.hi>>>24;return 0==e?0==n?t<16384?t<128?1:2:t<2097152?3:4:n<16384?n<128?5:6:n<2097152?7:8:e<128?9:10}},function(t,n,e){"use strict";t.exports=o;var i=e(8);(o.prototype=Object.create(i.prototype)).constructor=o;var r=e(2);function o(){i.call(this)}function s(t,n,e){t.length<40?r.utf8.write(t,n,e):n.utf8Write?n.utf8Write(t,e):n.write(t,e)}o.M=function(){o.alloc=r._,o.writeBytesBuffer=r.Buffer&&r.Buffer.prototype instanceof Uint8Array&&"set"===r.Buffer.prototype.set.name?function(t,n,e){n.set(t,e)}:function(t,n,e){if(t.copy)t.copy(n,e,0,t.length);else for(var i=0;i<t.length;)n[e++]=t[i++]}},o.prototype.bytes=function(t){var n=(t=r.isString(t)?r.u(t,"base64"):t).length>>>0;return this.uint32(n),n&&this.O(o.writeBytesBuffer,n,t),this},o.prototype.string=function(t){var n=r.Buffer.byteLength(t);return this.uint32(n),n&&this.O(s,n,t),this},o.M()},function(t,n,e){"use strict";t.exports=o;var i=e(9);(o.prototype=Object.create(i.prototype)).constructor=o;var r=e(2);function o(t){i.call(this,t)}o.M=function(){r.Buffer&&(o.prototype.A=r.Buffer.prototype.slice)},o.prototype.string=function(){var t=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+t,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+t,this.len))},o.M()},function(t,n,e){"use strict";t.exports=i;var a=e(2);function i(t,n,e){if("function"!=typeof t)throw TypeError("rpcImpl must be a function");a.EventEmitter.call(this),this.rpcImpl=t,this.requestDelimited=Boolean(n),this.responseDelimited=Boolean(e)}((i.prototype=Object.create(a.EventEmitter.prototype)).constructor=i).prototype.rpcCall=function t(e,n,i,r,o){if(!r)throw TypeError("request must be specified");var s=this;if(!o)return a.asPromise(t,s,e,n,i,r);if(s.rpcImpl)try{return s.rpcImpl(e,n[s.requestDelimited?"encodeDelimited":"encode"](r).finish(),function(t,n){if(t)return s.emit("error",t,e),o(t);if(null!==n){if(!(n instanceof i))try{n=i[s.responseDelimited?"decodeDelimited":"decode"](n)}catch(t){return s.emit("error",t,e),o(t)}return s.emit("data",n,e),o(null,n)}s.end(!0)})}catch(t){return s.emit("error",t,e),void setTimeout(function(){o(t)},0)}else setTimeout(function(){o(Error("already ended"))},0)},i.prototype.end=function(t){return this.rpcImpl&&(t||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},function(t,n,e){"use strict";function i(n,e){"string"==typeof n&&(e=n,n=void 0);var u=[];function h(t){if("string"!=typeof t){var n="return "+(n=c());if(t){for(var e=Object.keys(t),i=new Array(e.length+1),r=new Array(e.length),o=0;o<e.length;)i[o]=e[o],r[o]=t[e[o++]];return i[o]=n,Function.apply(null,i).apply(null,r)}return Function(n)()}for(var s=new Array(arguments.length-1),a=0;a<s.length;)s[a]=arguments[++a];if(a=0,t=t.replace(/%([%dfijs])/g,function(t,n){var e=s[a++];switch(n){case"d":case"f":return String(Number(e));case"i":return String(Math.floor(e));case"j":return JSON.stringify(e);case"s":return String(e)}return"%"}),a!==s.length)throw Error("parameter count mismatch");return u.push(t),h}function c(t){return"function "+(t||e||"")+"("+(n&&n.join(",")||"")+"){\n "+u.join("\n ")+"\n}"}return h.toString=c,h}(t.exports=i).verbose=!1},function(t,n,e){"use strict";t.exports=a;var o=e(13),s=e(14)("fs");function a(e,i,r){return i="function"==typeof i?(r=i,{}):i||{},r?!i.xhr&&s&&s.readFile?s.readFile(e,function(t,n){return t&&"undefined"!=typeof XMLHttpRequest?a.xhr(e,i,r):t?r(t):r(null,i.binary?n:n.toString("utf8"))}):a.xhr(e,i,r):o(a,this,e,i)}a.xhr=function(t,e,i){var r=new XMLHttpRequest;r.onreadystatechange=function(){if(4===r.readyState){if(0!==r.status&&200!==r.status)return i(Error("status "+r.status));if(e.binary){if(!(t=r.response))for(var t=[],n=0;n<r.responseText.length;++n)t.push(255&r.responseText.charCodeAt(n));return i(null,"undefined"!=typeof Uint8Array?new Uint8Array(t):t)}return i(null,r.responseText)}},e.binary&&("overrideMimeType"in r&&r.overrideMimeType("text/plain; charset=x-user-defined"),r.responseType="arraybuffer"),r.open("GET",t),r.send()}},function(t,n,e){"use strict";var n=n,r=n.isAbsolute=function(t){return/^(?:\/|\w+:)/.test(t)},i=n.normalize=function(t){var n=(t=t.replace(/\\/g,"/").replace(/\/{2,}/g,"/")).split("/"),e=r(t),t="";e&&(t=n.shift()+"/");for(var i=0;i<n.length;)".."===n[i]?0<i&&".."!==n[i-1]?n.splice(--i,2):e?n.splice(i,1):++i:"."===n[i]?n.splice(i,1):++i;return t+n.join("/")};n.resolve=function(t,n,e){return e||(n=i(n)),!r(n)&&(t=(t=!e?i(t):t).replace(/(?:\/|^)[^/]+$/,"")).length?i(t+"/"+n):n}},function(t,n,e){"use strict";e.r(n);var u={};e.r(u),e.d(u,"ShadowMaterial",function(){return mf}),e.d(u,"SpriteMaterial",function(){return _c}),e.d(u,"RawShaderMaterial",function(){return Mc}),e.d(u,"ShaderMaterial",function(){return wo}),e.d(u,"PointsMaterial",function(){return gf}),e.d(u,"MeshPhysicalMaterial",function(){return bf}),e.d(u,"MeshStandardMaterial",function(){return yf}),e.d(u,"MeshPhongMaterial",function(){return wf}),e.d(u,"MeshToonMaterial",function(){return _f}),e.d(u,"MeshNormalMaterial",function(){return xf}),e.d(u,"MeshLambertMaterial",function(){return Mf}),e.d(u,"MeshDepthMaterial",function(){return Ba}),e.d(u,"MeshDistanceMaterial",function(){return Ga}),e.d(u,"MeshBasicMaterial",function(){return Co}),e.d(u,"MeshMatcapMaterial",function(){return Sf}),e.d(u,"LineDashedMaterial",function(){return Ef}),e.d(u,"LineBasicMaterial",function(){return xc}),e.d(u,"Material",function(){return vo});for(var a="v3.1.2",h=9,r=[],o=0;o<256;o++)r[o]=(o<16?"0":"")+o.toString(16);var Mt={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){var t=4294967295*Math.random()|0,n=4294967295*Math.random()|0,e=4294967295*Math.random()|0,i=4294967295*Math.random()|0;return(r[255&t]+r[t>>8&255]+r[t>>16&255]+r[t>>24&255]+"-"+r[255&n]+r[n>>8&255]+"-"+r[n>>16&15|64]+r[n>>24&255]+"-"+r[63&e|128]+r[e>>8&255]+"-"+r[e>>16&255]+r[e>>24&255]+r[255&i]+r[i>>8&255]+r[i>>16&255]+r[i>>24&255]).toUpperCase()},clamp:function(t,n,e){return Math.max(n,Math.min(e,t))},euclideanModulo:function(t,n){return(t%n+n)%n},mapLinear:function(t,n,e,i,r){return i+(t-n)*(r-i)/(e-n)},lerp:function(t,n,e){return(1-e)*t+e*n},smoothstep:function(t,n,e){return t<=n?0:e<=t?1:(t=(t-n)/(e-n))*t*(3-2*t)},smootherstep:function(t,n,e){return t<=n?0:e<=t?1:(t=(t-n)/(e-n))*t*t*(t*(6*t-15)+10)},randInt:function(t,n){return t+Math.floor(Math.random()*(n-t+1))},randFloat:function(t,n){return t+Math.random()*(n-t)},randFloatSpread:function(t){return t*(.5-Math.random())},degToRad:function(t){return t*Mt.DEG2RAD},radToDeg:function(t){return t*Mt.RAD2DEG},isPowerOfTwo:function(t){return 0==(t&t-1)&&0!==t},ceilPowerOfTwo:function(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},floorPowerOfTwo:function(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))},setQuaternionFromProperEuler:function(t,n,e,i,r){var o=Math.cos,s=Math.sin,a=o(e/2),u=s(e/2),h=o((n+i)/2),c=s((n+i)/2),f=o((n-i)/2),e=s((n-i)/2),o=o((i-n)/2),n=s((i-n)/2);"XYX"===r?t.set(a*c,u*f,u*e,a*h):"YZY"===r?t.set(u*e,a*c,u*f,a*h):"ZXZ"===r?t.set(u*f,u*e,a*c,a*h):"XZX"===r?t.set(a*c,u*n,u*o,a*h):"YXY"===r?t.set(u*o,a*c,u*n,a*h):"ZYZ"===r?t.set(u*n,u*o,a*c,a*h):console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order.")}};function st(t,n,e,i){this.N=t||0,this.F=n||0,this.U=e||0,this.B=void 0!==i?i:1}Object.assign(st,{slerp:function(t,n,e,i){return e.copy(t).slerp(n,i)},slerpFlat:function(t,n,e,i,r,o,s){var a=e[i+0],u=e[i+1],h=e[i+2],c=e[i+3],f=r[o+0],l=r[o+1],d=r[o+2],v=r[o+3];c===v&&a===f&&u===l&&h===d||(e=1-s,r=0<=(i=a*f+u*l+h*d+c*v)?1:-1,(o=1-i*i)>Number.EPSILON&&(o=Math.sqrt(o),i=Math.atan2(o,i*r),e=Math.sin(e*i)/o,s=Math.sin(s*i)/o),a=a*e+f*(r=s*r),u=u*e+l*r,h=h*e+d*r,c=c*e+v*r,e===1-s&&(a*=s=1/Math.sqrt(a*a+u*u+h*h+c*c),u*=s,h*=s,c*=s)),t[n]=a,t[n+1]=u,t[n+2]=h,t[n+3]=c}}),Object.defineProperties(st.prototype,{x:{get:function(){return this.N},set:function(t){this.N=t,this.G()}},y:{get:function(){return this.F},set:function(t){this.F=t,this.G()}},z:{get:function(){return this.U},set:function(t){this.U=t,this.G()}},w:{get:function(){return this.B},set:function(t){this.B=t,this.G()}}}),Object.assign(st.prototype,{isQuaternion:!0,set:function(t,n,e,i){return this.N=t,this.F=n,this.U=e,this.B=i,this.G(),this},clone:function(){return new this.constructor(this.N,this.F,this.U,this.B)},copy:function(t){return this.N=t.x,this.F=t.y,this.U=t.z,this.B=t.w,this.G(),this},setFromEuler:function(t,n){if(!t||!t.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var e=t.N,i=t.F,r=t.U,o=t.order,s=Math.cos,a=Math.sin,u=s(e/2),t=s(i/2),s=s(r/2),e=a(e/2),i=a(i/2),r=a(r/2);return"XYZ"===o?(this.N=e*t*s+u*i*r,this.F=u*i*s-e*t*r,this.U=u*t*r+e*i*s,this.B=u*t*s-e*i*r):"YXZ"===o?(this.N=e*t*s+u*i*r,this.F=u*i*s-e*t*r,this.U=u*t*r-e*i*s,this.B=u*t*s+e*i*r):"ZXY"===o?(this.N=e*t*s-u*i*r,this.F=u*i*s+e*t*r,this.U=u*t*r+e*i*s,this.B=u*t*s-e*i*r):"ZYX"===o?(this.N=e*t*s-u*i*r,this.F=u*i*s+e*t*r,this.U=u*t*r-e*i*s,this.B=u*t*s+e*i*r):"YZX"===o?(this.N=e*t*s+u*i*r,this.F=u*i*s+e*t*r,this.U=u*t*r-e*i*s,this.B=u*t*s-e*i*r):"XZY"===o&&(this.N=e*t*s-u*i*r,this.F=u*i*s-e*t*r,this.U=u*t*r+e*i*s,this.B=u*t*s+e*i*r),!1!==n&&this.G(),this},setFromAxisAngle:function(t,n){var e=n/2,n=Math.sin(e);return this.N=t.x*n,this.F=t.y*n,this.U=t.z*n,this.B=Math.cos(e),this.G(),this},setFromRotationMatrix:function(t){var n,e=t.elements,i=e[0],r=e[4],o=e[8],s=e[1],a=e[5],u=e[9],h=e[2],c=e[6],t=e[10],e=i+a+t;return 0<e?(n=.5/Math.sqrt(e+1),this.B=.25/n,this.N=(c-u)*n,this.F=(o-h)*n,this.U=(s-r)*n):a<i&&t<i?(n=2*Math.sqrt(1+i-a-t),this.B=(c-u)/n,this.N=.25*n,this.F=(r+s)/n,this.U=(o+h)/n):t<a?(n=2*Math.sqrt(1+a-i-t),this.B=(o-h)/n,this.N=(r+s)/n,this.F=.25*n,this.U=(u+c)/n):(n=2*Math.sqrt(1+t-i-a),this.B=(s-r)/n,this.N=(o+h)/n,this.F=(u+c)/n,this.U=.25*n),this.G(),this},setFromUnitVectors:function(t,n){var e=t.dot(n)+1;return e<1e-6?(e=0,Math.abs(t.x)>Math.abs(t.z)?(this.N=-t.y,this.F=t.x,this.U=0):(this.N=0,this.F=-t.z,this.U=t.y)):(this.N=t.y*n.z-t.z*n.y,this.F=t.z*n.x-t.x*n.z,this.U=t.x*n.y-t.y*n.x),this.B=e,this.normalize()},angleTo:function(t){return 2*Math.acos(Math.abs(Mt.clamp(this.dot(t),-1,1)))},rotateTowards:function(t,n){var e=this.angleTo(t);if(0===e)return this;e=Math.min(1,n/e);return this.slerp(t,e),this},inverse:function(){return this.conjugate()},conjugate:function(){return this.N*=-1,this.F*=-1,this.U*=-1,this.G(),this},dot:function(t){return this.N*t.N+this.F*t.F+this.U*t.U+this.B*t.B},lengthSq:function(){return this.N*this.N+this.F*this.F+this.U*this.U+this.B*this.B},length:function(){return Math.sqrt(this.N*this.N+this.F*this.F+this.U*this.U+this.B*this.B)},normalize:function(){var t=this.length();return 0===t?(this.N=0,this.F=0,this.U=0,this.B=1):(this.N=this.N*(t=1/t),this.F=this.F*t,this.U=this.U*t,this.B=this.B*t),this.G(),this},multiply:function(t,n){return void 0!==n?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(t,n)):this.multiplyQuaternions(this,t)},premultiply:function(t){return this.multiplyQuaternions(t,this)},multiplyQuaternions:function(t,n){var e=t.N,i=t.F,r=t.U,o=t.B,s=n.N,a=n.F,t=n.U,n=n.B;return this.N=e*n+o*s+i*t-r*a,this.F=i*n+o*a+r*s-e*t,this.U=r*n+o*t+e*a-i*s,this.B=o*n-e*s-i*a-r*t,this.G(),this},slerp:function(t,n){if(0===n)return this;if(1===n)return this.copy(t);var e=this.N,i=this.F,r=this.U,o=this.B,s=o*t.B+e*t.N+i*t.F+r*t.U;if(s<0?(this.B=-t.B,this.N=-t.N,this.F=-t.F,this.U=-t.U,s=-s):this.copy(t),1<=s)return this.B=o,this.N=e,this.F=i,this.U=r,this;t=1-s*s;if(t<=Number.EPSILON){var a=1-n;return this.B=a*o+n*this.B,this.N=a*e+n*this.N,this.F=a*i+n*this.F,this.U=a*r+n*this.U,this.normalize(),this.G(),this}a=Math.sqrt(t),t=Math.atan2(a,s),s=Math.sin((1-n)*t)/a,a=Math.sin(n*t)/a;return this.B=o*s+this.B*a,this.N=e*s+this.N*a,this.F=i*s+this.F*a,this.U=r*s+this.U*a,this.G(),this},equals:function(t){return t.N===this.N&&t.F===this.F&&t.U===this.U&&t.B===this.B},fromArray:function(t,n){return this.N=t[n=void 0===n?0:n],this.F=t[n+1],this.U=t[n+2],this.B=t[n+3],this.G(),this},toArray:function(t,n){return(t=void 0===t?[]:t)[n=void 0===n?0:n]=this.N,t[n+1]=this.F,t[n+2]=this.U,t[n+3]=this.B,t},fromBufferAttribute:function(t,n){return this.N=t.getX(n),this.F=t.getY(n),this.U=t.getZ(n),this.B=t.getW(n),this},H:function(t){return this.G=t,this},G:function(){}});var s=new St,c=new st;function St(t,n,e){this.x=t||0,this.y=n||0,this.z=e||0}Object.assign(St.prototype,{isVector3:!0,set:function(t,n,e){return this.x=t,this.y=n,this.z=e,this},setScalar:function(t){return this.x=t,this.y=t,this.z=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setComponent:function(t,n){switch(t){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},add:function(t,n){return void 0!==n?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,n)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this},addVectors:function(t,n){return this.x=t.x+n.x,this.y=t.y+n.y,this.z=t.z+n.z,this},addScaledVector:function(t,n){return this.x+=t.x*n,this.y+=t.y*n,this.z+=t.z*n,this},sub:function(t,n){return void 0!==n?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,n)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this},subVectors:function(t,n){return this.x=t.x-n.x,this.y=t.y-n.y,this.z=t.z-n.z,this},multiply:function(t,n){return void 0!==n?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(t,n)):(this.x*=t.x,this.y*=t.y,this.z*=t.z,this)},multiplyScalar:function(t){return this.x*=t,this.y*=t,this.z*=t,this},multiplyVectors:function(t,n){return this.x=t.x*n.x,this.y=t.y*n.y,this.z=t.z*n.z,this},applyEuler:function(t){return t&&t.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(c.setFromEuler(t))},applyAxisAngle:function(t,n){return this.applyQuaternion(c.setFromAxisAngle(t,n))},applyMatrix3:function(t){var n=this.x,e=this.y,i=this.z,t=t.elements;return this.x=t[0]*n+t[3]*e+t[6]*i,this.y=t[1]*n+t[4]*e+t[7]*i,this.z=t[2]*n+t[5]*e+t[8]*i,this},applyNormalMatrix:function(t){return this.applyMatrix3(t).normalize()},applyMatrix4:function(t){var n=this.x,e=this.y,i=this.z,r=t.elements,t=1/(r[3]*n+r[7]*e+r[11]*i+r[15]);return this.x=(r[0]*n+r[4]*e+r[8]*i+r[12])*t,this.y=(r[1]*n+r[5]*e+r[9]*i+r[13])*t,this.z=(r[2]*n+r[6]*e+r[10]*i+r[14])*t,this},applyQuaternion:function(t){var n=this.x,e=this.y,i=this.z,r=t.x,o=t.y,s=t.z,a=t.w,u=a*n+o*i-s*e,h=a*e+s*n-r*i,t=a*i+r*e-o*n,i=-r*n-o*e-s*i;return this.x=u*a+i*-r+h*-s-t*-o,this.y=h*a+i*-o+t*-r-u*-s,this.z=t*a+i*-s+u*-o-h*-r,this},project:function(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)},unproject:function(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)},transformDirection:function(t){var n=this.x,e=this.y,i=this.z,t=t.elements;return this.x=t[0]*n+t[4]*e+t[8]*i,this.y=t[1]*n+t[5]*e+t[9]*i,this.z=t[2]*n+t[6]*e+t[10]*i,this.normalize()},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this},divideScalar:function(t){return this.multiplyScalar(1/t)},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},clamp:function(t,n){return this.x=Math.max(t.x,Math.min(n.x,this.x)),this.y=Math.max(t.y,Math.min(n.y,this.y)),this.z=Math.max(t.z,Math.min(n.z,this.z)),this},clampScalar:function(t,n){return this.x=Math.max(t,Math.min(n,this.x)),this.y=Math.max(t,Math.min(n,this.y)),this.z=Math.max(t,Math.min(n,this.z)),this},clampLength:function(t,n){var e=this.length();return this.divideScalar(e||1).multiplyScalar(Math.max(t,Math.min(n,e)))},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(t){return this.x*t.x+this.y*t.y+this.z*t.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(t){return this.normalize().multiplyScalar(t)},lerp:function(t,n){return this.x+=(t.x-this.x)*n,this.y+=(t.y-this.y)*n,this.z+=(t.z-this.z)*n,this},lerpVectors:function(t,n,e){return this.subVectors(n,t).multiplyScalar(e).add(t)},cross:function(t,n){return void 0!==n?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(t,n)):this.crossVectors(this,t)},crossVectors:function(t,n){var e=t.x,i=t.y,r=t.z,o=n.x,t=n.y,n=n.z;return this.x=i*n-r*t,this.y=r*o-e*n,this.z=e*t-i*o,this},projectOnVector:function(t){var n=t.lengthSq();if(0===n)return this.set(0,0,0);n=t.dot(this)/n;return this.copy(t).multiplyScalar(n)},projectOnPlane:function(t){return s.copy(this).projectOnVector(t),this.sub(s)},reflect:function(t){return this.sub(s.copy(t).multiplyScalar(2*this.dot(t)))},angleTo:function(t){var n=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===n)return Math.PI/2;n=this.dot(t)/n;return Math.acos(Mt.clamp(n,-1,1))},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var n=this.x-t.x,e=this.y-t.y,t=this.z-t.z;return n*n+e*e+t*t},manhattanDistanceTo:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)},setFromSpherical:function(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)},setFromSphericalCoords:function(t,n,e){var i=Math.sin(n)*t;return this.x=i*Math.sin(e),this.y=Math.cos(n)*t,this.z=i*Math.cos(e),this},setFromCylindrical:function(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)},setFromCylindricalCoords:function(t,n,e){return this.x=t*Math.sin(n),this.y=e,this.z=t*Math.cos(n),this},setFromMatrixPosition:function(t){t=t.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this},setFromMatrixScale:function(t){var n=this.setFromMatrixColumn(t,0).length(),e=this.setFromMatrixColumn(t,1).length(),t=this.setFromMatrixColumn(t,2).length();return this.x=n,this.y=e,this.z=t,this},setFromMatrixColumn:function(t,n){return this.fromArray(t.elements,4*n)},setFromMatrix3Column:function(t,n){return this.fromArray(t.elements,3*n)},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z},fromArray:function(t,n){return this.x=t[n=void 0===n?0:n],this.y=t[n+1],this.z=t[n+2],this},toArray:function(t,n){return(t=void 0===t?[]:t)[n=void 0===n?0:n]=this.x,t[n+1]=this.y,t[n+2]=this.z,t},fromBufferAttribute:function(t,n,e){return void 0!==e&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(n),this.y=t.getY(n),this.z=t.getZ(n),this}});var f=new St,l=new Et,d=new St(0,0,0),v=new St(1,1,1),p=new St,m=new St,g=new St;function Et(){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 y(){}Object.assign(Et.prototype,{isMatrix4:!0,set:function(t,n,e,i,r,o,s,a,u,h,c,f,l,d,v,p){var m=this.elements;return m[0]=t,m[4]=n,m[8]=e,m[12]=i,m[1]=r,m[5]=o,m[9]=s,m[13]=a,m[2]=u,m[6]=h,m[10]=c,m[14]=f,m[3]=l,m[7]=d,m[11]=v,m[15]=p,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 Et).fromArray(this.elements)},copy:function(t){var n=this.elements,t=t.elements;return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],this},copyPosition:function(t){var n=this.elements,t=t.elements;return n[12]=t[12],n[13]=t[13],n[14]=t[14],this},extractBasis:function(t,n,e){return t.setFromMatrixColumn(this,0),n.setFromMatrixColumn(this,1),e.setFromMatrixColumn(this,2),this},makeBasis:function(t,n,e){return this.set(t.x,n.x,e.x,0,t.y,n.y,e.y,0,t.z,n.z,e.z,0,0,0,0,1),this},extractRotation:function(t){var n=this.elements,e=t.elements,i=1/f.setFromMatrixColumn(t,0).length(),r=1/f.setFromMatrixColumn(t,1).length(),t=1/f.setFromMatrixColumn(t,2).length();return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*i,n[3]=0,n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*r,n[7]=0,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this},makeRotationFromEuler:function(t){t&&t.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var n,e,i,r,o,s,a,u,h,c,f,l,d=this.elements,v=t.x,p=t.y,m=t.z,g=Math.cos(v),y=Math.sin(v),b=Math.cos(p),v=Math.sin(p),p=Math.cos(m),m=Math.sin(m);return"XYZ"===t.order?(o=g*p,s=g*m,a=y*p,u=y*m,d[0]=b*p,d[4]=-b*m,d[8]=v,d[1]=s+a*v,d[5]=o-u*v,d[9]=-y*b,d[2]=u-o*v,d[6]=a+s*v,d[10]=g*b):"YXZ"===t.order?(e=b*m,i=v*p,d[0]=(n=b*p)+(r=v*m)*y,d[4]=i*y-e,d[8]=g*v,d[1]=g*m,d[5]=g*p,d[9]=-y,d[2]=e*y-i,d[6]=r+n*y,d[10]=g*b):"ZXY"===t.order?(e=b*m,i=v*p,d[0]=(n=b*p)-(r=v*m)*y,d[4]=-g*m,d[8]=i+e*y,d[1]=e+i*y,d[5]=g*p,d[9]=r-n*y,d[2]=-g*v,d[6]=y,d[10]=g*b):"ZYX"===t.order?(o=g*p,s=g*m,a=y*p,u=y*m,d[0]=b*p,d[4]=a*v-s,d[8]=o*v+u,d[1]=b*m,d[5]=u*v+o,d[9]=s*v-a,d[2]=-v,d[6]=y*b,d[10]=g*b):"YZX"===t.order?(h=g*b,c=g*v,f=y*b,l=y*v,d[0]=b*p,d[4]=l-h*m,d[8]=f*m+c,d[1]=m,d[5]=g*p,d[9]=-y*p,d[2]=-v*p,d[6]=c*m+f,d[10]=h-l*m):"XZY"===t.order&&(h=g*b,c=g*v,f=y*b,l=y*v,d[0]=b*p,d[4]=-m,d[8]=v*p,d[1]=h*m+l,d[5]=g*p,d[9]=c*m-f,d[2]=f*m-c,d[6]=y*p,d[10]=l*m+h),d[3]=0,d[7]=0,d[11]=0,d[12]=0,d[13]=0,d[14]=0,d[15]=1,this},makeRotationFromQuaternion:function(t){return this.compose(d,t,v)},lookAt:function(t,n,e){var i=this.elements;return g.subVectors(t,n),0===g.lengthSq()&&(g.z=1),g.normalize(),p.crossVectors(e,g),0===p.lengthSq()&&(1===Math.abs(e.z)?g.x+=1e-4:g.z+=1e-4,g.normalize(),p.crossVectors(e,g)),p.normalize(),m.crossVectors(g,p),i[0]=p.x,i[4]=m.x,i[8]=g.x,i[1]=p.y,i[5]=m.y,i[9]=g.y,i[2]=p.z,i[6]=m.z,i[10]=g.z,this},multiply:function(t,n){return void 0!==n?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(t,n)):this.multiplyMatrices(this,t)},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,n){var e=t.elements,i=n.elements,r=this.elements,o=e[0],s=e[4],a=e[8],u=e[12],h=e[1],c=e[5],f=e[9],l=e[13],d=e[2],v=e[6],p=e[10],m=e[14],g=e[3],y=e[7],b=e[11],w=e[15],_=i[0],x=i[4],M=i[8],S=i[12],E=i[1],T=i[5],L=i[9],R=i[13],O=i[2],A=i[6],k=i[10],C=i[14],t=i[3],n=i[7],e=i[11],i=i[15];return r[0]=o*_+s*E+a*O+u*t,r[4]=o*x+s*T+a*A+u*n,r[8]=o*M+s*L+a*k+u*e,r[12]=o*S+s*R+a*C+u*i,r[1]=h*_+c*E+f*O+l*t,r[5]=h*x+c*T+f*A+l*n,r[9]=h*M+c*L+f*k+l*e,r[13]=h*S+c*R+f*C+l*i,r[2]=d*_+v*E+p*O+m*t,r[6]=d*x+v*T+p*A+m*n,r[10]=d*M+v*L+p*k+m*e,r[14]=d*S+v*R+p*C+m*i,r[3]=g*_+y*E+b*O+w*t,r[7]=g*x+y*T+b*A+w*n,r[11]=g*M+y*L+b*k+w*e,r[15]=g*S+y*R+b*C+w*i,this},multiplyScalar:function(t){var n=this.elements;return n[0]*=t,n[4]*=t,n[8]*=t,n[12]*=t,n[1]*=t,n[5]*=t,n[9]*=t,n[13]*=t,n[2]*=t,n[6]*=t,n[10]*=t,n[14]*=t,n[3]*=t,n[7]*=t,n[11]*=t,n[15]*=t,this},determinant:function(){var t=this.elements,n=t[0],e=t[4],i=t[8],r=t[12],o=t[1],s=t[5],a=t[9],u=t[13],h=t[2],c=t[6],f=t[10],l=t[14];return t[3]*(+r*a*c-i*u*c-r*s*f+e*u*f+i*s*l-e*a*l)+t[7]*(+n*a*l-n*u*f+r*o*f-i*o*l+i*u*h-r*a*h)+t[11]*(+n*u*c-n*s*l-r*o*c+e*o*l+r*s*h-e*u*h)+t[15]*(-i*s*h-n*a*c+n*s*f+i*o*c-e*o*f+e*a*h)},transpose:function(){var t=this.elements,n=t[1];return t[1]=t[4],t[4]=n,n=t[2],t[2]=t[8],t[8]=n,n=t[6],t[6]=t[9],t[9]=n,n=t[3],t[3]=t[12],t[12]=n,n=t[7],t[7]=t[13],t[13]=n,n=t[11],t[11]=t[14],t[14]=n,this},setPosition:function(t,n,e){var i=this.elements;return t.isVector3?(i[12]=t.x,i[13]=t.y,i[14]=t.z):(i[12]=t,i[13]=n,i[14]=e),this},getInverse:function(t,n){void 0!==n&&console.warn("THREE.Matrix4: .getInverse() can no longer be configured to throw on degenerate.");var e=this.elements,i=t.elements,r=i[0],o=i[1],s=i[2],a=i[3],u=i[4],h=i[5],c=i[6],f=i[7],l=i[8],d=i[9],v=i[10],p=i[11],m=i[12],g=i[13],y=i[14],b=i[15],w=d*y*f-g*v*f+g*c*p-h*y*p-d*c*b+h*v*b,_=m*v*f-l*y*f-m*c*p+u*y*p+l*c*b-u*v*b,n=l*g*f-m*d*f+m*h*p-u*g*p-l*h*b+u*d*b,t=m*d*c-l*g*c-m*h*v+u*g*v+l*h*y-u*d*y,i=r*w+o*_+s*n+a*t;if(0==i)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);i=1/i;return e[0]=w*i,e[1]=(g*v*a-d*y*a-g*s*p+o*y*p+d*s*b-o*v*b)*i,e[2]=(h*y*a-g*c*a+g*s*f-o*y*f-h*s*b+o*c*b)*i,e[3]=(d*c*a-h*v*a-d*s*f+o*v*f+h*s*p-o*c*p)*i,e[4]=_*i,e[5]=(l*y*a-m*v*a+m*s*p-r*y*p-l*s*b+r*v*b)*i,e[6]=(m*c*a-u*y*a-m*s*f+r*y*f+u*s*b-r*c*b)*i,e[7]=(u*v*a-l*c*a+l*s*f-r*v*f-u*s*p+r*c*p)*i,e[8]=n*i,e[9]=(m*d*a-l*g*a-m*o*p+r*g*p+l*o*b-r*d*b)*i,e[10]=(u*g*a-m*h*a+m*o*f-r*g*f-u*o*b+r*h*b)*i,e[11]=(l*h*a-u*d*a-l*o*f+r*d*f+u*o*p-r*h*p)*i,e[12]=t*i,e[13]=(l*g*s-m*d*s+m*o*v-r*g*v-l*o*y+r*d*y)*i,e[14]=(m*h*s-u*g*s-m*o*c+r*g*c+u*o*y-r*h*y)*i,e[15]=(u*d*s-l*h*s+l*o*c-r*d*c-u*o*v+r*h*v)*i,this},invert:function(){var t=this.elements,n=t[0],e=t[1],i=t[2],r=t[3],o=t[4],s=t[5],a=t[6],u=t[7],h=t[8],c=t[9],f=t[10],l=t[11],d=t[12],v=t[13],p=t[14],m=t[15],g=c*p*u-v*f*u+v*a*l-s*p*l-c*a*m+s*f*m,y=d*f*u-h*p*u-d*a*l+o*p*l+h*a*m-o*f*m,b=h*v*u-d*c*u+d*s*l-o*v*l-h*s*m+o*c*m,w=d*c*a-h*v*a-d*s*f+o*v*f+h*s*p-o*c*p,_=n*g+e*y+i*b+r*w;if(0==_)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);_=1/_;return t[0]=g*_,t[1]=(v*f*r-c*p*r-v*i*l+e*p*l+c*i*m-e*f*m)*_,t[2]=(s*p*r-v*a*r+v*i*u-e*p*u-s*i*m+e*a*m)*_,t[3]=(c*a*r-s*f*r-c*i*u+e*f*u+s*i*l-e*a*l)*_,t[4]=y*_,t[5]=(h*p*r-d*f*r+d*i*l-n*p*l-h*i*m+n*f*m)*_,t[6]=(d*a*r-o*p*r-d*i*u+n*p*u+o*i*m-n*a*m)*_,t[7]=(o*f*r-h*a*r+h*i*u-n*f*u-o*i*l+n*a*l)*_,t[8]=b*_,t[9]=(d*c*r-h*v*r-d*e*l+n*v*l+h*e*m-n*c*m)*_,t[10]=(o*v*r-d*s*r+d*e*u-n*v*u-o*e*m+n*s*m)*_,t[11]=(h*s*r-o*c*r-h*e*u+n*c*u+o*e*l-n*s*l)*_,t[12]=w*_,t[13]=(h*v*i-d*c*i+d*e*f-n*v*f-h*e*p+n*c*p)*_,t[14]=(d*s*i-o*v*i-d*e*a+n*v*a+o*e*p-n*s*p)*_,t[15]=(o*c*i-h*s*i+h*e*a-n*c*a-o*e*f+n*s*f)*_,this},scale:function(t){var n=this.elements,e=t.x,i=t.y,t=t.z;return n[0]*=e,n[4]*=i,n[8]*=t,n[1]*=e,n[5]*=i,n[9]*=t,n[2]*=e,n[6]*=i,n[10]*=t,n[3]*=e,n[7]*=i,n[11]*=t,this},getMaxScaleOnAxis:function(){var t=this.elements,n=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],e=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],t=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(n,e,t))},makeTranslation:function(t,n,e){return this.set(1,0,0,t,0,1,0,n,0,0,1,e,0,0,0,1),this},makeRotationX:function(t){var n=Math.cos(t),t=Math.sin(t);return this.set(1,0,0,0,0,n,-t,0,0,t,n,0,0,0,0,1),this},makeRotationY:function(t){var n=Math.cos(t),t=Math.sin(t);return this.set(n,0,t,0,0,1,0,0,-t,0,n,0,0,0,0,1),this},makeRotationZ:function(t){var n=Math.cos(t),t=Math.sin(t);return this.set(n,-t,0,0,t,n,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(t,n){var e=Math.cos(n),i=Math.sin(n),r=1-e,o=t.x,s=t.y,a=t.z,n=r*o,t=r*s;return this.set(n*o+e,n*s-i*a,n*a+i*s,0,n*s+i*a,t*s+e,t*a-i*o,0,n*a-i*s,t*a+i*o,r*a*a+e,0,0,0,0,1),this},makeScale:function(t,n,e){return this.set(t,0,0,0,0,n,0,0,0,0,e,0,0,0,0,1),this},makeShear:function(t,n,e){return this.set(1,n,e,0,t,1,e,0,t,n,1,0,0,0,0,1),this},compose:function(t,n,e){var i=this.elements,r=n.N,o=n.F,s=n.U,a=n.B,u=r+r,h=o+o,c=s+s,f=r*u,l=r*h,d=r*c,n=o*h,r=o*c,o=s*c,s=a*u,u=a*h,h=a*c,a=e.x,c=e.y,e=e.z;return i[0]=(1-(n+o))*a,i[1]=(l+h)*a,i[2]=(d-u)*a,i[3]=0,i[4]=(l-h)*c,i[5]=(1-(f+o))*c,i[6]=(r+s)*c,i[7]=0,i[8]=(d+u)*e,i[9]=(r-s)*e,i[10]=(1-(f+n))*e,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,this},decompose:function(t,n,e){var i=this.elements,r=f.set(i[0],i[1],i[2]).length(),o=f.set(i[4],i[5],i[6]).length(),s=f.set(i[8],i[9],i[10]).length();this.determinant()<0&&(r=-r),t.x=i[12],t.y=i[13],t.z=i[14],l.copy(this);var a=1/r,t=1/o,i=1/s;return l.elements[0]*=a,l.elements[1]*=a,l.elements[2]*=a,l.elements[4]*=t,l.elements[5]*=t,l.elements[6]*=t,l.elements[8]*=i,l.elements[9]*=i,l.elements[10]*=i,n.setFromRotationMatrix(l),e.x=r,e.y=o,e.z=s,this},makePerspective:function(t,n,e,i,r,o){void 0===o&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");var s=this.elements,a=2*r/(e-i),u=(n+t)/(n-t),e=(e+i)/(e-i),i=-(o+r)/(o-r),o=-2*o*r/(o-r);return s[0]=2*r/(n-t),s[4]=0,s[8]=u,s[12]=0,s[1]=0,s[5]=a,s[9]=e,s[13]=0,s[2]=0,s[6]=0,s[10]=i,s[14]=o,s[3]=0,s[7]=0,s[11]=-1,s[15]=0,this},makeOrthographic:function(t,n,e,i,r,o){var s=this.elements,a=1/(n-t),u=1/(e-i),h=1/(o-r),t=(n+t)*a,i=(e+i)*u,r=(o+r)*h;return s[0]=2*a,s[4]=0,s[8]=0,s[12]=-t,s[1]=0,s[5]=2*u,s[9]=0,s[13]=-i,s[2]=0,s[6]=0,s[10]=-2*h,s[14]=-r,s[3]=0,s[7]=0,s[11]=0,s[15]=1,this},equals:function(t){for(var n=this.elements,e=t.elements,i=0;i<16;i++)if(n[i]!==e[i])return!1;return!0},fromArray:function(t,n){void 0===n&&(n=0);for(var e=0;e<16;e++)this.elements[e]=t[e+n];return this},toArray:function(t,n){var e=this.elements;return(t=void 0===t?[]:t)[n=void 0===n?0:n]=e[0],t[n+1]=e[1],t[n+2]=e[2],t[n+3]=e[3],t[n+4]=e[4],t[n+5]=e[5],t[n+6]=e[6],t[n+7]=e[7],t[n+8]=e[8],t[n+9]=e[9],t[n+10]=e[10],t[n+11]=e[11],t[n+12]=e[12],t[n+13]=e[13],t[n+14]=e[14],t[n+15]=e[15],t}}),Object.assign(y.prototype,{addEventListener:function(t,n){void 0===this.I&&(this.I={});var e=this.I;void 0===e[t]&&(e[t]=[]),-1===e[t].indexOf(n)&&e[t].push(n)},hasEventListener:function(t,n){if(void 0===this.I)return!1;var e=this.I;return void 0!==e[t]&&-1!==e[t].indexOf(n)},removeEventListener:function(t,n){void 0!==this.I&&(void 0===(t=this.I[t])||-1!==(n=t.indexOf(n))&&t.splice(n,1))},dispatchEvent:function(t){if(void 0!==this.I){var n=this.I[t.type];if(void 0!==n){t.target=this;for(var e=n.slice(0),i=0,r=e.length;i<r;i++)e[i].call(this,t)}}}});var b=new Et,w=new st;function _(t,n,e,i){this.N=t||0,this.F=n||0,this.U=e||0,this.V=i||_.DefaultOrder}function x(){this.mask=1}function M(){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.")}_.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],_.DefaultOrder="XYZ",Object.defineProperties(_.prototype,{x:{get:function(){return this.N},set:function(t){this.N=t,this.G()}},y:{get:function(){return this.F},set:function(t){this.F=t,this.G()}},z:{get:function(){return this.U},set:function(t){this.U=t,this.G()}},order:{get:function(){return this.V},set:function(t){this.V=t,this.G()}}}),Object.assign(_.prototype,{isEuler:!0,set:function(t,n,e,i){return this.N=t,this.F=n,this.U=e,this.V=i||this.V,this.G(),this},clone:function(){return new this.constructor(this.N,this.F,this.U,this.V)},copy:function(t){return this.N=t.N,this.F=t.F,this.U=t.U,this.V=t.V,this.G(),this},setFromRotationMatrix:function(t,n,e){var i=Mt.clamp,r=t.elements,o=r[0],s=r[4],a=r[8],u=r[1],h=r[5],c=r[9],f=r[2],t=r[6],r=r[10];return"XYZ"===(n=n||this.V)?(this.F=Math.asin(i(a,-1,1)),Math.abs(a)<.9999999?(this.N=Math.atan2(-c,r),this.U=Math.atan2(-s,o)):(this.N=Math.atan2(t,h),this.U=0)):"YXZ"===n?(this.N=Math.asin(-i(c,-1,1)),Math.abs(c)<.9999999?(this.F=Math.atan2(a,r),this.U=Math.atan2(u,h)):(this.F=Math.atan2(-f,o),this.U=0)):"ZXY"===n?(this.N=Math.asin(i(t,-1,1)),Math.abs(t)<.9999999?(this.F=Math.atan2(-f,r),this.U=Math.atan2(-s,h)):(this.F=0,this.U=Math.atan2(u,o))):"ZYX"===n?(this.F=Math.asin(-i(f,-1,1)),Math.abs(f)<.9999999?(this.N=Math.atan2(t,r),this.U=Math.atan2(u,o)):(this.N=0,this.U=Math.atan2(-s,h))):"YZX"===n?(this.U=Math.asin(i(u,-1,1)),Math.abs(u)<.9999999?(this.N=Math.atan2(-c,h),this.F=Math.atan2(-f,o)):(this.N=0,this.F=Math.atan2(a,r))):"XZY"===n?(this.U=Math.asin(-i(s,-1,1)),Math.abs(s)<.9999999?(this.N=Math.atan2(t,h),this.F=Math.atan2(a,o)):(this.N=Math.atan2(-c,r),this.F=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+n),this.V=n,!1!==e&&this.G(),this},setFromQuaternion:function(t,n,e){return b.makeRotationFromQuaternion(t),this.setFromRotationMatrix(b,n,e)},setFromVector3:function(t,n){return this.set(t.x,t.y,t.z,n||this.V)},reorder:function(t){return w.setFromEuler(this),this.setFromQuaternion(w,t)},equals:function(t){return t.N===this.N&&t.F===this.F&&t.U===this.U&&t.V===this.V},fromArray:function(t){return this.N=t[0],this.F=t[1],this.U=t[2],void 0!==t[3]&&(this.V=t[3]),this.G(),this},toArray:function(t,n){return(t=void 0===t?[]:t)[n=void 0===n?0:n]=this.N,t[n+1]=this.F,t[n+2]=this.U,t[n+3]=this.V,t},toVector3:function(t){return t?t.set(this.N,this.F,this.U):new St(this.N,this.F,this.U)},H:function(t){return this.G=t,this},G:function(){}}),Object.assign(x.prototype,{set:function(t){this.mask=1<<t|0},enable:function(t){this.mask|=1<<t|0},enableAll:function(){this.mask=-1},toggle:function(t){this.mask^=1<<t|0},disable:function(t){this.mask&=~(1<<t|0)},disableAll:function(){this.mask=0},test:function(t){return 0!=(this.mask&t.mask)}}),Object.assign(M.prototype,{isMatrix3:!0,set:function(t,n,e,i,r,o,s,a,u){var h=this.elements;return h[0]=t,h[1]=i,h[2]=s,h[3]=n,h[4]=r,h[5]=a,h[6]=e,h[7]=o,h[8]=u,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(t){var n=this.elements,t=t.elements;return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],this},extractBasis:function(t,n,e){return t.setFromMatrix3Column(this,0),n.setFromMatrix3Column(this,1),e.setFromMatrix3Column(this,2),this},setFromMatrix4:function(t){t=t.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this},multiply:function(t){return this.multiplyMatrices(this,t)},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,n){var e=t.elements,i=n.elements,r=this.elements,o=e[0],s=e[3],a=e[6],u=e[1],h=e[4],c=e[7],f=e[2],l=e[5],d=e[8],v=i[0],p=i[3],m=i[6],g=i[1],y=i[4],t=i[7],n=i[2],e=i[5],i=i[8];return r[0]=o*v+s*g+a*n,r[3]=o*p+s*y+a*e,r[6]=o*m+s*t+a*i,r[1]=u*v+h*g+c*n,r[4]=u*p+h*y+c*e,r[7]=u*m+h*t+c*i,r[2]=f*v+l*g+d*n,r[5]=f*p+l*y+d*e,r[8]=f*m+l*t+d*i,this},multiplyScalar:function(t){var n=this.elements;return n[0]*=t,n[3]*=t,n[6]*=t,n[1]*=t,n[4]*=t,n[7]*=t,n[2]*=t,n[5]*=t,n[8]*=t,this},determinant:function(){var t=this.elements,n=t[0],e=t[1],i=t[2],r=t[3],o=t[4],s=t[5],a=t[6],u=t[7],t=t[8];return n*o*t-n*s*u-e*r*t+e*s*a+i*r*u-i*o*a},getInverse:function(t,n){void 0!==n&&console.warn("THREE.Matrix3: .getInverse() can no longer be configured to throw on degenerate.");var e=t.elements,i=this.elements,r=e[0],o=e[1],s=e[2],a=e[3],u=e[4],h=e[5],c=e[6],f=e[7],l=e[8],d=l*u-h*f,n=h*c-l*a,t=f*a-u*c,e=r*d+o*n+s*t;if(0==e)return this.set(0,0,0,0,0,0,0,0,0);e=1/e;return i[0]=d*e,i[1]=(s*f-l*o)*e,i[2]=(h*o-s*u)*e,i[3]=n*e,i[4]=(l*r-s*c)*e,i[5]=(s*a-h*r)*e,i[6]=t*e,i[7]=(o*c-f*r)*e,i[8]=(u*r-o*a)*e,this},transpose:function(){var t=this.elements,n=t[1];return t[1]=t[3],t[3]=n,n=t[2],t[2]=t[6],t[6]=n,n=t[5],t[5]=t[7],t[7]=n,this},getNormalMatrix:function(t){return this.setFromMatrix4(t).getInverse(this).transpose()},transposeIntoArray:function(t){var n=this.elements;return t[0]=n[0],t[1]=n[3],t[2]=n[6],t[3]=n[1],t[4]=n[4],t[5]=n[7],t[6]=n[2],t[7]=n[5],t[8]=n[8],this},setUvTransform:function(t,n,e,i,r,o,s){var a=Math.cos(r),r=Math.sin(r);this.set(e*a,e*r,-e*(a*o+r*s)+o+t,-i*r,i*a,-i*(-r*o+a*s)+s+n,0,0,1)},scale:function(t,n){var e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=n,e[4]*=n,e[7]*=n,this},rotate:function(t){var n=Math.cos(t),e=Math.sin(t),i=this.elements,r=i[0],o=i[3],s=i[6],a=i[1],u=i[4],t=i[7];return i[0]=n*r+e*a,i[3]=n*o+e*u,i[6]=n*s+e*t,i[1]=-e*r+n*a,i[4]=-e*o+n*u,i[7]=-e*s+n*t,this},translate:function(t,n){var e=this.elements;return e[0]+=t*e[2],e[3]+=t*e[5],e[6]+=t*e[8],e[1]+=n*e[2],e[4]+=n*e[5],e[7]+=n*e[8],this},equals:function(t){for(var n=this.elements,e=t.elements,i=0;i<9;i++)if(n[i]!==e[i])return!1;return!0},fromArray:function(t,n){void 0===n&&(n=0);for(var e=0;e<9;e++)this.elements[e]=t[e+n];return this},toArray:function(t,n){var e=this.elements;return(t=void 0===t?[]:t)[n=void 0===n?0:n]=e[0],t[n+1]=e[1],t[n+2]=e[2],t[n+3]=e[3],t[n+4]=e[4],t[n+5]=e[5],t[n+6]=e[6],t[n+7]=e[7],t[n+8]=e[8],t}});var S=0,E=new St,T=new st,L=new Et,R=new St,O=new St,A=new St,k=new st,C=new St(1,0,0),j=new St(0,1,0),P=new St(0,0,1),D={type:"added"},I={type:"removed"};function Z(){Object.defineProperty(this,"id",{value:S++}),this.uuid=Mt.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Z.DefaultUp.clone();var t=new St,n=new _,e=new st,i=new St(1,1,1);n.H(function(){e.setFromEuler(n,!1)}),e.H(function(){n.setFromQuaternion(e,void 0,!1)}),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:n},quaternion:{configurable:!0,enumerable:!0,value:e},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new Et},normalMatrix:{value:new M}}),this.matrix=new Et,this.matrixWorld=new Et,this.matrixAutoUpdate=Z.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new x,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}}function N(){Z.call(this),this.type="Camera",this.matrixWorldInverse=new Et,this.projectionMatrix=new Et,this.projectionMatrixInverse=new Et}function Y(t,n,e,i){N.call(this),this.type="PerspectiveCamera",this.fov=void 0!==t?t:50,this.zoom=1,this.near=void 0!==e?e:.1,this.far=void 0!==i?i:2e3,this.focus=10,this.aspect=void 0!==n?n:1,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}function q(t,n,e,i,r,o){N.call(this),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=void 0!==t?t:-1,this.right=void 0!==n?n:1,this.top=void 0!==e?e:1,this.bottom=void 0!==i?i:-1,this.near=void 0!==r?r:.1,this.far=void 0!==o?o:2e3,this.updateProjectionMatrix()}Z.DefaultUp=new St(0,1,0),Z.DefaultMatrixAutoUpdate=!0,Z.prototype=Object.assign(Object.create(y.prototype),{constructor:Z,isObject3D:!0,onBeforeRender:function(){},onAfterRender:function(){},applyMatrix4:function(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)},applyQuaternion:function(t){return this.quaternion.premultiply(t),this},setRotationFromAxisAngle:function(t,n){this.quaternion.setFromAxisAngle(t,n)},setRotationFromEuler:function(t){this.quaternion.setFromEuler(t,!0)},setRotationFromMatrix:function(t){this.quaternion.setFromRotationMatrix(t)},setRotationFromQuaternion:function(t){this.quaternion.copy(t)},rotateOnAxis:function(t,n){return T.setFromAxisAngle(t,n),this.quaternion.multiply(T),this},rotateOnWorldAxis:function(t,n){return T.setFromAxisAngle(t,n),this.quaternion.premultiply(T),this},rotateX:function(t){return this.rotateOnAxis(C,t)},rotateY:function(t){return this.rotateOnAxis(j,t)},rotateZ:function(t){return this.rotateOnAxis(P,t)},translateOnAxis:function(t,n){return E.copy(t).applyQuaternion(this.quaternion),this.position.add(E.multiplyScalar(n)),this},translateX:function(t){return this.translateOnAxis(C,t)},translateY:function(t){return this.translateOnAxis(j,t)},translateZ:function(t){return this.translateOnAxis(P,t)},localToWorld:function(t){return t.applyMatrix4(this.matrixWorld)},worldToLocal:function(t){return t.applyMatrix4(L.getInverse(this.matrixWorld))},lookAt:function(t,n,e){t.isVector3?R.copy(t):R.set(t,n,e);e=this.parent;this.updateWorldMatrix(!0,!1),O.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?L.lookAt(O,R,this.up):L.lookAt(R,O,this.up),this.quaternion.setFromRotationMatrix(L),e&&(L.extractRotation(e.matrixWorld),T.setFromRotationMatrix(L),this.quaternion.premultiply(T.inverse()))},add:function(t){if(1<arguments.length){for(var n=0;n<arguments.length;n++)this.add(arguments[n]);return this}return t===this?console.error("THREE.Object3D.add: object can't be added as a child of itself.",t):t&&t.isObject3D?(null!==t.parent&&t.parent.remove(t),(t.parent=this).children.push(t),t.dispatchEvent(D)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this},remove:function(t){if(1<arguments.length){for(var n=0;n<arguments.length;n++)this.remove(arguments[n]);return this}var e=this.children.indexOf(t);return-1!==e&&(t.parent=null,this.children.splice(e,1),t.dispatchEvent(I)),this},attach:function(t){return this.updateWorldMatrix(!0,!1),L.getInverse(this.matrixWorld),null!==t.parent&&(t.parent.updateWorldMatrix(!0,!1),L.multiply(t.parent.matrixWorld)),t.applyMatrix4(L),t.updateWorldMatrix(!1,!1),this.add(t),this},getObjectById:function(t){return this.getObjectByProperty("id",t)},getObjectByName:function(t){return this.getObjectByProperty("name",t)},getObjectByProperty:function(t,n){if(this[t]===n)return this;for(var e=0,i=this.children.length;e<i;e++){var r=this.children[e].getObjectByProperty(t,n);if(void 0!==r)return r}},getWorldPosition:function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldPosition() target is now required"),t=new St),this.updateMatrixWorld(!0),t.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldQuaternion() target is now required"),t=new st),this.updateMatrixWorld(!0),this.matrixWorld.decompose(O,t,A),t},getWorldScale:function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldScale() target is now required"),t=new St),this.updateMatrixWorld(!0),this.matrixWorld.decompose(O,k,t),t},getWorldDirection:function(t){void 0===t&&(console.warn("THREE.Object3D: .getWorldDirection() target is now required"),t=new St),this.updateMatrixWorld(!0);var n=this.matrixWorld.elements;return t.set(n[8],n[9],n[10]).normalize()},raycast:function(){},traverse:function(t){t(this);for(var n=this.children,e=0,i=n.length;e<i;e++)n[e].traverse(t)},traverseVisible:function(t){if(!1!==this.visible){t(this);for(var n=this.children,e=0,i=n.length;e<i;e++)n[e].traverseVisible(t)}},traverseAncestors:function(t){var n=this.parent;null!==n&&(t(n),n.traverseAncestors(t))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),t=!(this.matrixWorldNeedsUpdate=!1));for(var n=this.children,e=0,i=n.length;e<i;e++)n[e].updateMatrixWorld(t)},updateWorldMatrix:function(t,n){var e=this.parent;if(!0===t&&null!==e&&e.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===n)for(var i=this.children,r=0,o=i.length;r<o;r++)i[r].updateWorldMatrix(!1,!0)},clone:function(t){return(new this.constructor).copy(this,t)},copy:function(t,n){if(void 0===n&&(n=!0),this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),!0===n)for(var e=0;e<t.children.length;e++){var i=t.children[e];this.add(i.clone())}return this}}),N.prototype=Object.assign(Object.create(Z.prototype),{constructor:N,isCamera:!0,copy:function(t,n){return Z.prototype.copy.call(this,t,n),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this},getWorldDirection:function(t){void 0===t&&(console.warn("THREE.Camera: .getWorldDirection() target is now required"),t=new St),this.updateMatrixWorld(!0);var n=this.matrixWorld.elements;return t.set(-n[8],-n[9],-n[10]).normalize()},updateMatrixWorld:function(t){Z.prototype.updateMatrixWorld.call(this,t),this.matrixWorldInverse.getInverse(this.matrixWorld)},updateWorldMatrix:function(t,n){Z.prototype.updateWorldMatrix.call(this,t,n),this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return(new this.constructor).copy(this)}}),Y.prototype=Object.assign(Object.create(N.prototype),{constructor:Y,isPerspectiveCamera:!0,copy:function(t,n){return N.prototype.copy.call(this,t,n),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=null===t.view?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this},setFocalLength:function(t){t=.5*this.getFilmHeight()/t;this.fov=2*Mt.RAD2DEG*Math.atan(t),this.updateProjectionMatrix()},getFocalLength:function(){var t=Math.tan(.5*Mt.DEG2RAD*this.fov);return.5*this.getFilmHeight()/t},getEffectiveFOV:function(){return 2*Mt.RAD2DEG*Math.atan(Math.tan(.5*Mt.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(t,n,e,i,r,o){this.aspect=t/n,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=t,this.view.fullHeight=n,this.view.offsetX=e,this.view.offsetY=i,this.view.width=r,this.view.height=o,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var t,n=this.near,e=n*Math.tan(.5*Mt.DEG2RAD*this.fov)/this.zoom,i=2*e,r=this.aspect*i,o=-.5*r,s=this.view;null!==this.view&&this.view.enabled&&(t=s.fullWidth,a=s.fullHeight,o+=s.offsetX*r/t,e-=s.offsetY*i/a,r*=s.width/t,i*=s.height/a);var a=this.filmOffset;0!==a&&(o+=n*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(o,o+r,e,e-i,n,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)}}),q.prototype=Object.assign(Object.create(N.prototype),{constructor:q,isOrthographicCamera:!0,copy:function(t,n){return N.prototype.copy.call(this,t,n),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=null===t.view?null:Object.assign({},t.view),this},setViewOffset:function(t,n,e,i,r,o){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=t,this.view.fullHeight=n,this.view.offsetX=e,this.view.offsetY=i,this.view.width=r,this.view.height=o,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var t=(this.right-this.left)/(2*this.zoom),n=(this.top-this.bottom)/(2*this.zoom),e=(this.right+this.left)/2,i=(this.top+this.bottom)/2,r=e-t,o=e+t,e=i+n,t=i-n;null!==this.view&&this.view.enabled&&(i=(this.right-this.left)/this.view.fullWidth/this.zoom,n=(this.top-this.bottom)/this.view.fullHeight/this.zoom,o=(r+=i*this.view.offsetX)+i*this.view.width,t=(e-=n*this.view.offsetY)-n*this.view.height),this.projectionMatrix.makeOrthographic(r,o,e,t,this.near,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)}});var F=[new St,new St,new St,new St,new St,new St,new St,new St],U=new St,B=new tt,G=new St,H=new St,V=new St,z=new St,W=new St,X=new St,K=new St,J=new St,Q=new St,$=new St;function tt(t,n){this.min=void 0!==t?t:new St(1/0,1/0,1/0),this.max=void 0!==n?n:new St(-1/0,-1/0,-1/0)}function nt(t,n,e,i,r){for(var o=0,s=t.length-3;o<=s;o+=3){$.fromArray(t,o);var a=r.x*Math.abs($.x)+r.y*Math.abs($.y)+r.z*Math.abs($.z),u=n.dot($),h=e.dot($),c=i.dot($);if(Math.max(-Math.max(u,h,c),Math.min(u,h,c))>a)return!1}return!0}Object.assign(tt.prototype,{isBox3:!0,set:function(t,n){return this.min.copy(t),this.max.copy(n),this},setFromArray:function(t){for(var n=1/0,e=1/0,i=1/0,r=-1/0,o=-1/0,s=-1/0,a=0,u=t.length;a<u;a+=3){var h=t[a],c=t[a+1],f=t[a+2];h<n&&(n=h),c<e&&(e=c),f<i&&(i=f),r<h&&(r=h),o<c&&(o=c),s<f&&(s=f)}return this.min.set(n,e,i),this.max.set(r,o,s),this},setFromBufferAttribute:function(t){for(var n=1/0,e=1/0,i=1/0,r=-1/0,o=-1/0,s=-1/0,a=0,u=t.count;a<u;a++){var h=t.getX(a),c=t.getY(a),f=t.getZ(a);h<n&&(n=h),c<e&&(e=c),f<i&&(i=f),r<h&&(r=h),o<c&&(o=c),s<f&&(s=f)}return this.min.set(n,e,i),this.max.set(r,o,s),this},setFromPoints:function(t){this.makeEmpty();for(var n=0,e=t.length;n<e;n++)this.expandByPoint(t[n]);return this},setFromCenterAndSize:function(t,n){n=U.copy(n).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this},setFromObject:function(t){return this.makeEmpty(),this.expandByObject(t)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.min.copy(t.min),this.max.copy(t.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(t){return void 0===t&&(console.warn("THREE.Box3: .getCenter() target is now required"),t=new St),this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(t){return void 0===t&&(console.warn("THREE.Box3: .getSize() target is now required"),t=new St),this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)},expandByPoint:function(t){return this.min.min(t),this.max.max(t),this},expandByVector:function(t){return this.min.sub(t),this.max.add(t),this},expandByScalar:function(t){return this.min.addScalar(-t),this.max.addScalar(t),this},expandByObject:function(t){t.updateWorldMatrix(!1,!1);var n=t.geometry;void 0!==n&&(null===n.boundingBox&&n.computeBoundingBox(),B.copy(n.boundingBox),B.applyMatrix4(t.matrixWorld),this.union(B));for(var e=t.children,i=0,r=e.length;i<r;i++)this.expandByObject(e[i]);return this},containsPoint:function(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y||t.z<this.min.z||t.z>this.max.z)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z},getParameter:function(t,n){return void 0===n&&(console.warn("THREE.Box3: .getParameter() target is now required"),n=new St),n.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y||t.max.z<this.min.z||t.min.z>this.max.z)},intersectsSphere:function(t){return this.clampPoint(t.center,U),U.distanceToSquared(t.center)<=t.radius*t.radius},intersectsPlane:function(t){var n,e=0<t.normal.x?(n=t.normal.x*this.min.x,t.normal.x*this.max.x):(n=t.normal.x*this.max.x,t.normal.x*this.min.x);return 0<t.normal.y?(n+=t.normal.y*this.min.y,e+=t.normal.y*this.max.y):(n+=t.normal.y*this.max.y,e+=t.normal.y*this.min.y),0<t.normal.z?(n+=t.normal.z*this.min.z,e+=t.normal.z*this.max.z):(n+=t.normal.z*this.max.z,e+=t.normal.z*this.min.z),n<=-t.constant&&e>=-t.constant},intersectsTriangle:function(t){if(this.isEmpty())return!1;this.getCenter(K),J.subVectors(this.max,K),G.subVectors(t.a,K),H.subVectors(t.b,K),V.subVectors(t.c,K),z.subVectors(H,G),W.subVectors(V,H),X.subVectors(G,V);t=[0,-z.z,z.y,0,-W.z,W.y,0,-X.z,X.y,z.z,0,-z.x,W.z,0,-W.x,X.z,0,-X.x,-z.y,z.x,0,-W.y,W.x,0,-X.y,X.x,0];return!!nt(t,G,H,V,J)&&(!!nt(t=[1,0,0,0,1,0,0,0,1],G,H,V,J)&&(Q.crossVectors(z,W),nt(t=[Q.x,Q.y,Q.z],G,H,V,J)))},clampPoint:function(t,n){return void 0===n&&(console.warn("THREE.Box3: .clampPoint() target is now required"),n=new St),n.copy(t).clamp(this.min,this.max)},distanceToPoint:function(t){return U.copy(t).clamp(this.min,this.max).sub(t).length()},getBoundingSphere:function(t){return void 0===t&&console.error("THREE.Box3: .getBoundingSphere() target is now required"),this.getCenter(t.center),t.radius=.5*this.getSize(U).length(),t},intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},applyMatrix4:function(t){return this.isEmpty()||(F[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),F[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),F[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),F[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),F[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),F[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),F[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),F[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(F)),this},translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}});var et=new tt;function it(t,n){this.center=void 0!==t?t:new St,this.radius=void 0!==n?n:0}Object.assign(it.prototype,{set:function(t,n){return this.center.copy(t),this.radius=n,this},setFromPoints:function(t,n){var e=this.center;void 0!==n?e.copy(n):et.setFromPoints(t).getCenter(e);for(var i=0,r=0,o=t.length;r<o;r++)i=Math.max(i,e.distanceToSquared(t[r]));return this.radius=Math.sqrt(i),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.center.copy(t.center),this.radius=t.radius,this},empty:function(){return this.radius<=0},containsPoint:function(t){return t.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(t){return t.distanceTo(this.center)-this.radius},intersectsSphere:function(t){var n=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=n*n},intersectsBox:function(t){return t.intersectsSphere(this)},intersectsPlane:function(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius},clampPoint:function(t,n){var e=this.center.distanceToSquared(t);return void 0===n&&(console.warn("THREE.Sphere: .clampPoint() target is now required"),n=new St),n.copy(t),e>this.radius*this.radius&&(n.sub(this.center).normalize(),n.multiplyScalar(this.radius).add(this.center)),n},getBoundingBox:function(t){return void 0===t&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),t=new tt),t.set(this.center,this.center),t.expandByScalar(this.radius),t},applyMatrix4:function(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this},translate:function(t){return this.center.add(t),this},equals:function(t){return t.center.equals(this.center)&&t.radius===this.radius}});var rt=new St,ot=new St,at=new M;function ut(t,n){this.normal=void 0!==t?t:new St(1,0,0),this.constant=void 0!==n?n:0}Object.assign(ut.prototype,{isPlane:!0,set:function(t,n){return this.normal.copy(t),this.constant=n,this},setComponents:function(t,n,e,i){return this.normal.set(t,n,e),this.constant=i,this},setFromNormalAndCoplanarPoint:function(t,n){return this.normal.copy(t),this.constant=-n.dot(this.normal),this},setFromCoplanarPoints:function(t,n,e){n=rt.subVectors(e,n).cross(ot.subVectors(t,n)).normalize();return this.setFromNormalAndCoplanarPoint(n,t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.normal.copy(t.normal),this.constant=t.constant,this},normalize:function(){var t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(t){return this.normal.dot(t)+this.constant},distanceToSphere:function(t){return this.distanceToPoint(t.center)-t.radius},projectPoint:function(t,n){return void 0===n&&(console.warn("THREE.Plane: .projectPoint() target is now required"),n=new St),n.copy(this.normal).multiplyScalar(-this.distanceToPoint(t)).add(t)},intersectLine:function(t,n){void 0===n&&(console.warn("THREE.Plane: .intersectLine() target is now required"),n=new St);var e=t.delta(rt),i=this.normal.dot(e);if(0===i)return 0===this.distanceToPoint(t.start)?n.copy(t.start):void 0;i=-(t.start.dot(this.normal)+this.constant)/i;return i<0||1<i?void 0:n.copy(e).multiplyScalar(i).add(t.start)},intersectsLine:function(t){var n=this.distanceToPoint(t.start),t=this.distanceToPoint(t.end);return n<0&&0<t||t<0&&0<n},intersectsBox:function(t){return t.intersectsPlane(this)},intersectsSphere:function(t){return t.intersectsPlane(this)},coplanarPoint:function(t){return void 0===t&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),t=new St),t.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(t,n){n=n||at.getNormalMatrix(t),t=this.coplanarPoint(rt).applyMatrix4(t),n=this.normal.applyMatrix3(n).normalize();return this.constant=-t.dot(n),this},translate:function(t){return this.constant-=t.dot(this.normal),this},equals:function(t){return t.normal.equals(this.normal)&&t.constant===this.constant}});var ht=new it,ct=new St;function Tt(t,n,e,i,r,o){this.planes=[void 0!==t?t:new ut,void 0!==n?n:new ut,void 0!==e?e:new ut,void 0!==i?i:new ut,void 0!==r?r:new ut,void 0!==o?o:new ut]}Object.assign(Tt.prototype,{set:function(t,n,e,i,r,o){var s=this.planes;return s[0].copy(t),s[1].copy(n),s[2].copy(e),s[3].copy(i),s[4].copy(r),s[5].copy(o),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){for(var n=this.planes,e=0;e<6;e++)n[e].copy(t.planes[e]);return this},setFromProjectionMatrix:function(t){var n=this.planes,e=t.elements,i=e[0],r=e[1],o=e[2],s=e[3],a=e[4],u=e[5],h=e[6],c=e[7],f=e[8],l=e[9],d=e[10],v=e[11],p=e[12],m=e[13],t=e[14],e=e[15];return n[0].setComponents(s-i,c-a,v-f,e-p).normalize(),n[1].setComponents(s+i,c+a,v+f,e+p).normalize(),n[2].setComponents(s+r,c+u,v+l,e+m).normalize(),n[3].setComponents(s-r,c-u,v-l,e-m).normalize(),n[4].setComponents(s-o,c-h,v-d,e-t).normalize(),n[5].setComponents(s+o,c+h,v+d,e+t).normalize(),this},intersectsObject:function(t){var n=t.geometry;return null===n.boundingSphere&&n.computeBoundingSphere(),ht.copy(n.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(ht)},intersectsSprite:function(t){return ht.center.set(0,0,0),ht.radius=.7071067811865476,ht.applyMatrix4(t.matrixWorld),this.intersectsSphere(ht)},intersectsSphere:function(t){for(var n=this.planes,e=t.center,i=-t.radius,r=0;r<6;r++)if(n[r].distanceToPoint(e)<i)return!1;return!0},intersectsBox:function(t){for(var n=this.planes,e=0;e<6;e++){var i=n[e];if(ct.x=(0<i.normal.x?t.max:t.min).x,ct.y=(0<i.normal.y?t.max:t.min).y,ct.z=(0<i.normal.z?t.max:t.min).z,i.distanceToPoint(ct)<0)return!1}return!0},containsPoint:function(t){for(var n=this.planes,e=0;e<6;e++)if(n[e].distanceToPoint(t)<0)return!1;return!0}});var ft=0,lt=1,dt=2,vt=0,pt=1,mt=2,gt=3,yt=0,bt=1,wt=2,_t=1,xt=2,Lt=3,Rt=0,Ot=1,At=2,kt=0,Ct=1,jt=2,Pt=3,Dt=4,It=5,Nt=100,Ft=101,Ut=102,Bt=103,Gt=104,Ht=200,Vt=201,zt=202,Wt=203,Xt=204,Zt=205,Yt=206,qt=207,Kt=208,Jt=209,Qt=210,$t=0,tn=1,nn=2,en=3,rn=4,on=5,sn=6,an=7,un=0,hn=1,cn=2,fn=0,ln=1,dn=2,vn=3,pn=4,mn=5,gn=301,yn=302,bn=303,wn=304,_n=305,xn=306,Mn=307,Sn=1e3,En=1001,Tn=1002,Ln=1003,Rn=1004,On=1005,An=1006,kn=1007,Cn=1008,jn=1009,Pn=1010,Dn=1011,In=1012,Nn=1013,Fn=1014,Un=1015,Bn=1016,Gn=1017,Hn=1018,Vn=1019,zn=1020,Wn=1021,Xn=1022,Zn=1023,Yn=1024,qn=1025,Kn=1026,Jn=1027,Qn=1028,$n=1029,te=1030,ne=1031,ee=1032,ie=1033,re=33776,oe=33777,se=33778,ae=33779,ue=35840,he=35841,ce=35842,fe=35843,le=36196,de=37492,ve=37496,pe=37808,me=37809,ge=37810,ye=37811,be=37812,we=37813,_e=37814,xe=37815,Me=37816,Se=37817,Ee=37818,Te=37819,Le=37820,Re=37821,Oe=36492,Ae=37840,ke=37841,Ce=37842,je=37843,Pe=37844,De=37845,Ie=37846,Ne=37847,Fe=37848,Ue=37849,Be=37850,Ge=37851,He=37852,Ve=37853,ze=2300,We=2301,Xe=2400,Ze=2401,Ye=2,qe=3e3,Ke=3001,Je=3007,Qe=3002,$e=3003,ti=3004,ni=3005,ei=3006,ii=3200,ri=3201,oi=0,si=1,ai=7680,ui=519,hi=35044;function ci(t,n,e){return this.radius=void 0!==t?t:1,this.phi=void 0!==n?n:0,this.theta=void 0!==e?e:0,this}function fi(t,n){this.x=t||0,this.y=n||0}Object.assign(ci.prototype,{set:function(t,n,e){return this.radius=t,this.phi=n,this.theta=e,this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.radius=t.radius,this.phi=t.phi,this.theta=t.theta,this},makeSafe:function(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this},setFromVector3:function(t){return this.setFromCartesianCoords(t.x,t.y,t.z)},setFromCartesianCoords:function(t,n,e){return this.radius=Math.sqrt(t*t+n*n+e*e),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(t,e),this.phi=Math.acos(Mt.clamp(n/this.radius,-1,1))),this}}),Object.defineProperties(fi.prototype,{width:{get:function(){return this.x},set:function(t){this.x=t}},height:{get:function(){return this.y},set:function(t){this.y=t}}}),Object.assign(fi.prototype,{isVector2:!0,set:function(t,n){return this.x=t,this.y=n,this},setScalar:function(t){return this.x=t,this.y=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setComponent:function(t,n){switch(t){case 0:this.x=n;break;case 1:this.y=n;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(t){return this.x=t.x,this.y=t.y,this},add:function(t,n){return void 0!==n?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,n)):(this.x+=t.x,this.y+=t.y,this)},addScalar:function(t){return this.x+=t,this.y+=t,this},addVectors:function(t,n){return this.x=t.x+n.x,this.y=t.y+n.y,this},addScaledVector:function(t,n){return this.x+=t.x*n,this.y+=t.y*n,this},sub:function(t,n){return void 0!==n?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,n)):(this.x-=t.x,this.y-=t.y,this)},subScalar:function(t){return this.x-=t,this.y-=t,this},subVectors:function(t,n){return this.x=t.x-n.x,this.y=t.y-n.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},multiplyScalar:function(t){return this.x*=t,this.y*=t,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},divideScalar:function(t){return this.multiplyScalar(1/t)},applyMatrix3:function(t){var n=this.x,e=this.y,t=t.elements;return this.x=t[0]*n+t[3]*e+t[6],this.y=t[1]*n+t[4]*e+t[7],this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this},clamp:function(t,n){return this.x=Math.max(t.x,Math.min(n.x,this.x)),this.y=Math.max(t.y,Math.min(n.y,this.y)),this},clampScalar:function(t,n){return this.x=Math.max(t,Math.min(n,this.x)),this.y=Math.max(t,Math.min(n,this.y)),this},clampLength:function(t,n){var e=this.length();return this.divideScalar(e||1).multiplyScalar(Math.max(t,Math.min(n,e)))},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(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.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(){return Math.atan2(-this.y,-this.x)+Math.PI},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var n=this.x-t.x,t=this.y-t.y;return n*n+t*t},manhattanDistanceTo:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,n){return this.x+=(t.x-this.x)*n,this.y+=(t.y-this.y)*n,this},lerpVectors:function(t,n,e){return this.subVectors(n,t).multiplyScalar(e).add(t)},equals:function(t){return t.x===this.x&&t.y===this.y},fromArray:function(t,n){return this.x=t[n=void 0===n?0:n],this.y=t[n+1],this},toArray:function(t,n){return(t=void 0===t?[]:t)[n=void 0===n?0:n]=this.x,t[n+1]=this.y,t},fromBufferAttribute:function(t,n,e){return void 0!==e&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(n),this.y=t.getY(n),this},rotateAround:function(t,n){var e=Math.cos(n),i=Math.sin(n),r=this.x-t.x,n=this.y-t.y;return this.x=r*e-n*i+t.x,this.y=r*i+n*e+t.y,this}});function li(t,n,e){var i,r,o,s,a,u,h=this;void 0===n&&console.warn('THREE.OrbitControls: The second parameter "domElement" is now mandatory.'),n===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),this.object=t,this.isScreenLock=!1,this.domElement=n,this.W=e,this.enabled=!0,this.useRange=!1,this.target=new St,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.isDamping=!1,this.dampingFactor=.25,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.enableRotateLeft=!0,this.enableRotateUp=!0,this.rotateSpeed=2,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:ft,MIDDLE:lt,RIGHT:dt},this.touches={ONE:vt,TWO:mt},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.rotateLeftStart=new fi,this.rotateLeftEnd=new fi,this.X=function(){h.isDamping&&(y.theta>m||y.phi>m||w.length()>m?(h.update(),h.W.enableUpdateRender()):(h.isDamping=!1,h.update()))},this.X=this.X.bind(this),this.W.on("beforeRender",this.X),this.getPolarAngle=function(){return g.phi},this.getAzimuthalAngle=function(){return g.theta},this.panAdd=function(t){w.add(t)},this.saveState=function(){c.target0.copy(c.target),c.position0.copy(c.object.position),c.zoom0=c.object.zoom},this.reset=function(){c.target.copy(c.target0),c.object.position.copy(c.position0),c.object.zoom=c.zoom0,c.object.updateProjectionMatrix(),c.dispatchEvent(f),c.update(),p=v.NONE},this.updateCheck=function(){this.W.Z&&this.W.Z.enableDragRange&&(this.W.Z.Y()?this.saveState():(this.reset(),this.W.Z.Y()||this.W.setCenter({x:e.x,y:e.y})))},this.getTarget=function(t,n){if(0===this.W.K.length)return t;var e=this.W.getMapOptions().screenLockCoords,i={x:this.W.getContainer().clientWidth/2,y:this.W.getContainer().clientHeight/2},e={x:this.W.getContainer().clientWidth*e.x,y:this.W.getContainer().clientHeight*e.y},i=fengmap.FMUtil.coordsScreenToMap(this.W,i,n);i.x=i.x-this.W.x,i.y=-i.y+this.W.y;e=fengmap.FMUtil.coordsScreenToMap(this.W,e,n);e.x=e.x-this.W.x,e.y=-e.y+this.W.y;n=e.x-i.x,i=e.y-i.y,t=t.clone();return isNaN(n)||isNaN(i)||1e3<Math.abs(i)||1e3<Math.abs(n)||(t.x=t.x-n,t.z=t.z-i),t},this.update=(i=new St,r=(new st).setFromUnitVectors(t.up,new St(0,1,0)),o=r.clone().inverse(),s=new St,a=new st,u=0,function(t){t=t||{};var n,e=c.object.position;return i.copy(e).sub(c.target),i.applyQuaternion(r),g.setFromVector3(i),c.autoRotate&&p===v.NONE&&j(2*Math.PI/60/60*c.autoRotateSpeed),c.enableDamping&&c.isDamping?(g.theta+=y.theta*c.dampingFactor,g.phi+=y.phi*c.dampingFactor):(g.theta+=y.theta,g.phi+=y.phi),g.theta=Math.max(c.minAzimuthAngle,Math.min(c.maxAzimuthAngle,g.theta)),t&&void 0!==t.theta&&(g.theta=Math.max(c.minAzimuthAngle,Math.min(c.maxAzimuthAngle,t.theta))),g.phi=Math.max(c.minPolarAngle,Math.min(c.maxPolarAngle,g.phi)),t&&void 0!==t.phi&&(g.phi=Math.max(c.minPolarAngle,Math.min(c.maxPolarAngle,t.phi))),g.makeSafe(),g.radius*=b,g.radius=Math.max(c.minDistance,Math.min(c.maxDistance,g.radius)),this.useRange?((n=(new St).setFromMatrixPosition(c.object.matrixWorld)).add(w),n=(new Et).copy(c.object.matrixWorld).setPosition(n),n=(new Et).getInverse(n),(new Tt).setFromProjectionMatrix((new Et).multiplyMatrices(c.object.projectionMatrix,n)).intersectsSphere(c.viewSphere)&&c.target.add(w)):c.enableDamping&&c.isDamping?c.target.addScaledVector(w,c.dampingFactor):c.target.add(w),i.setFromSpherical(g),i.applyQuaternion(o),t&&t.offset&&i.add(t.offset),this.useRange?((t=(new St).setFromMatrixPosition(c.object.matrixWorld)).add(i),t=(new Et).copy(c.object.matrixWorld).setPosition(t),t=(new Et).getInverse(t),(new Tt).setFromProjectionMatrix((new Et).multiplyMatrices(c.object.projectionMatrix,t)).intersectsSphere(c.viewSphere)&&e.copy(c.target).add(i)):e.copy(c.target).add(i),c.isScreenLock&&void 0!==this.W.getMapOptions().screenLockCoords?((e=c.object.clone()).lookAt(c.target),c.object.lookAt(this.getTarget(c.target,e)),c.object.rotation.z=e.rotation.z):c.object.lookAt(c.target),c.enableDamping&&c.isDamping?(y.theta*=1-c.dampingFactor,y.phi*=1-c.dampingFactor,w.multiplyScalar(1-c.dampingFactor)):(y.set(0,0,0),w.set(0,0,0)),b=1,!!(_||s.distanceToSquared(c.object.position)>m||8*(1-a.dot(c.object.quaternion))>m||u!==c.object.zoom)&&(c.dispatchEvent(f),s.copy(c.object.position),a.copy(c.object.quaternion),u=c.object.zoom,!(_=!1))}),this.dispose=function(){c.domElement.removeEventListener("contextmenu",ot,!1),c.domElement.removeEventListener("mousedown",J,!1),c.domElement.removeEventListener("wheel",tt,!1),c.domElement.removeEventListener("touchstart",et,!1),c.domElement.removeEventListener("touchend",rt,!1),c.domElement.removeEventListener("touchmove",it,!1),document.removeEventListener("mousemove",Q,!1),document.removeEventListener("mouseup",$,!1),c.domElement.removeEventListener("keydown",nt,!1)};var c=this,f={type:"change"},l={type:"start"},d={type:"end"},v={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},p=v.NONE,m=1e-6,g=new ci,y=new ci,b=1,w=new St,_=!1,x=new fi,M=new fi,S=new fi,E=new fi,T=new fi,L=new fi,R=new fi,O=new fi,A=new fi,k=null;function C(){return Math.pow(.95,c.zoomSpeed)}function j(t){c.enableRotateLeft&&(y.theta-=t)}function P(t){c.enableRotateUp&&(y.phi-=t)}var D,I,N=(D=new St,function(t,n){D.setFromMatrixColumn(n,0),D.multiplyScalar(-t),w.add(D)}),F=(I=new St,function(t,n){!0===c.screenSpacePanning?I.setFromMatrixColumn(n,1):(I.setFromMatrixColumn(n,0),I.crossVectors(c.object.up,I)),I.multiplyScalar(t),w.add(I)});this.panUp=function(t){var n=new St(0,1,0);n.multiplyScalar(t),w.add(n)};var U,B=(U=new St,function(t,n){var e,i=c.domElement;c.object.isPerspectiveCamera?(e=c.object.position,U.copy(e).sub(c.target),e=U.length(),e*=Math.tan(c.object.fov/2*Math.PI/180),N(2*t*e/i.clientHeight,c.object.matrix),F(2*n*e/i.clientHeight,c.object.matrix)):c.object.isOrthographicCamera?(N(t*(c.object.right-c.object.left)/c.object.zoom/i.clientWidth,c.object.matrix),F(n*(c.object.top-c.object.bottom)/c.object.zoom/i.clientHeight,c.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),c.enablePan=!1)});function G(t){c.object.isPerspectiveCamera?b/=t:c.object.isOrthographicCamera?(c.object.zoom=Math.max(c.minZoom,Math.min(c.maxZoom,c.object.zoom*t)),c.object.updateProjectionMatrix(),b/=t,_=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),c.enableZoom=!1)}function H(t){c.object.isPerspectiveCamera?b*=t:c.object.isOrthographicCamera?(c.object.zoom=Math.max(c.minZoom,Math.min(c.maxZoom,c.object.zoom/t)),c.object.updateProjectionMatrix(),b*=t,_=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),c.enableZoom=!1)}function V(t){x.set(t.clientX,t.clientY)}function z(t){E.set(t.clientX,t.clientY)}function W(t){var n,e;1==t.touches.length?x.set(t.touches[0].pageX,t.touches[0].pageY):(n=.5*(t.touches[0].pageX+t.touches[1].pageX),e=.5*(t.touches[0].pageY+t.touches[1].pageY),x.set(n,e),e=t.touches[0].pageX-t.touches[1].pageX,t=t.touches[0].pageY-t.touches[1].pageY,c.rotateLeftStart.set(e,t))}function X(t){var n;1==t.touches.length?E.set(t.touches[0].pageX,t.touches[0].pageY):(n=.5*(t.touches[0].pageX+t.touches[1].pageX),t=.5*(t.touches[0].pageY+t.touches[1].pageY),E.set(n,t))}function Z(t){var n=t.touches[0].pageX-t.touches[1].pageX,t=t.touches[0].pageY-t.touches[1].pageY,t=Math.sqrt(n*n+t*t);R.set(0,t)}function Y(t){var n;1==t.touches.length?M.set(t.touches[0].pageX,t.touches[0].pageY):(n=.5*(t.touches[0].pageX+t.touches[1].pageX),e=.5*(t.touches[0].pageY+t.touches[1].pageY),M.set(n,e),n=t.touches[0].pageX-t.touches[1].pageX,e=t.touches[0].pageY-t.touches[1].pageY,c.rotateLeftEnd.set(n,e),e=c.rotateLeftStart.angle(),j((-c.rotateLeftEnd.angle()+e)*c.rotateSpeed),c.rotateLeftStart.copy(c.rotateLeftEnd)),S.subVectors(M,x).multiplyScalar(c.rotateSpeed);var e=c.domElement;P(2*Math.PI*S.y/e.clientHeight),x.copy(M)}function q(t){var n;1==t.touches.length?(T.set(t.touches[0].pageX,t.touches[0].pageY),T.x<0&&T.copy(E)):(n=.5*(t.touches[0].pageX+t.touches[1].pageX),t=.5*(t.touches[0].pageY+t.touches[1].pageY),T.set(n,t)),L.subVectors(T,E).multiplyScalar(c.panSpeed),B(L.x,L.y),E.copy(T)}function K(t){var n;t.touches[0]&&t.touches[1]&&(n=t.touches[0].pageX-t.touches[1].pageX,t=t.touches[0].pageY-t.touches[1].pageY,t=Math.sqrt(n*n+t*t),O.set(0,t),A.set(0,Math.pow(O.y/R.y,c.zoomSpeed)),G(A.y),R.copy(O))}function J(t){if(!1!==c.enabled){switch(t.preventDefault(),(c.domElement.focus?c.domElement:window).focus(),t.button){case 0:switch(c.mouseButtons.LEFT){case ft:if(t.ctrlKey||t.metaKey||t.shiftKey){if(!1===c.enablePan)return;z(t),p=v.PAN}else{if(!1===c.enableRotate)return;V(t),p=v.ROTATE}break;case dt:if(t.ctrlKey||t.metaKey||t.shiftKey){if(!1===c.enableRotate)return;V(t),p=v.ROTATE}else{if(!1===c.enablePan)return;z(t),p=v.PAN}break;default:p=v.NONE}break;case 1:if(c.mouseButtons.MIDDLE===lt){if(!1===c.enableZoom)return;n=t,R.set(n.clientX,n.clientY),p=v.DOLLY}else p=v.NONE;break;case 2:switch(c.mouseButtons.RIGHT){case ft:if(!1===c.enableRotate)return;V(t),p=v.ROTATE;break;case dt:if(!1===c.enablePan)return;z(t),p=v.PAN;break;default:p=v.NONE}}var n;p!==v.NONE&&(document.addEventListener("mousemove",Q,!1),document.addEventListener("mouseup",$,!1),c.dispatchEvent(l))}}function Q(t){var n,e;if(!1!==c.enabled)switch(t.preventDefault(),p){case v.ROTATE:if(!1===c.enableRotate)return;e=t,M.set(e.clientX,e.clientY),S.subVectors(M,x).multiplyScalar(c.rotateSpeed),e=c.domElement,j(2*Math.PI*S.x/e.clientHeight),P(2*Math.PI*S.y/e.clientHeight),x.copy(M),c.isDamping=!0,c.update(),c.updateCheck();break;case v.DOLLY:if(!1===c.enableZoom)return;n=t,O.set(n.clientX,n.clientY),A.subVectors(O,R),0<A.y?G(C()):A.y<0&&H(C()),R.copy(O),c.isDamping=!0,c.update(),c.updateCheck();break;case v.PAN:if(!1===c.enablePan)return;n=t,T.set(n.clientX,n.clientY),L.subVectors(T,E).multiplyScalar(c.panSpeed),B(L.x,L.y),E.copy(T),c.isDamping=!0,c.update(),c.updateCheck()}}function $(t){!1!==c.enabled&&(document.removeEventListener("mousemove",Q,!1),document.removeEventListener("mouseup",$,!1),c.dispatchEvent(d),p=v.NONE)}function tt(t){!1===c.enabled||!1===c.enableZoom||p!==v.NONE&&p!==v.ROTATE||(t.preventDefault(),t.stopPropagation(),c.dispatchEvent(l),(t=t).deltaY<0?H(C()):0<t.deltaY&&G(C()),c.isDamping=!0,c.update(),c.updateCheck(),c.dispatchEvent(d))}function nt(t){!1!==c.enabled&&!1!==c.enableKeys&&!1!==c.enablePan&&function(t){var n=!1;switch(t.keyCode){case c.keys.UP:B(0,c.keyPanSpeed),n=!0;break;case c.keys.BOTTOM:B(0,-c.keyPanSpeed),n=!0;break;case c.keys.LEFT:B(c.keyPanSpeed,0),n=!0;break;case c.keys.RIGHT:B(-c.keyPanSpeed,0),n=!0}n&&(t.preventDefault(),c.isDamping=!0,c.update(),c.updateCheck())}(t)}function et(t){if(!1!==c.enabled){switch(t.preventDefault(),t.touches.length){case 1:switch(c.touches.ONE){case vt:if(!1===c.enableRotate)return;W(t),p=v.TOUCH_ROTATE;break;case pt:if(!1===c.enablePan)return;X(t),p=v.TOUCH_PAN;break;default:p=v.NONE}break;case 2:switch(k=t.touches[0].identifier,c.touches.TWO){case mt:if(!1===c.enableZoom&&!1===c.enablePan)return;n=t,c.enableZoom&&Z(n),c.enablePan&&X(n),p=v.TOUCH_DOLLY_PAN;break;case gt:if(!1===c.enableZoom&&!1===c.enableRotate)return;n=t,c.enableZoom&&Z(n),c.enableRotate&&W(n),p=v.TOUCH_DOLLY_ROTATE;break;default:p=v.NONE}break;default:p=v.NONE}var n;p!==v.NONE&&c.dispatchEvent(l)}}function it(t){var n,e;if(!1!==c.enabled)switch(2===t.touches.length&&t.touches[1].identifier===k&&(n=t.touches[0],t.touches[0]=t.touches[1],t.touches[1]=n),t.preventDefault(),t.stopPropagation(),p){case v.TOUCH_ROTATE:if(!1===c.enableRotate)return;Y(t),c.isDamping=!0,c.update(),c.updateCheck();break;case v.TOUCH_PAN:if(!1===c.enablePan)return;q(t),c.isDamping=!0,c.update(),c.updateCheck();break;case v.TOUCH_DOLLY_PAN:if(!1===c.enableZoom&&!1===c.enablePan)return;e=t,c.enableZoom&&K(e),c.enablePan&&q(e),c.isDamping=!0,c.update(),c.updateCheck();break;case v.TOUCH_DOLLY_ROTATE:if(!1===c.enableZoom&&!1===c.enableRotate)return;e=t,c.enableZoom&&K(e),c.enableRotate&&Y(e),c.isDamping=!0,c.update(),c.updateCheck();break;default:p=v.NONE}}function rt(t){!1!==c.enabled&&(c.dispatchEvent(d),p=v.NONE)}function ot(t){!1!==c.enabled&&t.preventDefault()}this.dollyIn=G,this.dollyOut=H,c.domElement.addEventListener("contextmenu",ot,!1),c.domElement.addEventListener("mousedown",J,!1),c.domElement.addEventListener("wheel",tt,!1),c.domElement.addEventListener("touchstart",et,!1),c.domElement.addEventListener("touchend",rt,!1),c.domElement.addEventListener("touchmove",it,!1),c.domElement.addEventListener("keydown",nt,!1),-1===c.domElement.tabIndex&&(c.domElement.tabIndex=0),c.isDamping=!0,this.update(),this.updateCheck(),this.removeEvent=function(){c.domElement.removeEventListener("contextmenu",ot,!1),c.domElement.removeEventListener("mousedown",J,!1),c.domElement.removeEventListener("wheel",tt,!1),c.domElement.removeEventListener("touchstart",et,!1),c.domElement.removeEventListener("touchend",rt,!1),c.domElement.removeEventListener("touchmove",it,!1),c.domElement.removeEventListener("keydown",nt,!1),document.removeEventListener("mousemove",Q,!1),document.removeEventListener("mouseup",$,!1)}}(li.prototype=Object.create(y.prototype)).constructor=li;var di=function(t,n,e){li.call(this,t,n,e),this.mouseButtons.LEFT=dt,this.mouseButtons.RIGHT=ft,this.touches.ONE=pt,this.touches.TWO=gt,this.J=null};di.prototype=Object.create(y.prototype),di.prototype.constructor=di,Object.assign(di.prototype,{dispose:function(){this.removeEvent(),this.object=null,this.domElement=null,this.W.off("beforeRender",this.W.X),this.W=null},pauseDamping:function(){this.J={dampingFactor:this.dampingFactor,enableDamping:this.enableDamping},this.enableDamping=!1,this.dampingFactor=1},resumeDamping:function(){this.J&&(this.enableDamping=this.J.enableDamping,this.dampingFactor=this.J.dampingFactor)}});var vi={FOV:35,CAMERA_NEAR:1,CAMERA_FAR:1e5,ZOOM_UPPER_BOUND:30,TILT_UPPER_BOUND:90,THOUSAND:1e3,DEG2RAD:.0174532,RAD2DEG:57.2957795,DRAW_TIME:500,EPS:.001};Object.freeze(vi);var pi=vi,mi={MODE_3D:2,MODE_2D:4};Object.freeze(mi);var gi=mi,yi={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},bi={h:0,s:0,l:0},wi={h:0,s:0,l:0};function _i(t,n,e){return void 0===n&&void 0===e?this.set(t):this.setRGB(t,n,e)}function xi(t,n,e){return e<0&&(e+=1),1<e&&--e,e<1/6?t+6*(n-t)*e:e<.5?n:e<2/3?t+6*(n-t)*(2/3-e):t}function Mi(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function Si(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}function Ei(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}Object.assign(_i.prototype,{isColor:!0,r:1,g:1,b:1,set:function(t){return t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t),this},setScalar:function(t){return this.r=t,this.g=t,this.b=t,this},setHex:function(t){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,this},setRGB:function(t,n,e){return this.r=t,this.g=n,this.b=e,this},setHSL:function(t,n,e){return t=Mt.euclideanModulo(t,1),n=Mt.clamp(n,0,1),e=Mt.clamp(e,0,1),0===n?this.r=this.g=this.b=e:(this.r=xi(n=2*e-(e=e<=.5?e*(1+n):e+n-e*n),e,t+1/3),this.g=xi(n,e,t),this.b=xi(n,e,t-1/3)),this},setStyle:function(n){function t(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+n+" will be ignored.")}if(u=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(n)){var e,i=u[1],r=u[2];switch(i){case"rgb":case"rgba":if(e=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(r))return this.r=Math.min(255,parseInt(e[1],10))/255,this.g=Math.min(255,parseInt(e[2],10))/255,this.b=Math.min(255,parseInt(e[3],10))/255,t(e[5]),this;if(e=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(r))return this.r=Math.min(100,parseInt(e[1],10))/100,this.g=Math.min(100,parseInt(e[2],10))/100,this.b=Math.min(100,parseInt(e[3],10))/100,t(e[5]),this;break;case"hsl":case"hsla":if(e=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(r)){var o=parseFloat(e[1])/360,s=parseInt(e[2],10)/100,a=parseInt(e[3],10)/100;return t(e[5]),this.setHSL(o,s,a)}}}else if(u=/^\#([A-Fa-f0-9]+)$/.exec(n)){var i=u[1],u=i.length;if(3===u)return this.r=parseInt(i.charAt(0)+i.charAt(0),16)/255,this.g=parseInt(i.charAt(1)+i.charAt(1),16)/255,this.b=parseInt(i.charAt(2)+i.charAt(2),16)/255,this;if(6===u)return this.r=parseInt(i.charAt(0)+i.charAt(1),16)/255,this.g=parseInt(i.charAt(2)+i.charAt(3),16)/255,this.b=parseInt(i.charAt(4)+i.charAt(5),16)/255,this}return n&&0<n.length?this.setColorName(n):this},setColorName:function(t){var n=yi[t];return void 0!==n?this.setHex(n):console.warn("THREE.Color: Unknown color "+t),this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this},copyGammaToLinear:function(t,n){return void 0===n&&(n=2),this.r=Math.pow(t.r,n),this.g=Math.pow(t.g,n),this.b=Math.pow(t.b,n),this},copyLinearToGamma:function(t,n){n=0<(n=void 0===n?2:n)?1/n:1;return this.r=Math.pow(t.r,n),this.g=Math.pow(t.g,n),this.b=Math.pow(t.b,n),this},convertGammaToLinear:function(t){return this.copyGammaToLinear(this,t),this},convertLinearToGamma:function(t){return this.copyLinearToGamma(this,t),this},copySRGBToLinear:function(t){return this.r=Mi(t.r),this.g=Mi(t.g),this.b=Mi(t.b),this},copyLinearToSRGB:function(t){return this.r=Si(t.r),this.g=Si(t.g),this.b=Si(t.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(t){void 0===t&&(console.warn("THREE.Color: .getHSL() target is now required"),t={h:0,s:0,l:0});var n,e=this.r,i=this.g,r=this.b,o=Math.max(e,i,r),s=Math.min(e,i,r),a=(s+o)/2;if(s===o)h=n=0;else{var u=o-s,h=a<=.5?u/(o+s):u/(2-o-s);switch(o){case e:n=(i-r)/u+(i<r?6:0);break;case i:n=(r-e)/u+2;break;case r:n=(e-i)/u+4}n/=6}return t.h=n,t.s=h,t.l=a,t},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:function(t,n,e){return this.getHSL(bi),bi.h+=t,bi.s+=n,bi.l+=e,this.setHSL(bi.h,bi.s,bi.l),this},add:function(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this},addColors:function(t,n){return this.r=t.r+n.r,this.g=t.g+n.g,this.b=t.b+n.b,this},addScalar:function(t){return this.r+=t,this.g+=t,this.b+=t,this},sub:function(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this},multiply:function(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this},multiplyScalar:function(t){return this.r*=t,this.g*=t,this.b*=t,this},lerp:function(t,n){return this.r+=(t.r-this.r)*n,this.g+=(t.g-this.g)*n,this.b+=(t.b-this.b)*n,this},lerpHSL:function(t,n){this.getHSL(bi),t.getHSL(wi);var e=Mt.lerp(bi.h,wi.h,n),t=Mt.lerp(bi.s,wi.s,n),n=Mt.lerp(bi.l,wi.l,n);return this.setHSL(e,t,n),this},equals:function(t){return t.r===this.r&&t.g===this.g&&t.b===this.b},fromArray:function(t,n){return this.r=t[n=void 0===n?0:n],this.g=t[n+1],this.b=t[n+2],this},toArray:function(t,n){return(t=void 0===t?[]:t)[n=void 0===n?0:n]=this.r,t[n+1]=this.g,t[n+2]=this.b,t}}),_i.NAMES=yi;var Ti=function(){function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t)}var n,e,i;return n=t,i=[{key:"round",value:function(t){return 0<t.toFixed(2)?Math.ceil(t.toFixed(2)):Math.floor(t.toFixed(2))}},{key:"generateUUID",value:function(){for(var t=[],n=0;n<256;n++)t[n]=(n<16?"0":"")+n.toString(16);var e=4294967295*Math.random()|0,i=4294967295*Math.random()|0,r=4294967295*Math.random()|0,o=4294967295*Math.random()|0,o=t[255&e]+t[e>>8&255]+t[e>>16&255]+t[e>>24&255]+"-"+t[255&i]+t[i>>8&255]+"-"+t[i>>16&15|64]+t[i>>24&255]+"-"+t[63&r|128]+t[r>>8&255]+"-"+t[r>>16&255]+t[r>>24&255]+t[255&o]+t[o>>8&255]+t[o>>16&255]+t[o>>24&255];return t.length=0,o.toUpperCase()}},{key:"findNearNthPowerOfTwo",value:function(t){t-=1;return t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,(t|=t>>16)<0?1:1+t}},{key:"toRgba",value:function(t){if(void 0===t)return t;if("number"==typeof t)return"rgba("+parseInt(255*new _i(t).r)+","+parseInt(255*new _i(t).g)+","+parseInt(255*new _i(t).b)+",1)";var n=t.split(",");return 3<=n.length?"rgba("+parseInt(n[0])+","+parseInt(n[1])+","+parseInt(n[2])+",1)":t}},{key:"toColor",value:function(t){if("number"==typeof t)return t;var n=t.split(",");return 3<=n.length?parseInt(n[0])<<16|parseInt(n[1])<<8|parseInt(n[2]):(console.error("color format error",t),0)}}],(e=null)&&Ei(n.prototype,e),i&&Ei(n,i),t}();function Li(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var Ri=function(){function n(t){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,n),this.Q=(t=t||{}).src,this.$=t.dest,this.tt=null,this.nt=[],this.et=0,this.it=0,this.rt=0,this.ot=pi.THOUSAND,this.st=!1,this.ut=!1,this.ht=!0,this.ct=null,this.ft=null,this.lt=Ti.generateUUID()}var t,e,i;return t=n,(e=[{key:"play",value:function(){return this.dt()}},{key:"pause",value:function(){return this.ut=!0,this}},{key:"resume",value:function(){return this.ut=!1,this.et+=this.rt,this.rt=0,this}},{key:"stop",value:function(){return this.ht=!0,this}},{key:"finish",value:function(){return this.ht=!0,this.ft&&this.ft(),this.nt=[],this}}])&&Li(t.prototype,e),i&&Li(t,i),n}();Object.assign(Ri.prototype,{vt:function(){for(var t in this)this[""+t]=null,delete this[""+t]},pt:function(t){return this.Q=t,this},mt:function(t){return this.$=t,this},gt:function(t){return this.ot=t*pi.THOUSAND,this},yt:function(t){return this.it=t*pi.THOUSAND,this},bt:function(t){return this.ct=t,this},wt:function(t){return this.ft=t,this},_t:function(t){return this.st=t,this},dt:function(){return this.ht=!1,this.tt&&(this.et=this.tt.xt),this},Mt:function(){var t=new this.constructor({src:this.Q,dest:this.$});return t.et=this.et,t.it=this.it,t.ot=this.ot,t.st=this.st,t.ct=this.ct,t.ft=this.ft,t},St:function(){var t=this.$.concat(),n=this.Q.concat();return this.Q=t,this.$=n,this}});var Oi=Ri,Ai={RIGHT:2,LEFT:4,BOTTOM:8,TOP:16,RIGHT_BOTTOM:32,LEFT_BOTTOM:64,RIGHT_TOP:128,LEFT_TOP:256,CENTER:512};Object.freeze(Ai);var ki=Ai;function Ci(t,n,e,i){this.x=t||0,this.y=n||0,this.z=e||0,this.w=void 0!==i?i:1}function ji(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}Object.defineProperties(Ci.prototype,{width:{get:function(){return this.z},set:function(t){this.z=t}},height:{get:function(){return this.w},set:function(t){this.w=t}}}),Object.assign(Ci.prototype,{isVector4:!0,set:function(t,n,e,i){return this.x=t,this.y=n,this.z=e,this.w=i,this},setScalar:function(t){return this.x=t,this.y=t,this.z=t,this.w=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setW:function(t){return this.w=t,this},setComponent:function(t,n){switch(t){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;case 3:this.w=n;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){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: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this},add:function(t,n){return void 0!==n?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,n)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this},addVectors:function(t,n){return this.x=t.x+n.x,this.y=t.y+n.y,this.z=t.z+n.z,this.w=t.w+n.w,this},addScaledVector:function(t,n){return this.x+=t.x*n,this.y+=t.y*n,this.z+=t.z*n,this.w+=t.w*n,this},sub:function(t,n){return void 0!==n?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,n)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this},subVectors:function(t,n){return this.x=t.x-n.x,this.y=t.y-n.y,this.z=t.z-n.z,this.w=t.w-n.w,this},multiplyScalar:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},applyMatrix4:function(t){var n=this.x,e=this.y,i=this.z,r=this.w,t=t.elements;return this.x=t[0]*n+t[4]*e+t[8]*i+t[12]*r,this.y=t[1]*n+t[5]*e+t[9]*i+t[13]*r,this.z=t[2]*n+t[6]*e+t[10]*i+t[14]*r,this.w=t[3]*n+t[7]*e+t[11]*i+t[15]*r,this},divideScalar:function(t){return this.multiplyScalar(1/t)},setAxisAngleFromQuaternion:function(t){this.w=2*Math.acos(t.w);var n=Math.sqrt(1-t.w*t.w);return n<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/n,this.y=t.y/n,this.z=t.z/n),this},setAxisAngleFromRotationMatrix:function(t){var n,e,i,r=t.elements,o=r[0],s=r[4],a=r[8],u=r[1],h=r[5],c=r[9],f=r[2],l=r[6],d=r[10];if(Math.abs(s-u)<.01&&Math.abs(a-f)<.01&&Math.abs(c-l)<.01){if(Math.abs(s+u)<.1&&Math.abs(a+f)<.1&&Math.abs(c+l)<.1&&Math.abs(o+h+d-3)<.1)return this.set(1,0,0,0),this;var v=Math.PI,p=(o+1)/2,m=(h+1)/2,g=(d+1)/2,y=(s+u)/4,t=(a+f)/4,r=(c+l)/4;return m<p&&g<p?i=p<.01?(n=0,e=.707106781):(e=y/(n=Math.sqrt(p)),t/n):g<m?i=m<.01?(e=0,n=.707106781):(n=y/(e=Math.sqrt(m)),r/e):g<.01?(e=n=.707106781,i=0):(n=t/(i=Math.sqrt(g)),e=r/i),this.set(n,e,i,v),this}v=Math.sqrt((l-c)*(l-c)+(a-f)*(a-f)+(u-s)*(u-s));return Math.abs(v)<.001&&(v=1),this.x=(l-c)/v,this.y=(a-f)/v,this.z=(u-s)/v,this.w=Math.acos((o+h+d-1)/2),this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this},clamp:function(t,n){return this.x=Math.max(t.x,Math.min(n.x,this.x)),this.y=Math.max(t.y,Math.min(n.y,this.y)),this.z=Math.max(t.z,Math.min(n.z,this.z)),this.w=Math.max(t.w,Math.min(n.w,this.w)),this},clampScalar:function(t,n){return this.x=Math.max(t,Math.min(n,this.x)),this.y=Math.max(t,Math.min(n,this.y)),this.z=Math.max(t,Math.min(n,this.z)),this.w=Math.max(t,Math.min(n,this.w)),this},clampLength:function(t,n){var e=this.length();return this.divideScalar(e||1).multiplyScalar(Math.max(t,Math.min(n,e)))},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(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.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(t){return this.normalize().multiplyScalar(t)},lerp:function(t,n){return this.x+=(t.x-this.x)*n,this.y+=(t.y-this.y)*n,this.z+=(t.z-this.z)*n,this.w+=(t.w-this.w)*n,this},lerpVectors:function(t,n,e){return this.subVectors(n,t).multiplyScalar(e).add(t)},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w},fromArray:function(t,n){return this.x=t[n=void 0===n?0:n],this.y=t[n+1],this.z=t[n+2],this.w=t[n+3],this},toArray:function(t,n){return(t=void 0===t?[]:t)[n=void 0===n?0:n]=this.x,t[n+1]=this.y,t[n+2]=this.z,t[n+3]=this.w,t},fromBufferAttribute:function(t,n,e){return void 0!==e&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(n),this.y=t.getY(n),this.z=t.getZ(n),this.w=t.getW(n),this}});var Pi=function(){function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t)}var n,e,i;return n=t,i=[{key:"convertPointCoordsByCenter",value:function(t,n){return t.x=t.x-n.x,t.y=t.y-n.y,void 0!==t.z&&void 0!==n.z&&(t.z=t.z-n.z),t}},{key:"convertPointsCoordsByCenter",value:function(t,n){for(var e=0;e<t.length;e++)this.convertPointCoordsByCenter(t[e],n);return t}},{key:"getMapScaleInfo",value:function(){var t,n;return window.screen.deviceXDPI?t=window.screen.deviceXDPI:((n=document.createElement("DIV")).style.cssText="width:1in;height:1in;position:absolute;left:0px;top:0px;z-index:99;visibility:hidden",document.body.appendChild(n),t=parseInt(n.offsetWidth),n.parentNode.removeChild(n)),t/2.54}},{key:"getCenterByAnchor",value:function(t){var n=new fi(.5,.5);switch(t){case ki.LEFT:n.setX(0);break;case ki.RIGHT:n.setX(1);break;case ki.TOP:n.setY(1);break;case ki.BOTTOM:n.setY(0);break;case ki.LEFT_TOP:n.set(0,1);break;case ki.RIGHT_TOP:n.set(1,1);break;case ki.LEFT_BOTTOM:n.set(0,0);break;case ki.RIGHT_BOTTOM:n.set(1,0)}return n}},{key:"uniqWithArrayOne",value:function(t){var n=[];return t.forEach(function(t){n.includes(t)||n.push(t)}),n}},{key:"uniqWithArrayTwo",value:function(t){if(t.length<1)return[];t=JSON.parse(JSON.stringify(t));for(var n=[],e=0;e<t.length;e++){var i=(i=this.uniqWithArrayOne(t[e])).filter(function(t){return!n.includes(t)});t[e]=i,n=n.concat(i)}return t.filter(function(t){return 0<t.length})}}],(e=null)&&ji(n.prototype,e),i&&ji(n,i),t}(),Di={NONE:0,EXTRUDE_MARKER:2,IMAGE_MARKER:8,LOCATION_MARKER:16,POLYGON_MARKER:32,TEXT_MARKER:64,LINE_MARKER:128,LINE3D_MARKER:256,HEAT_MAP_MARKER:512,EXTENT:1024,EXTERNAL_MODEL:2048,MODEL:4096,FACILITY:8192,LABEL:16384,DYNAMIC_MODEL_MARKER:32768,DOM_MARKER:65536,SPHERE_MARKER:1<<17,EXTENT_LAYER:1<<20,EXTERNAL_MODEL_LAYER:1<<21,MODEL_LAYER:1<<22,FACILITY_LAYER:1<<23,LABEL_LAYER:1<<24,MARKER_GROUP:1<<25,FLOW_LINE_LAYER:1<<27,FLOW_LINE_MARKER:1<<27,FIRE_MARKER:1<<28,WALL_MARKER:1<<29,TUBE_MARKER:1<<30};Di.LAYER_NODE_TYPE=new Map,Di.LAYER_NODE_TYPE.set(Di.EXTENT_LAYER,Di.EXTENT),Di.LAYER_NODE_TYPE.set(Di.EXTERNAL_MODEL_LAYER,Di.EXTERNAL_MODEL),Di.LAYER_NODE_TYPE.set(Di.MODEL_LAYER,Di.MODEL),Di.LAYER_NODE_TYPE.set(Di.FACILITY_LAYER,Di.FACILITY),Di.LAYER_NODE_TYPE.set(Di.LABEL_LAYER,Di.LABEL),Di.LAYER_NODE_TYPE.set(Di.DOM_MARKER,Di.DOM_MARKER),Di.LAYER_NODE_TYPE.set(Di.DYNAMIC_MODEL_MARKER,Di.DYNAMIC_MODEL_MARKER),Di.LAYER_NODE_TYPE.set(Di.EXTRUDE_MARKER,Di.EXTRUDE_MARKER),Di.LAYER_NODE_TYPE.set(Di.HEAT_MAP_MARKER,Di.HEAT_MAP_MARKER),Di.LAYER_NODE_TYPE.set(Di.LINE_MARKER,Di.LINE_MARKER),Di.LAYER_NODE_TYPE.set(Di.LOCATION_MARKER,Di.LOCATION_MARKER),Di.LAYER_NODE_TYPE.set(Di.POLYGON_MARKER,Di.POLYGON_MARKER),Di.LAYER_NODE_TYPE.set(Di.TEXT_MARKER,Di.TEXT_MARKER),Di.LAYER_NODE_TYPE.set(Di.IMAGE_MARKER,Di.IMAGE_MARKER),Di.LAYER_NODE_TYPE.set(Di.FLOW_LINE_LAYER,Di.FLOW_LINE_MARKER),Di.LAYER_NODE_TYPE.set(Di.FIRE_MARKER,Di.FIRE_MARKER),Di.LAYER_NODE_TYPE.set(Di.WALL_MARKER,Di.WALL_MARKER),Di.LAYER_NODE_TYPE.set(Di.TUBE_MARKER,Di.TUBE_MARKER),Di.LAYER_NODE_TYPE.set(Di.LINE3D_MARKER,Di.LINE3D_MARKER),Di.LAYER_NODE_TYPE.set(Di.SPHERE_MARKER,Di.SPHERE_MARKER);var Ii=Di,Ni={NAME_KEY_ERROR:0,MAP_ID_URL_ERROR:2,THEME_ID_URL_ERROR:4,LICENSE_ERROR:8,PATH_ERROR:404,INFO:32,DEFAULT_LEVEL_ERROR:64};function Fi(t){return function(t){if(Array.isArray(t))return Ui(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,n){if(t){if("string"==typeof t)return Ui(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(e="Object"===e&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Ui(t,n):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ui(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}function Bi(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var Gi=function(){function r(t,n,e){var i=this;!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),this.W=t,this.Et=e,this.Tt=[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],this.K=[],this.Lt=new Map,this.Rt=null,this.Ot=this.Et.At,this.kt=null,this.Ct=new di(this.W.jt,n,this.W),this.Ct.enableDamping=this.W.Pt.enableDamping,this.Ct.dampingFactor=.08,this.Ct.addEventListener("change",function(t){i.ft(),i.W.It.Dt({type:"viewChanged"})});n=!this.W.Pt.lock;this.Ct.enableZoom=n,this.Ct.enablePan=n,this.Ct.enableRotate=n,this.Ct.enableRotateLeft=n,this.Ct.enableRotateUp=n,this.Nt=n,this.Ft=n,this.Ut=n,this.Bt=n,this.Gt=this.Ct.useRange}var t,n,e;return t=r,(n=[{key:"enableZoom",get:function(){return this.Nt},set:function(t){this.Nt=t,this.Ct.enableZoom=t}},{key:"enableDragRange",get:function(){return this.Gt},set:function(t){this.Gt=t}},{key:"enableDrag",get:function(){return this.Ft},set:function(t){this.Ft=t,this.Ct.enablePan=t}},{key:"enableRotate",get:function(){return this.Ut},set:function(t){this.Ut=t,this.Ct.enableRotateLeft=t}},{key:"enableTilt",get:function(){return this.Bt},set:function(t){this.Bt=t,this.Ct.enableRotateUp=t}},{key:"enableDamping",get:function(){return this.Ct.enableDamping},set:function(t){this.Ct.enableDamping=t}},{key:"controls",get:function(){return this.Ct},set:function(t){this.Ct=t}},{key:"copyControls",value:function(t){t=new di(t,this.Ct.domElement,this.W);return t.target=(new St).copy(this.Ct.target),t.maxDistance=this.Ct.maxDistance,t.minDistance=this.Ct.minDistance,t.minZoom=this.Ct.minZoom,t.maxZoom=this.Ct.maxZoom,t.minPolarAngle=this.Ct.minPolarAngle,t.maxPolarAngle=this.Ct.maxPolarAngle,t.update({theta:this.Ct.getAzimuthalAngle()}),t}},{key:"pauseDamping",value:function(){this.Ct&&this.Ct.pauseDamping()}},{key:"resumeDamping",value:function(){this.Ct&&this.Ct.pauseDamping()}}])&&Bi(t.prototype,n),e&&Bi(t,e),r}();Object.assign(Gi.prototype,{vt:function(){for(var t in this.Ct.dispose(),this)this[""+t]=null,delete this[""+t]},Ht:function(){var t=this.Vt(this.Et.zoom),n=this.zt(t),e=this.Et.Wt,i=this.W.Zt.Xt(this.W.qt.Yt,this.W.qt.level);if(!i){var r={type:"info",InfoMode:Ni.DEFAULT_LEVEL_ERROR};return this.W.Kt.error.push(r),void this.W.It.Dt(r)}e.y=i.Jt,this.Ct.target=(new St).copy(e),this.Ct.object.lookAt(e),this.Qt(),this.Et.At===gi.MODE_3D?(r=(pi.TILT_UPPER_BOUND-this.Et.$t)*pi.DEG2RAD,i=n*Math.cos(r),r=n*Math.sin(r),this.Ct.object.position.set(e.x,e.y+i,e.z+r),this.Ct.minPolarAngle=(pi.TILT_UPPER_BOUND-this.W.Pt.maxTiltAngle)*pi.DEG2RAD,this.Ct.maxPolarAngle=(pi.TILT_UPPER_BOUND-this.W.Pt.minTiltAngle)*pi.DEG2RAD):(o=this.tn(t),this.Ct.minPolarAngle=0,this.Ct.maxPolarAngle=0,this.Ct.object.position.set(e.x,e.y+n,e.z),this.Ct.object.zoom=1/o,this.Ct.object.updateProjectionMatrix());var o=this.nn(this.Et.en);this.Ct.update({theta:this.Ct.getAzimuthalAngle()+o})},in:function(t){this.Ct.target=t,this.Ct.update()},rn:function(e){var i,t,n,r=this;this.Ot!==e.mode?(this.Ot=e.mode,i=this.Ct,this.kt&&!1===this.kt.ht&&this.kt.finish(),e.mode===gi.MODE_2D?(i.minPolarAngle=-90*pi.DEG2RAD,this.Et.$t=this.W.getTilt(),this.sn({animate:void 0===e.animate||e.animate,duration:1,tilt:90,finish:function(){i.maxPolarAngle=0;var t=r.W.an,n=r.un(),n=r.tn(n);t.quaternion.copy(i.object.quaternion),t.position.copy(i.object.position),t.zoom=1/n,t.updateProjectionMatrix(),i.object=t,i.update(),r.W.jt=t,r.W.cn.hn(),e.finish&&e.finish(),r.W.It.Dt({type:"viewModeChanged"})}})):e.mode===gi.MODE_3D&&(i.maxPolarAngle=(pi.TILT_UPPER_BOUND-this.W.Pt.minTiltAngle)*pi.DEG2RAD,t=this.W.ln,n=this.dn(),n=this.zt(n),t.quaternion.copy(i.object.quaternion),t.position.copy(i.object.position),t.position.setY(i.target.y+n),t.updateMatrix(),i.object=t,i.update(),this.W.jt=t,this.W.cn.hn(),this.sn({animate:void 0===e.animate||e.animate,duration:1,tilt:this.Et.$t,finish:e.finish}),this.W.It.Dt({type:"viewModeChanged"}))):e.mode===this.W.getViewMode()&&e.finish&&e.finish()},sn:function(t){var n,e=this,i=this.Ct,r=t.finish;"animate"in t&&!t.animate?(i.update({phi:(pi.TILT_UPPER_BOUND-t.tilt)*pi.DEG2RAD}),i.update(),r&&r()):(null===this.kt&&(this.kt=new Oi),n=Number.isFinite(t.duration)?t.duration:.5,this.kt.pt([this.W.getTilt()]).mt([t.tilt]).gt(n).bt(function(t){i.update({phi:(pi.TILT_UPPER_BOUND-t.destination[0])*pi.DEG2RAD})}).wt(function(){i.update({phi:(pi.TILT_UPPER_BOUND-t.tilt)*pi.DEG2RAD}),i.update(),e.W.pn.vn(e.kt),r&&r()}),this.W.pn.mn(this.kt.dt()))},gn:function(t){var n=this,t=this.W.getZoom()*t,e=new Oi({src:[this.W.getZoom()],dest:[t]});t>this.Et.yn[1]||t<this.Et.yn[0]||(e.gt(.5).bt(function(t){return n.W.setZoom({animate:!1,zoom:t.destination[0]})}).wt(function(){return n.W.pn.vn(e)}),this.W.pn.mn(e.dt()))},bn:function(){var t=this.W.jt.isPerspectiveCamera?this.un():this.dn();return this.wn(t)},_n:function(t){var n=this;this.Et.zoom=t.zoom;var e,i,r=Number.isFinite(t.duration)?t.duration:.5,o=this.Vt(this.Et.zoom),s=this.zt(o),a=this.Ct.object.position.distanceTo(this.Ct.target),u=(new St).copy(this.Ct.object.position).sub(this.Ct.target).normalize(),h=(new St).copy(u).multiplyScalar(s-a);this.W.jt.isPerspectiveCamera?"animate"in t&&!t.animate?(this.Ct.update({offset:h}),t.finish&&t.finish()):((e=new Oi({src:[0,0,0],dest:[h.x,h.y,h.z]})).gt(r).bt(function(t){n.Ct.update({offset:new St(t.delta[0],t.delta[1],t.delta[2])})}).wt(function(){n.W.pn.vn(e),t.finish&&t.finish()}),this.W.pn.mn(e.dt())):"animate"in t&&!t.animate?(a=this.tn(o),this.W.jt.zoom=1/a,this.W.jt.updateProjectionMatrix(),this.W.cn.hn(),this.Ct.update({offset:h}),t.finish&&t.finish()):((i=new Oi({src:[this.dn()],dest:[o]})).gt(r).bt(function(t){t=n.tn(t.destination[0]);n.W.jt.zoom=1/t,n.W.jt.updateProjectionMatrix(),n.W.cn.hn(),n.W.enableUpdateRender()}).wt(function(){n.Ct.update({offset:h}),n.W.pn.vn(i),t.finish&&t.finish()}),this.W.pn.mn(i.dt()))},xn:function(t){this.Et.yn=t,this.Qt(),this.Ct.update()},Qt:function(){var t=this.Vt(this.Et.yn[0]),n=this.Vt(this.Et.yn[1]);this.Ct.maxDistance=this.zt(t),this.Ct.minDistance=this.zt(n),this.Ct.minZoom=1/this.tn(t),this.Ct.maxZoom=1/this.tn(n)},Mn:function(){var t=this.Ct.target,n=this.W.K[0];return{x:parseFloat((n.x+t.x).toFixed(4)),y:parseFloat((n.y-t.z).toFixed(4))}},Sn:function(t){var n,e,i,r=this,o=this.Ct,s=this.W.K[0],a=t.x-s.x,u=-t.y+s.y,h=o.target.x,c=o.target.z,s=t.height;!!s&&Number.isFinite(s)?(e=o.target.y,n=s):e=n=0,"animate"in t&&t.animate?(s=Number.isFinite(t.duration)?t.duration:.5,(i=new Oi({src:[h,e,c],dest:[a,n,u]})).gt(s).bt(function(t){o.panAdd({x:t.delta[0],y:t.delta[1],z:t.delta[2]}),o.update(),r.W.cn.hn()}).wt(function(){r.W.pn.vn(i),r.W.cn.hn(),t.finish&&t.finish()}),this.W.pn.mn(i.dt())):(o.panAdd({x:a-h,y:n-e,z:u-c}),o.update(),t.finish&&t.finish(),this.W.cn.hn())},En:function(n,e){function t(){i.Et.Tn(n.Yt).level=e.level,i.W.cn.Ln(),i.W.Zt.Rn();var t={type:"levelChanged",level:e.level};n!==i.W.qt&&(t.buildingID=n.Yt),i.W.It.Dt(t),i.enableDragRange&&r.saveState(),e.finish&&e.finish(e.level),i.W.cn.hn()}var i=this,r=this.Ct;n===this.W.qt||this.W.On?this.An(n,{level:e.level,animate:e.animate,duration:e.duration,callback:e.callback,finish:function(){t()}}):t()},An:function(t,n){var e=void 0!==n.duration?n.duration:.5,i=void 0===n.animate||n.animate,r=this.Ct,o=r.target.y,s=t.getFloor(n.level).Jt;i?(null===this.Rt&&(this.Rt=new Oi),this.Rt.pt([o]).mt([s]).gt(e).bt(function(t){r.panUp(t.delta[0]),r.update()}).wt(function(){r.panUp(s-r.target.y),r.update(),n.finish&&n.finish()}),this.W.pn.mn(this.Rt.dt()),n.callback&&n.callback(this.Rt)):(r.panUp(s-o),r.update(),n.callback&&n.callback(null),n.finish&&n.finish())},kn:function(){var t=Ti.round(-this.Ct.getAzimuthalAngle()*pi.RAD2DEG);return 360<(t=t<0?360+t:t)&&(t%=360),t},nn:function(t){t=-t%360*pi.DEG2RAD-this.Ct.getAzimuthalAngle();return t=0!==t?Math.sin(t)/Math.abs(Math.sin(t))*Math.acos(Math.cos(t)):t},Cn:function(t){var n,e=this,i=void 0!==t.loop&&t.loop,r=void 0!==t.direction?t.direction:0,o=this.Ct.getAzimuthalAngle();if(n=i?0===r?o-2*Math.PI:2*Math.PI+o:o+this.nn(t.rotation),!("animate"in t)||t.animate){var r=t&&t.duration&&Number.isFinite(t.duration)?t.duration:.5,s=new Oi({src:[o],dest:[n]});return s.gt(r)._t(i).bt(function(t){e.Ct.update({theta:t.destination[0]})}).wt(function(){i||e.W.pn.vn(s),t.finish&&t.finish()}),this.W.pn.mn(s.dt()),s}this.Ct.update({theta:n}),t.finish&&t.finish()},mn:function(t){var n;(n=this.K).push.apply(n,Fi(t))},ft:function(){for(var t=0;t<this.K.length;t++)this.K[t].call(this.W.cn)},Vt:function(t){var n=this.Tt.length-1;--t,t=Math.max(0,Math.min(t,n));var e=Math.floor(t),i=t-e,t=Math.max(0,Math.min(e,n)),n=Math.max(0,Math.min(e+1,n)),n=this.Tt[t]-this.Tt[n];return this.Tt[e]-n*i},wn:function(t){for(var n=0,e=.1,i=!1,r=0;r<this.Tt.length-1;r++)if(t<=this.Tt[r]&&t>this.Tt[r+1]){e=(this.Tt[n=r]-t)/(this.Tt[r]-this.Tt[r+1]),i=!0;break}var o;return i?parseFloat((n+1+e).toFixed(2)):(o=this.Tt.length-1,t<=this.Tt[o]?1+o:1)},zt:function(t){return t/100*(this.W.cn.renderer.domElement.clientHeight/Pi.getMapScaleInfo())/2/Math.tan(pi.FOV/2*pi.DEG2RAD)},un:function(){return(new St).copy(this.Ct.object.position).sub(this.Ct.target).length()*(100*Math.tan(pi.FOV/2*pi.DEG2RAD)*2/(this.W.cn.renderer.domElement.clientHeight/Pi.getMapScaleInfo()))},dn:function(){var t=this.W.jt.top,n=this.W.jt.bottom;return Math.abs(t-n)*Pi.getMapScaleInfo()*100/this.W.cn.renderer.domElement.clientHeight/this.W.jt.zoom},tn:function(t){var n=this.W.an.top,e=this.W.an.bottom;return t/(Math.abs(n-e)*Pi.getMapScaleInfo()*100/this.W.cn.renderer.domElement.clientHeight)},Y:function(){try{var t=!1,n=this.W.camera,e=this.W.getFloor(this.W.getLevel()).getLayers(Ii.EXTENT_LAYER)[0],i=new Tt;if(i.setFromProjectionMatrix((new Et).multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse)),this.W.Pt.panRangeValue){for(var r=null,o=0;o<e.K.length;o++)e.K[o].jn&&(r=e.K[o].jn);if(null===r)return!1;var s=r.geometry.boundingSphere,a=new it;a.copy(s).applyMatrix4(r.matrixWorld);var u=this.W.Pt.panRangeValue,h=new it(new St(u.center.x-this.W.x,a.center.y,this.W.y-u.center.y),u.radius);return i.intersectsSphere(h)}for(var c=0;c<e.K.length;c++){var f=e.K[c].jn;if(f){var l=f.geometry.boundingSphere,d=new it;if(d.copy(l).applyMatrix4(f.matrixWorld),d.radius=.5*d.radius,i.intersectsSphere(d)){t=!0;break}}}return t}catch(t){return!0}}});var Hi=Gi,Vi=new St,zi=new St,Wi=new St,Xi=new St,Zi=new St,Yi=new St,qi=new St;function Ki(t,n){this.origin=void 0!==t?t:new St,this.direction=void 0!==n?n:new St(0,0,-1)}function Ji(t,n,e,i){this.ray=new Ki(t,n),this.near=e||0,this.far=i||1/0,this.camera=null,this.layers=new x,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}},Object.defineProperties(this.params,{PointCloud:{get:function(){return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),this.Points}}})}function Qi(t,n){return t.distance-n.distance}function $i(t,n,e,i){if(t.layers.test(n.layers)&&t.raycast(n,e),!0===i)for(var r=t.children,o=0,s=r.length;o<s;o++)$i(r[o],n,e,!0)}Object.assign(Ki.prototype,{set:function(t,n){return this.origin.copy(t),this.direction.copy(n),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this},at:function(t,n){return void 0===n&&(console.warn("THREE.Ray: .at() target is now required"),n=new St),n.copy(this.direction).multiplyScalar(t).add(this.origin)},lookAt:function(t){return this.direction.copy(t).sub(this.origin).normalize(),this},recast:function(t){return this.origin.copy(this.at(t,Vi)),this},closestPointToPoint:function(t,n){void 0===n&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),n=new St),n.subVectors(t,this.origin);t=n.dot(this.direction);return t<0?n.copy(this.origin):n.copy(this.direction).multiplyScalar(t).add(this.origin)},distanceToPoint:function(t){return Math.sqrt(this.distanceSqToPoint(t))},distanceSqToPoint:function(t){var n=Vi.subVectors(t,this.origin).dot(this.direction);return n<0?this.origin.distanceToSquared(t):(Vi.copy(this.direction).multiplyScalar(n).add(this.origin),Vi.distanceToSquared(t))},distanceSqToSegment:function(t,n,e,i){zi.copy(t).add(n).multiplyScalar(.5),Wi.copy(n).sub(t).normalize(),Xi.copy(this.origin).sub(zi);var r,o,s=.5*t.distanceTo(n),a=-this.direction.dot(Wi),u=Xi.dot(this.direction),h=-Xi.dot(Wi),c=Xi.lengthSq(),t=Math.abs(1-a*a);return c=0<t?(o=a*u-h,n=s*t,0<=(r=a*h-u)?-n<=o?o<=n?(r*=t=1/t)*(r+a*(o*=t)+2*u)+o*(a*r+o+2*h)+c:(o=s,-(r=Math.max(0,-(a*o+u)))*r+o*(o+2*h)+c):(o=-s,-(r=Math.max(0,-(a*o+u)))*r+o*(o+2*h)+c):o<=-n?-(r=Math.max(0,-(-a*s+u)))*r+(o=0<r?-s:Math.min(Math.max(-s,-h),s))*(o+2*h)+c:o<=n?(r=0,(o=Math.min(Math.max(-s,-h),s))*(o+2*h)+c):-(r=Math.max(0,-(a*s+u)))*r+(o=0<r?s:Math.min(Math.max(-s,-h),s))*(o+2*h)+c):(o=0<a?-s:s,-(r=Math.max(0,-(a*o+u)))*r+o*(o+2*h)+c),e&&e.copy(this.direction).multiplyScalar(r).add(this.origin),i&&i.copy(Wi).multiplyScalar(o).add(zi),c},intersectSphere:function(t,n){Vi.subVectors(t.center,this.origin);var e=Vi.dot(this.direction),i=Vi.dot(Vi)-e*e,t=t.radius*t.radius;if(t<i)return null;t=Math.sqrt(t-i),i=e-t,t=e+t;return i<0&&t<0?null:i<0?this.at(t,n):this.at(i,n)},intersectsSphere:function(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius},distanceToPlane:function(t){var n=t.normal.dot(this.direction);if(0===n)return 0===t.distanceToPoint(this.origin)?0:null;n=-(this.origin.dot(t.normal)+t.constant)/n;return 0<=n?n:null},intersectPlane:function(t,n){t=this.distanceToPlane(t);return null===t?null:this.at(t,n)},intersectsPlane:function(t){var n=t.distanceToPoint(this.origin);return 0===n||t.normal.dot(this.direction)*n<0},intersectBox:function(t,n){var e,i,r,o=1/this.direction.x,s=1/this.direction.y,a=1/this.direction.z,u=this.origin,o=0<=o?(e=(t.min.x-u.x)*o,(t.max.x-u.x)*o):(e=(t.max.x-u.x)*o,(t.min.x-u.x)*o),s=0<=s?(i=(t.min.y-u.y)*s,(t.max.y-u.y)*s):(i=(t.max.y-u.y)*s,(t.min.y-u.y)*s);return s<e||o<i?null:((s<o||o!=o)&&(o=s),(a=0<=a?(r=(t.min.z-u.z)*a,(t.max.z-u.z)*a):(r=(t.max.z-u.z)*a,(t.min.z-u.z)*a))<(e=e<i||e!=e?i:e)||o<r?null:((e<r||e!=e)&&(e=r),(o=a<o||o!=o?a:o)<0?null:this.at(0<=e?e:o,n)))},intersectsBox:function(t){return null!==this.intersectBox(t,Vi)},intersectTriangle:function(t,n,e,i,r){Zi.subVectors(n,t),Yi.subVectors(e,t),qi.crossVectors(Zi,Yi);e=this.direction.dot(qi);if(0<e){if(i)return null;o=1}else{if(!(e<0))return null;o=-1,e=-e}Xi.subVectors(this.origin,t);i=o*this.direction.dot(Yi.crossVectors(Xi,Yi));if(i<0)return null;t=o*this.direction.dot(Zi.cross(Xi));if(t<0)return null;if(e<i+t)return null;var o=-o*Xi.dot(qi);return o<0?null:this.at(o/e,r)},applyMatrix4:function(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this},equals:function(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}}),Object.assign(Ji.prototype,{set:function(t,n){this.ray.set(t,n)},setFromCamera:function(t,n){n&&n.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(n.matrixWorld),this.ray.direction.set(t.x,t.y,.5).unproject(n).sub(this.ray.origin).normalize(),this.camera=n):n&&n.isOrthographicCamera?(this.ray.origin.set(t.x,t.y,(n.near+n.far)/(n.near-n.far)).unproject(n),this.ray.direction.set(0,0,-1).transformDirection(n.matrixWorld),this.camera=n):console.error("THREE.Raycaster: Unsupported camera type.")},intersectObject:function(t,n,e){e=e||[];return $i(t,this,e,n),e.sort(Qi),e},intersectObjects:function(t,n,e){var i=e||[];if(!1===Array.isArray(t))return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),i;for(var r=0,o=t.length;r<o;r++)$i(t[r],this,i,n);return i.sort(Qi),i}});var tr={CLASSIC:2,REAL:4};Object.freeze(tr);var nr=tr;function er(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var ir=function(){function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),this.Pn={x:Number.MAX_VALUE,y:Number.MAX_VALUE},this.Dn={x:-Number.MAX_VALUE,y:-Number.MAX_VALUE}}var n,e,i;return n=t,(e=[{key:"min",get:function(){return this.Pn}},{key:"max",get:function(){return this.Dn}},{key:"center",get:function(){var t={x:Number.NaN,y:Number.NaN};return this.valid()&&(t.x=(this.min.x+this.max.x)/2,t.y=(this.min.y+this.max.y)/2),t}},{key:"size",get:function(){var t={x:Number.NaN,y:Number.NaN};return this.valid()&&(t.x=this.max.x-this.min.x,t.y=this.max.y-this.min.y),t}},{key:"copy",value:function(t){return this.Dn.x=t.max.x,this.Dn.y=t.max.y,this.Pn.x=t.min.x,this.Pn.y=t.min.y,this}},{key:"clone",value:function(){return(new t).copy(this)}},{key:"reset",value:function(){this.Pn={x:Number.MAX_VALUE,y:Number.MAX_VALUE},this.Dn={x:-Number.MAX_VALUE,y:-Number.MAX_VALUE}}},{key:"toObject",value:function(){return{min:this.min,max:this.max,center:this.center,size:this.size}}},{key:"expand",value:function(t){this.In(t)}},{key:"expandByCoords",value:function(t){this.Nn(t)}},{key:"valid",value:function(){return this.Fn()}},{key:"isCross",value:function(t){var n=!0;return t.max.x<this.min.x&&(n=!1),t.min.x>this.max.x&&(n=!1),t.max.y<this.min.y&&(n=!1),n=t.min.y>this.max.y?!1:n}}])&&er(n.prototype,e),i&&er(n,i),t}();Object.assign(ir.prototype,{Fn:function(){return!(this.min.x>this.max.x||this.min.y>this.max.y)},In:function(t){t&&t.valid()&&(t.min.x<this.min.x&&(this.min.x=t.min.x),t.min.y<this.min.y&&(this.min.y=t.min.y),t.max.x>this.max.x&&(this.max.x=t.max.x),t.max.y>this.max.y&&(this.max.y=t.max.y))},Nn:function(t){var n=this;t&&0!=t.length&&t.forEach(function(t){t.x<n.min.x&&(n.min.x=t.x),t.y<n.min.y&&(n.min.y=t.y),t.x>n.max.x&&(n.max.x=t.x),t.y>n.max.y&&(n.max.y=t.y)})}});var rr=ir;function or(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var sr=function(){function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),this.Yt=-1,this.Un=Ii.NONE,this.Bn=!0,this.tt=null,this.K=[],this.Gn=new rr,this.Hn=!0}var n,e,i;return n=t,(e=[{key:"type",get:function(){return this.Un}},{key:"visible",get:function(){return this.Bn},set:function(t){this.Bn=t}},{key:"children",get:function(){return this.K}},{key:"parent",get:function(){return this.tt},set:function(t){this.tt=t}},{key:"needUpdateBound",get:function(){return this.Hn},set:function(t){!0===(this.Hn=t)&&null!==this.parent&&(this.parent.needUpdateBound=t)}},{key:"isLayer",get:function(){return!1}},{key:"traverse",value:function(t){if(this.K)for(var n=this.K.length-1;0<=n;n--)t(this.K[n])}},{key:"remove",value:function(t){var n=this.K.indexOf(t);-1<n&&this.K.splice(n,1),t.parent=null,this.needUpdateBound=!0}},{key:"dispose",value:function(){var t,n=this;for(t in this.traverse(function(t){n.remove(t),t.dispose()}),this.parent&&this.parent.remove(this),this)this[""+t]&&this[""+t].vt&&this[""+t].vt(),this[""+t]&&this[""+t].dispose&&this[""+t].dispose(),this[""+t]=null,delete this[""+t]}}])&&or(n.prototype,e),i&&or(n,i),t}();Object.assign(sr.prototype,{Vn:function(t){for(var n=this;n;){if(n instanceof t)return n;n=n.tt}return null}});var ar=sr;function ur(t){return(ur="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function hr(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function cr(t,n){return(cr=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function fr(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=lr(e);return t=i?(t=lr(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==ur(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function lr(t){return(lr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var dr=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&cr(t,n)}(r,ar);var t,n,e,i=fr(r);function r(t){var n;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(n=i.call(this)).Yt=t.bid,n.zn=t.bcode,n.Wn=t.mid,n.Xn=t.name,n.Zn=t.ename,n.Yn=t.alias,n.N=t.x,n.F=t.y,n.qn=t.levels,n.Kn=[],n}return t=r,(n=[{key:"type",get:function(){return this.Un}},{key:"x",get:function(){return this.N}},{key:"y",get:function(){return this.F}},{key:"bound",get:function(){var n=this;return!0===this.needUpdateBound&&(this.Gn.reset(),void 0!==this.Jn&&this.Gn.copy(this.Jn),this.K.forEach(function(t){n.Gn.expand(t.bound)}),this.needUpdateBound=!1),this.Gn.clone()}},{key:"buildingID",get:function(){return this.Yt}},{key:"bcode",get:function(){return this.zn}},{key:"name",get:function(){return this.Xn}},{key:"eName",get:function(){return this.Zn}},{key:"alias",get:function(){return this.Yn}},{key:"floorSpace",get:function(){return this.tt.Et.Tn(this.Yt).floorSpace},set:function(t){this.tt.Et.Tn(this.Yt).floorSpace=t,this.traverse(function(t){t.Qn({animate:!1})})}},{key:"level",get:function(){return this.tt.Et.Tn(this.Yt).level}},{key:"visibleLevels",get:function(){return this.tt.Et.Tn(this.Yt).visibleLevels}},{key:"getFloor",value:function(n){var e=null;return this.traverse(function(t){t.$n===n&&(e=t)}),e}},{key:"getFloorInfos",value:function(){return this.te()}},{key:"setLevel",value:function(t){this.tt.Zt.ne(this,t)}},{key:"setVisibleLevels",value:function(t,n){this.tt.Zt.ee({levels:t,building:this},n)}}])&&hr(t.prototype,n),e&&hr(t,e),r}();Object.assign(dr.prototype,{te:function(){var t,n=this;0!==this.Kn.length||(t=this.tt.re.ie.get(this.Wn))&&(this.Kn=[],t.K.forEach(function(t){n.Kn.push(t)}));for(var e={alias:"alias",floorId:"floorID",gid:"level",gname:"name"},i=Object.keys(e),r=[],o=0;o<this.Kn.length;o++){var s=this.Kn[o];r[o]={};for(var a=0;a<i.length;a++){var u=i[a],h=e[u];s[u]?r[o][h]=s[u]:r[o][h]=null}}return r}});var vr=dr;function pr(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var e=[],i=!0,r=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(i=(s=a.next()).done)&&(e.push(s.value),!n||e.length!==n);i=!0);}catch(t){r=!0,o=t}finally{try{i||null==a.return||a.return()}finally{if(r)throw o}}return e}}(t,n)||br(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function mr(t,n){var e;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(e=br(t))||n&&t&&"number"==typeof t.length){e&&(t=e);var i=0,n=function(){};return{s:n,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},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,o=!0,s=!1;return{s:function(){e=t[Symbol.iterator]()},n:function(){var t=e.next();return o=t.done,t},e:function(t){s=!0,r=t},f:function(){try{o||null==e.return||e.return()}finally{if(s)throw r}}}}function gr(t){return(gr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function yr(t){return function(t){if(Array.isArray(t))return wr(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||br(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function br(t,n){if(t){if("string"==typeof t)return wr(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(e="Object"===e&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?wr(t,n):void 0}}function wr(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}var _r=function t(n,e,i){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),this.W=n,this.Et=i,this.Pt=e,this.oe=[],this.se=null,this.ae=Ti.generateUUID(),this.ue=new Ji,this.he=new St,this.ce=0,this.fe=0,this.ft=this.ft.bind(this),this.et=0,this.W.cn.renderer.domElement.addEventListener("mousedown",this.ft,!1),this.W.cn.renderer.domElement.addEventListener("mouseup",this.ft,!1),this.W.cn.renderer.domElement.addEventListener("mousemove",this.ft,!1),this.W.cn.renderer.domElement.addEventListener("touchstart",this.ft,!1),this.W.cn.renderer.domElement.addEventListener("touchend",this.ft,!1),this.W.cn.renderer.domElement.addEventListener("touchmove",this.ft,!1)};Object.assign(_r.prototype,{vt:function(){for(var t in this.W.cn.renderer.domElement.removeEventListener("mousedown",this.ft,!1),this.W.cn.renderer.domElement.removeEventListener("mouseup",this.ft,!1),this.W.cn.renderer.domElement.removeEventListener("touchstart",this.ft,!1),this.W.cn.renderer.domElement.removeEventListener("mousemove",this.ft,!1),this.W.cn.renderer.domElement.removeEventListener("touchmove",this.ft,!1),this.W.cn.renderer.domElement.removeEventListener("touchend",this.ft,!1),delete this.W,delete this.Et,delete this.Pt,this)this[""+t]&&this[""+t].vt&&this[""+t].vt(),this[""+t]=null,delete this[""+t]},mn:function(t){var n;(n=this.oe).push.apply(n,yr(t))},ft:function(t){if(!this.Et||"mousemove"!==t.type||this.Et.le){if("mousedown"===t.type||"touchstart"===t.type)return this.et=(new Date).getTime(),void("touchstart"===t.type&&(this.ce=t.changedTouches[0].clientX,this.fe=t.changedTouches[0].clientY));if("mouseup"===t.type||"touchend"===t.type){if(200<(new Date).getTime()-this.et)return;if("touchend"===t.type&&Math.pow(t.changedTouches[0].clientX-this.ce,2)+Math.pow(t.changedTouches[0].clientY-this.fe,2)>Math.pow(t.changedTouches[0].radiusX,2))return;this.et=(new Date).getTime()}for(var n=this.de(t),e=0;e<this.oe.length;e++)this.oe[e](n);var i=this.ve(n),r=null,o=null;!i[0]||(s=i[0].Vn(vr))&&(r=i[0].level,s!==this.W.qt&&(o=s.Yt));var s="mousemove"===t.type||"touchmove"===t.type?"hover":"click",o={type:s,targets:i,coords:this.pe(n),mouseEvent:t,level:r,buildingID:o};-1<this.Pt.me.indexOf(s)&&this.ge(i),this.W.It.Dt(o)}},ge:function(s){for(var a=this,t=[Ii.MODEL,Ii.EXTERNAL_MODEL],u=0;u<s.length;u++)if(-1<t.indexOf(s[u].Un)){if(s[u]===this.se)return;if(s[u].jn){var n=function(){a.Lt&&(a.Lt.stop(),a.W.pn.vn(a.Lt)),h(a.se),a.se=s[u],a.se.ye=a.Et.highlightColor;var n=s[u].jn;if(s[u].Un===Ii.MODEL){n.userData.sourceMaterial=n.material,n.material=n.material.clone();var t=n.material.color,e=new _i(a.Et.highlightColor);a.Lt?(a.Lt.pt([t.r,t.g,t.b]),a.Lt.mt([e.r,e.g,e.b])):a.Lt=new Oi({src:[t.r,t.g,t.b],dest:[e.r,e.g,e.b]}),a.Lt.gt(.5).bt(function(t){t=new _i(t.destination[0],t.destination[1],t.destination[2]);n&&n.material&&(n.material.color=t),a.W.enableUpdateRender()}).wt(function(){a.Lt.stop(),a.W.pn.vn(a.Lt),n&&n.material&&(n.material.color=e),a.W.enableUpdateRender()}),a.W.pn.mn(a.Lt.dt())}else if(s[u].Un===Ii.EXTERNAL_MODEL)if("Mesh"===n.type)if(n.userData.sourceMaterial||(n.userData.sourceMaterial=n.material),Array.isArray(n.material)){for(var i=[],r=!0,o=0;o<n.material.length;o++)"MeshLambertMaterial"!==n.material[o].type?r=!1:(i[o]=n.material[o].clone(),i[o].color=new _i(a.Et.highlightColor));r&&(n.material=i)}else"MeshLambertMaterial"!==n.material.type||(n.material=n.material.clone(),n.material.color=new _i(a.Et.highlightColor));else"Scene"===n.type&&n.traverse(function(t){if("Mesh"===t.type)if(t.userData.sourceMaterial||(t.userData.sourceMaterial=t.material),Array.isArray(t.material)){for(var n=[],e=0;e<t.material.length;e++){var i=a.be(t.material[e]);n.push(i)}t.material=n}else t.material=a.be(t.material)});return a.W.enableUpdateRender(),{v:void 0}}();if("object"===gr(n))return n.v}break}function h(t){var n,e;t&&(t.ye=null,(n=t.jn)&&(t.Un===Ii.MODEL?n.userData.sourceMaterial&&(e=n.material,n.material=n.userData.sourceMaterial,e.dispose(),delete n.userData.sourceMaterial):t.Un===Ii.EXTERNAL_MODEL&&("Mesh"===n.type?(n.material=n.userData.sourceMaterial,delete n.userData.sourceMaterial):"Scene"===n.type&&n.parent&&n.traverse(function(t){"Mesh"===t.type&&t.userData.sourceMaterial&&(t.material=t.userData.sourceMaterial,delete t.userData.sourceMaterial)}))))}this.Lt&&(this.Lt.stop(),this.W.pn.vn(this.Lt)),h(this.se),this.se=null,this.W.enableUpdateRender()},be:function(t){var n=this.we(t);return n.color=this.Et.highlightColor,(n=this.W.getMapOptions().materialMode===nr.REAL?this.W.Zt.xe._e(n):this.W.Zt.xe.Me(t,n)).userData=t.userData,n},we:function(t){var n={};return(n=this.W.Pt.materialMode===nr.REAL&&!t.isBasic?{USE_EMISSIVEMAP:t.defines.USE_EMISSIVEMAP,USE_MAP:t.defines.USE_MAP,USE_AOMAP:t.defines.USE_AOMAP,aoMap:t.uniforms.aoMap.value,map:t.uniforms.map.value,color:t.uniforms.diffuse.value.getHex(),emissive:t.uniforms.emissive.value.getHex(),emissiveMap:t.uniforms.emissiveMap.value,metalness:t.uniforms.metalness.value,roughness:t.uniforms.roughness.value,normalScale:t.uniforms.normalScale.value,vertexColors:t.vertexColors,side:t.side}:n).opacity=t.opacity,n.transparent=t.transparent,n},ve:function(t){for(var n=[],e=0;e<t.length;e++){var i=t[e].object;if("LineSegments"!==i.type&&!(i.isNoPickup||i.parent&&i.parent.mapNode&&i.parent.mapNode.Se&&i===i.parent.mapNode.Se.top)){for(;!i.mapNode;)i=i.parent;for(var r=!0,o=0;o<n.length;o++)if(n[o].jn&&n[o].jn.uuid===i.uuid){r=!1;break}this.W.pickFilterFunction({type:i.mapNode.Un,data:i.mapNode.Ee})&&r&&i.visible&&n.push(i.mapNode)}}return n},pe:function(t){for(var n=null,e=0;e<t.length;e++)if("LineSegments"!==t[e].object.type){n=t[e];break}if(t.length<1||!n)return{x:NaN,y:NaN,z:NaN};var i=n.point.clone();return{x:this.W.x+i.x,y:this.W.y-i.z,z:n.point.y}},de:function(t){var n,e,i,r=this,o=[];if(t.touches?(i=t.touches[0],"touchend"===t.type&&(i=t.changedTouches[0]),n=this.W.cn.renderer.domElement.getBoundingClientRect(),e=i.clientX-n.left,i=i.clientY-n.top,this.he.x=e/n.width*2-1,this.he.y=2*-(i/n.height)+1):(this.he.x=(t=t).offsetX/this.W.cn.renderer.domElement.clientWidth*2-1,this.he.y=2*-(t.offsetY/this.W.cn.renderer.domElement.clientHeight)+1),this.he.z=.5,this.ue.setFromCamera(this.he,this.W.jt),this.W.cn.bloom){var s,a=mr(this.W.cn.bloom.singleSceneList);try{for(a.s();!(s=a.n()).done;){var u,h=pr(s.value,2),c=(h[0],mr(h[1]));try{for(c.s();!(u=c.n()).done;)for(var f=pr(u.value,2),l=(f[0],f[1]),d=this.ue.intersectObject(l,!0),v=0;v<d.length;v++)o.push(d[v])}catch(t){c.e(t)}finally{c.f()}}}catch(t){a.e(t)}finally{a.f()}}if(this.W.cn.Te.forEach(function(t){for(var n=r.ue.intersectObject(t,!0),e=0;e<n.length;e++)n[e].object.visible&&!n[e].object.isNoPick&&o.push(n[e])}),this.W.cn.Le)for(var p=this.ue.intersectObject(this.W.cn.Le,!0),m=0;m<p.length;m++)p[m].object.visible&&(p[m].object.isNoPickup=!0,o.push(p[m]));return o.sort(function(t,n){return t.distance-n.distance})}});var xr=_r,Mr=0;function Sr(t,n,e,i,r,o,s,a,u,h){Object.defineProperty(this,"id",{value:Mr++}),this.uuid=Mt.generateUUID(),this.name="",this.image=void 0!==t?t:Sr.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==n?n:Sr.DEFAULT_MAPPING,this.wrapS=void 0!==e?e:En,this.wrapT=void 0!==i?i:En,this.magFilter=void 0!==r?r:An,this.minFilter=void 0!==o?o:Cn,this.anisotropy=void 0!==u?u:1,this.format=void 0!==s?s:Zn,this.internalFormat=null,this.type=void 0!==a?a:jn,this.offset=new fi(0,0),this.repeat=new fi(1,1),this.center=new fi(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new M,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==h?h:qe,this.version=0,this.onUpdate=null}function Er(t,n,e,i,r,o,s,a,u,h,c,f){Sr.call(this,null,o,s,a,u,h,i,r,c,f),this.image={data:t||null,width:n||1,height:e||1},this.magFilter=void 0!==u?u:Ln,this.minFilter=void 0!==h?h:Ln,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}Sr.DEFAULT_IMAGE=void 0,Sr.DEFAULT_MAPPING=300,Sr.prototype=Object.assign(Object.create(y.prototype),{constructor:Sr,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(t){return this.name=t.name,this.image=t.image,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.encoding=t.encoding,this},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(t){if(300!==this.mapping)return t;if(t.applyMatrix3(this.matrix),t.x<0||1<t.x)switch(this.wrapS){case Sn:t.x=t.x-Math.floor(t.x);break;case En:t.x=t.x<0?0:1;break;case Tn:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||1<t.y)switch(this.wrapT){case Sn:t.y=t.y-Math.floor(t.y);break;case En:t.y=t.y<0?0:1;break;case Tn:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}return this.flipY&&(t.y=1-t.y),t}}),Object.defineProperty(Sr.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),((Er.prototype=Object.create(Sr.prototype)).constructor=Er).prototype.isDataTexture=!0;var Tr={common:{diffuse:{value:new _i(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new M},uv2Transform:{value:new M},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 fi(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 _i(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{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 _i(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new M}},sprite:{diffuse:{value:new _i(15658734)},opacity:{value:1},center:{value:new fi(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new M}}};function Lr(){Z.call(this),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}function Rr(){var e=null,i=!1,r=null;function o(t,n){!1!==i&&(r(t,n),e.requestAnimationFrame(o))}return{start:function(){!0!==i&&null!==r&&(e.requestAnimationFrame(o),i=!0)},stop:function(){i=!1},setAnimationLoop:function(t){r=t},setContext:function(t){e=t}}}function Or(u,t){var h=t.isWebGL2,c=new WeakMap;return{get:function(t){return t.isInterleavedBufferAttribute&&(t=t.data),c.get(t)},remove:function(t){t.isInterleavedBufferAttribute&&(t=t.data);var n=c.get(t);n&&(u.deleteBuffer(n.buffer),c.delete(t))},update:function(t,n){t.isInterleavedBufferAttribute&&(t=t.data);var e,i,r,o,s,a=c.get(t);void 0===a?c.set(t,(i=n,r=(e=t).array,o=e.usage,s=u.createBuffer(),u.bindBuffer(i,s),u.bufferData(i,r,o),e.onUploadCallback(),o=u.FLOAT,r instanceof Float32Array?o=u.FLOAT:r instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):r instanceof Uint16Array?o=u.UNSIGNED_SHORT:r instanceof Int16Array?o=u.SHORT:r instanceof Uint32Array?o=u.UNSIGNED_INT:r instanceof Int32Array?o=u.INT:r instanceof Int8Array?o=u.BYTE:r instanceof Uint8Array&&(o=u.UNSIGNED_BYTE),{buffer:s,type:o,bytesPerElement:r.BYTES_PER_ELEMENT,version:e.version})):a.version<t.version&&(o=a.buffer,r=n,n=(e=t).array,e=e.updateRange,u.bindBuffer(r,o),-1===e.count?u.bufferSubData(r,0,n):(h?u.bufferSubData(r,e.offset*n.BYTES_PER_ELEMENT,n,e.offset,e.count):u.bufferSubData(r,e.offset*n.BYTES_PER_ELEMENT,n.subarray(e.offset,e.offset+e.count)),e.count=-1),a.version=t.version)}}}function Ar(t,n,e,i,r,o){this.a=t,this.b=n,this.c=e,this.normal=i&&i.isVector3?i:new St,this.vertexNormals=Array.isArray(i)?i:[],this.color=r&&r.isColor?r:new _i,this.vertexColors=Array.isArray(r)?r:[],this.materialIndex=void 0!==o?o:0}Lr.prototype=Object.assign(Object.create(Z.prototype),{constructor:Lr,isScene:!0,copy:function(t,n){return Z.prototype.copy.call(this,t,n),null!==t.background&&(this.background=t.background.clone()),null!==t.environment&&(this.environment=t.environment.clone()),null!==t.fog&&(this.fog=t.fog.clone()),null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.autoUpdate=t.autoUpdate,this.matrixAutoUpdate=t.matrixAutoUpdate,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.assign(Ar.prototype,{clone:function(){return(new this.constructor).copy(this)},copy:function(t){this.a=t.a,this.b=t.b,this.c=t.c,this.normal.copy(t.normal),this.color.copy(t.color),this.materialIndex=t.materialIndex;for(var n=0,e=t.vertexNormals.length;n<e;n++)this.vertexNormals[n]=t.vertexNormals[n].clone();for(n=0,e=t.vertexColors.length;n<e;n++)this.vertexColors[n]=t.vertexColors[n].clone();return this}});var kr=0,Cr=new Et,jr=new Z,Pr=new St;function Dr(){Object.defineProperty(this,"id",{value:kr+=2}),this.uuid=Mt.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}Dr.prototype=Object.assign(Object.create(y.prototype),{constructor:Dr,isGeometry:!0,applyMatrix4:function(t){for(var n=(new M).getNormalMatrix(t),e=0,i=this.vertices.length;e<i;e++)this.vertices[e].applyMatrix4(t);for(e=0,i=this.faces.length;e<i;e++){var r=this.faces[e];r.normal.applyMatrix3(n).normalize();for(var o=0,s=r.vertexNormals.length;o<s;o++)r.vertexNormals[o].applyMatrix3(n).normalize()}return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},rotateX:function(t){return Cr.makeRotationX(t),this.applyMatrix4(Cr),this},rotateY:function(t){return Cr.makeRotationY(t),this.applyMatrix4(Cr),this},rotateZ:function(t){return Cr.makeRotationZ(t),this.applyMatrix4(Cr),this},translate:function(t,n,e){return Cr.makeTranslation(t,n,e),this.applyMatrix4(Cr),this},scale:function(t,n,e){return Cr.makeScale(t,n,e),this.applyMatrix4(Cr),this},lookAt:function(t){return jr.lookAt(t),jr.updateMatrix(),this.applyMatrix4(jr.matrix),this},fromBufferGeometry:function(t){var o=this,n=null!==t.index?t.index.array:void 0,e=t.attributes;if(void 0===e.position)return console.error("THREE.Geometry.fromBufferGeometry(): Position attribute required for conversion."),this;var i=e.position.array,s=void 0!==e.normal?e.normal.array:void 0,a=void 0!==e.color?e.color.array:void 0,u=void 0!==e.uv?e.uv.array:void 0,h=void 0!==e.uv2?e.uv2.array:void 0;void 0!==h&&(this.faceVertexUvs[1]=[]);for(var r=0;r<i.length;r+=3)o.vertices.push((new St).fromArray(i,r)),void 0!==a&&o.colors.push((new _i).fromArray(a,r));function c(t,n,e,i){var r=void 0===a?[]:[o.colors[t].clone(),o.colors[n].clone(),o.colors[e].clone()],i=new Ar(t,n,e,void 0===s?[]:[(new St).fromArray(s,3*t),(new St).fromArray(s,3*n),(new St).fromArray(s,3*e)],r,i);o.faces.push(i),void 0!==u&&o.faceVertexUvs[0].push([(new fi).fromArray(u,2*t),(new fi).fromArray(u,2*n),(new fi).fromArray(u,2*e)]),void 0!==h&&o.faceVertexUvs[1].push([(new fi).fromArray(h,2*t),(new fi).fromArray(h,2*n),(new fi).fromArray(h,2*e)])}var f=t.groups;if(0<f.length)for(r=0;r<f.length;r++)for(var l=f[r],d=l.start,v=d,p=d+l.count;v<p;v+=3)void 0!==n?c(n[v],n[v+1],n[v+2],l.materialIndex):c(v,v+1,v+2,l.materialIndex);else if(void 0!==n)for(r=0;r<n.length;r+=3)c(n[r],n[r+1],n[r+2]);else for(r=0;r<i.length/3;r+=3)c(r,r+1,r+2);return this.computeFaceNormals(),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(Pr).negate(),this.translate(Pr.x,Pr.y,Pr.z),this},normalize:function(){this.computeBoundingSphere();var t=this.boundingSphere.center,n=this.boundingSphere.radius,e=0===n?1:1/n,n=new Et;return n.set(e,0,0,-e*t.x,0,e,0,-e*t.y,0,0,e,-e*t.z,0,0,0,1),this.applyMatrix4(n),this},computeFaceNormals:function(){for(var t=new St,n=new St,e=0,i=this.faces.length;e<i;e++){var r=this.faces[e],o=this.vertices[r.a],s=this.vertices[r.b],a=this.vertices[r.c];t.subVectors(a,s),n.subVectors(o,s),t.cross(n),t.normalize(),r.normal.copy(t)}},computeVertexNormals:function(t){var n,e,i;for(void 0===t&&(t=!0),i=new Array(this.vertices.length),n=0,e=this.vertices.length;n<e;n++)i[n]=new St;if(t)for(var r,o,s,a=new St,u=new St,h=0,c=this.faces.length;h<c;h++)f=this.faces[h],r=this.vertices[f.a],o=this.vertices[f.b],s=this.vertices[f.c],a.subVectors(s,o),u.subVectors(r,o),a.cross(u),i[f.a].add(a),i[f.b].add(a),i[f.c].add(a);else for(this.computeFaceNormals(),h=0,c=this.faces.length;h<c;h++)i[(f=this.faces[h]).a].add(f.normal),i[f.b].add(f.normal),i[f.c].add(f.normal);for(n=0,e=this.vertices.length;n<e;n++)i[n].normalize();for(h=0,c=this.faces.length;h<c;h++){var f,l=(f=this.faces[h]).vertexNormals;3===l.length?(l[0].copy(i[f.a]),l[1].copy(i[f.b]),l[2].copy(i[f.c])):(l[0]=i[f.a].clone(),l[1]=i[f.b].clone(),l[2]=i[f.c].clone())}0<this.faces.length&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){var t,n;for(this.computeFaceNormals(),t=0,n=this.faces.length;t<n;t++){var e,i=(e=this.faces[t]).vertexNormals;3===i.length?(i[0].copy(e.normal),i[1].copy(e.normal),i[2].copy(e.normal)):(i[0]=e.normal.clone(),i[1]=e.normal.clone(),i[2]=e.normal.clone())}0<this.faces.length&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){var t,n,e;for(s=0,a=this.faces.length;s<a;s++)for((e=this.faces[s]).Re?e.Re.copy(e.normal):e.Re=e.normal.clone(),e.Oe||(e.Oe=[]),t=0,n=e.vertexNormals.length;t<n;t++)e.Oe[t]?e.Oe[t].copy(e.vertexNormals[t]):e.Oe[t]=e.vertexNormals[t].clone();var i=new Dr;for(i.faces=this.faces,t=0,n=this.morphTargets.length;t<n;t++){if(!this.morphNormals[t]){this.morphNormals[t]={},this.morphNormals[t].faceNormals=[],this.morphNormals[t].vertexNormals=[];for(var r=this.morphNormals[t].faceNormals,o=this.morphNormals[t].vertexNormals,s=0,a=this.faces.length;s<a;s++)u=new St,h={a:new St,b:new St,c:new St},r.push(u),o.push(h)}var u,h,c=this.morphNormals[t];for(i.vertices=this.morphTargets[t].vertices,i.computeFaceNormals(),i.computeVertexNormals(),s=0,a=this.faces.length;s<a;s++)e=this.faces[s],u=c.faceNormals[s],h=c.vertexNormals[s],u.copy(e.normal),h.a.copy(e.vertexNormals[0]),h.b.copy(e.vertexNormals[1]),h.c.copy(e.vertexNormals[2])}for(s=0,a=this.faces.length;s<a;s++)(e=this.faces[s]).normal=e.Re,e.vertexNormals=e.Oe},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new tt),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new it),this.boundingSphere.setFromPoints(this.vertices)},mergeVertices:function(){for(var t,n,e,i,r={},o=[],s=[],a=Math.pow(10,4),u=0,h=this.vertices.length;u<h;u++)t=this.vertices[u],void 0===r[t=Math.round(t.x*a)+"_"+Math.round(t.y*a)+"_"+Math.round(t.z*a)]?(r[t]=u,o.push(this.vertices[u]),s[u]=o.length-1):s[u]=s[r[t]];var c=[];for(u=0,h=this.faces.length;u<h;u++){(n=this.faces[u]).a=s[n.a],n.b=s[n.b],n.c=s[n.c];for(var f=[n.a,n.b,n.c],l=0;l<3;l++)if(f[l]===f[(l+1)%3]){c.push(u);break}}for(u=c.length-1;0<=u;u--){var d=c[u];for(this.faces.splice(d,1),e=0,i=this.faceVertexUvs.length;e<i;e++)this.faceVertexUvs[e].splice(d,1)}var v=this.vertices.length-o.length;return this.vertices=o,v},setFromPoints:function(t){this.vertices=[];for(var n=0,e=t.length;n<e;n++){var i=t[n];this.vertices.push(new St(i.x,i.y,i.z||0))}return this},sortFacesByMaterialIndex:function(){for(var t=this.faces,n=t.length,e=0;e<n;e++)t[e].Yt=e;t.sort(function(t,n){return t.materialIndex-n.materialIndex});var i,r,o=this.faceVertexUvs[0],s=this.faceVertexUvs[1];o&&o.length===n&&(i=[]),s&&s.length===n&&(r=[]);for(e=0;e<n;e++){var a=t[e].Yt;i&&i.push(o[a]),r&&r.push(s[a])}i&&(this.faceVertexUvs[0]=i),r&&(this.faceVertexUvs[1]=r)},dispose:function(){this.dispatchEvent({type:"dispose"})}});var Ir=new St;function Nr(t,n,e){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=t,this.itemSize=n,this.count=void 0!==t?t.length/n:0,this.normalized=!0===e,this.usage=hi,this.updateRange={offset:0,count:-1},this.version=0}function Fr(t,n,e){Nr.call(this,new Int8Array(t),n,e)}function Ur(t,n,e){Nr.call(this,new Uint8Array(t),n,e)}function Br(t,n,e){Nr.call(this,new Uint8ClampedArray(t),n,e)}function Gr(t,n,e){Nr.call(this,new Int16Array(t),n,e)}function Hr(t,n,e){Nr.call(this,new Uint16Array(t),n,e)}function Vr(t,n,e){Nr.call(this,new Int32Array(t),n,e)}function zr(t,n,e){Nr.call(this,new Uint32Array(t),n,e)}function Wr(t,n,e){Nr.call(this,new Float32Array(t),n,e)}function Xr(t,n,e){Nr.call(this,new Float64Array(t),n,e)}function Zr(){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 Yr(t){if(0===t.length)return-1/0;for(var n=t[0],e=1,i=t.length;e<i;++e)t[e]>n&&(n=t[e]);return n}Object.defineProperty(Nr.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(Nr.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setUsage:function(t){return this.usage=t,this},copy:function(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this},copyAt:function(t,n,e){t*=this.itemSize,e*=n.itemSize;for(var i=0,r=this.itemSize;i<r;i++)this.array[t+i]=n.array[e+i];return this},copyArray:function(t){return this.array.set(t),this},copyColorsArray:function(t){for(var n=this.array,e=0,i=0,r=t.length;i<r;i++){var o=t[i];void 0===o&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",i),o=new _i),n[e++]=o.r,n[e++]=o.g,n[e++]=o.b}return this},copyVector2sArray:function(t){for(var n=this.array,e=0,i=0,r=t.length;i<r;i++){var o=t[i];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",i),o=new fi),n[e++]=o.x,n[e++]=o.y}return this},copyVector3sArray:function(t){for(var n=this.array,e=0,i=0,r=t.length;i<r;i++){var o=t[i];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",i),o=new St),n[e++]=o.x,n[e++]=o.y,n[e++]=o.z}return this},copyVector4sArray:function(t){for(var n=this.array,e=0,i=0,r=t.length;i<r;i++){var o=t[i];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",i),o=new Ci),n[e++]=o.x,n[e++]=o.y,n[e++]=o.z,n[e++]=o.w}return this},applyMatrix3:function(t){for(var n=0,e=this.count;n<e;n++)Ir.x=this.getX(n),Ir.y=this.getY(n),Ir.z=this.getZ(n),Ir.applyMatrix3(t),this.setXYZ(n,Ir.x,Ir.y,Ir.z);return this},applyMatrix4:function(t){for(var n=0,e=this.count;n<e;n++)Ir.x=this.getX(n),Ir.y=this.getY(n),Ir.z=this.getZ(n),Ir.applyMatrix4(t),this.setXYZ(n,Ir.x,Ir.y,Ir.z);return this},applyNormalMatrix:function(t){for(var n=0,e=this.count;n<e;n++)Ir.x=this.getX(n),Ir.y=this.getY(n),Ir.z=this.getZ(n),Ir.applyNormalMatrix(t),this.setXYZ(n,Ir.x,Ir.y,Ir.z);return this},transformDirection:function(t){for(var n=0,e=this.count;n<e;n++)Ir.x=this.getX(n),Ir.y=this.getY(n),Ir.z=this.getZ(n),Ir.transformDirection(t),this.setXYZ(n,Ir.x,Ir.y,Ir.z);return this},set:function(t,n){return this.array.set(t,n=void 0===n?0:n),this},getX:function(t){return this.array[t*this.itemSize]},setX:function(t,n){return this.array[t*this.itemSize]=n,this},getY:function(t){return this.array[t*this.itemSize+1]},setY:function(t,n){return this.array[t*this.itemSize+1]=n,this},getZ:function(t){return this.array[t*this.itemSize+2]},setZ:function(t,n){return this.array[t*this.itemSize+2]=n,this},getW:function(t){return this.array[t*this.itemSize+3]},setW:function(t,n){return this.array[t*this.itemSize+3]=n,this},setXY:function(t,n,e){return t*=this.itemSize,this.array[t+0]=n,this.array[t+1]=e,this},setXYZ:function(t,n,e,i){return t*=this.itemSize,this.array[t+0]=n,this.array[t+1]=e,this.array[t+2]=i,this},setXYZW:function(t,n,e,i,r){return t*=this.itemSize,this.array[t+0]=n,this.array[t+1]=e,this.array[t+2]=i,this.array[t+3]=r,this},onUpload:function(t){return this.onUploadCallback=t,this},clone:function(){return new this.constructor(this.array,this.itemSize).copy(this)}}),(Fr.prototype=Object.create(Nr.prototype)).constructor=Fr,(Ur.prototype=Object.create(Nr.prototype)).constructor=Ur,(Br.prototype=Object.create(Nr.prototype)).constructor=Br,(Gr.prototype=Object.create(Nr.prototype)).constructor=Gr,Hr.prototype=Object.create(Nr.prototype),Hr.prototype.constructor=Hr,(Vr.prototype=Object.create(Nr.prototype)).constructor=Vr,zr.prototype=Object.create(Nr.prototype),zr.prototype.constructor=zr,(Wr.prototype=Object.create(Nr.prototype)).constructor=Wr,(Xr.prototype=Object.create(Nr.prototype)).constructor=Xr,Object.assign(Zr.prototype,{computeGroups:function(t){for(var n,e=[],i=void 0,r=t.faces,o=0;o<r.length;o++){var s=r[o];s.materialIndex!==i&&(i=s.materialIndex,void 0!==n&&(n.count=3*o-n.start,e.push(n)),n={start:3*o,materialIndex:i})}void 0!==n&&(n.count=3*o-n.start,e.push(n)),this.groups=e},fromGeometry:function(t){var n=t.faces,e=t.vertices,i=t.faceVertexUvs,r=i[0]&&0<i[0].length,o=i[1]&&0<i[1].length,s=t.morphTargets,a=s.length;if(0<a){for(var u=[],h=0;h<a;h++)u[h]={name:s[h].name,data:[]};this.morphTargets.position=u}var c=t.morphNormals,f=c.length;if(0<f){for(var l=[],h=0;h<f;h++)l[h]={name:c[h].name,data:[]};this.morphTargets.normal=l}var d=t.skinIndices,v=t.skinWeights,p=d.length===e.length,m=v.length===e.length;0<e.length&&0===n.length&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(h=0;h<n.length;h++){var g=n[h];this.vertices.push(e[g.a],e[g.b],e[g.c]);var y=g.vertexNormals;3===y.length?this.normals.push(y[0],y[1],y[2]):(w=g.normal,this.normals.push(w,w,w));var b,w=g.vertexColors;3===w.length?this.colors.push(w[0],w[1],w[2]):(w=g.color,this.colors.push(w,w,w)),!0===r&&(void 0!==(b=i[0][h])?this.uvs.push(b[0],b[1],b[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",h),this.uvs.push(new fi,new fi,new fi))),!0===o&&(void 0!==(b=i[1][h])?this.uvs2.push(b[0],b[1],b[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",h),this.uvs2.push(new fi,new fi,new fi)));for(var _=0;_<a;_++){var x=s[_].vertices;u[_].data.push(x[g.a],x[g.b],x[g.c])}for(_=0;_<f;_++){var M=c[_].vertexNormals[h];l[_].data.push(M.a,M.b,M.c)}p&&this.skinIndices.push(d[g.a],d[g.b],d[g.c]),m&&this.skinWeights.push(v[g.a],v[g.b],v[g.c])}return this.computeGroups(t),this.verticesNeedUpdate=t.verticesNeedUpdate,this.normalsNeedUpdate=t.normalsNeedUpdate,this.colorsNeedUpdate=t.colorsNeedUpdate,this.uvsNeedUpdate=t.uvsNeedUpdate,this.groupsNeedUpdate=t.groupsNeedUpdate,null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),this}});var qr=1,Kr=new Et,Jr=new Z,Qr=new St,$r=new tt,to=new tt,no=new St;function eo(){Object.defineProperty(this,"id",{value:qr+=2}),this.uuid=Mt.generateUUID(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}function io(t){return(io="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ro(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function oo(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&so(t,n)}function so(t,n){return(so=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function ao(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=ho(e);return t=i?(t=ho(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==io(t)&&"function"!=typeof t?uo(n):t}}function uo(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ho(t){return(ho=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}eo.prototype=Object.assign(Object.create(y.prototype),{constructor:eo,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(t){Array.isArray(t)?this.index=new(65535<Yr(t)?zr:Hr)(t,1):this.index=t},getAttribute:function(t){return this.attributes[t]},setAttribute:function(t,n){return this.attributes[t]=n,this},deleteAttribute:function(t){return delete this.attributes[t],this},addGroup:function(t,n,e){this.groups.push({start:t,count:n,materialIndex:void 0!==e?e:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(t,n){this.drawRange.start=t,this.drawRange.count=n},applyMatrix4:function(t){var n=this.attributes.position;void 0!==n&&(n.applyMatrix4(t),n.needsUpdate=!0);var e=this.attributes.normal;void 0!==e&&(n=(new M).getNormalMatrix(t),e.applyNormalMatrix(n),e.needsUpdate=!0);e=this.attributes.tangent;return void 0!==e&&(e.transformDirection(t),e.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(t){return Kr.makeRotationX(t),this.applyMatrix4(Kr),this},rotateY:function(t){return Kr.makeRotationY(t),this.applyMatrix4(Kr),this},rotateZ:function(t){return Kr.makeRotationZ(t),this.applyMatrix4(Kr),this},translate:function(t,n,e){return Kr.makeTranslation(t,n,e),this.applyMatrix4(Kr),this},scale:function(t,n,e){return Kr.makeScale(t,n,e),this.applyMatrix4(Kr),this},lookAt:function(t){return Jr.lookAt(t),Jr.updateMatrix(),this.applyMatrix4(Jr.matrix),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(Qr).negate(),this.translate(Qr.x,Qr.y,Qr.z),this},setFromObject:function(t){var n,e,i=t.geometry;return t.isPoints||t.isLine?(n=new Wr(3*i.vertices.length,3),e=new Wr(3*i.colors.length,3),this.setAttribute("position",n.copyVector3sArray(i.vertices)),this.setAttribute("color",e.copyColorsArray(i.colors)),i.lineDistances&&i.lineDistances.length===i.vertices.length&&(e=new Wr(i.lineDistances.length,1),this.setAttribute("lineDistance",e.copyArray(i.lineDistances))),null!==i.boundingSphere&&(this.boundingSphere=i.boundingSphere.clone()),null!==i.boundingBox&&(this.boundingBox=i.boundingBox.clone())):t.isMesh&&i&&i.isGeometry&&this.fromGeometry(i),this},setFromPoints:function(t){for(var n=[],e=0,i=t.length;e<i;e++){var r=t[e];n.push(r.x,r.y,r.z||0)}return this.setAttribute("position",new Wr(n,3)),this},updateFromObject:function(t){var n,e=t.geometry;if(t.isMesh){var i=e.Ae;if(!0===e.elementsNeedUpdate&&(i=void 0,e.elementsNeedUpdate=!1),void 0===i)return this.fromGeometry(e);i.verticesNeedUpdate=e.verticesNeedUpdate,i.normalsNeedUpdate=e.normalsNeedUpdate,i.colorsNeedUpdate=e.colorsNeedUpdate,i.uvsNeedUpdate=e.uvsNeedUpdate,i.groupsNeedUpdate=e.groupsNeedUpdate,e.verticesNeedUpdate=!1,e.normalsNeedUpdate=!1,e.colorsNeedUpdate=!1,e.uvsNeedUpdate=!1,e.groupsNeedUpdate=!1,e=i}return!0===e.verticesNeedUpdate&&(void 0!==(n=this.attributes.position)&&(n.copyVector3sArray(e.vertices),n.needsUpdate=!0),e.verticesNeedUpdate=!1),!0===e.normalsNeedUpdate&&(void 0!==(n=this.attributes.normal)&&(n.copyVector3sArray(e.normals),n.needsUpdate=!0),e.normalsNeedUpdate=!1),!0===e.colorsNeedUpdate&&(void 0!==(n=this.attributes.color)&&(n.copyColorsArray(e.colors),n.needsUpdate=!0),e.colorsNeedUpdate=!1),e.uvsNeedUpdate&&(void 0!==(n=this.attributes.uv)&&(n.copyVector2sArray(e.uvs),n.needsUpdate=!0),e.uvsNeedUpdate=!1),e.lineDistancesNeedUpdate&&(void 0!==(n=this.attributes.lineDistance)&&(n.copyArray(e.lineDistances),n.needsUpdate=!0),e.lineDistancesNeedUpdate=!1),e.groupsNeedUpdate&&(e.computeGroups(t.geometry),this.groups=e.groups,e.groupsNeedUpdate=!1),this},fromGeometry:function(t){return t.Ae=(new Zr).fromGeometry(t),this.fromDirectGeometry(t.Ae)},fromDirectGeometry:function(t){var n,e,i,r,o=new Float32Array(3*t.vertices.length);for(i in this.setAttribute("position",new Nr(o,3).copyVector3sArray(t.vertices)),0<t.normals.length&&(n=new Float32Array(3*t.normals.length),this.setAttribute("normal",new Nr(n,3).copyVector3sArray(t.normals))),0<t.colors.length&&(n=new Float32Array(3*t.colors.length),this.setAttribute("color",new Nr(n,3).copyColorsArray(t.colors))),0<t.uvs.length&&(e=new Float32Array(2*t.uvs.length),this.setAttribute("uv",new Nr(e,2).copyVector2sArray(t.uvs))),0<t.uvs2.length&&(e=new Float32Array(2*t.uvs2.length),this.setAttribute("uv2",new Nr(e,2).copyVector2sArray(t.uvs2))),this.groups=t.groups,t.morphTargets){for(var s=[],a=t.morphTargets[i],u=0,h=a.length;u<h;u++){var c=a[u],f=new Wr(3*c.data.length,3);f.name=c.name,s.push(f.copyVector3sArray(c.data))}this.morphAttributes[i]=s}return 0<t.skinIndices.length&&(r=new Wr(4*t.skinIndices.length,4),this.setAttribute("skinIndex",r.copyVector4sArray(t.skinIndices))),0<t.skinWeights.length&&(r=new Wr(4*t.skinWeights.length,4),this.setAttribute("skinWeight",r.copyVector4sArray(t.skinWeights))),null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),this},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new tt);var t=this.attributes.position,n=this.morphAttributes.position;if(void 0!==t){if(this.boundingBox.setFromBufferAttribute(t),n)for(var e=0,i=n.length;e<i;e++){var r=n[e];$r.setFromBufferAttribute(r),this.morphTargetsRelative?(no.addVectors(this.boundingBox.min,$r.min),this.boundingBox.expandByPoint(no),no.addVectors(this.boundingBox.max,$r.max),this.boundingBox.expandByPoint(no)):(this.boundingBox.expandByPoint($r.min),this.boundingBox.expandByPoint($r.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:function(){null===this.boundingSphere&&(this.boundingSphere=new it);var t=this.attributes.position,n=this.morphAttributes.position;if(t){var e=this.boundingSphere.center;if($r.setFromBufferAttribute(t),n)for(var i=0,r=n.length;i<r;i++){var o=n[i];to.setFromBufferAttribute(o),this.morphTargetsRelative?(no.addVectors($r.min,to.min),$r.expandByPoint(no),no.addVectors($r.max,to.max),$r.expandByPoint(no)):($r.expandByPoint(to.min),$r.expandByPoint(to.max))}$r.getCenter(e);for(var s=0,i=0,r=t.count;i<r;i++)no.fromBufferAttribute(t,i),s=Math.max(s,e.distanceToSquared(no));if(n)for(i=0,r=n.length;i<r;i++)for(var o=n[i],a=this.morphTargetsRelative,u=0,h=o.count;u<h;u++)no.fromBufferAttribute(o,u),a&&(Qr.fromBufferAttribute(t,u),no.add(Qr)),s=Math.max(s,e.distanceToSquared(no));this.boundingSphere.radius=Math.sqrt(s),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 t=this.index,n=this.attributes;if(n.position){var e=n.position.array;if(void 0===n.normal)this.setAttribute("normal",new Nr(new Float32Array(e.length),3));else for(var i=n.normal.array,r=0,o=i.length;r<o;r++)i[r]=0;var s,a,u,h=n.normal.array,c=new St,f=new St,l=new St,d=new St,v=new St;if(t)for(var p=t.array,r=0,o=t.count;r<o;r+=3)s=3*p[r+0],a=3*p[r+1],u=3*p[r+2],c.fromArray(e,s),f.fromArray(e,a),l.fromArray(e,u),d.subVectors(l,f),v.subVectors(c,f),d.cross(v),h[s]+=d.x,h[1+s]+=d.y,h[2+s]+=d.z,h[a]+=d.x,h[1+a]+=d.y,h[2+a]+=d.z,h[u]+=d.x,h[1+u]+=d.y,h[2+u]+=d.z;else for(r=0,o=e.length;r<o;r+=9)c.fromArray(e,r),f.fromArray(e,r+3),l.fromArray(e,r+6),d.subVectors(l,f),v.subVectors(c,f),d.cross(v),h[r]=d.x,h[r+1]=d.y,h[r+2]=d.z,h[r+3]=d.x,h[r+4]=d.y,h[r+5]=d.z,h[r+6]=d.x,h[r+7]=d.y,h[r+8]=d.z;this.normalizeNormals(),n.normal.needsUpdate=!0}},normalizeNormals:function(){for(var t=this.attributes.normal,n=0,e=t.count;n<e;n++)no.x=t.getX(n),no.y=t.getY(n),no.z=t.getZ(n),no.normalize(),t.setXYZ(n,no.x,no.y,no.z)},dispose:function(){this.dispatchEvent({type:"dispose"})}});var co=function(){oo(h,eo);var u=ao(h);function h(t,n,e,i,r,o){var s;ro(this,h),(s=u.call(this)).type="BoxBufferGeometry",s.parameters={width:t,height:n,depth:e,widthSegments:i,heightSegments:r,depthSegments:o};var L=uo(s);t=t||1,n=n||1,e=e||1,i=Math.floor(i)||1,r=Math.floor(r)||1,o=Math.floor(o)||1;var R=[],O=[],A=[],k=[],C=0,j=0;function a(t,n,e,i,r,o,s,a,u,h,c){for(var f=o/u,l=s/h,d=o/2,v=s/2,p=a/2,m=u+1,g=h+1,y=0,b=0,w=new St,_=0;_<g;_++)for(var x=_*l-v,M=0;M<m;M++)w[t]=(M*f-d)*i,w[n]=x*r,w[e]=p,O.push(w.x,w.y,w.z),w[t]=0,w[n]=0,w[e]=0<a?1:-1,A.push(w.x,w.y,w.z),k.push(M/u),k.push(1-_/h),y+=1;for(_=0;_<h;_++)for(M=0;M<u;M++){var S=C+M+m*(_+1),E=C+(M+1)+m*(_+1),T=C+(M+1)+m*_;R.push(C+M+m*_,S,T),R.push(S,E,T),b+=6}L.addGroup(j,b,c),j+=b,C+=y}return a("z","y","x",-1,-1,e,n,t,o,r,0),a("z","y","x",1,-1,e,n,-t,o,r,1),a("x","z","y",1,1,t,e,n,i,o,2),a("x","z","y",1,-1,t,e,-n,i,o,3),a("x","y","z",1,-1,t,n,e,i,r,4),a("x","y","z",-1,-1,t,n,-e,i,r,5),s.setIndex(R),s.setAttribute("position",new Wr(O,3)),s.setAttribute("normal",new Wr(A,3)),s.setAttribute("uv",new Wr(k,2)),s}return h}();function fo(t,n,e,i){eo.call(this),this.type="PlaneBufferGeometry",this.parameters={width:t,height:n,widthSegments:e,heightSegments:i};for(var r=(t=t||1)/2,o=(n=n||1)/2,s=Math.floor(e)||1,a=Math.floor(i)||1,u=s+1,h=a+1,c=t/s,f=n/a,l=[],d=[],v=[],p=[],m=0;m<h;m++)for(var g=m*f-o,y=0;y<u;y++)d.push(y*c-r,-g,0),v.push(0,0,1),p.push(y/s),p.push(1-m/a);for(m=0;m<a;m++)for(y=0;y<s;y++){var b=y+u*(m+1),w=y+1+u*(m+1),_=y+1+u*m;l.push(y+u*m,b,_),l.push(b,w,_)}this.setIndex(l),this.setAttribute("position",new Wr(d,3)),this.setAttribute("normal",new Wr(v,3)),this.setAttribute("uv",new Wr(p,2))}(fo.prototype=Object.create(eo.prototype)).constructor=fo;var lo=0;function vo(){Object.defineProperty(this,"id",{value:lo++}),this.uuid=Mt.generateUUID(),this.name="",this.type="Material",this.fog=!0,this.blending=Ct,this.side=Rt,this.flatShading=!1,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=Xt,this.blendDst=Zt,this.blendEquation=Nt,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=en,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=ui,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=ai,this.stencilZFail=ai,this.stencilZPass=ai,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.2,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0}function po(t){var n,e={};for(n in t)for(var i in e[n]={},t[n]){var r=t[n][i];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture)?e[n][i]=r.clone():Array.isArray(r)?e[n][i]=r.slice():e[n][i]=r}return e}function mo(t){for(var n={},e=0;e<t.length;e++){var i,r=po(t[e]);for(i in r)n[i]=r[i]}return n}vo.prototype=Object.assign(Object.create(y.prototype),{constructor:vo,isMaterial:!0,onBeforeCompile:function(){},setValues:function(t){if(void 0!==t)for(var n in t){var e,i=t[n];void 0!==i?"shading"!==n?void 0!==(e=this[n])?e&&e.isColor?e.set(i):e&&e.isVector3&&i&&i.isVector3?e.copy(i):this[n]=i:console.warn("THREE."+this.type+": '"+n+"' is not a property of this material."):(console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===i):console.warn("THREE.Material: '"+n+"' parameter is undefined.")}},clone:function(){return(new this.constructor).copy(this)},copy:function(t){this.name=t.name,this.fog=t.fog,this.blending=t.blending,this.side=t.side,this.flatShading=t.flatShading,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;var n=t.clippingPlanes,e=null;if(null!==n)for(var i=n.length,e=new Array(i),r=0;r!==i;++r)e[r]=n[r].clone();return this.clippingPlanes=e,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.premultipliedAlpha=t.premultipliedAlpha,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(vo.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}});var go={clone:po,merge:mo},yo="\nvoid main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n",bo="\nvoid main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}\n";function wo(t){vo.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader=yo,this.fragmentShader=bo,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!==t&&(void 0!==t.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(t))}((wo.prototype=Object.create(vo.prototype)).constructor=wo).prototype.isShaderMaterial=!0,wo.prototype.copy=function(t){return vo.prototype.copy.call(this,t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=po(t.uniforms),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.lights=t.lights,this.clipping=t.clipping,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this.extensions=t.extensions,this};var _o=new St,xo=new St,Mo=new St,So=new St,Eo=new St,To=new St,Lo=new St,Ro=new St,Oo=new St,Ao=new St;function ko(t,n,e){this.a=void 0!==t?t:new St,this.b=void 0!==n?n:new St,this.c=void 0!==e?e:new St}function Co(t){vo.call(this),this.type="MeshBasicMaterial",this.color=new _i(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=un,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.setValues(t)}Object.assign(ko,{getNormal:function(t,n,e,i){void 0===i&&(console.warn("THREE.Triangle: .getNormal() target is now required"),i=new St),i.subVectors(e,n),_o.subVectors(t,n),i.cross(_o);n=i.lengthSq();return 0<n?i.multiplyScalar(1/Math.sqrt(n)):i.set(0,0,0)},getBarycoord:function(t,n,e,i,r){_o.subVectors(i,n),xo.subVectors(e,n),Mo.subVectors(t,n);var o=_o.dot(_o),s=_o.dot(xo),i=_o.dot(Mo),e=xo.dot(xo),t=xo.dot(Mo),n=o*e-s*s;if(void 0===r&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),r=new St),0==n)return r.set(-2,-1,-1);n=1/n,e=(e*i-s*t)*n,n*=o*t-s*i;return r.set(1-e-n,n,e)},containsPoint:function(t,n,e,i){return ko.getBarycoord(t,n,e,i,So),0<=So.x&&0<=So.y&&So.x+So.y<=1},getUV:function(t,n,e,i,r,o,s,a){return this.getBarycoord(t,n,e,i,So),a.set(0,0),a.addScaledVector(r,So.x),a.addScaledVector(o,So.y),a.addScaledVector(s,So.z),a},isFrontFacing:function(t,n,e,i){return _o.subVectors(e,n),xo.subVectors(t,n),_o.cross(xo).dot(i)<0}}),Object.assign(ko.prototype,{set:function(t,n,e){return this.a.copy(t),this.b.copy(n),this.c.copy(e),this},setFromPointsAndIndices:function(t,n,e,i){return this.a.copy(t[n]),this.b.copy(t[e]),this.c.copy(t[i]),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this},getArea:function(){return _o.subVectors(this.c,this.b),xo.subVectors(this.a,this.b),.5*_o.cross(xo).length()},getMidpoint:function(t){return void 0===t&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),t=new St),t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},getNormal:function(t){return ko.getNormal(this.a,this.b,this.c,t)},getPlane:function(t){return void 0===t&&(console.warn("THREE.Triangle: .getPlane() target is now required"),t=new ut),t.setFromCoplanarPoints(this.a,this.b,this.c)},getBarycoord:function(t,n){return ko.getBarycoord(t,this.a,this.b,this.c,n)},getUV:function(t,n,e,i,r){return ko.getUV(t,this.a,this.b,this.c,n,e,i,r)},containsPoint:function(t){return ko.containsPoint(t,this.a,this.b,this.c)},isFrontFacing:function(t){return ko.isFrontFacing(this.a,this.b,this.c,t)},intersectsBox:function(t){return t.intersectsTriangle(this)},closestPointToPoint:function(t,n){void 0===n&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),n=new St);var e=this.a,i=this.b,r=this.c;Eo.subVectors(i,e),To.subVectors(r,e),Ro.subVectors(t,e);var o=Eo.dot(Ro),s=To.dot(Ro);if(o<=0&&s<=0)return n.copy(e);Oo.subVectors(t,i);var a=Eo.dot(Oo),u=To.dot(Oo);if(0<=a&&u<=a)return n.copy(i);var h=o*u-a*s;if(h<=0&&0<=o&&a<=0)return f=o/(o-a),n.copy(e).addScaledVector(Eo,f);Ao.subVectors(t,r);var c=Eo.dot(Ao),t=To.dot(Ao);if(0<=t&&c<=t)return n.copy(r);o=c*s-o*t;if(o<=0&&0<=s&&t<=0)return l=s/(s-t),n.copy(e).addScaledVector(To,l);s=a*t-c*u;if(s<=0&&0<=u-a&&0<=c-t)return Lo.subVectors(r,i),l=(u-a)/(u-a+(c-t)),n.copy(i).addScaledVector(Lo,l);var s=1/(s+o+h),f=o*s,l=h*s;return n.copy(e).addScaledVector(Eo,f).addScaledVector(To,l)},equals:function(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}),((Co.prototype=Object.create(vo.prototype)).constructor=Co).prototype.isMeshBasicMaterial=!0,Co.prototype.copy=function(t){return vo.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this};var jo=new Et,Po=new Ki,Do=new it,Io=new St,No=new St,Fo=new St,Uo=new St,Bo=new St,Go=new St,Ho=new St,Vo=new St,zo=new St,Wo=new fi,Xo=new fi,Zo=new fi,Yo=new St,qo=new St;function Ko(t,n){Z.call(this),this.type="Mesh",this.geometry=void 0!==t?t:new eo,this.material=void 0!==n?n:new Co,this.updateMorphTargets()}function Jo(t,n,e,i,r,o,s,a){n=n.side===Ot?i.intersectTriangle(s,o,r,!0,a):i.intersectTriangle(r,o,s,n.side!==At,a);if(null===n)return null;qo.copy(a),qo.applyMatrix4(t.matrixWorld);a=e.ray.origin.distanceTo(qo);return a<e.near||a>e.far?null:{distance:a,point:qo.clone(),object:t}}function Qo(t,n,e,i,r,o,s,a,u,h,c,f){Io.fromBufferAttribute(r,h),No.fromBufferAttribute(r,c),Fo.fromBufferAttribute(r,f);var l=t.morphTargetInfluences;if(n.morphTargets&&o&&l){Ho.set(0,0,0),Vo.set(0,0,0),zo.set(0,0,0);for(var d=0,v=o.length;d<v;d++){var p=l[d],m=o[d];0!==p&&(Uo.fromBufferAttribute(m,h),Bo.fromBufferAttribute(m,c),Go.fromBufferAttribute(m,f),s?(Ho.addScaledVector(Uo,p),Vo.addScaledVector(Bo,p),zo.addScaledVector(Go,p)):(Ho.addScaledVector(Uo.sub(Io),p),Vo.addScaledVector(Bo.sub(No),p),zo.addScaledVector(Go.sub(Fo),p)))}Io.add(Ho),No.add(Vo),Fo.add(zo)}i=Jo(t,n,e,i,Io,No,Fo,Yo);return i&&(a&&(Wo.fromBufferAttribute(a,h),Xo.fromBufferAttribute(a,c),Zo.fromBufferAttribute(a,f),i.uv=ko.getUV(Yo,Io,No,Fo,Wo,Xo,Zo,new fi)),u&&(Wo.fromBufferAttribute(u,h),Xo.fromBufferAttribute(u,c),Zo.fromBufferAttribute(u,f),i.uv2=ko.getUV(Yo,Io,No,Fo,Wo,Xo,Zo,new fi)),u=new Ar(h,c,f),ko.getNormal(Io,No,Fo,u.normal),i.face=u),i}Ko.prototype=Object.assign(Object.create(Z.prototype),{constructor:Ko,isMesh:!0,copy:function(t){return Z.prototype.copy.call(this,t),void 0!==t.morphTargetInfluences&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),void 0!==t.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this},updateMorphTargets:function(){var t,n,e,i=this.geometry;if(i.isBufferGeometry){var r=i.morphAttributes,o=Object.keys(r);if(0<o.length){var s=r[o[0]];if(void 0!==s)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},t=0,n=s.length;t<n;t++)e=s[t].name||String(t),this.morphTargetInfluences.push(0),this.morphTargetDictionary[e]=t}}else{i=i.morphTargets;void 0!==i&&0<i.length&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},raycast:function(t,n){var e=this.geometry,i=this.material,r=this.matrixWorld;if(void 0!==i&&(null===e.boundingSphere&&e.computeBoundingSphere(),Do.copy(e.boundingSphere),Do.applyMatrix4(r),!1!==t.ray.intersectsSphere(Do)&&(jo.getInverse(r),Po.copy(t.ray).applyMatrix4(jo),null===e.boundingBox||!1!==Po.intersectsBox(e.boundingBox))))if(e.isBufferGeometry){var o,s,a,u,h,c,f,l,d,v=e.index,p=e.attributes.position,m=e.morphAttributes.position,g=e.morphTargetsRelative,y=e.attributes.uv,b=e.attributes.uv2,w=e.groups,_=e.drawRange;if(null!==v)if(Array.isArray(i))for(u=0,c=w.length;u<c;u++)for(d=i[(l=w[u]).materialIndex],h=Math.max(l.start,_.start),f=Math.min(l.start+l.count,_.start+_.count);h<f;h+=3)o=v.getX(h),s=v.getX(h+1),a=v.getX(h+2),(k=Qo(this,d,t,Po,p,m,g,y,b,o,s,a))&&(k.faceIndex=Math.floor(h/3),k.face.materialIndex=l.materialIndex,n.push(k));else for(u=Math.max(0,_.start),c=Math.min(v.count,_.start+_.count);u<c;u+=3)o=v.getX(u),s=v.getX(u+1),a=v.getX(u+2),(k=Qo(this,i,t,Po,p,m,g,y,b,o,s,a))&&(k.faceIndex=Math.floor(u/3),n.push(k));else if(void 0!==p)if(Array.isArray(i))for(u=0,c=w.length;u<c;u++)for(d=i[(l=w[u]).materialIndex],h=Math.max(l.start,_.start),f=Math.min(l.start+l.count,_.start+_.count);h<f;h+=3)(k=Qo(this,d,t,Po,p,m,g,y,b,o=h,s=h+1,a=h+2))&&(k.faceIndex=Math.floor(h/3),k.face.materialIndex=l.materialIndex,n.push(k));else for(u=Math.max(0,_.start),c=Math.min(p.count,_.start+_.count);u<c;u+=3)(k=Qo(this,i,t,Po,p,m,g,y,b,o=u,s=u+1,a=u+2))&&(k.faceIndex=Math.floor(u/3),n.push(k))}else if(e.isGeometry){var x,M=Array.isArray(i),S=e.vertices,E=e.faces,e=e.faceVertexUvs[0];0<e.length&&(x=e);for(var T=0,L=E.length;T<L;T++){var R,O,A,k,C=E[T],j=M?i[C.materialIndex]:i;void 0!==j&&(R=S[C.a],O=S[C.b],A=S[C.c],(k=Jo(this,j,t,Po,R,O,A,Yo))&&(x&&x[T]&&(j=x[T],Wo.copy(j[0]),Xo.copy(j[1]),Zo.copy(j[2]),k.uv=ko.getUV(Yo,R,O,A,Wo,Xo,Zo,new fi)),k.face=C,k.faceIndex=T,n.push(k)))}}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var $o={alphamap_fragment:"\n#ifdef USE_ALPHAMAP\n\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n\n#endif\n",alphamap_pars_fragment:"\n#ifdef USE_ALPHAMAP\n\n\tuniform sampler2D alphaMap;\n\n#endif\n",alphatest_fragment:"\n#ifdef ALPHATEST\n\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n\n#endif\n",aomap_fragment:"\n#ifdef USE_AOMAP\n\n\t// reads channel R, compatible with a combined OcclusionRoughnessMetallic (RGB) texture\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\n\t#endif\n\n#endif\n",aomap_pars_fragment:"\n#ifdef USE_AOMAP\n\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n\n#endif\n",begin_vertex:"\nvec3 transformed = vec3( position );\n",beginnormal_vertex:"\nvec3 objectNormal = vec3( normal );\n\n#ifdef USE_TANGENT\n\n\tvec3 objectTangent = vec3( tangent.xyz );\n\n#endif\n",bsdfs:'\n\n// Analytical approximation of the DFG LUT, one half of the\n// split-sum approximation used in indirect specular lighting.\n// via \'environmentBRDF\' from "Physically Based Shading on Mobile"\n// https://www.unrealengine.com/blog/physically-based-shading-on-mobile - environmentBRDF for GGX on mobile\nvec2 integrateSpecularBRDF( const in float dotNV, const in float roughness ) {\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\n\tvec4 r = roughness * c0 + c1;\n\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\n\treturn vec2( -1.04, 1.04 ) * a004 + r.zw;\n\n}\n\nfloat punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\n\t// based upon Frostbite 3 Moving to Physically-based Rendering\n\t// page 32, equation 26: E[window1]\n\t// https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf\n\t// this is intended to be used on spot and point lights who are represented as luminous intensity\n\t// but who must be converted to luminous irradiance for surface lighting calculation\n\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\n\tif( cutoffDistance > 0.0 ) {\n\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\n\t}\n\n\treturn distanceFalloff;\n\n#else\n\n\tif( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\n\t}\n\n\treturn 1.0;\n\n#endif\n\n}\n\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\n\treturn RECIPROCAL_PI * diffuseColor;\n\n} // validated\n\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\n\t// Original approximation by Christophe Schlick \'94\n\t// float fresnel = pow( 1.0 - dotLH, 5.0 );\n\n\t// Optimized variant (presented by Epic at SIGGRAPH \'13)\n\t// https://cdn2.unrealengine.com/Resources/files/2013SiggraphPresentationsNotes-26915738.pdf\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n\n} // validated\n\nvec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) {\n\n\t// See F_Schlick\n\tfloat fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV );\n\tvec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0;\n\n\treturn Fr * fresnel + F0;\n\n}\n\n\n// Microfacet Models for Refraction through Rough Surfaces - equation (34)\n// http://graphicrants.blogspot.com/2013/08/specular-brdf-reference.html\n// alpha is "roughness squared" in Disney’s reparameterization\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\n\t// geometry term (normalized) = G(l)⋅G(v) / 4(n⋅l)(n⋅v)\n\t// also see #12151\n\n\tfloat a2 = pow2( alpha );\n\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\n\treturn 1.0 / ( gl * gv );\n\n} // validated\n\n// Moving Frostbite to Physically Based Rendering 3.0 - page 12, listing 2\n// https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\n\tfloat a2 = pow2( alpha );\n\n\t// dotNL and dotNV are explicitly swapped. This is not a mistake.\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\n\treturn 0.5 / max( gv + gl, EPSILON );\n\n}\n\n// Microfacet Models for Refraction through Rough Surfaces - equation (33)\n// http://graphicrants.blogspot.com/2013/08/specular-brdf-reference.html\n// alpha is "roughness squared" in Disney’s reparameterization\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\n\tfloat a2 = pow2( alpha );\n\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; // avoid alpha = 0 with dotNH = 1\n\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n\n}\n\n// GGX Distribution, Schlick Fresnel, GGX-Smith Visibility\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\n\tfloat alpha = pow2( roughness ); // UE4\'s roughness\n\n\tvec3 halfDir = normalize( incidentLight.direction + viewDir );\n\n\tfloat dotNL = saturate( dot( normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\n\tfloat D = D_GGX( alpha, dotNH );\n\n\treturn F * ( G * D );\n\n} // validated\n\n// Rect Area Light\n\n// Real-Time Polygonal-Light Shading with Linearly Transformed Cosines\n// by Eric Heitz, Jonathan Dupuy, Stephen Hill and David Neubelt\n// code: https://github.com/selfshadow/ltc_code/\n\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\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\n\tfloat dotNV = saturate( dot( N, V ) );\n\n\t// texture parameterized by sqrt( GGX alpha ) and sqrt( 1 - cos( theta ) )\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\n\treturn uv;\n\n}\n\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\n\t// Real-Time Area Lighting: a Journey from Research to Production (p.102)\n\t// An approximation of the form factor of a horizon-clipped rectangle.\n\n\tfloat l = length( f );\n\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n\n}\n\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\n\tfloat x = dot( v1, v2 );\n\n\tfloat y = abs( x );\n\n\t// rational polynomial approximation to theta / sin( theta ) / 2PI\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\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\n\treturn cross( v1, v2 ) * theta_sintheta;\n\n}\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\n\t// bail if point is on back side of plane of light\n\t// assumes ccw winding order of light vertices\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\n\t// construct orthonormal basis around N\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 ); // negated from paper; possibly due to a different handedness of world coordinate system\n\n\t// compute transform\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\n\t// transform rect\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\n\t// project rect onto sphere\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\n\t// calculate vector form factor\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\n\t// adjust for horizon clipping\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\n/*\n\t// alternate method of adjusting for horizon clipping (see referece)\n\t// refactoring required\n\tfloat len = length( vectorFormFactor );\n\tfloat z = vectorFormFactor.z / len;\n\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\n\t// tabulated horizon-clipped sphere, apparently...\n\tvec2 uv = vec2( z * 0.5 + 0.5, len );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\n\tfloat scale = texture2D( ltc_2, uv ).w;\n\n\tfloat result = len * scale;\n*/\n\n\treturn vec3( result );\n\n}\n\n// End Rect Area Light\n\n// ref: https://www.unrealengine.com/blog/physically-based-shading-on-mobile - environmentBRDF for GGX on mobile\nvec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\n\treturn specularColor * brdf.x + brdf.y;\n\n} // validated\n\n// Fdez-Agüera\'s "Multiple-Scattering Microfacet Model for Real-Time Image Based Lighting"\n// Approximates multiscattering in order to preserve energy.\n// http://www.jcgt.org/published/0008/01/03/\nvoid BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\n\tvec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\tvec3 FssEss = F * brdf.x + brdf.y;\n\n\tfloat Ess = brdf.x + brdf.y;\n\tfloat Ems = 1.0 - Ess;\n\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619; // 1/21\n\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n\n}\n\nfloat G_BlinnPhong_Implicit( /* const in float dotNL, const in float dotNV */ ) {\n\n\t// geometry term is (n dot l)(n dot v) / 4(n dot l)(n dot v)\n\treturn 0.25;\n\n}\n\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n\n}\n\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\n\t//float dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\n\t//float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\n\tfloat G = G_BlinnPhong_Implicit( /* dotNL, dotNV */ );\n\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\n\treturn F * ( G * D );\n\n} // validated\n\n// source: http://simonstechblog.blogspot.ca/2011/12/microfacet-brdf.html\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\n\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n\n#if defined( USE_SHEEN )\n\n// https://github.com/google/filament/blob/master/shaders/src/brdf.fs#L94\nfloat D_Charlie(float roughness, float NoH) {\n\t// Estevez and Kulla 2017, "Production Friendly Microfacet Sheen BRDF"\n\tfloat invAlpha = 1.0 / roughness;\n\tfloat cos2h = NoH * NoH;\n\tfloat sin2h = max(1.0 - cos2h, 0.0078125); // 2^(-14/2), so sin2h^2 > 0 in fp16\n\treturn (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI);\n}\n\n// https://github.com/google/filament/blob/master/shaders/src/brdf.fs#L136\nfloat V_Neubelt(float NoV, float NoL) {\n\t// Neubelt and Pettineo 2013, "Crafting a Next-gen Material Pipeline for The Order: 1886"\n\treturn saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV)));\n}\n\nvec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) {\n\n\tvec3 N = geometry.normal;\n\tvec3 V = geometry.viewDir;\n\n\tvec3 H = normalize( V + L );\n\tfloat dotNH = saturate( dot( N, H ) );\n\n\treturn specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) );\n\n}\n\n#endif\n',bumpmap_pars_fragment:"\n#ifdef USE_BUMPMAP\n\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\n\t// Bump Mapping Unparametrized Surfaces on the GPU by Morten S. Mikkelsen\n\t// http://api.unrealengine.com/attachments/Engine/Rendering/LightingAndShadows/BumpMappingWithoutTangentSpace/mm_sfgrad_bump.pdf\n\n\t// Evaluate the derivative of the height w.r.t. screen-space using forward differencing (listing 2)\n\n\tvec2 dHdxy_fwd() {\n\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\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\n\t\treturn vec2( dBx, dBy );\n\n\t}\n\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\n\t\t// Workaround for Adreno 3XX dFd*( vec3 ) bug. See #9988\n\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;\t\t// normalized\n\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\n\t\tfDet *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\n\t}\n\n#endif\n",clipping_planes_fragment:"\n#if NUM_CLIPPING_PLANES > 0\n\n\tvec4 plane;\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\n\t}\n\t#pragma unroll_loop_end\n\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\n\t\tbool clipped = true;\n\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\n\t\t}\n\t\t#pragma unroll_loop_end\n\n\t\tif ( clipped ) discard;\n\n\t#endif\n\n#endif\n",clipping_planes_pars_fragment:"\n#if NUM_CLIPPING_PLANES > 0\n\n\tvarying vec3 vClipPosition;\n\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n\n#endif\n",clipping_planes_pars_vertex:"\n#if NUM_CLIPPING_PLANES > 0\n\n\tvarying vec3 vClipPosition;\n\n#endif\n",clipping_planes_vertex:"\n#if NUM_CLIPPING_PLANES > 0\n\n\tvClipPosition = - mvPosition.xyz;\n\n#endif\n",color_fragment:"\n#ifdef USE_COLOR\n\n\tdiffuseColor.rgb *= vColor;\n\n#endif\n",color_pars_fragment:"\n#ifdef USE_COLOR\n\n\tvarying vec3 vColor;\n\n#endif\n",color_pars_vertex:"\n#ifdef USE_COLOR\n\n\tvarying vec3 vColor;\n\n#endif\n",color_vertex:"\n#ifdef USE_COLOR\n\n\tvColor.xyz = color.xyz;\n\n#endif\n",common:"\n#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\n#ifndef saturate\n// <tonemapping_pars_fragment> may have defined saturate() already\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement(a) ( 1.0 - saturate( a ) )\n\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 ) ); }\n// expects values in the range of [0,1]x[0,1], returns values in the [0,1] range.\n// do not collapse into a single function per: http://byteblacksmith.com/improvements-to-the-canonical-one-liner-glsl-rand-for-opengl-es-2-0/\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}\n\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); }\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\n\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\n\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\n\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\n\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n}\n\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t// dir can be either a direction vector or a normal vector\n\t// upper-left 3x3 of matrix is assumed to be orthogonal\n\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n\n}\n\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\n\treturn - distance * planeNormal + point;\n\n}\n\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n\n}\n\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n\n}\n\nmat3 transposeMat3( const in mat3 m ) {\n\n\tmat3 tmp;\n\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\n\treturn tmp;\n\n}\n\n// https://en.wikipedia.org/wiki/Relative_luminance\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\n\treturn dot( weights, color.rgb );\n\n}\n\nbool isPerspectiveMatrix( mat4 m ) {\n\n return m[ 2 ][ 3 ] == - 1.0;\n\n}\n",cube_uv_reflection_fragment:"\n#ifdef ENVMAP_TYPE_CUBE_UV\n\n#define cubeUV_maxMipLevel 8.0\n#define cubeUV_minMipLevel 4.0\n#define cubeUV_maxTileSize 256.0\n#define cubeUV_minTileSize 16.0\n\n// These shader functions convert between the UV coordinates of a single face of\n// a cubemap, the 0-5 integer index of a cube face, and the direction vector for\n// sampling a textureCube (not generally normalized).\n\nfloat getFace(vec3 direction) {\n vec3 absDirection = abs(direction);\n float face = -1.0;\n if (absDirection.x > absDirection.z) {\n if (absDirection.x > absDirection.y)\n face = direction.x > 0.0 ? 0.0 : 3.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n } else {\n if (absDirection.z > absDirection.y)\n face = direction.z > 0.0 ? 2.0 : 5.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n }\n return face;\n}\n\nvec2 getUV(vec3 direction, float face) {\n vec2 uv;\n if (face == 0.0) {\n uv = vec2(-direction.z, direction.y) / abs(direction.x);\n } else if (face == 1.0) {\n uv = vec2(direction.x, -direction.z) / abs(direction.y);\n } else if (face == 2.0) {\n uv = direction.xy / abs(direction.z);\n } else if (face == 3.0) {\n uv = vec2(direction.z, direction.y) / abs(direction.x);\n } else if (face == 4.0) {\n uv = direction.xz / abs(direction.y);\n } else {\n uv = vec2(-direction.x, direction.y) / abs(direction.z);\n }\n return 0.5 * (uv + 1.0);\n}\n\nvec3 bilinearCubeUV(sampler2D envMap, vec3 direction, float mipInt) {\n float face = getFace(direction);\n float filterInt = max(cubeUV_minMipLevel - mipInt, 0.0);\n mipInt = max(mipInt, cubeUV_minMipLevel);\n float faceSize = exp2(mipInt);\n\n float texelSize = 1.0 / (3.0 * cubeUV_maxTileSize);\n\n vec2 uv = getUV(direction, face) * (faceSize - 1.0);\n vec2 f = fract(uv);\n uv += 0.5 - f;\n if (face > 2.0) {\n uv.y += faceSize;\n face -= 3.0;\n }\n uv.x += face * faceSize;\n if(mipInt < cubeUV_maxMipLevel){\n uv.y += 2.0 * cubeUV_maxTileSize;\n }\n uv.y += filterInt * 2.0 * cubeUV_minTileSize;\n uv.x += 3.0 * max(0.0, cubeUV_maxTileSize - 2.0 * faceSize);\n uv *= texelSize;\n\n vec3 tl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n uv.x += texelSize;\n vec3 tr = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n uv.y += texelSize;\n vec3 br = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n uv.x -= texelSize;\n vec3 bl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n vec3 tm = mix(tl, tr, f.x);\n vec3 bm = mix(bl, br, f.x);\n return mix(tm, bm, f.y);\n}\n\n// These defines must match with PMREMGenerator\n\n#define r0 1.0\n#define v0 0.339\n#define m0 -2.0\n#define r1 0.8\n#define v1 0.276\n#define m1 -1.0\n#define r4 0.4\n#define v4 0.046\n#define m4 2.0\n#define r5 0.305\n#define v5 0.016\n#define m5 3.0\n#define r6 0.21\n#define v6 0.0038\n#define m6 4.0\n\nfloat roughnessToMip(float roughness) {\n float mip = 0.0;\n if (roughness >= r1) {\n mip = (r0 - roughness) * (m1 - m0) / (r0 - r1) + m0;\n } else if (roughness >= r4) {\n mip = (r1 - roughness) * (m4 - m1) / (r1 - r4) + m1;\n } else if (roughness >= r5) {\n mip = (r4 - roughness) * (m5 - m4) / (r4 - r5) + m4;\n } else if (roughness >= r6) {\n mip = (r5 - roughness) * (m6 - m5) / (r5 - r6) + m5;\n } else {\n mip = -2.0 * log2(1.16 * roughness);// 1.16 = 1.79^0.25\n }\n return mip;\n}\n\nvec4 textureCubeUV(sampler2D envMap, vec3 sampleDir, float roughness) {\n float mip = clamp(roughnessToMip(roughness), m0, cubeUV_maxMipLevel);\n float mipF = fract(mip);\n float mipInt = floor(mip);\n\n vec3 color0 = bilinearCubeUV(envMap, sampleDir, mipInt);\n if (mipF == 0.0) {\n return vec4(color0, 1.0);\n } else {\n vec3 color1 = bilinearCubeUV(envMap, sampleDir, mipInt + 1.0);\n return vec4(mix(color0, color1, mipF), 1.0);\n }\n}\n#endif\n",defaultnormal_vertex:"\nvec3 transformedNormal = objectNormal;\n\n#ifdef USE_INSTANCING\n\n\t// this is in lieu of a per-instance normal-matrix\n\t// shear transforms in the instance matrix are not supported\n\n\tmat3 m = mat3( instanceMatrix );\n\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\n\ttransformedNormal = m * transformedNormal;\n\n#endif\n\ntransformedNormal = normalMatrix * transformedNormal;\n\n#ifdef FLIP_SIDED\n\n\ttransformedNormal = - transformedNormal;\n\n#endif\n\n#ifdef USE_TANGENT\n\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\n\t#ifdef FLIP_SIDED\n\n\t\ttransformedTangent = - transformedTangent;\n\n\t#endif\n\n#endif\n",displacementmap_pars_vertex:"\n#ifdef USE_DISPLACEMENTMAP\n\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n\n#endif\n",displacementmap_vertex:"\n#ifdef USE_DISPLACEMENTMAP\n\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n\n#endif\n",emissivemap_fragment:"\n#ifdef USE_EMISSIVEMAP\n\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n\n#endif\n",emissivemap_pars_fragment:"\n#ifdef USE_EMISSIVEMAP\n\n\tuniform sampler2D emissiveMap;\n\n#endif\n",encodings_fragment:"\ngl_FragColor = linearToOutputTexel( gl_FragColor );\n",encodings_pars_fragment:"\n// For a discussion of what this is, please read this: http://lousodrome.net/blog/light/2013/05/26/gamma-correct-and-hdr-rendering-in-a-32-bits-buffer/\n\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\n\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\n}\n\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\n}\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}\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}\n\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\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// return vec4( value.brg, ( 3.0 + 128.0 ) / 256.0 );\n}\n\n// reference: http://iwasbeingirony.blogspot.ca/2010/06/difference-between-rgbm-and-rgbd.html\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * value.a * maxRange, 1.0 );\n}\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}\n\n// reference: http://iwasbeingirony.blogspot.ca/2010/06/difference-between-rgbm-and-rgbd.html\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\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\t// NOTE: The implementation with min causes the shader to not compile on\n\t// a common Alcatel A502DL in Chrome 78/Android 8.1. Some research suggests \n\t// that the chipset is Mediatek MT6739 w/ IMG PowerVR GE8100 GPU.\n\t// D = min( floor( D ) / 255.0, 1.0 );\n\tD = clamp( floor( D ) / 255.0, 0.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\n\n// LogLuv reference: http://graphicrants.blogspot.ca/2009/04/rgbm-color-encoding.html\n\n// M matrix, for encoding\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}\n\n// Inverse M matrix, for decoding\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}\n",envmap_fragment:"\n#ifdef USE_ENVMAP\n\n\t#ifdef ENV_WORLDPOS\n\n\t\tvec3 cameraToFrag;\n\t\t\n\t\tif ( isOrthographic ) {\n\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\n\t\t} else {\n\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\n\t\t}\n\n\t\t// Transforming Normal Vectors with the Inverse Transformation\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\n\t\t#else\n\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\n\t\t#endif\n\n\t#else\n\n\t\tvec3 reflectVec = vReflect;\n\n\t#endif\n\n\t#ifdef ENVMAP_TYPE_CUBE\n\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\n\t\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\n\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\n\t\tvec2 sampleUV;\n\n\t\treflectVec = normalize( reflectVec );\n\n\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\n\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\n\t\treflectVec = normalize( reflectVec );\n\n\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) );\n\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n\n\t#else\n\n\t\tvec4 envColor = vec4( 0.0 );\n\n\t#endif\n\n\t#ifndef ENVMAP_TYPE_CUBE_UV\n\n\t\tenvColor = envMapTexelToLinear( envColor );\n\n\t#endif\n\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\n\t#endif\n\n#endif\n",envmap_common_pars_fragment:"\n#ifdef USE_ENVMAP\n\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif\n",envmap_pars_fragment:"\n#ifdef USE_ENVMAP\n\n\tuniform float reflectivity;\n\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\n\t\t#define ENV_WORLDPOS\n\n\t#endif\n\n\t#ifdef ENV_WORLDPOS\n\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n\n#endif\n",envmap_pars_vertex:"\n#ifdef USE_ENVMAP\n\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\n\n\t\t#define ENV_WORLDPOS\n\n\t#endif\n\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\n\t#else\n\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\n\t#endif\n\n#endif\n",envmap_physical_pars_fragment:"\n#if defined( USE_ENVMAP )\n\n\t#ifdef ENVMAP_MODE_REFRACTION\n\t\tuniform float refractionRatio;\n\t#endif\n\n\tvec3 getLightProbeIndirectIrradiance( /*const in SpecularLightProbe specularLightProbe,*/ const in GeometricContext geometry, const in int maxMIPLevel ) {\n\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\n\t\t\t// TODO: replace with properly filtered cubemaps and access the irradiance LOD level, be it the last LOD level\n\t\t\t// of a specular cubemap, or just the default level of a specially created irradiance cubemap.\n\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\n\t\t\t#else\n\n\t\t\t\t// force the bias high to get the last LOD level as it is the most blurred.\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\n\t\t\t#endif\n\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\n\t\t#else\n\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\n\t\t#endif\n\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\n\t}\n\n\t// Trowbridge-Reitz distribution to Mip level, following the logic of http://casual-effects.blogspot.ca/2011/08/plausible-environment-lighting-in-two.html\n\tfloat getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) {\n\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\n\t\tfloat sigma = PI * roughness * roughness / ( 1.0 + roughness );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + log2( sigma );\n\n\t\t// clamp to allowable LOD ranges.\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\n\t}\n\n\tvec3 getLightProbeIndirectRadiance( /*const in SpecularLightProbe specularLightProbe,*/ const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) {\n\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\n\t\t vec3 reflectVec = reflect( -viewDir, normal );\n\n\t\t // Mixing the reflection with the normal is more accurate and keeps rough objects from gathering light from behind their tangent plane.\n\t\t reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\n\t\t#else\n\n\t\t vec3 reflectVec = refract( -viewDir, normal, refractionRatio );\n\n\t\t#endif\n\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel );\n\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\n\t\t\t#else\n\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\n\t\t\t#endif\n\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\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\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n\n\t\t\t#else\n\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n\n\t\t\t#endif\n\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\n\n\t\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0,0.0,1.0 ) );\n\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\n\t\t\t#else\n\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\n\t\t\t#endif\n\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\n\t\t#endif\n\n\t\treturn envMapColor.rgb * envMapIntensity;\n\n\t}\n\n#endif\n",envmap_vertex:"\n#ifdef USE_ENVMAP\n\n\t#ifdef ENV_WORLDPOS\n\n\t\tvWorldPosition = worldPosition.xyz;\n\n\t#else\n\n\t\tvec3 cameraToVertex;\n\n\t\tif ( isOrthographic ) { \n\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\n\t\t} else {\n\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\n\t\t}\n\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\n\t\t#else\n\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\n\t\t#endif\n\n\t#endif\n\n#endif\n",fog_vertex:"\n#ifdef USE_FOG\n\n\tfogDepth = -mvPosition.z;\n\n#endif\n",fog_pars_vertex:"\n#ifdef USE_FOG\n\n\tvarying float fogDepth;\n\n#endif\n",fog_fragment:"\n#ifdef USE_FOG\n\n\t#ifdef FOG_EXP2\n\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth );\n\n\t#else\n\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n\n\t#endif\n\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n\n#endif\n",fog_pars_fragment:"\n#ifdef USE_FOG\n\n\tuniform vec3 fogColor;\n\tvarying float fogDepth;\n\n\t#ifdef FOG_EXP2\n\n\t\tuniform float fogDensity;\n\n\t#else\n\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\n\t#endif\n\n#endif\n",gradientmap_pars_fragment:"\n\n#ifdef USE_GRADIENTMAP\n\n\tuniform sampler2D gradientMap;\n\n#endif\n\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\n\t// dotNL will be from -1.0 to 1.0\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\n\t#ifdef USE_GRADIENTMAP\n\n\t\treturn texture2D( gradientMap, coord ).rgb;\n\n\t#else\n\n\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\n\t#endif\n\n}\n\n",lightmap_fragment:"\n#ifdef USE_LIGHTMAP\n\n\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\treflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity; // factor of PI should not be present; included here to prevent breakage\n\n#endif\n",lightmap_pars_fragment:"\n#ifdef USE_LIGHTMAP\n\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n\n#endif\n",lights_lambert_vertex:"\nvec3 diffuse = vec3( 1.0 );\n\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\n\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\n\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\n\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\n\n#if NUM_POINT_LIGHTS > 0\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\n\t\t#endif\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n#if NUM_SPOT_LIGHTS > 0\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n/*\n#if NUM_RECT_AREA_LIGHTS > 0\n\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\n\t\t// TODO (abelnation): implement\n\n\t}\n\n#endif\n*/\n\n#if NUM_DIR_LIGHTS > 0\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\n\t\t#endif\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n#if NUM_HEMI_LIGHTS > 0\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\n\t\t#endif\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n",lights_pars_begin:"\nuniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\n\n// get the irradiance (radiance convolved with cosine lobe) at the point 'normal' on the unit sphere\n// source: https://graphics.stanford.edu/papers/envmap/envmap.pdf\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\n\t// normal is assumed to have unit length\n\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\n\t// band 0\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\n\t// band 1\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\n\t// band 2\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\n\treturn result;\n\n}\n\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) {\n\n\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\n\treturn irradiance;\n\n}\n\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\n\tvec3 irradiance = ambientLightColor;\n\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\n\t\tirradiance *= PI;\n\n\t#endif\n\n\treturn irradiance;\n\n}\n\n#if NUM_DIR_LIGHTS > 0\n\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\n\t#endif\n\n\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\n\t}\n\n#endif\n\n\n#if NUM_POINT_LIGHTS > 0\n\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\n\t#endif\n\n\t// directLight is an out parameter as having it as a return value caused compiler errors on some devices\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\n\t\tfloat lightDistance = length( lVector );\n\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\n\t}\n\n#endif\n\n\n#if NUM_SPOT_LIGHTS > 0\n\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};\n\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\n\t#endif\n\n\t// directLight is an out parameter as having it as a return value caused compiler errors on some devices\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\n\t\tif ( angleCos > spotLight.coneCos ) {\n\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\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\n\t\t} else {\n\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\n\t\t}\n\t}\n\n#endif\n\n\n#if NUM_RECT_AREA_LIGHTS > 0\n\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\n\t// Pre-computed values of LinearTransformedCosine approximation of BRDF\n\t// BRDF approximation Texture is 64x64\n\tuniform sampler2D ltc_1; // RGBA Float\n\tuniform sampler2D ltc_2; // RGBA Float\n\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n\n#endif\n\n\n#if NUM_HEMI_LIGHTS > 0\n\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\n\t\t\tirradiance *= PI;\n\n\t\t#endif\n\n\t\treturn irradiance;\n\n\t}\n\n#endif\n",lights_toon_fragment:"\nToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",lights_toon_pars_fragment:"\nvarying vec3 vViewPosition;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n#endif\n\n\nstruct ToonMaterial {\n\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n\n};\n\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\n\t\tirradiance *= PI; // punctual light\n\n\t#endif\n\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n\n}\n\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\n}\n\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon\n\n#define Material_LightProbeLOD( material )\t(0)\n",lights_phong_fragment:"\nBlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",lights_phong_pars_fragment:"\nvarying vec3 vViewPosition;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n#endif\n\n\nstruct BlinnPhongMaterial {\n\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n\n};\n\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\n\t\tirradiance *= PI; // punctual light\n\n\t#endif\n\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n\n}\n\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\n}\n\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n\n#define Material_LightProbeLOD( material )\t(0)\n",lights_physical_fragment:"\nPhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\n\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\n\nmaterial.specularRoughness = max( roughnessFactor, 0.0525 );// 0.0525 corresponds to the base mip of a 256 cubemap.\nmaterial.specularRoughness += geometryRoughness;\nmaterial.specularRoughness = min( material.specularRoughness, 1.0 );\n\n#ifdef REFLECTIVITY\n\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n\n#else\n\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n\n#endif\n\n#ifdef CLEARCOAT\n\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\n\t#ifdef USE_CLEARCOATMAP\n\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vUv ).x;\n\n\t#endif\n\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\n\n\t#endif\n\n\tmaterial.clearcoat = saturate( material.clearcoat ); // Burley clearcoat model\n\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n\n#endif\n\n#ifdef USE_SHEEN\n\n\tmaterial.sheenColor = sheen;\n\n#endif\n",lights_physical_pars_fragment:"\nstruct PhysicalMaterial {\n\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n\n#ifdef CLEARCOAT\n\tfloat clearcoat;\n\tfloat clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tvec3 sheenColor;\n#endif\n\n};\n\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\n\n// Clear coat directional hemishperical reflectance (this approximation should be improved)\nfloat clearcoatDHRApprox( const in float roughness, const in float dotNL ) {\n\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n\n}\n\n#if NUM_RECT_AREA_LIGHTS > 0\n\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\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\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight; // counterclockwise; light shines in local neg z direction\n\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\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\n\t\t// LTC Fresnel Approximation by Stephen Hill\n\t\t// http://blog.selfshadow.com/publications/s2016-advances/s2016_ltc_fresnel.pdf\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\n\t}\n\n#endif\n\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\n\tvec3 irradiance = dotNL * directLight.color;\n\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\n\t\tirradiance *= PI; // punctual light\n\n\t#endif\n\n\t#ifdef CLEARCOAT\n\n\t\tfloat ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\n\t\tvec3 ccIrradiance = ccDotNL * directLight.color;\n\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\n\t\t\tccIrradiance *= PI; // punctual light\n\n\t\t#endif\n\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\n\t\treflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\n\t#else\n\n\t\tfloat clearcoatDHR = 0.0;\n\n\t#endif\n\n\t#ifdef USE_SHEEN\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen(\n\t\t\tmaterial.specularRoughness,\n\t\t\tdirectLight.direction,\n\t\t\tgeometry,\n\t\t\tmaterial.sheenColor\n\t\t);\n\t#else\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularRoughness);\n\t#endif\n\n\treflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\n}\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\n\t#ifdef CLEARCOAT\n\n\t\tfloat ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\n\t\treflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\n\t\tfloat ccDotNL = ccDotNV;\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\n\t#else\n\n\t\tfloat clearcoatDHR = 0.0;\n\n\t#endif\n\n\tfloat clearcoatInv = 1.0 - clearcoatDHR;\n\n\t// Both indirect specular and indirect diffuse light accumulate here\n\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\n\tBRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering );\n\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\n\treflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n\n}\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\n// ref: https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n\n}\n",lights_fragment_begin:"\n/**\n * This is a template that can be used to light a material, it uses pluggable\n * RenderEquations (RE)for specific lighting scenarios.\n *\n * Instructions for use:\n * - Ensure that both RE_Direct, RE_IndirectDiffuse and RE_IndirectSpecular are defined\n * - If you have defined an RE_IndirectSpecular, you need to also provide a Material_LightProbeLOD. <---- ???\n * - Create a material parameter that is to be passed as the third parameter to your lighting functions.\n *\n * TODO:\n * - Add area light support.\n * - Add sphere light support.\n * - Add diffuse light probe (irradiance cubemap) support.\n */\n\nGeometricContext geometry;\n\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n\n#ifdef CLEARCOAT\n\n\tgeometry.clearcoatNormal = clearcoatNormal;\n\n#endif\n\nIncidentLight directLight;\n\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\n\t\tpointLight = pointLights[ i ];\n\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\n\tSpotLight spotLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\n\t\tspotLight = spotLights[ i ];\n\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\n\t\tdirectionalLight = directionalLights[ i ];\n\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\n\tRectAreaLight rectAreaLight;\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n#if defined( RE_IndirectDiffuse )\n\n\tvec3 iblIrradiance = vec3( 0.0 );\n\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry );\n\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\n\t\t}\n\t\t#pragma unroll_loop_end\n\n\t#endif\n\n#endif\n\n#if defined( RE_IndirectSpecular )\n\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n\n#endif\n",lights_fragment_maps:"\n#if defined( RE_IndirectDiffuse )\n\n\t#ifdef USE_LIGHTMAP\n\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\n\t\t\tlightMapIrradiance *= PI; // factor of PI should not be present; included here to prevent breakage\n\n\t\t#endif\n\n\t\tirradiance += lightMapIrradiance;\n\n\t#endif\n\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\n\t\tiblIrradiance += getLightProbeIndirectIrradiance( /*lightProbe,*/ geometry, maxMipLevel );\n\n\t#endif\n\n#endif\n\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\n\tradiance += getLightProbeIndirectRadiance( /*specularLightProbe,*/ geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel );\n\n\t#ifdef CLEARCOAT\n\n\t\tclearcoatRadiance += getLightProbeIndirectRadiance( /*specularLightProbe,*/ geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel );\n\n\t#endif\n\n#endif\n",lights_fragment_end:"\n#if defined( RE_IndirectDiffuse )\n\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n\n#endif\n\n#if defined( RE_IndirectSpecular )\n\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n\n#endif\n",logdepthbuf_fragment:"\n#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\n\t// Doing a strict comparison with == 1.0 can cause noise artifacts\n\t// on some platforms. See issue #17623.\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n\n#endif\n",logdepthbuf_pars_fragment:"\n#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n\n#endif\n",logdepthbuf_pars_vertex:"\n#ifdef USE_LOGDEPTHBUF\n\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\n\t#else\n\n\t\tuniform float logDepthBufFC;\n\n\t#endif\n\n#endif\n",logdepthbuf_vertex:"\n#ifdef USE_LOGDEPTHBUF\n\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\n\t#else\n\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\n\t\t\tgl_Position.z *= gl_Position.w;\n\n\t\t}\n\n\t#endif\n\n#endif\n",map_fragment:"\n#ifdef USE_MAP\n\n\tvec4 texelColor = texture2D( map, vUv );\n\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n\n#endif\n",map_fragment_1:"\n#ifdef USE_MAP\n\n\tvec4 texelColor = texture2D( map, vUv );\n\n\ttexelColor = mapTexelToLinear( texelColor );\n\t\n\tif(mapMixColor){\n\t diffuseColor = texelColor*texelColor.a + diffuseColor*(1.0-texelColor.a);\n\t}else {\n\t diffuseColor *= texelColor;\n\t}\n\n#endif\n",map_pars_fragment:"\n#ifdef USE_MAP\n\n\tuniform sampler2D map;\n\n#endif\n",map_particle_fragment:"\n#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\n#endif\n\n#ifdef USE_MAP\n\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n\n#endif\n\n#ifdef USE_ALPHAMAP\n\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n\n#endif\n",map_particle_pars_fragment:"\n#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\n\tuniform mat3 uvTransform;\n\n#endif\n\n#ifdef USE_MAP\n\n\tuniform sampler2D map;\n\n#endif\n\n#ifdef USE_ALPHAMAP\n\n\tuniform sampler2D alphaMap;\n\n#endif\n",metalnessmap_fragment:"\nfloat metalnessFactor = metalness;\n\n#ifdef USE_METALNESSMAP\n\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\n\t// reads channel B, compatible with a combined OcclusionRoughnessMetallic (RGB) texture\n\tmetalnessFactor *= texelMetalness.b;\n\n#endif\n",metalnessmap_pars_fragment:"\n#ifdef USE_METALNESSMAP\n\n\tuniform sampler2D metalnessMap;\n\n#endif\n",morphnormal_vertex:"\n#ifdef USE_MORPHNORMALS\n\n\t// morphTargetBaseInfluence is set based on BufferGeometry.morphTargetsRelative value:\n\t// When morphTargetsRelative is false, this is set to 1 - sum(influences); this results in normal = sum((target - base) * influence)\n\t// When morphTargetsRelative is true, this is set to 1; as a result, all morph targets are simply added to the base after weighting\n\tobjectNormal *= morphTargetBaseInfluence;\n\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n\n#endif\n",morphtarget_pars_vertex:"\n#ifdef USE_MORPHTARGETS\n\n\tuniform float morphTargetBaseInfluence;\n\n\t#ifndef USE_MORPHNORMALS\n\n\tuniform float morphTargetInfluences[ 8 ];\n\n\t#else\n\n\tuniform float morphTargetInfluences[ 4 ];\n\n\t#endif\n\n#endif\n",morphtarget_vertex:"\n#ifdef USE_MORPHTARGETS\n\n\t// morphTargetBaseInfluence is set based on BufferGeometry.morphTargetsRelative value:\n\t// When morphTargetsRelative is false, this is set to 1 - sum(influences); this results in position = sum((target - base) * influence)\n\t// When morphTargetsRelative is true, this is set to 1; as a result, all morph targets are simply added to the base after weighting\n\ttransformed *= morphTargetBaseInfluence;\n\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\n\t#ifndef USE_MORPHNORMALS\n\n\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\n\t#endif\n\n#endif\n",normal_fragment_begin:"\n#ifdef FLAT_SHADED\n\n\t// Workaround for Adreno/Nexus5 not able able to do dFdx( vViewPosition ) ...\n\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\n#else\n\n\tvec3 normal = normalize( vNormal );\n\n\t#ifdef DOUBLE_SIDED\n\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\n\t#endif\n\n\t#ifdef USE_TANGENT\n\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\n\t\t#ifdef DOUBLE_SIDED\n\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\n\t\t#endif\n\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\n\t\t#endif\n\n\t#endif\n\n#endif\n\n// non perturbed normal for clearcoat among others\n\nvec3 geometryNormal = normal;\n\n",normal_fragment_maps:"\n\n#ifdef OBJECTSPACE_NORMALMAP\n\n\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0; // overrides both flatShading and attribute normals\n\n\t#ifdef FLIP_SIDED\n\n\t\tnormal = - normal;\n\n\t#endif\n\n\t#ifdef DOUBLE_SIDED\n\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\n\t#endif\n\n\tnormal = normalize( normalMatrix * normal );\n\n#elif defined( TANGENTSPACE_NORMALMAP )\n\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\n\t#ifdef USE_TANGENT\n\n\t\tnormal = normalize( vTBN * mapN );\n\n\t#else\n\n\t\tnormal = perturbNormal2Arb( -vViewPosition, normal, mapN );\n\n\t#endif\n\n#elif defined( USE_BUMPMAP )\n\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n\n#endif\n",normalmap_pars_fragment:"\n#ifdef USE_NORMALMAP\n\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\n#endif\n\n#ifdef OBJECTSPACE_NORMALMAP\n\n\tuniform mat3 normalMatrix;\n\n#endif\n\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\n\t// Per-Pixel Tangent Space Normal Mapping\n\t// http://hacksoflife.blogspot.ch/2009/11/per-pixel-tangent-space-normal-mapping.html\n\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN ) {\n\n\t\t// Workaround for Adreno 3XX dFd*( vec3 ) bug. See #9988\n\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\n\t\tfloat scale = sign( st1.t * st0.s - st0.t * st1.s ); // we do not care about the magnitude\n\n\t\tvec3 S = normalize( ( q0 * st1.t - q1 * st0.t ) * scale );\n\t\tvec3 T = normalize( ( - q0 * st1.s + q1 * st0.s ) * scale );\n\t\tvec3 N = normalize( surf_norm );\n\n\t\tmat3 tsn = mat3( S, T, N );\n\n\t\tmapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\n\t\treturn normalize( tsn * mapN );\n\n\t}\n\n#endif\n",clearcoat_normal_fragment_begin:"\n#ifdef CLEARCOAT\n\n\tvec3 clearcoatNormal = geometryNormal;\n\n#endif\n",clearcoat_normal_fragment_maps:"\n#ifdef USE_CLEARCOAT_NORMALMAP\n\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\n\t#ifdef USE_TANGENT\n\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\n\t#else\n\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN );\n\n\t#endif\n\n#endif\n",clearcoat_pars_fragment:"\n\n#ifdef USE_CLEARCOATMAP\n\n\tuniform sampler2D clearcoatMap;\n\n#endif\n\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\n\tuniform sampler2D clearcoatRoughnessMap;\n\n#endif\n\n#ifdef USE_CLEARCOAT_NORMALMAP\n\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n\n#endif\n",packing:"\nvec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\n\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\n\nconst float PackUpscale = 256. / 255.; // fraction -> 0..1 (including 1)\nconst float UnpackDownscale = 255. / 256.; // 0..1 -> fraction (excluding 1)\n\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\n\nconst float ShiftRight8 = 1. / 256.;\n\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8; // tidy overflow\n\treturn r * PackUpscale;\n}\n\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\n\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ));\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w);\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\n\n// NOTE: viewZ/eyeZ is < 0 when in front of the camera per OpenGL conventions\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}\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}\n",premultiplied_alpha_fragment:"\n#ifdef PREMULTIPLIED_ALPHA\n\n\t// Get get normal blending with premultipled, use with CustomBlending, OneFactor, OneMinusSrcAlphaFactor, AddEquation.\n\tgl_FragColor.rgb *= gl_FragColor.a;\n\n#endif\n",project_vertex:"\nvec4 mvPosition = vec4( transformed, 1.0 );\n\n#ifdef USE_INSTANCING\n\n\tmvPosition = instanceMatrix * mvPosition;\n\n#endif\n\nmvPosition = modelViewMatrix * mvPosition;\n\ngl_Position = projectionMatrix * mvPosition;\n",dithering_fragment:"\n#ifdef DITHERING\n\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n\n#endif\n",dithering_pars_fragment:"\n#ifdef DITHERING\n\n\t// based on https://www.shadertoy.com/view/MslGR8\n\tvec3 dithering( vec3 color ) {\n\t\t//Calculate grid position\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\n\t\t//Shift the individual colors differently, thus making it even harder to see the dithering pattern\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\n\t\t//modify shift acording to grid position.\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\n\t\t//shift the color by dither_shift\n\t\treturn color + dither_shift_RGB;\n\t}\n\n#endif\n",roughnessmap_fragment:"\nfloat roughnessFactor = roughness;\n\n#ifdef USE_ROUGHNESSMAP\n\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\n\t// reads channel G, compatible with a combined OcclusionRoughnessMetallic (RGB) texture\n\troughnessFactor *= texelRoughness.g;\n\n#endif\n",roughnessmap_pars_fragment:"\n#ifdef USE_ROUGHNESSMAP\n\n\tuniform sampler2D roughnessMap;\n\n#endif\n",shadowmap_pars_fragment:"\n#ifdef USE_SHADOWMAP\n\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\n\t#endif\n\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\n\t#endif\n\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\n\t#endif\n\n\t/*\n\t#if NUM_RECT_AREA_LIGHTS > 0\n\n\t\t// TODO (abelnation): create uniforms for area light shadows\n\n\t#endif\n\t*/\n\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\n\t}\n\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\n\t}\n\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\n\t\tfloat occlusion = 1.0;\n\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\n\t\tfloat hard_shadow = step( compare , distribution.x ); // Hard Shadow\n\n\t\tif (hard_shadow != 1.0 ) {\n\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance ); // Chebeyshevs inequality\n\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); // 0.3 reduces light bleed\n\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\n\t\t}\n\t\treturn occlusion;\n\n\t}\n\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\n\t\tfloat shadow = 1.0;\n\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\n\t\t// if ( something && something ) breaks ATI OpenGL shader compiler\n\t\t// if ( all( something, something ) ) using this instead\n\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\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\n\t\tbool frustumTest = all( frustumTestVec );\n\n\t\tif ( frustumTest ) {\n\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\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\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\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( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), 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( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), 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 / 17.0 );\n\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\n\t\t#else // no percentage-closer filtering:\n\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\n\t\t#endif\n\n\t\t}\n\n\t\treturn shadow;\n\n\t}\n\n\t// cubeToUV() maps a 3D direction vector suitable for cube texture mapping to a 2D\n\t// vector suitable for 2D texture mapping. This code uses the following layout for the\n\t// 2D texture:\n\t//\n\t// xzXZ\n\t// y Y\n\t//\n\t// Y - Positive y direction\n\t// y - Negative y direction\n\t// X - Positive x direction\n\t// x - Negative x direction\n\t// Z - Positive z direction\n\t// z - Negative z direction\n\t//\n\t// Source and test bed:\n\t// https://gist.github.com/tschw/da10c43c467ce8afd0c4\n\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\n\t\t// Number of texels to avoid at the edge of each square\n\n\t\tvec3 absV = abs( v );\n\n\t\t// Intersect unit cube\n\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\n\t\t// Apply scale to avoid seams\n\n\t\t// two texels less per square (one texel will do for NEAREST)\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\n\t\t// Unwrap\n\n\t\t// space: -1 ... 1 range for each square\n\t\t//\n\t\t// #X##\t\tdim := ( 4 , 2 )\n\t\t// # #\t\tcenter := ( 1 , 1 )\n\n\t\tvec2 planar = v.xy;\n\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\n\t\tif ( absV.z >= almostOne ) {\n\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\n\t\t} else if ( absV.x >= almostOne ) {\n\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\n\t\t} else if ( absV.y >= almostOne ) {\n\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\n\t\t}\n\n\t\t// Transform to UV space\n\n\t\t// scale := 0.5 / dim\n\t\t// translate := ( center + 0.5 ) / dim\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\n\t}\n\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\n\t\t// for point lights, the uniform @vShadowCoord is re-purposed to hold\n\t\t// the vector from the light to the world-space position of the fragment.\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\n\t\t// dp = normalized distance from light to fragment position\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); // need to clamp?\n\t\tdp += shadowBias;\n\n\t\t// bd3D = base direction 3D\n\t\tvec3 bd3D = normalize( lightToPosition );\n\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\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\n\t\t#else // no percentage-closer filtering\n\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\n\t\t#endif\n\n\t}\n\n#endif\n",shadowmap_pars_vertex:"\n#ifdef USE_SHADOWMAP\n\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\n\t#endif\n\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\n\t#endif\n\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\n\t#endif\n\n\t/*\n\t#if NUM_RECT_AREA_LIGHTS > 0\n\n\t\t// TODO (abelnation): uniforms for area light shadows\n\n\t#endif\n\t*/\n\n#endif\n",shadowmap_vertex:"\n#ifdef USE_SHADOWMAP\n\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\n\t}\n\t#pragma unroll_loop_end\n\n\t#endif\n\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\n\t}\n\t#pragma unroll_loop_end\n\n\t#endif\n\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\n\t}\n\t#pragma unroll_loop_end\n\n\t#endif\n\n\t/*\n\t#if NUM_RECT_AREA_LIGHTS > 0\n\n\t\t// TODO (abelnation): update vAreaShadowCoord with area light info\n\n\t#endif\n\t*/\n\n#endif\n",shadowmask_pars_fragment:"\nfloat getShadowMask() {\n\n\tfloat shadow = 1.0;\n\n\t#ifdef USE_SHADOWMAP\n\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\n\tDirectionalLightShadow directionalLight;\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\n\t}\n\t#pragma unroll_loop_end\n\n\t#endif\n\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\n\tSpotLightShadow spotLight;\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\n\t}\n\t#pragma unroll_loop_end\n\n\t#endif\n\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\n\tPointLightShadow pointLight;\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\n\t}\n\t#pragma unroll_loop_end\n\n\t#endif\n\n\t/*\n\t#if NUM_RECT_AREA_LIGHTS > 0\n\n\t\t// TODO (abelnation): update shadow for Area light\n\n\t#endif\n\t*/\n\n\t#endif\n\n\treturn shadow;\n\n}\n",skinbase_vertex:"\n#ifdef USE_SKINNING\n\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\n#endif\n",skinning_pars_vertex:"\n#ifdef USE_SKINNING\n\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\n\t#ifdef BONE_TEXTURE\n\n\t\tuniform highp sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\n\t\tmat4 getBoneMatrix( const in float i ) {\n\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\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\n\t\t\ty = dy * ( y + 0.5 );\n\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\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\n\t\t\treturn bone;\n\n\t\t}\n\n\t#else\n\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\n\t\tmat4 getBoneMatrix( const in float i ) {\n\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\n\t\t}\n\n\t#endif\n\n#endif\n",skinning_vertex:"\n#ifdef USE_SKINNING\n\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\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\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n\n#endif\n",skinnormal_vertex:"\n#ifdef USE_SKINNING\n\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\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\n\t#ifdef USE_TANGENT\n\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\n\t#endif\n\n#endif\n",specularmap_fragment:"\nfloat specularStrength;\n\n#ifdef USE_SPECULARMAP\n\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n\n#else\n\n\tspecularStrength = 1.0;\n\n#endif\n",specularmap_pars_fragment:"\n#ifdef USE_SPECULARMAP\n\n\tuniform sampler2D specularMap;\n\n#endif\n",tonemapping_fragment:"\n#if defined( TONE_MAPPING )\n\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n\n#endif\n",tonemapping_pars_fragment:"\n#ifndef saturate\n// <common> may have defined saturate() already\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\n\nuniform float toneMappingExposure;\nuniform float toneMappingWhitePoint;\n\n// exposure only\nvec3 LinearToneMapping( vec3 color ) {\n\n\treturn toneMappingExposure * color;\n\n}\n\n// source: https://www.cs.utah.edu/~reinhard/cdrom/\nvec3 ReinhardToneMapping( vec3 color ) {\n\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n\n}\n\n// source: http://filmicgames.com/archives/75\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\n\t// John Hable's filmic operator from Uncharted 2 video game\n\tcolor *= toneMappingExposure;\n\treturn saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\n\n}\n\n// source: http://filmicgames.com/archives/75\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\n\t// optimized filmic operator by Jim Hejl and Richard Burgess-Dawson\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\n}\n\n// source: https://knarkowicz.wordpress.com/2016/01/06/aces-filmic-tone-mapping-curve/\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\n\tcolor *= toneMappingExposure;\n\treturn saturate( ( color * ( 2.51 * color + 0.03 ) ) / ( color * ( 2.43 * color + 0.59 ) + 0.14 ) );\n\n}\n",uv_pars_fragment:"\n#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\n\tvarying vec2 vUv;\n\n#endif\n",uv_pars_vertex:"\n#ifdef USE_UV\n\n\t#ifdef UVS_VERTEX_ONLY\n\n\t\tvec2 vUv;\n\n\t#else\n\n\t\tvarying vec2 vUv;\n\n\t#endif\n\n\tuniform mat3 uvTransform;\n\n#endif\n",uv_vertex:"\n#ifdef USE_UV\n\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\n#endif\n",uv2_pars_fragment:"\n#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\n\tvarying vec2 vUv2;\n\n#endif\n",uv2_pars_vertex:"\n#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\n\tuniform mat3 uv2Transform;\n\n#endif\n",uv2_vertex:"\n#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n\n#endif\n",worldpos_vertex:"\n#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\n\t#ifdef USE_INSTANCING\n\n\t\tworldPosition = instanceMatrix * worldPosition;\n\n\t#endif\n\n\tworldPosition = modelMatrix * worldPosition;\n\n#endif\n",background_frag:"\nuniform sampler2D t2D;\n\nvarying vec2 vUv;\n\nvoid main() {\n\n\tvec4 texColor = texture2D( t2D, vUv );\n\n\tgl_FragColor = mapTexelToLinear( texColor );\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\n}\n",background_vert:"\nvarying vec2 vUv;\nuniform mat3 uvTransform;\n\nvoid main() {\n\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n\n}\n",cube_frag:"\n\n#include <envmap_common_pars_fragment>\nuniform float opacity;\n\nvarying vec3 vWorldDirection;\n\n#include <cube_uv_reflection_fragment>\n\nvoid main() {\n\n\tvec3 vReflect = vWorldDirection;\n\t#include <envmap_fragment>\n\n\tgl_FragColor = envColor;\n\tgl_FragColor.a *= opacity;\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\n}\n",cube_vert:"\nvarying vec3 vWorldDirection;\n\n#include <common>\n\nvoid main() {\n\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\n\tgl_Position.z = gl_Position.w; // set z to camera.far\n\n}\n",depth_frag:"\n#if DEPTH_PACKING == 3200\n\n\tuniform float opacity;\n\n#endif\n\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>\n\nvarying vec2 vHighPrecisionZW;\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( 1.0 );\n\n\t#if DEPTH_PACKING == 3200\n\n\t\tdiffuseColor.a = opacity;\n\n\t#endif\n\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\n\t#include <logdepthbuf_fragment>\n\n\t// Higher precision equivalent of gl_FragCoord.z. This assumes depthRange has been left to its default values.\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\n\t#if DEPTH_PACKING == 3200\n\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\n\t#elif DEPTH_PACKING == 3201\n\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\n\t#endif\n\n}\n",depth_vert:"\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 <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\n// This is used for computing an equivalent of gl_FragCoord.z that is as high precision as possible.\n// Some platforms compute gl_FragCoord at a lower precision which makes the manually computed value better for\n// depth-based postprocessing effects. Reproduced on iPad with A10 processor / iPadOS 13.3.1.\nvarying vec2 vHighPrecisionZW;\n\nvoid main() {\n\n\t#include <uv_vertex>\n\n\t#include <skinbase_vertex>\n\n\t#ifdef USE_DISPLACEMENTMAP\n\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\n\t#endif\n\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\n\tvHighPrecisionZW = gl_Position.zw;\n\n}\n",distanceRGBA_frag:"\n#define DISTANCE\n\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n\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>\n\nvoid main () {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( 1.0 );\n\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist ); // clamp to [ 0, 1 ]\n\n\tgl_FragColor = packDepthToRGBA( dist );\n\n}\n",distanceRGBA_vert:"\n#define DISTANCE\n\nvarying vec3 vWorldPosition;\n\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>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\n\t#include <skinbase_vertex>\n\n\t#ifdef USE_DISPLACEMENTMAP\n\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\n\t#endif\n\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\n\tvWorldPosition = worldPosition.xyz;\n\n}\n",equirect_frag:"\nuniform sampler2D tEquirect;\n\nvarying vec3 vWorldDirection;\n\n#include <common>\n\nvoid main() {\n\n\tvec3 direction = normalize( vWorldDirection );\n\n\tvec2 sampleUV;\n\n\tsampleUV.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n\n\tvec4 texColor = texture2D( tEquirect, sampleUV );\n\n\tgl_FragColor = mapTexelToLinear( texColor );\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\n}\n",equirect_vert:"\nvarying vec3 vWorldDirection;\n\n#include <common>\n\nvoid main() {\n\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\n}\n",linedashed_frag:"\nuniform vec3 diffuse;\nuniform float opacity;\n\nuniform float dashSize;\nuniform float totalSize;\n\nvarying float vLineDistance;\n\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\n\t\tdiscard;\n\n\t}\n\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\n\toutgoingLight = diffuseColor.rgb; // simple shader\n\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\n}\n",linedashed_vert:"\nuniform float scale;\nattribute float lineDistance;\n\nvarying float vLineDistance;\n\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n\tvLineDistance = scale * lineDistance;\n\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\n}\n",meshbasic_frag:"\nuniform vec3 diffuse;\nuniform float opacity;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n#endif\n\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_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\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\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\n\t// accumulation (baked indirect lighting only)\n\t#ifdef USE_LIGHTMAP\n\t\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\n\t#else\n\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\n\t#endif\n\n\t// modulation\n\t#include <aomap_fragment>\n\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\n\t#include <envmap_fragment>\n\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\n}\n",meshbasic_vert:"\n#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>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <skinbase_vertex>\n\n\t#ifdef USE_ENVMAP\n\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\n\t#endif\n\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\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n\n}\n",meshlambert_frag:"\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n\n\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_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_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>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\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\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\n\t// accumulation\n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\n\n\t#ifdef DOUBLE_SIDED\n\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\n\t#else\n\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\n\t#endif\n\n\t#include <lightmap_fragment>\n\n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\n\t#ifdef DOUBLE_SIDED\n\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\n\t#else\n\n\t\treflectedLight.directDiffuse = vLightFront;\n\n\t#endif\n\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\n\t// modulation\n\t#include <aomap_fragment>\n\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\n\t#include <envmap_fragment>\n\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\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}\n",meshlambert_vert:"\n#define LAMBERT\n\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n\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>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\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\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\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}\n",meshmatcap_frag:"\n#define MATCAP\n\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\n\nvarying vec3 vViewPosition;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n#endif\n\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n\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>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\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 <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\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; // 0.495 to remove artifacts caused by undersized matcap disks\n\n\t#ifdef USE_MATCAP\n\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t\tmatcapColor = matcapTexelToLinear( matcapColor );\n\n\t#else\n\n\t\tvec4 matcapColor = vec4( 1.0 );\n\n\t#endif\n\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\n}\n",meshmatcap_vert:"\n#define MATCAP\n\nvarying vec3 vViewPosition;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n#endif\n\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n\t#include <uv_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\n\t#ifndef FLAT_SHADED // Normal computed with derivatives when FLAT_SHADED\n\n\t\tvNormal = normalize( transformedNormal );\n\n\t#endif\n\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\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\n\tvViewPosition = - mvPosition.xyz;\n\n}\n",meshtoon_frag:"\n#define TOON\n\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n\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 <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <lights_toon_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>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\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\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\n\t// accumulation\n\t#include <lights_toon_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\n\t// modulation\n\t#include <aomap_fragment>\n\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\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\n}\n",meshtoon_vert:"\n#define TOON\n\nvarying vec3 vViewPosition;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n#endif\n\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>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\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\n#ifndef FLAT_SHADED // Normal computed with derivatives when FLAT_SHADED\n\n\tvNormal = normalize( transformedNormal );\n\n#endif\n\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\n\tvViewPosition = - mvPosition.xyz;\n\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n\n}\n",meshphong_frag:"\n#define PHONG\n\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n\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_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_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>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\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\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\n\t// accumulation\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\n\t// modulation\n\t#include <aomap_fragment>\n\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\n\t#include <envmap_fragment>\n\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\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\n}\n",meshphong_vert:"\n#define PHONG\n\nvarying vec3 vViewPosition;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n#endif\n\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>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\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\n#ifndef FLAT_SHADED // Normal computed with derivatives when FLAT_SHADED\n\n\tvNormal = normalize( transformedNormal );\n\n#endif\n\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\n\tvViewPosition = - mvPosition.xyz;\n\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n\n}\n",meshphysical_frag:"\n#define STANDARD\n\n#ifdef PHYSICAL\n\t#define REFLECTIVITY\n\t#define CLEARCOAT\n\t#define TRANSPARENCY\n#endif\n\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n\n#ifdef TRANSPARENCY\n\tuniform float transparency;\n#endif\n\n#ifdef REFLECTIVITY\n\tuniform float reflectivity;\n#endif\n\n#ifdef CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n\n#ifdef USE_SHEEN\n\tuniform vec3 sheen;\n#endif\n\nvarying vec3 vViewPosition;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n\t#ifdef USE_TANGENT\n\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\n\t#endif\n\n#endif\n\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_common_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 <clearcoat_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\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\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 <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\n\t// accumulation\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\n\t// modulation\n\t#include <aomap_fragment>\n\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\n\t// this is a stub for the transparency model\n\t#ifdef TRANSPARENCY\n\t\tdiffuseColor.a *= saturate( 1. - transparency + linearToRelativeLuminance( reflectedLight.directSpecular + reflectedLight.indirectSpecular ) );\n\t#endif\n\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\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\n}\n",meshphysical_vert:"\n#define STANDARD\n\nvarying vec3 vViewPosition;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n\t#ifdef USE_TANGENT\n\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\n\t#endif\n\n#endif\n\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>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\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\n#ifndef FLAT_SHADED // Normal computed with derivatives when FLAT_SHADED\n\n\tvNormal = normalize( transformedNormal );\n\n\t#ifdef USE_TANGENT\n\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\n\t#endif\n\n#endif\n\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\n\tvViewPosition = - mvPosition.xyz;\n\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n\n}\n",normal_frag:"\n#define NORMAL\n\nuniform float opacity;\n\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\n\tvarying vec3 vViewPosition;\n\n#endif\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n\t#ifdef USE_TANGENT\n\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\n\t#endif\n\n#endif\n\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>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n\n}\n",normal_vert:"\n#define NORMAL\n\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\n\tvarying vec3 vViewPosition;\n\n#endif\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n\t#ifdef USE_TANGENT\n\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\n\t#endif\n\n#endif\n\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 <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\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\n#ifndef FLAT_SHADED // Normal computed with derivatives when FLAT_SHADED\n\n\tvNormal = normalize( transformedNormal );\n\n\t#ifdef USE_TANGENT\n\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\n\t#endif\n\n#endif\n\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\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\n\tvViewPosition = - mvPosition.xyz;\n\n#endif\n\n}\n",points_frag:"\nuniform vec3 diffuse;\nuniform float opacity;\n\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>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\n\toutgoingLight = diffuseColor.rgb;\n\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\n}\n",points_vert:"\nuniform float size;\nuniform float scale;\n\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>\n\nvoid main() {\n\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\n\tgl_PointSize = size;\n\n\t#ifdef USE_SIZEATTENUATION\n\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\n\t#endif\n\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n\n}\n",shadow_frag:"\nuniform vec3 color;\nuniform float opacity;\n\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>\n\nvoid main() {\n\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\n}\n",shadow_vert:"\n#include <fog_pars_vertex>\n#include <shadowmap_pars_vertex>\n\nvoid main() {\n\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\n}\n",sprite_frag:"\nuniform vec3 diffuse;\nuniform float opacity;\n\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 <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\n\toutgoingLight = diffuseColor.rgb;\n\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\n}\n",sprite_vert:"\nuniform float rotation;\nuniform vec2 center;\n\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\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\n\t#ifndef USE_SIZEATTENUATION\n\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\n\t#endif\n\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\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\n\tmvPosition.xy += rotatedPosition;\n\n\tgl_Position = projectionMatrix * mvPosition;\n\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\n}\n"},ts={basic:{uniforms:mo([Tr.common,Tr.specularmap,Tr.envmap,Tr.aomap,Tr.lightmap,Tr.fog]),vertexShader:$o.meshbasic_vert,fragmentShader:$o.meshbasic_frag},lambert:{uniforms:mo([Tr.common,Tr.specularmap,Tr.envmap,Tr.aomap,Tr.lightmap,Tr.emissivemap,Tr.fog,Tr.lights,{emissive:{value:new _i(0)}}]),vertexShader:$o.meshlambert_vert,fragmentShader:$o.meshlambert_frag},phong:{uniforms:mo([Tr.common,Tr.specularmap,Tr.envmap,Tr.aomap,Tr.lightmap,Tr.emissivemap,Tr.bumpmap,Tr.normalmap,Tr.displacementmap,Tr.fog,Tr.lights,{emissive:{value:new _i(0)},specular:{value:new _i(1118481)},shininess:{value:30}}]),vertexShader:$o.meshphong_vert,fragmentShader:$o.meshphong_frag},standard:{uniforms:mo([Tr.common,Tr.envmap,Tr.aomap,Tr.lightmap,Tr.emissivemap,Tr.bumpmap,Tr.normalmap,Tr.displacementmap,Tr.roughnessmap,Tr.metalnessmap,Tr.fog,Tr.lights,{emissive:{value:new _i(0)},roughness:{value:.5},metalness:{value:.5},envMapIntensity:{value:1}}]),vertexShader:$o.meshphysical_vert,fragmentShader:$o.meshphysical_frag},toon:{uniforms:mo([Tr.common,Tr.specularmap,Tr.aomap,Tr.lightmap,Tr.emissivemap,Tr.bumpmap,Tr.normalmap,Tr.displacementmap,Tr.gradientmap,Tr.fog,Tr.lights,{emissive:{value:new _i(0)},specular:{value:new _i(1118481)},shininess:{value:30}}]),vertexShader:$o.meshtoon_vert,fragmentShader:$o.meshtoon_frag},matcap:{uniforms:mo([Tr.common,Tr.bumpmap,Tr.normalmap,Tr.displacementmap,Tr.fog,{matcap:{value:null}}]),vertexShader:$o.meshmatcap_vert,fragmentShader:$o.meshmatcap_frag},points:{uniforms:mo([Tr.points,Tr.fog]),vertexShader:$o.points_vert,fragmentShader:$o.points_frag},dashed:{uniforms:mo([Tr.common,Tr.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:$o.linedashed_vert,fragmentShader:$o.linedashed_frag},depth:{uniforms:mo([Tr.common,Tr.displacementmap]),vertexShader:$o.depth_vert,fragmentShader:$o.depth_frag},normal:{uniforms:mo([Tr.common,Tr.bumpmap,Tr.normalmap,Tr.displacementmap,{opacity:{value:1}}]),vertexShader:$o.normal_vert,fragmentShader:$o.normal_frag},sprite:{uniforms:mo([Tr.sprite,Tr.fog]),vertexShader:$o.sprite_vert,fragmentShader:$o.sprite_frag},background:{uniforms:{uvTransform:{value:new M},t2D:{value:null}},vertexShader:$o.background_vert,fragmentShader:$o.background_frag},cube:{uniforms:mo([Tr.envmap,{opacity:{value:1}}]),vertexShader:$o.cube_vert,fragmentShader:$o.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:$o.equirect_vert,fragmentShader:$o.equirect_frag},distanceRGBA:{uniforms:mo([Tr.common,Tr.displacementmap,{referencePosition:{value:new St},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:$o.distanceRGBA_vert,fragmentShader:$o.distanceRGBA_frag},shadow:{uniforms:mo([Tr.lights,Tr.fog,{color:{value:new _i(0)},opacity:{value:1}}]),vertexShader:$o.shadow_vert,fragmentShader:$o.shadow_frag}};function ns(o,e,s,i){var a,u,h=new _i(0),c=0,f=null,l=0,d=null;function v(t,n){e.buffers.color.setClear(t.r,t.g,t.b,n,i)}return{getClearColor:function(){return h},setClearColor:function(t,n){h.set(t),v(h,c=void 0!==n?n:1)},getClearAlpha:function(){return c},setClearAlpha:function(t){v(h,c=t)},render:function(t,n,e,i){var r=n.background,n=(n=o.xr).getSession&&n.getSession();null===(r=n&&"additive"===n.environmentBlendMode?null:r)?v(h,c):r&&r.isColor&&(v(r,1),i=!0),(o.autoClear||i)&&o.clear(o.autoClearColor,o.autoClearDepth,o.autoClearStencil),r&&(r.isCubeTexture||r.isWebGLCubeRenderTarget||r.mapping===xn)?(void 0===u&&((u=new Ko(new co(1,1,1),new wo({type:"BackgroundCubeMaterial",uniforms:po(ts.cube.uniforms),vertexShader:ts.cube.vertexShader,fragmentShader:ts.cube.fragmentShader,side:Ot,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(t,n,e){this.matrixWorld.copyPosition(e.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),s.update(u)),i=r.isWebGLCubeRenderTarget?r.texture:r,u.material.uniforms.envMap.value=i,u.material.uniforms.flipEnvMap.value=i.isCubeTexture?-1:1,f===r&&l===i.version&&d===o.toneMapping||(u.material.needsUpdate=!0,f=r,l=i.version,d=o.toneMapping),t.unshift(u,u.geometry,u.material,0,0,null)):r&&r.isTexture&&(void 0===a&&((a=new Ko(new fo(2,2),new wo({type:"BackgroundMaterial",uniforms:po(ts.background.uniforms),vertexShader:ts.background.vertexShader,fragmentShader:ts.background.fragmentShader,side:Rt,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),Object.defineProperty(a.material,"map",{get:function(){return this.uniforms.t2D.value}}),s.update(a)),!0===(a.material.uniforms.t2D.value=r).matrixAutoUpdate&&r.updateMatrix(),a.material.uniforms.uvTransform.value.copy(r.matrix),f===r&&l===r.version&&d===o.toneMapping||(a.material.needsUpdate=!0,l=(f=r).version,d=o.toneMapping),t.unshift(a,a.geometry,a.material,0,0,null))}}}function es(s,a,u,t){var h,c=t.isWebGL2;this.setMode=function(t){h=t},this.render=function(t,n){s.drawArrays(h,t,n),u.update(n,h)},this.renderInstances=function(t,n,e,i){if(0!==i){var r,o;if(c)r=s,o="drawArraysInstanced";else if(o="drawArraysInstancedANGLE",null===(r=a.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");r[o](h,n,e,i),u.update(e,h,i)}}}function is(n,e,t){var i;function r(t){if("highp"===t){if(0<n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.HIGH_FLOAT).precision&&0<n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision)return"highp";t="mediump"}return"mediump"===t&&0<n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).precision&&0<n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).precision?"mediump":"lowp"}var o="undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext||"undefined"!=typeof WebGL2ComputeRenderingContext&&n instanceof WebGL2ComputeRenderingContext,s=void 0!==t.precision?t.precision:"highp",a=r(s);a!==s&&(console.warn("THREE.WebGLRenderer:",s,"not supported, using",a,"instead."),s=a);var u=!0===t.logarithmicDepthBuffer,h=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),c=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),f=n.getParameter(n.MAX_TEXTURE_SIZE),l=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),d=n.getParameter(n.MAX_VERTEX_ATTRIBS),v=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),p=n.getParameter(n.MAX_VARYING_VECTORS),m=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),a=0<c,t=o||!!e.get("OES_texture_float");return{isWebGL2:o,getMaxAnisotropy:function(){if(void 0!==i)return i;var t=e.get("EXT_texture_filter_anisotropic");return i=null!==t?n.getParameter(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0},getMaxPrecision:r,precision:s,logarithmicDepthBuffer:u,maxTextures:h,maxVertexTextures:c,maxTextureSize:f,maxCubemapSize:l,maxAttributes:d,maxVertexUniforms:v,maxVaryings:p,maxFragmentUniforms:m,vertexTextures:a,floatFragmentTextures:t,floatVertexTextures:a&&t,maxSamples:o?n.getParameter(n.MAX_SAMPLES):0}}function rs(){var h=this,c=null,f=0,l=!1,d=!1,v=new ut,p=new M,m={value:null,needsUpdate:!1};function g(){m.value!==c&&(m.value=c,m.needsUpdate=0<f),h.numPlanes=f,h.numIntersection=0}function y(t,n,e,i){var r=null!==t?t.length:0,o=null;if(0!==r){if(o=m.value,!0!==i||null===o){var i=e+4*r,s=n.matrixWorldInverse;p.getNormalMatrix(s),(null===o||o.length<i)&&(o=new Float32Array(i));for(var a=0,u=e;a!==r;++a,u+=4)v.copy(t[a]).applyMatrix4(s,p),v.normal.toArray(o,u),o[u+3]=v.constant}m.value=o,m.needsUpdate=!0}return h.numPlanes=r,h.numIntersection=0,o}this.uniform=m,this.numPlanes=0,this.numIntersection=0,this.init=function(t,n,e){var i=0!==t.length||n||0!==f||l;return l=n,c=y(t,e,0),f=t.length,i},this.beginShadows=function(){d=!0,y(null)},this.endShadows=function(){d=!1,g()},this.setState=function(t,n,e,i,r,o){if(!l||null===t||0===t.length||d&&!e)d?y(null):g();else{var e=d?0:f,s=4*e,a=r.clippingState||null;m.value=a;for(var a=y(t,i,s,o),u=0;u!==s;++u)a[u]=c[u];r.clippingState=a,this.numIntersection=n?this.numPlanes:0,this.numPlanes+=e}}}function os(e){var i={};return{get:function(t){if(void 0!==i[t])return i[t];var n;switch(t){case"WEBGL_depth_texture":n=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":n=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":n=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":n=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:n=e.getExtension(t)}return null===n&&console.warn("THREE.WebGLRenderer: "+t+" extension not supported."),i[t]=n}}}function ss(f,l,i){var r=new WeakMap,d=new WeakMap;function o(t){var n,t=t.target,e=r.get(t);for(n in null!==e.index&&l.remove(e.index),e.attributes)l.remove(e.attributes[n]);t.removeEventListener("dispose",o),r.delete(t);t=d.get(e);t&&(l.remove(t),d.delete(e)),i.memory.geometries--}function s(t){var n=[],e=t.index,i=t.attributes.position,r=0;if(null!==e)for(var o=e.array,r=e.version,s=0,a=o.length;s<a;s+=3){var u=o[s+0],h=o[s+1],c=o[s+2];n.push(u,h,h,c,c,u)}else{o=i.array;r=i.version;for(s=0,a=o.length/3-1;s<a;s+=3)n.push(u=s+0,h=s+1,h,c=s+2,c,u)}i=new(65535<Yr(n)?zr:Hr)(n,1);i.version=r,l.update(i,f.ELEMENT_ARRAY_BUFFER);r=d.get(t);r&&l.remove(r),d.set(t,i)}return{get:function(t,n){var e=r.get(n);return e||(n.addEventListener("dispose",o),n.isBufferGeometry?e=n:n.isGeometry&&(void 0===n.ke&&(n.ke=(new eo).setFromObject(t)),e=n.ke),r.set(n,e),i.memory.geometries++,e)},update:function(t){var n=t.index,e=t.attributes;for(i in null!==n&&l.update(n,f.ELEMENT_ARRAY_BUFFER),e)l.update(e[i],f.ARRAY_BUFFER);var i,r=t.morphAttributes;for(i in r)for(var o=r[i],s=0,a=o.length;s<a;s++)l.update(o[s],f.ARRAY_BUFFER)},getWireframeAttribute:function(t){var n,e=d.get(t);return(!e||null!==(n=t.index)&&e.version<n.version)&&s(t),d.get(t)}}}function as(s,a,u,t){var h,c,f,l=t.isWebGL2;this.setMode=function(t){h=t},this.setIndex=function(t){c=t.type,f=t.bytesPerElement},this.render=function(t,n){s.drawElements(h,n,c,t*f),u.update(n,h)},this.renderInstances=function(t,n,e,i){if(0!==i){var r,o;if(l)r=s,o="drawElementsInstanced";else if(o="drawElementsInstancedANGLE",null===(r=a.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");r[o](h,e,c,n*f,i),u.update(e,h,i)}}}function us(i){var r={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:r,programs:null,autoReset:!0,reset:function(){r.frame++,r.calls=0,r.triangles=0,r.points=0,r.lines=0},update:function(t,n,e){switch(e=e||1,r.calls++,n){case i.TRIANGLES:r.triangles+=e*(t/3);break;case i.LINES:r.lines+=e*(t/2);break;case i.LINE_STRIP:r.lines+=e*(t-1);break;case i.LINE_LOOP:r.lines+=e*t;break;case i.POINTS:r.points+=e*t;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",n)}}}}function hs(t,n){return Math.abs(n[1])-Math.abs(t[1])}function cs(v){var p={},m=new Float32Array(8);return{update:function(t,n,e,i){var r=t.morphTargetInfluences,o=void 0===r?0:r.length;if(void 0===(s=p[n.id])){for(var s=[],a=0;a<o;a++)s[a]=[a,0];p[n.id]=s}for(var u=e.morphTargets&&n.morphAttributes.position,h=e.morphNormals&&n.morphAttributes.normal,a=0;a<o;a++)0!==(c=s[a])[1]&&(u&&n.deleteAttribute("morphTarget"+a),h&&n.deleteAttribute("morphNormal"+a));for(a=0;a<o;a++)(c=s[a])[0]=a,c[1]=r[a];s.sort(hs);for(var c,f=0,a=0;a<8;a++){if(c=s[a]){var l=c[0],d=c[1];if(d){u&&n.setAttribute("morphTarget"+a,u[l]),h&&n.setAttribute("morphNormal"+a,h[l]),f+=m[a]=d;continue}}m[a]=0}e=n.morphTargetsRelative?1:1-f,i.getUniforms().setValue(v,"morphTargetBaseInfluence",e),i.getUniforms().setValue(v,"morphTargetInfluences",m)}}}function fs(r,o,s,a){var u=new WeakMap;return{update:function(t){var n=a.render.frame,e=t.geometry,i=o.get(t,e);return u.get(i)!==n&&(e.isGeometry&&i.updateFromObject(t),o.update(i),u.set(i,n)),t.isInstancedMesh&&s.update(t.instanceMatrix,r.ARRAY_BUFFER),i},dispose:function(){u=new WeakMap}}}function ls(t,n,e,i,r,o,s,a,u,h){Sr.call(this,t=void 0!==t?t:[],n=void 0!==n?n:gn,e,i,r,o,s=void 0!==s?s:Xn,a,u,h),this.flipY=!1}function ds(t,n,e,i){Sr.call(this,null),this.image={data:t||null,width:n||1,height:e||1,depth:i||1},this.magFilter=Ln,this.minFilter=Ln,this.wrapR=En,this.generateMipmaps=!1,this.flipY=!1,this.needsUpdate=!0}function vs(t,n,e,i){Sr.call(this,null),this.image={data:t||null,width:n||1,height:e||1,depth:i||1},this.magFilter=Ln,this.minFilter=Ln,this.wrapR=En,this.generateMipmaps=!1,this.flipY=!1,this.needsUpdate=!0}ts.physical={uniforms:mo([ts.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new fi(1,1)},clearcoatNormalMap:{value:null},sheen:{value:new _i(0)},transparency:{value:0}}]),vertexShader:$o.meshphysical_vert,fragmentShader:$o.meshphysical_frag},((ls.prototype=Object.create(Sr.prototype)).constructor=ls).prototype.isCubeTexture=!0,Object.defineProperty(ls.prototype,"images",{get:function(){return this.image},set:function(t){this.image=t}}),((ds.prototype=Object.create(Sr.prototype)).constructor=ds).prototype.isDataTexture2DArray=!0,((vs.prototype=Object.create(Sr.prototype)).constructor=vs).prototype.isDataTexture3D=!0;var ps=new Sr,ms=new ds,gs=new vs,ys=new ls,bs=[],ws=[],_s=new Float32Array(16),xs=new Float32Array(9),Ms=new Float32Array(4);function Ss(t,n,e){var i=t[0];if(i<=0||0<i)return t;var r=n*e,o=bs[r];if(void 0===o&&(o=new Float32Array(r),bs[r]=o),0!==n){i.toArray(o,0);for(var s=1,a=0;s!==n;++s)t[s].toArray(o,a+=e)}return o}function Es(t,n){if(t.length===n.length){for(var e=0,i=t.length;e<i;e++)if(t[e]!==n[e])return;return 1}}function Ts(t,n){for(var e=0,i=n.length;e<i;e++)t[e]=n[e]}function Ls(t,n){var e=ws[n];void 0===e&&(e=new Int32Array(n),ws[n]=e);for(var i=0;i!==n;++i)e[i]=t.allocateTextureUnit();return e}function Rs(t,n){var e=this.cache;e[0]!==n&&(t.uniform1f(this.addr,n),e[0]=n)}function Os(t,n){var e=this.cache;void 0!==n.x?e[0]===n.x&&e[1]===n.y||(t.uniform2f(this.addr,n.x,n.y),e[0]=n.x,e[1]=n.y):Es(e,n)||(t.uniform2fv(this.addr,n),Ts(e,n))}function As(t,n){var e=this.cache;void 0!==n.x?e[0]===n.x&&e[1]===n.y&&e[2]===n.z||(t.uniform3f(this.addr,n.x,n.y,n.z),e[0]=n.x,e[1]=n.y,e[2]=n.z):void 0!==n.r?e[0]===n.r&&e[1]===n.g&&e[2]===n.b||(t.uniform3f(this.addr,n.r,n.g,n.b),e[0]=n.r,e[1]=n.g,e[2]=n.b):Es(e,n)||(t.uniform3fv(this.addr,n),Ts(e,n))}function ks(t,n){var e=this.cache;void 0!==n.x?e[0]===n.x&&e[1]===n.y&&e[2]===n.z&&e[3]===n.w||(t.uniform4f(this.addr,n.x,n.y,n.z,n.w),e[0]=n.x,e[1]=n.y,e[2]=n.z,e[3]=n.w):Es(e,n)||(t.uniform4fv(this.addr,n),Ts(e,n))}function Cs(t,n){var e=this.cache,i=n.elements;void 0===i?Es(e,n)||(t.uniformMatrix2fv(this.addr,!1,n),Ts(e,n)):Es(e,i)||(Ms.set(i),t.uniformMatrix2fv(this.addr,!1,Ms),Ts(e,i))}function js(t,n){var e=this.cache,i=n.elements;void 0===i?Es(e,n)||(t.uniformMatrix3fv(this.addr,!1,n),Ts(e,n)):Es(e,i)||(xs.set(i),t.uniformMatrix3fv(this.addr,!1,xs),Ts(e,i))}function Ps(t,n){var e=this.cache,i=n.elements;void 0===i?Es(e,n)||(t.uniformMatrix4fv(this.addr,!1,n),Ts(e,n)):Es(e,i)||(_s.set(i),t.uniformMatrix4fv(this.addr,!1,_s),Ts(e,i))}function Ds(t,n,e){var i=this.cache,r=e.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),e.safeSetTexture2D(n||ps,r)}function Is(t,n,e){var i=this.cache,r=e.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),e.setTexture2DArray(n||ms,r)}function Ns(t,n,e){var i=this.cache,r=e.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),e.setTexture3D(n||gs,r)}function Fs(t,n,e){var i=this.cache,r=e.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),e.safeSetTextureCube(n||ys,r)}function Us(t,n){var e=this.cache;e[0]!==n&&(t.uniform1i(this.addr,n),e[0]=n)}function Bs(t,n){var e=this.cache;Es(e,n)||(t.uniform2iv(this.addr,n),Ts(e,n))}function Gs(t,n){var e=this.cache;Es(e,n)||(t.uniform3iv(this.addr,n),Ts(e,n))}function Hs(t,n){var e=this.cache;Es(e,n)||(t.uniform4iv(this.addr,n),Ts(e,n))}function Vs(t,n){var e=this.cache;e[0]!==n&&(t.uniform1ui(this.addr,n),e[0]=n)}function zs(t,n){t.uniform1fv(this.addr,n)}function Ws(t,n){t.uniform1iv(this.addr,n)}function Xs(t,n){t.uniform2iv(this.addr,n)}function Zs(t,n){t.uniform3iv(this.addr,n)}function Ys(t,n){t.uniform4iv(this.addr,n)}function qs(t,n){n=Ss(n,this.size,2);t.uniform2fv(this.addr,n)}function Ks(t,n){n=Ss(n,this.size,3);t.uniform3fv(this.addr,n)}function Js(t,n){n=Ss(n,this.size,4);t.uniform4fv(this.addr,n)}function Qs(t,n){n=Ss(n,this.size,4);t.uniformMatrix2fv(this.addr,!1,n)}function $s(t,n){n=Ss(n,this.size,9);t.uniformMatrix3fv(this.addr,!1,n)}function ta(t,n){n=Ss(n,this.size,16);t.uniformMatrix4fv(this.addr,!1,n)}function na(t,n,e){var i=n.length,r=Ls(e,i);t.uniform1iv(this.addr,r);for(var o=0;o!==i;++o)e.safeSetTexture2D(n[o]||ps,r[o])}function ea(t,n,e){var i=n.length,r=Ls(e,i);t.uniform1iv(this.addr,r);for(var o=0;o!==i;++o)e.safeSetTextureCube(n[o]||ys,r[o])}function ia(t,n,e){this.id=t,this.addr=e,this.cache=[],this.setValue=function(t){switch(t){case 5126:return Rs;case 35664:return Os;case 35665:return As;case 35666:return ks;case 35674:return Cs;case 35675:return js;case 35676:return Ps;case 5124:case 35670:return Us;case 35667:case 35671:return Bs;case 35668:case 35672:return Gs;case 35669:case 35673:return Hs;case 5125:return Vs;case 35678:case 36198:case 36298:case 36306:case 35682:return Ds;case 35679:case 36299:case 36307:return Ns;case 35680:case 36300:case 36308:case 36293:return Fs;case 36289:case 36303:case 36311:case 36292:return Is}}(n.type)}function ra(t,n,e){this.id=t,this.addr=e,this.cache=[],this.size=n.size,this.setValue=function(t){switch(t){case 5126:return zs;case 35664:return qs;case 35665:return Ks;case 35666:return Js;case 35674:return Qs;case 35675:return $s;case 35676:return ta;case 5124:case 35670:return Ws;case 35667:case 35671:return Xs;case 35668:case 35672:return Zs;case 35669:case 35673:return Ys;case 35678:case 36198:case 36298:case 36306:case 35682:return na;case 35680:case 36300:case 36308:case 36293:return ea}}(n.type)}function oa(t){this.id=t,this.seq=[],this.map={}}ra.prototype.updateCache=function(t){var n=this.cache;t instanceof Float32Array&&n.length!==t.length&&(this.cache=new Float32Array(t.length)),Ts(n,t)},oa.prototype.setValue=function(t,n,e){for(var i=this.seq,r=0,o=i.length;r!==o;++r){var s=i[r];s.setValue(t,n[s.id],e)}};var sa=/([\w\d_]+)(\])?(\[|\.)?/g;function aa(t,n){t.seq.push(n),t.map[n.id]=n}function ua(t,n){this.seq=[],this.map={};for(var e=t.getProgramParameter(n,t.ACTIVE_UNIFORMS),i=0;i<e;++i){var r=t.getActiveUniform(n,i);!function(t,n,e){var i=t.name,r=i.length;for(sa.lastIndex=0;;){var o=sa.exec(i),s=sa.lastIndex,a=o[1],u="]"===o[2],o=o[3];if(u&&(a|=0),void 0===o||"["===o&&s+2===r){aa(e,new(void 0===o?ia:ra)(a,t,n));break}o=e.map[a];void 0===o&&aa(e,o=new oa(a)),e=o}}(r,t.getUniformLocation(n,r.name),this)}}function ha(t,n,e){n=t.createShader(n);return t.shaderSource(n,e),t.compileShader(n),n}ua.prototype.setValue=function(t,n,e,i){n=this.map[n];void 0!==n&&n.setValue(t,e,i)},ua.prototype.setOptional=function(t,n,e){n=n[e];void 0!==n&&this.setValue(t,e,n)},ua.upload=function(t,n,e,i){for(var r=0,o=n.length;r!==o;++r){var s=n[r],a=e[s.id];!1!==a.needsUpdate&&s.setValue(t,a.value,i)}},ua.seqWithValue=function(t,n){for(var e=[],i=0,r=t.length;i!==r;++i){var o=t[i];o.id in n&&e.push(o)}return e};var ca=0;function fa(t){switch(t){case qe:return["Linear","( value )"];case Ke:return["sRGB","( value )"];case Qe:return["RGBE","( value )"];case ti:return["RGBM","( value, 7.0 )"];case ni:return["RGBM","( value, 16.0 )"];case ei:return["RGBD","( value, 256.0 )"];case Je:return["Gamma","( value, float( GAMMA_FACTOR ) )"];case $e:return["LogLuv","( value )"];default:throw new Error("unsupported encoding: "+t)}}function la(t,n,e){var i=t.getShaderParameter(n,t.COMPILE_STATUS),r=t.getShaderInfoLog(n).trim();return i&&""===r?"":"THREE.WebGLShader: gl.getShaderInfoLog() "+e+"\n"+r+function(t){for(var n=t.split("\n"),e=0;e<n.length;e++)n[e]=e+1+": "+n[e];return n.join("\n")}(t.getShaderSource(n))}function da(t,n){n=fa(n);return"vec4 "+t+"( vec4 value ) { return "+n[0]+"ToLinear"+n[1]+"; }"}function va(t){return""!==t}function pa(t,n){return t.replace(/NUM_DIR_LIGHTS/g,n.numDirLights).replace(/NUM_SPOT_LIGHTS/g,n.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,n.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,n.numPointLights).replace(/NUM_HEMI_LIGHTS/g,n.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,n.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS/g,n.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,n.numPointLightShadows)}function ma(t,n){return t.replace(/NUM_CLIPPING_PLANES/g,n.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,n.numClippingPlanes-n.numClipIntersection)}var ga=/^[ \t]*#include +<([\w\d./]+)>/gm;function ya(t){return t.replace(ga,ba)}function ba(t,n){var e=$o[n];if(void 0===e)throw new Error("Can not resolve #include <"+n+">");return ya(e)}var wa=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,_a=/#pragma unroll_loop_start[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}[\s]+?#pragma unroll_loop_end/g;function xa(t){return t.replace(_a,Sa).replace(wa,Ma)}function Ma(t,n,e,i){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),Sa(0,n,e,i)}function Sa(t,n,e,i){for(var r="",o=parseInt(n);o<parseInt(e);o++)r+=i.replace(/\[ i \]/g,"[ "+o+" ]").replace(/UNROLLED_LOOP_INDEX/g,o);return r}function Ea(t){var n="precision "+t.precision+" float;\nprecision "+t.precision+" int;";return"highp"===t.precision?n+="\n#define HIGH_PRECISION":"mediump"===t.precision?n+="\n#define MEDIUM_PRECISION":"lowp"===t.precision&&(n+="\n#define LOW_PRECISION"),n}function Ta(t,n,e){var i,r,o,s=t.getContext(),a=e.defines,u=e.vertexShader,h=e.fragmentShader,c=(v="SHADOWMAP_TYPE_BASIC",(d=e).shadowMapType===_t?v="SHADOWMAP_TYPE_PCF":d.shadowMapType===xt?v="SHADOWMAP_TYPE_PCF_SOFT":d.shadowMapType===Lt&&(v="SHADOWMAP_TYPE_VSM"),v),f=function(t){var n="ENVMAP_TYPE_CUBE";if(t.envMap)switch(t.envMapMode){case gn:case yn:n="ENVMAP_TYPE_CUBE";break;case xn:case Mn:n="ENVMAP_TYPE_CUBE_UV";break;case bn:case wn:n="ENVMAP_TYPE_EQUIREC";break;case _n:n="ENVMAP_TYPE_SPHERE"}return n}(e),l=function(t){var n="ENVMAP_MODE_REFLECTION";if(t.envMap)switch(t.envMapMode){case yn:case wn:n="ENVMAP_MODE_REFRACTION"}return n}(e),d=function(t){var n="ENVMAP_BLENDING_NONE";if(t.envMap)switch(t.combine){case un:n="ENVMAP_BLENDING_MULTIPLY";break;case hn:n="ENVMAP_BLENDING_MIX";break;case cn:n="ENVMAP_BLENDING_ADD"}return n}(e),v=0<t.gammaFactor?t.gammaFactor:1,i=e.isWebGL2?"":[(i=e).extensionDerivatives||i.envMapCubeUV||i.bumpMap||i.tangentSpaceNormalMap||i.clearcoatNormalMap||i.flatShading||"physical"===i.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(i.extensionFragDepth||i.logarithmicDepthBuffer)&&i.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",i.extensionDrawBuffers&&i.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(i.extensionShaderTextureLOD||i.envMap)&&i.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(va).join("\n"),a=function(t){var n,e=[];for(n in t){var i=t[n];!1!==i&&e.push("#define "+n+" "+i)}return e.join("\n")}(a),p=s.createProgram();e.isRawShaderMaterial?(0<(r=[a].filter(va).join("\n")).length&&(r+="\n"),0<(o=[i,a].filter(va).join("\n")).length&&(o+="\n")):(r=[Ea(e),"#define SHADER_NAME "+e.shaderName,a,e.instancing?"#define USE_INSTANCING":"",e.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+v,"#define MAX_BONES "+e.maxBones,e.useFog&&e.fog?"#define USE_FOG":"",e.useFog&&e.fogExp2?"#define FOG_EXP2":"",e.map?"#define USE_MAP":"",e.envMap?"#define USE_ENVMAP":"",e.envMap?"#define "+l:"",e.lightMap?"#define USE_LIGHTMAP":"",e.aoMap?"#define USE_AOMAP":"",e.emissiveMap?"#define USE_EMISSIVEMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.normalMap&&e.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",e.normalMap&&e.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",e.clearcoatMap?"#define USE_CLEARCOATMAP":"",e.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",e.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",e.displacementMap&&e.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.roughnessMap?"#define USE_ROUGHNESSMAP":"",e.metalnessMap?"#define USE_METALNESSMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.vertexTangents?"#define USE_TANGENT":"",e.vertexColors?"#define USE_COLOR":"",e.vertexUvs?"#define USE_UV":"",e.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",e.flatShading?"#define FLAT_SHADED":"",e.skinning?"#define USE_SKINNING":"",e.useVertexTexture?"#define BONE_TEXTURE":"",e.morphTargets?"#define USE_MORPHTARGETS":"",e.morphNormals&&!1===e.flatShading?"#define USE_MORPHNORMALS":"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+c:"",e.sizeAttenuation?"#define USE_SIZEATTENUATION":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",e.logarithmicDepthBuffer&&e.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","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(va).join("\n"),o=[i,Ea(e),"#define SHADER_NAME "+e.shaderName,a,e.alphaTest?"#define ALPHATEST "+e.alphaTest+(e.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+v,e.useFog&&e.fog?"#define USE_FOG":"",e.useFog&&e.fogExp2?"#define FOG_EXP2":"",e.map?"#define USE_MAP":"",e.matcap?"#define USE_MATCAP":"",e.envMap?"#define USE_ENVMAP":"",e.envMap?"#define "+f:"",e.envMap?"#define "+l:"",e.envMap?"#define "+d:"",e.lightMap?"#define USE_LIGHTMAP":"",e.aoMap?"#define USE_AOMAP":"",e.emissiveMap?"#define USE_EMISSIVEMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.normalMap&&e.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",e.normalMap&&e.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",e.clearcoatMap?"#define USE_CLEARCOATMAP":"",e.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",e.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.roughnessMap?"#define USE_ROUGHNESSMAP":"",e.metalnessMap?"#define USE_METALNESSMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.sheen?"#define USE_SHEEN":"",e.vertexTangents?"#define USE_TANGENT":"",e.vertexColors?"#define USE_COLOR":"",e.vertexUvs?"#define USE_UV":"",e.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",e.gradientMap?"#define USE_GRADIENTMAP":"",e.flatShading?"#define FLAT_SHADED":"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+c:"",e.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",e.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",e.logarithmicDepthBuffer&&e.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(e.extensionShaderTextureLOD||e.envMap)&&e.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",e.toneMapping!==fn?"#define TONE_MAPPING":"",e.toneMapping!==fn?$o.tonemapping_pars_fragment:"",e.toneMapping!==fn?function(t,n){var e;switch(n){case ln:e="Linear";break;case dn:e="Reinhard";break;case vn:e="Uncharted2";break;case pn:e="OptimizedCineon";break;case mn:e="ACESFilmic";break;default:throw new Error("unsupported toneMapping: "+n)}return"vec3 "+t+"( vec3 color ) { return "+e+"ToneMapping( color ); }"}("toneMapping",e.toneMapping):"",e.dithering?"#define DITHERING":"",e.outputEncoding||e.mapEncoding||e.matcapEncoding||e.envMapEncoding||e.emissiveMapEncoding||e.lightMapEncoding?$o.encodings_pars_fragment:"",e.mapEncoding?da("mapTexelToLinear",e.mapEncoding):"",e.matcapEncoding?da("matcapTexelToLinear",e.matcapEncoding):"",e.envMapEncoding?da("envMapTexelToLinear",e.envMapEncoding):"",e.emissiveMapEncoding?da("emissiveMapTexelToLinear",e.emissiveMapEncoding):"",e.lightMapEncoding?da("lightMapTexelToLinear",e.lightMapEncoding):"",e.outputEncoding?(_="linearToOutputTexel",m=fa(m=e.outputEncoding),"vec4 "+_+"( vec4 value ) { return LinearTo"+m[0]+m[1]+"; }"):"",e.depthPacking?"#define DEPTH_PACKING "+e.depthPacking:"","\n"].filter(va).join("\n")),u=ma(u=pa(u=ya(u),e),e),h=ma(h=pa(h=ya(h),e),e),u=xa(u),h=xa(h),e.isWebGL2&&!e.isRawShaderMaterial&&(y=!1,g=/^\s*#version\s+300\s+es\s*\n/,e.isShaderMaterial&&null!==u.match(g)&&null!==h.match(g)&&(y=!0,u=u.replace(g,""),h=h.replace(g,"")),r=["#version 300 es\n","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+r,o=["#version 300 es\n","#define varying in",y?"":"out highp vec4 pc_fragColor;",y?"":"#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"+o);var m,g,y,b,w,d=o+h,c=ha(s,s.VERTEX_SHADER,r+u),_=ha(s,s.FRAGMENT_SHADER,d);return s.attachShader(p,c),s.attachShader(p,_),void 0!==e.index0AttributeName?s.bindAttribLocation(p,0,e.index0AttributeName):!0===e.morphTargets&&s.bindAttribLocation(p,0,"position"),s.linkProgram(p),t.debug.checkShaderErrors&&(m=s.getProgramInfoLog(p).trim(),g=s.getShaderInfoLog(c).trim(),y=s.getShaderInfoLog(_).trim(),!(u=h=!0)===s.getProgramParameter(p,s.LINK_STATUS)?(h=!1,d=la(s,c,"vertex"),t=la(s,_,"fragment"),console.error("THREE.WebGLProgram: shader error: ",s.getError(),"gl.VALIDATE_STATUS",s.getProgramParameter(p,s.VALIDATE_STATUS),"gl.getProgramInfoLog",m,d,t)):""!==m?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",m):""!==g&&""!==y||(u=!1),u&&(this.diagnostics={runnable:h,programLog:m,vertexShader:{log:g,prefix:r},fragmentShader:{log:y,prefix:o}})),s.detachShader(p,c),s.detachShader(p,_),s.deleteShader(c),s.deleteShader(_),this.getUniforms=function(){return b=void 0===b?new ua(s,p):b},this.getAttributes=function(){return w=void 0===w?function(t,n){for(var e={},i=t.getProgramParameter(n,t.ACTIVE_ATTRIBUTES),r=0;r<i;r++){var o=t.getActiveAttrib(n,r).name;e[o]=t.getAttribLocation(n,o)}return e}(s,p):w},this.destroy=function(){s.deleteProgram(p),this.program=void 0},this.name=e.shaderName,this.id=ca++,this.cacheKey=n,this.usedTimes=1,this.program=p,this.vertexShader=c,this.fragmentShader=_,this}function La(l,d,v){var s=[],p=v.isWebGL2,m=v.logarithmicDepthBuffer,g=v.floatVertexTextures,y=v.precision,b=v.maxVertexUniforms,w=v.vertexTextures,_={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"},r=["precision","isWebGL2","supportsVertexTextures","outputEncoding","instancing","map","mapEncoding","matcap","matcapEncoding","envMap","envMapMode","envMapEncoding","envMapCubeUV","lightMap","lightMapEncoding","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","tangentSpaceNormalMap","clearcoatMap","clearcoatRoughnessMap","clearcoatNormalMap","displacementMap","specularMap","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","vertexTangents","vertexUvs","uvsVertexOnly","fog","useFog","fogExp2","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","maxMorphTargets","maxMorphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","numDirLightShadows","numPointLightShadows","numSpotLightShadows","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering","sheen"];function x(t){var n;return t?t.isTexture?n=t.encoding:t.isWebGLRenderTarget&&(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),n=t.texture.encoding):n=qe,n}this.getParameters=function(t,n,e,i,r,o,s){var a=i.fog,u=t.isMeshStandardMaterial?i.environment:null,h=t.envMap||u,i=_[t.type],u=s.isSkinnedMesh?(f=(c=s).skeleton.bones,g?1024:(c=Math.floor((b-20)/4),(c=Math.min(c,f.length))<f.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+f.length+" bones. This GPU supports "+c+"."),0):c)):0;null!==t.precision&&(y=v.getMaxPrecision(t.precision))!==t.precision&&console.warn("THREE.WebGLProgram.getParameters:",t.precision,"not supported, using",y,"instead.");var c,c=(f=t,(c=i)?(c=ts[c],{name:f.type,uniforms:go.clone(c.uniforms),vertexShader:c.vertexShader,fragmentShader:c.fragmentShader}):{name:f.type,uniforms:f.uniforms,vertexShader:f.vertexShader,fragmentShader:f.fragmentShader});t.onBeforeCompile(c,l);var f=l.getRenderTarget();return{isWebGL2:p,shaderID:i,shaderName:c.name,uniforms:c.uniforms,vertexShader:c.vertexShader,fragmentShader:c.fragmentShader,defines:t.defines,isRawShaderMaterial:t.isRawShaderMaterial,isShaderMaterial:t.isShaderMaterial,precision:y,instancing:!0===s.isInstancedMesh,supportsVertexTextures:w,outputEncoding:null!==f?x(f.texture):l.outputEncoding,map:!!t.map,mapEncoding:x(t.map),matcap:!!t.matcap,matcapEncoding:x(t.matcap),envMap:!!h,envMapMode:h&&h.mapping,envMapEncoding:x(h),envMapCubeUV:!!h&&(h.mapping===xn||h.mapping===Mn),lightMap:!!t.lightMap,lightMapEncoding:x(t.lightMap),aoMap:!!t.aoMap,emissiveMap:!!t.emissiveMap,emissiveMapEncoding:x(t.emissiveMap),bumpMap:!!t.bumpMap,normalMap:!!t.normalMap,objectSpaceNormalMap:t.normalMapType===si,tangentSpaceNormalMap:t.normalMapType===oi,clearcoatMap:!!t.clearcoatMap,clearcoatRoughnessMap:!!t.clearcoatRoughnessMap,clearcoatNormalMap:!!t.clearcoatNormalMap,displacementMap:!!t.displacementMap,roughnessMap:!!t.roughnessMap,metalnessMap:!!t.metalnessMap,specularMap:!!t.specularMap,alphaMap:!!t.alphaMap,gradientMap:!!t.gradientMap,sheen:!!t.sheen,combine:t.combine,vertexTangents:t.normalMap&&t.vertexTangents,vertexColors:t.vertexColors,vertexUvs:!!(t.map||t.bumpMap||t.normalMap||t.specularMap||t.alphaMap||t.emissiveMap||t.roughnessMap||t.metalnessMap||t.clearcoatMap||t.clearcoatRoughnessMap||t.clearcoatNormalMap||t.displacementMap),uvsVertexOnly:!(t.map||t.bumpMap||t.normalMap||t.specularMap||t.alphaMap||t.emissiveMap||t.roughnessMap||t.metalnessMap||t.clearcoatNormalMap||!t.displacementMap),fog:!!a,useFog:t.fog,fogExp2:a&&a.isFogExp2,flatShading:t.flatShading,sizeAttenuation:t.sizeAttenuation,logarithmicDepthBuffer:m,skinning:t.skinning&&0<u,maxBones:u,useVertexTexture:g,morphTargets:t.morphTargets,morphNormals:t.morphNormals,maxMorphTargets:l.maxMorphTargets,maxMorphNormals:l.maxMorphNormals,numDirLights:n.directional.length,numPointLights:n.point.length,numSpotLights:n.spot.length,numRectAreaLights:n.rectArea.length,numHemiLights:n.hemi.length,numDirLightShadows:n.directionalShadowMap.length,numPointLightShadows:n.pointShadowMap.length,numSpotLightShadows:n.spotShadowMap.length,numClippingPlanes:r,numClipIntersection:o,dithering:t.dithering,shadowMapEnabled:l.shadowMap.enabled&&0<e.length,shadowMapType:l.shadowMap.type,toneMapping:t.toneMapped?l.toneMapping:fn,physicallyCorrectLights:l.physicallyCorrectLights,premultipliedAlpha:t.premultipliedAlpha,alphaTest:t.alphaTest,doubleSided:t.side===At,flipSided:t.side===Ot,depthPacking:void 0!==t.depthPacking&&t.depthPacking,index0AttributeName:t.index0AttributeName,extensionDerivatives:t.extensions&&t.extensions.derivatives,extensionFragDepth:t.extensions&&t.extensions.fragDepth,extensionDrawBuffers:t.extensions&&t.extensions.drawBuffers,extensionShaderTextureLOD:t.extensions&&t.extensions.shaderTextureLOD,rendererExtensionFragDepth:p||null!==d.get("EXT_frag_depth"),rendererExtensionDrawBuffers:p||null!==d.get("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:p||null!==d.get("EXT_shader_texture_lod"),onBeforeCompile:t.onBeforeCompile}},this.getProgramCacheKey=function(t){var n=[];if(t.shaderID?n.push(t.shaderID):(n.push(t.fragmentShader),n.push(t.vertexShader)),void 0!==t.defines)for(var e in t.defines)n.push(e),n.push(t.defines[e]);if(void 0===t.isRawShaderMaterial){for(var i=0;i<r.length;i++)n.push(t[r[i]]);n.push(l.outputEncoding),n.push(l.gammaFactor)}return n.push(t.onBeforeCompile.toString()),n.join()},this.acquireProgram=function(t,n){for(var e,i=0,r=s.length;i<r;i++){var o=s[i];if(o.cacheKey===n){++(e=o).usedTimes;break}}return void 0===e&&(e=new Ta(l,n,t),s.push(e)),e},this.releaseProgram=function(t){var n;0==--t.usedTimes&&(n=s.indexOf(t),s[n]=s[s.length-1],s.pop(),t.destroy())},this.programs=s}function Ra(){var i=new WeakMap;return{get:function(t){var n=i.get(t);return void 0===n&&i.set(t,n={}),n},remove:function(t){i.delete(t)},update:function(t,n,e){i.get(t)[n]=e},dispose:function(){i=new WeakMap}}}function Oa(t,n){return t.groupOrder!==n.groupOrder?t.groupOrder-n.groupOrder:t.renderOrder!==n.renderOrder?t.renderOrder-n.renderOrder:t.program!==n.program?t.program.id-n.program.id:t.material.id!==n.material.id?t.material.id-n.material.id:t.z!==n.z?t.z-n.z:t.id-n.id}function Aa(t,n){return t.groupOrder!==n.groupOrder?t.groupOrder-n.groupOrder:t.renderOrder!==n.renderOrder?t.renderOrder-n.renderOrder:t.z!==n.z?n.z-t.z:t.id-n.id}function ka(){var a=[],u=0,s=[],h=[],c={id:-1};function f(t,n,e,i,r,o){var s=a[u];return void 0===s?(s={id:t.id,object:t,geometry:n,material:e,program:e.program||c,groupOrder:i,renderOrder:t.renderOrder,z:r,group:o},a[u]=s):(s.id=t.id,s.object=t,s.geometry=n,s.material=e,s.program=e.program||c,s.groupOrder=i,s.renderOrder=t.renderOrder,s.z=r,s.group=o),u++,s}return{opaque:s,transparent:h,init:function(){u=0,s.length=0,h.length=0},push:function(t,n,e,i,r,o){o=f(t,n,e,i,r,o),(!0===e.transparent?h:s).push(o)},unshift:function(t,n,e,i,r,o){o=f(t,n,e,i,r,o),(!0===e.transparent?h:s).unshift(o)},finish:function(){for(var t=u,n=a.length;t<n;t++){var e=a[t];if(null===e.id)break;e.id=null,e.object=null,e.geometry=null,e.material=null,e.program=null,e.group=null}},sort:function(t,n){1<s.length&&s.sort(t||Oa),1<h.length&&h.sort(n||Aa)}}}function Ca(){var r=new WeakMap;function o(t){t=t.target;t.removeEventListener("dispose",o),r.delete(t)}return{get:function(t,n){var e,i=r.get(t);return void 0===i?(e=new ka,r.set(t,new WeakMap),r.get(t).set(n,e),t.addEventListener("dispose",o)):void 0===(e=i.get(n))&&(e=new ka,i.set(n,e)),e},dispose:function(){r=new WeakMap}}}function ja(){var e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];var n;switch(t.type){case"DirectionalLight":n={direction:new St,color:new _i};break;case"SpotLight":n={position:new St,direction:new St,color:new _i,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new St,color:new _i,distance:0,decay:0};break;case"HemisphereLight":n={direction:new St,skyColor:new _i,groundColor:new _i};break;case"RectAreaLight":n={color:new _i,position:new St,halfWidth:new St,halfHeight:new St}}return e[t.id]=n}}}var Pa=0;function Da(t,n){return(n.castShadow?1:0)-(t.castShadow?1:0)}function Ia(){for(var e,T=new ja,L=(e={},{get:function(t){if(void 0!==e[t.id])return e[t.id];var n;switch(t.type){case"DirectionalLight":case"SpotLight":n={shadowBias:0,shadowRadius:1,shadowMapSize:new fi};break;case"PointLight":n={shadowBias:0,shadowRadius:1,shadowMapSize:new fi,shadowCameraNear:1,shadowCameraFar:1e3}}return e[t.id]=n}}),R={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]},t=0;t<9;t++)R.probe.push(new St);var O=new St,A=new Et,k=new Et;return{setup:function(t,n,e){for(var i=0,r=0,o=0,s=0;s<9;s++)R.probe[s].set(0,0,0);var a=0,u=0,h=0,c=0,f=0,l=0,d=0,v=0,p=e.matrixWorldInverse;t.sort(Da);for(var s=0,m=t.length;s<m;s++){var g,y,b,w=t[s],_=w.color,x=w.intensity,M=w.distance,S=w.shadow&&w.shadow.map?w.shadow.map.texture:null;if(w.isAmbientLight)i+=_.r*x,r+=_.g*x,o+=_.b*x;else if(w.isLightProbe)for(var E=0;E<9;E++)R.probe[E].addScaledVector(w.sh.coefficients[E],x);else w.isDirectionalLight?((b=T.get(w)).color.copy(w.color).multiplyScalar(w.intensity),b.direction.setFromMatrixPosition(w.matrixWorld),O.setFromMatrixPosition(w.target.matrixWorld),b.direction.sub(O),b.direction.transformDirection(p),w.castShadow&&(g=w.shadow,(y=L.get(w)).shadowBias=g.bias,y.shadowRadius=g.radius,y.shadowMapSize=g.mapSize,R.directionalShadow[a]=y,R.directionalShadowMap[a]=S,R.directionalShadowMatrix[a]=w.shadow.matrix,l++),R.directional[a]=b,a++):w.isSpotLight?((b=T.get(w)).position.setFromMatrixPosition(w.matrixWorld),b.position.applyMatrix4(p),b.color.copy(_).multiplyScalar(x),b.distance=M,b.direction.setFromMatrixPosition(w.matrixWorld),O.setFromMatrixPosition(w.target.matrixWorld),b.direction.sub(O),b.direction.transformDirection(p),b.coneCos=Math.cos(w.angle),b.penumbraCos=Math.cos(w.angle*(1-w.penumbra)),b.decay=w.decay,w.castShadow&&(g=w.shadow,(y=L.get(w)).shadowBias=g.bias,y.shadowRadius=g.radius,y.shadowMapSize=g.mapSize,R.spotShadow[h]=y,R.spotShadowMap[h]=S,R.spotShadowMatrix[h]=w.shadow.matrix,v++),R.spot[h]=b,h++):w.isRectAreaLight?((b=T.get(w)).color.copy(_).multiplyScalar(x),b.position.setFromMatrixPosition(w.matrixWorld),b.position.applyMatrix4(p),k.identity(),A.copy(w.matrixWorld),A.premultiply(p),k.extractRotation(A),b.halfWidth.set(.5*w.width,0,0),b.halfHeight.set(0,.5*w.height,0),b.halfWidth.applyMatrix4(k),b.halfHeight.applyMatrix4(k),R.rectArea[c]=b,c++):w.isPointLight?((b=T.get(w)).position.setFromMatrixPosition(w.matrixWorld),b.position.applyMatrix4(p),b.color.copy(w.color).multiplyScalar(w.intensity),b.distance=w.distance,b.decay=w.decay,w.castShadow&&(g=w.shadow,(y=L.get(w)).shadowBias=g.bias,y.shadowRadius=g.radius,y.shadowMapSize=g.mapSize,y.shadowCameraNear=g.camera.near,y.shadowCameraFar=g.camera.far,R.pointShadow[u]=y,R.pointShadowMap[u]=S,R.pointShadowMatrix[u]=w.shadow.matrix,d++),R.point[u]=b,u++):w.isHemisphereLight&&((b=T.get(w)).direction.setFromMatrixPosition(w.matrixWorld),b.direction.transformDirection(p),b.direction.normalize(),b.skyColor.copy(w.color).multiplyScalar(x),b.groundColor.copy(w.groundColor).multiplyScalar(x),R.hemi[f]=b,f++)}R.ambient[0]=i,R.ambient[1]=r,R.ambient[2]=o,(e=R.hash).directionalLength===a&&e.pointLength===u&&e.spotLength===h&&e.rectAreaLength===c&&e.hemiLength===f&&e.numDirectionalShadows===l&&e.numPointShadows===d&&e.numSpotShadows===v||(R.directional.length=a,R.spot.length=h,R.rectArea.length=c,R.point.length=u,R.hemi.length=f,R.directionalShadow.length=l,R.directionalShadowMap.length=l,R.pointShadow.length=d,R.pointShadowMap.length=d,R.spotShadow.length=v,R.spotShadowMap.length=v,R.directionalShadowMatrix.length=l,R.pointShadowMatrix.length=d,R.spotShadowMatrix.length=v,e.directionalLength=a,e.pointLength=u,e.spotLength=h,e.rectAreaLength=c,e.hemiLength=f,e.numDirectionalShadows=l,e.numPointShadows=d,e.numSpotShadows=v,R.version=Pa++)},state:R}}function Na(){var n=new Ia,e=[],i=[];return{init:function(){e.length=0,i.length=0},state:{lightsArray:e,shadowsArray:i,lights:n},setupLights:function(t){n.setup(e,i,t)},pushLight:function(t){e.push(t)},pushShadow:function(t){i.push(t)}}}function Fa(){var i=new WeakMap;function r(t){t=t.target;t.removeEventListener("dispose",r),i.delete(t)}return{get:function(t,n){var e;return!1===i.has(t)?(e=new Na,i.set(t,new WeakMap),i.get(t).set(n,e),t.addEventListener("dispose",r)):!1===i.get(t).has(n)?(e=new Na,i.get(t).set(n,e)):e=i.get(t).get(n),e},dispose:function(){i=new WeakMap}}}function Ua(t,n,e){this.width=t,this.height=n,this.scissor=new Ci(0,0,t,n),this.scissorTest=!1,this.viewport=new Ci(0,0,t,n),this.texture=new Sr(void 0,(e=e||{}).mapping,e.wrapS,e.wrapT,e.magFilter,e.minFilter,e.format,e.type,e.anisotropy,e.encoding),this.texture.image={},this.texture.image.width=t,this.texture.image.height=n,this.texture.generateMipmaps=void 0!==e.generateMipmaps&&e.generateMipmaps,this.texture.minFilter=void 0!==e.minFilter?e.minFilter:An,this.depthBuffer=void 0===e.depthBuffer||e.depthBuffer,this.stencilBuffer=void 0===e.stencilBuffer||e.stencilBuffer,this.depthTexture=void 0!==e.depthTexture?e.depthTexture:null}function Ba(t){vo.call(this),this.type="MeshDepthMaterial",this.depthPacking=ii,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(t)}function Ga(t){vo.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new St,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.setValues(t)}Ua.prototype=Object.assign(Object.create(y.prototype),{constructor:Ua,isWebGLRenderTarget:!0,setSize:function(t,n){this.width===t&&this.height===n||(this.width=t,this.height=n,this.texture.image.width=t,this.texture.image.height=n,this.dispose()),this.viewport.set(0,0,t,n),this.scissor.set(0,0,t,n)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.width=t.width,this.height=t.height,this.viewport.copy(t.viewport),this.texture=t.texture.clone(),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.depthTexture=t.depthTexture,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),((Ba.prototype=Object.create(vo.prototype)).constructor=Ba).prototype.isMeshDepthMaterial=!0,Ba.prototype.copy=function(t){return vo.prototype.copy.call(this,t),this.depthPacking=t.depthPacking,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this},((Ga.prototype=Object.create(vo.prototype)).constructor=Ga).prototype.isMeshDistanceMaterial=!0,Ga.prototype.copy=function(t){return vo.prototype.copy.call(this,t),this.referencePosition.copy(t.referencePosition),this.nearDistance=t.nearDistance,this.farDistance=t.farDistance,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this};var Ha="\nuniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n\n#include <packing>\n\nvoid main() {\n\n float mean = 0.0;\n float squared_mean = 0.0;\n\n\t// This seems totally useless but it's a crazy work around for a Adreno compiler bug\n\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) );\n\n for ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) {\n\n #ifdef HORIZONAL_PASS\n\n vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) );\n mean += distribution.x;\n squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\n #else\n\n float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) );\n mean += depth;\n squared_mean += depth * depth;\n\n #endif\n\n }\n\n mean = mean * HALF_SAMPLE_RATE;\n squared_mean = squared_mean * HALF_SAMPLE_RATE;\n\n float std_dev = sqrt( squared_mean - mean * mean );\n\n gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n\n}\n",Va="\n\nvoid main() {\n\n\tgl_Position = vec4( position, 1.0 );\n\n}\n\n";function za(y,b,w){var _=new Tt,x=new fi,M=new fi,S=new Ci,r=[],o=[],l={},d={0:Ot,1:Rt,2:At},E=new wo({defines:{SAMPLE_RATE:.25,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new fi},radius:{value:4}},vertexShader:Va,fragmentShader:Ha}),T=E.clone();T.defines.HORIZONAL_PASS=1;var t=new eo;t.setAttribute("position",new Nr(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));var L=new Ko(t,E),R=this;function v(t,n,e){var i=t<<0|n<<1|e<<2,e=r[i];return void 0===e&&(e=new Ba({depthPacking:ri,morphTargets:t,skinning:n}),r[i]=e),e}function p(t,n,e){var i=t<<0|n<<1|e<<2,e=o[i];return void 0===e&&(e=new Ga({morphTargets:t,skinning:n}),o[i]=e),e}function O(t,n,e,i,r,o){var s,a,u=t.geometry,h=null,c=v,f=t.customDepthMaterial;return!0===e.isPointLight&&(c=p,f=t.customDistanceMaterial),h=void 0===f?(!(s=!1)===n.morphTargets&&(!0===u.isBufferGeometry?s=u.morphAttributes&&u.morphAttributes.position&&0<u.morphAttributes.position.length:!0===u.isGeometry&&(s=u.morphTargets&&0<u.morphTargets.length)),!(a=!1)===t.isSkinnedMesh&&(!0===n.skinning?a=!0:console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",t)),c(s,a,!0===t.isInstancedMesh)):f,y.localClippingEnabled&&!0===n.clipShadows&&0!==n.clippingPlanes.length&&(a=h.uuid,t=n.uuid,void 0===(f=l[a])&&(l[a]=f={}),void 0===(a=f[t])&&(a=h.clone(),f[t]=a),h=a),h.visible=n.visible,h.wireframe=n.wireframe,h.side=o===Lt?null!==n.shadowSide?n.shadowSide:n.side:null!==n.shadowSide?n.shadowSide:d[n.side],h.clipShadows=n.clipShadows,h.clippingPlanes=n.clippingPlanes,h.clipIntersection=n.clipIntersection,h.wireframeLinewidth=n.wireframeLinewidth,h.linewidth=n.linewidth,!0===e.isPointLight&&!0===h.isMeshDistanceMaterial&&(h.referencePosition.setFromMatrixPosition(e.matrixWorld),h.nearDistance=i,h.farDistance=r),h}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=_t,this.render=function(t,n,e){if(!1!==R.enabled&&(!1!==R.autoUpdate||!1!==R.needsUpdate)&&0!==t.length){var i=y.getRenderTarget(),r=y.getActiveCubeFace(),o=y.getActiveMipmapLevel(),s=y.state;s.setBlending(kt),s.buffers.color.setClear(1,1,1,1),s.buffers.depth.setTest(!0),s.setScissorTest(!1);for(var a,u,h=0,c=t.length;h<c;h++){var f=t[h],l=f.shadow;if(void 0!==l){x.copy(l.mapSize);var d,v=l.getFrameExtents();x.multiply(v),M.copy(l.mapSize),(x.x>w||x.y>w)&&(console.warn("THREE.WebGLShadowMap:",f,"has shadow exceeding max texture size, reducing"),x.x>w&&(M.x=Math.floor(w/v.x),x.x=M.x*v.x,l.mapSize.x=M.x),x.y>w&&(M.y=Math.floor(w/v.y),x.y=M.y*v.y,l.mapSize.y=M.y)),null!==l.map||l.isPointLightShadow||this.type!==Lt||(l.map=new Ua(x.x,x.y,d={minFilter:An,magFilter:An,format:Zn}),l.map.texture.name=f.name+".shadowMap",l.mapPass=new Ua(x.x,x.y,d),l.camera.updateProjectionMatrix()),null===l.map&&(l.map=new Ua(x.x,x.y,d={minFilter:Ln,magFilter:Ln,format:Zn}),l.map.texture.name=f.name+".shadowMap",l.camera.updateProjectionMatrix()),y.setRenderTarget(l.map),y.clear();for(var p=l.getViewportCount(),m=0;m<p;m++){var g=l.getViewport(m);S.set(M.x*g.x,M.y*g.y,M.x*g.z,M.y*g.w),s.viewport(S),l.updateMatrices(f,m),_=l.getFrustum(),function t(n,e,i,r,o){if(!1===n.visible)return;var s=n.layers.test(e.layers);if(s&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&o===Lt)&&(!n.frustumCulled||_.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse,n.matrixWorld);var a=b.update(n),u=n.material;if(Array.isArray(u))for(var h=a.groups,c=0,f=h.length;c<f;c++){var l,d=h[c],v=u[d.materialIndex];v&&v.visible&&(l=O(n,v,r,i.near,i.far,o),y.renderBufferDirect(i,null,a,l,n,d))}else u.visible&&(l=O(n,u,r,i.near,i.far,o),y.renderBufferDirect(i,null,a,l,n,null))}var p=n.children;for(var m=0,g=p.length;m<g;m++)t(p[m],e,i,r,o)}(n,e,l.camera,f,this.type)}l.isPointLightShadow||this.type!==Lt||(a=l,u=e,v=void 0,v=b.update(L),E.uniforms.shadow_pass.value=a.map.texture,E.uniforms.resolution.value=a.mapSize,E.uniforms.radius.value=a.radius,y.setRenderTarget(a.mapPass),y.clear(),y.renderBufferDirect(u,null,v,E,L,null),T.uniforms.shadow_pass.value=a.mapPass.texture,T.uniforms.resolution.value=a.mapSize,T.uniforms.radius.value=a.radius,y.setRenderTarget(a.map),y.clear(),y.renderBufferDirect(u,null,v,T,L,null))}else console.warn("THREE.WebGLShadowMap:",f,"has no shadow.")}R.needsUpdate=!1,y.setRenderTarget(i,r,o)}}}function Wa(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function Xa(c,e,t){var i=t.isWebGL2;var r=new function(){var n=!1,o=new Ci,e=null,s=new Ci(0,0,0,0);return{setMask:function(t){e===t||n||(c.colorMask(t,t,t,t),e=t)},setLocked:function(t){n=t},setClear:function(t,n,e,i,r){!0===r&&(t*=i,n*=i,e*=i),o.set(t,n,e,i),!1===s.equals(o)&&(c.clearColor(t,n,e,i),s.copy(o))},reset:function(){n=!1,e=null,s.set(-1,0,0,0)}}},o=new function(){var n=!1,e=null,i=null,r=null;return{setTest:function(t){(t?I:N)(c.DEPTH_TEST)},setMask:function(t){e===t||n||(c.depthMask(t),e=t)},setFunc:function(t){if(i!==t){if(t)switch(t){case $t:c.depthFunc(c.NEVER);break;case tn:c.depthFunc(c.ALWAYS);break;case nn:c.depthFunc(c.LESS);break;case en:c.depthFunc(c.LEQUAL);break;case rn:c.depthFunc(c.EQUAL);break;case on:c.depthFunc(c.GEQUAL);break;case sn:c.depthFunc(c.GREATER);break;case an:c.depthFunc(c.NOTEQUAL);break;default:c.depthFunc(c.LEQUAL)}else c.depthFunc(c.LEQUAL);i=t}},setLocked:function(t){n=t},setClear:function(t){r!==t&&(c.clearDepth(t),r=t)},reset:function(){n=!1,r=i=e=null}}},s=new function(){var n=!1,e=null,i=null,r=null,o=null,s=null,a=null,u=null,h=null;return{setTest:function(t){n||(t?I:N)(c.STENCIL_TEST)},setMask:function(t){e===t||n||(c.stencilMask(t),e=t)},setFunc:function(t,n,e){i===t&&r===n&&o===e||(c.stencilFunc(t,n,e),i=t,r=n,o=e)},setOp:function(t,n,e){s===t&&a===n&&u===e||(c.stencilOp(t,n,e),s=t,a=n,u=e)},setLocked:function(t){n=t},setClear:function(t){h!==t&&(c.clearStencil(t),h=t)},reset:function(){n=!1,h=u=a=s=o=r=i=e=null}}},n=c.getParameter(c.MAX_VERTEX_ATTRIBS),a=new Uint8Array(n),u=new Uint8Array(n),h=new Uint8Array(n),f={},l=null,d=null,v=null,p=null,m=null,g=null,y=null,b=null,w=null,_=!1,x=null,M=null,S=null,E=null,T=null,L=c.getParameter(c.MAX_COMBINED_TEXTURE_IMAGE_UNITS),R=!1,t=0,n=c.getParameter(c.VERSION);-1!==n.indexOf("WebGL")?(t=parseFloat(/^WebGL\ ([0-9])/.exec(n)[1]),R=1<=t):-1!==n.indexOf("OpenGL ES")&&(t=parseFloat(/^OpenGL\ ES\ ([0-9])/.exec(n)[1]),R=2<=t);var O=null,A={},k=new Ci,C=new Ci;function j(t,n,e){var i=new Uint8Array(4),r=c.createTexture();c.bindTexture(t,r),c.texParameteri(t,c.TEXTURE_MIN_FILTER,c.NEAREST),c.texParameteri(t,c.TEXTURE_MAG_FILTER,c.NEAREST);for(var o=0;o<e;o++)c.texImage2D(n+o,0,c.RGBA,1,1,0,c.RGBA,c.UNSIGNED_BYTE,i);return r}var P={};function D(t,n){a[t]=1,0===u[t]&&(c.enableVertexAttribArray(t),u[t]=1),h[t]!==n&&((i?c:e.get("ANGLE_instanced_arrays"))[i?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](t,n),h[t]=n)}function I(t){!0!==f[t]&&(c.enable(t),f[t]=!0)}function N(t){!1!==f[t]&&(c.disable(t),f[t]=!1)}P[c.TEXTURE_2D]=j(c.TEXTURE_2D,c.TEXTURE_2D,1),P[c.TEXTURE_CUBE_MAP]=j(c.TEXTURE_CUBE_MAP,c.TEXTURE_CUBE_MAP_POSITIVE_X,6),r.setClear(0,0,0,1),o.setClear(1),s.setClear(0),I(c.DEPTH_TEST),o.setFunc(en),H(!1),V(bt),I(c.CULL_FACE),G(kt);var F,U=(Wa(t={},Nt,c.FUNC_ADD),Wa(t,Ft,c.FUNC_SUBTRACT),Wa(t,Ut,c.FUNC_REVERSE_SUBTRACT),t);i?(U[Bt]=c.MIN,U[Gt]=c.MAX):null!==(F=e.get("EXT_blend_minmax"))&&(U[Bt]=F.MIN_EXT,U[Gt]=F.MAX_EXT);var B=(Wa(F={},Ht,c.ZERO),Wa(F,Vt,c.ONE),Wa(F,zt,c.SRC_COLOR),Wa(F,Xt,c.SRC_ALPHA),Wa(F,Qt,c.SRC_ALPHA_SATURATE),Wa(F,Kt,c.DST_COLOR),Wa(F,Yt,c.DST_ALPHA),Wa(F,Wt,c.ONE_MINUS_SRC_COLOR),Wa(F,Zt,c.ONE_MINUS_SRC_ALPHA),Wa(F,Jt,c.ONE_MINUS_DST_COLOR),Wa(F,qt,c.ONE_MINUS_DST_ALPHA),F);function G(t,n,e,i,r,o,s,a){if(t!==kt){if(d||(I(c.BLEND),d=!0),t===It)r=r||n,o=o||e,s=s||i,n===p&&r===y||(c.blendEquationSeparate(U[n],U[r]),p=n,y=r),e===m&&i===g&&o===b&&s===w||(c.blendFuncSeparate(B[e],B[i],B[o],B[s]),m=e,g=i,b=o,w=s),v=t,_=null;else if(t!==v||a!==_){if(p===Nt&&y===Nt||(c.blendEquation(c.FUNC_ADD),y=p=Nt),a)switch(t){case Ct:c.blendFuncSeparate(c.ONE,c.ONE_MINUS_SRC_ALPHA,c.ONE,c.ONE_MINUS_SRC_ALPHA);break;case jt:c.blendFunc(c.ONE,c.ONE);break;case Pt:c.blendFuncSeparate(c.ZERO,c.ZERO,c.ONE_MINUS_SRC_COLOR,c.ONE_MINUS_SRC_ALPHA);break;case Dt:c.blendFuncSeparate(c.ZERO,c.SRC_COLOR,c.ZERO,c.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}else switch(t){case Ct:c.blendFuncSeparate(c.SRC_ALPHA,c.ONE_MINUS_SRC_ALPHA,c.ONE,c.ONE_MINUS_SRC_ALPHA);break;case jt:c.blendFunc(c.SRC_ALPHA,c.ONE);break;case Pt:c.blendFunc(c.ZERO,c.ONE_MINUS_SRC_COLOR);break;case Dt:c.blendFunc(c.ZERO,c.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}w=b=g=m=null,v=t,_=a}}else d&&(N(c.BLEND),d=!1)}function H(t){x!==t&&(t?c.frontFace(c.CW):c.frontFace(c.CCW),x=t)}function V(t){t!==yt?(I(c.CULL_FACE),t!==M&&(t===bt?c.cullFace(c.BACK):t===wt?c.cullFace(c.FRONT):c.cullFace(c.FRONT_AND_BACK))):N(c.CULL_FACE),M=t}function z(t,n,e){t?(I(c.POLYGON_OFFSET_FILL),E===n&&T===e||(c.polygonOffset(n,e),E=n,T=e)):N(c.POLYGON_OFFSET_FILL)}function W(t){void 0===t&&(t=c.TEXTURE0+L-1),O!==t&&(c.activeTexture(t),O=t)}return{buffers:{color:r,depth:o,stencil:s},initAttributes:function(){for(var t=0,n=a.length;t<n;t++)a[t]=0},enableAttribute:function(t){D(t,0)},enableAttributeAndDivisor:D,disableUnusedAttributes:function(){for(var t=0,n=u.length;t!==n;++t)u[t]!==a[t]&&(c.disableVertexAttribArray(t),u[t]=0)},enable:I,disable:N,useProgram:function(t){return l!==t&&(c.useProgram(t),l=t,!0)},setBlending:G,setMaterial:function(t,n){(t.side===At?N:I)(c.CULL_FACE);var e=t.side===Ot;H(e=n?!e:e),t.blending===Ct&&!1===t.transparent?G(kt):G(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha,t.premultipliedAlpha),o.setFunc(t.depthFunc),o.setTest(t.depthTest),o.setMask(t.depthWrite),r.setMask(t.colorWrite),e=t.stencilWrite,s.setTest(e),e&&(s.setMask(t.stencilWriteMask),s.setFunc(t.stencilFunc,t.stencilRef,t.stencilFuncMask),s.setOp(t.stencilFail,t.stencilZFail,t.stencilZPass)),z(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits)},setFlipSided:H,setCullFace:V,setLineWidth:function(t){t!==S&&(R&&c.lineWidth(t),S=t)},setPolygonOffset:z,setScissorTest:function(t){(t?I:N)(c.SCISSOR_TEST)},activeTexture:W,bindTexture:function(t,n){null===O&&W();var e=A[O];void 0===e&&(A[O]=e={type:void 0,texture:void 0}),e.type===t&&e.texture===n||(c.bindTexture(t,n||P[t]),e.type=t,e.texture=n)},unbindTexture:function(){var t=A[O];void 0!==t&&void 0!==t.type&&(c.bindTexture(t.type,null),t.type=void 0,t.texture=void 0)},compressedTexImage2D:function(){try{c.compressedTexImage2D.apply(c,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage2D:function(){try{c.texImage2D.apply(c,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage3D:function(){try{c.texImage3D.apply(c,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},scissor:function(t){!1===k.equals(t)&&(c.scissor(t.x,t.y,t.z,t.w),k.copy(t))},viewport:function(t){!1===C.equals(t)&&(c.viewport(t.x,t.y,t.z,t.w),C.copy(t))},reset:function(){for(var t=0;t<u.length;t++)1===u[t]&&(c.disableVertexAttribArray(t),u[t]=0);f={},A={},M=x=v=l=O=null,r.reset(),o.reset(),s.reset()}}}function Za(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function Ya(m,i,g,y,r,b,u){var t,o,w=r.isWebGL2,n=r.maxTextures,_=r.maxCubemapSize,l=r.maxTextureSize,e=r.maxSamples,s=new WeakMap,a=!1;try{a="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(t){}function h(t,n){return a?new OffscreenCanvas(t,n):document.createElementNS("http://www.w3.org/1999/xhtml","canvas")}function x(t,n,e,i){var r=1;if((r=t.width>i||t.height>i?i/Math.max(t.width,t.height):r)<1||!0===n){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){i=n?Mt.floorPowerOfTwo:Math.floor,n=i(r*t.width),r=i(r*t.height);void 0===o&&(o=h(n,r));e=e?h(n,r):o;return e.width=n,e.height=r,e.getContext("2d").drawImage(t,0,0,n,r),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+t.width+"x"+t.height+") to ("+n+"x"+r+")."),e}return"data"in t&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+t.width+"x"+t.height+")."),t}return t}function M(t){return Mt.isPowerOfTwo(t.width)&&Mt.isPowerOfTwo(t.height)}function S(t,n){return t.generateMipmaps&&n&&t.minFilter!==Ln&&t.minFilter!==An}function E(t,n,e,i){m.generateMipmap(t),y.get(n).Ce=Math.log(Math.max(e,i))*Math.LOG2E}function T(t,n,e){if(!1===w)return n;if(null!==t){if(void 0!==m[t])return m[t];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+t+"'")}t=n;return n===m.RED&&(e===m.FLOAT&&(t=m.R32F),e===m.HALF_FLOAT&&(t=m.R16F),e===m.UNSIGNED_BYTE&&(t=m.R8)),n===m.RGB&&(e===m.FLOAT&&(t=m.RGB32F),e===m.HALF_FLOAT&&(t=m.RGB16F),e===m.UNSIGNED_BYTE&&(t=m.RGB8)),n===m.RGBA&&(e===m.FLOAT&&(t=m.RGBA32F),e===m.HALF_FLOAT&&(t=m.RGBA16F),e===m.UNSIGNED_BYTE&&(t=m.RGBA8)),t!==m.R16F&&t!==m.R32F&&t!==m.RGBA16F&&t!==m.RGBA32F||i.get("EXT_color_buffer_float"),t}function c(t){return t===Ln||t===Rn||t===On?m.NEAREST:m.LINEAR}function f(t){var n,e=t.target;e.removeEventListener("dispose",f),n=e,void 0!==(t=y.get(n)).je&&(m.deleteTexture(t.Pe),y.remove(n)),e.isVideoTexture&&s.delete(e),u.memory.textures--}function d(t){t=t.target;t.removeEventListener("dispose",d),function(t){var n=y.get(t),e=y.get(t.texture);if(t){if(void 0!==e.Pe&&m.deleteTexture(e.Pe),t.depthTexture&&t.depthTexture.dispose(),t.isWebGLCubeRenderTarget)for(var i=0;i<6;i++)m.deleteFramebuffer(n.De[i]),n.Ie&&m.deleteRenderbuffer(n.Ie[i]);else m.deleteFramebuffer(n.De),n.Ie&&m.deleteRenderbuffer(n.Ie),n.Ne&&m.deleteFramebuffer(n.Ne),n.Fe&&m.deleteRenderbuffer(n.Fe),n.Ue&&m.deleteRenderbuffer(n.Ue);y.remove(t.texture),y.remove(t)}}(t),u.memory.textures--}var v=0;function p(t,n){var e,i=y.get(t);if(t.isVideoTexture&&(r=t,e=u.render.frame,s.get(r)!==e&&(s.set(r,e),r.update())),0<t.version&&i.Be!==t.version){var r=t.image;if(void 0===r)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==r.complete)return void j(i,t,n);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}g.activeTexture(m.TEXTURE0+n),g.bindTexture(m.TEXTURE_2D,i.Pe)}function L(t,n){if(6===t.image.length){var e=y.get(t);if(0<t.version&&e.Be!==t.version){C(e,t),g.activeTexture(m.TEXTURE0+n),g.bindTexture(m.TEXTURE_CUBE_MAP,e.Pe),m.pixelStorei(m.UNPACK_FLIP_Y_WEBGL,t.flipY);for(var i=t&&(t.isCompressedTexture||t.image[0].isCompressedTexture),r=t.image[0]&&t.image[0].isDataTexture,o=[],s=0;s<6;s++)o[s]=i||r?r?t.image[s].image:t.image[s]:x(t.image[s],!1,!0,_);var a=o[0],u=M(a)||w,h=b.convert(t.format),c=b.convert(t.type),f=T(t.internalFormat,h,c);if(k(m.TEXTURE_CUBE_MAP,t,u),i){for(s=0;s<6;s++)for(var l=o[s].mipmaps,d=0;d<l.length;d++){var v=l[d];t.format!==Zn&&t.format!==Xn?null!==h?g.compressedTexImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+s,d,f,v.width,v.height,0,v.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):g.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+s,d,f,v.width,v.height,0,h,c,v.data)}e.Ce=l.length-1}else{l=t.mipmaps;for(s=0;s<6;s++)if(r){g.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+s,0,f,o[s].width,o[s].height,0,h,c,o[s].data);for(d=0;d<l.length;d++){var p=(v=l[d]).image[s].image;g.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+s,d+1,f,p.width,p.height,0,h,c,p.data)}}else{g.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+s,0,f,h,c,o[s]);for(d=0;d<l.length;d++){v=l[d];g.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+s,d+1,f,h,c,v.image[s])}}e.Ce=l.length}S(t,u)&&E(m.TEXTURE_CUBE_MAP,t,a.width,a.height),e.Be=t.version,t.onUpdate&&t.onUpdate(t)}else g.activeTexture(m.TEXTURE0+n),g.bindTexture(m.TEXTURE_CUBE_MAP,e.Pe)}}function R(t,n){g.activeTexture(m.TEXTURE0+n),g.bindTexture(m.TEXTURE_CUBE_MAP,y.get(t).Pe)}var O=(Za(t={},Sn,m.REPEAT),Za(t,En,m.CLAMP_TO_EDGE),Za(t,Tn,m.MIRRORED_REPEAT),t),A=(Za(t={},Ln,m.NEAREST),Za(t,Rn,m.NEAREST_MIPMAP_NEAREST),Za(t,On,m.NEAREST_MIPMAP_LINEAR),Za(t,An,m.LINEAR),Za(t,kn,m.LINEAR_MIPMAP_NEAREST),Za(t,Cn,m.LINEAR_MIPMAP_LINEAR),t);function k(t,n,e){e?(m.texParameteri(t,m.TEXTURE_WRAP_S,O[n.wrapS]),m.texParameteri(t,m.TEXTURE_WRAP_T,O[n.wrapT]),t!==m.TEXTURE_3D&&t!==m.TEXTURE_2D_ARRAY||m.texParameteri(t,m.TEXTURE_WRAP_R,O[n.wrapR]),m.texParameteri(t,m.TEXTURE_MAG_FILTER,A[n.magFilter]),m.texParameteri(t,m.TEXTURE_MIN_FILTER,A[n.minFilter])):(m.texParameteri(t,m.TEXTURE_WRAP_S,m.CLAMP_TO_EDGE),m.texParameteri(t,m.TEXTURE_WRAP_T,m.CLAMP_TO_EDGE),t!==m.TEXTURE_3D&&t!==m.TEXTURE_2D_ARRAY||m.texParameteri(t,m.TEXTURE_WRAP_R,m.CLAMP_TO_EDGE),n.wrapS===En&&n.wrapT===En||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),m.texParameteri(t,m.TEXTURE_MAG_FILTER,c(n.magFilter)),m.texParameteri(t,m.TEXTURE_MIN_FILTER,c(n.minFilter)),n.minFilter!==Ln&&n.minFilter!==An&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter."));e=i.get("EXT_texture_filter_anisotropic");e&&(n.type===Un&&null===i.get("OES_texture_float_linear")||n.type===Bn&&null===(w||i.get("OES_texture_half_float_linear"))||(1<n.anisotropy||y.get(n).Ge)&&(m.texParameterf(t,e.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(n.anisotropy,r.getMaxAnisotropy())),y.get(n).Ge=n.anisotropy))}function C(t,n){void 0===t.je&&(t.je=!0,n.addEventListener("dispose",f),t.Pe=m.createTexture(),u.memory.textures++)}function j(t,n,e){var i=m.TEXTURE_2D;n.isDataTexture2DArray&&(i=m.TEXTURE_2D_ARRAY),n.isDataTexture3D&&(i=m.TEXTURE_3D),C(t,n),g.activeTexture(m.TEXTURE0+e),g.bindTexture(i,t.Pe),m.pixelStorei(m.UNPACK_FLIP_Y_WEBGL,n.flipY),m.pixelStorei(m.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n.premultiplyAlpha),m.pixelStorei(m.UNPACK_ALIGNMENT,n.unpackAlignment);var e=(r=n,!w&&(r.wrapS!==En||r.wrapT!==En||r.minFilter!==Ln&&r.minFilter!==An)&&!1===M(n.image)),r=x(n.image,e,!1,l),e=M(r)||w,o=b.convert(n.format),s=b.convert(n.type),a=T(n.internalFormat,o,s);k(i,n,e);var u,h=n.mipmaps;if(n.isDepthTexture)a=m.DEPTH_COMPONENT,w?a=n.type===Un?m.DEPTH_COMPONENT32F:n.type===Fn?m.DEPTH_COMPONENT24:n.type===zn?m.DEPTH24_STENCIL8:m.DEPTH_COMPONENT16:n.type===Un&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),n.format===Kn&&a===m.DEPTH_COMPONENT&&n.type!==In&&n.type!==Fn&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),n.type=In,s=b.convert(n.type)),n.format===Jn&&a===m.DEPTH_COMPONENT&&(a=m.DEPTH_STENCIL,n.type!==zn&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),n.type=zn,s=b.convert(n.type))),g.texImage2D(m.TEXTURE_2D,0,a,r.width,r.height,0,o,s,null);else if(n.isDataTexture)if(0<h.length&&e){for(var c=0,f=h.length;c<f;c++)u=h[c],g.texImage2D(m.TEXTURE_2D,c,a,u.width,u.height,0,o,s,u.data);n.generateMipmaps=!1,t.Ce=h.length-1}else g.texImage2D(m.TEXTURE_2D,0,a,r.width,r.height,0,o,s,r.data),t.Ce=0;else if(n.isCompressedTexture){for(c=0,f=h.length;c<f;c++)u=h[c],n.format!==Zn&&n.format!==Xn?null!==o?g.compressedTexImage2D(m.TEXTURE_2D,c,a,u.width,u.height,0,u.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):g.texImage2D(m.TEXTURE_2D,c,a,u.width,u.height,0,o,s,u.data);t.Ce=h.length-1}else if(n.isDataTexture2DArray)g.texImage3D(m.TEXTURE_2D_ARRAY,0,a,r.width,r.height,r.depth,0,o,s,r.data),t.Ce=0;else if(n.isDataTexture3D)g.texImage3D(m.TEXTURE_3D,0,a,r.width,r.height,r.depth,0,o,s,r.data),t.Ce=0;else if(0<h.length&&e){for(c=0,f=h.length;c<f;c++)u=h[c],g.texImage2D(m.TEXTURE_2D,c,a,o,s,u);n.generateMipmaps=!1,t.Ce=h.length-1}else g.texImage2D(m.TEXTURE_2D,0,a,o,s,r),t.Ce=0;S(n,e)&&E(i,n,r.width,r.height),t.Be=n.version,n.onUpdate&&n.onUpdate(n)}function P(t,n,e,i){var r=b.convert(n.texture.format),o=b.convert(n.texture.type),s=T(n.texture.internalFormat,r,o);g.texImage2D(i,0,s,n.width,n.height,0,r,o,null),m.bindFramebuffer(m.FRAMEBUFFER,t),m.framebufferTexture2D(m.FRAMEBUFFER,e,i,y.get(n.texture).Pe,0),m.bindFramebuffer(m.FRAMEBUFFER,null)}function D(t,n,e){var i,r,o;m.bindRenderbuffer(m.RENDERBUFFER,t),n.depthBuffer&&!n.stencilBuffer?(r=m.DEPTH_COMPONENT16,e?((i=n.depthTexture)&&i.isDepthTexture&&(i.type===Un?r=m.DEPTH_COMPONENT32F:i.type===Fn&&(r=m.DEPTH_COMPONENT24)),o=N(n),m.renderbufferStorageMultisample(m.RENDERBUFFER,o,r,n.width,n.height)):m.renderbufferStorage(m.RENDERBUFFER,r,n.width,n.height),m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_ATTACHMENT,m.RENDERBUFFER,t)):n.depthBuffer&&n.stencilBuffer?(e?(o=N(n),m.renderbufferStorageMultisample(m.RENDERBUFFER,o,m.DEPTH24_STENCIL8,n.width,n.height)):m.renderbufferStorage(m.RENDERBUFFER,m.DEPTH_STENCIL,n.width,n.height),m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_STENCIL_ATTACHMENT,m.RENDERBUFFER,t)):(i=b.convert(n.texture.format),t=b.convert(n.texture.type),r=T(n.texture.internalFormat,i,t),e?(o=N(n),m.renderbufferStorageMultisample(m.RENDERBUFFER,o,r,n.width,n.height)):m.renderbufferStorage(m.RENDERBUFFER,r,n.width,n.height)),m.bindRenderbuffer(m.RENDERBUFFER,null)}function I(t){var n=y.get(t),e=!0===t.isWebGLCubeRenderTarget;if(t.depthTexture){if(e)throw new Error("target.depthTexture not supported in Cube render targets");!function(t,n){if(n&&n.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(m.bindFramebuffer(m.FRAMEBUFFER,t),!n.depthTexture||!n.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");if(y.get(n.depthTexture).Pe&&n.depthTexture.image.width===n.width&&n.depthTexture.image.height===n.height||(n.depthTexture.image.width=n.width,n.depthTexture.image.height=n.height,n.depthTexture.needsUpdate=!0),p(n.depthTexture,0),t=y.get(n.depthTexture).Pe,n.depthTexture.format===Kn)m.framebufferTexture2D(m.FRAMEBUFFER,m.DEPTH_ATTACHMENT,m.TEXTURE_2D,t,0);else{if(n.depthTexture.format!==Jn)throw new Error("Unknown depthTexture format");m.framebufferTexture2D(m.FRAMEBUFFER,m.DEPTH_STENCIL_ATTACHMENT,m.TEXTURE_2D,t,0)}}(n.De,t)}else if(e){n.Ie=[];for(var i=0;i<6;i++)m.bindFramebuffer(m.FRAMEBUFFER,n.De[i]),n.Ie[i]=m.createRenderbuffer(),D(n.Ie[i],t,!1)}else m.bindFramebuffer(m.FRAMEBUFFER,n.De),n.Ie=m.createRenderbuffer(),D(n.Ie,t,!1);m.bindFramebuffer(m.FRAMEBUFFER,null)}function N(t){return w&&t.isWebGLMultisampleRenderTarget?Math.min(e,t.samples):0}var F=!1,U=!1;this.allocateTextureUnit=function(){var t=v;return n<=t&&console.warn("THREE.WebGLTextures: Trying to use "+t+" texture units while this GPU supports only "+n),v+=1,t},this.resetTextureUnits=function(){v=0},this.setTexture2D=p,this.setTexture2DArray=function(t,n){var e=y.get(t);0<t.version&&e.Be!==t.version?j(e,t,n):(g.activeTexture(m.TEXTURE0+n),g.bindTexture(m.TEXTURE_2D_ARRAY,e.Pe))},this.setTexture3D=function(t,n){var e=y.get(t);0<t.version&&e.Be!==t.version?j(e,t,n):(g.activeTexture(m.TEXTURE0+n),g.bindTexture(m.TEXTURE_3D,e.Pe))},this.setTextureCube=L,this.setTextureCubeDynamic=R,this.setupRenderTarget=function(t){var n=y.get(t),e=y.get(t.texture);t.addEventListener("dispose",d),e.Pe=m.createTexture(),u.memory.textures++;var i,r=!0===t.isWebGLCubeRenderTarget,o=!0===t.isWebGLMultisampleRenderTarget,s=M(t)||w;if(!w||t.texture.format!==Xn||t.texture.type!==Un&&t.texture.type!==Bn||(t.texture.format=Zn,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),r){n.De=[];for(var a=0;a<6;a++)n.De[a]=m.createFramebuffer()}else n.De=m.createFramebuffer(),o&&(w?(n.Ne=m.createFramebuffer(),n.Fe=m.createRenderbuffer(),m.bindRenderbuffer(m.RENDERBUFFER,n.Fe),i=b.convert(t.texture.format),o=b.convert(t.texture.type),i=T(t.texture.internalFormat,i,o),o=N(t),m.renderbufferStorageMultisample(m.RENDERBUFFER,o,i,t.width,t.height),m.bindFramebuffer(m.FRAMEBUFFER,n.Ne),m.framebufferRenderbuffer(m.FRAMEBUFFER,m.COLOR_ATTACHMENT0,m.RENDERBUFFER,n.Fe),m.bindRenderbuffer(m.RENDERBUFFER,null),t.depthBuffer&&(n.Ue=m.createRenderbuffer(),D(n.Ue,t,!0)),m.bindFramebuffer(m.FRAMEBUFFER,null)):console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2."));if(r){g.bindTexture(m.TEXTURE_CUBE_MAP,e.Pe),k(m.TEXTURE_CUBE_MAP,t.texture,s);for(a=0;a<6;a++)P(n.De[a],t,m.COLOR_ATTACHMENT0,m.TEXTURE_CUBE_MAP_POSITIVE_X+a);S(t.texture,s)&&E(m.TEXTURE_CUBE_MAP,t.texture,t.width,t.height),g.bindTexture(m.TEXTURE_CUBE_MAP,null)}else g.bindTexture(m.TEXTURE_2D,e.Pe),k(m.TEXTURE_2D,t.texture,s),P(n.De,t,m.COLOR_ATTACHMENT0,m.TEXTURE_2D),S(t.texture,s)&&E(m.TEXTURE_2D,t.texture,t.width,t.height),g.bindTexture(m.TEXTURE_2D,null);t.depthBuffer&&I(t)},this.updateRenderTargetMipmap=function(t){var n,e,i=t.texture;S(i,M(t)||w)&&(n=t.isWebGLCubeRenderTarget?m.TEXTURE_CUBE_MAP:m.TEXTURE_2D,e=y.get(i).Pe,g.bindTexture(n,e),E(n,i,t.width,t.height),g.bindTexture(n,null))},this.updateMultisampleRenderTarget=function(t){var n,e,i,r;t.isWebGLMultisampleRenderTarget&&(w?(n=y.get(t),m.bindFramebuffer(m.READ_FRAMEBUFFER,n.Ne),m.bindFramebuffer(m.DRAW_FRAMEBUFFER,n.De),e=t.width,i=t.height,r=m.COLOR_BUFFER_BIT,t.depthBuffer&&(r|=m.DEPTH_BUFFER_BIT),t.stencilBuffer&&(r|=m.STENCIL_BUFFER_BIT),m.blitFramebuffer(0,0,e,i,0,0,e,i,r,m.NEAREST),m.bindFramebuffer(m.FRAMEBUFFER,n.Ne)):console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2."))},this.safeSetTexture2D=function(t,n){t&&t.isWebGLRenderTarget&&(!1===F&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),F=!0),t=t.texture),p(t,n)},this.safeSetTextureCube=function(t,n){t&&t.isWebGLCubeRenderTarget&&(!1===U&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),U=!0),t=t.texture),(t&&t.isCubeTexture||Array.isArray(t.image)&&6===t.image.length?L:R)(t,n)}}function qa(e,i,t){var r=t.isWebGL2;return{convert:function(t){var n;if(t===jn)return e.UNSIGNED_BYTE;if(t===Gn)return e.UNSIGNED_SHORT_4_4_4_4;if(t===Hn)return e.UNSIGNED_SHORT_5_5_5_1;if(t===Vn)return e.UNSIGNED_SHORT_5_6_5;if(t===Pn)return e.BYTE;if(t===Dn)return e.SHORT;if(t===In)return e.UNSIGNED_SHORT;if(t===Nn)return e.INT;if(t===Fn)return e.UNSIGNED_INT;if(t===Un)return e.FLOAT;if(t===Bn)return r?e.HALF_FLOAT:null!==(n=i.get("OES_texture_half_float"))?n.HALF_FLOAT_OES:null;if(t===Wn)return e.ALPHA;if(t===Xn)return e.RGB;if(t===Zn)return e.RGBA;if(t===Yn)return e.LUMINANCE;if(t===qn)return e.LUMINANCE_ALPHA;if(t===Kn)return e.DEPTH_COMPONENT;if(t===Jn)return e.DEPTH_STENCIL;if(t===Qn)return e.RED;if(t===$n)return e.RED_INTEGER;if(t===te)return e.RG;if(t===ne)return e.RG_INTEGER;if(t===ee)return e.RGB_INTEGER;if(t===ie)return e.RGBA_INTEGER;if(t===re||t===oe||t===se||t===ae){if(null===(n=i.get("WEBGL_compressed_texture_s3tc")))return null;if(t===re)return n.COMPRESSED_RGB_S3TC_DXT1_EXT;if(t===oe)return n.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(t===se)return n.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(t===ae)return n.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(t===ue||t===he||t===ce||t===fe){if(null===(n=i.get("WEBGL_compressed_texture_pvrtc")))return null;if(t===ue)return n.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(t===he)return n.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(t===ce)return n.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(t===fe)return n.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(t===le)return null!==(n=i.get("WEBGL_compressed_texture_etc1"))?n.COMPRESSED_RGB_ETC1_WEBGL:null;if((t===de||t===ve)&&null!==(n=i.get("WEBGL_compressed_texture_etc"))){if(t===de)return n.COMPRESSED_RGB8_ETC2;if(t===ve)return n.COMPRESSED_RGBA8_ETC2_EAC}return t===pe||t===me||t===ge||t===ye||t===be||t===we||t===_e||t===xe||t===Me||t===Se||t===Ee||t===Te||t===Le||t===Re||t===Ae||t===ke||t===Ce||t===je||t===Pe||t===De||t===Ie||t===Ne||t===Fe||t===Ue||t===Be||t===Ge||t===He||t===Ve?null!==(n=i.get("WEBGL_compressed_texture_astc"))?t:null:t===Oe?null!==(n=i.get("EXT_texture_compression_bptc"))?t:null:t===zn?r?e.UNSIGNED_INT_24_8:null!==(n=i.get("WEBGL_depth_texture"))?n.UNSIGNED_INT_24_8_WEBGL:null:void 0}}}function Ka(t){Y.call(this),this.cameras=t||[]}function Ja(){Z.call(this),this.type="Group"}function Qa(d,n){var e=this,v=null,i=1,p=null,r="local-floor",m=null,g=[],o=new Map,s=new Y;s.layers.enable(1),s.viewport=new Ci;var a=new Y;a.layers.enable(2),a.viewport=new Ci;var y=new Ka([s,a]);y.layers.enable(1),y.layers.enable(2);var u=null,h=null;function c(t){var n=o.get(t.inputSource);n&&(n.targetRay&&n.targetRay.dispatchEvent({type:t.type}),n.grip&&n.grip.dispatchEvent({type:t.type}))}function f(){o.forEach(function(t,n){t.targetRay&&(t.targetRay.dispatchEvent({type:"disconnected",data:n}),t.targetRay.visible=!1),t.grip&&(t.grip.dispatchEvent({type:"disconnected",data:n}),t.grip.visible=!1)}),o.clear(),d.setFramebuffer(null),d.setRenderTarget(d.getRenderTarget()),S.stop(),e.isPresenting=!1,e.dispatchEvent({type:"sessionend"})}function l(t){p=t,S.setContext(v),S.start(),e.isPresenting=!0,e.dispatchEvent({type:"sessionstart"})}function b(t){for(var n=v.inputSources,e=0;e<g.length;e++)o.set(n[e],g[e]);for(e=0;e<t.removed.length;e++){var i=t.removed[e];(r=o.get(i))&&(r.targetRay&&r.targetRay.dispatchEvent({type:"disconnected",data:i}),r.grip&&r.grip.dispatchEvent({type:"disconnected",data:i}),o.delete(i))}for(e=0;e<t.added.length;e++){var r,i=t.added[e];(r=o.get(i))&&(r.targetRay&&r.targetRay.dispatchEvent({type:"connected",data:i}),r.grip&&r.grip.dispatchEvent({type:"connected",data:i}))}}this.enabled=!1,this.isPresenting=!1,this.getController=function(t){var n=g[t];return void 0===n&&(g[t]=n={}),void 0===n.targetRay&&(n.targetRay=new Ja,n.targetRay.matrixAutoUpdate=!1,n.targetRay.visible=!1),n.targetRay},this.getControllerGrip=function(t){var n=g[t];return void 0===n&&(g[t]=n={}),void 0===n.grip&&(n.grip=new Ja,n.grip.matrixAutoUpdate=!1,n.grip.visible=!1),n.grip},this.setFramebufferScaleFactor=function(t){i=t,1==e.isPresenting&&console.warn("WebXRManager: Cannot change framebuffer scale while presenting VR content")},this.setReferenceSpaceType=function(t){r=t},this.getReferenceSpace=function(){return p},this.getSession=function(){return v},this.setSession=function(t){null!==(v=t)&&(v.addEventListener("select",c),v.addEventListener("selectstart",c),v.addEventListener("selectend",c),v.addEventListener("squeeze",c),v.addEventListener("squeezestart",c),v.addEventListener("squeezeend",c),v.addEventListener("end",f),t={antialias:(t=n.getContextAttributes()).antialias,alpha:t.alpha,depth:t.depth,stencil:t.stencil,framebufferScaleFactor:i},t=new XRWebGLLayer(v,n,t),v.updateRenderState({baseLayer:t}),v.requestReferenceSpace(r).then(l),v.addEventListener("inputsourceschange",b))};var w=new St,_=new St;function x(t,n){null===n?t.matrixWorld.copy(t.matrix):t.matrixWorld.multiplyMatrices(n.matrixWorld,t.matrix),t.matrixWorldInverse.getInverse(t.matrixWorld)}this.getCamera=function(t){y.near=a.near=s.near=t.near,y.far=a.far=s.far=t.far,u===y.near&&h===y.far||(v.updateRenderState({depthNear:y.near,depthFar:y.far}),u=y.near,h=y.far);var n=t.parent,e=y.cameras;x(y,n);for(var i=0;i<e.length;i++)x(e[i],n);t.matrixWorld.copy(y.matrixWorld);for(var r=t.children,i=0,o=r.length;i<o;i++)r[i].updateMatrixWorld(!0);return function(t,n,e){w.setFromMatrixPosition(n.matrixWorld),_.setFromMatrixPosition(e.matrixWorld);var i=w.distanceTo(_),r=n.projectionMatrix.elements,o=e.projectionMatrix.elements,s=r[14]/(r[10]-1),a=r[14]/(r[10]+1),u=(r[9]+1)/r[5],h=(r[9]-1)/r[5],c=(r[8]-1)/r[0],e=(o[8]+1)/o[0],r=s*c,o=s*e,c=(e=i/(e-c))*-c;n.matrixWorld.decompose(t.position,t.quaternion,t.scale),t.translateX(c),t.translateZ(e),t.matrixWorld.compose(t.position,t.quaternion,t.scale),t.matrixWorldInverse.getInverse(t.matrixWorld),s+=e,e=a+e,t.projectionMatrix.makePerspective(r-c,i-c+o,u*a/e*s,h*a/e*s,s,e)}(y,s,a),y};var M=null;var S=new Rr;S.setAnimationLoop(function(t,n){if(null!==(m=n.getViewerPose(p))){var e=m.views,i=v.renderState.baseLayer;d.setFramebuffer(i.framebuffer);for(var r=0;r<e.length;r++){var o=e[r],s=i.getViewport(o),a=y.cameras[r];a.matrix.fromArray(o.transform.matrix),a.projectionMatrix.fromArray(o.projectionMatrix),a.viewport.set(s.x,s.y,s.width,s.height),0===r&&y.matrix.copy(a.matrix)}}for(var u=v.inputSources,r=0;r<g.length;r++){var h=g[r],c=u[r],f=null,l=null;c&&(h.targetRay&&null!==(f=n.getPose(c.targetRaySpace,p))&&(h.targetRay.matrix.fromArray(f.transform.matrix),h.targetRay.matrix.decompose(h.targetRay.position,h.targetRay.rotation,h.targetRay.scale)),h.grip&&c.gripSpace&&null!==(l=n.getPose(c.gripSpace,p))&&(h.grip.matrix.fromArray(l.transform.matrix),h.grip.matrix.decompose(h.grip.position,h.grip.rotation,h.grip.scale))),h.targetRay&&(h.targetRay.visible=null!==f),h.grip&&(h.grip.visible=null!==l)}M&&M(t,n)}),this.setAnimationLoop=function(t){M=t},this.dispose=function(){}}function $a(t){var i=void 0!==(t=t||{}).canvas?t.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),n=void 0!==t.context?t.context:null,e=void 0!==t.alpha&&t.alpha,r=void 0===t.depth||t.depth,o=void 0===t.stencil||t.stencil,s=void 0!==t.antialias&&t.antialias,a=void 0===t.premultipliedAlpha||t.premultipliedAlpha,u=void 0!==t.preserveDrawingBuffer&&t.preserveDrawingBuffer,h=void 0!==t.powerPreference?t.powerPreference:"default",c=void 0!==t.failIfMajorPerformanceCaveat&&t.failIfMajorPerformanceCaveat,v=null,y=null;this.domElement=i,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.outputEncoding=qe,this.physicallyCorrectLights=!1,this.toneMapping=ln,this.toneMappingExposure=1,this.toneMappingWhitePoint=1,this.maxMorphTargets=8,this.maxMorphNormals=4;var w,_,x,M,p,b,S,E,f,m,l,d,g,T,L,R,O,A,k=this,C=!1,j=null,P=0,D=0,I=null,N=null,F=-1,U={geometry:null,program:null,wireframe:!1},B=null,G=null,H=new Ci,V=new Ci,z=null,W=i.width,X=i.height,Z=1,Y=null,q=null,K=new Ci(0,0,W,X),J=new Ci(0,0,W,X),Q=!1,$=new Tt,tt=new rs,nt=!1,et=!1,it=new Et,rt=new St;function ot(){return null===I?Z:1}try{var st={alpha:e,depth:r,stencil:o,antialias:s,premultipliedAlpha:a,preserveDrawingBuffer:u,powerPreference:h,failIfMajorPerformanceCaveat:c,xrCompatible:!1};if(i.addEventListener("webglcontextlost",ct,!1),i.addEventListener("webglcontextrestored",ft,!1),null===(w=n||i.getContext("webgl",st)||i.getContext("experimental-webgl",st)))throw null!==i.getContext("webgl")?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.");void 0===w.getShaderPrecisionFormat&&(w.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(t){throw console.error("THREE.WebGLRenderer: "+t.message),t}function at(){_=new os(w),!1===(x=new is(w,_,t)).isWebGL2&&(_.get("WEBGL_depth_texture"),_.get("OES_texture_float"),_.get("OES_texture_half_float"),_.get("OES_texture_half_float_linear"),_.get("OES_standard_derivatives"),_.get("OES_element_index_uint"),_.get("ANGLE_instanced_arrays")),_.get("OES_texture_float_linear"),A=new qa(w,_,x),(M=new Xa(w,_,x)).scissor(V.copy(J).multiplyScalar(Z).floor()),M.viewport(H.copy(K).multiplyScalar(Z).floor()),p=new us(w),b=new Ra,S=new Ya(w,_,M,b,x,A,p),E=new Or(w,x),f=new ss(w,E,p),m=new fs(w,f,E,p),L=new cs(w),l=new La(k,_,x),d=new Ca,g=new Fa,T=new ns(k,M,m,a),R=new es(w,_,p,x),O=new as(w,_,p,x),p.programs=l.programs,k.capabilities=x,k.extensions=_,k.properties=b,k.renderLists=d,k.state=M,k.info=p}at();var ut=new Qa(k,w);this.xr=ut;var ht=new za(k,m,x.maxTextureSize);function ct(t){t.preventDefault(),C=!0}function ft(){C=!1,at()}function lt(t){t=t.target;t.removeEventListener("dispose",lt),dt(t=t),b.remove(t)}function dt(t){var n=b.get(t).program;(t.program=void 0)!==n&&l.releaseProgram(n)}this.shadowMap=ht,this.getContext=function(){return w},this.getContextAttributes=function(){return w.getContextAttributes()},this.forceContextLoss=function(){var t=_.get("WEBGL_lose_context");t&&t.loseContext()},this.forceContextRestore=function(){var t=_.get("WEBGL_lose_context");t&&t.restoreContext()},this.getPixelRatio=function(){return Z},this.setPixelRatio=function(t){void 0!==t&&(Z=t,this.setSize(W,X,!1))},this.getSize=function(t){return void 0===t&&(console.warn("WebGLRenderer: .getsize() now requires a Vector2 as an argument"),t=new fi),t.set(W,X)},this.setSize=function(t,n,e){ut.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(W=t,X=n,i.width=Math.floor(t*Z),i.height=Math.floor(n*Z),!1!==e&&(i.style.width=t+"px",i.style.height=n+"px"),this.setViewport(0,0,t,n))},this.getDrawingBufferSize=function(t){return void 0===t&&(console.warn("WebGLRenderer: .getdrawingBufferSize() now requires a Vector2 as an argument"),t=new fi),t.set(W*Z,X*Z).floor()},this.setDrawingBufferSize=function(t,n,e){W=t,X=n,Z=e,i.width=Math.floor(t*e),i.height=Math.floor(n*e),this.setViewport(0,0,t,n)},this.getCurrentViewport=function(t){return void 0===t&&(console.warn("WebGLRenderer: .getCurrentViewport() now requires a Vector4 as an argument"),t=new Ci),t.copy(H)},this.getViewport=function(t){return t.copy(K)},this.setViewport=function(t,n,e,i){t.isVector4?K.set(t.x,t.y,t.z,t.w):K.set(t,n,e,i),M.viewport(H.copy(K).multiplyScalar(Z).floor())},this.getScissor=function(t){return t.copy(J)},this.setScissor=function(t,n,e,i){t.isVector4?J.set(t.x,t.y,t.z,t.w):J.set(t,n,e,i),M.scissor(V.copy(J).multiplyScalar(Z).floor())},this.getScissorTest=function(){return Q},this.setScissorTest=function(t){M.setScissorTest(Q=t)},this.setOpaqueSort=function(t){Y=t},this.setTransparentSort=function(t){q=t},this.getClearColor=function(){return T.getClearColor()},this.setClearColor=function(){T.setClearColor.apply(T,arguments)},this.getClearAlpha=function(){return T.getClearAlpha()},this.setClearAlpha=function(){T.setClearAlpha.apply(T,arguments)},this.clear=function(t,n,e){var i=0;void 0!==t&&!t||(i|=w.COLOR_BUFFER_BIT),void 0!==n&&!n||(i|=w.DEPTH_BUFFER_BIT),void 0!==e&&!e||(i|=w.STENCIL_BUFFER_BIT),w.clear(i)},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(){i.removeEventListener("webglcontextlost",ct,!1),i.removeEventListener("webglcontextrestored",ft,!1),d.dispose(),g.dispose(),b.dispose(),m.dispose(),ut.dispose(),mt.stop(),this.forceContextLoss()},this.renderBufferImmediate=function(t,n){M.initAttributes();var e=b.get(t);t.hasPositions&&!e.position&&(e.position=w.createBuffer()),t.hasNormals&&!e.normal&&(e.normal=w.createBuffer()),t.hasUvs&&!e.uv&&(e.uv=w.createBuffer()),t.hasColors&&!e.color&&(e.color=w.createBuffer());n=n.getAttributes();t.hasPositions&&(w.bindBuffer(w.ARRAY_BUFFER,e.position),w.bufferData(w.ARRAY_BUFFER,t.positionArray,w.DYNAMIC_DRAW),M.enableAttribute(n.position),w.vertexAttribPointer(n.position,3,w.FLOAT,!1,0,0)),t.hasNormals&&(w.bindBuffer(w.ARRAY_BUFFER,e.normal),w.bufferData(w.ARRAY_BUFFER,t.normalArray,w.DYNAMIC_DRAW),M.enableAttribute(n.normal),w.vertexAttribPointer(n.normal,3,w.FLOAT,!1,0,0)),t.hasUvs&&(w.bindBuffer(w.ARRAY_BUFFER,e.uv),w.bufferData(w.ARRAY_BUFFER,t.uvArray,w.DYNAMIC_DRAW),M.enableAttribute(n.uv),w.vertexAttribPointer(n.uv,2,w.FLOAT,!1,0,0)),t.hasColors&&(w.bindBuffer(w.ARRAY_BUFFER,e.color),w.bufferData(w.ARRAY_BUFFER,t.colorArray,w.DYNAMIC_DRAW),M.enableAttribute(n.color),w.vertexAttribPointer(n.color,3,w.FLOAT,!1,0,0)),M.disableUnusedAttributes(),w.drawArrays(w.TRIANGLES,0,t.count),t.count=0};var vt=new Lr;this.renderBufferDirect=function(t,n,e,i,r,o){null===n&&(n=vt);var s=r.isMesh&&r.matrixWorld.determinant()<0,a=wt(t,n,i,r);M.setMaterial(i,s);var u=!1;U.geometry===e.id&&U.program===a.id&&U.wireframe===(!0===i.wireframe)||(U.geometry=e.id,U.program=a.id,U.wireframe=!0===i.wireframe,u=!0),(i.morphTargets||i.morphNormals)&&(L.update(r,e,i,a),u=!0);var h=e.index,t=e.attributes.position;if(null===h){if(void 0===t||0===t.count)return}else if(0===h.count)return;n=1;!0===i.wireframe&&(h=f.getWireframeAttribute(e),n=2);s=R;null!==h&&(c=E.get(h),(s=O).setIndex(c)),u&&(function(t,n,e,i){if(!1===x.isWebGL2&&(t.isInstancedMesh||n.isInstancedBufferGeometry)&&null===_.get("ANGLE_instanced_arrays"))return;M.initAttributes();var r,o=n.attributes,s=i.getAttributes(),a=e.defaultAttributeValues;for(r in s){var u=s[r];if(0<=u){var h=o[r];if(void 0!==h){var c,f,l,d,v,p,m,g=h.normalized,y=h.itemSize;void 0!==(c=E.get(h))&&(f=c.buffer,l=c.type,d=c.bytesPerElement,h.isInterleavedBufferAttribute?(v=h.data,p=v.stride,m=h.offset,v&&v.isInstancedInterleavedBuffer?(M.enableAttributeAndDivisor(u,v.meshPerAttribute),void 0===n.maxInstancedCount&&(n.maxInstancedCount=v.meshPerAttribute*v.count)):M.enableAttribute(u),w.bindBuffer(w.ARRAY_BUFFER,f),w.vertexAttribPointer(u,y,l,g,p*d,m*d)):(h.isInstancedBufferAttribute?(M.enableAttributeAndDivisor(u,h.meshPerAttribute),void 0===n.maxInstancedCount&&(n.maxInstancedCount=h.meshPerAttribute*h.count)):M.enableAttribute(u),w.bindBuffer(w.ARRAY_BUFFER,f),w.vertexAttribPointer(u,y,l,g,0,0)))}else if("instanceMatrix"===r)void 0!==(c=E.get(t.instanceMatrix))&&(f=c.buffer,l=c.type,M.enableAttributeAndDivisor(u+0,1),M.enableAttributeAndDivisor(u+1,1),M.enableAttributeAndDivisor(u+2,1),M.enableAttributeAndDivisor(u+3,1),w.bindBuffer(w.ARRAY_BUFFER,f),w.vertexAttribPointer(u+0,4,l,!1,64,0),w.vertexAttribPointer(u+1,4,l,!1,64,16),w.vertexAttribPointer(u+2,4,l,!1,64,32),w.vertexAttribPointer(u+3,4,l,!1,64,48));else if(void 0!==a){var b=a[r];if(void 0!==b)switch(b.length){case 2:w.vertexAttrib2fv(u,b);break;case 3:w.vertexAttrib3fv(u,b);break;case 4:w.vertexAttrib4fv(u,b);break;default:w.vertexAttrib1fv(u,b)}}}}M.disableUnusedAttributes()}(r,e,i,a),null!==h&&w.bindBuffer(w.ELEMENT_ARRAY_BUFFER,c.buffer));var a=(null!==h?h:t).count,c=e.drawRange.start*n,h=e.drawRange.count*n,t=null!==o?o.start*n:0,o=null!==o?o.count*n:1/0,n=Math.max(c,t),o=Math.min(a,c+h,t+o)-1,o=Math.max(0,o-n+1);0!==o&&(r.isMesh?!0===i.wireframe?(M.setLineWidth(i.wireframeLinewidth*ot()),s.setMode(w.LINES)):s.setMode(w.TRIANGLES):r.isLine?(i=i.linewidth,M.setLineWidth((i=void 0===i?1:i)*ot()),r.isLineSegments?s.setMode(w.LINES):r.isLineLoop?s.setMode(w.LINE_LOOP):s.setMode(w.LINE_STRIP)):r.isPoints?s.setMode(w.POINTS):r.isSprite&&s.setMode(w.TRIANGLES),r.isInstancedMesh?s.renderInstances(e,n,o,r.count):e.isInstancedBufferGeometry?s.renderInstances(e,n,o,e.maxInstancedCount):s.render(n,o))},this.compile=function(e,t){(y=g.get(e,t)).init(),e.traverse(function(t){t.isLight&&(y.pushLight(t),t.castShadow&&y.pushShadow(t))}),y.setupLights(t);var i={};e.traverse(function(t){if(t.material)if(Array.isArray(t.material))for(var n=0;n<t.material.length;n++)t.material[n].uuid in i==!1&&(bt(t.material[n],e,t),i[t.material[n].uuid]=!0);else t.material.uuid in i==!1&&(bt(t.material,e,t),i[t.material.uuid]=!0)})};var pt=null;var mt=new Rr;function gt(t,n,e,i){for(var r=0,o=t.length;r<o;r++){var s=t[r],a=s.object,u=s.geometry,h=void 0===i?s.material:i,c=s.group;if(e.isArrayCamera)for(var f=(G=e).cameras,l=0,d=f.length;l<d;l++){var v=f[l];a.layers.test(v.layers)&&(M.viewport(H.copy(v.viewport)),y.setupLights(v),yt(a,n,v,u,h,c))}else G=null,yt(a,n,e,u,h,c)}}function yt(t,n,e,i,r,o){var s,a;t.onBeforeRender(k,n,e,i,r,o),y=g.get(n,G||e),t.modelViewMatrix.multiplyMatrices(e.matrixWorldInverse,t.matrixWorld),t.normalMatrix.getNormalMatrix(t.modelViewMatrix),t.isImmediateRenderObject?(s=wt(e,n,r,t),M.setMaterial(r),U.geometry=null,U.program=null,U.wireframe=!1,a=s,t.render(function(t){k.renderBufferImmediate(t,a)})):k.renderBufferDirect(e,n,i,r,t,o),t.onAfterRender(k,n,e,i,r,o),y=g.get(n,G||e)}function bt(t,n,e){var i=b.get(t),r=y.state.lights,o=y.state.shadowsArray,s=r.state.version,a=l.getParameters(t,r.state,o,n,tt.numPlanes,tt.numIntersection,e),u=l.getProgramCacheKey(a),o=i.program,e=!0;if(void 0===o)t.addEventListener("dispose",lt);else if(o.cacheKey!==u)dt(t);else if(i.lightsStateVersion!==s)i.lightsStateVersion=s,e=!1;else{if(void 0!==a.shaderID)return;e=!1}e&&(o=l.acquireProgram(a,u),i.program=o,i.uniforms=a.uniforms,i.environment=t.isMeshStandardMaterial?n.environment:null,i.outputEncoding=k.outputEncoding,t.program=o);var h=o.getAttributes();if(t.morphTargets)for(var c=t.numSupportedMorphTargets=0;c<k.maxMorphTargets;c++)0<=h["morphTarget"+c]&&t.numSupportedMorphTargets++;if(t.morphNormals)for(c=t.numSupportedMorphNormals=0;c<k.maxMorphNormals;c++)0<=h["morphNormal"+c]&&t.numSupportedMorphNormals++;o=i.uniforms;(t.isShaderMaterial||t.isRawShaderMaterial)&&!0!==t.clipping||(i.numClippingPlanes=tt.numPlanes,i.numIntersection=tt.numIntersection,o.clippingPlanes=tt.uniform),i.fog=n.fog,i.needsLights=(n=t).isMeshLambertMaterial||n.isMeshToonMaterial||n.isMeshPhongMaterial||n.isMeshStandardMaterial||n.isShadowMaterial||n.isShaderMaterial&&!0===n.lights,i.lightsStateVersion=s,i.needsLights&&(o.ambientLightColor.value=r.state.ambient,o.lightProbe.value=r.state.probe,o.directionalLights.value=r.state.directional,o.directionalLightShadows.value=r.state.directionalShadow,o.spotLights.value=r.state.spot,o.spotLightShadows.value=r.state.spotShadow,o.rectAreaLights.value=r.state.rectArea,o.pointLights.value=r.state.point,o.pointLightShadows.value=r.state.pointShadow,o.hemisphereLights.value=r.state.hemi,o.directionalShadowMap.value=r.state.directionalShadowMap,o.directionalShadowMatrix.value=r.state.directionalShadowMatrix,o.spotShadowMap.value=r.state.spotShadowMap,o.spotShadowMatrix.value=r.state.spotShadowMatrix,o.pointShadowMap.value=r.state.pointShadowMap,o.pointShadowMatrix.value=r.state.pointShadowMatrix);r=i.program.getUniforms(),o=ua.seqWithValue(r.seq,o);i.uniformsList=o}function wt(t,n,e,i){S.resetTextureUnits();var r=n.fog,o=e.isMeshStandardMaterial?n.environment:null,s=b.get(e),a=y.state.lights;nt&&(!et&&t===B||(g=t===B&&e.id===F,tt.setState(e.clippingPlanes,e.clipIntersection,e.clipShadows,t,s,g))),e.version===s.Be?(void 0===s.program||e.fog&&s.fog!==r||s.environment!==o||s.needsLights&&s.lightsStateVersion!==a.state.version||void 0!==s.numClippingPlanes&&(s.numClippingPlanes!==tt.numPlanes||s.numIntersection!==tt.numIntersection)||s.outputEncoding!==k.outputEncoding)&&bt(e,n,i):(bt(e,n,i),s.Be=e.version);var u,h,c,f,l,d=!1,v=!1,p=!1,m=s.program,g=m.getUniforms(),a=s.uniforms;return M.useProgram(m.program)&&(p=v=d=!0),e.id!==F&&(F=e.id,v=!0),!d&&B===t||(g.setValue(w,"projectionMatrix",t.projectionMatrix),x.logarithmicDepthBuffer&&g.setValue(w,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2)),B!==t&&(B=t,p=v=!0),!(e.isShaderMaterial||e.isMeshPhongMaterial||e.isMeshToonMaterial||e.isMeshStandardMaterial||e.envMap)||void 0!==(u=g.map.cameraPosition)&&u.setValue(w,rt.setFromMatrixPosition(t.matrixWorld)),(e.isMeshPhongMaterial||e.isMeshToonMaterial||e.isMeshLambertMaterial||e.isMeshBasicMaterial||e.isMeshStandardMaterial||e.isShaderMaterial)&&g.setValue(w,"isOrthographic",!0===t.isOrthographicCamera),(e.isMeshPhongMaterial||e.isMeshToonMaterial||e.isMeshLambertMaterial||e.isMeshBasicMaterial||e.isMeshStandardMaterial||e.isShaderMaterial||e.skinning)&&g.setValue(w,"viewMatrix",t.matrixWorldInverse)),e.skinning&&(g.setOptional(w,i,"bindMatrix"),g.setOptional(w,i,"bindMatrixInverse"),(n=i.skeleton)&&(d=n.bones,x.floatVertexTextures?(void 0===n.boneTexture&&(u=Math.sqrt(4*d.length),u=Mt.ceilPowerOfTwo(u),u=Math.max(u,4),(t=new Float32Array(u*u*4)).set(n.boneMatrices),d=new Er(t,u,u,Zn,Un),n.boneMatrices=t,n.boneTexture=d,n.boneTextureSize=u),g.setValue(w,"boneTexture",n.boneTexture,S),g.setValue(w,"boneTextureSize",n.boneTextureSize)):g.setOptional(w,n,"boneMatrices"))),!v&&s.receiveShadow===i.receiveShadow||(s.receiveShadow=i.receiveShadow,g.setValue(w,"receiveShadow",i.receiveShadow)),v&&(g.setValue(w,"toneMappingExposure",k.toneMappingExposure),g.setValue(w,"toneMappingWhitePoint",k.toneMappingWhitePoint),s.needsLights&&(v=p,(p=a).ambientLightColor.needsUpdate=v,p.lightProbe.needsUpdate=v,p.directionalLights.needsUpdate=v,p.directionalLightShadows.needsUpdate=v,p.pointLights.needsUpdate=v,p.pointLightShadows.needsUpdate=v,p.spotLights.needsUpdate=v,p.spotLightShadows.needsUpdate=v,p.rectAreaLights.needsUpdate=v,p.hemisphereLights.needsUpdate=v),r&&e.fog&&(l=r,(f=a).fogColor.value.copy(l.color),l.isFog?(f.fogNear.value=l.near,f.fogFar.value=l.far):l.isFogExp2&&(f.fogDensity.value=l.density)),e.isMeshBasicMaterial?_t(a,e):e.isMeshLambertMaterial?(_t(a,e),f=a,(l=e).emissiveMap&&(f.emissiveMap.value=l.emissiveMap)):e.isMeshToonMaterial?(_t(a,e),function(t,n){t.specular.value.copy(n.specular),t.shininess.value=Math.max(n.shininess,1e-4),n.gradientMap&&(t.gradientMap.value=n.gradientMap);n.emissiveMap&&(t.emissiveMap.value=n.emissiveMap);n.bumpMap&&(t.bumpMap.value=n.bumpMap,t.bumpScale.value=n.bumpScale,n.side===Ot&&(t.bumpScale.value*=-1));n.normalMap&&(t.normalMap.value=n.normalMap,t.normalScale.value.copy(n.normalScale),n.side===Ot&&t.normalScale.value.negate());n.displacementMap&&(t.displacementMap.value=n.displacementMap,t.displacementScale.value=n.displacementScale,t.displacementBias.value=n.displacementBias)}(a,e)):e.isMeshPhongMaterial?(_t(a,e),function(t,n){t.specular.value.copy(n.specular),t.shininess.value=Math.max(n.shininess,1e-4),n.emissiveMap&&(t.emissiveMap.value=n.emissiveMap);n.bumpMap&&(t.bumpMap.value=n.bumpMap,t.bumpScale.value=n.bumpScale,n.side===Ot&&(t.bumpScale.value*=-1));n.normalMap&&(t.normalMap.value=n.normalMap,t.normalScale.value.copy(n.normalScale),n.side===Ot&&t.normalScale.value.negate());n.displacementMap&&(t.displacementMap.value=n.displacementMap,t.displacementScale.value=n.displacementScale,t.displacementBias.value=n.displacementBias)}(a,e)):e.isMeshStandardMaterial?(_t(a,e,o),(e.isMeshPhysicalMaterial?function(t,n,e){xt(t,n,e),t.reflectivity.value=n.reflectivity,t.clearcoat.value=n.clearcoat,t.clearcoatRoughness.value=n.clearcoatRoughness,n.sheen&&t.sheen.value.copy(n.sheen);n.clearcoatMap&&(t.clearcoatMap.value=n.clearcoatMap);n.clearcoatRoughnessMap&&(t.clearcoatRoughnessMap.value=n.clearcoatRoughnessMap);n.clearcoatNormalMap&&(t.clearcoatNormalScale.value.copy(n.clearcoatNormalScale),t.clearcoatNormalMap.value=n.clearcoatNormalMap,n.side===Ot&&t.clearcoatNormalScale.value.negate());t.transparency.value=n.transparency}:xt)(a,e,o)):e.isMeshMatcapMaterial?(_t(a,e),function(t,n){n.matcap&&(t.matcap.value=n.matcap);n.bumpMap&&(t.bumpMap.value=n.bumpMap,t.bumpScale.value=n.bumpScale,n.side===Ot&&(t.bumpScale.value*=-1));n.normalMap&&(t.normalMap.value=n.normalMap,t.normalScale.value.copy(n.normalScale),n.side===Ot&&t.normalScale.value.negate());n.displacementMap&&(t.displacementMap.value=n.displacementMap,t.displacementScale.value=n.displacementScale,t.displacementBias.value=n.displacementBias)}(a,e)):e.isMeshDepthMaterial?(_t(a,e),h=a,(c=e).displacementMap&&(h.displacementMap.value=c.displacementMap,h.displacementScale.value=c.displacementScale,h.displacementBias.value=c.displacementBias)):e.isMeshDistanceMaterial?(_t(a,e),function(t,n){n.displacementMap&&(t.displacementMap.value=n.displacementMap,t.displacementScale.value=n.displacementScale,t.displacementBias.value=n.displacementBias);t.referencePosition.value.copy(n.referencePosition),t.nearDistance.value=n.nearDistance,t.farDistance.value=n.farDistance}(a,e)):e.isMeshNormalMaterial?(_t(a,e),function(t,n){n.bumpMap&&(t.bumpMap.value=n.bumpMap,t.bumpScale.value=n.bumpScale,n.side===Ot&&(t.bumpScale.value*=-1));n.normalMap&&(t.normalMap.value=n.normalMap,t.normalScale.value.copy(n.normalScale),n.side===Ot&&t.normalScale.value.negate());n.displacementMap&&(t.displacementMap.value=n.displacementMap,t.displacementScale.value=n.displacementScale,t.displacementBias.value=n.displacementBias)}(a,e)):e.isLineBasicMaterial?(h=e,(c=a).diffuse.value.copy(h.color),c.opacity.value=h.opacity,e.isLineDashedMaterial&&(c=e,(h=a).dashSize.value=c.dashSize,h.totalSize.value=c.dashSize+c.gapSize,h.scale.value=c.scale)):e.isPointsMaterial?function(t,n){t.diffuse.value.copy(n.color),t.opacity.value=n.opacity,t.size.value=n.size*Z,t.scale.value=.5*X,n.map&&(t.map.value=n.map);n.alphaMap&&(t.alphaMap.value=n.alphaMap);var e;n.map?e=n.map:n.alphaMap&&(e=n.alphaMap);void 0!==e&&(!0===e.matrixAutoUpdate&&e.updateMatrix(),t.uvTransform.value.copy(e.matrix))}(a,e):e.isSpriteMaterial?function(t,n){t.diffuse.value.copy(n.color),t.opacity.value=n.opacity,t.rotation.value=n.rotation,n.map&&(t.map.value=n.map);n.alphaMap&&(t.alphaMap.value=n.alphaMap);var e;n.map?e=n.map:n.alphaMap&&(e=n.alphaMap);void 0!==e&&(!0===e.matrixAutoUpdate&&e.updateMatrix(),t.uvTransform.value.copy(e.matrix))}(a,e):e.isShadowMaterial&&(a.color.value.copy(e.color),a.opacity.value=e.opacity),void 0!==a.ltc_1&&(a.ltc_1.value=Tr.LTC_1),void 0!==a.ltc_2&&(a.ltc_2.value=Tr.LTC_2),ua.upload(w,s.uniformsList,a,S),e.isShaderMaterial&&(e.uniformsNeedUpdate=!1)),e.isShaderMaterial&&!0===e.uniformsNeedUpdate&&(ua.upload(w,s.uniformsList,a,S),e.uniformsNeedUpdate=!1),e.isSpriteMaterial&&g.setValue(w,"center",i.center),g.setValue(w,"modelViewMatrix",i.modelViewMatrix),g.setValue(w,"normalMatrix",i.normalMatrix),g.setValue(w,"modelMatrix",i.matrixWorld),m}function _t(t,n,e){t.opacity.value=n.opacity,n.color&&t.diffuse.value.copy(n.color),n.emissive&&t.emissive.value.copy(n.emissive).multiplyScalar(n.emissiveIntensity),n.map&&(t.map.value=n.map),n.alphaMap&&(t.alphaMap.value=n.alphaMap),n.specularMap&&(t.specularMap.value=n.specularMap);var i,r,e=n.envMap||e;e&&(t.envMap.value=e,t.flipEnvMap.value=e.isCubeTexture?-1:1,t.reflectivity.value=n.reflectivity,t.refractionRatio.value=n.refractionRatio,t.maxMipLevel.value=b.get(e).Ce),n.lightMap&&(t.lightMap.value=n.lightMap,t.lightMapIntensity.value=n.lightMapIntensity),n.aoMap&&(t.aoMap.value=n.aoMap,t.aoMapIntensity.value=n.aoMapIntensity),n.map?i=n.map:n.specularMap?i=n.specularMap:n.displacementMap?i=n.displacementMap:n.normalMap?i=n.normalMap:n.bumpMap?i=n.bumpMap:n.roughnessMap?i=n.roughnessMap:n.metalnessMap?i=n.metalnessMap:n.alphaMap?i=n.alphaMap:n.emissiveMap&&(i=n.emissiveMap),void 0!==i&&(!0===(i=i.isWebGLRenderTarget?i.texture:i).matrixAutoUpdate&&i.updateMatrix(),t.uvTransform.value.copy(i.matrix)),n.aoMap?r=n.aoMap:n.lightMap&&(r=n.lightMap),void 0!==r&&(!0===(r=r.isWebGLRenderTarget?r.texture:r).matrixAutoUpdate&&r.updateMatrix(),t.uv2Transform.value.copy(r.matrix))}function xt(t,n,e){t.roughness.value=n.roughness,t.metalness.value=n.metalness,n.roughnessMap&&(t.roughnessMap.value=n.roughnessMap),n.metalnessMap&&(t.metalnessMap.value=n.metalnessMap),n.emissiveMap&&(t.emissiveMap.value=n.emissiveMap),n.bumpMap&&(t.bumpMap.value=n.bumpMap,t.bumpScale.value=n.bumpScale,n.side===Ot&&(t.bumpScale.value*=-1)),n.normalMap&&(t.normalMap.value=n.normalMap,t.normalScale.value.copy(n.normalScale),n.side===Ot&&t.normalScale.value.negate()),n.displacementMap&&(t.displacementMap.value=n.displacementMap,t.displacementScale.value=n.displacementScale,t.displacementBias.value=n.displacementBias),(n.envMap||e)&&(t.envMapIntensity.value=n.envMapIntensity)}mt.setAnimationLoop(function(t){ut.isPresenting||pt&&pt(t)}),"undefined"!=typeof window&&mt.setContext(window),this.setAnimationLoop=function(t){pt=t,ut.setAnimationLoop(t),mt.start()},this.render=function(t,n){var e,i,r;void 0!==arguments[2]&&(console.warn("THREE.WebGLRenderer.render(): the renderTarget argument has been removed. Use .setRenderTarget() instead."),i=arguments[2]),void 0!==arguments[3]&&(console.warn("THREE.WebGLRenderer.render(): the forceClear argument has been removed. Use .clear() instead."),r=arguments[3]),n&&n.isCamera?C||(U.geometry=null,U.program=null,U.wireframe=!1,F=-1,!(B=null)===t.autoUpdate&&t.updateMatrixWorld(),null===n.parent&&n.updateMatrixWorld(),ut.enabled&&ut.isPresenting&&(n=ut.getCamera(n)),(y=g.get(t,n)).init(),t.onBeforeRender(k,t,n,i||I),it.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),$.setFromProjectionMatrix(it),et=this.localClippingEnabled,nt=tt.init(this.clippingPlanes,et,n),(v=d.get(t,n)).init(),function t(n,e,i,r){if(!1===n.visible)return;var o=n.layers.test(e.layers);if(o)if(n.isGroup)i=n.renderOrder;else if(n.isLOD)!0===n.autoUpdate&&n.update(e);else if(n.isLight)y.pushLight(n),n.castShadow&&y.pushShadow(n);else if(n.isSprite)n.frustumCulled&&!$.intersectsSprite(n)||(r&&rt.setFromMatrixPosition(n.matrixWorld).applyMatrix4(it),s=m.update(n),(a=n.material).visible&&v.push(n,s,a,i,rt.z,null));else if(n.isImmediateRenderObject)r&&rt.setFromMatrixPosition(n.matrixWorld).applyMatrix4(it),v.push(n,null,n.material,i,rt.z,null);else if((n.isMesh||n.isLine||n.isPoints)&&(n.isSkinnedMesh&&n.skeleton.frame!==p.render.frame&&(n.skeleton.update(),n.skeleton.frame=p.render.frame),!n.frustumCulled||$.intersectsObject(n))){r&&rt.setFromMatrixPosition(n.matrixWorld).applyMatrix4(it);var s=m.update(n),a=n.material;if(Array.isArray(a))for(var u=s.groups,h=0,c=u.length;h<c;h++){var f=u[h],l=a[f.materialIndex];l&&l.visible&&v.push(n,s,l,i,rt.z,f)}else a.visible&&v.push(n,s,a,i,rt.z,null)}var d=n.children;for(var h=0,c=d.length;h<c;h++)t(d[h],e,i,r)}(t,n,0,k.sortObjects),v.finish(),!0===k.sortObjects&&v.sort(Y,q),nt&&tt.beginShadows(),e=y.state.shadowsArray,ht.render(e,t,n),y.setupLights(n),nt&&tt.endShadows(),this.info.autoReset&&this.info.reset(),void 0!==i&&this.setRenderTarget(i),T.render(v,t,n,r),e=v.opaque,i=v.transparent,t.overrideMaterial?(r=t.overrideMaterial,e.length&>(e,t,n,r),i.length&>(i,t,n,r)):(e.length&>(e,t,n),i.length&>(i,t,n)),t.onAfterRender(k,t,n),null!==I&&(S.updateRenderTargetMipmap(I),S.updateMultisampleRenderTarget(I)),M.buffers.depth.setTest(!0),M.buffers.depth.setMask(!0),M.buffers.color.setMask(!0),M.setPolygonOffset(!1),y=v=null):console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")},this.setFramebuffer=function(t){j!==t&&null===I&&w.bindFramebuffer(w.FRAMEBUFFER,t),j=t},this.getActiveCubeFace=function(){return P},this.getActiveMipmapLevel=function(){return D},this.getRenderTarget=function(){return I},this.setRenderTarget=function(t,n,e){P=n,D=e,(I=t)&&void 0===b.get(t).De&&S.setupRenderTarget(t);var i,r=j,o=!1;z=t?(i=b.get(t).De,t.isWebGLCubeRenderTarget?(r=i[n||0],o=!0):r=t.isWebGLMultisampleRenderTarget?b.get(t).Ne:i,H.copy(t.viewport),V.copy(t.scissor),t.scissorTest):(H.copy(K).multiplyScalar(Z).floor(),V.copy(J).multiplyScalar(Z).floor(),Q),N!==r&&(w.bindFramebuffer(w.FRAMEBUFFER,r),N=r),M.viewport(H),M.scissor(V),M.setScissorTest(z),o&&(t=b.get(t.texture),w.framebufferTexture2D(w.FRAMEBUFFER,w.COLOR_ATTACHMENT0,w.TEXTURE_CUBE_MAP_POSITIVE_X+(n||0),t.Pe,e||0))},this.readRenderTargetPixels=function(t,n,e,i,r,o,s){if(t&&t.isWebGLRenderTarget){var a=b.get(t).De;if(a=t.isWebGLCubeRenderTarget&&void 0!==s?a[s]:a){s=!1;a!==N&&(w.bindFramebuffer(w.FRAMEBUFFER,a),s=!0);try{var u=t.texture,h=u.format,c=u.type;if(h!==Zn&&A.convert(h)!==w.getParameter(w.IMPLEMENTATION_COLOR_READ_FORMAT))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!(c===jn||A.convert(c)===w.getParameter(w.IMPLEMENTATION_COLOR_READ_TYPE)||c===Un&&(x.isWebGL2||_.get("OES_texture_float")||_.get("WEBGL_color_buffer_float"))||c===Bn&&(x.isWebGL2?_.get("EXT_color_buffer_float"):_.get("EXT_color_buffer_half_float"))))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");w.checkFramebufferStatus(w.FRAMEBUFFER)===w.FRAMEBUFFER_COMPLETE?0<=n&&n<=t.width-i&&0<=e&&e<=t.height-r&&w.readPixels(n,e,i,r,A.convert(h),A.convert(c),o):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{s&&w.bindFramebuffer(w.FRAMEBUFFER,N)}}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")},this.copyFramebufferToTexture=function(t,n,e){void 0===e&&(e=0);var i=Math.pow(2,-e),r=Math.floor(n.image.width*i),o=Math.floor(n.image.height*i),i=A.convert(n.format);S.setTexture2D(n,0),w.copyTexImage2D(w.TEXTURE_2D,e,i,t.x,t.y,r,o,0),M.unbindTexture()},this.copyTextureToTexture=function(t,n,e,i){var r=n.image.width,o=n.image.height,s=A.convert(e.format),a=A.convert(e.type);S.setTexture2D(e,0),n.isDataTexture?w.texSubImage2D(w.TEXTURE_2D,i||0,t.x,t.y,r,o,s,a,n.image.data):w.texSubImage2D(w.TEXTURE_2D,i||0,t.x,t.y,s,a,n.image),M.unbindTexture()},this.initTexture=function(t){S.setTexture2D(t,0),M.unbindTexture()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}Ka.prototype=Object.assign(Object.create(Y.prototype),{constructor:Ka,isArrayCamera:!0}),Ja.prototype=Object.assign(Object.create(Z.prototype),{constructor:Ja,isGroup:!0}),Object.assign(Qa.prototype,y.prototype);var tu=function(t,n,e){e=e||2;var i,r,o,s,a,u=n&&n.length,h=u?n[0]*e:t.length,c=nu(t,0,h,e,!0),f=[];if(!c||c.next===c.prev)return f;if(u&&(c=function(t,n,e,i){var r,o,s,a,u=[];for(r=0,o=n.length;r<o;r++)s=n[r]*i,a=r<o-1?n[r+1]*i:t.length,(a=nu(t,s,a,i,!1))===a.next&&(a.steiner=!0),u.push(function(t){var n=t,e=t;for(;(n.x<e.x||n.x===e.x&&n.y<e.y)&&(e=n),n=n.next,n!==t;);return e}(a));for(u.sort(ru),r=0;r<u.length;r++)!function(t,n){(n=function(t,n){var e,i=n,r=t.x,o=t.y,s=-1/0;do{if(o<=i.y&&o>=i.next.y&&i.next.y!==i.y){var a=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(a<=r&&s<a){if((s=a)===r){if(o===i.y)return i;if(o===i.next.y)return i.next}e=i.x<i.next.x?i:i.next}}}while(i=i.next,i!==n);if(!e)return null;if(r===s)return e;var u,h=e,c=e.x,f=e.y,l=1/0;i=e;for(;r>=i.x&&i.x>=c&&r!==i.x&&su(o<f?r:s,o,c,f,o<f?s:r,o,i.x,i.y)&&(u=Math.abs(o-i.y)/(r-i.x),lu(i,t)&&(u<l||u===l&&(i.x>e.x||i.x===e.x&&function(t,n){return au(t.prev,t,n.prev)<0&&au(n.next,t,t.next)<0}(e,i)))&&(e=i,l=u)),i=i.next,i!==h;);return e}(t,n))&&(t=du(n,t),eu(n,n.next),eu(t,t.next))}(u[r],e),e=eu(e,e.next);return e}(t,n,c,e)),t.length>80*e){for(var l=i=t[0],d=r=t[1],v=e;v<h;v+=e)(o=t[v])<l&&(l=o),(s=t[v+1])<d&&(d=s),i<o&&(i=o),r<s&&(r=s);a=0!==(a=Math.max(i-l,r-d))?1/a:0}return iu(c,f,e,l,d,a),f};function nu(t,n,e,i,r){var o,s;if(r===0<function(t,n,e,i){for(var r=0,o=n,s=e-i;o<e;o+=i)r+=(t[s]-t[o])*(t[o+1]+t[s+1]),s=o;return r}(t,n,e,i))for(o=n;o<e;o+=i)s=vu(o,t[o],t[o+1],s);else for(o=e-i;n<=o;o-=i)s=vu(o,t[o],t[o+1],s);return s&&uu(s,s.next)&&(pu(s),s=s.next),s}function eu(t,n){if(!t)return t;n=n||t;var e,i=t;do{if(e=!1,i.steiner||!uu(i,i.next)&&0!==au(i.prev,i,i.next))i=i.next;else{if(pu(i),(i=n=i.prev)===i.next)break;e=!0}}while(e||i!==n);return n}function iu(t,n,e,i,r,o,s){if(t){!s&&o&&function(t,n,e,i){var r=t;for(;null===r.z&&(r.z=ou(r.x,r.y,n,e,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next,r!==t;);r.prevZ.nextZ=null,r.prevZ=null,function(t){var n,e,i,r,o,s,a,u,h=1;do{for(e=t,o=t=null,s=0;e;){for(s++,i=e,n=a=0;n<h&&(a++,i=i.nextZ);n++);for(u=h;0<a||0<u&&i;)0!==a&&(0===u||!i||e.z<=i.z)?(e=(r=e).nextZ,a--):(i=(r=i).nextZ,u--),o?o.nextZ=r:t=r,r.prevZ=o,o=r;e=i}}while(o.nextZ=null,h*=2,1<s)}(r)}(t,i,r,o);for(var a,u,h=t;t.prev!==t.next;)if(a=t.prev,u=t.next,o?function(t,n,e,i){var r=t.prev,o=t,s=t.next;if(0<=au(r,o,s))return!1;var a=(r.x<o.x?r.x<s.x?r:s:o.x<s.x?o:s).x,u=(r.y<o.y?r.y<s.y?r:s:o.y<s.y?o:s).y,h=(r.x>o.x?r.x>s.x?r:s:o.x>s.x?o:s).x,c=(r.y>o.y?r.y>s.y?r:s:o.y>s.y?o:s).y,f=ou(a,u,n,e,i),l=ou(h,c,n,e,i),d=t.prevZ,v=t.nextZ;for(;d&&d.z>=f&&v&&v.z<=l;){if(d!==t.prev&&d!==t.next&&su(r.x,r.y,o.x,o.y,s.x,s.y,d.x,d.y)&&0<=au(d.prev,d,d.next))return!1;if(d=d.prevZ,v!==t.prev&&v!==t.next&&su(r.x,r.y,o.x,o.y,s.x,s.y,v.x,v.y)&&0<=au(v.prev,v,v.next))return!1;v=v.nextZ}for(;d&&d.z>=f;){if(d!==t.prev&&d!==t.next&&su(r.x,r.y,o.x,o.y,s.x,s.y,d.x,d.y)&&0<=au(d.prev,d,d.next))return!1;d=d.prevZ}for(;v&&v.z<=l;){if(v!==t.prev&&v!==t.next&&su(r.x,r.y,o.x,o.y,s.x,s.y,v.x,v.y)&&0<=au(v.prev,v,v.next))return!1;v=v.nextZ}return!0}(t,i,r,o):function(t){var n=t.prev,e=t,i=t.next;if(0<=au(n,e,i))return!1;var r=t.next.next;for(;r!==t.prev;){if(su(n.x,n.y,e.x,e.y,i.x,i.y,r.x,r.y)&&0<=au(r.prev,r,r.next))return!1;r=r.next}return!0}(t))n.push(a.i/e),n.push(t.i/e),n.push(u.i/e),pu(t),t=u.next,h=u.next;else if((t=u)===h){s?1===s?iu(t=function(t,n,e){var i=t;do{var r=i.prev,o=i.next.next}while(!uu(r,o)&&hu(r,i,i.next,o)&&lu(r,o)&&lu(o,r)&&(n.push(r.i/e),n.push(i.i/e),n.push(o.i/e),pu(i),pu(i.next),i=t=o),i=i.next,i!==t);return eu(i)}(eu(t),n,e),n,e,i,r,o,2):2===s&&function(t,n,e,i,r,o){var s=t;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&function(t,n){return t.next.i!==n.i&&t.prev.i!==n.i&&!function(t,n){var e=t;do{if(e.i!==t.i&&e.next.i!==t.i&&e.i!==n.i&&e.next.i!==n.i&&hu(e,e.next,t,n))return!0}while(e=e.next,e!==t);return!1}(t,n)&&(lu(t,n)&&lu(n,t)&&function(t,n){var e=t,i=!1,r=(t.x+n.x)/2,o=(t.y+n.y)/2;for(;e.y>o!=e.next.y>o&&e.next.y!==e.y&&r<(e.next.x-e.x)*(o-e.y)/(e.next.y-e.y)+e.x&&(i=!i),e=e.next,e!==t;);return i}(t,n)&&(au(t.prev,t,n.prev)||au(t,n.prev,n))||uu(t,n)&&0<au(t.prev,t,t.next)&&0<au(n.prev,n,n.next))}(s,a)){var u=du(s,a);return s=eu(s,s.next),u=eu(u,u.next),iu(s,n,e,i,r,o),iu(u,n,e,i,r,o)}a=a.next}}while(s=s.next,s!==t)}(t,n,e,i,r,o):iu(eu(t),n,e,i,r,o,1);break}}}function ru(t,n){return t.x-n.x}function ou(t,n,e,i,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-e)*r)|t<<8))|t<<4))|t<<2))|t<<1))|(n=1431655765&((n=858993459&((n=252645135&((n=16711935&((n=32767*(n-i)*r)|n<<8))|n<<4))|n<<2))|n<<1))<<1}function su(t,n,e,i,r,o,s,a){return 0<=(r-s)*(n-a)-(t-s)*(o-a)&&0<=(t-s)*(i-a)-(e-s)*(n-a)&&0<=(e-s)*(o-a)-(r-s)*(i-a)}function au(t,n,e){return(n.y-t.y)*(e.x-n.x)-(n.x-t.x)*(e.y-n.y)}function uu(t,n){return t.x===n.x&&t.y===n.y}function hu(t,n,e,i){var r=fu(au(t,n,e)),o=fu(au(t,n,i)),s=fu(au(e,i,t)),a=fu(au(e,i,n));return r!==o&&s!==a||(0===r&&cu(t,e,n)||(0===o&&cu(t,i,n)||(0===s&&cu(e,t,i)||!(0!==a||!cu(e,n,i)))))}function cu(t,n,e){return n.x<=Math.max(t.x,e.x)&&n.x>=Math.min(t.x,e.x)&&n.y<=Math.max(t.y,e.y)&&n.y>=Math.min(t.y,e.y)}function fu(t){return 0<t?1:t<0?-1:0}function lu(t,n){return au(t.prev,t,t.next)<0?0<=au(t,n,t.next)&&0<=au(t,t.prev,n):au(t,n,t.prev)<0||au(t,t.next,n)<0}function du(t,n){var e=new mu(t.i,t.x,t.y),i=new mu(n.i,n.x,n.y),r=t.next,o=n.prev;return(t.next=n).prev=t,(e.next=r).prev=e,(i.next=e).prev=i,(o.next=i).prev=o,i}function vu(t,n,e,i){e=new mu(t,n,e);return i?(e.next=i.next,(e.prev=i).next.prev=e,i.next=e):(e.prev=e).next=e,e}function pu(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function mu(t,n,e){this.i=t,this.x=n,this.y=e,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function gu(t){return function(t){if(Array.isArray(t))return yu(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,n){if(t){if("string"==typeof t)return yu(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(e="Object"===e&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?yu(t,n):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function yu(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}var bu={area:function(t){for(var n=t.length,e=0,i=n-1,r=0;r<n;i=r++)e+=t[i].x*t[r].y-t[r].x*t[i].y;return.5*e},isClockWise:function(t){return bu.area(t)<0},triangulateShape:function(t,n){var e=[],i=[],r=[];wu(t),_u(e,t);var o=t.length;n.forEach(wu);for(var s=0;s<n.length;s++)i.push(o),o+=n[s].length,_u(e,n[s]);for(var a=tu(e,i),u=0;u<a.length;u+=3)r.push(a.slice(u,u+3));return r},triangulate:function(t){(r=[]).push.apply(r,gu(t[0]));for(var n=[],e=1;e<t.length;e++){var i=[];i.push.apply(i,gu(t[e])),n.push(i)}if(!bu.isClockWise(r))for(var r=r.reverse(),o=0,s=n.length;o<s;o++){var a=n[o];bu.isClockWise(a)&&(n[o]=a.reverse())}return bu.triangulateShape(r,n)}};function wu(t){var n,e=t.length;2<e&&(n=t[e-1],e=t[0],n.x===e.x&&n.y===e.y)&&t.pop()}function _u(t,n){for(var e=0;e<n.length;e++)t.push(n[e].x),t.push(n[e].y)}var xu=1e-5,Mu=.001,Su=Math.PI/180,Eu=180/Math.PI,Tu=function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t)};Object.assign(Tu.prototype,{He:function(){return xu},Ve:function(){return Su},ze:function(){return Eu},We:function(t){return t<xu&&-xu<t},Xe:function(t){return xu<t},Ze:function(t){return t<-xu},Ye:function(t,n,e){e=(t.x-e.x)*(n.y-e.y)-(n.x-e.x)*(t.y-e.y);return Math.abs(e)<xu?0:e},distanceOfTwoPoints:function(t,n){return t&&n?Math.sqrt((t.x-n.x)*(t.x-n.x)+(t.y-n.y)*(t.y-n.y)):Number.NaN},distance:function(t,n){return Math.sqrt(Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2))},isPolygonContainPoint:function(t,n){for(var e=0,i=0;i<t.length;i++){var r=t[i].x,o=t[i].y,s=0,a=0,a=i<t.length-1?(s=t[i+1].x,t[i+1].y):(s=t[0].x,t[0].y);if(r===n.x&&o===n.y||s===n.x&&a===n.y)return!0;if(a!==o){var u=r+(n.y-o)*(s-r)/(a-o);if(u===n.x)return!0;r!==s?u<=Math.max(r,s)&&u>=Math.min(r,s)&&u>n.x&&u!==r&&(u===s&&0<(o-n.y)*(a-n.y)?e+=2:e++):u<=Math.max(r,s)&&u>=Math.min(r,s)&&u>n.x&&(u===s&&0<(o-n.y)*(a-n.y)?e+=2:e++)}}return 0<e%2},qe:function(t,n,e,i){return!(Math.max(t.x,n.x)<Math.min(e.x,i.x))&&(!(Math.max(t.y,n.y)<Math.min(e.y,i.y))&&(!(Math.max(e.x,i.x)<Math.min(t.x,n.x))&&!(Math.max(e.y,i.y)<Math.min(t.y,n.y))))},Ke:function(t,n,e,i){return!(Math.max(t.x,n.x)<Math.min(e.x,i.x))&&(!(Math.max(t.y,n.y)<Math.min(e.y,i.y))&&(!(Math.max(e.x,i.x)<Math.min(t.x,n.x))&&(!(Math.max(e.y,i.y)<Math.min(t.y,n.y))&&((0!==this.Ye(e,n,t)||0!==this.Ye(n,i,t))&&(!(this.Ye(e,n,t)*this.Ye(n,i,t)<0)&&!(this.Ye(t,i,e)*this.Ye(i,n,e)<0))))))},Je:function(t,n,e){return!(t.x<n.x)&&(!(t.y<n.y)&&(!(t.x>e.x)&&!(t.y>e.y)))},Qe:function(t,n,e){var i=Math.min(n.x,e.x),r=Math.max(n.x,e.x),o=Math.min(n.y,e.y),e=Math.max(n.y,e.y);return!(t.x<i||t.x>r||t.y<o||t.y>e)},$e:function(t,n,e){var i=Math.min(e.x,n.x),r=Math.max(e.x,n.x),o=Math.min(e.y,n.y),n=Math.max(e.y,n.y);return!(t.x<i||t.x>r||t.y<o||t.y>n)},ti:function(t,n,e){for(var i,r,o=!1,s=0;s<e;s++)i=n[s],r=n[(s+1)%e],(i.y<t.y&&r.y>=t.y||r.y<t.y&&i.y>=t.y)&&(i.x<=t.x||r.x<=t.x)&&i.x+(t.y-i.y)/(r.y-i.y)*(r.x-i.x)<t.x&&(o=!o);return o},ni:function(t,n,e){return(t.x-n.x)*(e.y-n.y)==(e.x-n.x)*(t.y-n.y)&&Math.min(n.x,e.x)<=t.x&&t.x<=Math.max(n.x,e.x)&&Math.min(n.y,e.y)<=t.y&&t.y<=Math.max(n.y,e.y)},ei:function(t,n){return Math.sqrt((t.x-n.x)*(t.x-n.x)+(t.y-n.y)*(t.y-n.y))},ii:function(t,n){return(t.x-n.x)*(t.x-n.x)+(t.y-n.y)*(t.y-n.y)},ri:function(t,n,e){var i=n.x,r=n.y,o=e.x,s=e.y,a=t.x,u=t.y,h=o-i,c=s-r,f=h*h+c*c,n=a-i,e=u-r,t=n*n+e*e;if(this.We(f))return l=this.We(t)?0:t;var l,f=Math.sqrt(f),h=h/f,c=c/f,e=h*n+c*e;return l=this.Xe(e)?this.Ze(e-f)?(h=a-(i+e*h))*h+(c=u-(r+e*c))*c:(o=a-o)*o+(s=u-s)*s:t,this.We(l)?0:l},oi:function(t,n,e,i){var r=n.x,o=n.y,s=e.x,a=e.y,u=t.x,h=t.y,c=s-r,f=a-o,l=Math.sqrt(c*c+f*f),d=u-r,v=h-o,t=Math.sqrt(d*d+v*v);if(this.We(l))return i.x=n.x,i.y=n.y,this.We(p=t)?0:p;var c=c/l,f=f/l,v=c*d+f*v,p=this.Xe(v)?this.Ze(v-l)?(c=u-(r=r+v*c),f=h-(v=o+v*f),f=Math.sqrt(c*c+f*f),i.x=r,i.y=v,f):(s=u-s,a=h-a,a=Math.sqrt(s*s+a*a),i.x=e.x,i.y=e.y,a):(i.x=n.x,i.y=n.y,t);return this.We(p)?0:p},si:function(t,n){for(var e=0,i=0,r=0,o=0;o<n;o++){var s=t[o],a=t[(o+1)%n],u=(s.x*a.y-s.y*a.x)/2;e+=u,i+=u*(s.x+a.x)/3,r+=u*(s.y+a.y)/3}return{x:i/=e,y:r/=e}},ai:function(t){for(var n=bu.triangulate([t]),e=0,i=0,r=0,o=0;o<n.length;o++){var s=t[n[o][0]],a=t[n[o][1]],u=t[n[o][2]],h=a.x-s.x,c=a.y-s.y,f=u.x-s.x,c=(h*(u.y-s.y)-f*c)/2;e+=c,i+=(s.x+a.x+u.x)/3*c,r+=(s.y+a.y+u.y)/3*c}return{x:i/e,y:r/e}},ui:function(t,n){if(n<3)return 0;for(var e=0,i=0;i<n;++i){var r=t[i],o=t[(i+1)%n];e+=r.x*o.y-r.y*o.x}return Math.abs(e/2)},ci:function(t,n,e,i,r){if(this.Ke(t,n,e,i)){var o=(i.x-e.x)*(t.y-n.y)-(n.x-t.x)*(e.y-i.y),s=(t.y-e.y)*(n.x-t.x)*(i.x-e.x)+e.x*(i.y-e.y)*(n.x-t.x)-t.x*(n.y-t.y)*(i.x-e.x);return r.x=s/o,o=(t.x-n.x)*(i.y-e.y)-(n.y-t.y)*(e.x-i.x),s=n.y*(t.x-n.x)*(i.y-e.y)+(i.x-n.x)*(i.y-e.y)*(t.y-n.y)-i.y*(e.x-i.x)*(n.y-t.y),r.y=s/o,1}return 0},fi:function(t,n,e,i,r){var o=Math.min(e.x,i.x),s=Math.max(e.x,i.x),a=Math.min(e.y,i.y),u=Math.max(e.y,i.y),h=t.x,c=t.y,f=e.x,l=e.y,d=i.x,v=i.y;if(90==n){if(t.x<o||t.x>s)return!1;if(Math.abs(s-o<Mu))return t.y>=l&&t.y<=v||t.y>=v&&t.y<=l?(r.x=t.x,r.y=t.y,!0):l<v&&t.x<l?(r.x=f,r.y=l,!0):v<l&&t.x<v&&(r.x=d,r.y=v,!0);var p=(v-l)/(d-f)*(h-f)+l;return r.y=p,r.x=h,p<c?!1:!!this.$e(r,e,i)}if(270==n){if(t.x<o||t.x>s)return!1;if(Math.abs(s-o<Mu))return t.y>=l&&t.y<=v||t.y>=v&&t.y<=l?(r.x=t.x,r.y=t.y,!0):l<v&&t.y>v?(r.x=d,r.y=v,!0):v<l&&t.y>l&&(r.x=f,r.y=l,!0);t=(v-l)/(d-f)*(h-f)+l;return r.y=t,r.x=h,c<t?!1:!!this.$e(r,e,i)}if(270!=n&&90!=n&&Math.abs(s-o<Mu)){s=o,o=Math.tan(n/180*Math.PI)*(s-h)+c;if(r.y=o,r.x=s,this.$e(r,e,i)){s=s-h,o=o-c;return 0<s/Math.sqrt(s*s+o*o)*Math.cos(n/180*Math.PI)}}if(Math.abs(u-a<=Mu)){u=a,a=1/Math.tan(n/180*Math.PI)*(u-c)+h;if(r.x=a,r.y=u,this.$e(r,e,i)){var a=a-h,m=u-c;return 0<a/Math.sqrt(a*a+m*m)*Math.cos(n/180*Math.PI)}return!1}m=Math.tan(n/180*Math.PI),d=(v-l)/(d-f),d=(l-c-(d*f-m*h))/(m-d),m=c+m*(d-h);if(r.x=d,r.y=m,this.$e(r,e,i)){h=d-h,c=m-c;return Math.abs(h)<=Mu&&Math.abs(c)<=Mu?!0:0<h/Math.sqrt(h*h+c*c)*Math.cos(n/180*Math.PI)}return!1},li:function(t,n){return Math.abs(t.x-n.x)<xu&&Math.abs(t.y-n.y)<xu},di:function(t,n,e,i){var r=t.x,o=t.y,s=n.x,a=n.y,u=e.x,h=e.y;if(this.li(t,n)||this.li(t,e))return i.x=r,i.y=o,!0;var c=Math.min(n.x,e.x),f=Math.max(n.x,e.x),l=Math.min(n.y,e.y),d=Math.max(n.y,e.y);if(Math.abs(s-u)<1e-5)return i.x=s,l<=(i.y=o)&&o<=d;if(Math.abs(a-h)<1e-5)return i.x=r,i.y=a,c<=r&&r<=f;f=-1/((h-a)/(u-s)),u=(h-a)/(u-s),u=(a-o-(u*s-f*r))/(f-u),r=o+f*(u-r);return i.x=u,i.y=r,!!this.$e(i,n,e)||!(!this.li(t,n)&&!this.li(t,e))},vi:function(t,n){return{x:t.y*n.z-t.z*n.y,y:t.z*n.x-t.x*n.z,z:t.x*n.y-t.y*n.x}},pi:function(t,n){return t.x*n.x+t.y*n.y+t.z*n.z},mi:function(t){return Math.sqrt(t.x*t.x+t.y*t.y+t.z*t.z)},gi:function(t,n){return t.x*n.x+t.y*n.y},yi:function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},bi:function(t,n){if(0==t.x&&0==t.y||0==n.x&&0==n.y)return 0;var e={x:t.x,y:t.y,z:0},i={x:n.x,y:n.y,z:0},e=this.vi(e,i),i=this.gi(t,n),n=Math.acos(i/(this.yi(t)*this.yi(n)));return 0<e.z?n/Math.PI*180:360-n/Math.PI*180},wi:function(t,n,e,i){for(var r=0;r<e.length;r++){var o=e[r],s=e[(r+1)%e.length];if(1==this.ci(t,n,o,s,i))return!0}return!1},_i:function(t,n,e,i,r){var o=Math.min(t.x,e.x,i.x),s=Math.max(t.x,e.x,i.x),a=Math.min(t.y,e.y,i.y),u=Math.max(t.y,e.y,i.y),u=Math.sqrt((s-o)*(s-o)+(u-a)*(u-a)),a=n/180*Math.PI,n=u*Math.cos(a)+t.x,a=u*Math.sin(a)+t.y;return 1==this.ci(t,{x:n,y:a},e,i,r)},xi:function(t){for(var n={x:null,y:null},e=0,i=0,r=0;r<t.length;r++)e+=t[r].x,i+=t[r].y;return n.x=e/t.length,n.y=i/t.length,n},Mi:function(t,n,e,i){var r=[],o=t.x-n,s=t.x+n,a=t.y-n,u=t.y+n,h=Math.min(e.x,i.x),c=Math.max(e.x,i.x),f=Math.min(e.y,i.y),l=Math.max(e.y,i.y);if(c<o||s<h||l<a||u<f)return r;o=i.x-e.x,s=i.y-e.y,a=t.x-e.x,u=t.y-e.y,i=o*o+s*s,t=(o*a+s*u)/i,n=t*t-(a*a+u*u-n*n)/i;if(n<0)return r;i=Math.sqrt(n),n=-t+i,t=-t-i,i={x:e.x-o*n,y:e.y-s*n},s={x:e.x-o*t,y:e.y-s*t};return n===t||(h<=i.x&&i.x<=c&&f<=i.y&&i.y<=l&&r.push(i),h<=s.x&&s.x<=c&&f<=s.y&&s.y<=l&&r.push(s)),r}});var Lu=new Tu,Ru={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 "},Ou=Ru;function Au(t){return(Au="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ku(t,n){return(ku=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Cu(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=ju(e);return t=i?(t=ju(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Au(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function ju(t){return(ju=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Pu=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&ku(t,n)}(e,wo);var n=Cu(e);function e(t){return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,e),(t=n.call(this,t)).uniforms.offset={value:new fi},t.uniforms.rotation={value:0},t.uniforms.scale={value:new fi(1,1)},t.depthTest=!1,t.vertexShader=Ou.vert,t.fragmentShader=Ou.frag,t}return e}();function Du(t,n){this.array=t,this.stride=n,this.count=void 0!==t?t.length/n:0,this.usage=hi,this.updateRange={offset:0,count:-1},this.version=0}Object.defineProperty(Du.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(Du.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setUsage:function(t){return this.usage=t,this},copy:function(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this},copyAt:function(t,n,e){t*=this.stride,e*=n.stride;for(var i=0,r=this.stride;i<r;i++)this.array[t+i]=n.array[e+i];return this},set:function(t,n){return this.array.set(t,n=void 0===n?0:n),this},clone:function(){return(new this.constructor).copy(this)},onUpload:function(t){return this.onUploadCallback=t,this}});var Iu=new St;function Nu(t,n,e,i){this.data=t,this.itemSize=n,this.offset=e,this.normalized=!0===i}function Fu(t){return(Fu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Uu(t,n){return(Uu=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Bu(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Gu(e);return t=i?(t=Gu(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Fu(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function Gu(t){return(Gu=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}Object.defineProperties(Nu.prototype,{count:{get:function(){return this.data.count}},array:{get:function(){return this.data.array}}}),Object.assign(Nu.prototype,{isInterleavedBufferAttribute:!0,applyMatrix4:function(t){for(var n=0,e=this.data.count;n<e;n++)Iu.x=this.getX(n),Iu.y=this.getY(n),Iu.z=this.getZ(n),Iu.applyMatrix4(t),this.setXYZ(n,Iu.x,Iu.y,Iu.z);return this},setX:function(t,n){return this.data.array[t*this.data.stride+this.offset]=n,this},setY:function(t,n){return this.data.array[t*this.data.stride+this.offset+1]=n,this},setZ:function(t,n){return this.data.array[t*this.data.stride+this.offset+2]=n,this},setW:function(t,n){return this.data.array[t*this.data.stride+this.offset+3]=n,this},getX:function(t){return this.data.array[t*this.data.stride+this.offset]},getY:function(t){return this.data.array[t*this.data.stride+this.offset+1]},getZ:function(t){return this.data.array[t*this.data.stride+this.offset+2]},getW:function(t){return this.data.array[t*this.data.stride+this.offset+3]},setXY:function(t,n,e){return t=t*this.data.stride+this.offset,this.data.array[t+0]=n,this.data.array[t+1]=e,this},setXYZ:function(t,n,e,i){return t=t*this.data.stride+this.offset,this.data.array[t+0]=n,this.data.array[t+1]=e,this.data.array[t+2]=i,this},setXYZW:function(t,n,e,i,r){return t=t*this.data.stride+this.offset,this.data.array[t+0]=n,this.data.array[t+1]=e,this.data.array[t+2]=i,this.data.array[t+3]=r,this}});var Hu=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Uu(t,n)}(i,eo);var e=Bu(i);function i(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,i);var t=e.call(this),n=new Du(new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),5);return t.setIndex([0,1,2,0,2,3]),t.setAttribute("position",new Nu(n,3,0,!1)),t.setAttribute("uv",new Nu(n,2,3,!1)),t}return i}();function Vu(t,n,e,i,r,o,s,a,u){Sr.call(this,t,n,e,i,r,o,s,a,u),this.needsUpdate=!0}function zu(t,n,e,i,r,o){var s=(t+e)/2,a=(n+i)/2,u=((t-e)*(t-e)+(n-i)*(n-i))/4,h=Math.sqrt(u),c=h*(h/Math.sqrt(r*r-u)),f=Math.PI/2,l=(e-t)/(n-i),h=(t-e)/(n-i),r=Math.sqrt(1+l*l),u=Math.sqrt(1+h*h),r={x:s+c*(1/r),y:a+c*(l/r),theta:f},f={x:s+c*(-1/u),y:a+c*(h/u),theta:f};return 0<(e-t)*(r.y-n)-(i-n)*(r.x-t)?0===o?r:f:0===o?f:r}function Wu(t,n,e,i){for(var r=0;r<t.length;r++)switch(t[r]){case"m":n.moveTo(i.x+parseFloat(t[r+1]),i.y+parseFloat(t[r+2])),e.x=i.x+parseFloat(t[r+1]),e.y=i.y+parseFloat(t[r+2]),i.x=e.x,i.y=e.y,r+=2;break;case"M":n.moveTo(parseFloat(t[r+1]),parseFloat(t[r+2])),e.x=parseFloat(t[r+1]),e.y=parseFloat(t[r+2]),i.x=e.x,i.y=e.y,r+=2;break;case"l":n.lineTo(e.x+parseFloat(t[r+1]),e.y+parseFloat(t[r+2])),e.x=e.x+parseFloat(t[r+1]),e.y=e.y+parseFloat(t[r+2]),r+=2;break;case"L":n.lineTo(parseFloat(t[r+1]),parseFloat(t[r+2])),e.x=parseFloat(t[r+1]),e.y=parseFloat(t[r+2]),r+=2;break;case"A":var o=parseFloat(t[r+1]),s=parseFloat(t[r+2]),a=(parseFloat(t[r+3]),Math.PI,parseFloat(t[r+4]),parseFloat(t[r+5])),u=e.x,h=e.y,c=parseFloat(t[r+6]),f=parseFloat(t[r+7]);o===s&&(l=zu(u,h,c,f,o,a),n.arcTo(l.x,l.y,c,f,l.theta),e.x=c,e.y=f),r+=7;break;case"a":var l,o=parseFloat(t[r+1]),s=parseFloat(t[r+2]),a=(parseFloat(t[r+3]),Math.PI,parseFloat(t[r+4]),parseFloat(t[r+5])),u=e.x,h=e.y,c=u+parseFloat(t[r+6]),f=h+parseFloat(t[r+7]);o===s&&(l=zu(u,h,c,f,o,a),n.arcTo(l.x,l.y,c,f,l.theta),e.x=c,e.y=f),r+=7;break;case"h":n.lineTo(e.x+parseFloat(t[r+1]),e.y),e.x=e.x+parseFloat(t[r+1]),r+=1;break;case"H":n.lineTo(parseFloat(t[r+1]),e.y),e.x=parseFloat(t[r+1]),r+=1;break;case"z":case"Z":n.lineTo(i.x,i.y)}}Vu.prototype=Object.create(Sr.prototype);var Xu=["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"],Zu=["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"],Yu=["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"],qu=["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"],Ku=["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"],Ju=["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"],Qu=["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"];var $u={Si:(Vu.prototype.constructor=Vu).prototype.isCanvasTexture=!0};function th(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var nh=function(t){var n=function(){var t=document.createElement("canvas"),n=t.getContext("2d");t.width=500,t.height=120,t.style.width="500px",t.style.height="120px";var e={x:0,y:0},i={x:0,y:0};n.transform(5,0,0,5,10,10);var r=n.createLinearGradient(5.9,15.07,5.9,0);return r.addColorStop(0,"#232323"),r.addColorStop(1,"#585858"),n.fillStyle=r,n.beginPath(),Wu(Xu,n,i,e),n.closePath(),n.fill(),n.beginPath(),Wu(Zu,n,i,e),n.closePath(),n.fill(),n.beginPath(),Wu(Yu,n,i,e),n.closePath(),n.fill(),n.beginPath(),Wu(qu,n,i,e),n.closePath(),n.fill(),(r=n.createLinearGradient(57.68,15.07,57.68,0)).addColorStop(0,"#77bf00"),r.addColorStop(1,"#addc0c"),n.fillStyle=r,n.beginPath(),Wu(Ku,n,i,e),n.closePath(),n.fill(),n.beginPath(),Wu(Ju,n,i,e),n.closePath(),n.fill(),n.beginPath(),Wu(Qu,n,i,e),n.closePath(),n.fill(),new Vu(t)}(),e=new fi(.4,.096),i=new Pu,r=-1*(.5*e.x/t-1),t=-1*(1-.5*e.y);return n.minFilter=An,n.generateMipmaps=!1,i.transparent=!0,i.depthTest=!1,i.uniforms={scale:{value:e},offset:{value:new fi(r,t)},mmap:{value:n}},i.needsUpdate=!0,new Ko(new Hu,i)},eh=function(){function i(t,n,e){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,i),this.W=t,this.Pt=n,this.Et=e,this.renderer=this.Ei(n.container,n.logarithmicDepthBuffer),this.Te=new Map,this.Ti=JSON.parse(JSON.stringify(n.renderOrder)),this.Li=0,this.Ri=!1,this.Oi=null,this.Ai=$u.Si,this.Ai&&(this.Oi=nh(this.renderer.domElement.clientWidth/this.renderer.domElement.clientHeight),this.Oi.frustumCulled=!1,this.xx45f6=this.Oi),this.ki=!1,this.Ci=!1,this.B=this.renderer.domElement.clientWidth,this.ji=this.renderer.domElement.clientHeight,this.type="basic",this.st=!0,this.Le=void 0,this.Pi=[],this.Di()}var t,n,e;return t=i,(n=[{key:"setTileLayScene",value:function(t){this.Le=t}},{key:"getTileLayScene",value:function(){return this.Le}},{key:"set3DTilesLayerSceneArr",value:function(t){this.Pi.push(t)}},{key:"get3DTilesLayerSceneArr",value:function(){return this.Pi}},{key:"needLogo",get:function(){return this.Ai}},{key:"render",value:function(){var i=this;if(this.renderer){this.renderer.clear(),this.Le&&this.renderer.render(this.Le,this.W.jt);for(var t=0;t<this.Pi.length;t++)this.renderer.render(this.Pi[t],this.W.jt);this.Te.forEach(function(t){return i.renderer.render(t,i.W.jt)});var r={min:1/0,max:-1/0};this.W.Ii.K.forEach(function(t){var n=[];t.Ni.forEach(function(t){t.isCross&&(n.push(t),r.min>t.levelRange[0]&&(r.min=t.levelRange[0]),r.max<t.levelRange[1]&&(r.max=t.levelRange[1]))}),n.forEach(function(t){i.renderer.render(t.line,i.W.jt)})});var o=this.Ti.indexOf(Ii.LINE_MARKER);this.Te.forEach(function(t,n){var e=n.split("_"),n=e[1],e=e[2];+n>=r.min&&+n<=r.max&&(e=i.Ti.indexOf(fengmap.FMType.LAYER_NODE_TYPE.get(+e)),o<e&&i.renderer.render(t,i.W.jt))}),this.W.Ii&&this.renderer.render(this.W.Ii.Fi,this.W.jt),this.Ai&&this.Oi&&this.renderer.render(this.Oi,this.W.jt)}}},{key:"resize",value:function(){this.renderer&&(5<Math.abs(this.renderer.domElement.parentElement.clientHeight-this.ji)||5<Math.abs(this.renderer.domElement.parentElement.clientWidth-this.B))&&(this.Ui(this.renderer.domElement.parentElement.clientWidth,this.renderer.domElement.parentElement.clientHeight),this.B=this.renderer.domElement.clientWidth,this.ji=this.renderer.domElement.clientHeight,this.W.It.Dt({type:"resize"}))}},{key:"getRenderList",value:function(){return this.Te}},{key:"parent",get:function(){return this.W}},{key:"getWebGLRenderer",value:function(){return $a}}])&&th(t.prototype,n),e&&th(t,e),i}();Object.assign(eh.prototype,{Bi:function(){for(var t in this.W=null,this.Pt=null,this.Et=null,this)this[""+t]=null,delete this[""+t]},vt:function(){this.st=!1,this.Te.clear()},Ei:function(t,n){n=new $a({antialias:!0,alpha:!0,logarithmicDepthBuffer:n});return n.setPixelRatio(window.devicePixelRatio),n.setSize(t.clientWidth,t.clientHeight),n.autoClear=!1,n.domElement.style.position="absolute",n.domElement.style.top=0,n.domElement.style.zIndex=0,t.appendChild(n.domElement),n},Gi:function(t){this.renderer=t},Hi:function(t){t="3D"===t?this.W.ln:this.W.an;return t.updateMatrixWorld(!0),(new Tt).setFromProjectionMatrix((new Et).multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse))},Vi:function(t){for(var n=[],e=[],i=0;i<t.length;i++){var r=this.Ti.indexOf(t[i]);-1!==r&&(n.push(r),e.push(t[i]))}n.sort(function(t,n){return t-n});for(var o=0;o<n.length;o++)this.Ti[n[o]]=e[o];this.Ln()},zi:function(t){this.Ti=t,this.Ln()},Wi:function(t,n){var e=1,i=this.renderer.domElement.clientHeight,i=this.W.jt.isPerspectiveCamera?n?n/(i/(2*Math.tan(this.W.ln.fov*pi.DEG2RAD/2))):t.mapNode.Xi/(i/(2*Math.tan(this.W.ln.fov*pi.DEG2RAD/2))):n?n*Math.abs(this.W.jt.top-this.W.jt.bottom)/this.W.jt.zoom/i:t.mapNode.Xi*Math.abs(this.W.jt.top-this.W.jt.bottom)/this.W.jt.zoom/i;t.material.userData.scaleRatio&&(e=t.material.userData.scaleRatio),t.scale.set(i,i/e,i)},hn:function(){var r=this;this.Te.forEach(function(t){switch(t.userData.type){case"label":for(var n=0;n<t.children.length;n++)t.children[n].mapNode.Zi(r.W.Zt);break;case"facility":for(var e=0;e<t.children.length;e++)r.Wi(t.children[e]);break;default:for(var i=0;i<t.children.length;i++)!t.children[i].mapNode||t.children[i].mapNode.type!==fengmap.FMType.IMAGE_MARKER&&t.children[i].mapNode.type!==fengmap.FMType.LOCATION_MARKER||t.children[i].mapNode.Yi()}})},Ui:function(t,n){var e=this.W.ln,i=this.W.an,r=new fi(.4,.096),o=-1*(.5*r.x/(t/n)-1),s=-1*(1-.5*r.y);e.aspect=t/n,e.updateProjectionMatrix(),i.left=-t/2,i.right=t/2,i.top=n/2,i.bottom=-n/2,i.updateProjectionMatrix(),this.Oi&&(this.Oi.material.uniforms.scale={value:r},this.Oi.material.uniforms.offset={value:new fi(o,s)}),this.renderer.setSize(t,n),this.hn(),this.W.enableUpdateRender()},qi:function(t,n){t.updateMatrixWorld(!0);var e,i=this.W.jt,r=(new St).setFromMatrixPosition(t.matrixWorld).applyMatrix4(i.matrixWorldInverse).applyMatrix4(i.projectionMatrix),o=t.mapNode.Xi;return n?(e="string"==typeof t.mapNode.text?t.mapNode.type===fengmap.FMType.LABEL?(o=t.material.map.image.height/2/1.2,t.material.map.image.width/2/1.2):(o*=t.mapNode.text.split("%rn%").length)/t.material.userData.scaleRatio:(o*=t.mapNode.text.length)/t.material.userData.scaleRatio,void 0!==t.material.userData.style&&(i=t.material.userData.style,n=o*t.material.userData.itHeightRatio*1.1,"limage-rtext"===i||"ltext-rimage"===i?o<n&&(e=(o=n)/t.material.userData.scaleRatio):"timage-btext"===i||"ttext-bimage"===i?e=(o+=n)/t.material.userData.scaleRatio:"overlay-text"===i&&o<n&&(e=(o=n)/t.material.userData.scaleRatio))):e=o,o=o/this.renderer.domElement.clientHeight*2,e=e/this.renderer.domElement.clientWidth*2,{leftTop:new fi(r.x-e/2,r.y+o/2),rightDown:new fi(r.x+e/2,r.y-o/2)}},Ki:function(t,n,e,i,r){for(var o=0;o<n.length;o++)if(n[o].mapNode.Bn&&!n[o].mapNode.Ji)if(n[o].mapNode.Ee&&(n[o].mapNode.Ee.maxlevel<=i||n[o].mapNode.Ee.minlevel>i))n[o].visible=!1;else if(!1!==r)if(!1!==n[o].mapNode.Qi){if(n[o].material.map){var s=this.qi(n[o],e);n[o].userData.bounds=s;for(var a=!0,u=0;u<t.length;u++){var h=t[u].userData.bounds;if(!(a=!Lu.qe(s.leftTop,s.rightDown,h.leftTop,h.rightDown)))break}a?(n[o].visible=!0,t.push(n[o])):n[o].visible=!1}}else n[o].visible=!0;else n[o].visible=!0;else n[o].visible=!1},$i:function(){var g=this;this.Ci&&(this.W.traverse(function(t){if(g.W.Zt.tr(t))for(var n=t.visibleLevels,e=[],i=g.W.getZoom(),r=g.Et.nr,o=0;o<n.length;o++){var s=t.getFloor(n[o]);if(s){var a=s.getLayers(fengmap.FMType.LABEL_LAYER),u=void 0;0<a.length&&(u=a[0].scene);var h=s.getLayers(fengmap.FMType.FACILITY_LAYER),a=void 0;0<h.length&&(a=h[0].scene),e.length=0,u&&g.Ki(e,u.children,!0,i,u.mapNode.Qi),a&&g.Ki(e,a.children,!1,i,a.mapNode.Qi);for(var c=0;c<r.length;c++)for(var f=r[c],l=e.length=0;l<f.length;l++){var d=f[l],v=s.getLayers(d),p=void 0,m=void 0,d=!1;0<v.length&&(m=(p=v[0]).scene,d=!0===p.isHasText),m&&void 0!==p.collision&&g.Ki(e,m.children,d,i,p.collision)}}}}),this.Ci=!1,this.W.enableUpdateRender())},er:function(){!0!==this.Et.ir&&!0!==this.Et.rr||(this.Ci=!0)},Ln:function(){this.ki=!0},vn:function(t){this.Te.delete(t)},or:function(){this.Te.clear()},sr:function(){var i,r=this;this.ki&&(this.Te.clear(),i=[],this.W.traverse(function(t){if(r.W.Zt.tr(t))for(var n=0;n<t.visibleLevels.length;n++){var e=t.getFloor(t.visibleLevels[n]);e&&i.push(e)}}),i.sort(function(t,n){return t.height<n.height?-1:t.height>n.height?1:t.parent===r.W.qt?-1:n.parent===r.W.qt?1:0}),i.forEach(function(t){var n=[];t.traverse(function(t){n.unshift(t)}),n.sort(function(t,n){var e=r.Ti.indexOf(fengmap.FMType.LAYER_NODE_TYPE.get(t.Un)),t=r.Ti.indexOf(fengmap.FMType.LAYER_NODE_TYPE.get(n.Un)),n=r.Ti.length-1;return(e=-1===e?n:e)-(t=-1===t?n:t)}),n.forEach(function(t,n,e){var i=t.parent,i=i.parent.Yt+"_"+i.level+"_"+t.Un;r.Te.set(i,t.scene)})}),this.ki=!1,this.er())},ct:function(){this.Te&&0<this.Te.size&&!this.Ri&&(this.W.It.Dt({type:"firstRender"}),this.Ri=!0)},Di:function(){var t;this.W&&this.st&&(this.st&&requestAnimationFrame(this.Di.bind(this)),this.W.It.Dt({type:"beforeRender"}),this.resize(),t={type:"update",renderType:this.Et.ar?0:1},this.Et.ar&&(this.render(),this.ct(),this.Et.ar=!1),this.W.It.Dt(t))}});var ih=eh,rh=e(1);function oh(t){return(oh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function sh(n,t){var e,i=Object.keys(n);return Object.getOwnPropertySymbols&&(e=Object.getOwnPropertySymbols(n),t&&(e=e.filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})),i.push.apply(i,e)),i}function ah(i){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?sh(Object(r),!0).forEach(function(t){var n,e;n=i,t=r[e=t],e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(r)):sh(Object(r)).forEach(function(t){Object.defineProperty(i,t,Object.getOwnPropertyDescriptor(r,t))})}return i}var uh=function t(n){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),this.ur=ah({data:null,method:"GET",responseType:"json"},n),this.hr=null};Object.assign(uh.prototype,{cr:function(t,n,e){var i=this.ur,r=i.data,o=i.method,s=i.url,a=i.responseType,u=i.header,h=null;if((h=new("undefined"!=typeof XMLHttpRequest?XMLHttpRequest:rh.a.global().fengmap.XMLHttpRequest)).responseType=a,h.open(o,s),"object"==oh(u))for(var c in u)h.setRequestHeader(c,u[c]);h.addEventListener("load",function(){200===h.status||0===h.status||201===h.status?t&&t(h.response):n&&(404===h.status?n(Ni.PATH_ERROR):2069===h.response.error_code?n(Ni.NAME_KEY_ERROR):2063===h.response.error_code?n(Ni.MAP_ID_URL_ERROR):400===h.response.error_code?n(Ni.THEME_ID_URL_ERROR):n(h.response))}),h.addEventListener("timeout",function(t){e&&e(t)}),h.addEventListener("error",function(t){n&&n(t)}),h.send(JSON.stringify(r)),this.hr=h},vt:function(){this.hr&&this.hr.abort&&(this.hr.abort(),this.hr=null)}});var hh=uh,ch=e(27),fh=e.n(ch);var lh,dh=["TmF2aVNlZ21lbg==","YWNjZXNzaWJsZQ==","Zmlk","bmZv","Rmxvb3JHZW8=","bGlmdFR5cGU=","bGVu","dmVs","ZXh0ZW50TGF5ZQ==","RXh0ZW50Qml6SQ==","cmVhZE9ubHk=","LnByb3RvYnVm","aW50MzI=","ZG9vcnR5cGU=","R0VPUE9JTlRfTQ==","TmF2aVpvbmU=","ZW50cmFuY2VGbA==","bGVuZ3Ro","ZWxCaXpJbmZv","c3RhaXJMYXllcg==","dG9CaWQ=","R2F0ZQ==","b2Zmc2V0WQ==","Zmlkcw==","aXNTZWxlY3RhYg==","ZmxhZw==","ZXh0ZXJuYWxNbw==","bGlmdEVudHJ5","VklTRUdNRU5U","SW5kZXhJbmZv","ZGF0YQ==","ZGVsQml6SW5mbw==","bWlk","cG9pTGF5ZXI=","bW9kZWxpZA==","cGFja2Vk","dGhyb3VnaA==","bmF2aVNlZ21lbg==","bGlmdExheWVy","cmVwZWF0ZWQ=","ZGVmQ2VuWQ==","b29y","bm9kZUlk","TmF2aU1vZGVs","cmFuaw==","c25vZGU=","cHRz","ZGVmR2lk","aGFzaENvZGU=","bmVzdGVk","Ymlk","cmVxdWlyZWQ=","R0VPTElORV9OQQ==","b2Zmc2V0WA==","TmF2aU5vZGU=","bHR5cGU=","T1ZFUkxBWURBVA==","ZGVmQ2VuWA==","b3B0aW9ucw==","YmFzZUxldmVs","YXJlYQ==","TGF5ZXJHcm91cA==","ZmllbGRz","cGFzcw==","Zmxvb3Jz","SUZU","Rmxvb3JOYXZp","amF2YV9vdXRlcg==","UG9seWdvbkxhYg==","ZW50cmFuY2VUeQ==","VHlwZQ==","bmF2aVpvbmVz","ZWxMYXllcg==","YWxpYXM=","d2lkdGg=","YXllcg==","ZW50cnl0eXBlcw==","TGlmdEJpekluZg==","bm9kZXR5cGVz","amF2YV9wYWNrYQ==","bmF2aVR5cGU=","ZGF0ZVZlcg==","bGlmdEZsYWc=","Z2lk","bWF4WA==","bW5hbWU=","bWluU2NhbGVMZQ==","Zmxvb3JJZA==","X2NsYXNzbmFtZQ==","TW9kZWxCaXpJbg==","Zmxvb3I=","bmFtZQ==","c2NhbGVMZXZlbA==","RXh0ZXJuYWxNbw==","cGdpZA==","ZmlsZVZlcg==","VEFJUg==","bWlubGV2ZWw=","Rmxvb3JDb25maQ==","R2VuZXJhbEdlbw==","ZHJpdmU=","Ym9vbA==","a2V5","R0VPUE9MWUdPTg==","dG9HaWQ=","ZGVmQ2VuWg==","YnR5cGU=","R0VPUE9JTlRfUw==","cC5wbGF0Zm9ybQ==","TmF2aUZsb29y","ZmxvYXQ=","bmF2aUV4dGVudA==","UE9JQml6SW5mbw==","TGFiZWxCaXpJbg==","TGF5ZXI=","cnVsZQ==","bGlk","Y29tLmZlbmdtYQ==","c2NhbGU=","c2VnbWVudElk","ZGVzYw==","ZGVsTGF5ZXI=","R0VPUE9JTlRfUA==","cm90YXRlQW5nbA==","X0xBQkVM","cG9seWdvbkxheQ==","ZmlsZURhdGU=","R0VPUE9JTlRfTA==","U3RhaXJCaXpJbg==","ZXNjYWxhdG9yTA==","bGlua1NlZw==","QnVmZmVy","TmF2aUV4dGVudA==","Z2Vv","R0VPTElORQ==","bmF2aU5vZGVz","cmVqZWN0cw==","UG9seWdvbkJpeg==","aXNWaXNpYmxl","b25zaGlw","YnVmZmVycw==","bWF4bGV2ZWw=","ZG91Ymxl","R0VPUE9JTlRfRQ==","bmF2aQ==","Rmxvb3JCaXo=","Z1Byb3RvQnVm","T0RFTA==","ZW5hbWU=","bW9kZWxMYXllcg==","a2V5cw==","ZWlk","bGF5ZXJz","QU5PUkFNQQ==","UkRFUg==","R0VPUE9JTlQ=","QnVpbGRpbmc=","bWluWA==","TWFw","aGVpZ2h0","c3RyaW5n","dHlwZQ==","ZGVmYXVsdA==","cG9seWdvbkxhYg==","TmF2aVJlbGF0aQ==","dWludDY0","aWR4cw==","SW5mbw==","X0VYVEVOVA=="];lh=dh,function(t){for(;--t;)lh.push(lh.shift())}(218);function vh(t,n){var e=dh[t=+t];void 0===vh.ngQRZk&&((i=function(){var n;try{n=Function('return (function() {}.constructor("return this")( ));')()}catch(t){n=window}return n}()).atob||(i.atob=function(t){for(var n,e,i=String(t).replace(/=+$/,""),r="",o=0,s=0;e=i.charAt(s++);~e&&(n=o%4?64*n+e:e,o++%4)&&(r+=String.fromCharCode(255&n>>(-2*o&6))))e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(e);return r}),vh.bOCUYG=function(t){for(var n=atob(t),e=[],i=0,r=n.length;i<r;i++)e+="%"+("00"+n.charCodeAt(i).toString(16)).slice(-2);return decodeURIComponent(e)},vh.TcYoxp={},vh.ngQRZk=!0);var i=vh.TcYoxp[t];return void 0===i?(e=vh.bOCUYG(e),vh.TcYoxp[t]=e):e=i,e}var ph=function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t);var n={};n[vh("0x1f")+"ge"]=vh("0x45")+vh("0x3c")+vh("0x84"),n[vh("0x13")+vh("0x28")]=vh("0x32")+vh("0x62");var e={};e[vh("0x43")]="required",e[vh("0x71")]=vh("0x70"),e.id=1;var i={};i.rule=vh("0x3"),i[vh("0x71")]=vh("0x85"),i.id=2;var r={};r.rule=vh("0x3"),r.type=vh("0x75"),r.id=3;var o={};o[vh("0x43")]=vh("0x3"),o[vh("0x71")]=vh("0x70"),o.id=4;var s={};s[vh("0x43")]=vh("0x3"),s[vh("0x71")]=vh("0x70"),s.id=5;var a={};a[vh("0x71")]=vh("0x70"),a.id=6;var u={};u[vh("0x71")]=vh("0x70"),u.id=7;var h={};h[vh("0x71")]=vh("0x70"),h.id=8;var c={};c[vh("0x72")]=!1;var f={type:"bool",id:9};f[vh("0xa")]=c;var l={};l[vh("0x43")]="repeated",l[vh("0x71")]=vh("0x53"),l.id=10;var d={rule:"repeated"};d.type=vh("0x70"),d.id=11;var v={};v[vh("0x99")]=e,v.fileVer=i,v[vh("0x21")]=r,v[vh("0x25")]=o,v.hashCode=s,v[vh("0x36")]=a,v[vh("0x4e")]=u,v.desc=h,v.readOnly=f,v[vh("0x5c")]=l,v[vh("0x66")]=d;var p={};p[vh("0x43")]=vh("0x3"),p[vh("0x71")]="int32",p.id=1;var m={};m[vh("0x43")]=vh("0x3"),m.type=vh("0x85"),m.id=2;var g={};g[vh("0x43")]="required",g[vh("0x71")]="int32",g.id=3;var y={rule:"required"};y[vh("0x71")]=vh("0x75"),y.id=4;var b={};b.rule=vh("0x3"),b[vh("0x71")]="bytes",b.id=5;var w={};w[vh("0x23")]=p,w[vh("0x2f")]=m,w[vh("0x3a")]=g,w[vh("0x7f")]=y,w[vh("0x97")]=b;var _={};_[vh("0xe")]=w;var x={};x.Buffer=_;var M={};M[vh("0xe")]=v,M.nested=x;var S={};S[vh("0x43")]=vh("0x3"),S[vh("0x71")]="string",S.id=19;var E={};E.rule=vh("0x3"),E.type=vh("0x85"),E.id=20;var T={};T[vh("0x43")]=vh("0x3"),T[vh("0x71")]="uint64",T.id=21;var L={};L[vh("0x43")]=vh("0x3"),L[vh("0x71")]=vh("0x70"),L.id=22;var R={};R.rule=vh("0x3"),R[vh("0x71")]=vh("0x70"),R.id=23;var O={type:"string",id:24},A={};A[vh("0x71")]=vh("0x70"),A.id=25;var k={};k[vh("0x72")]=!1;c={};c[vh("0x71")]=vh("0x35"),c.id=26,c[vh("0xa")]=k;e={};e[vh("0x71")]=vh("0x3e"),e.id=1;i={};i[vh("0x71")]="float",i.id=2;r={};r[vh("0x71")]="float",r.id=3;o={};o[vh("0x71")]=vh("0x3e"),o.id=4;s={};s.type=vh("0x3e"),s.id=5;a={};a.type=vh("0x3e"),a.id=6;u={};u.type=vh("0x3e"),u.id=7;h={};h[vh("0x71")]=vh("0x70"),h.id=8;f={};f.type=vh("0x3e"),f.id=9;l={};l[vh("0x71")]=vh("0x3e"),l.id=10;d={};d[vh("0x71")]=vh("0x3e"),d.id=11;p={};p.type=vh("0x3e"),p.id=12;m={};m[vh("0x71")]=vh("0x3e"),m.id=13;g={};g[vh("0x71")]=vh("0x3e"),g.id=14;y={};y.type=vh("0x3e"),y.id=15;b={};b[vh("0x71")]=vh("0x3e"),b.id=16;w={};w[vh("0x71")]=vh("0x70"),w.id=17;_={};_[vh("0x71")]="int32",_.id=28;v={};v.rule=vh("0xa0"),v[vh("0x71")]="LayerGroup",v.id=18;x={};x[vh("0x43")]="repeated",x[vh("0x71")]=vh("0x6c"),x.id=27;k={};k.mid=S,k.fileVer=E,k[vh("0x21")]=T,k[vh("0x25")]=L,k[vh("0x0")]=R,k[vh("0x36")]=O,k[vh("0x48")]=A,k[vh("0x83")]=c,k.x=e,k.y=i,k.z=r,k[vh("0x6d")]=o,k.minY=s,k[vh("0x24")]=a,k.maxY=u,k[vh("0xa8")]=h,k[vh("0x9")]=f,k[vh("0xa1")]=l,k[vh("0x39")]=d,k[vh("0x6f")]=p,k[vh("0x4b")+"eX"]=m,k.rotateAngleY=g,k[vh("0x4b")+"eZ"]=y,k[vh("0x46")]=b,k[vh("0x2c")]=w,k[vh("0x20")]=_,k.layerGroups=v,k.buildings=x;i={};i[vh("0x71")]=vh("0x85"),i.id=1;r={};r[vh("0x71")]=vh("0x70"),r.id=2;o={};o[vh("0x71")]=vh("0x70"),o.id=3;s={};s[vh("0x71")]=vh("0x16"),s.id=4;a={};a.type=vh("0x3e"),a.id=5;u={};u[vh("0x71")]=vh("0x3e"),u.id=6;h={};h[vh("0x71")]=vh("0x3e"),h.id=7;f={};f[vh("0x71")]=vh("0x3e"),f.id=8;l={};l[vh("0x71")]=vh("0x3e"),l.id=9;d={};d[vh("0x71")]=vh("0x3e"),d.id=10;p={};p[vh("0x71")]=vh("0x3e"),p.id=11;m={};m[vh("0x71")]=vh("0x3e"),m.id=12;g={};g[vh("0x71")]=vh("0x35"),g.id=13;y={};y[vh("0x71")]=vh("0x35"),y.id=14;b={};b[vh("0x71")]=vh("0x35"),b.id=15;w={};w.type=vh("0x70"),w.id=16;_={};_[vh("0x44")]=i,_.lname=r,_[vh("0x19")]=o,_[vh("0x7")]=s,_[vh("0x5")]=a,_[vh("0x8f")]=u,_[vh("0x6f")]=h,_[vh("0x4b")+"eX"]=f,_.rotateAngleY=l,_[vh("0x4b")+"eZ"]=d,_[vh("0x26")+vh("0x80")]=p,_["maxScaleLe"+vh("0x80")]=m,_[vh("0x5a")]=g,_[vh("0x91")+"le"]=y,_.isEditable=b,_[vh("0x48")]=w;v={};v[vh("0x6b")]=1,v[vh("0x5f")+"SCALATOR"]=2,v[vh("0x4f")+vh("0x11")]=3,v[vh("0x3b")+vh("0x30")]=4,v[vh("0x4a")+vh("0x69")]=5,v[vh("0x4a")+"OI"]=6,v[vh("0x3b")+"TORELABEL"]=7,v.GEOPOINT_NAVINODE=8,v[vh("0x87")+vh("0x63")]=9,v[vh("0x56")]=20,v[vh("0x4")+vh("0x95")]=21,v["GEOLINE_BO"+vh("0x6a")]=22,v[vh("0x37")]=30,v[vh("0x37")+vh("0x78")]=31,v.GEOPOLYGON_STORE=32,v[vh("0x37")+vh("0x4c")]=33,v.RASTERATA=40,v[vh("0x8")+"A"]=50;x={};x.values=v;i={};i[vh("0x16")]=x;r={};r[vh("0xe")]=_,r[vh("0x1")]=i;o={};o[vh("0x71")]="int32",o.id=1;s={};s[vh("0x71")]="string",s.id=2;a={};a[vh("0x71")]="string",a.id=3;u={};u[vh("0x71")]=vh("0x3e"),u.id=4;h={};h[vh("0x71")]=vh("0x70"),h.id=5;f={};f[vh("0x43")]="repeated",f[vh("0x71")]=vh("0x42"),f.id=6;l={};l[vh("0x71")]=vh("0x70"),l.id=7;d={};d[vh("0x71")]="int32",d.id=8;p={};p.gid=o,p.gname=s,p[vh("0x19")]=a,p[vh("0x6f")]=u,p[vh("0x48")]=h,p[vh("0x68")]=f,p[vh("0x27")]=l,p[vh("0x20")]=d;m={};m[vh("0xe")]=p;g={};g[vh("0x71")]=vh("0x85"),g.id=1;y={};y[vh("0x71")]=vh("0x3e"),y.id=2;b={};b[vh("0x71")]=vh("0x3e"),b.id=3;w={};w.type=vh("0x3e"),w.id=4;v={};v.type=vh("0x3e"),v.id=5;x={};x[vh("0x71")]="float",x.id=6;_={};_[vh("0x71")]=vh("0x3e"),_.id=7;i={};i[vh("0x43")]=vh("0xa0"),i.type=vh("0x70"),i.id=8;o={};o.type=vh("0x85"),o.id=9;s={type:"bool",id:10},a={};a[vh("0x71")]=vh("0x85"),a.id=11;u={};u[vh("0x71")]="int32",u.id=12;h={};h[vh("0x71")]=vh("0x70"),h.id=13;f={rule:"repeated"};f[vh("0x71")]=vh("0x96"),f.id=14;l={};l[vh("0x9c")]=!1;d={};d[vh("0x43")]=vh("0xa0"),d.type=vh("0x5e"),d.id=15,d[vh("0xa")]=l;p={};p[vh("0x23")]=g,p.x=y,p.y=b,p.offsetX=w,p[vh("0x8f")]=v,p.angle=x,p.scale=_,p[vh("0x90")]=i,p[vh("0x2e")]=o,p[vh("0xb")]=s,p.minlevel=a,p[vh("0x5d")]=u,p.floorId=h,p.idxs=f,p[vh("0xa7")]=d;l={};l[vh("0x9c")]=!1;g={};g.rule=vh("0xa0"),g[vh("0x71")]=vh("0x85"),g.id=1,g[vh("0xa")]=l;y={};y[vh("0x76")]=g;b={};b[vh("0xe")]=y;w={};w.IndexInfo=b;v={};v[vh("0xe")]=p,v[vh("0x1")]=w;x={};x[vh("0x71")]=vh("0x70"),x.id=1;_={type:"string",id:2},i={};i.type=vh("0x70"),i.id=3;o={};o[vh("0x71")]=vh("0x70"),o.id=4;s={type:"float",id:5},a={};a[vh("0x71")]=vh("0x3e"),a.id=6;u={};u.type=vh("0x70"),u.id=7;h={};h[vh("0x71")]=vh("0x85"),h.id=8;f={};f[vh("0x43")]="repeated",f[vh("0x71")]="Floor",f.id=9;d={};d[vh("0x71")]="int32",d.id=10;l={};l[vh("0x2")]=x,l[vh("0x2b")]=_,l[vh("0x64")]=i,l[vh("0x19")]=o,l.x=s,l.y=a,l.mid=u,l.version=h,l.floors=f,l.bcode=d;g={};g.fields=l;y={};y[vh("0x42")]=r,y[vh("0xd")]=m,y.Floor=v,y[vh("0x6c")]=g;b={};b[vh("0xe")]=k,b[vh("0x1")]=y;p={};p[vh("0x43")]=vh("0x3"),p[vh("0x71")]=vh("0x70"),p.id=1;w={};w[vh("0x43")]="repeated",w[vh("0x71")]=vh("0x3d"),w.id=2;x={};x.mid=p,x[vh("0x10")]=w;_={};_[vh("0x71")]="int32",_.id=1;i={};i[vh("0x71")]="string",i.id=2;o={};o[vh("0x71")]=vh("0x70"),o.id=3;s={};s[vh("0x71")]=vh("0x70"),s.id=4;a={};a[vh("0x43")]=vh("0xa0"),a.type=vh("0x74")+vh("0x5b"),a.id=5;u={};u[vh("0x43")]=vh("0xa0"),u[vh("0x71")]=vh("0x74")+vh("0x5b"),u.id=6;h={};h[vh("0x43")]=vh("0xa0"),h[vh("0x71")]=vh("0x74")+vh("0x5b"),h.id=7;f={};f.gid=_,f[vh("0x27")]=i,f[vh("0x2")]=o,f[vh("0x99")]=s,f[vh("0x60")]=a,f[vh("0x34")]=u,f.accessible=h;d={};d[vh("0xe")]=f;l={};l[vh("0x43")]=vh("0x3"),l[vh("0x71")]="int32",l.id=1;r={};r[vh("0x71")]=vh("0x85"),r.id=2;m={};m[vh("0x71")]=vh("0x85"),m.id=3;v={};v[vh("0x43")]=vh("0xa0"),v[vh("0x71")]="IndexInfo",v.id=4;g={};g[vh("0x9c")]=!1;k={};k[vh("0x43")]=vh("0xa0"),k[vh("0x71")]=vh("0x5e"),k.id=5,k.options=g;y={};y.type=vh("0x85"),y.id=6;p={};p[vh("0x43")]=vh("0xa0"),p.type=vh("0x70"),p.id=7;w={};w[vh("0x43")]="repeated",w[vh("0x71")]="string",w.id=8;_={};_[vh("0x67")]=l,_[vh("0x71")]=r,_[vh("0x7a")]=m,_[vh("0x76")]=v,_[vh("0xa7")]=k,_[vh("0x92")]=y,_[vh("0x8d")]=p,_[vh("0x38")]=w;i={};i[vh("0x9c")]=!1;o={};o[vh("0x43")]=vh("0xa0"),o[vh("0x71")]=vh("0x85"),o.id=1,o.options=i;s={};s[vh("0x76")]=o;a={};a[vh("0xe")]=s;u={};u[vh("0x96")]=a;h={};h[vh("0xe")]=_,h.nested=u;f={};f[vh("0x3d")]=d,f[vh("0x74")+vh("0x5b")]=h;g={};g.fields=x,g[vh("0x1")]=f;l={};l[vh("0x43")]=vh("0x3"),l[vh("0x71")]=vh("0x70"),l.id=1;r={};r[vh("0x43")]="required",r[vh("0x71")]=vh("0x85"),r.id=2;m={};m.type=vh("0x3e"),m.id=3;v={};v[vh("0x43")]=vh("0xa0"),v[vh("0x71")]=vh("0x33")+vh("0x77"),v.id=4;k={};k.rule=vh("0xa0"),k[vh("0x71")]=vh("0x33")+"Info",k.id=5;y={rule:"repeated"};y[vh("0x71")]="GeneralGeo"+vh("0x77"),y.id=6;p={};p[vh("0x43")]="repeated",p[vh("0x71")]="GeneralGeoInfo",p.id=7;w={};w[vh("0x43")]="repeated",w[vh("0x71")]=vh("0x33")+vh("0x77"),w.id=8;i={};i.rule=vh("0xa0"),i[vh("0x71")]=vh("0x33")+"Info",i.id=9;o={};o[vh("0x43")]=vh("0xa0"),o[vh("0x71")]="GeneralGeoInfo",o.id=10;s={};s[vh("0x43")]=vh("0xa0"),s.type=vh("0x33")+vh("0x77"),s.id=11;a={};a[vh("0x43")]=vh("0xa0"),a[vh("0x71")]=vh("0x33")+"Info",a.id=12;_={};_[vh("0x43")]=vh("0xa0"),_[vh("0x71")]=vh("0x33")+vh("0x77"),_.id=13;u={};u[vh("0x99")]=l,u[vh("0x23")]=r,u[vh("0x6f")]=m,u[vh("0x81")+"r"]=v,u[vh("0x65")]=k,u.labelLayer=y,u[vh("0x9a")]=p,u[vh("0x4d")+"er"]=w,u[vh("0x73")+"elLayer"]=i,u[vh("0x9f")]=o,u[vh("0x8c")]=s,u[vh("0x51")+vh("0x1b")]=a,u[vh("0x93")+vh("0x49")]=_;d={};d[vh("0x43")]=vh("0x3"),d[vh("0x71")]=vh("0x85"),d.id=1;h={};h[vh("0x71")]="string",h.id=2;x={};x[vh("0x71")]=vh("0x3e"),x.id=3;f={type:"float",id:4},l={};l[vh("0x43")]="repeated",l[vh("0x71")]=vh("0x96"),l.id=5;r={};r[vh("0x9c")]=!1;m={};m[vh("0x43")]=vh("0xa0"),m.type=vh("0x5e"),m.id=6,m[vh("0xa")]=r;v={};v.eid=d,v[vh("0x55")]=h,v[vh("0x6f")]=x,v[vh("0xc")]=f,v.idxs=l,v[vh("0xa7")]=m;k={packed:!1},y={};y[vh("0x43")]=vh("0xa0"),y.type=vh("0x85"),y.id=1,y[vh("0xa")]=k;p={};p[vh("0x76")]=y;w={};w[vh("0xe")]=p;i={};i[vh("0x96")]=w;o={};o.fields=v,o[vh("0x1")]=i;s={};s["GeneralGeo"+vh("0x77")]=o;a={};a[vh("0xe")]=u,a[vh("0x1")]=s;_={};_.rule=vh("0x3"),_[vh("0x71")]=vh("0x70"),_.id=1;r={};r[vh("0x43")]=vh("0x3"),r[vh("0x71")]=vh("0x85"),r.id=2;d={};d[vh("0x43")]="repeated",d[vh("0x71")]=vh("0x82")+vh("0x7c"),d.id=3;h={rule:"repeated"};h.type=vh("0x29")+"fo",h.id=4;x={};x[vh("0x43")]=vh("0xa0"),x.type=vh("0x41")+"fo",x.id=5;f={};f.rule=vh("0xa0"),f.type=vh("0x40"),f.id=6;l={};l[vh("0x43")]=vh("0xa0"),l.type=vh("0x59")+"Info",l.id=7;m={};m[vh("0x43")]=vh("0xa0"),m[vh("0x71")]=vh("0x1d")+"o",m.id=8;k={};k[vh("0x43")]=vh("0xa0"),k.type=vh("0x50")+"fo",k.id=9;y={};y[vh("0x43")]=vh("0xa0"),y[vh("0x71")]=vh("0x14")+vh("0x8b"),y.id=10;p={};p[vh("0x43")]=vh("0xa0"),p[vh("0x71")]=vh("0x2d")+vh("0x98"),p.id=11;w={};w[vh("0x99")]=_,w[vh("0x23")]=r,w[vh("0x81")+"r"]=d,w[vh("0x65")]=h,w.labelLayer=x,w[vh("0x9a")]=f,w[vh("0x4d")+"er"]=l,w.liftLayer=m,w[vh("0x8c")]=k,w["polygonLab"+vh("0x18")]=y,w[vh("0x93")+"delLayer"]=p;v={};v.rule=vh("0x3"),v[vh("0x71")]=vh("0x85"),v.id=1;i={};i.type=vh("0x70"),i.id=2;o={};o[vh("0x71")]=vh("0x85"),o.id=3;u={};u[vh("0x71")]=vh("0x70"),u.id=4;s={};s.type=vh("0x70"),s.id=5;_={};_[vh("0x71")]="int32",_.id=6;r={};r[vh("0x71")]="int32",r.id=7;d={};d.eid=v,d[vh("0x7b")]=i,d.type=o,d[vh("0x2b")]=u,d[vh("0x64")]=s,d[vh("0x31")]=_,d[vh("0x5d")]=r;h={};h.fields=d;x={};x[vh("0x43")]="required",x[vh("0x71")]=vh("0x85"),x.id=1;f={};f[vh("0x71")]="string",f.id=2;l={};l[vh("0x71")]="int32",l.id=3;m={};m[vh("0x71")]=vh("0x70"),m.id=4;k={};k[vh("0x71")]=vh("0x70"),k.id=5;y={};y.type=vh("0x85"),y.id=6;p={};p[vh("0x71")]=vh("0x85"),p.id=7;v={};v[vh("0x71")]="int32",v.id=8;i={};i[vh("0x67")]=x,i[vh("0x7b")]=f,i[vh("0x71")]=l,i[vh("0x2b")]=m,i[vh("0x64")]=k,i[vh("0x31")]=y,i[vh("0x5d")]=p,i[vh("0xf")]=v;o={};o[vh("0xe")]=i;u={};u[vh("0x43")]=vh("0x3"),u[vh("0x71")]=vh("0x85"),u.id=1;s={};s[vh("0x71")]=vh("0x70"),s.id=2;_={};_[vh("0x71")]=vh("0x85"),_.id=3;r={};r[vh("0x71")]=vh("0x70"),r.id=4;d={};d.type=vh("0x70"),d.id=5;x={};x[vh("0x71")]=vh("0x85"),x.id=6;f={};f.type=vh("0x85"),f.id=7;l={};l[vh("0x67")]=u,l[vh("0x7b")]=s,l[vh("0x71")]=_,l[vh("0x2b")]=r,l[vh("0x64")]=d,l[vh("0x31")]=x,l.maxlevel=f;m={};m.fields=l;k={};k[vh("0x43")]=vh("0x3"),k[vh("0x71")]=vh("0x85"),k.id=1;y={};y[vh("0x71")]=vh("0x70"),y.id=2;p={};p[vh("0x71")]="int32",p.id=3;v={};v[vh("0x71")]=vh("0x70"),v.id=4;i={};i[vh("0x71")]=vh("0x70"),i.id=5;u={type:"int32",id:6},s={};s[vh("0x71")]=vh("0x85"),s.id=7;_={};_[vh("0x67")]=k,_.fid=y,_[vh("0x71")]=p,_[vh("0x2b")]=v,_[vh("0x64")]=i,_[vh("0x31")]=u,_[vh("0x5d")]=s;r={};r[vh("0xe")]=_;d={};d[vh("0x43")]=vh("0x3"),d.type=vh("0x85"),d.id=1;x={};x.type=vh("0x70"),x.id=2;f={};f[vh("0x71")]=vh("0x85"),f.id=3;l={};l[vh("0x71")]=vh("0x70"),l.id=4;k={};k.type=vh("0x70"),k.id=5;y={};y[vh("0x71")]="int32",y.id=6;p={type:"int32",id:7},v={};v.eid=d,v[vh("0x7b")]=x,v[vh("0x71")]=f,v.name=l,v[vh("0x64")]=k,v[vh("0x31")]=y,v[vh("0x5d")]=p;i={};i[vh("0xe")]=v;u={};u[vh("0x43")]="required",u[vh("0x71")]=vh("0x85"),u.id=1;s={};s.type=vh("0x70"),s.id=2;_={};_.type=vh("0x85"),_.id=3;d={};d.type=vh("0x85"),d.id=4;x={};x[vh("0x71")]=vh("0x70"),x.id=5;f={};f.type=vh("0x85"),f.id=6;l={};l[vh("0x71")]=vh("0x85"),l.id=7;k={};k[vh("0x67")]=u,k[vh("0x7b")]=s,k[vh("0x71")]=_,k[vh("0x92")]=d,k[vh("0x2a")]=x,k[vh("0x31")]=f,k[vh("0x5d")]=l;y={};y[vh("0xe")]=k;p={};p[vh("0x43")]=vh("0x3"),p[vh("0x71")]="int32",p.id=1;v={};v[vh("0x71")]=vh("0x70"),v.id=2;u={};u[vh("0x71")]=vh("0x85"),u.id=3;s={};s[vh("0x71")]=vh("0x85"),s.id=4;_={};_[vh("0x71")]="int32",_.id=5;d={};d[vh("0x71")]=vh("0x85"),d.id=6;x={};x[vh("0x67")]=p,x[vh("0x7b")]=v,x[vh("0x71")]=u,x[vh("0x92")]=s,x[vh("0x31")]=_,x.maxlevel=d;f={};f[vh("0xe")]=x;l={};l.rule=vh("0x3"),l[vh("0x71")]=vh("0x85"),l.id=1;k={};k.type=vh("0x70"),k.id=2;p={};p[vh("0x71")]="int32",p.id=3;v={};v[vh("0x71")]="float",v.id=4;u={};u[vh("0x71")]=vh("0x70"),u.id=5;s={};s[vh("0x71")]="string",s.id=6;_={};_[vh("0x71")]=vh("0x3e"),_.id=7;d={};d[vh("0x67")]=l,d[vh("0x7b")]=k,d[vh("0x71")]=p,d[vh("0x1a")]=v,d[vh("0x2b")]=u,d[vh("0x64")]=s,d.angle=_;x={};x.fields=d;l={};l[vh("0x43")]=vh("0x3"),l[vh("0x71")]="int32",l.id=1;k={type:"string",id:2},p={};p[vh("0x71")]=vh("0x85"),p.id=3;v={};v[vh("0x71")]=vh("0x70"),v.id=4;u={};u[vh("0x71")]=vh("0x70"),u.id=5;s={};s[vh("0x71")]="int32",s.id=6;_={};_.type=vh("0x85"),_.id=7;d={};d[vh("0x67")]=l,d[vh("0x7b")]=k,d[vh("0x71")]=p,d.name=v,d[vh("0x64")]=u,d[vh("0x31")]=s,d[vh("0x5d")]=_;l={};l[vh("0xe")]=d;k={};k[vh("0x82")+"nfo"]=h,k[vh("0x29")+"fo"]=o,k[vh("0x41")+"fo"]=m,k[vh("0x59")+vh("0x77")]=r,k.POIBizInfo=i,k[vh("0x1d")+"o"]=y,k[vh("0x50")+"fo"]=f,k[vh("0x14")+vh("0x8b")]=x,k[vh("0x2d")+"delBizInfo"]=l;p={};p[vh("0xe")]=w,p.nested=k;v={};v[vh("0x43")]="required",v.type=vh("0x70"),v.id=1;u={};u[vh("0x43")]="required",u.type=vh("0x85"),u.id=2;s={};s[vh("0x43")]=vh("0xa0"),s[vh("0x71")]=vh("0x6"),s.id=3;_={};_[vh("0x43")]="repeated",_[vh("0x71")]=vh("0x79")+"t",_.id=4;d={};d[vh("0x43")]=vh("0xa0"),d[vh("0x71")]=vh("0x88"),d.id=5;h={};h[vh("0x43")]=vh("0xa0"),h[vh("0x71")]="NaviModel",h.id=6;o={};o[vh("0x9c")]=!1;m={};m[vh("0x43")]=vh("0xa0"),m[vh("0x71")]=vh("0x85"),m.id=7,m[vh("0xa")]=o;r={};r[vh("0x43")]=vh("0xa0"),r[vh("0x71")]="NaviExtent",r.id=8;i={};i[vh("0x99")]=v,i[vh("0x23")]=u,i[vh("0x57")]=s,i[vh("0x9e")+"ts"]=_,i[vh("0x17")]=d,i.naviModels=h,i.nextFloors=m,i[vh("0x3f")+"s"]=r;y={};y[vh("0x71")]="int32",y.id=1;f={};f.type=vh("0x85"),f.id=2;x={};x[vh("0x71")]=vh("0x85"),x.id=3;l={};l[vh("0x71")]=vh("0x85"),l.id=4;w={};w[vh("0x71")]="int32",w.id=5;k={};k[vh("0x71")]=vh("0x70"),k.id=6;o={type:"string",id:7},v={};v[vh("0x71")]=vh("0x70"),v.id=8;u={};u[vh("0x71")]="int32",u.id=9;s={};s[vh("0x71")]=vh("0x70"),s.id=10;_={};_[vh("0x71")]=vh("0x85"),_.id=11;d={};d[vh("0x9c")]=!1;h={};h[vh("0x43")]=vh("0xa0"),h.type=vh("0x85"),h.id=12,h[vh("0xa")]=d;m={};m[vh("0x9c")]=!1;r={};r[vh("0x43")]=vh("0xa0"),r[vh("0x71")]=vh("0x5e"),r.id=13,r[vh("0xa")]=m;d={default:0},m={type:"int32",id:14};m[vh("0xa")]=d;d={};d[vh("0xa3")]=y,d.nodeType=f,d[vh("0x7e")]=x,d[vh("0x22")]=l,d[vh("0x94")]=w,d.liftFloor=k,d[vh("0x52")]=o,d[vh("0x55")]=v,d[vh("0x15")+"pe"]=u,d[vh("0x89")+vh("0xa2")]=s,d[vh("0x86")]=_,d[vh("0x76")]=h,d.pts=r,d[vh("0x7a")]=m;f={};f[vh("0xe")]=d;x={};x[vh("0x71")]=vh("0x85"),x.id=1;l={};l[vh("0x71")]="int32",l.id=2;w={};w[vh("0x71")]=vh("0x85"),w.id=3;k={};k[vh("0x71")]=vh("0x5e"),k.id=4;o={};o[vh("0x71")]=vh("0x85"),o.id=5;v={};v[vh("0x71")]=vh("0x70"),v.id=6;u={};u[vh("0x71")]=vh("0x85"),u.id=7;s={};s[vh("0x71")]=vh("0x70"),s.id=8;_={};_[vh("0x71")]=vh("0x70"),_.id=9;h={};h[vh("0x71")]=vh("0x85"),h.id=10;r={};r[vh("0x9c")]=!1;m={};m[vh("0x43")]="repeated",m[vh("0x71")]=vh("0x85"),m.id=11,m[vh("0xa")]=r;d={};d[vh("0x9c")]=!1;r={};r[vh("0x43")]=vh("0xa0"),r[vh("0x71")]=vh("0x5e"),r.id=12,r[vh("0xa")]=d;d={};d[vh("0x47")]=x,d[vh("0xa6")]=l,d.enode=w,d[vh("0x8a")]=k,d[vh("0xa5")]=o,d[vh("0x2b")]=v,d.entry=u,d[vh("0x48")]=s,d[vh("0x55")]=_,d[vh("0x9d")]=h,d[vh("0x76")]=m,d[vh("0xa7")]=r;v={};v[vh("0xe")]=d;u={};u.rule=vh("0x3"),u[vh("0x71")]=vh("0x85"),u.id=1;s={};s[vh("0x72")]=0;_={};_[vh("0x43")]=vh("0x3"),_.type=vh("0x85"),_.id=2,_[vh("0xa")]=s;h={};h.type=vh("0x70"),h.id=3;m={};m[vh("0x43")]=vh("0xa0"),m[vh("0x71")]=vh("0x70"),m.id=4;r={};r[vh("0x9c")]=!1;d={};d[vh("0x43")]=vh("0xa0"),d[vh("0x71")]="int32",d.id=5,d[vh("0xa")]=r;s={};s[vh("0x9c")]=!1;r={};r[vh("0x43")]="repeated",r[vh("0x71")]=vh("0x5e"),r.id=6,r[vh("0xa")]=s;s={};s.id=u,s[vh("0x71")]=_,s[vh("0x55")]=h,s[vh("0x58")]=m,s[vh("0x76")]=d,s.pts=r;_={};_[vh("0xe")]=s;h={};h[vh("0x43")]="required",h[vh("0x71")]=vh("0x85"),h.id=1;m={};m[vh("0x9c")]=!1;d={};d[vh("0x43")]=vh("0xa0"),d.type=vh("0x85"),d.id=2,d.options=m;r={packed:!1},s={};s[vh("0x43")]=vh("0xa0"),s[vh("0x71")]="int32",s.id=3,s[vh("0xa")]=r;m={};m[vh("0x9c")]=!1;r={};r[vh("0x43")]=vh("0xa0"),r.type=vh("0x85"),r.id=4,r[vh("0xa")]=m;m={};m[vh("0x9b")]=h,m.doorids=d,m[vh("0x1e")]=s,m[vh("0x1c")]=r;h={};h[vh("0xe")]=m;d={};d[vh("0x43")]=vh("0x3"),d[vh("0x71")]=vh("0x85"),d.id=1;s={};s[vh("0x9c")]=!1;r={};r.rule=vh("0xa0"),r[vh("0x71")]="double",r.id=2,r.options=s;m={};m[vh("0x43")]="repeated",m[vh("0x71")]=vh("0x96"),m.id=3;s={};s.id=d,s[vh("0xa7")]=r,s[vh("0x76")]=m;r={packed:!1},m={};m[vh("0x43")]=vh("0xa0"),m[vh("0x71")]=vh("0x85"),m.id=1,m.options=r;r={};r[vh("0x76")]=m;m={};m[vh("0xe")]=r;r={};r[vh("0x96")]=m;m={};m[vh("0xe")]=s,m[vh("0x1")]=r;r={};r[vh("0x6")]=f,r[vh("0x79")+"t"]=v,r[vh("0x88")]=_,r[vh("0xa4")]=h,r[vh("0x54")]=m;m={};m.fields=i,m[vh("0x1")]=r;r={};r[vh("0x6e")]=M,r.Scene=b,r[vh("0x8e")]=g,r[vh("0x7d")]=a,r[vh("0x61")]=p,r[vh("0x12")]=m;m={};m[vh("0xa")]=n,m[vh("0x1")]=r;r={};r.protobuf=m;m={};m[vh("0x1")]=r,this.id=m};var mh=function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),this.fr=null};Object.assign(mh.prototype,{lr:function(){this.fr||(this.fr=fh.a.Root.fromJSON((new("undefined"!=typeof KjWzhWlSj&&KjWzhWlSj.ProtoDef?KjWzhWlSj.ProtoDef:ph)).id))},dr:function(t){return this.lr(),this.fr.lookup("Map").decode(t)},vr:function(t){for(var n=0;n<t.buffers.length;n++){var e=t.buffers[n];if(1==e.btype)return this.pr(e.data)}return null},mr:function(t){for(var n=0;n<t.buffers.length;n++){var e=t.buffers[n];if(7==e.btype)return this.gr(e.data)}return null},yr:function(t,n){for(var e=0;e<t.buffers.length;e++){var i=t.buffers[e];if(2==i.btype&&i.gid==n)return this.br(i.data)}return null},wr:function(t,n){for(var e=0;e<t.buffers.length;e++){var i=t.buffers[e];if(3==i.btype&&i.gid==n)return this._r(i.data)}return null},Mr:function(t,n){for(var e=0;e<t.buffers.length;e++){var i=t.buffers[e];if(4==i.btype&&i.gid==n)return this.Sr(i.data)}return null},Er:function(t,n){for(var e=0;e<t.buffers.length;e++){var i=t.buffers[e];if(5===i.btype&&i.gid===n)return this.Sr(i.data)}return null},Tr:function(t,n){for(var e=0;e<t.buffers.length;e++){var i=t.buffers[e];if(6===i.btype&&i.gid===n)return this.Sr(i.data)}return null},pr:function(t){this.lr();var n=this.fr.lookup("Scene").decode(t);return n.levels=[],n.layerGroups.forEach(function(t){n.levels.push(t.gid)}),n},gr:function(t){return this.lr(),this.fr.lookup("Gate").decode(t)},br:function(t){return this.lr(),this.fr.lookup("FloorGeo").decode(t)},_r:function(t){return this.lr(),this.fr.lookup("FloorBiz").decode(t)},Sr:function(t){return this.lr(),this.fr.lookup("FloorNavi").decode(t)}});var gh=mh;var yh=function t(){var n;!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),void 0!==rh.a.global().KjWzhWlSj&&rh.a.global().KjWzhWlSj.ProtoReaderStatic?(n=rh.a.global().KjWzhWlSj.ProtoReaderStatic,this.Lr=new n):this.Lr=new gh};Object.assign(yh.prototype,{dr:function(t){return this.Lr.dr(t)},vr:function(t){return this.Lr.vr(t)},mr:function(t){return this.Lr.mr(t)},yr:function(t,n){return this.Lr.yr(t,n)},wr:function(t,n){return this.Lr.wr(t,n)},Mr:function(t,n){return this.Lr.Mr(t,n)},Er:function(t,n){return this.Lr.Er(t,n)},Tr:function(t,n){return this.Lr.Tr(t,n)},pr:function(t){return this.Lr.pr(t)},gr:function(t){return this.Lr.gr(t)},br:function(t){return this.Lr.br(t)},_r:function(t){return this.Lr._r(t)},Sr:function(t){return this.Lr.Sr(t)}});var bh,wh,_h,xh,Mh,Sh=yh,vi="https://console.fengmap.com/api-s/",Eh="https://console.fengmap.cool/api-s/",Th={domain:vi,online:vi+"sdk/check",check:vi+"sdk/auth/web",download:vi+"sdk/auth/obtainMapRoute",downloadTile:vi+"sdk/authLayered/obtainMapRoute",collect:vi+"sdk/collect",themeUrl:vi+"webtheme/",externalModelURL:vi+"webmodel/"},Lh=function(){Th={domain:Eh,online:Eh+"sdk/check",check:Eh+"sdk/auth/web",download:Eh+"sdk/auth/obtainMapRoute",downloadTile:Eh+"sdk/authLayered/obtainMapRoute",collect:Eh+"sdk/collect",themeUrl:Eh+"webtheme/",externalModelURL:Eh+"webmodel/"}};function Rh(t,n){for(var e,i=0,r=0,r=0;r<8;r++)1&n&&(i^=t),e=128&t,t<<=1,e&&(t^=27),n>>=1;return i}function Oh(t,n,e){for(var i=0;i<4;i++)t[0+i]^=n[16*e+4*i],t[4+i]^=n[16*e+4*i+1],t[8+i]^=n[16*e+4*i+2],t[12+i]^=n[16*e+4*i+3]}function Ah(t){for(var n,e,i,r=1;r<4;r++)for(e=0;e<r;){for(i=t[4*r+4-1],n=3;0<n;n--)t[4*r+n]=t[4*r+n-1];t[4*r+0]=i,e++}}function kh(t){for(var n,e,i,r=0;r<4;r++)for(n=0;n<4;n++)e=(240&t[4*r+n])>>4,i=15&t[4*r+n],t[4*r+n]=wh[16*e+i]}function Ch(t){for(var n=0;n<4;n++)t[n]=bh[16*((240&t[n])>>4)+(15&t[n])]}function jh(t){return parseInt(t,16)}var Ph=(bh=[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],wh=[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],Mh=[2,xh=_h=0,0,0],{decryption:function(t,n){for(var e=Array(16),i=0;i<16;i++)e[i]=16*jh(n.substr(2*i,1))+jh(n.substr(2*i+1,1));var r=Array(16);for(i=0;i<16;i++)r[i]=16*jh(t.substr(2*i,1))+jh(t.substr(2*i+1,1));var o=Array(16);switch(i=[],e.length){default:case 16:_h=4,xh=10;break;case 24:_h=6,xh=12;break;case 32:_h=8,xh=14}for(var s=i=Array(16*(xh+1)),a=Array(4),u=4*(xh+1),h=0;h<_h;h++)s[4*h+0]=e[4*h+0],s[4*h+1]=e[4*h+1],s[4*h+2]=e[4*h+2],s[4*h+3]=e[4*h+3];for(h=_h;h<u;h++){if(a[0]=s[4*(h-1)+0],a[1]=s[4*(h-1)+1],a[2]=s[4*(h-1)+2],a[3]=s[4*(h-1)+3],0==h%_h){for(var c=void 0,f=void 0,c=(e=a)[0],f=0;f<3;f++)e[f]=e[f+1];if(e[3]=c,Ch(a),1==(e=h/_h))Mh[0]=1;else if(1<e)for(Mh[0]=2,e--;0<e-1;)Mh[0]=Rh(Mh[0],2),e--;(f=e=a)[0]=e[0]^(c=Mh)[0],f[1]=e[1]^c[1],f[2]=e[2]^c[2],f[3]=e[3]^c[3]}else 6<_h&&4==h%_h&&Ch(a);s[4*h+0]=s[4*(h-_h)+0]^a[0],s[4*h+1]=s[4*(h-_h)+1]^a[1],s[4*h+2]=s[4*(h-_h)+2]^a[2],s[4*h+3]=s[4*(h-_h)+3]^a[3]}for(s=Array(16),a=0;a<4;a++)for(h=0;h<4;h++)s[4*a+h]=r[a+4*h];for(Oh(s,i,xh),r=xh-1;1<=r;r--)for(Ah(s),kh(s),Oh(s,i,r),a=s,h=[14,9,13,11],u=f=void 0,e=Array(4),c=Array(4),u=0;u<4;u++){for(f=0;f<4;f++)e[f]=a[4*f+u];var l=e,d=c;for(d[0]=Rh((f=h)[0],l[0])^Rh(f[3],l[1])^Rh(f[2],l[2])^Rh(f[1],l[3]),d[1]=Rh(f[1],l[0])^Rh(f[0],l[1])^Rh(f[3],l[2])^Rh(f[2],l[3]),d[2]=Rh(f[2],l[0])^Rh(f[1],l[1])^Rh(f[0],l[2])^Rh(f[3],l[3]),d[3]=Rh(f[3],l[0])^Rh(f[2],l[1])^Rh(f[1],l[2])^Rh(f[0],l[3]),f=0;f<4;f++)a[4*f+u]=c[f]}for(Ah(s),kh(s),Oh(s,i,0),a=0;a<4;a++)for(h=0;h<4;h++)o[a+4*h]=s[4*a+h];for(r="",i=0;i<16;++i)r+=s=(s=o[i].toString(16)).length<2?"0"+s:s;return r}});function Dh(t,n){var e=(65535&t)+(65535&n);return(t>>16)+(n>>16)+(e>>16)<<16|65535&e}function Ih(t,n,e,i,r,o){return Dh((o=Dh(Dh(n,t),Dh(i,o)))<<(r=r)|o>>>32-r,e)}function Nh(t,n,e,i,r,o,s){return Ih(n&e|~n&i,t,n,r,o,s)}function Fh(t,n,e,i,r,o,s){return Ih(n&i|e&~i,t,n,r,o,s)}function Uh(t,n,e,i,r,o,s){return Ih(n^e^i,t,n,r,o,s)}function Bh(t,n,e,i,r,o,s){return Ih(e^(n|~i),t,n,r,o,s)}function Gh(t,n){var e,i,r,o;t[n>>5]|=128<<n%32,t[14+(n+64>>>9<<4)]=n;for(var s=1732584193,a=-271733879,u=-1732584194,h=271733878,c=0;c<t.length;c+=16)s=Nh(e=s,i=a,r=u,o=h,t[c],7,-680876936),h=Nh(h,s,a,u,t[c+1],12,-389564586),u=Nh(u,h,s,a,t[c+2],17,606105819),a=Nh(a,u,h,s,t[c+3],22,-1044525330),s=Nh(s,a,u,h,t[c+4],7,-176418897),h=Nh(h,s,a,u,t[c+5],12,1200080426),u=Nh(u,h,s,a,t[c+6],17,-1473231341),a=Nh(a,u,h,s,t[c+7],22,-45705983),s=Nh(s,a,u,h,t[c+8],7,1770035416),h=Nh(h,s,a,u,t[c+9],12,-1958414417),u=Nh(u,h,s,a,t[c+10],17,-42063),a=Nh(a,u,h,s,t[c+11],22,-1990404162),s=Nh(s,a,u,h,t[c+12],7,1804603682),h=Nh(h,s,a,u,t[c+13],12,-40341101),u=Nh(u,h,s,a,t[c+14],17,-1502002290),s=Fh(s,a=Nh(a,u,h,s,t[c+15],22,1236535329),u,h,t[c+1],5,-165796510),h=Fh(h,s,a,u,t[c+6],9,-1069501632),u=Fh(u,h,s,a,t[c+11],14,643717713),a=Fh(a,u,h,s,t[c],20,-373897302),s=Fh(s,a,u,h,t[c+5],5,-701558691),h=Fh(h,s,a,u,t[c+10],9,38016083),u=Fh(u,h,s,a,t[c+15],14,-660478335),a=Fh(a,u,h,s,t[c+4],20,-405537848),s=Fh(s,a,u,h,t[c+9],5,568446438),h=Fh(h,s,a,u,t[c+14],9,-1019803690),u=Fh(u,h,s,a,t[c+3],14,-187363961),a=Fh(a,u,h,s,t[c+8],20,1163531501),s=Fh(s,a,u,h,t[c+13],5,-1444681467),h=Fh(h,s,a,u,t[c+2],9,-51403784),u=Fh(u,h,s,a,t[c+7],14,1735328473),s=Uh(s,a=Fh(a,u,h,s,t[c+12],20,-1926607734),u,h,t[c+5],4,-378558),h=Uh(h,s,a,u,t[c+8],11,-2022574463),u=Uh(u,h,s,a,t[c+11],16,1839030562),a=Uh(a,u,h,s,t[c+14],23,-35309556),s=Uh(s,a,u,h,t[c+1],4,-1530992060),h=Uh(h,s,a,u,t[c+4],11,1272893353),u=Uh(u,h,s,a,t[c+7],16,-155497632),a=Uh(a,u,h,s,t[c+10],23,-1094730640),s=Uh(s,a,u,h,t[c+13],4,681279174),h=Uh(h,s,a,u,t[c],11,-358537222),u=Uh(u,h,s,a,t[c+3],16,-722521979),a=Uh(a,u,h,s,t[c+6],23,76029189),s=Uh(s,a,u,h,t[c+9],4,-640364487),h=Uh(h,s,a,u,t[c+12],11,-421815835),u=Uh(u,h,s,a,t[c+15],16,530742520),s=Bh(s,a=Uh(a,u,h,s,t[c+2],23,-995338651),u,h,t[c],6,-198630844),h=Bh(h,s,a,u,t[c+7],10,1126891415),u=Bh(u,h,s,a,t[c+14],15,-1416354905),a=Bh(a,u,h,s,t[c+5],21,-57434055),s=Bh(s,a,u,h,t[c+12],6,1700485571),h=Bh(h,s,a,u,t[c+3],10,-1894986606),u=Bh(u,h,s,a,t[c+10],15,-1051523),a=Bh(a,u,h,s,t[c+1],21,-2054922799),s=Bh(s,a,u,h,t[c+8],6,1873313359),h=Bh(h,s,a,u,t[c+15],10,-30611744),u=Bh(u,h,s,a,t[c+6],15,-1560198380),a=Bh(a,u,h,s,t[c+13],21,1309151649),s=Bh(s,a,u,h,t[c+4],6,-145523070),h=Bh(h,s,a,u,t[c+11],10,-1120210379),u=Bh(u,h,s,a,t[c+2],15,718787259),a=Bh(a,u,h,s,t[c+9],21,-343485551),s=Dh(s,e),a=Dh(a,i),u=Dh(u,r),h=Dh(h,o);return[s,a,u,h]}function Hh(t){for(var n="",e=32*t.length,i=0;i<e;i+=8)n+=String.fromCharCode(t[i>>5]>>>i%32&255);return n}function Vh(t){var n=[];for(n[(t.length>>2)-1]=void 0,i=0;i<n.length;i+=1)n[i]=0;for(var e=8*t.length,i=0;i<e;i+=8)n[i>>5]|=(255&t.charCodeAt(i/8))<<i%32;return n}function zh(t){for(var n,e="0123456789abcdef",i="",r=0;r<t.length;r+=1)n=t.charCodeAt(r),i+=e.charAt(n>>>4&15)+e.charAt(15&n);return i}function Wh(t){return unescape(encodeURIComponent(t))}function Xh(t){return Hh(Gh(Vh(t=Wh(t)),8*t.length))}function Zh(t,n){return function(t,n){var e,i=Vh(t),r=[],o=[];for(r[15]=o[15]=void 0,16<i.length&&(i=Gh(i,8*t.length)),e=0;e<16;e+=1)r[e]=909522486^i[e],o[e]=1549556828^i[e];return n=Gh(r.concat(Vh(n)),512+8*n.length),Hh(Gh(o.concat(n),640))}(Wh(t),Wh(n))}function Yh(t,n,e){return n?e?Zh(n,t):zh(Zh(n,t)):e?Xh(t):zh(Xh(t))}var qh={encryption:function(t){return Yh(t)}};var Kh="0.0.0.0",mi=function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t)};Object.assign(mi.prototype,{Rr:function(t,n,e,i,r){"undefined"==typeof KjWzhWlSj||!KjWzhWlSj.license||!KjWzhWlSj.license?i&&i():"string"==typeof n&&0!=n.length?(n=Ph.decryption(n,"026685bf295f587b5dffc1f18d5dc27c"),e=qh.encryption(e),n=Ph.decryption(n,e),-1!==t.indexOf(n)?i&&i():r&&r()):r&&r()},Or:function(t,n,e,i){var r;-1===n.indexOf("")&&-1===n.indexOf("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")?(r=qh.encryption("fengmap.localhost:"+t.appName),r=Ph.decryption(t.key,r),-1!==n.indexOf(r)?this.Rr(n,t.license,t.buildingID,function(){e&&e()},function(){i&&i(Ni.LICENSE_ERROR)}):i&&i(Ni.NAME_KEY_ERROR)):e&&e()},Ar:function(t,n,e){var i=this;void 0===t.mapURL?(t.enableCollect&&this.kr(t),this.Cr(function(){new hh({method:"POST",url:Th.check,header:{"X-Requested-With":"XMLHttpRequest","Content-type":"application/json;charset=utf-8"},data:i.jr(t)}).cr(function(){n&&n()},function(t){e&&e(t)},function(){n&&n()})},function(){n&&n()})):n&&n()},Cr:function(t,n){new hh({method:"GET",url:Th.online}).cr(function(){t&&t()},function(){n&&n()},function(){n&&n()})},jr:function(t,n){var e=rh.a.global().location.host,i=e.indexOf(":");-1!==i&&(e=e.slice(0,i));i={mapId:t.buildingID,appName:t.appName};return n?i.keyValue=t.key:i.appKey=t.key,n?i.webUrl=e||Kh:i.webURL=e||Kh,i},kr:function(t){if("undefined"!=typeof navigator&&"undefined"!=typeof document){var n={};-1!==navigator.userAgent.indexOf("Opera")?n.userAgent="Opera":-1!==navigator.userAgent.indexOf("Firefox")?n.userAgent="FF":-1!==navigator.userAgent.indexOf("Chrome")?n.userAgent="Chrome":-1!==navigator.userAgent.indexOf("Safari")&&0===navigator.userAgent.indexOf("Chrome")?n.userAgent="Safari":-1!==navigator.userAgent.indexOf("compatible")&&-1!==navigator.userAgent.indexOf("MSIE")?n.userAgent="IE":-1!==navigator.userAgent.indexOf("Trident")&&(n.userAgent="Edge"),n.product="JS",n.sdkVersion=a+"."+h,n.appName=t.appName,n.appkey=t.key;var e=document.createElement("canvas").getContext("experimental-webgl"),t=e.getExtension("WEBGL_debug_renderer_info");n.gpu=t?e.getParameter(t.UNMASKED_RENDERER_WEBGL):null,n.os=navigator.platform;for(var i=!0,r=navigator.userAgent,o=["Android","iPhone","SymbianOS","Windows Phone","iPad","iPod"],s=0;s<o.length;s++)if(0<r.indexOf(o[s])){i=!1;break}n.device=i?"pc":"mobile",new hh({method:"POST",url:Th.collect,header:{"X-Requested-With":"XMLHttpRequest","Content-type":"application/json;charset=utf-8"},data:n}).cr()}}});var Jh=new mi;function Qh(t){return function(t){if(Array.isArray(t))return $h(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,n){if(t){if("string"==typeof t)return $h(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(e="Object"===e&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?$h(t,n):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $h(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}Ri=function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),this.Lr=new Sh,this.Pr=[]};Object.assign(Ri.prototype,{vt:function(){this.Pr.forEach(function(t){t.vt()}),this.Pr.length=0},Dr:function(t,n,e,i){var r;t.mapURL?(r=t.isPreview?t.isOutdoor?t.tile?t.mapURL+t.buildingID+"/separate/"+t.buildingID+n+".fmap":t.mapURL+t.buildingID+"/"+t.buildingID+n+".fmap":t.tile?t.mapURL+t.mapID+"/"+t.bid+"/"+t.buildingID+"/separate/"+t.buildingID+n+".fmap":t.mapURL+t.mapID+"/"+t.bid+"/"+t.buildingID+"/"+t.buildingID+n+".fmap":t.mapURLAbsolute?t.mapURL+t.buildingID+n+".fmap":t.isOutdoor?t.mapURL+t.buildingID+"/"+t.buildingID+n+".fmap":t.mapURL+t.mapID+"/"+t.bid+"/"+t.buildingID+"/"+t.buildingID+n+".fmap",e&&e(r)):(r={newFlag:"2",keyType:3,isSeparate:!1},t.isOutdoor||(r.bId=t.bid,r.rootMid=t.mapID),t=new hh({method:"POST",url:""===n?Th.download:Th.downloadTile+"/"+t.buildingID+n+".fmap",header:{"X-Requested-With":"XMLHttpRequest","Content-type":"application/json;charset=utf-8"},data:Object.assign(r,Jh.jr(t,!0))}),this.Pr.push(t),t.cr(function(t){e&&e(t.replace('"',"").replace('"',""))},function(t){i&&i(t)},function(t){i&&i(t)}))},Ir:function(e,i,r){var o=this;e.enableCollect=!0,Jh.Ar(e,function(){o.Dr(e,"",function(t){t=new hh({method:"GET",responseType:"arraybuffer",url:t});o.Pr.push(t),t.cr(function(t){var t=new Uint8Array(t),n=o.Lr.dr(t);e.isOutdoor?(t=[],n.keys&&0!==n.keys.length?t.push.apply(t,Qh(n.keys)):t.push(n.key),e.isPreview?i&&i(n):Jh.Or(e,t,function(){i&&i(n)},function(t){r&&r(t)})):i&&i(n)},function(t){r&&r(t===Ni.PATH_ERROR?Ni.MAP_ID_URL_ERROR:t)},function(t){r&&r(t)})},function(t){r&&r(t)})},function(t){r&&r(t)})},Nr:function(e,i,r){var o=this;e.enableCollect=!0,Jh.Ar(e,function(){o.Dr(e,".scene",function(t){t=new hh({method:"GET",responseType:"arraybuffer",url:t});o.Pr.push(t),t.cr(function(t){var t=new Uint8Array(t),n=o.Lr.pr(t);e.isOutdoor?(t=[],n.keys&&0!==n.keys.length?t.push.apply(t,Qh(n.keys)):t.push(n.key),e.isPreview?i&&i(n):Jh.Or(e,t,function(){i&&i(n)},function(t){r&&r(t)})):i&&i(n)},function(t){r&&r(t)},function(t){r&&r(t)})},function(t){r&&r(t)})},function(t){r&&r(t)})},Fr:function(t,n,e){var i=this;this.Dr(t,".gate",function(t){t=new hh({method:"GET",responseType:"arraybuffer",url:t});i.Pr.push(t),t.cr(function(t){t=new Uint8Array(t),t=i.Lr.gr(t);n&&n(t)},function(t){e&&e(t)},function(t){e&&e(t)})},function(t){e&&e(t)})},Ur:function(t,n,e,i){var r=this;this.Dr(t,".floor."+n+".geo",function(t){t=new hh({method:"GET",responseType:"arraybuffer",url:t});r.Pr.push(t),t.cr(function(t){t=new Uint8Array(t),t=r.Lr.br(t);e&&e(t)},function(t){i&&i(t)},function(t){i&&i(t)})},function(t){i&&i(t)})},Br:function(t,n,e,i){var r=this;this.Dr(t,".floor."+n+".biz",function(t){t=new hh({method:"GET",responseType:"arraybuffer",url:t});r.Pr.push(t),t.cr(function(t){t=new Uint8Array(t),t=r.Lr._r(t);e&&e(t)},function(t){i&&i(t)},function(t){i&&i(t)})},function(t){i&&i(t)})},Gr:function(t,n,e,i){var r=this;this.Dr(t,".floor."+n+".navi",function(t){t=new hh({method:"GET",responseType:"arraybuffer",url:t});r.Pr.push(t),t.cr(function(t){t=new Uint8Array(t),t=r.Lr.Sr(t);e&&e(t)},function(t){i&&i(t)})},function(t){i&&i(t)},function(t){i&&i(t)})},Hr:function(t,n,e,i){var r=this;this.Dr(t,".floor."+n+".drive.navi",function(t){t=new hh({method:"GET",responseType:"arraybuffer",url:t});r.Pr.push(t),t.cr(function(t){t=new Uint8Array(t),t=r.Lr.Sr(t);e&&e(t)},function(t){i&&i(t)})},function(t){i&&i(t)},function(t){i&&i(t)})},Vr:function(t,n,e,i){var r=this;this.Dr(t,".floor."+n+".accessible.navi",function(t){t=new hh({method:"GET",responseType:"arraybuffer",url:t});r.Pr.push(t),t.cr(function(t){t=new Uint8Array(t),t=r.Lr.Sr(t);e&&e(t)},function(t){i&&i(t)})},function(t){i&&i(t)},function(t){i&&i(t)})}});var tc=Ri;Ai=function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t)};Object.assign(Ai.prototype,{zr:function(t,n){for(var e=[],i=0,r=0;r<t.length;r++){var o=t[r].idxs;if("number"==typeof(o=o||t[r]))for(;i<o;)e.push({x:n[i],y:n[i+1]}),i+=2;else for(var s=0;s<o.length;s++)for(var a=o[s];i<a;)e.push({x:n[i],y:n[i+1]}),i+=2}return e},Wr:function(t,n){for(var e=[],i=0,r=0;r<t.length;r++){var o=t[r].idxs;if("number"==typeof(o=o||t[r])){for(var s=[];i<o;)s.push({x:n[i],y:n[i+1]}),i+=2;e.push(s)}else for(var a=0;a<o.length;a++){for(var u=o[a],h=[];i<u;)h.push({x:n[i],y:n[i+1]}),i+=2;e.push(h)}}return e},Xr:function(t,n){for(var e=[],i=[],r=0,o=0;o<t.length;o++){var s=t[o].idxs;if("number"==typeof(s=s||t[o]))for(;r<s;)e.push({x:n[r],y:n[r+1]}),r+=2;else for(var a=0;a<s.length;a++)if(0===a)for(var u=s[a];r<u;)e.push({x:n[r],y:n[r+1]}),r+=2;else{for(var h=[],c=s[a];r<c;)h.push({x:n[r],y:n[r+1]}),r+=2;i.push(h)}}var f=[];return f.push(e),f.push.apply(f,i),f},Zr:function(t){for(var n=[],e=t.length,i=0;i<e;i++){for(var r=t[i],o={x:this.Yr(r.x),y:this.Yr(r.y)},s=n.length,a=!1,u=0;u<s;u++){var h=n[u];if(h.x==o.x&&h.y==o.y){a=!0;break}}a||n.push(o)}return n},Yr:function(t){return+t.toFixed(2)}});var nc=new Ai;var ec=ec||{};ec.G1="MULTIPOLYGON(((",ec.G2="POINT(",ec.G3="MULTILINESTRING((",ec.GLEN1="MULTIPOLYGON(((".length,ec.GLEN2="POINT(".length,ec.GLEN3="MULTILINESTRING((".length;Di=function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t)};Object.assign(Di.prototype,{zr:function(t){var n=[];if(0!=t.indexOf(ec.G2))return[];t=t.substring(ec.GLEN2,t.length-1).split(" ");return n.push({x:parseFloat(t[0]),y:parseFloat(t[1])}),n},Wr:function(t){if(0!=t.indexOf(ec.G3))return[];for(var n=t.substring(ec.GLEN3,t.length-2).split(","),e=[],i=0;i<n.length;i++){var r=n[i].split(" ");e.push({x:parseFloat(r[0]),y:parseFloat(r[1])})}return[e]},Xr:function(t){var n=[],e=[];if(0!=t.indexOf(ec.G1))return[];for(var i=t.substring(ec.GLEN1,t.length-3).split(/\),\(/),r=0;r<i.length;r++){var o=i[r].split(/,/);if(0==r)for(var s=0;s<o.length;s++){var a=o[s].split(" ");n.push({x:parseFloat(a[0]),y:parseFloat(a[1])})}else{for(var u=[],h=0;h<o.length;h++){var c=o[h].split(" ");u.push({x:parseFloat(c[0]),y:parseFloat(c[1])})}e.push(u)}}t=[];return t.push(n),t.push.apply(t,e),t},Zr:function(t){for(var n=[],e=t.length,i=0;i<e;i++){for(var r=t[i],o={x:this.Yr(r.x),y:this.Yr(r.y)},s=n.length,a=!1,u=0;u<s;u++){var h=n[u];if(h.x==o.x&&h.y==o.y){a=!0;break}}a||n.push(o)}return n},Yr:function(t){return+t.toFixed(2)}});var ic=new Di,Gi={NONE:0,POINT:1,LINE:2,POLYGON:4,MULTIPOINT:8,MULTILINE:16,MULTIPOLYGON:32,GROUP:64,EXTENT:1024,EXTERNALMODEL:2048,MODEL:4096,FACILITY:8192,LABEL:16384,EXTENTGROUP:1<<20,EXTERNALMODELGROUP:1<<21,MODELGROUP:1<<22,FACILITYGROUP:1<<23,LABELGROUP:1<<24};Object.freeze(Gi);var rc=Gi,tr={STOP:0,PASS:1,PUSH:2};Object.freeze(tr);var oc=tr;function sc(t,n){var e;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(e=function(t,n){if(t){if("string"==typeof t)return ac(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(e="Object"===e&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?ac(t,n):void 0}}(t))||n&&t&&"number"==typeof t.length){e&&(t=e);var i=0,n=function(){};return{s:n,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},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,o=!0,s=!1;return{s:function(){e=t[Symbol.iterator]()},n:function(){var t=e.next();return o=t.done,t},e:function(t){s=!0,r=t},f:function(){try{o||null==e.return||e.return()}finally{if(s)throw r}}}}function ac(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}function uc(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}ir=function(){function n(t){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,n),this.Un=rc.GROUP,this.K=new Map,this.Yt=-1,this.qr=null,this.Gn=null,Object.assign(this,t)}var t,e,i;return t=n,(e=[{key:"getType",value:function(){return this.Un}},{key:"getCoordinates",value:function(){return this.qr}},{key:"getBound",value:function(){return this.Gn||this.Kr(),this.Gn}},{key:"getChildren",value:function(){return this.K}}])&&uc(t.prototype,e),i&&uc(t,i),n}();Object.assign(ir.prototype,{vt:function(){var t,n=sc(this.K.values());try{for(n.s();!(t=n.n()).done;){var e=t.value;e.vt&&e.vt()}}catch(t){n.e(t)}finally{n.f()}this.K.clear()},Jr:function(n){var t=n.Qr(this);t==oc.PASS?this.K.forEach(function(t){t.Jr(n)}):t==oc.PUSH&&n.$r.push(this)},Kr:function(){var n=this;this.Gn=new rr,0!=this.K.size&&this.K.forEach(function(t){n.Gn.In(t.getBound())})}});var hc=ir;function cc(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}sr=function(){function n(t){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,n),this.Yt=t.eid,this.Un=rc.POINT,this.qr=null,this.Gn=null,Object.assign(this,t)}var t,e,i;return t=n,(e=[{key:"getType",value:function(){return this.Un}},{key:"getCoordinates",value:function(){return this.qr}},{key:"getBound",value:function(){return this.Gn||this.Kr(),this.Gn}}])&&cc(t.prototype,e),i&&cc(t,i),n}();Object.assign(sr.prototype,{Kr:function(){this.Gn=new rr,this.qr&&this.Gn.Nn(this.qr)},Jr:function(t){t.Qr(this)==oc.PUSH&&t.$r.push(this)}});var fc=sr;function lc(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}dr=function(){function n(t){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,n),this.Yt=t.eid,this.Un=rc.POLYGON,this.Wt=null,this.qr=null,this.Gn=null,Object.assign(this,t)}var t,e,i;return t=n,(e=[{key:"getType",value:function(){return this.Un}},{key:"getCenter",value:function(){return this.Wt}},{key:"getCoordinates",value:function(){return this.qr}},{key:"getBound",value:function(){return this.Gn||this.Kr(),this.Gn}}])&&lc(t.prototype,e),i&&lc(t,i),n}();Object.assign(dr.prototype,{Kr:function(){var n=this;this.Gn=new rr,this.qr&&this.qr.forEach(function(t){n.Gn.Nn(t)})},Jr:function(t){t.Qr(this)==oc.PUSH&&t.$r.push(this)}});var dc=dr;function vc(t,n){if(null==t)return{};var e,i=function(t,n){if(null==t)return{};var e,i,r={},o=Object.keys(t);for(i=0;i<o.length;i++)e=o[i],0<=n.indexOf(e)||(r[e]=t[e]);return r}(t,n);if(Object.getOwnPropertySymbols)for(var r=Object.getOwnPropertySymbols(t),o=0;o<r.length;o++)e=r[o],0<=n.indexOf(e)||Object.prototype.propertyIsEnumerable.call(t,e)&&(i[e]=t[e]);return i}_r=function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),this.to=[1,2,3,4],this.no=[6,7,9],this.eo=[31,32],this.io=new Map,this.io.set(31,rc.EXTENTGROUP),this.io.set(32,rc.MODELGROUP),this.io.set(6,rc.FACILITYGROUP),this.io.set(7,rc.LABELGROUP),this.io.set(9,rc.EXTERNALMODELGROUP),this.ro=new Map,this.ro.set(31,["extentLayer",null]),this.ro.set(32,["modelLayer","labelLayer"]),this.ro.set(6,["poiLayer",null]),this.ro.set(7,["labelLayer",null]),this.ro.set(9,["externalModelLayer",null]),this.Lr=new Sh};Object.assign(_r.prototype,{oo:function(t){if(!t)return null;var n=t.scene;return this.so(n,t)},so:function(t,e){var i=this,n=t.layerGroups,r=vc(t,["layerGroups"]),o=t.fileVer,s=new hc(r);return n.forEach(function(t){var n=i.ao(t,e,o);s.K.set(t.gid,n)}),s},ao:function(t,n,e){var i=this,r=t.layers,o=vc(t,["layers"]),s=new hc(o),a=n&&n.floors?n.floors.get(t.gid).geo[0]:null,u=n&&n.floors?n.floors.get(t.gid).biz[0]:null;return r.forEach(function(t){6===t.ltype&&-1!==t.lname.indexOf("storelabel")&&(t.ltype=7);var n=i.uo(t,a,u,e);null!==n&&s.K.set(i.io.get(t.ltype),n)}),this.ho(s),s},ho:function(t){var n=Array.from(t.K);n.sort(function(t,n){return t[0]-n[0]}),t.K=new Map(n)},uo:function(t,n,e,i){if(-1!==this.to.indexOf(t.ltype))return null;if(!this.ro.get(t.ltype))return null;var r=new hc(t);return this.co(r,n,e,i),r&&(r.Un=this.io.get(t.ltype)),r},co:function(t,n,e,i){if(t){var r=this.ro.get(t.ltype);if(r){var o=n?n[r[0]]:[],s=e?e[r[0]]:[];switch(t.ltype){case 6:this.fo(t,o,s,i,rc.FACILITY);break;case 7:this.fo(t,o,s,i,rc.LABEL);break;case 9:this.fo(t,o,s,i,rc.EXTERNALMODEL);break;case 31:this.do(t,o,s,i,rc.EXTENT,null);break;case 32:this.do(t,o,s,i,rc.MODEL,n?n[r[1]]:null)}}}},fo:function(t,n,e,i,r){for(var o=0;o<n.length;o++){var s=this.vo(n[o],e[o],i);s.Un=r,t.K.set(n[o].eid,s)}},vo:function(t,n,e){n=Object.assign({},n,{area:t.area,eid:t.eid,height:t.height}),n=new fc(n);return t.coordinates?n.qr=t.coordinates:(n.qr=1==e?ic.zr(t.geo):nc.zr(t.idxs,t.pts),t.coordinates=n.qr),n},do:function(t,n,e,i,r,o){for(var s=0;s<n.length;s++){var a=this.po(n[s],e[s],i,o?o[s]:null);a.Un=r,t.K.set(n[s].eid,a)}},po:function(t,n,e,i){n=Object.assign({},n,{area:t.area,eid:t.eid,height:t.height}),n=new dc(n);return n.qr=1===e?ic.Xr(t.geo):nc.Xr(t.idxs,t.pts),i&&(i.coordinates||(i.coordinates=1===e?ic.zr(i.geo):nc.zr(i.idxs,i.pts)),n.Wt=i.coordinates[0]),n}});var pc=_r,mc={NONE_RODE_NETWORK:1,WALK_RODE_NETWORK:2,DRIVE_RODE_NETWORK:4,ACCESSIBLE_RODE_NETWORK:8};Tu=function t(){var n=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),this.mo=n.disposeCallback,this.go=!1,this.yo=!1,this.bo=void 0!==n.enable&&n.enable,this.name=void 0!==n.name?n.name:"",this.wo=new Map,this._o=n.mapCreateTime};Object.assign(Tu.prototype,{xo:function(){this.bo&&(this.yo||this.go&&0===this.wo.size&&(this.mo({mapCreateTime:this._o}),this.yo=!0))},Mo:function(t){this.bo&&(this.go=t,this.xo())},So:function(t){this.bo&&(this.wo.has(t)&&console.warn("添加的引用已经存在..."),this.wo.set(t,0))},Eo:function(t){this.bo&&(this.wo.has(t)?(this.wo.delete(t),this.xo()):console.warn("移除的引用不存在"))}});var gc=Tu;function yc(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}Ru=function(){function n(t){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,n),this.ie=new Map,this.To=new Map,this.ur=new Map,this.Lo=new Map,this.Ro=new Map,this.Oo=new Map,this.Ao=[2,3],this.ko=!1,this.Lr=new Sh,this.Co=new pc,this.jo=new tc,this.Po=null,this.Bi=this.Bi.bind(this),this.Do=new gc({disposeCallback:this.Bi,enable:!0,name:"DataManager",mapCreateTime:(null==t?void 0:t.mapCreateTime)||(new Date).getTime()})}var t,e,i;return t=n,(e=[{key:"load",value:function(t,n){this.Io(t,n)}},{key:"loadWhole",value:function(t,n){this.No(t,n)}},{key:"getDecode",value:function(t){t=void 0!==t.buildingID?t.buildingID:t.mapID;return this.Fo({buildingID:t})}},{key:"getData",value:function(t){t=void 0!==t.buildingID?t.buildingID:t.mapID;return this.ie.get(t)}},{key:"setCache",value:function(t){this.ie=t[0],this.To=t[1]}},{key:"getCache",value:function(){return[this.ie,this.To]}}])&&yc(t.prototype,e),i&&yc(t,i),n}();Object.assign(Ru.prototype,{vt:function(t){this.Po=t,this.jo.vt(),this.Do.Mo(!0)},Bi:function(){this.ie.clear(),this.ie=null,this.To.clear(),this.To=null,this.ur.clear(),this.ur=null,this.Lo.clear(),this.Lo=null,this.Ro.clear(),this.Ro=null,this.Oo.clear(),this.Oo=null,this.Po&&this.Po({name:"DataManager"})},Uo:function(t){this.Lo.set(t.buildingID+t.uuid,null),this.Ro.set(t.buildingID+t.uuid,null),this.Oo.set(t.buildingID+t.uuid,0)},Io:function(a,u){var h=this;this.Uo(a),this.Nr(a,function(n,t){u&&u(n,t);var s=h.Bo(a),t=a.loadNavi&&s.buildings&&0<s.buildings.length;h.Fr(a,t,function(t,n){u&&u(t,n);var e=void 0!==a.level?a.level:parseInt(s.defGid);h.Go(a,e,u);for(var i=a.visibleLevels||s.levels,r=0;r<i.length;r++)i[r]!==e&&(s.levels.indexOf(i[r])<0||h.Go(a,i[r],u));if(a.preLoad)for(var o=0;o<s.levels.length;o++)s.levels[o]!==e&&-1===i.indexOf(s.levels[o])&&h.Go(a,s.levels[o],u)},function(t){u&&u(n,t)})},function(t,n){u&&u(t,n)})},Fr:function(e,t,i,r){var o,s=this;t?(t=this.Ho(e))?i&&i("gate",t):(o="_sendGate"+Mt.generateUUID(),this.Do.So(o),this.jo.Fr(e,function(t){s.To.get(e.buildingID).gate=t,i&&i("gate",t),s.Do.Eo(o)},function(t){var n;e.navigationData?((n=s.To.get(e.buildingID)).gate=e.navigationData,i&&i("gate",n.gate)):r("error",t),s.Do.Eo(o)})):i&&i("gate",null)},Nr:function(e,i,n){var r,o=this,t=this.Bo(e);t?(i&&i("scene",t),e.justDecode||(t=this.ie.get(e.buildingID),i&&i("building",t))):(r="_sendScene"+Mt.generateUUID(),this.Do.So(r),this.jo.Nr(e,function(t){var n;e.isOutdoor&&(n=t.fileVer,t.buildings&&1<n&&t.buildings.forEach(function(n){n.floors&&(n.levelChart=[],n.fids=[],n.floors.forEach(function(t){t.qr=nc.Xr(t.idxs,t.pts),t.pgid&&n.levelChart.push(t.pgid,t.gid),t.baseLevel&&(n.minlevel=t.minlevel,n.maxlevel=t.maxlevel),t.fids&&n.fids.push.apply(n.fids,t.fids)}))})),o.To.set(e.buildingID,{scene:t}),i&&i("scene",t),e.justDecode||(t=o.Co.so(t),o.ie.set(e.buildingID,t),i&&i("building",t)),o.Do.Eo(r)},function(t){n&&n("error",t===Ni.PATH_ERROR?Ni.MAP_ID_URL_ERROR:t),o.Do.Eo(r)}))},Go:function(t,n,e,i){var r=this.Lo.get(t.buildingID+t.uuid);r||this.Lo.set(t.buildingID+t.uuid,r=[]),i?r.unshift(n):r.push(n),this.ko&&1!==r.length||this.Vo(t,e)},Vo:function(i,r){var o=this,s=this.Bo(i);if(s){var a=this.Lo.get(i.buildingID+i.uuid);if(a&&0!==a.length){var t=this.Ro.get(i.buildingID+i.uuid);t||this.Ro.set(i.buildingID+i.uuid,t=[]);var u=a[0];if(-1!==t.indexOf(u))return a.splice(a.indexOf(u),1),void this.Vo(i,r);t.push(u),this.zo(i,u,function(t,n){var e=o.Oo.get(i.buildingID+i.uuid);"layerGroup"===t&&(r&&r(t,n),o.Oo.set(i.buildingID+i.uuid,++e),e===s.layerGroups.length&&r&&r("decode",o.Fo(i)),a.splice(a.indexOf(u),1),o.Vo(i,r)),"layer"===t&&r&&r(t,n),"floor"===t&&(r&&r(t,n),e===s.layerGroups.length&&r&&r("complete",o.Wo(i)))},function(t,n){r&&r(t,n)})}}},zo:function(r,o,s,n){var t,a,u,h,c,e,i=this,f=this.Bo(r),l=this.Xo(f,o);l?(t=l.gname,l=l.naviType||0,a=this.Ao[0],u=0,h=new Map,c=r.merge,e=function(n){var e,i,t;a===++u&&(e=h.get("geo"),i=h.get("biz"),c&&c.merge(o,e,i,f.fileVer),s&&s("layerGroup",h),r.justDecode||((t=n.Xt(r,o)).K.forEach(function(t){n.Co.co(t,e,i,f.fileVer),s&&s("layer",t)}),s&&s("floor",t)))},r.loadNavi&&((0!=(l&mc.WALK_RODE_NETWORK)||f.fileVer<3)&&(a++,this.Gr(r,o,t,function(t,n){h.set(t,n),s&&s(t,n),e(i)},function(t){n&&n(t)})),0!=(l&mc.DRIVE_RODE_NETWORK)&&(a++,this.Hr(r,o,t,function(t,n){h.set(t,n),s&&s(t,n),e(i)},function(t){n&&n(t)})),0!=(l&mc.ACCESSIBLE_RODE_NETWORK)&&(a++,this.Vr(r,o,t,function(t,n){h.set(t,n),s&&s(t,n),e(i)},function(t){n&&n(t)}))),this.Ur(r,o,t,function(t,n){h.set(t,n),s&&s(t,n),e(i)},function(t){n&&n(t)}),this.Br(r,o,t,function(t,n){h.set(t,n),s&&s(t,n),e(i)},function(t){n&&n(t)})):n&&n("error",Ni.DEFAULT_LEVEL_ERROR)},Ur:function(n,e,t,i,r){var o,s=this,a=this.Zo(n,e,"geo");a?i&&i("geo",a):(o="_sendFloorGeo"+Mt.generateUUID(),this.Do.So(o),this.jo.Ur(n,t,function(t){s.Yo(n,e,"geo",t),i&&i("geo",t),s.Do.Eo(o)},function(t){r&&r("error",t),s.Do.Eo(o)}))},Br:function(n,e,t,i,r){var o,s=this,a=this.Zo(n,e,"biz");a?i&&i("biz",a):(o="_sendFloorBiz"+Mt.generateUUID(),this.Do.So(o),this.jo.Br(n,t,function(t){s.Yo(n,e,"biz",t),i&&i("biz",t),s.Do.Eo(o)},function(t){r&&r("error",t),s.Do.Eo(o)}))},Gr:function(n,e,t,i,r){var o,s=this,a=this.Zo(n,e,"navi");a?i&&i("navi",a):(o="_sendFloorNavi"+Mt.generateUUID(),this.Do.So(o),this.jo.Gr(n,t,function(t){s.Yo(n,e,"navi",t),i&&i("navi",t),s.Do.Eo(o)},function(t){r&&r("error",t),s.Do.Eo(o)}))},Hr:function(n,e,t,i,r){var o,s=this,a=this.Zo(n,e,"drive_navi");a?i&&i("drive_navi",a):(o="_sendFloorNaviDrive"+Mt.generateUUID(),this.Do.So(o),this.jo.Hr(n,t,function(t){s.Yo(n,e,"drive_navi",t),i&&i("drive_navi",t),s.Do.Eo(o)},function(t){r&&r("error",t),s.Do.Eo(o)}))},Vr:function(n,e,t,i,r){var o,s=this,a=this.Zo(n,e,"accessible_navi");a?i&&i("drive_navi",a):(o="_sendFloorNaviAccessible"+Mt.generateUUID(),this.Do.So(o),this.jo.Vr(n,t,function(t){s.Yo(n,e,"accessible_navi",t),i&&i("accessible_navi",t),s.Do.Eo(o)},function(t){r&&r("error",t),s.Do.Eo(o)}))},No:function(t,e){this.Ir(t,function(t,n){e&&e(t,n)},function(t,n){e&&e(t,n)})},Ir:function(n,e,i){var r,o=this,s=this.Fo(n);s?e&&e("decode",s):(r="_sendWhole"+Mt.generateUUID(),this.Do.So(r),this.jo.Ir(n,function(t){o.qo(n,t),s=o.Fo(n),e&&e("decode",s),n.justDecode||(t=o.Co.oo(s),o.ie.set(n.buildingID,t),e&&e("complete",t)),o.Do.Eo(r)},function(t){i&&i("error",t),o.Do.Eo(r)}))},Wo:function(t){if(this.ie){t=this.ie.get(t.buildingID);return t||null}},Xt:function(t,n){t=this.ie.get(t.buildingID);return t?t.K.get(n):null},qo:function(t,n){var e,i={scene:null,floors:new Map},r=this.Lr.vr(n);t.isOutdoor&&(e=r.fileVer,r.buildings&&1<e&&r.buildings.forEach(function(n){n.floors&&(n.levelChart=[],n.fids=[],n.floors.forEach(function(t){t.qr=nc.Xr(t.idxs,t.pts),t.pgid&&n.levelChart.push(t.pgid,t.gid),t.baseLevel&&(n.minlevel=t.minlevel,n.maxlevel=t.maxlevel),t.fids&&n.fids.push.apply(n.fids,t.fids)}))})),i.scene=r,i.gate=this.Lr.mr(n);for(var o=0;o<r.layerGroups.length;o++){var s=r.layerGroups[o],a=this.Lr.yr(n,s.gid),u=this.Lr.wr(n,s.gid),h=this.Lr.Mr(n,s.gid),c=this.Lr.Er(n,s.gid),f=this.Lr.Tr(n,s.gid);t.merge&&t.merge.merge(s.gid,a,u,r.fileVer);var l=new Map;l.set("geo",a),l.set("biz",u),l.set("navi",h),l.set("drive_navi",c),l.set("accessible_navi",f),i.floors.set(s.gid,l)}this.To.set(t.buildingID,i)},Fo:function(t){var n=this.To.get(t.buildingID);if(!n)return null;for(var e=n.scene,n=n.gate,i=new Map,n={scene:e,floors:i,gate:n},r=0;r<e.layerGroups.length;r++){var o=e.layerGroups[r],s=o.gid,a={gid:s,gname:o.gname,level:s,geo:[],biz:[],navi:[],naviDrive:[],naviAccessible:[]};a.geo.push(this.Zo(t,s,"geo")),a.biz.push(this.Zo(t,s,"biz"));var u=this.Zo(t,s,"navi");u&&a.navi.push(u);u=this.Zo(t,s,"drive_navi");u&&a.naviDrive.push(u);s=this.Zo(t,s,"accessible_navi");s&&a.naviAccessible.push(s),i.set(o.gid,a)}return n},Bo:function(t){t=this.To.get(t.buildingID);return t?t.scene:null},Ho:function(t){t=this.To.get(t.buildingID);return t?t.gate:null},Yo:function(t,n,e,i){var r=this.To.get(t.buildingID);r&&((t=r.floors)||(t=new Map,r.floors=t),(r=t.get(n))||(r=new Map,t.set(n,r)),r.set(e,i))},Zo:function(t,n,e){t=this.To.get(t.buildingID);if(!t)return null;t=t.floors;if(!t)return null;n=t.get(n);return n?n.get(e):null},Xo:function(t,n){if(null==t)return null;for(var e=t.layerGroups,i=0;i<e.length;i++)if(e[i].gid==n)return e[i];return null}});var bc=Ru;Tr.fmcommon={diffuse:{value:new _i(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new M}},Tr.line={lineWidth:{value:1},resolution:{value:new fi(1,1)},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1},mmap:{value:null},offset:{value:new fi(0,0)},repeat:{value:new fi(1,1)},miny:{value:0},pcolor:{value:new _i(11447982)}},ts.line={uniforms:go.merge([Tr.fmcommon,Tr.line]),vertexShader:"\n\t\t#include <common>\n\t\t#include <color_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\t\t\n\t\t#include <logdepthbuf_pars_vertex>\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\t\t\t\n\t\t\t#include <logdepthbuf_vertex>\n\n\t\t\tvec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation\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\t\tuniform float miny;\n\t\tuniform vec3 pcolor;\n\t\t\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\n\t\t\tuniform sampler2D mmap;\n\n\t\tvarying float vLineDistance;\n\n\t\t#include <common>\n\t\t#include <color_pars_fragment>\n\n\t\tvarying float uvScale;\n\t\tvarying vec2 vUv;\n\t\tvarying vec2 vUv2;\n\t\t\n\t\t#include <logdepthbuf_pars_fragment>\n\n\t\tvoid main() {\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\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t\t\t\n\t\t\t#include <logdepthbuf_fragment>\n\t\n\t\t\t#ifdef USE_MMAP\n\t\t\t\n\t\t\t\tif(vUv2.y >= miny && miny != 1.0){\t\t\t\n\t\t\t\t vec4 texColor = texture2D( mmap, vUv2 * repeat + offset );\n\t\t\t\t\tdiffuseColor = vec4(texColor.xyz,min(texColor.w, opacity));\n\t\t\t\t}else{\n\t\t\t\t\tdiffuseColor = vec4(pcolor,opacity);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t#endif\n\n\t\t\tgl_FragColor = diffuseColor;\n\n\t\t\t#include <encodings_fragment>\n\n\t\t}\n\t\t"};eh=function(t){wo.call(this,{type:"FMLineMaterial",uniforms:go.clone(ts.line.uniforms),vertexShader:ts.line.vertexShader,fragmentShader:ts.line.fragmentShader}),this.dashed=!1,Object.defineProperties(this,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(t){this.uniforms.diffuse.value.copy(t)}},lineWidth:{enumerable:!0,get:function(){return this.uniforms.lineWidth.value},set:function(t){this.uniforms.lineWidth.value=t}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(t){this.uniforms.dashScale.value=t}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(t){this.uniforms.dashSize.value=t}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(t){this.uniforms.gapSize.value=t}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(t){this.uniforms.resolution.value.copy(t)}},pcolor:{enumerable:!0,get:function(){return this.uniforms.pcolor.value},set:function(t){this.uniforms.pcolor.value.copy(t)}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(t){this.uniforms.opacity.value=t}}}),this.setValues(t)};((eh.prototype=Object.create(wo.prototype)).constructor=eh).prototype.isFMLineMaterial=!0,eh.prototype.copy=function(t){return wo.prototype.copy.call(this,t),this.color.copy(t.color),this.lineWidth=t.lineWidth,this.resolution=t.resolution,this};var wc=eh;function _c(t){vo.call(this),this.type="SpriteMaterial",this.color=new _i(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.setValues(t)}function xc(t){vo.call(this),this.type="LineBasicMaterial",this.color=new _i(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.setValues(t)}function Mc(t){wo.call(this,t),this.type="RawShaderMaterial"}((_c.prototype=Object.create(vo.prototype)).constructor=_c).prototype.isSpriteMaterial=!0,_c.prototype.copy=function(t){return vo.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.rotation=t.rotation,this.sizeAttenuation=t.sizeAttenuation,this},((xc.prototype=Object.create(vo.prototype)).constructor=xc).prototype.isLineBasicMaterial=!0,xc.prototype.copy=function(t){return vo.prototype.copy.call(this,t),this.color.copy(t.color),this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this},((Mc.prototype=Object.create(wo.prototype)).constructor=Mc).prototype.isRawShaderMaterial=!0;uh=function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),this.Ko=!1,this.Jo=new Map,this.Qo=new Map};Object.assign(uh.prototype,{$o:function(t,n){this.Qo.has(t)||this.Qo.set(t,new Set),this.Qo.get(t).add(n)},or:function(){this.Jo.clear(),this.Jo=null,this.Qo.clear(),this.Qo=null}});var Sc=uh;function Ec(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var Tc=function(){function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t)}var n,e,i;return n=t,i=[{key:"getBrowser",value:function(){var t=navigator.userAgent,n=-1<t.indexOf("Opera"),e=-1<t.indexOf("compatible")&&-1<t.indexOf("MSIE")&&!n,i=-1<t.indexOf("Edge"),r=-1<t.indexOf("Firefox"),o=-1<t.indexOf("Safari")&&-1===t.indexOf("Chrome"),s=-1<t.indexOf("Chrome")&&-1<t.indexOf("Safari");if(e){new RegExp("MSIE (\\d+\\.\\d+);").test(t);t=parseFloat(RegExp.$1);return 7===t?"IE7":8===t?"IE8":9===t?"IE9":10===t?"IE10":11===t?"IE11":"IE"}return n?"Opera":i?"Edge":r?"FF":o?"Safari":s?"Chrome":void 0}}],(e=null)&&Ec(n.prototype,e),i&&Ec(n,i),t}().getBrowser();function Lc(t){return(Lc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Rc(t,n){return(Rc=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Oc(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Ac(e);return t=i?(t=Ac(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Lc(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function Ac(t){return(Ac=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}ch=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Rc(t,n)}(e,Sc);var n=Oc(e);function e(){var t;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,e),(t=n.call(this)).ts=0,t.ns=0,t.es=new Map,t}return e}();Object.assign(ch.prototype,{rs:function(t,n){var e;return this.Jo.has(t)?(e=this.Jo.get(t),n&&(e.isComplete?e.isError?n(null):n(e):this.$o(t,n))):e=this.ss(t,n),e},ss:function(n,t){var e=this;this.ts++;var i=new Image;return i.crossOrigin="Anonymous",i.onload="IE11"===Tc?new function(){this.ns++,i.isComplete=!0,e.as(n,i)}:function(){e.ns++,i.isComplete=!0,e.as(n,i)},i.onerror=function(t){e.ns++,i.isComplete=!0,i.isError=!0,e.as(n,null)},i.src=n,i.isComplete=!1,this.Jo.set(n,i),t&&this.$o(n,t),i},as:function(t,i){this.Qo.has(t)&&(this.Qo.get(t).forEach(function(t,n,e){n(i),e.delete(t)}),this.Qo.delete(t)),0<this.es.size&&this.ts===this.ns&&this.es.forEach(function(t,n){t(n)})},or:function(){this.Jo.clear(),this.Qo.clear()}});var kc=new ch,Cc={Left:0,Center:2,Right:4};function jc(t,n){var e;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(e=function(t,n){if(t){if("string"==typeof t)return Pc(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(e="Object"===e&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Pc(t,n):void 0}}(t))||n&&t&&"number"==typeof t.length){e&&(t=e);var i=0,n=function(){};return{s:n,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},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,o=!0,s=!1;return{s:function(){e=t[Symbol.iterator]()},n:function(){var t=e.next();return o=t.done,t},e:function(t){s=!0,r=t},f:function(){try{o||null==e.return||e.return()}finally{if(s)throw r}}}}function Pc(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}mh=function t(n){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),this.xe=n};Object.assign(mh.prototype,{us:function(t,n,e,i,r){var o=r,s={x:r.x+n,y:r.y},a={x:r.x,y:r.y+e},u={x:r.x+n,y:r.y+e},h={x:o.x+i,y:o.y},c={x:s.x-i,y:s.y},f={x:s.x,y:s.y+i},l={x:u.x,y:u.y-i},d={x:u.x-i,y:u.y},n={x:a.x+i,y:a.y},r={x:a.x,y:a.y-i},e={x:o.x,y:o.y+i};t.beginPath(),t.moveTo(h.x,h.y),t.lineTo(c.x,c.y),t.arcTo(s.x,s.y,f.x,f.y,i),t.lineTo(l.x,l.y),t.arcTo(u.x,u.y,d.x,d.y,i),t.lineTo(n.x,n.y),t.arcTo(a.x,a.y,r.x,r.y,i),t.lineTo(e.x,e.y),t.arcTo(o.x,o.y,h.x,h.y,i),t.closePath()},hs:function(t,n,e,i){var r,o,s=1,a=void 0!==i.needSize&&i.needSize,u=2*e.fontsize*1.2,h=void 0!==e.fontWeight?e.fontWeight:400,c=this.cs(i.family,e.fontFamily),f=0,l=0,d="".concat(h," ").concat(u,"px ").concat(c),v=void 0!==e.space?2*e.space:4,p=0;void 0!==e.plateSize&&(p=(e.plateSize-e.fontsize)/2*2);var m,p=Math.max(p,6),g=u/3,y=0,b=[],w=document.createElement("canvas"),_=w.getContext("2d");_.font=d,_.textBaseline="Alphabetic";var x=1.2*e.fontsize*2;void 0!==e.imageSize&&(x=1.2*e.imageSize*2),n&&0!=x||(v=x=0);h=-1<t.indexOf("%rn%");if(h){var M,S=jc(b=t.split("%rn%"));try{for(S.s();!(M=S.n()).done;){var E=M.value,f=Math.max(_.measureText(E).width+4,f);l+=u}}catch(t){S.e(t)}finally{S.f()}l+=4*b.length}else f=_.measureText(t).width+4,l=4+u;r=Math.ceil(l)+2*p,m=0+x+v+(o=Math.ceil(f)+2*p),c=0+Math.max(r,x),e.plateStrokeColor&&(m+=4,c+=4),y=h?l/b.length/2+g+p:c/2+g,h&&(s=c/(0+u+2*p)),w.width=m,w.height=c,w.style.width=m+"px",w.style.height=c+"px",w.spriteScale=s,_.font=d,_.clearRect(0,0,w.width,w.height),(e.plateColor||e.plateStrokeColor)&&(e.plateColor&&(_.fillStyle=e.plateColor),_.lineWidth=2,this.us(_,o,r,10,{x:x+0+v,y:c/2-r/2}),e.plateColor&&_.fill(),e.plateStrokeColor&&(_.strokeStyle=e.plateStrokeColor,_.stroke()),_.beginPath()),n&&_.drawImage(n,0,(c-x)/2,x,x);var T=x+0+v+p+2;_.lineWidth=4*(void 0!==e.strokeWidth?e.strokeWidth:1);v=1;if(void 0!==e.strokeWidth&&(v=parseFloat(e.strokeWidth)),e.strokeColor&&0!==v)if(_.strokeStyle=e.strokeColor,h)for(var L=y,R=0;R<b.length;R++)R&&(L+=4+u),n?_.strokeText(b[R],T,L):i.textAlign===Cc.Left?(_.textAlign="left",_.strokeText(b[R],0,L)):i.textAlign===Cc.Right?(_.textAlign="right",_.strokeText(b[R],m,L)):(_.textAlign="center",_.strokeText(b[R],m/2,L));else n?_.strokeText(t,T,y):i.textAlign===Cc.Left?_.strokeText(t,0,y):i.textAlign===Cc.Right?(_.textAlign="right",_.strokeText(t,m,y)):(_.textAlign="center",_.strokeText(t,m/2,y));if(_.fillStyle=e.fillColor,h)for(var O=y,A=0;A<b.length;A++)A&&(O+=4+u),n?_.fillText(b[A],T,O):i.textAlign===Cc.Left?(_.textAlign="left",_.fillText(b[A],0,O)):i.textAlign===Cc.Right?(_.textAlign="right",_.fillText(b[A],m,O)):(_.textAlign="center",_.fillText(b[A],m/2,O));else n?_.fillText(t,T,y):i.textAlign===Cc.Left?(_.textAlign="left",_.fillText(t,0,y)):i.textAlign===Cc.Right?(_.textAlign="right",_.fillText(t,m,y)):(_.textAlign="center",_.fillText(t,m/2,y));y=0;return a&&(y=h?e.fontsize+(4*(b.length-1)+0+p)/b.length:e.fontsize+0+p,w.size=y),w},ls:function(t){var n=t.width,e=t.height,i=t.arrowWidth||10,r=document.createElement("canvas"),o=r.getContext("2d");r.width=n,r.height=e,r.style.width=n+"px",r.style.height=e+"px",o.fillStyle=t.godEdgeColor,o.fillRect(0,0,n,e);var s=n*(1-t.godEdgePercent);o.fillStyle=t.godColor,o.fillRect((n-s)/2,0,s,e),o.fillStyle="#ffffff",o.shadowOffsetX=-2,o.shadowOffsetY=2,o.shadowBlur=4,o.shadowColor="rgba(0,0,0,0.5)";var a=e*t.godArrowPercent,s=s*t.godArrowWidthPercent,n=n/2-s/2,e=e/2+a/2;return o.beginPath(),o.moveTo(n,e),o.lineTo(n,e+i),o.lineTo(n+s/2,e-a+i),o.lineTo(n+s,e+i),o.lineTo(n+s,e),o.lineTo(n+s/2,e-a),o.closePath(),o.fillStyle=t.godArrowColor,o.fill(),r},ds:function(t){var n=t.width,e=t.height,i=document.createElement("canvas"),r=i.getContext("2d");i.width=n,i.height=e,i.style.width=n+"px",i.style.height=e+"px";var o=new M;o.set(Math.cos(Math.PI/2),-Math.sin(Math.PI/2),+n/2,Math.sin(Math.PI/2),Math.cos(Math.PI/2),+e/2,0,0,1);var s=new M;s.set(1,0,-n/2,0,1,-e/2,0,0,1),o.multiply(s);e=o.elements;r.transform(e[0],e[3],e[1],e[4],e[2],e[6]);s=t.height*t.arrowHeightPercent,o=(1-t.arrowHeightPercent)*t.height/2,e=t.width*(t.arrowWidthPercent-t.arrowPercent);return r.beginPath(),r.moveTo(0,o),r.lineTo(e,o),r.lineTo(t.width*t.arrowWidthPercent,o+s/2),r.lineTo(e,o+s),r.lineTo(0,o+s),r.lineTo(t.width*t.arrowPercent,o+s/2),r.closePath(),r.fillStyle=t.color,r.fill(),i},vs:function(e){var t=e.width,n=e.height,i=e.dashArray,r=document.createElement("canvas"),o=r.getContext("2d");r.width=t,r.height=n,r.style.width=t+"px",r.style.height=n+"px";var s=new M;s.set(Math.cos(Math.PI/2),-Math.sin(Math.PI/2),+t/2,Math.sin(Math.PI/2),Math.cos(Math.PI/2),+n/2,0,0,1);var a=new M;a.set(1,0,-t/2,0,1,-n/2,0,0,1),s.multiply(a);s=s.elements;o.transform(s[0],s[3],s[1],s[4],s[2],s[6]);var u=i.reduce(function(t,n){return t+n}),h=0;return i.forEach(function(t,n){n%2==0&&(o.fillStyle=e.color,o.fillRect(h/u*e.width,0,t/u*e.width,e.height)),h+=t}),r},cs:function(t,n){var e=this.xe.Zt.Pt.fontFamily;return void 0!==t?t+","+e:void 0!==n&&'"Microsoft Yahei","微软雅黑",Tahoma,Arial'===e?n:e},vt:function(){}});var Dc=mh;function Ic(t){return(Ic="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Nc(t,n){return(Nc=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Fc(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Uc(e);return t=i?(t=Uc(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Ic(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function Uc(t){return(Uc=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}yh=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Nc(t,n)}(n,Sc);var t=Fc(n);function n(){return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,n),t.call(this)}return n}();Object.assign(yh.prototype,{ps:function(t){var n,e=[];for(n in t)e.push(t[n]);return e.join()}});var Bc=yh;function Gc(t){return(Gc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Hc(t,n){return(Hc=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Vc(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Wc(e);return t=i?(t=Wc(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Gc(t)&&"function"!=typeof t?zc(n):t}}function zc(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Wc(t){return(Wc=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}vi=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Hc(t,n)}(i,Bc);var e=Vc(i);function i(t){var n;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,i),(n=e.call(this)).Po=null,n.Bi=n.Bi.bind(zc(n)),n.Do=new gc({disposeCallback:n.Bi,enable:!0,name:"TextureManager",mapCreateTime:t.mapCreateTime}),n}return i}();Object.assign(vi.prototype,{ms:function(t){t=new Vu(t);return t.minFilter=An,t.generateMipmaps=!1,t.needsUpdate=!0,t},gs:function(t){var n=new Sr;return n.minFilter=An,n.generateMipmaps=!1,n.flipY=t.flipY,n},ys:function(t,n){var r,e=this;void 0===t.flipY&&(t.flipY=!0);var o,s=this.ps(t);return this.Jo.has(s)?this.Qo.has(s)?this.$o(s,n):n(r=this.Jo.get(s)):(r=this.gs(t),this.Jo.set(s,r),this.$o(s,n),o="_getTexture"+Mt.generateUUID(),this.Do.So(o),kc.rs(t.url,function(i){r.image=i,r.needsUpdate=!0,e.Qo.get(s).forEach(function(t,n,e){i&&n(r),e.delete(t)}),e.Qo.delete(s),e.Do.Eo(o)})),r},bs:function(t,n){var e=this.ms(t);return e.scaleRatio=t.height/t.width,e.mspriteScale=t.spriteScale,n.needSize&&(e.size=t.size),e},vt:function(t){this.Po=t,this.Do.Mo(!0)},Bi:function(){this.Jo.forEach(function(t,n,e){t.dispose(),e.delete(n)}),this.Jo.clear(),this.Jo=null,this.Qo.forEach(function(t,n,e){t.forEach(function(t,n,e){e.delete(n)}),e.delete(n)}),this.Qo.clear(),this.Qo=null,this.Po&&this.Po({name:"TextureManager"})}});var Xc=vi;Tr.fmcommon={diffuse:{value:new _i(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new M}},ts.fmLambert={uniforms:go.merge([Tr.fmcommon,Tr.lights,{emissive:{value:new _i(0)},mapMixColor:{value:!1},fogColor:{value:new _i(0)},fogDensity:{value:0}}]),vertexShader:"\n#define LAMBERT\n\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n \n#include <common> \n#include <uv_pars_vertex> \n#include <bsdfs> \n#include <lights_pars_begin> \n#include <logdepthbuf_pars_vertex>\n#include <fog_pars_vertex>\n\nvoid main() {\n\n\t#include <uv_vertex> \n\n\t#include <beginnormal_vertex> \n\t#include <morphnormal_vertex> \n\t#include <defaultnormal_vertex> \n\n\t#include <begin_vertex> \n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex> \n\n\t#include <worldpos_vertex> \n\t#include <lights_lambert_vertex> \n\t#include <fog_vertex>\n}\n",fragmentShader:"\nuniform bool mapMixColor;\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n\n\n#include <common> \n#include <packing> \n#include <uv_pars_fragment> \n#include <map_pars_fragment> \n#include <bsdfs> \n#include <lights_pars_begin>\n#include <logdepthbuf_pars_fragment> \n#include <fog_pars_fragment> \n\nvoid main() {\n\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\n #include <logdepthbuf_fragment>\n\t#include <map_fragment_1> \n\t \n\n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\n\n\t#ifdef DOUBLE_SIDED\n\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\n\t#else\n\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\n\t#endif\n\n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\n\t#else\n\n\t\treflectedLight.directDiffuse = vLightFront;\n\n\t#endif\n\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\n\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <fog_fragment> \n}\n"};mi=function(t){wo.call(this),this.type="FMMeshLambertMaterial",this.uniforms=go.clone(ts.fmLambert.uniforms),this.vertexShader=ts.fmLambert.vertexShader,this.fragmentShader=ts.fmLambert.fragmentShader,this.lights=!0,this.fog=!0,Object.defineProperties(this,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(t){this.uniforms.diffuse.value=t}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(t){this.uniforms.opacity.value=t}},emissive:{enumerable:!0,get:function(){return this.uniforms.emissive.value},set:function(t){this.uniforms.emissive.value=t}},map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(t){this.uniforms.map.value=t}},mapMixColor:{enumerable:!0,get:function(){return this.uniforms.mapMixColor.value},set:function(t){this.uniforms.mapMixColor.value=t}}}),this.setValues(t)};((mi.prototype=Object.create(wo.prototype)).constructor=mi).prototype.isFMMeshLambertMaterial=!0,mi.prototype.copy=function(t){return wo.prototype.copy.call(this,t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=go.clone(t.uniforms),this.lights=t.lights,this};var Zc=mi;function Yc(t){wo.call(this),this.type="FMMeshBasicMaterial",this.uniforms=go.clone(ts.fmBasic.uniforms),this.vertexShader=ts.fmBasic.vertexShader,this.fragmentShader=ts.fmBasic.fragmentShader,Object.defineProperties(this,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(t){this.uniforms.diffuse.value=t}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(t){this.uniforms.opacity.value=t}},map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(t){this.uniforms.map.value=t}}}),this.setValues(t)}Tr.fmcommon={diffuse:{value:new _i(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new M}},ts.fmBasic={uniforms:go.merge([Tr.fmcommon]),vertexShader:"\n#include <common> \n#include <uv_pars_vertex> \n\nvoid main() {\n\n\t#include <uv_vertex> \n\n\t#include <begin_vertex> \n\t#include <project_vertex> \n\n\t#include <worldpos_vertex> \n}\n",fragmentShader:"\nuniform vec3 diffuse;\nuniform float opacity;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n#endif\n\n#include <common> \n#include <uv_pars_fragment> \n#include <map_pars_fragment> \n\nvoid main() {\n\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\t#include <map_fragment> \n\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\n\t#ifdef USE_LIGHTMAP\n\n\t\treflectedLight.indirectDiffuse += texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\n\t#else\n\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\n\t#endif\n\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n \n}\n"},((Yc.prototype=Object.create(wo.prototype)).constructor=Yc).prototype.isFMMeshBasicMaterial=!0,Yc.prototype.copy=function(t){return wo.prototype.copy.call(this,t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=go.clone(t.uniforms),this};var qc="\n\t#extension GL_OES_standard_derivatives : enable\n\n\t#define STANDARD\n\t\n\t#ifdef PHYSICAL\n\t\t#define REFLECTIVITY\n\t\t#define CLEARCOAT\n\t\t#define TRANSPARENCY\n\t#endif\n\t\n\tvarying vec3 v_position;\t\n\n\tuniform bool isRect;\n\tuniform bool isAnnulus;\n\n\tuniform float sweepW;\n\tuniform float sweepH;\n\tuniform vec2 se2N;\n\tuniform vec2 se2RN;\n\tuniform vec2 moveP;\n\tuniform vec3 color_r;\n\t\n\tuniform vec2 circleC;\n\tuniform float maxR;\n\tuniform float minR;\n\tuniform vec3 color_a;\n\n\tuniform bool isSweepTexture;\n\tuniform sampler2D sweepTexture;\n\tuniform float sweepStrength;\n\t\n\tbool isInRectW(vec2 v, vec2 a, float w){\n\t\tfloat a1 = abs(dot(v,a));\n\t\treturn a1 < w;\n\t}\n\tbool isInRectH(vec2 v, vec2 a, float h){\n\t\tfloat a1 = abs(dot(v,a));\n\t\treturn a1 < h;\n\t}\n\n\tbool isMaxCircle(vec3 a, vec2 b, float r){\n\t\tfloat c = pow((a.x-b.x),2.0)+pow((a.z-b.y),2.0);\n\t\treturn c <= pow(r,2.0);\n\t}\n\t\n\tbool isMinCircle(vec3 a, vec2 b, float r){\n\t\tfloat c = pow((a.x-b.x),2.0)+pow((a.z-b.y),2.0);\n\t\treturn c > pow(r,2.0);\n\t}\n\n\tuniform vec3 diffuse;\n\tuniform vec3 emissive;\n\tuniform float roughness;\n\tuniform float metalness;\n\tuniform float opacity;\n\tuniform bool isEnable;\n\t\n\t#ifdef TRANSPARENCY\n\t\tuniform float transparency;\n\t#endif\n\t\n\t#ifdef REFLECTIVITY\n\t\tuniform float reflectivity;\n\t#endif\n\t\n\t#ifdef CLEARCOAT\n\t\tuniform float clearcoat;\n\t\tuniform float clearcoatRoughness;\n\t#endif\n\t\n\t#ifdef USE_SHEEN\n\t\tuniform vec3 sheen;\n\t#endif\n\t\n\tvarying vec3 vViewPosition;\n\t\n\t#ifndef FLAT_SHADED\n\t\n\t\tvarying vec3 vNormal;\n\t\n\t\t#ifdef USE_TANGENT\n\t\n\t\t\tvarying vec3 vTangent;\n\t\t\tvarying vec3 vBitangent;\n\t\n\t\t#endif\n\t\n\t#endif\n\t\n\t#include <common>\n\t#include <packing>\n\t#include <dithering_pars_fragment>\n\t#include <color_pars_fragment>\n\t#include <uv_pars_fragment>\n\t#include <uv2_pars_fragment>\n\t#include <map_pars_fragment>\n\t#include <alphamap_pars_fragment>\n\t#include <aomap_pars_fragment>\n\t#include <lightmap_pars_fragment>\n\t#include <emissivemap_pars_fragment>\n\t#include <bsdfs>\n\t#include <cube_uv_reflection_fragment>\n\t#include <envmap_common_pars_fragment>\n\t#include <envmap_physical_pars_fragment>\n\t#include <fog_pars_fragment>\n\t#include <lights_pars_begin>\n\t#include <lights_physical_pars_fragment>\n\t#include <shadowmap_pars_fragment>\n\t#include <bumpmap_pars_fragment>\n\t#include <normalmap_pars_fragment>\n\t#include <clearcoat_pars_fragment>\n\t#include <roughnessmap_pars_fragment>\n\t#include <metalnessmap_pars_fragment>\n\t#include <logdepthbuf_pars_fragment>\n\t#include <clipping_planes_pars_fragment>\n\t\n\tvoid main() {\n\t\t#include <clipping_planes_fragment>\n\t\n\t\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t\tvec3 totalEmissiveRadiance = emissive;\n\t\n\t\t#include <logdepthbuf_fragment>\n\t\t#include <map_fragment>\n\t\t#include <color_fragment>\n\t\t#include <alphamap_fragment>\n\t\t#include <alphatest_fragment>\n\t\t#include <roughnessmap_fragment>\n\t\t#include <metalnessmap_fragment>\n\t\t#include <normal_fragment_begin>\n\t\t#include <normal_fragment_maps>\n\t\t#include <clearcoat_normal_fragment_begin>\n\t\t#include <clearcoat_normal_fragment_maps>\n\t\t#include <emissivemap_fragment>\n\t\t\n\t\t// accumulation\n\t\t#include <lights_physical_fragment>\n\t\t#include <lights_fragment_begin>\n\t\t#include <lights_fragment_maps>\n\t\t#include <lights_fragment_end>\n\t\t\n\t\t// modulation\n\t\t#include <aomap_fragment>\n\t\t\n\t\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t\n\t\t// this is a stub for the transparency model\n\t\t#ifdef TRANSPARENCY\n\t\t\tdiffuseColor.a *= saturate( 1. - transparency + linearToRelativeLuminance( reflectedLight.directSpecular + reflectedLight.indirectSpecular ) );\n\t\t#endif\n\t\n\t\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t\t\n\t\tif(isRect&&isEnable){\n \n\t\t\tvec2 v = vec2(v_position.x - moveP.x, v_position.z - moveP.y);\n\t\t\tif(isInRectW(v,se2N,sweepW) && isInRectH(v,se2RN,sweepH)){\n\t\t\t\tgl_FragColor = vec4(mix(gl_FragColor.rgb, sweepStrength*color_a.rgb, 0.5),gl_FragColor.a);\n\t\t\t}\t\n\t\t}\n\t\tif(isAnnulus&&isEnable){\n\t\t\tif(isMaxCircle(v_position.xyz,circleC,maxR) && isMinCircle(v_position.xyz,circleC,minR)){\t\t\t\n\t\t\t\tif(isSweepTexture){\n\t\t\t\t\tvec2 uv = vec2((v_position.x-(circleC.x-maxR))/(2.0*maxR),(v_position.z-(circleC.y-maxR))/(2.0*maxR));\n\t\t\t\t\tvec4 tex = texture2D( sweepTexture, uv );\n\t\t\t\t\ttex = mapTexelToLinear( tex );\n\t\t\t\t\tfloat d2 = pow(v_position.x-circleC.x,2.0) + pow(v_position.z-circleC.y,2.0);\n\t\t\t\t\tfloat a = smoothstep(0.0, pow(maxR,2.0), d2);\n\t\t\t\t\ta = 1.0 - a;\n\t\t\t\t\ttex.a = a;\n\t\t\t\t\tgl_FragColor = vec4(mix(gl_FragColor.rgb, sweepStrength*tex.rgb, 0.2),gl_FragColor.a);\n\t\t\t\t} else {\n\t\t\t\t\tgl_FragColor = vec4(mix(gl_FragColor.rgb, sweepStrength*color_a.rgb, 0.5),gl_FragColor.a);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\n\t\t#include <tonemapping_fragment>\n\t\t#include <encodings_fragment>\n\t\t#include <fog_fragment>\n\t\t#include <premultiplied_alpha_fragment>\n\t\t#include <dithering_fragment>\n\t}\n",Kc="\n #define STANDARD\n \n varying vec3 vViewPosition;\n varying vec3 v_position;\n \n #ifndef FLAT_SHADED\n\n varying vec3 vNormal;\n \n #ifdef USE_TANGENT\n \n varying vec3 vTangent;\n varying vec3 vBitangent;\n \n #endif\n \n #endif\n \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>\n\n void main() {\n \t#include <uv_vertex>\n #include <uv2_vertex>\n #include <color_vertex>\n \n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n \n #ifndef FLAT_SHADED // Normal computed with derivatives when FLAT_SHADED\n \n vNormal = normalize( transformedNormal );\n \n #ifdef USE_TANGENT\n \n vTangent = normalize( transformedTangent );\n vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n \n #endif\n \n #endif\n \n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n \n vViewPosition = - mvPosition.xyz;\n \n vec4 pos = vec4(position, 1.0);\n v_position = vec3(modelMatrix * vec4( position, 1.0 ));\n \n #include <worldpos_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n }\n ";function Jc(t){return(Jc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Qc(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function $c(t,n){return($c=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function tf(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=nf(e);return t=i?(t=nf(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Jc(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function nf(t){return(nf=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var ef=go.merge([{sweepW:{value:0},sweepH:{value:0},se2N:{value:new fi(0,0)},se2RN:{value:new fi(0,0)},moveP:{value:new fi(0,0)},color_r:{value:new _i(16711935)},color_a:{value:new _i(16776960)},isRect:{value:!1},isAnnulus:{value:!1},isEnable:{value:!1},circleC:{value:new fi(0,0)},maxR:{value:0},minR:{value:0},isSweepTexture:{value:!1},sweepTexture:{value:null},sweepStrength:{value:1}},ts.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new fi(1,1)},clearcoatNormalMap:{value:null},sheen:{value:new _i(0)},transparency:{value:0}}]),Ri=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&$c(t,n)}(r,wo);var t,n,e,i=tf(r);function r(){var t;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(t=i.call(this)).type="FMMeshStandardMaterial",t.uniforms=go.clone(ef),t.vertexShader=Kc,t.fragmentShader=qc,t.lights=!0,t.fog=!0,t}return t=r,(n=[{key:"copy",value:function(t){return wo.prototype.copy.call(this,t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=go.clone(t.uniforms),this.lights=t.lights,this}}])&&Qc(t.prototype,n),e&&Qc(t,e),r}();Ri.prototype.isFMMeshStandardMaterial=!0;var rf=Ri;function of(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var sf=function(){function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t)}var n,e,i;return n=t,i=[{key:"setPixel",value:function(t){var n=t.x,e=t.y,i=t.color,r=t.d,t=t.width;r[4*(e*t+n)+0]=i[0],r[4*(e*t+n)+1]=i[1],r[4*(e*t+n)+2]=i[2],r[4*(e*t+n)+3]=i[3]}},{key:"getPowerOfTwoSizeCanvas",value:function(t){var n=Mt.floorPowerOfTwo(t.width),e=Mt.floorPowerOfTwo(t.height);return void 0===this.ws&&(this.ws=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),this.ws.width=n,this.ws.height=e,this.ws.getContext("2d").drawImage(t,0,0,n,e),this.ws}}],(e=null)&&of(n.prototype,e),i&&of(n,i),t}();Ai=function t(n){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),this.Zt=n,this._s=new Dc(this),this.xs=new Xc({mapCreateTime:this.Zt.W.Ms}),this.Ss={},this.Es=new Map,this.Ts=new Map,this.Ls=new Map,this.Rs=new Map,this.Os=new Map,this.As=new Map,this.ks={},this.Po=null,this.Bi=this.Bi.bind(this),this.Do=new gc({disposeCallback:this.Bi,enable:!0,name:"MaterialManager",mapCreateTime:this.Zt.W.Ms})};Object.assign(Ai.prototype,{Cs:function(t,n){this.ks[n.uuid]||(this.ks[n.uuid]=[]),this.ks[n.uuid].push(t.uuid)},js:function(t,e){t=this.ks[e.uuid].indexOf(t.uuid);if(-1!==t&&this.ks[e.uuid].splice(t,1),0===this.ks[e.uuid].length){var i=[];if(e instanceof rf){this.Os.forEach(function(t,n){t.uuid===e.uuid&&i.push(n)});for(var n=0;n<i.length;n++)this.Os.delete(i[n])}delete this.ks[e.uuid]}},Ps:function(t){var n,e=[];for(n in t)t[n]?t[n].constructor===Sr||t[n].isTexture?e.push(t[n].uuid):t[n].constructor===fi?(e.push(t[n].x),e.push(t[n].y)):e.push(t[n]):e.push(t[n]);return e.join()},Ds:function(t,n){var e=this.Ps(t);return this.Es.has(e)||(n=this.Is(t,n),this.Es.set(e,n)),this.Es.get(e)},Is:function(t,n){if(t.isline)return new xc({color:t.color,linewidth:1,transparent:!0,opacity:t.opacity});var e=new Yc;void 0!==t.color&&(e.color=new _i(t.color)),void 0!==t.opacity&&(e.opacity=t.opacity),void 0!==t.url&&this.xs.ys({url:t.url,flipY:t.flipY},function(t){t.image&&(e.map=t,e.needsUpdate=!0),n&&n()});t=void 0!==t.needDepth&&t.needDepth;return e.transparent=!0,e.depthTest=t,e.depthWrite=t,e},Ns:function(t){var n=this.Ps(t);return this.Ts.has(n)||(t=this.Fs(t),this.Ts.set(n,t)),this.Ts.get(n)},_e:function(t){var n=this.Ps(t);return this.Os.has(n)||(t=this.Us(t),this.Os.set(n,t)),this.Os.get(n)},Us:function(t){var n=new rf;return n.defines.USE_UV=!0,n.uniforms.diffuse.value=new _i(t.color),n.uniforms.emissive.value=new _i(t.emissive),n.uniforms.metalness.value=t.metalness,n.uniforms.roughness.value=t.roughness,n.uniforms.normalScale.value=t.normalScale,n.defines.USE_EMISSIVEMAP=t.USE_EMISSIVEMAP,n.uniforms.emissiveMap.value=t.emissiveMap,n.defines.USE_MAP=t.USE_MAP,n.uniforms.map.value=t.map,t.aoMap&&(n.defines.USE_AOMAP=!0,n.uniforms.aoMap.value=t.aoMap),n.transparent=t.transparent,n.uniforms.opacity.value=t.opacity,n.skinning=t.skinning,n.side=t.side,n.vertexColors=t.vertexColors,n.needsUpdate=!0,n},Me:function(t,n){(n=n||{}).uuid=t.uuid;var e=this.Ps(n);return this.As.has(e)||(t=t.clone(),n.color&&(t.color=new _i(n.color)),n.opacity&&(t.opacity=n.opacity),n.transparent&&(t.transparent=n.transparent),this.As.set(e,t)),this.As.get(e)},Fs:function(n){var e=new Zc;return e.color=new _i(n.color),e.opacity=n.alpha,e.transparent=e.opacity<1,void 0!==n.url&&this.xs.ys({url:n.url},function(t){t.image&&(e.map=t,e.needsUpdate=!0),n.finish&&n.finish(e)}),e},Bs:function(t){var n=void 0===t.needDepth||t.needDepth,t=new wc({color:t.color,opacity:t.opacity,lineWidth:t.lineWidth,vertexColors:2,dashed:!1,transparent:!0});t.depthWrite=n,t.depthTest=n;n=this.Zt.W;return t.resolution.set(n.cn.renderer.domElement.clientWidth,n.cn.renderer.domElement.clientHeight),t},Gs:function(t){var n=this.Ps(t);return this.Ls.has(n)||(t=this.Bs(t),this.Ls.set(n,t)),this.Ls.get(n)},Hs:function(t,n,e){var i=new _c;i.sizeAttenuation=!1,i.depthTest=!1,i.depthWrite=!1,i.transparent=!0,i.opacity=e.opacity,i.side=At;n=this.Vs(t,null,n,e);return i.map=n,e.needSize&&(i.size=n.size),i.userData.scaleRatio=n.scaleRatio,i.userData.mspriteScale=n.mspriteScale,i.needsUpdate=!0,i},zs:function(n,e,i,r){var o,s,t,a=this,u=new _c;return u.sizeAttenuation=!1,u.depthTest=!1,u.depthWrite=!1,u.side=At,u.opacity=i.opacity,u.transparent=!0,u.blending=It,i.imageUrl?(u.visible=!1,o="_createLabelMaterial"+Mt.generateUUID(),this.Do.So(o),s=this,kc.rs(i.imageUrl,function(t){t=a.Vs(n,t,e,i);u.map=t,u.visible=!0,u.needsUpdate=!0,u.userData.scaleRatio=t.scaleRatio,u.userData.mspriteScale=t.mspriteScale,r&&r(u),s.Do.Eo(o)})):(t=this.Vs(n,null,e,i),u.map=t,u.needsUpdate=!0,u.userData.scaleRatio=t.scaleRatio,u.userData.mspriteScale=t.mspriteScale,r&&r(u)),u},Vs:function(t,n,e,i){e=this._s.hs(t,n,e,i);return this.xs.bs(e,{needSize:i.needSize})},Ws:function(t,n){var e=this.Ps(t);return this.Rs.has(e)||(t=this.Xs(t,n),this.Rs.set(e,t)),n&&n(this.Rs.get(e)),this.Rs.get(e)},Xs:function(t,n){var e=void 0!==t.opacity?t.opacity:1,i=new _c;return i.sizeAttenuation=!1,i.depthTest=t.needDepth,i.depthWrite=t.needDepth,i.transparent=!0,i.opacity=e,i.visible=!1,this.xs.ys({url:t.url},function(t){t.image&&(i.map=t,i.needsUpdate=!0,i.visible=!0,i.userData.scaleRatio=t.image.width/t.image.height),n&&n(i)}),i},createArrowWidthBackTexture:function(t){t=this._s.ls(t);return new Vu(sf.getPowerOfTwoSizeCanvas(t))},createNormalLineTexture:function(t){t=this._s.vs(t);return new Vu(sf.getPowerOfTwoSizeCanvas(t))},Zs:function(t){t=this._s.ds(t);return new Vu(sf.getPowerOfTwoSizeCanvas(t))},Ys:function(t,n){if(this.Ss[t+n])return this.Ss[t+n];var e=new Mc({uniforms:{color:{value:new _i(t)},alpha:{value:n}},vertexShader:"\nprecision mediump float;\nprecision mediump int;\n\nattribute vec3 position;\n\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\n\nvoid main() {\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n ",fragmentShader:"\nprecision mediump float;\nprecision mediump int;\n\nuniform vec3 color;\nuniform float alpha;\n\nvoid main() {\n gl_FragColor = vec4(color,alpha);\n}\n "});return e.transparent=!0,this.Ss[t+n]=e},qs:function(t,n){n=new wo({uniforms:{color:{value:new _i(t)},alpha:{value:n}},vertexShader:"\nattribute float gradientAlpha;\n\nvarying float v_gradientAlpha;\n\nvoid main() {\n v_gradientAlpha = gradientAlpha;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n ",fragmentShader:"\n\nuniform vec3 color;\nuniform float alpha;\n\nvarying float v_gradientAlpha;\n\nvoid main() {\n gl_FragColor = vec4(color, alpha * v_gradientAlpha);\n}\n "});return n.depthTest=!0,n.depthWrite=!1,n.transparent=!0,n},Ks:function(t,n){var e=new Sr;e.minFilter=An,e.generateMipmaps=!1,e.anisotropy=4,e.wrapS=Sn,e.wrapT=Sn;var i="_loadTexture"+Mt.generateUUID();this.Do.So(i);var r=this;return kc.rs(t,function(t){t&&(e.image=t,e.needsUpdate=!0),n(e),r.Do.Eo(i)}),e},vt:function(t){var n=this;this.Po=t,this.xs.vt(function(){n.xs=null,n.Do.Mo(!0)})},Bi:function(){kc.or(),this._s.vt(),this._s=null,this.Es.clear(),this.Ts.clear(),this.Ls.clear(),this.Rs.clear(),this.Po&&this.Po({name:"MaterialManager"})}});var af=Ai;Di=function t(n){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),this.Zt=n};Object.assign(Di.prototype,{Js:function(t){var n=this.Zt.Qs.get(t),e=this.Zt.Qs.get(this.Zt.Pt.buildingID),t={};return(t=n?{theme:n.theme,themeExtension:n.themeExtension}:t).theme||(t.theme=e.theme),t.themeExtension||(t.themeExtension=e.themeExtension),t},$s:function(t){t=this.Js(t);return Object.assign({},t.theme.ta,t.themeExtension.ta)},na:function(t){t=this.Js(t);return Object.assign({},t.theme.ea.get("0"),t.themeExtension.ea.get("0"))},ia:function(t){return this.ra(Ii.MODEL,t)},oa:function(t){return this.ra(Ii.FACILITY,t)},sa:function(t){return this.ra(Ii.LABEL,t)},aa:function(t){return this.ra(Ii.EXTERNAL_MODEL,t)},ra:function(t,n){var e=this.Js(n.bid),i={},r={},o=e.themeExtension.ua(t).get(n.fid),s=e.theme.ua(t).get(n.fid);if(o||s){var a=(o&&void 0!==o.normalID?o:s).normalID,u=e.themeExtension.ha(t).get(a),a=e.theme.ha(t).get(a);if(u||a)return Object.assign(r,a,u,s,o)}return o=e.themeExtension.ca(t).get(n.typeID),s=e.theme.ca(t).get(n.typeID),(o||s)&&Object.assign(i,s,o),i.normalID||(o=e.themeExtension.ca(t).get("0"),s=e.theme.ca(t).get("0"),Object.assign(i,o,s)),u=e.themeExtension.ha(t).get(i.normalID),a=e.theme.ha(t).get(i.normalID),Object.assign(r,a,u)},fa:function(t){t=this.Js(t);return t.themeExtension.la||t.theme.la},vt:function(){this.Zt=null}});var uf=Di;function hf(t,n,e){var i=this,r=!1,o=0,s=0,a=void 0,u=[];this.onStart=void 0,this.onLoad=t,this.onProgress=n,this.onError=e,this.itemStart=function(t){s++,!1===r&&void 0!==i.onStart&&i.onStart(t,o,s),r=!0},this.itemEnd=function(t){o++,void 0!==i.onProgress&&i.onProgress(t,o,s),o===s&&(r=!1,void 0!==i.onLoad&&i.onLoad())},this.itemError=function(t){void 0!==i.onError&&i.onError(t)},this.resolveURL=function(t){return a?a(t):t},this.setURLModifier=function(t){return a=t,this},this.addHandler=function(t,n){return u.push(t,n),this},this.removeHandler=function(t){t=u.indexOf(t);return-1!==t&&u.splice(t,2),this},this.getHandler=function(t){for(var n=0,e=u.length;n<e;n+=2){var i=u[n],r=u[n+1];if(i.global&&(i.lastIndex=0),i.test(t))return r}return null},this.isLoaded=function(){return o===s}}var cf=new hf,ff=function(t){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(t);for(var n="",e=0,i=t.length;e<i;e++)n+=String.fromCharCode(t[e]);try{return decodeURIComponent(escape(n))}catch(t){return n}},lf=function(t){var n=t.lastIndexOf("/");return-1===n?"./":t.substr(0,n+1)},df={enabled:!1,files:{},add:function(t,n){!1!==this.enabled&&(this.files[t]=n)},get:function(t){if(!1!==this.enabled)return this.files[t]},remove:function(t){delete this.files[t]},clear:function(){this.files={}}};function vf(t){kf.call(this,t)}function pf(t){kf.call(this,t)}function mf(t){vo.call(this),this.type="ShadowMaterial",this.color=new _i(0),this.transparent=!0,this.setValues(t)}function gf(t){vo.call(this),this.type="PointsMaterial",this.color=new _i(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.setValues(t)}function yf(t){vo.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new _i(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new _i(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=oi,this.normalScale=new fi(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.vertexTangents=!1,this.setValues(t)}function bf(t){yf.call(this),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.clearcoat=0,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new fi(1,1),this.clearcoatNormalMap=null,this.reflectivity=.5,this.sheen=null,this.transparency=0,this.setValues(t)}function wf(t){vo.call(this),this.type="MeshPhongMaterial",this.color=new _i(16777215),this.specular=new _i(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new _i(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=oi,this.normalScale=new fi(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=un,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(t)}function _f(t){vo.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new _i(16777215),this.specular=new _i(1118481),this.shininess=30,this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new _i(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=oi,this.normalScale=new fi(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function xf(t){vo.call(this),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=oi,this.normalScale=new fi(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function Mf(t){vo.call(this),this.type="MeshLambertMaterial",this.color=new _i(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new _i(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=un,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(t)}function Sf(t){vo.call(this),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new _i(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=oi,this.normalScale=new fi(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function Ef(t){xc.call(this),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}function Tf(t){kf.call(this,t),this.textures={}}vf.prototype=Object.assign(Object.create(kf.prototype),{constructor:vf,load:function(n,t,e,i){void 0!==this.path&&(n=this.path+n),n=this.manager.resolveURL(n);var r=this,o=df.get(n);if(void 0!==o)return r.manager.itemStart(n),setTimeout(function(){t&&t(o),r.manager.itemEnd(n)},0),o;var s=document.createElementNS("http://www.w3.org/1999/xhtml","img");function a(){s.removeEventListener("load",a,!1),s.removeEventListener("error",u,!1),df.add(n,this),t&&t(this),r.manager.itemEnd(n)}function u(t){s.removeEventListener("load",a,!1),s.removeEventListener("error",u,!1),i&&i(t),r.manager.itemError(n),r.manager.itemEnd(n)}return s.addEventListener("load",a,!1),s.addEventListener("error",u,!1),"data:"!==n.substr(0,5)&&void 0!==this.crossOrigin&&(s.crossOrigin=this.crossOrigin),r.manager.itemStart(n),s.src=n,s}}),pf.prototype=Object.assign(Object.create(kf.prototype),{constructor:pf,load:function(n,e,t,i){var r=new Sr,o=new vf(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(n,function(t){r.image=t;t=0<n.search(/\.jpe?g($|\?)/i)||0===n.search(/^data\:image\/jpeg/);r.format=t?Xn:Zn,r.needsUpdate=!0,void 0!==e&&e(r)},t,i),r}}),((mf.prototype=Object.create(vo.prototype)).constructor=mf).prototype.isShadowMaterial=!0,mf.prototype.copy=function(t){return vo.prototype.copy.call(this,t),this.color.copy(t.color),this},((gf.prototype=Object.create(vo.prototype)).constructor=gf).prototype.isPointsMaterial=!0,gf.prototype.copy=function(t){return vo.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.size=t.size,this.sizeAttenuation=t.sizeAttenuation,this.morphTargets=t.morphTargets,this},((yf.prototype=Object.create(vo.prototype)).constructor=yf).prototype.isMeshStandardMaterial=!0,yf.prototype.copy=function(t){return vo.prototype.copy.call(this,t),this.defines={STANDARD:""},this.color.copy(t.color),this.roughness=t.roughness,this.metalness=t.metalness,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.roughnessMap=t.roughnessMap,this.metalnessMap=t.metalnessMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapIntensity=t.envMapIntensity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this.vertexTangents=t.vertexTangents,this},((bf.prototype=Object.create(yf.prototype)).constructor=bf).prototype.isMeshPhysicalMaterial=!0,bf.prototype.copy=function(t){return yf.prototype.copy.call(this,t),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=t.clearcoat,this.clearcoatMap=t.clearcoatMap,this.clearcoatRoughness=t.clearcoatRoughness,this.clearcoatRoughnessMap=t.clearcoatRoughnessMap,this.clearcoatNormalMap=t.clearcoatNormalMap,this.clearcoatNormalScale.copy(t.clearcoatNormalScale),this.reflectivity=t.reflectivity,t.sheen?this.sheen=(this.sheen||new _i).copy(t.sheen):this.sheen=null,this.transparency=t.transparency,this},((wf.prototype=Object.create(vo.prototype)).constructor=wf).prototype.isMeshPhongMaterial=!0,wf.prototype.copy=function(t){return vo.prototype.copy.call(this,t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},((_f.prototype=Object.create(vo.prototype)).constructor=_f).prototype.isMeshToonMaterial=!0,_f.prototype.copy=function(t){return vo.prototype.copy.call(this,t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.gradientMap=t.gradientMap,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},((xf.prototype=Object.create(vo.prototype)).constructor=xf).prototype.isMeshNormalMaterial=!0,xf.prototype.copy=function(t){return vo.prototype.copy.call(this,t),this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},((Mf.prototype=Object.create(vo.prototype)).constructor=Mf).prototype.isMeshLambertMaterial=!0,Mf.prototype.copy=function(t){return vo.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},((Sf.prototype=Object.create(vo.prototype)).constructor=Sf).prototype.isMeshMatcapMaterial=!0,Sf.prototype.copy=function(t){return vo.prototype.copy.call(this,t),this.defines={MATCAP:""},this.color.copy(t.color),this.matcap=t.matcap,this.map=t.map,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},((Ef.prototype=Object.create(xc.prototype)).constructor=Ef).prototype.isLineDashedMaterial=!0,Ef.prototype.copy=function(t){return xc.prototype.copy.call(this,t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this},Tf.prototype=Object.assign(Object.create(kf.prototype),{constructor:Tf,load:function(t,n,e,i){var r=this,o=new jf(r.manager);o.setPath(r.path),o.load(t,function(t){n(r.parse(JSON.parse(t)))},e,i)},parse:function(t){var n=this.textures;function e(t){return void 0===n[t]&&console.warn("THREE.MaterialLoader: Undefined texture",t),n[t]}var i,r=new u[t.type];if(void 0!==t.uuid&&(r.uuid=t.uuid),void 0!==t.name&&(r.name=t.name),void 0!==t.color&&r.color.setHex(t.color),void 0!==t.roughness&&(r.roughness=t.roughness),void 0!==t.metalness&&(r.metalness=t.metalness),void 0!==t.sheen&&(r.sheen=(new _i).setHex(t.sheen)),void 0!==t.emissive&&r.emissive.setHex(t.emissive),void 0!==t.specular&&r.specular.setHex(t.specular),void 0!==t.shininess&&(r.shininess=t.shininess),void 0!==t.clearcoat&&(r.clearcoat=t.clearcoat),void 0!==t.clearcoatRoughness&&(r.clearcoatRoughness=t.clearcoatRoughness),void 0!==t.fog&&(r.fog=t.fog),void 0!==t.flatShading&&(r.flatShading=t.flatShading),void 0!==t.blending&&(r.blending=t.blending),void 0!==t.combine&&(r.combine=t.combine),void 0!==t.side&&(r.side=t.side),void 0!==t.opacity&&(r.opacity=t.opacity),void 0!==t.transparent&&(r.transparent=t.transparent),void 0!==t.alphaTest&&(r.alphaTest=t.alphaTest),void 0!==t.depthTest&&(r.depthTest=t.depthTest),void 0!==t.depthWrite&&(r.depthWrite=t.depthWrite),void 0!==t.colorWrite&&(r.colorWrite=t.colorWrite),void 0!==t.stencilWrite&&(r.stencilWrite=t.stencilWrite),void 0!==t.stencilWriteMask&&(r.stencilWriteMask=t.stencilWriteMask),void 0!==t.stencilFunc&&(r.stencilFunc=t.stencilFunc),void 0!==t.stencilRef&&(r.stencilRef=t.stencilRef),void 0!==t.stencilFuncMask&&(r.stencilFuncMask=t.stencilFuncMask),void 0!==t.stencilFail&&(r.stencilFail=t.stencilFail),void 0!==t.stencilZFail&&(r.stencilZFail=t.stencilZFail),void 0!==t.stencilZPass&&(r.stencilZPass=t.stencilZPass),void 0!==t.wireframe&&(r.wireframe=t.wireframe),void 0!==t.wireframeLinewidth&&(r.wireframeLinewidth=t.wireframeLinewidth),void 0!==t.wireframeLinecap&&(r.wireframeLinecap=t.wireframeLinecap),void 0!==t.wireframeLinejoin&&(r.wireframeLinejoin=t.wireframeLinejoin),void 0!==t.rotation&&(r.rotation=t.rotation),1!==t.linewidth&&(r.linewidth=t.linewidth),void 0!==t.dashSize&&(r.dashSize=t.dashSize),void 0!==t.gapSize&&(r.gapSize=t.gapSize),void 0!==t.scale&&(r.scale=t.scale),void 0!==t.polygonOffset&&(r.polygonOffset=t.polygonOffset),void 0!==t.polygonOffsetFactor&&(r.polygonOffsetFactor=t.polygonOffsetFactor),void 0!==t.polygonOffsetUnits&&(r.polygonOffsetUnits=t.polygonOffsetUnits),void 0!==t.skinning&&(r.skinning=t.skinning),void 0!==t.morphTargets&&(r.morphTargets=t.morphTargets),void 0!==t.morphNormals&&(r.morphNormals=t.morphNormals),void 0!==t.dithering&&(r.dithering=t.dithering),void 0!==t.vertexTangents&&(r.vertexTangents=t.vertexTangents),void 0!==t.visible&&(r.visible=t.visible),void 0!==t.toneMapped&&(r.toneMapped=t.toneMapped),void 0!==t.userData&&(r.userData=t.userData),void 0!==t.vertexColors&&("number"==typeof t.vertexColors?r.vertexColors=0<t.vertexColors:r.vertexColors=t.vertexColors),void 0!==t.uniforms)for(var o in t.uniforms){var s=t.uniforms[o];switch(r.uniforms[o]={},s.type){case"t":r.uniforms[o].value=e(s.value);break;case"c":r.uniforms[o].value=(new _i).setHex(s.value);break;case"v2":r.uniforms[o].value=(new fi).fromArray(s.value);break;case"v3":r.uniforms[o].value=(new St).fromArray(s.value);break;case"v4":r.uniforms[o].value=(new Ci).fromArray(s.value);break;case"m3":r.uniforms[o].value=(new M).fromArray(s.value);case"m4":r.uniforms[o].value=(new Et).fromArray(s.value);break;default:r.uniforms[o].value=s.value}}if(void 0!==t.defines&&(r.defines=t.defines),void 0!==t.vertexShader&&(r.vertexShader=t.vertexShader),void 0!==t.fragmentShader&&(r.fragmentShader=t.fragmentShader),void 0!==t.extensions)for(var a in t.extensions)r.extensions[a]=t.extensions[a];return void 0!==t.shading&&(r.flatShading=1===t.shading),void 0!==t.size&&(r.size=t.size),void 0!==t.sizeAttenuation&&(r.sizeAttenuation=t.sizeAttenuation),void 0!==t.map&&(r.map=e(t.map)),void 0!==t.matcap&&(r.matcap=e(t.matcap)),void 0!==t.alphaMap&&(r.alphaMap=e(t.alphaMap)),void 0!==t.bumpMap&&(r.bumpMap=e(t.bumpMap)),void 0!==t.bumpScale&&(r.bumpScale=t.bumpScale),void 0!==t.normalMap&&(r.normalMap=e(t.normalMap)),void 0!==t.normalMapType&&(r.normalMapType=t.normalMapType),void 0!==t.normalScale&&(i=t.normalScale,!1===Array.isArray(i)&&(i=[i,i]),r.normalScale=(new fi).fromArray(i)),void 0!==t.displacementMap&&(r.displacementMap=e(t.displacementMap)),void 0!==t.displacementScale&&(r.displacementScale=t.displacementScale),void 0!==t.displacementBias&&(r.displacementBias=t.displacementBias),void 0!==t.roughnessMap&&(r.roughnessMap=e(t.roughnessMap)),void 0!==t.metalnessMap&&(r.metalnessMap=e(t.metalnessMap)),void 0!==t.emissiveMap&&(r.emissiveMap=e(t.emissiveMap)),void 0!==t.emissiveIntensity&&(r.emissiveIntensity=t.emissiveIntensity),void 0!==t.specularMap&&(r.specularMap=e(t.specularMap)),void 0!==t.envMap&&(r.envMap=e(t.envMap)),void 0!==t.envMapIntensity&&(r.envMapIntensity=t.envMapIntensity),void 0!==t.reflectivity&&(r.reflectivity=t.reflectivity),void 0!==t.refractionRatio&&(r.refractionRatio=t.refractionRatio),void 0!==t.lightMap&&(r.lightMap=e(t.lightMap)),void 0!==t.lightMapIntensity&&(r.lightMapIntensity=t.lightMapIntensity),void 0!==t.aoMap&&(r.aoMap=e(t.aoMap)),void 0!==t.aoMapIntensity&&(r.aoMapIntensity=t.aoMapIntensity),void 0!==t.gradientMap&&(r.gradientMap=e(t.gradientMap)),void 0!==t.clearcoatMap&&(r.clearcoatMap=e(t.clearcoatMap)),void 0!==t.clearcoatRoughnessMap&&(r.clearcoatRoughnessMap=e(t.clearcoatRoughnessMap)),void 0!==t.clearcoatNormalMap&&(r.clearcoatNormalMap=e(t.clearcoatNormalMap)),void 0!==t.clearcoatNormalScale&&(r.clearcoatNormalScale=(new fi).fromArray(t.clearcoatNormalScale)),r},setTextures:function(t){return this.textures=t,this}});var Lf,Rf,Of,Af;function kf(t){this.manager=void 0!==t?t:cf,this.crossOrigin="anonymous",this.path="",this.resourcePath=""}Object.assign(kf.prototype,{load:function(){},parse:function(){},setCrossOrigin:function(t){return this.crossOrigin=t,this},setPath:function(t){return this.path=t,this},setResourcePath:function(t){return this.resourcePath=t,this}}),Object.assign(kf.prototype,{crossOrigin:"anonymous",onLoadStart:function(){},onLoadProgress:function(){},onLoadComplete:function(){},initMaterials:function(t,n,e){for(var i=[],r=0;r<t.length;++r)i[r]=this.createMaterial(t[r],n,e);return i},createMaterial:(Lf={NoBlending:0,NormalBlending:1,AdditiveBlending:2,SubtractiveBlending:3,MultiplyBlending:4,CustomBlending:5},Rf=new _i,Of=new pf,Af=new Tf,function(t,s,a){var u={};function n(t,n,e,i,r){var o=s+t,t=(new hf).getHandler(o),o=null!==t?t.load(o):(Of.setCrossOrigin(a),Of.load(o));void 0!==n&&(o.repeat.fromArray(n),1!==n[0]&&(o.wrapS=1e3),1!==n[1]&&(o.wrapT=1e3)),void 0!==e&&o.offset.fromArray(e),void 0!==i&&("repeat"===i[0]&&(o.wrapS=1e3),"mirror"===i[0]&&(o.wrapS=1002),"repeat"===i[1]&&(o.wrapT=1e3),"mirror"===i[1]&&(o.wrapT=1002)),void 0!==r&&(o.anisotropy=r);r=Mt.generateUUID();return u[r]=o,r}var e,i={uuid:Mt.generateUUID(),type:"MeshLambertMaterial"};for(e in t){var r=t[e];switch(e){case"DbgColor":case"DbgIndex":case"opticalDensity":case"illumination":break;case"DbgName":i.name=r;break;case"blending":i.blending=Lf[r];break;case"colorAmbient":case"mapAmbient":break;case"colorDiffuse":i.color=Rf.fromArray(r).getHex();break;case"colorSpecular":i.specular=Rf.fromArray(r).getHex();break;case"colorEmissive":i.emissive=Rf.fromArray(r).getHex();break;case"specularCoef":i.shininess=r;break;case"shading":"basic"===r.toLowerCase()&&(i.type="MeshBasicMaterial"),"phong"===r.toLowerCase()&&(i.type="MeshPhongMaterial"),"standard"===r.toLowerCase()&&(i.type="MeshStandardMaterial");break;case"mapDiffuse":i.map=n(r,t.mapDiffuseRepeat,t.mapDiffuseOffset,t.mapDiffuseWrap,t.mapDiffuseAnisotropy);break;case"mapDiffuseRepeat":case"mapDiffuseOffset":case"mapDiffuseWrap":case"mapDiffuseAnisotropy":break;case"mapEmissive":i.emissiveMap=n(r,t.mapEmissiveRepeat,t.mapEmissiveOffset,t.mapEmissiveWrap,t.mapEmissiveAnisotropy);break;case"mapEmissiveRepeat":case"mapEmissiveOffset":case"mapEmissiveWrap":case"mapEmissiveAnisotropy":break;case"mapLight":i.lightMap=n(r,t.mapLightRepeat,t.mapLightOffset,t.mapLightWrap,t.mapLightAnisotropy);break;case"mapLightRepeat":case"mapLightOffset":case"mapLightWrap":case"mapLightAnisotropy":break;case"mapAO":i.aoMap=n(r,t.mapAORepeat,t.mapAOOffset,t.mapAOWrap,t.mapAOAnisotropy);break;case"mapAORepeat":case"mapAOOffset":case"mapAOWrap":case"mapAOAnisotropy":break;case"mapBump":i.bumpMap=n(r,t.mapBumpRepeat,t.mapBumpOffset,t.mapBumpWrap,t.mapBumpAnisotropy);break;case"mapBumpScale":i.bumpScale=r;break;case"mapBumpRepeat":case"mapBumpOffset":case"mapBumpWrap":case"mapBumpAnisotropy":break;case"mapNormal":i.normalMap=n(r,t.mapNormalRepeat,t.mapNormalOffset,t.mapNormalWrap,t.mapNormalAnisotropy);break;case"mapNormalFactor":i.normalScale=r;break;case"mapNormalRepeat":case"mapNormalOffset":case"mapNormalWrap":case"mapNormalAnisotropy":break;case"mapSpecular":i.specularMap=n(r,t.mapSpecularRepeat,t.mapSpecularOffset,t.mapSpecularWrap,t.mapSpecularAnisotropy);break;case"mapSpecularRepeat":case"mapSpecularOffset":case"mapSpecularWrap":case"mapSpecularAnisotropy":break;case"mapMetalness":i.metalnessMap=n(r,t.mapMetalnessRepeat,t.mapMetalnessOffset,t.mapMetalnessWrap,t.mapMetalnessAnisotropy);break;case"mapMetalnessRepeat":case"mapMetalnessOffset":case"mapMetalnessWrap":case"mapMetalnessAnisotropy":break;case"mapRoughness":i.roughnessMap=n(r,t.mapRoughnessRepeat,t.mapRoughnessOffset,t.mapRoughnessWrap,t.mapRoughnessAnisotropy);break;case"mapRoughnessRepeat":case"mapRoughnessOffset":case"mapRoughnessWrap":case"mapRoughnessAnisotropy":break;case"mapAlpha":i.alphaMap=n(r,t.mapAlphaRepeat,t.mapAlphaOffset,t.mapAlphaWrap,t.mapAlphaAnisotropy);break;case"mapAlphaRepeat":case"mapAlphaOffset":case"mapAlphaWrap":case"mapAlphaAnisotropy":break;case"flipSided":i.side=1;break;case"doubleSided":i.side=2;break;case"transparency":i.opacity=r;break;case"depthTest":case"depthWrite":case"colorWrite":case"opacity":case"reflectivity":case"transparent":case"visible":case"wireframe":i[e]=r;break;case"vertexColors":!0===r&&(i.vertexColors=2),"face"===r&&(i.vertexColors=1)}}return"MeshBasicMaterial"===i.type&&delete i.emissive,"MeshPhongMaterial"!==i.type&&delete i.specular,i.opacity<1&&(i.transparent=!0),Af.setTextures(u),Af.parse(i)})});var Cf={};function jf(t){kf.call(this,t)}jf.prototype=Object.assign(Object.create(kf.prototype),{constructor:jf,load:function(s,t,n,e){void 0===s&&(s=""),void 0!==this.path&&(s=this.path+s),s=this.manager.resolveURL(s);var a=this,i=df.get(s);if(void 0!==i)return a.manager.itemStart(s),setTimeout(function(){t&&t(i),a.manager.itemEnd(s)},0),i;if(void 0===Cf[s]){var r=s.match(/^data:(.*?)(;base64)?,(.*)$/);if(r){var o=r[1],u=!!r[2],h=r[3],h=decodeURIComponent(h);u&&(h=atob(h));try{var c=(this.responseType||"").toLowerCase();switch(c){case"arraybuffer":case"blob":for(var f=new Uint8Array(h.length),l=0;l<h.length;l++)f[l]=h.charCodeAt(l);d="blob"===c?new Blob([f.buffer],{type:o}):f.buffer;break;case"document":var d=(new DOMParser).parseFromString(h,o);break;case"json":d=JSON.parse(h);break;default:d=h}setTimeout(function(){t&&t(d),a.manager.itemEnd(s)},0)}catch(t){setTimeout(function(){e&&e(t),a.manager.itemError(s),a.manager.itemEnd(s)},0)}}else{Cf[s]=[],Cf[s].push({onLoad:t,onProgress:n,onError:e});var v,p=new XMLHttpRequest;for(v in p.open("GET",s,!0),p.addEventListener("load",function(t){var n=this.response,e=Cf[s];if(delete Cf[s],200===this.status||0===this.status){0===this.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),df.add(s,n);for(var i=0,r=e.length;i<r;i++)(o=e[i]).onLoad&&o.onLoad(n);a.manager.itemEnd(s)}else{for(var o,i=0,r=e.length;i<r;i++)(o=e[i]).onError&&o.onError(t);a.manager.itemError(s),a.manager.itemEnd(s)}},!1),p.addEventListener("progress",function(t){for(var n=Cf[s],e=0,i=n.length;e<i;e++){var r=n[e];r.onProgress&&r.onProgress(t)}},!1),p.addEventListener("error",function(t){var n=Cf[s];delete Cf[s];for(var e=0,i=n.length;e<i;e++){var r=n[e];r.onError&&r.onError(t)}a.manager.itemError(s),a.manager.itemEnd(s)},!1),p.addEventListener("abort",function(t){var n=Cf[s];delete Cf[s];for(var e=0,i=n.length;e<i;e++){var r=n[e];r.onError&&r.onError(t)}a.manager.itemError(s),a.manager.itemEnd(s)},!1),void 0!==this.responseType&&(p.responseType=this.responseType),void 0!==this.withCredentials&&(p.withCredentials=this.withCredentials),p.overrideMimeType&&p.overrideMimeType(void 0!==this.mimeType?this.mimeType:"text/plain"),this.requestHeader)p.setRequestHeader(v,this.requestHeader[v]);p.send(null)}return a.manager.itemStart(s),p}Cf[s].push({onLoad:t,onProgress:n,onError:e})},setResponseType:function(t){return this.responseType=t,this},setWithCredentials:function(t){return this.withCredentials=t,this},setMimeType:function(t){return this.mimeType=t,this},setRequestHeader:function(t){return this.requestHeader=t,this}});var Pf={arraySlice:function(t,n,e){return Pf.isTypedArray(t)?new t.constructor(t.subarray(n,void 0!==e?e:t.length)):t.slice(n,e)},convertArray:function(t,n,e){return!t||!e&&t.constructor===n?t:"number"==typeof n.BYTES_PER_ELEMENT?new n(t):Array.prototype.slice.call(t)},isTypedArray:function(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)},getKeyframeOrder:function(e){for(var t=e.length,n=new Array(t),i=0;i!==t;++i)n[i]=i;return n.sort(function(t,n){return e[t]-e[n]}),n},sortedArray:function(t,n,e){for(var i=t.length,r=new t.constructor(i),o=0,s=0;s!==i;++o)for(var a=e[o]*n,u=0;u!==n;++u)r[s++]=t[a+u];return r},flattenJSON:function(t,n,e,i){for(var r=1,o=t[0];void 0!==o&&void 0===o[i];)o=t[r++];if(void 0!==o){var s=o[i];if(void 0!==s)if(Array.isArray(s))for(;void 0!==(s=o[i])&&(n.push(o.time),e.push.apply(e,s)),o=t[r++],void 0!==o;);else if(void 0!==s.toArray)for(;void 0!==(s=o[i])&&(n.push(o.time),s.toArray(e,e.length)),o=t[r++],void 0!==o;);else for(;void 0!==(s=o[i])&&(n.push(o.time),e.push(s)),o=t[r++],void 0!==o;);}},subclip:function(t,n,e,i,r){r=r||30;var o=t.clone();o.name=n;for(var s=[],a=0;a<o.tracks.length;++a){for(var u=o.tracks[a],h=u.getValueSize(),c=[],f=[],l=0;l<u.times.length;++l){var d=u.times[l]*r;if(!(d<e||i<=d)){c.push(u.times[l]);for(var v=0;v<h;++v)f.push(u.values[l*h+v])}}0!==c.length&&(u.times=Pf.convertArray(c,u.times.constructor),u.values=Pf.convertArray(f,u.values.constructor),s.push(u))}o.tracks=s;for(var p=1/0,a=0;a<o.tracks.length;++a)p>o.tracks[a].times[0]&&(p=o.tracks[a].times[0]);for(a=0;a<o.tracks.length;++a)o.tracks[a].shift(-1*p);return o.resetDuration(),o}};function Df(t,n,e,i){this.parameterPositions=t,this.da=0,this.resultBuffer=void 0!==i?i:new n.constructor(e),this.sampleValues=n,this.valueSize=e}function If(t,n,e,i){Df.call(this,t,n,e,i),this.va=-0,this.pa=-0,this.ma=-0,this.ga=-0}function Nf(t,n,e,i){Df.call(this,t,n,e,i)}function Ff(t,n,e,i){Df.call(this,t,n,e,i)}function Uf(t,n,e,i){if(void 0===t)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===n||0===n.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=Pf.convertArray(n,this.TimeBufferType),this.values=Pf.convertArray(e,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}function Bf(t,n,e){Uf.call(this,t,n,e)}function Gf(t,n,e,i){Uf.call(this,t,n,e,i)}function Hf(t,n,e,i){Uf.call(this,t,n,e,i)}function Vf(t,n,e,i){Df.call(this,t,n,e,i)}function zf(t,n,e,i){Uf.call(this,t,n,e,i)}function Wf(t,n,e,i){Uf.call(this,t,n,e,i)}function Xf(t,n,e,i){Uf.call(this,t,n,e,i)}function Zf(t,n,e){this.name=t,this.tracks=e,this.duration=void 0!==n?n:-1,this.uuid=Mt.generateUUID(),this.duration<0&&this.resetDuration()}function Yf(t){if(void 0===t.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");var n,e,i=function(t){switch(t.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Hf;case"vector":case"vector2":case"vector3":case"vector4":return Xf;case"color":return Gf;case"quaternion":return zf;case"bool":case"boolean":return Bf;case"string":return Wf}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+t)}(t.type);return void 0===t.times&&(Pf.flattenJSON(t.keys,n=[],e=[],"value"),t.times=n,t.values=e),void 0!==i.parse?i.parse(t):new i(t.name,t.times,t.values,t.interpolation)}function qf(t){"boolean"==typeof t&&(console.warn("JSONLoader: showStatus parameter has been removed from constructor."),t=void 0),this.manager=void 0!==t?t:cf,this.withCredentials=!1}Object.assign(Df.prototype,{evaluate:function(t){var n,e=this.parameterPositions,i=this.da,r=e[i],o=e[i-1];t:{n:{e:{i:if(!(t<r)){for(var s=i+2;;){if(void 0===r){if(t<o)break i;return i=e.length,this.da=i,this.afterEnd_(i-1,t,o)}if(i===s)break;if(o=r,t<(r=e[++i]))break n}n=e.length;break e}if(o<=t)break t;var a=e[1];t<a&&(i=2,o=a);for(s=i-2;;){if(void 0===o)return this.da=0,this.beforeStart_(0,t,r);if(i===s)break;if(r=o,(o=e[--i-1])<=t)break n}n=i,i=0}for(;i<n;){var u=i+n>>>1;t<e[u]?n=u:i=1+u}if(r=e[i],void 0===(o=e[i-1]))return this.da=0,this.beforeStart_(0,t,r);if(void 0===r)return i=e.length,this.da=i,this.afterEnd_(i-1,o,t)}this.da=i,this.intervalChanged_(i,o,r)}return this.interpolate_(i,o,t,r)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings||this.DefaultSettings_},copySampleValue_:function(t){for(var n=this.resultBuffer,e=this.sampleValues,i=this.valueSize,r=t*i,o=0;o!==i;++o)n[o]=e[r+o];return n},interpolate_:function(){throw new Error("call to abstract method")},intervalChanged_:function(){}}),Object.assign(Df.prototype,{beforeStart_:Df.prototype.copySampleValue_,afterEnd_:Df.prototype.copySampleValue_}),If.prototype=Object.assign(Object.create(Df.prototype),{constructor:If,DefaultSettings_:{endingStart:Xe,endingEnd:Xe},intervalChanged_:function(t,n,e){var i=this.parameterPositions,r=t-2,o=t+1,s=i[r],a=i[o];if(void 0===s)switch(this.getSettings_().endingStart){case Ze:r=t,s=2*n-e;break;case 2402:s=n+i[r=i.length-2]-i[r+1];break;default:r=t,s=e}if(void 0===a)switch(this.getSettings_().endingEnd){case Ze:o=t,a=2*e-n;break;case 2402:a=e+i[o=1]-i[0];break;default:o=t-1,a=n}var u=.5*(e-n),h=this.valueSize;this.va=u/(n-s),this.ma=u/(a-e),this.pa=r*h,this.ga=o*h},interpolate_:function(t,n,e,i){for(var r=this.resultBuffer,o=this.sampleValues,s=this.valueSize,a=t*s,u=a-s,h=this.pa,c=this.ga,f=this.va,t=this.ma,e=(e-n)/(i-n),i=e*e,n=i*e,l=-f*n+2*f*i-f*e,d=(1+f)*n+(-1.5-2*f)*i+(-.5+f)*e+1,v=(-1-t)*n+(1.5+t)*i+.5*e,p=t*n-t*i,m=0;m!==s;++m)r[m]=l*o[h+m]+d*o[u+m]+v*o[a+m]+p*o[c+m];return r}}),Nf.prototype=Object.assign(Object.create(Df.prototype),{constructor:Nf,interpolate_:function(t,n,e,i){for(var r=this.resultBuffer,o=this.sampleValues,s=this.valueSize,a=t*s,u=a-s,h=(e-n)/(i-n),c=1-h,f=0;f!==s;++f)r[f]=o[u+f]*c+o[a+f]*h;return r}}),Ff.prototype=Object.assign(Object.create(Df.prototype),{constructor:Ff,interpolate_:function(t){return this.copySampleValue_(t-1)}}),Object.assign(Uf.prototype,{constructor:Uf,TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:We,InterpolantFactoryMethodDiscrete:function(t){return new Ff(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodLinear:function(t){return new Nf(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:function(t){return new If(this.times,this.values,this.getValueSize(),t)},setInterpolation:function(t){var n;switch(t){case ze:n=this.InterpolantFactoryMethodDiscrete;break;case We:n=this.InterpolantFactoryMethodLinear;break;case 2302:n=this.InterpolantFactoryMethodSmooth}if(void 0!==n)return this.createInterpolant=n,this;var e="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(t===this.DefaultInterpolation)throw new Error(e);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",e),this},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return ze;case this.InterpolantFactoryMethodLinear:return We;case this.InterpolantFactoryMethodSmooth:return 2302}},getValueSize:function(){return this.values.length/this.times.length},shift:function(t){if(0!==t)for(var n=this.times,e=0,i=n.length;e!==i;++e)n[e]+=t;return this},scale:function(t){if(1!==t)for(var n=this.times,e=0,i=n.length;e!==i;++e)n[e]*=t;return this},trim:function(t,n){for(var e,i=this.times,r=i.length,o=0,s=r-1;o!==r&&i[o]<t;)++o;for(;-1!==s&&i[s]>n;)--s;return++s,0===o&&s===r||(s<=o&&(o=(s=Math.max(s,1))-1),e=this.getValueSize(),this.times=Pf.arraySlice(i,o,s),this.values=Pf.arraySlice(this.values,o*e,s*e)),this},validate:function(){var t=!0,n=this.getValueSize();n-Math.floor(n)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);var e=this.times,i=this.values,r=e.length;0===r&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);for(var o=null,s=0;s!==r;s++){var a=e[s];if("number"==typeof a&&isNaN(a)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,s,a),t=!1;break}if(null!==o&&a<o){console.error("THREE.KeyframeTrack: Out of order keys.",this,s,a,o),t=!1;break}o=a}if(void 0!==i&&Pf.isTypedArray(i))for(var s=0,u=i.length;s!==u;++s){var h=i[s];if(isNaN(h)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,s,h),t=!1;break}}return t},optimize:function(){for(var t=Pf.arraySlice(this.times),n=Pf.arraySlice(this.values),e=this.getValueSize(),i=2302===this.getInterpolation(),r=1,o=t.length-1,s=1;s<o;++s){var a=!1,u=t[s];if(u!==t[s+1]&&(1!==s||u!==u[0]))if(i)a=!0;else for(var h=s*e,c=h-e,f=h+e,l=0;l!==e;++l){var d=n[h+l];if(d!==n[c+l]||d!==n[f+l]){a=!0;break}}if(a){if(s!==r){t[r]=t[s];for(var v=s*e,p=r*e,l=0;l!==e;++l)n[p+l]=n[v+l]}++r}}if(0<o){t[r]=t[o];for(v=o*e,p=r*e,l=0;l!==e;++l)n[p+l]=n[v+l];++r}return r!==t.length?(this.times=Pf.arraySlice(t,0,r),this.values=Pf.arraySlice(n,0,r*e)):(this.times=t,this.values=n),this},clone:function(){var t=Pf.arraySlice(this.times,0),n=Pf.arraySlice(this.values,0),n=new this.constructor(this.name,t,n);return n.createInterpolant=this.createInterpolant,n}}),Bf.prototype=Object.assign(Object.create(Uf.prototype),{constructor:Bf,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:ze,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Gf.prototype=Object.assign(Object.create(Uf.prototype),{constructor:Gf,ValueTypeName:"color"}),Hf.prototype=Object.assign(Object.create(Uf.prototype),{constructor:Hf,ValueTypeName:"number"}),Vf.prototype=Object.assign(Object.create(Df.prototype),{constructor:Vf,interpolate_:function(t,n,e,i){for(var r=this.resultBuffer,o=this.sampleValues,s=this.valueSize,a=t*s,u=(e-n)/(i-n),h=a+s;a!==h;a+=4)st.slerpFlat(r,0,o,a-s,o,a,u);return r}}),zf.prototype=Object.assign(Object.create(Uf.prototype),{constructor:zf,ValueTypeName:"quaternion",DefaultInterpolation:We,InterpolantFactoryMethodLinear:function(t){return new Vf(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:void 0}),Wf.prototype=Object.assign(Object.create(Uf.prototype),{constructor:Wf,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:ze,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Xf.prototype=Object.assign(Object.create(Uf.prototype),{constructor:Xf,ValueTypeName:"vector"}),Object.assign(Zf,{parse:function(t){for(var n=[],e=t.tracks,i=1/(t.fps||1),r=0,o=e.length;r!==o;++r)n.push(Yf(e[r]).scale(i));return new Zf(t.name,t.duration,n)},CreateFromMorphTargetSequence:function(t,n,e,i){for(var r=n.length,o=[],s=0;s<r;s++){var a=[];(h=[]).push((s+r-1)%r,s,(s+1)%r),a.push(0,1,0);var u=Pf.getKeyframeOrder(h),h=Pf.sortedArray(h,1,u),a=Pf.sortedArray(a,1,u);i||0!==h[0]||(h.push(r),a.push(a[0])),o.push(new Hf(".morphTargetInfluences["+n[s].name+"]",h,a).scale(1/e))}return new Zf(t,-1,o)},findByName:function(t,n){var e=t;Array.isArray(t)||(e=t.geometry&&t.geometry.animations||t.animations);for(var i=0;i<e.length;i++)if(e[i].name===n)return e[i];return null},CreateClipsFromMorphTargetSequences:function(t,n,e){for(var i={},r=/^([\w-]*?)([\d]+)$/,o=0,s=t.length;o<s;o++){var a=t[o],u=a.name.match(r);u&&1<u.length&&((u=i[h=u[1]])||(i[h]=u=[]),u.push(a))}var h,c=[];for(h in i)c.push(Zf.CreateFromMorphTargetSequence(h,i[h],n,e));return c},parseAnimation:function(t,n){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;for(var e=function(t,n,e,i,r){var o;0!==e.length&&(Pf.flattenJSON(e,o=[],e=[],i),0!==o.length&&r.push(new t(n,o,e)))},i=[],r=t.name||"default",o=t.length||-1,s=t.fps||30,a=t.hierarchy||[],u=0;u<a.length;u++){var h=a[u].keys;if(h&&0!==h.length)if(h[0].morphTargets){for(var c,f={},l=0;l<h.length;l++)if(h[l].morphTargets)for(var d=0;d<h[l].morphTargets.length;d++)f[h[l].morphTargets[d]]=-1;for(c in f){for(var v=[],p=[],d=0;d!==h[l].morphTargets.length;++d){var m=h[l];v.push(m.time),p.push(m.morphTarget===c?1:0)}i.push(new Hf(".morphTargetInfluence["+c+"]",v,p))}o=f.length*(s||1)}else{var g=".bones["+n[u].name+"]";e(Xf,g+".position",h,"pos",i),e(zf,g+".quaternion",h,"rot",i),e(Xf,g+".scale",h,"scl",i)}}return 0===i.length?null:new Zf(r,o,i)}}),Object.assign(Zf.prototype,{resetDuration:function(){for(var t=0,n=0,e=this.tracks.length;n!==e;++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 t=0;t<this.tracks.length;t++)this.tracks[t].trim(0,this.duration);return this},validate:function(){for(var t=!0,n=0;n<this.tracks.length;n++)t=t&&this.tracks[n].validate();return t},optimize:function(){for(var t=0;t<this.tracks.length;t++)this.tracks[t].optimize();return this},clone:function(){for(var t=[],n=0;n<this.tracks.length;n++)t.push(this.tracks[n].clone());return new Zf(this.name,this.duration,t)}}),Object.assign(qf.prototype,{crossOrigin:"anonymous",load:function(e,i,t,n){var r=this,o=void 0===this.path?lf(e):this.path;this.resourcePath=o+"maps/";var s=new jf(this.manager);s.setPath(this.path),s.setWithCredentials(this.withCredentials),s.load(e,function(t){var n=JSON.parse(t),t=n.metadata;if(void 0!==t){t=t.type;if(void 0!==t&&"object"===t.toLowerCase())return void console.error("JSONLoader: "+e+" should be loaded with ObjectLoader instead.")}n=r.parse(n,o);i(n.geometry,n.materials)},t,n)},setPath:function(t){return this.path=t,this},setResourcePath:function(t){return this.resourcePath=t,this},setCrossOrigin:function(t){return this.crossOrigin=t,this},parse:function(t,n){void 0!==(t=void 0!==t.data?t.data:t).scale?t.scale=1/t.scale:t.scale=1;var e=new Dr;return function(t,n){var e,i,r,o,s,a,u,h,c,f,l,d,v,p,m,g,y,b,w,_,x,M,S,E,T=t.faces,L=t.vertices,R=t.normals,O=t.colors,A=t.scale,k=0;if(void 0!==t.uvs){for(e=0;e<t.uvs.length;e++)t.uvs[e].length&&k++;for(e=0;e<k;e++)n.faceVertexUvs[e]=[]}for(o=0,s=L.length;o<s;)(y=new St).x=L[o++]*A,y.y=L[o++]*A,y.z=L[o++]*A,n.vertices.push(y);for(o=0,s=T.length;o<s;)if(l=(f=T[o++])&2,d=f&8,v=f&16,p=f&32,m=f&64,g=f&128,f&1){if((w=new Ar).a=T[o],w.b=T[o+1],w.c=T[o+3],(_=new Ar).a=T[o+1],_.b=T[o+2],_.c=T[o+3],o+=4,l&&(c=T[o++],w.materialIndex=c,_.materialIndex=c),r=n.faces.length,d)for(e=0;e<k;e++)for(S=t.uvs[e],n.faceVertexUvs[e][r]=[],n.faceVertexUvs[e][r+1]=[],i=0;i<4;i++)E=new fi(S[2*(h=T[o++])],S[2*h+1]),2!==i&&n.faceVertexUvs[e][r].push(E),0!==i&&n.faceVertexUvs[e][r+1].push(E);if(v&&(u=3*T[o++],w.normal.set(R[u++],R[u++],R[u]),_.normal.copy(w.normal)),p)for(e=0;e<4;e++)u=3*T[o++],M=new St(R[u++],R[u++],R[u]),2!==e&&w.vertexNormals.push(M),0!==e&&_.vertexNormals.push(M);if(m&&(x=O[a=T[o++]],w.color.setHex(x),_.color.setHex(x)),g)for(e=0;e<4;e++)x=O[a=T[o++]],2!==e&&w.vertexColors.push(new _i(x)),0!==e&&_.vertexColors.push(new _i(x));n.faces.push(w),n.faces.push(_)}else{if((b=new Ar).a=T[o++],b.b=T[o++],b.c=T[o++],l&&(c=T[o++],b.materialIndex=c),r=n.faces.length,d)for(e=0;e<k;e++)for(S=t.uvs[e],n.faceVertexUvs[e][r]=[],i=0;i<3;i++)E=new fi(S[2*(h=T[o++])],S[2*h+1]),n.faceVertexUvs[e][r].push(E);if(v&&(u=3*T[o++],b.normal.set(R[u++],R[u++],R[u])),p)for(e=0;e<3;e++)u=3*T[o++],M=new St(R[u++],R[u++],R[u]),b.vertexNormals.push(M);if(m&&(a=T[o++],b.color.setHex(O[a])),g)for(e=0;e<3;e++)a=T[o++],b.vertexColors.push(new _i(O[a]));n.faces.push(b)}}(t,e),function(t,n){var e=void 0!==t.influencesPerVertex?t.influencesPerVertex:2;if(t.skinWeights)for(var i=0,r=t.skinWeights.length;i<r;i+=e){var o=t.skinWeights[i],s=1<e?t.skinWeights[i+1]:0,a=2<e?t.skinWeights[i+2]:0,u=3<e?t.skinWeights[i+3]:0;n.skinWeights.push(new Ci(o,s,a,u))}if(t.skinIndices)for(i=0,r=t.skinIndices.length;i<r;i+=e){var h=t.skinIndices[i],c=1<e?t.skinIndices[i+1]:0,f=2<e?t.skinIndices[i+2]:0,l=3<e?t.skinIndices[i+3]:0;n.skinIndices.push(new Ci(h,c,f,l))}n.bones=t.bones,n.bones&&0<n.bones.length&&(n.skinWeights.length!==n.skinIndices.length||n.skinIndices.length!==n.vertices.length)&&console.warn("When skinning, number of vertices ("+n.vertices.length+"), skinIndices ("+n.skinIndices.length+"), and skinWeights ("+n.skinWeights.length+") should match.")}(t,e),function(t,n){var e=t.scale;if(void 0!==t.morphTargets)for(var i=0,r=t.morphTargets.length;i<r;i++){n.morphTargets[i]={},n.morphTargets[i].name=t.morphTargets[i].name,n.morphTargets[i].vertices=[];for(var o=n.morphTargets[i].vertices,s=t.morphTargets[i].vertices,a=0,u=s.length;a<u;a+=3){var h=new St;h.x=s[a]*e,h.y=s[a+1]*e,h.z=s[a+2]*e,o.push(h)}}if(void 0!==t.morphColors&&0<t.morphColors.length){console.warn('fm.JSONLoader: "morphColors" no longer supported. Using them as face colors.');for(var c=n.faces,f=t.morphColors[0].colors,i=0,r=c.length;i<r;i++)c[i].color.fromArray(f,3*i)}}(t,e),function(t,n){var e=[],i=[];void 0!==t.animation&&i.push(t.animation),void 0!==t.animations&&(t.animations.length?i=i.concat(t.animations):i.push(t.animations));for(var r=0;r<i.length;r++){var o=Zf.parseAnimation(i[r],n.bones);o&&e.push(o)}n.morphTargets&&(t=Zf.CreateClipsFromMorphTargetSequences(n.morphTargets,10),e=e.concat(t)),0<e.length&&(n.animations=e)}(t,e),e.computeFaceNormals(),e.computeBoundingSphere(),void 0===t.materials||0===t.materials.length?{geometry:e}:{geometry:e,materials:kf.prototype.initMaterials(t.materials,this.resourcePath||n,this.crossOrigin)}}});var Kf=qf;function Jf(t,n){Z.call(this),this.type="Light",this.color=new _i(t),this.intensity=void 0!==n?n:1,this.receiveShadow=void 0}function Qf(t){this.camera=t,this.bias=0,this.radius=1,this.mapSize=new fi(512,512),this.map=null,this.mapPass=null,this.matrix=new Et,this.ya=new Tt,this.ba=new fi(1,1),this.wa=1,this._a=[new Ci(0,0,1,1)]}function $f(){Qf.call(this,new q(-5,5,5,-5,.5,500))}function tl(t,n){Jf.call(this,t,n),this.type="DirectionalLight",this.position.copy(Z.DefaultUp),this.updateMatrix(),this.target=new Z,this.shadow=new $f}function nl(){Qf.call(this,new Y(90,1,.5,500)),this.ba=new fi(4,2),this.wa=6,this._a=[new Ci(2,1,1,1),new Ci(0,1,1,1),new Ci(3,1,1,1),new Ci(1,1,1,1),new Ci(3,0,1,1),new Ci(1,0,1,1)],this.xa=[new St(1,0,0),new St(-1,0,0),new St(0,0,1),new St(0,0,-1),new St(0,1,0),new St(0,-1,0)],this.Ma=[new St(0,1,0),new St(0,1,0),new St(0,1,0),new St(0,1,0),new St(0,0,1),new St(0,0,-1)]}function el(t,n,e,i){Jf.call(this,t,n),this.type="PointLight",Object.defineProperty(this,"power",{get:function(){return 4*this.intensity*Math.PI},set:function(t){this.intensity=t/(4*Math.PI)}}),this.distance=void 0!==e?e:0,this.decay=void 0!==i?i:1,this.shadow=new nl}function il(){Qf.call(this,new Y(50,1,.5,500))}function rl(t,n,e,i,r,o){Jf.call(this,t,n),this.type="SpotLight",this.position.copy(Z.DefaultUp),this.updateMatrix(),this.target=new Z,Object.defineProperty(this,"power",{get:function(){return this.intensity*Math.PI},set:function(t){this.intensity=t/Math.PI}}),this.distance=void 0!==e?e:0,this.angle=void 0!==i?i:Math.PI/3,this.penumbra=void 0!==r?r:0,this.decay=void 0!==o?o:1,this.shadow=new il}function ol(t,n){t&&t.isGeometry&&console.error("THREE.SkinnedMesh no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."),Ko.call(this,t,n),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new Et,this.bindMatrixInverse=new Et}Jf.prototype=Object.assign(Object.create(Z.prototype),{constructor:Jf,isLight:!0,copy:function(t){return Z.prototype.copy.call(this,t),this.color.copy(t.color),this.intensity=t.intensity,this}}),Object.assign(Qf.prototype,{Sa:new Et,Ea:new St,Ta:new St,getViewportCount:function(){return this.wa},getFrustum:function(){return this.ya},updateMatrices:function(t){var n=this.camera,e=this.matrix,i=this.Sa,r=this.Ta,o=this.Ea;o.setFromMatrixPosition(t.matrixWorld),n.position.copy(o),r.setFromMatrixPosition(t.target.matrixWorld),n.lookAt(r),n.updateMatrixWorld(),i.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this.ya.setFromProjectionMatrix(i),e.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),e.multiply(n.projectionMatrix),e.multiply(n.matrixWorldInverse)},getViewport:function(t){return this._a[t]},getFrameExtents:function(){return this.ba},copy:function(t){return this.camera=t.camera.clone(),this.bias=t.bias,this.radius=t.radius,this.mapSize.copy(t.mapSize),this},clone:function(){return(new this.constructor).copy(this)}}),$f.prototype=Object.assign(Object.create(Qf.prototype),{constructor:$f,isDirectionalLightShadow:!0,updateMatrices:function(t){Qf.prototype.updateMatrices.call(this,t)}}),tl.prototype=Object.assign(Object.create(Jf.prototype),{constructor:tl,isDirectionalLight:!0,copy:function(t){return Jf.prototype.copy.call(this,t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}),nl.prototype=Object.assign(Object.create(Qf.prototype),{constructor:nl,isPointLightShadow:!0,updateMatrices:function(t,n){void 0===n&&(n=0);var e=this.camera,i=this.matrix,r=this.Ea,o=this.Ta,s=this.Sa;r.setFromMatrixPosition(t.matrixWorld),e.position.copy(r),o.copy(e.position),o.add(this.xa[n]),e.up.copy(this.Ma[n]),e.lookAt(o),e.updateMatrixWorld(),i.makeTranslation(-r.x,-r.y,-r.z),s.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),this.ya.setFromProjectionMatrix(s)}}),el.prototype=Object.assign(Object.create(Jf.prototype),{constructor:el,isPointLight:!0,copy:function(t){return Jf.prototype.copy.call(this,t),this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this}}),il.prototype=Object.assign(Object.create(Qf.prototype),{constructor:il,isSpotLightShadow:!0,updateMatrices:function(t){var n=this.camera,e=2*Mt.RAD2DEG*t.angle,i=this.mapSize.width/this.mapSize.height,r=t.distance||n.far;e===n.fov&&i===n.aspect&&r===n.far||(n.fov=e,n.aspect=i,n.far=r,n.updateProjectionMatrix()),Qf.prototype.updateMatrices.call(this,t)}}),rl.prototype=Object.assign(Object.create(Jf.prototype),{constructor:rl,isSpotLight:!0,copy:function(t){return Jf.prototype.copy.call(this,t),this.distance=t.distance,this.angle=t.angle,this.penumbra=t.penumbra,this.decay=t.decay,this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}),ol.prototype=Object.assign(Object.create(Ko.prototype),{constructor:ol,isSkinnedMesh:!0,bind:function(t,n){this.skeleton=t,void 0===n&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),n=this.matrixWorld),this.bindMatrix.copy(n),this.bindMatrixInverse.getInverse(n)},pose:function(){this.skeleton.pose()},normalizeSkinWeights:function(){for(var t=new Ci,n=this.geometry.attributes.skinWeight,e=0,i=n.count;e<i;e++){t.x=n.getX(e),t.y=n.getY(e),t.z=n.getZ(e),t.w=n.getW(e);var r=1/t.manhattanLength();r!=1/0?t.multiplyScalar(r):t.set(1,0,0,0),n.setXYZW(e,t.x,t.y,t.z,t.w)}},updateMatrixWorld:function(t){Ko.prototype.updateMatrixWorld.call(this,t),"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)}});var sl=new St,al=new St,ul=new Et,hl=new Ki,cl=new it;function fl(t,n,e){1===e&&console.error("THREE.Line: parameter THREE.LinePieces no longer supported. Use THREE.LineSegments instead."),Z.call(this),this.type="Line",this.geometry=void 0!==t?t:new eo,this.material=void 0!==n?n:new xc}fl.prototype=Object.assign(Object.create(Z.prototype),{constructor:fl,isLine:!0,computeLineDistances:function(){var t=this.geometry;if(t.isBufferGeometry)if(null===t.index){for(var n=t.attributes.position,e=[0],i=1,r=n.count;i<r;i++)sl.fromBufferAttribute(n,i-1),al.fromBufferAttribute(n,i),e[i]=e[i-1],e[i]+=sl.distanceTo(al);t.setAttribute("lineDistance",new Wr(e,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(t.isGeometry){var o=t.vertices;(e=t.lineDistances)[0]=0;for(i=1,r=o.length;i<r;i++)e[i]=e[i-1],e[i]+=o[i-1].distanceTo(o[i])}return this},raycast:function(t,n){var e=this.geometry,i=this.matrixWorld,r=t.params.Line.threshold;if(null===e.boundingSphere&&e.computeBoundingSphere(),cl.copy(e.boundingSphere),cl.applyMatrix4(i),cl.radius+=r,!1!==t.ray.intersectsSphere(cl)){ul.getInverse(i),hl.copy(t.ray).applyMatrix4(ul);var r=r/((this.scale.x+this.scale.y+this.scale.z)/3),o=r*r,s=new St,a=new St,u=new St,h=new St,c=this&&this.isLineSegments?2:1;if(e.isBufferGeometry){var r=e.index,f=e.attributes.position.array;if(null!==r)for(var l=r.array,d=0,v=l.length-1;d<v;d+=c){var p=l[d],m=l[d+1];s.fromArray(f,3*p),a.fromArray(f,3*m),o<hl.distanceSqToSegment(s,a,h,u)||(h.applyMatrix4(this.matrixWorld),(g=t.ray.origin.distanceTo(h))<t.near||g>t.far||n.push({distance:g,point:u.clone().applyMatrix4(this.matrixWorld),index:d,face:null,faceIndex:null,object:this}))}else for(d=0,v=f.length/3-1;d<v;d+=c)s.fromArray(f,3*d),a.fromArray(f,3*d+3),o<hl.distanceSqToSegment(s,a,h,u)||(h.applyMatrix4(this.matrixWorld),(g=t.ray.origin.distanceTo(h))<t.near||g>t.far||n.push({distance:g,point:u.clone().applyMatrix4(this.matrixWorld),index:d,face:null,faceIndex:null,object:this}))}else if(e.isGeometry)for(var g,y=e.vertices,b=y.length,d=0;d<b-1;d+=c)o<hl.distanceSqToSegment(y[d],y[d+1],h,u)||(h.applyMatrix4(this.matrixWorld),(g=t.ray.origin.distanceTo(h))<t.near||g>t.far||n.push({distance:g,point:u.clone().applyMatrix4(this.matrixWorld),index:d,face:null,faceIndex:null,object:this}))}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var ll=new St,dl=new St;function vl(t,n){fl.call(this,t,n),this.type="LineSegments"}function pl(t,n){fl.call(this,t,n),this.type="LineLoop"}vl.prototype=Object.assign(Object.create(fl.prototype),{constructor:vl,isLineSegments:!0,computeLineDistances:function(){var t=this.geometry;if(t.isBufferGeometry)if(null===t.index){for(var n=t.attributes.position,e=[],i=0,r=n.count;i<r;i+=2)ll.fromBufferAttribute(n,i),dl.fromBufferAttribute(n,i+1),e[i]=0===i?0:e[i-1],e[i+1]=e[i]+ll.distanceTo(dl);t.setAttribute("lineDistance",new Wr(e,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(t.isGeometry)for(var o=t.vertices,e=t.lineDistances,i=0,r=o.length;i<r;i+=2)ll.copy(o[i]),dl.copy(o[i+1]),e[i]=0===i?0:e[i-1],e[i+1]=e[i]+ll.distanceTo(dl);return this}}),pl.prototype=Object.assign(Object.create(fl.prototype),{constructor:pl,isLineLoop:!0});var ml=new Et,gl=new Ki,yl=new it,bl=new St;function wl(t,n){Z.call(this),this.type="Points",this.geometry=void 0!==t?t:new eo,this.material=void 0!==n?n:new gf,this.updateMorphTargets()}function _l(t,n,e,i,r,o,s){var a=gl.distanceSqToPoint(t);a<e&&(e=new St,gl.closestPointToPoint(t,e),e.applyMatrix4(i),(i=r.ray.origin.distanceTo(e))<r.near||i>r.far||o.push({distance:i,distanceToRay:Math.sqrt(a),point:e,index:n,face:null,object:s}))}function xl(){Z.call(this),this.type="Bone"}wl.prototype=Object.assign(Object.create(Z.prototype),{constructor:wl,isPoints:!0,raycast:function(t,n){var e=this.geometry,i=this.matrixWorld,r=t.params.Points.threshold;if(null===e.boundingSphere&&e.computeBoundingSphere(),yl.copy(e.boundingSphere),yl.applyMatrix4(i),yl.radius+=r,!1!==t.ray.intersectsSphere(yl)){ml.getInverse(i),gl.copy(t.ray).applyMatrix4(ml);var r=r/((this.scale.x+this.scale.y+this.scale.z)/3),o=r*r;if(e.isBufferGeometry){var r=e.index,s=e.attributes.position.array;if(null!==r)for(var a=r.array,u=0,h=a.length;u<h;u++){var c=a[u];bl.fromArray(s,3*c),_l(bl,c,o,i,t,n,this)}else for(var u=0,f=s.length/3;u<f;u++)bl.fromArray(s,3*u),_l(bl,u,o,i,t,n,this)}else for(var l=e.vertices,u=0,f=l.length;u<f;u++)_l(l[u],u,o,i,t,n,this)}},updateMorphTargets:function(){var t,n,e,i=this.geometry;if(i.isBufferGeometry){var r=i.morphAttributes,o=Object.keys(r);if(0<o.length){var s=r[o[0]];if(void 0!==s)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},t=0,n=s.length;t<n;t++)e=s[t].name||String(t),this.morphTargetInfluences.push(0),this.morphTargetDictionary[e]=t}}else{i=i.morphTargets;void 0!==i&&0<i.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)}}),xl.prototype=Object.assign(Object.create(Z.prototype),{constructor:xl,isBone:!0});var Gi="\\[\\]\\.:\\/",Ml=new RegExp("["+Gi+"]","g"),tr="[^"+Gi+"]",ir="[^"+Gi.replace("\\.","")+"]",sr=/((?:WC+[\/:])*)/.source.replace("WC",tr),dr=/(WCOD+)?/.source.replace("WCOD",ir),_r=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",tr),Tu=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",tr),Sl=new RegExp("^"+sr+dr+_r+Tu+"$"),El=["material","materials","bones"];function Tl(t,n,e){e=e||Ll.parseTrackName(n);this.La=t,this.Ra=t.subscribe_(n,e)}function Ll(t,n,e){this.path=n,this.parsedPath=e||Ll.parseTrackName(n),this.node=Ll.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t}Object.assign(Tl.prototype,{getValue:function(t,n){this.bind();var e=this.La.nCachedObjects_,e=this.Ra[e];void 0!==e&&e.getValue(t,n)},setValue:function(t,n){for(var e=this.Ra,i=this.La.nCachedObjects_,r=e.length;i!==r;++i)e[i].setValue(t,n)},bind:function(){for(var t=this.Ra,n=this.La.nCachedObjects_,e=t.length;n!==e;++n)t[n].bind()},unbind:function(){for(var t=this.Ra,n=this.La.nCachedObjects_,e=t.length;n!==e;++n)t[n].unbind()}}),Object.assign(Ll,{Composite:Tl,create:function(t,n,e){return new(t&&t.isAnimationObjectGroup?Ll.Composite:Ll)(t,n,e)},sanitizeNodeName:function(t){return t.replace(/\s/g,"_").replace(Ml,"")},parseTrackName:function(t){var n=Sl.exec(t);if(!n)throw new Error("PropertyBinding: Cannot parse trackName: "+t);var e={nodeName:n[2],objectName:n[3],objectIndex:n[4],propertyName:n[5],propertyIndex:n[6]},i=e.nodeName&&e.nodeName.lastIndexOf(".");if(void 0!==i&&-1!==i&&(n=e.nodeName.substring(i+1),-1!==El.indexOf(n)&&(e.nodeName=e.nodeName.substring(0,i),e.objectName=n)),null===e.propertyName||0===e.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return e},findNode:function(t,r){if(!r||""===r||"."===r||-1===r||r===t.name||r===t.uuid)return t;if(t.skeleton){var n=t.skeleton.getBoneByName(r);if(void 0!==n)return n}if(t.children){t=function t(n){for(var e=0;e<n.length;e++){var i=n[e];if(i.name===r||i.uuid===r)return i;i=t(i.children);if(i)return i}return null}(t.children);if(t)return t}return null}}),Object.assign(Ll.prototype,{Oa:function(){},Aa:function(){},BindingType:{Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Versioning:{None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},GetterByBindingType:[function(t,n){t[n]=this.node[this.propertyName]},function(t,n){for(var e=this.resolvedProperty,i=0,r=e.length;i!==r;++i)t[n++]=e[i]},function(t,n){t[n]=this.resolvedProperty[this.propertyIndex]},function(t,n){this.resolvedProperty.toArray(t,n)}],SetterByBindingTypeAndVersioning:[[function(t,n){this.targetObject[this.propertyName]=t[n]},function(t,n){this.targetObject[this.propertyName]=t[n],this.targetObject.needsUpdate=!0},function(t,n){this.targetObject[this.propertyName]=t[n],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,n){for(var e=this.resolvedProperty,i=0,r=e.length;i!==r;++i)e[i]=t[n++]},function(t,n){for(var e=this.resolvedProperty,i=0,r=e.length;i!==r;++i)e[i]=t[n++];this.targetObject.needsUpdate=!0},function(t,n){for(var e=this.resolvedProperty,i=0,r=e.length;i!==r;++i)e[i]=t[n++];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,n){this.resolvedProperty[this.propertyIndex]=t[n]},function(t,n){this.resolvedProperty[this.propertyIndex]=t[n],this.targetObject.needsUpdate=!0},function(t,n){this.resolvedProperty[this.propertyIndex]=t[n],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,n){this.resolvedProperty.fromArray(t,n)},function(t,n){this.resolvedProperty.fromArray(t,n),this.targetObject.needsUpdate=!0},function(t,n){this.resolvedProperty.fromArray(t,n),this.targetObject.matrixWorldNeedsUpdate=!0}]],getValue:function(t,n){this.bind(),this.getValue(t,n)},setValue:function(t,n){this.bind(),this.setValue(t,n)},bind:function(){var t=this.node,n=this.parsedPath,e=n.objectName,i=n.propertyName,r=n.propertyIndex;if(t||(t=Ll.findNode(this.rootNode,n.nodeName)||this.rootNode,this.node=t),this.getValue=this.Oa,this.setValue=this.Aa,t){if(e){var o=n.objectIndex;switch(e){case"materials":if(!t.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!t.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);t=t.material.materials;break;case"bones":if(!t.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);for(var t=t.skeleton.bones,s=0;s<t.length;s++)if(t[s].name===o){o=s;break}break;default:if(void 0===t[e])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);t=t[e]}if(void 0!==o){if(void 0===t[o])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);t=t[o]}}var a=t[i];if(void 0!==a){var u=this.Versioning.None;void 0!==(this.targetObject=t).needsUpdate?u=this.Versioning.NeedsUpdate:void 0!==t.matrixWorldNeedsUpdate&&(u=this.Versioning.MatrixWorldNeedsUpdate);var h=this.BindingType.Direct;if(void 0!==r){if("morphTargetInfluences"===i){if(!t.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(t.geometry.isBufferGeometry){if(!t.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);for(s=0;s<this.node.geometry.morphAttributes.position.length;s++)if(t.geometry.morphAttributes.position[s].name===r){r=s;break}}else{if(!t.geometry.morphTargets)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphTargets.",this);for(s=0;s<this.node.geometry.morphTargets.length;s++)if(t.geometry.morphTargets[s].name===r){r=s;break}}}h=this.BindingType.ArrayElement,this.resolvedProperty=a,this.propertyIndex=r}else void 0!==a.fromArray&&void 0!==a.toArray?(h=this.BindingType.HasFromToArray,this.resolvedProperty=a):Array.isArray(a)?(h=this.BindingType.EntireArray,this.resolvedProperty=a):this.propertyName=i;this.getValue=this.GetterByBindingType[h],this.setValue=this.SetterByBindingTypeAndVersioning[h][u]}else{n=n.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+n+"."+i+" but it wasn't found.",t)}}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.ka,this.setValue=this.Ca}}),Object.assign(Ll.prototype,{ka:Ll.prototype.getValue,Ca:Ll.prototype.setValue});var Rl=new Et,Ol=new Et;function Al(t,n){if(this.bones=(t=t||[]).slice(0),this.boneMatrices=new Float32Array(16*this.bones.length),this.frame=-1,void 0===n)this.calculateInverses();else if(this.bones.length===n.length)this.boneInverses=n.slice(0);else{console.warn("THREE.Skeleton boneInverses is the wrong length."),this.boneInverses=[];for(var e=0,i=this.bones.length;e<i;e++)this.boneInverses.push(new Et)}}function kl(t){return(kl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.assign(Al.prototype,{calculateInverses:function(){this.boneInverses=[];for(var t=0,n=this.bones.length;t<n;t++){var e=new Et;this.bones[t]&&e.getInverse(this.bones[t].matrixWorld),this.boneInverses.push(e)}},pose:function(){for(var t,n=0,e=this.bones.length;n<e;n++)(t=this.bones[n])&&t.matrixWorld.getInverse(this.boneInverses[n]);for(n=0,e=this.bones.length;n<e;n++)(t=this.bones[n])&&(t.parent&&t.parent.isBone?(t.matrix.getInverse(t.parent.matrixWorld),t.matrix.multiply(t.matrixWorld)):t.matrix.copy(t.matrixWorld),t.matrix.decompose(t.position,t.quaternion,t.scale))},update:function(){for(var t=this.bones,n=this.boneInverses,e=this.boneMatrices,i=this.boneTexture,r=0,o=t.length;r<o;r++){var s=t[r]?t[r].matrixWorld:Ol;Rl.multiplyMatrices(s,n[r]),Rl.toArray(e,16*r)}void 0!==i&&(i.needsUpdate=!0)},clone:function(){return new Al(this.bones,this.boneInverses)},getBoneByName:function(t){for(var n=0,e=this.bones.length;n<e;n++){var i=this.bones[n];if(i.name===t)return i}},dispose:function(){this.boneTexture&&(this.boneTexture.dispose(),this.boneTexture=void 0)}});var Cl=function(){function t(t){kf.call(this,t),this.dracoLoader=null,this.ddsLoader=null}function i(){var e={};return{get:function(t){return e[t]},add:function(t,n){e[t]=n},remove:function(t){delete e[t]},removeAll:function(){e={}}}}t.prototype=Object.assign(Object.create(kf.prototype),{constructor:t,load:function(e,i,t,n){var r=this,o=""!==this.resourcePath?this.resourcePath:""!==this.path?this.path:lf(e);r.manager.itemStart(e);function s(t){n?n(t):console.error(t),r.manager.itemError(e),r.manager.itemEnd(e)}var a=new jf(r.manager);a.setPath(this.path),a.setResponseType("arraybuffer"),"use-credentials"===r.crossOrigin&&a.setWithCredentials(!0),a.load(e,function(n){try{r.parse(n,o,function(t){i(t,n),r.manager.itemEnd(e)},s)}catch(t){s(t)}},t,s)},setDRACOLoader:function(t){return this.dracoLoader=t,this},setDDSLoader:function(t){return this.ddsLoader=t,this},parse:function(t,n,e,i){var r,o={};if("string"==typeof t)r=t;else if(ff(new Uint8Array(t,0,4))===p){try{o[f.KHR_BINARY_GLTF]=new m(t)}catch(t){return void(i&&i(t))}r=o[f.KHR_BINARY_GLTF].content}else r=ff(new Uint8Array(t));var s=JSON.parse(r);if(void 0===s.asset||s.asset.version[0]<2)i&&i(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));else{if(s.extensionsUsed)for(var a=0;a<s.extensionsUsed.length;++a){var u=s.extensionsUsed[a],h=s.extensionsRequired||[];switch(u){case f.KHR_LIGHTS_PUNCTUAL:o[u]=new l(s);break;case f.KHR_MATERIALS_CLEARCOAT:o[u]=new v;break;case f.KHR_MATERIALS_UNLIT:o[u]=new d;break;case f.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:o[u]=new b;break;case f.KHR_DRACO_MESH_COMPRESSION:o[u]=new g(s,this.dracoLoader);break;case f.MSFT_TEXTURE_DDS:o[u]=new c(this.ddsLoader);break;case f.KHR_TEXTURE_TRANSFORM:o[u]=new y;break;case f.KHR_MESH_QUANTIZATION:o[u]=new w;break;default:0<=h.indexOf(u)&&console.warn('THREE.GLTFLoader: Unknown extension "'+u+'".')}}new z(s,o,{path:n||this.resourcePath||"",crossOrigin:this.crossOrigin,manager:this.manager}).parse(e,i)}}});var f={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",MSFT_TEXTURE_DDS:"MSFT_texture_dds"};function c(t){if(!t)throw new Error("THREE.GLTFLoader: Attempting to load .dds texture without importing DDSLoader");this.name=f.MSFT_TEXTURE_DDS,this.ddsLoader=t}function l(t){this.name=f.KHR_LIGHTS_PUNCTUAL;t=t.extensions&&t.extensions[f.KHR_LIGHTS_PUNCTUAL]||{};this.lightDefs=t.lights||[]}function d(){this.name=f.KHR_MATERIALS_UNLIT}function v(){this.name=f.KHR_MATERIALS_CLEARCOAT}l.prototype.loadLight=function(t){var n,e=this.lightDefs[t],i=new _i(16777215);void 0!==e.color&&i.fromArray(e.color);var r=void 0!==e.range?e.range:0;switch(e.type){case"directional":(n=new tl(i)).target.position.set(0,0,-1),n.add(n.target);break;case"point":(n=new el(i)).distance=r;break;case"spot":(n=new rl(i)).distance=r,e.spot=e.spot||{},e.spot.innerConeAngle=void 0!==e.spot.innerConeAngle?e.spot.innerConeAngle:0,e.spot.outerConeAngle=void 0!==e.spot.outerConeAngle?e.spot.outerConeAngle:Math.PI/4,n.angle=e.spot.outerConeAngle,n.penumbra=1-e.spot.innerConeAngle/e.spot.outerConeAngle,n.target.position.set(0,0,-1),n.add(n.target);break;default:throw new Error('THREE.GLTFLoader: Unexpected light type, "'+e.type+'".')}return n.position.set(0,0,0),n.decay=2,void 0!==e.intensity&&(n.intensity=e.intensity),n.name=e.name||"light_"+t,Promise.resolve(n)},d.prototype.getMaterialType=function(){return Co},d.prototype.extendParams=function(t,n,e){var i=[];t.color=new _i(1,1,1),t.opacity=1;var r=n.pbrMetallicRoughness;return r&&(Array.isArray(r.baseColorFactor)&&(n=r.baseColorFactor,t.color.fromArray(n),t.opacity=n[3]),void 0!==r.baseColorTexture&&i.push(e.assignTexture(t,"map",r.baseColorTexture))),Promise.all(i)},v.prototype.getMaterialType=function(){return bf},v.prototype.extendParams=function(t,n,e){var i=[],n=n.extensions[this.name];return void 0!==n.clearcoatFactor&&(t.clearcoat=n.clearcoatFactor),void 0!==n.clearcoatTexture&&i.push(e.assignTexture(t,"clearcoatMap",n.clearcoatTexture)),void 0!==n.clearcoatRoughnessFactor&&(t.clearcoatRoughness=n.clearcoatRoughnessFactor),void 0!==n.clearcoatRoughnessTexture&&i.push(e.assignTexture(t,"clearcoatRoughnessMap",n.clearcoatRoughnessTexture)),void 0!==n.clearcoatNormalTexture&&(i.push(e.assignTexture(t,"clearcoatNormalMap",n.clearcoatNormalTexture)),void 0!==n.clearcoatNormalTexture.scale&&(n=n.clearcoatNormalTexture.scale,t.clearcoatNormalScale=new fi(n,n))),Promise.all(i)};var p="glTF",a=12,u={JSON:1313821514,BIN:5130562};function m(t){this.name=f.KHR_BINARY_GLTF,this.content=null,this.body=null;var n=new DataView(t,0,a);if(this.header={magic:ff(new Uint8Array(t.slice(0,4))),version:n.getUint32(4,!0),length:n.getUint32(8,!0)},this.header.magic!==p)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");for(var e=new DataView(t,a),i=0;i<e.byteLength;){var r=e.getUint32(i,!0);i+=4;var o,s=e.getUint32(i,!0);i+=4,s===u.JSON?(o=new Uint8Array(t,a+i,r),this.content=ff(o)):s===u.BIN&&(this.body=t.slice(s=a+i,s+r)),i+=r}if(null===this.content)throw new Error("THREE.GLTFLoader: JSON content not found.")}function g(t,n){if(!n)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=f.KHR_DRACO_MESH_COMPRESSION,this.json=t,this.dracoLoader=n,this.dracoLoader.preload()}function y(){this.name=f.KHR_TEXTURE_TRANSFORM}function h(t){yf.call(this),this.isGLTFSpecularGlossinessMaterial=!0;["#ifdef USE_SPECULARMAP","\tuniform sampler2D specularMap;","#endif"].join("\n");var e=["#ifdef USE_GLOSSINESSMAP","\tuniform sampler2D glossinessMap;","#endif"].join("\n"),i=["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"),r=["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"),o=["PhysicalMaterial material;","material.diffuseColor = diffuseColor.rgb;","vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );","float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );","material.specularRoughness = max( 1.0 - glossinessFactor, 0.0525 );// 0.0525 corresponds to the base mip of a 256 cubemap.","material.specularRoughness += geometryRoughness;","material.specularRoughness = min( material.specularRoughness, 1.0 );","material.specularColor = specularFactor.rgb;"].join("\n"),s={specular:{value:(new _i).setHex(16777215)},glossiness:{value:1},specularMap:{value:null},glossinessMap:{value:null}};this.ja=s,this.onBeforeCompile=function(t){for(var n in s)t.uniforms[n]=s[n];t.fragmentShader=t.fragmentShader.replace("uniform float roughness;","uniform vec3 specular;"),t.fragmentShader=t.fragmentShader.replace("uniform float metalness;","uniform float glossiness;"),t.fragmentShader=t.fragmentShader.replace("#include <metalnessmap_pars_fragment>",e),t.fragmentShader=t.fragmentShader.replace("#include <roughnessmap_fragment>",i),t.fragmentShader=t.fragmentShader.replace("#include <metalnessmap_fragment>",r),t.fragmentShader=t.fragmentShader.replace("#include <lights_physical_fragment>",o)},Object.defineProperties(this,{specular:{get:function(){return s.specular.value},set:function(t){s.specular.value=t}},specularMap:{get:function(){return s.specularMap.value},set:function(t){s.specularMap.value=t}},glossiness:{get:function(){return s.glossiness.value},set:function(t){s.glossiness.value=t}},glossinessMap:{get:function(){return s.glossinessMap.value},set:function(t){(s.glossinessMap.value=t)?(this.defines.USE_GLOSSINESSMAP="",this.defines.USE_ROUGHNESSMAP=""):(delete this.defines.USE_ROUGHNESSMAP,delete this.defines.USE_GLOSSINESSMAP)}}}),delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this.setValues(t)}function b(){return{name:f.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,specularGlossinessParams:["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","normalMapType","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity","refractionRatio"],getMaterialType:function(){return h},extendParams:function(t,n,e){var i=n.extensions[this.name];t.color=new _i(1,1,1),t.opacity=1;var r=[];return Array.isArray(i.diffuseFactor)&&(n=i.diffuseFactor,t.color.fromArray(n),t.opacity=n[3]),void 0!==i.diffuseTexture&&r.push(e.assignTexture(t,"map",i.diffuseTexture)),t.emissive=new _i(0,0,0),t.glossiness=void 0!==i.glossinessFactor?i.glossinessFactor:1,t.specular=new _i(1,1,1),Array.isArray(i.specularFactor)&&t.specular.fromArray(i.specularFactor),void 0!==i.specularGlossinessTexture&&(i=i.specularGlossinessTexture,r.push(e.assignTexture(t,"glossinessMap",i)),r.push(e.assignTexture(t,"specularMap",i))),Promise.all(r)},createMaterial:function(t){var n=new h(t);return n.fog=!0,n.color=t.color,n.map=void 0===t.map?null:t.map,n.lightMap=null,n.lightMapIntensity=1,n.aoMap=void 0===t.aoMap?null:t.aoMap,n.aoMapIntensity=1,n.emissive=t.emissive,n.emissiveIntensity=1,n.emissiveMap=void 0===t.emissiveMap?null:t.emissiveMap,n.bumpMap=void 0===t.bumpMap?null:t.bumpMap,n.bumpScale=1,n.normalMap=void 0===t.normalMap?null:t.normalMap,n.normalMapType=oi,t.normalScale&&(n.normalScale=t.normalScale),n.displacementMap=null,n.displacementScale=1,n.displacementBias=0,n.specularMap=void 0===t.specularMap?null:t.specularMap,n.specular=t.specular,n.glossinessMap=void 0===t.glossinessMap?null:t.glossinessMap,n.glossiness=t.glossiness,n.alphaMap=null,n.envMap=void 0===t.envMap?null:t.envMap,n.envMapIntensity=1,n.refractionRatio=.98,n}}}function w(){this.name=f.KHR_MESH_QUANTIZATION}function T(t,n,e,i){Df.call(this,t,n,e,i)}g.prototype.decodePrimitive=function(t,n){var e,i=this.json,r=this.dracoLoader,o=t.extensions[this.name].bufferView,s=t.extensions[this.name].attributes,a={},u={},h={};for(e in s){var c=j[e]||e.toLowerCase();a[c]=s[e]}for(e in t.attributes){var f,l,c=j[e]||e.toLowerCase();void 0!==s[e]&&(f=i.accessors[t.attributes[e]],l=O[f.componentType],h[c]=l,u[c]=!0===f.normalized)}return n.getDependency("bufferView",o).then(function(t){return new Promise(function(i){r.decodeDracoFile(t,function(t){for(var n in t.attributes){var e=t.attributes[n],n=u[n];void 0!==n&&(e.normalized=n)}i(t)},a,h)})})},y.prototype.extendTexture=function(t,n){return t=t.clone(),void 0!==n.offset&&t.offset.fromArray(n.offset),void 0!==n.rotation&&(t.rotation=n.rotation),void 0!==n.scale&&t.repeat.fromArray(n.scale),void 0!==n.texCoord&&console.warn('THREE.GLTFLoader: Custom UV sets in "'+this.name+'" extension not yet supported.'),t.needsUpdate=!0,t},((h.prototype=Object.create(yf.prototype)).constructor=h).prototype.copy=function(t){return yf.prototype.copy.call(this,t),this.specularMap=t.specularMap,this.specular.copy(t.specular),this.glossinessMap=t.glossinessMap,this.glossiness=t.glossiness,delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this},((T.prototype=Object.create(Df.prototype)).constructor=T).prototype.beforeStart_=T.prototype.copySampleValue_=function(t){for(var n=this.resultBuffer,e=this.sampleValues,i=this.valueSize,r=t*i*3+i,o=0;o!==i;o++)n[o]=e[r+o];return n},T.prototype.afterEnd_=T.prototype.copySampleValue_,T.prototype.interpolate_=function(t,n,e,i){for(var r=this.resultBuffer,o=this.sampleValues,s=this.valueSize,a=2*s,u=3*s,h=i-n,i=(e-n)/h,e=i*i,n=e*i,c=t*u,f=c-u,l=-2*n+3*e,d=n-e,v=1-l,p=d-e+i,m=0;m!==s;m++){var g=o[f+m+s],y=o[f+m+a]*h,b=o[c+m+s],w=o[c+m]*h;r[m]=v*g+p*y+l*b+d*w}return r};var _=0,x=1,M=2,S=3,E=4,L=5,R=6,O={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},A={9728:Ln,9729:An,9984:Rn,9985:kn,9986:On,9987:Cn},k={33071:En,33648:Tn,10497:Sn},C={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},j={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},P={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},D={CUBICSPLINE:void 0,LINEAR:We,STEP:ze},I="OPAQUE",N="MASK",F="BLEND",U={"image/png":Zn,"image/jpeg":Xn};function B(t,n){return"string"!=typeof t||""===t?"":(/^https?:\/\//i.test(n)&&/^\//.test(t)&&(n=n.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(t)||/^data:.*,.*$/i.test(t)||/^blob:.*$/i.test(t)?t:n+t)}function G(t,n,e){for(var i in e.extensions)void 0===t[i]&&(n.userData.gltfExtensions=n.userData.gltfExtensions||{},n.userData.gltfExtensions[i]=e.extensions[i])}function H(t,n){void 0!==n.extras&&("object"===kl(n.extras)?Object.assign(t.userData,n.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+n.extras))}function V(t){for(var n="",e=Object.keys(t).sort(),i=0,r=e.length;i<r;i++)n+=e[i]+":"+t[e[i]]+";";return n}function z(t,n,e){this.json=t||{},this.extensions=n||{},this.options=e||{},this.cache=new i,this.primitiveCache={},this.textureLoader=new pf(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.fileLoader=new jf(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),"use-credentials"===this.options.crossOrigin&&this.fileLoader.setWithCredentials(!0)}function W(e,t,i){var n,r,o=t.attributes,s=[];for(n in o){var a=j[n]||n.toLowerCase();a in e.attributes||s.push(function(t,n){return i.getDependency("accessor",t).then(function(t){e.setAttribute(n,t)})}(o[n],a))}return void 0===t.indices||e.index||(r=i.getDependency("accessor",t.indices).then(function(t){e.setIndex(t)}),s.push(r)),H(e,t),function(t,n,e){var i=n.attributes,r=new tt;if(void 0!==i.POSITION){var o=(l=e.json.accessors[i.POSITION]).min,s=l.max;if(void 0!==o&&void 0!==s){r.set(new St(o[0],o[1],o[2]),new St(s[0],s[1],s[2]));var a=n.targets;if(void 0!==a){for(var u=new St,h=new St,c=0,f=a.length;c<f;c++){var l,d=a[c];void 0!==d.POSITION&&(o=(l=e.json.accessors[d.POSITION]).min,s=l.max,void 0!==o&&void 0!==s?(h.setX(Math.max(Math.abs(o[0]),Math.abs(s[0]))),h.setY(Math.max(Math.abs(o[1]),Math.abs(s[1]))),h.setZ(Math.max(Math.abs(o[2]),Math.abs(s[2]))),u.max(h)):console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION."))}r.expandByVector(u)}t.boundingBox=r;n=new it;r.getCenter(n.center),n.radius=r.min.distanceTo(r.max)/2,t.boundingSphere=n}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}(e,t,i),Promise.all(s).then(function(){return void 0!==t.targets?function(e,t,n){for(var i=!1,r=!1,o=0,s=t.length;o<s;o++)if(void 0!==(c=t[o]).POSITION&&(i=!0),void 0!==c.NORMAL&&(r=!0),i&&r)break;if(!i&&!r)return Promise.resolve(e);for(var a=[],u=[],o=0,s=t.length;o<s;o++){var h,c=t[o];i&&(h=void 0!==c.POSITION?n.getDependency("accessor",c.POSITION):e.attributes.position,a.push(h)),r&&(h=void 0!==c.NORMAL?n.getDependency("accessor",c.NORMAL):e.attributes.normal,u.push(h))}return Promise.all([Promise.all(a),Promise.all(u)]).then(function(t){var n=t[0],t=t[1];return i&&(e.morphAttributes.position=n),r&&(e.morphAttributes.normal=t),e.morphTargetsRelative=!0,e})}(e,t.targets,i):e})}function X(t,n){var e=t.getIndex();if(null===e){var i=[],r=t.getAttribute("position");if(void 0===r)return console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),t;for(var o=0;o<r.count;o++)i.push(o);t.setIndex(i),e=t.getIndex()}var s=e.count-2,a=[];if(n===Ye)for(o=1;o<=s;o++)a.push(e.getX(0)),a.push(e.getX(o)),a.push(e.getX(o+1));else for(o=0;o<s;o++)o%2==0?(a.push(e.getX(o)),a.push(e.getX(o+1)),a.push(e.getX(o+2))):(a.push(e.getX(o+2)),a.push(e.getX(o+1)),a.push(e.getX(o)));a.length/3!=s&&console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");t=t.clone();return t.setIndex(a),t}return z.prototype.parse=function(n,t){var e=this,i=this.json,r=this.extensions;this.cache.removeAll(),this.markDefs(),Promise.all([this.getDependencies("scene"),this.getDependencies("animation"),this.getDependencies("camera")]).then(function(t){t={scene:t[0][i.scene||0],scenes:t[0],animations:t[1],cameras:t[2],asset:i.asset,parser:e,userData:{}};G(r,t,i),H(t,i),n(t)}).catch(t)},z.prototype.markDefs=function(){for(var t=this.json.nodes||[],n=this.json.skins||[],e=this.json.meshes||[],i={},r={},o=0,s=n.length;o<s;o++)for(var a=n[o].joints,u=0,h=a.length;u<h;u++)t[a[u]].isBone=!0;for(var c=0,f=t.length;c<f;c++){var l=t[c];void 0!==l.mesh&&(void 0===i[l.mesh]&&(i[l.mesh]=r[l.mesh]=0),i[l.mesh]++,void 0!==l.skin&&(e[l.mesh].isSkinnedMesh=!0))}this.json.meshReferences=i,this.json.meshUses=r},z.prototype.getDependency=function(t,n){var e=t+":"+n,i=this.cache.get(e);if(!i){switch(t){case"scene":i=this.loadScene(n);break;case"node":i=this.loadNode(n);break;case"mesh":i=this.loadMesh(n);break;case"accessor":i=this.loadAccessor(n);break;case"bufferView":i=this.loadBufferView(n);break;case"buffer":i=this.loadBuffer(n);break;case"material":i=this.loadMaterial(n);break;case"texture":i=this.loadTexture(n);break;case"skin":i=this.loadSkin(n);break;case"animation":i=this.loadAnimation(n);break;case"camera":i=this.loadCamera(n);break;case"light":i=this.extensions[f.KHR_LIGHTS_PUNCTUAL].loadLight(n);break;default:throw new Error("Unknown type: "+t)}this.cache.add(e,i)}return i},z.prototype.getDependencies=function(e){var i,t,n=this.cache.get(e);return n||(t=(i=this).json[e+("mesh"===e?"es":"s")]||[],n=Promise.all(t.map(function(t,n){return i.getDependency(e,n)})),this.cache.add(e,n)),n},z.prototype.loadBuffer=function(t){var e=this.json.buffers[t],i=this.fileLoader;if(e.type&&"arraybuffer"!==e.type)throw new Error("THREE.GLTFLoader: "+e.type+" buffer type is not supported.");if(void 0===e.uri&&0===t)return Promise.resolve(this.extensions[f.KHR_BINARY_GLTF].body);var r=this.options;return new Promise(function(t,n){i.load(B(e.uri,r.path),t,void 0,function(){n(new Error('THREE.GLTFLoader: Failed to load buffer "'+e.uri+'".'))})})},z.prototype.loadBufferView=function(t){var i=this.json.bufferViews[t];return this.getDependency("buffer",i.buffer).then(function(t){var n=i.byteLength||0,e=i.byteOffset||0;return t.slice(e,e+n)})},z.prototype.loadAccessor=function(t){var g=this,y=this.json,b=this.json.accessors[t];if(void 0===b.bufferView&&void 0===b.sparse)return Promise.resolve(null);t=[];return void 0!==b.bufferView?t.push(this.getDependency("bufferView",b.bufferView)):t.push(null),void 0!==b.sparse&&(t.push(this.getDependency("bufferView",b.sparse.indices.bufferView)),t.push(this.getDependency("bufferView",b.sparse.values.bufferView))),Promise.all(t).then(function(t){var n,e,i,r=t[0],o=C[b.type],s=O[b.componentType],a=s.BYTES_PER_ELEMENT,u=b.byteOffset||0,h=void 0!==b.bufferView?y.bufferViews[b.bufferView].byteStride:void 0,c=!0===b.normalized,f=h&&h!==a*o?(n=Math.floor(u/h),e="InterleavedBuffer:"+b.bufferView+":"+b.componentType+":"+n+":"+b.count,(i=g.cache.get(e))||(i=new Du(new s(r,n*h,b.count*h/a),h/a),g.cache.add(e,i)),new Nu(i,o,u%h/a,c)):new Nr(null===r?new s(b.count*o):new s(r,u,b.count*o),o,c);if(void 0!==b.sparse){var a=O[b.sparse.indices.componentType],u=b.sparse.indices.byteOffset||0,c=b.sparse.values.byteOffset||0,l=new a(t[1],u,b.sparse.count*C.SCALAR),d=new s(t[2],c,b.sparse.count*o);null!==r&&(f=new Nr(f.array.slice(),f.itemSize,f.normalized));for(var v=0,p=l.length;v<p;v++){var m=l[v];if(f.setX(m,d[v*o]),2<=o&&f.setY(m,d[v*o+1]),3<=o&&f.setZ(m,d[v*o+2]),4<=o&&f.setW(m,d[v*o+3]),5<=o)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return f})},z.prototype.loadTexture=function(t){var n=this,e=this.json,r=this.options,o=this.textureLoader,i=self.URL||self.webkitURL,s=e.textures[t],a=s.extensions||{},u=a[f.MSFT_TEXTURE_DDS]?e.images[a[f.MSFT_TEXTURE_DDS].source]:e.images[s.source],h=u.uri,c=!1;return void 0!==u.bufferView&&(h=n.getDependency("bufferView",u.bufferView).then(function(t){c=!0;t=new Blob([t],{type:u.mimeType});return h=i.createObjectURL(t)})),Promise.resolve(h).then(function(e){var i=(i=r.manager.getHandler(e))||(a[f.MSFT_TEXTURE_DDS]?n.extensions[f.MSFT_TEXTURE_DDS].ddsLoader:o);return new Promise(function(t,n){i.load(B(e,r.path),t,void 0,n)})}).then(function(t){!0===c&&i.revokeObjectURL(h),t.flipY=!1,s.name&&(t.name=s.name),u.mimeType in U&&(t.format=U[u.mimeType]);var n=(e.samplers||{})[s.sampler]||{};return t.magFilter=A[n.magFilter]||An,t.minFilter=A[n.minFilter]||Cn,t.wrapS=k[n.wrapS]||Sn,t.wrapT=k[n.wrapT]||Sn,t})},z.prototype.assignTexture=function(e,i,r){var o=this;return this.getDependency("texture",r.index).then(function(t){if(!t.isCompressedTexture)switch(i){case"aoMap":case"emissiveMap":case"metalnessMap":case"normalMap":case"roughnessMap":t.format=Xn}var n;void 0===r.texCoord||0==r.texCoord||"aoMap"===i&&1==r.texCoord||console.warn("THREE.GLTFLoader: Custom UV set "+r.texCoord+" for texture "+i+" not yet supported."),!o.extensions[f.KHR_TEXTURE_TRANSFORM]||(n=void 0!==r.extensions?r.extensions[f.KHR_TEXTURE_TRANSFORM]:void 0)&&(t=o.extensions[f.KHR_TEXTURE_TRANSFORM].extendTexture(t,n)),e[i]=t})},z.prototype.assignFinalMaterial=function(t){var n,e,i,r=t.geometry,o=t.material,s=void 0!==r.attributes.tangent,a=void 0!==r.attributes.color,u=void 0===r.attributes.normal,h=!0===t.isSkinnedMesh,c=0<Object.keys(r.morphAttributes).length,f=c&&void 0!==r.morphAttributes.normal;t.isPoints?(e="PointsMaterial:"+o.uuid,(n=this.cache.get(e))||(n=new gf,vo.prototype.copy.call(n,o),n.color.copy(o.color),n.map=o.map,n.sizeAttenuation=!1,this.cache.add(e,n)),o=n):t.isLine&&(e="LineBasicMaterial:"+o.uuid,(i=this.cache.get(e))||(i=new xc,vo.prototype.copy.call(i,o),i.color.copy(o.color),this.cache.add(e,i)),o=i),(s||a||u||h||c)&&(e="ClonedMaterial:"+o.uuid+":",o.isGLTFSpecularGlossinessMaterial&&(e+="specular-glossiness:"),h&&(e+="skinning:"),s&&(e+="vertex-tangents:"),a&&(e+="vertex-colors:"),u&&(e+="flat-shading:"),c&&(e+="morph-targets:"),f&&(e+="morph-normals:"),(i=this.cache.get(e))||(i=o.clone(),h&&(i.skinning=!0),s&&(i.vertexTangents=!0),a&&(i.vertexColors=!0),u&&(i.flatShading=!0),c&&(i.morphTargets=!0),f&&(i.morphNormals=!0),this.cache.add(e,i)),o=i),o.aoMap&&void 0===r.attributes.uv2&&void 0!==r.attributes.uv&&r.setAttribute("uv2",new Nr(r.attributes.uv.array,2)),o.normalScale&&!s&&(o.normalScale.y=-o.normalScale.y),o.clearcoatNormalScale&&!s&&(o.clearcoatNormalScale.y=-o.clearcoatNormalScale.y),t.material=o},z.prototype.loadMaterial=function(t){var n,e,i=this.json,r=this.extensions,o=i.materials[t],s={},a=o.extensions||{},i=[];a[f.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]?(t=r[f.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS],n=t.getMaterialType(),i.push(t.extendParams(s,o,this))):a[f.KHR_MATERIALS_UNLIT]?(e=r[f.KHR_MATERIALS_UNLIT],n=e.getMaterialType(),i.push(e.extendParams(s,o,this))):(n=yf,u=o.pbrMetallicRoughness||{},s.color=new _i(1,1,1),s.opacity=1,Array.isArray(u.baseColorFactor)&&(s.color.fromArray(e=u.baseColorFactor),s.opacity=e[3]),void 0!==u.baseColorTexture&&i.push(this.assignTexture(s,"map",u.baseColorTexture)),s.metalness=void 0!==u.metallicFactor?u.metallicFactor:1,s.roughness=void 0!==u.roughnessFactor?u.roughnessFactor:1,void 0!==u.metallicRoughnessTexture&&(i.push(this.assignTexture(s,"metalnessMap",u.metallicRoughnessTexture)),i.push(this.assignTexture(s,"roughnessMap",u.metallicRoughnessTexture)))),!0===o.doubleSided&&(s.side=At);var u=o.alphaMode||I;return u===F?(s.transparent=!0,s.depthWrite=!1):(s.transparent=!1,u===N&&(s.alphaTest=void 0!==o.alphaCutoff?o.alphaCutoff:.5)),void 0!==o.normalTexture&&n!==Co&&(i.push(this.assignTexture(s,"normalMap",o.normalTexture)),s.normalScale=new fi(1,1),void 0!==o.normalTexture.scale&&s.normalScale.set(o.normalTexture.scale,o.normalTexture.scale)),void 0!==o.occlusionTexture&&n!==Co&&(i.push(this.assignTexture(s,"aoMap",o.occlusionTexture)),void 0!==o.occlusionTexture.strength&&(s.aoMapIntensity=o.occlusionTexture.strength)),void 0!==o.emissiveFactor&&n!==Co&&(s.emissive=(new _i).fromArray(o.emissiveFactor)),void 0!==o.emissiveTexture&&n!==Co&&i.push(this.assignTexture(s,"emissiveMap",o.emissiveTexture)),a[f.KHR_MATERIALS_CLEARCOAT]&&(u=r[f.KHR_MATERIALS_CLEARCOAT],n=u.getMaterialType(),i.push(u.extendParams(s,{extensions:a},this))),Promise.all(i).then(function(){var t=n===h?r[f.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(s):new n(s);return o.name&&(t.name=o.name),t.map&&(t.map.encoding=Ke),t.emissiveMap&&(t.emissiveMap.encoding=Ke),H(t,o),o.extensions&&G(r,t,o),t})},z.prototype.loadGeometries=function(t){var e=this,i=this.extensions,n=this.primitiveCache;for(var r=[],o=0,s=t.length;o<s;o++){var a=t[o],u=(u=void 0,h=(u=(h=a).extensions&&h.extensions[f.KHR_DRACO_MESH_COMPRESSION])?"draco:"+u.bufferView+":"+u.indices+":"+V(u.attributes):h.indices+":"+V(h.attributes)+":"+h.mode),h=n[u];h?r.push(h.promise):(h=a.extensions&&a.extensions[f.KHR_DRACO_MESH_COMPRESSION]?function(n){return i[f.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(n,e).then(function(t){return W(t,n,e)})}(a):W(new eo,a,e),n[u]={primitive:a,promise:h},r.push(h))}return Promise.all(r)},z.prototype.loadMesh=function(f){for(var l=this,d=this.json.meshes[f],v=d.primitives,t=[],n=0,e=v.length;n<e;n++){var i=void 0===v[n].material?(void 0===(i=this.cache).DefaultMaterial&&(i.DefaultMaterial=new yf({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:Rt})),i.DefaultMaterial):this.getDependency("material",v[n].material);t.push(i)}return t.push(l.loadGeometries(v)),Promise.all(t).then(function(t){for(var n=t.slice(0,t.length-1),e=t[t.length-1],i=[],r=0,o=e.length;r<o;r++){var s,a=e[r],u=v[r],h=n[r];if(u.mode===E||u.mode===L||u.mode===R||void 0===u.mode)!0!==(s=new(!0===d.isSkinnedMesh?ol:Ko)(a,h)).isSkinnedMesh||s.geometry.attributes.skinWeight.normalized||s.normalizeSkinWeights(),u.mode===L?s.geometry=X(s.geometry,1):u.mode===R&&(s.geometry=X(s.geometry,Ye));else if(u.mode===x)s=new vl(a,h);else if(u.mode===S)s=new fl(a,h);else if(u.mode===M)s=new pl(a,h);else{if(u.mode!==_)throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+u.mode);s=new wl(a,h)}0<Object.keys(s.geometry.morphAttributes).length&&function(t,n){if(t.updateMorphTargets(),void 0!==n.weights)for(var e=0,i=n.weights.length;e<i;e++)t.morphTargetInfluences[e]=n.weights[e];if(n.extras&&Array.isArray(n.extras.targetNames)){var r=n.extras.targetNames;if(t.morphTargetInfluences.length===r.length){t.morphTargetDictionary={};for(e=0,i=r.length;e<i;e++)t.morphTargetDictionary[r[e]]=e}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}(s,d),s.name=d.name||"mesh_"+f,1<e.length&&(s.name+="_"+r),H(s,d),l.assignFinalMaterial(s),i.push(s)}if(1===i.length)return i[0];for(var c=new Ja,r=0,o=i.length;r<o;r++)c.add(i[r]);return c})},z.prototype.loadCamera=function(t){var n,e=this.json.cameras[t],t=e[e.type];if(t)return"perspective"===e.type?n=new Y(Mt.radToDeg(t.yfov),t.aspectRatio||1,t.znear||1,t.zfar||2e6):"orthographic"===e.type&&(n=new q(t.xmag/-2,t.xmag/2,t.ymag/2,t.ymag/-2,t.znear,t.zfar)),e.name&&(n.name=e.name),H(n,e),Promise.resolve(n);console.warn("THREE.GLTFLoader: Missing camera parameters.")},z.prototype.loadSkin=function(t){var t=this.json.skins[t],n={joints:t.joints};return void 0===t.inverseBindMatrices?Promise.resolve(n):this.getDependency("accessor",t.inverseBindMatrices).then(function(t){return n.inverseBindMatrices=t,n})},z.prototype.loadAnimation=function(S){for(var E=this.json.animations[S],t=[],n=[],e=[],i=[],r=[],o=0,s=E.channels.length;o<s;o++){var a=E.channels[o],u=E.samplers[a.sampler],h=a.target,c=void 0!==h.node?h.node:h.id,f=void 0!==E.parameters?E.parameters[u.input]:u.input,a=void 0!==E.parameters?E.parameters[u.output]:u.output;t.push(this.getDependency("node",c)),n.push(this.getDependency("accessor",f)),e.push(this.getDependency("accessor",a)),i.push(u),r.push(h)}return Promise.all([Promise.all(t),Promise.all(n),Promise.all(e),Promise.all(i),Promise.all(r)]).then(function(t){for(var n=t[0],e=t[1],i=t[2],r=t[3],o=t[4],s=[],a=0,u=n.length;a<u;a++){var h,c=n[a],f=e[a],l=i[a],d=r[a],v=o[a];if(void 0!==c){switch(c.updateMatrix(),c.matrixAutoUpdate=!0,P[v.path]){case P.weights:h=Hf;break;case P.rotation:h=zf;break;case P.position:case P.scale:default:h=Xf}var p=c.name||c.uuid,m=void 0!==d.interpolation?D[d.interpolation]:We,g=[];P[v.path]===P.weights?c.traverse(function(t){!0===t.isMesh&&t.morphTargetInfluences&&g.push(t.name||t.uuid)}):g.push(p);var y,b=l.array;if(l.normalized){if(b.constructor===Int8Array)y=1/127;else if(b.constructor===Uint8Array)y=1/255;else if(b.constructor==Int16Array)y=1/32767;else{if(b.constructor!==Uint16Array)throw new Error("THREE.GLTFLoader: Unsupported output accessor component type.");y=1/65535}for(var w=new Float32Array(b.length),_=0,x=b.length;_<x;_++)w[_]=b[_]*y;b=w}for(_=0,x=g.length;_<x;_++){var M=new h(g[_]+"."+P[v.path],f.array,b,m);"CUBICSPLINE"===d.interpolation&&(M.createInterpolant=function(t){return new T(this.times,this.values,this.getValueSize()/3,t)},M.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0),s.push(M)}}}return new Zf(E.name||"animation_"+S,void 0,s)})},z.prototype.loadNode=function(t){var n=this.json,o=this.extensions,e=this,i=n.meshReferences,r=n.meshUses,s=n.nodes[t];return t=[],void 0!==s.mesh&&t.push(e.getDependency("mesh",s.mesh).then(function(t){var n,e;return 1<i[s.mesh]?(n=r[s.mesh]++,(e=t.clone()).name+="_instance_"+n):e=t,void 0!==s.weights&&e.traverse(function(t){if(t.isMesh)for(var n=0,e=s.weights.length;n<e;n++)t.morphTargetInfluences[n]=s.weights[n]}),e})),void 0!==s.camera&&t.push(e.getDependency("camera",s.camera)),s.extensions&&s.extensions[f.KHR_LIGHTS_PUNCTUAL]&&void 0!==s.extensions[f.KHR_LIGHTS_PUNCTUAL].light&&t.push(e.getDependency("light",s.extensions[f.KHR_LIGHTS_PUNCTUAL].light)),Promise.all(t).then(function(t){var n,e=!0===s.isBone?new xl:1<t.length?new Ja:1===t.length?t[0]:new Z;if(e!==t[0])for(var i=0,r=t.length;i<r;i++)e.add(t[i]);return s.name&&(e.userData.name=s.name,e.name=Ll.sanitizeNodeName(s.name)),H(e,s),s.extensions&&G(o,e,s),void 0!==s.matrix?((n=new Et).fromArray(s.matrix),e.applyMatrix4(n)):(void 0!==s.translation&&e.position.fromArray(s.translation),void 0!==s.rotation&&e.quaternion.fromArray(s.rotation),void 0!==s.scale&&e.scale.fromArray(s.scale)),e})},z.prototype.loadScene=function(t){var n=this.json,e=this.extensions,t=this.json.scenes[t],i=new Lr;t.name&&(i.name=t.name),H(i,t),t.extensions&&G(e,i,t);for(var r=t.nodes||[],o=[],s=0,a=r.length;s<a;s++)o.push(function s(t,a,u,h){var c=u.nodes[t];return h.getDependency("node",t).then(function(t){return void 0===c.skin?t:h.getDependency("skin",c.skin).then(function(t){for(var n=[],e=0,i=(a=t).joints.length;e<i;e++)n.push(h.getDependency("node",a.joints[e]));return Promise.all(n)}).then(function(s){return t.traverse(function(t){if(t.isMesh){for(var n=[],e=[],i=0,r=s.length;i<r;i++){var o=s[i];o?(n.push(o),o=new Et,void 0!==a.inverseBindMatrices&&o.fromArray(a.inverseBindMatrices.array,16*i),e.push(o)):console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',a.joints[i])}t.bind(new Al(n,e),t.matrixWorld)}}),t});var a}).then(function(t){a.add(t);var n=[];if(c.children)for(var e=c.children,i=0,r=e.length;i<r;i++){var o=e[i];n.push(s(o,t,u,h))}return Promise.all(n)})}(r[s],i,n,this));return Promise.all(o).then(function(){return i})},t}();function jl(t){return(jl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Pl(t,n){var e;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(e=function(t,n){if(t){if("string"==typeof t)return Dl(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(e="Object"===e&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Dl(t,n):void 0}}(t))||n&&t&&"number"==typeof t.length){e&&(t=e);var i=0,n=function(){};return{s:n,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},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,o=!0,s=!1;return{s:function(){e=t[Symbol.iterator]()},n:function(){var t=e.next();return o=t.done,t},e:function(t){s=!0,r=t},f:function(){try{o||null==e.return||e.return()}finally{if(s)throw r}}}}function Dl(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}function Il(t,n){return(Il=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Nl(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Fl(e);return t=i?(t=Fl(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==jl(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function Fl(t){return(Fl=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}Ru=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Il(t,n)}(i,Sc);var e=Nl(i);function i(t){var n;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,i),(n=e.call(this)).W=t,n.Pa=new Kf,n.Da=new Cl,n.Ia=!1,n.Na=!1,n}return i}();Object.assign(Ru.prototype,{Io:function(o,s,n){var a,t,u=this;this.Jo.has(o)?(this.$o(o,{success:s,fail:n}),!0===this.Jo.get(o).loadComplete&&this.Fa(o)):(this.Jo.set(o,{loadComplete:!1}),a=-1===o.indexOf(".js"),t=this.Da,(t=!a?this.Pa:t).load(o,function(t,n){if(!0!==u.Na){if(a)u.Jo.set(o,{gltf:t,data:n,isAnimate:0<t.animations.length,isGltf:!0,loadComplete:!0}),s&&s(a,t);else{if(Array.isArray(n)){var e,i=Pl(n);try{for(i.s();!(e=i.n()).done;){var r=e.value;r.map&&u.Ia&&r.color.setScalar(1)}}catch(t){i.e(t)}finally{i.f()}}else n.map&&u.Ia&&n.color.setScalar(1);u.Jo.set(o,{geometry:t,material:n,isGltf:!1,loadComplete:!0}),s&&s(a,t,n)}u.W.Zt.Ua(),u.Fa(o,!1)}},function(t){},function(t){!0!==u.Na&&(u.Jo.delete(o),n&&n(t),u.Fa(o,t))}))},Fa:function(r,o){var s,a=this;!this.Qo.has(r)||(s=this.Jo.get(r))&&(this.Qo.get(r).forEach(function(t,n,e){var i;o?n.fail&&n.fail(o):s.isGltf?s.isAnimate?a.Da.parse(s.data,lf(r),function(t){n.success&&n.success(!0,t)},function(t){n.fail&&n.fail(t)}):((i={animations:[]}).scene=s.gltf.scene.clone(),i.scene.traverse(function(t){"Mesh"===t.type&&delete t.userData.sourceMaterial}),n.success&&n.success(!0,i)):n.success&&n.success(!1,s.geometry,s.material),e.delete(t)}),this.Qo.delete(r))},vt:function(){this.Na=!0,this.Qo.clear(),this.Pa=null,this.Da=null}});var Ul=Ru;function Bl(t){return(Bl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Gl(t,n){return(Gl=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Hl(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Vl(e);return t=i?(t=Vl(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Bl(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function Vl(t){return(Vl=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}eh=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Gl(t,n)}(e,Sc);var n=Hl(e);function e(){var t;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,e),(t=n.call(this)).Da=new Cl,t}return e}();Object.assign(eh.prototype,{Io:function(e,i,r){var o=this;this.Jo.has(e)?(this.$o(e,{success:i,fail:r}),!0===this.Jo.get(e).loadComplete&&this.Fa(e)):(this.Jo.set(e,{loadComplete:!1}),this.Da.load(e,function(t,n){t.scene.userData.sourceScale=t.scene.scale.clone(),o.Jo.set(e,{gltf:t,isAnimate:0<t.animations.length,data:0<t.animations.length?n:null,loadComplete:!0}),o.$o(e,{success:i,fail:r}),o.Fa(e)},function(t){},function(t){o.Jo.delete(e),r&&r(t),o.Fa(e,t)}))},Fa:function(r,o){var s,a=this;!this.Qo.has(r)||(s=this.Jo.get(r))&&(this.Qo.get(r).forEach(function(t,n,e){var i;o?n.fail&&n.fail(o):s.isAnimate?a.Da.parse(s.data,lf(r),function(t){t.scene.userData.sourceScale=t.scene.scale.clone(),n.success&&n.success(t)},function(t){n.fail&&n.fail(t)}):((i={animations:[]}).scene=s.gltf.scene.clone(!0),n.success&&n.success(i)),e.delete(t)}),this.Qo.delete(r))},vt:function(){this.Da=null}});var zl=eh;function Wl(t){return(Wl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Xl(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Zl(t,n){return(Zl=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Yl(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=ql(e);return t=i?(t=ql(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Wl(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function ql(t){return(ql=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}uh=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Zl(t,n)}(r,vr);var t,n,e,i=Yl(r);function r(t){var n;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(n=i.call(this,t)).Jt=t.height,n.Jn=t.bounds,n.Ba=t.zoom,n}return t=r,(n=[{key:"height",get:function(){return this.Jt}},{key:"floorSpace",get:function(){return this.tt.Et.Tn(this.Yt).floorSpace},set:function(t){var n=this;this.tt.Et.Tn(this.Yt).floorSpace=t,this.traverse(function(t){t.Qn({animate:!1})}),this.tt.traverse(function(t){t!==n&&(t.Ga=!0,t.traverse(function(t){t.Qn({animate:!1})}))}),this.tt.Z.An(this,{level:this.level,animate:!1,finish:function(){n.parent.cn.hn(),n.parent.cn.Ln()}})}},{key:"getFloors",value:function(){return this.K}}])&&Xl(t.prototype,n),e&&Xl(t,e),r}();Object.assign(uh.prototype,{mn:function(t){(t.tt=this).K.push(t)}});var Kl=uh;function Jl(t){return(Jl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ql(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function $l(t,n){return($l=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function td(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=nd(e);return t=i?(t=nd(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Jl(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function nd(t){return(nd=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var ed=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&$l(t,n)}(r,ar);var t,n,e,i=td(r);function r(){var t;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(t=i.call(this)).Fi=new Lr,t}return t=r,(n=[{key:"scene",get:function(){return this.Fi}},{key:"bound",get:function(){var n=this;return!0===this.needUpdateBound&&(this.Gn.reset(),this.K.forEach(function(t){n.Gn.expand(t.bound)}),this.needUpdateBound=!1),this.Gn.clone()}},{key:"isLayer",get:function(){return!0}},{key:"init",value:function(){this.Fi.position.y=this.parent.Jt}}])&&Ql(t.prototype,n),e&&Ql(t,e),r}();function id(t){return(id="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function rd(t,n){var e;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(e=function(t,n){if(t){if("string"==typeof t)return od(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(e="Object"===e&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?od(t,n):void 0}}(t))||n&&t&&"number"==typeof t.length){e&&(t=e);var i=0,n=function(){};return{s:n,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},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,o=!0,s=!1;return{s:function(){e=t[Symbol.iterator]()},n:function(){var t=e.next();return o=t.done,t},e:function(t){s=!0,r=t},f:function(){try{o||null==e.return||e.return()}finally{if(s)throw r}}}}function od(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}function sd(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function ad(t,n){return(ad=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function ud(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=hd(e);return t=i?(t=hd(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==id(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function hd(t){return(hd=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}ch=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&ad(t,n)}(r,ed);var t,n,e,i=ud(r);function r(t){var n;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(n=i.call(this)).Ha=[],void 0!==t&&void 0!==t.type&&(n.Un=t.type),n}return t=r,(n=[{key:"getMarkers",value:function(){return this.K}},{key:"add",value:function(t){t.tt=this,t.Va||t.za()?this.O(t):this.Ha.push(t),this.needUpdateBound=!0}},{key:"remove",value:function(t){this.Wa(t),t.dispose();var n=this.K.indexOf(t);-1<n&&this.K.splice(n,1);t=this.Ha.indexOf(t);-1<t&&this.Ha.splice(t,1),this.needUpdateBound=!0}},{key:"clear",value:function(){var t,n=rd(this.K);try{for(n.s();!(t=n.n()).done;){var e=t.value;this.Wa(e),e.dispose()}}catch(t){n.e(t)}finally{n.f()}this.K.length=0}},{key:"traverse",value:function(t){var n,e=rd(this.K);try{for(e.s();!(n=e.n()).done;){var i=n.value;t&&t(i)}}catch(t){e.e(t)}finally{e.f()}}},{key:"dispose",value:function(){var t,n=rd(this.K);try{for(n.s();!(t=n.n()).done;){var e=t.value;this.Wa(e),e.dispose()}}catch(t){n.e(t)}finally{n.f()}this.K.length=0,this.Fi=void 0}}])&&sd(t.prototype,n),e&&sd(t,e),r}();Object.assign(ch.prototype,{Xa:function(){var t,n=rd(this.Ha);try{for(n.s();!(t=n.n()).done;){var e,i=t.value;i.za()&&(-1<(e=this.Ha.indexOf(i))&&this.Ha.splice(e,1),this.O(i))}}catch(t){n.e(t)}finally{n.f()}},O:function(t){this.K.push(t),t.jn&&this.Fi.add(t.jn)},Wa:function(t){t.tt=void 0,this.Fi.remove(t.jn)}});var cd=ch;function fd(t){return(fd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ld(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function dd(t,n){return(dd=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function vd(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=pd(e);return t=i?(t=pd(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==fd(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function pd(t){return(pd=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}mh=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&dd(t,n)}(r,cd);var t,n,e,i=vd(r);function r(){var t;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(t=i.call(this)).Un=Ii.IMAGE_MARKER,t.Qi=!0,t}return t=r,(n=[{key:"collision",get:function(){return this.Qi}}])&&ld(t.prototype,n),e&&ld(t,e),r}();function md(t){return(md="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function gd(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function yd(t,n){return(yd=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function bd(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=wd(e);return t=i?(t=wd(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==md(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function wd(t){return(wd=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}yh=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&yd(t,n)}(r,cd);var t,n,e,i=bd(r);function r(){var t;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(t=i.call(this)).Un=Ii.TEXT_MARKER,t.isHasText=!0,t.Qi=!0,t}return t=r,(n=[{key:"collision",get:function(){return this.Qi}}])&&gd(t.prototype,n),e&&gd(t,e),r}();function _d(t){return(_d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function xd(t,n){return(xd=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Md(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Sd(e);return t=i?(t=Sd(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==_d(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function Sd(t){return(Sd=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}vi=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&xd(t,n)}(e,cd);var n=Md(e);function e(){var t;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,e),(t=n.call(this)).Un=Ii.POLYGON_MARKER,t}return e}();function Ed(t){return(Ed="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Td(t,n){return(Td=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Ld(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Rd(e);return t=i?(t=Rd(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Ed(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function Rd(t){return(Rd=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}mi=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Td(t,n)}(e,cd);var n=Ld(e);function e(){var t;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,e),(t=n.call(this)).Un=Ii.EXTRUDE_MARKER,t}return e}();function Od(t){return(Od="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ad(t,n){var e;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(e=function(t,n){if(t){if("string"==typeof t)return kd(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(e="Object"===e&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?kd(t,n):void 0}}(t))||n&&t&&"number"==typeof t.length){e&&(t=e);var i=0,n=function(){};return{s:n,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},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,o=!0,s=!1;return{s:function(){e=t[Symbol.iterator]()},n:function(){var t=e.next();return o=t.done,t},e:function(t){s=!0,r=t},f:function(){try{o||null==e.return||e.return()}finally{if(s)throw r}}}}function kd(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}function Cd(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function jd(t,n,e){return(jd="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,n,e){t=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=Nd(t)););return t}(t,n);if(t){n=Object.getOwnPropertyDescriptor(t,n);return n.get?n.get.call(e):n.value}})(t,n,e||t)}function Pd(t,n){return(Pd=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Dd(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Nd(e);return t=i?(t=Nd(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Od(t)&&"function"!=typeof t?Id(n):t}}function Id(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Nd(t){return(Nd=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}Ri=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Pd(t,n)}(r,cd);var t,n,e,i=Dd(r);function r(){var t;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(t=i.call(this)).Un=Ii.HEAT_MAP_MARKER,t.Za=!1,t.Ya=t.Ya.bind(Id(t)),t}return t=r,(n=[{key:"add",value:function(t){jd(Nd(r.prototype),"add",this).call(this,t),t.Va&&!t.qa&&this.Ka(t.Ja),0<this.Ha.length&&this.Vn(tb).on("update",this.Ya)}},{key:"remove",value:function(t){jd(Nd(r.prototype),"remove",this).call(this,t),this.Za&&this.Ka(null)}}])&&Cd(t.prototype,n),e&&Cd(t,e),r}();Object.assign(Ri.prototype,{Xa:function(){var t,n=Ad(this.Ha);try{for(n.s();!(t=n.n()).done;){var e,i=t.value;i.za()&&(-1<(e=this.Ha.indexOf(i))&&this.Ha.splice(e,1),this.O(i),i.qa||this.Ka(i.Ja),i.needUpdateBound=!0)}}catch(t){n.e(t)}finally{n.f()}},Ka:function(i){var t=this.Vn(ug),n=t.getExtendMesh(),e=n.material.map;(n.material.map=i)?(n.material.mapMixColor=!0,n.material.map.needsUpdate=!0):n.material.mapMixColor=!1,n.material.needsUpdate=!0,t.getModelMeshs().forEach(function(t){if("MultiMaterial"===t.material.type)for(var n=t.material.materials.length,e=0;e<n;)(t.material.materials[e].map=i)?(t.material.materials[e].map.needsUpdate=!0,t.material.materials[e].mapMixColor=!0):(t.material.materials[e].mapMixColor=!1,t.material.materials[e].transparent=!0),t.material.materials[e].needsUpdate=!0,e+=0===e?3:2;else(t.material.map=i)?(t.material.mapMixColor=!0,t.material.map.needsUpdate=!0,1===t.material.opacity&&(t.material.transparent=!1)):(t.material.mapMixColor=!1,t.material.transparent=!0),t.material.needsUpdate=!0}),e&&(e.dispose(),e=null),this.Za=!0},Ya:function(){this.Xa(),0===this.Ha.length&&this.Vn(tb).off("update",this.Ya)}});Ai=Ri;function Fd(t,n){Jf.call(this,t,n),this.type="AmbientLight",this.castShadow=void 0}function Ud(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}Fd.prototype=Object.assign(Object.create(Jf.prototype),{constructor:Fd,isAmbientLight:!0});var Bd=function(){function n(t){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,n),this.W=t,this.Qa=null,this.$a=null,this.tu=null,this.nu=null,this.createLight=this.createLight.bind(this)}var t,e,i;return t=n,(e=[{key:"createLight",value:function(t,n){var e=this.W.getMapOptions(),i=e.lockedLight,e=e.lightConfig[n];return t.eu=new Fd(e[1].color,e[1].intensity),t.iu=new Z,t.ru=new tl(e[0].color,e[0].intensity),t.ru.position.set(e[0].position.x,e[0].position.y,e[0].position.z),t.ru.target=t.iu,t.ou=new tl(e[2].color,e[2].intensity),t.ou.position.set(e[2].position.x,e[2].position.y,e[2].position.z),t.ou.target=t.iu,this.Qa=t,this.$a=n,i&&(this.su=this.su.bind(this),this.W.on("viewChanged",this.su)),this}}])&&Ud(t.prototype,e),i&&Ud(t,i),n}();function Gd(t){return(Gd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Hd(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Vd(t,n,e){return(Vd="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,n,e){t=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=Xd(t)););return t}(t,n);if(t){n=Object.getOwnPropertyDescriptor(t,n);return n.get?n.get.call(e):n.value}})(t,n,e||t)}function zd(t,n){return(zd=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Wd(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Xd(e);return t=i?(t=Xd(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Gd(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function Xd(t){return(Xd=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}Object.assign(Bd.prototype,{au:function(t){var n=new ci;return n.setFromVector3(t),n.theta},uu:function(t,n){var e=new ci;e.setFromVector3(t),e.theta=n;n=new St;n.setFromSpherical(e),t.copy(n)},su:function(){var t,n,e;this.Qa&&(e=this.au(this.W.camera.position),null===this.tu&&(t=this.au(this.Qa.ru.position),n=this.au(this.Qa.ou.position),this.tu=t-e,this.nu=n-e),n=e+this.tu,this.uu(this.Qa.ru.position,n),e=e+this.nu,this.uu(this.Qa.ou.position,e))},vt:function(){this.W.getMapOptions().lockedLight&&this.W.off("viewChanged",this.su)}});Di=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&zd(t,n)}(r,cd);var t,n,e,i=Wd(r);function r(){var t;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(t=i.call(this)).Un=Ii.DYNAMIC_MODEL_MARKER,t}return t=r,(n=[{key:"init",value:function(){Vd(Xd(r.prototype),"init",this).call(this),this.hu(),this.cu(),this.fu()}},{key:"remove",value:function(n){var i,t,e=this;n.lu?(i=this.Vn(tb),n.tt=void 0,(t=new Oi({src:[1],dest:[0]})).gt(1).bt(function(t){var e=t.destination[0];n.jn.traverse(function(t){var n;t instanceof Ko&&(t.material.transparent=!0,n=t.material.userData.sourceOpacity,i.getMapOptions().materialMode===nr.REAL?t.material.uniforms.opacity.value=n*e:t.material.opacity=n*e,i.enableUpdateRender())})}).wt(function(){e.Fi.remove(n.jn),i.pn.vn(t),Vd(Xd(r.prototype),"remove",e).call(e,n),i.enableUpdateNode()}).dt(),i.pn.mn(t)):Vd(Xd(r.prototype),"remove",this).call(this,n)}}])&&Hd(t.prototype,n),e&&Hd(t,e),r}();Object.assign(Di.prototype,{hu:function(){var t=this.Vn(tb);this.du=new Bd(t).createLight(this,"FMDynamicModelLayer")},fu:function(){var n=this,e=this.Vn(tb);e.Pt.hdr&&e.Pt.hdr.load(e,function(t){n.Fi.environment=t,e.enableUpdateRender()})},cu:function(){var t=this;this.Fi.add(this.ru),this.Fi.add(this.eu),this.Fi.add(this.ou),this.Fi.add(this.iu),this.Fi.removeLight=function(){t.vu()}},vu:function(){this.Fi.remove(this.ru),this.Fi.remove(this.eu),this.Fi.remove(this.ou),this.du.vt()}});Gi=Di;function Zd(t){return(Zd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Yd(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function qd(t,n,e){return(qd="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,n,e){t=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=Qd(t)););return t}(t,n);if(t){n=Object.getOwnPropertyDescriptor(t,n);return n.get?n.get.call(e):n.value}})(t,n,e||t)}function Kd(t,n){return(Kd=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Jd(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Qd(e);return t=i?(t=Qd(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Zd(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function Qd(t){return(Qd=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}ir=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Kd(t,n)}(r,cd);var t,n,e,i=Jd(r);function r(){var t;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(t=i.call(this)).Un=Ii.LINE_MARKER,t}return t=r,(n=[{key:"init",value:function(){qd(Qd(r.prototype),"init",this).call(this),this.Fi.position.y=0}}])&&Yd(t.prototype,n),e&&Yd(t,e),r}();function $d(t){return($d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function tv(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function nv(t,n,e){return(nv="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,n,e){t=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=rv(t)););return t}(t,n);if(t){n=Object.getOwnPropertyDescriptor(t,n);return n.get?n.get.call(e):n.value}})(t,n,e||t)}function ev(t,n){return(ev=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function iv(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=rv(e);return t=i?(t=rv(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==$d(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function rv(t){return(rv=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}tr=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&ev(t,n)}(r,cd);var t,n,e,i=iv(r);function r(){var t;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(t=i.call(this)).Un=Ii.LOCATION_MARKER,t}return t=r,(n=[{key:"init",value:function(){nv(rv(r.prototype),"init",this).call(this),this.Fi.position.y=0}}])&&tv(t.prototype,n),e&&tv(t,e),r}();function ov(t){return(ov="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function sv(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function av(t,n){return(av=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function uv(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=hv(e);return t=i?(t=hv(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==ov(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function hv(t){return(hv=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}sr=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&av(t,n)}(r,cd);var t,n,e,i=uv(r);function r(){var t;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(t=i.call(this)).Un=Ii.DOM_MARKER,t}return t=r,(n=[{key:"init",value:function(){}},{key:"add",value:function(t){this.K.push(t),this.needUpdateBound=!0}},{key:"remove",value:function(t){t=this.K.indexOf(t);-1<t&&this.K.splice(t,1),this.needUpdateBound=!0}},{key:"clear",value:function(){for(;0<this.K.length;)this.K[0].dispose();this.K.length=0,this.needUpdateBound=!0}},{key:"dispose",value:function(){this.K.length=0,this.Fi=void 0}},{key:"visible",get:function(){return this.Bn},set:function(t){for(var n=0;n<this.K.length;n++)this.K[n].visible=t}}])&&sv(t.prototype,n),e&&sv(t,e),r}();function cv(t){return(cv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function fv(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function lv(t,n,e){return(lv="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,n,e){t=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=pv(t)););return t}(t,n);if(t){n=Object.getOwnPropertyDescriptor(t,n);return n.get?n.get.call(e):n.value}})(t,n,e||t)}function dv(t,n){return(dv=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function vv(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=pv(e);return t=i?(t=pv(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==cv(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function pv(t){return(pv=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var mv=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&dv(t,n)}(r,ed);var t,n,e,i=vv(r);function r(){return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),i.call(this)}return t=r,(n=[{key:"init",value:function(){lv(pv(r.prototype),"init",this).call(this);var t=this.Vn(tb);this.visible=t.Zt.pu(this.Un)}},{key:"removeLight",value:function(){this.vu&&this.vu()}},{key:"putLight",value:function(){this.cu&&this.cu()}},{key:"visible",get:function(){return this.Bn},set:function(t){this.Bn=t,this.Fi.visible=!(!this.tt.visible||!this.Bn);t=this.Vn(tb);t&&t.Zt.er()}},{key:"getBound",value:function(){return{maxY:this.bound.max.y,maxX:this.bound.max.x,minX:this.bound.min.x,minY:this.bound.min.y}}},{key:"remove",value:function(t){this.Fi.remove(t.jn),lv(pv(r.prototype),"remove",this).call(this,t)}}])&&fv(t.prototype,n),e&&fv(t,e),r}();function gv(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var yv=function(){function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t)}var n,e,i;return n=t,i=[{key:"distance",value:function(t,n){return Lu.distance(t,n)}},{key:"isContain",value:function(t,n){return Lu.isPolygonContainPoint(t,n)}},{key:"bound",value:function(t){for(var n=-Number.MAX_VALUE,e=-Number.MAX_VALUE,i=Number.MAX_VALUE,r=Number.MAX_VALUE,o=0;o<t.length;o++)t[o].x>n&&(n=t[o].x),t[o].y>e&&(e=t[o].y),t[o].x<i&&(i=t[o].x),t[o].y<r&&(r=t[o].y);return{max:{x:n,y:e},min:{x:i,y:r},size:{x:n-i,y:e-r},center:{x:(n+i)/2,y:(e+r)/2}}}},{key:"scaleBound",value:function(t,n){var e=t.max,i=t.min,t=new fi(e.x,e.y),e=new fi(i.x,i.y),i=t.clone().add(e).multiplyScalar(.5),t=t.clone().sub(e),e=t.clone().normalize(),t=t.clone().length()*n,n=i.clone().add(e.clone().multiplyScalar(t/2)),i=i.clone().add(e.clone().multiplyScalar(-t/2)),e=n.x,t=n.y,n=i.x,i=i.y;return{max:{x:e,y:t},min:{x:n,y:i},size:{x:Math.abs(e-n),y:Math.abs(t-i)},center:{x:(e+n)/2,y:(t+i)/2}}}},{key:"rectangleBuilder",value:function(t,n,e){var i=[];return i.push({x:e.x-t/2,y:e.y+n/2}),i.push({x:e.x+t/2,y:e.y+n/2}),i.push({x:e.x+t/2,y:e.y-n/2}),i.push({x:e.x-t/2,y:e.y-n/2}),i}},{key:"circleBuilder",value:function(t,n,e){for(var i=[],r=0;r<=e;r++){var o=r/e*Math.PI*2;i.push({x:n.x+t*Math.cos(o),y:n.y+t*Math.sin(o)})}return i}},{key:"fanBuilder",value:function(t,n,e,i){var r=[];r.push(n);for(var o=[i[0]/180*Math.PI,i[1]/180*Math.PI],s=(o[1]-o[0])/e,a=0;a<=e;a++){var u=o[0]+a*s;r.push({x:n.x+t*Math.sin(u),y:n.y+t*Math.cos(u)})}return r}},{key:"area",value:function(t){return Lu.ui(t,t.length)}},{key:"TriangleCentroid",value:function(t,n,e,i){var r=n.x-t.x,o=n.y-t.y,s=e.x-t.x,a=e.y-t.y;return i.area=(r*a-s*o)/2,i.centroid={},i.centroid.x=(t.x+n.x+e.x)/3,i.centroid.y=(t.y+n.y+e.y)/3,!0}},{key:"calculatorInsideCentroid",value:function(t,n){var e=t.length;if(e<3)return!1;for(var i=[],r=1;r<e-1;r++){var o={};this.TriangleCentroid(t[0],t[r],t[r+1],o),i.push(o)}var s=[];i.forEach(function(t,n,e){s.push(t)});var a=!1;s.sort(function(t,n){return(0<t.area?t.area:-t.area)-(0<n.area?n.area:-n.area)});for(;0<s.length&&!(a=this.calculatorCentroid(t,s,n));)s.shift();if(a)return a;var u=[];i.forEach(function(t,n,e){u.push(t)});for(;0<u.length&&!(a=this.calculatorCentroid(t,u,n));)u.shift();return a}},{key:"calculatorCentroid",value:function(t,n,e){for(var i=0,r={x:0,y:0},o=0;o<n.length;o++)r.x+=n[o].centroid.x*n[o].area,r.y+=n[o].centroid.y*n[o].area,i+=n[o].area;return e.x=r.x/i,e.y=r.y/i,this.isContain(t,e)}},{key:"latlngToMapCoordinate",value:function(t){return{x:20037508.34*parseFloat(t.x)/180,y:Math.log(Math.tan((90+parseFloat(t.y))*Math.PI/360))/(Math.PI/180)*20037508.34/180}}},{key:"mapCoordinateToLatlng",value:function(t){var n=parseFloat(t.y)/20037508.34*180;return{x:parseFloat(t.x)/20037508.34*180,y:180/Math.PI*(2*Math.atan(Math.exp(n*Math.PI/180))-Math.PI/2)}}}],(e=null)&&gv(n.prototype,e),i&&gv(n,i),t}();function bv(t){return(bv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function wv(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function _v(t,n,e){return(_v="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,n,e){t=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=Sv(t)););return t}(t,n);if(t){n=Object.getOwnPropertyDescriptor(t,n);return n.get?n.get.call(e):n.value}})(t,n,e||t)}function xv(t,n){return(xv=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Mv(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Sv(e);return t=i?(t=Sv(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==bv(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function Sv(t){return(Sv=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}dr=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&xv(t,n)}(r,ar);var t,n,e,i=Mv(r);function r(t){var n;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(n=i.call(this)).Ee=t,n.Jt=t.height,n.Un=Ii.EXTENT,n.mu=null,n.gu=null,n.jn=null,n}return t=r,(n=[{key:"bound",get:function(){return!0===this.needUpdateBound&&(this.Ee.Gn=null,this.Gn=this.Ee.getBound(),this.needUpdateBound=!1),this.Gn.clone()}},{key:"x",get:function(){return this.Gn.center.x}},{key:"y",get:function(){return this.Gn.center.y}},{key:"ID",get:function(){return this.Ee.Yt}},{key:"height",get:function(){return this.Ee.height}},{key:"level",get:function(){return this.tt.tt.$n}},{key:"visible",get:function(){return this.Bn},set:function(t){this.Bn=t,this.yu()}},{key:"getData",value:function(){var t=this.Ee;return{ID:t.Yt,height:t.height,area:t.area}}},{key:"getBound",value:function(){return{minX:this.bound.Pn.x,maxX:this.bound.Dn.x,minY:this.bound.Pn.y,maxY:this.bound.Dn.y}}},{key:"getArea",value:function(){return yv.area(this.Ee.qr[0])}},{key:"dispose",value:function(){this.bu(),_v(Sv(r.prototype),"dispose",this).call(this)}},{key:"coordinates",get:function(){return this.Ee.qr}},{key:"getRenderNode",value:function(){return this.jn}}])&&wv(t.prototype,n),e&&wv(t,e),r}();Object.assign(dr.prototype,{za:function(){var t,n,e,i;this.jn||(t=this.Vn(tb))&&(i=this.Vn(vr),n=t.Zt.wu(this.Ee,this.Jt,i),this.mu=t.Zt._u.na(i.Yt),e=this.be(t),i!==t.qt&&(e.polygonOffset=!0,e.polygonOffsetFactor=-1,e.polygonOffsetUnits=-1),e.stencilWrite=!0,e.stencilRef=1,e.stencilFunc=516,e.stencilFail=7681,e.stencilZFail=7681,e.stencilZPass=7681,i=this.Ee.getBound(),this.jn=new Ko(n.geometry,e),this.jn.rotation.set(-Math.PI/2,0,0,"XYZ"),this.jn.position.set(i.center.x-t.N,-this.Jt,t.F-i.center.y),this.jn.receiveShadow=!0,this.jn.visible=this.Bn,(this.jn.mapNode=this).tt.Fi.add(this.jn))},xu:function(t,n){var e;this.jn&&(e=this.Vn(vr),this.mu=n.na(e.Yt),this.Mu())},Su:function(t){t!==this.gu&&(this.gu=t,this.Mu())},Mu:function(){var t;!this.jn||(t=this.Vn(tb))&&(this.jn.material=this.be(t),t.enableUpdateRender())},be:function(t){var n=this.Vn(ug),n={color:this.mu.color,alpha:this.mu.alpha*n.Eu};this.gu&&(n.url=this.gu,n.finish=function(){t.enableUpdateRender()});n=t.Zt.xe.Ns(n);return n.polygonOffset=!0,n.polygonOffsetFactor=1,n.polygonOffsetUnits=4,n.userData.opacity=n.opacity,n},yu:function(){var t=this.Vn(tb);t&&(this.jn&&(this.jn.visible=this.Bn),t.enableUpdateNode(),t.enableUpdateRender())},bu:function(){this.jn&&(this.jn.parent&&this.jn.parent.remove(this.jn),this.jn.geometry.dispose(),this.jn.geometry=void 0,this.jn.material=void 0,this.jn.mapNode=void 0,this.jn=void 0)},updateMaterialByThemeTool:function(t){this.mu=t,this.Mu()}});var Ev=dr;function Tv(t){return(Tv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Lv(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var e=[],i=!0,r=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(i=(s=a.next()).done)&&(e.push(s.value),!n||e.length!==n);i=!0);}catch(t){r=!0,o=t}finally{try{i||null==a.return||a.return()}finally{if(r)throw o}}return e}}(t,n)||Rv(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Rv(t,n){if(t){if("string"==typeof t)return Ov(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(e="Object"===e&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Ov(t,n):void 0}}function Ov(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}function Av(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function kv(t,n,e){return(kv="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,n,e){t=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=Pv(t)););return t}(t,n);if(t){n=Object.getOwnPropertyDescriptor(t,n);return n.get?n.get.call(e):n.value}})(t,n,e||t)}function Cv(t,n){return(Cv=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function jv(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Pv(e);return t=i?(t=Pv(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Tv(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function Pv(t){return(Pv=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}_r=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Cv(t,n)}(r,mv);var t,n,e,i=jv(r);function r(t,n){var e;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(e=i.call(this)).Yn=t.alias,e.Tu=t.desc,e.Jt=t.height,e.Un=Ii.EXTENT_LAYER,e.Fi.name="extent",e.Fi.userData.type="extent",e.Lu={},e.Ru(t,n),e}return t=r,(n=[{key:"level",get:function(){return this.tt.$n}},{key:"init",value:function(){kv(Pv(r.prototype),"init",this).call(this),this.hu(),this.cu()}},{key:"getFeatures",value:function(){return this.K}},{key:"dispose",value:function(){this.vu(),kv(Pv(r.prototype),"dispose",this).call(this)}}])&&Av(t.prototype,n),e&&Av(t,e),r}();Object.assign(_r.prototype,{Ru:function(t,n){var e,i=function(t,n){var e;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(e=Rv(t))||n&&t&&"number"==typeof t.length){e&&(t=e);var i=0,n=function(){};return{s:n,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},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,o=!0,s=!1;return{s:function(){e=t[Symbol.iterator]()},n:function(){var t=e.next();return o=t.done,t},e:function(t){s=!0,r=t},f:function(){try{o||null==e.return||e.return()}finally{if(s)throw r}}}}(t.K);try{for(i.s();!(e=i.n()).done;){var r=Lv(e.value,2),o=(r[0],r[1]),s=new Ev(o);this.mn(s),s.visible=n.map.Zt.Ou(this.Un,{typeID:s.typeID,FID:s.FID})}}catch(t){i.e(t)}finally{i.f()}},mn:function(t){(t.tt=this).K.push(t)},hu:function(){var t=this.Vn(tb);this.du=new Bd(t).createLight(this,"FMExtentLayer")},cu:function(){this.Fi.add(this.ru),this.Fi.add(this.eu),this.Fi.add(this.ou),this.Fi.add(this.iu)},vu:function(){this.Fi.remove(this.ru),this.Fi.remove(this.eu),this.Fi.remove(this.ou),this.du.vt()}});Tu=_r;function Dv(t){return(Dv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Iv(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Nv(t,n,e){return(Nv="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,n,e){t=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=Bv(t)););return t}(t,n);if(t){n=Object.getOwnPropertyDescriptor(t,n);return n.get?n.get.call(e):n.value}})(t,n,e||t)}function Fv(t,n){return(Fv=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Uv(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Bv(e);return t=i?(t=Bv(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Dv(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function Bv(t){return(Bv=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}Ru=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Fv(t,n)}(r,ar);var t,n,e,i=Uv(r);function r(t){var n;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(n=i.call(this)).Ee=t,n.Au=t.maxlevel,n.ku=t.minlevel,n.Jt=t.height,n.Un=Ii.MODEL,n.jn=null,n.Cu=null,n.Lt=null,n.Gn=null,n.ju="#FF0000",n.Pu=null,n.Se={top:null,left:null,right:null,front:null,back:null},n.mu=null,n.Du=null,n.Eu=null,n.Iu=null,n.Nu=null,n.Fu=.01*n.Uu(n.x+n.y),n.Bu=null,n.Gu=null,n.Hu=[0,0],n.Vu=null,n.zu=0,n.Wu=null,n}return t=r,(n=[{key:"bound",get:function(){return!0===this.needUpdateBound&&(this.Ee.Gn=null,this.Gn=this.Ee.getBound(),this.needUpdateBound=!1),this.Gn.clone()}},{key:"x",get:function(){var t;return null===(t=this.Ee.Wt)||void 0===t?void 0:t.x}},{key:"y",get:function(){var t;return null===(t=this.Ee.Wt)||void 0===t?void 0:t.y}},{key:"ID",get:function(){return this.Ee.Yt}},{key:"FID",get:function(){return this.Ee.fid}},{key:"zoomRange",get:function(){return{maxLevel:this.Au,minLevel:this.ku}}},{key:"name",get:function(){return this.Ee.name}},{key:"eName",get:function(){return this.Ee.ename}},{key:"pass",get:function(){return this.Ee.pass}},{key:"level",get:function(){return this.tt.tt.$n}},{key:"height",get:function(){return this.Ee.height}},{key:"typeID",get:function(){return this.Ee.type}},{key:"visible",get:function(){return this.Bn},set:function(t){this.Bn=t,this.yu()}},{key:"coordinates",get:function(){return this.Ee.qr}},{key:"getData",value:function(){var t=this.Ee;return{ID:t.Yt,typeID:t.type,FID:t.fid,height:t.height,name:t.name,eName:t.ename,minLevel:t.minlevel,maxLevel:t.maxlevel,pass:t.pass}}},{key:"getArea",value:function(){return yv.area(this.Ee.qr[0])}},{key:"setColor",value:function(t,n){void 0!==t&&(this.Du=t),void 0!==n&&(this.Eu=n),this.Mu()}},{key:"resetColor",value:function(){this.mu||this.Xu(),this.setColor(this.mu.color,this.mu.alpha)}},{key:"setBorderColor",value:function(t,n){t&&(this.Iu=t),null!=n&&(this.Nu=n);n=this.Vn(tb);this.Zu(n)}},{key:"resetBorderColor",value:function(){this.mu&&this.setBorderColor(this.mu.strokeColor,this.mu.alpha)}},{key:"setTopImage",value:function(t){this.Bu=t.image,this.Vu=void 0!==t.coords?t.coords:this.Ee.Wt,this.Gu=void 0!==t.size?t.size:[5,5],this.Hu=void 0!==t.offset?t.offset:[0,0],this.zu=void 0!==t.angle?t.angle:0,this.jn&&this.Yu()}},{key:"clearTopImage",value:function(){var t;this.Se.top&&this.Se.top.parent&&(this.Se.top.parent.remove(this.Se.top),this.Se.top.geometry.dispose(),this.Se.top.material.map&&this.Se.top.material.map.dispose(),this.Se.top.material.dispose(),this.Se.top=null,(t=this.Vn(tb))&&t.enableUpdateRender())}},{key:"flash",value:function(t){this.qu(t);var n=this,e=this.Vn(tb),i=0;function r(){i%2==0?n.jn&&(n.jn.material.color=new _i(n.ju)):n.jn&&(n.jn.material.color=new _i(n.Du)),i++,e.enableUpdateRender()}n.Pu&&clearTimeout(n.Pu),function t(){n.jn&&(n.jn.userData.sourceMaterial||(n.jn.userData.sourceMaterial=n.jn.material,n.jn.material=n.jn.material.clone()),r());n.Pu=setTimeout(t,100)}()}},{key:"stopFlash",value:function(){var t;this.Pu&&(clearTimeout(this.Pu),this.Pu=null,t=this.jn.material,this.jn.material=this.jn.userData.sourceMaterial,delete this.jn.userData.sourceMaterial,t.dispose(),t=null,this.Vn(tb).enableUpdateRender())}},{key:"getBound",value:function(){return{maxY:this.bound.max.y,maxX:this.bound.max.x,minX:this.bound.min.x,minY:this.bound.min.y}}},{key:"dispose",value:function(){this.bu(),Nv(Bv(r.prototype),"dispose",this).call(this)}},{key:"getRenderNode",value:function(){return this.jn}},{key:"updateMaterialByThemeTool",value:function(t){var n,e,i;this.jn&&(e=(n=this.Vn(vr)).tt.Zt,t.image?this.Bu=e.Ku(t,"logoPath",n.buildingID)+t.image:this.Bu=null,t.coords&&(i=t.coords.split(","),this.Vu=new fi(parseFloat(i[0]),parseFloat(i[1]))),t.angle&&(this.zu=t.angle),t.sizes&&(i=t.sizes.split(","),this.Gu=[parseFloat(i[0]),parseFloat(i[1])]),this.Du=t.color,this.Eu=t.alpha,this.Iu=t.strokeColor,this.Nu=t.alpha,this.Ju=t.strokeWidth,this.Cu&&(this.Cu.visible=0!==this.Ju),this.Mu(),this.Yu())}}])&&Iv(t.prototype,n),e&&Iv(t,e),r}();Object.assign(Ru.prototype,{za:function(){var t,n,e,i;this.jn||(t=(e=this.Vn(ug).tt).tt,n=(i=e.tt.Zt).wu(this.Ee,this.Jt,e),this.Xu(),this.Du||(this.Du=this.mu.color),null===this.Eu&&(this.Eu=this.mu.alpha),this.Iu||(this.Iu=this.mu.strokeColor),this.Ju||(this.Ju=this.mu.strokeWidth),null===this.Nu&&(this.Nu=this.mu.alpha),(e=this.be(i.xe)).userData.opacity=e.opacity,i=this.Ee.getBound(),this.jn=new Ko(n.geometry,e),i=new St(i.center.x-t.N,0,t.F-i.center.y),this.jn.position.copy(i),this.jn.rotation.set(-Math.PI/2,0,0,"XYZ"),(this.jn.mapNode=this).tt.Fi.add(this.jn),this.Qu(n.shape),this.$u(),this.Wu&&this.Wu.za(this))},Qu:function(t){var r=this,n=this.Vn(vr).tt.Zt,n=this.th(n.xe),o=this.Jt&&-1!==this.Jt?this.Jt:2,e=(new Dr).setFromPoints(t.getPoints());e&&0<e.vertices.length&&e.vertices.push(e.vertices[0]);for(var i=[],s=e.vertices.length,a=0;a<s;a++)e.vertices[a].z=this.Jt+this.Fu,0===a||a===s-1?i.push(e.vertices[a]):i.push(e.vertices[a],e.vertices[a]);e.vertices=i;var u=new vl(e,n);if(u.position.setZ(.005*o),u.castShadow=!1,u.geometry.computeBoundingSphere(),this.Cu=u,this.Cu.matrixAutoUpdate=!1,this.jn.add(u),0===this.Ju&&(this.Cu.visible=!1),t.holes)for(var h=0;h<t.holes.length;h++)!function(t,n){for(var e=0;e<n.length;e++){var i=[];i.push(new St(n[e].v1.x,n[e].v1.y,o)),i.push(new St(n[e].v2.x,n[e].v2.y,o));i=new vl((new eo).setFromPoints(i),r.nh);t.add(i)}}(u,t.holes[h].curves)},$u:function(){var t,n;this.Bu&&this.Gu&&(n=this.Vn(tb),t=new fo(1,1,1,1),n=this.eh(n,this.Bu),this.Se.top=new Ko(t,n),this.ih(),this.jn.add(this.Se.top))},Yu:function(){this.Bu&&this.Gu?this.Se.top?(this.rh(),this.ih()):this.$u():this.clearTopImage()},qu:function(t){this.ju=t},xu:function(){this.Xu(),this.Du=this.mu.color,this.Eu=this.mu.alpha,this.Iu=this.mu.strokeColor,this.Nu=this.mu.alpha,this.Ju=this.mu.strokeWidth,this.Cu&&(this.Cu.visible=0!==this.Ju),this.Mu(),this.jn&&this.Yu()},th:function(t){var n=this.Vn(ug);return t.Ds({isline:!0,color:this.Iu,opacity:this.Nu*n.Eu,needDepth:!0})},be:function(t){var n=this.Vn(ug);return t.Ns({color:this.Du,alpha:this.Eu*n.Eu})},eh:function(n,t){var e=new Mf({transparent:!0,opacity:this.Vn(ug).Eu,depthWrite:!1,visible:!1});return n.Zt.xe.Ks(t,function(t){e.map=t,e.map.wrapS=En,e.map.wrapT=En,e.needsUpdate=!0,e.visible=!0,e.polygonOffset=!0,e.polygonOffsetFactor=-1,e.polygonOffsetUnits=-4,n.enableUpdateRender()}),e},rh:function(){var t,n=this.Se.top;n&&(n.material.map&&n.material.map.dispose(),n.material.map=null,n.material.dispose(),t=this.Vn(tb),n.material=this.eh(t,this.Bu))},Mu:function(){var t;!this.jn||(t=this.Vn(tb))&&(this.jn.userData.sourceMaterial?this.jn.userData.sourceMaterial=this.be(t.Zt.xe):this.jn.material=this.be(t.Zt.xe),this.Zu(t),this.rh(),t.enableUpdateRender())},Zu:function(t){var n=this.th(t.Zt.xe);if(this.Cu){this.Cu.material=n;for(var e=0;e<this.Cu.children.length;e++)this.Cu.children[e].material=n}t.enableUpdateRender()},ih:function(){var t=this.Se.top;t.scale.set(this.Gu[0],this.Gu[1],1);var n=this.Ee.getBound();t.position.set(this.Hu[0]+this.Vu.x-n.center.x,this.Hu[1]+this.Vu.y-n.center.y,this.Jt+.1),t.rotation.z=-this.zu*Math.PI/180},Xu:function(){var t,n=this.Vn(vr),e=n.tt.Zt;this.mu=e._u.ia({fid:this.Ee.fid,typeID:this.Ee.type+"",bid:n.Yt}),this.mu.image?this.Bu=e.Ku(this.mu,"logoPath",n.buildingID)+this.mu.image:this.Bu=null,this.mu.coords&&(t=this.mu.coords.split(","),this.Vu=new fi(parseFloat(t[0]),parseFloat(t[1]))),this.mu.angle&&(this.zu=this.mu.angle),this.mu.sizes&&(t=this.mu.sizes.split(","),this.Gu=[parseFloat(t[0]),parseFloat(t[1])])},yu:function(){var t,n=this.Vn(tb);n&&(this.jn&&(t=n.getZoom(),n.Zt.oh(this,t)),n.enableUpdateNode(),n.enableUpdateRender())},bu:function(){this.jn&&(this.Cu&&(this.jn.remove(this.Cu),this.Cu.material.dispose(),this.Cu.geometry.dispose(),this.Cu=void 0),this.clearTopImage(),this.jn.parent&&this.jn.parent.remove(this.jn),this.jn.geometry.dispose(),this.jn.geometry=void 0,this.jn.material=void 0,this.jn.mapNode=void 0,this.jn=void 0)},Uu:function(t){return(t=(9301*t+49297)%233280)/233280}});var Gv=Ru;function Hv(t){return(Hv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Vv(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var e=[],i=!0,r=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(i=(s=a.next()).done)&&(e.push(s.value),!n||e.length!==n);i=!0);}catch(t){r=!0,o=t}finally{try{i||null==a.return||a.return()}finally{if(r)throw o}}return e}}(t,n)||zv(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function zv(t,n){if(t){if("string"==typeof t)return Wv(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(e="Object"===e&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Wv(t,n):void 0}}function Wv(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}function Xv(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Zv(t,n,e){return(Zv="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,n,e){t=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=Kv(t)););return t}(t,n);if(t){n=Object.getOwnPropertyDescriptor(t,n);return n.get?n.get.call(e):n.value}})(t,n,e||t)}function Yv(t,n){return(Yv=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function qv(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Kv(e);return t=i?(t=Kv(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Hv(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function Kv(t){return(Kv=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}eh=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Yv(t,n)}(r,mv);var t,n,e,i=qv(r);function r(t,n){var e;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(e=i.call(this)).Un=Ii.MODEL_LAYER,e.Fi.name="model",e.Fi.userData.type="model",e.Yn="model",e.ah={},e.Ru(t,n),e}return t=r,(n=[{key:"level",get:function(){return this.tt.$n}},{key:"height",get:function(){return this.tt.Jt}},{key:"getFeatures",value:function(){return this.K}},{key:"init",value:function(){Zv(Kv(r.prototype),"init",this).call(this),this.hu(),this.cu()}},{key:"dispose",value:function(){this.vu(),Zv(Kv(r.prototype),"dispose",this).call(this)}}])&&Xv(t.prototype,n),e&&Xv(t,e),r}();Object.assign(eh.prototype,{Ru:function(t,n){var e,i=function(t,n){var e;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(e=zv(t))||n&&t&&"number"==typeof t.length){e&&(t=e);var i=0,n=function(){};return{s:n,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},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,o=!0,s=!1;return{s:function(){e=t[Symbol.iterator]()},n:function(){var t=e.next();return o=t.done,t},e:function(t){s=!0,r=t},f:function(){try{o||null==e.return||e.return()}finally{if(s)throw r}}}}(t.K);try{for(i.s();!(e=i.n()).done;){var r=Vv(e.value,2),o=(r[0],r[1]),s=new Gv(o);this.mn(s),s.visible=n.map.Zt.Ou(this.Un,{typeID:s.typeID,FID:s.FID})}}catch(t){i.e(t)}finally{i.f()}},mn:function(t){(t.tt=this).K.push(t)},hu:function(){var t=this.Vn(tb);this.du=new Bd(t).createLight(this,"FMModelLayer")},cu:function(){this.Fi.add(this.ru),this.Fi.add(this.eu),this.Fi.add(this.ou),this.Fi.add(this.iu)},vu:function(){this.Fi.remove(this.ru),this.Fi.remove(this.eu),this.Fi.remove(this.ou),this.du.vt()}});var Jv,uh=eh,Qv=new St,$v=new St,tp=new St,np=new fi,ep=new fi,ip=new Et,rp=new St,op=new St,sp=new St,ap=new fi,up=new fi,hp=new fi;function cp(t){var n;Z.call(this),this.type="Sprite",void 0===Jv&&(Jv=new eo,n=new Du(new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),5),Jv.setIndex([0,1,2,0,2,3]),Jv.setAttribute("position",new Nu(n,3,0,!1)),Jv.setAttribute("uv",new Nu(n,2,3,!1))),this.geometry=Jv,this.material=void 0!==t?t:new _c,this.center=new fi(.5,.5)}function fp(t,n,e,i,r,o){np.subVectors(t,e).addScalar(.5).multiply(i),void 0!==r?(ep.x=o*np.x-r*np.y,ep.y=r*np.x+o*np.y):ep.copy(np),t.copy(n),t.x+=ep.x,t.y+=ep.y,t.applyMatrix4(ip)}cp.prototype=Object.assign(Object.create(Z.prototype),{constructor:cp,isSprite:!0,raycast:function(t,n){null===t.camera&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),$v.setFromMatrixScale(this.matrixWorld),ip.copy(t.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(t.camera.matrixWorldInverse,this.matrixWorld),tp.setFromMatrixPosition(this.modelViewMatrix),t.camera.isPerspectiveCamera&&!1===this.material.sizeAttenuation&&$v.multiplyScalar(-tp.z);var e,i,r=this.material.rotation;0!==r&&(i=Math.cos(r),e=Math.sin(r));var o=this.center;fp(rp.set(-.5,-.5,0),tp,o,$v,e,i),fp(op.set(.5,-.5,0),tp,o,$v,e,i),fp(sp.set(.5,.5,0),tp,o,$v,e,i),ap.set(0,0),up.set(1,0),hp.set(1,1);r=t.ray.intersectTriangle(rp,op,sp,!1,Qv);null===r&&(fp(op.set(-.5,.5,0),tp,o,$v,e,i),up.set(0,1),null===(r=t.ray.intersectTriangle(rp,sp,op,!1,Qv)))||((r=t.ray.origin.distanceTo(Qv))<t.near||r>t.far||n.push({distance:r,point:Qv.clone(),uv:ko.getUV(Qv,rp,op,sp,ap,up,hp,new fi),face:null,object:this}))},clone:function(){return new this.constructor(this.material).copy(this)},copy:function(t){return Z.prototype.copy.call(this,t),void 0!==t.center&&this.center.copy(t.center),this}});ch={NAME:2,ENAME:4,FID:8};Object.freeze(ch);var lp=ch,Ri={NORMAL:1,INDOOR:2,OUTDOOR:4};Object.freeze(Ri);var dp=Ri;function vp(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}Di=function(){function n(t){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,n),this.uh=t,this.Bn=!0,this.hh=new Map,this.ch={x:1,y:1,z:1},this.fh=!0,this.Lt=null}var t,e,i;return t=n,(e=[{key:"visible",get:function(){return this.Bn},set:function(t){this.Bn=t,this.hh.forEach(function(t){t.yu()})}},{key:"show",get:function(){return this.fh},set:function(t){t!==this.fh&&(this.fh=t,this.lh({opacity:t?1:0,duration:1,finish:function(){}}))}},{key:"setFacadeNode",value:function(t){var n=t.FID;t.type===Ii.LABEL&&(n="label"+t.FID),this.hh.set(n,t)}}])&&vp(t.prototype,e),i&&vp(t,i),n}();Object.assign(Di.prototype,{za:function(t){var n;this.fh=!this.uh.parent.Zt.tr(this.uh),this.uh.dh===dp.NORMAL&&(this.uh.vh(),n=this.uh.parent.Et.Tn(this.uh.Yt),this.ch.z=n.isZoomLimit?.2:1),t.jn&&(t.Un===Ii.EXTERNAL_MODEL?(t.jn.scale.x=this.ch.x,t.jn.scale.y=this.ch.z,t.jn.scale.z=this.ch.y):t.Un===Ii.MODEL&&(t.jn.scale.x=this.ch.x,t.jn.scale.y=this.ch.y,t.jn.scale.z=this.ch.z)),this.lh({opacity:this.fh?1:0,duration:1,finish:function(){}})},ph:function(a,t){var u;t.scale.z===this.ch.z&&t.scale.y===this.ch.y||(u=void 0!==t.duration?t.duration:.5,this.ch=t.scale,this.hh.forEach(function(n){var e,i,r,o,s;n.Un!==Ii.MODEL&&n.Un!==Ii.EXTERNAL_MODEL||n.jn&&(e=n.jn.scale.x,i=n.jn.scale.y,r=n.jn.scale.z,o={x:t.scale.x-e,y:t.scale.z-i,z:t.scale.y-r},n.Un===Ii.MODEL&&(o={x:t.scale.x-e,y:t.scale.y-i,z:t.scale.z-r}),(s=new Oi({src:[0],dest:[1]})).gt(u).bt(function(t){t=t.destination[0];n.jn?(n.jn.scale.x=o.x*t+e,n.jn.scale.y=o.y*t+i,n.jn.scale.z=o.z*t+r,a.enableUpdateRender()):a.pn.vn(s)}).wt(function(){a.pn.vn(s),t.finish&&t.finish()}),a.pn.mn(s.dt()))}))},lh:function(e){var n=this;this.Lt?this.Lt.finish():this.Lt=new Oi,this.visible=!0;var i=this.uh.parent,r=[];this.hh.forEach(function(n){n.jn&&n.jn.traverse(function(t){t.constructor!==Ko&&t.constructor!==cp||(t=t.material,Array.isArray(t)||(t=[t]),n.Cu&&t.push(n.Cu.material),t.forEach(function(t){"FMMeshStandardMaterial"===t.type?r.push({material:t,offset:e.opacity-t.uniforms.opacity.value,opacity:t.uniforms.opacity.value}):r.push({material:t,offset:e.opacity-t.opacity,opacity:t.opacity})}))})}),this.Lt.pt([0]).mt([1]).gt(e.duration).bt(function(t){for(var n=t.destination[0],e=0;e<r.length;e++)"FMMeshStandardMaterial"===r[e].material.type?r[e].material.uniforms.opacity.value=r[e].offset*n+r[e].opacity:r[e].material.opacity=r[e].offset*n+r[e].opacity,r[e].material.transparent=!0,r[e].needsUpdate=!0;i.enableUpdateRender()}).wt(function(){n.visible=n.fh;for(var t=0;t<r.length;t++)"FMMeshStandardMaterial"===r[t].material.type?r[t].material.uniforms.opacity.value=r[t].opacity:r[t].material.opacity=r[t].opacity,r[t].needsUpdate=!0;i.pn.vn(n.Lt),e.finish&&e.finish(),i.enableUpdateRender()}).play(),i.pn.mn(this.Lt)}});var pp=Di;function mp(t){return(mp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function gp(t,n){var e;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(e=function(t,n){if(t){if("string"==typeof t)return yp(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(e="Object"===e&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?yp(t,n):void 0}}(t))||n&&t&&"number"==typeof t.length){e&&(t=e);var i=0,n=function(){};return{s:n,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},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,o=!0,s=!1;return{s:function(){e=t[Symbol.iterator]()},n:function(){var t=e.next();return o=t.done,t},e:function(t){s=!0,r=t},f:function(){try{o||null==e.return||e.return()}finally{if(s)throw r}}}}function yp(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}function bp(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function wp(t,n,e){return(wp="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,n,e){t=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=Sp(t)););return t}(t,n);if(t){n=Object.getOwnPropertyDescriptor(t,n);return n.get?n.get.call(e):n.value}})(t,n,e||t)}function _p(t,n){return(_p=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function xp(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Sp(e);return t=i?(t=Sp(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==mp(t)&&"function"!=typeof t?Mp(n):t}}function Mp(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Sp(t){return(Sp=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}dr=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&_p(t,n)}(r,vr);var t,n,e,i=xp(r);function r(t){var n;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(n=i.call(this,t)).ku=t.minlevel,n.Au=t.maxlevel,n.mh=t.levelChart,n.gh=t.fids,n.dh=dp.NORMAL,n.Wu=new pp(Mp(n)),n.yh=!1,n.bh=new Map,n.Ga=!0,n}return t=r,(n=[{key:"zoomRange",get:function(){return{minLevel:this.ku,maxLevel:this.Au}}},{key:"alignHeight",get:function(){return this.Ga&&(this.wh(),this.Ga=!1),this.bh}},{key:"overviewMode",get:function(){return this.dh}},{key:"visible",get:function(){return this.Bn},set:function(t){this.Bn=t,this.tt.Zt._h(this),this.tt.enableUpdateNode()}},{key:"levelChart",get:function(){return this.mh}},{key:"setTheme",value:function(t){this.tt.Zt.xh({themeID:t,bid:this.Yt})}},{key:"setThemeExtension",value:function(t){this.tt.Zt.Mh({data:t,bid:this.Yt})}},{key:"clearThemeExtension",value:function(){this.tt.Zt.Mh({bid:this.Yt})}},{key:"getFadeFeatures",value:function(){var t,n=[],e=gp(this.Wu.hh.values());try{for(e.s();!(t=e.n()).done;){var i=t.value;n.push(i)}}catch(t){e.e(t)}finally{e.f()}return n}},{key:"dispose",value:function(){wp(Sp(r.prototype),"dispose",this).call(this)}}])&&bp(t.prototype,n),e&&bp(t,e),r}();Object.assign(dr.prototype,{mn:function(t){(t.tt=this).K.push(t)},vh:function(){var t,n=this.parent.Et.Tn(this.Yt);this.dh===dp.OUTDOOR?n.isZoomLimit=!1:(t=this.parent.getZoom(),n.isZoomLimit=!(t<this.ku||t>=this.Au))},Sh:function(){this.vh();var t=this.parent.Et.Tn(this.Yt);this.Wu.ph(this.parent,{scale:{x:1,y:1,z:t.isZoomLimit?.2:1},duration:1,finish:function(){}})},wh:function(){if(this.tt)for(var t=this.tt.qt,n=0;n<this.mh.length;n+=2){var e=t.floorSpace*this.mh[n];this.bh.set(this.mh[n+1],e)}}});var Ep=dr;function Tp(t){return(Tp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Lp(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Rp(t,n,e){return(Rp="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,n,e){t=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=kp(t)););return t}(t,n);if(t){n=Object.getOwnPropertyDescriptor(t,n);return n.get?n.get.call(e):n.value}})(t,n,e||t)}function Op(t,n){return(Op=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Ap(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=kp(e);return t=i?(t=kp(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Tp(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function kp(t){return(kp=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}_r=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Op(t,n)}(r,ar);var t,n,e,i=Ap(r);function r(t,n){var e;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(e=i.call(this)).Ee=t,e.W=n,e.Au=t.maxlevel,e.ku=t.minlevel,e.Un=Ii.LABEL,e.mu=null,e.Eh=null,e.Ji=!1,e.Wu=null,n.Et.Th===lp.ENAME?e.Lh=t.ename:n.Et.Th===lp.FID?e.Lh=t.fid:e.Lh=t.name,e.Lh||(e.Lh="",e.Ji=!0),e}return t=r,(n=[{key:"bound",get:function(){return!0===this.needUpdateBound&&(this.Ee.Gn=null,this.Gn=this.Ee.getBound(),this.needUpdateBound=!1),this.Gn.clone()}},{key:"x",get:function(){return this.Ee.qr[0].x}},{key:"y",get:function(){return this.Ee.qr[0].y}},{key:"ID",get:function(){return this.Ee.Yt}},{key:"FID",get:function(){return this.Ee.fid}},{key:"typeID",get:function(){return this.Ee.type}},{key:"level",get:function(){return this.tt.tt.$n}},{key:"height",get:function(){return this.Ee.height}},{key:"zoomRange",get:function(){return{maxLevel:this.Au,minLevel:this.ku}}},{key:"name",get:function(){return this.Ee.name}},{key:"eName",get:function(){return this.Ee.ename}},{key:"text",get:function(){return this.Lh},set:function(t){t?(this.Lh=t,this.Ji=!1):(this.Lh="",this.Ji=!0),this.jn&&(this.Mu(),this.yu())}},{key:"visible",get:function(){return this.Bn},set:function(t){this.Bn=t,this.yu()}},{key:"setText",value:function(t){this.text=t}},{key:"getData",value:function(){var t=this.Ee;return{ID:t.Yt,typeID:t.type,FID:t.fid,height:t.height,name:t.name,eName:t.ename,minLevel:t.minlevel,maxLevel:t.maxlevel}}},{key:"getBound",value:function(){return{minX:this.bound.Pn.x,maxX:this.bound.Dn.x,minY:this.bound.Pn.y,maxY:this.bound.Dn.y}}},{key:"dispose",value:function(){this.bu(),this.W=null,Rp(kp(r.prototype),"dispose",this).call(this)}},{key:"getRenderNode",value:function(){return this.jn}}])&&Lp(t.prototype,n),e&&Lp(t,e),r}();Object.assign(_r.prototype,{za:function(){var t,n;this.jn||(n=this.Vn(ug).tt.tt,this.Xu(this.W.Zt,n.Zt._u),(t=this.be()).userData.opacity=t.opacity,this.jn=new cp(t),n=new St((t=(this.jn.mapNode=this).Ee.qr[0]).x-n.N,-t.y+n.F,0).applyEuler(new _(Math.PI/2,0,0,"XYZ")).add(new St(0,this.Ee.height,0)),this.jn.position.copy(n),this.Zi(this.W.Zt),this.tt.Fi.add(this.jn),this.Wu&&this.Wu.za(this))},xu:function(t,n){this.jn&&(this.Xu(t,n),this.Mu())},Mu:function(){var e=this;this.jn&&this.Vn(tb)&&this.be(function(t){var n;e.jn&&(n=e.jn.material,e.jn.material=t,n.map&&(n.map.dispose(),n.map=null),n.dispose())})},be:function(n){var e=this,t=this.Vn(ug),i={needSize:!0,opacity:this.mu.alpha*t.Eu};return this.mu.image&&(i.imageUrl=this.Eh+this.mu.image),this.W.Zt.xe.zs(this.Lh,this.mu,i,function(t){n&&n(t),e.jn&&e.Zi(e.W.Zt),void 0!==i.imageUrl&&e.W.Zt.er(),e.W.enableUpdateRender()})},Zi:function(t){var n;this.jn.material.userData.mspriteScale&&(n=t.Rh(this.mu.fontsize),t=2*this.mu.fontsize*1.2,t=this.jn.material.map.image.height/t,this.jn.material.userData.mspriteScale=Math.max(t,this.jn.material.userData.mspriteScale),this.jn.scale.set(n,n,n),this.jn.scale.multiplyScalar(this.jn.material.userData.mspriteScale),this.jn.scale.setX(this.jn.scale.x/this.jn.material.userData.scaleRatio))},Xu:function(t,n){var e=this.Vn(vr);this.mu=n.sa({fid:this.Ee.fid,typeID:this.Ee.type+"",bid:e.Yt}),this.Eh=t.Ku(this.mu,"path",e.buildingID);e=parseInt(this.mu.fontsize);isNaN(e)},yu:function(){var t=this.Vn(tb);t&&(this.jn&&t.Zt.er(),t.enableUpdateNode(),t.enableUpdateRender())},bu:function(){this.jn&&(this.jn.parent&&this.jn.parent.remove(this.jn),this.jn.geometry.dispose(),this.jn.geometry=void 0,this.jn.material=void 0,this.jn.mapNode=void 0,this.jn=void 0)},updateMaterialByThemeTool:function(t){this.mu=t;var n=this.Vn(ug).tt,t=n.tt.Zt;this.Eh=t.Ku(this.mu,"path",n.buildingID),this.Mu()}});var Cp=_r;function jp(t){return(jp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Pp(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var e=[],i=!0,r=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(i=(s=a.next()).done)&&(e.push(s.value),!n||e.length!==n);i=!0);}catch(t){r=!0,o=t}finally{try{i||null==a.return||a.return()}finally{if(r)throw o}}return e}}(t,n)||Dp(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Dp(t,n){if(t){if("string"==typeof t)return Ip(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(e="Object"===e&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Ip(t,n):void 0}}function Ip(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}function Np(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Fp(t,n){return(Fp=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Up(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Gp(e);return t=i?(t=Gp(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==jp(t)&&"function"!=typeof t?Bp(n):t}}function Bp(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Gp(t){return(Gp=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}Ru=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Fp(t,n)}(r,mv);var t,n,e,i=Up(r);function r(t,n){var e;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(e=i.call(this)).Un=Ii.LABEL_LAYER,e.Fi.userData.type="label",e.Fi.name="label",e.Fi.mapNode=Bp(e),e.Yn="label",e.Oh={},e.Ru(t,n),e.Qi=!0,e}return t=r,(n=[{key:"getFeatures",value:function(){return this.K}},{key:"type",get:function(){return this.Un}},{key:"level",get:function(){return this.tt.$n}},{key:"collision",get:function(){return this.Qi},set:function(t){this.Qi!==t&&(this.Qi=t,(t=this.Vn(tb))&&t.Zt.er())}}])&&Np(t.prototype,n),e&&Np(t,e),r}();Object.assign(Ru.prototype,{Ru:function(t,n){var e,i=function(t,n){var e;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(e=Dp(t))||n&&t&&"number"==typeof t.length){e&&(t=e);var i=0,n=function(){};return{s:n,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},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,o=!0,s=!1;return{s:function(){e=t[Symbol.iterator]()},n:function(){var t=e.next();return o=t.done,t},e:function(t){s=!0,r=t},f:function(){try{o||null==e.return||e.return()}finally{if(s)throw r}}}}(t.K);try{for(i.s();!(e=i.n()).done;){var r=Pp(e.value,2),o=(r[0],r[1]),s=new Cp(o,n.map);this.mn(s),s.visible=n.map.Zt.Ou(this.Un,{typeID:s.typeID,FID:s.FID})}}catch(t){i.e(t)}finally{i.f()}},mn:function(t){(t.tt=this).K.push(t)}});eh=Ru;function Hp(t){return(Hp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Vp(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function zp(t,n,e){return(zp="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,n,e){t=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=Zp(t)););return t}(t,n);if(t){n=Object.getOwnPropertyDescriptor(t,n);return n.get?n.get.call(e):n.value}})(t,n,e||t)}function Wp(t,n){return(Wp=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Xp(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Zp(e);return t=i?(t=Zp(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Hp(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function Zp(t){return(Zp=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}ch=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Wp(t,n)}(r,ar);var t,n,e,i=Xp(r);function r(t){var n;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(n=i.call(this)).Ee=t,n.Jt=t.height,n.Au=t.maxlevel,n.ku=t.minlevel,n.Un=Ii.FACILITY,n.Xi=0,n.Lt=new Map,n.mu=null,n}return t=r,(n=[{key:"bound",get:function(){return!0===this.needUpdateBound&&(this.Ee.Gn=null,this.Gn=this.Ee.getBound(),this.needUpdateBound=!1),this.Gn.clone()}},{key:"x",get:function(){return this.Ee.qr[0].x}},{key:"y",get:function(){return this.Ee.qr[0].y}},{key:"ID",get:function(){return this.Ee.Yt}},{key:"FID",get:function(){return this.Ee.fid}},{key:"typeID",get:function(){return this.Ee.type}},{key:"eName",get:function(){return this.Ee.Ah}},{key:"name",get:function(){return this.Ee.name}},{key:"level",get:function(){return this.tt.tt.$n}},{key:"height",get:function(){return this.Jt}},{key:"zoomRange",get:function(){return{maxLevel:this.Au,minLevel:this.ku}}},{key:"visible",get:function(){return this.Bn},set:function(t){this.Bn=t,this.yu()}},{key:"getData",value:function(){var t=this.Ee;return{ID:t.Yt,typeID:t.type,FID:t.fid,height:t.height,name:t.name,eName:t.ename,minLevel:t.minlevel,maxLevel:t.maxlevel}}},{key:"jump",value:function(t){var n=this,e=1,i=this.Vn(tb),r=t.times||void 0,o=t.delay||0,s=new Oi({src:[this.Jt],dest:[this.Jt+t.height]});t&&t.duration&&s.gt(t.duration),this.Lt.has("jump")&&((t=this.Lt.get("jump")).stop(),i.pn.vn(t)),i.pn.mn(s.bt(function(t){n.jn&&(n.jn.position.y=t.destination[0],i.enableUpdateRender())}).wt(function(){var t;Number.isFinite(r)&&r<e||(t=0<e%1?0:o,s.St().yt(t).dt(),e+=.5,i.enableUpdateRender())})),s.play(),this.Lt.set("jump",s)}},{key:"stopJump",value:function(){var t=this.Vn(tb),n=this.Lt.get("jump");n&&(t.pn.vn(n),this.jn&&(this.jn.position.y=this.Jt),t.enableUpdateRender())}},{key:"boost",value:function(t){var n=this,e=void 0!==(t=t||{}).duration?t.duration:1,i=void 0!==t.size?t.size:8,r=t.times||void 0,o=void 0!==t.delay?t.delay:0,s=1,a=this.Vn(tb);this.Lt.has("boost")&&((t=this.Lt.get("boost")).stop(),a.pn.vn(t));var u=new Oi({src:[this.Xi],dest:[i]});u.gt(e).dt().bt(function(t){n.jn&&a.cn.Wi(n.jn,t.destination[0]),a.enableUpdateRender()}).wt(function(){var t;r<s||(t=0<s%1?0:o,u.St().yt(t).dt(),a.enableUpdateRender(),s+=.5)}),a.pn.mn(u),this.Lt.set("boost",u)}},{key:"stopBoost",value:function(){var t=this.Vn(tb),n=this.Lt.get("boost");n&&(t.pn.vn(n),this.jn&&t.cn.Wi(this.jn,this.Xi),t.enableUpdateRender())}},{key:"getPosition",value:function(){return{x:this.Ee.qr[0].x,y:this.Ee.qr[0].y,z:this.Jt}}},{key:"getBound",value:function(){return{minX:this.bound.Pn.x,maxX:this.bound.Dn.x,minY:this.bound.Pn.y,maxY:this.bound.Dn.y}}},{key:"dispose",value:function(){this.bu(),this.W=null,zp(Zp(r.prototype),"dispose",this).call(this)}},{key:"getRenderNode",value:function(){return this.jn}},{key:"updateMaterialByThemeTool",value:function(t){this.mu=t,this.Xi=parseInt(this.mu.height),this.Mu(),this.jn.userData.size=this.Xi}}])&&Vp(t.prototype,n),e&&Vp(t,e),r}();Object.assign(ch.prototype,{za:function(){if(!this.jn){var t=this.Vn(tb),n=this.Vn(vr);this.mu=t.Zt._u.oa({fid:this.Ee.fid,typeID:""+this.Ee.type,bid:n.Yt}),this.Xi=parseInt(this.mu.height);n=this.be(t);n.userData.opacity=n.opacity,this.jn=new cp(n);n=this.Ee.qr[0],n=new St(n.x-t.N,-n.y+t.F,0).applyEuler(new _(Math.PI/2,0,0,"XYZ")).add(new St(0,this.Jt,0));return this.jn.position.copy(n),this.Zi(t.Zt),this.jn.userData.size=this.Xi,(this.jn.mapNode=this).tt.Fi.add(this.jn),!0}},xu:function(t,n){var e;this.jn&&(e=this.Vn(vr),this.mu=n.oa({fid:this.Ee.fid,typeID:""+this.Ee.type,bid:e.Yt}),this.Xi=parseInt(this.mu.height),this.Mu(),this.jn.userData.size=this.Xi)},Mu:function(){var t;!this.jn||(t=this.Vn(tb))&&(this.jn.material=this.be(t))},be:function(t){var n=this,e=this.Vn(ug),i=e.parent;return t.Zt.xe.Ws({opacity:e.Eu,needDepth:!1,url:t.Zt.Ku(this.mu,"path",i.buildingID)+this.mu.imageName},function(){n.Zi(t.Zt),t.Zt.er(),t.enableUpdateRender()})},Zi:function(t){var n;this.jn&&(n=t.Rh(this.Xi),t=1,this.jn.material.userData.scaleRatio&&(t=this.jn.material.userData.scaleRatio),this.jn.scale.set(n,n/t,n))},yu:function(){var t=this.Vn(tb);t&&(this.jn&&t.Zt.er(),t.enableUpdateNode(),t.enableUpdateRender())},bu:function(){this.jn&&(this.jn.parent&&this.jn.parent.remove(this.jn),this.jn.geometry.dispose(),this.jn.geometry=void 0,this.jn.material=void 0,this.jn.mapNode=void 0,this.jn=void 0)}});var Yp=ch;function qp(t){return(qp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Kp(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var e=[],i=!0,r=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(i=(s=a.next()).done)&&(e.push(s.value),!n||e.length!==n);i=!0);}catch(t){r=!0,o=t}finally{try{i||null==a.return||a.return()}finally{if(r)throw o}}return e}}(t,n)||Jp(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Jp(t,n){if(t){if("string"==typeof t)return Qp(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(e="Object"===e&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Qp(t,n):void 0}}function Qp(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}function $p(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function tm(t,n){return(tm=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function nm(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=im(e);return t=i?(t=im(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==qp(t)&&"function"!=typeof t?em(n):t}}function em(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function im(t){return(im=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}Ri=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&tm(t,n)}(r,mv);var t,n,e,i=nm(r);function r(t,n){var e;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(e=i.call(this)).Un=Ii.FACILITY_LAYER,e.Fi.userData.type="facility",e.Fi.name="facility",e.Yn="facility",e.kh={},e.Qi=!0,e.Fi.mapNode=em(e),e.Ru(t,n),e}return t=r,(n=[{key:"level",get:function(){return this.tt.$n}},{key:"collision",get:function(){return this.Qi},set:function(t){this.Qi!==t&&(this.Qi=t,(t=this.Vn(tb))&&t.Zt.er())}},{key:"getFeatures",value:function(){return this.K}}])&&$p(t.prototype,n),e&&$p(t,e),r}();Object.assign(Ri.prototype,{Ru:function(t,n){var e,i=function(t,n){var e;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(e=Jp(t))||n&&t&&"number"==typeof t.length){e&&(t=e);var i=0,n=function(){};return{s:n,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},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,o=!0,s=!1;return{s:function(){e=t[Symbol.iterator]()},n:function(){var t=e.next();return o=t.done,t},e:function(t){s=!0,r=t},f:function(){try{o||null==e.return||e.return()}finally{if(s)throw r}}}}(t.K);try{for(i.s();!(e=i.n()).done;){var r=Kp(e.value,2),o=(r[0],r[1]),s=new Yp(o);this.mn(s),s.visible=n.map.Zt.Ou(this.Un,{typeID:s.typeID,FID:s.FID})}}catch(t){i.e(t)}finally{i.f()}},mn:function(t){(t.tt=this).K.push(t)}});var Di=Ri,rm=new tt;function om(t,n){this.object=t,void 0===n&&(n=16776960);var e=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]),i=new Float32Array(24),t=new eo;t.setIndex(new Nr(e,1)),t.setAttribute("position",new Nr(i,3)),vl.call(this,t,new xc({color:n,toneMapped:!1})),this.matrixAutoUpdate=!1,this.update()}function sm(t,n,e){this.Ch=t,this.jh=n,this.Ph=e||null;for(var i=n.tracks,r=i.length,o=new Array(r),s={endingStart:Xe,endingEnd:Xe},a=0;a!==r;++a){var u=i[a].createInterpolant(null);(o[a]=u).settings=s}this.Dh=s,this.Ih=o,this.Nh=new Array(r),this.Fh=null,this.Uh=null,this.Bh=null,this.Gh=null,this.loop=2201,this.Hh=-1,this.Vh=null,this.time=0,this.timeScale=1,this.zh=1,this.weight=1,this.Wh=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}function am(t,n,e){this.binding=t,this.valueSize=e;var i,r=Float64Array;switch(n){case"quaternion":i=this.Xh;break;case"string":case"bool":r=Array,i=this.Zh;break;default:i=this.Yh}this.buffer=new r(4*e),this.qh=i,this.cumulativeWeight=0,this.useCount=0,this.referenceCount=0}function um(t){this.fr=t,this.Kh(),this.Jh=0,this.time=0,this.timeScale=1}((om.prototype=Object.create(vl.prototype)).constructor=om).prototype.update=function(t){var n,e,i;void 0!==t&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&rm.setFromObject(this.object),rm.isEmpty()||(n=rm.min,e=rm.max,(t=(i=this.geometry.attributes.position).array)[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=n.x,t[4]=e.y,t[5]=e.z,t[6]=n.x,t[7]=n.y,t[8]=e.z,t[9]=e.x,t[10]=n.y,t[11]=e.z,t[12]=e.x,t[13]=e.y,t[14]=n.z,t[15]=n.x,t[16]=e.y,t[17]=n.z,t[18]=n.x,t[19]=n.y,t[20]=n.z,t[21]=e.x,t[22]=n.y,t[23]=n.z,i.needsUpdate=!0,this.geometry.computeBoundingSphere())},om.prototype.setFromObject=function(t){return this.object=t,this.update(),this},om.prototype.copy=function(t){return vl.prototype.copy.call(this,t),this.object=t.object,this},om.prototype.clone=function(){return(new this.constructor).copy(this)},Object.assign(sm.prototype,{play:function(){return this.Ch.Qh(this),this},stop:function(){return this.Ch.$h(this),this.reset()},reset:function(){return this.paused=!1,this.enabled=!0,this.time=0,this.Hh=-1,this.Vh=null,this.stopFading().stopWarping()},isRunning:function(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this.Vh&&this.Ch.tc(this)},isScheduled:function(){return this.Ch.tc(this)},startAt:function(t){return this.Vh=t,this},setLoop:function(t,n){return this.loop=t,this.repetitions=n,this},setEffectiveWeight:function(t){return this.weight=t,this.Wh=this.enabled?t:0,this.stopFading()},getEffectiveWeight:function(){return this.Wh},fadeIn:function(t){return this.nc(t,0,1)},fadeOut:function(t){return this.nc(t,1,0)},crossFadeFrom:function(t,n,e){var i,r;return t.fadeOut(n),this.fadeIn(n),e&&(e=(i=this.jh.duration)/(r=t.jh.duration),t.warp(1,r/i,n),this.warp(e,1,n)),this},crossFadeTo:function(t,n,e){return t.crossFadeFrom(this,n,e)},stopFading:function(){var t=this.Gh;return null!==t&&(this.Gh=null,this.Ch.ec(t)),this},setEffectiveTimeScale:function(t){return this.timeScale=t,this.zh=this.paused?0:t,this.stopWarping()},getEffectiveTimeScale:function(){return this.zh},setDuration:function(t){return this.timeScale=this.jh.duration/t,this.stopWarping()},syncWith:function(t){return this.time=t.time,this.timeScale=t.timeScale,this.stopWarping()},halt:function(t){return this.warp(this.zh,0,t)},warp:function(t,n,e){var i=this.Ch,r=i.time,o=this.Bh,s=this.timeScale;null===o&&(o=i.ic(),this.Bh=o);i=o.parameterPositions,o=o.sampleValues;return i[0]=r,i[1]=r+e,o[0]=t/s,o[1]=n/s,this},stopWarping:function(){var t=this.Bh;return null!==t&&(this.Bh=null,this.Ch.ec(t)),this},getMixer:function(){return this.Ch},getClip:function(){return this.jh},getRoot:function(){return this.Ph||this.Ch.fr},ct:function(t,n,e,i){if(this.enabled){var r=this.Vh;if(null!==r){r=(t-r)*e;if(r<0||0===e)return;this.Vh=null,n=e*r}n*=this.rc(t);var o=this.oc(n),s=this.sc(t);if(0<s)for(var a=this.Ih,u=this.Nh,h=0,c=a.length;h!==c;++h)a[h].evaluate(o),u[h].accumulate(i,s)}else this.sc(t)},sc:function(t){var n,e,i=0;return this.enabled&&(i=this.weight,null!==(n=this.Gh)&&(i*=e=n.evaluate(t)[0],t>n.parameterPositions[1]&&(this.stopFading(),0===e&&(this.enabled=!1)))),this.Wh=i},rc:function(t){var n,e=0;return this.paused||(e=this.timeScale,null!==(n=this.Bh)&&(e*=n.evaluate(t)[0],t>n.parameterPositions[1]&&(this.stopWarping(),0===e?this.paused=!0:this.timeScale=e))),this.zh=e},oc:function(t){var n,e=this.time+t,i=this.jh.duration,r=this.loop,o=this.Hh,s=2202===r;if(0===t)return-1!==o&&s&&1==(1&o)?i-e:e;if(2200===r){-1===o&&(this.Hh=0,this.ac(!0,!0,!1));t:{if(i<=e)e=i;else{if(!(e<0)){this.time=e;break t}e=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=e,this.Ch.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else if(-1===o&&(0<=t?this.ac(!(o=0),0===this.repetitions,s):this.ac(0===this.repetitions,!0,s)),i<=e||e<0?(e-=i*(n=Math.floor(e/i)),o+=Math.abs(n),(r=this.repetitions-o)<=0?(this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=e=0<t?i:0,this.Ch.dispatchEvent({type:"finished",action:this,direction:0<t?1:-1})):(1==r?this.ac(r=t<0,!r,s):this.ac(!1,!1,s),this.Hh=o,this.time=e,this.Ch.dispatchEvent({type:"loop",action:this,loopDelta:n}))):this.time=e,s&&1==(1&o))return i-e;return e},ac:function(t,n,e){var i=this.Dh;e?(i.endingStart=Ze,i.endingEnd=Ze):(i.endingStart=t?this.zeroSlopeAtStart?Ze:Xe:2402,i.endingEnd=n?this.zeroSlopeAtEnd?Ze:Xe:2402)},nc:function(t,n,e){var i=this.Ch,r=i.time,o=this.Gh;null===o&&(o=i.ic(),this.Gh=o);i=o.parameterPositions,o=o.sampleValues;return i[0]=r,o[0]=n,i[1]=r+t,o[1]=e,this}}),Object.assign(am.prototype,{accumulate:function(t,n){var e=this.buffer,i=this.valueSize,r=t*i+i,t=this.cumulativeWeight;if(0===t){for(var o=0;o!==i;++o)e[r+o]=e[o];t=n}else this.qh(e,r,0,n/(t+=n),i);this.cumulativeWeight=t},apply:function(t){var n=this.valueSize,e=this.buffer,i=t*n+n,t=this.cumulativeWeight,r=this.binding;this.cumulativeWeight=0,t<1&&this.qh(e,i,3*n,1-t,n);for(var o=n,s=n+n;o!==s;++o)if(e[o]!==e[o+n]){r.setValue(e,i);break}},saveOriginalState:function(){var t=this.binding,n=this.buffer,e=this.valueSize,i=3*e;t.getValue(n,i);for(var r=e,o=i;r!==o;++r)n[r]=n[i+r%e];this.cumulativeWeight=0},restoreOriginalState:function(){var t=3*this.valueSize;this.binding.setValue(this.buffer,t)},Zh:function(t,n,e,i,r){if(.5<=i)for(var o=0;o!==r;++o)t[n+o]=t[e+o]},Xh:function(t,n,e,i){st.slerpFlat(t,n,t,n,t,e,i)},Yh:function(t,n,e,i,r){for(var o=1-i,s=0;s!==r;++s){var a=n+s;t[a]=t[a]*o+t[e+s]*i}}}),um.prototype=Object.assign(Object.create(y.prototype),{constructor:um,uc:function(t,n){var e=t.Ph||this.fr,i=t.jh.tracks,r=i.length,o=t.Nh,s=t.Ih,a=e.uuid,t=this.hc,u=t[a];void 0===u&&(t[a]=u={});for(var h=0;h!==r;++h){var c=i[h],f=c.name;if(void 0!==(l=u[f]))o[h]=l;else{if(void 0!==(l=o[h])){null===l.Fh&&(++l.referenceCount,this.cc(l,a,f));continue}var l,d=n&&n.Nh[h].binding.parsedPath;++(l=new am(Ll.create(e,f,d),c.ValueTypeName,c.getValueSize())).referenceCount,this.cc(l,a,f),o[h]=l}s[h].resultBuffer=l.buffer}},Qh:function(t){if(!this.tc(t)){var n,e,i;null===t.Fh&&(n=(t.Ph||this.fr).uuid,e=t.jh.uuid,i=this.fc[e],this.uc(t,i&&i.knownActions[0]),this.lc(t,e,n));for(var r=t.Nh,o=0,s=r.length;o!==s;++o){var a=r[o];0==a.useCount++&&(this.dc(a),a.saveOriginalState())}this.vc(t)}},$h:function(t){if(this.tc(t)){for(var n=t.Nh,e=0,i=n.length;e!==i;++e){var r=n[e];0==--r.useCount&&(r.restoreOriginalState(),this.pc(r))}this.mc(t)}},Kh:function(){this.gc=[],this.yc=0,this.fc={},this.Ra=[],this.bc=0,this.hc={},this.wc=[],this._c=0;var t=this;this.stats={actions:{get total(){return t.gc.length},get inUse(){return t.yc}},bindings:{get total(){return t.Ra.length},get inUse(){return t.bc}},controlInterpolants:{get total(){return t.wc.length},get inUse(){return t._c}}}},tc:function(t){t=t.Fh;return null!==t&&t<this.yc},lc:function(t,n,e){var i=this.gc,r=this.fc,o=r[n];void 0===o?(o={knownActions:[t],actionByRoot:{}},t.Uh=0,r[n]=o):(n=o.knownActions,t.Uh=n.length,n.push(t)),t.Fh=i.length,i.push(t),o.actionByRoot[e]=t},xc:function(t){var n=this.gc,e=n[n.length-1],i=t.Fh;n[e.Fh=i]=e,n.pop(),t.Fh=null;var r=t.jh.uuid,o=this.fc,s=o[r],i=s.knownActions,e=i[i.length-1],n=t.Uh;i[e.Uh=n]=e,i.pop(),t.Uh=null,delete s.actionByRoot[(t.Ph||this.fr).uuid],0===i.length&&delete o[r],this.Mc(t)},Mc:function(t){for(var n=t.Nh,e=0,i=n.length;e!==i;++e){var r=n[e];0==--r.referenceCount&&this.Sc(r)}},vc:function(t){var n=this.gc,e=t.Fh,i=this.yc++,r=n[i];n[t.Fh=i]=t,n[r.Fh=e]=r},mc:function(t){var n=this.gc,e=t.Fh,i=--this.yc,r=n[i];n[t.Fh=i]=t,n[r.Fh=e]=r},cc:function(t,n,e){var i=this.hc,r=i[n],o=this.Ra;void 0===r&&(i[n]=r={}),(r[e]=t).Fh=o.length,o.push(t)},Sc:function(t){var n=this.Ra,e=t.binding,i=e.rootNode.uuid,r=e.path,o=this.hc,s=o[i],e=n[n.length-1],t=t.Fh;n[e.Fh=t]=e,n.pop(),delete s[r],0===Object.keys(s).length&&delete o[i]},dc:function(t){var n=this.Ra,e=t.Fh,i=this.bc++,r=n[i];n[t.Fh=i]=t,n[r.Fh=e]=r},pc:function(t){var n=this.Ra,e=t.Fh,i=--this.bc,r=n[i];n[t.Fh=i]=t,n[r.Fh=e]=r},ic:function(){var t=this.wc,n=this._c++,e=t[n];return void 0===e&&(t[(e=new Nf(new Float32Array(2),new Float32Array(2),1,this.Tc)).Ec=n]=e),e},ec:function(t){var n=this.wc,e=t.Ec,i=--this._c,r=n[i];n[t.Ec=i]=t,n[r.Ec=e]=r},Tc:new Float32Array(1),clipAction:function(t,n){var e=n||this.fr,i=e.uuid,r="string"==typeof t?Zf.findByName(e,t):t,o=null!==r?r.uuid:t,s=this.fc[o],e=null;if(void 0!==s){t=s.actionByRoot[i];if(void 0!==t)return t;e=s.knownActions[0],null===r&&(r=e.jh)}if(null===r)return null;n=new sm(this,r,n);return this.uc(n,e),this.lc(n,o,i),n},existingAction:function(t,n){var e=n||this.fr,n=e.uuid,e="string"==typeof t?Zf.findByName(e,t):t,t=e?e.uuid:t,t=this.fc[t];return void 0!==t&&t.actionByRoot[n]||null},stopAllAction:function(){var t=this.gc,n=this.yc,e=this.Ra,i=this.bc;this.yc=0;for(var r=this.bc=0;r!==n;++r)t[r].reset();for(r=0;r!==i;++r)e[r].useCount=0;return this},update:function(t){t*=this.timeScale;for(var n=this.gc,e=this.yc,i=this.time+=t,r=Math.sign(t),o=this.Jh^=1,s=0;s!==e;++s)n[s].ct(i,t,r,o);for(var a=this.Ra,u=this.bc,s=0;s!==u;++s)a[s].apply(o);return this},setTime:function(t){for(var n=this.time=0;n<this.gc.length;n++)this.gc[n].time=0;return this.update(t)},getRoot:function(){return this.fr},uncacheClip:function(t){var n=this.gc,e=t.uuid,i=this.fc,t=i[e];if(void 0!==t){for(var r=t.knownActions,o=0,s=r.length;o!==s;++o){var a=r[o];this.$h(a);var u=a.Fh,h=n[n.length-1];a.Fh=null,a.Uh=null,n[h.Fh=u]=h,n.pop(),this.Mc(a)}delete i[e]}},uncacheRoot:function(t){var n,e=t.uuid,i=this.fc;for(n in i){var r=i[n].actionByRoot[e];void 0!==r&&(this.$h(r),this.xc(r))}var o=this.hc[e];if(void 0!==o)for(var s in o){s=o[s];s.restoreOriginalState(),this.Sc(s)}},uncacheAction:function(t,n){n=this.existingAction(t,n);null!==n&&(this.$h(n),this.xc(n))}});var dr=e(28),hm=e.n(dr);function cm(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}_r=function(){function n(t){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,n),this.ur=t,this.W=this.ur.map,this.Lc={},this.gu=null,this.Rc={},this.Oc=0,this.Jt=512,this.Ac=512,this.kc=!1,this.et=null,this.ct=this.ct.bind(this)}var t,e,i;return t=n,(e=[{key:"isAdded",get:function(){return this.kc}},{key:"add",value:function(t){var n=this;null===this.gu&&(this.gu=t),this.Cc(function(t){n.jc(t)})}},{key:"dispose",value:function(t){this.W.off("update",this.ct),t&&t()}},{key:"stop",value:function(){this.W.off("update",this.ct)}}])&&cm(t.prototype,e),i&&cm(t,i),n}();Object.assign(_r.prototype,{Cc:function(n){var t=this.ur.externalModel.getRenderNode();this.ur.externalModel.Pc?t.traverse(function(t){"Mesh"===t.type&&n(t)}):n(t)},jc:function(i){var e=this,r=this,o=0,s=null;Array.isArray(i.material)?(this.Lc[i.name]=[],function e(){o<i.material.length?r.Mu(i.material[o],function(t,n){r.Lc[i.name].push(i.material[o].clone()),n&&(i.material[o].dispose(),i.material[o]=t),o++,s=setTimeout(e,0)}):(null!==s&&clearTimeout(s),r.et=(new Date).getTime(),r.W.on("update",r.ct))}()):this.Mu(i.material,function(t,n){e.Lc[i.name]=i.material.clone(),n&&(i.material.dispose(),i.material=t),e.et=(new Date).getTime(),e.W.on("update",r.ct)})},Mu:function(t,n){var e,i=null;t&&(this.ur.externalModel.Pc?t.uniforms&&t.uniforms.map&&t.uniforms.map.value?i=t.uniforms.map.value.name:t.map&&(i=""+t.map.name):t.map&&(i=""+t.map.name).indexOf(".gif")<0&&(i=t.name)),(null===i||!this.ur.parent.Dc||!this.ur.parent.Dc[i])&&null!==i&&0<=i.indexOf(".gif")?(t=(e=i.split("."))[0]+"."+e[1],(e=this.Rc[t])?e.canvasArray&&0<e.canvasArray.length&&(e=new Vu(e.canvasArray[e.canvascount]),this.ur.externalModel.Pc&&(e.flipY=!1),e.repeat.set(1,1),e.name=i,e.magFilter=An,e.minFilter=1008,(e=new Co({map:e})).isBasic=!0,e.gifname=t,n(e,!0)):this.Ic(this.gu+t,t,function(t){n(t,!0)})):n(null,!1)},Ic:function(t,e,i){var r=this,o=document.createElement("div");o.style.display="none",document.body.appendChild(o);var s=new Image;s.crossOrigin="Anonymous",s.onload=function(){var t;i&&((t=document.createElement("canvas")).width=r.Ac,t.height=r.Jt,t.getContext("2d").drawImage(s,0,0,r.Ac,r.Jt),t=new Vu(t),r.ur.externalModel.Pc&&(t.flipY=!1),t.repeat.set(1,1),t.magFilter=An,t.minFilter=1008,(t=new Co({map:t})).transparent=!0,t.isBasic=!0,t.gifname=e,i(t)),r.Rc[e]={canvascount:0,canvasArray:[]},o.appendChild(s);var n=new hm.a({gif:s});n.load(function(){r.Nc(n,e,o)})},s.src=t},Nc:function(e,i,r){var o=this,s=null,a=e.get_length(),u=1;this.Rc[i].canvascount=0,function t(){{var n;a<u?(document.body.removeChild(r),null!==s&&clearTimeout(s)):(e.move_to(u),(n=document.createElement("canvas")).width=o.Ac,n.height=o.Jt,n.getContext("2d").drawImage(e.get_canvas(),0,0,o.Ac,o.Jt),o.Rc[i].canvasArray.push(n),u++,s=setTimeout(t,0))}}()},Fc:function(t,n){t=t.split("."),t=t[0]+"."+t[1];this.Rc[t]&&(this.Rc[t].canvasArray.length=0,this.Rc[t].canvascount=0),this.Ic(n,t),this.ct(),this.kc||(this.kc=!0,this.W.on("update",this.ct))},Uo:function(t){var n=t.split("."),n=n[0]+"."+n[1];this.Fc(t,this.gu+n)},ct:function(){var r=this,t=(new Date).getTime(),o=t-this.et;50<=o&&(this.et=t),this.ur.externalModel.getRenderNode()&&(this.Cc(function(i){var t;if(Array.isArray(i.material))for(var n=i.material,e=0;e<n.length;e++)!function(e){var t;!n[e].isBasic||i.material[e].isupdate?r.Mu(r.Lc[i.name][e],function(t,n){n&&(i.material[e].dispose(),i.material[e]=t)}):((t=r.Rc[n[e].gifname])&&t.canvasArray[t.canvascount]&&(i.material.isupdate?r.Mu(r.Lc[i.name][e],function(t,n){n&&(i.material[e].dispose(),i.material[e]=t)}):(i.material[e].map.image=t.canvasArray[t.canvascount],i.material[e].map.needsUpdate=!0)),50<=o&&t&&(t.canvascount<t.canvasArray.length-1?t.canvascount++:t.canvascount=0))}(e);else i.material.isBasic&&!i.material.isupdate?((t=r.Rc[i.material.gifname])&&t.canvasArray[t.canvascount]&&(i.material.isupdate?r.Mu(r.Lc[i.name],function(t,n){n&&(i.material.dispose(),i.material=t)}):(i.material.map.image=t.canvasArray[t.canvascount],i.material.map.needsUpdate=!0)),50<=o&&t&&(t.canvascount<t.canvasArray.length-1?t.canvascount++:t.canvascount=0)):r.Mu(r.Lc[i.name],function(t,n){n&&(i.material.dispose(),i.material=t)})}),this.W.enableUpdateRender())}});var fm=_r;function lm(t,n,e,i,r,o,s,a,u){Sr.call(this,t,n,e,i,r,o,s,a,u),this.format=void 0!==s?s:Xn,this.minFilter=void 0!==o?o:An,this.magFilter=void 0!==r?r:An,this.generateMipmaps=!1}function dm(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}lm.prototype=Object.assign(Object.create(Sr.prototype),{constructor:lm,isVideoTexture:!0,update:function(){var t=this.image;t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}});Ru=function(){function n(t){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,n),this.ur=t,this.Uc=t.externalModel,this.W=this.ur.map,this.Bc=[],this.Gc=null,this.Hc={},this.Vc=null,this.kc=!1,this.oldmaterial={},this.gu=null,this.zc={},this.ct=this.ct.bind(this)}var t,e,i;return t=n,(e=[{key:"isAdded",get:function(){return this.kc}},{key:"add",value:function(t){var n=this;null===this.gu&&(this.gu=t),this.Cc(function(t){n.jc(t)}),this.W.on("update",this.ct)}},{key:"dispose",value:function(){for(var t=0;t<this.Bc.length;t++){var n=this.Bc[t];null!==document.getElementById(n)&&document.getElementById(n).parentNode.removeChild(document.getElementById(n))}this.W.off("update",this.ct)}},{key:"stop",value:function(){this.W.off("update",this.ct)}}])&&dm(t.prototype,e),i&&dm(t,i),n}();Object.assign(Ru.prototype,{Cc:function(n){var t=this.ur.externalModel.getRenderNode();this.Uc.Pc?t.traverse(function(t){"Mesh"===t.type&&n(t)}):n(t)},jc:function(i){var e=this,r=this,o=i.material,s=0,a=null;Array.isArray(o)?(this.oldmaterial[i.name]=[],function e(){s<o.length?r.Mu(o[s],function(t,n){r.oldmaterial[i.name].push(o[s].clone()),n&&(i.material[s].dispose(),i.material[s]=t),s++,a=setTimeout(e,0)}):null!==a&&clearTimeout(a)}()):this.Mu(o,function(t,n){e.oldmaterial[i.name]=o.clone(),n&&(i.material.dispose(),i.material=t)})},Mu:function(t,n){var e,i=this,r=null;t&&(this.Uc.Pc?t.uniforms&&t.uniforms.map&&t.uniforms.map.value?r=t.uniforms.map.value.name:t.map&&(r=""+t.map.name):t.map&&(r=""+t.map.name).indexOf(".mp4")<0&&r.indexOf(".webm")<0&&r.indexOf(".ogg")<0&&(r=t.name)),(null===r||!this.ur.parent.Dc||!this.ur.parent.Dc[r])&&null!==r&&(0<=r.indexOf(".mp4")||0<=r.indexOf(".webm")||0<=r.indexOf(".ogg"))?(e=r.split("."),(t=(t=this.zc[r])||this.Hc[e[0]+"."+e[1]])?((t=new Co({map:t.clone()})).isBasic=!0,n&&n(t,!0)):this.Wc(this.gu+e[0]+"."+e[1],function(t){t.name=r;t=new Co({map:(i.Hc[e[0]+"."+e[1]]=t).clone()});t.isBasic=!0,n(t,!0)})):n(null,!1)},Wc:function(t,i){var r=this;this.Vc=t;var n=null,e=document.createElement("div");e.style.display="none";var o="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var n=16*Math.random()|0;return("x"==t?n:3&n|8).toString(16)});this.Gc=o+"_div",this.Bc.push(this.Gc),e.setAttribute("id",this.Gc),e.innerHTML='<video id="'+o+'" loop crossOrigin="anonymous" muted><source src="'+t+'"></video>',document.body.appendChild(e),function t(){var e=document.getElementById(o);e?(null!==n&&clearTimeout(n),e.addEventListener("loadeddata",function(t){var n=new lm(e);n.video_id=o+"_div",r.Uc.Pc&&(n.flipY=!1),i&&i(n),e.play()})):n=setTimeout(t,0)}()},Uo:function(i){var t,r=this;this.zc[i]&&(t=this.zc[i].video_id,null!==document.getElementById(t)&&document.getElementById(t).parentNode.removeChild(document.getElementById(t)),this.zc[i].dispose(),this.zc[i]=void 0,this.ur.externalModel.getRenderNode()&&this.Cc(function(e){var t=e.material;if(Array.isArray(t))for(var n=0;n<t.length;n++)!function(n){r.Mu(r.oldmaterial[e.name][n],function(t){t&&t.map&&t.map.name===i&&(e.material[n].dispose(),e.material[n]=t)})}(n);else r.Mu(r.oldmaterial[e.name],function(t){t&&t.map&&t.map.name===i&&(e.material.dispose(),e.material=t)})}))},Fc:function(i,t){var r=this;this.Wc(t,function(t){r.zc[i]&&r.Uo(i),t.name=i,r.zc[i]=t,r.ur.externalModel.getRenderNode()&&r.Cc(function(e){var t=e.material;if(Array.isArray(t))for(var n=0;n<t.length;n++)!function(n){r.Mu(r.oldmaterial[e.name][n],function(t){t&&t.map&&t.map.name===i&&(e.material[n].dispose(),e.material[n]=t)})}(n);else r.Mu(r.oldmaterial[e.name],function(t){t&&t.map&&t.map.name===i&&(e.material.dispose(),e.material=t)})})}),this.kc||(this.kc=!0,this.W.on("update",this.ct))},ct:function(){var i=this;this.ur.externalModel.getRenderNode()&&(this.Cc(function(e){var t=e.material;if(Array.isArray(t))for(var n=0;n<t.length;n++)!function(n){t[n].isBasic?t[n].isupdate&&i.Mu(i.oldmaterial[e.name][n],function(t){t&&(e.material[n].dispose(),e.material[n]=t)}):i.Mu(i.oldmaterial[e.name][n],function(t){t&&(e.material[n].dispose(),e.material[n]=t)})}(n);else t.isBasic?t.isupdate&&i.Mu(i.oldmaterial[e.name],function(t){t&&(e.material.dispose(),e.material=t)}):i.Mu(i.oldmaterial[e.name],function(t){t&&(e.material.dispose(),e.material=t)})}),this.W.enableUpdateRender())}});var vm=Ru;function pm(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}ch=function(){function n(t){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,n),this.W=t.parent.parent.parent.parent,this.Uc=t,this.ct=this.ct.bind(this),this.Un="no",this.Xc=new fm({map:this.W,externalModel:t,parent:this}),this.Zc=new vm({map:this.W,externalModel:t,parent:this}),this.Dc=null,this.Yc=[],this.qc={},this.W.on("update",this.ct)}var t,e,i;return t=n,(e=[{key:"gifTool",get:function(){return this.Xc}},{key:"videoTool",get:function(){return this.Zc}},{key:"isGltf",get:function(){return this.Uc.Pc}},{key:"textureNames",get:function(){return this.Yc}},{key:"oldMaterial",get:function(){return this.qc}},{key:"replace",value:function(t,n){null===this.Dc&&(this.Dc={}),this.Dc[t]=!0}},{key:"reset",value:function(t){this.Dc[t]=!1}},{key:"dispose",value:function(){this.Xc.kc&&this.Xc.dispose(),this.Zc.kc&&this.Zc.dispose()}}])&&pm(t.prototype,e),i&&pm(t,i),n}();Object.assign(ch.prototype,{ct:function(){var n,e=this,t=this.Uc.getRenderNode();t&&(this.W.off("update",this.ct),this.W.getMapOptions(),n=this.Uc.Kc,this.Uc.Pc?t.traverse(function(t){"Mesh"===t.type&&((t=e.Jc(t)).needgif&&!e.Xc.kc&&(e.Xc.add(n),e.Xc.kc=!0),t.needvideo&&!e.Zc.kc&&(e.Zc.add(n),e.Zc.kc=!0))}):((t=this.Jc(t)).needgif&&!this.Xc.kc&&(this.Xc.add(n),this.Xc.kc=!0),t.needvideo&&!this.Zc.kc&&(this.Zc.add(n),this.Zc.kc=!0)))},Jc:function(t){var n,e,i={needgif:!1,needvideo:!1},r=!1,o=!1,s=t.material;if(Array.isArray(s)){this.qc[t.name]=[];for(var a,u,h=0;h<s.length;h++)this.qc[t.name].push(s[h].clone()),this.Uc.Pc?(u="",s[h].uniforms&&s[h].uniforms.map&&s[h].uniforms.map.value?u=s[h].uniforms.map.value.name:s[h].map&&(u=s[h].map.name),0<=u.indexOf(".gif")?(r=!0,this.Yc.push(u)):(0<=u.indexOf(".mp4")||0<=u.indexOf(".webm")||0<=u.indexOf(".ogg"))&&(o=!0,this.Yc.push(u))):(a="",s[h].map&&(a=""+s[h].map.name),u=""+s[h].name,0<=a.indexOf(".gif")||0<=u.indexOf(".gif")?(r=!0,0<=a.indexOf(".gif")?this.Yc.push(a):this.Yc.push(u)):(0<=a.indexOf(".mp4")||0<=a.indexOf(".webm")||0<=a.indexOf(".ogg")||0<=u.indexOf(".mp4")||0<=u.indexOf(".webm")||0<=u.indexOf(".ogg"))&&(o=!0,0<=a.indexOf(".mp4")||0<=a.indexOf(".webm")||0<=a.indexOf(".ogg")?this.Yc.push(a):this.Yc.push(u)))}else this.qc[t.name]=s.clone(),this.Uc.Pc?(e="",s.uniforms&&s.uniforms.map&&s.uniforms.map.value?e=s.uniforms.map.value.name:s.map&&(e=s.map.name),0<=e.indexOf(".gif")?(r=!0,this.Yc.push(e)):(0<=e.indexOf(".mp4")||0<=e.indexOf(".webm")||0<=e.indexOf(".ogg"))&&(o=!0,this.Yc.push(e))):(n="",s.map&&(n=""+s.map.name),e=""+s.name,0<=n.indexOf(".gif")||0<=e.indexOf(".gif")?(r=!0,0<=n.indexOf(".gif")?this.Yc.push(n):this.Yc.push(e)):(0<=n.indexOf(".mp4")||0<=n.indexOf(".webm")||0<=n.indexOf(".ogg")||0<=e.indexOf(".mp4")||0<=e.indexOf(".webm")||0<=e.indexOf(".ogg"))&&(o=!0,0<=n.indexOf(".mp4")||0<=n.indexOf(".webm")||0<=n.indexOf(".ogg")?this.Yc.push(n):this.Yc.push(e)));return i.needgif=r,i.needvideo=o,i}});var mm=ch;function gm(t){return(gm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ym(t,n){var e;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(e=function(t,n){if(t){if("string"==typeof t)return bm(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(e="Object"===e&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?bm(t,n):void 0}}(t))||n&&t&&"number"==typeof t.length){e&&(t=e);var i=0,n=function(){};return{s:n,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},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,o=!0,s=!1;return{s:function(){e=t[Symbol.iterator]()},n:function(){var t=e.next();return o=t.done,t},e:function(t){s=!0,r=t},f:function(){try{o||null==e.return||e.return()}finally{if(s)throw r}}}}function bm(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}function wm(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function _m(t,n,e){return(_m="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,n,e){t=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=Em(t)););return t}(t,n);if(t){n=Object.getOwnPropertyDescriptor(t,n);return n.get?n.get.call(e):n.value}})(t,n,e||t)}function xm(t,n){return(xm=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Mm(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Em(e);return t=i?(t=Em(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==gm(t)&&"function"!=typeof t?Sm(n):t}}function Sm(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Em(t){return(Em=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}Ri=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&xm(t,n)}(r,ar);var t,n,e,i=Mm(r);function r(t){var n;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(n=i.call(this)).Ee=t,n.Un=Ii.EXTERNAL_MODEL,n.mu=null,n.jn=null,n.Qc=null,n.Du=null,n.ye=null,n.Pc=null,n.Ch=null,n.gc=[],n.Wu=null,n.$c=n.$c.bind(Sm(n)),n.tf=new Oi,n.nf=!0,n.ef=null,n.Kc=null,n.if=!1,n}return t=r,(n=[{key:"multiMediaTool",get:function(){return this.ef}},{key:"fading",get:function(){return!this.tf.ht}},{key:"bound",get:function(){return!0===this.needUpdateBound&&(this.Ee.Gn=null,this.Gn=this.Ee.getBound(),this.needUpdateBound=!1),this.Gn.clone()}},{key:"x",get:function(){return this.Ee.qr[0].x}},{key:"y",get:function(){return this.Ee.qr[0].y}},{key:"ID",get:function(){return this.Ee.Yt}},{key:"FID",get:function(){return this.Ee.fid}},{key:"typeID",get:function(){return this.Ee.type}},{key:"name",get:function(){return this.Ee.name}},{key:"eName",get:function(){return this.Ee.ename}},{key:"level",get:function(){return this.tt.tt.$n}},{key:"height",get:function(){return this.Ee.height}},{key:"zoomRange",get:function(){return{maxLevel:this.Ee.maxlevel,minLevel:this.Ee.minlevel}}},{key:"visible",get:function(){return this.Bn},set:function(t){this.Bn=t,this.yu()}},{key:"color",get:function(){return this.Du},set:function(t){this.Du=t,this.Mu()}},{key:"canDispose",get:function(){return this.rf}},{key:"show",get:function(){return this.fh},set:function(t){t?this.Wu&&!this.Wu.show||this.sf():this.af()}},{key:"isGltf",get:function(){return this.Pc}},{key:"beforRemove",value:function(){var t,n=null===(t=this.parent)||void 0===t||null===(n=t.parent)||void 0===n?void 0:n.parent;this.if=!n||!n.visibleLevels.includes(this.level)}},{key:"getData",value:function(){var t=this.Ee;return{ID:t.Yt,typeID:t.type,FID:t.fid,height:t.height,name:t.name,eName:t.ename,minLevel:t.minlevel,maxLevel:t.maxlevel}}},{key:"getBound",value:function(){if(this.Qc)return this.Qc;var t={};if(this.jn){for(var n=new om(this.jn,16776960),e=n.geometry.attributes.position.array,i=n.geometry.attributes.position.count,r=0;r<i;r++){var o=e[3*r],s=e[3*r+2];(!t.minX||t.minX>o)&&(t.minX=o),(!t.maxX||t.maxX<o)&&(t.maxX=o),(!t.minY||t.minY>s)&&(t.minY=s),(!t.maxY||t.maxY<s)&&(t.maxY=s)}n.material.dispose(),n.geometry.dispose(),n.material=void 0,n.geometry=void 0;n=this.Vn(tb);return t.minX=t.minX+n.x,t.maxX=t.maxX+n.x,t.minY=n.y-t.minY,t.maxY=n.y-t.maxY,t.minY>t.maxY&&(n=t.minY,t.minY=t.maxY,t.maxY=n),this.Qc=t,this.Qc}}},{key:"startAction",value:function(t,n){var e=this.gc[t];if(e){if(n){for(var i=this.getActionNames(),r=0;r<i.length;r++)i[r]!==t&&!0===this.gc[i[r]].clampWhenFinished&&!0===this.gc[i[r]].paused&&this.gc[i[r]].stop();e.loop=2200,e.clampWhenFinished=!0}else e.clampWhenFinished=!1,e.loop=2201;e.reset().setEffectiveTimeScale(1).setEffectiveWeight(1).play()}e=this.Vn(tb);e&&e.on("beforeRender",this.$c)}},{key:"getActionNames",value:function(){return Object.keys(this.gc)}},{key:"stopAction",value:function(t){var n=this.Vn(tb);n&&n.off("beforeRender",this.$c);t=this.gc[t];t&&t.stop()}},{key:"dispose",value:function(){null!==this.ef&&this.ef.dispose(),this.bu(),_m(Em(r.prototype),"dispose",this).call(this)}},{key:"getRenderNode",value:function(){return this.jn}},{key:"getTextureNames",value:function(){return null===this.ef?[]:this.ef.textureNames}},{key:"update3DTitlesMaterial",value:function(t,n){var e,i=t.parent.parent;i&&("Mesh"===n.type&&(e=this.uf(n.material,t),i.Pt.materialMode===nr.REAL&&((t=i.Zt.xe._e(e)).userData=n.material.userData,n.material=t,this.ye&&(e.color=this.ye,(e=i.Zt.xe._e(e)).userData=n.material.userData,n.userData.sourceMaterial=n.material,n.material=e))),i.enableUpdateRender())}}])&&wm(t.prototype,n),e&&wm(t,e),r}();Object.assign(Ri.prototype,{za:function(t){var n=this;this.if=!1,!this.jn&&this.Ee&&this.hf(function(){n.Wu&&n.Wu.za(n),t&&t()})},xu:function(){this.jn&&this.tt.Fi.remove(this.jn),this.jn=null,this.hf()},hf:function(i){var t,r=this,o=this.Vn(tb),n=this.Vn(vr);this.mu=o.Zt._u.aa({fid:this.Ee.fid,typeID:this.Ee.type+"",bid:n.Yt}),this.mu&&this.mu.normalID&&(t=o.Zt.Ku(this.mu,"model",n.buildingID)+this.mu.model+"?keyValue="+o.Pt.key,null===this.Kc&&(this.Kc=o.Zt.Ku(this.mu,"model",n.buildingID)),o.Zt.cf.Io(t,function(t,n,e){r.Pc=t,r.Pc?r.ff(n):r.lf(n,e,r.mu),null===r.ef&&(r.ef=new mm(r)),o.enableUpdateRender(),i&&i&&i()}))},lf:function(t,n,e){if(!this.jn){var i=this.Vn(ug);if(i){var r=i.Vn(tb);if(Array.isArray(n)){var o,s=ym(n);try{for(s.s();!(o=s.n()).done;){var a=o.value;a.map&&(a.map.wrapS=Sn,a.map.wrapT=Sn),a.userData.sourceTransparent=a.transparent,a.userData.sourceOpacity=a.opacity,a.opacity=a.userData.sourceOpacity*i.Eu,a.opacity<1&&(a.transparent=!0)}}catch(t){s.e(t)}finally{s.f()}}else n.map&&(n.map.wrapS=Sn,n.map.wrapT=Sn),n.userData.sourceOpacity=n.opacity,n.userData.sourceTransparent=n.transparent,n.opacity=n.userData.sourceOpacity*i.Eu,n.opacity<1&&(n.transparent=!0);var u=[];if(void 0!==n.length)for(var h=0;h<n.length;h++){var c=n[h].clone();this.Du&&(c.color=new _i(this.Du)),u.push(c)}else{var f=n.clone();this.Du&&(f.color=new _i(this.Du)),u.push(f)}this.jn=new Ko(t,u),this.ye&&this.Mu(),this.Wu||this.sf();var l=e.scale.split(",");this.jn.scale.set(parseFloat(l[0]),parseFloat(l[2]),parseFloat(l[1]));f=e.rotate.split(","),t=new St,l=Math.PI/180;t.set(parseFloat(f[0])*l,parseFloat(f[2])*l,parseFloat(f[1])*l),this.jn.rotation.setFromVector3(t,"YXZ");e=e.translate.split(","),r=new St(this.Ee.qr[0].x-r.N,this.Ee.qr[0].y-r.F,0).applyEuler(new _(-Math.PI/2,0,0,"XYZ")).add(new St(0,-1===this.Ee.height?2.2:this.Ee.height,0));r.add(new St(parseFloat(e[0]),parseFloat(e[2]),parseFloat(e[1]))),this.jn.position.set(r.x,r.y,r.z),(this.jn.mapNode=this).tt.Fi.add(this.jn)}}},ff:function(t){if(!this.jn){var n=this.Vn(tb);if(n){var e=t.scene,i=this.mu.rotate.split(","),r=new St,o=Math.PI/180;r.set(parseFloat(i[0])*o,parseFloat(i[2])*o,parseFloat(i[1])*o),e.rotation.setFromVector3(r,"YXZ");r=this.mu.scale.split(",");e.scale.set(parseFloat(r[0]),parseFloat(r[2]),parseFloat(r[1]));r=this.mu.translate.split(","),n=new St(this.Ee.qr[0].x-n.N,this.Ee.qr[0].y-n.F,0).applyEuler(new _(-Math.PI/2,0,0,"XYZ")).add(new St(0,-1===this.Ee.height?2.2:this.Ee.height,0));if(n.add(new St(parseFloat(r[0]),parseFloat(r[2]),parseFloat(r[1]))),e.position.set(n.x,n.y,n.z),this.jn=e,(this.jn.mapNode=this).tt.Fi.add(this.jn),this.Mu(),this.Wu||this.sf(),0<t.animations.length){this.Ch=new um(this.jn);var s,a=ym(t.animations);try{for(a.s();!(s=a.n()).done;){var u=s.value;this.gc[u.name]=this.Ch.clipAction(u)}}catch(t){a.e(t)}finally{a.f()}t=this.Vn(tb);t.pn.df(this.Ch),t.Pt.autoPlay&&this.startAction(this.getActionNames()[0])}}}},vf:function(t){var n,e=this.Vn(tb),i=this.Vn(ug);return(n=e.getMapOptions().materialMode===nr.REAL?(n=this.we(t,i),e.Zt.xe.Us(n)):t.clone()).userData=t.userData,n},pf:function(){var o=this,s=[],t=this.jn;if(this.Pc)this.jn.traverse(function(t){if("Mesh"===t.type)if(t.userData.sourceMaterial||(t.userData.sourceMaterial=t.material),Array.isArray(t.material)){for(var n=[],e=0;e<t.material.length;e++){var i=o.vf(t.material[e]);i.transparent=!0,n.push(i)}t.material=n,s=s.concat(n)}else{var r=o.vf(t.material);r.transparent=!0,t.material=r,s.push(r)}});else if(t.userData.sourceMaterial||(t.userData.sourceMaterial=t.material),Array.isArray(this.jn.material)){for(var n=[],e=0;e<this.jn.material.length;e++){var i=this.jn.material[e];i.transparent=!0,n.push(i.clone())}this.jn.material=n,s=s.concat(n)}else{t=this.jn.material.clone();t.transparent=!0,s.push(t),this.jn.material=t}return s},mf:function(){function n(t){var n;t.userData.sourceMaterial&&(n=t.material,t.material=t.userData.sourceMaterial,delete t.userData.sourceMaterial,Array.isArray(n)?n.forEach(function(t){t.dispose()}):n.dispose())}var t=this.jn;this.Pc?this.jn.traverse(function(t){"Mesh"===t.type&&n(t)}):n(t),this.Mu()},sf:function(t){var r=this,t=void 0!==(t=t||{}).duration?t.duration:.5,o=this.Vn(ug),s=o.Vn(tb);if(this.tf&&!1===this.tf.ht){if(this.nf)return;this.tf.stop()}this.nf=!0;var a=this.pf();this.tf.pt([0]).mt([1]).gt(t).bt(function(t){for(var n=t.destination[0],e=0;e<a.length;e++){var i=a[e];r.Pc&&s.getMapOptions().materialMode===nr.REAL?i.uniforms.opacity.value=n*i.userData.sourceOpacity*o.Eu:i.opacity=n*i.userData.sourceOpacity*o.Eu}s.enableUpdateRender()}).wt(function(){s.pn.vn(r.tf),r.mf()}),s.pn.mn(this.tf.play())},af:function(t){var i=this,t=void 0!==(t=t||{}).duration?t.duration:.5,r=this.Vn(ug),o=r.Vn(tb);if(this.tf&&!1===this.tf.ht){if(!this.nf)return;this.tf.stop()}this.nf=!1;var s=this.pf();this.tf.pt([1]).mt([0]).gt(t).bt(function(t){for(var n=t.destination[0],e=0;e<s.length;e++)i.Pc&&o.getMapOptions().materialMode===nr.REAL?s[e].uniforms.opacity.value=n*s[e].userData.sourceOpacity*r.Eu:s[e].opacity=n*s[e].userData.sourceOpacity*r.Eu;o.enableUpdateRender()}).wt(function(){o.pn.vn(i.tf),i.bu(),o.enableUpdateNode()}),o.pn.mn(this.tf.play())},Mu:function(){var r=this;if(this.jn){var o=this.Vn(tb),s=this.Vn(ug);if(o){if(this.Pc)this.jn.traverse(function(t){if("Mesh"===t.type){var n=r.we(t.material,s);if(o.Pt.materialMode===nr.REAL){var e=o.Zt.xe._e(n);e.userData=t.material.userData,t.material=e,r.ye&&(n.color=r.ye,(e=o.Zt.xe._e(n)).userData=t.material.userData,t.userData.sourceMaterial=t.material,t.material=e)}else if(Array.isArray(t.material.length))for(var i=0;i<t.material.length;i++)t.material[i].depthWrite=!0,t.material[i]=o.Zt.xe.Me(t.material[i],n),r.ye&&(n.color=r.ye,t.userData.sourceMaterial=t.material,t.material[i]=o.Zt.xe.Me(t.material[i],n));else t.material.depthWrite=!0,t.material=o.Zt.xe.Me(t.material,n),r.ye&&(n.color=r.ye,t.userData.sourceMaterial=t.material,t.material=o.Zt.xe.Me(t.material,n))}});else{var t=this.jn.material;if(Array.isArray(t)){var n,e=[],i=ym(t);try{for(i.s();!(n=i.n()).done;){var a,u=n.value,h=this.we(u,s);u.color=new _i(h.color),u.opacity=h.opacity,u.transparent=h.transparent,this.ye&&((a=u.clone()).color=new _i(this.ye),e.push(a))}}catch(t){i.e(t)}finally{i.f()}this.ye&&(this.jn.userData.sourceMaterial=this.jn.material,this.jn.material=e)}else{var c=this.we(t,s);t.color=new _i(c.color),t.opacity=c.opacity,t.transparent=c.transparent,this.ye&&((t=t.clone()).color=new _i(this.ye),this.jn.userData.sourceMaterial=this.jn.material,this.jn.material=t)}}o.enableUpdateRender()}}},we:function(t,n){var e={};return this.Vn(tb).Pt.materialMode===nr.REAL?(t.constructor===yf?(t.userData.sourceOpacity=t.opacity,t.userData.sourceTransparent=t.transparent,e={color:t.color.getHex(),USE_EMISSIVEMAP:!!t.emissiveMap,USE_MAP:!!t.map,USE_AOMAP:!!t.aoMap,map:t.map,aoMap:t.aoMap,emissive:t.emissive.getHex(),emissiveMap:t.emissiveMap,metalness:t.metalness,roughness:t.roughness,normalScale:t.normalScale,vertexColors:t.vertexColors,side:t.side,skinning:t.skinning}):t.constructor===rf&&(e={USE_EMISSIVEMAP:t.defines.USE_EMISSIVEMAP,USE_MAP:t.defines.USE_MAP,USE_AOMAP:t.defines.USE_AOMAP,aoMap:t.uniforms.aoMap.value,map:t.uniforms.map.value,color:t.uniforms.diffuse.value.getHex(),emissive:t.uniforms.emissive.value.getHex(),emissiveMap:t.uniforms.emissiveMap.value,metalness:t.uniforms.metalness.value,roughness:t.uniforms.roughness.value,normalScale:t.uniforms.normalScale.value,vertexColors:t.vertexColors,side:t.side,skinning:t.skinning}),null===this.Du&&(this.Du=e.color)):(void 0===t.userData.sourceOpacity&&(t.userData.sourceOpacity=t.opacity),void 0===t.userData.sourceTransparent&&(t.userData.sourceTransparent=t.transparent),null===this.Du&&(this.Du=t.color)),this.Du&&(e.color=this.Du),e.opacity=void 0!==t.userData.sourceOpacity?t.userData.sourceOpacity*n.Eu:t.opacity*n.Eu,e.transparent=t.userData.sourceTransparent||e.opacity<1,e},yu:function(){var t,n=this.Vn(tb);n&&(this.jn&&(t=n.getZoom(),n.Zt.oh(this,t)),n.enableUpdateNode(),n.enableUpdateRender())},bu:function(){var t;if(this.Ch&&(this.stopAction(this.getActionNames()[0]),(t=this.Vn(tb))&&t.pn.gf(this.Ch),this.Ch=null),this.tf&&!1===this.tf.ht&&this.tf.finish(),this.jn&&"Mesh"===this.jn.type){if(this.jn.parent&&this.jn.parent.remove(this.jn),Array.isArray(this.jn.material)){var n,e=ym(this.jn.material);try{for(e.s();!(n=e.n()).done;){var i=n.value;i.map&&this.if&&i.map.dispose(),i.dispose()}}catch(t){e.e(t)}finally{e.f()}}else this.jn.material.map&&this.if&&this.jn.material.map.dispose(),this.jn.material.dispose();this.jn.geometry.dispose(),this.jn.geometry=void 0,this.jn.material=void 0,this.jn.mapNode=void 0,this.jn=void 0}else this.jn&&"Scene"===this.jn.type&&(this.jn.parent&&this.jn.parent.remove(this.jn),this.jn.mapNode=void 0,this.jn=void 0)},$c:function(){var t=this.Vn(tb);t&&t.enableUpdateRender()},uf:function(t,n){var e={};return n.parent.parent.Pt.materialMode===nr.REAL&&(t.constructor===yf||"MeshStandardMaterial"==t.type?(t.userData.sourceOpacity=t.opacity,t.userData.sourceTransparent=t.transparent,e={color:t.color.getHex(),USE_EMISSIVEMAP:!!t.emissiveMap,USE_MAP:!!t.map,USE_AOMAP:!!t.aoMap,map:t.map,aoMap:t.aoMap,emissive:t.emissive.getHex(),emissiveMap:t.emissiveMap,metalness:t.metalness,roughness:t.roughness,normalScale:t.normalScale,vertexColors:t.vertexColors,side:t.side,skinning:t.skinning}):t.constructor===rf&&(e={USE_EMISSIVEMAP:t.defines.USE_EMISSIVEMAP,USE_MAP:t.defines.USE_MAP,USE_AOMAP:t.defines.USE_AOMAP,aoMap:t.uniforms.aoMap.value,map:t.uniforms.map.value,color:t.uniforms.diffuse.value.getHex(),emissive:t.uniforms.emissive.value.getHex(),emissiveMap:t.uniforms.emissiveMap.value,metalness:t.uniforms.metalness.value,roughness:t.uniforms.roughness.value,normalScale:t.uniforms.normalScale.value,vertexColors:t.vertexColors,side:t.side,skinning:t.skinning}),null===this.Du&&(this.Du=e.color)),this.Du&&(e.color=this.Du),e.opacity=void 0!==t.userData.sourceOpacity?t.userData.sourceOpacity*n.Eu:t.opacity*n.Eu,e.transparent=t.userData.sourceTransparent||e.opacity<1,e}});var Tm=Ri;function Lm(t){return(Lm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Rm(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var e=[],i=!0,r=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(i=(s=a.next()).done)&&(e.push(s.value),!n||e.length!==n);i=!0);}catch(t){r=!0,o=t}finally{try{i||null==a.return||a.return()}finally{if(r)throw o}}return e}}(t,n)||Om(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Om(t,n){if(t){if("string"==typeof t)return Am(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(e="Object"===e&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Am(t,n):void 0}}function Am(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}function km(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Cm(t,n,e){return(Cm="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,n,e){t=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=Dm(t)););return t}(t,n);if(t){n=Object.getOwnPropertyDescriptor(t,n);return n.get?n.get.call(e):n.value}})(t,n,e||t)}function jm(t,n){return(jm=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Pm(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Dm(e);return t=i?(t=Dm(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Lm(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function Dm(t){return(Dm=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}e=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&jm(t,n)}(r,mv);var t,n,e,i=Pm(r);function r(t,n){var e;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(e=i.call(this)).Un=Ii.EXTERNAL_MODEL_LAYER,e.Fi.name="externalModel",e.Fi.userData.type="externalModel",e.Yn="externalModel",e.ah={},e.Ru(t,n),e}return t=r,(n=[{key:"level",get:function(){return this.tt.$n}},{key:"height",get:function(){return this.tt.Jt}},{key:"getFeatures",value:function(){return this.K}},{key:"init",value:function(){Cm(Dm(r.prototype),"init",this).call(this),this.hu(),this.cu(),this.fu()}},{key:"beforRemove",value:function(){this.traverse(function(t){t.beforRemove&&t.beforRemove()})}},{key:"dispose",value:function(){this.vu(),Cm(Dm(r.prototype),"dispose",this).call(this)}}])&&km(t.prototype,n),e&&km(t,e),r}();Object.assign(e.prototype,{Ru:function(t,n){var e,i=function(t,n){var e;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(e=Om(t))||n&&t&&"number"==typeof t.length){e&&(t=e);var i=0,n=function(){};return{s:n,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},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,o=!0,s=!1;return{s:function(){e=t[Symbol.iterator]()},n:function(){var t=e.next();return o=t.done,t},e:function(t){s=!0,r=t},f:function(){try{o||null==e.return||e.return()}finally{if(s)throw r}}}}(t.K);try{for(i.s();!(e=i.n()).done;){var r=Rm(e.value,2),o=(r[0],r[1]),s=new Tm(o);(s.tt=this).K.push(s),s.visible=n.map.Zt.Ou(this.Un,{typeID:s.typeID,FID:s.FID})}}catch(t){i.e(t)}finally{i.f()}},hu:function(){var t=this.Vn(tb);this.du=new Bd(t).createLight(this,"FMExternalModelLayer")},fu:function(){var n=this,e=this.Vn(tb);e.Pt.hdr&&e.Pt.hdr.load(e,function(t){n.Fi.environment=t,e.enableUpdateRender()})},cu:function(){this.Fi.add(this.ru),this.Fi.add(this.eu),this.Fi.add(this.ou),this.Fi.add(this.iu)},vu:function(){this.Fi.remove(this.ru),this.Fi.remove(this.eu),this.Fi.remove(this.ou),this.du.vt()}});dr=e;function Im(t){return(Im="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Nm(t,n){return(Nm=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Fm(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Um(e);return t=i?(t=Um(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Im(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function Um(t){return(Um=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}_r=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Nm(t,n)}(e,cd);var n=Fm(e);function e(){var t;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,e),(t=n.call(this)).Un=Ii.WALL_MARKER,t}return e}();function Bm(t){return(Bm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Gm(t,n){return(Gm=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Hm(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Vm(e);return t=i?(t=Vm(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Bm(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function Vm(t){return(Vm=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}Ru=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Gm(t,n)}(e,cd);var n=Hm(e);function e(){var t;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,e),(t=n.call(this)).Un=Ii.TUBE_MARKER,t.hu(),t}return e}();Object.assign(Ru.prototype,{hu:function(){this.eu=new Fd(7631988),this.iu=new Z,this.ru=new tl(8947848,1.2),this.ru.position.set(-1,1,1).normalize(),this.ru.castShadow=!1,this.ru.target=this.iu,this.ou=new tl(3355443),this.ou.position.set(-.5,1,-1).normalize(),this.ou.target=this.iu,this.Fi.add(this.ru),this.Fi.add(this.ou),this.Fi.add(this.eu),this.Fi.add(this.iu)}});ch=Ru;function zm(t){return(zm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Wm(t,n){return(Wm=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Xm(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Zm(e);return t=i?(t=Zm(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==zm(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function Zm(t){return(Zm=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}Ri=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Wm(t,n)}(e,cd);var n=Xm(e);function e(){var t;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,e),(t=n.call(this)).Un=Ii.LINE3D_MARKER,t}return e}();function Ym(t){return(Ym="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function qm(t,n){return(qm=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Km(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Jm(e);return t=i?(t=Jm(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Ym(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function Jm(t){return(Jm=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}e=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&qm(t,n)}(e,cd);var n=Km(e);function e(){var t;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,e),(t=n.call(this)).Un=Ii.SPHERE_MARKER,t}return e}(),Ru={};Ru.LAYER_CLASS=new Map,Ru.LAYER_CLASS.set(Ii.EXTENT_LAYER,Tu),Ru.LAYER_CLASS.set(Ii.MODEL_LAYER,uh),Ru.LAYER_CLASS.set(Ii.LABEL_LAYER,eh),Ru.LAYER_CLASS.set(Ii.FACILITY_LAYER,Di),Ru.LAYER_CLASS.set(Ii.EXTERNAL_MODEL_LAYER,dr),Ru.LAYER_CLASS.set(Ii.IMAGE_MARKER,mh),Ru.LAYER_CLASS.set(Ii.TEXT_MARKER,yh),Ru.LAYER_CLASS.set(Ii.POLYGON_MARKER,vi),Ru.LAYER_CLASS.set(Ii.EXTRUDE_MARKER,mi),Ru.LAYER_CLASS.set(Ii.HEAT_MAP_MARKER,Ai),Ru.LAYER_CLASS.set(Ii.DYNAMIC_MODEL_MARKER,Gi),Ru.LAYER_CLASS.set(Ii.LINE_MARKER,ir),Ru.LAYER_CLASS.set(Ii.LOCATION_MARKER,tr),Ru.LAYER_CLASS.set(Ii.DOM_MARKER,sr),Ru.LAYER_CLASS.set(Ii.WALL_MARKER,_r),Ru.LAYER_CLASS.set(Ii.TUBE_MARKER,ch),Ru.LAYER_CLASS.set(Ii.LINE3D_MARKER,Ri),Ru.LAYER_CLASS.set(Ii.SPHERE_MARKER,e);var Qm=Ru;function $m(t){return($m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function tg(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var e=[],i=!0,r=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(i=(s=a.next()).done)&&(e.push(s.value),!n||e.length!==n);i=!0);}catch(t){r=!0,o=t}finally{try{i||null==a.return||a.return()}finally{if(r)throw o}}return e}}(t,n)||ng(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ng(t,n){if(t){if("string"==typeof t)return eg(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(e="Object"===e&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?eg(t,n):void 0}}function eg(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}function ig(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function rg(t,n,e){return(rg="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,n,e){t=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=ag(t)););return t}(t,n);if(t){n=Object.getOwnPropertyDescriptor(t,n);return n.get?n.get.call(e):n.value}})(t,n,e||t)}function og(t,n){return(og=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function sg(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=ag(e);return t=i?(t=ag(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==$m(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function ag(t){return(ag=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}yh=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&og(t,n)}(r,ar);var t,n,e,i=sg(r);function r(t){var n;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(n=i.call(this)).Pt=t.mapOptions,n.Et=t.states,n.Ee=t.data,n.$n=n.Ee.gid,n.yf=n.Ee.gname,n.bf=n.Ee.alias,n.wf=n.Ee.desc,n.Jt=0,n._f=null,n.xf=[Ii.EXTENT_LAYER,Ii.EXTERNAL_MODEL_LAYER,Ii.MODEL_LAYER,Ii.LABEL_LAYER,Ii.FACILITY_LAYER],n.Eu=1,n.Mf=!0,n}return t=r,(n=[{key:"bound",get:function(){var n=this;return!0===this.needUpdateBound&&(this.Gn.reset(),this.K.forEach(function(t){n.Gn.expand(t.bound)}),this.needUpdateBound=!1),this.Gn.clone()}},{key:"height",get:function(){return this.Jt}},{key:"type",get:function(){return this.Ee.Un}},{key:"center",get:function(){var t=this._f;return{x:(t.minX+t.maxX)/2,y:(t.minY+t.maxY)/2}}},{key:"x",get:function(){return this.center.x}},{key:"y",get:function(){return this.center.y}},{key:"visible",get:function(){return this.Bn},set:function(t){var n=this;this.Bn=t,this.traverse(function(t){t.Fi.visible=!(!t.visible||!n.Bn)});t=this.Vn(tb);t&&t.Zt.er()}},{key:"level",get:function(){return this.$n}},{key:"name",get:function(){return this.yf}},{key:"ID",get:function(){return this.Yt}},{key:"alias",get:function(){return this.bf}},{key:"floorID",get:function(){return this.Ee.floorId}},{key:"getLayers",value:function(t,n){if(void 0===t)return this.K;for(var e=[],i=0;i<this.K.length;i++)0==(this.K[i].type&t)==!!n&&e.push(this.K[i]);return e}},{key:"getExtendMesh",value:function(){var t=this.getLayers(Ii.EXTENT_LAYER)[0];return t?t.K[0].jn:null}},{key:"getModelMeshs",value:function(){for(var t=this.getLayers(Ii.MODEL_LAYER)[0],n=[],e=0;e<t.K.length;e++)n.push(t.K[e].jn);return n}},{key:"getBound",value:function(){return this.Ee.getBound().toObject()}},{key:"setExtentImage",value:function(t){for(var n=this.getLayers(Ii.EXTENT_LAYER)[0],e=0;e<n.K.length;e++)n.K[e].Su(t)}},{key:"clearExtentImage",value:function(){this.setExtentImage("")}},{key:"getOrCreateLayer",value:function(t){if(void 0!==(n=this.getLayers(t)[0]))return n;var n=new(Qm.LAYER_CLASS.get(t));return this.mn(n),this.Vn(tb).cn.Ln(),n}},{key:"getMapCoordsRange",value:function(){return this._f}},{key:"opacity",value:function(){return this.Eu}},{key:"remove",value:function(t){t.beforRemove&&t.beforRemove(),rg(ag(r.prototype),"remove",this).call(this,t);t=this.Vn(tb);t&&t.cn&&t.cn.Ln()}}])&&ig(t.prototype,n),e&&ig(t,e),r}();Object.assign(yh.prototype,{Sf:function(){var t=this.Et.Tn(this.tt.Yt);t.nonFocusAlphaMode&&(this.tt.level===this.$n?1!==this.Eu&&(this.Eu=1,this.Mf=!0):this.Eu!==t.nonFocusAlpha&&(this.Eu=t.nonFocusAlpha,this.Mf=!0))},mn:function(t){(t.tt=this).K.push(t),this.needUpdateBound=!0,t.init()},Ef:function(){var i,r,t,o=this,n=this.tt;this.tt.constructor===Kl?this.Jt=n.floorSpace*this.$n:1===n.visibleLevels.length?(t=n.parent.qt,this.Jt=t.getFloor(t.level).height):(i=1/0,r=0,(t=n.alignHeight).forEach(function(t,n,e){Math.abs(o.$n-n)<i&&(i=Math.abs(o.$n-n),r=n)}),this.Jt=t.get(r)+n.floorSpace*(this.$n-r))},Qn:function(t){var e=this,n=void 0===(t=t||{}).animate||t.animate,i=void 0!==t.duration?t.duration:.5,r=this.Vn(tb),o=this.Jt;this.Ef(),n?(this.Tf||(this.Tf=new Oi),this.Tf.pt([o]).mt([this.Jt]).gt(i).bt(function(n){e.traverse(function(t){t.Un!==Ii.LINE_MARKER&&t.Un!==Ii.LOCATION_MARKER&&(t.Fi.position.y=n.destination[0]),t.Un===Ii.LOCATION_MARKER&&t.K.forEach(function(t){t.Lf()})}),r.Ii.K.forEach(function(t){t.Un===Ii.LINE_MARKER&&t.Lf()}),r.enableUpdateNode()}).wt(function(){t.finish&&t.finish()}),r.pn.mn(this.Tf.dt())):(this.Tf&&this.Tf.stop(),this.traverse(function(t){t.Un!==Ii.LINE_MARKER&&t.Un!==Ii.LOCATION_MARKER&&(t.Fi.position.y=e.Jt),t.Un===Ii.LOCATION_MARKER&&t.K.forEach(function(t){t.Lf()})}),r.Ii.K.forEach(function(t){t.Un===Ii.LINE_MARKER&&t.Lf()}),r.enableUpdateNode())},Rf:function(e){for(var t=0;t<this.K.length;t++)if("externalModel"===this.K[t].Yn)this.K[t].Fi.traverse(function(t){if("Mesh"===t.type&&t.material.length)for(var n=0;n<t.material.length;n++)t.material[n].userData.oldAlpha||(t.material[n].userData.oldAlpha=t.material[n].opacity),t.material[n].opacity=e});else for(var n=this.K[t].Fi.children,i=0;i<n.length;i++)n[i].material&&(n[i].material.userData.oldAlpha||(n[i].material=n[i].material.clone(),n[i].material.userData.oldAlpha=n[i].material.opacity),n[i].material.opacity=e)},Of:function(){for(var t=0;t<this.K.length;t++)if("externalModel"===this.K[t].Yn)this.K[t].Fi.traverse(function(t){if("Mesh"===t.type)if(t.material.length)for(var n=0;n<t.material.length;n++)t.material[n].userData.oldAlpha&&(t.material[n].opacity=t.material[n].userData.oldAlpha);else t.material.userData.oldAlpha&&(t.material.opacity=t.material.userData.oldAlpha)});else for(var n=this.K[t].Fi.children,e=0;e<n.length;e++)n[e].material&&n[e].material.userData.oldAlpha&&(n[e].material.opacity=n[e].material.userData.oldAlpha)},Af:function(){var n=this;this.tt.tt.re.ie.get(this.tt.Wn).K.forEach(function(t){t.gid===n.$n&&(t=t.K.get(Ii.EXTENT_LAYER).getBound(),n._f={minX:t.Pn.x,minY:t.Pn.y,maxX:t.Dn.x,maxY:t.Dn.y})})},kf:function(){var i,r,o=this,t=this.Ee,s=this.Vn(tb),n=function(t,n){var e;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(e=ng(t))||n&&t&&"number"==typeof t.length){e&&(t=e);var i=0,n=function(){};return{s:n,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},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,o=!0,s=!1;return{s:function(){e=t[Symbol.iterator]()},n:function(){var t=e.next();return o=t.done,t},e:function(t){s=!0,r=t},f:function(){try{o||null==e.return||e.return()}finally{if(s)throw r}}}}(t.K);try{for(n.s();!(r=n.n()).done;)(function(){var t=tg(r.value,2),n=t[0],e=t[1];if(o.K.some(function(t){return t.type===n}))return;t=Qm.LAYER_CLASS.get(n);i=new t(e,{map:s}),o.mn(i)})()}catch(t){n.e(t)}finally{n.f()}},Cf:function(t,n){for(var e=null,i=0;i<t.length;i++)if(""+t[i].Un==""+n){e=t[i];break}return e}});var ug=yh;vi=function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t)};Object.assign(vi.prototype,{cr:function(t,n,e,i){n=new hh({method:"GET",url:t+n+"/"+n+".theme"});return n.cr(function(t){e&&e(t)},function(t){i&&i(t===Ni.PATH_ERROR?Ni.THEME_ID_URL_ERROR:t)}),n}});var hg=new vi;function cg(){this.type="Curve",this.arcLengthDivisions=200}function fg(t,n,e,i,r,o,s,a){cg.call(this),this.type="EllipseCurve",this.aX=t||0,this.aY=n||0,this.xRadius=e||1,this.yRadius=i||1,this.aStartAngle=r||0,this.aEndAngle=o||2*Math.PI,this.aClockwise=s||!1,this.aRotation=a||0}function lg(t,n,e,i,r,o){fg.call(this,t,n,e,e,i,r,o),this.type="ArcCurve"}function dg(){var r=0,o=0,s=0,a=0;function u(t,n,e,i){s=-3*(r=t)+3*n-2*(o=e)-i,a=2*t-2*n+e+i}return{initCatmullRom:function(t,n,e,i,r){u(n,e,r*(e-t),r*(i-n))},initNonuniformCatmullRom:function(t,n,e,i,r,o,s){r=(n-t)/r-(e-t)/(r+o)+(e-n)/o,s=(e-n)/o-(i-n)/(o+s)+(i-e)/s;u(n,e,r*=o,s*=o)},calc:function(t){var n=t*t;return r+o*t+s*n+a*(n*t)}}}Object.assign(cg.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(t,n){t=this.getUtoTmapping(t);return this.getPoint(t,n)},getPoints:function(t){void 0===t&&(t=5);for(var n=[],e=0;e<=t;e++)n.push(this.getPoint(e/t));return n},getSpacedPoints:function(t){void 0===t&&(t=5);for(var n=[],e=0;e<=t;e++)n.push(this.getPointAt(e/t));return n},getLength:function(){var t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var n,e,i=[],r=this.getPoint(0),o=0;for(i.push(0),e=1;e<=t;e++)o+=(n=this.getPoint(e/t)).distanceTo(r),i.push(o),r=n;return this.cacheArcLengths=i},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(t,n){for(var e,i=this.getLengths(),r=0,o=i.length,s=n||t*i[o-1],a=0,u=o-1;a<=u;)if((e=i[r=Math.floor(a+(u-a)/2)]-s)<0)a=r+1;else{if(!(0<e)){u=r;break}u=r-1}if(i[r=u]===s)return r/(o-1);t=i[r];return(r+(s-t)/(i[r+1]-t))/(o-1)},getTangent:function(t){var n=t-1e-4,t=t+1e-4;1<t&&(t=1);n=this.getPoint(n=n<0?0:n);return this.getPoint(t).clone().sub(n).normalize()},getTangentAt:function(t){t=this.getUtoTmapping(t);return this.getTangent(t)},computeFrenetFrames:function(t,n){for(var e,i=new St,r=[],o=[],s=[],a=new St,u=new Et,h=0;h<=t;h++)r[h]=this.getTangentAt(h/t),r[h].normalize();o[0]=new St,s[0]=new St;var c=Number.MAX_VALUE,f=Math.abs(r[0].x),l=Math.abs(r[0].y),d=Math.abs(r[0].z);for(f<=c&&(c=f,i.set(1,0,0)),l<=c&&(c=l,i.set(0,1,0)),d<=c&&i.set(0,0,1),a.crossVectors(r[0],i).normalize(),o[0].crossVectors(r[0],a),s[0].crossVectors(r[0],o[0]),h=1;h<=t;h++)o[h]=o[h-1].clone(),s[h]=s[h-1].clone(),a.crossVectors(r[h-1],r[h]),a.length()>Number.EPSILON&&(a.normalize(),e=Math.acos(Mt.clamp(r[h-1].dot(r[h]),-1,1)),o[h].applyMatrix4(u.makeRotationAxis(a,e))),s[h].crossVectors(r[h],o[h]);if(!0===n)for(e=Math.acos(Mt.clamp(o[0].dot(o[t]),-1,1)),e/=t,0<r[0].dot(a.crossVectors(o[0],o[t]))&&(e=-e),h=1;h<=t;h++)o[h].applyMatrix4(u.makeRotationAxis(r[h],e*h)),s[h].crossVectors(r[h],o[h]);return{tangents:r,normals:o,binormals:s}},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}),((fg.prototype=Object.create(cg.prototype)).constructor=fg).prototype.isEllipseCurve=!0,fg.prototype.getPoint=function(t,n){for(var e=n||new fi,i=2*Math.PI,r=this.aEndAngle-this.aStartAngle,o=Math.abs(r)<Number.EPSILON;r<0;)r+=i;for(;i<r;)r-=i;r<Number.EPSILON&&(r=o?0:i),!0!==this.aClockwise||o||(r===i?r=-i:r-=i);var s=this.aStartAngle+t*r,a=this.aX+this.xRadius*Math.cos(s),u=this.aY+this.yRadius*Math.sin(s);return 0!==this.aRotation&&(n=Math.cos(this.aRotation),o=Math.sin(this.aRotation),a=(t=a-this.aX)*n-(s=u-this.aY)*o+this.aX,u=t*o+s*n+this.aY),e.set(a,u)},fg.prototype.copy=function(t){return cg.prototype.copy.call(this,t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this},((lg.prototype=Object.create(fg.prototype)).constructor=lg).prototype.isArcCurve=!0;var vg=new St,pg=new dg,mg=new dg,gg=new dg;function yg(t,n,e,i){cg.call(this),this.type="CatmullRomCurve3",this.points=t||[],this.closed=n||!1,this.curveType=e||"centripetal",this.tension=i||.5}function bg(t,n,e,i,r){var o=.5*(i-n),n=.5*(r-e),r=t*t;return(2*e-2*i+o+n)*(t*r)+(-3*e+3*i-2*o-n)*r+o*t+e}function wg(t,n,e,i){return(r=1-(r=t))*r*n+2*(1-(n=t))*n*e+(t=t)*t*i;var r}function _g(t,n,e,i,r){return(o=1-(o=t))*o*o*n+3*(n=1-(o=t))*n*o*e+3*(1-(e=t))*e*e*i+(t=t)*t*t*r;var o}function xg(t,n,e,i){cg.call(this),this.type="CubicBezierCurve",this.v0=t||new fi,this.v1=n||new fi,this.v2=e||new fi,this.v3=i||new fi}function Mg(t,n,e,i){cg.call(this),this.type="CubicBezierCurve3",this.v0=t||new St,this.v1=n||new St,this.v2=e||new St,this.v3=i||new St}function Sg(t,n){cg.call(this),this.type="LineCurve",this.v1=t||new fi,this.v2=n||new fi}function Eg(t,n){cg.call(this),this.type="LineCurve3",this.v1=t||new St,this.v2=n||new St}function Tg(t,n,e){cg.call(this),this.type="QuadraticBezierCurve",this.v0=t||new fi,this.v1=n||new fi,this.v2=e||new fi}function Lg(t,n,e){cg.call(this),this.type="QuadraticBezierCurve3",this.v0=t||new St,this.v1=n||new St,this.v2=e||new St}function Rg(t){cg.call(this),this.type="SplineCurve",this.points=t||[]}function Og(){cg.call(this),this.type="CurvePath",this.curves=[],this.autoClose=!1}function Ag(t){Og.call(this),this.type="Path",this.currentPoint=new fi,t&&this.setFromPoints(t)}function kg(t){Ag.call(this,t),this.uuid=Mt.generateUUID(),this.type="Shape",this.holes=[]}((yg.prototype=Object.create(cg.prototype)).constructor=yg).prototype.isCatmullRomCurve3=!0,yg.prototype.getPoint=function(t,n){var e,i=n||new St,r=this.points,o=r.length,s=(o-(this.closed?0:1))*t,a=Math.floor(s),u=s-a;return this.closed?a+=0<a?0:(Math.floor(Math.abs(a)/o)+1)*o:0===u&&a===o-1&&(a=o-2,u=1),e=this.closed||0<a?r[(a-1)%o]:(vg.subVectors(r[0],r[1]).add(r[0]),vg),n=r[a%o],t=r[(a+1)%o],s=this.closed||a+2<o?r[(a+2)%o]:(vg.subVectors(r[o-1],r[o-2]).add(r[o-1]),vg),"centripetal"===this.curveType||"chordal"===this.curveType?(a="chordal"===this.curveType?.5:.25,r=Math.pow(e.distanceToSquared(n),a),o=Math.pow(n.distanceToSquared(t),a),a=Math.pow(t.distanceToSquared(s),a),o<1e-4&&(o=1),pg.initNonuniformCatmullRom(e.x,n.x,t.x,s.x,r=r<1e-4?o:r,o,a=a<1e-4?o:a),mg.initNonuniformCatmullRom(e.y,n.y,t.y,s.y,r,o,a),gg.initNonuniformCatmullRom(e.z,n.z,t.z,s.z,r,o,a)):"catmullrom"===this.curveType&&(pg.initCatmullRom(e.x,n.x,t.x,s.x,this.tension),mg.initCatmullRom(e.y,n.y,t.y,s.y,this.tension),gg.initCatmullRom(e.z,n.z,t.z,s.z,this.tension)),i.set(pg.calc(u),mg.calc(u),gg.calc(u)),i},yg.prototype.copy=function(t){cg.prototype.copy.call(this,t),this.points=[];for(var n=0,e=t.points.length;n<e;n++){var i=t.points[n];this.points.push(i.clone())}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this},((xg.prototype=Object.create(cg.prototype)).constructor=xg).prototype.isCubicBezierCurve=!0,xg.prototype.getPoint=function(t,n){var e=n||new fi,i=this.v0,r=this.v1,o=this.v2,n=this.v3;return e.set(_g(t,i.x,r.x,o.x,n.x),_g(t,i.y,r.y,o.y,n.y)),e},xg.prototype.copy=function(t){return cg.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this},((Mg.prototype=Object.create(cg.prototype)).constructor=Mg).prototype.isCubicBezierCurve3=!0,Mg.prototype.getPoint=function(t,n){var e=n||new St,i=this.v0,r=this.v1,o=this.v2,n=this.v3;return e.set(_g(t,i.x,r.x,o.x,n.x),_g(t,i.y,r.y,o.y,n.y),_g(t,i.z,r.z,o.z,n.z)),e},Mg.prototype.copy=function(t){return cg.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this},((Sg.prototype=Object.create(cg.prototype)).constructor=Sg).prototype.isLineCurve=!0,Sg.prototype.getPoint=function(t,n){n=n||new fi;return 1===t?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n},Sg.prototype.getPointAt=function(t,n){return this.getPoint(t,n)},Sg.prototype.getTangent=function(){return this.v2.clone().sub(this.v1).normalize()},Sg.prototype.copy=function(t){return cg.prototype.copy.call(this,t),this.v1.copy(t.v1),this.v2.copy(t.v2),this},((Eg.prototype=Object.create(cg.prototype)).constructor=Eg).prototype.isLineCurve3=!0,Eg.prototype.getPoint=function(t,n){n=n||new St;return 1===t?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n},Eg.prototype.getPointAt=function(t,n){return this.getPoint(t,n)},Eg.prototype.copy=function(t){return cg.prototype.copy.call(this,t),this.v1.copy(t.v1),this.v2.copy(t.v2),this},((Tg.prototype=Object.create(cg.prototype)).constructor=Tg).prototype.isQuadraticBezierCurve=!0,Tg.prototype.getPoint=function(t,n){var e=n||new fi,i=this.v0,r=this.v1,n=this.v2;return e.set(wg(t,i.x,r.x,n.x),wg(t,i.y,r.y,n.y)),e},Tg.prototype.copy=function(t){return cg.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this},Lg.prototype.getPoint=function(t,n){var e=n||new St,i=this.v0,r=this.v1,n=this.v2;return e.set(wg(t,i.x,r.x,n.x),wg(t,i.y,r.y,n.y),wg(t,i.z,r.z,n.z)),e},((Rg.prototype=Object.create(cg.prototype)).constructor=Rg).prototype.isSplineCurve=!0,Rg.prototype.getPoint=function(t,n){var e=n||new fi,i=this.points,r=(i.length-1)*t,o=Math.floor(r),s=r-o,n=i[0===o?o:o-1],t=i[o],r=i[o>i.length-2?i.length-1:o+1],o=i[o>i.length-3?i.length-1:o+2];return e.set(bg(s,n.x,t.x,r.x,o.x),bg(s,n.y,t.y,r.y,o.y)),e},Rg.prototype.copy=function(t){cg.prototype.copy.call(this,t),this.points=[];for(var n=0,e=t.points.length;n<e;n++){var i=t.points[n];this.points.push(i.clone())}return this},Og.prototype=Object.assign(Object.create(cg.prototype),{constructor:Og,add:function(t){this.curves.push(t)},closePath:function(){var t=this.curves[0].getPoint(0),n=this.curves[this.curves.length-1].getPoint(1);t.equals(n)||this.curves.push(new Sg(n,t))},getPoint:function(t){for(var n=t*this.getLength(),e=this.getCurveLengths(),i=0;i<e.length;){if(e[i]>=n){var r=e[i]-n,o=this.curves[i],s=o.getLength();return o.getPointAt(0===s?0:1-r/s)}i++}return null},getLength:function(){var t=this.getCurveLengths();return t[t.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 t=[],n=0,e=0,i=this.curves.length;e<i;e++)n+=this.curves[e].getLength(),t.push(n);return this.cacheLengths=t},getSpacedPoints:function(t){void 0===t&&(t=40);for(var n=[],e=0;e<=t;e++)n.push(this.getPoint(e/t));return this.autoClose&&n.push(n[0]),n},getPoints:function(t){t=t||12;for(var n,e=[],i=0,r=this.curves;i<r.length;i++)for(var o=r[i],s=o&&o.isEllipseCurve?2*t:o&&(o.isLineCurve||o.isLineCurve3)?1:o&&o.isSplineCurve?t*o.points.length:t,a=o.getPoints(s),u=0;u<a.length;u++){var h=a[u];n&&n.equals(h)||(e.push(h),n=h)}return this.autoClose&&1<e.length&&!e[e.length-1].equals(e[0])&&e.push(e[0]),e},copy:function(t){cg.prototype.copy.call(this,t),this.curves=[];for(var n=0,e=t.curves.length;n<e;n++){var i=t.curves[n];this.curves.push(i.clone())}return this.autoClose=t.autoClose,this}}),Ag.prototype=Object.assign(Object.create(Og.prototype),{constructor:Ag,setFromPoints:function(t){this.moveTo(t[0].x,t[0].y);for(var n=1,e=t.length;n<e;n++)this.lineTo(t[n].x,t[n].y);return this},moveTo:function(t,n){return this.currentPoint.set(t,n),this},lineTo:function(t,n){var e=new Sg(this.currentPoint.clone(),new fi(t,n));return this.curves.push(e),this.currentPoint.set(t,n),this},quadraticCurveTo:function(t,n,e,i){n=new Tg(this.currentPoint.clone(),new fi(t,n),new fi(e,i));return this.curves.push(n),this.currentPoint.set(e,i),this},bezierCurveTo:function(t,n,e,i,r,o){i=new xg(this.currentPoint.clone(),new fi(t,n),new fi(e,i),new fi(r,o));return this.curves.push(i),this.currentPoint.set(r,o),this},splineThru:function(t){var n=new Rg([this.currentPoint.clone()].concat(t));return this.curves.push(n),this.currentPoint.copy(t[t.length-1]),this},arc:function(t,n,e,i,r,o){var s=this.currentPoint.x,a=this.currentPoint.y;return this.absarc(t+s,n+a,e,i,r,o),this},absarc:function(t,n,e,i,r,o){return this.absellipse(t,n,e,e,i,r,o),this},ellipse:function(t,n,e,i,r,o,s,a){var u=this.currentPoint.x,h=this.currentPoint.y;return this.absellipse(t+u,n+h,e,i,r,o,s,a),this},absellipse:function(t,n,e,i,r,o,s,a){s=new fg(t,n,e,i,r,o,s,a);0<this.curves.length&&((a=s.getPoint(0)).equals(this.currentPoint)||this.lineTo(a.x,a.y)),this.curves.push(s);s=s.getPoint(1);return this.currentPoint.copy(s),this},copy:function(t){return Og.prototype.copy.call(this,t),this.currentPoint.copy(t.currentPoint),this}}),kg.prototype=Object.assign(Object.create(Ag.prototype),{constructor:kg,getPointsHoles:function(t){for(var n=[],e=0,i=this.holes.length;e<i;e++)n[e]=this.holes[e].getPoints(t);return n},extractPoints:function(t){return{shape:this.getPoints(t),holes:this.getPointsHoles(t)}},copy:function(t){Ag.prototype.copy.call(this,t),this.holes=[];for(var n=0,e=t.holes.length;n<e;n++){var i=t.holes[n];this.holes.push(i.clone())}return this}});var Cg=function(t,n,e){e=e||2;var i,r,o,s,a,u=n&&n.length,h=u?n[0]*e:t.length,c=jg(t,0,h,e,!0),f=[];if(!c||c.next===c.prev)return f;if(u&&(c=function(t,n,e,i){var r,o,s,a,u=[];for(r=0,o=n.length;r<o;r++)s=n[r]*i,a=r<o-1?n[r+1]*i:t.length,(a=jg(t,s,a,i,!1))===a.next&&(a.steiner=!0),u.push(function(t){var n=t,e=t;for(;(n.x<e.x||n.x===e.x&&n.y<e.y)&&(e=n),n=n.next,n!==t;);return e}(a));for(u.sort(Ig),r=0;r<u.length;r++)!function(t,n){(n=function(t,n){var e,i=n,r=t.x,o=t.y,s=-1/0;do{if(o<=i.y&&o>=i.next.y&&i.next.y!==i.y){var a=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(a<=r&&s<a){if((s=a)===r){if(o===i.y)return i;if(o===i.next.y)return i.next}e=i.x<i.next.x?i:i.next}}}while(i=i.next,i!==n);if(!e)return null;if(r===s)return e.prev;var u,h=e,c=e.x,f=e.y,l=1/0;i=e.next;for(;i!==h;)r>=i.x&&i.x>=c&&r!==i.x&&Fg(o<f?r:s,o,c,f,o<f?s:r,o,i.x,i.y)&&((u=Math.abs(o-i.y)/(r-i.x))<l||u===l&&i.x>e.x)&&Hg(i,t)&&(e=i,l=u),i=i.next;return e}(t,n))&&Pg(t=Vg(n,t),t.next)}(u[r],e),e=Pg(e,e.next);return e}(t,n,c,e)),t.length>80*e){for(var l=i=t[0],d=r=t[1],v=e;v<h;v+=e)(o=t[v])<l&&(l=o),(s=t[v+1])<d&&(d=s),i<o&&(i=o),r<s&&(r=s);a=0!==(a=Math.max(i-l,r-d))?1/a:0}return Dg(c,f,e,l,d,a),f};function jg(t,n,e,i,r){var o,s;if(r===0<function(t,n,e,i){for(var r=0,o=n,s=e-i;o<e;o+=i)r+=(t[s]-t[o])*(t[o+1]+t[s+1]),s=o;return r}(t,n,e,i))for(o=n;o<e;o+=i)s=zg(o,t[o],t[o+1],s);else for(o=e-i;n<=o;o-=i)s=zg(o,t[o],t[o+1],s);return s&&Bg(s,s.next)&&(Wg(s),s=s.next),s}function Pg(t,n){if(!t)return t;n=n||t;var e,i=t;do{if(e=!1,i.steiner||!Bg(i,i.next)&&0!==Ug(i.prev,i,i.next))i=i.next;else{if(Wg(i),(i=n=i.prev)===i.next)break;e=!0}}while(e||i!==n);return n}function Dg(t,n,e,i,r,o,s){if(t){!s&&o&&function(t,n,e,i){var r=t;for(;null===r.z&&(r.z=Ng(r.x,r.y,n,e,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next,r!==t;);r.prevZ.nextZ=null,r.prevZ=null,function(t){var n,e,i,r,o,s,a,u,h=1;do{for(e=t,o=t=null,s=0;e;){for(s++,i=e,n=a=0;n<h&&(a++,i=i.nextZ);n++);for(u=h;0<a||0<u&&i;)0!==a&&(0===u||!i||e.z<=i.z)?(e=(r=e).nextZ,a--):(i=(r=i).nextZ,u--),o?o.nextZ=r:t=r,r.prevZ=o,o=r;e=i}}while(o.nextZ=null,h*=2,1<s)}(r)}(t,i,r,o);for(var a,u,h=t;t.prev!==t.next;)if(a=t.prev,u=t.next,o?function(t,n,e,i){var r=t.prev,o=t,s=t.next;if(0<=Ug(r,o,s))return!1;var a=(r.x<o.x?r.x<s.x?r:s:o.x<s.x?o:s).x,u=(r.y<o.y?r.y<s.y?r:s:o.y<s.y?o:s).y,h=(r.x>o.x?r.x>s.x?r:s:o.x>s.x?o:s).x,c=(r.y>o.y?r.y>s.y?r:s:o.y>s.y?o:s).y,f=Ng(a,u,n,e,i),l=Ng(h,c,n,e,i),d=t.prevZ,v=t.nextZ;for(;d&&d.z>=f&&v&&v.z<=l;){if(d!==t.prev&&d!==t.next&&Fg(r.x,r.y,o.x,o.y,s.x,s.y,d.x,d.y)&&0<=Ug(d.prev,d,d.next))return!1;if(d=d.prevZ,v!==t.prev&&v!==t.next&&Fg(r.x,r.y,o.x,o.y,s.x,s.y,v.x,v.y)&&0<=Ug(v.prev,v,v.next))return!1;v=v.nextZ}for(;d&&d.z>=f;){if(d!==t.prev&&d!==t.next&&Fg(r.x,r.y,o.x,o.y,s.x,s.y,d.x,d.y)&&0<=Ug(d.prev,d,d.next))return!1;d=d.prevZ}for(;v&&v.z<=l;){if(v!==t.prev&&v!==t.next&&Fg(r.x,r.y,o.x,o.y,s.x,s.y,v.x,v.y)&&0<=Ug(v.prev,v,v.next))return!1;v=v.nextZ}return!0}(t,i,r,o):function(t){var n=t.prev,e=t,i=t.next;if(0<=Ug(n,e,i))return!1;var r=t.next.next;for(;r!==t.prev;){if(Fg(n.x,n.y,e.x,e.y,i.x,i.y,r.x,r.y)&&0<=Ug(r.prev,r,r.next))return!1;r=r.next}return!0}(t))n.push(a.i/e),n.push(t.i/e),n.push(u.i/e),Wg(t),t=u.next,h=u.next;else if((t=u)===h){s?1===s?Dg(t=function(t,n,e){var i=t;do{var r=i.prev,o=i.next.next}while(!Bg(r,o)&&Gg(r,i,i.next,o)&&Hg(r,o)&&Hg(o,r)&&(n.push(r.i/e),n.push(i.i/e),n.push(o.i/e),Wg(i),Wg(i.next),i=t=o),i=i.next,i!==t);return i}(t,n,e),n,e,i,r,o,2):2===s&&function(t,n,e,i,r,o){var s=t;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&function(t,n){return t.next.i!==n.i&&t.prev.i!==n.i&&!function(t,n){var e=t;do{if(e.i!==t.i&&e.next.i!==t.i&&e.i!==n.i&&e.next.i!==n.i&&Gg(e,e.next,t,n))return!0}while(e=e.next,e!==t);return!1}(t,n)&&Hg(t,n)&&Hg(n,t)&&function(t,n){var e=t,i=!1,r=(t.x+n.x)/2,o=(t.y+n.y)/2;for(;e.y>o!=e.next.y>o&&e.next.y!==e.y&&r<(e.next.x-e.x)*(o-e.y)/(e.next.y-e.y)+e.x&&(i=!i),e=e.next,e!==t;);return i}(t,n)}(s,a)){var u=Vg(s,a);return s=Pg(s,s.next),u=Pg(u,u.next),Dg(s,n,e,i,r,o),Dg(u,n,e,i,r,o)}a=a.next}}while(s=s.next,s!==t)}(t,n,e,i,r,o):Dg(Pg(t),n,e,i,r,o,1);break}}}function Ig(t,n){return t.x-n.x}function Ng(t,n,e,i,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-e)*r)|t<<8))|t<<4))|t<<2))|t<<1))|(n=1431655765&((n=858993459&((n=252645135&((n=16711935&((n=32767*(n-i)*r)|n<<8))|n<<4))|n<<2))|n<<1))<<1}function Fg(t,n,e,i,r,o,s,a){return 0<=(r-s)*(n-a)-(t-s)*(o-a)&&0<=(t-s)*(i-a)-(e-s)*(n-a)&&0<=(e-s)*(o-a)-(r-s)*(i-a)}function Ug(t,n,e){return(n.y-t.y)*(e.x-n.x)-(n.x-t.x)*(e.y-n.y)}function Bg(t,n){return t.x===n.x&&t.y===n.y}function Gg(t,n,e,i){return Bg(t,e)&&Bg(n,i)||Bg(t,i)&&Bg(e,n)||0<Ug(t,n,e)!=0<Ug(t,n,i)&&0<Ug(e,i,t)!=0<Ug(e,i,n)}function Hg(t,n){return Ug(t.prev,t,t.next)<0?0<=Ug(t,n,t.next)&&0<=Ug(t,t.prev,n):Ug(t,n,t.prev)<0||Ug(t,t.next,n)<0}function Vg(t,n){var e=new Xg(t.i,t.x,t.y),i=new Xg(n.i,n.x,n.y),r=t.next,o=n.prev;return(t.next=n).prev=t,(e.next=r).prev=e,(i.next=e).prev=i,(o.next=i).prev=o,i}function zg(t,n,e,i){e=new Xg(t,n,e);return i?(e.next=i.next,(e.prev=i).next.prev=e,i.next=e):(e.prev=e).next=e,e}function Wg(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Xg(t,n,e){this.i=t,this.x=n,this.y=e,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}var Zg={area:function(t){for(var n=t.length,e=0,i=n-1,r=0;r<n;i=r++)e+=t[i].x*t[r].y-t[r].x*t[i].y;return.5*e},isClockWise:function(t){return Zg.area(t)<0},triangulateShape:function(t,n){var e=[],i=[],r=[];Yg(t),qg(e,t);var o=t.length;n.forEach(Yg);for(var s=0;s<n.length;s++)i.push(o),o+=n[s].length,qg(e,n[s]);for(var a=Cg(e,i),s=0;s<a.length;s+=3)r.push(a.slice(s,s+3));return r}};function Yg(t){var n=t.length;2<n&&t[n-1].equals(t[0])&&t.pop()}function qg(t,n){for(var e=0;e<n.length;e++)t.push(n[e].x),t.push(n[e].y)}function Kg(t){return(Kg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Jg(t,n){Dr.call(this),this.type="ShapeGeometry","object"===Kg(n)&&(console.warn("THREE.ShapeGeometry: Options parameter has been removed."),n=n.curveSegments),this.parameters={shapes:t,curveSegments:n},this.fromBufferGeometry(new Qg(t,n)),this.mergeVertices()}function Qg(t,l){eo.call(this),this.type="ShapeBufferGeometry",this.parameters={shapes:t,curveSegments:l},l=l||12;var d=[],v=[],p=[],m=[],n=0,g=0;if(!1===Array.isArray(t))i(t);else for(var e=0;e<t.length;e++)i(t[e]),this.addGroup(n,g,e),n+=g,g=0;function i(t){var n,e=v.length/3,t=t.extractPoints(l),i=t.shape,r=t.holes;for(!1===Zg.isClockWise(i)&&(i=i.reverse()),s=0,a=r.length;s<a;s++)n=r[s],!0===Zg.isClockWise(n)&&(r[s]=n.reverse());for(var o=Zg.triangulateShape(i,r),s=0,a=r.length;s<a;s++)n=r[s],i=i.concat(n);for(s=0,a=i.length;s<a;s++){var u=i[s];v.push(u.x,u.y,0),p.push(0,0,1),m.push(u.x,u.y)}for(s=0,a=o.length;s<a;s++){var h=o[s],c=h[0]+e,f=h[1]+e,h=h[2]+e;d.push(c,f,h),g+=3}}this.setIndex(d),this.setAttribute("position",new Wr(v,3)),this.setAttribute("normal",new Wr(p,3)),this.setAttribute("uv",new Wr(m,2))}function $g(t,n){Dr.call(this),this.type="ExtrudeGeometry",this.parameters={shapes:t,options:n},this.fromBufferGeometry(new ty(t,n)),this.mergeVertices()}function ty(t,q){eo.call(this),this.type="ExtrudeBufferGeometry",this.parameters={shapes:t,options:q},t=Array.isArray(t)?t:[t];for(var K=this,J=[],Q=[],n=0,e=t.length;n<e;n++)!function(t){var i=[],n=void 0!==q.curveSegments?q.curveSegments:12,u=void 0!==q.steps?q.steps:1,e=void 0!==q.depth?q.depth:100,r=void 0===q.bevelEnabled||q.bevelEnabled,o=void 0!==q.bevelThickness?q.bevelThickness:6,s=void 0!==q.bevelSize?q.bevelSize:o-2,a=void 0!==q.bevelOffset?q.bevelOffset:0,h=void 0!==q.bevelSegments?q.bevelSegments:3,c=q.extrudePath,f=void 0!==q.UVGenerator?q.UVGenerator:ny;void 0!==q.amount&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),e=q.amount);var l,d,v,p,m,g,y,b,w=!1;c&&(l=c.getSpacedPoints(u),r=!(w=!0),d=c.computeFrenetFrames(u,!1),v=new St,p=new St,m=new St);r||(a=s=o=h=0);var n=t.extractPoints(n),_=n.shape,x=n.holes;if(!Zg.isClockWise(_))for(_=_.reverse(),y=0,b=x.length;y<b;y++)g=x[y],Zg.isClockWise(g)&&(x[y]=g.reverse());var M=Zg.triangulateShape(_,x),S=_;for(y=0,b=x.length;y<b;y++)g=x[y],_=_.concat(g);function E(t,n,e){return n||console.error("THREE.ExtrudeGeometry: vec does not exist"),n.clone().multiplyScalar(e).add(t)}var T,L,R,O,A,k,C=_.length,j=M.length;function P(t,n,e){var i=t.x-n.x,r=t.y-n.y,o=e.x-t.x,s=e.y-t.y,a=i*i+r*r;if(Math.abs(i*s-r*o)>Number.EPSILON){var u=Math.sqrt(a),h=Math.sqrt(o*o+s*s),c=n.x-r/u,f=n.y+i/u,u=((e.x-s/h-c)*s-(e.y+o/h-f)*o)/(i*s-r*o),f=(h=c+i*u-t.x)*h+(c=f+r*u-t.y)*c;if(f<=2)return new fi(h,c);u=Math.sqrt(f/2)}else{f=!1;i>Number.EPSILON?o>Number.EPSILON&&(f=!0):i<-Number.EPSILON?o<-Number.EPSILON&&(f=!0):Math.sign(r)===Math.sign(s)&&(f=!0),u=f?(h=-r,c=i,Math.sqrt(a)):(h=i,c=r,Math.sqrt(a/2))}return new fi(h/u,c/u)}for(var D=[],I=0,N=S.length,F=N-1,U=I+1;I<N;I++,F++,U++)F===N&&(F=0),U===N&&(U=0),D[I]=P(S[I],S[F],S[U]);var B,G,H=[],V=D.concat();for(y=0,b=x.length;y<b;y++){for(g=x[y],B=[],I=0,N=g.length,F=N-1,U=I+1;I<N;I++,F++,U++)F===N&&(F=0),U===N&&(U=0),B[I]=P(g[I],g[F],g[U]);H.push(B),V=V.concat(B)}for(T=0;T<h;T++){for(R=T/h,O=o*Math.cos(R*Math.PI/2),L=s*Math.sin(R*Math.PI/2)+a,I=0,N=S.length;I<N;I++)W((A=E(S[I],D[I],L)).x,A.y,-O);for(y=0,b=x.length;y<b;y++)for(g=x[y],B=H[y],I=0,N=g.length;I<N;I++)W((A=E(g[I],B[I],L)).x,A.y,-O)}for(L=s+a,I=0;I<C;I++)A=r?E(_[I],V[I],L):_[I],w?(p.copy(d.normals[0]).multiplyScalar(A.x),v.copy(d.binormals[0]).multiplyScalar(A.y),m.copy(l[0]).add(p).add(v),W(m.x,m.y,m.z)):W(A.x,A.y,0);for(G=1;G<=u;G++)for(I=0;I<C;I++)A=r?E(_[I],V[I],L):_[I],w?(p.copy(d.normals[G]).multiplyScalar(A.x),v.copy(d.binormals[G]).multiplyScalar(A.y),m.copy(l[G]).add(p).add(v),W(m.x,m.y,m.z)):W(A.x,A.y,e/u*G);for(T=h-1;0<=T;T--){for(R=T/h,O=o*Math.cos(R*Math.PI/2),L=s*Math.sin(R*Math.PI/2)+a,I=0,N=S.length;I<N;I++)W((A=E(S[I],D[I],L)).x,A.y,e+O);for(y=0,b=x.length;y<b;y++)for(g=x[y],B=H[y],I=0,N=g.length;I<N;I++)A=E(g[I],B[I],L),w?W(A.x,A.y+l[u-1].y,l[u-1].x+O):W(A.x,A.y,e+O)}function z(t,n){var e,i;for(I=t.length;0<=--I;){(i=(e=I)-1)<0&&(i=t.length-1);for(var r=0,o=u+2*h,r=0;r<o;r++){var s=C*r,a=C*(r+1);!function(t,n,e,i){Z(t),Z(n),Z(i),Z(n),Z(e),Z(i);i=J.length/3,i=f.generateSideWallUV(K,J,i-6,i-3,i-2,i-1);Y(i[0]),Y(i[1]),Y(i[3]),Y(i[1]),Y(i[2]),Y(i[3])}(n+e+s,n+i+s,n+i+a,n+e+a)}}}function W(t,n,e){i.push(t),i.push(n),i.push(e)}function X(t,n,e){Z(t),Z(n),Z(e);e=J.length/3,e=f.generateTopUV(K,J,e-3,e-2,e-1);Y(e[0]),Y(e[1]),Y(e[2])}function Z(t){J.push(i[3*t+0]),J.push(i[3*t+1]),J.push(i[3*t+2])}function Y(t){Q.push(t.x),Q.push(t.y)}(function(){var t=J.length/3;if(r){var n=0*C;for(I=0;I<j;I++)X((k=M[I])[2]+n,k[1]+n,k[0]+n);for(n=C*(u+2*h),I=0;I<j;I++)X((k=M[I])[0]+n,k[1]+n,k[2]+n)}else{for(I=0;I<j;I++)X((k=M[I])[2],k[1],k[0]);for(I=0;I<j;I++)X((k=M[I])[0]+C*u,k[1]+C*u,k[2]+C*u)}K.addGroup(t,J.length/3-t,0)})(),function(){var t=J.length/3,n=0;for(z(S,n),n+=S.length,y=0,b=x.length;y<b;y++)z(g=x[y],n),n+=g.length;K.addGroup(t,J.length/3-t,1)}()}(t[n]);this.setAttribute("position",new Wr(J,3)),this.setAttribute("uv",new Wr(Q,2)),this.computeVertexNormals()}(Jg.prototype=Object.create(Dr.prototype)).constructor=Jg,(Qg.prototype=Object.create(eo.prototype)).constructor=Qg,($g.prototype=Object.create(Dr.prototype)).constructor=$g,(ty.prototype=Object.create(eo.prototype)).constructor=ty;var ny={generateTopUV:function(t,n,e,i,r){var o=n[3*e],s=n[3*e+1],a=n[3*i],e=n[3*i+1],i=n[3*r],r=n[3*r+1];return[new fi(o,s),new fi(a,e),new fi(i,r)]},generateSideWallUV:function(t,n,e,i,r,o){var s=n[3*e],a=n[3*e+1],u=n[3*e+2],h=n[3*i],c=n[3*i+1],f=n[3*i+2],l=n[3*r],d=n[3*r+1],e=n[3*r+2],i=n[3*o],r=n[3*o+1],o=n[3*o+2];return Math.abs(a-c)<.01?[new fi(s,1-u),new fi(h,1-f),new fi(l,1-e),new fi(i,1-o)]:[new fi(a,1-u),new fi(c,1-f),new fi(d,1-e),new fi(r,1-o)]}},ey=new fi;function iy(t,n){this.min=void 0!==t?t:new fi(1/0,1/0),this.max=void 0!==n?n:new fi(-1/0,-1/0)}function ry(t){return function(t){if(Array.isArray(t))return oy(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,n){if(t){if("string"==typeof t)return oy(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(e="Object"===e&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?oy(t,n):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function oy(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}function sy(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function ay(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function uy(t,n,e){return n&&ay(t.prototype,n),e&&ay(t,e),t}Object.assign(iy.prototype,{set:function(t,n){return this.min.copy(t),this.max.copy(n),this},setFromPoints:function(t){this.makeEmpty();for(var n=0,e=t.length;n<e;n++)this.expandByPoint(t[n]);return this},setFromCenterAndSize:function(t,n){n=ey.copy(n).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.min.copy(t.min),this.max.copy(t.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(t){return void 0===t&&(console.warn("THREE.Box2: .getCenter() target is now required"),t=new fi),this.isEmpty()?t.set(0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(t){return void 0===t&&(console.warn("THREE.Box2: .getSize() target is now required"),t=new fi),this.isEmpty()?t.set(0,0):t.subVectors(this.max,this.min)},expandByPoint:function(t){return this.min.min(t),this.max.max(t),this},expandByVector:function(t){return this.min.sub(t),this.max.add(t),this},expandByScalar:function(t){return this.min.addScalar(-t),this.max.addScalar(t),this},containsPoint:function(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y},getParameter:function(t,n){return void 0===n&&(console.warn("THREE.Box2: .getParameter() target is now required"),n=new fi),n.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y)},clampPoint:function(t,n){return void 0===n&&(console.warn("THREE.Box2: .clampPoint() target is now required"),n=new fi),n.copy(t).clamp(this.min,this.max)},distanceToPoint:function(t){return ey.copy(t).clamp(this.min,this.max).sub(t).length()},intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}});var hy=function(){function f(){sy(this,f)}return uy(f,null,[{key:"getPointFromBound",value:function(t){var n=t.min.x,e=t.min.y,i=t.max.x,t=t.max.y;return[{x:n,y:e},{x:n,y:t},{x:i,y:e},{x:i,y:t}]}},{key:"getBoundFromPoint",value:function(t){for(var n=t[0].x,e=t[0].y,i=t[0].x,r=t[0].y,o=0;o<t.length;o++){var s=t[o];n>s.x&&(n=s.x),e>s.y&&(e=s.y),i<s.x&&(i=s.x),r<s.y&&(r=s.y)}return{max:{x:i,y:r},min:{x:n,y:e},size:{x:i-n,y:r-e}}}},{key:"getRotationBound",value:function(t,n){for(var e=new St(0,1,0),i=(new Et).makeRotationAxis(e,n.getRotation()*Math.PI/180),r=f.getPointFromBound(t),o=[],s=0;s<r.length;s++){var a=(a=new St(r[s].x-n.x,0,n.y-r[s].y)).applyMatrix4(i);o.push(a)}for(var u=[],h=0;h<r.length;h++){var c=o[h];u.push({x:c.x+n.x,y:n.y-c.z})}return f.getBoundFromPoint(u)}}]),f}(),cy=function(){function g(){sy(this,g)}return uy(g,null,[{key:"showFloorNode",value:function(t,n){for(var e=0;e<n.K.length;e++){var i=n.K[e];if(-1<t.getVisibleLevels().indexOf(n.level))for(var r=0;r<i.K.length;r++){var o=i.K[r];o.jn||1!=o.visible||t.Zt.jf.push([e,o])}}}},{key:"showAllNode",value:function(n){for(n.getLevels().forEach(function(t){g.showFloorNode(n,n.getFloor(t))});0<n.Zt.jf.length;)n.Zt.Pf()}},{key:"recoveAllNode",value:function(t){t.enableUpdateNode(),t.Zt.Df()}},{key:"setVisibleLevelsFrustumCulled",value:function(t,n){for(var e=t.cn,i=t.getVisibleLevels(),r=0;r<i.length;r++){var o=i[r]+"_"+Ii.LABEL,s=i[r]+"_"+Ii.FACILITY,a=i[r]+"_"+Ii.TEXT_MARKER,u=i[r]+"_"+Ii.IMAGE_MARKER,h=e.Te.get(o),o=e.Te.get(s),s=e.Te.get(a),a=e.Te.get(u),u=[];h&&h.children&&u.push.apply(u,ry(h.children)),o&&o.children&&u.push.apply(u,ry(o.children)),s&&s.children&&u.push.apply(u,ry(s.children)),a&&a.children&&u.push.apply(u,ry(a.children)),u.forEach(function(t){t.frustumCulled=n})}}},{key:"setValue",value:function(t,n,e){e[t]=n}},{key:"getValue",value:function(t,n){return n[t]}},{key:"addLastFrame",value:function(n,e){var i=window.devicePixelRatio||1,t=n.cn.renderer,r=t.domElement.parentElement,o=t.domElement.clientWidth,s=t.domElement.clientHeight,a=document.createElement("canvas");a.width=o*i,a.height=s*i,a.style.width=o+"px",a.style.height=s+"px",a.style.position="absolute",a.style.zIndex=1,a.className="exportImageLastFrame";var u=a.getContext("2d"),h=new Image;h.onload=function(t){u.drawImage(t.path[0],0,0,o*i,s*i),r.append(a),n.It.Dt({type:"printBefor"}),e()},h.onerror=function(t){console.warn("fail...",t)},n.cn.render(),h.src=t.domElement.toDataURL()}},{key:"removeLastFrame",value:function(t){var n=t.cn.renderer,e=document.querySelector(".exportImageLastFrame"),n=n.domElement.parentElement;n&&e&&n.removeChild(e),t.It.Dt({type:"printAfter"})}},{key:"start",value:function(t){var n={callback:null,viewParam:{width:0,height:0},state:{col:0,row:0,loadCount:0},camera:null,backCamera:null,width:0,height:0,padding:0,canvas:null,renderTarget:null,cameraType:null,defaultLogoAspact:null},e=t.padding,i=t.map,r=t.imageWidth,o=t.imageHieght,s=t.callback,a=t.bound,u=t.cameraType;a&&(g.setValue("originBound",{max:{x:a.max.x,y:a.max.y},min:{x:a.min.x,y:a.min.y}},n),a.size||(a.size.x=a.max.x-a.min.x,a.size.y=a.max.y-a.min.y),t=r/a.size.x,h=o/a.size.y,a=hy.getRotationBound(a,i),Math.abs(h-t)<.1&&(r=a.size.x*t,o=a.size.y*h)),g.setValue("mapZoom",i.getZoom(),n),g.setValue("cameraType",u||"2d",n),g.setValue("backCamera","2d"==n.cameraType?i.jt:{aspect:i.jt.aspect},n);var h=r/o;15e3<(o=15e3<r?+(r=15e3)/h:o)&&(r=(o=15e3)*h),e=e||0,e*=2,r=Math.ceil(r),o=Math.ceil(o),g.setValue("width",r,n),g.setValue("height",o,n);u=i.cn.renderer.domElement.clientWidth,h=i.cn.renderer.domElement.clientHeight;g.setValue("defaultLogoAspact",u/h,n),g.setValue("domSize",{width:u,height:h},n),g.setValue("padding",e,n),g.setValue("callback",s,n);u={width:r,height:o};4096<u.width&&(u.width=4096),4096<u.height&&(u.height=4096),g.setValue("viewParam",u,n);h=Math.ceil(r/n.viewParam.width),s=Math.ceil(o/n.viewParam.height);g.setValue("state",{col:h,row:s,loadCount:0},n);s=document.createElement("canvas");s.width=r,s.height=o,s.style.width=r+"px",s.style.height=o+"px",g.setValue("canvas",s,n),"2d"==n.cameraType?(a=g.getCameraParame2d(i,r,o,a,e,void 0,n),g.setValue("camera",a,n),i.jt=a):"3d"==n.cameraType&&g.setCameraParame3d(i,r,o,null,e,n),i.cn.renderer.setPixelRatio(1),i.cn.renderer.setSize(u.width,u.height),i.It.Dt({type:"viewModeChanged"}),g.shot(i,s,n)}},{key:"print",value:function(t){g.addLastFrame(t.map,function(){g.start(t)})}},{key:"recoverParam",value:function(t,n){"2d"===n.cameraType?(t.jt=g.getValue("backCamera",n),t.an=t.jt):"3d"===n.cameraType&&(i=g.getValue("backCamera",n),t.jt.aspect=i.aspect,t.jt.clearViewOffset());var e=g.getValue("domSize",n),i=window.devicePixelRatio||1;t.cn.renderer.setPixelRatio(i),t.cn.renderer.setSize(e.width,e.height),t.It.Dt({type:"viewModeChanged"}),g.recoveAllNode(t,n),g.setLogo(t,g.getValue("defaultLogoAspact",n)),t.Z.Ct.object=t.jt,g.setVisibleLevelsFrustumCulled(t,!0),t.cn.hn(),t.cn.Ci=!0,t.cn.renderer.clear(),t.cn.render(),t.enableUpdateNode(),g.removeLastFrame(t)}},{key:"getCameraParame2d",value:function(t,n,e,i,r,o,s){var a,u,h,c,f,l,d,v=Math.min(n,e),p=o||(v-r)/v,o=t.getState(),r=i.min,v=i.max,i=Math.abs(v.x-r.x),v=Math.abs(v.y-r.y);Math.abs(i/v-n/e)<.05?h=i<v?(m=-v/2,a=v/2,u=-i/(r=v/i)/2/(h=n/e),i/r/2/h):(m=-v/2,a=v/2,u=-i/(f=i/v)/2/(c=e/n),i/f/2/c):i<v?h=e<n?(m=-v/2,a=v/2,u=-i/(f=i/v)/2/(c=e/n),i/f/2/c):(m=-v/2/(l=n/e),a=v/2/l,u=-i/(l=i/v)/2,i/l/2):v<=i&&(h=e<=n?(m=-v/2,a=v/2,u=-i/2/(l=e/n)/(d=i/v),i/2/l/d):(m=-v/2*(d=i/v)/(e=n/e),a=v/2*d/e,u=-i/2,i/2));var m=new q(u,h,a,m,1,1e4);m.zoom=p,m.up=new St(0,1,0),m.rotation.x=-Math.PI/2,m.rotation.y=0,m.rotation.z=-o.rotation*Math.PI/180;p=t.getBound().center,o=g.getValue("originBound",s),s=(o.max.x+o.min.x)/2-p.x,p=(o.max.y+o.min.y)/2-p.y;return m.position.x=s,m.position.y=t.jt.position.y,m.position.z=-p,m.updateProjectionMatrix(),m.updateMatrix(),m.updateMatrixWorld(),m.updateWorldMatrix(),m.matrixWorldNeedsUpdate=!0,m}},{key:"setCameraParame3d",value:function(t,n,e,i,r,o){t.jt.aspect=n/e,g.setValue("camera",t.jt,o)}},{key:"readPixcel",value:function(e,i,r,o){var t=g.getValue("state",o),s=t.row,a=t.col,n=e.cn.renderer,u=g.getValue("canvas",o),t=g.getValue("viewParam",o),h=t.width,c=t.height,f=u.getContext("2d"),t=document.createElement("canvas");t.width=h,t.height=c;var l=t.getContext("2d"),d=g.getValue("callback",o),t=new Image;t.onload=function(t){var n=g.getValue("state",o);n.loadCount++,g.setValue("state",n,o),l.drawImage(t.path[0],0,0,h,c),f.putImageData(l.getImageData(0,0,h,c),i,r),n.loadCount===s*a&&(u.toBlob(function(t){d&&d(t),t=null}),g.recoverParam(e,o),o.callback=null,o.viewParam=null,o.state=null,o.camera=null,o.backCamera=null,o.canvas=null,o=null)},e.cn.render(),t.src=n.domElement.toDataURL()}},{key:"setLogo",value:function(t,n){t.cn.needLogo&&(n=Math.min(n,1),t.cn.Oi.material.uniforms.offset.value.x=-1*(.5*.4/n-1))}},{key:"caleAvoid",value:function(t,n){var e,i;"2d"==t.cameraType||t.cameraType,"2d"==t.cameraType?(g.showAllNode(n,t),e=g.getValue("width",t),i=g.getValue("height",t),n.cn.renderer.setSize(e,i),n.cn.hn(),n.cn.$i(),t=g.getValue("viewParam",t),n.cn.renderer.setSize(t.width,t.height)):(n.cn.hn(),n.cn.$i())}},{key:"shot",value:function(t,n,e){g.setLogo(t,e.width/e.height);var i=g.getValue("camera",e);t.cn.Ci=!0,g.setVisibleLevelsFrustumCulled(t,!1);var r=g.getValue("state",e),o=r.row,s=r.col,a=g.getValue("viewParam",e);g.caleAvoid(e,t);for(var u=0;u<o*s;u++){var h=Math.floor(u/s),c=Math.max(u-h*s,0),f=n.width,l=n.height,d=new Image;d.indexI=h,d.indexJ=c;c=a.width*d.indexJ,d=a.height*d.indexI;i.setViewOffset(f,l,c,d,a.width,a.height),i.updateProjectionMatrix(),g.readPixcel(t,c,d,e)}}}]),g}();function fy(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function ly(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function dy(t,n,e){return n&&ly(t.prototype,n),e&&ly(t,e),t}var vy=function(){function o(){fy(this,o)}return dy(o,null,[{key:"getRenderNode",value:function(t){var n=null;if(t)return t.getRenderNode?n=t.getRenderNode():t.jn&&(n=t.jn),n}},{key:"downLoad",value:function(t){var n,e=new FileReader;e.readAsDataURL(t),e.onload=function(t){(n=t.target.result).length<6||((t=document.createElement("a")).download=(new Date).getTime()+".jpg",t.href=n,document.body.appendChild(t),t.click(),t.remove())}}},{key:"setLogo",value:function(t,n){t.cn.needLogo&&(n=Math.min(n,1),t.cn.Oi.material.uniforms.offset.value.x=-1*(.5*.4/n-1))}},{key:"setVisibleLevelsFrustumCulled",value:function(t,n,e){this.forEachElement(t,n,function(t){t=o.getRenderNode(t);t&&(t.frustumCulled=e)})}},{key:"byZoomUpdateVisible",value:function(t,r,o){t.cn.Te.forEach(function(t,n){if(+n.split("_")[0]===o)for(var e=0;e<t.children.length;e++){var i=t.children[e];("Mesh"===i.type||"Scene"===i.type||"Sprite"===i.type)&&i.mapNode.Bn&&i.mapNode.Ee&&i.mapNode.Ee.maxlevel&&(r<i.mapNode.Ee.maxlevel&&r>=i.mapNode.Ee.minlevel||!i.mapNode.Ee.maxlevel?i.visible=!0:i.visible=!1)}})}},{key:"recoveAllNode",value:function(t){for(t.enableUpdateNode(),t.Zt.Df();0<t.Zt.jf.length;)t.Zt.Pf()}},{key:"addLastFrame",value:function(t,n){var e=window.devicePixelRatio||1,i=t.cn.renderer,r=i.domElement.parentElement,o=i.domElement.clientWidth,s=i.domElement.clientHeight,a=document.createElement("canvas");a.width=o*e,a.height=s*e,a.style.width=o+"px",a.style.height=s+"px",a.style.position="absolute",a.style.zIndex=0,a.className="exportImageLastFrame";var u=a.getContext("2d"),h=new Image;h.crossOrigin="Anonymous",h.onload=function(){u.drawImage(h,0,0,o*e,s*e),r.append(a),t.It.Dt({type:"printBefor"}),n()},h.onerror=function(t){console.warn("fail...",t)},t.cn.render(),h.src=i.domElement.toDataURL()}},{key:"insideBound",value:function(t,n){var e=!1;return e=t.min.x>=n.min.x&&t.min.y>=n.min.y&&t.max.x<=n.max.x&&t.max.y<=n.max.y?!0:e}},{key:"forEachElement",value:function(t,n,e){for(var i=t.getFloor(n),r=0;r<i.K.length;r++)for(var o=i.K[r],s=0;s<o.K.length;s++)e(o.K[s])}},{key:"getInBoundSpriteElement",value:function(t,n,e,i){var r=this;this.forEachElement(t,n,function(t){var n=o.getRenderNode(t);n&&"Sprite"===n.type&&r.insideBound(t.bound,e)&&i.push(t)})}},{key:"getElementBound",value:function(t){var n=new rr;return t.forEach(function(t){n.expand(t.bound)}),n}}]),o}(),py=function(){function c(){fy(this,c)}return dy(c,null,[{key:"getSpriteWorldSize",value:function(t,n,e,i){if(t.parent.isHasText){var r=t.getScreenSize();if(!r||isNaN(r.width)||isNaN(r.height))return null;s=r.width,o=r.height}else var o,r=vy.getRenderNode(t).material.userData.scaleRatio||1,s=(o=t.Xi)/r;return{x:s*Math.abs(n.left-n.right)/n.zoom/i,y:o*Math.abs(n.top-n.bottom)/n.zoom/e}}},{key:"getSpriteBound",value:function(t,n,e,i){var r={},o={};t=Math.ceil(t),n=Math.ceil(n);var s=new rr;return r.x=e.x-i.x*t,o.x=e.x+(1-i.x)*t,o.y=e.y-i.y*n,r.y=e.y+(1-i.y)*n,s.expandByCoords([r,o]),s}},{key:"calcElements",value:function(t,n,e,i,r){for(var o=0;o<t.length;o++){var s,a,u=t[o],h=vy.getRenderNode(u);h&&"Sprite"===h.type&&((s=c.getSpriteWorldSize(u,e,i,r))&&(a=void 0,a=u.getAnchor?u.getAnchor():h.center,a=c.getSpriteBound(s.x,s.y,u.bound.center,a),isNaN(a.size.x)||isNaN(a.size.y)||a.size.x===1/0||a.size.y===1/0||n.expand(a)))}}},{key:"getWidthSpriteBound",value:function(t,n,e,i,r){this.calcElements(t,r,n,e,i)}}]),c}(),my=function(){function e(){fy(this,e)}return dy(e,null,[{key:"createCamera",value:function(){var t=new q(-1,1,1,-1,1,1e4);return t.up=new St(0,1,0),t}},{key:"updateCamera",value:function(t,n,e,i,r){var o;r.left=-n/2,r.right=n/2,r.top=e/2,r.bottom=-e/2,o=n/e>i.size.x/i.size.y?e/i.size.y:n/i.size.x,r.rotation.x=-Math.PI/2,r.rotation.y=0;e=t.K[0].x,n=t.K[0].y,e=i.center.x-e,i=n-i.center.y;r.position.x=e,r.position.y=(t.getLevels().length+1)*t.getFloorSpace(),r.position.z=i,r.zoom=o,r.updateProjectionMatrix(),r.updateMatrixWorld()}},{key:"readOptions",value:function(t,n,e){e.autoDownload=void 0===e.autoDownload||e.autoDownload,e.isExpandbound=void 0===e.isExpandbound||e.isExpandbound,e.padding=void 0!==e.padding?e.padding:5,e.color=void 0!==e.color?e.color:"rgba(255, 255, 255, 1.0)",e.imageWidth=void 0!==e.width?e.width:1e3,e.imageHeight=void 0!==e.height?e.height:1e3,delete e.width,delete e.height;15e3<e.imageWidth&&(e.imageWidth=15e3),15e3<e.imageHeight&&(e.imageHeight=15e3),e.imageWidth<200&&(e.imageWidth=200),e.imageHeight<200&&(e.imageHeight=200),e.imageWidth=Math.ceil(e.imageWidth),e.imageHeight=Math.ceil(e.imageHeight),e.level=void 0!==e.level?e.level:1,e.oldLevel=t.getLevel(),e.bound=n,e.map=t}},{key:"initOptions",value:function(t){(t=Object.assign(t,{renderSizeMap:{width:null,height:null},renderSizeExport:{width:0,height:0},camera:null,backCamera:null,imageRenderSize:{width:null,height:null}})).renderSizeMap={width:t.map.cn.renderer.domElement.clientWidth,height:t.map.cn.renderer.domElement.clientHeight},t.imageRenderSize={width:t.imageWidth-2*t.padding,height:t.imageHeight-2*t.padding},t.renderSizeExport={width:t.imageRenderSize.width,height:t.imageRenderSize.height};2048<t.renderSizeExport.width&&(t.renderSizeExport.width=2048),2048<t.renderSizeExport.height&&(t.renderSizeExport.height=2048),t.backCamera=t.map.camera,t.camera=this.createCamera()}},{key:"findSpriteElement",value:function(t,n,e){var i=[];return vy.getInBoundSpriteElement(t,n,e,i),i}},{key:"expandBoundBySprite",value:function(t,n){for(var e=n.bound.clone(),i=0;i<100&&(this.updateCamera(n.map,n.imageRenderSize.width,n.imageRenderSize.height,e,n.camera),py.getWidthSpriteBound(t,n.camera,n.imageRenderSize.height,n.imageRenderSize.width,e),!(15e3<e.size.x||15e4<e.size.y));i++);var r=n.bound.clone();return r.expand(e),r}},{key:"addLastFrame",value:function(t,n){vy.addLastFrame(t,n)}},{key:"caleAvoid",value:function(t){vy.byZoomUpdateVisible(t.map,t.map.getZoom(),t.level),t.map.cn.renderer.setPixelRatio(1),e.showAllLevelNode(t.map,t.level),t.map.cn.renderer.setSize(t.imageRenderSize.width,t.imageRenderSize.height),t.map.cn.hn(),t.map.cn.Ci=!0,t.map.cn.$i(),vy.forEachElement(t.map,t.level,function(t){t.updateSize?t.updateSize():t.Yi&&t.Yi()}),t.map.cn.renderer.setSize(t.renderSizeExport.width,t.renderSizeExport.height)}},{key:"start",value:function(t,n){var e=t.map,i=t.imageRenderSize,r=t.renderSizeExport,o=t.camera;vy.setLogo(e,i.width/i.height),vy.setVisibleLevelsFrustumCulled(e,t.level,!1),this.caleAvoid(t);var s=document.createElement("canvas");s.width=t.imageWidth,s.height=t.imageHeight,s.style.width=t.imageWidth+"px",s.style.height=t.imageHeight+"px";var a=s.getContext("2d");a.fillStyle=t.color,a.fillRect(0,0,t.imageWidth,t.imageHeight);var u={col:0,row:0,loadCount:0};if(u.col=Math.ceil(t.imageRenderSize.width/t.renderSizeExport.width),u.row=Math.ceil(t.imageRenderSize.height/t.renderSizeExport.height),isNaN(u.col)||isNaN(u.row))n(null);else for(var h=0;h<u.row*u.col;h++){var c=Math.floor(h/u.col),f=Math.max(h-c*u.col,0),f=r.width*f,c=r.height*c;o.setViewOffset(i.width,i.height,f,c,r.width,r.height),o.updateProjectionMatrix(),this.renderImage(f,c,u,s,a,n,t)}}},{key:"renderDomMarker",value:function(s){if(s.dependent&&s.dependent.html2canvas){s.camera.view=null,this.updateCamera(s.map,s.width,s.height,s.bound,s.camera);var t=s.width/2,n=s.height/2,e=new St,i=new Et,r=new Et;i.copy(s.camera.matrixWorldInverse),r.multiplyMatrices(s.camera.projectionMatrix,i);for(var a=[],o=[],u=s.map.If,h=0;h<u.K.length;h++){var c=u.K[h];c.level===s.level&&(e.setFromMatrixPosition(c.jn.matrixWorld),e.applyMatrix4(r),a.push({x:e.x*t+t,y:-e.y*n+n}),c=s.dependent.html2canvas(c.jn.element.childNodes[0],{backgroundColor:null}),o.push(c))}0!=o.length?Promise.all(o).then(function(r){for(var o=0,t=0;t<r.length;t++)!function(t){var n=r[t],e=a[t],i=new Image;i.onload=function(){o+=1,s.ctxAll.drawImage(i,e.x-n.width/2,e.y-n.height/2),o===r.length&&s.callback(s.canvasAll)},i.onerror=function(t){(o+=1)===r.length&&s.callback(s.canvasAll),console.error(t)},i.src=n.toDataURL("image/png")}(t)}).catch(function(t){console.error(t),s.callback(s.canvasAll)}):s.callback(s.canvasAll)}else s.callback(s.canvasAll)}},{key:"renderImage",value:function(t,n,e,i,r,o,s){var a=this,u=s.map,h=s.padding,c=s.renderSizeExport,f=document.createElement("canvas");f.width=c.width,f.height=c.height;var l=f.getContext("2d"),d=new Image;d.crossOrigin="Anonymous",d.onload=function(){e.loadCount++,l.drawImage(d,0,0,c.width,c.height),r.putImageData(l.getImageData(0,0,c.width,c.height),t+h,n+h),e.loadCount===e.row*e.col&&a.renderDomMarker({ctxAll:r,level:s.level,canvasAll:i,map:s.map,width:s.imageWidth,height:s.imageHeight,camera:s.camera,dependent:s.dependent,bound:s.bound,callback:function(t){t.toBlob(function(t){s.autoDownload&&vy.downLoad(t),o(t)})}})},u.cn.render(),d.src=u.cn.renderer.domElement.toDataURL()}},{key:"recoverParam",value:function(t){var n=t.map;n.jt=t.backCamera;var e=t.renderSizeMap,i=window.devicePixelRatio||1;n.cn.renderer.setSize(e.width,e.height),n.cn.renderer.setPixelRatio(i),vy.forEachElement(n,t.level,function(t){t.updateSize?t.updateSize():t.Yi&&t.Yi()}),vy.recoveAllNode(n,t),vy.setLogo(n,e.width/e.height),n.Z.Ct.object=n.jt,vy.setVisibleLevelsFrustumCulled(n,t.level,!0),n.cn.hn(),n.cn.Ci=!0,n.enableUpdateNode()}},{key:"showFloorNode",value:function(t,n){for(var e=0;e<n.K.length;e++){var i=n.K[e];if(-1<n.parent.visibleLevels.indexOf(n.level))for(var r=0;r<i.K.length;r++){var o=i.K[r];vy.getRenderNode(o)||1!=o.visible||t.Zt.jf.push([e,o])}}}},{key:"removeLastFrame",value:function(t){var n=t.cn.renderer.domElement.parentElement;n&&n.childNodes.forEach(function(t){"exportImageLastFrame"===t.className&&n.removeChild(t)}),t.It.Dt({type:"printAfter"})}},{key:"showAllLevelNode",value:function(t,n){for(e.showFloorNode(t,t.getFloor(n));0<t.Zt.jf.length;)t.Zt.Pf()}}]),e}();function gy(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var yy=!1,by=0,wy=function(){function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t)}var n,e,i;return n=t,i=[{key:"coordsMapToScreen",value:function(t,n){var e=void 0!==n.height?n.height:0,i=t.getMapOptions().buildingID;n.buildingID&&(i=n.buildingID);var r=t.getBuilding(i),i=(void 0!==n.level?n:r).level,i=void 0!==n.z?n.z:r.getFloor(i).Jt;return this.coordsMapToScreen_(t,{x:n.x,y:n.y,z:i+e})}},{key:"coordsScreenToMap",value:function(t,n,e){var i=(void 0!==n.buildingID?n:t.getMapOptions()).buildingID,r=t.getBuilding(i),o=t.qt,s=(void 0!==n.level?n:r).level,a=void 0!==n.z?n.z:r.getFloor(s).Jt,u=null,h=t.cn.renderer.domElement.clientWidth,i=t.cn.renderer.domElement.clientHeight,r=new St,s=new St;(u=e||t.Z.Ct.object).isPerspectiveCamera?(u.updateMatrixWorld(),r.setFromMatrixPosition(u.matrixWorld),e=n.x/h*2-1,t=-n.y/i*2+1,s.set(e,t,u.near).unproject(u).sub(r).normalize()):(h=n.x/h*2-1,c=-n.y/i*2+1,r.set(h,c,(u.near+u.far)/(u.near-u.far)).unproject(u),s.set(0,0,-1).transformDirection(u.matrixWorld));var c=(-r.y+a)/s.y;c<0&&(c=u.far);c=(new St).copy(r).add((new St).copy(s).multiplyScalar(c));return{x:c.x+o.x,y:o.y-c.z,z:a}}},{key:"screenshot",value:function(t,n,e,i,s,a){var u=e.x-n.x,h=e.y-n.y,r=(e.x+n.x)/2,o=(e.y+n.y)/2,c=t.cn.renderer.domElement.style.width,f=t.cn.renderer.domElement.style.height,l=c.split("p")[0],d=f.split("p")[0],v=null,v=(e.x-n.x)/(e.y-n.y)>l/d?l/(e.x-n.x):d/(e.y-n.y),n=r-l/2,r=o-d/2,o=document.getElementsByTagName("canvas")[0],p=document.createElement("canvas"),m=document.createElement("canvas"),g=document.createElement("canvas"),y=window.devicePixelRatio,b=new Image;t.getViewMode(),t.jt.setViewOffset(l*v,d*v,l*(v-1)/2+n*v,d*(v-1)/2+r*v,l,d),t.cn.render(),p.width=u*v*y,p.height=h*v*y,p.style.width=u*v*y+"px",p.style.height=h*v*y+"px",i?(m.width=1240*Math.pow(1.414,s-1),m.height=1754*Math.pow(1.414,s-1),m.style.width=1240*Math.pow(1.414,s-1)+"px",m.style.height=1754*Math.pow(1.414,s-1)+"px"):(m.height=1240*Math.pow(1.414,s-1),m.width=1754*Math.pow(1.414,s-1),m.style.height=1240*Math.pow(1.414,s-1)+"px",m.style.width=1754*Math.pow(1.414,s-1)+"px"),g.height=h*Math.pow(1.414,s-1),g.width=u*Math.pow(1.414,s-1),g.style.height=h*Math.pow(1.414,s-1)+"px",g.style.width=u*Math.pow(1.414,s-1)+"px",b.src=o.toDataURL("image/png"),(t.getViewMode()===gi.PERSPECTIVE?t.ln:t.an).clearViewOffset();var w=p.getContext("2d"),_=m.getContext("2d"),x=g.getContext("2d");b.onload=function(){t.getViewMode(),w.drawImage(b,-(l*y-u*v*y)/2,-(d*y-h*v*y)/2);var o=new Image;o.src=p.toDataURL("image/png"),o.onload=function(){var t=Math.min(1240*Math.pow(1.414,s-1)/(u*v),1754*Math.pow(1.414,s-1)/(h*v)),n=(m.width-u*v*t)/2,e=(m.height-h*v*t)/2;_.drawImage(o,n,e,u*v*t,h*v*t),x.drawImage(o,0,0,u*Math.pow(1.414,s-1),h*Math.pow(1.414,s-1));var i=m.toDataURL("image/png"),r=g.toDataURL("image/png");-1<navigator.userAgent.indexOf("Edge")||-1<navigator.userAgent.indexOf(".NET4.0C")?a(i,null,r,null):m.toBlob(function(n){return g.toBlob(function(t){return a(i,n,r,t)})})}}}},{key:"print",value:function(t,n){var e=this;yy=!0;var i=t.getZoom();t.setZoom({animate:!0,zoom:29});var r=t.Z.Ct.target.x,o=t.Z.Ct.target.z;t.Z.Ct.panAdd({x:-r,z:-o,y:0});var s=t.getTilt(),a=t.getRotation(),u=document.createElement("canvas");u.width=6*t.cn.renderer.domElement.width,u.height=6*t.cn.renderer.domElement.height,t.setTilt({tilt:90,finish:function(){t.setRotation({rotation:0})}}),t.getViewMode()===gi.MODE_3D?t.setViewMode({mode:gi.MODE_2D,callback:function(){return e.shot_(t,u,u.getContext("2d"),0,t.an.zoom,r,o,i,gi.MODE_3D,s,a,n)}}):this.shot_(t,u,u.getContext("2d"),0,t.an.zoom,r,o,i,gi.MODE_2D,s,a,n)}},{key:"export",value:function(t){var n;void 0!==t.imageWidth&&void 0!==t.imageHieght&&(n=t.map.getViewMode(),void 0===t.mode?t.cameraType=n===gi.MODE_2D?"2d":"3d":t.cameraType=t.mode===gi.MODE_2D?"2d":"3d",n==gi.MODE_2D&&t.mode===gi.MODE_3D||cy.print(t))}},{key:"coordsMapToScreen_",value:function(t,n){var e=t.qt,i=t.Z.Ct.object,e=new St(n.x-e.x,n.z,-n.y+e.y).project(i),i=t.cn.renderer.domElement.clientWidth,t=t.cn.renderer.domElement.clientHeight;return e.z<-1||1<e.z?null:{x:Math.round(i/2*e.x+i/2),y:Math.round(-t/2*e.y+t/2)}}},{key:"shot_",value:function(e,i,r,t,o,s,a,u,h,c,f,l){if(yy&&t<36){var n=null,d=null;t<6?(n=0,d=+t):t<12?(n=1,d=t-6):t<18?(n=2,d=t-12):t<24?(n=3,d=t-18):t<30?(n=4,d=t-24):t<36&&(n=5,d=t-30);var v=e.cn.renderer.domElement.width,p=e.cn.renderer.domElement.height,m=new Image;return m.indexI=n,m.indexJ=d,e.an.setViewOffset(v,p,2.5*-v+v*n,2.5*-p+p*d,v,p),e.an.updateProjectionMatrix(),m.onload=function(t){by++;var n=(n=t.target)||t.path[0];r.drawImage(n,v*n.indexI,p*n.indexJ),36===by&&(i.toBlob(function(t){e.an.zoom=6*o,e.an.updateProjectionMatrix(),e.setViewMode({mode:h,callback:function(){e.setRotation({rotation:f,finish:function(){e.setTilt({tilt:c})}})}}),e.setZoom({zoom:u}),e.an.clearViewOffset(),e.cn.Ln(),e.Z.Ct.panAdd({x:s,z:a,y:0}),e.cn.hn(),e.Z.Ct.update(),e.cn.render(),yy=!1,l(t)}),by=0)},e.cn.hn(),e.Z.Ct.update(),e.cn.render(),m.src=e.cn.renderer.domElement.toDataURL(),this.shot_(e,i,r,++t,o,s,a,u,h,c,f,l)}}},{key:"exportToImage",value:function(r,o,s,a,u){my.readOptions(r,o,s=s||{}),my.initOptions(s),s.renderSizeExport.width<=0||s.renderSizeExport.height<=0?u&&u():my.addLastFrame(s.map,function(){var n=s.map.getLevel(),e=s.map.getVisibleLevels();s.map.cn.renderer.domElement.style.opacity="0",s.map.toolBar&&(s.map.toolBar.enable=!1);function i(){var t;!0===s.isExpandbound&&(t=my.findSpriteElement(s.map,s.level,s.bound),o=my.expandBoundBySprite(t,s)),my.updateCamera(s.map,s.imageRenderSize.width,s.imageRenderSize.height,o,s.camera),s.map.camera=s.camera,my.start(s,function(t){my.recoverParam(s),s.map.cn.renderer.domElement.style.opacity="1",s.map.setVisibleLevels(e),s.map.setLevel({level:n,animate:!1,finish:function(){my.showAllLevelNode(s.map,s.oldLevel),s.map.cn.render(),s.map.toolBar&&(s.map.toolBar.enable=!0),s.map.cn.hn(),s.map.cn.Ci=!0,s.map.cn.$i(),my.removeLastFrame(r),null!==t?a&&a(t):u&&u()}})})}function t(){for(s.map.cn.sr(),my.showFloorNode(s.map,s.map.getFloor(s.level));0<s.map.Zt.jf.length;)s.map.Zt.Pf();var t,n=[!1,!1];cf.isLoaded()?(n[0]=!0,n.every(function(t){return t})&&i()):(t=cf.onLoad,cf.onLoad=function(){t(),n[0]=!0,cf.onLoad=t,n.every(function(t){return t})&&i()}),kc.ns===kc.ts?(n[1]=!0,n.every(function(t){return t})&&i()):kc.es.set(s.map.Ms,function(){kc.es.delete(s.map.Ms),n[1]=!0,n.every(function(t){return t})&&i()})}s.map.setVisibleLevels([s.level],function(){s.map.setLevel({level:s.level,animate:!1,finish:t})})})}}],(e=null)&&gy(n.prototype,e),i&&gy(n,i),t}();function _y(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var xy=function(){function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t)}var n,e,i;return n=t,i=[{key:"findNearNthPowerOfTwo",value:function(t){t-=1;return t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,(t|=t>>16)<0?1:1+t}},{key:"polygonArea",value:function(t){if(t.length<3)return 0;var n=t.length;if(t[0].x===t[n-1].x&&t[0].y===t[n-1].y&&--n,n<3)return 0;t[0].y,t[n-1].x,t[1].x;for(var e=1;e<n-1;++e)t[e].y,t[e-1].x,t[e+1].x;return.5*(t[n-1].y*(t[n-2].x-t[0].x))}},{key:"closedPoints",value:function(t){var n=t.length;return!(n<3)&&(t[0].x===t[n-1].x&&t[0].y===t[n-1].y||(t[n]={x:t[n-1].x,y:t[n-1].y}),!0)}},{key:"IsRectCross",value:function(t,n,e,i){return Math.min(t.x,n.x)<=Math.max(e.x,i.x)&&Math.min(e.x,i.x)<=Math.max(t.x,n.x)&&Math.min(t.y,n.y)<=Math.max(e.y,i.y)&&Math.min(e.y,i.y)<=Math.max(t.y,n.y)}},{key:"IsLineSegmentCross",value:function(t,n,e,i){var r=t.x*(e.y-n.y)+n.x*(t.y-e.y)+e.x*(n.y-t.y),o=t.x*(i.y-n.y)+n.x*(t.y-i.y)+i.x*(n.y-t.y);return(!(0<=(r^o))||0==r&&0==o)&&(!(0<=((r=e.x*(t.y-i.y)+i.x*(e.y-t.y)+t.x*(i.y-e.y))^(o=e.x*(n.y-i.y)+i.x*(e.y-n.y)+n.x*(i.y-e.y))))||0==r&&0==o)}},{key:"computerFocus",value:function(t,n,e,i){var r=(i.x-e.x)*(t.y-n.y)-(n.x-t.x)*(e.y-i.y),o=(t.y-e.y)*(n.x-t.x)*(i.x-e.x)+e.x*(i.y-e.y)*(n.x-t.x)-t.x*(n.y-t.y)*(i.x-e.x);if(0==r)return null;var s=o/r,r=(t.x-n.x)*(i.y-e.y)-(n.y-t.y)*(e.x-i.x),o=n.y*(t.x-n.x)*(i.y-e.y)+(i.x-n.x)*(i.y-e.y)*(t.y-n.y)-i.y*(e.x-i.x)*(n.y-t.y);return 0==r?null:{x:s,y:o/r}}},{key:"GetLineSegmentCrossPoint",value:function(t,n,e,i){return this.IsRectCross(t,n,e,i)?this.computerFocus(t,n,e,i):null}},{key:"IsPointInPolygon",value:function(t,n){for(var e=!1,i=0,r=t.length-1;i<t.length;r=i++)(t[i].y<=n.y&&n.y<t[r].y||t[r].y<=n.y&&n.y<t[i].y)&&n.x<(t[r].x-t[i].x)*(n.y-t[i].y)/(t[r].y-t[i].y)+t[i].x&&(e=!e);return e}},{key:"PointCmp",value:function(t,n,e){if(0<=t.x&&n.x<0)return!0;if(0===t.x&&0===n.x)return t.y>n.y;var i=(t.x-e.x)*(n.y-e.y)-(n.x-e.x)*(t.y-e.y);if(i<0)return!0;if(0<i)return!1;t=(t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y);return(n.x-e.x)*(n.x-e.y)+(n.y-e.y)*(n.y-e.y)<t}},{key:"ClockwiseSortPoints",value:function(t){for(var n={x:0,y:0},e=0,i=0,r=0;r<t.length;r++)e+=t[r].x,i+=t[r].y;n.x=e/t.length,n.y=i/t.length;for(var o=0;o<t.length-1;o++)for(var s,a=0;a<t.length-o-1;a++)this.PointCmp(t[a],t[a+1],n)&&(s=t[a],t[a]=t[a+1],t[a+1]=s)}},{key:"PolygonClip",value:function(t,n,e){if(t.length<3||n.length<3)return!1;for(var i=0;i<t.length;i++)for(var r=(i+1)%t.length,o=0;o<n.length;o++){var s=(o+1)%n.length,s=this.GetLineSegmentCrossPoint(t[i],t[r],n[o],n[s]);s&&e.push(s)}for(var a=0;a<t.length;a++)this.IsPointInPolygon(n,t[a])&&e.push(t[a]);for(var u=0;u<n.length;u++)this.IsPointInPolygon(t,n[u])&&e.push(n[u]);return!(e.length<=0)&&(this.ClockwiseSortPoints(e),!0)}}],(e=null)&&_y(n.prototype,e),i&&_y(n,i),t}();function My(t,n){var e;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(e=function(t,n){if(t){if("string"==typeof t)return Sy(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(e="Object"===e&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Sy(t,n):void 0}}(t))||n&&t&&"number"==typeof t.length){e&&(t=e);var i=0,n=function(){};return{s:n,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},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,o=!0,s=!1;return{s:function(){e=t[Symbol.iterator]()},n:function(){var t=e.next();return o=t.done,t},e:function(t){s=!0,r=t},f:function(){try{o||null==e.return||e.return()}finally{if(s)throw r}}}}function Sy(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}function Ey(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}mi=function(){function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),this.ta={clearColor:16777215,clearAlpha:1},this.Nf=new Map,this.Ff=new Map,this.Uf=new Map,this.ea=new Map,this.Bf=new Map,this.Gf=new Map,this.Hf=new Map,this.Vf=new Map,this.zf=new Map,this.Wf=new Map,this.Xf=new Map,this.Zf=new Map,this.Yf=new Map,this.la=null}var n,e,i;return n=t,(e=[{key:"resize",value:function(){this.ta={clearColor:16777215,clearAlpha:1},this.Nf.clear(),this.Ff.clear(),this.Uf.clear(),this.ea.clear(),this.Bf.clear(),this.Gf.clear(),this.Hf.clear(),this.Vf.clear(),this.zf.clear(),this.Wf.clear(),this.Xf.clear(),this.Zf.clear(),this.Yf.clear()}}])&&Ey(n.prototype,e),i&&Ey(n,i),t}();Object.assign(mi.prototype,{Mt:function(t,n,e){for(var i in n)t[i]=n[i];if(e)for(var r in e){var o=t[r];if(o){if(e[r].type)switch(e[r].type){case"toColor":o=Ti.toColor(o);break;case"toFloat":o=parseFloat(o);break;case"toRgba":o=Ti.toRgba(o);break;case"toString":o+=""}e[r].name?(t[e[r].name]=o,delete t[r]):t[r]=o}}return t},za:function(t){this.resize(),t&&(this.sysPath=t.sysPath,this.userPath=t.userPath,this.logoPath=t.logoPath,this.sysModelPath=t.sysModelPath,this.userModelPath=t.userModelPath,this.qf(t),this.Kf(t.extenttheme,Ii.EXTENT),this.Kf(t.storetheme,Ii.MODEL),this.Jf(t.floorapply,Ii.MODEL),this.Qf(t.storeapply,Ii.MODEL),this.Kf(t.storelabeltheme,Ii.LABEL),this.Jf(t.floorstorelabelapply,Ii.LABEL),this.Qf(t.storelabelapply,Ii.LABEL),this.Kf(t.poiimagetheme,Ii.FACILITY),this.Jf(t.floorpoiimageapply,Ii.FACILITY),this.Qf(t.poiimageapply,Ii.FACILITY),this.Kf(t.externalmodeltheme,Ii.EXTERNAL_MODEL),this.Jf(t.floorexternalapply,Ii.EXTERNAL_MODEL),this.Qf(t.externalmodelapply,Ii.EXTERNAL_MODEL),this.$f())},qf:function(t){t.viewtheme&&((t=t.viewtheme).clearcolor&&(this.ta.clearColor=Ti.toColor(t.clearcolor)),t.clearalpha&&(this.ta.clearAlpha=parseFloat(t.clearalpha)))},Kf:function(t,n){if(t){var e,i=My(t);try{for(i.s();!(e=i.n()).done;){var r=e.value;if(r.id)switch(n){case Ii.EXTERNAL_MODEL:this.Xf.set(r.id,this.Mt({},r,{color:{type:"toColor"}}));break;case Ii.FACILITY:if(!r.imagename)break;this.Vf.set(r.id,this.Mt({},r,{imagename:{name:"imageName"}}));break;case Ii.LABEL:this.Bf.set(r.id,this.Mt({},r,{alpha:{type:"toFloat"},fillcolor:{name:"fillColor",type:"toRgba"},strokecolor:{name:"strokeColor",type:"toRgba"},platesize:{name:"plateSize"},platestrokecolor:{name:"plateStrokeColor",type:"toRgba"},platecolor:{name:"plateColor",type:"toRgba"},strokewidth:{name:"strokeWidth",type:"toFloat"},space:{type:"toFloat"},fontfamily:{name:"fontFamily"},fontweight:{name:"fontWeight",type:"toFloat"},imagesize:{name:"imageSize",type:"toFloat"}}));break;case Ii.MODEL:this.Nf.set(r.id,this.Mt({},r,{color:{type:"toColor"},alpha:{type:"toFloat"},strokecolor:{name:"strokeColor",type:"toColor"},strokewidth:{name:"strokeWidth",type:"toFloat"}}));break;case Ii.EXTENT:this.ea.set(r.id,this.Mt({},r,{color:{type:"toColor"},alpha:{type:"toFloat"}}))}}}catch(t){i.e(t)}finally{i.f()}}},Jf:function(t,n){if(t){var e,i=My(t);try{for(i.s();!(e=i.n()).done;){var r,o=My(e.value.typeapply);try{for(o.s();!(r=o.n()).done;){var s,a=r.value,u=this.Mt({},a,{normalid:{name:"normalID",type:"toString"},selectedid:{name:"selectID",type:"toString"}}),h=My(a.type.split(","));try{for(h.s();!(s=h.n()).done;){var c=s.value;this.ca(n).set(c,u)}}catch(t){h.e(t)}finally{h.f()}}}catch(t){o.e(t)}finally{o.f()}}}catch(t){i.e(t)}finally{i.f()}}},Qf:function(t,n){if(t){var e,i=My(t);try{for(i.s();!(e=i.n()).done;){var r=e.value;if(r.fids){var o,s=this.Mt({},r,{normalid:{name:"normalID",type:"toString"},selectedid:{name:"selectID",type:"toString"}}),a=My(r.fids.split(","));try{for(a.s();!(o=a.n()).done;){var u=o.value;this.ua(n).set(u,s)}}catch(t){a.e(t)}finally{a.f()}}}}catch(t){i.e(t)}finally{i.f()}}},$f:function(){this.Ff.get("0")&&this.Nf.get(this.Ff.get("0").selectID)&&(this.la=this.Nf.get(this.Ff.get("0").selectID).color)},ua:function(t){switch(t){case Ii.LABEL:return this.Hf;case Ii.FACILITY:return this.Wf;case Ii.MODEL:return this.Uf;case Ii.EXTERNAL_MODEL:return this.Yf}},ca:function(t){switch(t){case Ii.LABEL:return this.Gf;case Ii.FACILITY:return this.zf;case Ii.MODEL:return this.Ff;case Ii.EXTERNAL_MODEL:return this.Zf}},ha:function(t){switch(t){case Ii.LABEL:return this.Bf;case Ii.FACILITY:return this.Vf;case Ii.MODEL:return this.Nf;case Ii.EXTERNAL_MODEL:return this.Xf}},vt:function(){for(var t in this.resize(),this)this[""+t]=null,delete this[""+t]}});var Ty=mi;function Ly(t){return(Ly="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ry(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Oy(t,n,e){return(Oy="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,n,e){t=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=Cy(t)););return t}(t,n);if(t){n=Object.getOwnPropertyDescriptor(t,n);return n.get?n.get.call(e):n.value}})(t,n,e||t)}function Ay(t,n){return(Ay=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function ky(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Cy(e);return t=i?(t=Cy(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Ly(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function Cy(t){return(Cy=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var jy=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Ay(t,n)}(r,Ty);var t,n,e,i=ky(r);function r(){var t;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(t=i.call(this)).ta={},t}return t=r,(n=[{key:"resize",value:function(){Oy(Cy(r.prototype),"resize",this).call(this),this.ta={}}}])&&Ry(t.prototype,n),e&&Ry(t,e),r}();Ai=function t(n,e,i,r){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),this.W=n,this.Pt=e,this.Et=i,this.ft=r,this.xe=new af(this),this.Ee=null,this.cf=new Ul(n),this.cf.Ia=this.Pt.ClassicMaterial,this.tl=new zl,this._u=new uf(this),this.Qs=new Map,this.jf=[],this.nl=[],this.el=0,this.il=!1,this.ct=this.ct.bind(this),this.rl=this.rl.bind(this),this.ol=new ut(new St(0,1,0),0),this.ue=new Ji,n.on("visibleLevelsLoaded",this.rl),n.on("loaded",this.rl),n.on("viewChanged",this.rl),n.on("viewModeChanged",this.rl),n.on("buildingEntered",this.rl),n.on("buildingExited",this.rl),n.on("zoom",this.rl),n.on("move",this.rl),n.on("mapLoaded",this.rl),n.on("levelChanged",this.rl),n.on("sceneLoaded",this.rl),n.on("firstViewLoaded",this.rl),n.on("beforeRender",this.ct),this.Po=null,this.Bi=this.Bi.bind(this),this.Do=new gc({disposeCallback:this.Bi,enable:!0,name:"NodeManager",mapCreateTime:this.W.Ms})};Object.assign(Ai.prototype,{rl:function(n){var t,e=this;"visibleLevelsLoaded"!==n.type&&"loaded"!==n.type&&"viewChanged"!==n.type||(this.Et.sl=!0,this.er()),"mapLoaded"===n.type&&this.W.al(function(t){e.ul({bid:t.Yt})}),"move"===n.type&&this.W.hl(),"buildingEntered"!==n.type&&"buildingExited"!==n.type||this.ul({bid:n.buildingID}),"zoom"===n.type&&(this.W.hl(),this.W.traverse(function(t){t!==e.W.qt&&(e.ul({bid:t.Yt}),t.Sh())}),this.W.traverse(function(t){t.visible&&t.traverse(function(t){t.visible&&t.traverse(function(t){t.visible&&t.traverse(function(t){t.type===Ii.EXTERNAL_MODEL&&t.jn&&(!(t.Ee&&(t.Ee.maxlevel<=n.zoom||t.Ee.minlevel>n.zoom))?t.fading&&t.sf():t.af())})})})})),"levelChanged"!==n.type&&"visibleLevelsLoaded"!==n.type||(n.buildingID===this.W.Pt.buildingID?this.W.traverse(function(t){t.traverse(function(t){t.Qn({animate:!1})})}):(t=this.W.getBuilding(n.buildingID))&&t.traverse(function(t){t.Qn()})),"sceneLoaded"===n.type&&(n.buildingID||(this.el+=5,this.W.It.Dt({type:"progress",progressBar:this.el}))),"visibleLevelsLoaded"===n.type&&void 0===n.buildingID&&(this.el+=50,this.W.It.Dt({type:"progress",progressBar:this.el})),"loaded"===n.type&&(this.el+=30,this.W.It.Dt({type:"progress",progressBar:this.el})),"firstViewLoaded"===n.type&&(this.el=100,this.W.It.Dt({type:"progress",progressBar:this.el}))},cl:function(n){var t=this.Et.Tn(n.bid),e=[];t.visibleLevels.forEach(function(t){-1<n.levels.indexOf(t)&&e.push(t)}),t.visibleLevels=e},ul:function(t){var n=this.W.getBuilding(t.bid),t=!0;this.tr(n)&&(this._h(n),t=!1),n.Wu&&(n.Wu.show=t),this.Ln(),this.W.enableUpdateNode()},fl:function(t,n){var e=this;n=n||{};function i(){e.W.cn.Ln(),n.finish&&n.finish()}var r=this.Et.Tn(t.Yt);"animate"in n&&!n.animate?(t.traverse(function(t){t.Qn({animate:!1})}),i()):t.traverse(function(t){t.$n===r.level?t.Qn({finish:function(){i()}}):t.Qn({})})},Ua:function(){var n;this.Et.ll||this.Et.rr&&0===this.jf.length&&(n=!0,this.cf.Jo.forEach(function(t){t.loadComplete||(n=!1)}),n&&(this.Et.ll=!0,this.W.It.Dt({type:"externalFirstLoaded"})))},Xt:function(t,n){t=this.W.getBuilding(t);return t?t.getFloor(n):null},dl:function(t){t=this.W.getBuilding(t);return null!==t?t.K:[]},vl:function(t,o){var s=this;if(this.Pt.tile&&!this.Pt.preLoad){for(var a=[],u=t.building,n=0;n<u.visibleLevels.length;n++){var e=u.getFloor(u.visibleLevels[n]);e&&0===this.pl(e)&&(this.ml(e)?(e.kf(),this.gl(e)):a.push(u.visibleLevels[n]))}0<a.length?((t=Object.assign({},this.Pt,{buildingID:u.Wn,level:u.level,visibleLevels:u.visibleLevels,bid:u.Yt})).buildings=null,this.W.re.Io(t,function(t,n){if("floor"===t){var e=s.Et.yl(u.Yt);if(e.set(n.gid,!0),-1<a.indexOf(n.gid)){n=u.getFloor(n.gid);s.bl(n);for(var i=!0,r=0;r<a.length;r++)if(!e.get(a[r])){i=!1;break}i&&o&&o()}}})):o&&o()}else o&&o()},ee:function(n,e){var i=this;n.levels.sort(),this.Et.Tn(n.building.Yt).visibleLevels=n.levels,this.cl({bid:n.building.Yt,levels:n.building.qn}),this.vl(n,function(){i.Ln(),i.W.cn.hn();var t={type:"visibleLevelsLoaded"};n.building!==i.W.qt&&(t.buildingID=n.building.Yt),i.W.It.Dt(t),e&&e()})},ne:function(n,e){var i=this;this.W.hl();var r=this.Et.Tn(n.Yt);r.targetLevel=e.level,-1<r.visibleLevels.indexOf(e.level)?this.W.Z.En(n,e):(r.visibleLevels.length<=1?r.visibleLevels=[e.level]:r.visibleLevels.push(e.level),n.setVisibleLevels(r.visibleLevels,function(){var t;r.targetLevel===e.level?i.W.Z.En(n,e):(t={type:"levelChanged",level:e.level},n!==i.W.qt&&(t.buildingID=n.Yt),i.W.It.Dt(t),e.finish&&e.finish())}))},ml:function(t){var n=!1;return t.Ee.K.forEach(function(t){0<t.K.size&&(n=!0)}),n},pl:function(t){var n=this,e=0;return t.traverse(function(t){n.wl(t)&&e++}),e},oh:function(t,n){t.jn&&((!t.Wu||t.Wu.visible)&&t.Bn?t.jn.visible=t.Ee.maxlevel&&n>=t.Ee.minlevel&&n<t.Ee.maxlevel:t.jn.visible=!1)},tr:function(t){return!1!==t.visible&&(t.overviewMode===dp.INDOOR||(t.overviewMode!==dp.OUTDOOR||this.Et._l===t.buildingID)&&(this.Et._l!==this.W.Pt.buildingID?this.Et._l===t.Yt:t===this.W.qt||!!this.W.xl(t)&&!!this.W.Ml()))},Sl:function(){var n=this;this.W.traverse(function(t){t.traverse(function(t){t=t.getLayers(Ii.LABEL_LAYER)[0];t&&t.traverse(function(t){n.Et.Th===lp.FID?t.text=t.Ee.fid:n.Et.Th===lp.ENAME?t.text=t.Ee.ename:t.text=t.Ee.name})})})},Rh:function(t){var n=0,n=this.W.jt.isPerspectiveCamera?t/(this.W.cn.renderer.domElement.clientHeight/(2*Math.tan(this.W.jt.fov*pi.DEG2RAD/2))):t*Math.abs(this.W.jt.top-this.W.jt.bottom)/this.W.jt.zoom/this.W.cn.renderer.domElement.clientHeight;return n=isNaN(n)?1:n},El:function(t,n){if(this.W.jt.isPerspectiveCamera){var e=new Et;t.updateMatrixWorld(),this.W.ln.updateMatrixWorld(),e.multiplyMatrices(this.W.ln.matrixWorldInverse,t.matrixWorld);e=(new St).applyMatrix4(e);return this.Rh(n)*Math.abs(e.z)}return this.Rh(n)},Tl:function(t){var n,e,i=(new St).copy(this.W.Z.Ct.target),r=new fi(0,0);return i.y=t+r.y,10/("PerspectiveCamera"===this.W.jt.type?(e=this.W.jt.near,r=this.W.jt.fov,n=this.W.Z.Ct.object.position.distanceTo(i),10*e*Math.tan(r/2*pi.DEG2RAD)*2/this.W.cn.renderer.domElement.clientHeight*n/e):(n=this.W.jt.top,e=this.W.jt.bottom,10*Math.abs(n-e)/this.W.cn.renderer.domElement.clientHeight/this.W.jt.zoom))},Ll:function(){this.Qs.set(this.Pt.buildingID,{theme:new Ty});var t=this.Et.Tn(this.Pt.buildingID);t.themeNeedLoad=!0,t.themeLoaded=!1,this.Rl({bid:this.Pt.buildingID,themeID:this.Pt.themeID,theme:this.Pt.mu,themeExtension:this.Pt.themeExtension}),this.Pt.tile?((t=Object.assign({},this.Pt,{level:t.level,visibleLevels:t.visibleLevels})).bid=t.buildingID,this.Ol(t)):this.Al(this.Pt)},kl:function(t){for(var n=null,e=this.W.getBuildings(),i=0;i<e.length;i++)if(""+e[i].bcode==""+t){n=e[i].buildingID;break}return n},Cl:function(t){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},e=this.Et.Tn(t),i=e.themeExtension||n.themeExtension,n=e.themeID||n.themeID;if(!n)return e.themeLoaded=!0,void(e.themeNeedLoad=!1);this.Qs.set(t,{theme:new Ty}),e.themeLoaded=!1,e.themeNeedLoad=!0,this.Rl({bid:t,themeID:n,themeExtension:i})},jl:function(h){var c=this;h=h||[];var t=this.W.Pt.buildingOptions,f=t.buildings||t.themeID,l=null;(function t(){var n=c.W.getBuildings();if(!1===c.W.Pl)l=setTimeout(t,1);else{null!==l&&clearTimeout(l);var e=[];if(0<h.length)for(var i=0;i<h.length;i++){var r=h[i].bcode,r=c.kl(r);c.Cl(r,h[i]),e.push(r)}if(f)for(var o=0;o<n.length;o++){var s=n[o].buildingID;e.includes(s)||c.Cl(s)}if(e.length!==n.length)for(var a=0;a<n.length;a++){var u=n[a].buildingID;e.includes(u)||((u=c.Et.Tn(u)).themeLoaded=!0,u.themeNeedLoad=!1)}}})()},Rl:function(e){var i=this;this.Dl(e,function(t){var n=i.Qs.get(e.bid);n.theme.za(t),n.theme.themeID=e.themeID,e.themeExtension&&(n.themeExtension=new jy,n.themeExtension.za(e.themeExtension)),i.Et.Tn(e.bid).themeLoaded=!0,e.bid===i.Pt.buildingID&&(i.Et.Xu(i._u),i.W.setBackgroundColor(i.Et.backgroundColor,i.Et.backgroundAlpha),i.jl(t.buildings)),i.Et.Il=i.Nl(),(i.Et.Fl||i.Et.Ul)&&(i.ft(null,null,i.Et.Fl,!1,i.Et.Ul,i.Et.Il),i.Et.Fl&&(i.Et.Fl=!1),i.Et.Ul&&(i.Et.Ul=!1))})},Dl:function(t,n){var e,i=this;t.theme?n(t.theme):(e="_loadTheme"+Mt.generateUUID(),this.Do.So(e),hg.cr(this.Pt.themeURL,t.themeID,function(t){n&&n(t),i.Do.Eo(e)},function(t){i.W.It.Dt({type:"info",InfoMode:t}),i.Do.Eo(e)}))},Nl:function(){for(var t=!0,n=0;n<this.W.K.length;n++){var e=this.W.K[n];if(e.constructor===Ep){if(this.tr(e)&&!this.Et.Nl(e.Yt)){t=!1;break}}else if(!this.Et.Nl(e.Yt)){t=!1;break}}return t},Bl:function(t){var n,e,i=this.Et.Tn(t.Yt);i.buildingLoaded||(this.Pt.tile?this.tr(t)?((n=Object.assign({},this.Pt,{isOutdoor:!1,buildingID:t.Wn,bid:t.Yt,level:t.level,visibleLevels:t.visibleLevels})).buildings=null,this.Ol(n)):i.sceneLoaded||this.Pt.tile&&((e=Object.assign({},this.Pt,{isOutdoor:!1,buildingID:t.Wn,bid:t.Yt,level:t.level,visibleLevels:t.visibleLevels})).buildings=null,this.Gl(e)):((e=Object.assign({},this.Pt)).isOutdoor=!1,e.buildingID=t.Wn,e.bid=t.Yt,e.buildings=null,this.Al(e)))},Al:function(f){var l=this;this.W.re.No(f,function(t,s){var n;if(!(0<l.W.Kt.error.length))if("complete"===t)if(f.isOutdoor){var e=l.Hl(s);if(!(0<l.W.Kt.error.length)){var i=l.Et.Tn(e.Yt);if(i.buildingLoaded=!0,i.sceneLoaded=!0,s.buildings)for(var r=0;r<s.buildings.length;r++){var o=l.Vl(s.buildings[r]);if(0<l.W.Kt.error.length)return;l.Bl(o)}s.buildings&&0!==s.buildings.length&&s.buildings.length!==l.W.K.length-1||(l.W.Pl=!0);for(var a=l.Et.yl(e.Yt),u=0;u<e.qn.length;u++){var h=s.K.get(e.qn[u]);a.set(h.gid,!0);var c=l.ao(e,h,e.qn[u]);l.bl(c),l.zl(e,h.gid)}}}else l.W.K.forEach(function(t){if(t.Wn===s.mid){t.qn=s.levels,t.Jn=new tt(new St(s.minX,s.minY),new St(s.maxX,s.maxY));var n=l.Et.Tn(t.Yt);n.buildingLoaded=!0,n.sceneLoaded=!0;for(var e=l.Et.yl(t.Yt),i=0;i<s.levels.length;i++){var r=s.K.get(s.levels[i]);e.set(r.gid,!0);var o=l.ao(t,r,s.levels[i]);l.bl(o),l.zl(t,r.gid)}}});else"decode"===t?(n=null,(i=l.W.getBuilding(f.bid))&&(n=i.Yt),l.cl({bid:void 0!==f.bid?f.bid:f.buildingID,levels:s.scene.levels}),l.W.It.Dt({type:"sceneLoaded",buildingID:n}),l.W.It.Dt({type:"info",InfoMode:Ni.INFO,mapID:s.scene.mid,buildingID:n})):"error"===t&&(n=null,(t=l.W.getBuilding(f.bid))&&(n=t.Yt),l.W.Kt.error.push(n={type:"info",InfoMode:s,buildingID:n}),l.W.It.Dt(n))})},Ol:function(f){var l=this;this.W.re.Io(f,function(t,n){if(!(0<l.W.Kt.error.length)){if("building"===t){var e=null,i=l.Et.Tn(f.bid),r=i.sceneLoaded;if(i.buildingLoaded=!0,i.sceneLoaded=!0,f.buildingID===f.mapID){if(e=l.Hl(n),n.buildings)for(var o=0;o<n.buildings.length;o++){var s=l.Vl(n.buildings[o]);l.Bl(s)}n.buildings&&0!==n.buildings.length&&n.buildings.length!==l.W.K.length-1||(l.W.Pl=!0)}else e=l.W.getBuilding(f.bid),r||(e.qn=n.levels,e.Jn=new tt(new St(n.minX,n.minY),new St(n.maxX,n.maxY)));if(!r)for(var a=0;a<e.qn.length;a++){var u=n.K.get(e.qn[a]);l.ao(e,u,e.qn[a])}}var h,c;"scene"===t&&(h=null,f.buildingID!==f.mapID&&(h=f.bid),l.cl({bid:f.bid,levels:n.levels}),l.W.It.Dt({type:"sceneLoaded",buildingID:h}),l.W.It.Dt({type:"info",InfoMode:Ni.INFO,mapID:n.mid,buildingID:h})),"floor"===t&&(c=l.W.getBuilding(f.bid),l.Et.yl(c.Yt).set(n.gid,!0),(h=c.getFloor(n.gid)).Ee=n,l.bl(h),l.zl(c,n.gid)),"error"===t&&(c=null,c={type:"info",InfoMode:n,buildingID:c=(t=l.W.getBuilding(f.bid))?t.Yt:c},l.W.Kt.error.push(c),l.W.It.Dt(c))}})},Gl:function(r){var o=this,s=null;this.W.re.Nr(r,function(t,n){if("building"===t){(s=o.W.getBuilding(r.bid)).qn=n.levels,s.Jn=new tt(new St(n.minX,n.minY),new St(n.maxX,n.maxY)),o.Et.Tn(s.Yt).sceneLoaded=!0;for(var e=0;e<s.qn.length;e++){var i=n.K.get(s.qn[e]);o.ao(s,i,s.qn[e])}o.zl(s,void 0)}else"scene"===t&&(t=null,r.buildingID!==r.mapID&&(t=r.bid),o.cl({bid:r.bid,levels:n.levels}),o.W.It.Dt({type:"sceneLoaded",buildingID:t}),o.W.It.Dt({type:"info",InfoMode:Ni.INFO,mapID:n.mid,buildingID:t}))},function(t,n){var e=null,i=o.W.getBuilding(r.bid);i&&(e=i.Yt),o.W.It.Dt({type:"info",InfoMode:n,buildingID:e})})},_h:function(t){this.Bl(t)},zl:function(t,n){var e=this.Et.Tn(t.Yt),i=e.loaded,r=e.visibleLevelsLoaded;this.Wl(t),!r&&e.visibleLevelsLoaded&&(this.Et.Fl&&this.Et.Il?(this.ft(null,n,!0,!0,!1,this.Et.Il),this.Et.Fl=!1):this.ft(null,n,!1,!0,!1,this.Et.Il),r={type:"visibleLevelsLoaded"},t!==this.W.qt&&(r.buildingID=t.Yt),this.W.It.Dt(r)),!i&&e.loaded&&(t!==this.W.qt?this.W.It.Dt({type:"buildingLoaded",buildingID:t.Yt}):this.W.It.Dt({type:"mapLoaded"})),this.Et.Ul&&this.Et.Il&&(this.ft(null,n,!1,!1,!0,this.Et.Il),this.Et.Ul=!1)},Wl:function(t){var n=this.Et.Tn(t.Yt),e=this.Et.yl(t.Yt);if(!n.visibleLevelsLoaded){for(var i=!0,r=t.visibleLevels,o=0;o<r.length;o++)e.get(r[o])||(i=!1);n.visibleLevelsLoaded=i}this.Pt.tile&&!this.Pt.preLoad?n.loaded=n.visibleLevelsLoaded:e.size===t.qn.length&&(n.loaded=!0),this.Xl()},Xl:function(){var e,i,r=this,o=!0;this.W.traverse(function(t){var n=r.Et.Tn(t.Yt);n.visibleLevelsLoaded||(t.constructor===Ep?r.tr(t)&&!n.visibleLevelsLoaded&&(o=!1):n.visibleLevelsLoaded||(o=!1))}),!this.Et.rr&&o&&(this.Et.Fl=!0),this.Et.rr=o,this.Et.ir||(i=e=!0,this.W.traverse(function(t){var n=r.Et.Tn(t.Yt);n.sceneLoaded||(e=!1),(!r.tr(t)||n.loaded)&&e||(i=!1)}),!this.Et.ir&&i&&(this.Et.Ul=!0),this.Et.ir=i)},ct:function(){this.Et.Il&&(this.Zl(),this.Yl(),this.Df(),this.Pf(),this.W.cn.sr(),this.W.cn.$i())},Rn:function(){this.Et.ql=!0},er:function(){this.W.cn.er()},Ln:function(){this.W.cn.Ln()},Df:function(){if(this.Et.sl){this.jf=[];for(var t=this.W.getZoom(),n=this.Pt.tile&&!this.Pt.preLoad,e=0;e<this.W.K.length;e++)for(var i=this.W.K[e],r=!this.tr(i),o=0;o<i.K.length;o++){var s=i.K[o],a=null,u=-1<i.visibleLevels.indexOf(s.level);u&&!r&&(a=this.Kl(i,s.level),0===this.pl(s)&&this.ml(s)&&(s.kf(),this.gl(s),this.Ln()));for(var h=[],c=0;c<s.K.length;c++){var f=s.K[c];if(!u||r&&n)this.wl(f)&&n&&h.push(f);else for(var l=0;l<f.K.length;l++){var d=f.K[l],v=!0;r||!d.visible||d.Wu&&!d.Wu.visible?v=!1:d.Ee&&d.Ee.maxlevel&&(t>=d.Ee.maxlevel||t<d.Ee.minlevel)?(v=!1)===d.canDispose&&(v=!0):this.Jl(d,a)||(v=!1),!d.jn&&v&&this.jf.push([e,d]),d.jn&&!v&&(d.fading||d.bu&&d.bu())}}for(var p=0;p<h.length;p++)s.remove(h[p]),h[p].dispose()}this.Et.sl=!1,this.W.enableUpdateRender()}},Zl:function(){var i=this;this.Et.ql&&(this.nl=[],this.W.traverse(function(e){for(var t=0;t<e.K.length;t++)!function(n){var t=e.K[n];t.Sf(),t.Mf&&t.traverse(function(t){t.traverse(function(t){t.type!==Ii.EXTENT&&t.type!==Ii.FACILITY&&t.type!==Ii.LABEL&&t.type!==Ii.MODEL&&t.type!==Ii.EXTERNAL_MODEL&&t.type!==Ii.TEXT_MARKER&&t.type!==Ii.DOM_MARKER&&t.type!==Ii.EXTRUDE_MARKER&&t.type!==Ii.IMAGE_MARKER&&t.type!==Ii.POLYGON_MARKER&&t.type!==Ii.DYNAMIC_MODEL_MARKER||t.jn&&i.nl.push([n,t])})}),t.Mf=!1}(t)}),this.Et.ql=!1)},wl:function(t){var n=Ii.EXTENT_LAYER|Ii.FACILITY_LAYER|Ii.LABEL_LAYER|Ii.MODEL_LAYER|Ii.EXTERNAL_MODEL_LAYER;return 0!=(t.Un&n)},Pf:function(){if(0<this.jf.length){for(var t=!1,n=0,e=0;e<this.jf.length&&!(20<++n);e++){var i=this.jf[e][1];i.Un!==Ii.FACILITY&&i.Un!==Ii.LABEL||(t=!0),i.za(),this.jf.splice(e,1),e--}t&&this.er(),this.Ua(),this.W.enableUpdateRender(),this.Et.ir&&0===this.jf.length&&!this.il&&(this.W.It.Dt({type:"firstViewLoaded"}),this.il=!0)}!this.il&&this.ir&&0===this.jf.length&&(this.W.It.Dt({type:"firstViewLoaded"}),this.il=!0)},Yl:function(){if(0<this.nl.length){for(var t=0,n=0;n<this.nl.length&&!(++t>this.Pt.maxMaterialCount);n++){var e=this.nl[n][1];e.update?e.update():e.Mu(),this.nl.splice(n,1),n--}this.W.enableUpdateRender()}},Jl:function(t,n){if(!t.getBound||!n)return!0;var e=t.getBound();if(!e)return!0;t=!0;return e.maxX<n.min.x&&(t=!1),e.minX>n.max.x&&(t=!1),e.maxY<n.min.y&&(t=!1),t=e.minY>n.max.y?!1:t},Kl:function(t,n){var e=[],i=[],r=this.Pt.container.clientWidth,o=this.Pt.container.clientHeight;e.push(wy.coordsScreenToMap(this.W,{x:0,y:0,level:n,buildingID:t.Yt})),e.push(wy.coordsScreenToMap(this.W,{x:r,y:0,level:n,buildingID:t.Yt})),e.push(wy.coordsScreenToMap(this.W,{x:r,y:o,level:n,buildingID:t.Yt})),e.push(wy.coordsScreenToMap(this.W,{x:0,y:o,level:n,buildingID:t.Yt}));for(var s=t.visibleLevels,a=new rr,u=0;u<s.length;u++){var h=t.getFloor(s[u]).getBound();a.Nn([h.max,h.min])}i.push({x:a.min.x,y:a.min.y}),i.push({x:a.min.x,y:a.max.y}),i.push({x:a.max.x,y:a.max.y}),i.push({x:a.max.x,y:a.min.y});n=[];xy.PolygonClip(e,i,n);i=new iy;return i.setFromPoints(n),i.max.x<i.min.x||i.max.y<i.min.y?null:i},ao:function(t,n,e){e=new ug({mapOptions:this.Pt,states:this.Et,data:n,key:e});return t.mn(e),e.Sf(),e.Ef(),e},bl:function(t){t.kf(),t.Af(),this.gl(t)},Ql:function(t,n){for(var e=!0,i=0;i<t.length;i++)if(t[i]===n){e=!1;break}return e},$l:function(t,n,e){var i=[];i.push(t);for(var r=0;r<n.length;r++)n[r]!==t&&i.push(n[r]);if(e)for(var o=0;o<e.length;o++)this.Ql(i,e[o])&&i.push(e[o]);return i},Hl:function(t){var n=new Kl({bid:this.Pt.buildingID,mid:this.Pt.mapID,height:t.height,scaleLevel:t.scaleLevel,name:t.mname,levels:t.levels,x:t.x,y:t.y,bounds:new tt(new St(t.minX,t.minY),new St(t.maxX,t.maxY))});return this.W.mn(n),this.W.qt=n,this.W.N=t.x,this.W.F=t.y,n},Vl:function(t){var n=this.Et.Tn(t.bid);if(!n.visibleLevels||0===n.visibleLevels.length){for(var e=[],i=0;i<t.levelChart.length;i+=2)for(var r=0;r<this.W.qt.visibleLevels.length;r++)t.levelChart[i]===this.W.qt.visibleLevels[r]&&e.push(t.levelChart[i+1]);n.visibleLevels=e}if(void 0===n.level)for(var o=0;o<t.levelChart.length;o+=2)t.levelChart[o]===this.W.qt.level&&(n.level=t.levelChart[o+1]);var s=new Map;if(t.floors)for(var a=0;a<t.floors.length;a++){var u=t.floors[a].qr,h=t.floors[a].gid;s.set(h,u)}var c=new Ep(t);return n.minLevel&&(c.ku=n.minLevel),n.maxLevel&&(c.Au=n.maxLevel),c.dh=n.overviewMode,c.td=s,this.W.mn(c),c},gl:function(t){var i=this;t.tt.Yt===this.Pt.buildingID&&t.traverse(function(t){t.type!==Ii.MODEL_LAYER&&t.type!==Ii.EXTERNAL_MODEL_LAYER&&t.type!==Ii.LABEL_LAYER||t.traverse(function(e){i.W.traverse(function(t){if(t!==i.W.qt)for(var n=0;n<t.gh.length;n++)t.gh[n]===e.FID&&(t.Wu.setFacadeNode(e),e.Wu=t.Wu)})})})},wu:function(t,n,e){var i=t.qr,r=t.getBound(),o=new kg,s=i[0];if(0<s.length){o.moveTo(s[0].x-r.center.x,s[0].y-r.center.y);for(var a=1;a<s.length;a++)o.lineTo(s[a].x-r.center.x,s[a].y-r.center.y)}if(1<i.length)for(var u=1;u<i.length;u++){var h=i[u],c=new Ag;if(0<h.length){c.moveTo(h[0].x-r.center.x,h[0].y-r.center.y);for(var f=1;f<h.length;f++)c.lineTo(h[f].x-r.center.x,h[f].y-r.center.y)}o.holes.push(c)}for(var l=null,l=0===n?new Jg(o):new $g(o,{depth:n,bevelEnabled:!1}),d=r.min.x,v=r.min.y,p=r.max.x-d,m=r.max.y-v,g=l.faces,y=g.length,b=0;b<y;b++){var w=l.vertices[g[b].a],_=l.vertices[g[b].b],x=l.vertices[g[b].c];l.faceVertexUvs[0][b][0].x=(w.x+r.center.x-d)/p,l.faceVertexUvs[0][b][0].y=(w.y+r.center.y-v)/m,l.faceVertexUvs[0][b][1].x=(_.x+r.center.x-d)/p,l.faceVertexUvs[0][b][1].y=(_.y+r.center.y-v)/m,l.faceVertexUvs[0][b][2].x=(x.x+r.center.x-d)/p,l.faceVertexUvs[0][b][2].y=(x.y+r.center.y-v)/m}return l.computeBoundingSphere(),{geometry:l,shape:o}},nd:function(t){t=this.map.getBuilding(t);if(null===t)return-1;t=t.bounds;return Math.sqrt((t.maxX-t.minX)*(t.maxX-t.minX)+(t.maxY-t.minY)*(t.maxY-t.minY))},xh:function(e){var i=this,r=this.Et.Tn(e.bid);r.themeNeedLoad=!0,r.themeLoaded=!1,this.Dl({themeID:e.themeID},function(t){r.themeID=e.themeID;var n=i.Qs.get(e.bid);n||i.Qs.set(e.bid,{theme:new Ty}),n.theme.za(t),r.themeLoaded=!0,e.bid===i.Pt.buildingID&&(i.Et.Xu(i._u),i.W.setBackgroundColor(i.Et.backgroundColor,i.Et.backgroundAlpha)),i.ed()})},Mh:function(t){var n=this.Qs.get(t.bid);t.data?(n||(this.Qs.set(t.bid,{themeExtension:new jy}),n=this.Qs.get(t.bid)),n.themeExtension||(n.themeExtension=new jy),n.themeExtension.za(t.data)):n&&n.themeExtension&&(this.Pt.buildingID===t.bid?n.themeExtension.resize():(n.themeExtension.vt(),n.themeExtension=null)),this.Et.Xu(this._u),this.W.setBackgroundColor(this.Et.backgroundColor,this.Et.backgroundAlpha),this.ed()},ed:function(){var n=this;this.W.traverse(function(t){t.traverse(function(t){t.traverse(function(t){t.traverse(function(t){t.xu&&t.xu(n,n._u)})})})})},Ku:function(t,n,e){var i=this.Et.Tn(this.W.qt.Yt).themeID,r=this.Pt,o=this.Qs.get(this.Pt.buildingID).theme,s="";if(s=e===this.Pt.buildingID?r.userThemeURL?r.userThemeURL+i:r.themeURL+i:(a=(a=this.Qs.get(e))&&a.theme?a.theme.themeID:i,r.userThemeURL?r.userThemeURL+a:r.themeURL+a),r.isPreview){var a=r.themeURL;return"path"===n?("1"===t.isuser?a+=o.userPath+"/":a+=o.sysPath+"/",a):"logoPath"===n?a+=o.logoPath+"/":"model"===n?("1"===t.isuser?a+=o.userModelPath+"/":a+=o.sysModelPath+"/",a):void 0}if("model"===n){if(r.externalModelURL)return r.externalModelURL+"models/";if(r.userThemeURL)return s+"/models/"}return s+"/"},pu:function(t){t=this.W.getMapOptions().hideList[t];return void 0===t||0!==Object.keys(t).length},Ou:function(t,n){var e=this.W.getMapOptions().hideList,i=n.typeID,n=n.FID,e=e[t];if(void 0===e)return!0;t=e.typeIDs,e=e.FIDs;return void 0===e&&(e=[]),!(t=void 0===t?[]:t).includes(i)&&!e.includes(n)},vt:function(t){var n=this;this.W.off("visibleLevelsLoaded",this.rl),this.W.off("loaded",this.rl),this.W.off("viewChanged",this.rl),this.W.off("viewModeChanged",this.rl),this.W.off("buildingEntered",this.rl),this.W.off("zoom",this.rl),this.W.off("move",this.rl),this.W.off("buildingLoaded",this.rl),this.W.off("beforeRender",this.ct),this.Po=t,this.xe.vt(function(){n.xe=null,n.Do.Mo(!0)})},Bi:function(){for(var t in this.jf=[],this.cf.vt(),this.cf=null,this.Qs.clear(),this.W=null,this)this[""+t]&&this[""+t].vt&&this[""+t].vt();for(var n in this.Po&&this.Po({name:"NodeManager"}),this)this[""+n]=null,delete this[""+n]}});var Py=Ai;Gi=function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),this.K=new Map,this.rd=[],this.xt=(new Date).getTime(),this.od=new Map,this.Po=null,this.Bi=this.Bi.bind(this),this.sd=0,this.Di()};Object.assign(Gi.prototype,{mn:function(t){if(Array.isArray(t)){this.K.set(t[0].lt,t[0]),t[0].tt=this;for(var n=1;n<t.length;n++)t[n].et=t[n-1].et+t[n-1].ot,t[n].it=t[n-1].it+t[n-1].ot,this.K.set(t[n].lt,t[n]),t[n].tt=this}else this.K.has(t.lt)||(this.K.set(t.lt,t),t.tt=this,t.et=this.xt)},vn:function(t){if(Array.isArray(t))for(var n=0;n<t.length;n++)this.K.delete(t[n].lt);else this.K.delete(t.lt)},df:function(t){this.rd.push(t)},gf:function(t){t=this.rd.indexOf(t);-1<t&&this.rd.splice(t,1)},ad:function(t){this.od.set(t.lt=Ti.generateUUID(),t)},ud:function(t){this.od.delete(t.lt)},ct:function(t,n,e){for(var i=[],r=[],o=0;o<t.Q.length;o++)void 0===t.nt[o]&&(t.nt[o]=0),1<=n?(i.push(t.$[o]),r.push(t.$[o]-t.Q[o]-t.nt[o])):(i.push((t.$[o]-t.Q[o])*n+t.Q[o]),r.push((t.$[o]-t.Q[o])*e),t.nt[o]+=(t.$[o]-t.Q[o])*e);t.ct({destination:i,delta:r}),i.length=0,r.length=0},Di:function(){var i=this;this.sd=requestAnimationFrame(this.Di.bind(this));var r=(new Date).getTime(),o=r-this.xt;this.od.forEach(function(t){return t(o)});for(var t=0;t<this.rd.length;t++)this.rd[t].update(o/1e3);this.K.forEach(function(t){var n,e;t.ht||(t.ut?t.rt+=o:(n=(r-t.et)/t.ot,e=o/t.ot,i.ct(t,n,e),e=r-t.et-t.it,t.ot<=e&&(t.nt=[],t.st?(t.et=r,t.ft&&t.ft()):(e=t.ht,t.ht=!0,!e&&t.ft&&t.ft()))))}),this.xt=r,this.Po&&0===this.K.size&&this.Bi()},vt:function(t){this.Po=t},Bi:function(){this.sd&&(window.cancelAnimationFrame(this.sd),this.sd=0),this.K.forEach(function(t){t.vt()}),this.K.clear(),this.rd=[],this.od.clear(),this.Po&&this.Po({name:"Animator"})}});var Dy=Gi;ir=function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),this.I={}};Object.assign(ir.prototype,{hd:function(t,n){this.cd(t,n)||(void 0===this.I[t]&&(this.I[t]=[]),this.I[t].push(n))},cd:function(t,n){return n?void 0!==this.I[t]&&-1!==this.I[t].indexOf(n):void 0!==this.I[t]&&0<this.I[t].length},fd:function(t,n){void 0===this.I[t]||-1!==(n=this.I[t].indexOf(n))&&this.I[t].splice(n,1)},Dt:function(t){if(void 0!==this.I[t.type])for(var n=this.I[t.type].slice(0),e=0,i=n.length;e<i;e++)n[e].call(this,t)}});var Iy=ir;var Ny=function t(n){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),this.container=n.container,this.appName=n.appName,this.key=n.key,this.license=n.license,this.mapID=n.mapID,this.buildingID=n.mapID,this.mapURL=n.mapURL,this.mapURLAbsolute=void 0!==n.mapURLAbsolute&&n.mapURLAbsolute,this.merge=void 0!==n.merge?n.merge:null,this.userThemeURL=n.themeURL,this.themeURL=n.themeURL||Th.themeUrl,this.themeID=n.themeID||"2001",this.externalModelURL=n.externalModelURL,this.mu=n.theme,this.themeExtension=void 0!==n.themeExtension?n.themeExtension:{},this.isPreview="undefined"!=typeof KjWzhWlSj&&!!KjWzhWlSj.ProtoDef,this.nonFocusAlpha=void 0!==n.nonFocusAlpha?n.nonFocusAlpha:.1,this.nonFocusAlphaMode=void 0!==n.nonFocusAlphaMode&&n.nonFocusAlphaMode,this.state=n.state||{},this.center=(void 0!==this.state.center?this.state:n).center,this.zoomRange=void 0!==this.state.zoomRange?this.state.zoomRange:void 0!==n.zoomRange?n.zoomRange:[16,23],this.mapZoom=void 0!==this.state.zoom?this.state.zoom:void 0!==n.mapZoom?n.mapZoom:20,this.rotation=void 0!==this.state.rotation?this.state.rotation:void 0!==n.rotation?n.rotation:0,this.maxTiltAngle=void 0!==n.maxTiltAngle?n.maxTiltAngle:90,this.minTiltAngle=void 0!==n.minTiltAngle?n.minTiltAngle:30,this.tiltAngle=void 0!==this.state.tiltAngle?this.state.tiltAngle:void 0!==n.tiltAngle?n.tiltAngle:30,this.viewMode=void 0!==this.state.viewMode?this.state.viewMode:void 0!==n.viewMode?n.viewMode:gi.MODE_3D,this.floorSpace=void 0!==this.state.floorSpace?this.state.floorSpace:void 0!==n.floorSpace?n.floorSpace:50,this.level=void 0!==this.state.level?this.state.level:void 0!==n.level?n.level:1,this.visibleLevels=void 0!==this.state.visibleLevels?this.state.visibleLevels:void 0!==n.visibleLevels?n.visibleLevels:[1],this.buildingOptions=n.buildingOptions||{},this.navigationData=n.navigationData,this.buildings=n.buildings,this.backgroundColor=n.backgroundColor,this.backgroundAlpha=n.backgroundAlpha,this.la=n.highlightColor,this.me=void 0!==n.highlightPicker?n.highlightPicker:["click"],this.logarithmicDepthBuffer=n.logarithmicDepthBuffer||!1,this.tile=!1!==n.tile||n.tile,this.preLoad=!1!==n.preLoad||n.preLoad,this.loadLayerWaitingTime=n.loadLayerWaitingTime||.002,this.renderOrder=n.renderOrder||[Ii.EXTENT,Ii.EXTERNAL_MODEL,Ii.MODEL,Ii.DYNAMIC_MODEL_MARKER,Ii.EXTRUDE_MARKER,Ii.TUBE_MARKER,Ii.WALL_MARKER,Ii.SPHERE_MARKER,Ii.POLYGON_MARKER,Ii.HEAT_MAP_MARKER,Ii.LINE3D_MARKER,Ii.LINE_MARKER,Ii.FACILITY,Ii.LABEL,Ii.IMAGE_MARKER,Ii.TEXT_MARKER,Ii.LOCATION_MARKER],this.collisionOrder=n.collisionOrder?Pi.uniqWithArrayTwo(n.collisionOrder):[[Ii.TEXT_MARKER,Ii.IMAGE_MARKER]],this.fontFamily=n.fontFamily||'"Microsoft Yahei","微软雅黑",Tahoma,Arial',this.hdr=n.hdr,this.shadingMode=void 0!==n.shadingMode?n.shadingMode:nr.REAL,this.materialMode=void 0!==this.hdr?nr.CLASSIC:this.shadingMode,this.maxMaterialCount=void 0!==n.maxMaterialCount?n.maxMaterialCount:1/0,this.lock=void 0!==n.lock&&n.lock,this.labelField=void 0!==n.labelField?n.labelField:lp.NAME,this.enabledPanRange=void 0!==n.enabledPanRange&&n.enabledPanRange,this.panRangeValue=void 0!==n.panRangeValue?n.panRangeValue:null,this.screenLockCoords=n.screenLockCoords,this.lightConfig={FMExtentLayer:[{name:"DirectionalLight",color:11579568,intensity:.95,position:{x:58,y:65,z:40},id:0},{name:"AmbientLight",color:11579568,intensity:.85,id:1},{name:"DirectionalLight",color:6447714,intensity:.65,position:{x:-100,y:0,z:45},id:2}],FMDynamicModelLayer:[{name:"DirectionalLight",color:11579568,intensity:.95,position:{x:58,y:65,z:45},id:0},{name:"AmbientLight",color:11579568,intensity:.85,id:1},{name:"DirectionalLight",color:6447714,position:{x:-100,y:0,z:45},intensity:.45,id:2}],FMModelLayer:[{name:"DirectionalLight",color:11645361,intensity:.95,position:{x:58,y:65,z:40},id:0},{name:"AmbientLight",color:11645361,intensity:.85,id:1},{name:"DirectionalLight",color:6513507,position:{x:-100,y:0,z:45},intensity:.65,id:2}],FMExternalModelLayer:[{name:"DirectionalLight",color:11579568,intensity:.95,position:{x:58,y:65,z:45},id:0},{name:"AmbientLight",color:11579568,intensity:.85,id:1},{name:"DirectionalLight",color:6447714,position:{x:-100,y:0,z:45},intensity:.45,id:2}]},void 0!==n.light&&(this.lightConfig=n.light.getConfig()),this.lockedLight=void 0!==n.lockedLight&&n.lockedLight,this.hideList=void 0!==n.hideList?n.hideList:{},this.ClassicMaterial=void 0===n.ClassicMaterial||n.ClassicMaterial,this.isOutdoor=!0,this.enableDamping=void 0!==n.enableDamping&&n.enableDamping,this.enterTriggerMode=void 0!==n.enterTriggerMode?n.enterTriggerMode:fengmap.FMEnterTriggerMode.Entire,this.autoPlay=void 0===n.autoPlay||n.autoPlay};function Fy(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}tr=function(){function n(t){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,n),this.Pt=t,this.zoomRange=this.Pt.zoomRange,this.zoom=this.Pt.mapZoom,this.en=this.Pt.rotation,this.ld=this.Pt.maxTiltAngle,this.dd=this.Pt.minTiltAngle,this.tiltAngle=this.Pt.tiltAngle,this.At=this.Pt.viewMode,this.vd=new Map,this.pd(),this.Il=!1,this.rr=!1,this.ir=!1,this.Ul=!1,this.Fl=!1,this.Th=this.Pt.labelField,this.Wt=new St,this.md=this.Ba,this.le=!1,this.gd=!0,this.yd=!1,this.la=void 0!==this.Pt.la?this.Pt.la:null,this.bd=null,this.wd=void 0!==this.Pt.backgroundColor?this.Pt.backgroundColor:null,this._d=null,this.xd=void 0!==this.Pt.backgroundAlpha?this.Pt.backgroundAlpha:null,this.Md=null,this.ll=!1,this.ar=!1,this.sl=!1,this.ql=!0,this.nr=this.Pt.collisionOrder,this._l=this.Pt.buildingID}var t,e,i;return t=n,(e=[{key:"zoom",get:function(){return this.Ba},set:function(t){this.Ba=Math.min(Math.max(t,this.yn[0]),this.yn[1])}},{key:"zoomRange",get:function(){return this.yn},set:function(t){t[0]=Math.min(Math.max(t[0],1),29),t[1]=Math.min(Math.max(t[1],1),29),this.yn=t}},{key:"tiltAngle",get:function(){return this.$t},set:function(t){t=Math.min(Math.max(t,this.dd),this.ld),this.$t=t}},{key:"highlightColor",get:function(){return null!==this.la?this.la:this.bd},set:function(t){this.la=t}},{key:"backgroundColor",get:function(){return null!==this.wd?this.wd:this._d}},{key:"backgroundAlpha",get:function(){return null!==this.xd?this.xd:this.Md}}])&&Fy(t.prototype,e),i&&Fy(t,i),n}();Object.assign(tr.prototype,{pd:function(){this.Sd(this.Pt.buildingID);var t=this.Pt.buildingOptions.buildings;if(t)for(var n=0;n<t.length;n++)t[n].buildingID&&this.Sd(t[n].buildingID)},Xu:function(t){this.bd=t.fa(this.Pt.buildingID);t=t.$s(this.Pt.buildingID);this._d=t.clearColor,this.Md=t.clearAlpha},Ed:function(t,n){switch(t){case"click":this.gd=n;break;case"move":this.yd=n;break;case"hover":this.le=n}},Td:function(t){this.Pt.center&&(this.Wt.x=this.Pt.center.x-t.x,this.Wt.z=-this.Pt.center.y+t.y)},Tn:function(t){return this.vd.has(t)||this.Sd(t),this.vd.get(t)},Sd:function(t){var n={};if(this.Pt.buildingID===t)n={themeID:this.Pt.themeID,visibleLevels:this.Pt.visibleLevels,level:this.Pt.level,targetLevel:this.Pt.level,floorSpace:this.Pt.floorSpace,nonFocusAlphaMode:this.Pt.nonFocusAlphaMode,nonFocusAlpha:this.Pt.nonFocusAlpha};else{var e=this.Pt.buildingOptions,i=e.buildings,n={themeID:e.themeID,themeExtension:e.themeExtension,visibleLevels:void 0!==e.visibleLevels?e.visibleLevels:[],level:e.level,targetLevel:e.level,floorSpace:(void 0!==e.floorSpace?e:this.Pt).floorSpace,overviewMode:void 0!==e.overviewMode?e.overviewMode:dp.NORMAL,nonFocusAlphaMode:(void 0!==e.nonFocusAlphaMode?e:this.Pt).nonFocusAlphaMode,nonFocusAlpha:(void 0!==e.nonFocusAlpha?e:this.Pt).nonFocusAlpha,minLevel:e.minLevel,maxLevel:e.maxLevel,themeLoaded:!1,themeNeedLoad:!0};if(i)for(var r=0;r<i.length;r++)i[r].buildingID===t&&(void 0!==i[r].themeID&&(n.themeID=i[r].themeID),void 0!==i[r].themeExtension&&(n.themeExtension=i[r].themeExtension),void 0!==i[r].visibleLevels&&(n.visibleLevels=i[r].visibleLevels),void 0!==i[r].level&&(n.level=i[r].level),void 0!==i[r].targetLevel&&(n.targetLevel=i[r].targetLevel),void 0!==i[r].floorSpace&&(n.floorSpace=i[r].floorSpace),void 0!==i[r].overviewMode&&(n.overviewMode=i[r].overviewMode),void 0!==i[r].nonFocusAlphaMode&&(n.nonFocusAlphaMode=i[r].nonFocusAlphaMode),void 0!==i[r].nonFocusAlpha&&(n.nonFocusAlpha=i[r].nonFocusAlpha),void 0!==i[r].minLevel&&(n.minLevel=i[r].minLevel),void 0!==i[r].maxLevel&&(n.maxLevel=i[r].maxLevel))}n.level&&-1===n.visibleLevels.indexOf(n.level)&&(1<n.visibleLevels.length?n.visibleLevels.push(n.level):n.visibleLevels=[n.level]),this.vd.set(t,n)},yl:function(t){t=this.Tn(t);return t.levelsLoaded||(t.levelsLoaded=new Map),t.levelsLoaded},Nl:function(t){t=this.vd.get(t);return!1===t.themeNeedLoad||!1!==t.themeLoaded}});function Uy(t){Z.call(this),this.element=t,this.element.style.position="absolute",this.addEventListener("removed",function(){this.traverse(function(t){t.element instanceof Element&&null!==t.element.parentNode&&t.element.parentNode.removeChild(t.element)})})}var By=tr;(Uy.prototype=Object.create(Z.prototype)).constructor=Uy;function Gy(){var e,i,a,u,h=this,c=new St,r=new Et,f=new Et,l={objects:new WeakMap},d=document.createElement("div");function v(t,n,e){var i,r;t instanceof Uy&&(t.onBeforeRender(h,n,e),c.setFromMatrixPosition(t.matrixWorld),c.applyMatrix4(f),i=t.element,r="translate(-50%,-50%) translate("+(c.x*a+a)+"px,"+(-c.y*u+u)+"px)",i.style.WebkitTransform=r,i.style.MozTransform=r,i.style.oTransform=r,i.style.transform=r,i.style.display=t.visible&&-1<=c.z&&c.z<=1?"":"none",r={distanceToCameraSquared:p(e,t)},l.objects.set(t,r),i.parentNode!==d&&d.appendChild(i),t.onAfterRender(h,n,e));for(var o=0,s=t.children.length;o<s;o++)v(t.children[o],n,e)}d.style.overflow="hidden",this.domElement=d,this.getSize=function(){return{width:e,height:i}},this.setSize=function(t,n){a=(e=t)/2,u=(i=n)/2,d.style.width=t+"px",d.style.height=n+"px"};var o,s,p=(o=new St,s=new St,function(t,n){return o.setFromMatrixPosition(t.matrixWorld),s.setFromMatrixPosition(n.matrixWorld),o.distanceToSquared(s)});this.render=function(t,n){!0===t.autoUpdate&&t.updateMatrixWorld(),null===n.parent&&n.updateMatrixWorld(),r.copy(n.matrixWorldInverse),f.multiplyMatrices(n.projectionMatrix,r),v(t,t,n)}}function Hy(t,n){var e;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(e=function(t,n){if(t){if("string"==typeof t)return Vy(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(e="Object"===e&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Vy(t,n):void 0}}(t))||n&&t&&"number"==typeof t.length){e&&(t=e);var i=0,n=function(){};return{s:n,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},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,o=!0,s=!1;return{s:function(){e=t[Symbol.iterator]()},n:function(){var t=e.next();return o=t.done,t},e:function(t){s=!0,r=t},f:function(){try{o||null==e.return||e.return()}finally{if(s)throw r}}}}function Vy(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}function zy(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}sr=function(){function n(t){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,n),this.tt=t,this.Ld=null,this.Rd=this.Rd.bind(this),this.Od=this.Od.bind(this),this.Fi=new Lr,this.K=[]}var t,e,i;return t=n,(e=[{key:"add",value:function(t){t.tt=this,(t.Va||t.za())&&this.O(t),this.needUpdateBound=!0}},{key:"remove",value:function(t){t=this.K.indexOf(t);-1<t&&this.K.splice(t,1),this.needUpdateBound=!0}},{key:"clear",value:function(){var t,n=Hy(this.K);try{for(n.s();!(t=n.n()).done;)t.value.dispose()}catch(t){n.e(t)}finally{n.f()}this.K.length=0}},{key:"dispose",value:function(){if(null!==this.Ld){this.tt.off("resize",this.Rd),this.tt.off("beforeRender",this.Od);for(var t=0;t<this.K.length;t++)this.K[t].dispose();this.K.length=0,this.Fi=void 0,this.Ld.domElement.parentNode&&this.Ld.domElement.parentNode.removeChild(this.Ld.domElement)}}}])&&zy(t.prototype,e),i&&zy(t,i),n}();Object.assign(sr.prototype,{za:function(){this.Ld=new Gy,this.Ld.setSize(this.tt.getContainer().clientWidth,this.tt.getContainer().clientHeight),this.Ld.domElement.style.top="0px",this.Ld.domElement.style.left="0px",this.Ld.domElement.style.position="absolute",this.Ld.domElement.style.pointerEvents="none",this.tt.getContainer().appendChild(this.Ld.domElement),this.tt.on("resize",this.Rd),this.tt.on("beforeRender",this.Od)},Od:function(){for(var t=[],n=Array.from(this.tt.getRenderManager().getRenderList().keys()),e=0;e<this.K.length;e++)this.K[e].jn.element.childNodes[0].style.display="none",this.K[e].Lf();for(var i=0;i<n.length;i++){var r=n[i].split("_");-1===t.indexOf(r[0])&&t.push(r[0]);for(var o=r[0],s=r[1],a=this.tt.getBuilding(""+o),u=0;u<this.K.length;u++)this.K[u].Ad===o&&""+this.K[u].level==""+s&&this.K[u].visible&&(this.K[u].jn.element.childNodes[0].style.display="block",this.K[u].level===a.level?this.K[u].jn.element.childNodes[0].style.opacity=this.K[u].opacity:this.K[u].jn.element.childNodes[0].style.opacity=a.getFloor(this.K[u].level).Eu)}this.Ki(t),this.Ld.render(this.Fi,this.tt.camera)},Rd:function(){this.Ld.setSize(this.tt.getContainer().clientWidth,this.tt.getContainer().clientHeight)},Jc:function(t,n){for(var e=this.tt.getBuilding(""+n).visibleLevels,i=!1,r=0;r<e.length;r++)if(e[r]===t){i=!0;break}return i},Ki:function(t){for(var r=this,n=0;n<t.length;n++)for(var e=this.tt.getBuilding(""+t[n]).visibleLevels,i=0;i<e.length;i++){var o=function(t,n){for(var e=[],i=0;i<r.K.length;i++)r.K[i].$n===n&&r.K[i].Ad===t&&e.push(r.K[i]);return e}(t[n],e[i]);1<o.length&&function(t){for(var n=[],e=0;e<t.length;e++)if(t[e].Bn&&t[e].Qi){for(var i=!0,r=0;r<n.length;r++){var o=n[r].kd(),s=t[e].kd();if(!(i=!Lu.qe(s.leftTop,s.rightDown,o.leftTop,o.rightDown)))break}i?(t[e].jn.element.childNodes[0].style.display="block",t[e].Cd=!1,n.push(t[e])):(t[e].jn.element.childNodes[0].style.display="none",t[e].Cd=!0)}}(o)}},O:function(t){this.K.push(t),t.jn&&this.Fi.add(t.jn)}});var Wy=sr,_r={Entire:2,Individual:4};Object.freeze(_r);var Xy=_r;function Zy(t){return(Zy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Yy(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function qy(t,n,e){return(qy="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,n,e){t=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=$y(t)););return t}(t,n);if(t){n=Object.getOwnPropertyDescriptor(t,n);return n.get?n.get.call(e):n.value}})(t,n,e||t)}function Ky(t,n){return(Ky=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Jy(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=$y(e);return t=i?(t=$y(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Zy(t)&&"function"!=typeof t?Qy(n):t}}function Qy(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function $y(t){return($y=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}ch=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Ky(t,n)}(r,ar);var t,n,e,i=Jy(r);function r(t){var n;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),n=i.call(this),t.uatEnvironment&&Lh(),n.Kt={error:[]},n.Ms=(new Date).getTime(),n.Pt=new Ny(t),n.Et=new By(n.Pt),n.N=null,n.F=null,n.qt=null,n.Pl=!1,n.jd=new St,n.On=null!=t.followFocus&&t.followFocus,n.Pd=null,n.Dd=!1,n.Ti=[Ii.IMAGE_MARKER,Ii.TEXT_MARKER],n.It=new Iy,n.pn=new Dy,n.re=null,n.Zt=null,n.ln=null,n.an=null,n.jt=n.Id(n.Pt.container.clientWidth,n.Pt.container.clientHeight),n.cn=new ih(Qy(n),n.Pt,n.Et),n.Ii=new cd,n.Ii.tt=Qy(n),n.Z=new Hi(Qy(n),n.Pt.container,n.Et),n.Z.enableDragRange=n.Pt.enabledPanRange,n.Pt.panRangeValue&&(n.Pt.enabledPanRange=!0,n.Z.enableDragRange=!0),n.ue=new xr(Qy(n),n.Pt,n.Et),n.Bi=n.Bi.bind(Qy(n)),n.Nd=!1,n.Fd=n.Fd.bind(Qy(n)),n.Ud=n.Ud.bind(Qy(n)),n.Bd=[],n.If=new Wy(Qy(n)),n.Gd(),cf.onLoad=function(){n.enableUpdateRender()},n}return t=r,(n=[{key:"focusBuilding",get:function(){return this.Hd}},{key:"x",get:function(){return this.N}},{key:"y",get:function(){return this.F}},{key:"bound",get:function(){var n=this;return!0===this.needUpdateBound&&0<this.K.length&&(this.Gn.reset(),this.K.forEach(function(t){n.Gn.expand(t.bound)}),this.Gn.expand(this.Ii.bound),this.needUpdateBound=!1),this.Gn.clone()}},{key:"camera",get:function(){return this.jt},set:function(t){this.jt=t}},{key:"followFocus",get:function(){return this.On},set:function(t){this.On!==t&&(this.On=t,this.On||this.Z.An(this.qt,{level:this.getLevel()}))}},{key:"removeAnimator",value:function(t){this.pn.vn(t)}},{key:"copyCamera",value:function(){var t=null;return(t=this.jt===this.ln?new Y(pi.FOV,1,pi.CAMERA_NEAR,pi.CAMERA_FAR):new q(1,1,1,1,pi.CAMERA_NEAR,pi.CAMERA_FAR)).copy(this.jt),t}},{key:"enableUpdateRender",value:function(){this.Et.ar=!0}},{key:"enableUpdateNode",value:function(){this.Et.sl=!0}},{key:"getFloorInfos",value:function(){return this.getBuilding(this.Pt.buildingID).getFloorInfos()}},{key:"setHighlightColor",value:function(t){this.Et.highlightColor=t}},{key:"setControlTarget",value:function(t){this.Z.in(t)}},{key:"resize",value:function(t,n){this.cn.Ui(t,n)}},{key:"getMarkerGroup",value:function(){return this.Ii}},{key:"getVisibleLevels",value:function(){return this.qt.visibleLevels}},{key:"setTheme",value:function(t){this.Zt.xh({themeID:t,bid:this.Pt.buildingID})}},{key:"setThemeExtension",value:function(t){this.Zt.Mh({data:t,bid:this.Pt.buildingID})}},{key:"clearThemeExtension",value:function(){this.Zt.Mh({bid:this.Pt.buildingID})}},{key:"getRenderOrder",value:function(){return this.cn.Ti}},{key:"setRenderOrder",value:function(t){this.cn.zi(t)}},{key:"getCollisionOrder",value:function(){return this.Et.nr}},{key:"setCollisionOrder",value:function(t){this.Et.nr=Pi.uniqWithArrayTwo(t),this.Zt.er()}},{key:"adjustRenderOrder",value:function(t){this.cn.Vi(t)}},{key:"setVisibleLevels",value:function(t,n){this.qt.setVisibleLevels(t,n)}},{key:"getRenderManager",value:function(){return this.cn}},{key:"setRenderManager",value:function(t){for(var n in this.cn.render=t.render,this.cn.getLayerType=t.getLayerType,t)this.cn[n]=t[n]}},{key:"getCenter",value:function(){return this.Z.Mn()}},{key:"setCenter",value:function(t){this.Z.Sn(t)}},{key:"zoomIn",value:function(){this.Z.gn(1.02)}},{key:"zoomOut",value:function(){this.Z.gn(.98)}},{key:"getZoomRange",value:function(){return this.Et.yn}},{key:"setZoomRange",value:function(t){this.Z.xn(t)}},{key:"getZoom",value:function(){return this.Z.bn()}},{key:"setZoom",value:function(t){this.Z._n(t)}},{key:"getRotation",value:function(){return this.Z.kn()}},{key:"setRotation",value:function(t){this.Z.Cn(t)}},{key:"autoRotate",value:function(t){return(t=t||{}).loop=!0,void 0===t.duration&&(t.duration=5),this.Z.Cn(t)}},{key:"getTilt",value:function(){return Ti.round(90-this.Z.Ct.getPolarAngle()*pi.RAD2DEG)}},{key:"setTilt",value:function(t){t.tilt=Mt.clamp(t.tilt,this.Pt.minTiltAngle,this.Pt.maxTiltAngle),this.Et.$t=t.tilt,this.Z.sn(t)}},{key:"getFloor",value:function(t){return null===this.qt?null:this.qt.getFloor(t)}},{key:"getLevel",value:function(){return this.qt.level}},{key:"getLevels",value:function(){return null!==this.qt?this.qt.qn:null}},{key:"setLevel",value:function(t){this.Zt.ne(this.qt,t)}},{key:"getFloorSpace",value:function(){return null!==this.qt?this.qt.floorSpace:null}},{key:"setFloorSpace",value:function(t){this.qt.floorSpace=t,this.It.Dt({type:"floorSpaceChanged"});for(var n=this.Ii.K,e=0;e<n.length;e++)n[e].Lf()}},{key:"getViewMode",value:function(){return this.jt.isPerspectiveCamera?gi.MODE_3D:gi.MODE_2D}},{key:"setViewMode",value:function(t){this.Z.rn(t)}},{key:"getInteracations",value:function(){return this.Z}},{key:"getBound",value:function(){return this.qt.bound.clone()}},{key:"getState",value:function(){return{center:this.getCenter(),zoom:this.getZoom(),rotation:this.getRotation(),tiltAngle:this.getTilt(),viewMode:this.getViewMode(),level:this.qt.level,floorSpace:this.getFloorSpace(),visibleLevels:this.qt.visibleLevels,viewBuildingID:this.Et._l}}},{key:"setState",value:function(t,n){var e=this,i=!1!==(n=n||{}).animate;this.Z.pauseDamping(),this.setFloorSpace(t.floorSpace),this.setCenter({animate:i,x:t.center.x,y:t.center.y,finish:function(){e.setRotation({animate:i,rotation:t.rotation,finish:function(){e.setTilt({animate:i,tilt:t.tiltAngle,finish:function(){e.setZoom({animate:i,zoom:t.zoom,finish:function(){e.setViewMode({animate:i,mode:t.viewMode,finish:function(){e.setVisibleLevels(t.visibleLevels,function(){e.setLevel({animate:i,level:t.level,finish:function(){e.Z.resumeDamping(),n.finish&&n.finish()}})})}})}})}})}})}})}},{key:"getNodes",value:function(t,n){var e,s=this,i=[],r=this.qt,o=[Ii.LABEL_LAYER,Ii.FACILITY_LAYER,Ii.MODEL_LAYER,Ii.EXTENT_LAYER,Ii.EXTERNAL_MODEL_LAYER],a={};if(n)for(var u=0;u<n.length;u++){var h=(h=n[u].buildingID)||this.qt.buildingID,c=function(t,n){var e=[],i=t.buildingID;i=i||s.qt.buildingID;for(var r=t.levels,o=0;o<n.length;o++)n[o].buildingID!==i||r&&-1===r.indexOf(n[o].level)||e.push(n[o]);return e}(n[u],t);a[""+h]=c}else for(var f=0;f<t.length;f++){var l=a[""+t[f].buildingID];l?l.push(t[f]):a[""+t[f].buildingID]=[t[f]]}for(e in a)for(var d=a[e],r=function(t){for(var n=null,e=0;e<s.K.length;e++)if(s.K[e].buildingID===t){n=s.K[e];break}return n}(""+e),v=0;v<d.length;v++){var p=d[v].level,m=d[v].eid,g=d[v].type;t:for(var y=0;y<r.K.length;y++)if(r.K[y].$n===p)for(var b=(b=r.K[y].getLayers()).filter(function(t){return o.includes(t.type)}),w=0;w<b.length;w++)for(var _=0;_<b[w].K.length;_++)if(b[w].K[_].Ee.Yt===m&&b[w].K[_].Un===g){i.push(b[w].K[_]);break t}}return i}},{key:"getDataManager",value:function(){return this.re}},{key:"getMapOptions",value:function(){return this.Pt}},{key:"getContainer",value:function(){return this.Pt.container}},{key:"setFitView",value:function(t,n){var e=this,i=!1!==(n=n||{}).animate,r=this.getZoomRange(),o=this.copyCamera(),s=this.Z.copyControls(o),a=this.Z.Ct,u=this.jt;this.Z.Ct=s,this.jt=o,this.setZoomRange([1,29]),s.enableDamping=!1,this.Z.An(this.qt,{level:this.getLevel(),animate:!1}),this.setCenter({animate:!1,x:t.center.x,y:t.center.y,finish:function(){e.Vd(t,5,0,function(t){e.Z.Ct=a,e.jt=u,e.setZoomRange(r),s.dispose(),s=null,e.enableUpdateRender(),e.setZoom({animate:i,zoom:t.zoom,duration:.5}),e.setCenter({animate:i,x:t.center.x,y:t.center.y,duration:.5,finish:function(){n.finish&&n.finish()}})})}})}},{key:"setBackgroundColor",value:function(t,n){this.cn.renderer.setClearColor("string"===t?parseInt(t.slice(1),16):t,n),this.enableUpdateRender()}},{key:"setLabelField",value:function(t){this.Et.Th=t,this.Zt.Sl(),this.Zt.er()}},{key:"getBuilding",value:function(t){return this.Wo({bid:t})}},{key:"getBuildings",value:function(){var n=this,e=[];return this.traverse(function(t){t!==n.qt&&e.push(t)}),e}},{key:"changeOverviewMode",value:function(t){for(var n=0;n<t.buildingIDs.length;n++){var e=this.getBuilding(t.buildingIDs[n]);e.dh!==t.overviewMode&&(e.dh=t.overviewMode,this.followFocus&&t.overviewMode!=fengmap.FMOverviewMode.OUTDOOR&&e.parent.focusBuilding&&e.parent.focusBuilding.buildingID==e.buildingID&&e.setLevel({level:e.level}),e.Sh(),this.Zt.ul({bid:t.buildingIDs[n]}),this.It.Dt({type:"buildingOverviewModeChanged",buildingID:t.buildingIDs[n]}))}t.overviewMode==fengmap.FMOverviewMode.OUTDOOR&&this.followFocus&&this.qt.setLevel({level:this.qt.level})}},{key:"enterBuilding",value:function(t){var n=this,e=this.getBuilding(t.buildingID);this.Z.Sn({x:e.x,y:e.y,animate:!0,duration:.5,finish:function(){n.getBuildings().forEach(function(t){n.Bd.push({buildingID:t.buildingID,visible:t.visible}),t.visible=!1}),e.visible=!0,n.Et._l=t.buildingID,n.Zt._h(e),n.Zt.Ln(),n.Zt.fl(e,{}),n.It.Dt({type:"ViewBuildingChange",buildingID:n.Et._l}),n.It.Dt({type:"buildingEntered",buildingID:n.Et._l}),t.finish&&t.finish({buildingID:t.buildingID})}})}},{key:"exitBuilding",value:function(t){var n=this;this.Bd.forEach(function(t){n.getBuilding(t.buildingID).visible=t.visible}),this.Bd.length=0;var e=this.getBuilding(this.Et._l);this.Z.Sn({x:e.x,y:e.y,animate:!0,duration:.5,finish:function(){n.Et._l=n.Pt.buildingID,n.Zt.Ln(),n.Zt.fl(e,{}),n.It.Dt({type:"ViewBuildingChange",buildingID:n.Et._l}),n.It.Dt({type:"buildingExited",buildingID:e.Yt}),t.finish&&t.finish({buildingID:e.Yt})}})}},{key:"on",value:function(t,n){this.It&&(this.It.hd(t,n),this.Et.Ed(t,!0))}},{key:"off",value:function(t,n){this.It&&(this.It.fd(t,n),this.It.cd(t)||this.Et&&this.Et.Ed(t,!1))}},{key:"pickFilterFunction",value:function(){return!0}},{key:"dispose",value:function(){var t,n=this;this.Nd||(this.Nd=!0,this.If.dispose(),this.cn.vt(),this.Pt.container.removeChild(this.cn.renderer.domElement),t=function(){n.re.vt(function(){n.pn.vt(function(){n.Zt.vt(function(){n.Bi(),qy($y(r.prototype),"dispose",n).call(n)})})})},cf.isLoaded()?t():cf.onLoad=t)}}])&&Yy(t.prototype,n),e&&Yy(t,e),r}();Object.assign(ch.prototype,{Bi:function(){for(var t,n=[this.ue,this.Z],e=0;e<n.length;e++)n[e].vt();for(t in this.cn.Bi(),this.cn=null,this.re=null,this.Zt=null,this)-1<n.indexOf(this[""+t])&&delete this[""+t];this.qt=n=null},Id:function(t,n){return this.ln=new Y(pi.FOV,t/n,pi.CAMERA_NEAR,pi.CAMERA_FAR),this.an=new q(-t/2,t/2,n/2,-n/2,pi.CAMERA_NEAR,pi.CAMERA_FAR),this.Et.At===gi.MODE_3D?this.ln:this.an},mn:function(t){(t.tt=this).K.push(t),this.needUpdateBound=!0},Kl:function(t){var n=[];n.push({x:t.min.x,y:t.min.y}),n.push({x:t.min.x,y:t.max.y}),n.push({x:t.max.x,y:t.max.y}),n.push({x:t.max.x,y:t.min.y});for(var e=new rr,i=0;i<n.length;i++){var r=wy.coordsMapToScreen(this,{x:n[i].x,y:n[i].y,level:this.getLevel(),height:0});if(null===r)return null;e.Nn([r])}return e},zd:function(t){var n=this.cn.renderer.domElement.clientHeight,e=this.cn.renderer.domElement.clientWidth,i=this.getZoom(),i=this.Z.Vt(i),t=this.Kl(t);if(!t)return null;t=t.size;return i*(e/n>t.x/t.y?t.y/n:t.x/e)},Wd:function(t){t=this.Kl(t);return t?wy.coordsScreenToMap(this,{x:(t.max.x+t.min.x)/2,y:(t.max.y+t.min.y)/2,level:this.getLevel()}):null},Vd:function(n,e,i,r){var o=this,s=this.getZoom(),t=this.zd(n);t?s=this.Z.wn(t):s-=1,this.setZoom({animate:!1,zoom:s,finish:function(){var t=o.Wd(n);t?o.setCenter({animate:!1,x:t.x,y:t.y,finish:function(){++i===e?r({zoom:s,center:t}):o.Vd(n,e,i,r)}}):0<s?o.Vd(n,e,i,r):r({zoom:s,center:n.center})}})},Fd:function(){var t=this.getZoom();Math.abs(t-this.Et.md)>pi.EPS&&(this.It.Dt({type:"zoom",zoom:t}),this.jt.isOrthographicCamera&&this.cn.hn(),this.Et.md=t)},Ud:function(){var t;!this.Et.yd||(t=this.Z.Ct.target).distanceToSquared(this.jd)>pi.EPS&&(this.It.Dt({type:"move",center:this.getCenter()}),this.jd=t.clone(),t=null)},Gd:function(){var t,n,e,i,s=this,a=!0;n=(t=this).Pt,e=this.Et,i=function(t,n,e,i,r,o){a&&(s.Et.Td(s.qt),a=s.Z.Ht()),s.cn.Ln(),s.jt.updateMatrixWorld(),e&&o&&s.Z.mn([s.Fd,s.Ud]),r&&o&&s.It.Dt({type:"loaded"})},t.re=new bc({mapCreateTime:t.Ms}),t.Zt=new Py(t,n,e,i),t.Zt.Ll()},Wo:function(n){var e=null;return this.traverse(function(t){t.Yt!==n.bid&&t.Wn!==n.mid||(e=t)}),e},Xd:function(){var t=this.cn.renderer.domElement,t={x:t.clientWidth/2,y:t.clientHeight/2,z:this.Z.controls.target.y};return wy.coordsScreenToMap(this,t)},xl:function(e){var i=this;if(e===this.qt)return!1;var r=!1;if(this.Pt.enterTriggerMode===Xy.Individual)e.Wu.hh.forEach(function(t,n){t.type===Ii.MODEL&&t.level===i.qt.level&&yv.isContain(t.coordinates[0],i.Xd())&&(i.Hd=e,r=!0)});else for(var t,n=0;n<e.levelChart.length;n+=2)e.levelChart[n]===this.qt.level&&(t=e.levelChart[n+1],t=e.td.get(t),yv.isContain(t[0],this.Xd())&&(this.Hd=e,r=!0));return r},al:function(n){var e=this;this.traverse(function(t){e.Hd||(e.xl(t),e.Hd&&n(t))})},hl:function(){var n=this;this.getZoom();if(this.Dd&&(this.Hd.Yt!=this.Et.Pt.mapID&&this.Zd())){if(this.getState().viewBuildingID&&this.getState().viewBuildingID!==this.Et.Pt.mapID)return;var t={type:"buildingExited",buildingID:this.Hd.Yt};this.Dd=!1,this.Hd=null,this.It.Dt(t)}this.traverse(function(t){n.Dd||n.xl(t)&&n.Ml()&&(n.getState().viewBuildingID&&n.getState().viewBuildingID!==n.Et.Pt.mapID||(n.Dd=!0,n.It.Dt({type:"buildingEntered",buildingID:t.Yt})))})},Zd:function(){var t=this.Yd();if(this.Hd.overviewMode!=fengmap.FMOverviewMode.NORMAL)return!t;var n=this.getZoom(),n=n<this.Hd.ku||n>=this.Hd.Au;return!t||n},Ml:function(){if(this.Hd.overviewMode!=fengmap.FMOverviewMode.NORMAL)return!0;var t=this.getZoom();return!(t<this.Hd.ku||t>=this.Hd.Au)},Yd:function(){var n=this;if(null==this.Hd)return!1;if(this.xl(this.Hd))return!0;var t=this.Hd.getFloor(this.Hd.level).getLayers(Ii.EXTENT_LAYER)[0];if(null==t||null==t)return!1;var e=!1;return t&&t.traverse(function(t){e=!yv.isContain(t.coordinates[0],n.Xd())}),!e}});var tb=ch;function nb(t){return(nb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function eb(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function ib(t,n){return(ib=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function rb(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=ob(e);return t=i?(t=ob(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==nb(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function ob(t){return(ob=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}Ri=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&ib(t,n)}(r,ar);var t,n,e,i=rb(r);function r(t){var n;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(n=i.call(this)).Jt=void 0!==(t=t||{}).height?t.height:1,n.N=t.x,n.F=t.y,n.jn=null,n.Va=!1,n}return t=r,(n=[{key:"x",get:function(){return this.N}},{key:"y",get:function(){return this.F}},{key:"height",get:function(){return this.Jt},set:function(t){this.Jt=t,this.Lf()}},{key:"level",get:function(){var t=this.Vn(ug);return t?t.level:null}},{key:"visible",get:function(){return this.Bn},set:function(t){this.Bn=t,this.jn&&(this.jn.visible=this.Bn,(t=this.Vn(tb))&&t.enableUpdateRender())}},{key:"opacity",get:function(){return this.Eu},set:function(t){this.Eu=t,this.jn&&(this.jn.material.opacity=this.Eu)}},{key:"isMarker",get:function(){return!0}},{key:"addTo",value:function(t){t.getOrCreateLayer(this.Un).add(this)}},{key:"remove",value:function(){var t=this.Vn(tb);this.tt&&this.tt.remove(this),t&&t.enableUpdateRender()}},{key:"dispose",value:function(){var n=this;this.remove(),this.jn&&(this.jn.traverse(function(t){t instanceof Ko&&(t.geometry.dispose(),t.geometry=void 0,Array.isArray(t.material)?t.material.forEach(function(t){n.qd(t)}):n.qd(t.material)),"SkinnedMesh"===t.type&&t.skeleton.boneTexture&&t.skeleton.boneTexture.dispose()}),this.jn.mapNode=void 0,this.jn=void 0),this.Va=!1}}])&&eb(t.prototype,n),e&&eb(t,e),r}();Object.assign(Ri.prototype,{qd:function(t){if(t){if(t instanceof rf){var n,e=t.uniforms;for(n in e)e[n]&&e[n].value instanceof Sr&&e[n].value.dispose();t.dispose()}else for(var i in t)t[i]&&t[i]instanceof Sr&&t[i].dispose();t.dispose()}},Kd:function(){var t;void 0!==this.N&&void 0!==this.F||(t=this.Vn(ug),this.N=t.center.x,this.F=t.center.y)},za:function(){return!1},Lf:function(){}});var sb=Ri;function ab(t){return(ab="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ub(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function hb(t,n,e){return(hb="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,n,e){t=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=db(t)););return t}(t,n);if(t){n=Object.getOwnPropertyDescriptor(t,n);return n.get?n.get.call(e):n.value}})(t,n,e||t)}function cb(t,n){return(cb=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function fb(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=db(e);return t=i?(t=db(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==ab(t)&&"function"!=typeof t?lb(n):t}}function lb(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function db(t){return(db=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}e=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&cb(t,n)}(r,sb);var t,n,e,i=fb(r);function r(t){var n;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(n=i.call(this,t)).Un=Ii.IMAGE_MARKER,n.gu=t.url,n.Xi=void 0!==t.size?t.size:32,n.Jd=void 0!==t.depth&&t.depth,n.Eu=void 0!==t.opacity?t.opacity:1,n.Qi=void 0===t.collision||t.collision,n.Wt=Pi.getCenterByAnchor(t.anchor),n.Lt=null,n.Qd=null,n.$d=new Map,n.Yi=n.Yi.bind(lb(n)),n}return t=r,(n=[{key:"bound",get:function(){return!0===this.needUpdateBound&&(this.Gn.reset(),void 0!==this.N&&void 0!==this.F&&(this.Gn.expandByCoords([{x:this.N,y:this.F}]),this.needUpdateBound=!1)),this.Gn.clone()}},{key:"collision",get:function(){return this.Qi},set:function(t){this.Qi!==t&&(this.Qi=t,(t=this.Vn(tb))&&t.Zt.er())}},{key:"url",get:function(){return this.gu},set:function(t){this.gu=t,this.Mu()}},{key:"opacity",get:function(){return this.Eu},set:function(t){this.Eu=t,this.Mu()}},{key:"moveTo",value:function(t){var n=this,e=void 0!==t.animate&&t.animate,i=t.duration||.5;if(e){e=this.Vn(tb);if(e)return this.Lt||(this.Lt=new Oi),this.Lt.pt([this.N,this.F]),this.Lt.mt([t.x,t.y]),this.Lt.gt(i).bt(function(t){n.N=t.destination[0],n.F=t.destination[1],n.Lf()}).wt(function(){n.N=t.x,n.F=t.y,n.Lf(),t.finish&&t.finish()}),e.pn.mn(this.Lt.dt()),this.Lt}else this.N=t.x,this.F=t.y,this.Lf()}},{key:"stop",value:function(){var t=this.Vn(tb);t&&(this.Lt&&(t.pn.vn(this.Lt),this.Lt=null),this.Qd&&(t.pn.vn(this.Qd),this.Qd=null),this.tv&&(t.pn.vn(this.tv),this.tv=null))}},{key:"jump",value:function(t){var n=this;if(this.jn){var e=this.Vn(tb);if(e){var i=void 0!==t.duration?t.duration:1,r=void 0!==t.times?t.times:1,o=void 0!==t.delay?t.delay:0,s=0;return this.Qd?(this.Qd.pt([this.Jt]),this.Qd.mt([this.Jt+t.height])):(this.Qd=new Oi({src:[this.Jt],dest:[this.Jt+t.height]}),e.pn.mn(this.Qd)),this.Qd.gt(i).yt(0).bt(function(t){n.jn.position.y=t.destination[0],e.enableUpdateRender()}).wt(function(){var t;(s+=.5)<r&&(t=s%1==0?0:o,n.Qd.St().yt(t),n.Qd.dt())}),this.Qd.dt(),this.Qd}}}},{key:"stopJump",value:function(){var t;!this.jn||(t=this.Vn(tb))&&(this.Qd&&(t.pn.vn(this.Qd),this.Qd=null),this.jn.position.y=this.Jt,t.enableUpdateRender())}},{key:"addTo",value:function(t){hb(db(r.prototype),"addTo",this).call(this,t);t=this.Vn(tb);t&&(t.on("viewModeChanged",this.Yi),t.on("zoom",this.Yi),t.on("resize",this.Yi),t.Zt.er())}},{key:"remove",value:function(){this.stop();var t=this.Vn(tb);t&&(t.off("viewModeChanged",this.Yi),t.off("zoom",this.Yi),t.off("resize",this.Yi),hb(db(r.prototype),"remove",this).call(this),t.Zt.er(),t.enableUpdateRender())}},{key:"getRenderNode",value:function(){return this.jn}}])&&ub(t.prototype,n),e&&ub(t,e),r}();Object.assign(e.prototype,{za:function(){if(!this.gu)return!1;var t=this.Vn(tb);if(!t)return!1;t=this.be(t);return this.jn=new cp(t),this.jn.center.set(this.Wt.x,this.Wt.y),this.jn.visible=this.Bn,this.Yi(),this.Lf(),(this.jn.mapNode=this).Va=!0},Lf:function(){var t=this.Vn(tb);if(!t)return!1;this.jn.position.set(this.N-t.x,this.Jt,-this.F+t.y),this.needUpdateBound=!0,t.enableUpdateRender()},Yi:function(){var t,n,e=this.Vn(tb);e&&(t=e.Zt.Rh(this.Xi),n=1,this.jn.material.userData.scaleRatio&&(n=this.jn.material.userData.scaleRatio),this.jn.scale.set(t,t/n,t),e.enableUpdateRender())},Mu:function(){var t=this.Vn(tb);t&&(this.jn.material=this.be(t),this.Yi())},be:function(t){var n=this,e=this.Vn(ug);return t.Zt.xe.Ws({url:this.gu,needDepth:this.Jd,opacity:this.Eu*e.Eu},function(){n.jn&&n.Yi(),t.enableUpdateRender()})}});Ru=e;function vb(t){return(vb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function pb(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function mb(t,n,e){return(mb="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,n,e){t=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=wb(t)););return t}(t,n);if(t){n=Object.getOwnPropertyDescriptor(t,n);return n.get?n.get.call(e):n.value}})(t,n,e||t)}function gb(t,n){return(gb=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function yb(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=wb(e);return t=i?(t=wb(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==vb(t)&&"function"!=typeof t?bb(n):t}}function bb(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function wb(t){return(wb=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}yh=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&gb(t,n)}(r,sb);var t,n,e,i=yb(r);function r(t){var n;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(n=i.call(this,t)).Un=void 0!==t.type?t.type:Ii.TEXT_MARKER,n.Lh=void 0!==t.text?t.text:"",n.nv=void 0!==t.fontsize?t.fontsize:20,n.ev=t.fontFamily,n.iv=void 0!==t.fillColor?t.fillColor:"0,0,0",n.rv=void 0!==t.strokeColor?t.strokeColor:"255,225,255",n.ov=void 0!==t.strokeWidth?t.strokeWidth:1,n.sv=t.plateColor,n.av=t.plateStrokeColor,n.Jd=void 0!==t.depth&&t.depth,n.Qi=void 0===t.collision||t.collision,n.Eu=void 0!==t.opacity?t.opacity:1,n.hv=void 0!==t.textAlign?t.textAlign:Cc.Center,n.Wt=Pi.getCenterByAnchor(t.anchor),n.Xi=0,n.Lt=null,n.Yi=n.Yi.bind(bb(n)),n}return t=r,(n=[{key:"bound",get:function(){return!0===this.needUpdateBound&&(this.Gn.reset(),void 0!==this.N&&void 0!==this.F&&(this.Gn.expandByCoords([{x:this.N,y:this.F}]),this.needUpdateBound=!1)),this.Gn.clone()}},{key:"collision",get:function(){return this.Qi},set:function(t){this.Qi!==t&&(this.Qi=t,(t=this.Vn(tb))&&t.Zt.er())}},{key:"size",get:function(){return this.Xi},set:function(t){this.Xi=t}},{key:"text",get:function(){return this.Lh},set:function(t){this.Lh=t}},{key:"fillColor",get:function(){return this.iv},set:function(t){this.iv=t}},{key:"strokeColor",get:function(){return this.rv},set:function(t){this.rv=t}},{key:"strokeWidth",get:function(){return this.ov},set:function(t){this.ov=t}},{key:"fontsize",get:function(){return this.nv}},{key:"plateColor",get:function(){return this.sv},set:function(t){this.sv=t}},{key:"plateStrokeColor",get:function(){return this.av},set:function(t){this.av=t}},{key:"moveTo",value:function(t){var n=this,e=void 0!==t.animate&&t.animate,i=void 0!==t.duration?t.duration:.5;if(e){e=this.Vn(tb);if(!e)return!1;this.Lt||(this.Lt=new Oi),this.Lt.pt([this.N,this.F]).mt([t.x,t.y]).gt(i).bt(function(t){n.N=t.destination[0],n.F=t.destination[1],n.Lf()}).wt(function(){n.N=t.x,n.F=t.y,n.Lf(),t.finish&&t.finish()}),e.pn.mn(this.Lt.dt())}else this.N=t.x,this.F=t.y,this.Lf();return this.Lt}},{key:"stop",value:function(){var t;!this.Lt||(t=this.Vn(tb))&&(t.pn.vn(this.Lt),this.Lt=null,this.cv=!1)}},{key:"update",value:function(){this.Mu()}},{key:"addTo",value:function(t){mb(wb(r.prototype),"addTo",this).call(this,t);t=this.Vn(tb);t&&(t.on("viewModeChanged",this.Yi),t.on("zoom",this.Yi),t.on("resize",this.Yi),t.Zt.er())}},{key:"remove",value:function(){this.stop();var t=this.Vn(tb);t&&(t.off("viewModeChanged",this.Yi),t.off("zoom",this.Yi),t.off("resize",this.Yi),mb(wb(r.prototype),"remove",this).call(this),t.Zt.er())}},{key:"setInitWriteRenderNodeFunction",value:function(t){this.fv=t}},{key:"findParent",value:function(t){return this.Vn(t)}},{key:"updateSize",value:function(){this.Yi()}},{key:"getRenderNode",value:function(){return this.jn}},{key:"getScreenSize",value:function(){var t=null;return t=this.jn?{width:this.jn.material.map.image.width/2,height:this.jn.material.map.image.height/2}:t}}])&&pb(t.prototype,n),e&&pb(t,e),r}();Object.assign(yh.prototype,{za:function(){var t=this.Vn(tb);if(!t)return!1;t=t.Zt,t=this.be(t.xe);return this.jn=new cp(t),this.jn.center.set(this.Wt.x,this.Wt.y),this.Yi(),this.Lf(),(this.jn.mapNode=this).Va=!0,this.fv&&(this.jn=this.fv(this.jn)),!0},Lf:function(){var t=this.Vn(tb);if(!t)return!1;this.jn.position.set(this.N-t.x,this.Jt,-this.F+t.y),this.needUpdateBound=!0,t.enableUpdateRender()},Yi:function(){var t=this.Vn(tb);if(!t)return!1;var n=t.Zt.Rh(this.Xi);this.jn.scale.set(n,n,n),this.jn.scale.multiplyScalar(this.jn.material.userData.mspriteScale),this.jn.scale.setX(this.jn.scale.x/this.jn.material.userData.scaleRatio),t.enableUpdateRender()},Mu:function(){var t=this.Vn(tb);t&&(this.jn.material.map&&this.jn.material.map.dispose(),this.jn.material.dispose(),this.jn.material=this.be(t.Zt.xe),this.Yi())},be:function(t){var n=this.Vn(ug),n=t.Hs(this.Lh,{fontsize:this.nv,fillColor:Ti.toRgba(this.iv),strokeColor:Ti.toRgba(this.rv),plateColor:Ti.toRgba(this.sv),plateStrokeColor:Ti.toRgba(this.av),strokeWidth:this.ov},{family:this.ev,needSize:!0,opacity:this.Eu*n.Eu,textAlign:this.hv});return this.Xi=n.size,n}});vi=yh;function _b(t,n,e,i,r,o){Dr.call(this),this.type="TubeGeometry",this.parameters={path:t,tubularSegments:n,radius:e,radialSegments:i,closed:r},void 0!==o&&console.warn("THREE.TubeGeometry: taper has been removed.");r=new xb(t,n,e,i,r);this.tangents=r.tangents,this.normals=r.normals,this.binormals=r.binormals,this.fromBufferGeometry(r),this.mergeVertices()}function xb(o,s,a,u,t){eo.call(this),this.type="TubeBufferGeometry",this.parameters={path:o,tubularSegments:s,radius:a,radialSegments:u,closed:t},a=a||1,u=u||8;var h=o.computeFrenetFrames(s=s||64,t=t||!1);this.tangents=h.tangents,this.normals=h.normals,this.binormals=h.binormals;var r,c,f=new St,l=new St,n=new fi,d=new St,v=[],p=[],e=[],m=[];function i(t){d=o.getPointAt(t/s,d);var n=h.normals[t],e=h.binormals[t];for(c=0;c<=u;c++){var i=c/u*Math.PI*2,r=Math.sin(i),i=-Math.cos(i);l.x=i*n.x+r*e.x,l.y=i*n.y+r*e.y,l.z=i*n.z+r*e.z,l.normalize(),p.push(l.x,l.y,l.z),f.x=d.x+a*l.x,f.y=d.y+a*l.y,f.z=d.z+a*l.z,v.push(f.x,f.y,f.z)}}!function(){for(r=0;r<s;r++)i(r);i(!1===t?s:0),function(){for(r=0;r<=s;r++)for(c=0;c<=u;c++)n.x=r/s,n.y=c/u,e.push(n.x,n.y)}(),function(){for(c=1;c<=s;c++)for(r=1;r<=u;r++){var t=(u+1)*(c-1)+(r-1),n=(u+1)*c+(r-1),e=(u+1)*c+r,i=(u+1)*(c-1)+r;m.push(t,n,i),m.push(n,e,i)}}()}(),this.setIndex(m),this.setAttribute("position",new Wr(v,3)),this.setAttribute("normal",new Wr(p,3)),this.setAttribute("uv",new Wr(e,2))}function Mb(t){return(Mb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Sb(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Eb(t,n,e){return(Eb="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,n,e){t=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=Ob(t)););return t}(t,n);if(t){n=Object.getOwnPropertyDescriptor(t,n);return n.get?n.get.call(e):n.value}})(t,n,e||t)}function Tb(t,n){return(Tb=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Lb(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Ob(e);return t=i?(t=Ob(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Mb(t)&&"function"!=typeof t?Rb(n):t}}function Rb(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ob(t){return(Ob=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}(_b.prototype=Object.create(Dr.prototype)).constructor=_b,(xb.prototype=Object.create(eo.prototype)).constructor=xb;mi=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Tb(t,n)}(r,sb);var t,n,e,i=Lb(r);function r(t){var n;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(n=i.call(this,t)).Un=Ii.WALL_MARKER,n.lv=t.points,n.Du=t.color,n.Eu=t.opacity,void 0===n.Eu&&(n.Eu=1),n.Jt=t.height,void 0===n.Jt&&(n.Jt=0),n.dv=t.extrudeHeight,void 0===n.dv&&(n.dv=1),n.gu=t.url,n.vv=t.count,n.jn=null,n.pv=90,n.mv=null,n.gv=!1,n.yv=!1,n.bv=null,n.ct=n.ct.bind(Rb(n)),n}return t=r,(n=[{key:"opacity",get:function(){return this.Eu},set:function(t){this.Eu=t,this.jn&&(this.jn.material.opacity=this.Eu,this.wv())}},{key:"color",get:function(){return this.Du},set:function(t){this.Du=t,this.jn.material.color=new _i(t),this.wv()}},{key:"points",get:function(){return this.lv},set:function(t){this.lv=t;t=this.jn.parent;t.remove(this.jn),this.jn.geometry.dispose(),this.jn.material.dispose(),this.za(),t.add(this.jn),this.wv()}},{key:"url",get:function(){return this.gu},set:function(t){var r=this;this.gu=t,"ShaderMaterial"!==this.jn.material.type?this.gu&&this._v(this.gu,function(t){var n=r.xv(t),e=document.createElement("canvas");e.width=512,e.height=1024;var i=e.getContext("2d");i.drawImage(t,0,0,512,512),i.drawImage(n,0,512,512,512);e=new Vu(e);e.repeat.set(r.vv,1),e.wrapS=e.wrapT=Sn,r.jn.material.color=null,r.jn.material.map=e,r.jn.material.needsUpdate=!0,r.wv()}):this.mv.getMaterial(this,function(t){r.jn.material.dispose(),r.jn.material=t})}},{key:"count",get:function(){return this.vv},set:function(t){this.vv=t,this.jn.material.map&&(this.jn.material.map.repeat.set(this.vv,1),this.jn.material.needsUpdate=!0),this.wv()}},{key:"height",get:function(){return this.Jt},set:function(t){var n=this;this.Jt=t;t=this.jn.parent;t.remove(this.jn),this.jn.geometry.dispose(),this.jn.material.dispose(),this.za(),t.add(this.jn),null!==this.mv?this.mv.getMaterial(this,function(t){n.jn.material.dispose(),n.jn.material=t,n.wv()}):this.wv()}},{key:"extrudeHeight",get:function(){return this.dv},set:function(t){var n=this;this.dv=t;t=this.jn.parent;t.remove(this.jn),this.jn.geometry.dispose(),this.jn.material.dispose(),this.za(),t.add(this.jn),null!==this.mv?this.mv.getMaterial(this,function(t){n.jn.material.dispose(),n.jn.material=t,n.wv()}):this.wv()}},{key:"bound",get:function(){return!0===this.needUpdateBound&&(this.Gn.reset(),this.Gn.expandByCoords(this.lv),this.needUpdateBound=!1),this.Gn.clone()}},{key:"x",get:function(){return this.bound.center.x}},{key:"y",get:function(){return this.bound.center.y}},{key:"addTo",value:function(t){Eb(Ob(r.prototype),"addTo",this).call(this,t)}},{key:"remove",value:function(){var t=this.Vn(tb),n=this.jn.parent;n&&n.remove(this.jn),this.tt&&this.tt.remove(this),t&&(t.enableUpdateRender(),this.gv&&t.off("update",this.ct))}},{key:"getRenderNode",value:function(){return this.jn}},{key:"removeEffect",value:function(t){var r=this;"FMFlowEffect"===t.type?this.mv=null:"FMBreath"===t.type&&(this.bv=null),null!==this.mv||null!==this.bv||(t=this.Vn(tb))&&(t.off("update",this.ct),this.jn.material.dispose(),this.gv=!1,t=new Co({color:new _i(this.Du),opacity:this.Eu,transparent:!0}),this.jn.material=t,void 0!==this.gu&&this._v(this.gu,function(t){var n=r.xv(t),e=document.createElement("canvas");e.width=512,e.height=1024;var i=e.getContext("2d");i.drawImage(t,0,0,512,512),i.drawImage(n,0,512,512,512);e=new Vu(r.Mv(e));e.repeat.set(r.vv,1),e.wrapS=e.wrapT=Sn,r.jn.material.map=e,r.jn.material.needsUpdate=!0,r.jn.material.color=null,r.wv()}),this.wv())}},{key:"addEffect",value:function(t){var n,e,i=this,r=this,o=this.Vn(tb);o&&("FMFlowEffect"===t.type?void 0!==this.gu?(this.mv=t,this.mv.getMaterial(this,function(t){i.gv||(i.jn.material.dispose(),i.jn.material=t,i.yv=!0,o.on("update",i.ct),i.gv=!0)})):console.error("没有图片不能加特效"):"FMBreath"===t.type&&(void 0!==this.gu?(this.bv=t,null!==this.mv?(n=function(){i.jn.material.uniforms.luminance.value=i.bv.strength/4},e=null,function t(){r.jn.material.uniforms&&r.jn.material.uniforms.luminance?(n(),clearTimeout(e)):e=setTimeout(t,0)}()):this.bv.getMaterial(this,function(t){i.gv||(i.jn.material.dispose(),i.jn.material=t,i.jn.material.uniforms.luminance.value=i.bv.strength/4,o.on("update",i.ct),i.gv=!0)})):console.error("没有图片不能加特效")))}}])&&Sb(t.prototype,n),e&&Sb(t,e),r}();Object.assign(mi.prototype,{wv:function(){var t=this.Vn(tb);if(!t)return!1;t.enableUpdateRender()},za:function(){for(var r=this,t=new Og,n=this.Sv(this.lv,this.dv),e=0;e<n.length-1;e++){n[e].x===n[e+1].x&&(n[e+1].x=n[e+1].x+.01),n[e].z===n[e+1].z&&(n[e+1].z=n[e+1].z+.01);var i=new Eg(n[e],n[e+1]);t.curves.push(i)}var o=new xb(t,this.pv*(n.length-1),this.dv/2,2),s=new Co({color:new _i(this.Du),opacity:this.Eu,transparent:!0});return this.jn=new Ko(o,s),void 0!==(this.jn.mapNode=this).gu?this._v(this.gu,function(t,n,e){void 0===r.vv&&(r.vv=r.Ev(n,e));var i=r.xv(t),n=document.createElement("canvas");n.width=512,n.height=1024;e=n.getContext("2d");e.drawImage(t,0,0,512,512),e.drawImage(i,0,512,512,512);n=new Vu(r.Mv(n));n.repeat.set(r.vv,1),n.wrapS=n.wrapT=Sn,r.jn.material.color=null,r.jn.material.map=n,r.jn.material.needsUpdate=!0,r.wv()}):((s=document.createElement("canvas")).width=512,s.height=512,this.wv()),!0},_v:function(t,n){var e=new Image;e.crossOrigin="Anonymous",e.onload=function(){var t=document.createElement("canvas");t.width=512,t.height=512,t.getContext("2d").drawImage(e,0,0,512,512),n&&n(t,e.width,e.height)},e.src=t},Ev:function(t,n){for(var e=0,i=0;i<this.lv.length-1;i++){var r=this.lv[i],o=this.lv[i+1];e+=Math.sqrt((r.x-o.x)*(r.x-o.x)+(r.y-o.y)*(r.y-o.y))}n=this.dv/n;return Math.floor(e/(t*n))},Mv:function(t){var n=document.createElement("canvas");n.width=t.width,n.height=t.height;var e=n.getContext("2d");return e.translate(n.width,0),e.scale(-1,1),e.drawImage(t,0,0,n.width,n.height),n},xv:function(t){var n=document.createElement("canvas");n.width=512,n.height=512;var e=n.getContext("2d");return e.translate(256,256),e.rotate(Math.PI),e.drawImage(t,-256,-256),this.Mv(n)},Sv:function(t,n){var e=this.Vn(tb);if(!e)return!1;for(var i=[],r=0;r<t.length;r++){var o=new St(t[r].x-e.x,t[r].z+n/2+this.Jt,-t[r].y+e.y);i.push(o)}return i},ct:function(){null!==this.mv&&this.mv.update(this),null!==this.bv&&this.jn.material.uniforms&&this.jn.material.uniforms.luminance&&this.bv.update(this),this.wv()}});Ai=mi;function Ab(o,s,a,u,t){eo.call(this),this.type="TubeBufferGeometry",this.parameters={path:o,tubularSegments:s,radius:a,radialSegments:u,closed:t},a=a||1,u=u||8;var h=o.computeFrenetFrames(s=s||64,t=t||!1);this.tangents=h.tangents,this.normals=h.normals,this.binormals=h.binormals;var r,c,f=new St,l=new St,n=new fi,d=new St,v=[],p=[],e=[],m=[];function i(t){d=o.getPointAt(t/s,d);var n=h.normals[t],e=h.binormals[t];for(c=0;c<=u;c++){var i=c/u*Math.PI*2;4===u&&(i=c*Math.PI/2+Math.PI/4);var r=Math.sin(i),i=-Math.cos(i);l.x=i*n.x+r*e.x,l.y=i*n.y+r*e.y,l.z=i*n.z+r*e.z,l.normalize(),p.push(l.x,l.y,l.z),f.x=d.x+a*l.x,f.y=d.y+a*l.y,f.z=d.z+a*l.z,v.push(f.x,f.y,f.z)}}!function(){for(r=0;r<s;r++)i(r);i(!1===t?s:0),function(){for(r=0;r<=s;r++)for(c=0;c<=u;c++)n.x=r/s,n.y=c/u,e.push(n.x,n.y)}(),function(){for(c=1;c<=s;c++)for(r=1;r<=u;r++){var t=(u+1)*(c-1)+(r-1),n=(u+1)*c+(r-1),e=(u+1)*c+r,i=(u+1)*(c-1)+r;m.push(t,n,i),m.push(n,e,i)}}()}(),this.setIndex(m),this.setAttribute("position",new Wr(v,3)),this.setAttribute("normal",new Wr(p,3)),this.setAttribute("uv",new Wr(e,2))}function kb(t){return(kb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Cb(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function jb(t,n,e){return(jb="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,n,e){t=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=Nb(t)););return t}(t,n);if(t){n=Object.getOwnPropertyDescriptor(t,n);return n.get?n.get.call(e):n.value}})(t,n,e||t)}function Pb(t,n){return(Pb=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Db(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Nb(e);return t=i?(t=Nb(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==kb(t)&&"function"!=typeof t?Ib(n):t}}function Ib(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Nb(t){return(Nb=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}(Ab.prototype=Object.create(eo.prototype)).constructor=Ab;Gi=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Pb(t,n)}(r,sb);var t,n,e,i=Db(r);function r(t){var n;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(n=i.call(this,t)).Un=Ii.TUBE_MARKER,n.lv=t.points,n.Du=t.color,n.Eu=t.opacity,void 0===n.Eu&&(n.Eu=1),n.Tv=t.radius,void 0===n.Tv&&(n.Tv=2),n.Lv=t.tubularSegments,void 0===n.Lv&&(n.Lv=64),n.Rv=t.radialSegments,void 0===n.Rv&&(n.Rv=8),n.Jt=t.height,void 0===n.Jt&&(n.Jt=0),n.gu=t.url,n.vv=t.count,void 0===n.vv&&(n.vv=1),n.jn=null,n.mv=null,n.bv=null,n.gv=!1,n.yv=!1,n.ct=n.ct.bind(Ib(n)),n}return t=r,(n=[{key:"opacity",get:function(){return this.Eu},set:function(t){this.Eu=t,this.jn&&(this.jn.material.opacity=this.Eu,this.wv())}},{key:"color",get:function(){return this.Du},set:function(t){this.Du=t,this.jn.material.color=new _i(t),this.wv()}},{key:"url",get:function(){return this.gu},set:function(t){var n=this;this.gu=t,"ShaderMaterial"!==this.jn.material.type?this.gu&&this._v(this.gu,function(t){t=new Vu(t);t.repeat.set(n.vv,1),t.wrapS=t.wrapT=Sn,n.jn.material.color=null,n.jn.material.map=t,n.jn.material.needsUpdate=!0,n.wv()}):this.mv.getMaterial(this,function(t){n.jn.material.dispose(),n.jn.material=t})}},{key:"count",get:function(){return this.vv},set:function(t){this.vv=t,this.jn.material.map&&(this.jn.material.map.repeat.set(this.vv,1),this.jn.material.needsUpdate=!0),this.wv()}},{key:"points",get:function(){return this.lv},set:function(t){this.lv=t;t=this.jn.parent;t.remove(this.jn),this.jn.geometry.dispose(),this.jn.material.dispose(),this.za(),t.add(this.jn),this.wv()}},{key:"height",get:function(){return this.Jt},set:function(t){var n=this;this.Jt=t;t=this.jn.parent;t.remove(this.jn),this.jn.geometry.dispose(),this.jn.material.dispose(),this.za(),t.add(this.jn),null!==this.mv?this.mv.getMaterial(this,function(t){n.jn.material.dispose(),n.jn.material=t,n.wv()}):this.wv()}},{key:"radius",get:function(){return this.Tv},set:function(t){var n=this;this.Tv=t;t=this.jn.parent;t.remove(this.jn),this.jn.geometry.dispose(),this.jn.material.dispose(),this.za(),t.add(this.jn),null!==this.mv?this.mv.getMaterial(this,function(t){n.jn.material.dispose(),n.jn.material=t,n.wv()}):this.wv()}},{key:"tubularSegments",get:function(){return this.Lv},set:function(t){var n=this;this.Lv=t;t=this.jn.parent;t.remove(this.jn),this.jn.geometry.dispose(),this.jn.material.dispose(),this.za(),t.add(this.jn),null!==this.mv?this.mv.getMaterial(this,function(t){n.jn.material.dispose(),n.jn.material=t,n.wv()}):this.wv()}},{key:"radialSegments",get:function(){return this.Rv},set:function(t){var n=this;this.Rv=t;t=this.jn.parent;t.remove(this.jn),this.jn.geometry.dispose(),this.jn.material.dispose(),this.za(),t.add(this.jn),null!==this.mv?this.mv.getMaterial(this,function(t){n.jn.material.dispose(),n.jn.material=t,n.wv()}):this.wv()}},{key:"bound",get:function(){return!0===this.needUpdateBound&&(this.Gn.reset(),this.Gn.expandByCoords(this.lv),this.needUpdateBound=!1),this.Gn.clone()}},{key:"x",get:function(){return this.bound.center.x}},{key:"y",get:function(){return this.bound.center.y}},{key:"addTo",value:function(t){jb(Nb(r.prototype),"addTo",this).call(this,t)}},{key:"remove",value:function(){var t=this.Vn(tb),n=this.jn.parent;n&&n.remove(this.jn),this.tt&&this.tt.remove(this),t&&(t.enableUpdateRender(),this.gv&&t.off("update",this.ct))}},{key:"getRenderNode",value:function(){return this.jn}},{key:"addEffect",value:function(t){var n,e,i=this,r=this,o=this.Vn(tb);o&&("FMFlowEffect"===t.type?void 0!==this.gu?(this.mv=t,this.mv.getMaterial(this,function(t){i.gv||(i.jn.material.dispose(),i.jn.material=t,i.yv=!0,o.on("update",i.ct),i.gv=!0)})):console.error("没有图片不能加特效"):"FMBreath"===t.type&&(void 0!==this.gu?(this.bv=t,null!==this.mv?(n=function(){i.jn.material.uniforms.luminance.value=i.bv.strength/4},e=null,function t(){r.jn.material.uniforms&&r.jn.material.uniforms.luminance?(n(),clearTimeout(e)):e=setTimeout(t,0)}()):this.bv.getMaterial(this,function(t){i.gv||(i.jn.material.dispose(),i.jn.material=t,i.jn.material.uniforms.luminance.value=i.bv.strength/4,o.on("update",i.ct),i.gv=!0)})):console.error("没有图片不能加特效")))}},{key:"removeEffect",value:function(t){var n=this;"FMFlowEffect"===t.type?this.mv=null:"FMBreath"===t.type&&(this.bv=null),this.gv=!1,null!==this.mv||null!==this.bv||(t=this.Vn(tb))&&(t.off("update",this.ct),this.jn.material.dispose(),t=new wf({color:new _i(this.Du),opacity:this.Eu,side:Rt,transparent:!0}),this.jn.material=t,void 0!==this.gu&&this._v(this.gu,function(t){t=new Vu(t);t.repeat.set(n.vv,1),t.wrapS=t.wrapT=Sn,n.jn.material.map=t,n.jn.material.needsUpdate=!0,n.wv()}),this.wv())}}])&&Cb(t.prototype,n),e&&Cb(t,e),r}();Object.assign(Gi.prototype,{wv:function(){var t=this.Vn(tb);if(!t)return!1;t.enableUpdateRender()},za:function(){for(var n=this,t=new Og,e=this.Sv(this.lv,this.Tv),i=0;i<e.length-1;i++){var r=new Eg(e[i],e[i+1]);t.curves.push(r)}var o=new Ab(t,this.Lv,this.Tv,this.Rv,!1),s=new wf({color:new _i(this.Du),opacity:this.Eu,side:At,transparent:!0});return this.jn=new Ko(o,s),void 0!==(this.jn.mapNode=this).gu&&this._v(this.gu,function(t){t=new Vu(t);t.repeat.set(n.vv,1),t.wrapS=t.wrapT=Sn,n.jn.material.map=t,n.jn.material.color=null,n.jn.material.needsUpdate=!0,n.wv()}),this.wv(),!0},Sv:function(t,n){var e=this.Vn(tb);if(!e)return!1;for(var i=[],r=0;r<t.length;r++){var o=new St(t[r].x-e.x,t[r].z+n+this.Jt,-t[r].y+e.y);i.push(o)}return i},ct:function(){null!==this.mv&&this.mv.update(this),null!==this.bv&&this.jn.material.uniforms&&this.jn.material.uniforms.luminance&&this.bv.update(this),this.wv()},_v:function(t,e){var i=new Image;i.crossOrigin="Anonymous",i.onload=function(){var t=document.createElement("canvas");t.width=512,t.height=512;var n=t.getContext("2d");n.drawImage(i,0,0,i.width,i.height/2,0,256,512,256),n.drawImage(i,0,i.height/2,i.width,i.height/2,0,0,512,256),e&&e(t)},i.src=t}});ir=Gi;function Fb(t){return(Fb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ub(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function Bb(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Gb(t,n)}function Gb(t,n){return(Gb=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Hb(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=zb(e);return t=i?(t=zb(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Fb(t)&&"function"!=typeof t?Vb(n):t}}function Vb(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function zb(t){return(zb=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Wb=function(){Bb(e,eo);var n=Hb(e);function e(){var t;return Ub(this,e),(t=n.call(this)).isMeshLine=!0,t.type="MeshLine",t.positions=[],t.previous=[],t.next=[],t.side=[],t.width=[],t.indices_array=[],t.uvs=[],t.counters=[],t.lv=[],t.Ov=null,t.widthCallback=null,t.matrixWorld=new Et,Object.defineProperties(Vb(t),{geometry:{enumerable:!0,get:function(){return this}},geom:{enumerable:!0,get:function(){return this.Ov},set:function(t){this.setGeometry(t,this.widthCallback)}},points:{enumerable:!0,get:function(){return this.lv},set:function(t){this.setPoints(t,this.widthCallback)}}}),t}return e}();function Xb(t,n,e,i,r){var o;if(t=t.subarray||t.slice?t:t.buffer,e=e.subarray||e.slice?e:e.buffer,t=n?t.subarray?t.subarray(n,r&&n+r):t.slice(n,r&&n+r):t,e.set)e.set(t,i);else for(o=0;o<t.length;o++)e[o+i]=t[o];return e}Wb.prototype.setMatrixWorld=function(t){this.matrixWorld=t},Wb.prototype.setGeometry=function(t,n){this.Av=t,this.setPoints(t.getAttribute("position").array,n)},Wb.prototype.setPoints=function(t,n){if(t instanceof Float32Array||t instanceof Array){if(this.lv=t,this.widthCallback=n,this.positions=[],this.counters=[],t.length&&t[0]instanceof St)for(var e=0;e<t.length;e++){var i=t[e],r=e/t.length;this.positions.push(i.x,i.y,i.z),this.positions.push(i.x,i.y,i.z),this.counters.push(r),this.counters.push(r)}else for(e=0;e<t.length;e+=3){r=e/t.length;this.positions.push(t[e],t[e+1],t[e+2]),this.positions.push(t[e],t[e+1],t[e+2]),this.counters.push(r),this.counters.push(r)}this.process()}else console.error("ERROR: The BufferArray of points is not instancied correctly.")},Wb.prototype.raycast=function(t,n){var e=new Et,i=new Ki,r=new it,o=new St;if((c=this.geometry).boundingSphere||c.computeBoundingSphere(),r.copy(c.boundingSphere),r.applyMatrix4(this.matrixWorld),!1!==t.ray.intersectSphere(r,o)){e.copy(this.matrixWorld).invert(),i.copy(t.ray).applyMatrix4(e);var s=new St,a=new St,u=new St,h=this instanceof vl?2:1,e=c.index,c=c.attributes;if(null!==e)for(var f=e.array,l=c.position.array,d=c.width.array,v=0,p=f.length-1;v<p;v+=h){var m=f[v],g=f[v+1];s.fromArray(l,3*m),a.fromArray(l,3*g);g=void 0!==d[Math.floor(v/3)]?d[Math.floor(v/3)]:1,g=t.params.Line.threshold+this.material.lineWidth*g/2;g*g<i.distanceSqToSegment(s,a,o,u)||(o.applyMatrix4(this.matrixWorld),(g=t.ray.origin.distanceTo(o))<t.near||g>t.far||(n.push({distance:g,point:u.clone().applyMatrix4(this.matrixWorld),index:v,face:null,faceIndex:null,object:this}),v=p))}}},Wb.prototype.compareV3=function(t,n){t*=6,n*=6;return this.positions[t]===this.positions[n]&&this.positions[1+t]===this.positions[1+n]&&this.positions[2+t]===this.positions[2+n]},Wb.prototype.copyV3=function(t){t*=6;return[this.positions[t],this.positions[1+t],this.positions[2+t]]},Wb.prototype.process=function(){var t,n=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[],t=this.compareV3(0,n-1)?this.copyV3(n-2):this.copyV3(0),this.previous.push(t[0],t[1],t[2]),this.previous.push(t[0],t[1],t[2]);for(var e,i=0;i<n;i++)this.side.push(1),this.side.push(-1),e=this.widthCallback?this.widthCallback(i/(n-1)):1,this.width.push(e),this.width.push(e),this.uvs.push(i/(n-1),0),this.uvs.push(i/(n-1),1),i<n-1&&(t=this.copyV3(i),this.previous.push(t[0],t[1],t[2]),this.previous.push(t[0],t[1],t[2]),this.indices_array.push(e=2*i,1+e,2+e),this.indices_array.push(2+e,1+e,3+e)),0<i&&(t=this.copyV3(i),this.next.push(t[0],t[1],t[2]),this.next.push(t[0],t[1],t[2]));t=this.compareV3(n-1,0)?this.copyV3(1):this.copyV3(n-1),this.next.push(t[0],t[1],t[2]),this.next.push(t[0],t[1],t[2]),this.kv&&this.kv.position.count===this.positions.length?(this.kv.position.copyArray(new Float32Array(this.positions)),this.kv.position.needsUpdate=!0,this.kv.previous.copyArray(new Float32Array(this.previous)),this.kv.previous.needsUpdate=!0,this.kv.next.copyArray(new Float32Array(this.next)),this.kv.next.needsUpdate=!0,this.kv.side.copyArray(new Float32Array(this.side)),this.kv.side.needsUpdate=!0,this.kv.width.copyArray(new Float32Array(this.width)),this.kv.width.needsUpdate=!0,this.kv.uv.copyArray(new Float32Array(this.uvs)),this.kv.uv.needsUpdate=!0,this.kv.index.copyArray(new Uint16Array(this.indices_array)),this.kv.index.needsUpdate=!0):this.kv={position:new Nr(new Float32Array(this.positions),3),previous:new Nr(new Float32Array(this.previous),3),next:new Nr(new Float32Array(this.next),3),side:new Nr(new Float32Array(this.side),1),width:new Nr(new Float32Array(this.width),1),uv:new Nr(new Float32Array(this.uvs),2),index:new Nr(new Uint16Array(this.indices_array),1),counters:new Nr(new Float32Array(this.counters),1)},this.setAttribute("position",this.kv.position),this.setAttribute("previous",this.kv.previous),this.setAttribute("next",this.kv.next),this.setAttribute("side",this.kv.side),this.setAttribute("width",this.kv.width),this.setAttribute("uv",this.kv.uv),this.setAttribute("counters",this.kv.counters),this.setIndex(this.kv.index),this.computeBoundingSphere(),this.computeBoundingBox()},Wb.prototype.advance=function(t){var n=this.kv.position.array,e=this.kv.previous.array,i=this.kv.next.array,r=n.length;Xb(n,0,e,0,r),Xb(n,6,n,0,r-6),n[r-6]=t.x,n[r-5]=t.y,n[r-4]=t.z,n[r-3]=t.x,n[r-2]=t.y,n[r-1]=t.z,Xb(n,6,i,0,r-6),i[r-6]=t.x,i[r-5]=t.y,i[r-4]=t.z,i[r-3]=t.x,i[r-2]=t.y,i[r-1]=t.z,this.kv.position.needsUpdate=!0,this.kv.previous.needsUpdate=!0,this.kv.next.needsUpdate=!0},$o.meshline_vert=["",$o.common,$o.logdepthbuf_pars_vertex,$o.fog_pars_vertex,"","attribute vec3 previous;","attribute vec3 next;","attribute float side;","attribute float width;","attribute float counters;","","uniform vec2 resolution;","uniform float lineWidth;","uniform vec3 color;","uniform float opacity;","uniform float sizeAttenuation;","uniform vec2 offset;","","varying vec2 vUV;","varying vec4 vColor;","varying float vCounters;","","vec2 fix( vec4 i, float aspect ) {",""," vec2 res = i.xy / i.w;"," res.x *= aspect;","\t vCounters = counters;"," return res;","","}","","void main() {",""," float aspect = resolution.x / resolution.y;",""," vColor = vec4( color, opacity );"," vUV = uv + offset;",""," mat4 m = projectionMatrix * modelViewMatrix;"," vec4 finalPosition = m * vec4( position, 1.0 );"," vec4 prevPos = m * vec4( previous, 1.0 );"," vec4 nextPos = m * vec4( next, 1.0 );",""," vec2 currentP = fix( finalPosition, aspect );"," vec2 prevP = fix( prevPos, aspect );"," vec2 nextP = fix( nextPos, aspect );",""," float w = lineWidth * width;",""," vec2 dir;"," if( nextP == currentP ) dir = normalize( currentP - prevP );"," else if( prevP == currentP ) dir = normalize( nextP - currentP );"," else {"," vec2 dir1 = normalize( currentP - prevP );"," vec2 dir2 = normalize( nextP - currentP );"," dir = normalize( dir1 + dir2 );",""," vec2 perp = vec2( -dir1.y, dir1.x );"," vec2 miter = vec2( -dir.y, dir.x );"," //w = clamp( w / dot( miter, perp ), 0., 4. * lineWidth * width );",""," }",""," //vec2 normal = ( cross( vec3( dir, 0. ), vec3( 0., 0., 1. ) ) ).xy;"," vec4 normal = vec4( -dir.y, dir.x, 0., 1. );"," normal.xy *= .5 * w;"," normal *= projectionMatrix;"," if( sizeAttenuation == 0. ) {"," normal.xy *= finalPosition.w;"," normal.xy /= ( vec4( resolution, 0., 1. ) * projectionMatrix ).xy;"," }",""," finalPosition.xy += normal.xy * side;",""," gl_Position = finalPosition;","",$o.logdepthbuf_vertex,$o.fog_vertex&&" vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",$o.fog_vertex,"}"].join("\n"),$o.meshline_frag=["",$o.fog_pars_fragment,$o.logdepthbuf_pars_fragment,"","uniform sampler2D map;","uniform sampler2D alphaMap;","uniform float useMap;","uniform float useAlphaMap;","uniform float useDash;","uniform float dashArray;","uniform float dashOffset;","uniform float dashRatio;","uniform float visibility;","uniform float alphaTest;","uniform vec2 repeat;","uniform float luminance;","uniform bool isbackground;","uniform vec3 bgcolor;","","varying vec2 vUV;","varying vec4 vColor;","varying float vCounters;","","void main() {","",$o.logdepthbuf_fragment,""," vec4 c = vColor;"," if( useMap == 1. ) {","\t \tc = texture2D( map, vUV * repeat );","\t } else {"," c = vColor;","\t }","\t c.r = c.r * c.a * luminance;"," c.g = c.g * c.a * luminance;"," c.b = c.b * c.a * luminance;"," if(isbackground){","\t\tc=vec4(vec3(mix(c,vec4(bgcolor,1.0),1.0-c.a)),1.0);"," }","\t c.a = c.a * vColor.a;"," if( useAlphaMap == 1. ) c.a *= texture2D( alphaMap, vUV * repeat ).a;"," if( c.a < alphaTest ) discard;"," if( useDash == 1. ){"," c.a *= ceil(mod(vCounters + dashOffset, dashArray) - (dashArray * dashRatio));"," }"," gl_FragColor = c;"," gl_FragColor.a *= step(vCounters, visibility);","",$o.fog_fragment,"}"].join("\n");var Zb=function(){Bb(i,wo);var e=Hb(i);function i(t){var n;return Ub(this,i),(n=e.call(this,{uniforms:Object.assign({},Tr.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new _i(16777215)},opacity:{value:1},resolution:{value:new fi(1,1)},sizeAttenuation:{value:1},dashArray:{value:0},dashOffset:{value:0},dashRatio:{value:.5},useDash:{value:0},visibility:{value:1},alphaTest:{value:0},repeat:{value:new fi(1,1)},offset:{value:new fi(1,1)},luminance:{value:1},isbackground:{value:!1},bgcolor:{value:new _i(16777215)}}),vertexShader:$o.meshline_vert,fragmentShader:$o.meshline_frag})).isMeshLineMaterial=!0,n.type="MeshLineMaterial",Object.defineProperties(Vb(n),{lineWidth:{enumerable:!0,get:function(){return this.uniforms.lineWidth.value},set:function(t){this.uniforms.lineWidth.value=t}},map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(t){this.uniforms.map.value=t}},useMap:{enumerable:!0,get:function(){return this.uniforms.useMap.value},set:function(t){this.uniforms.useMap.value=t}},alphaMap:{enumerable:!0,get:function(){return this.uniforms.alphaMap.value},set:function(t){this.uniforms.alphaMap.value=t}},useAlphaMap:{enumerable:!0,get:function(){return this.uniforms.useAlphaMap.value},set:function(t){this.uniforms.useAlphaMap.value=t}},color:{enumerable:!0,get:function(){return this.uniforms.color.value},set:function(t){this.uniforms.color.value=t}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(t){this.uniforms.opacity.value=t}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(t){this.uniforms.resolution.value.copy(t)}},sizeAttenuation:{enumerable:!0,get:function(){return this.uniforms.sizeAttenuation.value},set:function(t){this.uniforms.sizeAttenuation.value=t}},dashArray:{enumerable:!0,get:function(){return this.uniforms.dashArray.value},set:function(t){this.uniforms.dashArray.value=t,this.useDash=0!==t?1:0}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(t){this.uniforms.dashOffset.value=t}},dashRatio:{enumerable:!0,get:function(){return this.uniforms.dashRatio.value},set:function(t){this.uniforms.dashRatio.value=t}},useDash:{enumerable:!0,get:function(){return this.uniforms.useDash.value},set:function(t){this.uniforms.useDash.value=t}},visibility:{enumerable:!0,get:function(){return this.uniforms.visibility.value},set:function(t){this.uniforms.visibility.value=t}},alphaTest:{enumerable:!0,get:function(){return this.uniforms.alphaTest.value},set:function(t){this.uniforms.alphaTest.value=t}},repeat:{enumerable:!0,get:function(){return this.uniforms.repeat.value},set:function(t){this.uniforms.repeat.value.copy(t)}},offset:{enumerable:!0,get:function(){return this.uniforms.offset.value},set:function(t){this.uniforms.offset.value.copy(t)}},luminance:{enumerable:!0,get:function(){return this.uniforms.luminance.value},set:function(t){this.uniforms.luminance.value=t}},isbackground:{enumerable:!0,get:function(){return this.uniforms.isbackground.value},set:function(t){this.uniforms.isbackground.value=t}},bgcolor:{enumerable:!0,get:function(){return this.uniforms.bgcolor.value},set:function(t){this.uniforms.bgcolor.value=t}}}),n.setValues(t),n}return i}();function Yb(t){return(Yb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function qb(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Kb(t,n,e){return(Kb="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,n,e){t=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=tw(t)););return t}(t,n);if(t){n=Object.getOwnPropertyDescriptor(t,n);return n.get?n.get.call(e):n.value}})(t,n,e||t)}function Jb(t,n){return(Jb=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Qb(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=tw(e);return t=i?(t=tw(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Yb(t)&&"function"!=typeof t?$b(n):t}}function $b(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function tw(t){return(tw=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}Zb.prototype.copy=function(t){return wo.prototype.copy.call(this,t),this.lineWidth=t.lineWidth,this.map=t.map,this.useMap=t.useMap,this.alphaMap=t.alphaMap,this.useAlphaMap=t.useAlphaMap,this.color.copy(t.color),this.opacity=t.opacity,this.resolution.copy(t.resolution),this.sizeAttenuation=t.sizeAttenuation,this.dashArray.copy(t.dashArray),this.dashOffset.copy(t.dashOffset),this.dashRatio.copy(t.dashRatio),this.useDash=t.useDash,this.visibility=t.visibility,this.alphaTest=t.alphaTest,this.repeat.copy(t.repeat),this};tr=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Jb(t,n)}(r,sb);var t,n,e,i=Qb(r);function r(t){var n;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(n=i.call(this,t)).Un=Ii.LINE3D_MARKER,n.lv=t.points,n.Du=t.color,n.gu=t.url,n.Eu=t.opacity,void 0===n.Eu&&(n.Eu=1),n.Jt=t.height,void 0===n.Jt&&(n.Jt=0),n.Tv=t.radius,void 0===n.Tv&&(n.Tv=1),n.Cv=t.isFlat,void 0===n.Cv&&(n.Cv=!1),n.jv=t.isBezier,n.jn=null,n.pv=t.smoothparam,void 0===n.pv&&(n.pv=35),n.mv=null,n.bv=null,n.gv=!1,n.yv=!1,n.vv=t.count,void 0===n.vv&&(n.vv=1),n.Pv=t.sizeAttenuation,void 0===n.Pv&&(n.Pv=0),n.Dv=t.depthTest,void 0===n.Dv&&(n.Dv=!0),n.Iv=t.issmooth,n.Nv=t.isautocount,n.Fv=void 0,n.Uv=void 0,n.ct=n.ct.bind($b(n)),n.Ui=n.Ui.bind($b(n)),n}return t=r,(n=[{key:"opacity",get:function(){return this.Eu},set:function(t){this.Eu=t,this.jn&&(this.jn.material.opacity=this.Eu,this.wv())}},{key:"url",get:function(){return this.gu},set:function(t){var i=this;this.gu=t,void 0!==this.gu&&this._v(this.gu,function(t,n,e){i.Nv&&(i.vv=i.Ev(n,e));t=new Vu(t);t.wrapS=t.wrapT=Sn,i.jn.material.color=new _i("#FFFFFF"),i.jn.material.useMap=1,i.jn.material.map=t,i.jn.material.repeat=new fi(i.vv,1),i.wv()})}},{key:"count",get:function(){return this.vv},set:function(t){this.vv=t,this.jn.material.map&&(this.jn.material.repeat=new fi(this.vv,1)),this.wv()}},{key:"isBezier",get:function(){return this.jv},set:function(t){t&&4!==this.lv.length?console.error("贝塞尔需要四个坐标点"):(this.jv=t,(t=this.jn.parent).remove(this.jn),this.jn.geometry.dispose(),this.jn.material.dispose(),this.za(),t.add(this.jn),this.wv())}},{key:"color",get:function(){return this.Du},set:function(t){this.Du=t,this.jn.material.color=new _i(t),this.wv()}},{key:"points",get:function(){return this.lv},set:function(t){this.lv=t;t=this.jn.parent;t.remove(this.jn),this.jn.geometry.dispose(),this.jn.material.dispose(),this.za(),t.add(this.jn),this.wv()}},{key:"height",get:function(){return this.Jt},set:function(t){this.Jt=t;t=this.jn.parent;t.remove(this.jn),this.jn.geometry.dispose(),this.jn.material.dispose(),this.za(),t.add(this.jn),void 0!==this.Fv&&(this.jn.material.isbackground=!0,this.jn.material.bgcolor=new _i(this.Fv)),void 0!==this.Uv&&(this.jn.material.luminance=this.Uv),this.wv()}},{key:"radius",get:function(){return this.Tv},set:function(t){this.Tv=t;t=this.jn.parent;t.remove(this.jn),this.jn.geometry.dispose(),this.jn.material.dispose(),this.za(),t.add(this.jn),void 0!==this.Fv&&(this.jn.material.isbackground=!0,this.jn.material.bgcolor=new _i(this.Fv)),void 0!==this.Uv&&(this.jn.material.luminance=this.Uv),this.wv()}},{key:"bound",get:function(){return!0===this.needUpdateBound&&(this.Gn.reset(),this.Gn.expandByCoords(this.lv),this.needUpdateBound=!1),this.Gn.clone()}},{key:"x",get:function(){return this.bound.center.x}},{key:"y",get:function(){return this.bound.center.y}},{key:"addTo",value:function(t){Kb(tw(r.prototype),"addTo",this).call(this,t)}},{key:"remove",value:function(){var t=this.Vn(tb),n=this.jn.parent;n&&n.remove(this.jn),this.tt&&this.tt.remove(this),t&&(t.enableUpdateRender(),this.gv&&t.off("update",this.ct),t.off("resize",this.Ui))}},{key:"getRenderNode",value:function(){return this.jn}},{key:"addEffect",value:function(t,n,e){var i=this.Vn(tb);i&&"FMFlowEffect"===t.type&&(void 0!==this.gu?(void 0!==e&&(this.jn.material.isbackground=!0,this.jn.material.bgcolor=new _i(e)),void 0!==n&&(this.jn.material.luminance=n),this.Fv=e,this.Uv=n,this.mv=t,i.on("update",this.ct),this.gv=!0):console.error("没有图片不能加特效"))}},{key:"removeEffect",value:function(t){"FMFlowEffect"===t.type?this.mv=null:"FMBreath"===t.type&&(this.bv=null),this.gv=!1,null!==this.mv||null!==this.bv||(t=this.Vn(tb))&&(t.off("update",this.ct),this.jn.material.offset=new fi(1,1),this.jn.material.isbackground=!1,this.jn.material.luminance=1)}}])&&qb(t.prototype,n),e&&qb(t,e),r}();Object.assign(tr.prototype,{wv:function(){var t=this.Vn(tb);if(!t)return!1;t.enableUpdateRender()},za:function(){var i=this,t=this.Sv(this.lv,this.Tv),n=new Og;if(this.jv)n=new Mg(t[0],t[1],t[2],t[3]);else for(var e=0;e<t.length-1;e++){var r=new Eg(t[e],t[e+1]);n.curves.push(r)}var o=window.innerWidth,s=window.innerHeight,a=this.Vn(tb);a&&(o=a.getContainer().clientWidth,s=a.getContainer().clientHeight,a.on("resize",this.Ui));o=new Zb({useMap:0,color:new _i(this.Du),opacity:this.Eu,resolution:new fi(o,s),sizeAttenuation:this.Pv,lineWidth:2*this.Tv,transparent:!0,depthTest:this.Dv});o.polygonOffset=!0,o.polygonOffsetFactor=-1,o.polygonOffsetUnits=-4;s=new Wb;return this.Iv?s.setPoints(this.Bv(t,n)):s.setPoints(n.getPoints(this.pv)),this.jn=new Ko(s.geometry,o),void 0!==(this.jn.mapNode=this).gu&&this._v(this.gu,function(t,n,e){t=new Vu(t);i.Nv&&(i.vv=i.Ev(n,e)),t.wrapS=t.wrapT=Sn,i.jn.material.color=new _i("#FFFFFF"),i.jn.material.useMap=1,i.jn.material.map=t,i.jn.material.repeat=new fi(i.vv,1),i.wv()}),this.wv(),!0},Ev:function(t,n){for(var e=0,i=0;i<this.lv.length-1;i++){var r=this.lv[i],o=this.lv[i+1];e+=Math.sqrt((r.x-o.x)*(r.x-o.x)+(r.y-o.y)*(r.y-o.y))}n=2*this.Tv/n;return Math.floor(e/(t*n))},Bv:function(t,n){for(var e=[],i=new St,r=t.length*this.pv,o=0;o<r;o++)i=n.getPointAt(o/r,i),e.push(i);return e},Sv:function(t,n){var e=this.Vn(tb);if(!e)return!1;for(var i,r=[],o=0;o<t.length;o++)this.jv?(i=new St(t[o].x-e.x,t[o].z+this.Jt,-t[o].y+e.y),r.push(i)):(i=new St(t[o].x-e.x,t[o].z+n+this.Jt,-t[o].y+e.y),r.push(i));return r},_v:function(t,n){var e=new Image;e.crossOrigin="Anonymous",e.onload=function(){var t=document.createElement("canvas");t.width=512,t.height=512,t.getContext("2d").drawImage(e,0,0,t.width,t.height),n&&n(t,e.width,e.height)},e.src=t},ct:function(){var t,n;null!==this.mv&&(t=this.mv.speed/this.count,(n=this.jn.material.offset).x=n.x+t/1e3,this.jn.material.offset=n),this.wv()},Ui:function(){var t=window.innerWidth,n=window.innerHeight,e=this.Vn(tb);e&&(t=e.getContainer().clientWidth,n=e.getContainer().clientHeight),this.jn.material.resolution=new fi(t,n),this.wv()}});sr=tr;function nw(t,n,e,i,r,o,s){Dr.call(this),this.type="SphereGeometry",this.parameters={radius:t,widthSegments:n,heightSegments:e,phiStart:i,phiLength:r,thetaStart:o,thetaLength:s},this.fromBufferGeometry(new ew(t,n,e,i,r,o,s)),this.mergeVertices()}function ew(t,n,e,i,r,o,s){eo.call(this),this.type="SphereBufferGeometry",this.parameters={radius:t,widthSegments:n,heightSegments:e,phiStart:i,phiLength:r,thetaStart:o,thetaLength:s},t=t||1,n=Math.max(3,Math.floor(n)||8),e=Math.max(2,Math.floor(e)||6),i=void 0!==i?i:0,r=void 0!==r?r:2*Math.PI,o=void 0!==o?o:0,s=void 0!==s?s:Math.PI;for(var a,u=Math.min(o+s,Math.PI),h=0,c=[],f=new St,l=new St,d=[],v=[],p=[],m=[],g=0;g<=e;g++){var y=[],b=g/e,w=0;for(0==g&&0==o?w=.5/n:g==e&&u==Math.PI&&(w=-.5/n),a=0;a<=n;a++){var _=a/n;f.x=-t*Math.cos(i+_*r)*Math.sin(o+b*s),f.y=t*Math.cos(o+b*s),f.z=t*Math.sin(i+_*r)*Math.sin(o+b*s),v.push(f.x,f.y,f.z),l.copy(f).normalize(),p.push(l.x,l.y,l.z),m.push(_+w,1-b),y.push(h++)}c.push(y)}for(g=0;g<e;g++)for(a=0;a<n;a++){var x=c[g][a+1],M=c[g][a],S=c[g+1][a],E=c[g+1][a+1];(0!==g||0<o)&&d.push(x,M,E),(g!==e-1||u<Math.PI)&&d.push(M,S,E)}this.setIndex(d),this.setAttribute("position",new Wr(v,3)),this.setAttribute("normal",new Wr(p,3)),this.setAttribute("uv",new Wr(m,2))}function iw(t){return(iw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function rw(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function ow(t,n,e){return(ow="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,n,e){t=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=hw(t)););return t}(t,n);if(t){n=Object.getOwnPropertyDescriptor(t,n);return n.get?n.get.call(e):n.value}})(t,n,e||t)}function sw(t,n){return(sw=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function aw(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=hw(e);return t=i?(t=hw(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==iw(t)&&"function"!=typeof t?uw(n):t}}function uw(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function hw(t){return(hw=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}(nw.prototype=Object.create(Dr.prototype)).constructor=nw,(ew.prototype=Object.create(eo.prototype)).constructor=ew;_r=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&sw(t,n)}(r,sb);var t,n,e,i=aw(r);function r(t){var n;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(n=i.call(this,t)).Gv=t.isHemiSphere,void 0===n.Gv&&(n.Gv=!0),n.Un=Ii.SPHERE_MARKER,n.N=t.x,n.F=t.y,n.Du=t.color,n.Eu=t.opacity,void 0===n.Eu&&(n.Eu=.5),n.Jt=t.height,void 0===n.Jt&&(n.Jt=0),n.Tv=t.radius,void 0===n.Tv&&(n.Tv=8),n.gu=t.url,n.lv=[{x:n.N+n.Tv,y:n.F},{x:n.N-n.Tv,y:n.F},{x:n.N,y:n.F+n.Tv},{x:n.N,y:n.F-n.Tv}],n.jn=null,n.Lt=null,n.Hv=null,n.gv=!1,n.Vv=!1,n.ct=n.ct.bind(uw(n)),n}return t=r,(n=[{key:"opacity",get:function(){return this.Eu},set:function(t){this.Eu=t,this.jn&&(this.jn.material.opacity=this.Eu,this.wv())}},{key:"color",get:function(){return this.Du},set:function(t){this.Du=t,"ShaderMaterial"===this.jn.material.type?(this.jn.material.uniforms.color.value=new _i(t),this.jn.material.uniforms.iscolor.value=!0):this.jn.material.color=new _i(t),this.wv()}},{key:"url",get:function(){return this.gu},set:function(t){var n=this;this.gu=t,"ShaderMaterial"!==this.jn.material.type?void 0!==this.gu&&this._v(this.gu,function(t){t=new Vu(t);t.repeat.set(1,1),t.wrapS=t.wrapT=Sn,n.jn.material.color=null,n.jn.material.map=t,n.jn.material.needsUpdate=!0,n.wv()}):this.Hv.getMaterial(this,function(t){n.jn.material.dispose(),n.jn.material=t})}},{key:"height",get:function(){return this.Jt},set:function(t){this.Jt=t,this.Lf(),this.wv()}},{key:"radius",get:function(){return this.Tv},set:function(t){var n=this;this.Tv=t;t=this.jn.parent;t.remove(this.jn),this.jn.geometry.dispose(),this.jn.material.dispose(),this.za(),t.add(this.jn),null!==this.Hv?this.Hv.getMaterial(this,function(t){n.jn.material.dispose(),n.jn.material=t,n.wv()}):this.wv()}},{key:"x",get:function(){return this.N},set:function(t){this.N=t,this.Lf(),this.wv()}},{key:"y",get:function(){return this.F},set:function(t){this.F=t,this.Lf(),this.wv()}},{key:"isHemiSphere",get:function(){return this.Gv},set:function(t){var n=this;this.Gv=t;t=this.jn.parent;t.remove(this.jn),this.jn.geometry.dispose(),this.jn.material.dispose(),this.za(),t.add(this.jn),null!==this.Hv?this.Hv.getMaterial(this,function(t){n.jn.material.dispose(),n.jn.material=t,n.wv()}):this.wv()}},{key:"bound",get:function(){return!0===this.needUpdateBound&&(this.Gn.reset(),this.Gn.expandByCoords(this.lv),this.needUpdateBound=!1),this.Gn.clone()}},{key:"addTo",value:function(t){ow(hw(r.prototype),"addTo",this).call(this,t)}},{key:"remove",value:function(){var t=this.Vn(tb),n=this.jn.parent;n&&n.remove(this.jn),this.tt&&this.tt.remove(this),t&&(t.enableUpdateRender(),this.gv&&t.off("update",this.ct))}},{key:"addEffect",value:function(t){var n,e=this;"FMDiffusion"===t.type?(n=this.Vn(tb))&&(this.Hv=t,this.Hv.getMaterial(this,function(t){e.gv||(e.jn.material.dispose(),e.jn.material=t,e.Vv=!0,n.on("update",e.ct),e.gv=!0)})):console.error("半圆覆盖物只能添加扩散效果")}},{key:"removeEffect",value:function(){var n=this;this.Hv=null;var t=this.Vn(tb);t&&(t.off("update",this.ct),t=new Co({color:new _i(this.Du),opacity:this.Eu,transparent:!0}),this.jn.material=t,this.jn.scale.set(1,1,1),void 0!==this.gu&&this._v(this.gu,function(t){t=new Vu(t);t.repeat.set(1,1),t.wrapS=t.wrapT=Sn,n.jn.material.color=null,n.jn.material.map=t,n.jn.material.needsUpdate=!0,n.wv()}),this.gv=!1,this.wv())}},{key:"diffusion",value:function(t){var n=this,e=this.Vn(tb);if(!e)return!1;this.Lt||(this.Lt=new Oi);var i=t.maxScale,t=t.speed,t=this.Tv*i/t;this.Lt.pt([1]).mt([i]).gt(t).bt(function(t){t=t.destination[0];n.jn.scale.set(t,t,t),n.wv()}).wt(function(){n.Lt.dt()}),e.pn.mn(this.Lt.dt())}},{key:"getRenderNode",value:function(){return this.jn}}])&&rw(t.prototype,n),e&&rw(t,e),r}();Object.assign(_r.prototype,{wv:function(){var t=this.Vn(tb);if(!t)return!1;t.enableUpdateRender()},za:function(){var n=this,t=null,t=this.Gv?new nw(this.Tv,32,16,0,2*Math.PI,0,Math.PI/2):new nw(this.Tv,32,16,0,2*Math.PI,0,Math.PI),e=new Co({color:new _i(this.Du),opacity:this.Eu,transparent:!0});return this.jn=new Ko(t,e),void 0!==(this.jn.mapNode=this).gu&&this._v(this.gu,function(t){t=new Vu(t);t.repeat.set(1,1),t.wrapS=t.wrapT=Sn,n.jn.material.map=t,n.jn.material.color=null,n.jn.material.needsUpdate=!0,n.wv()}),this.wv(),this.Lf(),!0},Lf:function(){var t=this.Vn(tb);if(!t)return!1;this.Gv?this.jn.position.set(this.N-t.x,this.Jt,-this.F+t.y):this.jn.position.set(this.N-t.x,this.Jt+this.Tv,-this.F+t.y)},ct:function(){null!==this.Hv&&this.Hv.update(this.jn),this.wv()},_v:function(t,n){var e=new Image;e.crossOrigin="Anonymous",e.onload=function(){var t=document.createElement("canvas");t.width=512,t.height=512,t.getContext("2d").drawImage(e,0,0,512,512),n&&n(t)},e.src=t}});ch=_r;function cw(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var fw=function(){function i(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,i)}var t,n,e;return t=i,e=[{key:"createShape",value:function(t,n){var e=new kg;if(Array.isArray(t[0])){var i=t[0];e.moveTo(i[0].x-n.x,i[0].y-n.y);for(var r=1;r<i.length;r++)e.lineTo(i[r].x-n.x,i[r].y-n.y);if(1<t.length)for(var o=1;o<t.length;o++){var s=t[o],a=new Ag;if(0<s.length){a.moveTo(s[0].x-n.x,s[0].y-n.y);for(var u=1;u<s.length;u++)a.lineTo(s[u].x-n.x,s[u].y-n.y)}e.holes.push(a)}}else{e.moveTo(t[0].x-n.x,t[0].y-n.y);for(var h=1;h<t.length;h++)e.lineTo(t[h].x-n.x,t[h].y-n.y)}return e}},{key:"createShapeBufferGeometryByCenter",value:function(t,n,e){n=new Qg(this.createShape(t,n));if(e){for(var i=[Number.MAX_VALUE,Number.MAX_VALUE],r=[-Number.MAX_VALUE,-Number.MAX_VALUE],o=n.attributes.position.array,s=0;s<o.length/3;s++){var a=o[3*s],u=o[3*s+1];i[0]>a&&(i[0]=a),i[1]>u&&(i[1]=u),r[0]<a&&(r[0]=a),r[1]<u&&(r[1]=u)}for(var h=n.attributes.uv.array,c=[r[0]-i[0],r[1]-i[1]],f=0;f<o.length/3;f++){var l=o[3*f],d=o[3*f+1];h[2*f]=(l-i[0])/c[0],h[2*f+1]=(d-i[1])/c[1]}n.setAttribute("uv",new Wr(h,2))}return n}},{key:"createExtrudeBufferGeometry",value:function(t,n){return new ty(t,{steps:1,depth:n.depth,bevelEnabled:!1,bevelThickness:0,bevelSize:0,bevelOffset:0,bevelSegments:1})}},{key:"closedPoints",value:function(t){var n=t.length;return!(n<3)&&(t[0].x===t[n-1].x&&t[0].y===t[n-1].y||(t[n]={x:t[n-1].x,y:t[n-1].y}),!0)}},{key:"createReactShape",value:function(t,n){var e=new kg,n=n/2,t=t/2;return e.moveTo(-t,-n),e.lineTo(-t,n),e.lineTo(t,n),e.lineTo(t,-n),e}},{key:"createCircleShape",value:function(t,n){var e=new kg;return e.absarc(0,0,t,0,2*Math.PI,!1),e}},{key:"createReactExtrudeBufferGeometry",value:function(t,n,e){n=i.createReactShape(t,n);return this.createExtrudeBufferGeometry(n,e)}},{key:"createCircleExtrudeBufferGeometry",value:function(t,n,e){n=i.createCircleShape(t,n);return this.createExtrudeBufferGeometry(n,e)}},{key:"createCenterBufferGeometry",value:function(t,n){for(var e=[],i=0;i<t.length-1;i++)for(var r=2;r<10;r+=2)e.push({x:t[i].x+(t[i+1].x-t[i].x)*r*.1,y:t[i].y+(t[i+1].y-t[i].y)*r*.1,z:t[i].z+(t[i+1].z-t[i].z)*r*.1});e.push({x:e[0].x,y:e[0].y,z:e[0].z});for(var o=new eo,s=[],a=[],u=0;u<e.length-1;u++)s.push(e[u].x),s.push(e[u].y),s.push(e[u].z),s.push(e[u+1].x),s.push(e[u+1].y),s.push(e[u+1].z),s.push(n.x),s.push(n.y),s.push(n.z),a.push(0,0,1);var h=new Float32Array(s);return o.setAttribute("position",new Wr(h,3)),o.setAttribute("gradientAlpha",new Wr(a,1)),o}},{key:"scalePoints",value:function(t,n,e){for(var i=[],r=0;r<t.length;r++){var o=t[r].x,s=t[r].y,a=t[r].z;i.push({x:o+(o-n.x)*(e-1),y:s+(s-n.y)*(e-1),z:a})}return i}},{key:"scaleValuePoints",value:function(t,n,e){for(var i=[],r=0;r<t.length;r++){var o={x:t[r].x,y:t[r].y,z:t[r].z};o.x-n.x<0?o.x-=e:o.x+=e,o.y-n.y<0?o.y-=e:o.y+=e,i.push(o)}return i}}],(n=null)&&cw(t.prototype,n),e&&cw(t,e),i}();function lw(){eo.call(this),this.type="InstancedBufferGeometry",this.maxInstancedCount=void 0}function dw(t,n,e){Du.call(this,t,n),this.meshPerAttribute=e||1}function vw(t){eo.call(this),this.type="WireframeGeometry";var n,e,i,r,o,s,a=[],u=[0,0],h={},c=["a","b","c"];if(t&&t.isGeometry){for(var f=t.faces,l=0,d=f.length;l<d;l++)for(var v=f[l],p=0;p<3;p++)r=v[c[p]],o=v[c[(p+1)%3]],u[0]=Math.min(r,o),u[1]=Math.max(r,o),void 0===h[s=u[0]+","+u[1]]&&(h[s]={index1:u[0],index2:u[1]});for(s in h)i=h[s],w=t.vertices[i.index1],a.push(w.x,w.y,w.z),w=t.vertices[i.index2],a.push(w.x,w.y,w.z)}else if(t&&t.isBufferGeometry){var m,g,y,b,w=new St;if(null!==t.index){for(m=t.attributes.position,g=t.index,e=(y=(n=0)===(y=t.groups).length?[{start:0,count:g.count,materialIndex:0}]:y).length;n<e;++n)for(d=(l=(b=y[n]).start)+b.count;l<d;l+=3)for(p=0;p<3;p++)r=g.getX(l+p),o=g.getX(l+(p+1)%3),u[0]=Math.min(r,o),u[1]=Math.max(r,o),void 0===h[s=u[0]+","+u[1]]&&(h[s]={index1:u[0],index2:u[1]});for(s in h)i=h[s],w.fromBufferAttribute(m,i.index1),a.push(w.x,w.y,w.z),w.fromBufferAttribute(m,i.index2),a.push(w.x,w.y,w.z)}else for(l=0,d=(m=t.attributes.position).count/3;l<d;l++)for(p=0;p<3;p++)w.fromBufferAttribute(m,3*l+p),a.push(w.x,w.y,w.z),w.fromBufferAttribute(m,3*l+(p+1)%3),a.push(w.x,w.y,w.z)}this.setAttribute("position",new Wr(a,3))}function pw(t){return(pw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function mw(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function gw(t,n){return(gw=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function yw(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=bw(e);return t=i?(t=bw(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==pw(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function bw(t){return(bw=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}lw.prototype=Object.assign(Object.create(eo.prototype),{constructor:lw,isInstancedBufferGeometry:!0,copy:function(t){return eo.prototype.copy.call(this,t),this.maxInstancedCount=t.maxInstancedCount,this},clone:function(){return(new this.constructor).copy(this)}}),dw.prototype=Object.assign(Object.create(Du.prototype),{constructor:dw,isInstancedInterleavedBuffer:!0,copy:function(t){return Du.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this}}),(vw.prototype=Object.create(eo.prototype)).constructor=vw;var ww=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&gw(t,n)}(r,lw);var t,n,e,i=yw(r);function r(){var t;!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(t=i.call(this)).type="LineSegmentsGeometry";return t.isLineSegmentsGeometry=!0,t.setIndex([0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5]),t.setAttribute("position",new Wr([-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],3)),t.setAttribute("uv",new Wr([-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],2)),t.setAttribute("uv2",new Wr([0,0,1,0,0,1/3,1,1/3,0,2/3,1,2/3,0,1,1,1],2)),t}return t=r,(n=[{key:"applyMatrix",value:function(t){var n=this.attributes.instanceStart,e=this.attributes.instanceEnd;return void 0!==n&&(t.applyToBufferAttribute(n),t.applyToBufferAttribute(e),n.data.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}},{key:"setPositions",value:function(t){t instanceof Float32Array?n=t:Array.isArray(t)&&(n=new Float32Array(t));var n=new dw(n,6,1);return this.setAttribute("instanceStart",new Nu(n,3,0)),this.setAttribute("instanceEnd",new Nu(n,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}},{key:"setColors",value:function(t){t instanceof Float32Array?n=t:Array.isArray(t)&&(n=new Float32Array(t));var n=new dw(n,6,1);return this.addAttribute("instanceColorStart",new Nu(n,3,0)),this.addAttribute("instanceColorEnd",new Nu(n,3,3)),this}},{key:"setUvys",value:function(t){t instanceof Float32Array?n=t:Array.isArray(t)&&(n=new Float32Array(t));var n=new dw(n,2,1);return this.setAttribute("uvyStart",new Nu(n,1,0)),this.setAttribute("uvyEnd",new Nu(n,1,1)),this}},{key:"fromWireframeGeometry",value:function(t){return this.setPositions(t.attributes.position.array),this}},{key:"fromEdgesGeometry",value:function(t){return this.setPositions(t.attributes.position.array),this}},{key:"fromMesh",value:function(t){return this.fromWireframeGeometry(new vw(t.geometry)),this}},{key:"fromLineSegements",value:function(t){t=t.geometry;return t.isGeometry?this.setPositions(t.vertices):t.isBufferGeometry&&this.setPositions(t.position.array),this}},{key:"computeBoundingBox",value:function(){var t=new tt;null===this.boundingBox&&(this.boundingBox=new tt);var n=this.attributes.instanceStart,e=this.attributes.instanceEnd;void 0!==n&&void 0!==e&&(this.boundingBox.setFromBufferAttribute(n),t.setFromBufferAttribute(e),this.boundingBox.union(t))}},{key:"computeBoundingSphere",value:function(){var t=new St;null===this.boundingSphere&&(this.boundingSphere=new it),null===this.boundingBox&&this.computeBoundingBox();var n=this.attributes.instanceStart,e=this.attributes.instanceEnd;if(void 0!==n&&void 0!==e){var i=this.boundingSphere.center;this.boundingBox.getCenter(i);for(var r=0,o=0,s=n.count;o<s;o++)t.fromBufferAttribute(n,o),r=Math.max(r,i.distanceToSquared(t)),t.fromBufferAttribute(e,o),r=Math.max(r,i.distanceToSquared(t));this.boundingSphere.radius=Math.sqrt(r),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(t){return this}}])&&mw(t.prototype,n),e&&mw(t,e),r}();function _w(t){return(_w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function xw(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Mw(t,n){return(Mw=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Sw(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Ew(e);return t=i?(t=Ew(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==_w(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function Ew(t){return(Ew=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Tw=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Mw(t,n)}(r,ww);var t,n,e,i=Sw(r);function r(){var t;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(t=i.call(this)).type="LineGeometry",t.isLineGeometry=!0,t}return t=r,(n=[{key:"setPositions",value:function(t){for(var n=t.length-3,e=new Float32Array(2*n),i=0;i<n;i+=3)e[2*i]=t[i],e[2*i+1]=t[i+1],e[2*i+2]=t[i+2],e[2*i+3]=t[i+3],e[2*i+4]=t[i+4],e[2*i+5]=t[i+5];return this.test="ddd",(new ww).setPositions.call(this,e),this}},{key:"setColors",value:function(t){for(var n=t.length-3,e=new Float32Array(2*n),i=0;i<n;i+=3)e[2*i]=t[i],e[2*i+1]=t[i+1],e[2*i+2]=t[i+2],e[2*i+3]=t[i+3],e[2*i+4]=t[i+4],e[2*i+5]=t[i+5];return(new ww).setColors.call(this,e),this}},{key:"fromLine",value:function(t){t=t.geometry;return t.isGeometry?this.setPositions(t.vertices):t.isBufferGeometry&&this.setPositions(t.position.array),this}},{key:"copy",value:function(t){return this}}])&&xw(t.prototype,n),e&&xw(t,e),r}(),Lw=new St,Rw=new St;function Ow(t,n){this.start=void 0!==t?t:new St,this.end=void 0!==n?n:new St}function Aw(t){return(Aw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function kw(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Cw(t,n){return(Cw=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function jw(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Pw(e);return t=i?(t=Pw(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Aw(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function Pw(t){return(Pw=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Dw(t,n,e){t=0<arguments.length&&void 0!==t?t:{x:0,y:0,z:0},n=1<arguments.length&&void 0!==n?n:{x:0,y:0,z:0},e=2<arguments.length?e:void 0,t=new Ci(t.x,t.y,t.z,1),n=new Ci(n.x,n.y,n.z,1);return t.applyMatrix4(e.projectionMatrix),n.multiplyScalar(t.w),n.applyMatrix4(e.projectionMatrixInverse),{x:n.x,y:n.y,z:n.z}}Object.assign(Ow.prototype,{set:function(t,n){return this.start.copy(t),this.end.copy(n),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.start.copy(t.start),this.end.copy(t.end),this},getCenter:function(t){return void 0===t&&(console.warn("THREE.Line3: .getCenter() target is now required"),t=new St),t.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(t){return void 0===t&&(console.warn("THREE.Line3: .delta() target is now required"),t=new St),t.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(t,n){return void 0===n&&(console.warn("THREE.Line3: .at() target is now required"),n=new St),this.delta(n).multiplyScalar(t).add(this.start)},closestPointToPointParameter:function(t,n){Lw.subVectors(t,this.start),Rw.subVectors(this.end,this.start);t=Rw.dot(Rw),t=Rw.dot(Lw)/t;return t=n?Mt.clamp(t,0,1):t},closestPointToPoint:function(t,n,e){n=this.closestPointToPointParameter(t,n);return void 0===e&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),e=new St),this.delta(e).multiplyScalar(n).add(this.start)},applyMatrix4:function(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this},equals:function(t){return t.start.equals(this.start)&&t.end.equals(this.end)}});var Iw=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Cw(t,n)}(r,Ko);var t,n,e,i=jw(r);function r(t,n){return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(n=i.call(this,t,n)).type="LineSegments2",n.isLineSegments2=!0,n}return t=r,(n=[{key:"computeLineDistances",value:function(){for(var t=new St,n=new St,e=this.geometry,i=e.attributes.instanceStart,r=e.attributes.instanceEnd,o=new Float32Array(2*i.data.count),s=0,a=0,u=i.data.count;s<u;s++,a+=2)t.fromBufferAttribute(i,s),n.fromBufferAttribute(r,s),o[a]=0===a?0:o[a-1],o[a+1]=o[a]+t.distanceTo(n);var h=new dw(o,2,1);return e.setAttribute("instanceDistanceStart",new Nu(h,1,0)),e.setAttribute("instanceDistanceEnd",new Nu(h,1,1)),this}},{key:"copy",value:function(t){return this}},{key:"raycast",value:function(t,n){null===t.camera&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2.');var e=new Ci,i=new Ci,r=new Ci,o=new St,s=new Et,a=new Ow,u=new St,h=new tt,c=new it,f=void 0!==t.params.Line2&&t.params.Line2.threshold||0,l=t.ray,d=t.camera,v=d.projectionMatrix,p=this.matrixWorld,m=this.geometry,g=this.material,y=g.resolution,b=g.uniforms.lineWidth.value+f,w=m.attributes.instanceStart,_=m.attributes.instanceEnd,x=-d.near,g=2*Math.max(b/y.width,b/y.height);null===m.boundingSphere&&m.computeBoundingSphere(),c.copy(m.boundingSphere).applyMatrix4(p);f=Dw({x:0,y:0,z:-Math.max(d.near,c.distanceToPoint(l.origin))},{x:g,y:0,z:0},d);if(d.isPerspectiveCamera?f.x/=2:f.x=b/d.zoom,c.radius+=f.x,!1!==t.ray.intersectsSphere(c)){null===m.boundingBox&&m.computeBoundingBox(),h.copy(m.boundingBox).applyMatrix4(p);g=Dw({x:0,y:0,z:-Math.max(d.near,h.distanceToPoint(l.origin))},{x:g,y:0,z:0},d);if(d.isPerspectiveCamera?g.x/=2:g.x=b/d.zoom,h.max.x+=g.x,h.max.y+=g.x,h.max.z+=g.x,h.min.x-=g.x,h.min.y-=g.x,h.min.z-=g.x,!1!==t.ray.intersectsBox(h)){l.at(1,r),r.w=1,r.applyMatrix4(d.matrixWorldInverse),r.applyMatrix4(v),r.multiplyScalar(1/r.w),r.x*=y.x/2,r.y*=y.y/2,r.z=0,o.copy(r),s.multiplyMatrices(d.matrixWorldInverse,p);for(var M,S=0,E=w.count;S<E;S++)if(e.fromBufferAttribute(w,S),i.fromBufferAttribute(_,S),e.w=1,i.w=1,e.applyMatrix4(s),i.applyMatrix4(s),!(e.z>x&&i.z>x)){e.z>x?(M=e.z-i.z,M=(e.z-x)/M,e.lerp(i,M)):i.z>x&&(T=i.z-e.z,L=(i.z-x)/T,i.lerp(e,L)),e.applyMatrix4(v),i.applyMatrix4(v),e.multiplyScalar(1/e.w),i.multiplyScalar(1/i.w),e.x*=y.x/2,e.y*=y.y/2,i.x*=y.x/2,i.y*=y.y/2,a.start.copy(e),a.start.z=0,a.end.copy(i),a.end.z=0;var T=a.closestPointToPointParameter(o,!0);a.at(T,u);var L=Mt.lerp(e.z,i.z,T),T=-1<=L&&L<=1,L=u.distanceTo(i)<1||u.distanceTo(e)<1?.5*b*Math.sqrt(2):.5*b,L=o.distanceTo(u)<L;if(T&&L){a.start.fromBufferAttribute(w,S),a.end.fromBufferAttribute(_,S),a.start.applyMatrix4(p),a.end.applyMatrix4(p);T=new St,L=new St;l.distanceSqToSegment(a.start,a.end,L,T),n.push({point:L,pointOnLine:T,distance:l.origin.distanceTo(L),object:this,face:null,faceIndex:S,uv:null,uv2:null});break}}}}}}])&&kw(t.prototype,n),e&&kw(t,e),r}();function Nw(t){return(Nw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Fw(t,n){return(Fw=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Uw(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Bw(e);return t=i?(t=Bw(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Nw(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function Bw(t){return(Bw=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Gw=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Fw(t,n)}(i,Iw);var e=Uw(i);function i(t,n){return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,i),(n=e.call(this,t,n)).type="Line2",n.isLine2=!0,n}return i}();function Hw(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var Vw=function(){function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t)}var n,e,i;return n=t,(e=[{key:"calculatePoint",value:function(t,n,e){return(new St).copy(e).add((new St).copy(t).sub(e).normalize().multiplyScalar(n))}},{key:"computerArcLineByPoints",value:function(t,n,e,i,r){var o=[],t=this.calculatePoint(t,i,n),i=this.calculatePoint(e,i,n),s=new Lg(t,n,i);o.push(t);for(var a=0;a<r-1;a++){var u=s.getPoint((a+1)/r);o.push(u)}return o.push(i),o}}])&&Hw(n.prototype,e),i&&Hw(n,i),t}();function zw(t){return function(t){if(Array.isArray(t))return Ww(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,n){if(t){if("string"==typeof t)return Ww(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(e="Object"===e&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Ww(t,n):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ww(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}function Xw(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}Ri=function(){function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),this.lv=null,this.$n=0,this.Ad=void 0,this.zv=!0,this.Wv=1,this.Xv=[],this.Zv=!1,this.Yv=null,this.qv=null,this.Kv=[],this.Jv=[],this.Qv=[],this.$v=null,this.tp=null}var n,e,i;return n=t,(e=[{key:"points",get:function(){return this.lv},set:function(t){this.lv=t}},{key:"level",get:function(){return this.$n},set:function(t){this.$n=t}},{key:"buildingID",get:function(){return this.Ad},set:function(t){this.Ad=t}},{key:"length",get:function(){return this.np(this.Kv.length)}},{key:"linePoints",get:function(){return this.Yv}},{key:"uvys",get:function(){return this.qv}},{key:"resize",value:function(){this.Kv=[],this.Zv=!1}}])&&Xw(n.prototype,e),i&&Xw(n,i),t}();Object.assign(Ri.prototype,{ep:function(t,n){"number"!=typeof n&&(n=this.Wv),this.Yv=this.ip(t,n),this.qv=this.rp()},ip:function(t,n){this.zv?this.Zv||this.op(n):((n=[]).push.apply(n,zw(this.lv)),this.Xv=n);for(var e=[],i=0;i<this.Xv.length;i++){var r=this.Xv[i].x-t.x,o=this.Xv[i].z,s=-this.Xv[i].y+t.y;e.push(r,o,s),0!==i&&(o=new St(this.Xv[i].x,this.Xv[i].y,this.Xv[i].z),s=new St(this.Xv[i-1].x,this.Xv[i-1].y,this.Xv[i-1].z),this.Kv.push(o.distanceTo(s)))}return e},op:function(t){for(var n,e,i=[],r=new Vw,o=0;o<this.lv.length;o++)0===o&&this.tp?(n=this.sp(t,this.tp,this.lv[o],this.lv[o+1]),this.isCross?i.push.apply(i,zw(r.computerArcLineByPoints(this.tp,this.lv[o],this.lv[o+1],n,12))):i.push(r.calculatePoint(this.lv[o+1],n,this.lv[o]))):o===this.lv.length-1&&this.$v?(e=this.sp(t,i[i.length-1],this.lv[o],this.$v),this.isCross?i.push.apply(i,zw(r.computerArcLineByPoints(i[i.length-1],this.lv[o],this.$v,e,12))):i.push(r.calculatePoint(i[i.length-1],e,this.lv[o]))):0<o&&o<this.lv.length-1?(e=this.sp(t,i[i.length-1],this.lv[o],this.lv[o+1]),i.push.apply(i,zw(r.computerArcLineByPoints(i[i.length-1],this.lv[o],this.lv[o+1],e,12)))):i.push(this.lv[o]);this.Xv=i,this.Zv=!0},sp:function(t,n,e,i){return Math.min(.5*Lu.distanceOfTwoPoints(n,e),.5*Lu.distanceOfTwoPoints(e,i),t)},rp:function(){for(var t,n=[],e=this.np(this.Kv.length),i=0;i<this.Xv.length;i++)0===i?n.push(0):i===this.Xv.length-1?n.push(1):(t=this.np(i)/e,n.push(t),n.push(t));return n},np:function(t){for(var n=0,e=0;e<this.Kv.length;e++)e<t&&(n+=this.Kv[e]);return n}});var Zw=Ri,Yw={FULL:0,DOTTED:2,DOT_DASH:4,CENTER:8,DASH:16,DOUBLE_DOT_DASH:32,TRI_DOT_DASH:64,FMARROW:128,ARROW:256};function qw(t){return(qw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Kw(t,n){var e;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(e=function(t,n){if(t){if("string"==typeof t)return Jw(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(e="Object"===e&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Jw(t,n):void 0}}(t))||n&&t&&"number"==typeof t.length){e&&(t=e);var i=0,n=function(){};return{s:n,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},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,o=!0,s=!1;return{s:function(){e=t[Symbol.iterator]()},n:function(){var t=e.next();return o=t.done,t},e:function(t){s=!0,r=t},f:function(){try{o||null==e.return||e.return()}finally{if(s)throw r}}}}function Jw(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}function Qw(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function $w(t,n,e){return($w="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,n,e){t=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=i_(t)););return t}(t,n);if(t){n=Object.getOwnPropertyDescriptor(t,n);return n.get?n.get.call(e):n.value}})(t,n,e||t)}function t_(t,n){return(t_=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function n_(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=i_(e);return t=i?(t=i_(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==qw(t)&&"function"!=typeof t?e_(n):t}}function e_(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function i_(t){return(i_=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}e=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&t_(t,n)}(r,sb);var t,n,e,i=n_(r);function r(t){var n;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),n=i.call(this,t),t=t||{},n.Un=Ii.LINE_MARKER,n.gu=t.url,n.Ju=void 0!==t.width?t.width:6,n.Du=void 0!==t.color?t.color:"#33cc61",n.zv=void 0===t.smooth||t.smooth,n.Tv=void 0!==t.radius?t.radius:1,n.Di=void 0===t.animate||t.animate,n.Eu=void 0!==t.opacity?t.opacity:1,n.Jd=void 0===t.depth||t.depth,n.ap=void 0!==t.type?t.type:Yw.FMARROW,n.hp=void 0!==t.borderColor?t.borderColor:"#4a82d2",n.cp=void 0!==t.segments?t.segments:[],n.Ni=[],n.fp=60,n.lp=10,n.dp="#aeaeae",n.vp=n.vp.bind(e_(n)),n.pp=n.pp.bind(e_(n)),n.mp=n.mp.bind(e_(n)),n.gp=n.gp.bind(e_(n)),n.Lf=n.Lf.bind(e_(n)),n}return t=r,(n=[{key:"bound",get:function(){if(!0===this.needUpdateBound){this.Gn.reset();for(var t=this.cp,n=0;n<t.length;n++){var e=t[n];this.Gn.expandByCoords(e.lv)}this.needUpdateBound=!1}return this.Gn.clone()}},{key:"level",get:function(){return null}},{key:"width",get:function(){return this.Ju},set:function(t){0!==t&&t!==this.Ju&&(this.Ju=t,this.Mu())}},{key:"color",get:function(){return this.Du},set:function(t){this.Du!==t&&(this.Du=t,this.Mu())}},{key:"opacity",get:function(){return this.Eu},set:function(t){this.Eu!==t&&(this.Eu=t,this.Mu())}},{key:"passedColor",get:function(){return this.dp},set:function(t){this.dp!==t&&(this.dp=t,this.Mu())}},{key:"segments",get:function(){return this.cp}},{key:"visible",get:function(){return this.Bn},set:function(t){this.Bn=t;for(var n=0;n<this.Ni.length;n++)this.Ni[n].line.visible=t;var e=this.Vn(tb);e&&e.enableUpdateRender()}},{key:"update",value:function(){var t,n;this.jn&&this.jn.material&&((t=this.Vn(tb))&&(n=this.Vn(ug),this.jn.material=t.Zt.xe.Gs({color:this.Du,lineWidth:this.Ju,opacity:this.Eu*n.Eu,needDepth:!1})))}},{key:"moveProportion",value:function(t){for(var n=0,e=this.Ni.length-1;-1<e;e--)this.Ni[e].isCross||(n+=this.Ni[e].seg.length);for(var i=0,r=this.Ni.length-1;-1<r;r--){var o=i/n;this.Ni[r].isCross||(i+=this.Ni[r].seg.length);var s=i/n;s<t?this.Ni[r].line.material.uniforms.miny.value=1:t<=s&&(this.Ni[r].line.material.uniforms.miny.value=(t-o)/(s-o))}var a=this.Vn(tb);a&&a.enableUpdateRender()}},{key:"getLineNodes",value:function(){return this.Ni}},{key:"addTo",value:function(t){t.Ii.add(this),this.yp(),t.on("visibleLevelsLoaded",this.gp),t.on("zoom",this.pp),t.on("levelChanged",this.pp),t.on("resize",this.mp),this.Di&&t.pn.ad(this.vp)}},{key:"remove",value:function(){var t=this.Vn(tb);if(t){t.off("visibleLevelsLoaded",this.gp),t.off("zoom",this.pp),t.off("levelChanged",this.pp),t.off("resize",this.Ui);for(var n=0;n<this.Ni.length;n++){var e=this.Ni[n].buildingID&&""+this.Ni[n].buildingID,e=this.Xt(e,this.Ni[n].gid,t);e&&e.getOrCreateLayer(this.Un).Fi.remove(this.Ni[n].line)}this.Ni=[],this.Di&&t.pn.ud(this.vp),t.Ii.remove(this),t.enableUpdateRender()}}},{key:"dispose",value:function(){$w(i_(r.prototype),"dispose",this).call(this);for(var t=0;t<this.cp.length;t++)this.cp[t].resize()}}])&&Qw(t.prototype,n),e&&Qw(t,e),r}();Object.assign(e.prototype,{bp:function(t,n){var e=new Tw;e.setPositions(t);t=this.Vn(ug),t=n.Zt.xe.Gs({color:this.Du,lineWidth:this.Ju,opacity:this.opacity*t.Eu,needDepth:!1});this.jn=new Gw(e,t),this.jn.computeLineDistances(),e.dispose(),e=null},wp:function(t){var n=new Tw;n.setPositions(t),this.jn.geometry=n,this.jn.computeLineDistances(),n.dispose(),n=null},za:function(){var t=this.Vn(tb);if(t){for(var n=this._p(),e=this.cp.length-1;-1<e;e--){var i=this.Xt(this.cp[e].buildingID,this.cp[e].$n,t);if(!i)return;var r=void 0,o=void 0;if(0<e&&this.cp[e].Ad===this.cp[e-1].Ad&&this.cp[e].$n!==this.cp[e-1].$n){if(!(r=this.Xt(this.cp[e-1].buildingID,this.cp[e-1].$n,t)))return;o=this.cp[e-1].points,this.cp[e].tp=Object.assign({},o[o.length-1]),this.cp[e].tp.z+=r.Jt-i.Jt}if(e<this.cp.length-1&&this.cp[e].Ad===this.cp[e+1].Ad&&this.cp[e].$n!==this.cp[e+1].$n){var s=this.Xt(this.cp[e+1].buildingID,this.cp[e+1].$n,t);if(!s)return;this.cp[e].$v=Object.assign({},this.cp[e+1].points[0]),this.cp[e].$v.z+=s.Jt-i.Jt}var a=this.xp(this.cp[e],n);this.Ni.push({line:a,buildingID:this.cp[e].Ad,gid:this.cp[e].$n,seg:this.cp[e],isCross:!1}),i.getOrCreateLayer(this.Un).Fi.add(a),0<e&&this.cp[e].Ad===this.cp[e-1].Ad&&this.cp[e].$n!==this.cp[e-1].$n&&((s=new Zw).$n=this.cp[e].$n,s.Ad=this.cp[e].Ad,s.isCross=!0,a=this.cp[e].points,this.Mp(s,o,a,r,i),i=this.xp(s,n),this.Ni.push({buildingID:s.Ad,line:i,seg:s,gid:this.cp[e-1].$n,gidAn:s.$n,isCross:!0,levelRange:[this.cp[e-1].$n,this.cp[e].$n]}),r.getOrCreateLayer(this.Un).Fi.add(i))}return this.Va=!0,t.enableUpdateRender(),this.Va}},Mp:function(t,n,e,i,r){var o=Object.assign({},n[n.length-1]),s=Object.assign({},e[0]);o.z+=i.Jt-r.Jt,t.points=[o,s],t.tp=Object.assign({},n[n.length-2]),t.tp.z+=i.Jt-r.Jt,t.$v=Object.assign({},e[1])},xp:function(t,n){var e=this.Vn(tb);if(e){var i=new fi(e.x,e.y);t.zv=this.zv,t.ep(i,this.Tv);var r=this.Xt(t.Ad,t.$n,e);if(r){for(var o=[],s=0;s<t.linePoints.length;s++)o.push(t.linePoints[s]);var a=t.qv,i=new Tw;i.setPositions(o),i.setUvys(a);a=new wc({color:this.Du,lineWidth:this.Ju,vertexColors:2,dashed:!1,transparent:!0,pcolor:this.dp,opacity:this.Eu});a.depthTest=this.Jd,a.depthWrite=this.Jd,a.transparent=!0,a.resolution=new fi(e.cn.renderer.domElement.clientWidth,e.cn.renderer.domElement.clientHeight),n.useMap&&(a.defines.USE_MMAP=!0,a.uniforms.mmap.value=n.texture,this.Sp(a,t,this.fp),a.needsUpdate=!0);a=new Gw(i,a);return a.computeLineDistances(),a.position.set(0,r.Jt,0),a.mapNode=this,a}}},vp:function(t){for(var n=0;n<this.Ni.length;n++)this.Ni[n].line.material.uniforms.offset.value.y-=.001*t;this.Vn(tb).enableUpdateRender()},pp:function(){for(var t=0;t<this.Ni.length;t++)this.Sp(this.Ni[t].line.material,this.Ni[t].seg,this.fp)},Sp:function(t,n,e){var i,r=this.Vn(tb);r&&(i=n.length,(n=this.Xt(n.Ad,n.$n,r))&&(n=i*r.Zt.Tl(n.Jt),t.uniforms.repeat.value.y=Math.floor(n*window.devicePixelRatio/e),r.enableUpdateRender()))},mp:function(){var t=this.Vn(tb);if(t){for(var n=0;n<this.Ni.length;n++)this.Ni[n].line.material.resolution=new fi(t.cn.renderer.domElement.clientWidth,t.cn.renderer.domElement.clientHeight);t.enableUpdateRender()}},yp:function(){var t,n=this.Vn(tb),e=Kw(this.Ni);try{for(e.s();!(t=e.n()).done;){var i,r=t.value;r.isCross?(i=this.Wo(r.buildingID,n).visibleLevels).indexOf(r.gid)<0||i.indexOf(r.gidAn)<0?r.line.visible=!1:r.line.visible=!0:-1<this.Wo(r.buildingID,n).visibleLevels.indexOf(r.gid)?r.line.visible=!0:r.line.visible=!1}}catch(t){e.e(t)}finally{e.f()}n.enableUpdateRender()},gp:function(){this.Vn(tb)&&this.yp()},Ep:function(){this.fp=this.Ju*this.lp;var t={type:"normal",width:128,height:128,color:this.Du,arrowHeightPercent:.6,arrowWidthPercent:1,arrowPercent:.1,lineType:null,dashArray:[2,1],textureCommand:"createNormalLineTexture",godHeightPercent:1,godEdgePercent:.2,godArrowPercent:.15,arrowWidth:20,godColor:this.Du,godEdgeColor:this.hp,godArrowColor:"#F4FEFB",godArrowXScale:4,godArrowWidthPercent:.9,useMap:!0};switch(this.ap){case Yw.FULL:t.useMap=!1;break;case Yw.DOTTED:t.dashArray=[.5,.5,.5,.5,.5,.5,.5,.5];break;case Yw.DOT_DASH:t.dashArray=[2.5,1,.5,1];break;case Yw.CENTER:t.dashArray=[3,1,1.5,1];break;case Yw.DASH:t.dashArray=[2,1];break;case Yw.DOUBLE_DOT_DASH:t.dashArray=[2.5,.5,.5,.5,.5,.5];break;case Yw.TRI_DOT_DASH:t.dashArray=[2.5,.5,.5,.5,.5,.5,.5,.5];break;case Yw.FMARROW:case Yw.ARROW:t.width=5*this.Ju,t.height=5*this.fp,t.arrowWidth=t.height/12,t.dashArray=[7,0],t.textureCommand="createArrowWidthBackTexture";break;default:t.useMap=!1}return t},_p:function(){var t=this.Vn(tb);if(t){var n=this.Ep(),e=null;return this.gu?{useMap:!0,texture:t.Zt.xe.Ks(this.gu,function(t){t.needsUpdate=!0})}:(n.useMap&&((e=t.Zt.xe[n.textureCommand](n)).minFilter=An,e.wrapS=Sn,e.wrapT=Sn,e.generateMipmaps=!1,e.anisotropy=4),{useMap:n.useMap,texture:e})}},Mu:function(){if(0<this.Ni.length)for(var t=this._p(),n=0;n<this.Ni.length;n++)this.Ni[n].line.material.lineWidth=this.Ju,this.Ni[n].line.material.color=new _i(this.Du),this.Ni[n].line.material.pcolor=new _i(this.dp),this.Ni[n].line.material.opacity=this.Eu,t.useMap&&(this.Ni[n].line.material.uniforms.mmap.value=t.texture);var e=this.Vn(tb);e&&e.enableUpdateRender()},Xt:function(t,n,e){return(t?this.Wo(t,e):e).getFloor(n)},Wo:function(t,n){return t=t||n.getMapOptions().buildingID,n.getBuilding(t)},Lf:function(){if(0<this.Ni.length){var t=this.Vn(tb);if(t){for(var n=0;n<this.Ni.length;n++){var e=this.Ni[n];if(e.isCross){var i=this.Xt(e.buildingID,e.gid,t),r=this.Xt(e.buildingID,e.gidAn,t);e.seg.resize(),this.Mp(e.seg,this.Ni[n+1].seg.points,this.Ni[n-1].seg.points,i,r);r=this._p(),r=this.xp(e.seg,r),i=i.getOrCreateLayer(this.Un);i.Fi.add(r),i.Fi.remove(e.line),r.material.uniforms.miny.value=e.line.material.uniforms.miny.value,e.line.geometry.dispose(),e.line.material.dispose(),e.line=r}else{r=this.Xt(e.seg.Ad,e.seg.$n,t);if(!r)return;e.line.position.y=r.Jt}}t.enableUpdateRender()}}}});var r_=e;function o_(t){return(o_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function s_(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function a_(t,n){return(a_=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function u_(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=h_(e);return t=i?(t=h_(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==o_(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function h_(t){return(h_=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}yh=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&a_(t,n)}(r,sb);var t,n,e,i=u_(r);function r(t){var n;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(n=i.call(this,t)).Un=Ii.POLYGON_MARKER,n.gu=void 0!==t.url?t.url:void 0,n.Du=void 0!==t.color?t.color:"#FF0000",n.Eu=void 0!==t.opacity?t.opacity:1,n.Iu=t.borderColor||t.borderColor||"#00ff00",n.Ju="number"==typeof t.borderWidth?t.borderWidth:2,n.Jt=void 0!==t.height?t.height:0,n.lv=void 0!==t.points?t.points:[],n}return t=r,(n=[{key:"bound",get:function(){return!0===this.needUpdateBound&&(this.Gn.reset(),this.Gn.expandByCoords(this.lv),this.needUpdateBound=!1),this.Gn.clone()}},{key:"x",get:function(){return this.N}},{key:"y",get:function(){return this.F}},{key:"points",get:function(){return this.lv},set:function(t){if(this.lv=t,this.jn){var n=this.Vn(tb);if(n){var t=new fi(n.x,n.y),e=fw.createShapeBufferGeometryByCenter(this.lv,t,!!this.gu),t=this.jn.geometry;this.jn.geometry=e,t.dispose();for(var t=null,i=e.attributes.position.array.length,r=new Float32Array(i+3),o=0;o<i;o++)r[o]=e.attributes.position.array[o];r[i]=e.attributes.position.array[0],r[i+1]=e.attributes.position.array[1],r[i+2]=e.attributes.position.array[2],this.Cu.wp(r),n.enableUpdateRender()}}}},{key:"color",get:function(){return this.Du},set:function(t){this.Du=t,this.Tp()}},{key:"borderColor",get:function(){return this.Iu},set:function(t){this.Iu=t,this.Cu&&(this.Cu.color=t,this.Cu.update())}},{key:"borderWidth",get:function(){return this.Ju},set:function(t){this.Ju=t,this.Cu&&(this.Cu.width=t,this.Cu.update())}},{key:"opacity",get:function(){return this.Eu},set:function(t){this.Eu=t,this.Tp()}},{key:"getBound",value:function(){return yv.bound(this.lv)}},{key:"getInsideCenter",value:function(){var t={};return yv.calculatorInsideCentroid(this.lv,t),t}},{key:"getRenderNode",value:function(){return this.jn}}])&&s_(t.prototype,n),e&&s_(t,e),r}();Object.assign(yh.prototype,{za:function(){if(!this.lv)return!1;var t=this.Vn(tb);if(!t)return!1;for(var n=this.Vn(ug),e=t.Zt.xe.Ds({url:this.gu,color:this.Du,opacity:this.Eu*n.Eu,visible:!this.gu},function(){e.map.wrapS=En,e.map.wrapT=En,e.needsUpdate=!0,e.visible=!0}),n=new fi(t.x,t.y),i=fw.createShapeBufferGeometryByCenter(this.lv,n,!!this.gu),r=i.attributes.position.array.length,o=new Float32Array(r+3),s=0;s<r;s++)o[s]=i.attributes.position.array[s];o[r]=i.attributes.position.array[0],o[r+1]=i.attributes.position.array[1],o[r+2]=i.attributes.position.array[2],this.jn=new Ko(i,e),this.jn.rotation.set(-Math.PI/2,0,0,"XYZ"),this.jn.position.set(0,this.Jt,0),this.jn.mapNode=this;n=new r_({color:this.Iu,width:this.Ju});return n.tt=this,n.bp(o,t),this.Yv=o,this.Cu=n,this.jn.add(n.jn),t.enableUpdateRender(),!0},Lf:function(){this.jn&&this.jn.position.set(0,this.Jt,0),map.enableUpdateRender()},Tp:function(){var t=this,n=this.Vn(tb);if(!n)return!1;var e=n.Zt,i=this.Vn(ug);this.jn.material=e.xe.Ds({url:this.gu,color:this.Du,opacity:this.Eu*i.Eu,visible:!this.gu},function(){t.jn.material.map.wrapS=En,t.jn.material.map.wrapT=En,t.jn.material.needsUpdate=!0,t.jn.material.visible=!0}),n.enableUpdateRender()},Mu:function(){this.Tp(),this.Cu.update()}});mi=yh;function c_(t){return(c_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function f_(t,n){return(f_=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function l_(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=d_(e);return t=i?(t=d_(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==c_(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function d_(t){return(d_=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var v_=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&f_(t,n)}(i,eo);var e=l_(i);function i(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,i);var t=e.call(this),n=new Du(new Float32Array([-.5,0,-.5,0,0,.5,0,-.5,1,0,.5,0,.5,1,1,-.5,0,.5,0,1]),5);return t.setIndex([0,1,2,0,2,3]),t.setAttribute("position",new Nu(n,3,0,!1)),t.setAttribute("uv",new Nu(n,2,3,!1)),t}return i}();function p_(t){return(p_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function m_(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function g_(t,n,e){return(g_="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,n,e){t=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=__(t)););return t}(t,n);if(t){n=Object.getOwnPropertyDescriptor(t,n);return n.get?n.get.call(e):n.value}})(t,n,e||t)}function y_(t,n){return(y_=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function b_(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=__(e);return t=i?(t=__(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==p_(t)&&"function"!=typeof t?w_(n):t}}function w_(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function __(t){return(__=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}Gi=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&y_(t,n)}(r,sb);var t,n,e,i=b_(r);function r(t){var n;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(n=i.call(this,t)).Un=Ii.LOCATION_MARKER,n.gu=t.url,n.Xi=void 0!==t.size?t.size:20,n.$n=void 0!==t.level?t.level:1,n.Eu=void 0!==t.opacity?t.opacity:1,n.Ad=t.buildingID,n.Lp=0,n.Lt=null,n.Rp=null,n.Yi=n.Yi.bind(w_(n)),n.Lf=n.Lf.bind(w_(n)),n}return t=r,(n=[{key:"bound",get:function(){return!0===this.needUpdateBound&&(this.Gn.reset(),void 0!==this.N&&void 0!==this.F&&(this.Gn.expandByCoords([{x:this.N,y:this.F}]),this.needUpdateBound=!1)),this.Gn.clone()}},{key:"buildingID",get:function(){return this.Ad}},{key:"level",get:function(){return this.$n},set:function(t){this.$n!==t&&(this.$n=t,t=this.Vn(tb),this.remove(),this.addTo(t))}},{key:"opacity",get:function(){return this.Eu},set:function(t){this.Eu=t,this.Va&&this.Mu()}},{key:"url",get:function(){return this.gu},set:function(t){this.gu=t,this.Mu()}},{key:"size",get:function(){return this.Xi},set:function(t){this.Xi=t,this.Yi()}},{key:"moveTo",value:function(t){var n=this,e=t.animate||!1,i=t.duration||.5;if(this.Ad!==t.buildingID){this.Ad=t.buildingID,this.$n=t.level;var r=this.Vn(tb);if(!r)return!1;this.remove(),this.addTo(r)}else t.level&&(this.level=t.level);if(e){e=this.Vn(tb);if(!e)return!1;this.Lt||(this.Lt=new Oi),this.Lt.pt([this.N,this.F]).mt([t.x,t.y]).gt(i).bt(function(t){n.N=t.destination[0],n.F=t.destination[1],n.Lf(),n.Yi()}).wt(function(){n.N=t.x,n.F=t.y,n.Lf(),t.finish&&t.finish()}),e.pn.mn(this.Lt.dt())}else this.N=t.x,this.F=t.y,this.Lf(),this.Yi();return this.Lt}},{key:"stop",value:function(){var t;this.Lt||this.Rp||(t=this.Vn(tb))&&(this.Lt&&(t.pn.vn(this.Lt),this.Lt=null),this.Rp&&(t.pn.vn(this.Rp),this.Rp=null),this.cv=!1)}},{key:"rotateTo",value:function(t){var n=this,e=this.Vn(tb);if(!e)return!1;var i=t.duration||.5,r=this.jn.rotation.y,o=t.heading%360*pi.DEG2RAD,s=0,s=r+(s=o-r!=0?Math.sin(o-r)/Math.abs(Math.sin(o-r))*Math.acos(Math.cos(o-r)):s);t.animate?(this.Rp&&this.Rp.finish(),this.Rp=new Oi({src:[r],dest:[s]}),this.Rp.gt(i).bt(function(t){n.jn&&(n.jn.rotation.y=t.destination[0],n.Lp=t.destination[0],e.enableUpdateRender())}).wt(function(){e.pn.vn(n.Rp),n.Rp=null,e.enableUpdateRender(),t.finish&&t.finish()}),e.pn.mn(this.Rp.dt())):this.jn&&(this.jn.rotation.y=s,this.Lp=s,e.enableUpdateRender())}},{key:"addTo",value:function(t){var n=this.Xt(t);n&&(g_(__(r.prototype),"addTo",this).call(this,n),t.on("zoom",this.Yi),t.on("resize",this.Yi),t.on("viewChanged",this.Yi))}},{key:"remove",value:function(){this.stop();var t=this.Vn(tb);if(!t)return!1;t.off("zoom",this.Yi),t.off("resize",this.Yi),t.off("viewChanged",this.Yi),g_(__(r.prototype),"remove",this).call(this)}},{key:"getRenderNode",value:function(){return this.jn}}])&&m_(t.prototype,n),e&&m_(t,e),r}();Object.assign(Gi.prototype,{za:function(){var t=this.Vn(tb);if(!t)return!1;var n=new v_,e=this.be(t);this.jn=new Ko(n,e),this.jn.renderOrder=1,(this.jn.mapNode=this).Lf(),this.jn.rotation.set(0,this.Lp,-Math.PI,"XYZ"),this.jn.updateMatrixWorld(!0);t=t.Zt.El(this.jn,this.Xi);return this.jn.scale.set(t,t,t),this.jn.visible=this.Bn,this.tt.Fi.add(this.jn),this.Va=!0},Yi:function(){var t,n,e=this.Vn(tb);e&&(t=this.jn.position,n=!1,(n=isNaN(t.x)||isNaN(t.y)||isNaN(t.z)||"number"!=typeof t.x||"number"!=typeof t.y||"number"!=typeof t.z?!0:n)||(n=e.Zt.El(this.jn,this.Xi),this.jn.scale.set(n,n,n),e.enableUpdateRender()))},Lf:function(){var t,n=this.Vn(tb);!n||(t=this.Xt(n))&&(this.jn.position.set(this.N-n.x,t.Jt+this.Jt,-this.F+n.y),this.needUpdateBound=!0,n.enableUpdateRender())},be:function(n){var e=this;return n.Zt.xe.Is({url:this.gu,flipY:!1,opacity:this.Eu},function(){var t;e.jn&&(t=n.Zt.El(e.jn,e.Xi),e.jn.scale.set(t,t,t),n.enableUpdateRender())})},Mu:function(){var t=this.Vn(tb);if(!t)return!1;this.jn.material.map&&this.jn.material.map.dispose(),this.jn.material.dispose(),this.jn.material=this.be(t),this.jn.material.needsUpdate=!0,t.enableUpdateRender()},Xt:function(t){return(this.Ad?t.getBuilding(this.Ad):t).getFloor(this.$n)}});tr=Gi,_r={EDGES_LINES_TYPE:"EDGES_LINES_TYPE"};Object.freeze(_r);var x_=_r,M_={NONE:0,ALL:1,TOP:2};function S_(t,n){eo.call(this),this.type="EdgesGeometry",this.parameters={thresholdAngle:n},n=void 0!==n?n:1;var e,i,r,o,s=[],a=Math.cos(Mt.DEG2RAD*n),u=[0,0],h={},c=["a","b","c"];t.isBufferGeometry?(o=new Dr).fromBufferGeometry(t):o=t.clone(),o.mergeVertices(),o.computeFaceNormals();for(var f=o.vertices,l=o.faces,d=0,v=l.length;d<v;d++)for(var p=l[d],m=0;m<3;m++)e=p[c[m]],i=p[c[(m+1)%3]],u[0]=Math.min(e,i),u[1]=Math.max(e,i),void 0===h[r=u[0]+","+u[1]]?h[r]={index1:u[0],index2:u[1],face1:d,face2:void 0}:h[r].face2=d;for(r in h){var g,y=h[r];(void 0===y.face2||l[y.face1].normal.dot(l[y.face2].normal)<=a)&&(g=f[y.index1],s.push(g.x,g.y,g.z),g=f[y.index2],s.push(g.x,g.y,g.z))}this.setAttribute("position",new Wr(s,3))}function E_(t){return(E_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function T_(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function L_(t,n){return(L_=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function R_(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=O_(e);return t=i?(t=O_(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==E_(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function O_(t){return(O_=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}(S_.prototype=Object.create(eo.prototype)).constructor=S_;Ri=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&L_(t,n)}(r,sb);var t,n,e,i=R_(r);function r(t){var n;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(n=i.call(this,t)).Un=x_.EDGES_LINES_TYPE,n.ap=void 0!==t.lineType?t.lineType:M_.TOP,n.Op=void 0!==t.lineAlpha?t.lineAlpha:1,n.Iu=void 0!==t.lineColor?t.lineColor:"#FF0000",n}return t=r,(n=[{key:"lineColor",get:function(){return this.Iu},set:function(t){this.Iu!==t&&(this.Iu=t,this.Mu())}},{key:"lineAlpha",get:function(){return this.Op},set:function(t){this.Op!==t&&(this.Op=t,this.Mu())}}])&&T_(t.prototype,n),e&&T_(t,e),r}();Object.assign(Ri.prototype,{xp:function(t){var n=new S_(t),e=this.Vn(tb);if(!e)return!1;t=e.Zt,e=this.Vn(ug),e=t.xe.Ys(this.Iu,this.Op*e.Eu);this.jn=new vl(n,e),this.Va=!0},Mu:function(){var t,n=this.Vn(tb);n&&(t=this.Vn(ug),this.jn.material=n.Zt.xe.Ys(this.Iu,this.Op*t.Eu))}});var A_=Ri;function k_(t){return(k_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function C_(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function j_(t,n,e){return(j_="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,n,e){t=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=N_(t)););return t}(t,n);if(t){n=Object.getOwnPropertyDescriptor(t,n);return n.get?n.get.call(e):n.value}})(t,n,e||t)}function P_(t,n){return(P_=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function D_(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=N_(e);return t=i?(t=N_(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==k_(t)&&"function"!=typeof t?I_(n):t}}function I_(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function N_(t){return(N_=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}e=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&P_(t,n)}(r,sb);var t,n,e,i=D_(r);function r(t){var n;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(n=i.call(this,t)).Un=Ii.EXTRUDE_MARKER,n.Eu=void 0!==t.opacity?t.opacity:1,n.Du=void 0!==t.color?t.color:"#FF0000",n.dv=void 0!==t.extrudeHeight?t.extrudeHeight:1,n.Jd=n.dv,n.lv=void 0!==t.points?Object.assign(t.points):[],n.lv.constructor===Array&&(xy.polygonArea(n.lv)<0&&n.lv.reverse(),xy.closedPoints(n.lv)),n.Ap=new A_({lineType:t.edgeMode,lineColor:void 0!==t.edgeColor?t.edgeColor:n.Du,lineAlpha:void 0!==t.edgeOpacity?t.edgeOpacity:n.Eu}),n.Ap.tt=I_(n),n}return t=r,(n=[{key:"bound",get:function(){return!0===this.needUpdateBound&&(this.Gn.reset(),this.Gn.expandByCoords(this.lv),this.needUpdateBound=!1),this.Gn.clone()}},{key:"x",get:function(){return this.N}},{key:"y",get:function(){return this.F}},{key:"color",get:function(){return this.Du},set:function(t){this.Du!==t&&(this.Du=t,this.kp())}},{key:"opacity",get:function(){return this.Eu},set:function(t){this.Eu!==t&&(this.Eu=t,this.kp())}},{key:"edgeColor",get:function(){return this.Ap.Iu},set:function(t){this.Ap.lineColor=t}},{key:"edgeOpacity",get:function(){return this.Ap.Op},set:function(t){this.Ap.lineAlpha=t}},{key:"extrudeHeight",get:function(){return this.dv},set:function(t){this.dv!==t&&(this.dv=t,this.jn.scale.setZ(this.dv/this.Jd))}},{key:"points",get:function(){return this.lv},set:function(t){this.lv=t,this.lv.constructor===Array&&(xy.polygonArea(this.lv)<0&&this.lv.reverse(),xy.closedPoints(this.lv)),!this.jn||(t=this.Vn(tb))&&(this.jn.parent.remove(this.jn),this.jn.traverse(function(t){t instanceof Ko&&(t.geometry.dispose(),t.material=void 0,t.geometry=void 0)}),this.jn.mapNode=void 0,this.jn=void 0,this.za(),this.parent.scene.add(this.jn),t.enableUpdateRender())}},{key:"dispose",value:function(){this.Ap&&this.Ap.dispose(),j_(N_(r.prototype),"dispose",this).call(this)}},{key:"getRenderNode",value:function(){return this.jn}},{key:"setType",value:function(t){this.Un=t}}])&&C_(t.prototype,n),e&&C_(t,e),r}();Object.assign(e.prototype,{za:function(){var t=this.Vn(tb);if(!t)return!1;var n=t.Zt,e=this.Vn(ug),i=new fi(t.x,t.y),r=fw.createShape(this.lv,i),o={depth:this.Jd},o=fw.createExtrudeBufferGeometry(r,o),e=n.xe.Ys(this.Du,this.Eu*e.Eu);return this.jn=new Ko(o,e),(this.jn.mapNode=this).jn.rotation.set(-Math.PI/2,0,0,"XYZ"),this.jn.position.set(0,this.Jt,0),this.Ap.ap===M_.TOP?this.Cp(i):this.Ap.ap===M_.ALL&&this.Qu(o),this.Va=!0,t.enableUpdateRender(),this.Va},Cp:function(t){t=new Qg(fw.createShape(this.lv,t));this.Qu(t),this.Ap.jn.position.setZ(this.Jd),t.dispose()},Qu:function(t){this.Ap.xp(t),this.jn.add(this.Ap.jn)},kp:function(){var t,n=this.Vn(tb);n&&(t=this.Vn(ug),this.jn.material=n.Zt.xe.Ys(this.Du,this.Eu*t.Eu),n.enableUpdateRender())},Mu:function(){this.kp(),this.Ap.Mu()},Lf:function(){this.jn.position.set(0,this.Jt,0),this.Vn(tb).enableUpdateRender()}});yh=e;function F_(t){return(F_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function U_(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function B_(t,n,e){return(B_="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,n,e){t=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=V_(t)););return t}(t,n);if(t){n=Object.getOwnPropertyDescriptor(t,n);return n.get?n.get.call(e):n.value}})(t,n,e||t)}function G_(t,n){return(G_=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function H_(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=V_(e);return t=i?(t=V_(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==F_(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function V_(t){return(V_=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}Gi=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&G_(t,n)}(r,sb);var t,n,e,i=H_(r);function r(t,n){var e;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(e=i.call(this,n=n||{})).Un=Ii.HEAT_MAP_MARKER,e.W=t,e.Eu=n.opacity?255*n.opacity:25500,e.Tv=void 0!==n.radius?n.radius:30,e.jp=void 0!==n.valueRange?void 0!==n.valueRange.max?void 0!==n.valueRange.min?n.valueRange:{max:n.valueRange.max,min:0}:void 0!==n.valueRange.min?{max:100,min:n.valueRange.min}:{max:100,min:0}:{max:100,min:0},e.jp.min>=e.jp.max&&(e.jp={max:100,min:0}),e.Pp=void 0!==n.quality?n.quality:1024,e.qa=void 0===n.isPlane||n.isPlane,e.Dp=void 0!==n.gradient?n.gradient:{.45:"rgb(0,0,255)",.55:"rgb(0,255,255)",.65:"rgb(0,255,0)",.95:"yellow",1:"rgb(255,0,0)"},e.Ip=Math.ceil(+e.Tv),e.Np=15e3,e.lv=[],e.Fp=null,e.Ee=null,e.Up=null,e.Bp=0,e.Gp=null,e.Hp=null,e.Ja=null,e.ws=void 0,e}return t=r,(n=[{key:"bound",get:function(){var t,n;return!0===this.needUpdateBound&&null!==this.Hp&&(this.Gn.reset(),t=this.Hp.getLayers(Ii.MODEL_LAYER)[0],!1===this.qa?(n=this.Hp.getLayers(Ii.EXTENT_LAYER)[0],t&&this.Gn.expand(t.bound),n&&this.Gn.expand(n.bound)):t&&this.Gn.expand(t.bound),this.needUpdateBound=!1),this.Gn.clone()}},{key:"x",get:function(){return this.N}},{key:"y",get:function(){return this.F}},{key:"opacity",get:function(){return this.Eu/255},set:function(t){this.Eu=255*t}},{key:"simulate",value:function(t){this.Bp=t}},{key:"clearDataSource",value:function(){this.lv=[],this.Vp()}},{key:"addPoint",value:function(t,n,e){if(t&&n&&e){n=this.zp(t,n);if(n){this.Vp();for(var i=0;i<this.lv.length;i++)this.Wp(this.lv[i][0],this.lv[i][1],this.lv[i][2],!0);this.Wp(n.x,n.y,e,!1),this.Xp()}}}},{key:"addDataSource",value:function(t){this.Ee=t}},{key:"update",value:function(){var t;this.Ja=new Sr(this.Zp(this.Up)),this.qa?(t=this.jn.material.map,this.jn.material.map=this.Ja,this.jn.material.map.needsUpdate=!0,this.jn.material.needsUpdate=!0,t.dispose()):this.tt.Ka(this.Ja),this.W.enableUpdateRender()}},{key:"addTo",value:function(t){var n=(this.Hp=t).getLayers(Ii.EXTENT_LAYER)[0].bound;this.Fp=this.Yp(n),this.Up=document.createElement("canvas"),this.Up.width=this.Fp.width,this.Up.height=this.Fp.height,this.Gp=this.Up.getContext("2d"),null!=this.Ee&&this.qp(n),0!=this.Bp&&this.Kp(this.Bp),B_(V_(r.prototype),"addTo",this).call(this,t),this.needUpdateBound=!0}},{key:"dispose",value:function(){B_(V_(r.prototype),"dispose",this).call(this),this.Hp=null,this.Ja&&this.Ja.dispose(),this.Ja=null}}])&&U_(t.prototype,n),e&&U_(t,e),r}();Object.assign(Gi.prototype,{za:function(){var n=this;if(this.Va)return this.Va;var t,e,i=this.Hp.getExtendMesh();return i&&(this.Ja=new Sr(this.Zp(this.Up)),this.qa?(e=i.userData,i.userData={},t=i.clone(),i.userData=e,t.name="heatMap",t.scale.z=.001,t.position.y+=this.Jt,(e=new Co(16777215)).opacity=1,e.transparent=!0,e.map=this.Ja,e.map.needsUpdate=!0,e.depthTest=!1,e.needsUpdate=!0,t.material=e,this.jn=t,(this.jn.mapNode=this).Va=!0):(this.Va=!0,this.Hp.getModelMeshs().forEach(function(t){t||(n.Va=!1)}))),this.Vn(tb).enableUpdateRender(),this.Va},Lf:function(){this.jn.position.y=this.Jt,this.Vn(tb).enableUpdateRender()},zp:function(t,n,e){e={x:(t-e.min.x)/(e.max.x-e.min.x),y:(e.max.y-n)/(e.max.y-e.min.y)};return e.x=e.x*this.Fp.width,e.y=e.y*this.Fp.height,e},Jp:function(t,n,e){this.lv.push([t,n,e])},Vp:function(){this.Gp.clearRect(0,0,this.Fp.width,this.Fp.height)},Xp:function(){for(var t=this.Gp.getImageData(0,0,this.Fp.width,this.Fp.height),n=t.data,e=this.Qp(),i=3;i<n.length;i+=4){var r=n[i],o=4*r;o&&(o=Math.floor(o),(r=this.Eu<r?this.Eu:r)<.8&&(r=.8),n[i-3]=e[o],n[i-2]=e[o+1],n[i-1]=e[o+2],n[i]=r)}this.Gp.putImageData(t,0,0)},Qp:function(){var t=document.createElement("canvas"),n=t.getContext("2d");t.width=1,t.height=256;var e,i=n.createLinearGradient(0,0,1,256);for(e in this.Dp)i.addColorStop(e,this.Dp[e]);return n.fillStyle=i,n.fillRect(0,0,1,256),n.getImageData(0,0,1,256).data},Wp:function(t,n,e,i){var r=this.Gp,o=parseFloat(e/(this.jp.max-this.jp.min),10);r.save(),r.shadowColor="rgba(0, 0, 0, "+o+")",r.shadowOffsetX=this.Np,r.shadowOffsetY=this.Np,r.shadowBlur=this.Ip,r.beginPath(),r.arc(t-this.Np,n-this.Np,this.Tv,0,2*Math.PI,!0),r.closePath(),r.fill(),r.restore(),i||this.Jp(t,n,e)},$p:function(){var t,n=[];return void 0!==window.screen.deviceXDPI?(n[0]=window.screen.deviceXDPI,n[1]=window.screen.deviceYDPI):((t=document.createElement("DIV")).style.cssText="width:1in;height:1in;position:absolute;left:0px;top:0px;z-index:99;visibility:hidden",document.body.appendChild(t),n[0]=parseInt(t.offsetWidth),n[1]=parseInt(t.offsetHeight),t.parentNode.removeChild(t)),n},Yp:function(t){var n=t.max.x-t.min.x,t=t.max.y-t.min.y,n={width:Math.round(n),height:Math.round(t)},t=this.$p();n.width=parseInt(n.width*t[0]/25.4),n.height=parseInt(n.height*t[1]/25.4);t=1;return(n.width>=this.Pp||n.height>=this.Pp)&&(n.width>=n.height?(t=n.height/n.width,n.width=this.Pp,n.height=parseInt(this.Pp*t)):(t=n.width/n.height,n.height=this.Pp,n.width=parseInt(this.Pp*t))),n},Zp:function(t){var n=Mt.floorPowerOfTwo(t.width),e=Mt.floorPowerOfTwo(t.height);return void 0===this.ws&&(this.ws=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),this.ws.width=n,this.ws.height=e,this.ws.getContext("2d").drawImage(t,0,0,n,e),this.ws},qp:function(t){this.Vp();for(var n=0;n<this.lv.length;n++)this.Wp(this.lv[n][0],this.lv[n][1],this.lv[n][2],!0);for(var e=0;e<this.Ee.length;e++){var i=this.zp(this.Ee[e].x,this.Ee[e].y,t);if(!i)return!0;this.Wp(i.x,i.y,this.Ee[e].value,!1)}this.Xp()},Kp:function(t){this.Vp();for(var n=0;n<t;n++){var e=Math.floor(Math.random()*this.Fp.width+1),i=Math.floor(Math.random()*this.Fp.height+1),r=Math.floor(Math.random()*(this.jp.max-this.jp.min)+1);this.Wp(e,i,r)}this.Xp()}});_r=Gi;function z_(t){return(z_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function W_(t,n){var e;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(e=function(t,n){if(t){if("string"==typeof t)return X_(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(e="Object"===e&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?X_(t,n):void 0}}(t))||n&&t&&"number"==typeof t.length){e&&(t=e);var i=0,n=function(){};return{s:n,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},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,o=!0,s=!1;return{s:function(){e=t[Symbol.iterator]()},n:function(){var t=e.next();return o=t.done,t},e:function(t){s=!0,r=t},f:function(){try{o||null==e.return||e.return()}finally{if(s)throw r}}}}function X_(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,i=new Array(n);e<n;e++)i[e]=t[e];return i}function Z_(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Y_(t,n,e){return(Y_="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,n,e){t=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=Q_(t)););return t}(t,n);if(t){n=Object.getOwnPropertyDescriptor(t,n);return n.get?n.get.call(e):n.value}})(t,n,e||t)}function q_(t,n){return(q_=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function K_(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Q_(e);return t=i?(t=Q_(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==z_(t)&&"function"!=typeof t?J_(n):t}}function J_(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Q_(t){return(Q_=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}Ri=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&q_(t,n)}(r,sb);var t,n,e,i=K_(r);function r(t){var n;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(n=i.call(this,t)).Un=Ii.DYNAMIC_MODEL_MARKER,n.Yt=void 0!==t.id?t.id:Mt.generateUUID(),n.tm=Mt.generateUUID(),n.nf=void 0!==t.fadeIn&&t.fadeIn,n.lu=void 0!==t.fadeOut&&t.fadeOut,n.Eu=void 0!==t.opacity?t.opacity:null,n.nm=void 0!==t.scale?t.scale:1,n.em=t.tilt,n.gu=t.url,n.zu=t.heading,n.ft=t.callback,n.im=new Map,n.im.set(n.ROOT,t.color),n.Ch=null,n.gc=[],n.Lt=null,n.$c=n.$c.bind(J_(n)),n}return t=r,(n=[{key:"FID",get:function(){return this.tm}},{key:"bound",get:function(){return!0===this.needUpdateBound&&(this.Gn.reset(),void 0!==this.N&&void 0!==this.F&&(this.Gn.expandByCoords([{x:this.N,y:this.F}]),this.needUpdateBound=!1)),this.Gn.clone()}},{key:"color",get:function(){return this.getModelColor()},set:function(t){this.modifyModelColor(t)}},{key:"scale",get:function(){return this.nm},set:function(t){this.nm=t,this.Zi()}},{key:"tilt",get:function(){return this.em}},{key:"heading",get:function(){return this.zu}},{key:"opacity",get:function(){return this.Eu},set:function(t){this.Eu=t,this.Mu()}},{key:"modifyModelColor",value:function(t,n){n=n||this.ROOT,this.im.set(n,t),this.Mu()}},{key:"getModelColor",value:function(t){return t=t||this.ROOT,this.im.get(t)}},{key:"moveTo",value:function(t){var n=this,e=void 0!==t.animate&&t.animate,i=t.duration||.5,r=this.Vn(tb);if(r)return e?(this.Lt||(this.Lt=new Oi),this.Lt.pt([this.N,this.F]),this.Lt.mt([t.x,t.y]),this.Lt.gt(i).bt(function(t){n.N=t.destination[0],n.F=t.destination[1],n.Lf(),r.enableUpdateRender()}).wt(function(){n.N=t.x,n.F=t.y,n.Lf(),r.enableUpdateRender(),t.finish&&t.finish()}),r.pn.mn(this.Lt.dt())):(this.N=t.x,this.F=t.y,this.Lf(),r.enableUpdateRender()),this.Lt}},{key:"stop",value:function(){var t;!this.Lt&&!this.Rp||(t=this.Vn(tb))&&(this.Lt&&(t.pn.vn(this.Lt),this.Lt=null),this.Rp&&(t.pn.vn(this.Rp),this.Rp=null))}},{key:"rotateTo",value:function(t){var n=this,e=this.Vn(tb);if(!e)return!1;var i,r,o=t.heading%360*pi.DEG2RAD;return t.animate?(i=t.duration||.5,r=this.jn.rotation.y,this.Rp||(this.Rp=new Oi),this.Rp.pt([r]).mt([o]).gt(i).bt(function(t){n.jn.rotation.y=t.destination[0],n.zu=t.destination[0]*pi.RAD2DEG,e.enableUpdateRender()}).wt(function(){n.jn.rotation.y=o,n.zu=o*pi.RAD2DEG,e.enableUpdateRender(),t.finish&&t.finish()}),e.pn.mn(this.Rp.dt())):(this.jn.rotation.y=o,this.zu=t.heading,e.enableUpdateRender()),this.Rp}},{key:"startAction",value:function(t,n){t=this.gc[t];t&&(n&&(t.clampWhenFinished=!0,t.loop=2200),t.reset().setEffectiveTimeScale(1).setEffectiveWeight(1).play());t=this.Vn(tb);t&&t.on("beforeRender",this.$c)}},{key:"getAction",value:function(){return this.gc}},{key:"getClip",value:function(t){return this.gc[t].jh}},{key:"getMixer",value:function(){return this.Ch}},{key:"stopAction",value:function(t){var n=this.Vn(tb);n&&n.off("beforeRender",this.$c);t=this.gc[t];t&&t.stop()}},{key:"getActionNames",value:function(){return Object.keys(this.gc)}},{key:"remove",value:function(){this.stop();var e=this.Vn(tb);e&&this.Ch&&e.pn.gf(this.Ch),e&&(t=this.im.get(this.ROOT),this.rm(this.jn,t,function(t,n){e.Zt.xe.js(t,t.material)}));var t=null===(t=this.jn)||void 0===t?void 0:t.parent;t&&t.remove(this.jn),Y_(Q_(r.prototype),"remove",this).call(this)}},{key:"dispose",value:function(){Y_(Q_(r.prototype),"dispose",this).call(this),this.remove(),this.jn&&(this.jn.mapNode=void 0,this.jn=void 0),this.Va=!1,this.om()}},{key:"getRenderNode",value:function(){return this.jn}}])&&Z_(t.prototype,n),e&&Z_(t,e),r}();Object.assign(Ri.prototype,{ROOT:"root",za:function(){var r=this;if(!this.Va){var o=this.Vn(tb);return o?(this.Va=!0,o.Zt.tl.Io(this.gu,function(t){if(r.Va){if(r.jn=t.scene,r.zu&&(r.jn.rotation.y=r.zu%360*pi.DEG2RAD),r.em&&(r.jn.rotation.x=r.em%360*pi.DEG2RAD),r.Zi(),(r.jn.mapNode=r).tt.Fi.add(r.jn),0<t.animations.length){r.Ch=new um(r.jn);var n,e=W_(t.animations);try{for(e.s();!(n=e.n()).done;){var i=n.value;r.gc[i.name]=r.Ch.clipAction(i)}}catch(t){e.e(t)}finally{e.f()}o.pn.df(r.Ch)}r.Mu(),r.Lf(),r.nf&&r.sf(),o.enableUpdateRender(),r.ft&&r.ft(r)}},function(){}),!0):!1}},sf:function(){var t,n=this,i=this.Vn(tb);i&&((t=new Oi({src:[0],dest:[1]})).gt(1).bt(function(t){var e=t.destination[0];n.jn.traverse(function(t){var n;t instanceof Ko&&(t.material.transparent=!0,n=t.material.userData.sourceOpacity,i.getMapOptions().materialMode===nr.REAL?t.material.uniforms.opacity.value=n*e:t.material.opacity=n*e,i.enableUpdateRender())})}).wt(function(){i.pn.vn(t),i.enableUpdateNode()}).dt(),i.pn.mn(t))},Zi:function(){if(this.jn){var t=this.Vn(tb);if(!t)return!1;this.jn.scale.copy(this.jn.userData.sourceScale).multiplyScalar(this.nm),t.enableUpdateRender()}},Lf:function(){if(this.jn){var t=this.Vn(tb);if(!t)return!1;this.jn.position.set(this.N-t.x,this.Jt,-this.F+t.y),this.needUpdateBound=!0,t.enableUpdateRender()}},Mu:function(){var r,o,t,s=this;this.jn&&(r=this.Vn(tb),o=this.Vn(ug),t=this.im.get(this.ROOT),this.rm(this.jn,t,function(t,n){var e=s.we(t.material,o,{color:n});if(r.Pt.materialMode===nr.REAL){n=r.Zt.xe._e(e);n.userData=t.material.userData,t.material=n,r.Zt.xe.Cs(t,n)}else if(Array.isArray(t.material.length))for(var i=0;i<t.material.length;i++)t.material[i].depthWrite=!0,t.material[i]=r.Zt.xe.Me(t.material[i],e);else t.material.depthWrite=!0,t.material=r.Zt.xe.Me(t.material,e)}),r.enableUpdateRender())},rm:function(t,n,e){var i=this.im.get(t.name);if(i&&(n=i),"Mesh"===t.type||"SkinnedMesh"===t.type)e(t,n);else for(var r=0;r<t.children.length;r++)this.rm(t.children[r],n,e)},we:function(t,n,e){var i={};return this.Vn(tb).Pt.materialMode===nr.REAL?t.constructor===yf?(t.userData.sourceOpacity=t.opacity,t.userData.sourceTransparent=t.transparent,i={USE_EMISSIVEMAP:!!t.emissiveMap,USE_MAP:!!t.map,map:t.map,emissive:t.emissive.getHex(),color:t.color.getHex(),emissiveMap:t.emissiveMap,metalness:t.metalness,roughness:t.roughness,normalScale:t.normalScale,vertexColors:t.vertexColors,side:t.side,skinning:t.skinning}):t.constructor===rf&&(i={USE_EMISSIVEMAP:t.defines.USE_EMISSIVEMAP,USE_MAP:t.defines.USE_MAP,map:t.uniforms.map.value,color:t.uniforms.diffuse.value.getHex(),emissive:t.uniforms.emissive.value.getHex(),emissiveMap:t.uniforms.emissiveMap.value,metalness:t.uniforms.metalness.value,roughness:t.uniforms.roughness.value,normalScale:t.uniforms.normalScale.value,vertexColors:t.vertexColors,side:t.side,skinning:t.skinning}):(void 0===t.userData.sourceOpacity&&(t.userData.sourceOpacity=t.opacity),void 0===t.userData.sourceTransparent&&(t.userData.sourceTransparent=t.transparent)),e.color&&(i.color=e.color),i.opacity=null!==this.Eu?this.Eu*n.Eu:void 0!==t.userData.sourceOpacity?t.userData.sourceOpacity*n.Eu:t.opacity*n.Eu,i.transparent=t.userData.sourceTransparent||i.opacity<1,i},$c:function(){var t=this.Vn(tb);t&&t.enableUpdateRender()},sm:function(t){if(t.am&&(t.am.length=0),t.Ih){for(var n=0;n<t.Ih.length;n++)t.Ih[n].parameterPositions=null,t.Ih[n].resultBuffer=null,t.Ih[n].sampleValues=null,t.Ih[n]=null;t.Ih=null}if(t.Nh){for(var e=0;e<t.Nh.length;e++)t.Nh[e].binding=null,t.Nh[e].buffer=null,t.Nh[e]=null;t.Nh=null}if(t.jh&&t.jh.tracks&&t.jh.tracks){for(var i=0;i<t.jh.tracks.length;i++)t.jh.tracks[i].times=null,t.jh.tracks[i].values=null,t.jh.tracks[i]=null;t.jh.tracks=null,t.jh=null}},om:function(){var t,n=this;for(t in this.gc.forEach(function(t){n.sm(t),n.gc[i]=null}),this.gc)this.sm(this.gc[t]),this.gc[t]=null;if(this.gc=[],this.Ch){for(var e=0;e<this.Ch.Ra.length;e++)this.Ch.Ra[e].buffer=null;this.Ch.Ra=null,this.Ch.hc=null,this.Ch.fr=null,this.Ch.stats=null,this.Ch.fc=null,this.Ch.gc=null,this.Ch=null}}});e=Ri;function $_(t){return($_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function tx(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function nx(t,n){return(nx=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function ex(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=rx(e);return t=i?(t=rx(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==$_(t)&&"function"!=typeof t?ix(n):t}}function ix(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function rx(t){return(rx=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}Gi=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&nx(t,n)}(r,sb);var t,n,e,i=ex(r);function r(t){var n;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(n=i.call(this,t)).Yt=null,n.Un=Ii.DOM_MARKER,n.um=void 0!==t.fontsize?t.fontsize:16,n.hm=t.content,n.cm=void 0!==t.domWidth?t.domWidth:30,n.fm=void 0!==t.domHeight?t.domHeight:30,n.lm=void 0!==t.anchor?t.anchor:ki.CENTER,n.Eu=void 0!==t.opacity?t.opacity:1,n.Qi=void 0!==t.collision&&t.collision,n.Cd=!1,n.jn=null,n.Va=!1,n.$n=null,n.Ad=null,n.Hp=null,n.Lt=null,n.dm=null,n.vm=n.vm.bind(ix(n)),n.Qa=null,n.za(),n}return t=r,(n=[{key:"bound",get:function(){return!0===this.needUpdateBound&&(this.Gn.reset(),void 0!==this.N&&void 0!==this.F&&(this.Gn.expandByCoords([{x:this.N,y:this.F}]),this.needUpdateBound=!1)),this.Gn.clone()}},{key:"content",get:function(){return this.hm},set:function(t){this.hm=t;this.pm();this.jn.element.childNodes[0].innerHTML=""+this.hm}},{key:"visible",get:function(){return this.Bn},set:function(t){this.Bn=t,this.jn&&(this.Bn?this.jn.element.childNodes[0].style.display="block":this.jn.element.childNodes[0].style.display="none")}},{key:"opacity",get:function(){return this.Eu},set:function(t){this.Eu=t,this.jn.element.childNodes[0].style.opacity=this.Eu}},{key:"level",get:function(){return this.$n}},{key:"moveTo",value:function(t){var n=this,e=void 0!==t.animate&&t.animate,i=t.duration||.5;if(e){e=this.tt.tt;if(e)return this.Lt||(this.Lt=new Oi),this.Lt.pt([this.N,this.F]),this.Lt.mt([t.x,t.y]),this.Lt.gt(i).bt(function(t){n.N=t.destination[0],n.F=t.destination[1],n.Lf()}).wt(function(){n.N=t.x,n.F=t.y,n.Lf(),t.finish&&t.finish()}),e.pn.mn(this.Lt.dt()),this.Lt}else this.N=t.x,this.F=t.y,this.Lf()}},{key:"stop",value:function(){var t=this.tt.tt;t&&this.Lt&&(t.pn.vn(this.Lt),this.Lt=null)}},{key:"remove",value:function(){this.stop(),this.Qa.remove(this),this.tt&&this.tt.remove(this),this.jn.parent.remove(this.jn),this.tt=void 0}},{key:"addTo",value:function(t){var n=t.tt.tt;null===n.If.Ld&&n.If.za(),this.$n=t.level,this.Hp=t,this.Ad=t.parent.buildingID,this.jn.position.set(this.N-n.x,t.height+this.Jt,-this.F+n.y);var e=n.getBuilding(""+t.parent.buildingID);t.level!==e.level&&(n.If.Jc(this.$n,""+t.parent.buildingID)?this.jn.element.childNodes[0].style.opacity=t.Eu:this.jn.element.childNodes[0].style.display="none"),n.If.add(this),this.Qa=t.getOrCreateLayer(this.Un),this.Qa.add(this)}},{key:"dispose",value:function(){this.remove(),this.jn&&(this.jn.mapNode=void 0,this.jn=void 0),this.Va=!1}}])&&tx(t.prototype,n),e&&tx(t,e),r}();Object.assign(Gi.prototype,{za:function(){var t=document.createElement("div"),n=this.pm();t.innerHTML='<div style="position:absolute;pointer-events:all;width:'+this.cm+"px;height:"+this.fm+"px;font-size:"+this.um+"px;opacity:"+this.Eu+";top:"+n.top+";left:"+n.left+'">'+this.hm+"</div>";t=new Uy(t);return this.jn=t,(this.jn.mapNode=this).Va=!0,this.Yt=this.jn.uuid,!0},Lf:function(){var t=this.tt.tt;this.jn.position.set(this.N-t.x,this.Hp.height+this.Jt,-this.F+t.y),this.needUpdateBound=!0},pm:function(){var t,n;switch(this.lm){case ki.CENTER:t=-this.cm/2,n=-this.fm/2;break;case ki.RIGHT_BOTTOM:t=-this.cm,n=-this.fm;break;case ki.LEFT_BOTTOM:t=0,n=-this.fm;break;case ki.RIGHT_TOP:t=-this.cm,n=0;break;case ki.LEFT_TOP:n=t=0;break;case ki.RIGHT:t=-this.cm,n=-this.fm/2;break;case ki.LEFT:t=0,n=-this.fm/2;break;case ki.BOTTOM:t=-this.cm/2,n=-this.fm;break;case ki.TOP:t=-this.cm/2,n=0}return this.dm={left:t,top:n},{left:t+"px",top:n+"px"}},kd:function(){var t=this.tt.tt;if(!this.dm)return null;var n=t.camera;this.jn.updateMatrixWorld(!0);var e=(new St).setFromMatrixPosition(this.jn.matrixWorld).applyMatrix4(n.matrixWorldInverse).applyMatrix4(n.projectionMatrix),i=t.cn.renderer.domElement.clientWidth,n=t.cn.renderer.domElement.clientHeight,t=e.x,e=e.y;return{leftTop:new fi(t-this.cm/i,e+this.fm/n),rightDown:new fi(t+this.cm/i,e-this.fm/n)}},vm:function(t){var n,e=this.tt.tt,i={};for(n in t)i[n]=t[n];i.offsetX=t.clientX,i.offsetY=t.clientY,e.ue.ft(i)},Mu:function(){this.jn.element.childNodes[0].style.opacity=this.Hp.Eu}});Ri=Gi;function ox(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}Gi=function(){function n(t){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,n),this.mm=t.origon,this.iu=t.target,this.gm=null,this.ym=null,this.bm=null,this.wm=null,this._m=null,this.xm=null,this.Mm=null,this.Sm=null,this.za()}var t,e,i;return t=n,(e=[{key:"transform",value:function(t){var n=t.x-this.gm.x,e=t.y-this.gm.y,t=this.ym.x*n+this.ym.y*e,e=this.bm.x*n+this.bm.y*e,t=t/this.wm.x,e=e/this.wm.y,t=t*this.Sm.x,e=e*this.Sm.y;return{x:this._m.x+this.xm.x*t+this.Mm.x*e,y:this._m.y+this.xm.y*t+this.Mm.y*e}}}])&&ox(t.prototype,e),i&&ox(t,i),n}();Object.assign(Gi.prototype,{za:function(){!Array.isArray(this.mm)||!Array.isArray(this.iu)||this.mm.length<3||this.iu.length<3||(this.gm=this.mm[0],this.ym={x:this.mm[1].x-this.mm[0].x,y:this.mm[1].y-this.mm[0].y},this.bm={x:this.mm[2].x-this.mm[0].x,y:this.mm[2].y-this.mm[0].y},this.wm={x:Lu.yi(this.ym),y:Lu.yi(this.bm)},this._m=this.iu[0],this.xm={x:this.iu[1].x-this.iu[0].x,y:this.iu[1].y-this.iu[0].y},this.Mm={x:this.iu[2].x-this.iu[0].x,y:this.iu[2].y-this.iu[0].y},this.Sm={x:Lu.yi(this.xm),y:Lu.yi(this.Mm)},this.ym.x/=this.wm.x,this.ym.y/=this.wm.x,this.bm.x/=this.wm.y,this.bm.y/=this.wm.y,this.xm.x/=this.Sm.x,this.xm.y/=this.Sm.x,this.Mm.x/=this.Sm.y,this.Mm.y/=this.Sm.y)}});var sx,ax={VERSION:a,BUILD:h,FMMap:tb,FMType:Ii,FMViewMode:gi,FMShadingMode:nr,FMInfoMode:Ni,FMTextAlign:Cc,FMLineType:Yw,FMLabelField:lp,FMMarkerAnchor:ki,FMEdgeMode:M_,FMOverviewMode:dp,FMEnterTriggerMode:Xy,FMUtil:wy,FMCalculator:yv,FMCoordsTransformer:Gi,FMImageMarker:Ru,FMWallMarker:Ai,FMTubeMarker:ir,FMLine3dMarker:sr,FMSphereMarker:ch,FMTextMarker:vi,FMPolygonMarker:mi,FMLocationMarker:tr,FMHeatMap:_r,FMDynamicModel:e,FMLineMarker:r_,FMDomMarker:Ri,FMExtrudeMarker:yh,FMSegment:Zw,FMMarkerLayer:cd,FMBound:rr,FMMarkerFun:Qm},yh=rh.a.global(),ux=void 0!==yh?yh.fengmap:{};for(sx in null==ux&&(ux={}),ax)ux[sx]=ax[sx];void 0!==yh&&(yh.fengmap=ux);n.default=ux}],f={},g.m=d,g.c=f,g.d=function(t,n,e){g.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:e})},g.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"Em",{value:!0})},g.t=function(n,t){if(1&t&&(n=g(n)),8&t)return n;if(4&t&&"object"==typeof n&&n&&n.Em)return n;var e=Object.create(null);if(g.r(e),Object.defineProperty(e,"default",{enumerable:!0,value:n}),2&t&&"string"!=typeof n)for(var i in n)g.d(e,i,function(t){return n[t]}.bind(null,i));return e},g.n=function(t){var n=t&&t.Em?function(){return t.default}:function(){return t};return g.d(n,"a",n),n},g.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},g.p="",g(g.s=43).default;function g(t){if(f[t])return f[t].exports;var n=f[t]={i:t,l:!1,exports:{}};return d[t].call(n.exports,n,n.exports,g),n.l=!0,n.exports}var d,f});