zhitong.yu
2024-04-18 a239a844f00b4a75c7f22db8a834fc8b5f92b54f
1
2
/**Released Version v3.0.9,BUILD 171,Time 1650280631512. Fengmap Javascript SDK , see: https://www.fengmap.com for details**/
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.fengmap=n():t.fengmap=n()}(this,function(){return d=[function(t,n,e){"use strict";var i,r,o=t.exports=e(2),s=e(16);o.codegen=e(39),o.fetch=e(40),o.path=e(41),o.fs=o.inquire("fs"),o.toArray=function(t){if(t){for(var n=Object.keys(t),e=new Array(n.length),i=0;i<n.length;)e[i]=t[n[i++]];return e}return[]},o.toObject=function(t){for(var n={},e=0;e<t.length;){var i=t[e++],r=t[e++];void 0!==r&&(n[i]=r)}return n};var a=/\\/g,u=/"/g;o.isReserved=function(t){return/^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(t)},o.safeProp=function(t){return!/^[$\w_]+$/.test(t)||o.isReserved(t)?'["'+t.replace(a,"\\\\").replace(u,'\\"')+'"]':"."+t},o.ucFirst=function(t){return t.charAt(0).toUpperCase()+t.substring(1)};var h=/_([a-z])/g;o.camelCase=function(t){return t.substring(0,1)+t.substring(1).replace(h,function(t,n){return n.toUpperCase()})},o.compareFieldsById=function(t,n){return t.id-n.id},o.decorateType=function(t,n){if(t.$type)return n&&t.$type.name!==n&&(o.decorateRoot.remove(t.$type),t.$type.name=n,o.decorateRoot.add(t.$type)),t.$type;n=new(i=i||e(18))(n||t.name);return o.decorateRoot.add(n),n.ctor=t,Object.defineProperty(t,"$type",{value:n,enumerable:!1}),Object.defineProperty(t.prototype,"$type",{value:n,enumerable:!1}),n};var c=0;o.decorateEnum=function(t){if(t.$type)return t.$type;var n=new(r=r||e(3))("Enum"+c++,t);return o.decorateRoot.add(n),Object.defineProperty(t,"$type",{value:n,enumerable:!1}),n},o.setProperty=function(t,n,e){if("object"!=typeof t)throw TypeError("dst must be an object");if(!n)throw TypeError("path must be specified");return function t(n,e,i){var r=e.shift();return 0<e.length?n[r]=t(n[r]||{},e,i):((e=n[r])&&(i=[].concat(e).concat(i)),n[r]=i),n}(t,n=n.split("."),e)},Object.defineProperty(o,"decorateRoot",{get:function(){return s.decorated||(s.decorated=new(e(26)))}})},function(t,n,e){"use strict";!function(s){function a(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var u=null;n.a=function(){function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t)}var n,e,i,r;function o(){return r.apply(this,arguments)}return n=t,e=null,i=[{key:"global",value:(r=function(){if("undefined"!=typeof self&&null!==self&&0!==Object.keys(self).length)return self;if("undefined"!=typeof window&&null!==window&&0!==Object.keys(window).length)return window;if(null!=s&&0!==Object.keys(s).length)return s;if("undefined"==typeof my)throw new Error("unable to locate global object");var t;return u||(t=my.getAppIdSync(),u={location:{host:t.appId+".hybrid.alipay-eco.com"}}),u},o.toString=function(){return r.toString()},o)}],e&&a(n.prototype,e),i&&a(n,i),t}()}.call(this,e(12))},function(t,e,o){"use strict";!function(t){var i=e;function r(t,n,e){for(var i=Object.keys(n),r=0;r<i.length;++r)void 0!==t[i[r]]&&e||(t[i[r]]=n[i[r]]);return t}function n(t){function e(t,n){if(!(this instanceof e))return new e(t,n);Object.defineProperty(this,"message",{get:function(){return t}}),Error.captureStackTrace?Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),n&&r(this,n)}return(e.prototype=Object.create(Error.prototype)).constructor=e,Object.defineProperty(e.prototype,"name",{get:function(){return t}}),e.prototype.toString=function(){return this.name+": "+this.message},e}i.asPromise=o(13),i.base64=o(30),i.EventEmitter=o(31),i.float=o(32),i.inquire=o(14),i.utf8=o(33),i.pool=o(34),i.LongBits=o(35),i.isNode=Boolean(void 0!==t&&t&&t.process&&t.process.versions&&t.process.versions.node),i.global=i.isNode&&t||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||this,i.emptyArray=Object.freeze?Object.freeze([]):[],i.emptyObject=Object.freeze?Object.freeze({}):{},i.isInteger=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t},i.isString=function(t){return"string"==typeof t||t instanceof String},i.isObject=function(t){return t&&"object"==typeof t},i.isset=i.isSet=function(t,n){var e=t[n];return!(null==e||!t.hasOwnProperty(n))&&("object"!=typeof e||0<(Array.isArray(e)?e:Object.keys(e)).length)},i.Buffer=function(){try{var t=i.inquire("buffer").Buffer;return t.prototype.utf8Write?t:null}catch(t){return null}}(),i.u=null,i.v=null,i.newBuffer=function(t){return"number"==typeof t?i.Buffer?i.v(t):new i.Array(t):i.Buffer?i.u(t):"undefined"==typeof Uint8Array?t:new Uint8Array(t)},i.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,i.Long=i.global.dcodeIO&&i.global.dcodeIO.Long||i.global.Long||i.inquire("long"),i.key2Re=/^true|false|0|1$/,i.key32Re=/^-?(?:0|[1-9][0-9]*)$/,i.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,i.longToHash=function(t){return t?i.LongBits.from(t).toHash():i.LongBits.zeroHash},i.longFromHash=function(t,n){t=i.LongBits.fromHash(t);return i.Long?i.Long.fromBits(t.lo,t.hi,n):t.toNumber(Boolean(n))},i.merge=r,i.lcFirst=function(t){return t.charAt(0).toLowerCase()+t.substring(1)},i.newError=n,i.ProtocolError=n("ProtocolError"),i.oneOfGetter=function(t){for(var e={},n=0;n<t.length;++n)e[t[n]]=1;return function(){for(var t=Object.keys(this),n=t.length-1;-1<n;--n)if(1===e[t[n]]&&void 0!==this[t[n]]&&null!==this[t[n]])return t[n]}},i.oneOfSetter=function(e){return function(t){for(var n=0;n<e.length;++n)e[n]!==t&&delete this[e[n]]}},i.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},i._=function(){var e=i.Buffer;e?(i.u=e.from!==Uint8Array.from&&e.from||function(t,n){return new e(t,n)},i.v=e.allocUnsafe||function(t){return new e(t)}):i.u=i.v=null}}.call(this,o(12))},function(t,n,e){"use strict";t.exports=o;var a=e(4);((o.prototype=Object.create(a.prototype)).constructor=o).className="Enum";var i=e(6),r=e(0);function o(t,n,e,i,r){if(a.call(this,t,e),n&&"object"!=typeof n)throw TypeError("values must be an object");if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=i,this.comments=r||{},this.reserved=void 0,n)for(var o=Object.keys(n),s=0;s<o.length;++s)"number"==typeof n[o[s]]&&(this.valuesById[this.values[o[s]]=n[o[s]]]=o[s])}o.fromJSON=function(t,n){t=new o(t,n.values,n.options,n.comment,n.comments);return t.reserved=n.reserved,t},o.prototype.toJSON=function(t){t=!!t&&Boolean(t.keepComments);return r.toObject(["options",this.options,"values",this.values,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"comment",t?this.comment:void 0,"comments",t?this.comments:void 0])},o.prototype.add=function(t,n,e){if(!r.isString(t))throw TypeError("name must be a string");if(!r.isInteger(n))throw TypeError("id must be an integer");if(void 0!==this.values[t])throw Error("duplicate name '"+t+"' in "+this);if(this.isReservedId(n))throw Error("id "+n+" is reserved in "+this);if(this.isReservedName(t))throw Error("name '"+t+"' is reserved in "+this);if(void 0!==this.valuesById[n]){if(!this.options||!this.options.allow_alias)throw Error("duplicate id "+n+" in "+this);this.values[t]=n}else this.valuesById[this.values[t]=n]=t;return this.comments[t]=e||null,this},o.prototype.remove=function(t){if(!r.isString(t))throw TypeError("name must be a string");var n=this.values[t];if(null==n)throw Error("name '"+t+"' does not exist in "+this);return delete this.valuesById[n],delete this.values[t],delete this.comments[t],this},o.prototype.isReservedId=function(t){return i.isReservedId(this.reserved,t)},o.prototype.isReservedName=function(t){return i.isReservedName(this.reserved,t)}},function(t,n,e){"use strict";(t.exports=r).className="ReflectionObject";var i,s=e(0);function r(t,n){if(!s.isString(t))throw TypeError("name must be a string");if(n&&!s.isObject(n))throw TypeError("options must be an object");this.options=n,this.parsedOptions=null,this.name=t,this.parent=null,this.resolved=!1,this.comment=null,this.filename=null}Object.defineProperties(r.prototype,{root:{get:function(){for(var t=this;null!==t.parent;)t=t.parent;return t}},fullName:{get:function(){for(var t=[this.name],n=this.parent;n;)t.unshift(n.name),n=n.parent;return t.join(".")}}}),r.prototype.toJSON=function(){throw Error()},r.prototype.onAdd=function(t){this.parent&&this.parent!==t&&this.parent.remove(this),this.parent=t,this.resolved=!1;t=t.root;t instanceof i&&t.M(this)},r.prototype.onRemove=function(t){t=t.root;t instanceof i&&t.S(this),this.parent=null,this.resolved=!1},r.prototype.resolve=function(){return this.resolved||this.root instanceof i&&(this.resolved=!0),this},r.prototype.getOption=function(t){if(this.options)return this.options[t]},r.prototype.setOption=function(t,n,e){return e&&this.options&&void 0!==this.options[t]||((this.options||(this.options={}))[t]=n),this},r.prototype.setParsedOption=function(n,t,e){this.parsedOptions||(this.parsedOptions=[]);var i,r,o=this.parsedOptions;return e?(r=o.find(function(t){return Object.prototype.hasOwnProperty.call(t,n)}))?(i=r[n],s.setProperty(i,e,t)):((r={})[n]=s.setProperty({},e,t),o.push(r)):((r={})[n]=t,o.push(r)),this},r.prototype.setOptions=function(t,n){if(t)for(var e=Object.keys(t),i=0;i<e.length;++i)this.setOption(e[i],t[e[i]],n);return this},r.prototype.toString=function(){var t=this.constructor.className,n=this.fullName;return n.length?t+" "+n:t},r._=function(t){i=t}},function(t,n,e){"use strict";t.exports=s;var a=e(4);((s.prototype=Object.create(a.prototype)).constructor=s).className="Field";var i,r=e(3),u=e(7),h=e(0),c=/^required|optional|repeated$/;function s(t,n,e,i,r,o,s){if(h.isObject(i)?(s=r,o=i,i=r=void 0):h.isObject(r)&&(s=o,o=r,r=void 0),a.call(this,t,o),!h.isInteger(n)||n<0)throw TypeError("id must be a non-negative integer");if(!h.isString(e))throw TypeError("type must be a string");if(void 0!==i&&!c.test(i=i.toString().toLowerCase()))throw TypeError("rule must be a string rule");if(void 0!==r&&!h.isString(r))throw TypeError("extend must be a string");this.rule=i&&"optional"!==i?i:void 0,this.type=e,this.id=n,this.extend=r||void 0,this.required="required"===i,this.optional=!this.required,this.repeated="repeated"===i,this.map=!1,this.message=null,this.partOf=null,this.typeDefault=null,this.defaultValue=null,this.long=!!h.Long&&void 0!==u.long[e],this.bytes="bytes"===e,this.resolvedType=null,this.extensionField=null,this.declaringField=null,this.T=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.T&&(this.T=!1!==this.getOption("packed")),this.T}}),s.prototype.setOption=function(t,n,e){return"packed"===t&&(this.T=null),a.prototype.setOption.call(this,t,n,e)},s.prototype.toJSON=function(t){t=!!t&&Boolean(t.keepComments);return h.toObject(["rule","optional"!==this.rule&&this.rule||void 0,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},s.prototype.resolve=function(){return this.resolved?this:(void 0===(this.typeDefault=u.defaults[this.type])&&(this.resolvedType=(this.declaringField||this).parent.lookupTypeOrEnum(this.type),this.resolvedType instanceof i?this.typeDefault=null:this.typeDefault=this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]),this.options&&null!=this.options.default&&(this.typeDefault=this.options.default,this.resolvedType instanceof r&&"string"==typeof this.typeDefault&&(this.typeDefault=this.resolvedType.values[this.typeDefault])),this.options&&(!0!==this.options.packed&&(void 0===this.options.packed||!this.resolvedType||this.resolvedType instanceof r)||delete this.options.packed,Object.keys(this.options).length||(this.options=void 0)),this.long?(this.typeDefault=h.Long.fromNumber(this.typeDefault,"u"===this.type.charAt(0)),Object.freeze&&Object.freeze(this.typeDefault)):this.bytes&&"string"==typeof this.typeDefault&&(h.base64.test(this.typeDefault)?h.base64.decode(this.typeDefault,t=h.newBuffer(h.base64.length(this.typeDefault)),0):h.utf8.write(this.typeDefault,t=h.newBuffer(h.utf8.length(this.typeDefault)),0),this.typeDefault=t),this.map?this.defaultValue=h.emptyObject:this.repeated?this.defaultValue=h.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof i&&(this.parent.ctor.prototype[this.name]=this.defaultValue),a.prototype.resolve.call(this));var t},s.d=function(e,i,r,o){return"function"==typeof i?i=h.decorateType(i).name:i&&"object"==typeof i&&(i=h.decorateEnum(i).name),function(t,n){h.decorateType(t.constructor).add(new s(n,e,i,r,{default:o}))}},s._=function(t){i=t}},function(t,n,e){"use strict";t.exports=c;var i=e(4);((c.prototype=Object.create(i.prototype)).constructor=c).className="Namespace";var r,o,s,a=e(5),u=e(0);function h(t,n){if(t&&t.length){for(var e={},i=0;i<t.length;++i)e[t[i].name]=t[i].toJSON(n);return e}}function c(t,n){i.call(this,t,n),this.nested=void 0,this.L=null}function f(t){return t.L=null,t}c.fromJSON=function(t,n){return new c(t,n.options).addJSON(n.nested)},c.arrayToJSON=h,c.isReservedId=function(t,n){if(t)for(var e=0;e<t.length;++e)if("string"!=typeof t[e]&&t[e][0]<=n&&t[e][1]>n)return!0;return!1},c.isReservedName=function(t,n){if(t)for(var e=0;e<t.length;++e)if(t[e]===n)return!0;return!1},Object.defineProperty(c.prototype,"nestedArray",{get:function(){return this.L||(this.L=u.toArray(this.nested))}}),c.prototype.toJSON=function(t){return u.toObject(["options",this.options,"nested",h(this.nestedArray,t)])},c.prototype.addJSON=function(t){if(t)for(var n,e=Object.keys(t),i=0;i<e.length;++i)n=t[e[i]],this.add((void 0!==n.fields?r:void 0!==n.values?s:void 0!==n.methods?o:void 0!==n.id?a:c).fromJSON(e[i],n));return this},c.prototype.get=function(t){return this.nested&&this.nested[t]||null},c.prototype.getEnum=function(t){if(this.nested&&this.nested[t]instanceof s)return this.nested[t].values;throw Error("no such enum: "+t)},c.prototype.add=function(t){if(!(t instanceof a&&void 0!==t.extend||t instanceof r||t instanceof s||t instanceof o||t instanceof c))throw TypeError("object must be a valid nested object");if(this.nested){var n=this.get(t.name);if(n){if(!(n instanceof c&&t instanceof c)||n instanceof r||n instanceof o)throw Error("duplicate name '"+t.name+"' in "+this);for(var e=n.nestedArray,i=0;i<e.length;++i)t.add(e[i]);this.remove(n),this.nested||(this.nested={}),t.setOptions(n.options,!0)}}else this.nested={};return(this.nested[t.name]=t).onAdd(this),f(this)},c.prototype.remove=function(t){if(!(t instanceof i))throw TypeError("object must be a ReflectionObject");if(t.parent!==this)throw Error(t+" is not a member of "+this);return delete this.nested[t.name],Object.keys(this.nested).length||(this.nested=void 0),t.onRemove(this),f(this)},c.prototype.define=function(t,n){if(u.isString(t))t=t.split(".");else if(!Array.isArray(t))throw TypeError("illegal path");if(t&&t.length&&""===t[0])throw Error("path must be relative");for(var e=this;0<t.length;){var i=t.shift();if(e.nested&&e.nested[i]){if(!((e=e.nested[i])instanceof c))throw Error("path conflicts with non-namespace objects")}else e.add(e=new c(i))}return n&&e.addJSON(n),e},c.prototype.resolveAll=function(){for(var t=this.nestedArray,n=0;n<t.length;)t[n]instanceof c?t[n++].resolveAll():t[n++].resolve();return this.resolve()},c.prototype.lookup=function(t,n,e){if("boolean"==typeof n?(e=n,n=void 0):n&&!Array.isArray(n)&&(n=[n]),u.isString(t)&&t.length){if("."===t)return this.root;t=t.split(".")}else if(!t.length)return this;if(""===t[0])return this.root.lookup(t.slice(1),n);var i=this.get(t[0]);if(i){if(1===t.length){if(!n||-1<n.indexOf(i.constructor))return i}else if(i instanceof c&&(i=i.lookup(t.slice(1),n,!0)))return i}else for(var r=0;r<this.nestedArray.length;++r)if(this.L[r]instanceof c&&(i=this.L[r].lookup(t,n,!0)))return i;return null===this.parent||e?null:this.parent.lookup(t,n)},c.prototype.lookupType=function(t){var n=this.lookup(t,[r]);if(!n)throw Error("no such type: "+t);return n},c.prototype.lookupEnum=function(t){var n=this.lookup(t,[s]);if(!n)throw Error("no such Enum '"+t+"' in "+this);return n},c.prototype.lookupTypeOrEnum=function(t){var n=this.lookup(t,[r,s]);if(!n)throw Error("no such Type or Enum '"+t+"' in "+this);return n},c.prototype.lookupService=function(t){var n=this.lookup(t,[o]);if(!n)throw Error("no such Service '"+t+"' in "+this);return n},c._=function(t,n,e){r=t,o=n,s=e}},function(t,n,e){"use strict";var n=n,e=e(0),r=["double","float","int32","uint32","sint32","fixed32","sfixed32","int64","uint64","sint64","fixed64","sfixed64","bool","string","bytes"];function i(t,n){var e=0,i={};for(n|=0;e<t.length;)i[r[e+n]]=t[e++];return i}n.basic=i([1,5,0,0,0,5,5,0,0,0,1,1,0,2,2]),n.defaults=i([0,0,0,0,0,0,0,0,0,0,0,0,!1,"",e.emptyArray,null]),n.long=i([0,0,0,1,1],7),n.mapKey=i([0,0,0,5,5,0,0,0,1,1,0,2],2),n.packed=i([1,5,0,0,0,5,5,0,0,0,1,1,0])},function(t,n,e){"use strict";t.exports=f;var i,r=e(2),o=r.LongBits,s=r.base64,a=r.utf8;function u(t,n,e){this.fn=t,this.len=n,this.next=void 0,this.val=e}function h(){}function c(t){this.head=t.head,this.tail=t.tail,this.len=t.len,this.next=t.states}function f(){this.len=0,this.head=new u(h,0,0),this.tail=this.head,this.states=null}function l(){return r.Buffer?function(){return(f.create=function(){return new i})()}:function(){return new f}}function d(t,n,e){n[e]=255&t}function v(t,n){this.len=t,this.next=void 0,this.val=n}function p(t,n,e){for(;t.hi;)n[e++]=127&t.lo|128,t.lo=(t.lo>>>7|t.hi<<25)>>>0,t.hi>>>=7;for(;127<t.lo;)n[e++]=127&t.lo|128,t.lo=t.lo>>>7;n[e++]=t.lo}function m(t,n,e){n[e]=255&t,n[e+1]=t>>>8&255,n[e+2]=t>>>16&255,n[e+3]=t>>>24}f.create=l(),f.alloc=function(t){return new r.Array(t)},r.Array!==Array&&(f.alloc=r.pool(f.alloc,r.Array.prototype.subarray)),f.prototype.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 g=r.Array.prototype.set?function(t,n,e){n.set(t,e)}:function(t,n,e){for(var i=0;i<t.length;++i)n[e+i]=t[i]};f.prototype.bytes=function(t){var n,e=t.length>>>0;return e?(r.isString(t)&&(n=f.alloc(e=s.length(t)),s.decode(t,n,0),t=n),this.uint32(e).R(g,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 c(this),this.head=this.tail=new u(h,0,0),this.len=0,this},f.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new u(h,0,0),this.len=0),this},f.prototype.ldelim=function(){var t=this.head,n=this.tail,e=this.len;return this.reset().uint32(e),e&&(this.tail.next=t.next,this.tail=n,this.len+=e),this},f.prototype.finish=function(){for(var t=this.head.next,n=this.constructor.alloc(this.len),e=0;t;)t.fn(t.val,n,e),e+=t.len,t=t.next;return n},f._=function(t){i=t,f.create=l(),i._()}},function(t,n,e){"use strict";t.exports=u;var i,r=e(2),o=r.LongBits,s=r.utf8;function a(t,n){return RangeError("index out of range: "+t.pos+" + "+(n||1)+" > "+t.len)}function u(t){this.buf=t,this.pos=0,this.len=t.length}function h(){return r.Buffer?function(t){return(u.create=function(t){return r.Buffer.isBuffer(t)?new i(t):f(t)})(t)}:f}var c,f="undefined"!=typeof Uint8Array?function(t){if(t instanceof Uint8Array||Array.isArray(t))return new u(t);throw Error("illegal buffer")}:function(t){if(Array.isArray(t))return new u(t);throw Error("illegal buffer")};function l(){var t=new o(0,0),n=0;if(!(4<this.len-this.pos)){for(;n<3;++n){if(this.pos>=this.len)throw a(this);if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*n)>>>0,this.buf[this.pos++]<128)return t}return t.lo=(t.lo|(127&this.buf[this.pos++])<<7*n)>>>0,t}for(;n<4;++n)if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*n)>>>0,this.buf[this.pos++]<128)return t;if(t.lo=(t.lo|(127&this.buf[this.pos])<<28)>>>0,t.hi=(t.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return t;if(n=0,4<this.len-this.pos){for(;n<5;++n)if(t.hi=(t.hi|(127&this.buf[this.pos])<<7*n+3)>>>0,this.buf[this.pos++]<128)return t}else for(;n<5;++n){if(this.pos>=this.len)throw a(this);if(t.hi=(t.hi|(127&this.buf[this.pos])<<7*n+3)>>>0,this.buf[this.pos++]<128)return t}throw Error("invalid varint encoding")}function d(t,n){return(t[n-4]|t[n-3]<<8|t[n-2]<<16|t[n-1]<<24)>>>0}function v(){if(this.pos+8>this.len)throw a(this,8);return new o(d(this.buf,this.pos+=4),d(this.buf,this.pos+=4))}u.create=h(),u.prototype.O=r.Array.prototype.subarray||r.Array.prototype.slice,u.prototype.uint32=(c=4294967295,function(){if(c=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return c;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return c}),u.prototype.int32=function(){return 0|this.uint32()},u.prototype.sint32=function(){var t=this.uint32();return t>>>1^-(1&t)|0},u.prototype.bool=function(){return 0!==this.uint32()},u.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return d(this.buf,this.pos+=4)},u.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return 0|d(this.buf,this.pos+=4)},u.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var t=r.float.readFloatLE(this.buf,this.pos);return this.pos+=4,t},u.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var t=r.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,t},u.prototype.bytes=function(){var t=this.uint32(),n=this.pos,e=this.pos+t;if(e>this.len)throw a(this,t);return this.pos+=t,Array.isArray(this.buf)?this.buf.slice(n,e):n===e?new this.buf.constructor(0):this.O.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._=function(t){i=t,u.create=h(),i._();var n=r.Long?"toLong":"toNumber";r.merge(u.prototype,{int64:function(){return l.call(this)[n](!1)},uint64:function(){return l.call(this)[n](!0)},sint64:function(){return l.call(this).zzDecode()[n](!1)},fixed64:function(){return v.call(this)[n](!0)},sfixed64:function(){return v.call(this)[n](!1)}})}},function(t,n,e){"use strict";t.exports=s;var r=e(4);((s.prototype=Object.create(r.prototype)).constructor=s).className="OneOf";var i=e(5),o=e(0);function s(t,n,e,i){if(Array.isArray(n)||(e=n,n=void 0),r.call(this,t,e),void 0!==n&&!Array.isArray(n))throw TypeError("fieldNames must be an Array");this.oneof=n||[],this.fieldsArray=[],this.comment=i}function a(t){if(t.parent)for(var n=0;n<t.fieldsArray.length;++n)t.fieldsArray[n].parent||t.parent.add(t.fieldsArray[n])}s.fromJSON=function(t,n){return new s(t,n.oneof,n.options,n.comment)},s.prototype.toJSON=function(t){t=!!t&&Boolean(t.keepComments);return o.toObject(["options",this.options,"oneof",this.oneof,"comment",t?this.comment:void 0])},s.prototype.add=function(t){if(!(t instanceof i))throw TypeError("field must be a Field");return t.parent&&t.parent!==this.parent&&t.parent.remove(t),this.oneof.push(t.name),this.fieldsArray.push(t),a(t.partOf=this),this},s.prototype.remove=function(t){if(!(t instanceof i))throw TypeError("field must be a Field");var n=this.fieldsArray.indexOf(t);if(n<0)throw Error(t+" is not a member of "+this);return this.fieldsArray.splice(n,1),-1<(n=this.oneof.indexOf(t.name))&&this.oneof.splice(n,1),t.partOf=null,this},s.prototype.onAdd=function(t){r.prototype.onAdd.call(this,t);for(var n=0;n<this.oneof.length;++n){var e=t.get(this.oneof[n]);e&&!e.partOf&&(e.partOf=this).fieldsArray.push(e)}a(this)},s.prototype.onRemove=function(t){for(var n,e=0;e<this.fieldsArray.length;++e)(n=this.fieldsArray[e]).parent&&n.parent.remove(n);r.prototype.onRemove.call(this,t)},s.d=function(){for(var e=new Array(arguments.length),t=0;t<arguments.length;)e[t]=arguments[t++];return function(t,n){o.decorateType(t.constructor).add(new s(n,e)),Object.defineProperty(t,n,{get:o.oneOfGetter(e),set:o.oneOfSetter(e)})}}},function(t,n,e){"use strict";t.exports=r;var i=e(2);function r(t){if(t)for(var n=Object.keys(t),e=0;e<n.length;++e)this[n[e]]=t[n[e]]}r.create=function(t){return this.$type.create(t)},r.encode=function(t,n){return this.$type.encode(t,n)},r.encodeDelimited=function(t,n){return this.$type.encodeDelimited(t,n)},r.decode=function(t){return this.$type.decode(t)},r.decodeDelimited=function(t){return this.$type.decodeDelimited(t)},r.verify=function(t){return this.$type.verify(t)},r.fromObject=function(t){return this.$type.fromObject(t)},r.toObject=function(t,n){return this.$type.toObject(t,n)},r.prototype.toJSON=function(){return this.$type.toObject(this,i.toJSONOptions)}},function(t,n){var e=function(){return this}();try{e=e||new Function("return this")()}catch(t){"object"==typeof window&&(e=window)}t.exports=e},function(t,n,e){"use strict";t.exports=function(t,n){var e=new Array(arguments.length-1),o=0,i=2,s=!0;for(;i<arguments.length;)e[o++]=arguments[i++];return new Promise(function(i,r){e[o]=function(t){if(s)if(s=!1,t)r(t);else{for(var n=new Array(arguments.length-1),e=0;e<n.length;)n[e++]=arguments[e];i.apply(null,n)}};try{t.apply(n||null,e)}catch(t){s&&(s=!1,r(t))}})}},function(module,exports,__webpack_require__){"use strict";function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}module.exports=inquire},function(t,n,e){"use strict";n.Service=e(38)},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.A.indexOf(o),a=o.resolvedType instanceof h?"int32":o.type,u=c.basic[a];n="m"+f.safeProp(o.name),o.map?(e("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){",n,o.name)("for(var ks=Object.keys(%s),i=0;i<ks.length;++i){",n)("w.uint32(%i).fork().uint32(%i).%s(ks[i])",(o.id<<3|2)>>>0,8|c.mapKey[o.keyType],o.keyType),void 0===u?e("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",s,n):e(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|u,a,n),e("}")("}")):o.repeated?(e("if(%s!=null&&%s.length){",n,n),o.packed&&void 0!==c.packed[a]?e("w.uint32(%i).fork()",(o.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",n)("w.%s(%s[i])",a,n)("w.ldelim()"):(e("for(var i=0;i<%s.length;++i)",n),void 0===u?l(e,o,s,n+"[i]"):e("w.uint32(%i).%s(%s[i])",(o.id<<3|u)>>>0,a,n)),e("}")):(o.optional&&e("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",n,o.name),void 0===u?l(e,o,s,n):e("w.uint32(%i).%s(%s)",(o.id<<3|u)>>>0,a,n))}return e("return w")};var h=e(3),c=e(7),f=e(0);function l(t,n,e,i){return n.resolvedType.group?t("types[%i].encode(%s,w.uint32(%i)).uint32(%i)",e,i,(n.id<<3|3)>>>0,(n.id<<3|4)>>>0):t("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",e,i,(n.id<<3|2)>>>0)}},function(t,n,e){"use strict";t.exports=b;var s=e(6);((b.prototype=Object.create(s.prototype)).constructor=b).className="Type";var a=e(3),u=e(10),h=e(5),c=e(19),f=e(20),r=e(11),o=e(9),l=e(8),d=e(0),v=e(17),p=e(22),m=e(23),g=e(24),y=e(25);function b(t,n){s.call(this,t,n),this.fields={},this.oneofs=void 0,this.extensions=void 0,this.reserved=void 0,this.group=void 0,this.C=null,this.A=null,this.k=null,this.P=null}function i(t){return t.C=t.A=t.k=null,delete t.encode,delete t.decode,delete t.verify,t}Object.defineProperties(b.prototype,{fieldsById:{get:function(){if(this.C)return this.C;this.C={};for(var t=Object.keys(this.fields),n=0;n<t.length;++n){var e=this.fields[t[n]],i=e.id;if(this.C[i])throw Error("duplicate id "+i+" in "+this);this.C[i]=e}return this.C}},fieldsArray:{get:function(){return this.A||(this.A=d.toArray(this.fields))}},oneofsArray:{get:function(){return this.k||(this.k=d.toArray(this.oneofs))}},ctor:{get:function(){return this.P||(this.ctor=b.generateConstructor(this)())},set:function(t){var n=t.prototype;n instanceof r||((t.prototype=new r).constructor=t,d.merge(t.prototype,n)),t.$type=t.prototype.$type=this,d.merge(t,r,!0),this.P=t;for(var e=0;e<this.fieldsArray.length;++e)this.A[e].resolve();for(var i={},e=0;e<this.oneofsArray.length;++e)i[this.k[e].resolve().name]={get:d.oneOfGetter(this.k[e].oneof),set:d.oneOfSetter(this.k[e].oneof)};e&&Object.defineProperties(t.prototype,i)}}}),b.generateConstructor=function(t){for(var n,e=d.codegen(["p"],t.name),i=0;i<t.fieldsArray.length;++i)(n=t.A[i]).map?e("this%s={}",d.safeProp(n.name)):n.repeated&&e("this%s=[]",d.safeProp(n.name));return e("if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null)")("this[ks[i]]=p[ks[i]]")},b.fromJSON=function(t,n){var e=new b(t,n.options);e.extensions=n.extensions,e.reserved=n.reserved;for(var i=Object.keys(n.fields),r=0;r<i.length;++r)e.add((void 0!==n.fields[i[r]].keyType?c:h).fromJSON(i[r],n.fields[i[r]]));if(n.oneofs)for(i=Object.keys(n.oneofs),r=0;r<i.length;++r)e.add(u.fromJSON(i[r],n.oneofs[i[r]]));if(n.nested)for(i=Object.keys(n.nested),r=0;r<i.length;++r){var o=n.nested[i[r]];e.add((void 0!==o.id?h:void 0!==o.fields?b:void 0!==o.values?a:void 0!==o.methods?f:s).fromJSON(i[r],o))}return n.extensions&&n.extensions.length&&(e.extensions=n.extensions),n.reserved&&n.reserved.length&&(e.reserved=n.reserved),n.group&&(e.group=!0),n.comment&&(e.comment=n.comment),e},b.prototype.toJSON=function(t){var n=s.prototype.toJSON.call(this,t),e=!!t&&Boolean(t.keepComments);return d.toObject(["options",n&&n.options||void 0,"oneofs",s.arrayToJSON(this.oneofsArray,t),"fields",s.arrayToJSON(this.fieldsArray.filter(function(t){return!t.declaringField}),t)||{},"extensions",this.extensions&&this.extensions.length?this.extensions:void 0,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"group",this.group||void 0,"nested",n&&n.nested||void 0,"comment",e?this.comment:void 0])},b.prototype.resolveAll=function(){for(var t=this.fieldsArray,n=0;n<t.length;)t[n++].resolve();for(var e=this.oneofsArray,n=0;n<e.length;)e[n++].resolve();return s.prototype.resolveAll.call(this)},b.prototype.get=function(t){return this.fields[t]||this.oneofs&&this.oneofs[t]||this.nested&&this.nested[t]||null},b.prototype.add=function(t){if(this.get(t.name))throw Error("duplicate name '"+t.name+"' in "+this);if(t instanceof h&&void 0===t.extend){if((this.C||this.fieldsById)[t.id])throw Error("duplicate id "+t.id+" in "+this);if(this.isReservedId(t.id))throw Error("id "+t.id+" is reserved in "+this);if(this.isReservedName(t.name))throw Error("name '"+t.name+"' is reserved in "+this);return t.parent&&t.parent.remove(t),(this.fields[t.name]=t).message=this,t.onAdd(this),i(this)}return t instanceof u?(this.oneofs||(this.oneofs={}),(this.oneofs[t.name]=t).onAdd(this),i(this)):s.prototype.add.call(this,t)},b.prototype.remove=function(t){if(t instanceof h&&void 0===t.extend){if(!this.fields||this.fields[t.name]!==t)throw Error(t+" is not a member of "+this);return delete this.fields[t.name],t.parent=null,t.onRemove(this),i(this)}if(t instanceof u){if(!this.oneofs||this.oneofs[t.name]!==t)throw Error(t+" is not a member of "+this);return delete this.oneofs[t.name],t.parent=null,t.onRemove(this),i(this)}return s.prototype.remove.call(this,t)},b.prototype.isReservedId=function(t){return s.isReservedId(this.reserved,t)},b.prototype.isReservedName=function(t){return s.isReservedName(this.reserved,t)},b.prototype.create=function(t){return new this.ctor(t)},b.prototype.setup=function(){for(var t=this.fullName,n=[],e=0;e<this.fieldsArray.length;++e)n.push(this.A[e].resolve().resolvedType);this.encode=v(this)({Writer:l,types:n,util:d}),this.decode=p(this)({Reader:o,types:n,util:d}),this.verify=m(this)({types:n,util:d}),this.fromObject=g.fromObject(this)({types:n,util:d}),this.toObject=g.toObject(this)({types:n,util:d});var i=y[t];return i&&((t=Object.create(this)).fromObject=this.fromObject,this.fromObject=i.fromObject.bind(t),t.toObject=this.toObject,this.toObject=i.toObject.bind(t)),this},b.prototype.encode=function(t,n){return this.setup().encode(t,n)},b.prototype.encodeDelimited=function(t,n){return this.encode(t,n&&n.len?n.fork():n).ldelim()},b.prototype.decode=function(t,n){return this.setup().decode(t,n)},b.prototype.decodeDelimited=function(t){return t instanceof o||(t=o.create(t)),this.decode(t,t.uint32())},b.prototype.verify=function(t){return this.setup().verify(t)},b.prototype.fromObject=function(t){return this.setup().fromObject(t)},b.prototype.toObject=function(t,n){return this.setup().toObject(t,n)},b.d=function(n){return function(t){d.decorateType(t,n)}}},function(t,n,e){"use strict";t.exports=o;var s=e(5);((o.prototype=Object.create(s.prototype)).constructor=o).className="MapField";var i=e(7),a=e(0);function o(t,n,e,i,r,o){if(s.call(this,t,n,i,void 0,void 0,r,o),!a.isString(e))throw TypeError("keyType must be a string");this.keyType=e,this.resolvedKeyType=null,this.map=!0}o.fromJSON=function(t,n){return new o(t,n.id,n.keyType,n.type,n.options,n.comment)},o.prototype.toJSON=function(t){t=!!t&&Boolean(t.keepComments);return a.toObject(["keyType",this.keyType,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},o.prototype.resolve=function(){if(this.resolved)return this;if(void 0===i.mapKey[this.keyType])throw Error("invalid key type: "+this.keyType);return s.prototype.resolve.call(this)},o.d=function(e,i,r){return"function"==typeof r?r=a.decorateType(r).name:r&&"object"==typeof r&&(r=a.decorateEnum(r).name),function(t,n){a.decorateType(t.constructor).add(new o(n,e,i,r))}}},function(t,n,e){"use strict";t.exports=s;var i=e(6);((s.prototype=Object.create(i.prototype)).constructor=s).className="Service";var o=e(21),a=e(0),u=e(15);function s(t,n){i.call(this,t,n),this.methods={},this.D=null}function r(t){return t.D=null,t}s.fromJSON=function(t,n){var e=new s(t,n.options);if(n.methods)for(var i=Object.keys(n.methods),r=0;r<i.length;++r)e.add(o.fromJSON(i[r],n.methods[i[r]]));return n.nested&&e.addJSON(n.nested),e.comment=n.comment,e},s.prototype.toJSON=function(t){var n=i.prototype.toJSON.call(this,t),e=!!t&&Boolean(t.keepComments);return a.toObject(["options",n&&n.options||void 0,"methods",i.arrayToJSON(this.methodsArray,t)||{},"nested",n&&n.nested||void 0,"comment",e?this.comment:void 0])},Object.defineProperty(s.prototype,"methodsArray",{get:function(){return this.D||(this.D=a.toArray(this.methods))}}),s.prototype.get=function(t){return this.methods[t]||i.prototype.get.call(this,t)},s.prototype.resolveAll=function(){for(var t=this.methodsArray,n=0;n<t.length;++n)t[n].resolve();return i.prototype.resolve.call(this)},s.prototype.add=function(t){if(this.get(t.name))throw Error("duplicate name '"+t.name+"' in "+this);return t instanceof o?r((this.methods[t.name]=t).parent=this):i.prototype.add.call(this,t)},s.prototype.remove=function(t){if(t instanceof o){if(this.methods[t.name]!==t)throw Error(t+" is not a member of "+this);return delete this.methods[t.name],t.parent=null,r(this)}return i.prototype.remove.call(this,t)},s.prototype.create=function(t,n,e){for(var i,r=new u.Service(t,n,e),o=0;o<this.methodsArray.length;++o){var s=a.lcFirst((i=this.D[o]).resolve().name).replace(/[^$\w_]/g,"");r[s]=a.codegen(["r","c"],a.isReserved(s)?s+"_":s)("return this.rpcCall(m,q,s,r,c)")({m:i,q:i.resolvedRequestType.ctor,s:i.resolvedResponseType.ctor})}return r}},function(t,n,e){"use strict";t.exports=i;var h=e(4);((i.prototype=Object.create(h.prototype)).constructor=i).className="Method";var c=e(0);function i(t,n,e,i,r,o,s,a,u){if(c.isObject(r)?(s=r,r=o=void 0):c.isObject(o)&&(s=o,o=void 0),void 0!==n&&!c.isString(n))throw TypeError("type must be a string");if(!c.isString(e))throw TypeError("requestType must be a string");if(!c.isString(i))throw TypeError("responseType must be a string");h.call(this,t,s),this.type=n||"rpc",this.requestType=e,this.requestStream=!!r||void 0,this.responseType=i,this.responseStream=!!o||void 0,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=a,this.parsedOptions=u}i.fromJSON=function(t,n){return new i(t,n.type,n.requestType,n.responseType,n.requestStream,n.responseStream,n.options,n.comment,n.parsedOptions)},i.prototype.toJSON=function(t){t=!!t&&Boolean(t.keepComments);return c.toObject(["type","rpc"!==this.type&&this.type||void 0,"requestType",this.requestType,"requestStream",this.requestStream,"responseType",this.responseType,"responseStream",this.responseStream,"options",this.options,"comment",t?this.comment:void 0,"parsedOptions",this.parsedOptions])},i.prototype.resolve=function(){return this.resolved?this:(this.resolvedRequestType=this.parent.lookupType(this.requestType),this.resolvedResponseType=this.parent.lookupType(this.responseType),h.prototype.resolve.call(this))}},function(t,n,e){"use strict";t.exports=function(t){var n=h.codegen(["r","l"],t.name+"$decode")("if(!(r instanceof Reader))")("r=Reader.create(r)")("var c=l===undefined?r.len:r.pos+l,m=new this.ctor"+(t.fieldsArray.filter(function(t){return t.map}).length?",k,value":""))("while(r.pos<c){")("var t=r.uint32()");t.group&&n("if((t&7)===4)")("break");n("switch(t>>>3){");for(var e=0;e<t.fieldsArray.length;++e){var i=t.A[e].resolve(),r=i.resolvedType instanceof a?"int32":i.type,o="m"+h.safeProp(i.name);n("case %i:",i.id),i.map?(n("if(%s===util.emptyObject)",o)("%s={}",o)("var c2 = r.uint32()+r.pos"),void 0!==u.defaults[i.keyType]?n("k=%j",u.defaults[i.keyType]):n("k=null"),void 0!==u.defaults[r]?n("value=%j",u.defaults[r]):n("value=null"),n("while(r.pos<c2){")("var tag2=r.uint32()")("switch(tag2>>>3){")("case 1: k=r.%s(); break",i.keyType)("case 2:"),void 0===u.basic[r]?n("value=types[%i].decode(r,r.uint32())",e):n("value=r.%s()",r),n("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"),void 0!==u.long[i.keyType]?n('%s[typeof k==="object"?util.longToHash(k):k]=value',o):n("%s[k]=value",o)):i.repeated?(n("if(!(%s&&%s.length))",o,o)("%s=[]",o),void 0!==u.packed[r]&&n("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos<c2)")("%s.push(r.%s())",o,r)("}else"),void 0===u.basic[r]?n(i.resolvedType.group?"%s.push(types[%i].decode(r))":"%s.push(types[%i].decode(r,r.uint32()))",o,e):n("%s.push(r.%s())",o,r)):void 0===u.basic[r]?n(i.resolvedType.group?"%s=types[%i].decode(r)":"%s=types[%i].decode(r,r.uint32())",o,e):n("%s=r.%s()",o,r),n("break")}for(n("default:")("r.skipType(t&7)")("break")("}")("}"),e=0;e<t.A.length;++e){var s=t.A[e];s.required&&n("if(!m.hasOwnProperty(%j))",s.name)("throw util.ProtocolError(%j,{instance:m})","missing required '"+s.name+"'")}return n("return m")};var a=e(3),u=e(7),h=e(0)},function(t,n,e){"use strict";t.exports=function(t){var n=u.codegen(["m"],t.name+"$verify")('if(typeof m!=="object"||m===null)')("return%j","object expected"),e=t.oneofsArray,i={};e.length&&n("var p={}");for(var r=0;r<t.fieldsArray.length;++r){var o,s=t.A[r].resolve(),a="m"+u.safeProp(s.name);s.optional&&n("if(%s!=null&&m.hasOwnProperty(%j)){",a,s.name),s.map?(n("if(!util.isObject(%s))",a)("return%j",h(s,"object"))("var k=Object.keys(%s)",a)("for(var i=0;i<k.length;++i){"),function(t,n,e){switch(n.keyType){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":t("if(!util.key32Re.test(%s))",e)("return%j",h(n,"integer key"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":t("if(!util.key64Re.test(%s))",e)("return%j",h(n,"integer|Long key"));break;case"bool":t("if(!util.key2Re.test(%s))",e)("return%j",h(n,"boolean key"))}}(n,s,"k[i]"),c(n,s,r,a+"[k[i]]")("}")):s.repeated?(n("if(!Array.isArray(%s))",a)("return%j",h(s,"array"))("for(var i=0;i<%s.length;++i){",a),c(n,s,r,a+"[i]")("}")):(s.partOf&&(o=u.safeProp(s.partOf.name),1===i[s.partOf.name]&&n("if(p%s===1)",o)("return%j",s.partOf.name+": multiple values"),i[s.partOf.name]=1,n("p%s=1",o)),c(n,s,r,a)),s.optional&&n("}")}return n("return null")};var s=e(3),u=e(0);function h(t,n){return t.name+": "+n+(t.repeated&&"array"!==n?"[]":t.map&&"object"!==n?"{k:"+t.keyType+"}":"")+" expected"}function c(t,n,e,i){if(n.resolvedType)if(n.resolvedType instanceof s){t("switch(%s){",i)("default:")("return%j",h(n,"enum value"));for(var r=Object.keys(n.resolvedType.values),o=0;o<r.length;++o)t("case %i:",n.resolvedType.values[r[o]]);t("break")("}")}else t("{")("var e=types[%i].verify(%s);",e,i)("if(e)")("return%j+e",n.name+".")("}");else switch(n.type){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":t("if(!util.isInteger(%s))",i)("return%j",h(n,"integer"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":t("if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))",i,i,i,i)("return%j",h(n,"integer|Long"));break;case"float":case"double":t('if(typeof %s!=="number")',i)("return%j",h(n,"number"));break;case"bool":t('if(typeof %s!=="boolean")',i)("return%j",h(n,"boolean"));break;case"string":t("if(!util.isString(%s))",i)("return%j",h(n,"string"));break;case"bytes":t('if(!(%s&&typeof %s.length==="number"||util.isString(%s)))',i,i,i)("return%j",h(n,"buffer"))}return t}},function(t,n,e){"use strict";var n=n,l=e(3),d=e(0);function s(t,n,e,i){if(n.resolvedType)if(n.resolvedType instanceof l){t("switch(d%s){",i);for(var r=n.resolvedType.values,o=Object.keys(r),s=0;s<o.length;++s)n.repeated&&r[o[s]]===n.typeDefault&&t("default:"),t("case%j:",o[s])("case %i:",r[o[s]])("m%s=%j",i,r[o[s]])("break");t("}")}else t('if(typeof d%s!=="object")',i)("throw TypeError(%j)",n.fullName+": object expected")("m%s=types[%i].fromObject(d%s)",i,e,i);else{var a=!1;switch(n.type){case"double":case"float":t("m%s=Number(d%s)",i,i);break;case"uint32":case"fixed32":t("m%s=d%s>>>0",i,i);break;case"int32":case"sint32":case"sfixed32":t("m%s=d%s|0",i,i);break;case"uint64":a=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":t("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j",i,i,a)('else if(typeof d%s==="string")',i)("m%s=parseInt(d%s,10)",i,i)('else if(typeof d%s==="number")',i)("m%s=d%s",i,i)('else if(typeof d%s==="object")',i)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",i,i,i,a?"true":"");break;case"bytes":t('if(typeof d%s==="string")',i)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",i,i,i)("else if(d%s.length)",i)("m%s=d%s",i,i);break;case"string":t("m%s=String(d%s)",i,i);break;case"bool":t("m%s=Boolean(d%s)",i,i)}}return t}function v(t,n,e,i){if(n.resolvedType)n.resolvedType instanceof l?t("d%s=o.enums===String?types[%i].values[m%s]:m%s",i,e,i,i):t("d%s=types[%i].toObject(m%s,o)",i,e,i);else{var r=!1;switch(n.type){case"double":case"float":t("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",i,i,i,i);break;case"uint64":r=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":t('if(typeof m%s==="number")',i)("d%s=o.longs===String?String(m%s):m%s",i,i,i)("else")("d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s",i,i,i,i,r?"true":"",i);break;case"bytes":t("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s",i,i,i,i,i);break;default:t("d%s=m%s",i,i)}}return t}n.fromObject=function(t){var n=t.fieldsArray,e=d.codegen(["d"],t.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!n.length)return e("return new this.ctor");e("var m=new this.ctor");for(var i=0;i<n.length;++i){var r=n[i].resolve(),o=d.safeProp(r.name);r.map?(e("if(d%s){",o)('if(typeof d%s!=="object")',o)("throw TypeError(%j)",r.fullName+": object expected")("m%s={}",o)("for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){",o),s(e,r,i,o+"[ks[i]]")("}")("}")):r.repeated?(e("if(d%s){",o)("if(!Array.isArray(d%s))",o)("throw TypeError(%j)",r.fullName+": array expected")("m%s=[]",o)("for(var i=0;i<d%s.length;++i){",o),s(e,r,i,o+"[i]")("}")("}")):(r.resolvedType instanceof l||e("if(d%s!=null){",o),s(e,r,i,o),r.resolvedType instanceof l||e("}"))}return e("return m")},n.toObject=function(t){var n=t.fieldsArray.slice().sort(d.compareFieldsById);if(!n.length)return d.codegen()("return {}");for(var e=d.codegen(["m","o"],t.name+"$toObject")("if(!o)")("o={}")("var d={}"),i=[],r=[],o=[],s=0;s<n.length;++s)n[s].partOf||(n[s].resolve().repeated?i:n[s].map?r:o).push(n[s]);if(i.length){for(e("if(o.arrays||o.defaults){"),s=0;s<i.length;++s)e("d%s=[]",d.safeProp(i[s].name));e("}")}if(r.length){for(e("if(o.objects||o.defaults){"),s=0;s<r.length;++s)e("d%s={}",d.safeProp(r[s].name));e("}")}if(o.length){for(e("if(o.defaults){"),s=0;s<o.length;++s){var a,u=o[s],h=d.safeProp(u.name);u.resolvedType instanceof l?e("d%s=o.enums===String?%j:%j",h,u.resolvedType.valuesById[u.typeDefault],u.typeDefault):u.long?e("if(util.Long){")("var n=new util.Long(%i,%i,%j)",u.typeDefault.low,u.typeDefault.high,u.typeDefault.unsigned)("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n",h)("}else")("d%s=o.longs===String?%j:%i",h,u.typeDefault.toString(),u.typeDefault.toNumber()):u.bytes?(a="["+Array.prototype.slice.call(u.typeDefault).join(",")+"]",e("if(o.bytes===String)d%s=%j",h,String.fromCharCode.apply(String,u.typeDefault))("else{")("d%s=%s",h,a)("if(o.bytes!==Array)d%s=util.newBuffer(d%s)",h,h)("}")):e("d%s=%j",h,u.typeDefault)}e("}")}for(var c=!1,s=0;s<n.length;++s){var u=n[s],f=t.A.indexOf(u),h=d.safeProp(u.name);u.map?(c||(c=!0,e("var ks2")),e("if(m%s&&(ks2=Object.keys(m%s)).length){",h,h)("d%s={}",h)("for(var j=0;j<ks2.length;++j){"),v(e,u,f,h+"[ks2[j]]")("}")):u.repeated?(e("if(m%s&&m%s.length){",h,h)("d%s=[]",h)("for(var j=0;j<m%s.length;++j){",h),v(e,u,f,h+"[j]")("}")):(e("if(m%s!=null&&m.hasOwnProperty(%j)){",h,u.name),v(e,u,f,h),u.partOf&&e("if(o.oneofs)")("d%s=%j",d.safeProp(u.partOf.name),u.name)),e("}")}return e("return d")}},function(t,n,e){"use strict";var n=n,o=e(11);n[".google.protobuf.Any"]={fromObject:function(t){if(t&&t["@type"]){var n=t["@type"].substring(t["@type"].lastIndexOf("/")+1),e=this.lookup(n);if(e){n="."===t["@type"].charAt(0)?t["@type"].substr(1):t["@type"];return-1===n.indexOf("/")&&(n="/"+n),this.create({type_url:n,value:e.encode(e.fromObject(t)).finish()})}}return this.fromObject(t)},toObject:function(t,n){var e,i="",r="";if(n&&n.json&&t.type_url&&t.value&&(r=t.type_url.substring(t.type_url.lastIndexOf("/")+1),i=t.type_url.substring(0,t.type_url.lastIndexOf("/")+1),(e=this.lookup(r))&&(t=e.decode(t.value))),t instanceof this.ctor||!(t instanceof o))return this.toObject(t,n);n=t.$type.toObject(t,n),t="."===t.$type.fullName[0]?t.$type.fullName.substr(1):t.$type.fullName;return n["@type"]=r=(i=""===i?"type.googleapis.com/":i)+t,n}}},function(t,n,e){"use strict";t.exports=u;var i=e(6);((u.prototype=Object.create(i.prototype)).constructor=u).className="Root";var r,d,v,o=e(5),s=e(3),a=e(10),p=e(0);function u(t){i.call(this,"",t),this.deferred=[],this.files=[]}function m(){}u.fromJSON=function(t,n){return n=n||new u,t.options&&n.setOptions(t.options),n.addJSON(t.nested)},u.prototype.resolvePath=p.path.resolve,u.prototype.fetch=p.fetch,u.prototype.load=function t(n,o,r){"function"==typeof o&&(r=o,o=void 0);var s=this;if(!r)return p.asPromise(t,s,n,o);var a=r===m;function u(t,n){if(r){var e=r;if(r=null,a)throw t;e(t,n)}}function h(t){var n=t.lastIndexOf("google/protobuf/");if(-1<n){n=t.substring(n);if(n in v)return n}return null}function c(t,n){try{if(p.isString(n)&&"{"===n.charAt(0)&&(n=JSON.parse(n)),p.isString(n)){d.filename=t;var e,i=d(n,s,o),r=0;if(i.imports)for(;r<i.imports.length;++r)(e=h(i.imports[r])||s.resolvePath(t,i.imports[r]))&&f(e);if(i.weakImports)for(r=0;r<i.weakImports.length;++r)(e=h(i.weakImports[r])||s.resolvePath(t,i.weakImports[r]))&&f(e,!0)}else s.setOptions(n.options).addJSON(n.nested)}catch(t){u(t)}a||l||u(null,s)}function f(e,i){if(!(-1<s.files.indexOf(e)))if(s.files.push(e),e in v)a?c(e,v[e]):(++l,setTimeout(function(){--l,c(e,v[e])}));else if(a){var t;try{t=p.fs.readFileSync(e).toString("utf8")}catch(t){return void(i||u(t))}c(e,t)}else++l,s.fetch(e,function(t,n){--l,r&&(t?i?l||u(null,s):u(t):c(e,n))})}var l=0;p.isString(n)&&(n=[n]);for(var e,i=0;i<n.length;++i)(e=s.resolvePath("",n[i]))&&f(e);if(a)return s;l||u(null,s)},u.prototype.loadSync=function(t,n){if(!p.isNode)throw Error("not supported");return this.load(t,n,m)},u.prototype.resolveAll=function(){if(this.deferred.length)throw Error("unresolvable extensions: "+this.deferred.map(function(t){return"'extend "+t.extend+"' in "+t.parent.fullName}).join(", "));return i.prototype.resolveAll.call(this)};var h=/^[A-Z]/;function c(t,n){var e=n.parent.lookup(n.extend);if(e){var i=new o(n.fullName,n.id,n.type,n.rule,void 0,n.options);return(i.declaringField=n).extensionField=i,e.add(i),1}}u.prototype.M=function(t){if(t instanceof o)void 0===t.extend||t.extensionField||c(0,t)||this.deferred.push(t);else if(t instanceof s)h.test(t.name)&&(t.parent[t.name]=t.values);else if(!(t instanceof a)){if(t instanceof r)for(var n=0;n<this.deferred.length;)c(0,this.deferred[n])?this.deferred.splice(n,1):++n;for(var e=0;e<t.nestedArray.length;++e)this.M(t.L[e]);h.test(t.name)&&(t.parent[t.name]=t)}},u.prototype.S=function(t){var n;if(t instanceof o)void 0!==t.extend&&(t.extensionField?(t.extensionField.parent.remove(t.extensionField),t.extensionField=null):-1<(n=this.deferred.indexOf(t))&&this.deferred.splice(n,1));else if(t instanceof s)h.test(t.name)&&delete t.parent[t.name];else if(t instanceof i){for(var e=0;e<t.nestedArray.length;++e)this.S(t.L[e]);h.test(t.name)&&delete t.parent[t.name]}},u._=function(t,n,e){r=t,d=n,v=e}},function(t,n,e){"use strict";t.exports=e(28)},function(t,n,e){"use strict";var i=t.exports=e(29);i.build="light",i.load=function(t,n,e){return(n="function"==typeof n?(e=n,new i.Root):n||new i.Root).load(t,e)},i.loadSync=function(t,n){return(n=n||new i.Root).loadSync(t)},i.encoder=e(17),i.decoder=e(22),i.verifier=e(23),i.converter=e(24),i.ReflectionObject=e(4),i.Namespace=e(6),i.Root=e(26),i.Enum=e(3),i.Type=e(18),i.Field=e(5),i.OneOf=e(10),i.MapField=e(19),i.Service=e(20),i.Method=e(21),i.Message=e(11),i.wrappers=e(25),i.types=e(7),i.util=e(0),i.ReflectionObject._(i.Root),i.Namespace._(i.Type,i.Service,i.Enum),i.Root._(i.Type),i.Field._(i.Type)},function(t,n,e){"use strict";var i=n;function r(){i.util._(),i.Writer._(i.BufferWriter),i.Reader._(i.BufferReader)}i.build="minimal",i.Writer=e(8),i.BufferWriter=e(36),i.Reader=e(9),i.BufferReader=e(37),i.util=e(2),i.rpc=e(15),i.roots=e(16),i.configure=r,r()},function(t,n,e){"use strict";n.length=function(t){var n=t.length;if(!n)return 0;for(var e=0;1<--n%4&&"="===t.charAt(n);)++e;return Math.ceil(3*t.length)/4-e};for(var h=new Array(64),u=new Array(123),i=0;i<64;)u[h[i]=i<26?i+65:i<52?i+71:i<62?i-4:i-59|43]=i++;n.encode=function(t,n,e){for(var i,r=null,o=[],s=0,a=0;n<e;){var u=t[n++];switch(a){case 0:o[s++]=h[u>>2],i=(3&u)<<4,a=1;break;case 1:o[s++]=h[i|u>>4],i=(15&u)<<2,a=2;break;case 2:o[s++]=h[i|u>>6],o[s++]=h[63&u],a=0}8191<s&&((r=r||[]).push(String.fromCharCode.apply(String,o)),s=0)}return a&&(o[s++]=h[i],o[s++]=61,1===a&&(o[s++]=61)),r?(s&&r.push(String.fromCharCode.apply(String,o.slice(0,s))),r.join("")):String.fromCharCode.apply(String,o.slice(0,s))};var c="invalid encoding";n.decode=function(t,n,e){for(var i,r=e,o=0,s=0;s<t.length;){var a=t.charCodeAt(s++);if(61===a&&1<o)break;if(void 0===(a=u[a]))throw Error(c);switch(o){case 0:i=a,o=1;break;case 1:n[e++]=i<<2|(48&a)>>4,i=a,o=2;break;case 2:n[e++]=(15&i)<<4|(60&a)>>2,i=a,o=3;break;case 3:n[e++]=(3&i)<<6|a,o=0}}if(1===o)throw Error(c);return e-r},n.test=function(t){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t)}},function(t,n,e){"use strict";function i(){this.j={}}(t.exports=i).prototype.on=function(t,n,e){return(this.j[t]||(this.j[t]=[])).push({fn:n,ctx:e||this}),this},i.prototype.off=function(t,n){if(void 0===t)this.j={};else if(void 0===n)this.j[t]=[];else for(var e=this.j[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.j[t];if(n){for(var e=[],i=1;i<arguments.length;)e.push(arguments[i++]);for(i=0;i<n.length;)n[i].fn.apply(n[i++].ctx,e)}return this}},function(t,n,e){"use strict";function i(t){function n(t,n,e,i){var r=n<0?1:0;0===(n=r?-n:n)?t(0<1/n?0:2147483648,e,i):isNaN(n)?t(2143289344,e,i):t(34028234663852886e22<n?(r<<31|2139095040)>>>0:n<11754943508222875e-54?(r<<31|Math.round(n/1401298464324817e-60))>>>0:(r<<31|(r=Math.floor(Math.log(n)/Math.LN2))+127<<23|8388607&Math.round(n*Math.pow(2,-r)*8388608))>>>0,e,i)}function e(t,n,e){t=t(n,e),n=2*(t>>31)+1,e=t>>>23&255,t&=8388607;return 255==e?t?NaN:1/0*n:0==e?1401298464324817e-60*n*t:n*Math.pow(2,e-150)*(8388608+t)}function i(t,n,e){a[0]=t,n[e]=u[0],n[e+1]=u[1],n[e+2]=u[2],n[e+3]=u[3]}function r(t,n,e){a[0]=t,n[e]=u[3],n[e+1]=u[2],n[e+2]=u[1],n[e+3]=u[0]}function o(t,n){return u[0]=t[n],u[1]=t[n+1],u[2]=t[n+2],u[3]=t[n+3],a[0]}function s(t,n){return u[3]=t[n],u[2]=t[n+1],u[1]=t[n+2],u[0]=t[n+3],a[0]}var a,u,h,c,f;function l(t,n,e,i,r,o){var s,a,u=i<0?1:0;0===(i=u?-i:i)?(t(0,r,o+n),t(0<1/i?0:2147483648,r,o+e)):isNaN(i)?(t(0,r,o+n),t(2146959360,r,o+e)):17976931348623157e292<i?(t(0,r,o+n),t((u<<31|2146435072)>>>0,r,o+e)):i<22250738585072014e-324?(t((s=i/5e-324)>>>0,r,o+n),t((u<<31|s/4294967296)>>>0,r,o+e)):(1024===(a=Math.floor(Math.log(i)/Math.LN2))&&(a=1023),t(4503599627370496*(s=i*Math.pow(2,-a))>>>0,r,o+n),t((u<<31|a+1023<<20|1048576*s&1048575)>>>0,r,o+e))}function d(t,n,e,i,r){n=t(i,r+n),i=t(i,r+e),r=2*(i>>31)+1,e=i>>>20&2047,n=4294967296*(1048575&i)+n;return 2047==e?n?NaN:1/0*r:0==e?5e-324*r*n:r*Math.pow(2,e-1075)*(n+4503599627370496)}function v(t,n,e){h[0]=t,n[e]=c[0],n[e+1]=c[1],n[e+2]=c[2],n[e+3]=c[3],n[e+4]=c[4],n[e+5]=c[5],n[e+6]=c[6],n[e+7]=c[7]}function p(t,n,e){h[0]=t,n[e]=c[7],n[e+1]=c[6],n[e+2]=c[5],n[e+3]=c[4],n[e+4]=c[3],n[e+5]=c[2],n[e+6]=c[1],n[e+7]=c[0]}function m(t,n){return c[0]=t[n],c[1]=t[n+1],c[2]=t[n+2],c[3]=t[n+3],c[4]=t[n+4],c[5]=t[n+5],c[6]=t[n+6],c[7]=t[n+7],h[0]}function g(t,n){return c[7]=t[n],c[6]=t[n+1],c[5]=t[n+2],c[4]=t[n+3],c[3]=t[n+4],c[2]=t[n+5],c[1]=t[n+6],c[0]=t[n+7],h[0]}return"undefined"!=typeof Float32Array?(a=new Float32Array([-0]),u=new Uint8Array(a.buffer),f=128===u[3],t.writeFloatLE=f?i:r,t.writeFloatBE=f?r:i,t.readFloatLE=f?o:s,t.readFloatBE=f?s:o):(t.writeFloatLE=n.bind(null,y),t.writeFloatBE=n.bind(null,b),t.readFloatLE=e.bind(null,_),t.readFloatBE=e.bind(null,w)),"undefined"!=typeof Float64Array?(h=new Float64Array([-0]),c=new Uint8Array(h.buffer),f=128===c[7],t.writeDoubleLE=f?v:p,t.writeDoubleBE=f?p:v,t.readDoubleLE=f?m:g,t.readDoubleBE=f?g:m):(t.writeDoubleLE=l.bind(null,y,0,4),t.writeDoubleBE=l.bind(null,b,4,0),t.readDoubleLE=d.bind(null,_,0,4),t.readDoubleBE=d.bind(null,w,4,0)),t}function y(t,n,e){n[e]=255&t,n[e+1]=t>>>8&255,n[e+2]=t>>>16&255,n[e+3]=t>>>24}function b(t,n,e){n[e]=t>>>24,n[e+1]=t>>>16&255,n[e+2]=t>>>8&255,n[e+3]=255&t}function _(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(2);function r(t,n){this.lo=t>>>0,this.hi=n>>>0}var o=r.zero=new r(0,0);o.toNumber=function(){return 0},o.zzEncode=o.zzDecode=function(){return this},o.length=function(){return 1};r.zeroHash="\0\0\0\0\0\0\0\0";r.fromNumber=function(t){if(0===t)return o;var n=t<0,e=(t=n?-t:t)>>>0,t=(t-e)/4294967296>>>0;return n&&(t=~t>>>0,e=~e>>>0,4294967295<++e&&(e=0,4294967295<++t&&(t=0))),new r(e,t)},r.from=function(t){if("number"==typeof t)return r.fromNumber(t);if(i.isString(t)){if(!i.Long)return r.fromNumber(parseInt(t,10));t=i.Long.fromString(t)}return t.low||t.high?new r(t.low>>>0,t.high>>>0):o},r.prototype.toNumber=function(t){if(!t&&this.hi>>>31){var n=1+~this.lo>>>0,t=~this.hi>>>0;return-(n+4294967296*(t=!n?t+1>>>0:t))}return this.lo+4294967296*this.hi},r.prototype.toLong=function(t){return i.Long?new i.Long(0|this.lo,0|this.hi,Boolean(t)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(t)}};var s=String.prototype.charCodeAt;r.fromHash=function(t){return"\0\0\0\0\0\0\0\0"===t?o:new r((s.call(t,0)|s.call(t,1)<<8|s.call(t,2)<<16|s.call(t,3)<<24)>>>0,(s.call(t,4)|s.call(t,5)<<8|s.call(t,6)<<16|s.call(t,7)<<24)>>>0)},r.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},r.prototype.zzEncode=function(){var t=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^t)>>>0,this.lo=(this.lo<<1^t)>>>0,this},r.prototype.zzDecode=function(){var t=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^t)>>>0,this.hi=(this.hi>>>1^t)>>>0,this},r.prototype.length=function(){var t=this.lo,n=(this.lo>>>28|this.hi<<4)>>>0,e=this.hi>>>24;return 0==e?0==n?t<16384?t<128?1:2:t<2097152?3:4:n<16384?n<128?5:6:n<2097152?7:8:e<128?9:10}},function(t,n,e){"use strict";t.exports=o;var i=e(8);(o.prototype=Object.create(i.prototype)).constructor=o;var r=e(2);function o(){i.call(this)}function s(t,n,e){t.length<40?r.utf8.write(t,n,e):n.utf8Write?n.utf8Write(t,e):n.write(t,e)}o._=function(){o.alloc=r.v,o.writeBytesBuffer=r.Buffer&&r.Buffer.prototype instanceof Uint8Array&&"set"===r.Buffer.prototype.set.name?function(t,n,e){n.set(t,e)}:function(t,n,e){if(t.copy)t.copy(n,e,0,t.length);else for(var i=0;i<t.length;)n[e++]=t[i++]}},o.prototype.bytes=function(t){var n=(t=r.isString(t)?r.u(t,"base64"):t).length>>>0;return this.uint32(n),n&&this.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._()},function(t,n,e){"use strict";t.exports=o;var i=e(9);(o.prototype=Object.create(i.prototype)).constructor=o;var r=e(2);function o(t){i.call(this,t)}o._=function(){r.Buffer&&(o.prototype.O=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._()},function(t,n,e){"use strict";t.exports=i;var a=e(2);function i(t,n,e){if("function"!=typeof t)throw TypeError("rpcImpl must be a function");a.EventEmitter.call(this),this.rpcImpl=t,this.requestDelimited=Boolean(n),this.responseDelimited=Boolean(e)}((i.prototype=Object.create(a.EventEmitter.prototype)).constructor=i).prototype.rpcCall=function t(e,n,i,r,o){if(!r)throw TypeError("request must be specified");var s=this;if(!o)return a.asPromise(t,s,e,n,i,r);if(s.rpcImpl)try{return s.rpcImpl(e,n[s.requestDelimited?"encodeDelimited":"encode"](r).finish(),function(t,n){if(t)return s.emit("error",t,e),o(t);if(null!==n){if(!(n instanceof i))try{n=i[s.responseDelimited?"decodeDelimited":"decode"](n)}catch(t){return s.emit("error",t,e),o(t)}return s.emit("data",n,e),o(null,n)}s.end(!0)})}catch(t){return s.emit("error",t,e),void setTimeout(function(){o(t)},0)}else setTimeout(function(){o(Error("already ended"))},0)},i.prototype.end=function(t){return this.rpcImpl&&(t||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},function(t,n,e){"use strict";function i(n,e){"string"==typeof n&&(e=n,n=void 0);var u=[];function h(t){if("string"!=typeof t){var n="return "+(n=c());if(t){for(var e=Object.keys(t),i=new Array(e.length+1),r=new Array(e.length),o=0;o<e.length;)i[o]=e[o],r[o]=t[e[o++]];return i[o]=n,Function.apply(null,i).apply(null,r)}return Function(n)()}for(var s=new Array(arguments.length-1),a=0;a<s.length;)s[a]=arguments[++a];if(a=0,t=t.replace(/%([%dfijs])/g,function(t,n){var e=s[a++];switch(n){case"d":case"f":return String(Number(e));case"i":return String(Math.floor(e));case"j":return JSON.stringify(e);case"s":return String(e)}return"%"}),a!==s.length)throw Error("parameter count mismatch");return u.push(t),h}function c(t){return"function "+(t||e||"")+"("+(n&&n.join(",")||"")+"){\n  "+u.join("\n  ")+"\n}"}return h.toString=c,h}(t.exports=i).verbose=!1},function(t,n,e){"use strict";t.exports=a;var o=e(13),s=e(14)("fs");function a(e,i,r){return i="function"==typeof i?(r=i,{}):i||{},r?!i.xhr&&s&&s.readFile?s.readFile(e,function(t,n){return t&&"undefined"!=typeof XMLHttpRequest?a.xhr(e,i,r):t?r(t):r(null,i.binary?n:n.toString("utf8"))}):a.xhr(e,i,r):o(a,this,e,i)}a.xhr=function(t,e,i){var r=new XMLHttpRequest;r.onreadystatechange=function(){if(4===r.readyState){if(0!==r.status&&200!==r.status)return i(Error("status "+r.status));if(e.binary){if(!(t=r.response))for(var t=[],n=0;n<r.responseText.length;++n)t.push(255&r.responseText.charCodeAt(n));return i(null,"undefined"!=typeof Uint8Array?new Uint8Array(t):t)}return i(null,r.responseText)}},e.binary&&("overrideMimeType"in r&&r.overrideMimeType("text/plain; charset=x-user-defined"),r.responseType="arraybuffer"),r.open("GET",t),r.send()}},function(t,n,e){"use strict";var n=n,r=n.isAbsolute=function(t){return/^(?:\/|\w+:)/.test(t)},i=n.normalize=function(t){var n=(t=t.replace(/\\/g,"/").replace(/\/{2,}/g,"/")).split("/"),e=r(t),t="";e&&(t=n.shift()+"/");for(var i=0;i<n.length;)".."===n[i]?0<i&&".."!==n[i-1]?n.splice(--i,2):e?n.splice(i,1):++i:"."===n[i]?n.splice(i,1):++i;return t+n.join("/")};n.resolve=function(t,n,e){return e||(n=i(n)),!r(n)&&(t=(t=!e?i(t):t).replace(/(?:\/|^)[^/]+$/,"")).length?i(t+"/"+n):n}},function(t,n,e){"use strict";e.r(n);var u={};e.r(u),e.d(u,"ShadowMaterial",function(){return Wc}),e.d(u,"SpriteMaterial",function(){return Qh}),e.d(u,"RawShaderMaterial",function(){return $h}),e.d(u,"ShaderMaterial",function(){return cr}),e.d(u,"PointsMaterial",function(){return Xc}),e.d(u,"MeshPhysicalMaterial",function(){return Zc}),e.d(u,"MeshStandardMaterial",function(){return nr}),e.d(u,"MeshPhongMaterial",function(){return Yc}),e.d(u,"MeshToonMaterial",function(){return qc}),e.d(u,"MeshNormalMaterial",function(){return Kc}),e.d(u,"MeshLambertMaterial",function(){return Jc}),e.d(u,"MeshDepthMaterial",function(){return La}),e.d(u,"MeshDistanceMaterial",function(){return Ra}),e.d(u,"MeshBasicMaterial",function(){return wo}),e.d(u,"MeshMatcapMaterial",function(){return Qc}),e.d(u,"LineDashedMaterial",function(){return tf}),e.d(u,"LineBasicMaterial",function(){return $c}),e.d(u,"Material",function(){return tr});for(var a="v3.0.9",h=171,r=[],i=0;i<256;i++)r[i]=(i<16?"0":"")+i.toString(16);var Mt={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){var t=4294967295*Math.random()|0,n=4294967295*Math.random()|0,e=4294967295*Math.random()|0,i=4294967295*Math.random()|0;return(r[255&t]+r[t>>8&255]+r[t>>16&255]+r[t>>24&255]+"-"+r[255&n]+r[n>>8&255]+"-"+r[n>>16&15|64]+r[n>>24&255]+"-"+r[63&e|128]+r[e>>8&255]+"-"+r[e>>16&255]+r[e>>24&255]+r[255&i]+r[i>>8&255]+r[i>>16&255]+r[i>>24&255]).toUpperCase()},clamp:function(t,n,e){return Math.max(n,Math.min(e,t))},euclideanModulo:function(t,n){return(t%n+n)%n},mapLinear:function(t,n,e,i,r){return i+(t-n)*(r-i)/(e-n)},lerp:function(t,n,e){return(1-e)*t+e*n},smoothstep:function(t,n,e){return t<=n?0:e<=t?1:(t=(t-n)/(e-n))*t*(3-2*t)},smootherstep:function(t,n,e){return t<=n?0:e<=t?1:(t=(t-n)/(e-n))*t*t*(t*(6*t-15)+10)},randInt:function(t,n){return t+Math.floor(Math.random()*(n-t+1))},randFloat:function(t,n){return t+Math.random()*(n-t)},randFloatSpread:function(t){return t*(.5-Math.random())},degToRad:function(t){return t*Mt.DEG2RAD},radToDeg:function(t){return t*Mt.RAD2DEG},isPowerOfTwo:function(t){return 0==(t&t-1)&&0!==t},ceilPowerOfTwo:function(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},floorPowerOfTwo:function(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))},setQuaternionFromProperEuler:function(t,n,e,i,r){var o=Math.cos,s=Math.sin,a=o(e/2),u=s(e/2),h=o((n+i)/2),c=s((n+i)/2),f=o((n-i)/2),e=s((n-i)/2),o=o((i-n)/2),n=s((i-n)/2);"XYX"===r?t.set(a*c,u*f,u*e,a*h):"YZY"===r?t.set(u*e,a*c,u*f,a*h):"ZXZ"===r?t.set(u*f,u*e,a*c,a*h):"XZX"===r?t.set(a*c,u*n,u*o,a*h):"YXY"===r?t.set(u*o,a*c,u*n,a*h):"ZYZ"===r?t.set(u*n,u*o,a*c,a*h):console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order.")}};function rt(t,n,e,i){this.I=t||0,this.N=n||0,this.F=e||0,this.U=void 0!==i?i:1}Object.assign(rt,{slerp:function(t,n,e,i){return e.copy(t).slerp(n,i)},slerpFlat:function(t,n,e,i,r,o,s){var a=e[i+0],u=e[i+1],h=e[i+2],c=e[i+3],f=r[o+0],l=r[o+1],d=r[o+2],v=r[o+3];c===v&&a===f&&u===l&&h===d||(e=1-s,r=0<=(i=a*f+u*l+h*d+c*v)?1:-1,(o=1-i*i)>Number.EPSILON&&(o=Math.sqrt(o),i=Math.atan2(o,i*r),e=Math.sin(e*i)/o,s=Math.sin(s*i)/o),a=a*e+f*(r=s*r),u=u*e+l*r,h=h*e+d*r,c=c*e+v*r,e===1-s&&(a*=s=1/Math.sqrt(a*a+u*u+h*h+c*c),u*=s,h*=s,c*=s)),t[n]=a,t[n+1]=u,t[n+2]=h,t[n+3]=c}}),Object.defineProperties(rt.prototype,{x:{get:function(){return this.I},set:function(t){this.I=t,this.B()}},y:{get:function(){return this.N},set:function(t){this.N=t,this.B()}},z:{get:function(){return this.F},set:function(t){this.F=t,this.B()}},w:{get:function(){return this.U},set:function(t){this.U=t,this.B()}}}),Object.assign(rt.prototype,{isQuaternion:!0,set:function(t,n,e,i){return this.I=t,this.N=n,this.F=e,this.U=i,this.B(),this},clone:function(){return new this.constructor(this.I,this.N,this.F,this.U)},copy:function(t){return this.I=t.x,this.N=t.y,this.F=t.z,this.U=t.w,this.B(),this},setFromEuler:function(t,n){if(!t||!t.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var e=t.I,i=t.N,r=t.F,o=t.order,s=Math.cos,a=Math.sin,u=s(e/2),t=s(i/2),s=s(r/2),e=a(e/2),i=a(i/2),r=a(r/2);return"XYZ"===o?(this.I=e*t*s+u*i*r,this.N=u*i*s-e*t*r,this.F=u*t*r+e*i*s,this.U=u*t*s-e*i*r):"YXZ"===o?(this.I=e*t*s+u*i*r,this.N=u*i*s-e*t*r,this.F=u*t*r-e*i*s,this.U=u*t*s+e*i*r):"ZXY"===o?(this.I=e*t*s-u*i*r,this.N=u*i*s+e*t*r,this.F=u*t*r+e*i*s,this.U=u*t*s-e*i*r):"ZYX"===o?(this.I=e*t*s-u*i*r,this.N=u*i*s+e*t*r,this.F=u*t*r-e*i*s,this.U=u*t*s+e*i*r):"YZX"===o?(this.I=e*t*s+u*i*r,this.N=u*i*s+e*t*r,this.F=u*t*r-e*i*s,this.U=u*t*s-e*i*r):"XZY"===o&&(this.I=e*t*s-u*i*r,this.N=u*i*s-e*t*r,this.F=u*t*r+e*i*s,this.U=u*t*s+e*i*r),!1!==n&&this.B(),this},setFromAxisAngle:function(t,n){var e=n/2,n=Math.sin(e);return this.I=t.x*n,this.N=t.y*n,this.F=t.z*n,this.U=Math.cos(e),this.B(),this},setFromRotationMatrix:function(t){var n,e=t.elements,i=e[0],r=e[4],o=e[8],s=e[1],a=e[5],u=e[9],h=e[2],c=e[6],t=e[10],e=i+a+t;return 0<e?(n=.5/Math.sqrt(e+1),this.U=.25/n,this.I=(c-u)*n,this.N=(o-h)*n,this.F=(s-r)*n):a<i&&t<i?(n=2*Math.sqrt(1+i-a-t),this.U=(c-u)/n,this.I=.25*n,this.N=(r+s)/n,this.F=(o+h)/n):t<a?(n=2*Math.sqrt(1+a-i-t),this.U=(o-h)/n,this.I=(r+s)/n,this.N=.25*n,this.F=(u+c)/n):(n=2*Math.sqrt(1+t-i-a),this.U=(s-r)/n,this.I=(o+h)/n,this.N=(u+c)/n,this.F=.25*n),this.B(),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.I=-t.y,this.N=t.x,this.F=0):(this.I=0,this.N=-t.z,this.F=t.y)):(this.I=t.y*n.z-t.z*n.y,this.N=t.z*n.x-t.x*n.z,this.F=t.x*n.y-t.y*n.x),this.U=e,this.normalize()},angleTo:function(t){return 2*Math.acos(Math.abs(Mt.clamp(this.dot(t),-1,1)))},rotateTowards:function(t,n){var e=this.angleTo(t);if(0===e)return this;e=Math.min(1,n/e);return this.slerp(t,e),this},inverse:function(){return this.conjugate()},conjugate:function(){return this.I*=-1,this.N*=-1,this.F*=-1,this.B(),this},dot:function(t){return this.I*t.I+this.N*t.N+this.F*t.F+this.U*t.U},lengthSq:function(){return this.I*this.I+this.N*this.N+this.F*this.F+this.U*this.U},length:function(){return Math.sqrt(this.I*this.I+this.N*this.N+this.F*this.F+this.U*this.U)},normalize:function(){var t=this.length();return 0===t?(this.I=0,this.N=0,this.F=0,this.U=1):(this.I=this.I*(t=1/t),this.N=this.N*t,this.F=this.F*t,this.U=this.U*t),this.B(),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.I,i=t.N,r=t.F,o=t.U,s=n.I,a=n.N,t=n.F,n=n.U;return this.I=e*n+o*s+i*t-r*a,this.N=i*n+o*a+r*s-e*t,this.F=r*n+o*t+e*a-i*s,this.U=o*n-e*s-i*a-r*t,this.B(),this},slerp:function(t,n){if(0===n)return this;if(1===n)return this.copy(t);var e=this.I,i=this.N,r=this.F,o=this.U,s=o*t.U+e*t.I+i*t.N+r*t.F;if(s<0?(this.U=-t.U,this.I=-t.I,this.N=-t.N,this.F=-t.F,s=-s):this.copy(t),1<=s)return this.U=o,this.I=e,this.N=i,this.F=r,this;t=1-s*s;if(t<=Number.EPSILON){var a=1-n;return this.U=a*o+n*this.U,this.I=a*e+n*this.I,this.N=a*i+n*this.N,this.F=a*r+n*this.F,this.normalize(),this.B(),this}a=Math.sqrt(t),t=Math.atan2(a,s),s=Math.sin((1-n)*t)/a,a=Math.sin(n*t)/a;return this.U=o*s+this.U*a,this.I=e*s+this.I*a,this.N=i*s+this.N*a,this.F=r*s+this.F*a,this.B(),this},equals:function(t){return t.I===this.I&&t.N===this.N&&t.F===this.F&&t.U===this.U},fromArray:function(t,n){return this.I=t[n=void 0===n?0:n],this.N=t[n+1],this.F=t[n+2],this.U=t[n+3],this.B(),this},toArray:function(t,n){return(t=void 0===t?[]:t)[n=void 0===n?0:n]=this.I,t[n+1]=this.N,t[n+2]=this.F,t[n+3]=this.U,t},fromBufferAttribute:function(t,n){return this.I=t.getX(n),this.N=t.getY(n),this.F=t.getZ(n),this.U=t.getW(n),this},G:function(t){return this.B=t,this},B:function(){}});var o=new St,s=new rt;function St(t,n,e){this.x=t||0,this.y=n||0,this.z=e||0}Object.assign(St.prototype,{isVector3:!0,set:function(t,n,e){return this.x=t,this.y=n,this.z=e,this},setScalar:function(t){return this.x=t,this.y=t,this.z=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setComponent:function(t,n){switch(t){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},add:function(t,n){return void 0!==n?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,n)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this},addVectors:function(t,n){return this.x=t.x+n.x,this.y=t.y+n.y,this.z=t.z+n.z,this},addScaledVector:function(t,n){return this.x+=t.x*n,this.y+=t.y*n,this.z+=t.z*n,this},sub:function(t,n){return void 0!==n?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,n)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this},subVectors:function(t,n){return this.x=t.x-n.x,this.y=t.y-n.y,this.z=t.z-n.z,this},multiply:function(t,n){return void 0!==n?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(t,n)):(this.x*=t.x,this.y*=t.y,this.z*=t.z,this)},multiplyScalar:function(t){return this.x*=t,this.y*=t,this.z*=t,this},multiplyVectors:function(t,n){return this.x=t.x*n.x,this.y=t.y*n.y,this.z=t.z*n.z,this},applyEuler:function(t){return t&&t.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(s.setFromEuler(t))},applyAxisAngle:function(t,n){return this.applyQuaternion(s.setFromAxisAngle(t,n))},applyMatrix3:function(t){var n=this.x,e=this.y,i=this.z,t=t.elements;return this.x=t[0]*n+t[3]*e+t[6]*i,this.y=t[1]*n+t[4]*e+t[7]*i,this.z=t[2]*n+t[5]*e+t[8]*i,this},applyNormalMatrix:function(t){return this.applyMatrix3(t).normalize()},applyMatrix4:function(t){var n=this.x,e=this.y,i=this.z,r=t.elements,t=1/(r[3]*n+r[7]*e+r[11]*i+r[15]);return this.x=(r[0]*n+r[4]*e+r[8]*i+r[12])*t,this.y=(r[1]*n+r[5]*e+r[9]*i+r[13])*t,this.z=(r[2]*n+r[6]*e+r[10]*i+r[14])*t,this},applyQuaternion:function(t){var n=this.x,e=this.y,i=this.z,r=t.x,o=t.y,s=t.z,a=t.w,u=a*n+o*i-s*e,h=a*e+s*n-r*i,t=a*i+r*e-o*n,i=-r*n-o*e-s*i;return this.x=u*a+i*-r+h*-s-t*-o,this.y=h*a+i*-o+t*-r-u*-s,this.z=t*a+i*-s+u*-o-h*-r,this},project:function(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)},unproject:function(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)},transformDirection:function(t){var n=this.x,e=this.y,i=this.z,t=t.elements;return this.x=t[0]*n+t[4]*e+t[8]*i,this.y=t[1]*n+t[5]*e+t[9]*i,this.z=t[2]*n+t[6]*e+t[10]*i,this.normalize()},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this},divideScalar:function(t){return this.multiplyScalar(1/t)},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},clamp:function(t,n){return this.x=Math.max(t.x,Math.min(n.x,this.x)),this.y=Math.max(t.y,Math.min(n.y,this.y)),this.z=Math.max(t.z,Math.min(n.z,this.z)),this},clampScalar:function(t,n){return this.x=Math.max(t,Math.min(n,this.x)),this.y=Math.max(t,Math.min(n,this.y)),this.z=Math.max(t,Math.min(n,this.z)),this},clampLength:function(t,n){var e=this.length();return this.divideScalar(e||1).multiplyScalar(Math.max(t,Math.min(n,e)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,n){return this.x+=(t.x-this.x)*n,this.y+=(t.y-this.y)*n,this.z+=(t.z-this.z)*n,this},lerpVectors:function(t,n,e){return this.subVectors(n,t).multiplyScalar(e).add(t)},cross:function(t,n){return void 0!==n?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(t,n)):this.crossVectors(this,t)},crossVectors:function(t,n){var e=t.x,i=t.y,r=t.z,o=n.x,t=n.y,n=n.z;return this.x=i*n-r*t,this.y=r*o-e*n,this.z=e*t-i*o,this},projectOnVector:function(t){var n=t.lengthSq();if(0===n)return this.set(0,0,0);n=t.dot(this)/n;return this.copy(t).multiplyScalar(n)},projectOnPlane:function(t){return 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());if(0===n)return Math.PI/2;n=this.dot(t)/n;return Math.acos(Mt.clamp(n,-1,1))},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var n=this.x-t.x,e=this.y-t.y,t=this.z-t.z;return n*n+e*e+t*t},manhattanDistanceTo:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)},setFromSpherical:function(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)},setFromSphericalCoords:function(t,n,e){var i=Math.sin(n)*t;return this.x=i*Math.sin(e),this.y=Math.cos(n)*t,this.z=i*Math.cos(e),this},setFromCylindrical:function(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)},setFromCylindricalCoords:function(t,n,e){return this.x=t*Math.sin(n),this.y=e,this.z=t*Math.cos(n),this},setFromMatrixPosition:function(t){t=t.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this},setFromMatrixScale:function(t){var n=this.setFromMatrixColumn(t,0).length(),e=this.setFromMatrixColumn(t,1).length(),t=this.setFromMatrixColumn(t,2).length();return this.x=n,this.y=e,this.z=t,this},setFromMatrixColumn:function(t,n){return this.fromArray(t.elements,4*n)},setFromMatrix3Column:function(t,n){return this.fromArray(t.elements,3*n)},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z},fromArray:function(t,n){return this.x=t[n=void 0===n?0:n],this.y=t[n+1],this.z=t[n+2],this},toArray:function(t,n){return(t=void 0===t?[]:t)[n=void 0===n?0:n]=this.x,t[n+1]=this.y,t[n+2]=this.z,t},fromBufferAttribute:function(t,n,e){return void 0!==e&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(n),this.y=t.getY(n),this.z=t.getZ(n),this}});var c=new St,f=new Et,l=new St(0,0,0),d=new St(1,1,1),v=new St,p=new St,m=new St;function Et(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],0<arguments.length&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}function g(){}Object.assign(Et.prototype,{isMatrix4:!0,set:function(t,n,e,i,r,o,s,a,u,h,c,f,l,d,v,p){var m=this.elements;return m[0]=t,m[4]=n,m[8]=e,m[12]=i,m[1]=r,m[5]=o,m[9]=s,m[13]=a,m[2]=u,m[6]=h,m[10]=c,m[14]=f,m[3]=l,m[7]=d,m[11]=v,m[15]=p,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},clone:function(){return(new Et).fromArray(this.elements)},copy:function(t){var n=this.elements,t=t.elements;return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],this},copyPosition:function(t){var n=this.elements,t=t.elements;return n[12]=t[12],n[13]=t[13],n[14]=t[14],this},extractBasis:function(t,n,e){return t.setFromMatrixColumn(this,0),n.setFromMatrixColumn(this,1),e.setFromMatrixColumn(this,2),this},makeBasis:function(t,n,e){return this.set(t.x,n.x,e.x,0,t.y,n.y,e.y,0,t.z,n.z,e.z,0,0,0,0,1),this},extractRotation:function(t){var n=this.elements,e=t.elements,i=1/c.setFromMatrixColumn(t,0).length(),r=1/c.setFromMatrixColumn(t,1).length(),t=1/c.setFromMatrixColumn(t,2).length();return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*i,n[3]=0,n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*r,n[7]=0,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this},makeRotationFromEuler:function(t){t&&t.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var n,e,i,r,o,s,a,u,h,c,f,l,d=this.elements,v=t.x,p=t.y,m=t.z,g=Math.cos(v),y=Math.sin(v),b=Math.cos(p),v=Math.sin(p),p=Math.cos(m),m=Math.sin(m);return"XYZ"===t.order?(o=g*p,s=g*m,a=y*p,u=y*m,d[0]=b*p,d[4]=-b*m,d[8]=v,d[1]=s+a*v,d[5]=o-u*v,d[9]=-y*b,d[2]=u-o*v,d[6]=a+s*v,d[10]=g*b):"YXZ"===t.order?(e=b*m,i=v*p,d[0]=(n=b*p)+(r=v*m)*y,d[4]=i*y-e,d[8]=g*v,d[1]=g*m,d[5]=g*p,d[9]=-y,d[2]=e*y-i,d[6]=r+n*y,d[10]=g*b):"ZXY"===t.order?(e=b*m,i=v*p,d[0]=(n=b*p)-(r=v*m)*y,d[4]=-g*m,d[8]=i+e*y,d[1]=e+i*y,d[5]=g*p,d[9]=r-n*y,d[2]=-g*v,d[6]=y,d[10]=g*b):"ZYX"===t.order?(o=g*p,s=g*m,a=y*p,u=y*m,d[0]=b*p,d[4]=a*v-s,d[8]=o*v+u,d[1]=b*m,d[5]=u*v+o,d[9]=s*v-a,d[2]=-v,d[6]=y*b,d[10]=g*b):"YZX"===t.order?(h=g*b,c=g*v,f=y*b,l=y*v,d[0]=b*p,d[4]=l-h*m,d[8]=f*m+c,d[1]=m,d[5]=g*p,d[9]=-y*p,d[2]=-v*p,d[6]=c*m+f,d[10]=h-l*m):"XZY"===t.order&&(h=g*b,c=g*v,f=y*b,l=y*v,d[0]=b*p,d[4]=-m,d[8]=v*p,d[1]=h*m+l,d[5]=g*p,d[9]=c*m-f,d[2]=f*m-c,d[6]=y*p,d[10]=l*m+h),d[3]=0,d[7]=0,d[11]=0,d[12]=0,d[13]=0,d[14]=0,d[15]=1,this},makeRotationFromQuaternion:function(t){return this.compose(l,t,d)},lookAt:function(t,n,e){var i=this.elements;return m.subVectors(t,n),0===m.lengthSq()&&(m.z=1),m.normalize(),v.crossVectors(e,m),0===v.lengthSq()&&(1===Math.abs(e.z)?m.x+=1e-4:m.z+=1e-4,m.normalize(),v.crossVectors(e,m)),v.normalize(),p.crossVectors(m,v),i[0]=v.x,i[4]=p.x,i[8]=m.x,i[1]=v.y,i[5]=p.y,i[9]=m.y,i[2]=v.z,i[6]=p.z,i[10]=m.z,this},multiply:function(t,n){return void 0!==n?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(t,n)):this.multiplyMatrices(this,t)},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,n){var e=t.elements,i=n.elements,r=this.elements,o=e[0],s=e[4],a=e[8],u=e[12],h=e[1],c=e[5],f=e[9],l=e[13],d=e[2],v=e[6],p=e[10],m=e[14],g=e[3],y=e[7],b=e[11],_=e[15],w=i[0],x=i[4],M=i[8],S=i[12],E=i[1],T=i[5],L=i[9],R=i[13],O=i[2],A=i[6],C=i[10],k=i[14],t=i[3],n=i[7],e=i[11],i=i[15];return r[0]=o*w+s*E+a*O+u*t,r[4]=o*x+s*T+a*A+u*n,r[8]=o*M+s*L+a*C+u*e,r[12]=o*S+s*R+a*k+u*i,r[1]=h*w+c*E+f*O+l*t,r[5]=h*x+c*T+f*A+l*n,r[9]=h*M+c*L+f*C+l*e,r[13]=h*S+c*R+f*k+l*i,r[2]=d*w+v*E+p*O+m*t,r[6]=d*x+v*T+p*A+m*n,r[10]=d*M+v*L+p*C+m*e,r[14]=d*S+v*R+p*k+m*i,r[3]=g*w+y*E+b*O+_*t,r[7]=g*x+y*T+b*A+_*n,r[11]=g*M+y*L+b*C+_*e,r[15]=g*S+y*R+b*k+_*i,this},multiplyScalar:function(t){var n=this.elements;return n[0]*=t,n[4]*=t,n[8]*=t,n[12]*=t,n[1]*=t,n[5]*=t,n[9]*=t,n[13]*=t,n[2]*=t,n[6]*=t,n[10]*=t,n[14]*=t,n[3]*=t,n[7]*=t,n[11]*=t,n[15]*=t,this},determinant:function(){var t=this.elements,n=t[0],e=t[4],i=t[8],r=t[12],o=t[1],s=t[5],a=t[9],u=t[13],h=t[2],c=t[6],f=t[10],l=t[14];return t[3]*(+r*a*c-i*u*c-r*s*f+e*u*f+i*s*l-e*a*l)+t[7]*(+n*a*l-n*u*f+r*o*f-i*o*l+i*u*h-r*a*h)+t[11]*(+n*u*c-n*s*l-r*o*c+e*o*l+r*s*h-e*u*h)+t[15]*(-i*s*h-n*a*c+n*s*f+i*o*c-e*o*f+e*a*h)},transpose:function(){var t=this.elements,n=t[1];return t[1]=t[4],t[4]=n,n=t[2],t[2]=t[8],t[8]=n,n=t[6],t[6]=t[9],t[9]=n,n=t[3],t[3]=t[12],t[12]=n,n=t[7],t[7]=t[13],t[13]=n,n=t[11],t[11]=t[14],t[14]=n,this},setPosition:function(t,n,e){var i=this.elements;return t.isVector3?(i[12]=t.x,i[13]=t.y,i[14]=t.z):(i[12]=t,i[13]=n,i[14]=e),this},getInverse:function(t,n){void 0!==n&&console.warn("THREE.Matrix4: .getInverse() can no longer be configured to throw on degenerate.");var e=this.elements,i=t.elements,r=i[0],o=i[1],s=i[2],a=i[3],u=i[4],h=i[5],c=i[6],f=i[7],l=i[8],d=i[9],v=i[10],p=i[11],m=i[12],g=i[13],y=i[14],b=i[15],_=d*y*f-g*v*f+g*c*p-h*y*p-d*c*b+h*v*b,w=m*v*f-l*y*f-m*c*p+u*y*p+l*c*b-u*v*b,n=l*g*f-m*d*f+m*h*p-u*g*p-l*h*b+u*d*b,t=m*d*c-l*g*c-m*h*v+u*g*v+l*h*y-u*d*y,i=r*_+o*w+s*n+a*t;if(0==i)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);i=1/i;return e[0]=_*i,e[1]=(g*v*a-d*y*a-g*s*p+o*y*p+d*s*b-o*v*b)*i,e[2]=(h*y*a-g*c*a+g*s*f-o*y*f-h*s*b+o*c*b)*i,e[3]=(d*c*a-h*v*a-d*s*f+o*v*f+h*s*p-o*c*p)*i,e[4]=w*i,e[5]=(l*y*a-m*v*a+m*s*p-r*y*p-l*s*b+r*v*b)*i,e[6]=(m*c*a-u*y*a-m*s*f+r*y*f+u*s*b-r*c*b)*i,e[7]=(u*v*a-l*c*a+l*s*f-r*v*f-u*s*p+r*c*p)*i,e[8]=n*i,e[9]=(m*d*a-l*g*a-m*o*p+r*g*p+l*o*b-r*d*b)*i,e[10]=(u*g*a-m*h*a+m*o*f-r*g*f-u*o*b+r*h*b)*i,e[11]=(l*h*a-u*d*a-l*o*f+r*d*f+u*o*p-r*h*p)*i,e[12]=t*i,e[13]=(l*g*s-m*d*s+m*o*v-r*g*v-l*o*y+r*d*y)*i,e[14]=(m*h*s-u*g*s-m*o*c+r*g*c+u*o*y-r*h*y)*i,e[15]=(u*d*s-l*h*s+l*o*c-r*d*c-u*o*v+r*h*v)*i,this},scale:function(t){var n=this.elements,e=t.x,i=t.y,t=t.z;return n[0]*=e,n[4]*=i,n[8]*=t,n[1]*=e,n[5]*=i,n[9]*=t,n[2]*=e,n[6]*=i,n[10]*=t,n[3]*=e,n[7]*=i,n[11]*=t,this},getMaxScaleOnAxis:function(){var t=this.elements,n=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],e=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],t=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(n,e,t))},makeTranslation:function(t,n,e){return this.set(1,0,0,t,0,1,0,n,0,0,1,e,0,0,0,1),this},makeRotationX:function(t){var n=Math.cos(t),t=Math.sin(t);return this.set(1,0,0,0,0,n,-t,0,0,t,n,0,0,0,0,1),this},makeRotationY:function(t){var n=Math.cos(t),t=Math.sin(t);return this.set(n,0,t,0,0,1,0,0,-t,0,n,0,0,0,0,1),this},makeRotationZ:function(t){var n=Math.cos(t),t=Math.sin(t);return this.set(n,-t,0,0,t,n,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(t,n){var e=Math.cos(n),i=Math.sin(n),r=1-e,o=t.x,s=t.y,a=t.z,n=r*o,t=r*s;return this.set(n*o+e,n*s-i*a,n*a+i*s,0,n*s+i*a,t*s+e,t*a-i*o,0,n*a-i*s,t*a+i*o,r*a*a+e,0,0,0,0,1),this},makeScale:function(t,n,e){return this.set(t,0,0,0,0,n,0,0,0,0,e,0,0,0,0,1),this},makeShear:function(t,n,e){return this.set(1,n,e,0,t,1,e,0,t,n,1,0,0,0,0,1),this},compose:function(t,n,e){var i=this.elements,r=n.I,o=n.N,s=n.F,a=n.U,u=r+r,h=o+o,c=s+s,f=r*u,l=r*h,d=r*c,n=o*h,r=o*c,o=s*c,s=a*u,u=a*h,h=a*c,a=e.x,c=e.y,e=e.z;return i[0]=(1-(n+o))*a,i[1]=(l+h)*a,i[2]=(d-u)*a,i[3]=0,i[4]=(l-h)*c,i[5]=(1-(f+o))*c,i[6]=(r+s)*c,i[7]=0,i[8]=(d+u)*e,i[9]=(r-s)*e,i[10]=(1-(f+n))*e,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,this},decompose:function(t,n,e){var i=this.elements,r=c.set(i[0],i[1],i[2]).length(),o=c.set(i[4],i[5],i[6]).length(),s=c.set(i[8],i[9],i[10]).length();this.determinant()<0&&(r=-r),t.x=i[12],t.y=i[13],t.z=i[14],f.copy(this);var a=1/r,t=1/o,i=1/s;return f.elements[0]*=a,f.elements[1]*=a,f.elements[2]*=a,f.elements[4]*=t,f.elements[5]*=t,f.elements[6]*=t,f.elements[8]*=i,f.elements[9]*=i,f.elements[10]*=i,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),h=1/(o-r),t=(n+t)*a,i=(e+i)*u,r=(o+r)*h;return s[0]=2*a,s[4]=0,s[8]=0,s[12]=-t,s[1]=0,s[5]=2*u,s[9]=0,s[13]=-i,s[2]=0,s[6]=0,s[10]=-2*h,s[14]=-r,s[3]=0,s[7]=0,s[11]=0,s[15]=1,this},equals:function(t){for(var n=this.elements,e=t.elements,i=0;i<16;i++)if(n[i]!==e[i])return!1;return!0},fromArray:function(t,n){void 0===n&&(n=0);for(var e=0;e<16;e++)this.elements[e]=t[e+n];return this},toArray:function(t,n){var e=this.elements;return(t=void 0===t?[]:t)[n=void 0===n?0:n]=e[0],t[n+1]=e[1],t[n+2]=e[2],t[n+3]=e[3],t[n+4]=e[4],t[n+5]=e[5],t[n+6]=e[6],t[n+7]=e[7],t[n+8]=e[8],t[n+9]=e[9],t[n+10]=e[10],t[n+11]=e[11],t[n+12]=e[12],t[n+13]=e[13],t[n+14]=e[14],t[n+15]=e[15],t}}),Object.assign(g.prototype,{addEventListener:function(t,n){void 0===this.j&&(this.j={});var e=this.j;void 0===e[t]&&(e[t]=[]),-1===e[t].indexOf(n)&&e[t].push(n)},hasEventListener:function(t,n){if(void 0===this.j)return!1;var e=this.j;return void 0!==e[t]&&-1!==e[t].indexOf(n)},removeEventListener:function(t,n){void 0!==this.j&&(void 0===(t=this.j[t])||-1!==(n=t.indexOf(n))&&t.splice(n,1))},dispatchEvent:function(t){if(void 0!==this.j){var n=this.j[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 y=new Et,b=new rt;function _(t,n,e,i){this.I=t||0,this.N=n||0,this.F=e||0,this.H=i||_.DefaultOrder}function w(){this.mask=1}function x(){this.elements=[1,0,0,0,1,0,0,0,1],0<arguments.length&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}_.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],_.DefaultOrder="XYZ",Object.defineProperties(_.prototype,{x:{get:function(){return this.I},set:function(t){this.I=t,this.B()}},y:{get:function(){return this.N},set:function(t){this.N=t,this.B()}},z:{get:function(){return this.F},set:function(t){this.F=t,this.B()}},order:{get:function(){return this.H},set:function(t){this.H=t,this.B()}}}),Object.assign(_.prototype,{isEuler:!0,set:function(t,n,e,i){return this.I=t,this.N=n,this.F=e,this.H=i||this.H,this.B(),this},clone:function(){return new this.constructor(this.I,this.N,this.F,this.H)},copy:function(t){return this.I=t.I,this.N=t.N,this.F=t.F,this.H=t.H,this.B(),this},setFromRotationMatrix:function(t,n,e){var i=Mt.clamp,r=t.elements,o=r[0],s=r[4],a=r[8],u=r[1],h=r[5],c=r[9],f=r[2],t=r[6],r=r[10];return"XYZ"===(n=n||this.H)?(this.N=Math.asin(i(a,-1,1)),Math.abs(a)<.9999999?(this.I=Math.atan2(-c,r),this.F=Math.atan2(-s,o)):(this.I=Math.atan2(t,h),this.F=0)):"YXZ"===n?(this.I=Math.asin(-i(c,-1,1)),Math.abs(c)<.9999999?(this.N=Math.atan2(a,r),this.F=Math.atan2(u,h)):(this.N=Math.atan2(-f,o),this.F=0)):"ZXY"===n?(this.I=Math.asin(i(t,-1,1)),Math.abs(t)<.9999999?(this.N=Math.atan2(-f,r),this.F=Math.atan2(-s,h)):(this.N=0,this.F=Math.atan2(u,o))):"ZYX"===n?(this.N=Math.asin(-i(f,-1,1)),Math.abs(f)<.9999999?(this.I=Math.atan2(t,r),this.F=Math.atan2(u,o)):(this.I=0,this.F=Math.atan2(-s,h))):"YZX"===n?(this.F=Math.asin(i(u,-1,1)),Math.abs(u)<.9999999?(this.I=Math.atan2(-c,h),this.N=Math.atan2(-f,o)):(this.I=0,this.N=Math.atan2(a,r))):"XZY"===n?(this.F=Math.asin(-i(s,-1,1)),Math.abs(s)<.9999999?(this.I=Math.atan2(t,h),this.N=Math.atan2(a,o)):(this.I=Math.atan2(-c,r),this.N=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+n),this.H=n,!1!==e&&this.B(),this},setFromQuaternion:function(t,n,e){return y.makeRotationFromQuaternion(t),this.setFromRotationMatrix(y,n,e)},setFromVector3:function(t,n){return this.set(t.x,t.y,t.z,n||this.H)},reorder:function(t){return b.setFromEuler(this),this.setFromQuaternion(b,t)},equals:function(t){return t.I===this.I&&t.N===this.N&&t.F===this.F&&t.H===this.H},fromArray:function(t){return this.I=t[0],this.N=t[1],this.F=t[2],void 0!==t[3]&&(this.H=t[3]),this.B(),this},toArray:function(t,n){return(t=void 0===t?[]:t)[n=void 0===n?0:n]=this.I,t[n+1]=this.N,t[n+2]=this.F,t[n+3]=this.H,t},toVector3:function(t){return t?t.set(this.I,this.N,this.F):new St(this.I,this.N,this.F)},G:function(t){return this.B=t,this},B:function(){}}),Object.assign(w.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(x.prototype,{isMatrix3:!0,set:function(t,n,e,i,r,o,s,a,u){var h=this.elements;return h[0]=t,h[1]=i,h[2]=s,h[3]=n,h[4]=r,h[5]=a,h[6]=e,h[7]=o,h[8]=u,this},identity:function(){return this.set(1,0,0,0,1,0,0,0,1),this},clone:function(){return(new this.constructor).fromArray(this.elements)},copy:function(t){var n=this.elements,t=t.elements;return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],this},extractBasis:function(t,n,e){return t.setFromMatrix3Column(this,0),n.setFromMatrix3Column(this,1),e.setFromMatrix3Column(this,2),this},setFromMatrix4:function(t){t=t.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this},multiply:function(t){return this.multiplyMatrices(this,t)},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,n){var e=t.elements,i=n.elements,r=this.elements,o=e[0],s=e[3],a=e[6],u=e[1],h=e[4],c=e[7],f=e[2],l=e[5],d=e[8],v=i[0],p=i[3],m=i[6],g=i[1],y=i[4],t=i[7],n=i[2],e=i[5],i=i[8];return r[0]=o*v+s*g+a*n,r[3]=o*p+s*y+a*e,r[6]=o*m+s*t+a*i,r[1]=u*v+h*g+c*n,r[4]=u*p+h*y+c*e,r[7]=u*m+h*t+c*i,r[2]=f*v+l*g+d*n,r[5]=f*p+l*y+d*e,r[8]=f*m+l*t+d*i,this},multiplyScalar:function(t){var n=this.elements;return n[0]*=t,n[3]*=t,n[6]*=t,n[1]*=t,n[4]*=t,n[7]*=t,n[2]*=t,n[5]*=t,n[8]*=t,this},determinant:function(){var t=this.elements,n=t[0],e=t[1],i=t[2],r=t[3],o=t[4],s=t[5],a=t[6],u=t[7],t=t[8];return n*o*t-n*s*u-e*r*t+e*s*a+i*r*u-i*o*a},getInverse:function(t,n){void 0!==n&&console.warn("THREE.Matrix3: .getInverse() can no longer be configured to throw on degenerate.");var e=t.elements,i=this.elements,r=e[0],o=e[1],s=e[2],a=e[3],u=e[4],h=e[5],c=e[6],f=e[7],l=e[8],d=l*u-h*f,n=h*c-l*a,t=f*a-u*c,e=r*d+o*n+s*t;if(0==e)return this.set(0,0,0,0,0,0,0,0,0);e=1/e;return i[0]=d*e,i[1]=(s*f-l*o)*e,i[2]=(h*o-s*u)*e,i[3]=n*e,i[4]=(l*r-s*c)*e,i[5]=(s*a-h*r)*e,i[6]=t*e,i[7]=(o*c-f*r)*e,i[8]=(u*r-o*a)*e,this},transpose:function(){var t=this.elements,n=t[1];return t[1]=t[3],t[3]=n,n=t[2],t[2]=t[6],t[6]=n,n=t[5],t[5]=t[7],t[7]=n,this},getNormalMatrix:function(t){return this.setFromMatrix4(t).getInverse(this).transpose()},transposeIntoArray:function(t){var n=this.elements;return t[0]=n[0],t[1]=n[3],t[2]=n[6],t[3]=n[1],t[4]=n[4],t[5]=n[7],t[6]=n[2],t[7]=n[5],t[8]=n[8],this},setUvTransform:function(t,n,e,i,r,o,s){var a=Math.cos(r),r=Math.sin(r);this.set(e*a,e*r,-e*(a*o+r*s)+o+t,-i*r,i*a,-i*(-r*o+a*s)+s+n,0,0,1)},scale:function(t,n){var e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=n,e[4]*=n,e[7]*=n,this},rotate:function(t){var n=Math.cos(t),e=Math.sin(t),i=this.elements,r=i[0],o=i[3],s=i[6],a=i[1],u=i[4],t=i[7];return i[0]=n*r+e*a,i[3]=n*o+e*u,i[6]=n*s+e*t,i[1]=-e*r+n*a,i[4]=-e*o+n*u,i[7]=-e*s+n*t,this},translate:function(t,n){var e=this.elements;return e[0]+=t*e[2],e[3]+=t*e[5],e[6]+=t*e[8],e[1]+=n*e[2],e[4]+=n*e[5],e[7]+=n*e[8],this},equals:function(t){for(var n=this.elements,e=t.elements,i=0;i<9;i++)if(n[i]!==e[i])return!1;return!0},fromArray:function(t,n){void 0===n&&(n=0);for(var e=0;e<9;e++)this.elements[e]=t[e+n];return this},toArray:function(t,n){var e=this.elements;return(t=void 0===t?[]:t)[n=void 0===n?0:n]=e[0],t[n+1]=e[1],t[n+2]=e[2],t[n+3]=e[3],t[n+4]=e[4],t[n+5]=e[5],t[n+6]=e[6],t[n+7]=e[7],t[n+8]=e[8],t}});var M=0,S=new St,E=new rt,T=new Et,L=new St,R=new St,O=new St,A=new rt,C=new St(1,0,0),k=new St(0,1,0),P=new St(0,0,1),D={type:"added"},j={type:"removed"};function Z(){Object.defineProperty(this,"id",{value:M++}),this.uuid=Mt.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Z.DefaultUp.clone();var t=new St,n=new _,e=new rt,i=new St(1,1,1);n.G(function(){e.setFromEuler(n,!1)}),e.G(function(){n.setFromQuaternion(e,void 0,!1)}),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:n},quaternion:{configurable:!0,enumerable:!0,value:e},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new Et},normalMatrix:{value:new x}}),this.matrix=new Et,this.matrixWorld=new Et,this.matrixAutoUpdate=Z.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new w,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}}function I(){Z.call(this),this.type="Camera",this.matrixWorldInverse=new Et,this.projectionMatrix=new Et,this.projectionMatrixInverse=new Et}function Y(t,n,e,i){I.call(this),this.type="PerspectiveCamera",this.fov=void 0!==t?t:50,this.zoom=1,this.near=void 0!==e?e:.1,this.far=void 0!==i?i:2e3,this.focus=10,this.aspect=void 0!==n?n:1,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}function q(t,n,e,i,r,o){I.call(this),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=void 0!==t?t:-1,this.right=void 0!==n?n:1,this.top=void 0!==e?e:1,this.bottom=void 0!==i?i:-1,this.near=void 0!==r?r:.1,this.far=void 0!==o?o:2e3,this.updateProjectionMatrix()}Z.DefaultUp=new St(0,1,0),Z.DefaultMatrixAutoUpdate=!0,Z.prototype=Object.assign(Object.create(g.prototype),{constructor:Z,isObject3D:!0,onBeforeRender:function(){},onAfterRender:function(){},applyMatrix4:function(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)},applyQuaternion:function(t){return this.quaternion.premultiply(t),this},setRotationFromAxisAngle:function(t,n){this.quaternion.setFromAxisAngle(t,n)},setRotationFromEuler:function(t){this.quaternion.setFromEuler(t,!0)},setRotationFromMatrix:function(t){this.quaternion.setFromRotationMatrix(t)},setRotationFromQuaternion:function(t){this.quaternion.copy(t)},rotateOnAxis:function(t,n){return E.setFromAxisAngle(t,n),this.quaternion.multiply(E),this},rotateOnWorldAxis:function(t,n){return E.setFromAxisAngle(t,n),this.quaternion.premultiply(E),this},rotateX:function(t){return this.rotateOnAxis(C,t)},rotateY:function(t){return this.rotateOnAxis(k,t)},rotateZ:function(t){return this.rotateOnAxis(P,t)},translateOnAxis:function(t,n){return S.copy(t).applyQuaternion(this.quaternion),this.position.add(S.multiplyScalar(n)),this},translateX:function(t){return this.translateOnAxis(C,t)},translateY:function(t){return this.translateOnAxis(k,t)},translateZ:function(t){return this.translateOnAxis(P,t)},localToWorld:function(t){return t.applyMatrix4(this.matrixWorld)},worldToLocal:function(t){return t.applyMatrix4(T.getInverse(this.matrixWorld))},lookAt:function(t,n,e){t.isVector3?L.copy(t):L.set(t,n,e);e=this.parent;this.updateWorldMatrix(!0,!1),R.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?T.lookAt(R,L,this.up):T.lookAt(L,R,this.up),this.quaternion.setFromRotationMatrix(T),e&&(T.extractRotation(e.matrixWorld),E.setFromRotationMatrix(T),this.quaternion.premultiply(E.inverse()))},add:function(t){if(1<arguments.length){for(var n=0;n<arguments.length;n++)this.add(arguments[n]);return this}return t===this?console.error("THREE.Object3D.add: object can't be added as a child of itself.",t):t&&t.isObject3D?(null!==t.parent&&t.parent.remove(t),(t.parent=this).children.push(t),t.dispatchEvent(D)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this},remove:function(t){if(1<arguments.length){for(var n=0;n<arguments.length;n++)this.remove(arguments[n]);return this}var e=this.children.indexOf(t);return-1!==e&&(t.parent=null,this.children.splice(e,1),t.dispatchEvent(j)),this},attach:function(t){return this.updateWorldMatrix(!0,!1),T.getInverse(this.matrixWorld),null!==t.parent&&(t.parent.updateWorldMatrix(!0,!1),T.multiply(t.parent.matrixWorld)),t.applyMatrix4(T),t.updateWorldMatrix(!1,!1),this.add(t),this},getObjectById:function(t){return this.getObjectByProperty("id",t)},getObjectByName:function(t){return this.getObjectByProperty("name",t)},getObjectByProperty:function(t,n){if(this[t]===n)return this;for(var e=0,i=this.children.length;e<i;e++){var r=this.children[e].getObjectByProperty(t,n);if(void 0!==r)return r}},getWorldPosition:function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldPosition() target is now required"),t=new St),this.updateMatrixWorld(!0),t.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldQuaternion() target is now required"),t=new rt),this.updateMatrixWorld(!0),this.matrixWorld.decompose(R,t,O),t},getWorldScale:function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldScale() target is now required"),t=new St),this.updateMatrixWorld(!0),this.matrixWorld.decompose(R,A,t),t},getWorldDirection:function(t){void 0===t&&(console.warn("THREE.Object3D: .getWorldDirection() target is now required"),t=new St),this.updateMatrixWorld(!0);var n=this.matrixWorld.elements;return t.set(n[8],n[9],n[10]).normalize()},raycast:function(){},traverse:function(t){t(this);for(var n=this.children,e=0,i=n.length;e<i;e++)n[e].traverse(t)},traverseVisible:function(t){if(!1!==this.visible){t(this);for(var n=this.children,e=0,i=n.length;e<i;e++)n[e].traverseVisible(t)}},traverseAncestors:function(t){var n=this.parent;null!==n&&(t(n),n.traverseAncestors(t))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),t=!(this.matrixWorldNeedsUpdate=!1));for(var n=this.children,e=0,i=n.length;e<i;e++)n[e].updateMatrixWorld(t)},updateWorldMatrix:function(t,n){var e=this.parent;if(!0===t&&null!==e&&e.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===n)for(var i=this.children,r=0,o=i.length;r<o;r++)i[r].updateWorldMatrix(!1,!0)},clone:function(t){return(new this.constructor).copy(this,t)},copy:function(t,n){if(void 0===n&&(n=!0),this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),!0===n)for(var e=0;e<t.children.length;e++){var i=t.children[e];this.add(i.clone())}return this}}),I.prototype=Object.assign(Object.create(Z.prototype),{constructor:I,isCamera:!0,copy:function(t,n){return Z.prototype.copy.call(this,t,n),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this},getWorldDirection:function(t){void 0===t&&(console.warn("THREE.Camera: .getWorldDirection() target is now required"),t=new St),this.updateMatrixWorld(!0);var n=this.matrixWorld.elements;return t.set(-n[8],-n[9],-n[10]).normalize()},updateMatrixWorld:function(t){Z.prototype.updateMatrixWorld.call(this,t),this.matrixWorldInverse.getInverse(this.matrixWorld)},updateWorldMatrix:function(t,n){Z.prototype.updateWorldMatrix.call(this,t,n),this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return(new this.constructor).copy(this)}}),Y.prototype=Object.assign(Object.create(I.prototype),{constructor:Y,isPerspectiveCamera:!0,copy:function(t,n){return I.prototype.copy.call(this,t,n),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=null===t.view?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this},setFocalLength:function(t){t=.5*this.getFilmHeight()/t;this.fov=2*Mt.RAD2DEG*Math.atan(t),this.updateProjectionMatrix()},getFocalLength:function(){var t=Math.tan(.5*Mt.DEG2RAD*this.fov);return.5*this.getFilmHeight()/t},getEffectiveFOV:function(){return 2*Mt.RAD2DEG*Math.atan(Math.tan(.5*Mt.DEG2RAD*this.fov)/this.zoom)},getFilmWidth:function(){return this.filmGauge*Math.min(this.aspect,1)},getFilmHeight:function(){return this.filmGauge/Math.max(this.aspect,1)},setViewOffset:function(t,n,e,i,r,o){this.aspect=t/n,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=n,this.view.offsetX=e,this.view.offsetY=i,this.view.width=r,this.view.height=o,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var t,n=this.near,e=n*Math.tan(.5*Mt.DEG2RAD*this.fov)/this.zoom,i=2*e,r=this.aspect*i,o=-.5*r,s=this.view;null!==this.view&&this.view.enabled&&(t=s.fullWidth,a=s.fullHeight,o+=s.offsetX*r/t,e-=s.offsetY*i/a,r*=s.width/t,i*=s.height/a);var a=this.filmOffset;0!==a&&(o+=n*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(o,o+r,e,e-i,n,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)}}),q.prototype=Object.assign(Object.create(I.prototype),{constructor:q,isOrthographicCamera:!0,copy:function(t,n){return I.prototype.copy.call(this,t,n),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=null===t.view?null:Object.assign({},t.view),this},setViewOffset:function(t,n,e,i,r,o){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=n,this.view.offsetX=e,this.view.offsetY=i,this.view.width=r,this.view.height=o,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var t=(this.right-this.left)/(2*this.zoom),n=(this.top-this.bottom)/(2*this.zoom),e=(this.right+this.left)/2,i=(this.top+this.bottom)/2,r=e-t,o=e+t,e=i+n,t=i-n;null!==this.view&&this.view.enabled&&(i=(this.right-this.left)/this.view.fullWidth/this.zoom,n=(this.top-this.bottom)/this.view.fullHeight/this.zoom,o=(r+=i*this.view.offsetX)+i*this.view.width,t=(e-=n*this.view.offsetY)-n*this.view.height),this.projectionMatrix.makeOrthographic(r,o,e,t,this.near,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)}});var N=[new St,new St,new St,new St,new St,new St,new St,new St],F=new St,U=new $,B=new St,G=new St,H=new St,V=new St,z=new St,W=new St,X=new St,K=new St,J=new St,Q=new St;function $(t,n){this.min=void 0!==t?t:new St(1/0,1/0,1/0),this.max=void 0!==n?n:new St(-1/0,-1/0,-1/0)}function tt(t,n,e,i,r){for(var o=0,s=t.length-3;o<=s;o+=3){Q.fromArray(t,o);var a=r.x*Math.abs(Q.x)+r.y*Math.abs(Q.y)+r.z*Math.abs(Q.z),u=n.dot(Q),h=e.dot(Q),c=i.dot(Q);if(Math.max(-Math.max(u,h,c),Math.min(u,h,c))>a)return!1}return!0}Object.assign($.prototype,{isBox3:!0,set:function(t,n){return this.min.copy(t),this.max.copy(n),this},setFromArray:function(t){for(var n=1/0,e=1/0,i=1/0,r=-1/0,o=-1/0,s=-1/0,a=0,u=t.length;a<u;a+=3){var h=t[a],c=t[a+1],f=t[a+2];h<n&&(n=h),c<e&&(e=c),f<i&&(i=f),r<h&&(r=h),o<c&&(o=c),s<f&&(s=f)}return this.min.set(n,e,i),this.max.set(r,o,s),this},setFromBufferAttribute:function(t){for(var n=1/0,e=1/0,i=1/0,r=-1/0,o=-1/0,s=-1/0,a=0,u=t.count;a<u;a++){var h=t.getX(a),c=t.getY(a),f=t.getZ(a);h<n&&(n=h),c<e&&(e=c),f<i&&(i=f),r<h&&(r=h),o<c&&(o=c),s<f&&(s=f)}return this.min.set(n,e,i),this.max.set(r,o,s),this},setFromPoints:function(t){this.makeEmpty();for(var n=0,e=t.length;n<e;n++)this.expandByPoint(t[n]);return this},setFromCenterAndSize:function(t,n){n=F.copy(n).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this},setFromObject:function(t){return this.makeEmpty(),this.expandByObject(t)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.min.copy(t.min),this.max.copy(t.max),this},makeEmpty:function(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z},getCenter:function(t){return void 0===t&&(console.warn("THREE.Box3: .getCenter() target is now required"),t=new St),this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(t){return void 0===t&&(console.warn("THREE.Box3: .getSize() target is now required"),t=new St),this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)},expandByPoint:function(t){return this.min.min(t),this.max.max(t),this},expandByVector:function(t){return this.min.sub(t),this.max.add(t),this},expandByScalar:function(t){return this.min.addScalar(-t),this.max.addScalar(t),this},expandByObject:function(t){t.updateWorldMatrix(!1,!1);var n=t.geometry;void 0!==n&&(null===n.boundingBox&&n.computeBoundingBox(),U.copy(n.boundingBox),U.applyMatrix4(t.matrixWorld),this.union(U));for(var e=t.children,i=0,r=e.length;i<r;i++)this.expandByObject(e[i]);return this},containsPoint:function(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y||t.z<this.min.z||t.z>this.max.z)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z},getParameter:function(t,n){return void 0===n&&(console.warn("THREE.Box3: .getParameter() target is now required"),n=new St),n.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y||t.max.z<this.min.z||t.min.z>this.max.z)},intersectsSphere:function(t){return this.clampPoint(t.center,F),F.distanceToSquared(t.center)<=t.radius*t.radius},intersectsPlane:function(t){var n,e=0<t.normal.x?(n=t.normal.x*this.min.x,t.normal.x*this.max.x):(n=t.normal.x*this.max.x,t.normal.x*this.min.x);return 0<t.normal.y?(n+=t.normal.y*this.min.y,e+=t.normal.y*this.max.y):(n+=t.normal.y*this.max.y,e+=t.normal.y*this.min.y),0<t.normal.z?(n+=t.normal.z*this.min.z,e+=t.normal.z*this.max.z):(n+=t.normal.z*this.max.z,e+=t.normal.z*this.min.z),n<=-t.constant&&e>=-t.constant},intersectsTriangle:function(t){if(this.isEmpty())return!1;this.getCenter(X),K.subVectors(this.max,X),B.subVectors(t.a,X),G.subVectors(t.b,X),H.subVectors(t.c,X),V.subVectors(G,B),z.subVectors(H,G),W.subVectors(B,H);t=[0,-V.z,V.y,0,-z.z,z.y,0,-W.z,W.y,V.z,0,-V.x,z.z,0,-z.x,W.z,0,-W.x,-V.y,V.x,0,-z.y,z.x,0,-W.y,W.x,0];return!!tt(t,B,G,H,K)&&(!!tt(t=[1,0,0,0,1,0,0,0,1],B,G,H,K)&&(J.crossVectors(V,z),tt(t=[J.x,J.y,J.z],B,G,H,K)))},clampPoint:function(t,n){return void 0===n&&(console.warn("THREE.Box3: .clampPoint() target is now required"),n=new St),n.copy(t).clamp(this.min,this.max)},distanceToPoint:function(t){return F.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(F).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()||(N[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),N[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),N[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),N[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),N[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),N[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),N[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),N[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(N)),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 nt=new $;function et(t,n){this.center=void 0!==t?t:new St,this.radius=void 0!==n?n:0}Object.assign(et.prototype,{set:function(t,n){return this.center.copy(t),this.radius=n,this},setFromPoints:function(t,n){var e=this.center;void 0!==n?e.copy(n):nt.setFromPoints(t).getCenter(e);for(var i=0,r=0,o=t.length;r<o;r++)i=Math.max(i,e.distanceToSquared(t[r]));return this.radius=Math.sqrt(i),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.center.copy(t.center),this.radius=t.radius,this},empty:function(){return this.radius<=0},containsPoint:function(t){return t.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(t){return t.distanceTo(this.center)-this.radius},intersectsSphere:function(t){var n=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=n*n},intersectsBox:function(t){return t.intersectsSphere(this)},intersectsPlane:function(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius},clampPoint:function(t,n){var e=this.center.distanceToSquared(t);return void 0===n&&(console.warn("THREE.Sphere: .clampPoint() target is now required"),n=new St),n.copy(t),e>this.radius*this.radius&&(n.sub(this.center).normalize(),n.multiplyScalar(this.radius).add(this.center)),n},getBoundingBox:function(t){return void 0===t&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),t=new $),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 it=new St,ot=new St,st=new x;function at(t,n){this.normal=void 0!==t?t:new St(1,0,0),this.constant=void 0!==n?n:0}Object.assign(at.prototype,{isPlane:!0,set:function(t,n){return this.normal.copy(t),this.constant=n,this},setComponents:function(t,n,e,i){return this.normal.set(t,n,e),this.constant=i,this},setFromNormalAndCoplanarPoint:function(t,n){return this.normal.copy(t),this.constant=-n.dot(this.normal),this},setFromCoplanarPoints:function(t,n,e){n=it.subVectors(e,n).cross(ot.subVectors(t,n)).normalize();return this.setFromNormalAndCoplanarPoint(n,t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.normal.copy(t.normal),this.constant=t.constant,this},normalize:function(){var t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(t){return this.normal.dot(t)+this.constant},distanceToSphere:function(t){return this.distanceToPoint(t.center)-t.radius},projectPoint:function(t,n){return void 0===n&&(console.warn("THREE.Plane: .projectPoint() target is now required"),n=new St),n.copy(this.normal).multiplyScalar(-this.distanceToPoint(t)).add(t)},intersectLine:function(t,n){void 0===n&&(console.warn("THREE.Plane: .intersectLine() target is now required"),n=new St);var e=t.delta(it),i=this.normal.dot(e);if(0===i)return 0===this.distanceToPoint(t.start)?n.copy(t.start):void 0;i=-(t.start.dot(this.normal)+this.constant)/i;return i<0||1<i?void 0:n.copy(e).multiplyScalar(i).add(t.start)},intersectsLine:function(t){var n=this.distanceToPoint(t.start),t=this.distanceToPoint(t.end);return n<0&&0<t||t<0&&0<n},intersectsBox:function(t){return t.intersectsPlane(this)},intersectsSphere:function(t){return t.intersectsPlane(this)},coplanarPoint:function(t){return void 0===t&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),t=new St),t.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(t,n){n=n||st.getNormalMatrix(t),t=this.coplanarPoint(it).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 ut=new et,ht=new St;function Tt(t,n,e,i,r,o){this.planes=[void 0!==t?t:new at,void 0!==n?n:new at,void 0!==e?e:new at,void 0!==i?i:new at,void 0!==r?r:new at,void 0!==o?o:new at]}Object.assign(Tt.prototype,{set:function(t,n,e,i,r,o){var s=this.planes;return s[0].copy(t),s[1].copy(n),s[2].copy(e),s[3].copy(i),s[4].copy(r),s[5].copy(o),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){for(var n=this.planes,e=0;e<6;e++)n[e].copy(t.planes[e]);return this},setFromProjectionMatrix:function(t){var n=this.planes,e=t.elements,i=e[0],r=e[1],o=e[2],s=e[3],a=e[4],u=e[5],h=e[6],c=e[7],f=e[8],l=e[9],d=e[10],v=e[11],p=e[12],m=e[13],t=e[14],e=e[15];return n[0].setComponents(s-i,c-a,v-f,e-p).normalize(),n[1].setComponents(s+i,c+a,v+f,e+p).normalize(),n[2].setComponents(s+r,c+u,v+l,e+m).normalize(),n[3].setComponents(s-r,c-u,v-l,e-m).normalize(),n[4].setComponents(s-o,c-h,v-d,e-t).normalize(),n[5].setComponents(s+o,c+h,v+d,e+t).normalize(),this},intersectsObject:function(t){var n=t.geometry;return null===n.boundingSphere&&n.computeBoundingSphere(),ut.copy(n.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(ut)},intersectsSprite:function(t){return ut.center.set(0,0,0),ut.radius=.7071067811865476,ut.applyMatrix4(t.matrixWorld),this.intersectsSphere(ut)},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(ht.x=(0<i.normal.x?t.max:t.min).x,ht.y=(0<i.normal.y?t.max:t.min).y,ht.z=(0<i.normal.z?t.max:t.min).z,i.distanceToPoint(ht)<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 ct=0,ft=1,lt=2,dt=0,vt=1,pt=2,mt=3,gt=0,yt=1,bt=2,_t=1,wt=2,xt=3,Lt=0,Rt=1,Ot=2,At=0,Ct=1,kt=2,Pt=3,Dt=4,jt=5,It=100,Nt=101,Ft=102,Ut=103,Bt=104,Gt=200,Ht=201,Vt=202,zt=203,Wt=204,Xt=205,Zt=206,Yt=207,qt=208,Kt=209,Jt=210,Qt=0,$t=1,tn=2,nn=3,en=4,rn=5,on=6,sn=7,an=0,un=1,hn=2,cn=0,fn=1,ln=2,dn=3,vn=4,pn=5,mn=301,gn=302,yn=303,bn=304,_n=305,wn=306,xn=307,Mn=1e3,Sn=1001,En=1002,Tn=1003,Ln=1004,Rn=1005,On=1006,An=1007,Cn=1008,kn=1009,Pn=1010,Dn=1011,jn=1012,In=1013,Nn=1014,Fn=1015,Un=1016,Bn=1017,Gn=1018,Hn=1019,Vn=1020,zn=1021,Wn=1022,Xn=1023,Zn=1024,Yn=1025,qn=1026,Kn=1027,Jn=1028,Qn=1029,$n=1030,te=1031,ne=1032,ee=1033,ie=33776,re=33777,oe=33778,se=33779,ae=35840,ue=35841,he=35842,ce=35843,fe=36196,le=37492,de=37496,ve=37808,pe=37809,me=37810,ge=37811,ye=37812,be=37813,_e=37814,we=37815,xe=37816,Me=37817,Se=37818,Ee=37819,Te=37820,Le=37821,Re=36492,Oe=37840,Ae=37841,Ce=37842,ke=37843,Pe=37844,De=37845,je=37846,Ie=37847,Ne=37848,Fe=37849,Ue=37850,Be=37851,Ge=37852,He=37853,Ve=2300,ze=2301,We=2400,Xe=2401,Ze=2,Ye=3e3,qe=3001,Ke=3007,Je=3002,Qe=3003,$e=3004,ti=3005,ni=3006,ei=3200,ii=3201,ri=0,oi=1,si=7680,ai=519,ui=35044;function hi(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 ci(t,n){this.x=t||0,this.y=n||0}Object.assign(hi.prototype,{set:function(t,n,e){return this.radius=t,this.phi=n,this.theta=e,this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.radius=t.radius,this.phi=t.phi,this.theta=t.theta,this},makeSafe:function(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this},setFromVector3:function(t){return this.setFromCartesianCoords(t.x,t.y,t.z)},setFromCartesianCoords:function(t,n,e){return this.radius=Math.sqrt(t*t+n*n+e*e),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(t,e),this.phi=Math.acos(Mt.clamp(n/this.radius,-1,1))),this}}),Object.defineProperties(ci.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(ci.prototype,{isVector2:!0,set:function(t,n){return this.x=t,this.y=n,this},setScalar:function(t){return this.x=t,this.y=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setComponent:function(t,n){switch(t){case 0:this.x=n;break;case 1:this.y=n;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(t){return this.x=t.x,this.y=t.y,this},add:function(t,n){return void 0!==n?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,n)):(this.x+=t.x,this.y+=t.y,this)},addScalar:function(t){return this.x+=t,this.y+=t,this},addVectors:function(t,n){return this.x=t.x+n.x,this.y=t.y+n.y,this},addScaledVector:function(t,n){return this.x+=t.x*n,this.y+=t.y*n,this},sub:function(t,n){return void 0!==n?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,n)):(this.x-=t.x,this.y-=t.y,this)},subScalar:function(t){return this.x-=t,this.y-=t,this},subVectors:function(t,n){return this.x=t.x-n.x,this.y=t.y-n.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},multiplyScalar:function(t){return this.x*=t,this.y*=t,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},divideScalar:function(t){return this.multiplyScalar(1/t)},applyMatrix3:function(t){var n=this.x,e=this.y,t=t.elements;return this.x=t[0]*n+t[3]*e+t[6],this.y=t[1]*n+t[4]*e+t[7],this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this},clamp:function(t,n){return this.x=Math.max(t.x,Math.min(n.x,this.x)),this.y=Math.max(t.y,Math.min(n.y,this.y)),this},clampScalar:function(t,n){return this.x=Math.max(t,Math.min(n,this.x)),this.y=Math.max(t,Math.min(n,this.y)),this},clampLength:function(t,n){var e=this.length();return this.divideScalar(e||1).multiplyScalar(Math.max(t,Math.min(n,e)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.x},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length()||1)},angle:function(){return Math.atan2(-this.y,-this.x)+Math.PI},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var n=this.x-t.x,t=this.y-t.y;return n*n+t*t},manhattanDistanceTo:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,n){return this.x+=(t.x-this.x)*n,this.y+=(t.y-this.y)*n,this},lerpVectors:function(t,n,e){return this.subVectors(n,t).multiplyScalar(e).add(t)},equals:function(t){return t.x===this.x&&t.y===this.y},fromArray:function(t,n){return this.x=t[n=void 0===n?0:n],this.y=t[n+1],this},toArray:function(t,n){return(t=void 0===t?[]:t)[n=void 0===n?0:n]=this.x,t[n+1]=this.y,t},fromBufferAttribute:function(t,n,e){return void 0!==e&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(n),this.y=t.getY(n),this},rotateAround:function(t,n){var e=Math.cos(n),i=Math.sin(n),r=this.x-t.x,n=this.y-t.y;return this.x=r*e-n*i+t.x,this.y=r*i+n*e+t.y,this}});function fi(t,n,e){var i,r,o,s,a,u;void 0===n&&console.warn('THREE.OrbitControls: The second parameter "domElement" is now mandatory.'),n===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),this.object=t,this.domElement=n,this.V=e,this.enabled=!0,this.useRange=!1,this.target=new St,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.25,this.enableZoom=!0,this.zoomSpeed=1,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!1,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.enableKeys=!0,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},this.mouseButtons={LEFT:ct,MIDDLE:ft,RIGHT:lt},this.touches={ONE:dt,TWO:pt},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.enableRotate=!0,this.enableRotateLeft=!0,this.enableRotateUp=!0,this.rotateLeftStart=new ci,this.rotateLeftEnd=new ci,this.getPolarAngle=function(){return m.phi},this.getAzimuthalAngle=function(){return m.theta},this.panAdd=function(t){b.add(t)},this.saveState=function(){h.target0.copy(h.target),h.position0.copy(h.object.position),h.zoom0=h.object.zoom},this.reset=function(){h.target.copy(h.target0),h.object.position.copy(h.position0),h.object.zoom=h.zoom0,h.object.updateProjectionMatrix(),h.dispatchEvent(c),h.update(),v=d.NONE},this.updateCheck=function(){this.V.W&&this.V.W.enableDragRange&&(this.V.W.X()?this.saveState():(this.reset(),this.V.W.X()||this.V.setCenter({x:e.getX(),y:e.getY()})))},this.update=(i=new St,r=(new rt).setFromUnitVectors(t.up,new St(0,1,0)),o=r.clone().inverse(),s=new St,a=new rt,u=0,function(t){var n,e=h.object.position;return i.copy(e).sub(h.target),i.applyQuaternion(r),m.setFromVector3(i),h.autoRotate&&v===d.NONE&&C(2*Math.PI/60/60*h.autoRotateSpeed),h.enableDamping?(m.theta+=g.theta*h.dampingFactor,m.phi+=g.phi*h.dampingFactor):(m.theta+=g.theta,m.phi+=g.phi),m.theta=Math.max(h.minAzimuthAngle,Math.min(h.maxAzimuthAngle,m.theta)),t&&void 0!==t.theta&&(m.theta=Math.max(h.minAzimuthAngle,Math.min(h.maxAzimuthAngle,t.theta))),m.phi=Math.max(h.minPolarAngle,Math.min(h.maxPolarAngle,m.phi)),t&&void 0!==t.phi&&(m.phi=Math.max(h.minPolarAngle,Math.min(h.maxPolarAngle,t.phi))),m.makeSafe(),m.radius*=y,m.radius=Math.max(h.minDistance,Math.min(h.maxDistance,m.radius)),this.useRange?((n=(new St).setFromMatrixPosition(h.object.matrixWorld)).add(b),n=(new Et).copy(h.object.matrixWorld).setPosition(n),n=(new Et).getInverse(n),(new Tt).setFromProjectionMatrix((new Et).multiplyMatrices(h.object.projectionMatrix,n)).intersectsSphere(h.viewSphere)&&h.target.add(b)):!0===h.enableDamping?h.target.addScaledVector(b,h.dampingFactor):h.target.add(b),i.setFromSpherical(m),i.applyQuaternion(o),t&&t.offset&&i.add(t.offset),this.useRange?((t=(new St).setFromMatrixPosition(h.object.matrixWorld)).add(i),t=(new Et).copy(h.object.matrixWorld).setPosition(t),t=(new Et).getInverse(t),(new Tt).setFromProjectionMatrix((new Et).multiplyMatrices(h.object.projectionMatrix,t)).intersectsSphere(h.viewSphere)&&e.copy(h.target).add(i)):e.copy(h.target).add(i),h.object.lookAt(h.target),!0===h.enableDamping?(g.theta*=1-h.dampingFactor,g.phi*=1-h.dampingFactor,b.multiplyScalar(1-h.dampingFactor)):(g.set(0,0,0),b.set(0,0,0)),y=1,!!(_||s.distanceToSquared(h.object.position)>p||8*(1-a.dot(h.object.quaternion))>p||u!=h.object.zoom)&&(h.dispatchEvent(c),s.copy(h.object.position),a.copy(h.object.quaternion),u=h.object.zoom,!(_=!1))}),this.dispose=function(){h.domElement.removeEventListener("contextmenu",it,!1),h.domElement.removeEventListener("mousedown",q,!1),h.domElement.removeEventListener("wheel",Q,!1),h.domElement.removeEventListener("touchstart",tt,!1),h.domElement.removeEventListener("touchend",et,!1),h.domElement.removeEventListener("touchmove",nt,!1),document.removeEventListener("mousemove",K,!1),document.removeEventListener("mouseup",J,!1),h.domElement.removeEventListener("keydown",$,!1)};var h=this,c={type:"change"},f={type:"start"},l={type:"end"},d={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},v=d.NONE,p=1e-6,m=new hi,g=new hi,y=1,b=new St,_=!1,w=new ci,x=new ci,M=new ci,S=new ci,E=new ci,T=new ci,L=new ci,R=new ci,O=new ci;function A(){return Math.pow(.95,h.zoomSpeed)}function C(t){h.enableRotateLeft&&(g.theta-=t)}function k(t){h.enableRotateUp&&(g.phi-=t)}var P,D,j=(P=new St,function(t,n){P.setFromMatrixColumn(n,0),P.multiplyScalar(-t),b.add(P)}),I=(D=new St,function(t,n){!0===h.screenSpacePanning?D.setFromMatrixColumn(n,1):(D.setFromMatrixColumn(n,0),D.crossVectors(h.object.up,D)),D.multiplyScalar(t),b.add(D)});this.panUp=function(t){var n=new St(0,1,0);n.multiplyScalar(t),b.add(n)};var N,F=(N=new St,function(t,n){var e,i=h.domElement;h.object.isPerspectiveCamera?(e=h.object.position,N.copy(e).sub(h.target),e=N.length(),e*=Math.tan(h.object.fov/2*Math.PI/180),j(2*t*e/i.clientHeight,h.object.matrix),I(2*n*e/i.clientHeight,h.object.matrix)):h.object.isOrthographicCamera?(j(t*(h.object.right-h.object.left)/h.object.zoom/i.clientWidth,h.object.matrix),I(n*(h.object.top-h.object.bottom)/h.object.zoom/i.clientHeight,h.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),h.enablePan=!1)});function U(t){h.object.isPerspectiveCamera?y/=t:h.object.isOrthographicCamera?(h.object.zoom=Math.max(h.minZoom,Math.min(h.maxZoom,h.object.zoom*t)),h.object.updateProjectionMatrix(),_=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),h.enableZoom=!1)}function B(t){h.object.isPerspectiveCamera?y*=t:h.object.isOrthographicCamera?(h.object.zoom=Math.max(h.minZoom,Math.min(h.maxZoom,h.object.zoom/t)),h.object.updateProjectionMatrix(),_=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),h.enableZoom=!1)}function G(t){w.set(t.clientX,t.clientY)}function H(t){S.set(t.clientX,t.clientY)}function V(t){var n,e;1==t.touches.length?w.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),w.set(n,e),e=t.touches[0].pageX-t.touches[1].pageX,t=t.touches[0].pageY-t.touches[1].pageY,h.rotateLeftStart.set(e,t))}function z(t){var n;1==t.touches.length?S.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),S.set(n,t))}function W(t){var n=t.touches[0].pageX-t.touches[1].pageX,t=t.touches[0].pageY-t.touches[1].pageY,t=Math.sqrt(n*n+t*t);L.set(0,t)}function X(t){var n;1==t.touches.length?x.set(t.touches[0].pageX,t.touches[0].pageY):(n=.5*(t.touches[0].pageX+t.touches[1].pageX),e=.5*(t.touches[0].pageY+t.touches[1].pageY),x.set(n,e),n=t.touches[0].pageX-t.touches[1].pageX,e=t.touches[0].pageY-t.touches[1].pageY,h.rotateLeftEnd.set(n,e),e=h.rotateLeftStart.angle(),C((-h.rotateLeftEnd.angle()+e)*h.rotateSpeed),h.rotateLeftStart.copy(h.rotateLeftEnd)),M.subVectors(x,w).multiplyScalar(h.rotateSpeed);var e=h.domElement;k(2*Math.PI*M.y/e.clientHeight),w.copy(x)}function Z(t){var n;1==t.touches.length?E.set(t.touches[0].pageX,t.touches[0].pageY):(n=.5*(t.touches[0].pageX+t.touches[1].pageX),t=.5*(t.touches[0].pageY+t.touches[1].pageY),E.set(n,t)),T.subVectors(E,S).multiplyScalar(h.panSpeed),F(T.x,T.y),S.copy(E)}function Y(t){var n;t.touches[0]&&t.touches[1]&&(n=t.touches[0].pageX-t.touches[1].pageX,t=t.touches[0].pageY-t.touches[1].pageY,t=Math.sqrt(n*n+t*t),R.set(0,t),O.set(0,Math.pow(R.y/L.y,h.zoomSpeed)),U(O.y),L.copy(R))}function q(t){if(!1!==h.enabled){switch(t.preventDefault(),(h.domElement.focus?h.domElement:window).focus(),t.button){case 0:switch(h.mouseButtons.LEFT){case ct:if(t.ctrlKey||t.metaKey||t.shiftKey){if(!1===h.enablePan)return;H(t),v=d.PAN}else{if(!1===h.enableRotate)return;G(t),v=d.ROTATE}break;case lt:if(t.ctrlKey||t.metaKey||t.shiftKey){if(!1===h.enableRotate)return;G(t),v=d.ROTATE}else{if(!1===h.enablePan)return;H(t),v=d.PAN}break;default:v=d.NONE}break;case 1:if(h.mouseButtons.MIDDLE===ft){if(!1===h.enableZoom)return;n=t,L.set(n.clientX,n.clientY),v=d.DOLLY}else v=d.NONE;break;case 2:switch(h.mouseButtons.RIGHT){case ct:if(!1===h.enableRotate)return;G(t),v=d.ROTATE;break;case lt:if(!1===h.enablePan)return;H(t),v=d.PAN;break;default:v=d.NONE}}var n;v!==d.NONE&&(document.addEventListener("mousemove",K,!1),document.addEventListener("mouseup",J,!1),h.dispatchEvent(f))}}function K(t){var n,e;if(!1!==h.enabled)switch(t.preventDefault(),v){case d.ROTATE:if(!1===h.enableRotate)return;e=t,x.set(e.clientX,e.clientY),M.subVectors(x,w).multiplyScalar(h.rotateSpeed),e=h.domElement,C(2*Math.PI*M.x/e.clientHeight),k(2*Math.PI*M.y/e.clientHeight),w.copy(x),h.update(),h.updateCheck();break;case d.DOLLY:if(!1===h.enableZoom)return;n=t,R.set(n.clientX,n.clientY),O.subVectors(R,L),0<O.y?U(A()):O.y<0&&B(A()),L.copy(R),h.update(),h.updateCheck();break;case d.PAN:if(!1===h.enablePan)return;n=t,E.set(n.clientX,n.clientY),T.subVectors(E,S).multiplyScalar(h.panSpeed),F(T.x,T.y),S.copy(E),h.update(),h.updateCheck()}}function J(t){!1!==h.enabled&&(document.removeEventListener("mousemove",K,!1),document.removeEventListener("mouseup",J,!1),h.dispatchEvent(l),v=d.NONE)}function Q(t){!1===h.enabled||!1===h.enableZoom||v!==d.NONE&&v!==d.ROTATE||(t.preventDefault(),t.stopPropagation(),h.dispatchEvent(f),(t=t).deltaY<0?B(A()):0<t.deltaY&&U(A()),h.update(),h.updateCheck(),h.dispatchEvent(l))}function $(t){!1!==h.enabled&&!1!==h.enableKeys&&!1!==h.enablePan&&function(t){var n=!1;switch(t.keyCode){case h.keys.UP:F(0,h.keyPanSpeed),n=!0;break;case h.keys.BOTTOM:F(0,-h.keyPanSpeed),n=!0;break;case h.keys.LEFT:F(h.keyPanSpeed,0),n=!0;break;case h.keys.RIGHT:F(-h.keyPanSpeed,0),n=!0}n&&(t.preventDefault(),h.update(),h.updateCheck())}(t)}function tt(t){if(!1!==h.enabled){switch(t.preventDefault(),t.touches.length){case 1:switch(h.touches.ONE){case dt:if(!1===h.enableRotate)return;V(t),v=d.TOUCH_ROTATE;break;case vt:if(!1===h.enablePan)return;z(t),v=d.TOUCH_PAN;break;default:v=d.NONE}break;case 2:switch(h.touches.TWO){case pt:if(!1===h.enableZoom&&!1===h.enablePan)return;n=t,h.enableZoom&&W(n),h.enablePan&&z(n),v=d.TOUCH_DOLLY_PAN;break;case mt:if(!1===h.enableZoom&&!1===h.enableRotate)return;n=t,h.enableZoom&&W(n),h.enableRotate&&V(n),v=d.TOUCH_DOLLY_ROTATE;break;default:v=d.NONE}break;default:v=d.NONE}var n;v!==d.NONE&&h.dispatchEvent(f)}}function nt(t){var n;if(!1!==h.enabled)switch(t.preventDefault(),t.stopPropagation(),v){case d.TOUCH_ROTATE:if(!1===h.enableRotate)return;X(t),h.update(),h.updateCheck();break;case d.TOUCH_PAN:if(!1===h.enablePan)return;Z(t),h.update(),h.updateCheck();break;case d.TOUCH_DOLLY_PAN:if(!1===h.enableZoom&&!1===h.enablePan)return;n=t,h.enableZoom&&Y(n),h.enablePan&&Z(n),h.update(),h.updateCheck();break;case d.TOUCH_DOLLY_ROTATE:if(!1===h.enableZoom&&!1===h.enableRotate)return;n=t,h.enableZoom&&Y(n),h.enableRotate&&X(n),h.update(),h.updateCheck();break;default:v=d.NONE}}function et(t){!1!==h.enabled&&(h.dispatchEvent(l),v=d.NONE)}function it(t){!1!==h.enabled&&t.preventDefault()}this.dollyIn=U,this.dollyOut=B,h.domElement.addEventListener("contextmenu",it,!1),h.domElement.addEventListener("mousedown",q,!1),h.domElement.addEventListener("wheel",Q,!1),h.domElement.addEventListener("touchstart",tt,!1),h.domElement.addEventListener("touchend",et,!1),h.domElement.addEventListener("touchmove",nt,!1),h.domElement.addEventListener("keydown",$,!1),-1===h.domElement.tabIndex&&(h.domElement.tabIndex=0),this.update(),this.updateCheck(),this.removeEvent=function(){h.domElement.removeEventListener("contextmenu",it,!1),h.domElement.removeEventListener("mousedown",q,!1),h.domElement.removeEventListener("wheel",Q,!1),h.domElement.removeEventListener("touchstart",tt,!1),h.domElement.removeEventListener("touchend",et,!1),h.domElement.removeEventListener("touchmove",nt,!1),h.domElement.removeEventListener("keydown",$,!1),document.removeEventListener("mousemove",K,!1),document.removeEventListener("mouseup",J,!1)}}(fi.prototype=Object.create(g.prototype)).constructor=fi;var li=function(t,n,e){fi.call(this,t,n,e),this.mouseButtons.LEFT=lt,this.mouseButtons.RIGHT=ct,this.touches.ONE=vt,this.touches.TWO=mt};li.prototype=Object.create(g.prototype),li.prototype.constructor=li,Object.assign(li.prototype,{dispose:function(){this.removeEvent(),this.object=null,this.domElement=null,this.V=null}});var di={FOV:35,CAMERA_NEAR:1,CAMERA_FAR:1e5,ZOOM_UPPER_BOUND:30,TILT_UPPER_BOUND:90,THOUSAND:1e3,DEG2RAD:.0174532,RAD2DEG:57.2957795,DRAW_TIME:500,EPS:.001};Object.freeze(di);var vi=di,pi={MODE_3D:2,MODE_2D:4};Object.freeze(pi);var mi=pi,gi={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},yi={h:0,s:0,l:0},bi={h:0,s:0,l:0};function _i(t,n,e){return void 0===n&&void 0===e?this.set(t):this.setRGB(t,n,e)}function wi(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 xi(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function Mi(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}function Si(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}Object.assign(_i.prototype,{isColor:!0,r:1,g:1,b:1,set:function(t){return t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t),this},setScalar:function(t){return this.r=t,this.g=t,this.b=t,this},setHex:function(t){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,this},setRGB:function(t,n,e){return this.r=t,this.g=n,this.b=e,this},setHSL:function(t,n,e){return t=Mt.euclideanModulo(t,1),n=Mt.clamp(n,0,1),e=Mt.clamp(e,0,1),0===n?this.r=this.g=this.b=e:(this.r=wi(n=2*e-(e=e<=.5?e*(1+n):e+n-e*n),e,t+1/3),this.g=wi(n,e,t),this.b=wi(n,e,t-1/3)),this},setStyle:function(n){function t(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+n+" will be ignored.")}if(u=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(n)){var e,i=u[1],r=u[2];switch(i){case"rgb":case"rgba":if(e=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(r))return this.r=Math.min(255,parseInt(e[1],10))/255,this.g=Math.min(255,parseInt(e[2],10))/255,this.b=Math.min(255,parseInt(e[3],10))/255,t(e[5]),this;if(e=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(r))return this.r=Math.min(100,parseInt(e[1],10))/100,this.g=Math.min(100,parseInt(e[2],10))/100,this.b=Math.min(100,parseInt(e[3],10))/100,t(e[5]),this;break;case"hsl":case"hsla":if(e=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(r)){var o=parseFloat(e[1])/360,s=parseInt(e[2],10)/100,a=parseInt(e[3],10)/100;return t(e[5]),this.setHSL(o,s,a)}}}else if(u=/^\#([A-Fa-f0-9]+)$/.exec(n)){var i=u[1],u=i.length;if(3===u)return this.r=parseInt(i.charAt(0)+i.charAt(0),16)/255,this.g=parseInt(i.charAt(1)+i.charAt(1),16)/255,this.b=parseInt(i.charAt(2)+i.charAt(2),16)/255,this;if(6===u)return this.r=parseInt(i.charAt(0)+i.charAt(1),16)/255,this.g=parseInt(i.charAt(2)+i.charAt(3),16)/255,this.b=parseInt(i.charAt(4)+i.charAt(5),16)/255,this}return n&&0<n.length?this.setColorName(n):this},setColorName:function(t){var n=gi[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=xi(t.r),this.g=xi(t.g),this.b=xi(t.b),this},copyLinearToSRGB:function(t){return this.r=Mi(t.r),this.g=Mi(t.g),this.b=Mi(t.b),this},convertSRGBToLinear:function(){return this.copySRGBToLinear(this),this},convertLinearToSRGB:function(){return this.copyLinearToSRGB(this),this},getHex:function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(t){void 0===t&&(console.warn("THREE.Color: .getHSL() target is now required"),t={h:0,s:0,l:0});var n,e=this.r,i=this.g,r=this.b,o=Math.max(e,i,r),s=Math.min(e,i,r),a=(s+o)/2;if(s===o)h=n=0;else{var u=o-s,h=a<=.5?u/(o+s):u/(2-o-s);switch(o){case e:n=(i-r)/u+(i<r?6:0);break;case i:n=(r-e)/u+2;break;case r:n=(e-i)/u+4}n/=6}return t.h=n,t.s=h,t.l=a,t},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:function(t,n,e){return this.getHSL(yi),yi.h+=t,yi.s+=n,yi.l+=e,this.setHSL(yi.h,yi.s,yi.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(yi),t.getHSL(bi);var e=Mt.lerp(yi.h,bi.h,n),t=Mt.lerp(yi.s,bi.s,n),n=Mt.lerp(yi.l,bi.l,n);return this.setHSL(e,t,n),this},equals:function(t){return t.r===this.r&&t.g===this.g&&t.b===this.b},fromArray:function(t,n){return this.r=t[n=void 0===n?0:n],this.g=t[n+1],this.b=t[n+2],this},toArray:function(t,n){return(t=void 0===t?[]:t)[n=void 0===n?0:n]=this.r,t[n+1]=this.g,t[n+2]=this.b,t}}),_i.NAMES=gi;var Ei=function(){function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t)}var n,e,i;return n=t,i=[{key:"round",value:function(t){return 0<t.toFixed(2)?Math.ceil(t.toFixed(2)):Math.floor(t.toFixed(2))}},{key:"generateUUID",value:function(){for(var t=[],n=0;n<256;n++)t[n]=(n<16?"0":"")+n.toString(16);var e=4294967295*Math.random()|0,i=4294967295*Math.random()|0,r=4294967295*Math.random()|0,o=4294967295*Math.random()|0,o=t[255&e]+t[e>>8&255]+t[e>>16&255]+t[e>>24&255]+"-"+t[255&i]+t[i>>8&255]+"-"+t[i>>16&15|64]+t[i>>24&255]+"-"+t[63&r|128]+t[r>>8&255]+"-"+t[r>>16&255]+t[r>>24&255]+t[255&o]+t[o>>8&255]+t[o>>16&255]+t[o>>24&255];return t.length=0,o.toUpperCase()}},{key:"findNearNthPowerOfTwo",value:function(t){t-=1;return t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,(t|=t>>16)<0?1:1+t}},{key:"toRgba",value:function(t){if(void 0===t)return t;if("number"==typeof t)return"rgba("+parseInt(255*new _i(t).r)+","+parseInt(255*new _i(t).g)+","+parseInt(255*new _i(t).b)+",1)";var n=t.split(",");return 3<=n.length?"rgba("+parseInt(n[0])+","+parseInt(n[1])+","+parseInt(n[2])+",1)":t}},{key:"toColor",value:function(t){if("number"==typeof t)return t;var n=t.split(",");return 3<=n.length?parseInt(n[0])<<16|parseInt(n[1])<<8|parseInt(n[2]):(console.error("color format error",t),0)}}],(e=null)&&Si(n.prototype,e),i&&Si(n,i),t}();function Ti(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var Li=function(){function n(t){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,n),this.Z=(t=t||{}).src,this.Y=t.dest,this.K=null,this.J=[],this.Q=0,this.$=0,this.tt=0,this.nt=vi.THOUSAND,this.et=!1,this.it=!1,this.rt=!1,this.ot=null,this.st=null,this.ut=Ei.generateUUID()}var t,e,i;return t=n,(e=[{key:"play",value:function(){return this.ht()}},{key:"pause",value:function(){return this.it=!0,this}},{key:"resume",value:function(){return this.it=!1,this.Q+=this.tt,this.tt=0,this}},{key:"stop",value:function(){return this.rt=!0,this}},{key:"finish",value:function(){return this.rt=!0,this.st&&this.st(),this.J=[],this}}])&&Ti(t.prototype,e),i&&Ti(t,i),n}();Object.assign(Li.prototype,{ct:function(){for(var t in this)this[""+t]=null,delete this[""+t]},ft:function(t){return this.Z=t,this},lt:function(t){return this.Y=t,this},dt:function(t){return this.nt=t*vi.THOUSAND,this},vt:function(t){return this.$=t*vi.THOUSAND,this},pt:function(t){return this.ot=t,this},mt:function(t){return this.st=t,this},gt:function(t){return this.et=t,this},ht:function(){return this.rt=!1,this.K&&(this.Q=this.K.yt),this},bt:function(){var t=new this.constructor({src:this.Z,dest:this.Y});return t.Q=this.Q,t.$=this.$,t.nt=this.nt,t.et=this.et,t.ot=this.ot,t.st=this.st,t},_t:function(){var t=this.Y.concat(),n=this.Z.concat();return this.Z=t,this.Y=n,this}});var Ri=Li,Oi={RIGHT:2,LEFT:4,BOTTOM:8,TOP:16,RIGHT_BOTTOM:32,LEFT_BOTTOM:64,RIGHT_TOP:128,LEFT_TOP:256,CENTER:512};Object.freeze(Oi);var Ai=Oi;function Ci(t,n,e,i){this.x=t||0,this.y=n||0,this.z=e||0,this.w=void 0!==i?i:1}function ki(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}Object.defineProperties(Ci.prototype,{width:{get:function(){return this.z},set:function(t){this.z=t}},height:{get:function(){return this.w},set:function(t){this.w=t}}}),Object.assign(Ci.prototype,{isVector4:!0,set:function(t,n,e,i){return this.x=t,this.y=n,this.z=e,this.w=i,this},setScalar:function(t){return this.x=t,this.y=t,this.z=t,this.w=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setW:function(t){return this.w=t,this},setComponent:function(t,n){switch(t){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;case 3:this.w=n;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this},add:function(t,n){return void 0!==n?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,n)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this},addVectors:function(t,n){return this.x=t.x+n.x,this.y=t.y+n.y,this.z=t.z+n.z,this.w=t.w+n.w,this},addScaledVector:function(t,n){return this.x+=t.x*n,this.y+=t.y*n,this.z+=t.z*n,this.w+=t.w*n,this},sub:function(t,n){return void 0!==n?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,n)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this},subVectors:function(t,n){return this.x=t.x-n.x,this.y=t.y-n.y,this.z=t.z-n.z,this.w=t.w-n.w,this},multiplyScalar:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},applyMatrix4:function(t){var n=this.x,e=this.y,i=this.z,r=this.w,t=t.elements;return this.x=t[0]*n+t[4]*e+t[8]*i+t[12]*r,this.y=t[1]*n+t[5]*e+t[9]*i+t[13]*r,this.z=t[2]*n+t[6]*e+t[10]*i+t[14]*r,this.w=t[3]*n+t[7]*e+t[11]*i+t[15]*r,this},divideScalar:function(t){return this.multiplyScalar(1/t)},setAxisAngleFromQuaternion:function(t){this.w=2*Math.acos(t.w);var n=Math.sqrt(1-t.w*t.w);return n<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/n,this.y=t.y/n,this.z=t.z/n),this},setAxisAngleFromRotationMatrix:function(t){var n,e,i,r=t.elements,o=r[0],s=r[4],a=r[8],u=r[1],h=r[5],c=r[9],f=r[2],l=r[6],d=r[10];if(Math.abs(s-u)<.01&&Math.abs(a-f)<.01&&Math.abs(c-l)<.01){if(Math.abs(s+u)<.1&&Math.abs(a+f)<.1&&Math.abs(c+l)<.1&&Math.abs(o+h+d-3)<.1)return this.set(1,0,0,0),this;var v=Math.PI,p=(o+1)/2,m=(h+1)/2,g=(d+1)/2,y=(s+u)/4,t=(a+f)/4,r=(c+l)/4;return m<p&&g<p?i=p<.01?(n=0,e=.707106781):(e=y/(n=Math.sqrt(p)),t/n):g<m?i=m<.01?(e=0,n=.707106781):(n=y/(e=Math.sqrt(m)),r/e):g<.01?(e=n=.707106781,i=0):(n=t/(i=Math.sqrt(g)),e=r/i),this.set(n,e,i,v),this}v=Math.sqrt((l-c)*(l-c)+(a-f)*(a-f)+(u-s)*(u-s));return Math.abs(v)<.001&&(v=1),this.x=(l-c)/v,this.y=(a-f)/v,this.z=(u-s)/v,this.w=Math.acos((o+h+d-1)/2),this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this},clamp:function(t,n){return this.x=Math.max(t.x,Math.min(n.x,this.x)),this.y=Math.max(t.y,Math.min(n.y,this.y)),this.z=Math.max(t.z,Math.min(n.z,this.z)),this.w=Math.max(t.w,Math.min(n.w,this.w)),this},clampScalar:function(t,n){return this.x=Math.max(t,Math.min(n,this.x)),this.y=Math.max(t,Math.min(n,this.y)),this.z=Math.max(t,Math.min(n,this.z)),this.w=Math.max(t,Math.min(n,this.w)),this},clampLength:function(t,n){var e=this.length();return this.divideScalar(e||1).multiplyScalar(Math.max(t,Math.min(n,e)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,n){return this.x+=(t.x-this.x)*n,this.y+=(t.y-this.y)*n,this.z+=(t.z-this.z)*n,this.w+=(t.w-this.w)*n,this},lerpVectors:function(t,n,e){return this.subVectors(n,t).multiplyScalar(e).add(t)},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w},fromArray:function(t,n){return this.x=t[n=void 0===n?0:n],this.y=t[n+1],this.z=t[n+2],this.w=t[n+3],this},toArray:function(t,n){return(t=void 0===t?[]:t)[n=void 0===n?0:n]=this.x,t[n+1]=this.y,t[n+2]=this.z,t[n+3]=this.w,t},fromBufferAttribute:function(t,n,e){return void 0!==e&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(n),this.y=t.getY(n),this.z=t.getZ(n),this.w=t.getW(n),this}});var Pi=function(){function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t)}var n,e,i;return n=t,i=[{key:"convertPointCoordsByCenter",value:function(t,n){return t.x=t.x-n.x,t.y=t.y-n.y,void 0!==t.z&&void 0!==n.z&&(t.z=t.z-n.z),t}},{key:"convertPointsCoordsByCenter",value:function(t,n){for(var e=0;e<t.length;e++)this.convertPointCoordsByCenter(t[e],n);return t}},{key:"getMapScaleInfo",value:function(){var t,n;return window.screen.deviceXDPI?t=window.screen.deviceXDPI:((n=document.createElement("DIV")).style.cssText="width:1in;height:1in;position:absolute;left:0px;top:0px;z-index:99;visibility:hidden",document.body.appendChild(n),t=parseInt(n.offsetWidth),n.parentNode.removeChild(n)),t/2.54}},{key:"getCenterByAnchor",value:function(t){var n=new ci(.5,.5);switch(t){case Ai.LEFT:n.setX(0);break;case Ai.RIGHT:n.setX(1);break;case Ai.TOP:n.setY(1);break;case Ai.BOTTOM:n.setY(0);break;case Ai.LEFT_TOP:n.set(0,1);break;case Ai.RIGHT_TOP:n.set(1,1);break;case Ai.LEFT_BOTTOM:n.set(0,0);break;case Ai.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)&&ki(n.prototype,e),i&&ki(n,i),t}(),Di={NONE:0,EXTRUDE_MARKER:2,IMAGE_MARKER:8,LOCATION_MARKER:16,POLYGON_MARKER:32,TEXT_MARKER:64,LINE_MARKER:128,HEAT_MAP_MARKER:512,EXTENT:1024,EXTERNAL_MODEL:2048,MODEL:4096,FACILITY:8192,LABEL:16384,DYNAMIC_MODEL_MARKER:32768,DOM_MARKER:65536,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};function ji(t){return function(t){if(Array.isArray(t))return Ii(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,n){if(t){if("string"==typeof t)return Ii(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(e="Object"===e&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Ii(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 Ii(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 Ni(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var Fi=function(){function r(t,n,e){var i=this;!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),this.K=t,this.V=t,this.wt=e,this.xt=[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.Mt=[],this.St=new Map,this.Et=null,this.Tt=this.wt.Lt,this.Rt=this.wt.Ot,this.At=null,this.Ct=new li(this.V.kt,n,this.V),this.Ct.addEventListener("change",function(t){i.st(),i.V.Dt.Pt({target:t.target,type:"viewChanged"})});n=!this.V.jt.lock;this.Ct.enableZoom=n,this.Ct.enablePan=n,this.Ct.enableRotate=n,this.Ct.enableRotateLeft=n,this.Ct.enableRotateUp=n,this.It=n,this.Nt=n,this.Ft=n,this.Ut=n,this.Bt=this.Ct.useRange}var t,n,e;return t=r,(n=[{key:"enableZoom",get:function(){return this.It},set:function(t){this.It=t,this.Ct.enableZoom=t}},{key:"enableDragRange",get:function(){return this.Bt},set:function(t){this.Bt=t}},{key:"enableDrag",get:function(){return this.Nt},set:function(t){this.Nt=t,this.Ct.enablePan=t}},{key:"enableRotate",get:function(){return this.Ft},set:function(t){this.Ft=t,this.Ct.enableRotateLeft=t}},{key:"enableTilt",get:function(){return this.Ut},set:function(t){this.Ut=t,this.Ct.enableRotateUp=t}},{key:"controls",get:function(){return this.Ct},set:function(t){this.Ct=t}},{key:"copyControls",value:function(t){t=new li(t,this.Ct.domElement,this.V);return t.target=(new St).copy(this.Ct.target),t.maxDistance=this.Ct.maxDistance,t.minDistance=this.Ct.minDistance,t.minZoom=this.Ct.minZoom,t.maxZoom=this.Ct.maxZoom,t.minPolarAngle=this.Ct.minPolarAngle,t.maxPolarAngle=this.Ct.maxPolarAngle,t.update({theta:this.Ct.getAzimuthalAngle()}),t}}])&&Ni(t.prototype,n),e&&Ni(t,e),r}();Object.assign(Fi.prototype,{ct:function(){for(var t in this.Ct.dispose(),this)this[""+t]=null,delete this[""+t]},Gt:function(){var t,n,e=this.Ht(this.wt.zoom),i=this.Vt(e),r=this.wt.zt;r.y=this.V.Zt.Xt(this.K.Yt[0],this.wt.Lt).Wt,this.Ct.target=(new St).copy(r),this.Ct.object.lookAt(r),this.qt(),this.wt.Ot===mi.MODE_3D?(n=(vi.TILT_UPPER_BOUND-this.wt.Kt)*vi.DEG2RAD,t=i*Math.cos(n),n=i*Math.sin(n),this.Ct.object.position.set(r.x,r.y+t,r.z+n),this.Ct.minPolarAngle=(vi.TILT_UPPER_BOUND-this.V.jt.maxTiltAngle)*vi.DEG2RAD,this.Ct.maxPolarAngle=(vi.TILT_UPPER_BOUND-this.V.jt.minTiltAngle)*vi.DEG2RAD):(o=this.Jt(e),this.Ct.minPolarAngle=0,this.Ct.maxPolarAngle=0,this.Ct.object.position.set(r.x,r.y+i,r.z),this.Ct.object.zoom=1/o,this.Ct.object.updateProjectionMatrix());var o=this.Qt(this.wt.$t);this.Ct.update({theta:this.Ct.getAzimuthalAngle()+o})},tn:function(t){this.Ct.target=t,this.Ct.update()},nn:function(e){var i,t,n,r=this;this.Rt!==e.mode?(this.Rt=e.mode,i=this.Ct,this.At&&!1===this.At.rt&&this.At.finish(),e.mode===mi.MODE_2D?(i.minPolarAngle=-90*vi.DEG2RAD,this.en({animate:void 0===e.animate||e.animate,duration:1,tilt:90,finish:function(){i.maxPolarAngle=0;var t=r.K.in,n=r.rn(),n=r.Jt(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.K.kt=t,r.K.an.sn(),e.finish&&e.finish(),r.K.Dt.Pt({type:"viewModeChanged"})}})):e.mode===mi.MODE_3D&&(i.maxPolarAngle=(vi.TILT_UPPER_BOUND-this.K.jt.minTiltAngle)*vi.DEG2RAD,t=this.K.un,n=this.hn(),n=this.Vt(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.K.kt=t,this.K.an.sn(),this.en({animate:void 0===e.animate||e.animate,duration:1,tilt:this.wt.Kt,finish:e.finish}),this.K.Dt.Pt({type:"viewModeChanged"}))):e.mode===this.K.getViewMode()&&e.finish&&e.finish()},en:function(t){var n,e=this,i=this.Ct,r=t.finish;"animate"in t&&!t.animate?(i.update({phi:(vi.TILT_UPPER_BOUND-t.tilt)*vi.DEG2RAD}),i.update(),r&&r()):(null===this.At&&(this.At=new Ri),n=Number.isFinite(t.duration)?t.duration:.5,this.At.ft([this.K.getTilt()]).lt([t.tilt]).dt(n).pt(function(t){i.update({phi:(vi.TILT_UPPER_BOUND-t.destination[0])*vi.DEG2RAD})}).mt(function(){i.update({phi:(vi.TILT_UPPER_BOUND-t.tilt)*vi.DEG2RAD}),i.update(),e.K.ln.cn(e.At),r&&r()}),this.K.ln.dn(this.At.ht()))},vn:function(t){var n=this,t=this.K.getZoom()*t,e=new Ri({src:[this.K.getZoom()],dest:[t]});t>this.wt.pn[1]||t<this.wt.pn[0]||(e.dt(.5).pt(function(t){return n.K.setZoom({animate:!1,zoom:t.destination[0]})}).mt(function(){return n.K.ln.cn(e)}),this.K.ln.dn(e.ht()))},mn:function(){var t=this.V.kt.isPerspectiveCamera?this.rn():this.hn();return this.gn(t)},yn:function(t){var n=this;this.wt.zoom=t.zoom;var e,i,r,o,s=Number.isFinite(t.duration)?t.duration:.5,a=this.Ht(this.wt.zoom),u=this.Vt(a);this.V.kt.isPerspectiveCamera?(r=this.Ct.object.position.distanceTo(this.Ct.target),e=(new St).copy(this.Ct.object.position).sub(this.Ct.target).normalize(),r=(new St).copy(e).multiplyScalar(u-r),"animate"in t&&!t.animate?(this.Ct.update({offset:r}),t.finish&&t.finish()):((i=new Ri({src:[0,0,0],dest:[r.x,r.y,r.z]})).dt(s).pt(function(t){n.Ct.update({offset:new St(t.delta[0],t.delta[1],t.delta[2])})}).mt(function(){n.V.ln.cn(i),t.finish&&t.finish()}),this.K.ln.dn(i.ht()))):"animate"in t&&!t.animate?(r=this.Jt(a),this.V.kt.zoom=1/r,this.V.kt.updateProjectionMatrix(),this.Ct.update(),this.K.an.sn(),t.finish&&t.finish()):((o=new Ri({src:[this.hn()],dest:[a]})).dt(s).pt(function(t){t=n.Jt(t.destination[0]);n.V.kt.zoom=1/t,n.V.kt.updateProjectionMatrix(),n.Ct.update(),n.K.an.sn()}).mt(function(){n.K.ln.cn(o),t.finish&&t.finish()}),this.K.ln.dn(o.ht()))},bn:function(t){this.wt.pn=t,this.qt(),this.Ct.update()},qt:function(){var t=this.Ht(this.wt.pn[0]),n=this.Ht(this.wt.pn[1]);this.Ct.maxDistance=this.Vt(t),this.Ct.minDistance=this.Vt(n),this.Ct.minZoom=1/this.Jt(t),this.Ct.maxZoom=1/this.Jt(n)},_n:function(){var t=this.Ct.target,n=this.K.Mt[0];return{x:parseFloat((n.x+t.x).toFixed(4)),y:parseFloat((n.y-t.z).toFixed(4))}},wn:function(t){var n,e,i,r=this,o=this.Ct,s=this.K.Mt[0],a=t.x-s.x,u=-t.y+s.y,h=o.target.x,c=o.target.z,s=t.height;!!s&&Number.isFinite(s)?(e=o.target.y,n=s):e=n=0,"animate"in t&&t.animate?(s=Number.isFinite(t.duration)?t.duration:.5,(i=new Ri({src:[h,e,c],dest:[a,n,u]})).dt(s).pt(function(t){o.panAdd({x:t.delta[0],y:t.delta[1],z:t.delta[2]}),o.update(),r.K.an.sn()}).mt(function(){r.K.ln.cn(i),r.K.an.sn(),t.finish&&t.finish()}),this.K.ln.dn(i.ht())):(o.panAdd({x:a-h,y:n-e,z:u-c}),o.update(),t.finish&&t.finish(),this.K.an.sn())},xn:function(t){var n=this;this.Tt!==t.level?(this.Tt=t.level,-1<this.wt.Mn.indexOf(t.level)?this.Sn(t):(this.wt.Mn.length<=1?this.wt.Mn=[t.level]:this.wt.Mn.push(t.level),this.V.setVisibleLevels(this.wt.Mn,function(){n.Tt===t.level?n.Sn(t):(n.V.Dt.Pt({type:"levelChanged",level:t.level}),t.callback&&t.callback(null),t.finish&&t.finish(t.level))}))):this.wt.Lt===this.Tt&&t.finish&&t.finish()},Sn:function(t){function n(){e.wt.Lt=t.level,e.V.an.En(),e.V.jt.nonFocusAlphaMode&&e.V.Zt.Tn(),i.panUp(o-i.target.y),i.update(),e.V.Dt.Pt({type:"levelChanged",level:t.level}),e.enableDragRange&&i.saveState(),t.finish&&t.finish(t.level),e.V.an.Ln(e.K.getZoom()),e.V.an.sn()}var e=this,i=this.Ct,r=i.target.y,o=this.V.Zt.Xt(this.V.Yt[0],t.level).Wt,s=void 0!==t.duration?t.duration:.5;"animate"in t&&!t.animate?(i.panUp(o-r),i.update(),n(),t.callback&&t.callback(null)):(null===this.Et&&(this.Et=new Ri),this.Et.ft([r]).lt([o]).dt(s).pt(function(t){i.panUp(t.delta[0]),i.update()}).mt(function(){n()}),this.V.ln.dn(this.Et.ht()),t.callback&&t.callback(this.Et))},Rn:function(){var t=Ei.round(-this.Ct.getAzimuthalAngle()*vi.RAD2DEG);return 360<(t=t<0?360+t:t)&&(t%=360),t},Qt:function(t){t=-t%360*vi.DEG2RAD-this.Ct.getAzimuthalAngle();return t=0!==t?Math.sin(t)/Math.abs(Math.sin(t))*Math.acos(Math.cos(t)):t},On:function(t){var n,e=this,i=this.Qt(t.rotation),r=this.Ct.getAzimuthalAngle(),o=r+i;"animate"in t&&!t.animate?(this.Ct.update({theta:o}),t.finish&&t.finish()):(i=t&&t.duration&&Number.isFinite(t.duration)?t.duration:.5,(n=new Ri({src:[r],dest:[o]})).dt(i).pt(function(t){e.Ct.update({theta:t.destination[0]})}).mt(function(){e.K.ln.cn(n),t.finish&&t.finish()}),this.K.ln.dn(n.ht()))},An:function(t){var e=this,n=t&&t.duration&&Number.isFinite(t.duration)?t.duration:5,t=new Ri({src:[0],dest:[2*Math.PI]});return t.dt(n).gt(!0).pt(function(n){e.V.an.Cn.forEach(function(t){return t.rotation.y=n.destination[0]}),e.wt.kn=n.destination[0],e.V.enableUpdateRender(),e.V.Dt.Pt({type:"autoRotate",autoRotate:e.wt.kn})}),this.V.ln.dn(t.ht()),this.St.set("autoRotate",t),t},Pn:function(){this.V.ln.cn(this.V.W.St.get("autoRotate")),this.V.W.St.delete("autoRotate")},dn:function(t){var n;(n=this.Mt).push.apply(n,ji(t))},st:function(){for(var t=0;t<this.Mt.length;t++)this.Mt[t].call(this.K.an)},Ht:function(t){var n=this.xt.length-1;--t,t=Math.max(0,Math.min(t,n));var e=Math.floor(t),i=t-e,t=Math.max(0,Math.min(e,n)),n=Math.max(0,Math.min(e+1,n)),n=this.xt[t]-this.xt[n];return this.xt[e]-n*i},gn:function(t){for(var n=0,e=.1,i=!1,r=0;r<this.xt.length-1;r++)if(t<=this.xt[r]&&t>this.xt[r+1]){e=(this.xt[n=r]-t)/(this.xt[r]-this.xt[r+1]),i=!0;break}var o;return i?parseFloat((n+1+e).toFixed(2)):(o=this.xt.length-1,t<this.xt[o]?1+o:1)},Vt:function(t){return t/100*(this.V.an.renderer.domElement.clientHeight/Pi.getMapScaleInfo())/2/Math.tan(vi.FOV/2*vi.DEG2RAD)},rn:function(){return(new St).copy(this.Ct.object.position).sub(this.Ct.target).length()*(100*Math.tan(vi.FOV/2*vi.DEG2RAD)*2/(this.V.an.renderer.domElement.clientHeight/Pi.getMapScaleInfo()))},hn:function(){var t=this.V.kt.top,n=this.V.kt.bottom;return Math.abs(t-n)*Pi.getMapScaleInfo()*100/this.V.an.renderer.domElement.clientHeight/this.V.kt.zoom},Jt:function(t){var n=this.V.in.top,e=this.V.in.bottom;return t/(Math.abs(n-e)*Pi.getMapScaleInfo()*100/this.V.an.renderer.domElement.clientHeight)},X:function(){try{var t=!1,n=this.V.camera,e=this.V.getFloor(this.V.getLevel()).getLayers(Di.EXTENT_LAYER)[0],i=new Tt;if(i.setFromProjectionMatrix((new Et).multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse)),this.V.jt.panRangeValue){for(var r=null,o=0;o<e.Mt.length;o++)e.Mt[o].Dn&&(r=e.Mt[o].Dn);if(null===r)return!1;var s=r.geometry.boundingSphere,a=new et;a.copy(s).applyMatrix4(r.matrixWorld);var u=this.V.jt.panRangeValue,h=new et(new St(u.center.x-this.V.getX(),a.center.y,this.V.getY()-u.center.y),u.radius);return i.intersectsSphere(h)}for(var c=0;c<e.Mt.length;c++){var f=e.Mt[c].Dn;if(f){var l=f.geometry.boundingSphere,d=new et;if(d.copy(l).applyMatrix4(f.matrixWorld),d.radius=.5*d.radius,i.intersectsSphere(d)){t=!0;break}}}return t}catch(t){return!0}}});var Ui=Fi,Bi=new St,Gi=new St,Hi=new St,Vi=new St,zi=new St,Wi=new St,Xi=new St;function Zi(t,n){this.origin=void 0!==t?t:new St,this.direction=void 0!==n?n:new St(0,0,-1)}function Yi(t,n,e,i){this.ray=new Zi(t,n),this.near=e||0,this.far=i||1/0,this.camera=null,this.layers=new w,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}},Object.defineProperties(this.params,{PointCloud:{get:function(){return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),this.Points}}})}function qi(t,n){return t.distance-n.distance}function Ki(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++)Ki(r[o],n,e,!0)}Object.assign(Zi.prototype,{set:function(t,n){return this.origin.copy(t),this.direction.copy(n),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this},at:function(t,n){return void 0===n&&(console.warn("THREE.Ray: .at() target is now required"),n=new St),n.copy(this.direction).multiplyScalar(t).add(this.origin)},lookAt:function(t){return this.direction.copy(t).sub(this.origin).normalize(),this},recast:function(t){return this.origin.copy(this.at(t,Bi)),this},closestPointToPoint:function(t,n){void 0===n&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),n=new St),n.subVectors(t,this.origin);t=n.dot(this.direction);return t<0?n.copy(this.origin):n.copy(this.direction).multiplyScalar(t).add(this.origin)},distanceToPoint:function(t){return Math.sqrt(this.distanceSqToPoint(t))},distanceSqToPoint:function(t){var n=Bi.subVectors(t,this.origin).dot(this.direction);return n<0?this.origin.distanceToSquared(t):(Bi.copy(this.direction).multiplyScalar(n).add(this.origin),Bi.distanceToSquared(t))},distanceSqToSegment:function(t,n,e,i){Gi.copy(t).add(n).multiplyScalar(.5),Hi.copy(n).sub(t).normalize(),Vi.copy(this.origin).sub(Gi);var r,o,s=.5*t.distanceTo(n),a=-this.direction.dot(Hi),u=Vi.dot(this.direction),h=-Vi.dot(Hi),c=Vi.lengthSq(),t=Math.abs(1-a*a);return c=0<t?(o=a*u-h,n=s*t,0<=(r=a*h-u)?-n<=o?o<=n?(r*=t=1/t)*(r+a*(o*=t)+2*u)+o*(a*r+o+2*h)+c:(o=s,-(r=Math.max(0,-(a*o+u)))*r+o*(o+2*h)+c):(o=-s,-(r=Math.max(0,-(a*o+u)))*r+o*(o+2*h)+c):o<=-n?-(r=Math.max(0,-(-a*s+u)))*r+(o=0<r?-s:Math.min(Math.max(-s,-h),s))*(o+2*h)+c:o<=n?(r=0,(o=Math.min(Math.max(-s,-h),s))*(o+2*h)+c):-(r=Math.max(0,-(a*s+u)))*r+(o=0<r?s:Math.min(Math.max(-s,-h),s))*(o+2*h)+c):(o=0<a?-s:s,-(r=Math.max(0,-(a*o+u)))*r+o*(o+2*h)+c),e&&e.copy(this.direction).multiplyScalar(r).add(this.origin),i&&i.copy(Hi).multiplyScalar(o).add(Gi),c},intersectSphere:function(t,n){Bi.subVectors(t.center,this.origin);var e=Bi.dot(this.direction),i=Bi.dot(Bi)-e*e,t=t.radius*t.radius;if(t<i)return null;t=Math.sqrt(t-i),i=e-t,t=e+t;return i<0&&t<0?null:i<0?this.at(t,n):this.at(i,n)},intersectsSphere:function(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius},distanceToPlane:function(t){var n=t.normal.dot(this.direction);if(0===n)return 0===t.distanceToPoint(this.origin)?0:null;n=-(this.origin.dot(t.normal)+t.constant)/n;return 0<=n?n:null},intersectPlane:function(t,n){t=this.distanceToPlane(t);return null===t?null:this.at(t,n)},intersectsPlane:function(t){var n=t.distanceToPoint(this.origin);return 0===n||t.normal.dot(this.direction)*n<0},intersectBox:function(t,n){var e,i,r,o=1/this.direction.x,s=1/this.direction.y,a=1/this.direction.z,u=this.origin,o=0<=o?(e=(t.min.x-u.x)*o,(t.max.x-u.x)*o):(e=(t.max.x-u.x)*o,(t.min.x-u.x)*o),s=0<=s?(i=(t.min.y-u.y)*s,(t.max.y-u.y)*s):(i=(t.max.y-u.y)*s,(t.min.y-u.y)*s);return s<e||o<i?null:((s<o||o!=o)&&(o=s),(a=0<=a?(r=(t.min.z-u.z)*a,(t.max.z-u.z)*a):(r=(t.max.z-u.z)*a,(t.min.z-u.z)*a))<(e=e<i||e!=e?i:e)||o<r?null:((e<r||e!=e)&&(e=r),(o=a<o||o!=o?a:o)<0?null:this.at(0<=e?e:o,n)))},intersectsBox:function(t){return null!==this.intersectBox(t,Bi)},intersectTriangle:function(t,n,e,i,r){zi.subVectors(n,t),Wi.subVectors(e,t),Xi.crossVectors(zi,Wi);e=this.direction.dot(Xi);if(0<e){if(i)return null;o=1}else{if(!(e<0))return null;o=-1,e=-e}Vi.subVectors(this.origin,t);i=o*this.direction.dot(Wi.crossVectors(Vi,Wi));if(i<0)return null;t=o*this.direction.dot(zi.cross(Vi));if(t<0)return null;if(e<i+t)return null;var o=-o*Vi.dot(Xi);return o<0?null:this.at(o/e,r)},applyMatrix4:function(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this},equals:function(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}}),Object.assign(Yi.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 Ki(t,this,e,n),e.sort(qi),e},intersectObjects:function(t,n,e){var i=e||[];if(!1===Array.isArray(t))return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),i;for(var r=0,o=t.length;r<o;r++)Ki(t[r],this,i,n);return i.sort(qi),i}});var Ji={CLASSIC:2,REAL:4};Object.freeze(Ji);var Qi=Ji,$i=0;function tr(){Object.defineProperty(this,"id",{value:$i++}),this.uuid=Mt.generateUUID(),this.name="",this.type="Material",this.fog=!0,this.blending=Ct,this.side=Lt,this.flatShading=!1,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=Wt,this.blendDst=Xt,this.blendEquation=It,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=nn,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=ai,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=si,this.stencilZFail=si,this.stencilZPass=si,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaTest=0,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0}function nr(t){tr.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new _i(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new _i(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ri,this.normalScale=new ci(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)}tr.prototype=Object.assign(Object.create(g.prototype),{constructor:tr,isMaterial:!0,onBeforeCompile:function(){},setValues:function(t){if(void 0!==t)for(var n in t){var e,i=t[n];void 0!==i?"shading"!==n?void 0!==(e=this[n])?e&&e.isColor?e.set(i):e&&e.isVector3&&i&&i.isVector3?e.copy(i):this[n]=i:console.warn("THREE."+this.type+": '"+n+"' is not a property of this material."):(console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===i):console.warn("THREE.Material: '"+n+"' parameter is undefined.")}},clone:function(){return(new this.constructor).copy(this)},copy:function(t){this.name=t.name,this.fog=t.fog,this.blending=t.blending,this.side=t.side,this.flatShading=t.flatShading,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;var n=t.clippingPlanes,e=null;if(null!==n)for(var i=n.length,e=new Array(i),r=0;r!==i;++r)e[r]=n[r].clone();return this.clippingPlanes=e,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.premultipliedAlpha=t.premultipliedAlpha,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(tr.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),((nr.prototype=Object.create(tr.prototype)).constructor=nr).prototype.isMeshStandardMaterial=!0,nr.prototype.copy=function(t){return tr.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};var er={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"};function ir(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 rr(t){for(var n={},e=0;e<t.length;e++){var i,r=ir(t[e]);for(i in r)n[i]=r[i]}return n}var or={clone:ir,merge:rr},sr={common:{diffuse:{value:new _i(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new x},uv2Transform:{value:new x},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 ci(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new _i(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}}},points:{diffuse:{value:new _i(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new x}},sprite:{diffuse:{value:new _i(15658734)},opacity:{value:1},center:{value:new ci(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new x}}},ar={basic:{uniforms:rr([sr.common,sr.specularmap,sr.envmap,sr.aomap,sr.lightmap,sr.fog]),vertexShader:er.meshbasic_vert,fragmentShader:er.meshbasic_frag},lambert:{uniforms:rr([sr.common,sr.specularmap,sr.envmap,sr.aomap,sr.lightmap,sr.emissivemap,sr.fog,sr.lights,{emissive:{value:new _i(0)}}]),vertexShader:er.meshlambert_vert,fragmentShader:er.meshlambert_frag},phong:{uniforms:rr([sr.common,sr.specularmap,sr.envmap,sr.aomap,sr.lightmap,sr.emissivemap,sr.bumpmap,sr.normalmap,sr.displacementmap,sr.fog,sr.lights,{emissive:{value:new _i(0)},specular:{value:new _i(1118481)},shininess:{value:30}}]),vertexShader:er.meshphong_vert,fragmentShader:er.meshphong_frag},standard:{uniforms:rr([sr.common,sr.envmap,sr.aomap,sr.lightmap,sr.emissivemap,sr.bumpmap,sr.normalmap,sr.displacementmap,sr.roughnessmap,sr.metalnessmap,sr.fog,sr.lights,{emissive:{value:new _i(0)},roughness:{value:.5},metalness:{value:.5},envMapIntensity:{value:1}}]),vertexShader:er.meshphysical_vert,fragmentShader:er.meshphysical_frag},toon:{uniforms:rr([sr.common,sr.specularmap,sr.aomap,sr.lightmap,sr.emissivemap,sr.bumpmap,sr.normalmap,sr.displacementmap,sr.gradientmap,sr.fog,sr.lights,{emissive:{value:new _i(0)},specular:{value:new _i(1118481)},shininess:{value:30}}]),vertexShader:er.meshtoon_vert,fragmentShader:er.meshtoon_frag},matcap:{uniforms:rr([sr.common,sr.bumpmap,sr.normalmap,sr.displacementmap,sr.fog,{matcap:{value:null}}]),vertexShader:er.meshmatcap_vert,fragmentShader:er.meshmatcap_frag},points:{uniforms:rr([sr.points,sr.fog]),vertexShader:er.points_vert,fragmentShader:er.points_frag},dashed:{uniforms:rr([sr.common,sr.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:er.linedashed_vert,fragmentShader:er.linedashed_frag},depth:{uniforms:rr([sr.common,sr.displacementmap]),vertexShader:er.depth_vert,fragmentShader:er.depth_frag},normal:{uniforms:rr([sr.common,sr.bumpmap,sr.normalmap,sr.displacementmap,{opacity:{value:1}}]),vertexShader:er.normal_vert,fragmentShader:er.normal_frag},sprite:{uniforms:rr([sr.sprite,sr.fog]),vertexShader:er.sprite_vert,fragmentShader:er.sprite_frag},background:{uniforms:{uvTransform:{value:new x},t2D:{value:null}},vertexShader:er.background_vert,fragmentShader:er.background_frag},cube:{uniforms:rr([sr.envmap,{opacity:{value:1}}]),vertexShader:er.cube_vert,fragmentShader:er.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:er.equirect_vert,fragmentShader:er.equirect_frag},distanceRGBA:{uniforms:rr([sr.common,sr.displacementmap,{referencePosition:{value:new St},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:er.distanceRGBA_vert,fragmentShader:er.distanceRGBA_frag},shadow:{uniforms:rr([sr.lights,sr.fog,{color:{value:new _i(0)},opacity:{value:1}}]),vertexShader:er.shadow_vert,fragmentShader:er.shadow_frag}};ar.physical={uniforms:rr([ar.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new ci(1,1)},clearcoatNormalMap:{value:null},sheen:{value:new _i(0)},transparency:{value:0}}]),vertexShader:er.meshphysical_vert,fragmentShader:er.meshphysical_frag};var ur="\nvoid main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n",hr="\nvoid main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}\n";function cr(t){tr.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader=ur,this.fragmentShader=hr,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))}((cr.prototype=Object.create(tr.prototype)).constructor=cr).prototype.isShaderMaterial=!0,cr.prototype.copy=function(t){return tr.prototype.copy.call(this,t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=ir(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 fr="\n\t#extension GL_OES_standard_derivatives : enable\n\n\t#define STANDARD\n\t\n\t#ifdef PHYSICAL\n\t\t#define REFLECTIVITY\n\t\t#define CLEARCOAT\n\t\t#define TRANSPARENCY\n\t#endif\n\t\n\tvarying vec3 v_position;\t\n\n\tuniform bool isRect;\n\tuniform bool isAnnulus;\n\n\tuniform float sweepW;\n\tuniform float sweepH;\n\tuniform vec2 se2N;\n\tuniform vec2 se2RN;\n\tuniform vec2 moveP;\n\tuniform vec3 color_r;\n\t\n\tuniform vec2 circleC;\n\tuniform float maxR;\n\tuniform float minR;\n\tuniform vec3 color_a;\n\t\n\tbool isInRectW(vec2 v, vec2 a, float w){\n\t\tfloat a1 = abs(dot(v,a));\n\t\treturn a1 < w;\n\t}\n\tbool isInRectH(vec2 v, vec2 a, float h){\n\t\tfloat a1 = abs(dot(v,a));\n\t\treturn a1 < h;\n\t}\n\n\tbool isMaxCircle(vec3 a, vec2 b, float r){\n\t\tfloat c = pow((a.x-b.x),2.0)+pow((a.z-b.y),2.0);\n\t\treturn c <= pow(r,2.0);\n\t}\n\t\n\tbool isMinCircle(vec3 a, vec2 b, float r){\n\t\tfloat c = pow((a.x-b.x),2.0)+pow((a.z-b.y),2.0);\n\t\treturn c > pow(r,2.0);\n\t}\n\n\tuniform vec3 diffuse;\n\tuniform vec3 emissive;\n\tuniform float roughness;\n\tuniform float metalness;\n\tuniform float opacity;\n\t\n\t#ifdef TRANSPARENCY\n\t\tuniform float transparency;\n\t#endif\n\t\n\t#ifdef REFLECTIVITY\n\t\tuniform float reflectivity;\n\t#endif\n\t\n\t#ifdef CLEARCOAT\n\t\tuniform float clearcoat;\n\t\tuniform float clearcoatRoughness;\n\t#endif\n\t\n\t#ifdef USE_SHEEN\n\t\tuniform vec3 sheen;\n\t#endif\n\t\n\tvarying vec3 vViewPosition;\n\t\n\t#ifndef FLAT_SHADED\n\t\n\t\tvarying vec3 vNormal;\n\t\n\t\t#ifdef USE_TANGENT\n\t\n\t\t\tvarying vec3 vTangent;\n\t\t\tvarying vec3 vBitangent;\n\t\n\t\t#endif\n\t\n\t#endif\n\t\n\t#include <common>\n\t#include <packing>\n\t#include <dithering_pars_fragment>\n\t#include <color_pars_fragment>\n\t#include <uv_pars_fragment>\n\t#include <uv2_pars_fragment>\n\t#include <map_pars_fragment>\n\t#include <alphamap_pars_fragment>\n\t#include <aomap_pars_fragment>\n\t#include <lightmap_pars_fragment>\n\t#include <emissivemap_pars_fragment>\n\t#include <bsdfs>\n\t#include <cube_uv_reflection_fragment>\n\t#include <envmap_common_pars_fragment>\n\t#include <envmap_physical_pars_fragment>\n\t#include <fog_pars_fragment>\n\t#include <lights_pars_begin>\n\t#include <lights_physical_pars_fragment>\n\t#include <shadowmap_pars_fragment>\n\t#include <bumpmap_pars_fragment>\n\t#include <normalmap_pars_fragment>\n\t#include <clearcoat_pars_fragment>\n\t#include <roughnessmap_pars_fragment>\n\t#include <metalnessmap_pars_fragment>\n\t#include <logdepthbuf_pars_fragment>\n\t#include <clipping_planes_pars_fragment>\n\t\n\tvoid main() {\n\t\t#include <clipping_planes_fragment>\n\t\n\t\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t\tvec3 totalEmissiveRadiance = emissive;\n\t\n\t\t#include <logdepthbuf_fragment>\n\t\t#include <map_fragment>\n\t\t#include <color_fragment>\n\t\t#include <alphamap_fragment>\n\t\t#include <alphatest_fragment>\n\t\t#include <roughnessmap_fragment>\n\t\t#include <metalnessmap_fragment>\n\t\t#include <normal_fragment_begin>\n\t\t#include <normal_fragment_maps>\n\t\t#include <clearcoat_normal_fragment_begin>\n\t\t#include <clearcoat_normal_fragment_maps>\n\t\t#include <emissivemap_fragment>\n\t\t\n\t\t// accumulation\n\t\t#include <lights_physical_fragment>\n\t\t#include <lights_fragment_begin>\n\t\t#include <lights_fragment_maps>\n\t\t#include <lights_fragment_end>\n\t\t\n\t\t// modulation\n\t\t#include <aomap_fragment>\n\t\t\n\t\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t\n\t\t// this is a stub for the transparency model\n\t\t#ifdef TRANSPARENCY\n\t\t\tdiffuseColor.a *= saturate( 1. - transparency + linearToRelativeLuminance( reflectedLight.directSpecular + reflectedLight.indirectSpecular ) );\n\t\t#endif\n\t\n\t\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t\t\n\t\tif(isRect){\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        gl_FragColor = vec4(color_r.r, color_r.g, color_r.b, 1.0);\n\t\t\t}\t\n\t\t}\n\t\t\n\t\tif(isAnnulus){\n\t\t\n\t\t\tif(isMaxCircle(v_position.xyz,circleC,maxR) && isMinCircle(v_position.xyz,circleC,minR)){\n\t\t\t\tgl_FragColor = vec4(color_a.r, color_a.g, color_a.b, 1.0);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\n\t\t#include <tonemapping_fragment>\n\t\t#include <encodings_fragment>\n\t\t#include <fog_fragment>\n\t\t#include <premultiplied_alpha_fragment>\n\t\t#include <dithering_fragment>\n\t}\n",lr="\n    #define STANDARD\n    \n    varying vec3 vViewPosition;\n    varying vec3 v_position;\n    \n    #ifndef FLAT_SHADED\n\n        varying vec3 vNormal;\n    \n        #ifdef USE_TANGENT\n    \n            varying vec3 vTangent;\n            varying vec3 vBitangent;\n    \n        #endif\n    \n    #endif\n    \n    #include <common>\n    #include <uv_pars_vertex>\n    #include <uv2_pars_vertex>\n    #include <displacementmap_pars_vertex>\n    #include <color_pars_vertex>\n    #include <fog_pars_vertex>\n    #include <morphtarget_pars_vertex>\n    #include <skinning_pars_vertex>\n    #include <shadowmap_pars_vertex>\n    #include <logdepthbuf_pars_vertex>\n    #include <clipping_planes_pars_vertex>\n\n    void main() {\n      \t#include <uv_vertex>\n        #include <uv2_vertex>\n        #include <color_vertex>\n    \n        #include <beginnormal_vertex>\n        #include <morphnormal_vertex>\n        #include <skinbase_vertex>\n        #include <skinnormal_vertex>\n        #include <defaultnormal_vertex>\n        \n        #ifndef FLAT_SHADED // Normal computed with derivatives when FLAT_SHADED\n        \n            vNormal = normalize( transformedNormal );\n        \n            #ifdef USE_TANGENT\n        \n                vTangent = normalize( transformedTangent );\n                vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n        \n            #endif\n        \n        #endif\n        \n        #include <begin_vertex>\n        #include <morphtarget_vertex>\n        #include <skinning_vertex>\n        #include <displacementmap_vertex>\n        #include <project_vertex>\n        #include <logdepthbuf_vertex>\n        #include <clipping_planes_vertex>\n    \n        vViewPosition = - mvPosition.xyz;\n    \n        vec4 pos = vec4(position, 1.0);\n        v_position = vec3(modelMatrix * vec4( position, 1.0 ));\n    \n        #include <worldpos_vertex>\n        #include <shadowmap_vertex>\n        #include <fog_vertex>\n    }\n ";function dr(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var vr=or.merge([{sweepW:{value:0},sweepH:{value:0},se2N:{value:new ci(0,0)},se2RN:{value:new ci(0,0)},moveP:{value:new ci(0,0)},color_r:{value:new _i(16711935)},color_a:{value:new _i(16776960)},isRect:{value:!1},isAnnulus:{value:!1},circleC:{value:new ci(0,0)},maxR:{value:0},minR:{value:0}},ar.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new ci(1,1)},clearcoatNormalMap:{value:null},sheen:{value:new _i(0)},transparency:{value:0}}]),pr=function(){function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),cr.call(this),this.type="FMMeshStandardMaterial",this.uniforms=or.clone(vr),this.vertexShader=lr,this.fragmentShader=fr,this.lights=!0}var n,e,i;return n=t,(e=[{key:"copy",value:function(t){return cr.prototype.copy.call(this,t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=or.clone(t.uniforms),this.lights=t.lights,this}}])&&dr(n.prototype,e),i&&dr(n,i),t}();pr.prototype=Object.create(cr.prototype),pr.prototype.isFMMeshStandardMaterial=!0;var mr=pr.prototype.constructor=pr;function gr(t){return function(t){if(Array.isArray(t))return yr(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,n){if(t){if("string"==typeof t)return yr(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(e="Object"===e&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?yr(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 yr(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 br=function t(n,e,i){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),this.V=n,this.wt=i,this.jt=e,this.jn=[],this.In=null,this.Nn=Ei.generateUUID(),this.Fn=new Yi,this.Un=new St,this.Bn=0,this.Gn=0,this.st=this.st.bind(this),this.Q=0,this.V.an.renderer.domElement.addEventListener("mousedown",this.st,!1),this.V.an.renderer.domElement.addEventListener("mouseup",this.st,!1),this.V.an.renderer.domElement.addEventListener("mousemove",this.st,!1),this.V.an.renderer.domElement.addEventListener("touchstart",this.st,!1),this.V.an.renderer.domElement.addEventListener("touchend",this.st,!1),this.V.an.renderer.domElement.addEventListener("touchmove",this.st,!1)};Object.assign(br.prototype,{ct:function(){for(var t in this.V.an.renderer.domElement.removeEventListener("mousedown",this.Fn.st,!1),this.V.an.renderer.domElement.removeEventListener("mouseup",this.Fn.st,!1),this.V.an.renderer.domElement.removeEventListener("touchstart",this.Fn.st,!1),this.V.an.renderer.domElement.removeEventListener("mousemove",this.Fn.st,!1),this.V.an.renderer.domElement.removeEventListener("touchmove",this.Fn.st,!1),delete this.V,delete this.wt,delete this.jt,this)this[""+t]&&this[""+t].ct&&this[""+t].ct(),this[""+t]=null,delete this[""+t]},dn:function(t){var n;(n=this.jn).push.apply(n,gr(t))},st:function(t){if("mousemove"!==t.type||this.wt.Hn){if("mousedown"===t.type||"touchstart"===t.type)return this.Q=(new Date).getTime(),void("touchstart"===t.type&&(this.Bn=t.changedTouches[0].clientX,this.Gn=t.changedTouches[0].clientY));if("mouseup"===t.type||"touchend"===t.type){if(200<(new Date).getTime()-this.Q)return;if("touchend"===t.type&&Math.pow(t.changedTouches[0].clientX-this.Bn,2)+Math.pow(t.changedTouches[0].clientY-this.Gn,2)>Math.pow(t.changedTouches[0].radiusX,2))return;this.Q=(new Date).getTime()}for(var n=this.Vn(t),e=0;e<this.jn.length;e++)this.jn[e](n);var i=this.zn(n),r=0<i.length?i[0].level:null,o="mousemove"===t.type||"touchmove"===t.type?"hover":"click",r={type:o,targets:i,coords:this.Wn(n),mouseEvent:t,level:r};-1<this.jt.Xn.indexOf(o)&&this.Zn(i),this.V.Dt.Pt(r)}},Zn:function(t){for(var s=this,n=[Di.MODEL,Di.EXTERNAL_MODEL],e=0;e<t.length;e++)if(-1<n.indexOf(t[e].Yn)){if(this.In&&t[e].Dn&&t[e].Dn.uuid===this.In.uuid)return;if(t[e].Dn){if(this.St&&(this.St.stop(),this.V.ln.cn(this.St)),o(this.In),this.In=t[e].Dn,t[e].Yn===Di.MODEL)!function(){s.In.userData.sourceMaterial=s.In.material,s.In.material=s.In.material.clone();var t=s.In.material.color,n=new _i(s.wt.highlightColor);s.St?(s.St.ft([t.r,t.g,t.b]),s.St.lt([n.r,n.g,n.b])):s.St=new Ri({src:[t.r,t.g,t.b],dest:[n.r,n.g,n.b]}),s.St.dt(.5).pt(function(t){t=new _i(t.destination[0],t.destination[1],t.destination[2]);s.In&&s.In.material&&(s.In.material.color=t),s.V.enableUpdateRender()}).mt(function(){s.St.stop(),s.V.ln.cn(s.St),s.In&&s.In.material&&(s.In.material.color=n),s.V.enableUpdateRender()}),s.V.ln.dn(s.St.ht())}();else if(t[e].Yn===Di.EXTERNAL_MODEL)if(this.In=t[e].Dn,"Mesh"===this.In.type)if(this.In.userData.sourceMaterial||(this.In.userData.sourceMaterial=this.In.material),Array.isArray(this.In.material)){for(var i=[],r=0;r<this.In.material.length;r++)"MeshLambertMaterial"!==this.In.material[r].type||(i[r]=this.In.material[r].clone(),i[r].color=new _i(this.wt.highlightColor));this.In.material=i}else"MeshLambertMaterial"!==this.In.material.type||(this.In.material=this.In.material.clone(),this.In.material.color=new _i(this.wt.highlightColor));else"Scene"===this.In.type&&this.In.traverse(function(t){if("Mesh"===t.type)if(Array.isArray(t.material)){t.userData.sourceMaterial=[];for(var n=0;n<t.material.length;n++){var e,i=s.qn(t.material[n]);i.color=s.wt.highlightColor,s.V.getMapOptions().materialMode===Qi.REAL?((e=s.V.Zt.Jn.Kn(i)).userData=t.material[n].userData,t.userData.sourceMaterial[n]=t.material[n],t.material=e):((i=s.V.Zt.Jn.Qn(t.material,i)).userData=t.material[n].userData,t.userData.sourceMaterial[n]=t.material[n],t.material=i)}}else{var r,o=s.qn(t.material);o.color=s.wt.highlightColor,s.V.getMapOptions().materialMode===Qi.REAL?((r=s.V.Zt.Jn.Kn(o)).userData=t.material.userData,t.userData.sourceMaterial=t.material,t.material=r):((o=s.V.Zt.Jn.Qn(t.material,o)).userData=t.material.userData,t.userData.sourceMaterial=t.material,t.material=o)}});return void this.V.enableUpdateRender()}break}function o(t){var n;if(t&&t.mapNode)if(t.mapNode.Yn===Di.MODEL)t.userData.sourceMaterial&&(n=t.material,t.material=t.userData.sourceMaterial,n.dispose(),delete t.userData.sourceMaterial);else if(t.mapNode.Yn===Di.EXTERNAL_MODEL)if("Mesh"===t.type){var e=t.material;if(t.material=t.userData.sourceMaterial,delete t.userData.sourceMaterial,Array.isArray(e))for(var i=0;i<e.length;i++)e[i].dispose();else e.dispose()}else"Scene"===t.type&&t.traverse(function(t){if("Mesh"===t.type){var n=t.material;if(t.material=t.userData.sourceMaterial,delete t.userData.sourceMaterial,Array.isArray(n))for(var e=0;e<n.length;e++)n[e].dispose();else n.dispose()}})}this.St&&(this.St.stop(),this.V.ln.cn(this.St)),o(this.In),this.In=null,this.V.enableUpdateRender()},qn:function(t){var n={};return(n=this.V.jt.materialMode===Qi.REAL?{USE_EMISSIVEMAP:t.defines.USE_EMISSIVEMAP,USE_MAP:t.defines.USE_MAP,map:t.uniforms.map.value,color:t.uniforms.diffuse.value.getHex(),emissive:t.uniforms.emissive.value.getHex(),emissiveMap:t.uniforms.emissiveMap.value,metalness:t.uniforms.metalness.value,roughness:t.uniforms.roughness.value,normalScale:t.uniforms.normalScale.value,vertexColors:t.vertexColors,side:t.side}:n).opacity=t.opacity,n.transparent=t.transparent,n},zn:function(t){for(var n=[],e=0;e<t.length;e++){var i=t[e].object;if("LineSegments"!==i.type&&!(i.parent&&i.parent.mapNode&&i.parent.mapNode.$n&&i===i.parent.mapNode.$n.top)){for(;!i.mapNode;)i=i.parent;for(var r=!0,o=0;o<n.length;o++)if(n[o].Dn&&n[o].Dn.uuid===i.uuid){r=!1;break}this.V.pickFilterFunction({type:i.mapNode.Yn,data:i.mapNode.te})&&r&&i.visible&&n.push(i.mapNode)}}return n},Wn:function(t){for(var n=null,e=0;e<t.length;e++)if("LineSegments"!==t[e].object.type){n=t[e];break}if(t.length<1||!n)return{x:NaN,y:NaN,z:NaN};var i=n.point.clone();var r=function t(n){return n.parent?t(n.parent):n}(n.object),o=r.matrix.clone();return o.getInverse(r.matrix),i.applyMatrix4(o),{x:this.V.getX()+i.x,y:this.V.getY()-i.z,z:n.point.y}},Vn:function(t){var n,e,i,r=this,o=[];return t.touches?(i=t.touches[0],"touchend"===t.type&&(i=t.changedTouches[0]),n=this.V.an.renderer.domElement.getBoundingClientRect(),e=i.pageX-n.left,i=i.pageY-n.top,this.Un.x=e/n.width*2-1,this.Un.y=2*-(i/n.height)+1):(this.Un.x=(t=t).offsetX/this.V.an.renderer.domElement.clientWidth*2-1,this.Un.y=2*-(t.offsetY/this.V.an.renderer.domElement.clientHeight)+1),this.Un.z=.5,this.Fn.setFromCamera(this.Un,this.V.kt),this.V.an.Cn.forEach(function(t){for(var n=r.Fn.intersectObject(t,!0),e=0;e<n.length;e++)n[e].object.visible&&o.push(n[e])}),o.sort(function(t,n){return t.distance-n.distance})}});var _r=br,wr=0;function xr(t,n,e,i,r,o,s,a,u,h){Object.defineProperty(this,"id",{value:wr++}),this.uuid=Mt.generateUUID(),this.name="",this.image=void 0!==t?t:xr.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==n?n:xr.DEFAULT_MAPPING,this.wrapS=void 0!==e?e:Sn,this.wrapT=void 0!==i?i:Sn,this.magFilter=void 0!==r?r:On,this.minFilter=void 0!==o?o:Cn,this.anisotropy=void 0!==u?u:1,this.format=void 0!==s?s:Xn,this.internalFormat=null,this.type=void 0!==a?a:kn,this.offset=new ci(0,0),this.repeat=new ci(1,1),this.center=new ci(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new x,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==h?h:Ye,this.version=0,this.onUpdate=null}function Mr(t,n,e,i,r,o,s,a,u,h,c,f){xr.call(this,null,o,s,a,u,h,i,r,c,f),this.image={data:t||null,width:n||1,height:e||1},this.magFilter=void 0!==u?u:Tn,this.minFilter=void 0!==h?h:Tn,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}function Sr(){Z.call(this),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}function Er(){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 Tr(u,t){var h=t.isWebGL2,c=new WeakMap;return{get:function(t){return t.isInterleavedBufferAttribute&&(t=t.data),c.get(t)},remove:function(t){t.isInterleavedBufferAttribute&&(t=t.data);var n=c.get(t);n&&(u.deleteBuffer(n.buffer),c.delete(t))},update:function(t,n){t.isInterleavedBufferAttribute&&(t=t.data);var e,i,r,o,s,a=c.get(t);void 0===a?c.set(t,(i=n,r=(e=t).array,o=e.usage,s=u.createBuffer(),u.bindBuffer(i,s),u.bufferData(i,r,o),e.onUploadCallback(),o=u.FLOAT,r instanceof Float32Array?o=u.FLOAT:r instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):r instanceof Uint16Array?o=u.UNSIGNED_SHORT:r instanceof Int16Array?o=u.SHORT:r instanceof Uint32Array?o=u.UNSIGNED_INT:r instanceof Int32Array?o=u.INT:r instanceof Int8Array?o=u.BYTE:r instanceof Uint8Array&&(o=u.UNSIGNED_BYTE),{buffer:s,type:o,bytesPerElement:r.BYTES_PER_ELEMENT,version:e.version})):a.version<t.version&&(o=a.buffer,r=n,n=(e=t).array,e=e.updateRange,u.bindBuffer(r,o),-1===e.count?u.bufferSubData(r,0,n):(h?u.bufferSubData(r,e.offset*n.BYTES_PER_ELEMENT,n,e.offset,e.count):u.bufferSubData(r,e.offset*n.BYTES_PER_ELEMENT,n.subarray(e.offset,e.offset+e.count)),e.count=-1),a.version=t.version)}}}function Lr(t,n,e,i,r,o){this.a=t,this.b=n,this.c=e,this.normal=i&&i.isVector3?i:new St,this.vertexNormals=Array.isArray(i)?i:[],this.color=r&&r.isColor?r:new _i,this.vertexColors=Array.isArray(r)?r:[],this.materialIndex=void 0!==o?o:0}xr.DEFAULT_IMAGE=void 0,xr.DEFAULT_MAPPING=300,xr.prototype=Object.assign(Object.create(g.prototype),{constructor:xr,isTexture:!0,updateMatrix:function(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.name=t.name,this.image=t.image,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.encoding=t.encoding,this},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(t){if(300!==this.mapping)return t;if(t.applyMatrix3(this.matrix),t.x<0||1<t.x)switch(this.wrapS){case Mn:t.x=t.x-Math.floor(t.x);break;case Sn:t.x=t.x<0?0:1;break;case En: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 Mn:t.y=t.y-Math.floor(t.y);break;case Sn:t.y=t.y<0?0:1;break;case En:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}return this.flipY&&(t.y=1-t.y),t}}),Object.defineProperty(xr.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),((Mr.prototype=Object.create(xr.prototype)).constructor=Mr).prototype.isDataTexture=!0,Sr.prototype=Object.assign(Object.create(Z.prototype),{constructor:Sr,isScene:!0,copy:function(t,n){return Z.prototype.copy.call(this,t,n),null!==t.background&&(this.background=t.background.clone()),null!==t.environment&&(this.environment=t.environment.clone()),null!==t.fog&&(this.fog=t.fog.clone()),null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.autoUpdate=t.autoUpdate,this.matrixAutoUpdate=t.matrixAutoUpdate,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.assign(Lr.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 Rr=0,Or=new Et,Ar=new Z,Cr=new St;function kr(){Object.defineProperty(this,"id",{value:Rr+=2}),this.uuid=Mt.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1}kr.prototype=Object.assign(Object.create(g.prototype),{constructor:kr,isGeometry:!0,applyMatrix4:function(t){for(var n=(new x).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 Or.makeRotationX(t),this.applyMatrix4(Or),this},rotateY:function(t){return Or.makeRotationY(t),this.applyMatrix4(Or),this},rotateZ:function(t){return Or.makeRotationZ(t),this.applyMatrix4(Or),this},translate:function(t,n,e){return Or.makeTranslation(t,n,e),this.applyMatrix4(Or),this},scale:function(t,n,e){return Or.makeScale(t,n,e),this.applyMatrix4(Or),this},lookAt:function(t){return Ar.lookAt(t),Ar.updateMatrix(),this.applyMatrix4(Ar.matrix),this},fromBufferGeometry:function(t){var o=this,n=null!==t.index?t.index.array:void 0,e=t.attributes;if(void 0===e.position)return console.error("THREE.Geometry.fromBufferGeometry(): Position attribute required for conversion."),this;var i=e.position.array,s=void 0!==e.normal?e.normal.array:void 0,a=void 0!==e.color?e.color.array:void 0,u=void 0!==e.uv?e.uv.array:void 0,h=void 0!==e.uv2?e.uv2.array:void 0;void 0!==h&&(this.faceVertexUvs[1]=[]);for(var r=0;r<i.length;r+=3)o.vertices.push((new St).fromArray(i,r)),void 0!==a&&o.colors.push((new _i).fromArray(a,r));function c(t,n,e,i){var r=void 0===a?[]:[o.colors[t].clone(),o.colors[n].clone(),o.colors[e].clone()],i=new Lr(t,n,e,void 0===s?[]:[(new St).fromArray(s,3*t),(new St).fromArray(s,3*n),(new St).fromArray(s,3*e)],r,i);o.faces.push(i),void 0!==u&&o.faceVertexUvs[0].push([(new ci).fromArray(u,2*t),(new ci).fromArray(u,2*n),(new ci).fromArray(u,2*e)]),void 0!==h&&o.faceVertexUvs[1].push([(new ci).fromArray(h,2*t),(new ci).fromArray(h,2*n),(new ci).fromArray(h,2*e)])}var f=t.groups;if(0<f.length)for(r=0;r<f.length;r++)for(var l=f[r],d=l.start,v=d,p=d+l.count;v<p;v+=3)void 0!==n?c(n[v],n[v+1],n[v+2],l.materialIndex):c(v,v+1,v+2,l.materialIndex);else if(void 0!==n)for(r=0;r<n.length;r+=3)c(n[r],n[r+1],n[r+2]);else for(r=0;r<i.length/3;r+=3)c(r,r+1,r+2);return this.computeFaceNormals(),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(Cr).negate(),this.translate(Cr.x,Cr.y,Cr.z),this},normalize:function(){this.computeBoundingSphere();var t=this.boundingSphere.center,n=this.boundingSphere.radius,e=0===n?1:1/n,n=new Et;return n.set(e,0,0,-e*t.x,0,e,0,-e*t.y,0,0,e,-e*t.z,0,0,0,1),this.applyMatrix4(n),this},computeFaceNormals:function(){for(var t=new St,n=new St,e=0,i=this.faces.length;e<i;e++){var r=this.faces[e],o=this.vertices[r.a],s=this.vertices[r.b],a=this.vertices[r.c];t.subVectors(a,s),n.subVectors(o,s),t.cross(n),t.normalize(),r.normal.copy(t)}},computeVertexNormals:function(t){var n,e,i;for(void 0===t&&(t=!0),i=new Array(this.vertices.length),n=0,e=this.vertices.length;n<e;n++)i[n]=new St;if(t)for(var r,o,s,a=new St,u=new St,h=0,c=this.faces.length;h<c;h++)f=this.faces[h],r=this.vertices[f.a],o=this.vertices[f.b],s=this.vertices[f.c],a.subVectors(s,o),u.subVectors(r,o),a.cross(u),i[f.a].add(a),i[f.b].add(a),i[f.c].add(a);else for(this.computeFaceNormals(),h=0,c=this.faces.length;h<c;h++)i[(f=this.faces[h]).a].add(f.normal),i[f.b].add(f.normal),i[f.c].add(f.normal);for(n=0,e=this.vertices.length;n<e;n++)i[n].normalize();for(h=0,c=this.faces.length;h<c;h++){var f,l=(f=this.faces[h]).vertexNormals;3===l.length?(l[0].copy(i[f.a]),l[1].copy(i[f.b]),l[2].copy(i[f.c])):(l[0]=i[f.a].clone(),l[1]=i[f.b].clone(),l[2]=i[f.c].clone())}0<this.faces.length&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){var t,n;for(this.computeFaceNormals(),t=0,n=this.faces.length;t<n;t++){var e,i=(e=this.faces[t]).vertexNormals;3===i.length?(i[0].copy(e.normal),i[1].copy(e.normal),i[2].copy(e.normal)):(i[0]=e.normal.clone(),i[1]=e.normal.clone(),i[2]=e.normal.clone())}0<this.faces.length&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){var t,n,e;for(s=0,a=this.faces.length;s<a;s++)for((e=this.faces[s]).ne?e.ne.copy(e.normal):e.ne=e.normal.clone(),e.ee||(e.ee=[]),t=0,n=e.vertexNormals.length;t<n;t++)e.ee[t]?e.ee[t].copy(e.vertexNormals[t]):e.ee[t]=e.vertexNormals[t].clone();var i=new kr;for(i.faces=this.faces,t=0,n=this.morphTargets.length;t<n;t++){if(!this.morphNormals[t]){this.morphNormals[t]={},this.morphNormals[t].faceNormals=[],this.morphNormals[t].vertexNormals=[];for(var r=this.morphNormals[t].faceNormals,o=this.morphNormals[t].vertexNormals,s=0,a=this.faces.length;s<a;s++)u=new St,h={a:new St,b:new St,c:new St},r.push(u),o.push(h)}var u,h,c=this.morphNormals[t];for(i.vertices=this.morphTargets[t].vertices,i.computeFaceNormals(),i.computeVertexNormals(),s=0,a=this.faces.length;s<a;s++)e=this.faces[s],u=c.faceNormals[s],h=c.vertexNormals[s],u.copy(e.normal),h.a.copy(e.vertexNormals[0]),h.b.copy(e.vertexNormals[1]),h.c.copy(e.vertexNormals[2])}for(s=0,a=this.faces.length;s<a;s++)(e=this.faces[s]).normal=e.ne,e.vertexNormals=e.ee},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new $),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new et),this.boundingSphere.setFromPoints(this.vertices)},mergeVertices:function(){for(var t,n,e,i,r={},o=[],s=[],a=Math.pow(10,4),u=0,h=this.vertices.length;u<h;u++)t=this.vertices[u],void 0===r[t=Math.round(t.x*a)+"_"+Math.round(t.y*a)+"_"+Math.round(t.z*a)]?(r[t]=u,o.push(this.vertices[u]),s[u]=o.length-1):s[u]=s[r[t]];var c=[];for(u=0,h=this.faces.length;u<h;u++){(n=this.faces[u]).a=s[n.a],n.b=s[n.b],n.c=s[n.c];for(var f=[n.a,n.b,n.c],l=0;l<3;l++)if(f[l]===f[(l+1)%3]){c.push(u);break}}for(u=c.length-1;0<=u;u--){var d=c[u];for(this.faces.splice(d,1),e=0,i=this.faceVertexUvs.length;e<i;e++)this.faceVertexUvs[e].splice(d,1)}var v=this.vertices.length-o.length;return this.vertices=o,v},setFromPoints:function(t){this.vertices=[];for(var n=0,e=t.length;n<e;n++){var i=t[n];this.vertices.push(new St(i.x,i.y,i.z||0))}return this},sortFacesByMaterialIndex:function(){for(var t=this.faces,n=t.length,e=0;e<n;e++)t[e].ie=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].ie;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 Pr=new St;function Dr(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=ui,this.updateRange={offset:0,count:-1},this.version=0}function jr(t,n,e){Dr.call(this,new Int8Array(t),n,e)}function Ir(t,n,e){Dr.call(this,new Uint8Array(t),n,e)}function Nr(t,n,e){Dr.call(this,new Uint8ClampedArray(t),n,e)}function Fr(t,n,e){Dr.call(this,new Int16Array(t),n,e)}function Ur(t,n,e){Dr.call(this,new Uint16Array(t),n,e)}function Br(t,n,e){Dr.call(this,new Int32Array(t),n,e)}function Gr(t,n,e){Dr.call(this,new Uint32Array(t),n,e)}function Hr(t,n,e){Dr.call(this,new Float32Array(t),n,e)}function Vr(t,n,e){Dr.call(this,new Float64Array(t),n,e)}function zr(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}function Wr(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(Dr.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(Dr.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setUsage:function(t){return this.usage=t,this},copy:function(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this},copyAt:function(t,n,e){t*=this.itemSize,e*=n.itemSize;for(var i=0,r=this.itemSize;i<r;i++)this.array[t+i]=n.array[e+i];return this},copyArray:function(t){return this.array.set(t),this},copyColorsArray:function(t){for(var n=this.array,e=0,i=0,r=t.length;i<r;i++){var o=t[i];void 0===o&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",i),o=new _i),n[e++]=o.r,n[e++]=o.g,n[e++]=o.b}return this},copyVector2sArray:function(t){for(var n=this.array,e=0,i=0,r=t.length;i<r;i++){var o=t[i];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",i),o=new ci),n[e++]=o.x,n[e++]=o.y}return this},copyVector3sArray:function(t){for(var n=this.array,e=0,i=0,r=t.length;i<r;i++){var o=t[i];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",i),o=new St),n[e++]=o.x,n[e++]=o.y,n[e++]=o.z}return this},copyVector4sArray:function(t){for(var n=this.array,e=0,i=0,r=t.length;i<r;i++){var o=t[i];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",i),o=new Ci),n[e++]=o.x,n[e++]=o.y,n[e++]=o.z,n[e++]=o.w}return this},applyMatrix3:function(t){for(var n=0,e=this.count;n<e;n++)Pr.x=this.getX(n),Pr.y=this.getY(n),Pr.z=this.getZ(n),Pr.applyMatrix3(t),this.setXYZ(n,Pr.x,Pr.y,Pr.z);return this},applyMatrix4:function(t){for(var n=0,e=this.count;n<e;n++)Pr.x=this.getX(n),Pr.y=this.getY(n),Pr.z=this.getZ(n),Pr.applyMatrix4(t),this.setXYZ(n,Pr.x,Pr.y,Pr.z);return this},applyNormalMatrix:function(t){for(var n=0,e=this.count;n<e;n++)Pr.x=this.getX(n),Pr.y=this.getY(n),Pr.z=this.getZ(n),Pr.applyNormalMatrix(t),this.setXYZ(n,Pr.x,Pr.y,Pr.z);return this},transformDirection:function(t){for(var n=0,e=this.count;n<e;n++)Pr.x=this.getX(n),Pr.y=this.getY(n),Pr.z=this.getZ(n),Pr.transformDirection(t),this.setXYZ(n,Pr.x,Pr.y,Pr.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)}}),(jr.prototype=Object.create(Dr.prototype)).constructor=jr,(Ir.prototype=Object.create(Dr.prototype)).constructor=Ir,(Nr.prototype=Object.create(Dr.prototype)).constructor=Nr,(Fr.prototype=Object.create(Dr.prototype)).constructor=Fr,Ur.prototype=Object.create(Dr.prototype),Ur.prototype.constructor=Ur,(Br.prototype=Object.create(Dr.prototype)).constructor=Br,Gr.prototype=Object.create(Dr.prototype),Gr.prototype.constructor=Gr,(Hr.prototype=Object.create(Dr.prototype)).constructor=Hr,(Vr.prototype=Object.create(Dr.prototype)).constructor=Vr,Object.assign(zr.prototype,{computeGroups:function(t){for(var n,e=[],i=void 0,r=t.faces,o=0;o<r.length;o++){var s=r[o];s.materialIndex!==i&&(i=s.materialIndex,void 0!==n&&(n.count=3*o-n.start,e.push(n)),n={start:3*o,materialIndex:i})}void 0!==n&&(n.count=3*o-n.start,e.push(n)),this.groups=e},fromGeometry:function(t){var n=t.faces,e=t.vertices,i=t.faceVertexUvs,r=i[0]&&0<i[0].length,o=i[1]&&0<i[1].length,s=t.morphTargets,a=s.length;if(0<a){for(var u=[],h=0;h<a;h++)u[h]={name:s[h].name,data:[]};this.morphTargets.position=u}var c=t.morphNormals,f=c.length;if(0<f){for(var l=[],h=0;h<f;h++)l[h]={name:c[h].name,data:[]};this.morphTargets.normal=l}var d=t.skinIndices,v=t.skinWeights,p=d.length===e.length,m=v.length===e.length;0<e.length&&0===n.length&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(h=0;h<n.length;h++){var g=n[h];this.vertices.push(e[g.a],e[g.b],e[g.c]);var y=g.vertexNormals;3===y.length?this.normals.push(y[0],y[1],y[2]):(_=g.normal,this.normals.push(_,_,_));var b,_=g.vertexColors;3===_.length?this.colors.push(_[0],_[1],_[2]):(_=g.color,this.colors.push(_,_,_)),!0===r&&(void 0!==(b=i[0][h])?this.uvs.push(b[0],b[1],b[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",h),this.uvs.push(new ci,new ci,new ci))),!0===o&&(void 0!==(b=i[1][h])?this.uvs2.push(b[0],b[1],b[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",h),this.uvs2.push(new ci,new ci,new ci)));for(var w=0;w<a;w++){var x=s[w].vertices;u[w].data.push(x[g.a],x[g.b],x[g.c])}for(w=0;w<f;w++){var M=c[w].vertexNormals[h];l[w].data.push(M.a,M.b,M.c)}p&&this.skinIndices.push(d[g.a],d[g.b],d[g.c]),m&&this.skinWeights.push(v[g.a],v[g.b],v[g.c])}return this.computeGroups(t),this.verticesNeedUpdate=t.verticesNeedUpdate,this.normalsNeedUpdate=t.normalsNeedUpdate,this.colorsNeedUpdate=t.colorsNeedUpdate,this.uvsNeedUpdate=t.uvsNeedUpdate,this.groupsNeedUpdate=t.groupsNeedUpdate,null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),this}});var Xr=1,Zr=new Et,Yr=new Z,qr=new St,Kr=new $,Jr=new $,Qr=new St;function $r(){Object.defineProperty(this,"id",{value:Xr+=2}),this.uuid=Mt.generateUUID(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}function to(t){return(to="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 no(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function eo(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&io(t,n)}function io(t,n){return(io=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function ro(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=so(e);return t=i?(t=so(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==to(t)&&"function"!=typeof t?oo(n):t}}function oo(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function so(t){return(so=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}$r.prototype=Object.assign(Object.create(g.prototype),{constructor:$r,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(t){Array.isArray(t)?this.index=new(65535<Wr(t)?Gr:Ur)(t,1):this.index=t},getAttribute:function(t){return this.attributes[t]},setAttribute:function(t,n){return this.attributes[t]=n,this},deleteAttribute:function(t){return delete this.attributes[t],this},addGroup:function(t,n,e){this.groups.push({start:t,count:n,materialIndex:void 0!==e?e:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(t,n){this.drawRange.start=t,this.drawRange.count=n},applyMatrix4:function(t){var n=this.attributes.position;void 0!==n&&(n.applyMatrix4(t),n.needsUpdate=!0);var e=this.attributes.normal;void 0!==e&&(n=(new x).getNormalMatrix(t),e.applyNormalMatrix(n),e.needsUpdate=!0);e=this.attributes.tangent;return void 0!==e&&(e.transformDirection(t),e.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(t){return Zr.makeRotationX(t),this.applyMatrix4(Zr),this},rotateY:function(t){return Zr.makeRotationY(t),this.applyMatrix4(Zr),this},rotateZ:function(t){return Zr.makeRotationZ(t),this.applyMatrix4(Zr),this},translate:function(t,n,e){return Zr.makeTranslation(t,n,e),this.applyMatrix4(Zr),this},scale:function(t,n,e){return Zr.makeScale(t,n,e),this.applyMatrix4(Zr),this},lookAt:function(t){return Yr.lookAt(t),Yr.updateMatrix(),this.applyMatrix4(Yr.matrix),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(qr).negate(),this.translate(qr.x,qr.y,qr.z),this},setFromObject:function(t){var n,e,i=t.geometry;return t.isPoints||t.isLine?(n=new Hr(3*i.vertices.length,3),e=new Hr(3*i.colors.length,3),this.setAttribute("position",n.copyVector3sArray(i.vertices)),this.setAttribute("color",e.copyColorsArray(i.colors)),i.lineDistances&&i.lineDistances.length===i.vertices.length&&(e=new Hr(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 Hr(n,3)),this},updateFromObject:function(t){var n,e=t.geometry;if(t.isMesh){var i=e.re;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.re=(new zr).fromGeometry(t),this.fromDirectGeometry(t.re)},fromDirectGeometry:function(t){var n,e,i,r,o=new Float32Array(3*t.vertices.length);for(i in this.setAttribute("position",new Dr(o,3).copyVector3sArray(t.vertices)),0<t.normals.length&&(n=new Float32Array(3*t.normals.length),this.setAttribute("normal",new Dr(n,3).copyVector3sArray(t.normals))),0<t.colors.length&&(n=new Float32Array(3*t.colors.length),this.setAttribute("color",new Dr(n,3).copyColorsArray(t.colors))),0<t.uvs.length&&(e=new Float32Array(2*t.uvs.length),this.setAttribute("uv",new Dr(e,2).copyVector2sArray(t.uvs))),0<t.uvs2.length&&(e=new Float32Array(2*t.uvs2.length),this.setAttribute("uv2",new Dr(e,2).copyVector2sArray(t.uvs2))),this.groups=t.groups,t.morphTargets){for(var s=[],a=t.morphTargets[i],u=0,h=a.length;u<h;u++){var c=a[u],f=new Hr(3*c.data.length,3);f.name=c.name,s.push(f.copyVector3sArray(c.data))}this.morphAttributes[i]=s}return 0<t.skinIndices.length&&(r=new Hr(4*t.skinIndices.length,4),this.setAttribute("skinIndex",r.copyVector4sArray(t.skinIndices))),0<t.skinWeights.length&&(r=new Hr(4*t.skinWeights.length,4),this.setAttribute("skinWeight",r.copyVector4sArray(t.skinWeights))),null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),this},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new et);var t=this.attributes.position,n=this.morphAttributes.position;if(t){var e=this.boundingSphere.center;if(Kr.setFromBufferAttribute(t),n)for(var i=0,r=n.length;i<r;i++){var o=n[i];Jr.setFromBufferAttribute(o),this.morphTargetsRelative?(Qr.addVectors(Kr.min,Jr.min),Kr.expandByPoint(Qr),Qr.addVectors(Kr.max,Jr.max),Kr.expandByPoint(Qr)):(Kr.expandByPoint(Jr.min),Kr.expandByPoint(Jr.max))}Kr.getCenter(e);for(var s=0,i=0,r=t.count;i<r;i++)Qr.fromBufferAttribute(t,i),s=Math.max(s,e.distanceToSquared(Qr));if(n)for(i=0,r=n.length;i<r;i++)for(var o=n[i],a=this.morphTargetsRelative,u=0,h=o.count;u<h;u++)Qr.fromBufferAttribute(o,u),a&&(qr.fromBufferAttribute(t,u),Qr.add(qr)),s=Math.max(s,e.distanceToSquared(Qr));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 Dr(new Float32Array(e.length),3));else for(var i=n.normal.array,r=0,o=i.length;r<o;r++)i[r]=0;var s,a,u,h=n.normal.array,c=new St,f=new St,l=new St,d=new St,v=new St;if(t)for(var p=t.array,r=0,o=t.count;r<o;r+=3)s=3*p[r+0],a=3*p[r+1],u=3*p[r+2],c.fromArray(e,s),f.fromArray(e,a),l.fromArray(e,u),d.subVectors(l,f),v.subVectors(c,f),d.cross(v),h[s]+=d.x,h[1+s]+=d.y,h[2+s]+=d.z,h[a]+=d.x,h[1+a]+=d.y,h[2+a]+=d.z,h[u]+=d.x,h[1+u]+=d.y,h[2+u]+=d.z;else for(r=0,o=e.length;r<o;r+=9)c.fromArray(e,r),f.fromArray(e,r+3),l.fromArray(e,r+6),d.subVectors(l,f),v.subVectors(c,f),d.cross(v),h[r]=d.x,h[r+1]=d.y,h[r+2]=d.z,h[r+3]=d.x,h[r+4]=d.y,h[r+5]=d.z,h[r+6]=d.x,h[r+7]=d.y,h[r+8]=d.z;this.normalizeNormals(),n.normal.needsUpdate=!0}},normalizeNormals:function(){for(var t=this.attributes.normal,n=0,e=t.count;n<e;n++)Qr.x=t.getX(n),Qr.y=t.getY(n),Qr.z=t.getZ(n),Qr.normalize(),t.setXYZ(n,Qr.x,Qr.y,Qr.z)},dispose:function(){this.dispatchEvent({type:"dispose"})}});var ao=function(){eo(h,$r);var u=ro(h);function h(t,n,e,i,r,o){var s;no(this,h),(s=u.call(this)).type="BoxBufferGeometry",s.parameters={width:t,height:n,depth:e,widthSegments:i,heightSegments:r,depthSegments:o};var L=oo(s);t=t||1,n=n||1,e=e||1,i=Math.floor(i)||1,r=Math.floor(r)||1,o=Math.floor(o)||1;var R=[],O=[],A=[],C=[],k=0,P=0;function a(t,n,e,i,r,o,s,a,u,h,c){for(var f=o/u,l=s/h,d=o/2,v=s/2,p=a/2,m=u+1,g=h+1,y=0,b=0,_=new St,w=0;w<g;w++)for(var x=w*l-v,M=0;M<m;M++)_[t]=(M*f-d)*i,_[n]=x*r,_[e]=p,O.push(_.x,_.y,_.z),_[t]=0,_[n]=0,_[e]=0<a?1:-1,A.push(_.x,_.y,_.z),C.push(M/u),C.push(1-w/h),y+=1;for(w=0;w<h;w++)for(M=0;M<u;M++){var S=k+M+m*(w+1),E=k+(M+1)+m*(w+1),T=k+(M+1)+m*w;R.push(k+M+m*w,S,T),R.push(S,E,T),b+=6}L.addGroup(P,b,c),P+=b,k+=y}return a("z","y","x",-1,-1,e,n,t,o,r,0),a("z","y","x",1,-1,e,n,-t,o,r,1),a("x","z","y",1,1,t,e,n,i,o,2),a("x","z","y",1,-1,t,e,-n,i,o,3),a("x","y","z",1,-1,t,n,e,i,r,4),a("x","y","z",-1,-1,t,n,-e,i,r,5),s.setIndex(R),s.setAttribute("position",new Hr(O,3)),s.setAttribute("normal",new Hr(A,3)),s.setAttribute("uv",new Hr(C,2)),s}return h}();function uo(t,n,e,i){$r.call(this),this.type="PlaneBufferGeometry",this.parameters={width:t,height:n,widthSegments:e,heightSegments:i};for(var r=(t=t||1)/2,o=(n=n||1)/2,s=Math.floor(e)||1,a=Math.floor(i)||1,u=s+1,h=a+1,c=t/s,f=n/a,l=[],d=[],v=[],p=[],m=0;m<h;m++)for(var g=m*f-o,y=0;y<u;y++)d.push(y*c-r,-g,0),v.push(0,0,1),p.push(y/s),p.push(1-m/a);for(m=0;m<a;m++)for(y=0;y<s;y++){var b=y+u*(m+1),_=y+1+u*(m+1),w=y+1+u*m;l.push(y+u*m,b,w),l.push(b,_,w)}this.setIndex(l),this.setAttribute("position",new Hr(d,3)),this.setAttribute("normal",new Hr(v,3)),this.setAttribute("uv",new Hr(p,2))}(uo.prototype=Object.create($r.prototype)).constructor=uo;var ho=new St,co=new St,fo=new St,lo=new St,vo=new St,po=new St,mo=new St,go=new St,yo=new St,bo=new St;function _o(t,n,e){this.a=void 0!==t?t:new St,this.b=void 0!==n?n:new St,this.c=void 0!==e?e:new St}function wo(t){tr.call(this),this.type="MeshBasicMaterial",this.color=new _i(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=an,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(_o,{getNormal:function(t,n,e,i){void 0===i&&(console.warn("THREE.Triangle: .getNormal() target is now required"),i=new St),i.subVectors(e,n),ho.subVectors(t,n),i.cross(ho);n=i.lengthSq();return 0<n?i.multiplyScalar(1/Math.sqrt(n)):i.set(0,0,0)},getBarycoord:function(t,n,e,i,r){ho.subVectors(i,n),co.subVectors(e,n),fo.subVectors(t,n);var o=ho.dot(ho),s=ho.dot(co),i=ho.dot(fo),e=co.dot(co),t=co.dot(fo),n=o*e-s*s;if(void 0===r&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),r=new St),0==n)return r.set(-2,-1,-1);n=1/n,e=(e*i-s*t)*n,n*=o*t-s*i;return r.set(1-e-n,n,e)},containsPoint:function(t,n,e,i){return _o.getBarycoord(t,n,e,i,lo),0<=lo.x&&0<=lo.y&&lo.x+lo.y<=1},getUV:function(t,n,e,i,r,o,s,a){return this.getBarycoord(t,n,e,i,lo),a.set(0,0),a.addScaledVector(r,lo.x),a.addScaledVector(o,lo.y),a.addScaledVector(s,lo.z),a},isFrontFacing:function(t,n,e,i){return ho.subVectors(e,n),co.subVectors(t,n),ho.cross(co).dot(i)<0}}),Object.assign(_o.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 ho.subVectors(this.c,this.b),co.subVectors(this.a,this.b),.5*ho.cross(co).length()},getMidpoint:function(t){return void 0===t&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),t=new St),t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},getNormal:function(t){return _o.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 at),t.setFromCoplanarPoints(this.a,this.b,this.c)},getBarycoord:function(t,n){return _o.getBarycoord(t,this.a,this.b,this.c,n)},getUV:function(t,n,e,i,r){return _o.getUV(t,this.a,this.b,this.c,n,e,i,r)},containsPoint:function(t){return _o.containsPoint(t,this.a,this.b,this.c)},isFrontFacing:function(t){return _o.isFrontFacing(this.a,this.b,this.c,t)},intersectsBox:function(t){return t.intersectsTriangle(this)},closestPointToPoint:function(t,n){void 0===n&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),n=new St);var e=this.a,i=this.b,r=this.c;vo.subVectors(i,e),po.subVectors(r,e),go.subVectors(t,e);var o=vo.dot(go),s=po.dot(go);if(o<=0&&s<=0)return n.copy(e);yo.subVectors(t,i);var a=vo.dot(yo),u=po.dot(yo);if(0<=a&&u<=a)return n.copy(i);var h=o*u-a*s;if(h<=0&&0<=o&&a<=0)return f=o/(o-a),n.copy(e).addScaledVector(vo,f);bo.subVectors(t,r);var c=vo.dot(bo),t=po.dot(bo);if(0<=t&&c<=t)return n.copy(r);o=c*s-o*t;if(o<=0&&0<=s&&t<=0)return l=s/(s-t),n.copy(e).addScaledVector(po,l);s=a*t-c*u;if(s<=0&&0<=u-a&&0<=c-t)return mo.subVectors(r,i),l=(u-a)/(u-a+(c-t)),n.copy(i).addScaledVector(mo,l);var s=1/(s+o+h),f=o*s,l=h*s;return n.copy(e).addScaledVector(vo,f).addScaledVector(po,l)},equals:function(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}),((wo.prototype=Object.create(tr.prototype)).constructor=wo).prototype.isMeshBasicMaterial=!0,wo.prototype.copy=function(t){return tr.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 xo=new Et,Mo=new Zi,So=new et,Eo=new St,To=new St,Lo=new St,Ro=new St,Oo=new St,Ao=new St,Co=new St,ko=new St,Po=new St,Do=new ci,jo=new ci,Io=new ci,No=new St,Fo=new St;function Uo(t,n){Z.call(this),this.type="Mesh",this.geometry=void 0!==t?t:new $r,this.material=void 0!==n?n:new wo,this.updateMorphTargets()}function Bo(t,n,e,i,r,o,s,a){n=n.side===Rt?i.intersectTriangle(s,o,r,!0,a):i.intersectTriangle(r,o,s,n.side!==Ot,a);if(null===n)return null;Fo.copy(a),Fo.applyMatrix4(t.matrixWorld);a=e.ray.origin.distanceTo(Fo);return a<e.near||a>e.far?null:{distance:a,point:Fo.clone(),object:t}}function Go(t,n,e,i,r,o,s,a,u,h,c,f){Eo.fromBufferAttribute(r,h),To.fromBufferAttribute(r,c),Lo.fromBufferAttribute(r,f);var l=t.morphTargetInfluences;if(n.morphTargets&&o&&l){Co.set(0,0,0),ko.set(0,0,0),Po.set(0,0,0);for(var d=0,v=o.length;d<v;d++){var p=l[d],m=o[d];0!==p&&(Ro.fromBufferAttribute(m,h),Oo.fromBufferAttribute(m,c),Ao.fromBufferAttribute(m,f),s?(Co.addScaledVector(Ro,p),ko.addScaledVector(Oo,p),Po.addScaledVector(Ao,p)):(Co.addScaledVector(Ro.sub(Eo),p),ko.addScaledVector(Oo.sub(To),p),Po.addScaledVector(Ao.sub(Lo),p)))}Eo.add(Co),To.add(ko),Lo.add(Po)}i=Bo(t,n,e,i,Eo,To,Lo,No);return i&&(a&&(Do.fromBufferAttribute(a,h),jo.fromBufferAttribute(a,c),Io.fromBufferAttribute(a,f),i.uv=_o.getUV(No,Eo,To,Lo,Do,jo,Io,new ci)),u&&(Do.fromBufferAttribute(u,h),jo.fromBufferAttribute(u,c),Io.fromBufferAttribute(u,f),i.uv2=_o.getUV(No,Eo,To,Lo,Do,jo,Io,new ci)),u=new Lr(h,c,f),_o.getNormal(Eo,To,Lo,u.normal),i.face=u),i}function Ho(o,e,s,i){var a,u,h=new _i(0),c=0,f=null,l=0,d=null;function v(t,n){e.buffers.color.setClear(t.r,t.g,t.b,n,i)}return{getClearColor:function(){return h},setClearColor:function(t,n){h.set(t),v(h,c=void 0!==n?n:1)},getClearAlpha:function(){return c},setClearAlpha:function(t){v(h,c=t)},render:function(t,n,e,i){var r=n.background,n=(n=o.xr).getSession&&n.getSession();null===(r=n&&"additive"===n.environmentBlendMode?null:r)?v(h,c):r&&r.isColor&&(v(r,1),i=!0),(o.autoClear||i)&&o.clear(o.autoClearColor,o.autoClearDepth,o.autoClearStencil),r&&(r.isCubeTexture||r.isWebGLCubeRenderTarget||r.mapping===wn)?(void 0===u&&((u=new Uo(new ao(1,1,1),new cr({type:"BackgroundCubeMaterial",uniforms:ir(ar.cube.uniforms),vertexShader:ar.cube.vertexShader,fragmentShader:ar.cube.fragmentShader,side:Rt,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(t,n,e){this.matrixWorld.copyPosition(e.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),s.update(u)),i=r.isWebGLCubeRenderTarget?r.texture:r,u.material.uniforms.envMap.value=i,u.material.uniforms.flipEnvMap.value=i.isCubeTexture?-1:1,f===r&&l===i.version&&d===o.toneMapping||(u.material.needsUpdate=!0,f=r,l=i.version,d=o.toneMapping),t.unshift(u,u.geometry,u.material,0,0,null)):r&&r.isTexture&&(void 0===a&&((a=new Uo(new uo(2,2),new cr({type:"BackgroundMaterial",uniforms:ir(ar.background.uniforms),vertexShader:ar.background.vertexShader,fragmentShader:ar.background.fragmentShader,side:Lt,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),Object.defineProperty(a.material,"map",{get:function(){return this.uniforms.t2D.value}}),s.update(a)),!0===(a.material.uniforms.t2D.value=r).matrixAutoUpdate&&r.updateMatrix(),a.material.uniforms.uvTransform.value.copy(r.matrix),f===r&&l===r.version&&d===o.toneMapping||(a.material.needsUpdate=!0,l=(f=r).version,d=o.toneMapping),t.unshift(a,a.geometry,a.material,0,0,null))}}}function Vo(s,a,u,t){var h,c=t.isWebGL2;this.setMode=function(t){h=t},this.render=function(t,n){s.drawArrays(h,t,n),u.update(n,h)},this.renderInstances=function(t,n,e,i){if(0!==i){var r,o;if(c)r=s,o="drawArraysInstanced";else if(o="drawArraysInstancedANGLE",null===(r=a.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");r[o](h,n,e,i),u.update(e,h,i)}}}function zo(n,e,t){var i;function r(t){if("highp"===t){if(0<n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.HIGH_FLOAT).precision&&0<n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision)return"highp";t="mediump"}return"mediump"===t&&0<n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).precision&&0<n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).precision?"mediump":"lowp"}var o="undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext||"undefined"!=typeof WebGL2ComputeRenderingContext&&n instanceof WebGL2ComputeRenderingContext,s=void 0!==t.precision?t.precision:"highp",a=r(s);a!==s&&(console.warn("THREE.WebGLRenderer:",s,"not supported, using",a,"instead."),s=a);var u=!0===t.logarithmicDepthBuffer,h=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),c=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),f=n.getParameter(n.MAX_TEXTURE_SIZE),l=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),d=n.getParameter(n.MAX_VERTEX_ATTRIBS),v=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),p=n.getParameter(n.MAX_VARYING_VECTORS),m=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),a=0<c,t=o||!!e.get("OES_texture_float");return{isWebGL2:o,getMaxAnisotropy:function(){if(void 0!==i)return i;var t=e.get("EXT_texture_filter_anisotropic");return i=null!==t?n.getParameter(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0},getMaxPrecision:r,precision:s,logarithmicDepthBuffer:u,maxTextures:h,maxVertexTextures:c,maxTextureSize:f,maxCubemapSize:l,maxAttributes:d,maxVertexUniforms:v,maxVaryings:p,maxFragmentUniforms:m,vertexTextures:a,floatFragmentTextures:t,floatVertexTextures:a&&t,maxSamples:o?n.getParameter(n.MAX_SAMPLES):0}}function Wo(){var h=this,c=null,f=0,l=!1,d=!1,v=new at,p=new x,m={value:null,needsUpdate:!1};function g(){m.value!==c&&(m.value=c,m.needsUpdate=0<f),h.numPlanes=f,h.numIntersection=0}function y(t,n,e,i){var r=null!==t?t.length:0,o=null;if(0!==r){if(o=m.value,!0!==i||null===o){var i=e+4*r,s=n.matrixWorldInverse;p.getNormalMatrix(s),(null===o||o.length<i)&&(o=new Float32Array(i));for(var a=0,u=e;a!==r;++a,u+=4)v.copy(t[a]).applyMatrix4(s,p),v.normal.toArray(o,u),o[u+3]=v.constant}m.value=o,m.needsUpdate=!0}return h.numPlanes=r,h.numIntersection=0,o}this.uniform=m,this.numPlanes=0,this.numIntersection=0,this.init=function(t,n,e){var i=0!==t.length||n||0!==f||l;return l=n,c=y(t,e,0),f=t.length,i},this.beginShadows=function(){d=!0,y(null)},this.endShadows=function(){d=!1,g()},this.setState=function(t,n,e,i,r,o){if(!l||null===t||0===t.length||d&&!e)d?y(null):g();else{var e=d?0:f,s=4*e,a=r.clippingState||null;m.value=a;for(var a=y(t,i,s,o),u=0;u!==s;++u)a[u]=c[u];r.clippingState=a,this.numIntersection=n?this.numPlanes:0,this.numPlanes+=e}}}function Xo(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 Zo(f,l,i){var r=new WeakMap,d=new WeakMap;function o(t){var n,t=t.target,e=r.get(t);for(n in null!==e.index&&l.remove(e.index),e.attributes)l.remove(e.attributes[n]);t.removeEventListener("dispose",o),r.delete(t);t=d.get(e);t&&(l.remove(t),d.delete(e)),i.memory.geometries--}function s(t){var n=[],e=t.index,i=t.attributes.position,r=0;if(null!==e)for(var o=e.array,r=e.version,s=0,a=o.length;s<a;s+=3){var u=o[s+0],h=o[s+1],c=o[s+2];n.push(u,h,h,c,c,u)}else{o=i.array;r=i.version;for(s=0,a=o.length/3-1;s<a;s+=3)n.push(u=s+0,h=s+1,h,c=s+2,c,u)}i=new(65535<Wr(n)?Gr:Ur)(n,1);i.version=r,l.update(i,f.ELEMENT_ARRAY_BUFFER);r=d.get(t);r&&l.remove(r),d.set(t,i)}return{get:function(t,n){var e=r.get(n);return e||(n.addEventListener("dispose",o),n.isBufferGeometry?e=n:n.isGeometry&&(void 0===n.oe&&(n.oe=(new $r).setFromObject(t)),e=n.oe),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 Yo(s,a,u,t){var h,c,f,l=t.isWebGL2;this.setMode=function(t){h=t},this.setIndex=function(t){c=t.type,f=t.bytesPerElement},this.render=function(t,n){s.drawElements(h,n,c,t*f),u.update(n,h)},this.renderInstances=function(t,n,e,i){if(0!==i){var r,o;if(l)r=s,o="drawElementsInstanced";else if(o="drawElementsInstancedANGLE",null===(r=a.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");r[o](h,e,c,n*f,i),u.update(e,h,i)}}}function qo(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 Ko(t,n){return Math.abs(n[1])-Math.abs(t[1])}function Jo(v){var p={},m=new Float32Array(8);return{update:function(t,n,e,i){var r=t.morphTargetInfluences,o=void 0===r?0:r.length;if(void 0===(s=p[n.id])){for(var s=[],a=0;a<o;a++)s[a]=[a,0];p[n.id]=s}for(var u=e.morphTargets&&n.morphAttributes.position,h=e.morphNormals&&n.morphAttributes.normal,a=0;a<o;a++)0!==(c=s[a])[1]&&(u&&n.deleteAttribute("morphTarget"+a),h&&n.deleteAttribute("morphNormal"+a));for(a=0;a<o;a++)(c=s[a])[0]=a,c[1]=r[a];s.sort(Ko);for(var c,f=0,a=0;a<8;a++){if(c=s[a]){var l=c[0],d=c[1];if(d){u&&n.setAttribute("morphTarget"+a,u[l]),h&&n.setAttribute("morphNormal"+a,h[l]),f+=m[a]=d;continue}}m[a]=0}e=n.morphTargetsRelative?1:1-f,i.getUniforms().setValue(v,"morphTargetBaseInfluence",e),i.getUniforms().setValue(v,"morphTargetInfluences",m)}}}function Qo(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 $o(t,n,e,i,r,o,s,a,u,h){xr.call(this,t=void 0!==t?t:[],n=void 0!==n?n:mn,e,i,r,o,s=void 0!==s?s:Wn,a,u,h),this.flipY=!1}function ts(t,n,e,i){xr.call(this,null),this.image={data:t||null,width:n||1,height:e||1,depth:i||1},this.magFilter=Tn,this.minFilter=Tn,this.wrapR=Sn,this.generateMipmaps=!1,this.flipY=!1,this.needsUpdate=!0}function ns(t,n,e,i){xr.call(this,null),this.image={data:t||null,width:n||1,height:e||1,depth:i||1},this.magFilter=Tn,this.minFilter=Tn,this.wrapR=Sn,this.generateMipmaps=!1,this.flipY=!1,this.needsUpdate=!0}Uo.prototype=Object.assign(Object.create(Z.prototype),{constructor:Uo,isMesh:!0,copy:function(t){return Z.prototype.copy.call(this,t),void 0!==t.morphTargetInfluences&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),void 0!==t.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this},updateMorphTargets:function(){var t,n,e,i=this.geometry;if(i.isBufferGeometry){var r=i.morphAttributes,o=Object.keys(r);if(0<o.length){var s=r[o[0]];if(void 0!==s)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},t=0,n=s.length;t<n;t++)e=s[t].name||String(t),this.morphTargetInfluences.push(0),this.morphTargetDictionary[e]=t}}else{i=i.morphTargets;void 0!==i&&0<i.length&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},raycast:function(t,n){var e=this.geometry,i=this.material,r=this.matrixWorld;if(void 0!==i&&(null===e.boundingSphere&&e.computeBoundingSphere(),So.copy(e.boundingSphere),So.applyMatrix4(r),!1!==t.ray.intersectsSphere(So)&&(xo.getInverse(r),Mo.copy(t.ray).applyMatrix4(xo),null===e.boundingBox||!1!==Mo.intersectsBox(e.boundingBox))))if(e.isBufferGeometry){var o,s,a,u,h,c,f,l,d,v=e.index,p=e.attributes.position,m=e.morphAttributes.position,g=e.morphTargetsRelative,y=e.attributes.uv,b=e.attributes.uv2,_=e.groups,w=e.drawRange;if(null!==v)if(Array.isArray(i))for(u=0,c=_.length;u<c;u++)for(d=i[(l=_[u]).materialIndex],h=Math.max(l.start,w.start),f=Math.min(l.start+l.count,w.start+w.count);h<f;h+=3)o=v.getX(h),s=v.getX(h+1),a=v.getX(h+2),(C=Go(this,d,t,Mo,p,m,g,y,b,o,s,a))&&(C.faceIndex=Math.floor(h/3),C.face.materialIndex=l.materialIndex,n.push(C));else for(u=Math.max(0,w.start),c=Math.min(v.count,w.start+w.count);u<c;u+=3)o=v.getX(u),s=v.getX(u+1),a=v.getX(u+2),(C=Go(this,i,t,Mo,p,m,g,y,b,o,s,a))&&(C.faceIndex=Math.floor(u/3),n.push(C));else if(void 0!==p)if(Array.isArray(i))for(u=0,c=_.length;u<c;u++)for(d=i[(l=_[u]).materialIndex],h=Math.max(l.start,w.start),f=Math.min(l.start+l.count,w.start+w.count);h<f;h+=3)(C=Go(this,d,t,Mo,p,m,g,y,b,o=h,s=h+1,a=h+2))&&(C.faceIndex=Math.floor(h/3),C.face.materialIndex=l.materialIndex,n.push(C));else for(u=Math.max(0,w.start),c=Math.min(p.count,w.start+w.count);u<c;u+=3)(C=Go(this,i,t,Mo,p,m,g,y,b,o=u,s=u+1,a=u+2))&&(C.faceIndex=Math.floor(u/3),n.push(C))}else if(e.isGeometry){var x,M=Array.isArray(i),S=e.vertices,E=e.faces,e=e.faceVertexUvs[0];0<e.length&&(x=e);for(var T=0,L=E.length;T<L;T++){var R,O,A,C,k=E[T],P=M?i[k.materialIndex]:i;void 0!==P&&(R=S[k.a],O=S[k.b],A=S[k.c],(C=Bo(this,P,t,Mo,R,O,A,No))&&(x&&x[T]&&(P=x[T],Do.copy(P[0]),jo.copy(P[1]),Io.copy(P[2]),C.uv=_o.getUV(No,R,O,A,Do,jo,Io,new ci)),C.face=k,C.faceIndex=T,n.push(C)))}}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),(($o.prototype=Object.create(xr.prototype)).constructor=$o).prototype.isCubeTexture=!0,Object.defineProperty($o.prototype,"images",{get:function(){return this.image},set:function(t){this.image=t}}),((ts.prototype=Object.create(xr.prototype)).constructor=ts).prototype.isDataTexture2DArray=!0,((ns.prototype=Object.create(xr.prototype)).constructor=ns).prototype.isDataTexture3D=!0;var es=new xr,is=new ts,rs=new ns,os=new $o,ss=[],as=[],us=new Float32Array(16),hs=new Float32Array(9),cs=new Float32Array(4);function fs(t,n,e){var i=t[0];if(i<=0||0<i)return t;var r=n*e,o=ss[r];if(void 0===o&&(o=new Float32Array(r),ss[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 ls(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 ds(t,n){for(var e=0,i=n.length;e<i;e++)t[e]=n[e]}function vs(t,n){var e=as[n];void 0===e&&(e=new Int32Array(n),as[n]=e);for(var i=0;i!==n;++i)e[i]=t.allocateTextureUnit();return e}function ps(t,n){var e=this.cache;e[0]!==n&&(t.uniform1f(this.addr,n),e[0]=n)}function ms(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):ls(e,n)||(t.uniform2fv(this.addr,n),ds(e,n))}function gs(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):ls(e,n)||(t.uniform3fv(this.addr,n),ds(e,n))}function ys(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):ls(e,n)||(t.uniform4fv(this.addr,n),ds(e,n))}function bs(t,n){var e=this.cache,i=n.elements;void 0===i?ls(e,n)||(t.uniformMatrix2fv(this.addr,!1,n),ds(e,n)):ls(e,i)||(cs.set(i),t.uniformMatrix2fv(this.addr,!1,cs),ds(e,i))}function _s(t,n){var e=this.cache,i=n.elements;void 0===i?ls(e,n)||(t.uniformMatrix3fv(this.addr,!1,n),ds(e,n)):ls(e,i)||(hs.set(i),t.uniformMatrix3fv(this.addr,!1,hs),ds(e,i))}function ws(t,n){var e=this.cache,i=n.elements;void 0===i?ls(e,n)||(t.uniformMatrix4fv(this.addr,!1,n),ds(e,n)):ls(e,i)||(us.set(i),t.uniformMatrix4fv(this.addr,!1,us),ds(e,i))}function xs(t,n,e){var i=this.cache,r=e.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),e.safeSetTexture2D(n||es,r)}function Ms(t,n,e){var i=this.cache,r=e.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),e.setTexture2DArray(n||is,r)}function Ss(t,n,e){var i=this.cache,r=e.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),e.setTexture3D(n||rs,r)}function Es(t,n,e){var i=this.cache,r=e.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),e.safeSetTextureCube(n||os,r)}function Ts(t,n){var e=this.cache;e[0]!==n&&(t.uniform1i(this.addr,n),e[0]=n)}function Ls(t,n){var e=this.cache;ls(e,n)||(t.uniform2iv(this.addr,n),ds(e,n))}function Rs(t,n){var e=this.cache;ls(e,n)||(t.uniform3iv(this.addr,n),ds(e,n))}function Os(t,n){var e=this.cache;ls(e,n)||(t.uniform4iv(this.addr,n),ds(e,n))}function As(t,n){var e=this.cache;e[0]!==n&&(t.uniform1ui(this.addr,n),e[0]=n)}function Cs(t,n){t.uniform1fv(this.addr,n)}function ks(t,n){t.uniform1iv(this.addr,n)}function Ps(t,n){t.uniform2iv(this.addr,n)}function Ds(t,n){t.uniform3iv(this.addr,n)}function js(t,n){t.uniform4iv(this.addr,n)}function Is(t,n){n=fs(n,this.size,2);t.uniform2fv(this.addr,n)}function Ns(t,n){n=fs(n,this.size,3);t.uniform3fv(this.addr,n)}function Fs(t,n){n=fs(n,this.size,4);t.uniform4fv(this.addr,n)}function Us(t,n){n=fs(n,this.size,4);t.uniformMatrix2fv(this.addr,!1,n)}function Bs(t,n){n=fs(n,this.size,9);t.uniformMatrix3fv(this.addr,!1,n)}function Gs(t,n){n=fs(n,this.size,16);t.uniformMatrix4fv(this.addr,!1,n)}function Hs(t,n,e){var i=n.length,r=vs(e,i);t.uniform1iv(this.addr,r);for(var o=0;o!==i;++o)e.safeSetTexture2D(n[o]||es,r[o])}function Vs(t,n,e){var i=n.length,r=vs(e,i);t.uniform1iv(this.addr,r);for(var o=0;o!==i;++o)e.safeSetTextureCube(n[o]||os,r[o])}function zs(t,n,e){this.id=t,this.addr=e,this.cache=[],this.setValue=function(t){switch(t){case 5126:return ps;case 35664:return ms;case 35665:return gs;case 35666:return ys;case 35674:return bs;case 35675:return _s;case 35676:return ws;case 5124:case 35670:return Ts;case 35667:case 35671:return Ls;case 35668:case 35672:return Rs;case 35669:case 35673:return Os;case 5125:return As;case 35678:case 36198:case 36298:case 36306:case 35682:return xs;case 35679:case 36299:case 36307:return Ss;case 35680:case 36300:case 36308:case 36293:return Es;case 36289:case 36303:case 36311:case 36292:return Ms}}(n.type)}function Ws(t,n,e){this.id=t,this.addr=e,this.cache=[],this.size=n.size,this.setValue=function(t){switch(t){case 5126:return Cs;case 35664:return Is;case 35665:return Ns;case 35666:return Fs;case 35674:return Us;case 35675:return Bs;case 35676:return Gs;case 5124:case 35670:return ks;case 35667:case 35671:return Ps;case 35668:case 35672:return Ds;case 35669:case 35673:return js;case 35678:case 36198:case 36298:case 36306:case 35682:return Hs;case 35680:case 36300:case 36308:case 36293:return Vs}}(n.type)}function Xs(t){this.id=t,this.seq=[],this.map={}}Ws.prototype.updateCache=function(t){var n=this.cache;t instanceof Float32Array&&n.length!==t.length&&(this.cache=new Float32Array(t.length)),ds(n,t)},Xs.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 Zs=/([\w\d_]+)(\])?(\[|\.)?/g;function Ys(t,n){t.seq.push(n),t.map[n.id]=n}function qs(t,n){this.seq=[],this.map={};for(var e=t.getProgramParameter(n,t.ACTIVE_UNIFORMS),i=0;i<e;++i){var r=t.getActiveUniform(n,i);!function(t,n,e){var i=t.name,r=i.length;for(Zs.lastIndex=0;;){var o=Zs.exec(i),s=Zs.lastIndex,a=o[1],u="]"===o[2],o=o[3];if(u&&(a|=0),void 0===o||"["===o&&s+2===r){Ys(e,new(void 0===o?zs:Ws)(a,t,n));break}o=e.map[a];void 0===o&&Ys(e,o=new Xs(a)),e=o}}(r,t.getUniformLocation(n,r.name),this)}}function Ks(t,n,e){n=t.createShader(n);return t.shaderSource(n,e),t.compileShader(n),n}qs.prototype.setValue=function(t,n,e,i){n=this.map[n];void 0!==n&&n.setValue(t,e,i)},qs.prototype.setOptional=function(t,n,e){n=n[e];void 0!==n&&this.setValue(t,e,n)},qs.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)}},qs.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 Js=0;function Qs(t){switch(t){case Ye:return["Linear","( value )"];case qe:return["sRGB","( value )"];case Je:return["RGBE","( value )"];case $e:return["RGBM","( value, 7.0 )"];case ti:return["RGBM","( value, 16.0 )"];case ni:return["RGBD","( value, 256.0 )"];case Ke:return["Gamma","( value, float( GAMMA_FACTOR ) )"];case Qe:return["LogLuv","( value )"];default:throw new Error("unsupported encoding: "+t)}}function $s(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 ta(t,n){n=Qs(n);return"vec4 "+t+"( vec4 value ) { return "+n[0]+"ToLinear"+n[1]+"; }"}function na(t){return""!==t}function ea(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 ia(t,n){return t.replace(/NUM_CLIPPING_PLANES/g,n.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,n.numClippingPlanes-n.numClipIntersection)}var ra=/^[ \t]*#include +<([\w\d./]+)>/gm;function oa(t){return t.replace(ra,sa)}function sa(t,n){var e=er[n];if(void 0===e)throw new Error("Can not resolve #include <"+n+">");return oa(e)}var aa=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,ua=/#pragma unroll_loop_start[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}[\s]+?#pragma unroll_loop_end/g;function ha(t){return t.replace(ua,fa).replace(aa,ca)}function ca(t,n,e,i){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),fa(0,n,e,i)}function fa(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 la(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 da(t,n,e){var i,r,o,s=t.getContext(),a=e.defines,u=e.vertexShader,h=e.fragmentShader,c=(v="SHADOWMAP_TYPE_BASIC",(d=e).shadowMapType===_t?v="SHADOWMAP_TYPE_PCF":d.shadowMapType===wt?v="SHADOWMAP_TYPE_PCF_SOFT":d.shadowMapType===xt&&(v="SHADOWMAP_TYPE_VSM"),v),f=function(t){var n="ENVMAP_TYPE_CUBE";if(t.envMap)switch(t.envMapMode){case mn:case gn:n="ENVMAP_TYPE_CUBE";break;case wn:case xn:n="ENVMAP_TYPE_CUBE_UV";break;case yn:case bn:n="ENVMAP_TYPE_EQUIREC";break;case _n:n="ENVMAP_TYPE_SPHERE"}return n}(e),l=function(t){var n="ENVMAP_MODE_REFLECTION";if(t.envMap)switch(t.envMapMode){case gn:case bn:n="ENVMAP_MODE_REFRACTION"}return n}(e),d=function(t){var n="ENVMAP_BLENDING_NONE";if(t.envMap)switch(t.combine){case an:n="ENVMAP_BLENDING_MULTIPLY";break;case un:n="ENVMAP_BLENDING_MIX";break;case hn:n="ENVMAP_BLENDING_ADD"}return n}(e),v=0<t.gammaFactor?t.gammaFactor:1,i=e.isWebGL2?"":[(i=e).extensionDerivatives||i.envMapCubeUV||i.bumpMap||i.tangentSpaceNormalMap||i.clearcoatNormalMap||i.flatShading||"physical"===i.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(i.extensionFragDepth||i.logarithmicDepthBuffer)&&i.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",i.extensionDrawBuffers&&i.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(i.extensionShaderTextureLOD||i.envMap)&&i.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(na).join("\n"),a=function(t){var n,e=[];for(n in t){var i=t[n];!1!==i&&e.push("#define "+n+" "+i)}return e.join("\n")}(a),p=s.createProgram();e.isRawShaderMaterial?(0<(r=[a].filter(na).join("\n")).length&&(r+="\n"),0<(o=[i,a].filter(na).join("\n")).length&&(o+="\n")):(r=[la(e),"#define SHADER_NAME "+e.shaderName,a,e.instancing?"#define USE_INSTANCING":"",e.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+v,"#define MAX_BONES "+e.maxBones,e.useFog&&e.fog?"#define USE_FOG":"",e.useFog&&e.fogExp2?"#define FOG_EXP2":"",e.map?"#define USE_MAP":"",e.envMap?"#define USE_ENVMAP":"",e.envMap?"#define "+l:"",e.lightMap?"#define USE_LIGHTMAP":"",e.aoMap?"#define USE_AOMAP":"",e.emissiveMap?"#define USE_EMISSIVEMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.normalMap&&e.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",e.normalMap&&e.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",e.clearcoatMap?"#define USE_CLEARCOATMAP":"",e.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",e.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",e.displacementMap&&e.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.roughnessMap?"#define USE_ROUGHNESSMAP":"",e.metalnessMap?"#define USE_METALNESSMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.vertexTangents?"#define USE_TANGENT":"",e.vertexColors?"#define USE_COLOR":"",e.vertexUvs?"#define USE_UV":"",e.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",e.flatShading?"#define FLAT_SHADED":"",e.skinning?"#define USE_SKINNING":"",e.useVertexTexture?"#define BONE_TEXTURE":"",e.morphTargets?"#define USE_MORPHTARGETS":"",e.morphNormals&&!1===e.flatShading?"#define USE_MORPHNORMALS":"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+c:"",e.sizeAttenuation?"#define USE_SIZEATTENUATION":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",e.logarithmicDepthBuffer&&e.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(na).join("\n"),o=[i,la(e),"#define SHADER_NAME "+e.shaderName,a,e.alphaTest?"#define ALPHATEST "+e.alphaTest+(e.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+v,e.useFog&&e.fog?"#define USE_FOG":"",e.useFog&&e.fogExp2?"#define FOG_EXP2":"",e.map?"#define USE_MAP":"",e.matcap?"#define USE_MATCAP":"",e.envMap?"#define USE_ENVMAP":"",e.envMap?"#define "+f:"",e.envMap?"#define "+l:"",e.envMap?"#define "+d:"",e.lightMap?"#define USE_LIGHTMAP":"",e.aoMap?"#define USE_AOMAP":"",e.emissiveMap?"#define USE_EMISSIVEMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.normalMap&&e.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",e.normalMap&&e.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",e.clearcoatMap?"#define USE_CLEARCOATMAP":"",e.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",e.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.roughnessMap?"#define USE_ROUGHNESSMAP":"",e.metalnessMap?"#define USE_METALNESSMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.sheen?"#define USE_SHEEN":"",e.vertexTangents?"#define USE_TANGENT":"",e.vertexColors?"#define USE_COLOR":"",e.vertexUvs?"#define USE_UV":"",e.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",e.gradientMap?"#define USE_GRADIENTMAP":"",e.flatShading?"#define FLAT_SHADED":"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+c:"",e.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",e.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",e.logarithmicDepthBuffer&&e.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(e.extensionShaderTextureLOD||e.envMap)&&e.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",e.toneMapping!==cn?"#define TONE_MAPPING":"",e.toneMapping!==cn?er.tonemapping_pars_fragment:"",e.toneMapping!==cn?function(t,n){var e;switch(n){case fn:e="Linear";break;case ln:e="Reinhard";break;case dn:e="Uncharted2";break;case vn:e="OptimizedCineon";break;case pn: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?er.encodings_pars_fragment:"",e.mapEncoding?ta("mapTexelToLinear",e.mapEncoding):"",e.matcapEncoding?ta("matcapTexelToLinear",e.matcapEncoding):"",e.envMapEncoding?ta("envMapTexelToLinear",e.envMapEncoding):"",e.emissiveMapEncoding?ta("emissiveMapTexelToLinear",e.emissiveMapEncoding):"",e.lightMapEncoding?ta("lightMapTexelToLinear",e.lightMapEncoding):"",e.outputEncoding?(w="linearToOutputTexel",m=Qs(m=e.outputEncoding),"vec4 "+w+"( vec4 value ) { return LinearTo"+m[0]+m[1]+"; }"):"",e.depthPacking?"#define DEPTH_PACKING "+e.depthPacking:"","\n"].filter(na).join("\n")),u=ia(u=ea(u=oa(u),e),e),h=ia(h=ea(h=oa(h),e),e),u=ha(u),h=ha(h),e.isWebGL2&&!e.isRawShaderMaterial&&(y=!1,g=/^\s*#version\s+300\s+es\s*\n/,e.isShaderMaterial&&null!==u.match(g)&&null!==h.match(g)&&(y=!0,u=u.replace(g,""),h=h.replace(g,"")),r=["#version 300 es\n","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+r,o=["#version 300 es\n","#define varying in",y?"":"out highp vec4 pc_fragColor;",y?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+o);var m,g,y,b,_,d=o+h,c=Ks(s,s.VERTEX_SHADER,r+u),w=Ks(s,s.FRAGMENT_SHADER,d);return s.attachShader(p,c),s.attachShader(p,w),void 0!==e.index0AttributeName?s.bindAttribLocation(p,0,e.index0AttributeName):!0===e.morphTargets&&s.bindAttribLocation(p,0,"position"),s.linkProgram(p),t.debug.checkShaderErrors&&(m=s.getProgramInfoLog(p).trim(),g=s.getShaderInfoLog(c).trim(),y=s.getShaderInfoLog(w).trim(),!(u=h=!0)===s.getProgramParameter(p,s.LINK_STATUS)?(h=!1,d=$s(s,c,"vertex"),t=$s(s,w,"fragment"),console.error("THREE.WebGLProgram: shader error: ",s.getError(),"gl.VALIDATE_STATUS",s.getProgramParameter(p,s.VALIDATE_STATUS),"gl.getProgramInfoLog",m,d,t)):""!==m?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",m):""!==g&&""!==y||(u=!1),u&&(this.diagnostics={runnable:h,programLog:m,vertexShader:{log:g,prefix:r},fragmentShader:{log:y,prefix:o}})),s.detachShader(p,c),s.detachShader(p,w),s.deleteShader(c),s.deleteShader(w),this.getUniforms=function(){return b=void 0===b?new qs(s,p):b},this.getAttributes=function(){return _=void 0===_?function(t,n){for(var e={},i=t.getProgramParameter(n,t.ACTIVE_ATTRIBUTES),r=0;r<i;r++){var o=t.getActiveAttrib(n,r).name;e[o]=t.getAttribLocation(n,o)}return e}(s,p):_},this.destroy=function(){s.deleteProgram(p),this.program=void 0},this.name=e.shaderName,this.id=Js++,this.cacheKey=n,this.usedTimes=1,this.program=p,this.vertexShader=c,this.fragmentShader=w,this}function va(l,d,v){var s=[],p=v.isWebGL2,m=v.logarithmicDepthBuffer,g=v.floatVertexTextures,y=v.precision,b=v.maxVertexUniforms,_=v.vertexTextures,w={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"},r=["precision","isWebGL2","supportsVertexTextures","outputEncoding","instancing","map","mapEncoding","matcap","matcapEncoding","envMap","envMapMode","envMapEncoding","envMapCubeUV","lightMap","lightMapEncoding","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","tangentSpaceNormalMap","clearcoatMap","clearcoatRoughnessMap","clearcoatNormalMap","displacementMap","specularMap","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","vertexTangents","vertexUvs","uvsVertexOnly","fog","useFog","fogExp2","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","maxMorphTargets","maxMorphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","numDirLightShadows","numPointLightShadows","numSpotLightShadows","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering","sheen"];function x(t){var n;return t?t.isTexture?n=t.encoding:t.isWebGLRenderTarget&&(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),n=t.texture.encoding):n=Ye,n}this.getParameters=function(t,n,e,i,r,o,s){var a=i.fog,u=t.isMeshStandardMaterial?i.environment:null,h=t.envMap||u,i=w[t.type],u=s.isSkinnedMesh?(f=(c=s).skeleton.bones,g?1024:(c=Math.floor((b-20)/4),(c=Math.min(c,f.length))<f.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+f.length+" bones. This GPU supports "+c+"."),0):c)):0;null!==t.precision&&(y=v.getMaxPrecision(t.precision))!==t.precision&&console.warn("THREE.WebGLProgram.getParameters:",t.precision,"not supported, using",y,"instead.");var c,c=(f=t,(c=i)?(c=ar[c],{name:f.type,uniforms:or.clone(c.uniforms),vertexShader:c.vertexShader,fragmentShader:c.fragmentShader}):{name:f.type,uniforms:f.uniforms,vertexShader:f.vertexShader,fragmentShader:f.fragmentShader});t.onBeforeCompile(c,l);var f=l.getRenderTarget();return{isWebGL2:p,shaderID:i,shaderName:c.name,uniforms:c.uniforms,vertexShader:c.vertexShader,fragmentShader:c.fragmentShader,defines:t.defines,isRawShaderMaterial:t.isRawShaderMaterial,isShaderMaterial:t.isShaderMaterial,precision:y,instancing:!0===s.isInstancedMesh,supportsVertexTextures:_,outputEncoding:null!==f?x(f.texture):l.outputEncoding,map:!!t.map,mapEncoding:x(t.map),matcap:!!t.matcap,matcapEncoding:x(t.matcap),envMap:!!h,envMapMode:h&&h.mapping,envMapEncoding:x(h),envMapCubeUV:!!h&&(h.mapping===wn||h.mapping===xn),lightMap:!!t.lightMap,lightMapEncoding:x(t.lightMap),aoMap:!!t.aoMap,emissiveMap:!!t.emissiveMap,emissiveMapEncoding:x(t.emissiveMap),bumpMap:!!t.bumpMap,normalMap:!!t.normalMap,objectSpaceNormalMap:t.normalMapType===oi,tangentSpaceNormalMap:t.normalMapType===ri,clearcoatMap:!!t.clearcoatMap,clearcoatRoughnessMap:!!t.clearcoatRoughnessMap,clearcoatNormalMap:!!t.clearcoatNormalMap,displacementMap:!!t.displacementMap,roughnessMap:!!t.roughnessMap,metalnessMap:!!t.metalnessMap,specularMap:!!t.specularMap,alphaMap:!!t.alphaMap,gradientMap:!!t.gradientMap,sheen:!!t.sheen,combine:t.combine,vertexTangents:t.normalMap&&t.vertexTangents,vertexColors:t.vertexColors,vertexUvs:!!(t.map||t.bumpMap||t.normalMap||t.specularMap||t.alphaMap||t.emissiveMap||t.roughnessMap||t.metalnessMap||t.clearcoatMap||t.clearcoatRoughnessMap||t.clearcoatNormalMap||t.displacementMap),uvsVertexOnly:!(t.map||t.bumpMap||t.normalMap||t.specularMap||t.alphaMap||t.emissiveMap||t.roughnessMap||t.metalnessMap||t.clearcoatNormalMap||!t.displacementMap),fog:!!a,useFog:t.fog,fogExp2:a&&a.isFogExp2,flatShading:t.flatShading,sizeAttenuation:t.sizeAttenuation,logarithmicDepthBuffer:m,skinning:t.skinning&&0<u,maxBones:u,useVertexTexture:g,morphTargets:t.morphTargets,morphNormals:t.morphNormals,maxMorphTargets:l.maxMorphTargets,maxMorphNormals:l.maxMorphNormals,numDirLights:n.directional.length,numPointLights:n.point.length,numSpotLights:n.spot.length,numRectAreaLights:n.rectArea.length,numHemiLights:n.hemi.length,numDirLightShadows:n.directionalShadowMap.length,numPointLightShadows:n.pointShadowMap.length,numSpotLightShadows:n.spotShadowMap.length,numClippingPlanes:r,numClipIntersection:o,dithering:t.dithering,shadowMapEnabled:l.shadowMap.enabled&&0<e.length,shadowMapType:l.shadowMap.type,toneMapping:t.toneMapped?l.toneMapping:cn,physicallyCorrectLights:l.physicallyCorrectLights,premultipliedAlpha:t.premultipliedAlpha,alphaTest:t.alphaTest,doubleSided:t.side===Ot,flipSided:t.side===Rt,depthPacking:void 0!==t.depthPacking&&t.depthPacking,index0AttributeName:t.index0AttributeName,extensionDerivatives:t.extensions&&t.extensions.derivatives,extensionFragDepth:t.extensions&&t.extensions.fragDepth,extensionDrawBuffers:t.extensions&&t.extensions.drawBuffers,extensionShaderTextureLOD:t.extensions&&t.extensions.shaderTextureLOD,rendererExtensionFragDepth:p||null!==d.get("EXT_frag_depth"),rendererExtensionDrawBuffers:p||null!==d.get("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:p||null!==d.get("EXT_shader_texture_lod"),onBeforeCompile:t.onBeforeCompile}},this.getProgramCacheKey=function(t){var n=[];if(t.shaderID?n.push(t.shaderID):(n.push(t.fragmentShader),n.push(t.vertexShader)),void 0!==t.defines)for(var e in t.defines)n.push(e),n.push(t.defines[e]);if(void 0===t.isRawShaderMaterial){for(var i=0;i<r.length;i++)n.push(t[r[i]]);n.push(l.outputEncoding),n.push(l.gammaFactor)}return n.push(t.onBeforeCompile.toString()),n.join()},this.acquireProgram=function(t,n){for(var e,i=0,r=s.length;i<r;i++){var o=s[i];if(o.cacheKey===n){++(e=o).usedTimes;break}}return void 0===e&&(e=new da(l,n,t),s.push(e)),e},this.releaseProgram=function(t){var n;0==--t.usedTimes&&(n=s.indexOf(t),s[n]=s[s.length-1],s.pop(),t.destroy())},this.programs=s}function pa(){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 ma(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 ga(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 ya(){var a=[],u=0,s=[],h=[],c={id:-1};function f(t,n,e,i,r,o){var s=a[u];return void 0===s?(s={id:t.id,object:t,geometry:n,material:e,program:e.program||c,groupOrder:i,renderOrder:t.renderOrder,z:r,group:o},a[u]=s):(s.id=t.id,s.object=t,s.geometry=n,s.material=e,s.program=e.program||c,s.groupOrder=i,s.renderOrder=t.renderOrder,s.z=r,s.group=o),u++,s}return{opaque:s,transparent:h,init:function(){u=0,s.length=0,h.length=0},push:function(t,n,e,i,r,o){o=f(t,n,e,i,r,o),(!0===e.transparent?h:s).push(o)},unshift:function(t,n,e,i,r,o){o=f(t,n,e,i,r,o),(!0===e.transparent?h:s).unshift(o)},finish:function(){for(var t=u,n=a.length;t<n;t++){var e=a[t];if(null===e.id)break;e.id=null,e.object=null,e.geometry=null,e.material=null,e.program=null,e.group=null}},sort:function(t,n){1<s.length&&s.sort(t||ma),1<h.length&&h.sort(n||ga)}}}function ba(){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 ya,r.set(t,new WeakMap),r.get(t).set(n,e),t.addEventListener("dispose",o)):void 0===(e=i.get(n))&&(e=new ya,i.set(n,e)),e},dispose:function(){r=new WeakMap}}}function _a(){var e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];var n;switch(t.type){case"DirectionalLight":n={direction:new St,color:new _i};break;case"SpotLight":n={position:new St,direction:new St,color:new _i,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new St,color:new _i,distance:0,decay:0};break;case"HemisphereLight":n={direction:new St,skyColor:new _i,groundColor:new _i};break;case"RectAreaLight":n={color:new _i,position:new St,halfWidth:new St,halfHeight:new St}}return e[t.id]=n}}}var wa=0;function xa(t,n){return(n.castShadow?1:0)-(t.castShadow?1:0)}function Ma(){for(var e,T=new _a,L=(e={},{get:function(t){if(void 0!==e[t.id])return e[t.id];var n;switch(t.type){case"DirectionalLight":case"SpotLight":n={shadowBias:0,shadowRadius:1,shadowMapSize:new ci};break;case"PointLight":n={shadowBias:0,shadowRadius:1,shadowMapSize:new ci,shadowCameraNear:1,shadowCameraFar:1e3}}return e[t.id]=n}}),R={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]},t=0;t<9;t++)R.probe.push(new St);var O=new St,A=new Et,C=new Et;return{setup:function(t,n,e){for(var i=0,r=0,o=0,s=0;s<9;s++)R.probe[s].set(0,0,0);var a=0,u=0,h=0,c=0,f=0,l=0,d=0,v=0,p=e.matrixWorldInverse;t.sort(xa);for(var s=0,m=t.length;s<m;s++){var g,y,b,_=t[s],w=_.color,x=_.intensity,M=_.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 E=0;E<9;E++)R.probe[E].addScaledVector(_.sh.coefficients[E],x);else _.isDirectionalLight?((b=T.get(_)).color.copy(_.color).multiplyScalar(_.intensity),b.direction.setFromMatrixPosition(_.matrixWorld),O.setFromMatrixPosition(_.target.matrixWorld),b.direction.sub(O),b.direction.transformDirection(p),_.castShadow&&(g=_.shadow,(y=L.get(_)).shadowBias=g.bias,y.shadowRadius=g.radius,y.shadowMapSize=g.mapSize,R.directionalShadow[a]=y,R.directionalShadowMap[a]=S,R.directionalShadowMatrix[a]=_.shadow.matrix,l++),R.directional[a]=b,a++):_.isSpotLight?((b=T.get(_)).position.setFromMatrixPosition(_.matrixWorld),b.position.applyMatrix4(p),b.color.copy(w).multiplyScalar(x),b.distance=M,b.direction.setFromMatrixPosition(_.matrixWorld),O.setFromMatrixPosition(_.target.matrixWorld),b.direction.sub(O),b.direction.transformDirection(p),b.coneCos=Math.cos(_.angle),b.penumbraCos=Math.cos(_.angle*(1-_.penumbra)),b.decay=_.decay,_.castShadow&&(g=_.shadow,(y=L.get(_)).shadowBias=g.bias,y.shadowRadius=g.radius,y.shadowMapSize=g.mapSize,R.spotShadow[h]=y,R.spotShadowMap[h]=S,R.spotShadowMatrix[h]=_.shadow.matrix,v++),R.spot[h]=b,h++):_.isRectAreaLight?((b=T.get(_)).color.copy(w).multiplyScalar(x),b.position.setFromMatrixPosition(_.matrixWorld),b.position.applyMatrix4(p),C.identity(),A.copy(_.matrixWorld),A.premultiply(p),C.extractRotation(A),b.halfWidth.set(.5*_.width,0,0),b.halfHeight.set(0,.5*_.height,0),b.halfWidth.applyMatrix4(C),b.halfHeight.applyMatrix4(C),R.rectArea[c]=b,c++):_.isPointLight?((b=T.get(_)).position.setFromMatrixPosition(_.matrixWorld),b.position.applyMatrix4(p),b.color.copy(_.color).multiplyScalar(_.intensity),b.distance=_.distance,b.decay=_.decay,_.castShadow&&(g=_.shadow,(y=L.get(_)).shadowBias=g.bias,y.shadowRadius=g.radius,y.shadowMapSize=g.mapSize,y.shadowCameraNear=g.camera.near,y.shadowCameraFar=g.camera.far,R.pointShadow[u]=y,R.pointShadowMap[u]=S,R.pointShadowMatrix[u]=_.shadow.matrix,d++),R.point[u]=b,u++):_.isHemisphereLight&&((b=T.get(_)).direction.setFromMatrixPosition(_.matrixWorld),b.direction.transformDirection(p),b.direction.normalize(),b.skyColor.copy(_.color).multiplyScalar(x),b.groundColor.copy(_.groundColor).multiplyScalar(x),R.hemi[f]=b,f++)}R.ambient[0]=i,R.ambient[1]=r,R.ambient[2]=o,(e=R.hash).directionalLength===a&&e.pointLength===u&&e.spotLength===h&&e.rectAreaLength===c&&e.hemiLength===f&&e.numDirectionalShadows===l&&e.numPointShadows===d&&e.numSpotShadows===v||(R.directional.length=a,R.spot.length=h,R.rectArea.length=c,R.point.length=u,R.hemi.length=f,R.directionalShadow.length=l,R.directionalShadowMap.length=l,R.pointShadow.length=d,R.pointShadowMap.length=d,R.spotShadow.length=v,R.spotShadowMap.length=v,R.directionalShadowMatrix.length=l,R.pointShadowMatrix.length=d,R.spotShadowMatrix.length=v,e.directionalLength=a,e.pointLength=u,e.spotLength=h,e.rectAreaLength=c,e.hemiLength=f,e.numDirectionalShadows=l,e.numPointShadows=d,e.numSpotShadows=v,R.version=wa++)},state:R}}function Sa(){var n=new Ma,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 Ea(){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 Sa,i.set(t,new WeakMap),i.get(t).set(n,e),t.addEventListener("dispose",r)):!1===i.get(t).has(n)?(e=new Sa,i.get(t).set(n,e)):e=i.get(t).get(n),e},dispose:function(){i=new WeakMap}}}function Ta(t,n,e){this.width=t,this.height=n,this.scissor=new Ci(0,0,t,n),this.scissorTest=!1,this.viewport=new Ci(0,0,t,n),this.texture=new xr(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:On,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 La(t){tr.call(this),this.type="MeshDepthMaterial",this.depthPacking=ei,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 Ra(t){tr.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new St,this.nearDistance=1,this.farDistance=1e3,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(t)}Ta.prototype=Object.assign(Object.create(g.prototype),{constructor:Ta,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"})}}),((La.prototype=Object.create(tr.prototype)).constructor=La).prototype.isMeshDepthMaterial=!0,La.prototype.copy=function(t){return tr.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},((Ra.prototype=Object.create(tr.prototype)).constructor=Ra).prototype.isMeshDistanceMaterial=!0,Ra.prototype.copy=function(t){return tr.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 Oa="\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",Aa="\n\nvoid main() {\n\n\tgl_Position = vec4( position, 1.0 );\n\n}\n\n";function Ca(y,b,_){var w=new Tt,x=new ci,M=new ci,S=new Ci,r=[],o=[],l={},d={0:Rt,1:Lt,2:Ot},E=new cr({defines:{SAMPLE_RATE:.25,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new ci},radius:{value:4}},vertexShader:Aa,fragmentShader:Oa}),T=E.clone();T.defines.HORIZONAL_PASS=1;var t=new $r;t.setAttribute("position",new Dr(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));var L=new Uo(t,E),R=this;function v(t,n,e){var i=t<<0|n<<1|e<<2,e=r[i];return void 0===e&&(e=new La({depthPacking:ii,morphTargets:t,skinning:n}),r[i]=e),e}function p(t,n,e){var i=t<<0|n<<1|e<<2,e=o[i];return void 0===e&&(e=new Ra({morphTargets:t,skinning:n}),o[i]=e),e}function O(t,n,e,i,r,o){var s,a,u=t.geometry,h=null,c=v,f=t.customDepthMaterial;return!0===e.isPointLight&&(c=p,f=t.customDistanceMaterial),h=void 0===f?(!(s=!1)===n.morphTargets&&(!0===u.isBufferGeometry?s=u.morphAttributes&&u.morphAttributes.position&&0<u.morphAttributes.position.length:!0===u.isGeometry&&(s=u.morphTargets&&0<u.morphTargets.length)),!(a=!1)===t.isSkinnedMesh&&(!0===n.skinning?a=!0:console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",t)),c(s,a,!0===t.isInstancedMesh)):f,y.localClippingEnabled&&!0===n.clipShadows&&0!==n.clippingPlanes.length&&(a=h.uuid,t=n.uuid,void 0===(f=l[a])&&(l[a]=f={}),void 0===(a=f[t])&&(a=h.clone(),f[t]=a),h=a),h.visible=n.visible,h.wireframe=n.wireframe,h.side=o===xt?null!==n.shadowSide?n.shadowSide:n.side:null!==n.shadowSide?n.shadowSide:d[n.side],h.clipShadows=n.clipShadows,h.clippingPlanes=n.clippingPlanes,h.clipIntersection=n.clipIntersection,h.wireframeLinewidth=n.wireframeLinewidth,h.linewidth=n.linewidth,!0===e.isPointLight&&!0===h.isMeshDistanceMaterial&&(h.referencePosition.setFromMatrixPosition(e.matrixWorld),h.nearDistance=i,h.farDistance=r),h}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=_t,this.render=function(t,n,e){if(!1!==R.enabled&&(!1!==R.autoUpdate||!1!==R.needsUpdate)&&0!==t.length){var i=y.getRenderTarget(),r=y.getActiveCubeFace(),o=y.getActiveMipmapLevel(),s=y.state;s.setBlending(At),s.buffers.color.setClear(1,1,1,1),s.buffers.depth.setTest(!0),s.setScissorTest(!1);for(var a,u,h=0,c=t.length;h<c;h++){var f=t[h],l=f.shadow;if(void 0!==l){x.copy(l.mapSize);var d,v=l.getFrameExtents();x.multiply(v),M.copy(l.mapSize),(x.x>_||x.y>_)&&(console.warn("THREE.WebGLShadowMap:",f,"has shadow exceeding max texture size, reducing"),x.x>_&&(M.x=Math.floor(_/v.x),x.x=M.x*v.x,l.mapSize.x=M.x),x.y>_&&(M.y=Math.floor(_/v.y),x.y=M.y*v.y,l.mapSize.y=M.y)),null!==l.map||l.isPointLightShadow||this.type!==xt||(l.map=new Ta(x.x,x.y,d={minFilter:On,magFilter:On,format:Xn}),l.map.texture.name=f.name+".shadowMap",l.mapPass=new Ta(x.x,x.y,d),l.camera.updateProjectionMatrix()),null===l.map&&(l.map=new Ta(x.x,x.y,d={minFilter:Tn,magFilter:Tn,format:Xn}),l.map.texture.name=f.name+".shadowMap",l.camera.updateProjectionMatrix()),y.setRenderTarget(l.map),y.clear();for(var p=l.getViewportCount(),m=0;m<p;m++){var g=l.getViewport(m);S.set(M.x*g.x,M.y*g.y,M.x*g.z,M.y*g.w),s.viewport(S),l.updateMatrices(f,m),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===xt)&&(!n.frustumCulled||w.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse,n.matrixWorld);var a=b.update(n),u=n.material;if(Array.isArray(u))for(var h=a.groups,c=0,f=h.length;c<f;c++){var l,d=h[c],v=u[d.materialIndex];v&&v.visible&&(l=O(n,v,r,i.near,i.far,o),y.renderBufferDirect(i,null,a,l,n,d))}else u.visible&&(l=O(n,u,r,i.near,i.far,o),y.renderBufferDirect(i,null,a,l,n,null))}var p=n.children;for(var m=0,g=p.length;m<g;m++)t(p[m],e,i,r,o)}(n,e,l.camera,f,this.type)}l.isPointLightShadow||this.type!==xt||(a=l,u=e,v=void 0,v=b.update(L),E.uniforms.shadow_pass.value=a.map.texture,E.uniforms.resolution.value=a.mapSize,E.uniforms.radius.value=a.radius,y.setRenderTarget(a.mapPass),y.clear(),y.renderBufferDirect(u,null,v,E,L,null),T.uniforms.shadow_pass.value=a.mapPass.texture,T.uniforms.resolution.value=a.mapSize,T.uniforms.radius.value=a.radius,y.setRenderTarget(a.map),y.clear(),y.renderBufferDirect(u,null,v,T,L,null))}else console.warn("THREE.WebGLShadowMap:",f,"has no shadow.")}R.needsUpdate=!1,y.setRenderTarget(i,r,o)}}}function ka(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function Pa(c,e,t){var i=t.isWebGL2;var r=new function(){var n=!1,o=new Ci,e=null,s=new Ci(0,0,0,0);return{setMask:function(t){e===t||n||(c.colorMask(t,t,t,t),e=t)},setLocked:function(t){n=t},setClear:function(t,n,e,i,r){!0===r&&(t*=i,n*=i,e*=i),o.set(t,n,e,i),!1===s.equals(o)&&(c.clearColor(t,n,e,i),s.copy(o))},reset:function(){n=!1,e=null,s.set(-1,0,0,0)}}},o=new function(){var n=!1,e=null,i=null,r=null;return{setTest:function(t){(t?I:N)(c.DEPTH_TEST)},setMask:function(t){e===t||n||(c.depthMask(t),e=t)},setFunc:function(t){if(i!==t){if(t)switch(t){case Qt:c.depthFunc(c.NEVER);break;case $t:c.depthFunc(c.ALWAYS);break;case tn:c.depthFunc(c.LESS);break;case nn:c.depthFunc(c.LEQUAL);break;case en:c.depthFunc(c.EQUAL);break;case rn:c.depthFunc(c.GEQUAL);break;case on:c.depthFunc(c.GREATER);break;case sn:c.depthFunc(c.NOTEQUAL);break;default:c.depthFunc(c.LEQUAL)}else c.depthFunc(c.LEQUAL);i=t}},setLocked:function(t){n=t},setClear:function(t){r!==t&&(c.clearDepth(t),r=t)},reset:function(){n=!1,r=i=e=null}}},s=new function(){var n=!1,e=null,i=null,r=null,o=null,s=null,a=null,u=null,h=null;return{setTest:function(t){n||(t?I:N)(c.STENCIL_TEST)},setMask:function(t){e===t||n||(c.stencilMask(t),e=t)},setFunc:function(t,n,e){i===t&&r===n&&o===e||(c.stencilFunc(t,n,e),i=t,r=n,o=e)},setOp:function(t,n,e){s===t&&a===n&&u===e||(c.stencilOp(t,n,e),s=t,a=n,u=e)},setLocked:function(t){n=t},setClear:function(t){h!==t&&(c.clearStencil(t),h=t)},reset:function(){n=!1,h=u=a=s=o=r=i=e=null}}},n=c.getParameter(c.MAX_VERTEX_ATTRIBS),a=new Uint8Array(n),u=new Uint8Array(n),h=new Uint8Array(n),f={},l=null,d=null,v=null,p=null,m=null,g=null,y=null,b=null,_=null,w=!1,x=null,M=null,S=null,E=null,T=null,L=c.getParameter(c.MAX_COMBINED_TEXTURE_IMAGE_UNITS),R=!1,t=0,n=c.getParameter(c.VERSION);-1!==n.indexOf("WebGL")?(t=parseFloat(/^WebGL\ ([0-9])/.exec(n)[1]),R=1<=t):-1!==n.indexOf("OpenGL ES")&&(t=parseFloat(/^OpenGL\ ES\ ([0-9])/.exec(n)[1]),R=2<=t);var O=null,A={},C=new Ci,k=new Ci;function P(t,n,e){var i=new Uint8Array(4),r=c.createTexture();c.bindTexture(t,r),c.texParameteri(t,c.TEXTURE_MIN_FILTER,c.NEAREST),c.texParameteri(t,c.TEXTURE_MAG_FILTER,c.NEAREST);for(var o=0;o<e;o++)c.texImage2D(n+o,0,c.RGBA,1,1,0,c.RGBA,c.UNSIGNED_BYTE,i);return r}var D={};function j(t,n){a[t]=1,0===u[t]&&(c.enableVertexAttribArray(t),u[t]=1),h[t]!==n&&((i?c:e.get("ANGLE_instanced_arrays"))[i?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](t,n),h[t]=n)}function I(t){!0!==f[t]&&(c.enable(t),f[t]=!0)}function N(t){!1!==f[t]&&(c.disable(t),f[t]=!1)}D[c.TEXTURE_2D]=P(c.TEXTURE_2D,c.TEXTURE_2D,1),D[c.TEXTURE_CUBE_MAP]=P(c.TEXTURE_CUBE_MAP,c.TEXTURE_CUBE_MAP_POSITIVE_X,6),r.setClear(0,0,0,1),o.setClear(1),s.setClear(0),I(c.DEPTH_TEST),o.setFunc(nn),H(!1),V(yt),I(c.CULL_FACE),G(At);var F,U=(ka(t={},It,c.FUNC_ADD),ka(t,Nt,c.FUNC_SUBTRACT),ka(t,Ft,c.FUNC_REVERSE_SUBTRACT),t);i?(U[Ut]=c.MIN,U[Bt]=c.MAX):null!==(F=e.get("EXT_blend_minmax"))&&(U[Ut]=F.MIN_EXT,U[Bt]=F.MAX_EXT);var B=(ka(F={},Gt,c.ZERO),ka(F,Ht,c.ONE),ka(F,Vt,c.SRC_COLOR),ka(F,Wt,c.SRC_ALPHA),ka(F,Jt,c.SRC_ALPHA_SATURATE),ka(F,qt,c.DST_COLOR),ka(F,Zt,c.DST_ALPHA),ka(F,zt,c.ONE_MINUS_SRC_COLOR),ka(F,Xt,c.ONE_MINUS_SRC_ALPHA),ka(F,Kt,c.ONE_MINUS_DST_COLOR),ka(F,Yt,c.ONE_MINUS_DST_ALPHA),F);function G(t,n,e,i,r,o,s,a){if(t!==At){if(d||(I(c.BLEND),d=!0),t===jt)r=r||n,o=o||e,s=s||i,n===p&&r===y||(c.blendEquationSeparate(U[n],U[r]),p=n,y=r),e===m&&i===g&&o===b&&s===_||(c.blendFuncSeparate(B[e],B[i],B[o],B[s]),m=e,g=i,b=o,_=s),v=t,w=null;else if(t!==v||a!==w){if(p===It&&y===It||(c.blendEquation(c.FUNC_ADD),y=p=It),a)switch(t){case Ct:c.blendFuncSeparate(c.ONE,c.ONE_MINUS_SRC_ALPHA,c.ONE,c.ONE_MINUS_SRC_ALPHA);break;case kt:c.blendFunc(c.ONE,c.ONE);break;case Pt:c.blendFuncSeparate(c.ZERO,c.ZERO,c.ONE_MINUS_SRC_COLOR,c.ONE_MINUS_SRC_ALPHA);break;case Dt:c.blendFuncSeparate(c.ZERO,c.SRC_COLOR,c.ZERO,c.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}else switch(t){case Ct:c.blendFuncSeparate(c.SRC_ALPHA,c.ONE_MINUS_SRC_ALPHA,c.ONE,c.ONE_MINUS_SRC_ALPHA);break;case kt:c.blendFunc(c.SRC_ALPHA,c.ONE);break;case Pt:c.blendFunc(c.ZERO,c.ONE_MINUS_SRC_COLOR);break;case Dt:c.blendFunc(c.ZERO,c.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}_=b=g=m=null,v=t,w=a}}else d&&(N(c.BLEND),d=!1)}function H(t){x!==t&&(t?c.frontFace(c.CW):c.frontFace(c.CCW),x=t)}function V(t){t!==gt?(I(c.CULL_FACE),t!==M&&(t===yt?c.cullFace(c.BACK):t===bt?c.cullFace(c.FRONT):c.cullFace(c.FRONT_AND_BACK))):N(c.CULL_FACE),M=t}function z(t,n,e){t?(I(c.POLYGON_OFFSET_FILL),E===n&&T===e||(c.polygonOffset(n,e),E=n,T=e)):N(c.POLYGON_OFFSET_FILL)}function W(t){void 0===t&&(t=c.TEXTURE0+L-1),O!==t&&(c.activeTexture(t),O=t)}return{buffers:{color:r,depth:o,stencil:s},initAttributes:function(){for(var t=0,n=a.length;t<n;t++)a[t]=0},enableAttribute:function(t){j(t,0)},enableAttributeAndDivisor:j,disableUnusedAttributes:function(){for(var t=0,n=u.length;t!==n;++t)u[t]!==a[t]&&(c.disableVertexAttribArray(t),u[t]=0)},enable:I,disable:N,useProgram:function(t){return l!==t&&(c.useProgram(t),l=t,!0)},setBlending:G,setMaterial:function(t,n){(t.side===Ot?N:I)(c.CULL_FACE);var e=t.side===Rt;H(e=n?!e:e),t.blending===Ct&&!1===t.transparent?G(At):G(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha,t.premultipliedAlpha),o.setFunc(t.depthFunc),o.setTest(t.depthTest),o.setMask(t.depthWrite),r.setMask(t.colorWrite),e=t.stencilWrite,s.setTest(e),e&&(s.setMask(t.stencilWriteMask),s.setFunc(t.stencilFunc,t.stencilRef,t.stencilFuncMask),s.setOp(t.stencilFail,t.stencilZFail,t.stencilZPass)),z(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits)},setFlipSided:H,setCullFace:V,setLineWidth:function(t){t!==S&&(R&&c.lineWidth(t),S=t)},setPolygonOffset:z,setScissorTest:function(t){(t?I:N)(c.SCISSOR_TEST)},activeTexture:W,bindTexture:function(t,n){null===O&&W();var e=A[O];void 0===e&&(A[O]=e={type:void 0,texture:void 0}),e.type===t&&e.texture===n||(c.bindTexture(t,n||D[t]),e.type=t,e.texture=n)},unbindTexture:function(){var t=A[O];void 0!==t&&void 0!==t.type&&(c.bindTexture(t.type,null),t.type=void 0,t.texture=void 0)},compressedTexImage2D:function(){try{c.compressedTexImage2D.apply(c,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage2D:function(){try{c.texImage2D.apply(c,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage3D:function(){try{c.texImage3D.apply(c,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},scissor:function(t){!1===C.equals(t)&&(c.scissor(t.x,t.y,t.z,t.w),C.copy(t))},viewport:function(t){!1===k.equals(t)&&(c.viewport(t.x,t.y,t.z,t.w),k.copy(t))},reset:function(){for(var t=0;t<u.length;t++)1===u[t]&&(c.disableVertexAttribArray(t),u[t]=0);f={},A={},M=x=v=l=O=null,r.reset(),o.reset(),s.reset()}}}function Da(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function ja(m,i,g,y,r,b,u){var t,o,_=r.isWebGL2,n=r.maxTextures,w=r.maxCubemapSize,l=r.maxTextureSize,e=r.maxSamples,s=new WeakMap,a=!1;try{a="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(t){}function h(t,n){return a?new OffscreenCanvas(t,n):document.createElementNS("http://www.w3.org/1999/xhtml","canvas")}function x(t,n,e,i){var r=1;if((r=t.width>i||t.height>i?i/Math.max(t.width,t.height):r)<1||!0===n){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){i=n?Mt.floorPowerOfTwo:Math.floor,n=i(r*t.width),r=i(r*t.height);void 0===o&&(o=h(n,r));e=e?h(n,r):o;return e.width=n,e.height=r,e.getContext("2d").drawImage(t,0,0,n,r),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+t.width+"x"+t.height+") to ("+n+"x"+r+")."),e}return"data"in t&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+t.width+"x"+t.height+")."),t}return t}function M(t){return Mt.isPowerOfTwo(t.width)&&Mt.isPowerOfTwo(t.height)}function S(t,n){return t.generateMipmaps&&n&&t.minFilter!==Tn&&t.minFilter!==On}function E(t,n,e,i){m.generateMipmap(t),y.get(n).se=Math.log(Math.max(e,i))*Math.LOG2E}function T(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)),n===m.RGBA&&(e===m.FLOAT&&(t=m.RGBA32F),e===m.HALF_FLOAT&&(t=m.RGBA16F),e===m.UNSIGNED_BYTE&&(t=m.RGBA8)),t!==m.R16F&&t!==m.R32F&&t!==m.RGBA16F&&t!==m.RGBA32F||i.get("EXT_color_buffer_float"),t}function c(t){return t===Tn||t===Ln||t===Rn?m.NEAREST:m.LINEAR}function f(t){var n,e=t.target;e.removeEventListener("dispose",f),n=e,void 0!==(t=y.get(n)).ae&&(m.deleteTexture(t.ue),y.remove(n)),e.isVideoTexture&&s.delete(e),u.memory.textures--}function d(t){t=t.target;t.removeEventListener("dispose",d),function(t){var n=y.get(t),e=y.get(t.texture);if(t){if(void 0!==e.ue&&m.deleteTexture(e.ue),t.depthTexture&&t.depthTexture.dispose(),t.isWebGLCubeRenderTarget)for(var i=0;i<6;i++)m.deleteFramebuffer(n.he[i]),n.ce&&m.deleteRenderbuffer(n.ce[i]);else m.deleteFramebuffer(n.he),n.ce&&m.deleteRenderbuffer(n.ce),n.fe&&m.deleteFramebuffer(n.fe),n.le&&m.deleteRenderbuffer(n.le),n.de&&m.deleteRenderbuffer(n.de);y.remove(t.texture),y.remove(t)}}(t),u.memory.textures--}var v=0;function p(t,n){var e,i=y.get(t);if(t.isVideoTexture&&(r=t,e=u.render.frame,s.get(r)!==e&&(s.set(r,e),r.update())),0<t.version&&i.ve!==t.version){var r=t.image;if(void 0===r)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==r.complete)return void P(i,t,n);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}g.activeTexture(m.TEXTURE0+n),g.bindTexture(m.TEXTURE_2D,i.ue)}function L(t,n){if(6===t.image.length){var e=y.get(t);if(0<t.version&&e.ve!==t.version){k(e,t),g.activeTexture(m.TEXTURE0+n),g.bindTexture(m.TEXTURE_CUBE_MAP,e.ue),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=M(a)||_,h=b.convert(t.format),c=b.convert(t.type),f=T(t.internalFormat,h,c);if(C(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!==Xn&&t.format!==Wn?null!==h?g.compressedTexImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+s,d,f,v.width,v.height,0,v.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):g.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+s,d,f,v.width,v.height,0,h,c,v.data)}e.se=l.length-1}else{l=t.mipmaps;for(s=0;s<6;s++)if(r){g.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+s,0,f,o[s].width,o[s].height,0,h,c,o[s].data);for(d=0;d<l.length;d++){var p=(v=l[d]).image[s].image;g.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+s,d+1,f,p.width,p.height,0,h,c,p.data)}}else{g.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+s,0,f,h,c,o[s]);for(d=0;d<l.length;d++){v=l[d];g.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+s,d+1,f,h,c,v.image[s])}}e.se=l.length}S(t,u)&&E(m.TEXTURE_CUBE_MAP,t,a.width,a.height),e.ve=t.version,t.onUpdate&&t.onUpdate(t)}else g.activeTexture(m.TEXTURE0+n),g.bindTexture(m.TEXTURE_CUBE_MAP,e.ue)}}function R(t,n){g.activeTexture(m.TEXTURE0+n),g.bindTexture(m.TEXTURE_CUBE_MAP,y.get(t).ue)}var O=(Da(t={},Mn,m.REPEAT),Da(t,Sn,m.CLAMP_TO_EDGE),Da(t,En,m.MIRRORED_REPEAT),t),A=(Da(t={},Tn,m.NEAREST),Da(t,Ln,m.NEAREST_MIPMAP_NEAREST),Da(t,Rn,m.NEAREST_MIPMAP_LINEAR),Da(t,On,m.LINEAR),Da(t,An,m.LINEAR_MIPMAP_NEAREST),Da(t,Cn,m.LINEAR_MIPMAP_LINEAR),t);function C(t,n,e){e?(m.texParameteri(t,m.TEXTURE_WRAP_S,O[n.wrapS]),m.texParameteri(t,m.TEXTURE_WRAP_T,O[n.wrapT]),t!==m.TEXTURE_3D&&t!==m.TEXTURE_2D_ARRAY||m.texParameteri(t,m.TEXTURE_WRAP_R,O[n.wrapR]),m.texParameteri(t,m.TEXTURE_MAG_FILTER,A[n.magFilter]),m.texParameteri(t,m.TEXTURE_MIN_FILTER,A[n.minFilter])):(m.texParameteri(t,m.TEXTURE_WRAP_S,m.CLAMP_TO_EDGE),m.texParameteri(t,m.TEXTURE_WRAP_T,m.CLAMP_TO_EDGE),t!==m.TEXTURE_3D&&t!==m.TEXTURE_2D_ARRAY||m.texParameteri(t,m.TEXTURE_WRAP_R,m.CLAMP_TO_EDGE),n.wrapS===Sn&&n.wrapT===Sn||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!==Tn&&n.minFilter!==On&&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===Fn&&null===i.get("OES_texture_float_linear")||n.type===Un&&null===(_||i.get("OES_texture_half_float_linear"))||(1<n.anisotropy||y.get(n).pe)&&(m.texParameterf(t,e.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(n.anisotropy,r.getMaxAnisotropy())),y.get(n).pe=n.anisotropy))}function k(t,n){void 0===t.ae&&(t.ae=!0,n.addEventListener("dispose",f),t.ue=m.createTexture(),u.memory.textures++)}function P(t,n,e){var i=m.TEXTURE_2D;n.isDataTexture2DArray&&(i=m.TEXTURE_2D_ARRAY),n.isDataTexture3D&&(i=m.TEXTURE_3D),k(t,n),g.activeTexture(m.TEXTURE0+e),g.bindTexture(i,t.ue),m.pixelStorei(m.UNPACK_FLIP_Y_WEBGL,n.flipY),m.pixelStorei(m.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n.premultiplyAlpha),m.pixelStorei(m.UNPACK_ALIGNMENT,n.unpackAlignment);var e=(r=n,!_&&(r.wrapS!==Sn||r.wrapT!==Sn||r.minFilter!==Tn&&r.minFilter!==On)&&!1===M(n.image)),r=x(n.image,e,!1,l),e=M(r)||_,o=b.convert(n.format),s=b.convert(n.type),a=T(n.internalFormat,o,s);C(i,n,e);var u,h=n.mipmaps;if(n.isDepthTexture)a=m.DEPTH_COMPONENT,_?a=n.type===Fn?m.DEPTH_COMPONENT32F:n.type===Nn?m.DEPTH_COMPONENT24:n.type===Vn?m.DEPTH24_STENCIL8:m.DEPTH_COMPONENT16:n.type===Fn&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),n.format===qn&&a===m.DEPTH_COMPONENT&&n.type!==jn&&n.type!==Nn&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),n.type=jn,s=b.convert(n.type)),n.format===Kn&&a===m.DEPTH_COMPONENT&&(a=m.DEPTH_STENCIL,n.type!==Vn&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),n.type=Vn,s=b.convert(n.type))),g.texImage2D(m.TEXTURE_2D,0,a,r.width,r.height,0,o,s,null);else if(n.isDataTexture)if(0<h.length&&e){for(var c=0,f=h.length;c<f;c++)u=h[c],g.texImage2D(m.TEXTURE_2D,c,a,u.width,u.height,0,o,s,u.data);n.generateMipmaps=!1,t.se=h.length-1}else g.texImage2D(m.TEXTURE_2D,0,a,r.width,r.height,0,o,s,r.data),t.se=0;else if(n.isCompressedTexture){for(c=0,f=h.length;c<f;c++)u=h[c],n.format!==Xn&&n.format!==Wn?null!==o?g.compressedTexImage2D(m.TEXTURE_2D,c,a,u.width,u.height,0,u.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):g.texImage2D(m.TEXTURE_2D,c,a,u.width,u.height,0,o,s,u.data);t.se=h.length-1}else if(n.isDataTexture2DArray)g.texImage3D(m.TEXTURE_2D_ARRAY,0,a,r.width,r.height,r.depth,0,o,s,r.data),t.se=0;else if(n.isDataTexture3D)g.texImage3D(m.TEXTURE_3D,0,a,r.width,r.height,r.depth,0,o,s,r.data),t.se=0;else if(0<h.length&&e){for(c=0,f=h.length;c<f;c++)u=h[c],g.texImage2D(m.TEXTURE_2D,c,a,o,s,u);n.generateMipmaps=!1,t.se=h.length-1}else g.texImage2D(m.TEXTURE_2D,0,a,o,s,r),t.se=0;S(n,e)&&E(i,n,r.width,r.height),t.ve=n.version,n.onUpdate&&n.onUpdate(n)}function D(t,n,e,i){var r=b.convert(n.texture.format),o=b.convert(n.texture.type),s=T(n.texture.internalFormat,r,o);g.texImage2D(i,0,s,n.width,n.height,0,r,o,null),m.bindFramebuffer(m.FRAMEBUFFER,t),m.framebufferTexture2D(m.FRAMEBUFFER,e,i,y.get(n.texture).ue,0),m.bindFramebuffer(m.FRAMEBUFFER,null)}function j(t,n,e){var i,r,o;m.bindRenderbuffer(m.RENDERBUFFER,t),n.depthBuffer&&!n.stencilBuffer?(r=m.DEPTH_COMPONENT16,e?((i=n.depthTexture)&&i.isDepthTexture&&(i.type===Fn?r=m.DEPTH_COMPONENT32F:i.type===Nn&&(r=m.DEPTH_COMPONENT24)),o=N(n),m.renderbufferStorageMultisample(m.RENDERBUFFER,o,r,n.width,n.height)):m.renderbufferStorage(m.RENDERBUFFER,r,n.width,n.height),m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_ATTACHMENT,m.RENDERBUFFER,t)):n.depthBuffer&&n.stencilBuffer?(e?(o=N(n),m.renderbufferStorageMultisample(m.RENDERBUFFER,o,m.DEPTH24_STENCIL8,n.width,n.height)):m.renderbufferStorage(m.RENDERBUFFER,m.DEPTH_STENCIL,n.width,n.height),m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_STENCIL_ATTACHMENT,m.RENDERBUFFER,t)):(i=b.convert(n.texture.format),t=b.convert(n.texture.type),r=T(n.texture.internalFormat,i,t),e?(o=N(n),m.renderbufferStorageMultisample(m.RENDERBUFFER,o,r,n.width,n.height)):m.renderbufferStorage(m.RENDERBUFFER,r,n.width,n.height)),m.bindRenderbuffer(m.RENDERBUFFER,null)}function I(t){var n=y.get(t),e=!0===t.isWebGLCubeRenderTarget;if(t.depthTexture){if(e)throw new Error("target.depthTexture not supported in Cube render targets");!function(t,n){if(n&&n.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(m.bindFramebuffer(m.FRAMEBUFFER,t),!n.depthTexture||!n.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");if(y.get(n.depthTexture).ue&&n.depthTexture.image.width===n.width&&n.depthTexture.image.height===n.height||(n.depthTexture.image.width=n.width,n.depthTexture.image.height=n.height,n.depthTexture.needsUpdate=!0),p(n.depthTexture,0),t=y.get(n.depthTexture).ue,n.depthTexture.format===qn)m.framebufferTexture2D(m.FRAMEBUFFER,m.DEPTH_ATTACHMENT,m.TEXTURE_2D,t,0);else{if(n.depthTexture.format!==Kn)throw new Error("Unknown depthTexture format");m.framebufferTexture2D(m.FRAMEBUFFER,m.DEPTH_STENCIL_ATTACHMENT,m.TEXTURE_2D,t,0)}}(n.he,t)}else if(e){n.ce=[];for(var i=0;i<6;i++)m.bindFramebuffer(m.FRAMEBUFFER,n.he[i]),n.ce[i]=m.createRenderbuffer(),j(n.ce[i],t,!1)}else m.bindFramebuffer(m.FRAMEBUFFER,n.he),n.ce=m.createRenderbuffer(),j(n.ce,t,!1);m.bindFramebuffer(m.FRAMEBUFFER,null)}function N(t){return _&&t.isWebGLMultisampleRenderTarget?Math.min(e,t.samples):0}var F=!1,U=!1;this.allocateTextureUnit=function(){var t=v;return n<=t&&console.warn("THREE.WebGLTextures: Trying to use "+t+" texture units while this GPU supports only "+n),v+=1,t},this.resetTextureUnits=function(){v=0},this.setTexture2D=p,this.setTexture2DArray=function(t,n){var e=y.get(t);0<t.version&&e.ve!==t.version?P(e,t,n):(g.activeTexture(m.TEXTURE0+n),g.bindTexture(m.TEXTURE_2D_ARRAY,e.ue))},this.setTexture3D=function(t,n){var e=y.get(t);0<t.version&&e.ve!==t.version?P(e,t,n):(g.activeTexture(m.TEXTURE0+n),g.bindTexture(m.TEXTURE_3D,e.ue))},this.setTextureCube=L,this.setTextureCubeDynamic=R,this.setupRenderTarget=function(t){var n=y.get(t),e=y.get(t.texture);t.addEventListener("dispose",d),e.ue=m.createTexture(),u.memory.textures++;var i,r=!0===t.isWebGLCubeRenderTarget,o=!0===t.isWebGLMultisampleRenderTarget,s=M(t)||_;if(!_||t.texture.format!==Wn||t.texture.type!==Fn&&t.texture.type!==Un||(t.texture.format=Xn,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),r){n.he=[];for(var a=0;a<6;a++)n.he[a]=m.createFramebuffer()}else n.he=m.createFramebuffer(),o&&(_?(n.fe=m.createFramebuffer(),n.le=m.createRenderbuffer(),m.bindRenderbuffer(m.RENDERBUFFER,n.le),i=b.convert(t.texture.format),o=b.convert(t.texture.type),i=T(t.texture.internalFormat,i,o),o=N(t),m.renderbufferStorageMultisample(m.RENDERBUFFER,o,i,t.width,t.height),m.bindFramebuffer(m.FRAMEBUFFER,n.fe),m.framebufferRenderbuffer(m.FRAMEBUFFER,m.COLOR_ATTACHMENT0,m.RENDERBUFFER,n.le),m.bindRenderbuffer(m.RENDERBUFFER,null),t.depthBuffer&&(n.de=m.createRenderbuffer(),j(n.de,t,!0)),m.bindFramebuffer(m.FRAMEBUFFER,null)):console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2."));if(r){g.bindTexture(m.TEXTURE_CUBE_MAP,e.ue),C(m.TEXTURE_CUBE_MAP,t.texture,s);for(a=0;a<6;a++)D(n.he[a],t,m.COLOR_ATTACHMENT0,m.TEXTURE_CUBE_MAP_POSITIVE_X+a);S(t.texture,s)&&E(m.TEXTURE_CUBE_MAP,t.texture,t.width,t.height),g.bindTexture(m.TEXTURE_CUBE_MAP,null)}else g.bindTexture(m.TEXTURE_2D,e.ue),C(m.TEXTURE_2D,t.texture,s),D(n.he,t,m.COLOR_ATTACHMENT0,m.TEXTURE_2D),S(t.texture,s)&&E(m.TEXTURE_2D,t.texture,t.width,t.height),g.bindTexture(m.TEXTURE_2D,null);t.depthBuffer&&I(t)},this.updateRenderTargetMipmap=function(t){var n,e,i=t.texture;S(i,M(t)||_)&&(n=t.isWebGLCubeRenderTarget?m.TEXTURE_CUBE_MAP:m.TEXTURE_2D,e=y.get(i).ue,g.bindTexture(n,e),E(n,i,t.width,t.height),g.bindTexture(n,null))},this.updateMultisampleRenderTarget=function(t){var n,e,i,r;t.isWebGLMultisampleRenderTarget&&(_?(n=y.get(t),m.bindFramebuffer(m.READ_FRAMEBUFFER,n.fe),m.bindFramebuffer(m.DRAW_FRAMEBUFFER,n.he),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.fe)):console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2."))},this.safeSetTexture2D=function(t,n){t&&t.isWebGLRenderTarget&&(!1===F&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),F=!0),t=t.texture),p(t,n)},this.safeSetTextureCube=function(t,n){t&&t.isWebGLCubeRenderTarget&&(!1===U&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),U=!0),t=t.texture),(t&&t.isCubeTexture||Array.isArray(t.image)&&6===t.image.length?L:R)(t,n)}}function Ia(e,i,t){var r=t.isWebGL2;return{convert:function(t){var n;if(t===kn)return e.UNSIGNED_BYTE;if(t===Bn)return e.UNSIGNED_SHORT_4_4_4_4;if(t===Gn)return e.UNSIGNED_SHORT_5_5_5_1;if(t===Hn)return e.UNSIGNED_SHORT_5_6_5;if(t===Pn)return e.BYTE;if(t===Dn)return e.SHORT;if(t===jn)return e.UNSIGNED_SHORT;if(t===In)return e.INT;if(t===Nn)return e.UNSIGNED_INT;if(t===Fn)return e.FLOAT;if(t===Un)return r?e.HALF_FLOAT:null!==(n=i.get("OES_texture_half_float"))?n.HALF_FLOAT_OES:null;if(t===zn)return e.ALPHA;if(t===Wn)return e.RGB;if(t===Xn)return e.RGBA;if(t===Zn)return e.LUMINANCE;if(t===Yn)return e.LUMINANCE_ALPHA;if(t===qn)return e.DEPTH_COMPONENT;if(t===Kn)return e.DEPTH_STENCIL;if(t===Jn)return e.RED;if(t===Qn)return e.RED_INTEGER;if(t===$n)return e.RG;if(t===te)return e.RG_INTEGER;if(t===ne)return e.RGB_INTEGER;if(t===ee)return e.RGBA_INTEGER;if(t===ie||t===re||t===oe||t===se){if(null===(n=i.get("WEBGL_compressed_texture_s3tc")))return null;if(t===ie)return n.COMPRESSED_RGB_S3TC_DXT1_EXT;if(t===re)return n.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(t===oe)return n.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(t===se)return n.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(t===ae||t===ue||t===he||t===ce){if(null===(n=i.get("WEBGL_compressed_texture_pvrtc")))return null;if(t===ae)return n.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(t===ue)return n.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(t===he)return n.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(t===ce)return n.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(t===fe)return null!==(n=i.get("WEBGL_compressed_texture_etc1"))?n.COMPRESSED_RGB_ETC1_WEBGL:null;if((t===le||t===de)&&null!==(n=i.get("WEBGL_compressed_texture_etc"))){if(t===le)return n.COMPRESSED_RGB8_ETC2;if(t===de)return n.COMPRESSED_RGBA8_ETC2_EAC}return t===ve||t===pe||t===me||t===ge||t===ye||t===be||t===_e||t===we||t===xe||t===Me||t===Se||t===Ee||t===Te||t===Le||t===Oe||t===Ae||t===Ce||t===ke||t===Pe||t===De||t===je||t===Ie||t===Ne||t===Fe||t===Ue||t===Be||t===Ge||t===He?null!==(n=i.get("WEBGL_compressed_texture_astc"))?t:null:t===Re?null!==(n=i.get("EXT_texture_compression_bptc"))?t:null:t===Vn?r?e.UNSIGNED_INT_24_8:null!==(n=i.get("WEBGL_depth_texture"))?n.UNSIGNED_INT_24_8_WEBGL:null:void 0}}}function Na(t){Y.call(this),this.cameras=t||[]}function Fa(){Z.call(this),this.type="Group"}function Ua(d,n){var e=this,v=null,i=1,p=null,r="local-floor",m=null,g=[],o=new Map,s=new Y;s.layers.enable(1),s.viewport=new Ci;var a=new Y;a.layers.enable(2),a.viewport=new Ci;var y=new Na([s,a]);y.layers.enable(1),y.layers.enable(2);var u=null,h=null;function c(t){var n=o.get(t.inputSource);n&&(n.targetRay&&n.targetRay.dispatchEvent({type:t.type}),n.grip&&n.grip.dispatchEvent({type:t.type}))}function f(){o.forEach(function(t,n){t.targetRay&&(t.targetRay.dispatchEvent({type:"disconnected",data:n}),t.targetRay.visible=!1),t.grip&&(t.grip.dispatchEvent({type:"disconnected",data:n}),t.grip.visible=!1)}),o.clear(),d.setFramebuffer(null),d.setRenderTarget(d.getRenderTarget()),S.stop(),e.isPresenting=!1,e.dispatchEvent({type:"sessionend"})}function l(t){p=t,S.setContext(v),S.start(),e.isPresenting=!0,e.dispatchEvent({type:"sessionstart"})}function b(t){for(var n=v.inputSources,e=0;e<g.length;e++)o.set(n[e],g[e]);for(e=0;e<t.removed.length;e++){var i=t.removed[e];(r=o.get(i))&&(r.targetRay&&r.targetRay.dispatchEvent({type:"disconnected",data:i}),r.grip&&r.grip.dispatchEvent({type:"disconnected",data:i}),o.delete(i))}for(e=0;e<t.added.length;e++){var r,i=t.added[e];(r=o.get(i))&&(r.targetRay&&r.targetRay.dispatchEvent({type:"connected",data:i}),r.grip&&r.grip.dispatchEvent({type:"connected",data:i}))}}this.enabled=!1,this.isPresenting=!1,this.getController=function(t){var n=g[t];return void 0===n&&(g[t]=n={}),void 0===n.targetRay&&(n.targetRay=new Fa,n.targetRay.matrixAutoUpdate=!1,n.targetRay.visible=!1),n.targetRay},this.getControllerGrip=function(t){var n=g[t];return void 0===n&&(g[t]=n={}),void 0===n.grip&&(n.grip=new Fa,n.grip.matrixAutoUpdate=!1,n.grip.visible=!1),n.grip},this.setFramebufferScaleFactor=function(t){i=t,1==e.isPresenting&&console.warn("WebXRManager: Cannot change framebuffer scale while presenting VR content")},this.setReferenceSpaceType=function(t){r=t},this.getReferenceSpace=function(){return p},this.getSession=function(){return v},this.setSession=function(t){null!==(v=t)&&(v.addEventListener("select",c),v.addEventListener("selectstart",c),v.addEventListener("selectend",c),v.addEventListener("squeeze",c),v.addEventListener("squeezestart",c),v.addEventListener("squeezeend",c),v.addEventListener("end",f),t={antialias:(t=n.getContextAttributes()).antialias,alpha:t.alpha,depth:t.depth,stencil:t.stencil,framebufferScaleFactor:i},t=new XRWebGLLayer(v,n,t),v.updateRenderState({baseLayer:t}),v.requestReferenceSpace(r).then(l),v.addEventListener("inputsourceschange",b))};var _=new St,w=new St;function x(t,n){null===n?t.matrixWorld.copy(t.matrix):t.matrixWorld.multiplyMatrices(n.matrixWorld,t.matrix),t.matrixWorldInverse.getInverse(t.matrixWorld)}this.getCamera=function(t){y.near=a.near=s.near=t.near,y.far=a.far=s.far=t.far,u===y.near&&h===y.far||(v.updateRenderState({depthNear:y.near,depthFar:y.far}),u=y.near,h=y.far);var n=t.parent,e=y.cameras;x(y,n);for(var i=0;i<e.length;i++)x(e[i],n);t.matrixWorld.copy(y.matrixWorld);for(var r=t.children,i=0,o=r.length;i<o;i++)r[i].updateMatrixWorld(!0);return function(t,n,e){_.setFromMatrixPosition(n.matrixWorld),w.setFromMatrixPosition(e.matrixWorld);var i=_.distanceTo(w),r=n.projectionMatrix.elements,o=e.projectionMatrix.elements,s=r[14]/(r[10]-1),a=r[14]/(r[10]+1),u=(r[9]+1)/r[5],h=(r[9]-1)/r[5],c=(r[8]-1)/r[0],e=(o[8]+1)/o[0],r=s*c,o=s*e,c=(e=i/(e-c))*-c;n.matrixWorld.decompose(t.position,t.quaternion,t.scale),t.translateX(c),t.translateZ(e),t.matrixWorld.compose(t.position,t.quaternion,t.scale),t.matrixWorldInverse.getInverse(t.matrixWorld),s+=e,e=a+e,t.projectionMatrix.makePerspective(r-c,i-c+o,u*a/e*s,h*a/e*s,s,e)}(y,s,a),y};var M=null;var S=new Er;S.setAnimationLoop(function(t,n){if(null!==(m=n.getViewerPose(p))){var e=m.views,i=v.renderState.baseLayer;d.setFramebuffer(i.framebuffer);for(var r=0;r<e.length;r++){var o=e[r],s=i.getViewport(o),a=y.cameras[r];a.matrix.fromArray(o.transform.matrix),a.projectionMatrix.fromArray(o.projectionMatrix),a.viewport.set(s.x,s.y,s.width,s.height),0===r&&y.matrix.copy(a.matrix)}}for(var u=v.inputSources,r=0;r<g.length;r++){var h=g[r],c=u[r],f=null,l=null;c&&(h.targetRay&&null!==(f=n.getPose(c.targetRaySpace,p))&&(h.targetRay.matrix.fromArray(f.transform.matrix),h.targetRay.matrix.decompose(h.targetRay.position,h.targetRay.rotation,h.targetRay.scale)),h.grip&&c.gripSpace&&null!==(l=n.getPose(c.gripSpace,p))&&(h.grip.matrix.fromArray(l.transform.matrix),h.grip.matrix.decompose(h.grip.position,h.grip.rotation,h.grip.scale))),h.targetRay&&(h.targetRay.visible=null!==f),h.grip&&(h.grip.visible=null!==l)}M&&M(t,n)}),this.setAnimationLoop=function(t){M=t},this.dispose=function(){}}function Ba(t){var i=void 0!==(t=t||{}).canvas?t.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),n=void 0!==t.context?t.context:null,e=void 0!==t.alpha&&t.alpha,r=void 0===t.depth||t.depth,o=void 0===t.stencil||t.stencil,s=void 0!==t.antialias&&t.antialias,a=void 0===t.premultipliedAlpha||t.premultipliedAlpha,u=void 0!==t.preserveDrawingBuffer&&t.preserveDrawingBuffer,h=void 0!==t.powerPreference?t.powerPreference:"default",c=void 0!==t.failIfMajorPerformanceCaveat&&t.failIfMajorPerformanceCaveat,v=null,y=null;this.domElement=i,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.outputEncoding=Ye,this.physicallyCorrectLights=!1,this.toneMapping=fn,this.toneMappingExposure=1,this.toneMappingWhitePoint=1,this.maxMorphTargets=8,this.maxMorphNormals=4;var _,w,x,M,p,b,S,E,f,m,l,d,g,T,L,R,O,A,C=this,k=!1,P=null,D=0,j=0,I=null,N=null,F=-1,U={geometry:null,program:null,wireframe:!1},B=null,G=null,H=new Ci,V=new Ci,z=null,W=i.width,X=i.height,Z=1,Y=null,q=null,K=new Ci(0,0,W,X),J=new Ci(0,0,W,X),Q=!1,$=new Tt,tt=new Wo,nt=!1,et=!1,it=new Et,rt=new St;function ot(){return null===I?Z:1}try{var st={alpha:e,depth:r,stencil:o,antialias:s,premultipliedAlpha:a,preserveDrawingBuffer:u,powerPreference:h,failIfMajorPerformanceCaveat:c,xrCompatible:!1};if(i.addEventListener("webglcontextlost",ct,!1),i.addEventListener("webglcontextrestored",ft,!1),null===(_=n||i.getContext("webgl",st)||i.getContext("experimental-webgl",st)))throw null!==i.getContext("webgl")?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.");void 0===_.getShaderPrecisionFormat&&(_.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(t){throw console.error("THREE.WebGLRenderer: "+t.message),t}function at(){w=new Xo(_),!1===(x=new zo(_,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"),A=new Ia(_,w,x),(M=new Pa(_,w,x)).scissor(V.copy(J).multiplyScalar(Z).floor()),M.viewport(H.copy(K).multiplyScalar(Z).floor()),p=new qo(_),b=new pa,S=new ja(_,w,M,b,x,A,p),E=new Tr(_,x),f=new Zo(_,E,p),m=new Qo(_,f,E,p),L=new Jo(_),l=new va(C,w,x),d=new ba,g=new Ea,T=new Ho(C,M,m,a),R=new Vo(_,w,p,x),O=new Yo(_,w,p,x),p.programs=l.programs,C.capabilities=x,C.extensions=w,C.properties=b,C.renderLists=d,C.state=M,C.info=p}at();var ut=new Ua(C,_);this.xr=ut;var ht=new Ca(C,m,x.maxTextureSize);function ct(t){t.preventDefault(),k=!0}function ft(){k=!1,at()}function lt(t){t=t.target;t.removeEventListener("dispose",lt),dt(t=t),b.remove(t)}function dt(t){var n=b.get(t).program;(t.program=void 0)!==n&&l.releaseProgram(n)}this.shadowMap=ht,this.getContext=function(){return _},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 Z},this.setPixelRatio=function(t){void 0!==t&&(Z=t,this.setSize(W,X,!1))},this.getSize=function(t){return void 0===t&&(console.warn("WebGLRenderer: .getsize() now requires a Vector2 as an argument"),t=new ci),t.set(W,X)},this.setSize=function(t,n,e){ut.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(W=t,X=n,i.width=Math.floor(t*Z),i.height=Math.floor(n*Z),!1!==e&&(i.style.width=t+"px",i.style.height=n+"px"),this.setViewport(0,0,t,n))},this.getDrawingBufferSize=function(t){return void 0===t&&(console.warn("WebGLRenderer: .getdrawingBufferSize() now requires a Vector2 as an argument"),t=new ci),t.set(W*Z,X*Z).floor()},this.setDrawingBufferSize=function(t,n,e){W=t,X=n,Z=e,i.width=Math.floor(t*e),i.height=Math.floor(n*e),this.setViewport(0,0,t,n)},this.getCurrentViewport=function(t){return void 0===t&&(console.warn("WebGLRenderer: .getCurrentViewport() now requires a Vector4 as an argument"),t=new Ci),t.copy(H)},this.getViewport=function(t){return t.copy(K)},this.setViewport=function(t,n,e,i){t.isVector4?K.set(t.x,t.y,t.z,t.w):K.set(t,n,e,i),M.viewport(H.copy(K).multiplyScalar(Z).floor())},this.getScissor=function(t){return t.copy(J)},this.setScissor=function(t,n,e,i){t.isVector4?J.set(t.x,t.y,t.z,t.w):J.set(t,n,e,i),M.scissor(V.copy(J).multiplyScalar(Z).floor())},this.getScissorTest=function(){return Q},this.setScissorTest=function(t){M.setScissorTest(Q=t)},this.setOpaqueSort=function(t){Y=t},this.setTransparentSort=function(t){q=t},this.getClearColor=function(){return T.getClearColor()},this.setClearColor=function(){T.setClearColor.apply(T,arguments)},this.getClearAlpha=function(){return T.getClearAlpha()},this.setClearAlpha=function(){T.setClearAlpha.apply(T,arguments)},this.clear=function(t,n,e){var i=0;void 0!==t&&!t||(i|=_.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",ct,!1),i.removeEventListener("webglcontextrestored",ft,!1),d.dispose(),g.dispose(),b.dispose(),m.dispose(),ut.dispose(),mt.stop(),this.forceContextLoss()},this.renderBufferImmediate=function(t,n){M.initAttributes();var e=b.get(t);t.hasPositions&&!e.position&&(e.position=_.createBuffer()),t.hasNormals&&!e.normal&&(e.normal=_.createBuffer()),t.hasUvs&&!e.uv&&(e.uv=_.createBuffer()),t.hasColors&&!e.color&&(e.color=_.createBuffer());n=n.getAttributes();t.hasPositions&&(_.bindBuffer(_.ARRAY_BUFFER,e.position),_.bufferData(_.ARRAY_BUFFER,t.positionArray,_.DYNAMIC_DRAW),M.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),M.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),M.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),M.enableAttribute(n.color),_.vertexAttribPointer(n.color,3,_.FLOAT,!1,0,0)),M.disableUnusedAttributes(),_.drawArrays(_.TRIANGLES,0,t.count),t.count=0};var vt=new Sr;this.renderBufferDirect=function(t,n,e,i,r,o){null===n&&(n=vt);var s=r.isMesh&&r.matrixWorld.determinant()<0,a=_t(t,n,i,r);M.setMaterial(i,s);var u=!1;U.geometry===e.id&&U.program===a.id&&U.wireframe===(!0===i.wireframe)||(U.geometry=e.id,U.program=a.id,U.wireframe=!0===i.wireframe,u=!0),(i.morphTargets||i.morphNormals)&&(L.update(r,e,i,a),u=!0);var h=e.index,t=e.attributes.position;if(null===h){if(void 0===t||0===t.count)return}else if(0===h.count)return;n=1;!0===i.wireframe&&(h=f.getWireframeAttribute(e),n=2);s=R;null!==h&&(c=E.get(h),(s=O).setIndex(c)),u&&(function(t,n,e,i){if(!1===x.isWebGL2&&(t.isInstancedMesh||n.isInstancedBufferGeometry)&&null===w.get("ANGLE_instanced_arrays"))return;M.initAttributes();var r,o=n.attributes,s=i.getAttributes(),a=e.defaultAttributeValues;for(r in s){var u=s[r];if(0<=u){var h=o[r];if(void 0!==h){var c,f,l,d,v,p,m,g=h.normalized,y=h.itemSize;void 0!==(c=E.get(h))&&(f=c.buffer,l=c.type,d=c.bytesPerElement,h.isInterleavedBufferAttribute?(v=h.data,p=v.stride,m=h.offset,v&&v.isInstancedInterleavedBuffer?(M.enableAttributeAndDivisor(u,v.meshPerAttribute),void 0===n.maxInstancedCount&&(n.maxInstancedCount=v.meshPerAttribute*v.count)):M.enableAttribute(u),_.bindBuffer(_.ARRAY_BUFFER,f),_.vertexAttribPointer(u,y,l,g,p*d,m*d)):(h.isInstancedBufferAttribute?(M.enableAttributeAndDivisor(u,h.meshPerAttribute),void 0===n.maxInstancedCount&&(n.maxInstancedCount=h.meshPerAttribute*h.count)):M.enableAttribute(u),_.bindBuffer(_.ARRAY_BUFFER,f),_.vertexAttribPointer(u,y,l,g,0,0)))}else if("instanceMatrix"===r)void 0!==(c=E.get(t.instanceMatrix))&&(f=c.buffer,l=c.type,M.enableAttributeAndDivisor(u+0,1),M.enableAttributeAndDivisor(u+1,1),M.enableAttributeAndDivisor(u+2,1),M.enableAttributeAndDivisor(u+3,1),_.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 b=a[r];if(void 0!==b)switch(b.length){case 2:_.vertexAttrib2fv(u,b);break;case 3:_.vertexAttrib3fv(u,b);break;case 4:_.vertexAttrib4fv(u,b);break;default:_.vertexAttrib1fv(u,b)}}}}M.disableUnusedAttributes()}(r,e,i,a),null!==h&&_.bindBuffer(_.ELEMENT_ARRAY_BUFFER,c.buffer));var a=(null!==h?h:t).count,c=e.drawRange.start*n,h=e.drawRange.count*n,t=null!==o?o.start*n:0,o=null!==o?o.count*n:1/0,n=Math.max(c,t),o=Math.min(a,c+h,t+o)-1,o=Math.max(0,o-n+1);0!==o&&(r.isMesh?!0===i.wireframe?(M.setLineWidth(i.wireframeLinewidth*ot()),s.setMode(_.LINES)):s.setMode(_.TRIANGLES):r.isLine?(i=i.linewidth,M.setLineWidth((i=void 0===i?1:i)*ot()),r.isLineSegments?s.setMode(_.LINES):r.isLineLoop?s.setMode(_.LINE_LOOP):s.setMode(_.LINE_STRIP)):r.isPoints?s.setMode(_.POINTS):r.isSprite&&s.setMode(_.TRIANGLES),r.isInstancedMesh?s.renderInstances(e,n,o,r.count):e.isInstancedBufferGeometry?s.renderInstances(e,n,o,e.maxInstancedCount):s.render(n,o))},this.compile=function(e,t){(y=g.get(e,t)).init(),e.traverse(function(t){t.isLight&&(y.pushLight(t),t.castShadow&&y.pushShadow(t))}),y.setupLights(t);var i={};e.traverse(function(t){if(t.material)if(Array.isArray(t.material))for(var n=0;n<t.material.length;n++)t.material[n].uuid in i==!1&&(bt(t.material[n],e,t),i[t.material[n].uuid]=!0);else t.material.uuid in i==!1&&(bt(t.material,e,t),i[t.material.uuid]=!0)})};var pt=null;var mt=new Er;function gt(t,n,e,i){for(var r=0,o=t.length;r<o;r++){var s=t[r],a=s.object,u=s.geometry,h=void 0===i?s.material:i,c=s.group;if(e.isArrayCamera)for(var f=(G=e).cameras,l=0,d=f.length;l<d;l++){var v=f[l];a.layers.test(v.layers)&&(M.viewport(H.copy(v.viewport)),y.setupLights(v),yt(a,n,v,u,h,c))}else G=null,yt(a,n,e,u,h,c)}}function yt(t,n,e,i,r,o){var s,a;t.onBeforeRender(C,n,e,i,r,o),y=g.get(n,G||e),t.modelViewMatrix.multiplyMatrices(e.matrixWorldInverse,t.matrixWorld),t.normalMatrix.getNormalMatrix(t.modelViewMatrix),t.isImmediateRenderObject?(s=_t(e,n,r,t),M.setMaterial(r),U.geometry=null,U.program=null,U.wireframe=!1,a=s,t.render(function(t){C.renderBufferImmediate(t,a)})):C.renderBufferDirect(e,n,i,r,t,o),t.onAfterRender(C,n,e,i,r,o),y=g.get(n,G||e)}function bt(t,n,e){var i=b.get(t),r=y.state.lights,o=y.state.shadowsArray,s=r.state.version,a=l.getParameters(t,r.state,o,n,tt.numPlanes,tt.numIntersection,e),u=l.getProgramCacheKey(a),o=i.program,e=!0;if(void 0===o)t.addEventListener("dispose",lt);else if(o.cacheKey!==u)dt(t);else if(i.lightsStateVersion!==s)i.lightsStateVersion=s,e=!1;else{if(void 0!==a.shaderID)return;e=!1}e&&(o=l.acquireProgram(a,u),i.program=o,i.uniforms=a.uniforms,i.environment=t.isMeshStandardMaterial?n.environment:null,i.outputEncoding=C.outputEncoding,t.program=o);var h=o.getAttributes();if(t.morphTargets)for(var c=t.numSupportedMorphTargets=0;c<C.maxMorphTargets;c++)0<=h["morphTarget"+c]&&t.numSupportedMorphTargets++;if(t.morphNormals)for(c=t.numSupportedMorphNormals=0;c<C.maxMorphNormals;c++)0<=h["morphNormal"+c]&&t.numSupportedMorphNormals++;o=i.uniforms;(t.isShaderMaterial||t.isRawShaderMaterial)&&!0!==t.clipping||(i.numClippingPlanes=tt.numPlanes,i.numIntersection=tt.numIntersection,o.clippingPlanes=tt.uniform),i.fog=n.fog,i.needsLights=(n=t).isMeshLambertMaterial||n.isMeshToonMaterial||n.isMeshPhongMaterial||n.isMeshStandardMaterial||n.isShadowMaterial||n.isShaderMaterial&&!0===n.lights,i.lightsStateVersion=s,i.needsLights&&(o.ambientLightColor.value=r.state.ambient,o.lightProbe.value=r.state.probe,o.directionalLights.value=r.state.directional,o.directionalLightShadows.value=r.state.directionalShadow,o.spotLights.value=r.state.spot,o.spotLightShadows.value=r.state.spotShadow,o.rectAreaLights.value=r.state.rectArea,o.pointLights.value=r.state.point,o.pointLightShadows.value=r.state.pointShadow,o.hemisphereLights.value=r.state.hemi,o.directionalShadowMap.value=r.state.directionalShadowMap,o.directionalShadowMatrix.value=r.state.directionalShadowMatrix,o.spotShadowMap.value=r.state.spotShadowMap,o.spotShadowMatrix.value=r.state.spotShadowMatrix,o.pointShadowMap.value=r.state.pointShadowMap,o.pointShadowMatrix.value=r.state.pointShadowMatrix);r=i.program.getUniforms(),o=qs.seqWithValue(r.seq,o);i.uniformsList=o}function _t(t,n,e,i){S.resetTextureUnits();var r=n.fog,o=e.isMeshStandardMaterial?n.environment:null,s=b.get(e),a=y.state.lights;nt&&(!et&&t===B||(g=t===B&&e.id===F,tt.setState(e.clippingPlanes,e.clipIntersection,e.clipShadows,t,s,g))),e.version===s.ve?(void 0===s.program||e.fog&&s.fog!==r||s.environment!==o||s.needsLights&&s.lightsStateVersion!==a.state.version||void 0!==s.numClippingPlanes&&(s.numClippingPlanes!==tt.numPlanes||s.numIntersection!==tt.numIntersection)||s.outputEncoding!==C.outputEncoding)&&bt(e,n,i):(bt(e,n,i),s.ve=e.version);var u,h,c,f,l,d=!1,v=!1,p=!1,m=s.program,g=m.getUniforms(),a=s.uniforms;return M.useProgram(m.program)&&(p=v=d=!0),e.id!==F&&(F=e.id,v=!0),!d&&B===t||(g.setValue(_,"projectionMatrix",t.projectionMatrix),x.logarithmicDepthBuffer&&g.setValue(_,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2)),B!==t&&(B=t,p=v=!0),!(e.isShaderMaterial||e.isMeshPhongMaterial||e.isMeshToonMaterial||e.isMeshStandardMaterial||e.envMap)||void 0!==(u=g.map.cameraPosition)&&u.setValue(_,rt.setFromMatrixPosition(t.matrixWorld)),(e.isMeshPhongMaterial||e.isMeshToonMaterial||e.isMeshLambertMaterial||e.isMeshBasicMaterial||e.isMeshStandardMaterial||e.isShaderMaterial)&&g.setValue(_,"isOrthographic",!0===t.isOrthographicCamera),(e.isMeshPhongMaterial||e.isMeshToonMaterial||e.isMeshLambertMaterial||e.isMeshBasicMaterial||e.isMeshStandardMaterial||e.isShaderMaterial||e.skinning)&&g.setValue(_,"viewMatrix",t.matrixWorldInverse)),e.skinning&&(g.setOptional(_,i,"bindMatrix"),g.setOptional(_,i,"bindMatrixInverse"),(n=i.skeleton)&&(d=n.bones,x.floatVertexTextures?(void 0===n.boneTexture&&(u=Math.sqrt(4*d.length),u=Mt.ceilPowerOfTwo(u),u=Math.max(u,4),(t=new Float32Array(u*u*4)).set(n.boneMatrices),d=new Mr(t,u,u,Xn,Fn),n.boneMatrices=t,n.boneTexture=d,n.boneTextureSize=u),g.setValue(_,"boneTexture",n.boneTexture,S),g.setValue(_,"boneTextureSize",n.boneTextureSize)):g.setOptional(_,n,"boneMatrices"))),!v&&s.receiveShadow===i.receiveShadow||(s.receiveShadow=i.receiveShadow,g.setValue(_,"receiveShadow",i.receiveShadow)),v&&(g.setValue(_,"toneMappingExposure",C.toneMappingExposure),g.setValue(_,"toneMappingWhitePoint",C.toneMappingWhitePoint),s.needsLights&&(v=p,(p=a).ambientLightColor.needsUpdate=v,p.lightProbe.needsUpdate=v,p.directionalLights.needsUpdate=v,p.directionalLightShadows.needsUpdate=v,p.pointLights.needsUpdate=v,p.pointLightShadows.needsUpdate=v,p.spotLights.needsUpdate=v,p.spotLightShadows.needsUpdate=v,p.rectAreaLights.needsUpdate=v,p.hemisphereLights.needsUpdate=v),r&&e.fog&&(l=r,(f=a).fogColor.value.copy(l.color),l.isFog?(f.fogNear.value=l.near,f.fogFar.value=l.far):l.isFogExp2&&(f.fogDensity.value=l.density)),e.isMeshBasicMaterial?wt(a,e):e.isMeshLambertMaterial?(wt(a,e),f=a,(l=e).emissiveMap&&(f.emissiveMap.value=l.emissiveMap)):e.isMeshToonMaterial?(wt(a,e),function(t,n){t.specular.value.copy(n.specular),t.shininess.value=Math.max(n.shininess,1e-4),n.gradientMap&&(t.gradientMap.value=n.gradientMap);n.emissiveMap&&(t.emissiveMap.value=n.emissiveMap);n.bumpMap&&(t.bumpMap.value=n.bumpMap,t.bumpScale.value=n.bumpScale,n.side===Rt&&(t.bumpScale.value*=-1));n.normalMap&&(t.normalMap.value=n.normalMap,t.normalScale.value.copy(n.normalScale),n.side===Rt&&t.normalScale.value.negate());n.displacementMap&&(t.displacementMap.value=n.displacementMap,t.displacementScale.value=n.displacementScale,t.displacementBias.value=n.displacementBias)}(a,e)):e.isMeshPhongMaterial?(wt(a,e),function(t,n){t.specular.value.copy(n.specular),t.shininess.value=Math.max(n.shininess,1e-4),n.emissiveMap&&(t.emissiveMap.value=n.emissiveMap);n.bumpMap&&(t.bumpMap.value=n.bumpMap,t.bumpScale.value=n.bumpScale,n.side===Rt&&(t.bumpScale.value*=-1));n.normalMap&&(t.normalMap.value=n.normalMap,t.normalScale.value.copy(n.normalScale),n.side===Rt&&t.normalScale.value.negate());n.displacementMap&&(t.displacementMap.value=n.displacementMap,t.displacementScale.value=n.displacementScale,t.displacementBias.value=n.displacementBias)}(a,e)):e.isMeshStandardMaterial?(wt(a,e,o),(e.isMeshPhysicalMaterial?function(t,n,e){xt(t,n,e),t.reflectivity.value=n.reflectivity,t.clearcoat.value=n.clearcoat,t.clearcoatRoughness.value=n.clearcoatRoughness,n.sheen&&t.sheen.value.copy(n.sheen);n.clearcoatMap&&(t.clearcoatMap.value=n.clearcoatMap);n.clearcoatRoughnessMap&&(t.clearcoatRoughnessMap.value=n.clearcoatRoughnessMap);n.clearcoatNormalMap&&(t.clearcoatNormalScale.value.copy(n.clearcoatNormalScale),t.clearcoatNormalMap.value=n.clearcoatNormalMap,n.side===Rt&&t.clearcoatNormalScale.value.negate());t.transparency.value=n.transparency}:xt)(a,e,o)):e.isMeshMatcapMaterial?(wt(a,e),function(t,n){n.matcap&&(t.matcap.value=n.matcap);n.bumpMap&&(t.bumpMap.value=n.bumpMap,t.bumpScale.value=n.bumpScale,n.side===Rt&&(t.bumpScale.value*=-1));n.normalMap&&(t.normalMap.value=n.normalMap,t.normalScale.value.copy(n.normalScale),n.side===Rt&&t.normalScale.value.negate());n.displacementMap&&(t.displacementMap.value=n.displacementMap,t.displacementScale.value=n.displacementScale,t.displacementBias.value=n.displacementBias)}(a,e)):e.isMeshDepthMaterial?(wt(a,e),h=a,(c=e).displacementMap&&(h.displacementMap.value=c.displacementMap,h.displacementScale.value=c.displacementScale,h.displacementBias.value=c.displacementBias)):e.isMeshDistanceMaterial?(wt(a,e),function(t,n){n.displacementMap&&(t.displacementMap.value=n.displacementMap,t.displacementScale.value=n.displacementScale,t.displacementBias.value=n.displacementBias);t.referencePosition.value.copy(n.referencePosition),t.nearDistance.value=n.nearDistance,t.farDistance.value=n.farDistance}(a,e)):e.isMeshNormalMaterial?(wt(a,e),function(t,n){n.bumpMap&&(t.bumpMap.value=n.bumpMap,t.bumpScale.value=n.bumpScale,n.side===Rt&&(t.bumpScale.value*=-1));n.normalMap&&(t.normalMap.value=n.normalMap,t.normalScale.value.copy(n.normalScale),n.side===Rt&&t.normalScale.value.negate());n.displacementMap&&(t.displacementMap.value=n.displacementMap,t.displacementScale.value=n.displacementScale,t.displacementBias.value=n.displacementBias)}(a,e)):e.isLineBasicMaterial?(h=e,(c=a).diffuse.value.copy(h.color),c.opacity.value=h.opacity,e.isLineDashedMaterial&&(c=e,(h=a).dashSize.value=c.dashSize,h.totalSize.value=c.dashSize+c.gapSize,h.scale.value=c.scale)):e.isPointsMaterial?function(t,n){t.diffuse.value.copy(n.color),t.opacity.value=n.opacity,t.size.value=n.size*Z,t.scale.value=.5*X,n.map&&(t.map.value=n.map);n.alphaMap&&(t.alphaMap.value=n.alphaMap);var e;n.map?e=n.map:n.alphaMap&&(e=n.alphaMap);void 0!==e&&(!0===e.matrixAutoUpdate&&e.updateMatrix(),t.uvTransform.value.copy(e.matrix))}(a,e):e.isSpriteMaterial?function(t,n){t.diffuse.value.copy(n.color),t.opacity.value=n.opacity,t.rotation.value=n.rotation,n.map&&(t.map.value=n.map);n.alphaMap&&(t.alphaMap.value=n.alphaMap);var e;n.map?e=n.map:n.alphaMap&&(e=n.alphaMap);void 0!==e&&(!0===e.matrixAutoUpdate&&e.updateMatrix(),t.uvTransform.value.copy(e.matrix))}(a,e):e.isShadowMaterial&&(a.color.value.copy(e.color),a.opacity.value=e.opacity),void 0!==a.ltc_1&&(a.ltc_1.value=sr.LTC_1),void 0!==a.ltc_2&&(a.ltc_2.value=sr.LTC_2),qs.upload(_,s.uniformsList,a,S),e.isShaderMaterial&&(e.uniformsNeedUpdate=!1)),e.isShaderMaterial&&!0===e.uniformsNeedUpdate&&(qs.upload(_,s.uniformsList,a,S),e.uniformsNeedUpdate=!1),e.isSpriteMaterial&&g.setValue(_,"center",i.center),g.setValue(_,"modelViewMatrix",i.modelViewMatrix),g.setValue(_,"normalMatrix",i.normalMatrix),g.setValue(_,"modelMatrix",i.matrixWorld),m}function wt(t,n,e){t.opacity.value=n.opacity,n.color&&t.diffuse.value.copy(n.color),n.emissive&&t.emissive.value.copy(n.emissive).multiplyScalar(n.emissiveIntensity),n.map&&(t.map.value=n.map),n.alphaMap&&(t.alphaMap.value=n.alphaMap),n.specularMap&&(t.specularMap.value=n.specularMap);var i,r,e=n.envMap||e;e&&(t.envMap.value=e,t.flipEnvMap.value=e.isCubeTexture?-1:1,t.reflectivity.value=n.reflectivity,t.refractionRatio.value=n.refractionRatio,t.maxMipLevel.value=b.get(e).se),n.lightMap&&(t.lightMap.value=n.lightMap,t.lightMapIntensity.value=n.lightMapIntensity),n.aoMap&&(t.aoMap.value=n.aoMap,t.aoMapIntensity.value=n.aoMapIntensity),n.map?i=n.map:n.specularMap?i=n.specularMap:n.displacementMap?i=n.displacementMap:n.normalMap?i=n.normalMap:n.bumpMap?i=n.bumpMap:n.roughnessMap?i=n.roughnessMap:n.metalnessMap?i=n.metalnessMap:n.alphaMap?i=n.alphaMap:n.emissiveMap&&(i=n.emissiveMap),void 0!==i&&(!0===(i=i.isWebGLRenderTarget?i.texture:i).matrixAutoUpdate&&i.updateMatrix(),t.uvTransform.value.copy(i.matrix)),n.aoMap?r=n.aoMap:n.lightMap&&(r=n.lightMap),void 0!==r&&(!0===(r=r.isWebGLRenderTarget?r.texture:r).matrixAutoUpdate&&r.updateMatrix(),t.uv2Transform.value.copy(r.matrix))}function xt(t,n,e){t.roughness.value=n.roughness,t.metalness.value=n.metalness,n.roughnessMap&&(t.roughnessMap.value=n.roughnessMap),n.metalnessMap&&(t.metalnessMap.value=n.metalnessMap),n.emissiveMap&&(t.emissiveMap.value=n.emissiveMap),n.bumpMap&&(t.bumpMap.value=n.bumpMap,t.bumpScale.value=n.bumpScale,n.side===Rt&&(t.bumpScale.value*=-1)),n.normalMap&&(t.normalMap.value=n.normalMap,t.normalScale.value.copy(n.normalScale),n.side===Rt&&t.normalScale.value.negate()),n.displacementMap&&(t.displacementMap.value=n.displacementMap,t.displacementScale.value=n.displacementScale,t.displacementBias.value=n.displacementBias),(n.envMap||e)&&(t.envMapIntensity.value=n.envMapIntensity)}mt.setAnimationLoop(function(t){ut.isPresenting||pt&&pt(t)}),"undefined"!=typeof window&&mt.setContext(window),this.setAnimationLoop=function(t){pt=t,ut.setAnimationLoop(t),mt.start()},this.render=function(t,n){var e,i,r;void 0!==arguments[2]&&(console.warn("THREE.WebGLRenderer.render(): the renderTarget argument has been removed. Use .setRenderTarget() instead."),i=arguments[2]),void 0!==arguments[3]&&(console.warn("THREE.WebGLRenderer.render(): the forceClear argument has been removed. Use .clear() instead."),r=arguments[3]),n&&n.isCamera?k||(U.geometry=null,U.program=null,U.wireframe=!1,F=-1,!(B=null)===t.autoUpdate&&t.updateMatrixWorld(),null===n.parent&&n.updateMatrixWorld(),ut.enabled&&ut.isPresenting&&(n=ut.getCamera(n)),(y=g.get(t,n)).init(),t.onBeforeRender(C,t,n,i||I),it.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),$.setFromProjectionMatrix(it),et=this.localClippingEnabled,nt=tt.init(this.clippingPlanes,et,n),(v=d.get(t,n)).init(),function t(n,e,i,r){if(!1===n.visible)return;var o=n.layers.test(e.layers);if(o)if(n.isGroup)i=n.renderOrder;else if(n.isLOD)!0===n.autoUpdate&&n.update(e);else if(n.isLight)y.pushLight(n),n.castShadow&&y.pushShadow(n);else if(n.isSprite)n.frustumCulled&&!$.intersectsSprite(n)||(r&&rt.setFromMatrixPosition(n.matrixWorld).applyMatrix4(it),s=m.update(n),(a=n.material).visible&&v.push(n,s,a,i,rt.z,null));else if(n.isImmediateRenderObject)r&&rt.setFromMatrixPosition(n.matrixWorld).applyMatrix4(it),v.push(n,null,n.material,i,rt.z,null);else if((n.isMesh||n.isLine||n.isPoints)&&(n.isSkinnedMesh&&n.skeleton.frame!==p.render.frame&&(n.skeleton.update(),n.skeleton.frame=p.render.frame),!n.frustumCulled||$.intersectsObject(n))){r&&rt.setFromMatrixPosition(n.matrixWorld).applyMatrix4(it);var s=m.update(n),a=n.material;if(Array.isArray(a))for(var u=s.groups,h=0,c=u.length;h<c;h++){var f=u[h],l=a[f.materialIndex];l&&l.visible&&v.push(n,s,l,i,rt.z,f)}else a.visible&&v.push(n,s,a,i,rt.z,null)}var d=n.children;for(var h=0,c=d.length;h<c;h++)t(d[h],e,i,r)}(t,n,0,C.sortObjects),v.finish(),!0===C.sortObjects&&v.sort(Y,q),nt&&tt.beginShadows(),e=y.state.shadowsArray,ht.render(e,t,n),y.setupLights(n),nt&&tt.endShadows(),this.info.autoReset&&this.info.reset(),void 0!==i&&this.setRenderTarget(i),T.render(v,t,n,r),e=v.opaque,i=v.transparent,t.overrideMaterial?(r=t.overrideMaterial,e.length&&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(C,t,n),null!==I&&(S.updateRenderTargetMipmap(I),S.updateMultisampleRenderTarget(I)),M.buffers.depth.setTest(!0),M.buffers.depth.setMask(!0),M.buffers.color.setMask(!0),M.setPolygonOffset(!1),y=v=null):console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")},this.setFramebuffer=function(t){P!==t&&null===I&&_.bindFramebuffer(_.FRAMEBUFFER,t),P=t},this.getActiveCubeFace=function(){return D},this.getActiveMipmapLevel=function(){return j},this.getRenderTarget=function(){return I},this.setRenderTarget=function(t,n,e){D=n,j=e,(I=t)&&void 0===b.get(t).he&&S.setupRenderTarget(t);var i,r=P,o=!1;z=t?(i=b.get(t).he,t.isWebGLCubeRenderTarget?(r=i[n||0],o=!0):r=t.isWebGLMultisampleRenderTarget?b.get(t).fe:i,H.copy(t.viewport),V.copy(t.scissor),t.scissorTest):(H.copy(K).multiplyScalar(Z).floor(),V.copy(J).multiplyScalar(Z).floor(),Q),N!==r&&(_.bindFramebuffer(_.FRAMEBUFFER,r),N=r),M.viewport(H),M.scissor(V),M.setScissorTest(z),o&&(t=b.get(t.texture),_.framebufferTexture2D(_.FRAMEBUFFER,_.COLOR_ATTACHMENT0,_.TEXTURE_CUBE_MAP_POSITIVE_X+(n||0),t.ue,e||0))},this.readRenderTargetPixels=function(t,n,e,i,r,o,s){if(t&&t.isWebGLRenderTarget){var a=b.get(t).he;if(a=t.isWebGLCubeRenderTarget&&void 0!==s?a[s]:a){s=!1;a!==N&&(_.bindFramebuffer(_.FRAMEBUFFER,a),s=!0);try{var u=t.texture,h=u.format,c=u.type;if(h!==Xn&&A.convert(h)!==_.getParameter(_.IMPLEMENTATION_COLOR_READ_FORMAT))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!(c===kn||A.convert(c)===_.getParameter(_.IMPLEMENTATION_COLOR_READ_TYPE)||c===Fn&&(x.isWebGL2||w.get("OES_texture_float")||w.get("WEBGL_color_buffer_float"))||c===Un&&(x.isWebGL2?w.get("EXT_color_buffer_float"):w.get("EXT_color_buffer_half_float"))))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");_.checkFramebufferStatus(_.FRAMEBUFFER)===_.FRAMEBUFFER_COMPLETE?0<=n&&n<=t.width-i&&0<=e&&e<=t.height-r&&_.readPixels(n,e,i,r,A.convert(h),A.convert(c),o):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{s&&_.bindFramebuffer(_.FRAMEBUFFER,N)}}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")},this.copyFramebufferToTexture=function(t,n,e){void 0===e&&(e=0);var i=Math.pow(2,-e),r=Math.floor(n.image.width*i),o=Math.floor(n.image.height*i),i=A.convert(n.format);S.setTexture2D(n,0),_.copyTexImage2D(_.TEXTURE_2D,e,i,t.x,t.y,r,o,0),M.unbindTexture()},this.copyTextureToTexture=function(t,n,e,i){var r=n.image.width,o=n.image.height,s=A.convert(e.format),a=A.convert(e.type);S.setTexture2D(e,0),n.isDataTexture?_.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),M.unbindTexture()},this.initTexture=function(t){S.setTexture2D(t,0),M.unbindTexture()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}Na.prototype=Object.assign(Object.create(Y.prototype),{constructor:Na,isArrayCamera:!0}),Fa.prototype=Object.assign(Object.create(Z.prototype),{constructor:Fa,isGroup:!0}),Object.assign(Ua.prototype,g.prototype);di={FOCUS:2,VISIBLE:4};Object.freeze(di);var Ga=di,Ha=function(t,n,e){e=e||2;var i,r,o,s,a,u=n&&n.length,h=u?n[0]*e:t.length,c=Va(t,0,h,e,!0),f=[];if(!c||c.next===c.prev)return f;if(u&&(c=function(t,n,e,i){var r,o,s,a,u=[];for(r=0,o=n.length;r<o;r++)s=n[r]*i,a=r<o-1?n[r+1]*i:t.length,(a=Va(t,s,a,i,!1))===a.next&&(a.steiner=!0),u.push(function(t){var n=t,e=t;for(;(n.x<e.x||n.x===e.x&&n.y<e.y)&&(e=n),n=n.next,n!==t;);return e}(a));for(u.sort(Xa),r=0;r<u.length;r++)!function(t,n){(n=function(t,n){var e,i=n,r=t.x,o=t.y,s=-1/0;do{if(o<=i.y&&o>=i.next.y&&i.next.y!==i.y){var a=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(a<=r&&s<a){if((s=a)===r){if(o===i.y)return i;if(o===i.next.y)return i.next}e=i.x<i.next.x?i:i.next}}}while(i=i.next,i!==n);if(!e)return null;if(r===s)return e;var u,h=e,c=e.x,f=e.y,l=1/0;i=e;for(;r>=i.x&&i.x>=c&&r!==i.x&&Ya(o<f?r:s,o,c,f,o<f?s:r,o,i.x,i.y)&&(u=Math.abs(o-i.y)/(r-i.x),tu(i,t)&&(u<l||u===l&&(i.x>e.x||i.x===e.x&&function(t,n){return qa(t.prev,t,n.prev)<0&&qa(n.next,t,t.next)<0}(e,i)))&&(e=i,l=u)),i=i.next,i!==h;);return e}(t,n))&&(t=nu(n,t),za(n,n.next),za(t,t.next))}(u[r],e),e=za(e,e.next);return e}(t,n,c,e)),t.length>80*e){for(var l=i=t[0],d=r=t[1],v=e;v<h;v+=e)(o=t[v])<l&&(l=o),(s=t[v+1])<d&&(d=s),i<o&&(i=o),r<s&&(r=s);a=0!==(a=Math.max(i-l,r-d))?1/a:0}return Wa(c,f,e,l,d,a),f};function Va(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=eu(o,t[o],t[o+1],s);else for(o=e-i;n<=o;o-=i)s=eu(o,t[o],t[o+1],s);return s&&Ka(s,s.next)&&(iu(s),s=s.next),s}function za(t,n){if(!t)return t;n=n||t;var e,i=t;do{if(e=!1,i.steiner||!Ka(i,i.next)&&0!==qa(i.prev,i,i.next))i=i.next;else{if(iu(i),(i=n=i.prev)===i.next)break;e=!0}}while(e||i!==n);return n}function Wa(t,n,e,i,r,o,s){if(t){!s&&o&&function(t,n,e,i){var r=t;for(;null===r.z&&(r.z=Za(r.x,r.y,n,e,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next,r!==t;);r.prevZ.nextZ=null,r.prevZ=null,function(t){var n,e,i,r,o,s,a,u,h=1;do{for(e=t,o=t=null,s=0;e;){for(s++,i=e,n=a=0;n<h&&(a++,i=i.nextZ);n++);for(u=h;0<a||0<u&&i;)0!==a&&(0===u||!i||e.z<=i.z)?(e=(r=e).nextZ,a--):(i=(r=i).nextZ,u--),o?o.nextZ=r:t=r,r.prevZ=o,o=r;e=i}}while(o.nextZ=null,h*=2,1<s)}(r)}(t,i,r,o);for(var a,u,h=t;t.prev!==t.next;)if(a=t.prev,u=t.next,o?function(t,n,e,i){var r=t.prev,o=t,s=t.next;if(0<=qa(r,o,s))return!1;var a=(r.x<o.x?r.x<s.x?r:s:o.x<s.x?o:s).x,u=(r.y<o.y?r.y<s.y?r:s:o.y<s.y?o:s).y,h=(r.x>o.x?r.x>s.x?r:s:o.x>s.x?o:s).x,c=(r.y>o.y?r.y>s.y?r:s:o.y>s.y?o:s).y,f=Za(a,u,n,e,i),l=Za(h,c,n,e,i),d=t.prevZ,v=t.nextZ;for(;d&&d.z>=f&&v&&v.z<=l;){if(d!==t.prev&&d!==t.next&&Ya(r.x,r.y,o.x,o.y,s.x,s.y,d.x,d.y)&&0<=qa(d.prev,d,d.next))return!1;if(d=d.prevZ,v!==t.prev&&v!==t.next&&Ya(r.x,r.y,o.x,o.y,s.x,s.y,v.x,v.y)&&0<=qa(v.prev,v,v.next))return!1;v=v.nextZ}for(;d&&d.z>=f;){if(d!==t.prev&&d!==t.next&&Ya(r.x,r.y,o.x,o.y,s.x,s.y,d.x,d.y)&&0<=qa(d.prev,d,d.next))return!1;d=d.prevZ}for(;v&&v.z<=l;){if(v!==t.prev&&v!==t.next&&Ya(r.x,r.y,o.x,o.y,s.x,s.y,v.x,v.y)&&0<=qa(v.prev,v,v.next))return!1;v=v.nextZ}return!0}(t,i,r,o):function(t){var n=t.prev,e=t,i=t.next;if(0<=qa(n,e,i))return!1;var r=t.next.next;for(;r!==t.prev;){if(Ya(n.x,n.y,e.x,e.y,i.x,i.y,r.x,r.y)&&0<=qa(r.prev,r,r.next))return!1;r=r.next}return!0}(t))n.push(a.i/e),n.push(t.i/e),n.push(u.i/e),iu(t),t=u.next,h=u.next;else if((t=u)===h){s?1===s?Wa(t=function(t,n,e){var i=t;do{var r=i.prev,o=i.next.next}while(!Ka(r,o)&&Ja(r,i,i.next,o)&&tu(r,o)&&tu(o,r)&&(n.push(r.i/e),n.push(i.i/e),n.push(o.i/e),iu(i),iu(i.next),i=t=o),i=i.next,i!==t);return za(i)}(za(t),n,e),n,e,i,r,o,2):2===s&&function(t,n,e,i,r,o){var s=t;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&function(t,n){return t.next.i!==n.i&&t.prev.i!==n.i&&!function(t,n){var e=t;do{if(e.i!==t.i&&e.next.i!==t.i&&e.i!==n.i&&e.next.i!==n.i&&Ja(e,e.next,t,n))return!0}while(e=e.next,e!==t);return!1}(t,n)&&(tu(t,n)&&tu(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)&&(qa(t.prev,t,n.prev)||qa(t,n.prev,n))||Ka(t,n)&&0<qa(t.prev,t,t.next)&&0<qa(n.prev,n,n.next))}(s,a)){var u=nu(s,a);return s=za(s,s.next),u=za(u,u.next),Wa(s,n,e,i,r,o),Wa(u,n,e,i,r,o)}a=a.next}}while(s=s.next,s!==t)}(t,n,e,i,r,o):Wa(za(t),n,e,i,r,o,1);break}}}function Xa(t,n){return t.x-n.x}function Za(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 Ya(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 qa(t,n,e){return(n.y-t.y)*(e.x-n.x)-(n.x-t.x)*(e.y-n.y)}function Ka(t,n){return t.x===n.x&&t.y===n.y}function Ja(t,n,e,i){var r=$a(qa(t,n,e)),o=$a(qa(t,n,i)),s=$a(qa(e,i,t)),a=$a(qa(e,i,n));return r!==o&&s!==a||(0===r&&Qa(t,e,n)||(0===o&&Qa(t,i,n)||(0===s&&Qa(e,t,i)||!(0!==a||!Qa(e,n,i)))))}function Qa(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 $a(t){return 0<t?1:t<0?-1:0}function tu(t,n){return qa(t.prev,t,t.next)<0?0<=qa(t,n,t.next)&&0<=qa(t,t.prev,n):qa(t,n,t.prev)<0||qa(t,t.next,n)<0}function nu(t,n){var e=new ru(t.i,t.x,t.y),i=new ru(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 eu(t,n,e,i){e=new ru(t,n,e);return i?(e.next=i.next,(e.prev=i).next.prev=e,i.next=e):(e.prev=e).next=e,e}function iu(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 ru(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 ou(t){return function(t){if(Array.isArray(t))return su(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,n){if(t){if("string"==typeof t)return su(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(e="Object"===e&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?su(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 su(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 au={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 au.area(t)<0},triangulateShape:function(t,n){var e=[],i=[],r=[];uu(t),hu(e,t);var o=t.length;n.forEach(uu);for(var s=0;s<n.length;s++)i.push(o),o+=n[s].length,hu(e,n[s]);for(var a=Ha(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,ou(t[0]));for(var n=[],e=1;e<t.length;e++){var i=[];i.push.apply(i,ou(t[e])),n.push(i)}if(!au.isClockWise(r))for(var r=r.reverse(),o=0,s=n.length;o<s;o++){var a=n[o];au.isClockWise(a)&&(n[o]=a.reverse())}return au.triangulateShape(r,n)}};function uu(t){var n,e=t.length;2<e&&(n=t[e-1],e=t[0],n.x===e.x&&n.y===e.y)&&t.pop()}function hu(t,n){for(var e=0;e<n.length;e++)t.push(n[e].x),t.push(n[e].y)}var cu=1e-5,fu=Math.PI/180,lu=180/Math.PI,pi=function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t)};Object.assign(pi.prototype,{me:function(){return cu},ge:function(){return fu},ye:function(){return lu},be:function(t){return t<cu&&-cu<t},_e:function(t){return cu<t},we:function(t){return t<-cu},xe:function(t,n,e){e=(t.x-e.x)*(n.y-e.y)-(n.x-e.x)*(t.y-e.y);return Math.abs(e)<cu?0:e},distanceOfTwoPoints:function(t,n){return t&&n?Math.sqrt((t.x-n.x)*(t.x-n.x)+(t.y-n.y)*(t.y-n.y)):Number.NaN},distance:function(t,n){return Math.sqrt(Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2))},isPolygonContainPoint:function(t,n){for(var e=0,i=0;i<t.length;i++){var r=t[i].x,o=t[i].y,s=0,a=0,a=i<t.length-1?(s=t[i+1].x,t[i+1].y):(s=t[0].x,t[0].y);if(r===n.x&&o===n.y||s===n.x&&a===n.y)return!0;if(a!==o){var u=r+(n.y-o)*(s-r)/(a-o);if(u===n.x)return!0;r!==s?u<=Math.max(r,s)&&u>=Math.min(r,s)&&u>n.x&&u!==r&&(u===s&&0<(o-n.y)*(a-n.y)?e+=2:e++):u<=Math.max(r,s)&&u>=Math.min(r,s)&&u>n.x&&(u===s&&0<(o-n.y)*(a-n.y)?e+=2:e++)}}return 0<e%2},Me: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))))},Se: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.xe(e,n,t)||0!==this.xe(n,i,t))&&(!(this.xe(e,n,t)*this.xe(n,i,t)<0)&&!(this.xe(t,i,e)*this.xe(i,n,e)<0))))))},Ee: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),e=Math.max(n.y,e.y);return!(t.x<i||t.x>r||t.y<o||t.y>e)},Le:function(t,n,e){var i=Math.min(e.x,n.x),r=Math.max(e.x,n.x),o=Math.min(e.y,n.y),n=Math.max(e.y,n.y);return!(t.x<i||t.x>r||t.y<o||t.y>n)},Re: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)},Ae:function(t,n){return Math.sqrt((t.x-n.x)*(t.x-n.x)+(t.y-n.y)*(t.y-n.y))},Ce:function(t,n){return(t.x-n.x)*(t.x-n.x)+(t.y-n.y)*(t.y-n.y)},ke:function(t,n,e){var i=n.x,r=n.y,o=e.x,s=e.y,a=t.x,u=t.y,h=o-i,c=s-r,f=h*h+c*c,n=a-i,e=u-r,t=n*n+e*e;if(this.be(f))return l=this.be(t)?0:t;var l,f=Math.sqrt(f),h=h/f,c=c/f,e=h*n+c*e;return l=this._e(e)?this.we(e-f)?(h=a-(i+e*h))*h+(c=u-(r+e*c))*c:(o=a-o)*o+(s=u-s)*s:t,this.be(l)?0:l},Pe:function(t,n,e,i){var r=n.x,o=n.y,s=e.x,a=e.y,u=t.x,h=t.y,c=s-r,f=a-o,l=Math.sqrt(c*c+f*f),d=u-r,v=h-o,t=Math.sqrt(d*d+v*v);if(this.be(l))return i.x=n.x,i.y=n.y,this.be(p=t)?0:p;var c=c/l,f=f/l,v=c*d+f*v,p=this._e(v)?this.we(v-l)?(c=u-(r=r+v*c),f=h-(v=o+v*f),f=Math.sqrt(c*c+f*f),i.x=r,i.y=v,f):(s=u-s,a=h-a,a=Math.sqrt(s*s+a*a),i.x=e.x,i.y=e.y,a):(i.x=n.x,i.y=n.y,t);return this.be(p)?0:p},De: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=au.triangulate([t]),e=0,i=0,r=0,o=0;o<n.length;o++){var s=t[n[o][0]],a=t[n[o][1]],u=t[n[o][2]],h=a.x-s.x,c=a.y-s.y,f=u.x-s.x,c=(h*(u.y-s.y)-f*c)/2;e+=c,i+=(s.x+a.x+u.x)/3*c,r+=(s.y+a.y+u.y)/3*c}return{x:i/e,y:r/e}},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)},Ne:function(t,n,e,i,r){if(this.Se(t,n,e,i)){var o=(i.x-e.x)*(t.y-n.y)-(n.x-t.x)*(e.y-i.y),s=(t.y-e.y)*(n.x-t.x)*(i.x-e.x)+e.x*(i.y-e.y)*(n.x-t.x)-t.x*(n.y-t.y)*(i.x-e.x);return r.x=s/o,o=(t.x-n.x)*(i.y-e.y)-(n.y-t.y)*(e.x-i.x),s=n.y*(t.x-n.x)*(i.y-e.y)+(i.x-n.x)*(i.y-e.y)*(t.y-n.y)-i.y*(e.x-i.x)*(n.y-t.y),r.y=s/o,1}return 0},Fe:function(t,n,e,i,r){var o=Math.min(e.x,i.x),s=Math.max(e.x,i.x),a=Math.min(e.y,i.y),u=Math.max(e.y,i.y),h=t.x,c=t.y,f=e.x,l=e.y,d=i.x,v=i.y;if(90==n){if(t.x<o||t.x>s)return!1;var p=(v-l)/(d-f)*(h-f)+l;return r.y=p,r.x=h,p<c?!1:!!this.Le(r,e,i)}if(270==n){if(t.x<o||t.x>s)return!1;t=(v-l)/(d-f)*(h-f)+l;return r.y=t,r.x=h,c<t?!1:!!this.Le(r,e,i)}if(270!=n&&90!=n&&s-o<.001){s=o,o=Math.tan(n/180*Math.PI)*(s-h)+c;if(r.y=o,r.x=s,this.Le(r,e,i)){s=s-h,o=o-c;return 0<s/Math.sqrt(s*s+o*o)*Math.cos(n/180*Math.PI)}}if(u-a<=1e-6){u=a,a=1/Math.tan(n/180*Math.PI)*(u-c)+h;if(r.x=a,r.y=u,this.Le(r,e,i)){var a=a-h,m=u-c;return 0<a/Math.sqrt(a*a+m*m)*Math.cos(n/180*Math.PI)}return!1}m=Math.tan(n/180*Math.PI),d=(v-l)/(d-f),d=(l-c-(d*f-m*h))/(m-d),m=c+m*(d-h);if(r.x=d,r.y=m,this.Le(r,e,i)){h=d-h,c=m-c;return 0<h/Math.sqrt(h*h+c*c)*Math.cos(n/180*Math.PI)}return!1},Ue:function(t,n,e,i){var r=t.x,o=t.y,s=n.x,a=n.y,u=e.x,h=e.y;if(r==s&&o==a||r==u&&o==h)return i.x=r,i.y=o,!0;var c=Math.min(n.x,e.x),f=Math.max(n.x,e.x),l=Math.min(n.y,e.y),t=Math.max(n.y,e.y);if(Math.abs(s-u)<1e-5)return i.x=s,l<=(i.y=o)&&o<=t;if(Math.abs(a-h)<1e-5)return i.x=r,i.y=a,c<=r&&r<=f;f=-1/((h-a)/(u-s)),u=(h-a)/(u-s),u=(a-o-(u*s-f*r))/(f-u),r=o+f*(u-r);return i.x=u,i.y=r,!!this.Le(i,n,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)},Ve:function(t,n){return t.x*n.x+t.y*n.y},ze:function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},We:function(t,n){if(0==t.x&&0==t.y||0==n.x&&0==n.y)return 0;var e={x:t.x,y:t.y,z:0},i={x:n.x,y:n.y,z:0},e=this.Be(e,i),i=this.Ve(t,n),n=Math.acos(i/(this.ze(t)*this.ze(n)));return 0<e.z?n/Math.PI*180:360-n/Math.PI*180},Xe: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.Ne(t,n,o,s,i))return!0}return!1},Ze:function(t,n,e,i,r){var o=Math.min(t.x,e.x,i.x),s=Math.max(t.x,e.x,i.x),a=Math.min(t.y,e.y,i.y),u=Math.max(t.y,e.y,i.y),u=Math.sqrt((s-o)*(s-o)+(u-a)*(u-a)),a=n/180*Math.PI,n=u*Math.cos(a)+t.x,a=u*Math.sin(a)+t.y;return 1==this.Ne(t,{x:n,y:a},e,i,r)}});var du=new pi,Li={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                    "},vu=Li;function pu(t){return(pu="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 mu(t,n){return(mu=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function gu(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=yu(e);return t=i?(t=yu(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==pu(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function yu(t){return(yu=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var bu=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&mu(t,n)}(e,cr);var n=gu(e);function e(t){return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,e),(t=n.call(this,t)).uniforms.offset={value:new ci},t.uniforms.rotation={value:0},t.uniforms.scale={value:new ci(1,1)},t.depthTest=!1,t.vertexShader=vu.vert,t.fragmentShader=vu.frag,t}return e}();function _u(t,n){this.array=t,this.stride=n,this.count=void 0!==t?t.length/n:0,this.usage=ui,this.updateRange={offset:0,count:-1},this.version=0}Object.defineProperty(_u.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(_u.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 wu=new St;function xu(t,n,e,i){this.data=t,this.itemSize=n,this.offset=e,this.normalized=!0===i}function Mu(t){return(Mu="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 Su(t,n){return(Su=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Eu(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Tu(e);return t=i?(t=Tu(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Mu(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function Tu(t){return(Tu=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}Object.defineProperties(xu.prototype,{count:{get:function(){return this.data.count}},array:{get:function(){return this.data.array}}}),Object.assign(xu.prototype,{isInterleavedBufferAttribute:!0,applyMatrix4:function(t){for(var n=0,e=this.data.count;n<e;n++)wu.x=this.getX(n),wu.y=this.getY(n),wu.z=this.getZ(n),wu.applyMatrix4(t),this.setXYZ(n,wu.x,wu.y,wu.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 Lu=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Su(t,n)}(i,$r);var e=Eu(i);function i(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,i);var t=e.call(this),n=new _u(new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),5);return t.setIndex([0,1,2,0,2,3]),t.setAttribute("position",new xu(n,3,0,!1)),t.setAttribute("uv",new xu(n,2,3,!1)),t}return i}();function Ru(t,n,e,i,r,o,s,a,u){xr.call(this,t,n,e,i,r,o,s,a,u),this.needsUpdate=!0}function Ou(t,n,e,i,r,o){var s=(t+e)/2,a=(n+i)/2,u=((t-e)*(t-e)+(n-i)*(n-i))/4,h=Math.sqrt(u),c=h*(h/Math.sqrt(r*r-u)),f=Math.PI/2,l=(e-t)/(n-i),h=(t-e)/(n-i),r=Math.sqrt(1+l*l),u=Math.sqrt(1+h*h),r={x:s+c*(1/r),y:a+c*(l/r),theta:f},f={x:s+c*(-1/u),y:a+c*(h/u),theta:f};return 0<(e-t)*(r.y-n)-(i-n)*(r.x-t)?0===o?r:f:0===o?f:r}function Au(t,n,e,i){for(var r=0;r<t.length;r++)switch(t[r]){case"m":n.moveTo(i.x+parseFloat(t[r+1]),i.y+parseFloat(t[r+2])),e.x=i.x+parseFloat(t[r+1]),e.y=i.y+parseFloat(t[r+2]),i.x=e.x,i.y=e.y,r+=2;break;case"M":n.moveTo(parseFloat(t[r+1]),parseFloat(t[r+2])),e.x=parseFloat(t[r+1]),e.y=parseFloat(t[r+2]),i.x=e.x,i.y=e.y,r+=2;break;case"l":n.lineTo(e.x+parseFloat(t[r+1]),e.y+parseFloat(t[r+2])),e.x=e.x+parseFloat(t[r+1]),e.y=e.y+parseFloat(t[r+2]),r+=2;break;case"L":n.lineTo(parseFloat(t[r+1]),parseFloat(t[r+2])),e.x=parseFloat(t[r+1]),e.y=parseFloat(t[r+2]),r+=2;break;case"A":var o=parseFloat(t[r+1]),s=parseFloat(t[r+2]),a=(parseFloat(t[r+3]),Math.PI,parseFloat(t[r+4]),parseFloat(t[r+5])),u=e.x,h=e.y,c=parseFloat(t[r+6]),f=parseFloat(t[r+7]);o===s&&(l=Ou(u,h,c,f,o,a),n.arcTo(l.x,l.y,c,f,l.theta),e.x=c,e.y=f),r+=7;break;case"a":var l,o=parseFloat(t[r+1]),s=parseFloat(t[r+2]),a=(parseFloat(t[r+3]),Math.PI,parseFloat(t[r+4]),parseFloat(t[r+5])),u=e.x,h=e.y,c=u+parseFloat(t[r+6]),f=h+parseFloat(t[r+7]);o===s&&(l=Ou(u,h,c,f,o,a),n.arcTo(l.x,l.y,c,f,l.theta),e.x=c,e.y=f),r+=7;break;case"h":n.lineTo(e.x+parseFloat(t[r+1]),e.y),e.x=e.x+parseFloat(t[r+1]),r+=1;break;case"H":n.lineTo(parseFloat(t[r+1]),e.y),e.x=parseFloat(t[r+1]),r+=1;break;case"z":case"Z":n.lineTo(i.x,i.y)}}Ru.prototype=Object.create(xr.prototype);var Cu=["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"],ku=["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"],Pu=["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"],Du=["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"],ju=["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"],Iu=["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"],Nu=["M","82.95","15.07","H","81.57","L","82.35","0","h","10","a","1.94","1.94","0","0","1","1.85","2","L","93.89","7.4","a","2","2","0","0","1","-2","1.92","H","83.25","Z","m","8.43","-7.15","a","1.13","1.13","0","0","0","1.09","-1.09","l","0.35","-4.37","a","1.1","1.1","0","0","0","-1.08","-1.06","H","83.66","l","-0.34","6.53","Z"];var Fu={Ye:(Ru.prototype.constructor=Ru).prototype.isCanvasTexture=!0};function Uu(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var Bu=function(t){var n=function(){var t=document.createElement("canvas"),n=t.getContext("2d");t.width=500,t.height=120,t.style.width="500px",t.style.height="120px";var e={x:0,y:0},i={x:0,y:0};n.transform(5,0,0,5,10,10);var r=n.createLinearGradient(5.9,15.07,5.9,0);return r.addColorStop(0,"#232323"),r.addColorStop(1,"#585858"),n.fillStyle=r,n.beginPath(),Au(Cu,n,i,e),n.closePath(),n.fill(),n.beginPath(),Au(ku,n,i,e),n.closePath(),n.fill(),n.beginPath(),Au(Pu,n,i,e),n.closePath(),n.fill(),n.beginPath(),Au(Du,n,i,e),n.closePath(),n.fill(),(r=n.createLinearGradient(57.68,15.07,57.68,0)).addColorStop(0,"#77bf00"),r.addColorStop(1,"#addc0c"),n.fillStyle=r,n.beginPath(),Au(ju,n,i,e),n.closePath(),n.fill(),n.beginPath(),Au(Iu,n,i,e),n.closePath(),n.fill(),n.beginPath(),Au(Nu,n,i,e),n.closePath(),n.fill(),new Ru(t)}(),e=new ci(.4,.096),i=new bu,r=-1*(.5*e.x/t-1),t=-1*(1-.5*e.y);return n.minFilter=On,n.generateMipmaps=!1,i.transparent=!0,i.depthTest=!1,i.uniforms={scale:{value:e},offset:{value:new ci(r,t)},mmap:{value:n}},i.needsUpdate=!0,new Uo(new Lu,i)},Oi=function(){function r(t,n,e){var i=this;!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),this.V=t,this.jt=n,this.wt=e,this.K=t,this.parent=t,this.renderer=this.qe(n.container,n.logarithmicDepthBuffer),this.Cn=new Map,this.Ke=new Map,this.Je=new Map,this.Je.set(Di.EXTENT_LAYER,Di.EXTENT),this.Je.set(Di.EXTERNAL_MODEL_LAYER,Di.EXTERNAL_MODEL),this.Je.set(Di.MODEL_LAYER,Di.MODEL),this.Je.set(Di.FACILITY_LAYER,Di.FACILITY),this.Je.set(Di.LABEL_LAYER,Di.LABEL),this.Qe=JSON.parse(JSON.stringify(n.renderOrder)),this.Ke.set("firstTimeRender",function(){return i.$e()}),this.ti=0,this.ni=!1,this.ei=null,this.ii=Fu.Ye,this.ii&&(this.ei=Bu(this.renderer.domElement.clientWidth/this.renderer.domElement.clientHeight),this.ei.frustumCulled=!1,this.xx45f6=this.ei),this.ri=!1,this.U=this.renderer.domElement.clientWidth,this.oi=this.renderer.domElement.clientHeight,this.type="basic",this.et=!0,this.si=void 0,this.ai()}var t,n,e;return t=r,(n=[{key:"setTileLayScene",value:function(t){this.si=t}},{key:"needLogo",get:function(){return this.ii}},{key:"render",value:function(){var n=this;this.renderer&&(this.renderer.clear(),this.si&&this.renderer.render(this.si,this.K.kt),this.Cn.forEach(function(t){return n.renderer.render(t,n.K.kt)}),this.K.ui&&this.renderer.render(this.K.ui.ci,this.K.kt),this.ii&&this.ei&&this.renderer.render(this.ei,this.K.kt))}},{key:"resize",value:function(){this.renderer&&(5<Math.abs(this.renderer.domElement.parentElement.clientHeight-this.oi)||5<Math.abs(this.renderer.domElement.parentElement.clientWidth-this.U))&&(this.fi(this.renderer.domElement.parentElement.clientWidth,this.renderer.domElement.parentElement.clientHeight),this.U=this.renderer.domElement.clientWidth,this.oi=this.renderer.domElement.clientHeight,this.K.Dt.Pt({type:"resize"}))}},{key:"getRenderList",value:function(){return this.Cn}}])&&Uu(t.prototype,n),e&&Uu(t,e),r}();Object.assign(Oi.prototype,{ct:function(){for(var t in this.V=null,this.jt=null,this.wt=null,this.et=!1,this.Cn.clear(),this.Ke.clear(),this)this[""+t]=null,delete this[""+t]},qe:function(t,n){n=new Ba({antialias:!0,alpha:!0,logarithmicDepthBuffer:n});return n.setPixelRatio(window.devicePixelRatio),n.setSize(t.clientWidth,t.clientHeight),n.autoClear=!1,n.domElement.style.position="absolute",n.domElement.style.top=0,n.domElement.style.zIndex=0,t.appendChild(n.domElement),n},li:function(t){this.renderer=t},di:function(t){t="3D"===t?this.K.un:this.K.in;return t.updateMatrixWorld(!0),(new Tt).setFromProjectionMatrix((new Et).multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse))},vi:function(t){t!==this.K.pi&&(t===Ga.FOCUS?(this.K.pi=t,this.mi(),this.En()):t===Ga.VISIBLE&&(this.K.pi=t,this.En()))},gi:function(t){for(var n=[],e=[],i=0;i<t.length;i++){var r=this.Qe.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.Qe[n[o]]=e[o];this.$e()},yi:function(t){this.Qe=t,this.$e()},$e:function(){var r=this,t=Array.from(this.Cn);t.sort(function(t,n){var e=t[0].split("_"),i=n[0].split("_"),t=r.Qe.indexOf(parseInt(e[1])),n=r.Qe.indexOf(parseInt(i[1])),e=e[0],i=i[0];return e===i?t-n:e-i}),this.Cn=new Map(t),this.V.enableUpdateRender()},bi:function(t){var n=this.K.Zt._i(t.mapNode.wi);isNaN(n)&&(n=1),t.scale.set(n,n,n),t.scale.multiplyScalar(t.material.userData.mspriteScale),t.scale.setX(t.scale.x/t.material.userData.scaleRatio)},xi:function(t,n){var e=1,i=this.renderer.domElement.clientHeight,i=this.K.kt.isPerspectiveCamera?n?n/(i/(2*Math.tan(this.K.un.fov*vi.DEG2RAD/2))):t.mapNode.wi/(i/(2*Math.tan(this.K.un.fov*vi.DEG2RAD/2))):n?n*Math.abs(this.K.kt.top-this.K.kt.bottom)/this.K.kt.zoom/i:t.mapNode.wi*Math.abs(this.K.kt.top-this.K.kt.bottom)/this.K.kt.zoom/i;t.material.userData.scaleRatio&&(e=t.material.userData.scaleRatio),t.scale.set(i,i/e,i)},sn:function(){var r=this;this.Cn.forEach(function(t){switch(t.userData.type){case"label":for(var n=0;n<t.children.length;n++)r.bi(t.children[n]);break;case"facility":for(var e=0;e<t.children.length;e++)r.xi(t.children[e]);break;default:for(var i=0;i<t.children.length;i++)!t.children[i].mapNode||t.children[i].mapNode.type!==Di.IMAGE_MARKER&&t.children[i].mapNode.type!==Di.LOCATION_MARKER||t.children[i].mapNode.Mi()}})},fi:function(t,n){var e=this.K.un,i=this.K.in,r=new ci(.4,.096),o=-1*(.5*r.x/(t/n)-1),s=-1*(1-.5*r.y);e.aspect=t/n,e.updateProjectionMatrix(),i.left=-t/2,i.right=t/2,i.top=n/2,i.bottom=-n/2,i.updateProjectionMatrix(),this.ei&&(this.ei.material.uniforms.scale={value:r},this.ei.material.uniforms.offset={value:new ci(o,s)}),this.renderer.setSize(t,n),this.sn(),this.V.enableUpdateRender()},Si:function(t,n){t.updateMatrixWorld(!0);var e=this.V.kt,i=(new St).setFromMatrixPosition(t.matrixWorld).applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix),e=t.mapNode.wi;return t=n?(e*=t.mapNode.text.split("%rn%").length)/t.material.userData.scaleRatio:e,e=e/this.renderer.domElement.clientHeight*2,t=t/this.renderer.domElement.clientWidth*2,{leftTop:new ci(i.x-t/2,i.y+e/2),rightDown:new ci(i.x+t/2,i.y-e/2)}},Ei:function(t,n,e,i,r){for(var o=0;o<n.length;o++)if(n[o].mapNode.Ti&&!n[o].mapNode.Li)if(n[o].mapNode.te&&(n[o].mapNode.te.maxlevel<=i||n[o].mapNode.te.minlevel>i))n[o].visible=!1;else if(!1!==r)if(!1!==n[o].mapNode.Ri){var s=this.Si(n[o],e);n[o].userData.bounds=s;for(var a=!0,u=0;u<t.length;u++){var h=t[u].userData.bounds;if(!(a=!du.Me(s.leftTop,s.rightDown,h.leftTop,h.rightDown)))break}a?(n[o].visible=!0,t.push(n[o])):n[o].visible=!1}else n[o].visible=!0;else n[o].visible=!0;else n[o].visible=!1},Oi:function(){if(this.ri){for(var t=this.K.wt.Mn,n=[],e=this.K.getZoom(),i=this.wt.Ai,r=0;r<t.length;r++){var o=this.V.getFloor(t[r]),s=o.getLayers(Di.LABEL_LAYER),a=void 0;0<s.length&&(a=s[0].scene);var u=o.getLayers(Di.FACILITY_LAYER),s=void 0;0<u.length&&(s=u[0].scene),n.length=0,a&&this.Ei(n,a.children,!0,e,a.mapNode.Ri),s&&this.Ei(n,s.children,!1,e,s.mapNode.Ri);for(var h=0;h<i.length;h++)for(var c=i[h],f=n.length=0;f<c.length;f++){var l=c[f],d=o.getLayers(l),v=void 0,p=void 0,l=!1;0<d.length&&(p=(v=d[0]).scene,l=!0===v.isHasText),p&&void 0!==v.collision&&this.Ei(n,p.children,l,e,v.collision)}}this.ri=!1,this.V.enableUpdateRender()}},Ln:function(i){this.Cn.forEach(function(t){for(var n=0;n<t.children.length;n++){var e=t.children[n];("Mesh"===e.type||"Scene"===e.type||"Sprite"===e.type)&&e.mapNode.Ti&&e.mapNode.te&&e.mapNode.te.maxlevel&&(i<e.mapNode.te.maxlevel&&i>=e.mapNode.te.minlevel||!e.mapNode.te.maxlevel?e.visible=!0:e.visible=!1)}}),this.ri=!0},Ci:function(n){for(var e=this,t=0;t<this.K.Mt.length;t++){var i=this.K.Mt[t].getFloor(n);if(i){Array.from(this.Cn.keys()).filter(function(t){if(+t.split("_")[0]===n)return t}).forEach(function(t){return e.Cn.delete(t)});for(var r=0;r<i.Mt.length;r++){var o=this.Je.get(i.Mt[r].Yn),o=n+"_"+(o||i.Mt[r].Yn);this.Cn.set(o,i.Mt[r].ci)}}}},dn:function(t,n){for(var e=this.K.wt.Mn,i=0;i<e.length;i++)if(e[i]===parseInt(t.split("_")[0])){this.Cn.set(t,n);break}},cn:function(t){this.Cn.delete(t)},mi:function(){this.Cn.clear()},En:function(){if(this.K.pi===Ga.FOCUS)this.mi(),this.Ci(this.K.Lt);else for(var t=this.K.wt.Mn,n=0;n<t.length;n++)this.Ci(t[n]);this.ri=!0},ot:function(){var t;this.Cn&&0<this.Cn.size&&!this.ni&&(this.K.Dt.Pt({type:"firstRender"}),this.ni=!0),this.Ke&&(this.Ke.forEach(function(t){return t()}),this.Ke.has("firstTimeRender")&&this.V.wt.ki&&this.Cn.size===this.V.wt.ki&&(t=(new Date).getTime(),0===this.ti&&(this.ti=t),t-this.ti>vi.DRAW_TIME&&this.Ke.delete("firstTimeRenderComplete"),t=null))},ai:function(){var t;this.V&&(this.et&&requestAnimationFrame(this.ai.bind(this)),this.V.Dt.Pt({type:"beforeRender"}),this.resize(),t={type:"update",renderType:this.wt.Pi?0:1},this.wt.Pi&&(this.render(),this.ot(),this.wt.Pi=!1),this.V.Dt.Pt(t))}});var Gu=Oi,Hu=e(1),Vu={NAME_KEY_ERROR:0,MAP_ID_URL_ERROR:2,THEME_ID_URL_ERROR:4,LICENSE_ERROR:8,PATH_ERROR:404};function zu(t){return(zu="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 Wu(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 Xu(i){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Wu(Object(r),!0).forEach(function(t){var n,e;n=i,t=r[e=t],e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(r)):Wu(Object(r)).forEach(function(t){Object.defineProperty(i,t,Object.getOwnPropertyDescriptor(r,t))})}return i}Fi=function t(n){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),this.Di=Xu({data:null,method:"GET",responseType:"json"},n)};Object.assign(Fi.prototype,{ji:function(t,n,e){var i=this.Di,r=i.data,o=i.method,s=i.url,a=i.responseType,u=i.header,h=null;if((h=new("undefined"!=typeof XMLHttpRequest?XMLHttpRequest:Hu.a.global().fengmap.XMLHttpRequest)).responseType=a,h.open(o,s),"object"==zu(u))for(var c in u)h.setRequestHeader(c,u[c]);h.addEventListener("load",function(){200===h.status||0===h.status||201===h.status?t&&t(h.response):n&&(404===h.status?n(Vu.PATH_ERROR):2069===h.response.error_code?n(Vu.NAME_KEY_ERROR):2063===h.response.error_code?n(Vu.MAP_ID_URL_ERROR):400===h.response.error_code?n(Vu.THEME_ID_URL_ERROR):n(h.response))}),h.addEventListener("timeout",function(t){e&&e(t)}),h.addEventListener("error",function(t){n&&n(t)}),h.send(JSON.stringify(r))}});var Zu=Fi,Ji=e(27),Yu=e.n(Ji);var qu=function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t);var n,r=["UkFTVEVSQVRB","bmF2aU5vZGVz","bG5hbWU=","R0VPTElORV9OQQ==","R0VPTElORV9CTw==","b2Zmc2V0WA==","ZGF0ZVZlcg==","Rmxvb3JHZW8=","c2NhbGU=","T1ZFUkxBWURBVA==","ZGVmQ2VuWg==","ZmxhZw==","b3B0aW9ucw==","cG9seWdvbkxheQ==","SW5mbw==","Z2Vv","ZG9vcnR5cGU=","bGlmdEZsYWc=","YXllcg==","ZmllbGRz","cmFuaw==","dWludDY0","d2lkdGg=","dmVs","aXNTZWxlY3RhYg==","bGlmdEVudHJ5","TmF2aU1vZGVs","R0VPUE9JTlRfUw==","bm9kZUlk","bWlk","SW5kZXhJbmZv","ZGVmR2lk","TmF2aVNlZ21lbg==","ZmxvYXQ=","RXh0ZW50Qml6SQ==","bWluWA==","R0VPUE9JTlRfRQ==","bmV4dEZsb29ycw==","bW9kZWxMYXllcg==","QVZJTk9ERQ==","c3RyaW5n","YWNjZXNzaWJsZQ==","R0VPUE9JTlRfTQ==","ZmlsZURhdGU=","Zmxvb3JJZA==","X0VYVEVOVA==","Ym9vbA==","ZmlsZVZlcg==","bGlmdExheWVy","amF2YV9wYWNrYQ==","TW9kZWxCaXpJbg==","TmF2aU5vZGU=","bmF2aU1vZGVscw==","R0VPTElORQ==","bmF2aVR5cGU=","LnByb3RvYnVm","ZG91Ymxl","a2V5","ZWxCaXpJbmZv","cmVhZE9ubHk=","R0VPUE9MWUdPTg==","aXNWaXNpYmxl","cGFja2Vk","ZW50cmFuY2VUeQ==","ZW5hbWU=","ZXh0ZW50TGF5ZQ==","T0RFTA==","TmF2aVpvbmU=","bmFtZQ==","TGFiZWxCaXpJbg==","R0VPUE9JTlRfUA==","bW9kZWxpZA==","Rmxvb3JDb25maQ==","aW50MzI=","c25vZGU=","cmVxdWlyZWQ=","cG9seWdvbkxhYg==","YXJlYQ==","bm9kZXR5cGVz","cHRz","bWF4bGV2ZWw=","YnR5cGU=","aWR4cw==","c3RhaXJMYXllcg==","YWxpYXM=","bmF2aVNlZ21lbg==","TGF5ZXJHcm91cA==","aGFzaENvZGU=","bmZv","RXh0ZXJuYWxNbw==","bmVzdGVk","ZXh0ZXJuYWxNbw==","ZW5vZGU=","amF2YV9vdXRlcg==","cnVsZQ==","TWFw","cm90YXRlQW5nbA==","bGlk","bmF2aVpvbmVz","bGFiZWxMYXllcg==","bGVu","QnVmZmVy","bGF5ZXJz","VEFJUg==","ZGF0YQ==","ZGVmYXVsdA==","TGF5ZXI=","c2VnbWVudElk","aGVpZ2h0","ZW50cnk=","b2Zmc2V0WQ==","Zmlk","a2V5cw==","VHlwZQ==","dHlwZQ==","VklTRUdNRU5U","UG9seWdvbkJpeg==","U0NBTEFUT1I=","bWF4WA==","ZGVsQml6SW5mbw==","ZWlk","Z2lk","b29y","bGlmdEZsb29y","bWlubGV2ZWw=","cmVwZWF0ZWQ=","ZGVmQ2VuWA==","bGVuZ3Ro","X0xBQkVM","Zmxvb3I=","cGFzcw==","UG9seWdvbkxhYg==","cG9pTGF5ZXI=","Rmxvb3JCaXo=","ZGVsTGF5ZXI=","R0VPUE9JTlRfTg==","Z25hbWU=","bGlmdFR5cGU=","R2VuZXJhbEdlbw==","ZGVzYw==","ZWxMYXllcg==","bWF4WQ==","cC5wbGF0Zm9ybQ==","cmVqZWN0cw=="];n=r,function(t){for(;--t;)n.push(n.shift())}(250);function o(t,n){var e=r[t=+t];void 0===o.TvxZJP&&(function(){try{var n=Function('return (function() {}.constructor("return this")( ));')()}catch(t){n=window}n.atob||(n.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})}(),o.twXBiB=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)},o.TavDox={},o.TvxZJP=!0);var i=o.TavDox[t];return void 0===i?(e=o.twXBiB(e),o.TavDox[t]=e):e=i,e}var e={};e[o("0x58")+"ge"]="com.fengma"+o("0x25")+o("0x5e"),e[o("0x84")+"_classname"]=o("0x6f")+"gProtoBuf";var i={};i[o("0x85")]="required",i[o("0x9")]=o("0x4f"),i.id=1;var s={};s[o("0x85")]=o("0x72"),s.type=o("0x70"),s.id=2;var a={};a[o("0x85")]=o("0x72"),a.type="uint64",a.id=3;var u={};u[o("0x85")]="required",u[o("0x9")]=o("0x4f"),u.id=4;var h={};h[o("0x85")]="required",h[o("0x9")]="string",h.id=5;var c={};c[o("0x9")]=o("0x4f"),c.id=6;var f={};f[o("0x9")]="string",f.id=7;var l={};l[o("0x9")]="string",l.id=8;var d={};d[o("0x0")]=!1;var v={};v[o("0x9")]=o("0x55"),v.id=9,v[o("0x33")]=d;var p={};p[o("0x85")]=o("0x14"),p[o("0x9")]=o("0x8c"),p.id=10;var m={};m[o("0x85")]="repeated",m[o("0x9")]=o("0x4f"),m.id=11;var g={};g.mid=i,g[o("0x56")]=s,g[o("0x2d")]=a,g.mname=u,g[o("0x7e")]=h,g[o("0x60")]=c,g[o("0x52")]=f,g[o("0x22")]=l,g[o("0x62")]=v,g.buffers=p,g[o("0x7")]=m;var y={};y.rule=o("0x72"),y[o("0x9")]="int32",y.id=1;var b={};b[o("0x85")]=o("0x72"),b[o("0x9")]=o("0x70"),b.id=2;var _={};_[o("0x85")]=o("0x72"),_.type=o("0x70"),_.id=3;var w={};w[o("0x85")]=o("0x72"),w[o("0x9")]=o("0x3c"),w.id=4;var x={};x[o("0x85")]=o("0x72"),x.type="bytes",x.id=5;var M={};M[o("0x10")]=y,M[o("0x56")]=b,M[o("0x78")]=_,M[o("0x8b")]=w,M[o("0x8f")]=x;var S={};S[o("0x3a")]=M;var E={};E.Buffer=S;var T={};T[o("0x3a")]=g,T[o("0x81")]=E;var L={};L[o("0x85")]=o("0x72"),L[o("0x9")]="string",L.id=19;var R={rule:"required"};R[o("0x9")]=o("0x70"),R.id=20;var O={};O[o("0x85")]=o("0x72"),O[o("0x9")]="uint64",O.id=21;var A={};A[o("0x85")]=o("0x72"),A[o("0x9")]=o("0x4f"),A.id=22;var C={};C[o("0x85")]="required",C[o("0x9")]=o("0x4f"),C.id=23;var k={};k[o("0x9")]=o("0x4f"),k.id=24;d={};d[o("0x9")]="string",d.id=25;i={};i[o("0x0")]=!1;s={};s[o("0x9")]="bool",s.id=26,s.options=i;a={};a[o("0x9")]=o("0x48"),a.id=1;u={};u[o("0x9")]=o("0x48"),u.id=2;h={};h[o("0x9")]=o("0x48"),h.id=3;c={};c[o("0x9")]="float",c.id=4;f={};f[o("0x9")]=o("0x48"),f.id=5;l={};l[o("0x9")]=o("0x48"),l.id=6;v={};v[o("0x9")]="float",v.id=7;p={type:"string",id:8},m={};m[o("0x9")]=o("0x48"),m.id=9;y={};y[o("0x9")]=o("0x48"),y.id=10;b={};b[o("0x9")]="float",b.id=11;_={};_[o("0x9")]=o("0x48"),_.id=12;w={};w[o("0x9")]="float",w.id=13;x={};x[o("0x9")]="float",x.id=14;M={};M[o("0x9")]="float",M.id=15;S={type:"float",id:16},g={};g[o("0x9")]=o("0x4f"),g.id=17;E={};E.rule=o("0x14"),E.type=o("0x7d"),E.id=18;i={};i[o("0x44")]=L,i[o("0x56")]=R,i[o("0x2d")]=O,i.mname=A,i[o("0x7e")]=C,i[o("0x60")]=k,i.desc=d,i[o("0x62")]=s,i.x=a,i.y=u,i.z=h,i[o("0x4a")]=c,i.minY=f,i[o("0xd")]=l,i[o("0x24")]=v,i[o("0x46")]=p,i[o("0x15")]=m,i.defCenY=y,i[o("0x31")]=b,i[o("0x3")]=_,i[o("0x87")+"eX"]=w,i[o("0x87")+"eY"]=x,i[o("0x87")+"eZ"]=M,i[o("0x2f")]=S,i.scaleLevel=g,i.layerGroups=E;a={};a[o("0x9")]="int32",a.id=1;u={};u[o("0x9")]=o("0x4f"),u.id=2;h={};h[o("0x9")]=o("0x4f"),h.id=3;c={};c[o("0x9")]=o("0x8"),c.id=4;f={};f[o("0x9")]="float",f.id=5;l={};l[o("0x9")]=o("0x48"),l.id=6;v={};v[o("0x9")]="float",v.id=7;p={};p[o("0x9")]="float",p.id=8;m={};m[o("0x9")]=o("0x48"),m.id=9;y={};y.type=o("0x48"),y.id=10;b={};b[o("0x9")]=o("0x48"),b.id=11;_={};_[o("0x9")]="float",_.id=12;w={};w[o("0x9")]=o("0x55"),w.id=13;x={};x[o("0x9")]="bool",x.id=14;M={};M[o("0x9")]=o("0x55"),M.id=15;S={};S[o("0x9")]=o("0x4f"),S.id=16;g={};g[o("0x88")]=a,g[o("0x29")]=u,g.alias=h,g.ltype=c,g[o("0x2c")]=f,g[o("0x5")]=l,g[o("0x3")]=v,g.rotateAngleX=p,g.rotateAngleY=m,g[o("0x87")+"eZ"]=y,g.minScaleLevel=b,g["maxScaleLe"+o("0x3e")]=_,g[o("0x64")]=w,g[o("0x3f")+"le"]=x,g.isEditable=M,g[o("0x22")]=S;E={GEOPOINT:1};E[o("0x4b")+o("0xc")]=2,E.GEOPOINT_LIFT=3,E["GEOPOINT_S"+o("0x8e")]=4,E[o("0x6d")+"ANORAMA"]=5,E.GEOPOINT_POI=6,E[o("0x42")+"TORELABEL"]=7,E[o("0x1e")+o("0x4e")]=8,E[o("0x51")+o("0x69")]=9,E[o("0x5c")]=20,E[o("0x2a")+o("0xa")]=21,E[o("0x2b")+"RDER"]=22,E[o("0x63")]=30,E["GEOPOLYGON"+o("0x54")]=31,E[o("0x63")+"_STORE"]=32,E[o("0x63")+o("0x17")]=33,E[o("0x27")]=40,E[o("0x30")+"A"]=50;a={};a.values=E;u={};u[o("0x8")]=a;h={};h.fields=g,h.nested=u;c={};c.type=o("0x70"),c.id=1;f={type:"string",id:2},l={};l.type=o("0x4f"),l.id=3;v={};v[o("0x9")]="float",v.id=4;p={};p[o("0x9")]=o("0x4f"),p.id=5;m={};m[o("0x85")]=o("0x14"),m[o("0x9")]=o("0x1"),m.id=6;y={};y.type=o("0x4f"),y.id=7;b={};b[o("0x9")]="int32",b.id=8;_={};_[o("0x10")]=c,_[o("0x1f")]=f,_[o("0x7b")]=l,_[o("0x3")]=v,_[o("0x22")]=p,_[o("0x8d")]=m,_[o("0x53")]=y,_[o("0x5d")]=b;w={};w[o("0x3a")]=_;x={};x[o("0x1")]=h,x[o("0x7d")]=w;M={};M[o("0x3a")]=i,M[o("0x81")]=x;S={};S[o("0x85")]=o("0x72"),S.type=o("0x4f"),S.id=1;E={};E[o("0x85")]=o("0x72"),E.type=o("0x70"),E.id=2;a={};a[o("0x9")]=o("0x48"),a.id=3;g={};g[o("0x85")]=o("0x14"),g[o("0x9")]=o("0x21")+o("0x35"),g.id=4;u={};u.rule=o("0x14"),u.type=o("0x21")+o("0x35"),u.id=5;c={};c[o("0x85")]=o("0x14"),c[o("0x9")]=o("0x21")+o("0x35"),c.id=6;f={};f[o("0x85")]=o("0x14"),f[o("0x9")]=o("0x21")+o("0x35"),f.id=7;l={};l[o("0x85")]=o("0x14"),l[o("0x9")]=o("0x21")+o("0x35"),l.id=8;v={};v.rule=o("0x14"),v[o("0x9")]=o("0x21")+o("0x35"),v.id=9;p={};p.rule=o("0x14"),p[o("0x9")]=o("0x21")+"Info",p.id=10;m={};m.rule=o("0x14"),m.type=o("0x21")+o("0x35"),m.id=11;y={};y[o("0x85")]=o("0x14"),y[o("0x9")]=o("0x21")+o("0x35"),y.id=12;b={rule:"repeated"};b[o("0x9")]=o("0x21")+o("0x35"),b.id=13;_={};_[o("0x44")]=S,_.gid=E,_.height=a,_[o("0x68")+"r"]=g,_[o("0x4d")]=u,_.labelLayer=c,_[o("0x1b")]=f,_.polygonLayer=l,_[o("0x73")+o("0x23")]=v,_[o("0x57")]=p,_[o("0x7a")]=m,_["escalatorL"+o("0x39")]=y,_[o("0x82")+o("0x1d")]=b;h={};h[o("0x85")]=o("0x72"),h[o("0x9")]=o("0x70"),h.id=1;w={};w[o("0x9")]=o("0x4f"),w.id=2;i={};i[o("0x9")]="float",i.id=3;x={};x[o("0x9")]="float",x.id=4;S={};S[o("0x85")]=o("0x14"),S.type=o("0x45"),S.id=5;E={};E[o("0x65")]=!1;a={};a[o("0x85")]=o("0x14"),a[o("0x9")]=o("0x5f"),a.id=6,a[o("0x33")]=E;g={};g[o("0xf")]=h,g.geo=w,g[o("0x3")]=i,g[o("0x74")]=x,g[o("0x79")]=S,g[o("0x76")]=a;u={};u[o("0x65")]=!1;c={};c[o("0x85")]=o("0x14"),c[o("0x9")]=o("0x70"),c.id=1,c.options=u;f={};f.idxs=c;l={};l.fields=f;v={};v[o("0x45")]=l;p={};p[o("0x3a")]=g,p[o("0x81")]=v;m={};m[o("0x21")+o("0x35")]=p;y={};y[o("0x3a")]=_,y[o("0x81")]=m;b={};b.rule=o("0x72"),b.type=o("0x4f"),b.id=1;E={};E.rule=o("0x72"),E[o("0x9")]=o("0x70"),E.id=2;h={};h.rule=o("0x14"),h[o("0x9")]=o("0x49")+o("0x7f"),h.id=3;w={};w.rule=o("0x14"),w.type=o("0x59")+"fo",w.id=4;i={};i.rule=o("0x14"),i.type="LabelBizInfo",i.id=5;x={};x[o("0x85")]=o("0x14"),x[o("0x9")]="POIBizInfo",x.id=6;S={};S[o("0x85")]=o("0x14"),S[o("0x9")]=o("0xb")+o("0x35"),S.id=7;a={};a.rule=o("0x14"),a.type="LiftBizInfo",a.id=8;u={};u.rule=o("0x14"),u[o("0x9")]="StairBizInfo",u.id=9;c={};c[o("0x85")]=o("0x14"),c[o("0x9")]=o("0x1a")+o("0x61"),c.id=10;f={};f[o("0x85")]="repeated",f[o("0x9")]="ExternalMo"+o("0xe"),f.id=11;l={};l[o("0x44")]=b,l.gid=E,l.extentLayer=h,l.modelLayer=w,l[o("0x8a")]=i,l.poiLayer=x,l[o("0x34")+"er"]=S,l[o("0x57")]=a,l[o("0x7a")]=u,l["polygonLab"+o("0x23")]=c,l[o("0x82")+"delLayer"]=f;g={};g[o("0x85")]=o("0x72"),g[o("0x9")]=o("0x70"),g.id=1;v={};v[o("0x9")]=o("0x4f"),v.id=2;p={};p[o("0x9")]=o("0x70"),p.id=3;_={};_.type=o("0x4f"),_.id=4;m={};m[o("0x9")]=o("0x4f"),m.id=5;b={};b.type=o("0x70"),b.id=6;E={};E.type=o("0x70"),E.id=7;h={};h.eid=g,h[o("0x6")]=v,h.type=p,h[o("0x6b")]=_,h[o("0x67")]=m,h.minlevel=b,h[o("0x77")]=E;w={};w[o("0x3a")]=h;i={};i.rule=o("0x72"),i[o("0x9")]="int32",i.id=1;x={};x.type=o("0x4f"),x.id=2;S={};S[o("0x9")]=o("0x70"),S.id=3;a={};a[o("0x9")]=o("0x4f"),a.id=4;u={};u.type=o("0x4f"),u.id=5;c={};c[o("0x9")]=o("0x70"),c.id=6;f={};f[o("0x9")]="int32",f.id=7;g={};g.type=o("0x70"),g.id=8;v={};v[o("0xf")]=i,v[o("0x6")]=x,v[o("0x9")]=S,v[o("0x6b")]=a,v[o("0x67")]=u,v.minlevel=c,v[o("0x77")]=f,v[o("0x19")]=g;p={};p[o("0x3a")]=v;_={};_[o("0x85")]=o("0x72"),_[o("0x9")]=o("0x70"),_.id=1;m={};m[o("0x9")]="string",m.id=2;b={};b.type=o("0x70"),b.id=3;E={};E[o("0x9")]=o("0x4f"),E.id=4;h={type:"string",id:5},i={};i[o("0x9")]=o("0x70"),i.id=6;x={type:"int32",id:7},S={};S.eid=_,S[o("0x6")]=m,S[o("0x9")]=b,S[o("0x6b")]=E,S[o("0x67")]=h,S.minlevel=i,S[o("0x77")]=x;a={};a[o("0x3a")]=S;u={};u[o("0x85")]="required",u[o("0x9")]="int32",u.id=1;c={};c[o("0x9")]=o("0x4f"),c.id=2;f={};f[o("0x9")]="int32",f.id=3;g={type:"string",id:4},v={};v[o("0x9")]=o("0x4f"),v.id=5;_={};_[o("0x9")]="int32",_.id=6;m={};m.type=o("0x70"),m.id=7;b={};b[o("0xf")]=u,b[o("0x6")]=c,b[o("0x9")]=f,b[o("0x6b")]=g,b[o("0x67")]=v,b[o("0x13")]=_,b.maxlevel=m;E={};E.fields=b;h={};h[o("0x85")]=o("0x72"),h.type=o("0x70"),h.id=1;i={};i[o("0x9")]=o("0x4f"),i.id=2;x={};x[o("0x9")]=o("0x70"),x.id=3;S={};S[o("0x9")]=o("0x4f"),S.id=4;u={};u[o("0x9")]=o("0x4f"),u.id=5;c={};c.type=o("0x70"),c.id=6;f={};f[o("0x9")]=o("0x70"),f.id=7;g={};g[o("0xf")]=h,g[o("0x6")]=i,g[o("0x9")]=x,g[o("0x6b")]=S,g[o("0x67")]=u,g[o("0x13")]=c,g[o("0x77")]=f;v={};v[o("0x3a")]=g;_={};_[o("0x85")]=o("0x72"),_[o("0x9")]=o("0x70"),_.id=1;m={};m[o("0x9")]=o("0x4f"),m.id=2;b={};b.type=o("0x70"),b.id=3;h={};h[o("0x9")]="int32",h.id=4;i={};i[o("0x9")]=o("0x4f"),i.id=5;x={};x[o("0x9")]=o("0x70"),x.id=6;S={};S[o("0x9")]=o("0x70"),S.id=7;u={};u.eid=_,u[o("0x6")]=m,u[o("0x9")]=b,u[o("0x32")]=h,u[o("0x18")]=i,u[o("0x13")]=x,u[o("0x77")]=S;c={};c.fields=u;f={};f[o("0x85")]=o("0x72"),f[o("0x9")]=o("0x70"),f.id=1;g={};g.type=o("0x4f"),g.id=2;_={type:"int32",id:3},m={};m[o("0x9")]=o("0x70"),m.id=4;b={type:"int32",id:5},h={};h[o("0x9")]=o("0x70"),h.id=6;i={};i.eid=f,i[o("0x6")]=g,i.type=_,i[o("0x32")]=m,i[o("0x13")]=b,i[o("0x77")]=h;x={};x[o("0x3a")]=i;S={};S.rule=o("0x72"),S[o("0x9")]="int32",S.id=1;u={};u[o("0x9")]=o("0x4f"),u.id=2;f={};f[o("0x9")]=o("0x70"),f.id=3;g={};g[o("0x9")]="float",g.id=4;_={};_.type=o("0x4f"),_.id=5;m={};m[o("0x9")]=o("0x4f"),m.id=6;b={};b[o("0x9")]=o("0x48"),b.id=7;h={};h.eid=S,h[o("0x6")]=u,h[o("0x9")]=f,h[o("0x3d")]=g,h[o("0x6b")]=_,h[o("0x67")]=m,h.angle=b;i={};i[o("0x3a")]=h;S={};S[o("0x85")]=o("0x72"),S[o("0x9")]=o("0x70"),S.id=1;u={};u[o("0x9")]=o("0x4f"),u.id=2;f={};f.type=o("0x70"),f.id=3;g={type:"string",id:4},_={};_.type=o("0x4f"),_.id=5;m={};m[o("0x9")]=o("0x70"),m.id=6;b={};b[o("0x9")]=o("0x70"),b.id=7;h={};h.eid=S,h[o("0x6")]=u,h[o("0x9")]=f,h[o("0x6b")]=g,h[o("0x67")]=_,h[o("0x13")]=m,h[o("0x77")]=b;S={};S[o("0x3a")]=h;u={};u[o("0x49")+o("0x7f")]=w,u.ModelBizInfo=p,u[o("0x6c")+"fo"]=a,u[o("0xb")+o("0x35")]=E,u.POIBizInfo=v,u.LiftBizInfo=c,u.StairBizInfo=x,u[o("0x1a")+"elBizInfo"]=i,u[o("0x80")+o("0xe")]=S;f={};f.fields=l,f[o("0x81")]=u;g={};g[o("0x85")]=o("0x72"),g[o("0x9")]=o("0x4f"),g.id=1;_={};_[o("0x85")]=o("0x72"),_[o("0x9")]=o("0x70"),_.id=2;m={};m[o("0x85")]=o("0x14"),m[o("0x9")]="NaviNode",m.id=3;b={rule:"repeated"};b.type=o("0x47")+"t",b.id=4;h={};h[o("0x85")]="repeated",h.type=o("0x6a"),h.id=5;w={};w[o("0x85")]=o("0x14"),w[o("0x9")]="NaviModel",w.id=6;p={};p[o("0x65")]=!1;a={};a[o("0x85")]=o("0x14"),a[o("0x9")]=o("0x70"),a.id=7,a[o("0x33")]=p;E={};E.mid=g,E[o("0x10")]=_,E[o("0x28")]=m,E[o("0x7c")+"ts"]=b,E[o("0x89")]=h,E[o("0x5b")]=w,E[o("0x4c")]=a;v={};v.type=o("0x70"),v.id=1;c={};c[o("0x9")]=o("0x70"),c.id=2;x={};x[o("0x9")]=o("0x70"),x.id=3;i={};i[o("0x9")]=o("0x70"),i.id=4;S={};S[o("0x9")]=o("0x70"),S.id=5;l={};l[o("0x9")]=o("0x4f"),l.id=6;u={};u[o("0x9")]=o("0x4f"),u.id=7;p={};p[o("0x9")]=o("0x4f"),p.id=8;g={};g[o("0x9")]="int32",g.id=9;_={};_[o("0x9")]=o("0x4f"),_.id=10;m={};m[o("0x9")]=o("0x70"),m.id=11;b={};b[o("0x65")]=!1;h={};h[o("0x85")]=o("0x14"),h[o("0x9")]=o("0x70"),h.id=12,h[o("0x33")]=b;w={};w[o("0x65")]=!1;a={};a[o("0x85")]="repeated",a[o("0x9")]=o("0x5f"),a.id=13,a[o("0x33")]=w;b={};b[o("0x0")]=0;w={};w.type=o("0x70"),w.id=14,w[o("0x33")]=b;b={};b[o("0x43")]=v,b.nodeType=c,b[o("0x20")]=x,b[o("0x38")]=i,b[o("0x40")]=S,b[o("0x12")]=l,b.linkSeg=u,b[o("0x36")]=p,b[o("0x66")+"pe"]=g,b["entranceFl"+o("0x11")]=_,b[o("0x37")]=m,b[o("0x79")]=h,b.pts=a,b[o("0x50")]=w;c={};c[o("0x3a")]=b;x={};x[o("0x9")]=o("0x70"),x.id=1;i={};i[o("0x9")]="int32",i.id=2;S={};S[o("0x9")]=o("0x70"),S.id=3;l={type:"double",id:4},u={};u[o("0x9")]=o("0x70"),u.id=5;p={};p[o("0x9")]="string",p.id=6;g={};g[o("0x9")]=o("0x70"),g.id=7;_={};_[o("0x9")]=o("0x4f"),_.id=8;m={};m[o("0x9")]=o("0x4f"),m.id=9;h={type:"int32",id:10},a={};a[o("0x65")]=!1;w={};w[o("0x85")]="repeated",w.type="int32",w.id=11,w[o("0x33")]=a;b={};b[o("0x65")]=!1;a={};a[o("0x85")]=o("0x14"),a.type=o("0x5f"),a.id=12,a[o("0x33")]=b;b={};b[o("0x2")]=x,b[o("0x71")]=i,b[o("0x83")]=S,b[o("0x16")]=l,b[o("0x3b")]=u,b[o("0x6b")]=p,b[o("0x4")]=g,b[o("0x22")]=_,b.geo=m,b.through=h,b.idxs=w,b[o("0x76")]=a;p={};p[o("0x3a")]=b;g={};g[o("0x85")]="required",g.type=o("0x70"),g.id=1;_={};_[o("0x0")]=0;m={};m[o("0x85")]="required",m.type=o("0x70"),m.id=2,m[o("0x33")]=_;h={};h[o("0x9")]=o("0x4f"),h.id=3;w={};w[o("0x85")]=o("0x14"),w[o("0x9")]="string",w.id=4;a={};a[o("0x65")]=!1;b={};b[o("0x85")]=o("0x14"),b[o("0x9")]=o("0x70"),b.id=5,b[o("0x33")]=a;_={};_[o("0x65")]=!1;a={};a[o("0x85")]=o("0x14"),a.type=o("0x5f"),a.id=6,a.options=_;_={};_.id=g,_[o("0x9")]=m,_.geo=h,_[o("0x26")]=w,_[o("0x79")]=b,_[o("0x76")]=a;m={};m[o("0x3a")]=_;h={};h[o("0x85")]="required",h[o("0x9")]="int32";w={packed:!(h.id=1)},b={};b.rule=o("0x14"),b.type="int32",b.id=2,b[o("0x33")]=w;a={};a[o("0x65")]=!1;_={};_[o("0x85")]=o("0x14"),_[o("0x9")]=o("0x70"),_.id=3,_[o("0x33")]=a;w={};w[o("0x65")]=!1;a={};a.rule=o("0x14"),a.type=o("0x70"),a.id=4,a[o("0x33")]=w;w={};w[o("0x6e")]=h,w.doorids=b,w[o("0x75")]=_,w.entrytypes=a;a={};a.fields=w;w={};w[o("0x5a")]=c,w[o("0x47")+"t"]=p,w[o("0x6a")]=m,w[o("0x41")]=a;a={};a.fields=E,a[o("0x81")]=w;w={};w[o("0x86")]=T,w.Scene=M,w[o("0x2e")]=y,w[o("0x1c")]=f,w.FloorNavi=a;a={};a[o("0x33")]=e,a[o("0x81")]=w;w={};w.protobuf=a;a={};a.nested=w,this.id=a};pr=function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),this.Ii=null};Object.assign(pr.prototype,{Ni:function(){this.Ii||(this.Ii=Yu.a.Root.fromJSON("undefined"!=typeof KjWzhWlSj&&KjWzhWlSj.ProtoDef?KjWzhWlSj.ProtoDef:(new qu).id))},Fi:function(t){return this.Ni(),this.Ii.lookup("Map").decode(t)},Ui:function(t){for(var n=0;n<t.buffers.length;n++){var e=t.buffers[n];if(1==e.btype)return this.Bi(e.data)}return null},Gi: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.Hi(i.data)}return null},Vi: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.zi(i.data)}return null},Wi: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.Xi(i.data)}return null},Zi: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.Xi(i.data)}return null},Yi: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.Xi(i.data)}return null},Bi:function(t){this.Ni();var n=this.Ii.lookup("Scene").decode(t);return n.levels=[],n.layerGroups.forEach(function(t){n.levels.push(t.gid)}),n},Hi:function(t){return this.Ni(),this.Ii.lookup("FloorGeo").decode(t)},zi:function(t){return this.Ni(),this.Ii.lookup("FloorBiz").decode(t)},Xi:function(t){return this.Ni(),this.Ii.lookup("FloorNavi").decode(t)}});var Ku=pr;br=function t(){var n;!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),void 0!==Hu.a.global().KjWzhWlSj&&Hu.a.global().KjWzhWlSj.ProtoReaderStatic?(n=Hu.a.global().KjWzhWlSj.ProtoReaderStatic,this.qi=new n):this.qi=new Ku};Object.assign(br.prototype,{Fi:function(t){return this.qi.Fi(t)},Ui:function(t){return this.qi.Ui(t)},Gi:function(t,n){return this.qi.Gi(t,n)},Vi:function(t,n){return this.qi.Vi(t,n)},Wi:function(t,n){return this.qi.Wi(t,n)},Zi:function(t,n){return this.qi.Zi(t,n)},Yi:function(t,n){return this.qi.Yi(t,n)},Bi:function(t){return this.qi.Bi(t)},Hi:function(t){return this.qi.Hi(t)},zi:function(t){return this.qi.zi(t)},Xi:function(t){return this.qi.Xi(t)}});var Ju,Qu,$u,th,nh,eh=br,di="https://console.fengmap.com/api-s/",ih={domain:di,online:di+"sdk/check",check:di+"sdk/auth/web",download:di+"sdk/auth/obtainMapRoute",downloadTile:di+"sdk/authLayered/obtainMapRoute",collect:di+"sdk/collect",themeUrl:di+"webtheme/",externalModelUrl:di+"webmodel/"};function rh(t,n){for(var e,i=0,r=0,r=0;r<8;r++)1&n&&(i^=t),e=128&t,t<<=1,e&&(t^=27),n>>=1;return i}function oh(t,n,e){for(var i=0;i<4;i++)t[0+i]^=n[16*e+4*i],t[4+i]^=n[16*e+4*i+1],t[8+i]^=n[16*e+4*i+2],t[12+i]^=n[16*e+4*i+3]}function sh(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 ah(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]=Qu[16*e+i]}function uh(t){for(var n=0;n<4;n++)t[n]=Ju[16*((240&t[n])>>4)+(15&t[n])]}function hh(t){return parseInt(t,16)}var ch=(Ju=[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],Qu=[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],nh=[2,th=$u=0,0,0],{decryption:function(t,n){for(var e=Array(16),i=0;i<16;i++)e[i]=16*hh(n.substr(2*i,1))+hh(n.substr(2*i+1,1));var r=Array(16);for(i=0;i<16;i++)r[i]=16*hh(t.substr(2*i,1))+hh(t.substr(2*i+1,1));var o=Array(16);switch(i=[],e.length){default:case 16:$u=4,th=10;break;case 24:$u=6,th=12;break;case 32:$u=8,th=14}for(var s=i=Array(16*(th+1)),a=Array(4),u=4*(th+1),h=0;h<$u;h++)s[4*h+0]=e[4*h+0],s[4*h+1]=e[4*h+1],s[4*h+2]=e[4*h+2],s[4*h+3]=e[4*h+3];for(h=$u;h<u;h++){if(a[0]=s[4*(h-1)+0],a[1]=s[4*(h-1)+1],a[2]=s[4*(h-1)+2],a[3]=s[4*(h-1)+3],0==h%$u){for(var c=void 0,f=void 0,c=(e=a)[0],f=0;f<3;f++)e[f]=e[f+1];if(e[3]=c,uh(a),1==(e=h/$u))nh[0]=1;else if(1<e)for(nh[0]=2,e--;0<e-1;)nh[0]=rh(nh[0],2),e--;(f=e=a)[0]=e[0]^(c=nh)[0],f[1]=e[1]^c[1],f[2]=e[2]^c[2],f[3]=e[3]^c[3]}else 6<$u&&4==h%$u&&uh(a);s[4*h+0]=s[4*(h-$u)+0]^a[0],s[4*h+1]=s[4*(h-$u)+1]^a[1],s[4*h+2]=s[4*(h-$u)+2]^a[2],s[4*h+3]=s[4*(h-$u)+3]^a[3]}for(s=Array(16),a=0;a<4;a++)for(h=0;h<4;h++)s[4*a+h]=r[a+4*h];for(oh(s,i,th),r=th-1;1<=r;r--)for(sh(s),ah(s),oh(s,i,r),a=s,h=[14,9,13,11],u=f=void 0,e=Array(4),c=Array(4),u=0;u<4;u++){for(f=0;f<4;f++)e[f]=a[4*f+u];var l=e,d=c;for(d[0]=rh((f=h)[0],l[0])^rh(f[3],l[1])^rh(f[2],l[2])^rh(f[1],l[3]),d[1]=rh(f[1],l[0])^rh(f[0],l[1])^rh(f[3],l[2])^rh(f[2],l[3]),d[2]=rh(f[2],l[0])^rh(f[1],l[1])^rh(f[0],l[2])^rh(f[3],l[3]),d[3]=rh(f[3],l[0])^rh(f[2],l[1])^rh(f[1],l[2])^rh(f[0],l[3]),f=0;f<4;f++)a[4*f+u]=c[f]}for(sh(s),ah(s),oh(s,i,0),a=0;a<4;a++)for(h=0;h<4;h++)o[a+4*h]=s[4*a+h];for(r="",i=0;i<16;++i)r+=s=(s=o[i].toString(16)).length<2?"0"+s:s;return r}});function fh(t,n){var e=(65535&t)+(65535&n);return(t>>16)+(n>>16)+(e>>16)<<16|65535&e}function lh(t,n,e,i,r,o){return fh((o=fh(fh(n,t),fh(i,o)))<<(r=r)|o>>>32-r,e)}function dh(t,n,e,i,r,o,s){return lh(n&e|~n&i,t,n,r,o,s)}function vh(t,n,e,i,r,o,s){return lh(n&i|e&~i,t,n,r,o,s)}function ph(t,n,e,i,r,o,s){return lh(n^e^i,t,n,r,o,s)}function mh(t,n,e,i,r,o,s){return lh(e^(n|~i),t,n,r,o,s)}function gh(t,n){var e,i,r,o;t[n>>5]|=128<<n%32,t[14+(n+64>>>9<<4)]=n;for(var s=1732584193,a=-271733879,u=-1732584194,h=271733878,c=0;c<t.length;c+=16)s=dh(e=s,i=a,r=u,o=h,t[c],7,-680876936),h=dh(h,s,a,u,t[c+1],12,-389564586),u=dh(u,h,s,a,t[c+2],17,606105819),a=dh(a,u,h,s,t[c+3],22,-1044525330),s=dh(s,a,u,h,t[c+4],7,-176418897),h=dh(h,s,a,u,t[c+5],12,1200080426),u=dh(u,h,s,a,t[c+6],17,-1473231341),a=dh(a,u,h,s,t[c+7],22,-45705983),s=dh(s,a,u,h,t[c+8],7,1770035416),h=dh(h,s,a,u,t[c+9],12,-1958414417),u=dh(u,h,s,a,t[c+10],17,-42063),a=dh(a,u,h,s,t[c+11],22,-1990404162),s=dh(s,a,u,h,t[c+12],7,1804603682),h=dh(h,s,a,u,t[c+13],12,-40341101),u=dh(u,h,s,a,t[c+14],17,-1502002290),s=vh(s,a=dh(a,u,h,s,t[c+15],22,1236535329),u,h,t[c+1],5,-165796510),h=vh(h,s,a,u,t[c+6],9,-1069501632),u=vh(u,h,s,a,t[c+11],14,643717713),a=vh(a,u,h,s,t[c],20,-373897302),s=vh(s,a,u,h,t[c+5],5,-701558691),h=vh(h,s,a,u,t[c+10],9,38016083),u=vh(u,h,s,a,t[c+15],14,-660478335),a=vh(a,u,h,s,t[c+4],20,-405537848),s=vh(s,a,u,h,t[c+9],5,568446438),h=vh(h,s,a,u,t[c+14],9,-1019803690),u=vh(u,h,s,a,t[c+3],14,-187363961),a=vh(a,u,h,s,t[c+8],20,1163531501),s=vh(s,a,u,h,t[c+13],5,-1444681467),h=vh(h,s,a,u,t[c+2],9,-51403784),u=vh(u,h,s,a,t[c+7],14,1735328473),s=ph(s,a=vh(a,u,h,s,t[c+12],20,-1926607734),u,h,t[c+5],4,-378558),h=ph(h,s,a,u,t[c+8],11,-2022574463),u=ph(u,h,s,a,t[c+11],16,1839030562),a=ph(a,u,h,s,t[c+14],23,-35309556),s=ph(s,a,u,h,t[c+1],4,-1530992060),h=ph(h,s,a,u,t[c+4],11,1272893353),u=ph(u,h,s,a,t[c+7],16,-155497632),a=ph(a,u,h,s,t[c+10],23,-1094730640),s=ph(s,a,u,h,t[c+13],4,681279174),h=ph(h,s,a,u,t[c],11,-358537222),u=ph(u,h,s,a,t[c+3],16,-722521979),a=ph(a,u,h,s,t[c+6],23,76029189),s=ph(s,a,u,h,t[c+9],4,-640364487),h=ph(h,s,a,u,t[c+12],11,-421815835),u=ph(u,h,s,a,t[c+15],16,530742520),s=mh(s,a=ph(a,u,h,s,t[c+2],23,-995338651),u,h,t[c],6,-198630844),h=mh(h,s,a,u,t[c+7],10,1126891415),u=mh(u,h,s,a,t[c+14],15,-1416354905),a=mh(a,u,h,s,t[c+5],21,-57434055),s=mh(s,a,u,h,t[c+12],6,1700485571),h=mh(h,s,a,u,t[c+3],10,-1894986606),u=mh(u,h,s,a,t[c+10],15,-1051523),a=mh(a,u,h,s,t[c+1],21,-2054922799),s=mh(s,a,u,h,t[c+8],6,1873313359),h=mh(h,s,a,u,t[c+15],10,-30611744),u=mh(u,h,s,a,t[c+6],15,-1560198380),a=mh(a,u,h,s,t[c+13],21,1309151649),s=mh(s,a,u,h,t[c+4],6,-145523070),h=mh(h,s,a,u,t[c+11],10,-1120210379),u=mh(u,h,s,a,t[c+2],15,718787259),a=mh(a,u,h,s,t[c+9],21,-343485551),s=fh(s,e),a=fh(a,i),u=fh(u,r),h=fh(h,o);return[s,a,u,h]}function yh(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 bh(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 _h(t){for(var n,e="0123456789abcdef",i="",r=0;r<t.length;r+=1)n=t.charCodeAt(r),i+=e.charAt(n>>>4&15)+e.charAt(15&n);return i}function wh(t){return unescape(encodeURIComponent(t))}function xh(t){return yh(gh(bh(t=wh(t)),8*t.length))}function Mh(t,n){return function(t,n){var e,i=bh(t),r=[],o=[];for(r[15]=o[15]=void 0,16<i.length&&(i=gh(i,8*t.length)),e=0;e<16;e+=1)r[e]=909522486^i[e],o[e]=1549556828^i[e];return n=gh(r.concat(bh(n)),512+8*n.length),yh(gh(o.concat(n),640))}(wh(t),wh(n))}function Sh(t,n,e){return n?e?Mh(n,t):_h(Mh(n,t)):e?xh(t):_h(xh(t))}var Eh={encryption:function(t){return Sh(t)}};var Th="0.0.0.0",pi=function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t)};Object.assign(pi.prototype,{Ki:function(t,n,e,i,r){"undefined"==typeof KjWzhWlSj||!KjWzhWlSj.license||!KjWzhWlSj.license?i&&i():"string"==typeof n&&0!=n.length?(n=ch.decryption(n,"026685bf295f587b5dffc1f18d5dc27c"),e=Eh.encryption(e),n=ch.decryption(n,e),-1!==t.indexOf(n)?i&&i():r&&r()):r&&r()},Ji:function(t,n,e,i){var r;-1===n.indexOf("")&&-1===n.indexOf("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")?(r=Eh.encryption("fengmap.localhost:"+t.appName),r=ch.decryption(t.key,r),-1!==n.indexOf(r)?this.Ki(n,t.license,t.buildingID,function(){e&&e()},function(){i&&i(Vu.LICENSE_ERROR)}):i&&i(Vu.NAME_KEY_ERROR)):e&&e()},Qi:function(t,n,e){var i=this;void 0===t.mapURL?(this.$i(t),this.tr(function(){new Zu({method:"POST",url:ih.check,header:{"X-Requested-With":"XMLHttpRequest","Content-type":"application/json;charset=utf-8"},data:i.nr(t)}).ji(function(){n&&n()},function(t){e&&e(t)},function(){n&&n()})},function(){n&&n()})):n&&n()},tr:function(t,n){new Zu({method:"GET",url:ih.online}).ji(function(){t&&t()},function(){n&&n()},function(){n&&n()})},nr:function(t,n){var e=Hu.a.global().location.host,i=e.indexOf(":");-1!==i&&(e=e.slice(0,i));i={mapId:t.buildingID,appName:t.appName};return n?i.keyValue=t.key:i.appKey=t.key,n?i.webUrl=e||Th:i.webURL=e||Th,i},$i:function(t){if("undefined"!=typeof navigator&&"undefined"!=typeof document){var n={};-1!==navigator.userAgent.indexOf("Opera")?n.userAgent="Opera":-1!==navigator.userAgent.indexOf("Firefox")?n.userAgent="FF":-1!==navigator.userAgent.indexOf("Chrome")?n.userAgent="Chrome":-1!==navigator.userAgent.indexOf("Safari")&&0===navigator.userAgent.indexOf("Chrome")?n.userAgent="Safari":-1!==navigator.userAgent.indexOf("compatible")&&-1!==navigator.userAgent.indexOf("MSIE")?n.userAgent="IE":-1!==navigator.userAgent.indexOf("Trident")&&(n.userAgent="Edge"),n.product="JS",n.sdkVersion=a+"."+h,n.appName=t.appName,n.appkey=t.key;var e=document.createElement("canvas").getContext("experimental-webgl"),t=e.getExtension("WEBGL_debug_renderer_info");n.gpu=t?e.getParameter(t.UNMASKED_RENDERER_WEBGL):null,n.os=navigator.platform;for(var i=!0,r=navigator.userAgent,o=["Android","iPhone","SymbianOS","Windows Phone","iPad","iPod"],s=0;s<o.length;s++)if(0<r.indexOf(o[s])){i=!1;break}n.device=i?"pc":"mobile",new Zu({method:"POST",url:ih.collect,header:{"X-Requested-With":"XMLHttpRequest","Content-type":"application/json;charset=utf-8"},data:n}).ji()}}});var Lh=new pi;function Rh(t){return function(t){if(Array.isArray(t))return Oh(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,n){if(t){if("string"==typeof t)return Oh(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(e="Object"===e&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Oh(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 Oh(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}Li=function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),this.qi=new eh};Object.assign(Li.prototype,{ct:function(){},er:function(t,n,e,i){var r;t.mapURL?(r=t.isPreview||t.mapURLAbsolute?t.mapURL+t.buildingID+n+".fmap":t.mapURL+t.buildingID+"/"+t.buildingID+n+".fmap",e&&e(r)):new Zu({method:"POST",url:""===n?ih.download:ih.downloadTile+"/"+t.buildingID+n+".fmap",header:{"X-Requested-With":"XMLHttpRequest","Content-type":"application/json;charset=utf-8"},data:Object.assign({newFlag:"2",keyType:3,isSeparate:!1},Lh.nr(t,!0))}).ji(function(t){e&&e(t.replace('"',"").replace('"',""))},function(t){i&&i(t)},function(t){i&&i(t)})},ir:function(e,i,r){var o=this;Lh.Qi(e,function(){o.er(e,"",function(t){new Zu({method:"GET",responseType:"arraybuffer",url:t}).ji(function(t){var t=new Uint8Array(t),n=o.qi.Fi(t),t=[];n.keys&&0!==n.keys.length?t.push.apply(t,Rh(n.keys)):t.push(n.key),e.isPreview?i&&i(n):Lh.Ji(e,t,function(){i&&i(n)},function(t){r&&r(t)})},function(t){r&&r(t===Vu.PATH_ERROR?Vu.MAP_ID_URL_ERROR:t)},function(t){r&&r(t)})},function(t){r&&r(t)})},function(t){r&&r(t)})},rr:function(e,i,r){var o=this;Lh.Qi(e,function(){o.er(e,".scene",function(t){new Zu({method:"GET",responseType:"arraybuffer",url:t}).ji(function(t){var t=new Uint8Array(t),n=o.qi.Bi(t),t=[];n.keys&&0!==n.keys.length?t.push.apply(t,Rh(n.keys)):t.push(n.key),e.isPreview?i&&i(n):Lh.Ji(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)})},or:function(t,n,e,i){var r=this;this.er(t,".floor."+n+".geo",function(t){new Zu({method:"GET",responseType:"arraybuffer",url:t}).ji(function(t){t=new Uint8Array(t),t=r.qi.Hi(t);e&&e(t)},function(t){i&&i(t)},function(t){i&&i(t)})},function(t){i&&i(t)})},sr:function(t,n,e,i){var r=this;this.er(t,".floor."+n+".biz",function(t){new Zu({method:"GET",responseType:"arraybuffer",url:t}).ji(function(t){t=new Uint8Array(t),t=r.qi.zi(t);e&&e(t)},function(t){i&&i(t)},function(t){i&&i(t)})},function(t){i&&i(t)})},ar:function(t,n,e,i){var r=this;this.er(t,".floor."+n+".navi",function(t){new Zu({method:"GET",responseType:"arraybuffer",url:t}).ji(function(t){t=new Uint8Array(t),t=r.qi.Xi(t);e&&e(t)},function(t){i&&i(t)})},function(t){i&&i(t)},function(t){i&&i(t)})},ur:function(t,n,e,i){var r=this;this.er(t,".floor."+n+".drive.navi",function(t){new Zu({method:"GET",responseType:"arraybuffer",url:t}).ji(function(t){t=new Uint8Array(t),t=r.qi.Xi(t);e&&e(t)},function(t){i&&i(t)})},function(t){i&&i(t)},function(t){i&&i(t)})},hr:function(t,n,e,i){var r=this;this.er(t,".floor."+n+".accessible.navi",function(t){new Zu({method:"GET",responseType:"arraybuffer",url:t}).ji(function(t){t=new Uint8Array(t),t=r.qi.Xi(t);e&&e(t)},function(t){i&&i(t)})},function(t){i&&i(t)},function(t){i&&i(t)})}});var Ah=Li;Oi=function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t)};Object.assign(Oi.prototype,{cr: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},fr:function(t,n){for(var e=[],i=0,r=0;r<t.length;r++){var o=t[r].idxs;if("number"==typeof(o=o||t[r])){for(var s=[];i<o;)s.push({x:n[i],y:n[i+1]}),i+=2;e.push(s)}else for(var a=0;a<o.length;a++){for(var u=o[a],h=[];i<u;)h.push({x:n[i],y:n[i+1]}),i+=2;e.push(h)}}return e},lr:function(t,n){for(var e=[],i=[],r=0,o=0;o<t.length;o++){var s=t[o].idxs;if("number"==typeof(s=s||t[o]))for(;r<s;)e.push({x:n[r],y:n[r+1]}),r+=2;else for(var a=0;a<s.length;a++)if(0===a)for(var u=s[a];r<u;)e.push({x:n[r],y:n[r+1]}),r+=2;else{for(var h=[],c=s[a];r<c;)h.push({x:n[r],y:n[r+1]}),r+=2;i.push(h)}}var f=[];return f.push(e),f.push.apply(f,i),f},dr:function(t){for(var n=[],e=t.length,i=0;i<e;i++){for(var r=t[i],o={x:this.vr(r.x),y:this.vr(r.y)},s=n.length,a=!1,u=0;u<s;u++){var h=n[u];if(h.x==o.x&&h.y==o.y){a=!0;break}}a||n.push(o)}return n},vr:function(t){return+t.toFixed(2)}});var Ch=new Oi;var kh=kh||{};kh.G1="MULTIPOLYGON(((",kh.G2="POINT(",kh.G3="MULTILINESTRING((",kh.GLEN1="MULTIPOLYGON(((".length,kh.GLEN2="POINT(".length,kh.GLEN3="MULTILINESTRING((".length;Fi=function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t)};Object.assign(Fi.prototype,{cr:function(t){var n=[];if(0!=t.indexOf(kh.G2))return[];t=t.substring(kh.GLEN2,t.length-1).split(" ");return n.push({x:parseFloat(t[0]),y:parseFloat(t[1])}),n},fr:function(t){if(0!=t.indexOf(kh.G3))return[];for(var n=t.substring(kh.GLEN3,t.length-2).split(","),e=[],i=0;i<n.length;i++){var r=n[i].split(" ");e.push({x:parseFloat(r[0]),y:parseFloat(r[1])})}return[e]},lr:function(t){var n=[],e=[];if(0!=t.indexOf(kh.G1))return[];for(var i=t.substring(kh.GLEN1,t.length-3).split(/\),\(/),r=0;r<i.length;r++){var o=i[r].split(/,/);if(0==r)for(var s=0;s<o.length;s++){var a=o[s].split(" ");n.push({x:parseFloat(a[0]),y:parseFloat(a[1])})}else{for(var u=[],h=0;h<o.length;h++){var c=o[h].split(" ");u.push({x:parseFloat(c[0]),y:parseFloat(c[1])})}e.push(u)}}t=[];return t.push(n),t.push.apply(t,e),t},dr:function(t){for(var n=[],e=t.length,i=0;i<e;i++){for(var r=t[i],o={x:this.vr(r.x),y:this.vr(r.y)},s=n.length,a=!1,u=0;u<s;u++){var h=n[u];if(h.x==o.x&&h.y==o.y){a=!0;break}}a||n.push(o)}return n},vr:function(t){return+t.toFixed(2)}});var Ph=new Fi,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};Object.freeze(e);var Dh=e,Ji={STOP:0,PASS:1,PUSH:2};Object.freeze(Ji);var jh=Ji;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,i.key,i)}}pr=function(){function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),this.pr={x:Number.MAX_VALUE,y:Number.MAX_VALUE},this.mr={x:-Number.MAX_VALUE,y:-Number.MAX_VALUE}}var n,e,i;return n=t,(e=[{key:"min",get:function(){return this.pr}},{key:"max",get:function(){return this.mr}},{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.mr.x=t.max.x,this.mr.y=t.max.y,this.pr.x=t.min.x,this.pr.y=t.min.y,this}},{key:"clone",value:function(){return(new t).copy(this)}},{key:"reset",value:function(){this.pr={x:Number.MAX_VALUE,y:Number.MAX_VALUE},this.mr={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.gr(t)}},{key:"expandByCoords",value:function(t){this.yr(t)}},{key:"valid",value:function(){return this.br()}},{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}}])&&Ih(n.prototype,e),i&&Ih(n,i),t}();Object.assign(pr.prototype,{br:function(){return!(this.min.x>this.max.x||this.min.y>this.max.y)},gr: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))},yr:function(t){var n=this;t&&0!=t.length&&t.forEach(function(t){t.x<n.min.x&&(n.min.x=t.x),t.y<n.min.y&&(n.min.y=t.y),t.x>n.max.x&&(n.max.x=t.x),t.y>n.max.y&&(n.max.y=t.y)})}});var Nh=pr;function Fh(t,n){var e;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(e=function(t,n){if(t){if("string"==typeof t)return Uh(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(e="Object"===e&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Uh(t,n):void 0}}(t))||n&&t&&"number"==typeof t.length){e&&(t=e);var i=0,n=function(){};return{s:n,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o=!0,s=!1;return{s:function(){e=t[Symbol.iterator]()},n:function(){var t=e.next();return o=t.done,t},e:function(t){s=!0,r=t},f:function(){try{o||null==e.return||e.return()}finally{if(s)throw r}}}}function Uh(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 Bh(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}br=function(){function n(t){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,n),this.Yn=Dh.GROUP,this.Mt=new Map,this.ie=-1,this._r=null,this.wr=null,Object.assign(this,t)}var t,e,i;return t=n,(e=[{key:"getType",value:function(){return this.Yn}},{key:"getCoordinates",value:function(){return this._r}},{key:"getBound",value:function(){return this.wr||this.Mr(),this.wr}},{key:"getChildren",value:function(){return this.Mt}}])&&Bh(t.prototype,e),i&&Bh(t,i),n}();Object.assign(br.prototype,{ct:function(){var t,n=Fh(this.Mt.values());try{for(n.s();!(t=n.n()).done;){var e=t.value;e.ct&&e.ct()}}catch(t){n.e(t)}finally{n.f()}this.Mt.clear()},Sr:function(n){var t=n.Er(this);t==jh.PASS?this.Mt.forEach(function(t){t.Sr(n)}):t==jh.PUSH&&n.Tr.push(this)},Mr:function(){var n=this;this.wr=new Nh,0!=this.Mt.size&&this.Mt.forEach(function(t){n.wr.gr(t.getBound())})}});var Gh=br;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,i.key,i)}}di=function(){function n(t){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,n),this.ie=t.eid,this.Yn=Dh.POINT,this._r=null,this.wr=null,Object.assign(this,t)}var t,e,i;return t=n,(e=[{key:"getType",value:function(){return this.Yn}},{key:"getCoordinates",value:function(){return this._r}},{key:"getBound",value:function(){return this.wr||this.Mr(),this.wr}}])&&Hh(t.prototype,e),i&&Hh(t,i),n}();Object.assign(di.prototype,{Mr:function(){this.wr=new Nh,this._r&&this.wr.yr(this._r)},Sr:function(t){t.Er(this)==jh.PUSH&&t.Tr.push(this)}});var Vh=di;function zh(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}pi=function(){function n(t){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,n),this.ie=t.eid,this.Yn=Dh.POLYGON,this.zt=null,this._r=null,this.wr=null,Object.assign(this,t)}var t,e,i;return t=n,(e=[{key:"getType",value:function(){return this.Yn}},{key:"getCenter",value:function(){return this.zt}},{key:"getCoordinates",value:function(){return this._r}},{key:"getBound",value:function(){return this.wr||this.Mr(),this.wr}}])&&zh(t.prototype,e),i&&zh(t,i),n}();Object.assign(pi.prototype,{Mr:function(){var n=this;this.wr=new Nh,this._r&&this._r.forEach(function(t){n.wr.yr(t)})},Sr:function(t){t.Er(this)==jh.PUSH&&t.Tr.push(this)}});var Wh=pi;function Xh(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}Li=function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),this.Lr=[1,2,3,4],this.Rr=[6,7,9],this.Or=[31,32],this.Ar=new Map,this.Ar.set(31,Dh.EXTENTGROUP),this.Ar.set(32,Dh.MODELGROUP),this.Ar.set(6,Dh.FACILITYGROUP),this.Ar.set(7,Dh.LABELGROUP),this.Ar.set(9,Dh.EXTERNALMODELGROUP),this.Cr=new Map,this.Cr.set(31,["extentLayer",null]),this.Cr.set(32,["modelLayer","labelLayer"]),this.Cr.set(6,["poiLayer",null]),this.Cr.set(7,["labelLayer",null]),this.Cr.set(9,["externalModelLayer",null]),this.qi=new eh};Object.assign(Li.prototype,{kr:function(t){if(!t)return null;var n=t.scene;return this.Pr(n,t)},Pr:function(e,i){var r=this,t=e.layerGroups,n=Xh(e,["layerGroups"]),o=new Gh(n);return t.forEach(function(t){var n=r.Dr(t,i,e.fileVer);o.Mt.set(t.gid,n)}),o},Dr:function(t,n,e){var i=this,r=t.layers,o=Xh(t,["layers"]),s=new Gh(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.jr(t,a,u,e);null!=n&&s.Mt.set(i.Ar.get(t.ltype),n)}),this.Ir(s),s},Ir:function(t){var n=Array.from(t.Mt);n.sort(function(t,n){return t[0]-n[0]}),t.Mt=new Map(n)},jr:function(t,n,e,i){if(-1!=this.Lr.indexOf(t.ltype))return null;if(!this.Cr.get(t.ltype))return null;var r=new Gh(t);return this.Nr(r,n,e,i),r&&(r.Yn=this.Ar.get(t.ltype)),r},Nr:function(t,n,e,i){if(t){var r=this.Cr.get(t.ltype);if(r){var o=n?n[r[0]]:[],s=e?e[r[0]]:[];switch(t.ltype){case 6:this.Fr(t,o,s,i,Dh.FACILITY);break;case 7:this.Fr(t,o,s,i,Dh.LABEL);break;case 9:this.Fr(t,o,s,i,Dh.EXTERNALMODEL);break;case 31:this.Ur(t,o,s,i,Dh.EXTENT,null);break;case 32:this.Ur(t,o,s,i,Dh.MODEL,n?n[r[1]]:null)}}}},Fr:function(t,n,e,i,r){for(var o=0;o<n.length;o++){var s=this.Br(n[o],e[o],i);s.Yn=r,t.Mt.set(n[o].eid,s)}},Br:function(t,n,e){n=Object.assign({},n,{area:t.area,eid:t.eid,height:t.height}),n=new Vh(n);return t.coordinates?n._r=t.coordinates:(n._r=1==e?Ph.cr(t.geo):Ch.cr(t.idxs,t.pts),t.coordinates=n._r),n},Ur:function(t,n,e,i,r,o){for(var s=0;s<n.length;s++){var a=this.Gr(n[s],e[s],i,o?o[s]:null);a.Yn=r,t.Mt.set(n[s].eid,a)}},Gr:function(t,n,e,i){n=Object.assign({},n,{area:t.area,eid:t.eid,height:t.height}),n=new Wh(n);return n._r=1===e?Ph.lr(t.geo):Ch.lr(t.idxs,t.pts),i&&(i.coordinates||(i.coordinates=1==e?Ph.cr(i.geo):Ch.cr(i.idxs,i.pts)),n.zt=i.coordinates[0]),n}});var Zh=Li,Yh={NONE_RODE_NETWORK:1,WALK_RODE_NETWORK:2,DRIVE_RODE_NETWORK:4,ACCESSIBLE_RODE_NETWORK:8};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,i.key,i)}}Oi=function(){function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),this.Hr=new Map,this.Vr=new Map,this.Di=new Map,this.zr=new Map,this.Wr=new Map,this.Xr=new Map,this.Zr=[2,3],this.Yr=!1,this.qi=new eh,this.qr=new Zh,this.Kr=new Ah}var n,e,i;return n=t,(e=[{key:"load",value:function(t,n){this.Jr(t,n)}},{key:"loadWhole",value:function(t,n){this.Qr(t,n)}},{key:"getDecode",value:function(t){t=void 0!==t.buildingID?t.buildingID:t.mapID;return this.$r({buildingID:t})}},{key:"getData",value:function(t){t=void 0!==t.buildingID?t.buildingID:t.mapID;return this.Hr.get(t)}},{key:"setCache",value:function(t){this.Hr=t[0],this.Vr=t[1]}},{key:"getCache",value:function(){return[this.Hr,this.Vr]}}])&&qh(n.prototype,e),i&&qh(n,i),t}();Object.assign(Oi.prototype,{ct:function(){this.Hr.clear(),this.Hr=null,this.Vr.clear(),this.Vr=null,this.Di.clear(),this.Di=null,this.zr.clear(),this.zr=null,this.Wr.clear(),this.Wr=null,this.Xr.clear(),this.Xr=null},to:function(t){this.zr.set(t.buildingID,null),this.Wr.set(t.buildingID,null),this.Xr.set(t.buildingID+t.uuid,0)},Jr:function(a,u){var h=this;this.to(a),this.rr(a,function(t,n){u&&u(t,n);var e=h.no(a),i=void 0!==a.level?a.level:parseInt(e.defGid);h.eo(a,i,u);for(var r=a.visibleLevels||e.levels,o=0;o<r.length;o++)r[o]!==i&&h.eo(a,r[o],u);if(a.preLoad)for(var s=0;s<e.levels.length;s++)e.levels[s]!==i&&-1===r.indexOf(e.levels[s])&&h.eo(a,e.levels[s],u)},function(t,n){u&&u(t,n)})},rr:function(n,e,i){var r=this,t=this.no(n);t?(e&&e("scene",t),n.justDecode||(t=this.Hr.get(n.buildingID),e&&e("building",t))):this.Kr.rr(n,function(t){r.Vr.set(n.buildingID,{scene:t}),e&&e("scene",t),n.justDecode||(t=r.qr.Pr(t),r.Hr.set(n.buildingID,t),e&&e("building",t))},function(t){i&&i("error",t===Vu.PATH_ERROR?Vu.MAP_ID_URL_ERROR:t)})},eo:function(t,n,e,i){var r=this.zr.get(t.buildingID);r||this.zr.set(t.buildingID,r=[]),i?r.unshift(n):r.push(n),this.Yr&&1!==r.length||this.io(t,e)},io:function(i,r){var o=this,s=this.no(i);if(s){var a=this.zr.get(i.buildingID),t=this.Wr.get(i.buildingID);if(a&&0!==a.length){t||this.Wr.set(i.buildingID,t=[]);var u=a[0];if(-1!==t.indexOf(u))return a.splice(a.indexOf(u),1),void this.io(i,r);t.push(u),this.ro(i,u,function(t,n){var e=o.Xr.get(i.buildingID+i.uuid);"layerGroup"===t&&(r&&r(t,n),o.Xr.set(i.buildingID+i.uuid,++e),e===s.layerGroups.length&&r&&r("decode",o.$r(i)),a.splice(a.indexOf(u),1),o.io(i,r)),"layer"===t&&r&&r(t,n),"floor"===t&&(r&&r(t,n),e===s.layerGroups.length&&r&&r("complete",o.oo(i)))},function(t,n){r&&r(t,n)})}}},ro:function(r,o,s,n){function e(n){var e,i,t;h===++c&&(e=f.get("geo"),i=f.get("biz"),l&&l.merge(o,e,i,a.fileVer),s&&s("layerGroup",f),r.justDecode||((t=n.Xt(r,o)).Mt.forEach(function(t){n.qr.Nr(t,e,i,a.fileVer),s&&s("layer",t)}),s&&s("floor",t)))}var i=this,a=this.no(r),t=this.so(a,o),u=t.gname,t=t.naviType||0,h=this.Zr[0],c=0,f=new Map,l=r.merge;r.loadNavi&&((0!=(t&Yh.WALK_RODE_NETWORK)||a.fileVer<3)&&(h++,this.ar(r,o,u,function(t,n){f.set(t,n),s&&s(t,n),e(i)},function(t){n&&n(t)})),0!=(t&Yh.DRIVE_RODE_NETWORK)&&(h++,this.ur(r,o,u,function(t,n){f.set(t,n),s&&s(t,n),e(i)},function(t){n&&n(t)})),0!=(t&Yh.ACCESSIBLE_RODE_NETWORK)&&(h++,this.hr(r,o,u,function(t,n){f.set(t,n),s&&s(t,n),e(i)},function(t){n&&n(t)}))),this.or(r,o,u,function(t,n){f.set(t,n),s&&s(t,n),e(i)},function(t){n&&n(t)}),this.sr(r,o,u,function(t,n){f.set(t,n),s&&s(t,n),e(i)},function(t){n&&n(t)})},or:function(n,e,t,i,r){var o=this,s=this.ao(n,e,"geo");s?i&&i("geo",s):this.Kr.or(n,t,function(t){o.uo(n,e,"geo",t),i&&i("geo",t)},function(t){r&&r("error",t)})},sr:function(n,e,t,i,r){var o=this,s=this.ao(n,e,"biz");s?i&&i("biz",s):this.Kr.sr(n,t,function(t){o.uo(n,e,"biz",t),i&&i("biz",t)},function(t){r&&r("error",t)})},ar:function(n,e,t,i,r){var o=this,s=this.ao(n,e,"navi");s?i&&i("navi",s):this.Kr.ar(n,t,function(t){o.uo(n,e,"navi",t),i&&i("navi",t)},function(t){r&&r("error",t)})},ur:function(n,e,t,i,r){var o=this,s=this.ao(n,e,"drive_navi");s?i&&i("drive_navi",s):this.Kr.ur(n,t,function(t){o.uo(n,e,"drive_navi",t),i&&i("drive_navi",t)},function(t){r&&r("error",t)})},hr:function(n,e,t,i,r){var o=this,s=this.ao(n,e,"accessible_navi");s?i&&i("drive_navi",s):this.Kr.hr(n,t,function(t){o.uo(n,e,"accessible_navi",t),i&&i("accessible_navi",t)},function(t){r&&r("error",t)})},Qr:function(t,e){this.ir(t,function(t,n){e&&e(t,n)},function(t,n){e&&e(t,n)})},ir:function(n,e,i){var r=this,o=this.$r(n);o?e&&e("decode",o):this.Kr.ir(n,function(t){r.ho(n,t),o=r.$r(n),e&&e("decode",o),n.justDecode||(t=r.qr.kr(o),r.Hr.set(n.buildingID,t),e&&e("complete",t))},function(t){i&&i("error",t)})},oo:function(t){if(this.Hr){t=this.Hr.get(t.buildingID);return t||null}},Xt:function(t,n){t=this.Hr.get(t.buildingID);return t?t.Mt.get(n):null},ho:function(t,n){var e={scene:null,floors:new Map},i=this.qi.Ui(n);e.scene=i;for(var r=0;r<i.layerGroups.length;r++){var o=i.layerGroups[r],s=this.qi.Gi(n,o.gid),a=this.qi.Vi(n,o.gid),u=this.qi.Wi(n,o.gid),h=this.qi.Zi(n,o.gid),c=this.qi.Yi(n,o.gid);t.merge&&t.merge.merge(o.gid,s,a,i.fileVer);var f=new Map;f.set("geo",s),f.set("biz",a),f.set("navi",u),f.set("drive_navi",h),f.set("accessible_navi",c),e.floors.set(o.gid,f)}this.Vr.set(t.buildingID,e)},$r:function(t){var n=this.Vr.get(t.buildingID);if(!n)return null;for(var e=n.scene,i=new Map,n={scene:e,floors:i},r=0;r<e.layerGroups.length;r++){var o=e.layerGroups[r],s=o.gid,a={gid:s,gname:o.gname,level:s,geo:[],biz:[],navi:[],naviDrive:[],naviAccessible:[]};a.geo.push(this.ao(t,s,"geo")),a.biz.push(this.ao(t,s,"biz"));var u=this.ao(t,s,"navi");u&&a.navi.push(u);u=this.ao(t,s,"drive_navi");u&&a.naviDrive.push(u);s=this.ao(t,s,"accessible_navi");s&&a.naviAccessible.push(s),i.set(o.gid,a)}return n},no:function(t){t=this.Vr.get(t.buildingID);return t?t.scene:null},uo:function(t,n,e,i){var r=this.Vr.get(t.buildingID);r&&((t=r.floors)||(t=new Map,r.floors=t),(r=t.get(n))||(r=new Map,t.set(n,r)),r.set(e,i))},ao:function(t,n,e){t=this.Vr.get(t.buildingID);if(!t)return null;t=t.floors;if(!t)return null;n=t.get(n);return n?n.get(e):null},so:function(t,n){if(null==t)return null;for(var e=t.layerGroups,i=0;i<e.length;i++)if(e[i].gid==n)return e[i];return null}});var Kh=Oi;sr.fmcommon={diffuse:{value:new _i(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new x}},sr.line={lineWidth:{value:1},resolution:{value:new ci(1,1)},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1},mmap:{value:null},offset:{value:new ci(0,0)},repeat:{value:new ci(1,1)},miny:{value:0},pcolor:{value:new _i(11447982)}},ar.line={uniforms:or.merge([sr.fmcommon,sr.line]),vertexShader:"\n\t\t#include <common>\n\t\t#include <color_pars_vertex>\n\n\t\tuniform float lineWidth;\n\t\tuniform vec2 resolution;\n\n\t\tattribute float uvyStart;\n\t\tattribute float uvyEnd;\n\n\t\tattribute vec3 instanceStart;\n\t\tattribute vec3 instanceEnd;\n\n\t\tattribute vec3 instanceColorStart;\n\t\tattribute vec3 instanceColorEnd;\n\t\tattribute vec2 uv2;\n\n\n\t\tvarying vec2 vUv;\n\t\tvarying vec2 vUv2;\n\t\tvarying float uvScale;\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashScale;\n\t\t\tattribute float instanceDistanceStart;\n\t\t\tattribute float instanceDistanceEnd;\n\t\t\tvarying float vLineDistance;\n\n\t\t#endif\n\n\t\tvoid trimSegment( const in vec4 start, inout vec4 end ) {\n\n\t\t\t// trim end segment so it terminates between the camera plane and the near plane\n\n\t\t\t// conservative estimate of the near plane\n\t\t\tfloat a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column\n\t\t\tfloat b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column\n\t\t\tfloat nearEstimate = - 0.5 * b / a;\n\n\t\t\tfloat alpha = ( nearEstimate - start.z ) / ( end.z - start.z );\n\n\t\t\tend.xyz = mix( start.xyz, end.xyz, alpha );\n\n\t\t}\n\t\t\n\t\t#include <logdepthbuf_pars_vertex>\n\n\t\tvoid main() {\n\n\t\t\t#ifdef USE_COLOR\n\n\t\t\t\tvColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd;\n\n\t\t\t#endif\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tvLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd;\n\n\t\t\t#endif\n\n\t\t\tfloat aspect = resolution.x / resolution.y;\n\n\t\t\tvUv = uv;\n\t\t\t\n\t\t\tfloat duvy = uvyEnd - uvyStart;\n\t\t\tfloat uvy = uvyStart + duvy * uv2.y;\n\t\t\t// vUv2 = vec2(uv2.x ,uvy);\n\t\t\tvUv2 = ( position.y < 0.5 ) ? vec2(uv2.x ,uvyStart) : vec2(uv2.x ,uvyEnd);\n\t\t\t// camera space\n\t\t\tvec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );\n\t\t\tvec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 );\n\n\t\t\t// special case for perspective projection, and segments that terminate either in, or behind, the camera plane\n\t\t\t// clearly the gpu firmware has a way of addressing this issue when projecting into ndc space\n\t\t\t// but we need to perform ndc-space calculations in the shader, so we must address this issue directly\n\t\t\t// perhaps there is a more elegant solution -- WestLangley\n\n\t\t\tbool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column\n\n\t\t\tif ( perspective ) {\n\n\t\t\t\tif ( start.z < 0.0 && end.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( start, end );\n\n\t\t\t\t} else if ( end.z < 0.0 && start.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( end, start );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// clip space\n\t\t\tvec4 clipStart = projectionMatrix * start;\n\t\t\tvec4 clipEnd = projectionMatrix * end;\n\n\t\t\t// ndc space\n\t\t\tvec2 ndcStart = clipStart.xy / clipStart.w;\n\t\t\tvec2 ndcEnd = clipEnd.xy / clipEnd.w;\n\n\t\t\t// direction\n\t\t\tvec2 dir = ndcEnd - ndcStart;\n\n\t\t\t// account for clip-space aspect ratio\n\t\t\tdir.x *= aspect;\n\t\t\tfloat scaleDir = length(dir);\n\t\t\tuvScale = 0.05/scaleDir;\n\t\t\tdir = normalize( dir );\n\n\t\t\t// perpendicular to dir\n\t\t\tvec2 offset = vec2( dir.y, - dir.x );\n\n\t\t\t// undo aspect ratio adjustment\n\t\t\tdir.x /= aspect;\n\t\t\toffset.x /= aspect;\n\n\t\t\t// sign flip\n\t\t\tif ( position.x < 0.0 ) offset *= - 1.0;\n\n\t\t\t// endcaps\n\t\t\tif ( position.y < 0.0 ) {\n\n\t\t\t\toffset += - dir;\n\n\t\t\t} else if ( position.y > 1.0 ) {\n\n\t\t\t\toffset += dir;\n\n\t\t\t}\n\n\t\t\t// adjust for lineWidth\n\t\t\toffset *= lineWidth;\n\n\t\t\t// adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ...\n\t\t\toffset /= resolution.y;\n\n\t\t\t// select end\n\t\t\tvec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;\n\n\t\t\t// back to clip space\n\t\t\toffset *= clip.w;\n\n\t\t\tclip.xy += offset;\n\n\t\t\tgl_Position = clip;\n\t\t\t\n\t\t\t#include <logdepthbuf_vertex>\n\n\t\t\tvec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation\n\n\t\t}\n\t\t",fragmentShader:"\n\t\tuniform vec3 diffuse;\n\t\tuniform float opacity;\n\t\tuniform vec2 repeat;\n\t\tuniform vec2 offset;\n\t\tuniform float miny;\n\t\tuniform vec3 pcolor;\n\t\t\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashSize;\n\t\t\tuniform float gapSize;\n\n\t\t#endif\n\n\t\t\tuniform sampler2D mmap;\n\n\t\tvarying float vLineDistance;\n\n\t\t#include <common>\n\t\t#include <color_pars_fragment>\n\n\t\tvarying float uvScale;\n\t\tvarying vec2 vUv;\n\t\tvarying vec2 vUv2;\n\t\t\n\t\t#include <logdepthbuf_pars_fragment>\n\n\t\tvoid main() {\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tif ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps\n\n\t\t\t\tif ( mod( vLineDistance, dashSize + gapSize ) > dashSize ) discard; // todo - FIX\n\n\t\t\t#endif\n\n\t\t\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t\t\t\n\t\t\t#include <logdepthbuf_fragment>\n\t\n\t\t\t#ifdef USE_MMAP\n\t\t\t\n\t\t\t\tif(vUv2.y >= miny && miny != 1.0){\t\t\t\n\t\t\t\t    vec4 texColor = texture2D( mmap, vUv2 * repeat + offset );\n\t\t\t\t\tdiffuseColor = vec4(texColor.xyz,min(texColor.w, opacity));\n\t\t\t\t}else{\n\t\t\t\t\tdiffuseColor = vec4(pcolor,opacity);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t#endif\n\n\t\t\tgl_FragColor = diffuseColor;\n\n\t\t\t#include <encodings_fragment>\n\n\t\t}\n\t\t"};Fi=function(t){cr.call(this,{type:"FMLineMaterial",uniforms:or.clone(ar.line.uniforms),vertexShader:ar.line.vertexShader,fragmentShader:ar.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)};((Fi.prototype=Object.create(cr.prototype)).constructor=Fi).prototype.isFMLineMaterial=!0,Fi.prototype.copy=function(t){return cr.prototype.copy.call(this,t),this.color.copy(t.color),this.lineWidth=t.lineWidth,this.resolution=t.resolution,this};var Jh=Fi;function Qh(t){tr.call(this),this.type="SpriteMaterial",this.color=new _i(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.setValues(t)}function $h(t){cr.call(this,t),this.type="RawShaderMaterial"}((Qh.prototype=Object.create(tr.prototype)).constructor=Qh).prototype.isSpriteMaterial=!0,Qh.prototype.copy=function(t){return tr.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},(($h.prototype=Object.create(cr.prototype)).constructor=$h).prototype.isRawShaderMaterial=!0;e=function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),this.co=!1,this.fo=new Map,this.do=new Map};Object.assign(e.prototype,{vo:function(t,n){this.do.has(t)||this.do.set(t,new Set),this.do.get(t).add(n)},mi:function(){this.fo.clear(),this.fo=null,this.do.clear(),this.do=null}});var tc=e;function nc(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var ec=function(){function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t)}var n,e,i;return n=t,i=[{key:"getBrowser",value:function(){var t=navigator.userAgent,n=-1<t.indexOf("Opera"),e=-1<t.indexOf("compatible")&&-1<t.indexOf("MSIE")&&!n,i=-1<t.indexOf("Edge"),r=-1<t.indexOf("Firefox"),o=-1<t.indexOf("Safari")&&-1===t.indexOf("Chrome"),s=-1<t.indexOf("Chrome")&&-1<t.indexOf("Safari");if(e){new RegExp("MSIE (\\d+\\.\\d+);").test(t);t=parseFloat(RegExp.$1);return 7===t?"IE7":8===t?"IE8":9===t?"IE9":10===t?"IE10":11===t?"IE11":"IE"}return n?"Opera":i?"Edge":r?"FF":o?"Safari":s?"Chrome":void 0}}],(e=null)&&nc(n.prototype,e),i&&nc(n,i),t}().getBrowser();function ic(t){return(ic="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function rc(t,n){return(rc=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function oc(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=sc(e);return t=i?(t=sc(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==ic(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function sc(t){return(sc=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}Ji=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&rc(t,n)}(n,tc);var t=oc(n);function n(){return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,n),t.call(this)}return n}();Object.assign(Ji.prototype,{po:function(t,n){var e;return this.fo.has(t)?(e=this.fo.get(t),n&&(e.isComplete?e.isError?n(null):n(e):this.vo(t,n))):e=this.mo(t,n),e},mo:function(n,t){var e=this,i=new Image;return i.crossOrigin="Anonymous",i.onload="IE11"===ec?new function(){i.isComplete=!0,e.go(n,i)}:function(){i.isComplete=!0,e.go(n,i)},i.onerror=function(t){i.isComplete=!0,i.isError=!0,e.go(n,null)},i.src=n,i.isComplete=!1,this.fo.set(n,i),t&&this.vo(n,t),i},go:function(t,i){this.do.has(t)&&(this.do.get(t).forEach(function(t,n,e){n(i),e.delete(t)}),this.do.delete(t))},mi:function(){this.fo.clear(),this.do.clear()}});var ac=new Ji,uc={Left:0,Center:2,Right:4};function hc(t,n){var e;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(e=function(t,n){if(t){if("string"==typeof t)return cc(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(e="Object"===e&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?cc(t,n):void 0}}(t))||n&&t&&"number"==typeof t.length){e&&(t=e);var i=0,n=function(){};return{s:n,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o=!0,s=!1;return{s:function(){e=t[Symbol.iterator]()},n:function(){var t=e.next();return o=t.done,t},e:function(t){s=!0,r=t},f:function(){try{o||null==e.return||e.return()}finally{if(s)throw r}}}}function cc(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}pr=function t(n){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),this.Jn=n};Object.assign(pr.prototype,{yo:function(t,n,e,i,r){var o=r,s={x:r.x+n,y:r.y},a={x:r.x,y:r.y+e},u={x:r.x+n,y:r.y+e},h={x:o.x+i,y:o.y},c={x:s.x-i,y:s.y},f={x:s.x,y:s.y+i},l={x:u.x,y:u.y-i},d={x:u.x-i,y:u.y},n={x:a.x+i,y:a.y},r={x:a.x,y:a.y-i},e={x:o.x,y:o.y+i};t.beginPath(),t.moveTo(h.x,h.y),t.lineTo(c.x,c.y),t.arcTo(s.x,s.y,f.x,f.y,i),t.lineTo(l.x,l.y),t.arcTo(u.x,u.y,d.x,d.y,i),t.lineTo(n.x,n.y),t.arcTo(a.x,a.y,r.x,r.y,i),t.lineTo(e.x,e.y),t.arcTo(o.x,o.y,h.x,h.y,i),t.closePath()},bo:function(t,n,e,i){var r=void 0!==i.needSize&&i.needSize,o=this._o(i.family),s=4,a=0,u=0,h=2*e.fontsize*1.2,c=h+"px "+o,f=1.2*e.fontsize*2,l=1;n||(f=0,s=10);var d=document.createElement("canvas"),v=d.getContext("2d");v.font=c;var p=-1<t.indexOf("%rn%"),m=0,g=0,o=h/3;if(v.textBaseline="Alphabetic",p){var y,b,_=hc(y=t.split("%rn%"));try{for(_.s();!(b=_.n()).done;){var w=b.value,a=Math.max(v.measureText(w).width,a);u+=h}}catch(t){_.e(t)}finally{_.f()}u+=4*y.length;var x,M=a+s+f+12,l=(x=Math.max(u,f)+12)/(12+h),g=u/y.length/2+o+6}else M=12+f+s+(a=v.measureText(t).width),m=(x=12+Math.max(h,f))/2+o;d.spriteScale=l,d.width=M,d.height=x,d.style.width=M+"px",d.style.height=x+"px",v.clearRect(0,0,d.width,d.height),(e.plateColor||e.plateStrokeColor)&&(e.plateColor&&(v.fillStyle=e.plateColor),v.lineWidth=2,this.yo(v,M-f,x,10,{x:f,y:0}),e.plateColor&&v.fill(),e.plateStrokeColor&&(v.strokeStyle=e.plateStrokeColor,v.stroke()),v.beginPath()),n&&v.drawImage(n,6,(x-f)/2,f,f);var S=f+s;v.font=c;v.lineWidth=4*(void 0!==e.strokeWidth?e.strokeWidth:1);c=1;if(void 0!==e.strokeWidth&&(c=parseFloat(e.strokeWidth)),e.strokeColor&&0!==c)if(v.strokeStyle=e.strokeColor,p)for(var E=g,T=0;T<y.length;T++)T&&(E+=4+h),n?v.strokeText(y[T],S,E):i.textAlign===uc.Left?(v.textAlign="left",v.strokeText(y[T],0,E)):i.textAlign===uc.Right?(v.textAlign="right",v.strokeText(y[T],M,E)):(v.textAlign="center",v.strokeText(y[T],M/2,E));else n?v.strokeText(t,S,m):i.textAlign===uc.Left?v.strokeText(t,0,m):i.textAlign===uc.Right?(v.textAlign="right",v.strokeText(t,M,m)):(v.textAlign="center",v.strokeText(t,M/2,m));if(v.fillStyle=e.fillColor,p)for(var L=g,R=0;R<y.length;R++)R&&(L+=4+h),n?v.fillText(y[R],S,L):i.textAlign===uc.Left?(v.textAlign="left",v.fillText(y[R],0,L)):i.textAlign===uc.Right?(v.textAlign="right",v.fillText(y[R],M,L)):(v.textAlign="center",v.fillText(y[R],M/2,L));else n?v.fillText(t,S,m):i.textAlign===uc.Left?(v.textAlign="left",v.fillText(t,0,m)):i.textAlign===uc.Right?(v.textAlign="right",v.fillText(t,M,m)):(v.textAlign="center",v.fillText(t,M/2,m));m=0;return r&&(m=p?e.fontsize+(4*(y.length-1)+6)/y.length:e.fontsize+6,d.size=m),d},wo:function(t){var n=t.width,e=t.height,i=t.arrowWidth||10,r=document.createElement("canvas"),o=r.getContext("2d");r.width=n,r.height=e,r.style.width=n+"px",r.style.height=e+"px",o.fillStyle=t.godEdgeColor,o.fillRect(0,0,n,e);var s=n*(1-t.godEdgePercent);o.fillStyle=t.godColor,o.fillRect((n-s)/2,0,s,e),o.fillStyle="#ffffff",o.shadowOffsetX=-2,o.shadowOffsetY=2,o.shadowBlur=4,o.shadowColor="rgba(0,0,0,0.5)";var a=e*t.godArrowPercent,s=s*t.godArrowWidthPercent,n=n/2-s/2,e=e/2+a/2;return o.beginPath(),o.moveTo(n,e),o.lineTo(n,e+i),o.lineTo(n+s/2,e-a+i),o.lineTo(n+s,e+i),o.lineTo(n+s,e),o.lineTo(n+s/2,e-a),o.closePath(),o.fillStyle=t.godArrowColor,o.fill(),r},xo:function(t){var n=t.width,e=t.height,i=document.createElement("canvas"),r=i.getContext("2d");i.width=n,i.height=e,i.style.width=n+"px",i.style.height=e+"px";var o=new x;o.set(Math.cos(Math.PI/2),-Math.sin(Math.PI/2),+n/2,Math.sin(Math.PI/2),Math.cos(Math.PI/2),+e/2,0,0,1);var s=new x;s.set(1,0,-n/2,0,1,-e/2,0,0,1),o.multiply(s);e=o.elements;r.transform(e[0],e[3],e[1],e[4],e[2],e[6]);s=t.height*t.arrowHeightPercent,o=(1-t.arrowHeightPercent)*t.height/2,e=t.width*(t.arrowWidthPercent-t.arrowPercent);return r.beginPath(),r.moveTo(0,o),r.lineTo(e,o),r.lineTo(t.width*t.arrowWidthPercent,o+s/2),r.lineTo(e,o+s),r.lineTo(0,o+s),r.lineTo(t.width*t.arrowPercent,o+s/2),r.closePath(),r.fillStyle=t.color,r.fill(),i},Mo:function(e){var t=e.width,n=e.height,i=e.dashArray,r=document.createElement("canvas"),o=r.getContext("2d");r.width=t,r.height=n,r.style.width=t+"px",r.style.height=n+"px";var s=new x;s.set(Math.cos(Math.PI/2),-Math.sin(Math.PI/2),+t/2,Math.sin(Math.PI/2),Math.cos(Math.PI/2),+n/2,0,0,1);var a=new x;a.set(1,0,-t/2,0,1,-n/2,0,0,1),s.multiply(a);s=s.elements;o.transform(s[0],s[3],s[1],s[4],s[2],s[6]);var u=i.reduce(function(t,n){return t+n}),h=0;return i.forEach(function(t,n){n%2==0&&(o.fillStyle=e.color,o.fillRect(h/u*e.width,0,t/u*e.width,e.height)),h+=t}),r},_o:function(t){var n=this.Jn.Zt;return void 0!==t?t+","+n.jt.fontFamily:n.jt.fontFamily},ct:function(){}});var fc=pr;function lc(t){return(lc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function dc(t,n){return(dc=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function vc(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=pc(e);return t=i?(t=pc(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==lc(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function pc(t){return(pc=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}br=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&dc(t,n)}(n,tc);var t=vc(n);function n(){return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,n),t.call(this)}return n}();Object.assign(br.prototype,{So:function(t){var n,e=[];for(n in t)e.push(t[n]);return e.join()}});var mc=br;function gc(t){return(gc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function yc(t,n){return(yc=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function bc(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=_c(e);return t=i?(t=_c(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==gc(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function _c(t){return(_c=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}di=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&yc(t,n)}(n,mc);var t=bc(n);function n(){return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,n),t.call(this)}return n}();Object.assign(di.prototype,{Eo:function(t){t=new Ru(t);return t.minFilter=On,t.generateMipmaps=!1,t.needsUpdate=!0,t},To:function(t){var n=new xr;return n.minFilter=On,n.generateMipmaps=!1,n.flipY=t.flipY,n},Lo:function(t,n){var r,e=this;void 0===t.flipY&&(t.flipY=!0);var o=this.So(t);return this.fo.has(o)?this.do.has(o)?this.vo(o,n):n(r=this.fo.get(o)):(r=this.To(t),this.fo.set(o,r),this.vo(o,n),ac.po(t.url,function(i){r.image=i,r.needsUpdate=!0,e.do.get(o).forEach(function(t,n,e){i&&n(r),e.delete(t)}),e.do.delete(o)})),r},Ro:function(t,n){var e=this.Eo(t);return e.scaleRatio=t.height/t.width,e.mspriteScale=t.spriteScale,n.needSize&&(e.size=t.size),e},ct:function(){this.fo.forEach(function(t,n,e){t.dispose(),e.delete(n)}),this.fo.clear(),this.fo=null,this.do.forEach(function(t,n,e){n.forEach(function(t,n,e){t.dispose(),e.delete(n)}),e.delete(t)}),this.do.clear(),this.do=null}});var wc=di;sr.fmcommon={diffuse:{value:new _i(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new x}},ar.fmLambert={uniforms:or.merge([sr.fmcommon,sr.lights,{emissive:{value:new _i(0)},mapMixColor:{value:!1}}]),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\nvoid main() {\n\n\t#include <uv_vertex>    \n\n\t#include <beginnormal_vertex>    \n\t#include <morphnormal_vertex>    \n\t#include <defaultnormal_vertex>  \n\n\t#include <begin_vertex>            \n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>         \n\n\t#include <worldpos_vertex>        \n\t#include <lights_lambert_vertex>  \n}\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\nvoid main() {\n\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\n    #include <logdepthbuf_fragment>\n\t#include <map_fragment_1>         \n\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}\n"};pi=function(t){cr.call(this),this.type="FMMeshLambertMaterial",this.uniforms=or.clone(ar.fmLambert.uniforms),this.vertexShader=ar.fmLambert.vertexShader,this.fragmentShader=ar.fmLambert.fragmentShader,this.lights=!0,Object.defineProperties(this,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(t){this.uniforms.diffuse.value=t}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(t){this.uniforms.opacity.value=t}},emissive:{enumerable:!0,get:function(){return this.uniforms.emissive.value},set:function(t){this.uniforms.emissive.value=t}},map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(t){this.uniforms.map.value=t}},mapMixColor:{enumerable:!0,get:function(){return this.uniforms.mapMixColor.value},set:function(t){this.uniforms.mapMixColor.value=t}}}),this.setValues(t)};((pi.prototype=Object.create(cr.prototype)).constructor=pi).prototype.isFMMeshLambertMaterial=!0,pi.prototype.copy=function(t){return cr.prototype.copy.call(this,t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=or.clone(t.uniforms),this.lights=t.lights,this};var xc=pi;function Mc(t){cr.call(this),this.type="FMMeshBasicMaterial",this.uniforms=or.clone(ar.fmBasic.uniforms),this.vertexShader=ar.fmBasic.vertexShader,this.fragmentShader=ar.fmBasic.fragmentShader,Object.defineProperties(this,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(t){this.uniforms.diffuse.value=t}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(t){this.uniforms.opacity.value=t}},map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(t){this.uniforms.map.value=t}}}),this.setValues(t)}sr.fmcommon={diffuse:{value:new _i(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new x}},ar.fmBasic={uniforms:or.merge([sr.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"},((Mc.prototype=Object.create(cr.prototype)).constructor=Mc).prototype.isFMMeshBasicMaterial=!0,Mc.prototype.copy=function(t){return cr.prototype.copy.call(this,t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=or.clone(t.uniforms),this};Li=function t(n){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),this.Zt=n,this.Oo=new fc(this),this.Ao=new wc,this.Co={},this.ko=new Map,this.Po=new Map,this.Do=new Map,this.jo=new Map,this.Io=new Map,this.No=new Map};Object.assign(Li.prototype,{Fo:function(t){var n,e=[];for(n in t)t[n]?t[n].constructor===xr?e.push(t[n].uuid):t[n].constructor===ci?(e.push(t[n].x),e.push(t[n].y)):e.push(t[n]):e.push(t[n]);return e.join()},Uo:function(t,n){var e=this.Fo(t);return this.ko.has(e)||(n=this.Bo(t,n),this.ko.set(e,n)),this.ko.get(e)},Bo:function(t,n){var e=new Mc;void 0!==t.color&&(e.color=new _i(t.color)),void 0!==t.opacity&&(e.opacity=t.opacity),void 0!==t.url&&this.Ao.Lo({url:t.url,flipY:t.flipY},function(t){t.image&&(e.map=t,e.needsUpdate=!0),n&&n()});t=void 0!==t.needDepth&&t.needDepth;return e.transparent=!0,e.depthTest=t,e.depthWrite=t,e},Go:function(t){var n=this.Fo(t);return this.Po.has(n)||(t=this.Ho(t),this.Po.set(n,t)),this.Po.get(n)},Kn:function(t){var n=this.Fo(t);return this.Io.has(n)||(t=this.Vo(t),this.Io.set(n,t)),this.Io.get(n)},Vo:function(t){var n=new mr;return n.defines.USE_UV=!0,n.uniforms.diffuse.value=new _i(t.color),n.uniforms.emissive.value=new _i(t.emissive),n.uniforms.metalness.value=t.metalness,n.uniforms.roughness.value=t.roughness,n.uniforms.normalScale.value=t.normalScale,n.defines.USE_EMISSIVEMAP=t.USE_EMISSIVEMAP,n.uniforms.emissiveMap.value=t.emissiveMap,n.defines.USE_MAP=t.USE_MAP,n.uniforms.map.value=t.map,n.transparent=t.transparent,n.uniforms.opacity.value=t.opacity,n.skinning=t.skinning,n.side=t.side,n.vertexColors=t.vertexColors,n.needsUpdate=!0,n},Qn:function(t,n){(n=n||{}).uuid=t.uuid;var e=this.Fo(n);return this.No.has(e)||(t=t.clone(),n.color&&(t.color=new _i(n.color)),n.opacity&&(t.opacity=n.opacity),n.transparent&&(t.transparent=n.transparent),this.No.set(e,t)),this.No.get(e)},Ho:function(n){var e=new xc;return e.color=new _i(n.color),e.opacity=n.alpha,e.transparent=e.opacity<1,void 0!==n.url&&this.Ao.Lo({url:n.url},function(t){t.image&&(e.map=t,e.needsUpdate=!0),n.finish&&n.finish(e)}),e},zo:function(t){var n=void 0===t.needDepth||t.needDepth,t=new Jh({color:t.color,opacity:t.opacity,lineWidth:t.lineWidth,vertexColors:2,dashed:!1,transparent:!0});t.depthWrite=n,t.depthTest=n;n=this.Zt.V;return t.resolution.set(n.an.renderer.domElement.clientWidth,n.an.renderer.domElement.clientHeight),t},Wo:function(t){var n=this.Fo(t);return this.Do.has(n)||(t=this.zo(t),this.Do.set(n,t)),this.Do.get(n)},Xo:function(t,n,e){var i=new Qh;i.sizeAttenuation=!1,i.depthTest=!1,i.depthWrite=!1,i.transparent=!0,i.opacity=e.opacity,i.side=Ot;n=this.Zo(t,null,n,e);return i.map=n,e.needSize&&(i.size=n.size),i.userData.scaleRatio=n.scaleRatio,i.userData.mspriteScale=n.mspriteScale,i.needsUpdate=!0,i},Yo:function(n,e,i,r){var t,o=this,s=new Qh;return s.sizeAttenuation=!1,s.depthTest=!1,s.depthWrite=!1,s.side=Ot,s.opacity=i.opacity,s.transparent=!0,i.imageUrl?(s.visible=!1,ac.po(i.imageUrl,function(t){t=o.Zo(n,t,e,i);s.map=t,s.visible=!0,s.needsUpdate=!0,s.userData.scaleRatio=t.scaleRatio,s.userData.mspriteScale=t.mspriteScale,r&&r(s)})):(t=this.Zo(n,null,e,i),s.map=t,s.needsUpdate=!0,s.userData.scaleRatio=t.scaleRatio,s.userData.mspriteScale=t.mspriteScale,r&&r(s)),s},Zo:function(t,n,e,i){e=this.Oo.bo(t,n,e,i);return this.Ao.Ro(e,{needSize:i.needSize})},qo:function(t,n){var e=this.Fo(t);return this.jo.has(e)||(t=this.Ko(t,n),this.jo.set(e,t)),n&&n(this.jo.get(e)),this.jo.get(e)},Ko:function(t,n){var e=void 0!==t.opacity?t.opacity:1,i=new Qh;return i.sizeAttenuation=!1,i.depthTest=t.needDepth,i.depthWrite=t.needDepth,i.transparent=!0,i.opacity=e,i.visible=!1,this.Ao.Lo({url:t.url},function(t){t.image&&(i.map=t,i.needsUpdate=!0,i.visible=!0,i.userData.scaleRatio=t.image.width/t.image.height),n&&n(i)}),i},createArrowWidthBackTexture:function(t){return new Ru(this.Oo.wo(t))},createNormalLineTexture:function(t){return new Ru(this.Oo.Mo(t))},Jo:function(t){return new Ru(this.Oo.xo(t))},Qo:function(t,n){if(this.Co[t+n])return this.Co[t+n];var e=new $h({uniforms:{color:{value:new _i(t)},alpha:{value:n}},vertexShader:"\nprecision mediump float;\nprecision mediump int;\n\nattribute vec3 position;\n\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\n\nvoid main() {\n  gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n ",fragmentShader:"\nprecision mediump float;\nprecision mediump int;\n\nuniform vec3 color;\nuniform float alpha;\n\nvoid main() {\n    gl_FragColor = vec4(color,alpha);\n}\n "});return e.transparent=!0,this.Co[t+n]=e},$o:function(t,n){n=new cr({uniforms:{color:{value:new _i(t)},alpha:{value:n}},vertexShader:"\nattribute float gradientAlpha;\n\nvarying float v_gradientAlpha;\n\nvoid main() {\n  v_gradientAlpha = gradientAlpha;\n  gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n ",fragmentShader:"\n\nuniform vec3 color;\nuniform float alpha;\n\nvarying float v_gradientAlpha;\n\nvoid main() {\n  gl_FragColor = vec4(color, alpha * v_gradientAlpha);\n}\n "});return n.depthTest=!0,n.depthWrite=!1,n.transparent=!0,n},ts:function(t,n){var e=new xr;return e.minFilter=On,e.generateMipmaps=!1,e.anisotropy=4,e.wrapS=Mn,e.wrapT=Mn,ac.po(t,function(t){e.image=t,e.needsUpdate=!0,n(e)}),e},ct:function(){ac.mi(),this.Oo.ct(),this.Oo=null,this.Ao.ct(),this.Ao=null,this.ko.clear(),this.Po.clear(),this.Do.clear(),this.jo.clear()}});var Sc=Li;Oi=function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t)};Object.assign(Oi.prototype,{ji:function(t,n,e,i){new Zu({method:"GET",url:t+n+"/"+n+".theme"}).ji(function(t){e&&e(t)},function(t){i&&i(t===Vu.PATH_ERROR?Vu.THEME_ID_URL_ERROR:t)})}});var Ec=new Oi;function Tc(t,n){var e;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(e=function(t,n){if(t){if("string"==typeof t)return Lc(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(e="Object"===e&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Lc(t,n):void 0}}(t))||n&&t&&"number"==typeof t.length){e&&(t=e);var i=0,n=function(){};return{s:n,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o=!0,s=!1;return{s:function(){e=t[Symbol.iterator]()},n:function(){var t=e.next();return o=t.done,t},e:function(t){s=!0,r=t},f:function(){try{o||null==e.return||e.return()}finally{if(s)throw r}}}}function Lc(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 Rc(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}Fi=function(){function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),this.ns={clearColor:16777215,clearAlpha:1},this.es=new Map,this.rs=new Map,this.ss=new Map,this.as=new Map,this.us=new Map,this.hs=new Map,this.cs=new Map,this.ls=new Map,this.ds=new Map,this.vs=new Map,this.ps=new Map,this.ms=new Map,this.gs=new Map,this.ys=null}var n,e,i;return n=t,(e=[{key:"resize",value:function(){this.ns={clearColor:16777215,clearAlpha:1},this.es.clear(),this.rs.clear(),this.ss.clear(),this.as.clear(),this.us.clear(),this.hs.clear(),this.cs.clear(),this.ls.clear(),this.ds.clear(),this.vs.clear(),this.ps.clear(),this.ms.clear(),this.gs.clear()}}])&&Rc(n.prototype,e),i&&Rc(n,i),t}();Object.assign(Fi.prototype,{bt: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=Ei.toColor(o);break;case"toFloat":o=parseFloat(o);break;case"toRgba":o=Ei.toRgba(o);break;case"toString":o+=""}e[r].name?(t[e[r].name]=o,delete t[r]):t[r]=o}}return t},bs: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._s(t),this.ws(t.extenttheme,Di.EXTENT),this.ws(t.storetheme,Di.MODEL),this.xs(t.floorapply,Di.MODEL),this.Ms(t.storeapply,Di.MODEL),this.ws(t.storelabeltheme,Di.LABEL),this.xs(t.floorstorelabelapply,Di.LABEL),this.Ms(t.storelabelapply,Di.LABEL),this.ws(t.poiimagetheme,Di.FACILITY),this.xs(t.floorpoiimageapply,Di.FACILITY),this.Ms(t.poiimageapply,Di.FACILITY),this.ws(t.externalmodeltheme,Di.EXTERNAL_MODEL),this.xs(t.floorexternalapply,Di.EXTERNAL_MODEL),this.Ms(t.externalmodelapply,Di.EXTERNAL_MODEL),this.Ss())},_s:function(t){t.viewtheme&&((t=t.viewtheme).clearcolor&&(this.ns.clearColor=Ei.toColor(t.clearcolor)),t.clearalpha&&(this.ns.clearAlpha=parseFloat(t.clearalpha)))},ws:function(t,n){if(t){var e,i=Tc(t);try{for(i.s();!(e=i.n()).done;){var r=e.value;if(r.id)switch(n){case Di.EXTERNAL_MODEL:this.ps.set(r.id,this.bt({},r,{color:{type:"toColor"}}));break;case Di.FACILITY:if(!r.imagename)break;this.ls.set(r.id,this.bt({},r,{imagename:{name:"imageName"}}));break;case Di.LABEL:this.us.set(r.id,this.bt({},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"}}));break;case Di.MODEL:this.es.set(r.id,this.bt({},r,{color:{type:"toColor"},alpha:{type:"toFloat"},strokecolor:{name:"strokeColor",type:"toColor"},strokewidth:{name:"strokeWidth"}}));break;case Di.EXTENT:this.as.set(r.id,this.bt({},r,{color:{type:"toColor"},alpha:{type:"toFloat"}}))}}}catch(t){i.e(t)}finally{i.f()}}},xs:function(t,n){if(t){var e,i=Tc(t);try{for(i.s();!(e=i.n()).done;){var r,o=Tc(e.value.typeapply);try{for(o.s();!(r=o.n()).done;){var s,a=r.value,u=this.bt({},a,{normalid:{name:"normalID",type:"toString"},selectedid:{name:"selectID",type:"toString"}}),h=Tc(a.type.split(","));try{for(h.s();!(s=h.n()).done;){var c=s.value;this.Es(n).set(c,u)}}catch(t){h.e(t)}finally{h.f()}}}catch(t){o.e(t)}finally{o.f()}}}catch(t){i.e(t)}finally{i.f()}}},Ms:function(t,n){if(t){var e,i=Tc(t);try{for(i.s();!(e=i.n()).done;){var r=e.value;if(r.fids){var o,s=this.bt({},r,{normalid:{name:"normalID",type:"toString"},selectedid:{name:"selectID",type:"toString"}}),a=Tc(r.fids.split(","));try{for(a.s();!(o=a.n()).done;){var u=o.value;this.Ts(n).set(u,s)}}catch(t){a.e(t)}finally{a.f()}}}}catch(t){i.e(t)}finally{i.f()}}},Ss:function(){this.rs.get("0")&&this.es.get(this.rs.get("0").selectID)&&(this.ys=this.es.get(this.rs.get("0").selectID).color)},Ts:function(t){switch(t){case Di.LABEL:return this.cs;case Di.FACILITY:return this.vs;case Di.MODEL:return this.ss;case Di.EXTERNAL_MODEL:return this.gs}},Es:function(t){switch(t){case Di.LABEL:return this.hs;case Di.FACILITY:return this.ds;case Di.MODEL:return this.rs;case Di.EXTERNAL_MODEL:return this.ms}},Ls:function(t){switch(t){case Di.LABEL:return this.us;case Di.FACILITY:return this.ls;case Di.MODEL:return this.es;case Di.EXTERNAL_MODEL:return this.ps}}});var Oc=Fi;function Ac(t){return(Ac="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 Cc(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function kc(t,n,e){return(kc="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,n,e){t=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=jc(t)););return t}(t,n);if(t){n=Object.getOwnPropertyDescriptor(t,n);return n.get?n.get.call(e):n.value}})(t,n,e||t)}function Pc(t,n){return(Pc=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Dc(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=jc(e);return t=i?(t=jc(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Ac(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function jc(t){return(jc=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Ic=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Pc(t,n)}(r,Oc);var t,n,e,i=Dc(r);function r(){var t;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(t=i.call(this)).ns={},t}return t=r,(n=[{key:"resize",value:function(){kc(jc(r.prototype),"resize",this).call(this),this.ns={}}}])&&Cc(t.prototype,n),e&&Cc(t,e),r}();e=function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),this.Rs=new Oc,this.Os=new Ic};Object.assign(e.prototype,{Jr:function(t,n,e){var i=this;Ec.ji(t,n,function(t){i.bs(t),e(!0)})},bs:function(t){this.Rs.bs(t)},As:function(t){this.Os.bs(t=t||{})},Cs:function(){return Object.assign({},this.Rs.ns,this.Os.ns)},ks:function(){return Object.assign({},this.Rs.as.get("0"),this.Os.as.get("0"))},Ps:function(t){return this.Ds(Di.MODEL,t)},js:function(t){return this.Ds(Di.FACILITY,t)},Is:function(t){return this.Ds(Di.LABEL,t)},Ns:function(t){return this.Ds(Di.EXTERNAL_MODEL,t)},Ds:function(t,n){var e={},i={},r=this.Os.Ts(t).get(n.fid),o=this.Rs.Ts(t).get(n.fid);if(r||o){var s=(r&&void 0!==r.normalID?r:o).normalID,a=this.Os.Ls(t).get(s),s=this.Rs.Ls(t).get(s);if(a||s)return Object.assign(i,s,a,o,r)}return r=this.Os.Es(t).get(n.typeID),o=this.Rs.Es(t).get(n.typeID),(r||o)&&Object.assign(e,o,r),e.normalID||(r=this.Os.Es(t).get("0"),o=this.Rs.Es(t).get("0"),Object.assign(e,r,o)),a=this.Os.Ls(t).get(e.normalID),s=this.Rs.Ls(t).get(e.normalID),Object.assign(i,s,a)},Fs:function(){return this.Os.ys||this.Rs.ys}});var Nc=e;function Fc(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}}var Uc=new Fc,Bc=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}},Gc=function(t){var n=t.lastIndexOf("/");return-1===n?"./":t.substr(0,n+1)},Hc={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 Vc(t){af.call(this,t)}function zc(t){af.call(this,t)}function Wc(t){tr.call(this),this.type="ShadowMaterial",this.color=new _i(0),this.transparent=!0,this.setValues(t)}function Xc(t){tr.call(this),this.type="PointsMaterial",this.color=new _i(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.setValues(t)}function Zc(t){nr.call(this),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.clearcoat=0,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new ci(1,1),this.clearcoatNormalMap=null,this.reflectivity=.5,this.sheen=null,this.transparency=0,this.setValues(t)}function Yc(t){tr.call(this),this.type="MeshPhongMaterial",this.color=new _i(16777215),this.specular=new _i(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new _i(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ri,this.normalScale=new ci(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=an,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 qc(t){tr.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new _i(16777215),this.specular=new _i(1118481),this.shininess=30,this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new _i(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ri,this.normalScale=new ci(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 Kc(t){tr.call(this),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ri,this.normalScale=new ci(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 Jc(t){tr.call(this),this.type="MeshLambertMaterial",this.color=new _i(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new _i(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=an,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 Qc(t){tr.call(this),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new _i(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ri,this.normalScale=new ci(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 $c(t){tr.call(this),this.type="LineBasicMaterial",this.color=new _i(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.setValues(t)}function tf(t){$c.call(this),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}function nf(t){af.call(this,t),this.textures={}}Vc.prototype=Object.assign(Object.create(af.prototype),{constructor:Vc,load:function(n,t,e,i){void 0!==this.path&&(n=this.path+n),n=this.manager.resolveURL(n);var r=this,o=Hc.get(n);if(void 0!==o)return r.manager.itemStart(n),setTimeout(function(){t&&t(o),r.manager.itemEnd(n)},0),o;var s=document.createElementNS("http://www.w3.org/1999/xhtml","img");function a(){s.removeEventListener("load",a,!1),s.removeEventListener("error",u,!1),Hc.add(n,this),t&&t(this),r.manager.itemEnd(n)}function u(t){s.removeEventListener("load",a,!1),s.removeEventListener("error",u,!1),i&&i(t),r.manager.itemError(n),r.manager.itemEnd(n)}return s.addEventListener("load",a,!1),s.addEventListener("error",u,!1),"data:"!==n.substr(0,5)&&void 0!==this.crossOrigin&&(s.crossOrigin=this.crossOrigin),r.manager.itemStart(n),s.src=n,s}}),zc.prototype=Object.assign(Object.create(af.prototype),{constructor:zc,load:function(n,e,t,i){var r=new xr,o=new Vc(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?Wn:Xn,r.needsUpdate=!0,void 0!==e&&e(r)},t,i),r}}),((Wc.prototype=Object.create(tr.prototype)).constructor=Wc).prototype.isShadowMaterial=!0,Wc.prototype.copy=function(t){return tr.prototype.copy.call(this,t),this.color.copy(t.color),this},((Xc.prototype=Object.create(tr.prototype)).constructor=Xc).prototype.isPointsMaterial=!0,Xc.prototype.copy=function(t){return tr.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},((Zc.prototype=Object.create(nr.prototype)).constructor=Zc).prototype.isMeshPhysicalMaterial=!0,Zc.prototype.copy=function(t){return nr.prototype.copy.call(this,t),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=t.clearcoat,this.clearcoatMap=t.clearcoatMap,this.clearcoatRoughness=t.clearcoatRoughness,this.clearcoatRoughnessMap=t.clearcoatRoughnessMap,this.clearcoatNormalMap=t.clearcoatNormalMap,this.clearcoatNormalScale.copy(t.clearcoatNormalScale),this.reflectivity=t.reflectivity,t.sheen?this.sheen=(this.sheen||new _i).copy(t.sheen):this.sheen=null,this.transparency=t.transparency,this},((Yc.prototype=Object.create(tr.prototype)).constructor=Yc).prototype.isMeshPhongMaterial=!0,Yc.prototype.copy=function(t){return tr.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},((qc.prototype=Object.create(tr.prototype)).constructor=qc).prototype.isMeshToonMaterial=!0,qc.prototype.copy=function(t){return tr.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},((Kc.prototype=Object.create(tr.prototype)).constructor=Kc).prototype.isMeshNormalMaterial=!0,Kc.prototype.copy=function(t){return tr.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},((Jc.prototype=Object.create(tr.prototype)).constructor=Jc).prototype.isMeshLambertMaterial=!0,Jc.prototype.copy=function(t){return tr.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},((Qc.prototype=Object.create(tr.prototype)).constructor=Qc).prototype.isMeshMatcapMaterial=!0,Qc.prototype.copy=function(t){return tr.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},(($c.prototype=Object.create(tr.prototype)).constructor=$c).prototype.isLineBasicMaterial=!0,$c.prototype.copy=function(t){return tr.prototype.copy.call(this,t),this.color.copy(t.color),this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this},((tf.prototype=Object.create($c.prototype)).constructor=tf).prototype.isLineDashedMaterial=!0,tf.prototype.copy=function(t){return $c.prototype.copy.call(this,t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this},nf.prototype=Object.assign(Object.create(af.prototype),{constructor:nf,load:function(t,n,e,i){var r=this,o=new hf(r.manager);o.setPath(r.path),o.load(t,function(t){n(r.parse(JSON.parse(t)))},e,i)},parse:function(t){var n=this.textures;function e(t){return void 0===n[t]&&console.warn("THREE.MaterialLoader: Undefined texture",t),n[t]}var i,r=new u[t.type];if(void 0!==t.uuid&&(r.uuid=t.uuid),void 0!==t.name&&(r.name=t.name),void 0!==t.color&&r.color.setHex(t.color),void 0!==t.roughness&&(r.roughness=t.roughness),void 0!==t.metalness&&(r.metalness=t.metalness),void 0!==t.sheen&&(r.sheen=(new _i).setHex(t.sheen)),void 0!==t.emissive&&r.emissive.setHex(t.emissive),void 0!==t.specular&&r.specular.setHex(t.specular),void 0!==t.shininess&&(r.shininess=t.shininess),void 0!==t.clearcoat&&(r.clearcoat=t.clearcoat),void 0!==t.clearcoatRoughness&&(r.clearcoatRoughness=t.clearcoatRoughness),void 0!==t.fog&&(r.fog=t.fog),void 0!==t.flatShading&&(r.flatShading=t.flatShading),void 0!==t.blending&&(r.blending=t.blending),void 0!==t.combine&&(r.combine=t.combine),void 0!==t.side&&(r.side=t.side),void 0!==t.opacity&&(r.opacity=t.opacity),void 0!==t.transparent&&(r.transparent=t.transparent),void 0!==t.alphaTest&&(r.alphaTest=t.alphaTest),void 0!==t.depthTest&&(r.depthTest=t.depthTest),void 0!==t.depthWrite&&(r.depthWrite=t.depthWrite),void 0!==t.colorWrite&&(r.colorWrite=t.colorWrite),void 0!==t.stencilWrite&&(r.stencilWrite=t.stencilWrite),void 0!==t.stencilWriteMask&&(r.stencilWriteMask=t.stencilWriteMask),void 0!==t.stencilFunc&&(r.stencilFunc=t.stencilFunc),void 0!==t.stencilRef&&(r.stencilRef=t.stencilRef),void 0!==t.stencilFuncMask&&(r.stencilFuncMask=t.stencilFuncMask),void 0!==t.stencilFail&&(r.stencilFail=t.stencilFail),void 0!==t.stencilZFail&&(r.stencilZFail=t.stencilZFail),void 0!==t.stencilZPass&&(r.stencilZPass=t.stencilZPass),void 0!==t.wireframe&&(r.wireframe=t.wireframe),void 0!==t.wireframeLinewidth&&(r.wireframeLinewidth=t.wireframeLinewidth),void 0!==t.wireframeLinecap&&(r.wireframeLinecap=t.wireframeLinecap),void 0!==t.wireframeLinejoin&&(r.wireframeLinejoin=t.wireframeLinejoin),void 0!==t.rotation&&(r.rotation=t.rotation),1!==t.linewidth&&(r.linewidth=t.linewidth),void 0!==t.dashSize&&(r.dashSize=t.dashSize),void 0!==t.gapSize&&(r.gapSize=t.gapSize),void 0!==t.scale&&(r.scale=t.scale),void 0!==t.polygonOffset&&(r.polygonOffset=t.polygonOffset),void 0!==t.polygonOffsetFactor&&(r.polygonOffsetFactor=t.polygonOffsetFactor),void 0!==t.polygonOffsetUnits&&(r.polygonOffsetUnits=t.polygonOffsetUnits),void 0!==t.skinning&&(r.skinning=t.skinning),void 0!==t.morphTargets&&(r.morphTargets=t.morphTargets),void 0!==t.morphNormals&&(r.morphNormals=t.morphNormals),void 0!==t.dithering&&(r.dithering=t.dithering),void 0!==t.vertexTangents&&(r.vertexTangents=t.vertexTangents),void 0!==t.visible&&(r.visible=t.visible),void 0!==t.toneMapped&&(r.toneMapped=t.toneMapped),void 0!==t.userData&&(r.userData=t.userData),void 0!==t.vertexColors&&("number"==typeof t.vertexColors?r.vertexColors=0<t.vertexColors:r.vertexColors=t.vertexColors),void 0!==t.uniforms)for(var o in t.uniforms){var s=t.uniforms[o];switch(r.uniforms[o]={},s.type){case"t":r.uniforms[o].value=e(s.value);break;case"c":r.uniforms[o].value=(new _i).setHex(s.value);break;case"v2":r.uniforms[o].value=(new ci).fromArray(s.value);break;case"v3":r.uniforms[o].value=(new St).fromArray(s.value);break;case"v4":r.uniforms[o].value=(new Ci).fromArray(s.value);break;case"m3":r.uniforms[o].value=(new x).fromArray(s.value);case"m4":r.uniforms[o].value=(new Et).fromArray(s.value);break;default:r.uniforms[o].value=s.value}}if(void 0!==t.defines&&(r.defines=t.defines),void 0!==t.vertexShader&&(r.vertexShader=t.vertexShader),void 0!==t.fragmentShader&&(r.fragmentShader=t.fragmentShader),void 0!==t.extensions)for(var a in t.extensions)r.extensions[a]=t.extensions[a];return void 0!==t.shading&&(r.flatShading=1===t.shading),void 0!==t.size&&(r.size=t.size),void 0!==t.sizeAttenuation&&(r.sizeAttenuation=t.sizeAttenuation),void 0!==t.map&&(r.map=e(t.map)),void 0!==t.matcap&&(r.matcap=e(t.matcap)),void 0!==t.alphaMap&&(r.alphaMap=e(t.alphaMap)),void 0!==t.bumpMap&&(r.bumpMap=e(t.bumpMap)),void 0!==t.bumpScale&&(r.bumpScale=t.bumpScale),void 0!==t.normalMap&&(r.normalMap=e(t.normalMap)),void 0!==t.normalMapType&&(r.normalMapType=t.normalMapType),void 0!==t.normalScale&&(i=t.normalScale,!1===Array.isArray(i)&&(i=[i,i]),r.normalScale=(new ci).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 ci).fromArray(t.clearcoatNormalScale)),r},setTextures:function(t){return this.textures=t,this}});var ef,rf,of,sf;function af(t){this.manager=void 0!==t?t:Uc,this.crossOrigin="anonymous",this.path="",this.resourcePath=""}Object.assign(af.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(af.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:(ef={NoBlending:0,NormalBlending:1,AdditiveBlending:2,SubtractiveBlending:3,MultiplyBlending:4,CustomBlending:5},rf=new _i,of=new zc,sf=new nf,function(t,s,a){var u={};function n(t,n,e,i,r){var o=s+t,t=(new Fc).getHandler(o),o=null!==t?t.load(o):(of.setCrossOrigin(a),of.load(o));void 0!==n&&(o.repeat.fromArray(n),1!==n[0]&&(o.wrapS=1e3),1!==n[1]&&(o.wrapT=1e3)),void 0!==e&&o.offset.fromArray(e),void 0!==i&&("repeat"===i[0]&&(o.wrapS=1e3),"mirror"===i[0]&&(o.wrapS=1002),"repeat"===i[1]&&(o.wrapT=1e3),"mirror"===i[1]&&(o.wrapT=1002)),void 0!==r&&(o.anisotropy=r);r=Mt.generateUUID();return u[r]=o,r}var e,i={uuid:Mt.generateUUID(),type:"MeshLambertMaterial"};for(e in t){var r=t[e];switch(e){case"DbgColor":case"DbgIndex":case"opticalDensity":case"illumination":break;case"DbgName":i.name=r;break;case"blending":i.blending=ef[r];break;case"colorAmbient":case"mapAmbient":break;case"colorDiffuse":i.color=rf.fromArray(r).getHex();break;case"colorSpecular":i.specular=rf.fromArray(r).getHex();break;case"colorEmissive":i.emissive=rf.fromArray(r).getHex();break;case"specularCoef":i.shininess=r;break;case"shading":"basic"===r.toLowerCase()&&(i.type="MeshBasicMaterial"),"phong"===r.toLowerCase()&&(i.type="MeshPhongMaterial"),"standard"===r.toLowerCase()&&(i.type="MeshStandardMaterial");break;case"mapDiffuse":i.map=n(r,t.mapDiffuseRepeat,t.mapDiffuseOffset,t.mapDiffuseWrap,t.mapDiffuseAnisotropy);break;case"mapDiffuseRepeat":case"mapDiffuseOffset":case"mapDiffuseWrap":case"mapDiffuseAnisotropy":break;case"mapEmissive":i.emissiveMap=n(r,t.mapEmissiveRepeat,t.mapEmissiveOffset,t.mapEmissiveWrap,t.mapEmissiveAnisotropy);break;case"mapEmissiveRepeat":case"mapEmissiveOffset":case"mapEmissiveWrap":case"mapEmissiveAnisotropy":break;case"mapLight":i.lightMap=n(r,t.mapLightRepeat,t.mapLightOffset,t.mapLightWrap,t.mapLightAnisotropy);break;case"mapLightRepeat":case"mapLightOffset":case"mapLightWrap":case"mapLightAnisotropy":break;case"mapAO":i.aoMap=n(r,t.mapAORepeat,t.mapAOOffset,t.mapAOWrap,t.mapAOAnisotropy);break;case"mapAORepeat":case"mapAOOffset":case"mapAOWrap":case"mapAOAnisotropy":break;case"mapBump":i.bumpMap=n(r,t.mapBumpRepeat,t.mapBumpOffset,t.mapBumpWrap,t.mapBumpAnisotropy);break;case"mapBumpScale":i.bumpScale=r;break;case"mapBumpRepeat":case"mapBumpOffset":case"mapBumpWrap":case"mapBumpAnisotropy":break;case"mapNormal":i.normalMap=n(r,t.mapNormalRepeat,t.mapNormalOffset,t.mapNormalWrap,t.mapNormalAnisotropy);break;case"mapNormalFactor":i.normalScale=r;break;case"mapNormalRepeat":case"mapNormalOffset":case"mapNormalWrap":case"mapNormalAnisotropy":break;case"mapSpecular":i.specularMap=n(r,t.mapSpecularRepeat,t.mapSpecularOffset,t.mapSpecularWrap,t.mapSpecularAnisotropy);break;case"mapSpecularRepeat":case"mapSpecularOffset":case"mapSpecularWrap":case"mapSpecularAnisotropy":break;case"mapMetalness":i.metalnessMap=n(r,t.mapMetalnessRepeat,t.mapMetalnessOffset,t.mapMetalnessWrap,t.mapMetalnessAnisotropy);break;case"mapMetalnessRepeat":case"mapMetalnessOffset":case"mapMetalnessWrap":case"mapMetalnessAnisotropy":break;case"mapRoughness":i.roughnessMap=n(r,t.mapRoughnessRepeat,t.mapRoughnessOffset,t.mapRoughnessWrap,t.mapRoughnessAnisotropy);break;case"mapRoughnessRepeat":case"mapRoughnessOffset":case"mapRoughnessWrap":case"mapRoughnessAnisotropy":break;case"mapAlpha":i.alphaMap=n(r,t.mapAlphaRepeat,t.mapAlphaOffset,t.mapAlphaWrap,t.mapAlphaAnisotropy);break;case"mapAlphaRepeat":case"mapAlphaOffset":case"mapAlphaWrap":case"mapAlphaAnisotropy":break;case"flipSided":i.side=1;break;case"doubleSided":i.side=2;break;case"transparency":i.opacity=r;break;case"depthTest":case"depthWrite":case"colorWrite":case"opacity":case"reflectivity":case"transparent":case"visible":case"wireframe":i[e]=r;break;case"vertexColors":!0===r&&(i.vertexColors=2),"face"===r&&(i.vertexColors=1)}}return"MeshBasicMaterial"===i.type&&delete i.emissive,"MeshPhongMaterial"!==i.type&&delete i.specular,i.opacity<1&&(i.transparent=!0),sf.setTextures(u),sf.parse(i)})});var uf={};function hf(t){af.call(this,t)}hf.prototype=Object.assign(Object.create(af.prototype),{constructor:hf,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=Hc.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===uf[s]){var r=s.match(/^data:(.*?)(;base64)?,(.*)$/);if(r){var o=r[1],u=!!r[2],h=r[3],h=decodeURIComponent(h);u&&(h=atob(h));try{var c=(this.responseType||"").toLowerCase();switch(c){case"arraybuffer":case"blob":for(var f=new Uint8Array(h.length),l=0;l<h.length;l++)f[l]=h.charCodeAt(l);d="blob"===c?new Blob([f.buffer],{type:o}):f.buffer;break;case"document":var d=(new DOMParser).parseFromString(h,o);break;case"json":d=JSON.parse(h);break;default:d=h}setTimeout(function(){t&&t(d),a.manager.itemEnd(s)},0)}catch(t){setTimeout(function(){e&&e(t),a.manager.itemError(s),a.manager.itemEnd(s)},0)}}else{uf[s]=[],uf[s].push({onLoad:t,onProgress:n,onError:e});var v,p=new XMLHttpRequest;for(v in p.open("GET",s,!0),p.addEventListener("load",function(t){var n=this.response,e=uf[s];if(delete uf[s],200===this.status||0===this.status){0===this.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),Hc.add(s,n);for(var i=0,r=e.length;i<r;i++)(o=e[i]).onLoad&&o.onLoad(n);a.manager.itemEnd(s)}else{for(var o,i=0,r=e.length;i<r;i++)(o=e[i]).onError&&o.onError(t);a.manager.itemError(s),a.manager.itemEnd(s)}},!1),p.addEventListener("progress",function(t){for(var n=uf[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=uf[s];delete uf[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=uf[s];delete uf[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}uf[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 cf={arraySlice:function(t,n,e){return cf.isTypedArray(t)?new t.constructor(t.subarray(n,void 0!==e?e:t.length)):t.slice(n,e)},convertArray:function(t,n,e){return!t||!e&&t.constructor===n?t:"number"==typeof n.BYTES_PER_ELEMENT?new n(t):Array.prototype.slice.call(t)},isTypedArray:function(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)},getKeyframeOrder:function(e){for(var t=e.length,n=new Array(t),i=0;i!==t;++i)n[i]=i;return n.sort(function(t,n){return e[t]-e[n]}),n},sortedArray:function(t,n,e){for(var i=t.length,r=new t.constructor(i),o=0,s=0;s!==i;++o)for(var a=e[o]*n,u=0;u!==n;++u)r[s++]=t[a+u];return r},flattenJSON:function(t,n,e,i){for(var r=1,o=t[0];void 0!==o&&void 0===o[i];)o=t[r++];if(void 0!==o){var s=o[i];if(void 0!==s)if(Array.isArray(s))for(;void 0!==(s=o[i])&&(n.push(o.time),e.push.apply(e,s)),o=t[r++],void 0!==o;);else if(void 0!==s.toArray)for(;void 0!==(s=o[i])&&(n.push(o.time),s.toArray(e,e.length)),o=t[r++],void 0!==o;);else for(;void 0!==(s=o[i])&&(n.push(o.time),e.push(s)),o=t[r++],void 0!==o;);}},subclip:function(t,n,e,i,r){r=r||30;var o=t.clone();o.name=n;for(var s=[],a=0;a<o.tracks.length;++a){for(var u=o.tracks[a],h=u.getValueSize(),c=[],f=[],l=0;l<u.times.length;++l){var d=u.times[l]*r;if(!(d<e||i<=d)){c.push(u.times[l]);for(var v=0;v<h;++v)f.push(u.values[l*h+v])}}0!==c.length&&(u.times=cf.convertArray(c,u.times.constructor),u.values=cf.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 ff(t,n,e,i){this.parameterPositions=t,this.Us=0,this.resultBuffer=void 0!==i?i:new n.constructor(e),this.sampleValues=n,this.valueSize=e}function lf(t,n,e,i){ff.call(this,t,n,e,i),this.Bs=-0,this.Gs=-0,this.Hs=-0,this.Vs=-0}function df(t,n,e,i){ff.call(this,t,n,e,i)}function vf(t,n,e,i){ff.call(this,t,n,e,i)}function pf(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=cf.convertArray(n,this.TimeBufferType),this.values=cf.convertArray(e,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}function mf(t,n,e){pf.call(this,t,n,e)}function gf(t,n,e,i){pf.call(this,t,n,e,i)}function yf(t,n,e,i){pf.call(this,t,n,e,i)}function bf(t,n,e,i){ff.call(this,t,n,e,i)}function _f(t,n,e,i){pf.call(this,t,n,e,i)}function wf(t,n,e,i){pf.call(this,t,n,e,i)}function xf(t,n,e,i){pf.call(this,t,n,e,i)}function Mf(t,n,e){this.name=t,this.tracks=e,this.duration=void 0!==n?n:-1,this.uuid=Mt.generateUUID(),this.duration<0&&this.resetDuration()}function Sf(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 yf;case"vector":case"vector2":case"vector3":case"vector4":return xf;case"color":return gf;case"quaternion":return _f;case"bool":case"boolean":return mf;case"string":return wf}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+t)}(t.type);return void 0===t.times&&(cf.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 Ef(t){"boolean"==typeof t&&(console.warn("JSONLoader: showStatus parameter has been removed from constructor."),t=void 0),this.manager=void 0!==t?t:Uc,this.withCredentials=!1}Object.assign(ff.prototype,{evaluate:function(t){var n,e=this.parameterPositions,i=this.Us,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.Us=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.Us=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.Us=0,this.beforeStart_(0,t,r);if(void 0===r)return i=e.length,this.Us=i,this.afterEnd_(i-1,o,t)}this.Us=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(ff.prototype,{beforeStart_:ff.prototype.copySampleValue_,afterEnd_:ff.prototype.copySampleValue_}),lf.prototype=Object.assign(Object.create(ff.prototype),{constructor:lf,DefaultSettings_:{endingStart:We,endingEnd:We},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 Xe: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 Xe:o=t,a=2*e-n;break;case 2402:a=e+i[o=1]-i[0];break;default:o=t-1,a=n}var u=.5*(e-n),h=this.valueSize;this.Bs=u/(n-s),this.Hs=u/(a-e),this.Gs=r*h,this.Vs=o*h},interpolate_:function(t,n,e,i){for(var r=this.resultBuffer,o=this.sampleValues,s=this.valueSize,a=t*s,u=a-s,h=this.Gs,c=this.Vs,f=this.Bs,t=this.Hs,e=(e-n)/(i-n),i=e*e,n=i*e,l=-f*n+2*f*i-f*e,d=(1+f)*n+(-1.5-2*f)*i+(-.5+f)*e+1,v=(-1-t)*n+(1.5+t)*i+.5*e,p=t*n-t*i,m=0;m!==s;++m)r[m]=l*o[h+m]+d*o[u+m]+v*o[a+m]+p*o[c+m];return r}}),df.prototype=Object.assign(Object.create(ff.prototype),{constructor:df,interpolate_:function(t,n,e,i){for(var r=this.resultBuffer,o=this.sampleValues,s=this.valueSize,a=t*s,u=a-s,h=(e-n)/(i-n),c=1-h,f=0;f!==s;++f)r[f]=o[u+f]*c+o[a+f]*h;return r}}),vf.prototype=Object.assign(Object.create(ff.prototype),{constructor:vf,interpolate_:function(t){return this.copySampleValue_(t-1)}}),Object.assign(pf.prototype,{constructor:pf,TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:ze,InterpolantFactoryMethodDiscrete:function(t){return new vf(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodLinear:function(t){return new df(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:function(t){return new lf(this.times,this.values,this.getValueSize(),t)},setInterpolation:function(t){var n;switch(t){case Ve:n=this.InterpolantFactoryMethodDiscrete;break;case ze:n=this.InterpolantFactoryMethodLinear;break;case 2302:n=this.InterpolantFactoryMethodSmooth}if(void 0!==n)return this.createInterpolant=n,this;var e="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(t===this.DefaultInterpolation)throw new Error(e);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",e),this},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Ve;case this.InterpolantFactoryMethodLinear:return ze;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=cf.arraySlice(i,o,s),this.values=cf.arraySlice(this.values,o*e,s*e)),this},validate:function(){var t=!0,n=this.getValueSize();n-Math.floor(n)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);var e=this.times,i=this.values,r=e.length;0===r&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);for(var o=null,s=0;s!==r;s++){var a=e[s];if("number"==typeof a&&isNaN(a)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,s,a),t=!1;break}if(null!==o&&a<o){console.error("THREE.KeyframeTrack: Out of order keys.",this,s,a,o),t=!1;break}o=a}if(void 0!==i&&cf.isTypedArray(i))for(var s=0,u=i.length;s!==u;++s){var h=i[s];if(isNaN(h)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,s,h),t=!1;break}}return t},optimize:function(){for(var t=cf.arraySlice(this.times),n=cf.arraySlice(this.values),e=this.getValueSize(),i=2302===this.getInterpolation(),r=1,o=t.length-1,s=1;s<o;++s){var a=!1,u=t[s];if(u!==t[s+1]&&(1!==s||u!==u[0]))if(i)a=!0;else for(var h=s*e,c=h-e,f=h+e,l=0;l!==e;++l){var d=n[h+l];if(d!==n[c+l]||d!==n[f+l]){a=!0;break}}if(a){if(s!==r){t[r]=t[s];for(var v=s*e,p=r*e,l=0;l!==e;++l)n[p+l]=n[v+l]}++r}}if(0<o){t[r]=t[o];for(v=o*e,p=r*e,l=0;l!==e;++l)n[p+l]=n[v+l];++r}return r!==t.length?(this.times=cf.arraySlice(t,0,r),this.values=cf.arraySlice(n,0,r*e)):(this.times=t,this.values=n),this},clone:function(){var t=cf.arraySlice(this.times,0),n=cf.arraySlice(this.values,0),n=new this.constructor(this.name,t,n);return n.createInterpolant=this.createInterpolant,n}}),mf.prototype=Object.assign(Object.create(pf.prototype),{constructor:mf,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:Ve,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),gf.prototype=Object.assign(Object.create(pf.prototype),{constructor:gf,ValueTypeName:"color"}),yf.prototype=Object.assign(Object.create(pf.prototype),{constructor:yf,ValueTypeName:"number"}),bf.prototype=Object.assign(Object.create(ff.prototype),{constructor:bf,interpolate_:function(t,n,e,i){for(var r=this.resultBuffer,o=this.sampleValues,s=this.valueSize,a=t*s,u=(e-n)/(i-n),h=a+s;a!==h;a+=4)rt.slerpFlat(r,0,o,a-s,o,a,u);return r}}),_f.prototype=Object.assign(Object.create(pf.prototype),{constructor:_f,ValueTypeName:"quaternion",DefaultInterpolation:ze,InterpolantFactoryMethodLinear:function(t){return new bf(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:void 0}),wf.prototype=Object.assign(Object.create(pf.prototype),{constructor:wf,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:Ve,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),xf.prototype=Object.assign(Object.create(pf.prototype),{constructor:xf,ValueTypeName:"vector"}),Object.assign(Mf,{parse:function(t){for(var n=[],e=t.tracks,i=1/(t.fps||1),r=0,o=e.length;r!==o;++r)n.push(Sf(e[r]).scale(i));return new Mf(t.name,t.duration,n)},CreateFromMorphTargetSequence:function(t,n,e,i){for(var r=n.length,o=[],s=0;s<r;s++){var a=[];(h=[]).push((s+r-1)%r,s,(s+1)%r),a.push(0,1,0);var u=cf.getKeyframeOrder(h),h=cf.sortedArray(h,1,u),a=cf.sortedArray(a,1,u);i||0!==h[0]||(h.push(r),a.push(a[0])),o.push(new yf(".morphTargetInfluences["+n[s].name+"]",h,a).scale(1/e))}return new Mf(t,-1,o)},findByName:function(t,n){var e=t;Array.isArray(t)||(e=t.geometry&&t.geometry.animations||t.animations);for(var i=0;i<e.length;i++)if(e[i].name===n)return e[i];return null},CreateClipsFromMorphTargetSequences:function(t,n,e){for(var i={},r=/^([\w-]*?)([\d]+)$/,o=0,s=t.length;o<s;o++){var a=t[o],u=a.name.match(r);u&&1<u.length&&((u=i[h=u[1]])||(i[h]=u=[]),u.push(a))}var h,c=[];for(h in i)c.push(Mf.CreateFromMorphTargetSequence(h,i[h],n,e));return c},parseAnimation:function(t,n){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;for(var e=function(t,n,e,i,r){var o;0!==e.length&&(cf.flattenJSON(e,o=[],e=[],i),0!==o.length&&r.push(new t(n,o,e)))},i=[],r=t.name||"default",o=t.length||-1,s=t.fps||30,a=t.hierarchy||[],u=0;u<a.length;u++){var h=a[u].keys;if(h&&0!==h.length)if(h[0].morphTargets){for(var c,f={},l=0;l<h.length;l++)if(h[l].morphTargets)for(var d=0;d<h[l].morphTargets.length;d++)f[h[l].morphTargets[d]]=-1;for(c in f){for(var v=[],p=[],d=0;d!==h[l].morphTargets.length;++d){var m=h[l];v.push(m.time),p.push(m.morphTarget===c?1:0)}i.push(new yf(".morphTargetInfluence["+c+"]",v,p))}o=f.length*(s||1)}else{var g=".bones["+n[u].name+"]";e(xf,g+".position",h,"pos",i),e(_f,g+".quaternion",h,"rot",i),e(xf,g+".scale",h,"scl",i)}}return 0===i.length?null:new Mf(r,o,i)}}),Object.assign(Mf.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 Mf(this.name,this.duration,t)}}),Object.assign(Ef.prototype,{crossOrigin:"anonymous",load:function(e,i,t,n){var r=this,o=void 0===this.path?Gc(e):this.path;this.resourcePath=o+"maps/";var s=new hf(this.manager);s.setPath(this.path),s.setWithCredentials(this.withCredentials),s.load(e,function(t){var n=JSON.parse(t),t=n.metadata;if(void 0!==t){t=t.type;if(void 0!==t&&"object"===t.toLowerCase())return void console.error("JSONLoader: "+e+" should be loaded with ObjectLoader instead.")}n=r.parse(n,o);i(n.geometry,n.materials)},t,n)},setPath:function(t){return this.path=t,this},setResourcePath:function(t){return this.resourcePath=t,this},setCrossOrigin:function(t){return this.crossOrigin=t,this},parse:function(t,n){void 0!==(t=void 0!==t.data?t.data:t).scale?t.scale=1/t.scale:t.scale=1;var e=new kr;return function(t,n){var e,i,r,o,s,a,u,h,c,f,l,d,v,p,m,g,y,b,_,w,x,M,S,E,T=t.faces,L=t.vertices,R=t.normals,O=t.colors,A=t.scale,C=0;if(void 0!==t.uvs){for(e=0;e<t.uvs.length;e++)t.uvs[e].length&&C++;for(e=0;e<C;e++)n.faceVertexUvs[e]=[]}for(o=0,s=L.length;o<s;)(y=new St).x=L[o++]*A,y.y=L[o++]*A,y.z=L[o++]*A,n.vertices.push(y);for(o=0,s=T.length;o<s;)if(l=(f=T[o++])&2,d=f&8,v=f&16,p=f&32,m=f&64,g=f&128,f&1){if((_=new Lr).a=T[o],_.b=T[o+1],_.c=T[o+3],(w=new Lr).a=T[o+1],w.b=T[o+2],w.c=T[o+3],o+=4,l&&(c=T[o++],_.materialIndex=c,w.materialIndex=c),r=n.faces.length,d)for(e=0;e<C;e++)for(S=t.uvs[e],n.faceVertexUvs[e][r]=[],n.faceVertexUvs[e][r+1]=[],i=0;i<4;i++)E=new ci(S[2*(h=T[o++])],S[2*h+1]),2!==i&&n.faceVertexUvs[e][r].push(E),0!==i&&n.faceVertexUvs[e][r+1].push(E);if(v&&(u=3*T[o++],_.normal.set(R[u++],R[u++],R[u]),w.normal.copy(_.normal)),p)for(e=0;e<4;e++)u=3*T[o++],M=new St(R[u++],R[u++],R[u]),2!==e&&_.vertexNormals.push(M),0!==e&&w.vertexNormals.push(M);if(m&&(x=O[a=T[o++]],_.color.setHex(x),w.color.setHex(x)),g)for(e=0;e<4;e++)x=O[a=T[o++]],2!==e&&_.vertexColors.push(new _i(x)),0!==e&&w.vertexColors.push(new _i(x));n.faces.push(_),n.faces.push(w)}else{if((b=new Lr).a=T[o++],b.b=T[o++],b.c=T[o++],l&&(c=T[o++],b.materialIndex=c),r=n.faces.length,d)for(e=0;e<C;e++)for(S=t.uvs[e],n.faceVertexUvs[e][r]=[],i=0;i<3;i++)E=new ci(S[2*(h=T[o++])],S[2*h+1]),n.faceVertexUvs[e][r].push(E);if(v&&(u=3*T[o++],b.normal.set(R[u++],R[u++],R[u])),p)for(e=0;e<3;e++)u=3*T[o++],M=new St(R[u++],R[u++],R[u]),b.vertexNormals.push(M);if(m&&(a=T[o++],b.color.setHex(O[a])),g)for(e=0;e<3;e++)a=T[o++],b.vertexColors.push(new _i(O[a]));n.faces.push(b)}}(t,e),function(t,n){var e=void 0!==t.influencesPerVertex?t.influencesPerVertex:2;if(t.skinWeights)for(var i=0,r=t.skinWeights.length;i<r;i+=e){var o=t.skinWeights[i],s=1<e?t.skinWeights[i+1]:0,a=2<e?t.skinWeights[i+2]:0,u=3<e?t.skinWeights[i+3]:0;n.skinWeights.push(new Ci(o,s,a,u))}if(t.skinIndices)for(i=0,r=t.skinIndices.length;i<r;i+=e){var h=t.skinIndices[i],c=1<e?t.skinIndices[i+1]:0,f=2<e?t.skinIndices[i+2]:0,l=3<e?t.skinIndices[i+3]:0;n.skinIndices.push(new Ci(h,c,f,l))}n.bones=t.bones,n.bones&&0<n.bones.length&&(n.skinWeights.length!==n.skinIndices.length||n.skinIndices.length!==n.vertices.length)&&console.warn("When skinning, number of vertices ("+n.vertices.length+"), skinIndices ("+n.skinIndices.length+"), and skinWeights ("+n.skinWeights.length+") should match.")}(t,e),function(t,n){var e=t.scale;if(void 0!==t.morphTargets)for(var i=0,r=t.morphTargets.length;i<r;i++){n.morphTargets[i]={},n.morphTargets[i].name=t.morphTargets[i].name,n.morphTargets[i].vertices=[];for(var o=n.morphTargets[i].vertices,s=t.morphTargets[i].vertices,a=0,u=s.length;a<u;a+=3){var h=new St;h.x=s[a]*e,h.y=s[a+1]*e,h.z=s[a+2]*e,o.push(h)}}if(void 0!==t.morphColors&&0<t.morphColors.length){console.warn('fm.JSONLoader: "morphColors" no longer supported. Using them as face colors.');for(var c=n.faces,f=t.morphColors[0].colors,i=0,r=c.length;i<r;i++)c[i].color.fromArray(f,3*i)}}(t,e),function(t,n){var e=[],i=[];void 0!==t.animation&&i.push(t.animation),void 0!==t.animations&&(t.animations.length?i=i.concat(t.animations):i.push(t.animations));for(var r=0;r<i.length;r++){var o=Mf.parseAnimation(i[r],n.bones);o&&e.push(o)}n.morphTargets&&(t=Mf.CreateClipsFromMorphTargetSequences(n.morphTargets,10),e=e.concat(t)),0<e.length&&(n.animations=e)}(t,e),e.computeFaceNormals(),e.computeBoundingSphere(),void 0===t.materials||0===t.materials.length?{geometry:e}:{geometry:e,materials:af.prototype.initMaterials(t.materials,this.resourcePath||n,this.crossOrigin)}}});var Tf=Ef;function Lf(t,n){Z.call(this),this.type="Light",this.color=new _i(t),this.intensity=void 0!==n?n:1,this.receiveShadow=void 0}function Rf(t){this.camera=t,this.bias=0,this.radius=1,this.mapSize=new ci(512,512),this.map=null,this.mapPass=null,this.matrix=new Et,this.zs=new Tt,this.Ws=new ci(1,1),this.Xs=1,this.Zs=[new Ci(0,0,1,1)]}function Of(){Rf.call(this,new q(-5,5,5,-5,.5,500))}function Af(t,n){Lf.call(this,t,n),this.type="DirectionalLight",this.position.copy(Z.DefaultUp),this.updateMatrix(),this.target=new Z,this.shadow=new Of}function Cf(){Rf.call(this,new Y(90,1,.5,500)),this.Ws=new ci(4,2),this.Xs=6,this.Zs=[new Ci(2,1,1,1),new Ci(0,1,1,1),new Ci(3,1,1,1),new Ci(1,1,1,1),new Ci(3,0,1,1),new Ci(1,0,1,1)],this.Ys=[new St(1,0,0),new St(-1,0,0),new St(0,0,1),new St(0,0,-1),new St(0,1,0),new St(0,-1,0)],this.qs=[new St(0,1,0),new St(0,1,0),new St(0,1,0),new St(0,1,0),new St(0,0,1),new St(0,0,-1)]}function kf(t,n,e,i){Lf.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 Cf}function Pf(){Rf.call(this,new Y(50,1,.5,500))}function Df(t,n,e,i,r,o){Lf.call(this,t,n),this.type="SpotLight",this.position.copy(Z.DefaultUp),this.updateMatrix(),this.target=new Z,Object.defineProperty(this,"power",{get:function(){return this.intensity*Math.PI},set:function(t){this.intensity=t/Math.PI}}),this.distance=void 0!==e?e:0,this.angle=void 0!==i?i:Math.PI/3,this.penumbra=void 0!==r?r:0,this.decay=void 0!==o?o:1,this.shadow=new Pf}function jf(t,n){t&&t.isGeometry&&console.error("THREE.SkinnedMesh no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."),Uo.call(this,t,n),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new Et,this.bindMatrixInverse=new Et}Lf.prototype=Object.assign(Object.create(Z.prototype),{constructor:Lf,isLight:!0,copy:function(t){return Z.prototype.copy.call(this,t),this.color.copy(t.color),this.intensity=t.intensity,this}}),Object.assign(Rf.prototype,{Ks:new Et,Js:new St,Qs:new St,getViewportCount:function(){return this.Xs},getFrustum:function(){return this.zs},updateMatrices:function(t){var n=this.camera,e=this.matrix,i=this.Ks,r=this.Qs,o=this.Js;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.zs.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.Zs[t]},getFrameExtents:function(){return this.Ws},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)}}),Of.prototype=Object.assign(Object.create(Rf.prototype),{constructor:Of,isDirectionalLightShadow:!0,updateMatrices:function(t){Rf.prototype.updateMatrices.call(this,t)}}),Af.prototype=Object.assign(Object.create(Lf.prototype),{constructor:Af,isDirectionalLight:!0,copy:function(t){return Lf.prototype.copy.call(this,t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}),Cf.prototype=Object.assign(Object.create(Rf.prototype),{constructor:Cf,isPointLightShadow:!0,updateMatrices:function(t,n){void 0===n&&(n=0);var e=this.camera,i=this.matrix,r=this.Js,o=this.Qs,s=this.Ks;r.setFromMatrixPosition(t.matrixWorld),e.position.copy(r),o.copy(e.position),o.add(this.Ys[n]),e.up.copy(this.qs[n]),e.lookAt(o),e.updateMatrixWorld(),i.makeTranslation(-r.x,-r.y,-r.z),s.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),this.zs.setFromProjectionMatrix(s)}}),kf.prototype=Object.assign(Object.create(Lf.prototype),{constructor:kf,isPointLight:!0,copy:function(t){return Lf.prototype.copy.call(this,t),this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this}}),Pf.prototype=Object.assign(Object.create(Rf.prototype),{constructor:Pf,isSpotLightShadow:!0,updateMatrices:function(t){var n=this.camera,e=2*Mt.RAD2DEG*t.angle,i=this.mapSize.width/this.mapSize.height,r=t.distance||n.far;e===n.fov&&i===n.aspect&&r===n.far||(n.fov=e,n.aspect=i,n.far=r,n.updateProjectionMatrix()),Rf.prototype.updateMatrices.call(this,t)}}),Df.prototype=Object.assign(Object.create(Lf.prototype),{constructor:Df,isSpotLight:!0,copy:function(t){return Lf.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}}),jf.prototype=Object.assign(Object.create(Uo.prototype),{constructor:jf,isSkinnedMesh:!0,bind:function(t,n){this.skeleton=t,void 0===n&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),n=this.matrixWorld),this.bindMatrix.copy(n),this.bindMatrixInverse.getInverse(n)},pose:function(){this.skeleton.pose()},normalizeSkinWeights:function(){for(var t=new Ci,n=this.geometry.attributes.skinWeight,e=0,i=n.count;e<i;e++){t.x=n.getX(e),t.y=n.getY(e),t.z=n.getZ(e),t.w=n.getW(e);var r=1/t.manhattanLength();r!=1/0?t.multiplyScalar(r):t.set(1,0,0,0),n.setXYZW(e,t.x,t.y,t.z,t.w)}},updateMatrixWorld:function(t){Uo.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 If=new St,Nf=new St,Ff=new Et,Uf=new Zi,Bf=new et;function Gf(t,n,e){1===e&&console.error("THREE.Line: parameter THREE.LinePieces no longer supported. Use THREE.LineSegments instead."),Z.call(this),this.type="Line",this.geometry=void 0!==t?t:new $r,this.material=void 0!==n?n:new $c}Gf.prototype=Object.assign(Object.create(Z.prototype),{constructor:Gf,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++)If.fromBufferAttribute(n,i-1),Nf.fromBufferAttribute(n,i),e[i]=e[i-1],e[i]+=If.distanceTo(Nf);t.setAttribute("lineDistance",new Hr(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(),Bf.copy(e.boundingSphere),Bf.applyMatrix4(i),Bf.radius+=r,!1!==t.ray.intersectsSphere(Bf)){Ff.getInverse(i),Uf.copy(t.ray).applyMatrix4(Ff);var r=r/((this.scale.x+this.scale.y+this.scale.z)/3),o=r*r,s=new St,a=new St,u=new St,h=new St,c=this&&this.isLineSegments?2:1;if(e.isBufferGeometry){var r=e.index,f=e.attributes.position.array;if(null!==r)for(var l=r.array,d=0,v=l.length-1;d<v;d+=c){var p=l[d],m=l[d+1];s.fromArray(f,3*p),a.fromArray(f,3*m),o<Uf.distanceSqToSegment(s,a,h,u)||(h.applyMatrix4(this.matrixWorld),(g=t.ray.origin.distanceTo(h))<t.near||g>t.far||n.push({distance:g,point:u.clone().applyMatrix4(this.matrixWorld),index:d,face:null,faceIndex:null,object:this}))}else for(d=0,v=f.length/3-1;d<v;d+=c)s.fromArray(f,3*d),a.fromArray(f,3*d+3),o<Uf.distanceSqToSegment(s,a,h,u)||(h.applyMatrix4(this.matrixWorld),(g=t.ray.origin.distanceTo(h))<t.near||g>t.far||n.push({distance:g,point:u.clone().applyMatrix4(this.matrixWorld),index:d,face:null,faceIndex:null,object:this}))}else if(e.isGeometry)for(var g,y=e.vertices,b=y.length,d=0;d<b-1;d+=c)o<Uf.distanceSqToSegment(y[d],y[d+1],h,u)||(h.applyMatrix4(this.matrixWorld),(g=t.ray.origin.distanceTo(h))<t.near||g>t.far||n.push({distance:g,point:u.clone().applyMatrix4(this.matrixWorld),index:d,face:null,faceIndex:null,object:this}))}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var Hf=new St,Vf=new St;function zf(t,n){Gf.call(this,t,n),this.type="LineSegments"}function Wf(t,n){Gf.call(this,t,n),this.type="LineLoop"}zf.prototype=Object.assign(Object.create(Gf.prototype),{constructor:zf,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)Hf.fromBufferAttribute(n,i),Vf.fromBufferAttribute(n,i+1),e[i]=0===i?0:e[i-1],e[i+1]=e[i]+Hf.distanceTo(Vf);t.setAttribute("lineDistance",new Hr(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)Hf.copy(o[i]),Vf.copy(o[i+1]),e[i]=0===i?0:e[i-1],e[i+1]=e[i]+Hf.distanceTo(Vf);return this}}),Wf.prototype=Object.assign(Object.create(Gf.prototype),{constructor:Wf,isLineLoop:!0});var Xf=new Et,Zf=new Zi,Yf=new et,qf=new St;function Kf(t,n){Z.call(this),this.type="Points",this.geometry=void 0!==t?t:new $r,this.material=void 0!==n?n:new Xc,this.updateMorphTargets()}function Jf(t,n,e,i,r,o,s){var a=Zf.distanceSqToPoint(t);a<e&&(e=new St,Zf.closestPointToPoint(t,e),e.applyMatrix4(i),(i=r.ray.origin.distanceTo(e))<r.near||i>r.far||o.push({distance:i,distanceToRay:Math.sqrt(a),point:e,index:n,face:null,object:s}))}function Qf(){Z.call(this),this.type="Bone"}Kf.prototype=Object.assign(Object.create(Z.prototype),{constructor:Kf,isPoints:!0,raycast:function(t,n){var e=this.geometry,i=this.matrixWorld,r=t.params.Points.threshold;if(null===e.boundingSphere&&e.computeBoundingSphere(),Yf.copy(e.boundingSphere),Yf.applyMatrix4(i),Yf.radius+=r,!1!==t.ray.intersectsSphere(Yf)){Xf.getInverse(i),Zf.copy(t.ray).applyMatrix4(Xf);var r=r/((this.scale.x+this.scale.y+this.scale.z)/3),o=r*r;if(e.isBufferGeometry){var r=e.index,s=e.attributes.position.array;if(null!==r)for(var a=r.array,u=0,h=a.length;u<h;u++){var c=a[u];qf.fromArray(s,3*c),Jf(qf,c,o,i,t,n,this)}else for(var u=0,f=s.length/3;u<f;u++)qf.fromArray(s,3*u),Jf(qf,u,o,i,t,n,this)}else for(var l=e.vertices,u=0,f=l.length;u<f;u++)Jf(l[u],u,o,i,t,n,this)}},updateMorphTargets:function(){var t,n,e,i=this.geometry;if(i.isBufferGeometry){var r=i.morphAttributes,o=Object.keys(r);if(0<o.length){var s=r[o[0]];if(void 0!==s)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},t=0,n=s.length;t<n;t++)e=s[t].name||String(t),this.morphTargetInfluences.push(0),this.morphTargetDictionary[e]=t}}else{i=i.morphTargets;void 0!==i&&0<i.length&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),Qf.prototype=Object.assign(Object.create(Z.prototype),{constructor:Qf,isBone:!0});var Ji="\\[\\]\\.:\\/",$f=new RegExp("["+Ji+"]","g"),pr="[^"+Ji+"]",br="[^"+Ji.replace("\\.","")+"]",di=/((?:WC+[\/:])*)/.source.replace("WC",pr),pi=/(WCOD+)?/.source.replace("WCOD",br),Li=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",pr),Oi=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",pr),tl=new RegExp("^"+di+pi+Li+Oi+"$"),nl=["material","materials","bones"];function el(t,n,e){e=e||il.parseTrackName(n);this.$s=t,this.ta=t.subscribe_(n,e)}function il(t,n,e){this.path=n,this.parsedPath=e||il.parseTrackName(n),this.node=il.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t}Object.assign(el.prototype,{getValue:function(t,n){this.bind();var e=this.$s.nCachedObjects_,e=this.ta[e];void 0!==e&&e.getValue(t,n)},setValue:function(t,n){for(var e=this.ta,i=this.$s.nCachedObjects_,r=e.length;i!==r;++i)e[i].setValue(t,n)},bind:function(){for(var t=this.ta,n=this.$s.nCachedObjects_,e=t.length;n!==e;++n)t[n].bind()},unbind:function(){for(var t=this.ta,n=this.$s.nCachedObjects_,e=t.length;n!==e;++n)t[n].unbind()}}),Object.assign(il,{Composite:el,create:function(t,n,e){return new(t&&t.isAnimationObjectGroup?il.Composite:il)(t,n,e)},sanitizeNodeName:function(t){return t.replace(/\s/g,"_").replace($f,"")},parseTrackName:function(t){var n=tl.exec(t);if(!n)throw new Error("PropertyBinding: Cannot parse trackName: "+t);var e={nodeName:n[2],objectName:n[3],objectIndex:n[4],propertyName:n[5],propertyIndex:n[6]},i=e.nodeName&&e.nodeName.lastIndexOf(".");if(void 0!==i&&-1!==i&&(n=e.nodeName.substring(i+1),-1!==nl.indexOf(n)&&(e.nodeName=e.nodeName.substring(0,i),e.objectName=n)),null===e.propertyName||0===e.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return e},findNode:function(t,r){if(!r||""===r||"."===r||-1===r||r===t.name||r===t.uuid)return t;if(t.skeleton){var n=t.skeleton.getBoneByName(r);if(void 0!==n)return n}if(t.children){t=function t(n){for(var e=0;e<n.length;e++){var i=n[e];if(i.name===r||i.uuid===r)return i;i=t(i.children);if(i)return i}return null}(t.children);if(t)return t}return null}}),Object.assign(il.prototype,{na:function(){},ea: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=il.findNode(this.rootNode,n.nodeName)||this.rootNode,this.node=t),this.getValue=this.na,this.setValue=this.ea,t){if(e){var o=n.objectIndex;switch(e){case"materials":if(!t.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!t.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);t=t.material.materials;break;case"bones":if(!t.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);for(var t=t.skeleton.bones,s=0;s<t.length;s++)if(t[s].name===o){o=s;break}break;default:if(void 0===t[e])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);t=t[e]}if(void 0!==o){if(void 0===t[o])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);t=t[o]}}var a=t[i];if(void 0!==a){var u=this.Versioning.None;void 0!==(this.targetObject=t).needsUpdate?u=this.Versioning.NeedsUpdate:void 0!==t.matrixWorldNeedsUpdate&&(u=this.Versioning.MatrixWorldNeedsUpdate);var h=this.BindingType.Direct;if(void 0!==r){if("morphTargetInfluences"===i){if(!t.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(t.geometry.isBufferGeometry){if(!t.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);for(s=0;s<this.node.geometry.morphAttributes.position.length;s++)if(t.geometry.morphAttributes.position[s].name===r){r=s;break}}else{if(!t.geometry.morphTargets)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphTargets.",this);for(s=0;s<this.node.geometry.morphTargets.length;s++)if(t.geometry.morphTargets[s].name===r){r=s;break}}}h=this.BindingType.ArrayElement,this.resolvedProperty=a,this.propertyIndex=r}else void 0!==a.fromArray&&void 0!==a.toArray?(h=this.BindingType.HasFromToArray,this.resolvedProperty=a):Array.isArray(a)?(h=this.BindingType.EntireArray,this.resolvedProperty=a):this.propertyName=i;this.getValue=this.GetterByBindingType[h],this.setValue=this.SetterByBindingTypeAndVersioning[h][u]}else{n=n.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+n+"."+i+" but it wasn't found.",t)}}else console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.")},unbind:function(){this.node=null,this.getValue=this.ia,this.setValue=this.ra}}),Object.assign(il.prototype,{ia:il.prototype.getValue,ra:il.prototype.setValue});var rl=new Et,ol=new Et;function sl(t,n){if(this.bones=(t=t||[]).slice(0),this.boneMatrices=new Float32Array(16*this.bones.length),this.frame=-1,void 0===n)this.calculateInverses();else if(this.bones.length===n.length)this.boneInverses=n.slice(0);else{console.warn("THREE.Skeleton boneInverses is the wrong length."),this.boneInverses=[];for(var e=0,i=this.bones.length;e<i;e++)this.boneInverses.push(new Et)}}function 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)}Object.assign(sl.prototype,{calculateInverses:function(){this.boneInverses=[];for(var t=0,n=this.bones.length;t<n;t++){var e=new Et;this.bones[t]&&e.getInverse(this.bones[t].matrixWorld),this.boneInverses.push(e)}},pose:function(){for(var t,n=0,e=this.bones.length;n<e;n++)(t=this.bones[n])&&t.matrixWorld.getInverse(this.boneInverses[n]);for(n=0,e=this.bones.length;n<e;n++)(t=this.bones[n])&&(t.parent&&t.parent.isBone?(t.matrix.getInverse(t.parent.matrixWorld),t.matrix.multiply(t.matrixWorld)):t.matrix.copy(t.matrixWorld),t.matrix.decompose(t.position,t.quaternion,t.scale))},update:function(){for(var t=this.bones,n=this.boneInverses,e=this.boneMatrices,i=this.boneTexture,r=0,o=t.length;r<o;r++){var s=t[r]?t[r].matrixWorld:ol;rl.multiplyMatrices(s,n[r]),rl.toArray(e,16*r)}void 0!==i&&(i.needsUpdate=!0)},clone:function(){return new sl(this.bones,this.boneInverses)},getBoneByName:function(t){for(var n=0,e=this.bones.length;n<e;n++){var i=this.bones[n];if(i.name===t)return i}},dispose:function(){this.boneTexture&&(this.boneTexture.dispose(),this.boneTexture=void 0)}});var ul=function(){function t(t){af.call(this,t),this.dracoLoader=null,this.ddsLoader=null}function i(){var e={};return{get:function(t){return e[t]},add:function(t,n){e[t]=n},remove:function(t){delete e[t]},removeAll:function(){e={}}}}t.prototype=Object.assign(Object.create(af.prototype),{constructor:t,load:function(e,i,t,n){var r=this,o=""!==this.resourcePath?this.resourcePath:""!==this.path?this.path:Gc(e);r.manager.itemStart(e);function s(t){n?n(t):console.error(t),r.manager.itemError(e),r.manager.itemEnd(e)}var a=new hf(r.manager);a.setPath(this.path),a.setResponseType("arraybuffer"),"use-credentials"===r.crossOrigin&&a.setWithCredentials(!0),a.load(e,function(n){try{r.parse(n,o,function(t){i(t,n),r.manager.itemEnd(e)},s)}catch(t){s(t)}},t,s)},setDRACOLoader:function(t){return this.dracoLoader=t,this},setDDSLoader:function(t){return this.ddsLoader=t,this},parse:function(t,n,e,i){var r,o={};if("string"==typeof t)r=t;else if(Bc(new Uint8Array(t,0,4))===p){try{o[f.KHR_BINARY_GLTF]=new m(t)}catch(t){return void(i&&i(t))}r=o[f.KHR_BINARY_GLTF].content}else r=Bc(new Uint8Array(t));var s=JSON.parse(r);if(void 0===s.asset||s.asset.version[0]<2)i&&i(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));else{if(s.extensionsUsed)for(var a=0;a<s.extensionsUsed.length;++a){var u=s.extensionsUsed[a],h=s.extensionsRequired||[];switch(u){case f.KHR_LIGHTS_PUNCTUAL:o[u]=new l(s);break;case f.KHR_MATERIALS_CLEARCOAT:o[u]=new v;break;case f.KHR_MATERIALS_UNLIT:o[u]=new d;break;case f.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:o[u]=new b;break;case f.KHR_DRACO_MESH_COMPRESSION:o[u]=new g(s,this.dracoLoader);break;case f.MSFT_TEXTURE_DDS:o[u]=new c(this.ddsLoader);break;case f.KHR_TEXTURE_TRANSFORM:o[u]=new y;break;case f.KHR_MESH_QUANTIZATION:o[u]=new _;break;default:0<=h.indexOf(u)&&console.warn('THREE.GLTFLoader: Unknown extension "'+u+'".')}}new z(s,o,{path:n||this.resourcePath||"",crossOrigin:this.crossOrigin,manager:this.manager}).parse(e,i)}}});var f={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",MSFT_TEXTURE_DDS:"MSFT_texture_dds"};function c(t){if(!t)throw new Error("THREE.GLTFLoader: Attempting to load .dds texture without importing DDSLoader");this.name=f.MSFT_TEXTURE_DDS,this.ddsLoader=t}function l(t){this.name=f.KHR_LIGHTS_PUNCTUAL;t=t.extensions&&t.extensions[f.KHR_LIGHTS_PUNCTUAL]||{};this.lightDefs=t.lights||[]}function d(){this.name=f.KHR_MATERIALS_UNLIT}function v(){this.name=f.KHR_MATERIALS_CLEARCOAT}l.prototype.loadLight=function(t){var n,e=this.lightDefs[t],i=new _i(16777215);void 0!==e.color&&i.fromArray(e.color);var r=void 0!==e.range?e.range:0;switch(e.type){case"directional":(n=new Af(i)).target.position.set(0,0,-1),n.add(n.target);break;case"point":(n=new kf(i)).distance=r;break;case"spot":(n=new Df(i)).distance=r,e.spot=e.spot||{},e.spot.innerConeAngle=void 0!==e.spot.innerConeAngle?e.spot.innerConeAngle:0,e.spot.outerConeAngle=void 0!==e.spot.outerConeAngle?e.spot.outerConeAngle:Math.PI/4,n.angle=e.spot.outerConeAngle,n.penumbra=1-e.spot.innerConeAngle/e.spot.outerConeAngle,n.target.position.set(0,0,-1),n.add(n.target);break;default:throw new Error('THREE.GLTFLoader: Unexpected light type, "'+e.type+'".')}return n.position.set(0,0,0),n.decay=2,void 0!==e.intensity&&(n.intensity=e.intensity),n.name=e.name||"light_"+t,Promise.resolve(n)},d.prototype.getMaterialType=function(){return wo},d.prototype.extendParams=function(t,n,e){var i=[];t.color=new _i(1,1,1),t.opacity=1;var r=n.pbrMetallicRoughness;return r&&(Array.isArray(r.baseColorFactor)&&(n=r.baseColorFactor,t.color.fromArray(n),t.opacity=n[3]),void 0!==r.baseColorTexture&&i.push(e.assignTexture(t,"map",r.baseColorTexture))),Promise.all(i)},v.prototype.getMaterialType=function(){return Zc},v.prototype.extendParams=function(t,n,e){var i=[],n=n.extensions[this.name];return void 0!==n.clearcoatFactor&&(t.clearcoat=n.clearcoatFactor),void 0!==n.clearcoatTexture&&i.push(e.assignTexture(t,"clearcoatMap",n.clearcoatTexture)),void 0!==n.clearcoatRoughnessFactor&&(t.clearcoatRoughness=n.clearcoatRoughnessFactor),void 0!==n.clearcoatRoughnessTexture&&i.push(e.assignTexture(t,"clearcoatRoughnessMap",n.clearcoatRoughnessTexture)),void 0!==n.clearcoatNormalTexture&&(i.push(e.assignTexture(t,"clearcoatNormalMap",n.clearcoatNormalTexture)),void 0!==n.clearcoatNormalTexture.scale&&(n=n.clearcoatNormalTexture.scale,t.clearcoatNormalScale=new ci(n,n))),Promise.all(i)};var p="glTF",a=12,u={JSON:1313821514,BIN:5130562};function m(t){this.name=f.KHR_BINARY_GLTF,this.content=null,this.body=null;var n=new DataView(t,0,a);if(this.header={magic:Bc(new Uint8Array(t.slice(0,4))),version:n.getUint32(4,!0),length:n.getUint32(8,!0)},this.header.magic!==p)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");for(var e=new DataView(t,a),i=0;i<e.byteLength;){var r=e.getUint32(i,!0);i+=4;var o,s=e.getUint32(i,!0);i+=4,s===u.JSON?(o=new Uint8Array(t,a+i,r),this.content=Bc(o)):s===u.BIN&&(this.body=t.slice(s=a+i,s+r)),i+=r}if(null===this.content)throw new Error("THREE.GLTFLoader: JSON content not found.")}function g(t,n){if(!n)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=f.KHR_DRACO_MESH_COMPRESSION,this.json=t,this.dracoLoader=n,this.dracoLoader.preload()}function y(){this.name=f.KHR_TEXTURE_TRANSFORM}function h(t){nr.call(this),this.isGLTFSpecularGlossinessMaterial=!0;["#ifdef USE_SPECULARMAP","\tuniform sampler2D specularMap;","#endif"].join("\n");var e=["#ifdef USE_GLOSSINESSMAP","\tuniform sampler2D glossinessMap;","#endif"].join("\n"),i=["vec3 specularFactor = specular;","#ifdef USE_SPECULARMAP","\tvec4 texelSpecular = texture2D( specularMap, vUv );","\ttexelSpecular = sRGBToLinear( texelSpecular );","\t// reads channel RGB, compatible with a glTF Specular-Glossiness (RGBA) texture","\tspecularFactor *= texelSpecular.rgb;","#endif"].join("\n"),r=["float glossinessFactor = glossiness;","#ifdef USE_GLOSSINESSMAP","\tvec4 texelGlossiness = texture2D( glossinessMap, vUv );","\t// reads channel A, compatible with a glTF Specular-Glossiness (RGBA) texture","\tglossinessFactor *= texelGlossiness.a;","#endif"].join("\n"),o=["PhysicalMaterial material;","material.diffuseColor = diffuseColor.rgb;","vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );","float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );","material.specularRoughness = max( 1.0 - glossinessFactor, 0.0525 );// 0.0525 corresponds to the base mip of a 256 cubemap.","material.specularRoughness += geometryRoughness;","material.specularRoughness = min( material.specularRoughness, 1.0 );","material.specularColor = specularFactor.rgb;"].join("\n"),s={specular:{value:(new _i).setHex(16777215)},glossiness:{value:1},specularMap:{value:null},glossinessMap:{value:null}};this.oa=s,this.onBeforeCompile=function(t){for(var n in s)t.uniforms[n]=s[n];t.fragmentShader=t.fragmentShader.replace("uniform float roughness;","uniform vec3 specular;"),t.fragmentShader=t.fragmentShader.replace("uniform float metalness;","uniform float glossiness;"),t.fragmentShader=t.fragmentShader.replace("#include <metalnessmap_pars_fragment>",e),t.fragmentShader=t.fragmentShader.replace("#include <roughnessmap_fragment>",i),t.fragmentShader=t.fragmentShader.replace("#include <metalnessmap_fragment>",r),t.fragmentShader=t.fragmentShader.replace("#include <lights_physical_fragment>",o)},Object.defineProperties(this,{specular:{get:function(){return s.specular.value},set:function(t){s.specular.value=t}},specularMap:{get:function(){return s.specularMap.value},set:function(t){s.specularMap.value=t}},glossiness:{get:function(){return s.glossiness.value},set:function(t){s.glossiness.value=t}},glossinessMap:{get:function(){return s.glossinessMap.value},set:function(t){(s.glossinessMap.value=t)?(this.defines.USE_GLOSSINESSMAP="",this.defines.USE_ROUGHNESSMAP=""):(delete this.defines.USE_ROUGHNESSMAP,delete this.defines.USE_GLOSSINESSMAP)}}}),delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this.setValues(t)}function b(){return{name:f.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,specularGlossinessParams:["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","normalMapType","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity","refractionRatio"],getMaterialType:function(){return h},extendParams:function(t,n,e){var i=n.extensions[this.name];t.color=new _i(1,1,1),t.opacity=1;var r=[];return Array.isArray(i.diffuseFactor)&&(n=i.diffuseFactor,t.color.fromArray(n),t.opacity=n[3]),void 0!==i.diffuseTexture&&r.push(e.assignTexture(t,"map",i.diffuseTexture)),t.emissive=new _i(0,0,0),t.glossiness=void 0!==i.glossinessFactor?i.glossinessFactor:1,t.specular=new _i(1,1,1),Array.isArray(i.specularFactor)&&t.specular.fromArray(i.specularFactor),void 0!==i.specularGlossinessTexture&&(i=i.specularGlossinessTexture,r.push(e.assignTexture(t,"glossinessMap",i)),r.push(e.assignTexture(t,"specularMap",i))),Promise.all(r)},createMaterial:function(t){var n=new h(t);return n.fog=!0,n.color=t.color,n.map=void 0===t.map?null:t.map,n.lightMap=null,n.lightMapIntensity=1,n.aoMap=void 0===t.aoMap?null:t.aoMap,n.aoMapIntensity=1,n.emissive=t.emissive,n.emissiveIntensity=1,n.emissiveMap=void 0===t.emissiveMap?null:t.emissiveMap,n.bumpMap=void 0===t.bumpMap?null:t.bumpMap,n.bumpScale=1,n.normalMap=void 0===t.normalMap?null:t.normalMap,n.normalMapType=ri,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 _(){this.name=f.KHR_MESH_QUANTIZATION}function T(t,n,e,i){ff.call(this,t,n,e,i)}g.prototype.decodePrimitive=function(t,n){var e,i=this.json,r=this.dracoLoader,o=t.extensions[this.name].bufferView,s=t.extensions[this.name].attributes,a={},u={},h={};for(e in s){var c=P[e]||e.toLowerCase();a[c]=s[e]}for(e in t.attributes){var f,l,c=P[e]||e.toLowerCase();void 0!==s[e]&&(f=i.accessors[t.attributes[e]],l=O[f.componentType],h[c]=l,u[c]=!0===f.normalized)}return n.getDependency("bufferView",o).then(function(t){return new Promise(function(i){r.decodeDracoFile(t,function(t){for(var n in t.attributes){var e=t.attributes[n],n=u[n];void 0!==n&&(e.normalized=n)}i(t)},a,h)})})},y.prototype.extendTexture=function(t,n){return t=t.clone(),void 0!==n.offset&&t.offset.fromArray(n.offset),void 0!==n.rotation&&(t.rotation=n.rotation),void 0!==n.scale&&t.repeat.fromArray(n.scale),void 0!==n.texCoord&&console.warn('THREE.GLTFLoader: Custom UV sets in "'+this.name+'" extension not yet supported.'),t.needsUpdate=!0,t},((h.prototype=Object.create(nr.prototype)).constructor=h).prototype.copy=function(t){return nr.prototype.copy.call(this,t),this.specularMap=t.specularMap,this.specular.copy(t.specular),this.glossinessMap=t.glossinessMap,this.glossiness=t.glossiness,delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this},((T.prototype=Object.create(ff.prototype)).constructor=T).prototype.beforeStart_=T.prototype.copySampleValue_=function(t){for(var n=this.resultBuffer,e=this.sampleValues,i=this.valueSize,r=t*i*3+i,o=0;o!==i;o++)n[o]=e[r+o];return n},T.prototype.afterEnd_=T.prototype.copySampleValue_,T.prototype.interpolate_=function(t,n,e,i){for(var r=this.resultBuffer,o=this.sampleValues,s=this.valueSize,a=2*s,u=3*s,h=i-n,i=(e-n)/h,e=i*i,n=e*i,c=t*u,f=c-u,l=-2*n+3*e,d=n-e,v=1-l,p=d-e+i,m=0;m!==s;m++){var g=o[f+m+s],y=o[f+m+a]*h,b=o[c+m+s],_=o[c+m]*h;r[m]=v*g+p*y+l*b+d*_}return r};var w=0,x=1,M=2,S=3,E=4,L=5,R=6,O={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},A={9728:Tn,9729:On,9984:Ln,9985:An,9986:Rn,9987:Cn},C={33071:Sn,33648:En,10497:Mn},k={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},P={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},D={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},j={CUBICSPLINE:void 0,LINEAR:ze,STEP:Ve},I="OPAQUE",N="MASK",F="BLEND",U={"image/png":Xn,"image/jpeg":Wn};function B(t,n){return"string"!=typeof t||""===t?"":(/^https?:\/\//i.test(n)&&/^\//.test(t)&&(n=n.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(t)||/^data:.*,.*$/i.test(t)||/^blob:.*$/i.test(t)?t:n+t)}function G(t,n,e){for(var i in e.extensions)void 0===t[i]&&(n.userData.gltfExtensions=n.userData.gltfExtensions||{},n.userData.gltfExtensions[i]=e.extensions[i])}function H(t,n){void 0!==n.extras&&("object"===al(n.extras)?Object.assign(t.userData,n.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+n.extras))}function V(t){for(var n="",e=Object.keys(t).sort(),i=0,r=e.length;i<r;i++)n+=e[i]+":"+t[e[i]]+";";return n}function z(t,n,e){this.json=t||{},this.extensions=n||{},this.options=e||{},this.cache=new i,this.primitiveCache={},this.textureLoader=new zc(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.fileLoader=new hf(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),"use-credentials"===this.options.crossOrigin&&this.fileLoader.setWithCredentials(!0)}function W(e,t,i){var n,r,o=t.attributes,s=[];for(n in o){var a=P[n]||n.toLowerCase();a in e.attributes||s.push(function(t,n){return i.getDependency("accessor",t).then(function(t){e.setAttribute(n,t)})}(o[n],a))}return void 0===t.indices||e.index||(r=i.getDependency("accessor",t.indices).then(function(t){e.setIndex(t)}),s.push(r)),H(e,t),function(t,n,e){var i=n.attributes,r=new $;if(void 0!==i.POSITION){var o=(l=e.json.accessors[i.POSITION]).min,s=l.max;if(void 0!==o&&void 0!==s){r.set(new St(o[0],o[1],o[2]),new St(s[0],s[1],s[2]));var a=n.targets;if(void 0!==a){for(var u=new St,h=new St,c=0,f=a.length;c<f;c++){var l,d=a[c];void 0!==d.POSITION&&(o=(l=e.json.accessors[d.POSITION]).min,s=l.max,void 0!==o&&void 0!==s?(h.setX(Math.max(Math.abs(o[0]),Math.abs(s[0]))),h.setY(Math.max(Math.abs(o[1]),Math.abs(s[1]))),h.setZ(Math.max(Math.abs(o[2]),Math.abs(s[2]))),u.max(h)):console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION."))}r.expandByVector(u)}t.boundingBox=r;n=new et;r.getCenter(n.center),n.radius=r.min.distanceTo(r.max)/2,t.boundingSphere=n}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}(e,t,i),Promise.all(s).then(function(){return void 0!==t.targets?function(e,t,n){for(var i=!1,r=!1,o=0,s=t.length;o<s;o++)if(void 0!==(c=t[o]).POSITION&&(i=!0),void 0!==c.NORMAL&&(r=!0),i&&r)break;if(!i&&!r)return Promise.resolve(e);for(var a=[],u=[],o=0,s=t.length;o<s;o++){var h,c=t[o];i&&(h=void 0!==c.POSITION?n.getDependency("accessor",c.POSITION):e.attributes.position,a.push(h)),r&&(h=void 0!==c.NORMAL?n.getDependency("accessor",c.NORMAL):e.attributes.normal,u.push(h))}return Promise.all([Promise.all(a),Promise.all(u)]).then(function(t){var n=t[0],t=t[1];return i&&(e.morphAttributes.position=n),r&&(e.morphAttributes.normal=t),e.morphTargetsRelative=!0,e})}(e,t.targets,i):e})}function X(t,n){var e=t.getIndex();if(null===e){var i=[],r=t.getAttribute("position");if(void 0===r)return console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),t;for(var o=0;o<r.count;o++)i.push(o);t.setIndex(i),e=t.getIndex()}var s=e.count-2,a=[];if(n===Ze)for(o=1;o<=s;o++)a.push(e.getX(0)),a.push(e.getX(o)),a.push(e.getX(o+1));else for(o=0;o<s;o++)o%2==0?(a.push(e.getX(o)),a.push(e.getX(o+1)),a.push(e.getX(o+2))):(a.push(e.getX(o+2)),a.push(e.getX(o+1)),a.push(e.getX(o)));a.length/3!=s&&console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");t=t.clone();return t.setIndex(a),t}return z.prototype.parse=function(n,t){var e=this,i=this.json,r=this.extensions;this.cache.removeAll(),this.markDefs(),Promise.all([this.getDependencies("scene"),this.getDependencies("animation"),this.getDependencies("camera")]).then(function(t){t={scene:t[0][i.scene||0],scenes:t[0],animations:t[1],cameras:t[2],asset:i.asset,parser:e,userData:{}};G(r,t,i),H(t,i),n(t)}).catch(t)},z.prototype.markDefs=function(){for(var t=this.json.nodes||[],n=this.json.skins||[],e=this.json.meshes||[],i={},r={},o=0,s=n.length;o<s;o++)for(var a=n[o].joints,u=0,h=a.length;u<h;u++)t[a[u]].isBone=!0;for(var c=0,f=t.length;c<f;c++){var l=t[c];void 0!==l.mesh&&(void 0===i[l.mesh]&&(i[l.mesh]=r[l.mesh]=0),i[l.mesh]++,void 0!==l.skin&&(e[l.mesh].isSkinnedMesh=!0))}this.json.meshReferences=i,this.json.meshUses=r},z.prototype.getDependency=function(t,n){var e=t+":"+n,i=this.cache.get(e);if(!i){switch(t){case"scene":i=this.loadScene(n);break;case"node":i=this.loadNode(n);break;case"mesh":i=this.loadMesh(n);break;case"accessor":i=this.loadAccessor(n);break;case"bufferView":i=this.loadBufferView(n);break;case"buffer":i=this.loadBuffer(n);break;case"material":i=this.loadMaterial(n);break;case"texture":i=this.loadTexture(n);break;case"skin":i=this.loadSkin(n);break;case"animation":i=this.loadAnimation(n);break;case"camera":i=this.loadCamera(n);break;case"light":i=this.extensions[f.KHR_LIGHTS_PUNCTUAL].loadLight(n);break;default:throw new Error("Unknown type: "+t)}this.cache.add(e,i)}return i},z.prototype.getDependencies=function(e){var i,t,n=this.cache.get(e);return n||(t=(i=this).json[e+("mesh"===e?"es":"s")]||[],n=Promise.all(t.map(function(t,n){return i.getDependency(e,n)})),this.cache.add(e,n)),n},z.prototype.loadBuffer=function(t){var e=this.json.buffers[t],i=this.fileLoader;if(e.type&&"arraybuffer"!==e.type)throw new Error("THREE.GLTFLoader: "+e.type+" buffer type is not supported.");if(void 0===e.uri&&0===t)return Promise.resolve(this.extensions[f.KHR_BINARY_GLTF].body);var r=this.options;return new Promise(function(t,n){i.load(B(e.uri,r.path),t,void 0,function(){n(new Error('THREE.GLTFLoader: Failed to load buffer "'+e.uri+'".'))})})},z.prototype.loadBufferView=function(t){var i=this.json.bufferViews[t];return this.getDependency("buffer",i.buffer).then(function(t){var n=i.byteLength||0,e=i.byteOffset||0;return t.slice(e,e+n)})},z.prototype.loadAccessor=function(t){var g=this,y=this.json,b=this.json.accessors[t];if(void 0===b.bufferView&&void 0===b.sparse)return Promise.resolve(null);t=[];return void 0!==b.bufferView?t.push(this.getDependency("bufferView",b.bufferView)):t.push(null),void 0!==b.sparse&&(t.push(this.getDependency("bufferView",b.sparse.indices.bufferView)),t.push(this.getDependency("bufferView",b.sparse.values.bufferView))),Promise.all(t).then(function(t){var n,e,i,r=t[0],o=k[b.type],s=O[b.componentType],a=s.BYTES_PER_ELEMENT,u=b.byteOffset||0,h=void 0!==b.bufferView?y.bufferViews[b.bufferView].byteStride:void 0,c=!0===b.normalized,f=h&&h!==a*o?(n=Math.floor(u/h),e="InterleavedBuffer:"+b.bufferView+":"+b.componentType+":"+n+":"+b.count,(i=g.cache.get(e))||(i=new _u(new s(r,n*h,b.count*h/a),h/a),g.cache.add(e,i)),new xu(i,o,u%h/a,c)):new Dr(null===r?new s(b.count*o):new s(r,u,b.count*o),o,c);if(void 0!==b.sparse){var a=O[b.sparse.indices.componentType],u=b.sparse.indices.byteOffset||0,c=b.sparse.values.byteOffset||0,l=new a(t[1],u,b.sparse.count*k.SCALAR),d=new s(t[2],c,b.sparse.count*o);null!==r&&(f=new Dr(f.array.slice(),f.itemSize,f.normalized));for(var v=0,p=l.length;v<p;v++){var m=l[v];if(f.setX(m,d[v*o]),2<=o&&f.setY(m,d[v*o+1]),3<=o&&f.setZ(m,d[v*o+2]),4<=o&&f.setW(m,d[v*o+3]),5<=o)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return f})},z.prototype.loadTexture=function(t){var n=this,e=this.json,r=this.options,o=this.textureLoader,i=self.URL||self.webkitURL,s=e.textures[t],a=s.extensions||{},u=a[f.MSFT_TEXTURE_DDS]?e.images[a[f.MSFT_TEXTURE_DDS].source]:e.images[s.source],h=u.uri,c=!1;return void 0!==u.bufferView&&(h=n.getDependency("bufferView",u.bufferView).then(function(t){c=!0;t=new Blob([t],{type:u.mimeType});return h=i.createObjectURL(t)})),Promise.resolve(h).then(function(e){var i=(i=r.manager.getHandler(e))||(a[f.MSFT_TEXTURE_DDS]?n.extensions[f.MSFT_TEXTURE_DDS].ddsLoader:o);return new Promise(function(t,n){i.load(B(e,r.path),t,void 0,n)})}).then(function(t){!0===c&&i.revokeObjectURL(h),t.flipY=!1,s.name&&(t.name=s.name),u.mimeType in U&&(t.format=U[u.mimeType]);var n=(e.samplers||{})[s.sampler]||{};return t.magFilter=A[n.magFilter]||On,t.minFilter=A[n.minFilter]||Cn,t.wrapS=C[n.wrapS]||Mn,t.wrapT=C[n.wrapT]||Mn,t})},z.prototype.assignTexture=function(e,i,r){var o=this;return this.getDependency("texture",r.index).then(function(t){if(!t.isCompressedTexture)switch(i){case"aoMap":case"emissiveMap":case"metalnessMap":case"normalMap":case"roughnessMap":t.format=Wn}var n;void 0===r.texCoord||0==r.texCoord||"aoMap"===i&&1==r.texCoord||console.warn("THREE.GLTFLoader: Custom UV set "+r.texCoord+" for texture "+i+" not yet supported."),!o.extensions[f.KHR_TEXTURE_TRANSFORM]||(n=void 0!==r.extensions?r.extensions[f.KHR_TEXTURE_TRANSFORM]:void 0)&&(t=o.extensions[f.KHR_TEXTURE_TRANSFORM].extendTexture(t,n)),e[i]=t})},z.prototype.assignFinalMaterial=function(t){var n,e,i,r=t.geometry,o=t.material,s=void 0!==r.attributes.tangent,a=void 0!==r.attributes.color,u=void 0===r.attributes.normal,h=!0===t.isSkinnedMesh,c=0<Object.keys(r.morphAttributes).length,f=c&&void 0!==r.morphAttributes.normal;t.isPoints?(e="PointsMaterial:"+o.uuid,(n=this.cache.get(e))||(n=new Xc,tr.prototype.copy.call(n,o),n.color.copy(o.color),n.map=o.map,n.sizeAttenuation=!1,this.cache.add(e,n)),o=n):t.isLine&&(e="LineBasicMaterial:"+o.uuid,(i=this.cache.get(e))||(i=new $c,tr.prototype.copy.call(i,o),i.color.copy(o.color),this.cache.add(e,i)),o=i),(s||a||u||h||c)&&(e="ClonedMaterial:"+o.uuid+":",o.isGLTFSpecularGlossinessMaterial&&(e+="specular-glossiness:"),h&&(e+="skinning:"),s&&(e+="vertex-tangents:"),a&&(e+="vertex-colors:"),u&&(e+="flat-shading:"),c&&(e+="morph-targets:"),f&&(e+="morph-normals:"),(i=this.cache.get(e))||(i=o.clone(),h&&(i.skinning=!0),s&&(i.vertexTangents=!0),a&&(i.vertexColors=!0),u&&(i.flatShading=!0),c&&(i.morphTargets=!0),f&&(i.morphNormals=!0),this.cache.add(e,i)),o=i),o.aoMap&&void 0===r.attributes.uv2&&void 0!==r.attributes.uv&&r.setAttribute("uv2",new Dr(r.attributes.uv.array,2)),o.normalScale&&!s&&(o.normalScale.y=-o.normalScale.y),o.clearcoatNormalScale&&!s&&(o.clearcoatNormalScale.y=-o.clearcoatNormalScale.y),t.material=o},z.prototype.loadMaterial=function(t){var n,e,i=this.json,r=this.extensions,o=i.materials[t],s={},a=o.extensions||{},i=[];a[f.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]?(t=r[f.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS],n=t.getMaterialType(),i.push(t.extendParams(s,o,this))):a[f.KHR_MATERIALS_UNLIT]?(e=r[f.KHR_MATERIALS_UNLIT],n=e.getMaterialType(),i.push(e.extendParams(s,o,this))):(n=nr,u=o.pbrMetallicRoughness||{},s.color=new _i(1,1,1),s.opacity=1,Array.isArray(u.baseColorFactor)&&(s.color.fromArray(e=u.baseColorFactor),s.opacity=e[3]),void 0!==u.baseColorTexture&&i.push(this.assignTexture(s,"map",u.baseColorTexture)),s.metalness=void 0!==u.metallicFactor?u.metallicFactor:1,s.roughness=void 0!==u.roughnessFactor?u.roughnessFactor:1,void 0!==u.metallicRoughnessTexture&&(i.push(this.assignTexture(s,"metalnessMap",u.metallicRoughnessTexture)),i.push(this.assignTexture(s,"roughnessMap",u.metallicRoughnessTexture)))),!0===o.doubleSided&&(s.side=Ot);var u=o.alphaMode||I;return u===F?(s.transparent=!0,s.depthWrite=!1):(s.transparent=!1,u===N&&(s.alphaTest=void 0!==o.alphaCutoff?o.alphaCutoff:.5)),void 0!==o.normalTexture&&n!==wo&&(i.push(this.assignTexture(s,"normalMap",o.normalTexture)),s.normalScale=new ci(1,1),void 0!==o.normalTexture.scale&&s.normalScale.set(o.normalTexture.scale,o.normalTexture.scale)),void 0!==o.occlusionTexture&&n!==wo&&(i.push(this.assignTexture(s,"aoMap",o.occlusionTexture)),void 0!==o.occlusionTexture.strength&&(s.aoMapIntensity=o.occlusionTexture.strength)),void 0!==o.emissiveFactor&&n!==wo&&(s.emissive=(new _i).fromArray(o.emissiveFactor)),void 0!==o.emissiveTexture&&n!==wo&&i.push(this.assignTexture(s,"emissiveMap",o.emissiveTexture)),a[f.KHR_MATERIALS_CLEARCOAT]&&(u=r[f.KHR_MATERIALS_CLEARCOAT],n=u.getMaterialType(),i.push(u.extendParams(s,{extensions:a},this))),Promise.all(i).then(function(){var t=n===h?r[f.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(s):new n(s);return o.name&&(t.name=o.name),t.map&&(t.map.encoding=qe),t.emissiveMap&&(t.emissiveMap.encoding=qe),H(t,o),o.extensions&&G(r,t,o),t})},z.prototype.loadGeometries=function(t){var e=this,i=this.extensions,n=this.primitiveCache;for(var r=[],o=0,s=t.length;o<s;o++){var a=t[o],u=(u=void 0,h=(u=(h=a).extensions&&h.extensions[f.KHR_DRACO_MESH_COMPRESSION])?"draco:"+u.bufferView+":"+u.indices+":"+V(u.attributes):h.indices+":"+V(h.attributes)+":"+h.mode),h=n[u];h?r.push(h.promise):(h=a.extensions&&a.extensions[f.KHR_DRACO_MESH_COMPRESSION]?function(n){return i[f.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(n,e).then(function(t){return W(t,n,e)})}(a):W(new $r,a,e),n[u]={primitive:a,promise:h},r.push(h))}return Promise.all(r)},z.prototype.loadMesh=function(f){for(var l=this,d=this.json.meshes[f],v=d.primitives,t=[],n=0,e=v.length;n<e;n++){var i=void 0===v[n].material?(void 0===(i=this.cache).DefaultMaterial&&(i.DefaultMaterial=new nr({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:Lt})),i.DefaultMaterial):this.getDependency("material",v[n].material);t.push(i)}return t.push(l.loadGeometries(v)),Promise.all(t).then(function(t){for(var n=t.slice(0,t.length-1),e=t[t.length-1],i=[],r=0,o=e.length;r<o;r++){var s,a=e[r],u=v[r],h=n[r];if(u.mode===E||u.mode===L||u.mode===R||void 0===u.mode)!0!==(s=new(!0===d.isSkinnedMesh?jf:Uo)(a,h)).isSkinnedMesh||s.geometry.attributes.skinWeight.normalized||s.normalizeSkinWeights(),u.mode===L?s.geometry=X(s.geometry,1):u.mode===R&&(s.geometry=X(s.geometry,Ze));else if(u.mode===x)s=new zf(a,h);else if(u.mode===S)s=new Gf(a,h);else if(u.mode===M)s=new Wf(a,h);else{if(u.mode!==w)throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+u.mode);s=new Kf(a,h)}0<Object.keys(s.geometry.morphAttributes).length&&function(t,n){if(t.updateMorphTargets(),void 0!==n.weights)for(var e=0,i=n.weights.length;e<i;e++)t.morphTargetInfluences[e]=n.weights[e];if(n.extras&&Array.isArray(n.extras.targetNames)){var r=n.extras.targetNames;if(t.morphTargetInfluences.length===r.length){t.morphTargetDictionary={};for(e=0,i=r.length;e<i;e++)t.morphTargetDictionary[r[e]]=e}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}(s,d),s.name=d.name||"mesh_"+f,1<e.length&&(s.name+="_"+r),H(s,d),l.assignFinalMaterial(s),i.push(s)}if(1===i.length)return i[0];for(var c=new Fa,r=0,o=i.length;r<o;r++)c.add(i[r]);return c})},z.prototype.loadCamera=function(t){var n,e=this.json.cameras[t],t=e[e.type];if(t)return"perspective"===e.type?n=new Y(Mt.radToDeg(t.yfov),t.aspectRatio||1,t.znear||1,t.zfar||2e6):"orthographic"===e.type&&(n=new q(t.xmag/-2,t.xmag/2,t.ymag/2,t.ymag/-2,t.znear,t.zfar)),e.name&&(n.name=e.name),H(n,e),Promise.resolve(n);console.warn("THREE.GLTFLoader: Missing camera parameters.")},z.prototype.loadSkin=function(t){var t=this.json.skins[t],n={joints:t.joints};return void 0===t.inverseBindMatrices?Promise.resolve(n):this.getDependency("accessor",t.inverseBindMatrices).then(function(t){return n.inverseBindMatrices=t,n})},z.prototype.loadAnimation=function(S){for(var E=this.json.animations[S],t=[],n=[],e=[],i=[],r=[],o=0,s=E.channels.length;o<s;o++){var a=E.channels[o],u=E.samplers[a.sampler],h=a.target,c=void 0!==h.node?h.node:h.id,f=void 0!==E.parameters?E.parameters[u.input]:u.input,a=void 0!==E.parameters?E.parameters[u.output]:u.output;t.push(this.getDependency("node",c)),n.push(this.getDependency("accessor",f)),e.push(this.getDependency("accessor",a)),i.push(u),r.push(h)}return Promise.all([Promise.all(t),Promise.all(n),Promise.all(e),Promise.all(i),Promise.all(r)]).then(function(t){for(var n=t[0],e=t[1],i=t[2],r=t[3],o=t[4],s=[],a=0,u=n.length;a<u;a++){var h,c=n[a],f=e[a],l=i[a],d=r[a],v=o[a];if(void 0!==c){switch(c.updateMatrix(),c.matrixAutoUpdate=!0,D[v.path]){case D.weights:h=yf;break;case D.rotation:h=_f;break;case D.position:case D.scale:default:h=xf}var p=c.name||c.uuid,m=void 0!==d.interpolation?j[d.interpolation]:ze,g=[];D[v.path]===D.weights?c.traverse(function(t){!0===t.isMesh&&t.morphTargetInfluences&&g.push(t.name||t.uuid)}):g.push(p);var y,b=l.array;if(l.normalized){if(b.constructor===Int8Array)y=1/127;else if(b.constructor===Uint8Array)y=1/255;else if(b.constructor==Int16Array)y=1/32767;else{if(b.constructor!==Uint16Array)throw new Error("THREE.GLTFLoader: Unsupported output accessor component type.");y=1/65535}for(var _=new Float32Array(b.length),w=0,x=b.length;w<x;w++)_[w]=b[w]*y;b=_}for(w=0,x=g.length;w<x;w++){var M=new h(g[w]+"."+D[v.path],f.array,b,m);"CUBICSPLINE"===d.interpolation&&(M.createInterpolant=function(t){return new T(this.times,this.values,this.getValueSize()/3,t)},M.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0),s.push(M)}}}return new Mf(E.name||"animation_"+S,void 0,s)})},z.prototype.loadNode=function(t){var n=this.json,o=this.extensions,e=this,i=n.meshReferences,r=n.meshUses,s=n.nodes[t];return t=[],void 0!==s.mesh&&t.push(e.getDependency("mesh",s.mesh).then(function(t){var n,e;return 1<i[s.mesh]?(n=r[s.mesh]++,(e=t.clone()).name+="_instance_"+n):e=t,void 0!==s.weights&&e.traverse(function(t){if(t.isMesh)for(var n=0,e=s.weights.length;n<e;n++)t.morphTargetInfluences[n]=s.weights[n]}),e})),void 0!==s.camera&&t.push(e.getDependency("camera",s.camera)),s.extensions&&s.extensions[f.KHR_LIGHTS_PUNCTUAL]&&void 0!==s.extensions[f.KHR_LIGHTS_PUNCTUAL].light&&t.push(e.getDependency("light",s.extensions[f.KHR_LIGHTS_PUNCTUAL].light)),Promise.all(t).then(function(t){var n,e=!0===s.isBone?new Qf:1<t.length?new Fa:1===t.length?t[0]:new Z;if(e!==t[0])for(var i=0,r=t.length;i<r;i++)e.add(t[i]);return s.name&&(e.userData.name=s.name,e.name=il.sanitizeNodeName(s.name)),H(e,s),s.extensions&&G(o,e,s),void 0!==s.matrix?((n=new Et).fromArray(s.matrix),e.applyMatrix4(n)):(void 0!==s.translation&&e.position.fromArray(s.translation),void 0!==s.rotation&&e.quaternion.fromArray(s.rotation),void 0!==s.scale&&e.scale.fromArray(s.scale)),e})},z.prototype.loadScene=function(t){var n=this.json,e=this.extensions,t=this.json.scenes[t],i=new Sr;t.name&&(i.name=t.name),H(i,t),t.extensions&&G(e,i,t);for(var r=t.nodes||[],o=[],s=0,a=r.length;s<a;s++)o.push(function s(t,a,u,h){var c=u.nodes[t];return h.getDependency("node",t).then(function(t){return void 0===c.skin?t:h.getDependency("skin",c.skin).then(function(t){for(var n=[],e=0,i=(a=t).joints.length;e<i;e++)n.push(h.getDependency("node",a.joints[e]));return Promise.all(n)}).then(function(s){return t.traverse(function(t){if(t.isMesh){for(var n=[],e=[],i=0,r=s.length;i<r;i++){var o=s[i];o?(n.push(o),o=new Et,void 0!==a.inverseBindMatrices&&o.fromArray(a.inverseBindMatrices.array,16*i),e.push(o)):console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',a.joints[i])}t.bind(new sl(n,e),t.matrixWorld)}}),t});var a}).then(function(t){a.add(t);var n=[];if(c.children)for(var e=c.children,i=0,r=e.length;i<r;i++){var o=e[i];n.push(s(o,t,u,h))}return Promise.all(n)})}(r[s],i,n,this));return Promise.all(o).then(function(){return i})},t}();function 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 cl(t,n){var e;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(e=function(t,n){if(t){if("string"==typeof t)return fl(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(e="Object"===e&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?fl(t,n):void 0}}(t))||n&&t&&"number"==typeof t.length){e&&(t=e);var i=0,n=function(){};return{s:n,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o=!0,s=!1;return{s:function(){e=t[Symbol.iterator]()},n:function(){var t=e.next();return o=t.done,t},e:function(t){s=!0,r=t},f:function(){try{o||null==e.return||e.return()}finally{if(s)throw r}}}}function fl(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 ll(t,n){return(ll=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function dl(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=vl(e);return t=i?(t=vl(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==hl(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function vl(t){return(vl=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}Fi=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&ll(t,n)}(i,tc);var e=dl(i);function i(t){var n;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,i),(n=e.call(this)).V=t,n.sa=new Tf,n.aa=new ul,n.ua=!1,n}return i}();Object.assign(Fi.prototype,{Jr:function(o,s,n){var a,t,u=this;this.fo.has(o)?(this.vo(o,{success:s,fail:n}),!0===this.fo.get(o).loadComplete&&this.ha(o)):(this.fo.set(o,{loadComplete:!1}),a=-1===o.indexOf(".js"),t=this.aa,(t=!a?this.sa:t).load(o,function(t,n){if(a)u.fo.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=cl(n);try{for(i.s();!(e=i.n()).done;){var r=e.value;r.map&&u.ua&&r.color.setScalar(1)}}catch(t){i.e(t)}finally{i.f()}}else n.map&&u.ua&&n.color.setScalar(1);u.fo.set(o,{geometry:t,material:n,isGltf:!1,loadComplete:!0}),s&&s(a,t,n)}u.V.Zt.ca(),u.ha(o,!1)},function(t){},function(t){u.fo.delete(o),n&&n(t),u.ha(o,t)}))},ha:function(r,o){var s,a=this;!this.do.has(r)||(s=this.fo.get(r))&&(this.do.get(r).forEach(function(t,n,e){var i;o?n.fail&&n.fail(o):s.isGltf?s.isAnimate?a.aa.parse(s.data,Gc(r),function(t){n.success&&n.success(!0,t)},function(t){n.fail&&n.fail(t)}):((i={animations:[]}).scene=s.gltf.scene.clone(),n.success&&n.success(!0,i)):n.success&&n.success(!1,s.geometry,s.material),e.delete(t)}),this.do.delete(r))},ct:function(){this.sa=null,this.aa=null}});var pl=Fi;function ml(t){return(ml="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function gl(t,n){return(gl=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function yl(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=bl(e);return t=i?(t=bl(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==ml(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function bl(t){return(bl=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}e=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&gl(t,n)}(e,tc);var n=yl(e);function e(){var t;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,e),(t=n.call(this)).aa=new ul,t}return e}();Object.assign(e.prototype,{Jr:function(e,i,r){var o=this;this.fo.has(e)?(this.vo(e,{success:i,fail:r}),!0===this.fo.get(e).loadComplete&&this.ha(e)):(this.fo.set(e,{loadComplete:!1}),this.aa.load(e,function(t,n){t.scene.userData.sourceScale=t.scene.scale.clone(),o.fo.set(e,{gltf:t,isAnimate:0<t.animations.length,data:0<t.animations.length?n:null,loadComplete:!0}),o.vo(e,{success:i,fail:r}),o.ha(e)},function(t){},function(t){o.fo.delete(e),r&&r(t),o.ha(e,t)}))},ha:function(r,o){var s,a=this;!this.do.has(r)||(s=this.fo.get(r))&&(this.do.get(r).forEach(function(t,n,e){var i;o?n.fail&&n.fail(o):s.isAnimate?a.aa.parse(s.data,Gc(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.do.delete(r))},ct:function(){this.aa=null}});var _l=e;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,i.key,i)}}Ji=function(){function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),this.ie=-1,this.Yn=Di.NONE,this.Ti=!0,this.K=null,this.Mt=[],this.wr=new Nh,this.fa=!0}var n,e,i;return n=t,(e=[{key:"type",get:function(){return this.Yn}},{key:"visible",get:function(){return this.Ti},set:function(t){this.Ti=t}},{key:"parent",get:function(){return this.K}},{key:"traverse",value:function(t){for(var n=0;n<this.Mt.length;n++)t(this.Mt[n])}},{key:"needUpdateBound",get:function(){return this.fa},set:function(t){!0===(this.fa=t)&&null!==this.parent&&(this.parent.needUpdateBound=t)}}])&&wl(n.prototype,e),i&&wl(n,i),t}();Object.assign(Ji.prototype,{la:function(t){for(var n=this.K;n;){if(n instanceof t)return n;n=n.K}return null}});var xl=Ji;function Ml(t){return(Ml="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 Sl(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function El(t,n){return(El=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Tl(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Ll(e);return t=i?(t=Ll(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Ml(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function Ll(t){return(Ll=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Rl=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&El(t,n)}(r,xl);var t,n,e,i=Tl(r);function r(){var t;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(t=i.call(this)).ci=new Sr,t}return t=r,(n=[{key:"scene",get:function(){return this.ci}},{key:"bound",get:function(){var n=this;return!0===this.needUpdateBound&&(this.wr.reset(),this.Mt.forEach(function(t){n.wr.expand(t.bound)}),this.needUpdateBound=!1),this.wr.clone()}}])&&Sl(t.prototype,n),e&&Sl(t,e),r}();function Ol(t){return(Ol="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,i.key,i)}}function Cl(t,n){return(Cl=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function kl(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Pl(e);return t=i?(t=Pl(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Ol(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function Pl(t){return(Pl=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Dl=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Cl(t,n)}(r,Rl);var t,n,e,i=kl(r);function r(){return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),i.call(this)}return t=r,(n=[{key:"removeLight",value:function(){this.da&&this.da()}},{key:"putLight",value:function(){this.va&&this.va()}},{key:"visible",get:function(){return this.Ti},set:function(t){this.Ti=t,this.ci.visible=!(!this.K.visible||!this.Ti);t=this.la(Bg);t&&t.Zt.pa()}},{key:"getBound",value:function(){return{maxY:this.bound.max.y,maxX:this.bound.max.x,minX:this.bound.min.x,minY:this.bound.min.y}}}])&&Al(t.prototype,n),e&&Al(t,e),r}();function jl(t){return(jl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Il(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Nl(t,n){return(Nl=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Fl(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Ul(e);return t=i?(t=Ul(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==jl(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function Ul(t){return(Ul=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}br=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Nl(t,n)}(r,xl);var t,n,e,i=Fl(r);function r(t){var n;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(n=i.call(this)).ma=t.buildingID,n.ga=t.name,n.I=t.x,n.N=t.y,n.ya=void 0!==t.floorSpace?t.floorSpace:50,n.Wt=t.height,n.ba=new $(new St(t.bounds.minX,t.bounds.minY),new St(t.bounds.maxX,t.bounds.maxY)),n._a=t.zoom,n.wa=t.levels,n.Mn=[],n.xa=null,n.Ma=null,n.Sa=[],n}return t=r,(n=[{key:"bound",get:function(){var n=this;return!0===this.needUpdateBound&&(this.wr.copy(this.ba),this.Mt.forEach(function(t){n.wr.expand(t.bound)}),this.needUpdateBound=!1),this.wr.clone()}},{key:"height",get:function(){return this.Wt}},{key:"x",get:function(){return this.I}},{key:"y",get:function(){return this.N}},{key:"getFloorsInfo",value:function(){var n=this;return null===this.Ma&&(this.Ma=[],this.K.Ea.Hr.get(this.ma).Mt.forEach(function(t){n.Ma.push(t)})),this.Ma}},{key:"getFloors",value:function(){return this.Mt}},{key:"getFloor",value:function(n){var e=null;return this.traverse(function(t){t.Lt===n&&(e=t)}),e}},{key:"getFloorSpace",value:function(){return this.ya}},{key:"setFloorSpace",value:function(t){this.ya=t;for(var n=0;n<this.Mt.length;n++){var e=this.Mt[n].Mt;this.Mt[n].Wt=t*this.Mt[n].Lt;for(var i=0;i<e.length;i++)Di.LINE_MARKER!==e[i].Yn&&Di.LOCATION_MARKER!==e[i].Yn&&(e[i].ci.position.y=t*this.Mt[n].Lt)}this.K.W.Sn({level:this.K.wt.Lt})}}])&&Il(t.prototype,n),e&&Il(t,e),r}();Object.assign(br.prototype,{dn:function(t){(t.K=this).Mt.push(t)},ct:function(){for(var t,n=0;n<this.Mt.length;n++)this.Mt[n]&&this.Mt[n].ct&&this.Mt[n].ct();for(t in this.Mt.length=0,this)this[""+t]=null,delete this[""+t]}});var Bl=br;function Gl(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var Hl=function(){function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t)}var n,e,i;return n=t,i=[{key:"distance",value:function(t,n){return du.distance(t,n)}},{key:"isContain",value:function(t,n){return du.isPolygonContainPoint(t,n)}},{key:"bound",value:function(t){for(var n=-Number.MAX_VALUE,e=-Number.MAX_VALUE,i=Number.MAX_VALUE,r=Number.MAX_VALUE,o=0;o<t.length;o++)t[o].x>n&&(n=t[o].x),t[o].y>e&&(e=t[o].y),t[o].x<i&&(i=t[o].x),t[o].y<r&&(r=t[o].y);return{max:{x:n,y:e},min:{x:i,y:r},size:{x:n-i,y:e-r},center:{x:(n+i)/2,y:(e+r)/2}}}},{key:"scaleBound",value:function(t,n){var e=t.max,i=t.min,t=new ci(e.x,e.y),e=new ci(i.x,i.y),i=t.clone().add(e).multiplyScalar(.5),t=t.clone().sub(e),e=t.clone().normalize(),t=t.clone().length()*n,n=i.clone().add(e.clone().multiplyScalar(t/2)),i=i.clone().add(e.clone().multiplyScalar(-t/2)),e=n.x,t=n.y,n=i.x,i=i.y;return{max:{x:e,y:t},min:{x:n,y:i},size:{x:Math.abs(e-n),y:Math.abs(t-i)},center:{x:(e+n)/2,y:(t+i)/2}}}},{key:"rectangleBuilder",value:function(t,n,e){var i=[];return i.push({x:e.x-t/2,y:e.y+n/2}),i.push({x:e.x+t/2,y:e.y+n/2}),i.push({x:e.x+t/2,y:e.y-n/2}),i.push({x:e.x-t/2,y:e.y-n/2}),i}},{key:"circleBuilder",value:function(t,n,e){for(var i=[],r=0;r<=e;r++){var o=r/e*Math.PI*2;i.push({x:n.x+t*Math.cos(o),y:n.y+t*Math.sin(o)})}return i}},{key:"fanBuilder",value:function(t,n,e,i){var r=[];r.push(n);for(var o=[i[0]/180*Math.PI,i[1]/180*Math.PI],s=(o[1]-o[0])/e,a=0;a<=e;a++){var u=o[0]+a*s;r.push({x:n.x+t*Math.sin(u),y:n.y+t*Math.cos(u)})}return r}},{key:"area",value:function(t){return du.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=[];i.forEach(function(t,n,e){s.push(t)});var a=!1;s.sort(function(t,n){return(0<t.area?t.area:-t.area)-(0<n.area?n.area:-n.area)});for(;0<s.length&&!(a=this.calculatorCentroid(t,s,n));)s.shift();if(a)return a;var u=[];i.forEach(function(t,n,e){u.push(t)});for(;0<u.length&&!(a=this.calculatorCentroid(t,u,n));)u.shift();return a}},{key:"calculatorCentroid",value:function(t,n,e){for(var i=0,r={x:0,y:0},o=0;o<n.length;o++)r.x+=n[o].centroid.x*n[o].area,r.y+=n[o].centroid.y*n[o].area,i+=n[o].area;return e.x=r.x/i,e.y=r.y/i,this.isContain(t,e)}},{key:"latlngToMapCoordinate",value:function(t){return{x:20037508.34*parseFloat(t.x)/180,y:Math.log(Math.tan((90+parseFloat(t.y))*Math.PI/360))/(Math.PI/180)*20037508.34/180}}},{key:"mapCoordinateToLatlng",value:function(t){var n=parseFloat(t.y)/20037508.34*180;return{x:parseFloat(t.x)/20037508.34*180,y:180/Math.PI*(2*Math.atan(Math.exp(n*Math.PI/180))-Math.PI/2)}}}],(e=null)&&Gl(n.prototype,e),i&&Gl(n,i),t}();function Vl(t){return(Vl="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 zl(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Wl(t,n){return(Wl=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Xl(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Zl(e);return t=i?(t=Zl(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Vl(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function Zl(t){return(Zl=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}pr=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Wl(t,n)}(r,xl);var t,n,e,i=Xl(r);function r(t){var n;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(n=i.call(this)).te=t,n.Wt=t.height,n.Yn=Di.EXTENT,n.Rs=null,n.Ta=null,n.Dn=null,n}return t=r,(n=[{key:"bound",get:function(){return!0===this.needUpdateBound&&(this.te.wr=null,this.wr=this.te.getBound(),this.needUpdateBound=!1),this.wr.clone()}},{key:"x",get:function(){return this.wr.center.x}},{key:"y",get:function(){return this.wr.center.y}},{key:"ID",get:function(){return this.te.ie}},{key:"height",get:function(){return this.te.height}},{key:"level",get:function(){return this.K.K.Lt}},{key:"visible",get:function(){return this.Ti},set:function(t){this.Ti=t,this.La()}},{key:"getData",value:function(){var t=this.te;return{ID:t.ie,height:t.height,area:t.area}}},{key:"getBound",value:function(){return{minX:this.bound.pr.x,maxX:this.bound.mr.x,minY:this.bound.pr.y,maxY:this.bound.mr.y}}},{key:"getArea",value:function(){return Hl.area(this.te._r[0])}}])&&zl(t.prototype,n),e&&zl(t,e),r}();Object.assign(pr.prototype,{bs:function(){var t,n,e,i;this.Dn||(i=this.la(Bg))&&(t=this.la(Bl),n=i.Zt.Ra(this.te,this.Wt,t),this.Rs=t.xa.ks(),e=this.Oa(i),i=this.te.getBound(),this.Dn=new Uo(n.geometry,e),this.Dn.rotation.set(-Math.PI/2,0,0,"XYZ"),this.Dn.position.set(i.center.x-t.I,-this.Wt,t.N-i.center.y),this.Dn.receiveShadow=!0,this.Dn.visible=this.Ti,(this.Dn.mapNode=this).K.ci.add(this.Dn))},Aa:function(t,n){this.Dn&&(this.Rs=n.ks(),this.Ca())},ka:function(t){t!==this.Ta&&(this.Ta=t,this.Ca())},Ca:function(){var t;!this.Dn||(t=this.la(Bg))&&(this.Dn.material=this.Oa(t),t.enableUpdateRender())},Oa:function(t){var n=this.la(um),n={color:this.Rs.color,alpha:this.Rs.alpha*n.Pa};this.Ta&&(n.url=this.Ta,n.finish=function(){t.enableUpdateRender()});n=t.Zt.Jn.Go(n);return n.polygonOffset=!0,n.polygonOffsetFactor=1,n.polygonOffsetUnits=4,n.userData.opacity=n.opacity,n},La:function(){var t=this.la(Bg);t&&(this.Dn&&(this.Dn.visible=this.Ti),t.enableUpdateNode(),t.enableUpdateRender())},ct:function(){for(var t in this.Da(),this)this[""+t]=null,delete this[""+t]},Da:function(){this.Dn&&(this.Dn.parent.remove(this.Dn),this.Dn.geometry.dispose(),this.Dn.geometry=void 0,this.Dn.material=void 0,this.Dn.mapNode=void 0,this.Dn=void 0)}});var Yl=pr;function ql(t,n){Lf.call(this,t,n),this.type="AmbientLight",this.castShadow=void 0}function Kl(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}ql.prototype=Object.assign(Object.create(Lf.prototype),{constructor:ql,isAmbientLight:!0});var Jl=function(){function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t)}var n,e,i;return n=t,(e=[{key:"createLight",value:function(t,n,e){e=n.getMapOptions().lightConfig[e];t.ja=new ql(e[1].color,e[1].intensity),t.Ia=new Z,t.Na=new Af(e[0].color,e[0].intensity),t.Na.position.set(e[0].position.x,e[0].position.y,e[0].position.z).normalize(),t.Na.target=t.Ia,t.Fa=new Af(e[2].color,e[2].intensity),t.Fa.position.set(e[2].position.x,e[2].position.y,e[2].position.z).normalize(),t.Fa.target=t.Ia}}])&&Kl(n.prototype,e),i&&Kl(n,i),t}();function Ql(t){return(Ql="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){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var e=[],i=!0,r=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(i=(s=a.next()).done)&&(e.push(s.value),!n||e.length!==n);i=!0);}catch(t){r=!0,o=t}finally{try{i||null==a.return||a.return()}finally{if(r)throw o}}return e}}(t,n)||td(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 td(t,n){if(t){if("string"==typeof t)return nd(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(e="Object"===e&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?nd(t,n):void 0}}function nd(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 ed(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function id(t,n){return(id=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function rd(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=od(e);return t=i?(t=od(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Ql(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function od(t){return(od=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}di=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&id(t,n)}(r,Dl);var t,n,e,i=rd(r);function r(t,n){var e;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(e=i.call(this)).Ua=t.alias,e.Ba=t.desc,e.Wt=t.height,e.Yn=Di.EXTENT_LAYER,e.ci.name="extent",e.ci.userData.type="extent",e.Ga={},e.Ha(t,n),e}return t=r,(n=[{key:"level",get:function(){return this.K.Lt}},{key:"getFeatures",value:function(){return this.Mt}}])&&ed(t.prototype,n),e&&ed(t,e),r}();Object.assign(di.prototype,{Ha:function(t,n){var e,i=function(t,n){var e;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(e=td(t))||n&&t&&"number"==typeof t.length){e&&(t=e);var i=0,n=function(){};return{s:n,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o=!0,s=!1;return{s:function(){e=t[Symbol.iterator]()},n:function(){var t=e.next();return o=t.done,t},e:function(t){s=!0,r=t},f:function(){try{o||null==e.return||e.return()}finally{if(s)throw r}}}}(t.Mt);try{for(i.s();!(e=i.n()).done;){var r=$l(e.value,2),o=(r[0],r[1]),s=new Yl(o);this.dn(s),s.visible=n.map.Zt.Va(this.Yn,{typeID:s.typeID,FID:s.FID})}}catch(t){i.e(t)}finally{i.f()}},dn:function(t){(t.K=this).Mt.push(t)},za:function(){var t=this.la(Bg);(new Jl).createLight(this,t,"FMExtentLayer")},va:function(){this.ci.add(this.Na),this.ci.add(this.ja),this.ci.add(this.Fa),this.ci.add(this.Ia)},da:function(){this.ci.remove(this.Na),this.ci.remove(this.ja),this.ci.remove(this.Fa)},Wa:function(){this.Na=void 0,this.ja=void 0,this.Fa=void 0},ct:function(){this.da(),this.Wa(),this.ci.children=[];for(var t,n=0;n<this.Mt.length;n++)this.Mt[n].ct();for(t in this.Mt.length=0,this)this[""+t]=null,delete this[""+t]}});var sd=di;function ad(t){return(ad="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 ud(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function hd(t,n){return(hd=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function cd(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=fd(e);return t=i?(t=fd(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==ad(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function fd(t){return(fd=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}pi=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&hd(t,n)}(r,xl);var t,n,e,i=cd(r);function r(t){var n;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(n=i.call(this)).te=t,n.Xa=t.maxlevel,n.Za=t.minlevel,n.Wt=t.height,n.Yn=Di.MODEL,n.Dn=null,n.Ya=null,n.St=null,n.wr=null,n.qa="#FF0000",n.Ka=null,n.$n={top:null,left:null,right:null,front:null,back:null},n.Rs=null,n.Ja=null,n.Pa=null,n.Qa=null,n.$a=null,n.tu=null,n.nu=null,n.eu=[0,0],n.iu=null,n.ru=0,n}return t=r,(n=[{key:"bound",get:function(){return!0===this.needUpdateBound&&(this.te.wr=null,this.wr=this.te.getBound(),this.needUpdateBound=!1),this.wr.clone()}},{key:"x",get:function(){return this.bound.center.x}},{key:"y",get:function(){return this.bound.center.y}},{key:"ID",get:function(){return this.te.ie}},{key:"FID",get:function(){return this.te.fid}},{key:"zoomRange",get:function(){return{maxLevel:this.Xa,minLevel:this.Za}}},{key:"name",get:function(){return this.te.name}},{key:"eName",get:function(){return this.te.ename}},{key:"pass",get:function(){return this.te.pass}},{key:"level",get:function(){return this.K.K.Lt}},{key:"height",get:function(){return this.te.height}},{key:"typeID",get:function(){return this.te.type}},{key:"visible",get:function(){return this.Ti},set:function(t){this.Ti=t,this.La()}},{key:"coordinates",get:function(){return this.te._r}},{key:"getData",value:function(){var t=this.te;return{ID:t.ie,typeID:t.type,FID:t.fid,height:t.height,name:t.name,eName:t.ename,minLevel:t.minlevel,maxLevel:t.maxlevel,pass:t.pass}}},{key:"getArea",value:function(){return Hl.area(this.te._r[0])}},{key:"setColor",value:function(t,n){void 0!==t&&(this.Ja=t),void 0!==n&&(this.Pa=n),this.Ca()}},{key:"resetColor",value:function(){this.Rs||this.ou(),this.setColor(this.Rs.color,this.Rs.alpha)}},{key:"setBorderColor",value:function(t,n){t&&(this.Qa=t),n&&(this.$a=n);n=this.la(Bg);this.su(n)}},{key:"resetBorderColor",value:function(){this.Rs&&this.setBorderColor(this.Rs.strokeColor,this.Rs.alpha)}},{key:"setTopImage",value:function(t){this.tu=t.image,this.iu=void 0!==t.coords?t.coords:this.te.zt,this.nu=void 0!==t.size?t.size:[5,5],this.eu=void 0!==t.offset?t.offset:[0,0],this.ru=void 0!==t.angle?t.angle:0,this.Dn&&this.au()}},{key:"clearTopImage",value:function(){var t;this.$n.top&&this.$n.top.parent&&(this.$n.top.parent.remove(this.$n.top),this.$n.top.geometry.dispose(),this.$n.top.material.map&&this.$n.top.material.map.dispose(),this.$n.top.material.dispose(),this.$n.top=null,(t=this.la(Bg))&&t.enableUpdateRender())}},{key:"flash",value:function(t){this.uu(t);var e=this,i=this.la(Bg);!function(){e.Ka&&clearTimeout(e.Ka);var n=0;{var t;e.Dn&&!e.Dn.userData.sourceMaterial&&(t=function t(){n%2==0?e.Dn&&(e.Dn.material.color=new _i(e.qa)):e.Dn&&(e.Dn.material.color=new _i(e.Ja)),n++,i.enableUpdateRender(),e.Ka=setTimeout(t,100)},e.Dn.userData.sourceMaterial=e.Dn.material,e.Dn.material=e.Dn.material.clone(),t())}}()}},{key:"stopFlash",value:function(){var t;this.Ka&&(clearTimeout(this.Ka),this.Ka=null,t=this.Dn.material,this.Dn.material=this.Dn.userData.sourceMaterial,delete this.Dn.userData.sourceMaterial,t.dispose(),t=null,this.la(Bg).enableUpdateRender())}},{key:"getBound",value:function(){return{maxY:this.bound.max.y,maxX:this.bound.max.x,minX:this.bound.min.x,minY:this.bound.min.y}}}])&&ud(t.prototype,n),e&&ud(t,e),r}();Object.assign(pi.prototype,{bs:function(){var t,n,e,i;this.Dn||(n=(i=(t=this.la(um).K).K.Zt).Ra(this.te,this.Wt,t),this.ou(),this.Ja||(this.Ja=this.Rs.color),this.Pa||(this.Pa=this.Rs.alpha),this.Qa||(this.Qa=this.Rs.strokeColor),this.$a||(this.$a=this.Rs.alpha),(e=this.Oa(i.Jn)).userData.opacity=e.opacity,i=this.te.getBound(),this.Dn=new Uo(n.geometry,e),i=new St(i.center.x-t.I,0,t.N-i.center.y),this.Dn.position.copy(i),this.Dn.rotation.set(-Math.PI/2,0,0,"XYZ"),(this.Dn.mapNode=this).K.ci.add(this.Dn),this.hu(n.shape),this.cu())},hu:function(t){var n=this.la(Bl).K.Zt,r=this.fu(n.Jn),o=this.Wt&&-1!==this.Wt?this.Wt:2,e=(new kr).setFromPoints(t.getPoints());e&&0<e.vertices.length&&e.vertices.push(e.vertices[0]);for(var i=[],s=e.vertices.length,a=0;a<s;a++)e.vertices[a].z=this.Wt,0===a||a===s-1?i.push(e.vertices[a]):i.push(e.vertices[a],e.vertices[a]);e.vertices=i;var u=new zf(e,r);if(u.position.setZ(.005*o),u.castShadow=!1,u.geometry.computeBoundingSphere(),this.Ya=u,this.Ya.matrixAutoUpdate=!1,this.Dn.add(u),t.holes)for(var h=0;h<t.holes.length;h++)!function(t,n){for(var e=0;e<n.length;e++){var i=[];i.push(new St(n[e].v1.x,n[e].v1.y,o)),i.push(new St(n[e].v2.x,n[e].v2.y,o));i=new zf((new $r).setFromPoints(i),r);t.add(i)}}(u,t.holes[h].curves)},cu:function(){var t,n;this.tu&&this.nu&&(n=this.la(Bg),t=new uo(1,1,1,1),n=this.lu(n,this.tu),this.$n.top=new Uo(t,n),this.$n.top.renderOrder=10,this.du(),this.Dn.add(this.$n.top))},au:function(){this.tu&&this.nu?this.$n.top?(this.vu(),this.du()):this.cu():this.clearTopImage()},uu:function(t){this.qa=t},Aa:function(){this.ou(),this.Ja=this.Rs.color,this.Pa=this.Rs.alpha,this.Qa=this.Rs.strokeColor,this.$a=this.Rs.alpha,this.Ca(),this.Dn&&this.au()},fu:function(t){var n=this.la(um);return t.Uo({color:this.Qa,opacity:this.$a*n.Pa,needDepth:!0})},Oa:function(t){var n=this.la(um);return t.Go({color:this.Ja,alpha:this.Pa*n.Pa})},lu:function(n,t){var e=new Jc({transparent:!0,opacity:this.la(um).Pa,depthWrite:!1,visible:!1});return n.Zt.Jn.ts(t,function(t){e.map=t,e.map.wrapS=Sn,e.map.wrapT=Sn,e.needsUpdate=!0,e.visible=!0,e.polygonOffset=!0,e.polygonOffsetFactor=-1,e.polygonOffsetUnits=-4,n.enableUpdateRender()}),e},vu:function(){var t,n=this.$n.top;n&&(n.material.map&&n.material.map.dispose(),n.material.map=null,n.material.dispose(),t=this.la(Bg),n.material=this.lu(t,this.tu))},Ca:function(){var t;!this.Dn||(t=this.la(Bg))&&(this.Dn.userData.sourceMaterial?this.Dn.userData.sourceMaterial=this.Oa(t.Zt.Jn):this.Dn.material=this.Oa(t.Zt.Jn),this.su(t),this.vu(),t.enableUpdateRender())},su:function(t){var n=this.fu(t.Zt.Jn);if(this.Ya){this.Ya.material=n;for(var e=0;e<this.Ya.children.length;e++)this.Ya.children[e].material=n}t.enableUpdateRender()},du:function(){var t=this.$n.top;t.scale.set(this.nu[0],this.nu[1],1);var n=this.te.getBound();t.position.set(this.eu[0]+this.iu.x-n.center.x,this.eu[1]+this.iu.y-n.center.y,this.Wt+.1),t.rotation.z=-this.ru*Math.PI/180},ou:function(){var t,n=this.la(Bl),e=n.K.Zt;this.Rs=n.xa.Ps({fid:this.te.fid,typeID:this.te.type+""}),this.Rs.image?this.tu=e.pu(this.Rs,"logoPath")+this.Rs.image:this.tu=null,this.Rs.coords&&(t=this.Rs.coords.split(","),this.iu=new ci(parseFloat(t[0]),parseFloat(t[1]))),this.Rs.angle&&(this.ru=this.Rs.angle),this.Rs.sizes&&(t=this.Rs.sizes.split(","),this.nu=[parseFloat(t[0]),parseFloat(t[1])])},La:function(){var t,n=this.la(Bg);n&&(this.Dn&&(t=n.getZoom(),n.Zt.mu(this,t)),n.enableUpdateNode(),n.enableUpdateRender())},Da:function(){this.Dn&&(this.Ya&&(this.Dn.remove(this.Ya),this.Ya.material.dispose(),this.Ya.geometry.dispose(),this.Ya=void 0),this.clearTopImage(),this.Dn.parent.remove(this.Dn),this.Dn.geometry.dispose(),this.Dn.geometry=void 0,this.Dn.material=void 0,this.Dn.mapNode=void 0,this.Dn=void 0)},ct:function(){for(var t in this.Da(),this)this[""+t]=null,delete this[""+t]}});var ld=pi;function dd(t){return(dd="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 vd(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var e=[],i=!0,r=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(i=(s=a.next()).done)&&(e.push(s.value),!n||e.length!==n);i=!0);}catch(t){r=!0,o=t}finally{try{i||null==a.return||a.return()}finally{if(r)throw o}}return e}}(t,n)||pd(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 pd(t,n){if(t){if("string"==typeof t)return md(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(e="Object"===e&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?md(t,n):void 0}}function md(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 gd(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function yd(t,n){return(yd=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function bd(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=_d(e);return t=i?(t=_d(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==dd(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function _d(t){return(_d=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}Li=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&yd(t,n)}(r,Dl);var t,n,e,i=bd(r);function r(t,n){var e;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(e=i.call(this)).Yn=Di.MODEL_LAYER,e.ci.name="model",e.ci.userData.type="model",e.Ua="model",e.gu={},e.Ha(t,n),e}return t=r,(n=[{key:"level",get:function(){return this.K.Lt}},{key:"height",get:function(){return this.K.Wt}},{key:"getFeatures",value:function(){return this.Mt}}])&&gd(t.prototype,n),e&&gd(t,e),r}();Object.assign(Li.prototype,{Ha:function(t,n){var e,i=function(t,n){var e;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(e=pd(t))||n&&t&&"number"==typeof t.length){e&&(t=e);var i=0,n=function(){};return{s:n,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o=!0,s=!1;return{s:function(){e=t[Symbol.iterator]()},n:function(){var t=e.next();return o=t.done,t},e:function(t){s=!0,r=t},f:function(){try{o||null==e.return||e.return()}finally{if(s)throw r}}}}(t.Mt);try{for(i.s();!(e=i.n()).done;){var r=vd(e.value,2),o=(r[0],r[1]),s=new ld(o);this.dn(s),s.visible=n.map.Zt.Va(this.Yn,{typeID:s.typeID,FID:s.FID})}}catch(t){i.e(t)}finally{i.f()}},dn:function(t){(t.K=this).Mt.push(t)},za:function(){var t=this.la(Bg);(new Jl).createLight(this,t,"FMModelLayer")},va:function(){this.ci.add(this.Na),this.ci.add(this.ja),this.ci.add(this.Fa),this.ci.add(this.Ia)},da:function(){this.ci.remove(this.Na),this.ci.remove(this.ja),this.ci.remove(this.Fa)},Wa:function(){this.Na=void 0,this.ja=void 0,this.Fa=void 0},ct:function(){this.da(),this.Wa(),this.ci.children=[];for(var t,n=0;n<this.Mt.length;n++)this.Mt[n].ct();for(t in this.Mt.length=0,this)this[""+t]=null,delete this[""+t]}});var wd,xd=Li,Md=new St,Sd=new St,Ed=new St,Td=new ci,Ld=new ci,Rd=new Et,Od=new St,Ad=new St,Cd=new St,kd=new ci,Pd=new ci,Dd=new ci;function jd(t){var n;Z.call(this),this.type="Sprite",void 0===wd&&(wd=new $r,n=new _u(new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),5),wd.setIndex([0,1,2,0,2,3]),wd.setAttribute("position",new xu(n,3,0,!1)),wd.setAttribute("uv",new xu(n,2,3,!1))),this.geometry=wd,this.material=void 0!==t?t:new Qh,this.center=new ci(.5,.5)}function Id(t,n,e,i,r,o){Td.subVectors(t,e).addScalar(.5).multiply(i),void 0!==r?(Ld.x=o*Td.x-r*Td.y,Ld.y=r*Td.x+o*Td.y):Ld.copy(Td),t.copy(n),t.x+=Ld.x,t.y+=Ld.y,t.applyMatrix4(Rd)}jd.prototype=Object.assign(Object.create(Z.prototype),{constructor:jd,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.'),Sd.setFromMatrixScale(this.matrixWorld),Rd.copy(t.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(t.camera.matrixWorldInverse,this.matrixWorld),Ed.setFromMatrixPosition(this.modelViewMatrix),t.camera.isPerspectiveCamera&&!1===this.material.sizeAttenuation&&Sd.multiplyScalar(-Ed.z);var e,i,r=this.material.rotation;0!==r&&(i=Math.cos(r),e=Math.sin(r));var o=this.center;Id(Od.set(-.5,-.5,0),Ed,o,Sd,e,i),Id(Ad.set(.5,-.5,0),Ed,o,Sd,e,i),Id(Cd.set(.5,.5,0),Ed,o,Sd,e,i),kd.set(0,0),Pd.set(1,0),Dd.set(1,1);r=t.ray.intersectTriangle(Od,Ad,Cd,!1,Md);null===r&&(Id(Ad.set(-.5,.5,0),Ed,o,Sd,e,i),Pd.set(0,1),null===(r=t.ray.intersectTriangle(Od,Cd,Ad,!1,Md)))||((r=t.ray.origin.distanceTo(Md))<t.near||r>t.far||n.push({distance:r,point:Md.clone(),uv:_o.getUV(Md,Od,Ad,Cd,kd,Pd,Dd,new ci),face:null,object:this}))},clone:function(){return new this.constructor(this.material).copy(this)},copy:function(t){return Z.prototype.copy.call(this,t),void 0!==t.center&&this.center.copy(t.center),this}});Oi={NAME:2,ENAME:4,FID:8};Object.freeze(Oi);var Nd=Oi;function Fd(t){return(Fd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ud(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Bd(t,n){return(Bd=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Gd(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Hd(e);return t=i?(t=Hd(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Fd(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function Hd(t){return(Hd=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}Fi=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Bd(t,n)}(r,xl);var t,n,e,i=Gd(r);function r(t,n){var e;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(e=i.call(this)).te=t,e.V=n,e.Xa=t.maxlevel,e.Za=t.minlevel,e.Yn=Di.LABEL,e.Rs=null,e.yu=null,e.wi=0,e.Li=!1,n.wt.bu===Nd.ENAME?e._u=t.ename:n.wt.bu===Nd.FID?e._u=t.fid:e._u=t.name,e._u||(e._u="",e.Li=!0),e}return t=r,(n=[{key:"bound",get:function(){return!0===this.needUpdateBound&&(this.te.wr=null,this.wr=this.te.getBound(),this.needUpdateBound=!1),this.wr.clone()}},{key:"x",get:function(){return this.te._r[0].x}},{key:"y",get:function(){return this.te._r[0].y}},{key:"ID",get:function(){return this.te.ie}},{key:"FID",get:function(){return this.te.fid}},{key:"typeID",get:function(){return this.te.type}},{key:"level",get:function(){return this.K.K.Lt}},{key:"height",get:function(){return this.te.height}},{key:"zoomRange",get:function(){return{maxLevel:this.Xa,minLevel:this.Za}}},{key:"name",get:function(){return this.te.name}},{key:"eName",get:function(){return this.te.ename}},{key:"text",get:function(){return this._u},set:function(t){t?(this._u=t,this.Li=!1):(this._u="",this.Li=!0),this.Dn&&this.Ca()}},{key:"visible",get:function(){return this.Ti},set:function(t){this.Ti=t,this.La()}},{key:"setText",value:function(t){this.text=t}},{key:"getData",value:function(){var t=this.te;return{ID:t.ie,typeID:t.type,FID:t.fid,height:t.height,name:t.name,eName:t.ename,minLevel:t.minlevel,maxLevel:t.maxlevel}}},{key:"getBound",value:function(){return{minX:this.bound.pr.x,maxX:this.bound.mr.x,minY:this.bound.pr.y,maxY:this.bound.mr.y}}}])&&Ud(t.prototype,n),e&&Ud(t,e),r}();Object.assign(Fi.prototype,{bs:function(){var t,n;this.Dn||(n=this.la(um).K,this.ou(this.V.Zt,n.xa),(t=this.Oa()).userData.opacity=t.opacity,this.Dn=new jd(t),n=new St((t=(this.Dn.mapNode=this).te._r[0]).x-n.I,-t.y+n.N,0).applyEuler(new _(Math.PI/2,0,0,"XYZ")).add(new St(0,this.te.height,0)),this.Dn.position.copy(n),this.wu(this.V.Zt),this.Dn.userData.size=this.wi,this.K.ci.add(this.Dn))},Aa:function(t,n){this.Dn&&(this.ou(t,n),this.Ca())},Ca:function(){var n=this;this.Dn&&this.la(Bg)&&this.Oa(function(t){n.Dn&&(n.Dn.material.map&&(n.Dn.material.map.dispose(),n.Dn.material.map=null),n.Dn.material.dispose(),n.Dn.material=t)})},Oa:function(n){var e=this,t=this.la(um),i={needSize:!0,opacity:this.Rs.alpha*t.Pa};return this.Rs.image&&(i.imageUrl=this.yu+this.Rs.image),this.V.Zt.Jn.Yo(this._u,this.Rs,i,function(t){n&&n(t),e.Dn&&e.wu(e.V.Zt),void 0!==i.imageUrl&&e.V.Zt.pa(),e.V.enableUpdateRender()})},wu:function(t){this.Dn.material.userData.mspriteScale&&(t=t._i(this.wi),this.Dn.scale.set(t,t,t),this.Dn.scale.multiplyScalar(this.Dn.material.userData.mspriteScale),this.Dn.scale.setX(this.Dn.scale.x/this.Dn.material.userData.scaleRatio))},ou:function(t,n){this.Rs=n.Is({fid:this.te.fid,typeID:this.te.type+""}),this.yu=t.pu(this.Rs,"path");t=parseInt(this.Rs.fontsize);isNaN(t)&&(t=20),this.wi=1.4*t},La:function(){var t=this.la(Bg);t&&(this.Dn&&t.Zt.pa(),t.enableUpdateNode(),t.enableUpdateRender())},Da:function(){this.Dn&&(this.Dn.parent.remove(this.Dn),this.Dn.geometry.dispose(),this.Dn.geometry=void 0,this.Dn.material=void 0,this.Dn.mapNode=void 0,this.Dn=void 0)},ct:function(){for(var t in this.Da(),this)this[""+t]=null,delete this[""+t]}});var Vd=Fi;function zd(t){return(zd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Wd(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var e=[],i=!0,r=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(i=(s=a.next()).done)&&(e.push(s.value),!n||e.length!==n);i=!0);}catch(t){r=!0,o=t}finally{try{i||null==a.return||a.return()}finally{if(r)throw o}}return e}}(t,n)||Xd(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 Xd(t,n){if(t){if("string"==typeof t)return Zd(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(e="Object"===e&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Zd(t,n):void 0}}function Zd(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 Yd(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function qd(t,n){return(qd=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Kd(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Qd(e);return t=i?(t=Qd(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==zd(t)&&"function"!=typeof t?Jd(n):t}}function Jd(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Qd(t){return(Qd=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}e=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&qd(t,n)}(r,Dl);var t,n,e,i=Kd(r);function r(t,n){var e;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(e=i.call(this)).Yn=Di.LABEL_LAYER,e.ci.userData.type="label",e.ci.name="label",e.ci.mapNode=Jd(e),e.Ua="label",e.xu={},e.Ha(t,n),e.Ri=!0,e}return t=r,(n=[{key:"getFeatures",value:function(){return this.Mt}},{key:"type",get:function(){return this.Yn}},{key:"level",get:function(){return this.K.Lt}},{key:"collision",get:function(){return this.Ri},set:function(t){this.Ri!==t&&(this.Ri=t,(t=this.la(Bg))&&t.Zt.pa())}}])&&Yd(t.prototype,n),e&&Yd(t,e),r}();Object.assign(e.prototype,{Ha:function(t,n){var e,i=function(t,n){var e;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(e=Xd(t))||n&&t&&"number"==typeof t.length){e&&(t=e);var i=0,n=function(){};return{s:n,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o=!0,s=!1;return{s:function(){e=t[Symbol.iterator]()},n:function(){var t=e.next();return o=t.done,t},e:function(t){s=!0,r=t},f:function(){try{o||null==e.return||e.return()}finally{if(s)throw r}}}}(t.Mt);try{for(i.s();!(e=i.n()).done;){var r=Wd(e.value,2),o=(r[0],r[1]),s=new Vd(o,n.map);this.dn(s),s.visible=n.map.Zt.Va(this.Yn,{typeID:s.typeID,FID:s.FID})}}catch(t){i.e(t)}finally{i.f()}},dn:function(t){(t.K=this).Mt.push(t)},ct:function(){this.ci.children=[];for(var t,n=0;n<this.Mt.length;n++)this.Mt[n].ct();for(t in this.Mt.length=0,this)this[""+t]=null,delete this[""+t]}});var $d=e;function tv(t){return(tv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function nv(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function ev(t,n){return(ev=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function iv(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=rv(e);return t=i?(t=rv(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==tv(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function rv(t){return(rv=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}Ji=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&ev(t,n)}(r,xl);var t,n,e,i=iv(r);function r(t){var n;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(n=i.call(this)).te=t,n.Wt=t.height,n.Xa=t.maxlevel,n.Za=t.minlevel,n.Yn=Di.FACILITY,n.wi=0,n.St=new Map,n.Rs=null,n}return t=r,(n=[{key:"bound",get:function(){return!0===this.needUpdateBound&&(this.te.wr=null,this.wr=this.te.getBound(),this.needUpdateBound=!1),this.wr.clone()}},{key:"x",get:function(){return this.te._r[0].x}},{key:"y",get:function(){return this.te._r[0].y}},{key:"ID",get:function(){return this.te.ie}},{key:"FID",get:function(){return this.te.fid}},{key:"typeID",get:function(){return this.te.type}},{key:"eName",get:function(){return this.te.Mu}},{key:"name",get:function(){return this.te.name}},{key:"level",get:function(){return this.K.K.Lt}},{key:"height",get:function(){return this.Wt}},{key:"zoomRange",get:function(){return{maxLevel:this.Xa,minLevel:this.Za}}},{key:"visible",get:function(){return this.Ti},set:function(t){this.Ti=t,this.La()}},{key:"getData",value:function(){var t=this.te;return{ID:t.ie,typeID:t.type,FID:t.fid,height:t.height,name:t.name,eName:t.ename,minLevel:t.minlevel,maxLevel:t.maxlevel}}},{key:"jump",value:function(t){var n=this,e=1,i=this.la(Bg),r=t.times||void 0,o=t.delay||0,s=new Ri({src:[this.Wt],dest:[this.Wt+t.height]});t&&t.duration&&s.dt(t.duration),i.ln.dn(s.pt(function(t){n.Dn.position.y=t.destination[0],i.enableUpdateRender()}).mt(function(){var t;Number.isFinite(r)&&r<e||(t=0<e%1?0:o,s._t().vt(t).ht(),e+=.5,i.enableUpdateRender())})),this.St.set("jump",s)}},{key:"stopJump",value:function(){var t=this.la(Bg);t.ln.cn(this.St.get("jump")),this.Dn.position.y=this.Wt,t.enableUpdateRender()}},{key:"boost",value:function(t){var n=this,e=void 0!==(t=t||{}).duration?t.duration:1,i=void 0!==t.size?t.size:8,r=void 0!==t.times?t.times:5,o=void 0!==t.delay?t.delay:0,s=1,a=this.la(Bg),u=new Ri({src:[this.wi],dest:[i]});u.dt(e).ht().pt(function(t){n.Dn&&a.an.xi(n.Dn,t.destination[0]),a.enableUpdateRender()}).mt(function(){var t;r<s||(t=0<s%1?0:o,u._t().vt(t).ht(),a.enableUpdateRender(),s+=.5)}),a.ln.dn(u),this.St.set("boost",u)}},{key:"stopBoost",value:function(){var t=this.la(Bg);t.ln.cn(this.St.get("boost")),t.an.xi(this.Dn,this.wi),t.enableUpdateRender()}},{key:"getPosition",value:function(){return{x:this.te._r[0].x,y:this.te._r[0].y,z:this.Wt}}},{key:"getBound",value:function(){return{minX:this.bound.pr.x,maxX:this.bound.mr.x,minY:this.bound.pr.y,maxY:this.bound.mr.y}}}])&&nv(t.prototype,n),e&&nv(t,e),r}();Object.assign(Ji.prototype,{bs:function(){if(!this.Dn){var t=this.la(Bg),n=this.la(Bl);this.Rs=n.xa.js({fid:this.te.fid,typeID:""+this.te.type}),this.wi=parseInt(this.Rs.height);var e=this.Oa(t);e.userData.opacity=e.opacity,this.Dn=new jd(e);e=this.te._r[0],n=new St(e.x-n.I,-e.y+n.N,0).applyEuler(new _(Math.PI/2,0,0,"XYZ")).add(new St(0,this.Wt,0));return this.Dn.position.copy(n),this.wu(t.Zt),this.Dn.userData.size=this.wi,(this.Dn.mapNode=this).K.ci.add(this.Dn),!0}},Aa:function(t,n){this.Dn&&(this.Rs=n.js({fid:this.te.fid,typeID:""+this.te.type}),this.wi=parseInt(this.Rs.height),this.Ca(),this.Dn.userData.size=this.wi)},Ca:function(){var t;!this.Dn||(t=this.la(Bg))&&(this.Dn.material=this.Oa(t))},Oa:function(t){var n=this,e=this.la(um);return t.Zt.Jn.qo({opacity:e.Pa,needDepth:!1,url:t.Zt.pu(this.Rs,"path")+this.Rs.imageName},function(){n.wu(t.Zt),t.Zt.pa(),t.enableUpdateRender()})},wu:function(t){var n;this.Dn&&(n=t._i(this.wi),t=1,this.Dn.material.userData.scaleRatio&&(t=this.Dn.material.userData.scaleRatio),this.Dn.scale.set(n,n/t,n))},La:function(){var t=this.la(Bg);t&&(this.Dn&&t.Zt.pa(),t.enableUpdateNode(),t.enableUpdateRender())},Da:function(){this.Dn&&(this.Dn.parent.remove(this.Dn),this.Dn.geometry.dispose(),this.Dn.geometry=void 0,this.Dn.material=void 0,this.Dn.mapNode=void 0,this.Dn=void 0)},ct:function(){for(var t in this.Da(),this)this[""+t]=null,delete this[""+t]}});var ov=Ji;function sv(t){return(sv="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 av(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var e=[],i=!0,r=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(i=(s=a.next()).done)&&(e.push(s.value),!n||e.length!==n);i=!0);}catch(t){r=!0,o=t}finally{try{i||null==a.return||a.return()}finally{if(r)throw o}}return e}}(t,n)||uv(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 uv(t,n){if(t){if("string"==typeof t)return hv(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(e="Object"===e&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?hv(t,n):void 0}}function hv(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 cv(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function fv(t,n){return(fv=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function lv(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=vv(e);return t=i?(t=vv(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==sv(t)&&"function"!=typeof t?dv(n):t}}function dv(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function vv(t){return(vv=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}br=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&fv(t,n)}(r,Dl);var t,n,e,i=lv(r);function r(t,n){var e;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(e=i.call(this)).Yn=Di.FACILITY_LAYER,e.ci.userData.type="facility",e.ci.name="facility",e.Ua="facility",e.Su={},e.Ri=!0,e.ci.mapNode=dv(e),e.Ha(t,n),e}return t=r,(n=[{key:"level",get:function(){return this.K.Lt}},{key:"collision",get:function(){return this.Ri},set:function(t){this.Ri!==t&&(this.Ri=t,(t=this.la(Bg))&&t.Zt.pa())}},{key:"getFeatures",value:function(){return this.Mt}}])&&cv(t.prototype,n),e&&cv(t,e),r}();Object.assign(br.prototype,{Ha:function(t,n){var e,i=function(t,n){var e;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(e=uv(t))||n&&t&&"number"==typeof t.length){e&&(t=e);var i=0,n=function(){};return{s:n,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o=!0,s=!1;return{s:function(){e=t[Symbol.iterator]()},n:function(){var t=e.next();return o=t.done,t},e:function(t){s=!0,r=t},f:function(){try{o||null==e.return||e.return()}finally{if(s)throw r}}}}(t.Mt);try{for(i.s();!(e=i.n()).done;){var r=av(e.value,2),o=(r[0],r[1]),s=new ov(o);this.dn(s),s.visible=n.map.Zt.Va(this.Yn,{typeID:s.typeID,FID:s.FID})}}catch(t){i.e(t)}finally{i.f()}},dn:function(t){(t.K=this).Mt.push(t)},ct:function(){this.ci.children=[];for(var t,n=0;n<this.Mt.length;n++)this.Mt[n].ct();for(t in this.Mt.length=0,this)this[""+t]=null,delete this[""+t]}});var pv=br,mv=new $;function gv(t,n){this.object=t,void 0===n&&(n=16776960);var e=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=new Float32Array(24),t=new $r;t.setIndex(new Dr(e,1)),t.setAttribute("position",new Dr(i,3)),zf.call(this,t,new $c({color:n,toneMapped:!1})),this.matrixAutoUpdate=!1,this.update()}function yv(t,n,e){this.Eu=t,this.Tu=n,this.Lu=e||null;for(var i=n.tracks,r=i.length,o=new Array(r),s={endingStart:We,endingEnd:We},a=0;a!==r;++a){var u=i[a].createInterpolant(null);(o[a]=u).settings=s}this.Ru=s,this.Ou=o,this.Au=new Array(r),this.Cu=null,this.ku=null,this.Pu=null,this.Du=null,this.loop=2201,this.ju=-1,this.Iu=null,this.time=0,this.timeScale=1,this.Nu=1,this.weight=1,this.Fu=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}function bv(t,n,e){this.binding=t,this.valueSize=e;var i,r=Float64Array;switch(n){case"quaternion":i=this.Uu;break;case"string":case"bool":r=Array,i=this.Bu;break;default:i=this.Gu}this.buffer=new r(4*e),this.Hu=i,this.cumulativeWeight=0,this.useCount=0,this.referenceCount=0}function _v(t){this.Ii=t,this.Vu(),this.zu=0,this.time=0,this.timeScale=1}function wv(t){return(wv="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 xv(t,n){var e;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(e=function(t,n){if(t){if("string"==typeof t)return Mv(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(e="Object"===e&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Mv(t,n):void 0}}(t))||n&&t&&"number"==typeof t.length){e&&(t=e);var i=0,n=function(){};return{s:n,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o=!0,s=!1;return{s:function(){e=t[Symbol.iterator]()},n:function(){var t=e.next();return o=t.done,t},e:function(t){s=!0,r=t},f:function(){try{o||null==e.return||e.return()}finally{if(s)throw r}}}}function Mv(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 Sv(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Ev(t,n){return(Ev=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Tv(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Rv(e);return t=i?(t=Rv(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==wv(t)&&"function"!=typeof t?Lv(n):t}}function Lv(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Rv(t){return(Rv=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}((gv.prototype=Object.create(zf.prototype)).constructor=gv).prototype.update=function(t){var n,e,i;void 0!==t&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&mv.setFromObject(this.object),mv.isEmpty()||(n=mv.min,e=mv.max,(t=(i=this.geometry.attributes.position).array)[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=n.x,t[4]=e.y,t[5]=e.z,t[6]=n.x,t[7]=n.y,t[8]=e.z,t[9]=e.x,t[10]=n.y,t[11]=e.z,t[12]=e.x,t[13]=e.y,t[14]=n.z,t[15]=n.x,t[16]=e.y,t[17]=n.z,t[18]=n.x,t[19]=n.y,t[20]=n.z,t[21]=e.x,t[22]=n.y,t[23]=n.z,i.needsUpdate=!0,this.geometry.computeBoundingSphere())},gv.prototype.setFromObject=function(t){return this.object=t,this.update(),this},gv.prototype.copy=function(t){return zf.prototype.copy.call(this,t),this.object=t.object,this},gv.prototype.clone=function(){return(new this.constructor).copy(this)},Object.assign(yv.prototype,{play:function(){return this.Eu.Wu(this),this},stop:function(){return this.Eu.Xu(this),this.reset()},reset:function(){return this.paused=!1,this.enabled=!0,this.time=0,this.ju=-1,this.Iu=null,this.stopFading().stopWarping()},isRunning:function(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this.Iu&&this.Eu.Zu(this)},isScheduled:function(){return this.Eu.Zu(this)},startAt:function(t){return this.Iu=t,this},setLoop:function(t,n){return this.loop=t,this.repetitions=n,this},setEffectiveWeight:function(t){return this.weight=t,this.Fu=this.enabled?t:0,this.stopFading()},getEffectiveWeight:function(){return this.Fu},fadeIn:function(t){return this.Yu(t,0,1)},fadeOut:function(t){return this.Yu(t,1,0)},crossFadeFrom:function(t,n,e){var i,r;return t.fadeOut(n),this.fadeIn(n),e&&(e=(i=this.Tu.duration)/(r=t.Tu.duration),t.warp(1,r/i,n),this.warp(e,1,n)),this},crossFadeTo:function(t,n,e){return t.crossFadeFrom(this,n,e)},stopFading:function(){var t=this.Du;return null!==t&&(this.Du=null,this.Eu.qu(t)),this},setEffectiveTimeScale:function(t){return this.timeScale=t,this.Nu=this.paused?0:t,this.stopWarping()},getEffectiveTimeScale:function(){return this.Nu},setDuration:function(t){return this.timeScale=this.Tu.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.Nu,0,t)},warp:function(t,n,e){var i=this.Eu,r=i.time,o=this.Pu,s=this.timeScale;null===o&&(o=i.Ku(),this.Pu=o);i=o.parameterPositions,o=o.sampleValues;return i[0]=r,i[1]=r+e,o[0]=t/s,o[1]=n/s,this},stopWarping:function(){var t=this.Pu;return null!==t&&(this.Pu=null,this.Eu.qu(t)),this},getMixer:function(){return this.Eu},getClip:function(){return this.Tu},getRoot:function(){return this.Lu||this.Eu.Ii},ot:function(t,n,e,i){if(this.enabled){var r=this.Iu;if(null!==r){r=(t-r)*e;if(r<0||0===e)return;this.Iu=null,n=e*r}n*=this.Ju(t);var o=this.Qu(n),s=this.$u(t);if(0<s)for(var a=this.Ou,u=this.Au,h=0,c=a.length;h!==c;++h)a[h].evaluate(o),u[h].accumulate(i,s)}else this.$u(t)},$u:function(t){var n,e,i=0;return this.enabled&&(i=this.weight,null!==(n=this.Du)&&(i*=e=n.evaluate(t)[0],t>n.parameterPositions[1]&&(this.stopFading(),0===e&&(this.enabled=!1)))),this.Fu=i},Ju:function(t){var n,e=0;return this.paused||(e=this.timeScale,null!==(n=this.Pu)&&(e*=n.evaluate(t)[0],t>n.parameterPositions[1]&&(this.stopWarping(),0===e?this.paused=!0:this.timeScale=e))),this.Nu=e},Qu:function(t){var n,e=this.time+t,i=this.Tu.duration,r=this.loop,o=this.ju,s=2202===r;if(0===t)return-1!==o&&s&&1==(1&o)?i-e:e;if(2200===r){-1===o&&(this.ju=0,this.th(!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.Eu.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else if(-1===o&&(0<=t?this.th(!(o=0),0===this.repetitions,s):this.th(0===this.repetitions,!0,s)),i<=e||e<0?(e-=i*(n=Math.floor(e/i)),o+=Math.abs(n),(r=this.repetitions-o)<=0?(this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=e=0<t?i:0,this.Eu.dispatchEvent({type:"finished",action:this,direction:0<t?1:-1})):(1==r?this.th(r=t<0,!r,s):this.th(!1,!1,s),this.ju=o,this.time=e,this.Eu.dispatchEvent({type:"loop",action:this,loopDelta:n}))):this.time=e,s&&1==(1&o))return i-e;return e},th:function(t,n,e){var i=this.Ru;e?(i.endingStart=Xe,i.endingEnd=Xe):(i.endingStart=t?this.zeroSlopeAtStart?Xe:We:2402,i.endingEnd=n?this.zeroSlopeAtEnd?Xe:We:2402)},Yu:function(t,n,e){var i=this.Eu,r=i.time,o=this.Du;null===o&&(o=i.Ku(),this.Du=o);i=o.parameterPositions,o=o.sampleValues;return i[0]=r,o[0]=n,i[1]=r+t,o[1]=e,this}}),Object.assign(bv.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.Hu(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.Hu(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)},Bu:function(t,n,e,i,r){if(.5<=i)for(var o=0;o!==r;++o)t[n+o]=t[e+o]},Uu:function(t,n,e,i){rt.slerpFlat(t,n,t,n,t,e,i)},Gu: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}}}),_v.prototype=Object.assign(Object.create(g.prototype),{constructor:_v,nh:function(t,n){var e=t.Lu||this.Ii,i=t.Tu.tracks,r=i.length,o=t.Au,s=t.Ou,a=e.uuid,t=this.eh,u=t[a];void 0===u&&(t[a]=u={});for(var h=0;h!==r;++h){var c=i[h],f=c.name;if(void 0!==(l=u[f]))o[h]=l;else{if(void 0!==(l=o[h])){null===l.Cu&&(++l.referenceCount,this.ih(l,a,f));continue}var l,d=n&&n.Au[h].binding.parsedPath;++(l=new bv(il.create(e,f,d),c.ValueTypeName,c.getValueSize())).referenceCount,this.ih(l,a,f),o[h]=l}s[h].resultBuffer=l.buffer}},Wu:function(t){if(!this.Zu(t)){var n,e,i;null===t.Cu&&(n=(t.Lu||this.Ii).uuid,e=t.Tu.uuid,i=this.rh[e],this.nh(t,i&&i.knownActions[0]),this.oh(t,e,n));for(var r=t.Au,o=0,s=r.length;o!==s;++o){var a=r[o];0==a.useCount++&&(this.ah(a),a.saveOriginalState())}this.uh(t)}},Xu:function(t){if(this.Zu(t)){for(var n=t.Au,e=0,i=n.length;e!==i;++e){var r=n[e];0==--r.useCount&&(r.restoreOriginalState(),this.hh(r))}this.ch(t)}},Vu:function(){this.fh=[],this.lh=0,this.rh={},this.ta=[],this.dh=0,this.eh={},this.vh=[],this.ph=0;var t=this;this.stats={actions:{get total(){return t.fh.length},get inUse(){return t.lh}},bindings:{get total(){return t.ta.length},get inUse(){return t.dh}},controlInterpolants:{get total(){return t.vh.length},get inUse(){return t.ph}}}},Zu:function(t){t=t.Cu;return null!==t&&t<this.lh},oh:function(t,n,e){var i=this.fh,r=this.rh,o=r[n];void 0===o?(o={knownActions:[t],actionByRoot:{}},t.ku=0,r[n]=o):(n=o.knownActions,t.ku=n.length,n.push(t)),t.Cu=i.length,i.push(t),o.actionByRoot[e]=t},mh:function(t){var n=this.fh,e=n[n.length-1],i=t.Cu;n[e.Cu=i]=e,n.pop(),t.Cu=null;var r=t.Tu.uuid,o=this.rh,s=o[r],i=s.knownActions,e=i[i.length-1],n=t.ku;i[e.ku=n]=e,i.pop(),t.ku=null,delete s.actionByRoot[(t.Lu||this.Ii).uuid],0===i.length&&delete o[r],this.gh(t)},gh:function(t){for(var n=t.Au,e=0,i=n.length;e!==i;++e){var r=n[e];0==--r.referenceCount&&this.yh(r)}},uh:function(t){var n=this.fh,e=t.Cu,i=this.lh++,r=n[i];n[t.Cu=i]=t,n[r.Cu=e]=r},ch:function(t){var n=this.fh,e=t.Cu,i=--this.lh,r=n[i];n[t.Cu=i]=t,n[r.Cu=e]=r},ih:function(t,n,e){var i=this.eh,r=i[n],o=this.ta;void 0===r&&(i[n]=r={}),(r[e]=t).Cu=o.length,o.push(t)},yh:function(t){var n=this.ta,e=t.binding,i=e.rootNode.uuid,r=e.path,o=this.eh,s=o[i],e=n[n.length-1],t=t.Cu;n[e.Cu=t]=e,n.pop(),delete s[r],0===Object.keys(s).length&&delete o[i]},ah:function(t){var n=this.ta,e=t.Cu,i=this.dh++,r=n[i];n[t.Cu=i]=t,n[r.Cu=e]=r},hh:function(t){var n=this.ta,e=t.Cu,i=--this.dh,r=n[i];n[t.Cu=i]=t,n[r.Cu=e]=r},Ku:function(){var t=this.vh,n=this.ph++,e=t[n];return void 0===e&&(t[(e=new df(new Float32Array(2),new Float32Array(2),1,this._h)).bh=n]=e),e},qu:function(t){var n=this.vh,e=t.bh,i=--this.ph,r=n[i];n[t.bh=i]=t,n[r.bh=e]=r},_h:new Float32Array(1),clipAction:function(t,n){var e=n||this.Ii,i=e.uuid,r="string"==typeof t?Mf.findByName(e,t):t,o=null!==r?r.uuid:t,s=this.rh[o],e=null;if(void 0!==s){t=s.actionByRoot[i];if(void 0!==t)return t;e=s.knownActions[0],null===r&&(r=e.Tu)}if(null===r)return null;n=new yv(this,r,n);return this.nh(n,e),this.oh(n,o,i),n},existingAction:function(t,n){var e=n||this.Ii,n=e.uuid,e="string"==typeof t?Mf.findByName(e,t):t,t=e?e.uuid:t,t=this.rh[t];return void 0!==t&&t.actionByRoot[n]||null},stopAllAction:function(){var t=this.fh,n=this.lh,e=this.ta,i=this.dh;this.lh=0;for(var r=this.dh=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.fh,e=this.lh,i=this.time+=t,r=Math.sign(t),o=this.zu^=1,s=0;s!==e;++s)n[s].ot(i,t,r,o);for(var a=this.ta,u=this.dh,s=0;s!==u;++s)a[s].apply(o);return this},setTime:function(t){for(var n=this.time=0;n<this.fh.length;n++)this.fh[n].time=0;return this.update(t)},getRoot:function(){return this.Ii},uncacheClip:function(t){var n=this.fh,e=t.uuid,i=this.rh,t=i[e];if(void 0!==t){for(var r=t.knownActions,o=0,s=r.length;o!==s;++o){var a=r[o];this.Xu(a);var u=a.Cu,h=n[n.length-1];a.Cu=null,a.ku=null,n[h.Cu=u]=h,n.pop(),this.gh(a)}delete i[e]}},uncacheRoot:function(t){var n,e=t.uuid,i=this.rh;for(n in i){var r=i[n].actionByRoot[e];void 0!==r&&(this.Xu(r),this.mh(r))}var o=this.eh[e];if(void 0!==o)for(var s in o){s=o[s];s.restoreOriginalState(),this.yh(s)}},uncacheAction:function(t,n){n=this.existingAction(t,n);null!==n&&(this.Xu(n),this.mh(n))}});pr=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Ev(t,n)}(r,xl);var t,n,e,i=Tv(r);function r(t){var n;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(n=i.call(this)).te=t,n.Yn=Di.EXTERNAL_MODEL,n.Rs=null,n.Dn=null,n.wh=null,n.Ja=null,n.xh=null,n.Eu=null,n.fh=[],n.Mh=n.Mh.bind(Lv(n)),n}return t=r,(n=[{key:"bound",get:function(){return!0===this.needUpdateBound&&(this.te.wr=null,this.wr=this.te.getBound(),this.needUpdateBound=!1),this.wr.clone()}},{key:"x",get:function(){return this.te._r[0].x}},{key:"y",get:function(){return this.te._r[0].y}},{key:"ID",get:function(){return this.te.ie}},{key:"FID",get:function(){return this.te.fid}},{key:"typeID",get:function(){return this.te.type}},{key:"name",get:function(){return this.te.name}},{key:"eName",get:function(){return this.te.ename}},{key:"level",get:function(){return this.K.K.Lt}},{key:"height",get:function(){return this.te.height}},{key:"zoomRange",get:function(){return{maxLevel:this.te.maxlevel,minLevel:this.te.minlevel}}},{key:"visible",get:function(){return this.Ti},set:function(t){this.Ti=t,this.La()}},{key:"color",get:function(){return this.Ja},set:function(t){this.Ja=t,this.Ca()}},{key:"getData",value:function(){var t=this.te;return{ID:t.ie,typeID:t.type,FID:t.fid,height:t.height,name:t.name,eName:t.ename,minLevel:t.minlevel,maxLevel:t.maxlevel}}},{key:"getBound",value:function(){if(this.wh)return this.wh;var t={};if(this.Dn){for(var n=new gv(this.Dn,16776960),e=n.geometry.attributes.position.array,i=n.geometry.attributes.position.count,r=0;r<i;r++){var o=e[3*r],s=e[3*r+2];(!t.minX||t.minX>o)&&(t.minX=o),(!t.maxX||t.maxX<o)&&(t.maxX=o),(!t.minY||t.minY>s)&&(t.minY=s),(!t.maxY||t.maxY<s)&&(t.maxY=s)}n.material.dispose(),n.geometry.dispose(),n.material=void 0,n.geometry=void 0;n=this.la(Bg);return t.minX=t.minX+n.getX(),t.maxX=t.maxX+n.getX(),t.minY=n.getY()-t.minY,t.maxY=n.getY()-t.maxY,t.minY>t.maxY&&(n=t.minY,t.minY=t.maxY,t.maxY=n),this.wh=t,this.wh}}},{key:"startAction",value:function(t,n){t=this.fh[t];t&&(n&&(t.clampWhenFinished=!0,t.loop=2200),t.reset().setEffectiveTimeScale(1).setEffectiveWeight(1).play());t=this.la(Bg);t&&t.on("beforeRender",this.Mh)}},{key:"getActionNames",value:function(){return Object.keys(this.fh)}},{key:"stopAction",value:function(t){var n=this.la(Bg);n&&n.off("beforeRender",this.Mh);t=this.fh[t];t&&t.stop()}}])&&Sv(t.prototype,n),e&&Sv(t,e),r}();Object.assign(pr.prototype,{bs:function(t){this.Dn||this.Sh(t)},Aa:function(){this.Dn&&this.K.ci.remove(this.Dn),this.Dn=null,this.Sh()},Sh:function(i){var t,r=this,o=this.la(Bg),s=this.la(Bl);this.Rs=s.xa.Ns({fid:this.te.fid,typeID:this.te.type+""}),this.Rs&&this.Rs.normalID&&(t=o.Zt.pu(this.Rs,"model")+this.Rs.model+"?keyValue="+o.jt.key,o.Zt.Eh.Jr(t,function(t,n,e){r.xh=t,r.xh?r.Th(n,s):r.Lh(n,e,r.Rs,s),o.enableUpdateRender(),i&&i()}))},Lh:function(t,n,e,i){if(!this.Dn){var r=this.la(um);if(Array.isArray(n)){var o,s=xv(n);try{for(s.s();!(o=s.n()).done;){var a=o.value;this.Ja&&(a.color=new _i(this.Ja)),a.map&&(a.map.wrapS=Mn,a.map.wrapT=Mn),a.userData.sourceTransparent=a.transparent,a.userData.sourceOpacity=a.opacity,a.opacity=a.userData.sourceOpacity*r.Pa,a.opacity<1&&(a.transparent=!0)}}catch(t){s.e(t)}finally{s.f()}}else this.Ja&&(n.color=new _i(this.Ja)),n.map&&(n.map.wrapS=Mn,n.map.wrapT=Mn),n.userData.sourceOpacity=n.opacity,n.userData.sourceTransparent=n.transparent,n.opacity=n.userData.sourceOpacity*r.Pa,n.opacity<1&&(n.transparent=!0);var u=[];if(void 0!==n.length)for(var h=0;h<n.length;h++)u.push(n[h].clone());else u.push(n.clone());this.Dn=new Uo(t,u);var c=e.scale.split(",");this.Dn.scale.set(parseFloat(c[0]),parseFloat(c[2]),parseFloat(c[1]));var f=e.rotate.split(","),t=new St,c=Math.PI/180;t.set(parseFloat(f[0])*c,parseFloat(f[2])*c,parseFloat(f[1])*c),this.Dn.rotation.setFromVector3(t,"YXZ");e=e.translate.split(","),i=new St(this.te._r[0].x-i.x,this.te._r[0].y-i.y,0).applyEuler(new _(-Math.PI/2,0,0,"XYZ")).add(new St(0,-1===this.te.height?2.2:this.te.height,0));i.add(new St(parseFloat(e[0]),parseFloat(e[2]),parseFloat(e[1]))),this.Dn.position.set(i.x,i.y,i.z),(this.Dn.mapNode=this).K.ci.add(this.Dn)}},Th:function(t,n){if(!this.Dn){var e=t.scene,i=this.Rs.rotate.split(","),r=new St,o=Math.PI/180;r.set(parseFloat(i[0])*o,parseFloat(i[2])*o,parseFloat(i[1])*o),e.rotation.setFromVector3(r,"YXZ");r=this.Rs.scale.split(",");e.scale.set(parseFloat(r[0]),parseFloat(r[2]),parseFloat(r[1]));r=this.Rs.translate.split(","),n=new St(this.te._r[0].x-n.x,this.te._r[0].y-n.y,0).applyEuler(new _(-Math.PI/2,0,0,"XYZ")).add(new St(0,-1===this.te.height?2.2:this.te.height,0));if(n.add(new St(parseFloat(r[0]),parseFloat(r[2]),parseFloat(r[1]))),e.position.set(n.x,n.y,n.z),this.Dn=e,(this.Dn.mapNode=this).K.ci.add(this.Dn),this.Ca(e),0<t.animations.length){this.Eu=new _v(this.Dn);var s,a=xv(t.animations);try{for(a.s();!(s=a.n()).done;){var u=s.value;this.fh[u.name]=this.Eu.clipAction(u)}}catch(t){a.e(t)}finally{a.f()}this.la(Bg).ln.Rh(this.Eu),this.startAction(this.getActionNames()[0])}}},Ca:function(){var r=this;if(this.Dn){var o=this.la(Bg),s=this.la(um);if(this.xh)this.Dn.traverse(function(t){if("Mesh"===t.type){var n=r.qn(t.material,s);if(o.jt.materialMode===Qi.REAL){var e=o.Zt.Jn.Kn(n);e.userData=t.material.userData,t.material=e}else if(Array.isArray(t.material.length))for(var i=0;i<t.material.length;i++)t.material[i].depthWrite=!0,t.material[i]=o.Zt.Jn.Qn(t.material[i],n);else t.material.depthWrite=!0,t.material=o.Zt.Jn.Qn(t.material,n)}});else{var t=this.Dn.material;if(Array.isArray(t)){var n,e=xv(t);try{for(e.s();!(n=e.n()).done;){var i=n.value,a=this.qn(i,s);i.color=new _i(a.color),i.opacity=a.opacity,i.transparent=a.transparent}}catch(t){e.e(t)}finally{e.f()}}else{var u=this.qn(t,s);t.color=new _i(u.color),t.opacity=u.opacity,t.transparent=u.transparent}}o.enableUpdateRender()}},qn:function(t,n){var e={};return this.la(Bg).jt.materialMode===Qi.REAL?t.constructor===nr?(t.userData.sourceOpacity=t.opacity,t.userData.sourceTransparent=t.transparent,e={color:t.color.getHex(),USE_EMISSIVEMAP:!!t.emissiveMap,USE_MAP:!!t.map,map:t.map,emissive:t.emissive.getHex(),emissiveMap:t.emissiveMap,metalness:t.metalness,roughness:t.roughness,normalScale:t.normalScale,vertexColors:t.vertexColors,side:t.side,skinning:t.skinning}):t.constructor===mr&&(e={USE_EMISSIVEMAP:t.defines.USE_EMISSIVEMAP,USE_MAP:t.defines.USE_MAP,map:t.uniforms.map.value,color:t.uniforms.diffuse.value.getHex(),emissive:t.uniforms.emissive.value.getHex(),emissiveMap:t.uniforms.emissiveMap.value,metalness:t.uniforms.metalness.value,roughness:t.uniforms.roughness.value,normalScale:t.uniforms.normalScale.value,vertexColors:t.vertexColors,side:t.side,skinning:t.skinning}):(t.userData.sourceOpacity||(t.userData.sourceOpacity=t.opacity),t.userData.sourceTransparent||(t.userData.sourceTransparent=t.transparent)),this.Ja&&(e.color=this.Ja),e.opacity=void 0!==t.userData.sourceOpacity?t.userData.sourceOpacity*n.Pa:t.opacity*n.Pa,e.transparent=t.userData.sourceTransparent||e.opacity<1,e},La:function(){var t,n=this.la(Bg);n&&(this.Dn&&(t=n.getZoom(),n.Zt.mu(this,t)),n.enableUpdateNode(),n.enableUpdateRender())},Da:function(){var t;if(this.Eu&&(this.stopAction(this.getActionNames()[0]),(t=this.la(Bg))&&t.ln.Oh(this.Eu),this.Eu=null),this.Dn&&"Mesh"===this.Dn.type){if(this.Dn.parent.remove(this.Dn),Array.isArray(this.Dn.material)){var n,e=xv(this.Dn.material);try{for(e.s();!(n=e.n()).done;)n.value.dispose()}catch(t){e.e(t)}finally{e.f()}}else this.Dn.material.dispose();this.Dn.geometry.dispose(),this.Dn.geometry=void 0,this.Dn.material=void 0,this.Dn.mapNode=void 0,this.Dn=void 0}else this.Dn&&"Scene"===this.Dn.type&&(this.Dn.parent.remove(this.Dn),this.Dn.mapNode=void 0,this.Dn=void 0)},Mh:function(){var t=this.la(Bg);t&&t.enableUpdateRender()},ct:function(){for(var t in this.Da(),this)this[""+t]=null,delete this[""+t]}});var Ov=pr;function Av(t){return(Av="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 Cv(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var e=[],i=!0,r=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(i=(s=a.next()).done)&&(e.push(s.value),!n||e.length!==n);i=!0);}catch(t){r=!0,o=t}finally{try{i||null==a.return||a.return()}finally{if(r)throw o}}return e}}(t,n)||kv(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 kv(t,n){if(t){if("string"==typeof t)return Pv(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(e="Object"===e&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Pv(t,n):void 0}}function Pv(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 Dv(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function jv(t,n){return(jv=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Iv(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Nv(e);return t=i?(t=Nv(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Av(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function Nv(t){return(Nv=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}di=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&jv(t,n)}(r,Dl);var t,n,e,i=Iv(r);function r(t,n){var e;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(e=i.call(this)).Yn=Di.EXTERNAL_MODEL_LAYER,e.ci.name="externalModel",e.ci.userData.type="externalModel",e.Ua="externalModel",e.gu={},e.Ha(t,n),e}return t=r,(n=[{key:"level",get:function(){return this.K.Lt}},{key:"height",get:function(){return this.K.Wt}},{key:"getFeatures",value:function(){return this.Mt}}])&&Dv(t.prototype,n),e&&Dv(t,e),r}();Object.assign(di.prototype,{Ha:function(t,n){var e,i=function(t,n){var e;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(e=kv(t))||n&&t&&"number"==typeof t.length){e&&(t=e);var i=0,n=function(){};return{s:n,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o=!0,s=!1;return{s:function(){e=t[Symbol.iterator]()},n:function(){var t=e.next();return o=t.done,t},e:function(t){s=!0,r=t},f:function(){try{o||null==e.return||e.return()}finally{if(s)throw r}}}}(t.Mt);try{for(i.s();!(e=i.n()).done;){var r=Cv(e.value,2),o=(r[0],r[1]),s=new Ov(o);(s.K=this).Mt.push(s),s.visible=n.map.Zt.Va(this.Yn,{typeID:s.typeID,FID:s.FID})}}catch(t){i.e(t)}finally{i.f()}},za:function(){var t=this.la(Bg);(new Jl).createLight(this,t,"FMExternalModelLayer")},Ah:function(){var n=this,e=this.la(Bg);e.jt.hdr&&e.jt.hdr.load(e,function(t){n.ci.environment=t,e.enableUpdateRender()})},va:function(){this.ci.add(this.Na),this.ci.add(this.ja),this.ci.add(this.Fa),this.ci.add(this.Ia)},da:function(){this.ci.remove(this.Na),this.ci.remove(this.ja),this.ci.remove(this.Fa)},Wa:function(){this.Na=void 0,this.ja=void 0,this.Fa=void 0},ct:function(){this.da(),this.Wa(),this.ci.children=[];for(var t,n=0;n<this.Mt.length;n++)this.Mt[n].ct();for(t in this.Mt.length=0,this)this[""+t]=null,delete this[""+t]}});var Fv=di;function Uv(t){return(Uv="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 Bv(t,n){var e;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(e=function(t,n){if(t){if("string"==typeof t)return Gv(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(e="Object"===e&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Gv(t,n):void 0}}(t))||n&&t&&"number"==typeof t.length){e&&(t=e);var i=0,n=function(){};return{s:n,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o=!0,s=!1;return{s:function(){e=t[Symbol.iterator]()},n:function(){var t=e.next();return o=t.done,t},e:function(t){s=!0,r=t},f:function(){try{o||null==e.return||e.return()}finally{if(s)throw r}}}}function Gv(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 Hv(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Vv(t,n){return(Vv=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function zv(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Wv(e);return t=i?(t=Wv(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Uv(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function Wv(t){return(Wv=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}pi=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Vv(t,n)}(r,Rl);var t,n,e,i=zv(r);function r(t){var n;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(n=i.call(this)).Ch=[],void 0!==t&&void 0!==t.type&&(n.Yn=t.type),n}return t=r,(n=[{key:"getMarkers",value:function(){return this.Mt}},{key:"add",value:function(t){t.K=this,t.kh||t.bs()?this.R(t):this.Ch.push(t),this.needUpdateBound=!0}},{key:"remove",value:function(t){this.Ph(t),t.dispose();t=this.Mt.indexOf(t);-1<t&&this.Mt.splice(t,1),this.needUpdateBound=!0}},{key:"clear",value:function(){var t,n=Bv(this.Mt);try{for(n.s();!(t=n.n()).done;){var e=t.value;this.Ph(e),e.dispose()}}catch(t){n.e(t)}finally{n.f()}this.Mt.length=0}},{key:"traverse",value:function(t){var n,e=Bv(this.Mt);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=Bv(this.Mt);try{for(n.s();!(t=n.n()).done;){var e=t.value;this.Ph(e),e.dispose()}}catch(t){n.e(t)}finally{n.f()}this.Mt.length=0,this.ci=void 0}}])&&Hv(t.prototype,n),e&&Hv(t,e),r}();Object.assign(pi.prototype,{Dh:function(){var t,n=Bv(this.Ch);try{for(n.s();!(t=n.n()).done;){var e,i=t.value;i.bs()&&(-1<(e=this.Ch.indexOf(i))&&this.Ch.splice(e,1),this.R(i))}}catch(t){n.e(t)}finally{n.f()}},R:function(t){this.Mt.push(t),t.Dn&&this.ci.add(t.Dn)},Ph:function(t){t.K=void 0,this.ci.remove(t.Dn)}});var Xv=pi;function Zv(t){return(Zv="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 Yv(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function qv(t,n){return(qv=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Kv(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Jv(e);return t=i?(t=Jv(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Zv(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function Jv(t){return(Jv=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Qv=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&qv(t,n)}(r,Xv);var t,n,e,i=Kv(r);function r(){var t;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(t=i.call(this)).Yn=Di.IMAGE_MARKER,t.Ri=!0,t}return t=r,(n=[{key:"collision",get:function(){return this.Ri}}])&&Yv(t.prototype,n),e&&Yv(t,e),r}();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 tp(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function np(t,n){return(np=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function ep(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=ip(e);return t=i?(t=ip(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==$v(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function ip(t){return(ip=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function rp(t){Z.call(this),this.element=t,this.element.style.position="absolute",this.addEventListener("removed",function(){this.traverse(function(t){t.element instanceof Element&&null!==t.element.parentNode&&t.element.parentNode.removeChild(t.element)})})}var op=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&np(t,n)}(r,Xv);var t,n,e,i=ep(r);function r(){var t;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(t=i.call(this)).Yn=Di.TEXT_MARKER,t.isHasText=!0,t.Ri=!0,t}return t=r,(n=[{key:"collision",get:function(){return this.Ri}}])&&tp(t.prototype,n),e&&tp(t,e),r}();(rp.prototype=Object.create(Z.prototype)).constructor=rp;function sp(){var e,i,a,u,h=this,c=new St,r=new Et,f=new Et,l={objects:new WeakMap},d=document.createElement("div");function v(t,n,e){var i,r;t instanceof rp&&(t.onBeforeRender(h,n,e),c.setFromMatrixPosition(t.matrixWorld),c.applyMatrix4(f),i=t.element,r="translate(-50%,-50%) translate("+(c.x*a+a)+"px,"+(-c.y*u+u)+"px)",i.style.WebkitTransform=r,i.style.MozTransform=r,i.style.oTransform=r,i.style.transform=r,i.style.display=t.visible&&-1<=c.z&&c.z<=1?"":"none",r={distanceToCameraSquared:p(e,t)},l.objects.set(t,r),i.parentNode!==d&&d.appendChild(i),t.onAfterRender(h,n,e));for(var o=0,s=t.children.length;o<s;o++)v(t.children[o],n,e)}d.style.overflow="hidden",this.domElement=d,this.getSize=function(){return{width:e,height:i}},this.setSize=function(t,n){a=(e=t)/2,u=(i=n)/2,d.style.width=t+"px",d.style.height=n+"px"};var o,s,p=(o=new St,s=new St,function(t,n){return o.setFromMatrixPosition(t.matrixWorld),s.setFromMatrixPosition(n.matrixWorld),o.distanceToSquared(s)});this.render=function(t,n){!0===t.autoUpdate&&t.updateMatrixWorld(),null===n.parent&&n.updateMatrixWorld(),r.copy(n.matrixWorldInverse),f.multiplyMatrices(n.projectionMatrix,r),v(t,t,n)}}function ap(t){return(ap="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 up(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function hp(t,n){return(hp=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function cp(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=fp(e);return t=i?(t=fp(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==ap(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function fp(t){return(fp=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var lp=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&hp(t,n)}(r,Xv);var t,n,e,i=cp(r);function r(){var t;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(t=i.call(this)).Yn=Di.DOM_MARKER,t}return t=r,(n=[{key:"add",value:function(t){this.Mt.push(t),this.needUpdateBound=!0}},{key:"remove",value:function(t){t=this.Mt.indexOf(t);-1<t&&this.Mt.splice(t,1),this.needUpdateBound=!0}},{key:"clear",value:function(){for(;0<this.Mt.length;)this.Mt[0].dispose();this.Mt.length=0,this.needUpdateBound=!0}},{key:"dispose",value:function(){this.Mt.length=0,this.ci=void 0}},{key:"visible",get:function(){return this.Ti},set:function(t){for(var n=0;n<this.Mt.length;n++)this.Mt[n].visible=t}}])&&up(t.prototype,n),e&&up(t,e),r}();function dp(t){return(dp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function vp(t,n){return(vp=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function pp(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=mp(e);return t=i?(t=mp(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==dp(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function mp(t){return(mp=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var gp=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&vp(t,n)}(e,Xv);var n=pp(e);function e(){var t;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,e),(t=n.call(this)).Yn=Di.POLYGON_MARKER,t}return e}();function yp(t){return(yp="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 bp(t,n){return(bp=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function _p(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=wp(e);return t=i?(t=wp(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==yp(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function wp(t){return(wp=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var xp=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&bp(t,n)}(e,Xv);var n=_p(e);function e(){var t;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,e),(t=n.call(this)).Yn=Di.EXTRUDE_MARKER,t}return e}();function Mp(t){return(Mp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Sp(t,n){return(Sp=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Ep(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Tp(e);return t=i?(t=Tp(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Mp(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function Tp(t){return(Tp=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Lp=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Sp(t,n)}(e,Xv);var n=Ep(e);function e(){var t;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,e),(t=n.call(this)).Yn=Di.GRADIENT_POLYGON_MARKER,t}return e}();function Rp(t){return(Rp="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 Op(t,n){var e;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(e=function(t,n){if(t){if("string"==typeof t)return Ap(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(e="Object"===e&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Ap(t,n):void 0}}(t))||n&&t&&"number"==typeof t.length){e&&(t=e);var i=0,n=function(){};return{s:n,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o=!0,s=!1;return{s:function(){e=t[Symbol.iterator]()},n:function(){var t=e.next();return o=t.done,t},e:function(t){s=!0,r=t},f:function(){try{o||null==e.return||e.return()}finally{if(s)throw r}}}}function Ap(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 Cp(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function kp(t,n,e){return(kp="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,n,e){t=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=Ip(t)););return t}(t,n);if(t){n=Object.getOwnPropertyDescriptor(t,n);return n.get?n.get.call(e):n.value}})(t,n,e||t)}function Pp(t,n){return(Pp=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Dp(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Ip(e);return t=i?(t=Ip(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Rp(t)&&"function"!=typeof t?jp(n):t}}function jp(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ip(t){return(Ip=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}Li=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Pp(t,n)}(r,Xv);var t,n,e,i=Dp(r);function r(){var t;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(t=i.call(this)).Yn=Di.HEAT_MAP_MARKER,t.jh=!1,t.Ih=t.Ih.bind(jp(t)),t}return t=r,(n=[{key:"add",value:function(t){kp(Ip(r.prototype),"add",this).call(this,t),t.kh&&!t.Nh&&this.Fh(t.Uh),0<this.Ch.length&&map.on("update",this.Ih)}},{key:"remove",value:function(t){kp(Ip(r.prototype),"remove",this).call(this,t),this.jh&&this.Fh(null)}}])&&Cp(t.prototype,n),e&&Cp(t,e),r}();Object.assign(Li.prototype,{Dh:function(){var t,n=Op(this.Ch);try{for(n.s();!(t=n.n()).done;){var e,i=t.value;i.bs()&&(-1<(e=this.Ch.indexOf(i))&&this.Ch.splice(e,1),this.R(i),i.Nh||this.Fh(i.Uh),i.needUpdateBound=!0)}}catch(t){n.e(t)}finally{n.f()}},Fh:function(i){var t=this.la(um),n=t.getExtendMesh(),e=n.material.map;(n.material.map=i)?(n.material.mapMixColor=!0,n.material.map.needsUpdate=!0):n.material.mapMixColor=!1,n.material.needsUpdate=!0,t.getModelMeshs().forEach(function(t){if("MultiMaterial"===t.material.type)for(var n=t.material.materials.length,e=0;e<n;)(t.material.materials[e].map=i)?(t.material.materials[e].map.needsUpdate=!0,t.material.materials[e].mapMixColor=!0):(t.material.materials[e].mapMixColor=!1,t.material.materials[e].transparent=!0),t.material.materials[e].needsUpdate=!0,e+=0===e?3:2;else(t.material.map=i)?(t.material.mapMixColor=!0,t.material.map.needsUpdate=!0,1===t.material.opacity&&(t.material.transparent=!1)):(t.material.mapMixColor=!1,t.material.transparent=!0),t.material.needsUpdate=!0}),e&&(e.dispose(),e=null),this.jh=!0},Ih:function(){this.Dh(),0===this.Ch.length&&map.off("update",this.Ih)}});var Np=Li;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 Up(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Bp(t,n){return(Bp=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Gp(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Hp(e);return t=i?(t=Hp(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Fp(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function Hp(t){return(Hp=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}Oi=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Bp(t,n)}(r,Xv);var t,n,e,i=Gp(r);function r(){var t;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(t=i.call(this)).Yn=Di.DYNAMIC_MODEL_MARKER,t}return t=r,(n=[{key:"remove",value:function(r){var o,s;r.Bh?(o=this.la(Bg),r.K=void 0,s=this,r.Dn.traverse(function(n){var e,i=this;n instanceof Uo&&(n.material.transparent=!0,e=setInterval(function(){var t=!0;o.getMapOptions().materialMode===Qi.REAL?.05<n.material.uniforms.opacity.value&&(n.material.uniforms.opacity.value-=.05,o.enableUpdateRender(),t=!1):.05<n.material.opacity&&(n.material.opacity-=.05,o.enableUpdateRender(),t=!1),t&&(clearInterval(e),s.ci.remove(r.Dn),r.dispose(),i.needUpdateBound=!0,o.enableUpdateNode(),o.enableUpdateRender())},200))})):(this.Ph(r),r.dispose(),this.needUpdateBound=!0);var t=this.Mt.indexOf(r);-1<t&&this.Mt.splice(t,1)}}])&&Up(t.prototype,n),e&&Up(t,e),r}();Object.assign(Oi.prototype,{za:function(){var t=this.la(Bg);(new Jl).createLight(this,t,"FMDynamicModelLayer")},Ah:function(){var n=this,e=this.la(Bg);e.jt.hdr&&e.jt.hdr.load(e,function(t){n.ci.environment=t,e.enableUpdateRender()})},va:function(){var t=this;this.ci.add(this.Na),this.ci.add(this.ja),this.ci.add(this.Fa),this.ci.add(this.Ia),this.ci.removeLight=function(){t.da()}},da:function(){this.ci.remove(this.Na),this.ci.remove(this.ja),this.ci.remove(this.Fa)}});var Vp=Oi;function zp(t){return(zp="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 Wp(t,n){return(Wp=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Xp(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Zp(e);return t=i?(t=Zp(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==zp(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function Zp(t){return(Zp=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Yp=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Wp(t,n)}(e,Xv);var n=Xp(e);function e(){var t;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,e),(t=n.call(this)).Yn=Di.LINE_MARKER,t}return e}();function qp(t){return(qp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Kp(t,n){return(Kp=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Jp(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Qp(e);return t=i?(t=Qp(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==qp(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function Qp(t){return(Qp=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var $p=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Kp(t,n)}(e,Xv);var n=Jp(e);function e(){var t;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,e),(t=n.call(this)).Yn=Di.LOCATION_MARKER,t}return 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){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var e=[],i=!0,r=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(i=(s=a.next()).done)&&(e.push(s.value),!n||e.length!==n);i=!0);}catch(t){r=!0,o=t}finally{try{i||null==a.return||a.return()}finally{if(r)throw o}}return e}}(t,n)||em(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 em(t,n){if(t){if("string"==typeof t)return im(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(e="Object"===e&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?im(t,n):void 0}}function im(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 rm(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function om(t,n){return(om=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function sm(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=am(e);return t=i?(t=am(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==tm(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function am(t){return(am=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}Fi=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&om(t,n)}(r,xl);var t,n,e,i=sm(r);function r(t){var n;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(n=i.call(this)).jt=t.mapOptions,n.wt=t.states,n.te=t.data,n.Lt=n.te.gid,n.Gh=n.te.gname,n.Hh=n.te.alias,n.Vh=n.te.desc,n.Wt=0,n.Pa=1,n.zh=null,n.Wh=!1,n.Sa=[Di.EXTENT_LAYER,Di.EXTERNAL_MODEL_LAYER,Di.MODEL_LAYER,Di.LABEL_LAYER,Di.FACILITY_LAYER],n.Xh(),n}return t=r,(n=[{key:"bound",get:function(){var n=this;return!0===this.needUpdateBound&&(this.wr.reset(),this.Mt.forEach(function(t){n.wr.expand(t.bound)}),this.needUpdateBound=!1),this.wr.clone()}},{key:"height",get:function(){return this.Wt}},{key:"type",get:function(){return this.te.Yn}},{key:"center",get:function(){var t=this.zh;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.Ti},set:function(t){var n=this;this.Ti=t,this.traverse(function(t){t.ci.visible=!(!t.visible||!n.Ti)});t=this.la(Bg);t&&t.Zt.pa()}},{key:"level",get:function(){return this.Lt}},{key:"name",get:function(){return this.Gh}},{key:"ID",get:function(){return this.ie}},{key:"alias",get:function(){return this.Hh}},{key:"floorID",get:function(){return this.te.floorId}},{key:"getLayers",value:function(t,n){if(void 0===t)return this.Mt;for(var e=[],i=0;i<this.Mt.length;i++)0==(this.Mt[i].type&t)==!!n&&e.push(this.Mt[i]);return e}},{key:"getNodes",value:function(t){var n=[];if(t)for(var e=0;e<this.Mt.length;e++){var i=this.Mt[e];if(t===i.Yn){for(var r=[],o=0;o<i.Mt.length;o++)r.push(i.Mt[o]);0<r.length&&n.push({type:i.Yn,children:r});break}}else for(var s=0;s<this.Mt.length;s++){for(var a=this.Mt[s],u=[],h=0;h<a.Mt.length;h++)u.push(a.Mt[h]);0<u.length&&n.push({type:a.Yn,children:u})}return n}},{key:"getExtendMesh",value:function(){return this.getLayers(Di.EXTENT_LAYER)[0].Mt[0].Dn}},{key:"getModelMeshs",value:function(){for(var t=this.getLayers(Di.MODEL_LAYER)[0],n=[],e=0;e<t.Mt.length;e++)n.push(t.Mt[e].Dn);return n}},{key:"getBound",value:function(){return this.te.getBound().toObject()}},{key:"setExtentImage",value:function(t){for(var n=this.getLayers(Di.EXTENT_LAYER)[0],e=0;e<n.Mt.length;e++)n.Mt[e].ka(t)}},{key:"clearExtentImage",value:function(){this.setExtentImage("")}},{key:"add",value:function(t){return t.ci.position.y=this.Wt,t.K=this,t.ci.rotation.y=this.wt.kn,this.Mt.push(t),t.za&&t.za(),t.va&&t.va(),t.Ah&&t.Ah(),t.ci&&this.K.K.an.dn(this.Lt+"_"+t.type,t.ci),this.la(Bg).an.En(),t}},{key:"remove",value:function(t){for(var n=0;n<this.Mt.length;n++)if(this.Mt[n].type===t){var e=this.Mt[n];this.Zh(e);break}this.needUpdateBound=!0,this.la(Bg).an.En()}},{key:"getOrCreateLayer",value:function(t){var n=this.getLayers(t)[0];return void 0!==n||(t===Di.IMAGE_MARKER?(n=new Qv).ci.position.y=this.Wt:t===Di.TEXT_MARKER?(n=new op).ci.position.y=this.Wt:t===Di.POLYGON_MARKER?(n=new gp).ci.position.y=this.Wt:t===Di.EXTRUDE_MARKER?(n=new xp).ci.position.y=this.Wt:t===Di.GRADIENT_POLYGON_MARKER?(n=new Lp).ci.position.y=this.Wt:t===Di.HEAT_MAP_MARKER?(n=new Np).ci.position.y=this.Wt:t===Di.DYNAMIC_MODEL_MARKER?(n=new Vp).ci.position.y=this.Wt:t===Di.LINE_MARKER?n=new Yp:t===Di.LOCATION_MARKER?n=new $p:t===Di.DOM_MARKER&&(n=new lp),n.K=this,n.ci.rotation.y=this.wt.kn,this.Mt.push(n),n.za&&n.za(),n.va&&n.va(),n.Ah&&n.Ah(),n.ci&&this.K.K.an.dn(this.Lt+"_"+t,n.ci)),n}},{key:"getMapCoordsRange",value:function(){return this.zh}}])&&rm(t.prototype,n),e&&rm(t,e),r}();Object.assign(Fi.prototype,{Xh:function(){this.jt.nonFocusAlphaMode&&(this.wt.Lt===this.Lt?this.Pa=1:this.Pa=this.jt.nonFocusAlpha)},dn:function(t){(t.K=this).Mt.push(t)},Yh:function(){this.Wt=this.K.ya*this.Lt},qh:function(e){for(var t=0;t<this.Mt.length;t++)if("externalModel"===this.Mt[t].Ua)this.Mt[t].ci.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.Mt[t].ci.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)},Kh:function(){for(var t=0;t<this.Mt.length;t++)if("externalModel"===this.Mt[t].Ua)this.Mt[t].ci.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.Mt[t].ci.children,e=0;e<n.length;e++)n[e].material&&n[e].material.userData.oldAlpha&&(n[e].material.opacity=n[e].material.userData.oldAlpha)},Jh:function(){var n=this;this.K.K.Ea.Hr.get(this.K.ma).Mt.forEach(function(t){t.gid===n.Lt&&(t=t.Mt.get(Di.EXTENT_LAYER).getBound(),n.zh={minX:t.pr.x,minY:t.pr.y,maxX:t.mr.x,maxY:t.mr.y})})},Qh:function(){var t,n=this.te,e=null,i=this.la(Bg),r=function(t,n){var e;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(e=em(t))||n&&t&&"number"==typeof t.length){e&&(t=e);var i=0,n=function(){};return{s:n,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o=!0,s=!1;return{s:function(){e=t[Symbol.iterator]()},n:function(){var t=e.next();return o=t.done,t},e:function(t){s=!0,r=t},f:function(){try{o||null==e.return||e.return()}finally{if(s)throw r}}}}(n.Mt);try{for(r.s();!(t=r.n()).done;){var o=nm(t.value,2),s=o[0],a=o[1],u=i.Zt.$h(s);s===Di.EXTENT_LAYER?e=new sd(a,{map:i}):s===Di.MODEL_LAYER?e=new xd(a,{map:i}):s===Di.LABEL_LAYER?e=new $d(a,{map:i}):s===Di.FACILITY_LAYER?e=new pv(a,{map:i}):s===Di.EXTERNAL_MODEL_LAYER&&(e=new Fv(a,{map:i})),e.ci.userData.level=this.Lt,e.ci.position.y=this.Wt,this.dn(e),e.visible=u,e.za&&e.za(),e.va&&e.va(),e.Ah&&e.Ah(),this.needUpdateBound=!0}}catch(t){r.e(t)}finally{r.f()}},tc:function(t,n){for(var e=null,i=0;i<t.length;i++)if(""+t[i].Yn==""+n){e=t[i];break}return e},Zh:function(t){var n=this.Mt.indexOf(t);-1<n&&this.Mt.splice(n,1),t.ct&&t.ct(),t.dispose&&t.dispose()},ct:function(){for(var t,n=0;n<this.Mt.length;n++)this.Mt[n].ct&&this.Mt[n].ct(),this.Mt[n].dispose&&this.Mt[n].dispose();for(t in this.Mt.length=0,this)this[""+t]=null,delete this[""+t]}});var um=Fi;function hm(){this.type="Curve",this.arcLengthDivisions=200}function cm(t,n,e,i,r,o,s,a){hm.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 fm(t,n,e,i,r,o){cm.call(this,t,n,e,e,i,r,o),this.type="ArcCurve"}function lm(){var r=0,o=0,s=0,a=0;function u(t,n,e,i){s=-3*(r=t)+3*n-2*(o=e)-i,a=2*t-2*n+e+i}return{initCatmullRom:function(t,n,e,i,r){u(n,e,r*(e-t),r*(i-n))},initNonuniformCatmullRom:function(t,n,e,i,r,o,s){r=(n-t)/r-(e-t)/(r+o)+(e-n)/o,s=(e-n)/o-(i-n)/(o+s)+(i-e)/s;u(n,e,r*=o,s*=o)},calc:function(t){var n=t*t;return r+o*t+s*n+a*(n*t)}}}Object.assign(hm.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(t,n){t=this.getUtoTmapping(t);return this.getPoint(t,n)},getPoints:function(t){void 0===t&&(t=5);for(var n=[],e=0;e<=t;e++)n.push(this.getPoint(e/t));return n},getSpacedPoints:function(t){void 0===t&&(t=5);for(var n=[],e=0;e<=t;e++)n.push(this.getPointAt(e/t));return n},getLength:function(){var t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var n,e,i=[],r=this.getPoint(0),o=0;for(i.push(0),e=1;e<=t;e++)o+=(n=this.getPoint(e/t)).distanceTo(r),i.push(o),r=n;return this.cacheArcLengths=i},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(t,n){for(var e,i=this.getLengths(),r=0,o=i.length,s=n||t*i[o-1],a=0,u=o-1;a<=u;)if((e=i[r=Math.floor(a+(u-a)/2)]-s)<0)a=r+1;else{if(!(0<e)){u=r;break}u=r-1}if(i[r=u]===s)return r/(o-1);t=i[r];return(r+(s-t)/(i[r+1]-t))/(o-1)},getTangent:function(t){var n=t-1e-4,t=t+1e-4;1<t&&(t=1);n=this.getPoint(n=n<0?0:n);return this.getPoint(t).clone().sub(n).normalize()},getTangentAt:function(t){t=this.getUtoTmapping(t);return this.getTangent(t)},computeFrenetFrames:function(t,n){for(var e,i=new St,r=[],o=[],s=[],a=new St,u=new Et,h=0;h<=t;h++)r[h]=this.getTangentAt(h/t),r[h].normalize();o[0]=new St,s[0]=new St;var c=Number.MAX_VALUE,f=Math.abs(r[0].x),l=Math.abs(r[0].y),d=Math.abs(r[0].z);for(f<=c&&(c=f,i.set(1,0,0)),l<=c&&(c=l,i.set(0,1,0)),d<=c&&i.set(0,0,1),a.crossVectors(r[0],i).normalize(),o[0].crossVectors(r[0],a),s[0].crossVectors(r[0],o[0]),h=1;h<=t;h++)o[h]=o[h-1].clone(),s[h]=s[h-1].clone(),a.crossVectors(r[h-1],r[h]),a.length()>Number.EPSILON&&(a.normalize(),e=Math.acos(Mt.clamp(r[h-1].dot(r[h]),-1,1)),o[h].applyMatrix4(u.makeRotationAxis(a,e))),s[h].crossVectors(r[h],o[h]);if(!0===n)for(e=Math.acos(Mt.clamp(o[0].dot(o[t]),-1,1)),e/=t,0<r[0].dot(a.crossVectors(o[0],o[t]))&&(e=-e),h=1;h<=t;h++)o[h].applyMatrix4(u.makeRotationAxis(r[h],e*h)),s[h].crossVectors(r[h],o[h]);return{tangents:r,normals:o,binormals:s}},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}),((cm.prototype=Object.create(hm.prototype)).constructor=cm).prototype.isEllipseCurve=!0,cm.prototype.getPoint=function(t,n){for(var e=n||new ci,i=2*Math.PI,r=this.aEndAngle-this.aStartAngle,o=Math.abs(r)<Number.EPSILON;r<0;)r+=i;for(;i<r;)r-=i;r<Number.EPSILON&&(r=o?0:i),!0!==this.aClockwise||o||(r===i?r=-i:r-=i);var s=this.aStartAngle+t*r,a=this.aX+this.xRadius*Math.cos(s),u=this.aY+this.yRadius*Math.sin(s);return 0!==this.aRotation&&(n=Math.cos(this.aRotation),o=Math.sin(this.aRotation),a=(t=a-this.aX)*n-(s=u-this.aY)*o+this.aX,u=t*o+s*n+this.aY),e.set(a,u)},cm.prototype.copy=function(t){return hm.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},((fm.prototype=Object.create(cm.prototype)).constructor=fm).prototype.isArcCurve=!0;var dm=new St,vm=new lm,pm=new lm,mm=new lm;function gm(t,n,e,i){hm.call(this),this.type="CatmullRomCurve3",this.points=t||[],this.closed=n||!1,this.curveType=e||"centripetal",this.tension=i||.5}function ym(t,n,e,i,r){var o=.5*(i-n),n=.5*(r-e),r=t*t;return(2*e-2*i+o+n)*(t*r)+(-3*e+3*i-2*o-n)*r+o*t+e}function bm(t,n,e,i){return(r=1-(r=t))*r*n+2*(1-(n=t))*n*e+(t=t)*t*i;var r}function _m(t,n,e,i,r){return(o=1-(o=t))*o*o*n+3*(n=1-(o=t))*n*o*e+3*(1-(e=t))*e*e*i+(t=t)*t*t*r;var o}function wm(t,n,e,i){hm.call(this),this.type="CubicBezierCurve",this.v0=t||new ci,this.v1=n||new ci,this.v2=e||new ci,this.v3=i||new ci}function xm(t,n,e,i){hm.call(this),this.type="CubicBezierCurve3",this.v0=t||new St,this.v1=n||new St,this.v2=e||new St,this.v3=i||new St}function Mm(t,n){hm.call(this),this.type="LineCurve",this.v1=t||new ci,this.v2=n||new ci}function Sm(t,n){hm.call(this),this.type="LineCurve3",this.v1=t||new St,this.v2=n||new St}function Em(t,n,e){hm.call(this),this.type="QuadraticBezierCurve",this.v0=t||new ci,this.v1=n||new ci,this.v2=e||new ci}function Tm(t,n,e){hm.call(this),this.type="QuadraticBezierCurve3",this.v0=t||new St,this.v1=n||new St,this.v2=e||new St}function Lm(t){hm.call(this),this.type="SplineCurve",this.points=t||[]}function Rm(){hm.call(this),this.type="CurvePath",this.curves=[],this.autoClose=!1}function Om(t){Rm.call(this),this.type="Path",this.currentPoint=new ci,t&&this.setFromPoints(t)}function Am(t){Om.call(this,t),this.uuid=Mt.generateUUID(),this.type="Shape",this.holes=[]}((gm.prototype=Object.create(hm.prototype)).constructor=gm).prototype.isCatmullRomCurve3=!0,gm.prototype.getPoint=function(t,n){var e,i=n||new St,r=this.points,o=r.length,s=(o-(this.closed?0:1))*t,a=Math.floor(s),u=s-a;return this.closed?a+=0<a?0:(Math.floor(Math.abs(a)/o)+1)*o:0===u&&a===o-1&&(a=o-2,u=1),e=this.closed||0<a?r[(a-1)%o]:(dm.subVectors(r[0],r[1]).add(r[0]),dm),n=r[a%o],t=r[(a+1)%o],s=this.closed||a+2<o?r[(a+2)%o]:(dm.subVectors(r[o-1],r[o-2]).add(r[o-1]),dm),"centripetal"===this.curveType||"chordal"===this.curveType?(a="chordal"===this.curveType?.5:.25,r=Math.pow(e.distanceToSquared(n),a),o=Math.pow(n.distanceToSquared(t),a),a=Math.pow(t.distanceToSquared(s),a),o<1e-4&&(o=1),vm.initNonuniformCatmullRom(e.x,n.x,t.x,s.x,r=r<1e-4?o:r,o,a=a<1e-4?o:a),pm.initNonuniformCatmullRom(e.y,n.y,t.y,s.y,r,o,a),mm.initNonuniformCatmullRom(e.z,n.z,t.z,s.z,r,o,a)):"catmullrom"===this.curveType&&(vm.initCatmullRom(e.x,n.x,t.x,s.x,this.tension),pm.initCatmullRom(e.y,n.y,t.y,s.y,this.tension),mm.initCatmullRom(e.z,n.z,t.z,s.z,this.tension)),i.set(vm.calc(u),pm.calc(u),mm.calc(u)),i},gm.prototype.copy=function(t){hm.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},((wm.prototype=Object.create(hm.prototype)).constructor=wm).prototype.isCubicBezierCurve=!0,wm.prototype.getPoint=function(t,n){var e=n||new ci,i=this.v0,r=this.v1,o=this.v2,n=this.v3;return e.set(_m(t,i.x,r.x,o.x,n.x),_m(t,i.y,r.y,o.y,n.y)),e},wm.prototype.copy=function(t){return hm.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},((xm.prototype=Object.create(hm.prototype)).constructor=xm).prototype.isCubicBezierCurve3=!0,xm.prototype.getPoint=function(t,n){var e=n||new St,i=this.v0,r=this.v1,o=this.v2,n=this.v3;return e.set(_m(t,i.x,r.x,o.x,n.x),_m(t,i.y,r.y,o.y,n.y),_m(t,i.z,r.z,o.z,n.z)),e},xm.prototype.copy=function(t){return hm.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},((Mm.prototype=Object.create(hm.prototype)).constructor=Mm).prototype.isLineCurve=!0,Mm.prototype.getPoint=function(t,n){n=n||new ci;return 1===t?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n},Mm.prototype.getPointAt=function(t,n){return this.getPoint(t,n)},Mm.prototype.getTangent=function(){return this.v2.clone().sub(this.v1).normalize()},Mm.prototype.copy=function(t){return hm.prototype.copy.call(this,t),this.v1.copy(t.v1),this.v2.copy(t.v2),this},((Sm.prototype=Object.create(hm.prototype)).constructor=Sm).prototype.isLineCurve3=!0,Sm.prototype.getPoint=function(t,n){n=n||new St;return 1===t?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n},Sm.prototype.getPointAt=function(t,n){return this.getPoint(t,n)},Sm.prototype.copy=function(t){return hm.prototype.copy.call(this,t),this.v1.copy(t.v1),this.v2.copy(t.v2),this},((Em.prototype=Object.create(hm.prototype)).constructor=Em).prototype.isQuadraticBezierCurve=!0,Em.prototype.getPoint=function(t,n){var e=n||new ci,i=this.v0,r=this.v1,n=this.v2;return e.set(bm(t,i.x,r.x,n.x),bm(t,i.y,r.y,n.y)),e},Em.prototype.copy=function(t){return hm.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this},Tm.prototype.getPoint=function(t,n){var e=n||new St,i=this.v0,r=this.v1,n=this.v2;return e.set(bm(t,i.x,r.x,n.x),bm(t,i.y,r.y,n.y),bm(t,i.z,r.z,n.z)),e},((Lm.prototype=Object.create(hm.prototype)).constructor=Lm).prototype.isSplineCurve=!0,Lm.prototype.getPoint=function(t,n){var e=n||new ci,i=this.points,r=(i.length-1)*t,o=Math.floor(r),s=r-o,n=i[0===o?o:o-1],t=i[o],r=i[o>i.length-2?i.length-1:o+1],o=i[o>i.length-3?i.length-1:o+2];return e.set(ym(s,n.x,t.x,r.x,o.x),ym(s,n.y,t.y,r.y,o.y)),e},Lm.prototype.copy=function(t){hm.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},Rm.prototype=Object.assign(Object.create(hm.prototype),{constructor:Rm,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 Mm(n,t))},getPoint:function(t){for(var n=t*this.getLength(),e=this.getCurveLengths(),i=0;i<e.length;){if(e[i]>=n){var r=e[i]-n,o=this.curves[i],s=o.getLength();return o.getPointAt(0===s?0:1-r/s)}i++}return null},getLength:function(){var t=this.getCurveLengths();return t[t.length-1]},updateArcLengths:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var t=[],n=0,e=0,i=this.curves.length;e<i;e++)n+=this.curves[e].getLength(),t.push(n);return this.cacheLengths=t},getSpacedPoints:function(t){void 0===t&&(t=40);for(var n=[],e=0;e<=t;e++)n.push(this.getPoint(e/t));return this.autoClose&&n.push(n[0]),n},getPoints:function(t){t=t||12;for(var n,e=[],i=0,r=this.curves;i<r.length;i++)for(var o=r[i],s=o&&o.isEllipseCurve?2*t:o&&(o.isLineCurve||o.isLineCurve3)?1:o&&o.isSplineCurve?t*o.points.length:t,a=o.getPoints(s),u=0;u<a.length;u++){var h=a[u];n&&n.equals(h)||(e.push(h),n=h)}return this.autoClose&&1<e.length&&!e[e.length-1].equals(e[0])&&e.push(e[0]),e},copy:function(t){hm.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}}),Om.prototype=Object.assign(Object.create(Rm.prototype),{constructor:Om,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 Mm(this.currentPoint.clone(),new ci(t,n));return this.curves.push(e),this.currentPoint.set(t,n),this},quadraticCurveTo:function(t,n,e,i){n=new Em(this.currentPoint.clone(),new ci(t,n),new ci(e,i));return this.curves.push(n),this.currentPoint.set(e,i),this},bezierCurveTo:function(t,n,e,i,r,o){i=new wm(this.currentPoint.clone(),new ci(t,n),new ci(e,i),new ci(r,o));return this.curves.push(i),this.currentPoint.set(r,o),this},splineThru:function(t){var n=new Lm([this.currentPoint.clone()].concat(t));return this.curves.push(n),this.currentPoint.copy(t[t.length-1]),this},arc:function(t,n,e,i,r,o){var s=this.currentPoint.x,a=this.currentPoint.y;return this.absarc(t+s,n+a,e,i,r,o),this},absarc:function(t,n,e,i,r,o){return this.absellipse(t,n,e,e,i,r,o),this},ellipse:function(t,n,e,i,r,o,s,a){var u=this.currentPoint.x,h=this.currentPoint.y;return this.absellipse(t+u,n+h,e,i,r,o,s,a),this},absellipse:function(t,n,e,i,r,o,s,a){s=new cm(t,n,e,i,r,o,s,a);0<this.curves.length&&((a=s.getPoint(0)).equals(this.currentPoint)||this.lineTo(a.x,a.y)),this.curves.push(s);s=s.getPoint(1);return this.currentPoint.copy(s),this},copy:function(t){return Rm.prototype.copy.call(this,t),this.currentPoint.copy(t.currentPoint),this}}),Am.prototype=Object.assign(Object.create(Om.prototype),{constructor:Am,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){Om.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 Cm=function(t,n,e){e=e||2;var i,r,o,s,a,u=n&&n.length,h=u?n[0]*e:t.length,c=km(t,0,h,e,!0),f=[];if(!c||c.next===c.prev)return f;if(u&&(c=function(t,n,e,i){var r,o,s,a,u=[];for(r=0,o=n.length;r<o;r++)s=n[r]*i,a=r<o-1?n[r+1]*i:t.length,(a=km(t,s,a,i,!1))===a.next&&(a.steiner=!0),u.push(function(t){var n=t,e=t;for(;(n.x<e.x||n.x===e.x&&n.y<e.y)&&(e=n),n=n.next,n!==t;);return e}(a));for(u.sort(jm),r=0;r<u.length;r++)!function(t,n){(n=function(t,n){var e,i=n,r=t.x,o=t.y,s=-1/0;do{if(o<=i.y&&o>=i.next.y&&i.next.y!==i.y){var a=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(a<=r&&s<a){if((s=a)===r){if(o===i.y)return i;if(o===i.next.y)return i.next}e=i.x<i.next.x?i:i.next}}}while(i=i.next,i!==n);if(!e)return null;if(r===s)return e.prev;var u,h=e,c=e.x,f=e.y,l=1/0;i=e.next;for(;i!==h;)r>=i.x&&i.x>=c&&r!==i.x&&Nm(o<f?r:s,o,c,f,o<f?s:r,o,i.x,i.y)&&((u=Math.abs(o-i.y)/(r-i.x))<l||u===l&&i.x>e.x)&&Gm(i,t)&&(e=i,l=u),i=i.next;return e}(t,n))&&Pm(t=Hm(n,t),t.next)}(u[r],e),e=Pm(e,e.next);return e}(t,n,c,e)),t.length>80*e){for(var l=i=t[0],d=r=t[1],v=e;v<h;v+=e)(o=t[v])<l&&(l=o),(s=t[v+1])<d&&(d=s),i<o&&(i=o),r<s&&(r=s);a=0!==(a=Math.max(i-l,r-d))?1/a:0}return Dm(c,f,e,l,d,a),f};function km(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=Vm(o,t[o],t[o+1],s);else for(o=e-i;n<=o;o-=i)s=Vm(o,t[o],t[o+1],s);return s&&Um(s,s.next)&&(zm(s),s=s.next),s}function Pm(t,n){if(!t)return t;n=n||t;var e,i=t;do{if(e=!1,i.steiner||!Um(i,i.next)&&0!==Fm(i.prev,i,i.next))i=i.next;else{if(zm(i),(i=n=i.prev)===i.next)break;e=!0}}while(e||i!==n);return n}function Dm(t,n,e,i,r,o,s){if(t){!s&&o&&function(t,n,e,i){var r=t;for(;null===r.z&&(r.z=Im(r.x,r.y,n,e,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next,r!==t;);r.prevZ.nextZ=null,r.prevZ=null,function(t){var n,e,i,r,o,s,a,u,h=1;do{for(e=t,o=t=null,s=0;e;){for(s++,i=e,n=a=0;n<h&&(a++,i=i.nextZ);n++);for(u=h;0<a||0<u&&i;)0!==a&&(0===u||!i||e.z<=i.z)?(e=(r=e).nextZ,a--):(i=(r=i).nextZ,u--),o?o.nextZ=r:t=r,r.prevZ=o,o=r;e=i}}while(o.nextZ=null,h*=2,1<s)}(r)}(t,i,r,o);for(var a,u,h=t;t.prev!==t.next;)if(a=t.prev,u=t.next,o?function(t,n,e,i){var r=t.prev,o=t,s=t.next;if(0<=Fm(r,o,s))return!1;var a=(r.x<o.x?r.x<s.x?r:s:o.x<s.x?o:s).x,u=(r.y<o.y?r.y<s.y?r:s:o.y<s.y?o:s).y,h=(r.x>o.x?r.x>s.x?r:s:o.x>s.x?o:s).x,c=(r.y>o.y?r.y>s.y?r:s:o.y>s.y?o:s).y,f=Im(a,u,n,e,i),l=Im(h,c,n,e,i),d=t.prevZ,v=t.nextZ;for(;d&&d.z>=f&&v&&v.z<=l;){if(d!==t.prev&&d!==t.next&&Nm(r.x,r.y,o.x,o.y,s.x,s.y,d.x,d.y)&&0<=Fm(d.prev,d,d.next))return!1;if(d=d.prevZ,v!==t.prev&&v!==t.next&&Nm(r.x,r.y,o.x,o.y,s.x,s.y,v.x,v.y)&&0<=Fm(v.prev,v,v.next))return!1;v=v.nextZ}for(;d&&d.z>=f;){if(d!==t.prev&&d!==t.next&&Nm(r.x,r.y,o.x,o.y,s.x,s.y,d.x,d.y)&&0<=Fm(d.prev,d,d.next))return!1;d=d.prevZ}for(;v&&v.z<=l;){if(v!==t.prev&&v!==t.next&&Nm(r.x,r.y,o.x,o.y,s.x,s.y,v.x,v.y)&&0<=Fm(v.prev,v,v.next))return!1;v=v.nextZ}return!0}(t,i,r,o):function(t){var n=t.prev,e=t,i=t.next;if(0<=Fm(n,e,i))return!1;var r=t.next.next;for(;r!==t.prev;){if(Nm(n.x,n.y,e.x,e.y,i.x,i.y,r.x,r.y)&&0<=Fm(r.prev,r,r.next))return!1;r=r.next}return!0}(t))n.push(a.i/e),n.push(t.i/e),n.push(u.i/e),zm(t),t=u.next,h=u.next;else if((t=u)===h){s?1===s?Dm(t=function(t,n,e){var i=t;do{var r=i.prev,o=i.next.next}while(!Um(r,o)&&Bm(r,i,i.next,o)&&Gm(r,o)&&Gm(o,r)&&(n.push(r.i/e),n.push(i.i/e),n.push(o.i/e),zm(i),zm(i.next),i=t=o),i=i.next,i!==t);return i}(t,n,e),n,e,i,r,o,2):2===s&&function(t,n,e,i,r,o){var s=t;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&function(t,n){return t.next.i!==n.i&&t.prev.i!==n.i&&!function(t,n){var e=t;do{if(e.i!==t.i&&e.next.i!==t.i&&e.i!==n.i&&e.next.i!==n.i&&Bm(e,e.next,t,n))return!0}while(e=e.next,e!==t);return!1}(t,n)&&Gm(t,n)&&Gm(n,t)&&function(t,n){var e=t,i=!1,r=(t.x+n.x)/2,o=(t.y+n.y)/2;for(;e.y>o!=e.next.y>o&&e.next.y!==e.y&&r<(e.next.x-e.x)*(o-e.y)/(e.next.y-e.y)+e.x&&(i=!i),e=e.next,e!==t;);return i}(t,n)}(s,a)){var u=Hm(s,a);return s=Pm(s,s.next),u=Pm(u,u.next),Dm(s,n,e,i,r,o),Dm(u,n,e,i,r,o)}a=a.next}}while(s=s.next,s!==t)}(t,n,e,i,r,o):Dm(Pm(t),n,e,i,r,o,1);break}}}function jm(t,n){return t.x-n.x}function Im(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 Nm(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 Fm(t,n,e){return(n.y-t.y)*(e.x-n.x)-(n.x-t.x)*(e.y-n.y)}function Um(t,n){return t.x===n.x&&t.y===n.y}function Bm(t,n,e,i){return Um(t,e)&&Um(n,i)||Um(t,i)&&Um(e,n)||0<Fm(t,n,e)!=0<Fm(t,n,i)&&0<Fm(e,i,t)!=0<Fm(e,i,n)}function Gm(t,n){return Fm(t.prev,t,t.next)<0?0<=Fm(t,n,t.next)&&0<=Fm(t,t.prev,n):Fm(t,n,t.prev)<0||Fm(t,t.next,n)<0}function Hm(t,n){var e=new Wm(t.i,t.x,t.y),i=new Wm(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 Vm(t,n,e,i){e=new Wm(t,n,e);return i?(e.next=i.next,(e.prev=i).next.prev=e,i.next=e):(e.prev=e).next=e,e}function zm(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 Wm(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 Xm={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 Xm.area(t)<0},triangulateShape:function(t,n){var e=[],i=[],r=[];Zm(t),Ym(e,t);var o=t.length;n.forEach(Zm);for(var s=0;s<n.length;s++)i.push(o),o+=n[s].length,Ym(e,n[s]);for(var a=Cm(e,i),s=0;s<a.length;s+=3)r.push(a.slice(s,s+3));return r}};function Zm(t){var n=t.length;2<n&&t[n-1].equals(t[0])&&t.pop()}function Ym(t,n){for(var e=0;e<n.length;e++)t.push(n[e].x),t.push(n[e].y)}function qm(t){return(qm="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 Km(t,n){kr.call(this),this.type="ShapeGeometry","object"===qm(n)&&(console.warn("THREE.ShapeGeometry: Options parameter has been removed."),n=n.curveSegments),this.parameters={shapes:t,curveSegments:n},this.fromBufferGeometry(new Jm(t,n)),this.mergeVertices()}function Jm(t,l){$r.call(this),this.type="ShapeBufferGeometry",this.parameters={shapes:t,curveSegments:l},l=l||12;var d=[],v=[],p=[],m=[],n=0,g=0;if(!1===Array.isArray(t))i(t);else for(var e=0;e<t.length;e++)i(t[e]),this.addGroup(n,g,e),n+=g,g=0;function i(t){var n,e=v.length/3,t=t.extractPoints(l),i=t.shape,r=t.holes;for(!1===Xm.isClockWise(i)&&(i=i.reverse()),s=0,a=r.length;s<a;s++)n=r[s],!0===Xm.isClockWise(n)&&(r[s]=n.reverse());for(var o=Xm.triangulateShape(i,r),s=0,a=r.length;s<a;s++)n=r[s],i=i.concat(n);for(s=0,a=i.length;s<a;s++){var u=i[s];v.push(u.x,u.y,0),p.push(0,0,1),m.push(u.x,u.y)}for(s=0,a=o.length;s<a;s++){var h=o[s],c=h[0]+e,f=h[1]+e,h=h[2]+e;d.push(c,f,h),g+=3}}this.setIndex(d),this.setAttribute("position",new Hr(v,3)),this.setAttribute("normal",new Hr(p,3)),this.setAttribute("uv",new Hr(m,2))}function Qm(t,n){kr.call(this),this.type="ExtrudeGeometry",this.parameters={shapes:t,options:n},this.fromBufferGeometry(new $m(t,n)),this.mergeVertices()}function $m(t,q){$r.call(this),this.type="ExtrudeBufferGeometry",this.parameters={shapes:t,options:q},t=Array.isArray(t)?t:[t];for(var K=this,J=[],Q=[],n=0,e=t.length;n<e;n++)!function(t){var i=[],n=void 0!==q.curveSegments?q.curveSegments:12,u=void 0!==q.steps?q.steps:1,e=void 0!==q.depth?q.depth:100,r=void 0===q.bevelEnabled||q.bevelEnabled,o=void 0!==q.bevelThickness?q.bevelThickness:6,s=void 0!==q.bevelSize?q.bevelSize:o-2,a=void 0!==q.bevelOffset?q.bevelOffset:0,h=void 0!==q.bevelSegments?q.bevelSegments:3,c=q.extrudePath,f=void 0!==q.UVGenerator?q.UVGenerator:tg;void 0!==q.amount&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),e=q.amount);var l,d,v,p,m,g,y,b,_=!1;c&&(l=c.getSpacedPoints(u),r=!(_=!0),d=c.computeFrenetFrames(u,!1),v=new St,p=new St,m=new St);r||(a=s=o=h=0);var n=t.extractPoints(n),w=n.shape,x=n.holes;if(!Xm.isClockWise(w))for(w=w.reverse(),y=0,b=x.length;y<b;y++)g=x[y],Xm.isClockWise(g)&&(x[y]=g.reverse());var M=Xm.triangulateShape(w,x),S=w;for(y=0,b=x.length;y<b;y++)g=x[y],w=w.concat(g);function E(t,n,e){return n||console.error("THREE.ExtrudeGeometry: vec does not exist"),n.clone().multiplyScalar(e).add(t)}var T,L,R,O,A,C,k=w.length,P=M.length;function D(t,n,e){var i=t.x-n.x,r=t.y-n.y,o=e.x-t.x,s=e.y-t.y,a=i*i+r*r;if(Math.abs(i*s-r*o)>Number.EPSILON){var u=Math.sqrt(a),h=Math.sqrt(o*o+s*s),c=n.x-r/u,f=n.y+i/u,u=((e.x-s/h-c)*s-(e.y+o/h-f)*o)/(i*s-r*o),f=(h=c+i*u-t.x)*h+(c=f+r*u-t.y)*c;if(f<=2)return new ci(h,c);u=Math.sqrt(f/2)}else{f=!1;i>Number.EPSILON?o>Number.EPSILON&&(f=!0):i<-Number.EPSILON?o<-Number.EPSILON&&(f=!0):Math.sign(r)===Math.sign(s)&&(f=!0),u=f?(h=-r,c=i,Math.sqrt(a)):(h=i,c=r,Math.sqrt(a/2))}return new ci(h/u,c/u)}for(var j=[],I=0,N=S.length,F=N-1,U=I+1;I<N;I++,F++,U++)F===N&&(F=0),U===N&&(U=0),j[I]=D(S[I],S[F],S[U]);var B,G,H=[],V=j.concat();for(y=0,b=x.length;y<b;y++){for(g=x[y],B=[],I=0,N=g.length,F=N-1,U=I+1;I<N;I++,F++,U++)F===N&&(F=0),U===N&&(U=0),B[I]=D(g[I],g[F],g[U]);H.push(B),V=V.concat(B)}for(T=0;T<h;T++){for(R=T/h,O=o*Math.cos(R*Math.PI/2),L=s*Math.sin(R*Math.PI/2)+a,I=0,N=S.length;I<N;I++)W((A=E(S[I],j[I],L)).x,A.y,-O);for(y=0,b=x.length;y<b;y++)for(g=x[y],B=H[y],I=0,N=g.length;I<N;I++)W((A=E(g[I],B[I],L)).x,A.y,-O)}for(L=s+a,I=0;I<k;I++)A=r?E(w[I],V[I],L):w[I],_?(p.copy(d.normals[0]).multiplyScalar(A.x),v.copy(d.binormals[0]).multiplyScalar(A.y),m.copy(l[0]).add(p).add(v),W(m.x,m.y,m.z)):W(A.x,A.y,0);for(G=1;G<=u;G++)for(I=0;I<k;I++)A=r?E(w[I],V[I],L):w[I],_?(p.copy(d.normals[G]).multiplyScalar(A.x),v.copy(d.binormals[G]).multiplyScalar(A.y),m.copy(l[G]).add(p).add(v),W(m.x,m.y,m.z)):W(A.x,A.y,e/u*G);for(T=h-1;0<=T;T--){for(R=T/h,O=o*Math.cos(R*Math.PI/2),L=s*Math.sin(R*Math.PI/2)+a,I=0,N=S.length;I<N;I++)W((A=E(S[I],j[I],L)).x,A.y,e+O);for(y=0,b=x.length;y<b;y++)for(g=x[y],B=H[y],I=0,N=g.length;I<N;I++)A=E(g[I],B[I],L),_?W(A.x,A.y+l[u-1].y,l[u-1].x+O):W(A.x,A.y,e+O)}function z(t,n){var e,i;for(I=t.length;0<=--I;){(i=(e=I)-1)<0&&(i=t.length-1);for(var r=0,o=u+2*h,r=0;r<o;r++){var s=k*r,a=k*(r+1);!function(t,n,e,i){Z(t),Z(n),Z(i),Z(n),Z(e),Z(i);i=J.length/3,i=f.generateSideWallUV(K,J,i-6,i-3,i-2,i-1);Y(i[0]),Y(i[1]),Y(i[3]),Y(i[1]),Y(i[2]),Y(i[3])}(n+e+s,n+i+s,n+i+a,n+e+a)}}}function W(t,n,e){i.push(t),i.push(n),i.push(e)}function X(t,n,e){Z(t),Z(n),Z(e);e=J.length/3,e=f.generateTopUV(K,J,e-3,e-2,e-1);Y(e[0]),Y(e[1]),Y(e[2])}function Z(t){J.push(i[3*t+0]),J.push(i[3*t+1]),J.push(i[3*t+2])}function Y(t){Q.push(t.x),Q.push(t.y)}(function(){var t=J.length/3;if(r){var n=0*k;for(I=0;I<P;I++)X((C=M[I])[2]+n,C[1]+n,C[0]+n);for(n=k*(u+2*h),I=0;I<P;I++)X((C=M[I])[0]+n,C[1]+n,C[2]+n)}else{for(I=0;I<P;I++)X((C=M[I])[2],C[1],C[0]);for(I=0;I<P;I++)X((C=M[I])[0]+k*u,C[1]+k*u,C[2]+k*u)}K.addGroup(t,J.length/3-t,0)})(),function(){var t=J.length/3,n=0;for(z(S,n),n+=S.length,y=0,b=x.length;y<b;y++)z(g=x[y],n),n+=g.length;K.addGroup(t,J.length/3-t,1)}()}(t[n]);this.setAttribute("position",new Hr(J,3)),this.setAttribute("uv",new Hr(Q,2)),this.computeVertexNormals()}(Km.prototype=Object.create(kr.prototype)).constructor=Km,(Jm.prototype=Object.create($r.prototype)).constructor=Jm,(Qm.prototype=Object.create(kr.prototype)).constructor=Qm,($m.prototype=Object.create($r.prototype)).constructor=$m;var tg={generateTopUV:function(t,n,e,i,r){var o=n[3*e],s=n[3*e+1],a=n[3*i],e=n[3*i+1],i=n[3*r],r=n[3*r+1];return[new ci(o,s),new ci(a,e),new ci(i,r)]},generateSideWallUV:function(t,n,e,i,r,o){var s=n[3*e],a=n[3*e+1],u=n[3*e+2],h=n[3*i],c=n[3*i+1],f=n[3*i+2],l=n[3*r],d=n[3*r+1],e=n[3*r+2],i=n[3*o],r=n[3*o+1],o=n[3*o+2];return Math.abs(a-c)<.01?[new ci(s,1-u),new ci(h,1-f),new ci(l,1-e),new ci(i,1-o)]:[new ci(a,1-u),new ci(c,1-f),new ci(d,1-e),new ci(r,1-o)]}},ng=new ci;function eg(t,n){this.min=void 0!==t?t:new ci(1/0,1/0),this.max=void 0!==n?n:new ci(-1/0,-1/0)}function ig(t){return function(t){if(Array.isArray(t))return rg(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,n){if(t){if("string"==typeof t)return rg(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(e="Object"===e&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?rg(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 rg(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 og(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function sg(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function ag(t,n,e){return n&&sg(t.prototype,n),e&&sg(t,e),t}Object.assign(eg.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=ng.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 ci),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 ci),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 ci),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 ci),n.copy(t).clamp(this.min,this.max)},distanceToPoint:function(t){return ng.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 ug=function(){function f(){og(this,f)}return ag(f,null,[{key:"getPointFromBound",value:function(t){var n=t.min.x,e=t.min.y,i=t.max.x,t=t.max.y;return[{x:n,y:e},{x:n,y:t},{x:i,y:e},{x:i,y:t}]}},{key:"getBoundFromPoint",value:function(t){for(var n=t[0].x,e=t[0].y,i=t[0].x,r=t[0].y,o=0;o<t.length;o++){var s=t[o];n>s.x&&(n=s.x),e>s.y&&(e=s.y),i<s.x&&(i=s.x),r<s.y&&(r=s.y)}return{max:{x:i,y:r},min:{x:n,y:e},size:{x:i-n,y:r-e}}}},{key:"getRotationBound",value:function(t,n){for(var e=new St(0,1,0),i=(new Et).makeRotationAxis(e,n.getRotation()*Math.PI/180),r=f.getPointFromBound(t),o=[],s=0;s<r.length;s++){var a=(a=new St(r[s].x-n.getX(),0,n.getY()-r[s].y)).applyMatrix4(i);o.push(a)}for(var u=[],h=0;h<r.length;h++){var c=o[h];u.push({x:c.x+n.getX(),y:n.getY()-c.z})}return f.getBoundFromPoint(u)}}]),f}(),hg=function(){function g(){og(this,g)}return ag(g,null,[{key:"showFloorNode",value:function(t,n){for(var e=0;e<n.Mt.length;e++){var i=n.Mt[e];if(-1<t.wt.Mn.indexOf(n.level))for(var r=0;r<i.Mt.length;r++){var o=i.Mt[r];o.Dn||1!=o.visible||t.Zt.nc.push([e,o])}}}},{key:"showAllNode",value:function(n){for(n.getLevels().forEach(function(t){g.showFloorNode(n,n.getFloor(t))});0<n.Zt.nc.length;)n.Zt.ec()}},{key:"recoveAllNode",value:function(t){t.enableUpdateNode(),t.Zt.ic()}},{key:"setVisibleLevelsFrustumCulled",value:function(t,n){for(var e=t.an,i=e.K.wt.Mn,r=0;r<i.length;r++){var o=i[r]+"_"+Di.LABEL,s=i[r]+"_"+Di.FACILITY,a=i[r]+"_"+Di.TEXT_MARKER,u=i[r]+"_"+Di.IMAGE_MARKER,h=e.Cn.get(o),o=e.Cn.get(s),s=e.Cn.get(a),a=e.Cn.get(u),u=[];h&&h.children&&u.push.apply(u,ig(h.children)),o&&o.children&&u.push.apply(u,ig(o.children)),s&&s.children&&u.push.apply(u,ig(s.children)),a&&a.children&&u.push.apply(u,ig(a.children)),u.forEach(function(t){t.frustumCulled=n})}}},{key:"setValue",value:function(t,n,e){e[t]=n}},{key:"getValue",value:function(t,n){return n[t]}},{key:"addLastFrame",value:function(n,e){var i=window.devicePixelRatio||1,t=n.an.renderer,r=t.domElement.parentElement,o=t.domElement.clientWidth,s=t.domElement.clientHeight,a=document.createElement("canvas");a.width=o*i,a.height=s*i,a.style.width=o+"px",a.style.height=s+"px",a.style.position="absolute",a.style.zIndex=1,a.className="exportImageLastFrame";var u=a.getContext("2d"),h=new Image;h.onload=function(t){u.drawImage(t.path[0],0,0,o*i,s*i),r.append(a),n.Dt.Pt({type:"printBefor"}),e()},h.onerror=function(t){console.warn("fail...",t)},n.an.render(),h.src=t.domElement.toDataURL()}},{key:"removeLastFrame",value:function(t){var n=t.an.renderer,e=document.querySelector(".exportImageLastFrame"),n=n.domElement.parentElement;n&&e&&n.removeChild(e),t.Dt.Pt({type:"printAfter"})}},{key:"start",value:function(t){var n={callback:null,viewParam:{width:0,height:0},state:{col:0,row:0,loadCount:0},camera:null,backCamera:null,width:0,height:0,padding:0,canvas:null,renderTarget:null,cameraType:null,defaultLogoAspact:null},e=t.padding,i=t.map,r=t.imageWidth,o=t.imageHieght,s=t.callback,a=t.bound,u=t.cameraType;a&&(g.setValue("originBound",{max:{x:a.max.x,y:a.max.y},min:{x:a.min.x,y:a.min.y}},n),a.size||(a.size.x=a.max.x-a.min.x,a.size.y=a.max.y-a.min.y),t=r/a.size.x,h=o/a.size.y,a=ug.getRotationBound(a,i),Math.abs(h-t)<.1&&(r=a.size.x*t,o=a.size.y*h)),g.setValue("mapZoom",i.getZoom(),n),g.setValue("cameraType",u||"2d",n),g.setValue("backCamera","2d"==n.cameraType?i.kt:{aspect:i.kt.aspect},n);var h=r/o;15e3<(o=15e3<r?+(r=15e3)/h:o)&&(r=(o=15e3)*h),e=e||0,e*=2,r=Math.ceil(r),o=Math.ceil(o),g.setValue("width",r,n),g.setValue("height",o,n);u=i.an.renderer.domElement.clientWidth,h=i.an.renderer.domElement.clientHeight;g.setValue("defaultLogoAspact",u/h,n),g.setValue("domSize",{width:u,height:h},n),g.setValue("padding",e,n),g.setValue("callback",s,n);u={width:r,height:o};4096<u.width&&(u.width=4096),4096<u.height&&(u.height=4096),g.setValue("viewParam",u,n);h=Math.ceil(r/n.viewParam.width),s=Math.ceil(o/n.viewParam.height);g.setValue("state",{col:h,row:s,loadCount:0},n);s=document.createElement("canvas");s.width=r,s.height=o,s.style.width=r+"px",s.style.height=o+"px",g.setValue("canvas",s,n),"2d"==n.cameraType?(a=g.getCameraParame2d(i,r,o,a,e,void 0,n),g.setValue("camera",a,n),i.kt=a):"3d"==n.cameraType&&g.setCameraParame3d(i,r,o,null,e,n),i.an.renderer.setPixelRatio(1),i.an.renderer.setSize(u.width,u.height),i.an.K.Dt.Pt({type:"viewModeChanged"}),g.shot(i,s,n)}},{key:"print",value:function(t){g.addLastFrame(t.map,function(){g.start(t)})}},{key:"recoverParam",value:function(t,n){"2d"===n.cameraType?(t.kt=g.getValue("backCamera",n),t.in=t.kt):"3d"===n.cameraType&&(i=g.getValue("backCamera",n),t.kt.aspect=i.aspect,t.kt.clearViewOffset());var e=g.getValue("domSize",n),i=window.devicePixelRatio||1;t.an.renderer.setPixelRatio(i),t.an.renderer.setSize(e.width,e.height),t.an.K.Dt.Pt({type:"viewModeChanged"}),g.recoveAllNode(t,n),g.setLogo(t,g.getValue("defaultLogoAspact",n)),t.W.Ct.object=t.kt,g.setVisibleLevelsFrustumCulled(t,!0),t.an.sn(),t.an.ri=!0,t.an.Ln(t.getZoom()),t.an.renderer.clear(),t.an.render(),t.enableUpdateNode(),g.removeLastFrame(t)}},{key:"getCameraParame2d",value:function(t,n,e,i,r,o,s){var a,u,h,c,f,l,d,v=Math.min(n,e),p=o||(v-r)/v,o=t.getState(),r=i.min,v=i.max,i=Math.abs(v.x-r.x),v=Math.abs(v.y-r.y);Math.abs(i/v-n/e)<.05?h=i<v?(m=-v/2,a=v/2,u=-i/(r=v/i)/2/(h=n/e),i/r/2/h):(m=-v/2,a=v/2,u=-i/(f=i/v)/2/(c=e/n),i/f/2/c):i<v?h=e<n?(m=-v/2,a=v/2,u=-i/(f=i/v)/2/(c=e/n),i/f/2/c):(m=-v/2/(l=n/e),a=v/2/l,u=-i/(l=i/v)/2,i/l/2):v<=i&&(h=e<=n?(m=-v/2,a=v/2,u=-i/2/(l=e/n)/(d=i/v),i/2/l/d):(m=-v/2*(d=i/v)/(e=n/e),a=v/2*d/e,u=-i/2,i/2));var m=new q(u,h,a,m,1,1e4);m.zoom=p,m.up=new St(0,1,0),m.rotation.x=-Math.PI/2,m.rotation.y=0,m.rotation.z=-o.rotation*Math.PI/180;p=t.getBound().center,o=g.getValue("originBound",s),s=(o.max.x+o.min.x)/2-p.x,p=(o.max.y+o.min.y)/2-p.y;return m.position.x=s,m.position.y=t.kt.position.y,m.position.z=-p,m.updateProjectionMatrix(),m.updateMatrix(),m.updateMatrixWorld(),m.updateWorldMatrix(),m.matrixWorldNeedsUpdate=!0,m}},{key:"setCameraParame3d",value:function(t,n,e,i,r,o){t.kt.aspect=n/e,g.setValue("camera",t.kt,o)}},{key:"readPixcel",value:function(e,i,r,o){var t=g.getValue("state",o),s=t.row,a=t.col,n=e.an.renderer,u=g.getValue("canvas",o),t=g.getValue("viewParam",o),h=t.width,c=t.height,f=u.getContext("2d"),t=document.createElement("canvas");t.width=h,t.height=c;var l=t.getContext("2d"),d=g.getValue("callback",o),t=new Image;t.onload=function(t){var n=g.getValue("state",o);n.loadCount++,g.setValue("state",n,o),l.drawImage(t.path[0],0,0,h,c),f.putImageData(l.getImageData(0,0,h,c),i,r),n.loadCount===s*a&&(u.toBlob(function(t){d&&d(t),t=null}),g.recoverParam(e,o),o.callback=null,o.viewParam=null,o.state=null,o.camera=null,o.backCamera=null,o.canvas=null,o=null)},e.an.render(),t.src=n.domElement.toDataURL()}},{key:"setLogo",value:function(t,n){t.an.needLogo&&(n=Math.min(n,1),t.an.ei.material.uniforms.offset.value.x=-1*(.5*.4/n-1))}},{key:"caleAvoid",value:function(t,n){var e,i;"2d"==t.cameraType?n.an.Ln(n.getZoom()):"3d"==t.cameraType&&(i=g.getValue("mapZoom",t),n.an.Ln(i)),"2d"==t.cameraType?(g.showAllNode(n,t),e=g.getValue("width",t),i=g.getValue("height",t),n.an.renderer.setSize(e,i),n.an.sn(),n.an.Oi(),t=g.getValue("viewParam",t),n.an.renderer.setSize(t.width,t.height)):(n.an.sn(),n.an.Oi())}},{key:"shot",value:function(t,n,e){g.setLogo(t,e.width/e.height);var i=g.getValue("camera",e);t.an.ri=!0,g.setVisibleLevelsFrustumCulled(t,!1);var r=g.getValue("state",e),o=r.row,s=r.col,a=g.getValue("viewParam",e);g.caleAvoid(e,t);for(var u=0;u<o*s;u++){var h=Math.floor(u/s),c=Math.max(u-h*s,0),f=n.width,l=n.height,d=new Image;d.indexI=h,d.indexJ=c;c=a.width*d.indexJ,d=a.height*d.indexI;i.setViewOffset(f,l,c,d,a.width,a.height),i.updateProjectionMatrix(),g.readPixcel(t,c,d,e)}}}]),g}();function cg(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function fg(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function lg(t,n,e){return n&&fg(t.prototype,n),e&&fg(t,e),t}var dg=function(){function t(){cg(this,t)}return lg(t,null,[{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.an.needLogo&&(n=Math.min(n,1),t.an.ei.material.uniforms.offset.value.x=-1*(.5*.4/n-1))}},{key:"setVisibleLevelsFrustumCulled",value:function(t,n){this.forEachElement(t,function(t){t=t.renderNodeProxy||t.Dn;t&&(t.frustumCulled=n)})}},{key:"showFloorNode",value:function(t,n){for(var e=0;e<n.Mt.length;e++){var i=n.Mt[e];if(-1<t.wt.Mn.indexOf(n.level))for(var r=0;r<i.Mt.length;r++){var o=i.Mt[r];o.Dn||1!=o.visible||t.Zt.nc.push([e,o])}}}},{key:"showAllNode",value:function(n){var e=this;for(n.getLevels().forEach(function(t){e.showFloorNode(n,n.getFloor(t))});0<n.Zt.nc.length;)n.Zt.ec()}},{key:"recoveAllNode",value:function(t){t.enableUpdateNode(),t.Zt.ic()}},{key:"removeLastFrame",value:function(t){var n=t.an.renderer,e=document.querySelector(".exportImageLastFrame"),n=n.domElement.parentElement;n&&e&&n.removeChild(e),t.Dt.Pt({type:"printAfter"})}},{key:"addLastFrame",value:function(n,e){var i=window.devicePixelRatio||1,t=n.an.renderer,r=t.domElement.parentElement,o=t.domElement.clientWidth,s=t.domElement.clientHeight,a=document.createElement("canvas");a.width=o*i,a.height=s*i,a.style.width=o+"px",a.style.height=s+"px",a.style.position="absolute",a.style.zIndex=1,a.className="exportImageLastFrame";var u=a.getContext("2d"),h=new Image;h.onload=function(t){u.drawImage(t.path[0],0,0,o*i,s*i),r.append(a),n.Dt.Pt({type:"printBefor"}),e()},h.onerror=function(t){console.warn("fail...",t)},n.an.render(),h.src=t.domElement.toDataURL()}},{key:"insideBound",value:function(t,n){var e=!1;return e=t.min.x>=n.min.x&&t.min.y>=n.min.y&&t.max.x<=n.max.x&&t.max.y<=n.max.y?!0:e}},{key:"forEachElement",value:function(t,n){for(var e=0;e<t.Mt[0].Mt.length;e++){var i=t.Mt[0].Mt[e];if(!1!=-1<t.wt.Mn.indexOf(i.level))for(var r=0;r<i.Mt.length;r++)for(var o=i.Mt[r],s=0;s<o.Mt.length;s++)n(o.Mt[s])}}},{key:"getInBoundElement",value:function(t,e,i){var r=this;this.forEachElement(t,function(t){var n=t.renderNodeProxy||t.Dn;n&&"Sprite"===n.type&&r.insideBound(t.bound,e)&&i.push(t)})}},{key:"getElementBound",value:function(t){var n=new Nh;return t.forEach(function(t){n.expand(t.bound)}),n}}]),t}(),vg=function(){function t(){cg(this,t)}return lg(t,null,[{key:"createCamera",value:function(){var t=new q(-1,1,1,-1,1,1e4);return t.up=new St(0,1,0),t}},{key:"updateCamera",value:function(t,n,e,i,r){var o;r.left=-n/2,r.right=n/2,r.top=e/2,r.bottom=-e/2,o=n/e>i.size.x/i.size.y?e/i.size.y:n/i.size.x,r.rotation.x=-Math.PI/2,r.rotation.y=0;e=t.Mt[0].x,n=t.Mt[0].y,e=i.center.x-e,i=n-i.center.y;r.position.x=e,r.position.y=(t.getLevels().length+1)*t.getFloorSpace(),r.position.z=i,r.zoom=o,r.updateProjectionMatrix(),r.updateMatrixWorld()}}]),t}(),pg=function(){function u(){cg(this,u)}return lg(u,null,[{key:"getSpriteSize",value:function(t,n,e,i){var r,o,s=t.size||t.wi,a=(t.renderNodeProxy||t.Dn).material.userData.scaleRatio;return!t.parent.isHasText||1<(r=t.text.split("%rn%").length)&&(o=s=t.fontsize*r+2*(r-1)),new ci((o=s=t.type===Di.LABEL&&(!t.text||t.text.length<1)?0:s)/a*Math.abs(n.left-n.right)/n.zoom/i,o*Math.abs(n.top-n.bottom)/n.zoom/e)}},{key:"extendBoundBySizeAndCenter",value:function(t,n,e){var i=n.x/2,r=n.y/2,o=e.min.x,s=e.min.y,a=e.max.x,u=e.max.y,n=t.x,t=t.y;e.min.x>n-i&&(o=n-i),e.max.x<n+i&&(a=n+i),e.min.y>t-r&&(s=t-r),e.max.y<t+r&&(u=t+r),e.expandByCoords([{x:o,y:s},{x:a,y:u}])}},{key:"calcElements",value:function(t,n,e,i,r){for(var o=0;o<t.length;o++){var s=t[o],a=s.renderNodeProxy||s.Dn;a&&"Sprite"===a.type&&(a=u.getSpriteSize(s,e,i,r),u.extendBoundBySizeAndCenter(s.bound.center,a,n))}}},{key:"getWidthSpriteBound",value:function(t,n,e,i){var r=new Nh;return this.calcElements(t,r,n,e,i),r}}]),u}(),mg=function(){function t(){cg(this,t)}return lg(t,null,[{key:"isNumber",value:function(t){return"number"==typeof t&&isFinite(t)}},{key:"readOptions",value:function(t){t.padding=void 0!==t.padding?t.padding:5,this.isNumber(t.padding)||(t.padding=5),t.imageWidth=void 0!==t.imageWidth?t.imageWidth:1e3,t.imageHeight=void 0!==t.imageHeight?t.imageHeight:1e3;15e3<t.imageWidth&&(t.imageWidth=15e3),15e3<t.imageHeight&&(t.imageHeight=15e3),t.imageWidth<200&&(t.imageWidth=200),t.imageHeight<200&&(t.imageHeight=200),t.imageWidth=Math.ceil(t.imageWidth),t.imageHeight=Math.ceil(t.imageHeight);var n,e,i,r,o=new Nh;void 0!==t.bound?o.expandByCoords([{x:t.bound.min.x,y:t.bound.min.y},{x:t.bound.max.x,y:t.bound.max.y}]):(e={x:0,y:t.map.an.renderer.domElement.clientHeight},i={x:t.map.an.renderer.domElement.clientWidth,y:t.map.an.renderer.domElement.clientHeight},r={x:t.map.an.renderer.domElement.clientWidth,y:0},n=_g.coordsScreenToMap(t.map,{x:0,y:0}),e=_g.coordsScreenToMap(t.map,e),i=_g.coordsScreenToMap(t.map,i),r=_g.coordsScreenToMap(t.map,r),o.expandByCoords([n,e,i,r])),t.bound=o}},{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.an.renderer.domElement.clientWidth,height:t.map.an.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};4096<t.renderSizeExport.width&&(t.renderSizeExport.width=4096),4096<t.renderSizeExport.height&&(t.renderSizeExport.height=4096),t.backCamera=t.map.camera,t.camera=vg.createCamera()}},{key:"calcElementBound",value:function(t,n){var e=[];return dg.getInBoundElement(t,n,e),{bound:dg.getElementBound(e),elements:e}}},{key:"expandBoundBySprite",value:function(t,n,e){for(var i=t.clone(),r=0;r<100&&(vg.updateCamera(e.map,e.imageRenderSize.width,e.imageRenderSize.height,i,e.camera),!(15e3<(i=pg.getWidthSpriteBound(n,e.camera,e.imageRenderSize.height,e.imageRenderSize.width)).size.x||15e4<i.size.y));r++);t.expand(i),e.outBound=t,vg.updateCamera(e.map,e.imageRenderSize.width,e.imageRenderSize.height,e.outBound,e.camera),e.map.camera=e.camera}},{key:"addLastFrame",value:function(t,n){dg.addLastFrame(t.map,n)}},{key:"caleAvoid",value:function(t){t.map.an.Ln(t.map.getZoom()),t.map.an.renderer.setPixelRatio(1),dg.showAllNode(t.map),t.map.an.renderer.setSize(t.imageRenderSize.width,t.imageRenderSize.height),t.map.an.sn(),t.map.an.Oi(),t.map.an.K.Dt.Pt({type:"viewModeChanged"}),t.map.an.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;dg.setLogo(e,i.width/i.height),dg.setVisibleLevelsFrustumCulled(e,!1),this.caleAvoid(t);var s=document.createElement("canvas");s.width=t.imageWidth,s.height=t.imageHeight,s.style.width=t.imageWidth+"px",s.style.height=t.imageHeight+"px";e=s.getContext("2d");e.fillStyle="#FFFFFF",e.fillRect(0,0,t.imageWidth,t.imageHeight);var a={col:0,row:0,loadCount:0};a.col=Math.ceil(t.imageRenderSize.width/t.renderSizeExport.width),a.row=Math.ceil(t.imageRenderSize.height/t.renderSizeExport.height);for(var u=0;u<a.row*a.col;u++){var h=Math.floor(u/a.col),c=Math.max(u-h*a.col,0),c=r.width*c,h=r.height*h;o.setViewOffset(i.width,i.height,c,h,r.width,r.height),o.updateProjectionMatrix(),this.renderImage(c,h,a,s,n,t)}}},{key:"renderImage",value:function(n,e,i,r,o,t){var s=t.map,a=t.padding,u=t.renderSizeExport,h=r.getContext("2d"),t=document.createElement("canvas");t.width=u.width,t.height=u.height;var c=t.getContext("2d"),t=new Image;t.onload=function(t){i.loadCount++,c.drawImage(t.path[0],0,0,u.width,u.height),h.putImageData(c.getImageData(0,0,u.width,u.height),n+a,e+a),i.loadCount===i.row*i.col&&(r.toBlob(function(t){dg.downLoad(t)}),o())},s.an.render(),t.src=s.an.renderer.domElement.toDataURL()}},{key:"recoverParam",value:function(t){var n=t.map;n.kt=t.backCamera;var e=t.renderSizeMap,i=window.devicePixelRatio||1;n.an.renderer.setPixelRatio(i),n.an.renderer.setSize(e.width,e.height),n.an.K.Dt.Pt({type:"viewModeChanged"}),dg.recoveAllNode(n,t),dg.setLogo(n,e.width/e.height),n.W.Ct.object=n.kt,dg.setVisibleLevelsFrustumCulled(n,!0),n.an.sn(),n.an.Ln(n.getZoom()),n.an.ri=!0,n.an.renderer.clear(),n.an.render(),n.enableUpdateNode(),dg.removeLastFrame(n)}}]),t}();function gg(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var yg=!1,bg=0,_g=function(){function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t)}var n,e,i;return n=t,i=[{key:"coordsMapToScreen",value:function(t,n){return this.coordsMapToScreen_(t,{x:n.x,y:n.y,z:n.height+n.level*t.getFloorSpace()})}},{key:"coordsScreenToMap",value:function(t,n){var e=t.Mt[0],i=void 0!==n.level?n.level:t.wt.Lt,r=void 0!==n.z?n.z:e.getFloor(i).Wt,o=t.W.Ct.object,s=t.an.renderer.domElement.clientWidth,a=t.an.renderer.domElement.clientHeight,u=new St,h=new St;o.isPerspectiveCamera?(o.updateMatrixWorld(),u.setFromMatrixPosition(o.matrixWorld),i=n.x/s*2-1,t=-n.y/a*2+1,h.set(i,t,o.near).unproject(o).sub(u).normalize()):(s=n.x/s*2-1,c=-n.y/a*2+1,u.set(s,c,(o.near+o.far)/(o.near-o.far)).unproject(o),h.set(0,0,-1).transformDirection(o.matrixWorld));var c=(-u.y+r)/h.y;c<0&&(c=o.far);c=(new St).copy(u).add((new St).copy(h).multiplyScalar(c));return{x:c.x+e.x,y:e.y-c.z,z:r}}},{key:"screenshot",value:function(t,n,e,i,s,a){var u=e.x-n.x,h=e.y-n.y,r=(e.x+n.x)/2,o=(e.y+n.y)/2,c=t.an.renderer.domElement.style.width,f=t.an.renderer.domElement.style.height,l=c.split("p")[0],d=f.split("p")[0],v=null,v=(e.x-n.x)/(e.y-n.y)>l/d?l/(e.x-n.x):d/(e.y-n.y),n=r-l/2,r=o-d/2,o=document.getElementsByTagName("canvas")[0],p=document.createElement("canvas"),m=document.createElement("canvas"),g=document.createElement("canvas"),y=window.devicePixelRatio,b=new Image;t.getViewMode(),mi.PERSPECTIVE,t.kt.setViewOffset(l*v,d*v,l*(v-1)/2+n*v,d*(v-1)/2+r*v,l,d),t.an.render(),p.width=u*v*y,p.height=h*v*y,p.style.width=u*v*y+"px",p.style.height=h*v*y+"px",i?(m.width=1240*Math.pow(1.414,s-1),m.height=1754*Math.pow(1.414,s-1),m.style.width=1240*Math.pow(1.414,s-1)+"px",m.style.height=1754*Math.pow(1.414,s-1)+"px"):(m.height=1240*Math.pow(1.414,s-1),m.width=1754*Math.pow(1.414,s-1),m.style.height=1240*Math.pow(1.414,s-1)+"px",m.style.width=1754*Math.pow(1.414,s-1)+"px"),g.height=h*Math.pow(1.414,s-1),g.width=u*Math.pow(1.414,s-1),g.style.height=h*Math.pow(1.414,s-1)+"px",g.style.width=u*Math.pow(1.414,s-1)+"px",b.src=o.toDataURL("image/png"),(t.getViewMode()===mi.PERSPECTIVE?t.un:t.in).clearViewOffset();var _=p.getContext("2d"),w=m.getContext("2d"),x=g.getContext("2d");b.onload=function(){t.getViewMode(),mi.PERSPECTIVE,_.drawImage(b,-(l*y-u*v*y)/2,-(d*y-h*v*y)/2);var o=new Image;o.src=p.toDataURL("image/png"),o.onload=function(){var t=Math.min(1240*Math.pow(1.414,s-1)/(u*v),1754*Math.pow(1.414,s-1)/(h*v)),n=(m.width-u*v*t)/2,e=(m.height-h*v*t)/2;w.drawImage(o,n,e,u*v*t,h*v*t),x.drawImage(o,0,0,u*Math.pow(1.414,s-1),h*Math.pow(1.414,s-1));var i=m.toDataURL("image/png"),r=g.toDataURL("image/png");-1<navigator.userAgent.indexOf("Edge")||-1<navigator.userAgent.indexOf(".NET4.0C")?a(i,null,r,null):m.toBlob(function(n){return g.toBlob(function(t){return a(i,n,r,t)})})}}}},{key:"print",value:function(t,n){var e=this;yg=!0;var i=t.getZoom();t.setZoom({animate:!0,zoom:29});var r=t.W.Ct.target.x,o=t.W.Ct.target.z;t.W.Ct.panAdd({x:-r,z:-o,y:0});var s=t.getTilt(),a=t.getRotation(),u=document.createElement("canvas");u.width=6*t.an.renderer.domElement.width,u.height=6*t.an.renderer.domElement.height,t.setTilt({tilt:90,finish:function(){t.setRotation({rotation:0})}}),t.getViewMode()===mi.MODE_3D?t.setViewMode({mode:mi.MODE_2D,callback:function(){return e.shot_(t,u,u.getContext("2d"),0,t.in.zoom,r,o,i,mi.MODE_3D,s,a,n)}}):this.shot_(t,u,u.getContext("2d"),0,t.in.zoom,r,o,i,mi.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===mi.MODE_2D?"2d":"3d":t.cameraType=t.mode===mi.MODE_2D?"2d":"3d",n==mi.MODE_2D&&t.mode===mi.MODE_3D||hg.print(t))}},{key:"coordsMapToScreen_",value:function(t,n){var e=t.Mt[0],i=t.W.Ct.object,e=new St(n.x-e.x,n.z,-n.y+e.y).project(i),i=t.an.renderer.domElement.clientWidth,t=t.an.renderer.domElement.clientHeight;return e.z<-1||1<e.z?null:{x:Math.round(i/2*e.x+i/2),y:Math.round(-t/2*e.y+t/2)}}},{key:"shot_",value:function(n,e,i,t,r,o,s,a,u,h,c,f){if(yg&&t<36){var l=null,d=null;t<6?(l=0,d=+t):t<12?(l=1,d=t-6):t<18?(l=2,d=t-12):t<24?(l=3,d=t-18):t<30?(l=4,d=t-24):t<36&&(l=5,d=t-30);var v=n.an.renderer.domElement.width,p=n.an.renderer.domElement.height,m=new Image;return m.indexI=l,m.indexJ=d,n.in.setViewOffset(v,p,2.5*-v+v*l,2.5*-p+p*d,v,p),n.in.updateProjectionMatrix(),m.onload=function(t){bg++,i.drawImage(t.path[0],v*t.path[0].indexI,p*t.path[0].indexJ),36===bg&&(e.toBlob(function(t){n.in.zoom=6*r,n.in.updateProjectionMatrix(),n.setViewMode({mode:u,callback:function(){n.setRotation({rotation:c,finish:function(){n.setTilt({tilt:h})}})}}),n.setZoom({zoom:a}),n.in.clearViewOffset(),n.an.En(),n.W.Ct.panAdd({x:o,z:s,y:0}),n.an.sn(),n.W.Ct.update(),n.an.render(),yg=!1,f(t)}),bg=0)},n.an.sn(),n.W.Ct.update(),n.an.render(),m.src=n.an.renderer.domElement.toDataURL(),this.shot_(n,e,i,++t,r,o,s,a,u,h,c,f)}}},{key:"exportToImage",value:function(e,i){i.map=e,mg.readOptions(i),mg.initOptions(i),mg.addLastFrame(i,function(){var t=mg.calcElementBound(e,i.bound),n=t.bound,t=t.elements;mg.expandBoundBySprite(n,t,i),mg.start(i,function(){mg.recoverParam(i)})})}}],(e=null)&&gg(n.prototype,e),i&&gg(n,i),t}();function wg(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var xg=function(){function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t)}var n,e,i;return n=t,i=[{key:"findNearNthPowerOfTwo",value:function(t){t-=1;return t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,(t|=t>>16)<0?1:1+t}},{key:"polygonArea",value:function(t){if(t.length<3)return 0;var n=t.length;if(t[0].x===t[n-1].x&&t[0].y===t[n-1].y&&--n,n<3)return 0;t[0].y,t[n-1].x,t[1].x;for(var e=1;e<n-1;++e)t[e].y,t[e-1].x,t[e+1].x;return.5*(t[n-1].y*(t[n-2].x-t[0].x))}},{key:"closedPoints",value:function(t){var n=t.length;return!(n<3)&&(t[0].x===t[n-1].x&&t[0].y===t[n-1].y||(t[n]={x:t[n-1].x,y:t[n-1].y}),!0)}},{key:"IsRectCross",value:function(t,n,e,i){return Math.min(t.x,n.x)<=Math.max(e.x,i.x)&&Math.min(e.x,i.x)<=Math.max(t.x,n.x)&&Math.min(t.y,n.y)<=Math.max(e.y,i.y)&&Math.min(e.y,i.y)<=Math.max(t.y,n.y)}},{key:"IsLineSegmentCross",value:function(t,n,e,i){var r=t.x*(e.y-n.y)+n.x*(t.y-e.y)+e.x*(n.y-t.y),o=t.x*(i.y-n.y)+n.x*(t.y-i.y)+i.x*(n.y-t.y);return(!(0<=(r^o))||0==r&&0==o)&&(!(0<=((r=e.x*(t.y-i.y)+i.x*(e.y-t.y)+t.x*(i.y-e.y))^(o=e.x*(n.y-i.y)+i.x*(e.y-n.y)+n.x*(i.y-e.y))))||0==r&&0==o)}},{key:"computerFocus",value:function(t,n,e,i){var r=(i.x-e.x)*(t.y-n.y)-(n.x-t.x)*(e.y-i.y),o=(t.y-e.y)*(n.x-t.x)*(i.x-e.x)+e.x*(i.y-e.y)*(n.x-t.x)-t.x*(n.y-t.y)*(i.x-e.x);if(0==r)return null;var s=o/r,r=(t.x-n.x)*(i.y-e.y)-(n.y-t.y)*(e.x-i.x),o=n.y*(t.x-n.x)*(i.y-e.y)+(i.x-n.x)*(i.y-e.y)*(t.y-n.y)-i.y*(e.x-i.x)*(n.y-t.y);return 0==r?null:{x:s,y:o/r}}},{key:"GetLineSegmentCrossPoint",value:function(t,n,e,i){return this.IsRectCross(t,n,e,i)?this.computerFocus(t,n,e,i):null}},{key:"IsPointInPolygon",value:function(t,n){for(var e=!1,i=0,r=t.length-1;i<t.length;r=i++)(t[i].y<=n.y&&n.y<t[r].y||t[r].y<=n.y&&n.y<t[i].y)&&n.x<(t[r].x-t[i].x)*(n.y-t[i].y)/(t[r].y-t[i].y)+t[i].x&&(e=!e);return e}},{key:"PointCmp",value:function(t,n,e){if(0<=t.x&&n.x<0)return!0;if(0===t.x&&0===n.x)return t.y>n.y;var i=(t.x-e.x)*(n.y-e.y)-(n.x-e.x)*(t.y-e.y);if(i<0)return!0;if(0<i)return!1;t=(t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y);return(n.x-e.x)*(n.x-e.y)+(n.y-e.y)*(n.y-e.y)<t}},{key:"ClockwiseSortPoints",value:function(t){for(var n={x:0,y:0},e=0,i=0,r=0;r<t.length;r++)e+=t[r].x,i+=t[r].y;n.x=e/t.length,n.y=i/t.length;for(var o=0;o<t.length-1;o++)for(var s,a=0;a<t.length-o-1;a++)this.PointCmp(t[a],t[a+1],n)&&(s=t[a],t[a]=t[a+1],t[a+1]=s)}},{key:"PolygonClip",value:function(t,n,e){if(t.length<3||n.length<3)return!1;for(var i=0;i<t.length;i++)for(var r=(i+1)%t.length,o=0;o<n.length;o++){var s=(o+1)%n.length,s=this.GetLineSegmentCrossPoint(t[i],t[r],n[o],n[s]);s&&e.push(s)}for(var a=0;a<t.length;a++)this.IsPointInPolygon(n,t[a])&&e.push(t[a]);for(var u=0;u<n.length;u++)this.IsPointInPolygon(t,n[u])&&e.push(n[u]);return!(e.length<=0)&&(this.ClockwiseSortPoints(e),!0)}}],(e=null)&&wg(n.prototype,e),i&&wg(n,i),t}();e=function t(n,e,i,r){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),this.V=n,this.jt=e,this.wt=i,this.st=r,this.rc=!1,this.oc=!1,this.sc=new Map,this.ac=!1,this.Jn=new Sc(this),this.te=null,this.Eh=new pl(n),this.Eh.ua=this.jt.ClassicMaterial,this.uc=new _l,this.Mn=this.wt.Mn.concat(),this.hc=new Map,this.nc=[],this.ot=this.ot.bind(this),this.cc=this.cc.bind(this),n.on("visibleLevelsLoaded",this.cc),n.on("loaded",this.cc),n.on("viewChanged",this.cc),n.on("beforeRender",this.ot)};Object.assign(e.prototype,{cc:function(t){"visibleLevelsLoaded"!==t.type&&"loaded"!==t.type&&"viewChanged"!==t.type||(this.wt.fc=!0,this.pa())},ca:function(){var n;this.wt.lc||this.oc&&0===this.nc.length&&(n=!0,this.Eh.fo.forEach(function(t){t.loadComplete||(n=!1)}),n&&(this.wt.lc=!0,this.V.Dt.Pt({type:"externalFirstLoaded"})))},Xt:function(t,n){t=this.V.getBuilding(t);return t?t.getFloor(n):null},dc:function(t){t=this.V.getBuilding(t);return null!==t?t.Mt:[]},vc:function(t,n,r){var o=this;if(this.jt.tile&&!this.jt.preLoad){for(var s,a=[],e=0;e<this.wt.Mn.length;e++){var i=this.V.getFloor(this.wt.Mn[e]);i&&0===this.pc(i)&&(this.mc(i)?i.Qh():a.push(this.wt.Mn[e]))}0<a.length?(s=this.V.getBuilding(t),t={appName:this.jt.appName,key:this.jt.key,isPreview:this.jt.gc,mapURL:this.jt.mapURL,preLoad:this.jt.preLoad,buildingID:t,level:a[0],visibleLevels:a},this.V.Ea.Jr(t,function(t,n){if("floor"===t&&(o.sc.set(n.gid,!0),-1<a.indexOf(n.gid))){t=s.getFloor(n.gid);t.te=n,o.yc(t);for(var e=!0,i=0;i<a.length;i++)if(!o.sc.get(a[i])){e=!1;break}e&&r&&r()}})):r&&r()}else r&&r()},mc:function(t){var n=!1;return t.te.Mt.forEach(function(t){0<t.Mt.size&&(n=!0)}),n},pc:function(t){var n=this,e=0;return t.Mt.forEach(function(t){n.bc(t)&&e++}),e},mu:function(t,n){t.Dn&&(t.Ti?t.Dn.visible=t.te.maxlevel&&n>=t.te.minlevel&&n<t.te.maxlevel:t.Dn.visible=!1)},Tn:function(){this.V.traverse(function(t){t.traverse(function(t){t.Xh(),t.traverse(function(t){t.traverse(function(t){t.type!==Di.EXTENT&&t.type!==Di.FACILITY&&t.type!==Di.LABEL&&t.type!==Di.MODEL&&t.type!==Di.EXTERNAL_MODEL&&t.type!==Di.TEXT_MARKER&&t.type!==Di.DOM_MARKER&&t.type!==Di.EXTRUDE_MARKER&&t.type!==Di.IMAGE_MARKER&&t.type!==Di.POLYGON_MARKER&&t.type!==Di.DYNAMIC_MODEL_MARKER||t.Ca()})})})})},_c:function(){for(var t=this.dc(this.jt.buildingID).concat(),n=0;n<t.length;n++){var e=t[n].getLayers(Di.LABEL_LAYER)[0];if(!e)return;for(var i=0;i<e.Mt.length;i++){var r=e.Mt[i];this.wt.bu===Nd.FID?r.text=r.te.fid:this.wt.bu===Nd.ENAME?r.text=r.te.ename:r.text=r.te.name}}},_i:function(t){var n=0,n=this.V.kt.isPerspectiveCamera?t/(this.V.an.renderer.domElement.clientHeight/(2*Math.tan(this.V.kt.fov*vi.DEG2RAD/2))):t*Math.abs(this.V.kt.top-this.V.kt.bottom)/this.V.kt.zoom/this.V.an.renderer.domElement.clientHeight;return n=isNaN(n)?1:n},wc:function(t,n){if(this.V.kt.isPerspectiveCamera){var e=new Et;t.updateMatrixWorld(),this.V.un.updateMatrixWorld(),e.multiplyMatrices(this.V.un.matrixWorldInverse,t.matrixWorld);e=(new St).applyMatrix4(e);return this._i(n)*Math.abs(e.z)}return this._i(n)},xc:function(t){var n,e,i=(new St).copy(this.V.W.Ct.target),r=new ci(0,0);return i.y=this.V.getFloor(t).Wt+r.y,10/("PerspectiveCamera"===this.V.kt.type?(e=this.V.kt.near,r=this.V.kt.fov,n=this.V.W.Ct.object.position.distanceTo(i),10*e*Math.tan(r/2*vi.DEG2RAD)*2/this.V.an.renderer.domElement.clientHeight*n/e):(n=this.V.kt.top,e=this.V.kt.bottom,10*Math.abs(n-e)/this.V.an.renderer.domElement.clientHeight/this.V.kt.zoom))},Mc:function(){var e=this;this.Ds(function(t){var n=new Nc;n.bs(t),n.As(e.jt.themeExtension),e.jt.themeExtension=null,e.hc.set(e.jt.buildingID,n);t=e.V.Mt[0];t&&(t.xa=n),e.wt.ou(n),e.V.setBackgroundColor(e.wt.backgroundColor,e.wt.backgroundAlpha),e.rc=!0,e.oc&&e.st(null,null,e.oc,!1,e.ac,!0)}),this.Sc()},Ds:function(t){var n=this;this.jt.Rs?t(this.jt.Rs):Ec.ji(this.jt.themeURL,this.jt.themeName,t,function(t){n.V.Dt.Pt({type:"info",InfoMode:t})})},Sc:function(){var a=this;this.jt.tile?this.Ec():this.V.Ea.Qr(this.jt,function(t,n){if("complete"===t)for(var e=a.Pr(n),i=e.Sa.length,r=0;r<i;r++){var o=n.Mt.get(e.Sa[r]);a.sc.set(o.gid,!0);var s=a.Dr(e,o,e.Sa[r]);a.yc(s),a.Tc(e,o.gid)}else"error"===t&&a.V.Dt.Pt({type:"info",InfoMode:n})})},Lc:function(t,n){for(var e=0,i=0;i<n.length;i++)e+=t.get(n[i]).Mt.size;return e},Ec:function(){var s=this,a=null,t={appName:this.jt.appName,key:this.jt.key,isPreview:this.jt.gc,mapURL:this.jt.mapURL,mapURLAbsolute:this.jt.mapURLAbsolute,preLoad:this.jt.preLoad,merge:this.jt.merge,license:this.jt.license,buildingID:this.jt.buildingID,level:this.wt.Lt,visibleLevels:this.wt.Mn};this.V.Ea.Jr(t,function(t,n){if("building"===t)for(var e=(a=s.Pr(n)).wa.length,i=0;i<e;i++){var r=n.Mt.get(a.wa[i]);s.Dr(a,r,a.wa[i])}var o;"floor"===t&&(s.sc.set(n.gid,!0),o=a.getFloor(n.gid),s.yc(o),s.Tc(a,n.gid)),"error"===t&&s.V.Dt.Pt({type:"info",InfoMode:n})})},Tc:function(t,n){if(!this.oc){for(var e=!0,i=0;i<this.wt.Mn.length;i++)if(!this.sc.get(this.wt.Mn[i])){e=!1;break}this.oc=e,this.oc&&this.st(null,n,this.oc,!0,!1,this.rc)}this.ac||(this.jt.tile&&!this.jt.preLoad?this.sc.size===this.wt.Mn.length&&(this.ac=!0,this.st(null,n,!1,!0,this.ac,this.rc)):this.sc.size===t.wa.length&&(this.ac=!0,this.st(null,n,!1,!0,this.ac,this.rc)))},ot:function(){this.rc&&(this.ic(),this.ec(),this.V.an.Oi())},pa:function(){!0!==this.ac&&!0!==this.oc||(this.V.an.ri=!0)},ic:function(){if(this.wt.fc){this.nc=[];for(var t=this.V.getZoom(),n=this.jt.tile&&!this.jt.preLoad,e=0;e<this.V.Mt[0].Mt.length;e++){var i=this.V.Mt[0].Mt[e],r=null,o=-1<this.wt.Mn.indexOf(i.level);o&&(r=this.Rc(i.level));for(var s=[],a=0;a<i.Mt.length;a++){var u=i.Mt[a];if(o)for(var h=0;h<u.Mt.length;h++){var c=u.Mt[h],f=!0;c.visible&&!(c.te&&c.te.maxlevel&&(t>=c.te.maxlevel||t<c.te.minlevel))&&this.Oc(c,r)||(f=!1),!c.Dn&&f&&this.nc.push([e,c]),c.Dn&&!f&&c.Da&&c.Da()}else this.bc(u)&&n&&s.push(u)}for(var l=0;l<s.length;l++)i.Zh(s[l])}this.wt.fc=!1,this.V.enableUpdateRender()}},bc:function(t){var n=Di.EXTENT_LAYER|Di.FACILITY_LAYER|Di.LABEL_LAYER|Di.MODEL_LAYER|Di.EXTERNAL_MODEL_LAYER;return 0!=(t.Yn&n)},ec:function(){if(0<this.nc.length){for(var t=!1,n=0,e=0;e<this.nc.length&&!(20<++n);e++){var i=this.nc[e][1];i.Yn!==Di.FACILITY&&i.Yn!==Di.LABEL||(t=!0),i.bs(),this.nc.splice(e,1),e--}t&&this.pa(),this.ca(),this.V.enableUpdateRender()}},Oc:function(t,n){if(!t.getBound||!n)return!0;var e=t.getBound();if(!e)return!0;t=!0;return e.maxX<n.min.x&&(t=!1),e.minX>n.max.x&&(t=!1),e.maxY<n.min.y&&(t=!1),t=e.minY>n.max.y?!1:t},Rc:function(t){var n=[],e=[],i=this.jt.container.clientWidth,r=this.jt.container.clientHeight;n.push(_g.coordsScreenToMap(this.V,{x:0,y:0,level:t})),n.push(_g.coordsScreenToMap(this.V,{x:i,y:0,level:t})),n.push(_g.coordsScreenToMap(this.V,{x:i,y:r,level:t})),n.push(_g.coordsScreenToMap(this.V,{x:0,y:r,level:t}));for(var o=this.V.getVisibleLevels(),s=new Nh,a=0;a<o.length;a++){var u=this.V.getFloor(o[a]).getBound();s.yr([u.max,u.min])}e.push({x:s.min.x,y:s.min.y}),e.push({x:s.min.x,y:s.max.y}),e.push({x:s.max.x,y:s.max.y}),e.push({x:s.max.x,y:s.min.y});t=[];xg.PolygonClip(n,e,t);e=new eg;return e.setFromPoints(t),e.max.x<e.min.x||e.max.y<e.min.y?null:e},Dr:function(t,n,e){e=new um({mapOptions:this.jt,states:this.wt,data:n,key:e});return t.dn(e),e.Yh(),e},yc:function(t){t.Qh(),t.Jh()},Pr:function(t){var n=new Bl({buildingID:this.jt.buildingID,height:t.height,scaleLevel:t.scaleLevel,name:t.mname,levels:t.levels,x:t.x,y:t.y,bounds:{maxX:t.maxX,maxY:t.maxY,minX:t.minX,minY:t.minY},floorSpace:this.wt.ya}),e=this.wt.Lt;function i(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++)!function(t,n){for(var e=!0,i=0;i<t.length;i++)if(t[i]===n){e=!1;break}return e}(i,e[o])||i.push(e[o]);return i}return this.jt.tile&&!this.jt.preLoad?n.Sa=i(e,this.wt.Mn):n.Sa=i(e,this.wt.Mn,t.levels),n.Mn=this.wt.Mn,n.xa=this.hc.get(n.ma),this.V.dn(n),this.wt.ki=this.Lc(t.Mt,n.Mn),n},Ra:function(t,n,e){var i=t._r,r=t.getBound(),o=new Am,s=i[0];if(0<s.length){o.moveTo(s[0].x-r.center.x,s[0].y-r.center.y);for(var a=1;a<s.length;a++)o.lineTo(s[a].x-r.center.x,s[a].y-r.center.y)}if(1<i.length)for(var u=1;u<i.length;u++){var h=i[u],c=new Om;if(0<h.length){c.moveTo(h[0].x-r.center.x,h[0].y-r.center.y);for(var f=1;f<h.length;f++)c.lineTo(h[f].x-r.center.x,h[f].y-r.center.y)}o.holes.push(c)}for(var l=null,l=0===n?new Km(o):new Qm(o,{depth:n,bevelEnabled:!1}),d=e.ba.min.x,v=e.ba.min.y,p=e.ba.max.x-d,m=e.ba.max.y-v,g=l.faces,y=g.length,b=0;b<y;b++){var _=l.vertices[g[b].a],w=l.vertices[g[b].b],x=l.vertices[g[b].c];l.faceVertexUvs[0][b][0].x=(_.x+r.center.x-d)/p,l.faceVertexUvs[0][b][0].y=(_.y+r.center.y-v)/m,l.faceVertexUvs[0][b][1].x=(w.x+r.center.x-d)/p,l.faceVertexUvs[0][b][1].y=(w.y+r.center.y-v)/m,l.faceVertexUvs[0][b][2].x=(x.x+r.center.x-d)/p,l.faceVertexUvs[0][b][2].y=(x.y+r.center.y-v)/m}return l.computeBoundingSphere(),{geometry:l,shape:o}},Ac:function(t){t=this.map.getBuilding(t);if(null===t)return-1;t=t.bounds;return Math.sqrt((t.maxX-t.minX)*(t.maxX-t.minX)+(t.maxY-t.minY)*(t.maxY-t.minY))},Cc:function(n){var e=this;Ec.ji(this.jt.themeURL,n,function(t){e.jt.themeName=n,e.V.Mt[0].xa.bs(t),e.wt.ou(e.V.Mt[0].xa),e.V.setBackgroundColor(e.wt.backgroundColor,e.wt.backgroundAlpha),e.kc()})},Pc:function(t){this.V.Mt[0].xa.Os.bs(t),this.wt.ou(this.V.Mt[0].xa),this.V.setBackgroundColor(this.wt.backgroundColor,this.wt.backgroundAlpha),this.kc()},kc:function(){for(var t=this.V.Mt[0].xa,n=this.V.Mt[0].Mt,e=0;e<n.length;e++)for(var i=0;i<n[e].Mt.length;i++)for(var r=n[e].Mt[i],o=0;o<r.Mt.length;o++)r.Mt[o].Aa&&r.Mt[o].Aa(this,t)},pu:function(t,n){var e=this.jt,i=this.V.Mt[0].xa.Rs;if(e.gc){var r=e.themeURL;return"path"===n?("1"===t.isuser?r+=i.userPath+"/":r+=i.sysPath+"/",r):"logoPath"===n?r+=i.logoPath+"/":"model"===n?("1"===t.isuser?r+=i.userModelPath+"/":r+=i.sysModelPath+"/",r):void 0}if("model"!==n)return e.themeURL+e.themeName+"/";n=ih.externalModelUrl;return n=e.mapURL?e.mapURLAbsolute?e.mapURL+"models/":e.mapURL+this.jt.buildingID+"/models/":n},$h:function(t){t=this.V.getMapOptions().hideList[t];return void 0===t||0!==Object.keys(t).length},Va:function(t,n){var e=this.V.getMapOptions().hideList,i=n.typeID,n=n.FID,e=e[t];if(void 0===e)return!0;t=e.typeIDs,e=e.FIDs;return void 0===e&&(e=[]),!(t=void 0===t?[]:t).includes(i)&&!e.includes(n)},ct:function(){for(var t in this.V.off("visibleLevelsLoaded",this.cc),this.V.off("loaded",this.cc),this.V.off("viewChanged",this.cc),this.V.off("beforeRender",this.ot),this.hc.clear(),this.nc=[],this.Eh.ct(),this.Eh=null,this.V=null,this)this[""+t]&&this[""+t].ct&&this[""+t].ct(),this[""+t]=null,delete this[""+t]}});var Mg=e;Ji=function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),this.Mt=new Map,this.Dc=[],this.yt=(new Date).getTime(),this.jc=new Map,this.ai()};Object.assign(Ji.prototype,{dn:function(t){if(Array.isArray(t)){this.Mt.set(t[0].ut,t[0]),t[0].K=this;for(var n=1;n<t.length;n++)t[n].Q=t[n-1].Q+t[n-1].nt,t[n].$=t[n-1].$+t[n-1].nt,this.Mt.set(t[n].ut,t[n]),t[n].K=this}else this.Mt.has(t.ut)||(this.Mt.set(t.ut,t),t.K=this,t.Q=this.yt)},cn:function(t){if(Array.isArray(t))for(var n=0;n<t.length;n++)this.Mt.delete(t[n].ut);else this.Mt.delete(t.ut)},Rh:function(t){this.Dc.push(t)},Oh:function(t){t=this.Dc.indexOf(t);-1<t&&this.Dc.splice(t,1)},Ic:function(t){this.jc.set(t.ut=Ei.generateUUID(),t)},Nc:function(t){this.jc.delete(t.ut)},ot:function(t,n,e){for(var i=[],r=[],o=0;o<t.Z.length;o++)void 0===t.J[o]&&(t.J[o]=0),1<=n?(i.push(t.Y[o]),r.push(t.Y[o]-t.Z[o]-t.J[o])):(i.push((t.Y[o]-t.Z[o])*n+t.Z[o]),r.push((t.Y[o]-t.Z[o])*e),t.J[o]+=(t.Y[o]-t.Z[o])*e);t.ot({destination:i,delta:r}),i.length=0,r.length=0},ai:function(){var i=this;requestAnimationFrame(this.ai.bind(this));var r=(new Date).getTime(),o=r-this.yt;this.jc.forEach(function(t){return t(o)});for(var t=0;t<this.Dc.length;t++)this.Dc[t].update(o/1e3);this.Mt.forEach(function(t){var n,e;t.rt||(t.it?t.tt+=o:(n=(r-t.Q)/t.nt,e=o/t.nt,i.ot(t,n,e),e=r-t.Q-t.$,t.nt<=e&&(t.J=[],t.et?(t.Q=r,t.st&&t.st()):(e=t.rt,t.rt=!0,!e&&t.st&&t.st()))))}),this.yt=r},ct:function(){this.Mt.forEach(function(t){t.ct()}),this.Mt.clear(),this.Dc=[],this.jc.clear()}});var Sg=Ji;br=function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),this.j={}};Object.assign(br.prototype,{Fc:function(t,n){this.Uc(t,n)||(void 0===this.j[t]&&(this.j[t]=[]),this.j[t].push(n))},Uc:function(t,n){return n?void 0!==this.j[t]&&-1!==this.j[t].indexOf(n):void 0!==this.j[t]&&0<this.j[t].length},Bc:function(t,n){void 0===this.j[t]||-1!==(n=this.j[t].indexOf(n))&&this.j[t].splice(n,1)},Pt:function(t){if(void 0!==this.j[t.type])for(var n=this.j[t.type].slice(0),e=0,i=n.length;e<i;e++)n[e].call(this,t)}});var Eg=br;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,i.key,i)}}var Lg=function(){function n(t){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,n),this.container=t.container,this.appName=t.appName,this.key=t.key,this.license=t.license,this.mapID=t.mapID,this.buildingID=t.mapID,this.mapURL=t.mapURL,this.mapURLAbsolute=void 0!==t.mapURLAbsolute&&t.mapURLAbsolute,this.merge=void 0!==t.merge?t.merge:null,this.themeURL=t.themeURL||ih.themeUrl,this.themeID=t.themeID||"2001",this.themeName=this.themeID,this.Rs=t.theme,this.themeExtension=t.themeExtension,this.gc="undefined"!=typeof KjWzhWlSj&&!!KjWzhWlSj.ProtoDef,this.state=t.state||{},this.center=t.center,this.zoomRange=t.zoomRange||[16,23],this.zoomRange[0]=Mt.clamp(this.zoomRange[0],1,29),this.zoomRange[1]=Mt.clamp(this.zoomRange[1],1,29),this.mapZoom=void 0!==t.mapZoom?t.mapZoom:20,this.mapZoom=Math.min(Math.max(this.mapZoom,this.zoomRange[0]),this.zoomRange[1]),this.visibleLevels=void 0!==t.visibleLevels?t.visibleLevels:[1],this.level=void 0!==t.level?t.level:1,-1===this.visibleLevels.indexOf(this.level)&&(1<this.visibleLevels.length?this.visibleLevels.push(this.level):this.visibleLevels=[this.level]),this.floorSpace=void 0!==t.floorSpace?t.floorSpace:50,this.rotation=void 0!==t.rotation?t.rotation:0,this.tiltAngle=void 0!==t.tiltAngle?t.tiltAngle:30,this.maxTiltAngle=void 0!==t.maxTiltAngle?t.maxTiltAngle:90,this.minTiltAngle=void 0!==t.minTiltAngle?t.minTiltAngle:30,this.tiltAngle=Mt.clamp(this.tiltAngle,this.minTiltAngle,this.maxTiltAngle),this.viewMode=void 0!==t.viewMode?t.viewMode:mi.MODE_3D,this.backgroundColor=t.backgroundColor,this.backgroundAlpha=t.backgroundAlpha,this.ys=t.highlightColor,this.Xn=void 0!==t.highlightPicker?t.highlightPicker:["click"],this.nonFocusAlpha=void 0!==t.nonFocusAlpha?t.nonFocusAlpha:.1,this.nonFocusAlphaMode=void 0!==t.nonFocusAlphaMode&&t.nonFocusAlphaMode,this.logarithmicDepthBuffer=t.logarithmicDepthBuffer||!1,this.tile=!1!==t.tile||t.tile,this.preLoad=!1!==t.preLoad||t.preLoad,this.loadLayerWaitingTime=t.loadLayerWaitingTime||.002,this.floorMode=t.floorMode||4,this.renderOrder=t.renderOrder||[Di.EXTENT,Di.EXTERNAL_MODEL,Di.MODEL,Di.DYNAMIC_MODEL_MARKER,Di.EXTRUDE_MARKER,Di.POLYGON_MARKER,Di.HEAT_MAP_MARKER,Di.LINE_MARKER,Di.FACILITY,Di.LABEL,Di.IMAGE_MARKER,Di.TEXT_MARKER,Di.LOCATION_MARKER],this.collisionOrder=t.collisionOrder?Pi.uniqWithArrayTwo(t.collisionOrder):[[Di.TEXT_MARKER,Di.IMAGE_MARKER]],this.fontFamily=t.fontFamily||'"Microsoft Yahei","微软雅黑",Tahoma,Arial',this.hdr=t.hdr,this.shadingMode=void 0!==t.shadingMode?t.shadingMode:Qi.REAL,this.materialMode=void 0!==this.hdr?Qi.CLASSIC:this.shadingMode,this.lock=void 0!==t.lock&&t.lock,this.labelField=void 0!==t.labelField?t.labelField:Nd.NAME,this.enabledPanRange=void 0!==t.enabledPanRange&&t.enabledPanRange,this.panRangeValue=void 0!==t.panRangeValue?t.panRangeValue:null,this.lightConfig={FMExtentLayer:[{name:"DirectionalLight",color:11579568,intensity:.95,position:{x:58,y:65,z:40},id:0},{name:"AmbientLight",color:11579568,intensity:.85,id:1},{name:"DirectionalLight",color:6447714,intensity:.65,position:{x:-100,y:0,z:45},id:2}],FMDynamicModelLayer:[{name:"DirectionalLight",color:11579568,intensity:.95,position:{x:58,y:65,z:45},id:0},{name:"AmbientLight",color:11579568,intensity:.85,id:1},{name:"DirectionalLight",color:6447714,position:{x:-100,y:0,z:45},intensity:.45,id:2}],FMModelLayer:[{name:"DirectionalLight",color:11645361,intensity:.95,position:{x:58,y:65,z:40},id:0},{name:"AmbientLight",color:11645361,intensity:.85,id:1},{name:"DirectionalLight",color:6513507,position:{x:-100,y:0,z:45},intensity:.65,id:2}],FMExternalModelLayer:[{name:"DirectionalLight",color:11579568,intensity:.95,position:{x:58,y:65,z:45},id:0},{name:"AmbientLight",color:11579568,intensity:.85,id:1},{name:"DirectionalLight",color:6447714,position:{x:-100,y:0,z:45},intensity:.45,id:2}]},void 0!==t.light&&(this.lightConfig=t.light.getConfig()),this.hideList=void 0!==t.hideList?t.hideList:{},this.ClassicMaterial=void 0===t.ClassicMaterial||t.ClassicMaterial}var t,e,i;return t=n,(e=[{key:"isPreview",get:function(){return this.gc}}])&&Tg(t.prototype,e),i&&Tg(t,i),n}();function Rg(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}pr=function(){function n(t){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,n),this.jt=t,this.pn=(void 0!==this.jt.state.zoomRange?this.jt.state:this.jt).zoomRange,this._a=void 0!==this.jt.state.zoom?this.jt.state.zoom:this.jt.mapZoom,this.Lt=(void 0!==this.jt.state.level?this.jt.state:this.jt).level,this.Mn=(void 0!==this.jt.state.visibleLevels?this.jt.state:this.jt).visibleLevels,this.ki=0,this.$t=(void 0!==this.jt.state.rotation?this.jt.state:this.jt).rotation,this.Kt=(void 0!==this.jt.state.tiltAngle?this.jt.state:this.jt).tiltAngle,this.ya=(void 0!==this.jt.state.floorSpace?this.jt.state:this.jt).floorSpace,this.Ot=(void 0!==this.jt.state.viewMode?this.jt.state:this.jt).viewMode,this.bu=this.jt.labelField,this.zt=new St,this.Gc=this._a,this.kn=0,this.Hn=!1,this.Hc=!0,this.Vc=!1,this.ys=void 0!==this.jt.ys?this.jt.ys:null,this.zc=null,this.Wc=void 0!==this.jt.backgroundColor?this.jt.backgroundColor:null,this.Xc=null,this.Zc=void 0!==this.jt.backgroundAlpha?this.jt.backgroundAlpha:null,this.Yc=null,this.lc=!1,this.Pi=!1,this.fc=!1,this.Ai=this.jt.collisionOrder}var t,e,i;return t=n,(e=[{key:"zoom",get:function(){return this._a},set:function(t){this._a=Math.min(Math.max(t,this.pn[0]),this.pn[1])}},{key:"zoomRange",get:function(){return this.pn},set:function(t){this.pn=t}},{key:"highlightColor",get:function(){return null!==this.ys?this.ys:this.zc},set:function(t){this.ys=t}},{key:"backgroundColor",get:function(){return null!==this.Wc?this.Wc:this.Xc}},{key:"backgroundAlpha",get:function(){return null!==this.Zc?this.Zc:this.Yc}}])&&Rg(t.prototype,e),i&&Rg(t,i),n}();Object.assign(pr.prototype,{ou:function(t){this.zc=t.Fs();t=t.Cs();this.Xc=t.clearColor,this.Yc=t.clearAlpha},qc:function(t,n){switch(t){case"click":this.Hc=n;break;case"move":this.Vc=n;break;case"hover":this.Hn=n}},Kc:function(t){this.jt.state.center?(this.zt.x=this.jt.state.center.x-t.x,this.zt.z=-this.jt.state.center.y+t.y):this.jt.center&&(this.zt.x=this.jt.center.x-t.x,this.zt.z=-this.jt.center.y+t.y)}});var Og=pr;function Ag(t,n){var e;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(e=function(t,n){if(t){if("string"==typeof t)return Cg(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(e="Object"===e&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Cg(t,n):void 0}}(t))||n&&t&&"number"==typeof t.length){e&&(t=e);var i=0,n=function(){};return{s:n,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o=!0,s=!1;return{s:function(){e=t[Symbol.iterator]()},n:function(){var t=e.next();return o=t.done,t},e:function(t){s=!0,r=t},f:function(){try{o||null==e.return||e.return()}finally{if(s)throw r}}}}function Cg(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 kg(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}di=function(){function n(t){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,n),this.K=t,this.Jc=null,this.Qc=this.Qc.bind(this),this.$c=this.$c.bind(this),this.tf=this.tf.bind(this),this.kn=this.kn.bind(this),this.nf=this.nf.bind(this),this.ef=this.ef.bind(this),this.if=this.if.bind(this),this.rf={},this.ci=new Sr,this.Mt=[]}var t,e,i;return t=n,(e=[{key:"add",value:function(t){t.K=this,(t.kh||t.bs())&&this.R(t);var n=this.rf[""+t.Lt];n||(this.rf[""+t.Lt]=n=[]),n.push(t),this.needUpdateBound=!0}},{key:"remove",value:function(t){var n=this.Mt.indexOf(t);-1<n&&this.Mt.splice(n,1);var e=this.rf[""+t.Lt];-1<(n=e.indexOf(t))&&e.splice(n,1),this.needUpdateBound=!0}},{key:"clear",value:function(){var t,n,e=Ag(this.Mt);try{for(e.s();!(t=e.n()).done;)t.value.dispose()}catch(t){e.e(t)}finally{e.f()}for(n in this.Mt.length=0,this.rf)delete this.rf[n]}},{key:"dispose",value:function(){if(null!==this.Jc){this.K.off("resize",this.$c),this.K.off("update",this.Qc),this.K.off("levelChanged",this.tf),this.K.off("visibleLevelsLoaded",this.nf),this.K.off("autoRotate",this.kn),this.K.off("beforeRender",this.ef),this.K.off("floorSpaceChanged",this.if);for(var t=0;t<this.Mt.length;t++)this.Mt[t].dispose();this.Mt.length=0,this.ci=void 0,this.K.getContainer().removeChild(this.Jc.domElement)}}}])&&kg(t.prototype,e),i&&kg(t,i),n}();Object.assign(di.prototype,{bs:function(){this.Jc=new sp,this.Jc.setSize(this.K.getContainer().clientWidth,this.K.getContainer().clientHeight),this.Jc.domElement.style.top="0px",this.Jc.domElement.style.left="0px",this.Jc.domElement.style.position="absolute",this.Jc.domElement.style.pointerEvents="none",this.K.getContainer().appendChild(this.Jc.domElement),this.K.on("resize",this.$c),this.K.on("update",this.Qc),this.K.on("levelChanged",this.tf),this.K.on("visibleLevelsLoaded",this.nf),this.K.on("autoRotate",this.kn),this.K.on("beforeRender",this.ef),this.K.on("floorSpaceChanged",this.if)},Qc:function(){this.Jc.render(this.ci,this.K.camera)},ef:function(){this.Ei()},$c:function(){this.Jc.setSize(this.K.getContainer().clientWidth,this.K.getContainer().clientHeight)},tf:function(t){for(var n,e=0;e<this.Mt.length;e++)this.Mt[e].Lt!==t.level?this.sf(this.Mt[e].Lt)?(n=this.K.getFloor(this.Mt[e].Lt),this.Mt[e].visible?(this.Mt[e].Dn.element.childNodes[0].style.display="block",this.Mt[e].Dn.element.childNodes[0].style.opacity=n.Pa):this.Mt[e].Dn.element.childNodes[0].style.display="none"):this.Mt[e].Dn.element.childNodes[0].style.display="none":this.Mt[e].visible&&(this.Mt[e].Dn.element.childNodes[0].style.display="block",this.Mt[e].Dn.element.childNodes[0].style.opacity=this.Mt[e].opacity)},if:function(){for(var t=0;t<this.Mt.length;t++)this.Mt[t].af()},kn:function(t){this.ci.rotation.y=t.autoRotate},nf:function(){for(var t,n=0;n<this.Mt.length;n++)this.Mt[n].visible&&this.sf(this.Mt[n].Lt)?(this.Mt[n].Dn.element.childNodes[0].style.display="block",this.K.getLevel()===this.Mt[n].Lt?this.Mt[n].Dn.element.childNodes[0].style.opacity=this.Mt[n].opacity:(t=this.K.getFloor(this.Mt[n].Lt),this.Mt[n].Dn.element.childNodes[0].style.opacity=t.Pa)):this.Mt[n].Dn.element.childNodes[0].style.display="none"},sf:function(t){for(var n=this.K.getVisibleLevels(),e=!1,i=0;i<n.length;i++)if(n[i]===t){e=!0;break}return e},Ei:function(){for(var t=this.K.getVisibleLevels(),n=0;n<t.length;n++){var e=this.rf[""+t[n]];e&&function(t){for(var n=[],e=0;e<t.length;e++)if(t[e].Ti&&t[e].Ri){for(var i=!0,r=0;r<n.length;r++){var o=n[r].uf(),s=t[e].uf();if(!(i=!du.Me(s.leftTop,s.rightDown,o.leftTop,o.rightDown)))break}i?(t[e].Dn.element.childNodes[0].style.display="block",n.push(t[e])):t[e].Dn.element.childNodes[0].style.display="none"}}(e)}},R:function(t){this.Mt.push(t),t.Dn&&this.ci.add(t.Dn)}});var Pg=di;function Dg(t){return(Dg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function jg(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Ig(t,n){return(Ig=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Ng(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Ug(e);return t=i?(t=Ug(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Dg(t)&&"function"!=typeof t?Fg(n):t}}function Fg(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ug(t){return(Ug=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}pi=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Ig(t,n)}(r,xl);var t,n,e,i=Ng(r);function r(t){var n;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(n=i.call(this)).jt=new Lg(t),n.wt=new Og(n.jt),n.Yt=[],n.hf=new St,n.pi=n.jt.floorMode,n.Qe=[Di.IMAGE_MARKER,Di.TEXT_MARKER],n.Dt=new Eg,n.ln=new Sg,n.Ea=null,n.Zt=null,n.un=null,n.in=null,n.kt=n.cf(n.jt.container.clientWidth,n.jt.container.clientHeight),n.an=new Gu(Fg(n),n.jt,n.wt),n.ui=new Xv,n.ui.K=Fg(n),n.W=new Ui(Fg(n),n.jt.container,n.wt),n.W.enableDragRange=n.jt.enabledPanRange,n.jt.panRangeValue&&(n.jt.enabledPanRange=!0,n.W.enableDragRange=!0),n.Fn=new _r(Fg(n),n.jt,n.wt),n.ff=n.ff.bind(Fg(n)),n.lf=n.lf.bind(Fg(n)),n.df=new Pg(Fg(n)),n.vf(n.jt.mapID),Uc.onLoad=function(){n.enableUpdateRender()},n}return t=r,(n=[{key:"bound",get:function(){var n=this;return!0===this.needUpdateBound&&0<this.Mt.length&&(this.wr.reset(),this.Mt.forEach(function(t){n.wr.expand(t.bound)}),this.wr.expand(this.ui.bound),this.needUpdateBound=!1),this.wr.clone()}},{key:"camera",get:function(){return this.kt},set:function(t){this.kt=t}},{key:"removeAnimator",value:function(t){this.ln.cn(t)}},{key:"copyCamera",value:function(){var t=null;return(t=this.kt===this.un?new Y(vi.FOV,1,vi.CAMERA_NEAR,vi.CAMERA_FAR):new q(1,1,1,1,vi.CAMERA_NEAR,vi.CAMERA_FAR)).copy(this.kt),t}},{key:"enableUpdateRender",value:function(){this.wt.Pi=!0}},{key:"enableUpdateNode",value:function(){this.wt.fc=!0}},{key:"getFloorInfos",value:function(){var t={alias:"alias",floorId:"floorID",gid:"level",gname:"name"},n=Object.keys(t),e=this.getBuilding();if(!e)return[];for(var i=e.getFloorsInfo(),r=[],o=0;o<i.length;o++){r[o]={};for(var s=i[o],a=0;a<n.length;a++){var u=n[a],h=t[u];s[u]?r[o][h]=s[u]:r[o][h]=null}}return r}},{key:"setHighlightColor",value:function(t){this.wt.highlightColor=t}},{key:"setControlTarget",value:function(t){this.W.tn(t)}},{key:"dispose",value:function(){this.df.dispose(),this.jt.container.removeChild(this.jt.container.children[0]);for(var t=0;t<this.Mt.length;t++)this.Mt[t]&&this.Mt[t].ct&&this.Mt[t].ct();this.Mt.length=0,delete this.Mt;for(var n,e,i=[this.Fn,this.W,this.an,this.Zt],r=0;r<i.length;r++)i[r].ct();for(n in this)-1<i.indexOf(this[""+n])&&delete this[""+n];for(e in i=null,this)this[""+e]&&this[""+e].ct&&this[""+e].ct(),this[""+e]=null,delete this[""+e]}},{key:"resize",value:function(t,n){this.an.fi(t,n)}},{key:"getMarkerGroup",value:function(){return this.ui}},{key:"getVisibleLevels",value:function(){return this.wt.Mn}},{key:"setTheme",value:function(t){this.Zt.Cc(t)}},{key:"setThemeExtension",value:function(t){this.Zt.Pc(t)}},{key:"clearThemeExtension",value:function(){this.Zt.Pc()}},{key:"getRenderOrder",value:function(){return this.an.Qe}},{key:"setRenderOrder",value:function(t){this.an.yi(t)}},{key:"getCollisionOrder",value:function(){return this.wt.Ai}},{key:"setCollisionOrder",value:function(t){this.wt.Ai=Pi.uniqWithArrayTwo(t),this.Zt.pa()}},{key:"adjustRenderOrder",value:function(t){this.an.gi(t)}},{key:"setVisibleLevels",value:function(t,n){var e=this;t.sort();var i=Array.from(this.Zt.sc).map(function(t){return t[0]}),r=t.every(function(t){return i.includes(t)});this.wt.Mn=t,this.Zt.vc(this.Mt[0].ma,t,function(){e.an.mi(),e.an.En(),e.an.sn(),!1===r&&(e.needUpdateBound=!0),e.Dt.Pt({type:"visibleLevelsLoaded"}),n&&n()})}},{key:"getRenderManager",value:function(){return this.an}},{key:"setRenderManager",value:function(t){for(var n in this.an.render=t.render,this.an.getLayerType=t.getLayerType,t)this.an[n]=t[n]}},{key:"getFloorMode",value:function(){return this.pi}},{key:"setFloorMode",value:function(t){this.an.vi(t),this.Dt.Pt({type:"visibleLevelsChanged",levels:this.wt.Mn})}},{key:"getBuilding",value:function(n){var e=null;return n?this.traverse(function(t){t.ma===n&&(e=t)}):e=this.Mt[0],e}},{key:"getX",value:function(){return this.Mt[0].x}},{key:"getY",value:function(){return this.Mt[0].y}},{key:"getCenter",value:function(){return this.W._n()}},{key:"setCenter",value:function(t){this.W.wn(t)}},{key:"zoomIn",value:function(){this.W.vn(1.02)}},{key:"zoomOut",value:function(){this.W.vn(.98)}},{key:"getZoomRange",value:function(){return this.wt.pn}},{key:"setZoomRange",value:function(t){this.W.bn(t)}},{key:"getZoom",value:function(){return this.W.mn()}},{key:"setZoom",value:function(t){this.W.yn(t)}},{key:"getRotation",value:function(){return this.W.Rn()}},{key:"setRotation",value:function(t){this.W.On(t)}},{key:"autoRotate",value:function(t){return this.W.An(t)}},{key:"getAutoRotate",value:function(){return this.wt.kn}},{key:"getTilt",value:function(){return Ei.round(90-this.W.Ct.getPolarAngle()*vi.RAD2DEG)}},{key:"setTilt",value:function(t){t.tilt=Mt.clamp(t.tilt,this.jt.minTiltAngle,this.jt.maxTiltAngle),this.wt.Kt=t.tilt,this.W.en(t)}},{key:"getFloor",value:function(t){return 0===this.Mt?null:this.Mt[0].getFloor(t)}},{key:"getLevel",value:function(){return this.wt.Lt}},{key:"getLevels",value:function(){return this.Mt[0].wa}},{key:"setLevel",value:function(t){this.W.xn(t)}},{key:"getFloorSpace",value:function(){return this.Mt[0].getFloorSpace()}},{key:"setFloorSpace",value:function(t){this.Mt[0].setFloorSpace(t),this.Dt.Pt({type:"floorSpaceChanged"});for(var n=this.ui.Mt,e=0;e<n.length;e++)n[e].af()}},{key:"getViewMode",value:function(){return this.kt.isPerspectiveCamera?mi.MODE_3D:mi.MODE_2D}},{key:"setViewMode",value:function(t){this.W.nn(t)}},{key:"getInteracations",value:function(){return this.W}},{key:"getBound",value:function(){return this.Mt[0].bound.clone()}},{key:"getState",value:function(){return{center:this.getCenter(),zoom:this.getZoom(),rotation:this.getRotation(),tiltAngle:this.getTilt(),viewMode:this.getViewMode(),level:this.getLevel(),floorSpace:this.getFloorSpace(),visibleLevels:this.wt.Mn}}},{key:"setState",value:function(t,n){var e=this,i=!1!==(n=n||{}).animate;this.setFloorSpace(t.floorSpace),this.setCenter({animate:i,x:t.center.x,y:t.center.y,finish:function(){e.setRotation({animate:i,rotation:t.rotation,finish:function(){e.setTilt({animate:i,tilt:t.tiltAngle,finish:function(){e.setZoom({animate:i,zoom:t.zoom,finish:function(){e.setViewMode({animate:i,mode:t.viewMode,finish:function(){e.setVisibleLevels(t.visibleLevels,function(){e.setLevel({animate:i,level:t.level,finish:function(){n.finish&&n.finish()}})})}})}})}})}})}})}},{key:"getNodes",value:function(t){for(var n=[],e=this.Mt[0],i=[Di.LABEL_LAYER,Di.FACILITY_LAYER,Di.MODEL_LAYER,Di.EXTENT_LAYER,Di.EXTERNAL_MODEL_LAYER],r=0;r<t.length;r++){var o=t[r].level,s=t[r].eid,a=t[r].type;t:for(var u=0;u<e.Mt.length;u++)if(e.Mt[u].Lt===o)for(var h=(h=e.Mt[u].getLayers()).filter(function(t){return i.includes(t.type)}),c=0;c<h.length;c++)for(var f=0;f<h[c].Mt.length;f++)if(h[c].Mt[f].te.ie===s&&h[c].Mt[f].Yn===a){n.push(h[c].Mt[f]);break t}}return n}},{key:"getDataManager",value:function(){return this.Ea}},{key:"getMapOptions",value:function(){return this.jt}},{key:"getContainer",value:function(){return this.jt.container}},{key:"setFitView",value:function(t,n){var e=this,i=!1!==(n=n||{}).animate,r=this.getZoomRange(),o=this.copyCamera(),s=this.W.copyControls(o),a=this.W.Ct,u=this.kt;this.W.Ct=s,this.kt=o,this.setZoomRange([1,29]),this.setCenter({animate:!1,x:t.center.x,y:t.center.y,finish:function(){e.pf(t,5,0,function(t){e.W.Ct=a,e.kt=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.an.renderer.setClearColor("string"===t?parseInt(t.slice(1),16):t,n),this.enableUpdateRender()}},{key:"setLabelField",value:function(t){this.wt.bu=t,this.Zt._c(),this.Zt.pa()}},{key:"on",value:function(t,n){this.Dt&&(this.Dt.Fc(t,n),this.wt.qc(t,!0))}},{key:"off",value:function(t,n){this.Dt&&(this.Dt.Bc(t,n),this.Dt.Uc(t)||this.wt&&this.wt.qc(t,!1))}},{key:"pickFilterFunction",value:function(){return!0}},{key:"collisionCheck",value:function(){this.Zt.pa()}}])&&jg(t.prototype,n),e&&jg(t,e),r}();Object.assign(pi.prototype,{cf:function(t,n){return this.un=new Y(vi.FOV,t/n,vi.CAMERA_NEAR,vi.CAMERA_FAR),this.in=new q(-t/2,t/2,n/2,-n/2,vi.CAMERA_NEAR,vi.CAMERA_FAR),this.wt.Ot===mi.MODE_3D?this.un:this.in},dn:function(t){(t.K=this).Mt.push(t)},Rc:function(t){var n=[];n.push({x:t.min.x,y:t.min.y}),n.push({x:t.min.x,y:t.max.y}),n.push({x:t.max.x,y:t.max.y}),n.push({x:t.max.x,y:t.min.y});for(var e=new Nh,i=0;i<n.length;i++){var r=fengmap.FMUtil.coordsMapToScreen(this,{x:n[i].x,y:n[i].y,level:this.getLevel(),height:0});if(null===r)return null;e.yr([r])}return e},mf:function(t){var n=this.an.renderer.domElement.clientHeight,e=this.an.renderer.domElement.clientWidth,i=this.getZoom(),i=this.W.Ht(i),t=this.Rc(t);if(!t)return null;t=t.size;return i*(e/n>t.x/t.y?t.y/n:t.x/e)},gf:function(t){t=this.Rc(t);return t?fengmap.FMUtil.coordsScreenToMap(this,{x:(t.max.x+t.min.x)/2,y:(t.max.y+t.min.y)/2,level:this.getLevel()}):null},pf:function(n,e,i,r){var o=this,s=this.getZoom(),t=this.mf(n);t?s=this.W.gn(t):s-=1,this.setZoom({animate:!1,zoom:s,finish:function(){var t=o.gf(n);t?o.setCenter({animate:!1,x:t.x,y:t.y,finish:function(){++i===e?r({zoom:s,center:t}):o.pf(n,e,i,r)}}):o.pf(n,e,i,r)}})},ff:function(){var t=this.getZoom();Math.abs(t-this.wt.Gc)>vi.EPS&&(this.Dt.Pt({type:"zoom",zoom:t}),this.kt.isOrthographicCamera&&this.an.sn(),this.wt.Gc=t,this.an.Ln(t))},lf:function(){var t;!this.wt.Vc||(t=this.W.Ct.target).distanceToSquared(this.hf)>vi.EPS&&(this.Dt.Pt({type:"move",center:this.getCenter()}),this.hf=t.clone(),t=null)},vf:function(t){var n,e,i,s=this,a=!0;this.Yt.push(t),e=(n=this).jt,i=this.wt,t=function(t,n,e,i,r,o){a&&(s.wt.Kc(s.Mt[0]),a=s.W.Gt()),s.an.En(),s.kt.updateMatrixWorld(),e&&o&&(s.an.Ln(s.getZoom()),s.W.dn([s.ff,s.lf]),s.Dt.Pt({type:"visibleLevelsLoaded"})),r&&o&&(s.needUpdateBound=!0,s.Dt.Pt({type:"loaded"}))},n.Ea=new Kh,n.Zt=new Mg(n,e,i,t),n.Zt.Mc()}});var Bg=pi;function Gg(t){return(Gg="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 Hg(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Vg(t,n){return(Vg=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function zg(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Wg(e);return t=i?(t=Wg(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Gg(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function Wg(t){return(Wg=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}Li=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Vg(t,n)}(r,xl);var t,n,e,i=zg(r);function r(t){var n;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(n=i.call(this)).Wt=void 0!==(t=t||{}).height?t.height:1,n.I=t.x,n.N=t.y,n.Dn=null,n.kh=!1,n}return t=r,(n=[{key:"x",get:function(){return this.I}},{key:"y",get:function(){return this.N}},{key:"height",get:function(){return this.Wt},set:function(t){this.Wt=t,this.af()}},{key:"level",get:function(){var t=this.la(um);return t?t.level:null}},{key:"visible",get:function(){return this.Ti},set:function(t){this.Ti=t,this.Dn&&(this.Dn.visible=this.Ti,(t=this.la(Bg))&&t.enableUpdateRender())}},{key:"opacity",get:function(){return this.Pa},set:function(t){this.Pa=t,this.Dn&&(this.Dn.material.opacity=this.Pa)}},{key:"addTo",value:function(t){t.getOrCreateLayer(this.Yn).add(this)}},{key:"remove",value:function(){var t=this.la(Bg);this.K&&this.K.remove(this),t&&t.enableUpdateRender()}},{key:"dispose",value:function(){this.remove(),this.Dn&&(this.Dn.traverse(function(t){t instanceof Uo&&(t.geometry.dispose(),t.material=void 0,t.geometry=void 0)}),this.Dn.mapNode=void 0,this.Dn=void 0),this.kh=!1}}])&&Hg(t.prototype,n),e&&Hg(t,e),r}();Object.assign(Li.prototype,{yf:function(){var t;void 0!==this.I&&void 0!==this.N||(t=this.la(um),this.I=t.center.x,this.N=t.center.y)},bs:function(){return!1},af:function(){}});var Xg=Li;function Zg(t){return(Zg="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 Yg(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function qg(t,n,e){return(qg="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,n,e){t=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=$g(t)););return t}(t,n);if(t){n=Object.getOwnPropertyDescriptor(t,n);return n.get?n.get.call(e):n.value}})(t,n,e||t)}function Kg(t,n){return(Kg=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Jg(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=$g(e);return t=i?(t=$g(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Zg(t)&&"function"!=typeof t?Qg(n):t}}function Qg(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function $g(t){return($g=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}Oi=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Kg(t,n)}(r,Xg);var t,n,e,i=Jg(r);function r(t){var n;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(n=i.call(this,t)).Yn=Di.IMAGE_MARKER,n.Ta=t.url,n.wi=void 0!==t.size?t.size:32,n.bf=void 0!==t.depth&&t.depth,n.Pa=void 0!==t.opacity?t.opacity:1,n.Ri=void 0===t.collision||t.collision,n.zt=Pi.getCenterByAnchor(t.anchor),n.St=null,n._f=null,n.wf=new Map,n.Mi=n.Mi.bind(Qg(n)),n}return t=r,(n=[{key:"bound",get:function(){return!0===this.needUpdateBound&&(this.wr.reset(),void 0!==this.I&&void 0!==this.N&&(this.wr.expandByCoords([{x:this.I,y:this.N}]),this.needUpdateBound=!1)),this.wr.clone()}},{key:"collision",get:function(){return this.Ri},set:function(t){this.Ri!==t&&(this.Ri=t,(t=this.la(Bg))&&t.Zt.pa())}},{key:"url",get:function(){return this.Ta},set:function(t){this.Ta=t,this.Ca()}},{key:"opacity",get:function(){return this.Pa},set:function(t){this.Pa=t,this.Ca()}},{key:"moveTo",value:function(t){var n=this,e=void 0!==t.animate&&t.animate,i=t.duration||.5;if(e){e=this.la(Bg);if(e)return this.St||(this.St=new Ri),this.St.ft([this.I,this.N]),this.St.lt([t.x,t.y]),this.St.dt(i).pt(function(t){n.I=t.destination[0],n.N=t.destination[1],n.af()}).mt(function(){n.I=t.x,n.N=t.y,n.af(),t.finish&&t.finish()}),e.ln.dn(this.St.ht()),this.St}else this.I=t.x,this.N=t.y,this.af()}},{key:"stop",value:function(){var t=this.la(Bg);t&&(this.St&&(t.ln.cn(this.St),this.St=null),this._f&&(t.ln.cn(this._f),this._f=null),this.xf&&(t.ln.cn(this.xf),this.xf=null))}},{key:"jump",value:function(t){var n=this;if(this.Dn){var e=this.la(Bg);if(e){var i=void 0!==t.duration?t.duration:1,r=void 0!==t.times?t.times:1,o=void 0!==t.delay?t.delay:0,s=0;return this._f?(this._f.ft([this.Wt]),this._f.lt([this.Wt+t.height])):(this._f=new Ri({src:[this.Wt],dest:[this.Wt+t.height]}),e.ln.dn(this._f)),this._f.dt(i).vt(0).pt(function(t){n.Wt=t.destination[0],n.Dn.position.y=n.Wt,e.enableUpdateRender()}).mt(function(){var t;(s+=.5)<r&&(t=s%1==0?0:o,n._f._t().vt(t),n._f.ht())}),this._f.ht(),this._f}}}},{key:"stopJump",value:function(){var t;!this.Dn||(t=this.la(Bg))&&(this._f&&(t.ln.cn(this._f),this._f=null),this.Dn.position.y=this.Wt,t.enableUpdateRender())}},{key:"addTo",value:function(t){qg($g(r.prototype),"addTo",this).call(this,t);t=this.la(Bg);t&&(t.on("viewModeChanged",this.Mi),t.on("zoom",this.Mi),t.on("resize",this.Mi),t.Zt.pa())}},{key:"remove",value:function(){this.stop();var t=this.la(Bg);t&&(t.off("viewModeChanged",this.Mi),t.off("zoom",this.Mi),t.off("resize",this.Mi),qg($g(r.prototype),"remove",this).call(this),t.Zt.pa(),t.enableUpdateRender())}},{key:"getRenderNode",value:function(){return this.Dn}}])&&Yg(t.prototype,n),e&&Yg(t,e),r}();Object.assign(Oi.prototype,{bs:function(){if(!this.Ta)return!1;var t=this.la(Bg);if(!t)return!1;t=this.Oa(t);return this.Dn=new jd(t),this.Dn.center.set(this.zt.x,this.zt.y),this.Dn.visible=this.Ti,this.Mi(),this.af(),(this.Dn.mapNode=this).kh=!0},af:function(){var t=this.la(Bg);if(!t)return!1;this.Dn.position.set(this.I-t.getX(),this.Wt,-this.N+t.getY()),this.needUpdateBound=!0,t.enableUpdateRender()},Mi:function(){var t,n,e=this.la(Bg);e&&(t=e.Zt._i(this.wi),n=1,this.Dn.material.userData.scaleRatio&&(n=this.Dn.material.userData.scaleRatio),this.Dn.scale.set(t,t/n,t),e.enableUpdateRender())},Ca:function(){var t=this.la(Bg);t&&(this.Dn.material=this.Oa(t),this.Mi())},Oa:function(t){var n=this,e=this.la(um);return t.Zt.Jn.qo({url:this.Ta,needDepth:this.bf,opacity:this.Pa*e.Pa},function(){n.Dn&&n.Mi(),t.enableUpdateRender()})}});Fi=Oi;function ty(t){return(ty="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 ny(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function ey(t,n,e){return(ey="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,n,e){t=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=sy(t)););return t}(t,n);if(t){n=Object.getOwnPropertyDescriptor(t,n);return n.get?n.get.call(e):n.value}})(t,n,e||t)}function iy(t,n){return(iy=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function ry(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=sy(e);return t=i?(t=sy(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==ty(t)&&"function"!=typeof t?oy(n):t}}function oy(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function sy(t){return(sy=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}e=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&iy(t,n)}(r,Xg);var t,n,e,i=ry(r);function r(t){var n;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(n=i.call(this,t)).Yn=void 0!==t.type?t.type:Di.TEXT_MARKER,n._u=void 0!==t.text?t.text:"",n.Mf=void 0!==t.fontsize?t.fontsize:20,n.Sf=t.fontFamily,n.Ef=void 0!==t.fillColor?t.fillColor:"0,0,0",n.Tf=void 0!==t.strokeColor?t.strokeColor:"255,225,255",n.Lf=void 0!==t.strokeWidth?t.strokeWidth:1,n.Rf=t.plateColor,n.Of=t.plateStrokeColor,n.bf=void 0!==t.depth&&t.depth,n.Ri=void 0===t.collision||t.collision,n.Pa=void 0!==t.opacity?t.opacity:1,n.Af=void 0!==t.textAlign?t.textAlign:uc.Center,n.zt=Pi.getCenterByAnchor(t.anchor),n.wi=0,n.St=null,n.Mi=n.Mi.bind(oy(n)),n}return t=r,(n=[{key:"bound",get:function(){return!0===this.needUpdateBound&&(this.wr.reset(),void 0!==this.I&&void 0!==this.N&&(this.wr.expandByCoords([{x:this.I,y:this.N}]),this.needUpdateBound=!1)),this.wr.clone()}},{key:"collision",get:function(){return this.Ri},set:function(t){this.Ri!==t&&(this.Ri=t,(t=this.la(Bg))&&t.Zt.pa())}},{key:"size",get:function(){return this.wi},set:function(t){this.wi=t}},{key:"text",get:function(){return this._u},set:function(t){this._u=t}},{key:"fillColor",get:function(){return this.Ef},set:function(t){this.Ef=t}},{key:"strokeColor",get:function(){return this.Tf},set:function(t){this.Tf=t}},{key:"strokeWidth",get:function(){return this.Lf},set:function(t){this.Lf=t}},{key:"fontsize",get:function(){return this.Mf}},{key:"plateColor",get:function(){return this.Rf},set:function(t){this.Rf=t}},{key:"plateStrokeColor",get:function(){return this.Of},set:function(t){this.Of=t}},{key:"moveTo",value:function(t){var n=this,e=void 0!==t.animate&&t.animate,i=void 0!==t.duration?t.duration:.5;if(e){e=this.la(Bg);if(!e)return!1;this.St||(this.St=new Ri),this.St.ft([this.I,this.N]).lt([t.x,t.y]).dt(i).pt(function(t){n.I=t.destination[0],n.N=t.destination[1],n.af()}).mt(function(){n.I=t.x,n.N=t.y,n.af(),t.finish&&t.finish()}),e.ln.dn(this.St.ht())}else this.I=t.x,this.N=t.y,this.af();return this.St}},{key:"stop",value:function(){var t;!this.St||(t=this.la(Bg))&&(t.ln.cn(this.St),this.St=null,this.Cf=!1)}},{key:"update",value:function(){this.Ca()}},{key:"addTo",value:function(t){ey(sy(r.prototype),"addTo",this).call(this,t);t=this.la(Bg);t&&(t.on("viewModeChanged",this.Mi),t.on("zoom",this.Mi),t.on("resize",this.Mi),t.Zt.pa())}},{key:"remove",value:function(){this.stop();var t=this.la(Bg);t&&(t.off("viewModeChanged",this.Mi),t.off("zoom",this.Mi),t.off("resize",this.Mi),ey(sy(r.prototype),"remove",this).call(this),t.Zt.pa())}},{key:"setInitWriteRenderNodeFunction",value:function(t){this.kf=t}},{key:"findParent",value:function(t){return this.la(t)}},{key:"updateSize",value:function(){this.Mi()}},{key:"getRenderNode",value:function(){return this.Dn}}])&&ny(t.prototype,n),e&&ny(t,e),r}();Object.assign(e.prototype,{bs:function(){var t=this.la(Bg);if(!t)return!1;t=t.Zt,t=this.Oa(t.Jn);return this.Dn=new jd(t),this.Dn.center.set(this.zt.x,this.zt.y),this.Mi(),this.af(),(this.Dn.mapNode=this).kh=!0,this.kf&&(this.Dn=this.kf(this.Dn)),!0},af:function(){var t=this.la(Bg);if(!t)return!1;this.Dn.position.set(this.I-t.getX(),this.Wt,-this.N+t.getY()),this.needUpdateBound=!0,t.enableUpdateRender()},Mi:function(){var t=this.la(Bg);if(!t)return!1;var n=t.Zt._i(this.wi);this.Dn.scale.set(n,n,n),this.Dn.scale.multiplyScalar(this.Dn.material.userData.mspriteScale),this.Dn.scale.setX(this.Dn.scale.x/this.Dn.material.userData.scaleRatio),t.enableUpdateRender()},Ca:function(){var t=this.la(Bg);t&&(this.Dn.material.map&&this.Dn.material.map.dispose(),this.Dn.material.dispose(),this.Dn.material=this.Oa(t.Zt.Jn),this.Mi())},Oa:function(t){var n=this.la(um),n=t.Xo(this._u,{fontsize:this.Mf,fillColor:Ei.toRgba(this.Ef),strokeColor:Ei.toRgba(this.Tf),plateColor:Ei.toRgba(this.Rf),plateStrokeColor:Ei.toRgba(this.Of),strokeWidth:this.Lf},{family:this.Sf,needSize:!0,opacity:this.Pa*n.Pa,textAlign:this.Af});return this.wi=n.size,n}});Ji=e;function ay(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var uy=function(){function i(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,i)}var t,n,e;return t=i,e=[{key:"createShape",value:function(t,n){var e=new Am;e.moveTo(t[0].x-n.x,t[0].y-n.y);for(var i=1;i<t.length;i++)e.lineTo(t[i].x-n.x,t[i].y-n.y);return e}},{key:"createShapeBufferGeometryByCenter",value:function(t,n,e){n=new Jm(this.createShape(t,n));if(e){for(var i=[Number.MAX_VALUE,Number.MAX_VALUE],r=[-Number.MAX_VALUE,-Number.MAX_VALUE],o=n.attributes.position.array,s=0;s<o.length/3;s++){var a=o[3*s],u=o[3*s+1];i[0]>a&&(i[0]=a),i[1]>u&&(i[1]=u),r[0]<a&&(r[0]=a),r[1]<u&&(r[1]=u)}for(var h=n.attributes.uv.array,c=[r[0]-i[0],r[1]-i[1]],f=0;f<o.length/3;f++){var l=o[3*f],d=o[3*f+1];h[2*f]=(l-i[0])/c[0],h[2*f+1]=(d-i[1])/c[1]}n.setAttribute("uv",new Hr(h,2))}return n}},{key:"createExtrudeBufferGeometry",value:function(t,n){return new $m(t,{steps:1,depth:n.depth,bevelEnabled:!1,bevelThickness:0,bevelSize:0,bevelOffset:0,bevelSegments:1})}},{key:"closedPoints",value:function(t){var n=t.length;return!(n<3)&&(t[0].x===t[n-1].x&&t[0].y===t[n-1].y||(t[n]={x:t[n-1].x,y:t[n-1].y}),!0)}},{key:"createReactShape",value:function(t,n){var e=new Am,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 Am;return e.absarc(0,0,t,0,2*Math.PI,!1),e}},{key:"createReactExtrudeBufferGeometry",value:function(t,n,e){n=i.createReactShape(t,n);return this.createExtrudeBufferGeometry(n,e)}},{key:"createCircleExtrudeBufferGeometry",value:function(t,n,e){n=i.createCircleShape(t,n);return this.createExtrudeBufferGeometry(n,e)}},{key:"createCenterBufferGeometry",value:function(t,n){for(var e=[],i=0;i<t.length-1;i++)for(var r=2;r<10;r+=2)e.push({x:t[i].x+(t[i+1].x-t[i].x)*r*.1,y:t[i].y+(t[i+1].y-t[i].y)*r*.1,z:t[i].z+(t[i+1].z-t[i].z)*r*.1});e.push({x:e[0].x,y:e[0].y,z:e[0].z});for(var o=new $r,s=[],a=[],u=0;u<e.length-1;u++)s.push(e[u].x),s.push(e[u].y),s.push(e[u].z),s.push(e[u+1].x),s.push(e[u+1].y),s.push(e[u+1].z),s.push(n.x),s.push(n.y),s.push(n.z),a.push(0,0,1);var h=new Float32Array(s);return o.setAttribute("position",new Hr(h,3)),o.setAttribute("gradientAlpha",new Hr(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)&&ay(t.prototype,n),e&&ay(t,e),i}();function hy(){$r.call(this),this.type="InstancedBufferGeometry",this.maxInstancedCount=void 0}function cy(t,n,e){_u.call(this,t,n),this.meshPerAttribute=e||1}function fy(t){$r.call(this),this.type="WireframeGeometry";var n,e,i,r,o,s,a=[],u=[0,0],h={},c=["a","b","c"];if(t&&t.isGeometry){for(var f=t.faces,l=0,d=f.length;l<d;l++)for(var v=f[l],p=0;p<3;p++)r=v[c[p]],o=v[c[(p+1)%3]],u[0]=Math.min(r,o),u[1]=Math.max(r,o),void 0===h[s=u[0]+","+u[1]]&&(h[s]={index1:u[0],index2:u[1]});for(s in h)i=h[s],_=t.vertices[i.index1],a.push(_.x,_.y,_.z),_=t.vertices[i.index2],a.push(_.x,_.y,_.z)}else if(t&&t.isBufferGeometry){var m,g,y,b,_=new St;if(null!==t.index){for(m=t.attributes.position,g=t.index,e=(y=(n=0)===(y=t.groups).length?[{start:0,count:g.count,materialIndex:0}]:y).length;n<e;++n)for(d=(l=(b=y[n]).start)+b.count;l<d;l+=3)for(p=0;p<3;p++)r=g.getX(l+p),o=g.getX(l+(p+1)%3),u[0]=Math.min(r,o),u[1]=Math.max(r,o),void 0===h[s=u[0]+","+u[1]]&&(h[s]={index1:u[0],index2:u[1]});for(s in h)i=h[s],_.fromBufferAttribute(m,i.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 Hr(a,3))}function ly(t){return(ly="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function dy(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function vy(t,n){return(vy=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function py(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=my(e);return t=i?(t=my(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==ly(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function my(t){return(my=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}hy.prototype=Object.assign(Object.create($r.prototype),{constructor:hy,isInstancedBufferGeometry:!0,copy:function(t){return $r.prototype.copy.call(this,t),this.maxInstancedCount=t.maxInstancedCount,this},clone:function(){return(new this.constructor).copy(this)}}),cy.prototype=Object.assign(Object.create(_u.prototype),{constructor:cy,isInstancedInterleavedBuffer:!0,copy:function(t){return _u.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this}}),(fy.prototype=Object.create($r.prototype)).constructor=fy;var gy=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&vy(t,n)}(r,hy);var t,n,e,i=py(r);function r(){var t;!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(t=i.call(this)).type="LineSegmentsGeometry";return t.isLineSegmentsGeometry=!0,t.setIndex([0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5]),t.setAttribute("position",new Hr([-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 Hr([-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],2)),t.setAttribute("uv2",new Hr([0,0,1,0,0,1/3,1,1/3,0,2/3,1,2/3,0,1,1,1],2)),t}return t=r,(n=[{key:"applyMatrix",value:function(t){var n=this.attributes.instanceStart,e=this.attributes.instanceEnd;return void 0!==n&&(t.applyToBufferAttribute(n),t.applyToBufferAttribute(e),n.data.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}},{key:"setPositions",value:function(t){t instanceof Float32Array?n=t:Array.isArray(t)&&(n=new Float32Array(t));var n=new cy(n,6,1);return this.setAttribute("instanceStart",new xu(n,3,0)),this.setAttribute("instanceEnd",new xu(n,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}},{key:"setColors",value:function(t){t instanceof Float32Array?n=t:Array.isArray(t)&&(n=new Float32Array(t));var n=new cy(n,6,1);return this.addAttribute("instanceColorStart",new xu(n,3,0)),this.addAttribute("instanceColorEnd",new xu(n,3,3)),this}},{key:"setUvys",value:function(t){t instanceof Float32Array?n=t:Array.isArray(t)&&(n=new Float32Array(t));var n=new cy(n,2,1);return this.setAttribute("uvyStart",new xu(n,1,0)),this.setAttribute("uvyEnd",new xu(n,1,1)),this}},{key:"fromWireframeGeometry",value:function(t){return this.setPositions(t.attributes.position.array),this}},{key:"fromEdgesGeometry",value:function(t){return this.setPositions(t.attributes.position.array),this}},{key:"fromMesh",value:function(t){return this.fromWireframeGeometry(new fy(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 $;null===this.boundingBox&&(this.boundingBox=new $);var n=this.attributes.instanceStart,e=this.attributes.instanceEnd;void 0!==n&&void 0!==e&&(this.boundingBox.setFromBufferAttribute(n),t.setFromBufferAttribute(e),this.boundingBox.union(t))}},{key:"computeBoundingSphere",value:function(){var t=new St;null===this.boundingSphere&&(this.boundingSphere=new et),null===this.boundingBox&&this.computeBoundingBox();var n=this.attributes.instanceStart,e=this.attributes.instanceEnd;if(void 0!==n&&void 0!==e){var i=this.boundingSphere.center;this.boundingBox.getCenter(i);for(var r=0,o=0,s=n.count;o<s;o++)t.fromBufferAttribute(n,o),r=Math.max(r,i.distanceToSquared(t)),t.fromBufferAttribute(e,o),r=Math.max(r,i.distanceToSquared(t));this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&console.error("fm.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}},{key:"toJSON",value:function(){}},{key:"clone",value:function(){}},{key:"copy",value:function(t){return this}}])&&dy(t.prototype,n),e&&dy(t,e),r}();function yy(t){return(yy="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 by(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function _y(t,n){return(_y=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function wy(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=xy(e);return t=i?(t=xy(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==yy(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function xy(t){return(xy=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var My=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&_y(t,n)}(r,gy);var t,n,e,i=wy(r);function r(){var t;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(t=i.call(this)).type="LineGeometry",t.isLineGeometry=!0,t}return t=r,(n=[{key:"setPositions",value:function(t){for(var n=t.length-3,e=new Float32Array(2*n),i=0;i<n;i+=3)e[2*i]=t[i],e[2*i+1]=t[i+1],e[2*i+2]=t[i+2],e[2*i+3]=t[i+3],e[2*i+4]=t[i+4],e[2*i+5]=t[i+5];return this.test="ddd",(new gy).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 gy).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}}])&&by(t.prototype,n),e&&by(t,e),r}(),Sy=new St,Ey=new St;function Ty(t,n){this.start=void 0!==t?t:new St,this.end=void 0!==n?n:new St}function Ly(t){return(Ly="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ry(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Oy(t,n){return(Oy=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Ay(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Cy(e);return t=i?(t=Cy(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Ly(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function Cy(t){return(Cy=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function ky(t,n,e){t=0<arguments.length&&void 0!==t?t:{x:0,y:0,z:0},n=1<arguments.length&&void 0!==n?n:{x:0,y:0,z:0},e=2<arguments.length?e:void 0,t=new Ci(t.x,t.y,t.z,1),n=new Ci(n.x,n.y,n.z,1);return t.applyMatrix4(e.projectionMatrix),n.multiplyScalar(t.w),n.applyMatrix4(e.projectionMatrixInverse),{x:n.x,y:n.y,z:n.z}}Object.assign(Ty.prototype,{set:function(t,n){return this.start.copy(t),this.end.copy(n),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.start.copy(t.start),this.end.copy(t.end),this},getCenter:function(t){return void 0===t&&(console.warn("THREE.Line3: .getCenter() target is now required"),t=new St),t.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(t){return void 0===t&&(console.warn("THREE.Line3: .delta() target is now required"),t=new St),t.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(t,n){return void 0===n&&(console.warn("THREE.Line3: .at() target is now required"),n=new St),this.delta(n).multiplyScalar(t).add(this.start)},closestPointToPointParameter:function(t,n){Sy.subVectors(t,this.start),Ey.subVectors(this.end,this.start);t=Ey.dot(Ey),t=Ey.dot(Sy)/t;return t=n?Mt.clamp(t,0,1):t},closestPointToPoint:function(t,n,e){n=this.closestPointToPointParameter(t,n);return void 0===e&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),e=new St),this.delta(e).multiplyScalar(n).add(this.start)},applyMatrix4:function(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this},equals:function(t){return t.start.equals(this.start)&&t.end.equals(this.end)}});var Py=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Oy(t,n)}(r,Uo);var t,n,e,i=Ay(r);function r(t,n){return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(n=i.call(this,t,n)).type="LineSegments2",n.isLineSegments2=!0,n}return t=r,(n=[{key:"computeLineDistances",value:function(){for(var t=new St,n=new St,e=this.geometry,i=e.attributes.instanceStart,r=e.attributes.instanceEnd,o=new Float32Array(2*i.data.count),s=0,a=0,u=i.data.count;s<u;s++,a+=2)t.fromBufferAttribute(i,s),n.fromBufferAttribute(r,s),o[a]=0===a?0:o[a-1],o[a+1]=o[a]+t.distanceTo(n);var h=new cy(o,2,1);return e.setAttribute("instanceDistanceStart",new xu(h,1,0)),e.setAttribute("instanceDistanceEnd",new xu(h,1,1)),this}},{key:"copy",value:function(t){return this}},{key:"raycast",value:function(t,n){null===t.camera&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2.');var e=new Ci,i=new Ci,r=new Ci,o=new St,s=new Et,a=new Ty,u=new St,h=new $,c=new et,f=void 0!==t.params.Line2&&t.params.Line2.threshold||0,l=t.ray,d=t.camera,v=d.projectionMatrix,p=this.matrixWorld,m=this.geometry,g=this.material,y=g.resolution,b=g.uniforms.lineWidth.value+f,_=m.attributes.instanceStart,w=m.attributes.instanceEnd,x=-d.near,g=2*Math.max(b/y.width,b/y.height);null===m.boundingSphere&&m.computeBoundingSphere(),c.copy(m.boundingSphere).applyMatrix4(p);f=ky({x:0,y:0,z:-Math.max(d.near,c.distanceToPoint(l.origin))},{x:g,y:0,z:0},d);if(d.isPerspectiveCamera?f.x/=2:f.x=b/d.zoom,c.radius+=f.x,!1!==t.ray.intersectsSphere(c)){null===m.boundingBox&&m.computeBoundingBox(),h.copy(m.boundingBox).applyMatrix4(p);g=ky({x:0,y:0,z:-Math.max(d.near,h.distanceToPoint(l.origin))},{x:g,y:0,z:0},d);if(d.isPerspectiveCamera?g.x/=2:g.x=b/d.zoom,h.max.x+=g.x,h.max.y+=g.x,h.max.z+=g.x,h.min.x-=g.x,h.min.y-=g.x,h.min.z-=g.x,!1!==t.ray.intersectsBox(h)){l.at(1,r),r.w=1,r.applyMatrix4(d.matrixWorldInverse),r.applyMatrix4(v),r.multiplyScalar(1/r.w),r.x*=y.x/2,r.y*=y.y/2,r.z=0,o.copy(r),s.multiplyMatrices(d.matrixWorldInverse,p);for(var M,S=0,E=_.count;S<E;S++)if(e.fromBufferAttribute(_,S),i.fromBufferAttribute(w,S),e.w=1,i.w=1,e.applyMatrix4(s),i.applyMatrix4(s),!(e.z>x&&i.z>x)){e.z>x?(M=e.z-i.z,M=(e.z-x)/M,e.lerp(i,M)):i.z>x&&(T=i.z-e.z,L=(i.z-x)/T,i.lerp(e,L)),e.applyMatrix4(v),i.applyMatrix4(v),e.multiplyScalar(1/e.w),i.multiplyScalar(1/i.w),e.x*=y.x/2,e.y*=y.y/2,i.x*=y.x/2,i.y*=y.y/2,a.start.copy(e),a.start.z=0,a.end.copy(i),a.end.z=0;var T=a.closestPointToPointParameter(o,!0);a.at(T,u);var L=Mt.lerp(e.z,i.z,T),T=-1<=L&&L<=1,L=u.distanceTo(i)<1||u.distanceTo(e)<1?.5*b*Math.sqrt(2):.5*b,L=o.distanceTo(u)<L;if(T&&L){a.start.fromBufferAttribute(_,S),a.end.fromBufferAttribute(w,S),a.start.applyMatrix4(p),a.end.applyMatrix4(p);T=new St,L=new St;l.distanceSqToSegment(a.start,a.end,L,T),n.push({point:L,pointOnLine:T,distance:l.origin.distanceTo(L),object:this,face:null,faceIndex:S,uv:null,uv2:null});break}}}}}}])&&Ry(t.prototype,n),e&&Ry(t,e),r}();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 jy(t,n){return(jy=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Iy(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Ny(e);return t=i?(t=Ny(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Dy(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function Ny(t){return(Ny=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Fy=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&jy(t,n)}(i,Py);var e=Iy(i);function i(t,n){return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,i),(n=e.call(this,t,n)).type="Line2",n.isLine2=!0,n}return i}();function Uy(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var By=function(){function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t)}var n,e,i;return n=t,(e=[{key:"calculatePoint",value:function(t,n,e){return(new St).copy(e).add((new St).copy(t).sub(e).normalize().multiplyScalar(n))}},{key:"computerArcLineByPoints",value:function(t,n,e,i,r){var o=[],t=this.calculatePoint(t,i,n),i=this.calculatePoint(e,i,n),s=new Tm(t,n,i);o.push(t);for(var a=0;a<r-1;a++){var u=s.getPoint((a+1)/r);o.push(u)}return o.push(i),o}}])&&Uy(n.prototype,e),i&&Uy(n,i),t}();function Gy(t){return function(t){if(Array.isArray(t))return Hy(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,n){if(t){if("string"==typeof t)return Hy(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(e="Object"===e&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Hy(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 Hy(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 Vy(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}br=function(){function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),this.Pf=null,this.Lt=0,this.Df=!0,this.jf=1,this.If=[],this.Nf=!1,this.Ff=null,this.Uf=null,this.Bf=[],this.Gf=[],this.Hf=[],this.Vf=null,this.zf=null}var n,e,i;return n=t,(e=[{key:"points",get:function(){return this.Pf},set:function(t){this.Pf=t}},{key:"level",get:function(){return this.Lt},set:function(t){this.Lt=t}},{key:"length",get:function(){return this.Wf(this.Bf.length)}},{key:"linePoints",get:function(){return this.Ff}},{key:"uvys",get:function(){return this.Uf}},{key:"resize",value:function(){this.Bf=[],this.Nf=!1}}])&&Vy(n.prototype,e),i&&Vy(n,i),t}();Object.assign(br.prototype,{Xf:function(t,n){"number"!=typeof n&&(n=this.jf),this.Ff=this.Zf(t,n),this.Uf=this.Yf()},Zf:function(t,n){this.Df?this.Nf||this.qf(n):((n=[]).push.apply(n,Gy(this.Pf)),this.If=n);for(var e=[],i=0;i<this.If.length;i++){var r=this.If[i].x-t.x,o=this.If[i].z,s=-this.If[i].y+t.y;e.push(r,o,s),0!==i&&(o=new St(this.If[i].x,this.If[i].y,this.If[i].z),s=new St(this.If[i-1].x,this.If[i-1].y,this.If[i-1].z),this.Bf.push(o.distanceTo(s)))}return e},qf:function(t){for(var n,e,i=[],r=new By,o=0;o<this.Pf.length;o++)0===o&&this.zf?(n=this.Kf(t,this.zf,this.Pf[o],this.Pf[o+1]),this.isCross?i.push.apply(i,Gy(r.computerArcLineByPoints(this.zf,this.Pf[o],this.Pf[o+1],n,12))):i.push(r.calculatePoint(this.Pf[o+1],n,this.Pf[o]))):o===this.Pf.length-1&&this.Vf?(e=this.Kf(t,i[i.length-1],this.Pf[o],this.Vf),this.isCross?i.push.apply(i,Gy(r.computerArcLineByPoints(i[i.length-1],this.Pf[o],this.Vf,e,12))):i.push(r.calculatePoint(i[i.length-1],e,this.Pf[o]))):0<o&&o<this.Pf.length-1?(e=this.Kf(t,i[i.length-1],this.Pf[o],this.Pf[o+1]),i.push.apply(i,Gy(r.computerArcLineByPoints(i[i.length-1],this.Pf[o],this.Pf[o+1],e,12)))):i.push(this.Pf[o]);this.If=i,this.Nf=!0},Kf:function(t,n,e,i){return Math.min(.5*du.distanceOfTwoPoints(n,e),.5*du.distanceOfTwoPoints(e,i),t)},Yf:function(){for(var t,n=[],e=this.Wf(this.Bf.length),i=0;i<this.If.length;i++)0===i?n.push(0):i===this.If.length-1?n.push(1):(t=this.Wf(i)/e,n.push(t),n.push(t));return n},Wf:function(t){for(var n=0,e=0;e<this.Bf.length;e++)e<t&&(n+=this.Bf[e]);return n}});var zy=br,Wy={FULL:0,DOTTED:2,DOT_DASH:4,CENTER:8,DASH:16,DOUBLE_DOT_DASH:32,TRI_DOT_DASH:64,FMARROW:128,ARROW:256};function Xy(t){return(Xy="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 Zy(t,n){var e;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(e=function(t,n){if(t){if("string"==typeof t)return Yy(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(e="Object"===e&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Yy(t,n):void 0}}(t))||n&&t&&"number"==typeof t.length){e&&(t=e);var i=0,n=function(){};return{s:n,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o=!0,s=!1;return{s:function(){e=t[Symbol.iterator]()},n:function(){var t=e.next();return o=t.done,t},e:function(t){s=!0,r=t},f:function(){try{o||null==e.return||e.return()}finally{if(s)throw r}}}}function Yy(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 qy(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Ky(t,n,e){return(Ky="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,n,e){t=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=tb(t)););return t}(t,n);if(t){n=Object.getOwnPropertyDescriptor(t,n);return n.get?n.get.call(e):n.value}})(t,n,e||t)}function Jy(t,n){return(Jy=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Qy(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=tb(e);return t=i?(t=tb(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Xy(t)&&"function"!=typeof t?$y(n):t}}function $y(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function tb(t){return(tb=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}pr=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Jy(t,n)}(r,Xg);var t,n,e,i=Qy(r);function r(t){var n;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),n=i.call(this,t),t=t||{},n.Yn=Di.LINE_MARKER,n.Ta=t.url,n.Jf=void 0!==t.width?t.width:6,n.Ja=void 0!==t.color?t.color:"#33cc61",n.Df=void 0===t.smooth||t.smooth,n.Qf=void 0!==t.radius?t.radius:1,n.ai=void 0===t.animate||t.animate,n.Pa=void 0!==t.opacity?t.opacity:1,n.bf=void 0===t.depth||t.depth,n.$f=void 0!==t.type?t.type:Wy.FMARROW,n.tl=void 0!==t.borderColor?t.borderColor:"#4a82d2",n.nl=void 0!==t.segments?t.segments:[],n.el=[],n.il=60,n.rl=10,n.ol="#aeaeae",n.sl=n.sl.bind($y(n)),n.al=n.al.bind($y(n)),n.ul=n.ul.bind($y(n)),n.hl=n.hl.bind($y(n)),n.af=n.af.bind($y(n)),n}return t=r,(n=[{key:"bound",get:function(){if(!0===this.needUpdateBound){this.wr.reset();for(var t=this.nl,n=0;n<t.length;n++){var e=t[n];this.wr.expandByCoords(e.Pf)}this.needUpdateBound=!1}return this.wr.clone()}},{key:"level",get:function(){return null}},{key:"width",get:function(){return this.Jf},set:function(t){0!==t&&t!==this.Jf&&(this.Jf=t,this.Ca())}},{key:"color",get:function(){return this.Ja},set:function(t){this.Ja!==t&&(this.Ja=t,this.Ca())}},{key:"opacity",get:function(){return this.Pa},set:function(t){this.Pa!==t&&(this.Pa=t,this.Ca())}},{key:"passedColor",get:function(){return this.ol},set:function(t){this.ol!==t&&(this.ol=t,this.Ca())}},{key:"segments",get:function(){return this.nl}},{key:"update",value:function(){var t,n;this.Dn&&this.Dn.material&&((t=this.la(Bg))&&(n=this.la(um),this.Dn.material=t.Zt.Jn.Wo({color:this.Ja,lineWidth:this.Jf,opacity:this.Pa*n.Pa,needDepth:!1})))}},{key:"moveProportion",value:function(t){for(var n=0,e=this.el.length-1;-1<e;e--)this.el[e].isCross||(n+=this.el[e].seg.length);for(var i=0,r=this.el.length-1;-1<r;r--){var o=i/n;this.el[r].isCross||(i+=this.el[r].seg.length);var s=i/n;s<t?this.el[r].line.material.uniforms.miny.value=1:t<=s&&(this.el[r].line.material.uniforms.miny.value=(t-o)/(s-o))}var a=this.la(Bg);a&&a.enableUpdateRender()}},{key:"getLineNodes",value:function(){return this.el}},{key:"addTo",value:function(t){t.ui.add(this),this.cl(t.getVisibleLevels()),t.on("visibleLevelsLoaded",this.hl),t.on("zoom",this.al),t.on("levelChanged",this.al),t.on("resize",this.ul),t.on("floorSpaceChanged",this.af),this.ai&&t.ln.Ic(this.sl)}},{key:"remove",value:function(){var t=this.la(Bg);if(t){t.off("visibleLevelsLoaded",this.hl),t.off("zoom",this.al),t.off("levelChanged",this.al),t.off("resize",this.fi),t.off("floorSpaceChanged",this.af);for(var n=0;n<this.el.length;n++)t.getFloor(this.el[n].gid).getOrCreateLayer(this.Yn).ci.remove(this.el[n].line);this.el=[],this.ai&&t.ln.Nc(this.sl),t.ui.remove(this),t.enableUpdateRender()}}},{key:"dispose",value:function(){Ky(tb(r.prototype),"dispose",this).call(this);for(var t=0;t<this.nl.length;t++)this.nl[t].resize()}}])&&qy(t.prototype,n),e&&qy(t,e),r}();Object.assign(pr.prototype,{fl:function(t,n){var e=new My;e.setPositions(t);t=this.la(um),t=n.Zt.Jn.Wo({color:this.Ja,lineWidth:this.Jf,opacity:this.opacity*t.Pa,needDepth:!1});this.Dn=new Fy(e,t),this.Dn.computeLineDistances(),e.dispose(),e=null},ll:function(t){var n=new My;n.setPositions(t),this.Dn.geometry=n,this.Dn.computeLineDistances(),n.dispose(),n=null},bs:function(){var t=this.la(Bg);if(t){for(var n=this.dl(),e=this.nl.length-1;-1<e;e--){var i=t.getFloor(this.nl[e].level),r=void 0,o=void 0;0<e&&this.nl[e].Lt!==this.nl[e-1].Lt&&(r=t.getFloor(this.nl[e-1].Lt),o=this.nl[e-1].points,this.nl[e].zf=Object.assign({},o[o.length-1]),this.nl[e].zf.z+=r.Wt-i.Wt),e<this.nl.length-1&&this.nl[e].Lt!==this.nl[e+1].Lt&&(s=t.getFloor(this.nl[e+1].Lt),this.nl[e].Vf=Object.assign({},this.nl[e+1].points[0]),this.nl[e].Vf.z+=s.Wt-i.Wt);var s,a=this.vl(this.nl[e],n);this.el.push({line:a,gid:this.nl[e].level,seg:this.nl[e],isCross:!1}),i.getOrCreateLayer(this.Yn).ci.add(a),0<e&&this.nl[e].Lt!==this.nl[e-1].Lt&&((s=new zy).Lt=this.nl[e].Lt,s.isCross=!0,a=this.nl[e].points,this.pl(s,o,a,r,i),i=this.vl(s,n),this.el.push({line:i,seg:s,gid:this.nl[e-1].level,gidAn:s.level,isCross:!0}),r.getOrCreateLayer(this.Yn).ci.add(i))}return this.kh=!0,t.enableUpdateRender(),this.kh}},pl:function(t,n,e,i,r){var o=Object.assign({},n[n.length-1]),s=Object.assign({},e[0]);o.z+=i.Wt-r.Wt,t.points=[o,s],t.zf=Object.assign({},n[n.length-2]),t.zf.z+=i.Wt-r.Wt,t.Vf=Object.assign({},e[1])},vl:function(t,n){var e=this.la(Bg);if(e){var i=new ci(e.getX(),e.getY());t.Df=this.Df,t.Xf(i,this.Qf);for(var r=e.getFloor(t.Lt),o=[],s=0;s<t.linePoints.length;s++)o.push(t.linePoints[s]);var a=t.Uf,i=new My;i.setPositions(o),i.setUvys(a);a=new Jh({color:this.Ja,lineWidth:this.Jf,vertexColors:2,dashed:!1,transparent:!0,pcolor:this.ol,opacity:this.Pa});a.depthTest=this.bf,a.depthWrite=this.bf,a.transparent=!0,a.resolution=new ci(e.an.renderer.domElement.clientWidth,e.an.renderer.domElement.clientHeight),n.useMap&&(a.defines.USE_MMAP=!0,a.uniforms.mmap.value=n.texture,this.ml(a,t,this.il),a.needsUpdate=!0);a=new Fy(i,a);return a.computeLineDistances(),a.position.set(0,r.Wt,0),a.mapNode=this,a}},sl:function(t){for(var n=0;n<this.el.length;n++)this.el[n].line.material.uniforms.offset.value.y-=.001*t;this.la(Bg).enableUpdateRender()},al:function(){for(var t=0;t<this.el.length;t++)this.ml(this.el[t].line.material,this.el[t].seg,this.il)},ml:function(t,n,e){var i=this.la(Bg);i&&(n=n.length*i.Zt.xc(n.Lt),t.uniforms.repeat.value.y=Math.floor(n*window.devicePixelRatio/e),i.enableUpdateRender())},ul:function(){var t=this.la(Bg);if(t){for(var n=0;n<this.el.length;n++)this.el[n].line.material.resolution=new ci(t.an.renderer.domElement.clientWidth,t.an.renderer.domElement.clientHeight);t.enableUpdateRender()}},cl:function(t){var n,e=Zy(this.el);try{for(e.s();!(n=e.n()).done;){var i=n.value;i.isCross?t.indexOf(i.gid)<0||t.indexOf(i.gidAn)<0?i.line.visible=!1:i.line.visible=!0:-1<t.indexOf(i.gid)?i.line.visible=!0:i.line.visible=!1}}catch(t){e.e(t)}finally{e.f()}this.la(Bg).enableUpdateRender()},hl:function(){var t=this.la(Bg);t&&this.cl(t.getVisibleLevels())},gl:function(){this.il=this.Jf*this.rl;var t={type:"normal",width:128,height:128,color:this.Ja,arrowHeightPercent:.6,arrowWidthPercent:1,arrowPercent:.1,lineType:null,dashArray:[2,1],textureCommand:"createNormalLineTexture",godHeightPercent:1,godEdgePercent:.2,godArrowPercent:.15,arrowWidth:20,godColor:this.Ja,godEdgeColor:this.tl,godArrowColor:"#F4FEFB",godArrowXScale:4,godArrowWidthPercent:.9,useMap:!0};switch(this.$f){case Wy.FULL:t.useMap=!1;break;case Wy.DOTTED:t.dashArray=[1,1];break;case Wy.DOT_DASH:t.dashArray=[2.5,1,.5,1];break;case Wy.CENTER:t.dashArray=[3,1,1.5,1];break;case Wy.DASH:t.dashArray=[2,1];break;case Wy.DOUBLE_DOT_DASH:t.dashArray=[2.5,.5,.5,.5,.5,.5];break;case Wy.TRI_DOT_DASH:t.dashArray=[2.5,.5,.5,.5,.5,.5,.5,.5];break;case Wy.FMARROW:case Wy.ARROW:t.width=5*this.Jf,t.height=5*this.il,t.arrowWidth=t.height/12,t.dashArray=[7,0],t.textureCommand="createArrowWidthBackTexture";break;default:t.useMap=!1}return t},dl:function(){var t=this.la(Bg);if(t){var n=this.gl(),e=null;return this.Ta?{useMap:!0,texture:t.Zt.Jn.ts(this.Ta,function(t){t.needsUpdate=!0})}:(n.useMap&&((e=t.Zt.Jn[n.textureCommand](n)).minFilter=On,e.wrapS=Mn,e.wrapT=Mn,e.generateMipmaps=!1,e.anisotropy=4),{useMap:n.useMap,texture:e})}},Ca:function(){if(0<this.el.length)for(var t=this.dl(),n=0;n<this.el.length;n++)this.el[n].line.material.lineWidth=this.Jf,this.el[n].line.material.color=new _i(this.Ja),this.el[n].line.material.pcolor=new _i(this.ol),this.el[n].line.material.opacity=this.Pa,t.useMap&&(this.el[n].line.material.uniforms.mmap.value=t.texture);var e=this.la(Bg);e&&e.enableUpdateRender()},af:function(){if(0<this.el.length){var t=this.la(Bg);if(t){for(var n=0;n<this.el.length;n++){var e,i,r=this.el[n];r.isCross?(e=t.getFloor(r.gid),i=t.getFloor(r.gidAn),r.seg.resize(),this.pl(r.seg,this.el[n+1].seg.points,this.el[n-1].seg.points,e,i),i=this.dl(),i=this.vl(r.seg,i),(e=e.getOrCreateLayer(this.Yn)).ci.add(i),e.ci.remove(r.line),r.line.geometry.dispose(),r.line.material.dispose(),r.line=i):(i=t.getFloor(r.seg.Lt),r.line.position.y=i.Wt)}t.enableUpdateRender()}}}});var nb=pr;function eb(t){return(eb="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 ib(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function rb(t,n){return(rb=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function ob(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=sb(e);return t=i?(t=sb(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==eb(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function sb(t){return(sb=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}di=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&rb(t,n)}(r,Xg);var t,n,e,i=ob(r);function r(t){var n;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(n=i.call(this,t)).Yn=Di.POLYGON_MARKER,n.Ta=void 0!==t.url?t.url:void 0,n.Ja=void 0!==t.color?t.color:"#FF0000",n.Pa=void 0!==t.opacity?t.opacity:1,n.Qa=t.borderColor||t.borderColor||"#00ff00",n.Jf="number"==typeof t.borderWidth?t.borderWidth:2,n.Wt=void 0!==t.height?t.height:0,n.Pf=void 0!==t.points?t.points:[],n}return t=r,(n=[{key:"bound",get:function(){return!0===this.needUpdateBound&&(this.wr.reset(),this.wr.expandByCoords(this.Pf),this.needUpdateBound=!1),this.wr.clone()}},{key:"x",get:function(){return this.I}},{key:"y",get:function(){return this.N}},{key:"points",get:function(){return this.Pf},set:function(t){if(this.Pf=t,this.Dn){var n=this.la(Bg);if(n){var t=new ci(n.getX(),n.getY()),e=uy.createShapeBufferGeometryByCenter(this.Pf,t,!!this.Ta),t=this.Dn.geometry;this.Dn.geometry=e,t.dispose();for(var t=null,i=e.attributes.position.array.length,r=new Float32Array(i+3),o=0;o<i;o++)r[o]=e.attributes.position.array[o];r[i]=e.attributes.position.array[0],r[i+1]=e.attributes.position.array[1],r[i+2]=e.attributes.position.array[2],this.Ya.ll(r),n.enableUpdateRender()}}}},{key:"color",get:function(){return this.Ja},set:function(t){this.Ja=t,this.yl()}},{key:"borderColor",get:function(){return this.Qa},set:function(t){this.Qa=t,this.Ya&&(this.Ya.color=t,this.Ya.update())}},{key:"borderWidth",get:function(){return this.Jf},set:function(t){this.Jf=t,this.Ya&&(this.Ya.width=t,this.Ya.update())}},{key:"opacity",get:function(){return this.Pa},set:function(t){this.Pa=t,this.yl()}},{key:"getBound",value:function(){return Hl.bound(this.Pf)}},{key:"getInsideCenter",value:function(){var t={};return Hl.calculatorInsideCentroid(this.Pf,t),t}},{key:"getRenderNode",value:function(){return this.Dn}}])&&ib(t.prototype,n),e&&ib(t,e),r}();Object.assign(di.prototype,{bs:function(){if(!this.Pf)return!1;var t=this.la(Bg);if(!t)return!1;for(var n=this.la(um),e=t.Zt.Jn.Uo({url:this.Ta,color:this.Ja,opacity:this.Pa*n.Pa,visible:!this.Ta},function(){e.map.wrapS=Sn,e.map.wrapT=Sn,e.needsUpdate=!0,e.visible=!0}),n=new ci(t.getX(),t.getY()),i=uy.createShapeBufferGeometryByCenter(this.Pf,n,!!this.Ta),r=i.attributes.position.array.length,o=new Float32Array(r+3),s=0;s<r;s++)o[s]=i.attributes.position.array[s];o[r]=i.attributes.position.array[0],o[r+1]=i.attributes.position.array[1],o[r+2]=i.attributes.position.array[2],this.Dn=new Uo(i,e),this.Dn.rotation.set(-Math.PI/2,0,0,"XYZ"),this.Dn.position.set(0,this.Wt,0),this.Dn.mapNode=this;n=new nb({color:this.Qa,width:this.Jf});return n.K=this,n.fl(o,t),this.Ff=o,this.Ya=n,this.Dn.add(n.Dn),t.enableUpdateRender(),!0},af:function(){this.Dn&&this.Dn.position.set(0,this.Wt,0),map.enableUpdateRender()},yl:function(){var t=this,n=this.la(Bg);if(!n)return!1;var e=n.Zt,i=this.la(um);this.Dn.material=e.Jn.Uo({url:this.Ta,color:this.Ja,opacity:this.Pa*i.Pa,visible:!this.Ta},function(){t.Dn.material.map.wrapS=Sn,t.Dn.material.map.wrapT=Sn,t.Dn.material.needsUpdate=!0,t.Dn.material.visible=!0}),n.enableUpdateRender()},Ca:function(){this.yl(),this.Ya.update()}});pi=di;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){return(ub=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function hb(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=cb(e);return t=i?(t=cb(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==ab(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function cb(t){return(cb=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var fb=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&ub(t,n)}(i,$r);var e=hb(i);function i(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,i);var t=e.call(this),n=new _u(new Float32Array([-.5,0,-.5,0,0,.5,0,-.5,1,0,.5,0,.5,1,1,-.5,0,.5,0,1]),5);return t.setIndex([0,1,2,0,2,3]),t.setAttribute("position",new xu(n,3,0,!1)),t.setAttribute("uv",new xu(n,2,3,!1)),t}return i}();function lb(t){return(lb="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 db(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function vb(t,n,e){return(vb="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,n,e){t=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=yb(t)););return t}(t,n);if(t){n=Object.getOwnPropertyDescriptor(t,n);return n.get?n.get.call(e):n.value}})(t,n,e||t)}function pb(t,n){return(pb=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function mb(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=yb(e);return t=i?(t=yb(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==lb(t)&&"function"!=typeof t?gb(n):t}}function gb(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function yb(t){return(yb=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}Li=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&pb(t,n)}(r,Xg);var t,n,e,i=mb(r);function r(t){var n;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(n=i.call(this,t)).Yn=Di.LOCATION_MARKER,n.Ta=t.url,n.wi=void 0!==t.size?t.size:20,n.Lt=void 0!==t.level?t.level:1,n.Pa=void 0!==t.opacity?t.opacity:1,n.St=null,n.bl=null,n.Mi=n.Mi.bind(gb(n)),n.af=n.af.bind(gb(n)),n}return t=r,(n=[{key:"bound",get:function(){return!0===this.needUpdateBound&&(this.wr.reset(),void 0!==this.I&&void 0!==this.N&&(this.wr.expandByCoords([{x:this.I,y:this.N}]),this.needUpdateBound=!1)),this.wr.clone()}},{key:"level",get:function(){return this.Lt},set:function(t){this.Lt!==t&&(this.Lt=t,t=this.la(Bg),this.remove(),this.addTo(t))}},{key:"opacity",get:function(){return this.Pa},set:function(t){this.Pa=t,this.kh&&this.Ca()}},{key:"url",get:function(){return this.Ta},set:function(t){this.Ta=t,this.Ca()}},{key:"size",get:function(){return this.wi},set:function(t){this.wi=t,this.Mi()}},{key:"moveTo",value:function(t){var n=this,e=t.animate||!1,i=t.duration||.5;if(t.level&&(this.level=t.level),e){e=this.la(Bg);if(!e)return!1;this.St||(this.St=new Ri),this.St.ft([this.I,this.N]).lt([t.x,t.y]).dt(i).pt(function(t){n.I=t.destination[0],n.N=t.destination[1],n.af(),n.Mi()}).mt(function(){n.I=t.x,n.N=t.y,n.af(),t.finish&&t.finish()}),e.ln.dn(this.St.ht())}else this.I=t.x,this.N=t.y,this.af(),this.Mi();return this.St}},{key:"stop",value:function(){var t;this.St||this.bl||(t=this.la(Bg))&&(this.St&&(t.ln.cn(this.St),this.St=null),this.bl&&(t.ln.cn(this.bl),this.bl=null),this.Cf=!1)}},{key:"rotateTo",value:function(t){var n=this,e=this.la(Bg);if(!e)return!1;var i=t.duration||.5,r=this.Dn.rotation.y,o=t.heading%360*vi.DEG2RAD,s=0,s=r+(s=o-r!=0?Math.sin(o-r)/Math.abs(Math.sin(o-r))*Math.acos(Math.cos(o-r)):s);t.animate?(this.bl?(this.bl.ft([r]),this.bl.lt([o])):this.bl=new Ri({src:[r],dest:[s]}),this.bl.dt(i).pt(function(t){n.Dn&&(n.Dn.rotation.y=t.destination[0],e.enableUpdateRender())}).mt(function(){e.ln.cn(n.bl),n.bl=null,e.enableUpdateRender(),t.finish&&t.finish()}),e.ln.dn(this.bl.ht())):this.Dn&&(this.Dn.rotation.y=s,e.enableUpdateRender())}},{key:"addTo",value:function(t){var n=t.getFloor(this.Lt);vb(yb(r.prototype),"addTo",this).call(this,n),t.on("zoom",this.Mi),t.on("resize",this.Mi),t.on("viewChanged",this.Mi),t.on("floorSpaceChanged",this.af)}},{key:"remove",value:function(){this.stop();var t=this.la(Bg);if(!t)return!1;t.off("zoom",this.Mi),t.off("resize",this.Mi),t.off("viewChanged",this.Mi),t.off("floorSpaceChanged",this.af),vb(yb(r.prototype),"remove",this).call(this)}},{key:"getRenderNode",value:function(){return this.Dn}}])&&db(t.prototype,n),e&&db(t,e),r}();Object.assign(Li.prototype,{bs:function(){var t=this.la(Bg);if(!t)return!1;var n=new fb,e=this.Oa(t);this.Dn=new Uo(n,e),this.Dn.renderOrder=1,(this.Dn.mapNode=this).af(),this.Dn.rotation.set(0,0,-Math.PI,"XYZ"),this.Dn.updateMatrixWorld(!0);t=t.Zt.wc(this.Dn,this.wi);return this.Dn.scale.set(t,t,t),this.Dn.visible=this.Ti,this.K.ci.add(this.Dn),this.kh=!0},Mi:function(){var t,n,e=this.la(Bg);e&&(t=this.Dn.position,n=!1,(n=isNaN(t.x)||isNaN(t.y)||isNaN(t.z)||"number"!=typeof t.x||"number"!=typeof t.y||"number"!=typeof t.z?!0:n)||(n=e.Zt.wc(this.Dn,this.wi),this.Dn.scale.set(n,n,n),e.enableUpdateRender()))},af:function(){var t,n=this.la(Bg);n&&(t=n.getFloor(this.Lt),this.Dn.position.set(this.I-n.getX(),t.Wt+this.Wt,-this.N+n.getY()),this.needUpdateBound=!0,n.enableUpdateRender())},Oa:function(n){var e=this;return n.Zt.Jn.Bo({url:this.Ta,flipY:!1,opacity:this.Pa},function(){var t;e.Dn&&(t=n.Zt.wc(e.Dn,e.wi),e.Dn.scale.set(t,t,t),n.enableUpdateRender())})},Ca:function(){var t=this.la(Bg);if(!t)return!1;this.Dn.material.map&&this.Dn.material.map.dispose(),this.Dn.material.dispose(),this.Dn.material=this.Oa(t),this.Dn.material.needsUpdate=!0,t.enableUpdateRender()}});Oi=Li,e={EDGES_LINES_TYPE:"EDGES_LINES_TYPE"};Object.freeze(e);var bb=e,_b={NONE:0,ALL:1,TOP:2};function wb(t,n){$r.call(this),this.type="EdgesGeometry",this.parameters={thresholdAngle:n},n=void 0!==n?n:1;var e,i,r,o,s=[],a=Math.cos(Mt.DEG2RAD*n),u=[0,0],h={},c=["a","b","c"];t.isBufferGeometry?(o=new kr).fromBufferGeometry(t):o=t.clone(),o.mergeVertices(),o.computeFaceNormals();for(var f=o.vertices,l=o.faces,d=0,v=l.length;d<v;d++)for(var p=l[d],m=0;m<3;m++)e=p[c[m]],i=p[c[(m+1)%3]],u[0]=Math.min(e,i),u[1]=Math.max(e,i),void 0===h[r=u[0]+","+u[1]]?h[r]={index1:u[0],index2:u[1],face1:d,face2:void 0}:h[r].face2=d;for(r in h){var g,y=h[r];(void 0===y.face2||l[y.face1].normal.dot(l[y.face2].normal)<=a)&&(g=f[y.index1],s.push(g.x,g.y,g.z),g=f[y.index2],s.push(g.x,g.y,g.z))}this.setAttribute("position",new Hr(s,3))}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 Mb(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Sb(t,n){return(Sb=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Eb(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Tb(e);return t=i?(t=Tb(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==xb(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function Tb(t){return(Tb=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}(wb.prototype=Object.create($r.prototype)).constructor=wb;br=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Sb(t,n)}(r,Xg);var t,n,e,i=Eb(r);function r(t){var n;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(n=i.call(this,t)).Yn=bb.EDGES_LINES_TYPE,n.$f=void 0!==t.lineType?t.lineType:_b.TOP,n._l=void 0!==t.lineAlpha?t.lineAlpha:1,n.Qa=void 0!==t.lineColor?t.lineColor:"#FF0000",n}return t=r,(n=[{key:"lineColor",get:function(){return this.Qa},set:function(t){this.Qa!==t&&(this.Qa=t,this.Ca())}},{key:"lineAlpha",get:function(){return this._l},set:function(t){this._l!==t&&(this._l=t,this.Ca())}}])&&Mb(t.prototype,n),e&&Mb(t,e),r}();Object.assign(br.prototype,{vl:function(t){var n=new wb(t),e=this.la(Bg);if(!e)return!1;t=e.Zt,e=this.la(um),e=t.Jn.Qo(this.Qa,this._l*e.Pa);this.Dn=new zf(n,e),this.kh=!0},Ca:function(){var t,n=this.la(Bg);n&&(t=this.la(um),this.Dn.material=n.Zt.Jn.Qo(this.Qa,this._l*t.Pa))}});var Lb=br;function Rb(t){return(Rb="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 Ob(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Ab(t,n,e){return(Ab="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,n,e){t=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=Db(t)););return t}(t,n);if(t){n=Object.getOwnPropertyDescriptor(t,n);return n.get?n.get.call(e):n.value}})(t,n,e||t)}function Cb(t,n){return(Cb=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function kb(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Db(e);return t=i?(t=Db(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Rb(t)&&"function"!=typeof t?Pb(n):t}}function Pb(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Db(t){return(Db=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}pr=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Cb(t,n)}(r,Xg);var t,n,e,i=kb(r);function r(t){var n;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(n=i.call(this,t)).Yn=Di.EXTRUDE_MARKER,n.Pa=void 0!==t.opacity?t.opacity:1,n.Ja=void 0!==t.color?t.color:"#FF0000",n.wl=void 0!==t.extrudeHeight?t.extrudeHeight:1,n.bf=n.wl,n.Pf=void 0!==t.points?Object.assign(t.points):[],n.Pf.constructor===Array&&(xg.polygonArea(n.Pf)<0&&n.Pf.reverse(),xg.closedPoints(n.Pf)),n.xl=new Lb({lineType:t.edgeMode,lineColor:void 0!==t.edgeColor?t.edgeColor:n.Ja,lineAlpha:void 0!==t.edgeOpacity?t.edgeOpacity:n.Pa}),n.xl.K=Pb(n),n}return t=r,(n=[{key:"bound",get:function(){return!0===this.needUpdateBound&&(this.wr.reset(),this.wr.expandByCoords(this.Pf),this.needUpdateBound=!1),this.wr.clone()}},{key:"x",get:function(){return this.I}},{key:"y",get:function(){return this.N}},{key:"color",get:function(){return this.Ja},set:function(t){this.Ja!==t&&(this.Ja=t,this.Ml())}},{key:"opacity",get:function(){return this.Pa},set:function(t){this.Pa!==t&&(this.Pa=t,this.Ml())}},{key:"edgeColor",get:function(){return this.xl.Qa},set:function(t){this.xl.lineColor=t}},{key:"edgeOpacity",get:function(){return this.xl._l},set:function(t){this.xl.lineAlpha=t}},{key:"extrudeHeight",get:function(){return this.wl},set:function(t){this.wl!==t&&(this.wl=t,this.Dn.scale.setZ(this.wl/this.bf))}},{key:"dispose",value:function(){this.xl&&this.xl.dispose(),Ab(Db(r.prototype),"dispose",this).call(this)}}])&&Ob(t.prototype,n),e&&Ob(t,e),r}();Object.assign(pr.prototype,{bs:function(){var t=this.la(Bg);if(!t)return!1;var n=t.Zt,e=this.la(um),i=new ci(t.getX(),t.getY()),r=uy.createShape(this.Pf,i),o={depth:this.bf},o=uy.createExtrudeBufferGeometry(r,o),e=n.Jn.Qo(this.Ja,this.Pa*e.Pa);return this.Dn=new Uo(o,e),(this.Dn.mapNode=this).Dn.rotation.set(-Math.PI/2,0,0,"XYZ"),this.Dn.position.set(0,this.Wt,0),this.xl.$f===_b.TOP?this.Sl(i):this.xl.$f===_b.ALL&&this.hu(o),this.kh=!0,t.enableUpdateRender(),this.kh},Sl:function(t){t=new Jm(uy.createShape(this.Pf,t));this.hu(t),this.xl.Dn.position.setZ(this.bf),t.dispose()},hu:function(t){this.xl.vl(t),this.Dn.add(this.xl.Dn)},Ml:function(){var t,n=this.la(Bg);n&&(t=this.la(um),this.Dn.material=n.Zt.Jn.Qo(this.Ja,this.Pa*t.Pa),n.enableUpdateRender())},Ca:function(){this.Ml(),this.xl.Ca()},af:function(){this.Dn.position.set(0,this.Wt,0),this.la(Bg).enableUpdateRender()}});di=pr;function jb(t){return(jb="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 Ib(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Nb(t,n,e){return(Nb="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,n,e){t=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=Bb(t)););return t}(t,n);if(t){n=Object.getOwnPropertyDescriptor(t,n);return n.get?n.get.call(e):n.value}})(t,n,e||t)}function Fb(t,n){return(Fb=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Ub(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=Bb(e);return t=i?(t=Bb(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==jb(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(n):t}}function Bb(t){return(Bb=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}Li=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Fb(t,n)}(r,Xg);var t,n,e,i=Ub(r);function r(t,n){var e;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(e=i.call(this,n=n||{})).Yn=Di.HEAT_MAP_MARKER,e.V=t,e.Pa=n.opacity?255*n.opacity:25500,e.Qf=void 0!==n.radius?n.radius:30,e.El=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.El.min>=e.El.max&&(e.El={max:100,min:0}),e.Tl=void 0!==n.quality?n.quality:1024,e.Nh=void 0===n.isPlane||n.isPlane,e.Ll=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.Rl=Math.ceil(+e.Qf),e.Ol=15e3,e.Pf=[],e.Al=e.Cl(),e.kl=document.createElement("canvas"),e.kl.width=e.Al.width,e.kl.height=e.Al.height,e.Pl=e.kl.getContext("2d"),e.Dl=null,e.Uh=null,e}return t=r,(n=[{key:"bound",get:function(){var t,n;return!0===this.needUpdateBound&&null!==this.Dl&&(this.wr.reset(),t=this.Dl.getLayers(Di.MODEL_LAYER)[0],!1===this.Nh?(n=this.Dl.getLayers(Di.EXTENT_LAYER)[0],t&&this.wr.expand(t.bound),n&&this.wr.expand(n.bound)):t&&this.wr.expand(t.bound),this.needUpdateBound=!1),this.wr.clone()}},{key:"x",get:function(){return this.I}},{key:"y",get:function(){return this.N}},{key:"opacity",get:function(){return this.Pa/255},set:function(t){this.Pa=255*t}},{key:"simulate",value:function(t){this.jl();for(var n=0;n<t;n++){var e=Math.floor(Math.random()*this.Al.width+1),i=Math.floor(Math.random()*this.Al.height+1),r=Math.floor(Math.random()*(this.El.max-this.El.min)+1);this.Il(e,i,r)}this.Nl()}},{key:"clearDataSource",value:function(){this.Pf=[],this.jl()}},{key:"addPoint",value:function(t,n,e){if(t&&n&&e){n=this.Fl(t,n);if(n){this.jl();for(var i=0;i<this.Pf.length;i++)this.Il(this.Pf[i][0],this.Pf[i][1],this.Pf[i][2],!0);this.Il(n.x,n.y,e,!1),this.Nl()}}}},{key:"addDataSource",value:function(t){this.jl();for(var n=0;n<this.Pf.length;n++)this.Il(this.Pf[n][0],this.Pf[n][1],this.Pf[n][2],!0);for(var e=0;e<t.length;e++){var i=this.Fl(t[e].x,t[e].y);if(!i)return!0;this.Il(i.x,i.y,t[e].value,!1)}this.Nl()}},{key:"update",value:function(){var t;this.Uh=new xr(this.kl),this.Nh?(t=this.Dn.material.map,this.Dn.material.map=this.Uh,this.Dn.material.map.needsUpdate=!0,this.Dn.material.needsUpdate=!0,t.dispose()):this.K.Fh(this.Uh),this.V.enableUpdateRender()}},{key:"addTo",value:function(t){this.Dl=t,Nb(Bb(r.prototype),"addTo",this).call(this,t),this.needUpdateBound=!0}},{key:"dispose",value:function(){Nb(Bb(r.prototype),"dispose",this).call(this),this.Dl=null,this.Uh&&this.Uh.dispose(),this.Uh=null}}])&&Ib(t.prototype,n),e&&Ib(t,e),r}();Object.assign(Li.prototype,{bs:function(){var n=this;if(this.kh)return this.kh;var t,e,i=this.Dl.getExtendMesh();return i&&(this.Uh=new xr(this.kl),this.Nh?(e=i.userData,i.userData={},t=i.clone(),i.userData=e,t.name="heatMap",t.scale.z=.001,t.position.y+=this.Wt,(e=new wo(16777215)).opacity=1,e.transparent=!0,e.map=this.Uh,e.map.needsUpdate=!0,e.depthTest=!1,e.needsUpdate=!0,t.material=e,this.Dn=t,(this.Dn.mapNode=this).kh=!0):(this.kh=!0,this.Dl.getModelMeshs().forEach(function(t){t||(n.kh=!1)}))),this.la(Bg).enableUpdateRender(),this.kh},af:function(){this.Dn.position.y=this.Wt,this.la(Bg).enableUpdateRender()},Fl:function(t,n){var e=this.V.getBound(),e={x:(t-e.min.x)/(e.max.x-e.min.x),y:(e.max.y-n)/(e.max.y-e.min.y)};return e.x=e.x*this.Al.width,e.y=e.y*this.Al.height,e},Ul:function(t,n,e){this.Pf.push([t,n,e])},jl:function(){this.Pl.clearRect(0,0,this.Al.width,this.Al.height)},Nl:function(){for(var t=this.Pl.getImageData(0,0,this.Al.width,this.Al.height),n=t.data,e=this.Bl(),i=3;i<n.length;i+=4){var r=n[i],o=4*r;o&&(o=Math.floor(o),(r=this.Pa<r?this.Pa:r)<.8&&(r=.8),n[i-3]=e[o],n[i-2]=e[o+1],n[i-1]=e[o+2],n[i]=r)}this.Pl.putImageData(t,0,0)},Bl:function(){var t=document.createElement("canvas"),n=t.getContext("2d");t.width=1,t.height=256;var e,i=n.createLinearGradient(0,0,1,256);for(e in this.Ll)i.addColorStop(e,this.Ll[e]);return n.fillStyle=i,n.fillRect(0,0,1,256),n.getImageData(0,0,1,256).data},Il:function(t,n,e,i){var r=this.Pl,o=parseFloat(e/(this.El.max-this.El.min),10);r.save(),r.shadowColor="rgba(0, 0, 0, "+o+")",r.shadowOffsetX=this.Ol,r.shadowOffsetY=this.Ol,r.shadowBlur=this.Rl,r.beginPath(),r.arc(t-this.Ol,n-this.Ol,this.Qf,0,2*Math.PI,!0),r.closePath(),r.fill(),r.restore(),i||this.Ul(t,n,e)},Gl:function(){var t,n=[];return void 0!==window.screen.deviceXDPI?(n[0]=window.screen.deviceXDPI,n[1]=window.screen.deviceYDPI):((t=document.createElement("DIV")).style.cssText="width:1in;height:1in;position:absolute;left:0px;top:0px;z-index:99;visibility:hidden",document.body.appendChild(t),n[0]=parseInt(t.offsetWidth),n[1]=parseInt(t.offsetHeight),t.parentNode.removeChild(t)),n},Cl:function(){var t=this.V.getBound(),n=t.max.x-t.min.x,t=t.max.y-t.min.y,n={width:Math.round(n),height:Math.round(t)},t=this.Gl();n.width=parseInt(n.width*t[0]/25.4),n.height=parseInt(n.height*t[1]/25.4);t=1;return(n.width>=this.Tl||n.height>=this.Tl)&&(n.width>=n.height?(t=n.height/n.width,n.width=this.Tl,n.height=parseInt(this.Tl*t)):(t=n.width/n.height,n.height=this.Tl,n.width=parseInt(this.Tl*t))),n}});e=Li;function Gb(t){return(Gb="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 Hb(t,n){var e;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(e=function(t,n){if(t){if("string"==typeof t)return Vb(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(e="Object"===e&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Vb(t,n):void 0}}(t))||n&&t&&"number"==typeof t.length){e&&(t=e);var i=0,n=function(){};return{s:n,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o=!0,s=!1;return{s:function(){e=t[Symbol.iterator]()},n:function(){var t=e.next();return o=t.done,t},e:function(t){s=!0,r=t},f:function(){try{o||null==e.return||e.return()}finally{if(s)throw r}}}}function Vb(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 zb(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Wb(t,n,e){return(Wb="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,n,e){t=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=qb(t)););return t}(t,n);if(t){n=Object.getOwnPropertyDescriptor(t,n);return n.get?n.get.call(e):n.value}})(t,n,e||t)}function Xb(t,n){return(Xb=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Zb(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=qb(e);return t=i?(t=qb(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Gb(t)&&"function"!=typeof t?Yb(n):t}}function Yb(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function qb(t){return(qb=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}br=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Xb(t,n)}(r,Xg);var t,n,e,i=Zb(r);function r(t){var n;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(n=i.call(this,t)).Yn=Di.DYNAMIC_MODEL_MARKER,n.ie=void 0!==t.id?t.id:Mt.generateUUID(),n.Hl=void 0!==t.fadeIn&&t.fadeIn,n.Bh=void 0!==t.fadeOut&&t.fadeOut,n.Pa=void 0!==t.opacity?t.opacity:null,n.Vl=void 0!==t.scale?t.scale:1,n.Ta=t.url,n.ru=t.heading,n.st=t.callback,n.zl=new Map,n.zl.set(n.ROOT,t.color),n.Eu=null,n.fh=[],n.St=null,n.Mh=n.Mh.bind(Yb(n)),n}return t=r,(n=[{key:"bound",get:function(){return!0===this.needUpdateBound&&(this.wr.reset(),void 0!==this.I&&void 0!==this.N&&(this.wr.expandByCoords([{x:this.I,y:this.N}]),this.needUpdateBound=!1)),this.wr.clone()}},{key:"color",get:function(){return this.getModelColor()},set:function(t){this.modifyModelColor(t)}},{key:"scale",get:function(){return this.Vl},set:function(t){this.Vl=t,this.wu()}},{key:"heading",get:function(){return this.ru}},{key:"opacity",get:function(){return this.Pa},set:function(t){this.Pa=t,this.Ca()}},{key:"modifyModelColor",value:function(t,n){n=n||this.ROOT,this.zl.set(n,t),this.Ca()}},{key:"getModelColor",value:function(t){return t=t||this.ROOT,this.zl.get(t)}},{key:"moveTo",value:function(t){var n=this,e=void 0!==t.animate&&t.animate,i=t.duration||.5,r=this.la(Bg);if(r)return e?(this.St||(this.St=new Ri),this.St.ft([this.I,this.N]),this.St.lt([t.x,t.y]),this.St.dt(i).pt(function(t){n.I=t.destination[0],n.N=t.destination[1],n.af(),r.enableUpdateRender()}).mt(function(){n.I=t.x,n.N=t.y,n.af(),r.enableUpdateRender(),t.finish&&t.finish()}),r.ln.dn(this.St.ht())):(this.I=t.x,this.N=t.y,this.af(),r.enableUpdateRender()),this.St}},{key:"stop",value:function(){var t;!this.St||(t=this.la(Bg))&&(t.ln.cn(this.St),this.St=null)}},{key:"rotateTo",value:function(t){var n=this,e=this.la(Bg);if(!e)return!1;var i,r,o=t.heading%360*vi.DEG2RAD;return t.animate?(i=t.duration||.5,r=this.Dn.rotation.y,this.bl||(this.bl=new Ri),this.bl.ft([r]).lt([o]).dt(i).pt(function(t){n.Dn.rotation.y=t.destination[0],n.ru=t.destination[0]*vi.RAD2DEG,e.enableUpdateRender()}).mt(function(){n.Dn.rotation.y=o,n.ru=o*vi.RAD2DEG,e.enableUpdateRender(),t.finish&&t.finish()}),e.ln.dn(this.bl.ht())):(this.Dn.rotation.y=o,this.ru=t.heading,e.enableUpdateRender()),this.bl}},{key:"startAction",value:function(t,n){t=this.fh[t];t&&(n&&(t.clampWhenFinished=!0,t.loop=2200),t.reset().setEffectiveTimeScale(1).setEffectiveWeight(1).play());t=this.la(Bg);t&&t.on("beforeRender",this.Mh)}},{key:"getAction",value:function(){return this.fh}},{key:"getClip",value:function(t){return this.fh[t].Tu}},{key:"getMixer",value:function(){return this.Eu}},{key:"stopAction",value:function(t){var n=this.la(Bg);n&&n.off("beforeRender",this.Mh);t=this.fh[t];t&&t.stop()}},{key:"getActionNames",value:function(){return Object.keys(this.fh)}},{key:"remove",value:function(){this.stop(),Wb(qb(r.prototype),"remove",this).call(this)}},{key:"dispose",value:function(){this.remove(),this.Dn&&(this.Dn.mapNode=void 0,this.Dn=void 0),this.kh=!1}},{key:"getRenderNode",value:function(){return this.Dn}}])&&zb(t.prototype,n),e&&zb(t,e),r}();Object.assign(br.prototype,{ROOT:"root",bs:function(){var r=this;if(!this.kh){var o=this.la(Bg);return o?(this.kh=!0,o.Zt.uc.Jr(this.Ta,function(t){if(r.kh){if(r.Dn=t.scene,r.ru&&(r.Dn.rotation.y=r.ru%360*vi.DEG2RAD),r.wu(),(r.Dn.mapNode=r).K.ci.add(r.Dn),0<t.animations.length){r.Eu=new _v(r.Dn);var n,e=Hb(t.animations);try{for(e.s();!(n=e.n()).done;){var i=n.value;r.fh[i.name]=r.Eu.clipAction(i)}}catch(t){e.e(t)}finally{e.f()}o.ln.Rh(r.Eu)}r.Ca(),r.af(),r.Hl&&r.Wl(),o.enableUpdateRender(),r.st&&r.st(r)}},function(){}),!0):!1}},Wl:function(){var i=this.la(Bg);i&&this.Dn.traverse(function(t){var n,e;t instanceof Uo&&(t.material.transparent=!0,i.getMapOptions().materialMode===Qi.REAL?(t.material.uniforms.opacity.value=0,n=setInterval(function(){t.material.uniforms.opacity.value<1?(t.material.uniforms.opacity.value+=.05,i.enableUpdateRender()):clearInterval(n)},200)):(t.material.opacity=0,e=setInterval(function(){t.material.opacity<1?(t.material.opacity+=.05,i.enableUpdateRender()):clearInterval(e)},200)))})},wu:function(){if(this.Dn){var t=this.la(Bg);if(!t)return!1;this.Dn.scale.copy(this.Dn.userData.sourceScale).multiplyScalar(this.Vl),t.enableUpdateRender()}},af:function(){if(this.Dn){var t=this.la(Bg);if(!t)return!1;this.Dn.position.set(this.I-t.getX(),this.Wt,-this.N+t.getY()),this.needUpdateBound=!0,t.enableUpdateRender()}},Ca:function(){var r,o,t,s=this;this.Dn&&(r=this.la(Bg),o=this.la(um),t=this.zl.get(this.ROOT),this.Xl(this.Dn,t,function(t,n){var e=s.qn(t.material,o,{color:n});if(r.jt.materialMode===Qi.REAL){n=r.Zt.Jn.Kn(e);n.userData=t.material.userData,t.material=n}else if(Array.isArray(t.material.length))for(var i=0;i<t.material.length;i++)t.material[i].depthWrite=!0,t.material[i]=r.Zt.Jn.Qn(t.material[i],e);else t.material.depthWrite=!0,t.material=r.Zt.Jn.Qn(t.material,e)}),r.enableUpdateRender())},Xl:function(t,n,e){var i=this.zl.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.Xl(t.children[r],n,e)},qn:function(t,n,e){var i={};return this.la(Bg).jt.materialMode===Qi.REAL?t.constructor===nr?(t.userData.sourceOpacity=t.opacity,t.userData.sourceTransparent=t.transparent,i={USE_EMISSIVEMAP:!!t.emissiveMap,USE_MAP:!!t.map,map:t.map,emissive:t.emissive.getHex(),color:t.color.getHex(),emissiveMap:t.emissiveMap,metalness:t.metalness,roughness:t.roughness,normalScale:t.normalScale,vertexColors:t.vertexColors,side:t.side,skinning:t.skinning}):t.constructor===mr&&(i={USE_EMISSIVEMAP:t.defines.USE_EMISSIVEMAP,USE_MAP:t.defines.USE_MAP,map:t.uniforms.map.value,color:t.uniforms.diffuse.value.getHex(),emissive:t.uniforms.emissive.value.getHex(),emissiveMap:t.uniforms.emissiveMap.value,metalness:t.uniforms.metalness.value,roughness:t.uniforms.roughness.value,normalScale:t.uniforms.normalScale.value,vertexColors:t.vertexColors,side:t.side,skinning:t.skinning}):(t.userData.sourceOpacity||(t.userData.sourceOpacity=t.opacity),t.userData.sourceTransparent||(t.userData.sourceTransparent=t.transparent)),e.color&&(i.color=e.color),i.opacity=null!==this.Pa?this.Pa*n.Pa:void 0!==t.userData.sourceOpacity?t.userData.sourceOpacity*n.Pa:t.opacity*n.Pa,i.transparent=t.userData.sourceTransparent||i.opacity<1,i},Mh:function(){var t=this.la(Bg);t&&t.enableUpdateRender()}});pr=br;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){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Qb(t,n){return(Qb=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function $b(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,n=n_(e);return t=i?(t=n_(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments),n=this,!(t=t)||"object"!==Kb(t)&&"function"!=typeof t?t_(n):t}}function t_(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function n_(t){return(n_=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}Li=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&Qb(t,n)}(r,Xg);var t,n,e,i=$b(r);function r(t){var n;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),(n=i.call(this,t)).ie=null,n.Yn=Di.DOM_MARKER,n.Zl=void 0!==t.fontsize?t.fontsize:16,n.Yl=t.content,n.ql=void 0!==t.domWidth?t.domWidth:30,n.Kl=void 0!==t.domHeight?t.domHeight:30,n.Jl=void 0!==t.anchor?t.anchor:Ai.CENTER,n.Pa=void 0!==t.opacity?t.opacity:1,n.Ri=void 0!==t.collision&&t.collision,n.Dn=null,n.kh=!1,n.Lt=null,n.Dl=null,n.St=null,n.Ql=null,n.$l=n.$l.bind(t_(n)),n.td=null,n.bs(),n}return t=r,(n=[{key:"bound",get:function(){return!0===this.needUpdateBound&&(this.wr.reset(),void 0!==this.I&&void 0!==this.N&&(this.wr.expandByCoords([{x:this.I,y:this.N}]),this.needUpdateBound=!1)),this.wr.clone()}},{key:"content",get:function(){return this.Yl},set:function(t){this.Yl=t;this.nd();this.Dn.element.childNodes[0].innerHTML=""+this.Yl}},{key:"visible",get:function(){return this.Ti},set:function(t){this.Ti=t,this.Dn&&(this.Ti?this.Dn.element.childNodes[0].style.display="block":this.Dn.element.childNodes[0].style.display="none");t=this.K;t&&t.nf()}},{key:"opacity",get:function(){return this.Pa},set:function(t){this.Pa=t,this.Dn.element.childNodes[0].style.opacity=this.Pa}},{key:"level",get:function(){return this.Lt}},{key:"moveTo",value:function(t){var n=this,e=void 0!==t.animate&&t.animate,i=t.duration||.5;if(e){e=this.K.K;if(e)return this.St||(this.St=new Ri),this.St.ft([this.I,this.N]),this.St.lt([t.x,t.y]),this.St.dt(i).pt(function(t){n.I=t.destination[0],n.N=t.destination[1],n.af()}).mt(function(){n.I=t.x,n.N=t.y,n.af(),t.finish&&t.finish()}),e.ln.dn(this.St.ht()),this.St}else this.I=t.x,this.N=t.y,this.af()}},{key:"stop",value:function(){var t=this.K.K;t&&this.St&&(t.ln.cn(this.St),this.St=null)}},{key:"remove",value:function(){this.stop(),this.td.remove(this),this.K&&this.K.remove(this),this.Dn.parent.remove(this.Dn),this.K=void 0}},{key:"addTo",value:function(t){var n=t.K.K;null===n.df.Jc&&n.df.bs(),this.Lt=t.level,this.Dl=t,this.Dn.position.set(this.I-n.getX(),t.height+this.Wt,-this.N+n.getY()),t.level!==n.getLevel()&&(n.df.sf(this.Lt)?this.Dn.element.childNodes[0].style.opacity=t.Pa:this.Dn.element.childNodes[0].style.display="none"),n.df.add(this),this.td=t.getOrCreateLayer(this.Yn),this.td.add(this)}},{key:"dispose",value:function(){this.remove(),this.Dn&&(this.Dn.mapNode=void 0,this.Dn=void 0),this.kh=!1}}])&&Jb(t.prototype,n),e&&Jb(t,e),r}();Object.assign(Li.prototype,{bs:function(){var t=document.createElement("div"),n=this.nd();t.innerHTML='<div style="position:absolute;pointer-events:all;width:'+this.ql+"px;height:"+this.Kl+"px;font-size:"+this.Zl+"px;opacity:"+this.Pa+";top:"+n.top+";left:"+n.left+'">'+this.Yl+"</div>";t=new rp(t);return this.Dn=t,(this.Dn.mapNode=this).kh=!0,this.ie=this.Dn.uuid,!0},af:function(){var t=this.K.K;this.Dn.position.set(this.I-t.getX(),this.Dl.height+this.Wt,-this.N+t.getY()),this.needUpdateBound=!0},nd:function(){var t,n;switch(this.Jl){case Ai.CENTER:t=-this.ql/2,n=-this.Kl/2;break;case Ai.RIGHT_BOTTOM:t=-this.ql,n=-this.Kl;break;case Ai.LEFT_BOTTOM:t=0,n=-this.Kl;break;case Ai.RIGHT_TOP:t=-this.ql,n=0;break;case Ai.LEFT_TOP:n=t=0;break;case Ai.RIGHT:t=-this.ql,n=-this.Kl/2;break;case Ai.LEFT:t=0,n=-this.Kl/2;break;case Ai.BOTTOM:t=-this.ql/2,n=-this.Kl;break;case Ai.TOP:t=-this.ql/2,n=0}return this.Ql={left:t,top:n},{left:t+"px",top:n+"px"}},uf:function(){var t=this.K.K;if(!this.Ql)return null;var n=t.camera;this.Dn.updateMatrixWorld(!0);var e=(new St).setFromMatrixPosition(this.Dn.matrixWorld).applyMatrix4(n.matrixWorldInverse).applyMatrix4(n.projectionMatrix),i=t.an.renderer.domElement.clientWidth,n=t.an.renderer.domElement.clientHeight,t=e.x,e=e.y;return{leftTop:new ci(t-this.ql/i,e+this.Kl/n),rightDown:new ci(t+this.ql/i,e-this.Kl/n)}},$l:function(t){var n,e=this.K.K,i={};for(n in t)i[n]=t[n];i.offsetX=t.clientX,i.offsetY=t.clientY,e.Fn.st(i)}});br=Li;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,i.key,i)}}Li=function(){function n(t){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,n),this.ed=t.origon,this.Ia=t.target,this.rd=null,this.od=null,this.sd=null,this.ad=null,this.ud=null,this.hd=null,this.cd=null,this.fd=null,this.bs()}var t,e,i;return t=n,(e=[{key:"transform",value:function(t){var n=t.x-this.rd.x,e=t.y-this.rd.y,t=this.od.x*n+this.od.y*e,e=this.sd.x*n+this.sd.y*e,t=t/this.ad.x,e=e/this.ad.y,t=t*this.fd.x,e=e*this.fd.y;return{x:this.ud.x+this.hd.x*t+this.cd.x*e,y:this.ud.y+this.hd.y*t+this.cd.y*e}}}])&&e_(t.prototype,e),i&&e_(t,i),n}();Object.assign(Li.prototype,{bs:function(){!Array.isArray(this.ed)||!Array.isArray(this.Ia)||this.ed.length<3||this.Ia.length<3||(this.rd=this.ed[0],this.od={x:this.ed[1].x-this.ed[0].x,y:this.ed[1].y-this.ed[0].y},this.sd={x:this.ed[2].x-this.ed[0].x,y:this.ed[2].y-this.ed[0].y},this.ad={x:du.ze(this.od),y:du.ze(this.sd)},this.ud=this.Ia[0],this.hd={x:this.Ia[1].x-this.Ia[0].x,y:this.Ia[1].y-this.Ia[0].y},this.cd={x:this.Ia[2].x-this.Ia[0].x,y:this.Ia[2].y-this.Ia[0].y},this.fd={x:du.ze(this.hd),y:du.ze(this.cd)},this.od.x/=this.ad.x,this.od.y/=this.ad.x,this.sd.x/=this.ad.y,this.sd.y/=this.ad.y,this.hd.x/=this.fd.x,this.hd.y/=this.fd.x,this.cd.x/=this.fd.y,this.cd.y/=this.fd.y)}});var i_,r_={VERSION:a,BUILD:h,FMMap:Bg,FMType:Di,FMViewMode:mi,FMShadingMode:Qi,FMInfoMode:Vu,FMTextAlign:uc,FMLineType:Wy,FMLabelField:Nd,FMMarkerAnchor:Ai,FMEdgeMode:_b,FMUtil:_g,FMCalculator:Hl,FMCoordsTransformer:Li,FMImageMarker:Fi,FMTextMarker:Ji,FMPolygonMarker:pi,FMLocationMarker:Oi,FMHeatMap:e,FMDynamicModel:pr,FMLineMarker:nb,FMDomMarker:br,FMExtrudeMarker:di,FMSegment:zy,FMMarkerLayer:Xv,FMBound:Nh},di=Hu.a.global(),o_=void 0!==di?di.fengmap:{};for(i_ in null==o_&&(o_={}),r_)o_[i_]=r_[i_];void 0!==di&&(di.fengmap=o_);n.default=o_}],f={},g.m=d,g.c=f,g.d=function(t,n,e){g.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:e})},g.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"ld",{value:!0})},g.t=function(n,t){if(1&t&&(n=g(n)),8&t)return n;if(4&t&&"object"==typeof n&&n&&n.ld)return n;var e=Object.create(null);if(g.r(e),Object.defineProperty(e,"default",{enumerable:!0,value:n}),2&t&&"string"!=typeof n)for(var i in n)g.d(e,i,function(t){return n[t]}.bind(null,i));return e},g.n=function(t){var n=t&&t.ld?function(){return t.default}:function(){return t};return g.d(n,"a",n),n},g.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},g.p="",g(g.s=42).default;function g(t){if(f[t])return f[t].exports;var n=f[t]={i:t,l:!1,exports:{}};return d[t].call(n.exports,n,n.exports,g),n.l=!0,n.exports}var d,f});