fengmap.map-nologo.min.js 1.4 MB
/**Released Version v3.1.5,BUILD 108,Time 1712806753510. Fengmap Javascript SDK nologo, 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 function(e){var i={};function r(t){var n;return(i[t]||(n=i[t]={i:t,l:!1,exports:{}},e[t].call(n.exports,n,n.exports,r),n.l=!0,n)).exports}return r.m=e,r.c=i,r.d=function(t,n,e){r.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:e})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"u",{value:!0})},r.t=function(n,t){if(1&t&&(n=r(n)),8&t)return n;if(4&t&&"object"==typeof n&&n&&n.u)return n;var e=Object.create(null);if(r.r(e),Object.defineProperty(e,"default",{enumerable:!0,value:n}),2&t&&"string"!=typeof n)for(var i in n)r.d(e,i,function(t){return n[t]}.bind(null,i));return e},r.n=function(t){var n=t&&t.u?function(){return t.default}:function(){return t};return r.d(n,"a",n),n},r.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},r.p="",r(r.s=48)}([function(t,n,e){"use strict";e.d(n,"a",function(){return i});var n=e(1),i={document:"undefined"!=typeof document?document:{},window:"undefined"!=typeof window?window:{},environment:n.a.BROWSER,XMLHttpRequest:"undefined"!=typeof XMLHttpRequest?XMLHttpRequest:{}}},function(t,n,e){"use strict";var i={BROWSER:0,WX:1};Object.freeze(i),n.a=i},function(t,n,e){"use strict";var i,r,o=t.exports=e(4),s=e(19),a=(o.codegen=e(45),o.fetch=e(46),o.path=e(47),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},/\\/g),u=/"/g,c=(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)},/_([a-z])/g),h=(o.camelCase=function(t){return t.substring(0,1)+t.substring(1).replace(c,function(t,n){return n.toUpperCase()})},o.compareFieldsById=function(t,n){return t.id-n.id},o.decorateType=function(t,n){return t.$type?(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(21))(n||t.name),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)},0);o.decorateEnum=function(t){var n;return t.$type||(n=new(r=r||e(5))("Enum"+h++,t),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)return function t(n,e,i){var r=e.shift();return"__proto__"!==r&&"prototype"!==r&&(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);throw TypeError("path must be specified")},Object.defineProperty(o,"decorateRoot",{get:function(){return s.decorated||(s.decorated=new(e(29)))}})},function(t,n,e){"use strict";!function(s){var a=e(1),u=e(0);function r(t){return(r="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,function(t){t=function(t,n){if("object"!=r(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=r(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==r(t)?t:t+""}(i.key),i)}}var h=null,t=function(){function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function")}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;var t;if("undefined"!=typeof my)return h||(t=my.getAppIdSync(),h={location:{host:t.appId+".hybrid.alipay-eco.com"}}),h;if(u.a.environment==a.a.WX)return{};throw new Error("unable to locate global object")},o.toString=function(){return r.toString()},o)}],e&&c(n.prototype,e),i&&c(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,e,i,r;function o(){return r.apply(this,arguments)}}();n.a=t}.call(this,e(15))},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(16),i.base64=o(36),i.EventEmitter=o(37),i.float=o(38),i.inquire=o(17),i.utf8=o(39),i.pool=o(40),i.LongBits=o(41),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._=null,i.S=null,i.newBuffer=function(t){return"number"==typeof t?i.Buffer?i.S(t):new i.Array(t):i.Buffer?i._(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.T=function(){var e=i.Buffer;e?(i._=e.from!==Uint8Array.from&&e.from||function(t,n){return new e(t,n)},i.S=e.allocUnsafe||function(t){return new e(t)}):i._=i.S=null}}.call(this,o(15))},function(t,n,e){"use strict";t.exports=o;var a=e(6),i=(((o.prototype=Object.create(a.prototype)).constructor=o).className="Enum",e(8)),r=e(2);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(2);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.A(this)},r.prototype.onRemove=function(t){t=t.root;t instanceof i&&t.M(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?(i=o.find(function(t){return Object.prototype.hasOwnProperty.call(t,n)}))?(r=i[n],s.setProperty(r,e,t)):((i={})[n]=s.setProperty({},e,t),o.push(i)):((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.T=function(t){i=t}},function(t,n,e){"use strict";t.exports=s;var i,a=e(6),r=(((s.prototype=Object.create(a.prototype)).constructor=s).className="Field",e(5)),u=e(9),c=e(2),h=/^required|optional|repeated$/;function s(t,n,e,i,r,o,s){if(c.isObject(i)?(s=r,o=i,i=r=void 0):c.isObject(r)&&(s=o,o=r,r=void 0),a.call(this,t,o),!c.isInteger(n)||n<0)throw TypeError("id must be a non-negative integer");if(!c.isString(e))throw TypeError("type must be a string");if(void 0!==i&&!h.test(i=i.toString().toLowerCase()))throw TypeError("rule must be a string rule");if(void 0!==r&&!c.isString(r))throw TypeError("extend must be a string");this.rule=(i="proto3_optional"===i?"optional":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=!!c.Long&&void 0!==u.long[e],this.bytes="bytes"===e,this.resolvedType=null,this.extensionField=null,this.declaringField=null,this.O=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.O&&(this.O=!1!==this.getOption("packed")),this.O}}),s.prototype.setOption=function(t,n,e){return"packed"===t&&(this.O=null),a.prototype.setOption.call(this,t,n,e)},s.prototype.toJSON=function(t){t=!!t&&Boolean(t.keepComments);return c.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(){var t;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=c.Long.fromNumber(this.typeDefault,"u"===this.type.charAt(0)),Object.freeze&&Object.freeze(this.typeDefault)):this.bytes&&"string"==typeof this.typeDefault&&(c.base64.test(this.typeDefault)?c.base64.decode(this.typeDefault,t=c.newBuffer(c.base64.length(this.typeDefault)),0):c.utf8.write(this.typeDefault,t=c.newBuffer(c.utf8.length(this.typeDefault)),0),this.typeDefault=t),this.map?this.defaultValue=c.emptyObject:this.repeated?this.defaultValue=c.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof i&&(this.parent.ctor.prototype[this.name]=this.defaultValue),a.prototype.resolve.call(this))},s.d=function(e,i,r,o){return"function"==typeof i?i=c.decorateType(i).name:i&&"object"==typeof i&&(i=c.decorateEnum(i).name),function(t,n){c.decorateType(t.constructor).add(new s(n,e,i,r,{default:o}))}},s.T=function(t){i=t}},function(t,n,e){"use strict";t.exports=f;var r,o,s,i=e(6),a=(((f.prototype=Object.create(i.prototype)).constructor=f).className="Namespace",e(7)),u=e(10),c=e(2);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 f(t,n){i.call(this,t,n),this.nested=void 0,this.L=null}function l(t){return t.L=null,t}f.fromJSON=function(t,n){return new f(t,n.options).addJSON(n.nested)},f.arrayToJSON=h,f.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},f.isReservedName=function(t,n){if(t)for(var e=0;e<t.length;++e)if(t[e]===n)return!0;return!1},Object.defineProperty(f.prototype,"nestedArray",{get:function(){return this.L||(this.L=c.toArray(this.nested))}}),f.prototype.toJSON=function(t){return c.toObject(["options",this.options,"nested",h(this.nestedArray,t)])},f.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:f).fromJSON(e[i],n));return this},f.prototype.get=function(t){return this.nested&&this.nested[t]||null},f.prototype.getEnum=function(t){if(this.nested&&this.nested[t]instanceof s)return this.nested[t].values;throw Error("no such enum: "+t)},f.prototype.add=function(t){if(!(t instanceof a&&void 0!==t.extend||t instanceof r||t instanceof s||t instanceof o||t instanceof f||t instanceof u))throw TypeError("object must be a valid nested object");if(this.nested){var n=this.get(t.name);if(n){if(!(n instanceof f&&t instanceof f)||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),l(this)},f.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),l(this)},f.prototype.define=function(t,n){if(c.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 f))throw Error("path conflicts with non-namespace objects")}else e.add(e=new f(i))}return n&&e.addJSON(n),e},f.prototype.resolveAll=function(){for(var t=this.nestedArray,n=0;n<t.length;)t[n]instanceof f?t[n++].resolveAll():t[n++].resolve();return this.resolve()},f.prototype.lookup=function(t,n,e){if("boolean"==typeof n?(e=n,n=void 0):n&&!Array.isArray(n)&&(n=[n]),c.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 f&&(i=i.lookup(t.slice(1),n,!0)))return i}else for(var r=0;r<this.nestedArray.length;++r)if(this.L[r]instanceof f&&(i=this.L[r].lookup(t,n,!0)))return i;return null===this.parent||e?null:this.parent.lookup(t,n)},f.prototype.lookupType=function(t){var n=this.lookup(t,[r]);if(n)return n;throw Error("no such type: "+t)},f.prototype.lookupEnum=function(t){var n=this.lookup(t,[s]);if(n)return n;throw Error("no such Enum '"+t+"' in "+this)},f.prototype.lookupTypeOrEnum=function(t){var n=this.lookup(t,[r,s]);if(n)return n;throw Error("no such Type or Enum '"+t+"' in "+this)},f.prototype.lookupService=function(t){var n=this.lookup(t,[o]);if(n)return n;throw Error("no such Service '"+t+"' in "+this)},f.T=function(t,n,e){r=t,o=n,s=e}},function(t,n,e){"use strict";var e=e(2),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=s;var r=e(6),i=(((s.prototype=Object.create(r.prototype)).constructor=s).className="OneOf",e(7)),o=e(2);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)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;throw TypeError("field must be a Field")},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){var i;void 0!==(n="function"==typeof(i=function(){var h=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 c=[];var h=function t(){c=[];u=e+1;for(var n=0;n<s;n++)c[n]=[n];c[s]=[];c[a]=null};var f;var l;while(true){l=f;f=n(u);if(f===s){h();continue}if(f===a)break;if(f<c.length){if(l!==s)c.push(c[l].concat(c[f][0]))}else{if(f!==c.length)throw new Error("Invalid LZW code.");c.push(c[l].concat(c[l][0]))}i.push.apply(i,c[f]);if(c.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 c=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=h(e.splice(0,3));n.sorted=e.shift();n.gctSize=h(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=h(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=c();u.com&&u.com(n)};var r=function t(n){var e=a.readByte();n.ptHeader=a.readBytes(12);n.ptData=c();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=c();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=c();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 c=0;c<4;c++)for(var h=i[c];h<n;h+=a[c]){e(h,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=h(i.splice(0,3));if(n.lctFlag)n.lct=o(1<<n.lctSize+1);n.lzwMinCodeSize=a.readByte();var r=c();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 C(t){var d={vp_l:0,vp_t:0,vp_w:null,vp_h:null,c_w:null,c_h:null};for(var n in t)d[n]=t[n];if(d.vp_w&&d.vp_h)d.is_vp=true;var r;var o;var h=null;var e=false;var s=null;var i=null;var a=null;var u=null;var c=null;var f=null;var l=null;var v=true;var D=true;var p=false;var m=[];var y=[];var b=d.gif;if(typeof d.auto_play=="undefined")d.auto_play=!b.getAttribute("rel:auto_play")||b.getAttribute("rel:auto_play")=="1";var g=d.hasOwnProperty("on_end")?d.on_end:null;var k=d.hasOwnProperty("loop_delay")?d.loop_delay:0;var U=d.hasOwnProperty("loop_mode")?d.loop_mode:"auto";var _=d.hasOwnProperty("draw_while_loading")?d.draw_while_loading:true;var B=_?d.hasOwnProperty("show_progress_bar")?d.show_progress_bar:true:false;var G=d.hasOwnProperty("progressbar_height")?d.progressbar_height:25;var H=d.hasOwnProperty("progressbar_background_color")?d.progressbar_background_color:"rgba(255,255,255,0.4)";var X=d.hasOwnProperty("progressbar_foreground_color")?d.progressbar_foreground_color:"rgba(255,0,22,.8)";var w=function t(){s=null;i=null;c=a;a=null;f=null};var x=function t(){try{et(r,K)}catch(t){T("parse")}};var V=function t(n){P.innerHTML=n;P.style.visibility="visible"};var E=function t(n,e){R.width=n*L();R.height=e*L();P.style.minWidth=n*L()+"px";F.width=n;F.height=e;F.style.width=n+"px";F.style.height=e+"px";F.getContext("2d").setTransform(1,0,0,1,0,0)};var z=function t(n,e){if(!y[n]){y[n]=e;return}if(typeof e.x!=="undefined")y[n].x=e.x;if(typeof e.y!=="undefined")y[n].y=e.y};var S=function t(n,e,i){if(i&&B){var r=G;var o,s,a,u;if(d.is_vp){if(!p){a=d.vp_t+d.vp_h-r;r=r;o=d.vp_l;s=o+n/e*d.vp_w;u=R.width}else{a=(d.vp_t+d.vp_h-r)/L();r=r/L();o=d.vp_l/L();s=o+n/e*(d.vp_w/L());u=R.width/L()}if(false)var c,h,f,l}else{a=(R.height-r)/(p?L():1);s=n/e*R.width/(p?L():1);u=R.width/(p?L():1);r/=p?L():1}N.fillStyle=H;N.fillRect(s,a,u-s,r);N.fillStyle=X;N.fillRect(0,a,s,r)}};var T=function t(n){var e=function t(){N.fillStyle="black";N.fillRect(0,0,d.c_w?d.c_w:o.width,d.c_h?d.c_h:o.height);N.strokeStyle="red";N.lineWidth=3;N.moveTo(0,0);N.lineTo(d.c_w?d.c_w:o.width,d.c_h?d.c_h:o.height);N.moveTo(0,d.c_h?d.c_h:o.height);N.lineTo(d.c_w?d.c_w:o.width,0);N.stroke()};h=n;o={width:b.width,height:b.height};m=[];e()};var W=function t(n){o=n;E(o.width,o.height)};var Y=function t(n){A();w();s=n.transparencyGiven?n.transparencyIndex:null;i=n.delayTime;a=n.disposalMethod};var A=function t(){if(!f)return;m.push({data:f.getImageData(0,0,o.width,o.height),delay:i});y.push({x:0,y:0})};var Q=function t(n){if(!f)f=F.getContext("2d");var e=m.length;var i=n.lctFlag?n.lct:o.gct;if(e>0){if(c===3)if(u!==null)f.putImageData(m[u].data,0,0);else f.clearRect(l.leftPos,l.topPos,l.width,l.height);else u=e-1;if(c===2)f.clearRect(l.leftPos,l.topPos,l.width,l.height)}var r=f.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}});f.putImageData(r,n.leftPos,n.topPos);if(!p){N.scale(L(),L());p=true}if(_){N.drawImage(F,0,0);_=d.auto_play}l=n};var M=function(){var o=-1;var e=0;var t=false;var n=false;var s=function t(){var n=D?1:-1;return(o+n+m.length)%m.length};var a=function t(n){o=o+n;r()};var i=function(){var i=false;var r=function t(){if(g!==null)g(b);e++;if(U!==false||e<0)n();else{i=false;v=false}};var n=function t(){i=v;if(!i)return;a(1);var n=m[o].delay*10;if(!n)n=100;var e=s();if(e===0){n+=k;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>m.length-1)o=0;if(o<0)o=0;n=y[o];F.getContext("2d").putImageData(m[o].data,n.x,n.y);N.globalCompositeOperation="copy";N.drawImage(F,0,0)};var u=function t(){v=true;i()};var c=function t(){v=false};return{init:function t(){if(h)return;if(!(d.c_w&&d.c_h))N.scale(L(),L());if(d.auto_play)i();else{o=0;r()}},step:i,play:u,pause:c,playing:v,move_relative:a,current_frame:function t(){return o},length:function t(){return m.length},move_to:function t(n){o=n;r()}}}();var Z=function t(n){S(r.pos,r.data.length,n)};var q=function t(){};var O=function t(n,e){return function(t){n(t);Z(e)}};var K={hdr:O(W),gce:O(Y),com:O(q),app:{NETSCAPE:O(q)},img:O(Q,true),eof:function t(n){A();Z(false);if(!(d.c_w&&d.c_h)){R.width=o.width*L();R.height=o.height*L()}M.init();e=false;if(I)I(b)}};var J=function t(){var n=b.parentNode;var e=document.createElement("div");R=document.createElement("canvas");N=R.getContext("2d");P=document.createElement("div");F=document.createElement("canvas");e.width=R.width=b.width;e.height=R.height=b.height;P.style.minWidth=b.width+"px";e.className="jsgif";P.className="jsgif_toolbar";e.appendChild(R);e.appendChild(P);n.insertBefore(e,b);n.removeChild(b);if(d.c_w&&d.c_h)E(d.c_w,d.c_h);j=true};var L=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 R,N,P,F;var j=false;var I=false;var $=function t(n){if(e)return false;if(n)I=n;else I=false;e=true;m=[];w();u=null;c=null;f=null;l=null;return true};var tt=function t(){return m.reduce(function(t,n){return t+n.delay},0)};return{play:M.play,pause:M.pause,move_relative:M.move_relative,move_to:M.move_to,get_playing:function t(){return v},get_canvas:function t(){return R},get_canvas_scale:function t(){return L()},get_loading:function t(){return e},get_auto_play:function t(){return d.auto_play},get_length:function t(){return M.length()},get_frames:function t(){return m},get_duration:function t(){return tt()},get_duration_ms:function t(){return tt()*10},get_current_frame:function t(){return M.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)J()};i.onload=function(t){if(this.status!=200)T("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(x,0)};i.onprogress=function(t){if(t.lengthComputable)S(t.loaded,t.total,true)};i.onerror=function(){T("xhr")};i.send()},load:function t(n){this.load_url(b.getAttribute("rel:animated_src")||b.src,n)},load_raw:function t(n,e){if(!$(e))return;if(!j)J();r=new nt(n);setTimeout(x,0)},set_frame_offset:z}}})?i.apply(n,[]):i)&&(t.exports=n)},function(t,n,e){"use strict";t.exports=f;var i,r=e(4),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 c(){}function h(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(c,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.R=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.R(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.R(p,t.length(),t)},f.prototype.sint64=function(t){t=o.from(t).zzEncode();return this.R(p,t.length(),t)},f.prototype.bool=function(t){return this.R(d,1,t?1:0)},f.prototype.sfixed32=f.prototype.fixed32=function(t){return this.R(m,4,t>>>0)},f.prototype.sfixed64=f.prototype.fixed64=function(t){t=o.from(t);return this.R(m,4,t.lo).R(m,4,t.hi)},f.prototype.float=function(t){return this.R(r.float.writeFloatLE,4,t)},f.prototype.double=function(t){return this.R(r.float.writeDoubleLE,8,t)};var y=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).R(y,e,t)):this.R(d,1,0)},f.prototype.string=function(t){var n=a.length(t);return n?this.uint32(n).R(a.write,n,t):this.R(d,1,0)},f.prototype.fork=function(){return this.states=new h(this),this.head=this.tail=new u(c,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(c,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.T=function(t){i=t,f.create=l(),i.T()}},function(t,n,e){"use strict";t.exports=u;var i,r=e(4),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 c(){return r.Buffer?function(t){return(u.create=function(t){return r.Buffer.isBuffer(t)?new i(t):f(t)})(t)}:f}var h,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=c(),u.prototype.N=r.Array.prototype.subarray||r.Array.prototype.slice,u.prototype.uint32=(h=4294967295,function(){if(h=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128||(h=(h|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)||(h=(h|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)||(h=(h|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)||(h=(h|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)||!((this.pos+=5)>this.len))return h;throw this.pos=this.len,a(this,10)}),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.N.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.T=function(t){i=t,u.create=c(),i.T();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=r;var i=e(4);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(44)},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.P.indexOf(o),a=o.resolvedType instanceof c?"int32":o.type,u=h.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|h.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!==h.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 c=e(5),h=e(9),f=e(2);function l(t,n,e,i){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=g;var s=e(8),a=(((g.prototype=Object.create(s.prototype)).constructor=g).className="Type",e(5)),u=e(10),c=e(7),h=e(22),f=e(23),r=e(14),o=e(13),l=e(12),d=e(2),v=e(20),p=e(25),m=e(26),y=e(27),b=e(28);function g(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.F=null,this.P=null,this.j=null,this.I=null}function i(t){return t.F=t.P=t.j=null,delete t.encode,delete t.decode,delete t.verify,t}Object.defineProperties(g.prototype,{fieldsById:{get:function(){if(!this.F){this.F={};for(var t=Object.keys(this.fields),n=0;n<t.length;++n){var e=this.fields[t[n]],i=e.id;if(this.F[i])throw Error("duplicate id "+i+" in "+this);this.F[i]=e}}return this.F}},fieldsArray:{get:function(){return this.P||(this.P=d.toArray(this.fields))}},oneofsArray:{get:function(){return this.j||(this.j=d.toArray(this.oneofs))}},ctor:{get:function(){return this.I||(this.ctor=g.generateConstructor(this)())},set:function(t){for(var n=t.prototype,e=(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.I=t,0);e<this.fieldsArray.length;++e)this.P[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)}}}),g.generateConstructor=function(t){for(var n,e=d.codegen(["p"],t.name),i=0;i<t.fieldsArray.length;++i)(n=t.P[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]]")},g.fromJSON=function(t,n){for(var e=new g(t,n.options),i=(e.extensions=n.extensions,e.reserved=n.reserved,Object.keys(n.fields)),r=0;r<i.length;++r)e.add((void 0!==n.fields[i[r]].keyType?h:c).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?c:void 0!==o.fields?g: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},g.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])},g.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)},g.prototype.get=function(t){return this.fields[t]||this.oneofs&&this.oneofs[t]||this.nested&&this.nested[t]||null},g.prototype.add=function(t){if(this.get(t.name))throw Error("duplicate name '"+t.name+"' in "+this);if(t instanceof c&&void 0===t.extend){if((this.F||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)},g.prototype.remove=function(t){if(t instanceof c&&void 0===t.extend){if(this.fields&&this.fields[t.name]===t)return delete this.fields[t.name],t.parent=null,t.onRemove(this),i(this);throw Error(t+" is not a member of "+this)}if(t instanceof u){if(this.oneofs&&this.oneofs[t.name]===t)return delete this.oneofs[t.name],t.parent=null,t.onRemove(this),i(this);throw Error(t+" is not a member of "+this)}return s.prototype.remove.call(this,t)},g.prototype.isReservedId=function(t){return s.isReservedId(this.reserved,t)},g.prototype.isReservedName=function(t){return s.isReservedName(this.reserved,t)},g.prototype.create=function(t){return new this.ctor(t)},g.prototype.setup=function(){for(var t=this.fullName,n=[],e=0;e<this.fieldsArray.length;++e)n.push(this.P[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=y.fromObject(this)({types:n,util:d}),this.toObject=y.toObject(this)({types:n,util:d});var i,t=b[t];return t&&((i=Object.create(this)).fromObject=this.fromObject,this.fromObject=t.fromObject.bind(i),i.toObject=this.toObject,this.toObject=t.toObject.bind(i)),this},g.prototype.encode=function(t,n){return this.setup().encode(t,n)},g.prototype.encodeDelimited=function(t,n){return this.encode(t,n&&n.len?n.fork():n).ldelim()},g.prototype.decode=function(t,n){return this.setup().decode(t,n)},g.prototype.decodeDelimited=function(t){return t instanceof o||(t=o.create(t)),this.decode(t,t.uint32())},g.prototype.verify=function(t){return this.setup().verify(t)},g.prototype.fromObject=function(t){return this.setup().fromObject(t)},g.prototype.toObject=function(t,n){return this.setup().toObject(t,n)},g.d=function(n){return function(t){d.decorateType(t,n)}}},function(t,n,e){"use strict";t.exports=o;var s=e(7),i=(((o.prototype=Object.create(s.prototype)).constructor=o).className="MapField",e(9)),a=e(2);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(8),o=(((s.prototype=Object.create(i.prototype)).constructor=s).className="Service",e(24)),a=e(2),u=e(18);function s(t,n){i.call(this,t,n),this.methods={},this.C=null}function r(t){return t.C=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.C||(this.C=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.C[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 c=e(6),h=(((i.prototype=Object.create(c.prototype)).constructor=i).className="Method",e(2));function i(t,n,e,i,r,o,s,a,u){if(h.isObject(r)?(s=r,r=o=void 0):h.isObject(o)&&(s=o,o=void 0),void 0!==n&&!h.isString(n))throw TypeError("type must be a string");if(!h.isString(e))throw TypeError("requestType must be a string");if(!h.isString(i))throw TypeError("responseType must be a string");c.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 h.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),c.prototype.resolve.call(this))}},function(t,n,e){"use strict";t.exports=function(t){var n=c.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.P[e].resolve(),r=i.resolvedType instanceof a?"int32":i.type,o="m"+c.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.P.length;++e){var s=t.P[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(5),u=e(9),c=e(2)},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.P[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",c(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",c(n,"integer key"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":t("if(!util.key64Re.test(%s))",e)("return%j",c(n,"integer|Long key"));break;case"bool":t("if(!util.key2Re.test(%s))",e)("return%j",c(n,"boolean key"))}}(n,s,"k[i]"),h(n,s,r,a+"[k[i]]")("}")):s.repeated?(n("if(!Array.isArray(%s))",a)("return%j",c(s,"array"))("for(var i=0;i<%s.length;++i){",a),h(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)),h(n,s,r,a)),s.optional&&n("}")}return n("return null")};var s=e(5),u=e(2);function c(t,n){return t.name+": "+n+(t.repeated&&"array"!==n?"[]":t.map&&"object"!==n?"{k:"+t.keyType+"}":"")+" expected"}function h(t,n,e,i){if(n.resolvedType)if(n.resolvedType instanceof s){t("switch(%s){",i)("default:")("return%j",c(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",c(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",c(n,"integer|Long"));break;case"float":case"double":t('if(typeof %s!=="number")',i)("return%j",c(n,"number"));break;case"bool":t('if(typeof %s!=="boolean")',i)("return%j",c(n,"boolean"));break;case"string":t("if(!util.isString(%s))",i)("return%j",c(n,"string"));break;case"bytes":t('if(!(%s&&typeof %s.length==="number"||util.isString(%s)))',i,i,i)("return%j",c(n,"buffer"))}return t}},function(t,n,e){"use strict";var l=e(5),d=e(2);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],c=d.safeProp(u.name);u.resolvedType instanceof l?e("d%s=o.enums===String?%j:%j",c,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",c)("}else")("d%s=o.longs===String?%j:%i",c,u.typeDefault.toString(),u.typeDefault.toNumber()):u.bytes?(a="["+Array.prototype.slice.call(u.typeDefault).join(",")+"]",e("if(o.bytes===String)d%s=%j",c,String.fromCharCode.apply(String,u.typeDefault))("else{")("d%s=%s",c,a)("if(o.bytes!==Array)d%s=util.newBuffer(d%s)",c,c)("}")):e("d%s=%j",c,u.typeDefault)}e("}")}for(var h=!1,s=0;s<n.length;++s){var u=n[s],f=t.P.indexOf(u),c=d.safeProp(u.name);u.map?(h||(h=!0,e("var ks2")),e("if(m%s&&(ks2=Object.keys(m%s)).length){",c,c)("d%s={}",c)("for(var j=0;j<ks2.length;++j){"),v(e,u,f,c+"[ks2[j]]")("}")):u.repeated?(e("if(m%s&&m%s.length){",c,c)("d%s=[]",c)("for(var j=0;j<m%s.length;++j){",c),v(e,u,f,c+"[j]")("}")):(e("if(m%s!=null&&m.hasOwnProperty(%j)){",c,u.name),v(e,u,f,c),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 s=e(14);n[".google.protobuf.Any"]={fromObject:function(t){if(t&&t["@type"]){var n,e=t["@type"].substring(t["@type"].lastIndexOf("/")+1),e=this.lookup(e);if(e)return-1===(n="."===t["@type"].charAt(0)?t["@type"].substr(1):t["@type"]).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="",o="";return!((t=n&&n.json&&t.type_url&&t.value&&(o=t.type_url.substring(t.type_url.lastIndexOf("/")+1),r=t.type_url.substring(0,t.type_url.lastIndexOf("/")+1),e=this.lookup(o))?e.decode(t.value):t)instanceof this.ctor)&&t instanceof s?(e=t.$type.toObject(t,n),i="."===t.$type.fullName[0]?t.$type.fullName.substr(1):t.$type.fullName,e["@type"]=o=(r=""===r?"type.googleapis.com/":r)+i,e):this.toObject(t,n)}}},function(t,n,e){"use strict";t.exports=u;var i,d,v,r=e(8),o=(((u.prototype=Object.create(r.prototype)).constructor=u).className="Root",e(7)),s=e(5),a=e(10),p=e(2);function u(t){r.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 c(t){var n=t.lastIndexOf("google/protobuf/");if(-1<n){t=t.substring(n);if(t in v)return t}return null}function h(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=c(i.imports[r])||s.resolvePath(t,i.imports[r]))&&f(e);if(i.weakImports)for(r=0;r<i.weakImports.length;++r)(e=c(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?h(e,v[e]):(++l,setTimeout(function(){--l,h(e,v[e])}));else if(a){var t;try{t=p.fs.readFileSync(e).toString("utf8")}catch(t){return void(i||u(t))}h(e,t)}else++l,s.fetch(e,function(t,n){--l,r&&(t?i?l||u(null,s):u(t):h(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)return this.load(t,n,m);throw Error("not supported")},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 r.prototype.resolveAll.call(this)};var c=/^[A-Z]/;function h(t,n){var e,i=n.parent.lookup(n.extend);if(i)return((e=new o(n.fullName,n.id,n.type,n.rule,void 0,n.options)).declaringField=n).extensionField=e,i.add(e),1}u.prototype.A=function(t){if(t instanceof o)void 0===t.extend||t.extensionField||h(0,t)||this.deferred.push(t);else if(t instanceof s)c.test(t.name)&&(t.parent[t.name]=t.values);else if(!(t instanceof a)){if(t instanceof i)for(var n=0;n<this.deferred.length;)h(0,this.deferred[n])?this.deferred.splice(n,1):++n;for(var e=0;e<t.nestedArray.length;++e)this.A(t.L[e]);c.test(t.name)&&(t.parent[t.name]=t)}},u.prototype.M=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)c.test(t.name)&&delete t.parent[t.name];else if(t instanceof r){for(var e=0;e<t.nestedArray.length;++e)this.M(t.L[e]);c.test(t.name)&&delete t.parent[t.name]}},u.T=function(t,n,e){i=t,d=n,v=e}},function(t,n,e){var i;function r(t){return(r="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)}i=function(t){"use strict";function n(t){return 180*t/Math.PI}function d(t){return n(Math.atan2(t[1][1]-t[0][1],t[1][0]-t[0][0]))}function l(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){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)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function i(t){return function(t){if(Array.isArray(t)){for(var n=0,e=new Array(t.length);n<t.length;n++)e[n]=t[n];return e}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function v(t){var n=1<arguments.length&&void 0!==arguments[1]&&arguments[1],t=l(t,2),e=l(t[0],2),i=e[0],r=e[1],e=l(t[1],2),o=e[0],s=e[1];return function(t){t=n?t<0?0:1<t?1:t:t;return[(o-i)*t+i,(s-r)*t+r]}}function p(t){return Math.sqrt(Math.pow(t[1][0]-t[0][0],2)+Math.pow(t[1][1]-t[0][1],2))}function r(t){return[(t[0][0]+t[1][0])/2,(t[0][1]+t[1][1])/2]}function o(t){return t/180*Math.PI}function s(t,n,e){n=o(n||0);return!e||0===e[0]&&0===e[1]?a(t,n):a(t.map(function(t,n){return t-e[n]}),n).map(function(t,n){return t+e[n]})}function a(t,n){return[t[0]*Math.cos(n)-t[1]*Math.sin(n),t[0]*Math.sin(n)+t[1]*Math.cos(n)]}function f(t){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0,e=2<arguments.length&&void 0!==arguments[2]?arguments[2]:0,n=o(n);return[t[0]+e*Math.cos(n),t[1]+e*Math.sin(n)]}function m(t){for(var n=1<arguments.length&&void 0!==arguments[1]&&arguments[1],e=0,i=0,r=t.length;i<r;i++)var o=t[i],s=t[i===r-1?0:i+1],e=(e+=o[0]*s[1])-s[0]*o[1];return n?e/2:Math.abs(e/2)}function y(t){if(t.length<3)return null;for(var n=1/0,e=-1/0,i=1/0,r=-1/0,o=!1,s=0,a=t.length;s<a;s++){var u=t[s],c=u[0],u=u[1];null!=c&&isFinite(c)&&null!=u&&isFinite(u)&&(o=!0,c<n&&(n=c),e<c&&(e=c),u<i&&(i=u),r<u)&&(r=u)}return o?[[n,i],[e,r]]:null}function b(t){for(var n=0,e=0,i=0,r=t.length,o=0;o<r;o++){var s=t[o],a=t[o===r-1?0:o+1],u=s[0]*a[1]-a[0]*s[1];n+=u,e+=(s[0]+a[0])*u,i+=(s[1]+a[1])*u}var c=3*n;return[e/c,i/c]}function u(t,n,e){return(t[0]-e[0])*(n[1]-e[1])-(t[1]-e[1])*(n[0]-e[0])}function g(t){return e=(n=t)[0],n=n[n.length-1],e[0]===n[0]&&e[1]===n[1]?t:[].concat(i(t),[t[0]]);var n,e}function _(t){if(0===t.length)return 0;for(var n,e,i=-1,r=t.length,o=t[r-1],s=o[0],a=o[1],u=0;++i<r;)n=s,e=a,n-=s=(o=t[i])[0],e-=a=o[1],u+=Math.sqrt(n*n+e*e);return u}function w(t,n,e){e=e||b(t);for(var i=[],r=0,o=t.length;r<o;r++){var s=t[r],a=p([e,s]),s=d([e,s]);i[r]=f(e,s,a*Math.sqrt(n))}return i}function x(t,n,e){for(var i=[],r=0,o=t.length;r<o;r++)i[r]=f(t[r],n,e);return i}function E(t,n,e){for(var i=n,r=n,o=[],s=1;s<t.length-1;s++){var a=t[s];.5<Math.random()?(o.push(a-i),i=a):(o.push(r-a),r=a)}return o.push(e-i),o.push(r-e),o}function e(t){return t[1][1]>t[0][1]?t:[t[1],t[0]]}function h(t,n){var e=2<arguments.length&&void 0!==arguments[2]?arguments[2]:0,i=p(n);return c(t,n,e)&&p([n[0],t])<=i&&p([n[1],t])<=i}function c(t,n){var e=2<arguments.length&&void 0!==arguments[2]?arguments[2]:0;return Math.abs(u(t,n[0],n[1]))<=e}function S(t,n){var e=l(t,2),i=l(e[0],2),r=i[0],i=i[1],e=l(e[1],2),o=e[0],e=e[1],s=l(n,2),a=l(s[0],2),u=a[0],a=a[1],s=l(s[1],2),c=s[0],s=s[1];return r===u&&i===a||o===c&&e===s||!!(h(t[0],n)||h(t[1],n)||h(n[0],t)||h(n[1],t))||0!=(n=(s-a)*(o-r)-(c-u)*(e-i))&&(e=((o-r)*(t=i-a)-(e-i)*(o=r-u))/n,0<(i=((c-u)*t-(s-a)*o)/n))&&i<1&&0<e&&e<1}function T(t,n){for(var e=!1,i=g(n),r=0,o=i.length-1;r<o;r++){var s=i[r],a=i[r+1];if(S(t,[s,a])||h(s,t)&&h(a,t)){e=!0;break}}return e}function A(t,n){for(var e=t[0],i=t[1],r=!1,o=0,s=n.length-1;o<n.length;s=o++){var a=n[o][0],u=n[o][1],c=n[s][0],h=n[s][1];i<u!=i<h&&e<(c-a)*(i-u)/(h-u)+a&&(r=!r)}return r}function M(t,n){for(var e=2<arguments.length&&void 0!==arguments[2]?arguments[2]:0,i=!1,r=g(n),o=0,s=r.length-1;o<s;o++)if(h(t,[r[o],r[o+1]],e)){i=!0;break}return i}t.lineAngle=d,t.lineInterpolate=v,t.lineLength=p,t.lineMidpoint=r,t.lineRotate=function(n,e,i){return n.map(function(t){return s(t,e,i||r(n))})},t.lineTranslate=function(t,n,e){return t.map(function(t){return f(t,n,e)})},t.pointRotate=s,t.pointTranslate=f,t.polygonArea=m,t.polygonBounds=y,t.polygonCentroid=b,t.polygonHull=function(t){if(t.length<3)return null;for(var n=t.slice().sort(function(t,n){return t[0]===n[0]?t[1]-n[1]:t[0]-n[0]}),e=[],i=0;i<n.length;i++){for(;2<=e.length&&u(e[e.length-2],e[e.length-1],n[i])<=0;)e.pop();e.push(n[i])}for(var r=[],o=n.length-1;0<=o;o--){for(;2<=r.length&&u(r[r.length-2],r[r.length-1],n[o])<=0;)r.pop();r.push(n[o])}return r.pop(),e.pop(),e.concat(r)},t.polygonInterpolate=function(h){return function(t){if(t<=0)return h[0];var n=g(h);if(1<=t)return n[n.length-1];for(var e=_(n)*t,i=[],r=0,o=0;o<n.length-1;o++){var s=[n[o],n[o+1]],a=p(s),u=d(s),c=e-(r+=a);if(c<0){i=f(s[0],u,a+c);break}o===h.length-2&&(i=f(s[0],u,c))}return i}},t.polygonLength=_,t.polygonMean=function(t){for(var n=0,e=0,i=t.length,r=0;r<i;r++){var o=t[r];n+=o[0],e+=o[1]}return[n/i,e/i]},t.polygonRandom=function(){for(var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:3,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:100,e=2<arguments.length&&void 0!==arguments[2]?arguments[2]:[0,0],i=Math.sqrt(n/Math.PI),r=Array.from({length:t},function(){return 2*i*Math.random()}),t=Array.from({length:t},function(){return 2*i*Math.random()}),r=(r.sort(function(t,n){return t-n}),t.sort(function(t,n){return t-n}),E(r,r[0],r[r.length-1])),o=E(t,t[0],t[t.length-1]),s=o,a=s.length-1;0<a;a--){var u=Math.floor(Math.random()*(a+1)),c=[s[u],s[a]];s[a]=c[0],s[u]=c[1]}var h=[],f=0,l=0,t=(r.map(function(t,n){return[t,o[n]]}).sort(function(t,n){return Math.atan2(n[1],n[0])-Math.atan2(t[1],t[0])}).forEach(function(t){f+=+t[0],l+=+t[1],h.push([f,l])}),b(h));return x(w(h,n/m(h)),d([t,e]),p([t,e]))},t.polygonReflectX=function(t){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:1,e=l(y(t),2),i=l(e[0],2),r=i[0];i[1];for(var o=(i=l(e[1],2))[0],s=(i[1],[]),a=0,u=t.length;a<u;a++){var c=l(t[a],2),h=c[0],c=c[1],f=[r+o-h,c];0===n?s[a]=[h,c]:1===n?s[a]=f:(h=v([[h,c],f]),s[a]=h(Math.max(Math.min(n,1),0)))}return s},t.polygonReflectY=function(t){for(var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:1,e=l(y(t),2),i=l(e[0],2),r=(i[0],i[1]),o=((i=l(e[1],2))[0],i[1]),s=[],a=0,u=t.length;a<u;a++){var c=l(t[a],2),h=c[0],c=c[1],f=[h,r+o-c];0===n?s[a]=[h,c]:1===n?s[a]=f:(h=v([[h,c],f]),s[a]=h(Math.max(Math.min(n,1),0)))}return s},t.polygonRegular=function(){for(var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:3,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:100,e=2<arguments.length?arguments[2]:void 0,i=[],r=[0,0],o=[0,0],s=0,a=0;a<t;a++)i[a]=r,o[0]+=r[0],o[1]+=r[1],r=f(r,s,Math.sqrt(4*n*Math.tan(Math.PI/t)/t)),s-=360/t;return i=e?x(i,d(e=[[o[0]/t,o[1]/t],e]),p(e)):i},t.polygonRotate=function(t,n,e){for(var i=[],r=0,o=t.length;r<o;r++)i[r]=s(t[r],n,e);return i},t.polygonScale=function(t,n,e){e=e||b(t);for(var i=[],r=0,o=t.length;r<o;r++){var s=t[r],a=p([e,s]),s=d([e,s]);i[r]=f(e,s,a*n)}return i},t.polygonScaleArea=w,t.polygonScaleX=function(t,n,e){e=e||b(t);for(var i=[],r=0,o=t.length;r<o;r++){var s=t[r],a=p([e,s]),a=f(e,d([e,s]),a*n);i[r]=[a[0],s[1]]}return i},t.polygonScaleY=function(t,n,e){e=e||b(t);for(var i=[],r=0,o=t.length;r<o;r++){var s=t[r],a=p([e,s]),a=f(e,d([e,s]),a*n);i[r]=[s[0],a[1]]}return i},t.polygonTranslate=x,t.polygonWind=function(t){var n,e,i=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"ccw";return t.length<3?null:(n=t.slice().reverse(),e=0<m(t,!0),"cw"===i||"clockwise"===i?e?t:n:e?n:t)},t.lineIntersectsLine=S,t.lineIntersectsPolygon=T,t.pointInPolygon=A,t.pointOnPolygon=M,t.pointLeftofLine=function(t,n){return n=e(n),u(t,n[1],n[0])<0},t.pointRightofLine=function(t,n){return n=e(n),0<u(t,n[1],n[0])},t.pointOnLine=h,t.pointWithLine=c,t.polygonInPolygon=function(t,n){for(var e=!0,i=g(t),r=0,o=i.length-1;r<o;r++){var s=i[r];if(!A(s,n)){e=!1;break}if(T([s,i[r+1]],n)){e=!1;break}}return e},t.polygonIntersectsPolygon=function(t,n){for(var e=!1,i=0,r=g(t),o=0,s=r.length-1;o<s;o++){var a=r[o];if(T([a,r[o+1]],n)){e=!0;break}if(M(a,n)&&++i,2===i){e=!0;break}}return e},t.angleReflect=function(t,n){return 360<=(n=2*n-t)?n-360:n<0?360+n:n},t.angleToDegrees=n,t.angleToRadians=o,Object.defineProperty(t,"u",{value:!0})},"object"===r(n)&&void 0!==t?i(n):void 0!==(n="function"==typeof(i=i)?i.apply(n,[n]):i)&&(t.exports=n)},function(t,n,e){"use strict";t.exports=e(34)},function(t,n,e){var i;i=function(){var c,r={defaultRadius:40,defaultRenderer:"canvas2d",defaultGradient:{.25:"rgb(0,0,255)",.55:"rgb(0,255,0)",.85:"yellow",1:"rgb(255,0,0)"},defaultMaxOpacity:1,defaultMinOpacity:0,defaultBlur:.85,defaultXField:"x",defaultYField:"y",defaultValueField:"value",plugins:{}},o=(c=r.defaultRadius,t.prototype={D:function(t,n){var e=t[this.k],i=t[this.U],r=this.B,o=this.G,s=this.H,a=this.X,u=t[this.V]||1,t=t.radius||this.W||c,r=(o[e]||(o[e]=[],r[e]=[]),o[e][i]?o[e][i]+=u:(o[e][i]=u,r[e][i]=t),o[e][i]);return s<r?(n?this.setDataMax(r):this.H=r,!1):r<a?(n?this.setDataMin(r):this.X=r,!1):{x:e,y:i,value:u,radius:t,min:a,max:s}},Y:function(){var t,n=[],e=this.G,i=this.B;for(t in e)for(var r in e[t])n.push({x:t,y:r,radius:i[t][r],value:e[t][r]});return{min:this.X,max:this.H,data:n}},Z:function(){this.K.emit("extremachange",{min:this.X,max:this.H})},addData:function(){if(0<arguments[0].length)for(var t=arguments[0],n=t.length;n--;)this.addData.call(this,t[n]);else{var e=this.D(arguments[0],!0);e&&(0===this.G.length&&(this.X=this.H=e.value),this.K.emit("renderpartial",{min:this.X,max:this.H,data:[e]}))}return this},setData:function(t){var n=t.data,e=n.length;this.G=[],this.B=[];for(var i=0;i<e;i++)this.D(n[i],!1);return this.H=t.max,this.X=t.min||0,this.Z(),this.K.emit("renderall",this.J()),this},removeData:function(){},setDataMax:function(t){return this.H=t,this.Z(),this.K.emit("renderall",this.J()),this},setDataMin:function(t){return this.X=t,this.Z(),this.K.emit("renderall",this.J()),this},setCoordinator:function(t){this.K=t},J:function(){return{max:this.H,min:this.X,data:this.G,radi:this.B}},getData:function(){return this.Y()}},t);function t(t){this.K={},this.G=[],this.B=[],this.X=10,this.H=1,this.k=t.xField||t.defaultXField,this.U=t.yField||t.defaultYField,this.V=t.valueField||t.defaultValueField,t.radius&&(this.W=t.radius)}function i(t){var n,e=t.gradient||t.defaultGradient,i=(t=document.createElement("canvas")).getContext("2d"),r=(t.width=256,t.height=1,i.createLinearGradient(0,0,256,1));for(n in e)r.addColorStop(n,e[n]);return i.fillStyle=r,i.fillRect(0,0,256,1),i.getImageData(0,0,256,1).data}function n(t){var n=this.shadowCanvas=document.createElement("canvas"),e=this.canvas=t.canvas;this.$=[1e4,1e4,0,0];n.width=e.width,n.height=e.height,this.tt=e.width,this.nt=e.height,this.shadowCtx=n.getContext("2d"),this.ctx=e.getContext("2d"),this.et=i(t),this.it={},this.rt(t)}e=!(n.prototype={renderPartial:function(t){0<t.data.length&&(this.ot(t),this.st())},renderAll:function(t){this.ut(),0<t.data.length&&(this.ot(function(t){for(var n=[],e=t.min,i=t.max,r=t.radi,t=t.data,o=Object.keys(t),s=o.length;s--;)for(var a=o[s],u=Object.keys(t[a]),c=u.length;c--;){var h=u[c],f=t[a][h],l=r[a][h];n.push({x:a,y:h,value:f,radius:l})}return{min:e,max:i,data:n}}(t)),this.st())},ct:function(t){this.et=i(t)},updateConfig:function(t){t.gradient&&this.ct(t),this.rt(t)},setDimensions:function(t,n){this.tt=t,this.nt=n,this.canvas.width=this.shadowCanvas.width=t,this.canvas.height=this.shadowCanvas.height=n},ut:function(){this.shadowCtx.clearRect(0,0,this.tt,this.nt),this.ctx.clearRect(0,0,this.tt,this.nt)},rt:function(t){this.ht=0==t.blur?0:t.blur||t.defaultBlur,t.backgroundColor&&(this.canvas.style.backgroundColor=t.backgroundColor),this.tt=this.canvas.width=this.shadowCanvas.width=t.width||this.tt,this.nt=this.canvas.height=this.shadowCanvas.height=t.height||this.nt,this.ft=255*(t.opacity||0),this.lt=255*(t.maxOpacity||t.defaultMaxOpacity),this.dt=255*(t.minOpacity||t.defaultMinOpacity),this.vt=!!t.useGradientOpacity},ot:function(t){for(var n,e,i,r,o,s=this.X=t.min,a=this.H=t.max,u=(t=t.data||[]).length,c=1-this.ht;u--;){var h,f=t[u],l=f.x,d=f.y,v=f.radius,f=Math.min(f.value,a),l=l-v,d=d-v,p=this.shadowCtx,m=(this.it[v]?h=this.it[v]:this.it[v]=(n=v,e=c,o=m=r=i=void 0,i=document.createElement("canvas"),r=i.getContext("2d"),o=m=n,i.width=i.height=2*n,1==e?(r.beginPath(),r.arc(m,o,n,0,2*Math.PI,!1),r.fillStyle="rgba(0,0,0,1)",r.fill()):((e=r.createRadialGradient(m,o,n*e,m,o,n)).addColorStop(0,"rgba(0,0,0,1)"),e.addColorStop(1,"rgba(0,0,0,0)"),r.fillStyle=e,r.fillRect(0,0,2*n,2*n)),h=i),(f-s)/(a-s));p.globalAlpha=m<.01?.01:m,p.drawImage(h,l,d),l<this.$[0]&&(this.$[0]=l),d<this.$[1]&&(this.$[1]=d),l+2*v>this.$[2]&&(this.$[2]=l+2*v),d+2*v>this.$[3]&&(this.$[3]=d+2*v)}},st:function(){for(var t=this.$[0],n=this.$[1],e=this.$[2]-t,i=this.$[3]-n,r=this.tt,o=this.nt,s=this.ft,a=this.lt,u=this.dt,c=this.vt,r=this.shadowCtx.getImageData(t=t<0?0:t,n=n<0?0:n,e=r<t+e?r-t:e,i=o<n+i?o-n:i),h=r.data,f=h.length,l=this.et,d=3;d<f;d+=4){var v=h[d],p=4*v;p&&(v=0<s?s:v<a?v<u?u:v:a,h[d-3]=l[p],h[d-2]=l[1+p],h[d-1]=l[2+p],h[d]=c?l[3+p]:v)}r.data=h,this.ctx.putImageData(r,t,n),this.$=[1e3,1e3,0,0]},getValueAt:function(t){var t=this.shadowCtx.getImageData(t.x,t.y,1,1).data[3],n=this.H,e=this.X;return Math.abs(n-e)*(t/255)>>0},getDataURL:function(){return this.canvas.toDataURL()}});var e,s,a=e="canvas2d"===r.defaultRenderer?n:e,u=function(){for(var t={},n=arguments.length,e=0;e<n;e++){var i,r=arguments[e];for(i in r)t[i]=r[i]}return t},h=(f.prototype={on:function(t,n,e){var i=this.cStore;i[t]||(i[t]=[]),i[t].push(function(t){return n.call(e,t)})},emit:function(t,n){var e=this.cStore;if(e[t])for(var i=e[t].length,r=0;r<i;r++)(0,e[t][r])(n)}},s=f,l.prototype={addData:function(){return this.yt.addData.apply(this.yt,arguments),this},removeData:function(){return this.yt.removeData&&this.yt.removeData.apply(this.yt,arguments),this},setData:function(){return this.yt.setData.apply(this.yt,arguments),this},setDataMax:function(){return this.yt.setDataMax.apply(this.yt,arguments),this},setDataMin:function(){return this.yt.setDataMin.apply(this.yt,arguments),this},configure:function(t){return this.bt=u(this.bt,t),this.gt.updateConfig(this.bt),this.K.emit("renderall",this.yt.J()),this},repaint:function(){return this.K.emit("renderall",this.yt.J()),this},getData:function(){return this.yt.getData()},getDataURL:function(){return this.gt.getDataURL()},getValueAt:function(t){return this.yt.getValueAt?this.yt.getValueAt(t):this.gt.getValueAt?this.gt.getValueAt(t):null}},l);function f(){this.cStore={}}function l(){var n,t,e=this.bt=u(r,arguments[0]||{});if(this.K=new s,e.plugin){var i=e.plugin;if(!r.plugins[i])throw new Error("Plugin '"+i+"' not found. Maybe it was not registered.");var i=r.plugins[i];this.gt=new i.renderer(e),this.yt=new i.store(e)}else this.gt=new a(e),this.yt=new o(e);i=(n=this).gt,e=n.K,t=n.yt,e.on("renderpartial",i.renderPartial,i),e.on("renderall",i.renderAll,i),e.on("extremachange",function(t){n.bt.onExtremaChange&&n.bt.onExtremaChange({min:t.min,max:t.max,gradient:n.bt.gradient||n.bt.defaultGradient})}),t.setCoordinator(e)}return{create:function(t){return new h(t)},register:function(t,n){r.plugins[t]=n}}},t.exports?t.exports=i():void 0!==(e="function"==typeof(i=i)?i.call(n,e,n,t):i)&&(t.exports=e)},function(t,n,e){var i;i=function(){var c,r={defaultRadius:40,defaultRenderer:"canvas2d",defaultGradient:{.25:"rgb(0,0,255)",.55:"rgb(0,255,0)",.85:"yellow",1:"rgb(255,0,0)"},defaultMaxOpacity:1,defaultMinOpacity:0,defaultBlur:.85,defaultXField:"x",defaultYField:"y",defaultValueField:"value",plugins:{}},o=(c=r.defaultRadius,t.prototype={D:function(t,n){var e=t[this.k],i=t[this.U],r=this.B,o=this.G,s=this.H,a=this.X,u=t[this.V]||1,t=t.radius||this.W||c,r=(o[e]||(o[e]=[],r[e]=[]),o[e][i]?o[e][i]+=u:(o[e][i]=u,r[e][i]=t),o[e][i]);return s<r?(n?this.setDataMax(r):this.H=r,!1):r<a?(n?this.setDataMin(r):this.X=r,!1):{x:e,y:i,value:u,radius:t,min:a,max:s}},Y:function(){var t,n=[],e=this.G,i=this.B;for(t in e)for(var r in e[t])n.push({x:t,y:r,radius:i[t][r],value:e[t][r]});return{min:this.X,max:this.H,data:n}},Z:function(){this.K.emit("extremachange",{min:this.X,max:this.H})},addData:function(){if(0<arguments[0].length)for(var t=arguments[0],n=t.length;n--;)this.addData.call(this,t[n]);else{var e=this.D(arguments[0],!0);e&&(0===this.G.length&&(this.X=this.H=e.value),this.K.emit("renderpartial",{min:this.X,max:this.H,data:[e]}))}return this},setData:function(t){var n=t.data,e=n.length;this.G=[],this.B=[];for(var i=0;i<e;i++)this.D(n[i],!1);return this.H=t.max,this.X=t.min||0,this.Z(),this.K.emit("renderall",this.J()),this},removeData:function(){},setDataMax:function(t){return this.H=t,this.Z(),this.K.emit("renderall",this.J()),this},setDataMin:function(t){return this.X=t,this.Z(),this.K.emit("renderall",this.J()),this},setCoordinator:function(t){this.K=t},J:function(){return{max:this.H,min:this.X,data:this.G,radi:this.B}},getData:function(){return this.Y()}},t);function t(t){this.K={},this.G=[],this.B=[],this.X=10,this.H=1,this.k=t.xField||t.defaultXField,this.U=t.yField||t.defaultYField,this.V=t.valueField||t.defaultValueField,t.radius&&(this.W=t.radius)}function i(t){var n,e=t.gradient||t.defaultGradient,i=(t=t.canvas).getContext("2d"),r=(t.width=256,t.height=1,i.createLinearGradient(0,0,256,1));for(n in e)r.addColorStop(n,e[n]);return i.fillStyle=r,i.fillRect(0,0,256,1),i.getImageData(0,0,256,1).data}function n(t){var n=this.shadowCanvas=t.canvas,e=this.canvas=t.canvas;this.$=[1e4,1e4,0,0];n.width=e.width,n.height=e.height,this.tt=e.width,this.nt=e.height,this.ctx=e.getContext("2d"),this.shadowCtx=n.getContext("2d"),this.et=i(t),this.it={},this.rt(t)}e=!(n.prototype={renderPartial:function(t){0<t.data.length&&(this.ot(t),this.st())},renderAll:function(t){var n;this.ut(),0<(null==t||null==(n=t.data)?void 0:n.length)&&(this.ot(function(t){for(var n=[],e=t.min,i=t.max,r=t.radi,t=t.data,o=Object.keys(t),s=o.length;s--;)for(var a=o[s],u=Object.keys(t[a]),c=u.length;c--;){var h=u[c],f=t[a][h],l=r[a][h];n.push({x:a,y:h,value:f,radius:l})}return{min:e,max:i,data:n}}(t)),this.st())},ct:function(t){this.et=i(t)},updateConfig:function(t){t.gradient&&this.ct(t),this.rt(t)},setDimensions:function(t,n){this.tt=t,this.nt=n,this.canvas.width=this.shadowCanvas.width=t,this.canvas.height=this.shadowCanvas.height=n},ut:function(){this.shadowCtx.clearRect(0,0,this.tt,this.nt),this.ctx.clearRect(0,0,this.tt,this.nt)},rt:function(t){this.ht=0==t.blur?0:t.blur||t.defaultBlur,t.backgroundColor&&(this.canvas.style.backgroundColor=t.backgroundColor),this.tt=this.canvas.width=this.shadowCanvas.width=t.width||this.tt,this.nt=this.canvas.height=this.shadowCanvas.height=t.height||this.nt,this.ft=255*(t.opacity||0),this.lt=255*(t.maxOpacity||t.defaultMaxOpacity),this.dt=255*(t.minOpacity||t.defaultMinOpacity),this.vt=!!t.useGradientOpacity},ot:function(t){for(var n,e,i,r,o,s,a=this.X=t.min,u=this.H=t.max,c=(t=t.data||[]).length,h=1-this.ht;c--;){var f=t[c],l=f.x,d=f.y,v=f.radius,f=Math.min(f.value,u),l=l-v,d=d-v,f=(f-a)/(u-a);this.ctx.globalAlpha=f<.01?.01:f,f=this.ctx,i=l,r=d,s=o=void 0,s=o=n=v,1==(e=h)?(f.beginPath(),f.arc(i,r,n,0,2*Math.PI,!1),f.fillStyle="rgba(0,0,0,1)",f.fill()):((e=f.createRadialGradient(i+o,r+s,n*e,i+o,r+s,n)).addColorStop(0,"rgba(0,0,0,1)"),e.addColorStop(1,"rgba(0,0,0,0)"),f.fillStyle=e,f.fillRect(i,r,2*n,2*n)),l<this.$[0]&&(this.$[0]=l),d<this.$[1]&&(this.$[1]=d),l+2*v>this.$[2]&&(this.$[2]=l+2*v),d+2*v>this.$[3]&&(this.$[3]=d+2*v)}},st:function(){for(var t=this.$[0],n=this.$[1],e=this.$[2]-t,i=this.$[3]-n,r=this.tt,o=this.nt,s=this.ft,a=this.lt,u=this.dt,c=this.vt,r=this.shadowCtx.getImageData(t=t<0?0:t,n=n<0?0:n,e=r<t+e?r-t:e,i=o<n+i?o-n:i),h=r.data,f=h.length,l=this.et,d=3;d<f;d+=4){var v=h[d],p=4*v;p&&(v=0<s?s:v<a?v<u?u:v:a,h[d-3]=l[p],h[d-2]=l[1+p],h[d-1]=l[2+p],h[d]=c?l[3+p]:v)}this.ctx.putImageData(r,t,n),this.$=[1e3,1e3,0,0]},getValueAt:function(t){var t=this.shadowCtx.getImageData(t.x,t.y,1,1).data[3],n=this.H,e=this.X;return Math.abs(n-e)*(t/255)>>0},getDataURL:function(){return this.canvas.toDataURL()}});var e,s,a=e="canvas2d"===r.defaultRenderer?n:e,u=function(){for(var t={},n=arguments.length,e=0;e<n;e++){var i,r=arguments[e];for(i in r)t[i]=r[i]}return t},h=(f.prototype={on:function(t,n,e){var i=this.cStore;i[t]||(i[t]=[]),i[t].push(function(t){return n.call(e,t)})},emit:function(t,n){var e=this.cStore;if(e[t])for(var i=e[t].length,r=0;r<i;r++)(0,e[t][r])(n)}},s=f,l.prototype={addData:function(){return this.yt.addData.apply(this.yt,arguments),this},removeData:function(){return this.yt.removeData&&this.yt.removeData.apply(this.yt,arguments),this},setData:function(){return this.yt.setData.apply(this.yt,arguments),this},setDataMax:function(){return this.yt.setDataMax.apply(this.yt,arguments),this},setDataMin:function(){return this.yt.setDataMin.apply(this.yt,arguments),this},configure:function(t){return this.bt=u(this.bt,t),this.gt.updateConfig(this.bt),this.K.emit("renderall",this.yt.J()),this},repaint:function(){return this.K.emit("renderall",this.yt.J()),this},getData:function(){return this.yt.getData()},getDataURL:function(){return this.gt.getDataURL()},getValueAt:function(t){return this.yt.getValueAt?this.yt.getValueAt(t):this.gt.getValueAt?this.gt.getValueAt(t):null}},l);function f(){this.cStore={}}function l(){var n,t,e=this.bt=u(r,arguments[0]||{});if(this.K=new s,e.plugin){var i=e.plugin;if(!r.plugins[i])throw new Error("Plugin '"+i+"' not found. Maybe it was not registered.");var i=r.plugins[i];this.gt=new i.renderer(e),this.yt=new i.store(e)}else this.gt=new a(e),this.yt=new o(e);i=(n=this).gt,e=n.K,t=n.yt,e.on("renderpartial",i.renderPartial,i),e.on("renderall",i.renderAll,i),e.on("extremachange",function(t){n.bt.onExtremaChange&&n.bt.onExtremaChange({min:t.min,max:t.max,gradient:n.bt.gradient||n.bt.defaultGradient})}),t.setCoordinator(e)}return{create:function(t){return new h(t)},register:function(t,n){r.plugins[t]=n}}},t.exports?t.exports=i():void 0!==(e="function"==typeof(i=i)?i.call(n,e,n,t):i)&&(t.exports=e)},function(t,n,e){"use strict";var i=t.exports=e(35);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(20),i.decoder=e(25),i.verifier=e(26),i.converter=e(27),i.ReflectionObject=e(6),i.Namespace=e(8),i.Root=e(29),i.Enum=e(5),i.Type=e(21),i.Field=e(7),i.OneOf=e(10),i.MapField=e(22),i.Service=e(23),i.Method=e(24),i.Message=e(14),i.wrappers=e(28),i.types=e(9),i.util=e(2),i.ReflectionObject.T(i.Root),i.Namespace.T(i.Type,i.Service,i.Enum),i.Root.T(i.Type),i.Field.T(i.Type)},function(t,n,e){"use strict";var i=n;function r(){i.util.T(),i.Writer.T(i.BufferWriter),i.Reader.T(i.BufferReader)}i.build="minimal",i.Writer=e(12),i.BufferWriter=e(42),i.Reader=e(13),i.BufferReader=e(43),i.util=e(4),i.rpc=e(18),i.roots=e(19),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 c=new Array(64),u=new Array(123),i=0;i<64;)u[c[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++]=c[u>>2],i=(3&u)<<4,a=1;break;case 1:o[s++]=c[i|u>>4],i=(15&u)<<2,a=2;break;case 2:o[s++]=c[i|u>>6],o[s++]=c[63&u],a=0}8191<s&&((r=r||[]).push(String.fromCharCode.apply(String,o)),s=0)}return a&&(o[s++]=c[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 h="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(h);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(h);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._t={}}(t.exports=i).prototype.on=function(t,n,e){return(this._t[t]||(this._t[t]=[])).push({fn:n,ctx:e||this}),this},i.prototype.off=function(t,n){if(void 0===t)this._t={};else if(void 0===n)this._t[t]=[];else for(var e=this._t[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._t[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|(t=Math.floor(Math.log(n)/Math.LN2))+127<<23|8388607&Math.round(n*Math.pow(2,-t)*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,c,h,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),t=t(i,r+e),i=2*(t>>31)+1,r=t>>>20&2047,e=4294967296*(1048575&t)+n;return 2047==r?e?NaN:1/0*i:0==r?5e-324*i*e:i*Math.pow(2,r-1075)*(e+4503599627370496)}function v(t,n,e){c[0]=t,n[e]=h[0],n[e+1]=h[1],n[e+2]=h[2],n[e+3]=h[3],n[e+4]=h[4],n[e+5]=h[5],n[e+6]=h[6],n[e+7]=h[7]}function p(t,n,e){c[0]=t,n[e]=h[7],n[e+1]=h[6],n[e+2]=h[5],n[e+3]=h[4],n[e+4]=h[3],n[e+5]=h[2],n[e+6]=h[1],n[e+7]=h[0]}function m(t,n){return h[0]=t[n],h[1]=t[n+1],h[2]=t[n+2],h[3]=t[n+3],h[4]=t[n+4],h[5]=t[n+5],h[6]=t[n+6],h[7]=t[n+7],c[0]}function y(t,n){return h[7]=t[n],h[6]=t[n+1],h[5]=t[n+2],h[4]=t[n+3],h[3]=t[n+4],h[2]=t[n+5],h[1]=t[n+6],h[0]=t[n+7],c[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,b),t.writeFloatBE=n.bind(null,g),t.readFloatLE=e.bind(null,_),t.readFloatBE=e.bind(null,w)),"undefined"!=typeof Float64Array?(c=new Float64Array([-0]),h=new Uint8Array(c.buffer),f=128===h[7],t.writeDoubleLE=f?v:p,t.writeDoubleBE=f?p:v,t.readDoubleLE=f?m:y,t.readDoubleBE=f?y:m):(t.writeDoubleLE=l.bind(null,b,0,4),t.writeDoubleBE=l.bind(null,g,4,0),t.readDoubleLE=d.bind(null,_,0,4),t.readDoubleBE=d.bind(null,w,4,0)),t}function b(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 g(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 _(t,n){return(t[n]|t[n+1]<<8|t[n+2]<<16|t[n+3]<<24)>>>0}function w(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(4);function r(t,n){this.lo=t>>>0,this.hi=n>>>0}var o=r.zero=new r(0,0),s=(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){var n,e;return 0===t?o:(e=(t=(n=t<0)?-t:t)>>>0,t=(t-e)/4294967296>>>0,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){var n;return!t&&this.hi>>>31?(t=1+~this.lo>>>0,n=~this.hi>>>0,-(t+4294967296*(n=t?n:n+1>>>0))):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)}},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(12),r=((o.prototype=Object.create(i.prototype)).constructor=o,e(4));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.T=function(){o.alloc=r.S,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._(t,"base64"):t).length>>>0;return this.uint32(n),n&&this.R(o.writeBytesBuffer,n,t),this},o.prototype.string=function(t){var n=r.Buffer.byteLength(t);return this.uint32(n),n&&this.R(s,n,t),this},o.T()},function(t,n,e){"use strict";t.exports=o;var i=e(13),r=((o.prototype=Object.create(i.prototype)).constructor=o,e(4));function o(t){i.call(this,t)}o.T=function(){r.Buffer&&(o.prototype.N=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.T()},function(t,n,e){"use strict";t.exports=i;var a=e(4);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){s.emit("error",t,e),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 c(t){if("string"!=typeof t){var n="return "+h();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),c}function h(t){return"function "+(t||e||"")+"("+(n&&n.join(",")||"")+"){\n  "+u.join("\n  ")+"\n}"}return c.toString=h,c}(t.exports=i).verbose=!1},function(t,n,e){"use strict";t.exports=a;var o=e(16),s=e(17)("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 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?t:i(t)).replace(/(?:\/|^)[^/]+$/,"")).length?i(t+"/"+n):n}},function(r,s,t){"use strict";t.r(s);for(var h={},_=(t.r(h),t.d(h,"ShadowMaterial",function(){return W0}),t.d(h,"SpriteMaterial",function(){return Dl}),t.d(h,"RawShaderMaterial",function(){return Ul}),t.d(h,"ShaderMaterial",function(){return Ea}),t.d(h,"PointsMaterial",function(){return Y0}),t.d(h,"MeshPhysicalMaterial",function(){return Z0}),t.d(h,"MeshStandardMaterial",function(){return Q0}),t.d(h,"MeshPhongMaterial",function(){return q0}),t.d(h,"MeshToonMaterial",function(){return K0}),t.d(h,"MeshNormalMaterial",function(){return J0}),t.d(h,"MeshLambertMaterial",function(){return $0}),t.d(h,"MeshDepthMaterial",function(){return Hc}),t.d(h,"MeshDistanceMaterial",function(){return Xc}),t.d(h,"MeshBasicMaterial",function(){return Ia}),t.d(h,"MeshMatcapMaterial",function(){return td}),t.d(h,"LineDashedMaterial",function(){return nd}),t.d(h,"LineBasicMaterial",function(){return kl}),t.d(h,"Material",function(){return f}),{wt:!0}),S="v3.1.5",T=108,A=[],M=0;M<256;M++)A[M]=(M<16?"0":"")+M.toString(16);var St={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(A[255&t]+A[t>>8&255]+A[t>>16&255]+A[t>>24&255]+"-"+A[255&n]+A[n>>8&255]+"-"+A[n>>16&15|64]+A[n>>24&255]+"-"+A[63&e|128]+A[e>>8&255]+"-"+A[e>>16&255]+A[e>>24&255]+A[255&i]+A[i>>8&255]+A[i>>16&255]+A[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*St.DEG2RAD},radToDeg:function(t){return t*St.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),e=s(e/2),u=o((n+i)/2),c=s((n+i)/2),h=o((n-i)/2),f=s((n-i)/2),o=o((i-n)/2),s=s((i-n)/2);"XYX"===r?t.set(a*c,e*h,e*f,a*u):"YZY"===r?t.set(e*f,a*c,e*h,a*u):"ZXZ"===r?t.set(e*h,e*f,a*c,a*u):"XZX"===r?t.set(a*c,e*s,e*o,a*u):"YXY"===r?t.set(e*o,a*c,e*s,a*u):"ZYZ"===r?t.set(e*s,e*o,a*c,a*u):console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order.")}};function at(t,n,e,i){this.xt=t||0,this.Et=n||0,this.St=e||0,this.Tt=void 0!==i?i:1}Object.assign(at,{slerp:function(t,n,e,i){return e.copy(t).slerp(n,i)},slerpFlat:function(t,n,e,i,r,o,s){var a,u,c,h=e[i+0],f=e[i+1],l=e[i+2],e=e[i+3],i=r[o+0],d=r[o+1],v=r[o+2],r=r[o+3];e===r&&h===i&&f===d&&l===v||(o=1-s,a=0<=(u=h*i+f*d+l*v+e*r)?1:-1,(c=1-u*u)>Number.EPSILON&&(c=Math.sqrt(c),u=Math.atan2(c,u*a),o=Math.sin(o*u)/c,s=Math.sin(s*u)/c),h=h*o+i*(u=s*a),f=f*o+d*u,l=l*o+v*u,e=e*o+r*u,o===1-s&&(h*=c=1/Math.sqrt(h*h+f*f+l*l+e*e),f*=c,l*=c,e*=c)),t[n]=h,t[n+1]=f,t[n+2]=l,t[n+3]=e}}),Object.defineProperties(at.prototype,{x:{get:function(){return this.xt},set:function(t){this.xt=t,this.At()}},y:{get:function(){return this.Et},set:function(t){this.Et=t,this.At()}},z:{get:function(){return this.St},set:function(t){this.St=t,this.At()}},w:{get:function(){return this.Tt},set:function(t){this.Tt=t,this.At()}}}),Object.assign(at.prototype,{isQuaternion:!0,set:function(t,n,e,i){return this.xt=t,this.Et=n,this.St=e,this.Tt=i,this.At(),this},clone:function(){return new this.constructor(this.xt,this.Et,this.St,this.Tt)},copy:function(t){return this.xt=t.x,this.Et=t.y,this.St=t.z,this.Tt=t.w,this.At(),this},setFromEuler:function(t,n){var e,i,r,o,s,a,u;if(t&&t.isEuler)return s=t.xt,a=t.Et,e=t.St,t=t.order,o=Math.cos,u=Math.sin,i=o(s/2),r=o(a/2),o=o(e/2),s=u(s/2),a=u(a/2),u=u(e/2),"XYZ"===t?(this.xt=s*r*o+i*a*u,this.Et=i*a*o-s*r*u,this.St=i*r*u+s*a*o,this.Tt=i*r*o-s*a*u):"YXZ"===t?(this.xt=s*r*o+i*a*u,this.Et=i*a*o-s*r*u,this.St=i*r*u-s*a*o,this.Tt=i*r*o+s*a*u):"ZXY"===t?(this.xt=s*r*o-i*a*u,this.Et=i*a*o+s*r*u,this.St=i*r*u+s*a*o,this.Tt=i*r*o-s*a*u):"ZYX"===t?(this.xt=s*r*o-i*a*u,this.Et=i*a*o+s*r*u,this.St=i*r*u-s*a*o,this.Tt=i*r*o+s*a*u):"YZX"===t?(this.xt=s*r*o+i*a*u,this.Et=i*a*o+s*r*u,this.St=i*r*u-s*a*o,this.Tt=i*r*o-s*a*u):"XZY"===t&&(this.xt=s*r*o-i*a*u,this.Et=i*a*o-s*r*u,this.St=i*r*u+s*a*o,this.Tt=i*r*o+s*a*u),!1!==n&&this.At(),this;throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.")},setFromAxisAngle:function(t,n){var n=n/2,e=Math.sin(n);return this.xt=t.x*e,this.Et=t.y*e,this.St=t.z*e,this.Tt=Math.cos(n),this.At(),this},setFromRotationMatrix:function(t){var n,t=t.elements,e=t[0],i=t[4],r=t[8],o=t[1],s=t[5],a=t[9],u=t[2],c=t[6],t=t[10],h=e+s+t;return 0<h?(n=.5/Math.sqrt(h+1),this.Tt=.25/n,this.xt=(c-a)*n,this.Et=(r-u)*n,this.St=(o-i)*n):s<e&&t<e?(n=2*Math.sqrt(1+e-s-t),this.Tt=(c-a)/n,this.xt=.25*n,this.Et=(i+o)/n,this.St=(r+u)/n):t<s?(n=2*Math.sqrt(1+s-e-t),this.Tt=(r-u)/n,this.xt=(i+o)/n,this.Et=.25*n,this.St=(a+c)/n):(n=2*Math.sqrt(1+t-e-s),this.Tt=(o-i)/n,this.xt=(r+u)/n,this.Et=(a+c)/n,this.St=.25*n),this.At(),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.xt=-t.y,this.Et=t.x,this.St=0):(this.xt=0,this.Et=-t.z,this.St=t.y)):(this.xt=t.y*n.z-t.z*n.y,this.Et=t.z*n.x-t.x*n.z,this.St=t.x*n.y-t.y*n.x),this.Tt=e,this.normalize()},angleTo:function(t){return 2*Math.acos(Math.abs(St.clamp(this.dot(t),-1,1)))},rotateTowards:function(t,n){var e=this.angleTo(t);return 0!==e&&(n=Math.min(1,n/e),this.slerp(t,n)),this},inverse:function(){return this.conjugate()},conjugate:function(){return this.xt*=-1,this.Et*=-1,this.St*=-1,this.At(),this},dot:function(t){return this.xt*t.xt+this.Et*t.Et+this.St*t.St+this.Tt*t.Tt},lengthSq:function(){return this.xt*this.xt+this.Et*this.Et+this.St*this.St+this.Tt*this.Tt},length:function(){return Math.sqrt(this.xt*this.xt+this.Et*this.Et+this.St*this.St+this.Tt*this.Tt)},normalize:function(){var t=this.length();return 0===t?(this.xt=0,this.Et=0,this.St=0,this.Tt=1):(this.xt=this.xt*(t=1/t),this.Et=this.Et*t,this.St=this.St*t,this.Tt=this.Tt*t),this.At(),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.xt,i=t.Et,r=t.St,t=t.Tt,o=n.xt,s=n.Et,a=n.St,n=n.Tt;return this.xt=e*n+t*o+i*a-r*s,this.Et=i*n+t*s+r*o-e*a,this.St=r*n+t*a+e*s-i*o,this.Tt=t*n-e*o-i*s-r*a,this.At(),this},slerp:function(t,n){if(0!==n){if(1===n)return this.copy(t);var e,i=this.xt,r=this.Et,o=this.St,s=this.Tt,a=s*t.Tt+i*t.xt+r*t.Et+o*t.St;a<0?(this.Tt=-t.Tt,this.xt=-t.xt,this.Et=-t.Et,this.St=-t.St,a=-a):this.copy(t),1<=a?(this.Tt=s,this.xt=i,this.Et=r,this.St=o):((t=1-a*a)<=Number.EPSILON?(this.Tt=(e=1-n)*s+n*this.Tt,this.xt=e*i+n*this.xt,this.Et=e*r+n*this.Et,this.St=e*o+n*this.St,this.normalize()):(e=Math.sqrt(t),t=Math.atan2(e,a),a=Math.sin((1-n)*t)/e,n=Math.sin(n*t)/e,this.Tt=s*a+this.Tt*n,this.xt=i*a+this.xt*n,this.Et=r*a+this.Et*n,this.St=o*a+this.St*n),this.At())}return this},equals:function(t){return t.xt===this.xt&&t.Et===this.Et&&t.St===this.St&&t.Tt===this.Tt},fromArray:function(t,n){return this.xt=t[n=void 0===n?0:n],this.Et=t[n+1],this.St=t[n+2],this.Tt=t[n+3],this.At(),this},toArray:function(t,n){return(t=void 0===t?[]:t)[n=void 0===n?0:n]=this.xt,t[n+1]=this.Et,t[n+2]=this.St,t[n+3]=this.Tt,t},fromBufferAttribute:function(t,n){return this.xt=t.getX(n),this.Et=t.getY(n),this.St=t.getZ(n),this.Tt=t.getW(n),this},Mt:function(t){return this.At=t,this},At:function(){}});var O=new Tt,L=new at;function Tt(t,n,e){this.x=t||0,this.y=n||0,this.z=e||0}Object.assign(Tt.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(L.setFromEuler(t))},applyAxisAngle:function(t,n){return this.applyQuaternion(L.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,t=t.elements,r=1/(t[3]*n+t[7]*e+t[11]*i+t[15]);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},applyQuaternion:function(t){var n=this.x,e=this.y,i=this.z,r=t.x,o=t.y,s=t.z,t=t.w,a=t*n+o*i-s*e,u=t*e+s*n-r*i,c=t*i+r*e-o*n,n=-r*n-o*e-s*i;return this.x=a*t+n*-r+u*-s-c*-o,this.y=u*t+n*-o+c*-r-a*-s,this.z=c*t+n*-s+a*-o-u*-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,t=t.z,r=n.x,o=n.y,n=n.z;return this.x=i*n-t*o,this.y=t*r-e*n,this.z=e*o-i*r,this},projectOnVector:function(t){var n=t.lengthSq();return 0===n?this.set(0,0,0):(n=t.dot(this)/n,this.copy(t).multiplyScalar(n))},projectOnPlane:function(t){return O.copy(this).projectOnVector(t),this.sub(O)},reflect:function(t){return this.sub(O.copy(t).multiplyScalar(2*this.dot(t)))},angleTo:function(t){var n=Math.sqrt(this.lengthSq()*t.lengthSq());return 0===n?Math.PI/2:(t=this.dot(t)/n,Math.acos(St.clamp(t,-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 N=new Tt,F=new At,j=new Tt(0,0,0),C=new Tt(1,1,1),D=new Tt,k=new Tt,X=new Tt;function At(){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 V(){}Object.assign(At.prototype,{isMatrix4:!0,set:function(t,n,e,i,r,o,s,a,u,c,h,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]=c,m[10]=h,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 At).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/N.setFromMatrixColumn(t,0).length(),r=1/N.setFromMatrixColumn(t,1).length(),t=1/N.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,c,h,f,l,d=this.elements,v=t.x,p=t.y,m=t.z,y=Math.cos(v),v=Math.sin(v),b=Math.cos(p),p=Math.sin(p),g=Math.cos(m),m=Math.sin(m);return"XYZ"===t.order?(o=y*g,s=y*m,a=v*g,u=v*m,d[0]=b*g,d[4]=-b*m,d[8]=p,d[1]=s+a*p,d[5]=o-u*p,d[9]=-v*b,d[2]=u-o*p,d[6]=a+s*p,d[10]=y*b):"YXZ"===t.order?(e=b*m,i=p*g,d[0]=(n=b*g)+(r=p*m)*v,d[4]=i*v-e,d[8]=y*p,d[1]=y*m,d[5]=y*g,d[9]=-v,d[2]=e*v-i,d[6]=r+n*v,d[10]=y*b):"ZXY"===t.order?(e=b*m,i=p*g,d[0]=(n=b*g)-(r=p*m)*v,d[4]=-y*m,d[8]=i+e*v,d[1]=e+i*v,d[5]=y*g,d[9]=r-n*v,d[2]=-y*p,d[6]=v,d[10]=y*b):"ZYX"===t.order?(o=y*g,s=y*m,a=v*g,u=v*m,d[0]=b*g,d[4]=a*p-s,d[8]=o*p+u,d[1]=b*m,d[5]=u*p+o,d[9]=s*p-a,d[2]=-p,d[6]=v*b,d[10]=y*b):"YZX"===t.order?(c=y*b,h=y*p,f=v*b,l=v*p,d[0]=b*g,d[4]=l-c*m,d[8]=f*m+h,d[1]=m,d[5]=y*g,d[9]=-v*g,d[2]=-p*g,d[6]=h*m+f,d[10]=c-l*m):"XZY"===t.order&&(c=y*b,h=y*p,f=v*b,l=v*p,d[0]=b*g,d[4]=-m,d[8]=p*g,d[1]=c*m+l,d[5]=y*g,d[9]=h*m-f,d[2]=f*m-h,d[6]=v*g,d[10]=l*m+c),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(j,t,C)},lookAt:function(t,n,e){var i=this.elements;return X.subVectors(t,n),0===X.lengthSq()&&(X.z=1),X.normalize(),D.crossVectors(e,X),0===D.lengthSq()&&(1===Math.abs(e.z)?X.x+=1e-4:X.z+=1e-4,X.normalize(),D.crossVectors(e,X)),D.normalize(),k.crossVectors(X,D),i[0]=D.x,i[4]=k.x,i[8]=X.x,i[1]=D.y,i[5]=k.y,i[9]=X.y,i[2]=D.z,i[6]=k.z,i[10]=X.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 t=t.elements,n=n.elements,e=this.elements,i=t[0],r=t[4],o=t[8],s=t[12],a=t[1],u=t[5],c=t[9],h=t[13],f=t[2],l=t[6],d=t[10],v=t[14],p=t[3],m=t[7],y=t[11],t=t[15],b=n[0],g=n[4],_=n[8],w=n[12],x=n[1],E=n[5],S=n[9],T=n[13],A=n[2],M=n[6],O=n[10],L=n[14],R=n[3],N=n[7],P=n[11],n=n[15];return e[0]=i*b+r*x+o*A+s*R,e[4]=i*g+r*E+o*M+s*N,e[8]=i*_+r*S+o*O+s*P,e[12]=i*w+r*T+o*L+s*n,e[1]=a*b+u*x+c*A+h*R,e[5]=a*g+u*E+c*M+h*N,e[9]=a*_+u*S+c*O+h*P,e[13]=a*w+u*T+c*L+h*n,e[2]=f*b+l*x+d*A+v*R,e[6]=f*g+l*E+d*M+v*N,e[10]=f*_+l*S+d*O+v*P,e[14]=f*w+l*T+d*L+v*n,e[3]=p*b+m*x+y*A+t*R,e[7]=p*g+m*E+y*M+t*N,e[11]=p*_+m*S+y*O+t*P,e[15]=p*w+m*T+y*L+t*n,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],c=t[2],h=t[6],f=t[10],l=t[14];return t[3]*(+r*a*h-i*u*h-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*c-r*a*c)+t[11]*(+n*u*h-n*s*l-r*o*h+e*o*l+r*s*c-e*u*c)+t[15]*(-i*s*c-n*a*h+n*s*f+i*o*h-e*o*f+e*a*c)},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 n=this.elements,t=t.elements,e=t[0],i=t[1],r=t[2],o=t[3],s=t[4],a=t[5],u=t[6],c=t[7],h=t[8],f=t[9],l=t[10],d=t[11],v=t[12],p=t[13],m=t[14],t=t[15],y=f*m*c-p*l*c+p*u*d-a*m*d-f*u*t+a*l*t,b=v*l*c-h*m*c-v*u*d+s*m*d+h*u*t-s*l*t,g=h*p*c-v*f*c+v*a*d-s*p*d-h*a*t+s*f*t,_=v*f*u-h*p*u-v*a*l+s*p*l+h*a*m-s*f*m,w=e*y+i*b+r*g+o*_;return 0==w?this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0):(n[0]=y*(y=1/w),n[1]=(p*l*o-f*m*o-p*r*d+i*m*d+f*r*t-i*l*t)*y,n[2]=(a*m*o-p*u*o+p*r*c-i*m*c-a*r*t+i*u*t)*y,n[3]=(f*u*o-a*l*o-f*r*c+i*l*c+a*r*d-i*u*d)*y,n[4]=b*y,n[5]=(h*m*o-v*l*o+v*r*d-e*m*d-h*r*t+e*l*t)*y,n[6]=(v*u*o-s*m*o-v*r*c+e*m*c+s*r*t-e*u*t)*y,n[7]=(s*l*o-h*u*o+h*r*c-e*l*c-s*r*d+e*u*d)*y,n[8]=g*y,n[9]=(v*f*o-h*p*o-v*i*d+e*p*d+h*i*t-e*f*t)*y,n[10]=(s*p*o-v*a*o+v*i*c-e*p*c-s*i*t+e*a*t)*y,n[11]=(h*a*o-s*f*o-h*i*c+e*f*c+s*i*d-e*a*d)*y,n[12]=_*y,n[13]=(h*p*r-v*f*r+v*i*l-e*p*l-h*i*m+e*f*m)*y,n[14]=(v*a*r-s*p*r-v*i*u+e*p*u+s*i*m-e*a*m)*y,n[15]=(s*f*r-h*a*r+h*i*u-e*f*u-s*i*l+e*a*l)*y,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],c=t[8],h=t[9],f=t[10],l=t[11],d=t[12],v=t[13],p=t[14],m=t[15],y=h*p*u-v*f*u+v*a*l-s*p*l-h*a*m+s*f*m,b=d*f*u-c*p*u-d*a*l+o*p*l+c*a*m-o*f*m,g=c*v*u-d*h*u+d*s*l-o*v*l-c*s*m+o*h*m,_=d*h*a-c*v*a-d*s*f+o*v*f+c*s*p-o*h*p,w=n*y+e*b+i*g+r*_;return 0==w?this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0):(t[0]=y*(y=1/w),t[1]=(v*f*r-h*p*r-v*i*l+e*p*l+h*i*m-e*f*m)*y,t[2]=(s*p*r-v*a*r+v*i*u-e*p*u-s*i*m+e*a*m)*y,t[3]=(h*a*r-s*f*r-h*i*u+e*f*u+s*i*l-e*a*l)*y,t[4]=b*y,t[5]=(c*p*r-d*f*r+d*i*l-n*p*l-c*i*m+n*f*m)*y,t[6]=(d*a*r-o*p*r-d*i*u+n*p*u+o*i*m-n*a*m)*y,t[7]=(o*f*r-c*a*r+c*i*u-n*f*u-o*i*l+n*a*l)*y,t[8]=g*y,t[9]=(d*h*r-c*v*r-d*e*l+n*v*l+c*e*m-n*h*m)*y,t[10]=(o*v*r-d*s*r+d*e*u-n*v*u-o*e*m+n*s*m)*y,t[11]=(c*s*r-o*h*r-c*e*u+n*h*u+o*e*l-n*s*l)*y,t[12]=_*y,t[13]=(c*v*i-d*h*i+d*e*f-n*v*f-c*e*p+n*h*p)*y,t[14]=(d*s*i-o*v*i-d*e*a+n*v*a+o*e*p-n*s*p)*y,t[15]=(o*h*i-c*s*i+c*e*a-n*h*a-o*e*f+n*s*f)*y,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),n=Math.sin(n),i=1-e,r=t.x,o=t.y,t=t.z,s=i*r,a=i*o;return this.set(s*r+e,s*o-n*t,s*t+n*o,0,s*o+n*t,a*o+e,a*t-n*r,0,s*t-n*o,a*t+n*r,i*t*t+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.xt,o=n.Et,s=n.St,n=n.Tt,a=r+r,u=o+o,c=s+s,h=r*a,f=r*u,r=r*c,l=o*u,o=o*c,s=s*c,a=n*a,u=n*u,n=n*c,c=e.x,d=e.y,e=e.z;return i[0]=(1-(l+s))*c,i[1]=(f+n)*c,i[2]=(r-u)*c,i[3]=0,i[4]=(f-n)*d,i[5]=(1-(h+s))*d,i[6]=(o+a)*d,i[7]=0,i[8]=(r+u)*e,i[9]=(o-a)*e,i[10]=(1-(h+l))*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=N.set(i[0],i[1],i[2]).length(),o=N.set(i[4],i[5],i[6]).length(),s=N.set(i[8],i[9],i[10]).length(),t=(this.determinant()<0&&(r=-r),t.x=i[12],t.y=i[13],t.z=i[14],F.copy(this),1/r),i=1/o,a=1/s;return F.elements[0]*=t,F.elements[1]*=t,F.elements[2]*=t,F.elements[4]*=i,F.elements[5]*=i,F.elements[6]*=i,F.elements[8]*=a,F.elements[9]*=a,F.elements[10]*=a,n.setFromRotationMatrix(F),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),c=1/(o-r),n=(n+t)*a,t=(e+i)*u,e=(o+r)*c;return s[0]=2*a,s[4]=0,s[8]=0,s[12]=-n,s[1]=0,s[5]=2*u,s[9]=0,s[13]=-t,s[2]=0,s[6]=0,s[10]=-2*c,s[14]=-e,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(V.prototype,{addEventListener:function(t,n){void 0===this._t&&(this._t={});var e=this._t;void 0===e[t]&&(e[t]=[]),-1===e[t].indexOf(n)&&e[t].push(n)},hasEventListener:function(t,n){var e;return void 0!==this._t&&void 0!==(e=this._t)[t]&&-1!==e[t].indexOf(n)},removeEventListener:function(t,n){var e;void 0!==this._t&&void 0!==(t=this._t[t])&&-1!==(e=t.indexOf(n))&&t.splice(e,1)},dispatchEvent:function(t){if(void 0!==this._t){var n=this._t[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 W=new At,Y=new at;function Q(t,n,e,i){this.xt=t||0,this.Et=n||0,this.St=e||0,this.Ot=i||Q.DefaultOrder}function Z(){this.mask=1}function q(){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.")}Q.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],Q.DefaultOrder="XYZ",Object.defineProperties(Q.prototype,{x:{get:function(){return this.xt},set:function(t){this.xt=t,this.At()}},y:{get:function(){return this.Et},set:function(t){this.Et=t,this.At()}},z:{get:function(){return this.St},set:function(t){this.St=t,this.At()}},order:{get:function(){return this.Ot},set:function(t){this.Ot=t,this.At()}}}),Object.assign(Q.prototype,{isEuler:!0,set:function(t,n,e,i){return this.xt=t,this.Et=n,this.St=e,this.Ot=i||this.Ot,this.At(),this},clone:function(){return new this.constructor(this.xt,this.Et,this.St,this.Ot)},copy:function(t){return this.xt=t.xt,this.Et=t.Et,this.St=t.St,this.Ot=t.Ot,this.At(),this},setFromRotationMatrix:function(t,n,e){var i=St.clamp,t=t.elements,r=t[0],o=t[4],s=t[8],a=t[1],u=t[5],c=t[9],h=t[2],f=t[6],t=t[10];return"XYZ"===(n=n||this.Ot)?(this.Et=Math.asin(i(s,-1,1)),Math.abs(s)<.9999999?(this.xt=Math.atan2(-c,t),this.St=Math.atan2(-o,r)):(this.xt=Math.atan2(f,u),this.St=0)):"YXZ"===n?(this.xt=Math.asin(-i(c,-1,1)),Math.abs(c)<.9999999?(this.Et=Math.atan2(s,t),this.St=Math.atan2(a,u)):(this.Et=Math.atan2(-h,r),this.St=0)):"ZXY"===n?(this.xt=Math.asin(i(f,-1,1)),Math.abs(f)<.9999999?(this.Et=Math.atan2(-h,t),this.St=Math.atan2(-o,u)):(this.Et=0,this.St=Math.atan2(a,r))):"ZYX"===n?(this.Et=Math.asin(-i(h,-1,1)),Math.abs(h)<.9999999?(this.xt=Math.atan2(f,t),this.St=Math.atan2(a,r)):(this.xt=0,this.St=Math.atan2(-o,u))):"YZX"===n?(this.St=Math.asin(i(a,-1,1)),Math.abs(a)<.9999999?(this.xt=Math.atan2(-c,u),this.Et=Math.atan2(-h,r)):(this.xt=0,this.Et=Math.atan2(s,t))):"XZY"===n?(this.St=Math.asin(-i(o,-1,1)),Math.abs(o)<.9999999?(this.xt=Math.atan2(f,u),this.Et=Math.atan2(s,r)):(this.xt=Math.atan2(-c,t),this.Et=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+n),this.Ot=n,!1!==e&&this.At(),this},setFromQuaternion:function(t,n,e){return W.makeRotationFromQuaternion(t),this.setFromRotationMatrix(W,n,e)},setFromVector3:function(t,n){return this.set(t.x,t.y,t.z,n||this.Ot)},reorder:function(t){return Y.setFromEuler(this),this.setFromQuaternion(Y,t)},equals:function(t){return t.xt===this.xt&&t.Et===this.Et&&t.St===this.St&&t.Ot===this.Ot},fromArray:function(t){return this.xt=t[0],this.Et=t[1],this.St=t[2],void 0!==t[3]&&(this.Ot=t[3]),this.At(),this},toArray:function(t,n){return(t=void 0===t?[]:t)[n=void 0===n?0:n]=this.xt,t[n+1]=this.Et,t[n+2]=this.St,t[n+3]=this.Ot,t},toVector3:function(t){return t?t.set(this.xt,this.Et,this.St):new Tt(this.xt,this.Et,this.St)},Mt:function(t){return this.At=t,this},At:function(){}}),Object.assign(Z.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(q.prototype,{isMatrix3:!0,set:function(t,n,e,i,r,o,s,a,u){var c=this.elements;return c[0]=t,c[1]=i,c[2]=s,c[3]=n,c[4]=r,c[5]=a,c[6]=e,c[7]=o,c[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 t=t.elements,n=n.elements,e=this.elements,i=t[0],r=t[3],o=t[6],s=t[1],a=t[4],u=t[7],c=t[2],h=t[5],t=t[8],f=n[0],l=n[3],d=n[6],v=n[1],p=n[4],m=n[7],y=n[2],b=n[5],n=n[8];return e[0]=i*f+r*v+o*y,e[3]=i*l+r*p+o*b,e[6]=i*d+r*m+o*n,e[1]=s*f+a*v+u*y,e[4]=s*l+a*p+u*b,e[7]=s*d+a*m+u*n,e[2]=c*f+h*v+t*y,e[5]=c*l+h*p+t*b,e[8]=c*d+h*m+t*n,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 n=t.elements,t=this.elements,e=n[0],i=n[1],r=n[2],o=n[3],s=n[4],a=n[5],u=n[6],c=n[7],n=n[8],h=n*s-a*c,f=a*u-n*o,l=c*o-s*u,d=e*h+i*f+r*l;return 0==d?this.set(0,0,0,0,0,0,0,0,0):(t[0]=h*(h=1/d),t[1]=(r*c-n*i)*h,t[2]=(a*i-r*s)*h,t[3]=f*h,t[4]=(n*e-r*u)*h,t[5]=(r*o-a*e)*h,t[6]=l*h,t[7]=(i*u-c*e)*h,t[8]=(s*e-i*o)*h,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),t=Math.sin(t),e=this.elements,i=e[0],r=e[3],o=e[6],s=e[1],a=e[4],u=e[7];return e[0]=n*i+t*s,e[3]=n*r+t*a,e[6]=n*o+t*u,e[1]=-t*i+n*s,e[4]=-t*r+n*a,e[7]=-t*o+n*u,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 K=0,J=new Tt,$=new at,tt=new At,nt=new Tt,et=new Tt,it=new Tt,rt=new at,ot=new Tt(1,0,0),ut=new Tt(0,1,0),ct=new Tt(0,0,1),ht={type:"added"},ft={type:"removed"};function a(){Object.defineProperty(this,"id",{value:K++}),this.uuid=St.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=a.DefaultUp.clone();var t=new Tt,n=new Q,e=new at,i=new Tt(1,1,1);n.Mt(function(){e.setFromEuler(n,!1)}),e.Mt(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 At},normalMatrix:{value:new q}}),this.matrix=new At,this.matrixWorld=new At,this.matrixAutoUpdate=a.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new Z,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}}function dt(){a.call(this),this.type="Camera",this.matrixWorldInverse=new At,this.projectionMatrix=new At,this.projectionMatrixInverse=new At}function vt(t,n,e,i){dt.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 pt(t,n,e,i,r,o){dt.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()}a.DefaultUp=new Tt(0,1,0),a.DefaultMatrixAutoUpdate=!0,a.prototype=Object.assign(Object.create(V.prototype),{constructor:a,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 $.setFromAxisAngle(t,n),this.quaternion.multiply($),this},rotateOnWorldAxis:function(t,n){return $.setFromAxisAngle(t,n),this.quaternion.premultiply($),this},rotateX:function(t){return this.rotateOnAxis(ot,t)},rotateY:function(t){return this.rotateOnAxis(ut,t)},rotateZ:function(t){return this.rotateOnAxis(ct,t)},translateOnAxis:function(t,n){return J.copy(t).applyQuaternion(this.quaternion),this.position.add(J.multiplyScalar(n)),this},translateX:function(t){return this.translateOnAxis(ot,t)},translateY:function(t){return this.translateOnAxis(ut,t)},translateZ:function(t){return this.translateOnAxis(ct,t)},localToWorld:function(t){return t.applyMatrix4(this.matrixWorld)},worldToLocal:function(t){return t.applyMatrix4(tt.getInverse(this.matrixWorld))},lookAt:function(t,n,e){t.isVector3?nt.copy(t):nt.set(t,n,e);t=this.parent;this.updateWorldMatrix(!0,!1),et.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?tt.lookAt(et,nt,this.up):tt.lookAt(nt,et,this.up),this.quaternion.setFromRotationMatrix(tt),t&&(tt.extractRotation(t.matrixWorld),$.setFromRotationMatrix(tt),this.quaternion.premultiply($.inverse()))},add:function(t){if(1<arguments.length)for(var n=0;n<arguments.length;n++)this.add(arguments[n]);else 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(ht)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t);return this},remove:function(t){if(1<arguments.length)for(var n=0;n<arguments.length;n++)this.remove(arguments[n]);else{var e=this.children.indexOf(t);-1!==e&&(t.parent=null,this.children.splice(e,1),t.dispatchEvent(ft))}return this},attach:function(t){return this.updateWorldMatrix(!0,!1),tt.getInverse(this.matrixWorld),null!==t.parent&&(t.parent.updateWorldMatrix(!0,!1),tt.multiply(t.parent.matrixWorld)),t.applyMatrix4(tt),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 Tt),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 at),this.updateMatrixWorld(!0),this.matrixWorld.decompose(et,t,it),t},getWorldScale:function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldScale() target is now required"),t=new Tt),this.updateMatrixWorld(!0),this.matrixWorld.decompose(et,rt,t),t},getWorldDirection:function(t){void 0===t&&(console.warn("THREE.Object3D: .getWorldDirection() target is now required"),t=new Tt),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}}),dt.prototype=Object.assign(Object.create(a.prototype),{constructor:dt,isCamera:!0,copy:function(t,n){return a.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 Tt),this.updateMatrixWorld(!0);var n=this.matrixWorld.elements;return t.set(-n[8],-n[9],-n[10]).normalize()},updateMatrixWorld:function(t){a.prototype.updateMatrixWorld.call(this,t),this.matrixWorldInverse.getInverse(this.matrixWorld)},updateWorldMatrix:function(t,n){a.prototype.updateWorldMatrix.call(this,t,n),this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return(new this.constructor).copy(this)}}),vt.prototype=Object.assign(Object.create(dt.prototype),{constructor:vt,isPerspectiveCamera:!0,copy:function(t,n){return dt.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*St.RAD2DEG*Math.atan(t),this.updateProjectionMatrix()},getFocalLength:function(){var t=Math.tan(.5*St.DEG2RAD*this.fov);return.5*this.getFilmHeight()/t},getEffectiveFOV:function(){return 2*St.RAD2DEG*Math.atan(Math.tan(.5*St.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*St.DEG2RAD*this.fov)/this.zoom,i=2*e,r=this.aspect*i,o=-.5*r,s=this.view,a=(null!==this.view&&this.view.enabled&&(a=s.fullWidth,t=s.fullHeight,o+=s.offsetX*r/a,e-=s.offsetY*i/t,r*=s.width/a,i*=s.height/t),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)}}),pt.prototype=Object.assign(Object.create(dt.prototype),{constructor:pt,isOrthographicCamera:!0,copy:function(t,n){return dt.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,n=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,r=(this.top+this.bottom)/2,o=i-n,i=i+n,n=r+e,r=r-e;null!==this.view&&this.view.enabled&&(e=(this.right-this.left)/this.view.fullWidth/this.zoom,t=(this.top-this.bottom)/this.view.fullHeight/this.zoom,i=(o+=e*this.view.offsetX)+e*this.view.width,r=(n-=t*this.view.offsetY)-t*this.view.height),this.projectionMatrix.makeOrthographic(o,i,n,r,this.near,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)}});var mt=[new Tt,new Tt,new Tt,new Tt,new Tt,new Tt,new Tt,new Tt],yt=new Tt,bt=new It,gt=new Tt,_t=new Tt,wt=new Tt,xt=new Tt,Et=new Tt,Rt=new Tt,Nt=new Tt,Pt=new Tt,Ft=new Tt,jt=new Tt;function It(t,n){this.min=void 0!==t?t:new Tt(1/0,1/0,1/0),this.max=void 0!==n?n:new Tt(-1/0,-1/0,-1/0)}function Ct(t,n,e,i,r){for(var o=0,s=t.length-3;o<=s;o+=3){jt.fromArray(t,o);var a=r.x*Math.abs(jt.x)+r.y*Math.abs(jt.y)+r.z*Math.abs(jt.z),u=n.dot(jt),c=e.dot(jt),h=i.dot(jt);if(Math.max(-Math.max(u,c,h),Math.min(u,c,h))>a)return!1}return!0}Object.assign(It.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 c=t[a],h=t[a+1],f=t[a+2];c<n&&(n=c),h<e&&(e=h),f<i&&(i=f),r<c&&(r=c),o<h&&(o=h),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 c=t.getX(a),h=t.getY(a),f=t.getZ(a);c<n&&(n=c),h<e&&(e=h),f<i&&(i=f),r<c&&(r=c),o<h&&(o=h),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=yt.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 Tt),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 Tt),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);for(var n=t.geometry,e=(void 0!==n&&(null===n.boundingBox&&n.computeBoundingBox(),bt.copy(n.boundingBox),bt.applyMatrix4(t.matrixWorld),this.union(bt)),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 Tt),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,yt),yt.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){return!this.isEmpty()&&(this.getCenter(Nt),Pt.subVectors(this.max,Nt),gt.subVectors(t.a,Nt),_t.subVectors(t.b,Nt),wt.subVectors(t.c,Nt),xt.subVectors(_t,gt),Et.subVectors(wt,_t),Rt.subVectors(gt,wt),!!Ct([0,-xt.z,xt.y,0,-Et.z,Et.y,0,-Rt.z,Rt.y,xt.z,0,-xt.x,Et.z,0,-Et.x,Rt.z,0,-Rt.x,-xt.y,xt.x,0,-Et.y,Et.x,0,-Rt.y,Rt.x,0],gt,_t,wt,Pt))&&!!Ct([1,0,0,0,1,0,0,0,1],gt,_t,wt,Pt)&&(Ft.crossVectors(xt,Et),Ct([Ft.x,Ft.y,Ft.z],gt,_t,wt,Pt))},clampPoint:function(t,n){return void 0===n&&(console.warn("THREE.Box3: .clampPoint() target is now required"),n=new Tt),n.copy(t).clamp(this.min,this.max)},distanceToPoint:function(t){return yt.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(yt).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()||(mt[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),mt[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),mt[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),mt[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),mt[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),mt[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),mt[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),mt[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(mt)),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 Dt=new It;function kt(t,n){this.center=void 0!==t?t:new Tt,this.radius=void 0!==n?n:0}Object.assign(kt.prototype,{set:function(t,n){return this.center.copy(t),this.radius=n,this},setFromPoints:function(t,n){for(var e=this.center,i=(void 0!==n?e.copy(n):Dt.setFromPoints(t).getCenter(e),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 Tt),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 It),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 Ut=new Tt,Bt=new Tt,Gt=new q;function Ht(t,n){this.normal=void 0!==t?t:new Tt(1,0,0),this.constant=void 0!==n?n:0}Object.assign(Ht.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){e=Ut.subVectors(e,n).cross(Bt.subVectors(t,n)).normalize();return this.setFromNormalAndCoplanarPoint(e,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 Tt),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 Tt);var e=t.delta(Ut),i=this.normal.dot(e);return 0===i?0===this.distanceToPoint(t.start)?n.copy(t.start):void 0:(i=-(t.start.dot(this.normal)+this.constant)/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 Tt),t.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(t,n){n=n||Gt.getNormalMatrix(t),t=this.coplanarPoint(Ut).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 Xt=new kt,Vt=new Tt;function zt(t,n,e,i,r,o){this.planes=[void 0!==t?t:new Ht,void 0!==n?n:new Ht,void 0!==e?e:new Ht,void 0!==i?i:new Ht,void 0!==r?r:new Ht,void 0!==o?o:new Ht]}Object.assign(zt.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,t=t.elements,e=t[0],i=t[1],r=t[2],o=t[3],s=t[4],a=t[5],u=t[6],c=t[7],h=t[8],f=t[9],l=t[10],d=t[11],v=t[12],p=t[13],m=t[14],t=t[15];return n[0].setComponents(o-e,c-s,d-h,t-v).normalize(),n[1].setComponents(o+e,c+s,d+h,t+v).normalize(),n[2].setComponents(o+i,c+a,d+f,t+p).normalize(),n[3].setComponents(o-i,c-a,d-f,t-p).normalize(),n[4].setComponents(o-r,c-u,d-l,t-m).normalize(),n[5].setComponents(o+r,c+u,d+l,t+m).normalize(),this},intersectsObject:function(t){var n=t.geometry;return null===n.boundingSphere&&n.computeBoundingSphere(),Xt.copy(n.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(Xt)},intersectsSprite:function(t){return Xt.center.set(0,0,0),Xt.radius=.7071067811865476,Xt.applyMatrix4(t.matrixWorld),this.intersectsSphere(Xt)},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(Vt.x=(0<i.normal.x?t.max:t.min).x,Vt.y=(0<i.normal.y?t.max:t.min).y,Vt.z=(0<i.normal.z?t.max:t.min).z,i.distanceToPoint(Vt)<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 Wt=0,Yt=1,Qt=2,Zt=3,qt=0,Kt=1,Jt=2,$t=3,tn=0,nn=1,en=2,rn=1,on=3,sn=0,an=1,un=2,cn=0,hn=1,fn=2,ln=3,dn=4,vn=5,pn=100,mn=101,yn=102,bn=103,gn=104,_n=200,wn=201,xn=202,En=203,Sn=204,Tn=205,An=206,Mn=207,On=208,Ln=209,Rn=210,Nn=0,Pn=1,Fn=2,jn=3,In=4,Cn=5,Dn=6,kn=7,Un=0,Bn=0,Gn=306,Hn=307,Xn=1e3,Vn=1001,zn=1002,Wn=1003,Yn=1004,Qn=1005,Zn=1006,qn=1007,Kn=1008,Jn=1009,$n=1010,te=1011,ne=1012,ee=1013,ie=1014,re=1015,oe=1016,se=1017,ae=1018,ue=1019,ce=1020,he=1021,fe=1022,le=1023,de=1024,ve=1025,pe=1026,me=1027,ye=1028,be=1029,ge=1030,_e=1031,we=1032,xe=1033,Ee=33776,Se=33777,Te=33778,Ae=33779,Me=35840,Oe=35841,Le=35842,Re=35843,Ne=36196,Pe=37492,Fe=37496,je=37808,Ie=37809,Ce=37810,De=37811,ke=37812,Ue=37813,Be=37814,Ge=37815,He=37816,Xe=37817,Ve=37818,ze=37819,We=37820,Ye=37821,Qe=36492,Ze=37840,qe=37841,Ke=37842,Je=37843,$e=37844,ti=37845,ni=37846,ei=37847,ii=37848,ri=37849,oi=37850,si=37851,ai=37852,ui=37853,ci=2300,hi=2301,fi=2400,li=2401,di=3e3,vi=3200,pi=3201,mi=0,yi=1,bi=7680,gi=7681,_i=519,wi=35044,xi=.001;function Ei(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 Mt(t,n){this.x=t||0,this.y=n||0}Object.assign(Ei.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(St.clamp(n/this.radius,-1,1))),this}}),Object.defineProperties(Mt.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(Mt.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),n=Math.sin(n),i=this.x-t.x,r=this.y-t.y;return this.x=i*e-r*n+t.x,this.y=i*n+r*e+t.y,this}});var n={MODE_3D:2,MODE_2D:4},Si=(Object.freeze(n),n),n={NONE:0,EXTRUDE_MARKER:2,FM3DTILE_LAYER:4,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},E=(n.LAYER_NODE_TYPE=new Map,n.LAYER_NODE_TYPE.set(n.EXTENT_LAYER,n.EXTENT),n.LAYER_NODE_TYPE.set(n.EXTERNAL_MODEL_LAYER,n.EXTERNAL_MODEL),n.LAYER_NODE_TYPE.set(n.MODEL_LAYER,n.MODEL),n.LAYER_NODE_TYPE.set(n.FACILITY_LAYER,n.FACILITY),n.LAYER_NODE_TYPE.set(n.LABEL_LAYER,n.LABEL),n.LAYER_NODE_TYPE.set(n.DOM_MARKER,n.DOM_MARKER),n.LAYER_NODE_TYPE.set(n.DYNAMIC_MODEL_MARKER,n.DYNAMIC_MODEL_MARKER),n.LAYER_NODE_TYPE.set(n.EXTRUDE_MARKER,n.EXTRUDE_MARKER),n.LAYER_NODE_TYPE.set(n.HEAT_MAP_MARKER,n.HEAT_MAP_MARKER),n.LAYER_NODE_TYPE.set(n.LINE_MARKER,n.LINE_MARKER),n.LAYER_NODE_TYPE.set(n.LOCATION_MARKER,n.LOCATION_MARKER),n.LAYER_NODE_TYPE.set(n.POLYGON_MARKER,n.POLYGON_MARKER),n.LAYER_NODE_TYPE.set(n.TEXT_MARKER,n.TEXT_MARKER),n.LAYER_NODE_TYPE.set(n.IMAGE_MARKER,n.IMAGE_MARKER),n.LAYER_NODE_TYPE.set(n.FLOW_LINE_LAYER,n.FLOW_LINE_MARKER),n.LAYER_NODE_TYPE.set(n.FIRE_MARKER,n.FIRE_MARKER),n.LAYER_NODE_TYPE.set(n.WALL_MARKER,n.WALL_MARKER),n.LAYER_NODE_TYPE.set(n.TUBE_MARKER,n.TUBE_MARKER),n.LAYER_NODE_TYPE.set(n.LINE3D_MARKER,n.LINE3D_MARKER),n.LAYER_NODE_TYPE.set(n.SPHERE_MARKER,n.SPHERE_MARKER),n);function Ti(t){return function(t){if(Array.isArray(t))return Ai(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,n){var e;if(t)return"string"==typeof t?Ai(t,n):"Map"===(e="Object"===(e=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Ai(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 Ai(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 Mi(t){return(Mi="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 Oi(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}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,function(t){t=function(t,n){if("object"!=Mi(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Mi(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Mi(t)?t:t+""}(i.key),i)}}function Ri(t,n,e){return n&&Li(t.prototype,n),e&&Li(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}var Ni=function(){function f(){Oi(this,f)}return Ri(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 Tt(0,1,0),i=(new At).makeRotationAxis(e,n.getRotation()*Math.PI/180),r=f.getPointFromBound(t),o=[],s=0;s<r.length;s++){var a=(a=new Tt(r[s].x-n.x,0,n.y-r[s].y)).applyMatrix4(i);o.push(a)}for(var u=[],c=0;c<r.length;c++){var h=o[c];u.push({x:h.x+n.x,y:n.y-h.z})}return f.getBoundFromPoint(u)}}])}(),Pi=function(){function v(){Oi(this,v)}return Ri(v,null,[{key:"showFloorNode",value:function(t,n){for(var e=0;e<n.Lt.length;e++){var i=n.Lt[e];if(-1<t.getVisibleLevels().indexOf(n.level))for(var r=0;r<i.Lt.length;r++){var o=i.Lt[r];o.Rt||1!=o.visible||t.Pt.Nt.push([e,o])}}}},{key:"showAllNode",value:function(n){for(n.getLevels().forEach(function(t){v.showFloorNode(n,n.getFloor(t))});0<n.Pt.Nt.length;)n.Pt.Ft()}},{key:"recoveAllNode",value:function(t){t.enableUpdateNode(),t.Pt.jt()}},{key:"setVisibleLevelsFrustumCulled",value:function(t,n){for(var e=t.It,i=t.getVisibleLevels(),r=0;r<i.length;r++){var o=i[r]+"_"+E.LABEL,s=i[r]+"_"+E.FACILITY,a=i[r]+"_"+E.TEXT_MARKER,u=i[r]+"_"+E.IMAGE_MARKER,o=e.Ct.get(o),s=e.Ct.get(s),a=e.Ct.get(a),u=e.Ct.get(u),c=[];o&&o.children&&c.push.apply(c,Ti(o.children)),s&&s.children&&c.push.apply(c,Ti(s.children)),a&&a.children&&c.push.apply(c,Ti(a.children)),u&&u.children&&c.push.apply(c,Ti(u.children)),c.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.It.renderer,r=t.domElement.parentElement,o=t.domElement.clientWidth,s=t.domElement.clientHeight,a=document.createElement("canvas"),u=(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",a.getContext("2d")),c=new Image;c.onload=function(t){u.drawImage(t.path[0],0,0,o*i,s*i),r.append(a),n.kt.Dt({type:"printBefor"}),e()},c.onerror=function(t){console.warn("fail...",t)},n.It.render(),c.src=t.domElement.toDataURL()}},{key:"removeLastFrame",value:function(t){var n=t.It.renderer,e=document.querySelector(".exportImageLastFrame"),n=n.domElement.parentElement;n&&e&&n.removeChild(e),t.kt.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,t=t.cameraType,u=(a&&(v.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),u=r/a.size.x,c=o/a.size.y,a=Ni.getRotationBound(a,i),Math.abs(c-u)<.1)&&(r=a.size.x*u,o=a.size.y*c),v.setValue("mapZoom",i.getZoom(),n),v.setValue("cameraType",t||"2d",n),v.setValue("backCamera","2d"==n.cameraType?i.Ut:{aspect:i.Ut.aspect},n),r/o),c=(15e3<(o=15e3<r?+(r=15e3)/u:o)&&(r=(o=15e3)*u),e=e||0,e*=2,r=Math.ceil(r),o=Math.ceil(o),v.setValue("width",r,n),v.setValue("height",o,n),i.It.renderer.domElement.clientWidth),t=i.It.renderer.domElement.clientHeight,u=(v.setValue("defaultLogoAspact",c/t,n),v.setValue("domSize",{width:c,height:t},n),v.setValue("padding",e,n),v.setValue("callback",s,n),{width:r,height:o}),c=(4096<u.width&&(u.width=4096),4096<u.height&&(u.height=4096),v.setValue("viewParam",u,n),Math.ceil(r/n.viewParam.width)),t=Math.ceil(o/n.viewParam.height),s=(v.setValue("state",{col:c,row:t,loadCount:0},n),document.createElement("canvas"));s.width=r,s.height=o,s.style.width=r+"px",s.style.height=o+"px",v.setValue("canvas",s,n),"2d"==n.cameraType?(c=v.getCameraParame2d(i,r,o,a,e,void 0,n),v.setValue("camera",c,n),i.Ut=c):"3d"==n.cameraType&&v.setCameraParame3d(i,r,o,null,e,n),i.It.renderer.setPixelRatio(1),i.It.renderer.setSize(u.width,u.height),i.kt.Dt({type:"viewModeChanged"}),v.shot(i,s,n)}},{key:"print",value:function(t){v.addLastFrame(t.map,function(){v.start(t)})}},{key:"recoverParam",value:function(t,n){"2d"===n.cameraType?(t.Ut=v.getValue("backCamera",n),t.Bt=t.Ut):"3d"===n.cameraType&&(e=v.getValue("backCamera",n),t.Ut.aspect=e.aspect,t.Ut.clearViewOffset());var e=v.getValue("domSize",n),i=window.devicePixelRatio||1;t.It.renderer.setPixelRatio(i),t.It.renderer.setSize(e.width,e.height),t.kt.Dt({type:"viewModeChanged"}),v.recoveAllNode(t,n),v.setLogo(t,v.getValue("defaultLogoAspact",n)),t.Ht.Gt.object=t.Ut,v.setVisibleLevelsFrustumCulled(t,!0),t.It.Xt(),t.It.Vt=!0,t.It.renderer.clear(),t.It.render(),t.enableUpdateNode(),v.removeLastFrame(t)}},{key:"getCameraParame2d",value:function(t,n,e,i,r,o,s){var a,u,c,h,f=Math.min(n,e),o=o||(f-r)/f,r=t.getState(),f=i.min,i=i.max,l=Math.abs(i.x-f.x),i=Math.abs(i.y-f.y),f=n/e,n=(f<i/l?(c=-l/2,h=l/2,a=-l/f/2,u=l/f/2):(a=-i/2,u=i/2,c=-i*f/2,h=i*f/2),new pt(c,h,u,a,1,1e4));n.zoom=o,n.up=new Tt(0,1,0),n.rotation.x=-Math.PI/2,n.rotation.y=0,n.rotation.z=-r.rotation*Math.PI/180;e=t.getBound().center,l=v.getValue("originBound",s),i=(l.max.x+l.min.x)/2-e.x,f=(l.max.y+l.min.y)/2-e.y;return n.position.x=i,n.position.y=t.Ut.position.y,n.position.z=-f,n.updateProjectionMatrix(),n.updateMatrix(),n.updateMatrixWorld(),n.updateWorldMatrix(),n.matrixWorldNeedsUpdate=!0,n}},{key:"setCameraParame3d",value:function(t,n,e,i,r,o){t.Ut.aspect=n/e,v.setValue("camera",t.Ut,o)}},{key:"readPixcel",value:function(e,i,r,o){var t=v.getValue("state",o),s=t.row,a=t.col,t=e.It.renderer,u=v.getValue("canvas",o),n=v.getValue("viewParam",o),c=n.width,h=n.height,f=u.getContext("2d"),n=document.createElement("canvas"),l=(n.width=c,n.height=h,n.getContext("2d")),d=v.getValue("callback",o),n=new Image;n.onload=function(t){var n=v.getValue("state",o);n.loadCount++,v.setValue("state",n,o),l.drawImage(t.path[0],0,0,c,h),f.putImageData(l.getImageData(0,0,c,h),i,r),n.loadCount===s*a&&(u.toBlob(function(t){d&&d(t)}),v.recoverParam(e,o),o.callback=null,o.viewParam=null,o.state=null,o.camera=null,o.backCamera=null,o.canvas=null,o=null)},e.It.render(),n.src=t.domElement.toDataURL()}},{key:"setLogo",value:function(t,n){t.It.needLogo&&(n=Math.min(n,1),t.It.zt.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?(v.showAllNode(n,t),i=v.getValue("width",t),e=v.getValue("height",t),n.It.renderer.setSize(i,e),n.It.Xt(),n.It.Wt(),i=v.getValue("viewParam",t),n.It.renderer.setSize(i.width,i.height)):(n.It.Xt(),n.It.Wt())}},{key:"shot",value:function(t,n,e){v.setLogo(t,e.width/e.height);var i=v.getValue("camera",e),r=(t.It.Vt=!0,v.setVisibleLevelsFrustumCulled(t,!1),v.getValue("state",e)),o=r.row,s=r.col,a=v.getValue("viewParam",e);v.caleAvoid(e,t);for(var u=0;u<o*s;u++){var c=Math.floor(u/s),h=Math.max(u-c*s,0),f=n.width,l=n.height,d=new Image,c=(d.indexI=c,d.indexJ=h,a.width*d.indexJ),h=a.height*d.indexI;i.setViewOffset(f,l,c,h,a.width,a.height),i.updateProjectionMatrix(),v.readPixcel(t,c,h,e)}}}])}();function Fi(t){return(Fi="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 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,function(t){t=function(t,n){if("object"!=Fi(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Fi(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Fi(t)?t:t+""}(i.key),i)}}var n=function(){function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");this.X={x:Number.MAX_VALUE,y:Number.MAX_VALUE},this.H={x:-Number.MAX_VALUE,y:-Number.MAX_VALUE}}return n=t,(e=[{key:"min",get:function(){return this.X}},{key:"max",get:function(){return this.H}},{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.H.x=t.max.x,this.H.y=t.max.y,this.X.x=t.min.x,this.X.y=t.min.y,this}},{key:"clone",value:function(){return(new t).copy(this)}},{key:"reset",value:function(){this.X={x:Number.MAX_VALUE,y:Number.MAX_VALUE},this.H={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.Yt(t)}},{key:"expandByCoords",value:function(t){this.Qt(t)}},{key:"valid",value:function(){return this.Zt()}},{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}}])&&ji(n.prototype,e),i&&ji(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,e,i}(),Ii=(Object.assign(n.prototype,{Zt:function(){return!(this.min.x>this.max.x||this.min.y>this.max.y)},Yt: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)},Qt: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)})}}),n);function Ci(t){return(Ci="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 Di(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,function(t){t=function(t,n){if("object"!=Ci(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Ci(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Ci(t)?t:t+""}(i.key),i)}}var n=function(){function n(t){if(!(this instanceof n))throw new TypeError("Cannot call a class as a function");this.qt=t.size,this.Kt=t.rotation,this.Jt=t.center}return t=n,(e=[{key:"min",get:function(){return{x:this.Jt.x-this.qt.x/2,y:this.Jt.y-this.qt.y/2}}},{key:"max",get:function(){return{x:this.Jt.x+this.qt.x/2,y:this.Jt.y+this.qt.y/2}}},{key:"center",get:function(){return{x:this.Jt.x,y:this.Jt.y}}},{key:"rotation",get:function(){return this.Kt}},{key:"size",get:function(){return{x:this.qt.x,y:this.qt.y}}},{key:"clone",value:function(){return new n({size:this.qt,center:this.Jt,rotation:this.Kt})}},{key:"valid",value:function(){return!(this.min.x>this.max.x||this.min.y>this.max.y)}},{key:"expand",value: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)}}])&&Di(t.prototype,e),i&&Di(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,i}(),st=t(0);function ki(t){return(ki="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 Ui(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,function(t){t=function(t,n){if("object"!=ki(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=ki(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==ki(t)?t:t+""}(i.key),i)}}var Bi=function(){function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function")}return n=t,i=[{key:"getBrowser",value:function(){if(void 0!==navigator){var t,n,e,i,r,o,s=navigator.userAgent;if(void 0!==s)return t=-1<s.indexOf("Opera"),o=-1<s.indexOf("compatible")&&-1<s.indexOf("MSIE")&&!t,n=-1<s.indexOf("Edge"),e=-1<s.indexOf("Firefox"),i=-1<s.indexOf("Safari")&&-1===s.indexOf("Chrome"),r=-1<s.indexOf("Chrome")&&-1<s.indexOf("Safari"),o?(new RegExp("MSIE (\\d+\\.\\d+);").test(s),7===(o=parseFloat(RegExp.$1))?"IE7":8===o?"IE8":9===o?"IE9":10===o?"IE10":11===o?"IE11":"IE"):t?"Opera":n?"Edge":e?"FF":i?"Safari":r?"Chrome":void 0}}}],(e=null)&&Ui(n.prototype,e),i&&Ui(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,e,i}().getBrowser();function Gi(t){return(Gi="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 Hi(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function Xi(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,function(t){t=function(t,n){if("object"!=Gi(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Gi(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Gi(t)?t:t+""}(i.key),i)}}function Vi(t,n,e){return n&&Xi(t.prototype,n),e&&Xi(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}var zi=function(){function o(){Hi(this,o)}return Vi(o,null,[{key:"getRenderNode",value:function(t){var n=null;if(t)return t.getRenderNode?(n=t.getRenderNode())&&"Group"===n.type&&(n=n.children[0]):t.Rt&&(n=t.Rt),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.It.needLogo&&(n=Math.min(n,1),t.It.zt.material.uniforms.offset.value.x=-1*(.5*.4/n-1))}},{key:"setVisibleLevelsFrustumCulled",value:function(t,n,e){this.forEachElement(t,n,function(t){var n=o.getRenderNode(t);n&&(n.frustumCulled=e),t.type===E.LABEL&&null!=(n=t.getRenderNode())&&n.children.forEach(function(t){t.frustumCulled=e})})}},{key:"byZoomUpdateVisible",value:function(t,r,o){t.It.Ct.forEach(function(t,n){if(+n.split("%A%B%C%D")[1]===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.$t&&i.mapNode.G&&i.mapNode.G.maxlevel&&(r<i.mapNode.G.maxlevel&&r>=i.mapNode.G.minlevel||!i.mapNode.G.maxlevel?i.visible=!0:i.visible=!1)}})}},{key:"recoveAllNode",value:function(t){for(t.enableUpdateNode(),t.Pt.jt();0<t.Pt.Nt.length;)t.Pt.Ft()}},{key:"addLastFrame",value:function(t,n){var e=st.a.window.devicePixelRatio||1,i=t.It.renderer,r=i.domElement.parentElement,o=i.domElement.clientWidth,s=i.domElement.clientHeight,a=document.createElement("canvas"),u=(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",a.getContext("2d")),c=new Image,h=(c.crossOrigin="Anonymous",c.onload=function(){u.drawImage(c,0,0,o*e,s*e),r.append(a),t.kt.Dt({type:"printBefor"}),n()},c.onerror=function(t){console.warn("fail...",t)},t.It.render(),"FF"===Bi?"image/jpeg":"image/png");c.src=i.domElement.toDataURL(h,1)}},{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.Lt.length;r++)for(var o=i.Lt[r],s=0;s<o.Lt.length;s++)e(o.Lt[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)&&(t.type!==E.LABEL||0<t.text.length)&&i.push(t)})}},{key:"getElementBound",value:function(t){var n=new Ii;return t.forEach(function(t){n.expand(t.bound)}),n}}])}(),Wi=function(){function h(){Hi(this,h)}return Vi(h,null,[{key:"getSpriteWorldSize",value:function(t,n,e,i){var r;if(t.parent.isHasText){var o=t.getScreenSize();if(!o||isNaN(o.width)||isNaN(o.height))return null;r=o.width,o=o.height}else{t=null==(t=zi.getRenderNode(t))||null==(t=t.material)||null==(t=t.map)?void 0:t.image;if(!t)return null;o=t.height/2,r=t.width/2}return{x:r*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={},s=(t=Math.ceil(t),n=Math.ceil(n),new Ii);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],c=zi.getRenderNode(u);c&&"Sprite"===c.type&&(s=h.getSpriteWorldSize(u,e,i,r))&&(a=void 0,a=u.getAnchor?u.getAnchor():c.center,c=h.getSpriteBound(s.x,s.y,u.bound.center,a),isNaN(c.size.x)||isNaN(c.size.y)||c.size.x===1/0||c.size.y===1/0||n.expand(c))}}},{key:"getWidthSpriteBound",value:function(t,n,e,i,r){this.calcElements(t,r,n,e,i)}}])}(),Yi=function(){function e(){Hi(this,e)}return Vi(e,null,[{key:"createCamera",value:function(){var t=new pt(-1,1,1,-1,1,1e4);return t.up=new Tt(0,1,0),t}},{key:"calcExportWidthHeight",value:function(t){var n=t[0].distanceTo(t[1]);return{exportWidth:t[1].distanceTo(t[2]),exportHeight:n}}},{key:"updateCamera",value:function(t,n,e,i,r){r.left=-n/2,r.right=n/2,r.top=e/2,r.bottom=-e/2;var o=1,s=i.center,a=i.size,i=null!=(i=i.rotation)?i:0,o=n/e>a.x/a.y?e/a.y:n/a.x;r.rotation.x=-Math.PI/2,r.rotation.y=0,r.rotation.z=-i*Math.PI/180;e=t.Lt[0].x,n=t.Lt[0].y,a=s.x-e,i=n-s.y;r.position.x=a,r.position.y=Math.max((t.getLevels().length+1)*t.getFloorSpace(),1e3),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.It.renderer.domElement.clientWidth,height:t.map.It.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 zi.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),Wi.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){zi.addLastFrame(t,n)}},{key:"befor",value:function(s){return new Promise(function(t,n){var e=s.style,i=void 0===e?[]:e,e=s.map,r=s.level,o=(e.Pt.tn=!1,[]);zi.forEachElement(e,r,function(n){i.forEach(function(t){if(t.type===n.type)switch(t.type){case E.LABEL:0<n.text.length&&o.push(n.nn(t.fontSize));break;case E.TEXT_MARKER:n.Rt.userData.originFontSize=n.fontSize,n.fontSize=t.fontSize,n.update();break;case E.FACILITY:n.size=t.size;break;case E.IMAGE_MARKER:n.Rt.userData.originSize=n.size,n.size=t.size}})}),Promise.all(o).then(t)})}},{key:"after",value:function(t){var n=t.style,e=void 0===n?[]:n,n=t.map,t=t.level;n.Pt.tn=!0,zi.forEachElement(n,t,function(n){e.forEach(function(t){if(t.type===n.type)switch(t.type){case E.LABEL:n.fontSize=null;break;case E.FACILITY:n.size=null;break;case E.IMAGE_MARKER:n.size=n.Rt.userData.originSize,delete n.Rt.userData.originSize;break;case E.TEXT_MARKER:n.fontSize=n.Rt.userData.originFontSize,delete n.Rt.userData.originFontSize,n.update()}})})}},{key:"caleAvoid",value:function(t){t.map.setDevicePixalRatio(1),t.map.It.renderer.setSize(t.imageRenderSize.width,t.imageRenderSize.height),zi.byZoomUpdateVisible(t.map,t.map.getZoom(),t.level),e.showAllLevelNode(t.map,t.level),t.map.It.Xt(),t.map.It.Vt=!0,t.map.It.Wt(),zi.forEachElement(t.map,t.level,function(t){t.updateSize?t.updateSize():t.en&&t.en()}),t.map.It.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,s=(zi.setLogo(e,i.width/i.height),zi.setVisibleLevelsFrustumCulled(e,t.level,!1),this.caleAvoid(t),document.createElement("canvas")),a=(s.width=t.imageWidth,s.height=t.imageHeight,s.style.width=t.imageWidth+"px",s.style.height=t.imageHeight+"px",s.getContext("2d")),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 c=0;c<u.row*u.col;c++){var h=Math.floor(c/u.col),f=Math.max(c-h*u.col,0),f=r.width*f,h=r.height*h;o.setViewOffset(i.width,i.height,f,h,r.width,r.height),o.updateProjectionMatrix(),this.renderImage(f,h,u,s,a,n,t)}}},{key:"renderDomMarker",value:function(a){if(a.dependent&&a.dependent.html2canvas){a.camera.view=null,this.updateCamera(a.map,a.width,a.height,a.bound,a.camera);for(var t=a.width/2,n=a.height/2,e=new Tt,i=new At,r=new At,u=(i.copy(a.camera.matrixWorldInverse),r.multiplyMatrices(a.camera.projectionMatrix,i),[]),o=[],s=a.map.rn,c=0;c<s.Lt.length;c++){var h=s.Lt[c];h.level===a.level&&(e.setFromMatrixPosition(h.Rt.matrixWorld),e.applyMatrix4(r),u.push({x:e.x*t+t,y:-e.y*n+n}),h=a.dependent.html2canvas(h.Rt.element.childNodes[0],{backgroundColor:null}),o.push(h))}0==o.length?a.callback(a.canvasAll):Promise.all(o).then(function(r){for(var o=0,s=0;s<r.length;s++)!function(){var t=r[s],n=u[s],e=new Image,i=(e.onload=function(){o+=1,a.ctxAll.drawImage(e,n.x-t.width/2,n.y-t.height/2),o===r.length&&a.callback(a.canvasAll)},e.onerror=function(t){(o+=1)===r.length&&a.callback(a.canvasAll),console.error(t)},"FF"===Bi?"image/jpeg":"image/png");e.src=t.toDataURL(i,1)}()}).catch(function(t){console.error(t),a.callback(a.canvasAll)})}else a.callback(a.canvasAll)}},{key:"renderImage",value:function(t,n,e,i,r,o,s){var a=this,u=s.map,c=s.padding,h=s.renderSizeExport,f=document.createElement("canvas"),l=(f.width=h.width,f.height=h.height,f.getContext("2d")),d=new Image,f=(d.crossOrigin="Anonymous",d.onload=function(){e.loadCount++,l.drawImage(d,0,0,h.width,h.height),r.putImageData(l.getImageData(0,0,h.width,h.height),t+c,n+c),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){r.fillStyle=s.color,r.fillRect(0,0,s.imageWidth,s.padding),r.fillRect(0,0,s.padding,s.imageHeight),r.fillRect(0,s.imageHeight-s.padding,s.imageWidth,s.imageHeight),r.fillRect(s.imageWidth-s.padding,0,s.imageWidth,s.imageHeight),t.toBlob(function(t){s.autoDownload&&zi.downLoad(t),o(t)})}})},u.It.render(),"FF"===Bi?"image/jpeg":"image/png");d.src=u.It.renderer.domElement.toDataURL(f,1)}},{key:"recoverParam",value:function(t){var n=t.map,e=(n.Ut=t.backCamera,t.renderSizeMap),i=window.devicePixelRatio||1;n.It.renderer.setSize(e.width,e.height),n.setDevicePixalRatio(i),zi.forEachElement(n,t.level,function(t){t.updateSize?t.updateSize():t.en&&t.en()}),zi.byZoomUpdateVisible(t.map,t.map.getZoom(),t.level),zi.recoveAllNode(n,t),zi.setLogo(n,e.width/e.height),n.Ht.Gt.object=n.Ut,zi.setVisibleLevelsFrustumCulled(n,t.level,!0),n.It.Xt(),n.It.Vt=!0,n.enableUpdateNode()}},{key:"showFloorNode",value:function(t,n){for(var e=0;e<n.Lt.length;e++){var i=n.Lt[e];if(-1<n.parent.visibleLevels.indexOf(n.level))for(var r=0;r<i.Lt.length;r++){var o=i.Lt[r];zi.getRenderNode(o)||1!=o.visible||t.Pt.Nt.push([e,o])}}}},{key:"removeLastFrame",value:function(t){var n=t.It.renderer.domElement.parentElement;n&&n.childNodes.forEach(function(t){"exportImageLastFrame"===t.className&&n.removeChild(t)}),t.kt.Dt({type:"printAfter"})}},{key:"showAllLevelNode",value:function(t,n){for(e.showFloorNode(t,t.getFloor(n));0<t.Pt.Nt.length;)t.Pt.Ft()}}])}(),B=t(1);function Qi(t){return(Qi="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 Zi(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,function(t){t=function(t,n){if("object"!=Qi(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Qi(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Qi(t)?t:t+""}(i.key),i)}}function qi(t,n,e){return n&&Zi(t.prototype,n),e&&Zi(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}var e=qi(function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");this.sn=!1,this.an=new Map,this.un=new Map}),Ki=(Object.assign(e.prototype,{cn:function(t,n){this.un.has(t)||this.un.set(t,new Set),this.un.get(t).add(n)},hn:function(){this.an.clear(),this.an=null,this.un.clear(),this.un=null}}),e);function Ji(t){return(Ji="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 $i(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,function(t){t=function(t,n){if("object"!=Ji(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Ji(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Ji(t)?t:t+""}(i.key),i)}}function tr(t,n,e){n=er(n);var i=t,n=nr()?Reflect.construct(n,e||[],er(t).constructor):n.apply(t,e);if(n&&("object"===Ji(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function nr(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(nr=function(){return!!t})()}function er(t){return(er=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function ir(t,n){return(ir=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}e=function(){function n(){var t;if(this instanceof n)return(t=tr(this,n)).ln=0,t.dn=0,t.vn=new Map,t;throw new TypeError("Cannot call a class as a function")}var t,e,i=n,r=Ki;if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");return i.prototype=Object.create(r&&r.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),r&&ir(i,r),i=n,t&&$i(i.prototype,t),e&&$i(i,e),Object.defineProperty(i,"prototype",{writable:!1}),i}();Object.assign(e.prototype,{pn:function(t,n,e){var i;return this.an.has(t)?(i=this.an.get(t),n&&(i.isComplete?i.isError?n(null):n(i):this.cn(t,n))):i=this.mn(t,n,e),i},mn:function(n,t,e){var i,r=this;return this.ln++,(i=st.a.environment===B.a.WX?st.a.textureHelper.createImage(e):new Image).crossOrigin="Anonymous",i.onload="IE11"===Bi?new function(){this.dn++,i.isComplete=!0,r.yn(n,i)}:function(){r.dn++,i.isComplete=!0,r.yn(n,i)},i.onerror=function(t){r.dn++,i.isComplete=!0,i.isError=!0,r.yn(n,null)},i.src=n,i.isComplete=!1,this.an.set(n,i),t&&this.cn(n,t),i},yn:function(t,i){this.un.has(t)&&(this.un.get(t).forEach(function(t,n,e){n(i),e.delete(t)}),this.un.delete(t)),0<this.vn.size&&this.ln===this.dn&&this.vn.forEach(function(t,n){t(n)})},hn:function(){this.an.clear(),this.un.clear()}});var rr=new e;function or(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 sr=new or;function ar(t){return(ar="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 ur(){ur=function(){return s};var u,s={},t=Object.prototype,c=t.hasOwnProperty,h=Object.defineProperty||function(t,n,e){t[n]=e.value},n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",e=n.asyncIterator||"@@asyncIterator",r=n.toStringTag||"@@toStringTag";function o(t,n,e){return Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[n]}try{o({},"")}catch(u){o=function(t,n,e){return t[n]=e}}function a(t,n,e,i){var r,o,s,a,n=n&&n.prototype instanceof y?n:y,n=Object.create(n.prototype),i=new A(i||[]);return h(n,"_invoke",{value:(r=t,o=e,s=i,a=l,function(t,n){if(a===v)throw Error("Generator is already running");if(a===p){if("throw"===t)throw n;return{value:u,done:!0}}for(s.method=t,s.arg=n;;){var e=s.delegate;if(e){e=function t(n,e){var i=e.method,r=n.iterator[i];if(r===u)return e.delegate=null,"throw"===i&&n.iterator.return&&(e.method="return",e.arg=u,t(n,e),"throw"===e.method)||"return"!==i&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+i+"' method")),m;i=f(r,n.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,m;r=i.arg;return r?r.done?(e[n.resultName]=r.value,e.next=n.nextLoc,"return"!==e.method&&(e.method="next",e.arg=u),e.delegate=null,m):r:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,m)}(e,s);if(e){if(e===m)continue;return e}}if("next"===s.method)s.sent=s.bn=s.arg;else if("throw"===s.method){if(a===l)throw a=p,s.arg;s.dispatchException(s.arg)}else"return"===s.method&&s.abrupt("return",s.arg);a=v;e=f(r,o,s);if("normal"===e.type){if(a=s.done?p:d,e.arg===m)continue;return{value:e.arg,done:s.done}}"throw"===e.type&&(a=p,s.method="throw",s.arg=e.arg)}})}),n}function f(t,n,e){try{return{type:"normal",arg:t.call(n,e)}}catch(t){return{type:"throw",arg:t}}}s.wrap=a;var l="suspendedStart",d="suspendedYield",v="executing",p="completed",m={};function y(){}function b(){}function g(){}var n={},_=(o(n,i,function(){return this}),Object.getPrototypeOf),_=_&&_(_(M([]))),w=(_&&_!==t&&c.call(_,i)&&(n=_),g.prototype=y.prototype=Object.create(n));function x(t){["next","throw","return"].forEach(function(n){o(t,n,function(t){return this._invoke(n,t)})})}function E(s,a){var n;h(this,"_invoke",{value:function(e,i){function t(){return new a(function(t,n){!function n(t,e,i,r){var o,t=f(s[t],s,e);if("throw"!==t.type)return(e=(o=t.arg).value)&&"object"==ar(e)&&c.call(e,"__await")?a.resolve(e.gn).then(function(t){n("next",t,i,r)},function(t){n("throw",t,i,r)}):a.resolve(e).then(function(t){o.value=t,i(o)},function(t){return n("throw",t,i,r)});r(t.arg)}(e,i,t,n)})}return n=n?n.then(t,t):t()}})}function S(t){var n={tryLoc:t[0]};1 in t&&(n.catchLoc=t[1]),2 in t&&(n.finallyLoc=t[2],n.afterLoc=t[3]),this.tryEntries.push(n)}function T(t){var n=t.completion||{};n.type="normal",delete n.arg,t.completion=n}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function M(n){if(n||""===n){var e,t=n[i];if(t)return t.call(n);if("function"==typeof n.next)return n;if(!isNaN(n.length))return e=-1,(t=function t(){for(;++e<n.length;)if(c.call(n,e))return t.value=n[e],t.done=!1,t;return t.value=u,t.done=!0,t}).next=t}throw new TypeError(ar(n)+" is not iterable")}return h(w,"constructor",{value:b.prototype=g,configurable:!0}),h(g,"constructor",{value:b,configurable:!0}),b.displayName=o(g,r,"GeneratorFunction"),s.isGeneratorFunction=function(t){t="function"==typeof t&&t.constructor;return!!t&&(t===b||"GeneratorFunction"===(t.displayName||t.name))},s.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,o(t,r,"GeneratorFunction")),t.prototype=Object.create(w),t},s.awrap=function(t){return{gn:t}},x(E.prototype),o(E.prototype,e,function(){return this}),s.AsyncIterator=E,s.async=function(t,n,e,i,r){void 0===r&&(r=Promise);var o=new E(a(t,n,e,i),r);return s.isGeneratorFunction(n)?o:o.next().then(function(t){return t.done?t.value:o.next()})},x(w),o(w,r,"Generator"),o(w,i,function(){return this}),o(w,"toString",function(){return"[object Generator]"}),s.keys=function(t){var n,e=Object(t),i=[];for(n in e)i.push(n);return i.reverse(),function t(){for(;i.length;){var n=i.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},s.values=M,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this.bn=u,this.done=!1,this.delegate=null,this.method="next",this.arg=u,this.tryEntries.forEach(T),!t)for(var n in this)"t"===n.charAt(0)&&c.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=u)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var i=this;function t(t,n){return o.type="throw",o.arg=e,i.next=t,n&&(i.method="next",i.arg=u),!!n}for(var n=this.tryEntries.length-1;0<=n;--n){var r=this.tryEntries[n],o=r.completion;if("root"===r.tryLoc)return t("end");if(r.tryLoc<=this.prev){var s=c.call(r,"catchLoc"),a=c.call(r,"finallyLoc");if(s&&a){if(this.prev<r.catchLoc)return t(r.catchLoc,!0);if(this.prev<r.finallyLoc)return t(r.finallyLoc)}else if(s){if(this.prev<r.catchLoc)return t(r.catchLoc,!0)}else{if(!a)throw Error("try statement without catch or finally");if(this.prev<r.finallyLoc)return t(r.finallyLoc)}}}},abrupt:function(t,n){for(var e=this.tryEntries.length-1;0<=e;--e){var i=this.tryEntries[e];if(i.tryLoc<=this.prev&&c.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var r=i;break}}var o=(r=r&&("break"===t||"continue"===t)&&r.tryLoc<=n&&n<=r.finallyLoc?null:r)?r.completion:{};return o.type=t,o.arg=n,r?(this.method="next",this.next=r.finallyLoc,m):this.complete(o)},complete:function(t,n){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&n&&(this.next=n),m},finish:function(t){for(var n=this.tryEntries.length-1;0<=n;--n){var e=this.tryEntries[n];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),T(e),m}},catch:function(t){for(var n=this.tryEntries.length-1;0<=n;--n){var e,i,r=this.tryEntries[n];if(r.tryLoc===t)return"throw"===(e=r.completion).type&&(i=e.arg,T(r)),i}throw Error("illegal catch attempt")},delegateYield:function(t,n,e){return this.delegate={iterator:M(t),resultName:n,nextLoc:e},"next"===this.method&&(this.arg=u),m}},s}function cr(t,n,e,i,r,o,s){try{var a=t[o](s),u=a.value}catch(t){return void e(t)}a.done?n(u):Promise.resolve(u).then(i,r)}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,function(t){t=function(t,n){if("object"!=ar(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=ar(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==ar(t)?t:t+""}(i.key),i)}}function fr(C,t,D){var i,r,k,o,s,a,n=this,u=(void 0===t&&console.warn('THREE.OrbitControls: The second parameter "domElement" is now mandatory.'),t===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),this.object=C,this.isScreenLock=!1,this.domElement=t,this._n=D,this.enabled=!0,this.useRange=!1,this.target=new Tt,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.zoomSpeedParam=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:Wt,MIDDLE:Yt,RIGHT:Qt},this.touches={ONE:qt,TWO:Jt},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.rotateLeftStart=new Mt,this.rotateLeftEnd=new Mt,this.mapStateArray=[],this.timelone=null,this.wn=function(){n.isDamping&&(v.theta>l||v.phi>l||m.length()>l?(n.update(),n._n.enableUpdateRender()):(n.isDamping=!1,n.update()))},this.wn=this.wn.bind(this),this._n.on("beforeRender",this.wn),this.getPolarAngle=function(){return d.phi},this.getAzimuthalAngle=function(){return d.theta},this.panAdd=function(t){m.add(t)},this.saveState=function(){u.target0.copy(u.target),u.position0.copy(u.object.position),u.zoom0=u.object.zoom},this.resetState=function(){f=h.NONE},this.reset=function(){u.target.copy(u.target0),u.object.position.copy(u.position0),u.object.zoom=u.zoom0,u.object.updateProjectionMatrix(),u.dispatchEvent(U),u.update(),f=h.NONE},this.updateCheck=function(){if(this._n.Ht&&this._n.Ht.enableDragRange)if(this._n.Ht.xn())this.saveMapState();else{for(var t,n=this.mapStateArray.length-1;0<=n;){var e=this.mapStateArray[n];if(e.viewMode=this._n.getViewMode(),this.updateState(e),this._n.Ht.xn())break;n--}n<0&&(t=(t=this._n.getBuilding(this._n.Ht.Sn.En)).getFloor(t.level),this._n.setCenter({x:t.x,y:t.y}))}},this.updateState=function(t){var n=this;this._n.Ht.pauseDamping(),this._n.setCenter({animate:!1,x:t.center.x,y:t.center.y,finish:function(){n._n.setRotation({animate:!1,rotation:t.rotation,finish:function(){n._n.setTilt({animate:!1,tilt:t.tiltAngle,finish:function(){n._n.setZoom({animate:!1,zoom:t.zoom})}})}})}})},this.saveMapState=function(){var t=this._n.getState();!function(t){var n,e=!0;for(n in t)if(""+n!="level"&&""+n!="visibleLevels"&&""+n!="viewBuildingID"&&""+n!="floorSpace"&&""+n!="viewMode")if(""+n=="center"){var i=t[n];if(isNaN(parseFloat(""+i.x))||isNaN(parseFloat(""+i.y))){e=!1;break}}else if(isNaN(parseFloat(""+t[n]))){e=!1;break}return e}(t)||(200<=this.mapStateArray.length&&this.mapStateArray.splice(0,1),this.mapStateArray.push(t))},this.getTarget=function(t,n){var e,i;return 0===this._n.Lt.length?t:(e=this._n.getMapOptions().screenLockCoords,i={x:this._n.getContainer().clientWidth/2,y:this._n.getContainer().clientHeight/2},e={x:this._n.getContainer().clientWidth*e.x,y:this._n.getContainer().clientHeight*e.y},(i=pr.coordsScreenToMap(this._n,i,n)).x=i.x-this._n.x,i.y=-i.y+this._n.y,(e=pr.coordsScreenToMap(this._n,e,n)).x=e.x-this._n.x,e.y=-e.y+this._n.y,n=e.x-i.x,e=e.y-i.y,i=t.clone(),isNaN(n)||isNaN(e)||1e3<Math.abs(e)||1e3<Math.abs(n)||(i.x=i.x-n,i.z=i.z-e),i)},this.update=(i=new Tt,r=(new at).setFromUnitVectors(C.up,new Tt(0,1,0)),k=r.clone().inverse(),o=new Tt,s=new at,a=0,function(t){t=t||{};var n,e=u.object.position;return i.copy(e).sub(u.target),i.applyQuaternion(r),d.setFromVector3(i),u.autoRotate&&f===h.NONE&&M(2*Math.PI/60/60*u.autoRotateSpeed),u.enableDamping&&u.isDamping?(d.theta+=v.theta*u.dampingFactor,d.phi+=v.phi*u.dampingFactor):(d.theta+=v.theta,d.phi+=v.phi),d.theta=Math.max(u.minAzimuthAngle,Math.min(u.maxAzimuthAngle,d.theta)),t&&void 0!==t.theta&&(d.theta=Math.max(u.minAzimuthAngle,Math.min(u.maxAzimuthAngle,t.theta))),d.phi=Math.max(u.minPolarAngle,Math.min(u.maxPolarAngle,d.phi)),t&&void 0!==t.phi&&(d.phi=Math.max(u.minPolarAngle,Math.min(u.maxPolarAngle,t.phi))),d.makeSafe(),d.radius*=p,d.radius=Math.max(u.minDistance,Math.min(u.maxDistance,d.radius)),this.useRange?((n=(new Tt).setFromMatrixPosition(u.object.matrixWorld)).add(m),n=(new At).copy(u.object.matrixWorld).setPosition(n),n=(new At).getInverse(n),(new zt).setFromProjectionMatrix((new At).multiplyMatrices(u.object.projectionMatrix,n)).intersectsSphere(u.viewSphere)&&u.target.add(m)):u.enableDamping&&u.isDamping?u.target.addScaledVector(m,u.dampingFactor):u.target.add(m),i.setFromSpherical(d),i.applyQuaternion(k),t&&t.offset&&i.add(t.offset),this.useRange&&((n=(new Tt).setFromMatrixPosition(u.object.matrixWorld)).add(i),t=(new At).copy(u.object.matrixWorld).setPosition(n),n=(new At).getInverse(t),!(new zt).setFromProjectionMatrix((new At).multiplyMatrices(u.object.projectionMatrix,n)).intersectsSphere(u.viewSphere))||e.copy(u.target).add(i),u.isScreenLock&&void 0!==this._n.getMapOptions().screenLockCoords?((t=u.object.clone()).lookAt(u.target),u.object.lookAt(this.getTarget(u.target,t)),u.object.rotation.z=t.rotation.z):u.object.lookAt(u.target),u.enableDamping&&u.isDamping?(v.theta*=1-u.dampingFactor,v.phi*=1-u.dampingFactor,m.multiplyScalar(1-u.dampingFactor)):(v.set(0,0,0),m.set(0,0,0)),p=1,!(!(y||o.distanceToSquared(u.object.position)>l||8*(1-s.dot(u.object.quaternion))>l||a!==u.object.zoom)||(u.dispatchEvent(U),o.copy(u.object.position),s.copy(u.object.quaternion),a=u.object.zoom,y=!1))}),this.dispose=function(){u.domElement.removeEventListener("contextmenu",ot,!1),u.domElement.removeEventListener("mousedown",$,!1),u.domElement.removeEventListener("wheel",tt,!1),u.domElement.removeEventListener("touchstart",et,!1),u.domElement.removeEventListener("touchend",rt,!1),u.domElement.removeEventListener("touchmove",it,!1),st.a.document.removeEventListener("mousemove",j,!1),st.a.document.removeEventListener("mouseup",I,!1),u.domElement.removeEventListener("keydown",nt,!1)},this),U={type:"change"},e={type:"start"},c={type:"end"},h={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},f=h.NONE,l=1e-6,d=new Ei,v=new Ei,p=1,m=new Tt,y=!1,b=new Mt,g=new Mt,_=new Mt,w=new Mt,x=new Mt,E=new Mt,S=new Mt,T=new Mt,A=new Mt,B=null;function G(){return Math.pow(.95,u.zoomSpeed)}function M(t){u.enableRotateLeft&&(v.theta-=t)}function H(t){u.enableRotateUp&&(v.phi-=t)}O=new Tt;var O,L,R,X=function(t,n){O.setFromMatrixColumn(n,0),O.multiplyScalar(-t),m.add(O)},V=(L=new Tt,function(t,n){!0===u.screenSpacePanning?L.setFromMatrixColumn(n,1):(L.setFromMatrixColumn(n,0),L.crossVectors(u.object.up,L)),L.multiplyScalar(t),m.add(L)}),N=(this.panUp=function(t){var n=new Tt(0,1,0);n.multiplyScalar(t),m.add(n)},R=new Tt,function(t,n){var e,i=u.domElement;u.object.isPerspectiveCamera?(e=u.object.position,R.copy(e).sub(u.target),e=R.length(),e*=Math.tan(u.object.fov/2*Math.PI/180),X(2*t*e/i.clientHeight,u.object.matrix),V(2*n*e/i.clientHeight,u.object.matrix)):u.object.isOrthographicCamera?(X(t*(u.object.right-u.object.left)/u.object.zoom/i.clientWidth,u.object.matrix),V(n*(u.object.top-u.object.bottom)/u.object.zoom/i.clientHeight,u.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),u.enablePan=!1)});function P(t){u.object.isPerspectiveCamera?p/=t:u.object.isOrthographicCamera?(u.object.zoom=Math.max(u.minZoom,Math.min(u.maxZoom,u.object.zoom*t)),u.object.updateProjectionMatrix(),p/=t,y=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),u.enableZoom=!1)}function z(t){u.object.isPerspectiveCamera?p*=t:u.object.isOrthographicCamera?(u.object.zoom=Math.max(u.minZoom,Math.min(u.maxZoom,u.object.zoom/t)),u.object.updateProjectionMatrix(),p*=t,y=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),u.enableZoom=!1)}function F(t){b.set(t.clientX,t.clientY)}function W(t){w.set(t.clientX,t.clientY)}function Y(t){var n,e;1==t.touches.length?b.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),b.set(n,e),n=t.touches[0].pageX-t.touches[1].pageX,e=t.touches[0].pageY-t.touches[1].pageY,u.rotateLeftStart.set(n,e))}function Q(t){var n;1==t.touches.length?w.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),w.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,n=Math.sqrt(n*n+t*t);S.set(0,n)}function q(t){1==t.touches.length?g.set(t.touches[0].pageX,t.touches[0].pageY):(e=.5*(t.touches[0].pageX+t.touches[1].pageX),n=.5*(t.touches[0].pageY+t.touches[1].pageY),g.set(e,n),e=t.touches[0].pageX-t.touches[1].pageX,n=t.touches[0].pageY-t.touches[1].pageY,u.rotateLeftEnd.set(e,n),t=u.rotateLeftStart.angle(),M((-u.rotateLeftEnd.angle()+t)*u.rotateSpeed),u.rotateLeftStart.copy(u.rotateLeftEnd)),_.subVectors(g,b).multiplyScalar(u.rotateSpeed);var n,e=u.domElement;H(2*Math.PI*_.y/e.clientHeight),b.copy(g)}function K(t){var n;1==t.touches.length?(x.set(t.touches[0].pageX,t.touches[0].pageY),x.x<0&&x.copy(w)):(n=.5*(t.touches[0].pageX+t.touches[1].pageX),t=.5*(t.touches[0].pageY+t.touches[1].pageY),x.set(n,t)),E.subVectors(x,w).multiplyScalar(u.panSpeed),N(E.x,E.y),w.copy(x)}function J(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,n=Math.sqrt(n*n+t*t),T.set(0,n),A.set(0,Math.pow(T.y/S.y,u.zoomSpeed)),P(A.y),S.copy(T))}function $(t){if(!1!==u.enabled){switch(t.preventDefault(),(u.domElement.focus?u.domElement:window).focus(),t.button){case 0:switch(u.mouseButtons.LEFT){case Wt:if(t.ctrlKey||t.metaKey||t.shiftKey){if(!1===u.enablePan)return;W(t),f=h.PAN}else{if(!1===u.enableRotate)return;F(t),f=h.ROTATE}break;case Qt:if(t.ctrlKey||t.metaKey||t.shiftKey){if(!1===u.enableRotate)return;F(t),f=h.ROTATE}else{if(!1===u.enablePan)return;W(t),f=h.PAN}break;default:f=h.NONE}break;case 1:switch(u.mouseButtons.MIDDLE){case Yt:if(!1===u.enableZoom)return;S.set(t.clientX,t.clientY),f=h.DOLLY;break;case Wt:if(!1===u.enableRotate)return;F(t),f=h.ROTATE;break;default:f=h.NONE}break;case 2:switch(u.mouseButtons.RIGHT){case Wt:if(!1===u.enableRotate)return;F(t),f=h.ROTATE;break;case Qt:if(!1===u.enablePan)return;W(t),f=h.PAN;break;default:f=h.NONE}}f!==h.NONE&&(st.a.document.addEventListener("mousemove",j,!1),st.a.document.addEventListener("mouseup",I,!1),u.dispatchEvent(e))}}function j(t){var n;if(!1!==u.enabled)switch(t.preventDefault(),f){case h.ROTATE:!1!==u.enableRotate&&(n=t,g.set(n.clientX,n.clientY),_.subVectors(g,b).multiplyScalar(u.rotateSpeed),n=u.domElement,M(2*Math.PI*_.x/n.clientHeight),H(2*Math.PI*_.y/n.clientHeight),b.copy(g),u.isDamping=!0,u.update(),u.updateCheck());break;case h.DOLLY:!1!==u.enableZoom&&(T.set(t.clientX,t.clientY),A.subVectors(T,S),0<A.y?P(G()):A.y<0&&z(G()),S.copy(T),u.isDamping=!0,u.update(),u.updateCheck());break;case h.PAN:!1!==u.enablePan&&(x.set(t.clientX,t.clientY),E.subVectors(x,w).multiplyScalar(u.panSpeed),N(E.x,E.y),w.copy(x),u.isDamping=!0,u.update(),u.updateCheck())}}function I(t){!1!==u.enabled&&(st.a.document.removeEventListener("mousemove",j,!1),st.a.document.removeEventListener("mouseup",I,!1),u.dispatchEvent(c),f=h.NONE)}function tt(t){var n;!1===u.enabled||!1===u.enableZoom||f!==h.NONE&&f!==h.ROTATE||(t.preventDefault(),t.stopPropagation(),u.dispatchEvent(e),t=t,n=Math.pow(.95,u.zoomSpeed*u.zoomSpeedParam),t.deltaY<0?z(n):0<t.deltaY&&P(n),u.isDamping=!0,u.update(),u.updateCheck(),u.dispatchEvent(c))}function nt(t){if(!1!==u.enabled&&!1!==u.enableKeys&&!1!==u.enablePan){var n=!1;switch(t.keyCode){case u.keys.UP:N(0,u.keyPanSpeed),n=!0;break;case u.keys.BOTTOM:N(0,-u.keyPanSpeed),n=!0;break;case u.keys.LEFT:N(u.keyPanSpeed,0),n=!0;break;case u.keys.RIGHT:N(-u.keyPanSpeed,0),n=!0}n&&(t.preventDefault(),u.isDamping=!0,u.update(),u.updateCheck())}}function et(t){if(!1!==u.enabled){switch(t.preventDefault(),t.touches.length){case 1:switch(u.touches.ONE){case qt:if(!1===u.enableRotate)return;Y(t),f=h.TOUCH_ROTATE;break;case Kt:if(!1===u.enablePan)return;Q(t),f=h.TOUCH_PAN;break;default:f=h.NONE}break;case 2:switch(B=t.touches[0].identifier,u.touches.TWO){case Jt:if(!1===u.enableZoom&&!1===u.enablePan)return;n=t,u.enableZoom&&Z(n),u.enablePan&&Q(n),f=h.TOUCH_DOLLY_PAN;break;case $t:if(!1===u.enableZoom&&!1===u.enableRotate)return;n=t,u.enableZoom&&Z(n),u.enableRotate&&Y(n),f=h.TOUCH_DOLLY_ROTATE;break;default:f=h.NONE}break;default:f=h.NONE}var n;f!==h.NONE&&u.dispatchEvent(e)}}function it(t){var n,e;if(!1!==u.enabled)switch(2===t.touches.length&&t.touches[1].identifier===B&&(n=t.touches[0],t.touches[0]=t.touches[1],t.touches[1]=n),t.preventDefault(),t.stopPropagation(),f){case h.TOUCH_ROTATE:!1!==u.enableRotate&&(q(t),u.isDamping=!0,u.update(),u.updateCheck());break;case h.TOUCH_PAN:!1!==u.enablePan&&(K(t),u.isDamping=!0,u.update(),u.updateCheck());break;case h.TOUCH_DOLLY_PAN:!1===u.enableZoom&&!1===u.enablePan||(e=t,u.enableZoom&&J(e),u.enablePan&&K(e),u.isDamping=!0,u.update(),u.updateCheck());break;case h.TOUCH_DOLLY_ROTATE:!1===u.enableZoom&&!1===u.enableRotate||(e=t,u.enableZoom&&J(e),u.enableRotate&&q(e),u.isDamping=!0,u.update(),u.updateCheck());break;default:f=h.NONE}}function rt(t){!1!==u.enabled&&(u.dispatchEvent(c),f=h.NONE)}function ot(t){!1!==u.enabled&&t.preventDefault()}this.dollyIn=P,this.dollyOut=z,u.domElement.addEventListener("contextmenu",ot,!1),u.domElement.addEventListener("mousedown",$,!1),u.domElement.addEventListener("wheel",tt,!1),u.domElement.addEventListener("touchstart",et,!1),u.domElement.addEventListener("touchend",rt,!1),u.domElement.addEventListener("touchmove",it,!1),u.domElement.addEventListener("keydown",nt,!1),-1===u.domElement.tabIndex&&(u.domElement.tabIndex=0),u.isDamping=!0,this.update(),this.updateCheck(),this.removeEvent=function(){u.domElement.removeEventListener("contextmenu",ot,!1),u.domElement.removeEventListener("mousedown",$,!1),u.domElement.removeEventListener("wheel",tt,!1),u.domElement.removeEventListener("touchstart",et,!1),u.domElement.removeEventListener("touchend",rt,!1),u.domElement.removeEventListener("touchmove",it,!1),u.domElement.removeEventListener("keydown",nt,!1),st.a.document.removeEventListener("mousemove",j,!1),st.a.document.removeEventListener("mouseup",I,!1)}}function lr(t,n,e){fr.call(this,t,n,e),this.mouseButtons.LEFT=Qt,this.mouseButtons.RIGHT=Wt,this.touches.ONE=Kt,this.touches.TWO=$t,this.Tn=null}var dr=!1,vr=0,pr=function(){function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function")}return n=t,i=[{key:"coordsMapToScreen",value:function(t,n){var e=void 0!==n.height?n.height:0,i=t.getMapOptions().buildingID,i=(n.buildingID&&(i=n.buildingID),t.getBuilding(i)),r=(void 0!==n.level?n:i).level,i=void 0!==n.z?n.z:i.getFloor(r).nt;return this.coordsMapToScreen_(t,{x:n.x,y:n.y,z:i+e})}},{key:"coordsScreenToMap",value:function(t,n,e){var i,r,o=(void 0!==n.buildingID?n:t.getMapOptions()).buildingID,o=t.getBuilding(o),s=t.An,a=(void 0!==n.level?n:o).level,o=void 0!==n.z?n.z:o.getFloor(a).nt,a=null,u=t.It.renderer.domElement.clientWidth,c=t.It.renderer.domElement.clientHeight,h=new Tt,f=new Tt,t=(null!=(e=(a=e||t.Ht.Gt.object).userData)&&e.near?a.userData:a).near,e=(null!=(e=a.userData)&&e.far?a.userData:a).far,u=(a.isPerspectiveCamera?(a.updateMatrixWorld(),h.setFromMatrixPosition(a.matrixWorld),i=n.x/u*2-1,r=-n.y/c*2+1,f.set(i,r,t).unproject(a).sub(h).normalize()):(i=n.x/u*2-1,r=-n.y/c*2+1,h.set(i,r,(t+e)/(t-e)).unproject(a),f.set(0,0,-1).transformDirection(a.matrixWorld)),(-h.y+o)/f.y),n=(u<0&&(u=e),(new Tt).copy(h).add((new Tt).copy(f).multiplyScalar(u)));return{x:n.x+s.x,y:s.y-n.z,z:o}}},{key:"_drawImage",value:function(t,n,e,i,r,o){var s=Math.min(r/e,o/i),e=e*s,i=i*s;t.drawImage(n,(r-e)/2,(o-i)/2,e,i)}},{key:"screenshot",value:function(s,t,n,e,a,u,c,h){var f=this,l=n.x-t.x,d=n.y-t.y,i=(n.x+t.x)/2,r=(n.y+t.y)/2,o=s.It.renderer.domElement.style.width,v=s.It.renderer.domElement.style.height,p=o.split("p")[0],m=v.split("p")[0],y=null,y=(n.x-t.x)/(n.y-t.y)>p/m?p/(n.x-t.x):m/(n.y-t.y),o=i-p/2,v=r-m/2,n=document.getElementsByTagName("canvas")[0],b=document.createElement("canvas"),g=document.createElement("canvas"),_=document.createElement("canvas"),w=st.a.window.devicePixelRatio,x=new Image,E=(s.getViewMode(),s.Ut.setViewOffset(p*y,m*y,p*(y-1)/2+o*y,m*(y-1)/2+v*y,p,m),s.It.render(),b.width=l*y*w,b.height=d*y*w,b.style.width=l*y*w+"px",b.style.height=d*y*w+"px",e?(g.width=1240*Math.pow(1.414,a-1),g.height=1754*Math.pow(1.414,a-1),g.style.width=1240*Math.pow(1.414,a-1)+"px",g.style.height=1754*Math.pow(1.414,a-1)+"px"):(g.height=1240*Math.pow(1.414,a-1),g.width=1754*Math.pow(1.414,a-1),g.style.height=1240*Math.pow(1.414,a-1)+"px",g.style.width=1754*Math.pow(1.414,a-1)+"px"),_.height=h||d*Math.pow(1.414,a-1),_.width=c||l*Math.pow(1.414,a-1),_.style.height=_.height+"px",_.style.width=_.width+"px",x.src=n.toDataURL("image/png"),(s.getViewMode()===Si.PERSPECTIVE?s.Mn:s.Bt).clearViewOffset(),b.getContext("2d")),S=g.getContext("2d"),T=_.getContext("2d");x.onload=function(){s.getViewMode(),E.drawImage(x,-(p*w-l*y*w)/2,-(m*w-d*y*w)/2);var o=new Image;o.src=b.toDataURL("image/png"),o.onload=function(){s.camera.clearViewOffset(),s.enableUpdateRender();var t=Math.min(1240*Math.pow(1.414,a-1)/(l*y),1754*Math.pow(1.414,a-1)/(d*y)),n=(g.width-l*y*t)/2,e=(g.height-d*y*t)/2,i=(S.drawImage(o,n,e,l*y*t,d*y*t),c&&h?f._drawImage(T,o,l,d,_.width,_.height):T.drawImage(o,0,0,l*Math.pow(1.414,a-1),d*Math.pow(1.414,a-1)),g.toDataURL("image/png")),r=_.toDataURL("image/png");-1<navigator.userAgent.indexOf("Edge")||-1<navigator.userAgent.indexOf(".NET4.0C")?u(i,null,r,null):g.toBlob(function(n){return _.toBlob(function(t){return u(i,n,r,t)})})}}}},{key:"print",value:function(t,n){var e=this,i=(dr=!0,t.getZoom()),r=(t.setZoom({animate:!0,zoom:29}),t.Ht.Gt.target.x),o=t.Ht.Gt.target.z,s=(t.Ht.Gt.panAdd({x:-r,z:-o,y:0}),t.getTilt()),a=t.getRotation(),u=document.createElement("canvas");u.width=6*t.It.renderer.domElement.width,u.height=6*t.It.renderer.domElement.height,t.setTilt({tilt:90,finish:function(){t.setRotation({rotation:0})}}),t.getViewMode()===Si.MODE_3D?t.setViewMode({mode:Si.MODE_2D,callback:function(){return e.shot_(t,u,u.getContext("2d"),0,t.Bt.zoom,r,o,i,Si.MODE_3D,s,a,n)}}):this.shot_(t,u,u.getContext("2d"),0,t.Bt.zoom,r,o,i,Si.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===Si.MODE_2D?"2d":"3d":t.cameraType=t.mode===Si.MODE_2D?"2d":"3d",n!=Si.MODE_2D||t.mode!==Si.MODE_3D)&&Pi.print(t)}},{key:"coordsMapToScreen_",value:function(t,n){var e=t.Ht.Gt.object,i=(null!=(i=e.userData)&&i.near?e.userData:e).near,r=(null!=(r=e.userData)&&r.far?e.userData:e).far,o=e.near,s=e.far,i=(e.near=i,e.far=r,e.updateProjectionMatrix(),t.An),r=new Tt(n.x-i.x,n.z,-n.y+i.y).project(e),n=t.It.renderer.domElement.clientWidth,i=t.It.renderer.domElement.clientHeight;return e.near=o,e.far=s,e.updateProjectionMatrix(),r.z<-1||1<r.z?null:{x:Math.round(n/2*r.x+n/2),y:Math.round(-i/2*r.y+i/2)}}},{key:"shot_",value:function(e,i,r,t,o,s,a,u,c,h,f,l){var n,d,v,p,m;return dr&&t<36?(d=n=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),v=e.It.renderer.domElement.width,p=e.It.renderer.domElement.height,(m=new Image).indexI=n,m.indexJ=d,e.Bt.setViewOffset(v,p,2.5*-v+v*n,2.5*-p+p*d,v,p),e.Bt.updateProjectionMatrix(),m.onload=function(t){vr++;var n=(n=t.target)||t.path[0];r.drawImage(n,v*n.indexI,p*n.indexJ),36===vr&&(i.toBlob(function(t){e.Bt.zoom=6*o,e.Bt.updateProjectionMatrix(),e.setViewMode({mode:c,callback:function(){e.setRotation({rotation:f,finish:function(){e.setTilt({tilt:h})}})}}),e.setZoom({zoom:u}),e.Bt.clearViewOffset(),e.It.On(),e.Ht.Gt.panAdd({x:s,z:a,y:0}),e.It.Xt(),e.Ht.Gt.update(),e.It.render(),dr=!1,l(t)}),vr=0)},e.It.Xt(),e.Ht.Gt.update(),e.It.render(),m.src=e.It.renderer.domElement.toDataURL(),this.shot_(e,i,r,++t,o,s,a,u,c,h,f,l)):void 0}},{key:"exportToImage",value:function(o,s,u,c,h){u=u||{},Yi.readOptions(o,s,u),Yi.initOptions(u),u.renderSizeExport.width<=0||u.renderSizeExport.height<=0?h&&h():Yi.addLastFrame(u.map,function(){function t(){for(u.map.Pt.tn=!0,u.map.Pt.jt(),u.map.It.Ln(),Yi.showFloorNode(u.map,u.map.getFloor(u.level));0<u.map.Pt.Nt.length;)u.map.Pt.Ft();var t,n=[!1,!1];sr.isLoaded()?(n[0]=!0,n.every(function(t){return t})&&r()):(t=sr.onLoad,sr.onLoad=function(){t(),n[0]=!0,sr.onLoad=t,n.every(function(t){return t})&&r()}),rr.dn===rr.ln?(n[1]=!0,n.every(function(t){return t})&&r()):rr.vn.set(u.map.Rn,function(){rr.vn.delete(u.map.Rn),n[1]=!0,n.every(function(t){return t})&&r()})}var e=u.map.getLevel(),i=u.map.getVisibleLevels(),r=(u.map.It.renderer.domElement.style.opacity="0",u.map.toolBar&&(u.map.toolBar.enable=!1),function(){a=ur().mark(function t(){var n;return ur().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Yi.befor(u);case 2:!0===u.isExpandbound&&(n=Yi.findSpriteElement(u.map,u.level,u.bound),s=Yi.expandBoundBySprite(n,u)),Yi.updateCamera(u.map,u.imageRenderSize.width,u.imageRenderSize.height,s,u.camera),u.map.camera=u.camera,Yi.start(u,function(n){Yi.recoverParam(u),u.map.It.renderer.domElement.style.opacity="1",u.map.setVisibleLevels(i),u.map.setLevel({level:e,animate:!1,finish:function(){var t;Yi.after(u),Yi.showAllLevelNode(u.map,u.oldLevel),u.map.toolBar&&(u.map.toolBar.enable=!0),u.map.It.Xt(),u.map.It.Vt=!0,u.map.It.Wt(),-1===i.indexOf(u.level)&&null!=(t=o.getFloor(u.level))&&null!=(t=t.children)&&t.forEach(function(t){null!=t&&null!=(t=t.children)&&t.forEach(function(t){t.fading||t.Nn&&t.Nn()})}),u.map.Pt.tn=!0,u.map.Pt.jt(),u.map.It.Ln(),u.map.It.render(),Yi.removeLastFrame(o),null!==n?c&&c(n):h&&h()}})});case 6:case"end":return t.stop()}},t)});var a,t=function(){var t=this,s=arguments;return new Promise(function(n,e){var i=a.apply(t,s);function r(t){cr(i,n,e,r,o,"next",t)}function o(t){cr(i,n,e,r,o,"throw",t)}r(void 0)})};return function(){return t.apply(this,arguments)}}());u.map.setVisibleLevels([u.level],function(){u.map.setLevel({level:u.level,animate:!1,finish:t})})})}}],(e=null)&&hr(n.prototype,e),i&&hr(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,e,i}(),e=((fr.prototype=Object.create(V.prototype)).constructor=fr,(lr.prototype=Object.create(V.prototype)).constructor=lr,Object.assign(lr.prototype,{setMouseMiddleButtonRotation:function(){this.mouseButtons.RIGHT=Zt,this.mouseButtons.MIDDLE=Wt},dispose:function(){this.removeEvent(),this.object=null,this.domElement=null,this._n.off("beforeRender",this._n.wn),this._n=null},pauseDamping:function(){this.Tn={dampingFactor:this.dampingFactor,enableDamping:this.enableDamping},this.enableDamping=!1,this.dampingFactor=1},resumeDamping:function(){this.Tn&&(this.enableDamping=this.Tn.enableDamping,this.dampingFactor=this.Tn.dampingFactor)}}),{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}),u=(Object.freeze(e),e),mr={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},e={RIGHT:2,LEFT:4,BOTTOM:8,TOP:16,RIGHT_BOTTOM:32,LEFT_BOTTOM:64,RIGHT_TOP:128,LEFT_TOP:256,CENTER:512},yr=(Object.freeze(e),e);function Ot(t,n,e,i){this.x=t||0,this.y=n||0,this.z=e||0,this.w=void 0!==i?i:1}function br(t){return(br="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 gr(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,function(t){t=function(t,n){if("object"!=br(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=br(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==br(t)?t:t+""}(i.key),i)}}Object.defineProperties(Ot.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(Ot.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,o,s,a,u,c,h,t=t.elements,f=t[0],l=t[4],d=t[8],v=t[1],p=t[5],m=t[9],y=t[2],b=t[6],t=t[10];return Math.abs(l-v)<.01&&Math.abs(d-y)<.01&&Math.abs(m-b)<.01?Math.abs(l+v)<.1&&Math.abs(d+y)<.1&&Math.abs(m+b)<.1&&Math.abs(f+p+t-3)<.1?this.set(1,0,0,0):(r=Math.PI,s=(t+1)/2,a=(l+v)/4,u=(d+y)/4,c=(m+b)/4,(o=(p+1)/2)<(h=(f+1)/2)&&s<h?i=h<.01?(n=0,e=.707106781):(e=a/(n=Math.sqrt(h)),u/n):s<o?i=o<.01?(e=0,n=.707106781):(n=a/(e=Math.sqrt(o)),c/e):s<.01?(e=n=.707106781,i=0):(n=u/(i=Math.sqrt(s)),e=c/i),this.set(n,e,i,r)):(h=Math.sqrt((b-m)*(b-m)+(d-y)*(d-y)+(v-l)*(v-l)),Math.abs(h)<.001&&(h=1),this.x=(b-m)/h,this.y=(d-y)/h,this.z=(v-l)/h,this.w=Math.acos((f+p+t-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 _r=function(){function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function")}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 st.a.environment===B.a.WX?96/2.54:(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 Mt(.5,.5);switch(t){case yr.LEFT:n.setX(0);break;case yr.RIGHT:n.setX(1);break;case yr.TOP:n.setY(1);break;case yr.BOTTOM:n.setY(0);break;case yr.LEFT_TOP:n.set(0,1);break;case yr.RIGHT_TOP:n.set(1,1);break;case yr.LEFT_BOTTOM:n.set(0,0);break;case yr.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)&&gr(n.prototype,e),i&&gr(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,e,i}(),wr={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},xr={h:0,s:0,l:0},Er={h:0,s:0,l:0};function lt(t,n,e){return void 0===n&&void 0===e?this.set(t):this.setRGB(t,n,e)}function Sr(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 Tr(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function Ar(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}function Mr(t){return(Mr="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 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,function(t){t=function(t,n){if("object"!=Mr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Mr(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Mr(t)?t:t+""}(i.key),i)}}Object.assign(lt.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=St.euclideanModulo(t,1),n=St.clamp(n,0,1),e=St.clamp(e,0,1),0===n?this.r=this.g=this.b=e:(this.r=Sr(n=2*e-(e=e<=.5?e*(1+n):e+n-e*n),e,t+1/3),this.g=Sr(n,e,t),this.b=Sr(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,r,o,s=u[1],a=u[2];switch(s){case"rgb":case"rgba":if(e=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))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(a))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(a))return i=parseFloat(e[1])/360,r=parseInt(e[2],10)/100,o=parseInt(e[3],10)/100,t(e[5]),this.setHSL(i,r,o)}}else if(u=/^\#([A-Fa-f0-9]+)$/.exec(n)){var s=u[1],u=s.length;if(3===u)return this.r=parseInt(s.charAt(0)+s.charAt(0),16)/255,this.g=parseInt(s.charAt(1)+s.charAt(1),16)/255,this.b=parseInt(s.charAt(2)+s.charAt(2),16)/255,this;if(6===u)return this.r=parseInt(s.charAt(0)+s.charAt(1),16)/255,this.g=parseInt(s.charAt(2)+s.charAt(3),16)/255,this.b=parseInt(s.charAt(4)+s.charAt(5),16)/255,this}return n&&0<n.length?this.setColorName(n):this},setColorName:function(t){var n=wr[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=Tr(t.r),this.g=Tr(t.g),this.b=Tr(t.b),this},copyLinearToSRGB:function(t){return this.r=Ar(t.r),this.g=Ar(t.g),this.b=Ar(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)c=n=0;else{var u=o-s,c=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=c,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(xr),xr.h+=t,xr.s+=n,xr.l+=e,this.setHSL(xr.h,xr.s,xr.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(xr),t.getHSL(Er);var t=St.lerp(xr.h,Er.h,n),e=St.lerp(xr.s,Er.s,n),n=St.lerp(xr.l,Er.l,n);return this.setHSL(t,e,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}}),lt.NAMES=wr;var Lr=function(){function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function")}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,e=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,e.toUpperCase()}},{key:"findNearNthPowerOfTwo",value:function(t){t-=1;return(t=(t=(t=(t=(t|=t>>1)|t>>2)|t>>4)|t>>8)|t>>16)<0?1:1+t}},{key:"rgbToArray",value:function(t){var n=new lt;return n.setStyle(t),[n.r,n.g,n.b]}},{key:"toRgba",value:function(t){var n;return void 0===t?t:"number"!=typeof t?3<=(n=t.split(",")).length?"rgba("+parseInt(n[0])+","+parseInt(n[1])+","+parseInt(n[2])+",1)":t:"rgba("+parseInt(255*new lt(t).r)+","+parseInt(255*new lt(t).g)+","+parseInt(255*new lt(t).b)+",1)"}},{key:"toColor",value:function(t){var n;return"number"==typeof t?t:3<=(n=t.split(",")).length?parseInt(n[0])<<16|parseInt(n[1])<<8|parseInt(n[2]):(console.error("color format error",t),0)}},{key:"cov",value:function(t){for(var n=[],e=[0,0],i=[],r=0;r<t.length;r++)e[0]+=t[r].x,e[1]+=t[r].y;e[0]=e[0]/t.length,e[1]=e[1]/t.length;for(var o=0;o<t.length;o++)i.push([t[o].x-e[0],t[o].y-e[1]]);for(var s=[],a=0;a<i[0].length;a++){for(var u=[],c=0;c<i.length;c++)u.push(i[c][a]);s.push(u)}for(var h=0;h<s.length;h++){for(var f=[],l=0;l<i[0].length;l++){for(var d=0,v=0;v<s[h].length;v++)d+=s[h][v]*i[v][l];d/=t.length-1,f.push(d)}n.push(f)}return n}},{key:"eig",value:function(t){var n=(t[0][0]+t[1][1])/2,e=t[0][0]*t[1][1]-t[1][0]*t[0][1],i=n+Math.sqrt(n*n-e),n=n-Math.sqrt(n*n-e);return 0==t[0][1]&&0==t[1][0]?{eigValue:[i,n],eigVect:[[1,0],[0,1]]}:(e=(i-t[0][0])/t[0][1],t=(n-t[0][0])/t[0][1],{eigValue:[i,n],eigVect:[[1/Math.sqrt(1+e*e),e/Math.sqrt(1+e*e)],[1/Math.sqrt(1+t*t),t/Math.sqrt(1+t*t)]]})}}],(e=null)&&Or(n.prototype,e),i&&Or(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,e,i}();function Rr(t){return(Rr="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 Nr(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,function(t){t=function(t,n){if("object"!=Rr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Rr(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Rr(t)?t:t+""}(i.key),i)}}var e=function(){function n(t){if(!(this instanceof n))throw new TypeError("Cannot call a class as a function");this.Pn=(t=t||{}).src,this.Fn=t.dest,this.jn=null,this.In=[],this.Cn=0,this.Dn=0,this.kn=0,this.Un=u.THOUSAND,this.Bn=!1,this.Gn=!1,this.Hn=!0,this.Xn=null,this.Vn=null,this.zn=Lr.generateUUID()}return t=n,(e=[{key:"play",value:function(){return this.Wn()}},{key:"pause",value:function(){return this.Gn=!0,this}},{key:"resume",value:function(){return this.Gn=!1,this.Cn+=this.kn,this.kn=0,this}},{key:"stop",value:function(){return this.Hn=!0,this}},{key:"finish",value:function(){return this.Hn=!0,this.Vn&&this.Vn(),this.In=[],this}}])&&Nr(t.prototype,e),i&&Nr(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,i}(),Pr=(Object.assign(e.prototype,{Yn:function(){for(var t in this)this[""+t]=null,delete this[""+t]},Qn:function(t){return this.Pn=t,this},Zn:function(t){return this.Fn=t,this},qn:function(t){return this.Un=t*u.THOUSAND,this},Kn:function(t){return this.Dn=t*u.THOUSAND,this},Jn:function(t){return this.Xn=t,this},$n:function(t){return this.Vn=t,this},te:function(t){return this.Bn=t,this},Wn:function(){return this.Hn=!1,this.jn&&(this.Cn=this.jn.ne),this},ee:function(){var t=new this.constructor({src:this.Pn,dest:this.Fn});return t.Cn=this.Cn,t.Dn=this.Dn,t.Un=this.Un,t.Bn=this.Bn,t.Xn=this.Xn,t.Vn=this.Vn,t},ie:function(){var t=this.Fn.concat(),n=this.Pn.concat();return this.Pn=t,this.Fn=n,this}}),e);function Fr(t){return(Fr="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 jr(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,function(t){t=function(t,n){if("object"!=Fr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Fr(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Fr(t)?t:t+""}(i.key),i)}}function Ir(t,n,e){return n&&jr(t.prototype,n),e&&jr(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}var Cr=Ir(function t(n,e){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");this.start=null!=n?n:0,this.stop=null!=e?e:0});function I(t){return null!=t}function Dr(t){return(Dr="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 kr(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,function(t){t=function(t,n){if("object"!=Dr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Dr(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Dr(t)?t:t+""}(i.key),i)}}var Ur=function(){function u(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,e=this,i=u;if(!(e instanceof i))throw new TypeError("Cannot call a class as a function");this.center=null==t?void 0:t.clone(),this.radius=n}return t=u,e=[{key:"computePlaneDistances",value:function(t,n,e,i){I(i)||(i=new Cr);var r=new Tt,n=(r.subVectors(t.center,n),e.dot(r));return i.start=n-t.radius,i.stop=n+t.radius,i}},{key:"clone",value:function(t,n){if(I(t))return I(n)?(n.center=t.center.clone(),n.radius=t.radius,n):new u(t.center,t.radius)}},{key:"expand",value:function(t,n,e){e=u.clone(t,e);t=n.distance(e.center);return t>e.radius&&(e.radius=t),e}},{key:"union",value:function(t,n,e){I(e)||(e=new u);var i=t.center,r=t.radius,o=n.center,s=n.radius,a=new Tt,o=(a.subVectors(o,i),a.length());return o+s<=r?u.clone(t,e):o+r<=s?u.clone(n,e):(t=.5*(r+o+s),(n=a.clone()).multiplyScalar((t-r)/o),n.add(i),e.center=n.clone(),e.radius=t),e}},{key:"equals",value:function(t,n){return t===n||I(t)&&I(n)&&t.equals(n.center)&&t.radius===n.radius}}],(n=[{key:"valid",get:function(){return null!==this.center&&null!==this.radius}},{key:"reset",value:function(){this.center=null,this.radius=null}}])&&kr(t.prototype,n),e&&kr(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,e}();function Br(t){return(Br="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 Gr(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,function(t){t=function(t,n){if("object"!=Br(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Br(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Br(t)?t:t+""}(i.key),i)}}var Hr=function(){function i(t){if(!(this instanceof i))throw new TypeError("Cannot call a class as a function");this.Gt=t,this.re=new Cr,this.oe=new Ur}return t=i,e=[{key:"getMeshBoudinggSphere",value:function(t){var t=(new It).setFromObject(t),n=new Tt,e=(t.getCenter(n),new Tt),t=(t.getSize(e),.5*e.length());return new Ur(n,t)}},{key:"getSceneBoudingSphere",value:function(t,e){t.traverse(function(t){var n;"Mesh"===t.type?n=i.getMeshBoudinggSphere(t):"Scene"!==t.type&&"Group"!==t.type&&"DirectionalLight"!==t.type&&"AmbientLight"!==t.type&&(n=new Ur(t.position,0)),!n||isNaN(n.radius)||isNaN(n.center.x)||isNaN(n.center.y)||isNaN(n.center.z)||(e.valid||Ur.clone(n,e),Ur.union(n,e,e))})}}],(n=[{key:"reset",value:function(){this.se()}},{key:"update",value:function(t){this.ae(t)}}])&&Gr(t.prototype,n),e&&Gr(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,e}();function Xr(t){return(Xr="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 Vr(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,function(t){t=function(t,n){if("object"!=Xr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Xr(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Xr(t)?t:t+""}(i.key),i)}}function zr(t,n,e){return n&&Vr(t.prototype,n),e&&Vr(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}Object.assign(Hr.prototype,{ue:function(){var t,n,e;!this.oe.valid||this.oe.radius<=0||(e=(t=this.Gt).target,((t=t.object).far>u.CAMERA_FAR||void 0===t.userData.far)&&(t.userData.far=Math.max(t.far,null!=(n=t.userData.far)?n:0)),void 0===t.userData.near&&(t.userData.near=t.near),n=t.position,e=e.clone().sub(n).normalize(),Ur.computePlaneDistances(this.oe,n,e,this.re),this.re.start>=this.re.stop)||(t.near=Math.max(this.re.start,t.userData.near),t.far=this.re.stop,t.updateProjectionMatrix())},se:function(){this.oe.reset()},ae:function(t){var n=this;t.forEach(function(t){t&&Hr.getSceneBoudingSphere(t,n.oe)}),this.ue()}});var e=zr(function t(n,e){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");this.ce=n,this.he=e}),Wr=(Object.assign(e.prototype,{fe:function(t){return!1},le:function(t,n){}}),e),e={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},Yr=(Object.freeze(e),e),Qr=function(t,n,e){e=e||2;var i,r,o,s,a,u=n&&n.length,c=u?n[0]*e:t.length,h=Zr(t,0,c,e,!0),f=[];if(h&&h.next!==h.prev){if(u&&(h=function(t,n,e,i){var r,o,s,a,u=[];for(r=0,o=n.length;r<o;r++)a=n[r]*i,s=r<o-1?n[r+1]*i:t.length,(a=Zr(t,a,s,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(Jr),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){var u,c=e,h=e.x,f=e.y,l=1/0;for(i=e;r>=i.x&&i.x>=h&&r!==i.x&&to(o<f?r:s,o,h,f,o<f?s:r,o,i.x,i.y)&&(u=Math.abs(o-i.y)/(r-i.x),so(i,t))&&(u<l||u===l&&(i.x>e.x||i.x===e.x&&function(t,n){return no(t.prev,t,n.prev)<0&&no(n.next,t,t.next)<0}(e,i)))&&(e=i,l=u),(i=i.next)!==c;);}return e}(t,n))&&(t=ao(n,t),qr(n,n.next),qr(t,t.next))}(u[r],e),e=qr(e,e.next);return e}(t,n,h,e)),t.length>80*e){for(var l=i=t[0],d=r=t[1],v=e;v<c;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}Kr(h,f,e,l,d,a)}return f};function Zr(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=uo(o,t[o],t[o+1],s);else for(o=e-i;n<=o;o-=i)s=uo(o,t[o],t[o+1],s);return s&&eo(s,s.next)&&(co(s),s=s.next),s}function qr(t,n){if(!t)return t;n=n||t;var e,i=t;do{if(e=!1,i.steiner||!eo(i,i.next)&&0!==no(i.prev,i,i.next))i=i.next;else{if(co(i),(i=n=i.prev)===i.next)break;e=!0}}while(e||i!==n);return n}function Kr(t,n,e,i,r,o,s){if(t){if(!s&&o){for(var a=t,u=i,c=r,h=o,f=a;null===f.z&&(f.z=$r(f.x,f.y,u,c,h)),f.prevZ=f.prev,f.nextZ=f.next,(f=f.next)!==a;);f.prevZ.nextZ=null,f.prevZ=null;var l,d,v,p,m,y,b,g,_=f,w=1;do{for(d=_,m=_=null,y=0;d;){for(y++,v=d,l=b=0;l<w&&(b++,v=v.nextZ);l++);for(g=w;0<b||0<g&&v;)0!==b&&(0===g||!v||d.z<=v.z)?(d=(p=d).nextZ,b--):(v=(p=v).nextZ,g--),m?m.nextZ=p:_=p,p.prevZ=m,m=p;d=v}}while(m.nextZ=null,w*=2,1<y)}for(var x,E,S=t;t.prev!==t.next;)if(x=t.prev,E=t.next,o?function(t,n,e,i){var r=t.prev,o=t,s=t.next;if(0<=no(r,o,s))return;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,c=(r.x>o.x?r.x>s.x?r:s:o.x>s.x?o:s).x,h=(r.y>o.y?r.y>s.y?r:s:o.y>s.y?o:s).y,f=$r(a,u,n,e,i),l=$r(c,h,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&&to(r.x,r.y,o.x,o.y,s.x,s.y,d.x,d.y)&&0<=no(d.prev,d,d.next))return;if(d=d.prevZ,v!==t.prev&&v!==t.next&&to(r.x,r.y,o.x,o.y,s.x,s.y,v.x,v.y)&&0<=no(v.prev,v,v.next))return;v=v.nextZ}for(;d&&d.z>=f;){if(d!==t.prev&&d!==t.next&&to(r.x,r.y,o.x,o.y,s.x,s.y,d.x,d.y)&&0<=no(d.prev,d,d.next))return;d=d.prevZ}for(;v&&v.z<=l;){if(v!==t.prev&&v!==t.next&&to(r.x,r.y,o.x,o.y,s.x,s.y,v.x,v.y)&&0<=no(v.prev,v,v.next))return;v=v.nextZ}return 1}(t,i,r,o):function(t){var n=t.prev,e=t,i=t.next;if(0<=no(n,e,i))return;var r=t.next.next;for(;r!==t.prev;){if(to(n.x,n.y,e.x,e.y,i.x,i.y,r.x,r.y)&&0<=no(r.prev,r,r.next))return;r=r.next}return 1}(t))n.push(x.i/e),n.push(t.i/e),n.push(E.i/e),co(t),t=E.next,S=E.next;else if((t=E)===S){s?1===s?Kr(t=function(t,n,e){var i=t;do{var r=i.prev,o=i.next.next}while(!eo(r,o)&&io(r,i,i.next,o)&&so(r,o)&&so(o,r)&&(n.push(r.i/e),n.push(i.i/e),n.push(o.i/e),co(i),co(i.next),i=t=o),i=i.next,i!==t);return qr(i)}(qr(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,u=s.next.next;u!==s.prev;){if(s.i!==u.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&&io(e,e.next,t,n))return 1}while(e=e.next,e!==t);return}(t,n)&&(so(t,n)&&so(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)&&(no(t.prev,t,n.prev)||no(t,n.prev,n))||eo(t,n)&&0<no(t.prev,t,t.next)&&0<no(n.prev,n,n.next))}(s,u))return a=ao(s,u),s=qr(s,s.next),a=qr(a,a.next),Kr(s,n,e,i,r,o),Kr(a,n,e,i,r,o);u=u.next}}while(s=s.next,s!==t)}(t,n,e,i,r,o):Kr(qr(t),n,e,i,r,o,1);break}}}function Jr(t,n){return t.x-n.x}function $r(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 to(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 no(t,n,e){return(n.y-t.y)*(e.x-n.x)-(n.x-t.x)*(e.y-n.y)}function eo(t,n){return t.x===n.x&&t.y===n.y}function io(t,n,e,i){var r=oo(no(t,n,e)),o=oo(no(t,n,i)),s=oo(no(e,i,t)),a=oo(no(e,i,n));return r!==o&&s!==a||0===r&&ro(t,e,n)||0===o&&ro(t,i,n)||0===s&&ro(e,t,i)||!(0!==a||!ro(e,n,i))}function ro(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 oo(t){return 0<t?1:t<0?-1:0}function so(t,n){return no(t.prev,t,t.next)<0?0<=no(t,n,t.next)&&0<=no(t,t.prev,n):no(t,n,t.prev)<0||no(t,t.next,n)<0}function ao(t,n){var e=new ho(t.i,t.x,t.y),i=new ho(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 uo(t,n,e,i){t=new ho(t,n,e);return i?(t.next=i.next,(t.prev=i).next.prev=t,i.next=t):(t.prev=t).next=t,t}function co(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 ho(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 fo(t){return function(t){if(Array.isArray(t))return lo(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,n){var e;if(t)return"string"==typeof t?lo(t,n):"Map"===(e="Object"===(e=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?lo(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 lo(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 vo={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 vo.area(t)<0},triangulateShape:function(t,n){var e=[],i=[],r=[],o=(po(t),mo(e,t),t.length);n.forEach(po);for(var s=0;s<n.length;s++)i.push(o),o+=n[s].length,mo(e,n[s]);for(var a=Qr(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,fo(t[0]));for(var n=[],e=1;e<t.length;e++){var i=[];i.push.apply(i,fo(t[e])),n.push(i)}if(!vo.isClockWise(r))for(var r=r.reverse(),o=0,s=n.length;o<s;o++){var a=n[o];vo.isClockWise(a)&&(n[o]=a.reverse())}return vo.triangulateShape(r,n)}};function po(t){var n,e=t.length;2<e&&(e=t[e-1],n=t[0],e.x===n.x)&&e.y===n.y&&t.pop()}function mo(t,n){for(var e=0;e<n.length;e++)t.push(n[e].x),t.push(n[e].y)}function yo(t){return(yo="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 bo(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,function(t){t=function(t,n){if("object"!=yo(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=yo(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==yo(t)?t:t+""}(i.key),i)}}function go(t,n,e){return n&&bo(t.prototype,n),e&&bo(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}var _o=1e-5,wo=.001,xo=Math.PI/180,Eo=180/Math.PI,e=go(function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function")});Object.assign(e.prototype,{de:function(){return _o},ve:function(){return xo},pe:function(){return Eo},me:function(t){return t<_o&&-_o<t},ye:function(t){return _o<t},be:function(t){return t<-_o},ge:function(t,n,e){n=(t.x-e.x)*(n.y-e.y)-(n.x-e.x)*(t.y-e.y);return Math.abs(n)<_o?0:n},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]):(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},isPolygonContainPoint2:function(t,n){var e=t.length;if(e<3)return!1;for(var i=e-1,r=0,o=0;o<e;o++){var s=t[o],a=t[i];s.y>n.y!=a.y>n.y&&n.x<(a.x-s.x)*(n.y-s.y)/(a.y-s.y)+s.x&&(s.y>a.y?r++:r--),i=o}return 0!=r},isPolygonInPolygon:function(t,n){var e=Object.assign([],t),i=Object.assign([],n);e.push(e[0]),i.push(i[0]);for(var r=0;r<e.length-1;r++){var o=e[r];if(!this.isPolygonContainPoint(i,o)&&!this.isPolygonContainPoint2(i,o))return!1}for(var s=0;s<e.length-1;s++)for(var a=0;a<i.length-1;a++)if(this._e(e[s],e[s+1],i[a],i[a+1]).isintersect&&!this.we(i[a],i[a+1],e[s])&&!this.we(i[a],i[a+1],e[s+1]))return!1;return!0},xe: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))},Ee: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.ge(e,n,t)&&0===this.ge(n,i,t)||this.ge(e,n,t)*this.ge(n,i,t)<0||this.ge(t,i,e)*this.ge(i,n,e)<0)},Se:function(t,n,e){return!(t.x<n.x||t.y<n.y||t.x>e.x||t.y>e.y)},Te: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),n=Math.max(n.y,e.y);return!(t.x<i||t.x>r||t.y<o||t.y>n)},Ae: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),e=Math.max(e.y,n.y);return!(t.x<i||t.x>r||t.y<o||t.y>e)},Me: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},Oe: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)},Le:function(t,n){return Math.sqrt((t.x-n.x)*(t.x-n.x)+(t.y-n.y)*(t.y-n.y))},Re:function(t,n){return(t.x-n.x)*(t.x-n.x)+(t.y-n.y)*(t.y-n.y)},Ne:function(t,n,e){var i=n.x,n=n.y,r=e.x,e=e.y,o=t.x,t=t.y,s=r-i,a=e-n,u=s*s+a*a,c=o-i,h=t-n,f=c*c+h*h;return this.me(u)?this.me(f)?0:f:(u=Math.sqrt(u),h=this.ye(a=(s=s/u)*c+(c=a/u)*h)?this.be(a-u)?(h=o-(i+a*s))*h+(u=t-(n+a*c))*u:(i=o-r)*i+(s=t-e)*s:f,this.me(h)?0:h)},Pe:function(t,n,e,i){var r,o=n.x,s=n.y,a=e.x,u=e.y,c=t.x,t=t.y,h=a-o,f=u-s,l=Math.sqrt(h*h+f*f),d=c-o,v=t-s,p=Math.sqrt(d*d+v*v);return this.me(l)?(i.x=n.x,i.y=n.y,this.me(r=p)?0:r):(r=this.ye(f=(h=h/l)*d+(d=f/l)*v)?this.be(f-l)?(l=c-(v=o+f*h),h=t-(o=s+f*d),s=Math.sqrt(l*l+h*h),i.x=v,i.y=o,s):(f=c-a,d=t-u,l=Math.sqrt(f*f+d*d),i.x=e.x,i.y=e.y,l):(i.x=n.x,i.y=n.y,p),this.me(r)?0:r)},Fe: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}},je:function(t){for(var n=vo.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]],c=a.x-s.x,h=a.y-s.y,f=u.x-s.x,c=(c*(u.y-s.y)-f*h)/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}},Ie: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)},Ce:function(t,n,e,i,r){var o,s;return this.Ee(t,n,e,i)?(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),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):0},De: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),c=t.x,h=t.y,f=e.x,l=e.y,d=i.x,v=i.y;if(90==n)return!(t.x<o||t.x>s||(Math.abs(s-o<wo)?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):(r.y=p=(v-l)/(d-f)*(c-f)+l,r.x=c,p<h||!this.Ae(r,e,i))));if(270==n)return!(t.x<o||t.x>s||(Math.abs(s-o<wo)?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):(r.y=p=(v-l)/(d-f)*(c-f)+l,r.x=c,h<p||!this.Ae(r,e,i))));if(270!=n&&90!=n&&Math.abs(s-o<wo)){var t=o,p=Math.tan(n/180*Math.PI)*(t-c)+h;if(r.y=p,r.x=t,this.Ae(r,e,i))return s=p-h,0<(o=t-c)/Math.sqrt(o*o+s*s)*Math.cos(n/180*Math.PI)}return Math.abs(u-a<=wo)?(p=a,t=1/Math.tan(n/180*Math.PI)*(p-h)+c,r.x=t,r.y=p,!!this.Ae(r,e,i)&&(o=p-h,0<(s=t-c)/Math.sqrt(s*s+o*o)*Math.cos(n/180*Math.PI))):(t=h+(u=Math.tan(n/180*Math.PI))*((p=(l-h-((a=(v-l)/(d-f))*f-u*c))/(u-a))-c),r.x=p,r.y=t,!!this.Ae(r,e,i)&&(s=p-c,o=t-h,Math.abs(s)<=wo&&Math.abs(o)<=wo||0<s/Math.sqrt(s*s+o*o)*Math.cos(n/180*Math.PI)))},ke:function(t,n){return Math.abs(t.x-n.x)<_o&&Math.abs(t.y-n.y)<_o},Ue:function(t,n,e,i){var r,o,s,a,u=t.x,c=t.y,h=n.x,f=n.y,l=e.x,d=e.y;return this.ke(t,n)||this.ke(t,e)?(i.x=u,i.y=c,!0):(s=Math.min(n.x,e.x),a=Math.max(n.x,e.x),r=Math.min(n.y,e.y),o=Math.max(n.y,e.y),Math.abs(h-l)<1e-5?(i.x=h,r<=(i.y=c)&&c<=o):Math.abs(f-d)<1e-5?(i.x=u,i.y=f,s<=u&&u<=a):(a=c+(r=-1/((d-f)/(l-h)))*((s=(f-c-((o=(d-f)/(l-h))*h-r*u))/(r-o))-u),i.x=s,i.y=a,!!this.Ae(i,n,e)||!(!this.ke(t,n)&&!this.ke(t,e))))},Be: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}},Ge:function(t,n){return t.x*n.x+t.y*n.y+t.z*n.z},He:function(t){return Math.sqrt(t.x*t.x+t.y*t.y+t.z*t.z)},Xe:function(t,n){return t.x*n.x+t.y*n.y},Ve:function(t,n){return t.x*n.y-t.y*n.x},ze:function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},We:function(t,n){var e,i;return 0==t.x&&0==t.y||0==n.x&&0==n.y?0:(e={x:t.x,y:t.y,z:0},i={x:n.x,y:n.y,z:0},e=this.Be(e,i),i=this.Xe(t,n),i=Math.acos(i/(this.ze(t)*this.ze(n))),0<e.z?i/Math.PI*180:360-i/Math.PI*180)},Ye: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.Ce(t,n,o,s,i))return!0}return!1},Qe: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),s=Math.sqrt((s-o)*(s-o)+(u-a)*(u-a)),o=n/180*Math.PI,u=s*Math.cos(o)+t.x,a=s*Math.sin(o)+t.y;return 1==this.Ce(t,{x:u,y:a},e,i,r)},Ze:function(t){var n={x:null,y:null},e=0,i=0,r=t.length;1<t.length&&t[0].x===t[t.length-1].x&&t[0].y===t[t.length-1].y&&r--;for(var o=0;o<r;o++)e+=t[o].x,i+=t[o].y;return n.x=e/t.length,n.y=i/t.length,n},qe:function(t,n,e,i){var r=[],o=t.x-n,s=t.x+n,a=t.y-n,u=t.y+n,c=Math.min(e.x,i.x),h=Math.max(e.x,i.x),f=Math.min(e.y,i.y),l=Math.max(e.y,i.y);return h<o||s<c||l<a||u<f||(o=i.x-e.x,s=i.y-e.y,(a=(t=(o*(a=t.x-e.x)+s*(u=t.y-e.y))/(i=o*o+s*s))*t-(a*a+u*u-n*n)/i)<0)||(u=Math.sqrt(a),i={x:e.x-o*(n=-t+u),y:e.y-s*n},o={x:e.x-o*(a=-t-u),y:e.y-s*a},n!==a&&(c<=i.x&&i.x<=h&&f<=i.y&&i.y<=l&&r.push(i),c<=o.x)&&o.x<=h&&f<=o.y&&o.y<=l&&r.push(o)),r},Ke:function(t,n,e){var i,r={};if(t.x!=n.x)return i=n=(n.y-t.y)/(n.x-t.x),n=t.y-n*t.x,r.x=(+e.x- -1*i*e.y-i*n)/(i*i+1),r.y=(i*i*e.y- -1*i*e.x- -1*n)/(i*i+1),r;r.x=t.x,r.y=e.y},_e:function(t,n,e,i){var r,o,s,a,u={point:null,isintersect:!1};return this.distanceOfTwoPoints(t,e)<.001||this.distanceOfTwoPoints(t,i)<.001?(u.isintersect=!0,u.point=t):this.distanceOfTwoPoints(n,e)<.001||this.distanceOfTwoPoints(n,i)<.001?(u.isintersect=!0,u.point=n):(r={x:n.x-t.x,y:n.y-t.y},o={x:i.x-e.x,y:i.y-e.y},s={x:e.x-t.x,y:e.y-t.y},i={x:i.x-t.x,y:i.y-t.y},n={x:n.x-e.x,y:n.y-e.y},e={x:-s.x,y:-s.y},a=this.Ve(o,r),Math.abs(a)<=1e-5||this.Ve(s,r)*this.Ve(i,r)<=-5e-4&&this.Ve(e,o)*this.Ve(n,o)<-5e-4&&(i=this.Ve(o,s)/a,u.point={x:t.x+r.x*i,y:t.y+r.y*i},u.isintersect=!0)),u},Je:function(t,n,e){t.x===n.x&&(n.x=n.x+1),t.y===n.y&&(n.y=n.y+1),n.x===e.x&&(e.x=e.x+1),n.y===e.y&&(e.y=e.y+1);var i=n.x-t.x,t=n.y-t.y,r=e.x-n.x;return!(0<i*(e.y-n.y)-t*r)},getAngle:function(t){var n=t.p1,t=t.p2,e=t.x-n.x,t=t.y-n.y,n=Math.sqrt(e*e+t*t),n=Math.asin(Math.abs(t)/n);return 0<e&&0<t?n:e<0&&0<t?Math.PI-n:e<0&&t<0?Math.PI+n:0<e&&t<0?2*Math.PI-n:0==e&&0<t?n:0==e&&t<0?3*Math.PI/2:0<e&&0==t?n:e<0&&0==t?Math.PI:null},$e:function(t){var n=this.distanceOfTwoPoints(t[0],t[1]),e=this.distanceOfTwoPoints(t[1],t[2]),t=this.distanceOfTwoPoints(t[0],t[2]),i=(n+e+t)/2;return Math.sqrt(i*(i-n)*(i-e)*(i-t))},ti:function(t,n){var e,i,r,o,s;return this.Pe(t,n[0],n[1],{})<1e-4||this.Pe(t,n[0],n[2],{})<1e-4||this.Pe(t,n[1],n[2],{})<1e-4||(o={x:n[1].x-n[0].x,y:n[1].y-n[0].y},e={x:n[0].x-n[2].x,y:n[0].y-n[2].y},i={x:n[2].x-n[1].x,y:n[2].y-n[1].y},s={x:t.x-n[0].x,y:t.y-n[0].y},r={x:t.x-n[1].x,y:t.y-n[1].y},t={x:t.x-n[2].x,y:t.y-n[2].y},n=this.Ve(o,s),o=this.Ve(i,r),s=this.Ve(e,t),_o<n*o&&_o<o*s)},ni:function(t,n,e){var i=e.length,r={isintersect:!1,start:null,end:null,type:0,outer:null},o=[];if(this.ti(t,e)&&(r.start=t),this.ti(n,e)&&(r.end=n),null!=r.start&&null!=r.end)r.isintersect=!0,r.type=1;else{for(var s=(e[1].x+e[2].x)/2,a=(e[1].y+e[2].y)/2,u=1;u<i;u++){var c,h=this._e(t,n,e[u-1],e[u]);if(h.isintersect){if(null!=r.start)return r.end=h.point,r.isintersect=!0,r.outer="end",c=this.We({x:s-e[0].x,y:a-e[0].y},{x:n.x-e[0].x,y:n.y-e[0].y}),r.type=0<(c=c<180?c:c-360)?2:3,r;if(null!=r.end)return r.start=h.point,r.isintersect=!0,r.outer="start",c=this.We({x:s-e[0].x,y:a-e[0].y},{x:t.x-e[0].x,y:t.y-e[0].y}),r.type=0<(c=c<180?c:c-360)?2:3,r;o.push(h)}}var f,l=this._e(t,n,e[0],e[i-1]);if(l.isintersect){if(null!=r.start)return r.end=l.point,r.isintersect=!0,r.outer="end",f=this.We({x:s-e[0].x,y:a-e[0].y},{x:n.x-e[0].x,y:n.y-e[0].y}),r.type=0<(f=f<180?f:f-360)?2:3,r;if(null!=r.end)return r.start=l.point,r.isintersect=!0,r.outer="start",f=this.We({x:s-e[0].x,y:a-e[0].y},{x:t.x-e[0].x,y:t.y-e[0].y}),r.type=0<(f=f<180?f:f-360)?2:3,r;o.push(l)}2!=o.length||this.distanceOfTwoPoints(o[0].point,o[1].point)<.01||(this.distanceOfTwoPoints(o[0].point,t)<=this.distanceOfTwoPoints(o[0].point,n)?(r.start=o[0].point,r.end=o[1].point):(r.start=o[1].point,r.end=o[0].point),r.isintersect=!0,r.type=4)}return r},ei:function(t,n,e){var i=e.length,r={isintersect:!1,start:null,end:null},o=[];if(this.ti(t,e)&&(r.start=t),this.ti(n,e)&&(r.end=n),null!=r.start&&null!=r.end)r.isintersect=!0;else{for(var s=1;s<i;s++){var a=this._e(t,n,e[s-1],e[s]);if(a.isintersect){if(null!=r.start)return r.end=a.point,r.isintersect=!0,r;if(null!=r.end)return r.start=t,r.isintersect=!0,r;o.push(a)}}var u=this._e(t,n,e[0],e[i-1]);if(u.isintersect){if(null!=r.start)return r.end=u.point,r.isintersect=!0,r;if(null!=r.end)return r.start=t,r.isintersect=!0,r;o.push(u)}2==o.length&&(r.start=(this.distanceOfTwoPoints(o[0].point,t)<=this.distanceOfTwoPoints(o[0].point,n)?o[0]:o[1]).point,r.end=(this.distanceOfTwoPoints(o[0].point,t)>this.distanceOfTwoPoints(o[0].point,n)?o[0]:o[1]).point,r.isintersect=!0)}return r},ii:function(r,t){if(0==t.length)return[r];for(var n,e,i=this.ri(t),o=[],s=(i.sort(function(t,n){var e=(t.oi.x-r.oi.x)*(t.oi.x-r.oi.x)+(t.oi.y-r.oi.y)*(t.oi.y-r.oi.y),i=(n.oi.x-r.oi.x)*(n.oi.x-r.oi.x)+(n.oi.y-r.oi.y)*(n.oi.y-r.oi.y),t=(t.si.x-r.oi.x)*(t.si.x-r.oi.x)+(t.si.y-r.oi.y)*(t.si.y-r.oi.y),n=(n.si.x-r.oi.x)*(n.si.x-r.oi.x)+(n.si.y-r.oi.y)*(n.si.y-r.oi.y);return(e<t?e:t)<(i<n?i:n)}),0),s=0;s<i.length;s++)this.distanceOfTwoPoints(i[s].oi,i[s].si)<.01||(n=this.distanceOfTwoPoints(i[s].oi,r.oi),e=this.distanceOfTwoPoints(i[s].si,r.oi),n<.01?r.oi=i[s].si:e<.01?r.oi=i[s].oi:n<e?.1<this.distanceOfTwoPoints(r.oi,i[s].oi)&&(o.push({ai:r.ai,oi:r.oi,si:i[s].oi,Le:r.Le,ui:r.ui}),r.oi=i[s].si):.1<this.distanceOfTwoPoints(r.oi,i[s].si)&&(o.push({ai:r.ai,oi:r.oi,si:i[s].si,Le:r.Le,ui:r.ui}),r.oi=i[s].oi),i.splice(s,1));return.1<this.distanceOfTwoPoints(r.oi,r.si)&&o.push(r),o},ri:function(t){var n=[];if(1==t.length)return t;for(var e=t[0],i=1;0<t.length;){if(i>=t.length){if(n.push(e),t.splice(0,1),t.length<1)break;e=t[0],i=1}if(1===t.length){n.push(e);break}this.we(e.oi,e.si,t[i].oi)?(this.we(e.oi,e.si,t[i].si)||(e.si=t[i].si),t.splice(i,1)):this.we(e.oi,e.si,t[i].si)?(e.oi=t[i].oi,t.splice(i,1)):this.we(t[i].oi,t[i].si,e.oi)?(e=(this.we(t[i].oi,t[i].si,e.si)||(t[i].si=e.si),t[i]),t.splice(i,1)):this.we(t[i].oi,t[i].si,e.si)?(t[i].oi=e.oi,e=t[i],t.splice(i,1)):i++}return n},we:function(t,n,e){var i=t.x-e.x,r=t.y-e.y,o=n.x-e.x,s=n.y-e.y,a=this.distanceOfTwoPoints(t,e),e=this.distanceOfTwoPoints(n,e),t=this.distanceOfTwoPoints(t,n);return i*s-r*o<1e-5&&a+e-t<.001}});var z=new e;function So(t){return(So="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 To(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,function(t){t=function(t,n){if("object"!=So(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=So(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==So(t)?t:t+""}(i.key),i)}}function Ao(t,n,e){n=Oo(n);var i=t,n=Mo()?Reflect.construct(n,e||[],Oo(t).constructor):n.apply(t,e);if(n&&("object"===So(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function Mo(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Mo=function(){return!!t})()}function Oo(t){return(Oo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Lo(t,n){return(Lo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var e=function(){function e(t,n){if(this instanceof e)return(t=Ao(this,e,[t,n])).ci=new Ii,t.fi=null,t;throw new TypeError("Cannot call a class as a function")}var t,n,i=e,r=Wr;if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");return i.prototype=Object.create(r&&r.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),r&&Lo(i,r),i=e,t&&To(i.prototype,t),n&&To(i,n),Object.defineProperty(i,"prototype",{writable:!1}),i}(),Ro=(Object.assign(e.prototype,{fe:function(t){return t.getType()!=Yr.MODEL?this.li(t):this.di(t)},di:function(t){return!0},vi:function(t){t=t.getBound();return!!z.xe(this.ci.X,this.ci.H,t.min,t.max)},le:function(t,n){var e=t.getCoordinates();if(t.getType()!==Yr.MODEL)n.Le=Math.sqrt(z.Re(e[0],this.Jt));else{for(var i=Number.MAX_VALUE,r=0,o=e.length;r<o;r++)for(var s=1,a=e[r].length;s<a;s++){var u=e[r][s-1],c=e[r][s],u=z.Ne(this.Jt,u,c);u<i&&(i=u)}n.Le=Math.sqrt(i)}},li:function(t){t=t.getCoordinates()[0];return!!z.Se(t,this.ci.X,this.ci.H)&&("circle"===this.fi?z.Re(t,this.Jt)<this._radiusSquare:z.Me(t,this.pi,this.pi.length-1))}}),e);function No(t){return(No="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 Po(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,function(t){t=function(t,n){if("object"!=No(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=No(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==No(t)?t:t+""}(i.key),i)}}function Fo(t,n,e){n=Io(n);var i=t,n=jo()?Reflect.construct(n,e||[],Io(t).constructor):n.apply(t,e);if(n&&("object"===No(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function jo(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(jo=function(){return!!t})()}function Io(t){return(Io=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Co(t,n){return(Co=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var e=function(){function e(t,n){if(this instanceof e)return(t=Fo(this,e,[t,n])).fi="polygon",t.pi=t.he,t.mi=t.pi.length-1,t.Jt=z.je(t.pi),t.ci.Qt(t.pi),t;throw new TypeError("Cannot call a class as a function")}var t,n,i=e,r=Ro;if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");return i.prototype=Object.create(r&&r.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),r&&Co(i,r),i=e,t&&Po(i.prototype,t),n&&Po(i,n),Object.defineProperty(i,"prototype",{writable:!1}),i}(),Do=(Object.assign(e.prototype,{di:function(t){if(this.vi(t)){for(var n=t.getCoordinates(),e=0,i=n.length;e<i;e++)for(var r=0,o=n[e].length-1;r<o;r++)if(z.Me(n[e][r],this.pi,this.pi.length))return!0;for(var s=0;s<this.mi;s++){for(var a=!1,u=0,c=n.length;u<c;u++)z.Me(this.pi[s],n[u],n[u].length-1)&&(a=0==u);if(a)return!0}for(var h=0;h<=this.mi;h++)for(var f=null,l=null,l=h===this.mi?(f=this.pi[0],this.pi[h]):(f=this.pi[h],this.pi[h+1]),d=0,v=n.length;d<v;d++)for(var p=0,m=n[d].length-1;p<m;p++){var y=n[d][p],b=n[d][p+1];if(z.Ee(f,l,y,b))return!0}}return!1}}),e),ko=t(30),e={STOP:0,PASS:1,PUSH:2},Uo=(Object.freeze(e),e);function Bo(t){return(Bo="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 Go(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,function(t){t=function(t,n){if("object"!=Bo(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Bo(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Bo(t)?t:t+""}(i.key),i)}}var e=function(){function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");this.yi=-1,this.bi=Yr.NONE,this.gi=null,this.ci=null}return n=t,(e=[{key:"getType",value:function(){return this.bi}},{key:"getCoordinates",value:function(){return this.gi}},{key:"getBound",value:function(){return this.ci||this._i(),this.ci}}])&&Go(n.prototype,e),i&&Go(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,e,i}(),Ho=(Object.assign(e.prototype,{Yn:function(){},wi:function(t){t._support(this)==Uo.PUSH&&t._result.push(this)}}),e);function Xo(t){return(Xo="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 Vo(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,function(t){t=function(t,n){if("object"!=Xo(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Xo(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Xo(t)?t:t+""}(i.key),i)}}function zo(t,n,e){n=Yo(n);var i=t,n=Wo()?Reflect.construct(n,e||[],Yo(t).constructor):n.apply(t,e);if(n&&("object"===Xo(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function Wo(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Wo=function(){return!!t})()}function Yo(t){return(Yo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Qo(t,n){return(Qo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var e=function(){function e(t){var n;if(this instanceof e)return(n=zo(this,e)).yi=t.eid,n.bi=Yr.POLYGON,Object.assign(n,t),n;throw new TypeError("Cannot call a class as a function")}var t,n=e,i=Ho;if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");return n.prototype=Object.create(i&&i.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),i&&Qo(n,i),n=e,(i=[{key:"getCenter",value:function(){return this.Jt}}])&&Vo(n.prototype,i),t&&Vo(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}(),Zo=(Object.assign(e.prototype,{_i:function(){var n=this;this.ci=new Ii,this.gi&&this.gi.forEach(function(t){n.ci.Qt(t)})},wi:function(t){t._support(this)==Uo.PUSH&&t._result.push(this)}}),e),e={NO_RIGHT_CLICK:2,NORMAL:4},qo=(Object.freeze(e),e);function Ko(t){return function(t){if(Array.isArray(t))return Jo(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,n){var e;if(t)return"string"==typeof t?Jo(t,n):"Map"===(e="Object"===(e=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Jo(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 Jo(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 $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 ts(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,function(t){t=function(t,n){if("object"!=$o(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=$o(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==$o(t)?t:t+""}(i.key),i)}}var e=function(){function r(t,n,e){var i=this;if(!(this instanceof r))throw new TypeError("Cannot call a class as a function");this._n=t,this.Sn=e,this.xi=[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.Lt=[],this.Ei=new Map,this.Si=null,this.Ti=this.Sn.Ai,this.Mi=null,this.Gt=new lr(this._n.Ut,n,this._n),this.Gt.enableDamping=this._n.Oi.enableDamping,this.Gt.dampingFactor=.08,this._n.Oi.mouseMode===qo.NO_RIGHT_CLICK&&this.Gt.setMouseMiddleButtonRotation(),this.Li=null,this.Gt.addEventListener("change",function(){i.Vn(),i._n.kt.Dt({type:"viewChanged"}),i._n.It.Ri=1,null!==i.Li&&clearTimeout(i.Li),i.Li=setTimeout(function(){i._n.It.Ri=0,i._n.enableUpdateRender()},10)}),this.Ni=new Hr(this.Gt,this._n.Mn,this._n.Bt);t=!this._n.Oi.lock;this.Gt.enableZoom=t,this.Gt.enablePan=t,this.Gt.enableRotate=t,this.Gt.enableRotateLeft=t,this.Gt.enableRotateUp=t,this.Pi=t,this.Fi=t,this.ji=t,this.Ii=t,this.Ci=this.Gt.useRange}return t=r,(n=[{key:"enableZoom",get:function(){return this.Pi},set:function(t){this.Pi=t,this.Gt.enableZoom=t}},{key:"enableDragRange",get:function(){return this.Ci},set:function(t){this.Ci=t}},{key:"enableDrag",get:function(){return this.Fi},set:function(t){this.Fi=t,this.Gt.enablePan=t}},{key:"enableRotate",get:function(){return this.ji},set:function(t){this.ji=t,this.Gt.enableRotateLeft=t}},{key:"enableTilt",get:function(){return this.Ii},set:function(t){this.Ii=t,this.Gt.enableRotateUp=t}},{key:"enableDamping",get:function(){return this.Gt.enableDamping},set:function(t){this.Gt.enableDamping=t}},{key:"controls",get:function(){return this.Gt},set:function(t){this.Gt=t}},{key:"autoCameraNearFar",get:function(){return this.Ni}},{key:"mouseMode",get:function(){return this._n.Oi.mouseMode}},{key:"zoomSpeed",get:function(){return this.Gt.zoomSpeedParam},set:function(t){this.Gt.zoomSpeedParam=t}},{key:"copyControls",value:function(t){t=new lr(t,this.Gt.domElement,this._n);return t.target=(new Tt).copy(this.Gt.target),t.maxDistance=this.Gt.maxDistance,t.minDistance=this.Gt.minDistance,t.minZoom=this.Gt.minZoom,t.maxZoom=this.Gt.maxZoom,t.minPolarAngle=this.Gt.minPolarAngle,t.maxPolarAngle=this.Gt.maxPolarAngle,t.update({theta:this.Gt.getAzimuthalAngle()}),t}},{key:"pauseDamping",value:function(){this.Gt&&this.Gt.pauseDamping()}},{key:"resumeDamping",value:function(){this.Gt&&this.Gt.pauseDamping()}}])&&ts(t.prototype,n),e&&ts(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,e}(),ns=(Object.assign(e.prototype,{Yn:function(){for(var t in clearTimeout(this.Li),this.Gt.dispose(),this)this[""+t]=null,delete this[""+t]},Di:function(){var t,n=this.ki(this.Sn.zoom),e=this.Ui(n),i=this.Sn.Jt,r=this._n.Pt.Bi(this._n.An.yi,this._n.An.level);r?(i.y=r.nt,this.Gt.target=(new Tt).copy(i),this.Gt.object.lookAt(i),this.Gi(),this.Sn.Ai===Si.MODE_3D?(r=(u.TILT_UPPER_BOUND-this.Sn.Hi)*u.DEG2RAD,t=e*Math.cos(r),r=e*Math.sin(r),this.Gt.object.position.set(i.x,i.y+t,i.z+r),this.Gt.minPolarAngle=(u.TILT_UPPER_BOUND-this._n.Oi.maxTiltAngle)*u.DEG2RAD,this.Gt.maxPolarAngle=(u.TILT_UPPER_BOUND-this._n.Oi.minTiltAngle)*u.DEG2RAD):(t=this.Xi(n),this.Gt.minPolarAngle=0,this.Gt.maxPolarAngle=0,this.Gt.object.position.set(i.x,i.y+e,i.z),this.Gt.object.zoom=1/t,this.Gt.object.updateProjectionMatrix()),r=this.Vi(this.Sn.Kt),this.Gt.update({theta:this.Gt.getAzimuthalAngle()+r})):(this._n.zi.error.push(n={type:"info",InfoMode:mr.DEFAULT_LEVEL_ERROR}),this._n.kt.Dt(n))},Wi:function(t){this.Gt.target=t,this.Gt.update()},Yi:function(e){var i,t,n,r=this;this.Ti===e.mode?e.mode===this._n.getViewMode()&&e.finish&&e.finish():(this.Ti=e.mode,i=this.Gt,this.Mi&&!1===this.Mi.Hn&&this.Mi.finish(),e.mode===Si.MODE_2D?(i.minPolarAngle=-90*u.DEG2RAD,this.Sn.Hi=this._n.getTilt(),this.Qi({animate:void 0===e.animate||e.animate,duration:1,tilt:90,finish:function(){i.maxPolarAngle=0;var t=r._n.Bt,n=r.Zi(),n=r.Xi(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._n.Ut=t,r._n.It.Xt(),e.finish&&e.finish(),r._n.kt.Dt({type:"viewModeChanged"})}})):e.mode===Si.MODE_3D&&(i.maxPolarAngle=(u.TILT_UPPER_BOUND-this._n.Oi.minTiltAngle)*u.DEG2RAD,t=this._n.Mn,n=this.qi(),n=this.Ui(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._n.Ut=t,this._n.It.Xt(),this.Qi({animate:void 0===e.animate||e.animate,duration:1,tilt:this.Sn.Hi,finish:e.finish}),this._n.kt.Dt({type:"viewModeChanged"})))},Ki:function(t){var n;(n=this.Lt).push.apply(n,Ko(t))},Vn:function(){for(var t=0;t<this.Lt.length;t++)this.Lt[t].call(this._n.It)},xn:function(){try{var t=!1,n=this._n.camera,e=this._n.getBuilding(this.Sn.En),i=e.getFloor(e.level),r=i.getLayers(E.EXTENT_LAYER)[0];if(this._n.Oi.panRangeValue){for(var o,s,a,u,c=new zt,h=(c.setFromProjectionMatrix((new At).multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse)),null),f=0;f<r.Lt.length;f++)r.Lt[f].Rt&&(h=r.Lt[f].Rt);return null===h?!1:(o=h.geometry.boundingSphere,(s=new kt).copy(o).applyMatrix4(h.matrixWorld),u=new kt(new Tt((a=this._n.Oi.panRangeValue).center.x-this._n.x,s.center.y,this._n.y-a.center.y),a.radius),c.intersectsSphere(u))}for(var l=[],d=this._n.Oi.container.clientWidth,v=this._n.Oi.container.clientHeight,p=(l.push(pr.coordsScreenToMap(this._n,{x:0,y:0,level:i.level,buildingID:e.yi})),l.push(pr.coordsScreenToMap(this._n,{x:d,y:0,level:i.level,buildingID:e.yi})),l.push(pr.coordsScreenToMap(this._n,{x:d,y:v,level:i.level,buildingID:e.yi})),l.push(pr.coordsScreenToMap(this._n,{x:0,y:v,level:i.level,buildingID:e.yi})),new Do("polygon",l)),m=0;m<r.Lt.length;m++){var y=function(t){for(var n=[],e=0;e<t.length;e++)n.push([t[e].x,t[e].y]);for(var i=Object(ko.polygonScale)(n,.9),r=[],o=0;o<i.length;o++)r.push({x:i[o][0],y:i[o][1]});return new Zo({eid:"1",gi:[r]})}(r.Lt[m].G.gi[0]);if(p.di(y)){t=!0;break}}return t}catch(t){return!0}}}),Object.assign(e.prototype,{Ji:function(t){var n=this,t=this._n.getZoom()*t,e=new Pr({src:[this._n.getZoom()],dest:[t]});t>this.Sn.$i[1]||t<this.Sn.$i[0]||(e.qn(.5).Jn(function(t){return n._n.setZoom({animate:!1,zoom:t.destination[0]})}).$n(function(){return n._n.nr.tr(e)}),this._n.nr.Ki(e.Wn()))},er:function(){var t=this._n.Ut.isPerspectiveCamera?this.Zi():this.qi();return this.ir(t)},rr:function(n){var e,i,r=this,t=(this.Sn.zoom=n.zoom,Number.isFinite(n.duration)?n.duration:.5),o=this.ki(this.Sn.zoom),s=this.Ui(o),a=this.Gt.object.position.distanceTo(this.Gt.target),u=(new Tt).copy(this.Gt.object.position).sub(this.Gt.target).normalize(),c=(new Tt).copy(u).multiplyScalar(s-a);this._n.Ut.isPerspectiveCamera?"animate"in n&&!n.animate?(this.Gt.update({offset:c}),n.finish&&n.finish()):((e=new Pr({src:[0,0,0],dest:[c.x,c.y,c.z]})).qn(t).Jn(function(t){"PerspectiveCamera"===r._n.Ut.type?r.Gt.update({offset:new Tt(t.delta[0],t.delta[1],t.delta[2])}):(r._n.nr.tr(e),r.rr({zoom:n.zoom,animate:!1,finish:n.finish}))}).$n(function(){r._n.nr.tr(e),n.finish&&n.finish()}),this._n.nr.Ki(e.Wn())):"animate"in n&&!n.animate?(u=this.Xi(o),this._n.Ut.zoom=1/u,this._n.Ut.updateProjectionMatrix(),this._n.It.Xt(),this.Gt.update({offset:c}),n.finish&&n.finish()):((i=new Pr({src:[this.qi()],dest:[o]})).qn(t).Jn(function(t){"OrthographicCamera"===r._n.Ut.type?(t=r.Xi(t.destination[0]),r._n.Ut.zoom=1/t,r._n.Ut.updateProjectionMatrix(),r._n.It.Xt(),r._n.enableUpdateRender(),r._n.sr()):(r._n.nr.tr(i),r.rr({zoom:n.zoom,animate:!1,finish:n.finish}))}).$n(function(){r.Gt.update({offset:c}),r._n.nr.tr(i),n.finish&&n.finish()}),this._n.nr.Ki(i.Wn()))},ar:function(t){this.Sn.$i=t,this.Gi(),this.Gt.update()},Gi:function(){var t=this.ki(this.Sn.$i[0]),n=this.ki(this.Sn.$i[1]);this.Gt.maxDistance=this.Ui(t),this.Gt.minDistance=this.Ui(n),this.Gt.minZoom=1/this.Xi(t),this.Gt.maxZoom=1/this.Xi(n)},ki:function(t){var n=this.xi.length-1,e=(--t,t=Math.max(0,Math.min(t,n)),Math.floor(t)),t=t-e,i=Math.max(0,Math.min(e,n)),n=Math.max(0,Math.min(e+1,n)),i=this.xi[i]-this.xi[n];return this.xi[e]-i*t},ir:function(t){for(var n=0,e=.1,i=!1,r=0;r<this.xi.length-1;r++)if(t<=this.xi[r]&&t>this.xi[r+1]){n=r,e=(this.xi[r]-t)/(this.xi[r]-this.xi[r+1]),i=!0;break}var o;return i?parseFloat((n+1+e).toFixed(2)):(o=this.xi.length-1,t<=this.xi[o]?1+o:1)},Ui:function(t){return t/100*(this._n.It.renderer.domElement.clientHeight/_r.getMapScaleInfo())/2/Math.tan(u.FOV/2*u.DEG2RAD)},Zi:function(){return(new Tt).copy(this.Gt.object.position).sub(this.Gt.target).length()*(100*Math.tan(u.FOV/2*u.DEG2RAD)*2/(this._n.It.renderer.domElement.clientHeight/_r.getMapScaleInfo()))},qi:function(){var t=this._n.Ut.top,n=this._n.Ut.bottom;return Math.abs(t-n)*_r.getMapScaleInfo()*100/this._n.It.renderer.domElement.clientHeight/this._n.Ut.zoom},Xi:function(t){var n=this._n.Bt.top,e=this._n.Bt.bottom;return t/(Math.abs(n-e)*_r.getMapScaleInfo()*100/this._n.It.renderer.domElement.clientHeight)}}),Object.assign(e.prototype,{Qi:function(t){var n,e=this,i=this.Gt,r=t.finish;"animate"in t&&!t.animate?(i.update({phi:(u.TILT_UPPER_BOUND-t.tilt)*u.DEG2RAD}),i.update(),r&&r()):(null===this.Mi&&(this.Mi=new Pr),n=Number.isFinite(t.duration)?t.duration:.5,this.Mi.Qn([this._n.getTilt()]).Zn([t.tilt]).qn(n).Jn(function(t){i.update({phi:(u.TILT_UPPER_BOUND-t.destination[0])*u.DEG2RAD})}).$n(function(){i.update({phi:(u.TILT_UPPER_BOUND-t.tilt)*u.DEG2RAD}),i.update(),e._n.nr.tr(e.Mi),r&&r()}),this._n.nr.Ki(this.Mi.Wn()))},ur:function(){var t=Lr.round(-this.Gt.getAzimuthalAngle()*u.RAD2DEG);return 360<(t=t<0?360+t:t)&&(t%=360),t},Vi:function(t){t=-t%360*u.DEG2RAD-this.Gt.getAzimuthalAngle();return t=0!==t?Math.sin(t)/Math.abs(Math.sin(t))*Math.acos(Math.cos(t)):t},cr:function(t){var n,e,i=this,r=void 0!==t.loop&&t.loop,o=void 0!==t.direction?t.direction:0,s=this.Gt.getAzimuthalAngle();if(o=r?0===o?s-2*Math.PI:2*Math.PI+s:s+this.Vi(t.rotation),!("animate"in t)||t.animate)return n=t&&t.duration&&Number.isFinite(t.duration)?t.duration:.5,(e=new Pr({src:[s],dest:[o]})).qn(n).te(r).Jn(function(t){i.Gt.update({theta:t.destination[0]})}).$n(function(){r||i._n.nr.tr(e),t.finish&&t.finish()}),this._n.nr.Ki(e.Wn()),e;this.Gt.update({theta:o}),t.finish&&t.finish()}}),Object.assign(e.prototype,{hr:function(){var t=this.Gt.target,n=this._n.Lt[0];return{x:parseFloat((n.x+t.x).toFixed(4)),y:parseFloat((n.y-t.z).toFixed(4))}},lr:function(t){var n,e,i,r=this,o=this.Gt,s=this._n.Lt[0],a=t.x-s.x,s=-t.y+s.y,u=o.target.x,c=o.target.z,h=t.height;!!h&&Number.isFinite(h)?(e=o.target.y,n=h):e=n=0,"animate"in t&&t.animate?(h=Number.isFinite(t.duration)?t.duration:.5,(i=new Pr({src:[u,e,c],dest:[a,n,s]})).qn(h).Jn(function(t){o.panAdd({x:t.delta[0],y:t.delta[1],z:t.delta[2]}),o.update(),r._n.It.Xt()}).$n(function(){r._n.nr.tr(i),r._n.It.Xt(),t.finish&&t.finish()}),this._n.nr.Ki(i.Wn())):(o.panAdd({x:a-u,y:n-e,z:s-c}),o.update(),t.finish&&t.finish(),this._n.It.Xt())},dr:function(n,e){function t(){i.Sn.vr(n.yi).level=e.level,i._n.It.On(),i._n.Pt.pr();var t={type:"levelChanged",level:e.level};n!==i._n.An&&(t.buildingID=n.yi),i._n.kt.Dt(t),i.enableDragRange&&r.saveState(),e.finish&&e.finish(e.level),i._n.It.Xt()}var i=this,r=this.Gt;n===this._n.An||this._n.mr?this.yr(n,{level:e.level,animate:e.animate,duration:e.duration,callback:e.callback,finish:function(){t()}}):t()},yr:function(t,n){var e=void 0!==n.duration?n.duration:.5,i=void 0===n.animate||n.animate,r=this.Gt,o=r.target.y,s=t.getFloor(n.level).nt;i?(null===this.Si&&(this.Si=new Pr),this.Si.Qn([o]).Zn([s]).qn(e).Jn(function(t){r.panUp(t.delta[0]),r.update()}).$n(function(){r.panUp(s-r.target.y),r.update(),n.finish&&n.finish()}),this._n.nr.Ki(this.Si.Wn()),n.callback&&n.callback(this.Si)):(r.panUp(s-o),r.update(),n.callback&&n.callback(null),n.finish&&n.finish())}}),e),es=new Tt,is=new Tt,rs=new Tt,os=new Tt,ss=new Tt,as=new Tt,us=new Tt;function cs(t,n){this.origin=void 0!==t?t:new Tt,this.direction=void 0!==n?n:new Tt(0,0,-1)}function hs(t,n,e,i){this.ray=new cs(t,n),this.near=e||0,this.far=i||1/0,this.camera=null,this.layers=new Z,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 fs(t,n){return t.distance-n.distance}function ls(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++)ls(r[o],n,e,!0)}Object.assign(cs.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 Tt),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,es)),this},closestPointToPoint:function(t,n){void 0===n&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),n=new Tt),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=es.subVectors(t,this.origin).dot(this.direction);return(n<0?this.origin:(es.copy(this.direction).multiplyScalar(n).add(this.origin),es)).distanceToSquared(t)},distanceSqToSegment:function(t,n,e,i){is.copy(t).add(n).multiplyScalar(.5),rs.copy(n).sub(t).normalize(),os.copy(this.origin).sub(is);var r,o,s,t=.5*t.distanceTo(n),n=-this.direction.dot(rs),a=os.dot(this.direction),u=-os.dot(rs),c=os.lengthSq(),h=Math.abs(1-n*n);return h=0<h?(o=n*a-u,s=t*h,0<=(r=n*u-a)?-s<=o?o<=s?(r*=h=1/h)*(r+n*(o*=h)+2*a)+o*(n*r+o+2*u)+c:(o=t,-(r=Math.max(0,-(n*o+a)))*r+o*(o+2*u)+c):(o=-t,-(r=Math.max(0,-(n*o+a)))*r+o*(o+2*u)+c):o<=-s?-(r=Math.max(0,-(-n*t+a)))*r+(o=0<r?-t:Math.min(Math.max(-t,-u),t))*(o+2*u)+c:o<=s?(r=0,(o=Math.min(Math.max(-t,-u),t))*(o+2*u)+c):-(r=Math.max(0,-(n*t+a)))*r+(o=0<r?t:Math.min(Math.max(-t,-u),t))*(o+2*u)+c):(o=0<n?-t:t,-(r=Math.max(0,-(n*o+a)))*r+o*(o+2*u)+c),e&&e.copy(this.direction).multiplyScalar(r).add(this.origin),i&&i.copy(rs).multiplyScalar(o).add(is),h},intersectSphere:function(t,n){es.subVectors(t.center,this.origin);var e=es.dot(this.direction),i=es.dot(es)-e*e,t=t.radius*t.radius;return t<i||(i=e+(t=Math.sqrt(t-i)),(e=e-t)<0&&i<0)?null:e<0?this.at(i,n):this.at(e,n)},intersectsSphere:function(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius},distanceToPlane:function(t){var n=t.normal.dot(this.direction);return 0===n?0===t.distanceToPoint(this.origin)?0:null:0<=(t=-(this.origin.dot(t.normal)+t.constant)/n)?t: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?(r=(t.min.y-u.y)*s,(t.max.y-u.y)*s):(r=(t.max.y-u.y)*s,(t.min.y-u.y)*s);return s<e||o<r||((e<r||e!=e)&&(e=r),(s<o||o!=o)&&(o=s),(r=0<=a?(i=(t.min.z-u.z)*a,(t.max.z-u.z)*a):(i=(t.max.z-u.z)*a,(t.min.z-u.z)*a))<e)||o<i||((e<i||e!=e)&&(e=i),(o=r<o||o!=o?r:o)<0)?null:this.at(0<=e?e:o,n)},intersectsBox:function(t){return null!==this.intersectBox(t,es)},intersectTriangle:function(t,n,e,i,r){ss.subVectors(n,t),as.subVectors(e,t),us.crossVectors(ss,as);var o,n=this.direction.dot(us);if(0<n){if(i)return null;o=1}else{if(!(n<0))return null;o=-1,n=-n}os.subVectors(this.origin,t);e=o*this.direction.dot(as.crossVectors(os,as));return e<0||(i=o*this.direction.dot(ss.cross(os)))<0||n<e+i||(t=-o*os.dot(us))<0?null:this.at(t/n,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(hs.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 ls(t,this,e,n),e.sort(fs),e},intersectObjects:function(t,n,e){var i=e||[];if(!1===Array.isArray(t))console.warn("THREE.Raycaster.intersectObjects: objects is not an Array.");else{for(var r=0,o=t.length;r<o;r++)ls(t[r],this,i,n);i.sort(fs)}return i}});var e={CLASSIC:2,REAL:4},ds=(Object.freeze(e),e);function vs(t){return(vs="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 ps(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,function(t){t=function(t,n){if("object"!=vs(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=vs(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==vs(t)?t:t+""}(i.key),i)}}var e=function(){function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");this.yi=-1,this.bi=E.NONE,this.$t=!0,this.jn=null,this.Lt=[],this.ci=new Ii,this.br=!0}return n=t,(e=[{key:"type",get:function(){return this.bi}},{key:"visible",get:function(){return this.$t},set:function(t){this.$t=t}},{key:"children",get:function(){return this.Lt}},{key:"parent",get:function(){return this.jn},set:function(t){this.jn=t}},{key:"needUpdateBound",get:function(){return this.br},set:function(t){!0===(this.br=t)&&null!==this.parent&&(this.parent.needUpdateBound=t)}},{key:"isLayer",get:function(){return!1}},{key:"setType",value:function(t){this.bi=t}},{key:"traverse",value:function(t){if(this.Lt)for(var n=this.Lt.length-1;0<=n;n--)t(this.Lt[n])}},{key:"remove",value:function(t){var n=this.Lt.indexOf(t);-1<n&&this.Lt.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].Yn&&this[""+t].Yn(),this[""+t]&&this[""+t].dispose&&this[""+t].dispose(),this[""+t]=null,delete this[""+t]}}])&&ps(n.prototype,e),i&&ps(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,e,i}(),ms=(Object.assign(e.prototype,{gr:function(t){for(var n=this;n;){if(n instanceof t)return n;n=n.jn}return null}}),e);function ys(t){return(ys="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 bs(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,function(t){t=function(t,n){if("object"!=ys(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=ys(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==ys(t)?t:t+""}(i.key),i)}}function gs(t,n,e){n=ws(n);var i=t,n=_s()?Reflect.construct(n,e||[],ws(t).constructor):n.apply(t,e);if(n&&("object"===ys(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function _s(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(_s=function(){return!!t})()}function ws(t){return(ws=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function xs(t,n){return(xs=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var e=function(){function e(t){var n;if(this instanceof e)return(n=gs(this,e)).yi=t.bid,n._r=t.bcode,n.wr=t.mid,n.Er=t.name,n.Sr=t.ename,n.Tr=t.alias,n.xt=t.x,n.Et=t.y,n.Ar=t.levels,n.Mr=[],n;throw new TypeError("Cannot call a class as a function")}var t,n=e,i=ms;if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");return n.prototype=Object.create(i&&i.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),i&&xs(n,i),n=e,(i=[{key:"type",get:function(){return this.bi}},{key:"x",get:function(){return this.xt}},{key:"y",get:function(){return this.Et}},{key:"bound",get:function(){var n=this;return!0===this.needUpdateBound&&(this.ci.reset(),void 0!==this.Or&&this.ci.copy(this.Or),this.Lt.forEach(function(t){n.ci.expand(t.bound)}),this.needUpdateBound=!1),this.ci.clone()}},{key:"buildingID",get:function(){return this.yi}},{key:"bcode",get:function(){return this._r}},{key:"name",get:function(){return this.Er}},{key:"eName",get:function(){return this.Sr}},{key:"alias",get:function(){return this.Tr}},{key:"floorSpace",get:function(){return this.jn.Sn.vr(this.yi).floorSpace},set:function(t){this.jn.Sn.vr(this.yi).floorSpace=t,this.traverse(function(t){t.Lr({animate:!1})})}},{key:"level",get:function(){return this.jn.Sn.vr(this.yi).level}},{key:"visibleLevels",get:function(){return this.jn.Sn.vr(this.yi).visibleLevels}},{key:"getFloor",value:function(n){var e=null;return this.traverse(function(t){t.Rr===n&&(e=t)}),e}},{key:"getFloorInfos",value:function(){return this.Nr()}},{key:"setLevel",value:function(t){this.jn.Pt.Pr(this,t)}},{key:"setVisibleLevels",value:function(t,n){this.jn.Pt.Fr({levels:t,building:this},n)}},{key:"getVisibleLevels",value:function(){return this.visibleLevels}}])&&bs(n.prototype,i),t&&bs(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}(),Es=(Object.assign(e.prototype,{Nr:function(){for(var t,n=this,e=(0===this.Mr.length&&(t=this.jn.Ir.jr.get(this.wr))&&(this.Mr=[],t.Lt.forEach(function(t){n.Mr.push(t)})),{alias:"alias",floorId:"floorID",gid:"level",gname:"name"}),i=Object.keys(e),r=[],o=0;o<this.Mr.length;o++){var s=this.Mr[o];r[o]={};for(var a=0;a<i.length;a++){var u=i[a],c=e[u];s[u]?r[o][c]=s[u]:r[o][c]=null}}return r}}),e);function Ss(t){return(Ss="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 Ts(t){return function(t){if(Array.isArray(t))return As(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,n){var e;if(t)return"string"==typeof t?As(t,n):"Map"===(e="Object"===(e=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?As(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 As(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 Ms(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,function(t){t=function(t,n){if("object"!=Ss(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Ss(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Ss(t)?t:t+""}(i.key),i)}}function Os(t,n,e){return n&&Ms(t.prototype,n),e&&Ms(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}var e=Os(function t(n,e,i){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");this._n=n,this.Sn=i,this.Oi=e,this.Cr=[],this.Dr=null,this.kr=Lr.generateUUID(),this.Ur=new hs,this.Br=new Tt,this.Gr=0,this.Hr=0,this.Vn=this.Vn.bind(this),this.Cn=0,this._n.It.renderer.domElement.addEventListener("mousedown",this.Vn,!1),this._n.It.renderer.domElement.addEventListener("mouseup",this.Vn,!1),this._n.It.renderer.domElement.addEventListener("mousemove",this.Vn,!1),this._n.It.renderer.domElement.addEventListener("touchstart",this.Vn,!1),this._n.It.renderer.domElement.addEventListener("touchend",this.Vn,!1),this._n.It.renderer.domElement.addEventListener("touchmove",this.Vn,!1)}),Ls=(Object.assign(e.prototype,{Yn:function(){for(var t in this._n.It.renderer.domElement.removeEventListener("mousedown",this.Vn,!1),this._n.It.renderer.domElement.removeEventListener("mouseup",this.Vn,!1),this._n.It.renderer.domElement.removeEventListener("touchstart",this.Vn,!1),this._n.It.renderer.domElement.removeEventListener("mousemove",this.Vn,!1),this._n.It.renderer.domElement.removeEventListener("touchmove",this.Vn,!1),this._n.It.renderer.domElement.removeEventListener("touchend",this.Vn,!1),delete this._n,delete this.Sn,delete this.Oi,this)this[""+t]&&this[""+t].Yn&&this[""+t].Yn(),this[""+t]=null,delete this[""+t]},Ki:function(t){var n;(n=this.Cr).push.apply(n,Ts(t))},Vn:function(t){if((st.a.environment!==B.a.WX||"touchmove"!==t.type)&&(!this.Sn||"mousemove"!==t.type||this.Sn.Xr))if("mousedown"===t.type||"touchstart"===t.type)this.Cn=(new Date).getTime(),"touchstart"===t.type&&(this.Gr=t.changedTouches[0].clientX,this.Hr=t.changedTouches[0].clientY);else{if("mouseup"===t.type||"touchend"===t.type){if(200<(new Date).getTime()-this.Cn)return;if("touchend"===t.type&&Math.pow(t.changedTouches[0].clientX-this.Gr,2)+Math.pow(t.changedTouches[0].clientY-this.Hr,2)>Math.pow(t.changedTouches[0].radiusX,2))return;this.Cn=(new Date).getTime()}for(var n=this.Vr(t),e=0;e<this.Cr.length;e++)this.Cr[e](n);var i=this.zr(n),r=null,o=null,s=(i[0]&&i[0].type!==E.FM3DTILE_LAYER&&(s=i[0].gr(Es))&&(r=i[0].level,s!==this._n.An)&&(o=s.yi),this.Wr(n));if(null!==r)s.height=null!==o?s.height-this._n.getBuilding(o).getFloor(r).height:s.height-this._n.getFloor(r).height;else{var a=this._n.getLevel();if(void 0===a)return;s.height=s.height-this._n.getFloor(a).height}a="mousemove"===t.type||"touchmove"===t.type?"hover":"click",s={type:a,targets:i,coords:s,mouseEvent:t,level:r,buildingID:o};-1<this.Oi.Yr.indexOf(a)&&this.Qr(i),this._n.kt.Dt(s)}},Qr:function(a){for(var t,u=this,c=[E.MODEL,E.EXTERNAL_MODEL],n=0;n<a.length&&0!==(t=function(s){if(-1<c.indexOf(a[s].bi)){if(a[s]===u.Dr)return{v:void 0};if(a[s].Rt){u.Ei&&(u.Ei.stop(),u._n.nr.tr(u.Ei)),h(u.Dr),u.Dr=a[s],u.Dr.Zr=u.Sn.highlightColor;var n=a[s].Rt;if(a[s].bi===E.MODEL){n.userData.sourceMaterial=n.material,n.material=n.material.clone();var t=n.material.color,e=new lt(u.Sn.highlightColor);u.Ei?(u.Ei.Qn([t.r,t.g,t.b]),u.Ei.Zn([e.r,e.g,e.b])):u.Ei=new Pr({src:[t.r,t.g,t.b],dest:[e.r,e.g,e.b]}),u.Ei.qn(.5).Jn(function(t){t=new lt(t.destination[0],t.destination[1],t.destination[2]);n&&n.material&&(n.material.color=t),u._n.enableUpdateRender()}).$n(function(){u.Ei.stop(),u._n.nr.tr(u.Ei),n&&n.material&&(n.material.color=e),u._n.enableUpdateRender()}),u._n.nr.Ki(u.Ei.Wn())}else if(a[s].bi===E.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 lt(u.Sn.highlightColor));r&&(n.material=i)}else"MeshLambertMaterial"===n.material.type&&(n.material=n.material.clone(),n.material.color=new lt(u.Sn.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=[],i=0;i<t.material.length;i++)t.material.isBasic?e.push(t.material):(n=u.qr(t.material[i]),e.push(n));t.material=e}else{var r,o;t.material.isBasic||(r=u.qr(t.material),null===a[s].Kr?t.material=r:((o=a[s].Jr(r)).clippingPlanes=a[s].Kr,o.clipping=!0,a[s].$r&&"outside"===a[s].$r&&(o.clipIntersection=!0),u._n.getMapOptions().materialMode===ds.REAL?o.uniforms.diffuse.value=r.uniforms.diffuse.value:o.color=r.color,o.userData=r.userData,t.material=o))}});return u._n.enableUpdateRender(),{v:void 0}}return 0}}(n));n++)if(t)return t.v;function h(t){var n,e;t&&(t.Zr=null,n=t.Rt)&&(t.bi===E.MODEL?n.userData.sourceMaterial&&!1!==n.userData.sourceMaterial.canDispose&&(e=n.material,n.material=n.userData.sourceMaterial,e.dispose(),delete n.userData.sourceMaterial):t.bi===E.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.Ei&&(this.Ei.stop(),this._n.nr.tr(this.Ei)),h(this.Dr),this.Dr=null,this._n.enableUpdateRender()},qr:function(t){var n=this.no(t);return n.color=this.Sn.highlightColor,(n=this._n.getMapOptions().materialMode===ds.REAL?this._n.Pt.io.eo(n):this._n.Pt.io.ro(t,n)).userData=t.userData,n},no:function(t){var n={};return(n=this._n.Oi.materialMode!==ds.REAL||t.isBasic?n:{alphaTest:t.alphaTest,USE_EMISSIVEMAP:t.defines.USE_EMISSIVEMAP,USE_MAP:t.defines.USE_MAP,USE_AOMAP:t.defines.USE_AOMAP,USE_METALNESSMAP:t.defines.USE_METALNESSMAP,USE_NORMALMAP:t.defines.USE_NORMALMAP,TANGENTSPACE_NORMALMAP:t.defines.TANGENTSPACE_NORMALMAP,USE_ROUGHNESSMAP:t.defines.USE_ROUGHNESSMAP,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,metalnessMap:t.uniforms.metalnessMap.value,roughness:t.uniforms.roughness.value,roughnessMap:t.uniforms.roughnessMap.value,normalScale:t.uniforms.normalScale.value,normalMap:t.uniforms.normalMap.value,vertexColors:t.vertexColors,side:t.side}).opacity=t.opacity,n.transparent=t.transparent,n},zr:function(t){for(var n=[],e=0;e<t.length;e++)if(void 0!==t[e].type&&t[e].type===E.FM3DTILE_LAYER)n.push({type:E.FM3DTILE_LAYER,object:t[e].object});else{var i=t[e].object;if("LineSegments"!==i.type&&!(i.isNoPickup||i.parent&&i.parent.mapNode&&i.parent.mapNode.oo&&i===i.parent.mapNode.oo.top)){for(;!i.mapNode;)i=i.parent;for(var r=!0,o=0;o<n.length;o++)if(n[o].Rt&&n[o].Rt.uuid===i.uuid){r=!1;break}this._n.pickFilterFunction({type:i.mapNode.bi,data:i.mapNode.G})&&r&&i.visible&&n.push(i.mapNode)}}return n},Wr:function(t){for(var n,e=null,i=0;i<t.length;i++)if("LineSegments"!==t[i].object.type){e=t[i];break}return t.length<1||!e?{x:NaN,y:NaN,z:NaN,height:NaN}:(n=e.point.clone(),{x:this._n.x+n.x,y:this._n.y-n.z,z:e.point.y,height:e.point.y})},Vr:function(t){var n,e,i,o=this,r=[],s=(t.touches?(e=t.touches[0],"touchend"===t.type&&(e=t.changedTouches[0]),n=this._n.It.renderer.domElement.getBoundingClientRect(),i=e.clientX-n.left,e=e.clientY-n.top,this.Br.x=i/n.width*2-1,this.Br.y=2*-(e/n.height)+1):(this.Br.x=(i=t).offsetX/this._n.It.renderer.domElement.clientWidth*2-1,this.Br.y=2*-(i.offsetY/this._n.It.renderer.domElement.clientHeight)+1),this.Br.z=.5,this.Ur.setFromCamera(this.Br,this._n.Ut),new Map),a=[];if(this._n.It.Ct.forEach(function(t,n){for(var n=n.split("%A%B%C%D")[0],e=s.get(n),i=(e||(s.set(n,e=[]),a.unshift(n)),o.Ur.intersectObject(t,!0)),r=0;r<i.length;r++)i[r].object.visible&&!i[r].object.isNoPick&&e.push(i[r])}),0<this._n.It.so.length)for(var u=s.get("other1"),c=(u||(s.set("other1",u=[]),a.push("other1")),this._n.It.so),h=0;h<c.length;h++)if(c[h].visible)for(var f=this.Ur.intersectObject(c[h],!0),l=0;l<f.length;l++)f[h].type=E.FM3DTILE_LAYER,u.push(f[h]);if(this._n.It.ao)for(var d=s.get("other2"),v=(d||(s.set("other2",d=[]),a.push("other2")),this.Ur.intersectObject(this._n.It.ao,!0)),p=0;p<v.length;p++)v[p].object.visible&&(v[p].object.isNoPickup=!0,d.push(v[p]));for(var m=0;m<a.length;m++){var y=s.get(a[m]);y.sort(function(t,n){return t.distance-n.distance});for(var b=0;b<y.length;b++)r.push(y[b])}return r}}),e),Rs=0;function l(t,n,e,i,r,o,s,a,u,c){Object.defineProperty(this,"id",{value:Rs++}),this.uuid=St.generateUUID(),this.name="",this.image=void 0!==t?t:l.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==n?n:l.DEFAULT_MAPPING,this.wrapS=void 0!==e?e:Vn,this.wrapT=void 0!==i?i:Vn,this.magFilter=void 0!==r?r:Zn,this.minFilter=void 0!==o?o:Kn,this.anisotropy=void 0!==u?u:1,this.format=void 0!==s?s:le,this.internalFormat=null,this.type=void 0!==a?a:Jn,this.offset=new Mt(0,0),this.repeat=new Mt(1,1),this.center=new Mt(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new q,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==c?c:di,this.version=0,this.onUpdate=null}function Ns(t,n,e,i,r,o,s,a,u,c,h,f){l.call(this,null,o,s,a,u,c,i,r,h,f),this.image={data:t||null,width:n||1,height:e||1},this.magFilter=void 0!==u?u:Wn,this.minFilter=void 0!==c?c:Wn,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}l.DEFAULT_IMAGE=void 0,l.DEFAULT_MAPPING=300,l.prototype=Object.assign(Object.create(V.prototype),{constructor:l,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){if(t.applyMatrix3(this.matrix),t.x<0||1<t.x)switch(this.wrapS){case Xn:t.x=t.x-Math.floor(t.x);break;case Vn:t.x=t.x<0?0:1;break;case zn: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 Xn:t.y=t.y-Math.floor(t.y);break;case Vn:t.y=t.y<0?0:1;break;case zn:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}this.flipY&&(t.y=1-t.y)}return t}}),Object.defineProperty(l.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),((Ns.prototype=Object.create(l.prototype)).constructor=Ns).prototype.isDataTexture=!0;var Lt={common:{diffuse:{value:new lt(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new q},uv2Transform:{value:new q},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 Mt(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 lt(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 lt(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new q}},sprite:{diffuse:{value:new lt(15658734)},opacity:{value:1},center:{value:new Mt(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new q}}};function Ps(){a.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 Fs(){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 js(u,t){var c=t.isWebGL2,h=new WeakMap;return{get:function(t){return t.isInterleavedBufferAttribute&&(t=t.data),h.get(t)},remove:function(t){t.isInterleavedBufferAttribute&&(t=t.data);var n=h.get(t);n&&(u.deleteBuffer(n.buffer),h.delete(t))},update:function(t,n){t.isInterleavedBufferAttribute&&(t=t.data);var e,i,r,o,s,a=h.get(t);void 0===a?h.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(),i=u.FLOAT,r instanceof Float32Array?i=u.FLOAT:r instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):r instanceof Uint16Array?i=u.UNSIGNED_SHORT:r instanceof Int16Array?i=u.SHORT:r instanceof Uint32Array?i=u.UNSIGNED_INT:r instanceof Int32Array?i=u.INT:r instanceof Int8Array?i=u.BYTE:r instanceof Uint8Array&&(i=u.UNSIGNED_BYTE),{buffer:s,type:i,bytesPerElement:r.BYTES_PER_ELEMENT,version:e.version})):a.version<t.version&&(o=a.buffer,s=n,r=(i=t).array,i=i.updateRange,u.bindBuffer(s,o),-1===i.count?u.bufferSubData(s,0,r):(c?u.bufferSubData(s,i.offset*r.BYTES_PER_ELEMENT,r,i.offset,i.count):u.bufferSubData(s,i.offset*r.BYTES_PER_ELEMENT,r.subarray(i.offset,i.offset+i.count)),i.count=-1),a.version=t.version)}}}function Is(t,n,e,i,r,o){this.a=t,this.b=n,this.c=e,this.normal=i&&i.isVector3?i:new Tt,this.vertexNormals=Array.isArray(i)?i:[],this.color=r&&r.isColor?r:new lt,this.vertexColors=Array.isArray(r)?r:[],this.materialIndex=void 0!==o?o:0}Ps.prototype=Object.assign(Object.create(a.prototype),{constructor:Ps,isScene:!0,copy:function(t,n){return a.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(Is.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 Cs=0,Ds=new At,ks=new a,Us=new Tt;function Bs(){Object.defineProperty(this,"id",{value:Cs+=2}),this.uuid=St.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}Bs.prototype=Object.assign(Object.create(V.prototype),{constructor:Bs,isGeometry:!0,applyMatrix4:function(t){for(var n=(new q).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 Ds.makeRotationX(t),this.applyMatrix4(Ds),this},rotateY:function(t){return Ds.makeRotationY(t),this.applyMatrix4(Ds),this},rotateZ:function(t){return Ds.makeRotationZ(t),this.applyMatrix4(Ds),this},translate:function(t,n,e){return Ds.makeTranslation(t,n,e),this.applyMatrix4(Ds),this},scale:function(t,n,e){return Ds.makeScale(t,n,e),this.applyMatrix4(Ds),this},lookAt:function(t){return ks.lookAt(t),ks.updateMatrix(),this.applyMatrix4(ks.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)console.error("THREE.Geometry.fromBufferGeometry(): Position attribute required for conversion.");else{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,c=void 0!==e.uv2?e.uv2.array:void 0;void 0!==c&&(this.faceVertexUvs[1]=[]);for(var r=0;r<i.length;r+=3)o.vertices.push((new Tt).fromArray(i,r)),void 0!==a&&o.colors.push((new lt).fromArray(a,r));var h=t.groups;if(0<h.length)for(r=0;r<h.length;r++)for(var f=h[r],l=f.start,d=l,v=l+f.count;d<v;d+=3)void 0!==n?p(n[d],n[d+1],n[d+2],f.materialIndex):p(d,d+1,d+2,f.materialIndex);else if(void 0!==n)for(r=0;r<n.length;r+=3)p(n[r],n[r+1],n[r+2]);else for(r=0;r<i.length/3;r+=3)p(r,r+1,r+2);this.computeFaceNormals(),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone())}return this;function p(t,n,e,i){var r=void 0===a?[]:[o.colors[t].clone(),o.colors[n].clone(),o.colors[e].clone()],r=new Is(t,n,e,void 0===s?[]:[(new Tt).fromArray(s,3*t),(new Tt).fromArray(s,3*n),(new Tt).fromArray(s,3*e)],r,i);o.faces.push(r),void 0!==u&&o.faceVertexUvs[0].push([(new Mt).fromArray(u,2*t),(new Mt).fromArray(u,2*n),(new Mt).fromArray(u,2*e)]),void 0!==c&&o.faceVertexUvs[1].push([(new Mt).fromArray(c,2*t),(new Mt).fromArray(c,2*n),(new Mt).fromArray(c,2*e)])}},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(Us).negate(),this.translate(Us.x,Us.y,Us.z),this},normalize:function(){this.computeBoundingSphere();var t=this.boundingSphere.center,n=this.boundingSphere.radius,n=0===n?1:1/n,e=new At;return e.set(n,0,0,-n*t.x,0,n,0,-n*t.y,0,0,n,-n*t.z,0,0,0,1),this.applyMatrix4(e),this},computeFaceNormals:function(){for(var t=new Tt,n=new Tt,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 Tt;if(t)for(var r,o,s,a=new Tt,u=new Tt,c=0,h=this.faces.length;c<h;c++)f=this.faces[c],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(),c=0,h=this.faces.length;c<h;c++)i[(f=this.faces[c]).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(c=0,h=this.faces.length;c<h;c++){var f,l=(f=this.faces[c]).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]).uo?e.uo.copy(e.normal):e.uo=e.normal.clone(),e.co||(e.co=[]),t=0,n=e.vertexNormals.length;t<n;t++)e.co[t]?e.co[t].copy(e.vertexNormals[t]):e.co[t]=e.vertexNormals[t].clone();var i=new Bs;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 Tt,c={a:new Tt,b:new Tt,c:new Tt},r.push(u),o.push(c)}var u,c,h=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=h.faceNormals[s],c=h.vertexNormals[s],u.copy(e.normal),c.a.copy(e.vertexNormals[0]),c.b.copy(e.vertexNormals[1]),c.c.copy(e.vertexNormals[2])}for(s=0,a=this.faces.length;s<a;s++)(e=this.faces[s]).normal=e.uo,e.vertexNormals=e.co},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new It),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new kt),this.boundingSphere.setFromPoints(this.vertices)},mergeVertices:function(){for(var t,n,e,i,r={},o=[],s=[],a=Math.pow(10,4),u=0,c=this.vertices.length;u<c;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 h=[];for(u=0,c=this.faces.length;u<c;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]){h.push(u);break}}for(u=h.length-1;0<=u;u--){var d=h[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 Tt(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].yi=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].yi;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 Gs=new Tt;function R(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=wi,this.updateRange={offset:0,count:-1},this.version=0}function Hs(t,n,e){R.call(this,new Int8Array(t),n,e)}function Xs(t,n,e){R.call(this,new Uint8Array(t),n,e)}function Vs(t,n,e){R.call(this,new Uint8ClampedArray(t),n,e)}function zs(t,n,e){R.call(this,new Int16Array(t),n,e)}function Ws(t,n,e){R.call(this,new Uint16Array(t),n,e)}function Ys(t,n,e){R.call(this,new Int32Array(t),n,e)}function Qs(t,n,e){R.call(this,new Uint32Array(t),n,e)}function x(t,n,e){R.call(this,new Float32Array(t),n,e)}function Zs(t,n,e){R.call(this,new Float64Array(t),n,e)}function qs(){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 Ks(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(R.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(R.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 lt),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 Mt),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 Tt),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 Ot),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++)Gs.x=this.getX(n),Gs.y=this.getY(n),Gs.z=this.getZ(n),Gs.applyMatrix3(t),this.setXYZ(n,Gs.x,Gs.y,Gs.z);return this},applyMatrix4:function(t){for(var n=0,e=this.count;n<e;n++)Gs.x=this.getX(n),Gs.y=this.getY(n),Gs.z=this.getZ(n),Gs.applyMatrix4(t),this.setXYZ(n,Gs.x,Gs.y,Gs.z);return this},applyNormalMatrix:function(t){for(var n=0,e=this.count;n<e;n++)Gs.x=this.getX(n),Gs.y=this.getY(n),Gs.z=this.getZ(n),Gs.applyNormalMatrix(t),this.setXYZ(n,Gs.x,Gs.y,Gs.z);return this},transformDirection:function(t){for(var n=0,e=this.count;n<e;n++)Gs.x=this.getX(n),Gs.y=this.getY(n),Gs.z=this.getZ(n),Gs.transformDirection(t),this.setXYZ(n,Gs.x,Gs.y,Gs.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)}}),(Hs.prototype=Object.create(R.prototype)).constructor=Hs,(Xs.prototype=Object.create(R.prototype)).constructor=Xs,(Vs.prototype=Object.create(R.prototype)).constructor=Vs,(zs.prototype=Object.create(R.prototype)).constructor=zs,Ws.prototype=Object.create(R.prototype),Ws.prototype.constructor=Ws,(Ys.prototype=Object.create(R.prototype)).constructor=Ys,Qs.prototype=Object.create(R.prototype),Qs.prototype.constructor=Qs,(x.prototype=Object.create(R.prototype)).constructor=x,(Zs.prototype=Object.create(R.prototype)).constructor=Zs,Object.assign(qs.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=[],c=0;c<a;c++)u[c]={name:s[c].name,data:[]};this.morphTargets.position=u}var h=t.morphNormals,f=h.length;if(0<f){for(var l=[],c=0;c<f;c++)l[c]={name:h[c].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(c=0;c<n.length;c++){var y,b=n[c],g=(this.vertices.push(e[b.a],e[b.b],e[b.c]),b.vertexNormals),g=(3===g.length?this.normals.push(g[0],g[1],g[2]):(g=b.normal,this.normals.push(g,g,g)),b.vertexColors);3===g.length?this.colors.push(g[0],g[1],g[2]):(g=b.color,this.colors.push(g,g,g)),!0===r&&(void 0!==(y=i[0][c])?this.uvs.push(y[0],y[1],y[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",c),this.uvs.push(new Mt,new Mt,new Mt))),!0===o&&(void 0!==(y=i[1][c])?this.uvs2.push(y[0],y[1],y[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",c),this.uvs2.push(new Mt,new Mt,new Mt)));for(var _=0;_<a;_++){var w=s[_].vertices;u[_].data.push(w[b.a],w[b.b],w[b.c])}for(_=0;_<f;_++){var x=h[_].vertexNormals[c];l[_].data.push(x.a,x.b,x.c)}p&&this.skinIndices.push(d[b.a],d[b.b],d[b.c]),m&&this.skinWeights.push(v[b.a],v[b.b],v[b.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 Js=1,$s=new At,ta=new a,na=new Tt,ea=new It,ia=new It,ra=new Tt;function oa(){Object.defineProperty(this,"id",{value:Js+=2}),this.uuid=St.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 sa(t){return(sa="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 aa(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,function(t){t=function(t,n){if("object"!=sa(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=sa(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==sa(t)?t:t+""}(i.key),i)}}function ua(t,n,e){return n&&aa(t.prototype,n),e&&aa(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function ca(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function ha(t,n,e){n=la(n);var i=t,n=fa()?Reflect.construct(n,e||[],la(t).constructor):n.apply(t,e);if(n&&("object"===sa(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function fa(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(fa=function(){return!!t})()}function la(t){return(la=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function da(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}}),Object.defineProperty(t,"prototype",{writable:!1}),n&&va(t,n)}function va(t,n){return(va=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}oa.prototype=Object.assign(Object.create(V.prototype),{constructor:oa,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(t){Array.isArray(t)?this.index=new(65535<Ks(t)?Qs:Ws)(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,n=(void 0!==n&&(n.applyMatrix4(t),n.needsUpdate=!0),this.attributes.normal),e=(void 0!==n&&(e=(new q).getNormalMatrix(t),n.applyNormalMatrix(e),n.needsUpdate=!0),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 $s.makeRotationX(t),this.applyMatrix4($s),this},rotateY:function(t){return $s.makeRotationY(t),this.applyMatrix4($s),this},rotateZ:function(t){return $s.makeRotationZ(t),this.applyMatrix4($s),this},translate:function(t,n,e){return $s.makeTranslation(t,n,e),this.applyMatrix4($s),this},scale:function(t,n,e){return $s.makeScale(t,n,e),this.applyMatrix4($s),this},lookAt:function(t){return ta.lookAt(t),ta.updateMatrix(),this.applyMatrix4(ta.matrix),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(na).negate(),this.translate(na.x,na.y,na.z),this},setFromObject:function(t){var n,e,i=t.geometry;return t.isPoints||t.isLine?(e=new x(3*i.vertices.length,3),n=new x(3*i.colors.length,3),this.setAttribute("position",e.copyVector3sArray(i.vertices)),this.setAttribute("color",n.copyColorsArray(i.colors)),i.lineDistances&&i.lineDistances.length===i.vertices.length&&(e=new x(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 x(n,3)),this},updateFromObject:function(t){var n,e=t.geometry;if(t.isMesh){var i=e.ho;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.ho=(new qs).fromGeometry(t),this.fromDirectGeometry(t.ho)},fromDirectGeometry:function(t){var n,e=new Float32Array(3*t.vertices.length);for(n in this.setAttribute("position",new R(e,3).copyVector3sArray(t.vertices)),0<t.normals.length&&(e=new Float32Array(3*t.normals.length),this.setAttribute("normal",new R(e,3).copyVector3sArray(t.normals))),0<t.colors.length&&(e=new Float32Array(3*t.colors.length),this.setAttribute("color",new R(e,3).copyColorsArray(t.colors))),0<t.uvs.length&&(e=new Float32Array(2*t.uvs.length),this.setAttribute("uv",new R(e,2).copyVector2sArray(t.uvs))),0<t.uvs2.length&&(e=new Float32Array(2*t.uvs2.length),this.setAttribute("uv2",new R(e,2).copyVector2sArray(t.uvs2))),this.groups=t.groups,t.morphTargets){for(var i=[],r=t.morphTargets[n],o=0,s=r.length;o<s;o++){var a=r[o],u=new x(3*a.data.length,3);u.name=a.name,i.push(u.copyVector3sArray(a.data))}this.morphAttributes[n]=i}return 0<t.skinIndices.length&&(e=new x(4*t.skinIndices.length,4),this.setAttribute("skinIndex",e.copyVector4sArray(t.skinIndices))),0<t.skinWeights.length&&(e=new x(4*t.skinWeights.length,4),this.setAttribute("skinWeight",e.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 It);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];ea.setFromBufferAttribute(r),this.morphTargetsRelative?(ra.addVectors(this.boundingBox.min,ea.min),this.boundingBox.expandByPoint(ra),ra.addVectors(this.boundingBox.max,ea.max),this.boundingBox.expandByPoint(ra)):(this.boundingBox.expandByPoint(ea.min),this.boundingBox.expandByPoint(ea.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 kt);var t=this.attributes.position,n=this.morphAttributes.position;if(t){var e=this.boundingSphere.center;if(ea.setFromBufferAttribute(t),n)for(var i=0,r=n.length;i<r;i++){var o=n[i];ia.setFromBufferAttribute(o),this.morphTargetsRelative?(ra.addVectors(ea.min,ia.min),ea.expandByPoint(ra),ra.addVectors(ea.max,ia.max),ea.expandByPoint(ra)):(ea.expandByPoint(ia.min),ea.expandByPoint(ia.max))}ea.getCenter(e);for(var s=0,i=0,r=t.count;i<r;i++)ra.fromBufferAttribute(t,i),s=Math.max(s,e.distanceToSquared(ra));if(n)for(i=0,r=n.length;i<r;i++)for(var o=n[i],a=this.morphTargetsRelative,u=0,c=o.count;u<c;u++)ra.fromBufferAttribute(o,u),a&&(na.fromBufferAttribute(t,u),ra.add(na)),s=Math.max(s,e.distanceToSquared(ra));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 R(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,c=n.normal.array,h=new Tt,f=new Tt,l=new Tt,d=new Tt,v=new Tt;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],h.fromArray(e,s),f.fromArray(e,a),l.fromArray(e,u),d.subVectors(l,f),v.subVectors(h,f),d.cross(v),c[s]+=d.x,c[1+s]+=d.y,c[2+s]+=d.z,c[a]+=d.x,c[1+a]+=d.y,c[2+a]+=d.z,c[u]+=d.x,c[1+u]+=d.y,c[2+u]+=d.z;else for(r=0,o=e.length;r<o;r+=9)h.fromArray(e,r),f.fromArray(e,r+3),l.fromArray(e,r+6),d.subVectors(l,f),v.subVectors(h,f),d.cross(v),c[r]=d.x,c[r+1]=d.y,c[r+2]=d.z,c[r+3]=d.x,c[r+4]=d.y,c[r+5]=d.z,c[r+6]=d.x,c[r+7]=d.y,c[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++)ra.x=t.getX(n),ra.y=t.getY(n),ra.z=t.getZ(n),ra.normalize(),t.setXYZ(n,ra.x,ra.y,ra.z)},dispose:function(){this.dispatchEvent({type:"dispose"})}});var pa=function(){function u(t,n,e,i,r,o){ca(this,u),(s=ha(this,u)).type="BoxBufferGeometry",s.parameters={width:t,height:n,depth:e,widthSegments:i,heightSegments:r,depthSegments:o};var s,O=s,L=(t=t||1,n=n||1,e=e||1,i=Math.floor(i)||1,r=Math.floor(r)||1,o=Math.floor(o)||1,[]),R=[],N=[],P=[],F=0,j=0;function a(t,n,e,i,r,o,s,a,u,c,h){for(var f=o/u,l=s/c,d=o/2,v=s/2,p=a/2,m=u+1,y=c+1,b=0,g=0,_=new Tt,w=0;w<y;w++)for(var x=w*l-v,E=0;E<m;E++)_[t]=(E*f-d)*i,_[n]=x*r,_[e]=p,R.push(_.x,_.y,_.z),_[t]=0,_[n]=0,_[e]=0<a?1:-1,N.push(_.x,_.y,_.z),P.push(E/u),P.push(1-w/c),b+=1;for(w=0;w<c;w++)for(E=0;E<u;E++){var S=F+E+m*w,T=F+E+m*(w+1),A=F+(E+1)+m*(w+1),M=F+(E+1)+m*w;L.push(S,T,M),L.push(T,A,M),g+=6}O.addGroup(j,g,h),j+=g,F+=b}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(L),s.setAttribute("position",new x(R,3)),s.setAttribute("normal",new x(N,3)),s.setAttribute("uv",new x(P,2)),s}return da(u,oa),ua(u)}();function ma(t,n,e,i){oa.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,c=a+1,h=t/s,f=n/a,l=[],d=[],v=[],p=[],m=0;m<c;m++)for(var y=m*f-o,b=0;b<u;b++)d.push(b*h-r,-y,0),v.push(0,0,1),p.push(b/s),p.push(1-m/a);for(m=0;m<a;m++)for(b=0;b<s;b++){var g=b+u*(m+1),_=b+1+u*(m+1),w=b+1+u*m;l.push(b+u*m,g,w),l.push(g,_,w)}this.setIndex(l),this.setAttribute("position",new x(d,3)),this.setAttribute("normal",new x(v,3)),this.setAttribute("uv",new x(p,2))}(ma.prototype=Object.create(oa.prototype)).constructor=ma;var ya=0;function f(){Object.defineProperty(this,"id",{value:ya++}),this.uuid=St.generateUUID(),this.name="",this.type="Material",this.fog=!0,this.blending=hn,this.side=sn,this.flatShading=!1,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=Sn,this.blendDst=Tn,this.blendEquation=pn,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=jn,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=_i,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=bi,this.stencilZFail=bi,this.stencilZPass=bi,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=xi,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0}function ba(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 ga(t){for(var n={},e=0;e<t.length;e++){var i,r=ba(t[e]);for(i in r)n[i]=r[i]}return n}f.prototype=Object.assign(Object.create(V.prototype),{constructor:f,isMaterial:!0,onBeforeCompile:function(){},setValues:function(t){if(void 0!==t)for(var n in t){var e,i=t[n];void 0===i?console.warn("THREE.Material: '"+n+"' parameter is undefined."):"shading"===n?(console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===i):void 0===(e=this[n])?console.warn("THREE."+this.type+": '"+n+"' is not a property of this material."):e&&e.isColor?e.set(i):e&&e.isVector3&&i&&i.isVector3?e.copy(i):this[n]=i}},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(f.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}});var _a={clone:ba,merge:ga},wa="\nvoid main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n",xa="\nvoid main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}\n";function Ea(t){f.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader=wa,this.fragmentShader=xa,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))}((Ea.prototype=Object.create(f.prototype)).constructor=Ea).prototype.isShaderMaterial=!0,Ea.prototype.copy=function(t){return f.prototype.copy.call(this,t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=ba(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 Sa=new Tt,Ta=new Tt,Aa=new Tt,Ma=new Tt,Oa=new Tt,La=new Tt,Ra=new Tt,Na=new Tt,Pa=new Tt,Fa=new Tt;function ja(t,n,e){this.a=void 0!==t?t:new Tt,this.b=void 0!==n?n:new Tt,this.c=void 0!==e?e:new Tt}function Ia(t){f.call(this),this.type="MeshBasicMaterial",this.color=new lt(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(ja,{getNormal:function(t,n,e,i){void 0===i&&(console.warn("THREE.Triangle: .getNormal() target is now required"),i=new Tt),i.subVectors(e,n),Sa.subVectors(t,n),i.cross(Sa);e=i.lengthSq();return 0<e?i.multiplyScalar(1/Math.sqrt(e)):i.set(0,0,0)},getBarycoord:function(t,n,e,i,r){Sa.subVectors(i,n),Ta.subVectors(e,n),Aa.subVectors(t,n);var i=Sa.dot(Sa),e=Sa.dot(Ta),t=Sa.dot(Aa),n=Ta.dot(Ta),o=Ta.dot(Aa),s=i*n-e*e;return void 0===r&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),r=new Tt),0==s?r.set(-2,-1,-1):r.set(1-(n=(n*t-e*o)*(r=1/s))-(s=(i*o-e*t)*r),s,n)},containsPoint:function(t,n,e,i){return ja.getBarycoord(t,n,e,i,Ma),0<=Ma.x&&0<=Ma.y&&Ma.x+Ma.y<=1},getUV:function(t,n,e,i,r,o,s,a){return this.getBarycoord(t,n,e,i,Ma),a.set(0,0),a.addScaledVector(r,Ma.x),a.addScaledVector(o,Ma.y),a.addScaledVector(s,Ma.z),a},isFrontFacing:function(t,n,e,i){return Sa.subVectors(e,n),Ta.subVectors(t,n),Sa.cross(Ta).dot(i)<0}}),Object.assign(ja.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 Sa.subVectors(this.c,this.b),Ta.subVectors(this.a,this.b),.5*Sa.cross(Ta).length()},getMidpoint:function(t){return void 0===t&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),t=new Tt),t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},getNormal:function(t){return ja.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 Ht),t.setFromCoplanarPoints(this.a,this.b,this.c)},getBarycoord:function(t,n){return ja.getBarycoord(t,this.a,this.b,this.c,n)},getUV:function(t,n,e,i,r){return ja.getUV(t,this.a,this.b,this.c,n,e,i,r)},containsPoint:function(t){return ja.containsPoint(t,this.a,this.b,this.c)},isFrontFacing:function(t){return ja.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 Tt);var e=this.a,i=this.b,r=this.c,o=(Oa.subVectors(i,e),La.subVectors(r,e),Na.subVectors(t,e),Oa.dot(Na)),s=La.dot(Na);if(o<=0&&s<=0)return n.copy(e);Pa.subVectors(t,i);var a=Oa.dot(Pa),u=La.dot(Pa);if(0<=a&&u<=a)return n.copy(i);var c=o*u-a*s;if(c<=0&&0<=o&&a<=0)return h=o/(o-a),n.copy(e).addScaledVector(Oa,h);Fa.subVectors(t,r);var h,f,t=Oa.dot(Fa),l=La.dot(Fa);return 0<=l&&t<=l?n.copy(r):(o=t*s-o*l)<=0&&0<=s&&l<=0?(f=s/(s-l),n.copy(e).addScaledVector(La,f)):(s=a*l-t*u)<=0&&0<=u-a&&0<=t-l?(Ra.subVectors(r,i),f=(u-a)/(u-a+(t-l)),n.copy(i).addScaledVector(Ra,f)):(h=o*(r=1/(s+o+c)),f=c*r,n.copy(e).addScaledVector(Oa,h).addScaledVector(La,f))},equals:function(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}),((Ia.prototype=Object.create(f.prototype)).constructor=Ia).prototype.isMeshBasicMaterial=!0,Ia.prototype.copy=function(t){return f.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 Ca=new At,Da=new cs,ka=new kt,Ua=new Tt,Ba=new Tt,Ga=new Tt,Ha=new Tt,Xa=new Tt,Va=new Tt,za=new Tt,Wa=new Tt,Ya=new Tt,Qa=new Mt,Za=new Mt,qa=new Mt,Ka=new Tt,Ja=new Tt;function $a(t,n){a.call(this),this.type="Mesh",this.geometry=void 0!==t?t:new oa,this.material=void 0!==n?n:new Ia,this.updateMorphTargets()}function tu(t,n,e,i,r,o,s,a){i=n.side===an?i.intersectTriangle(s,o,r,!0,a):i.intersectTriangle(r,o,s,n.side!==un,a);if(null===i)return null;Ja.copy(a),Ja.applyMatrix4(t.matrixWorld);r=e.ray.origin.distanceTo(Ja);return r<e.near||r>e.far?null:{distance:r,point:Ja.clone(),object:t}}function nu(t,n,e,i,r,o,s,a,u,c,h,f){Ua.fromBufferAttribute(r,c),Ba.fromBufferAttribute(r,h),Ga.fromBufferAttribute(r,f);var l=t.morphTargetInfluences;if(n.morphTargets&&o&&l){za.set(0,0,0),Wa.set(0,0,0),Ya.set(0,0,0);for(var d=0,v=o.length;d<v;d++){var p=l[d],m=o[d];0!==p&&(Ha.fromBufferAttribute(m,c),Xa.fromBufferAttribute(m,h),Va.fromBufferAttribute(m,f),s?(za.addScaledVector(Ha,p),Wa.addScaledVector(Xa,p),Ya.addScaledVector(Va,p)):(za.addScaledVector(Ha.sub(Ua),p),Wa.addScaledVector(Xa.sub(Ba),p),Ya.addScaledVector(Va.sub(Ga),p)))}Ua.add(za),Ba.add(Wa),Ga.add(Ya)}r=tu(t,n,e,i,Ua,Ba,Ga,Ka);return r&&(a&&(Qa.fromBufferAttribute(a,c),Za.fromBufferAttribute(a,h),qa.fromBufferAttribute(a,f),r.uv=ja.getUV(Ka,Ua,Ba,Ga,Qa,Za,qa,new Mt)),u&&(Qa.fromBufferAttribute(u,c),Za.fromBufferAttribute(u,h),qa.fromBufferAttribute(u,f),r.uv2=ja.getUV(Ka,Ua,Ba,Ga,Qa,Za,qa,new Mt)),t=new Is(c,h,f),ja.getNormal(Ua,Ba,Ga,t.normal),r.face=t),r}$a.prototype=Object.assign(Object.create(a.prototype),{constructor:$a,isMesh:!0,copy:function(t){return a.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{r=i.morphTargets;void 0!==r&&0<r.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(),ka.copy(e.boundingSphere),ka.applyMatrix4(r),!1!==t.ray.intersectsSphere(ka)&&(Ca.getInverse(r),Da.copy(t.ray).applyMatrix4(Ca),null===e.boundingBox||!1!==Da.intersectsBox(e.boundingBox))))if(e.isBufferGeometry){var o,s,a,u,c,h,f,l,d,v=e.index,p=e.attributes.position,m=e.morphAttributes.position,y=e.morphTargetsRelative,b=e.attributes.uv,g=e.attributes.uv2,_=e.groups,w=e.drawRange;if(null!==v)if(Array.isArray(i))for(u=0,h=_.length;u<h;u++)for(d=i[(l=_[u]).materialIndex],c=Math.max(l.start,w.start),f=Math.min(l.start+l.count,w.start+w.count);c<f;c+=3)o=v.getX(c),s=v.getX(c+1),a=v.getX(c+2),(N=nu(this,d,t,Da,p,m,y,b,g,o,s,a))&&(N.faceIndex=Math.floor(c/3),N.face.materialIndex=l.materialIndex,n.push(N));else for(u=Math.max(0,w.start),h=Math.min(v.count,w.start+w.count);u<h;u+=3)o=v.getX(u),s=v.getX(u+1),a=v.getX(u+2),(N=nu(this,i,t,Da,p,m,y,b,g,o,s,a))&&(N.faceIndex=Math.floor(u/3),n.push(N));else if(void 0!==p)if(Array.isArray(i))for(u=0,h=_.length;u<h;u++)for(d=i[(l=_[u]).materialIndex],c=Math.max(l.start,w.start),f=Math.min(l.start+l.count,w.start+w.count);c<f;c+=3)(N=nu(this,d,t,Da,p,m,y,b,g,o=c,s=c+1,a=c+2))&&(N.faceIndex=Math.floor(c/3),N.face.materialIndex=l.materialIndex,n.push(N));else for(u=Math.max(0,w.start),h=Math.min(p.count,w.start+w.count);u<h;u+=3)(N=nu(this,i,t,Da,p,m,y,b,g,o=u,s=u+1,a=u+2))&&(N.faceIndex=Math.floor(u/3),n.push(N))}else if(e.isGeometry){var x,E=Array.isArray(i),S=e.vertices,T=e.faces,r=e.faceVertexUvs[0];0<r.length&&(x=r);for(var A=0,M=T.length;A<M;A++){var O,L,R,N,P=T[A],F=E?i[P.materialIndex]:i;void 0!==F&&(O=S[P.a],L=S[P.b],R=S[P.c],N=tu(this,F,t,Da,O,L,R,Ka))&&(x&&x[A]&&(F=x[A],Qa.copy(F[0]),Za.copy(F[1]),qa.copy(F[2]),N.uv=ja.getUV(Ka,O,L,R,Qa,Za,qa,new Mt)),N.face=P,N.faceIndex=A,n.push(N))}}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var w={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"},eu={basic:{uniforms:ga([Lt.common,Lt.specularmap,Lt.envmap,Lt.aomap,Lt.lightmap,Lt.fog]),vertexShader:w.meshbasic_vert,fragmentShader:w.meshbasic_frag},lambert:{uniforms:ga([Lt.common,Lt.specularmap,Lt.envmap,Lt.aomap,Lt.lightmap,Lt.emissivemap,Lt.fog,Lt.lights,{emissive:{value:new lt(0)}}]),vertexShader:w.meshlambert_vert,fragmentShader:w.meshlambert_frag},phong:{uniforms:ga([Lt.common,Lt.specularmap,Lt.envmap,Lt.aomap,Lt.lightmap,Lt.emissivemap,Lt.bumpmap,Lt.normalmap,Lt.displacementmap,Lt.fog,Lt.lights,{emissive:{value:new lt(0)},specular:{value:new lt(1118481)},shininess:{value:30}}]),vertexShader:w.meshphong_vert,fragmentShader:w.meshphong_frag},standard:{uniforms:ga([Lt.common,Lt.envmap,Lt.aomap,Lt.lightmap,Lt.emissivemap,Lt.bumpmap,Lt.normalmap,Lt.displacementmap,Lt.roughnessmap,Lt.metalnessmap,Lt.fog,Lt.lights,{emissive:{value:new lt(0)},roughness:{value:.5},metalness:{value:.5},envMapIntensity:{value:1}}]),vertexShader:w.meshphysical_vert,fragmentShader:w.meshphysical_frag},toon:{uniforms:ga([Lt.common,Lt.specularmap,Lt.aomap,Lt.lightmap,Lt.emissivemap,Lt.bumpmap,Lt.normalmap,Lt.displacementmap,Lt.gradientmap,Lt.fog,Lt.lights,{emissive:{value:new lt(0)},specular:{value:new lt(1118481)},shininess:{value:30}}]),vertexShader:w.meshtoon_vert,fragmentShader:w.meshtoon_frag},matcap:{uniforms:ga([Lt.common,Lt.bumpmap,Lt.normalmap,Lt.displacementmap,Lt.fog,{matcap:{value:null}}]),vertexShader:w.meshmatcap_vert,fragmentShader:w.meshmatcap_frag},points:{uniforms:ga([Lt.points,Lt.fog]),vertexShader:w.points_vert,fragmentShader:w.points_frag},dashed:{uniforms:ga([Lt.common,Lt.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:w.linedashed_vert,fragmentShader:w.linedashed_frag},depth:{uniforms:ga([Lt.common,Lt.displacementmap]),vertexShader:w.depth_vert,fragmentShader:w.depth_frag},normal:{uniforms:ga([Lt.common,Lt.bumpmap,Lt.normalmap,Lt.displacementmap,{opacity:{value:1}}]),vertexShader:w.normal_vert,fragmentShader:w.normal_frag},sprite:{uniforms:ga([Lt.sprite,Lt.fog]),vertexShader:w.sprite_vert,fragmentShader:w.sprite_frag},background:{uniforms:{uvTransform:{value:new q},t2D:{value:null}},vertexShader:w.background_vert,fragmentShader:w.background_frag},cube:{uniforms:ga([Lt.envmap,{opacity:{value:1}}]),vertexShader:w.cube_vert,fragmentShader:w.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:w.equirect_vert,fragmentShader:w.equirect_frag},distanceRGBA:{uniforms:ga([Lt.common,Lt.displacementmap,{referencePosition:{value:new Tt},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:w.distanceRGBA_vert,fragmentShader:w.distanceRGBA_frag},shadow:{uniforms:ga([Lt.lights,Lt.fog,{color:{value:new lt(0)},opacity:{value:1}}]),vertexShader:w.shadow_vert,fragmentShader:w.shadow_frag}};function iu(o,e,s,i){var a,u,c=new lt(0),h=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 c},setClearColor:function(t,n){c.set(t),v(c,h=void 0!==n?n:1)},getClearAlpha:function(){return h},setClearAlpha:function(t){v(c,h=t)},render:function(t,n,e,i){var n=n.background,r=(r=o.xr).getSession&&r.getSession();null===(n=r&&"additive"===r.environmentBlendMode?null:n)?v(c,h):n&&n.isColor&&(v(n,1),i=!0),(o.autoClear||i)&&o.clear(o.autoClearColor,o.autoClearDepth,o.autoClearStencil),n&&(n.isCubeTexture||n.isWebGLCubeRenderTarget||n.mapping===Gn)?(void 0===u&&((u=new $a(new pa(1,1,1),new Ea({type:"BackgroundCubeMaterial",uniforms:ba(eu.cube.uniforms),vertexShader:eu.cube.vertexShader,fragmentShader:eu.cube.fragmentShader,side:an,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)),r=n.isWebGLCubeRenderTarget?n.texture:n,u.material.uniforms.envMap.value=r,u.material.uniforms.flipEnvMap.value=r.isCubeTexture?-1:1,f===n&&l===r.version&&d===o.toneMapping||(u.material.needsUpdate=!0,f=n,l=r.version,d=o.toneMapping),t.unshift(u,u.geometry,u.material,0,0,null)):n&&n.isTexture&&(void 0===a&&((a=new $a(new ma(2,2),new Ea({type:"BackgroundMaterial",uniforms:ba(eu.background.uniforms),vertexShader:eu.background.vertexShader,fragmentShader:eu.background.fragmentShader,side:sn,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=n).matrixAutoUpdate&&n.updateMatrix(),a.material.uniforms.uvTransform.value.copy(n.matrix),f===n&&l===n.version&&d===o.toneMapping||(a.material.needsUpdate=!0,l=(f=n).version,d=o.toneMapping),t.unshift(a,a.geometry,a.material,0,0,null))}}}function ru(s,a,u,t){var c,h=t.isWebGL2;this.setMode=function(t){c=t},this.render=function(t,n){s.drawArrays(c,t,n),u.update(n,c)},this.renderInstances=function(t,n,e,i){if(0!==i){var r,o;if(h)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](c,n,e,i),u.update(e,c,i)}}}function ou(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=(a!==s&&(console.warn("THREE.WebGLRenderer:",s,"not supported, using",a,"instead."),s=a),!0===t.logarithmicDepthBuffer),t=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),u=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),c=n.getParameter(n.MAX_TEXTURE_SIZE),h=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),f=n.getParameter(n.MAX_VERTEX_ATTRIBS),l=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),d=n.getParameter(n.MAX_VARYING_VECTORS),v=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),p=0<u,m=o||!!e.get("OES_texture_float");return{isWebGL2:o,getMaxAnisotropy:function(){var t;return void 0===i&&(t=e.get("EXT_texture_filter_anisotropic"),i=null!==t?n.getParameter(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0),i},getMaxPrecision:r,precision:s,logarithmicDepthBuffer:a,maxTextures:t,maxVertexTextures:u,maxTextureSize:c,maxCubemapSize:h,maxAttributes:f,maxVertexUniforms:l,maxVaryings:d,maxFragmentUniforms:v,vertexTextures:p,floatFragmentTextures:m,floatVertexTextures:p&&m,maxSamples:o?n.getParameter(n.MAX_SAMPLES):0}}function su(){var c=this,h=null,f=0,l=!1,d=!1,v=new Ht,p=new q,m={value:null,needsUpdate:!1};function y(){m.value!==h&&(m.value=h,m.needsUpdate=0<f),c.numPlanes=f,c.numIntersection=0}function b(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 c.numPlanes=r,c.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,h=b(t,e,0),f=t.length,i},this.beginShadows=function(){d=!0,b(null)},this.endShadows=function(){d=!1,y()},this.setState=function(t,n,e,i,r,o){if(!l||null===t||0===t.length||d&&!e)d?b(null):y();else{var e=d?0:f,s=4*e,a=r.clippingState||null;m.value=a;for(var a=b(t,i,s,o),u=0;u!==s;++u)a[u]=h[u];r.clippingState=a,this.numIntersection=n?this.numPlanes:0,this.numPlanes+=e}}}function au(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 uu(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],c=o[s+1],h=o[s+2];n.push(u,c,c,h,h,u)}else{o=i.array;r=i.version;for(s=0,a=o.length/3-1;s<a;s+=3){u=s+0,c=s+1,h=s+2;n.push(u,c,c,h,h,u)}}e=new(65535<Ks(n)?Qs:Ws)(n,1),e.version=r,l.update(e,f.ELEMENT_ARRAY_BUFFER),i=d.get(t);i&&l.remove(i),d.set(t,e)}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.fo&&(n.fo=(new oa).setFromObject(t)),e=n.fo),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 cu(s,a,u,t){var c,h,f,l=t.isWebGL2;this.setMode=function(t){c=t},this.setIndex=function(t){h=t.type,f=t.bytesPerElement},this.render=function(t,n){s.drawElements(c,n,h,t*f),u.update(n,c)},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](c,e,h,n*f,i),u.update(e,c,i)}}}function hu(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 fu(t,n){return Math.abs(n[1])-Math.abs(t[1])}function lu(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,c=e.morphNormals&&n.morphAttributes.normal,a=0;a<o;a++)0!==(h=s[a])[1]&&(u&&n.deleteAttribute("morphTarget"+a),c)&&n.deleteAttribute("morphNormal"+a);for(a=0;a<o;a++)(h=s[a])[0]=a,h[1]=r[a];s.sort(fu);for(var h,f=0,a=0;a<8;a++){if(h=s[a]){var l=h[0],d=h[1];if(d){u&&n.setAttribute("morphTarget"+a,u[l]),c&&n.setAttribute("morphNormal"+a,c[l]),f+=m[a]=d;continue}}m[a]=0}t=n.morphTargetsRelative?1:1-f,i.getUniforms().setValue(v,"morphTargetBaseInfluence",t),i.getUniforms().setValue(v,"morphTargetInfluences",m)}}}function du(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 vu(t,n,e,i,r,o,s,a,u,c){l.call(this,t=void 0!==t?t:[],n=void 0!==n?n:301,e,i,r,o,s=void 0!==s?s:fe,a,u,c),this.flipY=!1}function pu(t,n,e,i){l.call(this,null),this.image={data:t||null,width:n||1,height:e||1,depth:i||1},this.magFilter=Wn,this.minFilter=Wn,this.wrapR=Vn,this.generateMipmaps=!1,this.flipY=!1,this.needsUpdate=!0}function mu(t,n,e,i){l.call(this,null),this.image={data:t||null,width:n||1,height:e||1,depth:i||1},this.magFilter=Wn,this.minFilter=Wn,this.wrapR=Vn,this.generateMipmaps=!1,this.flipY=!1,this.needsUpdate=!0}eu.physical={uniforms:ga([eu.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new Mt(1,1)},clearcoatNormalMap:{value:null},sheen:{value:new lt(0)},transparency:{value:0}}]),vertexShader:w.meshphysical_vert,fragmentShader:w.meshphysical_frag},((vu.prototype=Object.create(l.prototype)).constructor=vu).prototype.isCubeTexture=!0,Object.defineProperty(vu.prototype,"images",{get:function(){return this.image},set:function(t){this.image=t}}),((pu.prototype=Object.create(l.prototype)).constructor=pu).prototype.isDataTexture2DArray=!0,((mu.prototype=Object.create(l.prototype)).constructor=mu).prototype.isDataTexture3D=!0;var yu=new l,bu=new pu,gu=new mu,_u=new vu,wu=[],xu=[],Eu=new Float32Array(16),Su=new Float32Array(9),Tu=new Float32Array(4);function Au(t,n,e){var i=t[0];if(i<=0||0<i)return t;var r=n*e,o=wu[r];if(void 0===o&&(o=new Float32Array(r),wu[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 Mu(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 Ou(t,n){for(var e=0,i=n.length;e<i;e++)t[e]=n[e]}function Lu(t,n){var e=xu[n];void 0===e&&(e=new Int32Array(n),xu[n]=e);for(var i=0;i!==n;++i)e[i]=t.allocateTextureUnit();return e}function Ru(t,n){var e=this.cache;e[0]!==n&&(t.uniform1f(this.addr,n),e[0]=n)}function Nu(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):Mu(e,n)||(t.uniform2fv(this.addr,n),Ou(e,n))}function Pu(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):Mu(e,n)||(t.uniform3fv(this.addr,n),Ou(e,n))}function Fu(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):Mu(e,n)||(t.uniform4fv(this.addr,n),Ou(e,n))}function ju(t,n){var e=this.cache,i=n.elements;void 0===i?Mu(e,n)||(t.uniformMatrix2fv(this.addr,!1,n),Ou(e,n)):Mu(e,i)||(Tu.set(i),t.uniformMatrix2fv(this.addr,!1,Tu),Ou(e,i))}function Iu(t,n){var e=this.cache,i=n.elements;void 0===i?Mu(e,n)||(t.uniformMatrix3fv(this.addr,!1,n),Ou(e,n)):Mu(e,i)||(Su.set(i),t.uniformMatrix3fv(this.addr,!1,Su),Ou(e,i))}function Cu(t,n){var e=this.cache,i=n.elements;void 0===i?Mu(e,n)||(t.uniformMatrix4fv(this.addr,!1,n),Ou(e,n)):Mu(e,i)||(Eu.set(i),t.uniformMatrix4fv(this.addr,!1,Eu),Ou(e,i))}function Du(t,n,e){var i=this.cache,r=e.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),e.safeSetTexture2D(n||yu,r)}function ku(t,n,e){var i=this.cache,r=e.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),e.setTexture2DArray(n||bu,r)}function Uu(t,n,e){var i=this.cache,r=e.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),e.setTexture3D(n||gu,r)}function Bu(t,n,e){var i=this.cache,r=e.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),e.safeSetTextureCube(n||_u,r)}function Gu(t,n){var e=this.cache;e[0]!==n&&(t.uniform1i(this.addr,n),e[0]=n)}function Hu(t,n){var e=this.cache;Mu(e,n)||(t.uniform2iv(this.addr,n),Ou(e,n))}function Xu(t,n){var e=this.cache;Mu(e,n)||(t.uniform3iv(this.addr,n),Ou(e,n))}function Vu(t,n){var e=this.cache;Mu(e,n)||(t.uniform4iv(this.addr,n),Ou(e,n))}function zu(t,n){var e=this.cache;e[0]!==n&&(t.uniform1ui(this.addr,n),e[0]=n)}function Wu(t,n){t.uniform1fv(this.addr,n)}function Yu(t,n){t.uniform1iv(this.addr,n)}function Qu(t,n){t.uniform2iv(this.addr,n)}function Zu(t,n){t.uniform3iv(this.addr,n)}function qu(t,n){t.uniform4iv(this.addr,n)}function Ku(t,n){n=Au(n,this.size,2);t.uniform2fv(this.addr,n)}function Ju(t,n){n=Au(n,this.size,3);t.uniform3fv(this.addr,n)}function $u(t,n){n=Au(n,this.size,4);t.uniform4fv(this.addr,n)}function tc(t,n){n=Au(n,this.size,4);t.uniformMatrix2fv(this.addr,!1,n)}function nc(t,n){n=Au(n,this.size,9);t.uniformMatrix3fv(this.addr,!1,n)}function ec(t,n){n=Au(n,this.size,16);t.uniformMatrix4fv(this.addr,!1,n)}function ic(t,n,e){var i=n.length,r=Lu(e,i);t.uniform1iv(this.addr,r);for(var o=0;o!==i;++o)e.safeSetTexture2D(n[o]||yu,r[o])}function rc(t,n,e){var i=n.length,r=Lu(e,i);t.uniform1iv(this.addr,r);for(var o=0;o!==i;++o)e.safeSetTextureCube(n[o]||_u,r[o])}function oc(t,n,e){this.id=t,this.addr=e,this.cache=[],this.setValue=function(t){switch(t){case 5126:return Ru;case 35664:return Nu;case 35665:return Pu;case 35666:return Fu;case 35674:return ju;case 35675:return Iu;case 35676:return Cu;case 5124:case 35670:return Gu;case 35667:case 35671:return Hu;case 35668:case 35672:return Xu;case 35669:case 35673:return Vu;case 5125:return zu;case 35678:case 36198:case 36298:case 36306:case 35682:return Du;case 35679:case 36299:case 36307:return Uu;case 35680:case 36300:case 36308:case 36293:return Bu;case 36289:case 36303:case 36311:case 36292:return ku}}(n.type)}function sc(t,n,e){this.id=t,this.addr=e,this.cache=[],this.size=n.size,this.setValue=function(t){switch(t){case 5126:return Wu;case 35664:return Ku;case 35665:return Ju;case 35666:return $u;case 35674:return tc;case 35675:return nc;case 35676:return ec;case 5124:case 35670:return Yu;case 35667:case 35671:return Qu;case 35668:case 35672:return Zu;case 35669:case 35673:return qu;case 35678:case 36198:case 36298:case 36306:case 35682:return ic;case 35680:case 36300:case 36308:case 36293:return rc}}(n.type)}function ac(t){this.id=t,this.seq=[],this.map={}}sc.prototype.updateCache=function(t){var n=this.cache;t instanceof Float32Array&&n.length!==t.length&&(this.cache=new Float32Array(t.length)),Ou(n,t)},ac.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 uc=/([\w\d_]+)(\])?(\[|\.)?/g;function cc(t,n){t.seq.push(n),t.map[n.id]=n}function hc(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),o=t.getUniformLocation(n,r.name),s=(v=d=l=f=h=c=u=a=s=void 0,r),a=o,u=this,c=s.name,h=c.length;for(uc.lastIndex=0;;){var f=uc.exec(c),l=uc.lastIndex,d=f[1],v="]"===f[2],f=f[3];if(v&&(d|=0),void 0===f||"["===f&&l+2===h){cc(u,new(void 0===f?oc:sc)(d,s,a));break}v=u.map[d];void 0===v&&cc(u,v=new ac(d)),u=v}}}function fc(t,n,e){n=t.createShader(n);return t.shaderSource(n,e),t.compileShader(n),n}hc.prototype.setValue=function(t,n,e,i){n=this.map[n];void 0!==n&&n.setValue(t,e,i)},hc.prototype.setOptional=function(t,n,e){n=n[e];void 0!==n&&this.setValue(t,e,n)},hc.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)}},hc.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 lc=0;function dc(t){switch(t){case di:return["Linear","( value )"];case 3001:return["sRGB","( value )"];case 3002:return["RGBE","( value )"];case 3004:return["RGBM","( value, 7.0 )"];case 3005:return["RGBM","( value, 16.0 )"];case 3006:return["RGBD","( value, 256.0 )"];case 3007:return["Gamma","( value, float( GAMMA_FACTOR ) )"];case 3003:return["LogLuv","( value )"];default:throw new Error("unsupported encoding: "+t)}}function vc(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 pc(t,n){n=dc(n);return"vec4 "+t+"( vec4 value ) { return "+n[0]+"ToLinear"+n[1]+"; }"}function mc(t){return""!==t}function yc(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 bc(t,n){return t.replace(/NUM_CLIPPING_PLANES/g,n.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,n.numClippingPlanes-n.numClipIntersection)}var gc=/^[ \t]*#include +<([\w\d./]+)>/gm;function _c(t){return t.replace(gc,wc)}function wc(t,n){var e=w[n];if(void 0===e)throw new Error("Can not resolve #include <"+n+">");return _c(e)}var xc=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,Ec=/#pragma unroll_loop_start[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}[\s]+?#pragma unroll_loop_end/g;function Sc(t){return t.replace(Ec,Ac).replace(xc,Tc)}function Tc(t,n,e,i){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),Ac(0,n,e,i)}function Ac(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 Mc(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 Oc(t,n,e){var i,r,o,s,a,u,c=t.getContext(),h=e.defines,f=e.vertexShader,l=e.fragmentShader,d=(v="SHADOWMAP_TYPE_BASIC",(d=e).shadowMapType===rn?v="SHADOWMAP_TYPE_PCF":2===d.shadowMapType?v="SHADOWMAP_TYPE_PCF_SOFT":d.shadowMapType===on&&(v="SHADOWMAP_TYPE_VSM"),v),v=function(t){var n="ENVMAP_TYPE_CUBE";if(t.envMap)switch(t.envMapMode){case 301:case 302:n="ENVMAP_TYPE_CUBE";break;case Gn:case Hn:n="ENVMAP_TYPE_CUBE_UV";break;case 303:case 304:n="ENVMAP_TYPE_EQUIREC";break;case 305:n="ENVMAP_TYPE_SPHERE"}return n}(e),p=function(t){var n="ENVMAP_MODE_REFLECTION";if(t.envMap)switch(t.envMapMode){case 302:case 304:n="ENVMAP_MODE_REFRACTION"}return n}(e),m=function(t){var n="ENVMAP_BLENDING_NONE";if(t.envMap)switch(t.combine){case Un:n="ENVMAP_BLENDING_MULTIPLY";break;case 1:n="ENVMAP_BLENDING_MIX";break;case 2:n="ENVMAP_BLENDING_ADD"}return n}(e),y=0<t.gammaFactor?t.gammaFactor:1,b=e.isWebGL2?"":(g=[(b=e).extensionDerivatives||b.envMapCubeUV||b.bumpMap||b.tangentSpaceNormalMap||b.clearcoatNormalMap||b.flatShading||"physical"===b.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(b.extensionFragDepth||b.logarithmicDepthBuffer)&&b.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",b.extensionDrawBuffers&&b.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(b.extensionShaderTextureLOD||b.envMap)&&b.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""],"FMMeshStandardMaterial"===b.shaderName&&g.push("#extension GL_OES_standard_derivatives : enable"),g.filter(mc).join("\n")),g=function(t){var n,e=[];for(n in t){var i=t[n];!1!==i&&e.push("#define "+n+" "+i)}return e.join("\n")}(h),_=c.createProgram(),m=(e.isRawShaderMaterial?(0<(i=[g].filter(mc).join("\n")).length&&(i+="\n"),0<(r=[b,g].filter(mc).join("\n")).length&&(r+="\n")):(i=[Mc(e),"#define SHADER_NAME "+e.shaderName,g,e.instancing?"#define USE_INSTANCING":"",e.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+y,"#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 "+p:"",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 "+d:"",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(mc).join("\n"),r=[b,Mc(e),"#define SHADER_NAME "+e.shaderName,g,e.alphaTest?"#define ALPHATEST "+e.alphaTest+(e.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+y,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 "+v:"",e.envMap?"#define "+p:"",e.envMap?"#define "+m:"",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 "+d:"",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!==Bn?"#define TONE_MAPPING":"",e.toneMapping!==Bn?w.tonemapping_pars_fragment:"",e.toneMapping!==Bn?function(t,n){var e;switch(n){case 1:e="Linear";break;case 2:e="Reinhard";break;case 3:e="Uncharted2";break;case 4:e="OptimizedCineon";break;case 5: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?w.encodings_pars_fragment:"",e.mapEncoding?pc("mapTexelToLinear",e.mapEncoding):"",e.matcapEncoding?pc("matcapTexelToLinear",e.matcapEncoding):"",e.envMapEncoding?pc("envMapTexelToLinear",e.envMapEncoding):"",e.emissiveMapEncoding?pc("emissiveMapTexelToLinear",e.emissiveMapEncoding):"",e.lightMapEncoding?pc("lightMapTexelToLinear",e.lightMapEncoding):"",e.outputEncoding?(h="linearToOutputTexel",y=dc(y=e.outputEncoding),"vec4 "+h+"( vec4 value ) { return LinearTo"+y[0]+y[1]+"; }"):"",e.depthPacking?"#define DEPTH_PACKING "+e.depthPacking:"","\n"].filter(mc).join("\n")),f=bc(f=yc(f=_c(f),e),e),l=bc(l=yc(l=_c(l),e),e),f=Sc(f),l=Sc(l),e.isWebGL2&&!e.isRawShaderMaterial&&(v=!1,p=/^\s*#version\s+300\s+es\s*\n/,e.isShaderMaterial&&null!==f.match(p)&&null!==l.match(p)&&(v=!0,f=f.replace(p,""),l=l.replace(p,"")),i=["#version 300 es\n","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+i,r=["#version 300 es\n","#define varying in",v?"":"out highp vec4 pc_fragColor;",v?"":"#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"+r),i+f),d=r+l,h=fc(c,c.VERTEX_SHADER,m),y=fc(c,c.FRAGMENT_SHADER,d);return c.attachShader(_,h),c.attachShader(_,y),void 0!==e.index0AttributeName?c.bindAttribLocation(_,0,e.index0AttributeName):!0===e.morphTargets&&c.bindAttribLocation(_,0,"position"),c.linkProgram(_),t.debug.checkShaderErrors&&(p=c.getProgramInfoLog(_).trim(),v=c.getShaderInfoLog(h).trim(),f=c.getShaderInfoLog(y).trim(),!(t=l=!0)===c.getProgramParameter(_,c.LINK_STATUS)?(l=!1,o=vc(c,h,"vertex"),s=vc(c,y,"fragment"),console.error("THREE.WebGLProgram: shader error: ",c.getError(),"gl.VALIDATE_STATUS",c.getProgramParameter(_,c.VALIDATE_STATUS),"gl.getProgramInfoLog",p,o,s)):""!==p?(console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",p),st.a.environment===B.a.WX&&(""!==v&&(console.error("vertexLog",v),console.error("vertexGlsl",m)),""!==f)&&(console.error("fragmentLog",f),console.error("fragmentGlsl",d))):""!==v&&""!==f||(t=!1),t)&&(this.diagnostics={runnable:l,programLog:p,vertexShader:{log:v,prefix:i},fragmentShader:{log:f,prefix:r}}),c.detachShader(_,h),c.detachShader(_,y),c.deleteShader(h),c.deleteShader(y),this.getUniforms=function(){return a=void 0===a?new hc(c,_):a},this.getAttributes=function(){return u=void 0===u?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}(c,_):u},this.destroy=function(){c.deleteProgram(_),this.program=void 0},this.name=e.shaderName,this.id=lc++,this.cacheKey=n,this.usedTimes=1,this.program=_,this.vertexShader=h,this.fragmentShader=y,this}function Lc(d,v,p){var s=[],m=p.isWebGL2,y=p.logarithmicDepthBuffer,b=p.floatVertexTextures,g=p.precision,_=p.maxVertexUniforms,w=p.vertexTextures,x={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 E(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=di,n}this.getParameters=function(t,n,e,i,r,o,s){var a,u=i.fog,i=t.isMeshStandardMaterial?i.environment:null,i=t.envMap||i,c=x[t.type],h=s.isSkinnedMesh?(h=(h=s).skeleton.bones,b?1024:(a=Math.floor((_-20)/4),(a=Math.min(a,h.length))<h.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+h.length+" bones. This GPU supports "+a+"."),0):a)):0,f=(null!==t.precision&&(g=p.getMaxPrecision(t.precision))!==t.precision&&console.warn("THREE.WebGLProgram.getParameters:",t.precision,"not supported, using",g,"instead."),a=t,(f=c)?(f=eu[f],{name:a.type,uniforms:_a.clone(f.uniforms),vertexShader:f.vertexShader,fragmentShader:f.fragmentShader}):{name:a.type,uniforms:a.uniforms,vertexShader:a.vertexShader,fragmentShader:a.fragmentShader}),l=(t.onBeforeCompile(f,d),d.getRenderTarget());return{isWebGL2:m,shaderID:c,shaderName:f.name,uniforms:f.uniforms,vertexShader:f.vertexShader,fragmentShader:f.fragmentShader,defines:t.defines,isRawShaderMaterial:t.isRawShaderMaterial,isShaderMaterial:t.isShaderMaterial,precision:g,instancing:!0===s.isInstancedMesh,supportsVertexTextures:w,outputEncoding:null!==l?E(l.texture):d.outputEncoding,map:!!t.map,mapEncoding:E(t.map),matcap:!!t.matcap,matcapEncoding:E(t.matcap),envMap:!!i,envMapMode:i&&i.mapping,envMapEncoding:E(i),envMapCubeUV:!!i&&(i.mapping===Gn||i.mapping===Hn),lightMap:!!t.lightMap,lightMapEncoding:E(t.lightMap),aoMap:!!t.aoMap,emissiveMap:!!t.emissiveMap,emissiveMapEncoding:E(t.emissiveMap),bumpMap:!!t.bumpMap,normalMap:!!t.normalMap,objectSpaceNormalMap:t.normalMapType===yi,tangentSpaceNormalMap:t.normalMapType===mi,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:!!u,useFog:t.fog,fogExp2:u&&u.isFogExp2,flatShading:t.flatShading,sizeAttenuation:t.sizeAttenuation,logarithmicDepthBuffer:y,skinning:t.skinning&&0<h,maxBones:h,useVertexTexture:b,morphTargets:t.morphTargets,morphNormals:t.morphNormals,maxMorphTargets:d.maxMorphTargets,maxMorphNormals:d.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:d.shadowMap.enabled&&0<e.length,shadowMapType:d.shadowMap.type,toneMapping:t.toneMapped?d.toneMapping:Bn,physicallyCorrectLights:d.physicallyCorrectLights,premultipliedAlpha:t.premultipliedAlpha,alphaTest:t.alphaTest,doubleSided:t.side===un,flipSided:t.side===an,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:m||null!==v.get("EXT_frag_depth"),rendererExtensionDrawBuffers:m||null!==v.get("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:m||null!==v.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(d.outputEncoding),n.push(d.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 Oc(d,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 Rc(){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 Nc(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 Pc(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 Fc(){var a=[],u=0,s=[],c=[],h={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||h,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||h,s.groupOrder=i,s.renderOrder=t.renderOrder,s.z=r,s.group=o),u++,s}return{opaque:s,transparent:c,init:function(){u=0,c.length=s.length=0},push:function(t,n,e,i,r,o){n=f(t,n,e,i,r,o),(!1!==t.userData.transparent&&!0===e.transparent?c:s).push(n)},unshift:function(t,n,e,i,r,o){n=f(t,n,e,i,r,o),!1===t.userData.transparent?s.push(n):(!0===e.transparent?c:s).unshift(n)},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||Nc),1<c.length&&c.sort(n||Pc)}}}function jc(){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 Fc,r.set(t,new WeakMap),r.get(t).set(n,e),t.addEventListener("dispose",o)):void 0===(e=i.get(n))&&(e=new Fc,i.set(n,e)),e},dispose:function(){r=new WeakMap}}}function Ic(){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 Tt,color:new lt};break;case"SpotLight":n={position:new Tt,direction:new Tt,color:new lt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new Tt,color:new lt,distance:0,decay:0};break;case"HemisphereLight":n={direction:new Tt,skyColor:new lt,groundColor:new lt};break;case"RectAreaLight":n={color:new lt,position:new Tt,halfWidth:new Tt,halfHeight:new Tt}}return e[t.id]=n}}}var Cc=0;function Dc(t,n){return(n.castShadow?1:0)-(t.castShadow?1:0)}function kc(){for(var e,A=new Ic,M=(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 Mt};break;case"PointLight":n={shadowBias:0,shadowRadius:1,shadowMapSize:new Mt,shadowCameraNear:1,shadowCameraFar:1e3}}return e[t.id]=n}}),O={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++)O.probe.push(new Tt);var L=new Tt,R=new At,N=new At;return{setup:function(t,n,e){for(var i=0,r=0,o=0,s=0;s<9;s++)O.probe[s].set(0,0,0);var a=0,u=0,c=0,h=0,f=0,l=0,d=0,v=0,p=e.matrixWorldInverse;t.sort(Dc);for(var s=0,m=t.length;s<m;s++){var y,b,g,_=t[s],w=_.color,x=_.intensity,E=_.distance,S=_.shadow&&_.shadow.map?_.shadow.map.texture:null;if(_.isAmbientLight)i+=w.r*x,r+=w.g*x,o+=w.b*x;else if(_.isLightProbe)for(var T=0;T<9;T++)O.probe[T].addScaledVector(_.sh.coefficients[T],x);else _.isDirectionalLight?((g=A.get(_)).color.copy(_.color).multiplyScalar(_.intensity),g.direction.setFromMatrixPosition(_.matrixWorld),L.setFromMatrixPosition(_.target.matrixWorld),g.direction.sub(L),g.direction.transformDirection(p),_.castShadow&&(y=_.shadow,(b=M.get(_)).shadowBias=y.bias,b.shadowRadius=y.radius,b.shadowMapSize=y.mapSize,O.directionalShadow[a]=b,O.directionalShadowMap[a]=S,O.directionalShadowMatrix[a]=_.shadow.matrix,l++),O.directional[a]=g,a++):_.isSpotLight?((g=A.get(_)).position.setFromMatrixPosition(_.matrixWorld),g.position.applyMatrix4(p),g.color.copy(w).multiplyScalar(x),g.distance=E,g.direction.setFromMatrixPosition(_.matrixWorld),L.setFromMatrixPosition(_.target.matrixWorld),g.direction.sub(L),g.direction.transformDirection(p),g.coneCos=Math.cos(_.angle),g.penumbraCos=Math.cos(_.angle*(1-_.penumbra)),g.decay=_.decay,_.castShadow&&(y=_.shadow,(b=M.get(_)).shadowBias=y.bias,b.shadowRadius=y.radius,b.shadowMapSize=y.mapSize,O.spotShadow[c]=b,O.spotShadowMap[c]=S,O.spotShadowMatrix[c]=_.shadow.matrix,v++),O.spot[c]=g,c++):_.isRectAreaLight?((g=A.get(_)).color.copy(w).multiplyScalar(x),g.position.setFromMatrixPosition(_.matrixWorld),g.position.applyMatrix4(p),N.identity(),R.copy(_.matrixWorld),R.premultiply(p),N.extractRotation(R),g.halfWidth.set(.5*_.width,0,0),g.halfHeight.set(0,.5*_.height,0),g.halfWidth.applyMatrix4(N),g.halfHeight.applyMatrix4(N),O.rectArea[h]=g,h++):_.isPointLight?((g=A.get(_)).position.setFromMatrixPosition(_.matrixWorld),g.position.applyMatrix4(p),g.color.copy(_.color).multiplyScalar(_.intensity),g.distance=_.distance,g.decay=_.decay,_.castShadow&&(y=_.shadow,(b=M.get(_)).shadowBias=y.bias,b.shadowRadius=y.radius,b.shadowMapSize=y.mapSize,b.shadowCameraNear=y.camera.near,b.shadowCameraFar=y.camera.far,O.pointShadow[u]=b,O.pointShadowMap[u]=S,O.pointShadowMatrix[u]=_.shadow.matrix,d++),O.point[u]=g,u++):_.isHemisphereLight&&((g=A.get(_)).direction.setFromMatrixPosition(_.matrixWorld),g.direction.transformDirection(p),g.direction.normalize(),g.skyColor.copy(_.color).multiplyScalar(x),g.groundColor.copy(_.groundColor).multiplyScalar(x),O.hemi[f]=g,f++)}O.ambient[0]=i,O.ambient[1]=r,O.ambient[2]=o,(e=O.hash).directionalLength===a&&e.pointLength===u&&e.spotLength===c&&e.rectAreaLength===h&&e.hemiLength===f&&e.numDirectionalShadows===l&&e.numPointShadows===d&&e.numSpotShadows===v||(O.directional.length=a,O.spot.length=c,O.rectArea.length=h,O.point.length=u,O.hemi.length=f,O.directionalShadow.length=l,O.directionalShadowMap.length=l,O.pointShadow.length=d,O.pointShadowMap.length=d,O.spotShadow.length=v,O.spotShadowMap.length=v,O.directionalShadowMatrix.length=l,O.pointShadowMatrix.length=d,O.spotShadowMatrix.length=v,e.directionalLength=a,e.pointLength=u,e.spotLength=c,e.rectAreaLength=h,e.hemiLength=f,e.numDirectionalShadows=l,e.numPointShadows=d,e.numSpotShadows=v,O.version=Cc++)},state:O}}function Uc(){var n=new kc,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 Bc(){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 Uc,i.set(t,new WeakMap),i.get(t).set(n,e),t.addEventListener("dispose",r)):!1===i.get(t).has(n)?(e=new Uc,i.get(t).set(n,e)):e=i.get(t).get(n),e},dispose:function(){i=new WeakMap}}}function Gc(t,n,e){this.width=t,this.height=n,this.scissor=new Ot(0,0,t,n),this.scissorTest=!1,this.viewport=new Ot(0,0,t,n),this.texture=new l(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:Zn,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 Hc(t){f.call(this),this.type="MeshDepthMaterial",this.depthPacking=vi,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 Xc(t){f.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new Tt,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)}Gc.prototype=Object.assign(Object.create(V.prototype),{constructor:Gc,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"})}}),((Hc.prototype=Object.create(f.prototype)).constructor=Hc).prototype.isMeshDepthMaterial=!0,Hc.prototype.copy=function(t){return f.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},((Xc.prototype=Object.create(f.prototype)).constructor=Xc).prototype.isMeshDistanceMaterial=!0,Xc.prototype.copy=function(t){return f.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 Vc="\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",zc="\n\nvoid main() {\n\n\tgl_Position = vec4( position, 1.0 );\n\n}\n\n";function Wc(b,g,_){var w=new zt,x=new Mt,E=new Mt,S=new Ot,r=[],o=[],f={},l={0:an,1:sn,2:un},T=new Ea({defines:{SAMPLE_RATE:.25,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new Mt},radius:{value:4}},vertexShader:zc,fragmentShader:Vc}),A=T.clone(),t=(A.defines.HORIZONAL_PASS=1,new oa),M=(t.setAttribute("position",new R(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3)),new $a(t,T)),O=this;function d(t,n,e){var e=t<<0|n<<1|e<<2,i=r[e];return void 0===i&&(i=new Hc({depthPacking:pi,morphTargets:t,skinning:n}),r[e]=i),i}function v(t,n,e){var e=t<<0|n<<1|e<<2,i=o[e];return void 0===i&&(i=new Xc({morphTargets:t,skinning:n}),o[e]=i),i}function L(t,n,e,i,r,o){var s,a=t.geometry,u=null,c=d,h=t.customDepthMaterial;return!0===e.isPointLight&&(c=v,h=t.customDistanceMaterial),u=void 0===h?(!(s=!1)===n.morphTargets&&(!0===a.isBufferGeometry?s=a.morphAttributes&&a.morphAttributes.position&&0<a.morphAttributes.position.length:!0===a.isGeometry&&(s=a.morphTargets&&0<a.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)):h,b.localClippingEnabled&&!0===n.clipShadows&&0!==n.clippingPlanes.length&&(c=u.uuid,s=n.uuid,void 0===(a=f[c])&&(f[c]=a={}),void 0===(t=a[s])&&(t=u.clone(),a[s]=t),u=t),u.visible=n.visible,u.wireframe=n.wireframe,u.side=o===on?null!==n.shadowSide?n.shadowSide:n.side:null!==n.shadowSide?n.shadowSide:l[n.side],u.clipShadows=n.clipShadows,u.clippingPlanes=n.clippingPlanes,u.clipIntersection=n.clipIntersection,u.wireframeLinewidth=n.wireframeLinewidth,u.linewidth=n.linewidth,!0===e.isPointLight&&!0===u.isMeshDistanceMaterial&&(u.referencePosition.setFromMatrixPosition(e.matrixWorld),u.nearDistance=i,u.farDistance=r),u}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=rn,this.render=function(t,n,e){if(!1!==O.enabled&&(!1!==O.autoUpdate||!1!==O.needsUpdate)&&0!==t.length){var i=b.getRenderTarget(),r=b.getActiveCubeFace(),o=b.getActiveMipmapLevel(),s=b.state;s.setBlending(cn),s.buffers.color.setClear(1,1,1,1),s.buffers.depth.setTest(!0),s.setScissorTest(!1);for(var a,u,c=0,h=t.length;c<h;c++){var f=t[c],l=f.shadow;if(void 0===l)console.warn("THREE.WebGLShadowMap:",f,"has no shadow.");else{x.copy(l.mapSize);for(var d,v=l.getFrameExtents(),p=(x.multiply(v),E.copy(l.mapSize),(x.x>_||x.y>_)&&(console.warn("THREE.WebGLShadowMap:",f,"has shadow exceeding max texture size, reducing"),x.x>_&&(E.x=Math.floor(_/v.x),x.x=E.x*v.x,l.mapSize.x=E.x),x.y>_)&&(E.y=Math.floor(_/v.y),x.y=E.y*v.y,l.mapSize.y=E.y),null!==l.map||l.isPointLightShadow||this.type!==on||(l.map=new Gc(x.x,x.y,d={minFilter:Zn,magFilter:Zn,format:le}),l.map.texture.name=f.name+".shadowMap",l.mapPass=new Gc(x.x,x.y,d),l.camera.updateProjectionMatrix()),null===l.map&&(l.map=new Gc(x.x,x.y,d={minFilter:Wn,magFilter:Wn,format:le}),l.map.texture.name=f.name+".shadowMap",l.camera.updateProjectionMatrix()),b.setRenderTarget(l.map),b.clear(),l.getViewportCount()),m=0;m<p;m++){var y=l.getViewport(m);S.set(E.x*y.x,E.y*y.y,E.x*y.z,E.y*y.w),s.viewport(S),l.updateMatrices(f,m),w=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===on)&&(!n.frustumCulled||w.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse,n.matrixWorld);var a=g.update(n),u=n.material;if(Array.isArray(u))for(var c=a.groups,h=0,f=c.length;h<f;h++){var l,d=c[h],v=u[d.materialIndex];v&&v.visible&&(l=L(n,v,r,i.near,i.far,o),b.renderBufferDirect(i,null,a,l,n,d))}else u.visible&&(l=L(n,u,r,i.near,i.far,o),b.renderBufferDirect(i,null,a,l,n,null))}var p=n.children;for(var m=0,y=p.length;m<y;m++)t(p[m],e,i,r,o)}(n,e,l.camera,f,this.type)}l.isPointLightShadow||this.type!==on||(v=l,a=e,u=void 0,u=g.update(M),T.uniforms.shadow_pass.value=v.map.texture,T.uniforms.resolution.value=v.mapSize,T.uniforms.radius.value=v.radius,b.setRenderTarget(v.mapPass),b.clear(),b.renderBufferDirect(a,null,u,T,M,null),A.uniforms.shadow_pass.value=v.mapPass.texture,A.uniforms.resolution.value=v.mapSize,A.uniforms.radius.value=v.radius,b.setRenderTarget(v.map),b.clear(),b.renderBufferDirect(a,null,u,A,M,null))}}O.needsUpdate=!1,b.setRenderTarget(i,r,o)}}}function Yc(t){return(Yc="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,e){return(n=function(t){t=function(t,n){if("object"!=Yc(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Yc(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Yc(t)?t:t+""}(n))in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function Zc(h,e,t){var i=t.isWebGL2;var r=new function(){var n=!1,o=new Ot,e=null,s=new Ot(0,0,0,0);return{setMask:function(t){e===t||n||(h.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)&&(h.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?R:N)(h.DEPTH_TEST)},setMask:function(t){e===t||n||(h.depthMask(t),e=t)},setFunc:function(t){if(i!==t){if(t)switch(t){case Nn:h.depthFunc(h.NEVER);break;case Pn:h.depthFunc(h.ALWAYS);break;case Fn:h.depthFunc(h.LESS);break;case jn:h.depthFunc(h.LEQUAL);break;case In:h.depthFunc(h.EQUAL);break;case Cn:h.depthFunc(h.GEQUAL);break;case Dn:h.depthFunc(h.GREATER);break;case kn:h.depthFunc(h.NOTEQUAL);break;default:h.depthFunc(h.LEQUAL)}else h.depthFunc(h.LEQUAL);i=t}},setLocked:function(t){n=t},setClear:function(t){r!==t&&(h.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,c=null;return{setTest:function(t){n||(t?R:N)(h.STENCIL_TEST)},setMask:function(t){e===t||n||(h.stencilMask(t),e=t)},setFunc:function(t,n,e){i===t&&r===n&&o===e||(h.stencilFunc(t,n,e),i=t,r=n,o=e)},setOp:function(t,n,e){s===t&&a===n&&u===e||(h.stencilOp(t,n,e),s=t,a=n,u=e)},setLocked:function(t){n=t},setClear:function(t){c!==t&&(h.clearStencil(t),c=t)},reset:function(){n=!1,c=u=a=s=o=r=i=e=null}}},t=h.getParameter(h.MAX_VERTEX_ATTRIBS),a=new Uint8Array(t),u=new Uint8Array(t),c=new Uint8Array(t),n={},f=null,l=null,d=null,v=null,p=null,m=null,y=null,b=null,g=null,_=!1,w=null,x=null,E=null,S=null,C=null,D=h.getParameter(h.MAX_COMBINED_TEXTURE_IMAGE_UNITS),T=!1,t=0,A=h.getParameter(h.VERSION),M=(-1!==A.indexOf("WebGL")?(t=parseFloat(/^WebGL\ ([0-9])/.exec(A)[1]),T=1<=t):-1!==A.indexOf("OpenGL ES")&&(t=parseFloat(/^OpenGL\ ES\ ([0-9])/.exec(A)[1]),T=2<=t),null),O={},k=new Ot,U=new Ot;function B(t,n,e){var i=new Uint8Array(4),r=h.createTexture();h.bindTexture(t,r),h.texParameteri(t,h.TEXTURE_MIN_FILTER,h.NEAREST),h.texParameteri(t,h.TEXTURE_MAG_FILTER,h.NEAREST);for(var o=0;o<e;o++)h.texImage2D(n+o,0,h.RGBA,1,1,0,h.RGBA,h.UNSIGNED_BYTE,i);return r}var L={};function G(t,n){a[t]=1,0===u[t]&&(h.enableVertexAttribArray(t),u[t]=1),c[t]!==n&&((i?h:e.get("ANGLE_instanced_arrays"))[i?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](t,n),c[t]=n)}function R(t){!0!==n[t]&&(h.enable(t),n[t]=!0)}function N(t){!1!==n[t]&&(h.disable(t),n[t]=!1)}L[h.TEXTURE_2D]=B(h.TEXTURE_2D,h.TEXTURE_2D,1),L[h.TEXTURE_CUBE_MAP]=B(h.TEXTURE_CUBE_MAP,h.TEXTURE_CUBE_MAP_POSITIVE_X,6),r.setClear(0,0,0,1),o.setClear(1),s.setClear(0),R(h.DEPTH_TEST),o.setFunc(jn),I(!1),H(nn),R(h.CULL_FACE),j(cn);var P=Qc(Qc(Qc({},pn,h.FUNC_ADD),mn,h.FUNC_SUBTRACT),yn,h.FUNC_REVERSE_SUBTRACT),F=(i?(P[bn]=h.MIN,P[gn]=h.MAX):null!==(A=e.get("EXT_blend_minmax"))&&(P[bn]=A.MIN_EXT,P[gn]=A.MAX_EXT),Qc(Qc(Qc(Qc(Qc(Qc(Qc(Qc(Qc(Qc(t={},_n,h.ZERO),wn,h.ONE),xn,h.SRC_COLOR),Sn,h.SRC_ALPHA),Rn,h.SRC_ALPHA_SATURATE),On,h.DST_COLOR),An,h.DST_ALPHA),En,h.ONE_MINUS_SRC_COLOR),Tn,h.ONE_MINUS_SRC_ALPHA),Ln,h.ONE_MINUS_DST_COLOR),Qc(t,Mn,h.ONE_MINUS_DST_ALPHA));function j(t,n,e,i,r,o,s,a){if(t===cn)l&&(N(h.BLEND),l=!1);else if(l||(R(h.BLEND),l=!0),t!==vn){if(t!==d||a!==_){if(v===pn&&y===pn||(h.blendEquation(h.FUNC_ADD),y=v=pn),a)switch(t){case hn:h.blendFuncSeparate(h.ONE,h.ONE_MINUS_SRC_ALPHA,h.ONE,h.ONE_MINUS_SRC_ALPHA);break;case fn:h.blendFunc(h.ONE,h.ONE);break;case ln:h.blendFuncSeparate(h.ZERO,h.ZERO,h.ONE_MINUS_SRC_COLOR,h.ONE_MINUS_SRC_ALPHA);break;case dn:h.blendFuncSeparate(h.ZERO,h.SRC_COLOR,h.ZERO,h.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}else switch(t){case hn:h.blendFuncSeparate(h.SRC_ALPHA,h.ONE_MINUS_SRC_ALPHA,h.ONE,h.ONE_MINUS_SRC_ALPHA);break;case fn:h.blendFunc(h.SRC_ALPHA,h.ONE);break;case ln:h.blendFunc(h.ZERO,h.ONE_MINUS_SRC_COLOR);break;case dn:h.blendFunc(h.ZERO,h.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}g=b=m=p=null,d=t,_=a}}else r=r||n,o=o||e,s=s||i,n===v&&r===y||(h.blendEquationSeparate(P[n],P[r]),v=n,y=r),e===p&&i===m&&o===b&&s===g||(h.blendFuncSeparate(F[e],F[i],F[o],F[s]),p=e,m=i,b=o,g=s),d=t,_=null}function I(t){w!==t&&(t?h.frontFace(h.CW):h.frontFace(h.CCW),w=t)}function H(t){t!==tn?(R(h.CULL_FACE),t!==x&&(t===nn?h.cullFace(h.BACK):t===en?h.cullFace(h.FRONT):h.cullFace(h.FRONT_AND_BACK))):N(h.CULL_FACE),x=t}function X(t,n,e){t?(R(h.POLYGON_OFFSET_FILL),S===n&&C===e||(h.polygonOffset(n,e),S=n,C=e)):N(h.POLYGON_OFFSET_FILL)}function V(t){void 0===t&&(t=h.TEXTURE0+D-1),M!==t&&(h.activeTexture(t),M=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){G(t,0)},enableAttributeAndDivisor:G,disableUnusedAttributes:function(){for(var t=0,n=u.length;t!==n;++t)u[t]!==a[t]&&(h.disableVertexAttribArray(t),u[t]=0)},enable:R,disable:N,useProgram:function(t){return f!==t&&(h.useProgram(t),f=t,!0)},setBlending:j,setMaterial:function(t,n,e){(t.side===un?N:R)(h.CULL_FACE);var i=t.side===an,n=(I(i=n?!i:i),t.blending!==hn||!1!==t.transparent&&!1!==e.userData.transparent?j(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha,t.premultipliedAlpha):j(cn),o.setFunc(t.depthFunc),o.setTest(t.depthTest),o.setMask(t.depthWrite),r.setMask(t.colorWrite),t.stencilWrite);s.setTest(n),n&&(s.setMask(t.stencilWriteMask),s.setFunc(t.stencilFunc,t.stencilRef,t.stencilFuncMask),s.setOp(t.stencilFail,t.stencilZFail,t.stencilZPass)),X(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits)},setFlipSided:I,setCullFace:H,setLineWidth:function(t){t!==E&&(T&&h.lineWidth(t),E=t)},setPolygonOffset:X,setScissorTest:function(t){(t?R:N)(h.SCISSOR_TEST)},activeTexture:V,bindTexture:function(t,n){null===M&&V();var e=O[M];void 0===e&&(O[M]=e={type:void 0,texture:void 0}),e.type===t&&e.texture===n||(h.bindTexture(t,n||L[t]),e.type=t,e.texture=n)},unbindTexture:function(){var t=O[M];void 0!==t&&void 0!==t.type&&(h.bindTexture(t.type,null),t.type=void 0,t.texture=void 0)},compressedTexImage2D:function(){try{h.compressedTexImage2D.apply(h,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage2D:function(){try{h.texImage2D.apply(h,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage3D:function(){try{h.texImage3D.apply(h,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},scissor:function(t){!1===k.equals(t)&&(h.scissor(t.x,t.y,t.z,t.w),k.copy(t))},viewport:function(t){!1===U.equals(t)&&(h.viewport(t.x,t.y,t.z,t.w),U.copy(t))},reset:function(){for(var t=0;t<u.length;t++)1===u[t]&&(h.disableVertexAttribArray(t),u[t]=0);n={},O={},x=w=d=f=M=null,r.reset(),o.reset(),s.reset()}}}function qc(t){return(qc="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 Kc(t,n,e){return(n=function(t){t=function(t,n){if("object"!=qc(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=qc(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==qc(t)?t:t+""}(n))in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function Jc(m,i,y,b,r,g,u){var o,_=r.isWebGL2,n=r.maxTextures,w=r.maxCubemapSize,D=r.maxTextureSize,k=r.maxSamples,s=new WeakMap,e=!1;try{e="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(t){}function a(t,n){return e?new OffscreenCanvas(t,n):st.a.document.createElementNS("http://www.w3.org/1999/xhtml","canvas")}function x(t,n,e,i){var r=1;return(r=t.width>i||t.height>i?i/Math.max(t.width,t.height):r)<1||!0===n?"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap?(n=(i=n?St.floorPowerOfTwo:Math.floor)(r*t.width),i=i(r*t.height),void 0===o&&(o=a(n,i)),(r=e?a(n,i):o).width=n,r.height=i,r.getContext("2d").drawImage(t,0,0,n,i),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+t.width+"x"+t.height+") to ("+n+"x"+i+")."),r):("data"in t&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+t.width+"x"+t.height+")."),t):t}function E(t){return St.isPowerOfTwo(t.width)&&St.isPowerOfTwo(t.height)}function S(t,n){return t.generateMipmaps&&n&&t.minFilter!==Wn&&t.minFilter!==Zn}function T(t,n,e,i){m.generateMipmap(t),b.get(n).do=Math.log(Math.max(e,i))*Math.LOG2E}function A(t,n,e){if(!1===_)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),(t=n===m.RGBA&&(e===m.FLOAT&&(t=m.RGBA32F),e===m.HALF_FLOAT&&(t=m.RGBA16F),e===m.UNSIGNED_BYTE)?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===Wn||t===Yn||t===Qn?m.NEAREST:m.LINEAR}function h(t){var n,e,t=t.target;t.removeEventListener("dispose",h),n=t,void 0!==(e=b.get(n)).vo&&(m.deleteTexture(e.po),b.remove(n)),t.isVideoTexture&&s.delete(t),u.memory.textures--}function f(t){var t=t.target,n=(t.removeEventListener("dispose",f),b.get(t)),e=b.get(t.texture);if(t){if(void 0!==e.po&&m.deleteTexture(e.po),t.depthTexture&&t.depthTexture.dispose(),t.isWebGLCubeRenderTarget)for(var i=0;i<6;i++)m.deleteFramebuffer(n.mo[i]),n.yo&&m.deleteRenderbuffer(n.yo[i]);else m.deleteFramebuffer(n.mo),n.yo&&m.deleteRenderbuffer(n.yo),n.bo&&m.deleteFramebuffer(n.bo),n._o&&m.deleteRenderbuffer(n._o),n.wo&&m.deleteRenderbuffer(n.wo);b.remove(t.texture),b.remove(t)}u.memory.textures--}var l=0;function d(t,n){var e,i=b.get(t);if(t.isVideoTexture&&(e=t,r=u.render.frame,s.get(e)!==r)&&(s.set(e,r),e.update()),0<t.version&&i.xo!==t.version){var r=t.image;if(void 0===r)st.a.environment===B.a.BROWSER&&console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==r.complete)return void N(i,t,n);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}y.activeTexture(m.TEXTURE0+n),y.bindTexture(m.TEXTURE_2D,i.po)}function v(t,n){if(6===t.image.length){var e=b.get(t);if(0<t.version&&e.xo!==t.version){R(e,t),y.activeTexture(m.TEXTURE0+n),y.bindTexture(m.TEXTURE_CUBE_MAP,e.po),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,w);var a=o[0],u=E(a)||_,c=g.convert(t.format),h=g.convert(t.type),f=A(t.internalFormat,c,h);if(L(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!==le&&t.format!==fe?null!==c?y.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()"):y.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+s,d,f,v.width,v.height,0,c,h,v.data)}e.do=l.length-1}else{l=t.mipmaps;for(s=0;s<6;s++)if(r){y.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+s,0,f,o[s].width,o[s].height,0,c,h,o[s].data);for(d=0;d<l.length;d++){var p=(v=l[d]).image[s].image;y.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+s,d+1,f,p.width,p.height,0,c,h,p.data)}}else{y.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+s,0,f,c,h,o[s]);for(d=0;d<l.length;d++){v=l[d];y.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+s,d+1,f,c,h,v.image[s])}}e.do=l.length}S(t,u)&&T(m.TEXTURE_CUBE_MAP,t,a.width,a.height),e.xo=t.version,t.onUpdate&&t.onUpdate(t)}else y.activeTexture(m.TEXTURE0+n),y.bindTexture(m.TEXTURE_CUBE_MAP,e.po)}}function p(t,n){y.activeTexture(m.TEXTURE0+n),y.bindTexture(m.TEXTURE_CUBE_MAP,b.get(t).po)}var M=Kc(Kc(Kc({},Xn,m.REPEAT),Vn,m.CLAMP_TO_EDGE),zn,m.MIRRORED_REPEAT),O=Kc(Kc(Kc(Kc(Kc(Kc({},Wn,m.NEAREST),Yn,m.NEAREST_MIPMAP_NEAREST),Qn,m.NEAREST_MIPMAP_LINEAR),Zn,m.LINEAR),qn,m.LINEAR_MIPMAP_NEAREST),Kn,m.LINEAR_MIPMAP_LINEAR);function L(t,n,e){e?(m.texParameteri(t,m.TEXTURE_WRAP_S,M[n.wrapS]),m.texParameteri(t,m.TEXTURE_WRAP_T,M[n.wrapT]),t!==m.TEXTURE_3D&&t!==m.TEXTURE_2D_ARRAY||m.texParameteri(t,m.TEXTURE_WRAP_R,M[n.wrapR]),m.texParameteri(t,m.TEXTURE_MAG_FILTER,O[n.magFilter]),m.texParameteri(t,m.TEXTURE_MIN_FILTER,O[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===Vn&&n.wrapT===Vn||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!==Wn&&n.minFilter!==Zn&&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===re&&null===i.get("OES_texture_float_linear")||n.type===oe&&null===(_||i.get("OES_texture_half_float_linear"))||(1<n.anisotropy||b.get(n).Eo)&&(m.texParameterf(t,e.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(n.anisotropy,r.getMaxAnisotropy())),b.get(n).Eo=n.anisotropy)}function R(t,n){void 0===t.vo&&(t.vo=!0,n.addEventListener("dispose",h),t.po=m.createTexture(),u.memory.textures++)}function N(t,n,e){var i=m.TEXTURE_2D,e=(n.isDataTexture2DArray&&(i=m.TEXTURE_2D_ARRAY),n.isDataTexture3D&&(i=m.TEXTURE_3D),R(t,n),y.activeTexture(m.TEXTURE0+e),y.bindTexture(i,t.po),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),e=n,!_&&(e.wrapS!==Vn||e.wrapT!==Vn||e.minFilter!==Wn&&e.minFilter!==Zn)&&!1===E(n.image)),e=x(n.image,e,!1,D),r=E(e)||_,o=g.convert(n.format),s=g.convert(n.type),a=A(n.internalFormat,o,s);L(i,n,r);var u,c=n.mipmaps;if(n.isDepthTexture)a=m.DEPTH_COMPONENT,_?a=n.type===re?m.DEPTH_COMPONENT32F:n.type===ie?m.DEPTH_COMPONENT24:n.type===ce?m.DEPTH24_STENCIL8:m.DEPTH_COMPONENT16:n.type===re&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),n.format===pe&&a===m.DEPTH_COMPONENT&&n.type!==ne&&n.type!==ie&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),n.type=ne,s=g.convert(n.type)),n.format===me&&a===m.DEPTH_COMPONENT&&(a=m.DEPTH_STENCIL,n.type!==ce)&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),n.type=ce,s=g.convert(n.type)),y.texImage2D(m.TEXTURE_2D,0,a,e.width,e.height,0,o,s,null);else if(n.isDataTexture)if(0<c.length&&r){for(var h=0,f=c.length;h<f;h++)u=c[h],y.texImage2D(m.TEXTURE_2D,h,a,u.width,u.height,0,o,s,u.data);n.generateMipmaps=!1,t.do=c.length-1}else y.texImage2D(m.TEXTURE_2D,0,a,e.width,e.height,0,o,s,e.data),t.do=0;else if(n.isCompressedTexture){for(h=0,f=c.length;h<f;h++)u=c[h],n.format!==le&&n.format!==fe?null!==o?y.compressedTexImage2D(m.TEXTURE_2D,h,a,u.width,u.height,0,u.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):y.texImage2D(m.TEXTURE_2D,h,a,u.width,u.height,0,o,s,u.data);t.do=c.length-1}else if(n.isDataTexture2DArray)y.texImage3D(m.TEXTURE_2D_ARRAY,0,a,e.width,e.height,e.depth,0,o,s,e.data),t.do=0;else if(n.isDataTexture3D)y.texImage3D(m.TEXTURE_3D,0,a,e.width,e.height,e.depth,0,o,s,e.data),t.do=0;else if(0<c.length&&r){for(h=0,f=c.length;h<f;h++)u=c[h],y.texImage2D(m.TEXTURE_2D,h,a,o,s,u);n.generateMipmaps=!1,t.do=c.length-1}else y.texImage2D(m.TEXTURE_2D,0,a,o,s,e),t.do=0;S(n,r)&&T(i,n,e.width,e.height),t.xo=n.version,n.onUpdate&&n.onUpdate(n)}function P(t,n,e,i){var r=g.convert(n.texture.format),o=g.convert(n.texture.type),s=A(n.texture.internalFormat,r,o);y.texImage2D(i,0,s,n.width,n.height,0,r,o,null),m.bindFramebuffer(m.FRAMEBUFFER,t),m.framebufferTexture2D(m.FRAMEBUFFER,e,i,b.get(n.texture).po,0),m.bindFramebuffer(m.FRAMEBUFFER,null)}function F(t,n,e){var i,r,o;m.bindRenderbuffer(m.RENDERBUFFER,t),n.depthBuffer&&!n.stencilBuffer?(r=m.DEPTH_COMPONENT16,e?((o=n.depthTexture)&&o.isDepthTexture&&(o.type===re?r=m.DEPTH_COMPONENT32F:o.type===ie&&(r=m.DEPTH_COMPONENT24)),o=j(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=j(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)):(t=g.convert(n.texture.format),i=g.convert(n.texture.type),r=A(n.texture.internalFormat,t,i),e?(o=j(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 U(t){var n=b.get(t),e=!0===t.isWebGLCubeRenderTarget;if(t.depthTexture){if(e)throw new Error("target.depthTexture not supported in Cube render targets");var i=n.mo,r=t;if(r&&r.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(m.bindFramebuffer(m.FRAMEBUFFER,i),!r.depthTexture||!r.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");if(b.get(r.depthTexture).po&&r.depthTexture.image.width===r.width&&r.depthTexture.image.height===r.height||(r.depthTexture.image.width=r.width,r.depthTexture.image.height=r.height,r.depthTexture.needsUpdate=!0),d(r.depthTexture,0),i=b.get(r.depthTexture).po,r.depthTexture.format===pe)m.framebufferTexture2D(m.FRAMEBUFFER,m.DEPTH_ATTACHMENT,m.TEXTURE_2D,i,0);else{if(r.depthTexture.format!==me)throw new Error("Unknown depthTexture format");m.framebufferTexture2D(m.FRAMEBUFFER,m.DEPTH_STENCIL_ATTACHMENT,m.TEXTURE_2D,i,0)}}else if(e){n.yo=[];for(var o=0;o<6;o++)m.bindFramebuffer(m.FRAMEBUFFER,n.mo[o]),n.yo[o]=m.createRenderbuffer(),F(n.yo[o],t,!1)}else m.bindFramebuffer(m.FRAMEBUFFER,n.mo),n.yo=m.createRenderbuffer(),F(n.yo,t,!1);m.bindFramebuffer(m.FRAMEBUFFER,null)}function j(t){return _&&t.isWebGLMultisampleRenderTarget?Math.min(k,t.samples):0}var I=!1,C=!1;this.allocateTextureUnit=function(){var t=l;return n<=t&&console.warn("THREE.WebGLTextures: Trying to use "+t+" texture units while this GPU supports only "+n),l+=1,t},this.resetTextureUnits=function(){l=0},this.setTexture2D=d,this.setTexture2DArray=function(t,n){var e=b.get(t);0<t.version&&e.xo!==t.version?N(e,t,n):(y.activeTexture(m.TEXTURE0+n),y.bindTexture(m.TEXTURE_2D_ARRAY,e.po))},this.setTexture3D=function(t,n){var e=b.get(t);0<t.version&&e.xo!==t.version?N(e,t,n):(y.activeTexture(m.TEXTURE0+n),y.bindTexture(m.TEXTURE_3D,e.po))},this.setTextureCube=v,this.setTextureCubeDynamic=p,this.setupRenderTarget=function(t){var n,e=b.get(t),i=b.get(t.texture),r=(t.addEventListener("dispose",f),i.po=m.createTexture(),u.memory.textures++,!0===t.isWebGLCubeRenderTarget),o=!0===t.isWebGLMultisampleRenderTarget,s=E(t)||_;if(!_||t.texture.format!==fe||t.texture.type!==re&&t.texture.type!==oe||(t.texture.format=le,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),r){e.mo=[];for(var a=0;a<6;a++)e.mo[a]=m.createFramebuffer()}else e.mo=m.createFramebuffer(),o&&(_?(e.bo=m.createFramebuffer(),e._o=m.createRenderbuffer(),m.bindRenderbuffer(m.RENDERBUFFER,e._o),o=g.convert(t.texture.format),n=g.convert(t.texture.type),o=A(t.texture.internalFormat,o,n),n=j(t),m.renderbufferStorageMultisample(m.RENDERBUFFER,n,o,t.width,t.height),m.bindFramebuffer(m.FRAMEBUFFER,e.bo),m.framebufferRenderbuffer(m.FRAMEBUFFER,m.COLOR_ATTACHMENT0,m.RENDERBUFFER,e._o),m.bindRenderbuffer(m.RENDERBUFFER,null),t.depthBuffer&&(e.wo=m.createRenderbuffer(),F(e.wo,t,!0)),m.bindFramebuffer(m.FRAMEBUFFER,null)):console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2."));if(r){y.bindTexture(m.TEXTURE_CUBE_MAP,i.po),L(m.TEXTURE_CUBE_MAP,t.texture,s);for(a=0;a<6;a++)P(e.mo[a],t,m.COLOR_ATTACHMENT0,m.TEXTURE_CUBE_MAP_POSITIVE_X+a);S(t.texture,s)&&T(m.TEXTURE_CUBE_MAP,t.texture,t.width,t.height),y.bindTexture(m.TEXTURE_CUBE_MAP,null)}else y.bindTexture(m.TEXTURE_2D,i.po),L(m.TEXTURE_2D,t.texture,s),P(e.mo,t,m.COLOR_ATTACHMENT0,m.TEXTURE_2D),S(t.texture,s)&&T(m.TEXTURE_2D,t.texture,t.width,t.height),y.bindTexture(m.TEXTURE_2D,null);t.depthBuffer&&U(t)},this.updateRenderTargetMipmap=function(t){var n,e,i=t.texture;S(i,E(t)||_)&&(n=t.isWebGLCubeRenderTarget?m.TEXTURE_CUBE_MAP:m.TEXTURE_2D,e=b.get(i).po,y.bindTexture(n,e),T(n,i,t.width,t.height),y.bindTexture(n,null))},this.updateMultisampleRenderTarget=function(t){var n,e,i,r;t.isWebGLMultisampleRenderTarget&&(_?(n=b.get(t),m.bindFramebuffer(m.READ_FRAMEBUFFER,n.bo),m.bindFramebuffer(m.DRAW_FRAMEBUFFER,n.mo),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.bo)):console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2."))},this.safeSetTexture2D=function(t,n){t&&t.isWebGLRenderTarget&&(!1===I&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),I=!0),t=t.texture),d(t,n)},this.safeSetTextureCube=function(t,n){t&&t.isWebGLCubeRenderTarget&&(!1===C&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),C=!0),t=t.texture),(t&&t.isCubeTexture||Array.isArray(t.image)&&6===t.image.length?v:p)(t,n)}}function $c(e,i,t){var r=t.isWebGL2;return{convert:function(t){var n;if(t===Jn)return e.UNSIGNED_BYTE;if(t===se)return e.UNSIGNED_SHORT_4_4_4_4;if(t===ae)return e.UNSIGNED_SHORT_5_5_5_1;if(t===ue)return e.UNSIGNED_SHORT_5_6_5;if(t===$n)return e.BYTE;if(t===te)return e.SHORT;if(t===ne)return e.UNSIGNED_SHORT;if(t===ee)return e.INT;if(t===ie)return e.UNSIGNED_INT;if(t===re)return e.FLOAT;if(t===oe)return r?e.HALF_FLOAT:null!==(n=i.get("OES_texture_half_float"))?n.HALF_FLOAT_OES:null;if(t===he)return e.ALPHA;if(t===fe)return e.RGB;if(t===le)return e.RGBA;if(t===de)return e.LUMINANCE;if(t===ve)return e.LUMINANCE_ALPHA;if(t===pe)return e.DEPTH_COMPONENT;if(t===me)return e.DEPTH_STENCIL;if(t===ye)return e.RED;if(t===be)return e.RED_INTEGER;if(t===ge)return e.RG;if(t===_e)return e.RG_INTEGER;if(t===we)return e.RGB_INTEGER;if(t===xe)return e.RGBA_INTEGER;if(t===Ee||t===Se||t===Te||t===Ae){if(null===(n=i.get("WEBGL_compressed_texture_s3tc")))return null;if(t===Ee)return n.COMPRESSED_RGB_S3TC_DXT1_EXT;if(t===Se)return n.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(t===Te)return n.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(t===Ae)return n.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(t===Me||t===Oe||t===Le||t===Re){if(null===(n=i.get("WEBGL_compressed_texture_pvrtc")))return null;if(t===Me)return n.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(t===Oe)return n.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(t===Le)return n.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(t===Re)return n.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(t===Ne)return null!==(n=i.get("WEBGL_compressed_texture_etc1"))?n.COMPRESSED_RGB_ETC1_WEBGL:null;if((t===Pe||t===Fe)&&null!==(n=i.get("WEBGL_compressed_texture_etc"))){if(t===Pe)return n.COMPRESSED_RGB8_ETC2;if(t===Fe)return n.COMPRESSED_RGBA8_ETC2_EAC}return t===je||t===Ie||t===Ce||t===De||t===ke||t===Ue||t===Be||t===Ge||t===He||t===Xe||t===Ve||t===ze||t===We||t===Ye||t===Ze||t===qe||t===Ke||t===Je||t===$e||t===ti||t===ni||t===ei||t===ii||t===ri||t===oi||t===si||t===ai||t===ui?null!==(n=i.get("WEBGL_compressed_texture_astc"))?t:null:t===Qe?null!==(n=i.get("EXT_texture_compression_bptc"))?t:null:t===ce?r?e.UNSIGNED_INT_24_8:null!==(n=i.get("WEBGL_depth_texture"))?n.UNSIGNED_INT_24_8_WEBGL:null:void 0}}}function th(t){vt.call(this),this.cameras=t||[]}function nh(){a.call(this),this.type="Group"}function eh(d,n){var e=this,m=null,i=1,v=null,r="local-floor",p=null,y=[],o=new Map,b=new vt,g=(b.layers.enable(1),b.viewport=new Ot,new vt),_=(g.layers.enable(2),g.viewport=new Ot,new th([b,g])),w=(_.layers.enable(1),_.layers.enable(2),null),x=null;function s(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 a(){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()),h.stop(),e.isPresenting=!1,e.dispatchEvent({type:"sessionend"})}function u(t){v=t,h.setContext(m),h.start(),e.isPresenting=!0,e.dispatchEvent({type:"sessionstart"})}function c(t){for(var n=m.inputSources,e=0;e<y.length;e++)o.set(n[e],y[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=y[t];return void 0===n&&(y[t]=n={}),void 0===n.targetRay&&(n.targetRay=new nh,n.targetRay.matrixAutoUpdate=!1,n.targetRay.visible=!1),n.targetRay},this.getControllerGrip=function(t){var n=y[t];return void 0===n&&(y[t]=n={}),void 0===n.grip&&(n.grip=new nh,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 v},this.getSession=function(){return m},this.setSession=function(t){null!==(m=t)&&(m.addEventListener("select",s),m.addEventListener("selectstart",s),m.addEventListener("selectend",s),m.addEventListener("squeeze",s),m.addEventListener("squeezestart",s),m.addEventListener("squeezeend",s),m.addEventListener("end",a),t={antialias:(t=n.getContextAttributes()).antialias,alpha:t.alpha,depth:t.depth,stencil:t.stencil,framebufferScaleFactor:i},t=new XRWebGLLayer(m,n,t),m.updateRenderState({baseLayer:t}),m.requestReferenceSpace(r).then(u),m.addEventListener("inputsourceschange",c))};var E=new Tt,S=new Tt;function T(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){_.near=g.near=b.near=t.near,_.far=g.far=b.far=t.far,w===_.near&&x===_.far||(m.updateRenderState({depthNear:_.near,depthFar:_.far}),w=_.near,x=_.far);var n=t.parent,e=_.cameras;T(_,n);for(var i=0;i<e.length;i++)T(e[i],n);t.matrixWorld.copy(_.matrixWorld);for(var r,o,s,a,u,c,h,f,l,d,v=t.children,i=0,p=v.length;i<p;i++)v[i].updateMatrixWorld(!0);return t=_,r=b,o=g,E.setFromMatrixPosition(r.matrixWorld),S.setFromMatrixPosition(o.matrixWorld),s=E.distanceTo(S),a=r.projectionMatrix.elements,o=o.projectionMatrix.elements,u=a[14]/(a[10]-1),c=a[14]/(a[10]+1),h=(a[9]+1)/a[5],f=(a[9]-1)/a[5],a=(a[8]-1)/a[0],o=(o[8]+1)/o[0],l=u*a,d=u*o,a=(o=s/(o-a))*-a,r.matrixWorld.decompose(t.position,t.quaternion,t.scale),t.translateX(a),t.translateZ(o),t.matrixWorld.compose(t.position,t.quaternion,t.scale),t.matrixWorldInverse.getInverse(t.matrixWorld),r=u+o,u=c+o,t.projectionMatrix.makePerspective(l-a,s-a+d,h*c/u*r,f*c/u*r,r,u),_};var A=null;var h=new Fs;h.setAnimationLoop(function(t,n){if(null!==(p=n.getViewerPose(v))){var e=p.views,i=m.renderState.baseLayer;d.setFramebuffer(i.framebuffer);for(var r=0;r<e.length;r++){var o=e[r],s=i.getViewport(o),a=_.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&&_.matrix.copy(a.matrix)}}for(var u=m.inputSources,r=0;r<y.length;r++){var c=y[r],h=u[r],f=null,l=null;h&&(c.targetRay&&null!==(f=n.getPose(h.targetRaySpace,v))&&(c.targetRay.matrix.fromArray(f.transform.matrix),c.targetRay.matrix.decompose(c.targetRay.position,c.targetRay.rotation,c.targetRay.scale)),c.grip)&&h.gripSpace&&null!==(l=n.getPose(h.gripSpace,v))&&(c.grip.matrix.fromArray(l.transform.matrix),c.grip.matrix.decompose(c.grip.position,c.grip.rotation,c.grip.scale)),c.targetRay&&(c.targetRay.visible=null!==f),c.grip&&(c.grip.visible=null!==l)}A&&A(t,n)}),this.setAnimationLoop=function(t){A=t},this.dispose=function(){}}function ih(t){var _,w,x,E,v,m,y,S,k,p,f,o,u,s,U,B,G,l,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,H=void 0===t.depth||t.depth,X=void 0===t.stencil||t.stencil,V=void 0!==t.antialias&&t.antialias,z=void 0===t.premultipliedAlpha||t.premultipliedAlpha,W=void 0!==t.preserveDrawingBuffer&&t.preserveDrawingBuffer,Y=void 0!==t.powerPreference?t.powerPreference:"default",Q=void 0!==t.failIfMajorPerformanceCaveat&&t.failIfMajorPerformanceCaveat,Z=void 0!==t.useWebGL2&&t.useWebGL2,b=null,g=null,T=(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=di,this.physicallyCorrectLights=!1,this.toneMapping=1,this.toneMappingExposure=1,this.toneMappingWhitePoint=1,this.maxMorphTargets=8,this.maxMorphNormals=4,this),q=!1,K=null,J=0,$=0,a=null,d=null,A=-1,M={geometry:null,program:null,wireframe:!1},O=null,tt=null,L=new Ot,c=new Ot,nt=null,r=i.width,R=i.height,N=1,et=null,it=null,h=new Ot(0,0,r,R),P=new Ot(0,0,r,R),rt=!1,ot=new zt,F=new su,st=!1,at=!1,j=new At,I=new Tt;function ut(){return null===a?N:1}try{var ct={alpha:e,depth:H,stencil:X,antialias:V,premultipliedAlpha:z,preserveDrawingBuffer:W,powerPreference:Y,failIfMajorPerformanceCaveat:Q,xrCompatible:!1};if(i.addEventListener("webglcontextlost",lt,!1),i.addEventListener("webglcontextrestored",dt,!1),null===(_=Z?i.getContext("webgl2",ct):n||i.getContext("webgl",ct)||i.getContext("experimental-webgl",ct)))throw null!==i.getContext("webgl")?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.");void 0===_.getShaderPrecisionFormat&&(_.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(t){throw console.error("THREE.WebGLRenderer: "+t.message),t}function ht(){w=new au(_),!1===(x=new ou(_,w,t)).isWebGL2&&(w.get("WEBGL_depth_texture"),w.get("OES_texture_float"),w.get("OES_texture_half_float"),w.get("OES_texture_half_float_linear"),w.get("OES_standard_derivatives"),w.get("OES_element_index_uint"),w.get("ANGLE_instanced_arrays")),w.get("OES_texture_float_linear"),l=new $c(_,w,x),(E=new Zc(_,w,x)).scissor(c.copy(P).multiplyScalar(N).floor()),E.viewport(L.copy(h).multiplyScalar(N).floor()),v=new hu(_),m=new Rc,y=new Jc(_,w,E,m,x,l,v),S=new js(_,x),k=new uu(_,S,v),p=new du(_,k,S,v),U=new lu(_),f=new Lc(T,w,x),o=new jc,u=new Bc,s=new iu(T,E,p,z),B=new ru(_,w,v,x),G=new cu(_,w,v,x),v.programs=f.programs,T.capabilities=x,T.extensions=w,T.properties=m,T.renderLists=o,T.state=E,T.info=v}ht();var C=new eh(T,_),ft=(this.xr=C,new Wc(T,p,x.maxTextureSize));function lt(t){t.preventDefault(),q=!0}function dt(){q=!1,ht()}function vt(t){var t=t.target;t.removeEventListener("dispose",vt),pt(t=t),m.remove(t)}function pt(t){var n=m.get(t).program;(t.program=void 0)!==n&&f.releaseProgram(n)}this.shadowMap=ft,this.getContext=function(){return _},this.getContextAttributes=function(){return _.getContextAttributes()},this.forceContextLoss=function(){var t=w.get("WEBGL_lose_context");t&&t.loseContext()},this.forceContextRestore=function(){var t=w.get("WEBGL_lose_context");t&&t.restoreContext()},this.getPixelRatio=function(){return N},this.setPixelRatio=function(t){void 0!==t&&(N=t,this.setSize(r,R,!1))},this.getSize=function(t){return void 0===t&&(console.warn("WebGLRenderer: .getsize() now requires a Vector2 as an argument"),t=new Mt),t.set(r,R)},this.setSize=function(t,n,e){C.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(r=t,R=n,i.width=Math.floor(t*N),i.height=Math.floor(n*N),!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 Mt),t.set(r*N,R*N).floor()},this.setDrawingBufferSize=function(t,n,e){r=t,R=n,N=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 Ot),t.copy(L)},this.getViewport=function(t){return t.copy(h)},this.setViewport=function(t,n,e,i){t.isVector4?h.set(t.x,t.y,t.z,t.w):h.set(t,n,e,i),E.viewport(L.copy(h).multiplyScalar(N).floor())},this.getScissor=function(t){return t.copy(P)},this.setScissor=function(t,n,e,i){t.isVector4?P.set(t.x,t.y,t.z,t.w):P.set(t,n,e,i),E.scissor(c.copy(P).multiplyScalar(N).floor())},this.getScissorTest=function(){return rt},this.setScissorTest=function(t){E.setScissorTest(rt=t)},this.setOpaqueSort=function(t){et=t},this.setTransparentSort=function(t){it=t},this.getClearColor=function(){return s.getClearColor()},this.setClearColor=function(){s.setClearColor.apply(s,arguments)},this.getClearAlpha=function(){return s.getClearAlpha()},this.setClearAlpha=function(){s.setClearAlpha.apply(s,arguments)},this.clear=function(t,n,e){var i=0;void 0!==t&&!t||(i|=_.COLOR_BUFFER_BIT),void 0!==n&&!n||(i|=_.DEPTH_BUFFER_BIT),void 0!==e&&!e||(i|=_.STENCIL_BUFFER_BIT),_.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",lt,!1),i.removeEventListener("webglcontextrestored",dt,!1),o.dispose(),u.dispose(),m.dispose(),p.dispose(),C.dispose(),bt.stop(),this.forceContextLoss()},this.renderBufferImmediate=function(t,n){E.initAttributes();var e=m.get(t),n=(t.hasPositions&&!e.position&&(e.position=_.createBuffer()),t.hasNormals&&!e.normal&&(e.normal=_.createBuffer()),t.hasUvs&&!e.uv&&(e.uv=_.createBuffer()),t.hasColors&&!e.color&&(e.color=_.createBuffer()),n.getAttributes());t.hasPositions&&(_.bindBuffer(_.ARRAY_BUFFER,e.position),_.bufferData(_.ARRAY_BUFFER,t.positionArray,_.DYNAMIC_DRAW),E.enableAttribute(n.position),_.vertexAttribPointer(n.position,3,_.FLOAT,!1,0,0)),t.hasNormals&&(_.bindBuffer(_.ARRAY_BUFFER,e.normal),_.bufferData(_.ARRAY_BUFFER,t.normalArray,_.DYNAMIC_DRAW),E.enableAttribute(n.normal),_.vertexAttribPointer(n.normal,3,_.FLOAT,!1,0,0)),t.hasUvs&&(_.bindBuffer(_.ARRAY_BUFFER,e.uv),_.bufferData(_.ARRAY_BUFFER,t.uvArray,_.DYNAMIC_DRAW),E.enableAttribute(n.uv),_.vertexAttribPointer(n.uv,2,_.FLOAT,!1,0,0)),t.hasColors&&(_.bindBuffer(_.ARRAY_BUFFER,e.color),_.bufferData(_.ARRAY_BUFFER,t.colorArray,_.DYNAMIC_DRAW),E.enableAttribute(n.color),_.vertexAttribPointer(n.color,3,_.FLOAT,!1,0,0)),E.disableUnusedAttributes(),_.drawArrays(_.TRIANGLES,0,t.count),t.count=0};var mt=new Ps;this.renderBufferDirect=function(t,n,e,i,r,o){null===n&&(n=mt);var s=r.isMesh&&r.matrixWorld.determinant()<0,t=xt(t,n,i,r),n=(E.setMaterial(i,s,r),!1),s=(M.geometry===e.id&&M.program===t.id&&M.wireframe===(!0===i.wireframe)||(M.geometry=e.id,M.program=t.id,M.wireframe=!0===i.wireframe,n=!0),(i.morphTargets||i.morphNormals)&&(U.update(r,e,i,t),n=!0),e.index),a=e.attributes.position;if(null===s){if(void 0===a||0===a.count)return}else if(0===s.count)return;var u=1,c=(!0===i.wireframe&&(s=k.getWireframeAttribute(e),u=2),B),n=(null!==s&&(h=S.get(s),(c=G).setIndex(h)),n&&(function(t,n,e,i){if(!1===x.isWebGL2&&(t.isInstancedMesh||n.isInstancedBufferGeometry)&&null===w.get("ANGLE_instanced_arrays"))return;E.initAttributes();var r,o=n.attributes,s=i.getAttributes(),a=e.defaultAttributeValues;for(r in s){var u=s[r];if(0<=u){var c=o[r];if(void 0!==c){var h,f,l,d,v,p,m,y=c.normalized,b=c.itemSize;void 0!==(h=S.get(c))&&(f=h.buffer,l=h.type,d=h.bytesPerElement,c.isInterleavedBufferAttribute?(v=c.data,p=v.stride,m=c.offset,v&&v.isInstancedInterleavedBuffer?(E.enableAttributeAndDivisor(u,v.meshPerAttribute),void 0===n.maxInstancedCount&&(n.maxInstancedCount=v.meshPerAttribute*v.count)):E.enableAttribute(u),_.bindBuffer(_.ARRAY_BUFFER,f),_.vertexAttribPointer(u,b,l,y,p*d,m*d)):(c.isInstancedBufferAttribute?(E.enableAttributeAndDivisor(u,c.meshPerAttribute),void 0===n.maxInstancedCount&&(n.maxInstancedCount=c.meshPerAttribute*c.count)):E.enableAttribute(u),_.bindBuffer(_.ARRAY_BUFFER,f),_.vertexAttribPointer(u,b,l,y,0,0)))}else if("instanceMatrix"===r)void 0!==(h=S.get(t.instanceMatrix))&&(f=h.buffer,l=h.type,E.enableAttributeAndDivisor(u+0,1),E.enableAttributeAndDivisor(u+1,1),E.enableAttributeAndDivisor(u+2,1),E.enableAttributeAndDivisor(u+3,1),_.bindBuffer(_.ARRAY_BUFFER,f),_.vertexAttribPointer(u+0,4,l,!1,64,0),_.vertexAttribPointer(u+1,4,l,!1,64,16),_.vertexAttribPointer(u+2,4,l,!1,64,32),_.vertexAttribPointer(u+3,4,l,!1,64,48));else if(void 0!==a){var g=a[r];if(void 0!==g)switch(g.length){case 2:_.vertexAttrib2fv(u,g);break;case 3:_.vertexAttrib3fv(u,g);break;case 4:_.vertexAttrib4fv(u,g);break;default:_.vertexAttrib1fv(u,g)}}}}E.disableUnusedAttributes()}(r,e,i,t),null!==s)&&_.bindBuffer(_.ELEMENT_ARRAY_BUFFER,h.buffer),(null!==s?s:a).count),t=e.drawRange.start*u,h=e.drawRange.count*u,s=null!==o?o.start*u:0,a=null!==o?o.count*u:1/0,o=Math.max(t,s),u=Math.min(n,t+h,s+a)-1,n=Math.max(0,u-o+1);0!==n&&(r.isMesh?!0===i.wireframe?(E.setLineWidth(i.wireframeLinewidth*ut()),c.setMode(_.LINES)):c.setMode(_.TRIANGLES):r.isLine?(t=i.linewidth,E.setLineWidth((t=void 0===t?1:t)*ut()),r.isLineSegments?c.setMode(_.LINES):r.isLineLoop?c.setMode(_.LINE_LOOP):c.setMode(_.LINE_STRIP)):r.isPoints?c.setMode(_.POINTS):r.isSprite&&c.setMode(_.TRIANGLES),r.isInstancedMesh?c.renderInstances(e,o,n,r.count):e.isInstancedBufferGeometry?c.renderInstances(e,o,n,e.maxInstancedCount):c.render(o,n))},this.compile=function(e,t){(g=u.get(e,t)).init(),e.traverse(function(t){t.isLight&&(g.pushLight(t),t.castShadow)&&g.pushShadow(t)}),g.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&&(wt(t.material[n],e,t),i[t.material[n].uuid]=!0);else t.material.uuid in i==!1&&(wt(t.material,e,t),i[t.material.uuid]=!0)})};var yt=null;var bt=new Fs;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,c=void 0===i?s.material:i,h=s.group;if(e.isArrayCamera)for(var f=(tt=e).cameras,l=0,d=f.length;l<d;l++){var v=f[l];a.layers.test(v.layers)&&(E.viewport(L.copy(v.viewport)),g.setupLights(v),_t(a,n,v,u,c,h))}else tt=null,_t(a,n,e,u,c,h)}}function _t(t,n,e,i,r,o){var s,a;r&&r.opacity<xi||(t.onBeforeRender(T,n,e,i,r,o),g=u.get(n,tt||e),t.userData.resetLight&&g.setupLights(e),t.modelViewMatrix.multiplyMatrices(e.matrixWorldInverse,t.matrixWorld),t.normalMatrix.getNormalMatrix(t.modelViewMatrix),t.isImmediateRenderObject?(s=xt(e,n,r,t),E.setMaterial(r),M.geometry=null,M.program=null,M.wireframe=!1,a=s,t.render(function(t){T.renderBufferImmediate(t,a)})):T.renderBufferDirect(e,n,i,r,t,o),t.onAfterRender(T,n,e,i,r,o),g=u.get(n,tt||e))}function wt(t,n,e){var i=m.get(t),r=g.state.lights,o=g.state.shadowsArray,s=r.state.version,o=f.getParameters(t,r.state,o,n,F.numPlanes,F.numIntersection,e),e=f.getProgramCacheKey(o),a=i.program,u=!0;if(void 0===a)t.addEventListener("dispose",vt);else if(a.cacheKey!==e)pt(t);else{if(i.lightsStateVersion!==s)i.lightsStateVersion=s;else if(void 0!==o.shaderID)return;u=!1}u&&(a=f.acquireProgram(o,e),i.program=a,i.uniforms=o.uniforms,i.environment=t.isMeshStandardMaterial?n.environment:null,i.outputEncoding=T.outputEncoding,t.program=a);var c=a.getAttributes();if(t.morphTargets)for(var h=t.numSupportedMorphTargets=0;h<T.maxMorphTargets;h++)0<=c["morphTarget"+h]&&t.numSupportedMorphTargets++;if(t.morphNormals)for(h=t.numSupportedMorphNormals=0;h<T.maxMorphNormals;h++)0<=c["morphNormal"+h]&&t.numSupportedMorphNormals++;u=i.uniforms,(t.isShaderMaterial||t.isRawShaderMaterial)&&!0!==t.clipping||(i.numClippingPlanes=F.numPlanes,i.numIntersection=F.numIntersection,u.clippingPlanes=F.uniform),i.fog=n.fog,i.needsLights=(e=t).isMeshLambertMaterial||e.isMeshToonMaterial||e.isMeshPhongMaterial||e.isMeshStandardMaterial||e.isShadowMaterial||e.isShaderMaterial&&!0===e.lights,i.lightsStateVersion=s,i.needsLights&&(u.ambientLightColor.value=r.state.ambient,u.lightProbe.value=r.state.probe,u.directionalLights.value=r.state.directional,u.directionalLightShadows.value=r.state.directionalShadow,u.spotLights.value=r.state.spot,u.spotLightShadows.value=r.state.spotShadow,u.rectAreaLights.value=r.state.rectArea,u.pointLights.value=r.state.point,u.pointLightShadows.value=r.state.pointShadow,u.hemisphereLights.value=r.state.hemi,u.directionalShadowMap.value=r.state.directionalShadowMap,u.directionalShadowMatrix.value=r.state.directionalShadowMatrix,u.spotShadowMap.value=r.state.spotShadowMap,u.spotShadowMatrix.value=r.state.spotShadowMatrix,u.pointShadowMap.value=r.state.pointShadowMap,u.pointShadowMatrix.value=r.state.pointShadowMatrix),o=i.program.getUniforms(),a=hc.seqWithValue(o.seq,u);i.uniformsList=a}function xt(t,n,e,i){y.resetTextureUnits();var r,o,s,a,u=n.fog,c=e.isMeshStandardMaterial?n.environment:null,h=m.get(e),f=g.state.lights,l=(st&&(at||t!==O)&&(l=t===O&&e.id===A,F.setState(e.clippingPlanes,e.clipIntersection,e.clipShadows,t,h,l)),e.version===h.xo?(void 0===h.program||e.fog&&h.fog!==u||h.environment!==c||h.needsLights&&h.lightsStateVersion!==f.state.version||void 0!==h.numClippingPlanes&&(h.numClippingPlanes!==F.numPlanes||h.numIntersection!==F.numIntersection)||h.outputEncoding!==T.outputEncoding)&&wt(e,n,i):(wt(e,n,i),h.xo=e.version),!1),f=!1,n=!1,d=h.program,v=d.getUniforms(),p=h.uniforms;return E.useProgram(d.program)&&(n=f=l=!0),e.id!==A&&(A=e.id,f=!0),(l||O!==t)&&(v.setValue(_,"projectionMatrix",t.projectionMatrix),x.logarithmicDepthBuffer&&v.setValue(_,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2)),O!==t&&(O=t,n=f=!0),(e.isShaderMaterial||e.isMeshPhongMaterial||e.isMeshToonMaterial||e.isMeshStandardMaterial||e.envMap)&&void 0!==(l=v.map.cameraPosition)&&l.setValue(_,I.setFromMatrixPosition(t.matrixWorld)),(e.isMeshPhongMaterial||e.isMeshToonMaterial||e.isMeshLambertMaterial||e.isMeshBasicMaterial||e.isMeshStandardMaterial||e.isShaderMaterial)&&v.setValue(_,"isOrthographic",!0===t.isOrthographicCamera),e.isMeshPhongMaterial||e.isMeshToonMaterial||e.isMeshLambertMaterial||e.isMeshBasicMaterial||e.isMeshStandardMaterial||e.isShaderMaterial||e.skinning)&&v.setValue(_,"viewMatrix",t.matrixWorldInverse),e.skinning&&(v.setOptional(_,i,"bindMatrix"),v.setOptional(_,i,"bindMatrixInverse"),l=i.skeleton)&&(t=l.bones,x.floatVertexTextures?(void 0===l.boneTexture&&(t=Math.sqrt(4*t.length),t=St.ceilPowerOfTwo(t),t=Math.max(t,4),(a=new Float32Array(t*t*4)).set(l.boneMatrices),s=new Ns(a,t,t,le,re),l.boneMatrices=a,l.boneTexture=s,l.boneTextureSize=t),v.setValue(_,"boneTexture",l.boneTexture,y),v.setValue(_,"boneTextureSize",l.boneTextureSize)):v.setOptional(_,l,"boneMatrices")),!f&&h.receiveShadow===i.receiveShadow||(h.receiveShadow=i.receiveShadow,v.setValue(_,"receiveShadow",i.receiveShadow)),f&&(v.setValue(_,"toneMappingExposure",T.toneMappingExposure),v.setValue(_,"toneMappingWhitePoint",T.toneMappingWhitePoint),h.needsLights&&(a=n,(s=p).ambientLightColor.needsUpdate=a,s.lightProbe.needsUpdate=a,s.directionalLights.needsUpdate=a,s.directionalLightShadows.needsUpdate=a,s.pointLights.needsUpdate=a,s.pointLightShadows.needsUpdate=a,s.spotLights.needsUpdate=a,s.spotLightShadows.needsUpdate=a,s.rectAreaLights.needsUpdate=a,s.hemisphereLights.needsUpdate=a),u&&e.fog&&(t=u,(l=p).fogColor.value.copy(t.color),t.isFog?(l.fogNear.value=t.near,l.fogFar.value=t.far):t.isFogExp2&&(l.fogDensity.value=t.density)),e.isMeshBasicMaterial?D(p,e):e.isMeshLambertMaterial?(D(p,e),f=p,(n=e).emissiveMap&&(f.emissiveMap.value=n.emissiveMap)):e.isMeshToonMaterial?(D(p,e),u=e,(t=p).specular.value.copy(u.specular),t.shininess.value=Math.max(u.shininess,1e-4),u.gradientMap&&(t.gradientMap.value=u.gradientMap),u.emissiveMap&&(t.emissiveMap.value=u.emissiveMap),u.bumpMap&&(t.bumpMap.value=u.bumpMap,t.bumpScale.value=u.bumpScale,u.side===an)&&(t.bumpScale.value*=-1),u.normalMap&&(t.normalMap.value=u.normalMap,t.normalScale.value.copy(u.normalScale),u.side===an)&&t.normalScale.value.negate(),u.displacementMap&&(t.displacementMap.value=u.displacementMap,t.displacementScale.value=u.displacementScale,t.displacementBias.value=u.displacementBias)):e.isMeshPhongMaterial?(D(p,e),f=e,(n=p).specular.value.copy(f.specular),n.shininess.value=Math.max(f.shininess,1e-4),f.emissiveMap&&(n.emissiveMap.value=f.emissiveMap),f.bumpMap&&(n.bumpMap.value=f.bumpMap,n.bumpScale.value=f.bumpScale,f.side===an)&&(n.bumpScale.value*=-1),f.normalMap&&(n.normalMap.value=f.normalMap,n.normalScale.value.copy(f.normalScale),f.side===an)&&n.normalScale.value.negate(),f.displacementMap&&(n.displacementMap.value=f.displacementMap,n.displacementScale.value=f.displacementScale,n.displacementBias.value=f.displacementBias)):e.isMeshStandardMaterial?(D(p,e,c),e.isMeshPhysicalMaterial?(Et(t=p,u=e,c),t.reflectivity.value=u.reflectivity,t.clearcoat.value=u.clearcoat,t.clearcoatRoughness.value=u.clearcoatRoughness,u.sheen&&t.sheen.value.copy(u.sheen),u.clearcoatMap&&(t.clearcoatMap.value=u.clearcoatMap),u.clearcoatRoughnessMap&&(t.clearcoatRoughnessMap.value=u.clearcoatRoughnessMap),u.clearcoatNormalMap&&(t.clearcoatNormalScale.value.copy(u.clearcoatNormalScale),t.clearcoatNormalMap.value=u.clearcoatNormalMap,u.side===an)&&t.clearcoatNormalScale.value.negate(),t.transparency.value=u.transparency):Et(p,e,c)):e.isMeshMatcapMaterial?(D(p,e),n=p,(f=e).matcap&&(n.matcap.value=f.matcap),f.bumpMap&&(n.bumpMap.value=f.bumpMap,n.bumpScale.value=f.bumpScale,f.side===an)&&(n.bumpScale.value*=-1),f.normalMap&&(n.normalMap.value=f.normalMap,n.normalScale.value.copy(f.normalScale),f.side===an)&&n.normalScale.value.negate(),f.displacementMap&&(n.displacementMap.value=f.displacementMap,n.displacementScale.value=f.displacementScale,n.displacementBias.value=f.displacementBias)):e.isMeshDepthMaterial?(D(p,e),t=p,(u=e).displacementMap&&(t.displacementMap.value=u.displacementMap,t.displacementScale.value=u.displacementScale,t.displacementBias.value=u.displacementBias)):e.isMeshDistanceMaterial?(D(p,e),c=p,(n=e).displacementMap&&(c.displacementMap.value=n.displacementMap,c.displacementScale.value=n.displacementScale,c.displacementBias.value=n.displacementBias),c.referencePosition.value.copy(n.referencePosition),c.nearDistance.value=n.nearDistance,c.farDistance.value=n.farDistance):e.isMeshNormalMaterial?(D(p,e),f=p,(t=e).bumpMap&&(f.bumpMap.value=t.bumpMap,f.bumpScale.value=t.bumpScale,t.side===an)&&(f.bumpScale.value*=-1),t.normalMap&&(f.normalMap.value=t.normalMap,f.normalScale.value.copy(t.normalScale),t.side===an)&&f.normalScale.value.negate(),t.displacementMap&&(f.displacementMap.value=t.displacementMap,f.displacementScale.value=t.displacementScale,f.displacementBias.value=t.displacementBias)):e.isLineBasicMaterial?(u=e,(c=p).diffuse.value.copy(u.color),c.opacity.value=u.opacity,e.isLineDashedMaterial&&(n=e,(f=p).dashSize.value=n.dashSize,f.totalSize.value=n.dashSize+n.gapSize,f.scale.value=n.scale)):e.isPointsMaterial?(t=e,(c=p).diffuse.value.copy(t.color),c.opacity.value=t.opacity,c.size.value=t.size*N,c.scale.value=.5*R,t.map&&(c.map.value=t.map),t.alphaMap&&(c.alphaMap.value=t.alphaMap),t.map?r=t.map:t.alphaMap&&(r=t.alphaMap),void 0!==r&&(!0===r.matrixAutoUpdate&&r.updateMatrix(),c.uvTransform.value.copy(r.matrix))):e.isSpriteMaterial?(u=e,(f=p).diffuse.value.copy(u.color),f.opacity.value=u.opacity,f.rotation.value=u.rotation,u.map&&(f.map.value=u.map),u.alphaMap&&(f.alphaMap.value=u.alphaMap),u.map?o=u.map:u.alphaMap&&(o=u.alphaMap),void 0!==o&&(!0===o.matrixAutoUpdate&&o.updateMatrix(),f.uvTransform.value.copy(o.matrix))):e.isShadowMaterial&&(p.color.value.copy(e.color),p.opacity.value=e.opacity),void 0!==p.ltc_1&&(p.ltc_1.value=Lt.LTC_1),void 0!==p.ltc_2&&(p.ltc_2.value=Lt.LTC_2),hc.upload(_,h.uniformsList,p,y),e.isShaderMaterial)&&(e.uniformsNeedUpdate=!1),e.isShaderMaterial&&!0===e.uniformsNeedUpdate&&(hc.upload(_,h.uniformsList,p,y),e.uniformsNeedUpdate=!1),e.isSpriteMaterial&&v.setValue(_,"center",i.center),v.setValue(_,"modelViewMatrix",i.modelViewMatrix),v.setValue(_,"normalMatrix",i.normalMatrix),v.setValue(_,"modelMatrix",i.matrixWorld),d}function D(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=m.get(e).do),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 Et(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===an)&&(t.bumpScale.value*=-1),n.normalMap&&(t.normalMap.value=n.normalMap,t.normalScale.value.copy(n.normalScale),n.side===an)&&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)}bt.setAnimationLoop(function(t){C.isPresenting||yt&&yt(t)}),"undefined"!=typeof window&&bt.setContext(window),this.setAnimationLoop=function(t){yt=t,C.setAnimationLoop(t),bt.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?q||(M.geometry=null,M.program=null,M.wireframe=!1,A=-1,!(O=null)===t.autoUpdate&&t.updateMatrixWorld(),null===n.parent&&n.updateMatrixWorld(),C.enabled&&C.isPresenting&&(n=C.getCamera(n)),(g=u.get(t,n)).init(),t.onBeforeRender(T,t,n,i||a),j.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),ot.setFromProjectionMatrix(j),at=this.localClippingEnabled,st=F.init(this.clippingPlanes,at,n),(b=o.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)g.pushLight(n),n.castShadow&&g.pushShadow(n);else if(n.isSprite)n.frustumCulled&&!ot.intersectsSprite(n)||(r&&I.setFromMatrixPosition(n.matrixWorld).applyMatrix4(j),s=p.update(n),(a=n.material).visible&&b.push(n,s,a,i,I.z,null));else if(n.isImmediateRenderObject)r&&I.setFromMatrixPosition(n.matrixWorld).applyMatrix4(j),b.push(n,null,n.material,i,I.z,null);else if((n.isMesh||n.isLine||n.isPoints)&&(n.isSkinnedMesh&&n.skeleton.frame!==v.render.frame&&(n.skeleton.update(),n.skeleton.frame=v.render.frame),!n.frustumCulled||ot.intersectsObject(n))){r&&I.setFromMatrixPosition(n.matrixWorld).applyMatrix4(j);var s=p.update(n),a=n.material;if(Array.isArray(a))for(var u=s.groups,c=0,h=u.length;c<h;c++){var f=u[c],l=a[f.materialIndex];l&&l.visible&&b.push(n,s,l,i,I.z,f)}else a.visible&&b.push(n,s,a,i,I.z,null)}var d=n.children;for(c=0,h=d.length;c<h;c++)t(d[c],e,i,r)}(t,n,0,T.sortObjects),b.finish(),!0===T.sortObjects&&b.sort(et,it),st&&F.beginShadows(),e=g.state.shadowsArray,ft.render(e,t,n),g.setupLights(n),st&&F.endShadows(),this.info.autoReset&&this.info.reset(),void 0!==i&&this.setRenderTarget(i),s.render(b,t,n,r),e=b.opaque,i=b.transparent,t.overrideMaterial?(r=t.overrideMaterial,e.length&&gt(e,t,n,r),i.length&&gt(i,t,n,r)):(e.length&&gt(e,t,n),i.length&&gt(i,t,n)),t.onAfterRender(T,t,n),null!==a&&(y.updateRenderTargetMipmap(a),y.updateMultisampleRenderTarget(a)),E.buffers.depth.setTest(!0),E.buffers.depth.setMask(!0),E.buffers.color.setMask(!0),E.setPolygonOffset(!1),g=b=null):console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")},this.setFramebuffer=function(t){K!==t&&null===a&&_.bindFramebuffer(_.FRAMEBUFFER,t),K=t},this.getActiveCubeFace=function(){return J},this.getActiveMipmapLevel=function(){return $},this.getRenderTarget=function(){return a},this.setRenderTarget=function(t,n,e){J=n,$=e,(a=t)&&void 0===m.get(t).mo&&y.setupRenderTarget(t);var i,r=K,o=!1;nt=t?(i=m.get(t).mo,t.isWebGLCubeRenderTarget?(r=i[n||0],o=!0):r=t.isWebGLMultisampleRenderTarget?m.get(t).bo:i,L.copy(t.viewport),c.copy(t.scissor),t.scissorTest):(L.copy(h).multiplyScalar(N).floor(),c.copy(P).multiplyScalar(N).floor(),rt),d!==r&&(_.bindFramebuffer(_.FRAMEBUFFER,r),d=r),E.viewport(L),E.scissor(c),E.setScissorTest(nt),o&&(i=m.get(t.texture),_.framebufferTexture2D(_.FRAMEBUFFER,_.COLOR_ATTACHMENT0,_.TEXTURE_CUBE_MAP_POSITIVE_X+(n||0),i.po,e||0))},this.readRenderTargetPixels=function(t,n,e,i,r,o,s){if(t&&t.isWebGLRenderTarget){var a=m.get(t).mo;if(a=t.isWebGLCubeRenderTarget&&void 0!==s?a[s]:a){s=!1;a!==d&&(_.bindFramebuffer(_.FRAMEBUFFER,a),s=!0);try{var u=t.texture,c=u.format,h=u.type;c!==le&&l.convert(c)!==_.getParameter(_.IMPLEMENTATION_COLOR_READ_FORMAT)?console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format."):h===Jn||l.convert(h)===_.getParameter(_.IMPLEMENTATION_COLOR_READ_TYPE)||h===re&&(x.isWebGL2||w.get("OES_texture_float")||w.get("WEBGL_color_buffer_float"))||h===oe&&(x.isWebGL2?w.get("EXT_color_buffer_float"):w.get("EXT_color_buffer_half_float"))?_.checkFramebufferStatus(_.FRAMEBUFFER)===_.FRAMEBUFFER_COMPLETE?0<=n&&n<=t.width-i&&0<=e&&e<=t.height-r&&_.readPixels(n,e,i,r,l.convert(c),l.convert(h),o):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete."):console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.")}finally{s&&_.bindFramebuffer(_.FRAMEBUFFER,d)}}}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),i=Math.floor(n.image.height*i),o=l.convert(n.format);y.setTexture2D(n,0),_.copyTexImage2D(_.TEXTURE_2D,e,o,t.x,t.y,r,i,0),E.unbindTexture()},this.copyTextureToTexture=function(t,n,e,i){var r=n.image.width,o=n.image.height,s=l.convert(e.format),a=l.convert(e.type);y.setTexture2D(e,0),n.isDataTexture?_.texSubImage2D(_.TEXTURE_2D,i||0,t.x,t.y,r,o,s,a,n.image.data):_.texSubImage2D(_.TEXTURE_2D,i||0,t.x,t.y,s,a,n.image),E.unbindTexture()},this.initTexture=function(t){y.setTexture2D(t,0),E.unbindTexture()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}th.prototype=Object.assign(Object.create(vt.prototype),{constructor:th,isArrayCamera:!0}),nh.prototype=Object.assign(Object.create(a.prototype),{constructor:nh,isGroup:!0}),Object.assign(eh.prototype,V.prototype);var e={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                    "},rh=e;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(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,function(t){t=function(t,n){if("object"!=oh(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=oh(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==oh(t)?t:t+""}(i.key),i)}}function ah(t,n,e){n=ch(n);var i=t,n=uh()?Reflect.construct(n,e||[],ch(t).constructor):n.apply(t,e);if(n&&("object"===oh(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function uh(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(uh=function(){return!!t})()}function ch(t){return(ch=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function hh(t,n){return(hh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var fh=function(){function n(t){if(this instanceof n)return(t=ah(this,n,[t])).uniforms.offset={value:new Mt},t.uniforms.rotation={value:0},t.uniforms.scale={value:new Mt(1,1)},t.depthTest=!1,t.vertexShader=rh.vert,t.fragmentShader=rh.frag,t;throw new TypeError("Cannot call a class as a function")}var t,e,i=n,r=Ea;if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");return i.prototype=Object.create(r&&r.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),r&&hh(i,r),i=n,t&&sh(i.prototype,t),e&&sh(i,e),Object.defineProperty(i,"prototype",{writable:!1}),i}();function lh(t,n){this.array=t,this.stride=n,this.count=void 0!==t?t.length/n:0,this.usage=wi,this.updateRange={offset:0,count:-1},this.version=0}Object.defineProperty(lh.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(lh.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 dh=new Tt;function vh(t,n,e,i){this.data=t,this.itemSize=n,this.offset=e,this.normalized=!0===i}function ph(t){return(ph="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 mh(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,function(t){t=function(t,n){if("object"!=ph(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=ph(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==ph(t)?t:t+""}(i.key),i)}}function yh(t,n,e){n=gh(n);var i=t,n=bh()?Reflect.construct(n,e||[],gh(t).constructor):n.apply(t,e);if(n&&("object"===ph(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function bh(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(bh=function(){return!!t})()}function gh(t){return(gh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function _h(t,n){return(_h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}Object.defineProperties(vh.prototype,{count:{get:function(){return this.data.count}},array:{get:function(){return this.data.array}}}),Object.assign(vh.prototype,{isInterleavedBufferAttribute:!0,applyMatrix4:function(t){for(var n=0,e=this.data.count;n<e;n++)dh.x=this.getX(n),dh.y=this.getY(n),dh.z=this.getZ(n),dh.applyMatrix4(t),this.setXYZ(n,dh.x,dh.y,dh.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 wh=function(){function e(){var t,n;if(this instanceof e)return t=yh(this,e),n=new lh(new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),5),t.setIndex([0,1,2,0,2,3]),t.setAttribute("position",new vh(n,3,0,!1)),t.setAttribute("uv",new vh(n,2,3,!1)),t;throw new TypeError("Cannot call a class as a function")}var t,n,i=e,r=oa;if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");return i.prototype=Object.create(r&&r.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),r&&_h(i,r),i=e,t&&mh(i.prototype,t),n&&mh(i,n),Object.defineProperty(i,"prototype",{writable:!1}),i}();function xh(t,n,e,i,r,o,s,a,u){l.call(this,t,n,e,i,r,o,s,a,u),this.needsUpdate=!0}function Eh(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,c=Math.sqrt(u),c=c*(c/Math.sqrt(r*r-u)),r=Math.PI/2,u=(e-t)/(n-i),h=(t-e)/(n-i),f=Math.sqrt(1+u*u),l=Math.sqrt(1+h*h),u={x:s+c*(1/f),y:a+c*(u/f),theta:r},f={x:s+c*(-1/l),y:a+c*(h/l),theta:r};return 0<(e-t)*(u.y-n)-(i-n)*(u.x-t)?0===o?u:f:0===o?f:u}function Sh(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,c=e.y,h=parseFloat(t[r+6]),f=parseFloat(t[r+7]);o===s&&(l=Eh(u,c,h,f,o,a),n.arcTo(l.x,l.y,h,f,l.theta),e.x=h,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,c=e.y,h=u+parseFloat(t[r+6]),f=c+parseFloat(t[r+7]);o===s&&(l=Eh(u,c,h,f,o,a),n.arcTo(l.x,l.y,h,f,l.theta),e.x=h,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)}}((xh.prototype=Object.create(l.prototype)).constructor=xh).prototype.isCanvasTexture=!0;var Th=["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"],Ah=["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"],Mh=["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"],Oh=["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"],Lh=["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"],Rh=["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"],Nh=["M","82.95","15.07","H","81.57","L","82.35","0","h","10","a","1.94","1.94","0","0","1","1.85","2","L","93.89","7.4","a","2","2","0","0","1","-2","1.92","H","83.25","Z","m","8.43","-7.15","a","1.13","1.13","0","0","0","1.09","-1.09","l","0.35","-4.37","a","1.1","1.1","0","0","0","-1.08","-1.06","H","83.66","l","-0.34","6.53","Z"];function Ph(t){return(Ph="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 Fh(t){return function(t){if(Array.isArray(t))return jh(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,n){var e;if(t)return"string"==typeof t?jh(t,n):"Map"===(e="Object"===(e=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?jh(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 jh(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 Ih(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,function(t){t=function(t,n){if("object"!=Ph(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Ph(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Ph(t)?t:t+""}(i.key),i)}}function Ch(t){r=st.a.document.createElement("canvas"),o=r.getContext("2d"),r.width=500,r.height=120,r.style.width="500px",r.style.height="120px",i={x:0,y:0},e={x:0,y:0},o.transform(5,0,0,5,10,10),(s=o.createLinearGradient(5.9,15.07,5.9,0)).addColorStop(0,"#232323"),s.addColorStop(1,"#585858"),o.fillStyle=s,o.beginPath(),Sh(Th,o,e,i),o.closePath(),o.fill(),o.beginPath(),Sh(Ah,o,e,i),o.closePath(),o.fill(),o.beginPath(),Sh(Mh,o,e,i),o.closePath(),o.fill(),o.beginPath(),Sh(Oh,o,e,i),o.closePath(),o.fill(),(s=o.createLinearGradient(57.68,15.07,57.68,0)).addColorStop(0,"#77bf00"),s.addColorStop(1,"#addc0c"),o.fillStyle=s,o.beginPath(),Sh(Lh,o,e,i),o.closePath(),o.fill(),o.beginPath(),Sh(Rh,o,e,i),o.closePath(),o.fill(),o.beginPath(),Sh(Nh,o,e,i),o.closePath(),o.fill(),st.a.environment==B.a.BROWSER?n=new xh(r):(s=r.toDataURL("image/png"),o.restore(),n=new l,st.a.textureHelper.createImage({url:s,onload:function(t){n.image=t,n.needsUpdate=!0}}));var n,e=n,i=new Mt(.4,.096),r=new fh,o=-1*(.5*i.x/t-1),s=-1*(1-.5*i.y);return e.minFilter=Zn,e.generateMipmaps=!1,r.transparent=!0,r.depthTest=!1,r.uniforms={scale:{value:i},offset:{value:new Mt(o,s)},mmap:{value:e}},r.needsUpdate=!0,new $a(new wh,r)}var e=function(){function i(t,n,e){if(!(this instanceof i))throw new TypeError("Cannot call a class as a function");this.So=0,this.Ri=0,this._n=t,this.Oi=n,this.Sn=e,this.renderer=this.To(n.container,n.logarithmicDepthBuffer),this.Ct=new Map;e=this._n.getMapOptions().depthPeeling;e&&st.a.environment===B.a.BROWSER&&(this.Ao=new st.a.DepthPeelingRenderer({map:t,renderManager:this,mode:e.mode,layers:e.layers,type:e.types})),this.Mo=JSON.parse(JSON.stringify(n.renderOrder)),this.Oo=0,this.Lo=!1,this.zt=null,this.Ro=_.wt,this.Ro&&(this.zt=Ch(this.renderer.domElement.clientWidth/this.renderer.domElement.clientHeight),this.zt.frustumCulled=!1,this.xx45f6=this.zt),this.No=!1,this.Vt=!1,this.Tt=this.renderer.domElement.clientWidth,this.Po=this.renderer.domElement.clientHeight,this.type="basic",this.Bn=!0,this.ao=void 0,this.Fo=void 0,this.so=[],this.jo()}return t=i,(n=[{key:"setTileLayScene",value:function(t){this.ao=t}},{key:"getTileLayScene",value:function(){return this.ao}},{key:"setGroundLayerScene",value:function(t){this.Fo=t}},{key:"getGroundLayerScene",value:function(){return this.Fo}},{key:"set3DTilesLayerSceneArr",value:function(t){this.so.push(t)}},{key:"get3DTilesLayerSceneArr",value:function(){return this.so}},{key:"needLogo",get:function(){return this.Ro}},{key:"render",value:function(){var i=this,r=this;if(this.renderer&&(this.So+=1,15e6<this.So&&(this.So=0),st.a.environment!==B.a.WX||1!=this.Ri||this.So%2!=0)){this._n.Ht.Ni.se(),this._n.Ht.Ni.ae(this.Ct),this._n.Ht.Ni.ae([this.ao,this.Fo].concat(Fh(this.so))),this.renderer.clear(),this.ao&&this.renderer.render(this.ao,this._n.Ut),this.Fo&&this.renderer.render(this.Fo,this._n.Ut);for(var t=0;t<this.so.length;t++)this.renderer.render(this.so[t],this._n.Ut);this._n.getMapOptions().depthPeeling?this.Ao.render():this.Ct.forEach(function(t){return i.renderer.render(t,i._n.Ut)});var o={min:1/0,max:-1/0},s=(this._n.Io.Lt.forEach(function(t){var e=[];t.Co.forEach(function(t){var n;(function(t){for(var n=!1,e=Array.from(r.getRenderList()),i=0;i<e.length;i++)if(e[i][0].split("%A%B%C%D")[0]===t){n=!0;break}return n})(t.buildingID||i._n.getMapOptions().mapID)&&t.isCross&&(e.push(t),(n=Math.min(t.levelRange[0],t.levelRange[1]))<o.min&&(o.min=n),n=Math.max(t.levelRange[0],t.levelRange[1]),o.max<n)&&(o.max=n)}),e.forEach(function(t){i.renderer.render(t.line,i._n.Ut)})}),this.Mo.indexOf(E.LINE_MARKER));this.Ct.forEach(function(t,n){var n=n.split("%A%B%C%D"),e=n[1],n=n[2];+e===o.max&&(e=i.Mo.indexOf(E.LAYER_NODE_TYPE.get(+n)),s<e)&&i.renderer.render(t,i._n.Ut)}),this._n.Io&&this.renderer.render(this._n.Io.Do,this._n.Ut),this.Ro&&this.zt&&this.renderer.render(this.zt,this._n.Ut)}}},{key:"resize",value:function(){this.renderer&&(5<Math.abs(this.renderer.domElement.parentElement.clientHeight-this.Po)||5<Math.abs(this.renderer.domElement.parentElement.clientWidth-this.Tt))&&(this.ko(this.renderer.domElement.parentElement.clientWidth,this.renderer.domElement.parentElement.clientHeight),this.Tt=this.renderer.domElement.clientWidth,this.Po=this.renderer.domElement.clientHeight,this._n.kt.Dt({type:"resize"}))}},{key:"getRenderList",value:function(){return this.Ct}},{key:"parent",get:function(){return this._n}},{key:"getWebGLRenderer",value:function(){return ih}}])&&Ih(t.prototype,n),e&&Ih(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,e}(),Dh=(Object.assign(e.prototype,{Uo:function(){for(var t in this._n=null,this.Oi=null,this.Sn=null,this)this[""+t]=null,delete this[""+t]},Yn:function(){this.Bn=!1,this.Ct.clear(),st.a.window.cancelAnimationFrame(this.Bo)},To:function(t,n){n=new ih({useWebGL2:this._n.getMapOptions().depthPeeling,antialias:!0,alpha:!0,logarithmicDepthBuffer:n,canvas:st.a.environment==B.a.BROWSER?void 0:t});return n.setPixelRatio(st.a.window.devicePixelRatio),st.a.environment===B.a.BROWSER&&n.setSize(t.clientWidth,t.clientHeight),n.autoClear=!1,n.domElement.style.position="absolute",n.domElement.style.top=0,n.domElement.style.zIndex=0,st.a.environment==B.a.BROWSER&&t.appendChild(n.domElement),n},Go:function(t){this.renderer=t},Ho:function(t){t="3D"===t?this._n.Mn:this._n.Bt;return t.updateMatrixWorld(!0),(new zt).setFromProjectionMatrix((new At).multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse))},Xo:function(t){for(var n=[],e=[],i=0;i<t.length;i++){var r=this.Mo.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.Mo[n[o]]=e[o];this.On()},Vo:function(t){this.Mo=t,this.On()},zo:function(t,n){var e=1,i=this.renderer.domElement.clientHeight,n=this._n.Ut.isPerspectiveCamera?n?n/(i/(2*Math.tan(this._n.Mn.fov*u.DEG2RAD/2))):t.mapNode.qt/(i/(2*Math.tan(this._n.Mn.fov*u.DEG2RAD/2))):n?n*Math.abs(this._n.Ut.top-this._n.Ut.bottom)/this._n.Ut.zoom/i:t.mapNode.qt*Math.abs(this._n.Ut.top-this._n.Ut.bottom)/this._n.Ut.zoom/i;t.material.userData.scaleRatio&&(e=t.material.userData.scaleRatio),t.scale.set(n,n/e,n)},Xt:function(){var r=this;this.Ct.forEach(function(t){switch(t.userData.type){case"label":for(var n=0;n<t.children.length;n++)t.children[n].mapNode.Wo(r._n.Pt);break;case"facility":for(var e=0;e<t.children.length;e++)r.zo(t.children[e]);break;default:for(var i=0;i<t.children.length;i++)!t.children[i].mapNode||t.children[i].mapNode.type!==E.IMAGE_MARKER&&t.children[i].mapNode.type!==E.LOCATION_MARKER||t.children[i].mapNode.en()}})},ko:function(t,n){var e=this._n.Mn,i=this._n.Bt,r=new Mt(.4,.096),o=-1*(.5*r.x/(t/n)-1),s=-1*(1-.5*r.y);for(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.zt&&(this.zt.material.uniforms.scale={value:r},this.zt.material.uniforms.offset={value:new Mt(o,s)}),this.renderer.setSize(t,n),this.Xt(),this._n.enableUpdateRender(),this._n.enableUpdateNode(),this._n.Pt.jt();0<this._n.Pt.Nt.length;)this._n.Pt.Ft()},Yo:function(t,n){st.a.environment===B.a.BROWSER&&(t.updateMatrixWorld(!0),t.parent.updateMatrixWorld(!0));var e,i,r=this._n.Ut,r=(new Tt).setFromMatrixPosition(t.matrixWorld).applyMatrix4(r.matrixWorldInverse).applyMatrix4(r.projectionMatrix),o=t.mapNode.qt;if(n){if("string"==typeof t.mapNode.text){if(!t.material.map.image)return;e=t.mapNode.type===E.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}else e=(o*=t.mapNode.text.length)/t.material.userData.scaleRatio;void 0!==t.material.userData.style&&(n=t.material.userData.style,i=o*t.material.userData.itHeightRatio*1.1,"limage-rtext"===n||"ltext-rimage"===n?o<i&&(e=(o=i)/t.material.userData.scaleRatio):"timage-btext"===n||"ttext-bimage"===n?e=(o+=i)/t.material.userData.scaleRatio:"overlay-text"===n&&o<i&&(e=(o=i)/t.material.userData.scaleRatio))}else e=o;return o=o/this.renderer.domElement.clientHeight*2,e=e/this.renderer.domElement.clientWidth*2,{leftTop:new Mt(r.x-e/2,r.y+o/2),rightDown:new Mt(r.x+e/2,r.y-o/2)}},Qo:function(t,n,e,i,r){for(var o=0;o<n.length;o++)if(!n[o].mapNode.$t||n[o].mapNode.Zo)n[o].visible=!1;else if(n[o].mapNode.G&&(n[o].mapNode.G.maxlevel<=i||n[o].mapNode.G.minlevel>i))n[o].visible=!1;else if(!1===r)n[o].visible=!0;else if(!1===n[o].mapNode.qo)n[o].visible=!0;else{var s=n[o].children[0]||n[o];if(s.material.map){var a=this.Yo(s,e);if(a){n[o].userData.bounds=a;for(var u=!0,c=0;c<t.length;c++){var h=t[c].userData.bounds;if(!(u=!z.xe(a.leftTop,a.rightDown,h.leftTop,h.rightDown)))break}u?(n[o].visible=!0,t.push(n[o])):n[o].visible=!1}}}},Wt:function(){var y=this;this.Vt&&(this._n.traverse(function(t){if(y._n.Pt.Ko(t))for(var n=t.visibleLevels,e=[],i=y._n.getZoom(),r=y.Sn.Jo,o=0;o<n.length;o++){var s=t.getFloor(n[o]);if(s){var a=s.getLayers(E.LABEL_LAYER),u=void 0,a=(0<a.length&&(u=a[0].scene),s.getLayers(E.FACILITY_LAYER)),c=void 0;0<a.length&&(c=a[0].scene),e.length=0,u&&y.Qo(e,u.children,!0,i,u.mapNode.qo),c&&y.Qo(e,c.children,!1,i,c.mapNode.qo);for(var h=0;h<r.length;h++)for(var f=r[h],l=e.length=0;l<f.length;l++){var d=f[l],d=s.getLayers(d),v=void 0,p=void 0,m=!1;0<d.length&&(p=(v=d[0]).scene,m=!0===v.isHasText),p&&void 0!==v.collision&&y.Qo(e,p.children,m,i,v.collision)}}}}),this.Vt=!1,this._n.enableUpdateRender())},$o:function(){!0!==this.Sn.ts&&!0!==this.Sn.ns||(this.Vt=!0)},On:function(){this.No=!0},tr:function(t){this.Ct.delete(t)},ut:function(){this.Ct.clear()},Ln:function(){var i,r=this;this.No&&(this.Ct.clear(),i=[],this._n.traverse(function(t){if(r._n.Pt.Ko(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._n.An?-1:n.parent===r._n.An?1:0}),i.forEach(function(t){var n=[];t.traverse(function(t){n.unshift(t)}),n.sort(function(t,n){var t=r.Mo.indexOf(E.LAYER_NODE_TYPE.get(t.bi)),n=r.Mo.indexOf(E.LAYER_NODE_TYPE.get(n.bi)),e=r.Mo.length-1;return(t=-1===t?e:t)-(n=-1===n?e:n)}),n.forEach(function(t,n,e){var i=t.parent,i=i.parent.yi+"%A%B%C%D"+i.level+"%A%B%C%D"+t.bi;r.Ct.set(i,t.scene)})}),this.No=!1,this.Xt(),this.$o())},Xn:function(){this.Ct&&0<this.Ct.size&&!this.Lo&&(this._n.kt.Dt({type:"firstRender"}),this.Lo=!0)},jo:function(){var t;this._n&&this.Bn&&(this.Bn&&(this.Bo=st.a.window.requestAnimationFrame(this.jo.bind(this))),this._n.kt.Dt({type:"beforeRender"}),this.resize(),t={type:"update",renderType:this.Sn.es?0:1},this.Sn.es&&(this.render(),this.Xn(),this.Sn.es=!1),this._n.kt.Dt(t))}}),e),kh=t(3);function Uh(t){return(Uh="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 Bh(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 Gh(i){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Bh(Object(r),!0).forEach(function(t){var n,e;n=i,e=r[t=t],(t=Vh(t))in n?Object.defineProperty(n,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):n[t]=e}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(r)):Bh(Object(r)).forEach(function(t){Object.defineProperty(i,t,Object.getOwnPropertyDescriptor(r,t))})}return i}function Hh(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,Vh(i.key),i)}}function Xh(t,n,e){return n&&Hh(t.prototype,n),e&&Hh(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Vh(t){t=function(t,n){if("object"!=Uh(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Uh(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Uh(t)?t:t+""}var e=Xh(function t(n){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");this.rs=Gh({data:null,method:"GET",responseType:"json"},n),this.ss=null}),zh=(Object.assign(e.prototype,{us:function(t,n,e){var i=this.rs,r=i.data,o=i.method,s=i.url,a=i.responseType,u=i.header,c=null;if((c=new(st.a.environment===B.a.WX?st.a.XMLHttpRequest:"undefined"!=typeof XMLHttpRequest?XMLHttpRequest:kh.a.global().fengmap.XMLHttpRequest)).responseType=a,c.open(o,s),"object"==Uh(u))for(var h in u)c.setRequestHeader(h,u[h]);c.addEventListener("load",function(){200===c.status||0===c.status||201===c.status?t&&t(c.response):n&&(404===c.status?n(mr.PATH_ERROR):2069===c.response.error_code?n(mr.NAME_KEY_ERROR):2063===c.response.error_code?n(mr.MAP_ID_URL_ERROR):400===c.response.error_code?n(mr.THEME_ID_URL_ERROR):n(c.response))}),c.addEventListener("timeout",function(t){e&&e(t)}),c.addEventListener("error",function(t){n&&n(t)}),c.send(JSON.stringify(r)),this.ss=c},Yn:function(){this.ss&&this.ss.abort&&(this.ss.abort(),this.ss=null)}}),e),e=t(31),Wh=t.n(e);function Yh(t){return(Yh="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 Qh(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,function(t){t=function(t,n){if("object"!=Yh(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Yh(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Yh(t)?t:t+""}(i.key),i)}}function Zh(t,n,e){return n&&Qh(t.prototype,n),e&&Qh(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}for(var qh=["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=="],Kh=qh,Jh=218;--Jh;)Kh.push(Kh.shift());function P(t,n){var e=qh[t=+t],i=(void 0===P.ngQRZk&&(i=function(){var n;try{n=Function('return (function() {}.constructor("return this")( ));')()}catch(t){n=window}return n}(),(i=st.a.environment===B.a.WX?st.a.window:i).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}),P.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)},P.TcYoxp={},P.ngQRZk=!0),P.TcYoxp[t]);return void 0===i?(e=P.bOCUYG(e),P.TcYoxp[t]=e):e=i,e}var $h=Zh(function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");var n={},e=(n[P("0x1f")+"ge"]=P("0x45")+P("0x3c")+P("0x84"),n[P("0x13")+P("0x28")]=P("0x32")+P("0x62"),{}),i=(e[P("0x43")]="required",e[P("0x71")]=P("0x70"),e.id=1,{}),r=(i.rule=P("0x3"),i[P("0x71")]=P("0x85"),i.id=2,{}),o=(r.rule=P("0x3"),r.type=P("0x75"),r.id=3,{}),s=(o[P("0x43")]=P("0x3"),o[P("0x71")]=P("0x70"),o.id=4,{}),a=(s[P("0x43")]=P("0x3"),s[P("0x71")]=P("0x70"),s.id=5,{}),u=(a[P("0x71")]=P("0x70"),a.id=6,{}),c=(u[P("0x71")]=P("0x70"),u.id=7,{}),h=(c[P("0x71")]=P("0x70"),c.id=8,{}),f=(h[P("0x72")]=!1,{}),h=(f.type="bool",f.id=9,f[P("0xa")]=h,{}),l=(h[P("0x43")]="repeated",h[P("0x71")]=P("0x53"),h.id=10,{}),d=(l.rule="repeated",l.type=P("0x70"),l.id=11,{}),e=(d[P("0x99")]=e,d.fileVer=i,d[P("0x21")]=r,d[P("0x25")]=o,d.hashCode=s,d[P("0x36")]=a,d[P("0x4e")]=u,d.desc=c,d.readOnly=f,d[P("0x5c")]=h,d[P("0x66")]=l,{}),i=(e[P("0x43")]=P("0x3"),e[P("0x71")]="int32",e.id=1,{}),r=(i[P("0x43")]=P("0x3"),i.type=P("0x85"),i.id=2,{}),o=(r[P("0x43")]="required",r[P("0x71")]="int32",r.id=3,{}),s=(o.rule="required",o[P("0x71")]=P("0x75"),o.id=4,{}),a=(s.rule=P("0x3"),s[P("0x71")]="bytes",s.id=5,{}),u=(a[P("0x23")]=e,a[P("0x2f")]=i,a[P("0x3a")]=r,a[P("0x7f")]=o,a[P("0x97")]=s,{}),c=(u[P("0xe")]=a,{}),f=(c.Buffer=u,{}),h=(f[P("0xe")]=d,f.nested=c,{}),l=(h[P("0x43")]=P("0x3"),h[P("0x71")]="string",h.id=19,{}),e=(l.rule=P("0x3"),l.type=P("0x85"),l.id=20,{}),i=(e[P("0x43")]=P("0x3"),e[P("0x71")]="uint64",e.id=21,{}),r=(i[P("0x43")]=P("0x3"),i[P("0x71")]=P("0x70"),i.id=22,{}),o=(r.rule=P("0x3"),r[P("0x71")]=P("0x70"),r.id=23,{}),s=(o.type="string",o.id=24,{}),a=(s[P("0x71")]=P("0x70"),s.id=25,{}),u=(a[P("0x72")]=!1,{}),d=(u[P("0x71")]=P("0x35"),u.id=26,u[P("0xa")]=a,{}),c=(d[P("0x71")]=P("0x3e"),d.id=1,{}),a=(c[P("0x71")]="float",c.id=2,{}),v=(a[P("0x71")]="float",a.id=3,{}),p=(v[P("0x71")]=P("0x3e"),v.id=4,{}),m=(p.type=P("0x3e"),p.id=5,{}),y=(m.type=P("0x3e"),m.id=6,{}),b=(y.type=P("0x3e"),y.id=7,{}),g=(b[P("0x71")]=P("0x70"),b.id=8,{}),_=(g.type=P("0x3e"),g.id=9,{}),w=(_[P("0x71")]=P("0x3e"),_.id=10,{}),x=(w[P("0x71")]=P("0x3e"),w.id=11,{}),E=(x.type=P("0x3e"),x.id=12,{}),S=(E[P("0x71")]=P("0x3e"),E.id=13,{}),T=(S[P("0x71")]=P("0x3e"),S.id=14,{}),A=(T.type=P("0x3e"),T.id=15,{}),M=(A[P("0x71")]=P("0x3e"),A.id=16,{}),O=(M[P("0x71")]=P("0x70"),M.id=17,{}),L=(O[P("0x71")]="int32",O.id=28,{}),R=(L.rule=P("0xa0"),L[P("0x71")]="LayerGroup",L.id=18,{}),N=(R[P("0x43")]="repeated",R[P("0x71")]=P("0x6c"),R.id=27,{}),h=(N.mid=h,N.fileVer=l,N[P("0x21")]=e,N[P("0x25")]=i,N[P("0x0")]=r,N[P("0x36")]=o,N[P("0x48")]=s,N[P("0x83")]=u,N.x=d,N.y=c,N.z=a,N[P("0x6d")]=v,N.minY=p,N[P("0x24")]=m,N.maxY=y,N[P("0xa8")]=b,N[P("0x9")]=g,N[P("0xa1")]=_,N[P("0x39")]=w,N[P("0x6f")]=x,N[P("0x4b")+"eX"]=E,N.rotateAngleY=S,N[P("0x4b")+"eZ"]=T,N[P("0x46")]=A,N[P("0x2c")]=M,N[P("0x20")]=O,N.layerGroups=L,N.buildings=R,{}),l=(h[P("0x71")]=P("0x85"),h.id=1,{}),e=(l[P("0x71")]=P("0x70"),l.id=2,{}),i=(e[P("0x71")]=P("0x70"),e.id=3,{}),r=(i[P("0x71")]=P("0x16"),i.id=4,{}),o=(r.type=P("0x3e"),r.id=5,{}),s=(o[P("0x71")]=P("0x3e"),o.id=6,{}),u=(s[P("0x71")]=P("0x3e"),s.id=7,{}),d=(u[P("0x71")]=P("0x3e"),u.id=8,{}),c=(d[P("0x71")]=P("0x3e"),d.id=9,{}),a=(c[P("0x71")]=P("0x3e"),c.id=10,{}),v=(a[P("0x71")]=P("0x3e"),a.id=11,{}),p=(v[P("0x71")]=P("0x3e"),v.id=12,{}),m=(p[P("0x71")]=P("0x35"),p.id=13,{}),y=(m[P("0x71")]=P("0x35"),m.id=14,{}),b=(y[P("0x71")]=P("0x35"),y.id=15,{}),g=(b.type=P("0x70"),b.id=16,{}),_=(g[P("0x44")]=h,g.lname=l,g[P("0x19")]=e,g[P("0x7")]=i,g[P("0x5")]=r,g[P("0x8f")]=o,g[P("0x6f")]=s,g[P("0x4b")+"eX"]=u,g.rotateAngleY=d,g[P("0x4b")+"eZ"]=c,g[P("0x26")+P("0x80")]=a,g["maxScaleLe"+P("0x80")]=v,g[P("0x5a")]=p,g[P("0x91")+"le"]=m,g.isEditable=y,g[P("0x48")]=b,{}),w=(_[P("0x6b")]=1,_[P("0x5f")+"SCALATOR"]=2,_[P("0x4f")+P("0x11")]=3,_[P("0x3b")+P("0x30")]=4,_[P("0x4a")+P("0x69")]=5,_[P("0x4a")+"OI"]=6,_[P("0x3b")+"TORELABEL"]=7,_.GEOPOINT_NAVINODE=8,_[P("0x87")+P("0x63")]=9,_[P("0x56")]=20,_[P("0x4")+P("0x95")]=21,_["GEOLINE_BO"+P("0x6a")]=22,_[P("0x37")]=30,_[P("0x37")+P("0x78")]=31,_.GEOPOLYGON_STORE=32,_[P("0x37")+P("0x4c")]=33,_.RASTERATA=40,_[P("0x8")+"A"]=50,{}),x=(w.values=_,{}),E=(x[P("0x16")]=w,{}),S=(E[P("0xe")]=g,E[P("0x1")]=x,{}),T=(S[P("0x71")]="int32",S.id=1,{}),A=(T[P("0x71")]="string",T.id=2,{}),M=(A[P("0x71")]="string",A.id=3,{}),O=(M[P("0x71")]=P("0x3e"),M.id=4,{}),L=(O[P("0x71")]=P("0x70"),O.id=5,{}),R=(L[P("0x43")]="repeated",L[P("0x71")]=P("0x42"),L.id=6,{}),h=(R[P("0x71")]=P("0x70"),R.id=7,{}),l=(h[P("0x71")]="int32",h.id=8,{}),e=(l.gid=S,l.gname=T,l[P("0x19")]=A,l[P("0x6f")]=M,l[P("0x48")]=O,l[P("0x68")]=L,l[P("0x27")]=R,l[P("0x20")]=h,{}),i=(e[P("0xe")]=l,{}),r=(i[P("0x71")]=P("0x85"),i.id=1,{}),o=(r[P("0x71")]=P("0x3e"),r.id=2,{}),s=(o[P("0x71")]=P("0x3e"),o.id=3,{}),u=(s.type=P("0x3e"),s.id=4,{}),d=(u.type=P("0x3e"),u.id=5,{}),c=(d[P("0x71")]="float",d.id=6,{}),a=(c[P("0x71")]=P("0x3e"),c.id=7,{}),v=(a[P("0x43")]=P("0xa0"),a.type=P("0x70"),a.id=8,{}),p=(v.type=P("0x85"),v.id=9,{}),m=(p.type="bool",p.id=10,{}),y=(m[P("0x71")]=P("0x85"),m.id=11,{}),b=(y[P("0x71")]="int32",y.id=12,{}),_=(b[P("0x71")]=P("0x70"),b.id=13,{}),w=(_.rule="repeated",_[P("0x71")]=P("0x96"),_.id=14,{}),g=(w[P("0x9c")]=!1,{}),x=(g[P("0x43")]=P("0xa0"),g.type=P("0x5e"),g.id=15,g[P("0xa")]=w,{}),S=(x[P("0x23")]=i,x.x=r,x.y=o,x.offsetX=s,x[P("0x8f")]=u,x.angle=d,x.scale=c,x[P("0x90")]=a,x[P("0x2e")]=v,x[P("0xb")]=p,x.minlevel=m,x[P("0x5d")]=y,x.floorId=b,x.idxs=_,x[P("0xa7")]=g,{}),T=(S[P("0x9c")]=!1,{}),A=(T.rule=P("0xa0"),T[P("0x71")]=P("0x85"),T.id=1,T[P("0xa")]=S,{}),M=(A[P("0x76")]=T,{}),O=(M[P("0xe")]=A,{}),L=(O.IndexInfo=M,{}),R=(L[P("0xe")]=x,L[P("0x1")]=O,{}),h=(R[P("0x71")]=P("0x70"),R.id=1,{}),l=(h.type="string",h.id=2,{}),w=(l.type=P("0x70"),l.id=3,{}),i=(w[P("0x71")]=P("0x70"),w.id=4,{}),r=(i.type="float",i.id=5,{}),o=(r[P("0x71")]=P("0x3e"),r.id=6,{}),s=(o.type=P("0x70"),o.id=7,{}),u=(s[P("0x71")]=P("0x85"),s.id=8,{}),d=(u[P("0x43")]="repeated",u[P("0x71")]="Floor",u.id=9,{}),c=(d[P("0x71")]="int32",d.id=10,{}),a=(c[P("0x2")]=R,c[P("0x2b")]=h,c[P("0x64")]=l,c[P("0x19")]=w,c.x=i,c.y=r,c.mid=o,c.version=s,c.floors=u,c.bcode=d,{}),v=(a.fields=c,{}),p=(v[P("0x42")]=E,v[P("0xd")]=e,v.Floor=L,v[P("0x6c")]=a,{}),m=(p[P("0xe")]=N,p[P("0x1")]=v,{}),y=(m[P("0x43")]=P("0x3"),m[P("0x71")]=P("0x70"),m.id=1,{}),b=(y[P("0x43")]="repeated",y[P("0x71")]=P("0x3d"),y.id=2,{}),_=(b.mid=m,b[P("0x10")]=y,{}),g=(_[P("0x71")]="int32",_.id=1,{}),S=(g[P("0x71")]="string",g.id=2,{}),T=(S[P("0x71")]=P("0x70"),S.id=3,{}),A=(T[P("0x71")]=P("0x70"),T.id=4,{}),M=(A[P("0x43")]=P("0xa0"),A.type=P("0x74")+P("0x5b"),A.id=5,{}),x=(M[P("0x43")]=P("0xa0"),M[P("0x71")]=P("0x74")+P("0x5b"),M.id=6,{}),O=(x[P("0x43")]=P("0xa0"),x[P("0x71")]=P("0x74")+P("0x5b"),x.id=7,{}),R=(O.gid=_,O[P("0x27")]=g,O[P("0x2")]=S,O[P("0x99")]=T,O[P("0x60")]=A,O[P("0x34")]=M,O.accessible=x,{}),h=(R[P("0xe")]=O,{}),l=(h[P("0x43")]=P("0x3"),h[P("0x71")]="int32",h.id=1,{}),w=(l[P("0x71")]=P("0x85"),l.id=2,{}),i=(w[P("0x71")]=P("0x85"),w.id=3,{}),r=(i[P("0x43")]=P("0xa0"),i[P("0x71")]="IndexInfo",i.id=4,{}),o=(r[P("0x9c")]=!1,{}),s=(o[P("0x43")]=P("0xa0"),o[P("0x71")]=P("0x5e"),o.id=5,o.options=r,{}),u=(s.type=P("0x85"),s.id=6,{}),d=(u[P("0x43")]=P("0xa0"),u.type=P("0x70"),u.id=7,{}),c=(d[P("0x43")]="repeated",d[P("0x71")]="string",d.id=8,{}),E=(c[P("0x67")]=h,c[P("0x71")]=l,c[P("0x7a")]=w,c[P("0x76")]=i,c[P("0xa7")]=o,c[P("0x92")]=s,c[P("0x8d")]=u,c[P("0x38")]=d,{}),e=(E[P("0x9c")]=!1,{}),L=(e[P("0x43")]=P("0xa0"),e[P("0x71")]=P("0x85"),e.id=1,e.options=E,{}),a=(L[P("0x76")]=e,{}),N=(a[P("0xe")]=L,{}),v=(N[P("0x96")]=a,{}),m=(v[P("0xe")]=c,v.nested=N,{}),y=(m[P("0x3d")]=R,m[P("0x74")+P("0x5b")]=v,{}),_=(y.fields=b,y[P("0x1")]=m,{}),g=(_[P("0x43")]=P("0x3"),_[P("0x71")]=P("0x70"),_.id=1,{}),S=(g[P("0x43")]="required",g[P("0x71")]=P("0x85"),g.id=2,{}),T=(S.type=P("0x3e"),S.id=3,{}),A=(T[P("0x43")]=P("0xa0"),T[P("0x71")]=P("0x33")+P("0x77"),T.id=4,{}),M=(A.rule=P("0xa0"),A[P("0x71")]=P("0x33")+"Info",A.id=5,{}),x=(M.rule="repeated",M[P("0x71")]="GeneralGeo"+P("0x77"),M.id=6,{}),O=(x[P("0x43")]="repeated",x[P("0x71")]="GeneralGeoInfo",x.id=7,{}),r=(O[P("0x43")]="repeated",O[P("0x71")]=P("0x33")+P("0x77"),O.id=8,{}),h=(r.rule=P("0xa0"),r[P("0x71")]=P("0x33")+"Info",r.id=9,{}),l=(h[P("0x43")]=P("0xa0"),h[P("0x71")]="GeneralGeoInfo",h.id=10,{}),w=(l[P("0x43")]=P("0xa0"),l.type=P("0x33")+P("0x77"),l.id=11,{}),i=(w[P("0x43")]=P("0xa0"),w[P("0x71")]=P("0x33")+"Info",w.id=12,{}),o=(i[P("0x43")]=P("0xa0"),i[P("0x71")]=P("0x33")+P("0x77"),i.id=13,{}),s=(o[P("0x99")]=_,o[P("0x23")]=g,o[P("0x6f")]=S,o[P("0x81")+"r"]=T,o[P("0x65")]=A,o.labelLayer=M,o[P("0x9a")]=x,o[P("0x4d")+"er"]=O,o[P("0x73")+"elLayer"]=r,o[P("0x9f")]=h,o[P("0x8c")]=l,o[P("0x51")+P("0x1b")]=w,o[P("0x93")+P("0x49")]=i,{}),u=(s[P("0x43")]=P("0x3"),s[P("0x71")]=P("0x85"),s.id=1,{}),d=(u[P("0x71")]="string",u.id=2,{}),E=(d[P("0x71")]=P("0x3e"),d.id=3,{}),e=(E.type="float",E.id=4,{}),L=(e[P("0x43")]="repeated",e[P("0x71")]=P("0x96"),e.id=5,{}),a=(L[P("0x9c")]=!1,{}),c=(a[P("0x43")]=P("0xa0"),a.type=P("0x5e"),a.id=6,a[P("0xa")]=L,{}),N=(c.eid=s,c[P("0x55")]=u,c[P("0x6f")]=d,c[P("0xc")]=E,c.idxs=e,c[P("0xa7")]=a,{}),R=(N.packed=!1,{}),v=(R[P("0x43")]=P("0xa0"),R.type=P("0x85"),R.id=1,R[P("0xa")]=N,{}),b=(v[P("0x76")]=R,{}),m=(b[P("0xe")]=v,{}),_=(m[P("0x96")]=b,{}),g=(_.fields=c,_[P("0x1")]=m,{}),S=(g["GeneralGeo"+P("0x77")]=_,{}),T=(S[P("0xe")]=o,S[P("0x1")]=g,{}),A=(T.rule=P("0x3"),T[P("0x71")]=P("0x70"),T.id=1,{}),M=(A[P("0x43")]=P("0x3"),A[P("0x71")]=P("0x85"),A.id=2,{}),x=(M[P("0x43")]="repeated",M[P("0x71")]=P("0x82")+P("0x7c"),M.id=3,{}),O=(x.rule="repeated",x.type=P("0x29")+"fo",x.id=4,{}),r=(O[P("0x43")]=P("0xa0"),O.type=P("0x41")+"fo",O.id=5,{}),h=(r.rule=P("0xa0"),r.type=P("0x40"),r.id=6,{}),l=(h[P("0x43")]=P("0xa0"),h.type=P("0x59")+"Info",h.id=7,{}),w=(l[P("0x43")]=P("0xa0"),l[P("0x71")]=P("0x1d")+"o",l.id=8,{}),i=(w[P("0x43")]=P("0xa0"),w.type=P("0x50")+"fo",w.id=9,{}),L=(i[P("0x43")]=P("0xa0"),i[P("0x71")]=P("0x14")+P("0x8b"),i.id=10,{}),s=(L[P("0x43")]=P("0xa0"),L[P("0x71")]=P("0x2d")+P("0x98"),L.id=11,{}),u=(s[P("0x99")]=T,s[P("0x23")]=A,s[P("0x81")+"r"]=M,s[P("0x65")]=x,s.labelLayer=O,s[P("0x9a")]=r,s[P("0x4d")+"er"]=h,s.liftLayer=l,s[P("0x8c")]=w,s["polygonLab"+P("0x18")]=i,s[P("0x93")+"delLayer"]=L,{}),d=(u.rule=P("0x3"),u[P("0x71")]=P("0x85"),u.id=1,{}),E=(d.type=P("0x70"),d.id=2,{}),e=(E[P("0x71")]=P("0x85"),E.id=3,{}),a=(e[P("0x71")]=P("0x70"),e.id=4,{}),N=(a.type=P("0x70"),a.id=5,{}),R=(N[P("0x71")]="int32",N.id=6,{}),v=(R[P("0x71")]="int32",R.id=7,{}),b=(v.eid=u,v[P("0x7b")]=d,v.type=E,v[P("0x2b")]=e,v[P("0x64")]=a,v[P("0x31")]=N,v[P("0x5d")]=R,{}),c=(b.fields=v,{}),m=(c[P("0x43")]="required",c[P("0x71")]=P("0x85"),c.id=1,{}),_=(m[P("0x71")]="string",m.id=2,{}),o=(_[P("0x71")]="int32",_.id=3,{}),g=(o[P("0x71")]=P("0x70"),o.id=4,{}),T=(g[P("0x71")]=P("0x70"),g.id=5,{}),A=(T.type=P("0x85"),T.id=6,{}),M=(A[P("0x71")]=P("0x85"),A.id=7,{}),x=(M[P("0x71")]="int32",M.id=8,{}),O=(x[P("0x67")]=c,x[P("0x7b")]=m,x[P("0x71")]=_,x[P("0x2b")]=o,x[P("0x64")]=g,x[P("0x31")]=T,x[P("0x5d")]=A,x[P("0xf")]=M,{}),r=(O[P("0xe")]=x,{}),h=(r[P("0x43")]=P("0x3"),r[P("0x71")]=P("0x85"),r.id=1,{}),l=(h[P("0x71")]=P("0x70"),h.id=2,{}),w=(l[P("0x71")]=P("0x85"),l.id=3,{}),i=(w[P("0x71")]=P("0x70"),w.id=4,{}),L=(i.type=P("0x70"),i.id=5,{}),u=(L[P("0x71")]=P("0x85"),L.id=6,{}),d=(u.type=P("0x85"),u.id=7,{}),E=(d[P("0x67")]=r,d[P("0x7b")]=h,d[P("0x71")]=l,d[P("0x2b")]=w,d[P("0x64")]=i,d[P("0x31")]=L,d.maxlevel=u,{}),e=(E.fields=d,{}),a=(e[P("0x43")]=P("0x3"),e[P("0x71")]=P("0x85"),e.id=1,{}),N=(a[P("0x71")]=P("0x70"),a.id=2,{}),R=(N[P("0x71")]="int32",N.id=3,{}),v=(R[P("0x71")]=P("0x70"),R.id=4,{}),c=(v[P("0x71")]=P("0x70"),v.id=5,{}),m=(c.type="int32",c.id=6,{}),_=(m[P("0x71")]=P("0x85"),m.id=7,{}),o=(_[P("0x67")]=e,_.fid=a,_[P("0x71")]=N,_[P("0x2b")]=R,_[P("0x64")]=v,_[P("0x31")]=c,_[P("0x5d")]=m,{}),g=(o[P("0xe")]=_,{}),T=(g[P("0x43")]=P("0x3"),g.type=P("0x85"),g.id=1,{}),A=(T.type=P("0x70"),T.id=2,{}),M=(A[P("0x71")]=P("0x85"),A.id=3,{}),x=(M[P("0x71")]=P("0x70"),M.id=4,{}),r=(x.type=P("0x70"),x.id=5,{}),h=(r[P("0x71")]="int32",r.id=6,{}),l=(h.type="int32",h.id=7,{}),w=(l.eid=g,l[P("0x7b")]=T,l[P("0x71")]=A,l.name=M,l[P("0x64")]=x,l[P("0x31")]=r,l[P("0x5d")]=h,{}),i=(w[P("0xe")]=l,{}),L=(i[P("0x43")]="required",i[P("0x71")]=P("0x85"),i.id=1,{}),u=(L.type=P("0x70"),L.id=2,{}),d=(u.type=P("0x85"),u.id=3,{}),e=(d.type=P("0x85"),d.id=4,{}),a=(e[P("0x71")]=P("0x70"),e.id=5,{}),N=(a.type=P("0x85"),a.id=6,{}),R=(N[P("0x71")]=P("0x85"),N.id=7,{}),v=(R[P("0x67")]=i,R[P("0x7b")]=L,R[P("0x71")]=u,R[P("0x92")]=d,R[P("0x2a")]=e,R[P("0x31")]=a,R[P("0x5d")]=N,{}),c=(v[P("0xe")]=R,{}),m=(c[P("0x43")]=P("0x3"),c[P("0x71")]="int32",c.id=1,{}),_=(m[P("0x71")]=P("0x70"),m.id=2,{}),g=(_[P("0x71")]=P("0x85"),_.id=3,{}),T=(g[P("0x71")]=P("0x85"),g.id=4,{}),A=(T[P("0x71")]="int32",T.id=5,{}),M=(A[P("0x71")]=P("0x85"),A.id=6,{}),x=(M[P("0x67")]=c,M[P("0x7b")]=m,M[P("0x71")]=_,M[P("0x92")]=g,M[P("0x31")]=T,M.maxlevel=A,{}),r=(x[P("0xe")]=M,{}),h=(r.rule=P("0x3"),r[P("0x71")]=P("0x85"),r.id=1,{}),l=(h.type=P("0x70"),h.id=2,{}),i=(l[P("0x71")]="int32",l.id=3,{}),L=(i[P("0x71")]="float",i.id=4,{}),u=(L[P("0x71")]=P("0x70"),L.id=5,{}),d=(u[P("0x71")]="string",u.id=6,{}),e=(d[P("0x71")]=P("0x3e"),d.id=7,{}),a=(e[P("0x67")]=r,e[P("0x7b")]=h,e[P("0x71")]=l,e[P("0x1a")]=i,e[P("0x2b")]=L,e[P("0x64")]=u,e.angle=d,{}),N=(a.fields=e,{}),R=(N[P("0x43")]=P("0x3"),N[P("0x71")]="int32",N.id=1,{}),c=(R.type="string",R.id=2,{}),m=(c[P("0x71")]=P("0x85"),c.id=3,{}),_=(m[P("0x71")]=P("0x70"),m.id=4,{}),g=(_[P("0x71")]=P("0x70"),_.id=5,{}),T=(g[P("0x71")]="int32",g.id=6,{}),A=(T.type=P("0x85"),T.id=7,{}),M=(A[P("0x67")]=N,A[P("0x7b")]=R,A[P("0x71")]=c,A.name=m,A[P("0x64")]=_,A[P("0x31")]=g,A[P("0x5d")]=T,{}),r=(M[P("0xe")]=A,{}),h=(r[P("0x82")+"nfo"]=b,r[P("0x29")+"fo"]=O,r[P("0x41")+"fo"]=E,r[P("0x59")+P("0x77")]=o,r.POIBizInfo=w,r[P("0x1d")+"o"]=v,r[P("0x50")+"fo"]=x,r[P("0x14")+P("0x8b")]=a,r[P("0x2d")+"delBizInfo"]=M,{}),l=(h[P("0xe")]=s,h.nested=r,{}),i=(l[P("0x43")]="required",l.type=P("0x70"),l.id=1,{}),L=(i[P("0x43")]="required",i.type=P("0x85"),i.id=2,{}),u=(L[P("0x43")]=P("0xa0"),L[P("0x71")]=P("0x6"),L.id=3,{}),d=(u[P("0x43")]="repeated",u[P("0x71")]=P("0x79")+"t",u.id=4,{}),e=(d[P("0x43")]=P("0xa0"),d[P("0x71")]=P("0x88"),d.id=5,{}),N=(e[P("0x43")]=P("0xa0"),e[P("0x71")]="NaviModel",e.id=6,{}),R=(N[P("0x9c")]=!1,{}),c=(R[P("0x43")]=P("0xa0"),R[P("0x71")]=P("0x85"),R.id=7,R[P("0xa")]=N,{}),m=(c[P("0x43")]=P("0xa0"),c[P("0x71")]="NaviExtent",c.id=8,{}),_=(m[P("0x99")]=l,m[P("0x23")]=i,m[P("0x57")]=L,m[P("0x9e")+"ts"]=u,m[P("0x17")]=d,m.naviModels=e,m.nextFloors=R,m[P("0x3f")+"s"]=c,{}),g=(_[P("0x71")]="int32",_.id=1,{}),T=(g.type=P("0x85"),g.id=2,{}),A=(T[P("0x71")]=P("0x85"),T.id=3,{}),b=(A[P("0x71")]=P("0x85"),A.id=4,{}),O=(b[P("0x71")]="int32",b.id=5,{}),E=(O[P("0x71")]=P("0x70"),O.id=6,{}),o=(E.type="string",E.id=7,{}),w=(o[P("0x71")]=P("0x70"),o.id=8,{}),v=(w[P("0x71")]="int32",w.id=9,{}),x=(v[P("0x71")]=P("0x70"),v.id=10,{}),a=(x[P("0x71")]=P("0x85"),x.id=11,{}),M=(a[P("0x9c")]=!1,{}),s=(M[P("0x43")]=P("0xa0"),M.type=P("0x85"),M.id=12,M[P("0xa")]=a,{}),r=(s[P("0x9c")]=!1,{}),N=(r[P("0x43")]=P("0xa0"),r[P("0x71")]=P("0x5e"),r.id=13,r[P("0xa")]=s,{}),l=(N.default=0,{}),i=(l.type="int32",l.id=14,l[P("0xa")]=N,{}),L=(i[P("0xa3")]=_,i.nodeType=g,i[P("0x7e")]=T,i[P("0x22")]=A,i[P("0x94")]=b,i.liftFloor=O,i[P("0x52")]=E,i[P("0x55")]=o,i[P("0x15")+"pe"]=w,i[P("0x89")+P("0xa2")]=v,i[P("0x86")]=x,i[P("0x76")]=M,i.pts=r,i[P("0x7a")]=l,{}),u=(L[P("0xe")]=i,{}),d=(u[P("0x71")]=P("0x85"),u.id=1,{}),e=(d[P("0x71")]="int32",d.id=2,{}),R=(e[P("0x71")]=P("0x85"),e.id=3,{}),c=(R[P("0x71")]=P("0x5e"),R.id=4,{}),a=(c[P("0x71")]=P("0x85"),c.id=5,{}),s=(a[P("0x71")]=P("0x70"),a.id=6,{}),N=(s[P("0x71")]=P("0x85"),s.id=7,{}),_=(N[P("0x71")]=P("0x70"),N.id=8,{}),g=(_[P("0x71")]=P("0x70"),_.id=9,{}),T=(g[P("0x71")]=P("0x85"),g.id=10,{}),A=(T[P("0x9c")]=!1,{}),b=(A[P("0x43")]="repeated",A[P("0x71")]=P("0x85"),A.id=11,A[P("0xa")]=T,{}),O=(b[P("0x9c")]=!1,{}),E=(O[P("0x43")]=P("0xa0"),O[P("0x71")]=P("0x5e"),O.id=12,O[P("0xa")]=b,{}),o=(E[P("0x47")]=u,E[P("0xa6")]=d,E.enode=e,E[P("0x8a")]=R,E[P("0xa5")]=c,E[P("0x2b")]=a,E.entry=s,E[P("0x48")]=N,E[P("0x55")]=_,E[P("0x9d")]=g,E[P("0x76")]=A,E[P("0xa7")]=O,{}),w=(o[P("0xe")]=E,{}),v=(w.rule=P("0x3"),w[P("0x71")]=P("0x85"),w.id=1,{}),x=(v[P("0x72")]=0,{}),M=(x[P("0x43")]=P("0x3"),x.type=P("0x85"),x.id=2,x[P("0xa")]=v,{}),r=(M.type=P("0x70"),M.id=3,{}),l=(r[P("0x43")]=P("0xa0"),r[P("0x71")]=P("0x70"),r.id=4,{}),i=(l[P("0x9c")]=!1,{}),T=(i[P("0x43")]=P("0xa0"),i[P("0x71")]="int32",i.id=5,i[P("0xa")]=l,{}),b=(T[P("0x9c")]=!1,{}),u=(b[P("0x43")]="repeated",b[P("0x71")]=P("0x5e"),b.id=6,b[P("0xa")]=T,{}),d=(u.id=w,u[P("0x71")]=x,u[P("0x55")]=M,u[P("0x58")]=r,u[P("0x76")]=i,u.pts=b,{}),e=(d[P("0xe")]=u,{}),R=(e[P("0x43")]="required",e[P("0x71")]=P("0x85"),e.id=1,{}),c=(R[P("0x9c")]=!1,{}),a=(c[P("0x43")]=P("0xa0"),c.type=P("0x85"),c.id=2,c.options=R,{}),s=(a.packed=!1,{}),N=(s[P("0x43")]=P("0xa0"),s[P("0x71")]="int32",s.id=3,s[P("0xa")]=a,{}),_=(N[P("0x9c")]=!1,{}),g=(_[P("0x43")]=P("0xa0"),_.type=P("0x85"),_.id=4,_[P("0xa")]=N,{}),A=(g[P("0x9b")]=e,g.doorids=c,g[P("0x1e")]=s,g[P("0x1c")]=_,{}),O=(A[P("0xe")]=g,{}),E=(O[P("0x43")]=P("0x3"),O[P("0x71")]=P("0x85"),O.id=1,{}),v=(E[P("0x9c")]=!1,{}),l=(v.rule=P("0xa0"),v[P("0x71")]="double",v.id=2,v.options=E,{}),T=(l[P("0x43")]="repeated",l[P("0x71")]=P("0x96"),l.id=3,{}),w=(T.id=O,T[P("0xa7")]=v,T[P("0x76")]=l,{}),x=(w.packed=!1,{}),M=(x[P("0x43")]=P("0xa0"),x[P("0x71")]=P("0x85"),x.id=1,x.options=w,{}),r=(M[P("0x76")]=x,{}),i=(r[P("0xe")]=M,{}),b=(i[P("0x96")]=r,{}),u=(b[P("0xe")]=T,b[P("0x1")]=i,{}),R=(u[P("0x6")]=L,u[P("0x79")+"t"]=o,u[P("0x88")]=d,u[P("0xa4")]=A,u[P("0x54")]=b,{}),a=(R.fields=m,R[P("0x1")]=u,{}),N=(a[P("0x6e")]=f,a.Scene=p,a[P("0x8e")]=y,a[P("0x7d")]=S,a[P("0x61")]=h,a[P("0x12")]=R,{}),e=(N[P("0xa")]=n,N[P("0x1")]=a,{}),c=(e.protobuf=N,{});c[P("0x1")]=e,this.id=c});function tf(t){return(tf="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 nf(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,function(t){t=function(t,n){if("object"!=tf(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=tf(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==tf(t)?t:t+""}(i.key),i)}}function ef(t,n,e){return n&&nf(t.prototype,n),e&&nf(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}var e=ef(function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");this.cs=null}),rf=(Object.assign(e.prototype,{hs:function(){this.cs||(this.cs=Wh.a.Root.fromJSON((new("undefined"!=typeof KjWzhWlSj&&KjWzhWlSj.ProtoDef?KjWzhWlSj.ProtoDef:$h)).id))},ls:function(t){return this.hs(),this.cs.lookup("Map").decode(t)},ds:function(t){for(var n=0;n<t.buffers.length;n++){var e=t.buffers[n];if(1==e.btype)return this.vs(e.data)}return null},ps:function(t){for(var n=0;n<t.buffers.length;n++){var e=t.buffers[n];if(7==e.btype)return this.ys(e.data)}return null},bs: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.gs(i.data)}return null},_s: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.ws(i.data)}return null},xs: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.Es(i.data)}return null},Ss: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.Es(i.data)}return null},Ts: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.Es(i.data)}return null},vs:function(t){this.hs();var n=this.cs.lookup("Scene").decode(t);return n.levels=[],n.layerGroups.forEach(function(t){n.levels.push(t.gid)}),n},ys:function(t){return this.hs(),this.cs.lookup("Gate").decode(t)},gs:function(t){return this.hs(),this.cs.lookup("FloorGeo").decode(t)},ws:function(t){return this.hs(),this.cs.lookup("FloorBiz").decode(t)},Es:function(t){return this.hs(),this.cs.lookup("FloorNavi").decode(t)}}),e);function of(t){return(of="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 sf(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,function(t){t=function(t,n){if("object"!=of(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=of(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==of(t)?t:t+""}(i.key),i)}}function af(t,n,e){return n&&sf(t.prototype,n),e&&sf(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}var uf,cf,hf,ff,lf,e=af(function t(){var n;if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");st.a.environment===B.a.WX?this.As=new st.a.ProtoReaderStatic:void 0!==kh.a.global().KjWzhWlSj&&kh.a.global().KjWzhWlSj.ProtoReaderStatic?(n=kh.a.global().KjWzhWlSj.ProtoReaderStatic,this.As=new n):this.As=new rf}),df=(Object.assign(e.prototype,{ls:function(t){return this.As.ls(t)},ds:function(t){return this.As.ds(t)},ps:function(t){return this.As.ps(t)},bs:function(t,n){return this.As.bs(t,n)},_s:function(t,n){return this.As._s(t,n)},xs:function(t,n){return this.As.xs(t,n)},Ss:function(t,n){return this.As.Ss(t,n)},Ts:function(t,n){return this.As.Ts(t,n)},vs:function(t){return this.As.vs(t)},ys:function(t){return this.As.ys(t)},gs:function(t){return this.As.gs(t)},ws:function(t){return this.As.ws(t)},Es:function(t){return this.As.Es(t)}}),e),e="https://console.fengmap.com/api-s/",vf="https://console.fengmap.cool/api-s/",pf={domain:e,online:e+"sdk/check",check:e+"sdk/auth/web",download:e+"sdk/auth/obtainMapRoute",downloadTile:e+"sdk/authLayered/obtainMapRoute",collect:e+"sdk/collect",themeUrl:e+"webtheme/",externalModelURL:e+"webmodel/"};function mf(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 yf(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 bf(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 gf(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]=cf[16*e+i]}function _f(t){for(var n=0;n<4;n++)t[n]=uf[16*((240&t[n])>>4)+(15&t[n])]}function wf(t){return parseInt(t,16)}uf=[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],cf=[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],lf=[2,ff=hf=0,0,0];var xf={decryption:function(t,n){for(var e=Array(16),i=0;i<16;i++)e[i]=16*wf(n.substr(2*i,1))+wf(n.substr(2*i+1,1));var r=Array(16);for(i=0;i<16;i++)r[i]=16*wf(t.substr(2*i,1))+wf(t.substr(2*i+1,1));var o=Array(16);switch(i=[],e.length){default:case 16:hf=4,ff=10;break;case 24:hf=6,ff=12;break;case 32:hf=8,ff=14}for(var s=i=Array(16*(ff+1)),a=Array(4),u=4*(ff+1),c=0;c<hf;c++)s[4*c+0]=e[4*c+0],s[4*c+1]=e[4*c+1],s[4*c+2]=e[4*c+2],s[4*c+3]=e[4*c+3];for(c=hf;c<u;c++){if(a[0]=s[4*(c-1)+0],a[1]=s[4*(c-1)+1],a[2]=s[4*(c-1)+2],a[3]=s[4*(c-1)+3],0==c%hf){for(var h=void 0,f=void 0,h=(e=a)[0],f=0;f<3;f++)e[f]=e[f+1];if(e[3]=h,_f(a),1==(e=c/hf))lf[0]=1;else if(1<e)for(lf[0]=2,e--;0<e-1;)lf[0]=mf(lf[0],2),e--;(f=e=a)[0]=e[0]^(h=lf)[0],f[1]=e[1]^h[1],f[2]=e[2]^h[2],f[3]=e[3]^h[3]}else 6<hf&&4==c%hf&&_f(a);s[4*c+0]=s[4*(c-hf)+0]^a[0],s[4*c+1]=s[4*(c-hf)+1]^a[1],s[4*c+2]=s[4*(c-hf)+2]^a[2],s[4*c+3]=s[4*(c-hf)+3]^a[3]}for(s=Array(16),a=0;a<4;a++)for(c=0;c<4;c++)s[4*a+c]=r[a+4*c];for(yf(s,i,ff),r=ff-1;1<=r;r--)for(bf(s),gf(s),yf(s,i,r),a=s,c=[14,9,13,11],u=f=void 0,e=Array(4),h=Array(4),u=0;u<4;u++){for(f=0;f<4;f++)e[f]=a[4*f+u];var f=c,l=e,d=h;for(d[0]=mf(f[0],l[0])^mf(f[3],l[1])^mf(f[2],l[2])^mf(f[1],l[3]),d[1]=mf(f[1],l[0])^mf(f[0],l[1])^mf(f[3],l[2])^mf(f[2],l[3]),d[2]=mf(f[2],l[0])^mf(f[1],l[1])^mf(f[0],l[2])^mf(f[3],l[3]),d[3]=mf(f[3],l[0])^mf(f[2],l[1])^mf(f[1],l[2])^mf(f[0],l[3]),f=0;f<4;f++)a[4*f+u]=h[f]}for(bf(s),gf(s),yf(s,i,0),a=0;a<4;a++)for(c=0;c<4;c++)o[a+4*c]=s[4*a+c];for(r="",i=0;i<16;++i)r+=s=(s=o[i].toString(16)).length<2?"0"+s:s;return r}};function Ef(t,n){var e=(65535&t)+(65535&n);return(t>>16)+(n>>16)+(e>>16)<<16|65535&e}function Sf(t,n,e,i,r,o){return Ef((n=Ef(Ef(n,t),Ef(i,o)))<<r|n>>>32-r,e)}function Tf(t,n,e,i,r,o,s){return Sf(n&e|~n&i,t,n,r,o,s)}function Af(t,n,e,i,r,o,s){return Sf(n&i|e&~i,t,n,r,o,s)}function Mf(t,n,e,i,r,o,s){return Sf(n^e^i,t,n,r,o,s)}function Of(t,n,e,i,r,o,s){return Sf(e^(n|~i),t,n,r,o,s)}function Lf(t,n){t[n>>5]|=128<<n%32,t[14+(n+64>>>9<<4)]=n;for(var e,i,r,o,s=1732584193,a=-271733879,u=-1732584194,c=271733878,h=0;h<t.length;h+=16)s=Tf(e=s,i=a,r=u,o=c,t[h],7,-680876936),c=Tf(c,s,a,u,t[h+1],12,-389564586),u=Tf(u,c,s,a,t[h+2],17,606105819),a=Tf(a,u,c,s,t[h+3],22,-1044525330),s=Tf(s,a,u,c,t[h+4],7,-176418897),c=Tf(c,s,a,u,t[h+5],12,1200080426),u=Tf(u,c,s,a,t[h+6],17,-1473231341),a=Tf(a,u,c,s,t[h+7],22,-45705983),s=Tf(s,a,u,c,t[h+8],7,1770035416),c=Tf(c,s,a,u,t[h+9],12,-1958414417),u=Tf(u,c,s,a,t[h+10],17,-42063),a=Tf(a,u,c,s,t[h+11],22,-1990404162),s=Tf(s,a,u,c,t[h+12],7,1804603682),c=Tf(c,s,a,u,t[h+13],12,-40341101),u=Tf(u,c,s,a,t[h+14],17,-1502002290),s=Af(s,a=Tf(a,u,c,s,t[h+15],22,1236535329),u,c,t[h+1],5,-165796510),c=Af(c,s,a,u,t[h+6],9,-1069501632),u=Af(u,c,s,a,t[h+11],14,643717713),a=Af(a,u,c,s,t[h],20,-373897302),s=Af(s,a,u,c,t[h+5],5,-701558691),c=Af(c,s,a,u,t[h+10],9,38016083),u=Af(u,c,s,a,t[h+15],14,-660478335),a=Af(a,u,c,s,t[h+4],20,-405537848),s=Af(s,a,u,c,t[h+9],5,568446438),c=Af(c,s,a,u,t[h+14],9,-1019803690),u=Af(u,c,s,a,t[h+3],14,-187363961),a=Af(a,u,c,s,t[h+8],20,1163531501),s=Af(s,a,u,c,t[h+13],5,-1444681467),c=Af(c,s,a,u,t[h+2],9,-51403784),u=Af(u,c,s,a,t[h+7],14,1735328473),s=Mf(s,a=Af(a,u,c,s,t[h+12],20,-1926607734),u,c,t[h+5],4,-378558),c=Mf(c,s,a,u,t[h+8],11,-2022574463),u=Mf(u,c,s,a,t[h+11],16,1839030562),a=Mf(a,u,c,s,t[h+14],23,-35309556),s=Mf(s,a,u,c,t[h+1],4,-1530992060),c=Mf(c,s,a,u,t[h+4],11,1272893353),u=Mf(u,c,s,a,t[h+7],16,-155497632),a=Mf(a,u,c,s,t[h+10],23,-1094730640),s=Mf(s,a,u,c,t[h+13],4,681279174),c=Mf(c,s,a,u,t[h],11,-358537222),u=Mf(u,c,s,a,t[h+3],16,-722521979),a=Mf(a,u,c,s,t[h+6],23,76029189),s=Mf(s,a,u,c,t[h+9],4,-640364487),c=Mf(c,s,a,u,t[h+12],11,-421815835),u=Mf(u,c,s,a,t[h+15],16,530742520),s=Of(s,a=Mf(a,u,c,s,t[h+2],23,-995338651),u,c,t[h],6,-198630844),c=Of(c,s,a,u,t[h+7],10,1126891415),u=Of(u,c,s,a,t[h+14],15,-1416354905),a=Of(a,u,c,s,t[h+5],21,-57434055),s=Of(s,a,u,c,t[h+12],6,1700485571),c=Of(c,s,a,u,t[h+3],10,-1894986606),u=Of(u,c,s,a,t[h+10],15,-1051523),a=Of(a,u,c,s,t[h+1],21,-2054922799),s=Of(s,a,u,c,t[h+8],6,1873313359),c=Of(c,s,a,u,t[h+15],10,-30611744),u=Of(u,c,s,a,t[h+6],15,-1560198380),a=Of(a,u,c,s,t[h+13],21,1309151649),s=Of(s,a,u,c,t[h+4],6,-145523070),c=Of(c,s,a,u,t[h+11],10,-1120210379),u=Of(u,c,s,a,t[h+2],15,718787259),a=Of(a,u,c,s,t[h+9],21,-343485551),s=Ef(s,e),a=Ef(a,i),u=Ef(u,r),c=Ef(c,o);return[s,a,u,c]}function Rf(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 Nf(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 Pf(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 Ff(t){return unescape(encodeURIComponent(t))}function jf(t){return Rf(Lf(Nf(t=Ff(t)),8*t.length))}function If(t,n){var e,t=Ff(t),n=Ff(n),i=Nf(t),r=[],o=[];for(r[15]=o[15]=void 0,16<i.length&&(i=Lf(i,8*t.length)),e=0;e<16;e+=1)r[e]=909522486^i[e],o[e]=1549556828^i[e];return t=Lf(r.concat(Nf(n)),512+8*n.length),Rf(Lf(o.concat(t),640))}function Cf(t,n,e){return n?e?If(n,t):Pf(If(n,t)):e?jf(t):Pf(jf(t))}var Df={encryption:function(t){return Cf(t)}};function kf(t){return(kf="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 Uf(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,function(t){t=function(t,n){if("object"!=kf(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=kf(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==kf(t)?t:t+""}(i.key),i)}}function Bf(t,n,e){return n&&Uf(t.prototype,n),e&&Uf(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}e=Bf(function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function")});Object.assign(e.prototype,{Ms:function(t,n,e,i,r){void 0===st.a.KjWzhWlSj||!st.a.KjWzhWlSj.license||!st.a.KjWzhWlSj.license||"string"==typeof n&&0!=n.length&&(n=xf.decryption(n,"026685bf295f587b5dffc1f18d5dc27c"),e=Df.encryption(e),n=xf.decryption(n,e),-1!==t.indexOf(n))?i&&i():r&&r()},Os:function(t,n,e,i){var r;-1!==n.indexOf("")||-1!==n.indexOf("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")||void 0===t.mapURL||(r=Df.encryption("fengmap.localhost:"+t.appName),r=xf.decryption(t.key,r),-1!==n.indexOf(r))?this.Ms(n,t.license,t.buildingID,function(){e&&e()},function(){i&&i(mr.LICENSE_ERROR)}):i&&i(mr.NAME_KEY_ERROR)},Ls:function(t,n,e){var i=this;void 0!==t.mapURL?n&&n():(t.enableCollect&&this.Rs(t),this.Ns(function(){new zh({method:"POST",url:pf.check,header:{"X-Requested-With":"XMLHttpRequest","Content-type":"application/json;charset=utf-8"},data:i.Ps(t)}).us(function(){n&&n()},function(t){e&&e(t)},function(){n&&n()})},function(){n&&n()}))},Ns:function(t,n){new zh({method:"GET",url:pf.online}).us(function(){t&&t()},function(){n&&n()},function(){n&&n()})},Ps:function(t,n){st.a.environment===B.a.BROWSER&&-1!==(i=(e=kh.a.global().location.host).indexOf(":"))&&(e=e.slice(0,i));var e,i={mapId:t.buildingID,appName:t.appName};return n?i.keyValue=t.key:i.appKey=t.key,n?i.webUrl=e||"0.0.0.0":i.webURL=e||"0.0.0.0",i},Rs: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=S+"."+T,n.appName=t.appName,n.appkey=t.key;for(var t=st.a.document.createElement("canvas").getContext("experimental-webgl"),e=t.getExtension("WEBGL_debug_renderer_info"),i=(n.gpu=e?t.getParameter(e.UNMASKED_RENDERER_WEBGL):null,n.os=navigator.platform,!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 zh({method:"POST",url:pf.collect,header:{"X-Requested-With":"XMLHttpRequest","Content-type":"application/json;charset=utf-8"},data:n}).us()}}});var Gf=new e;function Hf(t){return(Hf="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 Xf(t){return function(t){if(Array.isArray(t))return Vf(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,n){var e;if(t)return"string"==typeof t?Vf(t,n):"Map"===(e="Object"===(e=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Vf(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 Vf(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 zf(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,function(t){t=function(t,n){if("object"!=Hf(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Hf(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Hf(t)?t:t+""}(i.key),i)}}function Wf(t,n,e){return n&&zf(t.prototype,n),e&&zf(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}var e=Wf(function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");this.As=new df,this.Fs=[]}),Yf=(Object.assign(e.prototype,{Yn:function(){this.Fs.forEach(function(t){t.Yn()}),this.Fs.length=0},js: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),n=new zh({method:"POST",url:""===n?pf.download:pf.downloadTile+"/"+t.buildingID+n+".fmap",header:{"X-Requested-With":"XMLHttpRequest","Content-type":"application/json;charset=utf-8"},data:Object.assign(r,Gf.Ps(t,!0))}),this.Fs.push(n),n.us(function(t){e&&e(t.replace('"',"").replace('"',""))},function(t){i&&i(t)},function(t){i&&i(t)}))},Is:function(e,i,r){var o=this;e.enableCollect=!0,Gf.Ls(e,function(){o.js(e,"",function(t){t=new zh({method:"GET",responseType:"arraybuffer",url:t});o.Fs.push(t),t.us(function(t){var t=new Uint8Array(t),n=o.As.ls(t);!e.isOutdoor||(t=[],n.keys&&0!==n.keys.length?t.push.apply(t,Xf(n.keys)):t.push(n.key),e.isPreview)?i&&i(n):Gf.Os(e,t,function(){i&&i(n)},function(t){r&&r(t)})},function(t){r&&r(t===mr.PATH_ERROR?mr.MAP_ID_URL_ERROR:t)},function(t){r&&r(t)})},function(t){r&&r(t)})},function(t){r&&r(t)})},Cs:function(e,i,r){var o=this;e.enableCollect=!0,Gf.Ls(e,function(){o.js(e,".scene",function(t){t=new zh({method:"GET",responseType:"arraybuffer",url:t});o.Fs.push(t),t.us(function(t){var t=new Uint8Array(t),n=o.As.vs(t);!e.isOutdoor||(t=[],n.keys&&0!==n.keys.length?t.push.apply(t,Xf(n.keys)):t.push(n.key),e.isPreview)?i&&i(n):Gf.Os(e,t,function(){i&&i(n)},function(t){r&&r(t)})},function(t){r&&r(t)},function(t){r&&r(t)})},function(t){r&&r(t)})},function(t){r&&r(t)})},Ds:function(t,n,e){var i=this;this.js(t,".gate",function(t){t=new zh({method:"GET",responseType:"arraybuffer",url:t});i.Fs.push(t),t.us(function(t){t=new Uint8Array(t),t=i.As.ys(t);n&&n(t)},function(t){e&&e(t)},function(t){e&&e(t)})},function(t){e&&e(t)})},ks:function(t,n,e,i){var r=this;this.js(t,".floor."+n+".geo",function(t){t=new zh({method:"GET",responseType:"arraybuffer",url:t});r.Fs.push(t),t.us(function(t){t=new Uint8Array(t),t=r.As.gs(t);e&&e(t)},function(t){i&&i(t)},function(t){i&&i(t)})},function(t){i&&i(t)})},Us:function(t,n,e,i){var r=this;this.js(t,".floor."+n+".biz",function(t){t=new zh({method:"GET",responseType:"arraybuffer",url:t});r.Fs.push(t),t.us(function(t){t=new Uint8Array(t),t=r.As.ws(t);e&&e(t)},function(t){i&&i(t)},function(t){i&&i(t)})},function(t){i&&i(t)})},Bs:function(t,n,e,i){var r=this;this.js(t,n,function(t){t=new zh({method:"GET",responseType:"arraybuffer",url:t});r.Fs.push(t),t.us(function(t){t=new Uint8Array(t),t=r.As.Es(t);e&&e(t)},function(t){i&&i(t)})},function(t){i&&i(t)},function(t){i&&i(t)})},Gs:function(t,n,e,i){this.Bs(t,".floor."+n+".navi",e,i)},Hs:function(t,n,e,i){this.Bs(t,".floor."+n+".drive.navi",e,i)},Xs:function(t,n,e,i){this.Bs(t,".floor."+n+".accessible.navi",e,i)}}),e);function Qf(t){for(var n=[],e=t.length,i=0;i<e;i++){for(var r=t[i],o={x:this.Vs(r.x),y:this.Vs(r.y)},s=n.length,a=!1,u=0;u<s;u++){var c=n[u];if(c.x==o.x&&c.y==o.y){a=!0;break}}a||n.push(o)}return n}function Zf(t){return+t.toFixed(2)}function qf(t){return(qf="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 Kf(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,function(t){t=function(t,n){if("object"!=qf(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=qf(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==qf(t)?t:t+""}(i.key),i)}}function Jf(t,n,e){return n&&Kf(t.prototype,n),e&&Kf(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}e=Jf(function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function")});Object.assign(e.prototype,{zs: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},Ws: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],c=[];i<u;)c.push({x:n[i],y:n[i+1]}),i+=2;e.push(c)}}return e},Ys: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 c=[],h=s[a];r<h;)c.push({x:n[r],y:n[r+1]}),r+=2;i.push(c)}}var f=[];return f.push(e),f.push.apply(f,i),f},Qs:function(t){return Qf(t)},Vs:Zf});var $f=new e;function tl(t){return(tl="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 nl(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,function(t){t=function(t,n){if("object"!=tl(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=tl(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==tl(t)?t:t+""}(i.key),i)}}function el(t,n,e){return n&&nl(t.prototype,n),e&&nl(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}var il={G1:"MULTIPOLYGON(((",G2:"POINT(",G3:"MULTILINESTRING(("},e=(il.GLEN1="MULTIPOLYGON(((".length,il.GLEN2="POINT(".length,il.GLEN3="MULTILINESTRING((".length,el(function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function")}));Object.assign(e.prototype,{zs:function(t){var n=[];return 0!=t.indexOf(il.G2)?[]:(t=t.substring(il.GLEN2,t.length-1).split(" "),n.push({x:parseFloat(t[0]),y:parseFloat(t[1])}),n)},Zs:function(t,n){for(var e=0;e<t.length;e++){var i=t[e].split(" ");n.push({x:parseFloat(i[0]),y:parseFloat(i[1])})}},Ws:function(t){return 0!=t.indexOf(il.G3)?[]:(t=t.substring(il.GLEN3,t.length-2).split(","),this.Zs(t,t=[]),[t])},Ys:function(t){var n=[],e=[];if(0!=t.indexOf(il.G1))return[];for(var i=t.substring(il.GLEN1,t.length-3).split(/\),\(/),r=0;r<i.length;r++){var o=i[r].split(/,/);if(0==r)this.Zs(o,n);else{for(var s=[],a=0;a<o.length;a++){var u=o[a].split(" ");s.push({x:parseFloat(u[0]),y:parseFloat(u[1])})}e.push(s)}}t=[];return t.push(n),t.push.apply(t,e),t},Qs:function(t){return Qf(t)},Vs:Zf});var rl=new e;function ol(t,n){var e,i,r,o,s="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(s)return i=!(e=!0),{s:function(){s=s.call(t)},n:function(){var t=s.next();return e=t.done,t},e:function(t){i=!0,r=t},f:function(){try{e||null==s.return||s.return()}finally{if(i)throw r}}};if(Array.isArray(t)||(s=function(t,n){var e;if(t)return"string"==typeof t?sl(t,n):"Map"===(e="Object"===(e=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?sl(t,n):void 0}(t))||n&&t&&"number"==typeof t.length)return s&&(t=s),o=0,{s:n=function(){},n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},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.")}function sl(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 al(t){return(al="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 ul(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,function(t){t=function(t,n){if("object"!=al(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=al(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==al(t)?t:t+""}(i.key),i)}}var e=function(){function n(t){if(!(this instanceof n))throw new TypeError("Cannot call a class as a function");this.bi=Yr.GROUP,this.Lt=new Map,this.yi=-1,this.ci=null,Object.assign(this,t)}return t=n,(e=[{key:"getType",value:function(){return this.bi}},{key:"getBound",value:function(){return this.ci||this._i(),this.ci}},{key:"getChildren",value:function(){return this.Lt}}])&&ul(t.prototype,e),i&&ul(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,i}(),cl=(Object.assign(e.prototype,{Yn:function(){var t,n=ol(this.Lt.values());try{for(n.s();!(t=n.n()).done;){var e=t.value;e.Yn&&e.Yn()}}catch(t){n.e(t)}finally{n.f()}this.Lt.clear()},wi:function(n){var t=n._support(this);t==Uo.PASS?this.Lt.forEach(function(t){t.wi(n)}):t==Uo.PUSH&&n._result.push(this)},_i:function(){var n=this;this.ci=new Ii,0!=this.Lt.size&&this.Lt.forEach(function(t){n.ci.Yt(t.getBound())})}}),e);function hl(t){return(hl="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 fl(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,function(t){t=function(t,n){if("object"!=hl(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=hl(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==hl(t)?t:t+""}(i.key),i)}}function ll(t,n,e){n=vl(n);var i=t,n=dl()?Reflect.construct(n,e||[],vl(t).constructor):n.apply(t,e);if(n&&("object"===hl(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function dl(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(dl=function(){return!!t})()}function vl(t){return(vl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function pl(t,n){return(pl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var e=function(){function e(t){var n;if(this instanceof e)return(n=ll(this,e)).yi=t.eid,n.bi=Yr.POINT,Object.assign(n,t),n;throw new TypeError("Cannot call a class as a function")}var t,n,i=e,r=Ho;if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");return i.prototype=Object.create(r&&r.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),r&&pl(i,r),i=e,t&&fl(i.prototype,t),n&&fl(i,n),Object.defineProperty(i,"prototype",{writable:!1}),i}(),ml=(Object.assign(e.prototype,{_i:function(){this.ci=new Ii,this.gi&&this.ci.Qt(this.gi)},wi:function(t){t._support(this)==Uo.PUSH&&t._result.push(this)}}),e);function yl(t){return(yl="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)}var bl=["layerGroups"],gl=["layers"];function _l(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}function wl(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,function(t){t=function(t,n){if("object"!=yl(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=yl(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==yl(t)?t:t+""}(i.key),i)}}function xl(t,n,e){return n&&wl(t.prototype,n),e&&wl(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}var e=xl(function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");this.qs=[1,2,3,4],this.Ks=[6,7,9],this.Js=[31,32],this.$s=new Map,this.$s.set(31,Yr.EXTENTGROUP),this.$s.set(32,Yr.MODELGROUP),this.$s.set(6,Yr.FACILITYGROUP),this.$s.set(7,Yr.LABELGROUP),this.$s.set(9,Yr.EXTERNALMODELGROUP),this.ta=new Map,this.ta.set(31,["extentLayer",null]),this.ta.set(32,["modelLayer","labelLayer"]),this.ta.set(6,["poiLayer",null]),this.ta.set(7,["labelLayer",null]),this.ta.set(9,["externalModelLayer",null]),this.As=new df}),El=(Object.assign(e.prototype,{na:function(t){var n;return t?(n=t.scene,this.ea(n,t)):null},ea:function(t,e){var i=this,n=t.layerGroups,r=_l(t,bl),o=t.fileVer,s=new cl(r);return n.forEach(function(t){var n=i.ia(t,e,o);s.Lt.set(t.gid,n)}),s},ia:function(t,n,e){var i=this,r=t.layers,o=_l(t,gl),s=new cl(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.ra(t,a,u,e);null!==n&&s.Lt.set(i.$s.get(t.ltype),n)}),this.oa(s),s},oa:function(t){var n=Array.from(t.Lt);n.sort(function(t,n){return t[0]-n[0]}),t.Lt=new Map(n)},ra:function(t,n,e,i){var r;return-1===this.qs.indexOf(t.ltype)&&this.ta.get(t.ltype)?(r=new cl(t),this.sa(r,n,e,i),r&&(r.bi=this.$s.get(t.ltype)),r):null},sa:function(t,n,e,i){if(t){var r=this.ta.get(t.ltype);if(r){var o=n?n[r[0]]:[],s=e?e[r[0]]:[];switch(t.ltype){case 6:this.aa(t,o,s,i,Yr.FACILITY);break;case 7:this.aa(t,o,s,i,Yr.LABEL);break;case 9:this.aa(t,o,s,i,Yr.EXTERNALMODEL);break;case 31:this.ua(t,o,s,i,Yr.EXTENT,null);break;case 32:this.ua(t,o,s,i,Yr.MODEL,n?n[r[1]]:null)}}}},aa:function(t,n,e,i,r){for(var o=0;o<n.length;o++){var s=this.ca(n[o],e[o],i);s.bi=r,t.Lt.set(n[o].eid,s)}},ca:function(t,n,e){n=Object.assign({},n,{area:t.area,eid:t.eid,height:t.height}),n=new ml(n);return t.coordinates?n.gi=t.coordinates:(n.gi=1==e?rl.zs(t.geo):$f.zs(t.idxs,t.pts),t.coordinates=n.gi),n},ua:function(t,n,e,i,r,o){for(var s=0;s<n.length;s++){var a=this.ha(n[s],e[s],i,o?o[s]:null);a.bi=r,t.Lt.set(n[s].eid,a)}},ha:function(t,n,e,i){n=Object.assign({},n,{area:t.area,eid:t.eid,height:t.height}),n=new Zo(n);return n.gi=1===e?rl.Ys(t.geo):$f.Ys(t.idxs,t.pts),i&&(i.coordinates||(i.coordinates=1===e?rl.zs(i.geo):$f.zs(i.idxs,i.pts)),n.Jt=i.coordinates[0]),n}}),e),Sl={NONE_RODE_NETWORK:1,WALK_RODE_NETWORK:2,DRIVE_RODE_NETWORK:4,ACCESSIBLE_RODE_NETWORK:8};function Tl(t){return(Tl="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 Al(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,function(t){t=function(t,n){if("object"!=Tl(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Tl(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Tl(t)?t:t+""}(i.key),i)}}function Ml(t,n,e){return n&&Al(t.prototype,n),e&&Al(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}var e=Ml(function t(){var n=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},e=this,i=t;if(!(e instanceof i))throw new TypeError("Cannot call a class as a function");this.fa=n.disposeCallback,this.la=!1,this.da=!1,this.va=void 0!==n.enable&&n.enable,this.name=void 0!==n.name?n.name:"",this.pa=new Map,this.ma=n.mapCreateTime}),Ol=(Object.assign(e.prototype,{ya:function(){!this.va||this.da||this.la&&0===this.pa.size&&(this.fa({mapCreateTime:this.ma}),this.da=!0)},ba:function(t){this.va&&(this.la=t,this.ya())},ga:function(t){this.va&&(this.pa.has(t)&&console.warn("添加的引用已经存在..."),this.pa.set(t,0))},_a:function(t){this.va&&(this.pa.has(t)?(this.pa.delete(t),this.ya()):console.warn("移除的引用不存在"))}}),e);function Ll(t){return(Ll="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 Rl(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,function(t){t=function(t,n){if("object"!=Ll(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Ll(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Ll(t)?t:t+""}(i.key),i)}}var e=function(){function n(t){if(!(this instanceof n))throw new TypeError("Cannot call a class as a function");this.jr=new Map,this.wa=new Map,this.rs=new Map,this.xa=new Map,this.Ea=new Map,this.Sa=new Map,this.Ta=[2,3],this.Aa=!1,this.As=new df,this.Ma=new El,this.Oa=new Yf,this.La=null,this.Uo=this.Uo.bind(this),this.Ra=new Ol({disposeCallback:this.Uo,enable:!0,name:"DataManager",mapCreateTime:t?t.mapCreateTime:(new Date).getTime()})}return t=n,(e=[{key:"load",value:function(t,n){this.Na(t,n)}},{key:"loadWhole",value:function(t,n){this.Pa(t,n)}},{key:"getDecode",value:function(t){t=void 0!==t.buildingID?t.buildingID:t.mapID;return this.Fa({buildingID:t})}},{key:"getData",value:function(t){t=void 0!==t.buildingID?t.buildingID:t.mapID;return this.jr.get(t)}},{key:"setCache",value:function(t){this.jr=t[0],this.wa=t[1]}},{key:"getCache",value:function(){return[this.jr,this.wa]}}])&&Rl(t.prototype,e),i&&Rl(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,i}(),Nl=(Object.assign(e.prototype,{Yn:function(t){this.La=t,this.Oa.Yn(),this.Ra.ba(!0)},Uo:function(){this.jr.clear(),this.jr=null,this.wa.clear(),this.wa=null,this.rs.clear(),this.rs=null,this.xa.clear(),this.xa=null,this.Ea.clear(),this.Ea=null,this.Sa.clear(),this.Sa=null,this.La&&this.La({name:"DataManager"})},ja:function(t){this.xa.set(t.buildingID+t.uuid,null),this.Ea.set(t.buildingID+t.uuid,null),this.Sa.set(t.buildingID+t.uuid,0)},Na:function(a,u){var c=this;this.ja(a),this.Cs(a,function(n,t){u&&u(n,t);var s=c.Ia(a),t=a.loadNavi&&s.buildings&&0<s.buildings.length;c.Ds(a,t,function(t,n){u&&u(t,n);for(var e=void 0!==a.level?a.level:parseInt(s.defGid),i=(c.Ca(a,e,u),a.visibleLevels||s.levels),r=0;r<i.length;r++)i[r]===e||s.levels.indexOf(i[r])<0||c.Ca(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])&&c.Ca(a,s.levels[o],u)},function(t){u&&u(n,t)})},function(t,n){u&&u(t,n)})},Ds:function(e,t,i,r){var o,s=this;t?(t=this.Da(e))?i&&i("gate",t):(o="_sendGate"+St.generateUUID(),this.Ra.ga(o),this.Oa.Ds(e,function(t){s.wa.get(e.buildingID).gate=t,i&&i("gate",t),s.Ra._a(o)},function(t){var n;e.navigationData?((n=s.wa.get(e.buildingID)).gate=e.navigationData,i&&i("gate",n.gate)):r("error",t),s.Ra._a(o)})):i&&i("gate",null)},Cs:function(n,e,i){var r,o=this,t=this.Ia(n);t?(e&&e("scene",t),n.justDecode||(t=this.jr.get(n.buildingID),e&&e("building",t))):(r="_sendScene"+St.generateUUID(),this.Ra.ga(r),this.Oa.Cs(n,function(t){n.isOutdoor&&o.ka(t),o.wa.set(n.buildingID,{scene:t}),e&&e("scene",t),n.justDecode||(t=o.Ma.ea(t),o.jr.set(n.buildingID,t),e&&e("building",t)),o.Ra._a(r)},function(t){i&&i("error",t===mr.PATH_ERROR?mr.MAP_ID_URL_ERROR:t),o.Ra._a(r)}))},ka:function(t){var n=t.fileVer;t.buildings&&1<n&&t.buildings.forEach(function(n){n.floors&&(n.levelChart=[],n.fids=[],n.floors.forEach(function(t){t.gi=$f.Ys(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)}))})},Ca:function(t,n,e,i){var r=this.xa.get(t.buildingID+t.uuid);r||this.xa.set(t.buildingID+t.uuid,r=[]),i?r.unshift(n):r.push(n),this.Aa&&1!==r.length||this.Ua(t,e)},Ua:function(i,r){var o,t,s,a=this,u=this.Ia(i);u&&(o=this.xa.get(i.buildingID+i.uuid))&&0!==o.length&&((t=this.Ea.get(i.buildingID+i.uuid))||this.Ea.set(i.buildingID+i.uuid,t=[]),s=o[0],-1!==t.indexOf(s)?(o.splice(o.indexOf(s),1),this.Ua(i,r)):(t.push(s),this.Ba(i,s,function(t,n){var e=a.Sa.get(i.buildingID+i.uuid);"layerGroup"===t&&(r&&r(t,n),a.Sa.set(i.buildingID+i.uuid,++e),e===u.layerGroups.length&&r&&r("decode",a.Fa(i)),o.splice(o.indexOf(s),1),a.Ua(i,r)),"layer"===t&&r&&r(t,n),"floor"===t&&(r&&r(t,n),e===u.layerGroups.length)&&r&&r("complete",a.Ga(i))},function(t,n){r&&r(t,n)})))},Ba:function(r,o,s,n){var t,a,u,c,h,e,i=this,f=this.Ia(r),l=this.Ha(f,o);l?(t=l.gname,l=l.naviType||0,a=this.Ta[0],u=0,c=new Map,h=r.merge,e=function(n){var e,i,t;a===++u&&(e=c.get("geo"),i=c.get("biz"),h&&h.merge(o,e,i,f.fileVer),s&&s("layerGroup",c),r.justDecode||((t=n.Bi(r,o)).Lt.forEach(function(t){n.Ma.sa(t,e,i,f.fileVer),s&&s("layer",t)}),s&&s("floor",t)))},r.loadNavi&&((0!=(l&Sl.WALK_RODE_NETWORK)||f.fileVer<3)&&(a++,this.Gs(r,o,t,function(t,n){c.set(t,n),s&&s(t,n),e(i)},function(t){n&&n(t)})),0!=(l&Sl.DRIVE_RODE_NETWORK)&&(a++,this.Hs(r,o,t,function(t,n){c.set(t,n),s&&s(t,n),e(i)},function(t){n&&n(t)})),0!=(l&Sl.ACCESSIBLE_RODE_NETWORK))&&(a++,this.Xs(r,o,t,function(t,n){c.set(t,n),s&&s(t,n),e(i)},function(t){n&&n(t)})),this.ks(r,o,t,function(t,n){c.set(t,n),s&&s(t,n),e(i)},function(t){n&&n(t)}),this.Us(r,o,t,function(t,n){c.set(t,n),s&&s(t,n),e(i)},function(t){n&&n(t)})):n&&n("error",mr.DEFAULT_LEVEL_ERROR)},ks:function(n,e,t,i,r){var o,s=this,a=this.Xa(n,e,"geo");a?i&&i("geo",a):(o="_sendFloorGeo"+St.generateUUID(),this.Ra.ga(o),this.Oa.ks(n,t,function(t){s.Va(n,e,"geo",t),i&&i("geo",t),s.Ra._a(o)},function(t){r&&r("error",t),s.Ra._a(o)}))},Us:function(n,e,t,i,r){var o,s=this,a=this.Xa(n,e,"biz");a?i&&i("biz",a):(o="_sendFloorBiz"+St.generateUUID(),this.Ra.ga(o),this.Oa.Us(n,t,function(t){s.Va(n,e,"biz",t),i&&i("biz",t),s.Ra._a(o)},function(t){r&&r("error",t),s.Ra._a(o)}))},Gs:function(n,e,t,i,r){var o,s=this,a=this.Xa(n,e,"navi");a?i&&i("navi",a):(o="_sendFloorNavi"+St.generateUUID(),this.Ra.ga(o),this.Oa.Gs(n,t,function(t){s.Va(n,e,"navi",t),i&&i("navi",t),s.Ra._a(o)},function(t){r&&r("error",t),s.Ra._a(o)}))},Hs:function(n,e,t,i,r){var o,s=this,a=this.Xa(n,e,"drive_navi");a?i&&i("drive_navi",a):(o="_sendFloorNaviDrive"+St.generateUUID(),this.Ra.ga(o),this.Oa.Hs(n,t,function(t){s.Va(n,e,"drive_navi",t),i&&i("drive_navi",t),s.Ra._a(o)},function(t){r&&r("error",t),s.Ra._a(o)}))},Xs:function(n,e,t,i,r){var o,s=this,a=this.Xa(n,e,"accessible_navi");a?i&&i("drive_navi",a):(o="_sendFloorNaviAccessible"+St.generateUUID(),this.Ra.ga(o),this.Oa.Xs(n,t,function(t){s.Va(n,e,"accessible_navi",t),i&&i("accessible_navi",t),s.Ra._a(o)},function(t){r&&r("error",t),s.Ra._a(o)}))},Pa:function(t,e){this.Is(t,function(t,n){e&&e(t,n)},function(t,n){e&&e(t,n)})},Is:function(n,e,i){var r,o=this,s=this.Fa(n);s?e&&e("decode",s):(r="_sendWhole"+St.generateUUID(),this.Ra.ga(r),this.Oa.Is(n,function(t){o.za(n,t),s=o.Fa(n),e&&e("decode",s),n.justDecode||(t=o.Ma.na(s),o.jr.set(n.buildingID,t),e&&e("complete",t)),o.Ra._a(r)},function(t){i&&i("error",t),o.Ra._a(r)}))},Ga:function(t){if(this.jr)return this.jr.get(t.buildingID)||null},Bi:function(t,n){t=this.jr.get(t.buildingID);return t?t.Lt.get(n):null},za:function(t,n){var e={scene:null,floors:new Map},i=this.As.ds(n);t.isOutdoor&&this.ka(i),e.scene=i,e.gate=this.As.ps(n);for(var r=0;r<i.layerGroups.length;r++){var o=i.layerGroups[r],s=this.As.bs(n,o.gid),a=this.As._s(n,o.gid),u=this.As.xs(n,o.gid),c=this.As.Ss(n,o.gid),h=this.As.Ts(n,o.gid),f=(t.merge&&t.merge.merge(o.gid,s,a,i.fileVer),new Map);f.set("geo",s),f.set("biz",a),f.set("navi",u),f.set("drive_navi",c),f.set("accessible_navi",h),e.floors.set(o.gid,f)}this.wa.set(t.buildingID,e)},Fa:function(t){var n=this.wa.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:[]},u=(a.geo.push(this.Xa(t,s,"geo")),a.biz.push(this.Xa(t,s,"biz")),this.Xa(t,s,"navi")),u=(u&&a.navi.push(u),this.Xa(t,s,"drive_navi")),u=(u&&a.naviDrive.push(u),this.Xa(t,s,"accessible_navi"));u&&a.naviAccessible.push(u),i.set(o.gid,a)}return n},Ia:function(t){t=this.wa.get(t.buildingID);return t?t.scene:null},Da:function(t){t=this.wa.get(t.buildingID);return t?t.gate:null},Va:function(t,n,e,i){var r,t=this.wa.get(t.buildingID);t&&((r=t.floors)||(r=new Map,t.floors=r),(t=r.get(n))||(t=new Map,r.set(n,t)),t.set(e,i))},Xa:function(t,n,e){var t=this.wa.get(t.buildingID);return(t=t&&t.floors)&&(t=t.get(n))?t.get(e):null},Ha:function(t,n){if(null!=t)for(var e=t.layerGroups,i=0;i<e.length;i++)if(e[i].gid==n)return e[i];return null}}),e);function Pl(t,n){return Ea.prototype.copy.call(t,n),t.fragmentShader=n.fragmentShader,t.vertexShader=n.vertexShader,t.uniforms=_a.clone(n.uniforms),t.lights=n.lights,t}function Fl(n){Object.defineProperties(n,{color:{enumerable:!0,get:function(){return n.uniforms.diffuse.value},set:function(t){n.uniforms.diffuse.value=t}},opacity:{enumerable:!0,get:function(){return n.uniforms.opacity.value},set:function(t){n.uniforms.opacity.value=t}},map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(t){this.uniforms.map.value=t}}})}function jl(t){t.fmcommon={diffuse:{value:new lt(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new q}}}jl(Lt),Lt.line={lineWidth:{value:1},resolution:{value:new Mt(1,1)},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1},mmap:{value:null},offset:{value:new Mt(0,0)},repeat:{value:new Mt(1,1)},miny:{value:0},pcolor:{value:new lt(11447982)},usePassOpacity:{value:0},passOpacity:{value:1}},eu.line={uniforms:_a.merge([Lt.fmcommon,Lt.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\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\n\t\t\tfloat duvy = uvyEnd - uvyStart;\n\t\t\tfloat uvy = uvyStart + duvy * uv2.y;\n\t\t\t// vUv2 = vec2(uv2.x ,uvy);\n\t\t\tvUv2 = ( position.y < 0.5 ) ? vec2(uv2.x ,uvyStart) : vec2(uv2.x ,uvyEnd);\n\t\t\t// camera space\n\t\t\tvec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );\n\t\t\tvec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 );\n\n\t\t\t// special case for perspective projection, and segments that terminate either in, or behind, the camera plane\n\t\t\t// clearly the gpu firmware has a way of addressing this issue when projecting into ndc space\n\t\t\t// but we need to perform ndc-space calculations in the shader, so we must address this issue directly\n\t\t\t// perhaps there is a more elegant solution -- WestLangley\n\n\t\t\tbool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column\n\n\t\t\tif ( perspective ) {\n\n\t\t\t\tif ( start.z < 0.0 && end.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( start, end );\n\n\t\t\t\t} else if ( end.z < 0.0 && start.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( end, start );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// clip space\n\t\t\tvec4 clipStart = projectionMatrix * start;\n\t\t\tvec4 clipEnd = projectionMatrix * end;\n\n\t\t\t// ndc space\n\t\t\tvec2 ndcStart = clipStart.xy / clipStart.w;\n\t\t\tvec2 ndcEnd = clipEnd.xy / clipEnd.w;\n\n\t\t\t// direction\n\t\t\tvec2 dir = ndcEnd - ndcStart;\n\n\t\t\t// account for clip-space aspect ratio\n\t\t\tdir.x *= aspect;\n\t\t\tfloat scaleDir = length(dir);\n\t\t\tuvScale = 0.05/scaleDir;\n\t\t\tdir = normalize( dir );\n\n\t\t\t// perpendicular to dir\n\t\t\tvec2 offset = vec2( dir.y, - dir.x );\n\n\t\t\t// undo aspect ratio adjustment\n\t\t\tdir.x /= aspect;\n\t\t\toffset.x /= aspect;\n\n\t\t\t// sign flip\n\t\t\tif ( position.x < 0.0 ) offset *= - 1.0;\n\n\t\t\t// endcaps\n\t\t\tif ( position.y < 0.0 ) {\n\n\t\t\t\toffset += - dir;\n\n\t\t\t} else if ( position.y > 1.0 ) {\n\n\t\t\t\toffset += dir;\n\n\t\t\t}\n\n\t\t\t// adjust for lineWidth\n\t\t\toffset *= lineWidth;\n\n\t\t\t// adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ...\n\t\t\toffset /= resolution.y;\n\n\t\t\t// select end\n\t\t\tvec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;\n\n\t\t\t// back to clip space\n\t\t\toffset *= clip.w;\n\n\t\t\tclip.xy += offset;\n\n\t\t\tgl_Position = clip;\n\n\t\t\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\tuniform float usePassOpacity;\n\t\tuniform float passOpacity;\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashSize;\n\t\t\tuniform float gapSize;\n\n\t\t#endif\n\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\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\n\t\t\t#include <logdepthbuf_fragment>\n\n\t\t\t#ifdef USE_MMAP\n\n\t\t\t\tif(vUv2.y >= miny && miny != 1.0){\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\tfloat ret = opacity;\n\t\t\t\t\tif(usePassOpacity == 1.0) {\n\t\t\t\t\t\tret = passOpacity;\n\t\t\t\t\t}\n\t\t\t\t\tdiffuseColor = vec4(pcolor, ret);\n\n\t\t\t\t\tif(usePassOpacity == 1.0 && ret < 0.1) {\n\t\t\t\t\t\tdiscard;\n\t\t\t\t\t}\n\t\t\t\t}\n\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"};function Il(t){Ea.call(this,{type:"FMLineMaterial",uniforms:_a.clone(eu.line.uniforms),vertexShader:eu.line.vertexShader,fragmentShader:eu.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)}((Il.prototype=Object.create(Ea.prototype)).constructor=Il).prototype.isFMLineMaterial=!0,Il.prototype.copy=function(t){return Ea.prototype.copy.call(this,t),this.color.copy(t.color),this.lineWidth=t.lineWidth,this.resolution=t.resolution,this};var Cl=Il;function Dl(t){f.call(this),this.type="SpriteMaterial",this.color=new lt(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.setValues(t)}function kl(t){f.call(this),this.type="LineBasicMaterial",this.color=new lt(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.setValues(t)}function Ul(t){Ea.call(this,t),this.type="RawShaderMaterial"}((Dl.prototype=Object.create(f.prototype)).constructor=Dl).prototype.isSpriteMaterial=!0,Dl.prototype.copy=function(t){return f.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},((kl.prototype=Object.create(f.prototype)).constructor=kl).prototype.isLineBasicMaterial=!0,kl.prototype.copy=function(t){return f.prototype.copy.call(this,t),this.color.copy(t.color),this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this},((Ul.prototype=Object.create(Ea.prototype)).constructor=Ul).prototype.isRawShaderMaterial=!0;var Bl={Left:0,Center:2,Right:4};function Gl(t){return(Gl="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 Hl(t,n){var e,i,r,o,s="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(s)return i=!(e=!0),{s:function(){s=s.call(t)},n:function(){var t=s.next();return e=t.done,t},e:function(t){i=!0,r=t},f:function(){try{e||null==s.return||s.return()}finally{if(i)throw r}}};if(Array.isArray(t)||(s=function(t,n){var e;if(t)return"string"==typeof t?Xl(t,n):"Map"===(e="Object"===(e=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Xl(t,n):void 0}(t))||n&&t&&"number"==typeof t.length)return s&&(t=s),o=0,{s:n=function(){},n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},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.")}function Xl(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 Vl(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,function(t){t=function(t,n){if("object"!=Gl(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Gl(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Gl(t)?t:t+""}(i.key),i)}}function zl(t,n,e){return n&&Vl(t.prototype,n),e&&Vl(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}var e=zl(function t(n){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");this.io=n}),Wl=(Object.assign(e.prototype,{Wa:function(t,n){var e=st.a.document.createElement("canvas"),i=e.getContext("2d");return e.width=t,e.height=n,e.style.width=t+"px",e.style.height=n+"px",{canvas:e,ctx:i}},Ya: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},n={x:r.x+n,y:r.y+e},r={x:o.x+i,y:o.y},e={x:s.x-i,y:s.y},u={x:s.x,y:s.y+i},c={x:n.x,y:n.y-i},h={x:n.x-i,y:n.y},f={x:a.x+i,y:a.y},l={x:a.x,y:a.y-i},d={x:o.x,y:o.y+i};t.beginPath(),t.moveTo(r.x,r.y),t.lineTo(e.x,e.y),t.arcTo(s.x,s.y,u.x,u.y,i),t.lineTo(c.x,c.y),t.arcTo(n.x,n.y,h.x,h.y,i),t.lineTo(f.x,f.y),t.arcTo(a.x,a.y,l.x,l.y,i),t.lineTo(d.x,d.y),t.arcTo(o.x,o.y,r.x,r.y,i),t.closePath()},Qa:function(t,n,e,i){var r,o,s,a,u=1,c=void 0!==i.needSize&&i.needSize,h=2*e.fontsize*1.2,f=void 0!==e.fontWeight?e.fontWeight:400,l=this.Za(i.family,e.fontFamily),d=0,v=0,f="".concat(f," ").concat(h,"px ").concat(l),l=void 0!==e.space?2*e.space:4,p=0,m=(void 0!==e.plateSize&&(p=(e.plateSize-e.fontsize)/2*2),p=Math.max(p,6),h/3),y=0,b=[],g=st.a.document.createElement("canvas"),_=g.getContext("2d"),w=(_.font=f,_.textBaseline="Alphabetic",1.2*e.fontsize*2),x=(void 0!==e.imageSize&&(w=1.2*e.imageSize*2),n&&0!=w||(l=w=0),-1<t.indexOf("%rn%"));if(x){var E,S=Hl(b=t.split("%rn%"));try{for(S.s();!(E=S.n()).done;){var T=E.value,d=Math.max(_.measureText(T).width+4,d);v+=h}}catch(t){S.e(t)}finally{S.f()}v+=4*b.length}else d=_.measureText(t).width+4,v=4+h;r=Math.ceil(v)+2*p,s=0+w+l+(o=Math.ceil(d)+2*p),a=0+Math.max(r,w),e.plateStrokeColor&&(s+=4,a+=4),y=x?v/b.length/2+m+p:a/2+m,x&&(u=a/(0+h+2*p)),g.width=s,g.height=a,g.style.width=s+"px",g.style.height=a+"px",g.spriteScale=u,_.font=f,st.a.environment===B.a.WX&&(_.shadowOffsetX=0,_.shadowOffsetY=0,_.shadowBlur=0,_.shadowColor="rgba(0,0,0,0.0)"),_.clearRect(0,0,g.width,g.height),(e.plateColor||e.plateStrokeColor)&&(e.plateColor&&(_.fillStyle=e.plateColor),_.lineWidth=2,this.Ya(_,o,r,10,{x:w+0+l,y:a/2-r/2}),e.plateColor&&_.fill(),e.plateStrokeColor&&(_.strokeStyle=e.plateStrokeColor,_.stroke()),_.beginPath()),n&&_.drawImage(n,0,(a-w)/2,w,w);var A=w+0+l+p+2,m=(_.lineWidth=4*(void 0!==e.strokeWidth?e.strokeWidth:1),1);if(void 0!==e.strokeWidth&&(m=parseFloat(e.strokeWidth)),e.strokeColor&&0!==m)if(_.strokeStyle=e.strokeColor,x)for(var M=y,O=0;O<b.length;O++)O&&(M+=4+h),n?(_.textAlign="left",_.strokeText(b[O],A,M)):i.textAlign===Bl.Left?(_.textAlign="left",_.strokeText(b[O],0,M)):i.textAlign===Bl.Right?(_.textAlign="right",_.strokeText(b[O],s,M)):(_.textAlign="center",_.strokeText(b[O],s/2,M));else n?(_.textAlign="left",_.strokeText(t,A,y)):i.textAlign===Bl.Left?_.strokeText(t,0,y):i.textAlign===Bl.Right?(_.textAlign="right",_.strokeText(t,s,y)):(_.textAlign="center",_.strokeText(t,s/2,y));if(_.fillStyle=e.fillColor,x||!1===i.drawText){if(!1!==i.drawText)for(var L=y,R=0;R<b.length;R++)R&&(L+=4+h),n?(_.textAlign="left",_.fillText(b[R],A,L)):i.textAlign===Bl.Left?(_.textAlign="left",_.fillText(b[R],0,L)):i.textAlign===Bl.Right?(_.textAlign="right",_.fillText(b[R],s,L)):(_.textAlign="center",_.fillText(b[R],s/2,L))}else n?(_.textAlign="left",_.fillText(t,A,y)):i.textAlign===Bl.Left?(_.textAlign="left",_.fillText(t,0,y)):i.textAlign===Bl.Right?(_.textAlign="right",_.fillText(t,s,y)):(_.textAlign="center",_.fillText(t,s/2,y));u=0;return c&&(u=x?e.fontsize+(4*(b.length-1)+0+p)/b.length:e.fontsize+0+p,g.size=u),g.drawTextWidth=d,g.drawTextLeft=A,g},qa:function(t){var n=t.width,e=t.height,i=t.arrowWidth||10,r=this.Wa(n,e),o=r.canvas,r=r.ctx,s=(r.fillStyle=t.godEdgeColor,r.fillRect(0,0,n,e),n*(1-t.godEdgePercent));r.fillStyle=t.godColor,r.fillRect((n-s)/2,0,s,e),r.fillStyle="#ffffff",r.shadowOffsetX=-2,r.shadowOffsetY=2,r.shadowBlur=4,r.shadowColor="rgba(0,0,0,0.5)";var n=n/2,a=e/2,e=e*t.godArrowPercent,s=s*t.godArrowWidthPercent,n=n-s/2,a=a+e/2;return r.beginPath(),r.moveTo(n,a),r.lineTo(n,a+i),r.lineTo(n+s/2,a-e+i),r.lineTo(n+s,a+i),r.lineTo(n+s,a),r.lineTo(n+s/2,a-e),r.closePath(),r.fillStyle=t.godArrowColor,r.fill(),o},Ka:function(t){var n=t.width,e=t.height,i=this.Wa(n,e),r=i.canvas,i=i.ctx,n=(this.Ja(i,n,e),t.height*t.arrowHeightPercent),e=(1-t.arrowHeightPercent)*t.height/2,o=t.width*(t.arrowWidthPercent-t.arrowPercent);return i.beginPath(),i.moveTo(0,e),i.lineTo(o,e),i.lineTo(t.width*t.arrowWidthPercent,e+n/2),i.lineTo(o,e+n),i.lineTo(0,e+n),i.lineTo(t.width*t.arrowPercent,e+n/2),i.closePath(),i.fillStyle=t.color,i.fill(),r},Ja:function(t,n,e){var i=new q,r=(i.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),new q),n=(r.set(1,0,-n/2,0,1,-e/2,0,0,1),i.multiply(r),i.elements);t.transform(n[0],n[3],n[1],n[4],n[2],n[6])},$a:function(e){var t=e.width,n=e.height,i=e.dashArray,r=this.Wa(t,n),o=r.canvas,s=r.ctx,a=(this.Ja(s,t,n),i.reduce(function(t,n){return t+n})),u=0;return i.forEach(function(t,n){n%2==0&&(s.fillStyle=e.color,s.fillRect(u/a*e.width,0,t/a*e.width,e.height)),u+=t}),o},Za:function(t,n){var e=this.io.Pt.Oi.fontFamily;return void 0!==t?t+","+e:void 0!==n&&'"Microsoft Yahei","微软雅黑",Tahoma,Arial'===e?n:e},Yn:function(){}}),e);function Yl(t){return(Yl="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,function(t){t=function(t,n){if("object"!=Yl(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Yl(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Yl(t)?t:t+""}(i.key),i)}}function Zl(t,n,e){n=Kl(n);var i=t,n=ql()?Reflect.construct(n,e||[],Kl(t).constructor):n.apply(t,e);if(n&&("object"===Yl(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function ql(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(ql=function(){return!!t})()}function Kl(t){return(Kl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Jl(t,n){return(Jl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var e=function(){function t(){if(this instanceof t)return Zl(this,t);throw new TypeError("Cannot call a class as a function")}var n,e,i=t,r=Ki;if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");return i.prototype=Object.create(r&&r.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),r&&Jl(i,r),i=t,n&&Ql(i.prototype,n),e&&Ql(i,e),Object.defineProperty(i,"prototype",{writable:!1}),i}(),$l=(Object.assign(e.prototype,{tu:function(t){var n,e=[];for(n in t)e.push(t[n]);return e.join()}}),e);function t0(t){return(t0="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 n0(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,function(t){t=function(t,n){if("object"!=t0(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=t0(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==t0(t)?t:t+""}(i.key),i)}}function e0(t,n,e){n=r0(n);var i=t,n=i0()?Reflect.construct(n,e||[],r0(t).constructor):n.apply(t,e);if(n&&("object"===t0(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function i0(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(i0=function(){return!!t})()}function r0(t){return(r0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function o0(t,n){return(o0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}function s0(t){Ea.call(this),this.type="FMMeshLambertMaterial",this.uniforms=_a.clone(eu.fmLambert.uniforms),this.vertexShader=eu.fmLambert.vertexShader,this.fragmentShader=eu.fmLambert.fragmentShader,this.lights=!0,this.fog=!0,Fl(this),Object.defineProperties(this,{emissive:{enumerable:!0,get:function(){return this.uniforms.emissive.value},set:function(t){this.uniforms.emissive.value=t}},mapMixColor:{enumerable:!0,get:function(){return this.uniforms.mapMixColor.value},set:function(t){this.uniforms.mapMixColor.value=t}}}),this.setValues(t)}var e=function(){function e(t){var n;if(this instanceof e)return(n=e0(this,e)).La=null,n.Uo=n.Uo.bind(n),n.Ra=new Ol({disposeCallback:n.Uo,enable:!0,name:"TextureManager",mapCreateTime:t.mapCreateTime}),n;throw new TypeError("Cannot call a class as a function")}var t,n,i=e,r=$l;if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");return i.prototype=Object.create(r&&r.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),r&&o0(i,r),i=e,t&&n0(i.prototype,t),n&&n0(i,n),Object.defineProperty(i,"prototype",{writable:!1}),i}(),a0=(Object.assign(e.prototype,{nu:function(n,e){if(st.a.environment==B.a.BROWSER)r=new xh(n);else{var i=e.paramKey,r=new l;if(e.labelImageCatch[i].image)return r.image=e.labelImageCatch[i].image,r.minFilter=Zn,r.generateMipmaps=!1,r.needsUpdate=!0,t=e.labelImageCatch[i].texture,r.scaleRatio=t.scaleRatio,r.mspriteScale=t.mspriteScale,e.needSize&&(r.size=t.size),r.needsUpdate=!0,e&&e.callback&&e.callback(r),r.useCatch=!0,r;e.labelImageCatch[i].texture={scaleRatio:n.height/n.width,mspriteScale:n.spriteScale,size:n.size};var t=n.toDataURL("image/png");st.a.textureHelper.createImage({url:t,onload:function(t){r.image=t,r.needsUpdate=!0,e&&e.callback&&e.callback(r),e.labelImageCatch[i].canvas={size:n.size,spriteScale:n.spriteScale,width:n.width,height:n.height},e.labelImageCatch[i].image=t}})}return r.minFilter=Zn,r.generateMipmaps=!1,r.needsUpdate=!0,r},eu:function(t){var n=new l;return n.minFilter=Zn,n.generateMipmaps=!1,n.flipY=t.flipY,n},iu:function(t,n){var r,e,o=this,s=(void 0===t.flipY&&(t.flipY=!0),this.tu(t));return this.an.has(s)?this.un.has(s)?this.cn(s,n):n(r=this.an.get(s)):(r=this.eu(t),this.an.set(s,r),this.cn(s,n),e="_getTexture"+St.generateUUID(),this.Ra.ga(e),rr.pn(t.url,function(i){r.image=i,r.needsUpdate=!0,o.un.get(s).forEach(function(t,n,e){i&&n(r),e.delete(t)}),o.un.delete(s),o.Ra._a(e)},{needDraw:t.needDraw})),r},ru:function(t,n){var e=this.nu(t,n);return e.useCatch||(e.scaleRatio=t.height/t.width,e.mspriteScale=t.spriteScale,n.needSize&&(e.size=t.size)),e},Yn:function(t){this.La=t,this.Ra.ba(!0)},Uo:function(){this.an.forEach(function(t,n,e){t.dispose(),e.delete(n)}),this.an.clear(),this.an=null,this.un.forEach(function(t,n,e){t.forEach(function(t,n,e){e.delete(n)}),e.delete(n)}),this.un.clear(),this.un=null,this.La&&this.La({name:"TextureManager"})}}),e),u0=(jl(Lt),eu.fmLambert={uniforms:_a.merge([Lt.fmcommon,Lt.lights,{emissive:{value:new lt(0)},mapMixColor:{value:!1},fogColor:{value:new lt(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#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 <defaultnormal_vertex>  \n\n\t#include <begin_vertex>            \n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>   \n\t#include <clipping_planes_vertex>      \n\t\n\t#include <worldpos_vertex>        \n\t#include <lights_lambert_vertex>  \n\t#include <fog_vertex>\n\t\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#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\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"},((s0.prototype=Object.create(Ea.prototype)).constructor=s0).prototype.isFMMeshLambertMaterial=!0,s0.prototype.copy=function(t){return Pl(this,t)},s0);function c0(t){Ea.call(this),this.type="FMMeshBasicMaterial",this.uniforms=_a.clone(eu.fmBasic.uniforms),this.vertexShader=eu.fmBasic.vertexShader,this.fragmentShader=eu.fmBasic.fragmentShader,Fl(this),this.setValues(t)}jl(Lt),eu.fmBasic={uniforms:_a.merge([Lt.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"},((c0.prototype=Object.create(Ea.prototype)).constructor=c0).prototype.isFMMeshBasicMaterial=!0,c0.prototype.copy=function(t){return Ea.prototype.copy.call(this,t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=_a.clone(t.uniforms),this};function h0(t){return(h0="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 f0(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,function(t){t=function(t,n){if("object"!=h0(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=h0(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==h0(t)?t:t+""}(i.key),i)}}function l0(t,n,e){n=v0(n);var i=t,n=d0()?Reflect.construct(n,e||[],v0(t).constructor):n.apply(t,e);if(n&&("object"===h0(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function d0(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(d0=function(){return!!t})()}function v0(t){return(v0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function p0(t,n){return(p0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var m0=_a.merge([{sweepW:{value:0},sweepH:{value:0},se2N:{value:new Mt(0,0)},se2RN:{value:new Mt(0,0)},moveP:{value:new Mt(0,0)},color_r:{value:new lt(16711935)},color_a:{value:new lt(16776960)},isRect:{value:!1},isAnnulus:{value:!1},isEnable:{value:!1},circleC:{value:new Mt(0,0)},maxR:{value:0},minR:{value:0},isSweepTexture:{value:!1},sweepTexture:{value:null},sweepStrength:{value:1}},eu.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new Mt(1,1)},clearcoatNormalMap:{value:null},sheen:{value:new lt(0)},transparency:{value:0}}]),e=function(){function n(){var t;if(this instanceof n)return(t=l0(this,n)).type="FMMeshStandardMaterial",t.uniforms=_a.clone(m0),t.vertexShader="\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 ",t.fragmentShader="\n\n\n\t#define STANDARD\n\n\t#ifdef PHYSICAL\n\t\t#define REFLECTIVITY\n\t\t#define CLEARCOAT\n\t\t#define TRANSPARENCY\n\t#endif\n\n\tvarying vec3 v_position;\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\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\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\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\n\t#ifdef TRANSPARENCY\n\t\tuniform float transparency;\n\t#endif\n\n\t#ifdef REFLECTIVITY\n\t\tuniform float reflectivity;\n\t#endif\n\n\t#ifdef CLEARCOAT\n\t\tuniform float clearcoat;\n\t\tuniform float clearcoatRoughness;\n\t#endif\n\n\t#ifdef USE_SHEEN\n\t\tuniform vec3 sheen;\n\t#endif\n\n\tvarying vec3 vViewPosition;\n\n\t#ifndef FLAT_SHADED\n\n\t\tvarying vec3 vNormal;\n\n\t\t#ifdef USE_TANGENT\n\n\t\t\tvarying vec3 vTangent;\n\t\t\tvarying vec3 vBitangent;\n\n\t\t#endif\n\n\t#endif\n\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\n\tvoid main() {\n\t\t#include <clipping_planes_fragment>\n\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\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\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\n\t\t// modulation\n\t\t#include <aomap_fragment>\n\n\t\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\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\n\t\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\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}\n\t\t}\n\t\tif(isAnnulus&&isEnable){\n\t\t\tif(isMaxCircle(v_position.xyz,circleC,maxR) && isMinCircle(v_position.xyz,circleC,minR)){\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\n\t\t}\n\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",t.lights=!0,t.fog=!0,t;throw new TypeError("Cannot call a class as a function")}var t,e=n,i=Ea;if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");return e.prototype=Object.create(i&&i.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),i&&p0(e,i),e=n,(i=[{key:"copy",value:function(t){return Pl(this,t)}}])&&f0(e.prototype,i),t&&f0(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(),y0=(e.prototype.isFMMeshStandardMaterial=!0,e);function b0(t){return(b0="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 g0(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,function(t){t=function(t,n){if("object"!=b0(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=b0(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==b0(t)?t:t+""}(i.key),i)}}var _0=function(){function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function")}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=St.floorPowerOfTwo(t.width),e=St.floorPowerOfTwo(t.height),i=st.a.document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return i.width=n,i.height=e,i.getContext("2d").drawImage(t,0,0,n,e),i}}],(e=null)&&g0(n.prototype,e),i&&g0(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,e,i}(),w0=Object.freeze({CENTER:0,LEFT:1,RIGHT:-1}),x0=Object.freeze({CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1});function E0(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var i,r,o,s,a=[],u=!0,c=!1;try{if(o=(e=e.call(t)).next,0===n){if(Object(e)!==e)return;u=!1}else for(;!(u=(i=o.call(e)).done)&&(a.push(i.value),a.length!==n);u=!0);}catch(t){c=!0,r=t}finally{try{if(!u&&null!=e.return&&(s=e.return(),Object(s)!==s))return}finally{if(c)throw r}}return a}}(t,n)||S0(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 S0(t,n){var e;if(t)return"string"==typeof t?T0(t,n):"Map"===(e="Object"===(e=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?T0(t,n):void 0}function T0(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 A0(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 M0(i){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?A0(Object(r),!0).forEach(function(t){var n,e;n=i,e=r[t=t],(t=R0(t))in n?Object.defineProperty(n,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):n[t]=e}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(r)):A0(Object(r)).forEach(function(t){Object.defineProperty(i,t,Object.getOwnPropertyDescriptor(r,t))})}return i}function O0(t){return(O0="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 L0(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,R0(i.key),i)}}function R0(t){t=function(t,n){if("object"!=O0(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=O0(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==O0(t)?t:t+""}var e=function(){function n(t){if(!(this instanceof n))throw new TypeError("Cannot call a class as a function");this.Pt=t,this.ou=new Wl(this),this.su=new a0({mapCreateTime:this.Pt._n.Rn}),this.au={},this.uu=new Map,this.cu=new Map,this.hu=new Map,this.fu=new Map,this.lu=new Map,this.du=new Map,this.vu={},this.pu={},this.La=null,this.Uo=this.Uo.bind(this),this.Ra=new Ol({disposeCallback:this.Uo,enable:!0,name:"MaterialManager",mapCreateTime:this.Pt._n.Rn}),this.mu=null,this.yu={},this.bu()}return t=n,(e=[{key:"lamberMaterials",get:function(){return this.cu}},{key:"getMaterialCacheKey",value:function(t){return this.gu(t)}},{key:"regHook",value:function(t,n){this.yu[t]||(this.yu[t]=[]),this.yu[t].push(n)}},{key:"callHook",value:function(t){for(var n=arguments.length,e=new Array(1<n?n-1:0),i=1;i<n;i++)e[i-1]=arguments[i];t=this.yu[t];t&&t.forEach(function(t){return t.apply(void 0,e)})}}])&&L0(t.prototype,e),i&&L0(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,i}(),N0=(Object.assign(e.prototype,{_u:function(t,n){this.vu[n.uuid]||(this.vu[n.uuid]=[]),this.vu[n.uuid].push(t.uuid)},wu:function(t,e){t=this.vu[e.uuid].indexOf(t.uuid);if(-1!==t&&this.vu[e.uuid].splice(t,1),0===this.vu[e.uuid].length){var i=[];if(e instanceof y0){this.lu.forEach(function(t,n){t.uuid===e.uuid&&i.push(n)});for(var n=0;n<i.length;n++)this.lu.delete(i[n])}delete this.vu[e.uuid]}},gu:function(t){var n,e=[];for(n in t)t[n]?t[n].constructor===l?e.push(t[n].uuid):t[n].constructor===Mt?(e.push(t[n].x),e.push(t[n].y)):e.push(t[n]):e.push(t[n]);return e.join()},xu:function(t,n){var e=this.gu(t);return this.uu.has(e)||(t=this.Eu(t,n),this.uu.set(e,t)),this.uu.get(e)},Eu:function(t,n){var e;return t.isline?new kl({color:t.color,linewidth:1,transparent:!0,opacity:t.opacity}):(e=new c0,void 0!==t.color&&(e.color=new lt(t.color)),void 0!==t.opacity&&(e.opacity=t.opacity),void 0!==t.url&&this.su.iu({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,e.transparent=!0,e.depthTest=t,e.depthWrite=t,e)},Su:function(t){var n=this.gu(t);return this.cu.has(n)||(t=this.Tu(t),this.cu.set(n,t)),this.cu.get(n)},eo:function(t){var n=this.gu(t);return this.lu.has(n)||(t=this.Au(t),this.lu.set(n,t)),this.lu.get(n)},Au:function(t){var n=new y0;return n.defines.USE_UV=!0,n.uniforms.diffuse.value=new lt(t.color),n.uniforms.emissive.value=new lt(t.emissive),n.defines.USE_METALNESSMAP=t.USE_METALNESSMAP,n.defines.USE_ROUGHNESSMAP=t.USE_ROUGHNESSMAP,n.uniforms.metalness.value=t.metalness,n.uniforms.metalnessMap.value=t.metalnessMap,n.uniforms.roughness.value=t.roughness,n.uniforms.roughnessMap.value=t.roughnessMap,n.defines.USE_NORMALMAP=t.USE_NORMALMAP,n.defines.TANGENTSPACE_NORMALMAP=t.TANGENTSPACE_NORMALMAP,n.uniforms.normalScale.value=t.normalScale,n.uniforms.normalMap.value=t.normalMap,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.alphaTest=t.alphaTest,n.transparent=t.transparent,n.uniforms.opacity.value=t.opacity,n.skinning=t.skinning,n.side=t.side,n.vertexColors=t.vertexColors,this.mu&&(n.uniforms.envMap.value=this.mu,n.envMap=this.mu),n.needsUpdate=!0,n},ro:function(t,n){(n=n||{}).uuid=t.uuid;var e=this.gu(n);return this.du.has(e)||(t=t.clone(),n.color&&(t.color=new lt(n.color)),n.opacity&&(t.opacity=n.opacity),n.transparent&&(t.transparent=n.transparent),this.du.set(e,t)),this.du.get(e)},Tu:function(n){var e=new u0;return e.color=new lt(n.color),e.opacity=n.alpha,e.transparent=e.opacity<1,void 0!==n.url&&this.su.iu({url:n.url},function(t){t.image&&(e.map=t,e.needsUpdate=!0),n.finish&&n.finish(e)}),e},Mu:function(t){var n=void 0===t.needDepth||t.needDepth,t=new Cl({color:t.color,opacity:t.opacity,lineWidth:t.lineWidth,vertexColors:2,dashed:!1,transparent:!0}),n=(t.depthWrite=n,t.depthTest=n,this.Pt._n);return st.a.environment===B.a.BROWSER?t.resolution.set(n.It.renderer.domElement.clientWidth,n.It.renderer.domElement.clientHeight):t.resolution.set(n.It.renderer.domElement.width,n.It.renderer.domElement.height),t},Ou:function(t){var n=this.gu(t);return this.hu.has(n)||(t=this.Mu(t),this.hu.set(n,t)),this.hu.get(n)},Lu:function(t,n,e){var i=new Dl,t=(i.sizeAttenuation=!1,i.depthTest=!1,i.depthWrite=!1,i.transparent=!0,i.opacity=e.opacity,i.side=un,this.Ru(t,null,n,e));return i.map=t,e.needSize&&(i.size=t.size),i.userData.scaleRatio=t.scaleRatio,i.userData.mspriteScale=t.mspriteScale,i.needsUpdate=!0,i},Nu:function(n,e,i,r){var o,s,t,a=this,u=new Dl;return u.sizeAttenuation=!1,u.depthTest=!1,u.depthWrite=!1,u.side=un,u.opacity=i.opacity,u.transparent=!0,u.blending=vn,i.imageUrl?(u.visible=!1,o="_createLabelMaterial"+St.generateUUID(),this.Ra.ga(o),s=this,rr.pn(i.imageUrl,function(t){t=a.Ru(n,t,e,M0(M0({},i),{},{callback:function(t){u.map=t,u.visible=!0,u.userData.scaleRatio=t.scaleRatio,u.userData.mspriteScale=t.mspriteScale,r&&r(u),u.needsUpdate=!0}}));st.a.environment===B.a.BROWSER&&(u.map=t,u.visible=!0,u.needsUpdate=!0,u.userData.scaleRatio=t.scaleRatio,u.userData.mspriteScale=t.mspriteScale,r)&&r(u),s.Ra._a(o)},{needDraw:!0})):(t=this.Ru(n,null,e,M0(M0({},i),{},{callback:function(t){u.map=t,u.needsUpdate=!0,u.userData.scaleRatio=t.scaleRatio,u.userData.mspriteScale=t.mspriteScale,r&&r(u),u.visible=!0}})),st.a.environment===B.a.BROWSER?(u.map=t,u.needsUpdate=!0,u.userData.scaleRatio=t.scaleRatio,u.userData.mspriteScale=t.mspriteScale,r&&r(u)):u.map||(u.visible=!1)),u},Ru:function(t,n,e,i){var r=this.Pu(t,e);return this.pu[r]||(this.pu[r]={}),t=this.pu[r].canvas||this.ou.Qa(t,n,e,i),this.su.ru(t,{paramKey:r,labelImageCatch:this.pu,needSize:i.needSize,callback:i.callback})},Pu:function(t,n){return[t,n.alpha,n.fontsize,n.fillColor,n.image].join()},Fu:function(t,n){var e=this.gu(t);return this.fu.has(e)||(t=this.ju(t,n),this.fu.set(e,t)),n&&n(this.fu.get(e)),this.fu.get(e)},ju:function(t,n){var e=void 0!==t.opacity?t.opacity:1,i=new Dl;return i.sizeAttenuation=!1,i.depthTest=t.needDepth,i.depthWrite=t.needDepth,i.transparent=!0,i.opacity=e,i.visible=!1,this.su.iu({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(n){var e,t=this.ou.qa(n);return st.a.environment===B.a.BROWSER?new xh(_0.getPowerOfTwoSizeCanvas(t)):(t=t.toDataURL("image/png"),e=new l,st.a.textureHelper.createImage({url:t,onload:function(t){e.image=t,e.needsUpdate=!0,n.callback&&n.callback()}}),e)},createNormalLineTexture:function(n){var e,t=this.ou.$a(n);return st.a.environment===B.a.BROWSER?new xh(_0.getPowerOfTwoSizeCanvas(t)):(t=t.toDataURL("image/png"),e=new l,st.a.textureHelper.createImage({url:t,onload:function(t){e.image=t,e.needsUpdate=!0,n.callback&&n.callback()}}),e)},Iu:function(n){var e,t=this.ou.Ka(n);return st.a.environment===B.a.BROWSER?new xh(_0.getPowerOfTwoSizeCanvas(t)):(t=t.toDataURL("image/png"),e=new l,st.a.textureHelper.createImage({url:t,onload:function(t){e.image=t,e.needsUpdate=!0,n.callback&&n.callback()}}),e)},Cu:function(t,n){var e;return this.au[t+n]||((e=new Ul({uniforms:{color:{value:new lt(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 "})).transparent=!0,this.au[t+n]=e)},Du:function(t,n){t=new Ea({uniforms:{color:{value:new lt(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 t.depthTest=!0,t.depthWrite=!1,t.transparent=!0,t},ku:function(t,n){var e=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},i=new l,r=(i.minFilter=e.generateMipmaps?1008:Zn,i.generateMipmaps=!!e.generateMipmaps,i.anisotropy=4,i.wrapS=Xn,i.wrapT=Xn,"_loadTexture"+St.generateUUID()),o=(this.Ra.ga(r),this);return rr.pn(t,function(t){t&&(i.image=t,i.needsUpdate=!0),n(i),o.Ra._a(r)}),i},Yn:function(t){var n=this;this.La=t,this.su.Yn(function(){n.su=null,n.Ra.ba(!0)}),this.pu={}},Uo:function(){rr.hn(),this.ou.Yn(),this.ou=null,this.uu.clear(),this.cu.clear(),this.hu.clear(),this.fu.clear(),this.La&&this.La({name:"MaterialManager"})},bu:function(){var o=this;this.Pt._n.Oi.hdr&&this.Pt._n.Oi.hdr.load(this.Pt._n,function(t){o.mu=t;var n,e=function(t,n){var e,i,r,o,s="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(s)return i=!(e=!0),{s:function(){s=s.call(t)},n:function(){var t=s.next();return e=t.done,t},e:function(t){i=!0,r=t},f:function(){try{e||null==s.return||s.return()}finally{if(i)throw r}}};if(Array.isArray(t)||(s=S0(t))||n&&t&&"number"==typeof t.length)return s&&(t=s),o=0,{s:n=function(){},n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},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.")}(o.lu);try{for(e.s();!(n=e.n()).done;){var i=E0(n.value,2),r=(i[0],i[1]);r.envMap||(r.uniforms.envMap.value=o.mu,r.envMap=o.mu)}}catch(t){e.e(t)}finally{e.f()}})}}),e);function P0(t,n){var e,i,r,o,s="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(s)return i=!(e=!0),{s:function(){s=s.call(t)},n:function(){var t=s.next();return e=t.done,t},e:function(t){i=!0,r=t},f:function(){try{e||null==s.return||s.return()}finally{if(i)throw r}}};if(Array.isArray(t)||(s=function(t,n){var e;if(t)return"string"==typeof t?F0(t,n):"Map"===(e="Object"===(e=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?F0(t,n):void 0}(t))||n&&t&&"number"==typeof t.length)return s&&(t=s),o=0,{s:n=function(){},n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},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.")}function F0(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 j0(t){return(j0="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 I0(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,function(t){t=function(t,n){if("object"!=j0(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=j0(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==j0(t)?t:t+""}(i.key),i)}}var e=function(){function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");this.Uu={clearColor:16777215,clearAlpha:1},this.Bu=null,this.Gu=new Map,this.Hu=new Map,this.Xu=new Map,this.Vu=new Map,this.zu=new Map,this.Wu=new Map,this.Yu=new Map,this.Qu=new Map,this.Zu=new Map,this.qu=new Map,this.Ku=new Map,this.Ju=new Map,this.$u=new Map,this.tc=null}return n=t,(e=[{key:"resize",value:function(){this.Uu={clearColor:16777215,clearAlpha:1},this.Gu.clear(),this.Hu.clear(),this.Xu.clear(),this.Vu.clear(),this.zu.clear(),this.Wu.clear(),this.Yu.clear(),this.Qu.clear(),this.Zu.clear(),this.qu.clear(),this.Ku.clear(),this.Ju.clear(),this.$u.clear()}}])&&I0(n.prototype,e),i&&I0(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,e,i}(),C0=(Object.assign(e.prototype,{nc: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=Lr.toColor(o);break;case"toFloat":o=parseFloat(o);break;case"toRgba":o=Lr.toRgba(o);break;case"toString":o+=""}e[r].name?(t[e[r].name]=o,delete t[r]):t[r]=o}}return t},ec: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.ic(t),this.rc(t.extenttheme,E.EXTENT),this.rc(t.storetheme,E.MODEL),this.oc(t.floorapply,E.MODEL),this.sc(t.storeapply,E.MODEL),this.rc(t.storelabeltheme,E.LABEL),this.oc(t.floorstorelabelapply,E.LABEL),this.sc(t.storelabelapply,E.LABEL),this.rc(t.poiimagetheme,E.FACILITY),this.oc(t.floorpoiimageapply,E.FACILITY),this.sc(t.poiimageapply,E.FACILITY),this.rc(t.externalmodeltheme,E.EXTERNAL_MODEL),this.oc(t.floorexternalapply,E.EXTERNAL_MODEL),this.sc(t.externalmodelapply,E.EXTERNAL_MODEL),this.ac())},ic:function(t){t.viewtheme&&((t=t.viewtheme).clearcolor&&(this.Uu.clearColor=Lr.toColor(t.clearcolor)),t.clearalpha&&(this.Uu.clearAlpha=parseFloat(t.clearalpha)),t.lighttheme)&&(this.Bu=t.lighttheme)},rc:function(t,n){if(t){var e,i=P0(t);try{for(i.s();!(e=i.n()).done;){var r=e.value;if(r.id)switch(n){case E.EXTERNAL_MODEL:this.Ku.set(r.id,this.nc({},r,{color:{type:"toColor"}}));break;case E.FACILITY:r.imagename&&this.Qu.set(r.id,this.nc({},r,{imagename:{name:"imageName"}}));break;case E.LABEL:this.zu.set(r.id,this.nc({},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 E.MODEL:this.Gu.set(r.id,this.nc({},r,{color:{type:"toColor"},alpha:{type:"toFloat"},strokecolor:{name:"strokeColor",type:"toColor"},strokewidth:{name:"strokeWidth",type:"toFloat"}}));break;case E.EXTENT:this.Vu.set(r.id,this.nc({},r,{color:{type:"toColor"},alpha:{type:"toFloat"}}))}}}catch(t){i.e(t)}finally{i.f()}}},oc:function(t,n){if(t){var e,i=P0(t);try{for(i.s();!(e=i.n()).done;){var r,o=P0(e.value.typeapply);try{for(o.s();!(r=o.n()).done;){var s,a=r.value,u=this.nc({},a,{normalid:{name:"normalID",type:"toString"},selectedid:{name:"selectID",type:"toString"}}),c=P0(a.type.split(","));try{for(c.s();!(s=c.n()).done;){var h=s.value;this.uc(n).set(h,u)}}catch(t){c.e(t)}finally{c.f()}}}catch(t){o.e(t)}finally{o.f()}}}catch(t){i.e(t)}finally{i.f()}}},sc:function(t,n){if(t){var e,i=P0(t);try{for(i.s();!(e=i.n()).done;){var r=e.value;if(r.fids){var o,s=this.nc({},r,{normalid:{name:"normalID",type:"toString"},selectedid:{name:"selectID",type:"toString"}}),a=P0(r.fids.split(","));try{for(a.s();!(o=a.n()).done;){var u=o.value;this.cc(n).set(u,s)}}catch(t){a.e(t)}finally{a.f()}}}}catch(t){i.e(t)}finally{i.f()}}},ac:function(){this.Hu.get("0")&&this.Gu.get(this.Hu.get("0").selectID)&&(this.tc=this.Gu.get(this.Hu.get("0").selectID).color)},cc:function(t){switch(t){case E.LABEL:return this.Yu;case E.FACILITY:return this.qu;case E.MODEL:return this.Xu;case E.EXTERNAL_MODEL:return this.$u}},uc:function(t){switch(t){case E.LABEL:return this.Wu;case E.FACILITY:return this.Zu;case E.MODEL:return this.Hu;case E.EXTERNAL_MODEL:return this.Ju}},hc:function(t){switch(t){case E.LABEL:return this.zu;case E.FACILITY:return this.Qu;case E.MODEL:return this.Gu;case E.EXTERNAL_MODEL:return this.Ku}},Yn:function(){for(var t in this.resize(),this)this[""+t]=null,delete this[""+t]}}),e);function D0(t){return(D0="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 k0(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,function(t){t=function(t,n){if("object"!=D0(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=D0(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==D0(t)?t:t+""}(i.key),i)}}function U0(t,n,e){return n&&k0(t.prototype,n),e&&k0(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}var e=U0(function t(n){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");this.Pt=n}),B0=(Object.assign(e.prototype,{fc:function(t){var t=this.Pt.lc.get(t),n=this.Pt.lc.get(this.Pt.Oi.buildingID),e={};return(e=t?{theme:t.theme,themeExtension:t.themeExtension}:e).theme||(e.theme=n.theme),e.themeExtension||(e.themeExtension=n.themeExtension),e},dc:function(t){t=this.fc(t);return Object.assign({},t.theme.Uu,t.themeExtension.Uu)},vc:function(t){t=this.fc(t);return Object.assign({},t.theme.Vu.get("0"),t.themeExtension.Vu.get("0"))},mc:function(t){return this.yc(E.MODEL,t)},bc:function(t){return this.yc(E.FACILITY,t)},gc:function(t){return this.yc(E.LABEL,t)},_c:function(t){return this.yc(E.EXTERNAL_MODEL,t)},yc:function(t,n){var e=this.fc(n.bid),i={},r={},o=e.themeExtension.cc(t).get(n.fid),s=e.theme.cc(t).get(n.fid);if(o||s){var a=(o&&void 0!==o.normalID?o:s).normalID,u=e.themeExtension.hc(t).get(a),a=e.theme.hc(t).get(a);if(u||a)return r.themeUseDetail={content:n.fid,name:"fid",isExtension:!!o},Object.assign(r,a,u,s,o)}return o=e.themeExtension.uc(t).get(n.typeID),s=e.theme.uc(t).get(n.typeID),(o||s)&&(r.themeUseDetail={content:n.typeID,name:"typeId",isExtension:!!o},Object.assign(i,s,o)),i.normalID||(o=e.themeExtension.uc(t).get("0"),s=e.theme.uc(t).get("0"),Object.assign(i,o,s)),u=e.themeExtension.hc(t).get(i.normalID),a=e.theme.hc(t).get(i.normalID),Object.assign(r,a,u)},wc:function(t){t=this.fc(t);return t.themeExtension.tc||t.theme.tc},Yn:function(){this.Pt=null},xc:function(h){var f=this,l=h.Oi.buildingOptions,d=l.buildings||l.theme,v=null;(function t(){var n=h.getBuildings(),e=n.map(function(t){return t.yi});if(!1===h.Ec)v=setTimeout(t,1);else{null!==v&&clearTimeout(v);var i=[];if(d)for(var r=0;r<l.buildings.length;r++){var o,s=l.buildings[r],a=s.buildingID;e.includes(a)&&(o=f.Pt.Sn.vr(a),f.Pt.lc.set(a,{theme:new C0}),o.themeLoaded=!0,o.themeNeedLoad=!1,f.Pt.Sc({bid:a,theme:s.theme||l.theme,themeExtension:s.themeExtension||l.themeExtension}),i.push(a))}if(i.length!==n.length)for(var u=0;u<n.length;u++){var c=n[u].buildingID;i.includes(c)||((c=f.Pt.Sn.vr(c)).themeLoaded=!0,c.themeNeedLoad=!1)}f.Pt.Sn.Tc=f.Pt.Ac()}})()}}),e),G0=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}},H0=function(t){var n=t.lastIndexOf("/");return-1===n?"./":t.substr(0,n+1)},X0={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 V0(t){ad.call(this,t)}function z0(t){ad.call(this,t)}function W0(t){f.call(this),this.type="ShadowMaterial",this.color=new lt(0),this.transparent=!0,this.setValues(t)}function Y0(t){f.call(this),this.type="PointsMaterial",this.color=new lt(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.setValues(t)}function Q0(t){f.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new lt(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 lt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=mi,this.normalScale=new Mt(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 Z0(t){Q0.call(this),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.clearcoat=0,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new Mt(1,1),this.clearcoatNormalMap=null,this.reflectivity=.5,this.sheen=null,this.transparency=0,this.setValues(t)}function q0(t){f.call(this),this.type="MeshPhongMaterial",this.color=new lt(16777215),this.specular=new lt(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new lt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=mi,this.normalScale=new Mt(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 K0(t){f.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new lt(16777215),this.specular=new lt(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 lt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=mi,this.normalScale=new Mt(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 J0(t){f.call(this),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=mi,this.normalScale=new Mt(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 $0(t){f.call(this),this.type="MeshLambertMaterial",this.color=new lt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new lt(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 td(t){f.call(this),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new lt(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=mi,this.normalScale=new Mt(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 nd(t){kl.call(this),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}function ed(t){ad.call(this,t),this.textures={}}V0.prototype=Object.assign(Object.create(ad.prototype),{constructor:V0,load:function(e,i,t,n){void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);var r,o,s,a=this,u=X0.get(e);return void 0!==u?(a.manager.itemStart(e),setTimeout(function(){i&&i(u),a.manager.itemEnd(e)},0),u):st.a.environment===B.a.WX?(e.includes(wx.env.USER_DATA_PATH)?(o=wx.getFileSystemManager()).readFile({filePath:e,encoding:"base64",success:function(t){var t="data:image/png;base64,".concat(t.data),n=st.a.textureHelper.createImage({url:t,onload:function(){X0.add(e,n),i&&i(n),a.manager.itemEnd(e),o.unlink({filePath:e,fail:function(t){},success:function(){}})}})},fail:function(t){console.error(t),n&&n(t),a.manager.itemError(e),a.manager.itemEnd(e)}}):r=st.a.textureHelper.createImage({url:e,onload:function(){X0.add(e,r),i&&i(r),a.manager.itemEnd(e)},onerror:function(t){console.error(t),n&&n(t),a.manager.itemError(e),a.manager.itemEnd(e)}}),r):((s=st.a.document.createElementNS("http://www.w3.org/1999/xhtml","img")).addEventListener("load",c,!1),s.addEventListener("error",h,!1),"data:"!==e.substr(0,5)&&void 0!==this.crossOrigin&&(s.crossOrigin=this.crossOrigin),a.manager.itemStart(e),s.src=e,s);function c(){s.removeEventListener("load",c,!1),s.removeEventListener("error",h,!1),X0.add(e,this),i&&i(this),a.manager.itemEnd(e)}function h(t){s.removeEventListener("load",c,!1),s.removeEventListener("error",h,!1),n&&n(t),a.manager.itemError(e),a.manager.itemEnd(e)}}}),z0.prototype=Object.assign(Object.create(ad.prototype),{constructor:z0,load:function(n,e,t,i){var r=new l,o=new V0(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?fe:le,r.needsUpdate=!0,void 0!==e&&e(r)},t,i),r}}),((W0.prototype=Object.create(f.prototype)).constructor=W0).prototype.isShadowMaterial=!0,W0.prototype.copy=function(t){return f.prototype.copy.call(this,t),this.color.copy(t.color),this},((Y0.prototype=Object.create(f.prototype)).constructor=Y0).prototype.isPointsMaterial=!0,Y0.prototype.copy=function(t){return f.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},((Q0.prototype=Object.create(f.prototype)).constructor=Q0).prototype.isMeshStandardMaterial=!0,Q0.prototype.copy=function(t){return f.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},((Z0.prototype=Object.create(Q0.prototype)).constructor=Z0).prototype.isMeshPhysicalMaterial=!0,Z0.prototype.copy=function(t){return Q0.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 lt).copy(t.sheen):this.sheen=null,this.transparency=t.transparency,this},((q0.prototype=Object.create(f.prototype)).constructor=q0).prototype.isMeshPhongMaterial=!0,q0.prototype.copy=function(t){return f.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},((K0.prototype=Object.create(f.prototype)).constructor=K0).prototype.isMeshToonMaterial=!0,K0.prototype.copy=function(t){return f.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},((J0.prototype=Object.create(f.prototype)).constructor=J0).prototype.isMeshNormalMaterial=!0,J0.prototype.copy=function(t){return f.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},(($0.prototype=Object.create(f.prototype)).constructor=$0).prototype.isMeshLambertMaterial=!0,$0.prototype.copy=function(t){return f.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},((td.prototype=Object.create(f.prototype)).constructor=td).prototype.isMeshMatcapMaterial=!0,td.prototype.copy=function(t){return f.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},((nd.prototype=Object.create(kl.prototype)).constructor=nd).prototype.isLineDashedMaterial=!0,nd.prototype.copy=function(t){return kl.prototype.copy.call(this,t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this},ed.prototype=Object.assign(Object.create(ad.prototype),{constructor:ed,load:function(t,n,e,i){var r=this,o=new cd(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 h[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 lt).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 lt).setHex(s.value);break;case"v2":r.uniforms[o].value=(new Mt).fromArray(s.value);break;case"v3":r.uniforms[o].value=(new Tt).fromArray(s.value);break;case"v4":r.uniforms[o].value=(new Ot).fromArray(s.value);break;case"m3":r.uniforms[o].value=(new q).fromArray(s.value);case"m4":r.uniforms[o].value=(new At).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 Mt).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 Mt).fromArray(t.clearcoatNormalScale)),r},setTextures:function(t){return this.textures=t,this}});var id,rd,od,sd;function ad(t){this.manager=void 0!==t?t:sr,this.crossOrigin="anonymous",this.path="",this.resourcePath=""}Object.assign(ad.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(ad.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:(id={NoBlending:0,NormalBlending:1,AdditiveBlending:2,SubtractiveBlending:3,MultiplyBlending:4,CustomBlending:5},rd=new lt,od=new z0,sd=new ed,function(t,s,a){var u={};function n(t,n,e,i,r){var t=s+t,o=(new or).getHandler(t),o=(null!==o?o:(od.setCrossOrigin(a),od)).load(t),t=(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),St.generateUUID());return u[t]=o,t}var e,i={uuid:St.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=id[r];break;case"colorAmbient":case"mapAmbient":break;case"colorDiffuse":i.color=rd.fromArray(r).getHex();break;case"colorSpecular":i.specular=rd.fromArray(r).getHex();break;case"colorEmissive":i.emissive=rd.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),sd.setTextures(u),sd.parse(i)})});var ud={};function cd(t){ad.call(this,t)}cd.prototype=Object.assign(Object.create(ad.prototype),{constructor:cd,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=X0.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===ud[s]){var r=s.match(/^data:(.*?)(;base64)?,(.*)$/);if(r){var o=r[1],u=!!r[2],c=r[3],c=decodeURIComponent(c);u&&(c=atob(c));try{var h=(this.responseType||"").toLowerCase();switch(h){case"arraybuffer":case"blob":for(var f=new Uint8Array(c.length),l=0;l<c.length;l++)f[l]=c.charCodeAt(l);d="blob"===h?new Blob([f.buffer],{type:o}):f.buffer;break;case"document":var d=(new DOMParser).parseFromString(c,o);break;case"json":d=JSON.parse(c);break;default:d=c}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{ud[s]=[],ud[s].push({onLoad:t,onProgress:n,onError:e});var v,p=new st.a.XMLHttpRequest;for(v in p.open("GET",s,!0),p.addEventListener("load",function(t){var n=this.response,e=ud[s];if(delete ud[s],200===this.status||0===this.status){0===this.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),X0.add(s,n);for(var i=0,r=e.length;i<r;i++)(o=e[i]).onLoad&&o.onLoad(n)}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=ud[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=ud[s];delete ud[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=ud[s];delete ud[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}ud[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 hd={arraySlice:function(t,n,e){return hd.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)),void 0!==(o=t[r++]););else if(void 0!==s.toArray)for(;void 0!==(s=o[i])&&(n.push(o.time),s.toArray(e,e.length)),void 0!==(o=t[r++]););else for(;void 0!==(s=o[i])&&(n.push(o.time),e.push(s)),void 0!==(o=t[r++]););}},subclip:function(t,n,e,i,r){r=r||30;for(var o=t.clone(),s=(o.name=n,[]),a=0;a<o.tracks.length;++a){for(var u=o.tracks[a],c=u.getValueSize(),h=[],f=[],l=0;l<u.times.length;++l){var d=u.times[l]*r;if(!(d<e||i<=d)){h.push(u.times[l]);for(var v=0;v<c;++v)f.push(u.values[l*c+v])}}0!==h.length&&(u.times=hd.convertArray(h,u.times.constructor),u.values=hd.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 fd(t,n,e,i){this.parameterPositions=t,this.Mc=0,this.resultBuffer=void 0!==i?i:new n.constructor(e),this.sampleValues=n,this.valueSize=e}function ld(t,n,e,i){fd.call(this,t,n,e,i),this.Oc=-0,this.Lc=-0,this.Rc=-0,this.Nc=-0}function dd(t,n,e,i){fd.call(this,t,n,e,i)}function vd(t,n,e,i){fd.call(this,t,n,e,i)}function pd(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=hd.convertArray(n,this.TimeBufferType),this.values=hd.convertArray(e,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}function md(t,n,e){pd.call(this,t,n,e)}function yd(t,n,e,i){pd.call(this,t,n,e,i)}function bd(t,n,e,i){pd.call(this,t,n,e,i)}function gd(t,n,e,i){fd.call(this,t,n,e,i)}function _d(t,n,e,i){pd.call(this,t,n,e,i)}function wd(t,n,e,i){pd.call(this,t,n,e,i)}function xd(t,n,e,i){pd.call(this,t,n,e,i)}function Ed(t,n,e){this.name=t,this.tracks=e,this.duration=void 0!==n?n:-1,this.uuid=St.generateUUID(),this.duration<0&&this.resetDuration()}function Sd(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 bd;case"vector":case"vector2":case"vector3":case"vector4":return xd;case"color":return yd;case"quaternion":return _d;case"bool":case"boolean":return md;case"string":return wd}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+t)}(t.type);return void 0===t.times&&(hd.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 Td(t){"boolean"==typeof t&&(console.warn("JSONLoader: showStatus parameter has been removed from constructor."),t=void 0),this.manager=void 0!==t?t:sr,this.withCredentials=!1}Object.assign(fd.prototype,{evaluate:function(t){var n,e=this.parameterPositions,i=this.Mc,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.Mc=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.Mc=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.Mc=0,this.beforeStart_(0,t,r);if(void 0===r)return i=e.length,this.Mc=i,this.afterEnd_(i-1,o,t)}this.Mc=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(fd.prototype,{beforeStart_:fd.prototype.copySampleValue_,afterEnd_:fd.prototype.copySampleValue_}),ld.prototype=Object.assign(Object.create(fd.prototype),{constructor:ld,DefaultSettings_:{endingStart:fi,endingEnd:fi},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 li: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 li: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),c=this.valueSize;this.Oc=u/(n-s),this.Rc=u/(a-e),this.Lc=r*c,this.Nc=o*c},interpolate_:function(t,n,e,i){for(var r=this.resultBuffer,o=this.sampleValues,s=this.valueSize,a=t*s,u=a-s,c=this.Lc,h=this.Nc,t=this.Oc,f=this.Rc,e=(e-n)/(i-n),i=e*e,n=i*e,l=-t*n+2*t*i-t*e,d=(1+t)*n+(-1.5-2*t)*i+(-.5+t)*e+1,v=(-1-f)*n+(1.5+f)*i+.5*e,p=f*n-f*i,m=0;m!==s;++m)r[m]=l*o[c+m]+d*o[u+m]+v*o[a+m]+p*o[h+m];return r}}),dd.prototype=Object.assign(Object.create(fd.prototype),{constructor:dd,interpolate_:function(t,n,e,i){for(var r=this.resultBuffer,o=this.sampleValues,s=this.valueSize,a=t*s,u=a-s,c=(e-n)/(i-n),h=1-c,f=0;f!==s;++f)r[f]=o[u+f]*h+o[a+f]*c;return r}}),vd.prototype=Object.assign(Object.create(fd.prototype),{constructor:vd,interpolate_:function(t){return this.copySampleValue_(t-1)}}),Object.assign(pd.prototype,{constructor:pd,TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:hi,InterpolantFactoryMethodDiscrete:function(t){return new vd(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodLinear:function(t){return new dd(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:function(t){return new ld(this.times,this.values,this.getValueSize(),t)},setInterpolation:function(t){var n;switch(t){case ci:n=this.InterpolantFactoryMethodDiscrete;break;case hi:n=this.InterpolantFactoryMethodLinear;break;case 2302:n=this.InterpolantFactoryMethodSmooth}if(void 0===n){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)}console.warn("THREE.KeyframeTrack:",e)}else this.createInterpolant=n;return this},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return ci;case this.InterpolantFactoryMethodLinear:return hi;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=hd.arraySlice(i,o,s),this.values=hd.arraySlice(this.values,o*e,s*e)),this},validate:function(){for(var t=!0,n=this.getValueSize(),e=(n-Math.floor(n)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1),this.times),i=this.values,r=e.length,o=(0===r&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1),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&&hd.isTypedArray(i))for(var s=0,u=i.length;s!==u;++s){var c=i[s];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,s,c),t=!1;break}}return t},optimize:function(){for(var t=hd.arraySlice(this.times),n=hd.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 c=s*e,h=c-e,f=c+e,l=0;l!==e;++l){var d=n[c+l];if(d!==n[h+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=hd.arraySlice(t,0,r),this.values=hd.arraySlice(n,0,r*e)):(this.times=t,this.values=n),this},clone:function(){var t=hd.arraySlice(this.times,0),n=hd.arraySlice(this.values,0),t=new this.constructor(this.name,t,n);return t.createInterpolant=this.createInterpolant,t}}),md.prototype=Object.assign(Object.create(pd.prototype),{constructor:md,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:ci,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),yd.prototype=Object.assign(Object.create(pd.prototype),{constructor:yd,ValueTypeName:"color"}),bd.prototype=Object.assign(Object.create(pd.prototype),{constructor:bd,ValueTypeName:"number"}),gd.prototype=Object.assign(Object.create(fd.prototype),{constructor:gd,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),c=a+s;a!==c;a+=4)at.slerpFlat(r,0,o,a-s,o,a,u);return r}}),_d.prototype=Object.assign(Object.create(pd.prototype),{constructor:_d,ValueTypeName:"quaternion",DefaultInterpolation:hi,InterpolantFactoryMethodLinear:function(t){return new gd(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:void 0}),wd.prototype=Object.assign(Object.create(pd.prototype),{constructor:wd,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:ci,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),xd.prototype=Object.assign(Object.create(pd.prototype),{constructor:xd,ValueTypeName:"vector"}),Object.assign(Ed,{parse:function(t){for(var n=[],e=t.tracks,i=1/(t.fps||1),r=0,o=e.length;r!==o;++r)n.push(Sd(e[r]).scale(i));return new Ed(t.name,t.duration,n)},CreateFromMorphTargetSequence:function(t,n,e,i){for(var r=n.length,o=[],s=0;s<r;s++){var a=[],u=((c=[]).push((s+r-1)%r,s,(s+1)%r),a.push(0,1,0),hd.getKeyframeOrder(c)),c=hd.sortedArray(c,1,u),a=hd.sortedArray(a,1,u);i||0!==c[0]||(c.push(r),a.push(a[0])),o.push(new bd(".morphTargetInfluences["+n[s].name+"]",c,a).scale(1/e))}return new Ed(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[c=u[1]])||(i[c]=u=[]),u.push(a))}var c,h=[];for(c in i)h.push(Ed.CreateFromMorphTargetSequence(c,i[c],n,e));return h},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&&(hd.flattenJSON(e,e=[],o=[],i),0!==e.length)&&r.push(new t(n,e,o))},i=[],r=t.name||"default",o=t.length||-1,s=t.fps||30,a=t.hierarchy||[],u=0;u<a.length;u++){var c=a[u].keys;if(c&&0!==c.length)if(c[0].morphTargets){for(var h,f={},l=0;l<c.length;l++)if(c[l].morphTargets)for(var d=0;d<c[l].morphTargets.length;d++)f[c[l].morphTargets[d]]=-1;for(h in f){for(var v=[],p=[],d=0;d!==c[l].morphTargets.length;++d){var m=c[l];v.push(m.time),p.push(m.morphTarget===h?1:0)}i.push(new bd(".morphTargetInfluence["+h+"]",v,p))}o=f.length*(s||1)}else{var y=".bones["+n[u].name+"]";e(xd,y+".position",c,"pos",i),e(_d,y+".quaternion",c,"rot",i),e(xd,y+".scale",c,"scl",i)}}return 0===i.length?null:new Ed(r,o,i)}}),Object.assign(Ed.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 Ed(this.name,this.duration,t)}}),Object.assign(Td.prototype,{crossOrigin:"anonymous",load:function(e,i,t,n){var r=this,o=void 0===this.path?H0(e):this.path,s=(this.resourcePath=o+"maps/",new cd(this.manager));s.setPath(this.path),s.setWithCredentials(this.withCredentials),s.load(e,function(t){var t=JSON.parse(t),n=t.metadata;if(void 0!==n){n=n.type;if(void 0!==n&&"object"===n.toLowerCase())return void console.error("JSONLoader: "+e+" should be loaded with ObjectLoader instead.")}n=r.parse(t,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,C){void 0!==(t=void 0!==t.data?t.data:t).scale?t.scale=1/t.scale:t.scale=1;var n,e,i,r,o,s,a,u,c,h,D,k,U,B,G,H,f,l,d,v,p,m,y,b,g=new Bs,_=t,w=g,x=_.faces,E=_.vertices,S=_.normals,X=_.colors,V=_.scale,z=0;if(void 0!==_.uvs){for(n=0;n<_.uvs.length;n++)_.uvs[n].length&&z++;for(n=0;n<z;n++)w.faceVertexUvs[n]=[]}for(r=0,o=E.length;r<o;)(f=new Tt).x=E[r++]*V,f.y=E[r++]*V,f.z=E[r++]*V,w.vertices.push(f);for(r=0,o=x.length;r<o;)if(D=(h=x[r++])&2,k=h&8,U=h&16,B=h&32,G=h&64,H=h&128,h&1){if((d=new Is).a=x[r],d.b=x[r+1],d.c=x[r+3],(v=new Is).a=x[r+1],v.b=x[r+2],v.c=x[r+3],r+=4,D&&(c=x[r++],d.materialIndex=c,v.materialIndex=c),i=w.faces.length,k)for(n=0;n<z;n++)for(y=_.uvs[n],w.faceVertexUvs[n][i]=[],w.faceVertexUvs[n][i+1]=[],e=0;e<4;e++)b=new Mt(y[2*(u=x[r++])],y[2*u+1]),2!==e&&w.faceVertexUvs[n][i].push(b),0!==e&&w.faceVertexUvs[n][i+1].push(b);if(U&&(a=3*x[r++],d.normal.set(S[a++],S[a++],S[a]),v.normal.copy(d.normal)),B)for(n=0;n<4;n++)a=3*x[r++],m=new Tt(S[a++],S[a++],S[a]),2!==n&&d.vertexNormals.push(m),0!==n&&v.vertexNormals.push(m);if(G&&(p=X[s=x[r++]],d.color.setHex(p),v.color.setHex(p)),H)for(n=0;n<4;n++)p=X[s=x[r++]],2!==n&&d.vertexColors.push(new lt(p)),0!==n&&v.vertexColors.push(new lt(p));w.faces.push(d),w.faces.push(v)}else{if((l=new Is).a=x[r++],l.b=x[r++],l.c=x[r++],D&&(c=x[r++],l.materialIndex=c),i=w.faces.length,k)for(n=0;n<z;n++)for(y=_.uvs[n],w.faceVertexUvs[n][i]=[],e=0;e<3;e++)b=new Mt(y[2*(u=x[r++])],y[2*u+1]),w.faceVertexUvs[n][i].push(b);if(U&&(a=3*x[r++],l.normal.set(S[a++],S[a++],S[a])),B)for(n=0;n<3;n++)a=3*x[r++],m=new Tt(S[a++],S[a++],S[a]),l.vertexNormals.push(m);if(G&&(s=x[r++],l.color.setHex(X[s])),H)for(n=0;n<3;n++)s=x[r++],l.vertexColors.push(new lt(X[s]));w.faces.push(l)}var T=t,A=g,M=void 0!==T.influencesPerVertex?T.influencesPerVertex:2;if(T.skinWeights)for(var O=0,W=T.skinWeights.length;O<W;O+=M){var Y=T.skinWeights[O],Q=1<M?T.skinWeights[O+1]:0,Z=2<M?T.skinWeights[O+2]:0,q=3<M?T.skinWeights[O+3]:0;A.skinWeights.push(new Ot(Y,Q,Z,q))}if(T.skinIndices)for(O=0,W=T.skinIndices.length;O<W;O+=M){var K=T.skinIndices[O],J=1<M?T.skinIndices[O+1]:0,$=2<M?T.skinIndices[O+2]:0,tt=3<M?T.skinIndices[O+3]:0;A.skinIndices.push(new Ot(K,J,$,tt))}A.bones=T.bones,A.bones&&0<A.bones.length&&(A.skinWeights.length!==A.skinIndices.length||A.skinIndices.length!==A.vertices.length)&&console.warn("When skinning, number of vertices ("+A.vertices.length+"), skinIndices ("+A.skinIndices.length+"), and skinWeights ("+A.skinWeights.length+") should match.");var L=t,R=g,nt=L.scale;if(void 0!==L.morphTargets)for(var N=0,et=L.morphTargets.length;N<et;N++){R.morphTargets[N]={},R.morphTargets[N].name=L.morphTargets[N].name,R.morphTargets[N].vertices=[];for(var it=R.morphTargets[N].vertices,rt=L.morphTargets[N].vertices,P=0,ot=rt.length;P<ot;P+=3){var st=new Tt;st.x=rt[P]*nt,st.y=rt[P+1]*nt,st.z=rt[P+2]*nt,it.push(st)}}if(void 0!==L.morphColors&&0<L.morphColors.length){console.warn('fm.JSONLoader: "morphColors" no longer supported. Using them as face colors.');for(var at=R.faces,ut=L.morphColors[0].colors,N=0,et=at.length;N<et;N++)at[N].color.fromArray(ut,3*N)}var F=t,ct=g,j=[],I=[];void 0!==F.animation&&I.push(F.animation),void 0!==F.animations&&(F.animations.length?I=I.concat(F.animations):I.push(F.animations));for(var ht=0;ht<I.length;ht++){var ft=Ed.parseAnimation(I[ht],ct.bones);ft&&j.push(ft)}return ct.morphTargets&&(F=Ed.CreateClipsFromMorphTargetSequences(ct.morphTargets,10),j=j.concat(F)),0<j.length&&(ct.animations=j),g.computeFaceNormals(),g.computeBoundingSphere(),void 0===t.materials||0===t.materials.length?{geometry:g}:{geometry:g,materials:ad.prototype.initMaterials(t.materials,this.resourcePath||C,this.crossOrigin)}}});var Ad=Td;function Md(t,n){a.call(this),this.type="Light",this.color=new lt(t),this.intensity=void 0!==n?n:1,this.receiveShadow=void 0}function Od(t){this.camera=t,this.bias=0,this.radius=1,this.mapSize=new Mt(512,512),this.map=null,this.mapPass=null,this.matrix=new At,this.Pc=new zt,this.Fc=new Mt(1,1),this.jc=1,this.Ic=[new Ot(0,0,1,1)]}function Ld(){Od.call(this,new pt(-5,5,5,-5,.5,500))}function Rd(t,n){Md.call(this,t,n),this.type="DirectionalLight",this.position.copy(a.DefaultUp),this.updateMatrix(),this.target=new a,this.shadow=new Ld}function Nd(){Od.call(this,new vt(90,1,.5,500)),this.Fc=new Mt(4,2),this.jc=6,this.Ic=[new Ot(2,1,1,1),new Ot(0,1,1,1),new Ot(3,1,1,1),new Ot(1,1,1,1),new Ot(3,0,1,1),new Ot(1,0,1,1)],this.Cc=[new Tt(1,0,0),new Tt(-1,0,0),new Tt(0,0,1),new Tt(0,0,-1),new Tt(0,1,0),new Tt(0,-1,0)],this.Dc=[new Tt(0,1,0),new Tt(0,1,0),new Tt(0,1,0),new Tt(0,1,0),new Tt(0,0,1),new Tt(0,0,-1)]}function Pd(t,n,e,i){Md.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 Nd}function Fd(){Od.call(this,new vt(50,1,.5,500))}function jd(t,n,e,i,r,o){Md.call(this,t,n),this.type="SpotLight",this.position.copy(a.DefaultUp),this.updateMatrix(),this.target=new a,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 Fd}function Id(t,n){t&&t.isGeometry&&console.error("THREE.SkinnedMesh no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."),$a.call(this,t,n),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new At,this.bindMatrixInverse=new At}Md.prototype=Object.assign(Object.create(a.prototype),{constructor:Md,isLight:!0,copy:function(t){return a.prototype.copy.call(this,t),this.color.copy(t.color),this.intensity=t.intensity,this}}),Object.assign(Od.prototype,{kc:new At,Uc:new Tt,Bc:new Tt,getViewportCount:function(){return this.jc},getFrustum:function(){return this.Pc},updateMatrices:function(t){var n=this.camera,e=this.matrix,i=this.kc,r=this.Bc,o=this.Uc;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.Pc.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.Ic[t]},getFrameExtents:function(){return this.Fc},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)}}),Ld.prototype=Object.assign(Object.create(Od.prototype),{constructor:Ld,isDirectionalLightShadow:!0,updateMatrices:function(t){Od.prototype.updateMatrices.call(this,t)}}),Rd.prototype=Object.assign(Object.create(Md.prototype),{constructor:Rd,isDirectionalLight:!0,copy:function(t){return Md.prototype.copy.call(this,t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}),Nd.prototype=Object.assign(Object.create(Od.prototype),{constructor:Nd,isPointLightShadow:!0,updateMatrices:function(t,n){void 0===n&&(n=0);var e=this.camera,i=this.matrix,r=this.Uc,o=this.Bc,s=this.kc;r.setFromMatrixPosition(t.matrixWorld),e.position.copy(r),o.copy(e.position),o.add(this.Cc[n]),e.up.copy(this.Dc[n]),e.lookAt(o),e.updateMatrixWorld(),i.makeTranslation(-r.x,-r.y,-r.z),s.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),this.Pc.setFromProjectionMatrix(s)}}),Pd.prototype=Object.assign(Object.create(Md.prototype),{constructor:Pd,isPointLight:!0,copy:function(t){return Md.prototype.copy.call(this,t),this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this}}),Fd.prototype=Object.assign(Object.create(Od.prototype),{constructor:Fd,isSpotLightShadow:!0,updateMatrices:function(t){var n=this.camera,e=2*St.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()),Od.prototype.updateMatrices.call(this,t)}}),jd.prototype=Object.assign(Object.create(Md.prototype),{constructor:jd,isSpotLight:!0,copy:function(t){return Md.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}}),Id.prototype=Object.assign(Object.create($a.prototype),{constructor:Id,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 Ot,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){$a.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 Cd=new Tt,Dd=new Tt,kd=new At,Ud=new cs,Bd=new kt;function Gd(t,n,e){1===e&&console.error("THREE.Line: parameter THREE.LinePieces no longer supported. Use THREE.LineSegments instead."),a.call(this),this.type="Line",this.geometry=void 0!==t?t:new oa,this.material=void 0!==n?n:new kl}Gd.prototype=Object.assign(Object.create(a.prototype),{constructor:Gd,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++)Cd.fromBufferAttribute(n,i-1),Dd.fromBufferAttribute(n,i),e[i]=e[i-1],e[i]+=Cd.distanceTo(Dd);t.setAttribute("lineDistance",new x(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(),Bd.copy(e.boundingSphere),Bd.applyMatrix4(i),Bd.radius+=r,!1!==t.ray.intersectsSphere(Bd)){kd.getInverse(i),Ud.copy(t.ray).applyMatrix4(kd);var i=r/((this.scale.x+this.scale.y+this.scale.z)/3),o=i*i,s=new Tt,a=new Tt,u=new Tt,c=new Tt,h=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+=h){var p=l[d],m=l[d+1];s.fromArray(f,3*p),a.fromArray(f,3*m),o<Ud.distanceSqToSegment(s,a,c,u)||(c.applyMatrix4(this.matrixWorld),(y=t.ray.origin.distanceTo(c))<t.near)||y>t.far||n.push({distance:y,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+=h)s.fromArray(f,3*d),a.fromArray(f,3*d+3),o<Ud.distanceSqToSegment(s,a,c,u)||(c.applyMatrix4(this.matrixWorld),(y=t.ray.origin.distanceTo(c))<t.near)||y>t.far||n.push({distance:y,point:u.clone().applyMatrix4(this.matrixWorld),index:d,face:null,faceIndex:null,object:this})}else if(e.isGeometry)for(var y,b=e.vertices,g=b.length,d=0;d<g-1;d+=h)o<Ud.distanceSqToSegment(b[d],b[d+1],c,u)||(c.applyMatrix4(this.matrixWorld),(y=t.ray.origin.distanceTo(c))<t.near)||y>t.far||n.push({distance:y,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 Hd=new Tt,Xd=new Tt;function Vd(t,n){Gd.call(this,t,n),this.type="LineSegments"}function zd(t,n){Gd.call(this,t,n),this.type="LineLoop"}Vd.prototype=Object.assign(Object.create(Gd.prototype),{constructor:Vd,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)Hd.fromBufferAttribute(n,i),Xd.fromBufferAttribute(n,i+1),e[i]=0===i?0:e[i-1],e[i+1]=e[i]+Hd.distanceTo(Xd);t.setAttribute("lineDistance",new x(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)Hd.copy(o[i]),Xd.copy(o[i+1]),e[i]=0===i?0:e[i-1],e[i+1]=e[i]+Hd.distanceTo(Xd);return this}}),zd.prototype=Object.assign(Object.create(Gd.prototype),{constructor:zd,isLineLoop:!0});var Wd=new At,Yd=new cs,Qd=new kt,Zd=new Tt;function qd(t,n){a.call(this),this.type="Points",this.geometry=void 0!==t?t:new oa,this.material=void 0!==n?n:new Y0,this.updateMorphTargets()}function Kd(t,n,e,i,r,o,s){var a=Yd.distanceSqToPoint(t);a<e&&(e=new Tt,Yd.closestPointToPoint(t,e),e.applyMatrix4(i),(t=r.ray.origin.distanceTo(e))<r.near||t>r.far||o.push({distance:t,distanceToRay:Math.sqrt(a),point:e,index:n,face:null,object:s}))}function Jd(){a.call(this),this.type="Bone"}qd.prototype=Object.assign(Object.create(a.prototype),{constructor:qd,isPoints:!0,raycast:function(t,n){var e=this.geometry,i=this.matrixWorld,r=t.params.Points.threshold;if(null===e.boundingSphere&&e.computeBoundingSphere(),Qd.copy(e.boundingSphere),Qd.applyMatrix4(i),Qd.radius+=r,!1!==t.ray.intersectsSphere(Qd)){Wd.getInverse(i),Yd.copy(t.ray).applyMatrix4(Wd);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,c=a.length;u<c;u++){var h=a[u];Zd.fromArray(s,3*h),Kd(Zd,h,o,i,t,n,this)}else for(var u=0,f=s.length/3;u<f;u++)Zd.fromArray(s,3*u),Kd(Zd,u,o,i,t,n,this)}else for(var l=e.vertices,u=0,f=l.length;u<f;u++)Kd(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{r=i.morphTargets;void 0!==r&&0<r.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)}}),Jd.prototype=Object.assign(Object.create(a.prototype),{constructor:Jd,isBone:!0});var e="\\[\\]\\.:\\/",$d=new RegExp("["+e+"]","g"),tv="[^"+e+"]",e="[^"+e.replace("\\.","")+"]",nv=/((?:WC+[\/:])*)/.source.replace("WC",tv),e=/(WCOD+)?/.source.replace("WCOD",e),ev=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",tv),tv=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",tv),iv=new RegExp("^"+nv+e+ev+tv+"$"),rv=["material","materials","bones"];function ov(t,n,e){e=e||sv.parseTrackName(n);this.Gc=t,this.Hc=t.subscribe_(n,e)}function sv(t,n,e){this.path=n,this.parsedPath=e||sv.parseTrackName(n),this.node=sv.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t}Object.assign(ov.prototype,{getValue:function(t,n){this.bind();var e=this.Gc.nCachedObjects_,e=this.Hc[e];void 0!==e&&e.getValue(t,n)},setValue:function(t,n){for(var e=this.Hc,i=this.Gc.nCachedObjects_,r=e.length;i!==r;++i)e[i].setValue(t,n)},bind:function(){for(var t=this.Hc,n=this.Gc.nCachedObjects_,e=t.length;n!==e;++n)t[n].bind()},unbind:function(){for(var t=this.Hc,n=this.Gc.nCachedObjects_,e=t.length;n!==e;++n)t[n].unbind()}}),Object.assign(sv,{Composite:ov,create:function(t,n,e){return new(t&&t.isAnimationObjectGroup?sv.Composite:sv)(t,n,e)},sanitizeNodeName:function(t){return t.replace(/\s/g,"_").replace($d,"")},parseTrackName:function(t){var n=iv.exec(t);if(!n)throw new Error("PropertyBinding: Cannot parse trackName: "+t);var e,n={nodeName:n[2],objectName:n[3],objectIndex:n[4],propertyName:n[5],propertyIndex:n[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==i&&-1!==i&&(e=n.nodeName.substring(i+1),-1!==rv.indexOf(e))&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=e),null===n.propertyName||0===n.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return n},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){n=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(n)return n}return null}}),Object.assign(sv.prototype,{Xc:function(){},Vc: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=sv.findNode(this.rootNode,n.nodeName)||this.rootNode,this.node=t),this.getValue=this.Xc,this.setValue=this.Vc,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)n=n.nodeName,console.error("THREE.PropertyBinding: Trying to update property for track: "+n+"."+i+" but it wasn't found.",t);else{var n=this.Versioning.None,u=(void 0!==(this.targetObject=t).needsUpdate?n=this.Versioning.NeedsUpdate:void 0!==t.matrixWorldNeedsUpdate&&(n=this.Versioning.MatrixWorldNeedsUpdate),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}}}u=this.BindingType.ArrayElement,this.resolvedProperty=a,this.propertyIndex=r}else void 0!==a.fromArray&&void 0!==a.toArray?(u=this.BindingType.HasFromToArray,this.resolvedProperty=a):Array.isArray(a)?(u=this.BindingType.EntireArray,this.resolvedProperty=a):this.propertyName=i;this.getValue=this.GetterByBindingType[u],this.setValue=this.SetterByBindingTypeAndVersioning[u][n]}}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.zc,this.setValue=this.Wc}}),Object.assign(sv.prototype,{zc:sv.prototype.getValue,Wc:sv.prototype.setValue});var d,av,uv,cv,hv,fv,lv,dv,vv,pv,mv,yv,bv,gv,_v,wv,xv,Ev,Sv,Tv,Av,Mv,Ov,Lv=new At,Rv=new At;function Nv(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 At)}}function Pv(t){return(Pv="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){ad.call(this,t),this.dracoLoader=null,this.ddsLoader=null}function jv(){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={}}}}function Iv(t){if(!t)throw new Error("THREE.GLTFLoader: Attempting to load .dds texture without importing DDSLoader");this.name=d.MSFT_TEXTURE_DDS,this.ddsLoader=t}function Cv(t){this.name=d.KHR_LIGHTS_PUNCTUAL;t=t.extensions&&t.extensions[d.KHR_LIGHTS_PUNCTUAL]||{};this.lightDefs=t.lights||[]}function Dv(){this.name=d.KHR_MATERIALS_UNLIT}function kv(){this.name=d.KHR_MATERIALS_CLEARCOAT}function Uv(t){this.name=d.KHR_BINARY_GLTF,this.content=null,this.body=null;var n=new DataView(t,0,uv);if(this.header={magic:G0(new Uint8Array(t.slice(0,4))),version:n.getUint32(4,!0),length:n.getUint32(8,!0)},this.header.magic!==av)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,uv),i=0;i<e.byteLength;){var r,o=e.getUint32(i,!0),s=(i+=4,e.getUint32(i,!0));i+=4,s===cv.JSON?(r=new Uint8Array(t,uv+i,o),this.content=G0(r)):s===cv.BIN&&(this.body=t.slice(r=uv+i,r+o)),i+=o}if(null===this.content)throw new Error("THREE.GLTFLoader: JSON content not found.")}function Bv(t,n){if(!n)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=d.KHR_DRACO_MESH_COMPRESSION,this.json=t,this.dracoLoader=n,this.dracoLoader.preload()}function Gv(){this.name=d.KHR_TEXTURE_TRANSFORM}function Hv(t){Q0.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 lt).setHex(16777215)},glossiness:{value:1},specularMap:{value:null},glossinessMap:{value:null}};this.Yc=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 Xv(){return{name:d.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 Hv},extendParams:function(t,n,e){var i,n=n.extensions[this.name],r=(t.color=new lt(1,1,1),t.opacity=1,[]);return Array.isArray(n.diffuseFactor)&&(i=n.diffuseFactor,t.color.fromArray(i),t.opacity=i[3]),void 0!==n.diffuseTexture&&r.push(e.assignTexture(t,"map",n.diffuseTexture)),t.emissive=new lt(0,0,0),t.glossiness=void 0!==n.glossinessFactor?n.glossinessFactor:1,t.specular=new lt(1,1,1),Array.isArray(n.specularFactor)&&t.specular.fromArray(n.specularFactor),void 0!==n.specularGlossinessTexture&&(i=n.specularGlossinessTexture,r.push(e.assignTexture(t,"glossinessMap",i)),r.push(e.assignTexture(t,"specularMap",i))),Promise.all(r)},createMaterial:function(t){var n=new Hv(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=mi,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 Vv(){this.name=d.KHR_MESH_QUANTIZATION}function zv(t,n,e,i){fd.call(this,t,n,e,i)}function Wv(t,n){return"string"!=typeof t||""===t?"":(/^https?:\/\//i.test(n)&&/^\//.test(t)&&(n=n.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(t)||st.a.environment==B.a.WX&&st.a.WX_USER_DATA_PATH.test(t)||/^data:.*,.*$/i.test(t)||/^blob:.*$/i.test(t)?t:n+t)}function Yv(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 Qv(t,n){void 0!==n.extras&&("object"===Pv(n.extras)?Object.assign(t.userData,n.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+n.extras))}function Zv(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 qv(t,n,e){this.json=t||{},this.extensions=n||{},this.options=e||{},this.cache=new jv,this.primitiveCache={},this.textureLoader=new z0(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.fileLoader=new cd(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),"use-credentials"===this.options.crossOrigin&&this.fileLoader.setWithCredentials(!0)}function Kv(f,l,d){var t,n=l.attributes,e=[];for(t in n){var i=wv[t]||t.toLowerCase();i in f.attributes||e.push(function(t,n){return d.getDependency("accessor",t).then(function(t){f.setAttribute(n,t)})}(n[t],i))}void 0===l.indices||f.index||(r=d.getDependency("accessor",l.indices).then(function(t){f.setIndex(t)}),e.push(r)),Qv(f,l);var r=f,o=l,s=d,a=o.attributes,u=new It;if(void 0!==a.POSITION){var c=(g=s.json.accessors[a.POSITION]).min,h=g.max;if(void 0===c||void 0===h)console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");else{u.set(new Tt(c[0],c[1],c[2]),new Tt(h[0],h[1],h[2]));var v=o.targets;if(void 0!==v){for(var p=new Tt,m=new Tt,y=0,b=v.length;y<b;y++){var g,_=v[y];void 0!==_.POSITION&&(c=(g=s.json.accessors[_.POSITION]).min,h=g.max,void 0!==c&&void 0!==h?(m.setX(Math.max(Math.abs(c[0]),Math.abs(h[0]))),m.setY(Math.max(Math.abs(c[1]),Math.abs(h[1]))),m.setZ(Math.max(Math.abs(c[2]),Math.abs(h[2]))),p.max(m)):console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION."))}u.expandByVector(p)}r.boundingBox=u;a=new kt;u.getCenter(a.center),a.radius=u.min.distanceTo(u.max)/2,r.boundingSphere=a}}return Promise.all(e).then(function(){if(void 0===l.targets)return f;for(var e=f,t=l.targets,n=d,i=!1,r=!1,o=0,s=t.length;o<s&&(void 0!==(h=t[o]).POSITION&&(i=!0),void 0!==h.NORMAL&&(r=!0),!i||!r);o++);if(!i&&!r)return Promise.resolve(e);for(var a=[],u=[],o=0,s=t.length;o<s;o++){var c,h=t[o];i&&(c=void 0!==h.POSITION?n.getDependency("accessor",h.POSITION):e.attributes.position,a.push(c)),r&&(c=void 0!==h.NORMAL?n.getDependency("accessor",h.NORMAL):e.attributes.normal,u.push(c))}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})})}function Jv(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(2===n)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.");n=t.clone();return n.setIndex(a),n}Object.assign(Nv.prototype,{calculateInverses:function(){this.boneInverses=[];for(var t=0,n=this.bones.length;t<n;t++){var e=new At;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:Rv;Lv.multiplyMatrices(s,n[r]),Lv.toArray(e,16*r)}void 0!==i&&(i.needsUpdate=!0)},clone:function(){return new Nv(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)}}),Fv.prototype=Object.assign(Object.create(ad.prototype),{constructor:Fv,load:function(e,i,t,n){function r(t){n?n(t):console.error(t),o.manager.itemError(e),o.manager.itemEnd(e)}var o=this,s=""!==this.resourcePath?this.resourcePath:""!==this.path?this.path:H0(e),a=(o.manager.itemStart(e),new cd(o.manager));a.setPath(this.path),a.setResponseType("arraybuffer"),"use-credentials"===o.crossOrigin&&a.setWithCredentials(!0),a.load(e,function(n){try{o.parse(n,s,function(t){i(t,n),o.manager.itemEnd(e)},r)}catch(t){r(t)}},t,r)},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(G0(new Uint8Array(t,0,4))===av){try{o[d.KHR_BINARY_GLTF]=new Uv(t)}catch(t){return void(i&&i(t))}r=o[d.KHR_BINARY_GLTF].content}else r=G0(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],c=s.extensionsRequired||[];switch(u){case d.KHR_LIGHTS_PUNCTUAL:o[u]=new Cv(s);break;case d.KHR_MATERIALS_CLEARCOAT:o[u]=new kv;break;case d.KHR_MATERIALS_UNLIT:o[u]=new Dv;break;case d.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:o[u]=new Xv;break;case d.KHR_DRACO_MESH_COMPRESSION:o[u]=new Bv(s,this.dracoLoader);break;case d.MSFT_TEXTURE_DDS:o[u]=new Iv(this.ddsLoader);break;case d.KHR_TEXTURE_TRANSFORM:o[u]=new Gv;break;case d.KHR_MESH_QUANTIZATION:o[u]=new Vv;break;default:0<=c.indexOf(u)&&console.warn('THREE.GLTFLoader: Unknown extension "'+u+'".')}}new qv(s,o,{path:n||this.resourcePath||"",crossOrigin:this.crossOrigin,manager:this.manager}).parse(e,i)}}}),d={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"},Cv.prototype.loadLight=function(t){var n,e=this.lightDefs[t],i=new lt(16777215),r=(void 0!==e.color&&i.fromArray(e.color),void 0!==e.range?e.range:0);switch(e.type){case"directional":(n=new Rd(i)).target.position.set(0,0,-1),n.add(n.target);break;case"point":(n=new Pd(i)).distance=r;break;case"spot":(n=new jd(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)},Dv.prototype.getMaterialType=function(){return Ia},Dv.prototype.extendParams=function(t,n,e){var i,r=[],n=(t.color=new lt(1,1,1),t.opacity=1,n.pbrMetallicRoughness);return n&&(Array.isArray(n.baseColorFactor)&&(i=n.baseColorFactor,t.color.fromArray(i),t.opacity=i[3]),void 0!==n.baseColorTexture)&&r.push(e.assignTexture(t,"map",n.baseColorTexture)),Promise.all(r)},kv.prototype.getMaterialType=function(){return Z0},kv.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)&&(e=n.clearcoatNormalTexture.scale,t.clearcoatNormalScale=new Mt(e,e)),Promise.all(i)},av="glTF",uv=12,cv={JSON:1313821514,BIN:5130562},Bv.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={},c={};for(e in s){var h=wv[e]||e.toLowerCase();a[h]=s[e]}for(e in t.attributes){var f,l,h=wv[e]||e.toLowerCase();void 0!==s[e]&&(f=i.accessors[t.attributes[e]],l=yv[f.componentType],c[h]=l,u[h]=!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,c)})})},Gv.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},((Hv.prototype=Object.create(Q0.prototype)).constructor=Hv).prototype.copy=function(t){return Q0.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},((zv.prototype=Object.create(fd.prototype)).constructor=zv).prototype.beforeStart_=zv.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},zv.prototype.afterEnd_=zv.prototype.copySampleValue_,zv.prototype.interpolate_=function(t,n,e,i){for(var r=this.resultBuffer,o=this.sampleValues,s=this.valueSize,a=2*s,u=3*s,c=i-n,i=(e-n)/c,e=i*i,n=e*i,h=t*u,f=h-u,l=-2*n+3*e,d=n-e,v=1-l,p=d-e+i,m=0;m!==s;m++){var y=o[f+m+s],b=o[f+m+a]*c,g=o[h+m+s],_=o[h+m]*c;r[m]=v*y+p*b+l*g+d*_}return r},hv=0,fv=1,lv=2,dv=3,vv=4,pv=5,mv=6,yv={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},bv={9728:Wn,9729:Zn,9984:Yn,9985:qn,9986:Qn,9987:Kn},gv={33071:Vn,33648:zn,10497:Xn},_v={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},wv={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},xv={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},Ev={CUBICSPLINE:void 0,LINEAR:hi,STEP:ci},Sv="OPAQUE",Tv="MASK",Av="BLEND",Mv={"image/png":le,"image/jpeg":fe},qv.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:{}};Yv(r,t,i),Qv(t,i),n(t)}).catch(t)},qv.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,c=a.length;u<c;u++)t[a[u]].isBone=!0;for(var h=0,f=t.length;h<f;h++){var l=t[h];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},qv.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[d.KHR_LIGHTS_PUNCTUAL].loadLight(n);break;default:throw new Error("Unknown type: "+t)}this.cache.add(e,i)}return i},qv.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},qv.prototype.loadBuffer=function(t){var e,i=this.json.buffers[t],r=this.fileLoader;if(i.type&&"arraybuffer"!==i.type)throw new Error("THREE.GLTFLoader: "+i.type+" buffer type is not supported.");return void 0===i.uri&&0===t?Promise.resolve(this.extensions[d.KHR_BINARY_GLTF].body):(e=this.options,new Promise(function(t,n){r.load(Wv(i.uri,e.path),t,void 0,function(){n(new Error('THREE.GLTFLoader: Failed to load buffer "'+i.uri+'".'))})}))},qv.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)})},qv.prototype.loadAccessor=function(t){var y=this,b=this.json,g=this.json.accessors[t];return void 0===g.bufferView&&void 0===g.sparse?Promise.resolve(null):(t=[],void 0!==g.bufferView?t.push(this.getDependency("bufferView",g.bufferView)):t.push(null),void 0!==g.sparse&&(t.push(this.getDependency("bufferView",g.sparse.indices.bufferView)),t.push(this.getDependency("bufferView",g.sparse.values.bufferView))),Promise.all(t).then(function(t){var n=t[0],e=_v[g.type],i=yv[g.componentType],r=i.BYTES_PER_ELEMENT,o=g.byteOffset||0,s=void 0!==g.bufferView?b.bufferViews[g.bufferView].byteStride:void 0,a=!0===g.normalized,u=s&&s!==r*e?(c=Math.floor(o/s),h="InterleavedBuffer:"+g.bufferView+":"+g.componentType+":"+c+":"+g.count,(f=y.cache.get(h))||(f=new lh(new i(n,c*s,g.count*s/r),s/r),y.cache.add(h,f)),new vh(f,e,o%s/r,a)):new R(null===n?new i(g.count*e):new i(n,o,g.count*e),e,a);if(void 0!==g.sparse){var c=yv[g.sparse.indices.componentType],h=g.sparse.indices.byteOffset||0,f=g.sparse.values.byteOffset||0,l=new c(t[1],h,g.sparse.count*_v.SCALAR),d=new i(t[2],f,g.sparse.count*e);null!==n&&(u=new R(u.array.slice(),u.itemSize,u.normalized));for(var v=0,p=l.length;v<p;v++){var m=l[v];if(u.setX(m,d[v*e]),2<=e&&u.setY(m,d[v*e+1]),3<=e&&u.setZ(m,d[v*e+2]),4<=e&&u.setW(m,d[v*e+3]),5<=e)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return u}))},Ov=0,qv.prototype.loadTexture=function(t){var e,n=this,i=this.json,r=this.options,o=this.textureLoader,s=(st.a.environment===B.a.BROWSER&&(e=self.URL||self.webkitURL),i.textures[t]),a=s.extensions||{},u=a[d.MSFT_TEXTURE_DDS]?i.images[a[d.MSFT_TEXTURE_DDS].source]:i.images[s.source],c=u.uri,h=!1;return void 0!==u.bufferView&&(c=n.getDependency("bufferView",u.bufferView).then(function(t){var n,r;return st.a.environment===B.a.BROWSER?(h=!0,n=new Blob([t],{type:u.mimeType}),c=e.createObjectURL(n)):(r=wx.getFileSystemManager(),new Promise(function(n,e){var i=wx.env.USER_DATA_PATH+"/"+Ov+".png";Ov++,r.writeFile({filePath:i,data:t,encoding:"binary",success:function(t){n(i)},fail:function(t){console.error("失败******",i,t),e(i)}})}))})),Promise.resolve(c).then(function(e){var i=(i=r.manager.getHandler(e))||(a[d.MSFT_TEXTURE_DDS]?n.extensions[d.MSFT_TEXTURE_DDS].ddsLoader:o);return new Promise(function(t,n){i.load(Wv(e,r.path),t,void 0,n)})}).then(function(t){!0===h&&e.revokeObjectURL(c),t.flipY=!1,s.name&&(t.name=s.name),u.mimeType in Mv&&(t.format=Mv[u.mimeType]);var n=(i.samplers||{})[s.sampler]||{};return t.magFilter=bv[n.magFilter]||Zn,t.minFilter=bv[n.minFilter]||Kn,t.wrapS=gv[n.wrapS]||Xn,t.wrapT=gv[n.wrapT]||Xn,t})},qv.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=fe}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[d.KHR_TEXTURE_TRANSFORM]&&(n=void 0!==r.extensions?r.extensions[d.KHR_TEXTURE_TRANSFORM]:void 0)&&(t=o.extensions[d.KHR_TEXTURE_TRANSFORM].extendTexture(t,n)),e[i]=t})},qv.prototype.assignFinalMaterial=function(t){var n,e,i=t.geometry,r=t.material,o=void 0!==i.attributes.tangent,s=void 0!==i.attributes.color,a=void 0===i.attributes.normal,u=!0===t.isSkinnedMesh,c=0<Object.keys(i.morphAttributes).length,h=c&&void 0!==i.morphAttributes.normal;t.isPoints?(n="PointsMaterial:"+r.uuid,(e=this.cache.get(n))||(e=new Y0,f.prototype.copy.call(e,r),e.color.copy(r.color),e.map=r.map,e.sizeAttenuation=!1,this.cache.add(n,e)),r=e):t.isLine&&(n="LineBasicMaterial:"+r.uuid,(e=this.cache.get(n))||(e=new kl,f.prototype.copy.call(e,r),e.color.copy(r.color),this.cache.add(n,e)),r=e),(o||s||a||u||c)&&(n="ClonedMaterial:"+r.uuid+":",r.isGLTFSpecularGlossinessMaterial&&(n+="specular-glossiness:"),u&&(n+="skinning:"),o&&(n+="vertex-tangents:"),s&&(n+="vertex-colors:"),a&&(n+="flat-shading:"),c&&(n+="morph-targets:"),h&&(n+="morph-normals:"),(e=this.cache.get(n))||(e=r.clone(),u&&(e.skinning=!0),o&&(e.vertexTangents=!0),s&&(e.vertexColors=!0),a&&(e.flatShading=!0),c&&(e.morphTargets=!0),h&&(e.morphNormals=!0),this.cache.add(n,e)),r=e),r.aoMap&&void 0===i.attributes.uv2&&void 0!==i.attributes.uv&&i.setAttribute("uv2",new R(i.attributes.uv.array,2)),r.normalScale&&!o&&(r.normalScale.y=-r.normalScale.y),r.clearcoatNormalScale&&!o&&(r.clearcoatNormalScale.y=-r.clearcoatNormalScale.y),t.material=r},qv.prototype.loadMaterial=function(t){var n,e,i=this.json,r=this.extensions,o=i.materials[t],s={},i=o.extensions||{},t=[],a=(i[d.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]?(e=r[d.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS],n=e.getMaterialType(),t.push(e.extendParams(s,o,this))):i[d.KHR_MATERIALS_UNLIT]?(e=r[d.KHR_MATERIALS_UNLIT],n=e.getMaterialType(),t.push(e.extendParams(s,o,this))):(n=Q0,e=o.pbrMetallicRoughness||{},s.color=new lt(1,1,1),s.opacity=1,Array.isArray(e.baseColorFactor)&&(a=e.baseColorFactor,s.color.fromArray(a),s.opacity=a[3]),void 0!==e.baseColorTexture&&t.push(this.assignTexture(s,"map",e.baseColorTexture)),s.metalness=void 0!==e.metallicFactor?e.metallicFactor:1,s.roughness=void 0!==e.roughnessFactor?e.roughnessFactor:1,void 0!==e.metallicRoughnessTexture&&(t.push(this.assignTexture(s,"metalnessMap",e.metallicRoughnessTexture)),t.push(this.assignTexture(s,"roughnessMap",e.metallicRoughnessTexture)))),!0===o.doubleSided&&(s.side=un),o.alphaMode||Sv);return a===Av?(s.transparent=!0,s.depthWrite=!1):(s.transparent=!1,a===Tv&&(s.alphaTest=void 0!==o.alphaCutoff?o.alphaCutoff:.5)),void 0!==o.normalTexture&&n!==Ia&&(t.push(this.assignTexture(s,"normalMap",o.normalTexture)),s.normalScale=new Mt(1,1),void 0!==o.normalTexture.scale)&&s.normalScale.set(o.normalTexture.scale,o.normalTexture.scale),void 0!==o.occlusionTexture&&n!==Ia&&(t.push(this.assignTexture(s,"aoMap",o.occlusionTexture)),void 0!==o.occlusionTexture.strength)&&(s.aoMapIntensity=o.occlusionTexture.strength),void 0!==o.emissiveFactor&&n!==Ia&&(s.emissive=(new lt).fromArray(o.emissiveFactor)),void 0!==o.emissiveTexture&&n!==Ia&&t.push(this.assignTexture(s,"emissiveMap",o.emissiveTexture)),i[d.KHR_MATERIALS_CLEARCOAT]&&(e=r[d.KHR_MATERIALS_CLEARCOAT],n=e.getMaterialType(),t.push(e.extendParams(s,{extensions:i},this))),Promise.all(t).then(function(){var t=n===Hv?r[d.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(s):new n(s);return o.name&&(t.name=o.name),t.map&&(t.map.encoding=3001),t.emissiveMap&&(t.emissiveMap.encoding=3001),Qv(t,o),o.extensions&&Yv(r,t,o),t})},qv.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=(c=void 0,c=(c=(u=a).extensions&&u.extensions[d.KHR_DRACO_MESH_COMPRESSION])?"draco:"+c.bufferView+":"+c.indices+":"+Zv(c.attributes):u.indices+":"+Zv(u.attributes)+":"+u.mode),c=n[u];c?r.push(c.promise):(c=a.extensions&&a.extensions[d.KHR_DRACO_MESH_COMPRESSION]?function(n){return i[d.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(n,e).then(function(t){return Kv(t,n,e)})}(a):Kv(new oa,a,e),n[u]={primitive:a,promise:c},r.push(c))}return Promise.all(r)},qv.prototype.loadMesh=function(m){for(var y=this,b=this.json.meshes[m],g=b.primitives,t=[],n=0,e=g.length;n<e;n++){var i=void 0===g[n].material?(void 0===(i=this.cache).DefaultMaterial&&(i.DefaultMaterial=new Q0({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:sn})),i.DefaultMaterial):this.getDependency("material",g[n].material);t.push(i)}return t.push(y.loadGeometries(g)),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=g[r],c=n[r];if(u.mode===vv||u.mode===pv||u.mode===mv||void 0===u.mode)!0!==(s=new(!0===b.isSkinnedMesh?Id:$a)(a,c)).isSkinnedMesh||s.geometry.attributes.skinWeight.normalized||s.normalizeSkinWeights(),u.mode===pv?s.geometry=Jv(s.geometry,1):u.mode===mv&&(s.geometry=Jv(s.geometry,2));else if(u.mode===fv)s=new Vd(a,c);else if(u.mode===dv)s=new Gd(a,c);else if(u.mode===lv)s=new zd(a,c);else{if(u.mode!==hv)throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+u.mode);s=new qd(a,c)}if(0<Object.keys(s.geometry.morphAttributes).length){v=d=l=f=h=void 0;var h=s,f=b;if(h.updateMorphTargets(),void 0!==f.weights)for(var l=0,d=f.weights.length;l<d;l++)h.morphTargetInfluences[l]=f.weights[l];if(f.extras&&Array.isArray(f.extras.targetNames)){var v=f.extras.targetNames;if(h.morphTargetInfluences.length===v.length){h.morphTargetDictionary={};for(l=0,d=v.length;l<d;l++)h.morphTargetDictionary[v[l]]=l}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}s.name=b.name||"mesh_"+m,1<e.length&&(s.name+="_"+r),Qv(s,b),y.assignFinalMaterial(s),i.push(s)}if(1===i.length)return i[0];for(var p=new nh,r=0,o=i.length;r<o;r++)p.add(i[r]);return p})},qv.prototype.loadCamera=function(t){var n,t=this.json.cameras[t],e=t[t.type];if(e)return"perspective"===t.type?n=new vt(St.radToDeg(e.yfov),e.aspectRatio||1,e.znear||1,e.zfar||2e6):"orthographic"===t.type&&(n=new pt(e.xmag/-2,e.xmag/2,e.ymag/2,e.ymag/-2,e.znear,e.zfar)),t.name&&(n.name=t.name),Qv(n,t),Promise.resolve(n);console.warn("THREE.GLTFLoader: Missing camera parameters.")},qv.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})},qv.prototype.loadAnimation=function(S){for(var T=this.json.animations[S],t=[],n=[],e=[],i=[],r=[],o=0,s=T.channels.length;o<s;o++){var a=T.channels[o],u=T.samplers[a.sampler],a=a.target,c=void 0!==a.node?a.node:a.id,h=void 0!==T.parameters?T.parameters[u.input]:u.input,f=void 0!==T.parameters?T.parameters[u.output]:u.output;t.push(this.getDependency("node",c)),n.push(this.getDependency("accessor",h)),e.push(this.getDependency("accessor",f)),i.push(u),r.push(a)}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 c,h=n[a],f=e[a],l=i[a],d=r[a],v=o[a];if(void 0!==h){switch(h.updateMatrix(),h.matrixAutoUpdate=!0,xv[v.path]){case xv.weights:c=bd;break;case xv.rotation:c=_d;break;default:c=xd}var p,m=h.name||h.uuid,y=void 0!==d.interpolation?Ev[d.interpolation]:hi,b=[],g=(xv[v.path]===xv.weights?h.traverse(function(t){!0===t.isMesh&&t.morphTargetInfluences&&b.push(t.name||t.uuid)}):b.push(m),l.array);if(l.normalized){if(g.constructor===Int8Array)p=1/127;else if(g.constructor===Uint8Array)p=1/255;else if(g.constructor==Int16Array)p=1/32767;else{if(g.constructor!==Uint16Array)throw new Error("THREE.GLTFLoader: Unsupported output accessor component type.");p=1/65535}for(var _=new Float32Array(g.length),w=0,x=g.length;w<x;w++)_[w]=g[w]*p;g=_}for(w=0,x=b.length;w<x;w++){var E=new c(b[w]+"."+xv[v.path],f.array,g,y);"CUBICSPLINE"===d.interpolation&&(E.createInterpolant=function(t){return new zv(this.times,this.values,this.getValueSize()/3,t)},E.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0),s.push(E)}}}return new Ed(T.name||"animation_"+S,void 0,s)})},qv.prototype.loadNode=function(t){var n=this.json,o=this.extensions,e=this,i=n.meshReferences,r=n.meshUses,s=n.nodes[t];return n=[],void 0!==s.mesh&&n.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&&n.push(e.getDependency("camera",s.camera)),s.extensions&&s.extensions[d.KHR_LIGHTS_PUNCTUAL]&&void 0!==s.extensions[d.KHR_LIGHTS_PUNCTUAL].light&&n.push(e.getDependency("light",s.extensions[d.KHR_LIGHTS_PUNCTUAL].light)),Promise.all(n).then(function(t){var n,e=!0===s.isBone?new Jd:1<t.length?new nh:1===t.length?t[0]:new a;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=sv.sanitizeNodeName(s.name)),Qv(e,s),s.extensions&&Yv(o,e,s),void 0!==s.matrix?((n=new At).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})},qv.prototype.loadScene=function(t){for(var n=this.json,e=this.extensions,t=this.json.scenes[t],i=new Ps,r=(t.name&&(i.name=t.name),Qv(i,t),t.extensions&&Yv(e,i,t),t.nodes||[]),o=[],s=0,a=r.length;s<a;s++)o.push(function s(t,a,u,c){var h=u.nodes[t];return c.getDependency("node",t).then(function(t){var a;return void 0===h.skin?t:c.getDependency("skin",h.skin).then(function(t){for(var n=[],e=0,i=(a=t).joints.length;e<i;e++)n.push(c.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 At,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 Nv(n,e),t.matrixWorld)}}),t})}).then(function(t){a.add(t);var n=[];if(h.children)for(var e=h.children,i=0,r=e.length;i<r;i++){var o=e[i];n.push(s(o,t,u,c))}return Promise.all(n)})}(r[s],i,n,this));return Promise.all(o).then(function(){return i})};var $v=Fv;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 np(t){ad.call(this,t),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}function ep(t){return(ep="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 ip(t,n){var e,i,r,o,s="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(s)return i=!(e=!0),{s:function(){s=s.call(t)},n:function(){var t=s.next();return e=t.done,t},e:function(t){i=!0,r=t},f:function(){try{e||null==s.return||s.return()}finally{if(i)throw r}}};if(Array.isArray(t)||(s=function(t,n){var e;if(t)return"string"==typeof t?rp(t,n):"Map"===(e="Object"===(e=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?rp(t,n):void 0}(t))||n&&t&&"number"==typeof t.length)return s&&(t=s),o=0,{s:n=function(){},n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},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.")}function rp(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 op(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,function(t){t=function(t,n){if("object"!=ep(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=ep(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==ep(t)?t:t+""}(i.key),i)}}function sp(t,n,e){n=up(n);var i=t,n=ap()?Reflect.construct(n,e||[],up(t).constructor):n.apply(t,e);if(n&&("object"===ep(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function ap(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(ap=function(){return!!t})()}function up(t){return(up=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function cp(t,n){return(cp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}np.prototype=Object.assign(Object.create(ad.prototype),{constructor:np,setDecoderPath:function(t){return this.decoderPath=t,this},setDecoderConfig:function(t){return this.decoderConfig=t,this},setWorkerLimit:function(t){return this.workerLimit=t,this},setVerbosity:function(){console.warn("THREE.DRACOLoader: The .setVerbosity() method has been removed.")},setDrawMode:function(){console.warn("THREE.DRACOLoader: The .setDrawMode() method has been removed.")},setSkipDequantization:function(){console.warn("THREE.DRACOLoader: The .setSkipDequantization() method has been removed.")},load:function(t,e,n,i){var r=this,o=new cd(this.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),"use-credentials"===this.crossOrigin&&o.setWithCredentials(!0),o.load(t,function(t){var n={attributeIDs:r.defaultAttributeIDs,attributeTypes:r.defaultAttributeTypes,useUniqueIDs:!1};r.decodeGeometry(t,n).then(e).catch(i)},n,i)},decodeDracoFile:function(t,n,e,i){i={attributeIDs:e||this.defaultAttributeIDs,attributeTypes:i||this.defaultAttributeTypes,useUniqueIDs:!!e};this.decodeGeometry(t,i).then(n)},decodeGeometry:function(e,i){var t,n=this;for(t in i.attributeTypes){var r=i.attributeTypes[t];void 0!==r.BYTES_PER_ELEMENT&&(i.attributeTypes[t]=r.name)}var o,s=JSON.stringify(i);if(np.taskCache.has(e)){var a=np.taskCache.get(e);if(a.key===s)return a.promise;if(0===e.byteLength)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}var u=this.workerNextTaskID++,a=e.byteLength,a=this.Qc(u,a).then(function(t){return o=t,new Promise(function(t,n){o.Zc[u]={resolve:t,reject:n},o.postMessage({type:"decode",id:u,taskConfig:i,buffer:e},[e])})}).then(function(t){return n.qc(t.geometry)});return a.finally(function(){o&&u&&n.Kc(o,u)}),np.taskCache.set(e,{key:s,promise:a}),a},qc:function(t){var n=new oa;t.index&&n.setIndex(new R(t.index.array,1));for(var e=0;e<t.attributes.length;e++){var i=t.attributes[e],r=i.name,o=i.array,i=i.itemSize;n.setAttribute(r,new R(o,i))}return n},Jc:function(e,t){var i=new cd(this.manager);return i.setPath(this.decoderPath),i.setResponseType(t),new Promise(function(t,n){i.load(e,t,void 0,n)})},preload:function(){return this.$c(),this},$c:function(){var e,t,i=this;return this.decoderPending||(t=[],(e="object"!==("undefined"==typeof WebAssembly?"undefined":tp(WebAssembly))||"js"===this.decoderConfig.type)?t.push(this.Jc("draco_decoder.js","text")):(t.push(this.Jc("draco_wasm_wrapper.js","text")),t.push(this.Jc("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then(function(t){var n=t[0],t=(e||(i.decoderConfig.wasmBinary=t[1]),np.DRACOWorker.toString()),n=["/* draco decoder */",n,"","/* worker */",t.substring(t.indexOf("{")+1,t.lastIndexOf("}"))].join("\n");i.workerSourceURL=URL.createObjectURL(new Blob([n]))})),this.decoderPending},Qc:function(t,n){var i=this;return this.$c().then(function(){i.workerPool.length<i.workerLimit?((e=new Worker(i.workerSourceURL)).Zc={},e.th={},e.nh=0,e.postMessage({type:"init",decoderConfig:i.decoderConfig}),e.onmessage=function(t){var n=t.data;switch(n.type){case"decode":e.Zc[n.id].resolve(n);break;case"error":e.Zc[n.id].reject(n);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+n.type+'"')}},i.workerPool.push(e)):i.workerPool.sort(function(t,n){return t.nh>n.nh?-1:1});var e=i.workerPool[i.workerPool.length-1];return e.th[t]=n,e.nh+=n,e})},Kc:function(t,n){t.nh-=t.th[n],delete t.Zc[n],delete t.th[n]},debug:function(){this.workerPool.map(function(t){return t.nh})},dispose:function(){for(var t=0;t<this.workerPool.length;++t)this.workerPool[t].terminate();return this.workerPool.length=0,this}}),np.DRACOWorker=function(){var e,n;onmessage=function(t){var o=t.data;switch(o.type){case"init":e=o.decoderConfig,n=new Promise(function(n){e.onModuleLoaded=function(t){n({draco:t})},DracoDecoderModule(e)});break;case"decode":var s=o.buffer,a=o.taskConfig;n.then(function(t){var t=t.draco,n=new t.Decoder,e=new t.DecoderBuffer;e.Init(new Int8Array(s),s.byteLength);try{var i=function(t,n,e,i){var r,o,s=i.attributeIDs,a=i.attributeTypes,u=n.GetEncodedGeometryType(e);if(u===t.TRIANGULAR_MESH)r=new t.Mesh,o=n.DecodeBufferToMesh(e,r);else{if(u!==t.POINT_CLOUD)throw new Error("THREE.DRACOLoader: Unexpected geometry type.");r=new t.PointCloud,o=n.DecodeBufferToPointCloud(e,r)}if(!o.ok()||0===r.ptr)throw new Error("THREE.DRACOLoader: Decoding failed: "+o.error_msg());var c,h,f,l={index:null,attributes:[]};for(c in s){var d=self[a[c]];if(i.useUniqueIDs)f=s[c],h=n.GetAttributeByUniqueId(r,f);else{if(-1===(f=n.GetAttributeId(r,t[s[c]])))continue;h=n.GetAttribute(r,f)}l.attributes.push(function(t,n,e,i,r,o){var s,a,u=o.num_components(),c=e.num_points()*u;switch(r){case Float32Array:s=new t.DracoFloat32Array,n.GetAttributeFloatForAllPoints(e,o,s),a=new Float32Array(c);break;case Int8Array:s=new t.DracoInt8Array,n.GetAttributeInt8ForAllPoints(e,o,s),a=new Int8Array(c);break;case Int16Array:s=new t.DracoInt16Array,n.GetAttributeInt16ForAllPoints(e,o,s),a=new Int16Array(c);break;case Int32Array:s=new t.DracoInt32Array,n.GetAttributeInt32ForAllPoints(e,o,s),a=new Int32Array(c);break;case Uint8Array:s=new t.DracoUInt8Array,n.GetAttributeUInt8ForAllPoints(e,o,s),a=new Uint8Array(c);break;case Uint16Array:s=new t.DracoUInt16Array,n.GetAttributeUInt16ForAllPoints(e,o,s),a=new Uint16Array(c);break;case Uint32Array:s=new t.DracoUInt32Array,n.GetAttributeUInt32ForAllPoints(e,o,s),a=new Uint32Array(c);break;default:throw new Error("THREE.DRACOLoader: Unexpected attribute type.")}for(var h=0;h<c;h++)a[h]=s.GetValue(h);return t.destroy(s),{name:i,array:a,itemSize:u}}(t,n,r,c,d,h))}if(u===t.TRIANGULAR_MESH){for(var v=r.num_faces(),p=new Uint32Array(3*v),m=new t.DracoInt32Array,y=0;y<v;++y){n.GetFaceFromMesh(r,y,m);for(var b=0;b<3;++b)p[3*y+b]=m.GetValue(b)}l.index={array:p,itemSize:1},t.destroy(m)}return t.destroy(r),l}(t,n,e,a),r=i.attributes.map(function(t){return t.array.buffer});i.index&&r.push(i.index.array.buffer),self.postMessage({type:"decode",id:o.id,geometry:i},r)}catch(t){console.error(t),self.postMessage({type:"error",id:o.id,error:t.message})}finally{t.destroy(e),t.destroy(n)}})}}},np.taskCache=new WeakMap,np.setDecoderPath=function(){console.warn("THREE.DRACOLoader: The .setDecoderPath() method has been removed. Use instance methods.")},np.setDecoderConfig=function(){console.warn("THREE.DRACOLoader: The .setDecoderConfig() method has been removed. Use instance methods.")},np.releaseDecoderModule=function(){console.warn("THREE.DRACOLoader: The .releaseDecoderModule() method has been removed. Use instance methods.")},np.getDecoderModule=function(){console.warn("THREE.DRACOLoader: The .getDecoderModule() method has been removed. Use instance methods.")};var nv=function(){function e(t){var n;if(this instanceof e)return(n=sp(this,e))._n=t,n.eh=new Ad,n.ih=new $v,n.rh=!1,n.oh=!1,n._n.Oi.decoderURL&&((t=new np).setDecoderPath(n._n.Oi.decoderURL),n.ih.setDRACOLoader(t)),n;throw new TypeError("Cannot call a class as a function")}var t,n,i=e,r=Ki;if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");return i.prototype=Object.create(r&&r.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),r&&cp(i,r),i=e,t&&op(i.prototype,t),n&&op(i,n),Object.defineProperty(i,"prototype",{writable:!1}),i}(),hp=(Object.assign(nv.prototype,{Na:function(o,s,n){var a,t,u=this;this.an.has(o)?(this.cn(o,{success:s,fail:n}),!0===this.an.get(o).loadComplete&&this.sh(o)):(this.an.set(o,{loadComplete:!1}),a=-1===o.indexOf(".js"),t=this.ih,(t=a?t:this.eh).load(o,function(t,n){if(!0!==u.oh){if(a)u.an.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=ip(n);try{for(i.s();!(e=i.n()).done;){var r=e.value;r.map&&u.rh&&r.color.setScalar(1)}}catch(t){i.e(t)}finally{i.f()}}else n.map&&u.rh&&n.color.setScalar(1);u.an.set(o,{geometry:t,material:n,isGltf:!1,loadComplete:!0}),s&&s(a,t,n)}u._n.Pt.ah(),u.sh(o,!1)}},function(t){},function(t){!0!==u.oh&&(u.an.delete(o),n&&n(t),u.sh(o,t))}))},sh:function(r,o){var s,a=this;this.un.has(r)&&(s=this.an.get(r))&&(this.un.get(r).forEach(function(t,n,e){var i;o?n.fail&&n.fail(o):s.isGltf?s.isAnimate?a.ih.parse(s.data,H0(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.un.delete(r))},Yn:function(){this.oh=!0,this.un.clear(),this.eh=null,this.ih=null}}),nv);function fp(t){return(fp="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,function(t){t=function(t,n){if("object"!=fp(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=fp(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==fp(t)?t:t+""}(i.key),i)}}function dp(t,n,e){n=pp(n);var i=t,n=vp()?Reflect.construct(n,e||[],pp(t).constructor):n.apply(t,e);if(n&&("object"===fp(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function vp(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(vp=function(){return!!t})()}function pp(t){return(pp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function mp(t,n){return(mp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var e=function(){function i(t){var n,e;if(this instanceof i)return(n=dp(this,i)).ih=new $v,t.Oi.decoderURL&&((e=new np).setDecoderPath(t.Oi.decoderURL),n.ih.setDRACOLoader(e)),n;throw new TypeError("Cannot call a class as a function")}var t,n,e=i,r=Ki;if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");return e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),r&&mp(e,r),e=i,t&&lp(e.prototype,t),n&&lp(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(),yp=(Object.assign(e.prototype,{Na:function(e,i,r){var o=this;this.an.has(e)?(this.cn(e,{success:i,fail:r}),!0===this.an.get(e).loadComplete&&this.sh(e)):(this.an.set(e,{loadComplete:!1}),this.ih.load(e,function(t,n){t.scene.userData.sourceScale=t.scene.scale.clone(),o.an.set(e,{gltf:t,isAnimate:0<t.animations.length,data:0<t.animations.length?n:null,loadComplete:!0}),o.cn(e,{success:i,fail:r}),o.sh(e)},function(t){},function(t){o.an.delete(e),r&&r(t),o.sh(e,t)}))},sh:function(r,o){var s,a=this;this.un.has(r)&&(s=this.an.get(r))&&(this.un.get(r).forEach(function(t,n,e){var i;o?n.fail&&n.fail(o):s.isAnimate?a.ih.parse(s.data,H0(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.un.delete(r))},Yn:function(){this.ih=null}}),e);function bp(){this.type="Curve",this.arcLengthDivisions=200}function gp(t,n,e,i,r,o,s,a){bp.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 _p(t,n,e,i,r,o){gp.call(this,t,n,e,e,i,r,o),this.type="ArcCurve"}function wp(){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){t=(n-t)/r-(e-t)/(r+o)+(e-n)/o,r=(e-n)/o-(i-n)/(o+s)+(i-e)/s;u(n,e,t*=o,r*=o)},calc:function(t){var n=t*t;return r+o*t+s*n+a*(n*t)}}}Object.assign(bp.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}return i[r=u]===s?r/(o-1):(r+(s-(n=i[r]))/(i[r+1]-n))/(o-1)},getTangent:function(t){var n=t-1e-4,t=t+1e-4,n=(1<t&&(t=1),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 Tt,r=[],o=[],s=[],a=new Tt,u=new At,c=0;c<=t;c++)r[c]=this.getTangentAt(c/t),r[c].normalize();o[0]=new Tt,s[0]=new Tt;var h=Number.MAX_VALUE,f=Math.abs(r[0].x),l=Math.abs(r[0].y),d=Math.abs(r[0].z);for(f<=h&&(h=f,i.set(1,0,0)),l<=h&&(h=l,i.set(0,1,0)),d<=h&&i.set(0,0,1),a.crossVectors(r[0],i).normalize(),o[0].crossVectors(r[0],a),s[0].crossVectors(r[0],o[0]),c=1;c<=t;c++)o[c]=o[c-1].clone(),s[c]=s[c-1].clone(),a.crossVectors(r[c-1],r[c]),a.length()>Number.EPSILON&&(a.normalize(),e=Math.acos(St.clamp(r[c-1].dot(r[c]),-1,1)),o[c].applyMatrix4(u.makeRotationAxis(a,e))),s[c].crossVectors(r[c],o[c]);if(!0===n)for(e=Math.acos(St.clamp(o[0].dot(o[t]),-1,1)),e/=t,0<r[0].dot(a.crossVectors(o[0],o[t]))&&(e=-e),c=1;c<=t;c++)o[c].applyMatrix4(u.makeRotationAxis(r[c],e*c)),s[c].crossVectors(r[c],o[c]);return{tangents:r,normals:o,binormals:s}},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}),((gp.prototype=Object.create(bp.prototype)).constructor=gp).prototype.isEllipseCurve=!0,gp.prototype.getPoint=function(t,n){for(var n=n||new Mt,e=2*Math.PI,i=this.aEndAngle-this.aStartAngle,r=Math.abs(i)<Number.EPSILON;i<0;)i+=e;for(;e<i;)i-=e;i<Number.EPSILON&&(i=r?0:e),!0!==this.aClockwise||r||(i===e?i=-e:i-=e);var o,s,a,u,r=this.aStartAngle+t*i,t=this.aX+this.xRadius*Math.cos(r),r=this.aY+this.yRadius*Math.sin(r);return 0!==this.aRotation&&(o=Math.cos(this.aRotation),s=Math.sin(this.aRotation),t=(a=t-this.aX)*o-(u=r-this.aY)*s+this.aX,r=a*s+u*o+this.aY),n.set(t,r)},gp.prototype.copy=function(t){return bp.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},((_p.prototype=Object.create(gp.prototype)).constructor=_p).prototype.isArcCurve=!0;var xp=new Tt,Ep=new wp,Sp=new wp,Tp=new wp;function Ap(t,n,e,i){bp.call(this),this.type="CatmullRomCurve3",this.points=t||[],this.closed=n||!1,this.curveType=e||"centripetal",this.tension=i||.5}function Mp(t,n,e,i,r){var n=.5*(i-n),r=.5*(r-e),o=t*t;return(2*e-2*i+n+r)*(t*o)+(-3*e+3*i-2*n-r)*o+n*t+e}function Op(t,n,e,i){return(r=1-(r=t))*r*n+2*(1-t)*t*e+t*t*i;var r}function Lp(t,n,e,i,r){return(o=1-(o=t))*o*o*n+3*(o=1-t)*o*t*e+3*(1-t)*t*t*i+t*t*t*r;var o}function Rp(t,n,e,i){bp.call(this),this.type="CubicBezierCurve",this.v0=t||new Mt,this.v1=n||new Mt,this.v2=e||new Mt,this.v3=i||new Mt}function Np(t,n,e,i){bp.call(this),this.type="CubicBezierCurve3",this.v0=t||new Tt,this.v1=n||new Tt,this.v2=e||new Tt,this.v3=i||new Tt}function Pp(t,n){bp.call(this),this.type="LineCurve",this.v1=t||new Mt,this.v2=n||new Mt}function Fp(t,n){bp.call(this),this.type="LineCurve3",this.v1=t||new Tt,this.v2=n||new Tt}function jp(t,n,e){bp.call(this),this.type="QuadraticBezierCurve",this.v0=t||new Mt,this.v1=n||new Mt,this.v2=e||new Mt}function Ip(t,n,e){bp.call(this),this.type="QuadraticBezierCurve3",this.v0=t||new Tt,this.v1=n||new Tt,this.v2=e||new Tt}function Cp(t){bp.call(this),this.type="SplineCurve",this.points=t||[]}function Dp(){bp.call(this),this.type="CurvePath",this.curves=[],this.autoClose=!1}function kp(t){Dp.call(this),this.type="Path",this.currentPoint=new Mt,t&&this.setFromPoints(t)}function Up(t){kp.call(this,t),this.uuid=St.generateUUID(),this.type="Shape",this.holes=[]}((Ap.prototype=Object.create(bp.prototype)).constructor=Ap).prototype.isCatmullRomCurve3=!0,Ap.prototype.getPoint=function(t,n){var e,i,r,o,n=n||new Tt,s=this.points,a=s.length,t=(a-(this.closed?0:1))*t,u=Math.floor(t),t=t-u;return this.closed?u+=0<u?0:(Math.floor(Math.abs(u)/a)+1)*a:0===t&&u===a-1&&(u=a-2,t=1),e=this.closed||0<u?s[(u-1)%a]:(xp.subVectors(s[0],s[1]).add(s[0]),xp),i=s[u%a],r=s[(u+1)%a],u=this.closed||u+2<a?s[(u+2)%a]:(xp.subVectors(s[a-1],s[a-2]).add(s[a-1]),xp),"centripetal"===this.curveType||"chordal"===this.curveType?(s="chordal"===this.curveType?.5:.25,a=Math.pow(e.distanceToSquared(i),s),(o=Math.pow(i.distanceToSquared(r),s))<1e-4&&(o=1),a<1e-4&&(a=o),(s=Math.pow(r.distanceToSquared(u),s))<1e-4&&(s=o),Ep.initNonuniformCatmullRom(e.x,i.x,r.x,u.x,a,o,s),Sp.initNonuniformCatmullRom(e.y,i.y,r.y,u.y,a,o,s),Tp.initNonuniformCatmullRom(e.z,i.z,r.z,u.z,a,o,s)):"catmullrom"===this.curveType&&(Ep.initCatmullRom(e.x,i.x,r.x,u.x,this.tension),Sp.initCatmullRom(e.y,i.y,r.y,u.y,this.tension),Tp.initCatmullRom(e.z,i.z,r.z,u.z,this.tension)),n.set(Ep.calc(t),Sp.calc(t),Tp.calc(t)),n},Ap.prototype.copy=function(t){bp.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},((Rp.prototype=Object.create(bp.prototype)).constructor=Rp).prototype.isCubicBezierCurve=!0,Rp.prototype.getPoint=function(t,n){var n=n||new Mt,e=this.v0,i=this.v1,r=this.v2,o=this.v3;return n.set(Lp(t,e.x,i.x,r.x,o.x),Lp(t,e.y,i.y,r.y,o.y)),n},Rp.prototype.copy=function(t){return bp.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},((Np.prototype=Object.create(bp.prototype)).constructor=Np).prototype.isCubicBezierCurve3=!0,Np.prototype.getPoint=function(t,n){var n=n||new Tt,e=this.v0,i=this.v1,r=this.v2,o=this.v3;return n.set(Lp(t,e.x,i.x,r.x,o.x),Lp(t,e.y,i.y,r.y,o.y),Lp(t,e.z,i.z,r.z,o.z)),n},Np.prototype.copy=function(t){return bp.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},((Pp.prototype=Object.create(bp.prototype)).constructor=Pp).prototype.isLineCurve=!0,Pp.prototype.getPoint=function(t,n){n=n||new Mt;return 1===t?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n},Pp.prototype.getPointAt=function(t,n){return this.getPoint(t,n)},Pp.prototype.getTangent=function(){return this.v2.clone().sub(this.v1).normalize()},Pp.prototype.copy=function(t){return bp.prototype.copy.call(this,t),this.v1.copy(t.v1),this.v2.copy(t.v2),this},((Fp.prototype=Object.create(bp.prototype)).constructor=Fp).prototype.isLineCurve3=!0,Fp.prototype.getPoint=function(t,n){n=n||new Tt;return 1===t?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n},Fp.prototype.getPointAt=function(t,n){return this.getPoint(t,n)},Fp.prototype.copy=function(t){return bp.prototype.copy.call(this,t),this.v1.copy(t.v1),this.v2.copy(t.v2),this},((jp.prototype=Object.create(bp.prototype)).constructor=jp).prototype.isQuadraticBezierCurve=!0,jp.prototype.getPoint=function(t,n){var n=n||new Mt,e=this.v0,i=this.v1,r=this.v2;return n.set(Op(t,e.x,i.x,r.x),Op(t,e.y,i.y,r.y)),n},jp.prototype.copy=function(t){return bp.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this},Ip.prototype.getPoint=function(t,n){var n=n||new Tt,e=this.v0,i=this.v1,r=this.v2;return n.set(Op(t,e.x,i.x,r.x),Op(t,e.y,i.y,r.y),Op(t,e.z,i.z,r.z)),n},((Cp.prototype=Object.create(bp.prototype)).constructor=Cp).prototype.isSplineCurve=!0,Cp.prototype.getPoint=function(t,n){var n=n||new Mt,e=this.points,t=(e.length-1)*t,i=Math.floor(t),t=t-i,r=e[0===i?i:i-1],o=e[i],s=e[i>e.length-2?e.length-1:i+1],e=e[i>e.length-3?e.length-1:i+2];return n.set(Mp(t,r.x,o.x,s.x,e.x),Mp(t,r.y,o.y,s.y,e.y)),n},Cp.prototype.copy=function(t){bp.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},Dp.prototype=Object.assign(Object.create(bp.prototype),{constructor:Dp,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 Pp(n,t))},getPoint:function(t){for(var n,e,i,r=t*this.getLength(),o=this.getCurveLengths(),s=0;s<o.length;){if(o[s]>=r)return n=o[s]-r,i=(e=this.curves[s]).getLength(),e.getPointAt(0===i?0:1-n/i);s++}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 c=a[u];n&&n.equals(c)||(e.push(c),n=c)}return this.autoClose&&1<e.length&&!e[e.length-1].equals(e[0])&&e.push(e[0]),e},copy:function(t){bp.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}}),kp.prototype=Object.assign(Object.create(Dp.prototype),{constructor:kp,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 Pp(this.currentPoint.clone(),new Mt(t,n));return this.curves.push(e),this.currentPoint.set(t,n),this},quadraticCurveTo:function(t,n,e,i){t=new jp(this.currentPoint.clone(),new Mt(t,n),new Mt(e,i));return this.curves.push(t),this.currentPoint.set(e,i),this},bezierCurveTo:function(t,n,e,i,r,o){t=new Rp(this.currentPoint.clone(),new Mt(t,n),new Mt(e,i),new Mt(r,o));return this.curves.push(t),this.currentPoint.set(r,o),this},splineThru:function(t){var n=new Cp([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,c=this.currentPoint.y;return this.absellipse(t+u,n+c,e,i,r,o,s,a),this},absellipse:function(t,n,e,i,r,o,s,a){t=new gp(t,n,e,i,r,o,s,a),0<this.curves.length&&((n=t.getPoint(0)).equals(this.currentPoint)||this.lineTo(n.x,n.y)),this.curves.push(t),e=t.getPoint(1);return this.currentPoint.copy(e),this},copy:function(t){return Dp.prototype.copy.call(this,t),this.currentPoint.copy(t.currentPoint),this}}),Up.prototype=Object.assign(Object.create(kp.prototype),{constructor:Up,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){kp.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 Bp=function(t,n,e){e=e||2;var i,r,o,s,a,u=n&&n.length,c=u?n[0]*e:t.length,h=Gp(t,0,c,e,!0),f=[];if(h&&h.next!==h.prev){if(u&&(h=function(t,n,e,i){var r,o,s,a,u=[];for(r=0,o=n.length;r<o;r++)a=n[r]*i,s=r<o-1?n[r+1]*i:t.length,(a=Gp(t,a,s,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(Vp),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,c=e,h=e.x,f=e.y,l=1/0;i=e.next;for(;i!==c;)r>=i.x&&i.x>=h&&r!==i.x&&Wp(o<f?r:s,o,h,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)&&qp(i,t)&&(e=i,l=u),i=i.next;return e}(t,n))&&Hp(n=Kp(n,t),n.next)}(u[r],e),e=Hp(e,e.next);return e}(t,n,h,e)),t.length>80*e){for(var l=i=t[0],d=r=t[1],v=e;v<c;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}Xp(h,f,e,l,d,a)}return f};function Gp(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=Jp(o,t[o],t[o+1],s);else for(o=e-i;n<=o;o-=i)s=Jp(o,t[o],t[o+1],s);return s&&Qp(s,s.next)&&($p(s),s=s.next),s}function Hp(t,n){if(!t)return t;n=n||t;var e,i=t;do{if(e=!1,i.steiner||!Qp(i,i.next)&&0!==Yp(i.prev,i,i.next))i=i.next;else{if($p(i),(i=n=i.prev)===i.next)break;e=!0}}while(e||i!==n);return n}function Xp(t,n,e,i,r,o,s){if(t){if(!s&&o){for(var a=t,u=i,c=r,h=o,f=a;null===f.z&&(f.z=zp(f.x,f.y,u,c,h)),f.prevZ=f.prev,f.nextZ=f.next,(f=f.next)!==a;);f.prevZ.nextZ=null,f.prevZ=null;var l,d,v,p,m,y,b,g,_=f,w=1;do{for(d=_,m=_=null,y=0;d;){for(y++,v=d,l=b=0;l<w&&(b++,v=v.nextZ);l++);for(g=w;0<b||0<g&&v;)0!==b&&(0===g||!v||d.z<=v.z)?(d=(p=d).nextZ,b--):(v=(p=v).nextZ,g--),m?m.nextZ=p:_=p,p.prevZ=m,m=p;d=v}}while(m.nextZ=null,w*=2,1<y)}for(var x,E,S=t;t.prev!==t.next;)if(x=t.prev,E=t.next,o?function(t,n,e,i){var r=t.prev,o=t,s=t.next;if(0<=Yp(r,o,s))return;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,c=(r.x>o.x?r.x>s.x?r:s:o.x>s.x?o:s).x,h=(r.y>o.y?r.y>s.y?r:s:o.y>s.y?o:s).y,f=zp(a,u,n,e,i),l=zp(c,h,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&&Wp(r.x,r.y,o.x,o.y,s.x,s.y,d.x,d.y)&&0<=Yp(d.prev,d,d.next))return;if(d=d.prevZ,v!==t.prev&&v!==t.next&&Wp(r.x,r.y,o.x,o.y,s.x,s.y,v.x,v.y)&&0<=Yp(v.prev,v,v.next))return;v=v.nextZ}for(;d&&d.z>=f;){if(d!==t.prev&&d!==t.next&&Wp(r.x,r.y,o.x,o.y,s.x,s.y,d.x,d.y)&&0<=Yp(d.prev,d,d.next))return;d=d.prevZ}for(;v&&v.z<=l;){if(v!==t.prev&&v!==t.next&&Wp(r.x,r.y,o.x,o.y,s.x,s.y,v.x,v.y)&&0<=Yp(v.prev,v,v.next))return;v=v.nextZ}return 1}(t,i,r,o):function(t){var n=t.prev,e=t,i=t.next;if(0<=Yp(n,e,i))return;var r=t.next.next;for(;r!==t.prev;){if(Wp(n.x,n.y,e.x,e.y,i.x,i.y,r.x,r.y)&&0<=Yp(r.prev,r,r.next))return;r=r.next}return 1}(t))n.push(x.i/e),n.push(t.i/e),n.push(E.i/e),$p(t),t=E.next,S=E.next;else if((t=E)===S){s?1===s?Xp(t=function(t,n,e){var i=t;do{var r=i.prev,o=i.next.next}while(!Qp(r,o)&&Zp(r,i,i.next,o)&&qp(r,o)&&qp(o,r)&&(n.push(r.i/e),n.push(i.i/e),n.push(o.i/e),$p(i),$p(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,u=s.next.next;u!==s.prev;){if(s.i!==u.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&&Zp(e,e.next,t,n))return 1}while(e=e.next,e!==t);return}(t,n)&&qp(t,n)&&qp(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,u))return a=Kp(s,u),s=Hp(s,s.next),a=Hp(a,a.next),Xp(s,n,e,i,r,o),Xp(a,n,e,i,r,o);u=u.next}}while(s=s.next,s!==t)}(t,n,e,i,r,o):Xp(Hp(t),n,e,i,r,o,1);break}}}function Vp(t,n){return t.x-n.x}function zp(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 Wp(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 Yp(t,n,e){return(n.y-t.y)*(e.x-n.x)-(n.x-t.x)*(e.y-n.y)}function Qp(t,n){return t.x===n.x&&t.y===n.y}function Zp(t,n,e,i){return Qp(t,e)&&Qp(n,i)||Qp(t,i)&&Qp(e,n)||0<Yp(t,n,e)!=0<Yp(t,n,i)&&0<Yp(e,i,t)!=0<Yp(e,i,n)}function qp(t,n){return Yp(t.prev,t,t.next)<0?0<=Yp(t,n,t.next)&&0<=Yp(t,t.prev,n):Yp(t,n,t.prev)<0||Yp(t,t.next,n)<0}function Kp(t,n){var e=new tm(t.i,t.x,t.y),i=new tm(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 Jp(t,n,e,i){t=new tm(t,n,e);return i?(t.next=i.next,(t.prev=i).next.prev=t,i.next=t):(t.prev=t).next=t,t}function $p(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 tm(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 nm={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 nm.area(t)<0},triangulateShape:function(t,n){var e=[],i=[],r=[],o=(em(t),im(e,t),t.length);n.forEach(em);for(var s=0;s<n.length;s++)i.push(o),o+=n[s].length,im(e,n[s]);for(var a=Bp(e,i),s=0;s<a.length;s+=3)r.push(a.slice(s,s+3));return r}};function em(t){var n=t.length;2<n&&t[n-1].equals(t[0])&&t.pop()}function im(t,n){for(var e=0;e<n.length;e++)t.push(n[e].x),t.push(n[e].y)}function rm(t){return(rm="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 om(t,n){Bs.call(this),this.type="ShapeGeometry","object"===rm(n)&&(console.warn("THREE.ShapeGeometry: Options parameter has been removed."),n=n.curveSegments),this.parameters={shapes:t,curveSegments:n},this.fromBufferGeometry(new sm(t,n)),this.mergeVertices()}function sm(t,l){oa.call(this),this.type="ShapeBufferGeometry",this.parameters={shapes:t,curveSegments:l},l=l||12;var d=[],v=[],p=[],m=[],n=0,y=0;if(!1===Array.isArray(t))i(t);else for(var e=0;e<t.length;e++)i(t[e]),this.addGroup(n,y,e),n+=y,y=0;function i(t){var n,e=v.length/3,t=t.extractPoints(l),i=t.shape,r=t.holes;for(!1===nm.isClockWise(i)&&(i=i.reverse()),s=0,a=r.length;s<a;s++)n=r[s],!0===nm.isClockWise(n)&&(r[s]=n.reverse());for(var o=nm.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 c=o[s],h=c[0]+e,f=c[1]+e,c=c[2]+e;d.push(h,f,c),y+=3}}this.setIndex(d),this.setAttribute("position",new x(v,3)),this.setAttribute("normal",new x(p,3)),this.setAttribute("uv",new x(m,2))}function am(t,n){Bs.call(this),this.type="ExtrudeGeometry",this.parameters={shapes:t,options:n},this.fromBufferGeometry(new um(t,n)),this.mergeVertices()}function um(t,Z){oa.call(this),this.type="ExtrudeBufferGeometry",this.parameters={shapes:t,options:Z},t=Array.isArray(t)?t:[t];for(var q=this,K=[],J=[],n=0,e=t.length;n<e;n++)!function(C){var i=[],D=void 0!==Z.curveSegments?Z.curveSegments:12,l=void 0!==Z.steps?Z.steps:1,t=void 0!==Z.depth?Z.depth:100,e=void 0===Z.bevelEnabled||Z.bevelEnabled,n=void 0!==Z.bevelThickness?Z.bevelThickness:6,k=void 0!==Z.bevelSize?Z.bevelSize:n-2,U=void 0!==Z.bevelOffset?Z.bevelOffset:0,d=void 0!==Z.bevelSegments?Z.bevelSegments:3,r=Z.extrudePath,B=void 0!==Z.UVGenerator?Z.UVGenerator:cm;void 0!==Z.amount&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),t=Z.amount);var o,s,a,u,c,h,f,v,G=!1;r&&(o=r.getSpacedPoints(l),e=!(G=!0),s=r.computeFrenetFrames(l,!1),a=new Tt,u=new Tt,c=new Tt);e||(U=k=n=d=0);var r=C.extractPoints(D),p=r.shape,m=r.holes;if(!nm.isClockWise(p))for(p=p.reverse(),f=0,v=m.length;f<v;f++)h=m[f],nm.isClockWise(h)&&(m[f]=h.reverse());var y=nm.triangulateShape(p,m),b=p;for(f=0,v=m.length;f<v;f++)h=m[f],p=p.concat(h);function g(t,n,e){return n||console.error("THREE.ExtrudeGeometry: vec does not exist"),n.clone().multiplyScalar(e).add(t)}var _,w,x,E,S,T,A=p.length,H=y.length;function X(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),c=Math.sqrt(o*o+s*s),h=n.x-r/u,n=n.y+i/u,u=((e.x-s/c-h)*s-(e.y+o/c-n)*o)/(i*s-r*o),e=(c=h+i*u-t.x)*c+(h=n+r*u-t.y)*h;if(e<=2)return new Mt(c,h);u=Math.sqrt(e/2)}else{n=!1;i>Number.EPSILON?o>Number.EPSILON&&(n=!0):i<-Number.EPSILON?o<-Number.EPSILON&&(n=!0):Math.sign(r)===Math.sign(s)&&(n=!0),u=n?(c=-r,h=i,Math.sqrt(a)):(c=i,h=r,Math.sqrt(a/2))}return new Mt(c/u,h/u)}for(var V=[],M=0,O=b.length,L=O-1,R=M+1;M<O;M++,L++,R++)L===O&&(L=0),R===O&&(R=0),V[M]=X(b[M],b[L],b[R]);var N,P,z=[],W=V.concat();for(f=0,v=m.length;f<v;f++){for(h=m[f],N=[],M=0,O=h.length,L=O-1,R=M+1;M<O;M++,L++,R++)L===O&&(L=0),R===O&&(R=0),N[M]=X(h[M],h[L],h[R]);z.push(N),W=W.concat(N)}for(_=0;_<d;_++){for(x=_/d,E=n*Math.cos(x*Math.PI/2),w=k*Math.sin(x*Math.PI/2)+U,M=0,O=b.length;M<O;M++)F((S=g(b[M],V[M],w)).x,S.y,-E);for(f=0,v=m.length;f<v;f++)for(h=m[f],N=z[f],M=0,O=h.length;M<O;M++)F((S=g(h[M],N[M],w)).x,S.y,-E)}for(w=k+U,M=0;M<A;M++)S=e?g(p[M],W[M],w):p[M],G?(u.copy(s.normals[0]).multiplyScalar(S.x),a.copy(s.binormals[0]).multiplyScalar(S.y),c.copy(o[0]).add(u).add(a),F(c.x,c.y,c.z)):F(S.x,S.y,0);for(P=1;P<=l;P++)for(M=0;M<A;M++)S=e?g(p[M],W[M],w):p[M],G?(u.copy(s.normals[P]).multiplyScalar(S.x),a.copy(s.binormals[P]).multiplyScalar(S.y),c.copy(o[P]).add(u).add(a),F(c.x,c.y,c.z)):F(S.x,S.y,t/l*P);for(_=d-1;0<=_;_--){for(x=_/d,E=n*Math.cos(x*Math.PI/2),w=k*Math.sin(x*Math.PI/2)+U,M=0,O=b.length;M<O;M++)F((S=g(b[M],V[M],w)).x,S.y,t+E);for(f=0,v=m.length;f<v;f++)for(h=m[f],N=z[f],M=0,O=h.length;M<O;M++)S=g(h[M],N[M],w),G?F(S.x,S.y+o[l-1].y,o[l-1].x+E):F(S.x,S.y,t+E)}function Y(t,n){var e,i;for(M=t.length;0<=--M;){(i=(e=M)-1)<0&&(i=t.length-1);for(var r=0,o=l+2*d,r=0;r<o;r++){var s=A*r,a=A*(r+1),u=(f=h=c=u=void 0,n+e+s),c=n+i+s,h=n+i+a,f=n+e+a;j(u),j(c),j(f),j(c),j(h),j(f),u=K.length/3,I((c=B.generateSideWallUV(q,K,u-6,u-3,u-2,u-1))[0]),I(c[1]),I(c[3]),I(c[1]),I(c[2]),I(c[3])}}}function F(t,n,e){i.push(t),i.push(n),i.push(e)}function Q(t,n,e){j(t),j(n),j(e);t=K.length/3,n=B.generateTopUV(q,K,t-3,t-2,t-1);I(n[0]),I(n[1]),I(n[2])}function j(t){K.push(i[3*t+0]),K.push(i[3*t+1]),K.push(i[3*t+2])}function I(t){J.push(t.x),J.push(t.y)}(function(){var t=K.length/3;if(e){var n=0*A;for(M=0;M<H;M++)Q((T=y[M])[2]+n,T[1]+n,T[0]+n);for(n=A*(l+2*d),M=0;M<H;M++)Q((T=y[M])[0]+n,T[1]+n,T[2]+n)}else{for(M=0;M<H;M++)Q((T=y[M])[2],T[1],T[0]);for(M=0;M<H;M++)Q((T=y[M])[0]+A*l,T[1]+A*l,T[2]+A*l)}q.addGroup(t,K.length/3-t,0)})(),function(){var t=K.length/3,n=0;for(Y(b,n),n+=b.length,f=0,v=m.length;f<v;f++)Y(h=m[f],n),n+=h.length;q.addGroup(t,K.length/3-t,1)}()}(t[n]);this.setAttribute("position",new x(K,3)),this.setAttribute("uv",new x(J,2)),this.computeVertexNormals()}(om.prototype=Object.create(Bs.prototype)).constructor=om,(sm.prototype=Object.create(oa.prototype)).constructor=sm,(am.prototype=Object.create(Bs.prototype)).constructor=am,(um.prototype=Object.create(oa.prototype)).constructor=um;var cm={generateTopUV:function(t,n,e,i,r){var o=n[3*e],e=n[3*e+1],s=n[3*i],i=n[3*i+1],a=n[3*r],n=n[3*r+1];return[new Mt(o,e),new Mt(s,i),new Mt(a,n)]},generateSideWallUV:function(t,n,e,i,r,o){var s=n[3*e],a=n[3*e+1],e=n[3*e+2],u=n[3*i],c=n[3*i+1],i=n[3*i+2],h=n[3*r],f=n[3*r+1],r=n[3*r+2],l=n[3*o],d=n[3*o+1],n=n[3*o+2];return Math.abs(a-c)<.01?[new Mt(s,1-e),new Mt(u,1-i),new Mt(h,1-r),new Mt(l,1-n)]:[new Mt(a,1-e),new Mt(c,1-i),new Mt(f,1-r),new Mt(d,1-n)]}},hm=new Mt;function fm(t,n){this.min=void 0!==t?t:new Mt(1/0,1/0),this.max=void 0!==n?n:new Mt(-1/0,-1/0)}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 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,function(t){t=function(t,n){if("object"!=lm(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=lm(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==lm(t)?t:t+""}(i.key),i)}}Object.assign(fm.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=hm.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 Mt),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 Mt),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 Mt),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 Mt),n.copy(t).clamp(this.min,this.max)},distanceToPoint:function(t){return hm.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 vm=function(){function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function")}return n=t,i=[{key:"findNearNthPowerOfTwo",value:function(t){t-=1;return(t=(t=(t=(t=(t|=t>>1)|t>>2)|t>>4)|t>>8)|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,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 0==o||(r=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),0==o)?null:{x:r,y:s/o}}},{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){var i;return 0<=t.x&&n.x<0||(0===t.x&&0===n.x?t.y>n.y:(i=(t.x-e.x)*(n.y-e.y)-(n.x-e.x)*(t.y-e.y))<0||!(0<i)&&(i=(t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y),(n.x-e.x)*(n.x-e.y)+(n.y-e.y)*(n.y-e.y)<i))}},{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)&&dm(n.prototype,e),i&&dm(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,e,i}();function pm(t){return(pm="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 mm(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,function(t){t=function(t,n){if("object"!=pm(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=pm(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==pm(t)?t:t+""}(i.key),i)}}function ym(t,n,e){n=_m(n);var i=t,n=bm()?Reflect.construct(n,e||[],_m(t).constructor):n.apply(t,e);if(n&&("object"===pm(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function bm(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(bm=function(){return!!t})()}function gm(){return(gm="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,n,e){var i=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=_m(t)););return t}(t,n);if(i)return(i=Object.getOwnPropertyDescriptor(i,n)).get?i.get.call(arguments.length<3?t:e):i.value}).apply(this,arguments)}function _m(t){return(_m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function wm(t,n){return(wm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var xm=function(){function n(){var t;if(this instanceof n)return(t=ym(this,n)).Uu={},t;throw new TypeError("Cannot call a class as a function")}var t,e=n,i=C0;if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");return e.prototype=Object.create(i&&i.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),i&&wm(e,i),e=n,(i=[{key:"resize",value:function(){gm(_m(n.prototype),"resize",this).call(this),this.Uu={}}}])&&mm(e.prototype,i),t&&mm(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}();function Em(t){return(Em="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 Sm(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,function(t){t=function(t,n){if("object"!=Em(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Em(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Em(t)?t:t+""}(i.key),i)}}function Tm(t,n,e){return n&&Sm(t.prototype,n),e&&Sm(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}ev=Tm(function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function")});Object.assign(ev.prototype,{us:function(t,n,e,i,r){r=void 0!==r?"?contentVersion=".concat(r):"";t=new zh({method:"GET",url:t+n+"/"+n+".theme"+r});return t.us(function(t){e&&e(t)},function(t){i&&i(t===mr.PATH_ERROR?mr.THEME_ID_URL_ERROR:t)}),t}});var Am,Mm=new ev,tv={NORMAL:1,INDOOR:2,OUTDOOR:4},Om=(Object.freeze(tv),tv),Lm=new Tt,Rm=new Tt,Nm=new Tt,Pm=new Mt,Fm=new Mt,jm=new At,Im=new Tt,Cm=new Tt,Dm=new Tt,km=new Mt,Um=new Mt,Bm=new Mt;function Gm(t){var n;a.call(this),this.type="Sprite",void 0===Am&&(Am=new oa,n=new lh(new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),5),Am.setIndex([0,1,2,0,2,3]),Am.setAttribute("position",new vh(n,3,0,!1)),Am.setAttribute("uv",new vh(n,2,3,!1))),this.geometry=Am,this.material=void 0!==t?t:new Dl,this.center=new Mt(.5,.5)}function Hm(t,n,e,i,r,o){Pm.subVectors(t,e).addScalar(.5).multiply(i),void 0!==r?(Fm.x=o*Pm.x-r*Pm.y,Fm.y=r*Pm.x+o*Pm.y):Fm.copy(Pm),t.copy(n),t.x+=Fm.x,t.y+=Fm.y,t.applyMatrix4(jm)}function Xm(t){return(Xm="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 Vm(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,function(t){t=function(t,n){if("object"!=Xm(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Xm(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Xm(t)?t:t+""}(i.key),i)}}Gm.prototype=Object.assign(Object.create(a.prototype),{constructor:Gm,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.'),Rm.setFromMatrixScale(this.matrixWorld),jm.copy(t.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(t.camera.matrixWorldInverse,this.matrixWorld),Nm.setFromMatrixPosition(this.modelViewMatrix),t.camera.isPerspectiveCamera&&!1===this.material.sizeAttenuation&&Rm.multiplyScalar(-Nm.z);var e,i,r=this.material.rotation,r=(0!==r&&(i=Math.cos(r),e=Math.sin(r)),this.center);Hm(Im.set(-.5,-.5,0),Nm,r,Rm,e,i),Hm(Cm.set(.5,-.5,0),Nm,r,Rm,e,i),Hm(Dm.set(.5,.5,0),Nm,r,Rm,e,i),km.set(0,0),Um.set(1,0),Bm.set(1,1),null===t.ray.intersectTriangle(Im,Cm,Dm,!1,Lm)&&(Hm(Cm.set(-.5,.5,0),Nm,r,Rm,e,i),Um.set(0,1),null===t.ray.intersectTriangle(Im,Dm,Cm,!1,Lm))||(r=t.ray.origin.distanceTo(Lm))<t.near||r>t.far||n.push({distance:r,point:Lm.clone(),uv:ja.getUV(Lm,Im,Cm,Dm,km,Um,Bm,new Mt),face:null,object:this})},clone:function(){return new this.constructor(this.material).copy(this)},copy:function(t){return a.prototype.copy.call(this,t),void 0!==t.center&&this.center.copy(t.center),this}});var nv=function(){function n(t){if(!(this instanceof n))throw new TypeError("Cannot call a class as a function");this.uh=t,this.$t=!0,this.hh=new Map,this.fh={x:1,y:1,z:1},this.lh=!0,this.Ei=null}return t=n,(e=[{key:"visible",get:function(){return this.$t},set:function(t){this.$t=t,this.hh.forEach(function(t){t.dh()})}},{key:"show",get:function(){return this.lh},set:function(t){t!==this.lh&&(this.lh=t,this.ph({opacity:t?1:0,duration:1,finish:function(){}}))}},{key:"setFacadeNode",value:function(t){var n=t.FID;t.type===E.LABEL&&(n="label"+t.FID),this.hh.set(n,t)}}])&&Vm(t.prototype,e),i&&Vm(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,i}(),zm=(Object.assign(nv.prototype,{ec:function(t){var n;this.lh=!this.uh.parent.Pt.Ko(this.uh),this.uh.mh===Om.NORMAL&&(this.uh.yh(),n=this.uh.parent.Sn.vr(this.uh.yi),this.fh.z=n.isZoomLimit?.2:1),t.Rt&&(t.bi===E.EXTERNAL_MODEL?(t.Rt.scale.x=this.fh.x,t.Rt.scale.y=this.fh.z,t.Rt.scale.z=this.fh.y):t.bi===E.MODEL&&(t.Rt.scale.x=this.fh.x,t.Rt.scale.y=this.fh.y,t.Rt.scale.z=this.fh.z)),this.ph({opacity:this.lh?1:0,duration:1,finish:function(){}})},bh:function(a,t){var u;t.scale.z===this.fh.z&&t.scale.y===this.fh.y||(u=void 0!==t.duration?t.duration:.5,this.fh=t.scale,this.hh.forEach(function(n){var e,i,r,o,s;n.bi!==E.MODEL&&n.bi!==E.EXTERNAL_MODEL||n.Rt&&(e=n.Rt.scale.x,i=n.Rt.scale.y,r=n.Rt.scale.z,o={x:t.scale.x-e,y:t.scale.z-i,z:t.scale.y-r},n.bi===E.MODEL&&(o={x:t.scale.x-e,y:t.scale.y-i,z:t.scale.z-r}),(s=new Pr({src:[0],dest:[1]})).qn(u).Jn(function(t){t=t.destination[0];n.Rt?(n.Rt.scale.x=o.x*t+e,n.Rt.scale.y=o.y*t+i,n.Rt.scale.z=o.z*t+r,a.enableUpdateRender()):a.nr.tr(s)}).$n(function(){a.nr.tr(s),t.finish&&t.finish()}),a.nr.Ki(s.Wn()))}))},ph:function(i){var n=this,r=(this.Ei?this.Ei.finish():this.Ei=new Pr,this.visible=!0,this.uh.parent),o=[];this.hh.forEach(function(e){e.Rt&&e.Rt.traverse(function(t){var n;t.constructor!==$a&&t.constructor!==Gm||(e.bi===E.MODEL&&(n=t.material.clone(),t.material.dispose(),t.material=n),n=t.material,Array.isArray(n)||(n=[n]),e.gh&&n.push(e.gh.material),n.forEach(function(t){"FMMeshStandardMaterial"===t.type?o.push({material:t,offset:i.opacity-t.uniforms.opacity.value,opacity:t.uniforms.opacity.value}):o.push({material:t,offset:i.opacity-t.opacity,opacity:t.opacity})}))})}),this.Ei.Qn([0]).Zn([1]).qn(i.duration).Jn(function(t){for(var n=t.destination[0],e=0;e<o.length;e++)"FMMeshStandardMaterial"===o[e].material.type?o[e].material.uniforms.opacity.value=o[e].offset*n+o[e].opacity:o[e].material.opacity=o[e].offset*n+o[e].opacity,o[e].material.transparent=!0,o[e].needsUpdate=!0;r.enableUpdateRender()}).$n(function(){n.visible=n.lh;for(var t=0;t<o.length;t++)"FMMeshStandardMaterial"===o[t].material.type?o[t].material.uniforms.opacity.value=o[t].opacity:o[t].material.opacity=o[t].opacity,o[t].needsUpdate=!0;r.nr.tr(n.Ei),i.finish&&i.finish(),r.enableUpdateRender()}).play(),r.nr.Ki(this.Ei)}}),nv);function Wm(t){return(Wm="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,i,r,o,s="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(s)return i=!(e=!0),{s:function(){s=s.call(t)},n:function(){var t=s.next();return e=t.done,t},e:function(t){i=!0,r=t},f:function(){try{e||null==s.return||s.return()}finally{if(i)throw r}}};if(Array.isArray(t)||(s=function(t,n){var e;if(t)return"string"==typeof t?Qm(t,n):"Map"===(e="Object"===(e=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Qm(t,n):void 0}(t))||n&&t&&"number"==typeof t.length)return s&&(t=s),o=0,{s:n=function(){},n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},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.")}function Qm(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 Zm(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,function(t){t=function(t,n){if("object"!=Wm(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Wm(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Wm(t)?t:t+""}(i.key),i)}}function qm(t,n,e){n=$m(n);var i=t,n=Km()?Reflect.construct(n,e||[],$m(t).constructor):n.apply(t,e);if(n&&("object"===Wm(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function Km(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Km=function(){return!!t})()}function Jm(){return(Jm="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,n,e){var i=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=$m(t)););return t}(t,n);if(i)return(i=Object.getOwnPropertyDescriptor(i,n)).get?i.get.call(arguments.length<3?t:e):i.value}).apply(this,arguments)}function $m(t){return($m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function t1(t,n){return(t1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var e=function(){function e(t){var n;if(this instanceof e)return(n=qm(this,e,[t]))._h=t.minlevel,n.wh=t.maxlevel,n.xh=t.levelChart,n.Eh=t.fids,n.mh=Om.NORMAL,n.Sh=new zm(n),n.Th=!1,n.Ah=new Map,n.Mh=!0,n;throw new TypeError("Cannot call a class as a function")}var t,n=e,i=Es;if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");return n.prototype=Object.create(i&&i.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),i&&t1(n,i),n=e,(i=[{key:"zoomRange",get:function(){return{minLevel:this._h,maxLevel:this.wh}}},{key:"alignHeight",get:function(){return this.Mh&&(this.Oh(),this.Mh=!1),this.Ah}},{key:"overviewMode",get:function(){return this.mh}},{key:"visible",get:function(){return this.$t},set:function(t){this.$t=t,this.jn.Pt.Lh(this),this.jn.enableUpdateNode()}},{key:"levelChart",get:function(){return this.xh}},{key:"setTheme",value:function(t){this.jn.Pt.Rh({themeID:t,bid:this.yi})}},{key:"setThemeExtension",value:function(t){this.jn.Pt.Nh({data:t,bid:this.yi})}},{key:"clearThemeExtension",value:function(){this.jn.Pt.Nh({bid:this.yi})}},{key:"getFadeFeatures",value:function(){var t,n=[],e=Ym(this.Sh.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(){Jm($m(e.prototype),"dispose",this).call(this)}}])&&Zm(n.prototype,i),t&&Zm(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}(),n1=(Object.assign(e.prototype,{Ki:function(t){(t.jn=this).Lt.push(t)},yh:function(){var t,n=this.parent.Sn.vr(this.yi);this.mh===Om.OUTDOOR?n.isZoomLimit=!1:(t=this.parent.getZoom(),n.isZoomLimit=!(t<this._h||t>=this.wh))},Ph:function(){this.yh();var t=this.parent.Sn.vr(this.yi);this.Sh.bh(this.parent,{scale:{x:1,y:1,z:t.isZoomLimit?.2:1},duration:1,finish:function(){}})},Oh:function(){if(this.jn)for(var t=this.jn.An,n=0;n<this.xh.length;n+=2){var e=t.floorSpace*this.xh[n];this.Ah.set(this.xh[n+1],e)}},Fh:function(t){if(void 0===this.level||null===this.level)for(var n,e=0;e<this.xh.length;e+=2)this.xh[e]===t&&((n=this.parent.Sn.vr(this.yi)).level=this.xh[e+1],n.visibleLevels=[this.xh[e+1]])}}),e);function e1(t,n){return Object.assign({},n.Oi,{buildingID:t.wr,level:t.level,visibleLevels:t.visibleLevels,bid:t.yi})}var ev={NAME:2,ENAME:4,FID:8},i1=(Object.freeze(ev),ev);function r1(t){return(r1="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 o1(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,c1(i.key),i)}}function s1(t,n,e){n=l1(n);var i=t,n=a1()?Reflect.construct(n,e||[],l1(t).constructor):n.apply(t,e);if(n&&("object"===r1(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function a1(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(a1=function(){return!!t})()}function u1(t,n,e,i){return(u1="undefined"!=typeof Reflect&&Reflect.set?Reflect.set:function(t,n,e,i){var r,t=f1(t,n);if(t){if((r=Object.getOwnPropertyDescriptor(t,n)).set)return r.set.call(i,e),!0;if(!r.writable)return!1}if(r=Object.getOwnPropertyDescriptor(i,n)){if(!r.writable)return!1;r.value=e,Object.defineProperty(i,n,r)}else t=i,r=e,!((i=c1(i=n))in t?Object.defineProperty(t,i,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[i]=r);return!0})(t,n,e,i)}function c1(t){t=function(t,n){if("object"!=r1(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=r1(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==r1(t)?t:t+""}function h1(){return(h1="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,n,e){var i=f1(t,n);if(i)return(i=Object.getOwnPropertyDescriptor(i,n)).get?i.get.call(arguments.length<3?t:e):i.value}).apply(this,arguments)}function f1(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=l1(t)););return t}function l1(t){return(l1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function d1(t,n){return(d1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var tv=function(){function r(t){var n;if(this instanceof r)return(n=s1(this,r,[t])).nt=t.height,n.Or=t.bounds,n.jh=t.zoom,n;throw new TypeError("Cannot call a class as a function")}var t,n=r,e=Es;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&d1(n,e),n=r,(e=[{key:"height",get:function(){return this.nt}},{key:"floorSpace",get:function(){return h1(l1(r.prototype),"floorSpace",this)},set:function(t){var n=this,e=l1(r.prototype),i=!0;if(!u1(e,"floorSpace",t,this||e)&&i)throw new TypeError("failed to set property");this.jn.traverse(function(t){t!==n&&(t.Mh=!0,t.traverse(function(t){t.Lr({animate:!1})}))}),this.jn.Ht.yr(this,{level:this.level,animate:!1,finish:function(){n.parent.It.Xt(),n.parent.It.On(),n.parent.It.render()}})}},{key:"getFloors",value:function(){return this.Lt}}])&&o1(n.prototype,e),t&&o1(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}(),v1=(Object.assign(tv.prototype,{Ki:function(t){(t.jn=this).Lt.push(t)}}),tv);function p1(t){return(p1="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 m1(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,function(t){t=function(t,n){if("object"!=p1(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=p1(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==p1(t)?t:t+""}(i.key),i)}}var y1=function(){return t=function t(){var n=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0,e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0,i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:0,r=this,o=t;if(!(r instanceof o))throw new TypeError("Cannot call a class as a function");Object.defineProperty(this,"isVector3",{value:!0}),this.x=n,this.y=e,this.z=i},(n=[{key:"set",value:function(t,n,e){return void 0===e&&(e=this.z),this.x=t,this.y=n,this.z=e,this}},{key:"clone",value:function(){return new this.constructor(this.x,this.y,this.z)}},{key:"copy",value:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}},{key:"sub",value: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)}},{key:"subVectors",value:function(t,n){return this.x=t.x-n.x,this.y=t.y-n.y,this.z=t.z-n.z,this}},{key:"multiplyScalar",value:function(t){return this.x*=t,this.y*=t,this.z*=t,this}},{key:"dot",value:function(t){return this.x*t.x+this.y*t.y+this.z*t.z}},{key:"lengthSq",value:function(){return this.x*this.x+this.y*this.y+this.z*this.z}},{key:"length",value:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}},{key:"cross",value: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)}},{key:"crossVectors",value:function(t,n){var e=t.x,i=t.y,t=t.z,r=n.x,o=n.y,n=n.z;return this.x=i*n-t*o,this.y=t*r-e*n,this.z=e*o-i*r,this}},{key:"angleTo",value:function(t){var n=Math.sqrt(this.lengthSq()*t.lengthSq());return 0===n?Math.PI/2:(t=this.dot(t)/n,n=Math.max(-1,Math.min(1,t)),Math.acos(n))}},{key:"normalize",value:function(){return this.divideScalar(this.length()||1)}},{key:"divideScalar",value:function(t){return this.multiplyScalar(1/t)}}])&&m1(t.prototype,n),e&&m1(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,e}();function b1(t){return(b1="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 g1(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,function(t){t=function(t,n){if("object"!=b1(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=b1(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==b1(t)?t:t+""}(i.key),i)}}var _1=function(){function n(t){if(!(this instanceof n))throw new TypeError("Cannot call a class as a function");this.qt=t.size,this.Jt=t.center,this.Ih=t.points}return t=n,(e=[{key:"size",get:function(){return this.qt}},{key:"min",get:function(){return{x:this.Jt.x-this.qt.x/2,y:this.Jt.y-this.qt.y/2}}},{key:"max",get:function(){return{x:this.Jt.x+this.qt.x/2,y:this.Jt.y+this.qt.y/2}}},{key:"center",get:function(){return{x:this.Jt.x,y:this.Jt.y}}},{key:"points",get:function(){return this.Ih}}])&&g1(t.prototype,e),i&&g1(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,i}();function w1(t){return(w1="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 x1(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,function(t){t=function(t,n){if("object"!=w1(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=w1(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==w1(t)?t:t+""}(i.key),i)}}var E1=function(){function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function")}return n=t,i=[{key:"distance",value:function(t,n){return z.distance(t,n)}},{key:"isContain",value:function(t,n){return z.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:"orientedBound",value:function(t){var n={center:{x:0,y:0},size:{x:0,y:0},rotation:{x:0,y:0},corners:[]};if(t&&0!=t.length){for(var e=Lr.cov(t),i=Lr.eig(e).eigVect,r=[],o=Number.MAX_VALUE,s=Number.MAX_VALUE,a=-Number.MAX_VALUE,u=-Number.MAX_VALUE,c=0;c<t.length;c++){var h=t[c].x*i[0][0]+t[c].y*i[0][1],f=t[c].x*i[1][0]+t[c].y*i[1][1];h<o&&(o=h),f<s&&(s=f),a<h&&(a=h),u<f&&(u=f),r.push([h,f])}var e=[(a+o)/2,(u+s)/2],l=i[0][0]*i[1][1]-i[1][0]*i[0][1],l=[[i[1][1]/l,-i[0][1]/l],[-i[1][0]/l,i[0][0]/l]],e=[l[0][0]*e[0]+l[0][1]*e[1],l[1][0]*e[0]+l[1][1]*e[1]],e=(n.center.x=e[0],n.center.y=e[1],n.size.x=a-o,n.size.y=u-s,[[o,s],[o,u],[a,u],[a,s]]),d=[[],[],[],[]],l=(d[0]=[l[0][0]*e[0][0]+l[0][1]*e[0][1],l[1][0]*e[0][0]+l[1][1]*e[0][1]],d[1]=[l[0][0]*e[1][0]+l[0][1]*e[1][1],l[1][0]*e[1][0]+l[1][1]*e[1][1]],d[2]=[l[0][0]*e[2][0]+l[0][1]*e[2][1],l[1][0]*e[2][0]+l[1][1]*e[2][1]],d[3]=[l[0][0]*e[3][0]+l[0][1]*e[3][1],l[1][0]*e[3][0]+l[1][1]*e[3][1]],new y1(1,0,0)),e=new y1(d[0][0],0,d[0][1]),e=new y1(d[3][0],0,d[3][1]).clone().sub(e).normalize(),v=e.angleTo(l)*z.pe(),e=0<e.clone().cross(l).y?v:360-v,v=new y1(d[0][0],0,d[0][1]),v=new y1(d[1][0],0,d[1][1]).clone().sub(v).normalize(),p=v.angleTo(l)*z.pe(),v=0<v.clone().cross(l).y;return n.rotation={x:e,y:v?p:360-p},n.corners=[{x:d[0][0],y:d[0][1]},{x:d[1][0],y:d[1][1]},{x:d[2][0],y:d[2][1]},{x:d[3][0],y:d[3][1]}],n}}},{key:"scaleBound",value:function(t,n){var e=t.max,t=t.min,e=new Mt(e.x,e.y),t=new Mt(t.x,t.y),i=e.clone().add(t).multiplyScalar(.5),e=e.clone().sub(t),t=e.clone().normalize(),e=e.clone().length()*n,n=i.clone().add(t.clone().multiplyScalar(e/2)),i=i.clone().add(t.clone().multiplyScalar(-e/2)),t=n.x,e=n.y,n=i.x,i=i.y;return{max:{x:t,y:e},min:{x:n,y:i},size:{x:Math.abs(t-n),y:Math.abs(e-i)},center:{x:(t+n)/2,y:(e+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){for(var r=[],o=(r.push(n),[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 z.Ie(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=[],a=(i.forEach(function(t,n,e){s.push(t)}),!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){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)}}},{key:"maxInnerRect",value:function(t,n){if(t&&0!=t.length){for(var e=new y1(0,0,1),i={center:{x:0,y:0},size:{x:0,y:0},rotation:{x:0,y:0},corners:[]},r=Number.MAX_VALUE,o=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=-Number.MAX_VALUE,u=[],c=0;c<t.length;c++){var h=t[c].x,f=t[c].y;h<r&&(r=h),f<o&&(o=f),s<h&&(s=h),a<f&&(a=f),u.push({x:h,y:f})}for(var l=void 0===n?.25:n,d=Math.ceil((s-r)/l),v=Math.ceil((a-o)/l),p=[],m=0;m<v-1;m++){for(var y=new Array(d-1).fill(0),b=0;b<d-1;b++){var g=r+l*b,_=r+l*(b+1),w=o+l*m,x=o+l*(m+1);z.isPolygonInPolygon([{x:g,y:w},{x:g,y:x},{x:_,y:x},{x:_,y:w}],u)&&(y[b]=1)}p.push(y)}for(var E=new Array(d).fill(0),C=0,D=0,k=0,U=0,B=0,S=0;S<v-1;S++)for(var T=[],A=0;A<d;A++){for(E[d-1]=0,A<d-1&&(E[A]=1==p[S][A]?E[A]+1:0);0<T.length&&E[T[T.length-1]]>=E[A];){var G=T[T.length-1],H=(T.pop(),E[G]*(0==T.length?A:A-T[T.length-1]-1));C<H&&(C=H,D=0==T.length?0:T[T.length-1]+1,k=A,B=(U=S)-E[G]+1)}T.push(A)}for(var n=r+D*l,M=o+(U+1)*l,O=r+(k+1)*l,L=o+B*l,R=[[n,L],[n,M],[O,M],[O,L]],N=0,P=2,X=Number.MAX_VALUE,V=-Number.MAX_VALUE,F=0;F<R.length;F++)R[F][0]*R[F][0]+R[F][1]*R[F][1]<X&&(X=R[N=F][0]*R[F][0]+R[F][1]*R[F][1]),R[F][0]*R[F][0]+R[F][1]*R[F][1]>V&&(V=R[P=F][0]*R[F][0]+R[F][1]*R[F][1]);i.corners=[{x:R[0][0],y:R[0][1]},{x:R[1][0],y:R[1][1]},{x:R[2][0],y:R[2][1]},{x:R[3][0],y:R[3][1]}],i.center.x=(R[P][0]+R[N][0])/2,i.center.y=(R[P][1]+R[N][1])/2;var n=new y1(R[N][0],0,R[N][1]),M=new y1(R[(N+P)/2][0],0,R[(N+P)/2][1]),O=M.clone().sub(n).normalize(),L=(O.angleTo(e),z.pe(),O.clone().cross(e).y,new y1(R[(N+P)/2][0],0,R[(N+P)/2][1])),j=new y1(R[P][0],0,R[P][1]),I=j.clone().sub(L).normalize();I.angleTo(e),z.pe();I.clone().cross(e).y;return O.clone().cross(I).y<0?(i.size.x=M.clone().sub(n).length(),i.size.y=j.clone().sub(L).length()):(i.size.x=j.clone().sub(L).length(),i.size.y=M.clone().sub(n).length()),new _1({center:i.center,size:i.size,points:i.corners})}}}],(e=null)&&x1(n.prototype,e),i&&x1(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,e,i}();function S1(n,t){var e,i=void 0!==(t=t||{}).duration?t.duration:1,r=void 0!==t.size?t.size:8,o=t.times||void 0,s=void 0!==t.delay?t.delay:0,a=1,u=n.gr(p);if(u)return n.Ei.has("boost")?((e=n.Ei.get("boost")).stop(),u.nr.tr(e)):(e=new Pr({src:[n.qt],dest:[r]}),n.Ei.set("boost",e)),e.qn(i).Wn().Jn(function(t){n.Rt&&u.It.zo(n.Rt,t.destination[0]),u.enableUpdateRender()}).$n(function(){var t;o<a||(t=0<a%1?0:s,e.ie().Kn(t).Wn(),u.enableUpdateRender(),a+=.5)}),u.nr.Ki(e),e}function T1(t){var n=t.gr(p),e=t.Ei.get("boost");e&&n&&(n.nr.tr(e),t.Ei.delete("boost"),t.Rt&&n.It.zo(t.Rt,t.qt),n.enableUpdateRender())}function A1(n,t){var e,i,r,o,s,a=n.gr(p);if(a)return e=void 0!==t.duration?t.duration:1,i=void 0!==t.times?t.times:1/0,r=void 0!==t.delay?t.delay:0,0===i&&(i=1/0),o=0,n.Ei.has("jump")?((s=n.Ei.get("jump")).Qn([n.nt]),s.Zn([n.nt+t.height])):(s=new Pr({src:[n.nt],dest:[n.nt+t.height]}),n.Ei.set("jump",s),a.nr.Ki(s)),s.qn(e).Kn(0).Jn(function(t){n.Rt&&(n.Rt.position.y=t.destination[0]),a.enableUpdateRender()}).$n(function(){var t;(o+=.5)<i&&(t=o%1==0?0:r,s.ie().Kn(t),s.Wn())}),s.Wn(),s}function M1(t){var n,e;t.Rt&&(n=t.gr(p))&&((e=t.Ei.get("jump"))&&(n.nr.tr(e),t.Ei.delete("jump")),t.Rt.position.y=t.nt,n.enableUpdateRender())}function O1(t,n){var e;n.Rt&&(t=t.Ch(n.size||n.qt),e=1,n.Rt.material.userData.scaleRatio&&(e=n.Rt.material.userData.scaleRatio),n.Rt.scale.set(t,t/e,t))}function L1(n){return!0===n.needUpdateBound&&(n.ci.reset(),n.Lt.forEach(function(t){n.ci.expand(t.bound)}),n.needUpdateBound=!1),n.ci.clone()}function R1(t){return(R1="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 N1(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,I1(i.key),i)}}function P1(t,n,e){n=k1(n);var i=t,n=F1()?Reflect.construct(n,e||[],k1(t).constructor):n.apply(t,e);if(n&&("object"===R1(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function F1(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(F1=function(){return!!t})()}function j1(t,n,e,i){return(j1="undefined"!=typeof Reflect&&Reflect.set?Reflect.set:function(t,n,e,i){var r,t=D1(t,n);if(t){if((r=Object.getOwnPropertyDescriptor(t,n)).set)return r.set.call(i,e),!0;if(!r.writable)return!1}if(r=Object.getOwnPropertyDescriptor(i,n)){if(!r.writable)return!1;r.value=e,Object.defineProperty(i,n,r)}else t=i,r=e,!((i=I1(i=n))in t?Object.defineProperty(t,i,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[i]=r);return!0})(t,n,e,i)}function I1(t){t=function(t,n){if("object"!=R1(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=R1(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==R1(t)?t:t+""}function C1(){return(C1="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,n,e){var i=D1(t,n);if(i)return(i=Object.getOwnPropertyDescriptor(i,n)).get?i.get.call(arguments.length<3?t:e):i.value}).apply(this,arguments)}function D1(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=k1(t)););return t}function k1(t){return(k1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function U1(t,n){return(U1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var B1=function(){function r(){var t;if(this instanceof r)return(t=P1(this,r)).Do=new Ps,t;throw new TypeError("Cannot call a class as a function")}var t,n=r,e=ms;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&U1(n,e),n=r,(e=[{key:"scene",get:function(){return this.Do}},{key:"bound",get:function(){return L1(this)}},{key:"isLayer",get:function(){return!0}},{key:"visible",get:function(){return C1(k1(r.prototype),"visible",this)},set:function(t){var n=k1(r.prototype),e=t,i=!0;if(!j1(n,"visible",e,this||n)&&i)throw new TypeError("failed to set property");t?this.Do.parent||this.parent.effectScene.add(this.Do):this.Do.parent&&this.parent.effectScene.remove(this.Do)}},{key:"init",value:function(){this.Do.position.y=this.parent.nt}}])&&N1(n.prototype,e),t&&N1(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}();function G1(t){return(G1="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 H1(t,n){var e,i,r,o,s="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(s)return i=!(e=!0),{s:function(){s=s.call(t)},n:function(){var t=s.next();return e=t.done,t},e:function(t){i=!0,r=t},f:function(){try{e||null==s.return||s.return()}finally{if(i)throw r}}};if(Array.isArray(t)||(s=function(t,n){var e;if(t)return"string"==typeof t?X1(t,n):"Map"===(e="Object"===(e=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?X1(t,n):void 0}(t))||n&&t&&"number"==typeof t.length)return s&&(t=s),o=0,{s:n=function(){},n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},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.")}function X1(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 V1(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,function(t){t=function(t,n){if("object"!=G1(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=G1(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==G1(t)?t:t+""}(i.key),i)}}function z1(t,n,e){n=Y1(n);var i=t,n=W1()?Reflect.construct(n,e||[],Y1(t).constructor):n.apply(t,e);if(n&&("object"===G1(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function W1(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(W1=function(){return!!t})()}function Y1(t){return(Y1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Q1(t,n){return(Q1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var nv=function(){function e(t){var n;if(this instanceof e)return(n=z1(this,e)).Dh=[],void 0!==t&&void 0!==t.type&&(n.bi=t.type),n;throw new TypeError("Cannot call a class as a function")}var t,n=e,i=B1;if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");return n.prototype=Object.create(i&&i.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),i&&Q1(n,i),n=e,(i=[{key:"getMarkers",value:function(){return this.Lt}},{key:"add",value:function(t){t.jn=this,t.kh||t.ec()?this.R(t):this.Dh.push(t),this.needUpdateBound=!0}},{key:"remove",value:function(t){this.Uh(t),t.dispose();var n=this.Lt.indexOf(t),n=(-1<n&&this.Lt.splice(n,1),this.Dh.indexOf(t));-1<n&&this.Dh.splice(n,1),this.needUpdateBound=!0}},{key:"clear",value:function(){var t,n=H1(this.Lt);try{for(n.s();!(t=n.n()).done;){var e=t.value;this.Uh(e),e.dispose()}}catch(t){n.e(t)}finally{n.f()}this.Lt.length=0}},{key:"traverse",value:function(t){var n,e=H1(this.Lt);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=H1(this.Lt);try{for(n.s();!(t=n.n()).done;){var e=t.value;this.Uh(e),e.dispose()}}catch(t){n.e(t)}finally{n.f()}this.Lt.length=0,this.Do=void 0}}])&&V1(n.prototype,i),t&&V1(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}(),Z1=(Object.assign(nv.prototype,{Bh:function(){var t,n=H1(this.Dh);try{for(n.s();!(t=n.n()).done;){var e,i=t.value;i.ec()&&(-1<(e=this.Dh.indexOf(i))&&this.Dh.splice(e,1),this.R(i))}}catch(t){n.e(t)}finally{n.f()}},R:function(t){this.Lt.push(t),t.Rt&&this.Do.add(t.Rt)},Uh:function(t){t.jn=void 0,this.Do.remove(t.Rt)}}),nv);function q1(t){return(q1="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 K1(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,function(t){t=function(t,n){if("object"!=q1(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=q1(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==q1(t)?t:t+""}(i.key),i)}}function J1(t,n,e){n=ty(n);var i=t,n=$1()?Reflect.construct(n,e||[],ty(t).constructor):n.apply(t,e);if(n&&("object"===q1(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function $1(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return($1=function(){return!!t})()}function ty(t){return(ty=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function ny(t,n){return(ny=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}e=function(){function n(){var t;if(this instanceof n)return(t=J1(this,n)).bi=E.IMAGE_MARKER,t.qo=!0,t;throw new TypeError("Cannot call a class as a function")}var t,e=n,i=Z1;if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");return e.prototype=Object.create(i&&i.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),i&&ny(e,i),e=n,(i=[{key:"collision",get:function(){return this.qo}}])&&K1(e.prototype,i),t&&K1(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}();function ey(t){return(ey="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 iy(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,function(t){t=function(t,n){if("object"!=ey(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=ey(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==ey(t)?t:t+""}(i.key),i)}}function ry(t,n,e){n=sy(n);var i=t,n=oy()?Reflect.construct(n,e||[],sy(t).constructor):n.apply(t,e);if(n&&("object"===ey(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function oy(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(oy=function(){return!!t})()}function sy(t){return(sy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function ay(t,n){return(ay=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}ev=function(){function n(){var t;if(this instanceof n)return(t=ry(this,n)).bi=E.TEXT_MARKER,t.isHasText=!0,t.qo=!0,t;throw new TypeError("Cannot call a class as a function")}var t,e=n,i=Z1;if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");return e.prototype=Object.create(i&&i.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),i&&ay(e,i),e=n,(i=[{key:"collision",get:function(){return this.qo}}])&&iy(e.prototype,i),t&&iy(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}();function uy(t){return(uy="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 cy(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,function(t){t=function(t,n){if("object"!=uy(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=uy(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==uy(t)?t:t+""}(i.key),i)}}function hy(t,n,e){n=ly(n);var i=t,n=fy()?Reflect.construct(n,e||[],ly(t).constructor):n.apply(t,e);if(n&&("object"===uy(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function fy(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(fy=function(){return!!t})()}function ly(t){return(ly=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function dy(t,n){return(dy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}tv=function(){function n(){var t;if(this instanceof n)return(t=hy(this,n)).bi=E.POLYGON_MARKER,t;throw new TypeError("Cannot call a class as a function")}var t,e,i=n,r=Z1;if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");return i.prototype=Object.create(r&&r.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),r&&dy(i,r),i=n,t&&cy(i.prototype,t),e&&cy(i,e),Object.defineProperty(i,"prototype",{writable:!1}),i}();function vy(t){return(vy="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 py(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,function(t){t=function(t,n){if("object"!=vy(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=vy(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==vy(t)?t:t+""}(i.key),i)}}function my(t,n,e){n=by(n);var i=t,n=yy()?Reflect.construct(n,e||[],by(t).constructor):n.apply(t,e);if(n&&("object"===vy(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function yy(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(yy=function(){return!!t})()}function by(t){return(by=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function gy(t,n){return(gy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}nv=function(){function n(){var t;if(this instanceof n)return(t=my(this,n)).bi=E.EXTRUDE_MARKER,t;throw new TypeError("Cannot call a class as a function")}var t,e,i=n,r=Z1;if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");return i.prototype=Object.create(r&&r.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),r&&gy(i,r),i=n,t&&py(i.prototype,t),e&&py(i,e),Object.defineProperty(i,"prototype",{writable:!1}),i}();function _y(t){return(_y="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 wy(t,n){var e,i,r,o,s="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(s)return i=!(e=!0),{s:function(){s=s.call(t)},n:function(){var t=s.next();return e=t.done,t},e:function(t){i=!0,r=t},f:function(){try{e||null==s.return||s.return()}finally{if(i)throw r}}};if(Array.isArray(t)||(s=function(t,n){var e;if(t)return"string"==typeof t?xy(t,n):"Map"===(e="Object"===(e=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?xy(t,n):void 0}(t))||n&&t&&"number"==typeof t.length)return s&&(t=s),o=0,{s:n=function(){},n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},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.")}function xy(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,function(t){t=function(t,n){if("object"!=_y(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=_y(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==_y(t)?t:t+""}(i.key),i)}}function Sy(t,n,e){n=My(n);var i=t,n=Ty()?Reflect.construct(n,e||[],My(t).constructor):n.apply(t,e);if(n&&("object"===_y(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function Ty(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Ty=function(){return!!t})()}function Ay(){return(Ay="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,n,e){var i=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=My(t)););return t}(t,n);if(i)return(i=Object.getOwnPropertyDescriptor(i,n)).get?i.get.call(arguments.length<3?t:e):i.value}).apply(this,arguments)}function My(t){return(My=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Oy(t,n){return(Oy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var Ly=function(){function n(){var t;if(this instanceof n)return(t=Sy(this,n)).bi=E.HEAT_MAP_MARKER,t.Gh=!1,t.Hh=t.Hh.bind(t),t;throw new TypeError("Cannot call a class as a function")}var t,e=n,i=Z1;if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");return e.prototype=Object.create(i&&i.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),i&&Oy(e,i),e=n,(i=[{key:"add",value:function(t){Ay(My(n.prototype),"add",this).call(this,t),t.kh&&!t.Xh&&this.Vh(t.zh),0<this.Dh.length&&this.gr(p).on("update",this.Hh)}},{key:"remove",value:function(t){Ay(My(n.prototype),"remove",this).call(this,t),this.Gh&&this.Vh(null)}}])&&Ey(e.prototype,i),t&&Ey(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}();Object.assign(Ly.prototype,{Bh:function(){var t,n=wy(this.Dh);try{for(n.s();!(t=n.n()).done;){var e,i=t.value;i.ec()&&(-1<(e=this.Dh.indexOf(i))&&this.Dh.splice(e,1),this.R(i),i.Xh||this.Vh(i.zh),i.needUpdateBound=!0)}}catch(t){n.e(t)}finally{n.f()}},Vh:function(i){var t=this.gr(v),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(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.Gh=!0},Hh:function(){this.Bh(),0===this.Dh.length&&this.gr(p).off("update",this.Hh)}});function Ry(t,n){Md.call(this,t,n),this.type="AmbientLight",this.castShadow=void 0}function Ny(t){return(Ny="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 Py(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,function(t){t=function(t,n){if("object"!=Ny(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Ny(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Ny(t)?t:t+""}(i.key),i)}}Ry.prototype=Object.assign(Object.create(Md.prototype),{constructor:Ry,isAmbientLight:!0});var Fy=function(){function n(t){if(!(this instanceof n))throw new TypeError("Cannot call a class as a function");this._n=t,this.Wh=null,this.Yh=null,this.Qh=null,this.Zh=null,this.createLight=this.createLight.bind(this)}return t=n,(e=[{key:"createLight",value:function(t,n){var e=this._n.getMapOptions(),i=e.lockedLight,e=e.lightConfig[n];return t.qh=new Ry(e[1].color,e[1].intensity),t.Kh=new a,t.Jh=new Rd(e[0].color,e[0].intensity),t.Jh.position.set(e[0].position.x,e[0].position.y,e[0].position.z),t.Jh.target=t.Kh,t.$h=new Rd(e[2].color,e[2].intensity),t.$h.position.set(e[2].position.x,e[2].position.y,e[2].position.z),t.$h.target=t.Kh,this.Wh=t,this.Yh=n,i&&(this.tf=this.tf.bind(this),this._n.on("viewChanged",this.tf)),this}},{key:"createLightByTheme",value:function(t,n,e){return t.qh=new Ry(new lt("rgb("+e[1].color+")"),e[1].intensity),t.Jh=new Rd(new lt("rgb("+e[0].color+")"),e[0].intensity),t.Jh.position.set(e[0].position.x,e[0].position.y,e[0].position.z),t.Kh=new a,t.Kh.position.set(e[0].target.x,e[0].target.y,e[0].target.z),t.Jh.target=t.Kh,t.$h=new Rd(new lt("rgb("+e[2].color+")"),e[2].intensity),t.$h.position.set(e[2].position.x,e[2].position.y,e[2].position.z),t.nf=new a,t.nf.position.set(e[2].target.x,e[2].target.y,e[2].target.z),t.$h.target=t.nf,this.Wh=t,this.Yh=n,this}}])&&Py(t.prototype,e),i&&Py(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,i}();function jy(t,n,e){e.Rt=new $a(t,n),(e.Rt.mapNode=e).Rt.rotation.set(-Math.PI/2,0,0,"XYZ")}function Iy(n){var e=n.gr(p);e.Oi.hdr&&e.Oi.hdr.load(e,function(t){n.Do.environment=t,e.enableUpdateRender()})}function Cy(t,n,e){var i=new $a(new ma(200,200,1,1),new Ia({color:"#38382f",side:2}));return void 0!==t&&(i.rotation.y=t),i.position.set(n.x,n.y,n.z),e.parent.Do.add(i),i}function Dy(t){return(Dy="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 ky(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,function(t){t=function(t,n){if("object"!=Dy(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Dy(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Dy(t)?t:t+""}(i.key),i)}}function Uy(t,n,e){n=Hy(n);var i=t,n=By()?Reflect.construct(n,e||[],Hy(t).constructor):n.apply(t,e);if(n&&("object"===Dy(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function By(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(By=function(){return!!t})()}function Gy(){return(Gy="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,n,e){var i=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=Hy(t)););return t}(t,n);if(i)return(i=Object.getOwnPropertyDescriptor(i,n)).get?i.get.call(arguments.length<3?t:e):i.value}).apply(this,arguments)}function Hy(t){return(Hy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Xy(t,n){return(Xy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}Object.assign(Fy.prototype,{ef:function(t){var n=new Ei;return n.setFromVector3(t),n.theta},if:function(t,n){var e=new Ei,n=(e.setFromVector3(t),e.theta=n,new Tt);n.setFromSpherical(e),t.copy(n)},tf:function(){var t,n,e;this.Wh&&(t=this.ef(this._n.camera.position),null===this.Qh&&(n=this.ef(this.Wh.Jh.position),e=this.ef(this.Wh.$h.position),this.Qh=n-t,this.Zh=e-t),n=t+this.Qh,this.if(this.Wh.Jh.position,n),e=t+this.Zh,this.if(this.Wh.$h.position,e))},Yn:function(){this._n.getMapOptions().lockedLight&&this._n.off("viewChanged",this.tf)}});var Vy=function(){function i(){var t;if(this instanceof i)return(t=Uy(this,i)).scene.name="dynamicModel",t.bi=E.DYNAMIC_MODEL_MARKER,t;throw new TypeError("Cannot call a class as a function")}var t,n=i,e=Z1;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&Xy(n,e),n=i,(e=[{key:"init",value:function(){Gy(Hy(i.prototype),"init",this).call(this),this.rf(),this.sf(),Iy(this)}},{key:"remove",value:function(n){var t,e=this;n.af?n.uf({src:[1],dest:[0],duration:1,callback:function(){var t=null==(t=n.Rt)?void 0:t.parent;t&&t.remove(n.Rt),Gy(Hy(i.prototype),"remove",e).call(e,n)}}):((t=null==(t=n.Rt)?void 0:t.parent)&&t.remove(n.Rt),Gy(Hy(i.prototype),"remove",this).call(this,n))}}])&&ky(n.prototype,e),t&&ky(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}();Object.assign(Vy.prototype,{rf:function(){var t=this.gr(p);this.cf=new Fy(t).createLight(this,"FMDynamicModelLayer")},sf:function(){var t=this;this.Do.add(this.Jh),this.Do.add(this.qh),this.Do.add(this.$h),this.Do.add(this.Kh),this.Do.removeLight=function(){t.hf()}},hf:function(){this.Do.remove(this.Jh),this.Do.remove(this.qh),this.Do.remove(this.$h),this.cf.Yn()}});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 Wy(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,function(t){t=function(t,n){if("object"!=zy(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=zy(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==zy(t)?t:t+""}(i.key),i)}}function Yy(t,n,e){n=qy(n);var i=t,n=Qy()?Reflect.construct(n,e||[],qy(t).constructor):n.apply(t,e);if(n&&("object"===zy(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function Qy(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Qy=function(){return!!t})()}function Zy(){return(Zy="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,n,e){var i=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=qy(t)););return t}(t,n);if(i)return(i=Object.getOwnPropertyDescriptor(i,n)).get?i.get.call(arguments.length<3?t:e):i.value}).apply(this,arguments)}function qy(t){return(qy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Ky(t,n){return(Ky=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var Jy=function(){function n(){var t;if(this instanceof n)return(t=Yy(this,n)).bi=E.LINE_MARKER,t;throw new TypeError("Cannot call a class as a function")}var t,e=n,i=Z1;if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");return e.prototype=Object.create(i&&i.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),i&&Ky(e,i),e=n,(i=[{key:"init",value:function(){Zy(qy(n.prototype),"init",this).call(this),this.Do.position.y=0}}])&&Wy(e.prototype,i),t&&Wy(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}();function $y(t){return($y="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 tb(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,function(t){t=function(t,n){if("object"!=$y(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=$y(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==$y(t)?t:t+""}(i.key),i)}}function nb(t,n,e){n=rb(n);var i=t,n=eb()?Reflect.construct(n,e||[],rb(t).constructor):n.apply(t,e);if(n&&("object"===$y(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function eb(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(eb=function(){return!!t})()}function ib(){return(ib="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,n,e){var i=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=rb(t)););return t}(t,n);if(i)return(i=Object.getOwnPropertyDescriptor(i,n)).get?i.get.call(arguments.length<3?t:e):i.value}).apply(this,arguments)}function rb(t){return(rb=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function ob(t,n){return(ob=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var sb=function(){function n(){var t;if(this instanceof n)return(t=nb(this,n)).bi=E.LOCATION_MARKER,t;throw new TypeError("Cannot call a class as a function")}var t,e=n,i=Z1;if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");return e.prototype=Object.create(i&&i.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),i&&ob(e,i),e=n,(i=[{key:"init",value:function(){ib(rb(n.prototype),"init",this).call(this),this.Do.position.y=0}}])&&tb(e.prototype,i),t&&tb(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}();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,function(t){t=function(t,n){if("object"!=ab(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=ab(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==ab(t)?t:t+""}(i.key),i)}}function cb(t,n,e){n=fb(n);var i=t,n=hb()?Reflect.construct(n,e||[],fb(t).constructor):n.apply(t,e);if(n&&("object"===ab(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function hb(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(hb=function(){return!!t})()}function fb(t){return(fb=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function lb(t,n){return(lb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var db=function(){function n(){var t;if(this instanceof n)return(t=cb(this,n)).bi=E.DOM_MARKER,t;throw new TypeError("Cannot call a class as a function")}var t,e=n,i=Z1;if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");return e.prototype=Object.create(i&&i.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),i&&lb(e,i),e=n,(i=[{key:"init",value:function(){}},{key:"add",value:function(t){this.Lt.push(t),this.needUpdateBound=!0}},{key:"remove",value:function(t){t=this.Lt.indexOf(t);-1<t&&this.Lt.splice(t,1),this.needUpdateBound=!0}},{key:"clear",value:function(){for(;0<this.Lt.length;)this.Lt[0].dispose();this.Lt.length=0,this.needUpdateBound=!0}},{key:"dispose",value:function(){this.Lt.length=0,this.Do=void 0}},{key:"visible",get:function(){return this.$t},set:function(t){for(var n=0;n<this.Lt.length;n++)this.Lt[n].visible=t}}])&&ub(e.prototype,i),t&&ub(e,t),Object.defineProperty(e,"prototype",{writable:!1}),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,function(t){t=function(t,n){if("object"!=vb(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=vb(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==vb(t)?t:t+""}(i.key),i)}}function mb(t,n,e){n=gb(n);var i=t,n=yb()?Reflect.construct(n,e||[],gb(t).constructor):n.apply(t,e);if(n&&("object"===vb(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function yb(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(yb=function(){return!!t})()}function bb(){return(bb="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,n,e){var i=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=gb(t)););return t}(t,n);if(i)return(i=Object.getOwnPropertyDescriptor(i,n)).get?i.get.call(arguments.length<3?t:e):i.value}).apply(this,arguments)}function gb(t){return(gb=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function _b(t,n){return(_b=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var i=function(){function n(t){if(this instanceof n)return(t=mb(this,n,[t])).ff=void 0,t;throw new TypeError("Cannot call a class as a function")}var t,e=n,i=ms;if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");return e.prototype=Object.create(i&&i.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),i&&_b(e,i),e=n,(i=[{key:"isbloom",get:function(){return this.ff},set:function(t){this.ff=t}},{key:"ID",get:function(){return this.G.yi}},{key:"level",get:function(){return this.jn.jn.Rr}},{key:"x",get:function(){return this.bound.center.x}},{key:"y",get:function(){return this.bound.center.y}},{key:"height",get:function(){return this.G.height}},{key:"bound",get:function(){return!0===this.br&&(this.G.ci=null,this.ci=this.G.getBound(),this.br=!1),this.ci.clone()}},{key:"boundNoClone",get:function(){return 1==this.br&&(this.G.ci=null,this.ci=this.G.getBound(),this.br=!1),this.ci}},{key:"zoomRange",get:function(){return{maxLevel:this.G.maxlevel,minLevel:this.G.minlevel}}},{key:"visible",get:function(){return this.$t},set:function(t){this.$t=t,this.dh()}},{key:"getData",value:function(){var t=this.G;return{ID:t.yi,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(){var t=this.bound;return{maxY:t.max.y,maxX:t.max.x,minX:t.min.x,minY:t.min.y}}},{key:"getRenderNode",value:function(){return this.Rt}},{key:"dispose",value:function(){this.Nn(),this._n=null,bb(gb(n.prototype),"dispose",this).call(this)}}])&&pb(e.prototype,i),t&&pb(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(),wb=(Object.assign(i.prototype,{dh:function(){var t,n,e;this.bi===E.LABEL||this.bi===E.FACILITY?(e=(n=this).gr(p))&&(n.Rt&&e.Pt.$o(),e.enableUpdateNode(),e.enableUpdateRender()):(e=(n=this).gr(p))&&(n.Rt&&(t=e.getZoom(),e.Pt.lf(n,t)),e.enableUpdateNode(),e.enableUpdateRender())},Nn:function(){var t;(t=this).Rt&&(t.Rt.parent&&t.Rt.parent.remove(t.Rt),t.Rt instanceof nh?t.Rt.children.forEach(function(t){t.geometry&&t.geometry.dispose(),t.geometry=void 0,t.material=void 0,t.mapNode=void 0}):(t.Rt.geometry.dispose(),t.Rt.geometry=void 0,t.Rt.material=void 0,t.Rt.mapNode=void 0),t.Rt=void 0)}}),i);function xb(t){return(xb="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,function(t){t=function(t,n){if("object"!=xb(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=xb(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==xb(t)?t:t+""}(i.key),i)}}function Sb(t,n,e){n=Ab(n);var i=t,n=Tb()?Reflect.construct(n,e||[],Ab(t).constructor):n.apply(t,e);if(n&&("object"===xb(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function Tb(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Tb=function(){return!!t})()}function Ab(t){return(Ab=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Mb(t,n){return(Mb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var i=function(){function e(t){var n;if(this instanceof e)return(n=Sb(this,e)).G=t,n.nt=t.height,n.bi=E.EXTENT,n.df=null,n.vf=null,n.Rt=null,n;throw new TypeError("Cannot call a class as a function")}var t,n=e,i=wb;if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");return n.prototype=Object.create(i&&i.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),i&&Mb(n,i),n=e,(i=[{key:"zoomRange",get:function(){}},{key:"getData",value:function(){var t=this.G;return{ID:t.yi,height:t.height,area:t.area}}},{key:"getArea",value:function(){return E1.area(this.G.gi[0])}},{key:"coordinates",get:function(){return this.G.gi}}])&&Eb(n.prototype,i),t&&Eb(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}(),Ob=(Object.assign(i.prototype,{ec:function(){var t,n,e,i;this.Rt||(t=this.gr(p))&&(i=this.gr(Es),n=t.Pt.qc(this.G,this.nt,i),this.df=t.Pt.pf.vc(i.yi),e=this.qr(t,i.yi),i!==t.An&&(e.polygonOffset=!0,e.polygonOffsetFactor=-1,e.polygonOffsetUnits=-1),i===t.An&&1!==t.children.length&&1===t.An.Lt.length&&(e.stencilWrite=!0,e.stencilRef=1,e.stencilFunc=516,e.stencilFail=gi,e.stencilZFail=gi,e.stencilZPass=gi),i=this.G.getBound(),this.Rt=new $a(n.geometry,e),this.Rt.rotation.set(-Math.PI/2,0,0,"XYZ"),this.Rt.position.set(i.center.x-t.xt,-this.nt,t.Et-i.center.y),this.Rt.receiveShadow=!0,this.Rt.visible=this.$t,(this.Rt.mapNode=this).jn.Do.add(this.Rt))},mf:function(t,n){var e;this.Rt&&(e=this.gr(Es),this.df=n.vc(e.yi),this.yf())},bf:function(t){t!==this.vf&&(this.vf=t,this.yf())},yf:function(){var t,n;this.Rt&&(t=this.gr(p))&&(n=this.gr(Es),this.Rt.material=this.qr(t,n.yi),t.enableUpdateRender())},qr:function(t,n){var e=this.gr(v),e={color:this.df.color,alpha:this.df.alpha*e.ft,buildingID:n},n=(this.vf&&(e.url=this.vf,e.finish=function(){t.enableUpdateRender()}),t.Pt.io.Su(e));return n.polygonOffset=!0,n.polygonOffsetFactor=1,n.polygonOffsetUnits=4,n.userData.opacity=n.opacity,n},dh:function(){var t=this.gr(p);t&&(this.Rt&&(this.Rt.visible=this.$t),t.enableUpdateNode(),t.enableUpdateRender())},updateMaterialByThemeTool:function(t){this.df=t,this.yf()}}),i),Lb=new It;function Rb(t,n){this.object=t,void 0===n&&(n=16776960);var t=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]),e=new Float32Array(24),i=new oa;i.setIndex(new R(t,1)),i.setAttribute("position",new R(e,3)),Vd.call(this,i,new kl({color:n,toneMapped:!1})),this.matrixAutoUpdate=!1,this.update()}function Nb(t,n,e){this.gf=t,this._f=n,this.wf=e||null;for(var i=n.tracks,r=i.length,o=new Array(r),s={endingStart:fi,endingEnd:fi},a=0;a!==r;++a){var u=i[a].createInterpolant(null);(o[a]=u).settings=s}this.xf=s,this.Ef=o,this.Sf=new Array(r),this.Tf=null,this.Af=null,this.Mf=null,this.Of=null,this.loop=2201,this.Lf=-1,this.Rf=null,this.time=0,this.timeScale=1,this.Nf=1,this.weight=1,this.Pf=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}function Pb(t,n,e){this.binding=t,this.valueSize=e;var i,r=Float64Array;switch(n){case"quaternion":i=this.Ff;break;case"string":case"bool":r=Array,i=this.jf;break;default:i=this.If}this.buffer=new r(4*e),this.Cf=i,this.cumulativeWeight=0,this.useCount=0,this.referenceCount=0}function Fb(t){this.cs=t,this.Df(),this.kf=0,this.time=0,this.timeScale=1}((Rb.prototype=Object.create(Vd.prototype)).constructor=Rb).prototype.update=function(t){var n,e,i;void 0!==t&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&Lb.setFromObject(this.object),Lb.isEmpty()||(t=Lb.min,n=Lb.max,(i=(e=this.geometry.attributes.position).array)[0]=n.x,i[1]=n.y,i[2]=n.z,i[3]=t.x,i[4]=n.y,i[5]=n.z,i[6]=t.x,i[7]=t.y,i[8]=n.z,i[9]=n.x,i[10]=t.y,i[11]=n.z,i[12]=n.x,i[13]=n.y,i[14]=t.z,i[15]=t.x,i[16]=n.y,i[17]=t.z,i[18]=t.x,i[19]=t.y,i[20]=t.z,i[21]=n.x,i[22]=t.y,i[23]=t.z,e.needsUpdate=!0,this.geometry.computeBoundingSphere())},Rb.prototype.setFromObject=function(t){return this.object=t,this.update(),this},Rb.prototype.copy=function(t){return Vd.prototype.copy.call(this,t),this.object=t.object,this},Rb.prototype.clone=function(){return(new this.constructor).copy(this)},Object.assign(Nb.prototype,{play:function(){return this.gf.Uf(this),this},stop:function(){return this.gf.Bf(this),this.reset()},reset:function(){return this.paused=!1,this.enabled=!0,this.time=0,this.Lf=-1,this.Rf=null,this.stopFading().stopWarping()},isRunning:function(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this.Rf&&this.gf.Gf(this)},isScheduled:function(){return this.gf.Gf(this)},startAt:function(t){return this.Rf=t,this},setLoop:function(t,n){return this.loop=t,this.repetitions=n,this},setEffectiveWeight:function(t){return this.weight=t,this.Pf=this.enabled?t:0,this.stopFading()},getEffectiveWeight:function(){return this.Pf},fadeIn:function(t){return this.Hf(t,0,1)},fadeOut:function(t){return this.Hf(t,1,0)},crossFadeFrom:function(t,n,e){var i,r;return t.fadeOut(n),this.fadeIn(n),e&&(r=(e=this._f.duration)/(i=t._f.duration),t.warp(1,i/e,n),this.warp(r,1,n)),this},crossFadeTo:function(t,n,e){return t.crossFadeFrom(this,n,e)},stopFading:function(){var t=this.Of;return null!==t&&(this.Of=null,this.gf.Xf(t)),this},setEffectiveTimeScale:function(t){return this.timeScale=t,this.Nf=this.paused?0:t,this.stopWarping()},getEffectiveTimeScale:function(){return this.Nf},setDuration:function(t){return this.timeScale=this._f.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.Nf,0,t)},warp:function(t,n,e){var i=this.gf,r=i.time,o=this.Mf,s=this.timeScale,i=(null===o&&(o=i.Vf(),this.Mf=o),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.Mf;return null!==t&&(this.Mf=null,this.gf.Xf(t)),this},getMixer:function(){return this.gf},getClip:function(){return this._f},getRoot:function(){return this.wf||this.gf.cs},Xn:function(t,n,e,i){if(this.enabled){var r=this.Rf;if(null!==r){r=(t-r)*e;if(r<0||0===e)return;this.Rf=null,n=e*r}n*=this.zf(t);var o=this.Wf(n),s=this.Yf(t);if(0<s)for(var a=this.Ef,u=this.Sf,c=0,h=a.length;c!==h;++c)a[c].evaluate(o),u[c].accumulate(i,s)}else this.Yf(t)},Yf:function(t){var n,e,i=0;return this.enabled&&(i=this.weight,null!==(n=this.Of))&&(i*=e=n.evaluate(t)[0],t>n.parameterPositions[1])&&(this.stopFading(),0===e)&&(this.enabled=!1),this.Pf=i},zf:function(t){var n,e=0;return this.paused||(e=this.timeScale,null!==(n=this.Mf)&&(e*=n.evaluate(t)[0],t>n.parameterPositions[1])&&(this.stopWarping(),0===e?this.paused=!0:this.timeScale=e)),this.Nf=e},Wf:function(t){var n,e=this.time+t,i=this._f.duration,r=this.loop,o=this.Lf,s=2202===r;if(0===t)return-1!==o&&s&&1==(1&o)?i-e:e;if(2200===r){-1===o&&(this.Lf=0,this.Qf(!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.gf.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else if(-1===o&&(0<=t?this.Qf(!(o=0),0===this.repetitions,s):this.Qf(0===this.repetitions,!0,s)),i<=e||e<0?(e-=i*(r=Math.floor(e/i)),o+=Math.abs(r),(n=this.repetitions-o)<=0?(this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=e=0<t?i:0,this.gf.dispatchEvent({type:"finished",action:this,direction:0<t?1:-1})):(1==n?this.Qf(n=t<0,!n,s):this.Qf(!1,!1,s),this.Lf=o,this.time=e,this.gf.dispatchEvent({type:"loop",action:this,loopDelta:r}))):this.time=e,s&&1==(1&o))return i-e;return e},Qf:function(t,n,e){var i=this.xf;e?(i.endingStart=li,i.endingEnd=li):(i.endingStart=t?this.zeroSlopeAtStart?li:fi:2402,i.endingEnd=n?this.zeroSlopeAtEnd?li:fi:2402)},Hf:function(t,n,e){var i=this.gf,r=i.time,o=this.Of,i=(null===o&&(o=i.Vf(),this.Of=o),o.parameterPositions),o=o.sampleValues;return i[0]=r,o[0]=n,i[1]=r+t,o[1]=e,this}}),Object.assign(Pb.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.Cf(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.Cf(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)},jf:function(t,n,e,i,r){if(.5<=i)for(var o=0;o!==r;++o)t[n+o]=t[e+o]},Ff:function(t,n,e,i){at.slerpFlat(t,n,t,n,t,e,i)},If: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}}}),Fb.prototype=Object.assign(Object.create(V.prototype),{constructor:Fb,Zf:function(t,n){var e=t.wf||this.cs,i=t._f.tracks,r=i.length,o=t.Sf,s=t.Ef,a=e.uuid,t=this.qf,u=t[a];void 0===u&&(t[a]=u={});for(var c=0;c!==r;++c){var h=i[c],f=h.name,l=u[f];if(void 0===l){if(void 0!==(l=o[c])){null===l.Tf&&(++l.referenceCount,this.Kf(l,a,f));continue}var d=n&&n.Sf[c].binding.parsedPath;++(l=new Pb(sv.create(e,f,d),h.ValueTypeName,h.getValueSize())).referenceCount,this.Kf(l,a,f)}o[c]=l,s[c].resultBuffer=l.buffer}},Uf:function(t){if(!this.Gf(t)){null===t.Tf&&(n=(t.wf||this.cs).uuid,e=t._f.uuid,i=this.Jf[e],this.Zf(t,i&&i.knownActions[0]),this.$f(t,e,n));for(var n,e,i,r=t.Sf,o=0,s=r.length;o!==s;++o){var a=r[o];0==a.useCount++&&(this.tl(a),a.saveOriginalState())}this.nl(t)}},Bf:function(t){if(this.Gf(t)){for(var n=t.Sf,e=0,i=n.length;e!==i;++e){var r=n[e];0==--r.useCount&&(r.restoreOriginalState(),this.el(r))}this.il(t)}},Df:function(){this.rl=[],this.ol=0,this.Jf={},this.Hc=[],this.sl=0,this.qf={},this.al=[],this.ul=0;var t=this;this.stats={actions:{get total(){return t.rl.length},get inUse(){return t.ol}},bindings:{get total(){return t.Hc.length},get inUse(){return t.sl}},controlInterpolants:{get total(){return t.al.length},get inUse(){return t.ul}}}},Gf:function(t){t=t.Tf;return null!==t&&t<this.ol},$f:function(t,n,e){var i=this.rl,r=this.Jf,o=r[n];void 0===o?(o={knownActions:[t],actionByRoot:{}},t.Af=0,r[n]=o):(r=o.knownActions,t.Af=r.length,r.push(t)),t.Tf=i.length,i.push(t),o.actionByRoot[e]=t},cl:function(t){var n=this.rl,e=n[n.length-1],i=t.Tf,i=(n[e.Tf=i]=e,n.pop(),t.Tf=null,t._f.uuid),e=this.Jf,n=e[i],r=n.knownActions,o=r[r.length-1],s=t.Af;r[o.Af=s]=o,r.pop(),t.Af=null,delete n.actionByRoot[(t.wf||this.cs).uuid],0===r.length&&delete e[i],this.hl(t)},hl:function(t){for(var n=t.Sf,e=0,i=n.length;e!==i;++e){var r=n[e];0==--r.referenceCount&&this.fl(r)}},nl:function(t){var n=this.rl,e=t.Tf,i=this.ol++,r=n[i];n[t.Tf=i]=t,n[r.Tf=e]=r},il:function(t){var n=this.rl,e=t.Tf,i=--this.ol,r=n[i];n[t.Tf=i]=t,n[r.Tf=e]=r},Kf:function(t,n,e){var i=this.qf,r=i[n],o=this.Hc;void 0===r&&(i[n]=r={}),(r[e]=t).Tf=o.length,o.push(t)},fl:function(t){var n=this.Hc,e=t.binding,i=e.rootNode.uuid,e=e.path,r=this.qf,o=r[i],s=n[n.length-1],t=t.Tf;n[s.Tf=t]=s,n.pop(),delete o[e],0===Object.keys(o).length&&delete r[i]},tl:function(t){var n=this.Hc,e=t.Tf,i=this.sl++,r=n[i];n[t.Tf=i]=t,n[r.Tf=e]=r},el:function(t){var n=this.Hc,e=t.Tf,i=--this.sl,r=n[i];n[t.Tf=i]=t,n[r.Tf=e]=r},Vf:function(){var t=this.al,n=this.ul++,e=t[n];return void 0===e&&(t[(e=new dd(new Float32Array(2),new Float32Array(2),1,this.dl)).ll=n]=e),e},Xf:function(t){var n=this.al,e=t.ll,i=--this.ul,r=n[i];n[t.ll=i]=t,n[r.ll=e]=r},dl:new Float32Array(1),clipAction:function(t,n){var e=n||this.cs,i=e.uuid,e="string"==typeof t?Ed.findByName(e,t):t,t=null!==e?e.uuid:t,r=this.Jf[t],o=null;if(void 0!==r){var s=r.actionByRoot[i];if(void 0!==s)return s;o=r.knownActions[0],null===e&&(e=o._f)}return null===e?null:(s=new Nb(this,e,n),this.Zf(s,o),this.$f(s,t,i),s)},existingAction:function(t,n){var n=n||this.cs,e=n.uuid,n="string"==typeof t?Ed.findByName(n,t):t,n=n?n.uuid:t,t=this.Jf[n];return void 0!==t&&t.actionByRoot[e]||null},stopAllAction:function(){var t=this.rl,n=this.ol,e=this.Hc,i=this.sl;this.ol=0;for(var r=this.sl=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.rl,e=this.ol,i=this.time+=t,r=Math.sign(t),o=this.kf^=1,s=0;s!==e;++s)n[s].Xn(i,t,r,o);for(var a=this.Hc,u=this.sl,s=0;s!==u;++s)a[s].apply(o);return this},setTime:function(t){for(var n=this.time=0;n<this.rl.length;n++)this.rl[n].time=0;return this.update(t)},getRoot:function(){return this.cs},uncacheClip:function(t){var n=this.rl,t=t.uuid,e=this.Jf,i=e[t];if(void 0!==i){for(var r=i.knownActions,o=0,s=r.length;o!==s;++o){var a=r[o],u=(this.Bf(a),a.Tf),c=n[n.length-1];a.Tf=null,a.Af=null,n[c.Tf=u]=c,n.pop(),this.hl(a)}delete e[t]}},uncacheRoot:function(t){var n,e=t.uuid,i=this.Jf;for(n in i){var r=i[n].actionByRoot[e];void 0!==r&&(this.Bf(r),this.cl(r))}var o=this.qf[e];if(void 0!==o)for(var s in o){s=o[s];s.restoreOriginalState(),this.fl(s)}},uncacheAction:function(t,n){t=this.existingAction(t,n);null!==t&&(this.Bf(t),this.cl(t))}});var i=t(11),jb=t.n(i);function Ib(t){return(Ib="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,function(t){t=function(t,n){if("object"!=Ib(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Ib(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Ib(t)?t:t+""}(i.key),i)}}var i=function(){function n(t){if(!(this instanceof n))throw new TypeError("Cannot call a class as a function");this.rs=t,this._n=this.rs.map,this.vl={},this.vf=null,this.pl={},this.ml=0,this.nt=512,this.tt=512,this.yl=!1,this.Cn=null,this.Xn=this.Xn.bind(this)}return t=n,(e=[{key:"isAdded",get:function(){return this.yl}},{key:"add",value:function(t){var n=this;null===this.vf&&(this.vf=t),this.bl(function(t){n.gl(t)})}},{key:"dispose",value:function(t){this._n.off("update",this.Xn),t&&t()}},{key:"stop",value:function(){this._n.off("update",this.Xn)}}])&&Cb(t.prototype,e),i&&Cb(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,i}(),Db=(Object.assign(i.prototype,{bl:function(n){var t=this.rs.externalModel.getRenderNode();t.renderOrder=1,this.rs.externalModel._l?t.traverse(function(t){"Mesh"===t.type&&(t.renderOrder=1,n(t))}):n(t)},gl:function(i){var e=this,r=this,o=0,s=null;Array.isArray(i.material)?(this.vl[i.name]=[],function e(){o<i.material.length?r.yf(i.material[o],function(t,n){r.vl[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.Cn=(new Date).getTime(),r._n.on("update",r.Xn))}()):this.yf(i.material,function(t,n){e.vl[i.name]=i.material.clone(),n&&(i.material.dispose(),i.material=t),e.Cn=(new Date).getTime(),e._n.on("update",r.Xn)})},yf:function(t,n){var e,i=null;t&&(this.rs.externalModel._l?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.rs.parent.wl||!this.rs.parent.wl[i])&&null!==i&&0<=i.indexOf(".gif")?(t=(t=i.split("."))[0]+"."+t[1],(e=this.pl[t])?e.canvasArray&&0<e.canvasArray.length&&(e=new xh(e.canvasArray[e.canvascount]),this.rs.externalModel._l&&(e.flipY=!1),e.repeat.set(1,1),e.name=i,e.magFilter=Zn,e.minFilter=1008,(i=new Ia({map:e})).isBasic=!0,i.gifname=t,i.transparent=!0,n(i,!0)):this.xl(this.vf+t,t,function(t){n(t,!0)})):n(null,!1)},xl:function(t,e,i){var r=this,o=document.createElement("div"),s=(o.style.display="none",document.body.appendChild(o),new Image);s.crossOrigin="Anonymous",s.onload=function(){i&&((t=document.createElement("canvas")).width=r.tt,t.height=r.nt,t.getContext("2d").drawImage(s,0,0,r.tt,r.nt),t=new xh(t),r.rs.externalModel._l&&(t.flipY=!1),t.repeat.set(1,1),t.magFilter=Zn,t.minFilter=1008,(t=new Ia({map:t})).transparent=!0,t.isBasic=!0,t.gifname=e,i(t)),r.pl[e]={canvascount:0,canvasArray:[]},o.appendChild(s);var t,n=new jb.a({gif:s});n.load(function(){r.El(n,e,o)})},s.src=t},El:function(e,i,r){var o=this,s=null,a=e.get_length(),u=1;this.pl[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.tt,n.height=o.nt,n.getContext("2d").drawImage(e.get_canvas(),0,0,o.tt,o.nt),o.pl[i].canvasArray.push(n),u++,s=setTimeout(t,0))}}()},Sl:function(t,n){t=t.split("."),t=t[0]+"."+t[1];this.pl[t]&&(this.pl[t].canvasArray.length=0,this.pl[t].canvascount=0),this.xl(n,t),this.Xn(),this.yl||(this.yl=!0,this._n.on("update",this.Xn))},ja:function(t){var n=t.split("."),n=n[0]+"."+n[1];this.Sl(t,this.vf+n)},Xn:function(){function r(t){50<=n&&t&&(t.canvascount<t.canvasArray.length-1?t.canvascount++:t.canvascount=0)}var o=this,t=(new Date).getTime(),n=t-this.Cn;50<=n&&(this.Cn=t);this.rs.externalModel.getRenderNode()&&(this.bl(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?o.yf(o.vl[i.name][e],function(t,n){n&&(i.material[e].dispose(),i.material[e]=t)}):((t=o.pl[n[e].gifname])&&t.canvasArray[t.canvascount]&&(i.material.isupdate?o.yf(o.vl[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)),r(t))}(e);else i.material.isBasic&&!i.material.isupdate?((t=o.pl[i.material.gifname])&&t.canvasArray[t.canvascount]&&(i.material.isupdate?o.yf(o.vl[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)),r(t)):o.yf(o.vl[i.name],function(t,n){n&&(i.material.dispose(),i.material=t)})}),this._n.enableUpdateRender())}}),i);function kb(t,n,e,i,r,o,s,a,u){l.call(this,t,n,e,i,r,o,s,a,u),this.format=void 0!==s?s:fe,this.minFilter=void 0!==o?o:Zn,this.magFilter=void 0!==r?r:Zn,this.generateMipmaps=!1}function Ub(t){return(Ub="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 Bb(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,function(t){t=function(t,n){if("object"!=Ub(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Ub(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Ub(t)?t:t+""}(i.key),i)}}kb.prototype=Object.assign(Object.create(l.prototype),{constructor:kb,isVideoTexture:!0,update:function(){var t=this.image;t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}});var i=function(){function n(t){if(!(this instanceof n))throw new TypeError("Cannot call a class as a function");this.rs=t,this.Tl=t.externalModel,this._n=this.rs.map,this.Al=[],this.Ml=null,this.Ol={},this.Ll=null,this.yl=!1,this.oldmaterial={},this.vf=null,this.Rl={},this.Xn=this.Xn.bind(this)}return t=n,(e=[{key:"isAdded",get:function(){return this.yl}},{key:"add",value:function(t){var n=this;null===this.vf&&(this.vf=t),this.bl(function(t){n.gl(t)}),this._n.on("update",this.Xn)}},{key:"dispose",value:function(){for(var t=0;t<this.Al.length;t++){var n=this.Al[t];null!==document.getElementById(n)&&document.getElementById(n).parentNode.removeChild(document.getElementById(n))}this._n.off("update",this.Xn)}},{key:"stop",value:function(){this._n.off("update",this.Xn)}}])&&Bb(t.prototype,e),i&&Bb(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,i}(),Gb=(Object.assign(i.prototype,{bl:function(n){var t=this.rs.externalModel.getRenderNode();this.Tl._l?t.traverse(function(t){"Mesh"===t.type&&n(t)}):n(t)},gl: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.yf(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.yf(o,function(t,n){e.oldmaterial[i.name]=o.clone(),n&&(i.material.dispose(),i.material=t)})},yf:function(t,n){var e,i=this,r=null;t&&(this.Tl._l?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.rs.parent.wl||!this.rs.parent.wl[r])&&null!==r&&(0<=r.indexOf(".mp4")||0<=r.indexOf(".webm")||0<=r.indexOf(".ogg"))?(e=r.split("."),(t=(t=this.Rl[r])||this.Ol[e[0]+"."+e[1]])?((t=new Ia({map:t.clone()})).isBasic=!0,n&&n(t,!0)):this.Nl(this.vf+e[0]+"."+e[1],function(t){t.name=r;t=new Ia({map:(i.Ol[e[0]+"."+e[1]]=t).clone()});t.isBasic=!0,n(t,!0)})):n(null,!1)},Nl:function(t,e){var i=this,r=(this.Ll=t,null),n=document.createElement("div"),o=(n.style.display="none","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.Ml=o+"_div",this.Al.push(this.Ml),n.setAttribute("id",this.Ml),n.innerHTML='<video id="'+o+'" loop crossOrigin="anonymous" muted><source src="'+t+'"></video>',document.body.appendChild(n),function t(){var n=document.getElementById(o);n?(null!==r&&clearTimeout(r),n.addEventListener("loadeddata",function(){var t=new kb(n);t.video_id=o+"_div",i.Tl._l&&(t.flipY=!1),e&&e(t),n.play()})):r=setTimeout(t,0)}()},Pl:function(i){var r=this;this.rs.externalModel.getRenderNode()&&this.bl(function(e){var t=e.material;if(Array.isArray(t))for(var n=0;n<t.length;n++)!function(n){r.yf(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.yf(r.oldmaterial[e.name],function(t){t&&t.map&&t.map.name===i&&(e.material.dispose(),e.material=t)})})},ja:function(t){var n;this.Rl[t]&&(n=this.Rl[t].video_id,null!==document.getElementById(n)&&document.getElementById(n).parentNode.removeChild(document.getElementById(n)),this.Rl[t].dispose(),this.Rl[t]=void 0,this.Pl(t))},Sl:function(n,t){var e=this;this.Nl(t,function(t){e.Rl[n]&&e.ja(n),t.name=n,e.Rl[n]=t,e.Pl(n)}),this.yl||(this.yl=!0,this._n.on("update",this.Xn))},Xn:function(){var i=this;this.rs.externalModel.getRenderNode()&&(this.bl(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.yf(i.oldmaterial[e.name][n],function(t){t&&(e.material[n].dispose(),e.material[n]=t)})}(n);else t.isBasic?t.isupdate&&i.yf(i.oldmaterial[e.name],function(t){t&&(e.material.dispose(),e.material=t)}):i.yf(i.oldmaterial[e.name],function(t){t&&(e.material.dispose(),e.material=t)})}),this._n.enableUpdateRender())}}),i);function Hb(t){return(Hb="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 Xb(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,function(t){t=function(t,n){if("object"!=Hb(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Hb(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Hb(t)?t:t+""}(i.key),i)}}var i=function(){function n(t){if(!(this instanceof n))throw new TypeError("Cannot call a class as a function");this._n=t.parent.parent.parent.parent,this.Tl=t,this.Xn=this.Xn.bind(this),this.bi="no",this.Fl=new Db({map:this._n,externalModel:t,parent:this}),this.jl=new Gb({map:this._n,externalModel:t,parent:this}),this.wl=null,this.Il=[],this.Cl={},this._n.on("update",this.Xn)}return t=n,(e=[{key:"gifTool",get:function(){return this.Fl}},{key:"videoTool",get:function(){return this.jl}},{key:"isGltf",get:function(){return this.Tl._l}},{key:"textureNames",get:function(){return this.Il}},{key:"oldMaterial",get:function(){return this.Cl}},{key:"replace",value:function(t,n){null===this.wl&&(this.wl={}),this.wl[t]=!0}},{key:"reset",value:function(t){this.wl[t]=!1}},{key:"dispose",value:function(){this.Fl.yl&&this.Fl.dispose(),this.jl.yl&&this.jl.dispose()}}])&&Xb(t.prototype,e),i&&Xb(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,i}(),Vb=(Object.assign(i.prototype,{Xn:function(){function n(t,n){(t=i.Dl(t)).needgif&&!i.Fl.yl&&(i.Fl.add(n),i.Fl.yl=!0),t.needvideo&&!i.jl.yl&&(i.jl.add(n),i.jl.yl=!0)}var e,i=this,t=this.Tl.getRenderNode();t&&(this._n.off("update",this.Xn),e=this.Tl.kl,this.Tl._l?t.traverse(function(t){"Mesh"===t.type&&n(t,e)}):n(t,e))},Dl:function(t){function n(t){0<=t.indexOf(".gif")?(s=!0,r.Il.push(t)):(0<=t.indexOf(".mp4")||0<=t.indexOf(".webm")||0<=t.indexOf(".ogg"))&&(a=!0,r.Il.push(t))}function e(t,n){0<=t.indexOf(".gif")||0<=n.indexOf(".gif")?(s=!0,0<=t.indexOf(".gif")?r.Il.push(t):r.Il.push(n)):(0<=t.indexOf(".mp4")||0<=t.indexOf(".webm")||0<=t.indexOf(".ogg")||0<=n.indexOf(".mp4")||0<=n.indexOf(".webm")||0<=n.indexOf(".ogg"))&&(a=!0,0<=t.indexOf(".mp4")||0<=t.indexOf(".webm")||0<=t.indexOf(".ogg")?r.Il.push(t):r.Il.push(n))}var i,r=this,o={needgif:!1,needvideo:!1},s=!1,a=!1,u=t.material;if(Array.isArray(u)){this.Cl[t.name]=[];for(var c,h=0;h<u.length;h++)this.Cl[t.name].push(u[h].clone()),this.Tl._l?u[h].uniforms&&u[h].uniforms.map&&u[h].uniforms.map.value?u[h].uniforms.map.value.name:u[h].map&&n(u[h].map.name):(c="",e(c=u[h].map?""+u[h].map.name:c,""+u[h].name))}else this.Cl[t.name]=u.clone(),this.Tl._l?(i="",u.uniforms&&u.uniforms.map&&u.uniforms.map.value?i=u.uniforms.map.value.name:u.map&&(i=u.map.name),n(i)):(i="",e(i=u.map?""+u.map.name:i,""+u.name));return o.needgif=s,o.needvideo=a,o}}),i);function zb(t){return(zb="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 Wb(){Wb=function(){return s};var u,s={},t=Object.prototype,c=t.hasOwnProperty,h=Object.defineProperty||function(t,n,e){t[n]=e.value},n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",e=n.asyncIterator||"@@asyncIterator",r=n.toStringTag||"@@toStringTag";function o(t,n,e){return Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[n]}try{o({},"")}catch(u){o=function(t,n,e){return t[n]=e}}function a(t,n,e,i){var r,o,s,a,n=n&&n.prototype instanceof y?n:y,n=Object.create(n.prototype),i=new A(i||[]);return h(n,"_invoke",{value:(r=t,o=e,s=i,a=l,function(t,n){if(a===v)throw Error("Generator is already running");if(a===p){if("throw"===t)throw n;return{value:u,done:!0}}for(s.method=t,s.arg=n;;){var e=s.delegate;if(e){e=function t(n,e){var i=e.method,r=n.iterator[i];if(r===u)return e.delegate=null,"throw"===i&&n.iterator.return&&(e.method="return",e.arg=u,t(n,e),"throw"===e.method)||"return"!==i&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+i+"' method")),m;i=f(r,n.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,m;r=i.arg;return r?r.done?(e[n.resultName]=r.value,e.next=n.nextLoc,"return"!==e.method&&(e.method="next",e.arg=u),e.delegate=null,m):r:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,m)}(e,s);if(e){if(e===m)continue;return e}}if("next"===s.method)s.sent=s.bn=s.arg;else if("throw"===s.method){if(a===l)throw a=p,s.arg;s.dispatchException(s.arg)}else"return"===s.method&&s.abrupt("return",s.arg);a=v;e=f(r,o,s);if("normal"===e.type){if(a=s.done?p:d,e.arg===m)continue;return{value:e.arg,done:s.done}}"throw"===e.type&&(a=p,s.method="throw",s.arg=e.arg)}})}),n}function f(t,n,e){try{return{type:"normal",arg:t.call(n,e)}}catch(t){return{type:"throw",arg:t}}}s.wrap=a;var l="suspendedStart",d="suspendedYield",v="executing",p="completed",m={};function y(){}function b(){}function g(){}var n={},_=(o(n,i,function(){return this}),Object.getPrototypeOf),_=_&&_(_(M([]))),w=(_&&_!==t&&c.call(_,i)&&(n=_),g.prototype=y.prototype=Object.create(n));function x(t){["next","throw","return"].forEach(function(n){o(t,n,function(t){return this._invoke(n,t)})})}function E(s,a){var n;h(this,"_invoke",{value:function(e,i){function t(){return new a(function(t,n){!function n(t,e,i,r){var o,t=f(s[t],s,e);if("throw"!==t.type)return(e=(o=t.arg).value)&&"object"==zb(e)&&c.call(e,"__await")?a.resolve(e.gn).then(function(t){n("next",t,i,r)},function(t){n("throw",t,i,r)}):a.resolve(e).then(function(t){o.value=t,i(o)},function(t){return n("throw",t,i,r)});r(t.arg)}(e,i,t,n)})}return n=n?n.then(t,t):t()}})}function S(t){var n={tryLoc:t[0]};1 in t&&(n.catchLoc=t[1]),2 in t&&(n.finallyLoc=t[2],n.afterLoc=t[3]),this.tryEntries.push(n)}function T(t){var n=t.completion||{};n.type="normal",delete n.arg,t.completion=n}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function M(n){if(n||""===n){var e,t=n[i];if(t)return t.call(n);if("function"==typeof n.next)return n;if(!isNaN(n.length))return e=-1,(t=function t(){for(;++e<n.length;)if(c.call(n,e))return t.value=n[e],t.done=!1,t;return t.value=u,t.done=!0,t}).next=t}throw new TypeError(zb(n)+" is not iterable")}return h(w,"constructor",{value:b.prototype=g,configurable:!0}),h(g,"constructor",{value:b,configurable:!0}),b.displayName=o(g,r,"GeneratorFunction"),s.isGeneratorFunction=function(t){t="function"==typeof t&&t.constructor;return!!t&&(t===b||"GeneratorFunction"===(t.displayName||t.name))},s.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,o(t,r,"GeneratorFunction")),t.prototype=Object.create(w),t},s.awrap=function(t){return{gn:t}},x(E.prototype),o(E.prototype,e,function(){return this}),s.AsyncIterator=E,s.async=function(t,n,e,i,r){void 0===r&&(r=Promise);var o=new E(a(t,n,e,i),r);return s.isGeneratorFunction(n)?o:o.next().then(function(t){return t.done?t.value:o.next()})},x(w),o(w,r,"Generator"),o(w,i,function(){return this}),o(w,"toString",function(){return"[object Generator]"}),s.keys=function(t){var n,e=Object(t),i=[];for(n in e)i.push(n);return i.reverse(),function t(){for(;i.length;){var n=i.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},s.values=M,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this.bn=u,this.done=!1,this.delegate=null,this.method="next",this.arg=u,this.tryEntries.forEach(T),!t)for(var n in this)"t"===n.charAt(0)&&c.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=u)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var i=this;function t(t,n){return o.type="throw",o.arg=e,i.next=t,n&&(i.method="next",i.arg=u),!!n}for(var n=this.tryEntries.length-1;0<=n;--n){var r=this.tryEntries[n],o=r.completion;if("root"===r.tryLoc)return t("end");if(r.tryLoc<=this.prev){var s=c.call(r,"catchLoc"),a=c.call(r,"finallyLoc");if(s&&a){if(this.prev<r.catchLoc)return t(r.catchLoc,!0);if(this.prev<r.finallyLoc)return t(r.finallyLoc)}else if(s){if(this.prev<r.catchLoc)return t(r.catchLoc,!0)}else{if(!a)throw Error("try statement without catch or finally");if(this.prev<r.finallyLoc)return t(r.finallyLoc)}}}},abrupt:function(t,n){for(var e=this.tryEntries.length-1;0<=e;--e){var i=this.tryEntries[e];if(i.tryLoc<=this.prev&&c.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var r=i;break}}var o=(r=r&&("break"===t||"continue"===t)&&r.tryLoc<=n&&n<=r.finallyLoc?null:r)?r.completion:{};return o.type=t,o.arg=n,r?(this.method="next",this.next=r.finallyLoc,m):this.complete(o)},complete:function(t,n){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&n&&(this.next=n),m},finish:function(t){for(var n=this.tryEntries.length-1;0<=n;--n){var e=this.tryEntries[n];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),T(e),m}},catch:function(t){for(var n=this.tryEntries.length-1;0<=n;--n){var e,i,r=this.tryEntries[n];if(r.tryLoc===t)return"throw"===(e=r.completion).type&&(i=e.arg,T(r)),i}throw Error("illegal catch attempt")},delegateYield:function(t,n,e){return this.delegate={iterator:M(t),resultName:n,nextLoc:e},"next"===this.method&&(this.arg=u),m}},s}function Yb(t,n,e,i,r,o,s){try{var a=t[o](s),u=a.value}catch(t){return void e(t)}a.done?n(u):Promise.resolve(u).then(i,r)}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,function(t){t=function(t,n){if("object"!=zb(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=zb(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==zb(t)?t:t+""}(i.key),i)}}function Zb(t,n,e){return n&&Qb(t.prototype,n),e&&Qb(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}var qb=Zb(function t(n,e){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");this._n=n,this.Tl=e,this.Ul=null,this.Bl=null,this.Gl=null,this.Hl=null,this.Xl=null,this.Vl=new cd(sr),this.Vl.setResponseType("json"),this.zl=this.zl.bind(this),this._n.on("zoom",this.zl)});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 Jb(t,n){var e,i,r,o,s="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(s)return i=!(e=!0),{s:function(){s=s.call(t)},n:function(){var t=s.next();return e=t.done,t},e:function(t){i=!0,r=t},f:function(){try{e||null==s.return||s.return()}finally{if(i)throw r}}};if(Array.isArray(t)||(s=function(t,n){var e;if(t)return"string"==typeof t?$b(t,n):"Map"===(e="Object"===(e=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?$b(t,n):void 0}(t))||n&&t&&"number"==typeof t.length)return s&&(t=s),o=0,{s:n=function(){},n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},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.")}function $b(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 tg(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,function(t){t=function(t,n){if("object"!=Kb(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Kb(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Kb(t)?t:t+""}(i.key),i)}}function ng(t,n,e){n=rg(n);var i=t,n=eg()?Reflect.construct(n,e||[],rg(t).constructor):n.apply(t,e);if(n&&("object"===Kb(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function eg(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(eg=function(){return!!t})()}function ig(){return(ig="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,n,e){var i=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=rg(t)););return t}(t,n);if(i)return(i=Object.getOwnPropertyDescriptor(i,n)).get?i.get.call(arguments.length<3?t:e):i.value}).apply(this,arguments)}function rg(t){return(rg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function og(t,n){return(og=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}Object.assign(qb.prototype,{Wl:function(){var n=this;this.Tl.Yl({needFadeIn:!1,needFadeOut:!1,initLODMesh:!1,lodName:this.Bl,callback:function(t){t!==n.Bl&&n.Wl()}})},zl:function(){var a,e=this;return a=Wb().mark(function t(){var n;return Wb().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:n=e.Ql(e.Ul,e._n.getZoom()),e.Bl!==n&&null!==n&&(e.Bl=n,null!==e.Xl&&clearTimeout(e.Xl),e.Wl(),e.Xl=setTimeout(function(){},50));case 2:case"end":return t.stop()}},t)}),function(){var t=this,s=arguments;return new Promise(function(n,e){var i=a.apply(t,s);function r(t){Yb(i,n,e,r,o,"next",t)}function o(t){Yb(i,n,e,r,o,"throw",t)}r(void 0)})}()},Ql:function(t,n){if(!t)return null;var e=this.Tl.G,i=e.maxlevel;if(n<e.minlevel||i<n)return null;for(var r=null,o=0;o<t.length;o++){var s=t[o],a=s.maxlevel;if(s.minlevel<=n&&n<=a){r=s.name;break}}return r},Zl:function(o){var s=this;return this.Hl!==o&&(this.Hl=o,this.Gl=null),new Promise(function(i,r){s.ql(o).then(function(t){t.lod&&Array.isArray(t.lod)||r("lod format error");var n=s.Ql(t.lod,s._n.getZoom()),e=(null===n&&r(null),H0(o));s.Ul=t.lod,i("".concat(e).concat(n))}).catch(r)})},ql:function(e){var i=this;return new Promise(function(n,t){i.Gl?n(i.Gl):i.Vl.load(e,function(t){i.Gl=t,n(i.Gl)},null,t)})},Yn:function(){this._n.off("zoom",this.zl),this.Vl=null}});var i=function(){function e(t){var n;if(this instanceof e)return(n=ng(this,e)).G=t,n.bi=E.EXTERNAL_MODEL,n.df=null,n.Rt=null,n.Kl=null,n.Jl=null,n.ft=null,n.$l=!1,n.Zr=null,n._l=null,n.gf=null,n.rl=[],n.Sh=null,n.t0=n.t0.bind(n),n.n0=new Pr,n.e0=!0,n.i0=null,n.kl=null,n.r0=!1,n.Kr=null,n.$r=null,n.o0=null,n.s0=!1,n.a0=null,n.u0=null,n.c0=!1,n.h0=null,n.Il=[],n.f0=!1,n;throw new TypeError("Cannot call a class as a function")}var t,n=e,i=wb;if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");return n.prototype=Object.create(i&&i.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),i&&og(n,i),n=e,(i=[{key:"multiMediaTool",get:function(){return this.i0}},{key:"fading",get:function(){return!this.n0.Hn}},{key:"FID",get:function(){return this.G.fid}},{key:"typeID",get:function(){return this.G.type}},{key:"name",get:function(){return this.G.name}},{key:"eName",get:function(){return this.G.ename}},{key:"color",get:function(){return this.Jl},set:function(t){this.Jl=t,this.yf()}},{key:"opacity",get:function(){return this.ft},set:function(t){this.ft=t,this.yf()}},{key:"canDispose",get:function(){return this._canDispose}},{key:"show",get:function(){return this.lh},set:function(t){t?this.Sh&&!this.Sh.show||this.l0():this.d0()}},{key:"isGltf",get:function(){return this._l}},{key:"boundNoClone",get:function(){var t=this.getBound();return t?{min:{x:t.minX,y:t.minY},max:{x:t.maxX,y:t.maxY}}:null}},{key:"resetColor",value:function(){this.$l=!0,this.yf()}},{key:"setColor",value:function(t,n){this.Jl=t,this.ft=n,this.yf()}},{key:"beforRemove",value:function(){var t=null==(t=this.parent)||null==(t=t.parent)?void 0:t.parent;this.r0=!t||!t.visibleLevels.includes(this.level)}},{key:"getBound",value:function(){if(this.Kl)return this.Kl;var t={};if(this.Rt){for(var n=new Rb(this.Rt,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],a=e[3*r+1];(!t.minX||o<t.minX)&&(t.minX=o),(!t.maxX||t.maxX<o)&&(t.maxX=o),(!t.minY||s<t.minY)&&(t.minY=s),(!t.maxY||t.maxY<s)&&(t.maxY=s),(!t.minH||a<t.minH)&&(t.minH=a),(!t.maxH||t.maxH<a)&&(t.maxH=a)}n.material.dispose(),n.geometry.dispose(),n.material=void 0,n.geometry=void 0;var n=this.gr(p);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.maxY<t.minY&&(n=t.minY,t.minY=t.maxY,t.maxY=n),this.Kl=t,this.Kl}}},{key:"startAction",value:function(t,n,e){var i=this.rl[t];if(i){if(n){for(var r=this.getActionNames(),o=0;o<r.length;o++)r[o]!==t&&!0===this.rl[r[o]].clampWhenFinished&&!0===this.rl[r[o]].paused&&this.rl[r[o]].stop();i.loop=2200,i.clampWhenFinished=!0}else i.clampWhenFinished=!1,i.loop=2201;this.a0&&this.a0===t?this.a0===t&&(n=!1,i.time=this.u0,e?this.c0?n=!0:(n=!1,this.a0=null,this.u0=null):(this.a0=null,this.u0=null,this.c0=!1),i.paused=n,i.play()):i.reset().setEffectiveTimeScale(1).setEffectiveWeight(1).play()}e=this.gr(p);e&&e.on("beforeRender",this.t0)}},{key:"getActionNames",value:function(){return Object.keys(this.rl)}},{key:"stopAction",value:function(t,n){var e=this.gr(p),e=(e&&e.off("beforeRender",this.t0),this.rl[t]);e&&(e.paused=!0,this.a0=t,this.u0=e.time,this.h0=e.loop,n||(this.c0=!0))}},{key:"dispose",value:function(){null!==this.i0&&this.i0.dispose(),this.Nn(),ig(rg(e.prototype),"dispose",this).call(this)}},{key:"getTextureNames",value:function(){return this.Il}}])&&tg(n.prototype,i),t&&tg(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}(),sg=(Object.assign(i.prototype,{ec:function(t){var n=this;this.r0=!1,!this.Rt&&this.G&&this.p0(function(){n.Sh&&n.Sh.ec(n),t&&t()},{initLODMesh:!0})},Wl:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{needFadeIn:!0,needFadeOut:!0,initLODMesh:!0};this.Rt&&this.jn.Do.remove(this.Rt),this.Rt=null,this.p0(null,t)},Yl:function(){var n=this,e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{needFadeIn:!0,needFadeOut:!0,initLODMesh:!1};this.p0(function(t){e.onLoaded=function(){n.Rt&&n.jn.Do.remove(n.Rt),n.Rt=null},n.m0(t,function(){e.callback&&e.callback(e.lodName)},e)},e)},mf:function(){this.Wl()},m0:function(t,i){var r=this,o=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},s=this.gr(p);s.Pt.y0.Na(t,function(t,n,e){r._l=t,o.onLoaded&&o.onLoaded(),r._l?r.b0(n,o):r.g0(n,e,r.df),st.a.environment===B.a.BROWSER&&null===r.i0&&(r.i0=new Vb(r)),s.enableUpdateRender(),i&&i()})},p0:function(n,e){var t,i=this,r=(e=e||{},this.gr(p)),o=this.gr(Es);this.df=r.Pt.pf._c({fid:this.G.fid,typeID:this.G.type+"",bid:o.yi}),this.df&&this.df.normalID&&(t=r.Pt._0(this.df,"model",o.buildingID)+this.df.model+"?keyValue="+r.Oi.key,null===this.kl&&(this.kl=r.Pt._0(this.df,"model",o.buildingID)),t.includes(".json")?(this.w0||(this.w0=new qb(r,this)),this.w0.Zl(t).then(function(t){!1!==e.initLODMesh?i.m0(t,n,e):n&&n(t)})):this.m0(t,n))},x0:function(t,n){this.$l&&void 0!==t.userData.originColor&&(this.Jl=t.userData.originColor,t.color=t.userData.originColor,void 0!==t.userData.originOpacity)&&(t.opacity=t.userData.originOpacity*n.ft,this.ft=t.userData.originOpacity)},g0:function(t,n,e){if(!this.Rt){var i=this.gr(v);if(i){var r=i.gr(p);if(Array.isArray(n)){var o,s=Jb(n);try{for(s.s();!(o=s.n()).done;){var a=o.value;a.map&&(a.map.wrapS=Xn,a.map.wrapT=Xn),a.userData.sourceTransparent=a.transparent,a.userData.sourceOpacity=a.opacity,void 0===a.userData.originColor&&(a.userData.originColor=a.color),void 0===a.userData.originOpacity&&(a.userData.originOpacity=a.opacity),a.opacity=a.userData.sourceOpacity*i.ft,a.opacity<1&&(a.transparent=!0)}}catch(t){s.e(t)}finally{s.f()}}else n.map&&(n.map.wrapS=Xn,n.map.wrapT=Xn),n.userData.sourceOpacity=n.opacity,n.userData.sourceTransparent=n.transparent,void 0===n.userData.originColor&&(n.userData.originColor=n.color),void 0===n.userData.originOpacity&&(n.userData.originOpacity=n.opacity),n.opacity=n.userData.sourceOpacity*i.ft,n.opacity<1&&(n.transparent=!0);var u=[];if(void 0!==n.length)for(var c=0;c<n.length;c++){var h=n[c].clone();this.Jl&&(h.color=new lt(this.Jl)),null!==this.ft&&(h.opacity=this.ft),this.x0(h,i),u.push(h)}else{var f=n.clone();this.Jl&&(f.color=new lt(this.Jl)),null!==this.ft&&(f.opacity=this.ft),this.x0(f,i),u.push(f)}if(this.$l=!1,!this.f0){for(var l=0;l<u.length;l++)u[l].map&&this.Il.push(u[l].name);this.f0=!0}this.Rt=new $a(t,u),this.Zr&&this.yf(),this.Sh||this.l0();var f=e.scale.split(","),t=(this.Rt.scale.set(parseFloat(f[0]),parseFloat(f[2]),parseFloat(f[1])),e.rotate.split(",")),f=new Tt,d=Math.PI/180,t=(f.set(parseFloat(t[0])*d,parseFloat(t[2])*d,parseFloat(t[1])*d),this.Rt.rotation.setFromVector3(f,"YXZ"),e.translate.split(",")),d=new Tt(this.G.gi[0].x-r.xt,this.G.gi[0].y-r.Et,0).applyEuler(new Q(-Math.PI/2,0,0,"XYZ")).add(new Tt(0,-1===this.G.height?2.2:this.G.height,0));d.add(new Tt(parseFloat(t[0]),parseFloat(t[2]),parseFloat(t[1]))),this.Rt.position.set(d.x,d.y,d.z),(this.Rt.mapNode=this).jn.Do.add(this.Rt)}}},b0:function(t,n){var e=this,r=this;if(n=n||{},!this.Rt){var i=this.gr(p);if(i){var o=t.scene,s=this.df.rotate.split(","),a=new Tt,u=Math.PI/180,s=(a.set(parseFloat(s[0])*u,parseFloat(s[2])*u,parseFloat(s[1])*u),o.rotation.setFromVector3(a,"YXZ"),this.df.scale.split(",")),u=(o.scale.set(parseFloat(s[0]),parseFloat(s[2]),parseFloat(s[1])),this.df.translate.split(",")),a=new Tt(this.G.gi[0].x-i.xt,this.G.gi[0].y-i.Et,0).applyEuler(new Q(-Math.PI/2,0,0,"XYZ")).add(new Tt(0,-1===this.G.height?2.2:this.G.height,0));if(a.add(new Tt(parseFloat(u[0]),parseFloat(u[2]),parseFloat(u[1]))),o.position.set(a.x,a.y,a.z),this.Rt=o,(this.Rt.mapNode=this).f0||(!function t(n){"Mesh"===n.type&&n.material.map&&r.Il.push(n.material.map.name);var e=n.children;for(var i=0;i<e.length;i++)t(e[i])}(this.Rt),this.f0=!0),this.yf(),this.E0(function(){e.jn.Do.add(e.Rt),e.$t&&(e.Rt.visible=!0),e.Sh||null!==e.Kr||e.l0({duration:!1===n.needFadeIn?0:void 0})}),0<t.animations.length){this.gf=new Fb(this.Rt);var c,h=Jb(t.animations);try{for(h.s();!(c=h.n()).done;){var f=c.value;this.rl[f.name]=this.gf.clipAction(f)}}catch(t){h.e(t)}finally{h.f()}s=this.gr(p);s.nr.S0(this.gf),s.Oi.autoPlay&&(i=!1,null!==this.h0&&2200===this.h0&&(i=!0),this.startAction(this.getActionNames()[0],i,!0))}null!==this.o0&&(this.o0.T0(this),this.o0=null)}}},E0:function(i){var r=[],o=null;null===this.Kr?i&&i():(function t(n){"Mesh"===n.type&&r.push(n);var e=n.children;for(var i=0;i<e.length;i++)t(e[i])}(this.Rt),function t(){var n=!0;for(var e=0;e<r.length;e++)if(!r[e].isUpdateComplete){n=!1;break}n?(i&&i(),null!==o&&clearTimeout(o)):o=setTimeout(t,10)}())},Jr:function(t){var n=this.gr(p),e=this.gr(v);return(n=n.getMapOptions().materialMode===ds.REAL?(e=this.no(t,e),n.Pt.io.Au(e)):t.clone()).userData=t.userData,n},A0:function(){var o=this,s=[],t=this.Rt;if(this._l)this.Rt.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.Jr(t.material[e]);i.transparent=!0,n.push(i)}t.material=n,s=s.concat(n)}else{var r=o.Jr(t.material);r.transparent=!0,t.material=r,s.push(r)}});else if(t.userData.sourceMaterial||(t.userData.sourceMaterial=t.material),Array.isArray(this.Rt.material)){for(var n=[],e=0;e<this.Rt.material.length;e++){var i=this.Rt.material[e];i.transparent=!0,n.push(i.clone())}this.Rt.material=n,s=s.concat(n)}else{t=this.Rt.material.clone();t.transparent=!0,s.push(t),this.Rt.material=t}return s},M0:function(){function n(t){var n;t&&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.Rt;this._l&&t?this.Rt.traverse(function(t){"Mesh"===t.type&&n(t)}):n(t),this.yf()},l0:function(t){var o=this,t=void 0!==(t=t||{}).duration?t.duration:.5,s=this.gr(v),a=s.gr(p);if(this.n0&&!1===this.n0.Hn){if(this.e0)return;this.n0.stop()}this.e0=!0;var u=this.A0();this.n0.Qn([0]).Zn([1]).qn(t).Jn(function(t){for(var n=t.destination[0],e=0;e<u.length;e++){var i=u[e],r=void 0!==o.ft?o.ft:i.userData.sourceOpacity;o._l&&a.getMapOptions().materialMode===ds.REAL?i.uniforms.opacity.value=n*r*s.ft:i.opacity=n*r*s.ft}a.enableUpdateRender()}).$n(function(){a.nr.tr(o.n0),o.M0()}),a.nr.Ki(this.n0.play())},d0:function(t){var r=this,n=void 0!==(t=t||{}).duration?t.duration:.5,o=this.gr(v),s=o.gr(p);if(this.n0&&!1===this.n0.Hn){if(!this.e0)return;this.n0.stop()}this.e0=!1;var a=this.A0();this.n0.Qn([1]).Zn([0]).qn(n).Jn(function(t){for(var n=t.destination[0],e=0;e<a.length;e++){var i=void 0!==r.ft?r.ft:a[e].userData.sourceOpacity;r._l&&s.getMapOptions().materialMode===ds.REAL?a[e].uniforms.opacity.value=n*i*o.ft:a[e].opacity=n*i*o.ft}s.enableUpdateRender()}).$n(function(){s.nr.tr(r.n0),r.Nn(),s.enableUpdateNode(),t.finish&&t.finish()}),s.nr.Ki(this.n0.play())},O0:function(t,n){n=this.no(t,n);t.color=new lt(n.color),t.opacity=n.opacity,t.transparent=n.transparent},yf:function(){var o=this;if(this.Rt){var s=this.gr(p),a=this.gr(v);if(s){if(this._l)this.Rt.traverse(function(t){if("Mesh"===t.type){var n=o.no(t.material,a);if(s.Oi.materialMode===ds.REAL){var e=s.Pt.io.eo(n),i=o.L0(e);null===i?(e.userData=t.material.userData,t.material=e):(i.userData=t.material.userData,t.material=i),o.Zr&&(n.color=o.Zr,(e=s.Pt.io.eo(n)).userData=t.material.userData,t.userData.sourceMaterial=t.material,t.material=e)}else if(Array.isArray(t.material.length))for(var r=0;r<t.material.length;r++)t.material[r].depthWrite=!0,t.material[r]=s.Pt.io.ro(t.material[r],n),o.L0(t.material[r]),o.Zr&&(n.color=o.Zr,t.userData.sourceMaterial=t.material,t.material[r]=s.Pt.io.ro(t.material[r],n));else{i=o.L0(t.material);null===i?(t.material.depthWrite=!0,t.material=s.Pt.io.ro(t.material,n)):(i.depthWrite=!0,t.material=i),o.Zr&&(n.color=o.Zr,t.userData.sourceMaterial=t.material,t.material=s.Pt.io.ro(t.material,n))}null!==o.Kr&&(t.isUpdateComplete=!0)}});else{var t=this.Rt.material;if(Array.isArray(t)){var n,e=[],i=Jb(t);try{for(i.s();!(n=i.n()).done;){var r,u=n.value;this.O0(u,a),this.Zr&&((r=u.clone()).color=new lt(this.Zr),e.push(r))}}catch(t){i.e(t)}finally{i.f()}this.Zr&&(this.Rt.userData.sourceMaterial=this.Rt.material,this.Rt.material=e)}else this.O0(t,a),this.Zr&&((t=t.clone()).color=new lt(this.Zr),this.Rt.userData.sourceMaterial=this.Rt.material,this.Rt.material=t)}this.$l&&(this.$l=!1),s.enableUpdateRender()}}},L0:function(t){return null!==this.Kr?((t=this.Jr(t)).clippingPlanes=this.Kr,t.clipping=!0,(this.s0||this.$r&&"outside"===this.$r)&&(t.clipIntersection=!0),t):null},no:function(t,n){var e={},i=(this.gr(p).Oi.materialMode===ds.REAL?(t.constructor===Q0?(t.userData.sourceOpacity=t.opacity,t.userData.sourceTransparent=t.transparent,void 0===t.userData.originColor&&(t.userData.originColor=t.color),void 0===t.userData.originOpacity&&(t.userData.originOpacity=t.opacity),null===this.ft&&(this.ft=t.opacity),e={alphaTest:t.alphaTest,color:t.color.getHex(),USE_EMISSIVEMAP:!!t.emissiveMap,USE_METALNESSMAP:!!t.metalnessMap,USE_NORMALMAP:!!t.normalMap,TANGENTSPACE_NORMALMAP:!!t.normalMap,USE_ROUGHNESSMAP:!!t.roughnessMap,USE_MAP:!!t.map,USE_AOMAP:!!t.aoMap,map:r(t.map,null),aoMap:r(t.aoMap,null),emissive:t.emissive.getHex(),emissiveMap:r(t.emissiveMap,null),metalness:r(t.metalness,0),metalnessMap:r(t.metalnessMap,null),roughness:r(t.roughness,1),roughnessMap:r(t.roughnessMap,null),normalScale:r(t.normalScale,new Mt(1,1)),normalMap:r(t.normalMap,null),vertexColors:t.vertexColors,side:t.side,skinning:t.skinning}):t.constructor===y0&&(e={alphaTest:t.alphaTest,USE_EMISSIVEMAP:t.defines.USE_EMISSIVEMAP,USE_MAP:t.defines.USE_MAP,USE_AOMAP:t.defines.USE_AOMAP,USE_METALNESSMAP:t.defines.USE_METALNESSMAP,USE_NORMALMAP:t.defines.USE_NORMALMAP,TANGENTSPACE_NORMALMAP:t.defines.TANGENTSPACE_NORMALMAP,USE_ROUGHNESSMAP:t.defines.USE_ROUGHNESSMAP,aoMap:r(t.uniforms.aoMap.value,null),map:r(t.uniforms.map.value,null),color:t.uniforms.diffuse.value.getHex(),emissive:t.uniforms.emissive.value.getHex(),emissiveMap:r(t.uniforms.emissiveMap.value,null),metalness:r(t.uniforms.metalness.value,0),metalnessMap:r(t.uniforms.metalnessMap.value,null),roughness:r(t.uniforms.roughness.value,1),roughnessMap:r(t.uniforms.roughnessMap.value,null),normalScale:r(t.uniforms.normalScale.value,new Mt(1,1)),normalMap:r(t.uniforms.normalMap.value,null),vertexColors:t.vertexColors,side:t.side,skinning:t.skinning},void 0===t.userData.originColor&&(t.userData.originColor=t.uniforms.diffuse.value),void 0===t.userData.originOpacity&&(t.userData.originOpacity=t.uniforms.opacity.value),null===this.ft)&&(this.ft=t.uniforms.opacity.value),null===this.Jl&&(this.Jl=e.color)):(void 0===t.userData.sourceOpacity&&(t.userData.sourceOpacity=t.opacity),void 0===t.userData.sourceTransparent&&(t.userData.sourceTransparent=t.transparent),void 0===t.userData.originColor&&(t.userData.originColor=t.color),void 0===t.userData.originOpacity&&(t.userData.originOpacity=t.opacity),null===this.Jl&&(this.Jl=t.color),null===this.ft&&(this.ft=t.opacity)),this.Jl&&(e.color=this.Jl),void 0!==t.userData.sourceOpacity?t.userData.sourceOpacity:t.opacity);return null!==this.ft&&(i=this.ft),this.x0(t,n),e.opacity=i*n.ft,e.transparent=t.userData.sourceTransparent||e.opacity<1,e;function r(t,n){return void 0!==t?t:n}},Nn:function(){var t;if(this.gf&&(this.stopAction(this.getActionNames()[0],!0),(t=this.gr(p))&&t.nr.R0(this.gf),this.gf=null),this.n0&&!1===this.n0.Hn&&this.n0.finish(),this.Rt&&"Mesh"===this.Rt.type){if(this.Rt.parent&&this.Rt.parent.remove(this.Rt),Array.isArray(this.Rt.material)){var n,e=Jb(this.Rt.material);try{for(e.s();!(n=e.n()).done;){var i=n.value;i.map&&this.r0&&i.map.dispose(),i.dispose()}}catch(t){e.e(t)}finally{e.f()}}else this.Rt.material.map&&this.r0&&this.Rt.material.map.dispose(),this.Rt.material.dispose();this.Rt.geometry.dispose(),this.Rt.geometry=void 0,this.Rt.material=void 0,this.Rt.mapNode=void 0,this.Rt=void 0}else this.Rt&&"Scene"===this.Rt.type&&(this.Rt.parent&&this.Rt.parent.remove(this.Rt),this.Rt.mapNode=void 0,this.Rt=void 0)},t0:function(){var t=this.gr(p);t&&t.enableUpdateRender()}}),i);function ag(t){return(ag="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 ug(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,function(t){t=function(t,n){if("object"!=ag(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=ag(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==ag(t)?t:t+""}(i.key),i)}}function cg(t,n,e){n=fg(n);var i=t,n=hg()?Reflect.construct(n,e||[],fg(t).constructor):n.apply(t,e);if(n&&("object"===ag(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function hg(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(hg=function(){return!!t})()}function fg(t){return(fg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function lg(t,n){return(lg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var i=function(){function e(t){var n;if(this instanceof e)return(n=cg(this,e)).G=t,n.nt=t.height,n.bi=E.FACILITY,n.qt=0,n.N0=null,n.Ei=new Map,n.df=null,n;throw new TypeError("Cannot call a class as a function")}var t,n=e,i=wb;if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");return n.prototype=Object.create(i&&i.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),i&&lg(n,i),n=e,(i=[{key:"FID",get:function(){return this.G.fid}},{key:"typeID",get:function(){return this.G.type}},{key:"eName",get:function(){return this.G._ename}},{key:"name",get:function(){return this.G.name}},{key:"size",get:function(){return this.N0||this.df.height},set:function(t){var n;this.N0=t,this.N0?this.qt=this.N0:(t=this.gr(p),n=this.gr(Es),this.df=t.Pt.pf.bc({fid:this.G.fid,typeID:""+this.G.type,bid:n.yi}),this.qt=this.df.height),this.yf()}},{key:"scaleSize",get:function(){return this.size/this.qt||1}},{key:"jump",value:function(t){return A1(this,t)}},{key:"stopJump",value:function(){return M1(this)}},{key:"boost",value:function(t){return S1(this,t)}},{key:"stopBoost",value:function(){return T1(this)}},{key:"getPosition",value:function(){return{x:this.G.gi[0].x,y:this.G.gi[0].y,z:this.nt}}},{key:"updateMaterialByThemeTool",value:function(t){this.df=t,this.qt=parseInt(this.df.height),this.N0&&(this.qt=this.N0),this.yf(),this.Rt.userData.size=this.qt}}])&&ug(n.prototype,i),t&&ug(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}(),dg=(Object.assign(i.prototype,{ec:function(){var t,n;if(!this.Rt)return t=this.gr(p),n=this.gr(Es),this.df=t.Pt.pf.bc({fid:this.G.fid,typeID:""+this.G.type,bid:n.yi}),this.qt=parseInt(this.df.height),(n=this.qr(t)).userData.opacity=n.opacity,this.Rt=new Gm(n),n=new Tt((n=this.G.gi[0]).x-t.xt,-n.y+t.Et,0).applyEuler(new Q(Math.PI/2,0,0,"XYZ")).add(new Tt(0,this.nt,0)),this.Rt.position.copy(n),this.Wo(t.Pt),this.Rt.userData.size=this.qt,(this.Rt.mapNode=this).jn.Do.add(this.Rt),!0},mf:function(t,n){var e;this.Rt&&(e=this.gr(Es),this.df=n.bc({fid:this.G.fid,typeID:""+this.G.type,bid:e.yi}),this.qt=parseInt(this.df.height),this.yf(),this.Rt.userData.size=this.qt)},yf:function(){var t;this.Rt&&(t=this.gr(p))&&(this.Rt.material=this.qr(t))},qr:function(t){var n=this,e=this.gr(v),i=e.parent;return t.Pt.io.Fu({opacity:e.ft,needDepth:!1,url:t.Pt._0(this.df,"path",i.buildingID)+this.df.imageName},function(){n.Wo(t.Pt),t.Pt.$o(),t.enableUpdateRender()})},Wo:function(t){O1(t,this)}}),i);function vg(t){return(vg="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 pg(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,function(t){t=function(t,n){if("object"!=vg(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=vg(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==vg(t)?t:t+""}(i.key),i)}}function mg(t,n,e){n=bg(n);var i=t,n=yg()?Reflect.construct(n,e||[],bg(t).constructor):n.apply(t,e);if(n&&("object"===vg(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function yg(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(yg=function(){return!!t})()}function bg(t){return(bg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function gg(t,n){return(gg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var i=function(){function i(t,n){var e;if(this instanceof i)return(e=mg(this,i)).G=t,e._n=n,e.bi=E.LABEL,e.df=null,e.P0=null,e.Zo=!1,e.Sh=null,n.Sn.F0===i1.ENAME?e.j0=t.ename:n.Sn.F0===i1.FID?e.j0=t.fid:e.j0=t.name,e.j0||(e.j0="",e.Zo=!0),e.I0=n.Oi.HDText,!0===e.I0&&st.a.environment===B.a.BROWSER&&(e.C0=new st.a.LabelCollection,e.D0=null),e.k0=null,e;throw new TypeError("Cannot call a class as a function")}var t,n=i,e=wb;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&gg(n,e),n=i,(e=[{key:"FID",get:function(){return this.G.fid}},{key:"typeID",get:function(){return this.G.type}},{key:"name",get:function(){return this.G.name}},{key:"eName",get:function(){return this.G.ename}},{key:"text",get:function(){return this.j0},set:function(t){t?(this.j0=t,this.Zo=!1):(this.j0="",this.Zo=!0),this.Rt&&(this.yf(),this.dh())}},{key:"fontSize",get:function(){return this.k0||this.df.fontsize},set:function(t){this.k0=t,this.k0?this.df.fontsize=this.k0:this.U0(this._n.Pt,this._n.Pt.pf),this.Rt&&this.yf()}},{key:"setText",value:function(t){this.text=t}}])&&pg(n.prototype,e),t&&pg(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}(),_g=(Object.assign(i.prototype,{nn:function(t){var n=this;return this.fontSize=t,new Promise(function(t){!1===n.I0&&t(),n.readyCallback=t})},B0:function(n,t){var e,i,r,o,s=this;n&&t&&(this.C0||(this.C0=new st.a.LabelCollection,this.D0=null),e=t.width,i=t.drawTextWidth,r=t.drawTextLeft,t=this.fontSize,this.C0.map=n,this.D0?(o=this.D0).labelMeshInstance&&(this.Rt.remove(o.labelMeshInstance.mesh),this.Rt.remove(o.labelOutlineMeshInstance.mesh)):(o=this.C0.add(),this.D0=o),o.G0=!0,o.H0=[],o.X0=!0,o.rootNode=this.Rt,o.text=this.j0,o.font="".concat(t,"px ").concat(this.df.fontFamily||'"Microsoft Yahei","微软雅黑",Tahoma,Arial'),o.V0=Lr.rgbToArray(this.df.fillColor),o.outlineWidth=void 0!==this.df.strokeWidth?2*this.df.strokeWidth:4,o.outlineColor=Lr.rgbToArray(this.df.strokeColor),o.pixelRatio=n.It.renderer.getPixelRatio(),n.on("update",function t(){s.C0.update(),!1===o.G0&&(o.pixelOffset=[(r+i/2-e/2)/2/1.2,0],n.enableUpdateRender(),n.off("update",t),s.readyCallback)&&s.readyCallback()}),n.on("pixelRatioChanged",function(){o.pixelRatio=n.It.renderer.getPixelRatio()}))},ec:function(){var t,n;this.Rt||(t=this.gr(v).jn.jn,this.U0(this._n.Pt,t.Pt.pf),this.Rt=new nh,(n=this.qr()).userData.opacity=n.opacity,(n=new Gm(n)).scale.set(0,0,0),this.Rt.add(n),this.Rt.mapNode=this,n=new Tt((n=(n.mapNode=this).G.gi[0]).x-t.xt,-n.y+t.Et,0).applyEuler(new Q(Math.PI/2,0,0,"XYZ")).add(new Tt(0,this.G.height,0)),this.Rt.position.copy(n),this.Wo(this._n.Pt),this.jn.Do.add(this.Rt),this.Sh&&this.Sh.ec(this))},mf:function(t,n){this.Rt&&(this.U0(t,n),this.yf())},yf:function(){var e=this;this.Rt&&this.gr(p)&&this.qr(function(t){var n;e.Rt&&(n=e.Rt.children[0].material,e.Rt.children[0].material=t,n.map&&(n.map.dispose(),n.map=null),n.dispose())})},qr:function(n){var e=this,t=this.gr(v),i={needSize:!0,opacity:this.df.alpha*t.ft,drawText:!this.I0};return this.df.image&&(i.imageUrl=this.P0+this.df.image),this._n.Pt.io.Nu(this.j0,this.df,i,function(t){n&&n(t),e.Rt&&e.Wo(e._n.Pt),void 0!==i.imageUrl&&e._n.Pt.$o(),st.a.environment===B.a.WX&&e._n.Pt.$o(),!0===e.I0?e.B0(e._n,null==(t=t.map)?void 0:t.image):e.readyCallback&&e.readyCallback(),e._n.enableUpdateRender()})},Wo:function(t){var n,e,i=this.Rt.children[0];i&&i.material.map&&i.material.map.image&&(n=i.material).userData.mspriteScale&&(t=t.Ch(this.fontSize),e=2*this.fontSize*1.2,e=n.map.image.height/e,n.userData.mspriteScale=Math.max(e,n.userData.mspriteScale),i.scale.set(t,t,t),i.scale.multiplyScalar(n.userData.mspriteScale),i.scale.setX(i.scale.x/n.userData.scaleRatio))},U0:function(t,n){var e=this.gr(Es),n=(this.df=n.gc({fid:this.G.fid,typeID:this.G.type+"",bid:e.yi}),this.k0&&(this.df.fontsize=this.k0),this.P0=t._0(this.df,"path",e.buildingID),parseInt(this.fontSize));isNaN(n)},updateMaterialByThemeTool:function(t){this.df=t;var t=this.gr(v).jn,n=t.jn.Pt;this.P0=n._0(this.df,"path",t.buildingID),this.yf()}}),i);function wg(t){return(wg="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 xg(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,function(t){t=function(t,n){if("object"!=wg(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=wg(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==wg(t)?t:t+""}(i.key),i)}}function Eg(t,n,e){n=Tg(n);var i=t,n=Sg()?Reflect.construct(n,e||[],Tg(t).constructor):n.apply(t,e);if(n&&("object"===wg(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function Sg(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Sg=function(){return!!t})()}function Tg(t){return(Tg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Ag(t,n){return(Ag=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var i=function(){function e(t){var n;if(this instanceof e)return(n=Eg(this,e)).nt=void 0!==(t=t||{}).height?t.height:1,n.xt=t.x,n.Et=t.y,n.Rt=null,n.kh=!1,n.ff=void 0,n.z0=t.userID,void 0===n.z0&&(n.z0=""+Lr.generateUUID()),n;throw new TypeError("Cannot call a class as a function")}var t,n=e,i=ms;if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");return n.prototype=Object.create(i&&i.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),i&&Ag(n,i),n=e,(i=[{key:"userID",get:function(){return this.z0},set:function(t){this.z0=t}},{key:"isInit",get:function(){return this.kh},set:function(t){this.kh=t}},{key:"isbloom",get:function(){return this.ff},set:function(t){this.ff=t}},{key:"x",get:function(){return this.xt}},{key:"y",get:function(){return this.Et}},{key:"height",get:function(){return this.nt},set:function(t){this.nt=t,this.W0()}},{key:"level",get:function(){var t=this.gr(v);return t?t.level:null}},{key:"visible",get:function(){return this.$t},set:function(t){this.$t=t,this.Rt&&(this.Rt.visible=this.$t,t=this.gr(p))&&t.enableUpdateRender()}},{key:"opacity",get:function(){return this.ft},set:function(t){this.ft=t,this.Rt&&(this.Rt.material.opacity=this.ft)}},{key:"isMarker",get:function(){return!0}},{key:"bound",get:function(){var n=this;return[E.IMAGE_MARKER,E.DOM_MARKER,E.DYNAMIC_MODEL_MARKER,E.LOCATION_MARKER,E.TEXT_MARKER].find(function(t){return t===n.bi})?!0===this.needUpdateBound&&(this.ci.reset(),void 0!==this.xt)&&void 0!==this.Et&&(this.ci.expandByCoords([{x:this.xt,y:this.Et}]),this.needUpdateBound=!1):!0===this.needUpdateBound&&(this.ci.reset(),this.ci.expandByCoords(this.Ih),this.needUpdateBound=!1),this.ci.clone()}},{key:"addTo",value:function(t){t.getOrCreateLayer(this.bi).add(this),this.Rt&&(null!=(t=this.Rt)&&t.updateMatrixWorld(!0),null!=(t=this.Rt))&&null!=(t=t.parent)&&t.updateMatrixWorld(!0)}},{key:"remove",value:function(){var t=this.gr(p);this.jn&&this.jn.remove(this),t&&t.enableUpdateRender()}},{key:"dispose",value:function(){var n=this;this.remove(),this.Rt&&(this.Rt.traverse(function(t){t instanceof $a&&(t.geometry.dispose(),t.geometry=void 0,Array.isArray(t.material)?t.material.forEach(function(t){n.Y0(t)}):n.Y0(t.material)),"SkinnedMesh"===t.type&&(t.skeleton.boneTexture&&t.skeleton.boneTexture.dispose(),t.skeleton.dispose())}),this.Rt.mapNode=void 0,this.Rt=void 0),this.kh=!1}}])&&xg(n.prototype,i),t&&xg(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}(),Mg=(Object.assign(i.prototype,{Y0:function(t){if(t){if(t instanceof y0){var n,e=t.uniforms;for(n in e)e[n]&&e[n].value instanceof l&&e[n].value.dispose();t.dispose()}else for(var i in t)t[i]&&t[i]instanceof l&&t[i].dispose();t.dispose()}},Q0:function(){var t;void 0!==this.xt&&void 0!==this.Et||(t=this.gr(v),this.xt=t.center.x,this.Et=t.center.y)},ec:function(){return!1},W0:function(){}}),i);function Og(){oa.call(this),this.type="InstancedBufferGeometry",this.maxInstancedCount=void 0}function Lg(t,n,e){lh.call(this,t,n),this.meshPerAttribute=e||1}function Rg(t){oa.call(this),this.type="WireframeGeometry";var n,e,i,r,o,s,a=[],u=[0,0],c={},h=["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[h[p]],o=v[h[(p+1)%3]],u[0]=Math.min(r,o),u[1]=Math.max(r,o),void 0===c[s=u[0]+","+u[1]]&&(c[s]={index1:u[0],index2:u[1]});for(s in c)_=t.vertices[(i=c[s]).index1],a.push(_.x,_.y,_.z),_=t.vertices[i.index2],a.push(_.x,_.y,_.z)}else if(t&&t.isBufferGeometry){var m,y,b,g,_=new Tt;if(null!==t.index){for(m=t.attributes.position,y=t.index,e=(b=(n=0)===(b=t.groups).length?[{start:0,count:y.count,materialIndex:0}]:b).length;n<e;++n)for(d=(l=(g=b[n]).start)+g.count;l<d;l+=3)for(p=0;p<3;p++)r=y.getX(l+p),o=y.getX(l+(p+1)%3),u[0]=Math.min(r,o),u[1]=Math.max(r,o),void 0===c[s=u[0]+","+u[1]]&&(c[s]={index1:u[0],index2:u[1]});for(s in c)_.fromBufferAttribute(m,(i=c[s]).index1),a.push(_.x,_.y,_.z),_.fromBufferAttribute(m,i.index2),a.push(_.x,_.y,_.z)}else for(l=0,d=(m=t.attributes.position).count/3;l<d;l++)for(p=0;p<3;p++)_.fromBufferAttribute(m,3*l+p),a.push(_.x,_.y,_.z),_.fromBufferAttribute(m,3*l+(p+1)%3),a.push(_.x,_.y,_.z)}this.setAttribute("position",new x(a,3))}function Ng(t){return(Ng="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 Pg(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,function(t){t=function(t,n){if("object"!=Ng(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Ng(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Ng(t)?t:t+""}(i.key),i)}}function Fg(t,n,e){n=Ig(n);var i=t,n=jg()?Reflect.construct(n,e||[],Ig(t).constructor):n.apply(t,e);if(n&&("object"===Ng(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function jg(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(jg=function(){return!!t})()}function Ig(t){return(Ig=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Cg(t,n){return(Cg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}Og.prototype=Object.assign(Object.create(oa.prototype),{constructor:Og,isInstancedBufferGeometry:!0,copy:function(t){return oa.prototype.copy.call(this,t),this.maxInstancedCount=t.maxInstancedCount,this},clone:function(){return(new this.constructor).copy(this)}}),Lg.prototype=Object.assign(Object.create(lh.prototype),{constructor:Lg,isInstancedInterleavedBuffer:!0,copy:function(t){return lh.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this}}),(Rg.prototype=Object.create(oa.prototype)).constructor=Rg;var Dg=function(){function n(){var t;if(!(this instanceof n))throw new TypeError("Cannot call a class as a function");(t=Fg(this,n)).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 x([-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 x([-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],2)),t.setAttribute("uv2",new x([0,0,1,0,0,1/3,1,1/3,0,2/3,1,2/3,0,1,1,1],2)),t}var t,e=n,i=Og;if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");return e.prototype=Object.create(i&&i.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),i&&Cg(e,i),e=n,(i=[{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,t=new Lg(n,6,1);return this.setAttribute("instanceStart",new vh(t,3,0)),this.setAttribute("instanceEnd",new vh(t,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,t=new Lg(n,6,1);return this.addAttribute("instanceColorStart",new vh(t,3,0)),this.addAttribute("instanceColorEnd",new vh(t,3,3)),this}},{key:"setUvys",value:function(t){t instanceof Float32Array?n=t:Array.isArray(t)&&(n=new Float32Array(t));var n,t=new Lg(n,2,1);return this.setAttribute("uvyStart",new vh(t,1,0)),this.setAttribute("uvyEnd",new vh(t,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 Rg(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 It,n=(null===this.boundingBox&&(this.boundingBox=new It),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 Tt,n=(null===this.boundingSphere&&(this.boundingSphere=new kt),null===this.boundingBox&&this.computeBoundingBox(),this.attributes.instanceStart),e=this.attributes.instanceEnd;if(void 0!==n&&void 0!==e){for(var i=this.boundingSphere.center,r=(this.boundingBox.getCenter(i),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}}])&&Pg(e.prototype,i),t&&Pg(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}();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 Ug(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,function(t){t=function(t,n){if("object"!=kg(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=kg(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==kg(t)?t:t+""}(i.key),i)}}function Bg(t,n,e){n=Hg(n);var i=t,n=Gg()?Reflect.construct(n,e||[],Hg(t).constructor):n.apply(t,e);if(n&&("object"===kg(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function Gg(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Gg=function(){return!!t})()}function Hg(t){return(Hg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Xg(t,n){return(Xg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var Vg=function(){function n(){var t;if(this instanceof n)return(t=Bg(this,n)).type="LineGeometry",t.isLineGeometry=!0,t;throw new TypeError("Cannot call a class as a function")}var t,e=n,i=Dg;if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");return e.prototype=Object.create(i&&i.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),i&&Xg(e,i),e=n,(i=[{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 Dg).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 Dg).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}}])&&Ug(e.prototype,i),t&&Ug(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(),zg=new Tt,Wg=new Tt;function Yg(t,n){this.start=void 0!==t?t:new Tt,this.end=void 0!==n?n:new Tt}function Qg(t){return(Qg="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 Zg(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,function(t){t=function(t,n){if("object"!=Qg(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Qg(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Qg(t)?t:t+""}(i.key),i)}}function qg(t,n,e){n=Jg(n);var i=t,n=Kg()?Reflect.construct(n,e||[],Jg(t).constructor):n.apply(t,e);if(n&&("object"===Qg(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function Kg(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Kg=function(){return!!t})()}function Jg(t){return(Jg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function $g(t,n){return($g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}function t_(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 Ot(t.x,t.y,t.z,1),n=new Ot(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(Yg.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 Tt),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 Tt),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 Tt),this.delta(n).multiplyScalar(t).add(this.start)},closestPointToPointParameter:function(t,n){zg.subVectors(t,this.start),Wg.subVectors(this.end,this.start);t=Wg.dot(Wg),t=Wg.dot(zg)/t;return t=n?St.clamp(t,0,1):t},closestPointToPoint:function(t,n,e){t=this.closestPointToPointParameter(t,n);return void 0===e&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),e=new Tt),this.delta(e).multiplyScalar(t).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 n_=function(){function e(t,n){if(this instanceof e)return(t=qg(this,e,[t,n])).type="LineSegments2",t.isLineSegments2=!0,t;throw new TypeError("Cannot call a class as a function")}var t,n=e,i=$a;if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");return n.prototype=Object.create(i&&i.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),i&&$g(n,i),n=e,(i=[{key:"computeLineDistances",value:function(){for(var t=new Tt,n=new Tt,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 c=new Lg(o,2,1);return e.setAttribute("instanceDistanceStart",new vh(c,1,0)),e.setAttribute("instanceDistanceEnd",new vh(c,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 Ot,i=new Ot,r=new Ot,o=new Tt,s=new At,a=new Yg,u=new Tt,c=new It,h=new kt,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,y=this.material,b=y.resolution,g=y.uniforms.lineWidth.value+f,_=m.attributes.instanceStart,w=m.attributes.instanceEnd,x=-d.near,y=2*Math.max(g/b.width,g/b.height);null===m.boundingSphere&&m.computeBoundingSphere(),h.copy(m.boundingSphere).applyMatrix4(p);f=t_({x:0,y:0,z:-Math.max(d.near,h.distanceToPoint(l.origin))},{x:y,y:0,z:0},d);if(d.isPerspectiveCamera?f.x/=2:f.x=g/d.zoom,h.radius+=f.x,!1!==t.ray.intersectsSphere(h)){null===m.boundingBox&&m.computeBoundingBox(),c.copy(m.boundingBox).applyMatrix4(p);f=t_({x:0,y:0,z:-Math.max(d.near,c.distanceToPoint(l.origin))},{x:y,y:0,z:0},d);if(d.isPerspectiveCamera?f.x/=2:f.x=g/d.zoom,c.max.x+=f.x,c.max.y+=f.x,c.max.z+=f.x,c.min.x-=f.x,c.min.y-=f.x,c.min.z-=f.x,!1!==t.ray.intersectsBox(c)){l.at(1,r),r.w=1,r.applyMatrix4(d.matrixWorldInverse),r.applyMatrix4(v),r.multiplyScalar(1/r.w),r.x*=b.x/2,r.y*=b.y/2,r.z=0,o.copy(r),s.multiplyMatrices(d.matrixWorldInverse,p);for(var E=0,S=_.count;E<S;E++){e.fromBufferAttribute(_,E),i.fromBufferAttribute(w,E),e.w=1,i.w=1,e.applyMatrix4(s),i.applyMatrix4(s);var T=e.z>x&&i.z>x;if(!T){e.z>x?(T=e.z-i.z,T=(e.z-x)/T,e.lerp(i,T)):i.z>x&&(T=i.z-e.z,T=(i.z-x)/T,i.lerp(e,T)),e.applyMatrix4(v),i.applyMatrix4(v),e.multiplyScalar(1/e.w),i.multiplyScalar(1/i.w),e.x*=b.x/2,e.y*=b.y/2,i.x*=b.x/2,i.y*=b.y/2,a.start.copy(e),a.start.z=0,a.end.copy(i),a.end.z=0;var T=a.closestPointToPointParameter(o,!0),T=(a.at(T,u),St.lerp(e.z,i.z,T)),T=-1<=T&&T<=1,A=u.distanceTo(i)<1||u.distanceTo(e)<1?.5*g*Math.sqrt(2):.5*g,A=o.distanceTo(u)<A;if(T&&A){a.start.fromBufferAttribute(_,E),a.end.fromBufferAttribute(w,E),a.start.applyMatrix4(p),a.end.applyMatrix4(p);T=new Tt,A=new Tt;l.distanceSqToSegment(a.start,a.end,A,T),n.push({point:A,pointOnLine:T,distance:l.origin.distanceTo(A),object:this,face:null,faceIndex:E,uv:null,uv2:null});break}}}}}}}])&&Zg(n.prototype,i),t&&Zg(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}();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 i_(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,function(t){t=function(t,n){if("object"!=e_(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=e_(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==e_(t)?t:t+""}(i.key),i)}}function r_(t,n,e){n=s_(n);var i=t,n=o_()?Reflect.construct(n,e||[],s_(t).constructor):n.apply(t,e);if(n&&("object"===e_(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function o_(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(o_=function(){return!!t})()}function s_(t){return(s_=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function a_(t,n){return(a_=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var u_=function(){function e(t,n){if(this instanceof e)return(t=r_(this,e,[t,n])).type="Line2",t.isLine2=!0,t;throw new TypeError("Cannot call a class as a function")}var t,n,i=e,r=n_;if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");return i.prototype=Object.create(r&&r.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),r&&a_(i,r),i=e,t&&i_(i.prototype,t),n&&i_(i,n),Object.defineProperty(i,"prototype",{writable:!1}),i}();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 h_(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,function(t){t=function(t,n){if("object"!=c_(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=c_(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==c_(t)?t:t+""}(i.key),i)}}var f_=function(){function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function")}return n=t,(e=[{key:"calculatePoint",value:function(t,n,e){return(new Tt).copy(e).add((new Tt).copy(t).sub(e).normalize().multiplyScalar(n))}},{key:"computerArcLineByPoints",value:function(t,n,e,i,r){var o=[],t=this.calculatePoint(t,i,n),e=this.calculatePoint(e,i,n),s=new Ip(t,n,e);o.push(t);for(var a=0;a<r-1;a++){var u=s.getPoint((a+1)/r);o.push(u)}return o.push(e),o}}])&&h_(n.prototype,e),i&&h_(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,e,i}();function l_(t){return function(t){if(Array.isArray(t))return d_(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,n){var e;if(t)return"string"==typeof t?d_(t,n):"Map"===(e="Object"===(e=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?d_(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 d_(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 v_(t){return(v_="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 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,function(t){t=function(t,n){if("object"!=v_(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=v_(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==v_(t)?t:t+""}(i.key),i)}}var i=function(){function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");this.Ih=null,this.Rr=0,this.Z0=void 0,this.q0=!0,this.K0=1,this.J0=[],this.$0=!1,this.td=null,this.nd=null,this.ed=[],this.rd=[],this.od=[],this.sd=null,this.ad=null,this.ud=!1}return n=t,(e=[{key:"points",get:function(){return this.Ih},set:function(t){this.ud=!1,this.Ih=t}},{key:"level",get:function(){return this.Rr},set:function(t){this.Rr=t}},{key:"buildingID",get:function(){return this.Z0},set:function(t){this.Z0=t}},{key:"length",get:function(){return this.hd(this.ed.length)}},{key:"linePoints",get:function(){return this.td}},{key:"uvys",get:function(){return this.nd}},{key:"resize",value:function(){this.ed=[],this.$0=!1}}])&&p_(n.prototype,e),i&&p_(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,e,i}(),m_=(Object.assign(i.prototype,{fd:function(t,n){this.ud||("number"!=typeof n&&(n=this.K0),this.td=this.ld(t,n),this.nd=this.dd(),this.ud=!0)},ld:function(t,n){this.q0?this.$0||this.vd(n):((n=[]).push.apply(n,l_(this.Ih)),this.J0=n);for(var e=[],i=0;i<this.J0.length;i++){var r=this.J0[i].x-t.x,o=this.J0[i].z,s=-this.J0[i].y+t.y;e.push(r,o,s),0!==i&&(r=new Tt(this.J0[i].x,this.J0[i].y,this.J0[i].z),o=new Tt(this.J0[i-1].x,this.J0[i-1].y,this.J0[i-1].z),this.ed.push(r.distanceTo(o)))}return e},vd:function(t){for(var n,e,i=[],r=new f_,o=0;o<this.Ih.length;o++)0===o&&this.ad?(n=this.pd(t,this.ad,this.Ih[o],this.Ih[o+1]),this.isCross?i.push.apply(i,l_(r.computerArcLineByPoints(this.ad,this.Ih[o],this.Ih[o+1],n,12))):i.push(r.calculatePoint(this.Ih[o+1],n,this.Ih[o]))):o===this.Ih.length-1&&this.sd?(n=this.pd(t,i[i.length-1],this.Ih[o],this.sd),this.isCross?i.push.apply(i,l_(r.computerArcLineByPoints(i[i.length-1],this.Ih[o],this.sd,n,12))):i.push(r.calculatePoint(i[i.length-1],n,this.Ih[o]))):0<o&&o<this.Ih.length-1?(e=this.pd(t,i[i.length-1],this.Ih[o],this.Ih[o+1]),i.push.apply(i,l_(r.computerArcLineByPoints(i[i.length-1],this.Ih[o],this.Ih[o+1],e,12)))):i.push(this.Ih[o]);this.J0=i,this.$0=!0},pd:function(t,n,e,i){return Math.min(.5*z.distanceOfTwoPoints(n,e),.5*z.distanceOfTwoPoints(e,i),t)},dd:function(){for(var t,n=[],e=this.hd(this.ed.length),i=0;i<this.J0.length;i++)0===i?n.push(0):i===this.J0.length-1?n.push(1):(t=this.hd(i)/e,n.push(t),n.push(t));return n},hd:function(t){for(var n=0,e=0;e<this.ed.length;e++)e<t&&(n+=this.ed[e]);return n}}),i),y_={FULL:0,DOTTED:2,DOT_DASH:4,CENTER:8,DASH:16,DOUBLE_DOT_DASH:32,TRI_DOT_DASH:64,FMARROW:128,ARROW:256};function b_(t){return(b_="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 g_(t,n){var e,i,r,o,s="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(s)return i=!(e=!0),{s:function(){s=s.call(t)},n:function(){var t=s.next();return e=t.done,t},e:function(t){i=!0,r=t},f:function(){try{e||null==s.return||s.return()}finally{if(i)throw r}}};if(Array.isArray(t)||(s=function(t,n){var e;if(t)return"string"==typeof t?__(t,n):"Map"===(e="Object"===(e=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?__(t,n):void 0}(t))||n&&t&&"number"==typeof t.length)return s&&(t=s),o=0,{s:n=function(){},n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},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.")}function __(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 w_(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,function(t){t=function(t,n){if("object"!=b_(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=b_(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==b_(t)?t:t+""}(i.key),i)}}function x_(t,n,e){n=T_(n);var i=t,n=E_()?Reflect.construct(n,e||[],T_(t).constructor):n.apply(t,e);if(n&&("object"===b_(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function E_(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(E_=function(){return!!t})()}function S_(){return(S_="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,n,e){var i=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=T_(t)););return t}(t,n);if(i)return(i=Object.getOwnPropertyDescriptor(i,n)).get?i.get.call(arguments.length<3?t:e):i.value}).apply(this,arguments)}function T_(t){return(T_=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function A_(t,n){return(A_=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var i=function(){function e(t){var n;if(this instanceof e)return n=x_(this,e,[t]),t=t||{},n.bi=E.LINE_MARKER,n.vf=t.url,n.md=void 0!==t.width?t.width:6,n.Jl=void 0!==t.color?t.color:"#33cc61",n.q0=void 0===t.smooth||t.smooth,n.yd=void 0!==t.radius?t.radius:1,n.jo=void 0===t.animate||t.animate,n.ft=void 0!==t.opacity?t.opacity:1,n.bd=void 0===t.depth||t.depth,n.gd=void 0!==t.type?t.type:y_.FMARROW,n._d=void 0!==t.borderColor?t.borderColor:"#4a82d2",n.wd=void 0!==t.segments?t.segments:[],n.Co=[],n.xd=60,n.Ed=10,n.Sd="#aeaeae",n.Td=n.Td.bind(n),n.Ad=n.Ad.bind(n),n.Md=n.Md.bind(n),n.Od=n.Od.bind(n),n.W0=n.W0.bind(n),n.Ld=void 0!==t.zFighting?t.zFighting:void 0,n.Ld&&(n.Rd=new e(Object.assign(t,{zFighting:!1})),n.Nd=1,n.Pd=0),n;throw new TypeError("Cannot call a class as a function")}var t,n=e,i=Mg;if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");return n.prototype=Object.create(i&&i.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),i&&A_(n,i),n=e,(i=[{key:"bound",get:function(){if(!0===this.needUpdateBound){this.ci.reset();for(var t=this.wd,n=0;n<t.length;n++){var e=t[n];this.ci.expandByCoords(e.Ih)}this.needUpdateBound=!1}return this.ci.clone()}},{key:"level",get:function(){return null}},{key:"width",get:function(){return this.md},set:function(t){0!==t&&t!==this.md&&(this.md=t,this.yf(),this.Ld)&&(this.Rd.width=t)}},{key:"color",get:function(){return this.Jl},set:function(t){this.Jl!==t&&(this.Jl=t,this.yf())}},{key:"opacity",get:function(){return this.ft},set:function(t){this.ft!==t&&(this.ft=t,this.yf(),this.Ld)&&(this.Rd.opacity=t)}},{key:"passedColor",get:function(){return this.Sd},set:function(t){this.Sd!==t&&(this.Sd=t,this.yf())}},{key:"segments",get:function(){return this.wd},set:function(t){this.wd=t;var n=this.gr(p);n&&(this.Fd(n),this.ec(),this.Od(),this.Ld)&&(this.Rd.segments=t,this.Rd.moveProportion(1))}},{key:"visible",get:function(){return this.$t},set:function(t){this.$t=t;for(var n=0;n<this.Co.length;n++)this.Co[n].line.visible=t;var e=this.gr(p);e&&(e.enableUpdateRender(),this.Ld)&&(this.Rd.visible=t)}},{key:"updatePosition",value:function(t){this.W0(t)}},{key:"update",value:function(){var t,n;this.Rt&&this.Rt.material&&(t=this.gr(p))&&(n=this.gr(v),this.Rt.material=t.Pt.io.Ou({color:this.Jl,lineWidth:this.md,opacity:this.ft*n.ft,needDepth:!1}),this.Ld)&&this.Rd.update()}},{key:"moveProportion",value:function(t){for(var n=0,e=this.Co.length-1;-1<e;e--)this.Co[e].isCross||(n+=this.Co[e].seg.length);for(var i=0,r=this.Co.length-1;-1<r;r--){var o=i/n,s=(this.Co[r].isCross||(i+=this.Co[r].seg.length),i/n);s<t?this.Co[r].line.material.uniforms.miny.value=1:t<=s&&(this.Co[r].line.material.uniforms.miny.value=(t-o)/(s-o))}var a=this.gr(p);a&&a.enableUpdateRender()}},{key:"getLineNodes",value:function(){return this.Co}},{key:"addTo",value:function(t){t.Io.add(this),this.jd(),t.on("visibleLevelsLoaded",this.Od),t.on("zoom",this.Ad),t.on("levelChanged",this.Ad),t.on("resize",this.Md),this.jo&&!1!==this.Ld&&t.nr.Id(this.Td),this.Ld&&(this.Rd.addTo(t),this.Rd.moveProportion(1))}},{key:"remove",value:function(){var t=this.gr(p);t&&(t.off("visibleLevelsLoaded",this.Od),t.off("zoom",this.Ad),t.off("levelChanged",this.Ad),t.off("resize",this.ko),this.Fd(t),this.jo&&t.nr.Cd(this.Td),t.Io.remove(this),t.enableUpdateRender(),this.Ld)&&this.Rd.remove(t)}},{key:"dispose",value:function(){S_(T_(e.prototype),"dispose",this).call(this);for(var t=0;t<this.wd.length;t++)this.wd[t].resize();this.Ld&&this.Rd.dispose()}},{key:"getRenderNode",value:function(){return this.Co}}])&&w_(n.prototype,i),t&&w_(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}(),M_=(Object.assign(i.prototype,{Fd:function(t){for(var n=0;n<this.Co.length;n++){var e=this.Co[n].buildingID&&""+this.Co[n].buildingID,e=this.Bi(e,this.Co[n].gid,t);e&&e.getOrCreateLayer(this.bi).Do.remove(this.Co[n].line)}this.Co=[]},Dd:function(t,n){var e=new Vg,t=(e.setPositions(t),this.gr(v)),n=n.Pt.io.Ou({color:this.Jl,lineWidth:this.md,opacity:this.opacity*t.ft,needDepth:!1});this.Rt=new u_(e,n),this.Rt.computeLineDistances(),e.dispose()},kd:function(t){var n=new Vg;n.setPositions(t),this.Rt.geometry=n,this.Rt.computeLineDistances(),n.dispose()},ec:function(){var t=this.gr(p);if(t){for(var n=this.Ud(),e=this.wd.length-1;-1<e;e--){var i=this.Bi(this.wd[e].buildingID,this.wd[e].Rr,t);if(!i)return;var r=void 0,o=void 0;if(0<e&&this.wd[e].Z0===this.wd[e-1].Z0&&this.wd[e].Rr!==this.wd[e-1].Rr){if(!(r=this.Bi(this.wd[e-1].buildingID,this.wd[e-1].Rr,t)))return;o=this.wd[e-1].points,this.wd[e].ad=Object.assign({},o[o.length-1]),this.wd[e].ad.z+=r.nt-i.nt}if(e<this.wd.length-1&&this.wd[e].Z0===this.wd[e+1].Z0&&this.wd[e].Rr!==this.wd[e+1].Rr){var s=this.Bi(this.wd[e+1].buildingID,this.wd[e+1].Rr,t);if(!s)return;this.wd[e].sd=Object.assign({},this.wd[e+1].points[0]),this.wd[e].sd.z+=s.nt-i.nt}var a,u,s=this.Bd(this.wd[e],n);this.Co.push({line:s,buildingID:this.wd[e].Z0,gid:this.wd[e].Rr,seg:this.wd[e],isCross:!1}),i.getOrCreateLayer(this.bi).Do.add(s),0<e&&this.wd[e].Z0===this.wd[e-1].Z0&&this.wd[e].Rr!==this.wd[e-1].Rr&&((a=new m_).Rr=this.wd[e].Rr,a.Z0=this.wd[e].Z0,a.isCross=!0,u=this.wd[e].points,this.Gd(a,o,u,r,i),o=this.Bd(a,n),this.Co.push({buildingID:a.Z0,line:o,seg:a,gid:this.wd[e-1].Rr,gidAn:a.Rr,isCross:!0,levelRange:[this.wd[e-1].Rr,this.wd[e].Rr]}),r.getOrCreateLayer(this.bi).Do.add(o))}return this.kh=!0,t.enableUpdateRender(),this.kh}},Gd:function(t,n,e,i,r){var o=Object.assign({},n[n.length-1]),s=Object.assign({},e[0]);o.z+=i.nt-r.nt,t.points=[o,s],t.ad=Object.assign({},n[n.length-2]),t.ad.z+=i.nt-r.nt,t.sd=Object.assign({},e[1])},Bd:function(t,n){var e=this.gr(p);if(e){var i=new Mt(e.x,e.y),i=(t.q0=this.q0,t.fd(i,this.yd),this.Bi(t.Z0,t.Rr,e));if(i){for(var r=[],o=0;o<t.linePoints.length;o++)r.push(t.linePoints[o]);var s=t.nd,a=new Vg,s=(a.setPositions(r),a.setUvys(s),new Cl({color:this.Jl,lineWidth:this.md,vertexColors:2,dashed:!1,transparent:!0,pcolor:this.Sd,opacity:this.ft})),e=(s.depthTest=this.bd,s.depthWrite=this.bd,s.transparent=!0,s.resolution=new Mt(e.It.renderer.domElement.clientWidth,e.It.renderer.domElement.clientHeight),void 0!==this.Nd&&(s.uniforms.usePassOpacity.value=this.Nd),void 0!==this.Pd&&(s.uniforms.passOpacity.value=this.Pd),n.useMap&&(s.defines.USE_MMAP=!0,s.uniforms.mmap.value=n.texture,this.Hd(s,t,this.xd),s.needsUpdate=!0),new u_(a,s));return this.Ld?e.renderOrder=0:!1===this.Ld&&(e.renderOrder=1),!this.Ld&&!1!==this.Ld||(s.stencilWrite=!0,s.stencilRef=2,s.stencilFunc=516,s.stencilFail=gi,s.stencilZFail=gi,s.stencilZPass=gi),e.computeLineDistances(),e.position.set(0,i.nt,0),e.mapNode=this,e}}},Td:function(t){for(var n=0;n<this.Co.length;n++)this.Co[n].line.material.uniforms.offset.value.y-=.001*t;this.gr(p).enableUpdateRender()},Ad:function(){for(var t=0;t<this.Co.length;t++)this.Hd(this.Co[t].line.material,this.Co[t].seg,this.xd)},Hd:function(t,n,e){var i,r=this.gr(p);r&&(i=n.length,n=this.Bi(n.Z0,n.Rr,r))&&(i=i*r.Pt.Xd(n.nt),t.uniforms.repeat.value.y=Math.floor(i*st.a.window.devicePixelRatio/e),r.enableUpdateRender())},Md:function(){var t=this.gr(p);if(t){for(var n=0;n<this.Co.length;n++)this.Co[n].line.material.resolution=new Mt(t.It.renderer.domElement.clientWidth,t.It.renderer.domElement.clientHeight);t.enableUpdateRender()}},jd:function(){var t,n=this.gr(p),e=g_(this.Co);try{for(e.s();!(t=e.n()).done;){var i,r=t.value;r.isCross?(i=this.Ga(r.buildingID,n).visibleLevels).indexOf(r.gid)<0||i.indexOf(r.gidAn)<0?r.line.visible=!1:(r.line.visible=!0,r.line.visible=this.$t):-1<this.Ga(r.buildingID,n).visibleLevels.indexOf(r.gid)?(r.line.visible=!0,r.line.visible=this.$t):r.line.visible=!1}}catch(t){e.e(t)}finally{e.f()}n.enableUpdateRender()},Od:function(){this.gr(p)&&this.jd()},Vd:function(){this.xd=this.md*this.Ed;var t={type:"normal",width:128,height:128,color:this.Jl,arrowHeightPercent:.6,arrowWidthPercent:1,arrowPercent:.1,lineType:null,dashArray:[2,1],textureCommand:"createNormalLineTexture",godHeightPercent:1,godEdgePercent:.2,godArrowPercent:.15,arrowWidth:20,godColor:this.Jl,godEdgeColor:this._d,godArrowColor:"#F4FEFB",godArrowXScale:4,godArrowWidthPercent:.9,useMap:!0};switch(this.gd){case y_.FULL:t.useMap=!1;break;case y_.DOTTED:t.dashArray=[.5,.5,.5,.5,.5,.5,.5,.5];break;case y_.DOT_DASH:t.dashArray=[2.5,1,.5,1];break;case y_.CENTER:t.dashArray=[3,1,1.5,1];break;case y_.DASH:t.dashArray=[2,1];break;case y_.DOUBLE_DOT_DASH:t.dashArray=[2.5,.5,.5,.5,.5,.5];break;case y_.TRI_DOT_DASH:t.dashArray=[2.5,.5,.5,.5,.5,.5,.5,.5];break;case y_.FMARROW:case y_.ARROW:st.a.environment===B.a.BROWSER&&(t.width=5*this.md,t.height=5*this.xd),t.arrowWidth=t.height/12,t.dashArray=[7,0],t.textureCommand="createArrowWidthBackTexture";break;default:t.useMap=!1}return t},Ud:function(){var t,n,e=this.gr(p);if(e)return t=this.Vd(),n=null,this.vf?{useMap:!0,texture:e.Pt.io.ku(this.vf,function(t){t.needsUpdate=!0})}:(t.useMap&&((n=e.Pt.io[t.textureCommand](t)).minFilter=Zn,n.wrapS=Xn,n.wrapT=Xn,n.generateMipmaps=!1,n.anisotropy=4),{useMap:t.useMap,texture:n})},yf:function(){if(0<this.Co.length)for(var t=this.Ud(),n=0;n<this.Co.length;n++)this.Co[n].line.material.lineWidth=this.md,this.Co[n].line.material.color=new lt(this.Jl),this.Co[n].line.material.pcolor=new lt(this.Sd),this.Co[n].line.material.opacity=this.ft,t.useMap&&(this.Co[n].line.material.uniforms.mmap.value=t.texture);var e=this.gr(p);e&&e.enableUpdateRender()},Bi:function(t,n,e){return(t?this.Ga(t,e):e).getFloor(n)},Ga:function(t,n){return t=t||n.getMapOptions().buildingID,n.getBuilding(t)},W0:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},n=void 0===t.needUpdateCrossLine||t.needUpdateCrossLine;if(0<this.Co.length){var e=this.gr(p);if(e){for(var i=0;i<this.Co.length;i++){var r,o=this.Co[i];if(o.isCross)n&&(s=this.Bi(o.buildingID,o.gid,e),r=this.Bi(o.buildingID,o.gidAn,e),o.seg.resize(),this.Gd(o.seg,this.Co[i+1].seg.points,this.Co[i-1].seg.points,s,r),r=this.Ud(),r=this.Bd(o.seg,r),(s=s.getOrCreateLayer(this.bi)).Do.add(r),s.Do.remove(o.line),r.material.uniforms.miny.value=o.line.material.uniforms.miny.value,o.line.geometry.dispose(),o.line.material.dispose(),o.line=r);else{var s=this.Bi(o.seg.Z0,o.seg.Rr,e);if(!s)return;o.line.position.y=s.nt}}e.enableUpdateRender()}}}}),i);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 L_(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,function(t){t=function(t,n){if("object"!=O_(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=O_(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==O_(t)?t:t+""}(i.key),i)}}function R_(t,n,e){n=F_(n);var i=t,n=N_()?Reflect.construct(n,e||[],F_(t).constructor):n.apply(t,e);if(n&&("object"===O_(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function N_(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(N_=function(){return!!t})()}function P_(){return(P_="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,n,e){var i=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=F_(t)););return t}(t,n);if(i)return(i=Object.getOwnPropertyDescriptor(i,n)).get?i.get.call(arguments.length<3?t:e):i.value}).apply(this,arguments)}function F_(t){return(F_=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function j_(t,n){return(j_=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var i=function(){function e(t){var n;if(this instanceof e)return(n=R_(this,e)).G=t,n.nt=t.height,n.bi=E.MODEL,n.Rt=null,n.gh=null,n.Ei=null,n.ci=null,n.zd="#FF0000",n.Xl=null,n.oo={top:null,left:null,right:null,front:null,back:null},n.Wd=!1,n.df=null,n.Jl=null,n.ft=null,n.Yd=null,n.Qd=null,n.Zd=.01*n.qd(n.x+n.y),n.Kd=null,n.Jd=null,n.$d=[0,0],n.tv=null,n.nv=0,n.Sh=null,n.ev=0,n.Kr=null,n.$r=null,n.s0=!1,n;throw new TypeError("Cannot call a class as a function")}var t,n=e,i=wb;if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");return n.prototype=Object.create(i&&i.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),i&&j_(n,i),n=e,(i=[{key:"FID",get:function(){return this.G.fid}},{key:"typeID",get:function(){return this.G.type}},{key:"name",get:function(){return this.G.name}},{key:"eName",get:function(){return this.G.ename}},{key:"pass",get:function(){return this.G.pass}},{key:"coordinates",get:function(){return this.G.gi}},{key:"x",get:function(){var t;return null==(t=this.G.Jt)?void 0:t.x}},{key:"y",get:function(){var t;return null==(t=this.G.Jt)?void 0:t.y}},{key:"getData",value:function(){return Object.assign(P_(F_(e.prototype),"getData",this).call(this),{pass:this.G.pass})}},{key:"getArea",value:function(){return E1.area(this.G.gi[0])}},{key:"setColor",value:function(t,n){this.Wd=!0,void 0!==t&&(this.Jl=t),void 0!==n&&(this.ft=n),this.yf()}},{key:"resetColor",value:function(){this.df&&!this.iv()||this.U0(),this.setColor(this.df.color,this.df.alpha),this.Wd=!1}},{key:"setBorderColor",value:function(t,n){t&&(this.Yd=t),null!=n&&(this.Qd=n);t=this.gr(p);this.rv(t)}},{key:"resetBorderColor",value:function(){this.df&&(this.iv()&&this.U0(),this.setBorderColor(this.df.strokeColor,this.df.alpha))}},{key:"setTopImage",value:function(t){this.ev=1,this.Kd=t.image,this.tv=void 0!==t.coords?t.coords:this.G.Jt,this.Jd=void 0!==t.size?t.size:[5,5],this.$d=void 0!==t.offset?t.offset:[0,0],this.nv=void 0!==t.angle?t.angle:0,this.Rt&&this.ov()}},{key:"clearTopImage",value:function(){this.ev=0,this.sv()}},{key:"flash",value:function(t){this.av(t);var n=this,e=this.gr(p),i=0;function r(){i%2==0?n.Rt&&(n.Rt.material.color=new lt(n.zd)):n.Rt&&(n.Rt.material.color=new lt(n.Jl)),i++,e.enableUpdateRender()}n.Xl&&clearTimeout(n.Xl),function t(){n.Rt&&(n.Rt.userData.sourceMaterial||(n.Rt.userData.sourceMaterial=n.Rt.material,n.Rt.material=n.Rt.material.clone()),n.Rt.userData.sourceMaterial.canDispose=!1,r());n.Xl=setTimeout(t,100)}()}},{key:"stopFlash",value:function(){var t;this.Xl&&(clearTimeout(this.Xl),this.Xl=null,t=this.Rt.material,this.Rt.material=this.Rt.userData.sourceMaterial,delete this.Rt.userData.sourceMaterial.canDispose,delete this.Rt.userData.sourceMaterial,t.dispose(),t=null,this.gr(p).enableUpdateRender())}},{key:"getOtherNode",value:function(){return{top:this.oo.top,line:this.gh}}}])&&L_(n.prototype,i),t&&L_(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}(),I_=(Object.assign(i.prototype,{ec:function(){var t,n,e,i;this.Rt||(t=(i=(n=this.gr(v)).jn).jn,i=i.jn.Pt,n=n.getLayers(E.EXTENT_LAYER)[0].bound,n=i.qc(this.G,this.nt,n,!0),this.U0(),this.Jl&&this.Wd||(this.Jl=this.df.color),null!==this.ft&&this.Wd||(this.ft=this.df.alpha),this.Yd&&this.Wd||(this.Yd=this.df.strokeColor),this.md&&this.Wd||(this.md=this.df.strokeWidth),null!==this.Qd&&this.Wd||(this.Qd=this.df.alpha),(i=this.qr(i.io)).userData.opacity=i.opacity,e=this.G.getBound(),this.Rt=new $a(n.geometry,i),i=new Tt(e.center.x-t.xt,0,t.Et-e.center.y),this.Rt.position.copy(i),this.Rt.rotation.set(-Math.PI/2,0,0,"XYZ"),(this.Rt.mapNode=this).jn.Do.add(this.Rt),this.cv=n.shape,this.hv(n.shape),this.fv(),this.Sh&&this.Sh.ec(this))},lv:function(){var n=this,t=this.cv.getPoints(),e=new M_({color:this.Yd,width:this.md,smooth:!1,animate:!1,depth:!0}),i=(e.jn=this,[]),t=(t.forEach(function(t){i.push(t.x,t.y,n.nt+n.Zd)}),this.gr(p)),t=(e.Dd(i,t),e.Rt.material.depthWrite=!0,e.Rt.material.depthTest=!0,e.Rt.material.polygonOffset=!0,e.Rt.material.polygonOffsetFactor=-1,e.Rt.material.polygonOffsetUnits=1,this.Rt.add(e.Rt),this.nt&&-1!==this.nt?this.nt:2);e.Rt.position.setZ(.005*t),e.Rt.renderOrder=-1,e.Rt.isNoPick=!0,this.gh=e.Rt},dv:function(t){return null===this.Kr?t:((t=t.clone()).clippingPlanes=this.Kr,t.clipping=!0,(this.s0||this.$r&&"outside"===this.$r)&&(t.clipIntersection=!0),t)},vv:function(t){var n=this.gr(v),t=t.xu({isline:!0,color:this.Yd,opacity:this.Qd*n.ft,needDepth:!0});return this.dv(t)},initGLLine:function(){for(var t=this.gr(Es).jn.Pt,n=this.vv(t.io),e=this.nt&&-1!==this.nt?this.nt:2,i=(new Bs).setFromPoints(this.cv.getPoints()),r=(i&&0<i.vertices.length&&i.vertices.push(i.vertices[0]),[]),o=i.vertices.length,s=0;s<o;s++)i.vertices[s].z=this.nt+this.Zd,0===s||s===o-1?r.push(i.vertices[s]):r.push(i.vertices[s],i.vertices[s]);i.vertices=r;var a=new Vd(i,n);if(a.position.setZ(.005*e),a.castShadow=!1,a.geometry.computeBoundingSphere(),this.gh=a,this.gh.matrixAutoUpdate=!1,this.Rt.add(a),0===this.md&&(this.gh.visible=!1),this.cv.holes)for(var u=0;u<this.cv.holes.length;u++){l=f=h=c=void 0;for(var c=a,h=this.cv.holes[u].curves,f=0;f<h.length;f++){var l=[];l.push(new Tt(h[f].v1.x,h[f].v1.y,e)),l.push(new Tt(h[f].v2.x,h[f].v2.y,e));l=new Vd((new oa).setFromPoints(l),n);c.add(l)}}},hv:function(){1<Math.floor(this.md)?this.lv():this.initGLLine()},fv:function(){var t,n;this.Kd&&this.Jd&&(n=this.gr(p),t=new ma(1,1,1,1),n=this.pv(n,this.Kd),this.oo.top=new $a(t,n),this.oo.top.renderOrder=10,this.mv(),this.Rt.add(this.oo.top))},ov:function(){this.Kd&&this.Jd?this.oo.top?(this.yv(),this.mv()):this.fv():this.sv()},sv:function(){var t;this.oo.top&&this.oo.top.parent&&(this.oo.top.parent.remove(this.oo.top),this.oo.top.geometry.dispose(),this.oo.top.material.map&&this.oo.top.material.map.dispose(),this.oo.top.material.dispose(),this.oo.top=null,t=this.gr(p))&&t.enableUpdateRender()},av:function(t){this.zd=t},mf:function(){this.U0(),this.Jl=this.df.color,this.ft=this.df.alpha,this.Yd=this.df.strokeColor,this.Qd=this.df.alpha,this.md=this.df.strokeWidth,this.gh&&(this.gh.visible=0!==this.md),this.yf(),this.Rt&&this.ov()},bv:function(t){var n=this.gr(v);return t.xu({isline:!0,color:this.Yd,opacity:this.Qd*n.ft,needDepth:!0})},iv:function(){return!!this.Rt&&this.Rt.material.userData.dirtyTheme},qr:function(t){var n=this.gr(v),e=this.gr(Es).jn.Pt,i={themeUseDetail:this.df.themeUseDetail,level:n.level,buildingId:n.parent.buildingId},n={color:this.Jl,alpha:this.ft*n.ft,type:this.bi},r=(e.io.callHook("getMaterialBefor",{material:null==(r=this.Rt)?void 0:r.material,additionalInfo:i}),t.Su(n,i));return e.io.callHook("getMaterialAfter",{createInfo:n,material:r,additionalInfo:i}),this.dv(r)},pv:function(n,t){var e=new $0({transparent:!0,opacity:this.gr(v).ft,depthWrite:!1,visible:!1});return null!==this.Kr&&(e.clippingPlanes=this.Kr,e.clipping=!0,this.s0||this.$r&&"outside"===this.$r)&&(e.clipIntersection=!0),n.Pt.io.ku(t,function(t){e.map=t,e.map.wrapS=Vn,e.map.wrapT=Vn,e.needsUpdate=!0,e.visible=!0,e.polygonOffset=!0,e.polygonOffsetFactor=-1,e.polygonOffsetUnits=-4,n.enableUpdateRender()},{generateMipmaps:!0}),e},yv:function(){var t,n=this.oo.top;n&&(n.material.map&&n.material.map.dispose(),n.material.map=null,n.material.dispose(),t=this.gr(p),n.material=this.pv(t,this.Kd))},yf:function(){var t,n;this.Rt&&(t=this.gr(p))&&(this.Rt.userData.sourceMaterial?this.Rt.userData.sourceMaterial=this.qr(t.Pt.io):(n=this.Rt.material.userData,this.Rt.material=this.qr(t.Pt.io),this.Rt.material.userData=n),this.rv(t),this.yv(),t.enableUpdateRender())},rv:function(t){if(this.gh&&Math.floor(this.md)<2){var n=this.vv(t.Pt.io);this.gh.material=n;for(var e=0;e<this.gh.children.length;e++)this.gh.children[e].material=n}else this.gh&&(this.Rt.remove(this.gh),this.gh.mapNode instanceof M_?(this.gh.mapNode.width=this.md,this.gh.mapNode.color=this.Yd):this.lv());t.enableUpdateRender()},mv:function(){var t=this.oo.top,n=(t.scale.set(this.Jd[0],this.Jd[1],1),this.G.getBound());t.position.set(this.$d[0]+this.tv.x-n.center.x,this.$d[1]+this.tv.y-n.center.y,this.nt+.1),t.rotation.z=-this.nv*Math.PI/180},U0:function(){var t=this.gr(Es),n=t.jn.Pt;this.df=n.pf.mc({fid:this.G.fid,typeID:this.G.type+"",bid:t.yi}),0===this.ev&&(this.df.image?this.Kd=n._0(this.df,"logoPath",t.buildingID)+this.df.image:this.Kd=null,this.df.coords&&(n=this.df.coords.split(","),this.tv=new Mt(parseFloat(n[0]),parseFloat(n[1]))),this.df.angle&&(this.nv=this.df.angle),this.df.sizes)&&(t=this.df.sizes.split(","),this.Jd=[parseFloat(t[0]),parseFloat(t[1])]),this.Rt&&delete this.Rt.material.userData.dirtyTheme},Nn:function(){var t;this.Rt&&((t=this.gr(p))&&t.Pt.io.callHook("removeMaterial",{material:null==(t=this.Rt)?void 0:t.material,additionalInfo:{themeUseDetail:this.df.themeUseDetail}}),this.gh&&(this.Rt.remove(this.gh),this.gh.material.dispose(),this.gh.geometry.dispose(),this.gh=void 0),this.sv(),this.Rt.parent&&this.Rt.parent.remove(this.Rt),this.Rt.geometry.dispose(),this.Rt.geometry=void 0,this.Rt.material=void 0,this.Rt.mapNode=void 0,this.Rt=void 0)},qd:function(t){return(t=(9301*t+49297)%233280)/233280}}),i);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 D_(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var i,r,o,s,a=[],u=!0,c=!1;try{if(o=(e=e.call(t)).next,0===n){if(Object(e)!==e)return;u=!1}else for(;!(u=(i=o.call(e)).done)&&(a.push(i.value),a.length!==n);u=!0);}catch(t){c=!0,r=t}finally{try{if(!u&&null!=e.return&&(s=e.return(),Object(s)!==s))return}finally{if(c)throw r}}return a}}(t,n)||k_(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 k_(t,n){var e;if(t)return"string"==typeof t?U_(t,n):"Map"===(e="Object"===(e=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?U_(t,n):void 0}function U_(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 B_(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,W_(i.key),i)}}function G_(t,n,e){n=Q_(n);var i=t,n=H_()?Reflect.construct(n,e||[],Q_(t).constructor):n.apply(t,e);if(n&&("object"===C_(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function H_(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(H_=function(){return!!t})()}function X_(){return(X_="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,n,e){var i=Y_(t,n);if(i)return(i=Object.getOwnPropertyDescriptor(i,n)).get?i.get.call(arguments.length<3?t:e):i.value}).apply(this,arguments)}function V_(t,n,e,i){return(V_="undefined"!=typeof Reflect&&Reflect.set?Reflect.set:function(t,n,e,i){var r,t=Y_(t,n);if(t){if((r=Object.getOwnPropertyDescriptor(t,n)).set)return r.set.call(i,e),!0;if(!r.writable)return!1}if(r=Object.getOwnPropertyDescriptor(i,n)){if(!r.writable)return!1;r.value=e,Object.defineProperty(i,n,r)}else z_(i,n,e);return!0})(t,n,e,i)}function z_(t,n,e){return(n=W_(n))in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function W_(t){t=function(t,n){if("object"!=C_(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=C_(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==C_(t)?t:t+""}function Y_(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=Q_(t)););return t}function Q_(t){return(Q_=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Z_(t,n){return(Z_=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var i=function(){function r(){if(this instanceof r)return G_(this,r);throw new TypeError("Cannot call a class as a function")}var t,n=r,e=B1;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&Z_(n,e),n=r,(e=[{key:"level",get:function(){return this.jn.Rr}},{key:"visible",get:function(){return this.$t},set:function(t){var n=Q_(r.prototype),e=t,i=!0;if(!V_(n,"visible",e,this||n)&&i)throw new TypeError("failed to set property");this.$t=t,this.Do.visible=!(!this.jn.visible||!this.$t);e=this.gr(p);e&&e.Pt.$o()}},{key:"getFeatures",value:function(){return this.Lt}},{key:"dispose",value:function(){this.hf&&this.hf(),X_(Q_(r.prototype),"dispose",this).call(this)}},{key:"init",value:function(){X_(Q_(r.prototype),"init",this).call(this);var t=this.gr(p);this.visible=t.Pt.gv(this.bi)}},{key:"getBound",value:function(){var t=this.bound;return{maxY:t.max.y,maxX:t.max.x,minX:t.min.x,minY:t.min.y}}},{key:"remove",value:function(t){this.Do.remove(t.Rt),X_(Q_(r.prototype),"remove",this).call(this,t)}}])&&B_(n.prototype,e),t&&B_(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}(),q_=(Object.assign(i.prototype,{Ki:function(t){(t.jn=this).Lt.push(t)},_v:function(t,n){var e,i=z_(z_(z_(z_(z_({},E.EXTERNAL_MODEL_LAYER,sg),E.MODEL_LAYER,I_),E.EXTENT_LAYER,Ob),E.FACILITY_LAYER,dg),E.LABEL_LAYER,_g),r=function(t,n){var e,i,r,o,s="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(s)return i=!(e=!0),{s:function(){s=s.call(t)},n:function(){var t=s.next();return e=t.done,t},e:function(t){i=!0,r=t},f:function(){try{e||null==s.return||s.return()}finally{if(i)throw r}}};if(Array.isArray(t)||(s=k_(t))||n&&t&&"number"==typeof t.length)return s&&(t=s),o=0,{s:n=function(){},n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},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.")}(t.Lt);try{for(r.s();!(e=r.n()).done;){var o=D_(e.value,2),s=(o[0],o[1]),a=new i[this.bi](s,n.map);this.Ki(a),a.visible=n.map.Pt.wv(this.bi,{typeID:a.typeID,FID:a.FID})}}catch(t){r.e(t)}finally{r.f()}}}),i);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 J_(t,n,e){return(n=tw(n))in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function $_(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,tw(i.key),i)}}function tw(t){t=function(t,n){if("object"!=K_(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=K_(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==K_(t)?t:t+""}function nw(t,n,e){n=rw(n);var i=t,n=ew()?Reflect.construct(n,e||[],rw(t).constructor):n.apply(t,e);if(n&&("object"===K_(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function ew(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(ew=function(){return!!t})()}function iw(){return(iw="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,n,e){var i=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=rw(t)););return t}(t,n);if(i)return(i=Object.getOwnPropertyDescriptor(i,n)).get?i.get.call(arguments.length<3?t:e):i.value}).apply(this,arguments)}function rw(t){return(rw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function ow(t,n){return(ow=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var i=function(){function t(){if(this instanceof t)return nw(this,t);throw new TypeError("Cannot call a class as a function")}var n,e=t,i=q_;if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");return e.prototype=Object.create(i&&i.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),i&&ow(e,i),e=t,(i=[{key:"init",value:function(){iw(rw(t.prototype),"init",this).call(this),this.rf(),this.sf(),this.type===E.EXTERNAL_MODEL_LAYER&&Iy(this)}}])&&$_(e.prototype,i),n&&$_(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(),sw=(Object.assign(i.prototype,{rf:function(){var t=J_(J_(J_({},E.EXTERNAL_MODEL_LAYER,"FMExternalModelLayer"),E.MODEL_LAYER,"FMModelLayer"),E.EXTENT_LAYER,"FMExtentLayer"),n=this.gr(p),t=t[this.bi],e=n.Pt.lc.get(n.getMapOptions().mapID).theme;n.getMapOptions().isuserLight||!e.Bu?this.cf=new Fy(n).createLight(this,t):(e=n.Pt.lc.get(n.getMapOptions().mapID).theme.Bu,this.cf=new Fy(n).createLightByTheme(this,t,e.extent))},sf:function(){this.Do.add(this.Jh),this.Do.add(this.qh),this.Do.add(this.$h),this.Do.add(this.Kh),this.nf&&this.Do.add(this.nf)},hf:function(){this.Do.remove(this.Jh),this.Do.remove(this.qh),this.Do.remove(this.$h),this.cf.Yn()}}),i);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 uw(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,function(t){t=function(t,n){if("object"!=aw(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=aw(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==aw(t)?t:t+""}(i.key),i)}}function cw(t,n,e){n=fw(n);var i=t,n=hw()?Reflect.construct(n,e||[],fw(t).constructor):n.apply(t,e);if(n&&("object"===aw(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function hw(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(hw=function(){return!!t})()}function fw(t){return(fw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function lw(t,n){return(lw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}i=function(){function i(t,n){var e;if(this instanceof i)return(e=cw(this,i)).Tr=t.alias,e.xv=t.desc,e.nt=t.height,e.bi=E.EXTENT_LAYER,e.Do.name="extent",e.Do.userData.type="extent",e.Ev={},e._v(t,n),e;throw new TypeError("Cannot call a class as a function")}var t,n,e=i,r=sw;if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");return e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),r&&lw(e,r),e=i,t&&uw(e.prototype,t),n&&uw(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}();function dw(t){return(dw="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 vw(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,function(t){t=function(t,n){if("object"!=dw(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=dw(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==dw(t)?t:t+""}(i.key),i)}}function pw(t,n,e){n=yw(n);var i=t,n=mw()?Reflect.construct(n,e||[],yw(t).constructor):n.apply(t,e);if(n&&("object"===dw(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function mw(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(mw=function(){return!!t})()}function yw(t){return(yw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function bw(t,n){return(bw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var gw=function(){function i(t,n){var e;if(this instanceof i)return(e=pw(this,i)).bi=E.MODEL_LAYER,e.Do.name="model",e.Do.userData.type="model",e.Tr="model",e.Sv={},e._v(t,n),e;throw new TypeError("Cannot call a class as a function")}var t,n=i,e=sw;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&bw(n,e),n=i,(e=[{key:"height",get:function(){return this.jn.nt}}])&&vw(n.prototype,e),t&&vw(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}();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 ww(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,function(t){t=function(t,n){if("object"!=_w(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=_w(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==_w(t)?t:t+""}(i.key),i)}}function xw(t,n,e){n=Sw(n);var i=t,n=Ew()?Reflect.construct(n,e||[],Sw(t).constructor):n.apply(t,e);if(n&&("object"===_w(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function Ew(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Ew=function(){return!!t})()}function Sw(t){return(Sw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Tw(t,n){return(Tw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var Aw=function(){function t(){if(this instanceof t)return xw(this,t);throw new TypeError("Cannot call a class as a function")}var n,e=t,i=q_;if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");return e.prototype=Object.create(i&&i.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),i&&Tw(e,i),e=t,(i=[{key:"collision",get:function(){return this.qo},set:function(t){this.qo!==t&&(this.qo=t,t=this.gr(p))&&t.Pt.$o()}}])&&ww(e.prototype,i),n&&ww(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}();function Mw(t){return(Mw="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 Ow(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,function(t){t=function(t,n){if("object"!=Mw(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Mw(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Mw(t)?t:t+""}(i.key),i)}}function Lw(t,n,e){n=Nw(n);var i=t,n=Rw()?Reflect.construct(n,e||[],Nw(t).constructor):n.apply(t,e);if(n&&("object"===Mw(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function Rw(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Rw=function(){return!!t})()}function Nw(t){return(Nw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Pw(t,n){return(Pw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var Fw=function(){function i(t,n){var e;if(this instanceof i)return(e=Lw(this,i)).bi=E.LABEL_LAYER,e.Do.userData.type="label",e.Do.name="label",(e.Do.mapNode=e).Tr="label",e.Tv={},e._v(t,n),e.qo=!0,e;throw new TypeError("Cannot call a class as a function")}var t,n=i,e=Aw;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&Pw(n,e),n=i,(e=[{key:"type",get:function(){return this.bi}}])&&Ow(n.prototype,e),t&&Ow(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}();function jw(t){return(jw="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 Iw(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,function(t){t=function(t,n){if("object"!=jw(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=jw(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==jw(t)?t:t+""}(i.key),i)}}function Cw(t,n,e){n=kw(n);var i=t,n=Dw()?Reflect.construct(n,e||[],kw(t).constructor):n.apply(t,e);if(n&&("object"===jw(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function Dw(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Dw=function(){return!!t})()}function kw(t){return(kw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Uw(t,n){return(Uw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var Bw=function(){function i(t,n){var e;if(this instanceof i)return(e=Cw(this,i)).bi=E.FACILITY_LAYER,e.Do.userData.type="facility",e.Do.name="facility",e.Tr="facility",e.Av={},e.qo=!0,(e.Do.mapNode=e)._v(t,n),e;throw new TypeError("Cannot call a class as a function")}var t,n,e=i,r=Aw;if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");return e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),r&&Uw(e,r),e=i,t&&Iw(e.prototype,t),n&&Iw(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}();function Gw(t){return(Gw="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 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,function(t){t=function(t,n){if("object"!=Gw(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Gw(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Gw(t)?t:t+""}(i.key),i)}}function Xw(t,n,e){n=zw(n);var i=t,n=Vw()?Reflect.construct(n,e||[],zw(t).constructor):n.apply(t,e);if(n&&("object"===Gw(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function Vw(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Vw=function(){return!!t})()}function zw(t){return(zw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Ww(t,n){return(Ww=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var Yw=function(){function i(t,n){var e;if(this instanceof i)return(e=Xw(this,i)).bi=E.EXTERNAL_MODEL_LAYER,e.Do.name="externalModel",e.Do.userData.type="externalModel",e.Tr="externalModel",e.Sv={},e._v(t,n),e;throw new TypeError("Cannot call a class as a function")}var t,n=i,e=sw;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&Ww(n,e),n=i,(e=[{key:"height",get:function(){return this.jn.nt}},{key:"beforRemove",value:function(){this.traverse(function(t){t.beforRemove&&t.beforRemove()})}}])&&Hw(n.prototype,e),t&&Hw(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}();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 Zw(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,function(t){t=function(t,n){if("object"!=Qw(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Qw(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Qw(t)?t:t+""}(i.key),i)}}function qw(t,n,e){n=Jw(n);var i=t,n=Kw()?Reflect.construct(n,e||[],Jw(t).constructor):n.apply(t,e);if(n&&("object"===Qw(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function Kw(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Kw=function(){return!!t})()}function Jw(t){return(Jw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function $w(t,n){return($w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var t2=function(){function n(){var t;if(this instanceof n)return(t=qw(this,n)).bi=E.WALL_MARKER,t;throw new TypeError("Cannot call a class as a function")}var t,e,i=n,r=Z1;if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");return i.prototype=Object.create(r&&r.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),r&&$w(i,r),i=n,t&&Zw(i.prototype,t),e&&Zw(i,e),Object.defineProperty(i,"prototype",{writable:!1}),i}();function n2(t){return(n2="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 e2(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,function(t){t=function(t,n){if("object"!=n2(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=n2(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==n2(t)?t:t+""}(i.key),i)}}function i2(t,n,e){n=o2(n);var i=t,n=r2()?Reflect.construct(n,e||[],o2(t).constructor):n.apply(t,e);if(n&&("object"===n2(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function r2(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(r2=function(){return!!t})()}function o2(t){return(o2=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function s2(t,n){return(s2=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var a2=function(){function n(){var t;if(this instanceof n)return(t=i2(this,n)).bi=E.TUBE_MARKER,t.rf(),t;throw new TypeError("Cannot call a class as a function")}var t,e,i=n,r=Z1;if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");return i.prototype=Object.create(r&&r.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),r&&s2(i,r),i=n,t&&e2(i.prototype,t),e&&e2(i,e),Object.defineProperty(i,"prototype",{writable:!1}),i}();Object.assign(a2.prototype,{rf:function(){this.qh=new Ry(7631988),this.Kh=new a,this.Jh=new Rd(8947848,1.2),this.Jh.position.set(-1,1,1).normalize(),this.Jh.castShadow=!1,this.Jh.target=this.Kh,this.$h=new Rd(3355443),this.$h.position.set(-.5,1,-1).normalize(),this.$h.target=this.Kh,this.Do.add(this.Jh),this.Do.add(this.$h),this.Do.add(this.qh),this.Do.add(this.Kh)}});function u2(t){return(u2="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 c2(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,function(t){t=function(t,n){if("object"!=u2(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=u2(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==u2(t)?t:t+""}(i.key),i)}}function h2(t,n,e){n=l2(n);var i=t,n=f2()?Reflect.construct(n,e||[],l2(t).constructor):n.apply(t,e);if(n&&("object"===u2(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function f2(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(f2=function(){return!!t})()}function l2(t){return(l2=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function d2(t,n){return(d2=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var v2=function(){function n(){var t;if(this instanceof n)return(t=h2(this,n)).bi=E.LINE3D_MARKER,t;throw new TypeError("Cannot call a class as a function")}var t,e,i=n,r=Z1;if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");return i.prototype=Object.create(r&&r.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),r&&d2(i,r),i=n,t&&c2(i.prototype,t),e&&c2(i,e),Object.defineProperty(i,"prototype",{writable:!1}),i}();function p2(t){return(p2="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 m2(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,function(t){t=function(t,n){if("object"!=p2(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=p2(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==p2(t)?t:t+""}(i.key),i)}}function y2(t,n,e){n=g2(n);var i=t,n=b2()?Reflect.construct(n,e||[],g2(t).constructor):n.apply(t,e);if(n&&("object"===p2(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function b2(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(b2=function(){return!!t})()}function g2(t){return(g2=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function _2(t,n){return(_2=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var w2=function(){function n(){var t;if(this instanceof n)return(t=y2(this,n)).bi=E.SPHERE_MARKER,t;throw new TypeError("Cannot call a class as a function")}var t,e,i=n,r=Z1;if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");return i.prototype=Object.create(r&&r.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),r&&_2(i,r),i=n,t&&m2(i.prototype,t),e&&m2(i,e),Object.defineProperty(i,"prototype",{writable:!1}),i}(),x2={},E2=(x2.LAYER_CLASS=new Map,x2.LAYER_CLASS.set(E.EXTENT_LAYER,i),x2.LAYER_CLASS.set(E.MODEL_LAYER,gw),x2.LAYER_CLASS.set(E.LABEL_LAYER,Fw),x2.LAYER_CLASS.set(E.FACILITY_LAYER,Bw),x2.LAYER_CLASS.set(E.EXTERNAL_MODEL_LAYER,Yw),x2.LAYER_CLASS.set(E.IMAGE_MARKER,e),x2.LAYER_CLASS.set(E.TEXT_MARKER,ev),x2.LAYER_CLASS.set(E.POLYGON_MARKER,tv),x2.LAYER_CLASS.set(E.EXTRUDE_MARKER,nv),x2.LAYER_CLASS.set(E.HEAT_MAP_MARKER,Ly),x2.LAYER_CLASS.set(E.DYNAMIC_MODEL_MARKER,Vy),x2.LAYER_CLASS.set(E.LINE_MARKER,Jy),x2.LAYER_CLASS.set(E.LOCATION_MARKER,sb),x2.LAYER_CLASS.set(E.DOM_MARKER,db),x2.LAYER_CLASS.set(E.WALL_MARKER,t2),x2.LAYER_CLASS.set(E.TUBE_MARKER,a2),x2.LAYER_CLASS.set(E.LINE3D_MARKER,v2),x2.LAYER_CLASS.set(E.SPHERE_MARKER,w2),x2);function S2(t){return(S2="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 T2(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var i,r,o,s,a=[],u=!0,c=!1;try{if(o=(e=e.call(t)).next,0===n){if(Object(e)!==e)return;u=!1}else for(;!(u=(i=o.call(e)).done)&&(a.push(i.value),a.length!==n);u=!0);}catch(t){c=!0,r=t}finally{try{if(!u&&null!=e.return&&(s=e.return(),Object(s)!==s))return}finally{if(c)throw r}}return a}}(t,n)||A2(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 A2(t,n){var e;if(t)return"string"==typeof t?M2(t,n):"Map"===(e="Object"===(e=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?M2(t,n):void 0}function M2(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 O2(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,function(t){t=function(t,n){if("object"!=S2(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=S2(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==S2(t)?t:t+""}(i.key),i)}}function L2(t,n,e){n=P2(n);var i=t,n=R2()?Reflect.construct(n,e||[],P2(t).constructor):n.apply(t,e);if(n&&("object"===S2(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function R2(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(R2=function(){return!!t})()}function N2(){return(N2="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,n,e){var i=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=P2(t)););return t}(t,n);if(i)return(i=Object.getOwnPropertyDescriptor(i,n)).get?i.get.call(arguments.length<3?t:e):i.value}).apply(this,arguments)}function P2(t){return(P2=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function F2(t,n){return(F2=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var i=function(){function e(t){var n;if(this instanceof e)return(n=L2(this,e)).Oi=t.mapOptions,n.Sn=t.states,n.G=t.data,n.Rr=n.G.gid,n.Mv=n.G.gname,n.Ov=n.G.alias,n.Lv=n.G.desc,n.nt=0,n.Rv=null,n.Nv=[E.EXTENT_LAYER,E.EXTERNAL_MODEL_LAYER,E.MODEL_LAYER,E.LABEL_LAYER,E.FACILITY_LAYER],n.ft=1,n.Pv=!0,n.Fv=new Ps,n.Fv.isEffect=!0,n;throw new TypeError("Cannot call a class as a function")}var t,n=e,i=ms;if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");return n.prototype=Object.create(i&&i.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),i&&F2(n,i),n=e,(i=[{key:"bound",get:function(){return L1(this)}},{key:"height",get:function(){return this.nt}},{key:"type",get:function(){return this.G.bi}},{key:"center",get:function(){var t=this.Rv;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.$t},set:function(t){var n=this,t=(this.$t=t,this.traverse(function(t){t.Do.visible=!(!t.visible||!n.$t)}),this.gr(p));t&&t.Pt.$o()}},{key:"level",get:function(){return this.Rr}},{key:"name",get:function(){return this.Mv}},{key:"ID",get:function(){return this.yi}},{key:"alias",get:function(){return this.Ov}},{key:"floorID",get:function(){return this.G.floorId}},{key:"effectScene",get:function(){return this.Fv}},{key:"getLayers",value:function(t,n){if(void 0===t)return this.Lt;for(var e=[],i=0;i<this.Lt.length;i++)0==(this.Lt[i].type&t)==!!n&&e.push(this.Lt[i]);return e}},{key:"getExtendMesh",value:function(){var t=this.getLayers(E.EXTENT_LAYER)[0];return t?t.Lt[0].Rt:null}},{key:"getExtendByCoords",value:function(t){for(var n=null,e=this.getLayers(E.EXTENT_LAYER)[0],i=0;i<e.Lt.length;i++){var r=e.Lt[i],o=r.G.gi[0];if(z.Me(t,o,o.length)){n=r;break}}return n}},{key:"getModelMeshs",value:function(){for(var t=this.getLayers(E.MODEL_LAYER)[0],n=[],e=0;e<t.Lt.length;e++)n.push(t.Lt[e].Rt);return n}},{key:"getBound",value:function(){return this.G.getBound().toObject()}},{key:"setExtentImage",value:function(t){for(var n=this.getLayers(E.EXTENT_LAYER)[0],e=0;e<n.Lt.length;e++)n.Lt[e].bf(t)}},{key:"clearExtentImage",value:function(){this.setExtentImage("")}},{key:"getOrCreateLayer",value:function(t){var n=this.getLayers(t)[0];return void 0!==n||(n=new(E2.LAYER_CLASS.get(t)),this.Ki(n),this.gr(p).It.On()),n}},{key:"getMapCoordsRange",value:function(){return this.Rv}},{key:"opacity",value:function(){return this.ft}},{key:"remove",value:function(t){t.beforRemove&&t.beforRemove(),N2(P2(e.prototype),"remove",this).call(this,t);t=this.gr(p);t&&t.It&&t.It.On()}}])&&O2(n.prototype,i),t&&O2(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}(),v=(Object.assign(i.prototype,{jv:function(){var t=this.Sn.vr(this.jn.yi);t.nonFocusAlphaMode&&(this.jn.level===this.Rr?1!==this.ft&&(this.ft=1,this.Pv=!0):this.ft!==t.nonFocusAlpha&&(this.ft=t.nonFocusAlpha,this.Pv=!0))},Ki:function(t){(t.jn=this).Lt.push(t),this.needUpdateBound=!0,t.init(),this.Iv(t)},Iv:function(t){this.Fv.add(t.Do)},Cv:function(){var i,r,t,o=this,n=this.jn;this.jn.constructor===v1?this.nt=n.floorSpace*this.Rr:1===n.visibleLevels.length&&this.Sn.En!=n.buildingID?(t=n.parent.An,this.nt=t.getFloor(t.level).height):(i=1/0,r=0,(t=n.alignHeight).forEach(function(t,n,e){Math.abs(o.Rr-n)<i&&(i=Math.abs(o.Rr-n),r=n)}),this.nt=t.get(r)+n.floorSpace*(this.Rr-r))},Dv:function(t){t.bi===E.LOCATION_MARKER&&t.Lt.forEach(function(t){t.W0()})},Lr:function(t){function e(){o.Io.Lt.forEach(function(t){t.bi===E.LINE_MARKER&&t.W0({needUpdateCrossLine:1<i.parent.visibleLevels.length})}),o.enableUpdateNode()}var i=this,n=void 0===(t=t||{}).animate||t.animate,r=void 0!==t.duration?t.duration:.5,o=this.gr(p),s=this.nt;this.Cv();n?(this.kv||(this.kv=new Pr),this.kv.Qn([s]).Zn([this.nt]).qn(r).Jn(function(n){i.traverse(function(t){t.bi!==E.LINE_MARKER&&t.bi!==E.LOCATION_MARKER&&(t.Do.position.y=n.destination[0]),i.Dv(t)}),e()}).$n(function(){t.finish&&t.finish()}),o.nr.Ki(this.kv.Wn())):(this.kv&&this.kv.stop(),this.traverse(function(t){t.bi!==E.LINE_MARKER&&t.bi!==E.LOCATION_MARKER&&(t.Do.position.y=i.nt),i.Dv(t)}),e())},Uv:function(e){for(var t=0;t<this.Lt.length;t++)if("externalModel"===this.Lt[t].Tr)this.Lt[t].Do.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.Lt[t].Do.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)},Bv:function(){for(var t=0;t<this.Lt.length;t++)if("externalModel"===this.Lt[t].Tr)this.Lt[t].Do.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.Lt[t].Do.children,e=0;e<n.length;e++)n[e].material&&n[e].material.userData.oldAlpha&&(n[e].material.opacity=n[e].material.userData.oldAlpha)},Gv:function(){var n=this;this.jn.jn.Ir.jr.get(this.jn.wr).Lt.forEach(function(t){t.gid===n.Rr&&(t=t.Lt.get(E.EXTENT_LAYER).getBound(),n.Rv={minX:t.X.x,minY:t.X.y,maxX:t.H.x,maxY:t.H.y})})},Hv:function(){var i,r=this,t=this.G,o=null,s=this.gr(p),n=function(t,n){var e,i,r,o,s="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(s)return i=!(e=!0),{s:function(){s=s.call(t)},n:function(){var t=s.next();return e=t.done,t},e:function(t){i=!0,r=t},f:function(){try{e||null==s.return||s.return()}finally{if(i)throw r}}};if(Array.isArray(t)||(s=A2(t))||n&&t&&"number"==typeof t.length)return s&&(t=s),o=0,{s:n=function(){},n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},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.")}(t.Lt);try{for(n.s();!(i=n.n()).done;)!function(){var t=T2(i.value,2),n=t[0],t=t[1];if(r.Lt.some(function(t){return t.type===n}))return;var e=E2.LAYER_CLASS.get(n);o=new e(t,{map:s}),r.Ki(o)}()}catch(t){n.e(t)}finally{n.f()}},Xv:function(t,n){for(var e=null,i=0;i<t.length;i++)if(""+t[i].bi==""+n){e=t[i];break}return e}}),i);var j2={textureCanvas:null,dispose:function(){}};function I2(t){return(I2="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 C2(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,function(t){t=function(t,n){if("object"!=I2(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=I2(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==I2(t)?t:t+""}(i.key),i)}}function D2(t,n,e){return n&&C2(t.prototype,n),e&&C2(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}var gw=D2(function t(n,e,i,r){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");this._n=n,this.Oi=e,this.Sn=i,this.Vn=r,this.io=new N0(this),this.Oi.themeTool&&this.Oi.themeTool.setMaterialManager(this.io),this.G=null,this.y0=new hp(n),this.y0.rh=this.Oi.ClassicMaterial,this.Vv=new yp(n),this.pf=new B0(this),this.lc=new Map,this.Nt=[],this.zv=[],this.Wv=0,this.Yv=!1,this.Xn=this.Xn.bind(this),this.Qv=null,this.Zv=this.Zv.bind(this),this.qv=new Ht(new Tt(0,1,0),0),this.Ur=new hs,this.tn=!0,n.on("visibleLevelsLoaded",this.Zv),n.on("loaded",this.Zv),n.on("viewChanged",this.Zv),n.on("viewModeChanged",this.Zv),n.on("buildingEntered",this.Zv),n.on("buildingExited",this.Zv),n.on("zoom",this.Zv),n.on("move",this.Zv),n.on("mapLoaded",this.Zv),n.on("levelChanged",this.Zv),n.on("sceneLoaded",this.Zv),n.on("firstViewLoaded",this.Zv),n.on("beforeRender",this.Xn),this.La=null,this.Uo=this.Uo.bind(this),this.Ra=new Ol({disposeCallback:this.Uo,enable:!0,name:"NodeManager",mapCreateTime:this._n.Rn})}),k2=(Object.assign(gw.prototype,{Zv:function(n){var t,e=this;if("visibleLevelsLoaded"!==n.type&&"loaded"!==n.type&&"viewChanged"!==n.type||(this.Sn.Kv=!0,this.$o()),"viewModeChanged"===n.type&&this._n.Ht.Gt.updateCheck(),"mapLoaded"===n.type&&this._n.Jv(function(t){e.$v({bid:t.yi})}),"move"===n.type&&this._n.tp(),"buildingEntered"!==n.type&&"buildingExited"!==n.type||this.$v({bid:n.buildingID}),"zoom"===n.type){if(this._n.tp(),this._n.traverse(function(t){t!==e._n.An&&(e.$v({bid:t.yi}),t.Ph())}),st.a.environment===B.a.WX){if(void 0===j2.lastHandleZoomTime&&(j2.lastHandleZoomTime=Date.now()),Date.now()-j2.lastHandleZoomTime<50)return void(j2.lastHandleZoomTime=Date.now());j2.lastHandleZoomTime=Date.now()}this._n.traverse(function(t){t.visible&&t.traverse(function(t){t.visible&&t.traverse(function(t){t.visible&&t.traverse(function(t){t.type===E.EXTERNAL_MODEL&&t.Rt&&(!(t.G&&(t.G.maxlevel<=n.zoom||t.G.minlevel>n.zoom))?t.fading&&t.l0():t.d0())})})})})}"levelChanged"!==n.type&&"visibleLevelsLoaded"!==n.type||(n.buildingID&&n.buildingID!==this._n.Oi.buildingID?(t=this._n.getBuilding(n.buildingID))&&t.traverse(function(t){t.Lr()}):this._n.traverse(function(t){"levelChanged"===n.type&&t.yi!==e._n.Oi.buildingID&&t.Fh(n.level),t.traverse(function(t){t.Lr({animate:!1})})})),"sceneLoaded"!==n.type||n.buildingID||(this.Wv+=5,this._n.kt.Dt({type:"progress",progressBar:this.Wv})),"visibleLevelsLoaded"===n.type&&void 0===n.buildingID&&(this.Wv+=50,this._n.kt.Dt({type:"progress",progressBar:this.Wv})),"loaded"===n.type&&(this.Wv+=30,this._n.kt.Dt({type:"progress",progressBar:this.Wv})),"firstViewLoaded"===n.type&&(this.Wv=100,this._n.kt.Dt({type:"progress",progressBar:this.Wv}))},Xd:function(t){var n=(new Tt).copy(this._n.Ht.Gt.target),e=new Mt(0,0);return n.y=t+e.y,10/("PerspectiveCamera"===this._n.Ut.type?(t=this._n.Ut.near,e=this._n.Ut.fov,n=this._n.Ht.Gt.object.position.distanceTo(n),10*t*Math.tan(e/2*u.DEG2RAD)*2/this._n.It.renderer.domElement.clientHeight*n/t):(e=this._n.Ut.top,n=this._n.Ut.bottom,10*Math.abs(e-n)/this._n.It.renderer.domElement.clientHeight/this._n.Ut.zoom))},Xn:function(){this.Sn.Tc&&(this.np(),this.ep(),this.jt(),this.Ft(),this._n.It.Ln(),this._n.It.Wt())},$o:function(){this._n.It.$o()},On:function(){this._n.It.On()},ip:function(t,n){var e,i,r;return!t.getBound||!n||!(t=t.boundNoClone)||(e=!0,i=t.max,t=t.min,r=n.max,n=n.min,!(i.x<n.x||t.x>r.x||i.y<n.y||t.y>r.y)&&e)},rp:function(t,n){for(var e=[],i=[],r=this.Oi.container.clientWidth,o=this.Oi.container.clientHeight,s=(e.push(pr.coordsScreenToMap(this._n,{x:0,y:0,level:n,buildingID:t.yi})),e.push(pr.coordsScreenToMap(this._n,{x:r,y:0,level:n,buildingID:t.yi})),e.push(pr.coordsScreenToMap(this._n,{x:r,y:o,level:n,buildingID:t.yi})),e.push(pr.coordsScreenToMap(this._n,{x:0,y:o,level:n,buildingID:t.yi})),t.visibleLevels),a=new Ii,u=0;u<s.length;u++){var c=t.getFloor(s[u]).getBound();a.Qt([c.max,c.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});r=[],vm.PolygonClip(e,i,r),o=new fm;return o.setFromPoints(r),o},qc:function(t,n,e,i){var r=t.gi,o=t.getBound(),s=new Up,a=r[0];if(0<a.length){s.moveTo(a[0].x-o.center.x,a[0].y-o.center.y);for(var u=1;u<a.length;u++)s.lineTo(a[u].x-o.center.x,a[u].y-o.center.y)}if(1<r.length)for(var c=1;c<r.length;c++){var h=r[c],f=new kp;if(0<h.length){f.moveTo(h[0].x-o.center.x,h[0].y-o.center.y);for(var l=1;l<h.length;l++)f.lineTo(h[l].x-o.center.x,h[l].y-o.center.y)}s.holes.push(f)}for(var d,v,p,m=null,m=0===n?new om(s):new am(s,{depth:n,bevelEnabled:!1}),y=i?(d=e.min.x,v=e.min.y,p=e.max.x-d,e.max.y-v):(d=o.min.x,v=o.min.y,p=o.max.x-d,o.max.y-v),b=m.faces,g=b.length,_=0;_<g;_++){var w=m.vertices[b[_].a],x=m.vertices[b[_].b],E=m.vertices[b[_].c];m.faceVertexUvs[0][_][0].x=(w.x+o.center.x-d)/p,m.faceVertexUvs[0][_][0].y=(w.y+o.center.y-v)/y,m.faceVertexUvs[0][_][1].x=(x.x+o.center.x-d)/p,m.faceVertexUvs[0][_][1].y=(x.y+o.center.y-v)/y,m.faceVertexUvs[0][_][2].x=(E.x+o.center.x-d)/p,m.faceVertexUvs[0][_][2].y=(E.y+o.center.y-v)/y}return m.computeBoundingSphere(),{geometry:m,shape:s}},Rh:function(e){var i=this,r=this.Sn.vr(e.bid);r.themeNeedLoad=!0,r.themeLoaded=!1,this.op({themeID:e.themeID},function(t){r.themeID=e.themeID;var n=i.lc.get(e.bid);n||(i.lc.set(e.bid,{theme:new C0}),n=i.lc.get(e.bid)),n.theme.ec(t),r.themeLoaded=!0,e.bid===i.Oi.buildingID&&(i.Sn.U0(i.pf),i._n.setBackgroundColor(i.Sn.backgroundColor,i.Sn.backgroundAlpha)),i.sp()})},Nh:function(t){var n=this.lc.get(t.bid);t.data?(n||(this.lc.set(t.bid,{themeExtension:new xm}),n=this.lc.get(t.bid)),n.themeExtension||(n.themeExtension=new xm),n.themeExtension.ec(t.data)):n&&n.themeExtension&&(this.Oi.buildingID===t.bid?n.themeExtension.resize():(n.themeExtension.Yn(),n.themeExtension=null)),this.Sn.U0(this.pf),this._n.setBackgroundColor(this.Sn.backgroundColor,this.Sn.backgroundAlpha),!1!==t.needUpdataNode&&this.ap(t)},Yn:function(t){var n=this;this._n.off("visibleLevelsLoaded",this.Zv),this._n.off("loaded",this.Zv),this._n.off("viewChanged",this.Zv),this._n.off("viewModeChanged",this.Zv),this._n.off("buildingEntered",this.Zv),this._n.off("zoom",this.Zv),this._n.off("move",this.Zv),this._n.off("buildingLoaded",this.Zv),this._n.off("beforeRender",this.Xn),this.La=t,this.io.Yn(function(){n.io=null,n.Ra.ba(!0)})},Uo:function(){for(var t in this.Nt=[],this.y0.Yn(),this.y0=null,this.lc.clear(),this._n=null,this)this[""+t]&&this[""+t].Yn&&this[""+t].Yn();for(var n in this.La&&this.La({name:"NodeManager"}),this)this[""+n]=null,delete this[""+n]}}),Object.assign(gw.prototype,{_0:function(t,n,e){var i=this.Sn.vr(this._n.An.yi).themeID,r=this.Oi,o=this.lc.get(this.Oi.buildingID).theme,s="";if(s=e===this.Oi.buildingID?r.userThemeURL?r.userThemeURL+i:r.themeURL+i:(e=(e=this.lc.get(e))&&e.theme?e.theme.themeID:i,r.userThemeURL?r.userThemeURL+e:r.themeURL+e),r.isPreview)return i=r.themeURL,"path"===n?("1"===t.isuser?i+=o.userPath+"/":i+=o.sysPath+"/",i):"logoPath"===n?i+(o.logoPath+"/"):"model"===n?("1"===t.isuser?i+=o.userModelPath+"/":i+=o.sysModelPath+"/",i):void 0;if("model"===n){if(r.externalModelURL)return r.externalModelURL+"models/";if(r.userThemeURL)return s+"/models/"}return s+"/"},ah:function(){var n;this.Sn.cp||this.Sn.ns&&0===this.Nt.length&&(n=!0,this.y0.an.forEach(function(t){t.loadComplete||(n=!1)}),n)&&(this.Sn.cp=!0,this._n.kt.Dt({type:"externalFirstLoaded"}))},hp:function(t,o){var s=this;if(this.Oi.tile&&!this.Oi.preLoad){for(var a=[],u=t.building,n=0;n<u.visibleLevels.length;n++){var e=u.getFloor(u.visibleLevels[n]);e&&0===this.fp(e)&&(this.lp(e)?(e.Hv(),this.dp(e)):a.push(u.visibleLevels[n]))}0<a.length?((t=e1(u,this)).buildings=null,this._n.Ir.Na(t,function(t,n){if("floor"===t){var e=s.Sn.vp(u.yi);if(e.set(n.gid,!0),-1<a.indexOf(n.gid)){for(var t=u.getFloor(n.gid),i=(s.pp(t),!0),r=0;r<a.length;r++)if(!e.get(a[r])){i=!1;break}i&&o&&o()}}})):o&&o()}else o&&o()},mp:function(t){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},e=this.Sn.vr(t),i=e.themeExtension||n.themeExtension,r=e.themeID||n.themeID;r&&t?(this.lc.set(t,{theme:new C0}),e.themeLoaded=!1,e.themeNeedLoad=!0,this.Sc({bid:t,themeID:r,themeExtension:i,contentVersion:n.contentVersion})):(e.themeLoaded=!0,e.themeNeedLoad=!1)},yp:function(c){var h=this,t=(c=c||[],this._n.Oi.buildingOptions),f=t.buildings||t.themeID,l=null;(function t(){var n=h._n.getBuildings();if(!1===h._n.Ec)l=setTimeout(t,1);else{null!==l&&clearTimeout(l);var e=[];if(0<c.length)for(var i=0;i<c.length;i++){var r=c[i].bcode,r=h.bp(r);h.mp(r,c[i]),e.push(r)}if(f)for(var o=0;o<n.length;o++){var s=n[o].buildingID;e.includes(s)||h.mp(s)}if(e.length!==n.length)for(var a=0;a<n.length;a++){var u=n[a].buildingID;e.includes(u)||((u=h.Sn.vr(u)).themeLoaded=!0,u.themeNeedLoad=!1)}}})()},Sc:function(e){var i=this;this.op(e,function(t){var n=i.lc.get(e.bid);n.theme.ec(t),n.theme.themeID=e.themeID,e.themeExtension&&(n.themeExtension=new xm,n.themeExtension.ec(e.themeExtension)),i.Sn.vr(e.bid).themeLoaded=!0,e.bid===i.Oi.buildingID&&(i.Sn.U0(i.pf),i._n.setBackgroundColor(i.Sn.backgroundColor,i.Sn.backgroundAlpha),i.Oi.isPreview?i.pf.xc(i._n):i.yp(t.buildings)),i.Sn.Tc=i.Ac(),(i.Sn.gp||i.Sn._p)&&(i.Vn(null,null,i.Sn.gp,!1,i.Sn._p,i.Sn.Tc),i.Sn.gp)&&(i.Sn.gp=!1)})},op:function(t,n){var e,i=this;t.theme?n(t.theme):(e="_loadTheme"+St.generateUUID(),this.Ra.ga(e),Mm.us(this.Oi.themeURL,t.themeID,function(t){n&&n(t),i.Ra._a(e)},function(t){i._n.kt.Dt({type:"info",InfoMode:t}),i.Ra._a(e)},t.contentVersion))},wp:function(t){var n,e=this.Sn.vr(t.yi);e.buildingLoaded||(this.Oi.tile?this.Ko(t)?((n=e1(t,this)).buildings=null,n.isOutdoor=!1,this.xp(n)):e.sceneLoaded||this.Oi.tile&&((n=e1(t,this)).buildings=null,n.isOutdoor=!1,this.Ep(n)):((e=Object.assign({},this.Oi)).isOutdoor=!1,e.buildingID=t.wr,e.bid=t.yi,e.buildings=null,this.Sp(e)))},Tp:function(t,n){var e=null,t=this._n.getBuilding(t.bid),n={type:"info",InfoMode:n,buildingID:e=t?t.yi:e};this._n.zi.error.push(n),this._n.kt.Dt(n)},Ap:function(t,n){var e=null;t.buildingID!==t.mapID&&(e=t.bid),this.Mp({bid:t.bid,levels:n.levels}),this._n.kt.Dt({type:"sceneLoaded",buildingID:e}),this._n.kt.Dt({type:"info",InfoMode:mr.INFO,mapID:n.mid,buildingID:e})},Sp:function(c){var h=this;this._n.Ir.Pa(c,function(t,s){var n;if(!(0<h._n.zi.error.length))if("complete"===t)if(c.isOutdoor){var e=h.Op(s);if(!(0<h._n.zi.error.length)){var i=h.Sn.vr(e.yi);if(i.buildingLoaded=!0,!(i.sceneLoaded=!0)!==h.Lp(s,!0))for(var r=h.Sn.vp(e.yi),o=0;o<e.Ar.length;o++){var a=s.Lt.get(e.Ar[o]),u=(r.set(a.gid,!0),h.ia(e,a,e.Ar[o]));h.pp(u),h.Rp(e,a.gid)}}}else h._n.Lt.forEach(function(t){if(t.wr===s.mid){t.Ar=s.levels,t.Or=new It(new Tt(s.minX,s.minY),new Tt(s.maxX,s.maxY));for(var n=h.Sn.vr(t.yi),e=(n.buildingLoaded=!0,n.sceneLoaded=!0,h.Sn.vp(t.yi)),i=0;i<s.levels.length;i++){var r=s.Lt.get(s.levels[i]),o=(e.set(r.gid,!0),h.ia(t,r,s.levels[i]));h.pp(o),h.Rp(t,r.gid)}}});else"decode"===t?(i=null,(n=h._n.getBuilding(c.bid))&&(i=n.yi),h.Mp({bid:void 0!==c.bid?c.bid:c.buildingID,levels:s.scene.levels}),h._n.kt.Dt({type:"sceneLoaded",buildingID:i}),h._n.kt.Dt({type:"info",InfoMode:mr.INFO,mapID:s.scene.mid,buildingID:i})):"error"===t&&h.Tp(c,s)})},Lp:function(t,n){if(t.buildings)for(var e=0;e<t.buildings.length;e++){var i=this.Np(t.buildings[e]);if(0<this._n.zi.error.length&&n)return!1;this.wp(i)}return t.buildings&&0!==t.buildings.length&&t.buildings.length!==this._n.Lt.length-1||(this._n.Ec=!0),!0},Pp:function(t,n){for(var e=0;e<t.Ar.length;e++){var i=n.Lt.get(t.Ar[e]);this.ia(t,i,t.Ar[e])}},xp:function(o){var s=this;this._n.Ir.Na(o,function(t,n){var e,i,r;0<s._n.zi.error.length||("building"===t&&(e=null,r=(i=s.Sn.vr(o.bid)).sceneLoaded,i.buildingLoaded=!0,i.sceneLoaded=!0,o.buildingID===o.mapID?(e=s.Op(n),s.Lp(n,!1)):(e=s._n.getBuilding(o.bid),r||(e.Ar=n.levels,e.Or=new It(new Tt(n.minX,n.minY),new Tt(n.maxX,n.maxY)))),r||s.Pp(e,n)),"scene"===t&&s.Ap(o,n),"floor"===t&&(i=s._n.getBuilding(o.bid),s.Sn.vp(i.yi).set(n.gid,!0),(r=i.getFloor(n.gid)).G=n,s.pp(r),s.Rp(i,n.gid)),"error"===t&&s.Tp(o,n))})},Ep:function(r){var o=this,e=null;this._n.Ir.Cs(r,function(t,n){"building"===t?((e=o._n.getBuilding(r.bid)).Ar=n.levels,e.Or=new It(new Tt(n.minX,n.minY),new Tt(n.maxX,n.maxY)),o.Sn.vr(e.yi).sceneLoaded=!0,o.Pp(e,n),o.Rp(e,void 0)):"scene"===t&&o.Ap(r,n)},function(t,n){var e=null,i=o._n.getBuilding(r.bid);i&&(e=i.yi),o._n.kt.Dt({type:"info",InfoMode:n,buildingID:e})})},Lh:function(t){this.wp(t)},Rp:function(t,n){var e=this.Sn.vr(t.yi),i=e.loaded,r=e.visibleLevelsLoaded;this.Fp(t),!r&&e.visibleLevelsLoaded&&(this.Sn.gp&&this.Sn.Tc?(this.Vn(null,n,!0,!0,!1,this.Sn.Tc),this.Sn.gp=!1):this.Vn(null,n,!1,!0,!1,this.Sn.Tc),r={type:"visibleLevelsLoaded"},t!==this._n.An&&(r.buildingID=t.yi),this._n.kt.Dt(r)),!i&&e.loaded&&(t!==this._n.An?this._n.kt.Dt({type:"buildingLoaded",buildingID:t.yi}):this._n.kt.Dt({type:"mapLoaded"})),this.Sn._p&&this.Sn.Tc&&this.Vn(null,n,!1,!1,!0,this.Sn.Tc)},Ac:function(){for(var t=!0,n=0;n<this._n.Lt.length;n++){var e=this._n.Lt[n];if(e.constructor===n1){if(this.Ko(e)&&!this.Sn.Ac(e.yi)){t=!1;break}}else if(!this.Sn.Ac(e.yi)){t=!1;break}}return t}}),Fw=gw,Object.assign(Fw.prototype,{jp:function(t){var t=this.map.getBuilding(t);return null===t?-1:(t=t.bounds,Math.sqrt((t.maxX-t.minX)*(t.maxX-t.minX)+(t.maxY-t.minY)*(t.maxY-t.minY)))},$v:function(t){var t=this._n.getBuilding(t.bid),n=!0;this.Ko(t)&&(this.Lh(t),n=!1),t.Sh&&(t.Sh.show=n),this.On(),this._n.enableUpdateNode()},Ip:function(t){var n,e=this;return!(this.Ko(t)||(t=t.getFloor(t.level))&&null!=(t=t.getLayers(E.EXTENT_LAYER)[0])&&(n=!1,t&&t.traverse(function(t){n=!E1.isContain(t.coordinates[0],e._n.Cp())}),!n))},Ko:function(t){return!1!==t.visible&&(t.overviewMode===Om.INDOOR||(t.overviewMode!==Om.OUTDOOR||this.Sn.En===t.buildingID)&&(this.Sn.En!==this._n.Oi.buildingID?this.Sn.En===t.yi:t===this._n.An||!!this._n.Dp(t)&&!!this._n.kp()))},Op:function(t){var n=new v1({bid:this.Oi.buildingID,mid:this.Oi.mapID,height:t.height,scaleLevel:t.scaleLevel,name:t.mname,levels:t.levels,x:t.x,y:t.y,bounds:new It(new Tt(t.minX,t.minY),new Tt(t.maxX,t.maxY))});return this._n.Ki(n),this._n.An=n,this._n.xt=t.x,this._n.Et=t.y,n},Np:function(t){var n=this.Sn.vr(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._n.An.visibleLevels.length;r++)t.levelChart[i]===this._n.An.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._n.An.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].gi,c=t.floors[a].gid;s.set(c,u)}var h=new n1(t);return n.minLevel&&(h._h=n.minLevel),n.maxLevel&&(h.wh=n.maxLevel),h.mh=n.overviewMode,h.Up=s,this._n.Ki(h),h},bp:function(t){for(var n=null,e=this._n.getBuildings(),i=0;i<e.length;i++)if(""+e[i].bcode==""+t){n=e[i].buildingID;break}return n}}),Object.assign(Fw.prototype,{Bp:function(){var n=this;this._n.traverse(function(t){t.traverse(function(t){t=t.getLayers(E.LABEL_LAYER)[0];t&&t.traverse(function(t){n.Sn.F0===i1.FID?t.text=t.G.fid:n.Sn.F0===i1.ENAME?t.text=t.G.ename:t.text=t.G.name})})})},Ch:function(t){var n=0,n=this._n.Ut.isPerspectiveCamera?t/(this._n.It.renderer.domElement.clientHeight/(2*Math.tan(this._n.Ut.fov*u.DEG2RAD/2))):t*Math.abs(this._n.Ut.top-this._n.Ut.bottom)/this._n.Ut.zoom/this._n.It.renderer.domElement.clientHeight;return n=isNaN(n)?1:n},Gp:function(t,n){var e;return this._n.Ut.isPerspectiveCamera?(e=new At,t.updateMatrixWorld(),this._n.Mn.updateMatrixWorld(),e.multiplyMatrices(this._n.Mn.matrixWorldInverse,t.matrixWorld),t=(new Tt).applyMatrix4(e),this.Ch(n)*Math.abs(t.z)):this.Ch(n)}}),Object.assign(Fw.prototype,{ap:function(t){var n=this;null!==this.Qv&&(clearTimeout(this.Qv),this.Qv=null),this.Qv=setTimeout(function(){n.sp({changeScopeTypes:t.changeScopeTypes,fids:t.fids})},t.time||0)},sp:function(){function e(){if(o.length<=0)i._n.off("update",e);else{for(var t=0,n=0;n<o.length&&!(20<++t);n++)o[n].mf(i,i.pf),o.splice(n,1),n--;i._n.enableUpdateRender()}}var i=this,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},n=t.changeScopeTypes,r=t.fids,n=n||[E.EXTENT,E.MODEL,E.LABEL,E.FACILITY,E.EXTERNAL_MODEL],r=r||[],o=[];this._n.off("update",e),this._n.traverse(function(t){t.traverse(function(t){t.parent.visibleLevels.includes(t.level)&&t.traverse(function(t){t.traverse(function(t){(!(0<r.length)||r.includes(t.FID))&&n.includes(t.type)&&t.visible&&t.mf&&t.Rt&&o.push(t)})})})}),this._n.on("update",e)},lf:function(t,n){t.Rt&&((!t.Sh||t.Sh.visible)&&t.$t?t.Rt.visible=t.G.maxlevel&&n>=t.G.minlevel&&n<t.G.maxlevel:t.Rt.visible=!1)},Hp:function(){this.lc.set(this.Oi.buildingID,{theme:new C0});var t=this.Sn.vr(this.Oi.buildingID);t.themeNeedLoad=!0,t.themeLoaded=!1,this.Sc({bid:this.Oi.buildingID,themeID:this.Oi.themeID,theme:this.Oi.df,themeExtension:this.Oi.themeExtension}),this.Oi.tile?((t=Object.assign({},this.Oi,{level:t.level,visibleLevels:t.visibleLevels})).bid=t.buildingID,this.xp(t)):this.Sp(this.Oi)},jt:function(){if(this.Sn.Kv&&this.tn&&(st.a.environment!==B.a.WX||1!=this._n.It.Ri||this._n.It.So%2==0)){this.Nt=[];for(var t=this._n.getZoom(),n=this.Oi.tile&&!this.Oi.preLoad,e=0;e<this._n.Lt.length;e++)for(var i=this._n.Lt[e],r=this.Ip(i),o=0;o<i.Lt.length;o++){for(var s=i.Lt[o],a=null,u=-1<i.visibleLevels.indexOf(s.level),c=(u&&!r&&(a=this.rp(i,s.level),0===this.fp(s))&&this.lp(s)&&(s.Hv(),this.dp(s),this.On()),[]),h=0;h<s.Lt.length;h++){var f=s.Lt[h];if(!u||r&&n)this.Xp(f)&&n&&c.push(f);else for(var l=0;l<f.Lt.length;l++){var d=f.Lt[l],v=!0;r||!d.visible||d.Sh&&!d.Sh.visible?v=!1:d.G&&d.G.maxlevel&&(t>=d.G.maxlevel||t<d.G.minlevel)?(v=!1)===d.canDispose&&(v=!0):this.ip(d,a)||(v=!1),!d.Rt&&v&&this.Nt.push([e,d]),!d.Rt||v||d.fading||d.Nn&&d.Nn()}}for(var p=0;p<c.length;p++)s.remove(c[p]),c[p].dispose()}this.Sn.Kv=!1,this._n.enableUpdateRender()}},Xp:function(t){var n=E.EXTENT_LAYER|E.FACILITY_LAYER|E.LABEL_LAYER|E.MODEL_LAYER|E.EXTERNAL_MODEL_LAYER;return 0!=(t.bi&n)},Ft:function(){if(0<this.Nt.length){for(var t=!1,n=0,e=0;e<this.Nt.length&&!(20<++n);e++){var i=this.Nt[e][1];i.bi!==E.FACILITY&&i.bi!==E.LABEL||(t=!0),i.ec(),this.Nt.splice(e,1),e--}t&&this.$o(),this.ah(),this._n.enableUpdateRender(),this.Sn.ts&&0===this.Nt.length&&!this.Yv&&(this._n.kt.Dt({type:"firstViewLoaded"}),this.Yv=!0)}!this.Yv&&this.ts&&0===this.Nt.length&&(this._n.kt.Dt({type:"firstViewLoaded"}),this.Yv=!0)},wv:function(t,n){var e=this._n.getMapOptions().hideList,i=n.typeID,n=n.FID,e=e[t];return void 0===e||(t=e.typeIDs,void 0===(e=e.FIDs)&&(e=[]),!(t=void 0===t?[]:t).includes(i)&&!e.includes(n))},dp:function(t){var i=this;t.jn.yi===this.Oi.buildingID&&t.traverse(function(t){t.type!==E.MODEL_LAYER&&t.type!==E.EXTERNAL_MODEL_LAYER&&t.type!==E.LABEL_LAYER||t.traverse(function(e){i._n.traverse(function(t){if(t!==i._n.An)for(var n=0;n<t.Eh.length;n++)t.Eh[n]===e.FID&&(t.Sh.setFacadeNode(e),e.Sh=t.Sh)})})})}}),Object.assign(gw.prototype,{gv:function(t){t=this._n.getMapOptions().hideList[t];return void 0===t||0!==Object.keys(t).length},Mp:function(n){var t=this.Sn.vr(n.bid),e=[];t.visibleLevels.forEach(function(t){-1<n.levels.indexOf(t)&&e.push(t)}),t.visibleLevels=e},Vp:function(t,n){function e(){i._n.It.On(),n.finish&&n.finish()}var i=this,r=(n=n||{},this.Sn.vr(t.yi));"animate"in n&&!n.animate?(t.traverse(function(t){t.Lr({animate:!1})}),e()):t.traverse(function(t){t.Rr===r.level?t.Lr({finish:function(){e()}}):t.Lr({})})},Bi:function(t,n){t=this._n.getBuilding(t);return t?t.getFloor(n):null},zp:function(t){t=this._n.getBuilding(t);return null!==t?t.Lt:[]},Fr:function(n,e){var i=this;n.levels.sort(),this.Sn.vr(n.building.yi).visibleLevels=n.levels,this.Mp({bid:n.building.yi,levels:n.building.Ar}),this.hp(n,function(){i.On(),i._n.It.Xt();var t={type:"visibleLevelsLoaded"};n.building!==i._n.An&&(t.buildingID=n.building.yi),i._n.kt.Dt(t),e&&e()})},Pr:function(n,e){var i=this,r=(this._n.tp(),this.Sn.vr(n.yi));r.targetLevel=e.level,-1<r.visibleLevels.indexOf(e.level)?this._n.Ht.dr(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._n.Ht.dr(n,e):(t={type:"levelChanged",level:e.level},n!==i._n.An&&(t.buildingID=n.yi),i._n.kt.Dt(t),e.finish&&e.finish())}))},lp:function(t){var n=!1;return t.G.Lt.forEach(function(t){0<t.Lt.size&&(n=!0)}),n},fp:function(t){var n=this,e=0;return t.traverse(function(t){n.Xp(t)&&e++}),e},Fp:function(t){var n=this.Sn.vr(t.yi),e=this.Sn.vp(t.yi);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.Oi.tile&&!this.Oi.preLoad?n.loaded=n.visibleLevelsLoaded:e.size===t.Ar.length&&(n.loaded=!0),this.Wp()},Wp:function(){var e,i,r=this,o=!0;this._n.traverse(function(t){var n=r.Sn.vr(t.yi);n.visibleLevelsLoaded||(t.constructor===n1?r.Ko(t)&&!n.visibleLevelsLoaded&&(o=!1):n.visibleLevelsLoaded||(o=!1))}),!this.Sn.ns&&o&&(this.Sn.gp=!0),this.Sn.ns=o,this.Sn.ts||(i=e=!0,this._n.traverse(function(t){var n=r.Sn.vr(t.yi);n.sceneLoaded||(e=!1),(!r.Ko(t)||n.loaded)&&e||(i=!1)}),!this.Sn.ts&&i&&(this.Sn._p=!0),this.Sn.ts=i)},pr:function(){this.Sn.Yp=!0},np:function(){var i=this;this.Sn.Yp&&(this.zv=[],this._n.traverse(function(e){for(var t=0;t<e.Lt.length;t++)!function(n){var t=e.Lt[n];t.jv(),t.Pv&&t.traverse(function(t){t.traverse(function(t){t.type!==E.EXTENT&&t.type!==E.FACILITY&&t.type!==E.LABEL&&t.type!==E.MODEL&&t.type!==E.EXTERNAL_MODEL&&t.type!==E.TEXT_MARKER&&t.type!==E.DOM_MARKER&&t.type!==E.EXTRUDE_MARKER&&t.type!==E.IMAGE_MARKER&&t.type!==E.POLYGON_MARKER&&t.type!==E.DYNAMIC_MODEL_MARKER||t.Rt&&i.zv.push([n,t])})}),t.Pv=!1}(t)}),this.Sn.Yp=!1)},ep:function(){if(0<this.zv.length){for(var t=0,n=0;n<this.zv.length&&!(++t>this.Oi.maxMaterialCount);n++){var e=this.zv[n][1];e.update?e.update():e.yf(),this.zv.splice(n,1),n--}this._n.enableUpdateRender()}},ia:function(t,n,e){n=new v({mapOptions:this.Oi,states:this.Sn,data:n,key:e});return t.Ki(n),n.jv(),n.Cv(),n},pp:function(t){t.Hv(),t.Gv(),this.dp(t)},Qp:function(t,n){for(var e=!0,i=0;i<t.length;i++)if(t[i]===n){e=!1;break}return e},Zp: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.Qp(i,e[o])&&i.push(e[o]);return i}}),gw);function U2(t){return(U2="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 B2(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,function(t){t=function(t,n){if("object"!=U2(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=U2(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==U2(t)?t:t+""}(i.key),i)}}function G2(t,n,e){return n&&B2(t.prototype,n),e&&B2(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}var Bw=G2(function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");this.Lt=new Map,this.qp=[],this.ne=(new Date).getTime(),this.Kp=new Map,this.La=null,this.Uo=this.Uo.bind(this),this.Bo=0,this.jo()}),H2=(Object.assign(Bw.prototype,{Ki:function(t){if(Array.isArray(t)){this.Lt.set(t[0].zn,t[0]),t[0].jn=this;for(var n=1;n<t.length;n++)t[n].Cn=t[n-1].Cn+t[n-1].Un,t[n].Dn=t[n-1].Dn+t[n-1].Un,this.Lt.set(t[n].zn,t[n]),t[n].jn=this}else this.Lt.has(t.zn)||(this.Lt.set(t.zn,t),t.jn=this,t.Cn=this.ne)},tr:function(t){if(Array.isArray(t))for(var n=0;n<t.length;n++)this.Lt.delete(t[n].zn);else this.Lt.delete(t.zn)},S0:function(t){this.qp.push(t)},R0:function(t){t=this.qp.indexOf(t);-1<t&&this.qp.splice(t,1)},Id:function(t){this.Kp.set(t.zn=Lr.generateUUID(),t)},Cd:function(t){this.Kp.delete(t.zn)},Xn:function(t,n,e){for(var i=[],r=[],o=0;o<t.Pn.length;o++)void 0===t.In[o]&&(t.In[o]=0),1<=n?(i.push(t.Fn[o]),r.push(t.Fn[o]-t.Pn[o]-t.In[o])):(i.push((t.Fn[o]-t.Pn[o])*n+t.Pn[o]),r.push((t.Fn[o]-t.Pn[o])*e),t.In[o]+=(t.Fn[o]-t.Pn[o])*e);t.Xn({destination:i,delta:r}),r.length=i.length=0},jo:function(){var i=this,r=(this.Bo=st.a.window.requestAnimationFrame(this.jo.bind(this)),(new Date).getTime()),o=r-this.ne;this.Kp.forEach(function(t){return t(o)});for(var t=0;t<this.qp.length;t++)this.qp[t].update(o/1e3);this.Lt.forEach(function(t){var n,e;t.Hn||(t.Gn?t.kn+=o:(n=(r-t.Cn)/t.Un,e=o/t.Un,i.Xn(t,n,e),n=r-t.Cn-t.Dn,t.Un<=n&&(t.In=[],t.Bn?(t.Cn=r,t.Vn&&t.Vn()):(e=t.Hn,t.Hn=!0,!e&&t.Vn&&t.Vn()))))}),this.ne=r,this.La&&0===this.Lt.size&&this.Uo()},Yn:function(t){this.La=t},Uo:function(){this.Bo&&(st.a.window.cancelAnimationFrame(this.Bo),this.Bo=0),this.Lt.forEach(function(t){t.Yn()}),this.Lt.clear(),this.qp=[],this.Kp.clear(),this.La&&this.La({name:"Animator"})}}),Bw);function X2(t){return(X2="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 V2(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,function(t){t=function(t,n){if("object"!=X2(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=X2(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==X2(t)?t:t+""}(i.key),i)}}function z2(t,n,e){return n&&V2(t.prototype,n),e&&V2(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}var Yw=z2(function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");this._t={}}),W2=(Object.assign(Yw.prototype,{Jp:function(t,n){this.$p(t,n)||(void 0===this._t[t]&&(this._t[t]=[]),this._t[t].push(n))},$p:function(t,n){return n?void 0!==this._t[t]&&-1!==this._t[t].indexOf(n):void 0!==this._t[t]&&0<this._t[t].length},tm:function(t,n){void 0!==this._t[t]&&-1!==(n=this._t[t].indexOf(n))&&this._t[t].splice(n,1)},Dt:function(t){if(void 0!==this._t[t.type])for(var n=this._t[t.type].slice(0),e=0,i=n.length;e<i;e++)n[e].call(this,t)}}),Yw),e={Entire:2,Individual:4},Y2=(Object.freeze(e),e),Q2={RUNTIME:0,DIRTY:1};function Z2(t){return(Z2="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 q2(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,function(t){t=function(t,n){if("object"!=Z2(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Z2(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Z2(t)?t:t+""}(i.key),i)}}function K2(t,n,e){return n&&q2(t.prototype,n),e&&q2(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}var J2=K2(function t(n){var e;if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");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.themeTool=void 0!==n.themeTool?n.themeTool:null,this.merge=void 0!==n.merge?n.merge:null,this.userThemeURL=n.themeURL,this.themeURL=n.themeURL||pf.themeUrl,this.themeID=n.themeID||"2001",this.externalModelURL=n.externalModelURL,this.df=n.theme,this.themeExtension=void 0!==n.themeExtension?n.themeExtension:{},this.isPreview=void 0!==st.a.KjWzhWlSj&&!!st.a.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:Si.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.tc=n.highlightColor,this.Yr=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||[E.EXTENT,E.EXTERNAL_MODEL,E.MODEL,E.DYNAMIC_MODEL_MARKER,E.EXTRUDE_MARKER,E.TUBE_MARKER,E.WALL_MARKER,E.SPHERE_MARKER,E.POLYGON_MARKER,E.HEAT_MAP_MARKER,E.LINE3D_MARKER,E.LINE_MARKER,E.FACILITY,E.LABEL,E.IMAGE_MARKER,E.TEXT_MARKER,E.LOCATION_MARKER],this.collisionOrder=n.collisionOrder?_r.uniqWithArrayTwo(n.collisionOrder):[[E.TEXT_MARKER,E.IMAGE_MARKER]],this.fontFamily=n.fontFamily||'"Microsoft Yahei","微软雅黑",Tahoma,Arial',this.hdr=n.hdr,this.shadingMode=void 0!==n.shadingMode?n.shadingMode:ds.REAL,this.materialMode=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:i1.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}]},this.isuserLight=!1,void 0!==n.light&&(this.lightConfig=n.light.getConfig(),this.isuserLight=!0),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:Y2.Entire,this.autoPlay=void 0===n.autoPlay||n.autoPlay,this.decoderURL=void 0!==n.decoderURL?n.decoderURL:null,this.HDText=void 0!==n.HDText&&n.HDText,this.depthPeeling=void 0!==n.depthPeeling?n.depthPeeling:null,this.depthPeeling&&(this.depthPeeling.mode=(null==(e=n.depthPeeling)?void 0:e.mode)||Q2.RUNTIME,this.depthPeeling.layers=(null==(e=n.depthPeeling)?void 0:e.layers)||4,this.depthPeeling.types=(null==(e=n.depthPeeling)?void 0:e.types)||[E.MODEL_LAYER,E.EXTERNAL_MODEL_LAYER,E.DYNAMIC_MODEL_MARKER]),this.mouseMode=void 0!==n.mouseMode?n.mouseMode:qo.NORMAL});function $2(t){return($2="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,function(t){t=function(t,n){if("object"!=$2(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=$2(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==$2(t)?t:t+""}(i.key),i)}}function nx(t){a.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)})})}function ex(){function a(t,n,e){var i,r;t instanceof nx&&(t.onBeforeRender(h,n,e),f.setFromMatrixPosition(t.matrixWorld),f.applyMatrix4(l),i=t.element,r="translate(-50%,-50%) translate("+(f.x*u+u)+"px,"+(-f.y*c+c)+"px)",i.style.WebkitTransform=r,i.style.MozTransform=r,i.style.oTransform=r,i.style.transform=r,i.style.display=t.visible&&-1<=f.z&&f.z<=1?"":"none",r={distanceToCameraSquared:p(e,t)},d.objects.set(t,r),i.parentNode!==v&&v.appendChild(i),t.onAfterRender(h,n,e));for(var o=0,s=t.children.length;o<s;o++)a(t.children[o],n,e)}var e,i,u,c,r,o,h=this,f=new Tt,s=new At,l=new At,d={objects:new WeakMap},v=document.createElement("div"),p=(v.style.overflow="hidden",this.domElement=v,this.getSize=function(){return{width:e,height:i}},this.setSize=function(t,n){u=(e=t)/2,c=(i=n)/2,v.style.width=t+"px",v.style.height=n+"px"},r=new Tt,o=new Tt,function(t,n){return r.setFromMatrixPosition(t.matrixWorld),o.setFromMatrixPosition(n.matrixWorld),r.distanceToSquared(o)});this.render=function(t,n){!0===t.autoUpdate&&t.updateMatrixWorld(),null===n.parent&&n.updateMatrixWorld(),s.copy(n.matrixWorldInverse),l.multiplyMatrices(n.projectionMatrix,s),a(t,t,n)}}var ev=function(){function n(t){if(!(this instanceof n))throw new TypeError("Cannot call a class as a function");this.Oi=t,this.zoomRange=this.Oi.zoomRange,this.zoom=this.Oi.mapZoom,this.Kt=this.Oi.rotation,this.nm=this.Oi.maxTiltAngle,this.im=this.Oi.minTiltAngle,this.tiltAngle=this.Oi.tiltAngle,this.Ai=this.Oi.viewMode,this.rm=new Map,this.om(),this.Tc=!1,this.ns=!1,this.ts=!1,this._p=!1,this.gp=!1,this.F0=this.Oi.labelField,this.Jt=new Tt,this.sm=this.jh,this.Xr=!1,this.am=!0,this.um=!1,this.tc=void 0!==this.Oi.tc?this.Oi.tc:null,this.hm=null,this.fm=void 0!==this.Oi.backgroundColor?this.Oi.backgroundColor:null,this.lm=null,this.dm=void 0!==this.Oi.backgroundAlpha?this.Oi.backgroundAlpha:null,this.vm=null,this.cp=!1,this.es=!1,this.Kv=!1,this.Yp=!0,this.Jo=this.Oi.collisionOrder,this.En=this.Oi.buildingID}return t=n,(e=[{key:"zoom",get:function(){return this.jh},set:function(t){this.jh=Math.min(Math.max(t,this.$i[0]),this.$i[1])}},{key:"zoomRange",get:function(){return this.$i},set:function(t){t[0]=Math.min(Math.max(t[0],1),29),t[1]=Math.min(Math.max(t[1],1),29),this.$i=t}},{key:"tiltAngle",get:function(){return this.Hi},set:function(t){t=Math.min(Math.max(t,this.im),this.nm),this.Hi=t}},{key:"highlightColor",get:function(){return null!==this.tc?this.tc:this.hm},set:function(t){this.tc=t}},{key:"backgroundColor",get:function(){return null!==this.fm?this.fm:this.lm}},{key:"backgroundAlpha",get:function(){return null!==this.dm?this.dm:this.vm}}])&&tx(t.prototype,e),i&&tx(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,i}(),ix=(Object.assign(ev.prototype,{om:function(){this.pm(this.Oi.buildingID);var t=this.Oi.buildingOptions.buildings;if(t)for(var n=0;n<t.length;n++)t[n].buildingID&&this.pm(t[n].buildingID)},U0:function(t){this.hm=t.wc(this.Oi.buildingID);t=t.dc(this.Oi.buildingID);this.lm=t.clearColor,this.vm=t.clearAlpha},ym:function(t,n){switch(t){case"click":this.am=n;break;case"move":this.um=n;break;case"hover":this.Xr=n}},bm:function(t){this.Oi.center&&(this.Jt.x=this.Oi.center.x-t.x,this.Jt.z=-this.Oi.center.y+t.y)},vr:function(t){return this.rm.has(t)||this.pm(t),this.rm.get(t)},pm:function(t){var n={};if(this.Oi.buildingID===t)n={themeID:this.Oi.themeID,visibleLevels:this.Oi.visibleLevels,level:this.Oi.level,targetLevel:this.Oi.level,floorSpace:this.Oi.floorSpace,nonFocusAlphaMode:this.Oi.nonFocusAlphaMode,nonFocusAlpha:this.Oi.nonFocusAlpha};else{var e=this.Oi.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.Oi).floorSpace,overviewMode:void 0!==e.overviewMode?e.overviewMode:Om.NORMAL,nonFocusAlphaMode:(void 0!==e.nonFocusAlphaMode?e:this.Oi).nonFocusAlphaMode,nonFocusAlpha:(void 0!==e.nonFocusAlpha?e:this.Oi).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.rm.set(t,n)},vp:function(t){t=this.vr(t);return t.levelsLoaded||(t.levelsLoaded=new Map),t.levelsLoaded},Ac:function(t){t=this.rm.get(t);return!1===t.themeNeedLoad||!1!==t.themeLoaded}}),ev);(nx.prototype=Object.create(a.prototype)).constructor=nx;function rx(t){return(rx="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 ox(t,n){var e,i,r,o,s="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(s)return i=!(e=!0),{s:function(){s=s.call(t)},n:function(){var t=s.next();return e=t.done,t},e:function(t){i=!0,r=t},f:function(){try{e||null==s.return||s.return()}finally{if(i)throw r}}};if(Array.isArray(t)||(s=function(t,n){var e;if(t)return"string"==typeof t?sx(t,n):"Map"===(e="Object"===(e=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?sx(t,n):void 0}(t))||n&&t&&"number"==typeof t.length)return s&&(t=s),o=0,{s:n=function(){},n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},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.")}function sx(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 ax(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,function(t){t=function(t,n){if("object"!=rx(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=rx(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==rx(t)?t:t+""}(i.key),i)}}var tv=function(){function n(t){if(!(this instanceof n))throw new TypeError("Cannot call a class as a function");this.jn=t,this.gt=null,this.gm=this.gm.bind(this),this._m=this._m.bind(this),this.Do=new Ps,this.Lt=[]}return t=n,(e=[{key:"add",value:function(t){t.jn=this,(t.kh||t.ec())&&this.R(t),this.needUpdateBound=!0}},{key:"remove",value:function(t){t=this.Lt.indexOf(t);-1<t&&this.Lt.splice(t,1),this.needUpdateBound=!0}},{key:"clear",value:function(){var t,n=ox(this.Lt);try{for(n.s();!(t=n.n()).done;)t.value.dispose()}catch(t){n.e(t)}finally{n.f()}this.Lt.length=0}},{key:"dispose",value:function(){if(null!==this.gt){this.jn.off("resize",this.gm),this.jn.off("beforeRender",this._m);for(var t=0;t<this.Lt.length;t++)this.Lt[t].dispose();this.Lt.length=0,this.Do=void 0,this.gt.domElement.parentNode&&this.gt.domElement.parentNode.removeChild(this.gt.domElement)}}}])&&ax(t.prototype,e),i&&ax(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,i}(),ux=(Object.assign(tv.prototype,{ec:function(){this.gt=new ex,this.gt.setSize(this.jn.getContainer().clientWidth,this.jn.getContainer().clientHeight),this.gt.domElement.style.top="0px",this.gt.domElement.style.left="0px",this.gt.domElement.style.position="absolute",this.gt.domElement.style.pointerEvents="none",this.gt.domElement.style.zIndex=2,this.jn.getContainer().appendChild(this.gt.domElement),this.jn.on("resize",this.gm),this.jn.on("beforeRender",this._m)},_m:function(){for(var t=[],n=Array.from(this.jn.getRenderManager().getRenderList().keys()),e=0;e<this.Lt.length;e++)this.Lt[e].Rt.element.childNodes[0].style.display="none",this.Lt[e].W0();for(var i=0;i<n.length;i++)for(var r=n[i].split("%A%B%C%D"),o=(-1===t.indexOf(r[0])&&t.push(r[0]),r[0]),s=r[1],a=this.jn.getBuilding(""+o),u=0;u<this.Lt.length;u++)this.Lt[u].Z0===o&&""+this.Lt[u].level==""+s&&this.Lt[u].visible&&(this.Lt[u].Rt.element.childNodes[0].style.display="block",this.Lt[u].level===a.level?this.Lt[u].Rt.element.childNodes[0].style.opacity=this.Lt[u].opacity:this.Lt[u].Rt.element.childNodes[0].style.opacity=a.getFloor(this.Lt[u].level).ft);this.Qo(t),this.gt.render(this.Do,this.jn.camera)},gm:function(){this.gt.setSize(this.jn.getContainer().clientWidth,this.jn.getContainer().clientHeight)},Dl:function(t,n){for(var e=this.jn.getBuilding(""+n).visibleLevels,i=!1,r=0;r<e.length;r++)if(e[r]===t){i=!0;break}return i},Qo:function(t){for(var r=this,n=0;n<t.length;n++)for(var e=this.jn.getBuilding(""+t[n]).visibleLevels,i=0;i<e.length;i++){var o=function(t,n){for(var e=[],i=0;i<r.Lt.length;i++)r.Lt[i].Rr===n&&r.Lt[i].Z0===t&&e.push(r.Lt[i]);return e}(t[n],e[i]);if(1<o.length){l=f=h=c=u=a=s=void 0;for(var s=o,a=[],u=0;u<s.length;u++)if(s[u].$t&&s[u].qo){for(var c=!0,h=0;h<a.length;h++){var f=a[h].wm(),l=s[u].wm();if(!(c=!z.xe(l.leftTop,l.rightDown,f.leftTop,f.rightDown)))break}c?(s[u].Rt.element.childNodes[0].style.display="block",s[u].xm=!1,a.push(s[u])):(s[u].Rt.element.childNodes[0].style.display="none",s[u].xm=!0)}}}},R:function(t){this.Lt.push(t),t.Rt&&this.Do.add(t.Rt)}}),tv);function cx(t){return(cx="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 hx(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 fx(i){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?hx(Object(r),!0).forEach(function(t){var n,e;n=i,e=r[t=t],(t=dx(t))in n?Object.defineProperty(n,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):n[t]=e}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(r)):hx(Object(r)).forEach(function(t){Object.defineProperty(i,t,Object.getOwnPropertyDescriptor(r,t))})}return i}function lx(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,dx(i.key),i)}}function dx(t){t=function(t,n){if("object"!=cx(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=cx(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==cx(t)?t:t+""}function vx(t,n,e){n=yx(n);var i=t,n=px()?Reflect.construct(n,e||[],yx(t).constructor):n.apply(t,e);if(n&&("object"===cx(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function px(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(px=function(){return!!t})()}function mx(){return(mx="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,n,e){var i=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=yx(t)););return t}(t,n);if(i)return(i=Object.getOwnPropertyDescriptor(i,n)).get?i.get.call(arguments.length<3?t:e):i.value}).apply(this,arguments)}function yx(t){return(yx=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function bx(t,n){return(bx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var nv=function(){function e(t){var n;if(this instanceof e)return n=vx(this,e),t.uatEnvironment&&(pf={domain:vf,online:vf+"sdk/check",check:vf+"sdk/auth/web",download:vf+"sdk/auth/obtainMapRoute",downloadTile:vf+"sdk/authLayered/obtainMapRoute",collect:vf+"sdk/collect",themeUrl:vf+"webtheme/",externalModelURL:vf+"webmodel/"}),n.zi={error:[]},n.Rn=(new Date).getTime(),n.Oi=new J2(t),n.Sn=new ix(n.Oi),n.xt=null,n.Et=null,st.a.environment===B.a.WX&&st.a.initCanvas(n.Oi,n),n.An=null,n.Ec=!1,n.Em=new Tt,n.mr=null!=t.followFocus&&t.followFocus,n.Sm=null,n.Tm=!1,n.Mo=[E.IMAGE_MARKER,E.TEXT_MARKER],n.kt=new W2,n.nr=new H2,n.Ir=null,n.Pt=null,n.Mn=null,n.Bt=null,st.a.environment==B.a.BROWSER?n.Ut=n.Am(n.Oi.container.clientWidth,n.Oi.container.clientHeight):n.Ut=n.Am(n.Oi.container.width,n.Oi.container.height),n.It=new Dh(n,n.Oi,n.Sn),n.Io=new Z1,(n.Io.jn=n).Ht=new ns(n,n.Oi.container,n.Sn),n.Ht.enableDragRange=n.Oi.enabledPanRange,n.Oi.panRangeValue&&(n.Oi.enabledPanRange=!0,n.Ht.enableDragRange=!0),n.Ur=new Ls(n,n.Oi,n.Sn),n.Uo=n.Uo.bind(n),n.Mm=!1,n.sr=n.sr.bind(n),n.Om=n.Om.bind(n),n.Lm=[],n.Rm=!1,n.Nm=null,n.Pm=null,n.Fm=n.Fm.bind(n),n.rn=new ux(n),n.jm(),sr.onLoad=function(){n.enableUpdateRender()},n;throw new TypeError("Cannot call a class as a function")}var t,n=e,i=ms;if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");return n.prototype=Object.create(i&&i.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),i&&bx(n,i),n=e,(i=[{key:"requestDispose",get:function(){return this.Mm}},{key:"focusBuilding",get:function(){return this.Im}},{key:"x",get:function(){return this.xt}},{key:"y",get:function(){return this.Et}},{key:"bound",get:function(){var n=this;return!0===this.needUpdateBound&&0<this.Lt.length&&(this.ci.reset(),this.Lt.forEach(function(t){n.ci.expand(t.bound)}),this.ci.expand(this.Io.bound),this.needUpdateBound=!1),this.ci.clone()}},{key:"camera",get:function(){return this.Ut},set:function(t){this.Ut=t}},{key:"followFocus",get:function(){return this.mr},set:function(t){this.mr!==t&&(this.mr=t,this.mr||this.Ht.yr(this.An,{level:this.getLevel()}))}},{key:"getScaleBarInfo",value:function(){var t=st.a.environment===B.a.WX?{x:st.a.document.body.clientWidth/2,y:st.a.document.body.clientHeight/2}:{x:document.body.clientWidth/2,y:document.body.clientHeight/2},n={x:t.x+100,y:t.y},t=pr.coordsScreenToMap(this,t),n=pr.coordsScreenToMap(this,n),t=Math.sqrt((t.x-n.x)*(t.x-n.x)+(t.y-n.y)*(t.y-n.y))/100,n=[1e7,5e6,2e6,1e6,5e5,2e5,1e5,5e4,25e3,2e4,1e4,5e3,2e3,1e3,500,200,100,50,20,10,5,2,1,.5,.2,.1,.05,.02,.01][Math.floor(this.getZoom())-1],e="",e=n<1e3&&1<=n?"米":n<1?(n*=1e3,"毫米"):(n/=1e3,"公里");return{screenDistance:n/t,actualDistance:n,unit:e}}},{key:"setDevicePixalRatio",value:function(t){this.getRenderManager().renderer.setPixelRatio(t),this.kt.Dt({type:"pixelRatioChanged"}),this.enableUpdateRender()}},{key:"removeAnimator",value:function(t){this.nr.tr(t)}},{key:"copyCamera",value:function(){var t=null;return(t=this.Ut===this.Mn?new vt(u.FOV,1,u.CAMERA_NEAR,u.CAMERA_FAR):new pt(1,1,1,1,u.CAMERA_NEAR,u.CAMERA_FAR)).copy(this.Ut),t}},{key:"enableUpdateRender",value:function(){this.Sn.es=!0}},{key:"enableUpdateNode",value:function(){this.Sn.Kv=!0}},{key:"getFloorInfos",value:function(){return this.getBuilding(this.Oi.buildingID).getFloorInfos()}},{key:"setHighlightColor",value:function(t){this.Sn.highlightColor=t}},{key:"setControlTarget",value:function(t){this.Ht.Wi(t)}},{key:"resize",value:function(t,n){this.It.ko(t,n)}},{key:"getMarkerGroup",value:function(){return this.Io}},{key:"getVisibleLevels",value:function(){return this.An.visibleLevels}},{key:"setTheme",value:function(t){this.Pt.Rh({themeID:t,bid:this.Oi.buildingID})}},{key:"setThemeExtension",value:function(t,n){this.Pt.Nh(fx({data:t,bid:this.Oi.buildingID},n))}},{key:"clearThemeExtension",value:function(){this.Pt.Nh({bid:this.Oi.buildingID})}},{key:"getRenderOrder",value:function(){return this.It.Mo}},{key:"setRenderOrder",value:function(t){this.It.Vo(t)}},{key:"getCollisionOrder",value:function(){return this.Sn.Jo}},{key:"setCollisionOrder",value:function(t){this.Sn.Jo=_r.uniqWithArrayTwo(t),this.Pt.$o()}},{key:"adjustRenderOrder",value:function(t){this.It.Xo(t)}},{key:"setVisibleLevels",value:function(t,n){this.An.setVisibleLevels(t,n)}},{key:"getRenderManager",value:function(){return this.It}},{key:"setRenderManager",value:function(t){for(var n in this.It.render=t.render,this.It.getLayerType=t.getLayerType,t)this.It[n]=t[n]}},{key:"getCenter",value:function(){return this.Ht.hr()}},{key:"setCenter",value:function(t){this.Ht.lr(t)}},{key:"zoomIn",value:function(){this.Ht.Ji(1.02)}},{key:"zoomOut",value:function(){this.Ht.Ji(.98)}},{key:"getZoomRange",value:function(){return this.Sn.$i}},{key:"setZoomRange",value:function(t){this.Ht.ar(t)}},{key:"getZoom",value:function(){return this.Ht.er()}},{key:"setZoom",value:function(t){this.Ht.rr(t)}},{key:"getRotation",value:function(){return this.Ht.ur()}},{key:"setRotation",value:function(t){this.Ht.cr(t)}},{key:"autoRotate",value:function(t){return(t=t||{}).loop=!0,void 0===t.duration&&(t.duration=5),this.Ht.cr(t)}},{key:"getTilt",value:function(){return Lr.round(90-this.Ht.Gt.getPolarAngle()*u.RAD2DEG)}},{key:"setTilt",value:function(t){t.tilt=St.clamp(t.tilt,this.Oi.minTiltAngle,this.Oi.maxTiltAngle),this.Sn.Hi=t.tilt,this.Ht.Qi(t)}},{key:"getFloor",value:function(t){return null===this.An?null:this.An.getFloor(t)}},{key:"getLevel",value:function(){var t;return null==(t=this.An)?void 0:t.level}},{key:"getLevels",value:function(){return null!==this.An?this.An.Ar:null}},{key:"setLevel",value:function(t){this.Pt.Pr(this.An,t)}},{key:"getFloorSpace",value:function(){return null!==this.An?this.An.floorSpace:null}},{key:"setFloorSpace",value:function(t){this.An.floorSpace=t,this.kt.Dt({type:"floorSpaceChanged"});for(var n=this.Io.Lt,e=0;e<n.length;e++)n[e].W0()}},{key:"getViewMode",value:function(){return this.Ut.isPerspectiveCamera?Si.MODE_3D:Si.MODE_2D}},{key:"setViewMode",value:function(t){this.Ht.Yi(t)}},{key:"getInteractions",value:function(){return this.getInteracations()}},{key:"getInteracations",value:function(){return this.Ht}},{key:"getBound",value:function(){return this.An.bound.clone()}},{key:"getState",value:function(){return{center:this.getCenter(),zoom:this.getZoom(),rotation:this.getRotation(),tiltAngle:this.getTilt(),viewMode:this.getViewMode(),level:this.An.level,floorSpace:this.getFloorSpace(),visibleLevels:this.An.visibleLevels,viewBuildingID:this.Sn.En}}},{key:"setState",value:function(t,n){var e,i=this,r=(n=n||{},this.getState());for(e in r)void 0===t[e]&&(t[e]=r[e]);var o=!1!==n.animate;this.Ht.pauseDamping(),this.setFloorSpace(t.floorSpace),this.setCenter({animate:o,x:t.center.x,y:t.center.y,finish:function(){i.setRotation({animate:o,rotation:t.rotation,finish:function(){i.setTilt({animate:o,tilt:t.tiltAngle,finish:function(){i.setZoom({animate:o,zoom:t.zoom,finish:function(){i.setViewMode({animate:o,mode:t.viewMode,finish:function(){i.setVisibleLevels(t.visibleLevels,function(){i.setLevel({animate:o,level:t.level,finish:function(){i.Ht.resumeDamping(),n.finish&&n.finish()}})})}})}})}})}})}})}},{key:"getNodes",value:function(t,n){var e,s=this,i=[],r=(this.An,[E.LABEL_LAYER,E.FACILITY_LAYER,E.MODEL_LAYER,E.EXTENT_LAYER,E.EXTERNAL_MODEL_LAYER]),o={};if(n)for(var a=0;a<n.length;a++){var u=(u=n[a].buildingID)||this.An.buildingID,c=function(t,n){var e=[],i=t.buildingID;i=i||s.An.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[a],t);o[""+u]=c}else for(var h=0;h<t.length;h++){var f=t[h].buildingID,l=o[""+(f=f||this.An.buildingID)];l?l.push(t[h]):o[""+f]=[t[h]]}for(e in o)for(var d=o[e],v=function(t){for(var n=null,e=0;e<s.Lt.length;e++)if(s.Lt[e].buildingID===t){n=s.Lt[e];break}return n}(""+e),p=0;p<d.length;p++){var m=d[p].level,y=d[p].eid,b=d[p].type;t:for(var g=0;g<v.Lt.length;g++)if(v.Lt[g].Rr===m)for(var _=(_=v.Lt[g].getLayers()).filter(function(t){return r.includes(t.type)}),w=0;w<_.length;w++)for(var x=0;x<_[w].Lt.length;x++)if(_[w].Lt[x].G.yi===y&&_[w].Lt[x].bi===b){i.push(_[w].Lt[x]);break t}}return i}},{key:"getDataManager",value:function(){return this.Ir}},{key:"getMapOptions",value:function(){return this.Oi}},{key:"getContainer",value:function(){return this.Oi.container}},{key:"setFitView",value:function(t,n){var e=this,i=!1!==(n=n||{}).animate,r=this.getZoomRange(),o=this.copyCamera(),s=this.Ht.copyControls(o),a=this.Ht.Gt,u=this.Ut;this.Ht.Gt=s,this.Ut=o,this.setZoomRange([1,29]),s.enableDamping=!1,this.Ht.yr(this.An,{level:this.getLevel(),animate:!1}),this.setZoom({zoom:29,animate:!1,finish:function(){e.setCenter({animate:!1,x:t.center.x,y:t.center.y,finish:function(){e.Cm(t,5,0,function(t){e.Ht.Gt=a,e.Ut=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.It.renderer.setClearColor("string"===t?parseInt(t.slice(1),16):t,n),this.enableUpdateRender()}},{key:"setLabelField",value:function(t){this.Sn.F0=t,this.Pt.Bp(),this.Pt.$o()}},{key:"getLabelField",value:function(){return this.Sn.F0}},{key:"getBuilding",value:function(t){return this.Ga({bid:t})}},{key:"getBuildings",value:function(){var n=this,e=[];return this.traverse(function(t){t!==n.An&&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.mh!==t.overviewMode&&(e.mh=t.overviewMode,this.followFocus&&t.overviewMode!=Om.OUTDOOR&&e.parent.focusBuilding&&e.parent.focusBuilding.buildingID==e.buildingID&&e.setLevel({level:e.level}),e.Ph(),this.Pt.$v({bid:t.buildingIDs[n]}),this.kt.Dt({type:"buildingOverviewModeChanged",buildingID:t.buildingIDs[n]}))}t.overviewMode==Om.OUTDOOR&&this.followFocus&&this.An.setLevel({level:this.An.level})}},{key:"enterBuilding",value:function(t){var n=this,e=this.getBuilding(t.buildingID);this.Ht.lr({x:e.x,y:e.y,animate:!0,duration:.5,finish:function(){n.getBuildings().forEach(function(t){n.Lm.push({buildingID:t.buildingID,visible:t.visible}),t.visible=!1}),e.visible=!0,n.Sn.En=t.buildingID,n.Pt.Lh(e),n.Pt.On(),n.Pt.Vp(e,{}),n.kt.Dt({type:"ViewBuildingChange",buildingID:n.Sn.En}),n.kt.Dt({type:"buildingEntered",buildingID:n.Sn.En}),t.finish&&t.finish({buildingID:t.buildingID})}})}},{key:"exitBuilding",value:function(t){var n=this,e=(this.Lm.forEach(function(t){n.getBuilding(t.buildingID).visible=t.visible}),this.Lm.length=0,this.getBuilding(this.Sn.En));this.Ht.lr({x:e.x,y:e.y,animate:!0,duration:.5,finish:function(){n.Sn.En=n.Oi.buildingID,n.Pt.On(),n.Pt.Vp(e,{}),n.kt.Dt({type:"ViewBuildingChange",buildingID:n.Sn.En}),n.kt.Dt({type:"buildingExited",buildingID:e.yi}),t.finish&&t.finish({buildingID:e.yi})}})}},{key:"on",value:function(t,n){this.kt&&(this.kt.Jp(t,n),this.Sn.ym(t,!0))}},{key:"off",value:function(t,n){this.kt&&(this.kt.tm(t,n),this.kt.$p(t)||this.Sn&&this.Sn.ym(t,!1))}},{key:"pickFilterFunction",value:function(){return!0}},{key:"dispose",value:function(){var t,n=this;this.Mm||(this.Mm=!0,this.rn.dispose(),this.It.Yn(),st.a.environment==B.a.BROWSER&&this.Oi.container.removeChild(this.It.renderer.domElement),st.a.environment===B.a.WX&&(j2.textureCanvas=null,j2.dispose()),t=function(){n.Ir.Yn(function(){n.nr.Yn(function(){n.Pt.Yn(function(){n.Uo(),n.Io.dispose(),mx(yx(e.prototype),"dispose",n).call(n)})})})},sr.isLoaded()?t():sr.onLoad=t)}},{key:"collisionCheck",value:function(){this.Pt.$o()}}])&&lx(n.prototype,i),t&&lx(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}(),p=(Object.assign(nv.prototype,{Uo:function(){for(var t,n=[this.Ur,this.Ht],e=0;e<n.length;e++)n[e].Yn();for(t in this.It.Uo(),this.It=null,this.Ir=null,this.Pt=null,this)-1<n.indexOf(this[""+t])&&delete this[""+t];this.An=n=null},Am:function(t,n){return this.Mn=new vt(u.FOV,t/n,u.CAMERA_NEAR,u.CAMERA_FAR),this.Bt=new pt(-t/2,t/2,n/2,-n/2,u.CAMERA_NEAR,u.CAMERA_FAR),this.Sn.Ai===Si.MODE_3D?this.Mn:this.Bt},Ki:function(t){(t.jn=this).Lt.push(t),this.needUpdateBound=!0},rp:function(t){for(var n=[],e=(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}),new Ii),i=0;i<n.length;i++){var r=pr.coordsMapToScreen(this,{x:n[i].x,y:n[i].y,level:this.getLevel(),height:0});if(null===r)return null;e.Qt([r])}return e},Dm:function(t){var n=this.It.renderer.domElement.clientHeight,e=this.It.renderer.domElement.clientWidth,i=this.getZoom(),i=this.Ht.ki(i),t=this.rp(t);return t?i*(e/n>(i=t.size).x/i.y?i.y/n:i.x/e):null},km:function(t){t=this.rp(t);return t?pr.coordsScreenToMap(this,{x:(t.max.x+t.min.x)/2,y:(t.max.y+t.min.y)/2,level:this.getLevel()}):null},Cm:function(n,e,i,r){var o=this,s=this.getZoom(),t=this.Dm(n);t?s=this.Ht.ir(t):s-=1,this.setZoom({animate:!1,zoom:s,finish:function(){var t=o.km(n);t?o.setCenter({animate:!1,x:t.x,y:t.y,finish:function(){++i===e?r({zoom:s,center:t}):o.Cm(n,e,i,r)}}):0<s?o.Cm(n,e,i,r):r({zoom:s,center:n.center})}})},sr:function(){var t=this.getZoom();Math.abs(t-this.Sn.sm)>u.EPS&&(this.kt.Dt({type:"zoom",zoom:t}),this.Ut.isOrthographicCamera&&this.It.Xt(),this.Sn.sm=t)},Om:function(){var t;this.Sn.um&&(t=this.Ht.Gt.target).distanceToSquared(this.Em)>u.EPS&&(this.kt.Dt({type:"move",center:this.getCenter()}),this.Em=t.clone())},jm:function(){var t,n,e,i,s=this,a=!0;n=(t=this).Oi,e=this.Sn,i=function(t,n,e,i,r,o){a&&(s.Sn.bm(s.An),a=s.Ht.Di()),s.It.On(),s.Ut.updateMatrixWorld(),e&&o&&s.Ht.Ki([s.sr,s.Om]),r&&o&&(s.Rm=!0,s.kt.Dt({type:"loaded"}),s.tp(),s.Sn._p=!1)},t.Ir=new Nl({mapCreateTime:t.Rn}),t.Pt=new k2(t,n,e,i),t.Pt.Hp()},Ga:function(n){var e=null;return this.traverse(function(t){t.yi!==n.bid&&t.wr!==n.mid||(e=t)}),e},Cp:function(){var t=this.It.renderer.domElement,t={x:t.clientWidth/2,y:t.clientHeight/2,z:this.Ht.controls.target.y};return pr.coordsScreenToMap(this,t)},Dp:function(e){var i=this;if(e===this.An)return!1;if(!this.Rm)return!1;var r=!1;if(this.Oi.enterTriggerMode===Y2.Individual)e.Sh.hh.forEach(function(t,n){t.type===E.MODEL&&t.level===i.An.level&&E1.isContain(t.coordinates[0],i.Cp())&&(i.Im=e,r=!0)});else for(var t,n=0;n<e.levelChart.length;n+=2)e.levelChart[n]===this.An.level&&(t=e.levelChart[n+1],t=e.Up.get(t),E1.isContain(t[0],this.Cp()))&&(this.Im=e,r=!0);return r},Jv:function(n){var e=this;this.traverse(function(t){e.Im||(e.Dp(t),e.Im&&n(t))})},tp:function(){var e=this;if(this.Tm&&this.Im.yi!=this.Sn.Oi.mapID){var t=this.Um(),n=this.Im.yi;if(t||this.Nm===n||(n=this.Nm,t=!0),t){if(this.getState().viewBuildingID&&this.getState().viewBuildingID!==this.Sn.Oi.mapID)return;var t={type:"buildingExited",buildingID:n},i=(this.Tm=!1,this.Im=null,this.getBuilding(n));this.Pt.Ac(n)&&i.Th&&(i.Th=!1,this.kt.Dt(t))}}this.traverse(function(t){var n;e.Tm||e.Dp(t)&&(n=e.kp(),e.Nm=t.buildingID,!n||e.getState().viewBuildingID&&e.getState().viewBuildingID!==e.Sn.Oi.mapID||(e.Tm=!0,e.Pt.Ac(t.yi)&&0==t.Th?(t.Th=!0,e.kt.Dt({type:"buildingEntered",buildingID:t.yi})):(e.Pm=t.yi,e.on("update",e.Fm))))})},Fm:function(){var t,n;this.Pt.Ac(this.Pm)&&(this.Im&&this.Im.yi===this.Pm&&(t=this.Dp(this.Im),n=this.kp(),t)&&n&&(this.Im.Th=!0,this.kt.Dt({type:"buildingEntered",buildingID:this.Pm})),this.off("update",this.Fm),this.Pm=null)},Um:function(){var t,n=this.Bm();return this.Im.overviewMode==Om.NORMAL?(t=(t=this.getZoom())<this.Im._h||t>=this.Im.wh,!n||t):!n},kp:function(){var t;return this.Im.overviewMode!=Om.NORMAL||!((t=this.getZoom())<this.Im._h||t>=this.Im.wh)},Bm:function(){var t,n,e=this;return null!=this.Im&&(!!this.Dp(this.Im)||null!=(t=this.Im.getFloor(this.Im.level).getLayers(E.EXTENT_LAYER)[0])&&(n=!1,t&&t.traverse(function(t){n=!E1.isContain(t.coordinates[0],e.Cp())}),!n))}}),nv);function gx(t){return(gx="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 _x(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,function(t){t=function(t,n){if("object"!=gx(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=gx(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==gx(t)?t:t+""}(i.key),i)}}function xx(t,n,e){n=Sx(n);var i=t,n=Ex()?Reflect.construct(n,e||[],Sx(t).constructor):n.apply(t,e);if(n&&("object"===gx(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function Ex(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Ex=function(){return!!t})()}function Sx(t){return(Sx=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Tx(t,n){return(Tx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var Ly=function(){function n(t){if(this instanceof n)return(t=xx(this,n,[t])).Ei=new Map,t;throw new TypeError("Cannot call a class as a function")}var t,e=n,i=Mg;if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");return e.prototype=Object.create(i&&i.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),i&&Tx(e,i),e=n,(i=[{key:"moveTo",value:function(n){var t,e=this,i=void 0!==n.animate&&n.animate,r=n.duration||.5,o=this.gr(p);if(o)return i?(this.Ei.has("moveTo")?t=this.Ei.get("moveTo"):(t=new Pr,this.Ei.set("moveTo",t)),t.Qn([this.xt,this.Et]).Zn([n.x,n.y]).qn(r).Jn(function(t){e.xt=t.destination[0],e.Et=t.destination[1],e.W0(),n.update&&n.update({x:e.xt,y:e.Et,level:e.Rr,height:e.nt,buildingID:e.Z0}),o.enableUpdateRender()}).$n(function(){e.xt=n.x,e.Et=n.y,e.W0(),n.finish&&n.finish(),o.enableUpdateRender()}),o.nr.Ki(t.Wn()),t):(this.xt=n.x,this.Et=n.y,this.W0(),n.finish&&n.finish(),void o.enableUpdateRender())}},{key:"stop",value:function(){var n=this.gr(p);n&&this.Ei&&(this.Ei.forEach(function(t){n.nr.tr(t)}),this.Ei.clear())}}])&&_x(e.prototype,i),t&&_x(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(),Ax=(Object.assign(Ly.prototype,{W0:function(){if(this.Rt){var t=this.gr(p);if(!t)return!1;var n=this.bi===E.DOM_MARKER?this.Gm.height+this.nt:this.nt;this.Rt.position.set(this.xt-t.x,n,-this.Et+t.y),this.needUpdateBound=!0,t.enableUpdateRender()}}}),Ly);function Mx(t){return(Mx="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 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,function(t){t=function(t,n){if("object"!=Mx(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Mx(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Mx(t)?t:t+""}(i.key),i)}}function Lx(t,n,e){n=Px(n);var i=t,n=Rx()?Reflect.construct(n,e||[],Px(t).constructor):n.apply(t,e);if(n&&("object"===Mx(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function Rx(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Rx=function(){return!!t})()}function Nx(){return(Nx="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,n,e){var i=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=Px(t)););return t}(t,n);if(i)return(i=Object.getOwnPropertyDescriptor(i,n)).get?i.get.call(arguments.length<3?t:e):i.value}).apply(this,arguments)}function Px(t){return(Px=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Fx(t,n){return(Fx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var jx=function(){function n(t){if(this instanceof n)return Lx(this,n,[t]);throw new TypeError("Cannot call a class as a function")}var t,e=n,i=Ax;if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");return e.prototype=Object.create(i&&i.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),i&&Fx(e,i),e=n,(i=[{key:"collision",get:function(){return this.qo},set:function(t){this.qo!==t&&(this.qo=t,t=this.gr(p))&&t.Pt.$o()}},{key:"addTo",value:function(t){Nx(Px(n.prototype),"addTo",this).call(this,t);t=this.gr(p);t&&(t.on("viewModeChanged",this.en),t.on("zoom",this.en),t.on("resize",this.en),t.Pt.$o())}},{key:"remove",value:function(){this.stop();var t=this.gr(p);t&&(t.off("viewModeChanged",this.en),t.off("zoom",this.en),t.off("resize",this.en),Nx(Px(n.prototype),"remove",this).call(this),t.Pt.$o(),t.enableUpdateRender())}}])&&Ox(e.prototype,i),t&&Ox(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}();function Ix(t){return(Ix="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 Cx(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,function(t){t=function(t,n){if("object"!=Ix(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Ix(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Ix(t)?t:t+""}(i.key),i)}}function Dx(t,n,e){n=Ux(n);var i=t,n=kx()?Reflect.construct(n,e||[],Ux(t).constructor):n.apply(t,e);if(n&&("object"===Ix(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function kx(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(kx=function(){return!!t})()}function Ux(t){return(Ux=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Bx(t,n){return(Bx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}Vy=function(){function e(t){var n;if(this instanceof e)return(n=Dx(this,e,[t])).bi=E.IMAGE_MARKER,n.vf=t.url,n.qt=void 0!==t.size?t.size:32,n.bd=void 0!==t.depth&&t.depth,n.ft=void 0!==t.opacity?t.opacity:1,n.qo=void 0===t.collision||t.collision,n.Jt=_r.getCenterByAnchor(t.anchor),n.en=n.en.bind(n),n;throw new TypeError("Cannot call a class as a function")}var t,n=e,i=jx;if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");return n.prototype=Object.create(i&&i.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),i&&Bx(n,i),n=e,(i=[{key:"url",get:function(){return this.vf},set:function(t){this.vf=t,this.yf()}},{key:"opacity",get:function(){return this.ft},set:function(t){this.ft=t,this.yf()}},{key:"size",get:function(){return this.qt},set:function(t){this.qt=t,this.en()}},{key:"jump",value:function(t){return A1(this,t)}},{key:"stopJump",value:function(){return M1(this)}},{key:"boost",value:function(t){return S1(this,t)}},{key:"stopBoost",value:function(){return T1(this)}},{key:"getRenderNode",value:function(){return this.Rt}}])&&Cx(n.prototype,i),t&&Cx(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}(),Object.assign(Vy.prototype,{ec:function(){var t;return!!this.vf&&!!(t=this.gr(p))&&(t=this.qr(t),this.Rt=new Gm(t),this.Rt.center.set(this.Jt.x,this.Jt.y),this.Rt.visible=this.$t,this.W0(),this.en(),(this.Rt.mapNode=this).kh=!0)},en:function(){var t=this.gr(p);t&&(O1(t.Pt,this),t.Pt.$o(),t.enableUpdateRender())},yf:function(){var t=this.gr(p);t&&(this.Rt.material=this.qr(t),this.en())},qr:function(t){var n=this,e=this.gr(v);return t.Pt.io.Fu({url:this.vf,needDepth:this.bd,opacity:this.ft*e.ft},function(){n.Rt&&n.en(),t.enableUpdateRender()})}}),Jy=Vy;function Gx(t){return(Gx="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 Hx(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,function(t){t=function(t,n){if("object"!=Gx(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Gx(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Gx(t)?t:t+""}(i.key),i)}}function Xx(t,n,e){n=zx(n);var i=t,n=Vx()?Reflect.construct(n,e||[],zx(t).constructor):n.apply(t,e);if(n&&("object"===Gx(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function Vx(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Vx=function(){return!!t})()}function zx(t){return(zx=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Wx(t,n){return(Wx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}sb=function(){function e(t){var n;if(this instanceof e)return(n=Xx(this,e,[t])).bi=void 0!==t.type?t.type:E.TEXT_MARKER,n.j0=void 0!==t.text?t.text:"",n.Hm=void 0!==t.fontsize?t.fontsize:20,void 0!==t.fontSize&&(n.Hm=t.fontSize),n.Xm=t.fontFamily,n.V0=void 0!==t.fillColor?t.fillColor:"0,0,0",n.Vm=void 0!==t.strokeColor?t.strokeColor:"255,225,255",n.zm=void 0!==t.strokeWidth?t.strokeWidth:1,n.Wm=t.plateColor,n.Ym=t.plateStrokeColor,n.bd=void 0!==t.depth&&t.depth,n.qo=void 0===t.collision||t.collision,n.ft=void 0!==t.opacity?t.opacity:1,n.Qm=void 0!==t.textAlign?t.textAlign:Bl.Center,n.Zm=t.anchor,n.Jt=_r.getCenterByAnchor(t.anchor),n.qt=0,n.en=n.en.bind(n),n;throw new TypeError("Cannot call a class as a function")}var t,n=e,i=jx;if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");return n.prototype=Object.create(i&&i.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),i&&Wx(n,i),n=e,(i=[{key:"size",get:function(){return this.qt},set:function(t){this.qt=t}},{key:"text",get:function(){return this.j0},set:function(t){this.j0=t}},{key:"fillColor",get:function(){return this.V0},set:function(t){this.V0=t}},{key:"strokeColor",get:function(){return this.Vm},set:function(t){this.Vm=t}},{key:"strokeWidth",get:function(){return this.zm},set:function(t){this.zm=t}},{key:"fontsize",get:function(){return this.Hm},set:function(t){this.Hm=t}},{key:"fontSize",get:function(){return this.Hm},set:function(t){this.Hm=t}},{key:"plateColor",get:function(){return this.Wm},set:function(t){this.Wm=t}},{key:"plateStrokeColor",get:function(){return this.Ym},set:function(t){this.Ym=t}},{key:"update",value:function(){this.yf()}},{key:"setInitWriteRenderNodeFunction",value:function(t){this.qm=t}},{key:"findParent",value:function(t){return this.gr(t)}},{key:"updateSize",value:function(){this.en()}},{key:"getRenderNode",value:function(){return this.Rt}},{key:"getScreenSize",value:function(){var t=null;return t=this.Rt?{width:this.Rt.children[0].material.map.image.width/2,height:this.Rt.children[0].material.map.image.height/2}:t}}])&&Hx(n.prototype,i),t&&Hx(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}(),Object.assign(sb.prototype,{ec:function(){var t=this.gr(p);if(!t)return!1;this.I0=!1;t=t.Pt,t=this.qr(t.io).material,this.Rt=new nh,t=new Gm(t);return t.center.set(this.Jt.x,this.Jt.y),this.Rt.add(t),this.en(),this.W0(),this.Rt.mapNode=this,(t.mapNode=this).kh=!0,this.qm&&(this.Rt=this.qm(this.Rt)),!0},Km:function(t,n){if(t&&t.material){var e=this.gr(p);if(!e)return!1;e=e.Pt.Ch(n);t.scale.set(e,e,e),t.scale.multiplyScalar(t.material.userData.mspriteScale||1),t.scale.setX(t.scale.x/t.material.userData.scaleRatio)}},en:function(){var t=this.gr(p);if(!t)return!1;var n=this.Rt.isGroup?this.Rt.children[0]:this.Rt;"Sprite"===n.type&&(this.Km(n,this.qt),t.enableUpdateRender())},Y0:function(t){t&&t.material&&(t.material.map&&t.material.map.dispose(),t.material.dispose())},yf:function(){var t,n=this.gr(p);n&&(t=this.Rt.isGroup?this.Rt.children[0]:this.Rt,this.Y0(t),n=this.qr(n.Pt.io).material,t.material=n,this.en())},qr:function(t){var n=this.gr(v),t=t.Lu(this.j0,{fontsize:this.I0?this.Hm+2:this.Hm,fillColor:Lr.toRgba(this.V0),strokeColor:Lr.toRgba(this.Vm),plateColor:Lr.toRgba(this.Wm),plateStrokeColor:Lr.toRgba(this.Ym),strokeWidth:this.zm},{family:this.Xm,needSize:!0,opacity:this.ft*n.ft,textAlign:this.Qm,drawText:!this.I0});return this.qt=t.size,{material:t}}}),db=sb;function Yx(t){return(Yx="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 Qx(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,function(t){t=function(t,n){if("object"!=Yx(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=Yx(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==Yx(t)?t:t+""}(i.key),i)}}var Zx=function(){function i(){if(!(this instanceof i))throw new TypeError("Cannot call a class as a function")}return t=i,e=[{key:"createShape",value:function(t,n){var e=new Up;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 kp;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 c=1;c<t.length;c++)e.lineTo(t[c].x-n.x,t[c].y-n.y)}return e}},{key:"createShapeBufferGeometryByCenter",value:function(t,n,e){t=new sm(this.createShape(t,n));if(e){for(var i=[Number.MAX_VALUE,Number.MAX_VALUE],r=[-Number.MAX_VALUE,-Number.MAX_VALUE],o=t.attributes.position.array,s=0;s<o.length/3;s++){var a=o[3*s],u=o[3*s+1];a<i[0]&&(i[0]=a),u<i[1]&&(i[1]=u),r[0]<a&&(r[0]=a),r[1]<u&&(r[1]=u)}for(var c=t.attributes.uv.array,h=[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];c[2*f]=(l-i[0])/h[0],c[2*f+1]=(d-i[1])/h[1]}t.setAttribute("uv",new x(c,2))}return t}},{key:"createExtrudeBufferGeometry",value:function(t,n){return new um(t,{steps:1,depth:n.depth,bevelEnabled:!1,bevelThickness:0,bevelSize:0,bevelOffset:0,bevelSegments:1})}},{key:"closedPoints",value:function(t){return vm.closedPoints(t)}},{key:"createReactShape",value:function(t,n){var e=new Up,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 Up;return e.absarc(0,0,t,0,2*Math.PI,!1),e}},{key:"createReactExtrudeBufferGeometry",value:function(t,n,e){t=i.createReactShape(t,n);return this.createExtrudeBufferGeometry(t,e)}},{key:"createCircleExtrudeBufferGeometry",value:function(t,n,e){t=i.createCircleShape(t,n);return this.createExtrudeBufferGeometry(t,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 oa,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 c=new Float32Array(s);return o.setAttribute("position",new x(c,3)),o.setAttribute("gradientAlpha",new x(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)&&Qx(t.prototype,n),e&&Qx(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,e}();function qx(t){return(qx="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 Kx(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,function(t){t=function(t,n){if("object"!=qx(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=qx(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==qx(t)?t:t+""}(i.key),i)}}function Jx(t,n,e){n=tE(n);var i=t,n=$x()?Reflect.construct(n,e||[],tE(t).constructor):n.apply(t,e);if(n&&("object"===qx(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function $x(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return($x=function(){return!!t})()}function tE(t){return(tE=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function nE(t,n){return(nE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}t2=function(){function e(t){var n;if(this instanceof e)return(n=Jx(this,e,[t])).bi=E.POLYGON_MARKER,n.vf=void 0!==t.url?t.url:void 0,n.Jl=void 0!==t.color?t.color:"#FF0000",n.ft=void 0!==t.opacity?t.opacity:1,n.Yd=t.borderColor||t.borderColor||"#00ff00",n.md="number"==typeof t.borderWidth?t.borderWidth:2,n.nt=void 0!==t.height?t.height:0,n.Ih=void 0!==t.points?t.points:[],n;throw new TypeError("Cannot call a class as a function")}var t,n=e,i=Mg;if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");return n.prototype=Object.create(i&&i.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),i&&nE(n,i),n=e,(i=[{key:"x",get:function(){return this.xt}},{key:"y",get:function(){return this.Et}},{key:"points",get:function(){return this.Ih},set:function(t){var n,e;this.Ih=t,this.Rt&&(t=this.gr(p))&&(n=new Mt(t.x,t.y),n=Zx.createShapeBufferGeometryByCenter(this.Ih,n,!!this.vf),e=this.Rt.geometry,this.Rt.geometry=n,e.dispose(),e=null,e=this.Jm(n),this.gh.kd(e),t.enableUpdateRender())}},{key:"color",get:function(){return this.Jl},set:function(t){this.Jl=t,this.$m()}},{key:"borderColor",get:function(){return this.Yd},set:function(t){this.Yd=t,this.gh&&(this.gh.color=t,this.gh.update())}},{key:"borderWidth",get:function(){return this.md},set:function(t){this.md=t,this.gh&&(this.gh.width=t,this.gh.update())}},{key:"opacity",get:function(){return this.ft},set:function(t){this.ft=t,this.$m()}},{key:"getBound",value:function(){return E1.bound(this.Ih)}},{key:"getInsideCenter",value:function(){var t={};return E1.calculatorInsideCentroid(this.Ih,t),t}},{key:"getRenderNode",value:function(){return this.Rt}}])&&Kx(n.prototype,i),t&&Kx(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}(),Object.assign(t2.prototype,{Jm:function(t){for(var n=t.attributes.position.array.length,e=new Float32Array(n+3),i=0;i<n;i++)e[i]=t.attributes.position.array[i];return e[n]=t.attributes.position.array[0],e[n+1]=t.attributes.position.array[1],e[n+2]=t.attributes.position.array[2],e},ec:function(){var t,n,e,i;return!!this.Ih&&!!(t=this.gr(p))&&(i=this.gr(v),n=t.Pt.io.xu({url:this.vf,color:this.Jl,opacity:this.ft*i.ft,visible:!this.vf},function(){n.map.wrapS=Vn,n.map.wrapT=Vn,n.needsUpdate=!0,n.visible=!0}),i=new Mt(t.x,t.y),i=Zx.createShapeBufferGeometryByCenter(this.Ih,i,!!this.vf),e=this.Jm(i),jy(i,n,this),this.Rt.position.set(0,this.nt,0),(i=new M_({color:this.Yd,width:this.md})).jn=this,i.Dd(e,t),this.td=e,this.gh=i,this.Rt.add(i.Rt),t.enableUpdateRender(),!0)},W0:function(){this.Rt&&this.Rt.position.set(0,this.nt,0),this.gr(p).enableUpdateRender()},$m:function(){var t=this,n=this.gr(p);if(!n)return!1;var e=n.Pt,i=this.gr(v);this.Rt.material=e.io.xu({url:this.vf,color:this.Jl,opacity:this.ft*i.ft,visible:!this.vf},function(){t.Rt.material.map.wrapS=Vn,t.Rt.material.map.wrapT=Vn,t.Rt.material.needsUpdate=!0,t.Rt.material.visible=!0}),n.enableUpdateRender()},yf:function(){this.$m(),this.gh.update()}}),a2=t2;function eE(t){return(eE="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 iE(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,function(t){t=function(t,n){if("object"!=eE(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=eE(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==eE(t)?t:t+""}(i.key),i)}}function rE(t,n,e){n=sE(n);var i=t,n=oE()?Reflect.construct(n,e||[],sE(t).constructor):n.apply(t,e);if(n&&("object"===eE(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function oE(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(oE=function(){return!!t})()}function sE(t){return(sE=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function aE(t,n){return(aE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var uE=function(){function e(){var t,n;if(this instanceof e)return t=rE(this,e),n=new lh(new Float32Array([-.5,0,-.5,0,0,.5,0,-.5,1,0,.5,0,.5,1,1,-.5,0,.5,0,1]),5),t.setIndex([0,1,2,0,2,3]),t.setAttribute("position",new vh(n,3,0,!1)),t.setAttribute("uv",new vh(n,2,3,!1)),t;throw new TypeError("Cannot call a class as a function")}var t,n,i=e,r=oa;if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");return i.prototype=Object.create(r&&r.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),r&&aE(i,r),i=e,t&&iE(i.prototype,t),n&&iE(i,n),Object.defineProperty(i,"prototype",{writable:!1}),i}();function cE(t){return(cE="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 hE(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,function(t){t=function(t,n){if("object"!=cE(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=cE(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==cE(t)?t:t+""}(i.key),i)}}function fE(t,n,e){n=vE(n);var i=t,n=lE()?Reflect.construct(n,e||[],vE(t).constructor):n.apply(t,e);if(n&&("object"===cE(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function lE(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(lE=function(){return!!t})()}function dE(){return(dE="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,n,e){var i=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=vE(t)););return t}(t,n);if(i)return(i=Object.getOwnPropertyDescriptor(i,n)).get?i.get.call(arguments.length<3?t:e):i.value}).apply(this,arguments)}function vE(t){return(vE=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function pE(t,n){return(pE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var v2=function(){function e(t){var n;if(this instanceof e)return(n=fE(this,e,[t])).bi=E.LOCATION_MARKER,n.vf=t.url,n.qt=void 0!==t.size?t.size:20,n.Rr=void 0!==t.level?t.level:1,n.ft=void 0!==t.opacity?t.opacity:1,n.Z0=t.buildingID,n.t1=0,n.en=n.en.bind(n),n.W0=n.W0.bind(n),n;throw new TypeError("Cannot call a class as a function")}var t,n=e,i=Ax;if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");return n.prototype=Object.create(i&&i.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),i&&pE(n,i),n=e,(i=[{key:"buildingID",get:function(){return this.Z0}},{key:"level",get:function(){return this.Rr},set:function(t){this.Rr!==t&&(this.Rr=t,t=this.gr(p),this.remove(),this.addTo(t))}},{key:"opacity",get:function(){return this.ft},set:function(t){this.ft=t,this.kh&&this.yf()}},{key:"url",get:function(){return this.vf},set:function(t){this.vf=t,this.yf()}},{key:"size",get:function(){return this.qt},set:function(t){this.qt=t,this.en()}},{key:"moveTo",value:function(t){if(this.Z0!==t.buildingID){this.Z0=t.buildingID,this.Rr=t.level;var n=this.gr(p);if(!n)return!1;this.remove(),this.addTo(n)}else t.level&&(this.level=t.level);return dE(vE(e.prototype),"moveTo",this).call(this,t)}},{key:"rotateTo",value:function(t){var n=this,e=this.gr(p);if(!e)return!1;var i,r=t.duration||.5,o=this.Rt.rotation.y,s=t.heading%360*u.DEG2RAD,a=0,s=o+(a=s-o!=0?Math.sin(s-o)/Math.abs(Math.sin(s-o))*Math.acos(Math.cos(s-o)):a);t.animate?(this.Ei.has("rotation")?(i=this.Ei.get("rotation")).finish():(i=new Pr({src:[o],dest:[s]}),this.Ei.set("rotation",i)),i.qn(r).Jn(function(t){n.Rt&&(n.Rt.rotation.y=t.destination[0],n.t1=t.destination[0],e.enableUpdateRender())}).$n(function(){e.nr.tr(i),e.enableUpdateRender(),t.finish&&t.finish()}),e.nr.Ki(i.Wn())):this.Rt&&(this.Rt.rotation.y=s,this.t1=s,e.enableUpdateRender())}},{key:"addTo",value:function(t){var n=this.Bi(t);n&&(dE(vE(e.prototype),"addTo",this).call(this,n),t.on("zoom",this.en),t.on("resize",this.en),t.on("viewChanged",this.en))}},{key:"remove",value:function(){this.stop();var t=this.gr(p);if(!t)return!1;t.off("zoom",this.en),t.off("resize",this.en),t.off("viewChanged",this.en),dE(vE(e.prototype),"remove",this).call(this)}},{key:"getRenderNode",value:function(){return this.Rt}}])&&hE(n.prototype,i),t&&hE(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}(),w2=(Object.assign(v2.prototype,{ec:function(){var t,n,e=this.gr(p);return!!e&&(n=new uE,t=this.qr(e),this.Rt=new $a(n,t),this.Rt.renderOrder=1,(this.Rt.mapNode=this).W0(),this.Rt.rotation.set(0,this.t1,-Math.PI,"XYZ"),this.Rt.updateMatrixWorld(!0),n=e.Pt.Gp(this.Rt,this.qt),this.Rt.scale.set(n,n,n),this.Rt.visible=this.$t,this.jn.Do.add(this.Rt),this.kh=!0)},en:function(){var t,n,e=this.gr(p);!e||(n=this.Rt.position,t=!1,t=!!(isNaN(n.x)||isNaN(n.y)||isNaN(n.z)||"number"!=typeof n.x||"number"!=typeof n.y||"number"!=typeof n.z)||t)||(n=e.Pt.Gp(this.Rt,this.qt),this.Rt.scale.set(n,n,n),e.enableUpdateRender())},W0:function(){var t,n=this.gr(p);n&&(t=this.Bi(n))&&(this.Rt.position.set(this.xt-n.x,t.nt+this.nt,-this.Et+n.y),this.needUpdateBound=!0,n.enableUpdateRender())},qr:function(n){var e=this;return n.Pt.io.Eu({url:this.vf,flipY:!1,opacity:this.ft},function(){var t;e.Rt&&(t=n.Pt.Gp(e.Rt,e.qt),e.Rt.scale.set(t,t,t),n.enableUpdateRender())})},yf:function(){var t=this.gr(p);if(!t)return!1;this.Rt.material.map&&this.Rt.material.map.dispose(),this.Rt.material.dispose(),this.Rt.material=this.qr(t),this.Rt.material.needsUpdate=!0,t.enableUpdateRender()},Bi:function(t){return(this.Z0?t.getBuilding(this.Z0):t).getFloor(this.Rr)}}),v2),x2={EDGES_LINES_TYPE:"EDGES_LINES_TYPE"},mE=(Object.freeze(x2),x2),yE={NONE:0,ALL:1,TOP:2};function bE(t,n){oa.call(this),this.type="EdgesGeometry",this.parameters={thresholdAngle:n},n=void 0!==n?n:1;for(var e,i,r,o,s=[],a=Math.cos(St.DEG2RAD*n),u=[0,0],c={},h=["a","b","c"],f=(t.isBufferGeometry?(o=new Bs).fromBufferGeometry(t):o=t.clone(),o.mergeVertices(),o.computeFaceNormals(),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[h[m]],i=p[h[(m+1)%3]],u[0]=Math.min(e,i),u[1]=Math.max(e,i),void 0===c[r=u[0]+","+u[1]]?c[r]={index1:u[0],index2:u[1],face1:d,face2:void 0}:c[r].face2=d;for(r in c){var y,b=c[r];(void 0===b.face2||l[b.face1].normal.dot(l[b.face2].normal)<=a)&&(y=f[b.index1],s.push(y.x,y.y,y.z),y=f[b.index2],s.push(y.x,y.y,y.z))}this.setAttribute("position",new x(s,3))}function gE(t){return(gE="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 _E(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,function(t){t=function(t,n){if("object"!=gE(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=gE(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==gE(t)?t:t+""}(i.key),i)}}function wE(t,n,e){n=EE(n);var i=t,n=xE()?Reflect.construct(n,e||[],EE(t).constructor):n.apply(t,e);if(n&&("object"===gE(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function xE(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(xE=function(){return!!t})()}function EE(t){return(EE=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function SE(t,n){return(SE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}(bE.prototype=Object.create(oa.prototype)).constructor=bE;var i=function(){function e(t){var n;if(this instanceof e)return(n=wE(this,e,[t])).bi=mE.EDGES_LINES_TYPE,n.gd=void 0!==t.lineType?t.lineType:yE.TOP,n.n1=void 0!==t.lineAlpha?t.lineAlpha:1,n.Yd=void 0!==t.lineColor?t.lineColor:"#FF0000",n;throw new TypeError("Cannot call a class as a function")}var t,n=e,i=Mg;if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");return n.prototype=Object.create(i&&i.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),i&&SE(n,i),n=e,(i=[{key:"lineColor",get:function(){return this.Yd},set:function(t){this.Yd!==t&&(this.Yd=t,this.yf())}},{key:"lineAlpha",get:function(){return this.n1},set:function(t){this.n1!==t&&(this.n1=t,this.yf())}}])&&_E(n.prototype,i),t&&_E(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}(),TE=(Object.assign(i.prototype,{Bd:function(t){var t=new bE(t),n=this.gr(p);if(!n)return!1;var n=n.Pt,e=this.gr(v),n=n.io.Cu(this.Yd,this.n1*e.ft);this.Rt=new Vd(t,n),this.kh=!0},yf:function(){var t,n=this.gr(p);n&&(t=this.gr(v),this.Rt.material=n.Pt.io.Cu(this.Yd,this.n1*t.ft))}}),i);function AE(t){return(AE="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 ME(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,function(t){t=function(t,n){if("object"!=AE(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=AE(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==AE(t)?t:t+""}(i.key),i)}}function OE(t,n,e){n=NE(n);var i=t,n=LE()?Reflect.construct(n,e||[],NE(t).constructor):n.apply(t,e);if(n&&("object"===AE(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function LE(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(LE=function(){return!!t})()}function RE(){return(RE="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,n,e){var i=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=NE(t)););return t}(t,n);if(i)return(i=Object.getOwnPropertyDescriptor(i,n)).get?i.get.call(arguments.length<3?t:e):i.value}).apply(this,arguments)}function NE(t){return(NE=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function PE(t,n){return(PE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}var Fw=function(){function i(t){var n;if(!(this instanceof i))throw new TypeError("Cannot call a class as a function");if((n=OE(this,i,[t])).bi=E.EXTRUDE_MARKER,n.ft=void 0!==t.opacity?t.opacity:1,n.Jl=void 0!==t.color?t.color:"#FF0000",n.e1=void 0!==t.extrudeHeight?t.extrudeHeight:1,n.bd=n.e1,n.Ih=void 0!==t.points?Object.assign(t.points):[],Array.isArray(n.Ih[0]))for(var e=0;e<n.Ih.length;e++)n.Ih[e].constructor===Array&&(vm.polygonArea(n.Ih[e])<0&&n.Ih[e].reverse(),vm.closedPoints(n.Ih[e]));else n.Ih.constructor===Array&&(vm.polygonArea(n.Ih)<0&&n.Ih.reverse(),vm.closedPoints(n.Ih));return n.i1=new TE({lineType:t.edgeMode,lineColor:void 0!==t.edgeColor?t.edgeColor:n.Jl,lineAlpha:void 0!==t.edgeOpacity?t.edgeOpacity:n.ft}),n.i1.jn=n}var t,n=i,e=Mg;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&PE(n,e),n=i,(e=[{key:"x",get:function(){return this.xt}},{key:"y",get:function(){return this.Et}},{key:"color",get:function(){return this.Jl},set:function(t){this.Jl!==t&&(this.Jl=t,this.o1())}},{key:"opacity",get:function(){return this.ft},set:function(t){this.ft!==t&&(this.ft=t,this.o1())}},{key:"edgeColor",get:function(){return this.i1.Yd},set:function(t){this.i1.lineColor=t}},{key:"edgeOpacity",get:function(){return this.i1.n1},set:function(t){this.i1.lineAlpha=t}},{key:"extrudeHeight",get:function(){return this.e1},set:function(t){this.e1!==t&&(this.e1=t,this.Rt.scale.setZ(this.e1/this.bd))}},{key:"points",get:function(){return this.Ih},set:function(t){this.Ih=t,this.Ih.constructor===Array&&(vm.polygonArea(this.Ih)<0&&this.Ih.reverse(),vm.closedPoints(this.Ih)),this.Rt&&(t=this.gr(p))&&(this.Rt.parent.remove(this.Rt),this.Rt.traverse(function(t){t instanceof $a&&(t.geometry.dispose(),t.material=void 0,t.geometry=void 0)}),this.Rt.mapNode=void 0,this.Rt=void 0,this.ec(),this.parent.scene.add(this.Rt),t.enableUpdateRender())}},{key:"dispose",value:function(){this.i1&&this.i1.dispose(),RE(NE(i.prototype),"dispose",this).call(this)}},{key:"getRenderNode",value:function(){return this.Rt}},{key:"setType",value:function(t){this.bi=t}}])&&ME(n.prototype,e),t&&ME(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}(),gw=(Object.assign(Fw.prototype,{ec:function(){var t,n,e,i,r,o=this.gr(p);return!!o&&(t=o.Pt,n=this.gr(v),e=new Mt(o.x,o.y),r=Zx.createShape(this.Ih,e),i={depth:this.bd},jy(r=Zx.createExtrudeBufferGeometry(r,i),t.io.Cu(this.Jl,this.ft*n.ft),this),this.Rt.position.set(0,this.nt,0),this.i1.gd===yE.TOP?this.s1(e):this.i1.gd===yE.ALL&&this.hv(r),this.kh=!0,o.enableUpdateRender(),this.kh)},s1:function(t){t=new sm(Zx.createShape(this.Ih,t));this.hv(t),this.i1.Rt.position.setZ(this.bd),t.dispose()},hv:function(t){this.i1.Bd(t),this.Rt.add(this.i1.Rt)},o1:function(){var t,n=this.gr(p);n&&(t=this.gr(v),this.Rt.material=n.Pt.io.Cu(this.Jl,this.ft*t.ft),n.enableUpdateRender())},yf:function(){this.o1(),this.i1.yf()},W0:function(){this.Rt.position.set(0,this.nt,0),this.gr(p).enableUpdateRender()}}),Fw),Bw=t(32),FE=t.n(Bw),Yw=t(33),jE=t.n(Yw);function IE(t){return(IE="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 CE(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,BE(i.key),i)}}function DE(t,n,e){n=XE(n);var i=t,n=kE()?Reflect.construct(n,e||[],XE(t).constructor):n.apply(t,e);if(n&&("object"===IE(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function kE(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(kE=function(){return!!t})()}function UE(t,n,e,i){return(UE="undefined"!=typeof Reflect&&Reflect.set?Reflect.set:function(t,n,e,i){var r,t=HE(t,n);if(t){if((r=Object.getOwnPropertyDescriptor(t,n)).set)return r.set.call(i,e),!0;if(!r.writable)return!1}if(r=Object.getOwnPropertyDescriptor(i,n)){if(!r.writable)return!1;r.value=e,Object.defineProperty(i,n,r)}else t=i,r=e,!((i=BE(i=n))in t?Object.defineProperty(t,i,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[i]=r);return!0})(t,n,e,i)}function BE(t){t=function(t,n){if("object"!=IE(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=IE(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==IE(t)?t:t+""}function GE(){return(GE="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,n,e){var i=HE(t,n);if(i)return(i=Object.getOwnPropertyDescriptor(i,n)).get?i.get.call(arguments.length<3?t:e):i.value}).apply(this,arguments)}function HE(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=XE(t)););return t}function XE(t){return(XE=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function VE(t,n){return(VE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}e=function(){function s(t,n){var e;if(this instanceof s)return(e=DE(this,s,[n=n||{}])).bi=E.HEAT_MAP_MARKER,e._n=t,e.fm=n.backgroundColor,e.ft=n.opacity,e.yd=void 0!==n.radius?n.radius:30,e.a1=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.a1.min>=e.a1.max&&(e.a1={max:100,min:0}),e.u1=void 0!==n.quality?n.quality:1024,e.Xh=void 0===n.isPlane||n.isPlane,e.c1=e.Xh,e.h1=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.lt=n.maxOpacity,void 0===e.lt&&(e.lt=1),void 0!==e.ft&&(e.lt=e.ft),e.dt=n.minOpacity,void 0===e.dt&&(e.dt=0),e.ht=n.blur,void 0===e.ht&&(e.ht=.85),e.f1=n.scaleRadius,void 0===e.f1&&(e.f1=!0),e.nt=n.height,void 0===e.nt&&(e.nt=1),e.Xh||(e.f1=!0),e.Ih=[],e.l1=null,e.G=null,e.d1=null,e.m1=0,e.Gm=null,e.zh=null,e.b1=void 0,e.g1=null,e._1=null,e.w1=null,e.E1=null,e.S1=null,e.T1=null,e.A1=e.A1.bind(e),e.M1=11,e.O1=22,e.L1=null,e;throw new TypeError("Cannot call a class as a function")}var t,n=s,e=Mg;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&VE(n,e),n=s,(e=[{key:"bound",get:function(){var t,n;return!0===this.needUpdateBound&&null!==this.Gm&&(this.ci.reset(),t=this.Gm.getLayers(E.MODEL_LAYER)[0],!1===this.Xh?(n=this.Gm.getLayers(E.EXTENT_LAYER)[0],t&&this.ci.expand(t.bound),n&&this.ci.expand(n.bound)):t&&this.ci.expand(t.bound),this.needUpdateBound=!1),this.ci.clone()}},{key:"x",get:function(){return this.xt}},{key:"y",get:function(){return this.Et}},{key:"height",get:function(){return this.nt},set:function(t){this.c1&&(this.nt=t,this.W0())}},{key:"opacity",get:function(){return this.ft},set:function(t){this.ft=t,this.lt=this.ft,this.g1&&this.g1.configure({radius:this.yd,valueRange:this.a1,maxOpacity:this.lt,minOpacity:this.dt,gradient:this.h1,blur:this.ht})}},{key:"valueRange",get:function(){return this.a1},set:function(t){void 0!==t.max&&(this.a1.max=t.max),void 0!==t.min&&(this.a1.min=t.min),this.a1.min>=this.a1.max&&(this.a1={max:100,min:0})}},{key:"level",get:function(){return this.Gm.level}},{key:"visible",get:function(){return GE(XE(s.prototype),"visible",this)},set:function(t){if(this.$t!==t){var n=XE(s.prototype),e=t,i=!0;if(!UE(n,"visible",e,this||n)&&i)throw new TypeError("failed to set property");this.Xh?this.$t&&this.R1()&&(this.Ih.length=0,this.N1(),this.update()):(t?this.jn.Vh(this.zh):this.jn.Vh(null),this._n.enableUpdateRender())}}},{key:"simulate",value:function(t){this.m1=t}},{key:"clearDataSource",value:function(){this.G=null,this.Ih=[]}},{key:"addPoint",value:function(t,n,e){var i;t&&n&&e&&(i=this.Gm.getLayers(E.EXTENT_LAYER)[0].bound,t=this.P1(t,n,i))&&(t.x=Math.round(t.x),t.y=Math.round(t.y),t.value=e,t.radius=this.yd,this.Ih.push(t))}},{key:"addDataSource",value:function(t){this.G=t,this.Ih=[]}},{key:"update",value:function(){var t;0===this.Ih.length&&null!=this.G&&(t=(t=this.Gm.getExtendByCoords(this.G[0]))||this.Gm.getLayers(E.EXTENT_LAYER)[0],this.f1?this.F1(t.bound):this.N1()),this.g1.setData({max:this.a1.max,min:this.a1.min,data:this.Ih}),this.j1(),this.Xh?this.f1?(t=this.Rt.material.map,this.Rt.material.map=this.zh,this.Rt.material.map.needsUpdate=!0,this.Rt.material.needsUpdate=!0,t.dispose()):this.I1():this.jn.Vh(this.zh),this._n.enableUpdateRender()}},{key:"addTo",value:function(t){this.Gm=t;var n=null;if(null===this.G)n=this.Gm.getLayers(E.EXTENT_LAYER)[0].Lt[0];else{for(var e=[],i=(n=(n=this.Gm.getExtendByCoords(this.G[0]))||this.Gm.getLayers(E.EXTENT_LAYER)[0].Lt[0]).G.gi[0],r=0;r<this.G.length;r++)z.Me(this.G[r],i,i.length)&&e.push(this.G[r]);this.G=e}var o=n.bound,o=(this._1=n.bound,this.w1=n,st.a.environment===B.a.WX?this.d1=j2.textureCanvas[0]:this.d1=document.createElement("canvas"),0!=this.m1&&this.C1(this.m1),null!=this.G&&(this.f1?(this.l1=this.D1(o),this.d1.width=this.l1.width,this.d1.height=this.l1.height,this.F1(o)):(n=this.U1(),this.B1(n),this.T1=this.D1(this.E1),st.a.environment===B.a.WX?this.S1=j2.textureCanvas[0]:this.S1=document.createElement("canvas"),this.S1.width=this.T1.width,this.S1.height=this.T1.height,this.F1(this.E1,n))),{radius:this.yd,valueRange:this.a1,maxOpacity:this.lt,minOpacity:this.dt,gradient:this.h1,blur:this.ht});this.f1?o.canvas=this.d1:o.canvas=this.S1,st.a.environment==B.a.WX?this.g1=jE.a.create(o):this.g1=FE.a.create(o),null!==this.G&&this.g1.setData({max:this.a1.max,min:this.a1.min,data:this.Ih}),GE(XE(s.prototype),"addTo",this).call(this,t),this.needUpdateBound=!0}},{key:"remove",value:function(){this.f1||(this._n.off("zoom",this.A1),this._n.off("levelChanged",this.A1),this._n.off("visibleLevelsLoaded",this.A1),this._n.off("move",this.A1),this._n.off("viewChanged",this.A1),this._n.off("resize",this.A1)),GE(XE(s.prototype),"remove",this).call(this)}},{key:"dispose",value:function(){GE(XE(s.prototype),"dispose",this).call(this),this.Gm=null,this.zh&&this.zh.dispose(),this.zh=null}}])&&CE(n.prototype,e),t&&CE(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}(),Object.assign(e.prototype,{j1:function(){var t,n,e=this;st.a.environment===B.a.WX?(this.f1||this.H1(),t=this.d1.toDataURL("image/png"),this.zh?this.image&&(this.image.crossOrigin="Anonymous",this.image.onload=function(){e.zh.image=e.image,e._n.enableUpdateRender()},this.image.src=t):(n=new l,(this.zh=n).minFilter=Wn,st.a.textureHelper.createImage({url:t,onload:function(t){e.zh.image=t,e.zh.needsUpdate=!0,e.image=t,e._n.enableUpdateRender()}}))):(this.f1||this.H1(),this.zh=new l(this.X1(this.d1)))},V1:function(){var t=new Ia(16777215);return t.opacity=1,t.transparent=!0,t.map=this.zh,t.map&&(t.map.needsUpdate=!0),t.depthTest=!1,t.needsUpdate=!0,t},ec:function(){if(!this.kh){var t,n,e=(null!==this.G&&this.Gm.getExtendByCoords(this.G[0])||this.Gm.getLayers(E.EXTENT_LAYER)[0].Lt[0]).Rt;if(e)if(this.zh=null,this.j1(),this.Xh)this.f1?(t=e.userData,e.userData={},n=e.clone(),e.userData=t,n.name="heatMap",n.scale.z=.001,n.position.y+=this.nt,e=this.V1(),n.material=e,this.Rt=n,this.Rt.mapNode=this):this.I1(),this.kh=!0;else{this.kh=!0;for(var i=this.Gm.getModelMeshs(),r=0;r<i.length;r++)if(i[r]){this.kh=!0;break}}this.gr(p).enableUpdateRender(),this.f1||(this._n.on("zoom",this.A1),this._n.on("levelChanged",this.A1),this._n.on("visibleLevelsLoaded",this.A1),this._n.on("move",this.A1),this._n.on("viewChanged",this.A1),this._n.on("resize",this.A1))}return this.kh},H1:function(){var t,n,e;this.Xh?this.d1=this.S1:(this.l1=this.D1(this._1),n=this.l1.width,e=this.l1.height,this.d1.width=n,this.d1.height=e,(t=this.d1.getContext("2d")).clearRect(0,0,n,e),n=(this.E1.min.x-this._1.min.x)/(this._1.max.x-this._1.min.x)*n,e=(this._1.max.y-this.E1.max.y)/(this._1.max.y-this._1.min.y)*e,t.drawImage(this.S1,n,e,+this.S1.width,+this.S1.height))},W0:function(){this.Rt.position.y=this.nt,this.gr(p).enableUpdateRender()},P1:function(t,n,e){t={x:(t-e.min.x)/(e.max.x-e.min.x),y:(e.max.y-n)/(e.max.y-e.min.y)};return this.f1?(t.x=t.x*this.l1.width,t.y=t.y*this.l1.height):(t.x=t.x*this.T1.width,t.y=t.y*this.T1.height),t},z1:function(){var t,n;return st.a.environment===B.a.WX?[t=st.a.window.screenWidth/2.54,t]:(t=[],void 0!==window.screen.deviceXDPI?(t[0]=window.screen.deviceXDPI,t[1]=window.screen.deviceYDPI):((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[0]=parseInt(n.offsetWidth),t[1]=parseInt(n.offsetHeight),n.parentNode.removeChild(n)),t)},D1:function(t){var n,e=t.max.x-t.min.x,t=t.max.y-t.min.y,i=null;return this.f1?(i={width:Math.round(e),height:Math.round(t)},n=this.z1(),i.width=parseInt(i.width*n[0]/25.4),i.height=parseInt(i.height*n[1]/25.4),n=1,(i.width>=this.u1||i.height>=this.u1)&&(i.width>=i.height?(n=i.height/i.width,i.width=this.u1,i.height=parseInt(this.u1*n)):(n=i.width/i.height,i.height=this.u1,i.width=parseInt(this.u1*n)))):(n=this.W1(),i={width:Math.round(e/n),height:Math.round(t/n)}),i},X1:function(t){var n=St.floorPowerOfTwo(t.width),e=St.floorPowerOfTwo(t.height),i=(this.f1||(e<n?4096<n&&(i=n/4096,n=4096,e/=i):4096<e&&(i=e/4096,e=4096,n/=i)),void 0===this.b1&&(this.b1=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),this.b1.width=n,this.b1.height=e,this.b1.getContext("2d"));return void 0!==this.fm&&(i.fillStyle=this.fm,i.fillRect(0,0,n,e)),i.drawImage(t,0,0,n,e),this.b1},F1:function(t,n){for(var e=null,e=n||this.G,i=0;i<e.length;i++){var r,o=this.P1(e[i].x,e[i].y,t);if(!o)return!0;o.x=Math.round(o.x),o.y=Math.round(o.y),o.value=e[i].value,this.f1?(r=this.l1.width/this._1.size.x,o.radius=this.yd*r):o.radius=this.yd,this.Ih.push(o)}},C1:function(t){this.G=[];for(var n=this.w1.G.gi[0];this.G.length<t;){var e=Math.floor(this._1.min.x+Math.random()*this._1.size.x+1),i=Math.floor(this._1.min.y+Math.random()*this._1.size.y+1),r=this.a1.min+Math.floor(Math.random()*(this.a1.max-this.a1.min)+1);z.Me({x:e,y:i},n,n.length)&&this.G.push({x:e,y:i,value:r})}},A1:function(){this.kh&&null!==this.G&&this.$t&&this.R1()&&(this.Ih.length=0,this.N1(),this.update())},R1:function(){for(var t=!1,n=Array.from(this._n.getRenderManager().getRenderList().keys()),e=this.Gm.parent,i=0;i<n.length;i++){var r=n[i].split("%A%B%C%D");if(""+r[0]==""+e.buildingID&&""+r[1]==""+this.Gm.level){t=!0;break}}return t},N1:function(){var t=this.U1();this.B1(t),this.T1=this.D1(this.E1),this.F1(this.E1,t),this.g1.gt.setDimensions(this.T1.width,this.T1.height)},B1:function(t){this.E1=new Ii;for(var n=null,e=null,i=null,r=null,o=this.W1()*this.yd,s=0;s<t.length;s++)(null===n||n>t[s].x)&&(n=t[s].x),(null===e||e>t[s].y)&&(e=t[s].y),(null===i||i<t[s].x)&&(i=t[s].x),(null===r||r<t[s].y)&&(r=t[s].y);this.E1.expandByCoords([{x:n-o,y:e-o},{x:n-o,y:r+o},{x:i+o,y:r+o},{x:i+o,y:e-o}])},U1:function(){for(var t=[],n=this.G,e=this.W1()*this.yd,i=0;i<n.length;i++)for(var r=E1.circleBuilder(e,n[i],32),o=0;o<r.length;o++)if(this.Y1(r[o])){t.push(n[i]);break}return t},Y1:function(t){var t=new Tt(t.x-this._n.x,this.Gm.height,this._n.y-t.y),n=this._n.camera,t=t.applyMatrix4(n.matrixWorldInverse).applyMatrix4(n.projectionMatrix);return!(1<Math.abs(t.x)||1<Math.abs(t.y)||1<Math.abs(t.z))},W1:function(){var t={x:st.a.document.body.clientWidth/2,y:st.a.document.body.clientHeight/2,z:this.Gm.height+this.nt,buildingID:this.Gm.parent.buildingID},n={x:t.x+1,y:t.y,z:this.Gm.height+this.nt,buildingID:this.Gm.parent.buildingID},t=pr.coordsScreenToMap(this._n,t),n=pr.coordsScreenToMap(this._n,n),t=Math.sqrt((t.x-n.x)*(t.x-n.x)+(t.y-n.y)*(t.y-n.y));return this._n.getZoom()<this.M1?76.43745851702988:t},I1:function(t){this.Rt&&this.Rt.parent&&(this.Rt.parent.remove(this.Rt),null!=(n=this.Rt.material.map)&&n.dispose(),this.Rt.geometry.dispose(),this.Rt.geometry=void 0,this.Rt.material.dispose(),this.Rt.material=void 0,this.Rt=void 0);var n=!1;t||(t=this.E1,n=!0);var e=new $a(new ma(t.size.x,t.size.y,1,1),void 0),t=(e.name="heatMap",e.position.y=this.nt,e.position.x=t.center.x-this._n.x,e.position.z=-t.center.y+this._n.y,e.rotation.set(-Math.PI/2,0,0,"XYZ"),this.V1());null!==this.L1&&(t.clippingPlanes=this.L1,t.clipping=!0),e.material=t,this.Rt=e,this.Rt.mapNode=this,n&&this.jn.scene.add(this.Rt)},Q1:function(t){for(var n=[],e=[],i=0;i<t.length;i++)n.push({x:t[i].x,y:t[i].y});z.isClockwise(n[0],n[1],n[2])||(n=n.reverse());for(var r=0;r<n.length-1;r++){var o=n[r],s=n[r+1],a=(o.x+s.x)/2-this._n.x,u=-(o.y+s.y)/2+this._n.y,o=Cy(z.getAngle({p1:o,p2:s}),{x:a,y:0,z:u},this),s=new Ht,a=new Tt,u=new Tt;a.set(0,0,1).applyQuaternion(o.quaternion),u.copy(o.position),s.setFromNormalAndCoplanarPoint(a,u),e.push(s),o.parent.remove(o)}return e}}),ev=e;function zE(t){return(zE="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 WE(t,n){var e,i,r,o,s="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(s)return i=!(e=!0),{s:function(){s=s.call(t)},n:function(){var t=s.next();return e=t.done,t},e:function(t){i=!0,r=t},f:function(){try{e||null==s.return||s.return()}finally{if(i)throw r}}};if(Array.isArray(t)||(s=function(t,n){var e;if(t)return"string"==typeof t?YE(t,n):"Map"===(e="Object"===(e=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?YE(t,n):void 0}(t))||n&&t&&"number"==typeof t.length)return s&&(t=s),o=0,{s:n=function(){},n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},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.")}function YE(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 QE(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,function(t){t=function(t,n){if("object"!=zE(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=zE(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==zE(t)?t:t+""}(i.key),i)}}function ZE(t,n,e){n=JE(n);var i=t,n=qE()?Reflect.construct(n,e||[],JE(t).constructor):n.apply(t,e);if(n&&("object"===zE(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function qE(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(qE=function(){return!!t})()}function KE(){return(KE="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,n,e){var i=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=JE(t)););return t}(t,n);if(i)return(i=Object.getOwnPropertyDescriptor(i,n)).get?i.get.call(arguments.length<3?t:e):i.value}).apply(this,arguments)}function JE(t){return(JE=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function $E(t,n){return($E=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}tv=function(){function e(t){var n;if(this instanceof e)return(n=ZE(this,e,[t])).bi=E.DYNAMIC_MODEL_MARKER,n.yi=void 0!==t.id?t.id:St.generateUUID(),n.Z1=St.generateUUID(),n.e0=void 0!==t.fadeIn&&t.fadeIn,n.af=void 0!==t.fadeOut&&t.fadeOut,n.ft=void 0!==t.opacity?t.opacity:null,n.q1=void 0!==t.scale?t.scale:1,n.K1=t.tilt,n.vf=t.url,n.nv=t.heading,n.Vn=t.callback,n.J1=new Map,n.J1.set(n.ROOT,t.color),n.gf=null,n.rl=[],n.a0=null,n.u0=null,n.t0=n.t0.bind(n),n;throw new TypeError("Cannot call a class as a function")}var t,n=e,i=Ax;if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");return n.prototype=Object.create(i&&i.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),i&&$E(n,i),n=e,(i=[{key:"FID",get:function(){return this.Z1}},{key:"color",get:function(){return this.getModelColor()},set:function(t){this.modifyModelColor(t)}},{key:"scale",get:function(){return this.q1},set:function(t){this.q1=t,this.Wo()}},{key:"tilt",get:function(){return this.K1}},{key:"heading",get:function(){return this.nv}},{key:"opacity",get:function(){return this.ft},set:function(t){this.ft=t,this.yf()}},{key:"modifyModelColor",value:function(t,n){n=n||this.ROOT,this.J1.set(n,t),this.yf()}},{key:"getModelColor",value:function(t){return t=t||this.ROOT,this.J1.get(t)}},{key:"rotateTo",value:function(t){var n,e,i,r,o=this,s=this.gr(p);return!!s&&(n=t.heading%360*u.DEG2RAD,t.animate?(e=t.duration||.5,i=this.Rt.rotation.y,this.Ei.has("rotation")?r=this.Ei.get("rotation"):(r=new Pr,this.Ei.set("rotation",r)),r.Qn([i]).Zn([n]).qn(e).Jn(function(t){o.Rt.rotation.y=t.destination[0],o.nv=t.destination[0]*u.RAD2DEG,s.enableUpdateRender()}).$n(function(){o.Rt.rotation.y=n,o.nv=n*u.RAD2DEG,s.enableUpdateRender(),t.finish&&t.finish()}),s.nr.Ki(r.Wn())):(this.Rt.rotation.y=n,this.nv=t.heading,s.enableUpdateRender(),t.finish&&t.finish()),this.Ei.get("rotation"))}},{key:"startAction",value:function(t,n){var e=this.rl[t],n=(e&&(n&&(e.clampWhenFinished=!0,e.loop=2200),this.a0&&this.a0===t?(e.time=this.u0,e.paused=!1,e.play(),this.a0=null,this.u0=null):(this.a0!==t&&(this.a0=null,this.u0=null),e.reset().setEffectiveTimeScale(1).setEffectiveWeight(1).play())),this.gr(p));n&&n.on("beforeRender",this.t0)}},{key:"getAction",value:function(){return this.rl}},{key:"getClip",value:function(t){return this.rl[t]._f}},{key:"getMixer",value:function(){return this.gf}},{key:"stopAction",value:function(t){var n=this.gr(p),n=(n&&n.off("beforeRender",this.t0),this.rl[t]);n&&(n.paused=!0,this.a0=t,this.u0=n.time)}},{key:"getActionNames",value:function(){return Object.keys(this.rl)}},{key:"remove",value:function(){this.stop(),this.Rt&&this.Rt.bloom&&this.Rt.bloom.remove(this);var t,n=this.gr(p);n&&this.gf&&n.nr.R0(this.gf),n&&(t=this.J1.get(this.ROOT),this.ty(this.Rt,t,function(t){n.Pt.io.wu(t,t.material)})),KE(JE(e.prototype),"remove",this).call(this)}},{key:"dispose",value:function(){KE(JE(e.prototype),"dispose",this).call(this),this.remove(),this.Rt&&(this.Rt.mapNode=void 0,this.Rt=void 0),this.kh=!1,this.ny()}},{key:"getRenderNode",value:function(){return this.Rt}}])&&QE(n.prototype,i),t&&QE(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}(),Object.assign(tv.prototype,{ROOT:"root",ec:function(){var r,o=this;if(!this.kh)return!!(r=this.gr(p))&&(this.kh=!0,r.Pt.Vv.Na(this.vf,function(t){if(o.kh){if(o.Rt=t.scene,o.Rt.visible=o.$t,o.nv&&(o.Rt.rotation.y=o.nv%360*u.DEG2RAD),o.K1&&(o.Rt.rotation.x=o.K1%360*u.DEG2RAD),o.Wo(),(o.Rt.mapNode=o).jn.Do.add(o.Rt),0<t.animations.length){o.gf=new Fb(o.Rt);var n,e=WE(t.animations);try{for(e.s();!(n=e.n()).done;){var i=n.value;o.rl[i.name]=o.gf.clipAction(i)}}catch(t){e.e(t)}finally{e.f()}r.nr.S0(o.gf)}o.yf(),o.W0(),o.e0&&o.uf({src:[0],dest:[1],duration:1}),r.enableUpdateRender(),o.Vn&&o.Vn(o)}},function(){}),!0)},uf:function(t){var n,i=this,r=this.gr(p);r&&(n=new Pr({src:t.src||[0],dest:t.dest||[1]}),this.Ei.set("faceIn",n),n.qn(t.duration||1).Jn(function(t){var e=t.destination[0];i.Rt.traverse(function(t){var n;t instanceof $a&&(t.material.transparent=!0,n=t.material.userData.sourceOpacity,r.getMapOptions().materialMode===ds.REAL?t.material.uniforms.opacity.value=n*e:t.material.opacity=n*e,r.enableUpdateRender())})}).$n(function(){t.callback&&t.callback(),r.nr.tr(n),r.enableUpdateNode()}).Wn(),r.nr.Ki(n))},Wo:function(){if(this.Rt){var t=this.gr(p);if(!t)return!1;this.Rt.scale.copy(this.Rt.userData.sourceScale).multiplyScalar(this.q1),t.enableUpdateRender()}},yf:function(){var r,o,t,s=this;this.Rt&&(r=this.gr(p),o=this.gr(v),t=this.J1.get(this.ROOT),this.ty(this.Rt,t,function(t,n){var e=s.no(t.material,o,{color:n});if(r.Oi.materialMode===ds.REAL){n=r.Pt.io.eo(e);n.userData=t.material.userData,t.material=n,r.Pt.io._u(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.Pt.io.ro(t.material[i],e);else t.material.depthWrite=!0,t.material=r.Pt.io.ro(t.material,e)}),r.enableUpdateRender())},ty:function(t,n,e){var i=this.J1.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.ty(t.children[r],n,e)},no:function(t,n,e){var i={};return this.gr(p).Oi.materialMode===ds.REAL?t.constructor===Q0?(t.userData.sourceOpacity=t.opacity,t.userData.sourceTransparent=t.transparent,i={alphaTest:t.alphaTest,color:t.color.getHex(),USE_EMISSIVEMAP:!!t.emissiveMap,USE_METALNESSMAP:!!t.metalnessMap,USE_NORMALMAP:!!t.normalMap,TANGENTSPACE_NORMALMAP:!!t.normalMap,USE_ROUGHNESSMAP:!!t.roughnessMap,USE_MAP:!!t.map,USE_AOMAP:!!t.aoMap,map:r(t.map,null),aoMap:r(t.aoMap,null),emissive:t.emissive.getHex(),emissiveMap:r(t.emissiveMap,null),metalness:r(t.metalness,0),metalnessMap:r(t.metalnessMap,null),roughness:r(t.roughness,1),roughnessMap:r(t.roughnessMap,null),normalScale:r(t.normalScale,new Mt(1,1)),normalMap:r(t.normalMap,null),vertexColors:t.vertexColors,side:t.side,skinning:t.skinning}):t.constructor===y0&&(i={USE_EMISSIVEMAP:t.defines.USE_EMISSIVEMAP,USE_MAP:t.defines.USE_MAP,USE_AOMAP:t.defines.USE_AOMAP,USE_METALNESSMAP:t.defines.USE_METALNESSMAP,USE_NORMALMAP:t.defines.USE_NORMALMAP,TANGENTSPACE_NORMALMAP:t.defines.TANGENTSPACE_NORMALMAP,USE_ROUGHNESSMAP:t.defines.USE_ROUGHNESSMAP,aoMap:r(t.uniforms.aoMap.value,null),map:r(t.uniforms.map.value,null),color:t.uniforms.diffuse.value.getHex(),emissive:t.uniforms.emissive.value.getHex(),emissiveMap:r(t.uniforms.emissiveMap.value,null),metalness:r(t.uniforms.metalness.value,0),metalnessMap:r(t.uniforms.metalnessMap.value,null),roughness:r(t.uniforms.roughness.value,1),roughnessMap:r(t.uniforms.roughnessMap.value,null),normalScale:r(t.uniforms.normalScale.value,new Mt(1,1)),normalMap:r(t.uniforms.normalMap.value,null),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.ft?this.ft*n.ft:void 0!==t.userData.sourceOpacity?t.userData.sourceOpacity*n.ft:t.opacity*n.ft,i.transparent=t.userData.sourceTransparent||i.opacity<1,i;function r(t,n){return void 0!==t?t:n}},t0:function(){var t=this.gr(p);t&&t.enableUpdateRender()},ey:function(t){if(t._interpolant&&(t._interpolant.length=0),t.Ef){for(var n=0;n<t.Ef.length;n++)t.Ef[n].parameterPositions=null,t.Ef[n].resultBuffer=null,t.Ef[n].sampleValues=null,t.Ef[n]=null;t.Ef=null}if(t.Sf){for(var e=0;e<t.Sf.length;e++)t.Sf[e].binding=null,t.Sf[e].buffer=null,t.Sf[e]=null;t.Sf=null}if(t._f&&t._f.tracks&&t._f.tracks){for(var i=0;i<t._f.tracks.length;i++)t._f.tracks[i].times=null,t._f.tracks[i].values=null,t._f.tracks[i]=null;t._f.tracks=null,t._f=null}},ny:function(){for(var t in this.rl)this.ey(this.rl[t]),this.rl[t]=null;if(this.rl=[],this.gf){for(var n=0;n<this.gf.Hc.length;n++)this.gf.Hc[n].buffer=null;this.gf.Hc=null,this.gf.qf=null,this.gf.cs=null,this.gf.stats=null,this.gf.Jf=null,this.gf.rl=null,this.gf=null}}}),nv=tv;function tS(t){return(tS="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 nS(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,function(t){t=function(t,n){if("object"!=tS(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=tS(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==tS(t)?t:t+""}(i.key),i)}}function eS(t,n,e){n=rS(n);var i=t,n=iS()?Reflect.construct(n,e||[],rS(t).constructor):n.apply(t,e);if(n&&("object"===tS(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function iS(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(iS=function(){return!!t})()}function rS(t){return(rS=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function oS(t,n){return(oS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}Ly=function(){function e(t){var n;if(this instanceof e)return(n=eS(this,e,[t])).yi=null,n.bi=E.DOM_MARKER,n.iy=void 0!==t.fontsize?t.fontsize:16,n.oy=t.content,n.sy=t.domWidth,n.uy=t.domHeight,n.Zm=void 0!==t.anchor?t.anchor:yr.CENTER,n.ft=void 0!==t.opacity?t.opacity:1,n.qo=void 0!==t.collision&&t.collision,n.xm=!1,n.Rt=null,n.kh=!1,n.Rr=null,n.Z0=null,n.Gm=null,n.hy=null,n.ly=n.ly.bind(n),n.Wh=null,n.ec(),n;throw new TypeError("Cannot call a class as a function")}var t,n=e,i=Ax;if("function"!=typeof i&&null!==i)throw new TypeError("Super expression must either be null or a function");return n.prototype=Object.create(i&&i.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),i&&oS(n,i),n=e,(i=[{key:"isInputElement",get:function(){for(var t=["input","textarea"],n=!1,e=0;e<t.length;e++)if(0<=this.Rt.element.childNodes[0].innerHTML.toLocaleLowerCase().indexOf(t[e])){n=!0;break}return n}},{key:"content",get:function(){return this.oy},set:function(t){this.oy=t,"string"==typeof this.oy?this.Rt.element.childNodes[0].innerHTML=""+this.oy:this.Rt.element.childNodes[0].appendChild(this.oy)}},{key:"visible",get:function(){return this.$t},set:function(t){this.$t=t,this.Rt&&(this.$t?this.Rt.element.childNodes[0].style.display="block":this.Rt.element.childNodes[0].style.display="none")}},{key:"opacity",get:function(){return this.ft},set:function(t){this.ft=t,this.Rt.element.childNodes[0].style.opacity=this.ft}},{key:"level",get:function(){return this.Rr}},{key:"remove",value:function(){this.stop(),this.isInputElement&&(this.Gm.jn.jn.getInteracations().controls.enabled=!0),this.Wh.remove(this),this.jn&&this.jn.remove(this),this.Rt.parent.remove(this.Rt),this.jn=void 0}},{key:"addTo",value:function(t){var n,e=t.jn.jn,i=(null===e.rn.gt&&e.rn.ec(),this.Rr=t.level,this.Gm=t,this.Z0=t.parent.buildingID,this.Rt.position.set(this.xt-e.x,t.height+this.nt,-this.Et+e.y),e.getBuilding(""+t.parent.buildingID));t.level!==i.level&&(e.rn.Dl(this.Rr,""+t.parent.buildingID)?this.Rt.element.childNodes[0].style.opacity=t.ft:this.Rt.element.childNodes[0].style.display="none"),e.rn.add(this),this.Wh=t.getOrCreateLayer(this.bi),this.Wh.add(this),this.isInputElement&&(n=null,this.vy=function(){n=e.getInteracations().controls.enabled,e.getInteracations().controls.enabled=!1,e.getInteracations().controls.resetState()},this.py=function(){null!==n&&(e.getInteracations().controls.enabled=n,e.getInteracations().controls.resetState(),n=null)},this.Rt.element.childNodes[0].addEventListener("mouseenter",this.vy),this.Rt.element.childNodes[0].addEventListener("mouseleave",this.py))}},{key:"dispose",value:function(){this.remove(),this.Rt&&(this.isInputElement&&(this.Rt.element.childNodes[0].removeEventListener("mouseenter",this.vy),this.Rt.element.childNodes[0].removeEventListener("mouseleave",this.py)),this.Rt.mapNode=void 0,this.Rt=void 0),this.kh=!1}},{key:"getRenderNode",value:function(){return this.Rt}}])&&nS(n.prototype,i),t&&nS(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}(),Object.assign(Ly.prototype,{ec:function(){var t=document.createElement("div"),n=document.createElement("div"),e=(n.style.position="absolute",!(n.style.pointerEvents="all")),i=(void 0===this.sy||void 0===this.uy?e=!0:(n.style.width=this.sy+"px",n.style.height=this.uy+"px"),n.style.fontSize=this.iy+"px",n.style.opacity=this.ft,e||(i=this.my(),n.style.top=i.top,n.style.left=i.left),"string"==typeof this.oy?n.innerHTML=this.oy:n.appendChild(this.oy),t.appendChild(n),new nx(t));return this.Rt=i,(this.Rt.mapNode=this).kh=!0,this.yi=this.Rt.uuid,e&&this.gm(),!0},gm:function(){var e=this,i=null,r=document.createElement("div"),o=this.Rt.element.childNodes[0];r.style.position="absolute",void 0===this.sy?r.style.width="fit-content":r.style.width=this.sy+"px",void 0===this.uy?r.style.height="fit-content":r.style.height=this.uy+"px",r.style.fontSize=this.iy+"px",r.innerHTML=o.innerHTML,document.body.appendChild(r),function t(){{var n;r.parentNode?(null!==i&&clearTimeout(i),n=r.getBoundingClientRect(),e.sy=n.width,e.uy=n.height,n=e.my(),o.style.width=e.sy+"px",o.style.height=e.uy+"px",o.style.top=n.top,o.style.left=n.left,r.parentNode.removeChild(r)):i=setTimeout(t(),1)}}()},my:function(){var t,n;switch(this.Zm){case yr.CENTER:t=-this.sy/2,n=-this.uy/2;break;case yr.RIGHT_BOTTOM:t=-this.sy,n=-this.uy;break;case yr.LEFT_BOTTOM:t=0,n=-this.uy;break;case yr.RIGHT_TOP:t=-this.sy,n=0;break;case yr.LEFT_TOP:n=t=0;break;case yr.RIGHT:t=-this.sy,n=-this.uy/2;break;case yr.LEFT:t=0,n=-this.uy/2;break;case yr.BOTTOM:t=-this.sy/2,n=-this.uy;break;case yr.TOP:t=-this.sy/2,n=0}return this.hy={left:t,top:n},{left:t+"px",top:n+"px"}},wm:function(){var t=this.jn.jn;if(!this.hy)return null;var n=t.camera;this.Rt.updateMatrixWorld(!0);var n=(new Tt).setFromMatrixPosition(this.Rt.matrixWorld).applyMatrix4(n.matrixWorldInverse).applyMatrix4(n.projectionMatrix),e=t.It.renderer.domElement.clientWidth,t=t.It.renderer.domElement.clientHeight,i=n.x,n=n.y;return{leftTop:new Mt(i-this.sy/e,n+this.uy/t),rightDown:new Mt(i+this.sy/e,n-this.uy/t)}},ly:function(t){var n,e=this.jn.jn,i={};for(n in t)i[n]=t[n];i.offsetX=t.clientX,i.offsetY=t.clientY,e.Ur.Vn(i)},yf:function(){this.Rt.element.childNodes[0].style.opacity=this.Gm.ft}}),Vy=Ly;function sS(t){return(sS="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 aS(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,function(t){t=function(t,n){if("object"!=sS(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=sS(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==sS(t)?t:t+""}(i.key),i)}}sb=function(){function n(t){if(!(this instanceof n))throw new TypeError("Cannot call a class as a function");this.yy=t.origon,this.Kh=t.target,this.by=null,this.gy=null,this._y=null,this.wy=null,this.xy=null,this.Ey=null,this.Sy=null,this.Ty=null,this.ec()}return t=n,(e=[{key:"transform",value:function(t){var n=t.x-this.by.x,t=t.y-this.by.y,e=this.gy.x*n+this.gy.y*t,n=this._y.x*n+this._y.y*t,t=e/this.wy.x,e=n/this.wy.y,n=t*this.Ty.x,t=e*this.Ty.y;return{x:this.xy.x+this.Ey.x*n+this.Sy.x*t,y:this.xy.y+this.Ey.y*n+this.Sy.y*t}}}])&&aS(t.prototype,e),i&&aS(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,i}(),Object.assign(sb.prototype,{ec:function(){!Array.isArray(this.yy)||!Array.isArray(this.Kh)||this.yy.length<3||this.Kh.length<3||(this.by=this.yy[0],this.gy={x:this.yy[1].x-this.yy[0].x,y:this.yy[1].y-this.yy[0].y},this._y={x:this.yy[2].x-this.yy[0].x,y:this.yy[2].y-this.yy[0].y},this.wy={x:z.ze(this.gy),y:z.ze(this._y)},this.xy=this.Kh[0],this.Ey={x:this.Kh[1].x-this.Kh[0].x,y:this.Kh[1].y-this.Kh[0].y},this.Sy={x:this.Kh[2].x-this.Kh[0].x,y:this.Kh[2].y-this.Kh[0].y},this.Ty={x:z.ze(this.Ey),y:z.ze(this.Sy)},this.gy.x/=this.wy.x,this.gy.y/=this.wy.x,this._y.x/=this.wy.y,this._y.y/=this.wy.y,this.Ey.x/=this.Ty.x,this.Ey.y/=this.Ty.x,this.Sy.x/=this.Ty.y,this.Sy.y/=this.Ty.y)}}),t2=sb;function uS(t){return(uS="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 cS(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,function(t){t=function(t,n){if("object"!=uS(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=uS(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==uS(t)?t:t+""}(i.key),i)}}var v2=function(){function n(t){if(!(this instanceof n))throw new TypeError("Cannot call a class as a function");this.Ih=t.points,this.e1=t.extrudeHeight,this.nt=t.height,this.Ay=t.types,void 0===this.Ay&&(this.Ay=[E.EXTENT_LAYER,E.FACILITY_LAYER,E.LABEL_LAYER,E.MODEL_LAYER,E.EXTERNAL_MODEL_LAYER]),this.$r=t.showRegion,void 0===this.$r&&(this.$r="inside"),this.Gm=null,this._n=null,this.ci=new Ii,this.My=[],this.Jl=void 0,this.ft=void 0}return t=n,(e=[{key:"points",get:function(){return this.Ih},set:function(t){this.Ih=t,this.remove(),this.addTo(this.Gm)}},{key:"types",get:function(){return this.Ay}},{key:"showRegion",get:function(){return this.$r},set:function(t){this.$r=t,this.remove(),this.addTo(this.Gm)}},{key:"addTo",value:function(t){this.ci.reset(),this.ci.expandByCoords(this.Ih),this.Gm=t,this._n=t.parent.parent,this._n.getRenderManager().renderer.localClippingEnabled=!0,this.ec()}},{key:"remove",value:function(){for(var o=this,t=function(){for(var r=o.Gm.getLayers(o.Ay[s])[0],t=0;t<r.children.length;t++)!function(e){if(""+o.Ay[s]==""+E.FACILITY_LAYER||""+o.Ay[s]==""+E.LABEL_LAYER)r.children[e].visible=!0;else if(""+o.Ay[s]==""+E.EXTENT_LAYER||""+o.Ay[s]==""+E.MODEL_LAYER){if(""+o.Ay[s]==""+E.MODEL_LAYER&&(r.children[e].Kr=null,r.children[e].$r=null,r.children[e].s0=!1),r.children[e].visible=!0,r.children[e].Rt){var t=r.children[e].Rt.material.clone();if(t.clippingPlanes=null,t.clipping=null,t.clipIntersection=!1,r.children[e].Rt.material.dispose(),r.children[e].Rt.material=t,""+o.Ay[s]==""+E.MODEL_LAYER)if(r.children[e].oo.top&&((t=r.children[e].oo.top).material.clippingPlanes=null,t.material.clipping=null,t.material.clipIntersection=!1),r.children[e].gh){var n=r.children[e].gh;n.material.clippingPlanes=null,n.material.clipping=null,n.material.clipIntersection=!1;for(var i=0;i<n.children.length;i++)n.children[i].material.clippingPlanes=null,n.children[i].material.clipping=null,n.children[i].material.clipIntersection=!1}}}else""+o.Ay[s]==""+E.EXTERNAL_MODEL_LAYER&&(r.children[e].visible=!0,r.children[e].Kr=null,r.children[e].$r=null,r.children[e].o0=null,r.children[e].s0=!1,r.children[e].Rt)&&r.children[e]._l&&r.children[e].Rt.traverse(function(t){var n;"Mesh"===t.type&&((n=r.children[e].Jr(t.material)).clippingPlanes=null,n.clipping=null,n.clipIntersection=!1,t.material.dispose(),t.material=n,o._n.enableUpdateNode())})}(t)},s=0;s<this.Ay.length;s++)t()}}])&&cS(t.prototype,e),i&&cS(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,i}(),x2=(Object.assign(v2.prototype,{ec:function(){z.Je(this.Ih[0],this.Ih[1],this.Ih[2])||(this.Ih=this.Ih.reverse());for(var t=this.Gm.getLayers(),n=0;n<t.length;n++)this.Dl(t[n].type)&&this.Oy(t[n].children,t[n].type)},Dl:function(t){for(var n=!1,e=0;e<this.Ay.length;e++)if(""+t==""+this.Ay[e]){n=!0;break}return n},Ly:function(t){var n=t.getBound();return{gi:[[{x:n.minX,y:n.minY},{x:n.minX,y:n.maxY},{x:n.maxX,y:n.maxY},{x:n.maxX,y:n.minY},{x:n.minX,y:n.minY}]],getBound:function(){return{min:{x:n.minX,y:n.minY},max:{x:n.maxX,y:n.maxY}}}}},Oy:function(t,n){if(n===E.FACILITY_LAYER||n===E.LABEL_LAYER)for(var e=0;e<t.length;e++)"inside"===this.$r?z.Me({x:t[e].x,y:t[e].y},this.Ih,this.Ih.length)?t[e].visible=!0:t[e].visible=!1:z.Me({x:t[e].x,y:t[e].y},this.Ih,this.Ih.length)?t[e].visible=!1:t[e].visible=!0;else if(n===E.MODEL_LAYER||n===E.EXTENT_LAYER||n===E.EXTERNAL_MODEL_LAYER){for(var i=0;i<t.length;i++){var r=null;if(n===E.MODEL_LAYER||n===E.EXTENT_LAYER)"inside"===this.$r?t[i].visible=!1:t[i].visible=!0,r=t[i].G;else{if(!t[i].Rt){t[i].o0=this;continue}"inside"===this.$r?t[i].visible=!1:t[i].visible=!0,r=this.Ly(t[i])}"all"===(r=this.di(r)).result?void 0===this.nt?"inside"===this.$r?t[i].visible=!0:t[i].visible=!1:(t[i].visible=!0,"outside"===this.$r&&this.Ry(t[i],null)):"include"===r.result?(t[i].visible=!0,this.My.push({model:t[i],lines:r.points})):"no"===r.result&&(void 0===this.nt?"inside"===this.$r&&(t[i].visible=!1):(t[i].visible=!0,"inside"===this.$r&&this.Ry(t[i],null)))}this.Ny()}},T0:function(t){var n=null,e=this.Ly(t),e=this.di(e);"all"===e.result?void 0===this.nt?"inside"===this.$r?t.visible=!0:t.visible=!1:(t.visible=!0,"outside"===this.$r&&this.Ry(t,null)):"include"===e.result?(t.visible=!0,n={model:t,lines:e.points}):"no"===e.result&&(void 0===this.nt?"inside"===this.$r&&(t.visible=!1):(t.visible=!0,"inside"===this.$r&&this.Ry(t,null))),this.Ny(n)},Ny:function(t){if(t)this.Ry(t.model,t.lines);else for(var n=0;n<this.My.length;n++)this.Ry(this.My[n].model,this.My[n].lines)},Ry:function(l,d){var v=this,i=function(){var t=[];if(null!==d)for(var n=0;n<d.length;n++){var e,i=(d[n].p1.x+d[n].p2.x)/2-v._n.x,r=-(d[n].p1.y+d[n].p2.y)/2+v._n.y,o=z.getAngle(d[n]);null!==o&&(o=Cy(o,{x:i,y:0,z:r},l),i=new Ht,r=new Tt,e=new Tt,r.set(0,0,1).applyQuaternion(o.quaternion),e.copy(o.position),i.setFromNormalAndCoplanarPoint(r,e),t.push(i),o.parent.remove(o),"outside"===v.$r)&&i.negate()}else if(l.parent.type!==E.EXTENT_LAYER){var s=[v.nt];void 0!==v.e1&&s.push(v.nt+v.e1);for(var a=0;a<s.length;a++){var u=l.x-v._n.x,c=-l.y+v._n.y,u=Cy(void 0,{x:u,y:s[a],z:c},l),c=(void 0===v.e1?u.rotation.x=-Math.PI/2:u.rotation.x=0===a?-Math.PI/2:Math.PI/2,new Ht),h=new Tt,f=new Tt;h.set(0,0,1).applyQuaternion(u.quaternion),f.copy(u.position),f.y=f.y+v.Gm.height,c.setFromNormalAndCoplanarPoint(h,f),t.push(c),u.parent.remove(u),void 0!==v.e1&&c.negate()}}return t}();if(l.Kr=i,l.$r=this.$r,null===d&&void 0!==this.nt&&void 0!==this.e1&&(l.s0=!0),l.Rt)if(l.parent.type===E.MODEL_LAYER||l.parent.type===E.EXTENT_LAYER){if(n(l.Rt),l.parent.type===E.MODEL_LAYER&&(l.oo.top&&n(l.oo.top),l.gh)){n(l.gh);for(var t=0;t<l.gh.children.length;t++)n(l.gh.children[t])}}else l._l&&l.Rt.traverse(function(t){"Mesh"===t.type&&n(t,l)});function n(t,n){var e=null;(e=n?n.Jr(t.material):t.material.clone()).clippingPlanes=i,e.clipping=!0,"outside"===v.$r&&null!==d&&(e.clipIntersection=!0),null===d&&void 0!==v.nt&&void 0!==v.e1&&(e.clipIntersection=!0),t.material.dispose(),t.material=e,v._n.enableUpdateNode()}},di:function(t){var n=t.getBound();if(!z.xe(this.ci.X,this.ci.H,n.min,n.max))return{result:"no"};for(var e=t.gi,i=!0,r=0;r<e.length;r++){for(var o=e[r],s=0;s<o.length;s++)if(!z.Me(o[s],this.Ih,this.Ih.length)){i=!1;break}if(!i)break}if(i)return{result:"all"};for(var a=[],u=!0,c=0;c<this.Ih.length;c++)for(var h=0,f=e.length;h<f;h++)z.Me(this.Ih[c],e[h],e[h].length-1)?0===c?a.push({p1:this.Ih[c],p2:this.Ih[c+1]}):a.push({p1:this.Ih[c-1],p2:this.Ih[c]}):u=!1;if(u)return a.push({p1:this.Ih[this.Ih.length-1],p2:this.Ih[0]}),{result:"include",points:a};for(var l=this.Ih.length-1,d=0;d<l;d++)for(var v=this.Ih[d],p=this.Ih[d+1],m=0,y=e.length;m<y;m++)for(var b=0,g=e[m].length-1;b<g;b++){var _=e[m][b],w=e[m][b+1];if(z.Ee(v,p,_,w)){R(v,p)&&a.push({p1:v,p2:p});break}}for(var x=this.Ih[this.Ih.length-1],E=this.Ih[0],S=0,T=e.length;S<T;S++)for(var A=0,M=e[S].length-1;A<M;A++){var O=e[S][A],L=e[S][A+1];if(z.Ee(x,E,O,L)){R(x,E)&&a.push({p1:x,p2:E});break}}return 0===a.length?{result:"no"}:{result:"include",points:a};function R(t,n){for(var e=!0,i=0;i<a.length;i++)if(t.x===a[i].p1.x&&t.y===a[i].p1.y&&n.x===a[i].p2.x&&n.y===a[i].p2.y){e=!1;break}return e}}}),v2),hS={Default:1,Legacy:2,Classic:4,Custom:8};function fS(t){return(fS="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 lS(t,n,e){return(n=vS(n))in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function dS(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,vS(i.key),i)}}function vS(t){t=function(t,n){if("object"!=fS(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=fS(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==fS(t)?t:t+""}i=function(){function e(t,n){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");this.Py=t,this.Fy=n,this.jy=lS(lS(lS({},hS.Default,{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}]}),hS.Legacy,{FMExtentLayer:[{name:"DirectionalLight",color:8947848,intensity:1.2,position:{x:-1,y:1,z:1},id:0},{name:"AmbientLight",color:7631988,intensity:1,id:1},{name:"DirectionalLight",color:3355443,intensity:1,position:{x:-.5,y:1,z:-1},id:2}],FMExternalModelLayer:[{name:"DirectionalLight",color:8947848,intensity:1.2,position:{x:-1,y:1,z:1},id:0},{name:"AmbientLight",color:16777215,intensity:.46,id:1},{name:"DirectionalLight",color:3355443,position:{x:-.5,y:1,z:-1},intensity:1,id:2}],FMModelLayer:[{name:"DirectionalLight",color:8947848,intensity:1.2,position:{x:-1,y:1,z:1},id:0},{name:"AmbientLight",color:7631988,intensity:1,id:1},{name:"DirectionalLight",color:3355443,position:{x:-.5,y:1,z:-1},intensity:1,id:2}],FMDynamicModelLayer:[{name:"DirectionalLight",color:8947848,intensity:1.2,position:{x:-1,y:1,z:1},id:0},{name:"AmbientLight",color:7631988,intensity:1,id:1},{name:"DirectionalLight",color:3355443,position:{x:-.5,y:1,z:-1},intensity:1,id:2}]}),hS.Classic,{FMExtentLayer:[{name:"DirectionalLight",color:8947848,intensity:1.2,position:{x:-1,y:1,z:1},id:0},{name:"AmbientLight",color:7631988,intensity:1,id:1},{name:"DirectionalLight",color:3355443,intensity:1,position:{x:-.5,y:1,z:-1},id:2}],FMExternalModelLayer:[{name:"DirectionalLight",color:8947848,intensity:1.2,position:{x:-1,y:1,z:1},id:0},{name:"AmbientLight",color:16777215,intensity:.46,id:1},{name:"DirectionalLight",color:3355443,position:{x:-.5,y:1,z:-1},intensity:1,id:2}],FMModelLayer:[{name:"DirectionalLight",color:8947848,intensity:1.2,position:{x:-1,y:1,z:1},id:0},{name:"AmbientLight",color:7631988,intensity:1,id:1},{name:"DirectionalLight",color:3355443,position:{x:-.5,y:1,z:-1},intensity:1,id:2}],FMDynamicModelLayer:[{name:"DirectionalLight",color:8947848,intensity:.9,position:{x:-1,y:1,z:1},id:0},{name:"AmbientLight",color:16777215,intensity:.33,id:1},{name:"DirectionalLight",color:3355443,position:{x:-.5,y:1,z:-1},intensity:1,id:2}]})}return t=e,(n=[{key:"getConfig",value:function(){return this.Py==hS.Custom?this.Fy:this.jy[this.Py]}}])&&dS(t.prototype,n),i&&dS(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,i}();function pS(t){return(pS="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 mS(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,function(t){t=function(t,n){if("object"!=pS(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=pS(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==pS(t)?t:t+""}(i.key),i)}}Fw=function(){function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");this._n=null,this.Ct={},this.Cn=(new Date).getTime(),this.Xn=this.Xn.bind(this)}return n=t,(e=[{key:"replace",value:function(t,n,e){this.getTextureNames(t).indexOf(n)<0?console.warn(n+"不是一个包含视频或gif的纹理,无法替换"):(this.Iy(t.FID,n),0<=e.indexOf(".mp4")||0<=e.indexOf(".webm")||0<=e.indexOf(".ogg")?this.Nl(e,t,n):0<=e.indexOf(".gif")?this.xl(e,t,n):(0<=e.indexOf(".jpg")||0<=e.indexOf(".png"))&&this.Cy(e,t,n),t.multiMediaTool.replace(n),null===this._n&&(this._n=t.parent.parent.parent.parent,this._n.on("update",this.Xn)))}},{key:"reset",value:function(t,n){this.Iy(t.FID,n),t.multiMediaTool.reset(n)}},{key:"dispose",value:function(){for(var t in this.Ct){var n=t.split("_");this.reset(this.Ct[t].externalModel,n[1])}this._n.off("update",this.Xn)}},{key:"getTextureNames",value:function(t){return t.multiMediaTool.textureNames}}])&&mS(n.prototype,e),i&&mS(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,e,i}(),Object.assign(Fw.prototype,{Iy:function(t,n){var e=this.Ct[t+"_"+n];if(e&&"video"===e.type)document.getElementById(e.texture.video_id).parentNode.removeChild(document.getElementById(e.texture.video_id)),e.texture.dispose();else if(e&&"gif"===e.type)for(var i=0;i<e.canvasArray.length;i++)e.canvasArray[i].getContext("2d").clearRect(0,0,e.canvasArray[i].width,e.canvasArray[i].height);delete this.Ct[t+"_"+n]},Cy:function(t,n,e){var i=this,r=new Image;r.crossOrigin="Anonymous",r.onload=function(){var t=document.createElement("canvas");t.width=512,t.height=512,t.getContext("2d").drawImage(r,0,0,512,512),i.Ct[n.FID+"_"+e]={type:"gif",canvascount:0,externalModel:n,canvasArray:[t],isnewupdate:!0}},r.src=t},Nl:function(t,i,r){var o=this,n=(this.Ll=t,null),e=document.createElement("div"),s=(e.style.display="none","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)}));e.setAttribute("id",s+"_div"),e.innerHTML='<video id="'+s+'" loop crossOrigin="anonymous" muted><source src="'+t+'"></video>',document.body.appendChild(e),function t(){var e=document.getElementById(s);e?(null!==n&&clearTimeout(n),e.addEventListener("loadeddata",function(t){var n=new kb(e);n.video_id=s+"_div",n.name=r,i.isGltf&&(n.flipY=!1),o.Ct[i.FID+"_"+r]={type:"video",externalModel:i,texture:n,isnewupdate:!0},e.play()})):n=setTimeout(t,0)}()},xl:function(t,n,e){var i=this,r=document.createElement("div"),o=(r.style.display="none",document.body.appendChild(r),new Image);o.crossOrigin="Anonymous",o.onload=function(){i.Ct[n.FID+"_"+e]={type:"gif",canvascount:0,externalModel:n,canvasArray:[],isnewupdate:!0},r.appendChild(o);var t=new jb.a({gif:o});t.load(function(){i.El(t,n.FID,e,r)})},o.src=t},El:function(e,i,r,o){var s=this,a=null,u=e.get_length(),c=1;this.Ct[i+"_"+r].canvascount=0,function t(){{var n;u<c?(document.body.removeChild(o),null!==a&&clearTimeout(a)):(e.move_to(c),(n=document.createElement("canvas")).width=512,n.height=512,n.getContext("2d").drawImage(e.get_canvas(),0,0,512,512),s.Ct[i+"_"+r].canvasArray.push(n),c++,a=setTimeout(t,0))}}()},Dy:function(a){var r=this,t=a.getRenderNode();function n(t){var n=a.multiMediaTool.oldMaterial[t.name];if(Array.isArray(n))for(var e=0;e<n.length;e++){var i,r=u(t.material[e],n[e]);r&&(r.iscanvasinfo?(i=r.info,t.material[e].map.image=i.canvasArray[i.canvascount],t.material[e].map.needsUpdate=!0):(t.material[e].dispose(),t.material[e]=r))}else{var o,s=u(t.material,n);s&&(s.iscanvasinfo?(o=s.info,t.material.map.image=o.canvasArray[o.canvascount],t.material.map.needsUpdate=!0):(t.material.dispose(),t.material=s))}}function u(t,n){var e,i="",n=(n.uniforms&&n.uniforms.map&&n.uniforms.map.value?i=n.uniforms.map.value.name:n.map&&(i=""+n.map.name).indexOf(".gif")<0&&i.indexOf(".mp4")<0&&i.indexOf(".webm")<0&&i.indexOf(".ogg")<0&&(i=""+n.name),r.Ct[a.FID+"_"+i]);return n?"video"===n.type?!t.isupdate||n.isnewupdate?(n.isnewupdate=!1,(e=new Ia({map:n.texture.clone()})).isBasic=!0,e.isupdate=!0,e.updatename=i,e):null:"gif"===n.type?n.canvasArray[n.canvascount]?!t.isupdate||n.isnewupdate?(n.isnewupdate=!1,e=new xh(n.canvasArray[n.canvascount]),a.isGltf&&(e.flipY=!1),e.repeat.set(1,1),e.name=i,e.magFilter=Zn,e.minFilter=1008,(t=new Ia({map:e})).updatename=i,t.isBasic=!0,t.isupdate=!0,t):{iscanvasinfo:!0,info:n}:null:void 0:null}t&&(a.isGltf?t.traverse(function(t){"Mesh"===t.type&&n(t)}):n(t))},Xn:function(){var t,n,e=(new Date).getTime(),i=e-this.Cn,r=(50<=i&&(this.Cn=e),[]);for(t in this.Ct)(function(t){for(var n=!0,e=0;e<r.length;e++)if(r[e].FID===t){n=!1;break}return n})(t.split("_")[0])&&this.Ct[t]&&r.push(this.Ct[t].externalModel),"gif"===this.Ct[t].type&&50<=i&&((n=this.Ct[t]).canvascount<n.canvasArray.length-1?n.canvascount++:n.canvascount=0);for(var o=0;o<r.length;o++)this.Dy(r[o])}}),Bw=Fw;function yS(t){return(yS="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 bS(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,function(t){t=function(t,n){if("object"!=yS(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=yS(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==yS(t)?t:t+""}(i.key),i)}}var gS=function(){function r(t,n,e,i){if(!(this instanceof r))throw new TypeError("Cannot call a class as a function");this.x=t,this.y=n,this.width=e,this.height=i}return t=r,(n=[{key:"contains",value:function(t){return t.x>=this.x&&t.y>=this.y&&t.x<this.x+this.width&&t.y<this.y+this.height}},{key:"intersects",value:function(t){return this.x<t.x+t.width&&this.x+this.width>t.x&&this.y<t.y+t.height&&this.y+this.height>t.y}}])&&bS(t.prototype,n),e&&bS(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,e}();function _S(t){return(_S="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 wS(t,n){var e,i,r,o,s="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(s)return i=!(e=!0),{s:function(){s=s.call(t)},n:function(){var t=s.next();return e=t.done,t},e:function(t){i=!0,r=t},f:function(){try{e||null==s.return||s.return()}finally{if(i)throw r}}};if(Array.isArray(t)||(s=function(t,n){var e;if(t)return"string"==typeof t?xS(t,n):"Map"===(e="Object"===(e=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?xS(t,n):void 0}(t))||n&&t&&"number"==typeof t.length)return s&&(t=s),o=0,{s:n=function(){},n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},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.")}function xS(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 ES(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,function(t){t=function(t,n){if("object"!=_S(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=_S(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==_S(t)?t:t+""}(i.key),i)}}var SS=function(){function c(t){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:1,e=2<arguments.length&&void 0!==arguments[2]?arguments[2]:8,i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:0,r=this,o=c;if(!(r instanceof o))throw new TypeError("Cannot call a class as a function");this.bound=t,this.maxPoints=n,this.maxDepth=e,this.depth=i,this.points=[],this.nodes=[]}return t=c,(n=[{key:"insert",value:function(t){if(this.bound.contains(t)){if(this.points.length<this.maxPoints||this.depth>=this.maxDepth)return this.points.push(t),!0;0===this.nodes.length&&this.split();var n,e=wS(this.nodes);try{for(e.s();!(n=e.n()).done;)if(n.value.insert(t))return!0}catch(t){e.e(t)}finally{e.f()}}return!1}},{key:"split",value:function(){var t,n=this.bound.x,e=this.bound.y,i=this.bound.width/2,r=this.bound.height/2,o=(this.nodes.push(new c(new gS(n,e,i,r),this.maxPoints,this.maxDepth,this.depth+1)),this.nodes.push(new c(new gS(n+i,e,i,r),this.maxPoints,this.maxDepth,this.depth+1)),this.nodes.push(new c(new gS(n,e+r,i,r),this.maxPoints,this.maxDepth,this.depth+1)),this.nodes.push(new c(new gS(n+i,e+r,i,r),this.maxPoints,this.maxDepth,this.depth+1)),wS(this.points));try{for(o.s();!(t=o.n()).done;){var s,a=t.value,u=wS(this.nodes);try{for(u.s();!(s=u.n()).done;)s.value.insert(a)}catch(t){u.e(t)}finally{u.f()}}}catch(t){o.e(t)}finally{o.f()}this.points=[]}},{key:"query",value:function(t){var n=[];if(this.bound.intersects(t)){var e,i=wS(this.points);try{for(i.s();!(e=i.n()).done;){var r=e.value;t.contains(r)&&n.push(r)}}catch(t){i.e(t)}finally{i.f()}var o,s=wS(this.nodes);try{for(s.s();!(o=s.n()).done;)var a=o.value,n=n.concat(a.query(t))}catch(t){s.e(t)}finally{s.f()}}return n}}])&&ES(t.prototype,n),e&&ES(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,e}();function TS(t){return(TS="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 AS(t,n){var e,i,r,o,s="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(s)return i=!(e=!0),{s:function(){s=s.call(t)},n:function(){var t=s.next();return e=t.done,t},e:function(t){i=!0,r=t},f:function(){try{e||null==s.return||s.return()}finally{if(i)throw r}}};if(Array.isArray(t)||(s=function(t,n){var e;if(t)return"string"==typeof t?MS(t,n):"Map"===(e="Object"===(e=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?MS(t,n):void 0}(t))||n&&t&&"number"==typeof t.length)return s&&(t=s),o=0,{s:n=function(){},n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},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.")}function MS(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 OS(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,function(t){t=function(t,n){if("object"!=TS(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=TS(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==TS(t)?t:t+""}(i.key),i)}}var LS=function(){function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function")}return n=t,(e=[{key:"scatterPoints",value:function(t,n){for(var e=n.min.x,i=n.min.y,r=n.max.x-n.min.x,n=n.max.y-n.min.y,e=new gS(e,i,r,n),o=new SS(e),s=0;s<t.length;s++)o.insert(t[s]);return o}},{key:"clusterPoints",value:function(t,n,e,i){var r=[];i&&t.sort(function(t,n){return n.weight-t.weight});for(var o=0;o<t.length;o++){var s=t[o];if(!s.clustered){s=(s=n.query(new gS(s.x-e/2,s.y-e/2,e,e))).filter(function(t){return!0!==t.clustered});if(0!=s.length){var a,u=AS(s);try{for(u.s();!(a=u.n()).done;)a.value.clustered=!0}catch(t){u.e(t)}finally{u.f()}r.push(s)}}}return r}},{key:"getClusterCenter",value:function(t){for(var n=1<arguments.length&&void 0!==arguments[1]&&arguments[1],e=[],i=0;i<t.length;i++){var r,o,s=t[i].length,a={};s<=0||(r=t[i][0].level,o=t[i][0].buildingID,(a=n?this.get_centroid(t[i],n):this.get_centroid(t[i])).level=r,a.buildingID=o,a.num=s,e.push(a))}return e}},{key:"get_centroid",value:function(t){var n=1<arguments.length&&void 0!==arguments[1]&&arguments[1],e={};if(0!=t.length){var i=0,r=0,o=0;if(n){for(var s=0;s<t.length;s++){var a=t[s];i+=a.x*a.weight,r+=a.y*a.weight,o+=a.weight}if(0==o)return e;i/=o,r/=o}else{for(var u=0;u<t.length;u++){var c=t[u];i+=c.x,r+=c.y}i/=t.length,r/=t.length}e={x:i,y:r}}return e}}])&&OS(n.prototype,e),i&&OS(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,e,i}();function RS(t,n){var e,i,r,o,s="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(s)return i=!(e=!0),{s:function(){s=s.call(t)},n:function(){var t=s.next();return e=t.done,t},e:function(t){i=!0,r=t},f:function(){try{e||null==s.return||s.return()}finally{if(i)throw r}}};if(Array.isArray(t)||(s=function(t,n){var e;if(t)return"string"==typeof t?NS(t,n):"Map"===(e="Object"===(e=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?NS(t,n):void 0}(t))||n&&t&&"number"==typeof t.length)return s&&(t=s),o=0,{s:n=function(){},n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},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.")}function NS(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 PS(t){return(PS="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 FS(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,function(t){t=function(t,n){if("object"!=PS(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=PS(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==PS(t)?t:t+""}(i.key),i)}}var t=function(){function n(t){if(!(this instanceof n))throw new TypeError("Cannot call a class as a function");this._n=t.map,this.ky=t.gridSize,void 0===this.ky&&(this.ky=100),this.Ih=t.points,this.O1=t.maxZoom,void 0===this.O1&&(this.O1=20),this.Uy=t.renderClusterMarker,this.By=t.renderMarker,this.oy=t.content,this.Gy=null,this.Hy=new LS,this.Xy=null,this.Z0=t.buildingID,void 0===this.Z0&&(this.Z0=this._n.getMapOptions().buildingID),this.Rr=t.level,this.ci=null,this.A1=this.A1.bind(this),this.Xn=this.Xn.bind(this),this.Vy=[],this.zy="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAAXNSR0IArs4c6QAACDFJREFUeF7Fmw2MXFUVx3/nzczOdrtt3LZaSYFEDdBqMFKgIUESqhVaxS4xYIJBRVZaMKxktYvT7XZ3ust+0G3aKrVAaJvYBqM0JkitfIjWmDUW6xeU+AFVI2CBCrSpbdmZ2feOuW936n5137vvvdk9yWQ+3vmf8z//e+/7uPeOMFW2Rc9DWYLwMeCjwAeBuUDtMIVTwNvAP4DDwJ+A52iS1ytJUSoZnIc1wylWIHwJ+Dgw3zLfm0A/ym5qeZLVUrLEB7pXToBNeiMO3wKuCmQRzuEgHvezRh4P5x7OK3kBNutH8NiKsCwcBUsv5VmUJprlRUvkhO7JCtCnDQgbgTlJkJskxnGUZpplZ9w8yQnQpx0I6+MSssIrnTRLmxVmjHMyAvTpduCuOERiYB+kWb4WFR9fgE3ag0cuKoFEcA69rJG1UWLFE6BHb8ch9jiMQnwcRvkyOdltGyu6AN26EIfngSrbpBXyH8DjMlrkrzbxowvQqz8HPmGTbAp8D5ATK07RBOjVepREb0gSE0e4kZz8OGw8ewEe0xRH+CNwadgkAX7l29tMQvEOU2QxeRkME89egPu0Hond+r8G9iH04/GaT9ThfNR/XvgscHUY8uf0EeppkSfCxIgiwE+BFWGCT+DzEg7NgeS6dSUefcDFkfIIT7BO6sNg7QTo0vkoLwGzwwQf43OYNDeQk1dCYXv1Qgb5ScShdpJBLiIvx4Jy2QnQqZ8DfhQUdILj/yTFlbSIed4Pb906F5dDwAfCg4Y9hZW0yr4gnJ0AHdoJtAYFHXdcWMF6ecoaZwCduhzlSWuseU5oD35OsBNgg5pLX6ixdZaw8Axtcr11ASMBHfo0ynWWMfbRLiuDMLYCmMufmdKysa/SHvOxdYM2ADtskgLP0y6BXO0EyKu5ZC2wIPIuKS5nvfzFAjPetVMX4fJ7YIZFnKPkJZCrnQDtehx4jwWJNxD/bGwmPKNbXmtRXgbebxHkBBukLsjfToA2fWt4Jjcobvn4URw+RF4GwgIm9GvULHX83bL3vUOHmFnnSc1WgH8BFwYFHXH8BIN8mO6YU9steh5p/mzZ+16lQwK52gnQqr8FrrQQwNziLqdDnrbCjHVu1eVgfSn8HfdJIFdbAX6I8nnLYrbRJY2WmNHu6/QB4G7LGHvpkkCudgKs1VYEczNkY2+hLKTH8i6wnCGv8yhiriLzbJICbXRLIFc7AVr0UyjPWBIx7nvoEbM6ZG853YNwqzVQuI5u+VkQzk6AnNYh/uUo8Ow6LrHSQq/0BBEadTynaxG6rTBDzv8hy8Xk5UQQ1k4AE22tPoryhaDAEx5XNjODdYGXxbxW8y5dCN+IlAe+R6/cFgZrL0BOl6EEdq1Jkv8B+DZpDtAlr47yu1fPR/x5xnuAxWEKOIfPNdwv/WHw9gKYqPfqr4BrwiSYxMc8Gr/gd9che+/wsrn98Bqd5Ck2SugJm6gCfBJ4NqYAlYE7XEGvmOeGUBZNABN6je4FbgqVZeqctrHJ7p4jugBmvHr+Tg6bh6NKSvEyBa7gATlpkyS6AEO94DOoP2833ebisIQ+MSdYK4sngEn1Td3or9VPpymNbJFtUSjEF8BkvUf34/DpKARiY5QdbJU7osZJRoAmnYOHWexYGJVIRFw/dSwNuwo0UY5kBBjqBZcI/rTVzIjF2MJe1xKL2S5v2AJH+icngIn6dV0uYFaOko07vsKCOixlq/wmTvEGmzjRVKPerlR204QIt7jfkR/ELb4iApigzt26WaEpCYJjYwhs9LaJ2X+YiCXeA8qspFEfRy0XUYJKUvbpd4MXO4LCVO4cMDLyKq1xMpgxavYFJ2F/82ZwOZvkdBLBzjZUksHGxbpLL0kJBxO4XS44cFVpu5gN1IlaxYZAmWX6Tr1WHQ7EYu1xk/uQRFmVDkxbcQH8k+KdmhOwmw77fx99yH1QKrYJc0oEMLVkVuv3FW4JbJLRDs8NPixJ7TafMPWUCUCjzs4UeVHhgpAiuE6KS4vbYy6sBiSbOgGA9CpdqvCLMAKo0uw9IpvC+MbxmVIB/KFwhz6mcPNkpBWOuAtYFOchJ6woUy9Ag16mwqQTFyrc6j4ij4YtIo7flAtgyKYbdD+cc/7ghcGdZheKaJzCwmKnS4CrxfwZagJzlPrCrnCbHMMWOZnftAhgCGUbtN8bsyNUlEPFXbIkicLCxpg+Ab6iN6gwah+fwPWFXRJl8TVsveP8KitAXh3eJoNLhjOk8UhRQ6rMoqrAL4FFw98PFYssYxbV/vczmJlelxoGSVFiLiXy4kWu9BzABAVQ4YvUkKamOstMz/MLyaiSQnAw7x7if3bQlMcxz+U2XNrMtIymaUwJ+93ynysVz0cJLoon5h1KjsPAQIHTDHKGPZyJe7KML8DNmmIW86tS1KnHzHKBfrGmAEPf2MjP5muKk54yS4ocRDjqZLjWc6jVQbJnG8tIZ+IYK382ccxvRhSH00WX4/yXN9krRiBriy1AdrVe5LoswKMgUPILDWMeUkpzrKpAHod/Fx12ZBze55cXxjz/OpnBIZtSXivslCNhYGN9YgvAKp2XcbmAFFWmu8tQ+7h+y08mxtBwMOM8jUvRfw8ygzE9QUmp4PjDwqVYKvEKu6NtwYkvgCFthkEtc7IZZqtSrUIWjypD0gghRoiRYpSHxVAxBf/8MCTEUO8xv5fNtPRw4b64DkVRCiIMFEqc5BTvRO3+JkUyAoxqORWaqOY0VZSoQsiYV9Z0V9NyptjM8AkR8EUyRMpd3whVwvVbV3ALZliZX8wrQ5GZFNnCQNyTX5ny/wAFqGhfpVfGKAAAAABJRU5ErkJggg==",this.ec(),this.kt=new W2}return t=n,(e=[{key:"dispose",value:function(){for(var t=0;t<this.Vy.length;t++)this.Vy[t].marker.remove(),delete this.Vy[t];this.Vy.length=0,this.Wy(),this.Ih.length=0,this.Xy=void 0,this._n.off("zoom",this.A1),this._n.off("move",this.A1),this._n.off("viewChanged",this.A1),this._n.off("resize",this.A1)}},{key:"on",value:function(t,n){this.kt.Jp(t,n)}}])&&FS(t.prototype,e),i&&FS(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,i}(),Yw=(Object.assign(t.prototype,{ec:function(){this.Bi().getLayers(fengmap.FMType.EXTENT_LAYER)[0]?(this.ci=this.Bi().getLayers(fengmap.FMType.EXTENT_LAYER)[0].bound,this.Yy(),this.Qy(!0),this._n.on("zoom",this.A1),this._n.on("move",this.A1),this._n.on("viewChanged",this.A1),this._n.on("resize",this.A1)):this._n.on("update",this.Xn)},Yy:function(){this.Xy=this.Hy.scatterPoints(this.Ih,this.ci)},Qy:function(t){if(this._n.getZoom()<this.O1){for(var n=0;n<this.Ih.length&&this.Ih[n].clustered;n++)this.Ih[n].clustered=null;var e=this.Zy();t&&(this.Gy=this.qy(this.Ky(this.Ih,this.Xy,e))),null!==this.Gy&&(t=this.U1(this.Gy),this.Jy(t))}else{e=this.U1(this.Ih);this.Jy(e)}},U1:function(t){for(var n=[],e=0;e<t.length;e++)this.Y1(t[e])&&n.push(t[e]);return n},Jy:function(i){var r=this;if(0===this.Vy.length)for(var t=0;t<i.length;t++)this.$y(i[t]);else{for(var n=[],e=[],o=0;o<i.length;o++){var s,a=d(i[o]);null!==a&&((s=this.Vy[a]).marker.moveTo({x:i[o].x,y:i[o].y}),s.marker.getRenderNode().point=i[o],n.push(s),this.Vy.splice(a,1),e.push(o),this.Uy)&&(a={marker:s.marker,count:i[o].num},this.Uy(a))}i=v(e);for(var u=e.length=0;u<i.length&&0!==this.Vy.length;u++){var c,h=d(i[u],!0);null!==h&&((h=this.Vy.splice(h,1)[0]).marker.moveTo({x:i[u].x,y:i[u].y}),"multiple"===h.type?(h.marker.getRenderNode().point=i[u],h.num=i[u].num,this.Uy?(h.marker.content="<div></div>",c={marker:h.marker,count:i[u].num},this.Uy(c)):h.marker.content=this.tb(i[u].num)):this.By&&(c={x:i[u].x,y:i[u].y},this.By(c)),e.push(u),n.push(h))}i=v(e);for(var f=e.length=0;f<i.length;f++)this.$y(i[f],n);for(var l=0;l<this.Vy.length;l++)this.Vy[l].marker.remove();this.Vy.length=0,this.Vy=n}function d(t,n){for(var e=null,i=0;i<r.Vy.length;i++)if(void 0===t.num||1===t.num){if("single"===r.Vy[i].type){e=i;break}}else if(n){if("multiple"===r.Vy[i].type){e=i;break}}else if(r.Vy[i].num===t.num){e=i;break}return e}function v(t){for(var n=[],e=0;e<i.length;e++)!function(t,n){for(var e=!0,i=0;i<t.length;i++)if(t[i]===n){e=!1;break}return e}(t,e)||n.push(i[e]);return n}},tb:function(t){return void 0===this.oy?'<div style="background: rgba(73,102,245,0.8);height: 50px;width: 50px;border: 2px solid #3F5BC0;border-radius: 25px;box-shadow: rgb(255, 204, 204) 0px 0px 5px;line-height: 50px;color: rgb(255, 255, 255);font-size: 14px;text-align: center;">'+t+"</div>":this.oy.replace("${num}",""+t)},$y:function(t,n){var e,i;1<t.num?this.Uy?(i={marker:e=this.nb(t,"<div></div>"),count:t.num},this.Uy(i),(n||this.Vy).push({type:"multiple",num:t.num,marker:e})):(i=this.nb(t,this.tb(t.num),42,42),(n||this.Vy).push({type:"multiple",num:t.num,marker:i})):(e=null,e=this.By&&(i={x:t.x,y:t.y},this.By(i),e=i.marker)||new fengmap.FMImageMarker({url:this.zy,collision:!1,x:t.x,y:t.y}),i=this.Bi(),e.addTo(i),(n||this.Vy).push({type:"single",num:t.num,marker:e}))},nb:function(t,n,e,i){var r=this,o=new fengmap.FMDomMarker({x:t.x,y:t.y,collision:!1,domWidth:e,domHeight:i,anchor:fengmap.FMMarkerAnchor.BOTTOM,content:n}),e=this.Bi();return o.addTo(e),o.getRenderNode().point=t,o.getRenderNode().element.addEventListener("click",function(t){var n=r.Z0,e=(n===r._n.getMapOptions().buildingID&&(n=null),o.getRenderNode().point);r.kt.Dt({type:"click",buildingID:n,coords:{x:e.x,y:e.y},level:r.Rr,target:o,markers:s(e.markers)})}),o.getRenderNode().element.addEventListener("touchend",function(t){var n=r.Z0,e=(n===r._n.getMapOptions().buildingID&&(n=null),o.getRenderNode().point);r.kt.Dt({type:"click",buildingID:n,coords:{x:e.x,y:e.y},level:r.Rr,target:o,markers:s(e.markers)})}),o;function s(t){for(var n=[],e=0;e<t.length;e++)n.push({x:t[e].x,y:t[e].y});return n}},Zy:function(){var t={x:document.body.clientWidth/2,y:document.body.clientHeight/2},n={x:t.x+this.ky,y:t.y},t=fengmap.FMUtil.coordsScreenToMap(this._n,t),n=fengmap.FMUtil.coordsScreenToMap(this._n,n);return Math.sqrt((t.x-n.x)*(t.x-n.x)+(t.y-n.y)*(t.y-n.y))},Ky:function(t,n,e){for(var i=[],r=0;r<t.length;r++){var o=t[r];if(!o.clustered){o=(o=n.query(new gS(o.x-e/2,o.y-e/2,e,e))).filter(function(t){return!0!==t.clustered});if(0!=o.length){var s,a=RS(o);try{for(a.s();!(s=a.n()).done;)s.value.clustered=!0}catch(t){a.e(t)}finally{a.f()}i.push(o)}}}return i},qy:function(t){for(var n=[],e=0;e<t.length;e++){var i=0,r=0,o=t[e].length;if(!(o<=0)){for(var s=t[e][0].level,a=t[e][0].buildingID,u=0;u<o;u++)i+=t[e][u].x,r+=t[e][u].y;n.push({x:i/o,y:r/o,level:s,buildingID:a,num:o,markers:t[e]})}}return n},A1:function(t){var n;this.R1()&&(n=!1,"zoom"===t.type&&(n=!0),this.Qy(n))},R1:function(){for(var t=!1,n=Array.from(this._n.getRenderManager().getRenderList().keys()),e=0;e<n.length;e++){var i=n[e].split("%A%B%C%D");if(""+i[0]==""+this.Z0&&""+i[1]==""+this.Rr){t=!0;break}}return t},Y1:function(t){var n=this.Bi(),n=new Tt(t.x-this._n.x,n.height,this._n.y-t.y),t=this._n.camera,n=n.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix);return!(1<Math.abs(n.x)||1<Math.abs(n.y)||1<Math.abs(n.z))},Wy:function(){!function t(n){n.points.length=0;for(var e=0;e<n.nodes.length;e++)t(n.nodes[e]),delete n.nodes[e];n.nodes.length=0}(this.Xy)},Bi:function(){return this._n.getBuilding(this.Z0).getFloor(this.Rr)},Xn:function(){this.Bi().getLayers(fengmap.FMType.EXTENT_LAYER)[0]&&(this.ec(),this._n.off("update",this.Xn))}}),t),jS={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","gl_FragColor = opacity * texel;","}"].join("\n")};function IS(t){return(IS="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 CS(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,function(t){t=function(t,n){if("object"!=IS(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=IS(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==IS(t)?t:t+""}(i.key),i)}}function DS(t,n,e){return n&&CS(t.prototype,n),e&&CS(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function kS(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}var US,BS,GS=DS(function t(){kS(this,t),this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1});function HS(t){return(HS="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 XS(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,function(t){t=function(t,n){if("object"!=HS(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=HS(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==HS(t)?t:t+""}(i.key),i)}}function VS(t,n,e){n=WS(n);var i=t,n=zS()?Reflect.construct(n,e||[],WS(t).constructor):n.apply(t,e);if(n&&("object"===HS(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function zS(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(zS=function(){return!!t})()}function WS(t){return(WS=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function YS(t,n){return(YS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}Object.assign(GS.prototype,{setSize:function(){},render:function(){console.error("THREE.Pass: .render() must be implemented in derived pass.")}}),GS.FullScreenQuad=(US=new pt(-1,1,1,-1,0,1),BS=new ma(2,2),e=DS(function t(n){kS(this,t),this.eb=new $a(BS,n)}),Object.defineProperty(e.prototype,"material",{get:function(){return this.eb.material},set:function(t){this.eb.material=t}}),Object.assign(e.prototype,{render:function(t){t.render(this.eb,US)}}),e);var QS=function(){function i(t,n){var e;if(this instanceof i)return(e=VS(this,i)).textureID=void 0!==n?n:"tDiffuse",t instanceof Ea?(e.uniforms=t.uniforms,e.material=t):t&&(e.uniforms=_a.clone(t.uniforms),e.material=new Ea({defines:Object.assign({},t.defines),uniforms:e.uniforms,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader})),e.fsQuad=new GS.FullScreenQuad(e.material),e;throw new TypeError("Cannot call a class as a function")}var t,n,e=i,r=GS;if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");return e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),r&&YS(e,r),e=i,t&&XS(e.prototype,t),n&&XS(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}();function ZS(t){return(ZS="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 qS(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,function(t){t=function(t,n){if("object"!=ZS(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=ZS(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==ZS(t)?t:t+""}(i.key),i)}}function KS(t,n,e){return n&&qS(t.prototype,n),e&&qS(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function JS(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function $S(t,n,e){n=n3(n);var i=t,n=t3()?Reflect.construct(n,e||[],n3(t).constructor):n.apply(t,e);if(n&&("object"===ZS(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function t3(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(t3=function(){return!!t})()}function n3(t){return(n3=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function e3(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}}),Object.defineProperty(t,"prototype",{writable:!1}),n&&i3(t,n)}function i3(t,n){return(i3=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}Object.assign(QS.prototype,{render:function(t,n,e){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=e.texture),this.fsQuad.material=this.material,this.renderToScreen?t.setRenderTarget(null):(t.setRenderTarget(n),this.clear&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil)),this.fsQuad.render(t)}});var r3=function(){function i(t,n){var e;return JS(this,i),(e=$S(this,i)).scene=t,e.camera=n,e.clear=!0,e.needsSwap=!1,e.inverse=!1,e}return e3(i,GS),KS(i)}(),o3=(Object.assign(r3.prototype,{render:function(t,n,e){var i,r,o=t.getContext(),s=t.state;s.buffers.color.setMask(!1),s.buffers.depth.setMask(!1),s.buffers.color.setLocked(!0),s.buffers.depth.setLocked(!0),r=this.inverse?(i=0,1):(i=1,0),s.buffers.stencil.setTest(!0),s.buffers.stencil.setOp(o.REPLACE,o.REPLACE,o.REPLACE),s.buffers.stencil.setFunc(o.ALWAYS,i,4294967295),s.buffers.stencil.setClear(r),t.setRenderTarget(e),this.clear&&t.clear(),t.render(this.scene,this.camera),t.setRenderTarget(n),this.clear&&t.clear(),t.render(this.scene,this.camera),s.buffers.color.setLocked(!1),s.buffers.depth.setLocked(!1),s.buffers.stencil.setFunc(o.EQUAL,1,4294967295),s.buffers.stencil.setOp(o.KEEP,o.KEEP,o.KEEP)}}),function(){function n(){var t;return JS(this,n),(t=$S(this,n)).needsSwap=!1,t}return e3(n,GS),KS(n)}());function s3(t){this.autoStart=void 0===t||t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}function a3(t){return(a3="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 u3(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,function(t){t=function(t,n){if("object"!=a3(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=a3(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==a3(t)?t:t+""}(i.key),i)}}function c3(t,n,e){return n&&u3(t.prototype,n),e&&u3(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function h3(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}Object.assign(o3.prototype,{render:function(t){t.state.buffers.stencil.setTest(!1)}}),Object.assign(s3.prototype,{start:function(){this.startTime=("undefined"==typeof performance?Date:performance).now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0},stop:function(){this.getElapsedTime(),this.running=!1,this.autoStart=!1},getElapsedTime:function(){return this.getDelta(),this.elapsedTime},getDelta:function(){var t,n=0;return this.autoStart&&!this.running?(this.start(),0):(this.running&&(n=((t=("undefined"==typeof performance?Date:performance).now())-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=n),n)}});var f3,l3,d3=c3(function t(n,e){var i,r;h3(this,t),this.renderer=n,void 0===e?(i={minFilter:Zn,magFilter:Zn,format:le,stencilBuffer:!1},r=n.getSize(new Mt),this.ib=n.getPixelRatio(),this.tt=r.width,this.nt=r.height,(e=new Gc(this.tt*this.ib,this.nt*this.ib,i)).texture.name="EffectComposer.rt1"):(this.ib=1,this.tt=e.width,this.nt=e.height),this.renderTarget1=e,this.renderTarget2=e.clone(),this.renderTarget2.texture.name="EffectComposer.rt2",this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2,this.renderToScreen=!0,this.passes=[],void 0===QS&&console.error("THREE.EffectComposer relies on ShaderPass"),this.copyPass=new QS(jS),this.clock=new s3}),v3=(Object.assign(d3.prototype,{swapBuffers:function(){var t=this.readBuffer;this.readBuffer=this.writeBuffer,this.writeBuffer=t},clearPass:function(){for(var t=0;t<this.passes.length;t++)this.passes[t].scene=null,this.passes[t].camera=null},addPass:function(t){this.passes.push(t),t.setSize(this.tt*this.ib,this.nt*this.ib)},insertPass:function(t,n){this.passes.splice(n,0,t)},isLastEnabledPass:function(t){for(var n=t+1;n<this.passes.length;n++)if(this.passes[n].enabled)return!1;return!0},render:function(t){void 0===t&&(t=this.clock.getDelta());for(var n,e,i,r=this.renderer.getRenderTarget(),o=!1,s=this.passes.length,a=0;a<s;a++)!1!==(i=this.passes[a]).enabled&&(i.renderToScreen=this.renderToScreen&&this.isLastEnabledPass(a),i.render(this.renderer,this.writeBuffer,this.readBuffer,t,o),i.needsSwap&&(o&&(n=this.renderer.getContext(),(e=this.renderer.state.buffers.stencil).setFunc(n.NOTEQUAL,1,4294967295),this.copyPass.render(this.renderer,this.writeBuffer,this.readBuffer,t),e.setFunc(n.EQUAL,1,4294967295)),this.swapBuffers()),void 0!==r3)&&(i instanceof r3?o=!0:i instanceof o3&&(o=!1));this.renderer.setRenderTarget(r)},reset:function(t){var n;void 0===t&&(n=this.renderer.getSize(new Mt),this.ib=this.renderer.getPixelRatio(),this.tt=n.width,this.nt=n.height,(t=this.renderTarget1.clone()).setSize(this.tt*this.ib,this.nt*this.ib)),this.renderTarget1.dispose(),this.renderTarget2.dispose(),this.renderTarget1=t,this.renderTarget2=t.clone(),this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2},setSize:function(t,n){this.tt=t,this.nt=n;var e=this.tt*this.ib,i=this.nt*this.ib;this.renderTarget1.setSize(e,i),this.renderTarget2.setSize(e,i);for(var r=0;r<this.passes.length;r++)this.passes[r].setSize(e,i)},setPixelRatio:function(t){this.ib=t,this.setSize(this.tt,this.nt)}}),c3(function t(){h3(this,t),this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1})),p3=(Object.assign(v3.prototype,{setSize:function(){},render:function(){console.error("THREE.Pass: .render() must be implemented in derived pass.")}}),v3.FullScreenQuad=(f3=new pt(-1,1,1,-1,0,1),l3=new ma(2,2),tv=c3(function t(n){h3(this,t),this.eb=new $a(l3,n)}),Object.defineProperty(tv.prototype,"material",{get:function(){return this.eb.material},set:function(t){this.eb.material=t}}),Object.assign(tv.prototype,{dispose:function(){this.eb.geometry.dispose()},render:function(t){t.render(this.eb,f3)}}),tv),{uLayer:{value:0},uPrevDepthTexture:{value:null},uScreenSize:{value:new Mt(1,1)},uDepthPeel:{value:1},uDepthOffset:{value:1e-5}}),m3="\nvarying vec2 vUv;\nvoid main(){\n  vUv = uv;\n  gl_Position = vec4(position.xy, 0., 1.);\n}\n";function y3(t){t.fragmentShader=t.fragmentShader.replace("#include <packing>",""),t.fragmentShader="\n\t\t\t\t\t#include <packing>\n\n\t\t\t\t\t".concat(t.fragmentShader,"\n\t\t\t\t"),b3(t),t.fragmentShader=t.fragmentShader.replace(/}(\s*)$/g,"\n    if(uDepthPeel != 0) {\n      #ifdef STANDARD\n        gl_FragColor.a = diffuseColor.a;\n      #else\n        gl_FragColor.a = opacity;\n      #endif\n      gl_FragColor.rgb *= gl_FragColor.a;\n    }\n  }\n  ")}function b3(t){t.uniforms.uScreenSize=p3.uScreenSize,t.uniforms.uPrevDepthTexture=p3.uPrevDepthTexture,t.uniforms.uLayer=p3.uLayer,t.uniforms.uDepthOffset=p3.uDepthOffset,t.uniforms.uDepthPeel=p3.uDepthPeel,t.vertexShader=t.vertexShader.replace("void main() {","\n    varying vec2 vFMHighPrecisionZW;\n    void main() {"),t.vertexShader=t.vertexShader.replace(/}$/gm,"\n    vFMHighPrecisionZW = gl_Position.zw;\n  }\n  "),t.fragmentShader="\n\t\t\t\t\tuniform vec2 uScreenSize;\n\t\t\t\t\tuniform sampler2D uPrevDepthTexture;\n\t\t\t\t\tuniform int uLayer;\n\t\t\t\t\tuniform int uDepthPeel;\n\t\t\t\t\tuniform float uDepthOffset;\n          varying vec2 vFMHighPrecisionZW;\n\t\t\t\t\t".concat(t.fragmentShader,"\n\t\t\t\t"),t.fragmentShader=t.fragmentShader.replace(/}(\s*)$/g,"\n  if(uDepthPeel == 0) return;\n\n  if(uLayer != 0 ){\n    vec2 screenPos = gl_FragCoord.xy * uScreenSize;\n    float prevDepth = unpackRGBAToDepth(texture2D(uPrevDepthTexture, screenPos));\n    float fragCoordZ = 0.5 * vFMHighPrecisionZW[0] / vFMHighPrecisionZW[1] + 0.5;\n    if(prevDepth + uDepthOffset - fragCoordZ >= 0. ){\n      discard;\n    }\n  }\n}")}function g3(t,n,e){Gc.call(this,t,n,e),this.samples=4}function _3(t){return(_3="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 w3(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,function(t){t=function(t,n){if("object"!=_3(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=_3(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==_3(t)?t:t+""}(i.key),i)}}function x3(t,n,e){n=S3(n);var i=t,n=E3()?Reflect.construct(n,e||[],S3(t).constructor):n.apply(t,e);if(n&&("object"===_3(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");t=i;if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function E3(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(E3=function(){return!!t})()}function S3(t){return(S3=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function T3(t,n){return(T3=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}g3.prototype=Object.assign(Object.create(Gc.prototype),{constructor:g3,isWebGLMultisampleRenderTarget:!0,copy:function(t){return Gc.prototype.copy.call(this,t),this.samples=t.samples,this}});var A3=function(){function h(){var t,n,e,i,r,o,s,a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},u=this,c=h;if(u instanceof c)return u=x3(this,h),c=a.scene,t=a.camera,n=a.renderer,e=a.samples,i=a.layers,r=a.mode,o=a.w,s=a.h,a=a.type,u.gt=n,u.Do=c,u.Ut=t,u.rb=null!=e?e:4,u.ob=r,u.bi=a,u.sb=[],u.ab=null!=i?i:2,u.ub=new Mt(o,s),u.cb=new Ea({uniforms:{uTextureA:{value:null},uTextureB:{value:null},uBlit:{value:0}},vertexShader:m3,fragmentShader:"\n          varying vec2 vUv;\n          uniform sampler2D uTextureA;\n          uniform sampler2D uTextureB;\n\n          void main(){\n            vec4 src = texture2D(uTextureA, vUv);\n            vec4 dst = texture2D(uTextureB, vUv);\n\n            float a1 = 1.-src.a;\n            gl_FragColor.a = src.a + a1 * dst.a;\n            gl_FragColor.rgb = src.rgb + a1 * dst.rgb;\n            gl_FragColor.rgb /= gl_FragColor.a;\n          }\n        ",transparent:!0,depthTest:!1,depthWrite:!1}),u.hb=new Hc,u.hb.depthPacking=pi,u.hb.onBeforeCompile=b3,u.fb=new v3.FullScreenQuad(u.cb),u.clearDepth=!1,u.needsSwap=!1,u.lb=new Map,u.va=!0,u.initTargets(),u;throw new TypeError("Cannot call a class as a function")}var t,n=h,e=v3;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&T3(n,e),n=h,(e=[{key:"enable",get:function(){return this.va},set:function(t){(this.va=t)?(p3.uDepthPeel.value=1,this.lb.forEach(function(t){t=t.mesh;t.material&&(t.material.userData.transparent=!1)})):(p3.uDepthPeel.value=0,this.restoreState()),this.lb.clear()}},{key:"restoreState",value:function(){this.lb.forEach(function(t){t=t.mesh;t.material&&(delete t.userData.transparent,t.material.needsUpdate=!0)}),this.lb.clear()}},{key:"initTargets",value:function(){for(var t=this.ub,n=0;n<5;n++){var e=2<=n&&0<this.rb?g3:Gc,i=new e(t.x,t.y,{minFilter:Wn,magFilter:Wn,type:re,format:le});e===g3&&(i.samples=this.rb),this.sb.push(i)}}},{key:"setSize",value:function(){var t=new Mt;this.gt.getDrawingBufferSize(t);for(var n=0;n<5;n++)this.sb[n].setSize(t.x,t.y);this.ub.x=t.x,this.ub.y=t.y,p3.uScreenSize.value.set(1/t.x,1/t.y)}},{key:"dispose",value:function(){for(var t=0;t<5;t++)this.sb[t].dispose()}},{key:"clearTarget",value:function(t,n,e){t.setRenderTarget(n),t.setClearColor(e[0],e[1]),t.clear()}},{key:"clearAllTarget",value:function(t,n){var e=this.sb,i=t.getClearColor().clone(),r=t.getClearAlpha();this.clearTarget(t,e[0],[16777215,1]),this.clearTarget(t,e[1],[16777215,1]),this.clearTarget(t,e[2],[0,0]),this.clearTarget(t,e[3],[0,0]),this.clearTarget(t,n,[i,r])}},{key:"_buildTransparentObjects",value:function(t){var i=this,n={model:E.MODEL_LAYER,extent:E.EXTENT_LAYER,externalModel:E.EXTERNAL_MODEL_LAYER,dynamicModel:E.DYNAMIC_MODEL_MARKER};t.children.forEach(function(t){var e=i.bi.includes(n[t.name]);t.traverse(function(t){var n=null==(n=t.material)||null==(n=n.userData)?void 0:n.sourceTransparent;e&&t.visible&&"Mesh"===t.type&&0===t.renderOrder&&t.material.transparent&&!1!==n&&(t.userData.transparent=!1,t.visible&&t.material.transparent&&(i.lb.has(t.uuid)||i.lb.set(t.uuid,{mesh:t,onBeforeCompile:t.material.onBeforeCompile})),t.material.onBeforeCompile=y3,t.material.needsUpdate=!0)})})}},{key:"render",value:function(t,n,e){this.clearAllTarget(t,e);for(var i=t.getClearColor().getHex(),r=t.getClearAlpha(),o=this.Do,s=this.Ut,a=this.ab,u=this.sb,c=this.hb,h=this.cb,f=(this.restoreState(),t.setRenderTarget(e),t.setClearColor(i,r),t.clear(),t.render(o,s),this._buildTransparentObjects(this.Do),p3.uLayer.value=0,o.overrideMaterial=c,t.setRenderTarget(u[0]),t.setClearColor(16777215,1),t.clear(),t.render(o,s),o.overrideMaterial=null,t.setRenderTarget(u[2]),t.setClearColor(0,0),t.clear(),t.render(o,s),{0:2,1:4,2:3}),l={0:3,1:2,2:4},d={0:4,1:3,2:2},v=0;v<a;v++){var p=(v+1)%2,m=f[v%3],y=l[v%3],b=d[v%3];p3.uPrevDepthTexture.value=u[v%2].texture,p3.uLayer.value=v+1,o.overrideMaterial=c,t.setRenderTarget(u[p]),t.setClearColor(16777215,1),t.clear(),t.render(o,s),o.overrideMaterial=null,t.setRenderTarget(u[y]),t.setClearColor(0,0),t.clear(),t.render(o,s),h.uniforms.uTextureA.value=u[m].texture,h.uniforms.uTextureB.value=u[y].texture,t.setRenderTarget(u[b]),t.setClearColor(0,0),t.clear(),this.fb.render(t)}p3.uPrevDepthTexture.value=null,t.setRenderTarget(this.renderToScreen?null:e),this.fb.render(t),t.setClearColor(i,r)}},{key:"setPass",value:function(t,n){t&&(this.Do=t),n&&(this.Ut=n)}}])&&w3(n.prototype,e),t&&w3(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}(),M3={uniforms:{tDiffuse:{value:null},resolution:{value:new Mt(1/1024,1/512)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["precision highp float;","","uniform sampler2D tDiffuse;","","uniform vec2 resolution;","","varying vec2 vUv;","","// FXAA 3.11 implementation by NVIDIA, ported to WebGL by Agost Biro (biro@archilogic.com)","","//----------------------------------------------------------------------------------","// File:        es3-keplerFXAAassetsshaders/FXAA_DefaultES.frag","// SDK Version: v3.00","// Email:       gameworks@nvidia.com","// Site:        http://developer.nvidia.com/","//","// Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.","//","// Redistribution and use in source and binary forms, with or without","// modification, are permitted provided that the following conditions","// are met:","//  * Redistributions of source code must retain the above copyright","//    notice, this list of conditions and the following disclaimer.","//  * Redistributions in binary form must reproduce the above copyright","//    notice, this list of conditions and the following disclaimer in the","//    documentation and/or other materials provided with the distribution.","//  * Neither the name of NVIDIA CORPORATION nor the names of its","//    contributors may be used to endorse or promote products derived","//    from this software without specific prior written permission.","//","// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY","// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE","// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR","// PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR","// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,","// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,","// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR","// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY","// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT","// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE","// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.","//","//----------------------------------------------------------------------------------","","#define FXAA_PC 1","#define FXAA_GLSL_100 1","#define FXAA_QUALITY_PRESET 12","","#define FXAA_GREEN_AS_LUMA 1","","/*--------------------------------------------------------------------------*/","#ifndef FXAA_PC_CONSOLE","    //","    // The console algorithm for PC is included","    // for developers targeting really low spec machines.","    // Likely better to just run FXAA_PC, and use a really low preset.","    //","    #define FXAA_PC_CONSOLE 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_GLSL_120","    #define FXAA_GLSL_120 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_GLSL_130","    #define FXAA_GLSL_130 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_HLSL_3","    #define FXAA_HLSL_3 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_HLSL_4","    #define FXAA_HLSL_4 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_HLSL_5","    #define FXAA_HLSL_5 0","#endif","/*==========================================================================*/","#ifndef FXAA_GREEN_AS_LUMA","    //","    // For those using non-linear color,","    // and either not able to get luma in alpha, or not wanting to,","    // this enables FXAA to run using green as a proxy for luma.","    // So with this enabled, no need to pack luma in alpha.","    //","    // This will turn off AA on anything which lacks some amount of green.","    // Pure red and blue or combination of only R and B, will get no AA.","    //","    // Might want to lower the settings for both,","    //    fxaaConsoleEdgeThresholdMin","    //    fxaaQualityEdgeThresholdMin","    // In order to insure AA does not get turned off on colors","    // which contain a minor amount of green.","    //","    // 1 = On.","    // 0 = Off.","    //","    #define FXAA_GREEN_AS_LUMA 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_EARLY_EXIT","    //","    // Controls algorithm's early exit path.","    // On PS3 turning this ON adds 2 cycles to the shader.","    // On 360 turning this OFF adds 10ths of a millisecond to the shader.","    // Turning this off on console will result in a more blurry image.","    // So this defaults to on.","    //","    // 1 = On.","    // 0 = Off.","    //","    #define FXAA_EARLY_EXIT 1","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_DISCARD","    //","    // Only valid for PC OpenGL currently.","    // Probably will not work when FXAA_GREEN_AS_LUMA = 1.","    //","    // 1 = Use discard on pixels which don't need AA.","    //     For APIs which enable concurrent TEX+ROP from same surface.","    // 0 = Return unchanged color on pixels which don't need AA.","    //","    #define FXAA_DISCARD 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_FAST_PIXEL_OFFSET","    //","    // Used for GLSL 120 only.","    //","    // 1 = GL API supports fast pixel offsets","    // 0 = do not use fast pixel offsets","    //","    #ifdef GL_EXT_gpu_shader4","        #define FXAA_FAST_PIXEL_OFFSET 1","    #endif","    #ifdef GL_NV_gpu_shader5","        #define FXAA_FAST_PIXEL_OFFSET 1","    #endif","    #ifdef GL_ARB_gpu_shader5","        #define FXAA_FAST_PIXEL_OFFSET 1","    #endif","    #ifndef FXAA_FAST_PIXEL_OFFSET","        #define FXAA_FAST_PIXEL_OFFSET 0","    #endif","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_GATHER4_ALPHA","    //","    // 1 = API supports gather4 on alpha channel.","    // 0 = API does not support gather4 on alpha channel.","    //","    #if (FXAA_HLSL_5 == 1)","        #define FXAA_GATHER4_ALPHA 1","    #endif","    #ifdef GL_ARB_gpu_shader5","        #define FXAA_GATHER4_ALPHA 1","    #endif","    #ifdef GL_NV_gpu_shader5","        #define FXAA_GATHER4_ALPHA 1","    #endif","    #ifndef FXAA_GATHER4_ALPHA","        #define FXAA_GATHER4_ALPHA 0","    #endif","#endif","","","/*============================================================================","                        FXAA QUALITY - TUNING KNOBS","------------------------------------------------------------------------------","NOTE the other tuning knobs are now in the shader function inputs!","============================================================================*/","#ifndef FXAA_QUALITY_PRESET","    //","    // Choose the quality preset.","    // This needs to be compiled into the shader as it effects code.","    // Best option to include multiple presets is to","    // in each shader define the preset, then include this file.","    //","    // OPTIONS","    // -----------------------------------------------------------------------","    // 10 to 15 - default medium dither (10=fastest, 15=highest quality)","    // 20 to 29 - less dither, more expensive (20=fastest, 29=highest quality)","    // 39       - no dither, very expensive","    //","    // NOTES","    // -----------------------------------------------------------------------","    // 12 = slightly faster then FXAA 3.9 and higher edge quality (default)","    // 13 = about same speed as FXAA 3.9 and better than 12","    // 23 = closest to FXAA 3.9 visually and performance wise","    //  _ = the lowest digit is directly related to performance","    // _  = the highest digit is directly related to style","    //","    #define FXAA_QUALITY_PRESET 12","#endif","","","/*============================================================================","","                           FXAA QUALITY - PRESETS","","============================================================================*/","","/*============================================================================","                     FXAA QUALITY - MEDIUM DITHER PRESETS","============================================================================*/","#if (FXAA_QUALITY_PRESET == 10)","    #define FXAA_QUALITY_PS 3","    #define FXAA_QUALITY_P0 1.5","    #define FXAA_QUALITY_P1 3.0","    #define FXAA_QUALITY_P2 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 11)","    #define FXAA_QUALITY_PS 4","    #define FXAA_QUALITY_P0 1.0","    #define FXAA_QUALITY_P1 1.5","    #define FXAA_QUALITY_P2 3.0","    #define FXAA_QUALITY_P3 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 12)","    #define FXAA_QUALITY_PS 5","    #define FXAA_QUALITY_P0 1.0","    #define FXAA_QUALITY_P1 1.5","    #define FXAA_QUALITY_P2 2.0","    #define FXAA_QUALITY_P3 4.0","    #define FXAA_QUALITY_P4 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 13)","    #define FXAA_QUALITY_PS 6","    #define FXAA_QUALITY_P0 1.0","    #define FXAA_QUALITY_P1 1.5","    #define FXAA_QUALITY_P2 2.0","    #define FXAA_QUALITY_P3 2.0","    #define FXAA_QUALITY_P4 4.0","    #define FXAA_QUALITY_P5 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 14)","    #define FXAA_QUALITY_PS 7","    #define FXAA_QUALITY_P0 1.0","    #define FXAA_QUALITY_P1 1.5","    #define FXAA_QUALITY_P2 2.0","    #define FXAA_QUALITY_P3 2.0","    #define FXAA_QUALITY_P4 2.0","    #define FXAA_QUALITY_P5 4.0","    #define FXAA_QUALITY_P6 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 15)","    #define FXAA_QUALITY_PS 8","    #define FXAA_QUALITY_P0 1.0","    #define FXAA_QUALITY_P1 1.5","    #define FXAA_QUALITY_P2 2.0","    #define FXAA_QUALITY_P3 2.0","    #define FXAA_QUALITY_P4 2.0","    #define FXAA_QUALITY_P5 2.0","    #define FXAA_QUALITY_P6 4.0","    #define FXAA_QUALITY_P7 12.0","#endif","","/*============================================================================","                     FXAA QUALITY - LOW DITHER PRESETS","============================================================================*/","#if (FXAA_QUALITY_PRESET == 20)","    #define FXAA_QUALITY_PS 3","    #define FXAA_QUALITY_P0 1.5","    #define FXAA_QUALITY_P1 2.0","    #define FXAA_QUALITY_P2 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 21)","    #define FXAA_QUALITY_PS 4","    #define FXAA_QUALITY_P0 1.0","    #define FXAA_QUALITY_P1 1.5","    #define FXAA_QUALITY_P2 2.0","    #define FXAA_QUALITY_P3 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 22)","    #define FXAA_QUALITY_PS 5","    #define FXAA_QUALITY_P0 1.0","    #define FXAA_QUALITY_P1 1.5","    #define FXAA_QUALITY_P2 2.0","    #define FXAA_QUALITY_P3 2.0","    #define FXAA_QUALITY_P4 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 23)","    #define FXAA_QUALITY_PS 6","    #define FXAA_QUALITY_P0 1.0","    #define FXAA_QUALITY_P1 1.5","    #define FXAA_QUALITY_P2 2.0","    #define FXAA_QUALITY_P3 2.0","    #define FXAA_QUALITY_P4 2.0","    #define FXAA_QUALITY_P5 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 24)","    #define FXAA_QUALITY_PS 7","    #define FXAA_QUALITY_P0 1.0","    #define FXAA_QUALITY_P1 1.5","    #define FXAA_QUALITY_P2 2.0","    #define FXAA_QUALITY_P3 2.0","    #define FXAA_QUALITY_P4 2.0","    #define FXAA_QUALITY_P5 3.0","    #define FXAA_QUALITY_P6 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 25)","    #define FXAA_QUALITY_PS 8","    #define FXAA_QUALITY_P0 1.0","    #define FXAA_QUALITY_P1 1.5","    #define FXAA_QUALITY_P2 2.0","    #define FXAA_QUALITY_P3 2.0","    #define FXAA_QUALITY_P4 2.0","    #define FXAA_QUALITY_P5 2.0","    #define FXAA_QUALITY_P6 4.0","    #define FXAA_QUALITY_P7 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 26)","    #define FXAA_QUALITY_PS 9","    #define FXAA_QUALITY_P0 1.0","    #define FXAA_QUALITY_P1 1.5","    #define FXAA_QUALITY_P2 2.0","    #define FXAA_QUALITY_P3 2.0","    #define FXAA_QUALITY_P4 2.0","    #define FXAA_QUALITY_P5 2.0","    #define FXAA_QUALITY_P6 2.0","    #define FXAA_QUALITY_P7 4.0","    #define FXAA_QUALITY_P8 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 27)","    #define FXAA_QUALITY_PS 10","    #define FXAA_QUALITY_P0 1.0","    #define FXAA_QUALITY_P1 1.5","    #define FXAA_QUALITY_P2 2.0","    #define FXAA_QUALITY_P3 2.0","    #define FXAA_QUALITY_P4 2.0","    #define FXAA_QUALITY_P5 2.0","    #define FXAA_QUALITY_P6 2.0","    #define FXAA_QUALITY_P7 2.0","    #define FXAA_QUALITY_P8 4.0","    #define FXAA_QUALITY_P9 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 28)","    #define FXAA_QUALITY_PS 11","    #define FXAA_QUALITY_P0 1.0","    #define FXAA_QUALITY_P1 1.5","    #define FXAA_QUALITY_P2 2.0","    #define FXAA_QUALITY_P3 2.0","    #define FXAA_QUALITY_P4 2.0","    #define FXAA_QUALITY_P5 2.0","    #define FXAA_QUALITY_P6 2.0","    #define FXAA_QUALITY_P7 2.0","    #define FXAA_QUALITY_P8 2.0","    #define FXAA_QUALITY_P9 4.0","    #define FXAA_QUALITY_P10 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 29)","    #define FXAA_QUALITY_PS 12","    #define FXAA_QUALITY_P0 1.0","    #define FXAA_QUALITY_P1 1.5","    #define FXAA_QUALITY_P2 2.0","    #define FXAA_QUALITY_P3 2.0","    #define FXAA_QUALITY_P4 2.0","    #define FXAA_QUALITY_P5 2.0","    #define FXAA_QUALITY_P6 2.0","    #define FXAA_QUALITY_P7 2.0","    #define FXAA_QUALITY_P8 2.0","    #define FXAA_QUALITY_P9 2.0","    #define FXAA_QUALITY_P10 4.0","    #define FXAA_QUALITY_P11 8.0","#endif","","/*============================================================================","                     FXAA QUALITY - EXTREME QUALITY","============================================================================*/","#if (FXAA_QUALITY_PRESET == 39)","    #define FXAA_QUALITY_PS 12","    #define FXAA_QUALITY_P0 1.0","    #define FXAA_QUALITY_P1 1.0","    #define FXAA_QUALITY_P2 1.0","    #define FXAA_QUALITY_P3 1.0","    #define FXAA_QUALITY_P4 1.0","    #define FXAA_QUALITY_P5 1.5","    #define FXAA_QUALITY_P6 2.0","    #define FXAA_QUALITY_P7 2.0","    #define FXAA_QUALITY_P8 2.0","    #define FXAA_QUALITY_P9 2.0","    #define FXAA_QUALITY_P10 4.0","    #define FXAA_QUALITY_P11 8.0","#endif","","","","/*============================================================================","","                                API PORTING","","============================================================================*/","#if (FXAA_GLSL_100 == 1) || (FXAA_GLSL_120 == 1) || (FXAA_GLSL_130 == 1)","    #define FxaaBool bool","    #define FxaaDiscard discard","    #define FxaaFloat float","    #define FxaaFloat2 vec2","    #define FxaaFloat3 vec3","    #define FxaaFloat4 vec4","    #define FxaaHalf float","    #define FxaaHalf2 vec2","    #define FxaaHalf3 vec3","    #define FxaaHalf4 vec4","    #define FxaaInt2 ivec2","    #define FxaaSat(x) clamp(x, 0.0, 1.0)","    #define FxaaTex sampler2D","#else","    #define FxaaBool bool","    #define FxaaDiscard clip(-1)","    #define FxaaFloat float","    #define FxaaFloat2 float2","    #define FxaaFloat3 float3","    #define FxaaFloat4 float4","    #define FxaaHalf half","    #define FxaaHalf2 half2","    #define FxaaHalf3 half3","    #define FxaaHalf4 half4","    #define FxaaSat(x) saturate(x)","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_GLSL_100 == 1)","  #define FxaaTexTop(t, p) texture2D(t, p, 0.0)","  #define FxaaTexOff(t, p, o, r) texture2D(t, p + (o * r), 0.0)","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_GLSL_120 == 1)","    // Requires,","    //  #version 120","    // And at least,","    //  #extension GL_EXT_gpu_shader4 : enable","    //  (or set FXAA_FAST_PIXEL_OFFSET 1 to work like DX9)","    #define FxaaTexTop(t, p) texture2DLod(t, p, 0.0)","    #if (FXAA_FAST_PIXEL_OFFSET == 1)","        #define FxaaTexOff(t, p, o, r) texture2DLodOffset(t, p, 0.0, o)","    #else","        #define FxaaTexOff(t, p, o, r) texture2DLod(t, p + (o * r), 0.0)","    #endif","    #if (FXAA_GATHER4_ALPHA == 1)","        // use #extension GL_ARB_gpu_shader5 : enable","        #define FxaaTexAlpha4(t, p) textureGather(t, p, 3)","        #define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)","        #define FxaaTexGreen4(t, p) textureGather(t, p, 1)","        #define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)","    #endif","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_GLSL_130 == 1)",'    // Requires "#version 130" or better',"    #define FxaaTexTop(t, p) textureLod(t, p, 0.0)","    #define FxaaTexOff(t, p, o, r) textureLodOffset(t, p, 0.0, o)","    #if (FXAA_GATHER4_ALPHA == 1)","        // use #extension GL_ARB_gpu_shader5 : enable","        #define FxaaTexAlpha4(t, p) textureGather(t, p, 3)","        #define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)","        #define FxaaTexGreen4(t, p) textureGather(t, p, 1)","        #define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)","    #endif","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_HLSL_3 == 1)","    #define FxaaInt2 float2","    #define FxaaTex sampler2D","    #define FxaaTexTop(t, p) tex2Dlod(t, float4(p, 0.0, 0.0))","    #define FxaaTexOff(t, p, o, r) tex2Dlod(t, float4(p + (o * r), 0, 0))","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_HLSL_4 == 1)","    #define FxaaInt2 int2","    struct FxaaTex { SamplerState smpl; Texture2D tex; };","    #define FxaaTexTop(t, p) t.tex.SampleLevel(t.smpl, p, 0.0)","    #define FxaaTexOff(t, p, o, r) t.tex.SampleLevel(t.smpl, p, 0.0, o)","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_HLSL_5 == 1)","    #define FxaaInt2 int2","    struct FxaaTex { SamplerState smpl; Texture2D tex; };","    #define FxaaTexTop(t, p) t.tex.SampleLevel(t.smpl, p, 0.0)","    #define FxaaTexOff(t, p, o, r) t.tex.SampleLevel(t.smpl, p, 0.0, o)","    #define FxaaTexAlpha4(t, p) t.tex.GatherAlpha(t.smpl, p)","    #define FxaaTexOffAlpha4(t, p, o) t.tex.GatherAlpha(t.smpl, p, o)","    #define FxaaTexGreen4(t, p) t.tex.GatherGreen(t.smpl, p)","    #define FxaaTexOffGreen4(t, p, o) t.tex.GatherGreen(t.smpl, p, o)","#endif","","","/*============================================================================","                   GREEN AS LUMA OPTION SUPPORT FUNCTION","============================================================================*/","#if (FXAA_GREEN_AS_LUMA == 0)","    FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.w; }","#else","    FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; }","#endif","","","","","/*============================================================================","","                             FXAA3 QUALITY - PC","","============================================================================*/","#if (FXAA_PC == 1)","/*--------------------------------------------------------------------------*/","FxaaFloat4 FxaaPixelShader(","    //","    // Use noperspective interpolation here (turn off perspective interpolation).","    // {xy} = center of pixel","    FxaaFloat2 pos,","    //","    // Used only for FXAA Console, and not used on the 360 version.","    // Use noperspective interpolation here (turn off perspective interpolation).","    // {xy_} = upper left of pixel","    // {_zw} = lower right of pixel","    FxaaFloat4 fxaaConsolePosPos,","    //","    // Input color texture.","    // {rgb_} = color in linear or perceptual color space","    // if (FXAA_GREEN_AS_LUMA == 0)","    //     {__a} = luma in perceptual color space (not linear)","    FxaaTex tex,","    //","    // Only used on the optimized 360 version of FXAA Console.",'    // For everything but 360, just use the same input here as for "tex".',"    // For 360, same texture, just alias with a 2nd sampler.","    // This sampler needs to have an exponent bias of -1.","    FxaaTex fxaaConsole360TexExpBiasNegOne,","    //","    // Only used on the optimized 360 version of FXAA Console.",'    // For everything but 360, just use the same input here as for "tex".',"    // For 360, same texture, just alias with a 3nd sampler.","    // This sampler needs to have an exponent bias of -2.","    FxaaTex fxaaConsole360TexExpBiasNegTwo,","    //","    // Only used on FXAA Quality.","    // This must be from a constant/uniform.","    // {x_} = 1.0/screenWidthInPixels","    // {_y} = 1.0/screenHeightInPixels","    FxaaFloat2 fxaaQualityRcpFrame,","    //","    // Only used on FXAA Console.","    // This must be from a constant/uniform.","    // This effects sub-pixel AA quality and inversely sharpness.","    //   Where N ranges between,","    //     N = 0.50 (default)","    //     N = 0.33 (sharper)","    // {x__} = -N/screenWidthInPixels","    // {_y_} = -N/screenHeightInPixels","    // {_z_} =  N/screenWidthInPixels","    // {__w} =  N/screenHeightInPixels","    FxaaFloat4 fxaaConsoleRcpFrameOpt,","    //","    // Only used on FXAA Console.","    // Not used on 360, but used on PS3 and PC.","    // This must be from a constant/uniform.","    // {x__} = -2.0/screenWidthInPixels","    // {_y_} = -2.0/screenHeightInPixels","    // {_z_} =  2.0/screenWidthInPixels","    // {__w} =  2.0/screenHeightInPixels","    FxaaFloat4 fxaaConsoleRcpFrameOpt2,","    //","    // Only used on FXAA Console.","    // Only used on 360 in place of fxaaConsoleRcpFrameOpt2.","    // This must be from a constant/uniform.","    // {x__} =  8.0/screenWidthInPixels","    // {_y_} =  8.0/screenHeightInPixels","    // {_z_} = -4.0/screenWidthInPixels","    // {__w} = -4.0/screenHeightInPixels","    FxaaFloat4 fxaaConsole360RcpFrameOpt2,","    //","    // Only used on FXAA Quality.","    // This used to be the FXAA_QUALITY_SUBPIX define.","    // It is here now to allow easier tuning.","    // Choose the amount of sub-pixel aliasing removal.","    // This can effect sharpness.","    //   1.00 - upper limit (softer)","    //   0.75 - default amount of filtering","    //   0.50 - lower limit (sharper, less sub-pixel aliasing removal)","    //   0.25 - almost off","    //   0.00 - completely off","    FxaaFloat fxaaQualitySubpix,","    //","    // Only used on FXAA Quality.","    // This used to be the FXAA_QUALITY_EDGE_THRESHOLD define.","    // It is here now to allow easier tuning.","    // The minimum amount of local contrast required to apply algorithm.","    //   0.333 - too little (faster)","    //   0.250 - low quality","    //   0.166 - default","    //   0.125 - high quality","    //   0.063 - overkill (slower)","    FxaaFloat fxaaQualityEdgeThreshold,","    //","    // Only used on FXAA Quality.","    // This used to be the FXAA_QUALITY_EDGE_THRESHOLD_MIN define.","    // It is here now to allow easier tuning.","    // Trims the algorithm from processing darks.","    //   0.0833 - upper limit (default, the start of visible unfiltered edges)","    //   0.0625 - high quality (faster)","    //   0.0312 - visible limit (slower)","    // Special notes when using FXAA_GREEN_AS_LUMA,","    //   Likely want to set this to zero.","    //   As colors that are mostly not-green","    //   will appear very dark in the green channel!","    //   Tune by looking at mostly non-green content,","    //   then start at zero and increase until aliasing is a problem.","    FxaaFloat fxaaQualityEdgeThresholdMin,","    //","    // Only used on FXAA Console.","    // This used to be the FXAA_CONSOLE_EDGE_SHARPNESS define.","    // It is here now to allow easier tuning.","    // This does not effect PS3, as this needs to be compiled in.","    //   Use FXAA_CONSOLE_PS3_EDGE_SHARPNESS for PS3.","    //   Due to the PS3 being ALU bound,","    //   there are only three safe values here: 2 and 4 and 8.","    //   These options use the shaders ability to a free *|/ by 2|4|8.","    // For all other platforms can be a non-power of two.","    //   8.0 is sharper (default!!!)","    //   4.0 is softer","    //   2.0 is really soft (good only for vector graphics inputs)","    FxaaFloat fxaaConsoleEdgeSharpness,","    //","    // Only used on FXAA Console.","    // This used to be the FXAA_CONSOLE_EDGE_THRESHOLD define.","    // It is here now to allow easier tuning.","    // This does not effect PS3, as this needs to be compiled in.","    //   Use FXAA_CONSOLE_PS3_EDGE_THRESHOLD for PS3.","    //   Due to the PS3 being ALU bound,","    //   there are only two safe values here: 1/4 and 1/8.","    //   These options use the shaders ability to a free *|/ by 2|4|8.","    // The console setting has a different mapping than the quality setting.","    // Other platforms can use other values.","    //   0.125 leaves less aliasing, but is softer (default!!!)","    //   0.25 leaves more aliasing, and is sharper","    FxaaFloat fxaaConsoleEdgeThreshold,","    //","    // Only used on FXAA Console.","    // This used to be the FXAA_CONSOLE_EDGE_THRESHOLD_MIN define.","    // It is here now to allow easier tuning.","    // Trims the algorithm from processing darks.","    // The console setting has a different mapping than the quality setting.","    // This only applies when FXAA_EARLY_EXIT is 1.","    // This does not apply to PS3,","    // PS3 was simplified to avoid more shader instructions.","    //   0.06 - faster but more aliasing in darks","    //   0.05 - default","    //   0.04 - slower and less aliasing in darks","    // Special notes when using FXAA_GREEN_AS_LUMA,","    //   Likely want to set this to zero.","    //   As colors that are mostly not-green","    //   will appear very dark in the green channel!","    //   Tune by looking at mostly non-green content,","    //   then start at zero and increase until aliasing is a problem.","    FxaaFloat fxaaConsoleEdgeThresholdMin,","    //","    // Extra constants for 360 FXAA Console only.","    // Use zeros or anything else for other platforms.","    // These must be in physical constant registers and NOT immediates.","    // Immediates will result in compiler un-optimizing.","    // {xyzw} = float4(1.0, -1.0, 0.25, -0.25)","    FxaaFloat4 fxaaConsole360ConstDir",") {","/*--------------------------------------------------------------------------*/","    FxaaFloat2 posM;","    posM.x = pos.x;","    posM.y = pos.y;","    #if (FXAA_GATHER4_ALPHA == 1)","        #if (FXAA_DISCARD == 0)","            FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);","            #if (FXAA_GREEN_AS_LUMA == 0)","                #define lumaM rgbyM.w","            #else","                #define lumaM rgbyM.y","            #endif","        #endif","        #if (FXAA_GREEN_AS_LUMA == 0)","            FxaaFloat4 luma4A = FxaaTexAlpha4(tex, posM);","            FxaaFloat4 luma4B = FxaaTexOffAlpha4(tex, posM, FxaaInt2(-1, -1));","        #else","            FxaaFloat4 luma4A = FxaaTexGreen4(tex, posM);","            FxaaFloat4 luma4B = FxaaTexOffGreen4(tex, posM, FxaaInt2(-1, -1));","        #endif","        #if (FXAA_DISCARD == 1)","            #define lumaM luma4A.w","        #endif","        #define lumaE luma4A.z","        #define lumaS luma4A.x","        #define lumaSE luma4A.y","        #define lumaNW luma4B.w","        #define lumaN luma4B.z","        #define lumaW luma4B.x","    #else","        FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);","        #if (FXAA_GREEN_AS_LUMA == 0)","            #define lumaM rgbyM.w","        #else","            #define lumaM rgbyM.y","        #endif","        #if (FXAA_GLSL_100 == 1)","          FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 0.0, 1.0), fxaaQualityRcpFrame.xy));","          FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 1.0, 0.0), fxaaQualityRcpFrame.xy));","          FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 0.0,-1.0), fxaaQualityRcpFrame.xy));","          FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0, 0.0), fxaaQualityRcpFrame.xy));","        #else","          FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0, 1), fxaaQualityRcpFrame.xy));","          FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 0), fxaaQualityRcpFrame.xy));","          FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0,-1), fxaaQualityRcpFrame.xy));","          FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 0), fxaaQualityRcpFrame.xy));","        #endif","    #endif","/*--------------------------------------------------------------------------*/","    FxaaFloat maxSM = max(lumaS, lumaM);","    FxaaFloat minSM = min(lumaS, lumaM);","    FxaaFloat maxESM = max(lumaE, maxSM);","    FxaaFloat minESM = min(lumaE, minSM);","    FxaaFloat maxWN = max(lumaN, lumaW);","    FxaaFloat minWN = min(lumaN, lumaW);","    FxaaFloat rangeMax = max(maxWN, maxESM);","    FxaaFloat rangeMin = min(minWN, minESM);","    FxaaFloat rangeMaxScaled = rangeMax * fxaaQualityEdgeThreshold;","    FxaaFloat range = rangeMax - rangeMin;","    FxaaFloat rangeMaxClamped = max(fxaaQualityEdgeThresholdMin, rangeMaxScaled);","    FxaaBool earlyExit = range < rangeMaxClamped;","/*--------------------------------------------------------------------------*/","    if(earlyExit)","        #if (FXAA_DISCARD == 1)","            FxaaDiscard;","        #else","            return rgbyM;","        #endif","/*--------------------------------------------------------------------------*/","    #if (FXAA_GATHER4_ALPHA == 0)","        #if (FXAA_GLSL_100 == 1)","          FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0,-1.0), fxaaQualityRcpFrame.xy));","          FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 1.0, 1.0), fxaaQualityRcpFrame.xy));","          FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 1.0,-1.0), fxaaQualityRcpFrame.xy));","          FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0, 1.0), fxaaQualityRcpFrame.xy));","        #else","          FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1,-1), fxaaQualityRcpFrame.xy));","          FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 1), fxaaQualityRcpFrame.xy));","          FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1,-1), fxaaQualityRcpFrame.xy));","          FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));","        #endif","    #else","        FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(1, -1), fxaaQualityRcpFrame.xy));","        FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));","    #endif","/*--------------------------------------------------------------------------*/","    FxaaFloat lumaNS = lumaN + lumaS;","    FxaaFloat lumaWE = lumaW + lumaE;","    FxaaFloat subpixRcpRange = 1.0/range;","    FxaaFloat subpixNSWE = lumaNS + lumaWE;","    FxaaFloat edgeHorz1 = (-2.0 * lumaM) + lumaNS;","    FxaaFloat edgeVert1 = (-2.0 * lumaM) + lumaWE;","/*--------------------------------------------------------------------------*/","    FxaaFloat lumaNESE = lumaNE + lumaSE;","    FxaaFloat lumaNWNE = lumaNW + lumaNE;","    FxaaFloat edgeHorz2 = (-2.0 * lumaE) + lumaNESE;","    FxaaFloat edgeVert2 = (-2.0 * lumaN) + lumaNWNE;","/*--------------------------------------------------------------------------*/","    FxaaFloat lumaNWSW = lumaNW + lumaSW;","    FxaaFloat lumaSWSE = lumaSW + lumaSE;","    FxaaFloat edgeHorz4 = (abs(edgeHorz1) * 2.0) + abs(edgeHorz2);","    FxaaFloat edgeVert4 = (abs(edgeVert1) * 2.0) + abs(edgeVert2);","    FxaaFloat edgeHorz3 = (-2.0 * lumaW) + lumaNWSW;","    FxaaFloat edgeVert3 = (-2.0 * lumaS) + lumaSWSE;","    FxaaFloat edgeHorz = abs(edgeHorz3) + edgeHorz4;","    FxaaFloat edgeVert = abs(edgeVert3) + edgeVert4;","/*--------------------------------------------------------------------------*/","    FxaaFloat subpixNWSWNESE = lumaNWSW + lumaNESE;","    FxaaFloat lengthSign = fxaaQualityRcpFrame.x;","    FxaaBool horzSpan = edgeHorz >= edgeVert;","    FxaaFloat subpixA = subpixNSWE * 2.0 + subpixNWSWNESE;","/*--------------------------------------------------------------------------*/","    if(!horzSpan) lumaN = lumaW;","    if(!horzSpan) lumaS = lumaE;","    if(horzSpan) lengthSign = fxaaQualityRcpFrame.y;","    FxaaFloat subpixB = (subpixA * (1.0/12.0)) - lumaM;","/*--------------------------------------------------------------------------*/","    FxaaFloat gradientN = lumaN - lumaM;","    FxaaFloat gradientS = lumaS - lumaM;","    FxaaFloat lumaNN = lumaN + lumaM;","    FxaaFloat lumaSS = lumaS + lumaM;","    FxaaBool pairN = abs(gradientN) >= abs(gradientS);","    FxaaFloat gradient = max(abs(gradientN), abs(gradientS));","    if(pairN) lengthSign = -lengthSign;","    FxaaFloat subpixC = FxaaSat(abs(subpixB) * subpixRcpRange);","/*--------------------------------------------------------------------------*/","    FxaaFloat2 posB;","    posB.x = posM.x;","    posB.y = posM.y;","    FxaaFloat2 offNP;","    offNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x;","    offNP.y = ( horzSpan) ? 0.0 : fxaaQualityRcpFrame.y;","    if(!horzSpan) posB.x += lengthSign * 0.5;","    if( horzSpan) posB.y += lengthSign * 0.5;","/*--------------------------------------------------------------------------*/","    FxaaFloat2 posN;","    posN.x = posB.x - offNP.x * FXAA_QUALITY_P0;","    posN.y = posB.y - offNP.y * FXAA_QUALITY_P0;","    FxaaFloat2 posP;","    posP.x = posB.x + offNP.x * FXAA_QUALITY_P0;","    posP.y = posB.y + offNP.y * FXAA_QUALITY_P0;","    FxaaFloat subpixD = ((-2.0)*subpixC) + 3.0;","    FxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN));","    FxaaFloat subpixE = subpixC * subpixC;","    FxaaFloat lumaEndP = FxaaLuma(FxaaTexTop(tex, posP));","/*--------------------------------------------------------------------------*/","    if(!pairN) lumaNN = lumaSS;","    FxaaFloat gradientScaled = gradient * 1.0/4.0;","    FxaaFloat lumaMM = lumaM - lumaNN * 0.5;","    FxaaFloat subpixF = subpixD * subpixE;","    FxaaBool lumaMLTZero = lumaMM < 0.0;","/*--------------------------------------------------------------------------*/","    lumaEndN -= lumaNN * 0.5;","    lumaEndP -= lumaNN * 0.5;","    FxaaBool doneN = abs(lumaEndN) >= gradientScaled;","    FxaaBool doneP = abs(lumaEndP) >= gradientScaled;","    if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P1;","    if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P1;","    FxaaBool doneNP = (!doneN) || (!doneP);","    if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P1;","    if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P1;","/*--------------------------------------------------------------------------*/","    if(doneNP) {","        if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));","        if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));","        if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;","        if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;","        doneN = abs(lumaEndN) >= gradientScaled;","        doneP = abs(lumaEndP) >= gradientScaled;","        if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P2;","        if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P2;","        doneNP = (!doneN) || (!doneP);","        if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P2;","        if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P2;","/*--------------------------------------------------------------------------*/","        #if (FXAA_QUALITY_PS > 3)","        if(doneNP) {","            if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));","            if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));","            if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;","            if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;","            doneN = abs(lumaEndN) >= gradientScaled;","            doneP = abs(lumaEndP) >= gradientScaled;","            if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P3;","            if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P3;","            doneNP = (!doneN) || (!doneP);","            if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P3;","            if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P3;","/*--------------------------------------------------------------------------*/","            #if (FXAA_QUALITY_PS > 4)","            if(doneNP) {","                if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));","                if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));","                if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;","                if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;","                doneN = abs(lumaEndN) >= gradientScaled;","                doneP = abs(lumaEndP) >= gradientScaled;","                if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P4;","                if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P4;","                doneNP = (!doneN) || (!doneP);","                if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P4;","                if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P4;","/*--------------------------------------------------------------------------*/","                #if (FXAA_QUALITY_PS > 5)","                if(doneNP) {","                    if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));","                    if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));","                    if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;","                    if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;","                    doneN = abs(lumaEndN) >= gradientScaled;","                    doneP = abs(lumaEndP) >= gradientScaled;","                    if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P5;","                    if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P5;","                    doneNP = (!doneN) || (!doneP);","                    if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P5;","                    if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P5;","/*--------------------------------------------------------------------------*/","                    #if (FXAA_QUALITY_PS > 6)","                    if(doneNP) {","                        if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));","                        if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));","                        if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;","                        if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;","                        doneN = abs(lumaEndN) >= gradientScaled;","                        doneP = abs(lumaEndP) >= gradientScaled;","                        if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P6;","                        if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P6;","                        doneNP = (!doneN) || (!doneP);","                        if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P6;","                        if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P6;","/*--------------------------------------------------------------------------*/","                        #if (FXAA_QUALITY_PS > 7)","                        if(doneNP) {","                            if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));","                            if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));","                            if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;","                            if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;","                            doneN = abs(lumaEndN) >= gradientScaled;","                            doneP = abs(lumaEndP) >= gradientScaled;","                            if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P7;","                            if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P7;","                            doneNP = (!doneN) || (!doneP);","                            if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P7;","                            if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P7;","/*--------------------------------------------------------------------------*/","    #if (FXAA_QUALITY_PS > 8)","    if(doneNP) {","        if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));","        if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));","        if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;","        if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;","        doneN = abs(lumaEndN) >= gradientScaled;","        doneP = abs(lumaEndP) >= gradientScaled;","        if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P8;","        if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P8;","        doneNP = (!doneN) || (!doneP);","        if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P8;","        if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P8;","/*--------------------------------------------------------------------------*/","        #if (FXAA_QUALITY_PS > 9)","        if(doneNP) {","            if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));","            if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));","            if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;","            if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;","            doneN = abs(lumaEndN) >= gradientScaled;","            doneP = abs(lumaEndP) >= gradientScaled;","            if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P9;","            if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P9;","            doneNP = (!doneN) || (!doneP);","            if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P9;","            if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P9;","/*--------------------------------------------------------------------------*/","            #if (FXAA_QUALITY_PS > 10)","            if(doneNP) {","                if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));","                if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));","                if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;","                if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;","                doneN = abs(lumaEndN) >= gradientScaled;","                doneP = abs(lumaEndP) >= gradientScaled;","                if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P10;","                if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P10;","                doneNP = (!doneN) || (!doneP);","                if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P10;","                if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P10;","/*--------------------------------------------------------------------------*/","                #if (FXAA_QUALITY_PS > 11)","                if(doneNP) {","                    if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));","                    if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));","                    if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;","                    if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;","                    doneN = abs(lumaEndN) >= gradientScaled;","                    doneP = abs(lumaEndP) >= gradientScaled;","                    if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P11;","                    if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P11;","                    doneNP = (!doneN) || (!doneP);","                    if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P11;","                    if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P11;","/*--------------------------------------------------------------------------*/","                    #if (FXAA_QUALITY_PS > 12)","                    if(doneNP) {","                        if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));","                        if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));","                        if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;","                        if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;","                        doneN = abs(lumaEndN) >= gradientScaled;","                        doneP = abs(lumaEndP) >= gradientScaled;","                        if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P12;","                        if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P12;","                        doneNP = (!doneN) || (!doneP);","                        if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P12;","                        if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P12;","/*--------------------------------------------------------------------------*/","                    }","                    #endif","/*--------------------------------------------------------------------------*/","                }","                #endif","/*--------------------------------------------------------------------------*/","            }","            #endif","/*--------------------------------------------------------------------------*/","        }","        #endif","/*--------------------------------------------------------------------------*/","    }","    #endif","/*--------------------------------------------------------------------------*/","                        }","                        #endif","/*--------------------------------------------------------------------------*/","                    }","                    #endif","/*--------------------------------------------------------------------------*/","                }","                #endif","/*--------------------------------------------------------------------------*/","            }","            #endif","/*--------------------------------------------------------------------------*/","        }","        #endif","/*--------------------------------------------------------------------------*/","    }","/*--------------------------------------------------------------------------*/","    FxaaFloat dstN = posM.x - posN.x;","    FxaaFloat dstP = posP.x - posM.x;","    if(!horzSpan) dstN = posM.y - posN.y;","    if(!horzSpan) dstP = posP.y - posM.y;","/*--------------------------------------------------------------------------*/","    FxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero;","    FxaaFloat spanLength = (dstP + dstN);","    FxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero;","    FxaaFloat spanLengthRcp = 1.0/spanLength;","/*--------------------------------------------------------------------------*/","    FxaaBool directionN = dstN < dstP;","    FxaaFloat dst = min(dstN, dstP);","    FxaaBool goodSpan = directionN ? goodSpanN : goodSpanP;","    FxaaFloat subpixG = subpixF * subpixF;","    FxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5;","    FxaaFloat subpixH = subpixG * fxaaQualitySubpix;","/*--------------------------------------------------------------------------*/","    FxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0;","    FxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH);","    if(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign;","    if( horzSpan) posM.y += pixelOffsetSubpix * lengthSign;","    #if (FXAA_DISCARD == 1)","        return FxaaTexTop(tex, posM);","    #else","        return FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM);","    #endif","}","/*==========================================================================*/","#endif","","void main() {","  gl_FragColor = FxaaPixelShader(","    vUv,","    vec4(0.0),","    tDiffuse,","    tDiffuse,","    tDiffuse,","    resolution,","    vec4(0.0),","    vec4(0.0),","    vec4(0.0),","    0.75,","    0.166,","    0.0833,","    0.0,","    0.0,","    0.0,","    vec4(0.0)","  );","","  // TODO avoid querying texture twice for same texel","  gl_FragColor.a = texture2D(tDiffuse, vUv).a;","}"].join("\n")};function O3(t){return(O3="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 L3(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,function(t){t=function(t,n){if("object"!=O3(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=O3(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==O3(t)?t:t+""}(i.key),i)}}function R3(t,n){return n?(n.copy(t),n):t.clone()}function N3(t,n){return t.equals(n)}var Ly=function(){return t=function t(){var n=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},e=this,i=t;if(!(e instanceof i))throw new TypeError("Cannot call a class as a function");this.vb=new Ps,this.rs=n;var e=this.rs,i=e.renderManager,e=e.map,r={minFilter:Zn,magFilter:Zn,format:le,stencilBuffer:!1},o=i.renderer.domElement.parentElement.clientWidth*i.renderer.getPixelRatio(),s=i.renderer.domElement.parentElement.clientHeight*i.renderer.getPixelRatio(),r=new Gc(o,s,r);this.pb=new d3(i.renderer,r),this.mb=new A3({w:o,h:s,scene:this.vb,camera:e.camera,renderer:i.renderer,layers:n.layers,mode:n.mode,type:n.type}),this.yb=new QS(M3),this.yb.uniforms.resolution.value.set(1/o,1/s),this.pb.addPass(this.mb),this.pb.addPass(this.yb),this.handleResize=this.handleResize.bind(this),this.handleViewChange=this.handleViewChange.bind(this),this.handleViewModeChanged=this.handleViewModeChanged.bind(this),this.va=!0,this.bb=-1,e.on("resize",this.handleResize),e.on("viewChanged",this.handleViewChange),e.on("viewModeChanged",this.handleViewModeChanged)},(n=[{key:"enable",get:function(){return this.va},set:function(t){this.va=t,this.mb.enable=t,this.vb.children.length=0}},{key:"handleViewModeChanged",value:function(){this.mb.setPass(void 0,this.rs.map.camera)}},{key:"handleViewChange",value:function(){var t=this;this.rs.mode!=Q2.RUNTIME&&(this.enable=!1,clearTimeout(this.bb),this.bb=setTimeout(function(){t.enable=!0,t.rs.map.enableUpdateRender()},500))}},{key:"handleResize",value:function(){var t=this.rs.renderManager;this.pb.setSize(t.renderer.domElement.parentElement.clientWidth,t.renderer.domElement.parentElement.clientHeight)}},{key:"render",value:function(){var n=this,e=this.rs.renderManager,i=!1,r=[];this.va?(this.vb.children.length=0,e.Ct.forEach(function(t){"model"!==t.name&&"extent"!=t.name&&"externalModel"!=t.name&&"dynamicModel"!=t.name||(("externalModel"!==t.name||"externalModel"===t.name&&i)&&0<t.children.length&&("DirectionalLight"===t.children[0].type||"AmbientLight"===t.children[0].type)&&(t.children[0].visible=!1,t.children[1].visible=!1,t.children[2].visible=!1),"externalModel"!==t.name||i||(i=!0,t.traverse(function(t){"PointLight"===t.type&&r.push(t),"Mesh"===t.type&&(t.userData.resetLight=!0)})),"model"!==t.name&&"extent"!==t.name||t.traverse(function(t){"Mesh"===t.type&&(t.userData.resetLight=!0,t.onBeforeRender=function(){r.forEach(function(t){t.userData.intensity=t.intensity,t.intensity=0})},t.onAfterRender=function(){r.forEach(function(t){t.intensity=t.userData.intensity,delete t.userData.intensity})})}),n.vb.add(t))}),this.mb.setPass(this.vb),this.pb.render(),e.renderer.setRenderTarget(null),e.Ct.forEach(function(t){"model"!==t.name&&"externalModel"!==t.name&&"extent"!==t.name&&"dynamicModel"!==t.name&&e.renderer.render(t,e._n.Ut)})):e.Ct.forEach(function(t){"externalModel"!==t.name&&0<t.children.length&&("DirectionalLight"===t.children[0].type||"AmbientLight"===t.children[0].type)&&(t.children[0].visible=!0,t.children[1].visible=!0,t.children[2].visible=!0),e.renderer.render(t,e._n.Ut)})}}])&&L3(t.prototype,n),e&&L3(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,e}(),P3={WHITE:new lt(16777215),BLACK:new lt(0),TRANSPARENT:new lt(0,0,0)},F3={clone:R3,equals:N3,ZERO:new Mt(0,0)},j3={clone:R3,equals:N3,ZERO:new Tt(0,0)};function I3(t,n){return null!=t?t:n}I3.EMPTY_OBJECT=Object.freeze({});var y=I3;function C3(t){return(C3="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 D3(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,function(t){t=function(t,n){if("object"!=C3(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=C3(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==C3(t)?t:t+""}(i.key),i)}}var k3=function(){function e(t,n){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");this.gb=n,this._b=new Mt(0,0),this.wb=j3.clone(y(t.eyeOffset,j3.ZERO)),this.xb=y(t.verticalOrigin,x0.CENTER),this.Eb=y(t.horizontalOrigin,w0.CENTER),this.q1=y(t.scale,1)}return t=e,(n=[{key:"horizontalOrigin",get:function(){return this.Eb},set:function(t){this.Eb=t}},{key:"verticalOrigin",get:function(){return this.xb},set:function(t){this.xb=t}},{key:"image",get:function(){return this.Sb},set:function(t){this.setImage(t,t)}},{key:"setImage",value:function(t,n){this.Tb=-1,this.Ab=void 0,this.Sb=t,this.Mb=n,I(this.gb.Ob)&&this._loadImage()}},{key:"_loadImage",value:function(){var t,e=this,i=this.gb.Ob,r=this.Sb,o=this.Mb;I(o)&&(t=i.addImage(r,o)),I(this.Lb=t)&&t.then(function(t){var n;e.Sb===r&&e.Mb===o&&(n=i.textureCoordinates[t],e.Rb=i.texture.width*n.width,e.Nb=i.texture.height*n.height,e.Tb=t,e.Pb=!0,e.Mb=void 0,e.Lb=void 0,I(t=(n=e).gb))&&(t._updateBillboard(n),n.G0=!0)}).catch(function(t){console.error("Error loading image for billboard: ".concat(t)),e.Lb=void 0})}},{key:"_setTranslate",value:function(t){var n=this._b;F3.equals(n,t)||F3.clone(t,n)}}])&&D3(t.prototype,n),i&&D3(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,i}();function U3(t){var n;this.name="DeveloperError",this.message=t;try{throw new Error}catch(t){n=t.stack}this.stack=n}I(Object.create)&&((U3.prototype=Object.create(Error.prototype)).constructor=U3),U3.prototype.toString=function(){var t="".concat(this.name,": ").concat(this.message);return I(this.stack)&&(t+="\n".concat(this.stack.toString())),t},U3.throwInstantiationError=function(){throw new U3("This function defines an interface and should not be called directly.")};var m=U3;function B3(t){return(B3="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)}var G3={};function H3(t,n,e){return"Expected ".concat(e," to be typeof ").concat(n,", actual typeof was ").concat(t)}G3.typeOf={},G3.defined=function(t,n){if(!I(n))throw new m("".concat(t," is required, actual value was undefined"))},G3.typeOf.func=function(t,n){if("function"!=typeof n)throw new m(H3(B3(n),"function",t))},G3.typeOf.string=function(t,n){if("string"!=typeof n)throw new m(H3(B3(n),"string",t))},G3.typeOf.number=function(t,n){if("number"!=typeof n)throw new m(H3(B3(n),"number",t))},G3.typeOf.number.lessThan=function(t,n,e){if(G3.typeOf.number(t,n),e<=n)throw new m("Expected ".concat(t," to be less than ").concat(e,", actual value was ").concat(n))},G3.typeOf.number.lessThanOrEquals=function(t,n,e){if(G3.typeOf.number(t,n),e<n)throw new m("Expected ".concat(t," to be less than or equal to ").concat(e,", actual value was ").concat(n))},G3.typeOf.number.greaterThan=function(t,n,e){if(G3.typeOf.number(t,n),n<=e)throw new m("Expected ".concat(t," to be greater than ").concat(e,", actual value was ").concat(n))},G3.typeOf.number.greaterThanOrEquals=function(t,n,e){if(G3.typeOf.number(t,n),n<e)throw new m("Expected ".concat(t," to be greater than or equal to ").concat(e,", actual value was ").concat(n))},G3.typeOf.object=function(t,n){if("object"!==B3(n))throw new m(H3(B3(n),"object",t))},G3.typeOf.bool=function(t,n){if("boolean"!=typeof n)throw new m(H3(B3(n),"boolean",t))},G3.typeOf.bigint=function(t,n){if("bigint"!=typeof n)throw new m(H3(B3(n),"bigint",t))},G3.typeOf.number.equals=function(t,n,e,i){if(G3.typeOf.number(t,e),G3.typeOf.number(n,i),e!==i)throw new m("".concat(t," must be equal to ").concat(n,", the actual values are ").concat(e," and ").concat(i))};var U=G3;function X3(t){return(X3="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 V3(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,function(t){t=function(t,n){if("object"!=X3(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=X3(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==X3(t)?t:t+""}(i.key),i)}}var z3=Math.PI/180,G=function(){function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function")}return n=t,i=[{key:"equalsEpsilon",value:function(t,n,e,i){if(!I(t))throw new m("left is required.");if(!I(n))throw new m("right is required.");e=y(e,0),i=y(i,e);var r=Math.abs(t-n);return r<=i||r<=e*Math.max(Math.abs(t),Math.abs(n))}},{key:"toRadians",value:function(t){if(I(t))return t*z3;throw new m("degrees is required.")}}],(e=null)&&V3(n.prototype,e),i&&V3(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,e,i}();function c(t,n,e){this.x=y(t,0),this.y=y(n,0),this.z=y(e,0)}c.fromSpherical=function(t,n){U.typeOf.object("spherical",t),I(n)||(n=new c);var e=t.clock,i=t.cone,t=y(t.magnitude,1),r=t*Math.sin(i);return n.x=r*Math.cos(e),n.y=r*Math.sin(e),n.z=t*Math.cos(i),n},c.fromElements=function(t,n,e,i){return I(i)?(i.x=t,i.y=n,i.z=e,i):new c(t,n,e)},c.fromCartesian4=c.clone=function(t,n){if(I(t))return I(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n):new c(t.x,t.y,t.z)},c.packedLength=3,c.pack=function(t,n,e){return U.typeOf.object("value",t),U.defined("array",n),e=y(e,0),n[e++]=t.x,n[e++]=t.y,n[e]=t.z,n},c.unpack=function(t,n,e){return U.defined("array",t),n=y(n,0),(e=I(e)?e:new c).x=t[n++],e.y=t[n++],e.z=t[n],e},c.packArray=function(t,n){U.defined("array",t);var e=t.length,i=3*e;if(I(n)){if(!Array.isArray(n)&&n.length!==i)throw new m("If result is a typed array, it must have exactly array.length * 3 elements");n.length!==i&&(n.length=i)}else n=new Array(i);for(var r=0;r<e;++r)c.pack(t[r],n,3*r);return n},c.unpackArray=function(t,n){if(U.defined("array",t),U.typeOf.number.greaterThanOrEquals("array.length",t.length,3),t.length%3!=0)throw new m("array length must be a multiple of 3.");var e=t.length;I(n)?n.length=e/3:n=new Array(e/3);for(var i=0;i<e;i+=3){var r=i/3;n[r]=c.unpack(t,i,n[r])}return n},c.fromArray=c.unpack,c.maximumComponent=function(t){return U.typeOf.object("cartesian",t),Math.max(t.x,t.y,t.z)},c.minimumComponent=function(t){return U.typeOf.object("cartesian",t),Math.min(t.x,t.y,t.z)},c.minimumByComponent=function(t,n,e){return U.typeOf.object("first",t),U.typeOf.object("second",n),U.typeOf.object("result",e),e.x=Math.min(t.x,n.x),e.y=Math.min(t.y,n.y),e.z=Math.min(t.z,n.z),e},c.maximumByComponent=function(t,n,e){return U.typeOf.object("first",t),U.typeOf.object("second",n),U.typeOf.object("result",e),e.x=Math.max(t.x,n.x),e.y=Math.max(t.y,n.y),e.z=Math.max(t.z,n.z),e},c.clamp=function(t,n,e,i){U.typeOf.object("value",t),U.typeOf.object("min",n),U.typeOf.object("max",e),U.typeOf.object("result",i);var r=G.clamp(t.x,n.x,e.x),o=G.clamp(t.y,n.y,e.y),t=G.clamp(t.z,n.z,e.z);return i.x=r,i.y=o,i.z=t,i},c.magnitudeSquared=function(t){return U.typeOf.object("cartesian",t),t.x*t.x+t.y*t.y+t.z*t.z},c.magnitude=function(t){return Math.sqrt(c.magnitudeSquared(t))};var W3=new c,Y3=(c.distance=function(t,n){return U.typeOf.object("left",t),U.typeOf.object("right",n),c.subtract(t,n,W3),c.magnitude(W3)},c.distanceSquared=function(t,n){return U.typeOf.object("left",t),U.typeOf.object("right",n),c.subtract(t,n,W3),c.magnitudeSquared(W3)},c.normalize=function(t,n){U.typeOf.object("cartesian",t),U.typeOf.object("result",n);var e=c.magnitude(t);if(n.x=t.x/e,n.y=t.y/e,n.z=t.z/e,isNaN(n.x)||isNaN(n.y)||isNaN(n.z))throw new m("normalized result is not a number");return n},c.dot=function(t,n){return U.typeOf.object("left",t),U.typeOf.object("right",n),t.x*n.x+t.y*n.y+t.z*n.z},c.multiplyComponents=function(t,n,e){return U.typeOf.object("left",t),U.typeOf.object("right",n),U.typeOf.object("result",e),e.x=t.x*n.x,e.y=t.y*n.y,e.z=t.z*n.z,e},c.divideComponents=function(t,n,e){return U.typeOf.object("left",t),U.typeOf.object("right",n),U.typeOf.object("result",e),e.x=t.x/n.x,e.y=t.y/n.y,e.z=t.z/n.z,e},c.add=function(t,n,e){return U.typeOf.object("left",t),U.typeOf.object("right",n),U.typeOf.object("result",e),e.x=t.x+n.x,e.y=t.y+n.y,e.z=t.z+n.z,e},c.subtract=function(t,n,e){return U.typeOf.object("left",t),U.typeOf.object("right",n),U.typeOf.object("result",e),e.x=t.x-n.x,e.y=t.y-n.y,e.z=t.z-n.z,e},c.multiplyByScalar=function(t,n,e){return U.typeOf.object("cartesian",t),U.typeOf.number("scalar",n),U.typeOf.object("result",e),e.x=t.x*n,e.y=t.y*n,e.z=t.z*n,e},c.divideByScalar=function(t,n,e){return U.typeOf.object("cartesian",t),U.typeOf.number("scalar",n),U.typeOf.object("result",e),e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e},c.negate=function(t,n){return U.typeOf.object("cartesian",t),U.typeOf.object("result",n),n.x=-t.x,n.y=-t.y,n.z=-t.z,n},c.abs=function(t,n){return U.typeOf.object("cartesian",t),U.typeOf.object("result",n),n.x=Math.abs(t.x),n.y=Math.abs(t.y),n.z=Math.abs(t.z),n},new c),Q3=(c.lerp=function(t,n,e,i){return U.typeOf.object("start",t),U.typeOf.object("end",n),U.typeOf.number("t",e),U.typeOf.object("result",i),c.multiplyByScalar(n,e,Y3),i=c.multiplyByScalar(t,1-e,i),c.add(Y3,i,i)},new c),Z3=new c,q3=(c.angleBetween=function(t,n){U.typeOf.object("left",t),U.typeOf.object("right",n),c.normalize(t,Q3),c.normalize(n,Z3);t=c.dot(Q3,Z3),n=c.magnitude(c.cross(Q3,Z3,Q3));return Math.atan2(n,t)},new c),K3=(c.mostOrthogonalAxis=function(t,n){U.typeOf.object("cartesian",t),U.typeOf.object("result",n);t=c.normalize(t,q3);return c.abs(t,t),n=t.x<=t.y?t.x<=t.z?c.clone(c.UNIT_X,n):c.clone(c.UNIT_Z,n):t.y<=t.z?c.clone(c.UNIT_Y,n):c.clone(c.UNIT_Z,n)},c.projectVector=function(t,n,e){U.defined("a",t),U.defined("b",n),U.defined("result",e);t=c.dot(t,n)/c.dot(n,n);return c.multiplyByScalar(n,t,e)},c.equals=function(t,n){return t===n||I(t)&&I(n)&&t.x===n.x&&t.y===n.y&&t.z===n.z},c.equalsArray=function(t,n,e){return t.x===n[e]&&t.y===n[e+1]&&t.z===n[e+2]},c.equalsEpsilon=function(t,n,e,i){return t===n||I(t)&&I(n)&&G.equalsEpsilon(t.x,n.x,e,i)&&G.equalsEpsilon(t.y,n.y,e,i)&&G.equalsEpsilon(t.z,n.z,e,i)},c.cross=function(t,n,e){U.typeOf.object("left",t),U.typeOf.object("right",n),U.typeOf.object("result",e);var i=t.x,r=t.y,t=t.z,o=n.x,s=n.y,n=n.z,a=t*o-i*n,i=i*s-r*o;return e.x=r*n-t*s,e.y=a,e.z=i,e},c.midpoint=function(t,n,e){return U.typeOf.object("left",t),U.typeOf.object("right",n),U.typeOf.object("result",e),e.x=.5*(t.x+n.x),e.y=.5*(t.y+n.y),e.z=.5*(t.z+n.z),e},c.fromDegrees=function(t,n,e,i,r){return U.typeOf.number("longitude",t),U.typeOf.number("latitude",n),t=G.toRadians(t),n=G.toRadians(n),c.fromRadians(t,n,e,i,r)},new c),J3=new c,$3=new c(40680631590769,40680631590769,40408299984661.445),b=(c.fromRadians=function(t,n,e,i,r){U.typeOf.number("longitude",t),U.typeOf.number("latitude",n),e=y(e,0);var i=I(i)?i.radiiSquared:$3,o=Math.cos(n),o=(K3.x=o*Math.cos(t),K3.y=o*Math.sin(t),K3.z=Math.sin(n),K3=c.normalize(K3,K3),c.multiplyComponents(i,K3,J3),Math.sqrt(c.dot(K3,J3)));return J3=c.divideByScalar(J3,o,J3),K3=c.multiplyByScalar(K3,e,K3),I(r)||(r=new c),c.add(J3,K3,r)},c.fromDegreesArray=function(t,n,e){if(U.defined("coordinates",t),t.length<2||t.length%2!=0)throw new m("the number of coordinates must be a multiple of 2 and at least 2");var i=t.length;I(e)?e.length=i/2:e=new Array(i/2);for(var r=0;r<i;r+=2){var o=t[r],s=t[r+1],a=r/2;e[a]=c.fromDegrees(o,s,0,n,e[a])}return e},c.fromRadiansArray=function(t,n,e){if(U.defined("coordinates",t),t.length<2||t.length%2!=0)throw new m("the number of coordinates must be a multiple of 2 and at least 2");var i=t.length;I(e)?e.length=i/2:e=new Array(i/2);for(var r=0;r<i;r+=2){var o=t[r],s=t[r+1],a=r/2;e[a]=c.fromRadians(o,s,0,n,e[a])}return e},c.fromDegreesArrayHeights=function(t,n,e){if(U.defined("coordinates",t),t.length<3||t.length%3!=0)throw new m("the number of coordinates must be a multiple of 3 and at least 3");var i=t.length;I(e)?e.length=i/3:e=new Array(i/3);for(var r=0;r<i;r+=3){var o=t[r],s=t[r+1],a=t[r+2],u=r/3;e[u]=c.fromDegrees(o,s,a,n,e[u])}return e},c.fromRadiansArrayHeights=function(t,n,e){if(U.defined("coordinates",t),t.length<3||t.length%3!=0)throw new m("the number of coordinates must be a multiple of 3 and at least 3");var i=t.length;I(e)?e.length=i/3:e=new Array(i/3);for(var r=0;r<i;r+=3){var o=t[r],s=t[r+1],a=t[r+2],u=r/3;e[u]=c.fromRadians(o,s,a,n,e[u])}return e},c.ZERO=Object.freeze(new c(0,0,0)),c.ONE=Object.freeze(new c(1,1,1)),c.UNIT_X=Object.freeze(new c(1,0,0)),c.UNIT_Y=Object.freeze(new c(0,1,0)),c.UNIT_Z=Object.freeze(new c(0,0,1)),c.prototype.clone=function(t){return c.clone(this,t)},c.prototype.equals=function(t){return c.equals(this,t)},c.prototype.equalsEpsilon=function(t,n,e){return c.equalsEpsilon(this,t,n,e)},c.prototype.toString=function(){return"(".concat(this.x,", ").concat(this.y,", ").concat(this.z,")")},c);function o(t,n,e,i){this.x=y(t,0),this.y=y(n,0),this.z=y(e,0),this.w=y(i,0)}o.fromElements=function(t,n,e,i,r){return I(r)?(r.x=t,r.y=n,r.z=e,r.w=i,r):new o(t,n,e,i)},o.fromColor=function(t,n){return U.typeOf.object("color",t),I(n)?(n.x=t.red,n.y=t.green,n.z=t.blue,n.w=t.alpha,n):new o(t.red,t.green,t.blue,t.alpha)},o.clone=function(t,n){if(I(t))return I(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n.w=t.w,n):new o(t.x,t.y,t.z,t.w)},o.packedLength=4,o.pack=function(t,n,e){return U.typeOf.object("value",t),U.defined("array",n),e=y(e,0),n[e++]=t.x,n[e++]=t.y,n[e++]=t.z,n[e]=t.w,n},o.unpack=function(t,n,e){return U.defined("array",t),n=y(n,0),(e=I(e)?e:new o).x=t[n++],e.y=t[n++],e.z=t[n++],e.w=t[n],e},o.packArray=function(t,n){U.defined("array",t);var e=t.length,i=4*e;if(I(n)){if(!Array.isArray(n)&&n.length!==i)throw new m("If result is a typed array, it must have exactly array.length * 4 elements");n.length!==i&&(n.length=i)}else n=new Array(i);for(var r=0;r<e;++r)o.pack(t[r],n,4*r);return n},o.unpackArray=function(t,n){if(U.defined("array",t),U.typeOf.number.greaterThanOrEquals("array.length",t.length,4),t.length%4!=0)throw new m("array length must be a multiple of 4.");var e=t.length;I(n)?n.length=e/4:n=new Array(e/4);for(var i=0;i<e;i+=4){var r=i/4;n[r]=o.unpack(t,i,n[r])}return n},o.fromArray=o.unpack,o.maximumComponent=function(t){return U.typeOf.object("cartesian",t),Math.max(t.x,t.y,t.z,t.w)},o.minimumComponent=function(t){return U.typeOf.object("cartesian",t),Math.min(t.x,t.y,t.z,t.w)},o.minimumByComponent=function(t,n,e){return U.typeOf.object("first",t),U.typeOf.object("second",n),U.typeOf.object("result",e),e.x=Math.min(t.x,n.x),e.y=Math.min(t.y,n.y),e.z=Math.min(t.z,n.z),e.w=Math.min(t.w,n.w),e},o.maximumByComponent=function(t,n,e){return U.typeOf.object("first",t),U.typeOf.object("second",n),U.typeOf.object("result",e),e.x=Math.max(t.x,n.x),e.y=Math.max(t.y,n.y),e.z=Math.max(t.z,n.z),e.w=Math.max(t.w,n.w),e},o.clamp=function(t,n,e,i){U.typeOf.object("value",t),U.typeOf.object("min",n),U.typeOf.object("max",e),U.typeOf.object("result",i);var r=G.clamp(t.x,n.x,e.x),o=G.clamp(t.y,n.y,e.y),s=G.clamp(t.z,n.z,e.z),t=G.clamp(t.w,n.w,e.w);return i.x=r,i.y=o,i.z=s,i.w=t,i},o.magnitudeSquared=function(t){return U.typeOf.object("cartesian",t),t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w},o.magnitude=function(t){return Math.sqrt(o.magnitudeSquared(t))};var tT=new o,nT=(o.distance=function(t,n){return U.typeOf.object("left",t),U.typeOf.object("right",n),o.subtract(t,n,tT),o.magnitude(tT)},o.distanceSquared=function(t,n){return U.typeOf.object("left",t),U.typeOf.object("right",n),o.subtract(t,n,tT),o.magnitudeSquared(tT)},o.normalize=function(t,n){U.typeOf.object("cartesian",t),U.typeOf.object("result",n);var e=o.magnitude(t);if(n.x=t.x/e,n.y=t.y/e,n.z=t.z/e,n.w=t.w/e,isNaN(n.x)||isNaN(n.y)||isNaN(n.z)||isNaN(n.w))throw new m("normalized result is not a number");return n},o.dot=function(t,n){return U.typeOf.object("left",t),U.typeOf.object("right",n),t.x*n.x+t.y*n.y+t.z*n.z+t.w*n.w},o.multiplyComponents=function(t,n,e){return U.typeOf.object("left",t),U.typeOf.object("right",n),U.typeOf.object("result",e),e.x=t.x*n.x,e.y=t.y*n.y,e.z=t.z*n.z,e.w=t.w*n.w,e},o.divideComponents=function(t,n,e){return U.typeOf.object("left",t),U.typeOf.object("right",n),U.typeOf.object("result",e),e.x=t.x/n.x,e.y=t.y/n.y,e.z=t.z/n.z,e.w=t.w/n.w,e},o.add=function(t,n,e){return U.typeOf.object("left",t),U.typeOf.object("right",n),U.typeOf.object("result",e),e.x=t.x+n.x,e.y=t.y+n.y,e.z=t.z+n.z,e.w=t.w+n.w,e},o.subtract=function(t,n,e){return U.typeOf.object("left",t),U.typeOf.object("right",n),U.typeOf.object("result",e),e.x=t.x-n.x,e.y=t.y-n.y,e.z=t.z-n.z,e.w=t.w-n.w,e},o.multiplyByScalar=function(t,n,e){return U.typeOf.object("cartesian",t),U.typeOf.number("scalar",n),U.typeOf.object("result",e),e.x=t.x*n,e.y=t.y*n,e.z=t.z*n,e.w=t.w*n,e},o.divideByScalar=function(t,n,e){return U.typeOf.object("cartesian",t),U.typeOf.number("scalar",n),U.typeOf.object("result",e),e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e.w=t.w/n,e},o.negate=function(t,n){return U.typeOf.object("cartesian",t),U.typeOf.object("result",n),n.x=-t.x,n.y=-t.y,n.z=-t.z,n.w=-t.w,n},o.abs=function(t,n){return U.typeOf.object("cartesian",t),U.typeOf.object("result",n),n.x=Math.abs(t.x),n.y=Math.abs(t.y),n.z=Math.abs(t.z),n.w=Math.abs(t.w),n},new o),eT=(o.lerp=function(t,n,e,i){return U.typeOf.object("start",t),U.typeOf.object("end",n),U.typeOf.number("t",e),U.typeOf.object("result",i),o.multiplyByScalar(n,e,nT),i=o.multiplyByScalar(t,1-e,i),o.add(nT,i,i)},new o),iT=(o.mostOrthogonalAxis=function(t,n){U.typeOf.object("cartesian",t),U.typeOf.object("result",n);t=o.normalize(t,eT);return o.abs(t,t),n=t.x<=t.y?t.x<=t.z?t.x<=t.w?o.clone(o.UNIT_X,n):o.clone(o.UNIT_W,n):t.z<=t.w?o.clone(o.UNIT_Z,n):o.clone(o.UNIT_W,n):t.y<=t.z?t.y<=t.w?o.clone(o.UNIT_Y,n):o.clone(o.UNIT_W,n):t.z<=t.w?o.clone(o.UNIT_Z,n):o.clone(o.UNIT_W,n)},o.equals=function(t,n){return t===n||I(t)&&I(n)&&t.x===n.x&&t.y===n.y&&t.z===n.z&&t.w===n.w},o.equalsArray=function(t,n,e){return t.x===n[e]&&t.y===n[e+1]&&t.z===n[e+2]&&t.w===n[e+3]},o.equalsEpsilon=function(t,n,e,i){return t===n||I(t)&&I(n)&&G.equalsEpsilon(t.x,n.x,e,i)&&G.equalsEpsilon(t.y,n.y,e,i)&&G.equalsEpsilon(t.z,n.z,e,i)&&G.equalsEpsilon(t.w,n.w,e,i)},o.ZERO=Object.freeze(new o(0,0,0,0)),o.ONE=Object.freeze(new o(1,1,1,1)),o.UNIT_X=Object.freeze(new o(1,0,0,0)),o.UNIT_Y=Object.freeze(new o(0,1,0,0)),o.UNIT_Z=Object.freeze(new o(0,0,1,0)),o.UNIT_W=Object.freeze(new o(0,0,0,1)),o.prototype.clone=function(t){return o.clone(this,t)},o.prototype.equals=function(t){return o.equals(this,t)},o.prototype.equalsEpsilon=function(t,n,e){return o.equalsEpsilon(this,t,n,e)},o.prototype.toString=function(){return"(".concat(this.x,", ").concat(this.y,", ").concat(this.z,", ").concat(this.w,")")},new Float32Array(1)),rT=new Uint8Array(iT.buffer),sb=new Uint32Array([287454020]),oT=68===new Uint8Array(sb.buffer)[0],sT=(o.packFloat=function(t,n){return U.typeOf.number("value",t),I(n)||(n=new o),iT[0]=t,oT?(n.x=rT[0],n.y=rT[1],n.z=rT[2],n.w=rT[3]):(n.x=rT[3],n.y=rT[2],n.z=rT[1],n.w=rT[0]),n},o.unpackFloat=function(t){return U.typeOf.object("packedFloat",t),oT?(rT[0]=t.x,rT[1]=t.y,rT[2]=t.z,rT[3]=t.w):(rT[0]=t.w,rT[1]=t.z,rT[2]=t.y,rT[3]=t.x),iT[0]},o);function g(t,n,e,i,r,o,s,a,u){this[0]=y(t,0),this[1]=y(i,0),this[2]=y(s,0),this[3]=y(n,0),this[4]=y(r,0),this[5]=y(a,0),this[6]=y(e,0),this[7]=y(o,0),this[8]=y(u,0)}g.packedLength=9,g.pack=function(t,n,e){return U.typeOf.object("value",t),U.defined("array",n),e=y(e,0),n[e++]=t[0],n[e++]=t[1],n[e++]=t[2],n[e++]=t[3],n[e++]=t[4],n[e++]=t[5],n[e++]=t[6],n[e++]=t[7],n[e++]=t[8],n},g.unpack=function(t,n,e){return U.defined("array",t),n=y(n,0),(e=I(e)?e:new g)[0]=t[n++],e[1]=t[n++],e[2]=t[n++],e[3]=t[n++],e[4]=t[n++],e[5]=t[n++],e[6]=t[n++],e[7]=t[n++],e[8]=t[n++],e},g.packArray=function(t,n){U.defined("array",t);var e=t.length,i=9*e;if(I(n)){if(!Array.isArray(n)&&n.length!==i)throw new m("If result is a typed array, it must have exactly array.length * 9 elements");n.length!==i&&(n.length=i)}else n=new Array(i);for(var r=0;r<e;++r)g.pack(t[r],n,9*r);return n},g.unpackArray=function(t,n){if(U.defined("array",t),U.typeOf.number.greaterThanOrEquals("array.length",t.length,9),t.length%9!=0)throw new m("array length must be a multiple of 9.");var e=t.length;I(n)?n.length=e/9:n=new Array(e/9);for(var i=0;i<e;i+=9){var r=i/9;n[r]=g.unpack(t,i,n[r])}return n},g.clone=function(t,n){if(I(t))return I(n)?(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):new g(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8])},g.fromArray=g.unpack,g.fromColumnMajorArray=function(t,n){return U.defined("values",t),g.clone(t,n)},g.fromRowMajorArray=function(t,n){return U.defined("values",t),I(n)?(n[0]=t[0],n[1]=t[3],n[2]=t[6],n[3]=t[1],n[4]=t[4],n[5]=t[7],n[6]=t[2],n[7]=t[5],n[8]=t[8],n):new g(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},g.fromQuaternion=function(t,n){U.typeOf.object("quaternion",t);var e=t.x*t.x,i=t.x*t.y,r=t.x*t.z,o=t.x*t.w,s=t.y*t.y,a=t.y*t.z,u=t.y*t.w,c=t.z*t.z,h=t.z*t.w,t=t.w*t.w,f=e-s-c+t,l=2*(i-h),d=2*(r+u),i=2*(i+h),h=s-e-c+t,v=2*(a-o),r=2*(r-u),u=2*(a+o),a=-e-s+c+t;return I(n)?(n[0]=f,n[1]=i,n[2]=r,n[3]=l,n[4]=h,n[5]=u,n[6]=d,n[7]=v,n[8]=a,n):new g(f,l,d,i,h,v,r,u,a)},g.fromHeadingPitchRoll=function(t,n){U.typeOf.object("headingPitchRoll",t);var e=Math.cos(-t.pitch),i=Math.cos(-t.heading),r=Math.cos(t.roll),o=Math.sin(-t.pitch),s=Math.sin(-t.heading),t=Math.sin(t.roll),a=e*i,u=-r*s+t*o*i,c=t*s+r*o*i,h=e*s,f=r*i+t*o*s,i=-t*i+r*o*s,s=-o,o=t*e,t=r*e;return I(n)?(n[0]=a,n[1]=h,n[2]=s,n[3]=u,n[4]=f,n[5]=o,n[6]=c,n[7]=i,n[8]=t,n):new g(a,u,c,h,f,i,s,o,t)},g.fromScale=function(t,n){return U.typeOf.object("scale",t),I(n)?(n[0]=t.x,n[1]=0,n[2]=0,n[3]=0,n[4]=t.y,n[5]=0,n[6]=0,n[7]=0,n[8]=t.z,n):new g(t.x,0,0,0,t.y,0,0,0,t.z)},g.fromUniformScale=function(t,n){return U.typeOf.number("scale",t),I(n)?(n[0]=t,n[1]=0,n[2]=0,n[3]=0,n[4]=t,n[5]=0,n[6]=0,n[7]=0,n[8]=t,n):new g(t,0,0,0,t,0,0,0,t)},g.fromCrossProduct=function(t,n){return U.typeOf.object("vector",t),I(n)?(n[0]=0,n[1]=t.z,n[2]=-t.y,n[3]=-t.z,n[4]=0,n[5]=t.x,n[6]=t.y,n[7]=-t.x,n[8]=0,n):new g(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0)},g.fromRotationX=function(t,n){U.typeOf.number("angle",t);var e=Math.cos(t),t=Math.sin(t);return I(n)?(n[0]=1,n[1]=0,n[2]=0,n[3]=0,n[4]=e,n[5]=t,n[6]=0,n[7]=-t,n[8]=e,n):new g(1,0,0,0,e,-t,0,t,e)},g.fromRotationY=function(t,n){U.typeOf.number("angle",t);var e=Math.cos(t),t=Math.sin(t);return I(n)?(n[0]=e,n[1]=0,n[2]=-t,n[3]=0,n[4]=1,n[5]=0,n[6]=t,n[7]=0,n[8]=e,n):new g(e,0,t,0,1,0,-t,0,e)},g.fromRotationZ=function(t,n){U.typeOf.number("angle",t);var e=Math.cos(t),t=Math.sin(t);return I(n)?(n[0]=e,n[1]=t,n[2]=0,n[3]=-t,n[4]=e,n[5]=0,n[6]=0,n[7]=0,n[8]=1,n):new g(e,-t,0,t,e,0,0,0,1)},g.toArray=function(t,n){return U.typeOf.object("matrix",t),I(n)?(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):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]},g.getElementIndex=function(t,n){return U.typeOf.number.greaterThanOrEquals("row",n,0),U.typeOf.number.lessThanOrEquals("row",n,2),U.typeOf.number.greaterThanOrEquals("column",t,0),U.typeOf.number.lessThanOrEquals("column",t,2),3*t+n},g.getColumn=function(t,n,e){U.typeOf.object("matrix",t),U.typeOf.number.greaterThanOrEquals("index",n,0),U.typeOf.number.lessThanOrEquals("index",n,2),U.typeOf.object("result",e);var n=3*n,i=t[n],r=t[1+n],t=t[2+n];return e.x=i,e.y=r,e.z=t,e},g.setColumn=function(t,n,e,i){U.typeOf.object("matrix",t),U.typeOf.number.greaterThanOrEquals("index",n,0),U.typeOf.number.lessThanOrEquals("index",n,2),U.typeOf.object("cartesian",e),U.typeOf.object("result",i);n*=3;return(i=g.clone(t,i))[n]=e.x,i[1+n]=e.y,i[2+n]=e.z,i},g.getRow=function(t,n,e){U.typeOf.object("matrix",t),U.typeOf.number.greaterThanOrEquals("index",n,0),U.typeOf.number.lessThanOrEquals("index",n,2),U.typeOf.object("result",e);var i=t[n],r=t[n+3],t=t[n+6];return e.x=i,e.y=r,e.z=t,e},g.setRow=function(t,n,e,i){return U.typeOf.object("matrix",t),U.typeOf.number.greaterThanOrEquals("index",n,0),U.typeOf.number.lessThanOrEquals("index",n,2),U.typeOf.object("cartesian",e),U.typeOf.object("result",i),(i=g.clone(t,i))[n]=e.x,i[n+3]=e.y,i[n+6]=e.z,i};var aT=new b,uT=(g.setScale=function(t,n,e){U.typeOf.object("matrix",t),U.typeOf.object("scale",n),U.typeOf.object("result",e);var i=g.getScale(t,aT),r=n.x/i.x,o=n.y/i.y,n=n.z/i.z;return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*o,e[4]=t[4]*o,e[5]=t[5]*o,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e},new b),cT=(g.setUniformScale=function(t,n,e){U.typeOf.object("matrix",t),U.typeOf.number("scale",n),U.typeOf.object("result",e);var i=g.getScale(t,uT),r=n/i.x,o=n/i.y,n=n/i.z;return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*o,e[4]=t[4]*o,e[5]=t[5]*o,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e},new b),hT=(g.getScale=function(t,n){return U.typeOf.object("matrix",t),U.typeOf.object("result",n),n.x=b.magnitude(b.fromElements(t[0],t[1],t[2],cT)),n.y=b.magnitude(b.fromElements(t[3],t[4],t[5],cT)),n.z=b.magnitude(b.fromElements(t[6],t[7],t[8],cT)),n},new b),fT=(g.getMaximumScale=function(t){return g.getScale(t,hT),b.maximumComponent(hT)},new b),lT=(g.setRotation=function(t,n,e){U.typeOf.object("matrix",t),U.typeOf.object("result",e);t=g.getScale(t,fT);return e[0]=n[0]*t.x,e[1]=n[1]*t.x,e[2]=n[2]*t.x,e[3]=n[3]*t.y,e[4]=n[4]*t.y,e[5]=n[5]*t.y,e[6]=n[6]*t.z,e[7]=n[7]*t.z,e[8]=n[8]*t.z,e},new b);g.getRotation=function(t,n){U.typeOf.object("matrix",t),U.typeOf.object("result",n);var e=g.getScale(t,lT);return n[0]=t[0]/e.x,n[1]=t[1]/e.x,n[2]=t[2]/e.x,n[3]=t[3]/e.y,n[4]=t[4]/e.y,n[5]=t[5]/e.y,n[6]=t[6]/e.z,n[7]=t[7]/e.z,n[8]=t[8]/e.z,n},g.multiply=function(t,n,e){U.typeOf.object("left",t),U.typeOf.object("right",n),U.typeOf.object("result",e);var i=t[0]*n[0]+t[3]*n[1]+t[6]*n[2],r=t[1]*n[0]+t[4]*n[1]+t[7]*n[2],o=t[2]*n[0]+t[5]*n[1]+t[8]*n[2],s=t[0]*n[3]+t[3]*n[4]+t[6]*n[5],a=t[1]*n[3]+t[4]*n[4]+t[7]*n[5],u=t[2]*n[3]+t[5]*n[4]+t[8]*n[5],c=t[0]*n[6]+t[3]*n[7]+t[6]*n[8],h=t[1]*n[6]+t[4]*n[7]+t[7]*n[8],t=t[2]*n[6]+t[5]*n[7]+t[8]*n[8];return e[0]=i,e[1]=r,e[2]=o,e[3]=s,e[4]=a,e[5]=u,e[6]=c,e[7]=h,e[8]=t,e},g.add=function(t,n,e){return U.typeOf.object("left",t),U.typeOf.object("right",n),U.typeOf.object("result",e),e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e},g.subtract=function(t,n,e){return U.typeOf.object("left",t),U.typeOf.object("right",n),U.typeOf.object("result",e),e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e},g.multiplyByVector=function(t,n,e){U.typeOf.object("matrix",t),U.typeOf.object("cartesian",n),U.typeOf.object("result",e);var i=n.x,r=n.y,n=n.z,o=t[0]*i+t[3]*r+t[6]*n,s=t[1]*i+t[4]*r+t[7]*n,i=t[2]*i+t[5]*r+t[8]*n;return e.x=o,e.y=s,e.z=i,e},g.multiplyByScalar=function(t,n,e){return U.typeOf.object("matrix",t),U.typeOf.number("scalar",n),U.typeOf.object("result",e),e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e},g.multiplyByScale=function(t,n,e){return U.typeOf.object("matrix",t),U.typeOf.object("scale",n),U.typeOf.object("result",e),e[0]=t[0]*n.x,e[1]=t[1]*n.x,e[2]=t[2]*n.x,e[3]=t[3]*n.y,e[4]=t[4]*n.y,e[5]=t[5]*n.y,e[6]=t[6]*n.z,e[7]=t[7]*n.z,e[8]=t[8]*n.z,e},g.multiplyByUniformScale=function(t,n,e){return U.typeOf.object("matrix",t),U.typeOf.number("scale",n),U.typeOf.object("result",e),e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e},g.negate=function(t,n){return U.typeOf.object("matrix",t),U.typeOf.object("result",n),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},g.transpose=function(t,n){U.typeOf.object("matrix",t),U.typeOf.object("result",n);var e=t[0],i=t[3],r=t[6],o=t[1],s=t[4],a=t[7],u=t[2],c=t[5],t=t[8];return n[0]=e,n[1]=i,n[2]=r,n[3]=o,n[4]=s,n[5]=a,n[6]=u,n[7]=c,n[8]=t,n};var dT=[1,0,0],vT=[2,2,1];var pT=new g,mT=new g,yT=(g.computeEigenDecomposition=function(t,n){U.typeOf.object("matrix",t);for(var e=G.EPSILON20,i=0,r=0,o=(n=I(n)?n:{}).unitary=g.clone(g.IDENTITY,n.unitary),s=n.diagonal=g.clone(t,n.diagonal),a=e*function(t){for(var n=0,e=0;e<9;++e){var i=t[e];n+=i*i}return Math.sqrt(n)}(s);r<10&&function(t){for(var n=0,e=0;e<3;++e){var i=t[g.getElementIndex(vT[e],dT[e])];n+=2*i*i}return Math.sqrt(n)}(s)>a;){b=y=m=p=v=d=l=f=h=c=u=void 0;for(var u=s,c=pT,h=G.EPSILON15,f=0,l=1,d=0;d<3;++d){var v=Math.abs(u[g.getElementIndex(vT[d],dT[d])]);f<v&&(l=d,f=v)}var p=1,m=0,y=dT[l],b=vT[l];Math.abs(u[g.getElementIndex(b,y)])>h&&(m=(h=(h=(u[g.getElementIndex(b,b)]-u[g.getElementIndex(y,y)])/2/u[g.getElementIndex(b,y)])<0?-1/(-h+Math.sqrt(1+h*h)):1/(h+Math.sqrt(1+h*h)))*(p=1/Math.sqrt(1+h*h))),(c=g.clone(g.IDENTITY,c))[g.getElementIndex(y,y)]=c[g.getElementIndex(b,b)]=p,c[g.getElementIndex(b,y)]=m,c[g.getElementIndex(y,b)]=-m,g.transpose(pT,mT),g.multiply(s,pT,s),g.multiply(mT,s,s),g.multiply(o,pT,o),2<++i&&(++r,i=0)}return n},g.abs=function(t,n){return U.typeOf.object("matrix",t),U.typeOf.object("result",n),n[0]=Math.abs(t[0]),n[1]=Math.abs(t[1]),n[2]=Math.abs(t[2]),n[3]=Math.abs(t[3]),n[4]=Math.abs(t[4]),n[5]=Math.abs(t[5]),n[6]=Math.abs(t[6]),n[7]=Math.abs(t[7]),n[8]=Math.abs(t[8]),n},g.determinant=function(t){U.typeOf.object("matrix",t);var n=t[0],e=t[3],i=t[6],r=t[1],o=t[4],s=t[7],a=t[2],u=t[5],t=t[8];return n*(o*t-u*s)+r*(u*i-e*t)+a*(e*s-o*i)},g.inverse=function(t,n){U.typeOf.object("matrix",t),U.typeOf.object("result",n);var e=t[0],i=t[1],r=t[2],o=t[3],s=t[4],a=t[5],u=t[6],c=t[7],h=t[8],t=g.determinant(t);if(Math.abs(t)<=G.EPSILON15)throw new m("matrix is not invertible");return n[0]=s*h-c*a,n[1]=c*r-i*h,n[2]=i*a-s*r,n[3]=u*a-o*h,n[4]=e*h-u*r,n[5]=o*r-e*a,n[6]=o*c-u*s,n[7]=u*i-e*c,n[8]=e*s-o*i,g.multiplyByScalar(n,1/t,n)},new g),bT=(g.inverseTranspose=function(t,n){return U.typeOf.object("matrix",t),U.typeOf.object("result",n),g.inverse(g.transpose(t,yT),n)},g.equals=function(t,n){return t===n||I(t)&&I(n)&&t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]&&t[4]===n[4]&&t[5]===n[5]&&t[6]===n[6]&&t[7]===n[7]&&t[8]===n[8]},g.equalsEpsilon=function(t,n,e){return e=y(e,0),t===n||I(t)&&I(n)&&Math.abs(t[0]-n[0])<=e&&Math.abs(t[1]-n[1])<=e&&Math.abs(t[2]-n[2])<=e&&Math.abs(t[3]-n[3])<=e&&Math.abs(t[4]-n[4])<=e&&Math.abs(t[5]-n[5])<=e&&Math.abs(t[6]-n[6])<=e&&Math.abs(t[7]-n[7])<=e&&Math.abs(t[8]-n[8])<=e},g.IDENTITY=Object.freeze(new g(1,0,0,0,1,0,0,0,1)),g.ZERO=Object.freeze(new g(0,0,0,0,0,0,0,0,0)),g.COLUMN0ROW0=0,g.COLUMN0ROW1=1,g.COLUMN0ROW2=2,g.COLUMN1ROW0=3,g.COLUMN1ROW1=4,g.COLUMN1ROW2=5,g.COLUMN2ROW0=6,g.COLUMN2ROW1=7,g.COLUMN2ROW2=8,Object.defineProperties(g.prototype,{length:{get:function(){return g.packedLength}}}),g.prototype.clone=function(t){return g.clone(this,t)},g.prototype.equals=function(t){return g.equals(this,t)},g.equalsArray=function(t,n,e){return t[0]===n[e]&&t[1]===n[e+1]&&t[2]===n[e+2]&&t[3]===n[e+3]&&t[4]===n[e+4]&&t[5]===n[e+5]&&t[6]===n[e+6]&&t[7]===n[e+7]&&t[8]===n[e+8]},g.prototype.equalsEpsilon=function(t,n){return g.equalsEpsilon(this,t,n)},g.prototype.toString=function(){return"(".concat(this[0],", ").concat(this[3],", ").concat(this[6],")\n")+"(".concat(this[1],", ").concat(this[4],", ").concat(this[7],")\n")+"(".concat(this[2],", ").concat(this[5],", ").concat(this[8],")")},g);function gT(t){var n;this.name="RuntimeError",this.message=t;try{throw new Error}catch(t){n=t.stack}this.stack=n}I(Object.create)&&((gT.prototype=Object.create(Error.prototype)).constructor=gT),gT.prototype.toString=function(){var t="".concat(this.name,": ").concat(this.message);return I(this.stack)&&(t+="\n".concat(this.stack.toString())),t};var _T=gT;function H(t,n,e,i,r,o,s,a,u,c,h,f,l,d,v,p){this[0]=y(t,0),this[1]=y(r,0),this[2]=y(u,0),this[3]=y(l,0),this[4]=y(n,0),this[5]=y(o,0),this[6]=y(c,0),this[7]=y(d,0),this[8]=y(e,0),this[9]=y(s,0),this[10]=y(h,0),this[11]=y(v,0),this[12]=y(i,0),this[13]=y(a,0),this[14]=y(f,0),this[15]=y(p,0)}H.packedLength=16,H.pack=function(t,n,e){return U.typeOf.object("value",t),U.defined("array",n),e=y(e,0),n[e++]=t[0],n[e++]=t[1],n[e++]=t[2],n[e++]=t[3],n[e++]=t[4],n[e++]=t[5],n[e++]=t[6],n[e++]=t[7],n[e++]=t[8],n[e++]=t[9],n[e++]=t[10],n[e++]=t[11],n[e++]=t[12],n[e++]=t[13],n[e++]=t[14],n[e]=t[15],n},H.unpack=function(t,n,e){return U.defined("array",t),n=y(n,0),(e=I(e)?e:new H)[0]=t[n++],e[1]=t[n++],e[2]=t[n++],e[3]=t[n++],e[4]=t[n++],e[5]=t[n++],e[6]=t[n++],e[7]=t[n++],e[8]=t[n++],e[9]=t[n++],e[10]=t[n++],e[11]=t[n++],e[12]=t[n++],e[13]=t[n++],e[14]=t[n++],e[15]=t[n],e},H.packArray=function(t,n){U.defined("array",t);var e=t.length,i=16*e;if(I(n)){if(!Array.isArray(n)&&n.length!==i)throw new m("If result is a typed array, it must have exactly array.length * 16 elements");n.length!==i&&(n.length=i)}else n=new Array(i);for(var r=0;r<e;++r)H.pack(t[r],n,16*r);return n},H.unpackArray=function(t,n){if(U.defined("array",t),U.typeOf.number.greaterThanOrEquals("array.length",t.length,16),t.length%16!=0)throw new m("array length must be a multiple of 16.");var e=t.length;I(n)?n.length=e/16:n=new Array(e/16);for(var i=0;i<e;i+=16){var r=i/16;n[r]=H.unpack(t,i,n[r])}return n},H.clone=function(t,n){if(I(t))return I(n)?(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],n):new H(t[0],t[4],t[8],t[12],t[1],t[5],t[9],t[13],t[2],t[6],t[10],t[14],t[3],t[7],t[11],t[15])},H.fromArray=H.unpack,H.fromColumnMajorArray=function(t,n){return U.defined("values",t),H.clone(t,n)},H.fromRowMajorArray=function(t,n){return U.defined("values",t),I(n)?(n[0]=t[0],n[1]=t[4],n[2]=t[8],n[3]=t[12],n[4]=t[1],n[5]=t[5],n[6]=t[9],n[7]=t[13],n[8]=t[2],n[9]=t[6],n[10]=t[10],n[11]=t[14],n[12]=t[3],n[13]=t[7],n[14]=t[11],n[15]=t[15],n):new H(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},H.fromRotationTranslation=function(t,n,e){return U.typeOf.object("rotation",t),n=y(n,b.ZERO),I(e)?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=0,e[4]=t[3],e[5]=t[4],e[6]=t[5],e[7]=0,e[8]=t[6],e[9]=t[7],e[10]=t[8],e[11]=0,e[12]=n.x,e[13]=n.y,e[14]=n.z,e[15]=1,e):new H(t[0],t[3],t[6],n.x,t[1],t[4],t[7],n.y,t[2],t[5],t[8],n.z,0,0,0,1)},H.fromTranslationQuaternionRotationScale=function(t,n,e,i){U.typeOf.object("translation",t),U.typeOf.object("rotation",n),U.typeOf.object("scale",e),I(i)||(i=new H);var r=e.x,o=e.y,e=e.z,s=n.x*n.x,a=n.x*n.y,u=n.x*n.z,c=n.x*n.w,h=n.y*n.y,f=n.y*n.z,l=n.y*n.w,d=n.z*n.z,v=n.z*n.w,n=n.w*n.w,p=2*(a-v),m=2*(u+l),a=2*(a+v),v=h-s-d+n,y=2*(f-c),u=2*(u-l),l=2*(f+c),f=-s-h+d+n;return i[0]=(s-h-d+n)*r,i[1]=a*r,i[2]=u*r,i[3]=0,i[4]=p*o,i[5]=v*o,i[6]=l*o,i[7]=0,i[8]=m*e,i[9]=y*e,i[10]=f*e,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,i},H.fromTranslationRotationScale=function(t,n){return U.typeOf.object("translationRotationScale",t),H.fromTranslationQuaternionRotationScale(t.translation,t.rotation,t.scale,n)},H.fromTranslation=function(t,n){return U.typeOf.object("translation",t),H.fromRotationTranslation(bT.IDENTITY,t,n)},H.fromScale=function(t,n){return U.typeOf.object("scale",t),I(n)?(n[0]=t.x,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=t.y,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=t.z,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n):new H(t.x,0,0,0,0,t.y,0,0,0,0,t.z,0,0,0,0,1)},H.fromUniformScale=function(t,n){return U.typeOf.number("scale",t),I(n)?(n[0]=t,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=t,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=t,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n):new H(t,0,0,0,0,t,0,0,0,0,t,0,0,0,0,1)},H.fromRotation=function(t,n){return U.typeOf.object("rotation",t),(n=I(n)?n:new H)[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=0,n[4]=t[3],n[5]=t[4],n[6]=t[5],n[7]=0,n[8]=t[6],n[9]=t[7],n[10]=t[8],n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n};var wT=new b,xT=new b,ET=new b,ST=(H.fromCamera=function(t,n){U.typeOf.object("camera",t);var e=t.position,i=t.direction,t=t.up,i=(U.typeOf.object("camera.position",e),U.typeOf.object("camera.direction",i),U.typeOf.object("camera.up",t),b.normalize(i,wT),b.normalize(b.cross(wT,t,xT),xT),b.normalize(b.cross(xT,wT,ET),ET),xT.x),t=xT.y,r=xT.z,o=wT.x,s=wT.y,a=wT.z,u=ET.x,c=ET.y,h=ET.z,f=e.x,l=e.y,e=e.z,d=i*-f+t*-l+r*-e,v=u*-f+c*-l+h*-e,f=o*f+s*l+a*e;return I(n)?(n[0]=i,n[1]=u,n[2]=-o,n[3]=0,n[4]=t,n[5]=c,n[6]=-s,n[7]=0,n[8]=r,n[9]=h,n[10]=-a,n[11]=0,n[12]=d,n[13]=v,n[14]=f,n[15]=1,n):new H(i,t,r,d,u,c,h,v,-o,-s,-a,f,0,0,0,1)},H.computePerspectiveFieldOfView=function(t,n,e,i,r){U.typeOf.number.greaterThan("fovY",t,0),U.typeOf.number.lessThan("fovY",t,Math.PI),U.typeOf.number.greaterThan("near",e,0),U.typeOf.number.greaterThan("far",i,0),U.typeOf.object("result",r);var t=1/Math.tan(.5*t),o=(i+e)/(e-i),e=2*i*e/(e-i);return r[0]=t/n,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=t,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=o,r[11]=-1,r[12]=0,r[13]=0,r[14]=e,r[15]=0,r},H.computeOrthographicOffCenter=function(t,n,e,i,r,o,s){U.typeOf.number("left",t),U.typeOf.number("right",n),U.typeOf.number("bottom",e),U.typeOf.number("top",i),U.typeOf.number("near",r),U.typeOf.number("far",o),U.typeOf.object("result",s);var a=1/(n-t),u=1/(i-e),c=1/(o-r),n=-(n+t)*a,t=-(i+e)*u,i=-(o+r)*c;return u*=2,c*=-2,s[0]=a*=2,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=u,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=c,s[11]=0,s[12]=n,s[13]=t,s[14]=i,s[15]=1,s},H.computePerspectiveOffCenter=function(t,n,e,i,r,o,s){U.typeOf.number("left",t),U.typeOf.number("right",n),U.typeOf.number("bottom",e),U.typeOf.number("top",i),U.typeOf.number("near",r),U.typeOf.number("far",o),U.typeOf.object("result",s);var a=2*r/(i-e),u=(n+t)/(n-t),i=(i+e)/(i-e),e=-(o+r)/(o-r),o=-2*o*r/(o-r);return s[0]=2*r/(n-t),s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=a,s[6]=0,s[7]=0,s[8]=u,s[9]=i,s[10]=e,s[11]=-1,s[12]=0,s[13]=0,s[14]=o,s[15]=0,s},H.computeInfinitePerspectiveOffCenter=function(t,n,e,i,r,o){U.typeOf.number("left",t),U.typeOf.number("right",n),U.typeOf.number("bottom",e),U.typeOf.number("top",i),U.typeOf.number("near",r),U.typeOf.object("result",o);var s=2*r/(i-e),a=(n+t)/(n-t),i=(i+e)/(i-e),e=-2*r;return o[0]=2*r/(n-t),o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=a,o[9]=i,o[10]=-1,o[11]=-1,o[12]=0,o[13]=0,o[14]=e,o[15]=0,o},H.computeViewportTransformation=function(t,n,e,i){I(i)||(i=new H),t=y(t,y.EMPTY_OBJECT);var r=y(t.x,0),o=y(t.y,0),s=y(t.width,0),t=y(t.height,0),s=(n=y(n,0),.5*s),t=.5*t,e=.5*((e=y(e,1))-n),a=t,u=e,r=r+s,o=o+t,t=n+e;return i[0]=s,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=a,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=u,i[11]=0,i[12]=r,i[13]=o,i[14]=t,i[15]=1,i},H.computeView=function(t,n,e,i,r){return U.typeOf.object("position",t),U.typeOf.object("direction",n),U.typeOf.object("up",e),U.typeOf.object("right",i),U.typeOf.object("result",r),r[0]=i.x,r[1]=e.x,r[2]=-n.x,r[3]=0,r[4]=i.y,r[5]=e.y,r[6]=-n.y,r[7]=0,r[8]=i.z,r[9]=e.z,r[10]=-n.z,r[11]=0,r[12]=-b.dot(i,t),r[13]=-b.dot(e,t),r[14]=b.dot(n,t),r[15]=1,r},H.toArray=function(t,n){return U.typeOf.object("matrix",t),I(n)?(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],n):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15]]},H.getElementIndex=function(t,n){return U.typeOf.number.greaterThanOrEquals("row",n,0),U.typeOf.number.lessThanOrEquals("row",n,3),U.typeOf.number.greaterThanOrEquals("column",t,0),U.typeOf.number.lessThanOrEquals("column",t,3),4*t+n},H.getColumn=function(t,n,e){U.typeOf.object("matrix",t),U.typeOf.number.greaterThanOrEquals("index",n,0),U.typeOf.number.lessThanOrEquals("index",n,3),U.typeOf.object("result",e);var n=4*n,i=t[n],r=t[1+n],o=t[2+n],t=t[3+n];return e.x=i,e.y=r,e.z=o,e.w=t,e},H.setColumn=function(t,n,e,i){U.typeOf.object("matrix",t),U.typeOf.number.greaterThanOrEquals("index",n,0),U.typeOf.number.lessThanOrEquals("index",n,3),U.typeOf.object("cartesian",e),U.typeOf.object("result",i);n*=4;return(i=H.clone(t,i))[n]=e.x,i[1+n]=e.y,i[2+n]=e.z,i[3+n]=e.w,i},H.getRow=function(t,n,e){U.typeOf.object("matrix",t),U.typeOf.number.greaterThanOrEquals("index",n,0),U.typeOf.number.lessThanOrEquals("index",n,3),U.typeOf.object("result",e);var i=t[n],r=t[n+4],o=t[n+8],t=t[n+12];return e.x=i,e.y=r,e.z=o,e.w=t,e},H.setRow=function(t,n,e,i){return U.typeOf.object("matrix",t),U.typeOf.number.greaterThanOrEquals("index",n,0),U.typeOf.number.lessThanOrEquals("index",n,3),U.typeOf.object("cartesian",e),U.typeOf.object("result",i),(i=H.clone(t,i))[n]=e.x,i[n+4]=e.y,i[n+8]=e.z,i[n+12]=e.w,i},H.setTranslation=function(t,n,e){return U.typeOf.object("matrix",t),U.typeOf.object("translation",n),U.typeOf.object("result",e),e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=n.x,e[13]=n.y,e[14]=n.z,e[15]=t[15],e},new b),TT=(H.setScale=function(t,n,e){U.typeOf.object("matrix",t),U.typeOf.object("scale",n),U.typeOf.object("result",e);var i=H.getScale(t,ST),r=n.x/i.x,o=n.y/i.y,n=n.z/i.z;return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3],e[4]=t[4]*o,e[5]=t[5]*o,e[6]=t[6]*o,e[7]=t[7],e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},new b),AT=(H.setUniformScale=function(t,n,e){U.typeOf.object("matrix",t),U.typeOf.number("scale",n),U.typeOf.object("result",e);var i=H.getScale(t,TT),r=n/i.x,o=n/i.y,n=n/i.z;return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3],e[4]=t[4]*o,e[5]=t[5]*o,e[6]=t[6]*o,e[7]=t[7],e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},new b),MT=(H.getScale=function(t,n){return U.typeOf.object("matrix",t),U.typeOf.object("result",n),n.x=b.magnitude(b.fromElements(t[0],t[1],t[2],AT)),n.y=b.magnitude(b.fromElements(t[4],t[5],t[6],AT)),n.z=b.magnitude(b.fromElements(t[8],t[9],t[10],AT)),n},new b),OT=(H.getMaximumScale=function(t){return H.getScale(t,MT),b.maximumComponent(MT)},new b),LT=(H.setRotation=function(t,n,e){U.typeOf.object("matrix",t),U.typeOf.object("result",e);var i=H.getScale(t,OT);return e[0]=n[0]*i.x,e[1]=n[1]*i.x,e[2]=n[2]*i.x,e[3]=t[3],e[4]=n[3]*i.y,e[5]=n[4]*i.y,e[6]=n[5]*i.y,e[7]=t[7],e[8]=n[6]*i.z,e[9]=n[7]*i.z,e[10]=n[8]*i.z,e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},new b),RT=(H.getRotation=function(t,n){U.typeOf.object("matrix",t),U.typeOf.object("result",n);var e=H.getScale(t,LT);return n[0]=t[0]/e.x,n[1]=t[1]/e.x,n[2]=t[2]/e.x,n[3]=t[4]/e.y,n[4]=t[5]/e.y,n[5]=t[6]/e.y,n[6]=t[8]/e.z,n[7]=t[9]/e.z,n[8]=t[10]/e.z,n},H.multiply=function(t,n,e){U.typeOf.object("left",t),U.typeOf.object("right",n),U.typeOf.object("result",e);var i=t[0],r=t[1],o=t[2],s=t[3],a=t[4],u=t[5],c=t[6],h=t[7],f=t[8],l=t[9],d=t[10],v=t[11],p=t[12],m=t[13],y=t[14],t=t[15],b=n[0],g=n[1],_=n[2],w=n[3],x=n[4],E=n[5],S=n[6],T=n[7],A=n[8],M=n[9],O=n[10],L=n[11],R=n[12],N=n[13],P=n[14],n=n[15],F=r*b+u*g+l*_+m*w,j=o*b+c*g+d*_+y*w,I=s*b+h*g+v*_+t*w,C=i*x+a*E+f*S+p*T,D=r*x+u*E+l*S+m*T,k=o*x+c*E+d*S+y*T,x=s*x+h*E+v*S+t*T,E=i*A+a*M+f*O+p*L,S=r*A+u*M+l*O+m*L,T=o*A+c*M+d*O+y*L,A=s*A+h*M+v*O+t*L,M=i*R+a*N+f*P+p*n,O=r*R+u*N+l*P+m*n,L=o*R+c*N+d*P+y*n,r=s*R+h*N+v*P+t*n;return e[0]=i*b+a*g+f*_+p*w,e[1]=F,e[2]=j,e[3]=I,e[4]=C,e[5]=D,e[6]=k,e[7]=x,e[8]=E,e[9]=S,e[10]=T,e[11]=A,e[12]=M,e[13]=O,e[14]=L,e[15]=r,e},H.add=function(t,n,e){return U.typeOf.object("left",t),U.typeOf.object("right",n),U.typeOf.object("result",e),e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e[9]=t[9]+n[9],e[10]=t[10]+n[10],e[11]=t[11]+n[11],e[12]=t[12]+n[12],e[13]=t[13]+n[13],e[14]=t[14]+n[14],e[15]=t[15]+n[15],e},H.subtract=function(t,n,e){return U.typeOf.object("left",t),U.typeOf.object("right",n),U.typeOf.object("result",e),e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e[9]=t[9]-n[9],e[10]=t[10]-n[10],e[11]=t[11]-n[11],e[12]=t[12]-n[12],e[13]=t[13]-n[13],e[14]=t[14]-n[14],e[15]=t[15]-n[15],e},H.multiplyTransformation=function(t,n,e){U.typeOf.object("left",t),U.typeOf.object("right",n),U.typeOf.object("result",e);var i=t[0],r=t[1],o=t[2],s=t[4],a=t[5],u=t[6],c=t[8],h=t[9],f=t[10],l=t[12],d=t[13],t=t[14],v=n[0],p=n[1],m=n[2],y=n[4],b=n[5],g=n[6],_=n[8],w=n[9],x=n[10],E=n[12],S=n[13],n=n[14],T=r*v+a*p+h*m,A=o*v+u*p+f*m,M=i*y+s*b+c*g,O=r*y+a*b+h*g,y=o*y+u*b+f*g,b=i*_+s*w+c*x,g=r*_+a*w+h*x,_=o*_+u*w+f*x,w=i*E+s*S+c*n+l,x=r*E+a*S+h*n+d,l=o*E+u*S+f*n+t;return e[0]=i*v+s*p+c*m,e[1]=T,e[2]=A,e[3]=0,e[4]=M,e[5]=O,e[6]=y,e[7]=0,e[8]=b,e[9]=g,e[10]=_,e[11]=0,e[12]=w,e[13]=x,e[14]=l,e[15]=1,e},H.multiplyByMatrix3=function(t,n,e){U.typeOf.object("matrix",t),U.typeOf.object("rotation",n),U.typeOf.object("result",e);var i=t[0],r=t[1],o=t[2],s=t[4],a=t[5],u=t[6],c=t[8],h=t[9],f=t[10],l=n[0],d=n[1],v=n[2],p=n[3],m=n[4],y=n[5],b=n[6],g=n[7],n=n[8],_=r*l+a*d+h*v,w=o*l+u*d+f*v,x=i*p+s*m+c*y,E=r*p+a*m+h*y,p=o*p+u*m+f*y,m=i*b+s*g+c*n,y=r*b+a*g+h*n,r=o*b+u*g+f*n;return e[0]=i*l+s*d+c*v,e[1]=_,e[2]=w,e[3]=0,e[4]=x,e[5]=E,e[6]=p,e[7]=0,e[8]=m,e[9]=y,e[10]=r,e[11]=0,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},H.multiplyByTranslation=function(t,n,e){U.typeOf.object("matrix",t),U.typeOf.object("translation",n),U.typeOf.object("result",e);var i=n.x,r=n.y,n=n.z,o=i*t[0]+r*t[4]+n*t[8]+t[12],s=i*t[1]+r*t[5]+n*t[9]+t[13],i=i*t[2]+r*t[6]+n*t[10]+t[14];return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=o,e[13]=s,e[14]=i,e[15]=t[15],e},H.multiplyByScale=function(t,n,e){U.typeOf.object("matrix",t),U.typeOf.object("scale",n),U.typeOf.object("result",e);var i=n.x,r=n.y,n=n.z;return 1===i&&1===r&&1===n?H.clone(t,e):(e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=t[3],e[4]=r*t[4],e[5]=r*t[5],e[6]=r*t[6],e[7]=t[7],e[8]=n*t[8],e[9]=n*t[9],e[10]=n*t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e)},H.multiplyByUniformScale=function(t,n,e){return U.typeOf.object("matrix",t),U.typeOf.number("scale",n),U.typeOf.object("result",e),e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3],e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7],e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},H.multiplyByVector=function(t,n,e){U.typeOf.object("matrix",t),U.typeOf.object("cartesian",n),U.typeOf.object("result",e);var i=n.x,r=n.y,o=n.z,n=n.w,s=t[0]*i+t[4]*r+t[8]*o+t[12]*n,a=t[1]*i+t[5]*r+t[9]*o+t[13]*n,u=t[2]*i+t[6]*r+t[10]*o+t[14]*n,i=t[3]*i+t[7]*r+t[11]*o+t[15]*n;return e.x=s,e.y=a,e.z=u,e.w=i,e},H.multiplyByPointAsVector=function(t,n,e){U.typeOf.object("matrix",t),U.typeOf.object("cartesian",n),U.typeOf.object("result",e);var i=n.x,r=n.y,n=n.z,o=t[0]*i+t[4]*r+t[8]*n,s=t[1]*i+t[5]*r+t[9]*n,i=t[2]*i+t[6]*r+t[10]*n;return e.x=o,e.y=s,e.z=i,e},H.multiplyByPoint=function(t,n,e){U.typeOf.object("matrix",t),U.typeOf.object("cartesian",n),U.typeOf.object("result",e);var i=n.x,r=n.y,n=n.z,o=t[0]*i+t[4]*r+t[8]*n+t[12],s=t[1]*i+t[5]*r+t[9]*n+t[13],i=t[2]*i+t[6]*r+t[10]*n+t[14];return e.x=o,e.y=s,e.z=i,e},H.multiplyByScalar=function(t,n,e){return U.typeOf.object("matrix",t),U.typeOf.number("scalar",n),U.typeOf.object("result",e),e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11]*n,e[12]=t[12]*n,e[13]=t[13]*n,e[14]=t[14]*n,e[15]=t[15]*n,e},H.negate=function(t,n){return U.typeOf.object("matrix",t),U.typeOf.object("result",n),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],n},H.transpose=function(t,n){U.typeOf.object("matrix",t),U.typeOf.object("result",n);var e=t[1],i=t[2],r=t[3],o=t[6],s=t[7],a=t[11];return n[0]=t[0],n[1]=t[4],n[2]=t[8],n[3]=t[12],n[4]=e,n[5]=t[5],n[6]=t[9],n[7]=t[13],n[8]=i,n[9]=o,n[10]=t[10],n[11]=t[14],n[12]=r,n[13]=s,n[14]=a,n[15]=t[15],n},H.abs=function(t,n){return U.typeOf.object("matrix",t),U.typeOf.object("result",n),n[0]=Math.abs(t[0]),n[1]=Math.abs(t[1]),n[2]=Math.abs(t[2]),n[3]=Math.abs(t[3]),n[4]=Math.abs(t[4]),n[5]=Math.abs(t[5]),n[6]=Math.abs(t[6]),n[7]=Math.abs(t[7]),n[8]=Math.abs(t[8]),n[9]=Math.abs(t[9]),n[10]=Math.abs(t[10]),n[11]=Math.abs(t[11]),n[12]=Math.abs(t[12]),n[13]=Math.abs(t[13]),n[14]=Math.abs(t[14]),n[15]=Math.abs(t[15]),n},H.equals=function(t,n){return t===n||I(t)&&I(n)&&t[12]===n[12]&&t[13]===n[13]&&t[14]===n[14]&&t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[4]===n[4]&&t[5]===n[5]&&t[6]===n[6]&&t[8]===n[8]&&t[9]===n[9]&&t[10]===n[10]&&t[3]===n[3]&&t[7]===n[7]&&t[11]===n[11]&&t[15]===n[15]},H.equalsEpsilon=function(t,n,e){return e=y(e,0),t===n||I(t)&&I(n)&&Math.abs(t[0]-n[0])<=e&&Math.abs(t[1]-n[1])<=e&&Math.abs(t[2]-n[2])<=e&&Math.abs(t[3]-n[3])<=e&&Math.abs(t[4]-n[4])<=e&&Math.abs(t[5]-n[5])<=e&&Math.abs(t[6]-n[6])<=e&&Math.abs(t[7]-n[7])<=e&&Math.abs(t[8]-n[8])<=e&&Math.abs(t[9]-n[9])<=e&&Math.abs(t[10]-n[10])<=e&&Math.abs(t[11]-n[11])<=e&&Math.abs(t[12]-n[12])<=e&&Math.abs(t[13]-n[13])<=e&&Math.abs(t[14]-n[14])<=e&&Math.abs(t[15]-n[15])<=e},H.getTranslation=function(t,n){return U.typeOf.object("matrix",t),U.typeOf.object("result",n),n.x=t[12],n.y=t[13],n.z=t[14],n},H.getMatrix3=function(t,n){return U.typeOf.object("matrix",t),U.typeOf.object("result",n),n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[4],n[4]=t[5],n[5]=t[6],n[6]=t[8],n[7]=t[9],n[8]=t[10],n},new bT),NT=new bT,PT=new sT,FT=new sT(0,0,0,1),jT=(H.inverse=function(t,n){U.typeOf.object("matrix",t),U.typeOf.object("result",n);var e=t[0],i=t[4],r=t[8],o=t[12],s=t[1],a=t[5],u=t[9],c=t[13],h=t[2],f=t[6],l=t[10],d=t[14],v=t[3],p=t[7],m=t[11],y=t[15],b=l*y,g=d*m,_=f*y,w=d*p,x=f*m,E=l*p,S=h*y,T=d*v,A=h*m,M=l*v,O=h*p,L=f*v,R=b*a+w*u+x*c-(g*a+_*u+E*c),N=g*s+S*u+M*c-(b*s+T*u+A*c),P=_*s+T*a+O*c-(w*s+S*a+L*c),F=E*s+A*a+L*u-(x*s+M*a+O*u),j=g*i+_*r+E*o-(b*i+w*r+x*o),I=b*e+T*r+A*o-(g*e+S*r+M*o),C=w*e+S*i+L*o-(_*e+T*i+O*o),D=x*e+M*i+O*r-(E*e+A*i+L*r),k=(b=r*c)*p+(w=o*a)*m+(x=i*u)*y-((g=o*u)*p+(_=i*c)*m+(E=r*a)*y),c=g*v+(S=e*c)*m+(M=r*s)*y-(b*v+(T=o*s)*m+(A=e*u)*y),u=_*v+T*p+(O=e*a)*y-(w*v+S*p+(L=i*s)*y),a=E*v+A*p+L*m-(x*v+M*p+O*m),s=_*l+E*d+g*f-(x*d+b*f+w*l),y=A*d+b*h+T*l-(S*l+M*d+g*h),v=S*f+L*d+w*h-(O*d+_*h+T*f),p=O*l+x*h+M*f-(A*f+L*l+E*h),m=e*R+i*N+r*P+o*F;if(Math.abs(m)<G.EPSILON21){if(bT.equalsEpsilon(H.getMatrix3(t,RT),NT,G.EPSILON7)&&sT.equals(H.getRow(t,3,PT),FT))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-t[12],n[13]=-t[13],n[14]=-t[14],n[15]=1,n;throw new _T("matrix is not invertible because its determinate is zero.")}return n[0]=R*(m=1/m),n[1]=N*m,n[2]=P*m,n[3]=F*m,n[4]=j*m,n[5]=I*m,n[6]=C*m,n[7]=D*m,n[8]=k*m,n[9]=c*m,n[10]=u*m,n[11]=a*m,n[12]=s*m,n[13]=y*m,n[14]=v*m,n[15]=p*m,n},H.inverseTransformation=function(t,n){U.typeOf.object("matrix",t),U.typeOf.object("result",n);var e=t[0],i=t[1],r=t[2],o=t[4],s=t[5],a=t[6],u=t[8],c=t[9],h=t[10],f=t[12],l=t[13],t=t[14],d=-e*f-i*l-r*t,v=-o*f-s*l-a*t,f=-u*f-c*l-h*t;return n[0]=e,n[1]=o,n[2]=u,n[3]=0,n[4]=i,n[5]=s,n[6]=c,n[7]=0,n[8]=r,n[9]=a,n[10]=h,n[11]=0,n[12]=d,n[13]=v,n[14]=f,n[15]=1,n},new H),IT=(H.inverseTranspose=function(t,n){return U.typeOf.object("matrix",t),U.typeOf.object("result",n),H.inverse(H.transpose(t,jT),n)},H.IDENTITY=Object.freeze(new H(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),H.ZERO=Object.freeze(new H(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),H.COLUMN0ROW0=0,H.COLUMN0ROW1=1,H.COLUMN0ROW2=2,H.COLUMN0ROW3=3,H.COLUMN1ROW0=4,H.COLUMN1ROW1=5,H.COLUMN1ROW2=6,H.COLUMN1ROW3=7,H.COLUMN2ROW0=8,H.COLUMN2ROW1=9,H.COLUMN2ROW2=10,H.COLUMN2ROW3=11,H.COLUMN3ROW0=12,H.COLUMN3ROW1=13,H.COLUMN3ROW2=14,H.COLUMN3ROW3=15,Object.defineProperties(H.prototype,{length:{get:function(){return H.packedLength}}}),H.prototype.clone=function(t){return H.clone(this,t)},H.prototype.equals=function(t){return H.equals(this,t)},H.equalsArray=function(t,n,e){return t[0]===n[e]&&t[1]===n[e+1]&&t[2]===n[e+2]&&t[3]===n[e+3]&&t[4]===n[e+4]&&t[5]===n[e+5]&&t[6]===n[e+6]&&t[7]===n[e+7]&&t[8]===n[e+8]&&t[9]===n[e+9]&&t[10]===n[e+10]&&t[11]===n[e+11]&&t[12]===n[e+12]&&t[13]===n[e+13]&&t[14]===n[e+14]&&t[15]===n[e+15]},H.prototype.equalsEpsilon=function(t,n){return H.equalsEpsilon(this,t,n)},H.prototype.toString=function(){return"(".concat(this[0],", ").concat(this[4],", ").concat(this[8],", ").concat(this[12],")\n")+"(".concat(this[1],", ").concat(this[5],", ").concat(this[9],", ").concat(this[13],")\n")+"(".concat(this[2],", ").concat(this[6],", ").concat(this[10],", ").concat(this[14],")\n")+"(".concat(this[3],", ").concat(this[7],", ").concat(this[11],", ").concat(this[15],")")},H);function CT(t){t=y(t,y.EMPTY_OBJECT),this.left=t.left,this.Fb=void 0,this.right=t.right,this.jb=void 0,this.top=t.top,this.Ib=void 0,this.bottom=t.bottom,this.Cb=void 0,this.near=y(t.near,1),this.Db=this.near,this.far=y(t.far,5e8),this.kb=this.far,this.Ub=new IT,this.Bb=new IT}function DT(t){if(!(I(t.right)&&I(t.left)&&I(t.top)&&I(t.bottom)&&I(t.near)&&I(t.far)))throw new m("right, left, top, bottom, near, or far parameters are not set.");var n=t.top,e=t.bottom,i=t.right,r=t.left,o=t.near,s=t.far;if(n!==t.Ib||e!==t.Cb||r!==t.Fb||i!==t.jb||o!==t.Db||s!==t.kb){if(t.near<=0||t.near>t.far)throw new m("near must be greater than zero and less than far.");t.Fb=r,t.jb=i,t.Ib=n,t.Cb=e,t.Db=o,t.kb=s,t.Ub=IT.computePerspectiveOffCenter(r,i,e,n,o,s,t.Ub),t.Bb=IT.computeInfinitePerspectiveOffCenter(r,i,e,n,o,t.Bb)}}Object.defineProperties(CT.prototype,{projectionMatrix:{get:function(){return DT(this),this.Ub}},infiniteProjectionMatrix:{get:function(){return DT(this),this.Bb}}}),CT.prototype.getPixelDimensions=function(t,n,e,i,r){if(DT(this),!I(t)||!I(n))throw new m("Both drawingBufferWidth and drawingBufferHeight are required.");if(t<=0)throw new m("drawingBufferWidth must be greater than zero.");if(n<=0)throw new m("drawingBufferHeight must be greater than zero.");if(!I(e))throw new m("distance is required.");if(!I(i))throw new m("pixelRatio is required");if(i<=0)throw new m("pixelRatio must be greater than zero.");var o,s;if(I(r))return o=1/this.near,n=2*i*e*(s=this.top*o)/n,s=this.right*o,r.x=2*i*e*s/t,r.y=n,r;throw new m("A result object is required.")},CT.prototype.clone=function(t){return(t=I(t)?t:new CT).right=this.right,t.left=this.left,t.top=this.top,t.bottom=this.bottom,t.near=this.near,t.far=this.far,t.Fb=void 0,t.jb=void 0,t.Ib=void 0,t.Cb=void 0,t.Db=void 0,t.kb=void 0,t},CT.prototype.equals=function(t){return I(t)&&t instanceof CT&&this.right===t.right&&this.left===t.left&&this.top===t.top&&this.bottom===t.bottom&&this.near===t.near&&this.far===t.far},CT.prototype.equalsEpsilon=function(t,n,e){return t===this||I(t)&&t instanceof CT&&G.equalsEpsilon(this.right,t.right,n,e)&&G.equalsEpsilon(this.left,t.left,n,e)&&G.equalsEpsilon(this.top,t.top,n,e)&&G.equalsEpsilon(this.bottom,t.bottom,n,e)&&G.equalsEpsilon(this.near,t.near,n,e)&&G.equalsEpsilon(this.far,t.far,n,e)};var kT=CT;function UT(t){t=y(t,y.EMPTY_OBJECT),this.Gb=new kT,this.fov=t.fov,this.Hb=void 0,this.Xb=void 0,this.Vb=void 0,this.aspectRatio=t.aspectRatio,this.zb=void 0,this.near=y(t.near,1),this.Db=this.near,this.far=y(t.far,5e8),this.kb=this.far,this.xOffset=y(t.xOffset,0),this.Wb=this.xOffset,this.yOffset=y(t.yOffset,0),this.Yb=this.yOffset}function BT(t){if(!(I(t.fov)&&I(t.aspectRatio)&&I(t.near)&&I(t.far)))throw new m("fov, aspectRatio, near, or far parameters are not set.");var n=t.Gb;if(t.fov!==t.Hb||t.aspectRatio!==t.zb||t.near!==t.Db||t.far!==t.kb||t.xOffset!==t.Wb||t.yOffset!==t.Yb){if(t.fov<0||t.fov>=Math.PI)throw new m("fov must be in the range [0, PI).");if(t.aspectRatio<0)throw new m("aspectRatio must be positive.");if(t.near<0||t.near>t.far)throw new m("near must be greater than zero and less than far.");t.zb=t.aspectRatio,t.Hb=t.fov,t.Xb=t.fov,t.Db=t.near,t.kb=t.far,t.Vb=2*Math.tan(.5*t.Xb),t.Wb=t.xOffset,t.Yb=t.yOffset,n.top=t.near*Math.tan(.5*t.Xb),n.bottom=-n.top,n.right=t.aspectRatio*n.top,n.left=-n.right,n.near=t.near,n.far=t.far,n.right+=t.xOffset,n.left+=t.xOffset,n.top+=t.yOffset,n.bottom+=t.yOffset}}UT.packedLength=6,UT.prototype.update=function(){BT(this)},UT.pack=function(t,n,e){return U.typeOf.object("value",t),U.defined("array",n),e=y(e,0),n[e++]=t.fov,n[e++]=t.aspectRatio,n[e++]=t.near,n[e++]=t.far,n[e++]=t.xOffset,n[e]=t.yOffset,n},UT.unpack=function(t,n,e){return U.defined("array",t),n=y(n,0),(e=I(e)?e:new UT).fov=t[n++],e.aspectRatio=t[n++],e.near=t[n++],e.far=t[n++],e.xOffset=t[n++],e.yOffset=t[n],e},Object.defineProperties(UT.prototype,{projectionMatrix:{get:function(){return BT(this),this.Gb.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return BT(this),this.Gb.infiniteProjectionMatrix}},fovy:{get:function(){return BT(this),this.Xb}},sseDenominator:{get:function(){return BT(this),this.Vb}},offCenterFrustum:{get:function(){return BT(this),this.Gb}}}),UT.prototype.computeCullingVolume=function(t,n,e){return BT(this),this.Gb.computeCullingVolume(t,n,e)},UT.prototype.getPixelDimensions=function(t,n,e,i,r){return BT(this),this.Gb.getPixelDimensions(t,n,e,i,r)},UT.prototype.clone=function(t){return(t=I(t)?t:new UT).aspectRatio=this.aspectRatio,t.fov=this.fov,t.near=this.near,t.far=this.far,t.zb=void 0,t.Hb=void 0,t.Db=void 0,t.kb=void 0,this.Gb.clone(t.Gb),t},UT.prototype.equals=function(t){return!!(I(t)&&t instanceof UT)&&(BT(this),BT(t),this.fov===t.fov)&&this.aspectRatio===t.aspectRatio&&this.Gb.equals(t.Gb)},UT.prototype.equalsEpsilon=function(t,n,e){return!!(I(t)&&t instanceof UT)&&(BT(this),BT(t),G.equalsEpsilon(this.fov,t.fov,n,e))&&G.equalsEpsilon(this.aspectRatio,t.aspectRatio,n,e)&&this.Gb.equalsEpsilon(t.Gb,n,e)};var GT=UT;function HT(t){t=y(t,y.EMPTY_OBJECT),this.left=t.left,this.Fb=void 0,this.right=t.right,this.jb=void 0,this.top=t.top,this.Ib=void 0,this.bottom=t.bottom,this.Cb=void 0,this.near=y(t.near,1),this.Db=this.near,this.far=y(t.far,5e8),this.kb=this.far,this.Qb=new IT}function XT(t){if(!(I(t.right)&&I(t.left)&&I(t.top)&&I(t.bottom)&&I(t.near)&&I(t.far)))throw new m("right, left, top, bottom, near, or far parameters are not set.");if(t.top!==t.Ib||t.bottom!==t.Cb||t.left!==t.Fb||t.right!==t.jb||t.near!==t.Db||t.far!==t.kb){if(t.left>t.right)throw new m("right must be greater than left.");if(t.bottom>t.top)throw new m("top must be greater than bottom.");if(t.near<=0||t.near>t.far)throw new m("near must be greater than zero and less than far.");t.Fb=t.left,t.jb=t.right,t.Ib=t.top,t.Cb=t.bottom,t.Db=t.near,t.kb=t.far,t.Qb=IT.computeOrthographicOffCenter(t.left,t.right,t.bottom,t.top,t.near,t.far,t.Qb)}}Object.defineProperties(HT.prototype,{projectionMatrix:{get:function(){return XT(this),this.Qb}}});var VT=new b,zT=new b,WT=new b,YT=new b,QT=(HT.prototype.computeCullingVolume=function(t,n,e){if(!I(t))throw new m("position is required.");if(!I(n))throw new m("direction is required.");var i,r,o,s,a,u,c,h,f;if(I(e))return i=this._cullingVolume.planes,r=this.top,o=this.bottom,s=this.right,h=this.left,c=this.near,a=this.far,u=b.cross(n,e,VT),b.normalize(u,u),b.multiplyByScalar(n,c,c=zT),b.add(t,c,c),b.multiplyByScalar(u,h,h=WT),b.add(c,h,h),(f=I(f=i[0])?f:i[0]=new sT).x=u.x,f.y=u.y,f.z=u.z,f.w=-b.dot(u,h),b.multiplyByScalar(u,s,h),b.add(c,h,h),(f=I(f=i[1])?f:i[1]=new sT).x=-u.x,f.y=-u.y,f.z=-u.z,f.w=-b.dot(b.negate(u,YT),h),b.multiplyByScalar(e,o,h),b.add(c,h,h),(f=I(f=i[2])?f:i[2]=new sT).x=e.x,f.y=e.y,f.z=e.z,f.w=-b.dot(e,h),b.multiplyByScalar(e,r,h),b.add(c,h,h),(f=I(f=i[3])?f:i[3]=new sT).x=-e.x,f.y=-e.y,f.z=-e.z,f.w=-b.dot(b.negate(e,YT),h),(f=I(f=i[4])?f:i[4]=new sT).x=n.x,f.y=n.y,f.z=n.z,f.w=-b.dot(n,c),b.multiplyByScalar(n,a,h),b.add(t,h,h),(f=I(f=i[5])?f:i[5]=new sT).x=-n.x,f.y=-n.y,f.z=-n.z,f.w=-b.dot(b.negate(n,YT),h),this._cullingVolume;throw new m("up is required.")},HT.prototype.getPixelDimensions=function(t,n,e,i,r){if(XT(this),!I(t)||!I(n))throw new m("Both drawingBufferWidth and drawingBufferHeight are required.");if(t<=0)throw new m("drawingBufferWidth must be greater than zero.");if(n<=0)throw new m("drawingBufferHeight must be greater than zero.");if(!I(e))throw new m("distance is required.");if(!I(i))throw new m("pixelRatio is required.");if(i<=0)throw new m("pixelRatio must be greater than zero.");if(I(r))return e=this.right-this.left,n=i*(this.top-this.bottom)/n,r.x=i*e/t,r.y=n,r;throw new m("A result object is required.")},HT.prototype.clone=function(t){return(t=I(t)?t:new HT).left=this.left,t.right=this.right,t.top=this.top,t.bottom=this.bottom,t.near=this.near,t.far=this.far,t.Fb=void 0,t.jb=void 0,t.Ib=void 0,t.Cb=void 0,t.Db=void 0,t.kb=void 0,t},HT.prototype.equals=function(t){return I(t)&&t instanceof HT&&this.right===t.right&&this.left===t.left&&this.top===t.top&&this.bottom===t.bottom&&this.near===t.near&&this.far===t.far},HT.prototype.equalsEpsilon=function(t,n,e){return t===this||I(t)&&t instanceof HT&&G.equalsEpsilon(this.right,t.right,n,e)&&G.equalsEpsilon(this.left,t.left,n,e)&&G.equalsEpsilon(this.top,t.top,n,e)&&G.equalsEpsilon(this.bottom,t.bottom,n,e)&&G.equalsEpsilon(this.near,t.near,n,e)&&G.equalsEpsilon(this.far,t.far,n,e)},HT);function ZT(t){t=y(t,y.EMPTY_OBJECT),this.Gb=new QT,this.width=t.width,this.tt=void 0,this.aspectRatio=t.aspectRatio,this.zb=void 0,this.near=y(t.near,1),this.Db=this.near,this.far=y(t.far,5e8),this.kb=this.far,this.zoom=t.zoom||1,this.jh=this.zoom}function qT(t){if(!(I(t.width)&&I(t.aspectRatio)&&I(t.near)&&I(t.far)&&I(t.zoom)))throw new m("width, aspectRatio, near, or far parameters are not set.");var n=t.Gb;if(t.width!==t.tt||t.aspectRatio!==t.zb||t.near!==t.Db||t.far!==t.kb||t.zoom!==t.jh){if(t.aspectRatio<0)throw new m("aspectRatio must be positive.");if(t.near<0||t.near>t.far)throw new m("near must be greater than zero and less than far.");t.zb=t.aspectRatio,t.tt=t.width,t.Db=t.near,t.kb=t.far;var e=1/t.aspectRatio,i=t.width/(2*t.zoom),e=e*t.width/(2*t.zoom),r=0-i,o=0+e,e=0-e;n.right=0+i,n.left=r,n.top=o,n.bottom=e,n.near=t.near,n.far=t.far}}ZT.packedLength=4,ZT.pack=function(t,n,e){return U.typeOf.object("value",t),U.defined("array",n),e=y(e,0),n[e++]=t.width,n[e++]=t.aspectRatio,n[e++]=t.near,n[e]=t.far,n},ZT.unpack=function(t,n,e){return U.defined("array",t),n=y(n,0),(e=I(e)?e:new ZT).width=t[n++],e.aspectRatio=t[n++],e.near=t[n++],e.far=t[n],e},Object.defineProperties(ZT.prototype,{projectionMatrix:{get:function(){return qT(this),this.Gb.projectionMatrix}},offCenterFrustum:{get:function(){return qT(this),this.Gb}}}),ZT.prototype.computeCullingVolume=function(t,n,e){return qT(this),this.Gb.computeCullingVolume(t,n,e)},ZT.prototype.getPixelDimensions=function(t,n,e,i,r){return qT(this),this.Gb.getPixelDimensions(t,n,e,i,r)},ZT.prototype.clone=function(t){return(t=I(t)?t:new ZT).aspectRatio=this.aspectRatio,t.width=this.width,t.near=this.near,t.far=this.far,t.zb=void 0,t.tt=void 0,t.Db=void 0,t.kb=void 0,this.Gb.clone(t.Gb),t},ZT.prototype.equals=function(t){return!!(I(t)&&t instanceof ZT)&&(qT(this),qT(t),this.width===t.width)&&this.aspectRatio===t.aspectRatio&&this.Gb.equals(t.Gb)},ZT.prototype.update=function(){qT(this)},ZT.prototype.equalsEpsilon=function(t,n,e){return!!(I(t)&&t instanceof ZT)&&(qT(this),qT(t),G.equalsEpsilon(this.width,t.width,n,e))&&G.equalsEpsilon(this.aspectRatio,t.aspectRatio,n,e)&&this.Gb.equalsEpsilon(t.Gb,n,e)};var KT=ZT;function JT(t,n,e,i){"number"==typeof e&&(i=e,e=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),R.call(this,t,n,e),this.meshPerAttribute=i||1}function $T(t){return($T="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 tA(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,function(t){t=function(t,n){if("object"!=$T(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=$T(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==$T(t)?t:t+""}(i.key),i)}}JT.prototype=Object.assign(Object.create(R.prototype),{constructor:JT,isInstancedBufferAttribute:!0,copy:function(t){return R.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this}});var nA=function(){function n(t){if(!(this instanceof n))throw new TypeError("Cannot call a class as a function");this.label=t,this.viewportV2=new Mt}return t=n,(e=[{key:"frustum",get:function(){return this.label.C0.map.camera.isOrthographicCamera?this.frustumO:this.frustumP}},{key:"getGeometry",value:function(){for(var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],n=new Og,e=(n.instanceCount=t.length,[]),i=[],r=[],o=[],s=[],a=[],u=0;u<t.length;u++){var c=t[u],h=c.bottomLeft,f=c.eyeOffset,l=c.imageHeight,d=c.imageWidth,v=c.imageRectangleSize,p=c.scale,c=c.translate;e.push(h.x,h.y),i.push(f.x,f.y,f.z),r.push(d,l),o.push(v.width,v.height),a.push(c.x,c.y),s.push(p)}return n.setAttribute("bottomLeft",new JT(new Float32Array(e),2)),n.setAttribute("eyeOffset",new JT(new Float32Array(i),3)),n.setAttribute("imageSize",new JT(new Float32Array(r),2)),n.setAttribute("imageRectangle",new JT(new Float32Array(o),2)),n.setAttribute("scale",new JT(new Float32Array(s),1)),n.setAttribute("translate",new JT(new Float32Array(a),2)),n.setIndex([0,1,2,0,2,3]),n.setAttribute("direction",new R(new Float32Array([0,0,1,0,1,1,0,1]),2)),n}},{key:"_getUniform",value:function(t,n){var e=this.label.C0,i=e.map.camera,e=e.map.It.renderer,r=new xh(t.canvas),e=(r.minFilter=Zn,r.magFilter=Zn,i.updateMatrix(),i.updateProjectionMatrix(),e.getDrawingBufferSize(this.viewportV2),this.frustumP=new GT({fov:G.toRadians(i.fov||60),aspectRatio:this.viewportV2.x/this.viewportV2.y,near:i.near,far:i.far}),this.frustumO=new KT({width:e.domElement.clientWidth,aspectRatio:e.domElement.clientWidth/e.domElement.clientHeight,near:i.near,far:i.far,zoom:i.zoom}),i.isOrthographicCamera?this.frustumO:this.frustumP),e=(e.update(),e.Gb),o=t.fillColor,t=t.fontSize;return{isHalo:{value:n},outlineColor:{value:this.label.outlineColor},outlineWidth:{value:this.label.outlineWidth},halo_blur:{value:1},czm_orthographicIn3D:{value:i.isOrthographicCamera?1:0},czm_currentFrustum:{value:[i.near,i.far]},czm_viewport:{value:[0,0,this.viewportV2.x,this.viewportV2.y]},czm_frustumPlanes:{value:[e.top,e.bottom,e.left,e.right]},czm_projection:{value:i.projectionMatrix},czm_viewMatrix:{value:i.matrixWorldInverse},u_atlas:{value:r},u_device_pixel_ratio:{value:this.label.pixelRatio},fontSize:{value:+t},fillColor:{value:o},pixelOffset:{value:this.label.pixelOffset},origin:{value:[w0.LEFT,this.label.verticalOrigin]}}}},{key:"init",value:function(t,n){var e,i=this;this.label.rootNode&&((e=new $a(this.getGeometry(t),new Ul({uniforms:this._getUniform(t[0],n),fragmentShader:"\nprecision highp float;\nprecision highp int;\n\n#define SDF_EDGE 0.75\n#define SDF_PX 8.0\n\nuniform sampler2D u_atlas;\nuniform vec3 fillColor;\nuniform float fontSize;\nuniform float u_device_pixel_ratio;\n\nuniform float isHalo;\nuniform float halo_blur;\nuniform vec3 outlineColor;\nuniform float outlineWidth;\n\nvarying vec2 v_textureCoordinates;\n\nvoid main() {\n  float buff = (256.0 - 64.0) / 256.0;\n  float fontScale = fontSize / 24.0;\n  float EDGE_GAMMA = 0.105 / u_device_pixel_ratio;\n  float gamma = EDGE_GAMMA / (fontScale);\n\n  vec3 color = fillColor;\n\n  if (isHalo > 0. ) {\n    color = outlineColor;\n    gamma = (halo_blur * 1.19 / SDF_PX + EDGE_GAMMA) / fontScale ;\n    buff = (6.0 - outlineWidth / fontScale) / SDF_PX;\n  }\n\n  float dist = texture2D(u_atlas, v_textureCoordinates).a;\n  float alpha = smoothstep(buff - gamma, buff + gamma, dist);\n\n  gl_FragColor = vec4(color, alpha);\n\n  if(isHalo > 0. && gl_FragColor.a < 0.95) {\n    discard;\n  }\n}\n",vertexShader:"\nuniform float czm_orthographicIn3D;\nuniform float u_device_pixel_ratio;\nuniform vec4 czm_viewport;\nuniform vec4 czm_frustumPlanes;\nuniform vec2 czm_currentFrustum;\nuniform mat4 czm_projection;\nuniform mat4 modelViewMatrix;\nuniform vec2 pixelOffset;\n\nattribute vec2 direction;\nuniform vec2 origin;\nattribute vec2 imageSize;\nattribute vec2 translate;\nattribute float scale;\n\nattribute vec3 eyeOffset;\nattribute vec2 bottomLeft;\nattribute vec2 imageRectangle;\n\nvarying vec2 v_textureCoordinates;\n\n/**\n * 计算屏幕上每个像素对应多少米\n * @param {vec4} positionEC 表示相机位置到目标点的向量\n * @param {float} pixelRatio 像素比例值\n */\nfloat czm_metersPerPixel(vec4 positionEC, float pixelRatio) {\n  float width = czm_viewport.z;\n    float height = czm_viewport.w;\n    float pixelWidth;\n    float pixelHeight;\n\n    float top = czm_frustumPlanes.x;\n    float bottom = czm_frustumPlanes.y;\n    float left = czm_frustumPlanes.z;\n    float right = czm_frustumPlanes.w;\n\n    if (czm_orthographicIn3D == 1.0)\n    {\n        float frustumWidth = right - left;\n        float frustumHeight = top - bottom;\n        pixelWidth = frustumWidth / width;\n        pixelHeight = frustumHeight / height;\n    }\n    else\n    {\n        float distanceToPixel = -positionEC.z;\n        float inverseNear = 1.0 / czm_currentFrustum.x;\n        float tanTheta = top * inverseNear;\n        pixelHeight = 2.0 * distanceToPixel * tanTheta / height;\n        tanTheta = right * inverseNear;\n        pixelWidth = 2.0 * distanceToPixel * tanTheta / width;\n    }\n\n    return max(pixelWidth, pixelHeight) * pixelRatio;\n}\n\nfloat czm_metersPerPixel(vec4 positionEC) {\n    return czm_metersPerPixel(positionEC, u_device_pixel_ratio);\n}\n\nfloat czm_branchFreeTernary(bool comparison, float a, float b) {\n    float useA = float(comparison);\n    return a * useA + b * (1.0 - useA);\n}\n\nvec4 addScreenSpaceOffset(\n  vec4 positionEC,\n  vec2 imageSize,\n  float scale,\n  vec2 direction,\n  vec2 origin,\n  vec2 translate,\n  vec2 pixelOffset,\n   vec3 alignedAxis,\n   bool validAlignedAxis,\n   float rotation,\n   bool sizeInMeters,\n   out mat2 rotationMatrix,\n   out float mpp\n  ) {\n    vec2 halfSize = imageSize * scale * 0.5;\n    halfSize *= ((direction * 2.0) - 1.0);\n    vec2 originTranslate = origin * abs(halfSize);\n\n    mpp = czm_metersPerPixel(positionEC);\n    positionEC.xy += (originTranslate + halfSize) * czm_branchFreeTernary(sizeInMeters, 1.0, mpp);\n    positionEC.xy += (translate + pixelOffset) * mpp;\n    return positionEC;\n}\n\nvoid main() {\n    vec4 positionEC = modelViewMatrix * vec4(0.,0.,0., 1.0);\n\n    float mpp;\n    mat2 rotationMatrix;\n    bool validAlignedAxis = false;\n    float rotation = 0.0;\n    bool sizeInMeters = false;\n\n    vec3 alignedAxis = vec3(0.0);\n    positionEC = addScreenSpaceOffset(\n        positionEC,\n        imageSize,\n        scale,\n        direction,\n        origin,\n        translate,\n        pixelOffset,\n        alignedAxis,\n        validAlignedAxis,\n        rotation,\n        sizeInMeters,\n        rotationMatrix,\n        mpp\n    );\n    gl_Position = czm_projection * positionEC;\n\n\n    vec2 textureCoordinatesBottomLeft = bottomLeft;\n    vec2 textureCoordinatesRange = imageRectangle;\n    vec2 textureCoordinates = textureCoordinatesBottomLeft + direction * textureCoordinatesRange;\n    v_textureCoordinates = textureCoordinates;\n}\n",transparent:!0,wireframe:!1,depthTest:!1}))).onBeforeRender=function(){var t=i.label.C0,n=t.map.camera,t=t.map.It.renderer,t=(t.getDrawingBufferSize(i.viewportV2),i.frustumP.fov=G.toRadians(n.fov||60),i.frustumP.aspectRatio=i.viewportV2.x/i.viewportV2.y,i.frustumP.near=n.near,i.frustumP.far=n.far,i.frustumO.aspectRatio=t.domElement.clientWidth/t.domElement.clientHeight,i.frustumO.near=n.near,i.frustumO.far=n.far,i.frustumO.width=t.domElement.clientWidth,i.frustumO.zoom=n.zoom,n.isOrthographicCamera?i.frustumO:i.frustumP),t=(t.update(),t.Gb);e.material.uniforms.czm_currentFrustum.value=[n.near,n.far],e.material.uniforms.czm_viewport.value=[0,0,i.viewportV2.x,i.viewportV2.y],e.material.uniforms.czm_projection.value=n.projectionMatrix,e.material.uniforms.czm_frustumPlanes.value=[t.top,t.bottom,t.left,t.right],e.material.uniforms.czm_orthographicIn3D.value=n.isOrthographicCamera?1:0,e.material.uniforms.pixelOffset.value=i.label.pixelOffset,e.material.uniforms.origin.value=[w0.LEFT,i.label.verticalOrigin],e.material.uniforms.fillColor.value=i.label.V0,e.material.uniforms.u_device_pixel_ratio.value=i.label.pixelRatio},e.renderOrder=n?-1:1,t=n?"labelMeshInstance":"labelOutlineMeshInstance",this.label.rootNode.add(e),(this.label[t]=this).mesh=e)}}])&&tA(t.prototype,e),i&&tA(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,i}();function eA(t){return(eA="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 iA(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,function(t){t=function(t,n){if("object"!=eA(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=eA(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==eA(t)?t:t+""}(i.key),i)}}var rA,oA=function(){function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");this.Zb=[],this.qb=[],this.label=null}return n=t,(e=[{key:"add",value:function(){var t=new k3(0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},this);return t.Kb=this.Zb.length,this.Zb.push(t),t}},{key:"createMeshInstance",value:function(t){if(0!=t.length){this.label.G0=!1;for(var n=[],e=0;e<t.length;e++){var i=t[e],r=i.scale,o=i.pixelOffset,s=i.pickPrimitive,a=i._b,u=i.xb,c=i.Eb,h=i.wb,f=i.Tb;if(-1===f)break;var f=this.Ob.textureCoordinates[f],l=f.width,d=f.height,v=f.x,f=f.y,p=this.Ob.zh.width,m=this.Ob.zh.height,p=Math.round(y(i.width,p*l)),m=Math.round(y(i.height,m*d));n.push({fontSize:s.iy,Sb:i.Sb,bottomLeft:{x:v,y:f},imageRectangleSize:{width:l,height:d},fillColor:i.color,show:1,scale:r,pixelOffset:o,imageWidth:p,imageHeight:m,eyeOffset:h,translate:{x:a.x,y:a.y},verticalOrigin:u,horizontalOrigin:c,canvas:this.Ob.texture.canvas})}new nA(this.label).init(n,!1),new nA(this.label).init(n,!0)}}},{key:"_updateBillboard",value:function(t){this.qb.push(t)}},{key:"update",value:function(){var t=this.qb.length,n=this.Ob.textureCoordinates;if(0!==n.length){for(var e=0;e<t;++e)this.qb[e].G0=!1;this.createMeshInstance(this.qb),this.qb.length=0}}}])&&iA(n.prototype,e),i&&iA(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,e,i}(),sA=Object.freeze({FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2}),aA=Object.freeze({FONT_SIZE:48,PADDING:10,RADIUS:12,CUTOFF:.25});function uA(t,n){if(!I(t))throw new m("text is required.");var e,i,r,o,s,a,u,c,h,f,l,d,v,p;if(""!==t)return n=y(n,y.EMPTY_OBJECT),e=y(n.font,"10px sans-serif"),i=y(n.stroke,!1),r=y(n.fill,!0),o=y(n.strokeWidth,1),s=y(n.backgroundColor,P3.TRANSPARENT),v=2*(a=y(n.padding,0)),(u=document.createElement("canvas")).width=1,u.height=1,u.style.font=e,c=u.getContext("2d",{willReadFrequently:!0}),I(rA)||(I(c.imageSmoothingEnabled)?rA="imageSmoothingEnabled":I(c.mozImageSmoothingEnabled)?rA="mozImageSmoothingEnabled":I(c.webkitImageSmoothingEnabled)?rA="webkitImageSmoothingEnabled":I(c.msImageSmoothingEnabled)&&(rA="msImageSmoothingEnabled")),c.font=e,c.lineJoin="round",c.lineWidth=o,c[rA]=!1,p=(function(t){if(null!==(t=t.match(/\b\d+(?=px\b)/)))return parseInt(t[0])}(e)||0)/(/[\u4e00-\u9fa5]/.test(t)?11:15),c.textBaseline="Alphabetic",u.style.visibility="hidden",document.body.appendChild(u),d=function(t,n,e,i,r){var o=t.measureText(n);if(!/\S/.test(n))return{width:o.width,height:0,ascent:0,descent:0,minx:0};for(var s,a,u,c=document.defaultView.getComputedStyle(t.canvas).getPropertyValue("font-size").replace("px","")||aA.FONT_SIZE,h=document.createElement("canvas"),f=o.width+100|0,l=3*c,c=l/2,d=(h.width=f,h.height=l,h.getContext("2d")),v=(d.font=e,d.fillStyle="white",d.fillRect(0,0,h.width+1,h.height+1),i&&(d.strokeStyle="black",d.lineWidth=t.lineWidth,d.strokeText(n,50,c)),r&&(d.fillStyle="black",d.fillText(n,50,c)),d.getImageData(0,0,f,l).data),p=v.length,m=4*f,y=0;y<p;++y)if(255!==v[y]){a=y/m|0;break}for(y=p-1;0<=y;--y)if(255!==v[y]){u=y/m|0;break}var b=-1;for(y=0;y<f&&-1===b;++y)for(s=0;s<l;++s){var g=4*y+s*m;if(255!==v[g]||255!==v[1+g]||255!==v[2+g]||255!==v[3+g]){b=y;break}}return{width:o.width,height:u-a,ascent:c-a,descent:u-c,minx:b-50}}(c,t,e,i,r),u.dimensions=d,document.body.removeChild(u),u.style.visibility="",h=-d.minx,f=Math.ceil(d.width)+h+v,d=(l=d.height+v)-(l-d.ascent+a)+v-p,u.width=f,u.height=l,c.font=e,c.lineJoin="round",c.lineWidth=o,c[rA]=!1,s!==P3.TRANSPARENT&&(c.fillStyle=s.getStyle(),c.fillRect(0,0,u.width,u.height)),i&&(v=y(n.strokeColor,P3.BLACK),c.strokeStyle=v.getStyle(),c.strokeText(t,h+a,d)),r&&(p=y(n.fillColor,P3.WHITE),c.fillStyle=p.getStyle(),c.fillText(t,h+a,d)),u}function cA(t){return(cA="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 hA(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,function(t){t=function(t,n){if("object"!=cA(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=cA(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==cA(t)?t:t+""}(i.key),i)}}function fA(t,n,e){return n&&hA(t.prototype,n),e&&hA(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}var lA=fA(function t(n,e,i){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");this.labelCollection=n,this.index=e,this.dimensions=i}),dA=1e20;function vA(t,n,e,i,r,o,s){for(var a=0;a<n;a++){for(var u=0;u<e;u++)i[u]=t[u*n+a];for(pA(i,r,o,s,e),u=0;u<e;u++)t[u*n+a]=r[u]}for(u=0;u<e;u++){for(a=0;a<n;a++)i[a]=t[u*n+a];for(pA(i,r,o,s,n),a=0;a<n;a++)t[u*n+a]=Math.sqrt(r[a])}}function pA(t,n,e,i,r){i[e[0]=0]=-dA,i[1]=+dA;for(var o=1,s=0;o<r;o++){for(var a=(t[o]+o*o-(t[e[s]]+e[s]*e[s]))/(2*o-2*e[s]);a<=i[s];)s--,a=(t[o]+o*o-(t[e[s]]+e[s]*e[s]))/(2*o-2*e[s]);e[++s]=o,i[s]=a,i[s+1]=+dA}for(s=o=0;o<r;o++){for(;i[s+1]<o;)s++;n[o]=(o-e[s])*(o-e[s])+t[e[s]]}}function mA(t){return(mA="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 yA(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,function(t){t=function(t,n){if("object"!=mA(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=mA(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==mA(t)?t:t+""}(i.key),i)}}function bA(t,n,e){return n&&yA(t.prototype,n),e&&yA(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}var gA=bA(function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");this.textureInfo=null,this.dimensions=null});function _A(t){return(_A="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 wA(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,function(t){t=function(t,n){if("object"!=_A(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=_A(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==_A(t)?t:t+""}(i.key),i)}}function xA(t,n,e){return n&&wA(t.prototype,n),e&&wA(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}var EA=xA(function t(n,e,i,r){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");this.x=y(n,0),this.y=y(e,0),this.width=y(i,0),this.height=y(r,0)}),SA={},TA=0,AA=256;function MA(t,n){return document.defaultView.getComputedStyle(t,null).getPropertyValue(n)}function OA(t,n){n.textureInfo=void 0,n.dimensions=void 0;var e=n.billboard;e&&(e.show=!1,e.image=void 0,e.Jb&&(e.Jb(),e.Jb=void 0),n.billboard=void 0)}var LA={};function RA(t){var n,e,i=SA[t.$b];i||((n=document.createElement("div")).style.position="absolute",n.style.opacity=0,n.style.font=t.$b,document.body.appendChild(n),e=parseFloat(MA(n,"line-height")),isNaN(e)&&(e=void 0),i={family:MA(n,"font-family"),size:MA(n,"font-size").replace("px",""),style:MA(n,"font-style"),weight:MA(n,"font-weight"),lineHeight:e},document.body.removeChild(n),TA<AA&&(SA[t.$b]=i,TA++)),t.Xm=i.family,t.iy=i.size,t.tg=i.style,t.ng=i.weight,t.eg=i.lineHeight}function NA(t,n,e,i){var r,o,n="".concat(n.tg," ").concat(n.ng," ").concat(aA.FONT_SIZE,"px ").concat(n.Xm),n=(t=t,s=P3.WHITE,u=P3.WHITE,r=0,o=sA.FILL,i=i,LA.font=n,LA.fillColor=s,LA.strokeColor=u,LA.strokeWidth=r,LA.padding=aA.PADDING,i===x0.CENTER?LA.textBaseline="middle":i===x0.TOP?LA.textBaseline="top":LA.textBaseline="bottom",LA.fill=o===sA.FILL||o===sA.FILL_AND_OUTLINE,LA.stroke=o===sA.OUTLINE||o===sA.FILL_AND_OUTLINE,LA.backgroundColor=P3.BLACK,uA(t,LA)),s=new lA(e,-1,n.dimensions);if(0<n.width&&0<n.height){for(var a=function(t,n){var e,i,r,o,s,a=null==(n=n||{}).cutoff?.25:n.cutoff,u=null==n.radius?8:n.radius,c=n.channel||0;if(ArrayBuffer.isView(t)||Array.isArray(t)){if(!n.width||!n.height)throw Error("For raw data width and height should be provided by options");e=n.width,i=n.height,r=t,s=n.stride||Math.floor(t.length/e/i)}else window.HTMLCanvasElement&&t instanceof window.HTMLCanvasElement?(d=(l=t).getContext("2d"),e=l.width,i=l.height,r=(v=d.getImageData(0,0,e,i)).data,s=4):window.CanvasRenderingContext2D&&t instanceof window.CanvasRenderingContext2D?(e=(l=t.canvas).width,i=l.height,r=(v=(d=t).getImageData(0,0,e,i)).data,s=4):window.ImageData&&t instanceof window.ImageData&&(e=(v=t).width,i=t.height,r=v.data,s=4);if(n=Math.max(e,i),window.Uint8ClampedArray&&r instanceof window.Uint8ClampedArray||window.Uint8Array&&r instanceof window.Uint8Array)for(o=r,r=Array(e*i),p=0,m=Math.floor(o.length/s);p<m;p++)r[p]=o[p*s+c]/255;else if(1!==s)throw Error("Raw data can have only 1 value per pixel");for(var h=Array(e*i),f=Array(e*i),l=Array(n),d=Array(n),t=Array(n+1),v=Array(n),p=0,m=e*i;p<m;p++){var y=r[p];h[p]=1===y?0:0===y?dA:Math.pow(Math.max(0,.5-y),2),f[p]=1===y?dA:0===y?0:Math.pow(Math.max(0,y-.5),2)}vA(h,e,i,l,d,v,t),vA(f,e,i,l,d,v,t);var b=new(window.Float32Array?Float32Array:Array)(e*i);for(p=0,m=e*i;p<m;p++)b[p]=Math.min(Math.max(1-((h[p]-f[p])/u+a),0),1);return b}(n,{cutoff:aA.CUTOFF,radius:aA.RADIUS}),u=n.getContext("2d"),c=n.width,h=n.height,f=u.getImageData(0,0,c,h),l=0;l<c;l++)for(var d=0;d<h;d++){var v=d*c+l,p=255*a[v],v=4*v;f.data[0+v]=p,f.data[1+v]=p,f.data[2+v]=p,f.data[3+v]=p}u.putImageData(f,0,0)}return{glyphTextureInfo:s,canvas:n}}function PA(t,n,e){return n===w0.CENTER?-t/2:n===w0.RIGHT?-(t+e.x):e.x}var FA=new Mt,jA=new Mt,IA=new EA(1,1,1,1);function CA(t){var n=t.ig,e=t.j0,i=0,r=0,o=[],s=Number.NEGATIVE_INFINITY,a=0,u=1,c=n.length,h=t.rg,f=F3.clone(I(h)?t._backgroundPadding:F3.ZERO,jA);for(f.x/=t.og,f.y/=t.og,j=0;j<c;++j)"\n"===e.charAt(j)?(o.push(i),++u,i=0):(b=(y=n[j]).dimensions,a=Math.max(a,b.height-b.descent),s=Math.max(s,b.descent),i+=b.width-b.minx,j<c-1&&(i+=n[j+1].dimensions.minx),r=Math.max(r,i));o.push(i);for(var l,d,v,p,m,y,b,g=a+s,_=t.totalScale,w=t.Eb,x=t.xb,E=t.Qm,S=0,T=o[S],A=PA(T,w,f),M=(l=r,d=T,E=E,v=f,p=0,p=(M=w)===w0.CENTER?-l/2:M===w0.RIGHT?-(l+v.x):v.x,E===Bl.Left?p+=0:E===Bl.Right?p+=l-d+v.x:p+=l/2-d/2,p),O=(T<r&&1<o.length&&(A=M),(I(t.eg)?t.eg:1.2*t.iy)/t.og),L=O*(u-1),R=r,N=g+L,P=(I(h)&&(R+=2*f.x,N+=2*f.y,h.sg=w),FA.x=A*_,!(FA.y=0)),F=0,j=0;j<c;++j)"\n"===e.charAt(j)?(F+=O,A=PA(o[++S],w,f),FA.x=A*_,P=!0):(b=(y=n[j]).dimensions,x===x0.TOP?(FA.y=b.height-a-f.y,FA.y+=aA.PADDING):x===x0.CENTER?FA.y=(L+b.height-a)/2:(x===x0.BASELINE?FA.y=L:FA.y=L+s+f.y,FA.y-=aA.PADDING),FA.y=(FA.y-b.descent-F)*_,P&&(FA.x-=aA.PADDING*_,P=!1),I(y.billboard)&&(y.billboard._setTranslate(FA),y.billboard.ag.x=R,y.billboard.ag.y=N,y.billboard.sg=w),j<c-1&&(m=n[j+1],FA.x+=(b.width-b.minx+m.dimensions.minx)*_));I(h)&&0<e.split("\n").join("").length&&(A=w===w0.CENTER?-r/2-f.x:w===w0.RIGHT?-(r+2*f.x):0,FA.x=A*_,x===x0.TOP?FA.y=g-a-s:x===x0.CENTER?FA.y=(g-a)/2-s:x===x0.BASELINE?FA.y=-f.y-s:FA.y=0,FA.y=FA.y*_,h.width=R,h.height=N,h._setTranslate(FA),h.ug=F3.clone(FA,h.ug))}function DA(t){return(DA="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 kA(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,function(t){t=function(t,n){if("object"!=DA(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=DA(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==DA(t)?t:t+""}(i.key),i)}}var UA=function(){return t=function t(){var n=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},e=1<arguments.length?arguments[1]:void 0,i=this,r=t;if(!(i instanceof r))throw new TypeError("Cannot call a class as a function");this.C0=e,this.X0=!1,this.j0="",this.$b='16px \'"Microsoft Yahei","微软雅黑",Tahoma,Arial\'',this.V0=[0,0,0],this.ig=[],this.style=sA.FILL,this.Eb=w0.CENTER,this.xb=x0.CENTER,this.q1=y(n.scale,1),this.cg=n.pixelOffset||[0,0],this.wb=j3.clone(y(n.eyeOffset,j3.ZERO)),this.outlineColor=[0,0,0],this.outlineWidth=0,RA(this)},(n=[{key:"horizontalOrigin",get:function(){return this.Eb}},{key:"verticalOrigin",get:function(){return this.xb}},{key:"text",get:function(){return this.j0},set:function(t){if(this.j0!==t){if(this.j0="",-1<t.indexOf("%rn%")){for(var n=t.split("%rn%"),e=0;e<n.length;e++)this.j0+=n[e],this.j0+="\n";this.j0=this.j0.slice(0,this.j0.length-1)}else this.j0=t;this.X0=!0}}},{key:"font",get:function(){return this.$b},set:function(t){this.$b!==t&&(this.$b=t,this.X0=!0,RA(this))}},{key:"pixelOffset",get:function(){return this.cg},set:function(n){this.cg=n,this.C0.gb.Zb.forEach(function(t){t.pixelOffset=n})}},{key:"totalScale",get:function(){return this.q1*this.og}},{key:"getScreenSpaceBoundingBox",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{x:0,y:0},n=1<arguments.length?arguments[1]:void 0,e=this,i=0,r=0,o=0,s=0,a=e.totalScale,u=e.rg;if(I(u))i=t.x+u._b.x,r=t.y-u._b.y,o=u.width*a,s=u.height*a,e.verticalOrigin===x0.BOTTOM||e.verticalOrigin===x0.BASELINE?r-=s:e.verticalOrigin===x0.CENTER&&(r-=.5*s);else{for(var i=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY,c=0,h=0,f=e.ig,l=f.length,d=0;d<l;++d){var v,p,m=f[d],y=m.billboard;I(y)&&(v=t.x+y._b.x,y=t.y-y._b.y,p=m.dimensions.width*a,m=m.dimensions.height*a,e.verticalOrigin===x0.BOTTOM||e.verticalOrigin===x0.BASELINE?y-=m:e.verticalOrigin===x0.CENTER&&(y-=.5*m),e.xb===x0.TOP?y+=aA.PADDING*a:e.xb!==x0.BOTTOM&&e.xb!==x0.BASELINE||(y-=aA.PADDING*a),i=Math.min(i,v),r=Math.min(r,y),c=Math.max(c,v+p),h=Math.max(h,y+m))}o=c-i,s=h-r}return(n=I(n)?n:new EA).x=i,n.y=r,n.width=o,n.height=s,n}}])&&kA(t.prototype,n),e&&kA(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,e}();var BA=function(){return"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)})},v2=Object.freeze({DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGBA_ASTC_4x4_WEBGL:37808,COMPRESSED_RGB_ETC1_WEBGL:36196,COMPRESSED_RGBA_BPTC_UNORM:36492,HALF_FLOAT_OES:36193,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047}),Fw={DEPTH_COMPONENT:v2.DEPTH_COMPONENT,DEPTH_STENCIL:v2.DEPTH_STENCIL,ALPHA:v2.ALPHA,RED:v2.RED,RG:v2.RG,RGB:v2.RGB,RGBA:v2.RGBA,LUMINANCE:v2.LUMINANCE,LUMINANCE_ALPHA:v2.LUMINANCE_ALPHA,RGB_DXT1:v2.COMPRESSED_RGB_S3TC_DXT1_EXT,RGBA_DXT1:v2.COMPRESSED_RGBA_S3TC_DXT1_EXT,RGBA_DXT3:v2.COMPRESSED_RGBA_S3TC_DXT3_EXT,RGBA_DXT5:v2.COMPRESSED_RGBA_S3TC_DXT5_EXT,RGB_PVRTC_4BPPV1:v2.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,RGB_PVRTC_2BPPV1:v2.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,RGBA_PVRTC_4BPPV1:v2.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,RGBA_PVRTC_2BPPV1:v2.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,RGBA_ASTC:v2.COMPRESSED_RGBA_ASTC_4x4_WEBGL,RGB_ETC1:v2.COMPRESSED_RGB_ETC1_WEBGL,RGB8_ETC2:v2.COMPRESSED_RGB8_ETC2,RGBA8_ETC2_EAC:v2.COMPRESSED_RGBA8_ETC2_EAC,RGBA_BC7:v2.COMPRESSED_RGBA_BPTC_UNORM},GA=Object.freeze(Fw);function HA(t){return(HA="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 XA(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,function(t){t=function(t,n){if("object"!=HA(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=HA(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==HA(t)?t:t+""}(i.key),i)}}var VA=function(){return t=function t(){var n=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},e=this,i=t;if(!(e instanceof i))throw new TypeError("Cannot call a class as a function");this.yi=BA(),this.width=n.width,this.height=n.height,this.canvas=document.createElement("canvas"),this.canvas.width=this.width,this.canvas.height=this.height,this.ctx=this.canvas.getContext("2d")},(n=[{key:"copyFrom",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},n=y(t.xOffset,0),e=y(t.yOffset,0),t=t.source,i=this.canvas.height,r=t.width,o=t.height,t=t.getContext("2d").getImageData(0,0,r,o);this.ctx.putImageData(t,n,i-o-e)}}])&&XA(t.prototype,n),e&&XA(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,e}();function zA(t){return(zA="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 WA(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,function(t){t=function(t,n){if("object"!=zA(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=zA(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==zA(t)?t:t+""}(i.key),i)}}function YA(t,n,e){return n&&WA(t.prototype,n),e&&WA(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}var QA=YA(function t(n,e,i,r,o){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");this.bottomLeft=y(n,F3.ZERO),this.topRight=y(e,F3.ZERO),this.childNode1=i,this.childNode2=r,this.imageIndex=o});function ZA(t,n,e){var i=function t(n,e,i){var r,o;if(I(e))return I(e.childNode1)||I(e.childNode2)?t(n,e.childNode1,i)||t(n,e.childNode2,i):I(e.imageIndex)||(o=e.topRight.x-e.bottomLeft.x,r=e.topRight.y-e.bottomLeft.y,o-=i.width,r-=i.height,o<0)||r<0?void 0:0==o&&0==r?e:(r<o?(e.childNode1=new QA(new Mt(e.bottomLeft.x,e.bottomLeft.y),new Mt(e.bottomLeft.x+i.width,e.topRight.y)),(r=e.bottomLeft.x+i.width+n.hg)<e.topRight.x&&(e.childNode2=new QA(new Mt(r,e.bottomLeft.y),new Mt(e.topRight.x,e.topRight.y)))):(e.childNode1=new QA(new Mt(e.bottomLeft.x,e.bottomLeft.y),new Mt(e.topRight.x,e.bottomLeft.y+i.height)),(o=e.bottomLeft.y+i.height+n.hg)<e.topRight.y&&(e.childNode2=new QA(new Mt(e.bottomLeft.x,o),new Mt(e.topRight.x,e.topRight.y)))),t(n,e.childNode1,i))}(t,t.cs,n);if(I(i)){i.imageIndex=e;var r=t.zh.width,o=t.zh.height,s=i.topRight.x-i.bottomLeft.x,a=i.topRight.y-i.bottomLeft.y,u=i.bottomLeft.x/r,c=i.bottomLeft.y/o;t.fg[e]=new EA(u,c,s/r,a/o),t.zh.copyFrom({source:n,xOffset:i.bottomLeft.x,yOffset:i.bottomLeft.y})}else{var h=t,u=n,c=h.numberOfImages,s=h.hg;if(0<c){for(var c=h.zh.width,r=h.zh.height,f=2*(c+u.width+s),l=2*(r+u.height+s),d=c/f,v=r/l,c=new QA(new Mt(c+s,s),new Mt(f,r)),c=new QA(new Mt,new Mt(f,r),h.cs,c),r=new QA(new Mt(s,r+s),new Mt(f,l)),c=new QA(new Mt,new Mt(f,l),c,r),p=0;p<h.fg.length;p++){var m=h.fg[p];I(m)&&(m.x*=d,m.y*=v,m.width*=d,m.height*=v)}r=new VA({context:h._context,width:f,height:l,pixelFormat:h.lg});r.copyFrom({source:h.zh.canvas}),h.zh=r,h.cs=c}else{f=2*(u.width+2*s),l=2*(u.height+2*s);f<h.dg.x&&(f=h.dg.x),l<h.dg.y&&(l=h.dg.y),h.zh=h.zh&&h.zh.destroy(),h.zh=new VA({context:h._context,width:f,height:l,pixelFormat:h.lg}),h.cs=new QA(new Mt(s,s),new Mt(f,l))}ZA(t,n,e)}t.vg=BA()}function qA(t){return(qA="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 KA(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,function(t){t=function(t,n){if("object"!=qA(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=qA(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==qA(t)?t:t+""}(i.key),i)}}var JA=new Mt(16,16),$A=function(){return t=function t(){var n=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},e=this,i=t;if(!(e instanceof i))throw new TypeError("Cannot call a class as a function");e=y(n.borderWidthInPixels,1),i=y(n.initialSize,JA);this.lg=y(n.pixelFormat,GA.RGBA),this.hg=e,this.fg=[],this.vg=BA(),this.pg={},this.mg={},this.dg=i,this.cs=void 0},(n=[{key:"numberOfImages",get:function(){return this.fg.length}},{key:"textureCoordinates",get:function(){return this.fg}},{key:"texture",get:function(){return this.zh}},{key:"addImageSync",value:function(t,n){if(!I(t))throw new m("id is required.");var e,i;if(I(n))return I(e=this.mg[t])||(n=n,e=!I(i=this)||i.isDestroyed()?-1:(ZA(i,n,n=i.numberOfImages),n),this.pg[t]=Promise.resolve(e),this.mg[t]=e),e;throw new m("image is required.")}},{key:"isDestroyed",value:function(){return!1}},{key:"addImage",value:function(t){var n=this.pg[t];return I(n)||(this.pg[t]=n),n}}])&&KA(t.prototype,n),e&&KA(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,e}();function tM(t){return(tM="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){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,function(t){t=function(t,n){if("object"!=tM(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);e=e.call(t,n||"default");if("object"!=tM(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==tM(t)?t:t+""}(i.key),i)}}var eM,t=function(){function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");this.map=null,this.H0={},this.yg=[],this.Tv=[],this.Ob=new $A,this.gb=new oA,this.gb.Ob=this.Ob}return n=t,(e=[{key:"add",value:function(t){t=new UA(t,this);return this.Tv.push(t),this.gb.label=t}},{key:"update",value:function(){for(var t=this.Tv.length,n=0;n<t;n++){var e=this.Tv[n];if(e.X0){b=y=m=p=d=l=f=v=i=c=u=a=s=h=o=r=void 0;var i,r=this,o=e,s=h=o.j0,a=h.length,u=o.ig,c=u.length;if(o.og=o.iy/aA.FONT_SIZE,a<c)for(i=a;i<c;++i)OA(0,u[i]);u.length=a;for(var h=o._showBackground&&0<h.split("\n").join("").length,f=o.rg,l=r._backgroundBillboardCollection,d=(h?(I(f)||(f=l.add({collection:r,image:"ID_WHITE_PIXEL",imageSubRegion:IA}),o.rg=f),f.color=o.fm,f.show=o.lh,f.position=o._position,f.eyeOffset=o.wb,f.pixelOffset=o.cg,f.horizontalOrigin=w0.LEFT,f.verticalOrigin=o.xb,f.heightReference=o._heightReference,f.scale=o.totalScale,f.pickPrimitive=o,f.id=o.yi,f.translucencyByDistance=o._translucencyByDistance,f.pixelOffsetScaleByDistance=o._pixelOffsetScaleByDistance,f.scaleByDistance=o._scaleByDistance,f.distanceDisplayCondition=o._distanceDisplayCondition,f.disableDepthTestDistance=o._disableDepthTestDistance):I(f)&&(l.remove(f),o.rg=f=void 0),r.H0),v=0;v<a;++v){var p=s[v],m=o.xb,y=JSON.stringify([p,o.Xm,o.tg,o.ng,+m]),b=d[y];I(b)||(b=(m=NA(p,o,r,m)).glyphTextureInfo,d[y]=b," "!==p&&(b.index=r.Ob.addImageSync(y,m.canvas))),I(p=u[v])?-1===b.index?OA(0,p):I(p.textureInfo)&&(p.textureInfo=void 0):(p=new gA,u[v]=p),p.textureInfo=b,p.dimensions=b.dimensions,-1!==b.index&&(m=p.billboard,b=r.yg,I(m)||(0<b.length?m=b.pop():((m=r.gb.add({collection:r})).ag=new Mt,m.ug=new Mt),p.billboard=m),m.show=o.lh,m.position=o._position,m.eyeOffset=o.wb,m.pixelOffset=o.cg,m.horizontalOrigin=w0.LEFT,m.verticalOrigin=o.xb,m.heightReference=o._heightReference,m.scale=o.totalScale,m.pickPrimitive=o,m.id=o.yi,m.image=y,m.translucencyByDistance=o._translucencyByDistance,m.pixelOffsetScaleByDistance=o._pixelOffsetScaleByDistance,m.scaleByDistance=o._scaleByDistance,m.distanceDisplayCondition=o._distanceDisplayCondition,m.disableDepthTestDistance=o._disableDepthTestDistance,m.bg=o.bg,m.outlineColor=o.outlineColor,o.style===sA.FILL_AND_OUTLINE?(m.color=o.V0,m.outlineWidth=o.outlineWidth):o.style===sA.FILL?(m.color=o.V0,m.outlineWidth=0):o.style===sA.OUTLINE&&(m.color=P3.TRANSPARENT,m.outlineWidth=o.outlineWidth))}o.gg=!0,e.X0=!1}e.gg&&(CA(e),e.gg=!1)}this.gb.update()}}])&&nM(n.prototype,e),i&&nM(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,e,i}(),iM=(st.a.DepthPeelingRenderer=Ly,st.a.LabelCollection=t,{FMMouseMode:qo,VERSION:S,BUILD:T,FMMap:p,FMType:E,FMViewMode:Si,FMShadingMode:ds,FMInfoMode:mr,FMTextAlign:Bl,FMLineType:y_,FMLabelField:i1,FMMarkerAnchor:yr,FMEdgeMode:yE,FMDepthPeelingMode:Q2,FMOverviewMode:Om,FMEnterTriggerMode:Y2,FMUtil:pr,FMCalculator:E1,FMCoordsTransformer:t2,FMImageMarker:Jy,FMMarker:Mg,FMTextMarker:db,FMPolygonMarker:a2,FMLocationMarker:w2,FMHeatMap:ev,FMDynamicModel:nv,FMLineMarker:M_,FMDomMarker:Vy,FMExtrudeMarker:gw,FMSegment:m_,FMMarkerLayer:Z1,FMBound:Ii,FMOrientedBound:n,FMRectangle:_1,FMMarkerFun:E2,FMMapMask:x2,FMLight:i,FMLightMode:hS,FMDynamicTextureTool:Bw,FMMarkerCluster:Yw}),e=kh.a.global(),rM=void 0!==e?e.fengmap:{};for(eM in null==rM&&(rM={}),iM)rM[eM]=iM[eM];void 0!==e&&(e.fengmap=rM);var oM,sM=rM,tv=(_.wt=!1,kh.a.global()),aM=void 0!==tv?tv.fengmap:{};for(oM in sM)aM[oM]=sM[oM];s.default=aM}]).default});