mxdraw 0.0.7 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -15
- package/dist/lib/MxModule/McEdGetPointWorldDrawObjectClass/McEdGetPointWorldDrawObjectClass.js +95 -0
- package/dist/lib/MxModule/McEdGetPointWorldDrawObjectClass/McEdGetPointWorldDrawObjectClass.js.map +1 -0
- package/dist/lib/MxModule/McEdGetPointWorldDrawObjectClass/index.js +3 -91
- package/dist/lib/MxModule/McEdGetPointWorldDrawObjectClass/index.js.map +1 -1
- package/dist/lib/MxModule/MrxDbgUiPrBaseReturn/MrxDbgUiPrBaseReturn.js +32 -0
- package/dist/lib/MxModule/MrxDbgUiPrBaseReturn/MrxDbgUiPrBaseReturn.js.map +1 -0
- package/dist/lib/MxModule/MrxDbgUiPrBaseReturn/index.js +3 -12
- package/dist/lib/MxModule/MrxDbgUiPrBaseReturn/index.js.map +1 -1
- package/dist/lib/MxModule/MrxDbgUiPrPointClass/MrxDbgUiPrPointClass.js +135 -0
- package/dist/lib/MxModule/MrxDbgUiPrPointClass/MrxDbgUiPrPointClass.js.map +1 -0
- package/dist/lib/MxModule/MrxDbgUiPrPointClass/index.js +3 -147
- package/dist/lib/MxModule/MrxDbgUiPrPointClass/index.js.map +1 -1
- package/dist/lib/MxModule/MxDrawObject/MxDrawObject.js +260 -0
- package/dist/lib/MxModule/MxDrawObject/MxDrawObject.js.map +1 -0
- package/dist/lib/MxModule/MxDrawObject/index.js +3 -256
- package/dist/lib/MxModule/MxDrawObject/index.js.map +1 -1
- package/dist/lib/MxModule/MxFun/MxFun.js +34 -32
- package/dist/lib/MxModule/MxFun/MxFun.js.map +1 -1
- package/dist/lib/MxModule/MxFun/index.js +5 -5
- package/dist/lib/MxModule/MxFun/index.js.map +1 -1
- package/dist/lib/MxModule/MxThreeJS/MxThreeJS.js +133 -18
- package/dist/lib/MxModule/MxThreeJS/MxThreeJS.js.map +1 -1
- package/dist/lib/MxModule/store/{pubsub.js → PubsubClass.js} +7 -4
- package/dist/lib/MxModule/store/PubsubClass.js.map +1 -0
- package/dist/lib/MxModule/store/StoreClass.js +74 -0
- package/dist/lib/MxModule/store/StoreClass.js.map +1 -0
- package/dist/lib/MxModule/store/index.js +3 -2
- package/dist/lib/MxModule/store/index.js.map +1 -1
- package/dist/lib/MxModule/store/store.js +23 -70
- package/dist/lib/MxModule/store/store.js.map +1 -1
- package/dist/lib/MxModule/useCanvasResizeListener/index.js +3 -33
- package/dist/lib/MxModule/useCanvasResizeListener/index.js.map +1 -1
- package/dist/lib/MxModule/useCanvasResizeListener/useCanvasResizeListener.js +36 -0
- package/dist/lib/MxModule/useCanvasResizeListener/useCanvasResizeListener.js.map +1 -0
- package/dist/lib/MxModule/useCoreCode/index.js +3 -79
- package/dist/lib/MxModule/useCoreCode/index.js.map +1 -1
- package/dist/lib/MxModule/useCoreCode/useCoreCode.js +101 -0
- package/dist/lib/MxModule/useCoreCode/useCoreCode.js.map +1 -0
- package/dist/lib/doc.js +17 -16
- package/dist/lib/doc.js.map +1 -1
- package/dist/lib/mxdraw.js +2 -3
- package/dist/lib/mxdraw.js.map +1 -1
- package/dist/mxdraw.es5.js +2 -3
- package/dist/mxdraw.es5.js.map +1 -1
- package/dist/mxdraw.umd.js +13 -14
- package/dist/mxdraw.umd.js.map +1 -1
- package/dist/types/MxModule/McEdGetPointWorldDrawObjectClass/McEdGetPointWorldDrawObjectClass.d.ts +72 -0
- package/dist/types/MxModule/McEdGetPointWorldDrawObjectClass/index.d.ts +3 -71
- package/dist/types/MxModule/MrxDbgUiPrBaseReturn/MrxDbgUiPrBaseReturn.d.ts +28 -0
- package/dist/types/MxModule/MrxDbgUiPrBaseReturn/index.d.ts +2 -10
- package/dist/types/MxModule/MrxDbgUiPrPointClass/MrxDbgUiPrPointClass.d.ts +95 -0
- package/dist/types/MxModule/MrxDbgUiPrPointClass/index.d.ts +3 -110
- package/dist/types/MxModule/MxDrawObject/MxDrawObject.d.ts +215 -0
- package/dist/types/MxModule/MxDrawObject/index.d.ts +3 -214
- package/dist/types/MxModule/MxFun/MxFun.d.ts +1 -5
- package/dist/types/MxModule/MxThreeJS/MxThreeJS.d.ts +3 -1
- package/dist/types/MxModule/store/{pubsub.d.ts → PubsubClass.d.ts} +1 -1
- package/dist/types/MxModule/store/StoreClass.d.ts +27 -0
- package/dist/types/MxModule/store/index.d.ts +3 -1
- package/dist/types/MxModule/store/store.d.ts +9 -27
- package/dist/types/MxModule/useCanvasResizeListener/index.d.ts +3 -7
- package/dist/types/MxModule/useCanvasResizeListener/useCanvasResizeListener.d.ts +7 -0
- package/dist/types/MxModule/useCoreCode/index.d.ts +3 -4
- package/dist/types/MxModule/useCoreCode/useCoreCode.d.ts +9 -0
- package/dist/types/doc.d.ts +9 -6
- package/dist/types/mxdraw.d.ts +4 -3
- package/package.json +1 -1
- package/dist/lib/MxModule/store/_index.js +0 -27
- package/dist/lib/MxModule/store/_index.js.map +0 -1
- package/dist/lib/MxModule/store/pubsub.js.map +0 -1
- package/dist/static/mxfun.es5.js +0 -3
- package/dist/static/mxfun.min.js +0 -1
- package/dist/static/mxfun.umd.js +0 -13
- package/dist/types/MxModule/store/_index.d.ts +0 -9
package/dist/static/mxfun.umd.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
|
3
|
-
typeof define === 'function' && define.amd ? define(factory) :
|
|
4
|
-
(global.mx = factory());
|
|
5
|
-
}(this, (function () { 'use strict';
|
|
6
|
-
|
|
7
|
-
return function () {
|
|
8
|
-
!function a(o,s,l){function c(e,t){if(!s[e]){if(!o[e]){var n="function"==typeof require&&require;if(!t&&n)return n(e,!0);if(u)return u(e,!0);var i=new Error("Cannot find module '"+e+"'");throw i.code="MODULE_NOT_FOUND",i}var r=s[e]={exports:{}};o[e][0].call(r.exports,function(t){return c(o[e][1][t]||t)},r,r.exports,a,o,s,l)}return s[e].exports}for(var u="function"==typeof require&&require,t=0;t<l.length;t++)c(l[t]);return c}({1:[function(t,e,n){"use strict";var i={};(0,t("./lib/utils/common").assign)(i,t("./lib/deflate"),t("./lib/inflate"),t("./lib/zlib/constants")),e.exports=i},{"./lib/deflate":2,"./lib/inflate":3,"./lib/utils/common":4,"./lib/zlib/constants":7}],2:[function(t,e,n){"use strict";var o=t("./zlib/deflate"),s=t("./utils/common"),l=t("./utils/strings"),r=t("./zlib/messages"),a=t("./zlib/zstream"),c=Object.prototype.toString,u=0,h=-1,d=0,p=8;function f(t){if(!(this instanceof f))return new f(t);this.options=s.assign({level:h,method:p,chunkSize:16384,windowBits:15,memLevel:8,strategy:d,to:""},t||{});var e=this.options;e.raw&&0<e.windowBits?e.windowBits=-e.windowBits:e.gzip&&0<e.windowBits&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new a,this.strm.avail_out=0;var n=o.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(n!==u)throw new Error(r[n]);if(e.header&&o.deflateSetHeader(this.strm,e.header),e.dictionary){var i;if(i="string"==typeof e.dictionary?l.string2buf(e.dictionary):"[object ArrayBuffer]"===c.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,(n=o.deflateSetDictionary(this.strm,i))!==u)throw new Error(r[n]);this._dict_set=!0}}function i(t,e){var n=new f(e);if(n.push(t,!0),n.err)throw n.msg||r[n.err];return n.result}f.prototype.push=function(t,e){var n,i,r=this.strm,a=this.options.chunkSize;if(this.ended)return!1;i=e===~~e?e:!0===e?4:0,"string"==typeof t?r.input=l.string2buf(t):"[object ArrayBuffer]"===c.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;do{if(0===r.avail_out&&(r.output=new s.Buf8(a),r.next_out=0,r.avail_out=a),1!==(n=o.deflate(r,i))&&n!==u)return this.onEnd(n),!(this.ended=!0);0!==r.avail_out&&(0!==r.avail_in||4!==i&&2!==i)||("string"===this.options.to?this.onData(l.buf2binstring(s.shrinkBuf(r.output,r.next_out))):this.onData(s.shrinkBuf(r.output,r.next_out)))}while((0<r.avail_in||0===r.avail_out)&&1!==n);return 4===i?(n=o.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===u):2!==i||(this.onEnd(u),!(r.avail_out=0))},f.prototype.onData=function(t){this.chunks.push(t)},f.prototype.onEnd=function(t){t===u&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},n.Deflate=f,n.deflate=i,n.deflateRaw=function(t,e){return(e=e||{}).raw=!0,i(t,e)},n.gzip=function(t,e){return(e=e||{}).gzip=!0,i(t,e)}},{"./utils/common":4,"./utils/strings":5,"./zlib/deflate":9,"./zlib/messages":14,"./zlib/zstream":16}],3:[function(t,e,n){"use strict";var h=t("./zlib/inflate"),d=t("./utils/common"),p=t("./utils/strings"),f=t("./zlib/constants"),i=t("./zlib/messages"),r=t("./zlib/zstream"),a=t("./zlib/gzheader"),m=Object.prototype.toString;function o(t){if(!(this instanceof o))return new o(t);this.options=d.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&0<=e.windowBits&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(0<=e.windowBits&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),15<e.windowBits&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new r,this.strm.avail_out=0;var n=h.inflateInit2(this.strm,e.windowBits);if(n!==f.Z_OK)throw new Error(i[n]);if(this.header=new a,h.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=p.string2buf(e.dictionary):"[object ArrayBuffer]"===m.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(n=h.inflateSetDictionary(this.strm,e.dictionary))!==f.Z_OK))throw new Error(i[n])}function s(t,e){var n=new o(e);if(n.push(t,!0),n.err)throw n.msg||i[n.err];return n.result}o.prototype.push=function(t,e){var n,i,r,a,o,s=this.strm,l=this.options.chunkSize,c=this.options.dictionary,u=!1;if(this.ended)return!1;i=e===~~e?e:!0===e?f.Z_FINISH:f.Z_NO_FLUSH,"string"==typeof t?s.input=p.binstring2buf(t):"[object ArrayBuffer]"===m.call(t)?s.input=new Uint8Array(t):s.input=t,s.next_in=0,s.avail_in=s.input.length;do{if(0===s.avail_out&&(s.output=new d.Buf8(l),s.next_out=0,s.avail_out=l),(n=h.inflate(s,f.Z_NO_FLUSH))===f.Z_NEED_DICT&&c&&(n=h.inflateSetDictionary(this.strm,c)),n===f.Z_BUF_ERROR&&!0===u&&(n=f.Z_OK,u=!1),n!==f.Z_STREAM_END&&n!==f.Z_OK)return this.onEnd(n),!(this.ended=!0);s.next_out&&(0!==s.avail_out&&n!==f.Z_STREAM_END&&(0!==s.avail_in||i!==f.Z_FINISH&&i!==f.Z_SYNC_FLUSH)||("string"===this.options.to?(r=p.utf8border(s.output,s.next_out),a=s.next_out-r,o=p.buf2string(s.output,r),s.next_out=a,s.avail_out=l-a,a&&d.arraySet(s.output,s.output,r,a,0),this.onData(o)):this.onData(d.shrinkBuf(s.output,s.next_out)))),0===s.avail_in&&0===s.avail_out&&(u=!0)}while((0<s.avail_in||0===s.avail_out)&&n!==f.Z_STREAM_END);return n===f.Z_STREAM_END&&(i=f.Z_FINISH),i===f.Z_FINISH?(n=h.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===f.Z_OK):i!==f.Z_SYNC_FLUSH||(this.onEnd(f.Z_OK),!(s.avail_out=0))},o.prototype.onData=function(t){this.chunks.push(t)},o.prototype.onEnd=function(t){t===f.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=d.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},n.Inflate=o,n.inflate=s,n.inflateRaw=function(t,e){return(e=e||{}).raw=!0,s(t,e)},n.ungzip=s},{"./utils/common":4,"./utils/strings":5,"./zlib/constants":7,"./zlib/gzheader":10,"./zlib/inflate":12,"./zlib/messages":14,"./zlib/zstream":16}],4:[function(t,e,n){"use strict";var i="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;n.assign=function(t){for(var e,n,i=Array.prototype.slice.call(arguments,1);i.length;){var r=i.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(var a in r)e=r,n=a,Object.prototype.hasOwnProperty.call(e,n)&&(t[a]=r[a])}}return t},n.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var r={arraySet:function(t,e,n,i,r){if(e.subarray&&t.subarray)t.set(e.subarray(n,n+i),r);else for(var a=0;a<i;a++)t[r+a]=e[n+a]},flattenChunks:function(t){var e,n,i,r,a,o;for(e=i=0,n=t.length;e<n;e++)i+=t[e].length;for(o=new Uint8Array(i),e=r=0,n=t.length;e<n;e++)a=t[e],o.set(a,r),r+=a.length;return o}},a={arraySet:function(t,e,n,i,r){for(var a=0;a<i;a++)t[r+a]=e[n+a]},flattenChunks:function(t){return[].concat.apply([],t)}};n.setTyped=function(t){t?(n.Buf8=Uint8Array,n.Buf16=Uint16Array,n.Buf32=Int32Array,n.assign(n,r)):(n.Buf8=Array,n.Buf16=Array,n.Buf32=Array,n.assign(n,a))},n.setTyped(i)},{}],5:[function(t,e,n){"use strict";var l=t("./common"),r=!0,a=!0;try{String.fromCharCode.apply(null,[0])}catch(t){r=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){a=!1}for(var c=new l.Buf8(256),i=0;i<256;i++)c[i]=252<=i?6:248<=i?5:240<=i?4:224<=i?3:192<=i?2:1;function u(t,e){if(e<65534&&(t.subarray&&a||!t.subarray&&r))return String.fromCharCode.apply(null,l.shrinkBuf(t,e));for(var n="",i=0;i<e;i++)n+=String.fromCharCode(t[i]);return n}c[254]=c[254]=1,n.string2buf=function(t){var e,n,i,r,a,o=t.length,s=0;for(r=0;r<o;r++)55296==(64512&(n=t.charCodeAt(r)))&&r+1<o&&56320==(64512&(i=t.charCodeAt(r+1)))&&(n=65536+(n-55296<<10)+(i-56320),r++),s+=n<128?1:n<2048?2:n<65536?3:4;for(e=new l.Buf8(s),r=a=0;a<s;r++)55296==(64512&(n=t.charCodeAt(r)))&&r+1<o&&56320==(64512&(i=t.charCodeAt(r+1)))&&(n=65536+(n-55296<<10)+(i-56320),r++),n<128?e[a++]=n:(n<2048?e[a++]=192|n>>>6:(n<65536?e[a++]=224|n>>>12:(e[a++]=240|n>>>18,e[a++]=128|n>>>12&63),e[a++]=128|n>>>6&63),e[a++]=128|63&n);return e},n.buf2binstring=function(t){return u(t,t.length)},n.binstring2buf=function(t){for(var e=new l.Buf8(t.length),n=0,i=e.length;n<i;n++)e[n]=t.charCodeAt(n);return e},n.buf2string=function(t,e){var n,i,r,a,o=e||t.length,s=new Array(2*o);for(n=i=0;n<o;)if((r=t[n++])<128)s[i++]=r;else if(4<(a=c[r]))s[i++]=65533,n+=a-1;else{for(r&=2===a?31:3===a?15:7;1<a&&n<o;)r=r<<6|63&t[n++],a--;1<a?s[i++]=65533:r<65536?s[i++]=r:(r-=65536,s[i++]=55296|r>>10&1023,s[i++]=56320|1023&r)}return u(s,i)},n.utf8border=function(t,e){var n;for((e=e||t.length)>t.length&&(e=t.length),n=e-1;0<=n&&128==(192&t[n]);)n--;return!(n<0)&&0!==n&&n+c[t[n]]>e?n:e}},{"./common":4}],6:[function(t,e,n){"use strict";e.exports=function(t,e,n,i){for(var r=65535&t|0,a=t>>>16&65535|0,o=0;0!==n;){for(n-=o=2e3<n?2e3:n;a=a+(r=r+e[i++]|0)|0,--o;);r%=65521,a%=65521}return r|a<<16|0}},{}],7:[function(t,e,n){"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],8:[function(t,e,n){"use strict";var s=function(){for(var t,e=[],n=0;n<256;n++){t=n;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;e[n]=t}return e}();e.exports=function(t,e,n,i){var r=s,a=i+n;t^=-1;for(var o=i;o<a;o++)t=t>>>8^r[255&(t^e[o])];return-1^t}},{}],9:[function(t,e,n){"use strict";var l,d=t("../utils/common"),c=t("./trees"),p=t("./adler32"),f=t("./crc32"),i=t("./messages"),u=0,h=4,m=0,g=-2,v=-1,y=4,r=2,x=8,_=9,a=286,o=30,s=19,w=2*a+1,b=15,M=3,S=258,C=S+M+1,T=42,E=113,A=1,D=2,L=3,O=4;function I(t,e){return t.msg=i[e],e}function P(t){return(t<<1)-(4<t?9:0)}function R(t){for(var e=t.length;0<=--e;)t[e]=0}function k(t){var e=t.state,n=e.pending;n>t.avail_out&&(n=t.avail_out),0!==n&&(d.arraySet(t.output,e.pending_buf,e.pending_out,n,t.next_out),t.next_out+=n,e.pending_out+=n,t.total_out+=n,t.avail_out-=n,e.pending-=n,0===e.pending&&(e.pending_out=0))}function N(t,e){c._tr_flush_block(t,0<=t.block_start?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,k(t.strm)}function B(t,e){t.pending_buf[t.pending++]=e}function F(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function z(t,e){var n,i,r=t.max_chain_length,a=t.strstart,o=t.prev_length,s=t.nice_match,l=t.strstart>t.w_size-C?t.strstart-(t.w_size-C):0,c=t.window,u=t.w_mask,h=t.prev,d=t.strstart+S,p=c[a+o-1],f=c[a+o];t.prev_length>=t.good_match&&(r>>=2),s>t.lookahead&&(s=t.lookahead);do{if(c[(n=e)+o]===f&&c[n+o-1]===p&&c[n]===c[a]&&c[++n]===c[a+1]){a+=2,n++;do{}while(c[++a]===c[++n]&&c[++a]===c[++n]&&c[++a]===c[++n]&&c[++a]===c[++n]&&c[++a]===c[++n]&&c[++a]===c[++n]&&c[++a]===c[++n]&&c[++a]===c[++n]&&a<d);if(i=S-(d-a),a=d-S,o<i){if(t.match_start=e,s<=(o=i))break;p=c[a+o-1],f=c[a+o]}}}while((e=h[e&u])>l&&0!=--r);return o<=t.lookahead?o:t.lookahead}function V(t){var e,n,i,r,a,o,s,l,c,u,h=t.w_size;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=h+(h-C)){for(d.arraySet(t.window,t.window,h,h,0),t.match_start-=h,t.strstart-=h,t.block_start-=h,e=n=t.hash_size;i=t.head[--e],t.head[e]=h<=i?i-h:0,--n;);for(e=n=h;i=t.prev[--e],t.prev[e]=h<=i?i-h:0,--n;);r+=h}if(0===t.strm.avail_in)break;if(o=t.strm,s=t.window,l=t.strstart+t.lookahead,c=r,u=void 0,u=o.avail_in,c<u&&(u=c),n=0===u?0:(o.avail_in-=u,d.arraySet(s,o.input,o.next_in,u,l),1===o.state.wrap?o.adler=p(o.adler,s,u,l):2===o.state.wrap&&(o.adler=f(o.adler,s,u,l)),o.next_in+=u,o.total_in+=u,u),t.lookahead+=n,t.lookahead+t.insert>=M)for(a=t.strstart-t.insert,t.ins_h=t.window[a],t.ins_h=(t.ins_h<<t.hash_shift^t.window[a+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[a+M-1])&t.hash_mask,t.prev[a&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=a,a++,t.insert--,!(t.lookahead+t.insert<M)););}while(t.lookahead<C&&0!==t.strm.avail_in)}function U(t,e){for(var n,i;;){if(t.lookahead<C){if(V(t),t.lookahead<C&&e===u)return A;if(0===t.lookahead)break}if(n=0,t.lookahead>=M&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+M-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==n&&t.strstart-n<=t.w_size-C&&(t.match_length=z(t,n)),t.match_length>=M)if(i=c._tr_tally(t,t.strstart-t.match_start,t.match_length-M),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=M){for(t.match_length--;t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+M-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart,0!=--t.match_length;);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+1])&t.hash_mask;else i=c._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(i&&(N(t,!1),0===t.strm.avail_out))return A}return t.insert=t.strstart<M-1?t.strstart:M-1,e===h?(N(t,!0),0===t.strm.avail_out?L:O):t.last_lit&&(N(t,!1),0===t.strm.avail_out)?A:D}function j(t,e){for(var n,i,r;;){if(t.lookahead<C){if(V(t),t.lookahead<C&&e===u)return A;if(0===t.lookahead)break}if(n=0,t.lookahead>=M&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+M-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=M-1,0!==n&&t.prev_length<t.max_lazy_match&&t.strstart-n<=t.w_size-C&&(t.match_length=z(t,n),t.match_length<=5&&(1===t.strategy||t.match_length===M&&4096<t.strstart-t.match_start)&&(t.match_length=M-1)),t.prev_length>=M&&t.match_length<=t.prev_length){for(r=t.strstart+t.lookahead-M,i=c._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-M),t.lookahead-=t.prev_length-1,t.prev_length-=2;++t.strstart<=r&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+M-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!=--t.prev_length;);if(t.match_available=0,t.match_length=M-1,t.strstart++,i&&(N(t,!1),0===t.strm.avail_out))return A}else if(t.match_available){if((i=c._tr_tally(t,0,t.window[t.strstart-1]))&&N(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return A}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(i=c._tr_tally(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<M-1?t.strstart:M-1,e===h?(N(t,!0),0===t.strm.avail_out?L:O):t.last_lit&&(N(t,!1),0===t.strm.avail_out)?A:D}function G(t,e,n,i,r){this.good_length=t,this.max_lazy=e,this.nice_length=n,this.max_chain=i,this.func=r}function H(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=x,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new d.Buf16(2*w),this.dyn_dtree=new d.Buf16(2*(2*o+1)),this.bl_tree=new d.Buf16(2*(2*s+1)),R(this.dyn_ltree),R(this.dyn_dtree),R(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new d.Buf16(b+1),this.heap=new d.Buf16(2*a+1),R(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new d.Buf16(2*a+1),R(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function W(t){var e;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=r,(e=t.state).pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?T:E,t.adler=2===e.wrap?0:1,e.last_flush=u,c._tr_init(e),m):I(t,g)}function J(t){var e,n=W(t);return n===m&&((e=t.state).window_size=2*e.w_size,R(e.head),e.max_lazy_match=l[e.level].max_lazy,e.good_match=l[e.level].good_length,e.nice_match=l[e.level].nice_length,e.max_chain_length=l[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=M-1,e.match_available=0,e.ins_h=0),n}function q(t,e,n,i,r,a){if(!t)return g;var o=1;if(e===v&&(e=6),i<0?(o=0,i=-i):15<i&&(o=2,i-=16),r<1||_<r||n!==x||i<8||15<i||e<0||9<e||a<0||y<a)return I(t,g);8===i&&(i=9);var s=new H;return(t.state=s).strm=t,s.wrap=o,s.gzhead=null,s.w_bits=i,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=r+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+M-1)/M),s.window=new d.Buf8(2*s.w_size),s.head=new d.Buf16(s.hash_size),s.prev=new d.Buf16(s.w_size),s.lit_bufsize=1<<r+6,s.pending_buf_size=4*s.lit_bufsize,s.pending_buf=new d.Buf8(s.pending_buf_size),s.d_buf=+s.lit_bufsize,s.l_buf=3*s.lit_bufsize,s.level=e,s.strategy=a,s.method=n,J(t)}l=[new G(0,0,0,0,function(t,e){var n=65535;for(n>t.pending_buf_size-5&&(n=t.pending_buf_size-5);;){if(t.lookahead<=1){if(V(t),0===t.lookahead&&e===u)return A;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var i=t.block_start+n;if((0===t.strstart||t.strstart>=i)&&(t.lookahead=t.strstart-i,t.strstart=i,N(t,!1),0===t.strm.avail_out))return A;if(t.strstart-t.block_start>=t.w_size-C&&(N(t,!1),0===t.strm.avail_out))return A}return t.insert=0,e===h?(N(t,!0),0===t.strm.avail_out?L:O):(t.strstart>t.block_start&&(N(t,!1),t.strm.avail_out),A)}),new G(4,4,8,4,U),new G(4,5,16,8,U),new G(4,6,32,32,U),new G(4,4,16,16,j),new G(8,16,32,32,j),new G(8,16,128,128,j),new G(8,32,128,256,j),new G(32,128,258,1024,j),new G(32,258,258,4096,j)],n.deflateInit=function(t,e){return q(t,e,x,15,8,0)},n.deflateInit2=q,n.deflateReset=J,n.deflateResetKeep=W,n.deflateSetHeader=function(t,e){return!t||!t.state||2!==t.state.wrap?g:(t.state.gzhead=e,m)},n.deflate=function(t,e){var n,i,r,a;if(!t||!t.state||5<e||e<0)return t?I(t,g):g;if(i=t.state,!t.output||!t.input&&0!==t.avail_in||666===i.status&&e!==h)return I(t,0===t.avail_out?-5:g);if(i.strm=t,n=i.last_flush,i.last_flush=e,i.status===T)if(2===i.wrap)t.adler=0,B(i,31),B(i,139),B(i,8),i.gzhead?(B(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),B(i,255&i.gzhead.time),B(i,i.gzhead.time>>8&255),B(i,i.gzhead.time>>16&255),B(i,i.gzhead.time>>24&255),B(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),B(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(B(i,255&i.gzhead.extra.length),B(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(t.adler=f(t.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(B(i,0),B(i,0),B(i,0),B(i,0),B(i,0),B(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),B(i,3),i.status=E);else{var o=x+(i.w_bits-8<<4)<<8;o|=(2<=i.strategy||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(o|=32),o+=31-o%31,i.status=E,F(i,o),0!==i.strstart&&(F(i,t.adler>>>16),F(i,65535&t.adler)),t.adler=1}if(69===i.status)if(i.gzhead.extra){for(r=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>r&&(t.adler=f(t.adler,i.pending_buf,i.pending-r,r)),k(t),r=i.pending,i.pending!==i.pending_buf_size));)B(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>r&&(t.adler=f(t.adler,i.pending_buf,i.pending-r,r)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){r=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>r&&(t.adler=f(t.adler,i.pending_buf,i.pending-r,r)),k(t),r=i.pending,i.pending===i.pending_buf_size)){a=1;break}a=i.gzindex<i.gzhead.name.length?255&i.gzhead.name.charCodeAt(i.gzindex++):0,B(i,a)}while(0!==a);i.gzhead.hcrc&&i.pending>r&&(t.adler=f(t.adler,i.pending_buf,i.pending-r,r)),0===a&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){r=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>r&&(t.adler=f(t.adler,i.pending_buf,i.pending-r,r)),k(t),r=i.pending,i.pending===i.pending_buf_size)){a=1;break}a=i.gzindex<i.gzhead.comment.length?255&i.gzhead.comment.charCodeAt(i.gzindex++):0,B(i,a)}while(0!==a);i.gzhead.hcrc&&i.pending>r&&(t.adler=f(t.adler,i.pending_buf,i.pending-r,r)),0===a&&(i.status=103)}else i.status=103;if(103===i.status&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&k(t),i.pending+2<=i.pending_buf_size&&(B(i,255&t.adler),B(i,t.adler>>8&255),t.adler=0,i.status=E)):i.status=E),0!==i.pending){if(k(t),0===t.avail_out)return i.last_flush=-1,m}else if(0===t.avail_in&&P(e)<=P(n)&&e!==h)return I(t,-5);if(666===i.status&&0!==t.avail_in)return I(t,-5);if(0!==t.avail_in||0!==i.lookahead||e!==u&&666!==i.status){var s=2===i.strategy?function(t,e){for(var n;;){if(0===t.lookahead&&(V(t),0===t.lookahead)){if(e===u)return A;break}if(t.match_length=0,n=c._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,n&&(N(t,!1),0===t.strm.avail_out))return A}return t.insert=0,e===h?(N(t,!0),0===t.strm.avail_out?L:O):t.last_lit&&(N(t,!1),0===t.strm.avail_out)?A:D}(i,e):3===i.strategy?function(t,e){for(var n,i,r,a,o=t.window;;){if(t.lookahead<=S){if(V(t),t.lookahead<=S&&e===u)return A;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=M&&0<t.strstart&&(i=o[r=t.strstart-1])===o[++r]&&i===o[++r]&&i===o[++r]){a=t.strstart+S;do{}while(i===o[++r]&&i===o[++r]&&i===o[++r]&&i===o[++r]&&i===o[++r]&&i===o[++r]&&i===o[++r]&&i===o[++r]&&r<a);t.match_length=S-(a-r),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=M?(n=c._tr_tally(t,1,t.match_length-M),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(n=c._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),n&&(N(t,!1),0===t.strm.avail_out))return A}return t.insert=0,e===h?(N(t,!0),0===t.strm.avail_out?L:O):t.last_lit&&(N(t,!1),0===t.strm.avail_out)?A:D}(i,e):l[i.level].func(i,e);if(s!==L&&s!==O||(i.status=666),s===A||s===L)return 0===t.avail_out&&(i.last_flush=-1),m;if(s===D&&(1===e?c._tr_align(i):5!==e&&(c._tr_stored_block(i,0,0,!1),3===e&&(R(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),k(t),0===t.avail_out))return i.last_flush=-1,m}return e!==h?m:i.wrap<=0?1:(2===i.wrap?(B(i,255&t.adler),B(i,t.adler>>8&255),B(i,t.adler>>16&255),B(i,t.adler>>24&255),B(i,255&t.total_in),B(i,t.total_in>>8&255),B(i,t.total_in>>16&255),B(i,t.total_in>>24&255)):(F(i,t.adler>>>16),F(i,65535&t.adler)),k(t),0<i.wrap&&(i.wrap=-i.wrap),0!==i.pending?m:1)},n.deflateEnd=function(t){var e;return t&&t.state?(e=t.state.status)!==T&&69!==e&&73!==e&&91!==e&&103!==e&&e!==E&&666!==e?I(t,g):(t.state=null,e===E?I(t,-3):m):g},n.deflateSetDictionary=function(t,e){var n,i,r,a,o,s,l,c,u=e.length;if(!t||!t.state)return g;if(2===(a=(n=t.state).wrap)||1===a&&n.status!==T||n.lookahead)return g;for(1===a&&(t.adler=p(t.adler,e,u,0)),n.wrap=0,u>=n.w_size&&(0===a&&(R(n.head),n.strstart=0,n.block_start=0,n.insert=0),c=new d.Buf8(n.w_size),d.arraySet(c,e,u-n.w_size,n.w_size,0),e=c,u=n.w_size),o=t.avail_in,s=t.next_in,l=t.input,t.avail_in=u,t.next_in=0,t.input=e,V(n);n.lookahead>=M;){for(i=n.strstart,r=n.lookahead-(M-1);n.ins_h=(n.ins_h<<n.hash_shift^n.window[i+M-1])&n.hash_mask,n.prev[i&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=i,i++,--r;);n.strstart=i,n.lookahead=M-1,V(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=M-1,n.match_available=0,t.next_in=s,t.input=l,t.avail_in=o,n.wrap=a,m},n.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":4,"./adler32":6,"./crc32":8,"./messages":14,"./trees":15}],10:[function(t,e,n){"use strict";e.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],11:[function(t,e,n){"use strict";e.exports=function(t,e){var n,i,r,a,o,s,l,c,u,h,d,p,f,m,g,v,y,x,_,w,b,M,S,C,T;n=t.state,i=t.next_in,C=t.input,r=i+(t.avail_in-5),a=t.next_out,T=t.output,o=a-(e-t.avail_out),s=a+(t.avail_out-257),l=n.dmax,c=n.wsize,u=n.whave,h=n.wnext,d=n.window,p=n.hold,f=n.bits,m=n.lencode,g=n.distcode,v=(1<<n.lenbits)-1,y=(1<<n.distbits)-1;t:do{f<15&&(p+=C[i++]<<f,f+=8,p+=C[i++]<<f,f+=8),x=m[p&v];e:for(;;){if(p>>>=_=x>>>24,f-=_,0===(_=x>>>16&255))T[a++]=65535&x;else{if(!(16&_)){if(0==(64&_)){x=m[(65535&x)+(p&(1<<_)-1)];continue e}if(32&_){n.mode=12;break t}t.msg="invalid literal/length code",n.mode=30;break t}w=65535&x,(_&=15)&&(f<_&&(p+=C[i++]<<f,f+=8),w+=p&(1<<_)-1,p>>>=_,f-=_),f<15&&(p+=C[i++]<<f,f+=8,p+=C[i++]<<f,f+=8),x=g[p&y];n:for(;;){if(p>>>=_=x>>>24,f-=_,!(16&(_=x>>>16&255))){if(0==(64&_)){x=g[(65535&x)+(p&(1<<_)-1)];continue n}t.msg="invalid distance code",n.mode=30;break t}if(b=65535&x,f<(_&=15)&&(p+=C[i++]<<f,(f+=8)<_&&(p+=C[i++]<<f,f+=8)),l<(b+=p&(1<<_)-1)){t.msg="invalid distance too far back",n.mode=30;break t}if(p>>>=_,f-=_,(_=a-o)<b){if(u<(_=b-_)&&n.sane){t.msg="invalid distance too far back",n.mode=30;break t}if(S=d,(M=0)===h){if(M+=c-_,_<w){for(w-=_;T[a++]=d[M++],--_;);M=a-b,S=T}}else if(h<_){if(M+=c+h-_,(_-=h)<w){for(w-=_;T[a++]=d[M++],--_;);if(M=0,h<w){for(w-=_=h;T[a++]=d[M++],--_;);M=a-b,S=T}}}else if(M+=h-_,_<w){for(w-=_;T[a++]=d[M++],--_;);M=a-b,S=T}for(;2<w;)T[a++]=S[M++],T[a++]=S[M++],T[a++]=S[M++],w-=3;w&&(T[a++]=S[M++],1<w&&(T[a++]=S[M++]))}else{for(M=a-b;T[a++]=T[M++],T[a++]=T[M++],T[a++]=T[M++],2<(w-=3););w&&(T[a++]=T[M++],1<w&&(T[a++]=T[M++]))}break}}break}}while(i<r&&a<s);i-=w=f>>3,p&=(1<<(f-=w<<3))-1,t.next_in=i,t.next_out=a,t.avail_in=i<r?r-i+5:5-(i-r),t.avail_out=a<s?s-a+257:257-(a-s),n.hold=p,n.bits=f}},{}],12:[function(t,e,n){"use strict";var D=t("../utils/common"),L=t("./adler32"),O=t("./crc32"),I=t("./inffast"),P=t("./inftrees"),R=1,k=2,N=0,B=-2,F=1,i=852,r=592;function z(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function a(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new D.Buf16(320),this.work=new D.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function o(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=F,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new D.Buf32(i),e.distcode=e.distdyn=new D.Buf32(r),e.sane=1,e.back=-1,N):B}function s(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,o(t)):B}function l(t,e){var n,i;return t&&t.state?(i=t.state,e<0?(n=0,e=-e):(n=1+(e>>4),e<48&&(e&=15)),e&&(e<8||15<e)?B:(null!==i.window&&i.wbits!==e&&(i.window=null),i.wrap=n,i.wbits=e,s(t))):B}function c(t,e){var n,i;return t?(i=new a,(t.state=i).window=null,(n=l(t,e))!==N&&(t.state=null),n):B}var u,h,d=!0;function V(t){if(d){var e;for(u=new D.Buf32(512),h=new D.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(P(R,t.lens,0,288,u,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;P(k,t.lens,0,32,h,0,t.work,{bits:5}),d=!1}t.lencode=u,t.lenbits=9,t.distcode=h,t.distbits=5}function U(t,e,n,i){var r,a=t.state;return null===a.window&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new D.Buf8(a.wsize)),i>=a.wsize?(D.arraySet(a.window,e,n-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):(i<(r=a.wsize-a.wnext)&&(r=i),D.arraySet(a.window,e,n-i,r,a.wnext),(i-=r)?(D.arraySet(a.window,e,n-i,i,0),a.wnext=i,a.whave=a.wsize):(a.wnext+=r,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=r))),0}n.inflateReset=s,n.inflateReset2=l,n.inflateResetKeep=o,n.inflateInit=function(t){return c(t,15)},n.inflateInit2=c,n.inflate=function(t,e){var n,i,r,a,o,s,l,c,u,h,d,p,f,m,g,v,y,x,_,w,b,M,S,C,T=0,E=new D.Buf8(4),A=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!t||!t.state||!t.output||!t.input&&0!==t.avail_in)return B;12===(n=t.state).mode&&(n.mode=13),o=t.next_out,r=t.output,l=t.avail_out,a=t.next_in,i=t.input,s=t.avail_in,c=n.hold,u=n.bits,h=s,d=l,M=N;t:for(;;)switch(n.mode){case F:if(0===n.wrap){n.mode=13;break}for(;u<16;){if(0===s)break t;s--,c+=i[a++]<<u,u+=8}if(2&n.wrap&&35615===c){E[n.check=0]=255&c,E[1]=c>>>8&255,n.check=O(n.check,E,2,0),u=c=0,n.mode=2;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&c)<<8)+(c>>8))%31){t.msg="incorrect header check",n.mode=30;break}if(8!=(15&c)){t.msg="unknown compression method",n.mode=30;break}if(u-=4,b=8+(15&(c>>>=4)),0===n.wbits)n.wbits=b;else if(b>n.wbits){t.msg="invalid window size",n.mode=30;break}n.dmax=1<<b,t.adler=n.check=1,n.mode=512&c?10:12,u=c=0;break;case 2:for(;u<16;){if(0===s)break t;s--,c+=i[a++]<<u,u+=8}if(n.flags=c,8!=(255&n.flags)){t.msg="unknown compression method",n.mode=30;break}if(57344&n.flags){t.msg="unknown header flags set",n.mode=30;break}n.head&&(n.head.text=c>>8&1),512&n.flags&&(E[0]=255&c,E[1]=c>>>8&255,n.check=O(n.check,E,2,0)),u=c=0,n.mode=3;case 3:for(;u<32;){if(0===s)break t;s--,c+=i[a++]<<u,u+=8}n.head&&(n.head.time=c),512&n.flags&&(E[0]=255&c,E[1]=c>>>8&255,E[2]=c>>>16&255,E[3]=c>>>24&255,n.check=O(n.check,E,4,0)),u=c=0,n.mode=4;case 4:for(;u<16;){if(0===s)break t;s--,c+=i[a++]<<u,u+=8}n.head&&(n.head.xflags=255&c,n.head.os=c>>8),512&n.flags&&(E[0]=255&c,E[1]=c>>>8&255,n.check=O(n.check,E,2,0)),u=c=0,n.mode=5;case 5:if(1024&n.flags){for(;u<16;){if(0===s)break t;s--,c+=i[a++]<<u,u+=8}n.length=c,n.head&&(n.head.extra_len=c),512&n.flags&&(E[0]=255&c,E[1]=c>>>8&255,n.check=O(n.check,E,2,0)),u=c=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&(s<(p=n.length)&&(p=s),p&&(n.head&&(b=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),D.arraySet(n.head.extra,i,a,p,b)),512&n.flags&&(n.check=O(n.check,i,p,a)),s-=p,a+=p,n.length-=p),n.length))break t;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(0===s)break t;for(p=0;b=i[a+p++],n.head&&b&&n.length<65536&&(n.head.name+=String.fromCharCode(b)),b&&p<s;);if(512&n.flags&&(n.check=O(n.check,i,p,a)),s-=p,a+=p,b)break t}else n.head&&(n.head.name=null);n.length=0,n.mode=8;case 8:if(4096&n.flags){if(0===s)break t;for(p=0;b=i[a+p++],n.head&&b&&n.length<65536&&(n.head.comment+=String.fromCharCode(b)),b&&p<s;);if(512&n.flags&&(n.check=O(n.check,i,p,a)),s-=p,a+=p,b)break t}else n.head&&(n.head.comment=null);n.mode=9;case 9:if(512&n.flags){for(;u<16;){if(0===s)break t;s--,c+=i[a++]<<u,u+=8}if(c!==(65535&n.check)){t.msg="header crc mismatch",n.mode=30;break}u=c=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),t.adler=n.check=0,n.mode=12;break;case 10:for(;u<32;){if(0===s)break t;s--,c+=i[a++]<<u,u+=8}t.adler=n.check=z(c),u=c=0,n.mode=11;case 11:if(0===n.havedict)return t.next_out=o,t.avail_out=l,t.next_in=a,t.avail_in=s,n.hold=c,n.bits=u,2;t.adler=n.check=1,n.mode=12;case 12:if(5===e||6===e)break t;case 13:if(n.last){c>>>=7&u,u-=7&u,n.mode=27;break}for(;u<3;){if(0===s)break t;s--,c+=i[a++]<<u,u+=8}switch(n.last=1&c,--u,3&(c>>>=1)){case 0:n.mode=14;break;case 1:if(V(n),n.mode=20,6!==e)break;c>>>=2,u-=2;break t;case 2:n.mode=17;break;case 3:t.msg="invalid block type",n.mode=30}c>>>=2,u-=2;break;case 14:for(c>>>=7&u,u-=7&u;u<32;){if(0===s)break t;s--,c+=i[a++]<<u,u+=8}if((65535&c)!=(c>>>16^65535)){t.msg="invalid stored block lengths",n.mode=30;break}if(n.length=65535&c,u=c=0,n.mode=15,6===e)break t;case 15:n.mode=16;case 16:if(p=n.length){if(s<p&&(p=s),l<p&&(p=l),0===p)break t;D.arraySet(r,i,a,p,o),s-=p,a+=p,l-=p,o+=p,n.length-=p;break}n.mode=12;break;case 17:for(;u<14;){if(0===s)break t;s--,c+=i[a++]<<u,u+=8}if(n.nlen=257+(31&c),c>>>=5,u-=5,n.ndist=1+(31&c),c>>>=5,u-=5,n.ncode=4+(15&c),c>>>=4,u-=4,286<n.nlen||30<n.ndist){t.msg="too many length or distance symbols",n.mode=30;break}n.have=0,n.mode=18;case 18:for(;n.have<n.ncode;){for(;u<3;){if(0===s)break t;s--,c+=i[a++]<<u,u+=8}n.lens[A[n.have++]]=7&c,c>>>=3,u-=3}for(;n.have<19;)n.lens[A[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,S={bits:n.lenbits},M=P(0,n.lens,0,19,n.lencode,0,n.work,S),n.lenbits=S.bits,M){t.msg="invalid code lengths set",n.mode=30;break}n.have=0,n.mode=19;case 19:for(;n.have<n.nlen+n.ndist;){for(;v=(T=n.lencode[c&(1<<n.lenbits)-1])>>>16&255,y=65535&T,!((g=T>>>24)<=u);){if(0===s)break t;s--,c+=i[a++]<<u,u+=8}if(y<16)c>>>=g,u-=g,n.lens[n.have++]=y;else{if(16===y){for(C=g+2;u<C;){if(0===s)break t;s--,c+=i[a++]<<u,u+=8}if(c>>>=g,u-=g,0===n.have){t.msg="invalid bit length repeat",n.mode=30;break}b=n.lens[n.have-1],p=3+(3&c),c>>>=2,u-=2}else if(17===y){for(C=g+3;u<C;){if(0===s)break t;s--,c+=i[a++]<<u,u+=8}u-=g,b=0,p=3+(7&(c>>>=g)),c>>>=3,u-=3}else{for(C=g+7;u<C;){if(0===s)break t;s--,c+=i[a++]<<u,u+=8}u-=g,b=0,p=11+(127&(c>>>=g)),c>>>=7,u-=7}if(n.have+p>n.nlen+n.ndist){t.msg="invalid bit length repeat",n.mode=30;break}for(;p--;)n.lens[n.have++]=b}}if(30===n.mode)break;if(0===n.lens[256]){t.msg="invalid code -- missing end-of-block",n.mode=30;break}if(n.lenbits=9,S={bits:n.lenbits},M=P(R,n.lens,0,n.nlen,n.lencode,0,n.work,S),n.lenbits=S.bits,M){t.msg="invalid literal/lengths set",n.mode=30;break}if(n.distbits=6,n.distcode=n.distdyn,S={bits:n.distbits},M=P(k,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,S),n.distbits=S.bits,M){t.msg="invalid distances set",n.mode=30;break}if(n.mode=20,6===e)break t;case 20:n.mode=21;case 21:if(6<=s&&258<=l){t.next_out=o,t.avail_out=l,t.next_in=a,t.avail_in=s,n.hold=c,n.bits=u,I(t,d),o=t.next_out,r=t.output,l=t.avail_out,a=t.next_in,i=t.input,s=t.avail_in,c=n.hold,u=n.bits,12===n.mode&&(n.back=-1);break}for(n.back=0;v=(T=n.lencode[c&(1<<n.lenbits)-1])>>>16&255,y=65535&T,!((g=T>>>24)<=u);){if(0===s)break t;s--,c+=i[a++]<<u,u+=8}if(v&&0==(240&v)){for(x=g,_=v,w=y;v=(T=n.lencode[w+((c&(1<<x+_)-1)>>x)])>>>16&255,y=65535&T,!(x+(g=T>>>24)<=u);){if(0===s)break t;s--,c+=i[a++]<<u,u+=8}c>>>=x,u-=x,n.back+=x}if(c>>>=g,u-=g,n.back+=g,n.length=y,0===v){n.mode=26;break}if(32&v){n.back=-1,n.mode=12;break}if(64&v){t.msg="invalid literal/length code",n.mode=30;break}n.extra=15&v,n.mode=22;case 22:if(n.extra){for(C=n.extra;u<C;){if(0===s)break t;s--,c+=i[a++]<<u,u+=8}n.length+=c&(1<<n.extra)-1,c>>>=n.extra,u-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;v=(T=n.distcode[c&(1<<n.distbits)-1])>>>16&255,y=65535&T,!((g=T>>>24)<=u);){if(0===s)break t;s--,c+=i[a++]<<u,u+=8}if(0==(240&v)){for(x=g,_=v,w=y;v=(T=n.distcode[w+((c&(1<<x+_)-1)>>x)])>>>16&255,y=65535&T,!(x+(g=T>>>24)<=u);){if(0===s)break t;s--,c+=i[a++]<<u,u+=8}c>>>=x,u-=x,n.back+=x}if(c>>>=g,u-=g,n.back+=g,64&v){t.msg="invalid distance code",n.mode=30;break}n.offset=y,n.extra=15&v,n.mode=24;case 24:if(n.extra){for(C=n.extra;u<C;){if(0===s)break t;s--,c+=i[a++]<<u,u+=8}n.offset+=c&(1<<n.extra)-1,c>>>=n.extra,u-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){t.msg="invalid distance too far back",n.mode=30;break}n.mode=25;case 25:if(0===l)break t;if(p=d-l,n.offset>p){if((p=n.offset-p)>n.whave&&n.sane){t.msg="invalid distance too far back",n.mode=30;break}f=p>n.wnext?(p-=n.wnext,n.wsize-p):n.wnext-p,p>n.length&&(p=n.length),m=n.window}else m=r,f=o-n.offset,p=n.length;for(l<p&&(p=l),l-=p,n.length-=p;r[o++]=m[f++],--p;);0===n.length&&(n.mode=21);break;case 26:if(0===l)break t;r[o++]=n.length,l--,n.mode=21;break;case 27:if(n.wrap){for(;u<32;){if(0===s)break t;s--,c|=i[a++]<<u,u+=8}if(d-=l,t.total_out+=d,n.total+=d,d&&(t.adler=n.check=(n.flags?O:L)(n.check,r,d,o-d)),d=l,(n.flags?c:z(c))!==n.check){t.msg="incorrect data check",n.mode=30;break}u=c=0}n.mode=28;case 28:if(n.wrap&&n.flags){for(;u<32;){if(0===s)break t;s--,c+=i[a++]<<u,u+=8}if(c!==(4294967295&n.total)){t.msg="incorrect length check",n.mode=30;break}u=c=0}n.mode=29;case 29:M=1;break t;case 30:M=-3;break t;case 31:return-4;case 32:default:return B}return t.next_out=o,t.avail_out=l,t.next_in=a,t.avail_in=s,n.hold=c,n.bits=u,(n.wsize||d!==t.avail_out&&n.mode<30&&(n.mode<27||4!==e))&&U(t,t.output,t.next_out,d-t.avail_out)?(n.mode=31,-4):(h-=t.avail_in,d-=t.avail_out,t.total_in+=h,t.total_out+=d,n.total+=d,n.wrap&&d&&(t.adler=n.check=(n.flags?O:L)(n.check,r,d,t.next_out-d)),t.data_type=n.bits+(n.last?64:0)+(12===n.mode?128:0)+(20===n.mode||15===n.mode?256:0),(0==h&&0===d||4===e)&&M===N&&(M=-5),M)},n.inflateEnd=function(t){if(!t||!t.state)return B;var e=t.state;return e.window&&(e.window=null),t.state=null,N},n.inflateGetHeader=function(t,e){var n;return!t||!t.state||0==(2&(n=t.state).wrap)?B:((n.head=e).done=!1,N)},n.inflateSetDictionary=function(t,e){var n,i=e.length;return!t||!t.state||0!==(n=t.state).wrap&&11!==n.mode?B:11===n.mode&&L(1,e,i,0)!==n.check?-3:U(t,e,i,i)?(n.mode=31,-4):(n.havedict=1,N)},n.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":4,"./adler32":6,"./crc32":8,"./inffast":11,"./inftrees":13}],13:[function(t,e,n){"use strict";var R=t("../utils/common"),k=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],N=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],B=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],F=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];e.exports=function(t,e,n,i,r,a,o,s){var l,c,u,h,d,p,f,m,g,v=s.bits,y=0,x=0,_=0,w=0,b=0,M=0,S=0,C=0,T=0,E=0,A=null,D=0,L=new R.Buf16(16),O=new R.Buf16(16),I=null,P=0;for(y=0;y<=15;y++)L[y]=0;for(x=0;x<i;x++)L[e[n+x]]++;for(b=v,w=15;1<=w&&0===L[w];w--);if(w<b&&(b=w),0===w)return r[a++]=20971520,r[a++]=20971520,s.bits=1,0;for(_=1;_<w&&0===L[_];_++);for(b<_&&(b=_),y=C=1;y<=15;y++)if(C<<=1,(C-=L[y])<0)return-1;if(0<C&&(0===t||1!==w))return-1;for(O[1]=0,y=1;y<15;y++)O[y+1]=O[y]+L[y];for(x=0;x<i;x++)0!==e[n+x]&&(o[O[e[n+x]]++]=x);if(p=0===t?(A=I=o,19):1===t?(A=k,D-=257,I=N,P-=257,256):(A=B,I=F,-1),y=_,d=a,S=x=E=0,u=-1,h=(T=1<<(M=b))-1,1===t&&852<T||2===t&&592<T)return 1;for(;;){for(f=y-S,g=o[x]<p?(m=0,o[x]):o[x]>p?(m=I[P+o[x]],A[D+o[x]]):(m=96,0),l=1<<y-S,_=c=1<<M;r[d+(E>>S)+(c-=l)]=f<<24|m<<16|g|0,0!==c;);for(l=1<<y-1;E&l;)l>>=1;if(0!==l?(E&=l-1,E+=l):E=0,x++,0==--L[y]){if(y===w)break;y=e[n+o[x]]}if(b<y&&(E&h)!==u){for(0===S&&(S=b),d+=_,C=1<<(M=y-S);M+S<w&&!((C-=L[M+S])<=0);)M++,C<<=1;if(T+=1<<M,1===t&&852<T||2===t&&592<T)return 1;r[u=E&h]=b<<24|M<<16|d-a|0}}return 0!==E&&(r[d+E]=y-S<<24|64<<16|0),s.bits=b,0}},{"../utils/common":4}],14:[function(t,e,n){"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],15:[function(t,e,n){"use strict";var l=t("../utils/common"),s=0,c=1;function i(t){for(var e=t.length;0<=--e;)t[e]=0}var u=0,o=29,h=256,d=h+1+o,p=30,f=19,g=2*d+1,v=15,r=16,m=7,y=256,x=16,_=17,w=18,b=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],M=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],S=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],C=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],T=new Array(2*(d+2));i(T);var E=new Array(2*p);i(E);var A=new Array(512);i(A);var D=new Array(256);i(D);var L=new Array(o);i(L);var O,I,P,R=new Array(p);function k(t,e,n,i,r){this.static_tree=t,this.extra_bits=e,this.extra_base=n,this.elems=i,this.max_length=r,this.has_stree=t&&t.length}function a(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function N(t){return t<256?A[t]:A[256+(t>>>7)]}function B(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function F(t,e,n){t.bi_valid>r-n?(t.bi_buf|=e<<t.bi_valid&65535,B(t,t.bi_buf),t.bi_buf=e>>r-t.bi_valid,t.bi_valid+=n-r):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=n)}function z(t,e,n){F(t,n[2*e],n[2*e+1])}function V(t,e){for(var n=0;n|=1&t,t>>>=1,n<<=1,0<--e;);return n>>>1}function U(t,e,n){var i,r,a=new Array(v+1),o=0;for(i=1;i<=v;i++)a[i]=o=o+n[i-1]<<1;for(r=0;r<=e;r++){var s=t[2*r+1];0!==s&&(t[2*r]=V(a[s]++,s))}}function j(t){var e;for(e=0;e<d;e++)t.dyn_ltree[2*e]=0;for(e=0;e<p;e++)t.dyn_dtree[2*e]=0;for(e=0;e<f;e++)t.bl_tree[2*e]=0;t.dyn_ltree[2*y]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function G(t){8<t.bi_valid?B(t,t.bi_buf):0<t.bi_valid&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function H(t,e,n,i){var r=2*e,a=2*n;return t[r]<t[a]||t[r]===t[a]&&i[e]<=i[n]}function W(t,e,n){for(var i=t.heap[n],r=n<<1;r<=t.heap_len&&(r<t.heap_len&&H(e,t.heap[r+1],t.heap[r],t.depth)&&r++,!H(e,i,t.heap[r],t.depth));)t.heap[n]=t.heap[r],n=r,r<<=1;t.heap[n]=i}function J(t,e,n){var i,r,a,o,s=0;if(0!==t.last_lit)for(;i=t.pending_buf[t.d_buf+2*s]<<8|t.pending_buf[t.d_buf+2*s+1],r=t.pending_buf[t.l_buf+s],s++,0===i?z(t,r,e):(z(t,(a=D[r])+h+1,e),0!==(o=b[a])&&F(t,r-=L[a],o),z(t,a=N(--i),n),0!==(o=M[a])&&F(t,i-=R[a],o)),s<t.last_lit;);z(t,y,e)}function q(t,e){var n,i,r,a=e.dyn_tree,o=e.stat_desc.static_tree,s=e.stat_desc.has_stree,l=e.stat_desc.elems,c=-1;for(t.heap_len=0,t.heap_max=g,n=0;n<l;n++)0!==a[2*n]?(t.heap[++t.heap_len]=c=n,t.depth[n]=0):a[2*n+1]=0;for(;t.heap_len<2;)a[2*(r=t.heap[++t.heap_len]=c<2?++c:0)]=1,t.depth[r]=0,t.opt_len--,s&&(t.static_len-=o[2*r+1]);for(e.max_code=c,n=t.heap_len>>1;1<=n;n--)W(t,a,n);for(r=l;n=t.heap[1],t.heap[1]=t.heap[t.heap_len--],W(t,a,1),i=t.heap[1],t.heap[--t.heap_max]=n,t.heap[--t.heap_max]=i,a[2*r]=a[2*n]+a[2*i],t.depth[r]=(t.depth[n]>=t.depth[i]?t.depth[n]:t.depth[i])+1,a[2*n+1]=a[2*i+1]=r,t.heap[1]=r++,W(t,a,1),2<=t.heap_len;);t.heap[--t.heap_max]=t.heap[1],function(t,e){var n,i,r,a,o,s,l=e.dyn_tree,c=e.max_code,u=e.stat_desc.static_tree,h=e.stat_desc.has_stree,d=e.stat_desc.extra_bits,p=e.stat_desc.extra_base,f=e.stat_desc.max_length,m=0;for(a=0;a<=v;a++)t.bl_count[a]=0;for(l[2*t.heap[t.heap_max]+1]=0,n=t.heap_max+1;n<g;n++)f<(a=l[2*l[2*(i=t.heap[n])+1]+1]+1)&&(a=f,m++),l[2*i+1]=a,c<i||(t.bl_count[a]++,o=0,p<=i&&(o=d[i-p]),s=l[2*i],t.opt_len+=s*(a+o),h&&(t.static_len+=s*(u[2*i+1]+o)));if(0!==m){do{for(a=f-1;0===t.bl_count[a];)a--;t.bl_count[a]--,t.bl_count[a+1]+=2,t.bl_count[f]--,m-=2}while(0<m);for(a=f;0!==a;a--)for(i=t.bl_count[a];0!==i;)c<(r=t.heap[--n])||(l[2*r+1]!==a&&(t.opt_len+=(a-l[2*r+1])*l[2*r],l[2*r+1]=a),i--)}}(t,e),U(a,c,t.bl_count)}function X(t,e,n){var i,r,a=-1,o=e[1],s=0,l=7,c=4;for(0===o&&(l=138,c=3),e[2*(n+1)+1]=65535,i=0;i<=n;i++)r=o,o=e[2*(i+1)+1],++s<l&&r===o||(s<c?t.bl_tree[2*r]+=s:0!==r?(r!==a&&t.bl_tree[2*r]++,t.bl_tree[2*x]++):s<=10?t.bl_tree[2*_]++:t.bl_tree[2*w]++,a=r,c=(s=0)===o?(l=138,3):r===o?(l=6,3):(l=7,4))}function Y(t,e,n){var i,r,a=-1,o=e[1],s=0,l=7,c=4;for(0===o&&(l=138,c=3),i=0;i<=n;i++)if(r=o,o=e[2*(i+1)+1],!(++s<l&&r===o)){if(s<c)for(;z(t,r,t.bl_tree),0!=--s;);else 0!==r?(r!==a&&(z(t,r,t.bl_tree),s--),z(t,x,t.bl_tree),F(t,s-3,2)):s<=10?(z(t,_,t.bl_tree),F(t,s-3,3)):(z(t,w,t.bl_tree),F(t,s-11,7));a=r,c=(s=0)===o?(l=138,3):r===o?(l=6,3):(l=7,4)}}i(R);var Z=!1;function $(t,e,n,i){var r,a,o,s;F(t,(u<<1)+(i?1:0),3),a=e,o=n,s=!0,G(r=t),s&&(B(r,o),B(r,~o)),l.arraySet(r.pending_buf,r.window,a,o,r.pending),r.pending+=o}n._tr_init=function(t){Z||(function(){var t,e,n,i,r,a=new Array(v+1);for(i=n=0;i<o-1;i++)for(L[i]=n,t=0;t<1<<b[i];t++)D[n++]=i;for(D[n-1]=i,i=r=0;i<16;i++)for(R[i]=r,t=0;t<1<<M[i];t++)A[r++]=i;for(r>>=7;i<p;i++)for(R[i]=r<<7,t=0;t<1<<M[i]-7;t++)A[256+r++]=i;for(e=0;e<=v;e++)a[e]=0;for(t=0;t<=143;)T[2*t+1]=8,t++,a[8]++;for(;t<=255;)T[2*t+1]=9,t++,a[9]++;for(;t<=279;)T[2*t+1]=7,t++,a[7]++;for(;t<=287;)T[2*t+1]=8,t++,a[8]++;for(U(T,d+1,a),t=0;t<p;t++)E[2*t+1]=5,E[2*t]=V(t,5);O=new k(T,b,h+1,d,v),I=new k(E,M,0,p,v),P=new k(new Array(0),S,0,f,m)}(),Z=!0),t.l_desc=new a(t.dyn_ltree,O),t.d_desc=new a(t.dyn_dtree,I),t.bl_desc=new a(t.bl_tree,P),t.bi_buf=0,t.bi_valid=0,j(t)},n._tr_stored_block=$,n._tr_flush_block=function(t,e,n,i){var r,a,o=0;0<t.level?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,n=4093624447;for(e=0;e<=31;e++,n>>>=1)if(1&n&&0!==t.dyn_ltree[2*e])return s;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return c;for(e=32;e<h;e++)if(0!==t.dyn_ltree[2*e])return c;return s}(t)),q(t,t.l_desc),q(t,t.d_desc),o=function(t){var e;for(X(t,t.dyn_ltree,t.l_desc.max_code),X(t,t.dyn_dtree,t.d_desc.max_code),q(t,t.bl_desc),e=f-1;3<=e&&0===t.bl_tree[2*C[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),r=t.opt_len+3+7>>>3,(a=t.static_len+3+7>>>3)<=r&&(r=a)):r=a=n+5,n+4<=r&&-1!==e?$(t,e,n,i):4===t.strategy||a===r?(F(t,2+(i?1:0),3),J(t,T,E)):(F(t,4+(i?1:0),3),function(t,e,n,i){var r;for(F(t,e-257,5),F(t,n-1,5),F(t,i-4,4),r=0;r<i;r++)F(t,t.bl_tree[2*C[r]+1],3);Y(t,t.dyn_ltree,e-1),Y(t,t.dyn_dtree,n-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,o+1),J(t,t.dyn_ltree,t.dyn_dtree)),j(t),i&&G(t)},n._tr_tally=function(t,e,n){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&n,t.last_lit++,0===e?t.dyn_ltree[2*n]++:(t.matches++,e--,t.dyn_ltree[2*(D[n]+h+1)]++,t.dyn_dtree[2*N(e)]++),t.last_lit===t.lit_bufsize-1},n._tr_align=function(t){var e;F(t,2,3),z(t,y,T),16===(e=t).bi_valid?(B(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):8<=e.bi_valid&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}},{"../utils/common":4}],16:[function(t,e,n){"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],17:[function(t,e,n){var nt=t("three");nt.OrbitControls=function(t,e){var n,i,r,a,o;void 0===e&&console.warn('THREE.OrbitControls: The second parameter "domElement" is now mandatory.'),e===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),this.object=t,this.domElement=e,this.enabled=!0,this.target=new nt.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!1,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.enableKeys=!0,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},this.mouseButtons={LEFT:nt.MOUSE.ROTATE,MIDDLE:nt.MOUSE.DOLLY,RIGHT:nt.MOUSE.PAN},this.touches={ONE:nt.TOUCH.ROTATE,TWO:nt.TOUCH.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=function(){return f.phi},this.getAzimuthalAngle=function(){return f.theta},this.saveState=function(){s.target0.copy(s.target),s.position0.copy(s.object.position),s.zoom0=s.object.zoom},this.reset=function(){s.target.copy(s.target0),s.object.position.copy(s.position0),s.object.zoom=s.zoom0,s.object.updateProjectionMatrix(),s.dispatchEvent(l),s.update(),d=h.NONE},this.update=(n=new nt.Vector3,i=(new nt.Quaternion).setFromUnitVectors(t.up,new nt.Vector3(0,1,0)),r=i.clone().inverse(),a=new nt.Vector3,o=new nt.Quaternion,function(){var t=s.object.position;return n.copy(t).sub(s.target),n.applyQuaternion(i),f.setFromVector3(n),s.autoRotate&&d===h.NONE&&D(2*Math.PI/60/60*s.autoRotateSpeed),s.enableDamping?(f.theta+=m.theta*s.dampingFactor,f.phi+=m.phi*s.dampingFactor):(f.theta+=m.theta,f.phi+=m.phi),f.theta=Math.max(s.minAzimuthAngle,Math.min(s.maxAzimuthAngle,f.theta)),f.phi=Math.max(s.minPolarAngle,Math.min(s.maxPolarAngle,f.phi)),f.makeSafe(),f.radius*=g,f.radius=Math.max(s.minDistance,Math.min(s.maxDistance,f.radius)),!0===s.enableDamping?s.target.addScaledVector(v,s.dampingFactor):s.target.add(v),n.setFromSpherical(f),n.applyQuaternion(r),t.copy(s.target).add(n),s.object.lookAt(s.target),!0===s.enableDamping?(m.theta*=1-s.dampingFactor,m.phi*=1-s.dampingFactor,v.multiplyScalar(1-s.dampingFactor)):(m.set(0,0,0),v.set(0,0,0)),g=1,!(!(y||a.distanceToSquared(s.object.position)>p||8*(1-o.dot(s.object.quaternion))>p)||(s.dispatchEvent(l),a.copy(s.object.position),o.copy(s.object.quaternion),y=!1))}),this.dispose=function(){s.domElement.removeEventListener("contextmenu",et,!1),s.domElement.removeEventListener("mousedown",q,!1),s.domElement.removeEventListener("wheel",Z,!1),s.domElement.removeEventListener("touchstart",K,!1),s.domElement.removeEventListener("touchend",tt,!1),s.domElement.removeEventListener("touchmove",Q,!1),document.removeEventListener("mousemove",X,!1),document.removeEventListener("mouseup",Y,!1),s.domElement.removeEventListener("keydown",$,!1)};var s=this,l={type:"change"},c={type:"start"},u={type:"end"},h={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},d=h.NONE,p=1e-6,f=new nt.Spherical,m=new nt.Spherical,g=1,v=new nt.Vector3,y=!1,x=new nt.Vector2,_=new nt.Vector2,w=new nt.Vector2,b=new nt.Vector2,M=new nt.Vector2,S=new nt.Vector2,C=new nt.Vector2,T=new nt.Vector2,E=new nt.Vector2;function A(){return Math.pow(.95,s.zoomSpeed)}function D(t){m.theta-=t}function L(t){m.phi-=t}var O,I,P,R=(O=new nt.Vector3,function(t,e){O.setFromMatrixColumn(e,0),O.multiplyScalar(-t),v.add(O)}),k=(I=new nt.Vector3,function(t,e){!0===s.screenSpacePanning?I.setFromMatrixColumn(e,1):(I.setFromMatrixColumn(e,0),I.crossVectors(s.object.up,I)),I.multiplyScalar(t),v.add(I)}),N=(P=new nt.Vector3,function(t,e){var n=s.domElement;if(s.object.isPerspectiveCamera){var i=s.object.position;P.copy(i).sub(s.target);var r=P.length();r*=Math.tan(s.object.fov/2*Math.PI/180),R(2*t*r/n.clientHeight,s.object.matrix),k(2*e*r/n.clientHeight,s.object.matrix)}else s.object.isOrthographicCamera?(R(t*(s.object.right-s.object.left)/s.object.zoom/n.clientWidth,s.object.matrix),k(e*(s.object.top-s.object.bottom)/s.object.zoom/n.clientHeight,s.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),s.enablePan=!1)});function B(t){s.object.isPerspectiveCamera?g/=t:s.object.isOrthographicCamera?(s.object.zoom=Math.max(s.minZoom,Math.min(s.maxZoom,s.object.zoom*t)),s.object.updateProjectionMatrix(),y=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),s.enableZoom=!1)}function F(t){s.object.isPerspectiveCamera?g*=t:s.object.isOrthographicCamera?(s.object.zoom=Math.max(s.minZoom,Math.min(s.maxZoom,s.object.zoom/t)),s.object.updateProjectionMatrix(),y=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),s.enableZoom=!1)}function z(t){x.set(t.clientX,t.clientY)}function V(t){b.set(t.clientX,t.clientY)}function U(t){if(1==t.touches.length)x.set(t.touches[0].pageX,t.touches[0].pageY);else{var e=.5*(t.touches[0].pageX+t.touches[1].pageX),n=.5*(t.touches[0].pageY+t.touches[1].pageY);x.set(e,n)}}function j(t){if(1==t.touches.length)b.set(t.touches[0].pageX,t.touches[0].pageY);else{var e=.5*(t.touches[0].pageX+t.touches[1].pageX),n=.5*(t.touches[0].pageY+t.touches[1].pageY);b.set(e,n)}}function G(t){var e=t.touches[0].pageX-t.touches[1].pageX,n=t.touches[0].pageY-t.touches[1].pageY,i=Math.sqrt(e*e+n*n);C.set(0,i)}function H(t){if(1==t.touches.length)_.set(t.touches[0].pageX,t.touches[0].pageY);else{var e=.5*(t.touches[0].pageX+t.touches[1].pageX),n=.5*(t.touches[0].pageY+t.touches[1].pageY);_.set(e,n)}w.subVectors(_,x).multiplyScalar(s.rotateSpeed);var i=s.domElement;D(2*Math.PI*w.x/i.clientHeight),L(2*Math.PI*w.y/i.clientHeight),x.copy(_)}function W(t){if(1==t.touches.length)M.set(t.touches[0].pageX,t.touches[0].pageY);else{var e=.5*(t.touches[0].pageX+t.touches[1].pageX),n=.5*(t.touches[0].pageY+t.touches[1].pageY);M.set(e,n)}S.subVectors(M,b).multiplyScalar(s.panSpeed),N(S.x,S.y),b.copy(M)}function J(t){var e=t.touches[0].pageX-t.touches[1].pageX,n=t.touches[0].pageY-t.touches[1].pageY,i=Math.sqrt(e*e+n*n);T.set(0,i),E.set(0,Math.pow(T.y/C.y,s.zoomSpeed)),B(E.y),C.copy(T)}function q(t){if(!1!==s.enabled){switch(t.preventDefault(),s.domElement.focus?s.domElement.focus():window.focus(),t.button){case 0:switch(s.mouseButtons.LEFT){case nt.MOUSE.ROTATE:if(t.ctrlKey||t.metaKey||t.shiftKey){if(!1===s.enablePan)return;V(t),d=h.PAN}else{if(!1===s.enableRotate)return;z(t),d=h.ROTATE}break;case nt.MOUSE.PAN:if(t.ctrlKey||t.metaKey||t.shiftKey){if(!1===s.enableRotate)return;z(t),d=h.ROTATE}else{if(!1===s.enablePan)return;V(t),d=h.PAN}break;default:d=h.NONE}break;case 1:switch(s.mouseButtons.MIDDLE){case nt.MOUSE.DOLLY:if(!1===s.enableZoom)return;e=t,C.set(e.clientX,e.clientY),d=h.DOLLY;break;case nt.MOUSE.PAN:if(!1===s.enablePan)return;V(t),d=h.PAN;break;default:d=h.NONE}break;case 2:switch(s.mouseButtons.RIGHT){case nt.MOUSE.ROTATE:if(!1===s.enableRotate)return;z(t),d=h.ROTATE;break;case nt.MOUSE.PAN:if(!1===s.enablePan)return;V(t),d=h.PAN;break;default:d=h.NONE}}var e;d!==h.NONE&&(document.addEventListener("mousemove",X,!1),document.addEventListener("mouseup",Y,!1),s.dispatchEvent(c))}}function X(t){var e,n;if(!1!==s.enabled)switch(t.preventDefault(),d){case h.ROTATE:if(!1===s.enableRotate)return;!function(t){_.set(t.clientX,t.clientY),w.subVectors(_,x).multiplyScalar(s.rotateSpeed);var e=s.domElement;D(2*Math.PI*w.x/e.clientHeight),L(2*Math.PI*w.y/e.clientHeight),x.copy(_),s.update()}(t);break;case h.DOLLY:if(!1===s.enableZoom)return;n=t,T.set(n.clientX,n.clientY),E.subVectors(T,C),0<E.y?B(A()):E.y<0&&F(A()),C.copy(T),s.update();break;case h.PAN:if(!1===s.enablePan)return;e=t,M.set(e.clientX,e.clientY),S.subVectors(M,b).multiplyScalar(s.panSpeed),N(S.x,S.y),b.copy(M),s.update()}}function Y(t){!1!==s.enabled&&(document.removeEventListener("mousemove",X,!1),document.removeEventListener("mouseup",Y,!1),s.dispatchEvent(u),d=h.NONE)}function Z(t){var e;!1===s.enabled||!1===s.enableZoom||d!==h.NONE&&d!==h.ROTATE||(t.preventDefault(),t.stopPropagation(),s.dispatchEvent(c),(e=t).deltaY<0?F(A()):0<e.deltaY&&B(A()),s.update(),s.dispatchEvent(u))}function $(t){!1!==s.enabled&&!1!==s.enableKeys&&!1!==s.enablePan&&function(t){var e=!1;switch(t.keyCode){case s.keys.UP:N(0,s.keyPanSpeed),e=!0;break;case s.keys.BOTTOM:N(0,-s.keyPanSpeed),e=!0;break;case s.keys.LEFT:N(s.keyPanSpeed,0),e=!0;break;case s.keys.RIGHT:N(-s.keyPanSpeed,0),e=!0}e&&(t.preventDefault(),s.update())}(t)}function K(t){if(!1!==s.enabled){switch(t.preventDefault(),t.touches.length){case 1:switch(s.touches.ONE){case nt.TOUCH.ROTATE:if(!1===s.enableRotate)return;U(t),d=h.TOUCH_ROTATE;break;case nt.TOUCH.PAN:if(!1===s.enablePan)return;j(t),d=h.TOUCH_PAN;break;default:d=h.NONE}break;case 2:switch(s.touches.TWO){case nt.TOUCH.DOLLY_PAN:if(!1===s.enableZoom&&!1===s.enablePan)return;n=t,s.enableZoom&&G(n),s.enablePan&&j(n),d=h.TOUCH_DOLLY_PAN;break;case nt.TOUCH.DOLLY_ROTATE:if(!1===s.enableZoom&&!1===s.enableRotate)return;e=t,s.enableZoom&&G(e),s.enableRotate&&U(e),d=h.TOUCH_DOLLY_ROTATE;break;default:d=h.NONE}break;default:d=h.NONE}var e,n;d!==h.NONE&&s.dispatchEvent(c)}}function Q(t){var e,n;if(!1!==s.enabled)switch(t.preventDefault(),t.stopPropagation(),d){case h.TOUCH_ROTATE:if(!1===s.enableRotate)return;H(t),s.update();break;case h.TOUCH_PAN:if(!1===s.enablePan)return;W(t),s.update();break;case h.TOUCH_DOLLY_PAN:if(!1===s.enableZoom&&!1===s.enablePan)return;n=t,s.enableZoom&&J(n),s.enablePan&&W(n),s.update();break;case h.TOUCH_DOLLY_ROTATE:if(!1===s.enableZoom&&!1===s.enableRotate)return;e=t,s.enableZoom&&J(e),s.enableRotate&&H(e),s.update();break;default:d=h.NONE}}function tt(t){!1!==s.enabled&&(s.dispatchEvent(u),d=h.NONE)}function et(t){!1!==s.enabled&&t.preventDefault()}s.domElement.addEventListener("contextmenu",et,!1),s.domElement.addEventListener("mousedown",q,!1),s.domElement.addEventListener("wheel",Z,!1),s.domElement.addEventListener("touchstart",K,!1),s.domElement.addEventListener("touchend",tt,!1),s.domElement.addEventListener("touchmove",Q,!1),s.domElement.addEventListener("keydown",$,!1),-1===s.domElement.tabIndex&&(s.domElement.tabIndex=0),this.update()},nt.OrbitControls.prototype=Object.create(nt.EventDispatcher.prototype),nt.OrbitControls.prototype.constructor=nt.OrbitControls,nt.MapControls=function(t,e){nt.OrbitControls.call(this,t,e),this.mouseButtons.LEFT=nt.MOUSE.PAN,this.mouseButtons.RIGHT=nt.MOUSE.ROTATE,this.touches.ONE=nt.TOUCH.PAN,this.touches.TWO=nt.TOUCH.DOLLY_ROTATE},nt.MapControls.prototype=Object.create(nt.EventDispatcher.prototype),nt.MapControls.prototype.constructor=nt.MapControls,void 0!==n&&(void 0!==e&&e.exports&&(n=e.exports={OrbitControls:nt.OrbitControls,MapControls:nt.MapControls}),n.OrbitControls=nt.OrbitControls,n.MapControls=nt.MapControls)},{three:19}],18:[function(i,r,o){(function(){"use strict";var w,b,M,t=void 0!==i,S=this.THREE||t&&i("three");if(!S)throw new Error("MeshLine requires three.js");function e(){this.positions=[],this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[],this.counters=[],this.geometry=new S.BufferGeometry,this.widthCallback=null,this.matrixWorld=new S.Matrix4}function a(t,e,n,i,r){var a;if(t=t.subarray||t.slice?t:t.buffer,n=n.subarray||n.slice?n:n.buffer,t=e?t.subarray?t.subarray(e,r&&e+r):t.slice(e,r&&e+r):t,n.set)n.set(t,i);else for(a=0;a<t.length;a++)n[a+i]=t[a];return n}function n(t){S.ShaderMaterial.call(this,{uniforms:Object.assign({},S.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new S.Color(16777215)},opacity:{value:1},resolution:{value:new S.Vector2(1,1)},sizeAttenuation:{value:1},near:{value:1},far:{value:1},dashArray:{value:0},dashOffset:{value:0},dashRatio:{value:.5},useDash:{value:0},visibility:{value:1},alphaTest:{value:0},repeat:{value:new S.Vector2(1,1)}}),vertexShader:S.ShaderChunk.meshline_vert,fragmentShader:S.ShaderChunk.meshline_frag}),this.type="MeshLineMaterial",Object.defineProperties(this,{lineWidth:{enumerable:!0,get:function(){return this.uniforms.lineWidth.value},set:function(t){this.uniforms.lineWidth.value=t}},map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(t){this.uniforms.map.value=t}},useMap:{enumerable:!0,get:function(){return this.uniforms.useMap.value},set:function(t){this.uniforms.useMap.value=t}},alphaMap:{enumerable:!0,get:function(){return this.uniforms.alphaMap.value},set:function(t){this.uniforms.alphaMap.value=t}},useAlphaMap:{enumerable:!0,get:function(){return this.uniforms.useAlphaMap.value},set:function(t){this.uniforms.useAlphaMap.value=t}},color:{enumerable:!0,get:function(){return this.uniforms.color.value},set:function(t){this.uniforms.color.value=t}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(t){this.uniforms.opacity.value=t}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(t){this.uniforms.resolution.value.copy(t)}},sizeAttenuation:{enumerable:!0,get:function(){return this.uniforms.sizeAttenuation.value},set:function(t){this.uniforms.sizeAttenuation.value=t}},near:{enumerable:!0,get:function(){return this.uniforms.near.value},set:function(t){this.uniforms.near.value=t}},far:{enumerable:!0,get:function(){return this.uniforms.far.value},set:function(t){this.uniforms.far.value=t}},dashArray:{enumerable:!0,get:function(){return this.uniforms.dashArray.value},set:function(t){this.uniforms.dashArray.value=t,this.useDash=0!==t?1:0}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(t){this.uniforms.dashOffset.value=t}},dashRatio:{enumerable:!0,get:function(){return this.uniforms.dashRatio.value},set:function(t){this.uniforms.dashRatio.value=t}},useDash:{enumerable:!0,get:function(){return this.uniforms.useDash.value},set:function(t){this.uniforms.useDash.value=t}},visibility:{enumerable:!0,get:function(){return this.uniforms.visibility.value},set:function(t){this.uniforms.visibility.value=t}},alphaTest:{enumerable:!0,get:function(){return this.uniforms.alphaTest.value},set:function(t){this.uniforms.alphaTest.value=t}},repeat:{enumerable:!0,get:function(){return this.uniforms.repeat.value},set:function(t){this.uniforms.repeat.value.copy(t)}}}),this.setValues(t)}e.prototype.setMatrixWorld=function(t){this.matrixWorld=t},e.prototype.setGeometry=function(t,e){if(this.widthCallback=e,this.positions=[],this.counters=[],t instanceof S.Geometry)for(var n=0;n<t.vertices.length;n++){var i=t.vertices[n];e=n/t.vertices.length;this.positions.push(i.x,i.y,i.z),this.positions.push(i.x,i.y,i.z),this.counters.push(e),this.counters.push(e)}if(S.BufferGeometry,t instanceof Float32Array||t instanceof Array)for(n=0;n<t.length;n+=3){e=n/t.length;this.positions.push(t[n],t[n+1],t[n+2]),this.positions.push(t[n],t[n+1],t[n+2]),this.counters.push(e),this.counters.push(e)}this.process()},e.prototype.raycast=(w=new S.Matrix4,b=new S.Ray,M=new S.Sphere,function(t,e){var n=t.linePrecision,i=n*n,r=this.geometry;if(null===r.boundingSphere&&r.computeBoundingSphere(),M.copy(r.boundingSphere),M.applyMatrix4(this.matrixWorld),!1!==t.ray.intersectSphere(M)){w.getInverse(this.matrixWorld),b.copy(t.ray).applyMatrix4(w);var a=new S.Vector3,o=new S.Vector3,s=new S.Vector3,l=new S.Vector3,c=this instanceof S.LineSegments?2:1;if(r instanceof S.BufferGeometry){var u=r.index,h=r.attributes;if(null!==u)for(var d=u.array,p=h.position.array,f=0,m=d.length-1;f<m;f+=c){var g=d[f],v=d[f+1];a.fromArray(p,3*g),o.fromArray(p,3*v),i<b.distanceSqToSegment(a,o,l,s)||(l.applyMatrix4(this.matrixWorld),(_=t.ray.origin.distanceTo(l))<t.near||_>t.far||e.push({distance:_,point:s.clone().applyMatrix4(this.matrixWorld),index:f,face:null,faceIndex:null,object:this}))}else for(f=0,m=(p=h.position.array).length/3-1;f<m;f+=c)a.fromArray(p,3*f),o.fromArray(p,3*f+3),i<b.distanceSqToSegment(a,o,l,s)||(l.applyMatrix4(this.matrixWorld),(_=t.ray.origin.distanceTo(l))<t.near||_>t.far||e.push({distance:_,point:s.clone().applyMatrix4(this.matrixWorld),index:f,face:null,faceIndex:null,object:this}))}else if(r instanceof S.Geometry){var y=r.vertices,x=y.length;for(f=0;f<x-1;f+=c){var _;i<b.distanceSqToSegment(y[f],y[f+1],l,s)||(l.applyMatrix4(this.matrixWorld),(_=t.ray.origin.distanceTo(l))<t.near||_>t.far||e.push({distance:_,point:s.clone().applyMatrix4(this.matrixWorld),index:f,face:null,faceIndex:null,object:this}))}}}}),e.prototype.compareV3=function(t,e){var n=6*t,i=6*e;return this.positions[n]===this.positions[i]&&this.positions[1+n]===this.positions[1+i]&&this.positions[2+n]===this.positions[2+i]},e.prototype.copyV3=function(t){var e=6*t;return[this.positions[e],this.positions[1+e],this.positions[2+e]]},e.prototype.process=function(){var t,e,n=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];for(var i=0;i<n;i++)this.side.push(1),this.side.push(-1);for(i=0;i<n;i++)t=this.widthCallback?this.widthCallback(i/(n-1)):1,this.width.push(t),this.width.push(t);for(i=0;i<n;i++)this.uvs.push(i/(n-1),0),this.uvs.push(i/(n-1),1);e=this.compareV3(0,n-1)?this.copyV3(n-2):this.copyV3(0),this.previous.push(e[0],e[1],e[2]),this.previous.push(e[0],e[1],e[2]);for(i=0;i<n-1;i++)e=this.copyV3(i),this.previous.push(e[0],e[1],e[2]),this.previous.push(e[0],e[1],e[2]);for(i=1;i<n;i++)e=this.copyV3(i),this.next.push(e[0],e[1],e[2]),this.next.push(e[0],e[1],e[2]);e=this.compareV3(n-1,0)?this.copyV3(1):this.copyV3(n-1),this.next.push(e[0],e[1],e[2]),this.next.push(e[0],e[1],e[2]);for(i=0;i<n-1;i++){var r=2*i;this.indices_array.push(r,1+r,2+r),this.indices_array.push(2+r,1+r,3+r)}this.attributes?(this.attributes.position.copyArray(new Float32Array(this.positions)),this.attributes.position.needsUpdate=!0,this.attributes.previous.copyArray(new Float32Array(this.previous)),this.attributes.previous.needsUpdate=!0,this.attributes.next.copyArray(new Float32Array(this.next)),this.attributes.next.needsUpdate=!0,this.attributes.side.copyArray(new Float32Array(this.side)),this.attributes.side.needsUpdate=!0,this.attributes.width.copyArray(new Float32Array(this.width)),this.attributes.width.needsUpdate=!0,this.attributes.uv.copyArray(new Float32Array(this.uvs)),this.attributes.uv.needsUpdate=!0,this.attributes.index.copyArray(new Uint16Array(this.indices_array)),this.attributes.index.needsUpdate=!0):this.attributes={position:new S.BufferAttribute(new Float32Array(this.positions),3),previous:new S.BufferAttribute(new Float32Array(this.previous),3),next:new S.BufferAttribute(new Float32Array(this.next),3),side:new S.BufferAttribute(new Float32Array(this.side),1),width:new S.BufferAttribute(new Float32Array(this.width),1),uv:new S.BufferAttribute(new Float32Array(this.uvs),2),index:new S.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new S.BufferAttribute(new Float32Array(this.counters),1)},this.geometry.setAttribute("position",this.attributes.position),this.geometry.setAttribute("previous",this.attributes.previous),this.geometry.setAttribute("next",this.attributes.next),this.geometry.setAttribute("side",this.attributes.side),this.geometry.setAttribute("width",this.attributes.width),this.geometry.setAttribute("uv",this.attributes.uv),this.geometry.setAttribute("counters",this.attributes.counters),this.geometry.setIndex(this.attributes.index)},e.prototype.advance=function(t){var e=this.attributes.position.array,n=this.attributes.previous.array,i=this.attributes.next.array,r=e.length;a(e,0,n,0,r),a(e,6,e,0,r-6),e[r-6]=t.x,e[r-5]=t.y,e[r-4]=t.z,e[r-3]=t.x,e[r-2]=t.y,e[r-1]=t.z,a(e,6,i,0,r-6),i[r-6]=t.x,i[r-5]=t.y,i[r-4]=t.z,i[r-3]=t.x,i[r-2]=t.y,i[r-1]=t.z,this.attributes.position.needsUpdate=!0,this.attributes.previous.needsUpdate=!0,this.attributes.next.needsUpdate=!0},S.ShaderChunk.meshline_vert=["",S.ShaderChunk.logdepthbuf_pars_vertex,S.ShaderChunk.fog_pars_vertex,"","attribute vec3 previous;","attribute vec3 next;","attribute float side;","attribute float width;","attribute float counters;","","uniform vec2 resolution;","uniform float lineWidth;","uniform vec3 color;","uniform float opacity;","uniform float near;","uniform float far;","uniform float sizeAttenuation;","","varying vec2 vUV;","varying vec4 vColor;","varying float vCounters;","","vec2 fix( vec4 i, float aspect ) {",""," vec2 res = i.xy / i.w;"," res.x *= aspect;","\t vCounters = counters;"," return res;","","}","","void main() {",""," float aspect = resolution.x / resolution.y;"," float pixelWidthRatio = 1. / (resolution.x * projectionMatrix[0][0]);",""," vColor = vec4( color, opacity );"," vUV = uv;",""," mat4 m = projectionMatrix * modelViewMatrix;"," vec4 finalPosition = m * vec4( position, 1.0 );"," vec4 prevPos = m * vec4( previous, 1.0 );"," vec4 nextPos = m * vec4( next, 1.0 );",""," vec2 currentP = fix( finalPosition, aspect );"," vec2 prevP = fix( prevPos, aspect );"," vec2 nextP = fix( nextPos, aspect );",""," float pixelWidth = finalPosition.w * pixelWidthRatio;"," float w = 1.8 * pixelWidth * lineWidth * width;",""," if( sizeAttenuation == 1. ) {"," w = 1.8 * lineWidth * width;"," }",""," vec2 dir;"," if( nextP == currentP ) dir = normalize( currentP - prevP );"," else if( prevP == currentP ) dir = normalize( nextP - currentP );"," else {"," vec2 dir1 = normalize( currentP - prevP );"," vec2 dir2 = normalize( nextP - currentP );"," dir = normalize( dir1 + dir2 );",""," vec2 perp = vec2( -dir1.y, dir1.x );"," vec2 miter = vec2( -dir.y, dir.x );"," //w = clamp( w / dot( miter, perp ), 0., 4. * lineWidth * width );",""," }",""," //vec2 normal = ( cross( vec3( dir, 0. ), vec3( 0., 0., 1. ) ) ).xy;"," vec2 normal = vec2( -dir.y, dir.x );"," normal.x /= aspect;"," normal *= .5 * w;",""," vec4 offset = vec4( normal * side, 0.0, 1.0 );"," finalPosition.xy += offset.xy;",""," gl_Position = finalPosition;","",S.ShaderChunk.logdepthbuf_vertex,S.ShaderChunk.fog_vertex&&" vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",S.ShaderChunk.fog_vertex,"}"].join("\r\n"),S.ShaderChunk.meshline_frag=["",S.ShaderChunk.fog_pars_fragment,S.ShaderChunk.logdepthbuf_pars_fragment,"","uniform sampler2D map;","uniform sampler2D alphaMap;","uniform float useMap;","uniform float useAlphaMap;","uniform float useDash;","uniform float dashArray;","uniform float dashOffset;","uniform float dashRatio;","uniform float visibility;","uniform float alphaTest;","uniform vec2 repeat;","","varying vec2 vUV;","varying vec4 vColor;","varying float vCounters;","","void main() {","",S.ShaderChunk.logdepthbuf_fragment,""," vec4 c = vColor;"," if( useMap == 1. ) c *= texture2D( map, vUV * repeat );"," if( useAlphaMap == 1. ) c.a *= texture2D( alphaMap, vUV * repeat ).a;"," if( c.a < alphaTest ) discard;"," if( useDash == 1. ){"," c.a *= ceil(mod(vCounters + dashOffset, dashArray) - (dashArray * dashRatio));"," }"," gl_FragColor = c;"," gl_FragColor.a *= step(vCounters, visibility);","",S.ShaderChunk.fog_fragment,"}"].join("\r\n"),((n.prototype=Object.create(S.ShaderMaterial.prototype)).constructor=n).prototype.isMeshLineMaterial=!0,n.prototype.copy=function(t){return S.ShaderMaterial.prototype.copy.call(this,t),this.lineWidth=t.lineWidth,this.map=t.map,this.useMap=t.useMap,this.alphaMap=t.alphaMap,this.useAlphaMap=t.useAlphaMap,this.color.copy(t.color),this.opacity=t.opacity,this.resolution.copy(t.resolution),this.sizeAttenuation=t.sizeAttenuation,this.near=t.near,this.far=t.far,this.dashArray.copy(t.dashArray),this.dashOffset.copy(t.dashOffset),this.dashRatio.copy(t.dashRatio),this.useDash=t.useDash,this.visibility=t.visibility,this.alphaTest=t.alphaTest,this.repeat.copy(t.repeat),this},void 0!==o?(void 0!==r&&r.exports&&(o=r.exports={MeshLine:e,MeshLineMaterial:n}),o.MeshLine=e,o.MeshLineMaterial=n):(this.MeshLine=e,this.MeshLineMaterial=n)}).call(this)},{three:19}],19:[function(t,e,n){var i,r;i=this,r=function(t){"use strict";void 0===Number.EPSILON&&(Number.EPSILON=Math.pow(2,-52)),void 0===Number.isInteger&&(Number.isInteger=function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}),void 0===Math.sign&&(Math.sign=function(t){return t<0?-1:0<t?1:+t}),"name"in Function.prototype==!1&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}}),void 0===Object.assign&&(Object.assign=function(t){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),n=1;n<arguments.length;n++){var i=arguments[n];if(null!=i)for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e});var X=0,Y=1,Z=2,F=1,z=2,V=3,O=0,St=1,$=2,o=0,v=2,K=0,Q=1,tt=2,et=3,nt=4,it=5,rt=100,at=101,ot=102,st=103,lt=104,ct=200,ut=201,ht=202,dt=203,pt=204,ft=205,mt=206,gt=207,vt=208,yt=209,xt=210,_t=0,wt=1,bt=2,Mt=3,Ct=4,Tt=5,Et=6,At=7,U=0,j=1,G=2,H=0,Dt=1,W=2,J=3,q=4,Lt=5,Ot=301,It=302,Pt=303,Rt=304,kt=305,Nt=306,Bt=307,Ft=1e3,zt=1001,Vt=1002,Ut=1003,jt=1004,Gt=1005,Ht=1006,Wt=1007,Jt=1008,qt=1009,r=1010,a=1011,Xt=1012,s=1013,Yt=1014,Zt=1015,$t=1016,l=1017,c=1018,u=1019,Kt=1020,h=1021,Qt=1022,te=1023,d=1024,p=1025,i=te,ee=1026,ne=1027,f=1028,m=1029,g=1030,y=1031,x=1032,_=1033,w=33776,b=33777,M=33778,S=33779,C=35840,T=35841,E=35842,A=35843,D=36196,L=37808,I=37809,P=37810,R=37811,k=37812,N=37813,B=37814,ie=37815,re=37816,ae=37817,oe=37818,se=37819,le=37820,ce=37821,ue=2300,he=2301,de=2400,pe=2401,fe=2402,me=3e3,e=3001,n=3007,ge=3002,ve=3003,ye=3004,xe=3005,_e=3006,we=3200,be=3201,Me=0,Se=1,Ce=7680,Te=519,Ee=35044,Ae=35048;function De(){}Object.assign(De.prototype,{addEventListener:function(t,e){void 0===this._listeners&&(this._listeners={});var n=this._listeners;void 0===n[t]&&(n[t]=[]),-1===n[t].indexOf(e)&&n[t].push(e)},hasEventListener:function(t,e){if(void 0===this._listeners)return!1;var n=this._listeners;return void 0!==n[t]&&-1!==n[t].indexOf(e)},removeEventListener:function(t,e){if(void 0!==this._listeners){var n=this._listeners[t];if(void 0!==n){var i=n.indexOf(e);-1!==i&&n.splice(i,1)}}},dispatchEvent:function(t){if(void 0!==this._listeners){var e=this._listeners[t.type];if(void 0!==e){t.target=this;for(var n=e.slice(0),i=0,r=n.length;i<r;i++)n[i].call(this,t)}}}});for(var Le=[],Oe=0;Oe<256;Oe++)Le[Oe]=(Oe<16?"0":"")+Oe.toString(16);var Ie,Pe={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){var t=4294967295*Math.random()|0,e=4294967295*Math.random()|0,n=4294967295*Math.random()|0,i=4294967295*Math.random()|0;return(Le[255&t]+Le[t>>8&255]+Le[t>>16&255]+Le[t>>24&255]+"-"+Le[255&e]+Le[e>>8&255]+"-"+Le[e>>16&15|64]+Le[e>>24&255]+"-"+Le[63&n|128]+Le[n>>8&255]+"-"+Le[n>>16&255]+Le[n>>24&255]+Le[255&i]+Le[i>>8&255]+Le[i>>16&255]+Le[i>>24&255]).toUpperCase()},clamp:function(t,e,n){return Math.max(e,Math.min(n,t))},euclideanModulo:function(t,e){return(t%e+e)%e},mapLinear:function(t,e,n,i,r){return i+(t-e)*(r-i)/(n-e)},lerp:function(t,e,n){return(1-n)*t+n*e},smoothstep:function(t,e,n){return t<=e?0:n<=t?1:(t=(t-e)/(n-e))*t*(3-2*t)},smootherstep:function(t,e,n){return t<=e?0:n<=t?1:(t=(t-e)/(n-e))*t*t*(t*(6*t-15)+10)},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},degToRad:function(t){return t*Pe.DEG2RAD},radToDeg:function(t){return t*Pe.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,e,n,i,r){var a=Math.cos,o=Math.sin,s=a(n/2),l=o(n/2),c=a((e+i)/2),u=o((e+i)/2),h=a((e-i)/2),d=o((e-i)/2),p=a((i-e)/2),f=o((i-e)/2);"XYX"===r?t.set(s*u,l*h,l*d,s*c):"YZY"===r?t.set(l*d,s*u,l*h,s*c):"ZXZ"===r?t.set(l*h,l*d,s*u,s*c):"XZX"===r?t.set(s*u,l*f,l*p,s*c):"YXY"===r?t.set(l*p,s*u,l*f,s*c):"ZYZ"===r?t.set(l*f,l*p,s*u,s*c):console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order.")}};function Re(t,e){this.x=t||0,this.y=e||0}function ke(){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.")}Object.defineProperties(Re.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(Re.prototype,{isVector2:!0,set:function(t,e){return this.x=t,this.y=e,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,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;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,e){return void 0!==e?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this)},addScalar:function(t){return this.x+=t,this.y+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this)},subScalar:function(t){return this.x-=t,this.y-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.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 e=this.x,n=this.y,i=t.elements;return this.x=i[0]*e+i[3]*n+i[6],this.y=i[1]*e+i[4]*n+i[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,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this},clampScalar:function(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this},clampLength:function(t,e){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(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(){var t=Math.atan2(this.y,this.x);return t<0&&(t+=2*Math.PI),t},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x,n=this.y-t.y;return e*e+n*n},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,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this},lerpVectors:function(t,e,n){return this.subVectors(e,t).multiplyScalar(n).add(t)},equals:function(t){return t.x===this.x&&t.y===this.y},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t},fromBufferAttribute:function(t,e,n){return void 0!==n&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this},rotateAround:function(t,e){var n=Math.cos(e),i=Math.sin(e),r=this.x-t.x,a=this.y-t.y;return this.x=r*n-a*i+t.x,this.y=r*i+a*n+t.y,this}}),Object.assign(ke.prototype,{isMatrix3:!0,set:function(t,e,n,i,r,a,o,s,l){var c=this.elements;return c[0]=t,c[1]=i,c[2]=o,c[3]=e,c[4]=r,c[5]=s,c[6]=n,c[7]=a,c[8]=l,this},identity:function(){return this.set(1,0,0,0,1,0,0,0,1),this},clone:function(){return(new this.constructor).fromArray(this.elements)},copy:function(t){var e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this},setFromMatrix4:function(t){var e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this},multiply:function(t){return this.multiplyMatrices(this,t)},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var n=t.elements,i=e.elements,r=this.elements,a=n[0],o=n[3],s=n[6],l=n[1],c=n[4],u=n[7],h=n[2],d=n[5],p=n[8],f=i[0],m=i[3],g=i[6],v=i[1],y=i[4],x=i[7],_=i[2],w=i[5],b=i[8];return r[0]=a*f+o*v+s*_,r[3]=a*m+o*y+s*w,r[6]=a*g+o*x+s*b,r[1]=l*f+c*v+u*_,r[4]=l*m+c*y+u*w,r[7]=l*g+c*x+u*b,r[2]=h*f+d*v+p*_,r[5]=h*m+d*y+p*w,r[8]=h*g+d*x+p*b,this},multiplyScalar:function(t){var e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this},determinant:function(){var t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],a=t[4],o=t[5],s=t[6],l=t[7],c=t[8];return e*a*c-e*o*l-n*r*c+n*o*s+i*r*l-i*a*s},getInverse:function(t,e){t&&t.isMatrix4&&console.error("THREE.Matrix3: .getInverse() no longer takes a Matrix4 argument.");var n=t.elements,i=this.elements,r=n[0],a=n[1],o=n[2],s=n[3],l=n[4],c=n[5],u=n[6],h=n[7],d=n[8],p=d*l-c*h,f=c*u-d*s,m=h*s-l*u,g=r*p+a*f+o*m;if(0==g){var v="THREE.Matrix3: .getInverse() can't invert matrix, determinant is 0";if(!0===e)throw new Error(v);return console.warn(v),this.identity()}var y=1/g;return i[0]=p*y,i[1]=(o*h-d*a)*y,i[2]=(c*a-o*l)*y,i[3]=f*y,i[4]=(d*r-o*u)*y,i[5]=(o*s-c*r)*y,i[6]=m*y,i[7]=(a*u-h*r)*y,i[8]=(l*r-a*s)*y,this},transpose:function(){var t,e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this},getNormalMatrix:function(t){return this.setFromMatrix4(t).getInverse(this).transpose()},transposeIntoArray:function(t){var e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this},setUvTransform:function(t,e,n,i,r,a,o){var s=Math.cos(r),l=Math.sin(r);this.set(n*s,n*l,-n*(s*a+l*o)+a+t,-i*l,i*s,-i*(-l*a+s*o)+o+e,0,0,1)},scale:function(t,e){var n=this.elements;return n[0]*=t,n[3]*=t,n[6]*=t,n[1]*=e,n[4]*=e,n[7]*=e,this},rotate:function(t){var e=Math.cos(t),n=Math.sin(t),i=this.elements,r=i[0],a=i[3],o=i[6],s=i[1],l=i[4],c=i[7];return i[0]=e*r+n*s,i[3]=e*a+n*l,i[6]=e*o+n*c,i[1]=-n*r+e*s,i[4]=-n*a+e*l,i[7]=-n*o+e*c,this},translate:function(t,e){var n=this.elements;return n[0]+=t*n[2],n[3]+=t*n[5],n[6]+=t*n[8],n[1]+=e*n[2],n[4]+=e*n[5],n[7]+=e*n[8],this},equals:function(t){for(var e=this.elements,n=t.elements,i=0;i<9;i++)if(e[i]!==n[i])return!1;return!0},fromArray:function(t,e){void 0===e&&(e=0);for(var n=0;n<9;n++)this.elements[n]=t[n+e];return this},toArray:function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);var n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t}});var Ne={getDataURL:function(t){var e;if("undefined"==typeof HTMLCanvasElement)return t.src;if(t instanceof HTMLCanvasElement)e=t;else{void 0===Ie&&(Ie=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),Ie.width=t.width,Ie.height=t.height;var n=Ie.getContext("2d");t instanceof ImageData?n.putImageData(t,0,0):n.drawImage(t,0,0,t.width,t.height),e=Ie}return 2048<e.width||2048<e.height?e.toDataURL("image/jpeg",.6):e.toDataURL("image/png")}},Be=0;function Fe(t,e,n,i,r,a,o,s,l,c){Object.defineProperty(this,"id",{value:Be++}),this.uuid=Pe.generateUUID(),this.name="",this.image=void 0!==t?t:Fe.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==e?e:Fe.DEFAULT_MAPPING,this.wrapS=void 0!==n?n:zt,this.wrapT=void 0!==i?i:zt,this.magFilter=void 0!==r?r:Ht,this.minFilter=void 0!==a?a:Jt,this.anisotropy=void 0!==l?l:1,this.format=void 0!==o?o:te,this.internalFormat=null,this.type=void 0!==s?s:qt,this.offset=new Re(0,0),this.repeat=new Re(1,1),this.center=new Re(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new ke,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==c?c:me,this.version=0,this.onUpdate=null}function ze(t,e,n,i){this.x=t||0,this.y=e||0,this.z=n||0,this.w=void 0!==i?i:1}function Ve(t,e,n){this.width=t,this.height=e,this.scissor=new ze(0,0,t,e),this.scissorTest=!1,this.viewport=new ze(0,0,t,e),n=n||{},this.texture=new Fe(void 0,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.texture.image={},this.texture.image.width=t,this.texture.image.height=e,this.texture.generateMipmaps=void 0!==n.generateMipmaps&&n.generateMipmaps,this.texture.minFilter=void 0!==n.minFilter?n.minFilter:Ht,this.depthBuffer=void 0===n.depthBuffer||n.depthBuffer,this.stencilBuffer=void 0===n.stencilBuffer||n.stencilBuffer,this.depthTexture=void 0!==n.depthTexture?n.depthTexture:null}function Ue(t,e,n){Ve.call(this,t,e,n),this.samples=4}function je(t,e,n,i){this._x=t||0,this._y=e||0,this._z=n||0,this._w=void 0!==i?i:1}Fe.DEFAULT_IMAGE=void 0,Fe.DEFAULT_MAPPING=300,Fe.prototype=Object.assign(Object.create(De.prototype),{constructor:Fe,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},toJSON:function(t){var e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.textures[this.uuid])return t.textures[this.uuid];var n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(void 0!==this.image){var i=this.image;if(void 0===i.uuid&&(i.uuid=Pe.generateUUID()),!e&&void 0===t.images[i.uuid]){var r;if(Array.isArray(i)){r=[];for(var a=0,o=i.length;a<o;a++)r.push(Ne.getDataURL(i[a]))}else r=Ne.getDataURL(i);t.images[i.uuid]={uuid:i.uuid,url:r}}n.image=i.uuid}return e||(t.textures[this.uuid]=n),n},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 Ft:t.x=t.x-Math.floor(t.x);break;case zt:t.x=t.x<0?0:1;break;case Vt: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 Ft:t.y=t.y-Math.floor(t.y);break;case zt:t.y=t.y<0?0:1;break;case Vt: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(Fe.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.defineProperties(ze.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(ze.prototype,{isVector4:!0,set:function(t,e,n,i){return this.x=t,this.y=e,this.z=n,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,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;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,e){return void 0!==e?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(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,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(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,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this},multiplyScalar:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},applyMatrix4:function(t){var e=this.x,n=this.y,i=this.z,r=this.w,a=t.elements;return this.x=a[0]*e+a[4]*n+a[8]*i+a[12]*r,this.y=a[1]*e+a[5]*n+a[9]*i+a[13]*r,this.z=a[2]*e+a[6]*n+a[10]*i+a[14]*r,this.w=a[3]*e+a[7]*n+a[11]*i+a[15]*r,this},divideScalar:function(t){return this.multiplyScalar(1/t)},setAxisAngleFromQuaternion:function(t){this.w=2*Math.acos(t.w);var e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this},setAxisAngleFromRotationMatrix:function(t){var e,n,i,r,a=t.elements,o=a[0],s=a[4],l=a[8],c=a[1],u=a[5],h=a[9],d=a[2],p=a[6],f=a[10];if(Math.abs(s-c)<.01&&Math.abs(l-d)<.01&&Math.abs(h-p)<.01){if(Math.abs(s+c)<.1&&Math.abs(l+d)<.1&&Math.abs(h+p)<.1&&Math.abs(o+u+f-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;var m=(o+1)/2,g=(u+1)/2,v=(f+1)/2,y=(s+c)/4,x=(l+d)/4,_=(h+p)/4;return g<m&&v<m?r=m<.01?(n=0,i=.707106781):(i=y/(n=Math.sqrt(m)),x/n):v<g?r=g<.01?(i=0,n=.707106781):(n=y/(i=Math.sqrt(g)),_/i):v<.01?(i=n=.707106781,r=0):(n=x/(r=Math.sqrt(v)),i=_/r),this.set(n,i,r,e),this}var w=Math.sqrt((p-h)*(p-h)+(l-d)*(l-d)+(c-s)*(c-s));return Math.abs(w)<.001&&(w=1),this.x=(p-h)/w,this.y=(l-d)/w,this.z=(c-s)/w,this.w=Math.acos((o+u+f-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,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this},clampScalar:function(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this.w=Math.max(t,Math.min(e,this.w)),this},clampLength:function(t,e){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},dot:function(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,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this},lerpVectors:function(t,e,n){return this.subVectors(e,t).multiplyScalar(n).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,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t},fromBufferAttribute:function(t,e,n){return void 0!==n&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}}),Ve.prototype=Object.assign(Object.create(De.prototype),{constructor:Ve,isWebGLRenderTarget:!0,setSize:function(t,e){this.width===t&&this.height===e||(this.width=t,this.height=e,this.texture.image.width=t,this.texture.image.height=e,this.dispose()),this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)},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"})}}),Ue.prototype=Object.assign(Object.create(Ve.prototype),{constructor:Ue,isWebGLMultisampleRenderTarget:!0,copy:function(t){return Ve.prototype.copy.call(this,t),this.samples=t.samples,this}}),Object.assign(je,{slerp:function(t,e,n,i){return n.copy(t).slerp(e,i)},slerpFlat:function(t,e,n,i,r,a,o){var s=n[i+0],l=n[i+1],c=n[i+2],u=n[i+3],h=r[a+0],d=r[a+1],p=r[a+2],f=r[a+3];if(u!==f||s!==h||l!==d||c!==p){var m=1-o,g=s*h+l*d+c*p+u*f,v=0<=g?1:-1,y=1-g*g;if(y>Number.EPSILON){var x=Math.sqrt(y),_=Math.atan2(x,g*v);m=Math.sin(m*_)/x,o=Math.sin(o*_)/x}var w=o*v;if(s=s*m+h*w,l=l*m+d*w,c=c*m+p*w,u=u*m+f*w,m===1-o){var b=1/Math.sqrt(s*s+l*l+c*c+u*u);s*=b,l*=b,c*=b,u*=b}}t[e]=s,t[e+1]=l,t[e+2]=c,t[e+3]=u}}),Object.defineProperties(je.prototype,{x:{get:function(){return this._x},set:function(t){this._x=t,this._onChangeCallback()}},y:{get:function(){return this._y},set:function(t){this._y=t,this._onChangeCallback()}},z:{get:function(){return this._z},set:function(t){this._z=t,this._onChangeCallback()}},w:{get:function(){return this._w},set:function(t){this._w=t,this._onChangeCallback()}}}),Object.assign(je.prototype,{isQuaternion:!0,set:function(t,e,n,i){return this._x=t,this._y=e,this._z=n,this._w=i,this._onChangeCallback(),this},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=t.w,this._onChangeCallback(),this},setFromEuler:function(t,e){if(!t||!t.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var n=t._x,i=t._y,r=t._z,a=t.order,o=Math.cos,s=Math.sin,l=o(n/2),c=o(i/2),u=o(r/2),h=s(n/2),d=s(i/2),p=s(r/2);return"XYZ"===a?(this._x=h*c*u+l*d*p,this._y=l*d*u-h*c*p,this._z=l*c*p+h*d*u,this._w=l*c*u-h*d*p):"YXZ"===a?(this._x=h*c*u+l*d*p,this._y=l*d*u-h*c*p,this._z=l*c*p-h*d*u,this._w=l*c*u+h*d*p):"ZXY"===a?(this._x=h*c*u-l*d*p,this._y=l*d*u+h*c*p,this._z=l*c*p+h*d*u,this._w=l*c*u-h*d*p):"ZYX"===a?(this._x=h*c*u-l*d*p,this._y=l*d*u+h*c*p,this._z=l*c*p-h*d*u,this._w=l*c*u+h*d*p):"YZX"===a?(this._x=h*c*u+l*d*p,this._y=l*d*u+h*c*p,this._z=l*c*p-h*d*u,this._w=l*c*u-h*d*p):"XZY"===a&&(this._x=h*c*u-l*d*p,this._y=l*d*u-h*c*p,this._z=l*c*p+h*d*u,this._w=l*c*u+h*d*p),!1!==e&&this._onChangeCallback(),this},setFromAxisAngle:function(t,e){var n=e/2,i=Math.sin(n);return this._x=t.x*i,this._y=t.y*i,this._z=t.z*i,this._w=Math.cos(n),this._onChangeCallback(),this},setFromRotationMatrix:function(t){var e,n=t.elements,i=n[0],r=n[4],a=n[8],o=n[1],s=n[5],l=n[9],c=n[2],u=n[6],h=n[10],d=i+s+h;return 0<d?(e=.5/Math.sqrt(d+1),this._w=.25/e,this._x=(u-l)*e,this._y=(a-c)*e,this._z=(o-r)*e):s<i&&h<i?(e=2*Math.sqrt(1+i-s-h),this._w=(u-l)/e,this._x=.25*e,this._y=(r+o)/e,this._z=(a+c)/e):h<s?(e=2*Math.sqrt(1+s-i-h),this._w=(a-c)/e,this._x=(r+o)/e,this._y=.25*e,this._z=(l+u)/e):(e=2*Math.sqrt(1+h-i-s),this._w=(o-r)/e,this._x=(a+c)/e,this._y=(l+u)/e,this._z=.25*e),this._onChangeCallback(),this},setFromUnitVectors:function(t,e){var n=t.dot(e)+1;return n<1e-6?(n=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0):(this._x=0,this._y=-t.z,this._z=t.y)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x),this._w=n,this.normalize()},angleTo:function(t){return 2*Math.acos(Math.abs(Pe.clamp(this.dot(t),-1,1)))},rotateTowards:function(t,e){var n=this.angleTo(t);if(0===n)return this;var i=Math.min(1,e/n);return this.slerp(t,i),this},inverse:function(){return this.conjugate()},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),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)},normalize:function(){var t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(t,e)):this.multiplyQuaternions(this,t)},premultiply:function(t){return this.multiplyQuaternions(t,this)},multiplyQuaternions:function(t,e){var n=t._x,i=t._y,r=t._z,a=t._w,o=e._x,s=e._y,l=e._z,c=e._w;return this._x=n*c+a*o+i*l-r*s,this._y=i*c+a*s+r*o-n*l,this._z=r*c+a*l+n*s-i*o,this._w=a*c-n*o-i*s-r*l,this._onChangeCallback(),this},slerp:function(t,e){if(0===e)return this;if(1===e)return this.copy(t);var n=this._x,i=this._y,r=this._z,a=this._w,o=a*t._w+n*t._x+i*t._y+r*t._z;if(o<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,o=-o):this.copy(t),1<=o)return this._w=a,this._x=n,this._y=i,this._z=r,this;var s=1-o*o;if(s<=Number.EPSILON){var l=1-e;return this._w=l*a+e*this._w,this._x=l*n+e*this._x,this._y=l*i+e*this._y,this._z=l*r+e*this._z,this.normalize(),this._onChangeCallback(),this}var c=Math.sqrt(s),u=Math.atan2(c,o),h=Math.sin((1-e)*u)/c,d=Math.sin(e*u)/c;return this._w=a*h+this._w*d,this._x=n*h+this._x*d,this._y=i*h+this._y*d,this._z=r*h+this._z*d,this._onChangeCallback(),this},equals:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w},fromArray:function(t,e){return void 0===e&&(e=0),this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t},_onChange:function(t){return this._onChangeCallback=t,this},_onChangeCallback:function(){}});var Ge=new We,He=new je;function We(t,e,n){this.x=t||0,this.y=e||0,this.z=n||0}Object.assign(We.prototype,{isVector3:!0,set:function(t,e,n){return this.x=t,this.y=e,this.z=n,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,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;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,e){return void 0!==e?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(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,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(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,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(t,e)):(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,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.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(He.setFromEuler(t))},applyAxisAngle:function(t,e){return this.applyQuaternion(He.setFromAxisAngle(t,e))},applyMatrix3:function(t){var e=this.x,n=this.y,i=this.z,r=t.elements;return this.x=r[0]*e+r[3]*n+r[6]*i,this.y=r[1]*e+r[4]*n+r[7]*i,this.z=r[2]*e+r[5]*n+r[8]*i,this},applyNormalMatrix:function(t){return this.applyMatrix3(t).normalize()},applyMatrix4:function(t){var e=this.x,n=this.y,i=this.z,r=t.elements,a=1/(r[3]*e+r[7]*n+r[11]*i+r[15]);return this.x=(r[0]*e+r[4]*n+r[8]*i+r[12])*a,this.y=(r[1]*e+r[5]*n+r[9]*i+r[13])*a,this.z=(r[2]*e+r[6]*n+r[10]*i+r[14])*a,this},applyQuaternion:function(t){var e=this.x,n=this.y,i=this.z,r=t.x,a=t.y,o=t.z,s=t.w,l=s*e+a*i-o*n,c=s*n+o*e-r*i,u=s*i+r*n-a*e,h=-r*e-a*n-o*i;return this.x=l*s+h*-r+c*-o-u*-a,this.y=c*s+h*-a+u*-r-l*-o,this.z=u*s+h*-o+l*-a-c*-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 e=this.x,n=this.y,i=this.z,r=t.elements;return this.x=r[0]*e+r[4]*n+r[8]*i,this.y=r[1]*e+r[5]*n+r[9]*i,this.z=r[2]*e+r[6]*n+r[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,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this},clampScalar:function(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this},clampLength:function(t,e){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(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,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this},lerpVectors:function(t,e,n){return this.subVectors(e,t).multiplyScalar(n).add(t)},cross:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(t,e)):this.crossVectors(this,t)},crossVectors:function(t,e){var n=t.x,i=t.y,r=t.z,a=e.x,o=e.y,s=e.z;return this.x=i*s-r*o,this.y=r*a-n*s,this.z=n*o-i*a,this},projectOnVector:function(t){var e=t.lengthSq();if(0===e)return this.set(0,0,0);var n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)},projectOnPlane:function(t){return Ge.copy(this).projectOnVector(t),this.sub(Ge)},reflect:function(t){return this.sub(Ge.copy(t).multiplyScalar(2*this.dot(t)))},angleTo:function(t){var e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;var n=this.dot(t)/e;return Math.acos(Pe.clamp(n,-1,1))},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x,n=this.y-t.y,i=this.z-t.z;return e*e+n*n+i*i},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,e,n){var i=Math.sin(e)*t;return this.x=i*Math.sin(n),this.y=Math.cos(e)*t,this.z=i*Math.cos(n),this},setFromCylindrical:function(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)},setFromCylindricalCoords:function(t,e,n){return this.x=t*Math.sin(e),this.y=n,this.z=t*Math.cos(e),this},setFromMatrixPosition:function(t){var e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this},setFromMatrixScale:function(t){var e=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),i=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=i,this},setFromMatrixColumn:function(t,e){return this.fromArray(t.elements,4*e)},setFromMatrix3Column:function(t,e){return this.fromArray(t.elements,3*e)},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t},fromBufferAttribute:function(t,e,n){return void 0!==n&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}});var Je=new We,qe=new Qe,Xe=new We(0,0,0),Ye=new We(1,1,1),Ze=new We,$e=new We,Ke=new We;function Qe(){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.")}Object.assign(Qe.prototype,{isMatrix4:!0,set:function(t,e,n,i,r,a,o,s,l,c,u,h,d,p,f,m){var g=this.elements;return g[0]=t,g[4]=e,g[8]=n,g[12]=i,g[1]=r,g[5]=a,g[9]=o,g[13]=s,g[2]=l,g[6]=c,g[10]=u,g[14]=h,g[3]=d,g[7]=p,g[11]=f,g[15]=m,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},clone:function(){return(new Qe).fromArray(this.elements)},copy:function(t){var e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this},copyPosition:function(t){var e=this.elements,n=t.elements;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this},extractBasis:function(t,e,n){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this},makeBasis:function(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this},extractRotation:function(t){var e=this.elements,n=t.elements,i=1/Je.setFromMatrixColumn(t,0).length(),r=1/Je.setFromMatrixColumn(t,1).length(),a=1/Je.setFromMatrixColumn(t,2).length();return e[0]=n[0]*i,e[1]=n[1]*i,e[2]=n[2]*i,e[3]=0,e[4]=n[4]*r,e[5]=n[5]*r,e[6]=n[6]*r,e[7]=0,e[8]=n[8]*a,e[9]=n[9]*a,e[10]=n[10]*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[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 e=this.elements,n=t.x,i=t.y,r=t.z,a=Math.cos(n),o=Math.sin(n),s=Math.cos(i),l=Math.sin(i),c=Math.cos(r),u=Math.sin(r);if("XYZ"===t.order){var h=a*c,d=a*u,p=o*c,f=o*u;e[0]=s*c,e[4]=-s*u,e[8]=l,e[1]=d+p*l,e[5]=h-f*l,e[9]=-o*s,e[2]=f-h*l,e[6]=p+d*l,e[10]=a*s}else if("YXZ"===t.order){var m=s*c,g=s*u,v=l*c,y=l*u;e[0]=m+y*o,e[4]=v*o-g,e[8]=a*l,e[1]=a*u,e[5]=a*c,e[9]=-o,e[2]=g*o-v,e[6]=y+m*o,e[10]=a*s}else if("ZXY"===t.order){m=s*c,g=s*u,v=l*c,y=l*u;e[0]=m-y*o,e[4]=-a*u,e[8]=v+g*o,e[1]=g+v*o,e[5]=a*c,e[9]=y-m*o,e[2]=-a*l,e[6]=o,e[10]=a*s}else if("ZYX"===t.order){h=a*c,d=a*u,p=o*c,f=o*u;e[0]=s*c,e[4]=p*l-d,e[8]=h*l+f,e[1]=s*u,e[5]=f*l+h,e[9]=d*l-p,e[2]=-l,e[6]=o*s,e[10]=a*s}else if("YZX"===t.order){var x=a*s,_=a*l,w=o*s,b=o*l;e[0]=s*c,e[4]=b-x*u,e[8]=w*u+_,e[1]=u,e[5]=a*c,e[9]=-o*c,e[2]=-l*c,e[6]=_*u+w,e[10]=x-b*u}else if("XZY"===t.order){x=a*s,_=a*l,w=o*s,b=o*l;e[0]=s*c,e[4]=-u,e[8]=l*c,e[1]=x*u+b,e[5]=a*c,e[9]=_*u-w,e[2]=w*u-_,e[6]=o*c,e[10]=b*u+x}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},makeRotationFromQuaternion:function(t){return this.compose(Xe,t,Ye)},lookAt:function(t,e,n){var i=this.elements;return Ke.subVectors(t,e),0===Ke.lengthSq()&&(Ke.z=1),Ke.normalize(),Ze.crossVectors(n,Ke),0===Ze.lengthSq()&&(1===Math.abs(n.z)?Ke.x+=1e-4:Ke.z+=1e-4,Ke.normalize(),Ze.crossVectors(n,Ke)),Ze.normalize(),$e.crossVectors(Ke,Ze),i[0]=Ze.x,i[4]=$e.x,i[8]=Ke.x,i[1]=Ze.y,i[5]=$e.y,i[9]=Ke.y,i[2]=Ze.z,i[6]=$e.z,i[10]=Ke.z,this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(t,e)):this.multiplyMatrices(this,t)},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var n=t.elements,i=e.elements,r=this.elements,a=n[0],o=n[4],s=n[8],l=n[12],c=n[1],u=n[5],h=n[9],d=n[13],p=n[2],f=n[6],m=n[10],g=n[14],v=n[3],y=n[7],x=n[11],_=n[15],w=i[0],b=i[4],M=i[8],S=i[12],C=i[1],T=i[5],E=i[9],A=i[13],D=i[2],L=i[6],O=i[10],I=i[14],P=i[3],R=i[7],k=i[11],N=i[15];return r[0]=a*w+o*C+s*D+l*P,r[4]=a*b+o*T+s*L+l*R,r[8]=a*M+o*E+s*O+l*k,r[12]=a*S+o*A+s*I+l*N,r[1]=c*w+u*C+h*D+d*P,r[5]=c*b+u*T+h*L+d*R,r[9]=c*M+u*E+h*O+d*k,r[13]=c*S+u*A+h*I+d*N,r[2]=p*w+f*C+m*D+g*P,r[6]=p*b+f*T+m*L+g*R,r[10]=p*M+f*E+m*O+g*k,r[14]=p*S+f*A+m*I+g*N,r[3]=v*w+y*C+x*D+_*P,r[7]=v*b+y*T+x*L+_*R,r[11]=v*M+y*E+x*O+_*k,r[15]=v*S+y*A+x*I+_*N,this},multiplyScalar:function(t){var e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this},determinant:function(){var t=this.elements,e=t[0],n=t[4],i=t[8],r=t[12],a=t[1],o=t[5],s=t[9],l=t[13],c=t[2],u=t[6],h=t[10],d=t[14];return t[3]*(r*s*u-i*l*u-r*o*h+n*l*h+i*o*d-n*s*d)+t[7]*(e*s*d-e*l*h+r*a*h-i*a*d+i*l*c-r*s*c)+t[11]*(e*l*u-e*o*d-r*a*u+n*a*d+r*o*c-n*l*c)+t[15]*(-i*o*c-e*s*u+e*o*h+i*a*u-n*a*h+n*s*c)},transpose:function(){var t,e=this.elements;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this},setPosition:function(t,e,n){var i=this.elements;return t.isVector3?(i[12]=t.x,i[13]=t.y,i[14]=t.z):(i[12]=t,i[13]=e,i[14]=n),this},getInverse:function(t,e){var n=this.elements,i=t.elements,r=i[0],a=i[1],o=i[2],s=i[3],l=i[4],c=i[5],u=i[6],h=i[7],d=i[8],p=i[9],f=i[10],m=i[11],g=i[12],v=i[13],y=i[14],x=i[15],_=p*y*h-v*f*h+v*u*m-c*y*m-p*u*x+c*f*x,w=g*f*h-d*y*h-g*u*m+l*y*m+d*u*x-l*f*x,b=d*v*h-g*p*h+g*c*m-l*v*m-d*c*x+l*p*x,M=g*p*u-d*v*u-g*c*f+l*v*f+d*c*y-l*p*y,S=r*_+a*w+o*b+s*M;if(0==S){var C="THREE.Matrix4: .getInverse() can't invert matrix, determinant is 0";if(!0===e)throw new Error(C);return console.warn(C),this.identity()}var T=1/S;return n[0]=_*T,n[1]=(v*f*s-p*y*s-v*o*m+a*y*m+p*o*x-a*f*x)*T,n[2]=(c*y*s-v*u*s+v*o*h-a*y*h-c*o*x+a*u*x)*T,n[3]=(p*u*s-c*f*s-p*o*h+a*f*h+c*o*m-a*u*m)*T,n[4]=w*T,n[5]=(d*y*s-g*f*s+g*o*m-r*y*m-d*o*x+r*f*x)*T,n[6]=(g*u*s-l*y*s-g*o*h+r*y*h+l*o*x-r*u*x)*T,n[7]=(l*f*s-d*u*s+d*o*h-r*f*h-l*o*m+r*u*m)*T,n[8]=b*T,n[9]=(g*p*s-d*v*s-g*a*m+r*v*m+d*a*x-r*p*x)*T,n[10]=(l*v*s-g*c*s+g*a*h-r*v*h-l*a*x+r*c*x)*T,n[11]=(d*c*s-l*p*s-d*a*h+r*p*h+l*a*m-r*c*m)*T,n[12]=M*T,n[13]=(d*v*o-g*p*o+g*a*f-r*v*f-d*a*y+r*p*y)*T,n[14]=(g*c*o-l*v*o-g*a*u+r*v*u+l*a*y-r*c*y)*T,n[15]=(l*p*o-d*c*o+d*a*u-r*p*u-l*a*f+r*c*f)*T,this},scale:function(t){var e=this.elements,n=t.x,i=t.y,r=t.z;return e[0]*=n,e[4]*=i,e[8]*=r,e[1]*=n,e[5]*=i,e[9]*=r,e[2]*=n,e[6]*=i,e[10]*=r,e[3]*=n,e[7]*=i,e[11]*=r,this},getMaxScaleOnAxis:function(){var t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],i=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,i))},makeTranslation:function(t,e,n){return this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1),this},makeRotationX:function(t){var e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this},makeRotationY:function(t){var e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this},makeRotationZ:function(t){var e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(t,e){var n=Math.cos(e),i=Math.sin(e),r=1-n,a=t.x,o=t.y,s=t.z,l=r*a,c=r*o;return this.set(l*a+n,l*o-i*s,l*s+i*o,0,l*o+i*s,c*o+n,c*s-i*a,0,l*s-i*o,c*s+i*a,r*s*s+n,0,0,0,0,1),this},makeScale:function(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this},makeShear:function(t,e,n){return this.set(1,e,n,0,t,1,n,0,t,e,1,0,0,0,0,1),this},compose:function(t,e,n){var i=this.elements,r=e._x,a=e._y,o=e._z,s=e._w,l=r+r,c=a+a,u=o+o,h=r*l,d=r*c,p=r*u,f=a*c,m=a*u,g=o*u,v=s*l,y=s*c,x=s*u,_=n.x,w=n.y,b=n.z;return i[0]=(1-(f+g))*_,i[1]=(d+x)*_,i[2]=(p-y)*_,i[3]=0,i[4]=(d-x)*w,i[5]=(1-(h+g))*w,i[6]=(m+v)*w,i[7]=0,i[8]=(p+y)*b,i[9]=(m-v)*b,i[10]=(1-(h+f))*b,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,this},decompose:function(t,e,n){var i=this.elements,r=Je.set(i[0],i[1],i[2]).length(),a=Je.set(i[4],i[5],i[6]).length(),o=Je.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],qe.copy(this);var s=1/r,l=1/a,c=1/o;return qe.elements[0]*=s,qe.elements[1]*=s,qe.elements[2]*=s,qe.elements[4]*=l,qe.elements[5]*=l,qe.elements[6]*=l,qe.elements[8]*=c,qe.elements[9]*=c,qe.elements[10]*=c,e.setFromRotationMatrix(qe),n.x=r,n.y=a,n.z=o,this},makePerspective:function(t,e,n,i,r,a){void 0===a&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");var o=this.elements,s=2*r/(e-t),l=2*r/(n-i),c=(e+t)/(e-t),u=(n+i)/(n-i),h=-(a+r)/(a-r),d=-2*a*r/(a-r);return o[0]=s,o[4]=0,o[8]=c,o[12]=0,o[1]=0,o[5]=l,o[9]=u,o[13]=0,o[2]=0,o[6]=0,o[10]=h,o[14]=d,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this},makeOrthographic:function(t,e,n,i,r,a){var o=this.elements,s=1/(e-t),l=1/(n-i),c=1/(a-r),u=(e+t)*s,h=(n+i)*l,d=(a+r)*c;return o[0]=2*s,o[4]=0,o[8]=0,o[12]=-u,o[1]=0,o[5]=2*l,o[9]=0,o[13]=-h,o[2]=0,o[6]=0,o[10]=-2*c,o[14]=-d,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this},equals:function(t){for(var e=this.elements,n=t.elements,i=0;i<16;i++)if(e[i]!==n[i])return!1;return!0},fromArray:function(t,e){void 0===e&&(e=0);for(var n=0;n<16;n++)this.elements[n]=t[n+e];return this},toArray:function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);var n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t}});var tn=new Qe,en=new je;function nn(t,e,n,i){this._x=t||0,this._y=e||0,this._z=n||0,this._order=i||nn.DefaultOrder}function rn(){this.mask=1}nn.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],nn.DefaultOrder="XYZ",Object.defineProperties(nn.prototype,{x:{get:function(){return this._x},set:function(t){this._x=t,this._onChangeCallback()}},y:{get:function(){return this._y},set:function(t){this._y=t,this._onChangeCallback()}},z:{get:function(){return this._z},set:function(t){this._z=t,this._onChangeCallback()}},order:{get:function(){return this._order},set:function(t){this._order=t,this._onChangeCallback()}}}),Object.assign(nn.prototype,{isEuler:!0,set:function(t,e,n,i){return this._x=t,this._y=e,this._z=n,this._order=i||this._order,this._onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this},setFromRotationMatrix:function(t,e,n){var i=Pe.clamp,r=t.elements,a=r[0],o=r[4],s=r[8],l=r[1],c=r[5],u=r[9],h=r[2],d=r[6],p=r[10];return"XYZ"===(e=e||this._order)?(this._y=Math.asin(i(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-u,p),this._z=Math.atan2(-o,a)):(this._x=Math.atan2(d,c),this._z=0)):"YXZ"===e?(this._x=Math.asin(-i(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(s,p),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-h,a),this._z=0)):"ZXY"===e?(this._x=Math.asin(i(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-h,p),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,a))):"ZYX"===e?(this._y=Math.asin(-i(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(d,p),this._z=Math.atan2(l,a)):(this._x=0,this._z=Math.atan2(-o,c))):"YZX"===e?(this._z=Math.asin(i(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-h,a)):(this._x=0,this._y=Math.atan2(s,p))):"XZY"===e?(this._z=Math.asin(-i(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(s,a)):(this._x=Math.atan2(-u,p),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+e),this._order=e,!1!==n&&this._onChangeCallback(),this},setFromQuaternion:function(t,e,n){return tn.makeRotationFromQuaternion(t),this.setFromRotationMatrix(tn,e,n)},setFromVector3:function(t,e){return this.set(t.x,t.y,t.z,e||this._order)},reorder:function(t){return en.setFromEuler(this),this.setFromQuaternion(en,t)},equals:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order},fromArray:function(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this._onChangeCallback(),this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t},toVector3:function(t){return t?t.set(this._x,this._y,this._z):new We(this._x,this._y,this._z)},_onChange:function(t){return this._onChangeCallback=t,this},_onChangeCallback:function(){}}),Object.assign(rn.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)}});var an=0,on=new We,sn=new je,ln=new Qe,cn=new We,un=new We,hn=new We,dn=new je,pn=new We(1,0,0),fn=new We(0,1,0),mn=new We(0,0,1),gn={type:"added"},vn={type:"removed"};function yn(){Object.defineProperty(this,"id",{value:an++}),this.uuid=Pe.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=yn.DefaultUp.clone();var t=new We,e=new nn,n=new je,i=new We(1,1,1);e._onChange(function(){n.setFromEuler(e,!1)}),n._onChange(function(){e.setFromQuaternion(n,void 0,!1)}),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:e},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new Qe},normalMatrix:{value:new ke}}),this.matrix=new Qe,this.matrixWorld=new Qe,this.matrixAutoUpdate=yn.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new rn,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}}function xn(){yn.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}))}yn.DefaultUp=new We(0,1,0),yn.DefaultMatrixAutoUpdate=!0,yn.prototype=Object.assign(Object.create(De.prototype),{constructor:yn,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,e){this.quaternion.setFromAxisAngle(t,e)},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,e){return sn.setFromAxisAngle(t,e),this.quaternion.multiply(sn),this},rotateOnWorldAxis:function(t,e){return sn.setFromAxisAngle(t,e),this.quaternion.premultiply(sn),this},rotateX:function(t){return this.rotateOnAxis(pn,t)},rotateY:function(t){return this.rotateOnAxis(fn,t)},rotateZ:function(t){return this.rotateOnAxis(mn,t)},translateOnAxis:function(t,e){return on.copy(t).applyQuaternion(this.quaternion),this.position.add(on.multiplyScalar(e)),this},translateX:function(t){return this.translateOnAxis(pn,t)},translateY:function(t){return this.translateOnAxis(fn,t)},translateZ:function(t){return this.translateOnAxis(mn,t)},localToWorld:function(t){return t.applyMatrix4(this.matrixWorld)},worldToLocal:function(t){return t.applyMatrix4(ln.getInverse(this.matrixWorld))},lookAt:function(t,e,n){t.isVector3?cn.copy(t):cn.set(t,e,n);var i=this.parent;this.updateWorldMatrix(!0,!1),un.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?ln.lookAt(un,cn,this.up):ln.lookAt(cn,un,this.up),this.quaternion.setFromRotationMatrix(ln),i&&(ln.extractRotation(i.matrixWorld),sn.setFromRotationMatrix(ln),this.quaternion.premultiply(sn.inverse()))},add:function(t){if(1<arguments.length){for(var e=0;e<arguments.length;e++)this.add(arguments[e]);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(gn)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this},remove:function(t){if(1<arguments.length){for(var e=0;e<arguments.length;e++)this.remove(arguments[e]);return this}var n=this.children.indexOf(t);return-1!==n&&(t.parent=null,this.children.splice(n,1),t.dispatchEvent(vn)),this},attach:function(t){return this.updateWorldMatrix(!0,!1),ln.getInverse(this.matrixWorld),null!==t.parent&&(t.parent.updateWorldMatrix(!0,!1),ln.multiply(t.parent.matrixWorld)),t.applyMatrix4(ln),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,e){if(this[t]===e)return this;for(var n=0,i=this.children.length;n<i;n++){var r=this.children[n].getObjectByProperty(t,e);if(void 0!==r)return r}},getWorldPosition:function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldPosition() target is now required"),t=new We),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 je),this.updateMatrixWorld(!0),this.matrixWorld.decompose(un,t,hn),t},getWorldScale:function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldScale() target is now required"),t=new We),this.updateMatrixWorld(!0),this.matrixWorld.decompose(un,dn,t),t},getWorldDirection:function(t){void 0===t&&(console.warn("THREE.Object3D: .getWorldDirection() target is now required"),t=new We),this.updateMatrixWorld(!0);var e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()},raycast:function(){},traverse:function(t){t(this);for(var e=this.children,n=0,i=e.length;n<i;n++)e[n].traverse(t)},traverseVisible:function(t){if(!1!==this.visible){t(this);for(var e=this.children,n=0,i=e.length;n<i;n++)e[n].traverseVisible(t)}},traverseAncestors:function(t){var e=this.parent;null!==e&&(t(e),e.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 e=this.children,n=0,i=e.length;n<i;n++)e[n].updateMatrixWorld(t)},updateWorldMatrix:function(t,e){var n=this.parent;if(!0===t&&null!==n&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===e)for(var i=this.children,r=0,a=i.length;r<a;r++)i[r].updateWorldMatrix(!1,!0)},toJSON:function(n){var t=void 0===n||"string"==typeof n,e={};t&&(n={geometries:{},materials:{},textures:{},images:{},shapes:{}},e.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});var i={};function r(t,e){return void 0===t[e.uuid]&&(t[e.uuid]=e.toJSON(n)),e.uuid}if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),!0===this.castShadow&&(i.castShadow=!0),!0===this.receiveShadow&&(i.receiveShadow=!0),!1===this.visible&&(i.visible=!1),!1===this.frustumCulled&&(i.frustumCulled=!1),0!==this.renderOrder&&(i.renderOrder=this.renderOrder),"{}"!==JSON.stringify(this.userData)&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),!1===this.matrixAutoUpdate&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON()),this.isMesh||this.isLine||this.isPoints){i.geometry=r(n.geometries,this.geometry);var a=this.geometry.parameters;if(void 0!==a&&void 0!==a.shapes){var o=a.shapes;if(Array.isArray(o))for(var s=0,l=o.length;s<l;s++){var c=o[s];r(n.shapes,c)}else r(n.shapes,o)}}if(void 0!==this.material)if(Array.isArray(this.material)){var u=[];for(s=0,l=this.material.length;s<l;s++)u.push(r(n.materials,this.material[s]));i.material=u}else i.material=r(n.materials,this.material);if(0<this.children.length){i.children=[];for(s=0;s<this.children.length;s++)i.children.push(this.children[s].toJSON(n).object)}if(t){var h=m(n.geometries),d=m(n.materials),p=m(n.textures),f=m(n.images);o=m(n.shapes);0<h.length&&(e.geometries=h),0<d.length&&(e.materials=d),0<p.length&&(e.textures=p),0<f.length&&(e.images=f),0<o.length&&(e.shapes=o)}return e.object=i,e;function m(t){var e=[];for(var n in t){var i=t[n];delete i.metadata,e.push(i)}return e}},clone:function(t){return(new this.constructor).copy(this,t)},copy:function(t,e){if(void 0===e&&(e=!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===e)for(var n=0;n<t.children.length;n++){var i=t.children[n];this.add(i.clone())}return this}}),xn.prototype=Object.assign(Object.create(yn.prototype),{constructor:xn,isScene:!0,copy:function(t,e){return yn.prototype.copy.call(this,t,e),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},toJSON:function(t){var e=yn.prototype.toJSON.call(this,t);return null!==this.background&&(e.object.background=this.background.toJSON(t)),null!==this.environment&&(e.object.environment=this.environment.toJSON(t)),null!==this.fog&&(e.object.fog=this.fog.toJSON()),e},dispose:function(){this.dispatchEvent({type:"dispose"})}});var _n=[new We,new We,new We,new We,new We,new We,new We,new We],wn=new We,bn=new Pn,Mn=new We,Sn=new We,Cn=new We,Tn=new We,En=new We,An=new We,Dn=new We,Ln=new We,On=new We,In=new We;function Pn(t,e){this.min=void 0!==t?t:new We(1/0,1/0,1/0),this.max=void 0!==e?e:new We(-1/0,-1/0,-1/0)}function Rn(t,e,n,i,r){var a,o;for(a=0,o=t.length-3;a<=o;a+=3){In.fromArray(t,a);var s=r.x*Math.abs(In.x)+r.y*Math.abs(In.y)+r.z*Math.abs(In.z),l=e.dot(In),c=n.dot(In),u=i.dot(In);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>s)return!1}return!0}Object.assign(Pn.prototype,{isBox3:!0,set:function(t,e){return this.min.copy(t),this.max.copy(e),this},setFromArray:function(t){for(var e=1/0,n=1/0,i=1/0,r=-1/0,a=-1/0,o=-1/0,s=0,l=t.length;s<l;s+=3){var c=t[s],u=t[s+1],h=t[s+2];c<e&&(e=c),u<n&&(n=u),h<i&&(i=h),r<c&&(r=c),a<u&&(a=u),o<h&&(o=h)}return this.min.set(e,n,i),this.max.set(r,a,o),this},setFromBufferAttribute:function(t){for(var e=1/0,n=1/0,i=1/0,r=-1/0,a=-1/0,o=-1/0,s=0,l=t.count;s<l;s++){var c=t.getX(s),u=t.getY(s),h=t.getZ(s);c<e&&(e=c),u<n&&(n=u),h<i&&(i=h),r<c&&(r=c),a<u&&(a=u),o<h&&(o=h)}return this.min.set(e,n,i),this.max.set(r,a,o),this},setFromPoints:function(t){this.makeEmpty();for(var e=0,n=t.length;e<n;e++)this.expandByPoint(t[e]);return this},setFromCenterAndSize:function(t,e){var n=wn.copy(e).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 We),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 We),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 e=t.geometry;void 0!==e&&(null===e.boundingBox&&e.computeBoundingBox(),bn.copy(e.boundingBox),bn.applyMatrix4(t.matrixWorld),this.expandByPoint(bn.min),this.expandByPoint(bn.max));for(var n=t.children,i=0,r=n.length;i<r;i++)this.expandByObject(n[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,e){return void 0===e&&(console.warn("THREE.Box3: .getParameter() target is now required"),e=new We),e.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,wn),wn.distanceToSquared(t.center)<=t.radius*t.radius},intersectsPlane:function(t){var e,n;return n=0<t.normal.x?(e=t.normal.x*this.min.x,t.normal.x*this.max.x):(e=t.normal.x*this.max.x,t.normal.x*this.min.x),0<t.normal.y?(e+=t.normal.y*this.min.y,n+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,n+=t.normal.y*this.min.y),0<t.normal.z?(e+=t.normal.z*this.min.z,n+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,n+=t.normal.z*this.min.z),e<=-t.constant&&n>=-t.constant},intersectsTriangle:function(t){if(this.isEmpty())return!1;this.getCenter(Dn),Ln.subVectors(this.max,Dn),Mn.subVectors(t.a,Dn),Sn.subVectors(t.b,Dn),Cn.subVectors(t.c,Dn),Tn.subVectors(Sn,Mn),En.subVectors(Cn,Sn),An.subVectors(Mn,Cn);var e=[0,-Tn.z,Tn.y,0,-En.z,En.y,0,-An.z,An.y,Tn.z,0,-Tn.x,En.z,0,-En.x,An.z,0,-An.x,-Tn.y,Tn.x,0,-En.y,En.x,0,-An.y,An.x,0];return!!Rn(e,Mn,Sn,Cn,Ln)&&(!!Rn(e=[1,0,0,0,1,0,0,0,1],Mn,Sn,Cn,Ln)&&(On.crossVectors(Tn,En),Rn(e=[On.x,On.y,On.z],Mn,Sn,Cn,Ln)))},clampPoint:function(t,e){return void 0===e&&(console.warn("THREE.Box3: .clampPoint() target is now required"),e=new We),e.copy(t).clamp(this.min,this.max)},distanceToPoint:function(t){return wn.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(wn).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 kn=new Pn;function Nn(t,e){this.center=void 0!==t?t:new We,this.radius=void 0!==e?e:0}Object.assign(Nn.prototype,{set:function(t,e){return this.center.copy(t),this.radius=e,this},setFromPoints:function(t,e){var n=this.center;void 0!==e?n.copy(e):kn.setFromPoints(t).getCenter(n);for(var i=0,r=0,a=t.length;r<a;r++)i=Math.max(i,n.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 e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e},intersectsBox:function(t){return t.intersectsSphere(this)},intersectsPlane:function(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius},clampPoint:function(t,e){var n=this.center.distanceToSquared(t);return void 0===e&&(console.warn("THREE.Sphere: .clampPoint() target is now required"),e=new We),e.copy(t),n>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e},getBoundingBox:function(t){return void 0===t&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),t=new Pn),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 Bn=new We,Fn=new We,zn=new We,Vn=new We,Un=new We,jn=new We,Gn=new We;function Hn(t,e){this.origin=void 0!==t?t:new We,this.direction=void 0!==e?e:new We(0,0,-1)}Object.assign(Hn.prototype,{set:function(t,e){return this.origin.copy(t),this.direction.copy(e),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,e){return void 0===e&&(console.warn("THREE.Ray: .at() target is now required"),e=new We),e.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,Bn)),this},closestPointToPoint:function(t,e){void 0===e&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),e=new We),e.subVectors(t,this.origin);var n=e.dot(this.direction);return n<0?e.copy(this.origin):e.copy(this.direction).multiplyScalar(n).add(this.origin)},distanceToPoint:function(t){return Math.sqrt(this.distanceSqToPoint(t))},distanceSqToPoint:function(t){var e=Bn.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(Bn.copy(this.direction).multiplyScalar(e).add(this.origin),Bn.distanceToSquared(t))},distanceSqToSegment:function(t,e,n,i){Fn.copy(t).add(e).multiplyScalar(.5),zn.copy(e).sub(t).normalize(),Vn.copy(this.origin).sub(Fn);var r,a,o,s,l=.5*t.distanceTo(e),c=-this.direction.dot(zn),u=Vn.dot(this.direction),h=-Vn.dot(zn),d=Vn.lengthSq(),p=Math.abs(1-c*c);if(0<p)if(a=c*u-h,s=l*p,0<=(r=c*h-u))if(-s<=a)if(a<=s){var f=1/p;o=(r*=f)*(r+c*(a*=f)+2*u)+a*(c*r+a+2*h)+d}else a=l,o=-(r=Math.max(0,-(c*a+u)))*r+a*(a+2*h)+d;else a=-l,o=-(r=Math.max(0,-(c*a+u)))*r+a*(a+2*h)+d;else o=a<=-s?-(r=Math.max(0,-(-c*l+u)))*r+(a=0<r?-l:Math.min(Math.max(-l,-h),l))*(a+2*h)+d:a<=s?(r=0,(a=Math.min(Math.max(-l,-h),l))*(a+2*h)+d):-(r=Math.max(0,-(c*l+u)))*r+(a=0<r?l:Math.min(Math.max(-l,-h),l))*(a+2*h)+d;else a=0<c?-l:l,o=-(r=Math.max(0,-(c*a+u)))*r+a*(a+2*h)+d;return n&&n.copy(this.direction).multiplyScalar(r).add(this.origin),i&&i.copy(zn).multiplyScalar(a).add(Fn),o},intersectSphere:function(t,e){Bn.subVectors(t.center,this.origin);var n=Bn.dot(this.direction),i=Bn.dot(Bn)-n*n,r=t.radius*t.radius;if(r<i)return null;var a=Math.sqrt(r-i),o=n-a,s=n+a;return o<0&&s<0?null:o<0?this.at(s,e):this.at(o,e)},intersectsSphere:function(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius},distanceToPlane:function(t){var e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;var n=-(this.origin.dot(t.normal)+t.constant)/e;return 0<=n?n:null},intersectPlane:function(t,e){var n=this.distanceToPlane(t);return null===n?null:this.at(n,e)},intersectsPlane:function(t){var e=t.distanceToPoint(this.origin);return 0===e||t.normal.dot(this.direction)*e<0},intersectBox:function(t,e){var n,i,r,a,o,s,l=1/this.direction.x,c=1/this.direction.y,u=1/this.direction.z,h=this.origin;return i=0<=l?(n=(t.min.x-h.x)*l,(t.max.x-h.x)*l):(n=(t.max.x-h.x)*l,(t.min.x-h.x)*l),(a=0<=c?(r=(t.min.y-h.y)*c,(t.max.y-h.y)*c):(r=(t.max.y-h.y)*c,(t.min.y-h.y)*c))<n||i<r?null:((n<r||n!=n)&&(n=r),(a<i||i!=i)&&(i=a),(s=0<=u?(o=(t.min.z-h.z)*u,(t.max.z-h.z)*u):(o=(t.max.z-h.z)*u,(t.min.z-h.z)*u))<n||i<o?null:((n<o||n!=n)&&(n=o),(s<i||i!=i)&&(i=s),i<0?null:this.at(0<=n?n:i,e)))},intersectsBox:function(t){return null!==this.intersectBox(t,Bn)},intersectTriangle:function(t,e,n,i,r){Un.subVectors(e,t),jn.subVectors(n,t),Gn.crossVectors(Un,jn);var a,o=this.direction.dot(Gn);if(0<o){if(i)return null;a=1}else{if(!(o<0))return null;a=-1,o=-o}Vn.subVectors(this.origin,t);var s=a*this.direction.dot(jn.crossVectors(Vn,jn));if(s<0)return null;var l=a*this.direction.dot(Un.cross(Vn));if(l<0)return null;if(o<s+l)return null;var c=-a*Vn.dot(Gn);return c<0?null:this.at(c/o,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)}});var Wn=new We,Jn=new We,qn=new ke;function Xn(t,e){this.normal=void 0!==t?t:new We(1,0,0),this.constant=void 0!==e?e:0}Object.assign(Xn.prototype,{isPlane:!0,set:function(t,e){return this.normal.copy(t),this.constant=e,this},setComponents:function(t,e,n,i){return this.normal.set(t,e,n),this.constant=i,this},setFromNormalAndCoplanarPoint:function(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this},setFromCoplanarPoints:function(t,e,n){var i=Wn.subVectors(n,e).cross(Jn.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(i,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,e){return void 0===e&&(console.warn("THREE.Plane: .projectPoint() target is now required"),e=new We),e.copy(this.normal).multiplyScalar(-this.distanceToPoint(t)).add(t)},intersectLine:function(t,e){void 0===e&&(console.warn("THREE.Plane: .intersectLine() target is now required"),e=new We);var n=t.delta(Wn),i=this.normal.dot(n);if(0===i)return 0===this.distanceToPoint(t.start)?e.copy(t.start):void 0;var r=-(t.start.dot(this.normal)+this.constant)/i;return r<0||1<r?void 0:e.copy(n).multiplyScalar(r).add(t.start)},intersectsLine:function(t){var e=this.distanceToPoint(t.start),n=this.distanceToPoint(t.end);return e<0&&0<n||n<0&&0<e},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 We),t.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(t,e){var n=e||qn.getNormalMatrix(t),i=this.coplanarPoint(Wn).applyMatrix4(t),r=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(r),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 Yn=new We,Zn=new We,$n=new We,Kn=new We,Qn=new We,ti=new We,ei=new We,ni=new We,ii=new We,ri=new We;function ai(t,e,n){this.a=void 0!==t?t:new We,this.b=void 0!==e?e:new We,this.c=void 0!==n?n:new We}Object.assign(ai,{getNormal:function(t,e,n,i){void 0===i&&(console.warn("THREE.Triangle: .getNormal() target is now required"),i=new We),i.subVectors(n,e),Yn.subVectors(t,e),i.cross(Yn);var r=i.lengthSq();return 0<r?i.multiplyScalar(1/Math.sqrt(r)):i.set(0,0,0)},getBarycoord:function(t,e,n,i,r){Yn.subVectors(i,e),Zn.subVectors(n,e),$n.subVectors(t,e);var a=Yn.dot(Yn),o=Yn.dot(Zn),s=Yn.dot($n),l=Zn.dot(Zn),c=Zn.dot($n),u=a*l-o*o;if(void 0===r&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),r=new We),0==u)return r.set(-2,-1,-1);var h=1/u,d=(l*s-o*c)*h,p=(a*c-o*s)*h;return r.set(1-d-p,p,d)},containsPoint:function(t,e,n,i){return ai.getBarycoord(t,e,n,i,Kn),0<=Kn.x&&0<=Kn.y&&Kn.x+Kn.y<=1},getUV:function(t,e,n,i,r,a,o,s){return this.getBarycoord(t,e,n,i,Kn),s.set(0,0),s.addScaledVector(r,Kn.x),s.addScaledVector(a,Kn.y),s.addScaledVector(o,Kn.z),s},isFrontFacing:function(t,e,n,i){return Yn.subVectors(n,e),Zn.subVectors(t,e),Yn.cross(Zn).dot(i)<0}}),Object.assign(ai.prototype,{set:function(t,e,n){return this.a.copy(t),this.b.copy(e),this.c.copy(n),this},setFromPointsAndIndices:function(t,e,n,i){return this.a.copy(t[e]),this.b.copy(t[n]),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 Yn.subVectors(this.c,this.b),Zn.subVectors(this.a,this.b),.5*Yn.cross(Zn).length()},getMidpoint:function(t){return void 0===t&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),t=new We),t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},getNormal:function(t){return ai.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 Xn),t.setFromCoplanarPoints(this.a,this.b,this.c)},getBarycoord:function(t,e){return ai.getBarycoord(t,this.a,this.b,this.c,e)},getUV:function(t,e,n,i,r){return ai.getUV(t,this.a,this.b,this.c,e,n,i,r)},containsPoint:function(t){return ai.containsPoint(t,this.a,this.b,this.c)},isFrontFacing:function(t){return ai.isFrontFacing(this.a,this.b,this.c,t)},intersectsBox:function(t){return t.intersectsTriangle(this)},closestPointToPoint:function(t,e){void 0===e&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),e=new We);var n,i,r=this.a,a=this.b,o=this.c;Qn.subVectors(a,r),ti.subVectors(o,r),ni.subVectors(t,r);var s=Qn.dot(ni),l=ti.dot(ni);if(s<=0&&l<=0)return e.copy(r);ii.subVectors(t,a);var c=Qn.dot(ii),u=ti.dot(ii);if(0<=c&&u<=c)return e.copy(a);var h=s*u-c*l;if(h<=0&&0<=s&&c<=0)return n=s/(s-c),e.copy(r).addScaledVector(Qn,n);ri.subVectors(t,o);var d=Qn.dot(ri),p=ti.dot(ri);if(0<=p&&d<=p)return e.copy(o);var f=d*l-s*p;if(f<=0&&0<=l&&p<=0)return i=l/(l-p),e.copy(r).addScaledVector(ti,i);var m=c*p-d*u;if(m<=0&&0<=u-c&&0<=d-p)return ei.subVectors(o,a),i=(u-c)/(u-c+(d-p)),e.copy(a).addScaledVector(ei,i);var g=1/(m+f+h);return n=f*g,i=h*g,e.copy(r).addScaledVector(Qn,n).addScaledVector(ti,i)},equals:function(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}});var oi={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},si={h:0,s:0,l:0},li={h:0,s:0,l:0};function ci(t,e,n){return void 0===e&&void 0===n?this.set(t):this.setRGB(t,e,n)}function ui(t,e,n){return n<0&&(n+=1),1<n&&--n,n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+6*(e-t)*(2/3-n):t}function hi(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function di(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}function pi(t,e,n,i,r,a){this.a=t,this.b=e,this.c=n,this.normal=i&&i.isVector3?i:new We,this.vertexNormals=Array.isArray(i)?i:[],this.color=r&&r.isColor?r:new ci,this.vertexColors=Array.isArray(r)?r:[],this.materialIndex=void 0!==a?a:0}Object.assign(ci.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,e,n){return this.r=t,this.g=e,this.b=n,this},setHSL:function(t,e,n){if(t=Pe.euclideanModulo(t,1),e=Pe.clamp(e,0,1),n=Pe.clamp(n,0,1),0===e)this.r=this.g=this.b=n;else{var i=n<=.5?n*(1+e):n+e-n*e,r=2*n-i;this.r=ui(r,i,t+1/3),this.g=ui(r,i,t),this.b=ui(r,i,t-1/3)}return this},setStyle:function(e){function t(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}var n;if(n=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e)){var i,r=n[1],a=n[2];switch(r){case"rgb":case"rgba":if(i=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(255,parseInt(i[1],10))/255,this.g=Math.min(255,parseInt(i[2],10))/255,this.b=Math.min(255,parseInt(i[3],10))/255,t(i[5]),this;if(i=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(100,parseInt(i[1],10))/100,this.g=Math.min(100,parseInt(i[2],10))/100,this.b=Math.min(100,parseInt(i[3],10))/100,t(i[5]),this;break;case"hsl":case"hsla":if(i=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a)){var o=parseFloat(i[1])/360,s=parseInt(i[2],10)/100,l=parseInt(i[3],10)/100;return t(i[5]),this.setHSL(o,s,l)}}}else if(n=/^\#([A-Fa-f0-9]+)$/.exec(e)){var c=n[1],u=c.length;if(3===u)return this.r=parseInt(c.charAt(0)+c.charAt(0),16)/255,this.g=parseInt(c.charAt(1)+c.charAt(1),16)/255,this.b=parseInt(c.charAt(2)+c.charAt(2),16)/255,this;if(6===u)return this.r=parseInt(c.charAt(0)+c.charAt(1),16)/255,this.g=parseInt(c.charAt(2)+c.charAt(3),16)/255,this.b=parseInt(c.charAt(4)+c.charAt(5),16)/255,this}return e&&0<e.length?this.setColorName(e):this},setColorName:function(t){var e=oi[t];return void 0!==e?this.setHex(e):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,e){return void 0===e&&(e=2),this.r=Math.pow(t.r,e),this.g=Math.pow(t.g,e),this.b=Math.pow(t.b,e),this},copyLinearToGamma:function(t,e){void 0===e&&(e=2);var n=0<e?1/e: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=hi(t.r),this.g=hi(t.g),this.b=hi(t.b),this},copyLinearToSRGB:function(t){return this.r=di(t.r),this.g=di(t.g),this.b=di(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 e,n,i=this.r,r=this.g,a=this.b,o=Math.max(i,r,a),s=Math.min(i,r,a),l=(s+o)/2;if(s===o)n=e=0;else{var c=o-s;switch(n=l<=.5?c/(o+s):c/(2-o-s),o){case i:e=(r-a)/c+(r<a?6:0);break;case r:e=(a-i)/c+2;break;case a:e=(i-r)/c+4}e/=6}return t.h=e,t.s=n,t.l=l,t},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:function(t,e,n){return this.getHSL(si),si.h+=t,si.s+=e,si.l+=n,this.setHSL(si.h,si.s,si.l),this},add:function(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this},addColors:function(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.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,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this},lerpHSL:function(t,e){this.getHSL(si),t.getHSL(li);var n=Pe.lerp(si.h,li.h,e),i=Pe.lerp(si.s,li.s,e),r=Pe.lerp(si.l,li.l,e);return this.setHSL(n,i,r),this},equals:function(t){return t.r===this.r&&t.g===this.g&&t.b===this.b},fromArray:function(t,e){return void 0===e&&(e=0),this.r=t[e],this.g=t[e+1],this.b=t[e+2],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t},toJSON:function(){return this.getHex()}}),ci.NAMES=oi,Object.assign(pi.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 e=0,n=t.vertexNormals.length;e<n;e++)this.vertexNormals[e]=t.vertexNormals[e].clone();for(e=0,n=t.vertexColors.length;e<n;e++)this.vertexColors[e]=t.vertexColors[e].clone();return this}});var fi=0;function mi(){Object.defineProperty(this,"id",{value:fi++}),this.uuid=Pe.generateUUID(),this.name="",this.type="Material",this.fog=!0,this.blending=Q,this.side=O,this.flatShading=!1,this.vertexTangents=!1,this.vertexColors=o,this.opacity=1,this.transparent=!1,this.blendSrc=pt,this.blendDst=ft,this.blendEquation=rt,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=Mt,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=Te,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Ce,this.stencilZFail=Ce,this.stencilZPass=Ce,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 gi(t){mi.call(this),this.type="MeshBasicMaterial",this.color=new ci(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=U,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)}mi.prototype=Object.assign(Object.create(De.prototype),{constructor:mi,isMaterial:!0,onBeforeCompile:function(){},setValues:function(t){if(void 0!==t)for(var e in t){var n=t[e];if(void 0!==n)if("shading"!==e){var i=this[e];void 0!==i?i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[e]=n:console.warn("THREE."+this.type+": '"+e+"' is not a property of this material.")}else console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===n;else console.warn("THREE.Material: '"+e+"' parameter is undefined.")}},toJSON:function(t){var e=void 0===t||"string"==typeof t;e&&(t={textures:{},images:{}});var n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function i(t){var e=[];for(var n in t){var i=t[n];delete i.metadata,e.push(i)}return e}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),this.sheen&&this.sheen.isColor&&(n.sheen=this.sheen.getHex()),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearcoat&&(n.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(t).uuid),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(t).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(t).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(t).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(t).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(t).uuid,n.reflectivity=this.reflectivity,n.refractionRatio=this.refractionRatio,void 0!==this.combine&&(n.combine=this.combine),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity)),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(t).uuid),void 0!==this.size&&(n.size=this.size),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==Q&&(n.blending=this.blending),!0===this.flatShading&&(n.flatShading=this.flatShading),this.side!==O&&(n.side=this.side),this.vertexColors!==o&&(n.vertexColors=this.vertexColors),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,n.stencilWrite=this.stencilWrite,n.stencilWriteMask=this.stencilWriteMask,n.stencilFunc=this.stencilFunc,n.stencilRef=this.stencilRef,n.stencilFuncMask=this.stencilFuncMask,n.stencilFail=this.stencilFail,n.stencilZFail=this.stencilZFail,n.stencilZPass=this.stencilZPass,this.rotation&&0!==this.rotation&&(n.rotation=this.rotation),!0===this.polygonOffset&&(n.polygonOffset=!0),0!==this.polygonOffsetFactor&&(n.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),0<this.alphaTest&&(n.alphaTest=this.alphaTest),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(n.wireframe=this.wireframe),1<this.wireframeLinewidth&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.morphTargets&&(n.morphTargets=!0),!0===this.morphNormals&&(n.morphNormals=!0),!0===this.skinning&&(n.skinning=!0),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),e){var r=i(t.textures),a=i(t.images);0<r.length&&(n.textures=r),0<a.length&&(n.images=a)}return n},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.vertexTangents=t.vertexTangents,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 e=t.clippingPlanes,n=null;if(null!==e){var i=e.length;n=new Array(i);for(var r=0;r!==i;++r)n[r]=e[r].clone()}return this.clippingPlanes=n,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(mi.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),((gi.prototype=Object.create(mi.prototype)).constructor=gi).prototype.isMeshBasicMaterial=!0,gi.prototype.copy=function(t){return mi.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 vi=new We;function yi(t,e,n){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=!0===n,this.usage=Ee,this.updateRange={offset:0,count:-1},this.version=0}function xi(t,e,n){yi.call(this,new Int8Array(t),e,n)}function _i(t,e,n){yi.call(this,new Uint8Array(t),e,n)}function wi(t,e,n){yi.call(this,new Uint8ClampedArray(t),e,n)}function bi(t,e,n){yi.call(this,new Int16Array(t),e,n)}function Mi(t,e,n){yi.call(this,new Uint16Array(t),e,n)}function Si(t,e,n){yi.call(this,new Int32Array(t),e,n)}function Ci(t,e,n){yi.call(this,new Uint32Array(t),e,n)}function Ti(t,e,n){yi.call(this,new Float32Array(t),e,n)}function Ei(t,e,n){yi.call(this,new Float64Array(t),e,n)}function Ai(){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 Di(t){if(0===t.length)return-1/0;for(var e=t[0],n=1,i=t.length;n<i;++n)t[n]>e&&(e=t[n]);return e}Object.defineProperty(yi.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(yi.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,e,n){t*=this.itemSize,n*=e.itemSize;for(var i=0,r=this.itemSize;i<r;i++)this.array[t+i]=e.array[n+i];return this},copyArray:function(t){return this.array.set(t),this},copyColorsArray:function(t){for(var e=this.array,n=0,i=0,r=t.length;i<r;i++){var a=t[i];void 0===a&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",i),a=new ci),e[n++]=a.r,e[n++]=a.g,e[n++]=a.b}return this},copyVector2sArray:function(t){for(var e=this.array,n=0,i=0,r=t.length;i<r;i++){var a=t[i];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",i),a=new Re),e[n++]=a.x,e[n++]=a.y}return this},copyVector3sArray:function(t){for(var e=this.array,n=0,i=0,r=t.length;i<r;i++){var a=t[i];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",i),a=new We),e[n++]=a.x,e[n++]=a.y,e[n++]=a.z}return this},copyVector4sArray:function(t){for(var e=this.array,n=0,i=0,r=t.length;i<r;i++){var a=t[i];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",i),a=new ze),e[n++]=a.x,e[n++]=a.y,e[n++]=a.z,e[n++]=a.w}return this},applyMatrix3:function(t){for(var e=0,n=this.count;e<n;e++)vi.x=this.getX(e),vi.y=this.getY(e),vi.z=this.getZ(e),vi.applyMatrix3(t),this.setXYZ(e,vi.x,vi.y,vi.z);return this},applyMatrix4:function(t){for(var e=0,n=this.count;e<n;e++)vi.x=this.getX(e),vi.y=this.getY(e),vi.z=this.getZ(e),vi.applyMatrix4(t),this.setXYZ(e,vi.x,vi.y,vi.z);return this},applyNormalMatrix:function(t){for(var e=0,n=this.count;e<n;e++)vi.x=this.getX(e),vi.y=this.getY(e),vi.z=this.getZ(e),vi.applyNormalMatrix(t),this.setXYZ(e,vi.x,vi.y,vi.z);return this},transformDirection:function(t){for(var e=0,n=this.count;e<n;e++)vi.x=this.getX(e),vi.y=this.getY(e),vi.z=this.getZ(e),vi.transformDirection(t),this.setXYZ(e,vi.x,vi.y,vi.z);return this},set:function(t,e){return void 0===e&&(e=0),this.array.set(t,e),this},getX:function(t){return this.array[t*this.itemSize]},setX:function(t,e){return this.array[t*this.itemSize]=e,this},getY:function(t){return this.array[t*this.itemSize+1]},setY:function(t,e){return this.array[t*this.itemSize+1]=e,this},getZ:function(t){return this.array[t*this.itemSize+2]},setZ:function(t,e){return this.array[t*this.itemSize+2]=e,this},getW:function(t){return this.array[t*this.itemSize+3]},setW:function(t,e){return this.array[t*this.itemSize+3]=e,this},setXY:function(t,e,n){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,this},setXYZ:function(t,e,n,i){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=i,this},setXYZW:function(t,e,n,i,r){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,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)},toJSON:function(){return{itemSize:this.itemSize,type:this.array.constructor.name,array:Array.prototype.slice.call(this.array),normalized:this.normalized}}}),(xi.prototype=Object.create(yi.prototype)).constructor=xi,(_i.prototype=Object.create(yi.prototype)).constructor=_i,(wi.prototype=Object.create(yi.prototype)).constructor=wi,(bi.prototype=Object.create(yi.prototype)).constructor=bi,(Mi.prototype=Object.create(yi.prototype)).constructor=Mi,(Si.prototype=Object.create(yi.prototype)).constructor=Si,(Ci.prototype=Object.create(yi.prototype)).constructor=Ci,(Ti.prototype=Object.create(yi.prototype)).constructor=Ti,(Ei.prototype=Object.create(yi.prototype)).constructor=Ei,Object.assign(Ai.prototype,{computeGroups:function(t){for(var e,n=[],i=void 0,r=t.faces,a=0;a<r.length;a++){var o=r[a];o.materialIndex!==i&&(i=o.materialIndex,void 0!==e&&(e.count=3*a-e.start,n.push(e)),e={start:3*a,materialIndex:i})}void 0!==e&&(e.count=3*a-e.start,n.push(e)),this.groups=n},fromGeometry:function(t){var e,n=t.faces,i=t.vertices,r=t.faceVertexUvs,a=r[0]&&0<r[0].length,o=r[1]&&0<r[1].length,s=t.morphTargets,l=s.length;if(0<l){e=[];for(var c=0;c<l;c++)e[c]={name:s[c].name,data:[]};this.morphTargets.position=e}var u,h=t.morphNormals,d=h.length;if(0<d){u=[];for(c=0;c<d;c++)u[c]={name:h[c].name,data:[]};this.morphTargets.normal=u}var p=t.skinIndices,f=t.skinWeights,m=p.length===i.length,g=f.length===i.length;0<i.length&&0===n.length&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(c=0;c<n.length;c++){var v=n[c];this.vertices.push(i[v.a],i[v.b],i[v.c]);var y=v.vertexNormals;if(3===y.length)this.normals.push(y[0],y[1],y[2]);else{var x=v.normal;this.normals.push(x,x,x)}var _,w=v.vertexColors;if(3===w.length)this.colors.push(w[0],w[1],w[2]);else{var b=v.color;this.colors.push(b,b,b)}if(!0===a)void 0!==(_=r[0][c])?this.uvs.push(_[0],_[1],_[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",c),this.uvs.push(new Re,new Re,new Re));if(!0===o)void 0!==(_=r[1][c])?this.uvs2.push(_[0],_[1],_[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",c),this.uvs2.push(new Re,new Re,new Re));for(var M=0;M<l;M++){var S=s[M].vertices;e[M].data.push(S[v.a],S[v.b],S[v.c])}for(M=0;M<d;M++){var C=h[M].vertexNormals[c];u[M].data.push(C.a,C.b,C.c)}m&&this.skinIndices.push(p[v.a],p[v.b],p[v.c]),g&&this.skinWeights.push(f[v.a],f[v.b],f[v.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 Li=1,Oi=new Qe,Ii=new yn,Pi=new We,Ri=new Pn,ki=new Pn,Ni=new We;function Bi(){Object.defineProperty(this,"id",{value:Li+=2}),this.uuid=Pe.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={}}Bi.prototype=Object.assign(Object.create(De.prototype),{constructor:Bi,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(t){Array.isArray(t)?this.index=new(65535<Di(t)?Ci:Mi)(t,1):this.index=t},getAttribute:function(t){return this.attributes[t]},setAttribute:function(t,e){return this.attributes[t]=e,this},deleteAttribute:function(t){return delete this.attributes[t],this},addGroup:function(t,e,n){this.groups.push({start:t,count:e,materialIndex:void 0!==n?n:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(t,e){this.drawRange.start=t,this.drawRange.count=e},applyMatrix4:function(t){var e=this.attributes.position;void 0!==e&&(e.applyMatrix4(t),e.needsUpdate=!0);var n=this.attributes.normal;if(void 0!==n){var i=(new ke).getNormalMatrix(t);n.applyNormalMatrix(i),n.needsUpdate=!0}var r=this.attributes.tangent;return void 0!==r&&(r.transformDirection(t),r.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(t){return Oi.makeRotationX(t),this.applyMatrix4(Oi),this},rotateY:function(t){return Oi.makeRotationY(t),this.applyMatrix4(Oi),this},rotateZ:function(t){return Oi.makeRotationZ(t),this.applyMatrix4(Oi),this},translate:function(t,e,n){return Oi.makeTranslation(t,e,n),this.applyMatrix4(Oi),this},scale:function(t,e,n){return Oi.makeScale(t,e,n),this.applyMatrix4(Oi),this},lookAt:function(t){return Ii.lookAt(t),Ii.updateMatrix(),this.applyMatrix4(Ii.matrix),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(Pi).negate(),this.translate(Pi.x,Pi.y,Pi.z),this},setFromObject:function(t){var e=t.geometry;if(t.isPoints||t.isLine){var n=new Ti(3*e.vertices.length,3),i=new Ti(3*e.colors.length,3);if(this.setAttribute("position",n.copyVector3sArray(e.vertices)),this.setAttribute("color",i.copyColorsArray(e.colors)),e.lineDistances&&e.lineDistances.length===e.vertices.length){var r=new Ti(e.lineDistances.length,1);this.setAttribute("lineDistance",r.copyArray(e.lineDistances))}null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone())}else t.isMesh&&e&&e.isGeometry&&this.fromGeometry(e);return this},setFromPoints:function(t){for(var e=[],n=0,i=t.length;n<i;n++){var r=t[n];e.push(r.x,r.y,r.z||0)}return this.setAttribute("position",new Ti(e,3)),this},updateFromObject:function(t){var e,n=t.geometry;if(t.isMesh){var i=n.__directGeometry;if(!0===n.elementsNeedUpdate&&(i=void 0,n.elementsNeedUpdate=!1),void 0===i)return this.fromGeometry(n);i.verticesNeedUpdate=n.verticesNeedUpdate,i.normalsNeedUpdate=n.normalsNeedUpdate,i.colorsNeedUpdate=n.colorsNeedUpdate,i.uvsNeedUpdate=n.uvsNeedUpdate,i.groupsNeedUpdate=n.groupsNeedUpdate,n.verticesNeedUpdate=!1,n.normalsNeedUpdate=!1,n.colorsNeedUpdate=!1,n.uvsNeedUpdate=!1,n.groupsNeedUpdate=!1,n=i}return!0===n.verticesNeedUpdate&&(void 0!==(e=this.attributes.position)&&(e.copyVector3sArray(n.vertices),e.needsUpdate=!0),n.verticesNeedUpdate=!1),!0===n.normalsNeedUpdate&&(void 0!==(e=this.attributes.normal)&&(e.copyVector3sArray(n.normals),e.needsUpdate=!0),n.normalsNeedUpdate=!1),!0===n.colorsNeedUpdate&&(void 0!==(e=this.attributes.color)&&(e.copyColorsArray(n.colors),e.needsUpdate=!0),n.colorsNeedUpdate=!1),n.uvsNeedUpdate&&(void 0!==(e=this.attributes.uv)&&(e.copyVector2sArray(n.uvs),e.needsUpdate=!0),n.uvsNeedUpdate=!1),n.lineDistancesNeedUpdate&&(void 0!==(e=this.attributes.lineDistance)&&(e.copyArray(n.lineDistances),e.needsUpdate=!0),n.lineDistancesNeedUpdate=!1),n.groupsNeedUpdate&&(n.computeGroups(t.geometry),this.groups=n.groups,n.groupsNeedUpdate=!1),this},fromGeometry:function(t){return t.__directGeometry=(new Ai).fromGeometry(t),this.fromDirectGeometry(t.__directGeometry)},fromDirectGeometry:function(t){var e=new Float32Array(3*t.vertices.length);if(this.setAttribute("position",new yi(e,3).copyVector3sArray(t.vertices)),0<t.normals.length){var n=new Float32Array(3*t.normals.length);this.setAttribute("normal",new yi(n,3).copyVector3sArray(t.normals))}if(0<t.colors.length){var i=new Float32Array(3*t.colors.length);this.setAttribute("color",new yi(i,3).copyColorsArray(t.colors))}if(0<t.uvs.length){var r=new Float32Array(2*t.uvs.length);this.setAttribute("uv",new yi(r,2).copyVector2sArray(t.uvs))}if(0<t.uvs2.length){var a=new Float32Array(2*t.uvs2.length);this.setAttribute("uv2",new yi(a,2).copyVector2sArray(t.uvs2))}for(var o in this.groups=t.groups,t.morphTargets){for(var s=[],l=t.morphTargets[o],c=0,u=l.length;c<u;c++){var h=l[c],d=new Ti(3*h.data.length,3);d.name=h.name,s.push(d.copyVector3sArray(h.data))}this.morphAttributes[o]=s}if(0<t.skinIndices.length){var p=new Ti(4*t.skinIndices.length,4);this.setAttribute("skinIndex",p.copyVector4sArray(t.skinIndices))}if(0<t.skinWeights.length){var f=new Ti(4*t.skinWeights.length,4);this.setAttribute("skinWeight",f.copyVector4sArray(t.skinWeights))}return null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),this},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new Pn);var t=this.attributes.position,e=this.morphAttributes.position;if(void 0!==t){if(this.boundingBox.setFromBufferAttribute(t),e)for(var n=0,i=e.length;n<i;n++){var r=e[n];Ri.setFromBufferAttribute(r),this.morphTargetsRelative?(Ni.addVectors(this.boundingBox.min,Ri.min),this.boundingBox.expandByPoint(Ni),Ni.addVectors(this.boundingBox.max,Ri.max),this.boundingBox.expandByPoint(Ni)):(this.boundingBox.expandByPoint(Ri.min),this.boundingBox.expandByPoint(Ri.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new Nn);var t=this.attributes.position,e=this.morphAttributes.position;if(t){var n=this.boundingSphere.center;if(Ri.setFromBufferAttribute(t),e)for(var i=0,r=e.length;i<r;i++){var a=e[i];ki.setFromBufferAttribute(a),this.morphTargetsRelative?(Ni.addVectors(Ri.min,ki.min),Ri.expandByPoint(Ni),Ni.addVectors(Ri.max,ki.max),Ri.expandByPoint(Ni)):(Ri.expandByPoint(ki.min),Ri.expandByPoint(ki.max))}Ri.getCenter(n);var o=0;for(i=0,r=t.count;i<r;i++)Ni.fromBufferAttribute(t,i),o=Math.max(o,n.distanceToSquared(Ni));if(e)for(i=0,r=e.length;i<r;i++){a=e[i];for(var s=this.morphTargetsRelative,l=0,c=a.count;l<c;l++)Ni.fromBufferAttribute(a,l),s&&(Pi.fromBufferAttribute(t,l),Ni.add(Pi)),o=Math.max(o,n.distanceToSquared(Ni))}this.boundingSphere.radius=Math.sqrt(o),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}},computeFaceNormals:function(){},computeVertexNormals:function(){var t=this.index,e=this.attributes;if(e.position){var n=e.position.array;if(void 0===e.normal)this.setAttribute("normal",new yi(new Float32Array(n.length),3));else for(var i=e.normal.array,r=0,a=i.length;r<a;r++)i[r]=0;var o,s,l,c=e.normal.array,u=new We,h=new We,d=new We,p=new We,f=new We;if(t){var m=t.array;for(r=0,a=t.count;r<a;r+=3)o=3*m[r+0],s=3*m[r+1],l=3*m[r+2],u.fromArray(n,o),h.fromArray(n,s),d.fromArray(n,l),p.subVectors(d,h),f.subVectors(u,h),p.cross(f),c[o]+=p.x,c[1+o]+=p.y,c[2+o]+=p.z,c[s]+=p.x,c[1+s]+=p.y,c[2+s]+=p.z,c[l]+=p.x,c[1+l]+=p.y,c[2+l]+=p.z}else for(r=0,a=n.length;r<a;r+=9)u.fromArray(n,r),h.fromArray(n,r+3),d.fromArray(n,r+6),p.subVectors(d,h),f.subVectors(u,h),p.cross(f),c[r]=p.x,c[r+1]=p.y,c[r+2]=p.z,c[r+3]=p.x,c[r+4]=p.y,c[r+5]=p.z,c[r+6]=p.x,c[r+7]=p.y,c[r+8]=p.z;this.normalizeNormals(),e.normal.needsUpdate=!0}},merge:function(t,e){if(t&&t.isBufferGeometry){void 0===e&&(e=0,console.warn("THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge."));var n=this.attributes;for(var i in n)if(void 0!==t.attributes[i])for(var r=n[i].array,a=t.attributes[i],o=a.array,s=a.itemSize*e,l=Math.min(o.length,r.length-s),c=0,u=s;c<l;c++,u++)r[u]=o[c];return this}console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",t)},normalizeNormals:function(){for(var t=this.attributes.normal,e=0,n=t.count;e<n;e++)Ni.x=t.getX(e),Ni.y=t.getY(e),Ni.z=t.getZ(e),Ni.normalize(),t.setXYZ(e,Ni.x,Ni.y,Ni.z)},toNonIndexed:function(){function t(t,e){for(var n=t.array,i=t.itemSize,r=new n.constructor(e.length*i),a=0,o=0,s=0,l=e.length;s<l;s++){a=e[s]*i;for(var c=0;c<i;c++)r[o++]=n[a++]}return new yi(r,i)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),this;var e=new Bi,n=this.index.array,i=this.attributes;for(var r in i){var a=t(i[r],n);e.setAttribute(r,a)}var o=this.morphAttributes;for(r in o){for(var s=[],l=o[r],c=0,u=l.length;c<u;c++){a=t(l[c],n);s.push(a)}e.morphAttributes[r]=s}e.morphTargetsRelative=this.morphTargetsRelative;for(var h=this.groups,d=(c=0,h.length);c<d;c++){var p=h[c];e.addGroup(p.start,p.count,p.materialIndex)}return e},toJSON:function(){var t={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),0<Object.keys(this.userData).length&&(t.userData=this.userData),void 0!==this.parameters){var e=this.parameters;for(var n in e)void 0!==e[n]&&(t[n]=e[n]);return t}t.data={attributes:{}};var i=this.index;null!==i&&(t.data.index={type:i.array.constructor.name,array:Array.prototype.slice.call(i.array)});var r=this.attributes;for(var n in r){var a=(d=r[n]).toJSON();""!==d.name&&(a.name=d.name),t.data.attributes[n]=a}var o={},s=!1;for(var n in this.morphAttributes){for(var l=this.morphAttributes[n],c=[],u=0,h=l.length;u<h;u++){var d;a=(d=l[u]).toJSON();""!==d.name&&(a.name=d.name),c.push(a)}0<c.length&&(o[n]=c,s=!0)}s&&(t.data.morphAttributes=o,t.data.morphTargetsRelative=this.morphTargetsRelative);var p=this.groups;0<p.length&&(t.data.groups=JSON.parse(JSON.stringify(p)));var f=this.boundingSphere;return null!==f&&(t.data.boundingSphere={center:f.center.toArray(),radius:f.radius}),t},clone:function(){return(new Bi).copy(this)},copy:function(t){var e,n,i;this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.name=t.name;var r=t.index;null!==r&&this.setIndex(r.clone());var a=t.attributes;for(e in a){var o=a[e];this.setAttribute(e,o.clone())}var s=t.morphAttributes;for(e in s){var l=[],c=s[e];for(n=0,i=c.length;n<i;n++)l.push(c[n].clone());this.morphAttributes[e]=l}this.morphTargetsRelative=t.morphTargetsRelative;var u=t.groups;for(n=0,i=u.length;n<i;n++){var h=u[n];this.addGroup(h.start,h.count,h.materialIndex)}var d=t.boundingBox;null!==d&&(this.boundingBox=d.clone());var p=t.boundingSphere;return null!==p&&(this.boundingSphere=p.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this},dispose:function(){this.dispatchEvent({type:"dispose"})}});var Fi=new Qe,zi=new Hn,Vi=new Nn,Ui=new We,ji=new We,Gi=new We,Hi=new We,Wi=new We,Ji=new We,qi=new We,Xi=new We,Yi=new We,Zi=new Re,$i=new Re,Ki=new Re,Qi=new We,tr=new We;function er(t,e){yn.call(this),this.type="Mesh",this.geometry=void 0!==t?t:new Bi,this.material=void 0!==e?e:new gi,this.updateMorphTargets()}function nr(t,e,n,i,r,a,o,s){if(null===(e.side===St?i.intersectTriangle(o,a,r,!0,s):i.intersectTriangle(r,a,o,e.side!==$,s)))return null;tr.copy(s),tr.applyMatrix4(t.matrixWorld);var l=n.ray.origin.distanceTo(tr);return l<n.near||l>n.far?null:{distance:l,point:tr.clone(),object:t}}function ir(t,e,n,i,r,a,o,s,l,c,u,h){Ui.fromBufferAttribute(r,c),ji.fromBufferAttribute(r,u),Gi.fromBufferAttribute(r,h);var d=t.morphTargetInfluences;if(e.morphTargets&&a&&d){qi.set(0,0,0),Xi.set(0,0,0),Yi.set(0,0,0);for(var p=0,f=a.length;p<f;p++){var m=d[p],g=a[p];0!==m&&(Hi.fromBufferAttribute(g,c),Wi.fromBufferAttribute(g,u),Ji.fromBufferAttribute(g,h),o?(qi.addScaledVector(Hi,m),Xi.addScaledVector(Wi,m),Yi.addScaledVector(Ji,m)):(qi.addScaledVector(Hi.sub(Ui),m),Xi.addScaledVector(Wi.sub(ji),m),Yi.addScaledVector(Ji.sub(Gi),m)))}Ui.add(qi),ji.add(Xi),Gi.add(Yi)}var v=nr(t,e,n,i,Ui,ji,Gi,Qi);if(v){s&&(Zi.fromBufferAttribute(s,c),$i.fromBufferAttribute(s,u),Ki.fromBufferAttribute(s,h),v.uv=ai.getUV(Qi,Ui,ji,Gi,Zi,$i,Ki,new Re)),l&&(Zi.fromBufferAttribute(l,c),$i.fromBufferAttribute(l,u),Ki.fromBufferAttribute(l,h),v.uv2=ai.getUV(Qi,Ui,ji,Gi,Zi,$i,Ki,new Re));var y=new pi(c,u,h);ai.getNormal(Ui,ji,Gi,y.normal),v.face=y}return v}er.prototype=Object.assign(Object.create(yn.prototype),{constructor:er,isMesh:!0,copy:function(t){return yn.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,e,n,i=this.geometry;if(i.isBufferGeometry){var r=i.morphAttributes,a=Object.keys(r);if(0<a.length){var o=r[a[0]];if(void 0!==o)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},t=0,e=o.length;t<e;t++)n=o[t].name||String(t),this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=t}}else{var s=i.morphTargets;void 0!==s&&0<s.length&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},raycast:function(t,e){var n,i=this.geometry,r=this.material,a=this.matrixWorld;if(void 0!==r&&(null===i.boundingSphere&&i.computeBoundingSphere(),Vi.copy(i.boundingSphere),Vi.applyMatrix4(a),!1!==t.ray.intersectsSphere(Vi)&&(Fi.getInverse(a),zi.copy(t.ray).applyMatrix4(Fi),null===i.boundingBox||!1!==zi.intersectsBox(i.boundingBox))))if(i.isBufferGeometry){var o,s,l,c,u,h,d,p,f,m=i.index,g=i.attributes.position,v=i.morphAttributes.position,y=i.morphTargetsRelative,x=i.attributes.uv,_=i.attributes.uv2,w=i.groups,b=i.drawRange;if(null!==m)if(Array.isArray(r))for(c=0,h=w.length;c<h;c++)for(f=r[(p=w[c]).materialIndex],u=Math.max(p.start,b.start),d=Math.min(p.start+p.count,b.start+b.count);u<d;u+=3)o=m.getX(u),s=m.getX(u+1),l=m.getX(u+2),(n=ir(this,f,t,zi,g,v,y,x,_,o,s,l))&&(n.faceIndex=Math.floor(u/3),n.face.materialIndex=p.materialIndex,e.push(n));else for(c=Math.max(0,b.start),h=Math.min(m.count,b.start+b.count);c<h;c+=3)o=m.getX(c),s=m.getX(c+1),l=m.getX(c+2),(n=ir(this,r,t,zi,g,v,y,x,_,o,s,l))&&(n.faceIndex=Math.floor(c/3),e.push(n));else if(void 0!==g)if(Array.isArray(r))for(c=0,h=w.length;c<h;c++)for(f=r[(p=w[c]).materialIndex],u=Math.max(p.start,b.start),d=Math.min(p.start+p.count,b.start+b.count);u<d;u+=3)(n=ir(this,f,t,zi,g,v,y,x,_,o=u,s=u+1,l=u+2))&&(n.faceIndex=Math.floor(u/3),n.face.materialIndex=p.materialIndex,e.push(n));else for(c=Math.max(0,b.start),h=Math.min(g.count,b.start+b.count);c<h;c+=3)(n=ir(this,r,t,zi,g,v,y,x,_,o=c,s=c+1,l=c+2))&&(n.faceIndex=Math.floor(c/3),e.push(n))}else if(i.isGeometry){var M,S,C,T,E=Array.isArray(r),A=i.vertices,D=i.faces,L=i.faceVertexUvs[0];0<L.length&&(T=L);for(var O=0,I=D.length;O<I;O++){var P=D[O],R=E?r[P.materialIndex]:r;if(void 0!==R&&(M=A[P.a],S=A[P.b],C=A[P.c],n=nr(this,R,t,zi,M,S,C,Qi))){if(T&&T[O]){var k=T[O];Zi.copy(k[0]),$i.copy(k[1]),Ki.copy(k[2]),n.uv=ai.getUV(Qi,M,S,C,Zi,$i,Ki,new Re)}n.face=P,n.faceIndex=O,e.push(n)}}}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var rr=0,ar=new Qe,or=new yn,sr=new We;function lr(){Object.defineProperty(this,"id",{value:rr+=2}),this.uuid=Pe.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}lr.prototype=Object.assign(Object.create(De.prototype),{constructor:lr,isGeometry:!0,applyMatrix4:function(t){for(var e=(new ke).getNormalMatrix(t),n=0,i=this.vertices.length;n<i;n++){this.vertices[n].applyMatrix4(t)}for(n=0,i=this.faces.length;n<i;n++){var r=this.faces[n];r.normal.applyMatrix3(e).normalize();for(var a=0,o=r.vertexNormals.length;a<o;a++)r.vertexNormals[a].applyMatrix3(e).normalize()}return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},rotateX:function(t){return ar.makeRotationX(t),this.applyMatrix4(ar),this},rotateY:function(t){return ar.makeRotationY(t),this.applyMatrix4(ar),this},rotateZ:function(t){return ar.makeRotationZ(t),this.applyMatrix4(ar),this},translate:function(t,e,n){return ar.makeTranslation(t,e,n),this.applyMatrix4(ar),this},scale:function(t,e,n){return ar.makeScale(t,e,n),this.applyMatrix4(ar),this},lookAt:function(t){return or.lookAt(t),or.updateMatrix(),this.applyMatrix4(or.matrix),this},fromBufferGeometry:function(t){var o=this,e=null!==t.index?t.index.array:void 0,n=t.attributes;if(void 0===n.position)return console.error("THREE.Geometry.fromBufferGeometry(): Position attribute required for conversion."),this;var i=n.position.array,s=void 0!==n.normal?n.normal.array:void 0,l=void 0!==n.color?n.color.array:void 0,c=void 0!==n.uv?n.uv.array:void 0,u=void 0!==n.uv2?n.uv2.array:void 0;void 0!==u&&(this.faceVertexUvs[1]=[]);for(var r=0;r<i.length;r+=3)o.vertices.push((new We).fromArray(i,r)),void 0!==l&&o.colors.push((new ci).fromArray(l,r));function a(t,e,n,i){var r=void 0===l?[]:[o.colors[t].clone(),o.colors[e].clone(),o.colors[n].clone()],a=new pi(t,e,n,void 0===s?[]:[(new We).fromArray(s,3*t),(new We).fromArray(s,3*e),(new We).fromArray(s,3*n)],r,i);o.faces.push(a),void 0!==c&&o.faceVertexUvs[0].push([(new Re).fromArray(c,2*t),(new Re).fromArray(c,2*e),(new Re).fromArray(c,2*n)]),void 0!==u&&o.faceVertexUvs[1].push([(new Re).fromArray(u,2*t),(new Re).fromArray(u,2*e),(new Re).fromArray(u,2*n)])}var h=t.groups;if(0<h.length)for(r=0;r<h.length;r++)for(var d=h[r],p=d.start,f=p,m=p+d.count;f<m;f+=3)void 0!==e?a(e[f],e[f+1],e[f+2],d.materialIndex):a(f,f+1,f+2,d.materialIndex);else if(void 0!==e)for(r=0;r<e.length;r+=3)a(e[r],e[r+1],e[r+2]);else for(r=0;r<i.length/3;r+=3)a(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(sr).negate(),this.translate(sr.x,sr.y,sr.z),this},normalize:function(){this.computeBoundingSphere();var t=this.boundingSphere.center,e=this.boundingSphere.radius,n=0===e?1:1/e,i=new Qe;return i.set(n,0,0,-n*t.x,0,n,0,-n*t.y,0,0,n,-n*t.z,0,0,0,1),this.applyMatrix4(i),this},computeFaceNormals:function(){for(var t=new We,e=new We,n=0,i=this.faces.length;n<i;n++){var r=this.faces[n],a=this.vertices[r.a],o=this.vertices[r.b],s=this.vertices[r.c];t.subVectors(s,o),e.subVectors(a,o),t.cross(e),t.normalize(),r.normal.copy(t)}},computeVertexNormals:function(t){var e,n,i,r,a,o;for(void 0===t&&(t=!0),o=new Array(this.vertices.length),e=0,n=this.vertices.length;e<n;e++)o[e]=new We;if(t){var s,l,c,u=new We,h=new We;for(i=0,r=this.faces.length;i<r;i++)a=this.faces[i],s=this.vertices[a.a],l=this.vertices[a.b],c=this.vertices[a.c],u.subVectors(c,l),h.subVectors(s,l),u.cross(h),o[a.a].add(u),o[a.b].add(u),o[a.c].add(u)}else for(this.computeFaceNormals(),i=0,r=this.faces.length;i<r;i++)o[(a=this.faces[i]).a].add(a.normal),o[a.b].add(a.normal),o[a.c].add(a.normal);for(e=0,n=this.vertices.length;e<n;e++)o[e].normalize();for(i=0,r=this.faces.length;i<r;i++){var d=(a=this.faces[i]).vertexNormals;3===d.length?(d[0].copy(o[a.a]),d[1].copy(o[a.b]),d[2].copy(o[a.c])):(d[0]=o[a.a].clone(),d[1]=o[a.b].clone(),d[2]=o[a.c].clone())}0<this.faces.length&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){var t,e,n;for(this.computeFaceNormals(),t=0,e=this.faces.length;t<e;t++){var i=(n=this.faces[t]).vertexNormals;3===i.length?(i[0].copy(n.normal),i[1].copy(n.normal),i[2].copy(n.normal)):(i[0]=n.normal.clone(),i[1]=n.normal.clone(),i[2]=n.normal.clone())}0<this.faces.length&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){var t,e,n,i,r;for(n=0,i=this.faces.length;n<i;n++)for((r=this.faces[n]).__originalFaceNormal?r.__originalFaceNormal.copy(r.normal):r.__originalFaceNormal=r.normal.clone(),r.__originalVertexNormals||(r.__originalVertexNormals=[]),t=0,e=r.vertexNormals.length;t<e;t++)r.__originalVertexNormals[t]?r.__originalVertexNormals[t].copy(r.vertexNormals[t]):r.__originalVertexNormals[t]=r.vertexNormals[t].clone();var a=new lr;for(a.faces=this.faces,t=0,e=this.morphTargets.length;t<e;t++){if(!this.morphNormals[t]){this.morphNormals[t]={},this.morphNormals[t].faceNormals=[],this.morphNormals[t].vertexNormals=[];var o=this.morphNormals[t].faceNormals,s=this.morphNormals[t].vertexNormals;for(n=0,i=this.faces.length;n<i;n++)l=new We,c={a:new We,b:new We,c:new We},o.push(l),s.push(c)}var l,c,u=this.morphNormals[t];for(a.vertices=this.morphTargets[t].vertices,a.computeFaceNormals(),a.computeVertexNormals(),n=0,i=this.faces.length;n<i;n++)r=this.faces[n],l=u.faceNormals[n],c=u.vertexNormals[n],l.copy(r.normal),c.a.copy(r.vertexNormals[0]),c.b.copy(r.vertexNormals[1]),c.c.copy(r.vertexNormals[2])}for(n=0,i=this.faces.length;n<i;n++)(r=this.faces[n]).normal=r.__originalFaceNormal,r.vertexNormals=r.__originalVertexNormals},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new Pn),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new Nn),this.boundingSphere.setFromPoints(this.vertices)},merge:function(t,e,n){if(t&&t.isGeometry){var i,r=this.vertices.length,a=this.vertices,o=t.vertices,s=this.faces,l=t.faces,c=this.colors,u=t.colors;void 0===n&&(n=0),void 0!==e&&(i=(new ke).getNormalMatrix(e));for(var h=0,d=o.length;h<d;h++){var p=o[h].clone();void 0!==e&&p.applyMatrix4(e),a.push(p)}for(h=0,d=u.length;h<d;h++)c.push(u[h].clone());for(h=0,d=l.length;h<d;h++){var f,m,g,v=l[h],y=v.vertexNormals,x=v.vertexColors;(f=new pi(v.a+r,v.b+r,v.c+r)).normal.copy(v.normal),void 0!==i&&f.normal.applyMatrix3(i).normalize();for(var _=0,w=y.length;_<w;_++)m=y[_].clone(),void 0!==i&&m.applyMatrix3(i).normalize(),f.vertexNormals.push(m);f.color.copy(v.color);for(_=0,w=x.length;_<w;_++)g=x[_],f.vertexColors.push(g.clone());f.materialIndex=v.materialIndex+n,s.push(f)}for(h=0,d=t.faceVertexUvs.length;h<d;h++){var b=t.faceVertexUvs[h];void 0===this.faceVertexUvs[h]&&(this.faceVertexUvs[h]=[]);for(_=0,w=b.length;_<w;_++){for(var M=b[_],S=[],C=0,T=M.length;C<T;C++)S.push(M[C].clone());this.faceVertexUvs[h].push(S)}}}else console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",t)},mergeMesh:function(t){t&&t.isMesh?(t.matrixAutoUpdate&&t.updateMatrix(),this.merge(t.geometry,t.matrix)):console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",t)},mergeVertices:function(){var t,e,n,i,r,a,o,s,l={},c=[],u=[],h=Math.pow(10,4);for(n=0,i=this.vertices.length;n<i;n++)t=this.vertices[n],void 0===l[e=Math.round(t.x*h)+"_"+Math.round(t.y*h)+"_"+Math.round(t.z*h)]?(l[e]=n,c.push(this.vertices[n]),u[n]=c.length-1):u[n]=u[l[e]];var d=[];for(n=0,i=this.faces.length;n<i;n++){(r=this.faces[n]).a=u[r.a],r.b=u[r.b],r.c=u[r.c],a=[r.a,r.b,r.c];for(var p=0;p<3;p++)if(a[p]===a[(p+1)%3]){d.push(n);break}}for(n=d.length-1;0<=n;n--){var f=d[n];for(this.faces.splice(f,1),o=0,s=this.faceVertexUvs.length;o<s;o++)this.faceVertexUvs[o].splice(f,1)}var m=this.vertices.length-c.length;return this.vertices=c,m},setFromPoints:function(t){this.vertices=[];for(var e=0,n=t.length;e<n;e++){var i=t[e];this.vertices.push(new We(i.x,i.y,i.z||0))}return this},sortFacesByMaterialIndex:function(){for(var t=this.faces,e=t.length,n=0;n<e;n++)t[n]._id=n;t.sort(function(t,e){return t.materialIndex-e.materialIndex});var i,r,a=this.faceVertexUvs[0],o=this.faceVertexUvs[1];a&&a.length===e&&(i=[]),o&&o.length===e&&(r=[]);for(n=0;n<e;n++){var s=t[n]._id;i&&i.push(a[s]),r&&r.push(o[s])}i&&(this.faceVertexUvs[0]=i),r&&(this.faceVertexUvs[1]=r)},toJSON:function(){var t={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),void 0!==this.parameters){var e=this.parameters;for(var n in e)void 0!==e[n]&&(t[n]=e[n]);return t}for(var i=[],r=0;r<this.vertices.length;r++){var a=this.vertices[r];i.push(a.x,a.y,a.z)}var o=[],s=[],l={},c=[],u={},h=[],d={};for(r=0;r<this.faces.length;r++){var p=this.faces[r],f=void 0!==this.faceVertexUvs[0][r],m=0<p.normal.length(),g=0<p.vertexNormals.length,v=1!==p.color.r||1!==p.color.g||1!==p.color.b,y=0<p.vertexColors.length,x=0;if(x=M(x,0,0),x=M(x,1,!0),x=M(x,2,!1),x=M(x,3,f),x=M(x,4,m),x=M(x,5,g),x=M(x,6,v),x=M(x,7,y),o.push(x),o.push(p.a,p.b,p.c),o.push(p.materialIndex),f){var _=this.faceVertexUvs[0][r];o.push(T(_[0]),T(_[1]),T(_[2]))}if(m&&o.push(S(p.normal)),g){var w=p.vertexNormals;o.push(S(w[0]),S(w[1]),S(w[2]))}if(v&&o.push(C(p.color)),y){var b=p.vertexColors;o.push(C(b[0]),C(b[1]),C(b[2]))}}function M(t,e,n){return n?t|1<<e:t&~(1<<e)}function S(t){var e=t.x.toString()+t.y.toString()+t.z.toString();return void 0!==l[e]||(l[e]=s.length/3,s.push(t.x,t.y,t.z)),l[e]}function C(t){var e=t.r.toString()+t.g.toString()+t.b.toString();return void 0!==u[e]||(u[e]=c.length,c.push(t.getHex())),u[e]}function T(t){var e=t.x.toString()+t.y.toString();return void 0!==d[e]||(d[e]=h.length/2,h.push(t.x,t.y)),d[e]}return t.data={},t.data.vertices=i,t.data.normals=s,0<c.length&&(t.data.colors=c),0<h.length&&(t.data.uvs=[h]),t.data.faces=o,t},clone:function(){return(new lr).copy(this)},copy:function(t){var e,n,i,r,a,o;this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=t.name;var s=t.vertices;for(e=0,n=s.length;e<n;e++)this.vertices.push(s[e].clone());var l=t.colors;for(e=0,n=l.length;e<n;e++)this.colors.push(l[e].clone());var c=t.faces;for(e=0,n=c.length;e<n;e++)this.faces.push(c[e].clone());for(e=0,n=t.faceVertexUvs.length;e<n;e++){var u=t.faceVertexUvs[e];for(void 0===this.faceVertexUvs[e]&&(this.faceVertexUvs[e]=[]),i=0,r=u.length;i<r;i++){var h=u[i],d=[];for(a=0,o=h.length;a<o;a++){var p=h[a];d.push(p.clone())}this.faceVertexUvs[e].push(d)}}var f=t.morphTargets;for(e=0,n=f.length;e<n;e++){var m={};if(m.name=f[e].name,void 0!==f[e].vertices)for(m.vertices=[],i=0,r=f[e].vertices.length;i<r;i++)m.vertices.push(f[e].vertices[i].clone());if(void 0!==f[e].normals)for(m.normals=[],i=0,r=f[e].normals.length;i<r;i++)m.normals.push(f[e].normals[i].clone());this.morphTargets.push(m)}var g=t.morphNormals;for(e=0,n=g.length;e<n;e++){var v={};if(void 0!==g[e].vertexNormals)for(v.vertexNormals=[],i=0,r=g[e].vertexNormals.length;i<r;i++){var y=g[e].vertexNormals[i],x={};x.a=y.a.clone(),x.b=y.b.clone(),x.c=y.c.clone(),v.vertexNormals.push(x)}if(void 0!==g[e].faceNormals)for(v.faceNormals=[],i=0,r=g[e].faceNormals.length;i<r;i++)v.faceNormals.push(g[e].faceNormals[i].clone());this.morphNormals.push(v)}var _=t.skinWeights;for(e=0,n=_.length;e<n;e++)this.skinWeights.push(_[e].clone());var w=t.skinIndices;for(e=0,n=w.length;e<n;e++)this.skinIndices.push(w[e].clone());var b=t.lineDistances;for(e=0,n=b.length;e<n;e++)this.lineDistances.push(b[e]);var M=t.boundingBox;null!==M&&(this.boundingBox=M.clone());var S=t.boundingSphere;return null!==S&&(this.boundingSphere=S.clone()),this.elementsNeedUpdate=t.elementsNeedUpdate,this.verticesNeedUpdate=t.verticesNeedUpdate,this.uvsNeedUpdate=t.uvsNeedUpdate,this.normalsNeedUpdate=t.normalsNeedUpdate,this.colorsNeedUpdate=t.colorsNeedUpdate,this.lineDistancesNeedUpdate=t.lineDistancesNeedUpdate,this.groupsNeedUpdate=t.groupsNeedUpdate,this},dispose:function(){this.dispatchEvent({type:"dispose"})}});var cr=function(o){function t(t,e,n,i,r,a){o.call(this),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:i,heightSegments:r,depthSegments:a},this.fromBufferGeometry(new ur(t,e,n,i,r,a)),this.mergeVertices()}return o&&(t.__proto__=o),(t.prototype=Object.create(o&&o.prototype)).constructor=t}(lr),ur=function(s){function t(t,e,n,i,r,a){s.call(this),this.type="BoxBufferGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:i,heightSegments:r,depthSegments:a};var D=this;t=t||1,e=e||1,n=n||1,i=Math.floor(i)||1,r=Math.floor(r)||1,a=Math.floor(a)||1;var L=[],O=[],I=[],P=[],R=0,k=0;function o(t,e,n,i,r,a,o,s,l,c,u){var h,d,p=a/l,f=o/c,m=a/2,g=o/2,v=s/2,y=l+1,x=c+1,_=0,w=0,b=new We;for(d=0;d<x;d++){var M=d*f-g;for(h=0;h<y;h++){var S=h*p-m;b[t]=S*i,b[e]=M*r,b[n]=v,O.push(b.x,b.y,b.z),b[t]=0,b[e]=0,b[n]=0<s?1:-1,I.push(b.x,b.y,b.z),P.push(h/l),P.push(1-d/c),_+=1}}for(d=0;d<c;d++)for(h=0;h<l;h++){var C=R+h+y*d,T=R+h+y*(d+1),E=R+(h+1)+y*(d+1),A=R+(h+1)+y*d;L.push(C,T,A),L.push(T,E,A),w+=6}D.addGroup(k,w,u),k+=w,R+=_}o("z","y","x",-1,-1,n,e,t,a,r,0),o("z","y","x",1,-1,n,e,-t,a,r,1),o("x","z","y",1,1,t,n,e,i,a,2),o("x","z","y",1,-1,t,n,-e,i,a,3),o("x","y","z",1,-1,t,e,n,i,r,4),o("x","y","z",-1,-1,t,e,-n,i,r,5),this.setIndex(L),this.setAttribute("position",new Ti(O,3)),this.setAttribute("normal",new Ti(I,3)),this.setAttribute("uv",new Ti(P,2))}return s&&(t.__proto__=s),(t.prototype=Object.create(s&&s.prototype)).constructor=t}(Bi);function hr(t){var e={};for(var 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 dr(t){for(var e={},n=0;n<t.length;n++){var i=hr(t[n]);for(var r in i)e[r]=i[r]}return e}var pr={clone:hr,merge:dr},fr="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",mr="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}";function gr(t){mi.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader=fr,this.fragmentShader=mr,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))}function vr(){yn.call(this),this.type="Camera",this.matrixWorldInverse=new Qe,this.projectionMatrix=new Qe,this.projectionMatrixInverse=new Qe}function yr(t,e,n,i){vr.call(this),this.type="PerspectiveCamera",this.fov=void 0!==t?t:50,this.zoom=1,this.near=void 0!==n?n:.1,this.far=void 0!==i?i:2e3,this.focus=10,this.aspect=void 0!==e?e:1,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}((gr.prototype=Object.create(mi.prototype)).constructor=gr).prototype.isShaderMaterial=!0,gr.prototype.copy=function(t){return mi.prototype.copy.call(this,t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=hr(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},gr.prototype.toJSON=function(t){var e=mi.prototype.toJSON.call(this,t);for(var n in e.uniforms={},this.uniforms){var i=this.uniforms[n].value;i&&i.isTexture?e.uniforms[n]={type:"t",value:i.toJSON(t).uuid}:i&&i.isColor?e.uniforms[n]={type:"c",value:i.getHex()}:i&&i.isVector2?e.uniforms[n]={type:"v2",value:i.toArray()}:i&&i.isVector3?e.uniforms[n]={type:"v3",value:i.toArray()}:i&&i.isVector4?e.uniforms[n]={type:"v4",value:i.toArray()}:i&&i.isMatrix3?e.uniforms[n]={type:"m3",value:i.toArray()}:i&&i.isMatrix4?e.uniforms[n]={type:"m4",value:i.toArray()}:e.uniforms[n]={value:i}}0<Object.keys(this.defines).length&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader;var r={};for(var a in this.extensions)!0===this.extensions[a]&&(r[a]=!0);return 0<Object.keys(r).length&&(e.extensions=r),e},vr.prototype=Object.assign(Object.create(yn.prototype),{constructor:vr,isCamera:!0,copy:function(t,e){return yn.prototype.copy.call(this,t,e),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 We),this.updateMatrixWorld(!0);var e=this.matrixWorld.elements;return t.set(-e[8],-e[9],-e[10]).normalize()},updateMatrixWorld:function(t){yn.prototype.updateMatrixWorld.call(this,t),this.matrixWorldInverse.getInverse(this.matrixWorld)},updateWorldMatrix:function(t,e){yn.prototype.updateWorldMatrix.call(this,t,e),this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return(new this.constructor).copy(this)}}),yr.prototype=Object.assign(Object.create(vr.prototype),{constructor:yr,isPerspectiveCamera:!0,copy:function(t,e){return vr.prototype.copy.call(this,t,e),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){var e=.5*this.getFilmHeight()/t;this.fov=2*Pe.RAD2DEG*Math.atan(e),this.updateProjectionMatrix()},getFocalLength:function(){var t=Math.tan(.5*Pe.DEG2RAD*this.fov);return.5*this.getFilmHeight()/t},getEffectiveFOV:function(){return 2*Pe.RAD2DEG*Math.atan(Math.tan(.5*Pe.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,e,n,i,r,a){this.aspect=t/e,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=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var t=this.near,e=t*Math.tan(.5*Pe.DEG2RAD*this.fov)/this.zoom,n=2*e,i=this.aspect*n,r=-.5*i,a=this.view;if(null!==this.view&&this.view.enabled){var o=a.fullWidth,s=a.fullHeight;r+=a.offsetX*i/o,e-=a.offsetY*n/s,i*=a.width/o,n*=a.height/s}var l=this.filmOffset;0!==l&&(r+=t*l/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+i,e,e-n,t,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(t){var e=yn.prototype.toJSON.call(this,t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,null!==this.view&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}});function xr(t,e,n,i){yn.call(this),this.type="CubeCamera";var a=new yr(90,1,t,e);a.up.set(0,-1,0),a.lookAt(new We(1,0,0)),this.add(a);var o=new yr(90,1,t,e);o.up.set(0,-1,0),o.lookAt(new We(-1,0,0)),this.add(o);var s=new yr(90,1,t,e);s.up.set(0,0,1),s.lookAt(new We(0,1,0)),this.add(s);var l=new yr(90,1,t,e);l.up.set(0,0,-1),l.lookAt(new We(0,-1,0)),this.add(l);var c=new yr(90,1,t,e);c.up.set(0,-1,0),c.lookAt(new We(0,0,1)),this.add(c);var u=new yr(90,1,t,e);u.up.set(0,-1,0),u.lookAt(new We(0,0,-1)),this.add(u),i=i||{format:Qt,magFilter:Ht,minFilter:Ht},this.renderTarget=new _r(n,i),this.renderTarget.texture.name="CubeCamera",this.update=function(t,e){null===this.parent&&this.updateMatrixWorld();var n=t.getRenderTarget(),i=this.renderTarget,r=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,t.setRenderTarget(i,0),t.render(e,a),t.setRenderTarget(i,1),t.render(e,o),t.setRenderTarget(i,2),t.render(e,s),t.setRenderTarget(i,3),t.render(e,l),t.setRenderTarget(i,4),t.render(e,c),i.texture.generateMipmaps=r,t.setRenderTarget(i,5),t.render(e,u),t.setRenderTarget(n)},this.clear=function(t,e,n,i){for(var r=t.getRenderTarget(),a=this.renderTarget,o=0;o<6;o++)t.setRenderTarget(a,o),t.clear(e,n,i);t.setRenderTarget(r)}}function _r(t,e,n){Number.isInteger(e)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),e=n),Ve.call(this,t,t,e)}function wr(t,e,n,i,r,a,o,s,l,c,u,h){Fe.call(this,null,a,o,s,l,c,i,r,u,h),this.image={data:t||null,width:e||1,height:n||1},this.magFilter=void 0!==l?l:Ut,this.minFilter=void 0!==c?c:Ut,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}(xr.prototype=Object.create(yn.prototype)).constructor=xr,((_r.prototype=Object.create(Ve.prototype)).constructor=_r).prototype.isWebGLCubeRenderTarget=!0,_r.prototype.fromEquirectangularTexture=function(t,e){this.texture.type=e.type,this.texture.format=e.format,this.texture.encoding=e.encoding;var n=new xn,i={uniforms:{tEquirect:{value:null}},vertexShader:["varying vec3 vWorldDirection;","vec3 transformDirection( in vec3 dir, in mat4 matrix ) {","\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );","}","void main() {","\tvWorldDirection = transformDirection( position, modelMatrix );","\t#include <begin_vertex>","\t#include <project_vertex>","}"].join("\n"),fragmentShader:["uniform sampler2D tEquirect;","varying vec3 vWorldDirection;","#define RECIPROCAL_PI 0.31830988618","#define RECIPROCAL_PI2 0.15915494","void main() {","\tvec3 direction = normalize( vWorldDirection );","\tvec2 sampleUV;","\tsampleUV.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;","\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;","\tgl_FragColor = texture2D( tEquirect, sampleUV );","}"].join("\n")},r=new gr({type:"CubemapFromEquirect",uniforms:hr(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:St,blending:K});r.uniforms.tEquirect.value=e;var a=new er(new ur(5,5,5),r);n.add(a);var o=new xr(1,10,1);return o.renderTarget=this,o.renderTarget.texture.name="CubeCameraTexture",o.update(t,n),a.geometry.dispose(),a.material.dispose(),this},((wr.prototype=Object.create(Fe.prototype)).constructor=wr).prototype.isDataTexture=!0;var br=new Nn,Mr=new We;function Sr(t,e,n,i,r,a){this.planes=[void 0!==t?t:new Xn,void 0!==e?e:new Xn,void 0!==n?n:new Xn,void 0!==i?i:new Xn,void 0!==r?r:new Xn,void 0!==a?a:new Xn]}Object.assign(Sr.prototype,{set:function(t,e,n,i,r,a){var o=this.planes;return o[0].copy(t),o[1].copy(e),o[2].copy(n),o[3].copy(i),o[4].copy(r),o[5].copy(a),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){for(var e=this.planes,n=0;n<6;n++)e[n].copy(t.planes[n]);return this},setFromProjectionMatrix:function(t){var e=this.planes,n=t.elements,i=n[0],r=n[1],a=n[2],o=n[3],s=n[4],l=n[5],c=n[6],u=n[7],h=n[8],d=n[9],p=n[10],f=n[11],m=n[12],g=n[13],v=n[14],y=n[15];return e[0].setComponents(o-i,u-s,f-h,y-m).normalize(),e[1].setComponents(o+i,u+s,f+h,y+m).normalize(),e[2].setComponents(o+r,u+l,f+d,y+g).normalize(),e[3].setComponents(o-r,u-l,f-d,y-g).normalize(),e[4].setComponents(o-a,u-c,f-p,y-v).normalize(),e[5].setComponents(o+a,u+c,f+p,y+v).normalize(),this},intersectsObject:function(t){var e=t.geometry;return null===e.boundingSphere&&e.computeBoundingSphere(),br.copy(e.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(br)},intersectsSprite:function(t){return br.center.set(0,0,0),br.radius=.7071067811865476,br.applyMatrix4(t.matrixWorld),this.intersectsSphere(br)},intersectsSphere:function(t){for(var e=this.planes,n=t.center,i=-t.radius,r=0;r<6;r++){if(e[r].distanceToPoint(n)<i)return!1}return!0},intersectsBox:function(t){for(var e=this.planes,n=0;n<6;n++){var i=e[n];if(Mr.x=0<i.normal.x?t.max.x:t.min.x,Mr.y=0<i.normal.y?t.max.y:t.min.y,Mr.z=0<i.normal.z?t.max.z:t.min.z,i.distanceToPoint(Mr)<0)return!1}return!0},containsPoint:function(t){for(var e=this.planes,n=0;n<6;n++)if(e[n].distanceToPoint(t)<0)return!1;return!0}});var Cr={common:{diffuse:{value:new ci(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new ke},uv2Transform:{value:new ke},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 Re(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 ci(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}}},points:{diffuse:{value:new ci(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new ke}},sprite:{diffuse:{value:new ci(15658734)},opacity:{value:1},center:{value:new Re(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new ke}}};function Tr(){var n=null,i=!1,r=null;function a(t,e){!1!==i&&(r(t,e),n.requestAnimationFrame(a))}return{start:function(){!0!==i&&null!==r&&(n.requestAnimationFrame(a),i=!0)},stop:function(){i=!1},setAnimationLoop:function(t){r=t},setContext:function(t){n=t}}}function Er(l,t){var c=t.isWebGL2,u=new WeakMap;return{get:function(t){return t.isInterleavedBufferAttribute&&(t=t.data),u.get(t)},remove:function(t){t.isInterleavedBufferAttribute&&(t=t.data);var e=u.get(t);e&&(l.deleteBuffer(e.buffer),u.delete(t))},update:function(t,e){t.isInterleavedBufferAttribute&&(t=t.data);var n,i,r,a,o,s=u.get(t);void 0===s?u.set(t,function(t,e){var n=t.array,i=t.usage,r=l.createBuffer();l.bindBuffer(e,r),l.bufferData(e,n,i),t.onUploadCallback();var a=5126;return n instanceof Float32Array?a=5126:n instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):n instanceof Uint16Array?a=5123:n instanceof Int16Array?a=5122:n instanceof Uint32Array?a=5125:n instanceof Int32Array?a=5124:n instanceof Int8Array?a=5120:n instanceof Uint8Array&&(a=5121),{buffer:r,type:a,bytesPerElement:n.BYTES_PER_ELEMENT,version:t.version}}(t,e)):s.version<t.version&&(n=s.buffer,r=e,a=(i=t).array,o=i.updateRange,l.bindBuffer(r,n),-1===o.count?l.bufferSubData(r,0,a):(c?l.bufferSubData(r,o.offset*a.BYTES_PER_ELEMENT,a,o.offset,o.count):l.bufferSubData(r,o.offset*a.BYTES_PER_ELEMENT,a.subarray(o.offset,o.offset+o.count)),o.count=-1),s.version=t.version)}}}function Ar(t,e,n,i){lr.call(this),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:n,heightSegments:i},this.fromBufferGeometry(new Dr(t,e,n,i)),this.mergeVertices()}function Dr(t,e,n,i){Bi.call(this),this.type="PlaneBufferGeometry",this.parameters={width:t,height:e,widthSegments:n,heightSegments:i};var r,a,o=(t=t||1)/2,s=(e=e||1)/2,l=Math.floor(n)||1,c=Math.floor(i)||1,u=l+1,h=c+1,d=t/l,p=e/c,f=[],m=[],g=[],v=[];for(a=0;a<h;a++){var y=a*p-s;for(r=0;r<u;r++){var x=r*d-o;m.push(x,-y,0),g.push(0,0,1),v.push(r/l),v.push(1-a/c)}}for(a=0;a<c;a++)for(r=0;r<l;r++){var _=r+u*a,w=r+u*(a+1),b=r+1+u*(a+1),M=r+1+u*a;f.push(_,w,M),f.push(w,b,M)}this.setIndex(f),this.setAttribute("position",new Ti(m,3)),this.setAttribute("normal",new Ti(g,3)),this.setAttribute("uv",new Ti(v,2))}(Ar.prototype=Object.create(lr.prototype)).constructor=Ar,(Dr.prototype=Object.create(Bi.prototype)).constructor=Dr;var Lr={alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif",aomap_fragment:"#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\t#endif\n#endif",aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",begin_vertex:"vec3 transformed = vec3( position );",beginnormal_vertex:"vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",bsdfs:"vec2 integrateSpecularBRDF( const in float dotNV, const in float roughness ) {\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\treturn vec2( -1.04, 1.04 ) * a004 + r.zw;\n}\nfloat punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\tif( cutoffDistance > 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n#else\n\tif( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t}\n\treturn 1.0;\n#endif\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nvec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV );\n\tvec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0;\n\treturn Fr * fresnel + F0;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + viewDir );\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\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nvec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\treturn specularColor * brdf.x + brdf.y;\n}\nvoid BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tvec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\tvec3 FssEss = F * brdf.x + brdf.y;\n\tfloat Ess = brdf.x + brdf.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie(float roughness, float NoH) {\n\tfloat invAlpha = 1.0 / roughness;\n\tfloat cos2h = NoH * NoH;\n\tfloat sin2h = max(1.0 - cos2h, 0.0078125);\treturn (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI);\n}\nfloat V_Neubelt(float NoV, float NoL) {\n\treturn saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV)));\n}\nvec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) {\n\tvec3 N = geometry.normal;\n\tvec3 V = geometry.viewDir;\n\tvec3 H = normalize( V + L );\n\tfloat dotNH = saturate( dot( N, H ) );\n\treturn specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) );\n}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tfDet *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vViewPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vViewPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\t#if ! defined( STANDARD ) && ! defined( PHONG ) && ! defined( MATCAP )\n\t\tvarying vec3 vViewPosition;\n\t#endif\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( STANDARD ) && ! defined( PHONG ) && ! defined( MATCAP )\n\tvarying vec3 vViewPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( STANDARD ) && ! defined( PHONG ) && ! defined( MATCAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif",color_fragment:"#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_vertex:"#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",common:"#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#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract(sin(sn) * c);\n}\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\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n return m[ 2 ][ 3 ] == - 1.0;\n}",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n#define cubeUV_maxMipLevel 8.0\n#define cubeUV_minMipLevel 4.0\n#define cubeUV_maxTileSize 256.0\n#define cubeUV_minTileSize 16.0\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}\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}\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 float texelSize = 1.0 / (3.0 * cubeUV_maxTileSize);\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 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#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\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); }\n return mip;\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 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",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\ttransformedNormal = mat3( instanceMatrix ) * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",encodings_pars_fragment:"\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * value.a * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\tD = clamp( floor( D ) / 255.0, 0.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n\tvec3 Xp_Y_XYZp = cLogLuvM * value.rgb;\n\tXp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) );\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract( Le );\n\tvResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0;\n\treturn vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 );\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;\n\treturn vec4( max( vRGB, 0.0 ), 1.0 );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\t\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\tvec2 sampleUV;\n\t\treflectVec = normalize( reflectVec );\n\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\treflectVec = normalize( reflectVec );\n\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) );\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifndef ENVMAP_TYPE_CUBE_UV\n\t\tenvColor = envMapTexelToLinear( envColor );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\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",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#if defined( USE_ENVMAP )\n\t#ifdef ENVMAP_MODE_REFRACTION\n\t\tuniform float refractionRatio;\n\t#endif\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat sigma = PI * roughness * roughness / ( 1.0 + roughness );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + log2( sigma );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t vec3 reflectVec = reflect( -viewDir, normal );\n\t\t reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t#else\n\t\t vec3 reflectVec = refract( -viewDir, normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\t\tvec2 sampleUV;\n\t\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\t\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0,0.0,1.0 ) );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) { \n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tfogDepth = -mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float fogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float fogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn texture2D( gradientMap, coord ).rgb;\n\t#else\n\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\treflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n#endif",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) {\n\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t\tfloat shadowCameraNear;\n\t\tfloat shadowCameraFar;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tdirectLight.color = pointLight.color;\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( angleCos > spotLight.coneCos ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct ToonMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon\n#define Material_LightProbeLOD( material )\t(0)",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.specularRoughness = max( roughnessFactor, 0.0525 );material.specularRoughness += geometryRoughness;\nmaterial.specularRoughness = min( material.specularRoughness, 1.0 );\n#ifdef REFLECTIVITY\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#endif\n#ifdef CLEARCOAT\n\tmaterial.clearcoat = saturate( clearcoat );\tmaterial.clearcoatRoughness = max( clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheen;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n#ifdef CLEARCOAT\n\tfloat clearcoat;\n\tfloat clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tvec3 sheenColor;\n#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearcoatDHRApprox( const in float roughness, const in float dotNL ) {\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.specularRoughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = ccDotNL * directLight.color;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tccIrradiance *= PI;\n\t\t#endif\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t\treflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\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\treflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t\tfloat ccDotNL = ccDotNV;\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\tfloat clearcoatInv = 1.0 - clearcoatDHR;\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\tBRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering );\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\treflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\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\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tdirectLight.color *= all( bvec3( pointLight.shadow, directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tdirectLight.color *= all( bvec3( spotLight.shadow, directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectLight.color *= all( bvec3( directionalLight.shadow, directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel );\n\t#ifdef CLEARCOAT\n\t\tclearcoatRadiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n#endif\n#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tuniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifndef USE_MORPHNORMALS\n\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t#endif\n#endif",normal_fragment_begin:"#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t\tbitangent = bitangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#endif\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t#endif\n\t#endif\n#endif\nvec3 geometryNormal = normal;",normal_fragment_maps:"#ifdef OBJECTSPACE_NORMALMAP\n\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( TANGENTSPACE_NORMALMAP )\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\t#ifdef USE_TANGENT\n\t\tnormal = normalize( vTBN * mapN );\n\t#else\n\t\tnormal = perturbNormal2Arb( -vViewPosition, normal, mapN );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN ) {\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\t\tfloat scale = sign( st1.t * st0.s - st0.t * st1.s );\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\t\tmat3 tsn = mat3( S, T, N );\n\t\tmapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\t#ifdef USE_TANGENT\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\t#else\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN );\n\t#endif\n#endif",clearcoat_normalmap_pars_fragment:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\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}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\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 );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\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\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\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\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\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLight directionalLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tshadow *= all( bvec2( directionalLight.shadow, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLight spotLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tshadow *= all( bvec2( spotLight.shadow, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLight pointLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tshadow *= all( bvec2( pointLight.shadow, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform highp sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nuniform float toneMappingWhitePoint;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\nvec3 Uncharted2ToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( ( color * ( 2.51 * color + 0.03 ) ) / ( color * ( 2.43 * color + 0.59 ) + 0.14 ) );\n}",uv_pars_fragment:"#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#ifdef USE_UV\n\t#ifdef UVS_VERTEX_ONLY\n\t\tvec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif",uv_vertex:"#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\tuniform mat3 uv2Transform;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_frag:"uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",cube_frag:"#include <envmap_common_pars_fragment>\nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\tvec3 vReflect = vWorldDirection;\n\t#include <envmap_fragment>\n\tgl_FragColor = envColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",cube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <logdepthbuf_fragment>\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - gl_FragCoord.z ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( gl_FragCoord.z );\n\t#endif\n}",depth_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV;\n\tsampleUV.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n\tvec4 texColor = texture2D( tEquirect, sampleUV );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\tvLineDistance = scale * lineDistance;\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_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>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",meshbasic_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_ENVMAP\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}",meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_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>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <emissivemap_fragment>\n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\t#else\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\t#endif\n\t#include <lightmap_fragment>\n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_lambert_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t\tmatcapColor = matcapTexelToLinear( matcapColor );\n\t#else\n\t\tvec4 matcapColor = vec4( 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#ifndef FLAT_SHADED\n\t\tvNormal = normalize( transformedNormal );\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <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>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_toon_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_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>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define REFLECTIVITY\n\t#define CLEARCOAT\n\t#define TRANSPARENCY\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef TRANSPARENCY\n\tuniform float transparency;\n#endif\n#ifdef REFLECTIVITY\n\tuniform float reflectivity;\n#endif\n#ifdef CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheen;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <envmap_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_normalmap_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#ifdef TRANSPARENCY\n\t\tdiffuseColor.a *= saturate( 1. - transparency + linearToRelativeLuminance( reflectedLight.directSpecular + reflectedLight.indirectSpecular ) );\n\t#endif\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",normal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}",normal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",points_vert:"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",shadow_vert:"#include <fog_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\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>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}"},Or={basic:{uniforms:dr([Cr.common,Cr.specularmap,Cr.envmap,Cr.aomap,Cr.lightmap,Cr.fog]),vertexShader:Lr.meshbasic_vert,fragmentShader:Lr.meshbasic_frag},lambert:{uniforms:dr([Cr.common,Cr.specularmap,Cr.envmap,Cr.aomap,Cr.lightmap,Cr.emissivemap,Cr.fog,Cr.lights,{emissive:{value:new ci(0)}}]),vertexShader:Lr.meshlambert_vert,fragmentShader:Lr.meshlambert_frag},phong:{uniforms:dr([Cr.common,Cr.specularmap,Cr.envmap,Cr.aomap,Cr.lightmap,Cr.emissivemap,Cr.bumpmap,Cr.normalmap,Cr.displacementmap,Cr.fog,Cr.lights,{emissive:{value:new ci(0)},specular:{value:new ci(1118481)},shininess:{value:30}}]),vertexShader:Lr.meshphong_vert,fragmentShader:Lr.meshphong_frag},standard:{uniforms:dr([Cr.common,Cr.envmap,Cr.aomap,Cr.lightmap,Cr.emissivemap,Cr.bumpmap,Cr.normalmap,Cr.displacementmap,Cr.roughnessmap,Cr.metalnessmap,Cr.fog,Cr.lights,{emissive:{value:new ci(0)},roughness:{value:.5},metalness:{value:.5},envMapIntensity:{value:1}}]),vertexShader:Lr.meshphysical_vert,fragmentShader:Lr.meshphysical_frag},toon:{uniforms:dr([Cr.common,Cr.specularmap,Cr.aomap,Cr.lightmap,Cr.emissivemap,Cr.bumpmap,Cr.normalmap,Cr.displacementmap,Cr.gradientmap,Cr.fog,Cr.lights,{emissive:{value:new ci(0)},specular:{value:new ci(1118481)},shininess:{value:30}}]),vertexShader:Lr.meshtoon_vert,fragmentShader:Lr.meshtoon_frag},matcap:{uniforms:dr([Cr.common,Cr.bumpmap,Cr.normalmap,Cr.displacementmap,Cr.fog,{matcap:{value:null}}]),vertexShader:Lr.meshmatcap_vert,fragmentShader:Lr.meshmatcap_frag},points:{uniforms:dr([Cr.points,Cr.fog]),vertexShader:Lr.points_vert,fragmentShader:Lr.points_frag},dashed:{uniforms:dr([Cr.common,Cr.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Lr.linedashed_vert,fragmentShader:Lr.linedashed_frag},depth:{uniforms:dr([Cr.common,Cr.displacementmap]),vertexShader:Lr.depth_vert,fragmentShader:Lr.depth_frag},normal:{uniforms:dr([Cr.common,Cr.bumpmap,Cr.normalmap,Cr.displacementmap,{opacity:{value:1}}]),vertexShader:Lr.normal_vert,fragmentShader:Lr.normal_frag},sprite:{uniforms:dr([Cr.sprite,Cr.fog]),vertexShader:Lr.sprite_vert,fragmentShader:Lr.sprite_frag},background:{uniforms:{uvTransform:{value:new ke},t2D:{value:null}},vertexShader:Lr.background_vert,fragmentShader:Lr.background_frag},cube:{uniforms:dr([Cr.envmap,{opacity:{value:1}}]),vertexShader:Lr.cube_vert,fragmentShader:Lr.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Lr.equirect_vert,fragmentShader:Lr.equirect_frag},distanceRGBA:{uniforms:dr([Cr.common,Cr.displacementmap,{referencePosition:{value:new We},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Lr.distanceRGBA_vert,fragmentShader:Lr.distanceRGBA_frag},shadow:{uniforms:dr([Cr.lights,Cr.fog,{color:{value:new ci(0)},opacity:{value:1}}]),vertexShader:Lr.shadow_vert,fragmentShader:Lr.shadow_frag}};function Ir(l,n,c,i){var u,h,d=new ci(0),p=0,f=null,m=0,g=null;function v(t,e){n.buffers.color.setClear(t.r,t.g,t.b,e,i)}return{getClearColor:function(){return d},setClearColor:function(t,e){d.set(t),v(d,p=void 0!==e?e:1)},getClearAlpha:function(){return p},setClearAlpha:function(t){v(d,p=t)},render:function(t,e,n,i){var r=e.background,a=l.xr,o=a.getSession&&a.getSession();if(o&&"additive"===o.environmentBlendMode&&(r=null),null===r?v(d,p):r&&r.isColor&&(v(r,1),i=!0),(l.autoClear||i)&&l.clear(l.autoClearColor,l.autoClearDepth,l.autoClearStencil),r&&(r.isCubeTexture||r.isWebGLCubeRenderTarget||r.mapping===Nt)){void 0===h&&((h=new er(new ur(1,1,1),new gr({type:"BackgroundCubeMaterial",uniforms:hr(Or.cube.uniforms),vertexShader:Or.cube.vertexShader,fragmentShader:Or.cube.fragmentShader,side:St,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),h.geometry.deleteAttribute("uv"),h.onBeforeRender=function(t,e,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(h.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),c.update(h));var s=r.isWebGLCubeRenderTarget?r.texture:r;h.material.uniforms.envMap.value=s,h.material.uniforms.flipEnvMap.value=s.isCubeTexture?-1:1,f===r&&m===s.version&&g===l.toneMapping||(h.material.needsUpdate=!0,f=r,m=s.version,g=l.toneMapping),t.unshift(h,h.geometry,h.material,0,0,null)}else r&&r.isTexture&&(void 0===u&&((u=new er(new Dr(2,2),new gr({type:"BackgroundMaterial",uniforms:hr(Or.background.uniforms),vertexShader:Or.background.vertexShader,fragmentShader:Or.background.fragmentShader,side:O,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),Object.defineProperty(u.material,"map",{get:function(){return this.uniforms.t2D.value}}),c.update(u)),!0===(u.material.uniforms.t2D.value=r).matrixAutoUpdate&&r.updateMatrix(),u.material.uniforms.uvTransform.value.copy(r.matrix),f===r&&m===r.version&&g===l.toneMapping||(u.material.needsUpdate=!0,m=(f=r).version,g=l.toneMapping),t.unshift(u,u.geometry,u.material,0,0,null))}}}function Pr(o,s,l,t){var c,u=t.isWebGL2;this.setMode=function(t){c=t},this.render=function(t,e){o.drawArrays(c,t,e),l.update(e,c)},this.renderInstances=function(t,e,n,i){if(0!==i){var r,a;if(u)r=o,a="drawArraysInstanced";else if(a="drawArraysInstancedANGLE",null===(r=s.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");r[a](c,e,n,i),l.update(n,c,i)}}}function Rr(e,n,t){var i;function r(t){if("highp"===t){if(0<e.getShaderPrecisionFormat(35633,36338).precision&&0<e.getShaderPrecisionFormat(35632,36338).precision)return"highp";t="mediump"}return"mediump"===t&&0<e.getShaderPrecisionFormat(35633,36337).precision&&0<e.getShaderPrecisionFormat(35632,36337).precision?"mediump":"lowp"}var a="undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext||"undefined"!=typeof WebGL2ComputeRenderingContext&&e instanceof WebGL2ComputeRenderingContext,o=void 0!==t.precision?t.precision:"highp",s=r(o);s!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",s,"instead."),o=s);var l=!0===t.logarithmicDepthBuffer,c=e.getParameter(34930),u=e.getParameter(35660),h=e.getParameter(3379),d=e.getParameter(34076),p=e.getParameter(34921),f=e.getParameter(36347),m=e.getParameter(36348),g=e.getParameter(36349),v=0<u,y=a||!!n.get("OES_texture_float");return{isWebGL2:a,getMaxAnisotropy:function(){if(void 0!==i)return i;var t=n.get("EXT_texture_filter_anisotropic");return i=null!==t?e.getParameter(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0},getMaxPrecision:r,precision:o,logarithmicDepthBuffer:l,maxTextures:c,maxVertexTextures:u,maxTextureSize:h,maxCubemapSize:d,maxAttributes:p,maxVertexUniforms:f,maxVaryings:m,maxFragmentUniforms:g,vertexTextures:v,floatFragmentTextures:y,floatVertexTextures:v&&y,maxSamples:a?e.getParameter(36183):0}}function kr(){var u=this,h=null,d=0,p=!1,f=!1,m=new Xn,g=new ke,v={value:null,needsUpdate:!1};function y(){v.value!==h&&(v.value=h,v.needsUpdate=0<d),u.numPlanes=d,u.numIntersection=0}function x(t,e,n,i){var r=null!==t?t.length:0,a=null;if(0!==r){if(a=v.value,!0!==i||null===a){var o=n+4*r,s=e.matrixWorldInverse;g.getNormalMatrix(s),(null===a||a.length<o)&&(a=new Float32Array(o));for(var l=0,c=n;l!==r;++l,c+=4)m.copy(t[l]).applyMatrix4(s,g),m.normal.toArray(a,c),a[c+3]=m.constant}v.value=a,v.needsUpdate=!0}return u.numPlanes=r,a}this.uniform=v,this.numPlanes=0,this.numIntersection=0,this.init=function(t,e,n){var i=0!==t.length||e||0!==d||p;return p=e,h=x(t,n,0),d=t.length,i},this.beginShadows=function(){f=!0,x(null)},this.endShadows=function(){f=!1,y()},this.setState=function(t,e,n,i,r,a){if(!p||null===t||0===t.length||f&&!n)f?x(null):y();else{var o=f?0:d,s=4*o,l=r.clippingState||null;v.value=l,l=x(t,i,s,a);for(var c=0;c!==s;++c)l[c]=h[c];r.clippingState=l,this.numIntersection=e?this.numPlanes:0,this.numPlanes+=o}}}function Nr(n){var i={};return{get:function(t){if(void 0!==i[t])return i[t];var e;switch(t){case"WEBGL_depth_texture":e=n.getExtension("WEBGL_depth_texture")||n.getExtension("MOZ_WEBGL_depth_texture")||n.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":e=n.getExtension("EXT_texture_filter_anisotropic")||n.getExtension("MOZ_EXT_texture_filter_anisotropic")||n.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":e=n.getExtension("WEBGL_compressed_texture_s3tc")||n.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||n.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":e=n.getExtension("WEBGL_compressed_texture_pvrtc")||n.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:e=n.getExtension(t)}return null===e&&console.warn("THREE.WebGLRenderer: "+t+" extension not supported."),i[t]=e}}}function Br(t,p,a){var o=new WeakMap,f=new WeakMap;function s(t){var e=t.target,n=o.get(e);for(var i in null!==n.index&&p.remove(n.index),n.attributes)p.remove(n.attributes[i]);e.removeEventListener("dispose",s),o.delete(e);var r=f.get(n);r&&(p.remove(r),f.delete(n)),a.memory.geometries--}function i(t){var e=[],n=t.index,i=t.attributes.position,r=0;if(null!==n){var a=n.array;r=n.version;for(var o=0,s=a.length;o<s;o+=3){var l=a[o+0],c=a[o+1],u=a[o+2];e.push(l,c,c,u,u,l)}}else{a=i.array;r=i.version;for(o=0,s=a.length/3-1;o<s;o+=3){l=o+0,c=o+1,u=o+2;e.push(l,c,c,u,u,l)}}var h=new(65535<Di(e)?Ci:Mi)(e,1);h.version=r,p.update(h,34963);var d=f.get(t);d&&p.remove(d),f.set(t,h)}return{get:function(t,e){var n=o.get(e);return n||(e.addEventListener("dispose",s),e.isBufferGeometry?n=e:e.isGeometry&&(void 0===e._bufferGeometry&&(e._bufferGeometry=(new Bi).setFromObject(t)),n=e._bufferGeometry),o.set(e,n),a.memory.geometries++,n)},update:function(t){var e=t.index,n=t.attributes;for(var i in null!==e&&p.update(e,34963),n)p.update(n[i],34962);var r=t.morphAttributes;for(var i in r)for(var a=r[i],o=0,s=a.length;o<s;o++)p.update(a[o],34962)},getWireframeAttribute:function(t){var e=f.get(t);if(e){var n=t.index;null!==n&&e.version<n.version&&i(t)}else i(t);return f.get(t)}}}function Fr(o,s,l,t){var c,u,h,d=t.isWebGL2;this.setMode=function(t){c=t},this.setIndex=function(t){u=t.type,h=t.bytesPerElement},this.render=function(t,e){o.drawElements(c,e,u,t*h),l.update(e,c)},this.renderInstances=function(t,e,n,i){if(0!==i){var r,a;if(d)r=o,a="drawElementsInstanced";else if(a="drawElementsInstancedANGLE",null===(r=s.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");r[a](c,n,u,e*h,i),l.update(n,c,i)}}}function zr(t){var i={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:i,programs:null,autoReset:!0,reset:function(){i.frame++,i.calls=0,i.triangles=0,i.points=0,i.lines=0},update:function(t,e,n){switch(n=n||1,i.calls++,e){case 4:i.triangles+=n*(t/3);break;case 1:i.lines+=n*(t/2);break;case 3:i.lines+=n*(t-1);break;case 2:i.lines+=n*t;break;case 0:i.points+=n*t;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",e)}}}}function Vr(t,e){return Math.abs(e[1])-Math.abs(t[1])}function Ur(m){var g={},v=new Float32Array(8);return{update:function(t,e,n,i){var r=t.morphTargetInfluences,a=void 0===r?0:r.length,o=g[e.id];if(void 0===o){o=[];for(var s=0;s<a;s++)o[s]=[s,0];g[e.id]=o}var l=n.morphTargets&&e.morphAttributes.position,c=n.morphNormals&&e.morphAttributes.normal;for(s=0;s<a;s++){0!==(h=o[s])[1]&&(l&&e.deleteAttribute("morphTarget"+s),c&&e.deleteAttribute("morphNormal"+s))}for(s=0;s<a;s++){(h=o[s])[0]=s,h[1]=r[s]}o.sort(Vr);var u=0;for(s=0;s<8;s++){var h;if(h=o[s]){var d=h[0],p=h[1];if(p){l&&e.setAttribute("morphTarget"+s,l[d]),c&&e.setAttribute("morphNormal"+s,c[d]),u+=v[s]=p;continue}}v[s]=0}var f=e.morphTargetsRelative?1:1-u;i.getUniforms().setValue(m,"morphTargetBaseInfluence",f),i.getUniforms().setValue(m,"morphTargetInfluences",v)}}}function jr(t,r,a,o){var s={};return{update:function(t){var e=o.render.frame,n=t.geometry,i=r.get(t,n);return s[i.id]!==e&&(n.isGeometry&&i.updateFromObject(t),r.update(i),s[i.id]=e),t.isInstancedMesh&&a.update(t.instanceMatrix,34962),i},dispose:function(){s={}}}}function Gr(t,e,n,i,r,a,o,s,l,c){Fe.call(this,t=void 0!==t?t:[],e=void 0!==e?e:Ot,n,i,r,a,o=void 0!==o?o:Qt,s,l,c),this.flipY=!1}function Hr(t,e,n,i){Fe.call(this,null),this.image={data:t||null,width:e||1,height:n||1,depth:i||1},this.magFilter=Ut,this.minFilter=Ut,this.wrapR=zt,this.generateMipmaps=!1,this.flipY=!1,this.needsUpdate=!0}function Wr(t,e,n,i){Fe.call(this,null),this.image={data:t||null,width:e||1,height:n||1,depth:i||1},this.magFilter=Ut,this.minFilter=Ut,this.wrapR=zt,this.generateMipmaps=!1,this.flipY=!1,this.needsUpdate=!0}Or.physical={uniforms:dr([Or.standard.uniforms,{transparency:{value:0},clearcoat:{value:0},clearcoatRoughness:{value:0},sheen:{value:new ci(0)},clearcoatNormalScale:{value:new Re(1,1)},clearcoatNormalMap:{value:null}}]),vertexShader:Lr.meshphysical_vert,fragmentShader:Lr.meshphysical_frag},((Gr.prototype=Object.create(Fe.prototype)).constructor=Gr).prototype.isCubeTexture=!0,Object.defineProperty(Gr.prototype,"images",{get:function(){return this.image},set:function(t){this.image=t}}),((Hr.prototype=Object.create(Fe.prototype)).constructor=Hr).prototype.isDataTexture2DArray=!0,((Wr.prototype=Object.create(Fe.prototype)).constructor=Wr).prototype.isDataTexture3D=!0;var Jr=new Fe,qr=new Hr,Xr=new Wr,Yr=new Gr,Zr=[],$r=[],Kr=new Float32Array(16),Qr=new Float32Array(9),ta=new Float32Array(4);function ea(t,e,n){var i=t[0];if(i<=0||0<i)return t;var r=e*n,a=Zr[r];if(void 0===a&&(a=new Float32Array(r),Zr[r]=a),0!==e){i.toArray(a,0);for(var o=1,s=0;o!==e;++o)s+=n,t[o].toArray(a,s)}return a}function na(t,e){if(t.length===e.length){for(var n=0,i=t.length;n<i;n++)if(t[n]!==e[n])return;return 1}}function ia(t,e){for(var n=0,i=e.length;n<i;n++)t[n]=e[n]}function ra(t,e){var n=$r[e];void 0===n&&(n=new Int32Array(e),$r[e]=n);for(var i=0;i!==e;++i)n[i]=t.allocateTextureUnit();return n}function aa(t,e){var n=this.cache;n[0]!==e&&(t.uniform1f(this.addr,e),n[0]=e)}function oa(t,e){var n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y||(t.uniform2f(this.addr,e.x,e.y),n[0]=e.x,n[1]=e.y);else{if(na(n,e))return;t.uniform2fv(this.addr,e),ia(n,e)}}function sa(t,e){var n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z||(t.uniform3f(this.addr,e.x,e.y,e.z),n[0]=e.x,n[1]=e.y,n[2]=e.z);else if(void 0!==e.r)n[0]===e.r&&n[1]===e.g&&n[2]===e.b||(t.uniform3f(this.addr,e.r,e.g,e.b),n[0]=e.r,n[1]=e.g,n[2]=e.b);else{if(na(n,e))return;t.uniform3fv(this.addr,e),ia(n,e)}}function la(t,e){var n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z&&n[3]===e.w||(t.uniform4f(this.addr,e.x,e.y,e.z,e.w),n[0]=e.x,n[1]=e.y,n[2]=e.z,n[3]=e.w);else{if(na(n,e))return;t.uniform4fv(this.addr,e),ia(n,e)}}function ca(t,e){var n=this.cache,i=e.elements;if(void 0===i){if(na(n,e))return;t.uniformMatrix2fv(this.addr,!1,e),ia(n,e)}else{if(na(n,i))return;ta.set(i),t.uniformMatrix2fv(this.addr,!1,ta),ia(n,i)}}function ua(t,e){var n=this.cache,i=e.elements;if(void 0===i){if(na(n,e))return;t.uniformMatrix3fv(this.addr,!1,e),ia(n,e)}else{if(na(n,i))return;Qr.set(i),t.uniformMatrix3fv(this.addr,!1,Qr),ia(n,i)}}function ha(t,e){var n=this.cache,i=e.elements;if(void 0===i){if(na(n,e))return;t.uniformMatrix4fv(this.addr,!1,e),ia(n,e)}else{if(na(n,i))return;Kr.set(i),t.uniformMatrix4fv(this.addr,!1,Kr),ia(n,i)}}function da(t,e,n){var i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),n.safeSetTexture2D(e||Jr,r)}function pa(t,e,n){var i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),n.setTexture2DArray(e||qr,r)}function fa(t,e,n){var i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),n.setTexture3D(e||Xr,r)}function ma(t,e,n){var i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),n.safeSetTextureCube(e||Yr,r)}function ga(t,e){var n=this.cache;n[0]!==e&&(t.uniform1i(this.addr,e),n[0]=e)}function va(t,e){var n=this.cache;na(n,e)||(t.uniform2iv(this.addr,e),ia(n,e))}function ya(t,e){var n=this.cache;na(n,e)||(t.uniform3iv(this.addr,e),ia(n,e))}function xa(t,e){var n=this.cache;na(n,e)||(t.uniform4iv(this.addr,e),ia(n,e))}function _a(t,e){var n=this.cache;n[0]!==e&&(t.uniform1ui(this.addr,e),n[0]=e)}function wa(t,e){t.uniform1fv(this.addr,e)}function ba(t,e){t.uniform1iv(this.addr,e)}function Ma(t,e){t.uniform2iv(this.addr,e)}function Sa(t,e){t.uniform3iv(this.addr,e)}function Ca(t,e){t.uniform4iv(this.addr,e)}function Ta(t,e){var n=ea(e,this.size,2);t.uniform2fv(this.addr,n)}function Ea(t,e){var n=ea(e,this.size,3);t.uniform3fv(this.addr,n)}function Aa(t,e){var n=ea(e,this.size,4);t.uniform4fv(this.addr,n)}function Da(t,e){var n=ea(e,this.size,4);t.uniformMatrix2fv(this.addr,!1,n)}function La(t,e){var n=ea(e,this.size,9);t.uniformMatrix3fv(this.addr,!1,n)}function Oa(t,e){var n=ea(e,this.size,16);t.uniformMatrix4fv(this.addr,!1,n)}function Ia(t,e,n){var i=e.length,r=ra(n,i);t.uniform1iv(this.addr,r);for(var a=0;a!==i;++a)n.safeSetTexture2D(e[a]||Jr,r[a])}function Pa(t,e,n){var i=e.length,r=ra(n,i);t.uniform1iv(this.addr,r);for(var a=0;a!==i;++a)n.safeSetTextureCube(e[a]||Yr,r[a])}function Ra(t,e,n){this.id=t,this.addr=n,this.cache=[],this.setValue=function(t){switch(t){case 5126:return aa;case 35664:return oa;case 35665:return sa;case 35666:return la;case 35674:return ca;case 35675:return ua;case 35676:return ha;case 5124:case 35670:return ga;case 35667:case 35671:return va;case 35668:case 35672:return ya;case 35669:case 35673:return xa;case 5125:return _a;case 35678:case 36198:case 36298:case 36306:case 35682:return da;case 35679:case 36299:case 36307:return fa;case 35680:case 36300:case 36308:case 36293:return ma;case 36289:case 36303:case 36311:case 36292:return pa}}(e.type)}function ka(t,e,n){this.id=t,this.addr=n,this.cache=[],this.size=e.size,this.setValue=function(t){switch(t){case 5126:return wa;case 35664:return Ta;case 35665:return Ea;case 35666:return Aa;case 35674:return Da;case 35675:return La;case 35676:return Oa;case 5124:case 35670:return ba;case 35667:case 35671:return Ma;case 35668:case 35672:return Sa;case 35669:case 35673:return Ca;case 35678:case 36198:case 36298:case 36306:case 35682:return Ia;case 35680:case 36300:case 36308:case 36293:return Pa}}(e.type)}function Na(t){this.id=t,this.seq=[],this.map={}}ka.prototype.updateCache=function(t){var e=this.cache;t instanceof Float32Array&&e.length!==t.length&&(this.cache=new Float32Array(t.length)),ia(e,t)},Na.prototype.setValue=function(t,e,n){for(var i=this.seq,r=0,a=i.length;r!==a;++r){var o=i[r];o.setValue(t,e[o.id],n)}};var Ba=/([\w\d_]+)(\])?(\[|\.)?/g;function Fa(t,e){t.seq.push(e),t.map[e.id]=e}function za(t,e,n){var i=t.name,r=i.length;for(Ba.lastIndex=0;;){var a=Ba.exec(i),o=Ba.lastIndex,s=a[1],l="]"===a[2],c=a[3];if(l&&(s|=0),void 0===c||"["===c&&o+2===r){Fa(n,new(void 0===c?Ra:ka)(s,t,e));break}var u=n.map[s];void 0===u&&Fa(n,u=new Na(s)),n=u}}function Va(t,e){this.seq=[],this.map={};for(var n=t.getProgramParameter(e,35718),i=0;i<n;++i){var r=t.getActiveUniform(e,i);za(r,t.getUniformLocation(e,r.name),this)}}function Ua(t,e,n){var i=t.createShader(e);return t.shaderSource(i,n),t.compileShader(i),i}Va.prototype.setValue=function(t,e,n,i){var r=this.map[e];void 0!==r&&r.setValue(t,n,i)},Va.prototype.setOptional=function(t,e,n){var i=e[n];void 0!==i&&this.setValue(t,n,i)},Va.upload=function(t,e,n,i){for(var r=0,a=e.length;r!==a;++r){var o=e[r],s=n[o.id];!1!==s.needsUpdate&&o.setValue(t,s.value,i)}},Va.seqWithValue=function(t,e){for(var n=[],i=0,r=t.length;i!==r;++i){var a=t[i];a.id in e&&n.push(a)}return n};var ja=0;function Ga(t){switch(t){case me:return["Linear","( value )"];case e:return["sRGB","( value )"];case ge:return["RGBE","( value )"];case ye:return["RGBM","( value, 7.0 )"];case xe:return["RGBM","( value, 16.0 )"];case _e:return["RGBD","( value, 256.0 )"];case n:return["Gamma","( value, float( GAMMA_FACTOR ) )"];case ve:return["LogLuv","( value )"];default:throw new Error("unsupported encoding: "+t)}}function Ha(t,e,n){var i=t.getShaderParameter(e,35713),r=t.getShaderInfoLog(e).trim();return i&&""===r?"":"THREE.WebGLShader: gl.getShaderInfoLog() "+n+"\n"+r+function(t){for(var e=t.split("\n"),n=0;n<e.length;n++)e[n]=n+1+": "+e[n];return e.join("\n")}(t.getShaderSource(e))}function Wa(t,e){var n=Ga(e);return"vec4 "+t+"( vec4 value ) { return "+n[0]+"ToLinear"+n[1]+"; }"}function Ja(t){return""!==t}function qa(t,e){return t.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function Xa(t,e){return t.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}var Ya=/^[ \t]*#include +<([\w\d./]+)>/gm;function Za(t){return t.replace(Ya,$a)}function $a(t,e){var n=Lr[e];if(void 0===n)throw new Error("Can not resolve #include <"+e+">");return Za(n)}var Ka=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g;function Qa(t){return t.replace(Ka,to)}function to(t,e,n,i){for(var r="",a=parseInt(e);a<parseInt(n);a++)r+=i.replace(/\[ i \]/g,"[ "+a+" ]").replace(/UNROLLED_LOOP_INDEX/g,a);return r}function eo(t){var e="precision "+t.precision+" float;\nprecision "+t.precision+" int;";return"highp"===t.precision?e+="\n#define HIGH_PRECISION":"mediump"===t.precision?e+="\n#define MEDIUM_PRECISION":"lowp"===t.precision&&(e+="\n#define LOW_PRECISION"),e}function no(t,e,n){var i,r,a,o,s,l,c,u,h=t.getContext(),d=n.defines,p=n.vertexShader,f=n.fragmentShader,m=(r="SHADOWMAP_TYPE_BASIC",(i=n).shadowMapType===F?r="SHADOWMAP_TYPE_PCF":i.shadowMapType===z?r="SHADOWMAP_TYPE_PCF_SOFT":i.shadowMapType===V&&(r="SHADOWMAP_TYPE_VSM"),r),g=function(t){var e="ENVMAP_TYPE_CUBE";if(t.envMap)switch(t.envMapMode){case Ot:case It:e="ENVMAP_TYPE_CUBE";break;case Nt:case Bt:e="ENVMAP_TYPE_CUBE_UV";break;case Pt:case Rt:e="ENVMAP_TYPE_EQUIREC";break;case kt:e="ENVMAP_TYPE_SPHERE"}return e}(n),v=function(t){var e="ENVMAP_MODE_REFLECTION";if(t.envMap)switch(t.envMapMode){case It:case Rt:e="ENVMAP_MODE_REFRACTION"}return e}(n),y=function(t){var e="ENVMAP_BLENDING_NONE";if(t.envMap)switch(t.combine){case U:e="ENVMAP_BLENDING_MULTIPLY";break;case j:e="ENVMAP_BLENDING_MIX";break;case G:e="ENVMAP_BLENDING_ADD"}return e}(n),x=0<t.gammaFactor?t.gammaFactor:1,_=n.isWebGL2?"":[(a=n).extensionDerivatives||a.envMapCubeUV||a.bumpMap||a.tangentSpaceNormalMap||a.clearcoatNormalMap||a.flatShading||"physical"===a.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(a.extensionFragDepth||a.logarithmicDepthBuffer)&&a.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",a.extensionDrawBuffers&&a.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(a.extensionShaderTextureLOD||a.envMap)&&a.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Ja).join("\n"),w=function(t){var e=[];for(var n in t){var i=t[n];!1!==i&&e.push("#define "+n+" "+i)}return e.join("\n")}(d),b=h.createProgram(),M=n.numMultiviewViews;if(n.isRawShaderMaterial?(0<(o=[w].filter(Ja).join("\n")).length&&(o+="\n"),0<(s=[_,w].filter(Ja).join("\n")).length&&(s+="\n")):(o=[eo(n),"#define SHADER_NAME "+n.shaderName,w,n.instancing?"#define USE_INSTANCING":"",n.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+x,"#define MAX_BONES "+n.maxBones,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+v:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.displacementMap&&n.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.useVertexTexture?"#define BONE_TEXTURE":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&!1===n.flatShading?"#define USE_MORPHNORMALS":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+m:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.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(Ja).join("\n"),s=[_,eo(n),"#define SHADER_NAME "+n.shaderName,w,n.alphaTest?"#define ALPHATEST "+n.alphaTest+(n.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+x,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+g:"",n.envMap?"#define "+v:"",n.envMap?"#define "+y:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.sheen?"#define USE_SHEEN":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+m:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(n.extensionShaderTextureLOD||n.envMap)&&n.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==H?"#define TONE_MAPPING":"",n.toneMapping!==H?Lr.tonemapping_pars_fragment:"",n.toneMapping!==H?function(t,e){var n;switch(e){case Dt:n="Linear";break;case W:n="Reinhard";break;case J:n="Uncharted2";break;case q:n="OptimizedCineon";break;case Lt:n="ACESFilmic";break;default:throw new Error("unsupported toneMapping: "+e)}return"vec3 "+t+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.outputEncoding||n.mapEncoding||n.matcapEncoding||n.envMapEncoding||n.emissiveMapEncoding||n.lightMapEncoding?Lr.encodings_pars_fragment:"",n.mapEncoding?Wa("mapTexelToLinear",n.mapEncoding):"",n.matcapEncoding?Wa("matcapTexelToLinear",n.matcapEncoding):"",n.envMapEncoding?Wa("envMapTexelToLinear",n.envMapEncoding):"",n.emissiveMapEncoding?Wa("emissiveMapTexelToLinear",n.emissiveMapEncoding):"",n.lightMapEncoding?Wa("lightMapTexelToLinear",n.lightMapEncoding):"",n.outputEncoding?(l="linearToOutputTexel",c=n.outputEncoding,u=Ga(c),"vec4 "+l+"( vec4 value ) { return LinearTo"+u[0]+u[1]+"; }"):"",n.depthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(Ja).join("\n")),p=Xa(p=qa(p=Za(p),n),n),f=Xa(f=qa(f=Za(f),n),n),p=Qa(p),f=Qa(f),n.isWebGL2&&!n.isRawShaderMaterial){var S=!1,C=/^\s*#version\s+300\s+es\s*\n/;n.isShaderMaterial&&null!==p.match(C)&&null!==f.match(C)&&(S=!0,p=p.replace(C,""),f=f.replace(C,"")),o=["#version 300 es\n","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+o,s=["#version 300 es\n","#define varying in",S?"":"out highp vec4 pc_fragColor;",S?"":"#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"+s,0<M&&(o=(o=o.replace("#version 300 es\n",["#version 300 es\n","#extension GL_OVR_multiview2 : require","layout(num_views = "+M+") in;","#define VIEW_ID gl_ViewID_OVR"].join("\n"))).replace(["uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;"].join("\n"),["uniform mat4 modelViewMatrices["+M+"];","uniform mat4 projectionMatrices["+M+"];","uniform mat4 viewMatrices["+M+"];","uniform mat3 normalMatrices["+M+"];","#define modelViewMatrix modelViewMatrices[VIEW_ID]","#define projectionMatrix projectionMatrices[VIEW_ID]","#define viewMatrix viewMatrices[VIEW_ID]","#define normalMatrix normalMatrices[VIEW_ID]"].join("\n")),s=(s=s.replace("#version 300 es\n",["#version 300 es\n","#extension GL_OVR_multiview2 : require","#define VIEW_ID gl_ViewID_OVR"].join("\n"))).replace("uniform mat4 viewMatrix;",["uniform mat4 viewMatrices["+M+"];","#define viewMatrix viewMatrices[VIEW_ID]"].join("\n")))}var T,E,A=s+f,D=Ua(h,35633,o+p),L=Ua(h,35632,A);if(h.attachShader(b,D),h.attachShader(b,L),void 0!==n.index0AttributeName?h.bindAttribLocation(b,0,n.index0AttributeName):!0===n.morphTargets&&h.bindAttribLocation(b,0,"position"),h.linkProgram(b),t.debug.checkShaderErrors){var O=h.getProgramInfoLog(b).trim(),I=h.getShaderInfoLog(D).trim(),P=h.getShaderInfoLog(L).trim(),R=!0,k=!0;if(!1===h.getProgramParameter(b,35714)){R=!1;var N=Ha(h,D,"vertex"),B=Ha(h,L,"fragment");console.error("THREE.WebGLProgram: shader error: ",h.getError(),"35715",h.getProgramParameter(b,35715),"gl.getProgramInfoLog",O,N,B)}else""!==O?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",O):""!==I&&""!==P||(k=!1);k&&(this.diagnostics={runnable:R,programLog:O,vertexShader:{log:I,prefix:o},fragmentShader:{log:P,prefix:s}})}return h.deleteShader(D),h.deleteShader(L),this.getUniforms=function(){return void 0===T&&(T=new Va(h,b)),T},this.getAttributes=function(){return void 0===E&&(E=function(t,e){for(var n={},i=t.getProgramParameter(e,35721),r=0;r<i;r++){var a=t.getActiveAttrib(e,r).name;n[a]=t.getAttribLocation(e,a)}return n}(h,b)),E},this.destroy=function(){h.deleteProgram(b),this.program=void 0},this.name=n.shaderName,this.id=ja++,this.cacheKey=e,this.usedTimes=1,this.program=b,this.vertexShader=D,this.fragmentShader=L,this.numMultiviewViews=M,this}function io(m,g,v){var o=[],y=v.isWebGL2,x=v.logarithmicDepthBuffer,_=v.floatVertexTextures,w=v.precision,b=v.maxVertexUniforms,M=v.vertexTextures,S={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","numMultiviewViews","map","mapEncoding","matcap","matcapEncoding","envMap","envMapMode","envMapEncoding","envMapCubeUV","lightMap","lightMapEncoding","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","tangentSpaceNormalMap","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 C(t){var e;return t?t.isTexture?e=t.encoding:t.isWebGLRenderTarget&&(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),e=t.texture.encoding):e=me,e}this.getParameters=function(t,e,n,i,r,a,o){var s=i.fog,l=t.isMeshStandardMaterial?i.environment:null,c=t.envMap||l,u=S[t.type],h=o.isSkinnedMesh?function(t){var e=t.skeleton.bones;if(_)return 1024;var n=b,i=Math.floor((n-20)/4),r=Math.min(i,e.length);return r<e.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+e.length+" bones. This GPU supports "+r+"."),0):r}(o):0;null!==t.precision&&(w=v.getMaxPrecision(t.precision))!==t.precision&&console.warn("THREE.WebGLProgram.getParameters:",t.precision,"not supported, using",w,"instead.");var d=function(t,e){var n;if(e){var i=Or[e];n={name:t.type,uniforms:pr.clone(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader}}else n={name:t.type,uniforms:t.uniforms,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader};return n}(t,u);t.onBeforeCompile(d,m);var p=m.getRenderTarget(),f=p&&p.isWebGLMultiviewRenderTarget?p.numViews:0;return{isWebGL2:y,shaderID:u,shaderName:d.name,uniforms:d.uniforms,vertexShader:d.vertexShader,fragmentShader:d.fragmentShader,defines:t.defines,isRawShaderMaterial:t.isRawShaderMaterial,isShaderMaterial:t.isShaderMaterial,precision:w,instancing:!0===o.isInstancedMesh,supportsVertexTextures:M,numMultiviewViews:f,outputEncoding:null!==p?C(p.texture):m.outputEncoding,map:!!t.map,mapEncoding:C(t.map),matcap:!!t.matcap,matcapEncoding:C(t.matcap),envMap:!!c,envMapMode:c&&c.mapping,envMapEncoding:C(c),envMapCubeUV:!!c&&(c.mapping===Nt||c.mapping===Bt),lightMap:!!t.lightMap,lightMapEncoding:C(t.lightMap),aoMap:!!t.aoMap,emissiveMap:!!t.emissiveMap,emissiveMapEncoding:C(t.emissiveMap),bumpMap:!!t.bumpMap,normalMap:!!t.normalMap,objectSpaceNormalMap:t.normalMapType===Se,tangentSpaceNormalMap:t.normalMapType===Me,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.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:!!s,useFog:t.fog,fogExp2:s&&s.isFogExp2,flatShading:t.flatShading,sizeAttenuation:t.sizeAttenuation,logarithmicDepthBuffer:x,skinning:t.skinning&&0<h,maxBones:h,useVertexTexture:_,morphTargets:t.morphTargets,morphNormals:t.morphNormals,maxMorphTargets:m.maxMorphTargets,maxMorphNormals:m.maxMorphNormals,numDirLights:e.directional.length,numPointLights:e.point.length,numSpotLights:e.spot.length,numRectAreaLights:e.rectArea.length,numHemiLights:e.hemi.length,numDirLightShadows:e.directionalShadowMap.length,numPointLightShadows:e.pointShadowMap.length,numSpotLightShadows:e.spotShadowMap.length,numClippingPlanes:r,numClipIntersection:a,dithering:t.dithering,shadowMapEnabled:m.shadowMap.enabled&&0<n.length,shadowMapType:m.shadowMap.type,toneMapping:t.toneMapped?m.toneMapping:H,physicallyCorrectLights:m.physicallyCorrectLights,premultipliedAlpha:t.premultipliedAlpha,alphaTest:t.alphaTest,doubleSided:t.side===$,flipSided:t.side===St,depthPacking:void 0!==t.depthPacking&&t.depthPacking,index0AttributeName:t.index0AttributeName,extensionDerivatives:t.extensions&&t.extensions.derivatives,extensionFragDepth:t.extensions&&t.extensions.frawbuffers,extensionDrawbuffers:t.extensions&&t.extensions.drawbuffers,extensionShaderTextureLOD:t.extensions&&t.extensions.shaderTextureLOD,rendererExtensionFragDepth:y||null!==g.get("EXT_frag_depth"),rendererExtensionDrawBuffers:y||null!==g.get("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:y||null!==g.get("EXT_shader_texture_lod"),onBeforeCompile:t.onBeforeCompile}},this.getProgramCacheKey=function(t){var e=[];if(t.shaderID?e.push(t.shaderID):(e.push(t.fragmentShader),e.push(t.vertexShader)),void 0!==t.defines)for(var n in t.defines)e.push(n),e.push(t.defines[n]);if(void 0===t.isRawShaderMaterial){for(var i=0;i<r.length;i++)e.push(t[r[i]]);e.push(m.outputEncoding),e.push(m.gammaFactor)}return e.push(t.onBeforeCompile.toString()),e.join()},this.acquireProgram=function(t,e){for(var n,i=0,r=o.length;i<r;i++){var a=o[i];if(a.cacheKey===e){++(n=a).usedTimes;break}}return void 0===n&&(n=new no(m,e,t),o.push(n)),n},this.releaseProgram=function(t){if(0==--t.usedTimes){var e=o.indexOf(t);o[e]=o[o.length-1],o.pop(),t.destroy()}},this.programs=o}function ro(){var i=new WeakMap;return{get:function(t){var e=i.get(t);return void 0===e&&(e={},i.set(t,e)),e},remove:function(t){i.delete(t)},update:function(t,e,n){i.get(t)[e]=n},dispose:function(){i=new WeakMap}}}function ao(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.program!==e.program?t.program.id-e.program.id:t.material.id!==e.material.id?t.material.id-e.material.id:t.z!==e.z?t.z-e.z:t.id-e.id}function oo(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.z!==e.z?e.z-t.z:t.id-e.id}function so(){var s=[],l=0,c=[],u=[],h={id:-1};function d(t,e,n,i,r,a){var o=s[l];return void 0===o?(o={id:t.id,object:t,geometry:e,material:n,program:n.program||h,groupOrder:i,renderOrder:t.renderOrder,z:r,group:a},s[l]=o):(o.id=t.id,o.object=t,o.geometry=e,o.material=n,o.program=n.program||h,o.groupOrder=i,o.renderOrder=t.renderOrder,o.z=r,o.group=a),l++,o}return{opaque:c,transparent:u,init:function(){l=0,c.length=0,u.length=0},push:function(t,e,n,i,r,a){var o=d(t,e,n,i,r,a);(!0===n.transparent?u:c).push(o)},unshift:function(t,e,n,i,r,a){var o=d(t,e,n,i,r,a);(!0===n.transparent?u:c).unshift(o)},sort:function(t,e){1<c.length&&c.sort(t||ao),1<u.length&&u.sort(e||oo)}}}function lo(){var r=new WeakMap;function a(t){var e=t.target;e.removeEventListener("dispose",a),r.delete(e)}return{get:function(t,e){var n,i=r.get(t);return void 0===i?(n=new so,r.set(t,new WeakMap),r.get(t).set(e,n),t.addEventListener("dispose",a)):void 0===(n=i.get(e))&&(n=new so,i.set(e,n)),n},dispose:function(){r=new WeakMap}}}function co(){var n={};return{get:function(t){if(void 0!==n[t.id])return n[t.id];var e;switch(t.type){case"DirectionalLight":e={direction:new We,color:new ci,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new Re};break;case"SpotLight":e={position:new We,direction:new We,color:new ci,distance:0,coneCos:0,penumbraCos:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new Re};break;case"PointLight":e={position:new We,color:new ci,distance:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new Re,shadowCameraNear:1,shadowCameraFar:1e3};break;case"HemisphereLight":e={direction:new We,skyColor:new ci,groundColor:new ci};break;case"RectAreaLight":e={color:new ci,position:new We,halfWidth:new We,halfHeight:new We}}return n[t.id]=e}}}var uo=0;function ho(t,e){return(e.castShadow?1:0)-(t.castShadow?1:0)}function po(){for(var T=new co,E={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:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],point:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},t=0;t<9;t++)E.probe.push(new We);var A=new We,D=new Qe,L=new Qe;return{setup:function(t,e,n){for(var i=0,r=0,a=0,o=0;o<9;o++)E.probe[o].set(0,0,0);var s=0,l=0,c=0,u=0,h=0,d=0,p=0,f=0,m=n.matrixWorldInverse;t.sort(ho),o=0;for(var g=t.length;o<g;o++){var v=t[o],y=v.color,x=v.intensity,_=v.distance,w=v.shadow&&v.shadow.map?v.shadow.map.texture:null;if(v.isAmbientLight)i+=y.r*x,r+=y.g*x,a+=y.b*x;else if(v.isLightProbe)for(var b=0;b<9;b++)E.probe[b].addScaledVector(v.sh.coefficients[b],x);else if(v.isDirectionalLight){if((S=T.get(v)).color.copy(v.color).multiplyScalar(v.intensity),S.direction.setFromMatrixPosition(v.matrixWorld),A.setFromMatrixPosition(v.target.matrixWorld),S.direction.sub(A),S.direction.transformDirection(m),S.shadow=v.castShadow,v.castShadow){var M=v.shadow;S.shadowBias=M.bias,S.shadowRadius=M.radius,S.shadowMapSize=M.mapSize,E.directionalShadowMap[s]=w,E.directionalShadowMatrix[s]=v.shadow.matrix,d++}E.directional[s]=S,s++}else if(v.isSpotLight){if((S=T.get(v)).position.setFromMatrixPosition(v.matrixWorld),S.position.applyMatrix4(m),S.color.copy(y).multiplyScalar(x),S.distance=_,S.direction.setFromMatrixPosition(v.matrixWorld),A.setFromMatrixPosition(v.target.matrixWorld),S.direction.sub(A),S.direction.transformDirection(m),S.coneCos=Math.cos(v.angle),S.penumbraCos=Math.cos(v.angle*(1-v.penumbra)),S.decay=v.decay,S.shadow=v.castShadow,v.castShadow){M=v.shadow;S.shadowBias=M.bias,S.shadowRadius=M.radius,S.shadowMapSize=M.mapSize,E.spotShadowMap[c]=w,E.spotShadowMatrix[c]=v.shadow.matrix,f++}E.spot[c]=S,c++}else if(v.isRectAreaLight){(S=T.get(v)).color.copy(y).multiplyScalar(x),S.position.setFromMatrixPosition(v.matrixWorld),S.position.applyMatrix4(m),L.identity(),D.copy(v.matrixWorld),D.premultiply(m),L.extractRotation(D),S.halfWidth.set(.5*v.width,0,0),S.halfHeight.set(0,.5*v.height,0),S.halfWidth.applyMatrix4(L),S.halfHeight.applyMatrix4(L),E.rectArea[u]=S,u++}else if(v.isPointLight){if((S=T.get(v)).position.setFromMatrixPosition(v.matrixWorld),S.position.applyMatrix4(m),S.color.copy(v.color).multiplyScalar(v.intensity),S.distance=v.distance,S.decay=v.decay,S.shadow=v.castShadow,v.castShadow){M=v.shadow;S.shadowBias=M.bias,S.shadowRadius=M.radius,S.shadowMapSize=M.mapSize,S.shadowCameraNear=M.camera.near,S.shadowCameraFar=M.camera.far,E.pointShadowMap[l]=w,E.pointShadowMatrix[l]=v.shadow.matrix,p++}E.point[l]=S,l++}else if(v.isHemisphereLight){var S;(S=T.get(v)).direction.setFromMatrixPosition(v.matrixWorld),S.direction.transformDirection(m),S.direction.normalize(),S.skyColor.copy(v.color).multiplyScalar(x),S.groundColor.copy(v.groundColor).multiplyScalar(x),E.hemi[h]=S,h++}}E.ambient[0]=i,E.ambient[1]=r,E.ambient[2]=a;var C=E.hash;C.directionalLength===s&&C.pointLength===l&&C.spotLength===c&&C.rectAreaLength===u&&C.hemiLength===h&&C.numDirectionalShadows===d&&C.numPointShadows===p&&C.numSpotShadows===f||(E.directional.length=s,E.spot.length=c,E.rectArea.length=u,E.point.length=l,E.hemi.length=h,E.directionalShadowMap.length=d,E.pointShadowMap.length=p,E.spotShadowMap.length=f,E.directionalShadowMatrix.length=d,E.pointShadowMatrix.length=p,E.spotShadowMatrix.length=f,C.directionalLength=s,C.pointLength=l,C.spotLength=c,C.rectAreaLength=u,C.hemiLength=h,C.numDirectionalShadows=d,C.numPointShadows=p,C.numSpotShadows=f,E.version=uo++)},state:E}}function fo(){var e=new po,n=[],i=[];return{init:function(){n.length=0,i.length=0},state:{lightsArray:n,shadowsArray:i,lights:e},setupLights:function(t){e.setup(n,i,t)},pushLight:function(t){n.push(t)},pushShadow:function(t){i.push(t)}}}function mo(){var i=new WeakMap;function r(t){var e=t.target;e.removeEventListener("dispose",r),i.delete(e)}return{get:function(t,e){var n;return!1===i.has(t)?(n=new fo,i.set(t,new WeakMap),i.get(t).set(e,n),t.addEventListener("dispose",r)):!1===i.get(t).has(e)?(n=new fo,i.get(t).set(e,n)):n=i.get(t).get(e),n},dispose:function(){i=new WeakMap}}}function go(t){mi.call(this),this.type="MeshDepthMaterial",this.depthPacking=we,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 vo(t){mi.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new We,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)}((go.prototype=Object.create(mi.prototype)).constructor=go).prototype.isMeshDepthMaterial=!0,go.prototype.copy=function(t){return mi.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},((vo.prototype=Object.create(mi.prototype)).constructor=vo).prototype.isMeshDistanceMaterial=!0,vo.prototype.copy=function(t){return mi.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 yo="uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include <packing>\nvoid main() {\n float mean = 0.0;\n float squared_mean = 0.0;\n\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) );\n for ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) {\n #ifdef HORIZONAL_PASS\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 #else\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 #endif\n }\n mean = mean * HALF_SAMPLE_RATE;\n squared_mean = squared_mean * HALF_SAMPLE_RATE;\n float std_dev = sqrt( squared_mean - mean * mean );\n gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}",xo="void main() {\n\tgl_Position = vec4( position, 1.0 );\n}";function _o(g,v,y){var x=new Sr,_=new Re,w=new Re,b=new ze,a=[],o=[],M={},S={0:St,1:O,2:$},i=new gr({defines:{SAMPLE_RATE:.25,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new Re},radius:{value:4}},vertexShader:xo,fragmentShader:yo}),r=i.clone();r.defines.HORIZONAL_PASS=1;var t=new Bi;t.setAttribute("position",new yi(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));var s=new er(t,i),C=this;function T(t,e){var n=v.update(s);i.uniforms.shadow_pass.value=t.map.texture,i.uniforms.resolution.value=t.mapSize,i.uniforms.radius.value=t.radius,g.setRenderTarget(t.mapPass),g.clear(),g.renderBufferDirect(e,null,n,i,s,null),r.uniforms.shadow_pass.value=t.mapPass.texture,r.uniforms.resolution.value=t.mapSize,r.uniforms.radius.value=t.radius,g.setRenderTarget(t.map),g.clear(),g.renderBufferDirect(e,null,n,r,s,null)}function E(t,e,n){var i=t<<0|e<<1|n<<2,r=a[i];return void 0===r&&(r=new go({depthPacking:be,morphTargets:t,skinning:e}),a[i]=r),r}function A(t,e,n){var i=t<<0|e<<1|n<<2,r=o[i];return void 0===r&&(r=new vo({morphTargets:t,skinning:e}),o[i]=r),r}function D(t,e,n,i,r,a){var o=t.geometry,s=null,l=E,c=t.customDepthMaterial;if(!0===n.isPointLight&&(l=A,c=t.customDistanceMaterial),void 0===c){var u=!1;!0===e.morphTargets&&(!0===o.isBufferGeometry?u=o.morphAttributes&&o.morphAttributes.position&&0<o.morphAttributes.position.length:!0===o.isGeometry&&(u=o.morphTargets&&0<o.morphTargets.length));var h=!1;!0===t.isSkinnedMesh&&(!0===e.skinning?h=!0:console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",t)),s=l(u,h,!0===t.isInstancedMesh)}else s=c;if(g.localClippingEnabled&&!0===e.clipShadows&&0!==e.clippingPlanes.length){var d=s.uuid,p=e.uuid,f=M[d];void 0===f&&(f={},M[d]=f);var m=f[p];void 0===m&&(m=s.clone(),f[p]=m),s=m}return s.visible=e.visible,s.wireframe=e.wireframe,s.side=a===V?null!==e.shadowSide?e.shadowSide:e.side:null!==e.shadowSide?e.shadowSide:S[e.side],s.clipShadows=e.clipShadows,s.clippingPlanes=e.clippingPlanes,s.clipIntersection=e.clipIntersection,s.wireframeLinewidth=e.wireframeLinewidth,s.linewidth=e.linewidth,!0===n.isPointLight&&!0===s.isMeshDistanceMaterial&&(s.referencePosition.setFromMatrixPosition(n.matrixWorld),s.nearDistance=i,s.farDistance=r),s}function L(t,e,n,i,r){if(!1!==t.visible){if(t.layers.test(e.layers)&&(t.isMesh||t.isLine||t.isPoints)&&(t.castShadow||t.receiveShadow&&r===V)&&(!t.frustumCulled||x.intersectsObject(t))){t.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,t.matrixWorld);var a=v.update(t),o=t.material;if(Array.isArray(o))for(var s=a.groups,l=0,c=s.length;l<c;l++){var u=s[l],h=o[u.materialIndex];if(h&&h.visible){var d=D(t,h,i,n.near,n.far,r);g.renderBufferDirect(n,null,a,d,t,u)}}else if(o.visible){d=D(t,o,i,n.near,n.far,r);g.renderBufferDirect(n,null,a,d,t,null)}}for(var p=t.children,f=0,m=p.length;f<m;f++)L(p[f],e,n,i,r)}}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=F,this.render=function(t,e,n){if(!1!==C.enabled&&(!1!==C.autoUpdate||!1!==C.needsUpdate)&&0!==t.length){var i=g.getRenderTarget(),r=g.getActiveCubeFace(),a=g.getActiveMipmapLevel(),o=g.state;o.setBlending(K),o.buffers.color.setClear(1,1,1,1),o.buffers.depth.setTest(!0),o.setScissorTest(!1);for(var s=0,l=t.length;s<l;s++){var c=t[s],u=c.shadow;if(void 0!==u){_.copy(u.mapSize);var h=u.getFrameExtents();if(_.multiply(h),w.copy(u.mapSize),(_.x>y||_.y>y)&&(console.warn("THREE.WebGLShadowMap:",c,"has shadow exceeding max texture size, reducing"),_.x>y&&(w.x=Math.floor(y/h.x),_.x=w.x*h.x,u.mapSize.x=w.x),_.y>y&&(w.y=Math.floor(y/h.y),_.y=w.y*h.y,u.mapSize.y=w.y)),null===u.map&&!u.isPointLightShadow&&this.type===V){var d={minFilter:Ht,magFilter:Ht,format:te};u.map=new Ve(_.x,_.y,d),u.map.texture.name=c.name+".shadowMap",u.mapPass=new Ve(_.x,_.y,d),u.camera.updateProjectionMatrix()}if(null===u.map){d={minFilter:Ut,magFilter:Ut,format:te};u.map=new Ve(_.x,_.y,d),u.map.texture.name=c.name+".shadowMap",u.camera.updateProjectionMatrix()}g.setRenderTarget(u.map),g.clear();for(var p=u.getViewportCount(),f=0;f<p;f++){var m=u.getViewport(f);b.set(w.x*m.x,w.y*m.y,w.x*m.z,w.y*m.w),o.viewport(b),u.updateMatrices(c,f),x=u.getFrustum(),L(e,n,u.camera,c,this.type)}u.isPointLightShadow||this.type!==V||T(u,n)}else console.warn("THREE.WebGLShadowMap:",c,"has no shadow.")}C.needsUpdate=!1,g.setRenderTarget(i,r,a)}}}function wo(u,n,t){var i=t.isWebGL2;var r=new function(){var e=!1,a=new ze,n=null,o=new ze(0,0,0,0);return{setMask:function(t){n===t||e||(u.colorMask(t,t,t,t),n=t)},setLocked:function(t){e=t},setClear:function(t,e,n,i,r){!0===r&&(t*=i,e*=i,n*=i),a.set(t,e,n,i),!1===o.equals(a)&&(u.clearColor(t,e,n,i),o.copy(a))},reset:function(){e=!1,n=null,o.set(-1,0,0,0)}}},a=new function(){var e=!1,n=null,i=null,r=null;return{setTest:function(t){(t?F:z)(2929)},setMask:function(t){n===t||e||(u.depthMask(t),n=t)},setFunc:function(t){if(i!==t){if(t)switch(t){case _t:u.depthFunc(512);break;case wt:u.depthFunc(519);break;case bt:u.depthFunc(513);break;case Mt:u.depthFunc(515);break;case Ct:u.depthFunc(514);break;case Tt:u.depthFunc(518);break;case Et:u.depthFunc(516);break;case At:u.depthFunc(517);break;default:u.depthFunc(515)}else u.depthFunc(515);i=t}},setLocked:function(t){e=t},setClear:function(t){r!==t&&(u.clearDepth(t),r=t)},reset:function(){e=!1,r=i=n=null}}},o=new function(){var e=!1,n=null,i=null,r=null,a=null,o=null,s=null,l=null,c=null;return{setTest:function(t){e||(t?F:z)(2960)},setMask:function(t){n===t||e||(u.stencilMask(t),n=t)},setFunc:function(t,e,n){i===t&&r===e&&a===n||(u.stencilFunc(t,e,n),i=t,r=e,a=n)},setOp:function(t,e,n){o===t&&s===e&&l===n||(u.stencilOp(t,e,n),o=t,s=e,l=n)},setLocked:function(t){e=t},setClear:function(t){c!==t&&(u.clearStencil(t),c=t)},reset:function(){e=!1,c=l=s=o=a=r=i=n=null}}},e=u.getParameter(34921),s=new Uint8Array(e),l=new Uint8Array(e),c=new Uint8Array(e),h={},d=null,p=null,f=null,m=null,g=null,v=null,y=null,x=null,_=null,w=!1,b=null,M=null,S=null,C=null,T=null,E=u.getParameter(35661),A=!1,D=0,L=u.getParameter(7938);-1!==L.indexOf("WebGL")?(D=parseFloat(/^WebGL\ ([0-9])/.exec(L)[1]),A=1<=D):-1!==L.indexOf("OpenGL ES")&&(D=parseFloat(/^OpenGL\ ES\ ([0-9])/.exec(L)[1]),A=2<=D);var O=null,I={},P=new ze,R=new ze;function k(t,e,n){var i=new Uint8Array(4),r=u.createTexture();u.bindTexture(t,r),u.texParameteri(t,10241,9728),u.texParameteri(t,10240,9728);for(var a=0;a<n;a++)u.texImage2D(e+a,0,6408,1,1,0,6408,5121,i);return r}var N={};function B(t,e){s[t]=1,0===l[t]&&(u.enableVertexAttribArray(t),l[t]=1),c[t]!==e&&((i?u:n.get("ANGLE_instanced_arrays"))[i?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](t,e),c[t]=e)}function F(t){!0!==h[t]&&(u.enable(t),h[t]=!0)}function z(t){!1!==h[t]&&(u.disable(t),h[t]=!1)}N[3553]=k(3553,3553,1),N[34067]=k(34067,34069,6),r.setClear(0,0,0,1),a.setClear(1),o.setClear(0),F(2929),a.setFunc(Mt),H(!1),W(Y),F(2884),G(K);var V={};if(V[rt]=32774,V[at]=32778,V[ot]=32779,i)V[st]=32775,V[lt]=32776;else{var U=n.get("EXT_blend_minmax");null!==U&&(V[st]=U.MIN_EXT,V[lt]=U.MAX_EXT)}var j={};function G(t,e,n,i,r,a,o,s){if(t!==K){if(p||(F(3042),p=!0),t===it)r=r||e,a=a||n,o=o||i,e===m&&r===y||(u.blendEquationSeparate(V[e],V[r]),m=e,y=r),n===g&&i===v&&a===x&&o===_||(u.blendFuncSeparate(j[n],j[i],j[a],j[o]),g=n,v=i,x=a,_=o),f=t,w=null;else if(t!==f||s!==w){if(m===rt&&y===rt||(u.blendEquation(32774),y=m=rt),s)switch(t){case Q:u.blendFuncSeparate(1,771,1,771);break;case tt:u.blendFunc(1,1);break;case et:u.blendFuncSeparate(0,0,769,771);break;case nt:u.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}else switch(t){case Q:u.blendFuncSeparate(770,771,1,771);break;case tt:u.blendFunc(770,1);break;case et:u.blendFunc(0,769);break;case nt:u.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}_=x=v=g=null,f=t,w=s}}else p&&(z(3042),p=!1)}function H(t){b!==t&&(t?u.frontFace(2304):u.frontFace(2305),b=t)}function W(t){t!==X?(F(2884),t!==M&&(t===Y?u.cullFace(1029):t===Z?u.cullFace(1028):u.cullFace(1032))):z(2884),M=t}function J(t,e,n){t?(F(32823),C===e&&T===n||(u.polygonOffset(e,n),C=e,T=n)):z(32823)}function q(t){void 0===t&&(t=33984+E-1),O!==t&&(u.activeTexture(t),O=t)}return j[ct]=0,j[ut]=1,j[ht]=768,j[pt]=770,j[xt]=776,j[vt]=774,j[mt]=772,j[dt]=769,j[ft]=771,j[yt]=775,j[gt]=773,{buffers:{color:r,depth:a,stencil:o},initAttributes:function(){for(var t=0,e=s.length;t<e;t++)s[t]=0},enableAttribute:function(t){B(t,0)},enableAttributeAndDivisor:B,disableUnusedAttributes:function(){for(var t=0,e=l.length;t!==e;++t)l[t]!==s[t]&&(u.disableVertexAttribArray(t),l[t]=0)},enable:F,disable:z,useProgram:function(t){return d!==t&&(u.useProgram(t),d=t,!0)},setBlending:G,setMaterial:function(t,e){(t.side===$?z:F)(2884);var n=t.side===St;e&&(n=!n),H(n),t.blending===Q&&!1===t.transparent?G(K):G(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha,t.premultipliedAlpha),a.setFunc(t.depthFunc),a.setTest(t.depthTest),a.setMask(t.depthWrite),r.setMask(t.colorWrite);var i=t.stencilWrite;o.setTest(i),i&&(o.setMask(t.stencilWriteMask),o.setFunc(t.stencilFunc,t.stencilRef,t.stencilFuncMask),o.setOp(t.stencilFail,t.stencilZFail,t.stencilZPass)),J(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits)},setFlipSided:H,setCullFace:W,setLineWidth:function(t){t!==S&&(A&&u.lineWidth(t),S=t)},setPolygonOffset:J,setScissorTest:function(t){(t?F:z)(3089)},activeTexture:q,bindTexture:function(t,e){null===O&&q();var n=I[O];void 0===n&&(n={type:void 0,texture:void 0},I[O]=n),n.type===t&&n.texture===e||(u.bindTexture(t,e||N[t]),n.type=t,n.texture=e)},unbindTexture:function(){var t=I[O];void 0!==t&&void 0!==t.type&&(u.bindTexture(t.type,null),t.type=void 0,t.texture=void 0)},compressedTexImage2D:function(){try{u.compressedTexImage2D.apply(u,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage2D:function(){try{u.texImage2D.apply(u,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage3D:function(){try{u.texImage3D.apply(u,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},scissor:function(t){!1===P.equals(t)&&(u.scissor(t.x,t.y,t.z,t.w),P.copy(t))},viewport:function(t){!1===R.equals(t)&&(u.viewport(t.x,t.y,t.z,t.w),R.copy(t))},reset:function(){for(var t=0;t<l.length;t++)1===l[t]&&(u.disableVertexAttribArray(t),l[t]=0);h={},I={},M=b=f=d=O=null,r.reset(),a.reset(),o.reset()}}}function bo(x,_,w,b,r,M,S){var c,C=r.isWebGL2,e=r.maxTextures,g=r.maxCubemapSize,m=r.maxTextureSize,n=r.maxSamples,o=new WeakMap,i=!1;try{i="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(t){}function u(t,e){return i?new OffscreenCanvas(t,e):document.createElementNS("http://www.w3.org/1999/xhtml","canvas")}function v(t,e,n,i){var r=1;if((t.width>i||t.height>i)&&(r=i/Math.max(t.width,t.height)),r<1||!0===e){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){var a=e?Pe.floorPowerOfTwo:Math.floor,o=a(r*t.width),s=a(r*t.height);void 0===c&&(c=u(o,s));var l=n?u(o,s):c;return l.width=o,l.height=s,l.getContext("2d").drawImage(t,0,0,o,s),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+t.width+"x"+t.height+") to ("+o+"x"+s+")."),l}return"data"in t&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+t.width+"x"+t.height+")."),t}return t}function T(t){return Pe.isPowerOfTwo(t.width)&&Pe.isPowerOfTwo(t.height)}function E(t,e){return t.generateMipmaps&&e&&t.minFilter!==Ut&&t.minFilter!==Ht}function A(t,e,n,i){x.generateMipmap(t),b.get(e).__maxMipLevel=Math.log(Math.max(n,i))*Math.LOG2E}function D(t,e,n){if(!1===C)return e;if(null!==t){if(void 0!==x[t])return x[t];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+t+"'")}var i=e;return 6403===e&&(5126===n&&(i=33326),5131===n&&(i=33325),5121===n&&(i=33321)),6407===e&&(5126===n&&(i=34837),5131===n&&(i=34843),5121===n&&(i=32849)),6408===e&&(5126===n&&(i=34836),5131===n&&(i=34842),5121===n&&(i=32856)),33325===i||33326===i||34842===i||34836===i?_.get("EXT_color_buffer_float"):34843!==i&&34837!==i||console.warn("THREE.WebGLRenderer: Floating point textures with RGB format not supported. Please use RGBA instead."),i}function a(t){return t===Ut||t===jt||t===Gt?9728:9729}function s(t){var e=t.target;e.removeEventListener("dispose",s),function(t){var e=b.get(t);if(void 0===e.__webglInit)return;x.deleteTexture(e.__webglTexture),b.remove(t)}(e),e.isVideoTexture&&o.delete(e),S.memory.textures--}function L(t){var e=t.target;e.removeEventListener("dispose",L),function(t){var e=b.get(t),n=b.get(t.texture);if(!t)return;void 0!==n.__webglTexture&&x.deleteTexture(n.__webglTexture);t.depthTexture&&t.depthTexture.dispose();if(t.isWebGLCubeRenderTarget)for(var i=0;i<6;i++)x.deleteFramebuffer(e.__webglFramebuffer[i]),e.__webglDepthbuffer&&x.deleteRenderbuffer(e.__webglDepthbuffer[i]);else x.deleteFramebuffer(e.__webglFramebuffer),e.__webglDepthbuffer&&x.deleteRenderbuffer(e.__webglDepthbuffer);if(t.isWebGLMultiviewRenderTarget){x.deleteTexture(e.__webglColorTexture),x.deleteTexture(e.__webglDepthStencilTexture),S.memory.textures-=2;i=0;for(var r=e.__webglViewFramebuffers.length;i<r;i++)x.deleteFramebuffer(e.__webglViewFramebuffers[i])}b.remove(t.texture),b.remove(t)}(e),S.memory.textures--}var l=0;function h(t,e){var n,i,r=b.get(t);if(t.isVideoTexture&&(n=t,i=S.render.frame,o.get(n)!==i&&(o.set(n,i),n.update())),0<t.version&&r.__version!==t.version){var a=t.image;if(void 0===a)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==a.complete)return void P(r,t,e);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}w.activeTexture(33984+e),w.bindTexture(3553,r.__webglTexture)}function d(t,e){if(6===t.image.length){var n=b.get(t);if(0<t.version&&n.__version!==t.version){I(n,t),w.activeTexture(33984+e),w.bindTexture(34067,n.__webglTexture),x.pixelStorei(37440,t.flipY);for(var i=t&&(t.isCompressedTexture||t.image[0].isCompressedTexture),r=t.image[0]&&t.image[0].isDataTexture,a=[],o=0;o<6;o++)a[o]=i||r?r?t.image[o].image:t.image[o]:v(t.image[o],!1,!0,g);var s,l=a[0],c=T(l)||C,u=M.convert(t.format),h=M.convert(t.type),d=D(t.internalFormat,u,h);if(O(34067,t,c),i){for(o=0;o<6;o++){s=a[o].mipmaps;for(var p=0;p<s.length;p++){var f=s[p];t.format!==te&&t.format!==Qt?null!==u?w.compressedTexImage2D(34069+o,p,d,f.width,f.height,0,f.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):w.texImage2D(34069+o,p,d,f.width,f.height,0,u,h,f.data)}}n.__maxMipLevel=s.length-1}else{s=t.mipmaps;for(o=0;o<6;o++)if(r){w.texImage2D(34069+o,0,d,a[o].width,a[o].height,0,u,h,a[o].data);for(p=0;p<s.length;p++){var m=(f=s[p]).image[o].image;w.texImage2D(34069+o,p+1,d,m.width,m.height,0,u,h,m.data)}}else{w.texImage2D(34069+o,0,d,u,h,a[o]);for(p=0;p<s.length;p++){f=s[p];w.texImage2D(34069+o,p+1,d,u,h,f.image[o])}}n.__maxMipLevel=s.length}E(t,c)&&A(34067,t,l.width,l.height),n.__version=t.version,t.onUpdate&&t.onUpdate(t)}else w.activeTexture(33984+e),w.bindTexture(34067,n.__webglTexture)}}function p(t,e){w.activeTexture(33984+e),w.bindTexture(34067,b.get(t).__webglTexture)}var f={};f[Ft]=10497,f[zt]=33071,f[Vt]=33648;var y={};function O(t,e,n){n?(x.texParameteri(t,10242,f[e.wrapS]),x.texParameteri(t,10243,f[e.wrapT]),32879!==t&&35866!==t||x.texParameteri(t,32882,f[e.wrapR]),x.texParameteri(t,10240,y[e.magFilter]),x.texParameteri(t,10241,y[e.minFilter])):(x.texParameteri(t,10242,33071),x.texParameteri(t,10243,33071),32879!==t&&35866!==t||x.texParameteri(t,32882,33071),e.wrapS===zt&&e.wrapT===zt||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),x.texParameteri(t,10240,a(e.magFilter)),x.texParameteri(t,10241,a(e.minFilter)),e.minFilter!==Ut&&e.minFilter!==Ht&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter."));var i=_.get("EXT_texture_filter_anisotropic");if(i){if(e.type===Zt&&null===_.get("OES_texture_float_linear"))return;if(e.type===$t&&null===(C||_.get("OES_texture_half_float_linear")))return;(1<e.anisotropy||b.get(e).__currentAnisotropy)&&(x.texParameterf(t,i.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(e.anisotropy,r.getMaxAnisotropy())),b.get(e).__currentAnisotropy=e.anisotropy)}}function I(t,e){void 0===t.__webglInit&&(t.__webglInit=!0,e.addEventListener("dispose",s),t.__webglTexture=x.createTexture(),S.memory.textures++)}function P(t,e,n){var i=3553;e.isDataTexture2DArray&&(i=35866),e.isDataTexture3D&&(i=32879),I(t,e),w.activeTexture(33984+n),w.bindTexture(i,t.__webglTexture),x.pixelStorei(37440,e.flipY),x.pixelStorei(37441,e.premultiplyAlpha),x.pixelStorei(3317,e.unpackAlignment);var r,a=(r=e,!C&&(r.wrapS!==zt||r.wrapT!==zt||r.minFilter!==Ut&&r.minFilter!==Ht)&&!1===T(e.image)),o=v(e.image,a,!1,m),s=T(o)||C,l=M.convert(e.format),c=M.convert(e.type),u=D(e.internalFormat,l,c);O(i,e,s);var h,d=e.mipmaps;if(e.isDepthTexture){if(u=6402,e.type===Zt){if(!1===C)throw new Error("Float Depth Texture only supported in WebGL2.0");u=36012}else C&&(u=33189);e.format===ee&&6402===u&&e.type!==Xt&&e.type!==Yt&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),e.type=Xt,c=M.convert(e.type)),e.format===ne&&(u=34041,e.type!==Kt&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),e.type=Kt,c=M.convert(e.type))),w.texImage2D(3553,0,u,o.width,o.height,0,l,c,null)}else if(e.isDataTexture)if(0<d.length&&s){for(var p=0,f=d.length;p<f;p++)h=d[p],w.texImage2D(3553,p,u,h.width,h.height,0,l,c,h.data);e.generateMipmaps=!1,t.__maxMipLevel=d.length-1}else w.texImage2D(3553,0,u,o.width,o.height,0,l,c,o.data),t.__maxMipLevel=0;else if(e.isCompressedTexture){for(p=0,f=d.length;p<f;p++)h=d[p],e.format!==te&&e.format!==Qt?null!==l?w.compressedTexImage2D(3553,p,u,h.width,h.height,0,h.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):w.texImage2D(3553,p,u,h.width,h.height,0,l,c,h.data);t.__maxMipLevel=d.length-1}else if(e.isDataTexture2DArray)w.texImage3D(35866,0,u,o.width,o.height,o.depth,0,l,c,o.data),t.__maxMipLevel=0;else if(e.isDataTexture3D)w.texImage3D(32879,0,u,o.width,o.height,o.depth,0,l,c,o.data),t.__maxMipLevel=0;else if(0<d.length&&s){for(p=0,f=d.length;p<f;p++)h=d[p],w.texImage2D(3553,p,u,l,c,h);e.generateMipmaps=!1,t.__maxMipLevel=d.length-1}else w.texImage2D(3553,0,u,l,c,o),t.__maxMipLevel=0;E(e,s)&&A(i,e,o.width,o.height),t.__version=e.version,e.onUpdate&&e.onUpdate(e)}function R(t,e,n,i){var r=M.convert(e.texture.format),a=M.convert(e.texture.type),o=D(e.texture.internalFormat,r,a);w.texImage2D(i,0,o,e.width,e.height,0,r,a,null),x.bindFramebuffer(36160,t),x.framebufferTexture2D(36160,n,i,b.get(e.texture).__webglTexture,0),x.bindFramebuffer(36160,null)}function k(t,e,n){if(x.bindRenderbuffer(36161,t),e.depthBuffer&&!e.stencilBuffer){if(n){var i=B(e);x.renderbufferStorageMultisample(36161,i,33189,e.width,e.height)}else x.renderbufferStorage(36161,33189,e.width,e.height);x.framebufferRenderbuffer(36160,36096,36161,t)}else if(e.depthBuffer&&e.stencilBuffer){if(n){i=B(e);x.renderbufferStorageMultisample(36161,i,35056,e.width,e.height)}else x.renderbufferStorage(36161,34041,e.width,e.height);x.framebufferRenderbuffer(36160,33306,36161,t)}else{var r=M.convert(e.texture.format),a=M.convert(e.texture.type),o=D(e.texture.internalFormat,r,a);if(n){i=B(e);x.renderbufferStorageMultisample(36161,i,o,e.width,e.height)}else x.renderbufferStorage(36161,o,e.width,e.height)}x.bindRenderbuffer(36161,null)}function N(t){var e=b.get(t),n=!0===t.isWebGLCubeRenderTarget;if(t.depthTexture){if(n)throw new Error("target.depthTexture not supported in Cube render targets");!function(t,e){if(e&&e.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(x.bindFramebuffer(36160,t),!e.depthTexture||!e.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");b.get(e.depthTexture).__webglTexture&&e.depthTexture.image.width===e.width&&e.depthTexture.image.height===e.height||(e.depthTexture.image.width=e.width,e.depthTexture.image.height=e.height,e.depthTexture.needsUpdate=!0),h(e.depthTexture,0);var n=b.get(e.depthTexture).__webglTexture;if(e.depthTexture.format===ee)x.framebufferTexture2D(36160,36096,3553,n,0);else{if(e.depthTexture.format!==ne)throw new Error("Unknown depthTexture format");x.framebufferTexture2D(36160,33306,3553,n,0)}}(e.__webglFramebuffer,t)}else if(n){e.__webglDepthbuffer=[];for(var i=0;i<6;i++)x.bindFramebuffer(36160,e.__webglFramebuffer[i]),e.__webglDepthbuffer[i]=x.createRenderbuffer(),k(e.__webglDepthbuffer[i],t)}else x.bindFramebuffer(36160,e.__webglFramebuffer),e.__webglDepthbuffer=x.createRenderbuffer(),k(e.__webglDepthbuffer,t);x.bindFramebuffer(36160,null)}function B(t){return C&&t.isWebGLMultisampleRenderTarget?Math.min(n,t.samples):0}y[Ut]=9728,y[jt]=9984,y[Gt]=9986,y[Ht]=9729,y[Wt]=9985;var F=!(y[Jt]=9987),z=!1;this.allocateTextureUnit=function(){var t=l;return e<=t&&console.warn("THREE.WebGLTextures: Trying to use "+t+" texture units while this GPU supports only "+e),l+=1,t},this.resetTextureUnits=function(){l=0},this.setTexture2D=h,this.setTexture2DArray=function(t,e){var n=b.get(t);0<t.version&&n.__version!==t.version?P(n,t,e):(w.activeTexture(33984+e),w.bindTexture(35866,n.__webglTexture))},this.setTexture3D=function(t,e){var n=b.get(t);0<t.version&&n.__version!==t.version?P(n,t,e):(w.activeTexture(33984+e),w.bindTexture(32879,n.__webglTexture))},this.setTextureCube=d,this.setTextureCubeDynamic=p,this.setupRenderTarget=function(t){var e=b.get(t),n=b.get(t.texture);t.addEventListener("dispose",L),n.__webglTexture=x.createTexture(),S.memory.textures++;var i=!0===t.isWebGLCubeRenderTarget,r=!0===t.isWebGLMultisampleRenderTarget,a=!0===t.isWebGLMultiviewRenderTarget,o=T(t)||C;if(i){e.__webglFramebuffer=[];for(var s=0;s<6;s++)e.__webglFramebuffer[s]=x.createFramebuffer()}else if(e.__webglFramebuffer=x.createFramebuffer(),r)if(C){e.__webglMultisampledFramebuffer=x.createFramebuffer(),e.__webglColorRenderbuffer=x.createRenderbuffer(),x.bindRenderbuffer(36161,e.__webglColorRenderbuffer);var l=M.convert(t.texture.format),c=M.convert(t.texture.type),u=D(t.texture.internalFormat,l,c),h=B(t);x.renderbufferStorageMultisample(36161,h,u,t.width,t.height),x.bindFramebuffer(36160,e.__webglMultisampledFramebuffer),x.framebufferRenderbuffer(36160,36064,36161,e.__webglColorRenderbuffer),x.bindRenderbuffer(36161,null),t.depthBuffer&&(e.__webglDepthRenderbuffer=x.createRenderbuffer(),k(e.__webglDepthRenderbuffer,t,!0)),x.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");else if(a){var d=t.width,p=t.height,f=t.numViews;x.bindFramebuffer(36160,e.__webglFramebuffer);var m=_.get("OVR_multiview2");S.memory.textures+=2;var g=x.createTexture();x.bindTexture(35866,g),x.texParameteri(35866,10240,9728),x.texParameteri(35866,10241,9728),x.texImage3D(35866,0,32856,d,p,f,0,6408,5121,null),m.framebufferTextureMultiviewOVR(36160,36064,g,0,0,f);var v=x.createTexture();x.bindTexture(35866,v),x.texParameteri(35866,10240,9728),x.texParameteri(35866,10241,9728),x.texImage3D(35866,0,35056,d,p,f,0,34041,34042,null),m.framebufferTextureMultiviewOVR(36160,33306,v,0,0,f);var y=new Array(f);for(s=0;s<f;++s)y[s]=x.createFramebuffer(),x.bindFramebuffer(36160,y[s]),x.framebufferTextureLayer(36160,36064,g,0,s);e.__webglColorTexture=g,e.__webglDepthStencilTexture=v,e.__webglViewFramebuffers=y,x.bindFramebuffer(36160,null),x.bindTexture(35866,null)}if(i){w.bindTexture(34067,n.__webglTexture),O(34067,t.texture,o);for(s=0;s<6;s++)R(e.__webglFramebuffer[s],t,36064,34069+s);E(t.texture,o)&&A(34067,t.texture,t.width,t.height),w.bindTexture(34067,null)}else a||(w.bindTexture(3553,n.__webglTexture),O(3553,t.texture,o),R(e.__webglFramebuffer,t,36064,3553),E(t.texture,o)&&A(3553,t.texture,t.width,t.height),w.bindTexture(3553,null));t.depthBuffer&&N(t)},this.updateRenderTargetMipmap=function(t){var e=t.texture;if(E(e,T(t)||C)){var n=t.isWebGLCubeRenderTarget?34067:3553,i=b.get(e).__webglTexture;w.bindTexture(n,i),A(n,e,t.width,t.height),w.bindTexture(n,null)}},this.updateMultisampleRenderTarget=function(t){if(t.isWebGLMultisampleRenderTarget)if(C){var e=b.get(t);x.bindFramebuffer(36008,e.__webglMultisampledFramebuffer),x.bindFramebuffer(36009,e.__webglFramebuffer);var n=t.width,i=t.height,r=16384;t.depthBuffer&&(r|=256),t.stencilBuffer&&(r|=1024),x.blitFramebuffer(0,0,n,i,0,0,n,i,r,9728)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")},this.safeSetTexture2D=function(t,e){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),h(t,e)},this.safeSetTextureCube=function(t,e){t&&t.isWebGLCubeRenderTarget&&(!1===z&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),z=!0),t=t.texture),(t&&t.isCubeTexture||Array.isArray(t.image)&&6===t.image.length?d:p)(t,e)}}function Mo(t,n,e){var i=e.isWebGL2;return{convert:function(t){var e;if(t===qt)return 5121;if(t===l)return 32819;if(t===c)return 32820;if(t===u)return 33635;if(t===r)return 5120;if(t===a)return 5122;if(t===Xt)return 5123;if(t===s)return 5124;if(t===Yt)return 5125;if(t===Zt)return 5126;if(t===$t)return i?5131:null!==(e=n.get("OES_texture_half_float"))?e.HALF_FLOAT_OES:null;if(t===h)return 6406;if(t===Qt)return 6407;if(t===te)return 6408;if(t===d)return 6409;if(t===p)return 6410;if(t===ee)return 6402;if(t===ne)return 34041;if(t===f)return 6403;if(t===m)return 36244;if(t===g)return 33319;if(t===y)return 33320;if(t===x)return 36248;if(t===_)return 36249;if(t===w||t===b||t===M||t===S){if(null===(e=n.get("WEBGL_compressed_texture_s3tc")))return null;if(t===w)return e.COMPRESSED_RGB_S3TC_DXT1_EXT;if(t===b)return e.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(t===M)return e.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(t===S)return e.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(t===C||t===T||t===E||t===A){if(null===(e=n.get("WEBGL_compressed_texture_pvrtc")))return null;if(t===C)return e.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(t===T)return e.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(t===E)return e.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(t===A)return e.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}return t===D?null!==(e=n.get("WEBGL_compressed_texture_etc1"))?e.COMPRESSED_RGB_ETC1_WEBGL:null:t===L||t===I||t===P||t===R||t===k||t===N||t===B||t===ie||t===re||t===ae||t===oe||t===se||t===le||t===ce?null!==(e=n.get("WEBGL_compressed_texture_astc"))?t:null:t===Kt?i?34042:null!==(e=n.get("WEBGL_depth_texture"))?e.UNSIGNED_INT_24_8_WEBGL:null:void 0}}}function So(t,e,n,i){Ve.call(this,t,e,i),this.depthBuffer=!1,this.stencilBuffer=!1,this.numViews=n}function Co(n,d){var p,i,a,o,r,f,s,l=2,c=n.extensions,m=n.properties,u=0;function h(t){return t.isArrayCamera?t.cameras:(r[0]=t,r)}this.isAvailable=function(){if(void 0===s){var t=c.get("OVR_multiview2");if(s=null!==t&&!1===d.getContextAttributes().antialias){u=d.getParameter(t.MAX_VIEWS_OVR),p=new So(0,0,l),f=new Re,o=[],a=[],r=[];for(var e=0;e<u;e++)o[e]=new Qe,a[e]=new ke}}return s},this.attachCamera=function(t){!1!==function(t){if(void 0===t.isArrayCamera)return!0;var e=t.cameras;if(e.length>u)return!1;for(var n=1,i=e.length;n<i;n++)if(e[0].viewport.z!==e[n].viewport.z||e[0].viewport.w!==e[n].viewport.w)return!1;return!0}(t)&&(i=n.getRenderTarget(),function(t){if(i?f.set(i.width,i.height):n.getDrawingBufferSize(f),t.isArrayCamera){var e=t.cameras[0].viewport;p.setSize(e.z,e.w),p.setNumViews(t.cameras.length)}else p.setSize(f.x,f.y),p.setNumViews(l)}(t),n.setRenderTarget(p))},this.detachCamera=function(t){p===n.getRenderTarget()&&(n.setRenderTarget(i),function(t){var e=p,n=e.numViews,i=m.get(e).__webglViewFramebuffers,r=e.width,a=e.height;if(t.isArrayCamera)for(var o=0;o<n;o++){var s=t.cameras[o].viewport,l=s.x,c=s.y,u=l+s.z,h=c+s.w;d.bindFramebuffer(36008,i[o]),d.blitFramebuffer(0,0,r,a,l,c,u,h,16384,9728)}else d.bindFramebuffer(36008,i[0]),d.blitFramebuffer(0,0,r,a,0,0,f.x,f.y,16384,9728)}(t))},this.updateCameraProjectionMatricesUniform=function(t,e){for(var n=h(t),i=0;i<n.length;i++)o[i].copy(n[i].projectionMatrix);e.setValue(d,"projectionMatrices",o)},this.updateCameraViewMatricesUniform=function(t,e){for(var n=h(t),i=0;i<n.length;i++)o[i].copy(n[i].matrixWorldInverse);e.setValue(d,"viewMatrices",o)},this.updateObjectMatricesUniforms=function(t,e,n){for(var i=h(e),r=0;r<i.length;r++)o[r].multiplyMatrices(i[r].matrixWorldInverse,t.matrixWorld),a[r].getNormalMatrix(o[r]);n.setValue(d,"modelViewMatrices",o),n.setValue(d,"normalMatrices",a)}}function To(t){yr.call(this),this.cameras=t||[]}function Eo(){yn.call(this),this.type="Group"}function Ao(p,r){var e=this,f=null,m=null,a="local-floor",g=null,v=[],o=new Map,s=new yr;s.layers.enable(1),s.viewport=new ze;var l=new yr;l.layers.enable(2),l.viewport=new ze;var y=new To([s,l]);y.layers.enable(1),y.layers.enable(2);var c=null,u=null;function h(t){var e=o.get(t.inputSource);e&&(e.targetRay&&e.targetRay.dispatchEvent({type:t.type}),e.grip&&e.grip.dispatchEvent({type:t.type}))}function d(){o.forEach(function(t,e){t.targetRay&&(t.targetRay.dispatchEvent({type:"disconnected",data:e}),t.targetRay.visible=!1),t.grip&&(t.grip.dispatchEvent({type:"disconnected",data:e}),t.grip.visible=!1)}),o.clear(),p.setFramebuffer(null),p.setRenderTarget(p.getRenderTarget()),n.stop(),e.isPresenting=!1,e.dispatchEvent({type:"sessionend"})}function x(t){m=t,n.setContext(f),n.start(),e.isPresenting=!0,e.dispatchEvent({type:"sessionstart"})}function _(t){for(var e=f.inputSources,n=0;n<v.length;n++)o.set(e[n],v[n]);for(n=0;n<t.removed.length;n++){var i=t.removed[n];(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(n=0;n<t.added.length;n++){var r;i=t.added[n];(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 e=v[t];return void 0===e&&(e={},v[t]=e),void 0===e.targetRay&&(e.targetRay=new Eo,e.targetRay.matrixAutoUpdate=!1,e.targetRay.visible=!1),e.targetRay},this.getControllerGrip=function(t){var e=v[t];return void 0===e&&(e={},v[t]=e),void 0===e.grip&&(e.grip=new Eo,e.grip.matrixAutoUpdate=!1,e.grip.visible=!1),e.grip},this.setFramebufferScaleFactor=function(){},this.setReferenceSpaceType=function(t){a=t},this.getReferenceSpace=function(){return m},this.getSession=function(){return f},this.setSession=function(t){if(null!==(f=t)){f.addEventListener("select",h),f.addEventListener("selectstart",h),f.addEventListener("selectend",h),f.addEventListener("squeeze",h),f.addEventListener("squeezestart",h),f.addEventListener("squeezeend",h),f.addEventListener("end",d);var e=r.getContextAttributes(),n={antialias:e.antialias,alpha:e.alpha,depth:e.depth,stencil:e.stencil},i=new XRWebGLLayer(f,r,n);f.updateRenderState({baseLayer:i}),f.requestReferenceSpace(a).then(x),f.addEventListener("inputsourceschange",_)}};var b=new We,M=new We;function w(t,e){null===e?t.matrixWorld.copy(t.matrix):t.matrixWorld.multiplyMatrices(e.matrixWorld,t.matrix),t.matrixWorldInverse.getInverse(t.matrixWorld)}this.getCamera=function(t){y.near=l.near=s.near=t.near,y.far=l.far=s.far=t.far,c===y.near&&u===y.far||(f.updateRenderState({depthNear:y.near,depthFar:y.far}),c=y.near,u=y.far);var e=t.parent,n=y.cameras;w(y,e);for(var i=0;i<n.length;i++)w(n[i],e);t.matrixWorld.copy(y.matrixWorld);for(var r=t.children,a=(i=0,r.length);i<a;i++)r[i].updateMatrixWorld(!0);return function(t,e,n){b.setFromMatrixPosition(e.matrixWorld),M.setFromMatrixPosition(n.matrixWorld);var i=b.distanceTo(M),r=e.projectionMatrix.elements,a=n.projectionMatrix.elements,o=r[14]/(r[10]-1),s=r[14]/(r[10]+1),l=(r[9]+1)/r[5],c=(r[9]-1)/r[5],u=(r[8]-1)/r[0],h=(a[8]+1)/a[0],d=o*u,p=o*h,f=i/(h-u),m=f*-u;e.matrixWorld.decompose(t.position,t.quaternion,t.scale),t.translateX(m),t.translateZ(f),t.matrixWorld.compose(t.position,t.quaternion,t.scale),t.matrixWorldInverse.getInverse(t.matrixWorld);var g=o+f,v=s+f,y=d-m,x=i-m+p,_=l*s/v*g,w=c*s/v*g;t.projectionMatrix.makePerspective(y,x,_,w,g,v)}(y,s,l),y};var S=null;var n=new Tr;n.setAnimationLoop(function(t,e){if(null!==(g=e.getViewerPose(m))){var n=g.views,i=f.renderState.baseLayer;p.setFramebuffer(i.framebuffer);for(var r=0;r<n.length;r++){var a=n[r],o=i.getViewport(a),s=y.cameras[r];s.matrix.fromArray(a.transform.matrix),s.projectionMatrix.fromArray(a.projectionMatrix),s.viewport.set(o.x,o.y,o.width,o.height),0===r&&y.matrix.copy(s.matrix)}}var l=f.inputSources;for(r=0;r<v.length;r++){var c=v[r],u=l[r],h=null,d=null;u&&(c.targetRay&&null!==(h=e.getPose(u.targetRaySpace,m))&&(c.targetRay.matrix.fromArray(h.transform.matrix),c.targetRay.matrix.decompose(c.targetRay.position,c.targetRay.rotation,c.targetRay.scale)),c.grip&&u.gripSpace&&null!==(d=e.getPose(u.gripSpace,m))&&(c.grip.matrix.fromArray(d.transform.matrix),c.grip.matrix.decompose(c.grip.position,c.grip.rotation,c.grip.scale))),c.targetRay&&(c.targetRay.visible=null!==h),c.grip&&(c.grip.visible=null!==d)}S&&S(t,e)}),this.setAnimationLoop=function(t){S=t},this.dispose=function(){}}function Do(t){var i=void 0!==(t=t||{}).canvas?t.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),e=void 0!==t.context?t.context:null,n=void 0!==t.alpha&&t.alpha,r=void 0===t.depth||t.depth,a=void 0===t.stencil||t.stencil,o=void 0!==t.antialias&&t.antialias,s=void 0===t.premultipliedAlpha||t.premultipliedAlpha,l=void 0!==t.preserveDrawingBuffer&&t.preserveDrawingBuffer,c=void 0!==t.powerPreference?t.powerPreference:"default",u=void 0!==t.failIfMajorPerformanceCaveat&&t.failIfMajorPerformanceCaveat,f=null,P=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=me,this.physicallyCorrectLights=!1,this.toneMapping=Dt,this.toneMappingExposure=1,this.toneMappingWhitePoint=1,this.maxMorphTargets=8,this.maxMorphNormals=4;var R,M,k,N,m,B,F,S,C,g,v,h,d,p,T,E,A,y,z=this,x=!1,_=null,w=0,b=0,D=null,L=null,V=-1,O={geometry:null,program:null,wireframe:!1},U=null,I=null,j=new ze,G=new ze,H=null,W=i.width,J=i.height,q=1,X=null,Y=null,Z=new ze(0,0,W,J),$=new ze(0,0,W,J),K=!1,Q=new Sr,tt=new kr,et=!1,nt=!1,it=new Qe,rt=new We;function at(){return null===D?q:1}try{var ot={alpha:n,depth:r,stencil:a,antialias:o,premultipliedAlpha:s,preserveDrawingBuffer:l,powerPreference:c,failIfMajorPerformanceCaveat:u,xrCompatible:!0};if(i.addEventListener("webglcontextlost",ht,!1),i.addEventListener("webglcontextrestored",dt,!1),null===(R=e||i.getContext("webgl",ot)||i.getContext("experimental-webgl",ot)))throw null!==i.getContext("webgl")?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.");void 0===R.getShaderPrecisionFormat&&(R.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(t){throw console.error("THREE.WebGLRenderer: "+t.message),t}function st(){M=new Nr(R),!1===(k=new Rr(R,M,t)).isWebGL2&&(M.get("WEBGL_depth_texture"),M.get("OES_texture_float"),M.get("OES_texture_half_float"),M.get("OES_texture_half_float_linear"),M.get("OES_standard_derivatives"),M.get("OES_element_index_uint"),M.get("ANGLE_instanced_arrays")),M.get("OES_texture_float_linear"),y=new Mo(0,M,k),(N=new wo(R,M,k)).scissor(G.copy($).multiplyScalar(q).floor()),N.viewport(j.copy(Z).multiplyScalar(q).floor()),m=new zr,B=new ro,F=new bo(R,M,N,B,k,y,m),S=new Er(R,k),C=new Br(0,S,m),g=new jr(0,C,S,m),T=new Ur(R),v=new io(z,M,k),h=new lo,d=new mo,p=new Ir(z,N,g,s),E=new Pr(R,M,m,k),A=new Fr(R,M,m,k),m.programs=v.programs,z.capabilities=k,z.extensions=M,z.properties=B,z.renderLists=h,z.state=N,z.info=m}st();var lt=new Ao(z,R);this.xr=lt;var ct=new Co(z,R),ut=new _o(z,g,k.maxTextureSize);function ht(t){t.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),x=!0}function dt(){console.log("THREE.WebGLRenderer: Context Restored."),x=!1,st()}function pt(t){var e,n=t.target;n.removeEventListener("dispose",pt),ft(e=n),B.remove(e)}function ft(t){var e=B.get(t).program;(t.program=void 0)!==e&&v.releaseProgram(e)}this.shadowMap=ut,this.getContext=function(){return R},this.getContextAttributes=function(){return R.getContextAttributes()},this.forceContextLoss=function(){var t=M.get("WEBGL_lose_context");t&&t.loseContext()},this.forceContextRestore=function(){var t=M.get("WEBGL_lose_context");t&&t.restoreContext()},this.getPixelRatio=function(){return q},this.setPixelRatio=function(t){void 0!==t&&(q=t,this.setSize(W,J,!1))},this.getSize=function(t){return void 0===t&&(console.warn("WebGLRenderer: .getsize() now requires a Vector2 as an argument"),t=new Re),t.set(W,J)},this.setSize=function(t,e,n){lt.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(W=t,J=e,i.width=Math.floor(t*q),i.height=Math.floor(e*q),!1!==n&&(i.style.width=t+"px",i.style.height=e+"px"),this.setViewport(0,0,t,e))},this.getDrawingBufferSize=function(t){return void 0===t&&(console.warn("WebGLRenderer: .getdrawingBufferSize() now requires a Vector2 as an argument"),t=new Re),t.set(W*q,J*q).floor()},this.setDrawingBufferSize=function(t,e,n){W=t,J=e,q=n,i.width=Math.floor(t*n),i.height=Math.floor(e*n),this.setViewport(0,0,t,e)},this.getCurrentViewport=function(t){return void 0===t&&(console.warn("WebGLRenderer: .getCurrentViewport() now requires a Vector4 as an argument"),t=new ze),t.copy(j)},this.getViewport=function(t){return t.copy(Z)},this.setViewport=function(t,e,n,i){t.isVector4?Z.set(t.x,t.y,t.z,t.w):Z.set(t,e,n,i),N.viewport(j.copy(Z).multiplyScalar(q).floor())},this.getScissor=function(t){return t.copy($)},this.setScissor=function(t,e,n,i){t.isVector4?$.set(t.x,t.y,t.z,t.w):$.set(t,e,n,i),N.scissor(G.copy($).multiplyScalar(q).floor())},this.getScissorTest=function(){return K},this.setScissorTest=function(t){N.setScissorTest(K=t)},this.setOpaqueSort=function(t){X=t},this.setTransparentSort=function(t){Y=t},this.getClearColor=function(){return p.getClearColor()},this.setClearColor=function(){p.setClearColor.apply(p,arguments)},this.getClearAlpha=function(){return p.getClearAlpha()},this.setClearAlpha=function(){p.setClearAlpha.apply(p,arguments)},this.clear=function(t,e,n){var i=0;void 0!==t&&!t||(i|=16384),void 0!==e&&!e||(i|=256),void 0!==n&&!n||(i|=1024),R.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",ht,!1),i.removeEventListener("webglcontextrestored",dt,!1),h.dispose(),d.dispose(),B.dispose(),g.dispose(),lt.dispose(),vt.stop()},this.renderBufferImmediate=function(t,e){N.initAttributes();var n=B.get(t);t.hasPositions&&!n.position&&(n.position=R.createBuffer()),t.hasNormals&&!n.normal&&(n.normal=R.createBuffer()),t.hasUvs&&!n.uv&&(n.uv=R.createBuffer()),t.hasColors&&!n.color&&(n.color=R.createBuffer());var i=e.getAttributes();t.hasPositions&&(R.bindBuffer(34962,n.position),R.bufferData(34962,t.positionArray,35048),N.enableAttribute(i.position),R.vertexAttribPointer(i.position,3,5126,!1,0,0)),t.hasNormals&&(R.bindBuffer(34962,n.normal),R.bufferData(34962,t.normalArray,35048),N.enableAttribute(i.normal),R.vertexAttribPointer(i.normal,3,5126,!1,0,0)),t.hasUvs&&(R.bindBuffer(34962,n.uv),R.bufferData(34962,t.uvArray,35048),N.enableAttribute(i.uv),R.vertexAttribPointer(i.uv,2,5126,!1,0,0)),t.hasColors&&(R.bindBuffer(34962,n.color),R.bufferData(34962,t.colorArray,35048),N.enableAttribute(i.color),R.vertexAttribPointer(i.color,3,5126,!1,0,0)),N.disableUnusedAttributes(),R.drawArrays(4,0,t.count),t.count=0};var mt=new xn;this.renderBufferDirect=function(t,e,n,i,r,a){null===e&&(e=mt);var o=r.isMesh&&r.matrixWorld.determinant()<0,s=wt(t,e,i,r);N.setMaterial(i,o);var l=!1;O.geometry===n.id&&O.program===s.id&&O.wireframe===(!0===i.wireframe)||(O.geometry=n.id,O.program=s.id,O.wireframe=!0===i.wireframe,l=!0),(i.morphTargets||i.morphNormals)&&(T.update(r,n,i,s),l=!0);var c=n.index,u=n.attributes.position;if(null===c){if(void 0===u||0===u.count)return}else if(0===c.count)return;var h,d=1;!0===i.wireframe&&(c=C.getWireframeAttribute(n),d=2);var p=E;null!==c&&(h=S.get(c),(p=A).setIndex(h)),l&&(function(t,e,n,i){if(!1===k.isWebGL2&&(t.isInstancedMesh||e.isInstancedBufferGeometry)&&null===M.get("ANGLE_instanced_arrays"))return;N.initAttributes();var r=e.attributes,a=i.getAttributes(),o=n.defaultAttributeValues;for(var s in a){var l=a[s];if(0<=l){var c=r[s];if(void 0!==c){var u=c.normalized,h=c.itemSize;if(void 0===(y=S.get(c)))continue;var d=y.buffer,p=y.type,f=y.bytesPerElement;if(c.isInterleavedBufferAttribute){var m=c.data,g=m.stride,v=c.offset;m&&m.isInstancedInterleavedBuffer?(N.enableAttributeAndDivisor(l,m.meshPerAttribute),void 0===e.maxInstancedCount&&(e.maxInstancedCount=m.meshPerAttribute*m.count)):N.enableAttribute(l),R.bindBuffer(34962,d),R.vertexAttribPointer(l,h,p,u,g*f,v*f)}else c.isInstancedBufferAttribute?(N.enableAttributeAndDivisor(l,c.meshPerAttribute),void 0===e.maxInstancedCount&&(e.maxInstancedCount=c.meshPerAttribute*c.count)):N.enableAttribute(l),R.bindBuffer(34962,d),R.vertexAttribPointer(l,h,p,u,0,0)}else if("instanceMatrix"===s){var y;if(void 0===(y=S.get(t.instanceMatrix)))continue;d=y.buffer,p=y.type;N.enableAttributeAndDivisor(l+0,1),N.enableAttributeAndDivisor(l+1,1),N.enableAttributeAndDivisor(l+2,1),N.enableAttributeAndDivisor(l+3,1),R.bindBuffer(34962,d),R.vertexAttribPointer(l+0,4,p,!1,64,0),R.vertexAttribPointer(l+1,4,p,!1,64,16),R.vertexAttribPointer(l+2,4,p,!1,64,32),R.vertexAttribPointer(l+3,4,p,!1,64,48)}else if(void 0!==o){var x=o[s];if(void 0!==x)switch(x.length){case 2:R.vertexAttrib2fv(l,x);break;case 3:R.vertexAttrib3fv(l,x);break;case 4:R.vertexAttrib4fv(l,x);break;default:R.vertexAttrib1fv(l,x)}}}}N.disableUnusedAttributes()}(r,n,i,s),null!==c&&R.bindBuffer(34963,h.buffer));var f=null!==c?c.count:u.count,m=n.drawRange.start*d,g=n.drawRange.count*d,v=null!==a?a.start*d:0,y=null!==a?a.count*d:1/0,x=Math.max(m,v),_=Math.min(f,m+g,v+y)-1,w=Math.max(0,_-x+1);if(0!==w){if(r.isMesh)!0===i.wireframe?(N.setLineWidth(i.wireframeLinewidth*at()),p.setMode(1)):p.setMode(4);else if(r.isLine){var b=i.linewidth;void 0===b&&(b=1),N.setLineWidth(b*at()),r.isLineSegments?p.setMode(1):r.isLineLoop?p.setMode(2):p.setMode(3)}else r.isPoints?p.setMode(0):r.isSprite&&p.setMode(4);r.isInstancedMesh?p.renderInstances(n,x,w,r.count):n.isInstancedBufferGeometry?p.renderInstances(n,x,w,n.maxInstancedCount):p.render(x,w)}},this.compile=function(n,t){(P=d.get(n,t)).init(),n.traverse(function(t){t.isLight&&(P.pushLight(t),t.castShadow&&P.pushShadow(t))}),P.setupLights(t);var i={};n.traverse(function(t){if(t.material)if(Array.isArray(t.material))for(var e=0;e<t.material.length;e++)t.material[e].uuid in i==!1&&(_t(t.material[e],n,t),i[t.material[e].uuid]=!0);else t.material.uuid in i==!1&&(_t(t.material,n,t),i[t.material.uuid]=!0)})};var gt=null;var vt=new Tr;function yt(t,e,n,i){for(var r=0,a=t.length;r<a;r++){var o=t[r],s=o.object,l=o.geometry,c=void 0===i?o.material:i,u=o.group;if(n.isArrayCamera)if(I=n,lt.enabled&&ct.isAvailable())xt(s,e,n,l,c,u);else for(var h=n.cameras,d=0,p=h.length;d<p;d++){var f=h[d];s.layers.test(f.layers)&&(N.viewport(j.copy(f.viewport)),P.setupLights(f),xt(s,e,f,l,c,u))}else I=null,xt(s,e,n,l,c,u)}}function xt(t,e,n,i,r,a){if(t.onBeforeRender(z,e,n,i,r,a),P=d.get(e,I||n),t.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,t.matrixWorld),t.normalMatrix.getNormalMatrix(t.modelViewMatrix),t.isImmediateRenderObject){var o=wt(n,e,r,t);N.setMaterial(r),O.geometry=null,O.program=null,O.wireframe=!1,s=o,t.render(function(t){z.renderBufferImmediate(t,s)})}else z.renderBufferDirect(n,e,i,r,t,a);var s;t.onAfterRender(z,e,n,i,r,a),P=d.get(e,I||n)}function _t(t,e,n){var i=B.get(t),r=P.state.lights,a=P.state.shadowsArray,o=r.state.version,s=v.getParameters(t,r.state,a,e,tt.numPlanes,tt.numIntersection,n),l=v.getProgramCacheKey(s),c=i.program,u=!0;if(void 0===c)t.addEventListener("dispose",pt);else if(c.cacheKey!==l)ft(t);else if(i.lightsStateVersion!==o)i.lightsStateVersion=o,u=!1;else{if(void 0!==s.shaderID)return;u=!1}u&&(c=v.acquireProgram(s,l),i.program=c,i.uniforms=s.uniforms,i.environment=t.isMeshStandardMaterial?e.environment:null,i.outputEncoding=z.outputEncoding,t.program=c);var h=c.getAttributes();if(t.morphTargets)for(var d=t.numSupportedMorphTargets=0;d<z.maxMorphTargets;d++)0<=h["morphTarget"+d]&&t.numSupportedMorphTargets++;if(t.morphNormals)for(d=t.numSupportedMorphNormals=0;d<z.maxMorphNormals;d++)0<=h["morphNormal"+d]&&t.numSupportedMorphNormals++;var p,f=i.uniforms;(t.isShaderMaterial||t.isRawShaderMaterial)&&!0!==t.clipping||(i.numClippingPlanes=tt.numPlanes,i.numIntersection=tt.numIntersection,f.clippingPlanes=tt.uniform),i.fog=e.fog,i.needsLights=(p=t).isMeshLambertMaterial||p.isMeshToonMaterial||p.isMeshPhongMaterial||p.isMeshStandardMaterial||p.isShadowMaterial||p.isShaderMaterial&&!0===p.lights,i.lightsStateVersion=o,i.needsLights&&(f.ambientLightColor.value=r.state.ambient,f.lightProbe.value=r.state.probe,f.directionalLights.value=r.state.directional,f.spotLights.value=r.state.spot,f.rectAreaLights.value=r.state.rectArea,f.pointLights.value=r.state.point,f.hemisphereLights.value=r.state.hemi,f.directionalShadowMap.value=r.state.directionalShadowMap,f.directionalShadowMatrix.value=r.state.directionalShadowMatrix,f.spotShadowMap.value=r.state.spotShadowMap,f.spotShadowMatrix.value=r.state.spotShadowMatrix,f.pointShadowMap.value=r.state.pointShadowMap,f.pointShadowMatrix.value=r.state.pointShadowMatrix);var m=i.program.getUniforms(),g=Va.seqWithValue(m.seq,f);i.uniformsList=g}function wt(t,e,n,i){F.resetTextureUnits();var r=e.fog,a=n.isMeshStandardMaterial?e.environment:null,o=B.get(n),s=P.state.lights;if(et&&(nt||t!==U)){var l=t===U&&n.id===V;tt.setState(n.clippingPlanes,n.clipIntersection,n.clipShadows,t,o,l)}n.version===o.__version?(void 0===o.program||n.fog&&o.fog!==r||o.environment!==a||o.needsLights&&o.lightsStateVersion!==s.state.version||void 0!==o.numClippingPlanes&&(o.numClippingPlanes!==tt.numPlanes||o.numIntersection!==tt.numIntersection)||o.outputEncoding!==z.outputEncoding)&&_t(n,e,i):(B.update(n,"uniforms",n.uniforms),_t(n,e,i),o.__version=n.version);var c,u,h,d,p,f,m,g,v,y,x,_,w=!1,b=!1,M=!1,S=o.program,C=S.getUniforms(),T=o.uniforms;if(N.useProgram(S.program)&&(M=b=w=!0),n.id!==V&&(V=n.id,b=!0),w||U!==t){if(0<S.numMultiviewViews?ct.updateCameraProjectionMatricesUniform(t,C):C.setValue(R,"projectionMatrix",t.projectionMatrix),k.logarithmicDepthBuffer&&C.setValue(R,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2)),U!==t&&(U=t,M=b=!0),n.isShaderMaterial||n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshStandardMaterial||n.envMap){var E=C.map.cameraPosition;void 0!==E&&E.setValue(R,rt.setFromMatrixPosition(t.matrixWorld))}(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial)&&C.setValue(R,"isOrthographic",!0===t.isOrthographicCamera),(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial||n.skinning)&&(0<S.numMultiviewViews?ct.updateCameraViewMatricesUniform(t,C):C.setValue(R,"viewMatrix",t.matrixWorldInverse))}if(n.skinning){C.setOptional(R,i,"bindMatrix"),C.setOptional(R,i,"bindMatrixInverse");var A=i.skeleton;if(A){var D=A.bones;if(k.floatVertexTextures){if(void 0===A.boneTexture){var L=Math.sqrt(4*D.length);L=Pe.ceilPowerOfTwo(L),L=Math.max(L,4);var O=new Float32Array(L*L*4);O.set(A.boneMatrices);var I=new wr(O,L,L,te,Zt);A.boneMatrices=O,A.boneTexture=I,A.boneTextureSize=L}C.setValue(R,"boneTexture",A.boneTexture,F),C.setValue(R,"boneTextureSize",A.boneTextureSize)}else C.setOptional(R,A,"boneMatrices")}}return!b&&o.receiveShadow===i.receiveShadow||(o.receiveShadow=i.receiveShadow,C.setValue(R,"receiveShadow",i.receiveShadow)),b&&(C.setValue(R,"toneMappingExposure",z.toneMappingExposure),C.setValue(R,"toneMappingWhitePoint",z.toneMappingWhitePoint),o.needsLights&&(_=M,(x=T).ambientLightColor.needsUpdate=_,x.lightProbe.needsUpdate=_,x.directionalLights.needsUpdate=_,x.pointLights.needsUpdate=_,x.spotLights.needsUpdate=_,x.rectAreaLights.needsUpdate=_,x.hemisphereLights.needsUpdate=_),r&&n.fog&&(y=r,(v=T).fogColor.value.copy(y.color),y.isFog?(v.fogNear.value=y.near,v.fogFar.value=y.far):y.isFogExp2&&(v.fogDensity.value=y.density)),n.isMeshBasicMaterial?bt(T,n):n.isMeshLambertMaterial?(bt(T,n),m=T,(g=n).emissiveMap&&(m.emissiveMap.value=g.emissiveMap)):n.isMeshToonMaterial?(bt(T,n),function(t,e){t.specular.value.copy(e.specular),t.shininess.value=Math.max(e.shininess,1e-4),e.gradientMap&&(t.gradientMap.value=e.gradientMap);e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap);e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,e.side===St&&(t.bumpScale.value*=-1));e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===St&&t.normalScale.value.negate());e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(T,n)):n.isMeshPhongMaterial?(bt(T,n),function(t,e){t.specular.value.copy(e.specular),t.shininess.value=Math.max(e.shininess,1e-4),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap);e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,e.side===St&&(t.bumpScale.value*=-1));e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===St&&t.normalScale.value.negate());e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(T,n)):n.isMeshStandardMaterial?(bt(T,n,a),(n.isMeshPhysicalMaterial?function(t,e,n){Mt(t,e,n),t.reflectivity.value=e.reflectivity,t.clearcoat.value=e.clearcoat,t.clearcoatRoughness.value=e.clearcoatRoughness,e.sheen&&t.sheen.value.copy(e.sheen);e.clearcoatNormalMap&&(t.clearcoatNormalScale.value.copy(e.clearcoatNormalScale),t.clearcoatNormalMap.value=e.clearcoatNormalMap,e.side===St&&t.clearcoatNormalScale.value.negate());t.transparency.value=e.transparency}:Mt)(T,n,a)):n.isMeshMatcapMaterial?(bt(T,n),function(t,e){e.matcap&&(t.matcap.value=e.matcap);e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,e.side===St&&(t.bumpScale.value*=-1));e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===St&&t.normalScale.value.negate());e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(T,n)):n.isMeshDepthMaterial?(bt(T,n),p=T,(f=n).displacementMap&&(p.displacementMap.value=f.displacementMap,p.displacementScale.value=f.displacementScale,p.displacementBias.value=f.displacementBias)):n.isMeshDistanceMaterial?(bt(T,n),function(t,e){e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias);t.referencePosition.value.copy(e.referencePosition),t.nearDistance.value=e.nearDistance,t.farDistance.value=e.farDistance}(T,n)):n.isMeshNormalMaterial?(bt(T,n),function(t,e){e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,e.side===St&&(t.bumpScale.value*=-1));e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===St&&t.normalScale.value.negate());e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(T,n)):n.isLineBasicMaterial?(d=n,(h=T).diffuse.value.copy(d.color),h.opacity.value=d.opacity,n.isLineDashedMaterial&&(u=n,(c=T).dashSize.value=u.dashSize,c.totalSize.value=u.dashSize+u.gapSize,c.scale.value=u.scale)):n.isPointsMaterial?function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.size.value=e.size*q,t.scale.value=.5*J,e.map&&(t.map.value=e.map);e.alphaMap&&(t.alphaMap.value=e.alphaMap);var n;e.map?n=e.map:e.alphaMap&&(n=e.alphaMap);void 0!==n&&(!0===n.matrixAutoUpdate&&n.updateMatrix(),t.uvTransform.value.copy(n.matrix))}(T,n):n.isSpriteMaterial?function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.rotation.value=e.rotation,e.map&&(t.map.value=e.map);e.alphaMap&&(t.alphaMap.value=e.alphaMap);var n;e.map?n=e.map:e.alphaMap&&(n=e.alphaMap);void 0!==n&&(!0===n.matrixAutoUpdate&&n.updateMatrix(),t.uvTransform.value.copy(n.matrix))}(T,n):n.isShadowMaterial&&(T.color.value.copy(n.color),T.opacity.value=n.opacity),void 0!==T.ltc_1&&(T.ltc_1.value=Cr.LTC_1),void 0!==T.ltc_2&&(T.ltc_2.value=Cr.LTC_2),Va.upload(R,o.uniformsList,T,F),n.isShaderMaterial&&(n.uniformsNeedUpdate=!1)),n.isShaderMaterial&&!0===n.uniformsNeedUpdate&&(Va.upload(R,o.uniformsList,T,F),n.uniformsNeedUpdate=!1),n.isSpriteMaterial&&C.setValue(R,"center",i.center),0<S.numMultiviewViews?ct.updateObjectMatricesUniforms(i,t,C):(C.setValue(R,"modelViewMatrix",i.modelViewMatrix),C.setValue(R,"normalMatrix",i.normalMatrix)),C.setValue(R,"modelMatrix",i.matrixWorld),S}function bt(t,e,n){t.opacity.value=e.opacity,e.color&&t.diffuse.value.copy(e.color),e.emissive&&t.emissive.value.copy(e.emissive).multiplyScalar(e.emissiveIntensity),e.map&&(t.map.value=e.map),e.alphaMap&&(t.alphaMap.value=e.alphaMap),e.specularMap&&(t.specularMap.value=e.specularMap);var i,r,a=e.envMap||n;a&&(t.envMap.value=a,t.flipEnvMap.value=a.isCubeTexture?-1:1,t.reflectivity.value=e.reflectivity,t.refractionRatio.value=e.refractionRatio,t.maxMipLevel.value=B.get(a).__maxMipLevel),e.lightMap&&(t.lightMap.value=e.lightMap,t.lightMapIntensity.value=e.lightMapIntensity),e.aoMap&&(t.aoMap.value=e.aoMap,t.aoMapIntensity.value=e.aoMapIntensity),e.map?i=e.map:e.specularMap?i=e.specularMap:e.displacementMap?i=e.displacementMap:e.normalMap?i=e.normalMap:e.bumpMap?i=e.bumpMap:e.roughnessMap?i=e.roughnessMap:e.metalnessMap?i=e.metalnessMap:e.alphaMap?i=e.alphaMap:e.emissiveMap&&(i=e.emissiveMap),void 0!==i&&(i.isWebGLRenderTarget&&(i=i.texture),!0===i.matrixAutoUpdate&&i.updateMatrix(),t.uvTransform.value.copy(i.matrix)),e.aoMap?r=e.aoMap:e.lightMap&&(r=e.lightMap),void 0!==r&&(r.isWebGLRenderTarget&&(r=r.texture),!0===r.matrixAutoUpdate&&r.updateMatrix(),t.uv2Transform.value.copy(r.matrix))}function Mt(t,e,n){t.roughness.value=e.roughness,t.metalness.value=e.metalness,e.roughnessMap&&(t.roughnessMap.value=e.roughnessMap),e.metalnessMap&&(t.metalnessMap.value=e.metalnessMap),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,e.side===St&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===St&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias),(e.envMap||n)&&(t.envMapIntensity.value=e.envMapIntensity)}vt.setAnimationLoop(function(t){lt.isPresenting||gt&>(t)}),"undefined"!=typeof window&&vt.setContext(window),this.setAnimationLoop=function(t){gt=t,lt.setAnimationLoop(t),vt.start()},this.render=function(t,e){var n,i;if(void 0!==arguments[2]&&(console.warn("THREE.WebGLRenderer.render(): the renderTarget argument has been removed. Use .setRenderTarget() instead."),n=arguments[2]),void 0!==arguments[3]&&(console.warn("THREE.WebGLRenderer.render(): the forceClear argument has been removed. Use .clear() instead."),i=arguments[3]),e&&e.isCamera){if(!x){O.geometry=null,O.program=null,O.wireframe=!1,V=-1,!(U=null)===t.autoUpdate&&t.updateMatrixWorld(),null===e.parent&&e.updateMatrixWorld(),lt.enabled&<.isPresenting&&(e=lt.getCamera(e)),(P=d.get(t,e)).init(),t.onBeforeRender(z,t,e,n||D),it.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),Q.setFromProjectionMatrix(it),nt=this.localClippingEnabled,et=tt.init(this.clippingPlanes,nt,e),(f=h.get(t,e)).init(),function t(e,n,i,r){if(!1===e.visible)return;var a=e.layers.test(n.layers);if(a)if(e.isGroup)i=e.renderOrder;else if(e.isLOD)!0===e.autoUpdate&&e.update(n);else if(e.isLight)P.pushLight(e),e.castShadow&&P.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||Q.intersectsSprite(e)){r&&rt.setFromMatrixPosition(e.matrixWorld).applyMatrix4(it);var o=g.update(e),s=e.material;s.visible&&f.push(e,o,s,i,rt.z,null)}}else if(e.isImmediateRenderObject)r&&rt.setFromMatrixPosition(e.matrixWorld).applyMatrix4(it),f.push(e,null,e.material,i,rt.z,null);else if((e.isMesh||e.isLine||e.isPoints)&&(e.isSkinnedMesh&&e.skeleton.frame!==m.render.frame&&(e.skeleton.update(),e.skeleton.frame=m.render.frame),!e.frustumCulled||Q.intersectsObject(e))){r&&rt.setFromMatrixPosition(e.matrixWorld).applyMatrix4(it);var o=g.update(e),s=e.material;if(Array.isArray(s))for(var l=o.groups,c=0,u=l.length;c<u;c++){var h=l[c],d=s[h.materialIndex];d&&d.visible&&f.push(e,o,d,i,rt.z,h)}else s.visible&&f.push(e,o,s,i,rt.z,null)}var p=e.children;for(var c=0,u=p.length;c<u;c++)t(p[c],n,i,r)}(t,e,0,z.sortObjects),!0===z.sortObjects&&f.sort(X,Y),et&&tt.beginShadows();var r=P.state.shadowsArray;ut.render(r,t,e),P.setupLights(e),et&&tt.endShadows(),this.info.autoReset&&this.info.reset(),void 0!==n&&this.setRenderTarget(n),lt.enabled&&ct.isAvailable()&&ct.attachCamera(e),p.render(f,t,e,i);var a=f.opaque,o=f.transparent;if(t.overrideMaterial){var s=t.overrideMaterial;a.length&&yt(a,t,e,s),o.length&&yt(o,t,e,s)}else a.length&&yt(a,t,e),o.length&&yt(o,t,e);t.onAfterRender(z,t,e),null!==D&&(F.updateRenderTargetMipmap(D),F.updateMultisampleRenderTarget(D)),N.buffers.depth.setTest(!0),N.buffers.depth.setMask(!0),N.buffers.color.setMask(!0),N.setPolygonOffset(!1),lt.enabled&&ct.isAvailable()&&ct.detachCamera(e),P=f=null}}else console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")},this.setFramebuffer=function(t){_!==t&&null===D&&R.bindFramebuffer(36160,t),_=t},this.getActiveCubeFace=function(){return w},this.getActiveMipmapLevel=function(){return b},this.getRenderTarget=function(){return D},this.setRenderTarget=function(t,e,n){w=e,b=n,(D=t)&&void 0===B.get(t).__webglFramebuffer&&F.setupRenderTarget(t);var i=_,r=!1;if(t){var a=B.get(t).__webglFramebuffer;t.isWebGLCubeRenderTarget?(i=a[e||0],r=!0):i=t.isWebGLMultisampleRenderTarget?B.get(t).__webglMultisampledFramebuffer:a,j.copy(t.viewport),G.copy(t.scissor),H=t.scissorTest}else j.copy(Z).multiplyScalar(q).floor(),G.copy($).multiplyScalar(q).floor(),H=K;if(L!==i&&(R.bindFramebuffer(36160,i),L=i),N.viewport(j),N.scissor(G),N.setScissorTest(H),r){var o=B.get(t.texture);R.framebufferTexture2D(36160,36064,34069+(e||0),o.__webglTexture,n||0)}},this.readRenderTargetPixels=function(t,e,n,i,r,a,o){if(t&&t.isWebGLRenderTarget){var s=B.get(t).__webglFramebuffer;if(t.isWebGLCubeRenderTarget&&void 0!==o&&(s=s[o]),s){var l=!1;s!==L&&(R.bindFramebuffer(36160,s),l=!0);try{var c=t.texture,u=c.format,h=c.type;if(u!==te&&y.convert(u)!==R.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!(h===qt||y.convert(h)===R.getParameter(35738)||h===Zt&&(k.isWebGL2||M.get("OES_texture_float")||M.get("WEBGL_color_buffer_float"))||h===$t&&(k.isWebGL2?M.get("EXT_color_buffer_float"):M.get("EXT_color_buffer_half_float"))))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");36053===R.checkFramebufferStatus(36160)?0<=e&&e<=t.width-i&&0<=n&&n<=t.height-r&&R.readPixels(e,n,i,r,y.convert(u),y.convert(h),a):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{l&&R.bindFramebuffer(36160,L)}}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")},this.copyFramebufferToTexture=function(t,e,n){void 0===n&&(n=0);var i=Math.pow(2,-n),r=Math.floor(e.image.width*i),a=Math.floor(e.image.height*i),o=y.convert(e.format);F.setTexture2D(e,0),R.copyTexImage2D(3553,n,o,t.x,t.y,r,a,0),N.unbindTexture()},this.copyTextureToTexture=function(t,e,n,i){var r=e.image.width,a=e.image.height,o=y.convert(n.format),s=y.convert(n.type);F.setTexture2D(n,0),e.isDataTexture?R.texSubImage2D(3553,i||0,t.x,t.y,r,a,o,s,e.image.data):R.texSubImage2D(3553,i||0,t.x,t.y,o,s,e.image),N.unbindTexture()},this.initTexture=function(t){F.setTexture2D(t,0),N.unbindTexture()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}function Lo(t,e){this.name="",this.color=new ci(t),this.density=void 0!==e?e:25e-5}function Oo(t,e,n){this.name="",this.color=new ci(t),this.near=void 0!==e?e:1,this.far=void 0!==n?n:1e3}function Io(t,e){this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.usage=Ee,this.updateRange={offset:0,count:-1},this.version=0}So.prototype=Object.assign(Object.create(Ve.prototype),{constructor:So,isWebGLMultiviewRenderTarget:!0,copy:function(t){return Ve.prototype.copy.call(this,t),this.numViews=t.numViews,this},setNumViews:function(t){return this.numViews!==t&&(this.numViews=t,this.dispose()),this}}),To.prototype=Object.assign(Object.create(yr.prototype),{constructor:To,isArrayCamera:!0}),Eo.prototype=Object.assign(Object.create(yn.prototype),{constructor:Eo,isGroup:!0}),Object.assign(Ao.prototype,De.prototype),Object.assign(Lo.prototype,{isFogExp2:!0,clone:function(){return new Lo(this.color,this.density)},toJSON:function(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}),Object.assign(Oo.prototype,{isFog:!0,clone:function(){return new Oo(this.color,this.near,this.far)},toJSON:function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}),Object.defineProperty(Io.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(Io.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,e,n){t*=this.stride,n*=e.stride;for(var i=0,r=this.stride;i<r;i++)this.array[t+i]=e.array[n+i];return this},set:function(t,e){return void 0===e&&(e=0),this.array.set(t,e),this},clone:function(){return(new this.constructor).copy(this)},onUpload:function(t){return this.onUploadCallback=t,this}});var Po,Ro=new We;function ko(t,e,n,i){this.data=t,this.itemSize=e,this.offset=n,this.normalized=!0===i}function No(t){mi.call(this),this.type="SpriteMaterial",this.color=new ci(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.setValues(t)}Object.defineProperties(ko.prototype,{count:{get:function(){return this.data.count}},array:{get:function(){return this.data.array}}}),Object.assign(ko.prototype,{isInterleavedBufferAttribute:!0,applyMatrix4:function(t){for(var e=0,n=this.data.count;e<n;e++)Ro.x=this.getX(e),Ro.y=this.getY(e),Ro.z=this.getZ(e),Ro.applyMatrix4(t),this.setXYZ(e,Ro.x,Ro.y,Ro.z);return this},setX:function(t,e){return this.data.array[t*this.data.stride+this.offset]=e,this},setY:function(t,e){return this.data.array[t*this.data.stride+this.offset+1]=e,this},setZ:function(t,e){return this.data.array[t*this.data.stride+this.offset+2]=e,this},setW:function(t,e){return this.data.array[t*this.data.stride+this.offset+3]=e,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,e,n){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=n,this},setXYZ:function(t,e,n,i){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=n,this.data.array[t+2]=i,this},setXYZW:function(t,e,n,i,r){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=n,this.data.array[t+2]=i,this.data.array[t+3]=r,this}}),((No.prototype=Object.create(mi.prototype)).constructor=No).prototype.isSpriteMaterial=!0,No.prototype.copy=function(t){return mi.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};var Bo=new We,Fo=new We,zo=new We,Vo=new Re,Uo=new Re,jo=new Qe,Go=new We,Ho=new We,Wo=new We,Jo=new Re,qo=new Re,Xo=new Re;function Yo(t){if(yn.call(this),this.type="Sprite",void 0===Po){Po=new Bi;var e=new Io(new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),5);Po.setIndex([0,1,2,0,2,3]),Po.setAttribute("position",new ko(e,3,0,!1)),Po.setAttribute("uv",new ko(e,2,3,!1))}this.geometry=Po,this.material=void 0!==t?t:new No,this.center=new Re(.5,.5)}function Zo(t,e,n,i,r,a){Vo.subVectors(t,n).addScalar(.5).multiply(i),void 0!==r?(Uo.x=a*Vo.x-r*Vo.y,Uo.y=r*Vo.x+a*Vo.y):Uo.copy(Vo),t.copy(e),t.x+=Uo.x,t.y+=Uo.y,t.applyMatrix4(jo)}Yo.prototype=Object.assign(Object.create(yn.prototype),{constructor:Yo,isSprite:!0,raycast:function(t,e){null===t.camera&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),Fo.setFromMatrixScale(this.matrixWorld),jo.copy(t.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(t.camera.matrixWorldInverse,this.matrixWorld),zo.setFromMatrixPosition(this.modelViewMatrix),t.camera.isPerspectiveCamera&&!1===this.material.sizeAttenuation&&Fo.multiplyScalar(-zo.z);var n,i,r=this.material.rotation;0!==r&&(i=Math.cos(r),n=Math.sin(r));var a=this.center;Zo(Go.set(-.5,-.5,0),zo,a,Fo,n,i),Zo(Ho.set(.5,-.5,0),zo,a,Fo,n,i),Zo(Wo.set(.5,.5,0),zo,a,Fo,n,i),Jo.set(0,0),qo.set(1,0),Xo.set(1,1);var o=t.ray.intersectTriangle(Go,Ho,Wo,!1,Bo);if(null!==o||(Zo(Ho.set(-.5,.5,0),zo,a,Fo,n,i),qo.set(0,1),null!==(o=t.ray.intersectTriangle(Go,Wo,Ho,!1,Bo)))){var s=t.ray.origin.distanceTo(Bo);s<t.near||s>t.far||e.push({distance:s,point:Bo.clone(),uv:ai.getUV(Bo,Go,Ho,Wo,Jo,qo,Xo,new Re),face:null,object:this})}},clone:function(){return new this.constructor(this.material).copy(this)},copy:function(t){return yn.prototype.copy.call(this,t),void 0!==t.center&&this.center.copy(t.center),this}});var $o=new We,Ko=new We;function Qo(){yn.call(this),this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}function ts(t,e){t&&t.isGeometry&&console.error("THREE.SkinnedMesh no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."),er.call(this,t,e),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new Qe,this.bindMatrixInverse=new Qe}Qo.prototype=Object.assign(Object.create(yn.prototype),{constructor:Qo,isLOD:!0,copy:function(t){yn.prototype.copy.call(this,t,!1);for(var e=t.levels,n=0,i=e.length;n<i;n++){var r=e[n];this.addLevel(r.object.clone(),r.distance)}return this.autoUpdate=t.autoUpdate,this},addLevel:function(t,e){void 0===e&&(e=0),e=Math.abs(e);for(var n=this.levels,i=0;i<n.length&&!(e<n[i].distance);i++);return n.splice(i,0,{distance:e,object:t}),this.add(t),this},getObjectForDistance:function(t){var e=this.levels;if(0<e.length){for(var n=1,i=e.length;n<i&&!(t<e[n].distance);n++);return e[n-1].object}return null},raycast:function(t,e){if(0<this.levels.length){$o.setFromMatrixPosition(this.matrixWorld);var n=t.ray.origin.distanceTo($o);this.getObjectForDistance(n).raycast(t,e)}},update:function(t){var e=this.levels;if(1<e.length){$o.setFromMatrixPosition(t.matrixWorld),Ko.setFromMatrixPosition(this.matrixWorld);var n=$o.distanceTo(Ko);e[0].object.visible=!0;for(var i=1,r=e.length;i<r&&n>=e[i].distance;i++)e[i-1].object.visible=!1,e[i].object.visible=!0;for(;i<r;i++)e[i].object.visible=!1}},toJSON:function(t){var e=yn.prototype.toJSON.call(this,t);!1===this.autoUpdate&&(e.object.autoUpdate=!1),e.object.levels=[];for(var n=this.levels,i=0,r=n.length;i<r;i++){var a=n[i];e.object.levels.push({object:a.object.uuid,distance:a.distance})}return e}}),ts.prototype=Object.assign(Object.create(er.prototype),{constructor:ts,isSkinnedMesh:!0,bind:function(t,e){this.skeleton=t,void 0===e&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),e=this.matrixWorld),this.bindMatrix.copy(e),this.bindMatrixInverse.getInverse(e)},pose:function(){this.skeleton.pose()},normalizeSkinWeights:function(){for(var t=new ze,e=this.geometry.attributes.skinWeight,n=0,i=e.count;n<i;n++){t.x=e.getX(n),t.y=e.getY(n),t.z=e.getZ(n),t.w=e.getW(n);var r=1/t.manhattanLength();r!=1/0?t.multiplyScalar(r):t.set(1,0,0,0),e.setXYZW(n,t.x,t.y,t.z,t.w)}},updateMatrixWorld:function(t){er.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 es=new Qe,ns=new Qe;function is(t,e){if(t=t||[],this.bones=t.slice(0),this.boneMatrices=new Float32Array(16*this.bones.length),this.frame=-1,void 0===e)this.calculateInverses();else if(this.bones.length===e.length)this.boneInverses=e.slice(0);else{console.warn("THREE.Skeleton boneInverses is the wrong length."),this.boneInverses=[];for(var n=0,i=this.bones.length;n<i;n++)this.boneInverses.push(new Qe)}}function rs(){yn.call(this),this.type="Bone"}Object.assign(is.prototype,{calculateInverses:function(){this.boneInverses=[];for(var t=0,e=this.bones.length;t<e;t++){var n=new Qe;this.bones[t]&&n.getInverse(this.bones[t].matrixWorld),this.boneInverses.push(n)}},pose:function(){var t,e,n;for(e=0,n=this.bones.length;e<n;e++)(t=this.bones[e])&&t.matrixWorld.getInverse(this.boneInverses[e]);for(e=0,n=this.bones.length;e<n;e++)(t=this.bones[e])&&(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,e=this.boneInverses,n=this.boneMatrices,i=this.boneTexture,r=0,a=t.length;r<a;r++){var o=t[r]?t[r].matrixWorld:ns;es.multiplyMatrices(o,e[r]),es.toArray(n,16*r)}void 0!==i&&(i.needsUpdate=!0)},clone:function(){return new is(this.bones,this.boneInverses)},getBoneByName:function(t){for(var e=0,n=this.bones.length;e<n;e++){var i=this.bones[e];if(i.name===t)return i}}}),rs.prototype=Object.assign(Object.create(yn.prototype),{constructor:rs,isBone:!0});var as=new Qe,os=new Qe,ss=[],ls=new er;function cs(t,e,n){er.call(this,t,e),this.instanceMatrix=new yi(new Float32Array(16*n),16),this.count=n,this.frustumCulled=!1}function us(t){mi.call(this),this.type="LineBasicMaterial",this.color=new ci(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.setValues(t)}cs.prototype=Object.assign(Object.create(er.prototype),{constructor:cs,isInstancedMesh:!0,getMatrixAt:function(t,e){e.fromArray(this.instanceMatrix.array,16*t)},raycast:function(t,e){var n=this.matrixWorld,i=this.count;if(ls.geometry=this.geometry,ls.material=this.material,void 0!==ls.material)for(var r=0;r<i;r++)this.getMatrixAt(r,as),os.multiplyMatrices(n,as),ls.matrixWorld=os,ls.raycast(t,ss),0<ss.length&&(ss[0].instanceId=r,ss[0].object=this,e.push(ss[0]),ss.length=0)},setMatrixAt:function(t,e){e.toArray(this.instanceMatrix.array,16*t)},updateMorphTargets:function(){}}),((us.prototype=Object.create(mi.prototype)).constructor=us).prototype.isLineBasicMaterial=!0,us.prototype.copy=function(t){return mi.prototype.copy.call(this,t),this.color.copy(t.color),this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this};var hs=new We,ds=new We,ps=new Qe,fs=new Hn,ms=new Nn;function gs(t,e,n){1===n&&console.error("THREE.Line: parameter THREE.LinePieces no longer supported. Use THREE.LineSegments instead."),yn.call(this),this.type="Line",this.geometry=void 0!==t?t:new Bi,this.material=void 0!==e?e:new us}gs.prototype=Object.assign(Object.create(yn.prototype),{constructor:gs,isLine:!0,computeLineDistances:function(){var t=this.geometry;if(t.isBufferGeometry)if(null===t.index){for(var e=t.attributes.position,n=[0],i=1,r=e.count;i<r;i++)hs.fromBufferAttribute(e,i-1),ds.fromBufferAttribute(e,i),n[i]=n[i-1],n[i]+=hs.distanceTo(ds);t.setAttribute("lineDistance",new Ti(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(t.isGeometry){var a=t.vertices;(n=t.lineDistances)[0]=0;for(i=1,r=a.length;i<r;i++)n[i]=n[i-1],n[i]+=a[i-1].distanceTo(a[i])}return this},raycast:function(t,e){var n=t.linePrecision,i=this.geometry,r=this.matrixWorld;if(null===i.boundingSphere&&i.computeBoundingSphere(),ms.copy(i.boundingSphere),ms.applyMatrix4(r),ms.radius+=n,!1!==t.ray.intersectsSphere(ms)){ps.getInverse(r),fs.copy(t.ray).applyMatrix4(ps);var a=n/((this.scale.x+this.scale.y+this.scale.z)/3),o=a*a,s=new We,l=new We,c=new We,u=new We,h=this&&this.isLineSegments?2:1;if(i.isBufferGeometry){var d=i.index,p=i.attributes.position.array;if(null!==d)for(var f=d.array,m=0,g=f.length-1;m<g;m+=h){var v=f[m],y=f[m+1];if(s.fromArray(p,3*v),l.fromArray(p,3*y),!(o<fs.distanceSqToSegment(s,l,u,c)))u.applyMatrix4(this.matrixWorld),(w=t.ray.origin.distanceTo(u))<t.near||w>t.far||e.push({distance:w,point:c.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this})}else for(m=0,g=p.length/3-1;m<g;m+=h){if(s.fromArray(p,3*m),l.fromArray(p,3*m+3),!(o<fs.distanceSqToSegment(s,l,u,c)))u.applyMatrix4(this.matrixWorld),(w=t.ray.origin.distanceTo(u))<t.near||w>t.far||e.push({distance:w,point:c.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this})}}else if(i.isGeometry){var x=i.vertices,_=x.length;for(m=0;m<_-1;m+=h){var w;if(!(o<fs.distanceSqToSegment(x[m],x[m+1],u,c)))u.applyMatrix4(this.matrixWorld),(w=t.ray.origin.distanceTo(u))<t.near||w>t.far||e.push({distance:w,point:c.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this})}}}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var vs=new We,ys=new We;function xs(t,e){gs.call(this,t,e),this.type="LineSegments"}function _s(t,e){gs.call(this,t,e),this.type="LineLoop"}function ws(t){mi.call(this),this.type="PointsMaterial",this.color=new ci(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.setValues(t)}xs.prototype=Object.assign(Object.create(gs.prototype),{constructor:xs,isLineSegments:!0,computeLineDistances:function(){var t=this.geometry;if(t.isBufferGeometry)if(null===t.index){for(var e=t.attributes.position,n=[],i=0,r=e.count;i<r;i+=2)vs.fromBufferAttribute(e,i),ys.fromBufferAttribute(e,i+1),n[i]=0===i?0:n[i-1],n[i+1]=n[i]+vs.distanceTo(ys);t.setAttribute("lineDistance",new Ti(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(t.isGeometry){var a=t.vertices;for(n=t.lineDistances,i=0,r=a.length;i<r;i+=2)vs.copy(a[i]),ys.copy(a[i+1]),n[i]=0===i?0:n[i-1],n[i+1]=n[i]+vs.distanceTo(ys)}return this}}),_s.prototype=Object.assign(Object.create(gs.prototype),{constructor:_s,isLineLoop:!0}),((ws.prototype=Object.create(mi.prototype)).constructor=ws).prototype.isPointsMaterial=!0,ws.prototype.copy=function(t){return mi.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};var bs=new Qe,Ms=new Hn,Ss=new Nn,Cs=new We;function Ts(t,e){yn.call(this),this.type="Points",this.geometry=void 0!==t?t:new Bi,this.material=void 0!==e?e:new ws,this.updateMorphTargets()}function Es(t,e,n,i,r,a,o){var s=Ms.distanceSqToPoint(t);if(s<n){var l=new We;Ms.closestPointToPoint(t,l),l.applyMatrix4(i);var c=r.ray.origin.distanceTo(l);if(c<r.near||c>r.far)return;a.push({distance:c,distanceToRay:Math.sqrt(s),point:l,index:e,face:null,object:o})}}function As(t,e,n,i,r,a,o,s,l){Fe.call(this,t,e,n,i,r,a,o,s,l),this.format=void 0!==o?o:Qt,this.minFilter=void 0!==a?a:Ht,this.magFilter=void 0!==r?r:Ht,this.generateMipmaps=!1}function Ds(t,e,n,i,r,a,o,s,l,c,u,h){Fe.call(this,null,a,o,s,l,c,i,r,u,h),this.image={width:e,height:n},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}function Ls(t,e,n,i,r,a,o,s,l){Fe.call(this,t,e,n,i,r,a,o,s,l),this.needsUpdate=!0}function Os(t,e,n,i,r,a,o,s,l,c){if((c=void 0!==c?c:ee)!==ee&&c!==ne)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&c===ee&&(n=Xt),void 0===n&&c===ne&&(n=Kt),Fe.call(this,null,i,r,a,o,s,c,n,l),this.image={width:t,height:e},this.magFilter=void 0!==o?o:Ut,this.minFilter=void 0!==s?s:Ut,this.flipY=!1,this.generateMipmaps=!1}function Is(t){Bi.call(this),this.type="WireframeGeometry";var e,n,i,r,a,o,s,l,c,u,h=[],d=[0,0],p={},f=["a","b","c"];if(t&&t.isGeometry){var m=t.faces;for(e=0,i=m.length;e<i;e++){var g=m[e];for(n=0;n<3;n++)s=g[f[n]],l=g[f[(n+1)%3]],d[0]=Math.min(s,l),d[1]=Math.max(s,l),void 0===p[c=d[0]+","+d[1]]&&(p[c]={index1:d[0],index2:d[1]})}for(c in p)o=p[c],u=t.vertices[o.index1],h.push(u.x,u.y,u.z),u=t.vertices[o.index2],h.push(u.x,u.y,u.z)}else if(t&&t.isBufferGeometry){var v,y,x,_,w,b;if(u=new We,null!==t.index){for(v=t.attributes.position,y=t.index,0===(x=t.groups).length&&(x=[{start:0,count:y.count,materialIndex:0}]),r=0,a=x.length;r<a;++r)for(i=(e=(_=x[r]).start)+_.count;e<i;e+=3)for(n=0;n<3;n++)s=y.getX(e+n),l=y.getX(e+(n+1)%3),d[0]=Math.min(s,l),d[1]=Math.max(s,l),void 0===p[c=d[0]+","+d[1]]&&(p[c]={index1:d[0],index2:d[1]});for(c in p)o=p[c],u.fromBufferAttribute(v,o.index1),h.push(u.x,u.y,u.z),u.fromBufferAttribute(v,o.index2),h.push(u.x,u.y,u.z)}else for(e=0,i=(v=t.attributes.position).count/3;e<i;e++)for(n=0;n<3;n++)w=3*e+n,u.fromBufferAttribute(v,w),h.push(u.x,u.y,u.z),b=3*e+(n+1)%3,u.fromBufferAttribute(v,b),h.push(u.x,u.y,u.z)}this.setAttribute("position",new Ti(h,3))}function Ps(t,e,n){lr.call(this),this.type="ParametricGeometry",this.parameters={func:t,slices:e,stacks:n},this.fromBufferGeometry(new Rs(t,e,n)),this.mergeVertices()}function Rs(t,e,n){Bi.call(this),this.type="ParametricBufferGeometry",this.parameters={func:t,slices:e,stacks:n};var i,r,a=[],o=[],s=[],l=[],c=new We,u=new We,h=new We,d=new We,p=new We;t.length<3&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");var f=e+1;for(i=0;i<=n;i++){var m=i/n;for(r=0;r<=e;r++){var g=r/e;t(g,m,u),o.push(u.x,u.y,u.z),0<=g-1e-5?(t(g-1e-5,m,h),d.subVectors(u,h)):(t(1e-5+g,m,h),d.subVectors(h,u)),0<=m-1e-5?(t(g,m-1e-5,h),p.subVectors(u,h)):(t(g,1e-5+m,h),p.subVectors(h,u)),c.crossVectors(d,p).normalize(),s.push(c.x,c.y,c.z),l.push(g,m)}}for(i=0;i<n;i++)for(r=0;r<e;r++){var v=i*f+r,y=i*f+r+1,x=(i+1)*f+r+1,_=(i+1)*f+r;a.push(v,y,_),a.push(y,x,_)}this.setIndex(a),this.setAttribute("position",new Ti(o,3)),this.setAttribute("normal",new Ti(s,3)),this.setAttribute("uv",new Ti(l,2))}function ks(t,e,n,i){lr.call(this),this.type="PolyhedronGeometry",this.parameters={vertices:t,indices:e,radius:n,detail:i},this.fromBufferGeometry(new Ns(t,e,n,i)),this.mergeVertices()}function Ns(i,a,t,e){Bi.call(this),this.type="PolyhedronBufferGeometry",this.parameters={vertices:i,indices:a,radius:t,detail:e},t=t||1;var u=[],h=[];function o(t,e,n,i){var r,a,o=Math.pow(2,i),s=[];for(r=0;r<=o;r++){s[r]=[];var l=t.clone().lerp(n,r/o),c=e.clone().lerp(n,r/o),u=o-r;for(a=0;a<=u;a++)s[r][a]=0===a&&r===o?l:l.clone().lerp(c,a/u)}for(r=0;r<o;r++)for(a=0;a<2*(o-r)-1;a++){var h=Math.floor(a/2);a%2==0?(d(s[r][h+1]),d(s[r+1][h]),d(s[r][h])):(d(s[r][h+1]),d(s[r+1][h+1]),d(s[r+1][h]))}}function d(t){u.push(t.x,t.y,t.z)}function s(t,e){var n=3*t;e.x=i[0+n],e.y=i[1+n],e.z=i[2+n]}function p(t,e,n,i){i<0&&1===t.x&&(h[e]=t.x-1),0===n.x&&0===n.z&&(h[e]=i/2/Math.PI+.5)}function f(t){return Math.atan2(t.z,-t.x)}!function(t){for(var e=new We,n=new We,i=new We,r=0;r<a.length;r+=3)s(a[r+0],e),s(a[r+1],n),s(a[r+2],i),o(e,n,i,t)}(e=e||0),function(t){for(var e=new We,n=0;n<u.length;n+=3)e.x=u[n+0],e.y=u[n+1],e.z=u[n+2],e.normalize().multiplyScalar(t),u[n+0]=e.x,u[n+1]=e.y,u[n+2]=e.z}(t),function(){for(var t=new We,e=0;e<u.length;e+=3){t.x=u[e+0],t.y=u[e+1],t.z=u[e+2];var n=f(t)/2/Math.PI+.5,i=(r=t,Math.atan2(-r.y,Math.sqrt(r.x*r.x+r.z*r.z))/Math.PI+.5);h.push(n,1-i)}var r;(function(){for(var t=new We,e=new We,n=new We,i=new We,r=new Re,a=new Re,o=new Re,s=0,l=0;s<u.length;s+=9,l+=6){t.set(u[s+0],u[s+1],u[s+2]),e.set(u[s+3],u[s+4],u[s+5]),n.set(u[s+6],u[s+7],u[s+8]),r.set(h[l+0],h[l+1]),a.set(h[l+2],h[l+3]),o.set(h[l+4],h[l+5]),i.copy(t).add(e).add(n).divideScalar(3);var c=f(i);p(r,l+0,t,c),p(a,l+2,e,c),p(o,l+4,n,c)}})(),function(){for(var t=0;t<h.length;t+=6){var e=h[t+0],n=h[t+2],i=h[t+4],r=Math.max(e,n,i),a=Math.min(e,n,i);.9<r&&a<.1&&(e<.2&&(h[t+0]+=1),n<.2&&(h[t+2]+=1),i<.2&&(h[t+4]+=1))}}()}(),this.setAttribute("position",new Ti(u,3)),this.setAttribute("normal",new Ti(u.slice(),3)),this.setAttribute("uv",new Ti(h,2)),0===e?this.computeVertexNormals():this.normalizeNormals()}function Bs(t,e){lr.call(this),this.type="TetrahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new Fs(t,e)),this.mergeVertices()}function Fs(t,e){Ns.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],t,e),this.type="TetrahedronBufferGeometry",this.parameters={radius:t,detail:e}}function zs(t,e){lr.call(this),this.type="OctahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new Vs(t,e)),this.mergeVertices()}function Vs(t,e){Ns.call(this,[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],t,e),this.type="OctahedronBufferGeometry",this.parameters={radius:t,detail:e}}function Us(t,e){lr.call(this),this.type="IcosahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new js(t,e)),this.mergeVertices()}function js(t,e){var n=(1+Math.sqrt(5))/2;Ns.call(this,[-1,n,0,1,n,0,-1,-n,0,1,-n,0,0,-1,n,0,1,n,0,-1,-n,0,1,-n,n,0,-1,n,0,1,-n,0,-1,-n,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],t,e),this.type="IcosahedronBufferGeometry",this.parameters={radius:t,detail:e}}function Gs(t,e){lr.call(this),this.type="DodecahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new Hs(t,e)),this.mergeVertices()}function Hs(t,e){var n=(1+Math.sqrt(5))/2,i=1/n;Ns.call(this,[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-i,-n,0,-i,n,0,i,-n,0,i,n,-i,-n,0,-i,n,0,i,-n,0,i,n,0,-n,0,-i,n,0,-i,-n,0,i,n,0,i],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],t,e),this.type="DodecahedronBufferGeometry",this.parameters={radius:t,detail:e}}function Ws(t,e,n,i,r,a){lr.call(this),this.type="TubeGeometry",this.parameters={path:t,tubularSegments:e,radius:n,radialSegments:i,closed:r},void 0!==a&&console.warn("THREE.TubeGeometry: taper has been removed.");var o=new Js(t,e,n,i,r);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals,this.fromBufferGeometry(o),this.mergeVertices()}function Js(o,s,l,c,t){Bi.call(this),this.type="TubeBufferGeometry",this.parameters={path:o,tubularSegments:s,radius:l,radialSegments:c,closed:t},s=s||64,l=l||1,c=c||8,t=t||!1;var u=o.computeFrenetFrames(s,t);this.tangents=u.tangents,this.normals=u.normals,this.binormals=u.binormals;var r,h,d=new We,p=new We,e=new Re,f=new We,m=[],g=[],n=[],a=[];function i(t){f=o.getPointAt(t/s,f);var e=u.normals[t],n=u.binormals[t];for(h=0;h<=c;h++){var i=h/c*Math.PI*2,r=Math.sin(i),a=-Math.cos(i);p.x=a*e.x+r*n.x,p.y=a*e.y+r*n.y,p.z=a*e.z+r*n.z,p.normalize(),g.push(p.x,p.y,p.z),d.x=f.x+l*p.x,d.y=f.y+l*p.y,d.z=f.z+l*p.z,m.push(d.x,d.y,d.z)}}!function(){for(r=0;r<s;r++)i(r);i(!1===t?s:0),function(){for(r=0;r<=s;r++)for(h=0;h<=c;h++)e.x=r/s,e.y=h/c,n.push(e.x,e.y)}(),function(){for(h=1;h<=s;h++)for(r=1;r<=c;r++){var t=(c+1)*(h-1)+(r-1),e=(c+1)*h+(r-1),n=(c+1)*h+r,i=(c+1)*(h-1)+r;a.push(t,e,i),a.push(e,n,i)}}()}(),this.setIndex(a),this.setAttribute("position",new Ti(m,3)),this.setAttribute("normal",new Ti(g,3)),this.setAttribute("uv",new Ti(n,2))}function qs(t,e,n,i,r,a,o){lr.call(this),this.type="TorusKnotGeometry",this.parameters={radius:t,tube:e,tubularSegments:n,radialSegments:i,p:r,q:a},void 0!==o&&console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),this.fromBufferGeometry(new Xs(t,e,n,i,r,a)),this.mergeVertices()}function Xs(t,e,n,i,r,a){Bi.call(this),this.type="TorusKnotBufferGeometry",this.parameters={radius:t,tube:e,tubularSegments:n,radialSegments:i,p:r,q:a},t=t||1,e=e||.4,n=Math.floor(n)||64,i=Math.floor(i)||8,r=r||2,a=a||3;var o,s,l=[],c=[],u=[],h=[],d=new We,p=new We,f=new We,m=new We,g=new We,v=new We,y=new We;for(o=0;o<=n;++o){var x=o/n*r*Math.PI*2;for(E(x,r,a,t,f),E(.01+x,r,a,t,m),v.subVectors(m,f),y.addVectors(m,f),g.crossVectors(v,y),y.crossVectors(g,v),g.normalize(),y.normalize(),s=0;s<=i;++s){var _=s/i*Math.PI*2,w=-e*Math.cos(_),b=e*Math.sin(_);d.x=f.x+(w*y.x+b*g.x),d.y=f.y+(w*y.y+b*g.y),d.z=f.z+(w*y.z+b*g.z),c.push(d.x,d.y,d.z),p.subVectors(d,f).normalize(),u.push(p.x,p.y,p.z),h.push(o/n),h.push(s/i)}}for(s=1;s<=n;s++)for(o=1;o<=i;o++){var M=(i+1)*(s-1)+(o-1),S=(i+1)*s+(o-1),C=(i+1)*s+o,T=(i+1)*(s-1)+o;l.push(M,S,T),l.push(S,C,T)}function E(t,e,n,i,r){var a=Math.cos(t),o=Math.sin(t),s=n/e*t,l=Math.cos(s);r.x=i*(2+l)*.5*a,r.y=i*(2+l)*o*.5,r.z=i*Math.sin(s)*.5}this.setIndex(l),this.setAttribute("position",new Ti(c,3)),this.setAttribute("normal",new Ti(u,3)),this.setAttribute("uv",new Ti(h,2))}function Ys(t,e,n,i,r){lr.call(this),this.type="TorusGeometry",this.parameters={radius:t,tube:e,radialSegments:n,tubularSegments:i,arc:r},this.fromBufferGeometry(new Zs(t,e,n,i,r)),this.mergeVertices()}function Zs(t,e,n,i,r){Bi.call(this),this.type="TorusBufferGeometry",this.parameters={radius:t,tube:e,radialSegments:n,tubularSegments:i,arc:r},t=t||1,e=e||.4,n=Math.floor(n)||8,i=Math.floor(i)||6,r=r||2*Math.PI;var a,o,s=[],l=[],c=[],u=[],h=new We,d=new We,p=new We;for(a=0;a<=n;a++)for(o=0;o<=i;o++){var f=o/i*r,m=a/n*Math.PI*2;d.x=(t+e*Math.cos(m))*Math.cos(f),d.y=(t+e*Math.cos(m))*Math.sin(f),d.z=e*Math.sin(m),l.push(d.x,d.y,d.z),h.x=t*Math.cos(f),h.y=t*Math.sin(f),p.subVectors(d,h).normalize(),c.push(p.x,p.y,p.z),u.push(o/i),u.push(a/n)}for(a=1;a<=n;a++)for(o=1;o<=i;o++){var g=(i+1)*a+o-1,v=(i+1)*(a-1)+o-1,y=(i+1)*(a-1)+o,x=(i+1)*a+o;s.push(g,v,x),s.push(v,y,x)}this.setIndex(s),this.setAttribute("position",new Ti(l,3)),this.setAttribute("normal",new Ti(c,3)),this.setAttribute("uv",new Ti(u,2))}Ts.prototype=Object.assign(Object.create(yn.prototype),{constructor:Ts,isPoints:!0,raycast:function(t,e){var n=this.geometry,i=this.matrixWorld,r=t.params.Points.threshold;if(null===n.boundingSphere&&n.computeBoundingSphere(),Ss.copy(n.boundingSphere),Ss.applyMatrix4(i),Ss.radius+=r,!1!==t.ray.intersectsSphere(Ss)){bs.getInverse(i),Ms.copy(t.ray).applyMatrix4(bs);var a=r/((this.scale.x+this.scale.y+this.scale.z)/3),o=a*a;if(n.isBufferGeometry){var s=n.index,l=n.attributes.position.array;if(null!==s)for(var c=s.array,u=0,h=c.length;u<h;u++){var d=c[u];Cs.fromArray(l,3*d),Es(Cs,d,o,i,t,e,this)}else{u=0;for(var p=l.length/3;u<p;u++)Cs.fromArray(l,3*u),Es(Cs,u,o,i,t,e,this)}}else{var f=n.vertices;for(u=0,p=f.length;u<p;u++)Es(f[u],u,o,i,t,e,this)}}},updateMorphTargets:function(){var t,e,n,i=this.geometry;if(i.isBufferGeometry){var r=i.morphAttributes,a=Object.keys(r);if(0<a.length){var o=r[a[0]];if(void 0!==o)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},t=0,e=o.length;t<e;t++)n=o[t].name||String(t),this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=t}}else{var s=i.morphTargets;void 0!==s&&0<s.length&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),As.prototype=Object.assign(Object.create(Fe.prototype),{constructor:As,isVideoTexture:!0,update:function(){var t=this.image;t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}),((Ds.prototype=Object.create(Fe.prototype)).constructor=Ds).prototype.isCompressedTexture=!0,((Ls.prototype=Object.create(Fe.prototype)).constructor=Ls).prototype.isCanvasTexture=!0,((Os.prototype=Object.create(Fe.prototype)).constructor=Os).prototype.isDepthTexture=!0,(Is.prototype=Object.create(Bi.prototype)).constructor=Is,(Ps.prototype=Object.create(lr.prototype)).constructor=Ps,(Rs.prototype=Object.create(Bi.prototype)).constructor=Rs,(ks.prototype=Object.create(lr.prototype)).constructor=ks,(Ns.prototype=Object.create(Bi.prototype)).constructor=Ns,(Bs.prototype=Object.create(lr.prototype)).constructor=Bs,(Fs.prototype=Object.create(Ns.prototype)).constructor=Fs,(zs.prototype=Object.create(lr.prototype)).constructor=zs,(Vs.prototype=Object.create(Ns.prototype)).constructor=Vs,(Us.prototype=Object.create(lr.prototype)).constructor=Us,(js.prototype=Object.create(Ns.prototype)).constructor=js,(Gs.prototype=Object.create(lr.prototype)).constructor=Gs,(Hs.prototype=Object.create(Ns.prototype)).constructor=Hs,(Ws.prototype=Object.create(lr.prototype)).constructor=Ws,((Js.prototype=Object.create(Bi.prototype)).constructor=Js).prototype.toJSON=function(){var t=Bi.prototype.toJSON.call(this);return t.path=this.parameters.path.toJSON(),t},(qs.prototype=Object.create(lr.prototype)).constructor=qs,(Xs.prototype=Object.create(Bi.prototype)).constructor=Xs,(Ys.prototype=Object.create(lr.prototype)).constructor=Ys,(Zs.prototype=Object.create(Bi.prototype)).constructor=Zs;var $s=function(t,e,n){n=n||2;var i,r,a,o,s,l,c,u=e&&e.length,h=u?e[0]*n:t.length,d=Ks(t,0,h,n,!0),p=[];if(!d||d.next===d.prev)return p;if(u&&(d=function(t,e,n,i){var r,a,o,s,l,c=[];for(r=0,a=e.length;r<a;r++)o=e[r]*i,s=r<a-1?e[r+1]*i:t.length,(l=Ks(t,o,s,i,!1))===l.next&&(l.steiner=!0),c.push(ll(l));for(c.sort(al),r=0;r<c.length;r++)ol(c[r],n),n=Qs(n,n.next);return n}(t,e,d,n)),t.length>80*n){i=a=t[0],r=o=t[1];for(var f=n;f<h;f+=n)(s=t[f])<i&&(i=s),(l=t[f+1])<r&&(r=l),a<s&&(a=s),o<l&&(o=l);c=0!==(c=Math.max(a-i,o-r))?1/c:0}return tl(d,p,n,i,r,c),p};function Ks(t,e,n,i,r){var a,o;if(r===0<function(t,e,n,i){for(var r=0,a=e,o=n-i;a<n;a+=i)r+=(t[o]-t[a])*(t[a+1]+t[o+1]),o=a;return r}(t,e,n,i))for(a=e;a<n;a+=i)o=ml(a,t[a],t[a+1],o);else for(a=n-i;e<=a;a-=i)o=ml(a,t[a],t[a+1],o);return o&&hl(o,o.next)&&(gl(o),o=o.next),o}function Qs(t,e){if(!t)return t;e=e||t;var n,i=t;do{if(n=!1,i.steiner||!hl(i,i.next)&&0!==ul(i.prev,i,i.next))i=i.next;else{if(gl(i),(i=e=i.prev)===i.next)break;n=!0}}while(n||i!==e);return e}function tl(t,e,n,i,r,a,o){if(t){!o&&a&&function(t,e,n,i){var r=t;for(;null===r.z&&(r.z=sl(r.x,r.y,e,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next,r!==t;);r.prevZ.nextZ=null,r.prevZ=null,function(t){var e,n,i,r,a,o,s,l,c=1;do{for(n=t,a=t=null,o=0;n;){for(o++,i=n,e=s=0;e<c&&(s++,i=i.nextZ);e++);for(l=c;0<s||0<l&&i;)0!==s&&(0===l||!i||n.z<=i.z)?(n=(r=n).nextZ,s--):(i=(r=i).nextZ,l--),a?a.nextZ=r:t=r,r.prevZ=a,a=r;n=i}a.nextZ=null,c*=2}while(1<o)}(r)}(t,i,r,a);for(var s,l,c=t;t.prev!==t.next;)if(s=t.prev,l=t.next,a?nl(t,i,r,a):el(t))e.push(s.i/n),e.push(t.i/n),e.push(l.i/n),gl(t),t=l.next,c=l.next;else if((t=l)===c){o?1===o?tl(t=il(t,e,n),e,n,i,r,a,2):2===o&&rl(t,e,n,i,r,a):tl(Qs(t),e,n,i,r,a,1);break}}}function el(t){var e=t.prev,n=t,i=t.next;if(!(0<=ul(e,n,i))){for(var r=t.next.next;r!==t.prev;){if(cl(e.x,e.y,n.x,n.y,i.x,i.y,r.x,r.y)&&0<=ul(r.prev,r,r.next))return;r=r.next}return 1}}function nl(t,e,n,i){var r=t.prev,a=t,o=t.next;if(!(0<=ul(r,a,o))){for(var s=r.x<a.x?r.x<o.x?r.x:o.x:a.x<o.x?a.x:o.x,l=r.y<a.y?r.y<o.y?r.y:o.y:a.y<o.y?a.y:o.y,c=r.x>a.x?r.x>o.x?r.x:o.x:a.x>o.x?a.x:o.x,u=r.y>a.y?r.y>o.y?r.y:o.y:a.y>o.y?a.y:o.y,h=sl(s,l,e,n,i),d=sl(c,u,e,n,i),p=t.prevZ,f=t.nextZ;p&&p.z>=h&&f&&f.z<=d;){if(p!==t.prev&&p!==t.next&&cl(r.x,r.y,a.x,a.y,o.x,o.y,p.x,p.y)&&0<=ul(p.prev,p,p.next))return;if(p=p.prevZ,f!==t.prev&&f!==t.next&&cl(r.x,r.y,a.x,a.y,o.x,o.y,f.x,f.y)&&0<=ul(f.prev,f,f.next))return;f=f.nextZ}for(;p&&p.z>=h;){if(p!==t.prev&&p!==t.next&&cl(r.x,r.y,a.x,a.y,o.x,o.y,p.x,p.y)&&0<=ul(p.prev,p,p.next))return;p=p.prevZ}for(;f&&f.z<=d;){if(f!==t.prev&&f!==t.next&&cl(r.x,r.y,a.x,a.y,o.x,o.y,f.x,f.y)&&0<=ul(f.prev,f,f.next))return;f=f.nextZ}return 1}}function il(t,e,n){var i=t;do{var r=i.prev,a=i.next.next;!hl(r,a)&&dl(r,i,i.next,a)&&pl(r,a)&&pl(a,r)&&(e.push(r.i/n),e.push(i.i/n),e.push(a.i/n),gl(i),gl(i.next),i=t=a),i=i.next}while(i!==t);return i}function rl(t,e,n,i,r,a){var o,s,l=t;do{for(var c=l.next.next;c!==l.prev;){if(l.i!==c.i&&(s=c,(o=l).next.i!==s.i&&o.prev.i!==s.i&&!function(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&dl(n,n.next,t,e))return 1;n=n.next}while(n!==t);return}(o,s)&&pl(o,s)&&pl(s,o)&&function(t,e){var n=t,i=!1,r=(t.x+e.x)/2,a=(t.y+e.y)/2;for(;n.y>a!=n.next.y>a&&n.next.y!==n.y&&r<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next,n!==t;);return i}(o,s))){var u=fl(l,c);return l=Qs(l,l.next),u=Qs(u,u.next),tl(l,e,n,i,r,a),void tl(u,e,n,i,r,a)}c=c.next}l=l.next}while(l!==t)}function al(t,e){return t.x-e.x}function ol(t,e){if(e=function(t,e){var n,i=e,r=t.x,a=t.y,o=-1/0;do{if(a<=i.y&&a>=i.next.y&&i.next.y!==i.y){var s=i.x+(a-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(s<=r&&o<s){if((o=s)===r){if(a===i.y)return i;if(a===i.next.y)return i.next}n=i.x<i.next.x?i:i.next}}i=i.next}while(i!==e);if(!n)return null;if(r===o)return n.prev;var l,c=n,u=n.x,h=n.y,d=1/0;i=n.next;for(;i!==c;)r>=i.x&&i.x>=u&&r!==i.x&&cl(a<h?r:o,a,u,h,a<h?o:r,a,i.x,i.y)&&((l=Math.abs(a-i.y)/(r-i.x))<d||l===d&&i.x>n.x)&&pl(i,t)&&(n=i,d=l),i=i.next;return n}(t,e)){var n=fl(e,t);Qs(n,n.next)}}function sl(t,e,n,i,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*r)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*r)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function ll(t){for(var e=t,n=t;(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),(e=e.next)!==t;);return n}function cl(t,e,n,i,r,a,o,s){return 0<=(r-o)*(e-s)-(t-o)*(a-s)&&0<=(t-o)*(i-s)-(n-o)*(e-s)&&0<=(n-o)*(a-s)-(r-o)*(i-s)}function ul(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function hl(t,e){return t.x===e.x&&t.y===e.y}function dl(t,e,n,i){return hl(t,n)&&hl(e,i)||hl(t,i)&&hl(n,e)||0<ul(t,e,n)!=0<ul(t,e,i)&&0<ul(n,i,t)!=0<ul(n,i,e)}function pl(t,e){return ul(t.prev,t,t.next)<0?0<=ul(t,e,t.next)&&0<=ul(t,t.prev,e):ul(t,e,t.prev)<0||ul(t,t.next,e)<0}function fl(t,e){var n=new vl(t.i,t.x,t.y),i=new vl(e.i,e.x,e.y),r=t.next,a=e.prev;return(t.next=e).prev=t,(n.next=r).prev=n,(i.next=n).prev=i,(a.next=i).prev=a,i}function ml(t,e,n,i){var r=new vl(t,e,n);return i?(r.next=i.next,(r.prev=i).next.prev=r,i.next=r):(r.prev=r).next=r,r}function gl(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 vl(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}var yl={area:function(t){for(var e=t.length,n=0,i=e-1,r=0;r<e;i=r++)n+=t[i].x*t[r].y-t[r].x*t[i].y;return.5*n},isClockWise:function(t){return yl.area(t)<0},triangulateShape:function(t,e){var n=[],i=[],r=[];xl(t),_l(n,t);var a=t.length;e.forEach(xl);for(var o=0;o<e.length;o++)i.push(a),a+=e[o].length,_l(n,e[o]);var s=$s(n,i);for(o=0;o<s.length;o+=3)r.push(s.slice(o,o+3));return r}};function xl(t){var e=t.length;2<e&&t[e-1].equals(t[0])&&t.pop()}function _l(t,e){for(var n=0;n<e.length;n++)t.push(e[n].x),t.push(e[n].y)}function wl(t,e){lr.call(this),this.type="ExtrudeGeometry",this.parameters={shapes:t,options:e},this.fromBufferGeometry(new bl(t,e)),this.mergeVertices()}function bl(t,$){Bi.call(this),this.type="ExtrudeBufferGeometry",this.parameters={shapes:t,options:$},t=Array.isArray(t)?t:[t];for(var K=this,Q=[],tt=[],e=0,n=t.length;e<n;e++){i(t[e])}function i(t){var i=[],e=void 0!==$.curveSegments?$.curveSegments:12,l=void 0!==$.steps?$.steps:1,n=void 0!==$.depth?$.depth:100,r=void 0===$.bevelEnabled||$.bevelEnabled,a=void 0!==$.bevelThickness?$.bevelThickness:6,o=void 0!==$.bevelSize?$.bevelSize:a-2,s=void 0!==$.bevelOffset?$.bevelOffset:0,c=void 0!==$.bevelSegments?$.bevelSegments:3,u=$.extrudePath,h=void 0!==$.UVGenerator?$.UVGenerator:Ml;void 0!==$.amount&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),n=$.amount);var d,p,f,m,g,v,y,x,_=!1;u&&(d=u.getSpacedPoints(l),r=!(_=!0),p=u.computeFrenetFrames(l,!1),f=new We,m=new We,g=new We),r||(s=o=a=c=0);var w=t.extractPoints(e),b=w.shape,M=w.holes;if(!yl.isClockWise(b))for(b=b.reverse(),y=0,x=M.length;y<x;y++)v=M[y],yl.isClockWise(v)&&(M[y]=v.reverse());var S=yl.triangulateShape(b,M),C=b;for(y=0,x=M.length;y<x;y++)v=M[y],b=b.concat(v);function T(t,e,n){return e||console.error("THREE.ExtrudeGeometry: vec does not exist"),e.clone().multiplyScalar(n).add(t)}var E,A,D,L,O,I,P=b.length,R=S.length;function k(t,e,n){var i,r,a,o=t.x-e.x,s=t.y-e.y,l=n.x-t.x,c=n.y-t.y,u=o*o+s*s,h=o*c-s*l;if(Math.abs(h)>Number.EPSILON){var d=Math.sqrt(u),p=Math.sqrt(l*l+c*c),f=e.x-s/d,m=e.y+o/d,g=((n.x-c/p-f)*c-(n.y+l/p-m)*l)/(o*c-s*l),v=(i=f+o*g-t.x)*i+(r=m+s*g-t.y)*r;if(v<=2)return new Re(i,r);a=Math.sqrt(v/2)}else{var y=!1;o>Number.EPSILON?l>Number.EPSILON&&(y=!0):o<-Number.EPSILON?l<-Number.EPSILON&&(y=!0):Math.sign(s)===Math.sign(c)&&(y=!0),a=y?(i=-s,r=o,Math.sqrt(u)):(i=o,r=s,Math.sqrt(u/2))}return new Re(i/a,r/a)}for(var N=[],B=0,F=C.length,z=F-1,V=B+1;B<F;B++,z++,V++)z===F&&(z=0),V===F&&(V=0),N[B]=k(C[B],C[z],C[V]);var U,j,G=[],H=N.concat();for(y=0,x=M.length;y<x;y++){for(v=M[y],U=[],B=0,z=(F=v.length)-1,V=B+1;B<F;B++,z++,V++)z===F&&(z=0),V===F&&(V=0),U[B]=k(v[B],v[z],v[V]);G.push(U),H=H.concat(U)}for(E=0;E<c;E++){for(D=E/c,L=a*Math.cos(D*Math.PI/2),A=o*Math.sin(D*Math.PI/2)+s,B=0,F=C.length;B<F;B++)J((O=T(C[B],N[B],A)).x,O.y,-L);for(y=0,x=M.length;y<x;y++)for(v=M[y],U=G[y],B=0,F=v.length;B<F;B++)J((O=T(v[B],U[B],A)).x,O.y,-L)}for(A=o+s,B=0;B<P;B++)O=r?T(b[B],H[B],A):b[B],_?(m.copy(p.normals[0]).multiplyScalar(O.x),f.copy(p.binormals[0]).multiplyScalar(O.y),g.copy(d[0]).add(m).add(f),J(g.x,g.y,g.z)):J(O.x,O.y,0);for(j=1;j<=l;j++)for(B=0;B<P;B++)O=r?T(b[B],H[B],A):b[B],_?(m.copy(p.normals[j]).multiplyScalar(O.x),f.copy(p.binormals[j]).multiplyScalar(O.y),g.copy(d[j]).add(m).add(f),J(g.x,g.y,g.z)):J(O.x,O.y,n/l*j);for(E=c-1;0<=E;E--){for(D=E/c,L=a*Math.cos(D*Math.PI/2),A=o*Math.sin(D*Math.PI/2)+s,B=0,F=C.length;B<F;B++)J((O=T(C[B],N[B],A)).x,O.y,n+L);for(y=0,x=M.length;y<x;y++)for(v=M[y],U=G[y],B=0,F=v.length;B<F;B++)O=T(v[B],U[B],A),_?J(O.x,O.y+d[l-1].y,d[l-1].x+L):J(O.x,O.y,n+L)}function W(t,e){var n,i;for(B=t.length;0<=--B;){(i=(n=B)-1)<0&&(i=t.length-1);var r=0,a=l+2*c;for(r=0;r<a;r++){var o=P*r,s=P*(r+1);X(e+n+o,e+i+o,e+i+s,e+n+s)}}}function J(t,e,n){i.push(t),i.push(e),i.push(n)}function q(t,e,n){Y(t),Y(e),Y(n);var i=Q.length/3,r=h.generateTopUV(K,Q,i-3,i-2,i-1);Z(r[0]),Z(r[1]),Z(r[2])}function X(t,e,n,i){Y(t),Y(e),Y(i),Y(e),Y(n),Y(i);var r=Q.length/3,a=h.generateSideWallUV(K,Q,r-6,r-3,r-2,r-1);Z(a[0]),Z(a[1]),Z(a[3]),Z(a[1]),Z(a[2]),Z(a[3])}function Y(t){Q.push(i[3*t+0]),Q.push(i[3*t+1]),Q.push(i[3*t+2])}function Z(t){tt.push(t.x),tt.push(t.y)}!function(){var t=Q.length/3;if(r){var e=0,n=P*e;for(B=0;B<R;B++)q((I=S[B])[2]+n,I[1]+n,I[0]+n);for(n=P*(e=l+2*c),B=0;B<R;B++)q((I=S[B])[0]+n,I[1]+n,I[2]+n)}else{for(B=0;B<R;B++)q((I=S[B])[2],I[1],I[0]);for(B=0;B<R;B++)q((I=S[B])[0]+P*l,I[1]+P*l,I[2]+P*l)}K.addGroup(t,Q.length/3-t,0)}(),function(){var t=Q.length/3,e=0;for(W(C,e),e+=C.length,y=0,x=M.length;y<x;y++)W(v=M[y],e),e+=v.length;K.addGroup(t,Q.length/3-t,1)}()}this.setAttribute("position",new Ti(Q,3)),this.setAttribute("uv",new Ti(tt,2)),this.computeVertexNormals()}((wl.prototype=Object.create(lr.prototype)).constructor=wl).prototype.toJSON=function(){var t=lr.prototype.toJSON.call(this);return Sl(this.parameters.shapes,this.parameters.options,t)},((bl.prototype=Object.create(Bi.prototype)).constructor=bl).prototype.toJSON=function(){var t=Bi.prototype.toJSON.call(this);return Sl(this.parameters.shapes,this.parameters.options,t)};var Ml={generateTopUV:function(t,e,n,i,r){var a=e[3*n],o=e[3*n+1],s=e[3*i],l=e[3*i+1],c=e[3*r],u=e[3*r+1];return[new Re(a,o),new Re(s,l),new Re(c,u)]},generateSideWallUV:function(t,e,n,i,r,a){var o=e[3*n],s=e[3*n+1],l=e[3*n+2],c=e[3*i],u=e[3*i+1],h=e[3*i+2],d=e[3*r],p=e[3*r+1],f=e[3*r+2],m=e[3*a],g=e[3*a+1],v=e[3*a+2];return Math.abs(s-u)<.01?[new Re(o,1-l),new Re(c,1-h),new Re(d,1-f),new Re(m,1-v)]:[new Re(s,1-l),new Re(u,1-h),new Re(p,1-f),new Re(g,1-v)]}};function Sl(t,e,n){if(n.shapes=[],Array.isArray(t))for(var i=0,r=t.length;i<r;i++){var a=t[i];n.shapes.push(a.uuid)}else n.shapes.push(t.uuid);return void 0!==e.extrudePath&&(n.options.extrudePath=e.extrudePath.toJSON()),n}function Cl(t,e){lr.call(this),this.type="TextGeometry",this.parameters={text:t,parameters:e},this.fromBufferGeometry(new Tl(t,e)),this.mergeVertices()}function Tl(t,e){var n=(e=e||{}).font;if(!n||!n.isFont)return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new lr;var i=n.generateShapes(t,e.size);e.depth=void 0!==e.height?e.height:50,void 0===e.bevelThickness&&(e.bevelThickness=10),void 0===e.bevelSize&&(e.bevelSize=8),void 0===e.bevelEnabled&&(e.bevelEnabled=!1),bl.call(this,i,e),this.type="TextBufferGeometry"}function El(t,e,n,i,r,a,o){lr.call(this),this.type="SphereGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:n,phiStart:i,phiLength:r,thetaStart:a,thetaLength:o},this.fromBufferGeometry(new Al(t,e,n,i,r,a,o)),this.mergeVertices()}function Al(t,e,n,i,r,a,o){Bi.call(this),this.type="SphereBufferGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:n,phiStart:i,phiLength:r,thetaStart:a,thetaLength:o},t=t||1,e=Math.max(3,Math.floor(e)||8),n=Math.max(2,Math.floor(n)||6),i=void 0!==i?i:0,r=void 0!==r?r:2*Math.PI,a=void 0!==a?a:0,o=void 0!==o?o:Math.PI;var s,l,c=Math.min(a+o,Math.PI),u=0,h=[],d=new We,p=new We,f=[],m=[],g=[],v=[];for(l=0;l<=n;l++){var y=[],x=l/n,_=0;for(0==l&&0==a?_=.5/e:l==n&&c==Math.PI&&(_=-.5/e),s=0;s<=e;s++){var w=s/e;d.x=-t*Math.cos(i+w*r)*Math.sin(a+x*o),d.y=t*Math.cos(a+x*o),d.z=t*Math.sin(i+w*r)*Math.sin(a+x*o),m.push(d.x,d.y,d.z),p.copy(d).normalize(),g.push(p.x,p.y,p.z),v.push(w+_,1-x),y.push(u++)}h.push(y)}for(l=0;l<n;l++)for(s=0;s<e;s++){var b=h[l][s+1],M=h[l][s],S=h[l+1][s],C=h[l+1][s+1];(0!==l||0<a)&&f.push(b,M,C),(l!==n-1||c<Math.PI)&&f.push(M,S,C)}this.setIndex(f),this.setAttribute("position",new Ti(m,3)),this.setAttribute("normal",new Ti(g,3)),this.setAttribute("uv",new Ti(v,2))}function Dl(t,e,n,i,r,a){lr.call(this),this.type="RingGeometry",this.parameters={innerRadius:t,outerRadius:e,thetaSegments:n,phiSegments:i,thetaStart:r,thetaLength:a},this.fromBufferGeometry(new Ll(t,e,n,i,r,a)),this.mergeVertices()}function Ll(t,e,n,i,r,a){Bi.call(this),this.type="RingBufferGeometry",this.parameters={innerRadius:t,outerRadius:e,thetaSegments:n,phiSegments:i,thetaStart:r,thetaLength:a},t=t||.5,e=e||1,r=void 0!==r?r:0,a=void 0!==a?a:2*Math.PI,n=void 0!==n?Math.max(3,n):8;var o,s,l,c=[],u=[],h=[],d=[],p=t,f=(e-t)/(i=void 0!==i?Math.max(1,i):1),m=new We,g=new Re;for(s=0;s<=i;s++){for(l=0;l<=n;l++)o=r+l/n*a,m.x=p*Math.cos(o),m.y=p*Math.sin(o),u.push(m.x,m.y,m.z),h.push(0,0,1),g.x=(m.x/e+1)/2,g.y=(m.y/e+1)/2,d.push(g.x,g.y);p+=f}for(s=0;s<i;s++){var v=s*(n+1);for(l=0;l<n;l++){var y=o=l+v,x=o+n+1,_=o+n+2,w=o+1;c.push(y,x,w),c.push(x,_,w)}}this.setIndex(c),this.setAttribute("position",new Ti(u,3)),this.setAttribute("normal",new Ti(h,3)),this.setAttribute("uv",new Ti(d,2))}function Ol(t,e,n,i){lr.call(this),this.type="LatheGeometry",this.parameters={points:t,segments:e,phiStart:n,phiLength:i},this.fromBufferGeometry(new Il(t,e,n,i)),this.mergeVertices()}function Il(t,e,n,i){Bi.call(this),this.type="LatheBufferGeometry",this.parameters={points:t,segments:e,phiStart:n,phiLength:i},e=Math.floor(e)||12,n=n||0,i=i||2*Math.PI,i=Pe.clamp(i,0,2*Math.PI);var r,a,o,s=[],l=[],c=[],u=1/e,h=new We,d=new Re;for(a=0;a<=e;a++){var p=n+a*u*i,f=Math.sin(p),m=Math.cos(p);for(o=0;o<=t.length-1;o++)h.x=t[o].x*f,h.y=t[o].y,h.z=t[o].x*m,l.push(h.x,h.y,h.z),d.x=a/e,d.y=o/(t.length-1),c.push(d.x,d.y)}for(a=0;a<e;a++)for(o=0;o<t.length-1;o++){var g=r=o+a*t.length,v=r+t.length,y=r+t.length+1,x=r+1;s.push(g,v,x),s.push(v,y,x)}if(this.setIndex(s),this.setAttribute("position",new Ti(l,3)),this.setAttribute("uv",new Ti(c,2)),this.computeVertexNormals(),i===2*Math.PI){var _=this.attributes.normal.array,w=new We,b=new We,M=new We;for(r=e*t.length*3,o=a=0;a<t.length;a++,o+=3)w.x=_[o+0],w.y=_[o+1],w.z=_[o+2],b.x=_[r+o+0],b.y=_[r+o+1],b.z=_[r+o+2],M.addVectors(w,b).normalize(),_[o+0]=_[r+o+0]=M.x,_[o+1]=_[r+o+1]=M.y,_[o+2]=_[r+o+2]=M.z}}function Pl(t,e){lr.call(this),this.type="ShapeGeometry","object"==typeof e&&(console.warn("THREE.ShapeGeometry: Options parameter has been removed."),e=e.curveSegments),this.parameters={shapes:t,curveSegments:e},this.fromBufferGeometry(new Rl(t,e)),this.mergeVertices()}function Rl(t,f){Bi.call(this),this.type="ShapeBufferGeometry",this.parameters={shapes:t,curveSegments:f},f=f||12;var m=[],g=[],v=[],y=[],e=0,x=0;if(!1===Array.isArray(t))i(t);else for(var n=0;n<t.length;n++)i(t[n]),this.addGroup(e,x,n),e+=x,x=0;function i(t){var e,n,i,r=g.length/3,a=t.extractPoints(f),o=a.shape,s=a.holes;for(!1===yl.isClockWise(o)&&(o=o.reverse()),e=0,n=s.length;e<n;e++)i=s[e],!0===yl.isClockWise(i)&&(s[e]=i.reverse());var l=yl.triangulateShape(o,s);for(e=0,n=s.length;e<n;e++)i=s[e],o=o.concat(i);for(e=0,n=o.length;e<n;e++){var c=o[e];g.push(c.x,c.y,0),v.push(0,0,1),y.push(c.x,c.y)}for(e=0,n=l.length;e<n;e++){var u=l[e],h=u[0]+r,d=u[1]+r,p=u[2]+r;m.push(h,d,p),x+=3}}this.setIndex(m),this.setAttribute("position",new Ti(g,3)),this.setAttribute("normal",new Ti(v,3)),this.setAttribute("uv",new Ti(y,2))}function kl(t,e){if(e.shapes=[],Array.isArray(t))for(var n=0,i=t.length;n<i;n++){var r=t[n];e.shapes.push(r.uuid)}else e.shapes.push(t.uuid);return e}function Nl(t,e){Bi.call(this),this.type="EdgesGeometry",this.parameters={thresholdAngle:e},e=void 0!==e?e:1;var n,i,r,a,o=[],s=Math.cos(Pe.DEG2RAD*e),l=[0,0],c={},u=["a","b","c"];t.isBufferGeometry?(a=new lr).fromBufferGeometry(t):a=t.clone(),a.mergeVertices(),a.computeFaceNormals();for(var h=a.vertices,d=a.faces,p=0,f=d.length;p<f;p++)for(var m=d[p],g=0;g<3;g++)n=m[u[g]],i=m[u[(g+1)%3]],l[0]=Math.min(n,i),l[1]=Math.max(n,i),void 0===c[r=l[0]+","+l[1]]?c[r]={index1:l[0],index2:l[1],face1:p,face2:void 0}:c[r].face2=p;for(r in c){var v=c[r];if(void 0===v.face2||d[v.face1].normal.dot(d[v.face2].normal)<=s){var y=h[v.index1];o.push(y.x,y.y,y.z),y=h[v.index2],o.push(y.x,y.y,y.z)}}this.setAttribute("position",new Ti(o,3))}function Bl(t,e,n,i,r,a,o,s){lr.call(this),this.type="CylinderGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:n,radialSegments:i,heightSegments:r,openEnded:a,thetaStart:o,thetaLength:s},this.fromBufferGeometry(new Fl(t,e,n,i,r,a,o,s)),this.mergeVertices()}function Fl(v,y,x,_,w,t,b,M){Bi.call(this),this.type="CylinderBufferGeometry",this.parameters={radiusTop:v,radiusBottom:y,height:x,radialSegments:_,heightSegments:w,openEnded:t,thetaStart:b,thetaLength:M};var S=this;v=void 0!==v?v:1,y=void 0!==y?y:1,x=x||1,_=Math.floor(_)||8,w=Math.floor(w)||1,t=void 0!==t&&t,b=void 0!==b?b:0,M=void 0!==M?M:2*Math.PI;var C=[],T=[],E=[],A=[],D=0,L=[],O=x/2,I=0;function e(t){var e,n,i,r=new Re,a=new We,o=0,s=!0===t?v:y,l=!0===t?1:-1;for(n=D,e=1;e<=_;e++)T.push(0,O*l,0),E.push(0,l,0),A.push(.5,.5),D++;for(i=D,e=0;e<=_;e++){var c=e/_*M+b,u=Math.cos(c),h=Math.sin(c);a.x=s*h,a.y=O*l,a.z=s*u,T.push(a.x,a.y,a.z),E.push(0,l,0),r.x=.5*u+.5,r.y=.5*h*l+.5,A.push(r.x,r.y),D++}for(e=0;e<_;e++){var d=n+e,p=i+e;!0===t?C.push(p,p+1,d):C.push(p+1,p,d),o+=3}S.addGroup(I,o,!0===t?1:2),I+=o}!function(){var t,e,n=new We,i=new We,r=0,a=(y-v)/x;for(e=0;e<=w;e++){var o=[],s=e/w,l=s*(y-v)+v;for(t=0;t<=_;t++){var c=t/_,u=c*M+b,h=Math.sin(u),d=Math.cos(u);i.x=l*h,i.y=-s*x+O,i.z=l*d,T.push(i.x,i.y,i.z),n.set(h,a,d).normalize(),E.push(n.x,n.y,n.z),A.push(c,1-s),o.push(D++)}L.push(o)}for(t=0;t<_;t++)for(e=0;e<w;e++){var p=L[e][t],f=L[e+1][t],m=L[e+1][t+1],g=L[e][t+1];C.push(p,f,g),C.push(f,m,g),r+=6}S.addGroup(I,r,0),I+=r}(),!1===t&&(0<v&&e(!0),0<y&&e(!1)),this.setIndex(C),this.setAttribute("position",new Ti(T,3)),this.setAttribute("normal",new Ti(E,3)),this.setAttribute("uv",new Ti(A,2))}function zl(t,e,n,i,r,a,o){Bl.call(this,0,t,e,n,i,r,a,o),this.type="ConeGeometry",this.parameters={radius:t,height:e,radialSegments:n,heightSegments:i,openEnded:r,thetaStart:a,thetaLength:o}}function Vl(t,e,n,i,r,a,o){Fl.call(this,0,t,e,n,i,r,a,o),this.type="ConeBufferGeometry",this.parameters={radius:t,height:e,radialSegments:n,heightSegments:i,openEnded:r,thetaStart:a,thetaLength:o}}function Ul(t,e,n,i){lr.call(this),this.type="CircleGeometry",this.parameters={radius:t,segments:e,thetaStart:n,thetaLength:i},this.fromBufferGeometry(new jl(t,e,n,i)),this.mergeVertices()}function jl(t,e,n,i){Bi.call(this),this.type="CircleBufferGeometry",this.parameters={radius:t,segments:e,thetaStart:n,thetaLength:i},t=t||1,e=void 0!==e?Math.max(3,e):8,n=void 0!==n?n:0,i=void 0!==i?i:2*Math.PI;var r,a,o=[],s=[],l=[],c=[],u=new We,h=new Re;for(s.push(0,0,0),l.push(0,0,1),c.push(.5,.5),a=0,r=3;a<=e;a++,r+=3){var d=n+a/e*i;u.x=t*Math.cos(d),u.y=t*Math.sin(d),s.push(u.x,u.y,u.z),l.push(0,0,1),h.x=(s[r]/t+1)/2,h.y=(s[r+1]/t+1)/2,c.push(h.x,h.y)}for(r=1;r<=e;r++)o.push(r,r+1,0);this.setIndex(o),this.setAttribute("position",new Ti(s,3)),this.setAttribute("normal",new Ti(l,3)),this.setAttribute("uv",new Ti(c,2))}(Cl.prototype=Object.create(lr.prototype)).constructor=Cl,(Tl.prototype=Object.create(bl.prototype)).constructor=Tl,(El.prototype=Object.create(lr.prototype)).constructor=El,(Al.prototype=Object.create(Bi.prototype)).constructor=Al,(Dl.prototype=Object.create(lr.prototype)).constructor=Dl,(Ll.prototype=Object.create(Bi.prototype)).constructor=Ll,(Ol.prototype=Object.create(lr.prototype)).constructor=Ol,(Il.prototype=Object.create(Bi.prototype)).constructor=Il,((Pl.prototype=Object.create(lr.prototype)).constructor=Pl).prototype.toJSON=function(){var t=lr.prototype.toJSON.call(this);return kl(this.parameters.shapes,t)},((Rl.prototype=Object.create(Bi.prototype)).constructor=Rl).prototype.toJSON=function(){var t=Bi.prototype.toJSON.call(this);return kl(this.parameters.shapes,t)},(Nl.prototype=Object.create(Bi.prototype)).constructor=Nl,(Bl.prototype=Object.create(lr.prototype)).constructor=Bl,(Fl.prototype=Object.create(Bi.prototype)).constructor=Fl,(zl.prototype=Object.create(Bl.prototype)).constructor=zl,(Vl.prototype=Object.create(Fl.prototype)).constructor=Vl,(Ul.prototype=Object.create(lr.prototype)).constructor=Ul,(jl.prototype=Object.create(Bi.prototype)).constructor=jl;var Gl=Object.freeze({__proto__:null,WireframeGeometry:Is,ParametricGeometry:Ps,ParametricBufferGeometry:Rs,TetrahedronGeometry:Bs,TetrahedronBufferGeometry:Fs,OctahedronGeometry:zs,OctahedronBufferGeometry:Vs,IcosahedronGeometry:Us,IcosahedronBufferGeometry:js,DodecahedronGeometry:Gs,DodecahedronBufferGeometry:Hs,PolyhedronGeometry:ks,PolyhedronBufferGeometry:Ns,TubeGeometry:Ws,TubeBufferGeometry:Js,TorusKnotGeometry:qs,TorusKnotBufferGeometry:Xs,TorusGeometry:Ys,TorusBufferGeometry:Zs,TextGeometry:Cl,TextBufferGeometry:Tl,SphereGeometry:El,SphereBufferGeometry:Al,RingGeometry:Dl,RingBufferGeometry:Ll,PlaneGeometry:Ar,PlaneBufferGeometry:Dr,LatheGeometry:Ol,LatheBufferGeometry:Il,ShapeGeometry:Pl,ShapeBufferGeometry:Rl,ExtrudeGeometry:wl,ExtrudeBufferGeometry:bl,EdgesGeometry:Nl,ConeGeometry:zl,ConeBufferGeometry:Vl,CylinderGeometry:Bl,CylinderBufferGeometry:Fl,CircleGeometry:Ul,CircleBufferGeometry:jl,BoxGeometry:cr,BoxBufferGeometry:ur});function Hl(t){mi.call(this),this.type="ShadowMaterial",this.color=new ci(0),this.transparent=!0,this.setValues(t)}function Wl(t){gr.call(this,t),this.type="RawShaderMaterial"}function Jl(t){mi.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new ci(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 ci(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Me,this.normalScale=new Re(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function ql(t){Jl.call(this),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.reflectivity=.5,this.clearcoat=0,this.clearcoatRoughness=0,this.sheen=null,this.clearcoatNormalScale=new Re(1,1),this.clearcoatNormalMap=null,this.transparency=0,this.setValues(t)}function Xl(t){mi.call(this),this.type="MeshPhongMaterial",this.color=new ci(16777215),this.specular=new ci(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ci(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Me,this.normalScale=new Re(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=U,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 Yl(t){mi.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new ci(16777215),this.specular=new ci(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 ci(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Me,this.normalScale=new Re(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 Zl(t){mi.call(this),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Me,this.normalScale=new Re(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 $l(t){mi.call(this),this.type="MeshLambertMaterial",this.color=new ci(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ci(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=U,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 Kl(t){mi.call(this),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new ci(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Me,this.normalScale=new Re(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 Ql(t){us.call(this),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}((Hl.prototype=Object.create(mi.prototype)).constructor=Hl).prototype.isShadowMaterial=!0,Hl.prototype.copy=function(t){return mi.prototype.copy.call(this,t),this.color.copy(t.color),this},((Wl.prototype=Object.create(gr.prototype)).constructor=Wl).prototype.isRawShaderMaterial=!0,((Jl.prototype=Object.create(mi.prototype)).constructor=Jl).prototype.isMeshStandardMaterial=!0,Jl.prototype.copy=function(t){return mi.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},((ql.prototype=Object.create(Jl.prototype)).constructor=ql).prototype.isMeshPhysicalMaterial=!0,ql.prototype.copy=function(t){return Jl.prototype.copy.call(this,t),this.defines={STANDARD:"",PHYSICAL:""},this.reflectivity=t.reflectivity,this.clearcoat=t.clearcoat,this.clearcoatRoughness=t.clearcoatRoughness,t.sheen?this.sheen=(this.sheen||new ci).copy(t.sheen):this.sheen=null,this.clearcoatNormalMap=t.clearcoatNormalMap,this.clearcoatNormalScale.copy(t.clearcoatNormalScale),this.transparency=t.transparency,this},((Xl.prototype=Object.create(mi.prototype)).constructor=Xl).prototype.isMeshPhongMaterial=!0,Xl.prototype.copy=function(t){return mi.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},((Yl.prototype=Object.create(mi.prototype)).constructor=Yl).prototype.isMeshToonMaterial=!0,Yl.prototype.copy=function(t){return mi.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},((Zl.prototype=Object.create(mi.prototype)).constructor=Zl).prototype.isMeshNormalMaterial=!0,Zl.prototype.copy=function(t){return mi.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},(($l.prototype=Object.create(mi.prototype)).constructor=$l).prototype.isMeshLambertMaterial=!0,$l.prototype.copy=function(t){return mi.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},((Kl.prototype=Object.create(mi.prototype)).constructor=Kl).prototype.isMeshMatcapMaterial=!0,Kl.prototype.copy=function(t){return mi.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},((Ql.prototype=Object.create(us.prototype)).constructor=Ql).prototype.isLineDashedMaterial=!0,Ql.prototype.copy=function(t){return us.prototype.copy.call(this,t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this};var tc=Object.freeze({__proto__:null,ShadowMaterial:Hl,SpriteMaterial:No,RawShaderMaterial:Wl,ShaderMaterial:gr,PointsMaterial:ws,MeshPhysicalMaterial:ql,MeshStandardMaterial:Jl,MeshPhongMaterial:Xl,MeshToonMaterial:Yl,MeshNormalMaterial:Zl,MeshLambertMaterial:$l,MeshDepthMaterial:go,MeshDistanceMaterial:vo,MeshBasicMaterial:gi,MeshMatcapMaterial:Kl,LineDashedMaterial:Ql,LineBasicMaterial:us,Material:mi}),ec={arraySlice:function(t,e,n){return ec.isTypedArray(t)?new t.constructor(t.subarray(e,void 0!==n?n:t.length)):t.slice(e,n)},convertArray:function(t,e,n){return!t||!n&&t.constructor===e?t:"number"==typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t)},isTypedArray:function(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)},getKeyframeOrder:function(n){for(var t=n.length,e=new Array(t),i=0;i!==t;++i)e[i]=i;return e.sort(function(t,e){return n[t]-n[e]}),e},sortedArray:function(t,e,n){for(var i=t.length,r=new t.constructor(i),a=0,o=0;o!==i;++a)for(var s=n[a]*e,l=0;l!==e;++l)r[o++]=t[s+l];return r},flattenJSON:function(t,e,n,i){for(var r=1,a=t[0];void 0!==a&&void 0===a[i];)a=t[r++];if(void 0!==a){var o=a[i];if(void 0!==o)if(Array.isArray(o))for(;void 0!==(o=a[i])&&(e.push(a.time),n.push.apply(n,o)),void 0!==(a=t[r++]););else if(void 0!==o.toArray)for(;void 0!==(o=a[i])&&(e.push(a.time),o.toArray(n,n.length)),void 0!==(a=t[r++]););else for(;void 0!==(o=a[i])&&(e.push(a.time),n.push(o)),void 0!==(a=t[r++]););}},subclip:function(t,e,n,i,r){r=r||30;var a=t.clone();a.name=e;for(var o=[],s=0;s<a.tracks.length;++s){for(var l=a.tracks[s],c=l.getValueSize(),u=[],h=[],d=0;d<l.times.length;++d){var p=l.times[d]*r;if(!(p<n||i<=p)){u.push(l.times[d]);for(var f=0;f<c;++f)h.push(l.values[d*c+f])}}0!==u.length&&(l.times=ec.convertArray(u,l.times.constructor),l.values=ec.convertArray(h,l.values.constructor),o.push(l))}a.tracks=o;var m=1/0;for(s=0;s<a.tracks.length;++s)m>a.tracks[s].times[0]&&(m=a.tracks[s].times[0]);for(s=0;s<a.tracks.length;++s)a.tracks[s].shift(-1*m);return a.resetDuration(),a}};function nc(t,e,n,i){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=void 0!==i?i:new e.constructor(n),this.sampleValues=e,this.valueSize=n}function ic(t,e,n,i){nc.call(this,t,e,n,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0}function rc(t,e,n,i){nc.call(this,t,e,n,i)}function ac(t,e,n,i){nc.call(this,t,e,n,i)}function oc(t,e,n,i){if(void 0===t)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===e||0===e.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=ec.convertArray(e,this.TimeBufferType),this.values=ec.convertArray(n,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}function sc(t,e,n){oc.call(this,t,e,n)}function lc(t,e,n,i){oc.call(this,t,e,n,i)}function cc(t,e,n,i){oc.call(this,t,e,n,i)}function uc(t,e,n,i){nc.call(this,t,e,n,i)}function hc(t,e,n,i){oc.call(this,t,e,n,i)}function dc(t,e,n,i){oc.call(this,t,e,n,i)}function pc(t,e,n,i){oc.call(this,t,e,n,i)}function fc(t,e,n){this.name=t,this.tracks=n,this.duration=void 0!==e?e:-1,this.uuid=Pe.generateUUID(),this.duration<0&&this.resetDuration()}function mc(t){if(void 0===t.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");var e=function(t){switch(t.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return cc;case"vector":case"vector2":case"vector3":case"vector4":return pc;case"color":return lc;case"quaternion":return hc;case"bool":case"boolean":return sc;case"string":return dc}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+t)}(t.type);if(void 0===t.times){var n=[],i=[];ec.flattenJSON(t.keys,n,i,"value"),t.times=n,t.values=i}return void 0!==e.parse?e.parse(t):new e(t.name,t.times,t.values,t.interpolation)}Object.assign(nc.prototype,{evaluate:function(t){var e=this.parameterPositions,n=this._cachedIndex,i=e[n],r=e[n-1];t:{e:{var a;n:{i:if(!(t<i)){for(var o=n+2;;){if(void 0===i){if(t<r)break i;return n=e.length,this._cachedIndex=n,this.afterEnd_(n-1,t,r)}if(n===o)break;if(r=i,t<(i=e[++n]))break e}a=e.length;break n}if(r<=t)break t;var s=e[1];t<s&&(n=2,r=s);for(o=n-2;;){if(void 0===r)return this._cachedIndex=0,this.beforeStart_(0,t,i);if(n===o)break;if(i=r,(r=e[--n-1])<=t)break e}a=n,n=0}for(;n<a;){var l=n+a>>>1;t<e[l]?a=l:n=1+l}if(i=e[n],void 0===(r=e[n-1]))return this._cachedIndex=0,this.beforeStart_(0,t,i);if(void 0===i)return n=e.length,this._cachedIndex=n,this.afterEnd_(n-1,r,t)}this._cachedIndex=n,this.intervalChanged_(n,r,i)}return this.interpolate_(n,r,t,i)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings||this.DefaultSettings_},copySampleValue_:function(t){for(var e=this.resultBuffer,n=this.sampleValues,i=this.valueSize,r=t*i,a=0;a!==i;++a)e[a]=n[r+a];return e},interpolate_:function(){throw new Error("call to abstract method")},intervalChanged_:function(){}}),Object.assign(nc.prototype,{beforeStart_:nc.prototype.copySampleValue_,afterEnd_:nc.prototype.copySampleValue_}),ic.prototype=Object.assign(Object.create(nc.prototype),{constructor:ic,DefaultSettings_:{endingStart:de,endingEnd:de},intervalChanged_:function(t,e,n){var i=this.parameterPositions,r=t-2,a=t+1,o=i[r],s=i[a];if(void 0===o)switch(this.getSettings_().endingStart){case pe:r=t,o=2*e-n;break;case fe:o=e+i[r=i.length-2]-i[r+1];break;default:r=t,o=n}if(void 0===s)switch(this.getSettings_().endingEnd){case pe:a=t,s=2*n-e;break;case fe:s=n+i[a=1]-i[0];break;default:a=t-1,s=e}var l=.5*(n-e),c=this.valueSize;this._weightPrev=l/(e-o),this._weightNext=l/(s-n),this._offsetPrev=r*c,this._offsetNext=a*c},interpolate_:function(t,e,n,i){for(var r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=t*o,l=s-o,c=this._offsetPrev,u=this._offsetNext,h=this._weightPrev,d=this._weightNext,p=(n-e)/(i-e),f=p*p,m=f*p,g=-h*m+2*h*f-h*p,v=(1+h)*m+(-1.5-2*h)*f+(-.5+h)*p+1,y=(-1-d)*m+(1.5+d)*f+.5*p,x=d*m-d*f,_=0;_!==o;++_)r[_]=g*a[c+_]+v*a[l+_]+y*a[s+_]+x*a[u+_];return r}}),rc.prototype=Object.assign(Object.create(nc.prototype),{constructor:rc,interpolate_:function(t,e,n,i){for(var r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=t*o,l=s-o,c=(n-e)/(i-e),u=1-c,h=0;h!==o;++h)r[h]=a[l+h]*u+a[s+h]*c;return r}}),ac.prototype=Object.assign(Object.create(nc.prototype),{constructor:ac,interpolate_:function(t){return this.copySampleValue_(t-1)}}),Object.assign(oc,{toJSON:function(t){var e,n=t.constructor;if(void 0!==n.toJSON)e=n.toJSON(t);else{e={name:t.name,times:ec.convertArray(t.times,Array),values:ec.convertArray(t.values,Array)};var i=t.getInterpolation();i!==t.DefaultInterpolation&&(e.interpolation=i)}return e.type=t.ValueTypeName,e}}),Object.assign(oc.prototype,{constructor:oc,TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:he,InterpolantFactoryMethodDiscrete:function(t){return new ac(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodLinear:function(t){return new rc(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:function(t){return new ic(this.times,this.values,this.getValueSize(),t)},setInterpolation:function(t){var e;switch(t){case ue:e=this.InterpolantFactoryMethodDiscrete;break;case he:e=this.InterpolantFactoryMethodLinear;break;case 2302:e=this.InterpolantFactoryMethodSmooth}if(void 0!==e)return this.createInterpolant=e,this;var n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(t===this.DefaultInterpolation)throw new Error(n);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",n),this},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return ue;case this.InterpolantFactoryMethodLinear:return he;case this.InterpolantFactoryMethodSmooth:return 2302}},getValueSize:function(){return this.values.length/this.times.length},shift:function(t){if(0!==t)for(var e=this.times,n=0,i=e.length;n!==i;++n)e[n]+=t;return this},scale:function(t){if(1!==t)for(var e=this.times,n=0,i=e.length;n!==i;++n)e[n]*=t;return this},trim:function(t,e){for(var n=this.times,i=n.length,r=0,a=i-1;r!==i&&n[r]<t;)++r;for(;-1!==a&&n[a]>e;)--a;if(++a,0!==r||a!==i){a<=r&&(r=(a=Math.max(a,1))-1);var o=this.getValueSize();this.times=ec.arraySlice(n,r,a),this.values=ec.arraySlice(this.values,r*o,a*o)}return this},validate:function(){var t=!0,e=this.getValueSize();e-Math.floor(e)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);var n=this.times,i=this.values,r=n.length;0===r&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);for(var a=null,o=0;o!==r;o++){var s=n[o];if("number"==typeof s&&isNaN(s)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,o,s),t=!1;break}if(null!==a&&s<a){console.error("THREE.KeyframeTrack: Out of order keys.",this,o,s,a),t=!1;break}a=s}if(void 0!==i&&ec.isTypedArray(i)){o=0;for(var l=i.length;o!==l;++o){var c=i[o];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,o,c),t=!1;break}}}return t},optimize:function(){for(var t=ec.arraySlice(this.times),e=ec.arraySlice(this.values),n=this.getValueSize(),i=2302===this.getInterpolation(),r=1,a=t.length-1,o=1;o<a;++o){var s=!1,l=t[o];if(l!==t[o+1]&&(1!==o||l!==l[0]))if(i)s=!0;else for(var c=o*n,u=c-n,h=c+n,d=0;d!==n;++d){var p=e[c+d];if(p!==e[u+d]||p!==e[h+d]){s=!0;break}}if(s){if(o!==r){t[r]=t[o];var f=o*n,m=r*n;for(d=0;d!==n;++d)e[m+d]=e[f+d]}++r}}if(0<a){t[r]=t[a];for(f=a*n,m=r*n,d=0;d!==n;++d)e[m+d]=e[f+d];++r}return r!==t.length?(this.times=ec.arraySlice(t,0,r),this.values=ec.arraySlice(e,0,r*n)):(this.times=t,this.values=e),this},clone:function(){var t=ec.arraySlice(this.times,0),e=ec.arraySlice(this.values,0),n=new this.constructor(this.name,t,e);return n.createInterpolant=this.createInterpolant,n}}),sc.prototype=Object.assign(Object.create(oc.prototype),{constructor:sc,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:ue,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),lc.prototype=Object.assign(Object.create(oc.prototype),{constructor:lc,ValueTypeName:"color"}),cc.prototype=Object.assign(Object.create(oc.prototype),{constructor:cc,ValueTypeName:"number"}),uc.prototype=Object.assign(Object.create(nc.prototype),{constructor:uc,interpolate_:function(t,e,n,i){for(var r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=t*o,l=(n-e)/(i-e),c=s+o;s!==c;s+=4)je.slerpFlat(r,0,a,s-o,a,s,l);return r}}),hc.prototype=Object.assign(Object.create(oc.prototype),{constructor:hc,ValueTypeName:"quaternion",DefaultInterpolation:he,InterpolantFactoryMethodLinear:function(t){return new uc(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:void 0}),dc.prototype=Object.assign(Object.create(oc.prototype),{constructor:dc,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:ue,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),pc.prototype=Object.assign(Object.create(oc.prototype),{constructor:pc,ValueTypeName:"vector"}),Object.assign(fc,{parse:function(t){for(var e=[],n=t.tracks,i=1/(t.fps||1),r=0,a=n.length;r!==a;++r)e.push(mc(n[r]).scale(i));return new fc(t.name,t.duration,e)},toJSON:function(t){for(var e=[],n=t.tracks,i={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid},r=0,a=n.length;r!==a;++r)e.push(oc.toJSON(n[r]));return i},CreateFromMorphTargetSequence:function(t,e,n,i){for(var r=e.length,a=[],o=0;o<r;o++){var s=[],l=[];s.push((o+r-1)%r,o,(o+1)%r),l.push(0,1,0);var c=ec.getKeyframeOrder(s);s=ec.sortedArray(s,1,c),l=ec.sortedArray(l,1,c),i||0!==s[0]||(s.push(r),l.push(l[0])),a.push(new cc(".morphTargetInfluences["+e[o].name+"]",s,l).scale(1/n))}return new fc(t,-1,a)},findByName:function(t,e){var n=t;if(!Array.isArray(t)){n=t.geometry&&t.geometry.animations||t.animations}for(var i=0;i<n.length;i++)if(n[i].name===e)return n[i];return null},CreateClipsFromMorphTargetSequences:function(t,e,n){for(var i={},r=/^([\w-]*?)([\d]+)$/,a=0,o=t.length;a<o;a++){var s=t[a],l=s.name.match(r);if(l&&1<l.length){var c=i[h=l[1]];c||(i[h]=c=[]),c.push(s)}}var u=[];for(var h in i)u.push(fc.CreateFromMorphTargetSequence(h,i[h],e,n));return u},parseAnimation:function(t,e){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;for(var n=function(t,e,n,i,r){if(0!==n.length){var a=[],o=[];ec.flattenJSON(n,a,o,i),0!==a.length&&r.push(new t(e,a,o))}},i=[],r=t.name||"default",a=t.length||-1,o=t.fps||30,s=t.hierarchy||[],l=0;l<s.length;l++){var c=s[l].keys;if(c&&0!==c.length)if(c[0].morphTargets){for(var u={},h=0;h<c.length;h++)if(c[h].morphTargets)for(var d=0;d<c[h].morphTargets.length;d++)u[c[h].morphTargets[d]]=-1;for(var p in u){var f=[],m=[];for(d=0;d!==c[h].morphTargets.length;++d){var g=c[h];f.push(g.time),m.push(g.morphTarget===p?1:0)}i.push(new cc(".morphTargetInfluence["+p+"]",f,m))}a=u.length*(o||1)}else{var v=".bones["+e[l].name+"]";n(pc,v+".position",c,"pos",i),n(hc,v+".quaternion",c,"rot",i),n(pc,v+".scale",c,"scl",i)}}return 0===i.length?null:new fc(r,a,i)}}),Object.assign(fc.prototype,{resetDuration:function(){for(var t=0,e=0,n=this.tracks.length;e!==n;++e){var i=this.tracks[e];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,e=0;e<this.tracks.length;e++)t=t&&this.tracks[e].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=[],e=0;e<this.tracks.length;e++)t.push(this.tracks[e].clone());return new fc(this.name,this.duration,t)}});var gc={enabled:!1,files:{},add:function(t,e){!1!==this.enabled&&(this.files[t]=e)},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,e,n){var i=this,r=!1,a=0,o=0,s=void 0,l=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=n,this.itemStart=function(t){o++,!1===r&&void 0!==i.onStart&&i.onStart(t,a,o),r=!0},this.itemEnd=function(t){a++,void 0!==i.onProgress&&i.onProgress(t,a,o),a===o&&(r=!1,void 0!==i.onLoad&&i.onLoad())},this.itemError=function(t){void 0!==i.onError&&i.onError(t)},this.resolveURL=function(t){return s?s(t):t},this.setURLModifier=function(t){return s=t,this},this.addHandler=function(t,e){return l.push(t,e),this},this.removeHandler=function(t){var e=l.indexOf(t);return-1!==e&&l.splice(e,2),this},this.getHandler=function(t){for(var e=0,n=l.length;e<n;e+=2){var i=l[e],r=l[e+1];if(i.global&&(i.lastIndex=0),i.test(t))return r}return null}}var yc=new vc;function xc(t){this.manager=void 0!==t?t:yc,this.crossOrigin="anonymous",this.path="",this.resourcePath=""}Object.assign(xc.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}});var _c={};function wc(t){xc.call(this,t)}function bc(t){xc.call(this,t)}function Mc(t){xc.call(this,t)}function Sc(t){xc.call(this,t)}function Cc(t){xc.call(this,t)}function Tc(t){xc.call(this,t)}function Ec(t){xc.call(this,t)}function Ac(){this.type="Curve",this.arcLengthDivisions=200}function Dc(t,e,n,i,r,a,o,s){Ac.call(this),this.type="EllipseCurve",this.aX=t||0,this.aY=e||0,this.xRadius=n||1,this.yRadius=i||1,this.aStartAngle=r||0,this.aEndAngle=a||2*Math.PI,this.aClockwise=o||!1,this.aRotation=s||0}function Lc(t,e,n,i,r,a){Dc.call(this,t,e,n,n,i,r,a),this.type="ArcCurve"}function Oc(){var r=0,a=0,o=0,s=0;function c(t,e,n,i){o=-3*(r=t)+3*e-2*(a=n)-i,s=2*t-2*e+n+i}return{initCatmullRom:function(t,e,n,i,r){c(e,n,r*(n-t),r*(i-e))},initNonuniformCatmullRom:function(t,e,n,i,r,a,o){var s=(e-t)/r-(n-t)/(r+a)+(n-e)/a,l=(n-e)/a-(i-e)/(a+o)+(i-n)/o;c(e,n,s*=a,l*=a)},calc:function(t){var e=t*t;return r+a*t+o*e+s*(e*t)}}}wc.prototype=Object.assign(Object.create(xc.prototype),{constructor:wc,load:function(o,t,e,n){void 0===o&&(o=""),void 0!==this.path&&(o=this.path+o),o=this.manager.resolveURL(o);var s=this,i=gc.get(o);if(void 0!==i)return s.manager.itemStart(o),setTimeout(function(){t&&t(i),s.manager.itemEnd(o)},0),i;if(void 0===_c[o]){var r=o.match(/^data:(.*?)(;base64)?,(.*)$/);if(r){var a=r[1],l=!!r[2],c=r[3];c=decodeURIComponent(c),l&&(c=atob(c));try{var u,h=(this.responseType||"").toLowerCase();switch(h){case"arraybuffer":case"blob":for(var d=new Uint8Array(c.length),p=0;p<c.length;p++)d[p]=c.charCodeAt(p);u="blob"===h?new Blob([d.buffer],{type:a}):d.buffer;break;case"document":var f=new DOMParser;u=f.parseFromString(c,a);break;case"json":u=JSON.parse(c);break;default:u=c}setTimeout(function(){t&&t(u),s.manager.itemEnd(o)},0)}catch(t){setTimeout(function(){n&&n(t),s.manager.itemError(o),s.manager.itemEnd(o)},0)}}else{_c[o]=[],_c[o].push({onLoad:t,onProgress:e,onError:n});var m=new XMLHttpRequest;for(var g in m.open("GET",o,!0),m.addEventListener("load",function(t){var e=this.response,n=_c[o];if(delete _c[o],200===this.status||0===this.status){0===this.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),gc.add(o,e);for(var i=0,r=n.length;i<r;i++){(a=n[i]).onLoad&&a.onLoad(e)}s.manager.itemEnd(o)}else{for(i=0,r=n.length;i<r;i++){var a;(a=n[i]).onError&&a.onError(t)}s.manager.itemError(o),s.manager.itemEnd(o)}},!1),m.addEventListener("progress",function(t){for(var e=_c[o],n=0,i=e.length;n<i;n++){var r=e[n];r.onProgress&&r.onProgress(t)}},!1),m.addEventListener("error",function(t){var e=_c[o];delete _c[o];for(var n=0,i=e.length;n<i;n++){var r=e[n];r.onError&&r.onError(t)}s.manager.itemError(o),s.manager.itemEnd(o)},!1),m.addEventListener("abort",function(t){var e=_c[o];delete _c[o];for(var n=0,i=e.length;n<i;n++){var r=e[n];r.onError&&r.onError(t)}s.manager.itemError(o),s.manager.itemEnd(o)},!1),void 0!==this.responseType&&(m.responseType=this.responseType),void 0!==this.withCredentials&&(m.withCredentials=this.withCredentials),m.overrideMimeType&&m.overrideMimeType(void 0!==this.mimeType?this.mimeType:"text/plain"),this.requestHeader)m.setRequestHeader(g,this.requestHeader[g]);m.send(null)}return s.manager.itemStart(o),m}_c[o].push({onLoad:t,onProgress:e,onError:n})},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}}),bc.prototype=Object.assign(Object.create(xc.prototype),{constructor:bc,load:function(t,e,n,i){var r=this,a=new wc(r.manager);a.setPath(r.path),a.load(t,function(t){e(r.parse(JSON.parse(t)))},n,i)},parse:function(t){for(var e=[],n=0;n<t.length;n++){var i=fc.parse(t[n]);e.push(i)}return e}}),Mc.prototype=Object.assign(Object.create(xc.prototype),{constructor:Mc,load:function(t,a,e,i){var o=this,s=[],l=new Ds;l.image=s;var r=new wc(this.manager);function n(n){r.load(t[n],function(t){var e=o.parse(t,!0);s[n]={width:e.width,height:e.height,format:e.format,mipmaps:e.mipmaps},6===(c+=1)&&(1===e.mipmapCount&&(l.minFilter=Ht),l.format=e.format,l.needsUpdate=!0,a&&a(l))},e,i)}if(r.setPath(this.path),r.setResponseType("arraybuffer"),Array.isArray(t))for(var c=0,u=0,h=t.length;u<h;++u)n(u);else r.load(t,function(t){var e=o.parse(t,!0);if(e.isCubemap)for(var n=e.mipmaps.length/e.mipmapCount,i=0;i<n;i++){s[i]={mipmaps:[]};for(var r=0;r<e.mipmapCount;r++)s[i].mipmaps.push(e.mipmaps[i*e.mipmapCount+r]),s[i].format=e.format,s[i].width=e.width,s[i].height=e.height}else l.image.width=e.width,l.image.height=e.height,l.mipmaps=e.mipmaps;1===e.mipmapCount&&(l.minFilter=Ht),l.format=e.format,l.needsUpdate=!0,a&&a(l)},e,i);return l}}),Sc.prototype=Object.assign(Object.create(xc.prototype),{constructor:Sc,load:function(t,n,e,i){var r=this,a=new wr,o=new wc(this.manager);return o.setResponseType("arraybuffer"),o.setPath(this.path),o.load(t,function(t){var e=r.parse(t);e&&(void 0!==e.image?a.image=e.image:void 0!==e.data&&(a.image.width=e.width,a.image.height=e.height,a.image.data=e.data),a.wrapS=void 0!==e.wrapS?e.wrapS:zt,a.wrapT=void 0!==e.wrapT?e.wrapT:zt,a.magFilter=void 0!==e.magFilter?e.magFilter:Ht,a.minFilter=void 0!==e.minFilter?e.minFilter:Ht,a.anisotropy=void 0!==e.anisotropy?e.anisotropy:1,void 0!==e.format&&(a.format=e.format),void 0!==e.type&&(a.type=e.type),void 0!==e.mipmaps&&(a.mipmaps=e.mipmaps,a.minFilter=Jt),1===e.mipmapCount&&(a.minFilter=Ht),a.needsUpdate=!0,n&&n(a,e))},e,i),a}}),Cc.prototype=Object.assign(Object.create(xc.prototype),{constructor:Cc,load:function(e,t,n,i){void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);var r=this,a=gc.get(e);if(void 0!==a)return r.manager.itemStart(e),setTimeout(function(){t&&t(a),r.manager.itemEnd(e)},0),a;var o=document.createElementNS("http://www.w3.org/1999/xhtml","img");function s(){o.removeEventListener("load",s,!1),o.removeEventListener("error",l,!1),gc.add(e,this),t&&t(this),r.manager.itemEnd(e)}function l(t){o.removeEventListener("load",s,!1),o.removeEventListener("error",l,!1),i&&i(t),r.manager.itemError(e),r.manager.itemEnd(e)}return o.addEventListener("load",s,!1),o.addEventListener("error",l,!1),"data:"!==e.substr(0,5)&&void 0!==this.crossOrigin&&(o.crossOrigin=this.crossOrigin),r.manager.itemStart(e),o.src=e,o}}),Tc.prototype=Object.assign(Object.create(xc.prototype),{constructor:Tc,load:function(t,n,e,i){var r=new Gr,a=new Cc(this.manager);a.setCrossOrigin(this.crossOrigin),a.setPath(this.path);var o=0;function s(e){a.load(t[e],function(t){r.images[e]=t,6===++o&&(r.needsUpdate=!0,n&&n(r))},void 0,i)}for(var l=0;l<t.length;++l)s(l);return r}}),Ec.prototype=Object.assign(Object.create(xc.prototype),{constructor:Ec,load:function(n,i,t,e){var r=new Fe,a=new Cc(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(n,function(t){r.image=t;var e=0<n.search(/\.jpe?g($|\?)/i)||0===n.search(/^data\:image\/jpeg/);r.format=e?Qt:te,r.needsUpdate=!0,void 0!==i&&i(r)},t,e),r}}),Object.assign(Ac.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(t,e){var n=this.getUtoTmapping(t);return this.getPoint(n,e)},getPoints:function(t){void 0===t&&(t=5);for(var e=[],n=0;n<=t;n++)e.push(this.getPoint(n/t));return e},getSpacedPoints:function(t){void 0===t&&(t=5);for(var e=[],n=0;n<=t;n++)e.push(this.getPointAt(n/t));return e},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 e,n,i=[],r=this.getPoint(0),a=0;for(i.push(0),n=1;n<=t;n++)a+=(e=this.getPoint(n/t)).distanceTo(r),i.push(a),r=e;return this.cacheArcLengths=i},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(t,e){var n,i=this.getLengths(),r=0,a=i.length;n=e||t*i[a-1];for(var o,s=0,l=a-1;s<=l;)if((o=i[r=Math.floor(s+(l-s)/2)]-n)<0)s=r+1;else{if(!(0<o)){l=r;break}l=r-1}if(i[r=l]===n)return r/(a-1);var c=i[r];return(r+(n-c)/(i[r+1]-c))/(a-1)},getTangent:function(t){var e=t-1e-4,n=t+1e-4;e<0&&(e=0),1<n&&(n=1);var i=this.getPoint(e);return this.getPoint(n).clone().sub(i).normalize()},getTangentAt:function(t){var e=this.getUtoTmapping(t);return this.getTangent(e)},computeFrenetFrames:function(t,e){var n,i,r,a=new We,o=[],s=[],l=[],c=new We,u=new Qe;for(n=0;n<=t;n++)i=n/t,o[n]=this.getTangentAt(i),o[n].normalize();s[0]=new We,l[0]=new We;var h=Number.MAX_VALUE,d=Math.abs(o[0].x),p=Math.abs(o[0].y),f=Math.abs(o[0].z);for(d<=h&&(h=d,a.set(1,0,0)),p<=h&&(h=p,a.set(0,1,0)),f<=h&&a.set(0,0,1),c.crossVectors(o[0],a).normalize(),s[0].crossVectors(o[0],c),l[0].crossVectors(o[0],s[0]),n=1;n<=t;n++)s[n]=s[n-1].clone(),l[n]=l[n-1].clone(),c.crossVectors(o[n-1],o[n]),c.length()>Number.EPSILON&&(c.normalize(),r=Math.acos(Pe.clamp(o[n-1].dot(o[n]),-1,1)),s[n].applyMatrix4(u.makeRotationAxis(c,r))),l[n].crossVectors(o[n],s[n]);if(!0===e)for(r=Math.acos(Pe.clamp(s[0].dot(s[t]),-1,1)),r/=t,0<o[0].dot(c.crossVectors(s[0],s[t]))&&(r=-r),n=1;n<=t;n++)s[n].applyMatrix4(u.makeRotationAxis(o[n],r*n)),l[n].crossVectors(o[n],s[n]);return{tangents:o,normals:s,binormals:l}},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this},toJSON:function(){var t={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t},fromJSON:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}),((Dc.prototype=Object.create(Ac.prototype)).constructor=Dc).prototype.isEllipseCurve=!0,Dc.prototype.getPoint=function(t,e){for(var n=e||new Re,i=2*Math.PI,r=this.aEndAngle-this.aStartAngle,a=Math.abs(r)<Number.EPSILON;r<0;)r+=i;for(;i<r;)r-=i;r<Number.EPSILON&&(r=a?0:i),!0!==this.aClockwise||a||(r===i?r=-i:r-=i);var o=this.aStartAngle+t*r,s=this.aX+this.xRadius*Math.cos(o),l=this.aY+this.yRadius*Math.sin(o);if(0!==this.aRotation){var c=Math.cos(this.aRotation),u=Math.sin(this.aRotation),h=s-this.aX,d=l-this.aY;s=h*c-d*u+this.aX,l=h*u+d*c+this.aY}return n.set(s,l)},Dc.prototype.copy=function(t){return Ac.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},Dc.prototype.toJSON=function(){var t=Ac.prototype.toJSON.call(this);return t.aX=this.aX,t.aY=this.aY,t.xRadius=this.xRadius,t.yRadius=this.yRadius,t.aStartAngle=this.aStartAngle,t.aEndAngle=this.aEndAngle,t.aClockwise=this.aClockwise,t.aRotation=this.aRotation,t},Dc.prototype.fromJSON=function(t){return Ac.prototype.fromJSON.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},((Lc.prototype=Object.create(Dc.prototype)).constructor=Lc).prototype.isArcCurve=!0;var Ic=new We,Pc=new Oc,Rc=new Oc,kc=new Oc;function Nc(t,e,n,i){Ac.call(this),this.type="CatmullRomCurve3",this.points=t||[],this.closed=e||!1,this.curveType=n||"centripetal",this.tension=i||.5}function Bc(t,e,n,i,r){var a=.5*(i-e),o=.5*(r-n),s=t*t;return(2*n-2*i+a+o)*(t*s)+(-3*n+3*i-2*a-o)*s+a*t+n}function Fc(t,e,n,i){return(o=1-t)*o*e+2*(1-(a=t))*a*n+(r=t)*r*i;var r,a,o}function zc(t,e,n,i,r){return(c=1-t)*c*c*e+3*(l=1-(s=t))*l*s*n+3*(1-(o=t))*o*o*i+(a=t)*a*a*r;var a,o,s,l,c}function Vc(t,e,n,i){Ac.call(this),this.type="CubicBezierCurve",this.v0=t||new Re,this.v1=e||new Re,this.v2=n||new Re,this.v3=i||new Re}function Uc(t,e,n,i){Ac.call(this),this.type="CubicBezierCurve3",this.v0=t||new We,this.v1=e||new We,this.v2=n||new We,this.v3=i||new We}function jc(t,e){Ac.call(this),this.type="LineCurve",this.v1=t||new Re,this.v2=e||new Re}function Gc(t,e){Ac.call(this),this.type="LineCurve3",this.v1=t||new We,this.v2=e||new We}function Hc(t,e,n){Ac.call(this),this.type="QuadraticBezierCurve",this.v0=t||new Re,this.v1=e||new Re,this.v2=n||new Re}function Wc(t,e,n){Ac.call(this),this.type="QuadraticBezierCurve3",this.v0=t||new We,this.v1=e||new We,this.v2=n||new We}function Jc(t){Ac.call(this),this.type="SplineCurve",this.points=t||[]}((Nc.prototype=Object.create(Ac.prototype)).constructor=Nc).prototype.isCatmullRomCurve3=!0,Nc.prototype.getPoint=function(t,e){var n,i,r,a,o=e||new We,s=this.points,l=s.length,c=(l-(this.closed?0:1))*t,u=Math.floor(c),h=c-u;if(this.closed?u+=0<u?0:(Math.floor(Math.abs(u)/l)+1)*l:0===h&&u===l-1&&(u=l-2,h=1),n=this.closed||0<u?s[(u-1)%l]:(Ic.subVectors(s[0],s[1]).add(s[0]),Ic),i=s[u%l],r=s[(u+1)%l],a=this.closed||u+2<l?s[(u+2)%l]:(Ic.subVectors(s[l-1],s[l-2]).add(s[l-1]),Ic),"centripetal"===this.curveType||"chordal"===this.curveType){var d="chordal"===this.curveType?.5:.25,p=Math.pow(n.distanceToSquared(i),d),f=Math.pow(i.distanceToSquared(r),d),m=Math.pow(r.distanceToSquared(a),d);f<1e-4&&(f=1),p<1e-4&&(p=f),m<1e-4&&(m=f),Pc.initNonuniformCatmullRom(n.x,i.x,r.x,a.x,p,f,m),Rc.initNonuniformCatmullRom(n.y,i.y,r.y,a.y,p,f,m),kc.initNonuniformCatmullRom(n.z,i.z,r.z,a.z,p,f,m)}else"catmullrom"===this.curveType&&(Pc.initCatmullRom(n.x,i.x,r.x,a.x,this.tension),Rc.initCatmullRom(n.y,i.y,r.y,a.y,this.tension),kc.initCatmullRom(n.z,i.z,r.z,a.z,this.tension));return o.set(Pc.calc(h),Rc.calc(h),kc.calc(h)),o},Nc.prototype.copy=function(t){Ac.prototype.copy.call(this,t),this.points=[];for(var e=0,n=t.points.length;e<n;e++){var i=t.points[e];this.points.push(i.clone())}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this},Nc.prototype.toJSON=function(){var t=Ac.prototype.toJSON.call(this);t.points=[];for(var e=0,n=this.points.length;e<n;e++){var i=this.points[e];t.points.push(i.toArray())}return t.closed=this.closed,t.curveType=this.curveType,t.tension=this.tension,t},Nc.prototype.fromJSON=function(t){Ac.prototype.fromJSON.call(this,t),this.points=[];for(var e=0,n=t.points.length;e<n;e++){var i=t.points[e];this.points.push((new We).fromArray(i))}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this},((Vc.prototype=Object.create(Ac.prototype)).constructor=Vc).prototype.isCubicBezierCurve=!0,Vc.prototype.getPoint=function(t,e){var n=e||new Re,i=this.v0,r=this.v1,a=this.v2,o=this.v3;return n.set(zc(t,i.x,r.x,a.x,o.x),zc(t,i.y,r.y,a.y,o.y)),n},Vc.prototype.copy=function(t){return Ac.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},Vc.prototype.toJSON=function(){var t=Ac.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t},Vc.prototype.fromJSON=function(t){return Ac.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this},((Uc.prototype=Object.create(Ac.prototype)).constructor=Uc).prototype.isCubicBezierCurve3=!0,Uc.prototype.getPoint=function(t,e){var n=e||new We,i=this.v0,r=this.v1,a=this.v2,o=this.v3;return n.set(zc(t,i.x,r.x,a.x,o.x),zc(t,i.y,r.y,a.y,o.y),zc(t,i.z,r.z,a.z,o.z)),n},Uc.prototype.copy=function(t){return Ac.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},Uc.prototype.toJSON=function(){var t=Ac.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t},Uc.prototype.fromJSON=function(t){return Ac.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this},((jc.prototype=Object.create(Ac.prototype)).constructor=jc).prototype.isLineCurve=!0,jc.prototype.getPoint=function(t,e){var n=e||new Re;return 1===t?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n},jc.prototype.getPointAt=function(t,e){return this.getPoint(t,e)},jc.prototype.getTangent=function(){return this.v2.clone().sub(this.v1).normalize()},jc.prototype.copy=function(t){return Ac.prototype.copy.call(this,t),this.v1.copy(t.v1),this.v2.copy(t.v2),this},jc.prototype.toJSON=function(){var t=Ac.prototype.toJSON.call(this);return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},jc.prototype.fromJSON=function(t){return Ac.prototype.fromJSON.call(this,t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},((Gc.prototype=Object.create(Ac.prototype)).constructor=Gc).prototype.isLineCurve3=!0,Gc.prototype.getPoint=function(t,e){var n=e||new We;return 1===t?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n},Gc.prototype.getPointAt=function(t,e){return this.getPoint(t,e)},Gc.prototype.copy=function(t){return Ac.prototype.copy.call(this,t),this.v1.copy(t.v1),this.v2.copy(t.v2),this},Gc.prototype.toJSON=function(){var t=Ac.prototype.toJSON.call(this);return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},Gc.prototype.fromJSON=function(t){return Ac.prototype.fromJSON.call(this,t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},((Hc.prototype=Object.create(Ac.prototype)).constructor=Hc).prototype.isQuadraticBezierCurve=!0,Hc.prototype.getPoint=function(t,e){var n=e||new Re,i=this.v0,r=this.v1,a=this.v2;return n.set(Fc(t,i.x,r.x,a.x),Fc(t,i.y,r.y,a.y)),n},Hc.prototype.copy=function(t){return Ac.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this},Hc.prototype.toJSON=function(){var t=Ac.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},Hc.prototype.fromJSON=function(t){return Ac.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},((Wc.prototype=Object.create(Ac.prototype)).constructor=Wc).prototype.isQuadraticBezierCurve3=!0,Wc.prototype.getPoint=function(t,e){var n=e||new We,i=this.v0,r=this.v1,a=this.v2;return n.set(Fc(t,i.x,r.x,a.x),Fc(t,i.y,r.y,a.y),Fc(t,i.z,r.z,a.z)),n},Wc.prototype.copy=function(t){return Ac.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this},Wc.prototype.toJSON=function(){var t=Ac.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},Wc.prototype.fromJSON=function(t){return Ac.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},((Jc.prototype=Object.create(Ac.prototype)).constructor=Jc).prototype.isSplineCurve=!0,Jc.prototype.getPoint=function(t,e){var n=e||new Re,i=this.points,r=(i.length-1)*t,a=Math.floor(r),o=r-a,s=i[0===a?a:a-1],l=i[a],c=i[a>i.length-2?i.length-1:a+1],u=i[a>i.length-3?i.length-1:a+2];return n.set(Bc(o,s.x,l.x,c.x,u.x),Bc(o,s.y,l.y,c.y,u.y)),n},Jc.prototype.copy=function(t){Ac.prototype.copy.call(this,t),this.points=[];for(var e=0,n=t.points.length;e<n;e++){var i=t.points[e];this.points.push(i.clone())}return this},Jc.prototype.toJSON=function(){var t=Ac.prototype.toJSON.call(this);t.points=[];for(var e=0,n=this.points.length;e<n;e++){var i=this.points[e];t.points.push(i.toArray())}return t},Jc.prototype.fromJSON=function(t){Ac.prototype.fromJSON.call(this,t),this.points=[];for(var e=0,n=t.points.length;e<n;e++){var i=t.points[e];this.points.push((new Re).fromArray(i))}return this};var qc=Object.freeze({__proto__:null,ArcCurve:Lc,CatmullRomCurve3:Nc,CubicBezierCurve:Vc,CubicBezierCurve3:Uc,EllipseCurve:Dc,LineCurve:jc,LineCurve3:Gc,QuadraticBezierCurve:Hc,QuadraticBezierCurve3:Wc,SplineCurve:Jc});function Xc(){Ac.call(this),this.type="CurvePath",this.curves=[],this.autoClose=!1}function Yc(t){Xc.call(this),this.type="Path",this.currentPoint=new Re,t&&this.setFromPoints(t)}function Zc(t){Yc.call(this,t),this.uuid=Pe.generateUUID(),this.type="Shape",this.holes=[]}function $c(t,e){yn.call(this),this.type="Light",this.color=new ci(t),this.intensity=void 0!==e?e:1,this.receiveShadow=void 0}function Kc(t,e,n){$c.call(this,t,n),this.type="HemisphereLight",this.castShadow=void 0,this.position.copy(yn.DefaultUp),this.updateMatrix(),this.groundColor=new ci(e)}function Qc(t){this.camera=t,this.bias=0,this.radius=1,this.mapSize=new Re(512,512),this.map=null,this.mapPass=null,this.matrix=new Qe,this._frustum=new Sr,this._frameExtents=new Re(1,1),this._viewportCount=1,this._viewports=[new ze(0,0,1,1)]}function tu(){Qc.call(this,new yr(50,1,.5,500))}function eu(t,e,n,i,r,a){$c.call(this,t,e),this.type="SpotLight",this.position.copy(yn.DefaultUp),this.updateMatrix(),this.target=new yn,Object.defineProperty(this,"power",{get:function(){return this.intensity*Math.PI},set:function(t){this.intensity=t/Math.PI}}),this.distance=void 0!==n?n:0,this.angle=void 0!==i?i:Math.PI/3,this.penumbra=void 0!==r?r:0,this.decay=void 0!==a?a:1,this.shadow=new tu}function nu(){Qc.call(this,new yr(90,1,.5,500)),this._frameExtents=new Re(4,2),this._viewportCount=6,this._viewports=[new ze(2,1,1,1),new ze(0,1,1,1),new ze(3,1,1,1),new ze(1,1,1,1),new ze(3,0,1,1),new ze(1,0,1,1)],this._cubeDirections=[new We(1,0,0),new We(-1,0,0),new We(0,0,1),new We(0,0,-1),new We(0,1,0),new We(0,-1,0)],this._cubeUps=[new We(0,1,0),new We(0,1,0),new We(0,1,0),new We(0,1,0),new We(0,0,1),new We(0,0,-1)]}function iu(t,e,n,i){$c.call(this,t,e),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!==n?n:0,this.decay=void 0!==i?i:1,this.shadow=new nu}function ru(t,e,n,i,r,a){vr.call(this),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=void 0!==t?t:-1,this.right=void 0!==e?e:1,this.top=void 0!==n?n:1,this.bottom=void 0!==i?i:-1,this.near=void 0!==r?r:.1,this.far=void 0!==a?a:2e3,this.updateProjectionMatrix()}function au(){Qc.call(this,new ru(-5,5,5,-5,.5,500))}function ou(t,e){$c.call(this,t,e),this.type="DirectionalLight",this.position.copy(yn.DefaultUp),this.updateMatrix(),this.target=new yn,this.shadow=new au}function su(t,e){$c.call(this,t,e),this.type="AmbientLight",this.castShadow=void 0}function lu(t,e,n,i){$c.call(this,t,e),this.type="RectAreaLight",this.width=void 0!==n?n:10,this.height=void 0!==i?i:10}function cu(t){xc.call(this,t),this.textures={}}Xc.prototype=Object.assign(Object.create(Ac.prototype),{constructor:Xc,add:function(t){this.curves.push(t)},closePath:function(){var t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);t.equals(e)||this.curves.push(new jc(e,t))},getPoint:function(t){for(var e=t*this.getLength(),n=this.getCurveLengths(),i=0;i<n.length;){if(n[i]>=e){var r=n[i]-e,a=this.curves[i],o=a.getLength(),s=0===o?0:1-r/o;return a.getPointAt(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=[],e=0,n=0,i=this.curves.length;n<i;n++)e+=this.curves[n].getLength(),t.push(e);return this.cacheLengths=t},getSpacedPoints:function(t){void 0===t&&(t=40);for(var e=[],n=0;n<=t;n++)e.push(this.getPoint(n/t));return this.autoClose&&e.push(e[0]),e},getPoints:function(t){t=t||12;for(var e,n=[],i=0,r=this.curves;i<r.length;i++)for(var a=r[i],o=a&&a.isEllipseCurve?2*t:a&&(a.isLineCurve||a.isLineCurve3)?1:a&&a.isSplineCurve?t*a.points.length:t,s=a.getPoints(o),l=0;l<s.length;l++){var c=s[l];e&&e.equals(c)||(n.push(c),e=c)}return this.autoClose&&1<n.length&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n},copy:function(t){Ac.prototype.copy.call(this,t),this.curves=[];for(var e=0,n=t.curves.length;e<n;e++){var i=t.curves[e];this.curves.push(i.clone())}return this.autoClose=t.autoClose,this},toJSON:function(){var t=Ac.prototype.toJSON.call(this);t.autoClose=this.autoClose,t.curves=[];for(var e=0,n=this.curves.length;e<n;e++){var i=this.curves[e];t.curves.push(i.toJSON())}return t},fromJSON:function(t){Ac.prototype.fromJSON.call(this,t),this.autoClose=t.autoClose,this.curves=[];for(var e=0,n=t.curves.length;e<n;e++){var i=t.curves[e];this.curves.push((new qc[i.type]).fromJSON(i))}return this}}),Yc.prototype=Object.assign(Object.create(Xc.prototype),{constructor:Yc,setFromPoints:function(t){this.moveTo(t[0].x,t[0].y);for(var e=1,n=t.length;e<n;e++)this.lineTo(t[e].x,t[e].y);return this},moveTo:function(t,e){return this.currentPoint.set(t,e),this},lineTo:function(t,e){var n=new jc(this.currentPoint.clone(),new Re(t,e));return this.curves.push(n),this.currentPoint.set(t,e),this},quadraticCurveTo:function(t,e,n,i){var r=new Hc(this.currentPoint.clone(),new Re(t,e),new Re(n,i));return this.curves.push(r),this.currentPoint.set(n,i),this},bezierCurveTo:function(t,e,n,i,r,a){var o=new Vc(this.currentPoint.clone(),new Re(t,e),new Re(n,i),new Re(r,a));return this.curves.push(o),this.currentPoint.set(r,a),this},splineThru:function(t){var e=new Jc([this.currentPoint.clone()].concat(t));return this.curves.push(e),this.currentPoint.copy(t[t.length-1]),this},arc:function(t,e,n,i,r,a){var o=this.currentPoint.x,s=this.currentPoint.y;return this.absarc(t+o,e+s,n,i,r,a),this},absarc:function(t,e,n,i,r,a){return this.absellipse(t,e,n,n,i,r,a),this},ellipse:function(t,e,n,i,r,a,o,s){var l=this.currentPoint.x,c=this.currentPoint.y;return this.absellipse(t+l,e+c,n,i,r,a,o,s),this},absellipse:function(t,e,n,i,r,a,o,s){var l=new Dc(t,e,n,i,r,a,o,s);if(0<this.curves.length){var c=l.getPoint(0);c.equals(this.currentPoint)||this.lineTo(c.x,c.y)}this.curves.push(l);var u=l.getPoint(1);return this.currentPoint.copy(u),this},copy:function(t){return Xc.prototype.copy.call(this,t),this.currentPoint.copy(t.currentPoint),this},toJSON:function(){var t=Xc.prototype.toJSON.call(this);return t.currentPoint=this.currentPoint.toArray(),t},fromJSON:function(t){return Xc.prototype.fromJSON.call(this,t),this.currentPoint.fromArray(t.currentPoint),this}}),Zc.prototype=Object.assign(Object.create(Yc.prototype),{constructor:Zc,getPointsHoles:function(t){for(var e=[],n=0,i=this.holes.length;n<i;n++)e[n]=this.holes[n].getPoints(t);return e},extractPoints:function(t){return{shape:this.getPoints(t),holes:this.getPointsHoles(t)}},copy:function(t){Yc.prototype.copy.call(this,t),this.holes=[];for(var e=0,n=t.holes.length;e<n;e++){var i=t.holes[e];this.holes.push(i.clone())}return this},toJSON:function(){var t=Yc.prototype.toJSON.call(this);t.uuid=this.uuid,t.holes=[];for(var e=0,n=this.holes.length;e<n;e++){var i=this.holes[e];t.holes.push(i.toJSON())}return t},fromJSON:function(t){Yc.prototype.fromJSON.call(this,t),this.uuid=t.uuid,this.holes=[];for(var e=0,n=t.holes.length;e<n;e++){var i=t.holes[e];this.holes.push((new Yc).fromJSON(i))}return this}}),$c.prototype=Object.assign(Object.create(yn.prototype),{constructor:$c,isLight:!0,copy:function(t){return yn.prototype.copy.call(this,t),this.color.copy(t.color),this.intensity=t.intensity,this},toJSON:function(t){var e=yn.prototype.toJSON.call(this,t);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,void 0!==this.groundColor&&(e.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(e.object.distance=this.distance),void 0!==this.angle&&(e.object.angle=this.angle),void 0!==this.decay&&(e.object.decay=this.decay),void 0!==this.penumbra&&(e.object.penumbra=this.penumbra),void 0!==this.shadow&&(e.object.shadow=this.shadow.toJSON()),e}}),Kc.prototype=Object.assign(Object.create($c.prototype),{constructor:Kc,isHemisphereLight:!0,copy:function(t){return $c.prototype.copy.call(this,t),this.groundColor.copy(t.groundColor),this}}),Object.assign(Qc.prototype,{_projScreenMatrix:new Qe,_lightPositionWorld:new We,_lookTarget:new We,getViewportCount:function(){return this._viewportCount},getFrustum:function(){return this._frustum},updateMatrices:function(t){var e=this.camera,n=this.matrix,i=this._projScreenMatrix,r=this._lookTarget,a=this._lightPositionWorld;a.setFromMatrixPosition(t.matrixWorld),e.position.copy(a),r.setFromMatrixPosition(t.target.matrixWorld),e.lookAt(r),e.updateMatrixWorld(),i.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),this._frustum.setFromProjectionMatrix(i),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(e.projectionMatrix),n.multiply(e.matrixWorldInverse)},getViewport:function(t){return this._viewports[t]},getFrameExtents:function(){return this._frameExtents},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)},toJSON:function(){var t={};return 0!==this.bias&&(t.bias=this.bias),1!==this.radius&&(t.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}}),tu.prototype=Object.assign(Object.create(Qc.prototype),{constructor:tu,isSpotLightShadow:!0,updateMatrices:function(t){var e=this.camera,n=2*Pe.RAD2DEG*t.angle,i=this.mapSize.width/this.mapSize.height,r=t.distance||e.far;n===e.fov&&i===e.aspect&&r===e.far||(e.fov=n,e.aspect=i,e.far=r,e.updateProjectionMatrix()),Qc.prototype.updateMatrices.call(this,t)}}),eu.prototype=Object.assign(Object.create($c.prototype),{constructor:eu,isSpotLight:!0,copy:function(t){return $c.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}}),nu.prototype=Object.assign(Object.create(Qc.prototype),{constructor:nu,isPointLightShadow:!0,updateMatrices:function(t,e){void 0===e&&(e=0);var n=this.camera,i=this.matrix,r=this._lightPositionWorld,a=this._lookTarget,o=this._projScreenMatrix;r.setFromMatrixPosition(t.matrixWorld),n.position.copy(r),a.copy(n.position),a.add(this._cubeDirections[e]),n.up.copy(this._cubeUps[e]),n.lookAt(a),n.updateMatrixWorld(),i.makeTranslation(-r.x,-r.y,-r.z),o.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(o)}}),iu.prototype=Object.assign(Object.create($c.prototype),{constructor:iu,isPointLight:!0,copy:function(t){return $c.prototype.copy.call(this,t),this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this}}),ru.prototype=Object.assign(Object.create(vr.prototype),{constructor:ru,isOrthographicCamera:!0,copy:function(t,e){return vr.prototype.copy.call(this,t,e),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,e,n,i,r,a){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2,r=n-t,a=n+t,o=i+e,s=i-e;if(null!==this.view&&this.view.enabled){var l=(this.right-this.left)/this.view.fullWidth/this.zoom,c=(this.top-this.bottom)/this.view.fullHeight/this.zoom;a=(r+=l*this.view.offsetX)+l*this.view.width,s=(o-=c*this.view.offsetY)-c*this.view.height}this.projectionMatrix.makeOrthographic(r,a,o,s,this.near,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(t){var e=yn.prototype.toJSON.call(this,t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,null!==this.view&&(e.object.view=Object.assign({},this.view)),e}}),au.prototype=Object.assign(Object.create(Qc.prototype),{constructor:au,isDirectionalLightShadow:!0,updateMatrices:function(t){Qc.prototype.updateMatrices.call(this,t)}}),ou.prototype=Object.assign(Object.create($c.prototype),{constructor:ou,isDirectionalLight:!0,copy:function(t){return $c.prototype.copy.call(this,t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}),su.prototype=Object.assign(Object.create($c.prototype),{constructor:su,isAmbientLight:!0}),lu.prototype=Object.assign(Object.create($c.prototype),{constructor:lu,isRectAreaLight:!0,copy:function(t){return $c.prototype.copy.call(this,t),this.width=t.width,this.height=t.height,this},toJSON:function(t){var e=$c.prototype.toJSON.call(this,t);return e.object.width=this.width,e.object.height=this.height,e}}),cu.prototype=Object.assign(Object.create(xc.prototype),{constructor:cu,load:function(t,e,n,i){var r=this,a=new wc(r.manager);a.setPath(r.path),a.load(t,function(t){e(r.parse(JSON.parse(t)))},n,i)},parse:function(t){var e=this.textures;function n(t){return void 0===e[t]&&console.warn("THREE.MaterialLoader: Undefined texture",t),e[t]}var i=new tc[t.type];if(void 0!==t.uuid&&(i.uuid=t.uuid),void 0!==t.name&&(i.name=t.name),void 0!==t.color&&i.color.setHex(t.color),void 0!==t.roughness&&(i.roughness=t.roughness),void 0!==t.metalness&&(i.metalness=t.metalness),void 0!==t.sheen&&(i.sheen=(new ci).setHex(t.sheen)),void 0!==t.emissive&&i.emissive.setHex(t.emissive),void 0!==t.specular&&i.specular.setHex(t.specular),void 0!==t.shininess&&(i.shininess=t.shininess),void 0!==t.clearcoat&&(i.clearcoat=t.clearcoat),void 0!==t.clearcoatRoughness&&(i.clearcoatRoughness=t.clearcoatRoughness),void 0!==t.vertexColors&&(i.vertexColors=t.vertexColors),void 0!==t.fog&&(i.fog=t.fog),void 0!==t.flatShading&&(i.flatShading=t.flatShading),void 0!==t.blending&&(i.blending=t.blending),void 0!==t.combine&&(i.combine=t.combine),void 0!==t.side&&(i.side=t.side),void 0!==t.opacity&&(i.opacity=t.opacity),void 0!==t.transparent&&(i.transparent=t.transparent),void 0!==t.alphaTest&&(i.alphaTest=t.alphaTest),void 0!==t.depthTest&&(i.depthTest=t.depthTest),void 0!==t.depthWrite&&(i.depthWrite=t.depthWrite),void 0!==t.colorWrite&&(i.colorWrite=t.colorWrite),void 0!==t.stencilWrite&&(i.stencilWrite=t.stencilWrite),void 0!==t.stencilWriteMask&&(i.stencilWriteMask=t.stencilWriteMask),void 0!==t.stencilFunc&&(i.stencilFunc=t.stencilFunc),void 0!==t.stencilRef&&(i.stencilRef=t.stencilRef),void 0!==t.stencilFuncMask&&(i.stencilFuncMask=t.stencilFuncMask),void 0!==t.stencilFail&&(i.stencilFail=t.stencilFail),void 0!==t.stencilZFail&&(i.stencilZFail=t.stencilZFail),void 0!==t.stencilZPass&&(i.stencilZPass=t.stencilZPass),void 0!==t.wireframe&&(i.wireframe=t.wireframe),void 0!==t.wireframeLinewidth&&(i.wireframeLinewidth=t.wireframeLinewidth),void 0!==t.wireframeLinecap&&(i.wireframeLinecap=t.wireframeLinecap),void 0!==t.wireframeLinejoin&&(i.wireframeLinejoin=t.wireframeLinejoin),void 0!==t.rotation&&(i.rotation=t.rotation),1!==t.linewidth&&(i.linewidth=t.linewidth),void 0!==t.dashSize&&(i.dashSize=t.dashSize),void 0!==t.gapSize&&(i.gapSize=t.gapSize),void 0!==t.scale&&(i.scale=t.scale),void 0!==t.polygonOffset&&(i.polygonOffset=t.polygonOffset),void 0!==t.polygonOffsetFactor&&(i.polygonOffsetFactor=t.polygonOffsetFactor),void 0!==t.polygonOffsetUnits&&(i.polygonOffsetUnits=t.polygonOffsetUnits),void 0!==t.skinning&&(i.skinning=t.skinning),void 0!==t.morphTargets&&(i.morphTargets=t.morphTargets),void 0!==t.morphNormals&&(i.morphNormals=t.morphNormals),void 0!==t.dithering&&(i.dithering=t.dithering),void 0!==t.visible&&(i.visible=t.visible),void 0!==t.toneMapped&&(i.toneMapped=t.toneMapped),void 0!==t.userData&&(i.userData=t.userData),void 0!==t.uniforms)for(var r in t.uniforms){var a=t.uniforms[r];switch(i.uniforms[r]={},a.type){case"t":i.uniforms[r].value=n(a.value);break;case"c":i.uniforms[r].value=(new ci).setHex(a.value);break;case"v2":i.uniforms[r].value=(new Re).fromArray(a.value);break;case"v3":i.uniforms[r].value=(new We).fromArray(a.value);break;case"v4":i.uniforms[r].value=(new ze).fromArray(a.value);break;case"m3":i.uniforms[r].value=(new ke).fromArray(a.value);case"m4":i.uniforms[r].value=(new Qe).fromArray(a.value);break;default:i.uniforms[r].value=a.value}}if(void 0!==t.defines&&(i.defines=t.defines),void 0!==t.vertexShader&&(i.vertexShader=t.vertexShader),void 0!==t.fragmentShader&&(i.fragmentShader=t.fragmentShader),void 0!==t.extensions)for(var o in t.extensions)i.extensions[o]=t.extensions[o];if(void 0!==t.shading&&(i.flatShading=1===t.shading),void 0!==t.size&&(i.size=t.size),void 0!==t.sizeAttenuation&&(i.sizeAttenuation=t.sizeAttenuation),void 0!==t.map&&(i.map=n(t.map)),void 0!==t.matcap&&(i.matcap=n(t.matcap)),void 0!==t.alphaMap&&(i.alphaMap=n(t.alphaMap),i.transparent=!0),void 0!==t.bumpMap&&(i.bumpMap=n(t.bumpMap)),void 0!==t.bumpScale&&(i.bumpScale=t.bumpScale),void 0!==t.normalMap&&(i.normalMap=n(t.normalMap)),void 0!==t.normalMapType&&(i.normalMapType=t.normalMapType),void 0!==t.normalScale){var s=t.normalScale;!1===Array.isArray(s)&&(s=[s,s]),i.normalScale=(new Re).fromArray(s)}return void 0!==t.displacementMap&&(i.displacementMap=n(t.displacementMap)),void 0!==t.displacementScale&&(i.displacementScale=t.displacementScale),void 0!==t.displacementBias&&(i.displacementBias=t.displacementBias),void 0!==t.roughnessMap&&(i.roughnessMap=n(t.roughnessMap)),void 0!==t.metalnessMap&&(i.metalnessMap=n(t.metalnessMap)),void 0!==t.emissiveMap&&(i.emissiveMap=n(t.emissiveMap)),void 0!==t.emissiveIntensity&&(i.emissiveIntensity=t.emissiveIntensity),void 0!==t.specularMap&&(i.specularMap=n(t.specularMap)),void 0!==t.envMap&&(i.envMap=n(t.envMap)),void 0!==t.envMapIntensity&&(i.envMapIntensity=t.envMapIntensity),void 0!==t.reflectivity&&(i.reflectivity=t.reflectivity),void 0!==t.refractionRatio&&(i.refractionRatio=t.refractionRatio),void 0!==t.lightMap&&(i.lightMap=n(t.lightMap)),void 0!==t.lightMapIntensity&&(i.lightMapIntensity=t.lightMapIntensity),void 0!==t.aoMap&&(i.aoMap=n(t.aoMap)),void 0!==t.aoMapIntensity&&(i.aoMapIntensity=t.aoMapIntensity),void 0!==t.gradientMap&&(i.gradientMap=n(t.gradientMap)),void 0!==t.clearcoatNormalMap&&(i.clearcoatNormalMap=n(t.clearcoatNormalMap)),void 0!==t.clearcoatNormalScale&&(i.clearcoatNormalScale=(new Re).fromArray(t.clearcoatNormalScale)),i},setTextures:function(t){return this.textures=t,this}});var uu={decodeText:function(t){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(t);for(var e="",n=0,i=t.length;n<i;n++)e+=String.fromCharCode(t[n]);try{return decodeURIComponent(escape(e))}catch(t){return e}},extractUrlBase:function(t){var e=t.lastIndexOf("/");return-1===e?"./":t.substr(0,e+1)}};function hu(){Bi.call(this),this.type="InstancedBufferGeometry",this.maxInstancedCount=void 0}function du(t,e,n,i){"number"==typeof n&&(i=n,n=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),yi.call(this,t,e,n),this.meshPerAttribute=i||1}function pu(t){xc.call(this,t)}hu.prototype=Object.assign(Object.create(Bi.prototype),{constructor:hu,isInstancedBufferGeometry:!0,copy:function(t){return Bi.prototype.copy.call(this,t),this.maxInstancedCount=t.maxInstancedCount,this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var t=Bi.prototype.toJSON.call(this);return t.maxInstancedCount=this.maxInstancedCount,t.isInstancedBufferGeometry=!0,t}}),du.prototype=Object.assign(Object.create(yi.prototype),{constructor:du,isInstancedBufferAttribute:!0,copy:function(t){return yi.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this},toJSON:function(){var t=yi.prototype.toJSON.call(this);return t.meshPerAttribute=this.meshPerAttribute,t.isInstancedBufferAttribute=!0,t}}),pu.prototype=Object.assign(Object.create(xc.prototype),{constructor:pu,load:function(t,e,n,i){var r=this,a=new wc(r.manager);a.setPath(r.path),a.load(t,function(t){e(r.parse(JSON.parse(t)))},n,i)},parse:function(t){var e=new(t.isInstancedBufferGeometry?hu:Bi),n=t.data.index;if(void 0!==n){var i=new fu[n.type](n.array);e.setIndex(new yi(i,1))}var r=t.data.attributes;for(var a in r){var o=r[a],s=(i=new fu[o.type](o.array),new(o.isInstancedBufferAttribute?du:yi)(i,o.itemSize,o.normalized));void 0!==o.name&&(s.name=o.name),e.setAttribute(a,s)}var l=t.data.morphAttributes;if(l)for(var a in l){for(var c=l[a],u=[],h=0,d=c.length;h<d;h++){o=c[h],s=new yi(i=new fu[o.type](o.array),o.itemSize,o.normalized);void 0!==o.name&&(s.name=o.name),u.push(s)}e.morphAttributes[a]=u}t.data.morphTargetsRelative&&(e.morphTargetsRelative=!0);var p=t.data.groups||t.data.drawcalls||t.data.offsets;if(void 0!==p){h=0;for(var f=p.length;h!==f;++h){var m=p[h];e.addGroup(m.start,m.count,m.materialIndex)}}var g=t.data.boundingSphere;if(void 0!==g){var v=new We;void 0!==g.center&&v.fromArray(g.center),e.boundingSphere=new Nn(v,g.radius)}return t.name&&(e.name=t.name),t.userData&&(e.userData=t.userData),e}});var fu={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:"undefined"!=typeof Uint8ClampedArray?Uint8ClampedArray:Uint8Array,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function mu(t){xc.call(this,t)}mu.prototype=Object.assign(Object.create(xc.prototype),{constructor:mu,load:function(i,r,t,a){var o=this,e=""===this.path?uu.extractUrlBase(i):this.path;this.resourcePath=this.resourcePath||e;var n=new wc(o.manager);n.setPath(this.path),n.load(i,function(t){var e=null;try{e=JSON.parse(t)}catch(t){return void 0!==a&&a(t),void console.error("THREE:ObjectLoader: Can't parse "+i+".",t.message)}var n=e.metadata;void 0!==n&&void 0!==n.type&&"geometry"!==n.type.toLowerCase()?o.parse(e,r):console.error("THREE.ObjectLoader: Can't load "+i)},t,a)},parse:function(t,e){var n=this.parseShape(t.shapes),i=this.parseGeometries(t.geometries,n),r=this.parseImages(t.images,function(){void 0!==e&&e(s)}),a=this.parseTextures(t.textures,r),o=this.parseMaterials(t.materials,a),s=this.parseObject(t.object,i,o);return t.animations&&(s.animations=this.parseAnimations(t.animations)),void 0!==t.images&&0!==t.images.length||void 0!==e&&e(s),s},parseShape:function(t){var e={};if(void 0!==t)for(var n=0,i=t.length;n<i;n++){var r=(new Zc).fromJSON(t[n]);e[r.uuid]=r}return e},parseGeometries:function(t,e){var n={};if(void 0!==t)for(var i=new pu,r=0,a=t.length;r<a;r++){var o,s=t[r];switch(s.type){case"PlaneGeometry":case"PlaneBufferGeometry":o=new Gl[s.type](s.width,s.height,s.widthSegments,s.heightSegments);break;case"BoxGeometry":case"BoxBufferGeometry":case"CubeGeometry":o=new Gl[s.type](s.width,s.height,s.depth,s.widthSegments,s.heightSegments,s.depthSegments);break;case"CircleGeometry":case"CircleBufferGeometry":o=new Gl[s.type](s.radius,s.segments,s.thetaStart,s.thetaLength);break;case"CylinderGeometry":case"CylinderBufferGeometry":o=new Gl[s.type](s.radiusTop,s.radiusBottom,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"ConeGeometry":case"ConeBufferGeometry":o=new Gl[s.type](s.radius,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"SphereGeometry":case"SphereBufferGeometry":o=new Gl[s.type](s.radius,s.widthSegments,s.heightSegments,s.phiStart,s.phiLength,s.thetaStart,s.thetaLength);break;case"DodecahedronGeometry":case"DodecahedronBufferGeometry":case"IcosahedronGeometry":case"IcosahedronBufferGeometry":case"OctahedronGeometry":case"OctahedronBufferGeometry":case"TetrahedronGeometry":case"TetrahedronBufferGeometry":o=new Gl[s.type](s.radius,s.detail);break;case"RingGeometry":case"RingBufferGeometry":o=new Gl[s.type](s.innerRadius,s.outerRadius,s.thetaSegments,s.phiSegments,s.thetaStart,s.thetaLength);break;case"TorusGeometry":case"TorusBufferGeometry":o=new Gl[s.type](s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc);break;case"TorusKnotGeometry":case"TorusKnotBufferGeometry":o=new Gl[s.type](s.radius,s.tube,s.tubularSegments,s.radialSegments,s.p,s.q);break;case"TubeGeometry":case"TubeBufferGeometry":o=new Gl[s.type]((new qc[s.path.type]).fromJSON(s.path),s.tubularSegments,s.radius,s.radialSegments,s.closed);break;case"LatheGeometry":case"LatheBufferGeometry":o=new Gl[s.type](s.points,s.segments,s.phiStart,s.phiLength);break;case"PolyhedronGeometry":case"PolyhedronBufferGeometry":o=new Gl[s.type](s.vertices,s.indices,s.radius,s.details);break;case"ShapeGeometry":case"ShapeBufferGeometry":for(var l=[],c=0,u=s.shapes.length;c<u;c++){var h=e[s.shapes[c]];l.push(h)}o=new Gl[s.type](l,s.curveSegments);break;case"ExtrudeGeometry":case"ExtrudeBufferGeometry":for(l=[],c=0,u=s.shapes.length;c<u;c++){h=e[s.shapes[c]];l.push(h)}var d=s.options.extrudePath;void 0!==d&&(s.options.extrudePath=(new qc[d.type]).fromJSON(d)),o=new Gl[s.type](l,s.options);break;case"BufferGeometry":case"InstancedBufferGeometry":o=i.parse(s);break;case"Geometry":if("THREE"in window&&"LegacyJSONLoader"in THREE)o=(new THREE.LegacyJSONLoader).parse(s,this.resourcePath).geometry;else console.error('THREE.ObjectLoader: You have to import LegacyJSONLoader in order load geometry data of type "Geometry".');break;default:console.warn('THREE.ObjectLoader: Unsupported geometry type "'+s.type+'"');continue}o.uuid=s.uuid,void 0!==s.name&&(o.name=s.name),!0===o.isBufferGeometry&&void 0!==s.userData&&(o.userData=s.userData),n[s.uuid]=o}return n},parseMaterials:function(t,e){var n={},i={};if(void 0!==t){var r=new cu;r.setTextures(e);for(var a=0,o=t.length;a<o;a++){var s=t[a];if("MultiMaterial"===s.type){for(var l=[],c=0;c<s.materials.length;c++){var u=s.materials[c];void 0===n[u.uuid]&&(n[u.uuid]=r.parse(u)),l.push(n[u.uuid])}i[s.uuid]=l}else void 0===n[s.uuid]&&(n[s.uuid]=r.parse(s)),i[s.uuid]=n[s.uuid]}}return i},parseAnimations:function(t){for(var e=[],n=0;n<t.length;n++){var i=t[n],r=fc.parse(i);void 0!==i.uuid&&(r.uuid=i.uuid),e.push(r)}return e},parseImages:function(t,e){var n=this,i={};function r(t){return n.manager.itemStart(t),a.load(t,function(){n.manager.itemEnd(t)},void 0,function(){n.manager.itemError(t),n.manager.itemEnd(t)})}if(void 0!==t&&0<t.length){var a=new Cc(new vc(e));a.setCrossOrigin(this.crossOrigin);for(var o=0,s=t.length;o<s;o++){var l=t[o],c=l.url;if(Array.isArray(c)){i[l.uuid]=[];for(var u=0,h=c.length;u<h;u++){var d=c[u],p=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(d)?d:n.resourcePath+d;i[l.uuid].push(r(p))}}else{p=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(l.url)?l.url:n.resourcePath+l.url;i[l.uuid]=r(p)}}}return i},parseTextures:function(t,e){function n(t,e){return"number"==typeof t?t:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",t),e[t])}var i={};if(void 0!==t)for(var r=0,a=t.length;r<a;r++){var o,s=t[r];void 0===s.image&&console.warn('THREE.ObjectLoader: No "image" specified for',s.uuid),void 0===e[s.image]&&console.warn("THREE.ObjectLoader: Undefined image",s.image),(o=new(Array.isArray(e[s.image])?Gr:Fe)(e[s.image])).needsUpdate=!0,o.uuid=s.uuid,void 0!==s.name&&(o.name=s.name),void 0!==s.mapping&&(o.mapping=n(s.mapping,vu)),void 0!==s.offset&&o.offset.fromArray(s.offset),void 0!==s.repeat&&o.repeat.fromArray(s.repeat),void 0!==s.center&&o.center.fromArray(s.center),void 0!==s.rotation&&(o.rotation=s.rotation),void 0!==s.wrap&&(o.wrapS=n(s.wrap[0],yu),o.wrapT=n(s.wrap[1],yu)),void 0!==s.format&&(o.format=s.format),void 0!==s.type&&(o.type=s.type),void 0!==s.encoding&&(o.encoding=s.encoding),void 0!==s.minFilter&&(o.minFilter=n(s.minFilter,xu)),void 0!==s.magFilter&&(o.magFilter=n(s.magFilter,xu)),void 0!==s.anisotropy&&(o.anisotropy=s.anisotropy),void 0!==s.flipY&&(o.flipY=s.flipY),void 0!==s.premultiplyAlpha&&(o.premultiplyAlpha=s.premultiplyAlpha),void 0!==s.unpackAlignment&&(o.unpackAlignment=s.unpackAlignment),i[s.uuid]=o}return i},parseObject:function(t,e,a){var n;function i(t){return void 0===e[t]&&console.warn("THREE.ObjectLoader: Undefined geometry",t),e[t]}function r(t){if(void 0!==t){if(Array.isArray(t)){for(var e=[],n=0,i=t.length;n<i;n++){var r=t[n];void 0===a[r]&&console.warn("THREE.ObjectLoader: Undefined material",r),e.push(a[r])}return e}return void 0===a[t]&&console.warn("THREE.ObjectLoader: Undefined material",t),a[t]}}switch(t.type){case"Scene":n=new xn,void 0!==t.background&&Number.isInteger(t.background)&&(n.background=new ci(t.background)),void 0!==t.fog&&("Fog"===t.fog.type?n.fog=new Oo(t.fog.color,t.fog.near,t.fog.far):"FogExp2"===t.fog.type&&(n.fog=new Lo(t.fog.color,t.fog.density)));break;case"PerspectiveCamera":n=new yr(t.fov,t.aspect,t.near,t.far),void 0!==t.focus&&(n.focus=t.focus),void 0!==t.zoom&&(n.zoom=t.zoom),void 0!==t.filmGauge&&(n.filmGauge=t.filmGauge),void 0!==t.filmOffset&&(n.filmOffset=t.filmOffset),void 0!==t.view&&(n.view=Object.assign({},t.view));break;case"OrthographicCamera":n=new ru(t.left,t.right,t.top,t.bottom,t.near,t.far),void 0!==t.zoom&&(n.zoom=t.zoom),void 0!==t.view&&(n.view=Object.assign({},t.view));break;case"AmbientLight":n=new su(t.color,t.intensity);break;case"DirectionalLight":n=new ou(t.color,t.intensity);break;case"PointLight":n=new iu(t.color,t.intensity,t.distance,t.decay);break;case"RectAreaLight":n=new lu(t.color,t.intensity,t.width,t.height);break;case"SpotLight":n=new eu(t.color,t.intensity,t.distance,t.angle,t.penumbra,t.decay);break;case"HemisphereLight":n=new Kc(t.color,t.groundColor,t.intensity);break;case"SkinnedMesh":console.warn("THREE.ObjectLoader.parseObject() does not support SkinnedMesh yet.");case"Mesh":var o=i(t.geometry),s=r(t.material);n=new(o.bones&&0<o.bones.length?ts:er)(o,s);break;case"InstancedMesh":o=i(t.geometry),s=r(t.material);var l=t.count,c=t.instanceMatrix;(n=new cs(o,s,l)).instanceMatrix=new yi(new Float32Array(c.array),16);break;case"LOD":n=new Qo;break;case"Line":n=new gs(i(t.geometry),r(t.material),t.mode);break;case"LineLoop":n=new _s(i(t.geometry),r(t.material));break;case"LineSegments":n=new xs(i(t.geometry),r(t.material));break;case"PointCloud":case"Points":n=new Ts(i(t.geometry),r(t.material));break;case"Sprite":n=new Yo(r(t.material));break;case"Group":n=new Eo;break;default:n=new yn}if(n.uuid=t.uuid,void 0!==t.name&&(n.name=t.name),void 0!==t.matrix?(n.matrix.fromArray(t.matrix),void 0!==t.matrixAutoUpdate&&(n.matrixAutoUpdate=t.matrixAutoUpdate),n.matrixAutoUpdate&&n.matrix.decompose(n.position,n.quaternion,n.scale)):(void 0!==t.position&&n.position.fromArray(t.position),void 0!==t.rotation&&n.rotation.fromArray(t.rotation),void 0!==t.quaternion&&n.quaternion.fromArray(t.quaternion),void 0!==t.scale&&n.scale.fromArray(t.scale)),void 0!==t.castShadow&&(n.castShadow=t.castShadow),void 0!==t.receiveShadow&&(n.receiveShadow=t.receiveShadow),t.shadow&&(void 0!==t.shadow.bias&&(n.shadow.bias=t.shadow.bias),void 0!==t.shadow.radius&&(n.shadow.radius=t.shadow.radius),void 0!==t.shadow.mapSize&&n.shadow.mapSize.fromArray(t.shadow.mapSize),void 0!==t.shadow.camera&&(n.shadow.camera=this.parseObject(t.shadow.camera))),void 0!==t.visible&&(n.visible=t.visible),void 0!==t.frustumCulled&&(n.frustumCulled=t.frustumCulled),void 0!==t.renderOrder&&(n.renderOrder=t.renderOrder),void 0!==t.userData&&(n.userData=t.userData),void 0!==t.layers&&(n.layers.mask=t.layers),void 0!==t.children)for(var u=t.children,h=0;h<u.length;h++)n.add(this.parseObject(u[h],e,a));if("LOD"===t.type){void 0!==t.autoUpdate&&(n.autoUpdate=t.autoUpdate);for(var d=t.levels,p=0;p<d.length;p++){var f=d[p],m=n.getObjectByProperty("uuid",f.object);void 0!==m&&n.addLevel(m,f.distance)}}return n}});var gu,vu={UVMapping:300,CubeReflectionMapping:Ot,CubeRefractionMapping:It,EquirectangularReflectionMapping:Pt,EquirectangularRefractionMapping:Rt,SphericalReflectionMapping:kt,CubeUVReflectionMapping:Nt,CubeUVRefractionMapping:Bt},yu={RepeatWrapping:Ft,ClampToEdgeWrapping:zt,MirroredRepeatWrapping:Vt},xu={NearestFilter:Ut,NearestMipmapNearestFilter:jt,NearestMipmapLinearFilter:Gt,LinearFilter:Ht,LinearMipmapNearestFilter:Wt,LinearMipmapLinearFilter:Jt};function _u(t){"undefined"==typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"==typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),xc.call(this,t),this.options=void 0}function wu(){this.type="ShapePath",this.color=new ci,this.subPaths=[],this.currentPath=null}function bu(t){this.type="Font",this.data=t}function Mu(t,e,n,i,r){var a=r.glyphs[t]||r.glyphs["?"];if(a){var o,s,l,c,u,h,d,p,f=new wu;if(a.o)for(var m=a._cachedOutline||(a._cachedOutline=a.o.split(" ")),g=0,v=m.length;g<v;){switch(m[g++]){case"m":o=m[g++]*e+n,s=m[g++]*e+i,f.moveTo(o,s);break;case"l":o=m[g++]*e+n,s=m[g++]*e+i,f.lineTo(o,s);break;case"q":l=m[g++]*e+n,c=m[g++]*e+i,u=m[g++]*e+n,h=m[g++]*e+i,f.quadraticCurveTo(u,h,l,c);break;case"b":l=m[g++]*e+n,c=m[g++]*e+i,u=m[g++]*e+n,h=m[g++]*e+i,d=m[g++]*e+n,p=m[g++]*e+i,f.bezierCurveTo(u,h,d,p,l,c)}}return{offsetX:a.ha*e,path:f}}console.error('THREE.Font: character "'+t+'" does not exists in font family '+r.familyName+".")}function Su(t){xc.call(this,t)}_u.prototype=Object.assign(Object.create(xc.prototype),{constructor:_u,setOptions:function(t){return this.options=t,this},load:function(e,n,t,i){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);var r=this,a=gc.get(e);if(void 0!==a)return r.manager.itemStart(e),setTimeout(function(){n&&n(a),r.manager.itemEnd(e)},0),a;fetch(e).then(function(t){return t.blob()}).then(function(t){return void 0===r.options?createImageBitmap(t):createImageBitmap(t,r.options)}).then(function(t){gc.add(e,t),n&&n(t),r.manager.itemEnd(e)}).catch(function(t){i&&i(t),r.manager.itemError(e),r.manager.itemEnd(e)}),r.manager.itemStart(e)}}),Object.assign(wu.prototype,{moveTo:function(t,e){return this.currentPath=new Yc,this.subPaths.push(this.currentPath),this.currentPath.moveTo(t,e),this},lineTo:function(t,e){return this.currentPath.lineTo(t,e),this},quadraticCurveTo:function(t,e,n,i){return this.currentPath.quadraticCurveTo(t,e,n,i),this},bezierCurveTo:function(t,e,n,i,r,a){return this.currentPath.bezierCurveTo(t,e,n,i,r,a),this},splineThru:function(t){return this.currentPath.splineThru(t),this},toShapes:function(t,e){function n(t){for(var e=[],n=0,i=t.length;n<i;n++){var r=t[n],a=new Zc;a.curves=r.curves,e.push(a)}return e}function i(t,e){for(var n=e.length,i=!1,r=n-1,a=0;a<n;r=a++){var o=e[r],s=e[a],l=s.x-o.x,c=s.y-o.y;if(Math.abs(c)>Number.EPSILON){if(c<0&&(o=e[a],l=-l,s=e[r],c=-c),t.y<o.y||t.y>s.y)continue;if(t.y===o.y){if(t.x===o.x)return 1}else{var u=c*(t.x-o.x)-l*(t.y-o.y);if(0==u)return 1;if(u<0)continue;i=!i}}else{if(t.y!==o.y)continue;if(s.x<=t.x&&t.x<=o.x||o.x<=t.x&&t.x<=s.x)return 1}}return i}var r=yl.isClockWise,a=this.subPaths;if(0===a.length)return[];if(!0===e)return n(a);var o,s,l,c=[];if(1===a.length)return s=a[0],(l=new Zc).curves=s.curves,c.push(l),c;var u=!r(a[0].getPoints());u=t?!u:u;var h,d,p=[],f=[],m=[],g=0;f[g]=void 0,m[g]=[];for(var v=0,y=a.length;v<y;v++)o=r(h=(s=a[v]).getPoints()),(o=t?!o:o)?(!u&&f[g]&&g++,f[g]={s:new Zc,p:h},f[g].s.curves=s.curves,u&&g++,m[g]=[]):m[g].push({h:s,p:h[0]});if(!f[0])return n(a);if(1<f.length){for(var x=!1,_=[],w=0,b=f.length;w<b;w++)p[w]=[];for(w=0,b=f.length;w<b;w++)for(var M=m[w],S=0;S<M.length;S++){for(var C=M[S],T=!0,E=0;E<f.length;E++)i(C.p,f[E].p)&&(w!==E&&_.push({froms:w,tos:E,hole:S}),T?(T=!1,p[E].push(C)):x=!0);T&&p[w].push(C)}0<_.length&&(x||(m=p))}v=0;for(var A=f.length;v<A;v++){l=f[v].s,c.push(l);for(var D=0,L=(d=m[v]).length;D<L;D++)l.holes.push(d[D].h)}return c}}),Object.assign(bu.prototype,{isFont:!0,generateShapes:function(t,e){void 0===e&&(e=100);for(var n=[],i=function(t,e,n){for(var i=Array.from?Array.from(t):String(t).split(""),r=e/n.resolution,a=(n.boundingBox.yMax-n.boundingBox.yMin+n.underlineThickness)*r,o=[],s=0,l=0,c=0;c<i.length;c++){var u=i[c];if("\n"===u)s=0,l-=a;else{var h=Mu(u,r,s,l,n);s+=h.offsetX,o.push(h.path)}}return o}(t,e,this.data),r=0,a=i.length;r<a;r++)Array.prototype.push.apply(n,i[r].toShapes());return n}}),Su.prototype=Object.assign(Object.create(xc.prototype),{constructor:Su,load:function(t,i,e,n){var r=this,a=new wc(this.manager);a.setPath(this.path),a.load(t,function(e){var n;try{n=JSON.parse(e)}catch(t){console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),n=JSON.parse(e.substring(65,e.length-2))}var t=r.parse(n);i&&i(t)},e,n)},parse:function(t){return new bu(t)}});var Cu={getContext:function(){return void 0===gu&&(gu=new(window.AudioContext||window.webkitAudioContext)),gu},setContext:function(t){gu=t}};function Tu(t){xc.call(this,t)}function Eu(){this.coefficients=[];for(var t=0;t<9;t++)this.coefficients.push(new We)}function Au(t,e){$c.call(this,void 0,e),this.sh=void 0!==t?t:new Eu}function Du(t,e,n){Au.call(this,void 0,n);var i=(new ci).set(t),r=(new ci).set(e),a=new We(i.r,i.g,i.b),o=new We(r.r,r.g,r.b),s=Math.sqrt(Math.PI),l=s*Math.sqrt(.75);this.sh.coefficients[0].copy(a).add(o).multiplyScalar(s),this.sh.coefficients[1].copy(a).sub(o).multiplyScalar(l)}function Lu(t,e){Au.call(this,void 0,e);var n=(new ci).set(t);this.sh.coefficients[0].set(n.r,n.g,n.b).multiplyScalar(2*Math.sqrt(Math.PI))}Tu.prototype=Object.assign(Object.create(xc.prototype),{constructor:Tu,load:function(t,n,e,i){var r=new wc(this.manager);r.setResponseType("arraybuffer"),r.setPath(this.path),r.load(t,function(t){var e=t.slice(0);Cu.getContext().decodeAudioData(e,function(t){n(t)})},e,i)}}),Object.assign(Eu.prototype,{isSphericalHarmonics3:!0,set:function(t){for(var e=0;e<9;e++)this.coefficients[e].copy(t[e]);return this},zero:function(){for(var t=0;t<9;t++)this.coefficients[t].set(0,0,0);return this},getAt:function(t,e){var n=t.x,i=t.y,r=t.z,a=this.coefficients;return e.copy(a[0]).multiplyScalar(.282095),e.addScale(a[1],.488603*i),e.addScale(a[2],.488603*r),e.addScale(a[3],.488603*n),e.addScale(a[4],n*i*1.092548),e.addScale(a[5],i*r*1.092548),e.addScale(a[6],.315392*(3*r*r-1)),e.addScale(a[7],n*r*1.092548),e.addScale(a[8],.546274*(n*n-i*i)),e},getIrradianceAt:function(t,e){var n=t.x,i=t.y,r=t.z,a=this.coefficients;return e.copy(a[0]).multiplyScalar(.886227),e.addScale(a[1],1.023328*i),e.addScale(a[2],1.023328*r),e.addScale(a[3],1.023328*n),e.addScale(a[4],.858086*n*i),e.addScale(a[5],.858086*i*r),e.addScale(a[6],.743125*r*r-.247708),e.addScale(a[7],.858086*n*r),e.addScale(a[8],.429043*(n*n-i*i)),e},add:function(t){for(var e=0;e<9;e++)this.coefficients[e].add(t.coefficients[e]);return this},scale:function(t){for(var e=0;e<9;e++)this.coefficients[e].multiplyScalar(t);return this},lerp:function(t,e){for(var n=0;n<9;n++)this.coefficients[n].lerp(t.coefficients[n],e);return this},equals:function(t){for(var e=0;e<9;e++)if(!this.coefficients[e].equals(t.coefficients[e]))return!1;return!0},copy:function(t){return this.set(t.coefficients)},clone:function(){return(new this.constructor).copy(this)},fromArray:function(t,e){void 0===e&&(e=0);for(var n=this.coefficients,i=0;i<9;i++)n[i].fromArray(t,e+3*i);return this},toArray:function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);for(var n=this.coefficients,i=0;i<9;i++)n[i].toArray(t,e+3*i);return t}}),Object.assign(Eu,{getBasisAt:function(t,e){var n=t.x,i=t.y,r=t.z;e[0]=.282095,e[1]=.488603*i,e[2]=.488603*r,e[3]=.488603*n,e[4]=1.092548*n*i,e[5]=1.092548*i*r,e[6]=.315392*(3*r*r-1),e[7]=1.092548*n*r,e[8]=.546274*(n*n-i*i)}}),Au.prototype=Object.assign(Object.create($c.prototype),{constructor:Au,isLightProbe:!0,copy:function(t){return $c.prototype.copy.call(this,t),this.sh.copy(t.sh),this.intensity=t.intensity,this},toJSON:function(t){return $c.prototype.toJSON.call(this,t)}}),Du.prototype=Object.assign(Object.create(Au.prototype),{constructor:Du,isHemisphereLightProbe:!0,copy:function(t){return Au.prototype.copy.call(this,t),this},toJSON:function(t){return Au.prototype.toJSON.call(this,t)}}),Lu.prototype=Object.assign(Object.create(Au.prototype),{constructor:Lu,isAmbientLightProbe:!0,copy:function(t){return Au.prototype.copy.call(this,t),this},toJSON:function(t){return Au.prototype.toJSON.call(this,t)}});var Ou=new Qe,Iu=new Qe;function Pu(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new yr,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new yr,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}function Ru(t){this.autoStart=void 0===t||t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}Object.assign(Pu.prototype,{update:function(t){var e=this._cache;if(e.focus!==t.focus||e.fov!==t.fov||e.aspect!==t.aspect*this.aspect||e.near!==t.near||e.far!==t.far||e.zoom!==t.zoom||e.eyeSep!==this.eyeSep){e.focus=t.focus,e.fov=t.fov,e.aspect=t.aspect*this.aspect,e.near=t.near,e.far=t.far,e.zoom=t.zoom,e.eyeSep=this.eyeSep;var n,i,r=t.projectionMatrix.clone(),a=e.eyeSep/2,o=a*e.near/e.focus,s=e.near*Math.tan(Pe.DEG2RAD*e.fov*.5)/e.zoom;Iu.elements[12]=-a,Ou.elements[12]=a,n=-s*e.aspect+o,i=s*e.aspect+o,r.elements[0]=2*e.near/(i-n),r.elements[8]=(i+n)/(i-n),this.cameraL.projectionMatrix.copy(r),n=-s*e.aspect-o,i=s*e.aspect-o,r.elements[0]=2*e.near/(i-n),r.elements[8]=(i+n)/(i-n),this.cameraR.projectionMatrix.copy(r)}this.cameraL.matrixWorld.copy(t.matrixWorld).multiply(Iu),this.cameraR.matrixWorld.copy(t.matrixWorld).multiply(Ou)}}),Object.assign(Ru.prototype,{start:function(){this.startTime=("undefined"==typeof performance?Date:performance).now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0},stop:function(){this.getElapsedTime(),this.running=!1,this.autoStart=!1},getElapsedTime:function(){return this.getDelta(),this.elapsedTime},getDelta:function(){var t=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){var e=("undefined"==typeof performance?Date:performance).now();t=(e-this.oldTime)/1e3,this.oldTime=e,this.elapsedTime+=t}return t}});var ku=new We,Nu=new je,Bu=new We,Fu=new We;function zu(){yn.call(this),this.type="AudioListener",this.context=Cu.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new Ru}function Vu(t){yn.call(this),this.type="Audio",this.listener=t,this.context=t.context,this.gain=this.context.createGain(),this.gain.connect(t.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.sourceType="empty",this._startedAt=0,this._pausedAt=0,this.filters=[]}zu.prototype=Object.assign(Object.create(yn.prototype),{constructor:zu,getInput:function(){return this.gain},removeFilter:function(){return null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this},getFilter:function(){return this.filter},setFilter:function(t){return null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=t,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this},getMasterVolume:function(){return this.gain.gain.value},setMasterVolume:function(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this},updateMatrixWorld:function(t){yn.prototype.updateMatrixWorld.call(this,t);var e=this.context.listener,n=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(ku,Nu,Bu),Fu.set(0,0,-1).applyQuaternion(Nu),e.positionX){var i=this.context.currentTime+this.timeDelta;e.positionX.linearRampToValueAtTime(ku.x,i),e.positionY.linearRampToValueAtTime(ku.y,i),e.positionZ.linearRampToValueAtTime(ku.z,i),e.forwardX.linearRampToValueAtTime(Fu.x,i),e.forwardY.linearRampToValueAtTime(Fu.y,i),e.forwardZ.linearRampToValueAtTime(Fu.z,i),e.upX.linearRampToValueAtTime(n.x,i),e.upY.linearRampToValueAtTime(n.y,i),e.upZ.linearRampToValueAtTime(n.z,i)}else e.setPosition(ku.x,ku.y,ku.z),e.setOrientation(Fu.x,Fu.y,Fu.z,n.x,n.y,n.z)}}),Vu.prototype=Object.assign(Object.create(yn.prototype),{constructor:Vu,getOutput:function(){return this.gain},setNodeSource:function(t){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=t,this.connect(),this},setMediaElementSource:function(t){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(t),this.connect(),this},setMediaStreamSource:function(t){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(t),this.connect(),this},setBuffer:function(t){return this.buffer=t,this.sourceType="buffer",this.autoplay&&this.play(),this},play:function(t){if(void 0===t&&(t=0),!0!==this.isPlaying){if(!1!==this.hasPlaybackControl){this._startedAt=this.context.currentTime+t;var e=this.context.createBufferSource();return e.buffer=this.buffer,e.loop=this.loop,e.loopStart=this.loopStart,e.loopEnd=this.loopEnd,e.onended=this.onEnded.bind(this),e.start(this._startedAt,this._pausedAt+this.offset,this.duration),this.isPlaying=!0,this.source=e,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}console.warn("THREE.Audio: this Audio has no playback control.")}else console.warn("THREE.Audio: Audio is already playing.")},pause:function(){if(!1!==this.hasPlaybackControl)return!0===this.isPlaying&&(this._pausedAt=(this.context.currentTime-this._startedAt)*this.playbackRate,this.source.stop(),this.source.onended=null,this.isPlaying=!1),this;console.warn("THREE.Audio: this Audio has no playback control.")},stop:function(){if(!1!==this.hasPlaybackControl)return this._pausedAt=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")},connect:function(){if(0<this.filters.length){this.source.connect(this.filters[0]);for(var t=1,e=this.filters.length;t<e;t++)this.filters[t-1].connect(this.filters[t]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this},disconnect:function(){if(0<this.filters.length){this.source.disconnect(this.filters[0]);for(var t=1,e=this.filters.length;t<e;t++)this.filters[t-1].disconnect(this.filters[t]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this},getFilters:function(){return this.filters},setFilters:function(t){return t=t||[],!0===this.isPlaying?(this.disconnect(),this.filters=t,this.connect()):this.filters=t,this},setDetune:function(t){if(this.detune=t,void 0!==this.source.detune)return!0===this.isPlaying&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this},getDetune:function(){return this.detune},getFilter:function(){return this.getFilters()[0]},setFilter:function(t){return this.setFilters(t?[t]:[])},setPlaybackRate:function(t){if(!1!==this.hasPlaybackControl)return this.playbackRate=t,!0===this.isPlaying&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this;console.warn("THREE.Audio: this Audio has no playback control.")},getPlaybackRate:function(){return this.playbackRate},onEnded:function(){this.isPlaying=!1},getLoop:function(){return!1===this.hasPlaybackControl?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop},setLoop:function(t){if(!1!==this.hasPlaybackControl)return this.loop=t,!0===this.isPlaying&&(this.source.loop=this.loop),this;console.warn("THREE.Audio: this Audio has no playback control.")},setLoopStart:function(t){return this.loopStart=t,this},setLoopEnd:function(t){return this.loopEnd=t,this},getVolume:function(){return this.gain.gain.value},setVolume:function(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this}});var Uu=new We,ju=new je,Gu=new We,Hu=new We;function Wu(t){Vu.call(this,t),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}function Ju(t,e){this.analyser=t.context.createAnalyser(),this.analyser.fftSize=void 0!==e?e:2048,this.data=new Uint8Array(this.analyser.frequencyBinCount),t.getOutput().connect(this.analyser)}function qu(t,e,n){this.binding=t,this.valueSize=n;var i,r=Float64Array;switch(e){case"quaternion":i=this._slerp;break;case"string":case"bool":r=Array,i=this._select;break;default:i=this._lerp}this.buffer=new r(4*n),this._mixBufferRegion=i,this.cumulativeWeight=0,this.useCount=0,this.referenceCount=0}Wu.prototype=Object.assign(Object.create(Vu.prototype),{constructor:Wu,getOutput:function(){return this.panner},getRefDistance:function(){return this.panner.refDistance},setRefDistance:function(t){return this.panner.refDistance=t,this},getRolloffFactor:function(){return this.panner.rolloffFactor},setRolloffFactor:function(t){return this.panner.rolloffFactor=t,this},getDistanceModel:function(){return this.panner.distanceModel},setDistanceModel:function(t){return this.panner.distanceModel=t,this},getMaxDistance:function(){return this.panner.maxDistance},setMaxDistance:function(t){return this.panner.maxDistance=t,this},setDirectionalCone:function(t,e,n){return this.panner.coneInnerAngle=t,this.panner.coneOuterAngle=e,this.panner.coneOuterGain=n,this},updateMatrixWorld:function(t){if(yn.prototype.updateMatrixWorld.call(this,t),!0!==this.hasPlaybackControl||!1!==this.isPlaying){this.matrixWorld.decompose(Uu,ju,Gu),Hu.set(0,0,1).applyQuaternion(ju);var e=this.panner;if(e.positionX){var n=this.context.currentTime+this.listener.timeDelta;e.positionX.linearRampToValueAtTime(Uu.x,n),e.positionY.linearRampToValueAtTime(Uu.y,n),e.positionZ.linearRampToValueAtTime(Uu.z,n),e.orientationX.linearRampToValueAtTime(Hu.x,n),e.orientationY.linearRampToValueAtTime(Hu.y,n),e.orientationZ.linearRampToValueAtTime(Hu.z,n)}else e.setPosition(Uu.x,Uu.y,Uu.z),e.setOrientation(Hu.x,Hu.y,Hu.z)}}}),Object.assign(Ju.prototype,{getFrequencyData:function(){return this.analyser.getByteFrequencyData(this.data),this.data},getAverageFrequency:function(){for(var t=0,e=this.getFrequencyData(),n=0;n<e.length;n++)t+=e[n];return t/e.length}}),Object.assign(qu.prototype,{accumulate:function(t,e){var n=this.buffer,i=this.valueSize,r=t*i+i,a=this.cumulativeWeight;if(0===a){for(var o=0;o!==i;++o)n[r+o]=n[o];a=e}else{var s=e/(a+=e);this._mixBufferRegion(n,r,0,s,i)}this.cumulativeWeight=a},apply:function(t){var e=this.valueSize,n=this.buffer,i=t*e+e,r=this.cumulativeWeight,a=this.binding;if(this.cumulativeWeight=0,r<1){var o=3*e;this._mixBufferRegion(n,i,o,1-r,e)}for(var s=e,l=e+e;s!==l;++s)if(n[s]!==n[s+e]){a.setValue(n,i);break}},saveOriginalState:function(){var t=this.binding,e=this.buffer,n=this.valueSize,i=3*n;t.getValue(e,i);for(var r=n,a=i;r!==a;++r)e[r]=e[i+r%n];this.cumulativeWeight=0},restoreOriginalState:function(){var t=3*this.valueSize;this.binding.setValue(this.buffer,t)},_select:function(t,e,n,i,r){if(.5<=i)for(var a=0;a!==r;++a)t[e+a]=t[n+a]},_slerp:function(t,e,n,i){je.slerpFlat(t,e,t,e,t,n,i)},_lerp:function(t,e,n,i,r){for(var a=1-i,o=0;o!==r;++o){var s=e+o;t[s]=t[s]*a+t[n+o]*i}}});var Xu="\\[\\]\\.:\\/",Yu=new RegExp("["+Xu+"]","g"),Zu="[^"+Xu+"]",$u="[^"+Xu.replace("\\.","")+"]",Ku=/((?:WC+[\/:])*)/.source.replace("WC",Zu),Qu=/(WCOD+)?/.source.replace("WCOD",$u),th=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Zu),eh=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Zu),nh=new RegExp("^"+Ku+Qu+th+eh+"$"),ih=["material","materials","bones"];function rh(t,e,n){var i=n||ah.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,i)}function ah(t,e,n){this.path=e,this.parsedPath=n||ah.parseTrackName(e),this.node=ah.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t}function oh(){this.uuid=Pe.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;var t={};this._indicesByUUID=t;for(var e=0,n=arguments.length;e!==n;++e)t[arguments[e].uuid]=e;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};var i=this;this.stats={objects:{get total(){return i._objects.length},get inUse(){return this.total-i.nCachedObjects_}},get bindingsPerObject(){return i._bindings.length}}}function sh(t,e,n){this._mixer=t,this._clip=e,this._localRoot=n||null;for(var i=e.tracks,r=i.length,a=new Array(r),o={endingStart:de,endingEnd:de},s=0;s!==r;++s){var l=i[s].createInterpolant(null);(a[s]=l).settings=o}this._interpolantSettings=o,this._interpolants=a,this._propertyBindings=new Array(r),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=2201,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}function lh(t){this._root=t,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}function ch(t){"string"==typeof t&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),t=arguments[1]),this.value=t}function uh(t,e,n){Io.call(this,t,e),this.meshPerAttribute=n||1}function hh(t,e,n,i){this.ray=new Hn(t,e),this.near=n||0,this.far=i||1/0,this.camera=null,this.params={Mesh:{},Line:{},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 dh(t,e){return t.distance-e.distance}function ph(t,e,n,i){if(!1!==t.visible&&(t.raycast(e,n),!0===i))for(var r=t.children,a=0,o=r.length;a<o;a++)ph(r[a],e,n,!0)}function fh(t,e,n){return this.radius=void 0!==t?t:1,this.phi=void 0!==e?e:0,this.theta=void 0!==n?n:0,this}function mh(t,e,n){return this.radius=void 0!==t?t:1,this.theta=void 0!==e?e:0,this.y=void 0!==n?n:0,this}Object.assign(rh.prototype,{getValue:function(t,e){this.bind();var n=this._targetGroup.nCachedObjects_,i=this._bindings[n];void 0!==i&&i.getValue(t,e)},setValue:function(t,e){for(var n=this._bindings,i=this._targetGroup.nCachedObjects_,r=n.length;i!==r;++i)n[i].setValue(t,e)},bind:function(){for(var t=this._bindings,e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].bind()},unbind:function(){for(var t=this._bindings,e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].unbind()}}),Object.assign(ah,{Composite:rh,create:function(t,e,n){return t&&t.isAnimationObjectGroup?new ah.Composite(t,e,n):new ah(t,e,n)},sanitizeNodeName:function(t){return t.replace(/\s/g,"_").replace(Yu,"")},parseTrackName:function(t){var e=nh.exec(t);if(!e)throw new Error("PropertyBinding: Cannot parse trackName: "+t);var n={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==i&&-1!==i){var r=n.nodeName.substring(i+1);-1!==ih.indexOf(r)&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=r)}if(null===n.propertyName||0===n.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return n},findNode:function(t,r){if(!r||""===r||"root"===r||"."===r||-1===r||r===t.name||r===t.uuid)return t;if(t.skeleton){var e=t.skeleton.getBoneByName(r);if(void 0!==e)return e}if(t.children){var a=function(t){for(var e=0;e<t.length;e++){var n=t[e];if(n.name===r||n.uuid===r)return n;var i=a(n.children);if(i)return i}return null},n=a(t.children);if(n)return n}return null}}),Object.assign(ah.prototype,{_getValue_unavailable:function(){},_setValue_unavailable:function(){},BindingType:{Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Versioning:{None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},GetterByBindingType:[function(t,e){t[e]=this.node[this.propertyName]},function(t,e){for(var n=this.resolvedProperty,i=0,r=n.length;i!==r;++i)t[e++]=n[i]},function(t,e){t[e]=this.resolvedProperty[this.propertyIndex]},function(t,e){this.resolvedProperty.toArray(t,e)}],SetterByBindingTypeAndVersioning:[[function(t,e){this.targetObject[this.propertyName]=t[e]},function(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.needsUpdate=!0},function(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){for(var n=this.resolvedProperty,i=0,r=n.length;i!==r;++i)n[i]=t[e++]},function(t,e){for(var n=this.resolvedProperty,i=0,r=n.length;i!==r;++i)n[i]=t[e++];this.targetObject.needsUpdate=!0},function(t,e){for(var n=this.resolvedProperty,i=0,r=n.length;i!==r;++i)n[i]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){this.resolvedProperty[this.propertyIndex]=t[e]},function(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0},function(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){this.resolvedProperty.fromArray(t,e)},function(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0},function(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0}]],getValue:function(t,e){this.bind(),this.getValue(t,e)},setValue:function(t,e){this.bind(),this.setValue(t,e)},bind:function(){var t=this.node,e=this.parsedPath,n=e.objectName,i=e.propertyName,r=e.propertyIndex;if(t||(t=ah.findNode(this.rootNode,e.nodeName)||this.rootNode,this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,t){if(n){var a=e.objectIndex;switch(n){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);t=t.skeleton.bones;for(var o=0;o<t.length;o++)if(t[o].name===a){a=o;break}break;default:if(void 0===t[n])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);t=t[n]}if(void 0!==a){if(void 0===t[a])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);t=t[a]}}var s=t[i];if(void 0!==s){var l=this.Versioning.None;void 0!==(this.targetObject=t).needsUpdate?l=this.Versioning.NeedsUpdate:void 0!==t.matrixWorldNeedsUpdate&&(l=this.Versioning.MatrixWorldNeedsUpdate);var c=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(o=0;o<this.node.geometry.morphAttributes.position.length;o++)if(t.geometry.morphAttributes.position[o].name===r){r=o;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(o=0;o<this.node.geometry.morphTargets.length;o++)if(t.geometry.morphTargets[o].name===r){r=o;break}}}c=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=r}else void 0!==s.fromArray&&void 0!==s.toArray?(c=this.BindingType.HasFromToArray,this.resolvedProperty=s):Array.isArray(s)?(c=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=i;this.getValue=this.GetterByBindingType[c],this.setValue=this.SetterByBindingTypeAndVersioning[c][l]}else{var u=e.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+u+"."+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._getValue_unbound,this.setValue=this._setValue_unbound}}),Object.assign(ah.prototype,{_getValue_unbound:ah.prototype.getValue,_setValue_unbound:ah.prototype.setValue}),Object.assign(oh.prototype,{isAnimationObjectGroup:!0,add:function(){for(var t=this._objects,e=t.length,n=this.nCachedObjects_,i=this._indicesByUUID,r=this._paths,a=this._parsedPaths,o=this._bindings,s=o.length,l=void 0,c=0,u=arguments.length;c!==u;++c){var h=arguments[c],d=h.uuid,p=i[d];if(void 0===p){p=e++,i[d]=p,t.push(h);for(var f=0,m=s;f!==m;++f)o[f].push(new ah(h,r[f],a[f]))}else if(p<n){l=t[p];var g=--n,v=t[g];t[i[v.uuid]=p]=v,t[i[d]=g]=h;for(f=0,m=s;f!==m;++f){var y=o[f],x=y[g],_=y[p];y[p]=x,void 0===_&&(_=new ah(h,r[f],a[f])),y[g]=_}}else t[p]!==l&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=n},remove:function(){for(var t=this._objects,e=this.nCachedObjects_,n=this._indicesByUUID,i=this._bindings,r=i.length,a=0,o=arguments.length;a!==o;++a){var s=arguments[a],l=s.uuid,c=n[l];if(void 0!==c&&e<=c){var u=e++,h=t[u];t[n[h.uuid]=c]=h,t[n[l]=u]=s;for(var d=0,p=r;d!==p;++d){var f=i[d],m=f[u],g=f[c];f[c]=m,f[u]=g}}}this.nCachedObjects_=e},uncache:function(){for(var t=this._objects,e=t.length,n=this.nCachedObjects_,i=this._indicesByUUID,r=this._bindings,a=r.length,o=0,s=arguments.length;o!==s;++o){var l=arguments[o].uuid,c=i[l];if(void 0!==c)if(delete i[l],c<n){var u=--n,h=t[u],d=t[v=--e];t[i[h.uuid]=c]=h,t[i[d.uuid]=u]=d,t.pop();for(var p=0,f=a;p!==f;++p){var m=(y=r[p])[u],g=y[v];y[c]=m,y[u]=g,y.pop()}}else{var v;t[i[(d=t[v=--e]).uuid]=c]=d,t.pop();for(p=0,f=a;p!==f;++p){var y;(y=r[p])[c]=y[v],y.pop()}}}this.nCachedObjects_=n},subscribe_:function(t,e){var n=this._bindingsIndicesByPath,i=n[t],r=this._bindings;if(void 0!==i)return r[i];var a=this._paths,o=this._parsedPaths,s=this._objects,l=s.length,c=this.nCachedObjects_,u=new Array(l);i=r.length,n[t]=i,a.push(t),o.push(e),r.push(u);for(var h=c,d=s.length;h!==d;++h){var p=s[h];u[h]=new ah(p,t,e)}return u},unsubscribe_:function(t){var e=this._bindingsIndicesByPath,n=e[t];if(void 0!==n){var i=this._paths,r=this._parsedPaths,a=this._bindings,o=a.length-1,s=a[o];a[e[t[o]]=n]=s,a.pop(),r[n]=r[o],r.pop(),i[n]=i[o],i.pop()}}}),Object.assign(sh.prototype,{play:function(){return this._mixer._activateAction(this),this},stop:function(){return this._mixer._deactivateAction(this),this.reset()},reset:function(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()},isRunning:function(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)},isScheduled:function(){return this._mixer._isActiveAction(this)},startAt:function(t){return this._startTime=t,this},setLoop:function(t,e){return this.loop=t,this.repetitions=e,this},setEffectiveWeight:function(t){return this.weight=t,this._effectiveWeight=this.enabled?t:0,this.stopFading()},getEffectiveWeight:function(){return this._effectiveWeight},fadeIn:function(t){return this._scheduleFading(t,0,1)},fadeOut:function(t){return this._scheduleFading(t,1,0)},crossFadeFrom:function(t,e,n){if(t.fadeOut(e),this.fadeIn(e),n){var i=this._clip.duration,r=t._clip.duration,a=r/i,o=i/r;t.warp(1,a,e),this.warp(o,1,e)}return this},crossFadeTo:function(t,e,n){return t.crossFadeFrom(this,e,n)},stopFading:function(){var t=this._weightInterpolant;return null!==t&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this},setEffectiveTimeScale:function(t){return this.timeScale=t,this._effectiveTimeScale=this.paused?0:t,this.stopWarping()},getEffectiveTimeScale:function(){return this._effectiveTimeScale},setDuration:function(t){return this.timeScale=this._clip.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._effectiveTimeScale,0,t)},warp:function(t,e,n){var i=this._mixer,r=i.time,a=this._timeScaleInterpolant,o=this.timeScale;null===a&&(a=i._lendControlInterpolant(),this._timeScaleInterpolant=a);var s=a.parameterPositions,l=a.sampleValues;return s[0]=r,s[1]=r+n,l[0]=t/o,l[1]=e/o,this},stopWarping:function(){var t=this._timeScaleInterpolant;return null!==t&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this},getMixer:function(){return this._mixer},getClip:function(){return this._clip},getRoot:function(){return this._localRoot||this._mixer._root},_update:function(t,e,n,i){if(this.enabled){var r=this._startTime;if(null!==r){var a=(t-r)*n;if(a<0||0===n)return;this._startTime=null,e=n*a}e*=this._updateTimeScale(t);var o=this._updateTime(e),s=this._updateWeight(t);if(0<s)for(var l=this._interpolants,c=this._propertyBindings,u=0,h=l.length;u!==h;++u)l[u].evaluate(o),c[u].accumulate(i,s)}else this._updateWeight(t)},_updateWeight:function(t){var e=0;if(this.enabled){e=this.weight;var n=this._weightInterpolant;if(null!==n){var i=n.evaluate(t)[0];e*=i,t>n.parameterPositions[1]&&(this.stopFading(),0===i&&(this.enabled=!1))}}return this._effectiveWeight=e},_updateTimeScale:function(t){var e=0;if(!this.paused){e=this.timeScale;var n=this._timeScaleInterpolant;if(null!==n)e*=n.evaluate(t)[0],t>n.parameterPositions[1]&&(this.stopWarping(),0===e?this.paused=!0:this.timeScale=e)}return this._effectiveTimeScale=e},_updateTime:function(t){var e=this.time+t,n=this._clip.duration,i=this.loop,r=this._loopCount,a=2202===i;if(0===t)return-1!==r&&a&&1==(1&r)?n-e:e;if(2200===i){-1===r&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(n<=e)e=n;else{if(!(e<0)){this.time=e;break t}e=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=e,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{if(-1===r&&(0<=t?(r=0,this._setEndings(!0,0===this.repetitions,a)):this._setEndings(0===this.repetitions,!0,a)),n<=e||e<0){var o=Math.floor(e/n);e-=n*o,r+=Math.abs(o);var s=this.repetitions-r;if(s<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,e=0<t?n:0,this.time=e,this._mixer.dispatchEvent({type:"finished",action:this,direction:0<t?1:-1});else{if(1==s){var l=t<0;this._setEndings(l,!l,a)}else this._setEndings(!1,!1,a);this._loopCount=r,this.time=e,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:o})}}else this.time=e;if(a&&1==(1&r))return n-e}return e},_setEndings:function(t,e,n){var i=this._interpolantSettings;n?(i.endingStart=pe,i.endingEnd=pe):(i.endingStart=t?this.zeroSlopeAtStart?pe:de:fe,i.endingEnd=e?this.zeroSlopeAtEnd?pe:de:fe)},_scheduleFading:function(t,e,n){var i=this._mixer,r=i.time,a=this._weightInterpolant;null===a&&(a=i._lendControlInterpolant(),this._weightInterpolant=a);var o=a.parameterPositions,s=a.sampleValues;return o[0]=r,s[0]=e,o[1]=r+t,s[1]=n,this}}),lh.prototype=Object.assign(Object.create(De.prototype),{constructor:lh,_bindAction:function(t,e){var n=t._localRoot||this._root,i=t._clip.tracks,r=i.length,a=t._propertyBindings,o=t._interpolants,s=n.uuid,l=this._bindingsByRootAndName,c=l[s];void 0===c&&(c={},l[s]=c);for(var u=0;u!==r;++u){var h=i[u],d=h.name,p=c[d];if(void 0!==p)a[u]=p;else{if(void 0!==(p=a[u])){null===p._cacheIndex&&(++p.referenceCount,this._addInactiveBinding(p,s,d));continue}var f=e&&e._propertyBindings[u].binding.parsedPath;++(p=new qu(ah.create(n,d,f),h.ValueTypeName,h.getValueSize())).referenceCount,this._addInactiveBinding(p,s,d),a[u]=p}o[u].resultBuffer=p.buffer}},_activateAction:function(t){if(!this._isActiveAction(t)){if(null===t._cacheIndex){var e=(t._localRoot||this._root).uuid,n=t._clip.uuid,i=this._actionsByClip[n];this._bindAction(t,i&&i.knownActions[0]),this._addInactiveAction(t,n,e)}for(var r=t._propertyBindings,a=0,o=r.length;a!==o;++a){var s=r[a];0==s.useCount++&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(t)}},_deactivateAction:function(t){if(this._isActiveAction(t)){for(var e=t._propertyBindings,n=0,i=e.length;n!==i;++n){var r=e[n];0==--r.useCount&&(r.restoreOriginalState(),this._takeBackBinding(r))}this._takeBackAction(t)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var t=this;this.stats={actions:{get total(){return t._actions.length},get inUse(){return t._nActiveActions}},bindings:{get total(){return t._bindings.length},get inUse(){return t._nActiveBindings}},controlInterpolants:{get total(){return t._controlInterpolants.length},get inUse(){return t._nActiveControlInterpolants}}}},_isActiveAction:function(t){var e=t._cacheIndex;return null!==e&&e<this._nActiveActions},_addInactiveAction:function(t,e,n){var i=this._actions,r=this._actionsByClip,a=r[e];if(void 0===a)a={knownActions:[t],actionByRoot:{}},t._byClipCacheIndex=0,r[e]=a;else{var o=a.knownActions;t._byClipCacheIndex=o.length,o.push(t)}t._cacheIndex=i.length,i.push(t),a.actionByRoot[n]=t},_removeInactiveAction:function(t){var e=this._actions,n=e[e.length-1],i=t._cacheIndex;e[n._cacheIndex=i]=n,e.pop(),t._cacheIndex=null;var r=t._clip.uuid,a=this._actionsByClip,o=a[r],s=o.knownActions,l=s[s.length-1],c=t._byClipCacheIndex;s[l._byClipCacheIndex=c]=l,s.pop(),t._byClipCacheIndex=null,delete o.actionByRoot[(t._localRoot||this._root).uuid],0===s.length&&delete a[r],this._removeInactiveBindingsForAction(t)},_removeInactiveBindingsForAction:function(t){for(var e=t._propertyBindings,n=0,i=e.length;n!==i;++n){var r=e[n];0==--r.referenceCount&&this._removeInactiveBinding(r)}},_lendAction:function(t){var e=this._actions,n=t._cacheIndex,i=this._nActiveActions++,r=e[i];e[t._cacheIndex=i]=t,e[r._cacheIndex=n]=r},_takeBackAction:function(t){var e=this._actions,n=t._cacheIndex,i=--this._nActiveActions,r=e[i];e[t._cacheIndex=i]=t,e[r._cacheIndex=n]=r},_addInactiveBinding:function(t,e,n){var i=this._bindingsByRootAndName,r=i[e],a=this._bindings;void 0===r&&(r={},i[e]=r),(r[n]=t)._cacheIndex=a.length,a.push(t)},_removeInactiveBinding:function(t){var e=this._bindings,n=t.binding,i=n.rootNode.uuid,r=n.path,a=this._bindingsByRootAndName,o=a[i],s=e[e.length-1],l=t._cacheIndex;e[s._cacheIndex=l]=s,e.pop(),delete o[r],0===Object.keys(o).length&&delete a[i]},_lendBinding:function(t){var e=this._bindings,n=t._cacheIndex,i=this._nActiveBindings++,r=e[i];e[t._cacheIndex=i]=t,e[r._cacheIndex=n]=r},_takeBackBinding:function(t){var e=this._bindings,n=t._cacheIndex,i=--this._nActiveBindings,r=e[i];e[t._cacheIndex=i]=t,e[r._cacheIndex=n]=r},_lendControlInterpolant:function(){var t=this._controlInterpolants,e=this._nActiveControlInterpolants++,n=t[e];return void 0===n&&(t[(n=new rc(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer)).__cacheIndex=e]=n),n},_takeBackControlInterpolant:function(t){var e=this._controlInterpolants,n=t.__cacheIndex,i=--this._nActiveControlInterpolants,r=e[i];e[t.__cacheIndex=i]=t,e[r.__cacheIndex=n]=r},_controlInterpolantsResultBuffer:new Float32Array(1),clipAction:function(t,e){var n=e||this._root,i=n.uuid,r="string"==typeof t?fc.findByName(n,t):t,a=null!==r?r.uuid:t,o=this._actionsByClip[a],s=null;if(void 0!==o){var l=o.actionByRoot[i];if(void 0!==l)return l;s=o.knownActions[0],null===r&&(r=s._clip)}if(null===r)return null;var c=new sh(this,r,e);return this._bindAction(c,s),this._addInactiveAction(c,a,i),c},existingAction:function(t,e){var n=e||this._root,i=n.uuid,r="string"==typeof t?fc.findByName(n,t):t,a=r?r.uuid:t,o=this._actionsByClip[a];return void 0!==o&&o.actionByRoot[i]||null},stopAllAction:function(){var t=this._actions,e=this._nActiveActions,n=this._bindings,i=this._nActiveBindings;this._nActiveActions=0;for(var r=this._nActiveBindings=0;r!==e;++r)t[r].reset();for(r=0;r!==i;++r)n[r].useCount=0;return this},update:function(t){t*=this.timeScale;for(var e=this._actions,n=this._nActiveActions,i=this.time+=t,r=Math.sign(t),a=this._accuIndex^=1,o=0;o!==n;++o){e[o]._update(i,t,r,a)}var s=this._bindings,l=this._nActiveBindings;for(o=0;o!==l;++o)s[o].apply(a);return this},setTime:function(t){for(var e=this.time=0;e<this._actions.length;e++)this._actions[e].time=0;return this.update(t)},getRoot:function(){return this._root},uncacheClip:function(t){var e=this._actions,n=t.uuid,i=this._actionsByClip,r=i[n];if(void 0!==r){for(var a=r.knownActions,o=0,s=a.length;o!==s;++o){var l=a[o];this._deactivateAction(l);var c=l._cacheIndex,u=e[e.length-1];l._cacheIndex=null,l._byClipCacheIndex=null,e[u._cacheIndex=c]=u,e.pop(),this._removeInactiveBindingsForAction(l)}delete i[n]}},uncacheRoot:function(t){var e=t.uuid,n=this._actionsByClip;for(var i in n){var r=n[i].actionByRoot[e];void 0!==r&&(this._deactivateAction(r),this._removeInactiveAction(r))}var a=this._bindingsByRootAndName[e];if(void 0!==a)for(var o in a){var s=a[o];s.restoreOriginalState(),this._removeInactiveBinding(s)}},uncacheAction:function(t,e){var n=this.existingAction(t,e);null!==n&&(this._deactivateAction(n),this._removeInactiveAction(n))}}),ch.prototype.clone=function(){return new ch(void 0===this.value.clone?this.value:this.value.clone())},uh.prototype=Object.assign(Object.create(Io.prototype),{constructor:uh,isInstancedInterleavedBuffer:!0,copy:function(t){return Io.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this}}),Object.assign(hh.prototype,{linePrecision:1,set:function(t,e){this.ray.set(t,e)},setFromCamera:function(t,e){e&&e.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(t.x,t.y,.5).unproject(e).sub(this.ray.origin).normalize(),this.camera=e):e&&e.isOrthographicCamera?(this.ray.origin.set(t.x,t.y,(e.near+e.far)/(e.near-e.far)).unproject(e),this.ray.direction.set(0,0,-1).transformDirection(e.matrixWorld),this.camera=e):console.error("THREE.Raycaster: Unsupported camera type.")},intersectObject:function(t,e,n){var i=n||[];return ph(t,this,i,e),i.sort(dh),i},intersectObjects:function(t,e,n){var i=n||[];if(!1===Array.isArray(t))return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),i;for(var r=0,a=t.length;r<a;r++)ph(t[r],this,i,e);return i.sort(dh),i}}),Object.assign(fh.prototype,{set:function(t,e,n){return this.radius=t,this.phi=e,this.theta=n,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,e,n){return this.radius=Math.sqrt(t*t+e*e+n*n),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(t,n),this.phi=Math.acos(Pe.clamp(e/this.radius,-1,1))),this}}),Object.assign(mh.prototype,{set:function(t,e,n){return this.radius=t,this.theta=e,this.y=n,this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.radius=t.radius,this.theta=t.theta,this.y=t.y,this},setFromVector3:function(t){return this.setFromCartesianCoords(t.x,t.y,t.z)},setFromCartesianCoords:function(t,e,n){return this.radius=Math.sqrt(t*t+n*n),this.theta=Math.atan2(t,n),this.y=e,this}});var gh=new Re;function vh(t,e){this.min=void 0!==t?t:new Re(1/0,1/0),this.max=void 0!==e?e:new Re(-1/0,-1/0)}Object.assign(vh.prototype,{set:function(t,e){return this.min.copy(t),this.max.copy(e),this},setFromPoints:function(t){this.makeEmpty();for(var e=0,n=t.length;e<n;e++)this.expandByPoint(t[e]);return this},setFromCenterAndSize:function(t,e){var n=gh.copy(e).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 Re),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 Re),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,e){return void 0===e&&(console.warn("THREE.Box2: .getParameter() target is now required"),e=new Re),e.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,e){return void 0===e&&(console.warn("THREE.Box2: .clampPoint() target is now required"),e=new Re),e.copy(t).clamp(this.min,this.max)},distanceToPoint:function(t){return gh.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 yh=new We,xh=new We;function _h(t,e){this.start=void 0!==t?t:new We,this.end=void 0!==e?e:new We}function wh(t){yn.call(this),this.material=t,this.render=function(){}}Object.assign(_h.prototype,{set:function(t,e){return this.start.copy(t),this.end.copy(e),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 We),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 We),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,e){return void 0===e&&(console.warn("THREE.Line3: .at() target is now required"),e=new We),this.delta(e).multiplyScalar(t).add(this.start)},closestPointToPointParameter:function(t,e){yh.subVectors(t,this.start),xh.subVectors(this.end,this.start);var n=xh.dot(xh),i=xh.dot(yh)/n;return e&&(i=Pe.clamp(i,0,1)),i},closestPointToPoint:function(t,e,n){var i=this.closestPointToPointParameter(t,e);return void 0===n&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),n=new We),this.delta(n).multiplyScalar(i).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)}}),((wh.prototype=Object.create(yn.prototype)).constructor=wh).prototype.isImmediateRenderObject=!0;var bh=new We;function Mh(t,e){yn.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=e;for(var n=new Bi,i=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1],r=0,a=1;r<32;r++,a++){var o=r/32*Math.PI*2,s=a/32*Math.PI*2;i.push(Math.cos(o),Math.sin(o),1,Math.cos(s),Math.sin(s),1)}n.setAttribute("position",new Ti(i,3));var l=new us({fog:!1});this.cone=new xs(n,l),this.add(this.cone),this.update()}((Mh.prototype=Object.create(yn.prototype)).constructor=Mh).prototype.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},Mh.prototype.update=function(){this.light.updateMatrixWorld();var t=this.light.distance?this.light.distance:1e3,e=t*Math.tan(this.light.angle);this.cone.scale.set(e,e,t),bh.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(bh),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)};var Sh=new We,Ch=new Qe,Th=new Qe;function Eh(t){for(var e=function t(e){var n=[];e&&e.isBone&&n.push(e);for(var i=0;i<e.children.length;i++)n.push.apply(n,t(e.children[i]));return n}(t),n=new Bi,i=[],r=[],a=new ci(0,0,1),o=new ci(0,1,0),s=0;s<e.length;s++){var l=e[s];l.parent&&l.parent.isBone&&(i.push(0,0,0),i.push(0,0,0),r.push(a.r,a.g,a.b),r.push(o.r,o.g,o.b))}n.setAttribute("position",new Ti(i,3)),n.setAttribute("color",new Ti(r,3));var c=new us({vertexColors:v,depthTest:!1,depthWrite:!1,transparent:!0});xs.call(this,n,c),this.root=t,this.bones=e,this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1}function Ah(t,e,n){this.light=t,this.light.updateMatrixWorld(),this.color=n;var i=new Al(e,4,2),r=new gi({wireframe:!0,fog:!1});er.call(this,i,r),this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}((Eh.prototype=Object.create(xs.prototype)).constructor=Eh).prototype.updateMatrixWorld=function(t){var e=this.bones,n=this.geometry,i=n.getAttribute("position");Th.getInverse(this.root.matrixWorld);for(var r=0,a=0;r<e.length;r++){var o=e[r];o.parent&&o.parent.isBone&&(Ch.multiplyMatrices(Th,o.matrixWorld),Sh.setFromMatrixPosition(Ch),i.setXYZ(a,Sh.x,Sh.y,Sh.z),Ch.multiplyMatrices(Th,o.parent.matrixWorld),Sh.setFromMatrixPosition(Ch),i.setXYZ(a+1,Sh.x,Sh.y,Sh.z),a+=2)}n.getAttribute("position").needsUpdate=!0,yn.prototype.updateMatrixWorld.call(this,t)},((Ah.prototype=Object.create(er.prototype)).constructor=Ah).prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},Ah.prototype.update=function(){void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)};var Dh=new We,Lh=new ci,Oh=new ci;function Ih(t,e,n){yn.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=n;var i=new Vs(e);i.rotateY(.5*Math.PI),this.material=new gi({wireframe:!0,fog:!1}),void 0===this.color&&(this.material.vertexColors=v);var r=i.getAttribute("position"),a=new Float32Array(3*r.count);i.setAttribute("color",new yi(a,3)),this.add(new er(i,this.material)),this.update()}function Ph(t,e,n,i){t=t||10,e=e||10,n=new ci(void 0!==n?n:4473924),i=new ci(void 0!==i?i:8947848);for(var r=e/2,a=t/e,o=t/2,s=[],l=[],c=0,u=0,h=-o;c<=e;c++,h+=a){s.push(-o,0,h,o,0,h),s.push(h,0,-o,h,0,o);var d=c===r?n:i;d.toArray(l,u),u+=3,d.toArray(l,u),u+=3,d.toArray(l,u),u+=3,d.toArray(l,u),u+=3}var p=new Bi;p.setAttribute("position",new Ti(s,3)),p.setAttribute("color",new Ti(l,3));var f=new us({vertexColors:v});xs.call(this,p,f)}function Rh(t,e,n,i,r,a){t=t||10,e=e||16,n=n||8,i=i||64,r=new ci(void 0!==r?r:4473924),a=new ci(void 0!==a?a:8947848);var o,s,l,c,u,h,d,p=[],f=[];for(c=0;c<=e;c++)l=c/e*(2*Math.PI),o=Math.sin(l)*t,s=Math.cos(l)*t,p.push(0,0,0),p.push(o,0,s),d=1&c?r:a,f.push(d.r,d.g,d.b),f.push(d.r,d.g,d.b);for(c=0;c<=n;c++)for(d=1&c?r:a,h=t-t/n*c,u=0;u<i;u++)l=u/i*(2*Math.PI),o=Math.sin(l)*h,s=Math.cos(l)*h,p.push(o,0,s),f.push(d.r,d.g,d.b),l=(u+1)/i*(2*Math.PI),o=Math.sin(l)*h,s=Math.cos(l)*h,p.push(o,0,s),f.push(d.r,d.g,d.b);var m=new Bi;m.setAttribute("position",new Ti(p,3)),m.setAttribute("color",new Ti(f,3));var g=new us({vertexColors:v});xs.call(this,m,g)}((Ih.prototype=Object.create(yn.prototype)).constructor=Ih).prototype.dispose=function(){this.children[0].geometry.dispose(),this.children[0].material.dispose()},Ih.prototype.update=function(){var t=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{var e=t.geometry.getAttribute("color");Lh.copy(this.light.color),Oh.copy(this.light.groundColor);for(var n=0,i=e.count;n<i;n++){var r=n<i/2?Lh:Oh;e.setXYZ(n,r.r,r.g,r.b)}e.needsUpdate=!0}t.lookAt(Dh.setFromMatrixPosition(this.light.matrixWorld).negate())},Ph.prototype=Object.assign(Object.create(xs.prototype),{constructor:Ph,copy:function(t){return xs.prototype.copy.call(this,t),this.geometry.copy(t.geometry),this.material.copy(t.material),this},clone:function(){return(new this.constructor).copy(this)}}),(Rh.prototype=Object.create(xs.prototype)).constructor=Rh;var kh=new We,Nh=new We,Bh=new We;function Fh(t,e,n){yn.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,void 0===e&&(e=1);var i=new Bi;i.setAttribute("position",new Ti([-e,e,0,e,e,0,e,-e,0,-e,-e,0,-e,e,0],3));var r=new us({fog:!1});this.lightPlane=new gs(i,r),this.add(this.lightPlane),(i=new Bi).setAttribute("position",new Ti([0,0,0,0,0,1],3)),this.targetLine=new gs(i,r),this.add(this.targetLine),this.update()}((Fh.prototype=Object.create(yn.prototype)).constructor=Fh).prototype.dispose=function(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()},Fh.prototype.update=function(){kh.setFromMatrixPosition(this.light.matrixWorld),Nh.setFromMatrixPosition(this.light.target.matrixWorld),Bh.subVectors(Nh,kh),this.lightPlane.lookAt(Nh),void 0!==this.color?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(Nh),this.targetLine.scale.z=Bh.length()};var zh=new We,Vh=new vr;function Uh(t){var e=new Bi,n=new us({color:16777215,vertexColors:1}),i=[],r=[],a={},o=new ci(16755200),s=new ci(16711680),l=new ci(43775),c=new ci(16777215),u=new ci(3355443);function h(t,e,n){d(t,n),d(e,n)}function d(t,e){i.push(0,0,0),r.push(e.r,e.g,e.b),void 0===a[t]&&(a[t]=[]),a[t].push(i.length/3-1)}h("n1","n2",o),h("n2","n4",o),h("n4","n3",o),h("n3","n1",o),h("f1","f2",o),h("f2","f4",o),h("f4","f3",o),h("f3","f1",o),h("n1","f1",o),h("n2","f2",o),h("n3","f3",o),h("n4","f4",o),h("p","n1",s),h("p","n2",s),h("p","n3",s),h("p","n4",s),h("u1","u2",l),h("u2","u3",l),h("u3","u1",l),h("c","t",c),h("p","c",u),h("cn1","cn2",u),h("cn3","cn4",u),h("cf1","cf2",u),h("cf3","cf4",u),e.setAttribute("position",new Ti(i,3)),e.setAttribute("color",new Ti(r,3)),xs.call(this,e,n),this.camera=t,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=a,this.update()}function jh(t,e,n,i,r,a,o){zh.set(r,a,o).unproject(i);var s=e[t];if(void 0!==s)for(var l=n.getAttribute("position"),c=0,u=s.length;c<u;c++)l.setXYZ(s[c],zh.x,zh.y,zh.z)}((Uh.prototype=Object.create(xs.prototype)).constructor=Uh).prototype.update=function(){var t=this.geometry,e=this.pointMap;Vh.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),jh("c",e,t,Vh,0,0,-1),jh("t",e,t,Vh,0,0,1),jh("n1",e,t,Vh,-1,-1,-1),jh("n2",e,t,Vh,1,-1,-1),jh("n3",e,t,Vh,-1,1,-1),jh("n4",e,t,Vh,1,1,-1),jh("f1",e,t,Vh,-1,-1,1),jh("f2",e,t,Vh,1,-1,1),jh("f3",e,t,Vh,-1,1,1),jh("f4",e,t,Vh,1,1,1),jh("u1",e,t,Vh,.7,1.1,-1),jh("u2",e,t,Vh,-.7,1.1,-1),jh("u3",e,t,Vh,0,2,-1),jh("cf1",e,t,Vh,-1,0,1),jh("cf2",e,t,Vh,1,0,1),jh("cf3",e,t,Vh,0,-1,1),jh("cf4",e,t,Vh,0,1,1),jh("cn1",e,t,Vh,-1,0,-1),jh("cn2",e,t,Vh,1,0,-1),jh("cn3",e,t,Vh,0,-1,-1),jh("cn4",e,t,Vh,0,1,-1),t.getAttribute("position").needsUpdate=!0};var Gh=new Pn;function Hh(t,e){this.object=t,void 0===e&&(e=16776960);var n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=new Float32Array(24),r=new Bi;r.setIndex(new yi(n,1)),r.setAttribute("position",new yi(i,3)),xs.call(this,r,new us({color:e})),this.matrixAutoUpdate=!1,this.update()}function Wh(t,e){this.type="Box3Helper",this.box=t,e=e||16776960;var n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=new Bi;i.setIndex(new yi(n,1)),i.setAttribute("position",new Ti([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3)),xs.call(this,i,new us({color:e})),this.geometry.computeBoundingSphere()}function Jh(t,e,n){this.type="PlaneHelper",this.plane=t,this.size=void 0===e?1:e;var i=void 0!==n?n:16776960,r=new Bi;r.setAttribute("position",new Ti([1,-1,1,-1,1,1,-1,-1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,0,0,1,0,0,0],3)),r.computeBoundingSphere(),gs.call(this,r,new us({color:i}));var a=new Bi;a.setAttribute("position",new Ti([1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],3)),a.computeBoundingSphere(),this.add(new er(a,new gi({color:i,opacity:.2,transparent:!0,depthWrite:!1})))}((Hh.prototype=Object.create(xs.prototype)).constructor=Hh).prototype.update=function(t){if(void 0!==t&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&Gh.setFromObject(this.object),!Gh.isEmpty()){var e=Gh.min,n=Gh.max,i=this.geometry.attributes.position,r=i.array;r[0]=n.x,r[1]=n.y,r[2]=n.z,r[3]=e.x,r[4]=n.y,r[5]=n.z,r[6]=e.x,r[7]=e.y,r[8]=n.z,r[9]=n.x,r[10]=e.y,r[11]=n.z,r[12]=n.x,r[13]=n.y,r[14]=e.z,r[15]=e.x,r[16]=n.y,r[17]=e.z,r[18]=e.x,r[19]=e.y,r[20]=e.z,r[21]=n.x,r[22]=e.y,r[23]=e.z,i.needsUpdate=!0,this.geometry.computeBoundingSphere()}},Hh.prototype.setFromObject=function(t){return this.object=t,this.update(),this},Hh.prototype.copy=function(t){return xs.prototype.copy.call(this,t),this.object=t.object,this},Hh.prototype.clone=function(){return(new this.constructor).copy(this)},((Wh.prototype=Object.create(xs.prototype)).constructor=Wh).prototype.updateMatrixWorld=function(t){var e=this.box;e.isEmpty()||(e.getCenter(this.position),e.getSize(this.scale),this.scale.multiplyScalar(.5),yn.prototype.updateMatrixWorld.call(this,t))},((Jh.prototype=Object.create(gs.prototype)).constructor=Jh).prototype.updateMatrixWorld=function(t){var e=-this.plane.constant;Math.abs(e)<1e-8&&(e=1e-8),this.scale.set(.5*this.size,.5*this.size,e),this.children[0].material.side=e<0?St:O,this.lookAt(this.plane.normal),yn.prototype.updateMatrixWorld.call(this,t)};var qh,Xh,Yh=new We;function Zh(t,e,n,i,r,a){yn.call(this),void 0===t&&(t=new We(0,0,1)),void 0===e&&(e=new We(0,0,0)),void 0===n&&(n=1),void 0===i&&(i=16776960),void 0===r&&(r=.2*n),void 0===a&&(a=.2*r),void 0===qh&&((qh=new Bi).setAttribute("position",new Ti([0,0,0,0,1,0],3)),(Xh=new Fl(0,.5,1,5,1)).translate(0,-.5,0)),this.position.copy(e),this.line=new gs(qh,new us({color:i})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new er(Xh,new gi({color:i})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(t),this.setLength(n,r,a)}function $h(t){var e=[0,0,0,t=t||1,0,0,0,0,0,0,t,0,0,0,0,0,0,t],n=new Bi;n.setAttribute("position",new Ti(e,3)),n.setAttribute("color",new Ti([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3));var i=new us({vertexColors:v});xs.call(this,n,i)}((Zh.prototype=Object.create(yn.prototype)).constructor=Zh).prototype.setDirection=function(t){if(.99999<t.y)this.quaternion.set(0,0,0,1);else if(t.y<-.99999)this.quaternion.set(1,0,0,0);else{Yh.set(t.z,0,-t.x).normalize();var e=Math.acos(t.y);this.quaternion.setFromAxisAngle(Yh,e)}},Zh.prototype.setLength=function(t,e,n){void 0===e&&(e=.2*t),void 0===n&&(n=.2*e),this.line.scale.set(1,Math.max(1e-4,t-e),1),this.line.updateMatrix(),this.cone.scale.set(n,e,n),this.cone.position.y=t,this.cone.updateMatrix()},Zh.prototype.setColor=function(t){this.line.material.color.set(t),this.cone.material.color.set(t)},Zh.prototype.copy=function(t){return yn.prototype.copy.call(this,t,!1),this.line.copy(t.line),this.cone.copy(t.cone),this},Zh.prototype.clone=function(){return(new this.constructor).copy(this)},($h.prototype=Object.create(xs.prototype)).constructor=$h;var Kh=4,Qh=8,td=Math.pow(2,Qh),ed=[.125,.215,.35,.446,.526,.582],nd=Qh-Kh+1+ed.length,id=20,rd={};rd[me]=0,rd[e]=1,rd[ge]=2,rd[ye]=3,rd[xe]=4,rd[_e]=5,rd[n]=6;var ad,od,sd,ld,cd=new ru,ud=(ad=id,od=new Float32Array(ad),sd=new We(0,1,0),(ld=new Wl({defines:{n:ad},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:od},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:sd},inputEncoding:{value:rd[me]},outputEncoding:{value:rd[me]}},vertexShader:Rd(),fragmentShader:"\nprecision mediump float;\nprecision mediump int;\nvarying vec3 vOutputDirection;\nuniform sampler2D envMap;\nuniform int samples;\nuniform float weights[n];\nuniform bool latitudinal;\nuniform float dTheta;\nuniform float mipInt;\nuniform vec3 poleAxis;\n\n"+kd()+"\n\n#define ENVMAP_TYPE_CUBE_UV\n#include <cube_uv_reflection_fragment>\n\nvoid main() {\n\tgl_FragColor = vec4(0.0);\n\tfor (int i = 0; i < n; i++) {\n\t\tif (i >= samples)\n\t\t\tbreak;\n\t\tfor (int dir = -1; dir < 2; dir += 2) {\n\t\t\tif (i == 0 && dir == 1)\n\t\t\t\tcontinue;\n\t\t\tvec3 axis = latitudinal ? poleAxis : cross(poleAxis, vOutputDirection);\n\t\t\tif (all(equal(axis, vec3(0.0))))\n\t\t\t\taxis = cross(vec3(0.0, 1.0, 0.0), vOutputDirection);\n\t\t\taxis = normalize(axis);\n\t\t\tfloat theta = dTheta * float(dir * i);\n\t\t\tfloat cosTheta = cos(theta);\n\t\t\t// Rodrigues' axis-angle rotation\n\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross(axis, vOutputDirection) * sin(theta)\n\t\t\t\t\t+ axis * dot(axis, vOutputDirection) * (1.0 - cosTheta);\n\t\t\tgl_FragColor.rgb +=\n\t\t\t\t\tweights[i] * bilinearCubeUV(envMap, sampleDirection, mipInt);\n\t\t}\n\t}\n\tgl_FragColor = linearToOutputTexel(gl_FragColor);\n}\n\t\t",blending:K,depthTest:!1,depthWrite:!1})).type="SphericalGaussianBlur",ld),hd=null,dd=null,pd=function(){for(var t=[],e=[],n=[],i=Qh,r=0;r<nd;r++){var a=Math.pow(2,i);e.push(a);var o=1/a;Qh-Kh<r?o=ed[r-Qh+Kh-1]:0==r&&(o=0),n.push(o);for(var s=1/(a-1),l=-s/2,c=1+s/2,u=[l,l,c,l,c,c,l,l,c,c,l,c],h=new Float32Array(108),d=new Float32Array(72),p=new Float32Array(36),f=0;f<6;f++){var m=f%3*2/3-1,g=2<f?0:-1,v=[m,g,0,m+2/3,g,0,m+2/3,1+g,0,m,g,0,m+2/3,1+g,0,m,1+g,0];h.set(v,18*f),d.set(u,12*f);var y=[f,f,f,f,f,f];p.set(y,6*f)}var x=new Bi;x.setAttribute("position",new yi(h,3)),x.setAttribute("uv",new yi(d,2)),x.setAttribute("faceIndex",new yi(p,1)),t.push(x),Kh<i&&i--}return{_lodPlanes:t,_sizeLods:e,_sigmas:n}}(),fd=pd._lodPlanes,md=pd._sizeLods,gd=pd._sigmas,vd=null,yd=null,xd=null,_d=(1+Math.sqrt(5))/2,wd=1/_d,bd=[new We(1,1,1),new We(-1,1,1),new We(1,1,-1),new We(-1,1,-1),new We(0,_d,wd),new We(0,_d,-wd),new We(wd,0,_d),new We(-wd,0,_d),new We(_d,wd,0),new We(-_d,wd,0)];function Md(t){yd=t,Td(ud)}function Sd(t){var e={magFilter:Ut,minFilter:Ut,generateMipmaps:!1,type:t?t.type:qt,format:t?t.format:i,encoding:t?t.encoding:ge,depthBuffer:!1,stencilBuffer:!1},n=Ed(e);return n.depthBuffer=!t,vd=Ed(e),n}function Cd(t){vd.dispose(),yd.setRenderTarget(xd),t.scissorTest=!1,t.setSize(t.width,t.height)}function Td(t){var e=new xn;e.add(new er(fd[0],t)),yd.compile(e,cd)}function Ed(t){var e=new Ve(3*td,3*td,t);return e.texture.mapping=Nt,e.texture.name="PMREM.cubeUv",e.scissorTest=!0,e}function Ad(t,e,n,i,r){t.viewport.set(e,n,i,r),t.scissor.set(e,n,i,r)}function Dd(t){var e=yd.autoClear;yd.autoClear=!1;for(var n=1;n<nd;n++){Ld(t,n-1,n,Math.sqrt(gd[n]*gd[n]-gd[n-1]*gd[n-1]),bd[(n-1)%bd.length])}yd.autoClear=e}function Ld(t,e,n,i,r){Od(t,vd,e,n,i,"latitudinal",r),Od(vd,t,n,n,i,"longitudinal",r)}function Od(t,e,n,i,r,a,o){"latitudinal"!==a&&"longitudinal"!==a&&console.error("blur direction must be either latitudinal or longitudinal!");var s=new xn;s.add(new er(fd[i],ud));var l=ud.uniforms,c=md[n]-1,u=isFinite(r)?Math.PI/(2*c):2*Math.PI/(2*id-1),h=r/u,d=isFinite(r)?1+Math.floor(3*h):id;id<d&&console.warn("sigmaRadians, "+r+", is too large and will clip, as it requested "+d+" samples when the maximum is set to "+id);for(var p=[],f=0,m=0;m<id;++m){var g=m/h,v=Math.exp(-g*g/2);p.push(v),0==m?f+=v:m<d&&(f+=2*v)}for(m=0;m<p.length;m++)p[m]=p[m]/f;l.envMap.value=t.texture,l.samples.value=d,l.weights.value=p,l.latitudinal.value="latitudinal"===a,o&&(l.poleAxis.value=o),l.dTheta.value=u,l.mipInt.value=Qh-n,l.inputEncoding.value=rd[t.texture.encoding],l.outputEncoding.value=rd[t.texture.encoding];var y=md[i];Ad(e,g=3*Math.max(0,td-2*y),(0===i?0:2*td)+2*y*(Qh-Kh<i?i-Qh+Kh:0),3*y,2*y),yd.setRenderTarget(e),yd.render(s,cd)}function Id(){var t=new Wl({uniforms:{envMap:{value:null},texelSize:{value:new Re(1,1)},inputEncoding:{value:rd[me]},outputEncoding:{value:rd[me]}},vertexShader:Rd(),fragmentShader:"\nprecision mediump float;\nprecision mediump int;\nvarying vec3 vOutputDirection;\nuniform sampler2D envMap;\nuniform vec2 texelSize;\n\n"+kd()+"\n\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n\nvoid main() {\n\tgl_FragColor = vec4(0.0);\n\tvec3 outputDirection = normalize(vOutputDirection);\n\tvec2 uv;\n\tuv.y = asin(clamp(outputDirection.y, -1.0, 1.0)) * RECIPROCAL_PI + 0.5;\n\tuv.x = atan(outputDirection.z, outputDirection.x) * RECIPROCAL_PI2 + 0.5;\n\tvec2 f = fract(uv / texelSize - 0.5);\n\tuv -= f * texelSize;\n\tvec3 tl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\tuv.x += texelSize.x;\n\tvec3 tr = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\tuv.y += texelSize.y;\n\tvec3 br = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\tuv.x -= texelSize.x;\n\tvec3 bl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\tvec3 tm = mix(tl, tr, f.x);\n\tvec3 bm = mix(bl, br, f.x);\n\tgl_FragColor.rgb = mix(tm, bm, f.y);\n\tgl_FragColor = linearToOutputTexel(gl_FragColor);\n}\n\t\t",blending:K,depthTest:!1,depthWrite:!1});return t.type="EquirectangularToCubeUV",t}function Pd(){var t=new Wl({uniforms:{envMap:{value:null},inputEncoding:{value:rd[me]},outputEncoding:{value:rd[me]}},vertexShader:Rd(),fragmentShader:"\nprecision mediump float;\nprecision mediump int;\nvarying vec3 vOutputDirection;\nuniform samplerCube envMap;\n\n"+kd()+"\n\nvoid main() {\n\tgl_FragColor = vec4(0.0);\n\tgl_FragColor.rgb = envMapTexelToLinear(textureCube(envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ))).rgb;\n\tgl_FragColor = linearToOutputTexel(gl_FragColor);\n}\n\t\t",blending:K,depthTest:!1,depthWrite:!1});return t.type="CubemapToCubeUV",t}function Rd(){return"\nprecision mediump float;\nprecision mediump int;\nattribute vec3 position;\nattribute vec2 uv;\nattribute float faceIndex;\nvarying vec3 vOutputDirection;\nvec3 getDirection(vec2 uv, float face) {\n\tuv = 2.0 * uv - 1.0;\n\tvec3 direction = vec3(uv, 1.0);\n\tif (face == 0.0) {\n\t\tdirection = direction.zyx;\n\t\tdirection.z *= -1.0;\n\t} else if (face == 1.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.z *= -1.0;\n\t} else if (face == 3.0) {\n\t\tdirection = direction.zyx;\n\t\tdirection.x *= -1.0;\n\t} else if (face == 4.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.y *= -1.0;\n\t} else if (face == 5.0) {\n\t\tdirection.xz *= -1.0;\n\t}\n\treturn direction;\n}\nvoid main() {\n\tvOutputDirection = getDirection(uv, faceIndex);\n\tgl_Position = vec4( position, 1.0 );\n}\n\t"}function kd(){return"\nuniform int inputEncoding;\nuniform int outputEncoding;\n\n#include <encodings_pars_fragment>\n\nvec4 inputTexelToLinear(vec4 value){\n\tif(inputEncoding == 0){\n\t\treturn value;\n\t}else if(inputEncoding == 1){\n\t\treturn sRGBToLinear(value);\n\t}else if(inputEncoding == 2){\n\t\treturn RGBEToLinear(value);\n\t}else if(inputEncoding == 3){\n\t\treturn RGBMToLinear(value, 7.0);\n\t}else if(inputEncoding == 4){\n\t\treturn RGBMToLinear(value, 16.0);\n\t}else if(inputEncoding == 5){\n\t\treturn RGBDToLinear(value, 256.0);\n\t}else{\n\t\treturn GammaToLinear(value, 2.2);\n\t}\n}\n\nvec4 linearToOutputTexel(vec4 value){\n\tif(outputEncoding == 0){\n\t\treturn value;\n\t}else if(outputEncoding == 1){\n\t\treturn LinearTosRGB(value);\n\t}else if(outputEncoding == 2){\n\t\treturn LinearToRGBE(value);\n\t}else if(outputEncoding == 3){\n\t\treturn LinearToRGBM(value, 7.0);\n\t}else if(outputEncoding == 4){\n\t\treturn LinearToRGBM(value, 16.0);\n\t}else if(outputEncoding == 5){\n\t\treturn LinearToRGBD(value, 256.0);\n\t}else{\n\t\treturn LinearToGamma(value, 2.2);\n\t}\n}\n\nvec4 envMapTexelToLinear(vec4 color) {\n\treturn inputTexelToLinear(color);\n}\n\t"}Md.prototype={constructor:Md,fromScene:function(t,e,n,i){void 0===e&&(e=0),void 0===n&&(n=.1),void 0===i&&(i=100),xd=yd.getRenderTarget();var r=Sd();return function(t,e,n,i){var r=new yr(90,1,e,n),a=[1,1,1,1,-1,1],o=[1,1,-1,-1,-1,1],s=yd.outputEncoding,l=yd.toneMapping,c=yd.toneMappingExposure,u=yd.getClearColor(),h=yd.getClearAlpha();yd.toneMapping=Dt,yd.toneMappingExposure=1,yd.outputEncoding=me,t.scale.z*=-1;var d=t.background;if(d&&d.isColor){d.convertSRGBToLinear();var p=Math.max(d.r,d.g,d.b),f=Math.min(Math.max(Math.ceil(Math.log2(p)),-128),127);d=d.multiplyScalar(Math.pow(2,-f));var m=(f+128)/255;yd.setClearColor(d,m),t.background=null}for(var g=0;g<6;g++){var v=g%3;0==v?(r.up.set(0,a[g],0),r.lookAt(o[g],0,0)):1==v?(r.up.set(0,0,a[g]),r.lookAt(0,o[g],0)):(r.up.set(0,a[g],0),r.lookAt(0,0,o[g])),Ad(i,v*td,2<g?td:0,td,td),yd.setRenderTarget(i),yd.render(t,r)}yd.toneMapping=l,yd.toneMappingExposure=c,yd.outputEncoding=s,yd.setClearColor(u,h),t.scale.z*=-1}(t,n,i,r),0<e&&Ld(r,0,0,e),Dd(r),Cd(r),r},fromEquirectangular:function(t){return t.magFilter=Ut,t.minFilter=Ut,t.generateMipmaps=!1,this.fromCubemap(t)},fromCubemap:function(t){xd=yd.getRenderTarget();var e=Sd(t);return function(t,e){var n=new xn;t.isCubeTexture?null==dd&&(dd=Pd()):null==hd&&(hd=Id());var i=t.isCubeTexture?dd:hd;n.add(new er(fd[0],i));var r=i.uniforms;(r.envMap.value=t).isCubeTexture||r.texelSize.value.set(1/t.image.width,1/t.image.height);r.inputEncoding.value=rd[t.encoding],r.outputEncoding.value=rd[t.encoding],Ad(e,0,0,3*td,2*td),yd.setRenderTarget(e),yd.render(n,cd)}(t,e),Dd(e),Cd(e),e},compileCubemapShader:function(){null==dd&&Td(dd=Pd())},compileEquirectangularShader:function(){null==hd&&Td(hd=Id())},dispose:function(){ud.dispose(),null!=dd&&dd.dispose(),null!=hd&&hd.dispose();for(var t=0;t<fd.length;t++)fd[t].dispose()}};function Nd(t){console.warn("THREE.ClosedSplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),Nc.call(this,t),this.type="catmullrom",this.closed=!0}function Bd(t){console.warn("THREE.SplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),Nc.call(this,t),this.type="catmullrom"}function Fd(t){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead."),Nc.call(this,t),this.type="catmullrom"}Ac.create=function(t,e){return console.log("THREE.Curve.create() has been deprecated"),t.prototype=Object.create(Ac.prototype),(t.prototype.constructor=t).prototype.getPoint=e,t},Object.assign(Xc.prototype,{createPointsGeometry:function(t){console.warn("THREE.CurvePath: .createPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var e=this.getPoints(t);return this.createGeometry(e)},createSpacedPointsGeometry:function(t){console.warn("THREE.CurvePath: .createSpacedPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var e=this.getSpacedPoints(t);return this.createGeometry(e)},createGeometry:function(t){console.warn("THREE.CurvePath: .createGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");for(var e=new lr,n=0,i=t.length;n<i;n++){var r=t[n];e.vertices.push(new We(r.x,r.y,r.z||0))}return e}}),Object.assign(Yc.prototype,{fromPoints:function(t){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(t)}}),Nd.prototype=Object.create(Nc.prototype),Bd.prototype=Object.create(Nc.prototype),Fd.prototype=Object.create(Nc.prototype),Object.assign(Fd.prototype,{initFromArray:function(){console.error("THREE.Spline: .initFromArray() has been removed.")},getControlPointsArray:function(){console.error("THREE.Spline: .getControlPointsArray() has been removed.")},reparametrizeByArcLength:function(){console.error("THREE.Spline: .reparametrizeByArcLength() has been removed.")}}),Ph.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},Eh.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")},Object.assign(xc.prototype,{extractUrlBase:function(t){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),uu.extractUrlBase(t)}}),xc.Handlers={add:function(){console.error("THREE.Loader: Handlers.add() has been removed. Use LoadingManager.addHandler() instead.")},get:function(){console.error("THREE.Loader: Handlers.get() has been removed. Use LoadingManager.getHandler() instead.")}},Object.assign(mu.prototype,{setTexturePath:function(t){return console.warn("THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath()."),this.setResourcePath(t)}}),Object.assign(vh.prototype,{center:function(t){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(t)},empty:function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(t){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},size:function(t){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(t)}}),Object.assign(Pn.prototype,{center:function(t){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(t)},empty:function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(t){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},isIntersectionSphere:function(t){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)},size:function(t){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(t)}}),Sr.prototype.setFromMatrix=function(t){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(t)},_h.prototype.center=function(t){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(t)},Object.assign(Pe,{random16:function(){return console.warn("THREE.Math: .random16() has been deprecated. Use Math.random() instead."),Math.random()},nearestPowerOfTwo:function(t){return console.warn("THREE.Math: .nearestPowerOfTwo() has been renamed to .floorPowerOfTwo()."),Pe.floorPowerOfTwo(t)},nextPowerOfTwo:function(t){return console.warn("THREE.Math: .nextPowerOfTwo() has been renamed to .ceilPowerOfTwo()."),Pe.ceilPowerOfTwo(t)}}),Object.assign(ke.prototype,{flattenToArrayOffset:function(t,e){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(t,e)},multiplyVector3:function(t){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),t.applyMatrix3(this)},multiplyVector3Array:function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},applyToBufferAttribute:function(t){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."),t.applyMatrix3(this)},applyToVector3Array:function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")}}),Object.assign(Qe.prototype,{extractPosition:function(t){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(t)},flattenToArrayOffset:function(t,e){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(t,e)},getPosition:function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),(new We).setFromMatrixColumn(this,3)},setRotationFromQuaternion:function(t){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(t)},multiplyToArray:function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},multiplyVector3:function(t){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},multiplyVector4:function(t){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},multiplyVector3Array:function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},rotateAxis:function(t){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),t.transformDirection(this)},crossVector:function(t){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},translate:function(){console.error("THREE.Matrix4: .translate() has been removed.")},rotateX:function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},applyToBufferAttribute:function(t){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},applyToVector3Array:function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},makeFrustum:function(t,e,n,i,r,a){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(t,e,i,n,r,a)}}),Xn.prototype.isIntersectionLine=function(t){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(t)},je.prototype.multiplyVector3=function(t){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),t.applyQuaternion(this)},Object.assign(Hn.prototype,{isIntersectionBox:function(t){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},isIntersectionPlane:function(t){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(t)},isIntersectionSphere:function(t){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)}}),Object.assign(ai.prototype,{area:function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},barycoordFromPoint:function(t,e){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(t,e)},midpoint:function(t){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(t)},normal:function(t){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(t)},plane:function(t){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(t)}}),Object.assign(ai,{barycoordFromPoint:function(t,e,n,i,r){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),ai.getBarycoord(t,e,n,i,r)},normal:function(t,e,n,i){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),ai.getNormal(t,e,n,i)}}),Object.assign(Zc.prototype,{extractAllPoints:function(t){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(t)},extrude:function(t){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new wl(this,t)},makeGeometry:function(t){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new Pl(this,t)}}),Object.assign(Re.prototype,{fromAttribute:function(t,e,n){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,n)},distanceToManhattan:function(t){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(t)},lengthManhattan:function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(We.prototype,{setEulerFromRotationMatrix:function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(t){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(t)},getScaleFromMatrix:function(t){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(t)},getColumnFromMatrix:function(t,e){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(e,t)},applyProjection:function(t){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(t)},fromAttribute:function(t,e,n){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,n)},distanceToManhattan:function(t){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(t)},lengthManhattan:function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(ze.prototype,{fromAttribute:function(t,e,n){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,n)},lengthManhattan:function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(lr.prototype,{computeTangents:function(){console.error("THREE.Geometry: .computeTangents() has been removed.")},computeLineDistances:function(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")},applyMatrix:function(t){return console.warn("THREE.Geometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(t)}}),Object.assign(yn.prototype,{getChildByName:function(t){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(t)},renderDepth:function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},translate:function(t,e){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(e,t)},getWorldRotation:function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")},applyMatrix:function(t){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(t)}}),Object.defineProperties(yn.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(t){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=t}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),Object.assign(er.prototype,{setDrawMode:function(){console.error("THREE.Mesh: .setDrawMode() has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}),Object.defineProperties(er.prototype,{drawMode:{get:function(){return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."),0},set:function(){console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}}),Object.defineProperties(Qo.prototype,{objects:{get:function(){return console.warn("THREE.LOD: .objects has been renamed to .levels."),this.levels}}}),Object.defineProperty(is.prototype,"useVertexTexture",{get:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")},set:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")}}),ts.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},Object.defineProperty(Ac.prototype,"__arcLengthDivisions",{get:function(){return console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions},set:function(t){console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions=t}}),yr.prototype.setLens=function(t,e){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==e&&(this.filmGauge=e),this.setFocalLength(t)},Object.defineProperties($c.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(t){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=t}},shadowCameraLeft:{set:function(t){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=t}},shadowCameraRight:{set:function(t){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=t}},shadowCameraTop:{set:function(t){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=t}},shadowCameraBottom:{set:function(t){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=t}},shadowCameraNear:{set:function(t){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=t}},shadowCameraFar:{set:function(t){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=t}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(t){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=t}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(t){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=t}},shadowMapHeight:{set:function(t){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=t}}}),Object.defineProperties(yi.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},dynamic:{get:function(){return console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.usage===Ae},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(Ae)}}}),Object.assign(yi.prototype,{setDynamic:function(t){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===t?Ae:Ee),this},copyIndicesArray:function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")},setArray:function(){console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(Bi.prototype,{addIndex:function(t){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(t)},addAttribute:function(t,e){return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."),e&&e.isBufferAttribute||e&&e.isInterleavedBufferAttribute?"index"===t?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(e),this):this.setAttribute(t,e):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(t,new yi(e,arguments[2])))},addDrawCall:function(t,e,n){void 0!==n&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(t,e)},clearDrawCalls:function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},computeTangents:function(){console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")},computeOffsets:function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")},removeAttribute:function(t){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(t)},applyMatrix:function(t){return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(t)}}),Object.defineProperties(Bi.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}}),Object.defineProperties(Io.prototype,{dynamic:{get:function(){return console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),this.usage===Ae},set:function(t){console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),this.setUsage(t)}}}),Object.assign(Io.prototype,{setDynamic:function(t){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===t?Ae:Ee),this},setArray:function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(bl.prototype,{getArrays:function(){console.error("THREE.ExtrudeBufferGeometry: .getArrays() has been removed.")},addShapeList:function(){console.error("THREE.ExtrudeBufferGeometry: .addShapeList() has been removed.")},addShape:function(){console.error("THREE.ExtrudeBufferGeometry: .addShape() has been removed.")}}),Object.defineProperties(ch.prototype,{dynamic:{set:function(){console.warn("THREE.Uniform: .dynamic has been removed. Use object.onBeforeRender() instead.")}},onUpdate:{value:function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this}}}),Object.defineProperties(mi.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")},set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},overdraw:{get:function(){console.warn("THREE.Material: .overdraw has been removed.")},set:function(){console.warn("THREE.Material: .overdraw has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new ci}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(t){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===t}},stencilMask:{get:function(){return console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask},set:function(t){console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask=t}}}),Object.defineProperties(Xl.prototype,{metal:{get:function(){return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),!1},set:function(){console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")}}}),Object.defineProperties(gr.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(t){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=t}}}),Object.assign(Do.prototype,{clearTarget:function(t,e,n,i){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(t),this.clear(e,n,i)},animate:function(t){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(t)},getCurrentRenderTarget:function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},getMaxAnisotropy:function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},getPrecision:function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},resetGLState:function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},supportsFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},supportsHalfFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},supportsStandardDerivatives:function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},supportsCompressedTextureS3TC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},supportsCompressedTexturePVRTC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},supportsBlendMinMax:function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},supportsVertexTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},supportsInstancedArrays:function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},enableScissorTest:function(t){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(t)},initMaterial:function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},addPrePlugin:function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},addPostPlugin:function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},updateShadowMap:function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},setFaceCulling:function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")},allocTextureUnit:function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")},setTexture:function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")},setTexture2D:function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")},setTextureCube:function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")},getActiveMipMapLevel:function(){return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."),this.getActiveMipmapLevel()}}),Object.defineProperties(Do.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=t}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=t}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}},context:{get:function(){return console.warn("THREE.WebGLRenderer: .context has been removed. Use .getContext() instead."),this.getContext()}},vr:{get:function(){return console.warn("THREE.WebGLRenderer: .vr has been renamed to .xr"),this.xr}},gammaInput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead."),!1},set:function(){console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.")}},gammaOutput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),!1},set:function(t){console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),this.outputEncoding=!0===t?e:me}}}),Object.defineProperties(_o.prototype,{cullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},renderReverseSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},renderSingleSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}}),Object.defineProperties(Ve.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(t){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=t}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(t){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=t}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(t){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=t}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(t){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=t}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(t){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=t}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(t){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=t}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(t){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=t}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(t){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=t}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(t){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=t}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(t){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=t}}}),Object.defineProperties(Vu.prototype,{load:{value:function(t){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");var e=this;return(new Tu).load(t,function(t){e.setBuffer(t)}),this}},startTime:{set:function(){console.warn("THREE.Audio: .startTime is now .play( delay ).")}}}),Ju.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()},xr.prototype.updateCubeMap=function(t,e){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(t,e)};var zd={merge:function(t,e,n){var i;console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead."),e.isMesh&&(e.matrixAutoUpdate&&e.updateMatrix(),i=e.matrix,e=e.geometry),t.merge(e,i,n)},center:function(t){return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),t.center()}};Ne.crossOrigin=void 0,Ne.loadTexture=function(t,e,n,i){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");var r=new Ec;r.setCrossOrigin(this.crossOrigin);var a=r.load(t,n,void 0,i);return e&&(a.mapping=e),a},Ne.loadTextureCube=function(t,e,n,i){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");var r=new Tc;r.setCrossOrigin(this.crossOrigin);var a=r.load(t,n,void 0,i);return e&&(a.mapping=e),a},Ne.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},Ne.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")};var Vd={createMultiMaterialObject:function(){console.error("THREE.SceneUtils has been moved to /examples/js/utils/SceneUtils.js")},detach:function(){console.error("THREE.SceneUtils has been moved to /examples/js/utils/SceneUtils.js")},attach:function(){console.error("THREE.SceneUtils has been moved to /examples/js/utils/SceneUtils.js")}};"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:"113"}})),t.ACESFilmicToneMapping=Lt,t.AddEquation=rt,t.AddOperation=G,t.AdditiveBlending=tt,t.AlphaFormat=h,t.AlwaysDepth=wt,t.AlwaysStencilFunc=Te,t.AmbientLight=su,t.AmbientLightProbe=Lu,t.AnimationClip=fc,t.AnimationLoader=bc,t.AnimationMixer=lh,t.AnimationObjectGroup=oh,t.AnimationUtils=ec,t.ArcCurve=Lc,t.ArrayCamera=To,t.ArrowHelper=Zh,t.Audio=Vu,t.AudioAnalyser=Ju,t.AudioContext=Cu,t.AudioListener=zu,t.AudioLoader=Tu,t.AxesHelper=$h,t.AxisHelper=function(t){return console.warn("THREE.AxisHelper has been renamed to THREE.AxesHelper."),new $h(t)},t.BackSide=St,t.BasicDepthPacking=we,t.BasicShadowMap=0,t.BinaryTextureLoader=function(t){return console.warn("THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader."),new Sc(t)},t.Bone=rs,t.BooleanKeyframeTrack=sc,t.BoundingBoxHelper=function(t,e){return console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead."),new Hh(t,e)},t.Box2=vh,t.Box3=Pn,t.Box3Helper=Wh,t.BoxBufferGeometry=ur,t.BoxGeometry=cr,t.BoxHelper=Hh,t.BufferAttribute=yi,t.BufferGeometry=Bi,t.BufferGeometryLoader=pu,t.ByteType=r,t.Cache=gc,t.Camera=vr,t.CameraHelper=Uh,t.CanvasRenderer=function(){console.error("THREE.CanvasRenderer has been removed")},t.CanvasTexture=Ls,t.CatmullRomCurve3=Nc,t.CineonToneMapping=q,t.CircleBufferGeometry=jl,t.CircleGeometry=Ul,t.ClampToEdgeWrapping=zt,t.Clock=Ru,t.ClosedSplineCurve3=Nd,t.Color=ci,t.ColorKeyframeTrack=lc,t.CompressedTexture=Ds,t.CompressedTextureLoader=Mc,t.ConeBufferGeometry=Vl,t.ConeGeometry=zl,t.CubeCamera=xr,t.CubeGeometry=cr,t.CubeReflectionMapping=Ot,t.CubeRefractionMapping=It,t.CubeTexture=Gr,t.CubeTextureLoader=Tc,t.CubeUVReflectionMapping=Nt,t.CubeUVRefractionMapping=Bt,t.CubicBezierCurve=Vc,t.CubicBezierCurve3=Uc,t.CubicInterpolant=ic,t.CullFaceBack=Y,t.CullFaceFront=Z,t.CullFaceFrontBack=3,t.CullFaceNone=X,t.Curve=Ac,t.CurvePath=Xc,t.CustomBlending=it,t.CylinderBufferGeometry=Fl,t.CylinderGeometry=Bl,t.Cylindrical=mh,t.DataTexture=wr,t.DataTexture2DArray=Hr,t.DataTexture3D=Wr,t.DataTextureLoader=Sc,t.DecrementStencilOp=7683,t.DecrementWrapStencilOp=34056,t.DefaultLoadingManager=yc,t.DepthFormat=ee,t.DepthStencilFormat=ne,t.DepthTexture=Os,t.DirectionalLight=ou,t.DirectionalLightHelper=Fh,t.DirectionalLightShadow=au,t.DiscreteInterpolant=ac,t.DodecahedronBufferGeometry=Hs,t.DodecahedronGeometry=Gs,t.DoubleSide=$,t.DstAlphaFactor=mt,t.DstColorFactor=vt,t.DynamicBufferAttribute=function(t,e){return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setUsage( THREE.DynamicDrawUsage ) instead."),new yi(t,e).setUsage(Ae)},t.DynamicCopyUsage=35050,t.DynamicDrawUsage=Ae,t.DynamicReadUsage=35049,t.EdgesGeometry=Nl,t.EdgesHelper=function(t,e){return console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead."),new xs(new Nl(t.geometry),new us({color:void 0!==e?e:16777215}))},t.EllipseCurve=Dc,t.EqualDepth=Ct,t.EqualStencilFunc=514,t.EquirectangularReflectionMapping=Pt,t.EquirectangularRefractionMapping=Rt,t.Euler=nn,t.EventDispatcher=De,t.ExtrudeBufferGeometry=bl,t.ExtrudeGeometry=wl,t.Face3=pi,t.Face4=function(t,e,n,i,r,a,o){return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),new pi(t,e,n,r,a,o)},t.FaceColors=1,t.FileLoader=wc,t.FlatShading=1,t.Float32Attribute=function(t,e){return console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead."),new Ti(t,e)},t.Float32BufferAttribute=Ti,t.Float64Attribute=function(t,e){return console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead."),new Ei(t,e)},t.Float64BufferAttribute=Ei,t.FloatType=Zt,t.Fog=Oo,t.FogExp2=Lo,t.Font=bu,t.FontLoader=Su,t.FrontFaceDirectionCCW=1,t.FrontFaceDirectionCW=0,t.FrontSide=O,t.Frustum=Sr,t.GammaEncoding=n,t.Geometry=lr,t.GeometryUtils=zd,t.GreaterDepth=Et,t.GreaterEqualDepth=Tt,t.GreaterEqualStencilFunc=518,t.GreaterStencilFunc=516,t.GridHelper=Ph,t.Group=Eo,t.HalfFloatType=$t,t.HemisphereLight=Kc,t.HemisphereLightHelper=Ih,t.HemisphereLightProbe=Du,t.IcosahedronBufferGeometry=js,t.IcosahedronGeometry=Us,t.ImageBitmapLoader=_u,t.ImageLoader=Cc,t.ImageUtils=Ne,t.ImmediateRenderObject=wh,t.IncrementStencilOp=7682,t.IncrementWrapStencilOp=34055,t.InstancedBufferAttribute=du,t.InstancedBufferGeometry=hu,t.InstancedInterleavedBuffer=uh,t.InstancedMesh=cs,t.Int16Attribute=function(t,e){return console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead."),new bi(t,e)},t.Int16BufferAttribute=bi,t.Int32Attribute=function(t,e){return console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead."),new Si(t,e)},t.Int32BufferAttribute=Si,t.Int8Attribute=function(t,e){return console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead."),new xi(t,e)},t.Int8BufferAttribute=xi,t.IntType=s,t.InterleavedBuffer=Io,t.InterleavedBufferAttribute=ko,t.Interpolant=nc,t.InterpolateDiscrete=ue,t.InterpolateLinear=he,t.InterpolateSmooth=2302,t.InvertStencilOp=5386,t.JSONLoader=function(){console.error("THREE.JSONLoader has been removed.")},t.KeepStencilOp=Ce,t.KeyframeTrack=oc,t.LOD=Qo,t.LatheBufferGeometry=Il,t.LatheGeometry=Ol,t.Layers=rn,t.LensFlare=function(){console.error("THREE.LensFlare has been moved to /examples/js/objects/Lensflare.js")},t.LessDepth=bt,t.LessEqualDepth=Mt,t.LessEqualStencilFunc=515,t.LessStencilFunc=513,t.Light=$c,t.LightProbe=Au,t.LightShadow=Qc,t.Line=gs,t.Line3=_h,t.LineBasicMaterial=us,t.LineCurve=jc,t.LineCurve3=Gc,t.LineDashedMaterial=Ql,t.LineLoop=_s,t.LinePieces=1,t.LineSegments=xs,t.LineStrip=0,t.LinearEncoding=me,t.LinearFilter=Ht,t.LinearInterpolant=rc,t.LinearMipMapLinearFilter=1008,t.LinearMipMapNearestFilter=1007,t.LinearMipmapLinearFilter=Jt,t.LinearMipmapNearestFilter=Wt,t.LinearToneMapping=Dt,t.Loader=xc,t.LoaderUtils=uu,t.LoadingManager=vc,t.LogLuvEncoding=ve,t.LoopOnce=2200,t.LoopPingPong=2202,t.LoopRepeat=2201,t.LuminanceAlphaFormat=p,t.LuminanceFormat=d,t.MOUSE={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},t.Material=mi,t.MaterialLoader=cu,t.Math=Pe,t.MathUtils=Pe,t.Matrix3=ke,t.Matrix4=Qe,t.MaxEquation=lt,t.Mesh=er,t.MeshBasicMaterial=gi,t.MeshDepthMaterial=go,t.MeshDistanceMaterial=vo,t.MeshFaceMaterial=function(t){return console.warn("THREE.MeshFaceMaterial has been removed. Use an Array instead."),t},t.MeshLambertMaterial=$l,t.MeshMatcapMaterial=Kl,t.MeshNormalMaterial=Zl,t.MeshPhongMaterial=Xl,t.MeshPhysicalMaterial=ql,t.MeshStandardMaterial=Jl,t.MeshToonMaterial=Yl,t.MinEquation=st,t.MirroredRepeatWrapping=Vt,t.MixOperation=j,t.MultiMaterial=function(t){return void 0===t&&(t=[]),console.warn("THREE.MultiMaterial has been removed. Use an Array instead."),t.isMultiMaterial=!0,(t.materials=t).clone=function(){return t.slice()},t},t.MultiplyBlending=nt,t.MultiplyOperation=U,t.NearestFilter=Ut,t.NearestMipMapLinearFilter=1005,t.NearestMipMapNearestFilter=1004,t.NearestMipmapLinearFilter=Gt,t.NearestMipmapNearestFilter=jt,t.NeverDepth=_t,t.NeverStencilFunc=512,t.NoBlending=K,t.NoColors=o,t.NoToneMapping=H,t.NormalBlending=Q,t.NotEqualDepth=At,t.NotEqualStencilFunc=517,t.NumberKeyframeTrack=cc,t.Object3D=yn,t.ObjectLoader=mu,t.ObjectSpaceNormalMap=Se,t.OctahedronBufferGeometry=Vs,t.OctahedronGeometry=zs,t.OneFactor=ut,t.OneMinusDstAlphaFactor=gt,t.OneMinusDstColorFactor=yt,t.OneMinusSrcAlphaFactor=ft,t.OneMinusSrcColorFactor=dt,t.OrthographicCamera=ru,t.PCFShadowMap=F,t.PCFSoftShadowMap=z,t.PMREMGenerator=Md,t.ParametricBufferGeometry=Rs,t.ParametricGeometry=Ps,t.Particle=function(t){return console.warn("THREE.Particle has been renamed to THREE.Sprite."),new Yo(t)},t.ParticleBasicMaterial=function(t){return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),new ws(t)},t.ParticleSystem=function(t,e){return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),new Ts(t,e)},t.ParticleSystemMaterial=function(t){return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),new ws(t)},t.Path=Yc,t.PerspectiveCamera=yr,t.Plane=Xn,t.PlaneBufferGeometry=Dr,t.PlaneGeometry=Ar,t.PlaneHelper=Jh,t.PointCloud=function(t,e){return console.warn("THREE.PointCloud has been renamed to THREE.Points."),new Ts(t,e)},t.PointCloudMaterial=function(t){return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),new ws(t)},t.PointLight=iu,t.PointLightHelper=Ah,t.Points=Ts,t.PointsMaterial=ws,t.PolarGridHelper=Rh,t.PolyhedronBufferGeometry=Ns,t.PolyhedronGeometry=ks,t.PositionalAudio=Wu,t.PropertyBinding=ah,t.PropertyMixer=qu,t.QuadraticBezierCurve=Hc,t.QuadraticBezierCurve3=Wc,t.Quaternion=je,t.QuaternionKeyframeTrack=hc,t.QuaternionLinearInterpolant=uc,t.REVISION="113",t.RGBADepthPacking=be,t.RGBAFormat=te,t.RGBAIntegerFormat=_,t.RGBA_ASTC_10x10_Format=se,t.RGBA_ASTC_10x5_Format=re,t.RGBA_ASTC_10x6_Format=ae,t.RGBA_ASTC_10x8_Format=oe,t.RGBA_ASTC_12x10_Format=le,t.RGBA_ASTC_12x12_Format=ce,t.RGBA_ASTC_4x4_Format=L,t.RGBA_ASTC_5x4_Format=I,t.RGBA_ASTC_5x5_Format=P,t.RGBA_ASTC_6x5_Format=R,t.RGBA_ASTC_6x6_Format=k,t.RGBA_ASTC_8x5_Format=N,t.RGBA_ASTC_8x6_Format=B,t.RGBA_ASTC_8x8_Format=ie,t.RGBA_PVRTC_2BPPV1_Format=A,t.RGBA_PVRTC_4BPPV1_Format=E,t.RGBA_S3TC_DXT1_Format=b,t.RGBA_S3TC_DXT3_Format=M,t.RGBA_S3TC_DXT5_Format=S,t.RGBDEncoding=_e,t.RGBEEncoding=ge,t.RGBEFormat=i,t.RGBFormat=Qt,t.RGBIntegerFormat=x,t.RGBM16Encoding=xe,t.RGBM7Encoding=ye,t.RGB_ETC1_Format=D,t.RGB_PVRTC_2BPPV1_Format=T,t.RGB_PVRTC_4BPPV1_Format=C,t.RGB_S3TC_DXT1_Format=w,t.RGFormat=g,t.RGIntegerFormat=y,t.RawShaderMaterial=Wl,t.Ray=Hn,t.Raycaster=hh,t.RectAreaLight=lu,t.RedFormat=f,t.RedIntegerFormat=m,t.ReinhardToneMapping=W,t.RepeatWrapping=Ft,t.ReplaceStencilOp=7681,t.ReverseSubtractEquation=ot,t.RingBufferGeometry=Ll,t.RingGeometry=Dl,t.Scene=xn,t.SceneUtils=Vd,t.ShaderChunk=Lr,t.ShaderLib=Or,t.ShaderMaterial=gr,t.ShadowMaterial=Hl,t.Shape=Zc,t.ShapeBufferGeometry=Rl,t.ShapeGeometry=Pl,t.ShapePath=wu,t.ShapeUtils=yl,t.ShortType=a,t.Skeleton=is,t.SkeletonHelper=Eh,t.SkinnedMesh=ts,t.SmoothShading=2,t.Sphere=Nn,t.SphereBufferGeometry=Al,t.SphereGeometry=El,t.Spherical=fh,t.SphericalHarmonics3=Eu,t.SphericalReflectionMapping=kt,t.Spline=Fd,t.SplineCurve=Jc,t.SplineCurve3=Bd,t.SpotLight=eu,t.SpotLightHelper=Mh,t.SpotLightShadow=tu,t.Sprite=Yo,t.SpriteMaterial=No,t.SrcAlphaFactor=pt,t.SrcAlphaSaturateFactor=xt,t.SrcColorFactor=ht,t.StaticCopyUsage=35046,t.StaticDrawUsage=Ee,t.StaticReadUsage=35045,t.StereoCamera=Pu,t.StreamCopyUsage=35042,t.StreamDrawUsage=35040,t.StreamReadUsage=35041,t.StringKeyframeTrack=dc,t.SubtractEquation=at,t.SubtractiveBlending=et,t.TOUCH={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},t.TangentSpaceNormalMap=Me,t.TetrahedronBufferGeometry=Fs,t.TetrahedronGeometry=Bs,t.TextBufferGeometry=Tl,t.TextGeometry=Cl,t.Texture=Fe,t.TextureLoader=Ec,t.TorusBufferGeometry=Zs,t.TorusGeometry=Ys,t.TorusKnotBufferGeometry=Xs,t.TorusKnotGeometry=qs,t.Triangle=ai,t.TriangleFanDrawMode=2,t.TriangleStripDrawMode=1,t.TrianglesDrawMode=0,t.TubeBufferGeometry=Js,t.TubeGeometry=Ws,t.UVMapping=300,t.Uint16Attribute=function(t,e){return console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead."),new Mi(t,e)},t.Uint16BufferAttribute=Mi,t.Uint32Attribute=function(t,e){return console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead."),new Ci(t,e)},t.Uint32BufferAttribute=Ci,t.Uint8Attribute=function(t,e){return console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead."),new _i(t,e)},t.Uint8BufferAttribute=_i,t.Uint8ClampedAttribute=function(t,e){return console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead."),new wi(t,e)},t.Uint8ClampedBufferAttribute=wi,t.Uncharted2ToneMapping=J,t.Uniform=ch,t.UniformsLib=Cr,t.UniformsUtils=pr,t.UnsignedByteType=qt,t.UnsignedInt248Type=Kt,t.UnsignedIntType=Yt,t.UnsignedShort4444Type=l,t.UnsignedShort5551Type=c,t.UnsignedShort565Type=u,t.UnsignedShortType=Xt,t.VSMShadowMap=V,t.Vector2=Re,t.Vector3=We,t.Vector4=ze,t.VectorKeyframeTrack=pc,t.Vertex=function(t,e,n){return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),new We(t,e,n)},t.VertexColors=v,t.VideoTexture=As,t.WebGLCubeRenderTarget=_r,t.WebGLMultisampleRenderTarget=Ue,t.WebGLRenderTarget=Ve,t.WebGLRenderTargetCube=function(t,e,n){return console.warn("THREE.WebGLRenderTargetCube( width, height, options ) is now WebGLCubeRenderTarget( size, options )."),new _r(t,n)},t.WebGLRenderer=Do,t.WebGLUtils=Mo,t.WireframeGeometry=Is,t.WireframeHelper=function(t,e){return console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead."),new xs(new Is(t.geometry),new us({color:void 0!==e?e:16777215}))},t.WrapAroundEnding=fe,t.XHRLoader=function(t){return console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader."),new wc(t)},t.ZeroCurvatureEnding=de,t.ZeroFactor=ct,t.ZeroSlopeEnding=pe,t.ZeroStencilOp=0,t.sRGBEncoding=e,Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof n&&void 0!==e?r(n):"function"==typeof define&&define.amd?define(["exports"],r):r((i=i||self).THREE={})},{}],20:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.McEdJigOsnap=n.McEdImpJigGlobalData=n.MxOsnapDefine=void 0;var i,r,s,a,o,l,c,u,h,d,p,f=t("three"),m=t("./MxDrawObject"),g=t("./MxFun"),v=t("./MxJigCmdManager"),y=t("./MxTools"),x=t("./MxDrawData"),_=t("./MxWindowsEvent");(r=i=n.MxOsnapDefine||(n.MxOsnapDefine={}))[r.OsModeInvalid=0]="OsModeInvalid",r[r.OsModeEnd=1]="OsModeEnd",r[r.OsModeMid=2]="OsModeMid",r[r.OsModeCen=4]="OsModeCen",r[r.OsModeNode=8]="OsModeNode",r[r.OsModeQuad=16]="OsModeQuad",r[r.OsModeInt=32]="OsModeInt",r[r.OsModeIns=64]="OsModeIns",r[r.OsModePerp=128]="OsModePerp",r[r.OsModeTan=256]="OsModeTan",r[r.OsModeNear=512]="OsModeNear",r[r.OsModeApp=2048]="OsModeApp",r[r.OsModeExt=4096]="OsModeExt",r[r.OsModePar=8192]="OsModePar",r[r.OsModeOff=16384]="OsModeOff",r[r.OsModeAll=16383]="OsModeAll",a=s=n.McEdImpJigGlobalData||(n.McEdImpJigGlobalData={}),o=!1,l=new f.Vector3,c=new f.Vector3,u=0,d=h=!1,p=new Array,a.setPrvPoint=function(t){l=t,d=!0},a.isOsnapZValue=function(){return!1},a.setIsValidPrvpoint=function(t){d=t},a.isValidPrvpoint=function(){return d},a.getPrvPoint=function(){return l},a.setIsValidBasepoint=function(t){o=t},a.isValidBasepoint=function(){return o},a.setBasepoint=function(t){o=!0,c=t},a.getBasepoint=function(){return c},a.initStartCommand=function(){h=o=!1},a.setIsTmpDisableOsmode=function(t){h=t},a.isTmpDisableOsmode=function(){return h},a.intiStartDrag=function(t){u=t.sysVariable().getSysVarNumber("OSMODE")},a.isEnableOsmode=function(){return!(0==u||u&i.OsModeOff||h)},a.getOSmode=function(){return u},a.addDynDrawObject=function(t){p.push(t)},a.clearDisplay=function(t){for(var e=p.length,n=0;n<e;n++)g.MxFun.removeThreejsObject(p[n],t)};var w=(b.prototype.drawLine=function(t,e,n){var i=new f.Geometry,r=new f.LineBasicMaterial({color:this.m_iColor});i.vertices.push(new f.Vector3(t.x,t.y,t.z),new f.Vector3(e.x,e.y,e.z));var a=new f.Line(i,r);n.add(a),s.addDynDrawObject(a)},b.prototype.drawPolyline=function(t,e){for(var n=new f.Geometry,i=new f.LineBasicMaterial({color:this.m_iColor}),r=t.length,a=0;a<r;a++)n.vertices.push(new f.Vector3(t[a].x,t[a].y,t[a].z));var o=new f.Line(n,i);e.add(o),s.addDynDrawObject(o)},b.prototype.setWidth=function(t){this.m_dOsmodeWdith=t},b.prototype.GetDrawRect=function(){var t=.5*this.m_dOsmodeWdith,e={};return e.left=this.m_pt.x-t,e.right=this.m_pt.x+t,e.top=this.m_pt.y-t,e.bottom=this.m_pt.y+t,e},b.prototype.DrawNear=function(t){var e=this.GetDrawRect(),n=[new f.Vector3,new f.Vector3];n[0].x=e.left,n[0].y=e.top,n[1].x=e.right,n[1].y=e.top,this.drawLine(n[0],n[1],t),n[0].x=e.left,n[0].y=e.bottom,n[1].x=e.right,n[1].y=e.bottom,this.drawLine(n[0],n[1],t),n[0].x=e.right,n[0].y=e.top,n[1].x=e.left,n[1].y=e.bottom,this.drawLine(n[0],n[1],t),n[0].x=e.right,n[0].y=e.bottom,n[1].x=e.left,n[1].y=e.top,this.drawLine(n[0],n[1],t)},b.prototype.DrawEnd=function(t){var e=this.GetDrawRect(),n=[new f.Vector3,new f.Vector3,new f.Vector3,new f.Vector3];n[0].x=e.left,n[0].y=e.top,n[1].x=e.right,n[1].y=e.top,n[2].x=e.right,n[2].y=e.bottom,n[3].x=e.left,n[3].y=e.bottom,this.drawLine(n[0],n[1],t),this.drawLine(n[1],n[2],t),this.drawLine(n[2],n[3],t),this.drawLine(n[3],n[0],t)},b.prototype.DrawMid=function(t){var e=this.GetDrawRect(),n=1.2*(e.right-e.left),i=n/2/Math.sin(60*3.14159265/180),r=i*Math.sin(.5235987750000001),a=new f.Vector3(this.m_pt.x,this.m_pt.y,this.m_pt.z);a.y-=i;var o=new f.Vector3;o.x=this.m_pt.x+n/2,o.y=this.m_pt.y+r;var s=new f.Vector3;s.x=this.m_pt.x-n/2,s.y=this.m_pt.y+r;var l=[new f.Vector3,new f.Vector3,new f.Vector3,new f.Vector3];l[0].x=a.x,l[0].y=a.y,l[1].x=o.x,l[1].y=o.y,l[2].x=s.x,l[2].y=s.y,l[3].x=a.x,l[3].y=a.y,this.drawLine(l[0],l[1],t),this.drawLine(l[1],l[2],t),this.drawLine(l[2],l[3],t)},b.prototype.DrawPerp=function(t){var e=this.GetDrawRect(),n=[new f.Vector3,new f.Vector3,new f.Vector3];n[0].x=e.left,n[0].y=e.top,n[1].x=e.left,n[1].y=e.bottom,n[2].x=e.right,n[2].y=e.bottom,this.drawPolyline(n,t),n[0].x=e.left,n[0].y=this.m_pt.y,n[1].x=this.m_pt.x,n[1].y=this.m_pt.y,n[2].x=this.m_pt.x,n[2].y=e.bottom,this.drawPolyline(n,t)},b.prototype.DrawCircle=function(t,e,n){null==n&&(n=.5*this.m_dOsmodeWdith);for(var i=[],r=0,a=3.14159265/180;r<=360;r+=15){var o=n*Math.cos(r*a)+t.x,s=n*Math.sin(r*a)+t.y;i.push(new f.Vector3(o,s))}this.drawPolyline(i,e)},b.prototype.DrawInt=function(t){var e=this.GetDrawRect(),n=[new f.Vector3,new f.Vector3];n[0].x=e.right,n[0].y=e.top,n[1].x=e.left,n[1].y=e.bottom,this.drawLine(n[0],n[1],t),n[0].x=e.right,n[0].y=e.bottom,n[1].x=e.left,n[1].y=e.top,this.drawLine(n[0],n[1],t)},b.prototype.DrawCen=function(t){this.DrawInt(t),this.DrawCircle(this.m_pt,t)},b.prototype.DrawTan=function(t){this.DrawEnd(t)},b.prototype.DrawIns=function(t){var e=this.GetDrawRect(),n={},i=(e.right-e.left)/1.5;n.left=this.m_pt.x-i,n.right=this.m_pt.x+i,n.top=this.m_pt.y-i,n.bottom=this.m_pt.y+i;var r=this.m_pt.x,a=this.m_pt.y,o=[new f.Vector3,new f.Vector3,new f.Vector3,new f.Vector3,new f.Vector3,new f.Vector3,new f.Vector3,new f.Vector3,new f.Vector3];o[0].x=n.left,o[0].y=n.top,o[1].x=n.left,o[1].y=a+2,o[2].x=r,o[2].y=a+2,o[3].x=r,o[3].y=n.bottom,o[4].x=n.right,o[4].y=n.bottom,o[5].x=n.right,o[5].y=a-2,o[6].x=r,o[6].y=a-2,o[7].x=r,o[7].y=n.top,o[8].x=n.left,o[8].y=n.top,this.drawPolyline(o,t)},b.prototype.DrawNode=function(t){var e=this.GetDrawRect(),n={},i=(e.right-e.left)/1.5;n.left=this.m_pt.x-i,n.right=this.m_pt.x+i,n.top=this.m_pt.y-i,n.bottom=this.m_pt.y+i;var r={},a=this.m_dOsmodeWdith/1.3;r.left=this.m_pt.x-a,r.right=this.m_pt.x+a,r.top=this.m_pt.y-a,r.bottom=this.m_pt.y+a;var o=[new f.Vector3,new f.Vector3,new f.Vector3,new f.Vector3];o[0].x=n.left,o[0].y=n.top,o[1].x=n.right,o[1].y=n.bottom,o[2].x=n.left,o[2].y=n.bottom,o[3].x=n.right,o[3].y=n.top,this.drawLine(o[0],o[1],t),this.drawLine(o[2],o[3],t),this.DrawCircle(this.m_pt,t,a)},b.prototype.upDisplay=function(t,e,n){this.m_pt=t,this.m_osmode=e,this.clearDisplay(n);var i=n.getMxObject().getScene(),r=.5*this.m_dOsmodeWdith;if(this.m_osmode!=v.MxJigCmdManager.OsnapMode.kOsModekValid)if(this.m_osmode==v.MxJigCmdManager.OsnapMode.kOsModeNear)this.DrawNear(i);else if(this.m_osmode==v.MxJigCmdManager.OsnapMode.kOsModeEnd)this.DrawEnd(i);else if(this.m_osmode==v.MxJigCmdManager.OsnapMode.kOsModeMid)this.DrawMid(i);else if(this.m_osmode==v.MxJigCmdManager.OsnapMode.kOsModePerp)this.DrawPerp(i);else if(this.m_osmode==v.MxJigCmdManager.OsnapMode.kOsModeInt)this.DrawInt(i);else if(this.m_osmode==v.MxJigCmdManager.OsnapMode.kOsModeCen)this.DrawCen(i);else if(this.m_osmode==v.MxJigCmdManager.OsnapMode.kOsModeTan)this.DrawTan(i);else if(this.m_osmode==v.MxJigCmdManager.OsnapMode.kOsModeIns)this.DrawIns(i);else if(this.m_osmode==v.MxJigCmdManager.OsnapMode.kOsModeNode)this.DrawNode(i);else{var a=new f.Vector3(t.x-r,t.y-r,0),o=new f.Vector3(t.x+r,t.y+r,0);this.drawLine(a,o,i);var s=new f.Vector3(t.x-r,t.y+r,0),l=new f.Vector3(t.x+r,t.y-r,0);this.drawLine(s,l,i)}},b.prototype.clearDisplay=function(t){var e=t.getMxObject().getScene();s.clearDisplay(e)},b);function b(){this.m_iColor=16711935,this.m_pt=new f.Vector3,this.m_osmode=v.MxJigCmdManager.OsnapMode.kOsModekValid,this.m_dOsmodeWdith=10}var M=(S.prototype.resetData=function(){this.m_osmode=v.MxJigCmdManager.OsnapMode.kOsModekValid,this.m_isValidPrvInputPoint=!1,this.m_lOSmode=0,this.m_vecOffset.set(0,0,0),this.m_isValid=!1,this.m_iLongprogressStatus=-1},S.prototype.notifyOsnapToServer=function(){var n=this,t={ptx:this.m_pt.x,pty:this.m_pt.y,osmode:this.m_lOSmode,isValidPrvInputPoint:this.m_isValidPrvInputPoint};this.m_isValidPrvInputPoint&&(t.prvPtx=this.m_prvInputPoint.x,t.prvPty=this.m_prvInputPoint.y);var i=this.m_mxJig.getMxObject();if(i.getRunMode()==m.MxRunMode.kBrowse){var r=this,e=_.MxWindowsEvent.getCurrentMousePostion();i.getObjectOsnap().getOsnapData(e,function(t,e){r.m_ptSnapPoint.x=t.x,r.m_ptSnapPoint.y=t.y,r.m_ptSnapPoint.z=0,r.m_ptSnapSrcPoint.x=r.m_pt.x,r.m_ptSnapSrcPoint.y=r.m_pt.y,r.m_ptSnapSrcPoint.z=0,r.m_osmode=e,r.m_draw.setWidth(i.screenCoordLong2World(x.MxDrawData.getCursorWidthPixels())),r.m_draw.upDisplay(new f.Vector3(t.x,t.y,0),e,r.m_mxJig)})}else{t.SearchRnge=i.screenCoordLong2World(x.MxDrawData.getCursorWidthPixels());var a=this;i.callCommand("MxCAD_NotifyOsnap",JSON.stringify(t),function(t){if(!("string"!=typeof t||t.length<1)&&a.m_isRuning){var e=JSON.parse(t);n.m_ptSnapPoint.x=e.ptsx,n.m_ptSnapPoint.y=e.ptsy,n.m_ptSnapPoint.z=e.ptsz,n.m_ptSnapSrcPoint.x=e.ptx,n.m_ptSnapSrcPoint.y=e.pty,n.m_ptSnapSrcPoint.z=0,n.m_osmode=e.osmode,a.m_draw.setWidth(i.screenCoordLong2World(x.MxDrawData.getCursorWidthPixels())),a.m_draw.upDisplay(new f.Vector3(e.ptsx,e.ptsy,e.ptsz),e.osmode,a.m_mxJig)}})}},S.prototype.startDrag=function(t,e){this.m_mxJig=e;var n=this.m_mxJig.getMxObject();e.isDisableOsnap()?this.m_isEnable=!1:this.m_isEnable=!0===n.getInisetValue(m.IniSetName.kEnableOsnapFunction);var i,r,a,o=0;function s(){i.notifyOsnapToServer()}return(this.m_isOffsetInputPostion=t)&&(o=y.MxTools.MillimeterToPixels(15)),o=n.screenCoordLong2Doc(o),this.m_isRuning=!0,this.m_draw.setWidth(n.screenCoordLong2World(x.MxDrawData.getCursorWidthPixels())),this.resetData(),this.m_notifyOsnap_delayCall=(i=this,r=100,a=null,function(){clearTimeout(a),a=setTimeout(s,r)}),!0},S.prototype.endDrag=function(){return this.m_isRuning=!1,this.m_draw.clearDisplay(this.m_mxJig),!0},S.prototype.reCompteCurrentPoint=function(t){return t},S.prototype.isEnable=function(){return this.m_isEnable&&s.isEnableOsmode()},S.prototype.notifyOsnap=function(t,e){this.m_lOSmode=t,null==e?this.m_isValidPrvInputPoint=!1:(this.m_isValidPrvInputPoint=!0,this.m_prvInputPoint=e),this.m_osmode==v.MxJigCmdManager.OsnapMode.kOsModekValid&&this.m_draw.clearDisplay(this.m_mxJig),this.m_notifyOsnap_delayCall()},S.prototype.setPoint=function(t,e){if(this.isEnable()){null==t?(this.m_isValid=!1,this.m_osmode=v.MxJigCmdManager.OsnapMode.kOsModekValid):(-1==this.m_iLongprogressStatus||this.m_iLongprogressStatus,this.m_pt=t,this.m_inPoint=t,this.m_isValid=!0,(null==e||this.m_osmode!=v.MxJigCmdManager.OsnapMode.kOsModekValid&&y.MxTools.getXYPlanDistance(this.m_ptSnapSrcPoint,t)>e)&&(this.m_osmode=v.MxJigCmdManager.OsnapMode.kOsModekValid));var n=s.getOSmode(),i=s.getPrvPoint();this.notifyOsnap(n,s.isValidPrvpoint()?i:void 0)}},S.prototype.seInValidPoint=function(){this.setPoint(void 0)},S.prototype.getCurrentOSnapPoint=function(t){var e={};return this.isEnable()?(e.pt=t,e.osmode=this.m_osmode,this.m_osmode!=v.MxJigCmdManager.OsnapMode.kOsModekValid?(e.pt.x=this.m_ptSnapPoint.x,e.pt.y=this.m_ptSnapPoint.y,e.pt.z=this.m_ptSnapPoint.z,s.isOsnapZValue()||(t.z=0)):e.pt=t):(e.pt=t,e.osmode=v.MxJigCmdManager.OsnapMode.kOsModekValid),e},S.prototype.setLongprogressStatus=function(t){this.m_iLongprogressStatus=t},S.prototype.reComputeOffset=function(){},S);function S(t){this.m_inPoint=new f.Vector3,this.m_vecOffset=new f.Vector3,this.m_pt=new f.Vector3,this.m_isValid=!1,this.m_ptSnapPoint=new f.Vector3,this.m_ptSnapSrcPoint=new f.Vector3,this.m_osmode=v.MxJigCmdManager.OsnapMode.kOsModekValid,this.m_prvInputPoint=new f.Vector3,this.m_isValidPrvInputPoint=!1,this.m_lOSmode=0,this.m_iLongprogressStatus=-1,this.m_isOffsetInputPostion=!1,this.m_mxJig=null,this.m_notifyOsnap_delayCall=void 0,this.m_isRuning=!1,this.m_isEnable=!1,this.m_mxJig=t,this.m_draw=new w}n.McEdJigOsnap=M},{"./MxDrawData":34,"./MxDrawObject":35,"./MxFun":39,"./MxJigCmdManager":42,"./MxTools":53,"./MxWindowsEvent":59,three:19}],21:[function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.MrxDbgUiPrBase=n.MrxDbgUiPrBase_Return=n.McEdGetPointWorldDrawObject=n.McEdGetPointWorldDraw=void 0;var a=t("./MxJig"),o=t("./MxJigCmdManager"),s=t("./MxThreeJS"),l=t("./MxUiVue"),c=t("./MxString"),u=(h.prototype.setMcEdJig=function(t){this.m_pJig=t},h.prototype.setColor=function(t){this.m_iColor=t},h.prototype.getColor=function(){return this.m_iColor},h.prototype.drawLine=function(t,e){this.m_pJig.drawEntity(s.MxThreeJS.createLine(t,e,this.m_iColor))},h.prototype.drawCircle=function(t,e){this.m_pJig.drawEntity(s.MxThreeJS.createCircle(t,e,this.m_iColor))},h.prototype.drawEntity=function(t){this.m_pJig.drawEntity(t)},h.prototype.drawText=function(t,e,n,i){var r=s.MxThreeJS.creatTextSprite(t,i,e,n,this.m_iColor);this.drawEntity(r)},h);function h(){this.m_pJig=null,this.m_iColor=16777215}n.McEdGetPointWorldDraw=u;var d,p,f,m=(r(g,d=u),g.prototype.setDraw=function(t){this.m_callDraw=t},g.prototype.worldDraw=function(t){null!=this.m_callDraw&&this.m_callDraw(t,this)},g);function g(){var t=null!==d&&d.apply(this,arguments)||this;return t.m_callDraw=void 0,t}n.McEdGetPointWorldDrawObject=m,(f=p=n.MrxDbgUiPrBase_Return||(n.MrxDbgUiPrBase_Return={}))[f.kCancel=-2]="kCancel",f[f.kNone=-1]="kNone",f[f.kOk=0]="kOk",f[f.kKeyWord=1]="kKeyWord";var v,y=(v=a.McEdJigCommand,r(x,v),x.prototype.procInKeyword=function(t){t.status>=o.MxJigCmdManager.DragStatus.kKW1&&0<t.sKeyValue.length?this.m_keyWordPicked=t.sKeyValue.toUpperCase():this.m_keyWordPicked=""},x.prototype.getReturnStatus=function(t){switch(t){case o.MxJigCmdManager.DragStatus.kNoChange:return p.kNone;case o.MxJigCmdManager.DragStatus.kCancel:return p.kCancel;case o.MxJigCmdManager.DragStatus.kNull:return p.kNone;case o.MxJigCmdManager.DragStatus.kNormal:return p.kOk}return 1<=t?p.kKeyWord:p.kCancel},x.prototype.setInputToucheType=function(t){this.m_toucheType=t},x.prototype.getInputToucheType=function(){return this.m_toucheType},x.prototype.keyWords=function(){return this.m_keyWords},x.prototype.setKeyWords=function(t){this.m_keyWords=t},x.prototype.message=function(){return this.m_message},x.prototype.setMessage=function(t){this.m_message=t},x.prototype.keyWordPicked=function(){return this.m_keyWordPicked},x.prototype.isKeyWordPicked=function(t){return t=t.toUpperCase(),this.m_keyWordPicked==t},x.prototype.setUserDraw=function(t){t.setMcEdJig(this),this.m_pWorldDraw=t},x.prototype.printMessage=function(){var t=new c.MxString(this.m_message);t.TrimRight(":"),1<this.m_keyWords.length&&"["==this.m_keyWords[0]&&"]"==this.m_keyWords[this.m_keyWords.length-1]?l.MxUiVue.acutPrintf(t.m_val+" 或"+this.m_keyWords+":"):l.MxUiVue.acutPrintf(t.m_val+":")},x);function x(){var t=null!==v&&v.apply(this,arguments)||this;return t.m_keyWords="",t.m_message="",t.m_keyWordPicked="",t.m_pWorldDraw=null,t.m_toucheType=o.MxJigCmdManager.InType.kGetBegan,t}n.MrxDbgUiPrBase=y},{"./MxJig":41,"./MxJigCmdManager":42,"./MxString":50,"./MxThreeJS":52,"./MxUiVue":58}],22:[function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.MrxDbgUiPrPoint=void 0;var a,o=t("three"),s=t("./MxJigCmdManager"),l=t("./MxFun"),c=t("./MrxDbgUiPrBase"),u=t("./MxUiVue"),h=(a=c.MrxDbgUiPrBase,r(d,a),d.prototype.value=function(){return new o.Vector3(this.m_value.x,this.m_value.y,0)},d.prototype.valueDocCoord=function(){return null==this._mxObject?this.value():this._mxObject.worldCoord2Doc(this.m_value.x,this.m_value.y,0)},d.prototype.basePt=function(){return new o.Vector3(this.m_basePt.x,this.m_basePt.y,0)},d.prototype.setBasePt=function(t){null==this.m_basePt?this.m_basePt=new o.Vector3(t.x,t.y,0):(this.m_basePt.x=t.x,this.m_basePt.y=t.y)},d.prototype.setUseBasePt=function(t){this.m_useBasePt=t},d.prototype.initGo=function(){this.m_keyWordPicked="",this.m_retcall=null,this.m_retWhileCall=null,this.m_exitCall=null},d.prototype.go=function(t){this.initGo(),this.m_retcall=t,s.MxJigCmdManager.runCmd(this)},d.prototype.goWhile=function(t,e){this.initGo(),this.m_retWhileCall=t,e&&(this.m_exitCall=e),s.MxJigCmdManager.runCmd(this)},d.prototype.onExitCommand=function(){var t=this;u.MxUiVue.setCursorType(u.MxUiVue.CursorType.kNormal);var e=!1;null!=this.m_retcall&&(s.MxJigCmdManager.setRunCmdEvent(function(){a.prototype.onExitCommand.call(t,!1),e=!0}),this.m_retcall(this.getReturnStatus(this.m_resultDragStatus)),s.MxJigCmdManager.setRunCmdEvent(void 0)),!e&&s.MxJigCmdManager.isWaitCmdNull()&&u.MxUiVue.restoreCmdStatus(),e||a.prototype.onExitCommand.call(this,!0)},d.prototype.onStartCommand=function(){u.MxUiVue.setCursorType(u.MxUiVue.CursorType.kCross),this.printMessage(),s.MxJigCmdManager.setKeywordList(this.keyWords()),a.prototype.onStartCommand.call(this)},d.prototype.sampler=function(){var t=this.acquirePoint(this.m_toucheType);return this.procInKeyword(t),t.status==s.MxJigCmdManager.DragStatus.kNormal&&(null==this.m_value?this.m_value=new o.Vector3(t.pt.x,t.pt.y,0):(this.m_value.x=t.pt.x,this.m_value.y=t.pt.y)),t.status},d.prototype.done=function(t){if(null!=this.m_retcall)return this.m_resultDragStatus=t,this.m_exitCall&&this.m_exitCall(this.getReturnStatus(this.m_resultDragStatus)),s.MxJigCmdManager.DoneStatius.kExitCommand;if(null!=this.m_retWhileCall){if((this.m_resultDragStatus=t)==s.MxJigCmdManager.DragStatus.kCancel)return this.m_exitCall&&this.m_exitCall(this.getReturnStatus(this.m_resultDragStatus)),s.MxJigCmdManager.DoneStatius.kExitCommand;var e=!1;t==s.MxJigCmdManager.DragStatus.kNull&&(e=!0);var n=this.m_retWhileCall(this.getReturnStatus(this.m_resultDragStatus));return null!=n&&null!=n.exit&&(e=n.exit),e?(this.m_exitCall&&this.m_exitCall(this.getReturnStatus(this.m_resultDragStatus)),s.MxJigCmdManager.DoneStatius.kExitCommand):(s.MxJigCmdManager.setKeywordList(this.keyWords()),this.printMessage(),s.MxJigCmdManager.DoneStatius.kContinueCommand)}l.MxFun.Assert(0)},d.prototype.upDisplay=function(){this.m_pWorldDraw&&this.m_value&&(this.m_pWorldDraw.worldDraw(this.m_value),this.m_useBasePt&&this.m_basePt&&this.m_pWorldDraw.drawLine(this.m_value,this.m_basePt))},d);function d(){var t=null!==a&&a.apply(this,arguments)||this;return t.m_useBasePt=!1,t.m_basePt=null,t.m_value=null,t.m_retcall=null,t.m_retWhileCall=null,t.m_exitCall=null,t.m_resultDragStatus=s.MxJigCmdManager.DragStatus.kCancel,t}n.MrxDbgUiPrPoint=h},{"./MrxDbgUiPrBase":21,"./MxFun":39,"./MxJigCmdManager":42,"./MxUiVue":58,three:19}],23:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.ExternalReferenceManager=n.ExternalReferenceDatabase=n.Blocks=n.Block=n.Layer=n.BlockInstance=n.BlockRef=n.ClipPlans=n.ClipPlan=void 0;var S=t("three"),C=t("./MxShader"),i=t("./MxBrowseLayerData"),b=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0};n.ClipPlan=b;var M=function(){this.id=1,this.clipPlanArray=new Array};n.ClipPlans=M;var T=function(){this.mat=new S.Matrix4,this.blkRecId=-1,this.blkOwnerId=0,this.layerId=-1,this.color=16777215,this.clipPlans=new M};n.BlockRef=T;var x=function(){this.mat=new S.Matrix4,this.color=new Array,this.topLayerColor=new Array,this.clipPlans=new M};n.BlockInstance=x;var s=(r.prototype.Show=function(t){for(var e=0,n=this._entitys.length;e<n;e++)this._entitys[e].visible=t},r.prototype.updataClipMaterial=function(t){for(var e=this._material_clip.length,n=.5*t.width,i=.5*t.height,r=0;r<e;r++)this._material_clip[r].uniforms.vieww.value=n,this._material_clip[r].uniforms.viewh.value=i},r.prototype.createThreejsObjForMesh_Clip=function(t,_,w){0!=t.size&&t.forEach(function(t){var e=t;if(0!=e.length){var n=[],i=[];n.push(e[0].clipPlans.clipPlanArray[0].x1,e[0].clipPlans.clipPlanArray[0].y1),i.push(e[0].clipPlans.clipPlanArray[0].x2,e[0].clipPlans.clipPlanArray[0].y2);for(var r=[],a=[],o=[],s=[],l=[],c=[],u=[],h=0;h<e.length;h++){var d=e[h];r=r.concat(d.mat.elements.slice(0,4)),a=a.concat(d.mat.elements.slice(4,8)),o=o.concat(d.mat.elements.slice(8,12)),s=s.concat(d.mat.elements.slice(12,16)),l.push(0),c=c.concat(e[h].color)}if(0<this._geometryMeshPositionsByBlock.length)for(h=0;h<e.length;h++)c=c.concat(e[h].color);if(0<this._geometryMeshPositionsByBlock_ZeroLayer.length)for(h=0;h<e.length;h++)u=u.concat(e[h].topLayerColor);var p=.5*w.width,f=.5*w.height,m=new S.RawShaderMaterial({uniforms:{clippt1:{value:n},clippt2:{value:i},vieww:{value:p},viewh:{value:f}},vertexShader:C.MxShader.VSHADER_COLOR_POINT_CLIP,fragmentShader:C.MxShader.FSHADER_COLOR_POINT_CLIP,linewidth:1,transparent:!0});this._material_clip.push(m);for(var g=0;g<this._geometryMeshPostion.length;g++)(y=new S.InstancedBufferGeometry).maxInstancedCount=e.length,y.setAttribute("position",new S.Float32BufferAttribute(this._geometryMeshPostion[g],2)),y.setAttribute("color",new S.Float32BufferAttribute(this._geometryMeshColor[g],3)),y.setAttribute("tran1",new S.InstancedBufferAttribute(new Float32Array(r),4)),y.setAttribute("tran2",new S.InstancedBufferAttribute(new Float32Array(a),4)),y.setAttribute("tran3",new S.InstancedBufferAttribute(new Float32Array(o),4)),y.setAttribute("tran4",new S.InstancedBufferAttribute(new Float32Array(s),4)),y.setAttribute("ishide",new S.InstancedBufferAttribute(new Float32Array(l),1)),(x=new S.Mesh(y,m)).frustumCulled=!1,x.renderOrder=1,_.add(x),this._entitys.push(x);for(g=0;g<this._geometryMeshPositionsByBlock.length;g++)(y=new S.InstancedBufferGeometry).maxInstancedCount=e.length,y.setAttribute("position",new S.Float32BufferAttribute(this._geometryMeshPositionsByBlock[g],2)),y.setAttribute("color",new S.InstancedBufferAttribute(new Float32Array(c),3)),y.setAttribute("tran1",new S.InstancedBufferAttribute(new Float32Array(r),4)),y.setAttribute("tran2",new S.InstancedBufferAttribute(new Float32Array(a),4)),y.setAttribute("tran3",new S.InstancedBufferAttribute(new Float32Array(o),4)),y.setAttribute("tran4",new S.InstancedBufferAttribute(new Float32Array(s),4)),y.setAttribute("ishide",new S.InstancedBufferAttribute(new Float32Array(l),1)),(x=new S.Mesh(y,m)).frustumCulled=!1,x.renderOrder=1,_.add(x),this._entitys.push(x);for(g=0;g<this._geometryMeshPositionsByBlock_ZeroLayer.length;g++)(y=new S.InstancedBufferGeometry).maxInstancedCount=e.length,y.setAttribute("position",new S.Float32BufferAttribute(this._geometryMeshPositionsByBlock_ZeroLayer[g],2)),y.setAttribute("color",new S.InstancedBufferAttribute(new Float32Array(u),3)),y.setAttribute("tran1",new S.InstancedBufferAttribute(new Float32Array(r),4)),y.setAttribute("tran2",new S.InstancedBufferAttribute(new Float32Array(a),4)),y.setAttribute("tran3",new S.InstancedBufferAttribute(new Float32Array(o),4)),y.setAttribute("tran4",new S.InstancedBufferAttribute(new Float32Array(s),4)),y.setAttribute("ishide",new S.InstancedBufferAttribute(new Float32Array(l),1)),(x=new S.Mesh(y,m)).frustumCulled=!1,x.renderOrder=1,_.add(x),this._entitys.push(x);var v=new S.RawShaderMaterial({uniforms:{color:{value:this._color},clippt1:{value:n},clippt2:{value:i},vieww:{value:p},viewh:{value:f}},vertexShader:C.MxShader.VSHADER_COLOR_POINT_BYLAYER_CLIP,fragmentShader:C.MxShader.FSHADER_COLOR_POINT_CLIP,linewidth:1,transparent:!0});for(this._material_clip.push(v),g=0;g<this._geometryMeshPositionsByLayer.length;g++){var y,x;(y=new S.InstancedBufferGeometry).maxInstancedCount=e.length,y.setAttribute("position",new S.Float32BufferAttribute(this._geometryMeshPositionsByLayer[g],2)),y.setAttribute("tran1",new S.InstancedBufferAttribute(new Float32Array(r),4)),y.setAttribute("tran2",new S.InstancedBufferAttribute(new Float32Array(a),4)),y.setAttribute("tran3",new S.InstancedBufferAttribute(new Float32Array(o),4)),y.setAttribute("tran4",new S.InstancedBufferAttribute(new Float32Array(s),4)),y.setAttribute("ishide",new S.InstancedBufferAttribute(new Float32Array(l),1)),(x=new S.Mesh(y,v)).frustumCulled=!1,x.renderOrder=1,_.add(x),this._entitys.push(x)}}},this)},r.prototype.createThreejsObjForCurve_Clip=function(t,b,M){0!=t.size&&t.forEach(function(t,e,n){var i=t;if(0!=i.length){var r=[],a=[];r.push(i[0].clipPlans.clipPlanArray[0].x1,i[0].clipPlans.clipPlanArray[0].y1),a.push(i[0].clipPlans.clipPlanArray[0].x2,i[0].clipPlans.clipPlanArray[0].y2);for(var o=[],s=[],l=[],c=[],u=[],h=[],d=[],p=0;p<i.length;p++){var f=i[p];o=o.concat(f.mat.elements.slice(0,4)),s=s.concat(f.mat.elements.slice(4,8)),l=l.concat(f.mat.elements.slice(8,12)),c=c.concat(f.mat.elements.slice(12,16)),u.push(0)}if(0<this._geometryCurvePositionsByBlock.length)for(p=0;p<i.length;p++)h=h.concat(i[p].color);if(0<this._geometryCurvePositionsByBlock_ZeroLayer.length)for(p=0;p<i.length;p++)d=d.concat(i[p].topLayerColor);var m=.5*M.width,g=.5*M.height,v=new S.RawShaderMaterial({uniforms:{clippt1:{value:r},clippt2:{value:a},vieww:{value:m},viewh:{value:g}},vertexShader:C.MxShader.VSHADER_COLOR_POINT_CLIP,fragmentShader:C.MxShader.FSHADER_COLOR_POINT_CLIP,linewidth:1,transparent:!0});this._material_clip.push(v);for(var y=0;y<this._geometryCurvePostion.length;y++)(_=new S.InstancedBufferGeometry).maxInstancedCount=i.length,_.setAttribute("position",new S.Float32BufferAttribute(this._geometryCurvePostion[y],2)),_.setAttribute("color",new S.Float32BufferAttribute(this._geometryCurveColor[y],3)),_.setAttribute("tran1",new S.InstancedBufferAttribute(new Float32Array(o),4)),_.setAttribute("tran2",new S.InstancedBufferAttribute(new Float32Array(s),4)),_.setAttribute("tran3",new S.InstancedBufferAttribute(new Float32Array(l),4)),_.setAttribute("tran4",new S.InstancedBufferAttribute(new Float32Array(c),4)),_.setAttribute("ishide",new S.InstancedBufferAttribute(new Float32Array(u),1)),(w=new S.LineSegments(_,v)).frustumCulled=!1,w.renderOrder=10,b.add(w),this._entitys.push(w);for(y=0;y<this._geometryCurvePositionsByBlock.length;y++)(_=new S.InstancedBufferGeometry).maxInstancedCount=i.length,_.setAttribute("position",new S.Float32BufferAttribute(this._geometryCurvePositionsByBlock[y],2)),_.setAttribute("color",new S.InstancedBufferAttribute(new Float32Array(h),3)),_.setAttribute("tran1",new S.InstancedBufferAttribute(new Float32Array(o),4)),_.setAttribute("tran2",new S.InstancedBufferAttribute(new Float32Array(s),4)),_.setAttribute("tran3",new S.InstancedBufferAttribute(new Float32Array(l),4)),_.setAttribute("tran4",new S.InstancedBufferAttribute(new Float32Array(c),4)),_.setAttribute("ishide",new S.InstancedBufferAttribute(new Float32Array(u),1)),(w=new S.LineSegments(_,v)).frustumCulled=!1,w.renderOrder=10,b.add(w),this._entitys.push(w);for(y=0;y<this._geometryCurvePositionsByBlock_ZeroLayer.length;y++)(_=new S.InstancedBufferGeometry).maxInstancedCount=i.length,_.setAttribute("position",new S.Float32BufferAttribute(this._geometryCurvePositionsByBlock_ZeroLayer[y],2)),_.setAttribute("color",new S.InstancedBufferAttribute(new Float32Array(d),3)),_.setAttribute("tran1",new S.InstancedBufferAttribute(new Float32Array(o),4)),_.setAttribute("tran2",new S.InstancedBufferAttribute(new Float32Array(s),4)),_.setAttribute("tran3",new S.InstancedBufferAttribute(new Float32Array(l),4)),_.setAttribute("tran4",new S.InstancedBufferAttribute(new Float32Array(c),4)),_.setAttribute("ishide",new S.InstancedBufferAttribute(new Float32Array(u),1)),(w=new S.LineSegments(_,v)).frustumCulled=!1,w.renderOrder=10,b.add(w),this._entitys.push(w);var x=new S.RawShaderMaterial({uniforms:{color:{value:this._color},clippt1:{value:r},clippt2:{value:a},vieww:{value:m},viewh:{value:g}},vertexShader:C.MxShader.VSHADER_COLOR_POINT_BYLAYER_CLIP,fragmentShader:C.MxShader.FSHADER_COLOR_POINT_CLIP,linewidth:1,transparent:!0});for(this._material_clip.push(x),y=0;y<this._geometryCurvePositionsByLayer.length;y++){var _,w;(_=new S.InstancedBufferGeometry).maxInstancedCount=i.length,_.setAttribute("position",new S.Float32BufferAttribute(this._geometryCurvePositionsByLayer[y],2)),_.setAttribute("tran1",new S.InstancedBufferAttribute(new Float32Array(o),4)),_.setAttribute("tran2",new S.InstancedBufferAttribute(new Float32Array(s),4)),_.setAttribute("tran3",new S.InstancedBufferAttribute(new Float32Array(l),4)),_.setAttribute("tran4",new S.InstancedBufferAttribute(new Float32Array(c),4)),_.setAttribute("ishide",new S.InstancedBufferAttribute(new Float32Array(u),1)),(w=new S.LineSegments(_,x)).frustumCulled=!1,w.renderOrder=10,b.add(w),this._entitys.push(w)}}},this)},r.prototype.createThreejsObjForCurve=function(t,e){if(0!=t.length){for(var n=[],i=[],r=[],a=[],o=[],s=[],l=[],c=0;c<t.length;c++){var u=t[c];n=n.concat(u.mat.elements.slice(0,4)),i=i.concat(u.mat.elements.slice(4,8)),r=r.concat(u.mat.elements.slice(8,12)),a=a.concat(u.mat.elements.slice(12,16)),o.push(0)}if(0<this._geometryCurvePositionsByBlock.length)for(c=0;c<t.length;c++)s=s.concat(t[c].color);if(0<this._geometryCurvePositionsByBlock_ZeroLayer.length)for(c=0;c<t.length;c++)l=l.concat(t[c].topLayerColor);for(var h=new S.RawShaderMaterial({vertexShader:C.MxShader.VSHADER_COLOR_POINT,fragmentShader:C.MxShader.FSHADER_COLOR_POINT,linewidth:1,transparent:!0}),d=0;d<this._geometryCurvePostion.length;d++)(f=new S.InstancedBufferGeometry).maxInstancedCount=t.length,f.setAttribute("position",new S.Float32BufferAttribute(this._geometryCurvePostion[d],2)),f.setAttribute("color",new S.Float32BufferAttribute(this._geometryCurveColor[d],3)),f.setAttribute("tran1",new S.InstancedBufferAttribute(new Float32Array(n),4)),f.setAttribute("tran2",new S.InstancedBufferAttribute(new Float32Array(i),4)),f.setAttribute("tran3",new S.InstancedBufferAttribute(new Float32Array(r),4)),f.setAttribute("tran4",new S.InstancedBufferAttribute(new Float32Array(a),4)),f.setAttribute("ishide",new S.InstancedBufferAttribute(new Float32Array(o),1)),(m=new S.LineSegments(f,h)).frustumCulled=!1,m.renderOrder=10,e.add(m),this._entitys.push(m);for(d=0;d<this._geometryCurvePositionsByBlock.length;d++)(f=new S.InstancedBufferGeometry).maxInstancedCount=t.length,f.setAttribute("position",new S.Float32BufferAttribute(this._geometryCurvePositionsByBlock[d],2)),f.setAttribute("color",new S.InstancedBufferAttribute(new Float32Array(s),3)),f.setAttribute("tran1",new S.InstancedBufferAttribute(new Float32Array(n),4)),f.setAttribute("tran2",new S.InstancedBufferAttribute(new Float32Array(i),4)),f.setAttribute("tran3",new S.InstancedBufferAttribute(new Float32Array(r),4)),f.setAttribute("tran4",new S.InstancedBufferAttribute(new Float32Array(a),4)),f.setAttribute("ishide",new S.InstancedBufferAttribute(new Float32Array(o),1)),(m=new S.LineSegments(f,h)).frustumCulled=!1,m.renderOrder=10,e.add(m),this._entitys.push(m);for(d=0;d<this._geometryCurvePositionsByBlock_ZeroLayer.length;d++)(f=new S.InstancedBufferGeometry).maxInstancedCount=t.length,f.setAttribute("position",new S.Float32BufferAttribute(this._geometryCurvePositionsByBlock_ZeroLayer[d],2)),f.setAttribute("color",new S.InstancedBufferAttribute(new Float32Array(l),3)),f.setAttribute("tran1",new S.InstancedBufferAttribute(new Float32Array(n),4)),f.setAttribute("tran2",new S.InstancedBufferAttribute(new Float32Array(i),4)),f.setAttribute("tran3",new S.InstancedBufferAttribute(new Float32Array(r),4)),f.setAttribute("tran4",new S.InstancedBufferAttribute(new Float32Array(a),4)),f.setAttribute("ishide",new S.InstancedBufferAttribute(new Float32Array(o),1)),(m=new S.LineSegments(f,h)).frustumCulled=!1,m.renderOrder=10,e.add(m),this._entitys.push(m);var p=new S.RawShaderMaterial({uniforms:{color:{value:this._color}},vertexShader:C.MxShader.VSHADER_COLOR_POINT_BYLAYER,fragmentShader:C.MxShader.FSHADER_COLOR_POINT,linewidth:1,transparent:!0});for(d=0;d<this._geometryCurvePositionsByLayer.length;d++){var f,m;(f=new S.InstancedBufferGeometry).maxInstancedCount=t.length,f.setAttribute("position",new S.Float32BufferAttribute(this._geometryCurvePositionsByLayer[d],2)),f.setAttribute("tran1",new S.InstancedBufferAttribute(new Float32Array(n),4)),f.setAttribute("tran2",new S.InstancedBufferAttribute(new Float32Array(i),4)),f.setAttribute("tran3",new S.InstancedBufferAttribute(new Float32Array(r),4)),f.setAttribute("tran4",new S.InstancedBufferAttribute(new Float32Array(a),4)),f.setAttribute("ishide",new S.InstancedBufferAttribute(new Float32Array(o),1)),(m=new S.LineSegments(f,p)).frustumCulled=!1,m.renderOrder=10,e.add(m),this._entitys.push(m)}}},r.prototype.createThreejsObjForMesh=function(t,e){if(0!=t.length){for(var n=[],i=[],r=[],a=[],o=[],s=[],l=[],c=0;c<t.length;c++){var u=t[c];n=n.concat(u.mat.elements.slice(0,4)),i=i.concat(u.mat.elements.slice(4,8)),r=r.concat(u.mat.elements.slice(8,12)),a=a.concat(u.mat.elements.slice(12,16)),o.push(0),s=s.concat(t[c].color)}if(0<this._geometryMeshPositionsByBlock.length)for(c=0;c<t.length;c++)s=s.concat(t[c].color);if(0<this._geometryMeshPositionsByBlock_ZeroLayer.length)for(c=0;c<t.length;c++)l=l.concat(t[c].topLayerColor);for(var h=new S.RawShaderMaterial({vertexShader:C.MxShader.VSHADER_COLOR_POINT,fragmentShader:C.MxShader.FSHADER_COLOR_POINT,transparent:!0,side:S.DoubleSide}),d=0;d<this._geometryMeshPostion.length;d++)(f=new S.InstancedBufferGeometry).maxInstancedCount=t.length,f.setAttribute("position",new S.Float32BufferAttribute(this._geometryMeshPostion[d],2)),f.setAttribute("color",new S.Float32BufferAttribute(this._geometryMeshColor[d],3)),f.setAttribute("tran1",new S.InstancedBufferAttribute(new Float32Array(n),4)),f.setAttribute("tran2",new S.InstancedBufferAttribute(new Float32Array(i),4)),f.setAttribute("tran3",new S.InstancedBufferAttribute(new Float32Array(r),4)),f.setAttribute("tran4",new S.InstancedBufferAttribute(new Float32Array(a),4)),f.setAttribute("ishide",new S.InstancedBufferAttribute(new Float32Array(o),1)),(m=new S.Mesh(f,h)).frustumCulled=!1,m.renderOrder=1,e.add(m),this._entitys.push(m);for(d=0;d<this._geometryMeshPositionsByBlock.length;d++)(f=new S.InstancedBufferGeometry).maxInstancedCount=t.length,f.setAttribute("position",new S.Float32BufferAttribute(this._geometryMeshPositionsByBlock[d],2)),f.setAttribute("color",new S.InstancedBufferAttribute(new Float32Array(s),3)),f.setAttribute("tran1",new S.InstancedBufferAttribute(new Float32Array(n),4)),f.setAttribute("tran2",new S.InstancedBufferAttribute(new Float32Array(i),4)),f.setAttribute("tran3",new S.InstancedBufferAttribute(new Float32Array(r),4)),f.setAttribute("tran4",new S.InstancedBufferAttribute(new Float32Array(a),4)),f.setAttribute("ishide",new S.InstancedBufferAttribute(new Float32Array(o),1)),(m=new S.Mesh(f,h)).frustumCulled=!1,m.renderOrder=1,e.add(m),this._entitys.push(m);for(d=0;d<this._geometryMeshPositionsByBlock_ZeroLayer.length;d++)(f=new S.InstancedBufferGeometry).maxInstancedCount=t.length,f.setAttribute("position",new S.Float32BufferAttribute(this._geometryMeshPositionsByBlock_ZeroLayer[d],2)),f.setAttribute("color",new S.InstancedBufferAttribute(new Float32Array(l),3)),f.setAttribute("tran1",new S.InstancedBufferAttribute(new Float32Array(n),4)),f.setAttribute("tran2",new S.InstancedBufferAttribute(new Float32Array(i),4)),f.setAttribute("tran3",new S.InstancedBufferAttribute(new Float32Array(r),4)),f.setAttribute("tran4",new S.InstancedBufferAttribute(new Float32Array(a),4)),f.setAttribute("ishide",new S.InstancedBufferAttribute(new Float32Array(o),1)),(m=new S.Mesh(f,h)).frustumCulled=!1,m.renderOrder=1,e.add(m),this._entitys.push(m);var p=new S.RawShaderMaterial({uniforms:{color:{value:this._color}},vertexShader:C.MxShader.VSHADER_COLOR_POINT,fragmentShader:C.MxShader.FSHADER_COLOR_POINT,transparent:!0,side:S.DoubleSide});for(d=0;d<this._geometryMeshPositionsByLayer.length;d++){var f,m;(f=new S.InstancedBufferGeometry).maxInstancedCount=t.length,f.setAttribute("position",new S.Float32BufferAttribute(this._geometryMeshPositionsByLayer[d],2)),f.setAttribute("tran1",new S.InstancedBufferAttribute(new Float32Array(n),4)),f.setAttribute("tran2",new S.InstancedBufferAttribute(new Float32Array(i),4)),f.setAttribute("tran3",new S.InstancedBufferAttribute(new Float32Array(r),4)),f.setAttribute("tran4",new S.InstancedBufferAttribute(new Float32Array(a),4)),f.setAttribute("ishide",new S.InstancedBufferAttribute(new Float32Array(o),1)),(m=new S.Mesh(f,p)).frustumCulled=!1,m.renderOrder=1,e.add(m),this._entitys.push(m)}}},r.prototype.addGeometryCurve=function(t,e,n,i,r){0<t.length&&(this._geometryCurvePostion.push(t),this._geometryCurveColor.push(e)),0<n.length&&this._geometryCurvePositionsByBlock.push(n),0<i.length&&this._geometryCurvePositionsByLayer.push(i),0<r.length&&this._geometryCurvePositionsByBlock_ZeroLayer.push(r)},r.prototype.addGeometryMesh=function(t,e,n,i,r){0<t.length&&(this._geometryMeshPostion.push(t),this._geometryMeshColor.push(e)),0<n.length&&this._geometryMeshPositionsByBlock.push(n),0<i.length&&this._geometryMeshPositionsByLayer.push(i),0<r.length&&this._geometryMeshPositionsByBlock_ZeroLayer.push(r)},r.prototype.createThreejsObj=function(t,e,n,i,r){var a=n.getScene(),o=n.getCanvas();if(0!=t.length){if(null==this._color){var s=i.getColor(r);this._color=[],this._color.push((255&s)/255,(s>>8&255)/255,(s>>16&255)/255)}0==this._geometryCurvePostion.length&&0==this._geometryCurvePositionsByBlock.length&&0==this._geometryCurvePositionsByLayer.length&&0==this._geometryCurvePositionsByBlock_ZeroLayer.length||this.createThreejsObjForCurve(t,a),0==this._geometryMeshPostion.length&&0==this._geometryMeshPositionsByBlock.length&&0==this._geometryMeshPositionsByLayer.length&&0==this._geometryMeshPositionsByBlock_ZeroLayer.length||this.createThreejsObjForMesh(t,a)}0!=e.size&&(null==this._color&&(s=i.getColor(r),this._color=[],this._color.push((255&s)/255,(s>>8&255)/255,(s>>16&255)/255)),0==this._geometryCurvePostion.length&&0==this._geometryCurvePositionsByBlock.length&&0==this._geometryCurvePositionsByLayer.length&&0==this._geometryCurvePositionsByBlock_ZeroLayer.length||this.createThreejsObjForCurve_Clip(e,a,o),0==this._geometryMeshPostion.length&&0==this._geometryMeshPositionsByBlock.length&&0==this._geometryMeshPositionsByLayer.length&&0==this._geometryMeshPositionsByBlock_ZeroLayer.length||this.createThreejsObjForMesh_Clip(e,a,o)),this._geometryCurvePostion=[],this._geometryCurvePositionsByBlock=[],this._geometryCurvePositionsByLayer=[],this._geometryCurvePositionsByBlock_ZeroLayer=[],this._geometryCurveColor=[],this._geometryMeshPostion=[],this._geometryMeshPositionsByBlock=[],this._geometryMeshPositionsByLayer=[],this._geometryMeshPositionsByBlock_ZeroLayer=[],this._geometryMeshColor=[]},r);function r(t){this._blockRecId=0,this._geometryCurvePostion=new Array,this._geometryCurveColor=new Array,this._geometryMeshPostion=new Array,this._geometryMeshColor=new Array,this._geometryCurvePositionsByBlock=new Array,this._geometryMeshPositionsByBlock=new Array,this._geometryCurvePositionsByLayer=new Array,this._geometryMeshPositionsByLayer=new Array,this._geometryCurvePositionsByBlock_ZeroLayer=new Array,this._geometryMeshPositionsByBlock_ZeroLayer=new Array,this._entitys=new Array,this._color=void 0,this._material_clip=[],this._blockRecId=t}n.Layer=s;var a=(o.prototype.showLayer=function(t,e){var n=this._layerTogeometry.get(t);null!=n&&n.Show(e)},o.prototype.updataClipMaterial=function(t){var i=t.getCanvas();this._layerTogeometry.forEach(function(t,e,n){t.updataClipMaterial(i)})},o.prototype.getId=function(){return this._id},o.prototype.getBlkRef=function(){return this._blkRef},o.prototype.createThreejsObj=function(i,r){var a=this;this._layerTogeometry.forEach(function(t,e,n){t.createThreejsObj(a._instance,a._instance_clip,i,r,e)})},o.prototype.addGeometryCurve=function(t,e,n,i,r,a){var o=this._layerTogeometry.get(n);null==o&&(o=new s(this._id),this._layerTogeometry.set(n,o)),o.addGeometryCurve(t,e,i,r,a)},o.prototype.addGeometryMesh=function(t,e,n,i,r,a){var o=this._layerTogeometry.get(n);null==o&&(o=new s(this._id),this._layerTogeometry.set(n,o)),o.addGeometryMesh(t,e,i,r,a)},o.prototype.addInstance=function(t){if(0==t.clipPlans.clipPlanArray.length)this._instance.push(t);else{var e=this._instance_clip.get(t.clipPlans.id);null==e&&(e=[],this._instance_clip.set(t.clipPlans.id,e)),e.push(t)}},o.prototype.addBlkRef=function(t){this._blkRef.push(t)},o);function o(t){this._id=0,this._layerTogeometry=new Map,this._blkRef=[],this._instance=[],this._instance_clip=new Map,this._id=t}n.Block=a;var l=(c.prototype.crateBlock=function(t){var e=this._mapBlock.get(t);return null==e&&(e=new a(t),this._mapBlock.set(t,e)),e},c.prototype.getBlock=function(t){return this._mapBlock.get(t)},c.prototype.addBlockRef=function(t){this.crateBlock(t.blkOwnerId).addBlkRef(t)},c.prototype.showLayer=function(t,e){this._mapBlock.forEach(function(t,e){var i=t,r=e;return function(t,e,n){t.showLayer(i,r)}}.call(this,t,e))},c.prototype.createBlocks=function(t,e){if(!this._isCreate){this.crateBlock(0);for(var n=1,i=t.getInt32(12,!0),r=80,a=0;a<i;a++){var o=t.getInt32(r,!0);r+=4;var s=t.getInt32(r,!0);r+=4;var l=t.getInt32(r,!0);r+=4;var c=t.getInt32(r,!0);r+=4;for(var u=new Array,h=0;h<16;h++){var d=t.getFloat32(r,!0);r+=4,u.push(d)}var p=t.getInt32(r,!0);r+=4;var f=new M;f.id=n,n++,f.clipPlanArray=[];for(var m=0;m<p;m++){var g=t.getFloat32(r,!0);r+=4;var v=t.getFloat32(r,!0);r+=4;var y=t.getFloat32(r,!0);r+=4;var x=t.getFloat32(r,!0);r+=4;var _=new b;_.x1=g,_.y1=v,_.x2=y,_.y2=x,f.clipPlanArray.push(_)}var w=new T;w.mat=new S.Matrix4,w.mat.fromArray(u),w.blkRecId=l,w.blkOwnerId=o,w.layerId=s,w.color=c,w.clipPlans=f,this.crateBlock(l),this.addBlockRef(w)}this._isGetAllBlocks=!0,this._isCreate=!0}},c.prototype.updataClipMaterial=function(i){this._mapBlock.forEach(function(t,e,n){t.updataClipMaterial(i)})},c.prototype.createAllInstance=function(t){var e=this.getBlock(0);if(null==e)return!1;if(null==this._rootBlockRef)return!1;var n=new S.Matrix4,i=new Map,r=new M;return this.createAllInstanceCall(e,this._rootBlockRef,n,i,16777215,t,void 0,r),!0},c.prototype.createThreejsObj=function(t,i,r){null==this._mapNeedCreateThreejsObj.get(t.getId())&&this._mapNeedCreateThreejsObj.set(t.getId(),t),this._isCreateAllInstance||this._isGetAllBlocks&&r.isInitComplete()&&(this._isCreateAllInstance=this.createAllInstance(r)),this._isCreateAllInstance&&(this._mapNeedCreateThreejsObj.forEach(function(t,e,n){t.createThreejsObj(i,r)}),this._mapNeedCreateThreejsObj.clear())},c.prototype.createAllInstanceCall=function(t,e,n,i,r,a,o,s){if(1!=i[t.getId()]){i[t.getId()]=!0;var l=new x;if(l.mat=new S.Matrix4,l.mat.copy(n),l.mat.multiply(e.mat),0==e.clipPlans.clipPlanArray.length)l.clipPlans=s;else{l.clipPlans=e.clipPlans;for(var c=l.clipPlans.clipPlanArray.length,u=0;u<c;u++){var h=new S.Vector3(l.clipPlans.clipPlanArray[u].x1,l.clipPlans.clipPlanArray[u].y1,0),d=new S.Vector3(l.clipPlans.clipPlanArray[u].x2,l.clipPlans.clipPlanArray[u].y2,0);h.applyMatrix4(l.mat),d.applyMatrix4(l.mat),l.clipPlans.clipPlanArray[u].x1=h.x,l.clipPlans.clipPlanArray[u].y1=h.y,l.clipPlans.clipPlanArray[u].x2=d.x,l.clipPlans.clipPlanArray[u].y2=d.y}}null==o?l.topLayerColor.push(1,1,1):l.topLayerColor.push(o[0],o[1],o[2]);var p=e.color>>24&255;if(2==p)l.color.push((255&r)/255,(r>>8&255)/255,(r>>16&255)/255);else if(1==p){var f=a.getColor(e.layerId);l.color.push((255&f)/255,(f>>8&255)/255,(f>>16&255)/255),r=f}else l.color.push((255&e.color)/255,(e.color>>8&255)/255,(e.color>>16&255)/255),r=e.color;t.addInstance(l);for(var m=t.getBlkRef(),g=null==o,v=0;v<m.length;v++)if(0!=m[v].blkRecId){var y=this.getBlock(m[v].blkRecId);if(null==y)return;g&&(o=[],f=a.getColor(m[v].layerId),o.push((255&f)/255,(f>>8&255)/255,(f>>16&255)/255)),this.createAllInstanceCall(y,m[v],l.mat,i,r,a,o,l.clipPlans)}i[t.getId()]=!1}},c.prototype.initRootBlockRef=function(t){null==t&&((t=new T).mat=new S.Matrix4,t.blkRecId=0,t.blkOwnerId=-1,t.layerId=-1,t.color=16777215),this._rootBlockRef=t},c);function c(){this._mapBlock=new Map,this._mapNeedCreateThreejsObj=new Map,this._isCreate=!1,this._isGetAllBlocks=!1,this._isCreateAllInstance=!1,this._rootBlockRef=void 0}n.Blocks=l;var u=function(){this.blocks=new l,this.layers=new i.MxBrowseLayerData};n.ExternalReferenceDatabase=u;var h=(d.prototype.createTzDwgExternalReferences=function(t){this._mapId2ExternalDatabase.get(t)||this.getBlocks(t).initRootBlockRef()},d.prototype.createExternalReferences=function(t){for(var e=t.getInt32(12,!0),n=80,i=0;i<e;i++){for(var r=new Array,a=0;a<16;a++){var o=t.getFloat32(n,!0);n+=4,r.push(o)}var s=t.getInt32(n,!0);n+=4;var l=t.getInt32(n,!0);if(n+=4,t.getInt32(n,!0),n+=4,0!=s){var c=this.getBlocks(s),u=new T;u.mat=new S.Matrix4,u.mat.fromArray(r),u.blkRecId=0,u.blkOwnerId=-1,u.layerId=-1,u.color=l,c.initRootBlockRef(u)}else console.log("mx error iDatabaseIndex")}},d.prototype.getBlocks=function(t){if(0!=t){var e=this._mapId2ExternalDatabase.get(t);return null==e&&(e=new u,this._mapId2ExternalDatabase.set(t,e)),e.blocks}console.log("mx error iDatabaseIndex")},d.prototype.getLayers=function(t){if(0!=t){var e=this._mapId2ExternalDatabase.get(t);return null==e&&(e=new u,this._mapId2ExternalDatabase.set(t,e)),e.layers}console.log("mx error iDatabaseIndex")},d);function d(){this._mapId2ExternalDatabase=new Map}n.ExternalReferenceManager=h},{"./MxBrowseLayerData":24,"./MxShader":49,three:19}],24:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.MxBrowseLayerData=void 0;var i=(r.prototype.add=function(t,e,n){this._layerColor[t]=e,this._nametoId[n]=t},r.prototype.setZeroLayerId=function(t){this._zeroLayerId=t},r.prototype.getZeroLayerId=function(){return this._zeroLayerId},r.prototype.getLayerIdForName=function(t){return null==this._nametoId[t]?0:this._nametoId[t]},r.prototype.getColor=function(t){return null==this._layerColor[t]?16777215:this._layerColor[t]},r.prototype.initComplete=function(){this._isSetInstanceComplete=!0},r.prototype.isInitComplete=function(){return this._isSetInstanceComplete},r);function r(){this._isSetInstanceComplete=!1,this._layerColor=new Map,this._nametoId=new Map,this._zeroLayerId=0}n.MxBrowseLayerData=i},{}],25:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.MxCADSyncDisplay=n.MxCADDisplayFun=n.MxCADDatabase=n.MxCADLayerTable=n.MxCADLayerTableRecord=n.MxCADDisplayBlockTable=n.MxCADDisplayBlockRecord=n.MxCADDisplayLayerTable=n.MxCADDisplayLayerRecord=n.MxCADDisplayMemorySections=n.MxCADDisplayMemorySection=n.MxCADDisplayMemorySectionType=n.MxCADDisplayBlockInstance=n.MxCADDisplayBlockRef=n.MxCADDisplayClipPlans=n.MxCADDisplayClipPlan=void 0;function i(){this.x1=0,this.y1=0,this.x2=0,this.y2=0}var T=t("three"),a=t("./MxFun"),E=t("./MxShader"),f=t("./MxCADNetData");n.MxCADDisplayClipPlan=i;var r=function(){this.id=1,this.clipPlanArray=new Array};n.MxCADDisplayClipPlans=r;var o=function(){this.mat=new T.Matrix4,this.blkRecId=-1,this.blkOwnerId=0,this.layerId=-1,this.color=0,this.clipPlans=new r};n.MxCADDisplayBlockRef=o;function s(){this.mat=new T.Matrix4,this.clipPlans=new r}var A,l;n.MxCADDisplayBlockInstance=s,(l=A=n.MxCADDisplayMemorySectionType||(n.MxCADDisplayMemorySectionType={}))[l.kLinesType=1]="kLinesType",l[l.kTriangleType=2]="kTriangleType";var m=function(){this.id=0,this.type=A.kLinesType,this.blockId=0,this.layerId=0,this.color=0,this.points=[]};n.MxCADDisplayMemorySection=m;var c=(u.prototype.add=function(t){this.datas.set(t.id,t)},u.prototype.get=function(t){return this.datas.get(t)},u.prototype.remove=function(t){this.datas.delete(t)},u.prototype.has=function(t){return this.datas.has(t)},u.prototype.clearAll=function(){this.datas=new Map},u);function u(){this.datas=new Map}n.MxCADDisplayMemorySections=c;var h=(d.prototype.addColorByLayerMaterial=function(t,e){this.mapColorByLayerMaterial.set(t,e)},d.prototype.upColorToByLayerMaterial=function(e){this.mapColorByLayerMaterial.forEach(function(t){t.uniformsNeedUpdate=!0,t.needsUpdate=!0,t.uniforms={color:{value:e}}})},d.prototype.getId=function(){return this.id},d.prototype.getBlockRecordId=function(){return this.blockRecId},d.prototype.createMemorySectionToEntityArray=function(t){var e=this.mapMemorySectionIdToEntity.get(t);return e||(e=new Array,this.mapMemorySectionIdToEntity.set(t,e),e)},d.prototype.show=function(n){this.mapMemorySectionIdToEntity.forEach(function(t){for(var e in t)t[e].visible=n})},d.prototype.addEntity=function(t,e){this.createMemorySectionToEntityArray(t).push(e)},d.prototype.deleteMemorySectionEntitys=function(t,e){var n=this.mapMemorySectionIdToEntity.get(t);if(!n)return!1;for(var i=n.length,r=0;r<i;r++)a.MxFun.removeThreejsObject(n[r],e);return this.mapMemorySectionIdToEntity.delete(t),this.mapColorByLayerMaterial.delete(t),!0},d.prototype.addClipMaterial=function(t){this.material_clip.push(t)},d.prototype.updataClipMaterial=function(t){for(var e=this.material_clip.length,n=.5*t.width,i=.5*t.height,r=0;r<e;r++)this.material_clip[r].uniforms.vieww.value=n,this.material_clip[r].uniforms.viewh.value=i},d);function d(t,e){this.id=0,this.blockRecId=0,this.mapMemorySectionIdToEntity=new Map,this.mapColorByLayerMaterial=new Map,this.material_clip=[],this.id=t,this.blockRecId=e}n.MxCADDisplayLayerRecord=h;var p=(g.prototype.createLayerRecord=function(t){var e=this.layers.get(t);return e||(e=new h(t,this.blockRecId),this.layers.set(t,e),e)},g.prototype.getLayerRecord=function(t){return this.layers.get(t)},g);function g(t){this.blockRecId=0,this.layers=new Map,this.blockRecId=t}n.MxCADDisplayLayerTable=p;var v=(y.prototype.getId=function(){return this.id},y.prototype.addBlkRef=function(t){this.blkRefs.set(t.id,t)},y.prototype.getAllBlkRef=function(){return this.blkRefs},y.prototype.addInstance=function(t){this.blkInstances.push(t)},y.prototype.deleteAllInstance=function(){this.blkInstances=new Array},y.prototype.deleteBlkRef=function(){this.blkRefs=new Map},y.prototype.getLayerTable=function(){return this.layerTable},y.prototype.getInstances=function(){return this.blkInstances},y.prototype.getInstances_class=function(){for(var t=[],e=new Map,n=this.blkInstances.length,i=0;i<n;i++){var r=this.blkInstances[i];if(0==r.clipPlans.clipPlanArray.length)t.push(r);else{var a=e.get(r.clipPlans.id);null==a&&(a=[],e.set(r.clipPlans.id,a)),a.push(r)}}var o={};return o.aryInstanceNoClip=t,o.mapInstanceClip=e,o},y);function y(t){this.id=0,this.blkRefs=new Map,this.blkInstances=new Array,this.id=t||0,this.layerTable=new p(this.id)}n.MxCADDisplayBlockRecord=v;var x=(_.prototype.crateBlockRecord=function(t){var e=this.blocks.get(t);return null==e&&(e=new v(t),this.blocks.set(t,e)),e},_.prototype.getBlockRecord=function(t){return this.blocks.get(t)},_.prototype.getAllBlockRecord=function(){return this.blocks},_.prototype.reInit=function(t){this.blocks=new Map,this.curSpaceBlockRecId=t||0,this.crateBlockRecord(this.curSpaceBlockRecId)},_);function _(){this.blocks=new Map,this.curSpaceBlockRecId=0}n.MxCADDisplayBlockTable=x;var w=function(){};n.MxCADLayerTableRecord=w;var b=(M.prototype.add=function(t,e,n,i){var r=new w;r.id=t,r.name=n,r.color=e,r.off=i,this.mapData.set(t,r)},M.prototype.getAllLayerData=function(){for(var t,e=new Array,n=this.mapData.values();!(t=n.next()).done;){var i=new w;i.color=t.value.color,i.name=t.value.name,i.off=t.value.off,i.id=t.value.id,e.push(i)}return e},M.prototype.setZeroLayerId=function(t){this.zeroLayerId=t},M.prototype.getZeroLayerId=function(){return this.zeroLayerId},M.prototype.getLayerIdForName=function(t){for(var e,n=this.mapData.values();!(e=n.next()).done;)if(e.value.name==t)return e.value.id;return 0},M.prototype.getColor=function(t){var e=this.mapData.get(t);return e?e.color:0},M.prototype.getRecord=function(t){return this.mapData.get(t)},M.prototype.isOff=function(t){var e=this.mapData.get(t);return!e||e.off},M.prototype.upDisplayForLayerData=function(o,t){for(var s,l=t,e=l.length,c=!1,n=function(t){var e=l[t],n=e.id;if(0==n)return"continue";var i=u.getRecord(n);if(!i)return"continue";var r=e.color.split(",");if(r.length<3)return"continue";var a=255&parseInt(r[0])|parseInt(r[1])<<8&65280|parseInt(r[2])<<16&16711680;if((16777215&i.color)==a)return"continue";i.color=4278190080&i.color|a,(s=[]).push((255&i.color)/255,(i.color>>8&255)/255,(i.color>>16&255)/255),o.getDisplayBlockTable().getAllBlockRecord().forEach(function(t){var e=t.getLayerTable().getLayerRecord(n);e&&e.upColorToByLayerMaterial(s)}),c=!0},u=this,i=0;i<e;i++)n(i);var r=function(t){var e=l[t],n=e.id;if(0==n)return"continue";var i=a.getRecord(n);return i&&i.off!=e.off?(i.off=e.off,o.getDisplayBlockTable().getAllBlockRecord().forEach(function(t){var e=t.getLayerTable().getLayerRecord(n);e&&e.show(!i.off)}),void(c=!0)):"continue"},a=this;for(i=0;i<e;i++)r(i);return c},M);function M(){this.mapData=new Map,this.zeroLayerId=0}n.MxCADLayerTable=b;var S,C,D=(L.prototype.initRootBlockRef=function(t){t?this.dpRootBlkRef=t:(this.dpRootBlkRef=new o,this.dpRootBlkRef.mat=new T.Matrix4,this.dpRootBlkRef.blkRecId=0,this.dpRootBlkRef.blkOwnerId=-1,this.dpRootBlkRef.layerId=-1,this.dpRootBlkRef.color=16777215,this.dpRootBlkRef.id=0)},L.prototype.reInit=function(){this.dpBlockTable=new x,this.layerTable=new b,this.memSections=new c,this.initRootBlockRef()},L.prototype.getMxObj=function(){return this.mxObj},L.prototype.getDisplayRootBlockRef=function(){return this.dpRootBlkRef},L.prototype.getDisplayBlockTable=function(){return this.dpBlockTable},L.prototype.getLayerTable=function(){return this.layerTable},L.prototype.getMemSections=function(){return this.memSections},L);function L(t){this.dpBlockTable=new x,this.dpRootBlkRef=null,this.layerTable=new b,this.memSections=new c,this.mxObj=null,this.mxObj=t,this.initRootBlockRef()}n.MxCADDatabase=D,(C=S=n.MxCADDisplayFun||(n.MxCADDisplayFun={})).showLayer=function(t,n,i){t.getDisplayBlockTable().getAllBlockRecord().forEach(function(t){var e=t.getLayerTable().getLayerRecord(n);e&&e.show(i)})},C.createThreejsObjForMemData_Clip=function(t,e,n,i,r,a){if(0==t.length)return!1;var o=[],s=[],l=t[0].clipPlans.clipPlanArray[0];o.push(l.x1,l.y1),s.push(l.x2,l.y2);for(var c=[],u=[],h=[],d=[],p=[],f=0;f<t.length;f++){var m=t[f];c=c.concat(m.mat.elements.slice(0,4)),u=u.concat(m.mat.elements.slice(4,8)),h=h.concat(m.mat.elements.slice(8,12)),d=d.concat(m.mat.elements.slice(12,16)),p.push(0)}var g=e.color,v=16777216==(4278190080&g);v&&(g=r);var y=[];y.push(255&g,(65280&g)>>8,(16711680&g)>>16);var x=this.mxObj.getCanvas(),_=.5*x.width,w=.5*x.height;if(e.type==A.kLinesType){var b=new T.RawShaderMaterial({uniforms:{color:{value:y},clippt1:{value:o},clippt2:{value:s},vieww:{value:_},viewh:{value:w}},vertexShader:E.MxShader.VSHADER_COLOR_POINT_CLIP_FORMXCAD,fragmentShader:E.MxShader.FSHADER_COLOR_POINT_CLIP_FORMXCAD,linewidth:1,transparent:!0});n.addClipMaterial(b),(S=new T.InstancedBufferGeometry).maxInstancedCount=t.length,S.setAttribute("position",new T.Float32BufferAttribute(e.points,2)),S.setAttribute("tran1",new T.InstancedBufferAttribute(new Float32Array(c),4)),S.setAttribute("tran2",new T.InstancedBufferAttribute(new Float32Array(u),4)),S.setAttribute("tran3",new T.InstancedBufferAttribute(new Float32Array(h),4)),S.setAttribute("tran4",new T.InstancedBufferAttribute(new Float32Array(d),4)),S.setAttribute("ishide",new T.InstancedBufferAttribute(new Float32Array(p),1));var M=new T.LineSegments(S,b);M.frustumCulled=!1,M.renderOrder=10,i.add(M),n.addEntity(e.id,M),v&&n.addColorByLayerMaterial(e.id,b)}else if(e.type==A.kTriangleType){var S;b=new T.RawShaderMaterial({uniforms:{color:{value:y},clippt1:{value:o},clippt2:{value:s},vieww:{value:_},viewh:{value:w}},vertexShader:E.MxShader.VSHADER_COLOR_POINT_CLIP_FORMXCAD,fragmentShader:E.MxShader.FSHADER_COLOR_POINT_CLIP_FORMXCAD,transparent:!0,side:T.DoubleSide});n.addClipMaterial(b),(S=new T.InstancedBufferGeometry).maxInstancedCount=t.length,S.setAttribute("position",new T.Float32BufferAttribute(e.points,2)),S.setAttribute("tran1",new T.InstancedBufferAttribute(new Float32Array(c),4)),S.setAttribute("tran2",new T.InstancedBufferAttribute(new Float32Array(u),4)),S.setAttribute("tran3",new T.InstancedBufferAttribute(new Float32Array(h),4)),S.setAttribute("tran4",new T.InstancedBufferAttribute(new Float32Array(d),4)),S.setAttribute("ishide",new T.InstancedBufferAttribute(new Float32Array(p),1));var C=new T.Mesh(S,b);C.frustumCulled=!1,C.renderOrder=1,i.add(C),n.addEntity(e.id,C),v&&n.addColorByLayerMaterial(e.id,b)}},C.createThreejsObjForMemData=function(t,e,n,i,r,a){if(0==t.length)return!1;for(var o=[],s=[],l=[],c=[],u=[],h=0;h<t.length;h++){var d=t[h];o=o.concat(d.mat.elements.slice(0,4)),s=s.concat(d.mat.elements.slice(4,8)),l=l.concat(d.mat.elements.slice(8,12)),c=c.concat(d.mat.elements.slice(12,16)),u.push(0)}var p=e.color,f=16777216==(4278190080&p);f&&(p=r);var m=[];if(m.push((255&p)/255,(p>>8&255)/255,(p>>16&255)/255),e.type==A.kLinesType){var g=new T.RawShaderMaterial({uniforms:{color:{value:m}},vertexShader:E.MxShader.VSHADER_COLOR_POINT_FORMXCAD,fragmentShader:E.MxShader.FSHADER_COLOR_POINT_FORMXCAD,linewidth:1,transparent:!0});(y=new T.InstancedBufferGeometry).maxInstancedCount=t.length,y.setAttribute("position",new T.Float32BufferAttribute(e.points,2)),y.setAttribute("tran1",new T.InstancedBufferAttribute(new Float32Array(o),4)),y.setAttribute("tran2",new T.InstancedBufferAttribute(new Float32Array(s),4)),y.setAttribute("tran3",new T.InstancedBufferAttribute(new Float32Array(l),4)),y.setAttribute("tran4",new T.InstancedBufferAttribute(new Float32Array(c),4)),y.setAttribute("ishide",new T.InstancedBufferAttribute(new Float32Array(u),1));var v=new T.LineSegments(y,g);v.frustumCulled=!1,v.renderOrder=10,v.visible=!a,i.add(v),n.addEntity(e.id,v),f&&n.addColorByLayerMaterial(e.id,g)}else if(e.type==A.kTriangleType){var y;g=new T.RawShaderMaterial({uniforms:{color:{value:m}},vertexShader:E.MxShader.VSHADER_COLOR_POINT_FORMXCAD,fragmentShader:E.MxShader.FSHADER_COLOR_POINT_FORMXCAD,transparent:!0,side:T.DoubleSide});(y=new T.InstancedBufferGeometry).maxInstancedCount=t.length,y.setAttribute("position",new T.Float32BufferAttribute(e.points,2)),y.setAttribute("tran1",new T.InstancedBufferAttribute(new Float32Array(o),4)),y.setAttribute("tran2",new T.InstancedBufferAttribute(new Float32Array(s),4)),y.setAttribute("tran3",new T.InstancedBufferAttribute(new Float32Array(l),4)),y.setAttribute("tran4",new T.InstancedBufferAttribute(new Float32Array(c),4)),y.setAttribute("ishide",new T.InstancedBufferAttribute(new Float32Array(u),1));var x=new T.Mesh(y,g);x.frustumCulled=!1,x.renderOrder=1,x.visible=!a,i.add(x),n.addEntity(e.id,x),f&&n.addColorByLayerMaterial(e.id,g)}};var O=(I.prototype.upDisplayFromChage_memData=function(t){var e=this.database.getDisplayBlockTable().getBlockRecord(t.blockId);if(null==e)return!1;var n=this.database.getLayerTable().getColor(t.layerId),i=this.database.getLayerTable().isOff(t.layerId),r=e.getLayerTable().createLayerRecord(t.layerId),a=this.mxObj.getScene(),o=e.getInstances_class();r.deleteMemorySectionEntitys(t.id,a);var s=o.aryInstanceNoClip,l=o.mapInstanceClip;0<s.length&&S.createThreejsObjForMemData(s,t,r,a,n,i);for(var c=l.values(),u=c.next();!u.done;){var h=u.value;S.createThreejsObjForMemData_Clip(h,t,r,a,n,i),u=c.next()}},I.prototype.upDisplayFromChage=function(t){for(var e=t.length,n=0;n<e;n++){var i=t[n];this.upDisplayFromChage_memData(i)}},I.prototype.OnMessageDisplayMemorySectionsFromChange=function(t){for(var e=this.database.getMemSections(),n=new f.MxCADNetData(t),i=n.getMxCADPointMemorySectionsHeadFromChange(),r=i.nOffset,a=[],o=0;o<i.datacount;o++){var s=n.getMxCADPointMemorySectionHeadFromChange(r);r=s.offset;var l=new m;l.layerId=s.layerId,l.blockId=s.blkId,l.id=s.memId,l.color=s.memColor,l.type=s.memType;var c=s.pointCount;if(!(c<1)){for(var u=[],h=0;h<c;h++){var d=t.getFloat32(r,!0);r+=4;var p=t.getFloat32(r,!0);r+=4,u.push(d,p)}l.points=u,e.add(l),a.push(l)}}this.upDisplayFromChage(a)},I.prototype.deleteMemorySectionAndEntity=function(t){var e=this.database.getMemSections(),n=e.get(t);if(!n)return!1;var i=this.database.getDisplayBlockTable().getBlockRecord(n.blockId);if(null==i)return e.remove(n.id),console.log("mx:blkrec null assert(0)"),!1;var r=i.getLayerTable().createLayerRecord(n.layerId),a=this.mxObj.getScene();return r.deleteMemorySectionEntitys(n.id,a),e.remove(n.id),!0},I.prototype.OnMessageDisplayNotUseMemorySectionsForChage=function(t){for(var e=new f.MxCADNetData(t).getMxCADNotUseMemorySectionsHeadForChage(),n=e.nCount,i=e.nOffset,r=0;r<n;r++){var a=t.getInt32(i,!0);i+=4,this.deleteMemorySectionAndEntity(a)}},I);function I(t){this.database=null,this.mxObj=null,this.database=t,this.mxObj=t.getMxObj()}n.MxCADSyncDisplay=O},{"./MxCADNetData":27,"./MxFun":39,"./MxShader":49,three:19}],26:[function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.MxCADGripJig=n.MxCADGrip=n.MxCADGripData=void 0;var c=t("three"),s=t("./MxFun"),u=t("./MxThreeJS"),a=t("./MxJig"),h=t("./MxJigCmdManager"),o=function(){this.threeObject=null};n.MxCADGripData=o;var l=(d.prototype.removeAllEntity=function(){var o=this.mxObj.getScene();this.mapGrips.forEach(function(t,e,n){for(var i=t.length,r=0;r<i;r++){var a=t[r];s.MxFun.removeThreejsObject(a.threeObject,o)}}),this.mapGrips=new Map},d.prototype.deleteGripData=function(t){var e=this.mxObj.getScene(),n=this.mapGrips.get(t);if(n)for(var i=n.length,r=0;r<i;r++){var a=n[r];s.MxFun.removeThreejsObject(a.threeObject,e)}this.mapGrips.delete(t)},d.prototype.deleteEntityData=function(t){this.mapEntityData.delete(t)},d.prototype.addGripData=function(t,e,n,i){var r=this.mapGrips.get(t);null==r&&(r=new Array,this.mapGrips.set(t,r));var a=new o;return a.iIndex=e,a.point=new c.Vector3(n,i,0),r.push(a),a},d.prototype.createGripDisplayObject=function(t){var e=this.mxObj.getScene();t.geometry=new c.Geometry;var n=this.mxObj.screenCoordLong2World(8);t.geometry.vertices.push(new c.Vector3(t.point.x-n,t.point.y-n,0)),t.geometry.vertices.push(new c.Vector3(t.point.x-n,t.point.y+n,0)),t.geometry.vertices.push(new c.Vector3(t.point.x+n,t.point.y+n,0)),t.geometry.vertices.push(new c.Vector3(t.point.x+n,t.point.y-n,0)),t.geometry.faces.push(new c.Face3(0,1,2)),t.geometry.faces.push(new c.Face3(2,3,0)),t.geometry.computeFaceNormals(),t.geometry.computeVertexNormals();var i=new c.MeshBasicMaterial({color:255,transparent:!0,depthTest:!1,side:c.DoubleSide,opacity:.9}),r=new c.Mesh(t.geometry,i);r.renderOrder=100,e.add(r),t.threeObject=r},d.prototype.clearAll=function(){return this.mapEntityData=new Map,0!=this.mapGrips.size&&(this.removeAllEntity(),!0)},d.prototype.addEntityData=function(t,e){this.mapEntityData.set(t,e)},d.prototype.onIntelliSelect=function(t){for(var e=JSON.parse(t),n=e.vecEntityData.length,i=0;i<n;i++){var r=e.vecEntityData[i],a=r.lIdIndex;this.addEntityData(a,r.entity),this.deleteGripData(a);for(var o=r.vecGrip.length,s=0;s<o;s++){var l=r.vecGrip[s],c=this.addGripData(a,l.iIndex,l.ptx,l.pty);this.createGripDisplayObject(c)}}},d.prototype.onControlsChage=function(){if(0!=this.mapGrips.size){var o=this.mxObj.screenCoordLong2World(8);this.mapGrips.forEach(function(t,e,n){for(var i=t.length,r=0;r<i;r++){var a=t[r];4==a.geometry.vertices.length&&(a.geometry.vertices[0].x=a.point.x-o,a.geometry.vertices[0].y=a.point.y-o,a.geometry.vertices[1].x=a.point.x-o,a.geometry.vertices[1].y=a.point.y+o,a.geometry.vertices[2].x=a.point.x+o,a.geometry.vertices[2].y=a.point.y+o,a.geometry.vertices[3].x=a.point.x+o,a.geometry.vertices[3].y=a.point.y-o,a.geometry.computeFaceNormals(),a.geometry.computeVertexNormals(),a.geometry.verticesNeedUpdate=!0)}})}},d.prototype.hitTest=function(t){var a={grips:new Array,ids:new Array,pt:t},o=new c.Vector3(t.x,t.y,0),s=this.mxObj.screenCoordLong2World(8);return this.mapGrips.forEach(function(t,e){for(var n=t.length,i=0;i<n;i++){var r=t[i];if(r.point.distanceTo(o)<=s){a.grips.push(r),a.ids.push(e);break}}}),a},d.prototype.onMouseLBDown=function(t){var e=this.hitTest(t);return 0!=e.grips.length&&(s.MxFun.sendStringToExecute("Mx_GripEdit",e),!0)},d.prototype.gripEditImp=function(t){var e=t.grips,n=t.ids,i=t.pt,r=new f(i,e,n,this.mapEntityData);r.setDisableDynInput(!0),r.setDisableOsnap(!0),h.MxJigCmdManager.runCmd(r)},d);function d(t){this.mxObj=null,this.mapGrips=new Map,this.mapEntityData=new Map,this.mxObj=t}n.MxCADGrip=l;var p,f=(p=a.McEdJigCommand,r(m,p),m.prototype.sampler=function(){var t=h.MxJigCmdManager.InType.kGetBegan,e=this.acquirePoint(t);return e.status==h.MxJigCmdManager.DragStatus.kNormal&&(this.currPt=e.pt),e.status},m.prototype.getTypeName=function(){return"MxGripEdit"},m.prototype.done=function(t){if(t==h.MxJigCmdManager.DragStatus.kNormal){var e=[];e.push(this.currPt.x,this.currPt.y);for(var n=this.getMxObject(),i=n.getMxCAD().getGrip(),r=n.getMxCAD().getSelect(),a=this.grips.length,o=0;o<a;o++){var s=this.grips[o],l=this.ids[o];e.push(l,s.iIndex),i.deleteGripData(l),i.deleteEntityData(l),r.removeAllEntity()}n.callCommand("MxCAD_GridEdit",JSON.stringify(e),function(t){i.onIntelliSelect(t)})}return h.MxJigCmdManager.DoneStatius.kExitCommand},m.prototype.upDisplay_Line=function(t,e){var n=new c.Vector3(t.pt1x,t.pt1y,0),i=new c.Vector3(t.pt2x,t.pt2y,0);if(0==e.iIndex)n.x=this.currPt.x,n.y=this.currPt.y;else if(1==e.iIndex)i.x=this.currPt.x,i.y=this.currPt.y;else if(2==e.iIndex){var r=i.x+.5*(n.x-i.x),a=i.y+.5*(n.y-i.y),o=this.currPt.x-r,s=this.currPt.y-a;n.x+=o,n.y+=s,i.x+=o,i.y+=s}var l=u.MxThreeJS.createLine(n,i,16777215);this.drawEntity(l,31)},m.prototype.upDisplay=function(){for(var t=this.grips.length,e=0;e<t;e++){var n=this.grips[e],i=this.ids[e],r=this.mapEntityData.get(i);r&&"McDbLine"==r.name&&this.upDisplay_Line(r,n)}},m);function m(t,e,n,i){var r=p.call(this)||this;return r.pt=t,r.grips=e,r.ids=n,r.currPt=t,r.mapEntityData=i,r}n.MxCADGripJig=f},{"./MxFun":39,"./MxJig":41,"./MxJigCmdManager":42,"./MxThreeJS":52,three:19}],27:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.MxCADNetData=void 0;var i=(r.prototype.getBlobHead=function(t){var e={};return e.type=this._dataView.getInt32(t,!0),t+=4,e.ver=this._dataView.getInt32(t,!0),t+=4,e.databaseIndex=this._dataView.getInt32(t,!0),t+=4,e.nOffset=t,e},r.prototype.getMxCADPointMemorySectionsHead=function(){var t=this.getBlobHead(0);return t.zeroLayerIdIndex=this._dataView.getInt32(t.nOffset,!0),t.nOffset+=4,t.datacount=this._dataView.getInt32(t.nOffset,!0),t.nOffset+=4,t.datasize=this._dataView.getInt32(t.nOffset,!0),t.nOffset+=4,t.datasize!=t.nOffset&&console.log("mx: sectionshead size assert(0)"),t},r.prototype.getMxCADPointMemorySectionsHeadFromChange=function(){var t=this.getBlobHead(0);return t.zeroLayerIdIndex=this._dataView.getInt32(t.nOffset,!0),t.nOffset+=4,t.datacount=this._dataView.getInt32(t.nOffset,!0),t.nOffset+=4,t.datasize=this._dataView.getInt32(t.nOffset,!0),t.nOffset+=4,t.datasize!=t.nOffset&&console.log("mx: sectionshead size assert(0)"),t},r.prototype.getMxCADPointMemorySectionHead=function(t){var e=this.getBlobHead(t);return t=e.nOffset,e.pointCount=this._dataView.getInt32(t,!0),t+=4,e.layerId=this._dataView.getInt32(t,!0),t+=4,e.blkId=this._dataView.getInt32(t,!0),t+=4,e.memColor=this._dataView.getInt32(t,!0),t+=4,e.memId=this._dataView.getInt32(t,!0),t+=4,e.memType=this._dataView.getInt32(t,!0),t+=4,e.offset=t,e},r.prototype.getMxCADPointMemorySectionHeadFromChange=function(t){var e=this.getBlobHead(t);return t=e.nOffset,e.pointCount=this._dataView.getInt32(t,!0),t+=4,e.layerId=this._dataView.getInt32(t,!0),t+=4,e.blkId=this._dataView.getInt32(t,!0),t+=4,e.memColor=this._dataView.getInt32(t,!0),t+=4,e.memId=this._dataView.getInt32(t,!0),t+=4,e.memType=this._dataView.getInt32(t,!0),t+=4,e.offset=t,e},r.prototype.getMxCADBlockRefsHead=function(){var t=this.getBlobHead(0);return t.nBlockRefCount=this._dataView.getInt32(t.nOffset,!0),t.nOffset+=4,t.datasize=this._dataView.getInt32(t.nOffset,!0),t.nOffset+=4,t.datasize!=t.nOffset&&console.log("mx: sectionshead size assert(0)"),t},r.prototype.getMxCADNotUseMemorySectionsHeadForChage=function(){var t=this.getBlobHead(0);return t.nCount=this._dataView.getInt32(t.nOffset,!0),t.nOffset+=4,t.datasize=this._dataView.getInt32(t.nOffset,!0),t.nOffset+=4,t.datasize!=t.nOffset&&console.log("mx: sectionshead size assert(0)"),t},r.prototype.getEntityDisplayDatasHead=function(){var t=this.getBlobHead(0);return t.nCount=this._dataView.getInt32(t.nOffset,!0),t.nOffset+=4,t.datasize=this._dataView.getInt32(t.nOffset,!0),t.nOffset+=4,t.datasize!=t.nOffset&&console.log("mx: sectionshead size assert(0)"),t},r.prototype.getEntityDisplayDataHead=function(t){var e=this.getBlobHead(t);return e.nCount=this._dataView.getInt32(e.nOffset,!0),e.nOffset+=4,e.type=this._dataView.getInt32(e.nOffset,!0),e.nOffset+=4,e.datasize=this._dataView.getInt32(e.nOffset,!0),e.nOffset+=4,e.datasize!=e.nOffset-t&&console.log("mx: sectionshead size assert(0)"),e},r);function r(t){this._dataView=t}n.MxCADNetData=i},{}],28:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.MxCADObject=void 0;var i=t("./MxCADEditDisplay"),r=t("./MxCADOpenDisplay"),a=t("./MxCADSelect"),o=t("./MxCADGrip"),s=(l.prototype.reInit=function(){this.openDisplay.reInit(),this.databsae.reInit(),this.mxObj.reInit()},l.prototype.getSelect=function(){return this.select},l.prototype.getGrip=function(){return this.grip},l.prototype.newFile=function(){this.reInit(),this.openFile("")},l.prototype.openFile=function(t,e){var n=this;this.reInit(),this._openFile=t,this.mxObj.callCommand("MxCAD_OpenFile",JSON.stringify({file:t}),function(t){n.mxObj.callCommand("MxCAD_SendDisplay"),"string"!=typeof t||t.length<1?e&&e({}):e&&e(JSON.parse(t))})},l.prototype.saveFile=function(t,e){this.mxObj.callCommand("MxCAD_SaveFile",JSON.stringify({file:t}),function(t){e(JSON.parse(t))})},l.prototype.getDisplayFromServer=function(){this.reInit(),this.mxObj.callCommand("MxCAD_SendDisplay")},l.prototype.getFileName=function(){return this._openFile},l.prototype.getDatabase=function(){return this.databsae},l.prototype.getOpenDisplay=function(){return this.openDisplay},l.prototype.getSyncDisplay=function(){return this.syncDisplay},l.prototype.getAllLayerData=function(){return this.databsae.getLayerTable().getAllLayerData()},l);function l(t){this._openFile="",this.mxObj=null,this.databsae=null,this.openDisplay=null,this.syncDisplay=null,this.select=null,this.grip=null,this.mxObj=t,this.databsae=new i.MxCADDatabase(t),this.openDisplay=new r.MxCADOpenDisplay(this.databsae),this.syncDisplay=new i.MxCADSyncDisplay(this.databsae),this.select=new a.MxCADSelect(t),this.grip=new o.MxCADGrip(t)}n.MxCADObject=s},{"./MxCADEditDisplay":25,"./MxCADGrip":26,"./MxCADOpenDisplay":29,"./MxCADSelect":30}],29:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.MxCADOpenDisplay=void 0;var C=t("three"),T=t("./MxCADNetData"),E=t("./MxCADEditDisplay"),i=(r.prototype.createAllInstanceCall=function(t,e,n,i,r){if(!i.get(t.getId())){i.set(t.getId(),!0);var a=new E.MxCADDisplayBlockInstance;if(a.mat=new C.Matrix4,a.mat.copy(n),a.idBlkRef=e.id,a.mat.multiply(e.mat),0==e.clipPlans.clipPlanArray.length)a.clipPlans=r;else{a.clipPlans=e.clipPlans;for(var o=a.clipPlans.clipPlanArray.length,s=0;s<o;s++){var l=new C.Vector3(a.clipPlans.clipPlanArray[s].x1,a.clipPlans.clipPlanArray[s].y1,0),c=new C.Vector3(a.clipPlans.clipPlanArray[s].x2,a.clipPlans.clipPlanArray[s].y2,0);l.applyMatrix4(a.mat),c.applyMatrix4(a.mat),a.clipPlans.clipPlanArray[s].x1=l.x,a.clipPlans.clipPlanArray[s].y1=l.y,a.clipPlans.clipPlanArray[s].x2=c.x,a.clipPlans.clipPlanArray[s].y2=c.y}}t.addInstance(a);for(var u=this.database.getDisplayBlockTable(),h=t.getAllBlkRef().values(),d=h.next();!d.done;){var p=d.value;if(0!=p.blkRecId){var f=u.getBlockRecord(p.blkRecId);null!=f&&(this.createAllInstanceCall(f,p,a.mat,i,a.clipPlans),d=h.next())}}i.set(t.getId(),!1)}},r.prototype.deleteAllInstance=function(){for(var t=this.database.getDisplayBlockTable().getAllBlockRecord().values(),e=t.next();!e.done;)e.value.deleteAllInstance(),e=t.next()},r.prototype.createAllInstance=function(){this.deleteAllInstance();var t=this.database.getDisplayBlockTable().getBlockRecord(0);if(null==t)return!1;var e=this.database.getDisplayRootBlockRef(),n=new C.Matrix4,i=new Map,r=new E.MxCADDisplayClipPlans;return this.createAllInstanceCall(t,e,n,i,r),this.isCreateInstance=!0},r.prototype.creteDisplayForMemData=function(t){var e=this.database.getDisplayBlockTable().getBlockRecord(t.blockId);if(null==e)return!1;var n=e.getLayerTable().createLayerRecord(t.layerId),i=this.database.getLayerTable().getColor(t.layerId),r=this.database.getLayerTable().isOff(t.layerId),a=this.mxObj.getScene(),o=e.getInstances_class(),s=o.aryInstanceNoClip,l=o.mapInstanceClip;0<s.length&&E.MxCADDisplayFun.createThreejsObjForMemData(s,t,n,a,i,r);for(var c=l.values(),u=c.next();!u.done;){var h=u.value;E.MxCADDisplayFun.createThreejsObjForMemData_Clip(h,t,n,a,i,r),u=c.next()}},r.prototype.creteDisplayForNewData=function(){if(this.isCreateInstance||this.isGetDisplayBlockRef&&this.isGetLayerTable&&this.createAllInstance(),this.isCreateInstance){for(var t=this.vecNewCreateDisplayData.length,e=0;e<t;e++){var n=this.vecNewCreateDisplayData[e];this.creteDisplayForMemData(n)}this.vecNewCreateDisplayData=[]}},r.prototype.reInit=function(){this.isGetDisplayBlockRef=!1,this.isCreateInstance=!1,this.isGetLayerTable=!1,this.vecNewCreateDisplayData=[]},r.prototype.getMxOb=function(){return this.mxObj},r.prototype.OnMessageLayerData=function(t){var e=this.database.getLayerTable(),n=JSON.parse(t);if(null!=n){var i=n.list;for(var r in i)e.add(i[r].id,i[r].colorvalue,i[r].name,1==i[r].off),1==i[r].zerolayer&&e.setZeroLayerId(i[r].id)}this.isGetLayerTable=!0,this.creteDisplayForNewData()},r.prototype.OnMessageDisplayBlockRef=function(t){var e=this.database.getDisplayBlockTable();e.reInit();for(var n=new T.MxCADNetData(t).getMxCADBlockRefsHead(),i=n.nBlockRefCount,r=n.nOffset,a=1,o=0;o<i;o++){var s=t.getInt32(r,!0);r+=4;var l=t.getInt32(r,!0);r+=4;var c=t.getInt32(r,!0);r+=4;var u=t.getInt32(r,!0);r+=4;var h=t.getInt32(r,!0);r+=4;for(var d=new Array,p=0;p<16;p++){var f=t.getFloat32(r,!0);r+=4,d.push(f)}var m=t.getInt32(r,!0);r+=4;var g=new E.MxCADDisplayClipPlans;g.id=a,a++,g.clipPlanArray=[];for(var v=0;v<m;v++){var y=t.getFloat32(r,!0);r+=4;var x=t.getFloat32(r,!0);r+=4;var _=t.getFloat32(r,!0);r+=4;var w=t.getFloat32(r,!0);r+=4;var b=new E.MxCADDisplayClipPlan;b.x1=y,b.y1=x,b.x2=_,b.y2=w,g.clipPlanArray.push(b)}var M=new E.MxCADDisplayBlockRef;M.mat=new C.Matrix4,M.mat.fromArray(d),M.blkRecId=u,M.blkOwnerId=l,M.layerId=c,M.color=h,M.clipPlans=g,M.id=s,e.crateBlockRecord(u);var S=e.getBlockRecord(M.blkOwnerId);S?S.addBlkRef(M):console.log("ownerBlkRec == null,assert(0)")}this.isGetDisplayBlockRef=!0,this.creteDisplayForNewData()},r.prototype.OnMessageDisplayMemorySections=function(t){for(var e=this.database.getMemSections(),n=new T.MxCADNetData(t),i=n.getMxCADPointMemorySectionsHead(),r=i.nOffset,a=0;a<i.datacount;a++){var o=n.getMxCADPointMemorySectionHead(r);r=o.offset;var s=new E.MxCADDisplayMemorySection;s.layerId=o.layerId,s.blockId=o.blkId,s.id=o.memId,s.color=o.memColor,s.type=o.memType;var l=o.pointCount;if(!(l<1)){for(var c=[],u=0;u<l;u++){var h=t.getFloat32(r,!0);r+=4;var d=t.getFloat32(r,!0);r+=4,c.push(h,d)}s.points=c,e.add(s),this.vecNewCreateDisplayData.push(s)}}this.creteDisplayForNewData()},r);function r(t){this.database=null,this.isGetDisplayBlockRef=!1,this.isCreateInstance=!1,this.isGetLayerTable=!1,this.vecNewCreateDisplayData=[],this.mxObj=null,this.database=t,this.mxObj=t.getMxObj()}n.MxCADOpenDisplay=i},{"./MxCADEditDisplay":25,"./MxCADNetData":27,three:19}],30:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.MxCADSelect=n.MxCADSelectDisplayEntityData=n.MxCADSelectDisplayEntityDataType=void 0;var L,i,O=t("three"),r=t("./MxFun"),I=t("three.meshline"),P=t("./MxCADNetData");(i=L=n.MxCADSelectDisplayEntityDataType||(n.MxCADSelectDisplayEntityDataType={}))[i.kLinesType=1]="kLinesType",i[i.kTriangleType=2]="kTriangleType";var R=function(){this.type=L.kLinesType,this.points=[]};n.MxCADSelectDisplayEntityData=R;var a=(o.prototype.removeAllEntity=function(){for(var t=this.mxObj.getScene(),e=this.aryThreeObject.length,n=0;n<e;n++)r.MxFun.removeThreejsObject(this.aryThreeObject[n],t);this.aryThreeObject=[]},o.prototype.clearAllSelect=function(){return this.mxObj.callCommand("MxCAD_ClearSelect"),0!=this.aryThreeObject.length&&(this.removeAllEntity(),!0)},o.prototype.OnMessageEntityDisplayDatas=function(t){for(var e=new P.MxCADNetData(t),n=e.getEntityDisplayDatasHead(),i=n.nOffset,r=[],a=0;a<n.nCount;a++){var o=e.getEntityDisplayDataHead(i);i=o.nOffset,(v=new R).type=o.type;var s=o.nCount;if(!(s<1)){for(var l=[],c=0;c<s;c+=2){var u=t.getFloat32(i,!0);i+=4;var h=t.getFloat32(i,!0);i+=4,l.push(u,h)}v.points=l,r.push(v)}}var d=this.mxObj.getViewWidth(),p=this.mxObj.getViewHeight();this.material.resolution=new O.Vector2(d,p);for(var f=r.length,m=this.mxObj.getScene(),g=0;g<f;g++){var v;if((v=r[g]).type==L.kLinesType)for(var y=v.points.length,x=0;x+3<y;x+=4){var _=new Float32Array(6);_[0]=v.points[x],_[1]=v.points[x+1],_[2]=0,_[3]=v.points[x+2],_[4]=v.points[x+3],_[5]=0;var w=new I.MeshLine;w.setGeometry(_);var b=new O.Mesh(w.geometry,this.material);b.renderOrder=1,m.add(b),this.aryThreeObject.push(b)}else if(v.type==L.kTriangleType){y=v.points.length;var M=new O.Geometry,S=0;for(x=0;x+5<y;x+=6){var C=new O.Vector3(v.points[x],v.points[x+1],0),T=new O.Vector3(v.points[x+2],v.points[x+3],0),E=new O.Vector3(v.points[x+4],v.points[x+5],0);M.vertices.push(C),M.vertices.push(T),M.vertices.push(E);var A=new O.Face3(S,S+1,S+2);M.faces.push(A),S+=3}var D=new O.Mesh(M,this.materialFill);D.renderOrder=1,m.add(D),this.aryThreeObject.push(D)}}},o);function o(t){this.aryThreeObject=[],this.mxObj=null,this.material=new I.MeshLineMaterial({useMap:!1,color:new O.Color(2641557),opacity:1,resolution:new O.Vector2(500,500),sizeAttenuation:!0,lineWidth:.006,transparent:!0,depthTest:!1}),this.materialFill=new O.MeshBasicMaterial({color:new O.Color(2641557),opacity:.8,side:O.DoubleSide,transparent:!0,depthTest:!1}),this.mxObj=t}n.MxCADSelect=a},{"./MxCADNetData":27,"./MxFun":39,three:19,"three.meshline":18}],31:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.MxCadSketchLayers=n.MxCadSketchLayer=void 0;var i=(r.prototype.addEntity=function(t){this._setEntityId.add(t)},r.prototype.getId=function(){return this.id},r.prototype.setId=function(t){this.id=t},r.prototype.removeEntity=function(t){this._setEntityId.delete(t)},r.prototype.show=function(r){var a=this;this._setEntityId.forEach(function(t){var e=a._mxobj.getEntity(t);if(null!=e)for(var n=0,i=e.length;n<i;n++)e[n].visible=r})},r);function r(t){this._setEntityId=new Set,this.id=0,this._mxobj=null,this._mxobj=t}n.MxCadSketchLayer=i;var a=(o.prototype.getLayer=function(t,e){void 0===e&&(e=!0);var n=this._mapId2Layers.get(t);return null==n&&((n=new i(this._mxobj)).setId(t),this._mapId2Layers.set(t,n)),n},o.prototype.addEntity=function(t,e){this.getLayer(e).addEntity(t)},o.prototype.removeEntity=function(e){this._mapId2Layers.forEach(function(t){t.removeEntity(e)})},o.prototype.removeAllEntity=function(){this._mapId2Layers.clear()},o);function o(t){this._mxobj=null,this._mapId2Layers=new Map,this._mxobj=t}n.MxCadSketchLayers=a},{}],32:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.MxCmdRunManager=void 0;var i,s,l,c,u,h,d,p=t("./MxFun"),f=t("./MxType"),m=t("./MxJigCmdManager"),g=t("./MxUiVue");i=n.MxCmdRunManager||(n.MxCmdRunManager={}),s={},l=new Array,c=0,u=!1,h="",d={},i.InitQuickCommand=function(t){for(var e=t.length,n=0;n<e;n++){var i=t[n];if(!(i.length<2)){var r=i[0];if(0!=r.length)for(var a=i.length,o=1;o<a;o++)0!=i[o].length&&(d[i[o].toUpperCase()]=r)}}},i.MoveUpKey=function(){return u?++c>=l.length&&(c=0):u=!0,!0},i.MoveDownKey=function(){return!!u&&(--c<0&&(c=l.length-1),!0)},i.GetListCommad=function(){return c<0||c>=l.length?"":l[c]},i.ClearPrvCmd=function(){h=""},i.GetPrvCmd=function(){return h},i.SetPrvCmd=function(t){h=t},i.runCmd=function(t,e){var n=t.toUpperCase(),i=s[n];if(null==i){var r=d[n];if(null!=r&&(i=s[r.toUpperCase()]),null==i)return g.MxUiVue.isNull()?console.log(p.MxFun.formatString('未知命令"{0}"',t)):g.MxUiVue.acutPrintf('未知命令"{0}"。\n命令:',t),!1}var a=l.indexOf(i.cmd);-1<a&&l.splice(a,1),u=!(c=0),l.push(i.cmd),h=i.cmd;var o=i.fun;return 0==(i.flag&f.MxType.CommandFlags.MCRX_CMD_TRANSPARENT)&&g.MxUiVue.acutPrintf("{0}\n",i.cmd),m.MxJigCmdManager.stopCmd(),o(e),m.MxJigCmdManager.isRunning()||g.MxUiVue.restoreCmdStatus(),!0},i.addCommand=function(t,e,n){null==n&&(n=f.MxType.CommandFlags.MCRX_CMD_MODAL);var i=t.toUpperCase();s[i]={fun:e,cmd:t,flag:n}}},{"./MxFun":39,"./MxJigCmdManager":42,"./MxType":54,"./MxUiVue":58}],33:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.MxDrawCommands=void 0;var a=t("./MxFun"),i=t("./MxType"),o=t("./MxIntelliSelect"),s=t("./MxJigCmdManager"),l=t("./MxWindowsEvent");function r(t){if(null!=t&&null!=t.pt1){var e=new o.MxIntelliSelectJig(t.pt1);e.setDisableDynInput(!0),e.setDisableOsnap(!0);var i=t.pt1,r=a.MxFun.getCurrentMx();e.doPointSelect(a.MxFun.getCurrentMx(),t.pt1,function(t){if(0!=JSON.parse(t).lCount){r.getMxCAD().getGrip().onIntelliSelect(t);var e=l.MxWindowsEvent.getCurrentMousePostion();if(r.screenCoord2World(e.x,e.y,0).distanceTo(i)<r.screenCoordLong2World(10)){var n=s.MxJigCmdManager.getCurCmd();n&&"MxIntelliSelect"==n.getTypeName()&&s.MxJigCmdManager.stopCmd()}}}),s.MxJigCmdManager.runCmd(e)}}function c(t){null!=t&&null!=t.grips&&null!=t.ids&&a.MxFun.getCurrentMx().getMxCAD().getGrip().gripEditImp(t)}(n.MxDrawCommands||(n.MxDrawCommands={})).registerCommand=function(){a.MxFun.addCommand("Mx_IntelliSel",r,i.MxType.CommandFlags.MCRX_CMD_TRANSPARENT),a.MxFun.addCommand("Mx_GripEdit",c,i.MxType.CommandFlags.MCRX_CMD_TRANSPARENT)}},{"./MxFun":39,"./MxIntelliSelect":40,"./MxJigCmdManager":42,"./MxType":54,"./MxWindowsEvent":59}],34:[function(t,e,n){"use strict";var i;Object.defineProperty(n,"__esModule",{value:!0}),n.MxDrawData=void 0,(i=n.MxDrawData||(n.MxDrawData={})).m_isEnableIntelliSelect=!1,i.getCursorWidthPixels=function(){return 14},i.setIniset=function(t){void 0!==t.EnableIntelliSelect&&"boolean"==typeof t.EnableIntelliSelect&&(i.m_isEnableIntelliSelect=t.EnableIntelliSelect)}},{}],35:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.MxDrawObject=n.IniSetName=n.MxRunMode=void 0;var s,i,r,c=t("three"),u=t("./MxFun"),a=t("./MxCadSketchLayer"),o=t("./MxBrowseLayerData"),l=t("./MxBrowseDisplay"),L=t("./MxNetData"),h=t("./MxNetData"),d=t("./MxSelect"),p=t("./MxManager"),f=t("./MxJigCmdManager"),m=t("./MxSystemVariable"),g=t("./MxCADObject"),v=t("./MxLocalFileLoad"),y=t("./MxDrawObjectOsnap");(i=s=n.MxRunMode||(n.MxRunMode={}))[i.kBrowse=1]="kBrowse",i[i.kMxCAD=2]="kMxCAD",i[i.kMxCADBrowseApp=3]="kMxCADBrowseApp",(r=n.IniSetName||(n.IniSetName={})).kEnableOsnapFunction="EnableOsnapFunction";var x=(_.prototype.setOtherRefFile=function(t){this._tzDwgStaticFile=t},_.prototype.setRequestHeader=function(t){this._requestHeader=t},_.prototype.initZoomW=function(t,e){this._initZoomwCoordPt1=t.clone(),this._initZoomWCoordPt2=e.clone()},_.prototype.getMxCAD=function(){return this._mxCAD},_.prototype.setMouseRightRotate=function(t){this._mouseRightRotate=t,null!=this.controls&&(this.controls.mouseButtons.RIGHT=t?c.MOUSE.ROTATE:c.MOUSE.PAN)},_.prototype.initRunMode=function(t){this._isCreate?console.log("iniRunMode failed,mxobject already created"):this._runMode=t},_.prototype.getRunMode=function(){return this._runMode},_.prototype.setStaticLocalLoad=function(t){this._isStaticLocalLoad=t},_.prototype.isStaticLocalLoad=function(){return this._isStaticLocalLoad},_.prototype.setStaticLocalLoadPath=function(t){this._staticLocalLoadPath=t},_.prototype.addEvent=function(t,e){this._event[t]=e},_.prototype.removeEvent=function(t){this._event[t]=void 0},_.prototype.getEvent=function(){return this._event},_.prototype.sysVariable=function(){return this.m_sysVariable},_.prototype.setIniset=function(t){this.m_iniSet=t},_.prototype.getInisetValue=function(t){return this.m_iniSet[t]},_.prototype.getViewColor=function(){return this._viewcolor},_.prototype.isWhiteViewColor=function(){return 16777215==this._viewcolor},_.prototype.initUserLoginData=function(t,e){this._userIdentitySign=t,this._userRandomToken=e},_.prototype.automaticInversionColor=function(t){return 16777215!=this._viewcolor||16777215!=t?t:0},_.prototype.setViewColor=function(t){this._viewcolor=t,null!=this.scene&&(this.scene.background=new c.Color(t))},_.prototype.callInitCompleteEvent=function(){null!=this._event.loadComplete&&this._event.loadComplete()},_.prototype.callEvent=function(t,e){return null!=this._event[t]&&(this._event[t](e),!0)},_.prototype.userLoginResult=function(t){null!=this._event.userLoginResult&&this._event.userLoginResult(t)},_.prototype.serverReturn=function(t){var e=JSON.parse(t);null!=this._event.serverReturn&&this._event.serverReturn(e)},_.prototype.openFileResult=function(t){JSON.parse(t).linkServer||console.log("link mx serverobj error"),null!=this._event.openFileResult&&this._event.openFileResult(t)},_.prototype.xzSize=function(t){var e=this._devicePixelRatio;if(e-1<=1e-4&&-1e-4<=e-1)return t;for(var n=9999999,i=t,r=0,a=t;r<100;r++){if((s=(o=a*e)-Math.floor(o))<=.001)return a;s<n&&(n=s,i=a),a+=1}for(a=t;r<100;r++){var o,s;if((s=(o=a*e)-Math.floor(o))<=.001)return a;s<n&&(n=s,i=a),--a}return i},_.prototype.setSize=function(t,e){this._viewWidth=t,this._viewHeight=e,null!=this._userCanvas&&(this._userCanvas.width=t,this._userCanvas.height=e,this._userCanvas.style.width=t+"px",this._userCanvas.style.height=e+"px"),this.onResizeImp(),this.updateDisplay()},_.prototype.getCurrentColor=function(){return this._color},_.prototype.setCurrentColor=function(t){this._color=t},_.prototype.getSelect=function(){return this._select},_.prototype.call=function(t,e,n){this._net.getSend().CallServerJS(t,e,n)},_.prototype.zoomAll=function(){this._is2d&&this.call("getDatabaseBoundHelp",'{"isBackground":1}',function(t){if(0!=t.length){var e=JSON.parse(t);this.zoomW(new c.Vector3(e[0],e[1],0),new c.Vector3(e[2],e[3],0))}})},_.prototype.tempDisableSelect=function(t){this._select.tmpDisable=t},_.prototype.getViewCenterDocCoord=function(){return null!=this._userCanvas?this.screenCoord2Doc(.5*this._userCanvas.clientWidth,.5*this._userCanvas.clientHeight,0):this.screenCoord2Doc(.5*this._viewWidth,.5*this._viewHeight,0)},_.prototype.onLoad=function(){if(this._isStaticLocalLoad)this._net=new h.MxNet,this._net.init(this,!1),0<this._openFile.length&&(this._staticLocalNet=new v.MxLocalDwgFileLoad(this._net),this._staticLocalNet.load(encodeURIComponent(this._staticLocalLoadPath),encodeURIComponent(this._openFile)));else{this._net=new h.MxNet;var t=!0;if(this._runMode==s.kMxCAD?t=!0:(t=!u.MxFun.isStaticLoad(),this._is2d||(t=!0)),this._net.init(this,t),!t&&(this._staticNet=new h.MxHFileLoad(this._net),this._staticNet.setRequestHeader(this._requestHeader),this._staticNet.load(encodeURIComponent(this._openFile)),this._tzDwgStaticFile&&0<this._tzDwgStaticFile.length)){var e=new h.MxNet;e.init(this,!1),this._extRefManager.createTzDwgExternalReferences(99999),e.setCurrentDatabaseId(99999),this._staticLoadTzNet=new h.MxHFileLoad(e),this._staticLoadTzNet.setShowloading(!1),this._staticLoadTzNet.setRequestHeader(this._requestHeader),this._staticLoadTzNet.load(encodeURIComponent(this._tzDwgStaticFile))}}},_.prototype.getStaticNet=function(){return this._staticNet},_.prototype.isStaticFileNet=function(){return!this._isStaticLocalLoad&&null!=this._staticNet},_.prototype.getStaticLocalNet=function(){return this._staticLocalNet},_.prototype.getStaticLoadTzNet=function(){return this._staticLoadTzNet},_.prototype.getViewWidth=function(){return null!=this._userCanvas?this._userCanvas.clientWidth:this._viewWidth},_.prototype.getViewHeight=function(){return null!=this._userCanvas?this._userCanvas.clientHeight:this._viewHeight},_.prototype.makeCurrent=function(){p.MxManager.setCurrentMx(this)},_.prototype.createCanvasImageData=function(e,t){var n=this,i=0,r=0,a=!1;t&&t.width&&t.height&&(i=this.getViewWidth(),r=this.getViewHeight(),a=!0,this.setSize(t.width,t.height)),this._callCreateCanvasImageData=function(t){a&&n.setSize(i,r),e(t)},this.updateDisplay()},_.prototype.getIntersectObjects=function(t){var e=new c.Raycaster;e.linePrecision=this.screenCoordLong2World(4);var n=this.getCanvas(),i=n.clientWidth,r=n.clientHeight;return t=new c.Vector2(t.x/i*2-1,-t.y/r*2+1),e.setFromCamera(t,this.camera),e.intersectObjects(this.threejsselectObjects.children,!0)},_.prototype.addObject=function(t,e){null==e||1==e?(this.threejsselectObjects.add(t),this.threejsselectObjects.remove):this.scene.add(t)},_.prototype.removeAllSelectObject=function(){for(;this.threejsselectObjects.children.length;)this.threejsselectObjects.remove(this.threejsselectObjects.children[0])},_.prototype.removeObject=function(t,e){null==e||1==e?this.threejsselectObjects.remove(t):this.scene.remove(t)},_.prototype.render=function(){this.renderer.render(this.scene,this.camera),null!=this._callCreateCanvasImageData&&(this._callCreateCanvasImageData(this.renderer.domElement.toDataURL("image/png")),this._callCreateCanvasImageData=void 0)},_.prototype.updateDisplay=function(t){function e(){n._isAnimation?(n._isAnimationStarting=!0,requestAnimationFrame(this.needRander)):n._isWaiteCount=0,n.render()}void 0===t&&(t=!1);var n=this;!0!==t?this._isAnimationStarting||(this._isAnimation?requestAnimationFrame(e):((5<this._isWaiteCount||this._isWaiteCount<0)&&(this._isWaiteCount=0),this._isWaiteCount<=0&&requestAnimationFrame(e),this._isWaiteCount++)):e()},_.prototype.gotoLayout=function(t){"Modle"==t&&(t="");var e=this._openFile;for(var n in this._iniParam)"srcname"==(o=(a=this._iniParam[n])[0])&&(e=a[1]);var i={},r="";for(var n in this._iniParam){var a,o;if(null==i[o=(a=this._iniParam[n])[0]]){i[o]=!0;var s=a[1];if("file"==o){if(s=e,0<t.length){var l=s.substring(s.lastIndexOf(".")+1);s=s.substring(0,s.lastIndexOf("."))+"%23"+t+"%23."+l}}else if("srcname"==o)continue;0==r.length?r=o+"="+s+"&srcname="+e:r+="&"+o+"="+s}}var c=u.MxFun.getLocationPageUrl()+"?"+r;window.location.href=c},_.prototype.addInitParam=function(t,e){var n=new Array;n.push(t),n.push(e),this._iniParam.push(n)},_.prototype.create=function(t,e){if(this._callCreateCanvasImageData=void 0,this._isCreate=!0,this._devicePixelRatio=window.devicePixelRatio,this._openFile=e,this._iniParam=u.MxFun.getUrlParams(),this._openFileExtName=e.substring(e.lastIndexOf(".")+1),""!=this._openFile&&this._runMode!=s.kMxCAD&&this._runMode!=s.kMxCADBrowseApp){var n=new Array;n.push("file"),n.push(this._openFile),this._iniParam.push(n)}""!=this._userIdentitySign&&(this.addInitParam("userIdentitySign",this._userIdentitySign),this.addInitParam("userRandomToken",this._userRandomToken)),this.addInitParam("runMode",this._runMode==s.kMxCAD||this._runMode==s.kMxCADBrowseApp?"mxcad":"browse"),this._runMode==s.kMxCAD||this._runMode==s.kMxCADBrowseApp?("empty"==this._openFile&&(this._openFile=""),this._mxCAD=new g.MxCADObject(this)):this._mxCAD=null,this._userCanvas=t;var i=window.innerWidth,r=window.innerHeight;null!=t&&(i=t.clientWidth,r=t.clientHeight),this._viewWidth=i,this._viewHeight=r,this.onInitThreejs(),this.onCreate(),this.threejsselectObjects=new c.Object3D,this.scene.add(this.threejsselectObjects),this._objectsOsnap=new y.MxDrawObjectOsnap(this),this._is2d&&(this._runMode!=s.kMxCAD&&this._runMode!=s.kMxCADBrowseApp||(this.controls.mouseButtons.LEFT=-1,this.controls.mouseButtons.RIGHT=-1,this.controls.mouseButtons.MIDDLE=c.MOUSE.PAN)),this._select=new d.MxSelect(this,this.getCanvas()),this._select.enabled=u.MxFun.isEnableSelect(),this._select.init(),this._is2d||(this._select.enabled=!1),this._runMode!=s.kBrowse&&(this._select.enabled=!1),p.MxManager.add(this),p.MxManager.setCurrentMx(this);var a=this;if(this.controls.addEventListener("change",function(){f.MxJigCmdManager.OnThreeControlsChage(),a.callEvent("viewchange");var t=a.getMxCAD();t&&t.getGrip().onControlsChage(),a.updateDisplay()}),this.updateDisplay(),null==t)window.addEventListener("resize",function(){a._viewWidth=window.innerWidth,a._viewHeight=window.innerHeight,a.onResizeImp(),a.updateDisplay()},!1);else{var o=function(){if(a._viewWidth=a._userCanvas.clientWidth,a._viewHeight=a._userCanvas.clientHeight,null!=a._event.onResize){var t=a._event.onResize();null!=t&&(a._viewWidth=parseInt(t.width),a._viewHeight=parseInt(t.height))}a.onResizeImp(a._viewWidth,a._viewHeight),a.updateDisplay()};null!=this._event.addResizeEvent?this._event.addResizeEvent(o,t):window.addEventListener("resize",o,!1),null!=this._event.onResize&&(o(),window.setTimeout(function(){o(),window.setTimeout(function(){o(),window.setTimeout(function(){o(),window.setTimeout(function(){o()},600)},200)},50)},20))}this.onLoad()},_.prototype.initResize=function(){if(null==this._userCanvas)this._viewWidth=window.innerWidth,this._viewHeight=window.innerHeight,this.onResizeImp();else{if(this._viewWidth=this._userCanvas.clientWidth,this._viewHeight=this._userCanvas.clientHeight,null!=this._event.onResize){var t=this._event.onResize();null!=t&&(this._viewWidth=t.width,this._viewHeight=t.height)}this.onResizeImp(this._viewWidth,this._viewHeight)}this.updateDisplay()},_.prototype.is2D=function(){return this._is2d},_.prototype.getOpenFile=function(){return this._openFile},_.prototype.getIniParam=function(){return this._iniParam},_.prototype.getOpenFileExtName=function(){return this._openFileExtName},_.prototype.loadCodeToServer=function(t,e){this._net.getSend().CallLoadCodeToServer(t,e)},_.prototype.openFile=function(t){this._net.getSend().OpenFile(t)},_.prototype.userLogin=function(t,e){this._net.getSend().UserLogin(t,e)},_.prototype.getUserCanvas=function(){return this._userCanvas},_.prototype.getCanvas=function(){return null!=this._userCanvas?this._userCanvas:this.renderer.domElement},_.prototype.getScene=function(){return this.scene},_.prototype.getCamera=function(){return this.camera},_.prototype.callCommand=function(t,e,n){void 0===e&&(e=""),this._net.getSend().DoCommand(t,e,n)},_.prototype.loadCodeFileToServer=function(t,e,n){var i='{"path":"'+t+'","reload":'+(null!=n?"true":"false")+"}";this._net.getSend().DoCommand("Mx_LoadCodeFormServerFile",i,e)},_.prototype.deleteAll=function(){this.removeAllEntity(),this.callCommand("Mx_ClearAll"),this.updateDisplay()},_.prototype.undo=function(){this.callCommand("Mx_Undo")},_.prototype.save=function(){this.callCommand("Mx_Save")},_.prototype.initAllLayoutName=function(t){this._allLayoutName=t},_.prototype.getAllLayoutName=function(){return this._allLayoutName},_.prototype.updataClipMaterial=function(){this._blocks.updataClipMaterial(this)},_.prototype.getSketchLayers=function(){return this._sketchLayers},_.prototype.getExtRefManager=function(){return this._extRefManager},_.prototype.showLayer=function(t,e,n){"string"==typeof t&&(t=this._layers.getLayerIdForName(t)),n?this._sketchLayers.getLayer(t).show(e):this._blocks.showLayer(t,e),this.updateDisplay()},_.prototype.addLayerInfo=function(t,e,n){e=this.automaticInversionColor(16777215&e),this._layers.add(t,e,n)},_.prototype.setZeroLayerId=function(t){this._layers.setZeroLayerId(t)},_.prototype.addLayerInfoComplete=function(){this._layers.initComplete()},_.prototype.addEntity=function(t,e){var n=this._mapId2Entity.get(t);null==n&&(n=new Array,this._mapId2Entity.set(t,n)),n.push(e)},_.prototype.getEntity=function(t){return this._mapId2Entity.get(t)},_.prototype.clearThreejsScence=function(){this.scene.remove(),this.scene.dispose(),this.scene=new c.Scene,this.scene.background=new c.Color(this._viewcolor),this.threejsselectObjects=new c.Object3D,this.scene.add(this.threejsselectObjects),this._objectsOsnap=new y.MxDrawObjectOsnap(this),this.onInitScene()},_.prototype.reInit=function(){this.clearThreejsScence(),this._openFile="",this._openFileExtName="",this._select.removeAll(),this._is2d||(this._select.enabled=!1),this._mapId2Entity=new Map,this._setAdyDelete=new Map,this._sketchLayers=new a.MxCadSketchLayers(this),this._layers=new o.MxBrowseLayerData,this._blocks=new l.Blocks,this._extRefManager=new l.ExternalReferenceManager,this._doc2World=new c.Matrix4,this._word2doc=new c.Matrix4,this._allLayoutName=new Array,this._tzDwgStaticFile="",this._devicePixelRatio=window.devicePixelRatio,this._blocks.initRootBlockRef()},_.prototype.removeEntity=function(t){if(null==this._setAdyDelete[t]){this._setAdyDelete[t]=!0;var e=this._mapId2Entity.get(t);if(null!=e){for(var n in e)this.scene.remove(e[n]);this._sketchLayers.removeEntity(t),this._mapId2Entity.delete(t)}}},_.prototype.removeEntityFromServer=function(t){for(var e=t.getInt32(4,!0),n=0;n<e;n++){var i=t.getInt32(4*(n+20),!0);this.removeEntity(i)}},_.prototype.removeAllEntity=function(){var r=this;this._mapId2Entity.forEach(function(t,e,n){for(var i in t)r.scene.remove(t[i])}),this._mapId2Entity.clear(),this._sketchLayers.removeAllEntity()},_.prototype.mxWebAddEntity=function(t){this._setAdyDelete.clear();var e=this.mxWebAddEntity_3DChild(t);this.mxWebAddEntity_Curve(t,e),this._setAdyDelete.clear()},_.prototype.screenCoord2World=function(t,e,n){var i=this.getCanvas(),r=i.clientWidth,a=i.clientHeight;n=.5;var o=this.camera;o&&o.isOrthographicCamera&&(n=(o.near+o.far)/(o.near-o.far));var s=new c.Vector3(t/r*2-1,-e/a*2+1,n);return s.unproject(this.camera),s},_.prototype.worldCoord2Screen=function(t,e,n){var i=new c.Vector3(t,e,n).project(this.camera),r=this.getCanvas(),a=r.clientWidth/2,o=r.clientHeight/2,s=Math.round(i.x*a+a),l=Math.round(-i.y*o+o);return new c.Vector2(s,l)},_.prototype.worldCoordLong2Doc=function(t){var e=this.worldCoord2Doc(0,0,0),n=this.worldCoord2Doc(t,0,0);return e.distanceTo(n)},_.prototype.docCoordLong2World=function(t){var e=this.docCoord2World(0,0,0),n=this.docCoord2World(t,0,0);return e.distanceTo(n)},_.prototype.docCoord2World=function(t,e,n){var i=new c.Vector3(t,e,n);return i.applyMatrix4(this._doc2World),i},_.prototype.worldCoord2Doc=function(t,e,n){var i=new c.Vector3(t,e,n);return i.applyMatrix4(this._word2doc),i},_.prototype.screenCoord2Doc=function(t,e,n){var i=this.screenCoord2World(t,e,n);return this.worldCoord2Doc(i.x,i.y,i.z)},_.prototype.docCoord2Screen=function(t,e,n){var i=this.docCoord2World(t,e,n);return this.worldCoord2Screen(i.x,i.y,i.z)},_.prototype.screenCoordLong2Doc=function(t){var e=this.screenCoord2Doc(0,0,0),n=this.screenCoord2Doc(t,0,0);return e.distanceTo(n)},_.prototype.screenCoordLong2DocScale=function(){var t=this.screenCoord2Doc(0,0,0),e=this.screenCoord2Doc(1,0,0);return t.distanceTo(e)},_.prototype.docCoordLong2Screen=function(t){var e=this.docCoord2Screen(0,0,0),n=this.docCoord2Screen(t,0,0);return e.distanceTo(n)},_.prototype.screenCoordLong2World=function(t){var e=this.screenCoord2World(0,0,0),n=this.screenCoord2World(t,0,0);return e.distanceTo(n)},_.prototype.worldCoordLong2Screen=function(t){var e=this.worldCoord2Screen(0,0,0),n=this.worldCoord2Screen(t,0,0);return e.distanceTo(n)},_.prototype.intiDoc2Wold=function(t){this._doc2World.fromArray(t),this._word2doc.getInverse(this._doc2World)},_.prototype.enableSingleTouchPan=function(t){this.controls.enablePan=t},_.prototype.mxWebAddEntityFor2dPointMeshBuffers=function(t,e){var n=new L.MxNetData(t),i=n.getdPointMeshBuffersHead(),r=i.zeroLayerIdIndex,a=i.databaseIndex;-1!=e&&(a=e);for(var o=i.datasize,s=0;s<i.datacount;s++){var l=n.getdPointMeshBufferDataHead(o);o=l.offset;var c=l.layerId,u=c==r,h=l.blkId,d=l.pointCount;if(!(d<1)){for(var p=[],f=[],m=[],g=[],v=[],y=0;y<d;y++){var x=t.getFloat32(o,!0);o+=4;var _=t.getFloat32(o,!0);o+=4;var w=t.getFloat32(o,!0);o+=4;var b=t.getFloat32(o,!0);o+=4;var M=t.getFloat32(o,!0);o+=4;var S=t.getFloat32(o,!0);o+=4;var C=t.getInt32(o,!0);o+=4;var T=C>>24&255;2==T?(g.push(x,_),g.push(w,b),g.push(M,S)):1==T?0!=h&&u?(v.push(x,_),v.push(w,b),v.push(M,S)):(m.push(x,_),m.push(w,b),m.push(M,S)):(C=this.automaticInversionColor(16777215&C),p.push(x,_),p.push(w,b),p.push(M,S),f.push((255&C)/255,(C>>8&255)/255,(C>>16&255)/255),f.push((255&C)/255,(C>>8&255)/255,(C>>16&255)/255),f.push((255&C)/255,(C>>8&255)/255,(C>>16&255)/255))}var E=this._blocks,A=this._layers;0!=a&&(E=this._extRefManager.getBlocks(a),A=this._extRefManager.getLayers(a));var D=E.crateBlock(h);D.addGeometryMesh(p,f,c,g,m,v),E.createThreejsObj(D,this,A)}}},_.prototype.mxWebAddEntityFor2dPointCurveBuffers=function(t,e){var n=new L.MxNetData(t),i=n.getdPointCurveBuffersHead(),r=i.zeroLayerIdIndex,a=i.databaseIndex;-1!=e&&(a=e);for(var o=i.datasize,s=0;s<i.datacount;s++){var l=n.getdPointCurveBufferDataHead(o);o=l.offset;var c=l.layerId,u=c==r,h=l.blkId,d=l.pointCount;if(!(d<1)){for(var p=[],f=[],m=[],g=[],v=[],y=0;y<d;y++){var x=t.getFloat32(o,!0);o+=4;var _=t.getFloat32(o,!0);o+=4;var w=t.getFloat32(o,!0);o+=4;var b=t.getFloat32(o,!0);o+=4;var M=t.getInt32(o,!0);o+=4;var S=M>>24&255;2==S?(g.push(x,_),g.push(w,b)):1==S?0!=h&&u?(v.push(x,_),v.push(w,b)):(m.push(x,_),m.push(w,b)):(p.push(x,_),p.push(w,b),M=this.automaticInversionColor(16777215&M),f.push((255&M)/255,(M>>8&255)/255,(M>>16&255)/255),f.push((255&M)/255,(M>>8&255)/255,(M>>16&255)/255))}var C=this._blocks,T=this._layers;0!=a&&(C=this._extRefManager.getBlocks(a),T=this._extRefManager.getLayers(a));var E=C.crateBlock(h);E.addGeometryCurve(p,f,c,g,m,v),C.createThreejsObj(E,this,T)}}},_.prototype.mxWebAddEntityFor2dPointCurveBuffer=function(t,e){var n=new L.MxNetData(t);if(!n.getIsSketchEntity()){var i,r=n.getLayerId(),a=r==n.getZeroLayerId(),o=n.getBlockId();if(!((i=t.getInt32(20,!0)/20)<1)){for(var s=80,l=[],c=[],u=[],h=[],d=[],p=0;p<i;p++){var f=t.getFloat32(s,!0);s+=4;var m=t.getFloat32(s,!0);s+=4;var g=t.getFloat32(s,!0);s+=4;var v=t.getFloat32(s,!0);s+=4;var y=t.getInt32(s,!0);s+=4;var x=y>>24&255;2==x?(h.push(f,m),h.push(g,v)):1==x?0!=o&&a?(d.push(f,m),d.push(g,v)):(u.push(f,m),u.push(g,v)):(y=this.automaticInversionColor(16777215&y),l.push(f,m),l.push(g,v),c.push((255&y)/255,(y>>8&255)/255,(y>>16&255)/255),c.push((255&y)/255,(y>>8&255)/255,(y>>16&255)/255))}var _=n.getDatabaseIndex();-1!=e&&(_=e);var w=this._blocks,b=this._layers;0!=_&&(w=this._extRefManager.getBlocks(_),b=this._extRefManager.getLayers(_));var M=w.crateBlock(o);M.addGeometryCurve(l,c,r,h,u,d),w.createThreejsObj(M,this,b)}}},_.prototype.mxWebAddEntityFor2dPointMeshBuffer=function(t,e){var n=new L.MxNetData(t);if(!n.getIsSketchEntity()){var i,r=n.getLayerId(),a=n.getBlockId(),o=r==n.getZeroLayerId();if(!((i=t.getInt32(12,!0)/28)<1)){for(var s=80,l=[],c=[],u=[],h=[],d=[],p=0;p<i;p++){var f=t.getFloat32(s,!0);s+=4;var m=t.getFloat32(s,!0);s+=4;var g=t.getFloat32(s,!0);s+=4;var v=t.getFloat32(s,!0);s+=4;var y=t.getFloat32(s,!0);s+=4;var x=t.getFloat32(s,!0);s+=4;var _=t.getInt32(s,!0);s+=4;var w=_>>24&255;2==w?(h.push(f,m),h.push(g,v),h.push(y,x)):1==w?0!=a&&o?(d.push(f,m),d.push(g,v),d.push(y,x)):(u.push(f,m),u.push(g,v),u.push(y,x)):(l.push(f,m),l.push(g,v),l.push(y,x),_=this.automaticInversionColor(16777215&_),c.push((255&_)/255,(_>>8&255)/255,(_>>16&255)/255),c.push((255&_)/255,(_>>8&255)/255,(_>>16&255)/255),c.push((255&_)/255,(_>>8&255)/255,(_>>16&255)/255))}var b=n.getDatabaseIndex();-1!=e&&(b=e);var M=this._blocks,S=this._layers;0!=b&&(M=this._extRefManager.getBlocks(b),S=this._extRefManager.getLayers(b));var C=M.crateBlock(a);C.addGeometryMesh(l,c,r,h,u,d),M.createThreejsObj(C,this,S)}}},_.prototype.mxWebCreateAllBlocks=function(t,e){var n=new L.MxNetData(t).getDatabaseIndex();-1!=e&&(n=e);var i=this._blocks;0!=n&&(i=this._extRefManager.getBlocks(n)),i.createBlocks(t,this.scene)},_.prototype.mxWebEntitysData=function(t,e){-1==e&&this._objectsOsnap.mxWebEntitysData(t,e)},_.prototype.getObjectOsnap=function(){return this._objectsOsnap},_);function _(){this._is2d=!0,this._runMode=s.kBrowse,this._mxCAD=null,this._userCanvas=null,this._openFile="empty",this._openFileExtName="",this._userIdentitySign="",this._userRandomToken="",this._isCreate=!1,this.m_iniSet={},this._net=null,this._staticNet=null,this._staticLoadTzNet=null,this._staticLocalNet=null,this._isStaticLocalLoad=!1,this._staticLocalLoadPath="",this._viewWidth=1,this._viewHeight=1,this.m_sysVariable=new m.MxSystemVariable,this._color="#FFFFFF",this._viewcolor=15790320,this._isAnimation=!1,this._isAnimationStarting=!1,this._isWaiteCount=0,this._callCreateCanvasImageData=void 0,this._event={},this.scene=null,this.camera=null,this.renderer=null,this.controls=null,this.threejsselectObjects=null,this._mouseRightRotate=!0,this._mapId2Entity=new Map,this._setAdyDelete=new Map,this._sketchLayers=new a.MxCadSketchLayers(this),this._layers=new o.MxBrowseLayerData,this._blocks=new l.Blocks,this._extRefManager=new l.ExternalReferenceManager,this._doc2World=new c.Matrix4,this._word2doc=new c.Matrix4,this._allLayoutName=new Array,this._devicePixelRatio=1,this._tzDwgStaticFile="",this._requestHeader="",this._objectsOsnap=null,this._initZoomwCoordPt1=null,this._initZoomWCoordPt2=null,this._blocks.initRootBlockRef(),this.m_iniSet[r.kEnableOsnapFunction]=!1,this.m_sysVariable.init(this)}n.MxDrawObject=x},{"./MxBrowseDisplay":23,"./MxBrowseLayerData":24,"./MxCADObject":28,"./MxCadSketchLayer":31,"./MxDrawObjectOsnap":38,"./MxFun":39,"./MxJigCmdManager":42,"./MxLocalFileLoad":44,"./MxManager":45,"./MxNetData":47,"./MxSelect":48,"./MxSystemVariable":51,three:19}],36:[function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.MxDrawObject2d=void 0;var a,g=t("three"),o=t("./MxFun"),s=t("./MxDrawObject"),l=t("three-orbitcontrols"),c=t("./MxNetData"),u=t("./MxMaterial"),h=(a=s.MxDrawObject,r(d,a),d.prototype.set3DDraw=function(t){this.is3DDraw=t},d.prototype.getOrthographicCamera=function(){return this.camera instanceof g.OrthographicCamera?this.camera:null},d.prototype.getFullDisplayRange=function(){return{minPt:this._minDisplayPoint,maxPt:this._maxDisplayPoint}},d.prototype.zoomW=function(t,e,n){if(null!=n&&n||(t=this.docCoord2World(t.x,t.y,0),e=this.docCoord2World(e.x,e.y,0)),t.x>e.x){var i=t.x;t.x=e.x,e.x=i}t.y>e.y&&(i=t.y,t.y=e.y,e.y=i);var r=this.getViewWidth(),a=this.getViewHeight(),o=Math.abs(t.x-e.x),s=Math.abs(t.y-e.y),l=this.getOrthographicCamera();if(o/s<r/a){var c=.5*s,u=r/a;l.left=-c*u,l.right=c*u,l.top=c,l.bottom=-c}else c=.5*o,u=a/r,l.left=-c,l.right=c,l.top=c*u,l.bottom=-c*u;var h=o,d=s,p=h;p<h&&(p=d),l.far=p;var f=t.x+.5*h,m=t.y+.5*d;l.zoom=1,l.position.set(f,m,.5*p),l.lookAt(new g.Vector3(f,m,0)),l.updateProjectionMatrix(),this.controls.target.x=f,this.controls.target.y=m,this.controls.target.z=0,this.controls.update()},d.prototype.zoomScale=function(t){var e=this.getOrthographicCamera();e.zoom=Math.max(this.controls.minZoom,Math.min(this.controls.maxZoom,e.zoom*t)),e.updateProjectionMatrix(),this.controls.update()},d.prototype.zoomCenter=function(t,e){var n=this.getOrthographicCamera(),i=this.docCoord2World(t,e,0);t=i.x,e=i.y,n.position.set(t,e,n.position.z),n.lookAt(new g.Vector3(t,e,0)),n.updateProjectionMatrix(),this.controls.target.x=t,this.controls.target.y=e,this.controls.target.z=0,this.controls.update()},d.prototype.calcCameraUp=function(t){var e=new g.Vector3(0,1,0),n=new g.Matrix4;return n.makeRotationZ(t),e.applyMatrix4(n),e},d.prototype.updateCameraDisplayRange=function(t,e,n){null!=this._initZoomwCoordPt1&&null!=this._initZoomWCoordPt2?(this._minDisplayPoint=this.docCoord2World(this._initZoomwCoordPt1.x,this._initZoomwCoordPt1.y,0),this._maxDisplayPoint=this.docCoord2World(this._initZoomWCoordPt2.x,this._initZoomWCoordPt2.y,0)):(this._minDisplayPoint=t,this._maxDisplayPoint=e),this.camera.up=this.calcCameraUp(n),this.zoomW(this._minDisplayPoint,this._maxDisplayPoint,!0)},d.prototype.zoomInitialStates=function(){null!=this._minDisplayPoint&&null!=this._maxDisplayPoint?this.zoomW(this._minDisplayPoint,this._maxDisplayPoint,!0):console.log("mx assert(0)")},d.prototype.onInitScene=function(){var t=this.getEvent(),e=0;if(null!=t.initScene&&(e=t.initScene(this.scene,this.controls,!0)),0==e){var n=new g.AmbientLight(3355443,1);this.scene.add(n);var i=new g.DirectionalLight(16777215,1);i.position.set(-2,2,3).normalize(),this.scene.add(i)}},d.prototype.onInitThreejs=function(){var t=this.getViewWidth(),e=this.getViewHeight(),n=(t=this.xzSize(t))/(e=this.xzSize(e))*50;this.camera=new g.OrthographicCamera(n/-2,n/2,25,-25,1,1e3),this.camera.position.set(0,0,200),this.scene=new g.Scene,this.scene.background=new g.Color(this._viewcolor);var i=this.getUserCanvas();if(null==i)this.renderer=new g.WebGLRenderer({antialias:!1}),this.renderer.setClearColor(0,1),this.renderer.setPixelRatio(this._devicePixelRatio),this.renderer.setSize(t,e),document.body.appendChild(this.renderer.domElement);else{var r={};r.canvas=i,this.renderer=new g.WebGLRenderer(r),this.renderer.setClearColor(0,1),this.renderer.setPixelRatio(this._devicePixelRatio)}this.renderer.sortObjects=!0;var a=this.getUserCanvas();null==a&&(a=this.renderer.domElement),this.controls=new l.OrbitControls(this.camera,a),this.is3DDraw||(this.controls.enableZoom=!0),o.MxFun.isPC()?(this.controls.zoomSpeed=4,this.controls.mouseButtons.LEFT=g.MOUSE.PAN,this._mouseRightRotate?this.controls.mouseButtons.RIGHT=g.MOUSE.ROTATE:this.controls.mouseButtons.RIGHT=g.MOUSE.PAN):(this.controls.zoomSpeed=1.5,this.controls.touches.ONE=g.TOUCH.PAN),this.controls.screenSpacePanning=!0},d.prototype.onCreate=function(){this._is2d=!0,this.onInitScene()},d.prototype.mxWebAddEntity_3DChild=function(t){var e=new c.MxNetData(t),n=e.getMesh();if(null==n.id)return n.size;var i=new g.Mesh(n.geometry,u.MxMaterial.GetBaseColorMaterial(n.nColorIndex));return this.removeEntity(n.id),this.scene.add(i),n.isSketchEntity&&(this.addEntity(n.id,i),this.getSketchLayers().addEntity(n.id,e.getLayerId())),n.size},d.prototype.mxWebAddEntity_Curve=function(t,e){var n=new c.MxNetData(t),i=n.getCurve(e);if(null!=i.id){var r=u.MxMaterial.GetCurveColorMaterial(i.colorIndex),a=new g.LineSegments(i.geometry,r);this.removeEntity(i.id),this.scene.add(a),i.isSketchEntity&&(this.addEntity(i.id,a),this.getSketchLayers().addEntity(i.id,n.getLayerId()))}},d.prototype.onResizeImp=function(t,e){var n=this.getViewWidth();null!=t&&(n=t);var i=this.getViewHeight();null!=e&&(i=e),n=this.xzSize(n),i=this.xzSize(i);var r=this.getOrthographicCamera();if(null==this._minDisplayPoint||null==this._maxDisplayPoint){var a=50,o=n/i;r.left=a*o/-2,r.right=a*o/2,r.top=a/2,r.bottom=a/-2,r.updateProjectionMatrix()}else{var s=Math.abs(this._minDisplayPoint.x-this._maxDisplayPoint.x),l=Math.abs(this._minDisplayPoint.y-this._maxDisplayPoint.y);s/l<n/i?(a=.5*l,o=n/i,r.left=-a*o,r.right=a*o,r.top=a,r.bottom=-a):(a=.5*s,o=i/n,r.left=-a,r.right=a,r.top=a*o,r.bottom=-a*o),r.updateProjectionMatrix()}this.renderer.setSize(n,i),this.updataClipMaterial()},d);function d(){var t=null!==a&&a.apply(this,arguments)||this;return t._minDisplayPoint=null,t._maxDisplayPoint=null,t.is3DDraw=o.MxFun.is3DDwg(),t}n.MxDrawObject2d=h},{"./MxDrawObject":35,"./MxFun":39,"./MxMaterial":46,"./MxNetData":47,three:19,"three-orbitcontrols":17}],37:[function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.MxDrawObject3d=void 0;var a,L=t("three"),o=t("./MxDrawObject"),s=t("three-orbitcontrols"),O=t("./MxNetData"),I=t("./MxMaterial"),P=t("./MxTools"),l=(a=o.MxDrawObject,r(c,a),c.prototype.mxWebAddEntity_Curve=function(t,e){var n=new O.MxNetData(t),i=0==t.getInt32(32,!0),r=n.getIsSketchEntity(),a=0;if(!((a=i?t.getInt32(20,!0)/4/3:t.getInt32(20,!0)/4/2)<2)){for(var o=new L.Geometry,s=e,l=0;l<a;l++){var c=t.getFloat32(s,!0);s+=4;var u=t.getFloat32(s,!0);s+=4;var h=0;i&&(h=t.getFloat32(s,!0),s+=4),o.vertices.push(P.MxTools.AsThreeJsPoint(c,u,h))}var d=t.getInt32(28,!0),p=I.MxMaterial.GetCurveColorMaterial(d),f=new L.LineSegments(o,p),m=t.getInt32(4,!0);this.removeEntity(m),this.scene.add(f),r&&this.addEntity(m,f)}},c.prototype.mxWebAddEntity_3DChild=function(t){var e=new O.MxNetData(t),n=e.getId(),i=(e.getColorIndex(),0==e.getBufferType()),r=e.getIsSketchEntity();this.removeEntity(n);var a=new L.Mesh(new L.Geometry),o=this.mxWebUpdateEntity_3DChild(a,t,i);return this.scene.add(a),r&&this.addEntity(n,a),a.geometry.computeBoundingBox(),a.geometry.computeBoundingSphere(),o},c.prototype.mxWebUpdateEntity_3DChild=function(t,e,n){var i=new O.MxNetData(e),r=i.getVertexBufferSize(),a=i.getIndexBufferSize(),o=i.getColorIndex();if(0===r||0===a)return i.getDrawDataOffset();var s=i.getMateria(),l=void 0,c=!0,u=!1,h=!1;0!=s.length&&(null!=(l=JSON.parse(s)).computeFaceNonmal&&(c=l.computeFaceNonmal),null!=l.castShadow&&(u=l.castShadow),null!=l.receiveShadow&&(h=l.receiveShadow)),t.material=I.MxMaterial.createMaterial(l),null==t.material&&(t.material=I.MxMaterial.GetColorMaterial(o)),t.castShadow=u,t.receiveShadow=h;var d=i.getDrawDataOffset(),p=0;p=n?r/4/8:r/4/2;var f=t.geometry;f.vertices=[],f.faces=[];for(var m=0;m<p;m++){var g=e.getFloat32(d+0,!0),v=e.getFloat32(d+4,!0),y=0,x=0,_=0,w=0,b=0,M=0;n?(y=e.getFloat32(d+8,!0),x=e.getFloat32(d+12,!0),_=e.getFloat32(d+16,!0),w=e.getFloat32(d+20,!0),b=e.getFloat32(d+24,!0),M=e.getFloat32(d+28,!0),d+=32):d+=8;var S=P.MxTools.AsThreeJsPoint(g,v,y);f.vertices.push(S),f.vertices[m].normal=P.MxTools.AsThreeJsPoint(x,_,w),f.vertices[m].uv=new L.Vector2(b,M)}var C=a/4;for(m=0;m<C;m+=3){var T=e.getInt32(d,!0);d+=4;var E=e.getInt32(d,!0);d+=4;var A=e.getInt32(d,!0);d+=4;var D=new L.Face3(T,E,A);c||D.vertexNormals.push(f.vertices[T].normal,f.vertices[E].normal,f.vertices[A].normal),f.faces.push(D),f.faceVertexUvs[0].push([f.vertices[T].uv,f.vertices[E].uv,f.vertices[A].uv])}return c&&f.computeFaceNormals(),d},c.prototype.updateUVs=function(l){l.faceVertexUvs[0]=[],l.faces.forEach(function(n){var t=["x","y","z"].sort(function(t,e){return Math.abs(n.normal[t])-Math.abs(n.normal[e])}),e=l.vertices[n.a],i=l.vertices[n.b],r=l.vertices[n.c],a=new L.Vector2(e[t[0]],e[t[1]]),o=new L.Vector2(i[t[0]],i[t[1]]),s=new L.Vector2(r[t[0]],r[t[1]]);l.faceVertexUvs[0].push([a,o,s])}),l.uvsNeedUpdate=!0},c.prototype.onInitThreejs=function(){var t=this.getViewWidth(),e=this.getViewHeight(),n=(t=this.xzSize(t))/(e=this.xzSize(e))*50;this.camera=new L.OrthographicCamera(n/-2,n/2,25,-25,1,1e3),this.camera.position.set(-200,200,200),this.scene=new L.Scene,this.scene.background=new L.Color(this._viewcolor);var i=this.getUserCanvas();null==i?(this.renderer=new L.WebGLRenderer({antialias:!0,alpha:!0}),this.renderer.setPixelRatio(this._devicePixelRatio),this.renderer.setSize(t,e),document.body.appendChild(this.renderer.domElement)):(this.renderer=new L.WebGLRenderer({canvas:i,antialias:!0,alpha:!0}),this.renderer.setPixelRatio(this._devicePixelRatio));var r=this.getUserCanvas();null==r&&(r=this.renderer.domElement),this.controls=new s.OrbitControls(this.camera,r)},c.prototype.onInitScene=function(){var t=this.getEvent(),e=0;if(null!=t.initScene&&(e=t.initScene(this.scene,this.controls,!1)),0==e){var n=new L.AmbientLight(2236962);n.integrity=1,this.scene.add(n);var i=new L.DirectionalLight(16777215,1);i.position.set(-2,2,3).normalize(),this.scene.add(i);var r=new L.GridHelper(2e3,100);r.position.y=-199,r.material.opacity=.25,r.material.transparent=!0,this.scene.add(r);var a=new L.AxesHelper(20);this.scene.add(a)}},c.prototype.onCreate=function(){this._is2d=!1;var t=this.getEvent();null!=t.initRenderer&&t.initRenderer(this.renderer),this.onInitScene()},c.prototype.getOrthographicCamera=function(){return this.camera instanceof L.OrthographicCamera?this.camera:null},c.prototype.onResizeImp=function(t,e){var n=this.getViewWidth();null!=t&&(n=t);var i=this.getViewHeight();null!=e&&(i=e),n=this.xzSize(n),i=this.xzSize(i);var r=this.getOrthographicCamera(),a=n/i;r.left=50*a/-2,r.right=50*a/2,r.top=25,r.bottom=-25,r.updateProjectionMatrix(),this.renderer.setSize(n,i)},c.prototype.updateCameraDisplayRange=function(t,e,n){},c.prototype.zoomInitialStates=function(){},c.prototype.zoomScale=function(t){},c.prototype.zoomW=function(t,e,n){},c.prototype.zoomCenter=function(t,e){},c.prototype.getFullDisplayRange=function(){return{}},c);function c(){var t=a.call(this)||this;return t._viewcolor=15790320,t}n.MxDrawObject3d=l},{"./MxDrawObject":35,"./MxMaterial":46,"./MxNetData":47,"./MxTools":53,three:19,"three-orbitcontrols":17}],38:[function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.MxDrawObjectOsnap=n.McDbLine=n.McDbCurve=n.McDbEntity=n.McDbType=void 0;var y,a,M=t("three"),S=t("./MxThreeJS"),x=t("./MxDrawData"),_=t("./MxJigCmdManager");(a=y=n.McDbType||(n.McDbType={}))[a.kInValid=0]="kInValid",a[a.kLine=1]="kLine";var o=(s.prototype.getType=function(){return this.m_type},s);function s(){this.m_type=y.kInValid}n.McDbEntity=o;var l,c=(r(u,l=o),u);function u(){return null!==l&&l.apply(this,arguments)||this}n.McDbCurve=c;var h,C=(r(d,h=c),d);function d(){var t=h.call(this)||this;return t.m_type=y.kLine,t}n.McDbLine=C;var p=(f.prototype.getBlobHead=function(t,e){var n={};return n.type=t.getInt32(e,!0),e+=4,n.ver=t.getInt32(e,!0),e+=4,n.databaseIndex=t.getInt32(e,!0),e+=4,n.nOffset=e,n},f.prototype.clearData=function(){this.threejsObjects=new M.Object3D},f.prototype.calculateDistance=function(t,e,n){var i=(new M.Vector3).subVectors(e,t),r=(new M.Vector3).subVectors(n,t),a=i.clone().normalize(),o=r.clone().normalize(),s=a.dot(o),l=(new M.Vector3).subVectors(n,e),c=(new M.Vector3).subVectors(t,e),u=l.clone().normalize(),h=c.clone().normalize();if(0<u.dot(h)&&0<s){var d=Math.sqrt(1-s*s),p=t.distanceTo(n),f=p*d,m=p*s,g=i.clone().normalize().multiplyScalar(m),v=t.clone().add(g),y=i.clone().normalize().multiplyScalar(200+m),x=t.clone().add(y);return{pt1:t,pt2:e,pt:n,distance:f,targetPt:v,warningPt:x}}return null},f.prototype.getOsnapData=function(t,e){if(this.threejsObjects){var n=new M.Raycaster,i=x.MxDrawData.getCursorWidthPixels();n.linePrecision=this.mxObj.screenCoordLong2World(i);var r=this.mxObj.getCanvas(),a=r.clientWidth,o=r.clientHeight,s=this.mxObj.screenCoord2World(t.x,t.y);s.z=0,t=new M.Vector2(t.x/a*2-1,-t.y/o*2+1),n.setFromCamera(t,this.mxObj.getCamera());var l=n.intersectObjects(this.threejsObjects.children,!0),c=new Map;if(l.length)for(var u=0;u<l.length;u++){var h=l[u];if(h.object.userData&&h.object.userData.obj.getType()==y.kLine){var d=h.object.userData.obj,p=s.distanceTo(d.pt1);d.pt1.type=_.MxJigCmdManager.OsnapMode.kOsModeEnd,c.set(p,d.pt1);var f=s.distanceTo(d.pt2);if(d.pt2.type=_.MxJigCmdManager.OsnapMode.kOsModeEnd,c.set(f,d.pt2),!d.bulge||0==d.bulge){var m=this.calculateDistance(d.pt1,d.pt2,s);m&&(m.targetPt.type=_.MxJigCmdManager.OsnapMode.kOsModeNear,c.set(m.distance,m.targetPt))}}}if(c.size){var g=this.mxObj.screenCoordLong2World(i),v=Array.from(c);v.sort(function(t,e){return t[0]-e[0]}),v[0][0]<g&&e(v[0][1],v[0][1].type)}}},f.prototype.mxWebEntitysData=function(t,e){var n=this.getBlobHead(t,0);t.getInt32(n.nOffset,!0),n.nOffset+=4;var i=t.getInt32(n.nOffset,!0);n.nOffset+=4;var r=t.getInt32(n.nOffset,!0);if(n.nOffset+=4,1<r)console.log("mx:error mxfun.js version is old!");else{var a=t.getInt32(n.nOffset,!0);if(n.nOffset+=4,a==n.nOffset){this.threejsObjects=new M.Object3D;for(var o=0;o<i;o++){var s=t.getInt8(n.nOffset);n.nOffset+=1;var l=t.getInt32(n.nOffset,!0);if(n.nOffset+=4,1==s){var c=t.getFloat32(n.nOffset,!0);n.nOffset+=4;var u=t.getFloat32(n.nOffset,!0);n.nOffset+=4;var h=t.getFloat32(n.nOffset,!0);n.nOffset+=4;var d=t.getFloat32(n.nOffset,!0);n.nOffset+=4,(_=new C).pt1=new M.Vector3(c,u,0),_.pt2=new M.Vector3(h,d,0),(w=S.MxThreeJS.createLine(_.pt1,_.pt2,16777215)).userData.obj=_,this.threejsObjects.add(w)}else if(2==s){var p=t.getInt8(n.nOffset);n.nOffset+=1;var f=t.getInt32(n.nOffset,!0);n.nOffset+=4;for(var m=new M.Vector3,g=0,v=null,y=0;y<f;y++){var x=new M.Vector3;x.x=t.getFloat32(n.nOffset,!0),n.nOffset+=4,x.y=t.getFloat32(n.nOffset,!0),n.nOffset+=4;var _,w,b=t.getFloat32(n.nOffset,!0);n.nOffset+=4,0<y&&((_=new C).pt1=m.clone(),_.pt2=x.clone(),_.bulge=b,(w=S.MxThreeJS.createLine(_.pt1,_.pt2,16777215)).userData.obj=_,this.threejsObjects.add(w)),m=x,g=b,0==y&&(v=x)}p&&2<f&&((_=new C).pt1=v.clone(),_.pt2=m.clone(),_.bulge=g,(w=S.MxThreeJS.createLine(_.pt1,_.pt2,16777215)).userData.obj=_,this.threejsObjects.add(w))}else console.log("mx:error mxWebEntitysData type"),n.nOffset=n.nOffset-5+l}}else console.log("mx: mxWebEntitysData size assert(0)")}},f);function f(t){this.threejsObjects=null,this.mxObj=null,this.mxObj=t}n.MxDrawObjectOsnap=p},{"./MxDrawData":34,"./MxJigCmdManager":42,"./MxThreeJS":52,three:19}],39:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.MxFun=void 0;var l,i,r,a,o,s,c,u,h,d,p,f,m,g,v=t("three"),y=t("./MxManager"),x=t("./MxDrawObject2d"),_=t("./MxDrawObject3d"),w=t("./MxUiObjectMobile"),b=t("./MxUiObjectPC"),M=t("./MxJigCmdManager"),S=t("./MxJigGetLine"),C=t("./MxCmdRunManager"),T=t("./MxUiVue"),E=t("./MxThreeJS"),A=t("./MxWindowsEvent"),D=t("./MxTools"),L=t("./MxDrawCommands"),O=t("./MxDrawData"),I=t("./MxCADEditDisplay"),P=t("./MxLocalFileLoad");function R(t){t.cmd&&B(t.cmd)}function k(t){var e=new RegExp("(^|&)"+t+"=([^&]*)(&|$)"),n=window.location.search.substr(1).match(e);return null!=n?decodeURIComponent(n[2]):""}function N(){return y.MxManager.currentMx()}function B(t,e){return C.MxCmdRunManager.runCmd(t,e)}function F(t){null!=t&&(t.init(),T.MxUiVue.init(t)),p||(p=!0,g=new P.MxLocalNodeJs,M.MxJigCmdManager.init(),A.MxWindowsEvent.registEvent(),y.MxManager.init(),L.MxDrawCommands.registerCommand(),m.sendStringToExecute=R)}l=n.MxFun||(n.MxFun={}),i=".",c=o=a=-1,d=null,p=!(h="ws://localhost:5090"),m={},g=f=u=s=r=void 0,l.getUiObj=function(){return d},l.getNodeJs=function(){return g},l.setMxServer=function(t){h=t},l.getMxServer=function(){return h},l.isPC=function(){return!/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)},l.getClientPlatform=function(){return navigator.platform},l.getClientInfo=function(){return{width:document.body.clientWidth,height:document.body.clientHeight}},l.curPath=function(){return i},l.setCurPath=function(t){i=t},l.getQueryString=k,l.getLocationPageUrl=function(){var t=window.location.href,e=t.lastIndexOf("?");return-1==e?t:t.substring(0,e)},l.getUrlParams=function(){var t=window.location.search,e=t.substr(1,t.length).split("&"),n=new Array;if(null!=e)for(var i=0;i<e.length;i++){var r=e[i].replace(/[=|^==]/,"&").split("&");if(1<r.length){var a=new Array;a.push(decodeURIComponent(r[0])),a.push(decodeURIComponent(r[1])),n.push(a)}}return n},l.call=function(t,e,n){null==e?e="{}":"string"==typeof e?0==e.length?e="{}":"["==e[0]&&"]"==e[e.length-1]||"{"==e[0]&&"}"==e[e.length-1]||(e='"'+(e=e.replace(/"/g,"'"))+'"'):e="object"==typeof e?JSON.stringify(e):"{}",y.MxManager.currentMx().call(t,e,n)},l.loadCodeToServer=function(t,e){y.MxManager.currentMx().loadCodeToServer(t,e)},l.getCurrentMx=N,l.getCurrentMxCAD=function(){var t=N();return t?t.getMxCAD():null},l.openFile=function(t){y.MxManager.currentMx().openFile(t)},l.loadCodeFileToServer=function(t,e,n){y.MxManager.currentMx().loadCodeFileToServer(t,e,n)},l.isEnableSelect=function(){if(-1!=a)return 1==a;var t=k("select");return a=0,null!=t&&"y"==t.toLowerCase()&&(a=1),1==a},l.is3DDwg=function(){if(-1!=c)return 1==c;var t=k("3ddwg");return c=0,null!=t&&"y"==t.toLowerCase()&&(c=1),1==c},l.isStaticLoad=function(){if(-1!=o)return 1==o;var t=k("static");return o=0,null!=t&&"y"==t.toLowerCase()&&(o=1),1==o},l.enableSelect=function(t){a=t?1:0},l.enablStaticLoad=function(t){o=null==t||t?1:0},l.dwgDir=function(){return null!=s||null==(s=k("dwgdir"))&&(s=""),s},l.setDwgDir=function(t){s=t},l.getStaticServer=function(){return null!=u||null==(u=k("staticServer"))&&(u=""),u},l.setStaticServer=function(t){u=t},l.is2dParam=function(){if(null!=r)return r;var t=k("file");if(r=!1,null!=t){var e=t.substring(t.lastIndexOf(".")+1);"dwg"!=e.toLowerCase()&&"dxf"!=e.toLowerCase()&&"dwf"!=e.toLowerCase()&&"mwg"!=e.toLowerCase()||(r=!0)}return r},l.set2dParam=function(t){r=t},l.showLayer=function(t,e,n){var i=y.MxManager.currentMx().getMxCAD();if(!i)return y.MxManager.currentMx().showLayer(t,e,n);"number"==typeof t&&I.MxCADDisplayFun.showLayer(i.getDatabase(),t,e)},l.upDisplayForLayerData=function(t){var e=y.MxManager.currentMx().getMxCAD();return!!e&&e.getDatabase().getLayerTable().upDisplayForLayerData(e.getDatabase(),t)},l.screenCoord2World=function(t,e,n){return y.MxManager.currentMx().screenCoord2World(t,e,n)},l.worldCoord2Screen=function(t,e,n){return y.MxManager.currentMx().worldCoord2Screen(t,e,n)},l.docCoord2World=function(t,e,n){return y.MxManager.currentMx().docCoord2World(t,e,n)},l.worldCoord2Doc=function(t,e,n){return y.MxManager.currentMx().worldCoord2Doc(t,e,n)},l.screenCoord2Doc=function(t,e,n){return y.MxManager.currentMx().screenCoord2Doc(t,e,n)},l.docCoord2Screen=function(t,e,n){return y.MxManager.currentMx().docCoord2Screen(t,e,n)},l.zoomCenter=function(t,e){y.MxManager.currentMx().is2D()&&(y.MxManager.currentMx().zoomCenter(t,e),y.MxManager.currentMx().updateDisplay())},l.zoomW=function(t,e,n,i,r){y.MxManager.currentMx().is2D()&&(y.MxManager.currentMx().zoomW(new v.Vector3(t,e,0),new v.Vector3(n,i,0),r),y.MxManager.currentMx().updateDisplay())},l.zoomScale=function(t){y.MxManager.currentMx().is2D()&&(y.MxManager.currentMx().zoomScale(t),y.MxManager.currentMx().updateDisplay())},l.zoomAll=function(){y.MxManager.currentMx().is2D()&&(y.MxManager.currentMx().zoomAll(),y.MxManager.currentMx().updateDisplay())},l.deleteAll=function(){return y.MxManager.currentMx().deleteAll()},l.callCommand=function(t,e,n){y.MxManager.currentMx().callCommand(t,e,n)},l.getCurrentColor=function(){return y.MxManager.currentMx().getCurrentColor()},l.setCurrentColor=function(t){y.MxManager.currentMx().setCurrentColor(t)},l.undo=function(){y.MxManager.currentMx().undo()},l.save=function(){y.MxManager.currentMx().save()},l.showLoading=function(){null!=d&&d.ShowLoading()},l.hideLoading=function(){null!=d&&d.HideLoading()},l.showProp=function(t){null!=d&&d.ShowObjectProperty(t)},l.hideProp=function(){null!=d&&d.HideObjectProp()},l.getUiObject=function(){return d},l.getViewCenterDocCoord=function(){return y.MxManager.currentMx().is2D()?y.MxManager.currentMx().getViewCenterDocCoord():new v.Vector3(0,0,0)},l.screenCoordLong2Doc=function(t){return y.MxManager.currentMx().is2D()?y.MxManager.currentMx().screenCoordLong2Doc(t):t},l.docCoordLong2Screen=function(t){return y.MxManager.currentMx().is2D()?y.MxManager.currentMx().docCoordLong2Screen(t):t},l.worldCoordLong2Doc=function(t){return y.MxManager.currentMx().is2D()?y.MxManager.currentMx().worldCoordLong2Doc(t):t},l.docCoordLong2World=function(t){return y.MxManager.currentMx().is2D()?y.MxManager.currentMx().docCoordLong2World(t):t},l.screenCoordLong2World=function(t){return y.MxManager.currentMx().is2D()?y.MxManager.currentMx().screenCoordLong2World(t):t},l.worldCoordLong2Screen=function(t){return y.MxManager.currentMx().is2D()?y.MxManager.currentMx().worldCoordLong2Screen(t):t},l.addSelectEvent=function(t){y.MxManager.addSelectEvent(t)},l.clearSelectEvent=function(){y.MxManager.clearSelectEvent()},l.removeThreejsObject=function(t,e){t&&(t.traverse(function(t){(t instanceof v.Mesh||t instanceof v.Line||t instanceof v.LineLoop)&&t.geometry.dispose()}),e.remove(t))},l.setOutServerDebugCall=function(t){y.MxManager.setOutDebugCall(t)},l.updateDisplay=function(){y.MxManager.updateDisplay()},l.getCurrentDraw=function(){return y.MxManager.currentMx()},l.formatString=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var i=0;i<e.length;i++)t=t.replace("{"+i+"}",e[i]);return t},l.createMxUiObject=function(t){var e;return e=this.isPC()?new b.MxUiObjectPC:new w.MxUiObjectMobile,t(d=e),e.create(),e},l.createMxObject=function(t,e,n,i,r){p||F(),"string"==typeof t&&(t=0==t.length?void 0:document.getElementById(t)),null==e&&(e=l.getQueryString("file"));var a=null!=i&&i;if(null!=e){0==e.length&&(e="empty");var o=e.substring(e.lastIndexOf(".")+1);"dwg"!=o.toLowerCase()&&"dxf"!=o.toLowerCase()&&"dwf"!=o.toLowerCase()&&"mwg"!=o.toLowerCase()||(a=!0)}else e="empty";1==r&&(e="");var s=null;return a?(s=new x.MxDrawObject2d).setViewColor(0):(s=new _.MxDrawObject3d).setViewColor(15790320),null!=n&&n(s),s.create(t,e),s},l.getMxObjectFormElement=function(t){return y.MxManager.getMxObject(t)},l.isRunningCommand=function(){return M.MxJigCmdManager.isRunning()},l.stopRunCommand=function(){return M.MxJigCmdManager.stopCmd()},l.runCommand=function(t){return M.MxJigCmdManager.runCmd(t)},l.getTHREE=function(){return v},l.getLine=function(t){var e=new S.MxJigGetLine;e.setRetCall(t),M.MxJigCmdManager.runCmd(e)},l.addCommand=function(t,e,n){C.MxCmdRunManager.addCommand(t,e,n)},l.sendStringToExecute=B,l.init=F,l.addWindowsEvent=function(t){A.MxWindowsEvent.addEvent(t)},l.getCurrentMousePostion=function(){return A.MxWindowsEvent.getCurrentMousePostion()},l.getMxThreeJS=function(){return E.MxThreeJS},l.getMxTools=function(){return D.MxTools},l.getMxCmdRunManager=function(){return C.MxCmdRunManager},l.getMxJigCmdManager=function(){return M.MxJigCmdManager},l.initQuickCommand=function(t){C.MxCmdRunManager.InitQuickCommand(t)},l.Assert=function(t){t||console.log("MxAssert error")},l.setIniset=function(t){O.MxDrawData.setIniset(t)},l.setPostMessageToParentFrameFunction=function(t){f=t},l.postMessageToParentFrame=function(t){return null!=f&&(f(t),!0)},l.onParentFrameMessage=function(t){null!=t&&null!=t.type&&m[t.type]&&m[t.type](t)},l.acutPrintf=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(!T.MxUiVue.isNull()){for(var i=arguments,r=i[0],a=0;a<i.length-1;a++){var o=new RegExp("\\{"+a+"\\}","gm");r=r.replace(o,i[a+1])}T.MxUiVue.AcutPrintfNoFormat(r,!0)}}},{"./MxCADEditDisplay":25,"./MxCmdRunManager":32,"./MxDrawCommands":33,"./MxDrawData":34,"./MxDrawObject2d":36,"./MxDrawObject3d":37,"./MxJigCmdManager":42,"./MxJigGetLine":43,"./MxLocalFileLoad":44,"./MxManager":45,"./MxThreeJS":52,"./MxTools":53,"./MxUiObjectMobile":56,"./MxUiObjectPC":57,"./MxUiVue":58,"./MxWindowsEvent":59,three:19}],40:[function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.MxIntelliSelectJig=void 0;var a,l=t("three"),o=t("./MxJig"),s=t("./MxJigCmdManager"),c=t("./MxThreeJS"),u=(a=o.McEdJigCommand,r(h,a),h.prototype.sampler=function(){var t=s.MxJigCmdManager.InType.kGetBegan,e=this.acquirePoint(t);return e.status==s.MxJigCmdManager.DragStatus.kNormal&&(this.m_pt2=e.pt),e.status},h.prototype.getTypeName=function(){return"MxIntelliSelect"},h.prototype.done=function(t){if(t==s.MxJigCmdManager.DragStatus.kNormal){var e={x1:this.m_pt1.x,y1:this.m_pt1.y,x2:this.m_pt2.x,y2:this.m_pt2.y},n=this.getMxObject();n.callCommand("MxCAD_IntelliSelect",JSON.stringify(e),function(t){n.getMxCAD().getGrip().onIntelliSelect(t)})}return s.MxJigCmdManager.DoneStatius.kExitCommand},h.prototype.doPointSelect=function(t,e,n){var i=t.screenCoordLong2World(16),r={x:e.x,y:e.y,tol:i};t.callCommand("MxCAD_IntelliSelect_Point",JSON.stringify(r),function(t){n(t)})},h.prototype.upDisplay=function(){var t=new l.Vector3(this.m_pt1.x,this.m_pt2.y,this.m_pt2.z),e=new l.Vector3(this.m_pt2.x,this.m_pt1.y,this.m_pt2.z),n=[];n.push(this.m_pt1),n.push(t),n.push(this.m_pt2),n.push(e),n.push(this.m_pt1);var i=null,r=65280;if(this.m_pt2.x>this.m_pt1.x)i=c.MxThreeJS.createLines(n,16777215),r=255;else{var a=this.getMxObject().screenCoordLong2World(3);i=c.MxThreeJS.createDashedLines(n,16777215,2*a,a)}var o=[];o.push(this.m_pt1),o.push(t),o.push(this.m_pt2),o.push(this.m_pt1),o.push(this.m_pt2),o.push(e);var s=c.MxThreeJS.createTriangle(o,r,.27);this.drawEntity(s,30),this.drawEntity(i,31)},h);function h(t){var e=a.call(this)||this;return e.m_pt1=t,e.m_pt2=t,e}n.MxIntelliSelectJig=u},{"./MxJig":41,"./MxJigCmdManager":42,"./MxThreeJS":52,three:19}],41:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.McEdJigCommand=n.MxDynamicInput=void 0;var f=t("three"),m=t("./MxFun"),a=t("./MxJigCmdManager"),o=t("./MxTools"),s=t("./MxUiVue"),i=t("./McEdJigOsnap"),r=t("./MxWindowsEvent"),l=(c.prototype.onKeyDonw=function(t){if(27==t)return this.m_isInputStatus?(this.m_isInputStatus=!1,s.MxUiVue.OnMxEvent({name:"dynInputReSet"}),1):0;if(32!=t&&13!=t)return this.m_isInputStatus=!0,0;if(this.m_isInputStatus&&s.MxUiVue.DynamicInput_isShow()&&s.MxUiVue.DynamicInput_getType()==a.MxJigCmdManager.DynamicInputType.kXYCoordInput){var e=s.MxUiVue.DynamicInput_getValue1(),n=s.MxUiVue.DynamicInput_getValue2(),i=s.MxUiVue.DynamicInput_getFocusValue(),r="";r=o.MxTools.IsNumerical(e)&&o.MxTools.IsNumerical(n)?m.MxFun.formatString("{0},{1}",e,n):i,s.MxUiVue.setCmdText(r)}return this.m_isInputStatus=!1,0},c.prototype.isInputStatus=function(){return this.m_isInputStatus},c.prototype.initDynInput=function(t){this.m_jig=t;var e=this.m_jig.getMxObject();s.MxUiVue.DynamicInput_setType(this.m_dynType),this.m_dynType==a.MxJigCmdManager.DynamicInputType.kAutoInput&&(null!=this._dynamicInputBasePoint||e.sysVariable().getSysVarNumber("GETPOINTSTATUS")&a.MxJigCmdManager.GETPOINTSTATUS.OsModeSValidLastPoint?s.MxUiVue.DynamicInput_setType(a.MxJigCmdManager.DynamicInputType.kDistanceInput):s.MxUiVue.DynamicInput_setType(a.MxJigCmdManager.DynamicInputType.kXYCoordInput))},c.prototype.setFocus=function(t){s.MxUiVue.OnMxEvent({name:"dynInputSetFocus",param:{isFocus:t}})},c.prototype.exitDynInput=function(){this._dynamicInputBasePoint=void 0,s.MxUiVue.DynamicInput_setShow(!1),s.MxUiVue.DynamicInput_upDisplay()},c.prototype.isShow=function(){return s.MxUiVue.DynamicInput_isShow()},c.prototype.upDynInput=function(){var t=this.m_jig.getMxObject(),e=!1;if(e=!this.m_jig.isDisableDynInput()&&t.sysVariable().getSysVarBool("DYNINPUT"),s.MxUiVue.DynamicInput_setShow(e),e){if(s.MxUiVue.DynamicInput_setTip(s.MxUiVue.getCmdTip()),a.MxJigCmdManager.getAcquireStatus()==a.MxJigCmdManager.AcquireStatus.kMove){var n=a.MxJigCmdManager.getAcquirePoint();if(s.MxUiVue.DynamicInput_setPos(m.MxFun.worldCoord2Screen(n.x,n.y,n.z)),s.MxUiVue.DynamicInput_getType()==a.MxJigCmdManager.DynamicInputType.kXYCoordInput){var i=m.MxFun.worldCoord2Doc(n.x,n.y,n.z);s.MxUiVue.DynamicInput_setValue1(i.x.toFixed(3)),s.MxUiVue.DynamicInput_setValue2(i.y.toFixed(3))}else s.MxUiVue.DynamicInput_getType(),a.MxJigCmdManager.DynamicInputType.kDistanceInput}s.MxUiVue.DynamicInput_upDisplay()}},c.prototype.setDynamicInputBasePoint=function(t){this._dynamicInputBasePoint=t},c.prototype.setDynamicInputType=function(t){this.m_dynType=t},c.prototype.getDynamicInputType=function(){return this.m_dynType},c);function c(t){this.m_dynType=a.MxJigCmdManager.DynamicInputType.kAutoInput,this._dynamicInputBasePoint=void 0,this.m_isInputStatus=!1,this.m_jig=t}n.MxDynamicInput=l;var u=(h.prototype.getTypeName=function(){return""},h.prototype.onExitCommand=function(t){t&&this.m_dynInput.exitDynInput(),this.m_osnap.endDrag()},h.prototype.getOsnap=function(){return this.m_osnap},h.prototype.isDisableDynInput=function(){return this.m_isDisableDynInput},h.prototype.setDisableDynInput=function(t){this.m_isDisableDynInput=t},h.prototype.setDisableOsnap=function(t){this.m_isDisableOsnap=t},h.prototype.isDisableOsnap=function(){return this.m_isDisableOsnap},h.prototype.onStartCommand=function(){this._isCancle=!1,this._isExit=!1,this.m_dynInput.initDynInput(this),i.McEdImpJigGlobalData.intiStartDrag(this._mxObject),this.m_osnap.startDrag(this.m_isOffsetInputPostion,this);var t=r.MxWindowsEvent.getCurrentMousePostion(),e=this._mxObject.screenCoord2World(t.x,t.y,0);e=this.m_osnap.reCompteCurrentPoint(e),this.m_osnap.setPoint(e),a.MxJigCmdManager.doMouseMoveImp(),this.m_dynInput.setFocus(!0)},h.prototype.getDynImput=function(){return this.m_dynInput},h.prototype.setMxObject=function(t){this._mxObject=t},h.prototype.getMxObject=function(){return this._mxObject},h.prototype.setColor=function(t){this._iColor=t},h.prototype.getColor=function(){return this._iColor},h.prototype.setDynamicInputType=function(t){this.m_dynInput.setDynamicInputType(t)},h.prototype.getDynamicInputType=function(){return this.m_dynInput.getDynamicInputType()},h.prototype.createTriangle=function(t,e,n){var i=new f.MeshBasicMaterial({color:this._iColor,side:f.DoubleSide}),r=new f.Geometry;r.vertices.push(t),r.vertices.push(e),r.vertices.push(n);var a=new f.Vector3(1,1,1),o=new f.Color(this._iColor),s=new f.Face3(0,1,2,a,o,0);return r.faces.push(s),r.computeFaceNormals(),r.computeVertexNormals(),new f.Mesh(r,i)},h.prototype.createPoint=function(t){var e=new f.Geometry;e.vertices.push(t);var n=new f.PointsMaterial({color:this._iColor,size:3});return new f.Points(e,n)},h.prototype.createLine=function(t,e){var n=new f.Geometry,i=new f.LineBasicMaterial({color:this._iColor});return n.vertices.push(t,e),new f.Line(n,i)},h.prototype.drawReserve=function(t){this.m_isReserveDrawStatus=!0,this.m_callReserveDrawAddEntity=t,this.upDisplay(),this.m_isReserveDrawStatus=!1,this.m_callReserveDrawAddEntity=null},h.prototype.drawEntity=function(t,e){if(null!=t)if(this.m_isReserveDrawStatus)t.renderOrder=null!=e?e:30,this._mxObject.addObject(t,!0),this.m_callReserveDrawAddEntity&&this.m_callReserveDrawAddEntity(t);else{var n="MxDynDraw_"+this._DynNameId.toString();t.name=n,t.renderOrder=null!=e?e:30,null==this._aryDynDrawObjectNamesId&&(this._aryDynDrawObjectNamesId=new Array),this._aryDynDrawObjectNamesId.push(this._DynNameId),this._DynNameId++,this._mxObject.getScene().add(t)}},h.prototype.floorPowerOfTwo=function(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))},h.prototype.makeTextSprite=function(t,e,n,i,r){var a,o=document.createElement("canvas"),s=o.getContext("2d"),l=m.MxFun.formatString("normal {0}px Arial","256");s.font=l;var c=s.measureText(t);a=2*this.floorPowerOfTwo(c.width),o.width=a,o.height=256,s.font=l,s.textAlign="center",s.textBaseline="middle";var u=m.MxFun.formatString("#{0}",r.toString(16));s.fillStyle=u,s.fillText(t,a/2,128);var h=new f.Texture(o);h.needsUpdate=!0;var d=new f.SpriteMaterial({map:h});d.transparent=!1,d.rotation=i;var p=new f.Sprite(d);return p.scale.set(a/256*n,n,1),p.position.set(e.x,e.y,0),p},h.prototype.drawText=function(t,e,n,i){var r=this.makeTextSprite(t,i,e,n,this._iColor);this.drawEntity(r)},h.prototype.drawPoints=function(t){for(var e=0;e<t.length;e++){var n=new f.Geometry;n.vertices.push(t[e]);var i=new f.PointsMaterial({color:this._iColor,size:3}),r=new f.Points(n,i);this.drawEntity(r)}},h.prototype.drawPoint=function(t){var e=new f.Geometry;e.vertices.push(t);var n=new f.PointsMaterial({color:this._iColor,size:3}),i=new f.Points(e,n);this.drawEntity(i)},h.prototype.drawPolyline=function(t){for(var e=new f.Geometry,n=0;n<t.length;n++)e.vertices.push(t[n]);var i=new f.LineBasicMaterial({color:this._iColor}),r=new f.Line(e,i);this.drawEntity(r)},h.prototype.drawSpline=function(t){},h.prototype.drawCircle=function(t,e){var n=new f.CircleGeometry(e,64,3,2*Math.PI),i=new f.LineBasicMaterial({color:this._iColor});n.vertices.shift();var r=new f.LineLoop(n,i);r.position.x=t.x,r.position.y=t.y,r.position.z=t.z,this.drawEntity(r)},h.prototype.drawArc=function(t,e,n,i){var r=new f.CircleGeometry(e,64,n,i),a=new f.LineBasicMaterial({color:this._iColor});r.vertices.shift();var o=new f.Line(r,a);o.position.x=t.x,o.position.y=t.y,o.position.z=t.z,this.drawEntity(o)},h.prototype.drawLine=function(t,e){var n=new f.Geometry,i=new f.LineBasicMaterial({color:this._iColor});n.vertices.push(t,e);var r=new f.Line(n,i);this.drawEntity(r)},h.prototype.removeDynDrawObject=function(){if(null!=this._aryDynDrawObjectNamesId){for(var t=0;t<this._aryDynDrawObjectNamesId.length;t++){var e="MxDynDraw_"+this._aryDynDrawObjectNamesId[t].toString(),n=this._mxObject.getScene().getObjectByName(e);m.MxFun.removeThreejsObject(n,this._mxObject.getScene())}this._aryDynDrawObjectNamesId=[]}},h.prototype.acquirePoint=function(t){var e=a.MxJigCmdManager.acquirePoint(t);return this._isExit=e.exit,e},h.prototype.notifyCancleExit=function(){this._isCancle=!0,this.removeDynDrawObject(),this.done(a.MxJigCmdManager.DragStatus.kCancel),this.onExitCommand(!0),a.MxJigCmdManager.commandRunComplete(this)},h.prototype.notifySampler=function(){var t=this.sampler();if(this.m_dynInput.upDynInput(),t==a.MxJigCmdManager.DragStatus.kNormal&&(this.removeDynDrawObject(),this.upDisplay()),this._isExit){var e=this.done(t);this._isCancle||(e==a.MxJigCmdManager.DoneStatius.kContinueCommand?(this._isExit=!1,a.MxJigCmdManager.doMouseMoveImp(),s.MxUiVue.OnMxEvent({name:"dynInputReSet"})):(this.removeDynDrawObject(),a.MxJigCmdManager.commandRunComplete(this),this.onExitCommand(!0)))}this._mxObject.updateDisplay()},h.prototype.getCurrentMouseButton=function(){return a.MxJigCmdManager.getCurrentMouseButton()},h.prototype.userInputControls=function(){return this._userInputContros},h.prototype.setUserInputControls=function(t){this._userInputContros=t},h);function h(){this._isExit=!1,this._aryDynDrawObjectNamesId=void 0,this._DynNameId=1,this._iColor=16777215,this._isCancle=!1,this.m_isDisableDynInput=!1,this.m_isDisableOsnap=!1,this.m_dynInput=new l(this),this.m_osnap=new i.McEdJigOsnap(this),this._userInputContros=a.MxJigCmdManager.UserInputControls.kNullResponseAccepted,this.m_isOffsetInputPostion=!1,this.m_isReserveDrawStatus=!1,this.m_callReserveDrawAddEntity=null,this._mxObject=null}n.McEdJigCommand=u},{"./McEdJigOsnap":20,"./MxFun":39,"./MxJigCmdManager":42,"./MxTools":53,"./MxUiVue":58,"./MxWindowsEvent":59,three:19}],42:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.MxJigCmdManager=n.AcquireReturn=void 0;var i,X=t("three"),Y=t("./MxFun"),Z=t("./MxJig"),$=t("./MxManager"),K=t("./MrxDbgUiPrPoint"),Q=t("./MrxDbgUiPrBase"),tt=t("./MxUiVue"),et=t("./MxTools"),nt=t("./MxString"),it=t("./MxWindowsEvent"),rt=t("./MxDrawObject"),at=t("./McEdJigOsnap"),ot=t("./MxDrawData"),st=function(){this.status=i.DragStatus.kNoChange,this.exit=!0,this.sKeyValue=""};n.AcquireReturn=st,function(r){var s,t,a,e,l,n,i,o,c,u,h,d,p,f,m,g,v,y;(t=s=r.UserInputControls||(r.UserInputControls={}))[t.kGovernedByOrthoMode=1]="kGovernedByOrthoMode",t[t.kNullResponseAccepted=2]="kNullResponseAccepted",t[t.kDontEchoCancelForCtrlC=4]="kDontEchoCancelForCtrlC",t[t.kDontUpdateLastPoint=8]="kDontUpdateLastPoint",t[t.kNoDwgLimitsChecking=16]="kNoDwgLimitsChecking",t[t.kNoZeroResponseAccepted=32]="kNoZeroResponseAccepted",t[t.kNoNegativeResponseAccepted=64]="kNoNegativeResponseAccepted",t[t.kAccept3dCoordinates=128]="kAccept3dCoordinates",t[t.kAcceptMouseUpAsPoint=256]="kAcceptMouseUpAsPoint",t[t.kAnyBlankTerminatesInput=512]="kAnyBlankTerminatesInput",t[t.kInitialBlankTerminatesInput=1024]="kInitialBlankTerminatesInput",t[t.kAcceptOtherInputString=2048]="kAcceptOtherInputString",t[t.kGovernedByUCSDetect=4096]="kGovernedByUCSDetect",t[t.kNoZDirectionOrtho=8192]="kNoZDirectionOrtho",t[t.kSpacesInAccepted=16384]="kSpacesInAccepted",(e=a=r.AcquireStatus||(r.AcquireStatus={}))[e.kNoChange=0]="kNoChange",e[e.kMove=1]="kMove",e[e.kBegan=2]="kBegan",e[e.kEnd=3]="kEnd",e[e.kMouseUp=4]="kMouseUp",e[e.kMouseDown=5]="kMouseDown",e[e.kCancle=6]="kCancle",(n=l=r.DragStatus||(r.DragStatus={}))[n.kNoChange=-6]="kNoChange",n[n.kCancel=-4]="kCancel",n[n.kOther=-3]="kOther",n[n.kNull=-1]="kNull",n[n.kNormal=0]="kNormal",n[n.kKW1=1]="kKW1",(i=r.DoneStatius||(r.DoneStatius={}))[i.kContinueCommand=0]="kContinueCommand",i[i.kExitCommand=1]="kExitCommand",(c=o=r.InType||(r.InType={}))[c.kGetBegan=1]="kGetBegan",c[c.kGetEnd=2]="kGetEnd",(h=u=r.MouseButton||(r.MouseButton={}))[h.kInvalid=-1]="kInvalid",h[h.kLeft=0]="kLeft",h[h.kMid=1]="kMid",h[h.kRight=2]="kRight",(p=d=r.COMMAND_IN||(r.COMMAND_IN={}))[p.COMMAND_IN_NO_ENTITY=0]="COMMAND_IN_NO_ENTITY",p[p.COMMAND_IN_EMTPY=1]="COMMAND_IN_EMTPY",p[p.COMMAND_IN_KEY=2]="COMMAND_IN_KEY",p[p.COMMAND_IN_STRING=3]="COMMAND_IN_STRING",p[p.COMMAND_IN_COORD=5]="COMMAND_IN_COORD",p[p.COMMAND_IN_DIST=6]="COMMAND_IN_DIST",p[p.COMMAND_IN_INVALID=7]="COMMAND_IN_INVALID",p[p.COMMAND_IN_INVALID_ZERO=8]="COMMAND_IN_INVALID_ZERO",p[p.COMMAND_IN_INVALID_NEG=9]="COMMAND_IN_INVALID_NEG",p[p.COMMAND_IN_INT=10]="COMMAND_IN_INT",(m=f=r.COMMAND_GET||(r.COMMAND_GET={}))[m.COMMAND_GET_STRING=1]="COMMAND_GET_STRING",m[m.COMMAND_GET_KEY=2]="COMMAND_GET_KEY",m[m.COMMAND_GET_DIST=4]="COMMAND_GET_DIST",m[m.COMMAND_GET_COORD=8]="COMMAND_GET_COORD",m[m.COMMAND_GET_INT=16]="COMMAND_GET_INT",(g=r.DynamicInputType||(r.DynamicInputType={}))[g.kNoInput=0]="kNoInput",g[g.kXYCoordInput=1]="kXYCoordInput",g[g.kDistanceInput=2]="kDistanceInput",g[g.kDynTip=3]="kDynTip",g[g.kAutoInput=4]="kAutoInput",g[g.kAngleInput=5]="kAngleInput",(v=r.GETPOINTSTATUS||(r.GETPOINTSTATUS={}))[v.OsModeSValidLastPoint=1]="OsModeSValidLastPoint",v[v.OsModeSTempDisable=2]="OsModeSTempDisable",v[v.OsModeOrthoTempDisable=4]="OsModeOrthoTempDisable",v[v.OsModeSInvalidLastMovePoint=8]="OsModeSInvalidLastMovePoint",v[v.OsModePoloarTempDisable=16]="OsModePoloarTempDisable",v[v.OsModeDynTraceTempDisable=32]="OsModeDynTraceTempDisable",v[v.OsModeGridSnapTempDisable=64]="OsModeGridSnapTempDisable",(y=r.OsnapMode||(r.OsnapMode={}))[y.kOsModekValid=0]="kOsModekValid",y[y.kOsModeEnd=1]="kOsModeEnd",y[y.kOsModeMid=2]="kOsModeMid",y[y.kOsModeCen=3]="kOsModeCen",y[y.kOsModeNode=4]="kOsModeNode",y[y.kOsModeQuad=5]="kOsModeQuad",y[y.kOsModeIns=7]="kOsModeIns",y[y.kOsModePerp=8]="kOsModePerp",y[y.kOsModeTan=9]="kOsModeTan",y[y.kOsModeNear=10]="kOsModeNear",y[y.kOsModeInt=11]="kOsModeInt";var x,_=void 0,w=void 0,b=!1,M=a.kNoChange,S=u.kInvalid,C=new X.Vector2(0,0),T=!1,E=void 0,A=!1,D=new Map,L=new Array,O=new nt.MxString,I=!0;function P(){null!=_&&_.notifySampler()}function R(t){var e=t.srcElement;if(e&&"CANVAS"==e.tagName){if(null==_)return;if(_.getDynImput().isInputStatus())return;C.x=t.offsetX,C.y=t.offsetY,V(C)}}function k(t){if(t.button==u.kLeft){var e=t.srcElement;if(e&&"CANVAS"==e.tagName){if(null==_)return;if(_.getDynImput().isInputStatus())return;C.x=t.offsetX,C.y=t.offsetY,x=_.getMxObject().screenCoord2World(t.offsetX,t.offsetY,0),M=a.kMouseUp,S=t.button,P()}}}function N(t){if(t.button==u.kLeft){null!=_&&_.getDynImput().isShow()&&_.getDynImput().setFocus(!0);var e=t.srcElement;if(e&&"CANVAS"==e.tagName){if(null==_)return;if(_.getDynImput().isInputStatus())return;C.x=t.offsetX,C.y=t.offsetY;var n=_.getMxObject().screenCoord2World(t.offsetX,t.offsetY,0),i=_.getOsnap(),r=i.getCurrentOSnapPoint(n);n=r.pt,r.osmode,at.McEdImpJigGlobalData.setPrvPoint(n),i.seInValidPoint(),x=n,M=a.kMouseDown,S=t.button,P()}}}function B(t){if(0!=t.touches.length){var e=t.touches[0].pageX,n=t.touches[0].pageY;x=Y.MxFun.screenCoord2World(e,n,0),M=a.kBegan,P()}}function F(t){if(0!=t.touches.length){var e=t.touches[0].pageX,n=t.touches[0].pageY;x=Y.MxFun.screenCoord2World(e,n,0)}M=a.kEnd,P()}function z(t){if(0!=t.touches.length){var e=t.touches[0].pageX,n=t.touches[0].pageY;x=Y.MxFun.screenCoord2World(e,n,0),M=a.kMove,P()}}function V(t){A=!1,null==t&&(t=C);var e=_.getMxObject().screenCoord2World(t.x,t.y,0),n=_.getOsnap(),i=_.getMxObject().screenCoordLong2World(.5*ot.MxDrawData.getCursorWidthPixels());n.setPoint(e,i),r.OsnapMode.kOsModekValid,x=e,M=a.kMove,P.call(this)}function U(){b||(b=!0,Y.MxFun.isPC()?(document.addEventListener("mouseup",k,!1),document.addEventListener("mousemove",R,!1),document.addEventListener("mousedown",N,!1)):(document.addEventListener("touchstart",B,!1),document.addEventListener("touchend",F,!1),document.addEventListener("touchmove",z,!1)))}function j(){b&&(b=!1,Y.MxFun.isPC()?(document.removeEventListener("mouseup",k,!1),document.removeEventListener("mousemove",R,!1),document.removeEventListener("mousedown",N,!1)):(document.removeEventListener("touchstart",B,!1),document.removeEventListener("touchend",F,!1),document.removeEventListener("touchmove",z,!1)))}function G(t){t.getRunMode()==rt.MxRunMode.kBrowse&&t.enableSingleTouchPan(!1),t.tempDisableSelect(!0),t.updateDisplay()}function H(t){var e=new X.Vector3,n=!1,i=new nt.MxString(t),r=i.AnalyzeString(",");if(r.length<2)for(;!i.IsEmpty()&&et.MxTools.IsNumerical(i);){var a=et.MxTools._tstof(i.m_val);if(et.MxTools.IsZero(a))break;break}else{var o=new nt.MxString(r[0]),s=new nt.MxString(r[1]),l=new nt.MxString("0");2<r.length&&(l.m_val=r[2]),o.IsEmpty()||"@"!=o.Left(1)?et.MxTools.IsNumerical(o)&&et.MxTools.IsNumerical(s)&&et.MxTools.IsNumerical(l)?(n=!0,e.x=et.MxTools._tstof(o.m_val),e.y=et.MxTools._tstof(s.m_val),e.z=et.MxTools._tstof(l.m_val)):n=!1:(o.m_val=o.Right(o.GetLength()-1),et.MxTools.IsNumerical(o)&&et.MxTools.IsNumerical(s)&&et.MxTools.IsNumerical(l)||(n=!1))}return n?e:null}function W(t,e){void 0===e&&(e=!1),I&&tt.MxUiVue.AcutPrintfNoFormat(t,e)}function J(t,e){if(t==d.COMMAND_IN_INVALID){var n=tt.MxUiVue.getCmdTip();return W(e),W(n),l.kNoChange}if(t==d.COMMAND_IN_INVALID_ZERO){n=tt.MxUiVue.getCmdTip();return _.userInputControls()&s.kNoNegativeResponseAccepted?W("\n 值必须为正 且非零。 \n"):W("\n 值必不能为零。 \n"),W(n),l.kOther}if(t!=d.COMMAND_IN_INVALID_NEG)return l.kNoChange;n=tt.MxUiVue.getCmdTip();return _.userInputControls()&s.kNoZeroResponseAccepted?W("\n 值必须为正 且非零。 \n"):W("\n 值必不能为负。 \n"),W(n),l.kOther}function q(t){var e={iRet:d.COMMAND_IN_NO_ENTITY,sValue:"",iKey:l.kNull,dDist:0,iVal:0,pt:null};if(!A)return e;var n=_.userInputControls(),i=tt.MxUiVue.getCmdText();if(0==i.length)return n&s.kNullResponseAccepted?e.iRet=d.COMMAND_IN_EMTPY:e.iRet=d.COMMAND_IN_INVALID,e;if(t&f.COMMAND_GET_KEY&&0<D.size){var r=new nt.MxString(i);r.MakeUpper(),r.TrimLeft(" "),r.TrimRight(" ");var a=D.get(r.m_val);if(null!=a)return e.iRet=d.COMMAND_IN_KEY,e.iKey=a,e.sValue=r.m_val,e}if(t&f.COMMAND_GET_DIST&&et.MxTools.IsNumerical(i))return e.dDist=et.MxTools._tstof(i),n&s.kNoZeroResponseAccepted&&et.MxTools.IsZero(e.dDist)?e.iRet=d.COMMAND_IN_INVALID_ZERO:n&s.kNoNegativeResponseAccepted&&e.dDist<0?e.iRet=d.COMMAND_IN_INVALID_NEG:(e.sValue=i,e.iRet=d.COMMAND_IN_DIST),e;if(t&f.COMMAND_GET_INT&&et.MxTools.IsNumerical(i))return e.iVal=et.MxTools._tstoi(i),n&s.kNoZeroResponseAccepted&&0==e.iiVal?e.iRet=d.COMMAND_IN_INVALID_ZERO:n&s.kNoNegativeResponseAccepted&&e.iiVal<0?e.iRet=d.COMMAND_IN_INVALID_NEG:(e.sValue=i,e.iRet=d.COMMAND_IN_INT),e;if(t&f.COMMAND_GET_COORD){var o=H(i);if(null!=o)return e.sValue=i,e.iRet=d.COMMAND_IN_COORD,e.pt=o,e}return t&f.COMMAND_GET_STRING?(e.sValue=i,e.iRet=d.COMMAND_IN_STRING):e.iRet=d.COMMAND_IN_INVALID,e}r.getInputKeyword=function(t){if(t<1)return"";for(var e,n=D.entries();!(e=n.next()).done;)if(e.value==t)return e.key;return""},r.GetKeyWordToString=function(){return L},r.keywordList=function(){return O.m_val},r.setKeywordList=function(t){if(O.m_val=t,D.clear(),L.length=0,!O.IsEmpty())if(O.TrimLeft(" "),O.TrimRight(" "),"["==O.m_val[0]&&"]"==O.m_val[O.m_val.length-1]){O.TrimLeft("["),O.TrimRight("]");for(var e=O.AnalyzeString("/"),n=1,i=0;i<e.length;i++){var r=(s=new nt.MxString(e[i])).Find("(");if(-1!=r){var a=new nt.MxString(s.Left(r)),o=new nt.MxString(s.Right(s.GetLength()-r-1));o.TrimRight(")"),a.IsEmpty()||o.IsEmpty()||(o.MakeUpper(),D.set(o.m_val,n),n++,L.push(new et.MxPair(o.m_val,a.m_val)))}}}else for(e=O.AnalyzeString(" "),n=1,i=0;i<e.length;i++){var s;(s=new nt.MxString(e[i])).IsEmpty()||(s.MakeUpper(),D.set(s.m_val,n),n++)}},r.getAcquirePoint=function(){return x},r.getAcquireStatus=function(){return M},r.doMouseMoveImp=V,r.OnThreeControlsChage=function(){null==_||V(C)},r.OnEnter=function(t){A=!0,M=a.kNoChange,P(),A=!1},r.Test=function(){A=!0},r.registEvent=U,r.unRegistEvent=j,r.getCurrentMouseButton=function(){return S},r.isRunning=function(){return null!=_},r.getCurCmd=function(){return _},r.commandRunComplete=function(t){_!=t&&console.log("aseert:_curCmd == cmd");var e,n=$.MxManager.currentMx();null!=_&&(n=_.getMxObject()),null!=w?(U(),_=w,w=void 0,S=u.kInvalid,_.onStartCommand(),G(n)):(j(),_=void 0,(e=n).getRunMode()==rt.MxRunMode.kBrowse&&e.enableSingleTouchPan(!0),e.tempDisableSelect(!1),e.updateDisplay())},r.isWaitCmdNull=function(){return null==w},r.stopCmd=function(){null!=_&&(T=!0,_.notifyCancleExit(),T=!1)},r.setRunCmdEvent=function(t){E=t},r.runCmd=function(t){if(!T){var e=$.MxManager.currentMx();t.setMxObject(e),C=it.MxWindowsEvent.getCurrentMousePostion(),E&&E(),null==_?(U(),_=t,S=u.kInvalid,_.onStartCommand(),G(e)):(w=t,T=!0,_.notifyCancleExit(),T=!1)}},r.GetAcqurePointFromStringTo=H,r.ProcCommandRetResult=J,r.GetCommandLineContent=q,r.acquirePoint=function(t){var e=new st;if(null==_)return e.status=l.kCancel,e;var n=q(f.COMMAND_GET_COORD|f.COMMAND_GET_KEY);return n.iRet==d.COMMAND_IN_EMTPY?(e.status=l.kNull,e.exit=!0):n.iRet==d.COMMAND_IN_KEY?(e.status=n.iKey,e.exit=!0,e.sKeyValue=n.sValue):n.iRet==d.COMMAND_IN_COORD?(e.status=l.kNormal,e.pt=_.getMxObject().docCoord2World(n.pt.x,n.pt.y,n.pt.z),e.exit=!0):(J(n.iRet,"\n 需要点或选项关键字。 \n"),M==a.kMove?(e.status=l.kNormal,e.pt=x,e.exit=!1):M==a.kEnd?t&o.kGetEnd?(e.status=l.kNormal,e.pt=x,e.exit=!0):(e.status=l.kNormal,e.pt=x,e.exit=!1):M==a.kCancle?(e.status=l.kCancel,e.pt=x,e.exit=!0):M==a.kBegan?t&o.kGetBegan?(e.status=l.kNormal,e.pt=x,e.exit=!0):(e.status=l.kNormal,e.pt=x,e.exit=!1):M==a.kMouseDown?(e.status=l.kNormal,e.pt=x,e.exit=!0):(e.status=l.kNoChange,e.pt=void 0,e.exit=!1)),e},r.getMcEdJigCommandClass=function(){return Z.McEdJigCommand},r.getMrxDbgUiPrPointClass=function(){return K.MrxDbgUiPrPoint},r.getMcEdGetPointWorldDrawClass=function(){return Q.McEdGetPointWorldDraw},r.McEdGetPointWorldDrawObjectClass=function(){return Q.McEdGetPointWorldDrawObject},r.init=function(){this._curCmd=void 0}}(i=n.MxJigCmdManager||(n.MxJigCmdManager={}))},{"./McEdJigOsnap":20,"./MrxDbgUiPrBase":21,"./MrxDbgUiPrPoint":22,"./MxDrawData":34,"./MxDrawObject":35,"./MxFun":39,"./MxJig":41,"./MxManager":45,"./MxString":50,"./MxTools":53,"./MxUiVue":58,"./MxWindowsEvent":59,three:19}],43:[function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.MxJigGetLine=void 0;var a,o=t("./MxJig"),s=t("./MxJigCmdManager"),l=t("./MxFun"),c=(a=o.McEdJigCommand,r(u,a),u.prototype.sampler=function(){var t=s.MxJigCmdManager.InType.kGetBegan;this._isGetPt1||(t=s.MxJigCmdManager.InType.kGetEnd);var e=this.acquirePoint(t);return e.status==s.MxJigCmdManager.DragStatus.kNormal&&(this._isGetPt1?this._pt1=e.pt:this._pt2=e.pt),e.status},u.prototype.setRetCall=function(t){this._retCall=t},u.prototype.done=function(t){if(this._isGetPt1)return this._isGetPt1=!1,s.MxJigCmdManager.DoneStatius.kContinueCommand;var e={};return e.pt1=l.MxFun.worldCoord2Doc(this._pt1.x,this._pt1.y,this._pt1.z),e.pt2=l.MxFun.worldCoord2Doc(this._pt2.x,this._pt2.y,this._pt2.z),this._retCall(e),s.MxJigCmdManager.DoneStatius.kExitCommand},u.prototype.upDisplay=function(){this._isGetPt1||null==this._pt1||null==this._pt2||this.drawLine(this._pt1,this._pt2)},u);function u(){var t=null!==a&&a.apply(this,arguments)||this;return t._isGetPt1=!0,t}n.MxJigGetLine=c},{"./MxFun":39,"./MxJig":41,"./MxJigCmdManager":42}],44:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.MxLocalDwgFileLoad=n.MxLocalFileLoad=n.MxLocalNodeJs=void 0;var a=t("./MxFun"),i=(r.prototype.init=function(t){this.loadFileCall=t.loadFileFun},r.prototype.loadFile=function(t,e,n,i,r){null!=this.loadFileCall?this.loadFileCall(t,e,n,i,r):r(void 0)},r);function r(){this.loadFileCall=null}n.MxLocalNodeJs=i;var o=(s.prototype.setPath=function(t){this.path=t},s.prototype.setBinary=function(t){this.isBinary=t},s.prototype.load=function(t,e,n,i){a.MxFun.getNodeJs().loadFile(this.path+t,this.isBinary,e,n,i)},s);function s(){this.path="",this.isBinary=!1}n.MxLocalFileLoad=o;var l=(c.prototype.setShowloading=function(t){this._isShowLoading=t},c.prototype.load=function(t,e){var n="$"+e+".mxb1.wgh";this._path=t,this._filename=e;var i=this;this.getFile(this._path,n,!1,function(t){"string"==typeof t?i.net.onStaticHeadMessage(t):console.log("mx error h1")},function(){console.log("mx get "+n+" faild")})},c.prototype.getDatas=function(){if(this._iGet>=this._dataNum)this._isShowLoading&&a.MxFun.hideLoading();else{var t=this._dataType[this._iGet];this._iGet++;var e=this,n=this._iGet+1,i="$"+this._filename+".mxb"+n+".wgh",r=0!=t;this.getFile(this._path,i,r,function(t){e.net.onStaticMessage(t),e.getDatas()},function(){e._dataNum=0,e._iGet=0,e._isShowLoading&&a.MxFun.hideLoading(),console.log("mx get "+i+" faild")})}},c.prototype.onRenderHead=function(t){var e=JSON.parse(t);this._dataType=e.type,this._dataNum=e.count,this._iGet=0,this._isShowLoading&&a.MxFun.showLoading(),this.getDatas()},c.prototype.getFile=function(t,e,n,i,r){var a=new o;a.setPath(t),a.setBinary(n),a.load(e,i,function(){},r)},c);function c(t){this.net=null,this._dataNum=0,this._iGet=0,this._dataType=[],this._path="",this._filename="",this._isShowLoading=!0,this.net=t}n.MxLocalDwgFileLoad=l},{"./MxFun":39}],45:[function(t,e,n){"use strict";var i,r,a,o,s;Object.defineProperty(n,"__esModule",{value:!0}),n.MxManager=void 0,i=n.MxManager||(n.MxManager={}),r=[],a=null,o=[],s=void 0,i.add=function(t){r.push(t)},i.outDebugString=function(t){null==s?console.log(t):s(t)},i.setOutDebugCall=function(t){s=t},i.onLoad=function(){for(var t in r)r[t].onLoad()},i.updateDisplay=function(){for(var t in r)r[t].updateDisplay()},i.currentMx=function(){return a},i.setCurrentMx=function(t){a=t},i.initResize=function(){for(var t in r)r[t].initResize()},i.addSelectEvent=function(t){o.push(t)},i.clearSelectEvent=function(){o=[]},i.callSelectObject=function(t){for(var e in o)if(1==o[e](t))break},i.init=function(){},i.getMxObject=function(t){for(var e in r)if(r[e].getCanvas()===t)return r[e];return null}},{}],46:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.MxMaterial=void 0;var i,r=t("three");(i=n.MxMaterial||(n.MxMaterial={})).shaderUniforms={crAmbient:{value:new r.Vector3(1,0,0)},crDiffuse:{value:new r.Vector3(1,0,0)},crSpecular:{value:new r.Vector3(1,0,0)}},i.m_arrSystemColors=new Array(0,16711680,16776960,65280,65535,255,16711935,16777215,8421504,12632256,16711680,16744319,13369344,13395558,10027008,10046540,8323072,8339263,4980736,4990502,16727808,16752511,13382400,13401958,10036736,10051404,8331008,8343359,4985600,4992806,16744192,16760703,13395456,13408614,10046464,10056268,8339200,8347455,4990464,4995366,16760576,16768895,13408512,13415014,10056192,10061132,8347392,8351551,4995328,4997670,16776960,16777087,13421568,13421670,10066176,10066252,8355584,8355647,5000192,5000230,12582656,14679935,10079232,11717734,7510272,8755532,6258432,7307071,3755008,4344870,8388352,12582783,6736896,10079334,5019904,7510348,4161280,6258495,2509824,3755046,4194048,10485631,3394560,8375398,2529536,6265164,2064128,5209919,1264640,3099686,65280,8388479,52224,6736998,39168,5019980,32512,4161343,19456,2509862,65343,8388511,52275,6737023,39206,5019999,32543,4161359,19475,2509871,65407,8388543,52326,6737049,39244,5020018,32575,4161375,19494,2509881,65471,8388575,52377,6737074,39282,5020037,32607,4161391,19513,2509890,65535,8388607,52428,6737100,39321,5020057,32639,4161407,19532,2509900,49151,8380415,39372,6730444,29337,5014937,24447,4157311,14668,2507340,32767,8372223,26316,6724044,19609,5010073,16255,4153215,9804,2505036,16383,8364031,13260,6717388,9881,5005209,8063,4149119,4940,2502476,255,8355839,204,6710988,153,5000345,127,4145023,76,2500172,4129023,10452991,3342540,8349388,2490521,6245529,2031743,5193599,1245260,3089996,8323327,12550143,6684876,10053324,4980889,7490713,4128895,6242175,2490444,3745356,12517631,14647295,10027212,11691724,7471257,8735897,6226047,7290751,3735628,4335180,16711935,16744447,13369548,13395660,10027161,10046617,8323199,8339327,4980812,4990540,16711871,16744415,13369497,13395634,10027122,10046597,8323167,8339311,4980793,4990530,16711807,16744383,13369446,13395609,10027084,10046578,8323135,8339295,4980774,4990521,16711743,16744351,13369395,13395583,10027046,10046559,8323103,8339279,4980755,4990511,3355443,5987163,8684676,11382189,14079702,16777215),i.m_arrDefUseMaterials=new Array(null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null),i.m_arrDefUseCurveMaterials=new Array(null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null),i.m_arrDefUseBasicMaterials=new Array(null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null),i.m_selectMaterial=new r.MeshPhongMaterial({color:255,opacity:.2,transparent:!0,side:r.DoubleSide}),i.m_mouseMoveMaterial=new r.MeshPhongMaterial({color:16776960,side:r.DoubleSide}),i.m_lockedMaterial=new r.MeshPhongMaterial({color:197379,side:r.DoubleSide}),i.m_samplePoints=new r.PointsMaterial({color:255,depthTest:!1,size:8}),i.m_samplePointsMouseMove=new r.PointsMaterial({color:16711680,depthTest:!1,size:12}),i.GetColorByIndex=function(t){return i.m_arrSystemColors[t]},i.GetColorMaterial=function(t){var e=i.m_arrDefUseMaterials[t];return null===e&&(e=new r.MeshLambertMaterial({color:i.m_arrSystemColors[t],side:r.DoubleSide}),i.m_arrDefUseMaterials[t]=e),e},i.GetBaseColorMaterial=function(t){var e=i.m_arrDefUseBasicMaterials[t];return null===e&&(e=new r.MeshBasicMaterial({color:i.m_arrSystemColors[t],side:r.DoubleSide}),i.m_arrDefUseMaterials[t]=e),e},i.GetCurveColorMaterial=function(t){var e=i.m_arrDefUseCurveMaterials[t];return null===e&&(e=new r.LineBasicMaterial({color:i.m_arrSystemColors[t],linewidth:1}),i.m_arrDefUseCurveMaterials[t]=e),e},i.GetSelectMaterial=function(){return i.m_selectMaterial},i.GetMouseMoveMaterial=function(){return i.m_mouseMoveMaterial},i.GetLockedMaterial=function(){return i.m_lockedMaterial},i.GetSamplePointsMaterial=function(){return i.m_samplePoints},i.GetSamplePointsMouseMoveMaterial=function(){return i.m_samplePointsMouseMove},i.createMaterial=function(t){var e=void 0;if(null==t)return e;function n(t,e){if(null!=e.map){var n=e.map,i=(new r.TextureLoader).load(n);i.wrapS=i.wrapT=r.RepeatWrapping,t.map=i,t.side=r.DoubleSide}}return 0!=t.transparent?t.transparent=!0:t.transparent=!1,"MeshPhongMaterial"==t.name?n(e=new r.MeshPhongMaterial(t),t):"MeshBasicMaterial"==t.name?n(e=new r.MeshBasicMaterial(t),t):"MeshDepthMaterial"==t.name?n(e=new r.MeshDepthMaterial(t),t):"MeshNormalMaterial"==t.name?n(e=new r.MeshNormalMaterial(t),t):"MeshLambertMaterial"==t.name?n(e=new r.MeshLambertMaterial(t),t):"MeshStandardMaterial"==t.name&&n(e=new r.MeshStandardMaterial(t),t),e}},{three:19}],47:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.MxHFileLoad=n.MxNet=n.MxNetBinMessageType=n.MxNetSend=n.MxNetMessage=n.MxNetMessageType=n.MxNetData=void 0;var i,r,x=t("three"),l=t("./MxFun"),a=t("pako"),o=t("./MxManager"),s=(c.prototype.getId=function(){return this._dataView.getInt32(4,!0)},c.prototype.getVersion_MwBlobHead=function(){return this._dataView.getInt32(60,!0)},c.prototype.getVersion_MwBlobHeadDynLen=function(){return this._dataView.getInt32(4,!0)},c.prototype.getdPointCurveBuffersHead=function(){var t={};return t.ver=this._dataView.getInt32(4,!0),t.databaseIndex=this._dataView.getInt32(8,!0),t.zeroLayerIdIndex=this._dataView.getInt32(16,!0),t.datacount=this._dataView.getInt32(20,!0),t.datasize=this._dataView.getInt32(24,!0),t},c.prototype.getdPointMeshBuffersHead=function(){var t={};return t.ver=this._dataView.getInt32(4,!0),t.databaseIndex=this._dataView.getInt32(8,!0),t.id=this._dataView.getInt32(12,!0),t.zeroLayerIdIndex=this._dataView.getInt32(16,!0),t.datacount=this._dataView.getInt32(20,!0),t.datasize=this._dataView.getInt32(24,!0),t},c.prototype.getdPointCurveBufferDataHead=function(t){t+=4,t+=4,t+=4;var e={};return e.pointCount=this._dataView.getInt32(t,!0),t+=4,e.layerId=this._dataView.getInt32(t,!0),t+=4,e.blkId=this._dataView.getInt32(t,!0),t+=4,e.offset=t,e},c.prototype.getdPointMeshBufferDataHead=function(t){t+=4,t+=4,t+=4;var e={};return e.pointCount=this._dataView.getInt32(t,!0),t+=4,e.layerId=this._dataView.getInt32(t,!0),t+=4,e.blkId=this._dataView.getInt32(t,!0),t+=4,e.offset=t,e},c.prototype.getDatabaseIndex=function(){return this._dataView.getInt32(8,!0)},c.prototype.getColorIndex=function(){return this._dataView.getInt32(24,!0)},c.prototype.getBufferType=function(){return this._dataView.getInt32(32,!0)},c.prototype.getIsSketchEntity=function(){return this._dataView.getInt32(40,!0)},c.prototype.getLayerId=function(){return this._dataView.getInt32(44,!0)},c.prototype.getBlockId=function(){return this._dataView.getInt32(48,!0)},c.prototype.getVertexBufferSize=function(){return this._dataView.getInt32(12,!0)},c.prototype.getIndexBufferSize=function(){return this._dataView.getInt32(16,!0)},c.prototype.getZeroLayerId=function(){return this._dataView.getInt32(52,!0)},c.prototype.getSelectMark=function(){return this._dataView.getInt32(56,!0)},c.prototype.getMateria=function(){var t=this._dataView.getInt32(36,!0);if(0==t)return"";for(var e=[],n=0;n<t;n++){var i=String.fromCharCode(this._dataView.getUint8(80+n));e.push(i)}return e.join("")},c.prototype.getDrawDataOffset=function(){return this._dataView.getInt32(36,!0)+80},c.prototype.getMesh=function(){var t=this._dataView.getInt32(4,!0),e=0==this._dataView.getInt32(32,!0),n={},i=this._dataView.getInt32(12,!0),r=this._dataView.getInt32(16,!0);if(0===i||0===r)return n.size=80,n;var a=new x.Geometry,o=80,s=0;s=e?i/4/8:i/4/2;for(var l=0;l<s;l++){var c=this._dataView.getFloat32(o+0,!0),u=this._dataView.getFloat32(o+4,!0),h=0;e?(h=this._dataView.getFloat32(o+8,!0),this._dataView.getFloat32(o+12,!0),this._dataView.getFloat32(o+16,!0),this._dataView.getFloat32(o+20,!0),this._dataView.getFloat32(o+24,!0),this._dataView.getFloat32(o+28,!0),o+=32):o+=8;var d=new x.Vector3(c,u,h);a.vertices.push(d)}var p=r/4;for(l=0;l<p;l+=3){var f=this._dataView.getInt32(o,!0);o+=4;var m=this._dataView.getInt32(o,!0);o+=4;var g=this._dataView.getInt32(o,!0);o+=4;var v=new x.Face3(f,m,g);a.faces.push(v)}var y=this.getIsSketchEntity();return n.size=o,n.geometry=a,n.id=t,n.isSketchEntity=y,n.nColorIndex=this._dataView.getInt32(24,!0),n},c.prototype.getCurve=function(t){var e=this._dataView.getInt32(32,!0),n=this.getIsSketchEntity(),i=0==e,r=0,a={};if((r=i?this._dataView.getInt32(20,!0)/4/3:this._dataView.getInt32(20,!0)/4/2)<2)return a;for(var o=new x.Geometry,s=t,l=0;l<r;l++){var c=this._dataView.getFloat32(s,!0);s+=4;var u=this._dataView.getFloat32(s,!0);s+=4;var h=0;i&&(h=this._dataView.getFloat32(s,!0),s+=4),o.vertices.push(new x.Vector3(c,u,h))}var d=this._dataView.getInt32(4,!0);return a.size=s,a.geometry=o,a.id=d,a.isSketchEntity=n,a.colorIndex=this._dataView.getInt32(28,!0),a},c);function c(t){this._dataView=t}n.MxNetData=s,(r=i=n.MxNetMessageType||(n.MxNetMessageType={})).kAddLayer="00000007",r.kClearLayer="00000008",r.kHideLayer="00000009",r.kShowLayer="00000010",r.kUpdateDisplayRange="00000011",r.kCallJsReturn="00000012",r.kLayerData="00000013",r.kSendDebugString="00000014",r.kShowLoading="00000015",r.kHideLoading="00000016",r.kSelectObject="00000017",r.kGlRenderHead="00000018",r.kUserLoginResult="00000019",r.kOpenFileResult="00000020",r.kServerReturn="00000021",r.kMxCADLayerData="00000056",r.kMxCADSystemVariable="00000057";var u=(h.prototype.setJsRetCall=function(t,e,n){this.serverJsRetCall[e+n]=t},h.prototype.Do=function(t){var e=this.net.getCurrentDatabaseId();if(-1==e){var n=t.substring(0,4);e=parseInt(n)}var i=t.substring(4,12),r=t.substring(12);null!=this.messageCall[i]&&this.messageCall[i](r,e)},h);function h(s,t){this.messageCall=new Map,this.serverJsRetCall=new Map,this.net=null,this.net=t;var r=this;this.messageCall[i.kUpdateDisplayRange]=function(t){if(!r.net.isTzDwgStaticFile()){t=t.replace(/\\/g,"\\\\");try{var e=JSON.parse(t);if(null!=e&&s.is2D()){s.intiDoc2Wold(e.DToWMat),s.updateCameraDisplayRange(new x.Vector3(+e.pt1[0],+e.pt1[1],+e.pt1[2]),new x.Vector3(+e.pt2[0],+e.pt2[1],+e.pt2[2]),+e.viewangle),s.initAllLayoutName(e.layout),s.updateDisplay(!0);var n=l.MxFun.getUiObj();null!=n&&(n.SetLayoutData(e.layout),n.UpDisplayLayout())}}catch(t){console.log("UpdateDisplayRange exception")}}},this.messageCall[i.kCallJsReturn]=function(t){if(0!=t.length){var e=JSON.parse(t);0==e.cmd.length&&(e.cmd="__mx_loadcode");var n=e.cmd+e.count;if(null!=r.serverJsRetCall[n]){var i=r.serverJsRetCall[n];delete r.serverJsRetCall[n],"string"==typeof e.ret&&(e.ret=e.ret.replace(/\'/g,'"')),i(e.ret)}}else console.log("assert(0),kCallJsReturn return empty")},this.messageCall[i.kSendDebugString]=function(t){o.MxManager.outDebugString(t)},this.messageCall[i.kUserLoginResult]=function(t){s.userLoginResult(t)},this.messageCall[i.kOpenFileResult]=function(t){s.openFileResult(t)},this.messageCall[i.kServerReturn]=function(t){s.serverReturn(t)},this.messageCall[i.kShowLoading]=function(t){r.net.isTzDwgStaticFile()||l.MxFun.showLoading()},this.messageCall[i.kHideLoading]=function(t){r.net.isTzDwgStaticFile()||(l.MxFun.hideLoading(),s.callInitCompleteEvent())},this.messageCall[i.kSelectObject]=function(t){var e=JSON.parse(t);o.MxManager.callSelectObject(parseInt(e.id))},this.messageCall[i.kGlRenderHead]=function(t){if(s.isStaticLocalLoad())s.getStaticLocalNet().onRenderHead(t);else{(r.net.isTzDwgStaticFile()?s.getStaticLoadTzNet():s.getStaticNet()).onRenderHead(t)}},this.messageCall[i.kMxCADLayerData]=function(t,e){s.getMxCAD().getOpenDisplay().OnMessageLayerData(t)},this.messageCall[i.kMxCADSystemVariable]=function(t,e){s.sysVariable().OnMessageMxCADSystemVariable(t)},this.messageCall[i.kLayerData]=function(t,e){if(0==e){if(s.addLayerInfoComplete(),null!=(a=JSON.parse(t))){if(!a.isSketch){var n=a.list;for(var i in n)s.addLayerInfo(n[i].id,n[i].colorvalue,n[i].name),1==n[i].zerolayer&&s.setZeroLayerId(n[i].id)}a.isSketch||s.callEvent("uiSetLayerData",a.list);var r=l.MxFun.getUiObj();null!=r&&(a.isSketch?r.SetSketchLayerData(a.list):r.SetLayerData(a.list),r.UpDisplayLayer())}}else{var a,o=s.getExtRefManager().getLayers(e);if(o.initComplete(),null!=(a=JSON.parse(t))){n=a.list;for(var i in n)o.add(n[i].id,n[i].colorvalue,n[i].name),1==n[i].zerolayer&&o.setZeroLayerId(n[i].id)}}}}n.MxNetMessage=u;var d,p,f=(m.prototype.DoCommand=function(t,e,n){null!=this._webSocket&&(null!=n?(this._callCount++,200<this._callCount&&(this._callCount=1),this._msg.setJsRetCall(n,t,this._callCount),null==e&&(e=""),this._webSocket.send(this.SendType.kCmdEx+","+t+","+this._callCount+","+e)):null==e?this._webSocket.send(this.SendType.kCmd+","+t):this._webSocket.send(this.SendType.kCmd+","+t+","+e))},m.prototype.OpenFile=function(t){null!=this._webSocket&&this._webSocket.send(this.SendType.kOpenFile+","+t)},m.prototype.UserLogin=function(t,e,n){if(null!=this._webSocket){var i={};i.IdentitySign=t,i.RandomToken=null==e?"":e,i.Init=null==n?"":n,this._webSocket.send(this.SendType.kUserLogin+","+JSON.stringify(i))}},m.prototype.Init=function(t){null!=this._webSocket&&this._webSocket.send(this.SendType.kInit+","+t)},m.prototype.CallServerJS=function(t,e,n){null!=this._webSocket&&(null==n?null==e||null==e||0==e.length?this._webSocket.send(this.SendType.kCallJS+',{"command":"'+t+'","param":"{}"}'):this._webSocket.send(this.SendType.kCallJS+',{"command":"'+t+'","param":'+e+"}"):(this._callCount++,200<this._callCount&&(this._callCount=1),this._msg.setJsRetCall(n,t,this._callCount),null==e||null==e||0==e.length?this._webSocket.send(this.SendType.kCallJS+',{"command":"'+t+'","param":"{}","count":"'+this._callCount+'"}'):this._webSocket.send(this.SendType.kCallJS+',{"command":"'+t+'","param":'+e+',"count":"'+this._callCount+'"}')))},m.prototype.CallLoadCodeToServer=function(t,e){null!=this._webSocket&&(this._msg.setJsRetCall(e,"__mx_loadcode",0),null!=t&&null!=t&&0!=t.length&&this._webSocket.send(this.SendType.kCallJS+","+t))},m.prototype.DeleteObject=function(t){null!=this._webSocket&&this._webSocket.send(this.SendType.kDelete+","+t)},m.prototype.SelectObject=function(t){null!=this._webSocket&&this._webSocket.send(this.SendType.kSelect+","+t)},m.prototype.QuitSelectObject=function(t){null!=this._webSocket&&this._webSocket.send(this.SendType.kQuitSelect+","+t)},m.prototype.SendDragDrawEntity=function(t){null!=this._webSocket&&this._webSocket.send(this.SendType.kAddDragDraw+","+t)},m.prototype.SendDragDrawRequest=function(){null!=this._webSocket&&(this.SendMousePickRay(),this._webSocket.send(this.SendType.kRequestDragDraw))},m.prototype.SendDragDrawDetermine=function(){null!=this._webSocket&&(this.SendMousePickRay(),this._webSocket.send(this.SendType.kDetermineDragDraw))},m.prototype.SendDragDrawCancel=function(){null!=this._webSocket&&this._webSocket.send(this.SendType.kCancelDragDraw)},m.prototype.SendMousePickRay=function(){this._webSocket},m);function m(t,e){this.SendType={},this._callCount=1,this._webSocket=t,this._msg=e,this.SendType.kCmd=0,this.SendType.kDelete=1,this.SendType.kSelect=2,this.SendType.kOpenFile=3,this.SendType.kGetDemoList=4,this.SendType.kCallJS=5,this.SendType.kAddDragDraw=6,this.SendType.kRequestDragDraw=7,this.SendType.kMousePickRay=8,this.SendType.kDetermineDragDraw=9,this.SendType.kCancelDragDraw=10,this.SendType.kQuitSelect=11,this.SendType.kInit=12,this.SendType.kCmdEx=13,this.SendType.kUserLogin=14}n.MxNetSend=f,(p=d=n.MxNetBinMessageType||(n.MxNetBinMessageType={})).eEntitysData=14,p.kMxCADBlockRef=56,p.kMxCADMemorySections=57,p.kMxCADMemorySectionsFromChange=59,p.kMxCADNotUseMemorySectionsForChage=61,p.kMxCADEntityDisplayDatas=62;var g=(v.prototype.setCurrentDatabaseId=function(t){this._iCurrentDatabaseId=t},v.prototype.getMxDrawObject=function(){return this._mx},v.prototype.getCurrentDatabaseId=function(){return this._iCurrentDatabaseId},v.prototype.isTzDwgStaticFile=function(){return-1!=this._iCurrentDatabaseId},v.prototype.onBinMessage=function(t){var e=this._mx,n=a.inflate(t),i=new DataView(n.buffer),r=i.getInt32(0,!0);this._binMessageCall.has(r)?this._binMessageCall.get(r)(i,this._iCurrentDatabaseId):(-1==this._iCurrentDatabaseId&&(0==r?e.mxWebAddEntity(i):2==r?e.getSelect().mxWebAddEntity(i):6==r?e.removeEntityFromServer(i):11==r&&e.getExtRefManager().createExternalReferences(i)),12==r?e.mxWebAddEntityFor2dPointCurveBuffers(i,this._iCurrentDatabaseId):13==r?e.mxWebAddEntityFor2dPointMeshBuffers(i,this._iCurrentDatabaseId):8==r?e.mxWebAddEntityFor2dPointCurveBuffer(i,this._iCurrentDatabaseId):9==r?e.mxWebAddEntityFor2dPointMeshBuffer(i,this._iCurrentDatabaseId):10==r&&e.mxWebCreateAllBlocks(i,this._iCurrentDatabaseId))},v.prototype.socket_onMessageImp=function(t,e){if(void 0===e&&(e=!1),"string"==typeof t)this._msg.Do(t);else if(e)this.onBinMessage(t);else{var n=new FileReader;n.readAsArrayBuffer(t);var i=this;n.onload=function(t){i._mx.updateDisplay(),i.onBinMessage(n.result)}}this._mx.updateDisplay()},v.prototype.initBinMessage=function(){var n=this._mx;this._binMessageCall.set(d.kMxCADBlockRef,function(t,e){n.getMxCAD().getOpenDisplay().OnMessageDisplayBlockRef(t)}),this._binMessageCall.set(d.kMxCADMemorySections,function(t,e){n.getMxCAD().getOpenDisplay().OnMessageDisplayMemorySections(t)}),this._binMessageCall.set(d.kMxCADMemorySectionsFromChange,function(t,e){n.getMxCAD().getSyncDisplay().OnMessageDisplayMemorySectionsFromChange(t)}),this._binMessageCall.set(d.kMxCADNotUseMemorySectionsForChage,function(t,e){n.getMxCAD().getSyncDisplay().OnMessageDisplayNotUseMemorySectionsForChage(t)}),this._binMessageCall.set(d.kMxCADEntityDisplayDatas,function(t,e){n.getMxCAD().getSelect().OnMessageEntityDisplayDatas(t)}),this._binMessageCall.set(d.eEntitysData,function(t,e){n.mxWebEntitysData(t,e)})},v.prototype.init=function(t,e){var r=this;this._mx=t,this._msg=new u(t,this),this.initBinMessage(),e&&(this._webSocket=new WebSocket(l.MxFun.getMxServer()),this._webSocket.onopen=function(){var t=r._mx.getIniParam();if(0!=t.length){for(var e="{",n=t.length,i=0;i<n;i++)e=0==i?e+'"'+t[i][0]+'":"'+t[i][1]+'"':e+',"'+t[i][0]+'":"'+t[i][1]+'"';e+="}",r._send.Init(e)}},this._webSocket.onmessage=function(t){r.socket_onMessageImp(t.data)}),this._send=new f(this._webSocket,this._msg)},v.prototype.getOnMessage=function(){return this._msg},v.prototype.getSend=function(){return this._send},v.prototype.onStaticMessage=function(t){this.socket_onMessageImp(t,!0)},v.prototype.onStaticHeadMessage=function(t){"string"==typeof t&&this._msg.Do(t)},v);function v(){this._webSocket=null,this._send=null,this._msg=null,this._mx=null,this._binMessageCall=new Map,this._iCurrentDatabaseId=-1}n.MxNet=g;var y=(_.prototype.setShowloading=function(t){this._isShowLoading=t},_.prototype.showLoading=function(){this._isShowLoading&&l.MxFun.showLoading()},_.prototype.hideLoading=function(){this._isShowLoading&&l.MxFun.hideLoading(),this.net.getMxDrawObject().callInitCompleteEvent()},_.prototype.setRequestHeader=function(t){this._requestHeader=t},_.prototype.load=function(t){var e=l.MxFun.curPath(),n=l.MxFun.dwgDir(),i=l.MxFun.getStaticServer(),r="$"+t+".mxb1.wgh";0!=i.length?e=i+"/buf/":0!=n.length?e=e+"/"+n+"/buf/":e+="/buf/",this._path=e,this._filename=t;var a=this;this.getFile(e,r,function(t){"string"==typeof t?a.net.onStaticHeadMessage(t):console.log("mx error h1")},function(){console.log("mx get "+r+" faild")})},_.prototype.getData=function(){if(this._iGet>=this._dataNum)this.hideLoading();else{var t=this._dataType[this._iGet];this._iGet++;var e=this,n=this._iGet+1,i="$"+this._filename+".mxb"+n+".wgh";if(0==t)this.getFile(this._path,i,function(t){e.net.onStaticMessage(t),e.getData()},function(){e._dataNum=0,e._iGet=0,e.hideLoading(),console.log("mx get "+i+" faild")});else{var r=new XMLHttpRequest,a=this._path+i;r.open("GET",a),0!=this._requestHeader.length&&r.setRequestHeader("usertoken",this._requestHeader),r.responseType="arraybuffer",r.onload=function(){e.net.onStaticMessage(r.response),e.getData()},e=this,r.addEventListener("error",function(t){e._dataNum=0,e._iGet=0,e.hideLoading(),console.log("mx get "+i+" faild")},!1),r.send()}}},_.prototype.onRenderHead=function(t){var e=JSON.parse(t);this._dataType=e.type,this._dataNum=e.count,this._iGet=0,this.showLoading(),this.getData()},_.prototype.getFile=function(t,e,n,i){var r=new x.FileLoader(this.manager);r.setPath(t),0!=this._requestHeader.length&&(r.requestHeader={usertoken:this._requestHeader}),r.load(e,n,function(){},i)},_);function _(t,e){this.net=null,this.manager=null,this._dataNum=0,this._iGet=0,this._dataType=[],this._path="",this._filename="",this._isShowLoading=!0,this._requestHeader="",this.net=t,this.manager=void 0!==e?e:x.DefaultLoadingManager}n.MxHFileLoad=y},{"./MxFun":39,"./MxManager":45,pako:1,three:19}],48:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.MxSelect=void 0;var f=t("three"),m=t("three.meshline"),l=t("./MxFun"),r=t("./MxNetData"),a=t("./MxMaterial"),i=(o.prototype.removeAll=function(){this._mapSelectMark2Entity=new Map},o.prototype.addEntity=function(t,e){var n=this._mapSelectMark2Entity.get(t);null==n&&(n=new Array,this._mapSelectMark2Entity.set(t,n)),n.push(e)},o.prototype.removeEntity=function(t){var e=new Map,n=function(a,t){var o=this.mx.getScene(),s=t;return function(t,e,n){if(null==a||e!=a)for(var i in t)l.MxFun.removeThreejsObject(t[i],o);else{var r=t.concat();s.set(a,r)}}}.call(this,t,e);this._mapSelectMark2Entity.forEach(n),this._mapSelectMark2Entity=e},o.prototype.init=function(){var r=this;r.domElement.addEventListener("mousedown",function(t){if(!1!==r.enabled&&!r.tmpDisable&&t.button==f.MOUSE.LEFT){var e=r.mx.screenCoord2Doc(t.clientX,t.clientY,0),n=r.mx.screenCoordLong2Doc(10),i=l.MxFun.formatString("[{0},{1},{2},{3}]",e.x.toString(),e.y.toString(),"0",n.toString());r.mx.callCommand("Mx_Select",i)}},!1)},o.prototype.mxWebAddEntity=function(t){var e=new r.MxNetData(t),n=e.getSelectMark();this.removeEntity(n);var i=this.mxWebAddEntity_3DChild(e);this.mxWebAddEntity_Curve(e,i)},o.prototype.mxWebAddEntity_3DChild=function(t){var e=t.getMesh();if(null==e.id)return e.size;var n=new f.Mesh(e.geometry,a.MxMaterial.GetBaseColorMaterial(1));this.mx.getScene().add(n);var i=t.getSelectMark();return this.addEntity(i,n),e.size},o.prototype.mxWebAddEntity_Curve=function(t,e){var n=t.getCurve(e);if(null!=n.id){var i=this.mx.getViewWidth(),r=this.mx.getViewHeight();this._material.resolution=new f.Vector2(i,r);for(var a=t.getSelectMark(),o=n.geometry,s=this.mx.getScene(),l=0;l+1<o.vertices.length;l+=2){var c=o.vertices[l],u=o.vertices[l+1],h=new Float32Array(6);h[0]=c.x,h[1]=c.y,h[2]=c.z,h[3]=u.x,h[4]=u.y,h[5]=u.z;var d=new m.MeshLine;d.setGeometry(h);var p=new f.Mesh(d.geometry,this._material);s.add(p),this.addEntity(a,p)}}},o);function o(t,e){this.enabled=!0,this.tmpDisable=!1,this.mx=void 0,this.domElement=void 0,this._mapSelectMark2Entity=new Map,this._material=new m.MeshLineMaterial({useMap:!1,color:new f.Color(16711680),opacity:.5,resolution:new f.Vector2(500,500),sizeAttenuation:!0,lineWidth:.005,transparent:!0}),this.mx=t,this.domElement=void 0!==e?e:document}n.MxSelect=i},{"./MxFun":39,"./MxMaterial":46,"./MxNetData":47,three:19,"three.meshline":18}],49:[function(t,e,n){"use strict";var i;Object.defineProperty(n,"__esModule",{value:!0}),n.MxShader=void 0,(i=n.MxShader||(n.MxShader={})).VSHADER_COLOR_POINT=" precision highp float; \nuniform mat4 modelViewMatrix; \nuniform mat4 projectionMatrix; \nattribute vec2 position; \nattribute vec3 color; \nattribute vec4 tran1; \nattribute vec4 tran2; \nattribute vec4 tran3; \nattribute vec4 tran4; \nattribute float ishide; \nvarying vec4 vColor; \nvoid main(){ \n mat4 tran; \ntran[0][0] = tran1.x;tran[0][1] = tran1.y;tran[0][2] = tran1.z;tran[0][3] = tran1.w; \ntran[1][0] = tran2.x;tran[1][1] = tran2.y;tran[1][2] = tran2.z;tran[1][3] = tran2.w; \ntran[2][0] = tran3.x;tran[2][1] = tran3.y;tran[2][2] = tran3.z;tran[2][3] = tran3.w; \ntran[3][0] = tran4.x;tran[3][1] = tran4.y;tran[3][2] = tran4.z;tran[3][3] = tran4.w; \nif(ishide > 0.1) \n vColor = vec4(color,0.0); \nelse \n vColor = vec4(color,1.0); \ngl_Position = projectionMatrix * modelViewMatrix * tran * vec4( position.x,position.y,0.0, 1.0 ); \n} \n",i.VSHADER_COLOR_POINT_BYLAYER=" precision highp float; \nuniform mat4 modelViewMatrix; \nuniform mat4 projectionMatrix; \nuniform vec3 color; \nattribute vec2 position; \nattribute vec4 tran1; \nattribute vec4 tran2; \nattribute vec4 tran3; \nattribute vec4 tran4; \nattribute float ishide; \nvarying vec4 vColor; \nvoid main(){ \n mat4 tran; \ntran[0][0] = tran1.x;tran[0][1] = tran1.y;tran[0][2] = tran1.z;tran[0][3] = tran1.w; \ntran[1][0] = tran2.x;tran[1][1] = tran2.y;tran[1][2] = tran2.z;tran[1][3] = tran2.w; \ntran[2][0] = tran3.x;tran[2][1] = tran3.y;tran[2][2] = tran3.z;tran[2][3] = tran3.w; \ntran[3][0] = tran4.x;tran[3][1] = tran4.y;tran[3][2] = tran4.z;tran[3][3] = tran4.w; \nif(ishide > 0.1) \n vColor = vec4(color,0.0); \nelse \n vColor = vec4(color,1.0); \ngl_Position = projectionMatrix * modelViewMatrix * tran * vec4( position.x,position.y,0.0, 1.0 ); \n} \n",i.FSHADER_COLOR_POINT=" precision highp float; \nvarying vec4 vColor; \nvoid main() { \ngl_FragColor = vColor; \n} \n",i.VSHADER_COLOR_POINT_CLIP=" precision highp float; \nuniform mat4 modelViewMatrix; \nuniform mat4 projectionMatrix; \nuniform vec2 clippt1; \nuniform vec2 clippt2; \nuniform float vieww; \nuniform float viewh; \nattribute vec2 position; \nattribute vec3 color; \nattribute vec4 tran1; \nattribute vec4 tran2; \nattribute vec4 tran3; \nattribute vec4 tran4; \nattribute float ishide; \nvarying vec4 vColor; \nvarying vec2 vCp1; \nvarying vec2 vCp2; \nvoid main(){ \n mat4 tran; \ntran[0][0] = tran1.x;tran[0][1] = tran1.y;tran[0][2] = tran1.z;tran[0][3] = tran1.w; \ntran[1][0] = tran2.x;tran[1][1] = tran2.y;tran[1][2] = tran2.z;tran[1][3] = tran2.w; \ntran[2][0] = tran3.x;tran[2][1] = tran3.y;tran[2][2] = tran3.z;tran[2][3] = tran3.w; \ntran[3][0] = tran4.x;tran[3][1] = tran4.y;tran[3][2] = tran4.z;tran[3][3] = tran4.w; \nvec4 pt1 = projectionMatrix * modelViewMatrix * vec4( clippt1.x,clippt1.y,0.0, 1.0 ); \nvec4 pt2 = projectionMatrix * modelViewMatrix * vec4( clippt2.x,clippt2.y,0.0, 1.0 ); \nvCp1 = vec2(pt1.x * vieww + vieww,pt1.y * viewh + viewh); \nvCp2 = vec2(pt2.x * vieww + vieww,pt2.y * viewh + viewh); \nif(ishide > 0.1) \n vColor = vec4(color,0.0); \nelse \n vColor = vec4(color,1.0); \ngl_Position = projectionMatrix * modelViewMatrix * tran * vec4( position.x,position.y,0.0, 1.0 ); \n} \n",i.VSHADER_COLOR_POINT_BYLAYER_CLIP=" precision highp float; \nuniform mat4 modelViewMatrix; \nuniform mat4 projectionMatrix; \nuniform vec3 color; \nuniform vec2 clippt1; \nuniform vec2 clippt2; \nuniform float vieww; \nuniform float viewh; \nattribute vec2 position; \nattribute vec4 tran1; \nattribute vec4 tran2; \nattribute vec4 tran3; \nattribute vec4 tran4; \nattribute float ishide; \nvarying vec4 vColor; \nvarying vec2 vCp1; \nvarying vec2 vCp2; \nvoid main(){ \n mat4 tran; \ntran[0][0] = tran1.x;tran[0][1] = tran1.y;tran[0][2] = tran1.z;tran[0][3] = tran1.w; \ntran[1][0] = tran2.x;tran[1][1] = tran2.y;tran[1][2] = tran2.z;tran[1][3] = tran2.w; \ntran[2][0] = tran3.x;tran[2][1] = tran3.y;tran[2][2] = tran3.z;tran[2][3] = tran3.w; \ntran[3][0] = tran4.x;tran[3][1] = tran4.y;tran[3][2] = tran4.z;tran[3][3] = tran4.w; \nvec4 pt1 = projectionMatrix * modelViewMatrix * vec4( clippt1.x,clippt1.y,0.0, 1.0 ); \nvec4 pt2 = projectionMatrix * modelViewMatrix * vec4( clippt2.x,clippt2.y,0.0, 1.0 ); \nvCp1 = vec2(pt1.x * vieww + vieww,pt1.y * viewh + viewh); \nvCp2 = vec2(pt2.x * vieww + vieww,pt2.y * viewh + viewh); \nif(ishide > 0.1) \n vColor = vec4(color,0.0); \nelse \n vColor = vec4(color,1.0); \ngl_Position = projectionMatrix * modelViewMatrix * tran * vec4( position.x,position.y,0.0, 1.0 ); \n} \n",i.FSHADER_COLOR_POINT_CLIP="precision highp float; \nvarying vec4 vColor; \nvarying vec2 vCp1; \nvarying vec2 vCp2; \nvoid main() { \nif(gl_FragCoord.x > vCp1.x && gl_FragCoord.x < vCp2.x && gl_FragCoord.y > vCp1.y && gl_FragCoord.y < vCp2.y) \ngl_FragColor = vColor; \nelse \ndiscard; \n} \n",i.VSHADER_COLOR_POINT_FORMXCAD=" precision highp float; \nuniform mat4 modelViewMatrix; \nuniform mat4 projectionMatrix; \nuniform vec3 color; \nattribute vec2 position; \nattribute vec4 tran1; \nattribute vec4 tran2; \nattribute vec4 tran3; \nattribute vec4 tran4; \nattribute float ishide; \nvarying vec4 vColor; \nvoid main(){ \n mat4 tran; \ntran[0][0] = tran1.x;tran[0][1] = tran1.y;tran[0][2] = tran1.z;tran[0][3] = tran1.w; \ntran[1][0] = tran2.x;tran[1][1] = tran2.y;tran[1][2] = tran2.z;tran[1][3] = tran2.w; \ntran[2][0] = tran3.x;tran[2][1] = tran3.y;tran[2][2] = tran3.z;tran[2][3] = tran3.w; \ntran[3][0] = tran4.x;tran[3][1] = tran4.y;tran[3][2] = tran4.z;tran[3][3] = tran4.w; \nif(ishide > 0.1) \n vColor = vec4(color,0.0); \nelse \n vColor = vec4(color,1.0); \ngl_Position = projectionMatrix * modelViewMatrix * tran * vec4( position.x,position.y,0.0, 1.0 ); \n} \n",i.FSHADER_COLOR_POINT_FORMXCAD=" precision highp float; \nvarying vec4 vColor; \nvoid main() { \ngl_FragColor = vColor; \n} \n",i.VSHADER_COLOR_POINT_CLIP_FORMXCAD=" precision highp float; \nuniform mat4 modelViewMatrix; \nuniform mat4 projectionMatrix; \nuniform vec3 color; \nuniform vec2 clippt1; \nuniform vec2 clippt2; \nuniform float vieww; \nuniform float viewh; \nattribute vec2 position; \nattribute vec4 tran1; \nattribute vec4 tran2; \nattribute vec4 tran3; \nattribute vec4 tran4; \nattribute float ishide; \nvarying vec4 vColor; \nvarying vec2 vCp1; \nvarying vec2 vCp2; \nvoid main(){ \n mat4 tran; \ntran[0][0] = tran1.x;tran[0][1] = tran1.y;tran[0][2] = tran1.z;tran[0][3] = tran1.w; \ntran[1][0] = tran2.x;tran[1][1] = tran2.y;tran[1][2] = tran2.z;tran[1][3] = tran2.w; \ntran[2][0] = tran3.x;tran[2][1] = tran3.y;tran[2][2] = tran3.z;tran[2][3] = tran3.w; \ntran[3][0] = tran4.x;tran[3][1] = tran4.y;tran[3][2] = tran4.z;tran[3][3] = tran4.w; \nvec4 pt1 = projectionMatrix * modelViewMatrix * vec4( clippt1.x,clippt1.y,0.0, 1.0 ); \nvec4 pt2 = projectionMatrix * modelViewMatrix * vec4( clippt2.x,clippt2.y,0.0, 1.0 ); \nvCp1 = vec2(pt1.x * vieww + vieww,pt1.y * viewh + viewh); \nvCp2 = vec2(pt2.x * vieww + vieww,pt2.y * viewh + viewh); \nif(ishide > 0.1) \n vColor = vec4(color,0.0); \nelse \n vColor = vec4(color,1.0); \ngl_Position = projectionMatrix * modelViewMatrix * tran * vec4( position.x,position.y,0.0, 1.0 ); \n} \n",i.FSHADER_COLOR_POINT_CLIP_FORMXCAD="precision highp float; \nvarying vec4 vColor; \nvarying vec2 vCp1; \nvarying vec2 vCp2; \nvoid main() { \nif(gl_FragCoord.x > vCp1.x && gl_FragCoord.x < vCp2.x && gl_FragCoord.y > vCp1.y && gl_FragCoord.y < vCp2.y) \ngl_FragColor = vColor; \nelse \ndiscard; \n} \n"},{}],50:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.MxString=void 0;var i=(r.prototype.Find=function(t){return this.m_val.indexOf(t)},r.prototype.Left=function(t){return this.m_val.substring(0,t)},r.prototype.Right=function(t){return this.m_val.substring(t+1,this.m_val.length)},r.prototype.TrimLeft=function(t){for(;0<this.m_val.length&&this.m_val[0]==t;)this.m_val=this.m_val.slice(1)},r.prototype.TrimRight=function(t){for(;0<this.m_val.length&&this.m_val[this.m_val.length-1]==t;)this.m_val=this.m_val.slice(0,-1)},r.prototype.AnalyzeString=function(t){return this.m_val.split(t)},r.prototype.IsEmpty=function(){return 0==this.m_val.length},r.prototype.MakeUpper=function(){this.m_val=this.m_val.toUpperCase()},r.prototype.MakeLower=function(){this.m_val=this.m_val.toLowerCase()},r.prototype.GetLength=function(){return this.m_val.length},r);function r(t){this.m_val="",null!=t&&(this.m_val=t)}n.MxString=i},{}],51:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.MxSystemVariable=void 0;var i=t("three"),r=t("./McEdJigOsnap"),a=(o.prototype.init=function(t){this.m_mxObj=t},o.prototype.getAllLinetypeName=function(){return this.m_vecLinetype},o.prototype.getSysVarBool=function(t){return null!=this.m_data[t]&&this.m_data[t]},o.prototype.setSysVarBool=function(t,e){this.m_data[t]=e},o.prototype.setSysVarPoint=function(t,e){this.m_data[t]=e},o.prototype.OnMessageMxCADSystemVariable=function(t){this.m_vecLinetype=[];var e=JSON.parse(t);if(null!=e){var n=e.vecLinetypeName;for(var i in n)this.m_vecLinetype.push(n[i]);this.m_data.CELTYPE=e.curLinetypeName,this.m_data.CLAYER=e.clayer,this.m_data.CECOLOR=e.cecolor,this.m_data.CECOLORINDEX=e.cecolorindex}this.m_mxObj.callEvent("loadSystmeVariableComplete")},o.prototype.getSysVarPoint=function(t){return null==this.m_data[t]?new i.Vector3(0,0,0):this.m_data[t]},o.prototype.setSysVarNumber=function(t,e){this.m_data[t]=e},o.prototype.getSysVarNumber=function(t){return null==this.m_data[t]?0:this.m_data[t]},o);function o(){this.m_data={},this.m_mxObj=null,this.m_vecLinetype=[],this.m_data.DYNINPUT=!0,this.m_data.GETPOINTSTATUS=0,this.m_data.CELTYPE="Continuous",this.m_data.CLAYER="0",this.m_data.CECOLOR=67108863,this.m_data.CECOLORINDEX=7,this.m_data.OSMODE=r.MxOsnapDefine.OsModeAll}n.MxSystemVariable=a},{"./McEdJigOsnap":20,three:19}],52:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.MxThreeJS=void 0;var i,m=t("three"),g=t("./MxFun");(i=n.MxThreeJS||(n.MxThreeJS={})).createLine=function(t,e,n){var i=new m.Geometry,r=new m.LineBasicMaterial({color:n});return i.vertices.push(t,e),new m.Line(i,r)},i.createCircle=function(t,e,n){var i=new m.CircleGeometry(e,64,3,2*Math.PI),r=new m.LineBasicMaterial({color:n});i.vertices.shift();var a=new m.LineLoop(i,r);return a.position.x=t.x,a.position.y=t.y,a.position.z=t.z,a},i.creatTextSprite=function(t,e,n,i,r){var a,o=document.createElement("canvas"),s=o.getContext("2d"),l=g.MxFun.formatString("normal {0}px Arial","256");s.font=l;var c,u=s.measureText(t);a=2*(c=u.width,Math.pow(2,Math.floor(Math.log(c)/Math.LN2))),o.width=a,o.height=256,s.font=l,s.textAlign="center",s.textBaseline="middle";var h=g.MxFun.formatString("#{0}",r.toString(16));s.fillStyle=h,s.fillText(t,a/2,128);var d=new m.Texture(o);d.needsUpdate=!0;var p=new m.SpriteMaterial({map:d});p.transparent=!1,p.rotation=i;var f=new m.Sprite(p);return f.scale.set(a/256*n,n,1),f.position.set(e.x,e.y,0),f},i.createTriangle=function(t,e,n){if(!(t.length<3)){for(var i=t.length,r=new m.Geometry,a=0;a+2<i;a+=3){r.vertices.push(t[a]),r.vertices.push(t[a+1]),r.vertices.push(t[a+2]);var o=new m.Face3(a,a+1,a+2);r.faces.push(o)}r.computeFaceNormals(),r.computeVertexNormals(),null==n&&(n=1);var s=new m.MeshBasicMaterial({color:e,transparent:!0,depthTest:!1,side:m.DoubleSide,opacity:n});return new m.Mesh(r,s)}},i.createLines=function(t,e){var n=new m.Geometry;n.vertices=t;var i=new m.LineBasicMaterial({color:e});return new m.Line(n,i)},i.createDashedLines=function(t,e,n,i){var r=new m.Geometry;r.vertices=t;var a=new m.Line(r,new m.LineDashedMaterial({color:e,dashSize:n,gapSize:i}));return a.computeLineDistances(),a}},{"./MxFun":39,three:19}],53:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.MxPair=n.MxTools=void 0;var i,r=t("three");(i=n.MxTools||(n.MxTools={})).AsMxWebPoint=function(t,e,n){return new r.Vector3(-t,n,e)},i.AsMxWebPoint_pt=function(t){return new r.Vector3(-t.x,t.z,t.y)},i.AsThreeJsPoint=function(t,e,n){return new r.Vector3(-t,n,e)},i.stringTrimLeftSpace=function(t){return t.replace(/^\s*/g,"")},i.stringDeleteAllSpace=function(t){return t.replace(/\s*/g,"")},i.stringTrimLeftRightSpace=function(t){return t.replace(/^\s*|\s*$/g,"")},i.stringTrimRightSpace=function(t){return t.replace(/(\s*$)/g,"")},i.IsNumerical=function(t){if("string"==typeof t){var e=/^(-(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)))$/;return!(!/^\d+(\.\d+)?$/.test(t)&&!e.test(t))}var n=t.m_val;return e=/^(-(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)))$/,!(!/^\d+(\.\d+)?$/.test(n)&&!e.test(n))},i.formatString=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var i=0;i<e.length;i++)t=t.replace("{"+i+"}",e[i]);return t},i._tstof=function(t){return parseFloat(t)},i._tstoi=function(t){return parseInt(t)},i.IsZero=function(t){return-1e-7<t&&t<1e-7},i.MillimeterToPixels=function(t){return 10*t},i.getXYPlanDistance=function(t,e){var n=new r.Vector2(t.x,t.y),i=new r.Vector2(e.x,e.y);return n.distanceTo(i)};function a(t,e){this.first=t,this.second=e}n.MxPair=a},{three:19}],54:[function(t,e,n){"use strict";var i,r;Object.defineProperty(n,"__esModule",{value:!0}),n.MxType=void 0,i=n.MxType||(n.MxType={}),(r=i.CommandFlags||(i.CommandFlags={}))[r.MCRX_CMD_MODAL=0]="MCRX_CMD_MODAL",r[r.MCRX_CMD_TRANSPARENT=1]="MCRX_CMD_TRANSPARENT",r[r.MCRX_CMD_NO_UNDO_MARKER=2]="MCRX_CMD_NO_UNDO_MARKER",r[r.MCRX_CMD_NOPRV=4]="MCRX_CMD_NOPRV"},{}],55:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.MxUiObject=exports.MxToolBarItem=exports.MxMenuItem=void 0;var MxFun_1=require("./MxFun"),MxMenuItem=function(){this.id=-1,this.text="",this.evalString="",this.parentId=-1};exports.MxMenuItem=MxMenuItem;var MxToolBarItem=function(){this.isMxCommand=!1,this.itemid=""};exports.MxToolBarItem=MxToolBarItem;var MxUiObject=function(){function MxUiObject(){this.vecMenuItem=new Array,this.vecToolBarItem=new Array,this.uiPath="./ui",this.idMenuItemCount=100,this.isShowTitle=!1,this.isShowStructTree=!1,this.isEnableLoading=!0,this.isShowLayer=!1,this.isShowTakeColor=!1,this.isShowLayout=!1,this.isEnableObjectProperty=!1,this.isShowToolbar=!1,this.isShowMainMenu=!1,this.sTitle=""}return MxUiObject.prototype.SetLayoutData=function(t){this.vecLayoutData=t},MxUiObject.prototype.CallMxCommand=function(t){MxFun_1.MxFun.callCommand(t,"")},MxUiObject.prototype.EvalJs=function(value){eval(value)},MxUiObject.prototype.SetLayerData=function(t){this.vecLayerData=t},MxUiObject.prototype.SetSketchLayerData=function(t){this.vecSketchLayerData=t},MxUiObject.prototype.init=function(){this.onInit()},MxUiObject.prototype.addMenuItem=function(t,e,n,i){void 0===e&&(e=""),void 0===n&&(n=-1),void 0===i&&(i=-1);var r=new MxMenuItem;r.text=t,r.evalString=e,-1==i&&(i=this.idMenuItemCount,this.idMenuItemCount++),r.id=i,r.parentId=n,this.vecMenuItem.push(r)},MxUiObject.prototype.addToolBarItem=function(t,e,n,i,r){void 0===e&&(e=""),void 0===n&&(n=""),void 0===i&&(i=!1),void 0===r&&(r="");var a=new MxToolBarItem;a.image=t,a.evalString=n,a.text=e,a.isMxCommand=i,a.itemid=r,this.vecToolBarItem.push(a)},MxUiObject.prototype.setPath=function(t){this.uiPath=t},MxUiObject.prototype.getPath=function(){return this.uiPath},MxUiObject.prototype.create=function(){this.onCreate()},MxUiObject.prototype.writeUICSS=function(){var t=this.uiPath;MxFun_1.MxFun.isPC()?(document.write("<link rel='stylesheet' href='"+t+"/css/mxbimpcm.css'>"),this.isShowMainMenu&&(document.write("<link rel='stylesheet' href='"+t+"/css/rightfacefonts2.css'>"),document.write("<link rel='stylesheet' href='"+t+"/css/rightmnu.css'>"),document.write("<script type='text/javascript' src='"+t+"/hc-mobile-nav.js'><\/script>"))):(document.write("<link rel='stylesheet' href='"+t+"/css/mxmobile.css'>"),this.isShowMainMenu&&(document.write("<link href='"+t+"/css/font-awesome.min.css' rel='stylesheet'>"),document.write("<link rel='stylesheet' href='"+t+"/css/rightfacefonts1.css'>"),document.write("<link rel='stylesheet' href='"+t+"/css/rightfacefonts2.css'>"),document.write("<link rel='stylesheet' href='"+t+"/css/rightmnu.css'>"),document.write("<script type='text/javascript' src='"+t+"/hc-mobile-nav.js'><\/script>")))},MxUiObject}();exports.MxUiObject=MxUiObject},{"./MxFun":39}],56:[function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.MxUiObjectMobile=void 0;var a,o=t("./MxUiObject"),l=t("./MxFun"),s=(a=o.MxUiObject,r(c,a),c.prototype.onCreate=function(){this.isShowTitle&&this.WriteTitle(),this.WriteStructTree(),this.isEnableLoading&&this.WriteLoading(),this.WriteLayer(),this.WriteTakeColor(),this.WriteLayout(),this.isEnableObjectProperty&&this.WriteObjectProperty(),this.isShowToolbar&&this.WriteToolbar()},c.prototype.onInit=function(){this.InitEvent()},c.prototype.ShowLoading=function(){this.isEnableLoading&&($(".Prompt").css("background","rgba(0, 0, 0, 0)"),$(".Prompt").fadeIn(100),$(".Prompt span").css("display","none"))},c.prototype.HideLoading=function(){this.isEnableLoading&&($(".Prompt").css("background","rgba(0, 0, 0, 0.8)"),$(".Prompt div").fadeOut(100),$(".Prompt span").fadeIn(200),setTimeout(function(){$(".Prompt").fadeOut(1e3)},1e3))},c.prototype.ShowObjectProperty=function(t){if(0!=t.length){var e;e="string"==typeof t?JSON.parse(t):t;var n="";for(var i in e){var r=e[i];for(var a in n+='<tbody class="bf-group undefined bf-collapse">',n+='<tr class="bf-group-title">',n+='<td colspan="2"><i class="bf-icon" style=" padding: 12px;"></i>'+r.name+"</td>",n+="</tr>",r.datas){var o=r.datas[a];n+="<tr class='bf-group-content'>",n+="<td class='bf-key'>"+o.name+"</td>",n+="<td class='bf-value'>"+o.value+"</td>",n+="</tr>"}n+="</tbody>"}document.getElementById("ComponentContent").innerHTML=n,$(".bf-group").click(function(){$(this).hasClass("bf-collapse")?$(this).removeClass("bf-collapse"):$(this).addClass("bf-collapse")})}},c.prototype.HideObjectProp=function(){},c.prototype.SwitchShowLayer=function(){var t=document.getElementById("LayerInterface");"none"==t.style.display?(t.style.display="block",t.style.left="80px",t.style.top="50px"):t.style.display="none"},c.prototype.SwitchShowStructTree=function(){},c.prototype.Chosecolor=function(){document.getElementById("color-picker").click()},c.prototype.ColorChange=function(t){document.getElementById("colorbox").style.backgroundColor=t,l.MxFun.setCurrentColor(t)},c.prototype.SwitchShowLayout=function(){var t=document.getElementById("LayerOutInterface");"none"==t.style.display?t.style.display="block":t.style.display="none"},c.prototype.WriteTitle=function(){var t=this.uiPath;document.write("<div class='bar1'>"),document.write("<img src='"+t+"/image/mxcad.png' style='height: 50%;position: absolute;top: 12px;left: 10px;'>"),document.write("<span class='barspan' style='position: absolute;left: 45px;'>"),document.write("</span>"),document.write("<div id='container'>"),this.isShowMainMenu&&(document.write("<header>"),document.write("<div class='wrapper cf'style='z-index: 999'>"),document.write("<nav id='main-nav' >"),document.write("</nav>"),document.write("<a class='toggle'>"),document.write("<span></span>"),document.write("</a>"),document.write("</div>"),document.write("</header>")),document.write("</div>"),document.write("</div>")},c.prototype.WriteToolbar=function(){document.write("<div id='MainMenuContent' class='bf-toolbar bf-toolbar-bottom'>"),document.write("</div>")},c.prototype.WriteLoading=function(){var t=this.uiPath;document.write("<div class='Prompt' style='width: 100px;height:30px;position:"),document.write("absolute;top: 60px;left: 50%;margin-left: -50px;color: #fff;text-align: center;'>"),document.write("<div style='text-align: center;'>"),document.write("<img src='"+t+"/image/loading.gif' alt='' style='width:30px;height:30px;float: left'>"),document.write("<p style='color:black;vertical-align: middle;float: left; margin-top: 5px;margin-left: 5px;'>加载中.....</p>"),document.write("</div>"),document.write("<span style='vertical-align: middle;display: none'>图纸加载完毕</span>"),document.write("</div>")},c.prototype.WriteLayer=function(){var t=this.uiPath;this.isShowLayer&&(document.write("<div class='bf-toolbar bf-toolbar bf-tree-toolbar' title='ModelTree' style='position: absolute; top:111px;left: 0px;' onclick='uiObj.SwitchShowLayer()'>"),document.write("<div class='bf-button mxbim-bf-tree' title='图层'>"),document.write("<img src='"+t+"/image/layer.png.gif' alt='' style='width: 24px;'>"),document.write("</div>"),document.write("</div>")),document.write("<div class='bf-panel bf-has-title bf-sizable' id='LayerInterface' title='图层'"),document.write("style='left: 0px;"),document.write("top: 0px;"),document.write("width: 100%;"),document.write("height: 100%;"),document.write("display: none;'>"),document.write("<div class='bf-close' onclick='uiObj.SwitchShowLayer()' style='text-align: center;'><i class='fa fa-times' aria-hidden='true'></i></div>"),document.write("<div class='bf-title' style='cursor: move; user-select: none;'>图层</div>"),document.write("<div>"),document.write("<div class='layer-title' style='width: 12.5%;'>可见</div>"),document.write("<div class='layer-title' style='width: 12.5%;'>颜色</div>"),document.write("<div class='layer-title' style='width: 62.5%'>名字</div>"),document.write("<div class='layer-title' style='width: 12.5%'>状态</div>"),document.write("</div>"),document.write("<div id='Layer-Info' style='margin-top: 26px;height: 79%;width: 100%; position: absolute;overflow-y: auto;'>"),document.write("</div>"),document.write("</div>")},c.prototype.WriteStructTree=function(){this.isShowStructTree&&(document.write("<div class='bf-toolbar bf-toolbar bf-tree-toolbar' id='Fmj' title='ModelTree'"),document.write("style='position: absolute; top:60px;left: 0px;' onclick='uiObj.SwitchShowStructTree()'>"),document.write("<div class='bf-button mxbim-bf-tree' title='构件树'><i class='fa fa-sitemap' aria-hidden='true' style='font-size: 24px;'></i></div>"),document.write("</div>")),document.write("<div class='bf-panel bf-has-title bf-sizable tree-panel' id='dv' title='目录树' style='left: 0px; top: 0px; width: 100%; height: 100%; display: none;'>"),document.write("<div class='bf-close' onclick='uiObj.SwitchShowStructTree()'><i class='fa fa-times fa-2x' aria-hidden='true'></i></div>"),document.write("<div class='bf-title' style='cursor: move; user-select: none;'>目录树</div>"),document.write("<div class='bf-panel-body' style='padding-top: 57px;overflow-y: scroll;'>"),document.write("<div class='bf-panel-header'>"),document.write("<div class='bf-panel-header'>"),document.write("<div class='bf-tree-header' style='margin-top: -57px;'>"),document.write("<div class='bf-tabs bf-tabs-tree'>"),document.write("<ul class='bf-tabs-list'>"),document.write("<li class='bf-tabs-option my-option undefined active' id='component'>构件</li>"),document.write("<li class='bf-tabs-option my-option undefined' id='area'>空间</li>"),document.write("<li class='bf-tabs-option my-option undefined' id='drawing'>图纸</li>"),document.write("</ul>"),document.write("</div>"),document.write("</div>"),document.write("</div>"),document.write("</div>"),document.write("<div class='' style='margin-bottom: 100px;' id='DirectoryContent'>"),document.write("</div>"),document.write("</div>"),document.write("</div>")},c.prototype.WriteTakeColor=function(){var t=this.uiPath;this.isShowTakeColor&&(document.write("<div class='bf-toolbar bf-toolbar bf-tree-toolbar' id='TakeColor'"),document.write("style='position: absolute;left: 0px; top: 162px;width: 45px; '>"),document.write("<div class='bf-button' onclick='uiObj.Chosecolor()' style='opacity: 1;width: 45px;'>"),document.write("<div style='position: relative;margin-left: 10px;margin-top: -5px;'>"),document.write("<img src='"+t+"/image/color.png' alt='' style='width: 40px;margin-left: -21px;'>"),document.write("</div>"),document.write("<div id='colorbox' style='width: 30px;height: 5px;background-color: #cccccc;margin-left: -3px;margin-top: -5px;'>"),document.write("</div>"),document.write("<div style='width: 18px;height: 40px;float: right;margin-top: -38px;margin-left: 14px;position: absolute;'>"),document.write("<img src='"+t+"/image/daojiao.png' alt='' style='width: 15px;margin-top: 10px;z-index: 999;position: relative'>"),document.write("<input id='color-picker' type='color' value='#c0c0c0' style='display: none' onchange='colorChange(value)'>"),document.write("</div>"),document.write("</div>"),document.write("</div>"))},c.prototype.WriteLayout=function(){var t=this.uiPath;this.isShowLayout&&(document.write("<div class='bf-toolbar bf-toolbar bf-tree-toolbar' id='LayerOut'"),document.write("style='position: absolute;left: 0px; top: 213px; ' onclick='uiObj.SwitchShowLayout()'>"),document.write("<div class='bf-button'>"),document.write("<img src='"+t+"/image/layout.png' alt='' style='width: 24px;'>"),document.write("</div>"),document.write("</div>")),document.write("<div class='bf-panel bf-has-title bf-sizable' id='LayerOutInterface'"),document.write("style='left: 0; top: 0; width: 100%;display:none'>"),document.write("<div class='bf-close' onclick='uiObj.SwitchShowLayout()'><i class='fa fa-times' aria-hidden='true'></i></div>"),document.write("<div class='bf-title' id='buju' style='cursor: move; user-select: none;'>布局</div>"),document.write("<div>"),document.write("</div>"),document.write("<div id=''>"),document.write("<div>"),document.write("<table class='bf-table'>"),document.write("<tbody class='bf-group'>"),document.write("<tr class='bf-group-title bf_layerout' style='height: 30px;cursor: pointer;'>"),document.write("<td class='bf_layerout_td' style='width: 60px' >"),document.write("<div class='bf_layer_div layer_on'></div>"),document.write("</td>"),document.write("<td style='width: 238px' >"),document.write("<span style='color: white;cursor: pointer;'>LayerOut</span>"),document.write("</td>"),document.write("</tr>"),document.write("<tr class='bf-group-title bf_layerout' style='height: 30px;cursor: pointer;'>"),document.write("<td class='bf_layerout_td' style='width: 60px' >"),document.write("<div class='bf_layer_div' ></div>"),document.write("</td>"),document.write("<td style='width: 238px' >"),document.write("<span style='color: white;cursor: pointer;'>LayerOut</span>"),document.write("</td>"),document.write("</tr>"),document.write("<tr class='bf-group-title bf_layerout' style='height: 30px;cursor: pointer;'>"),document.write("<td class='bf_layerout_td' style='width: 60px' >"),document.write("<div class='bf_layer_div' ></div>"),document.write("</td>"),document.write("<td style='width: 238px' >"),document.write("<span style='color: white;cursor: pointer;'>LayerOut</span>"),document.write("</td>"),document.write("</tr>"),document.write("<tr class='bf-group-title bf_layerout' style='height: 30px;cursor: pointer;'>"),document.write("<td class='bf_layerout_td' style='width: 60px' >"),document.write("<div class='bf_layer_div'></div>"),document.write("</td>"),document.write("<td style='width: 238px' >"),document.write("<span style='color: white;cursor: pointer;'>LayerOut</span>"),document.write("</td>"),document.write("</tr>"),document.write("</tbody>"),document.write("</table>"),document.write("</div>"),document.write("</div>"),document.write("</div>")},c.prototype.WriteObjectProperty=function(){document.write("<div class='bf-panel bf-has-title bf-sizable property-panel' id='fmj2' title='构件详情' style='left: 0px; top: 0px; width: 100%; height: 100%;display: none;'>"),document.write("<div class='bf-close' id='close2' style='top:4.0em;'><i class='fa fa-times fa-2x' aria-hidden='true'></i></div>"),document.write("<div class='bf-title' style='cursor: move; user-select: none;'>构件详情</div>"),document.write("<div class='bf-panel-body' style='padding-top: 41px;'>"),document.write("<div class='bf-panel-container bf-scroll-bar' style='top:0;width: 100%;height: 100%;overflow-y: auto;position: relative;'>"),document.write("<table class='bf-table' id='ComponentContent'>"),document.write("</table>"),document.write("</div>"),document.write("</div>"),document.write("</div>")},c.prototype.UpDisplayLayout=function(){},c.prototype.UpDisplayLayer=function(){var t=this.uiPath,e=this.vecLayerData,n=this.vecSketchLayerData,i="";if(null!=n){var r=n;for(var a in r){i+="<div>";var o="hide.png";0==r[a].off&&(o="show.png");var s="unlock.png";i+="<table class='bf-table'>",i+="<tbody class='bf-group'>",i+="<tr class='bf-group-title'>",i+='<td><img class="layer-enable" sketch=1 id='+r[a].id+' src="'+t+"/image/"+o+'"/></td>',i+='<td><span class="layer-color" style="background-color:'+r[a].color+'"></span></td>',i+='<td><span class="layer-text">草图_'+r[a].name+"</span></td>",i+='<td><img class="layer-state" src="'+t+"/image/"+s+'"/></td>',i+="</tr>",i+="</tbody>",i+="</table>",i+="</div>"}}if(null!=e)for(var a in r=e)i+="<div>",o="hide.png",0==r[a].off&&(o="show.png"),s="lock.png",i+="<table class='bf-table'>",i+="<tbody class='bf-group'>",i+="<tr class='bf-group-title'>",i+='<td><img class="layer-enable" sketch=0 id='+r[a].id+' src="'+t+"/image/"+o+'"/></td>',i+='<td><span class="layer-color" style="background-color:'+r[a].color+'"></span></td>',i+='<td><span class="layer-text">'+r[a].name+"</span></td>",i+='<td><img class="layer-state" src="'+t+"/image/"+s+'"/></td>',i+="</tr>",i+="</tbody>",i+="</table>",i+="</div>";var l=document.getElementById("Layer-Info");null!=l&&(l.innerHTML=i)},c.prototype.WriteFooter=function(){document.write("<div class='footer' style='background: rgba(0, 0, 0, 0.7);min-width: auto;position: fixed;left: 0;bottom: 0;width: 100%;'>"),document.write("<div style='line-height: 40px;font-size: 12px;color: #999;padding: 0 10px;'>"),document.write("<p style='float: right;line-height: 15px;font-size: 12px;color: #999;display: block;'>"),document.write("<a style='color: #4a90e2;text-decoration: none;outline: none;' href='http://www.mxdraw.com/' target='_blank'>梦想CAD</a>旗下产品"),document.write("</p>"),document.write("<a style='color: #4a90e2;text-decoration: none;outline: none;' href='http://www.mxdraw.com' target='_blank'>MX3D</a> 蜀ICP备15011727号"),document.write("</div>"),document.write("</div>")},c.prototype.CreateToolBar=function(t){if(this.isShowToolbar){var e="";for(var n in t){var i=t[n],r="uiObj.CallMxCommand";i.isMxCommand||(r="uiObj.EvalJs"),0<i.itemid.length?e+='<div class="bf-button" onclick="'+r+"('"+t[n].evalString+'\')"><img class="mainimage-bf-butto" id="'+i.itemid+'" src="'+this.uiPath+"\\image\\"+i.image+'" title="'+t[n].text+'"></div>':e+='<div class="bf-button" onclick="'+r+"('"+t[n].evalString+'\')"><img class="mainimage-bf-butto" src="'+this.uiPath+"\\image\\"+i.image+'" title="'+t[n].text+'"></div>'}document.getElementById("MainMenuContent").innerHTML=e}},c.prototype.InitEvent=function(){var t=document.getElementById("LayerInterface");this.CreateToolBar(this.vecToolBarItem),t.style.display="none";var s=this.vecMenuItem;this.isShowMainMenu&&function(t){var a="";!function t(e,n){var i=function(t,e){var n=new Array;for(var i in e)e[i].parentId==t&&n.push(e[i]);return n}(e,n);if(0<i.length){for(var r in a+="<ul>",i)0!=i[r].evalString.length?(a+='<li><p class="li_option" ',a+="onclick=\"uiObj.EvalJs('"+i[r].evalString+"')\"",a+=">"+i[r].text+"</p>"):(a+="<li><a ",a+=">"+i[r].text+"</a>"),t(i[r].id,n),a+="</li>";a+="</br>",a+="</br>",a+="</br>",a+="</ul>"}}(-1,s),t("#main-nav").append(a);var e=t("#main-nav"),n=t(".toggle"),i={maxWidth:!1,customToggle:n,levelTitles:!0},r=null,o={};r&&r.remove(),n.off("click"),r=e.clone(),t.extend(o,{side:"right"}),r.hcMobileNav(t.extend({},i,o))}(jQuery);var e=window.location.href,n=e.length,i=e.indexOf("?"),r=e.substr(i,n).split("=")[1];$(".barspan").html(decodeURIComponent(r)),$("#close2").click(function(){$(this).parent("div").fadeOut(200)}),$(".bf-select-current").click(function(){$(this).hasClass("bf-open")?$(this).removeClass("bf-open"):$(this).addClass("bf-open")}),$(".my-option").click(function(){var t=$(this);$(".my-option").each(function(){$(this).removeClass("active")}),t.addClass("active")}),$(".bf-select-option").click(function(){$(this).parent("ul").prev("span").html($(this).text()),$(this).parent("ul").prev("span").removeClass("bf-open")}),$(document).on("click",".layer-enable",function(){var t=l.MxFun.getUiObj().getPath(),e=parseInt($(this).attr("id")),n=parseInt($(this).attr("sketch")),i=!0;$(this).attr("src")==t+"/image/show.png"?($(this).attr("src",t+"/image/hide.png"),i=!1):$(this).attr("src",t+"/image/show.png"),l.MxFun.showLayer(e,i,1==n)})},c.prototype.Fullscreen=function(){var t=document.documentElement;t.requestFullscreen?t.requestFullscreen():t.mozRequestFullScreen?t.mozRequestFullScreen():t.webkitRequestFullScreen&&t.webkitRequestFullScreen(),document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitCancelFullScreen?document.webkitCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen(),this.IsFullStatus()?($("img[title='取消全屏']").attr("src",this.uiPath+"/image\\fullscreen1.gif"),$("img[title='取消全屏']").attr("title","全屏")):($("img[title='全屏']").attr("src",this.uiPath+"/image\\escscreen1.gif"),$("img[title='全屏']").attr("title","取消全屏"))},c.prototype.IsFullStatus=function(){return null!=(document.fullscreenEnabled||document.mozFullscreenElement||document.webkitFullscreenElement)},c);function c(){return null!==a&&a.apply(this,arguments)||this}n.MxUiObjectMobile=s},{"./MxFun":39,"./MxUiObject":55}],57:[function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.MxUiObjectPC=void 0;var a,o=t("./MxUiObject"),v=t("./MxFun"),s=(a=o.MxUiObject,r(l,a),l.prototype.onCreate=function(){this.isShowTitle&&this.WriteTitle(),this.WriteStructTree(),this.isEnableLoading&&this.WriteLoading(),this.WriteLayer(),this.WriteTakeColor(),this.WriteLayout(),this.isEnableObjectProperty&&this.WriteObjectProperty(),this.isShowToolbar&&this.WriteToolbar()},l.prototype.onInit=function(){this.InitEvent()},l.prototype.WriteTitle=function(){var t=this.uiPath;document.write("<div id='all'>"),document.write(" <div class='bar1'>"),document.write(" <img src="+t+"/image/mxcad.png style='height: 50%;position: absolute;top: 12px;left: 10px;'>"),document.write(" <span class='barspan' style='position: absolute;left: 45px;'>"),document.write(" </span>"),document.write(" <div id='container'>"),this.isShowMainMenu&&(document.write(" <header>"),document.write(" <div class='wrapper cf'style='z-index: 999'>"),document.write(" <nav id='main-nav' >"),document.write(" </nav>"),document.write(" <a class='toggle'>"),document.write(" <span></span>"),document.write(" </a>"),document.write(" </div>"),document.write(" </header>")),document.write(" </div>"),document.write(" </div>")},l.prototype.WriteStructTree=function(){this.isShowStructTree&&(document.write("<div class='bf-toolbar bf-toolbar bf-tree-toolbar' id='ModelTreeThumbnail' title='目录树'"),document.write("style='position: absolute;left: 10px; top: 97px; ' onclick='uiObj.SwitchShowStructTree()'>"),document.write("<div class='bf-button mxbim-bf-tree' title='目录树'><i class='fa fa-sitemap' aria-hidden='true'></i></div>"),document.write("</div>")),document.write("<div class='bf-panel bf-has-title bf-sizable' id='ModelTreeInterface' title='目录树'"),document.write("style='left:0px; top: 0px; width: 300px; height: 416px;display: none'>"),document.write(" <div class='bf-close' onclick='uiObj.SwitchShowStructTree()'><i class='fa fa-times' aria-hidden='true'></i></div>"),document.write("<div class='bf-title' style='cursor: move; user-select: none;' id='mulushu'>目录树</div>"),document.write("<div class='bf-panel-body' style='padding-top: 36px;'>"),document.write("<div class='bf-panel-header'>"),document.write("<div class='bf-tree-header' style='margin-top: -36px;'>"),document.write("<div class='bf-select bf-select-tree'>"),document.write("<span class='bf-select-current'>构件</span>"),document.write("<ul class='bf-select-list'>"),document.write("<li class='bf-select-option' id='type'>构件</li>"),document.write("<li class='bf-select-option' id='file'>文件</li>"),document.write("<li class='bf-select-option' id='area'>空间</li>"),document.write("<li class='bf-select-option' id='drawing'>图纸</li>"),document.write("</ul>"),document.write("</div>"),document.write("</div>"),document.write("</div>"),document.write("<div id='DirectoryContent' class='bf-panel-container TreeInfo'>"),document.write("</div>"),document.write("</div>"),document.write("</div>")},l.prototype.WriteLoading=function(){var t=this.uiPath;document.write("<div class='Prompt'>"),document.write("<div style='text-align: center;'>"),document.write("<img src='"+t+"/image/loading.gif' alt='' style='width:30px;height:30px;float: left'>"),document.write("<p style='color:black;vertical-align: middle;float: left; margin-top: 5px;margin-left: 5px;'>加载中.....</p>"),document.write("</div>"),document.write("<span style='display: none'>提示:打开图纸完成</span>"),document.write("</div>")},l.prototype.WriteLayer=function(){var t=this.uiPath;this.isShowLayer&&(document.write("<div class='bf-toolbar bf-toolbar bf-tree-toolbar' id='LayerThumbnail' title='图层'"),document.write("style='position: absolute;left: 10px; top: 45px; ' onclick='uiObj.SwitchShowLayer()'>"),document.write("<div class='bf-button'>"),document.write("<img src='"+t+"/image/layer.png.gif' alt='' style='width: 32px;'>"),document.write("</div>"),document.write("</div>")),document.write("<div class='bf-panel bf-has-title bf-sizable' id='LayerInterface'"),document.write("style='left: 10px; top: 50px; width: 300px; height: 416px;display: none'>"),document.write("<div class='bf-close' onclick='uiObj.SwitchShowLayer(false)'><i class='fa fa-times' aria-hidden='true'></i></div>"),document.write("<div class='bf-title' id='tuceng' style='cursor: move; user-select: none;'>图层</div>"),document.write("<div>"),document.write("<div class='layer-title' style='width: 50px;font-size: 14px'>可见</div>"),document.write("<div class='layer-title' style='width: 50px;font-size: 14px'>颜色</div>"),document.write("<div class='layer-title' style='width: 148px;font-size: 14px'>名字</div>"),document.write("<div class='layer-title' style='width: 50px;font-size: 14px'>状态</div>"),document.write("</div>"),document.write("<div id='Layer-Info' style='margin-top: 25px;height: 349px;position: absolute;overflow-y: auto;'>"),document.write("</div>"),document.write("</div>")},l.prototype.WriteTakeColor=function(){var t=this.uiPath;this.isShowTakeColor&&(document.write("<div class='bf-toolbar bf-toolbar bf-tree-toolbar' id='TakeColor' title='选择颜色'"),document.write("style='position: absolute;left: 10px; top: 149px; '>"),document.write("<div class='bf-button' onclick='uiObj.Chosecolor()' style='opacity: 1;'>"),document.write("<img src='"+t+"/image/color.png' alt='' style='width: 40px;margin-left: -10px;'>"),document.write("<div id='colorbox' style='width: 35px;height: 5px;background-color: #cccccc;margin-left: -3px'>"),document.write("</div>"),document.write("<div style='width: 18px;height: 40px;float: right;margin-top: -42px;margin-left: 14px;'>"),document.write("<img src='"+t+"/image/daojiao.png' alt='' style='width: 15px;margin-top: 10px;z-index: 999;position: relative'>"),document.write("<input id='color-picker' type='color' value='#c0c0c0' style='display: none' onchange='uiObj.ColorChange(value)'>"),document.write("</div>"),document.write("</div>"),document.write("</div>"))},l.prototype.WriteLayout=function(){var t=this.uiPath;this.isShowLayout&&(document.write("<div class='bf-toolbar bf-toolbar bf-tree-toolbar' id='LayerOut' title='布局'"),document.write("style='position: absolute;left: 10px; top: 97px; ' onclick='uiObj.SwitchShowLayout()'>"),document.write("<div class='bf-button'>"),document.write("<img src='"+t+"/image/layout.png' alt='' style='width: 32px;'>"),document.write("</div>"),document.write("</div>")),document.write("<div class='bf-panel bf-has-title bf-sizable' id='LayerOutInterface'"),document.write("style='left: 10px; top: 50px; width: 300px;display:none'>"),document.write("<div class='bf-close' onclick='uiObj.SwitchShowLayout()'><i class='fa fa-times' aria-hidden='true'></i></div>"),document.write("<div class='bf-title' id='buju' style='cursor: move; user-select: none;'>布局</div>"),document.write("<div>"),document.write("</div>"),document.write("<div id='layout-Info'>"),document.write("</div>"),document.write("</div>")},l.prototype.WriteObjectProperty=function(){document.write("<div class='bf-panel bf-has-title bf-sizable' id='StrcutInfoBase' title='属性'"),document.write("style='right: 10px; top: 45px; width: 300px; height: 416px;display: none'>"),document.write("<div class='bf-close' id='close2'><i class='fa fa-times' aria-hidden='true'></i></div>"),document.write("<div class='bf-title' style='cursor: move; user-select: none;'>属性</div>"),document.write("<div id='ComponentContent' class='bf-panel-body StructInfo'></div>"),document.write("<div class='bf-resize'></div>"),document.write("</div>")},l.prototype.WriteToolbar=function(){document.write("<div id='MainMenuContent' class='bf-toolbar bf-toolbar-bottom' style='position: fixed'></div>")},l.prototype.CreateToolBar=function(t){if(this.isShowToolbar){var e="";for(var n in t){var i=t[n],r="uiObj.CallMxCommand";i.isMxCommand||(r="uiObj.EvalJs"),0<i.itemid.length?e+='<div class="bf-button" onclick="'+r+"('"+t[n].evalString+'\')"><img class="mainimage-bf-butto" id="'+i.itemid+'" src="'+this.uiPath+"\\image\\"+i.image+'" title="'+t[n].text+'"></div>':e+='<div class="bf-button" onclick="'+r+"('"+t[n].evalString+'\')"><img class="mainimage-bf-butto" src="'+this.uiPath+"\\image\\"+i.image+'" title="'+t[n].text+'"></div>'}document.getElementById("MainMenuContent").innerHTML=e}},l.prototype.UpDisplayLayer=function(){var t=this.uiPath,e=this.vecLayerData,n=this.vecSketchLayerData,i="";if(null!=n){var r=n;for(var a in r){i+="<div>";var o="hide.png";0==r[a].off&&(o="show.png");var s="unlock.png";i+="<table class='bf-table'>",i+="<tbody class='bf-group'>",i+="<tr class='bf-group-title'>",i+='<td><img class="layer-enable" sketch=1 id='+r[a].id+' src="'+t+"/image/"+o+'"/></td>',i+='<td><span class="layer-color" style="background-color:'+r[a].color+'"></span></td>',i+='<td><span class="layer-text">草图_'+r[a].name+"</span></td>",i+='<td><img class="layer-state" src="'+t+"/image/"+s+'"/></td>',i+="</tr>",i+="</tbody>",i+="</table>",i+="</div>"}}if(null!=e)for(var a in r=e)i+="<div>",o="hide.png",0==r[a].off&&(o="show.png"),s="lock.png",i+="<table class='bf-table'>",i+="<tbody class='bf-group'>",i+="<tr class='bf-group-title'>",i+='<td><img class="layer-enable" sketch=0 id='+r[a].id+' src="'+t+"/image/"+o+'"/></td>',i+='<td><span class="layer-color" style="background-color:'+r[a].color+'"></span></td>',i+='<td><span class="layer-text">'+r[a].name+"</span></td>",i+='<td><img class="layer-state" src="'+t+"/image/"+s+'"/></td>',i+="</tr>",i+="</tbody>",i+="</table>",i+="</div>";var l=document.getElementById("Layer-Info");null!=l&&(l.innerHTML=i)},l.prototype.UpDisplayLayout=function(){var t=this.vecLayoutData,e="";if(e+="<div>",e+="<table class='bf-table'>",e+="<tbody class='bf-group'>",e+="<tr class='bf-group-title bf_layerout' style='height: 30px;cursor: pointer;'>",e+="<td class='bf_layerout_td' style='width: 60px' >",e+="<div class='bf_layer_div layer_on'></div>",e+="</td>",e+="<td style='width: 238px' >",e+="<span class='layout-name' name='Model' style='color: white;cursor: pointer;'>Model</span>",e+="</td>",e+="</tr>",null!=t){var n=t;for(var i in n)e+="<tr class='bf-group-title bf_layerout' style='height: 30px;cursor: pointer;'>",e+="<td class='bf_layerout_td' style='width: 60px' >",e+="<div class='bf_layer_div layer_on'></div>",e+="</td>",e+="<td style='width: 238px' >",e+="<span class='layout-name' name='"+n[i]+"' style='color: white;cursor: pointer;'>"+n[i]+"</span>",e+="</td>",e+="</tr>"}e+="</tbody>",e+="</table>",e+="</div>";var r=document.getElementById("layout-Info");null!=r&&(r.innerHTML=e)},l.prototype.InitEvent=function(){var a=document.getElementById("ModelTreeInterface"),o=document.getElementById("LayerInterface"),s=document.getElementById("LayerOutInterface"),t=document.getElementById("tuceng"),e=document.getElementById("mulushu"),n=document.getElementById("buju"),l=0,c=0,u=0,h=0,d=!1;e.onmousedown=function(t){l=t.clientX,c=t.clientY,u=a.offsetLeft,h=a.offsetTop,d=!0,a.style.cursor="move"},t.onmousedown=function(t){l=t.clientX,c=t.clientY,u=o.offsetLeft,h=o.offsetTop,d=!0,o.style.cursor="move"},n.onmousedown=function(t){l=t.clientX,c=t.clientY,u=s.offsetLeft,h=s.offsetTop,d=!0,s.style.cursor="move"},window.onmousemove=function(t){if(0!=d){var e=t.clientX,n=t.clientY,i=e-(l-u),r=n-(c-h);a.style.left=i+"px",a.style.top=r+"px",o.style.left=i+"px",o.style.top=r+"px",s.style.left=i+"px",s.style.top=r+"px"}},e.onmouseup=function(){d=!1,a.style.cursor="default"},t.onmouseup=function(){d=!1,o.style.cursor="default"},n.onmouseup=function(){d=!1,s.style.cursor="default"},$("#close2").click(function(){$(this).parent("div").fadeOut(200)}),$("#menu4").click(function(){$("#StrcutInfoBase").hasClass("hide")?($("#StrcutInfoBase").fadeIn(200),$("#StrcutInfoBase").removeClass("hide")):($("#StrcutInfoBase").fadeOut(200),$("#StrcutInfoBase").addClass("hide"))}),$(".bf-select-current").click(function(){$(this).hasClass("bf-open")?$(this).removeClass("bf-open"):$(this).addClass("bf-open")}),$(".bf-select-option").click(function(){$(this).parent("ul").prev("span").html($(this).text()),$(this).parent("ul").prev("span").removeClass("bf-open")});var p=$("#StrcutInfoBase");p.bind("mousedown",function(t){var a=$(this)[0].offsetLeft,o=$(this)[0].offsetTop,s=t.pageX,l=t.pageY;$(document).bind("mousemove",function(t){var e=t.pageX-s,n=t.pageY-l,i=a+e+"px",r=o+n+"px";p.css({top:r,left:i})})}),$(document).bind("mouseup",function(){$(this).unbind("mousemove")}),this.CreateToolBar(this.vecToolBarItem);var f=this.vecMenuItem;if(this.isShowMainMenu&&function(t){var a="";!function t(e,n){var i=function(t,e){var n=new Array;for(var i in e)e[i].parentId==t&&n.push(e[i]);return n}(e,n);if(0<i.length){for(var r in a+="<ul>",i)0!=i[r].evalString.length?(a+='<li><p class="li_option" ',a+="onclick=\"uiObj.EvalJs('"+i[r].evalString+"')\"",a+=">"+i[r].text+"</p>"):(a+="<li><a ",a+=">"+i[r].text+"</a>"),t(i[r].id,n),a+="</li>";a+="</br>",a+="</br>",a+="</br>",a+="</ul>"}}(-1,f),t("#main-nav").append(a);var e=t("#main-nav"),n=t(".toggle"),i={maxWidth:!1,customToggle:n,levelTitles:!0},r=null,o={};r&&r.remove(),n.off("click"),r=e.clone(),t.extend(o,{side:"right"}),r.hcMobileNav(t.extend({},i,o))}(jQuery),$(".li_option").click(function(){var t=$(this);$(".li_option").each(function(){$(this).removeClass("active")}),t.addClass("active")}),""==this.sTitle){var i=window.location.href,r=i.length,m=i.indexOf("?"),g=i.substr(m,r).split("=")[1];null!=g&&(this.sTitle=g)}$(".barspan").html(decodeURIComponent(this.sTitle)),$(document).on("click",".layer-enable",function(){var t=v.MxFun.getUiObj().getPath(),e=parseInt($(this).attr("id")),n=parseInt($(this).attr("sketch")),i=!0;$(this).attr("src")==t+"/image/show.png"?($(this).attr("src",t+"/image/hide.png"),i=!1):$(this).attr("src",t+"/image/show.png"),v.MxFun.showLayer(e,i,1==n)}),$(document).on("click",".layout-name",function(){var t=$(this).attr("name");"Model"==t&&(t=""),v.MxFun.getCurrentDraw().gotoLayout(t)})},l.prototype.WriteFooter=function(){document.write("<div class='footer' style='background: rgba(0, 0, 0, 0.7);position: fixed;left: 0;bottom: 0;width: 100%;'>"),document.write(" <div style='line-height: 40px;font-size: 12px;color: #999;padding: 0 10px;'>"),document.write(" <p style='float: right;line-height: 15px;font-size: 12px;color: #999;display: block;'>"),document.write(" <a style='color: #4a90e2;text-decoration: none;outline: none;' href='http://www.mxdraw.com/' target='_blank'>MxDraw </a>旗下产品"),document.write(" </p>"),document.write(" <a style='color: #4a90e2;text-decoration: none;outline: none;' href='http://www.mxdraw.com' target='_blank'>MX3D </a> 蜀ICP备15011727号"),document.write(" </div>"),document.write(" </div>")},l.prototype.ShowLoading=function(){this.isEnableLoading&&($(".Prompt").css("background","rgba(0, 0, 0, 0)"),$(".Prompt").fadeIn(100),$(".Prompt span").css("display","none"))},l.prototype.HideLoading=function(){this.isEnableLoading&&($(".Prompt").css("background","rgba(0, 0, 0, 0.8)"),$(".Prompt div").fadeOut(100),$(".Prompt span").fadeIn(200),setTimeout(function(){$(".Prompt").fadeOut(1e3)},1e3))},l.prototype.ShowObjectProperty=function(t){if(0!=t.length){var e;e="string"==typeof t?JSON.parse(t):t;var n="";for(var i in e){var r=e[i];for(var a in n+="<table class='bf-table'>",n+="<tbody class='bf-group'>",n+="<tr class='bf-group-title'>",n+="<td colspan='2'><i class='bf-icon'></i>"+r.name+"</td>",n+="</tr>",r.datas){var o=r.datas[a];n+="<tr class='bf-group-content'>",n+="<td class='bf-key'>"+o.name+"</td>",n+="<td class='bf-value'>"+o.value+"</td>",n+="</tr>"}n+="</tbody>",n+="</table>"}document.getElementById("ComponentContent").innerHTML=n,$(".bf-group").click(function(){$(this).hasClass("bf-collapse")?$(this).removeClass("bf-collapse"):$(this).addClass("bf-collapse")}),$("#StrcutInfoBase").fadeIn(200),$("#StrcutInfoBase").removeClass("hide")}},l.prototype.HideObjectProp=function(){$("#StrcutInfoBase").hasClass("hide")||($("#StrcutInfoBase").fadeOut(200),$("#StrcutInfoBase").addClass("hide"))},l.prototype.SwitchShowLayer=function(){var t=document.getElementById("ModelTreeInterface"),e=document.getElementById("ModelTreeThumbnail"),n=document.getElementById("LayerThumbnail"),i=document.getElementById("LayerInterface"),r=document.getElementById("LayerOut"),a=document.getElementById("LayerOutInterface");t.style.display="none",(a.style.display="none")==i.style.display?(n.style.display="block",i.style.display="block",i.style.left="80px",i.style.top="50px",null!=e&&(e.style.display="block"),null!=r&&(r.style.display="block"),t.style.display="none",a.style.display="none"):(i.style.display="none",null!=e&&(e.style.display="block"),n.style.display="block",null!=r&&(r.style.display="block"))},l.prototype.SwitchShowStructTree=function(){var t=document.getElementById("ModelTreeInterface"),e=document.getElementById("ModelTreeThumbnail"),n=document.getElementById("LayerThumbnail"),i=document.getElementById("LayerInterface"),r=document.getElementById("LayerOut"),a=document.getElementById("LayerOutInterface");i.style.display="none",(a.style.display="none")==t.style.display?(null!=e&&(e.style.display="block"),t.style.display="block",t.style.left="80px",t.style.top="50px",n.style.display="block",null!=r&&(r.style.display="block"),i.style.display="none",a.style.display="none"):(t.style.display="none",null!=e&&(e.style.display="block"),n.style.display="block",null!=r&&(r.style.display="block"))},l.prototype.Chosecolor=function(){document.getElementById("color-picker").click()},l.prototype.ColorChange=function(t){document.getElementById("colorbox").style.backgroundColor=t,v.MxFun.setCurrentColor(t)},l.prototype.SwitchShowLayout=function(){var t=document.getElementById("ModelTreeInterface"),e=document.getElementById("ModelTreeThumbnail"),n=document.getElementById("LayerThumbnail"),i=document.getElementById("LayerInterface"),r=document.getElementById("LayerOut"),a=document.getElementById("LayerOutInterface");t.style.display="none",(i.style.display="none")==a.style.display?(r.style.display="block",a.style.display="block",a.style.left="80px",a.style.top="120px",null!=e&&(e.style.display="block"),n.style.display="block",t.style.display="none",i.style.display="none"):(a.style.display="none",null!=e&&(e.style.display="block"),n.style.display="block",r.style.display="block")},l.prototype.Fullscreen=function(){var t=document.documentElement;t.requestFullscreen?t.requestFullscreen():t.mozRequestFullScreen?t.mozRequestFullScreen():t.webkitRequestFullScreen&&t.webkitRequestFullScreen(),document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitCancelFullScreen?document.webkitCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen(),this.IsFullStatus()?($("img[title='取消全屏']").attr("src",this.uiPath+"/image\\fullscreen1.gif"),$("img[title='取消全屏']").attr("title","全屏")):($("img[title='全屏']").attr("src",this.uiPath+"/image\\escscreen1.gif"),$("img[title='全屏']").attr("title","取消全屏"))},l.prototype.IsFullStatus=function(){return null!=(document.fullscreenEnabled||document.mozFullscreenElement||document.webkitFullscreenElement)},l);function l(){return null!==a&&a.apply(this,arguments)||this}n.MxUiObjectPC=s},{"./MxFun":39,"./MxUiObject":55}],58:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.MxUiVue=void 0;var i,r,d,a=t("./MxFun"),o=t("./MxJigCmdManager"),s=t("./MxTools"),l=t("./MxCmdRunManager");function c(t){if(32==t||13==t)if(o.MxJigCmdManager.isRunning())o.MxJigCmdManager.OnEnter(t);else{var e=f(),n="";n=0==e.length?l.MxCmdRunManager.GetPrvCmd():e,m(""),n=s.MxTools.stringTrimLeftSpace(n),a.MxFun.sendStringToExecute(n)}else if(27==t)o.MxJigCmdManager.isRunning()?o.MxJigCmdManager.stopCmd():h(" *取消*\n命令:");else if(38==t){if(!o.MxJigCmdManager.isRunning())l.MxCmdRunManager.MoveUpKey(),0!=(i=l.MxCmdRunManager.GetListCommad()).length&&(m(i),p())}else if(40==t){var i;if(!o.MxJigCmdManager.isRunning())l.MxCmdRunManager.MoveDownKey(),0!=(i=l.MxCmdRunManager.GetListCommad()).length&&(m(i),p())}}function u(t,e){void 0===e&&(e=!0);var n=t.length;if(!(n<1)){for(var i=d.getCmdLine(),r=i.getCmdTip(),a=i.getCmdText(),o=t.indexOf("\n"),s=0,l=!0;-1!=o&&(l?(i.addCmdDisplay("\n"+r+a+t.substring(s,o-s)),a=r="",l=!1):i.addCmdDisplay("\n"+t.substring(s,o-s)),(s=o+1)<n);)o=t.indexOf("\n",s);if(l){var c=t.substring(s,n-s),u=c.indexOf("\r"),h=c.length;r=-1==u?r+a+c:u+1<h?c.substring(u+1,h-u-1):""}else s<n&&(r=t.substring(s,n));a="",e&&(r+=" "),i.setCmdTip(r),i.setCmdText(a),i.upDisplay()}}function h(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(null!=d){for(var i=arguments,r=i[0],a=0;a<i.length-1;a++){var o=new RegExp("\\{"+a+"\\}","gm");r=r.replace(o,i[a+1])}u(r,!0)}}function p(){null!=d&&d.getCmdLine().upDisplay()}function f(){if(null==d)return"";var t=d.getCmdLine();return s.MxTools.stringTrimLeftRightSpace(t.getCmdText())}function m(t){if(null!=d)return d.getCmdLine().setCmdText(t)}function g(t){var e=o.MxJigCmdManager.getCurCmd();null!=e&&(e.getDynImput().onKeyDonw(t)||c(t))}i=n.MxUiVue||(n.MxUiVue={}),d=void 0,(r=i.CursorType||(i.CursorType={}))[r.kNormal=0]="kNormal",r[r.kRect=1]="kRect",r[r.kCross=2]="kCross",i.isNull=function(){return null==d},i.init=function(t){(d=t).mountKeydownEvent(c),d.getDynamicInput().mountKeydownEvent(g)},i.setTipCoord=function(t){null!=d&&d.setTipCoord(t)},i.setCursorType=function(t){null!=d&&d.setCursorType(t)},i.AcutPrintfNoFormat=u,i.acutPrintf=h,i.cmdLineUpDisplay=p,i.getCmdText=f,i.setCmdText=m,i.getCmdDisplay=function(){return null==d?"":d.getCmdLine().getCmdDisplay()},i.setCmdDisplay=function(t){if(null!=d)return d.getCmdLine().setCmdDisplay(t)},i.getCmdTip=function(){return null==d?"":d.getCmdLine().getCmdTip()},i.setCmdTip=function(t){if(null!=d)return d.getCmdLine().setCmdTip(t)},i.restoreCmdStatus=function(){if(null!=d){var t=d.getCmdLine();" "==t.getCmdTip()&&0==t.getCmdText().length?(t.setCmdTip(""),h("{0}:","命令")):h("\n{0}:","命令")}},i.DynamicInput_upDisplay=function(){null!=d&&i.OnMxEvent({name:"dynInputUpDisplay"})},i.DynamicInput_setType=function(t){null!=d&&d.getDynamicInput().setType(t)},i.DynamicInput_getType=function(){return null==d?o.MxJigCmdManager.DynamicInputType.kNoInput:d.getDynamicInput().getType()},i.DynamicInput_setPos=function(t){null!=d&&d.getDynamicInput().setPos([t.x,t.y])},i.DynamicInput_setTip=function(t){null!=d&&d.getDynamicInput().setTip(t)},i.DynamicInput_setValue1=function(t){null!=d&&d.getDynamicInput().setValue1(t)},i.DynamicInput_getValue1=function(){return null==d?"":d.getDynamicInput().getValue1()},i.DynamicInput_setValue1Pos=function(t){null!=d&&d.getDynamicInput().setValue1Pos([t.x,t.y])},i.DynamicInput_setValue2=function(t){null!=d&&d.getDynamicInput().setValue2(t)},i.DynamicInput_getValue2=function(){return null==d?"":d.getDynamicInput().getValue2()},i.DynamicInput_getFocusValue=function(){return null==d?"":d.getDynamicInput().getFocusValue()},i.DynamicInput_setValue2Pos=function(t){null!=d&&d.getDynamicInput().setValue2Pos([t.x,t.y])},i.DynamicInput_setShow=function(t){null!=d&&d.getDynamicInput().setShow(t)},i.DynamicInput_isShow=function(){return null!=d&&d.getDynamicInput().isShow()},i.OnMxEvent=function(t){if(null==d)return!1;d.OnMxEvent(t)}},{"./MxCmdRunManager":32,"./MxFun":39,"./MxJigCmdManager":42,"./MxTools":53}],59:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.MxWindowsEvent=void 0;var i,r,o,a,s=t("./MxFun"),l=t("./MxManager"),c=t("./MxJigCmdManager"),u=t("three"),h=t("./MxUiVue"),d=t("./MxDrawData");function p(t,e){for(var n=0,i=a.length;n<i;n++){var r=a[n](t,e);if(0!=r)return r}}function f(t){if(o.x=t.offsetX,o.y=t.offsetY,!p("mousemove",t)&&!h.MxUiVue.isNull()){var e=t.srcElement;if(e&&"CANVAS"==e.tagName){var n=l.MxManager.getMxObject(e);if(null==n)return;var i=n.screenCoord2Doc(t.offsetX,t.offsetY,0);h.MxUiVue.setTipCoord(s.MxFun.formatString("{0},{1},0.000",i.x.toFixed(3),i.y.toFixed(3)))}}}function m(t){p("mouseup",t)}function g(t){if(o.x=t.offsetX,o.y=t.offsetY,!p("mousedown",t))if(t.button==c.MxJigCmdManager.MouseButton.kRight&&c.MxJigCmdManager.isRunning())c.MxJigCmdManager.stopCmd();else if(d.MxDrawData.m_isEnableIntelliSelect&&t.button==c.MxJigCmdManager.MouseButton.kLeft&&!c.MxJigCmdManager.isRunning()){var e=t.srcElement;if(e&&"CANVAS"==e.tagName){var n=l.MxManager.getMxObject(e);if(null==n)return;var i=n.screenCoord2World(t.offsetX,t.offsetY,0),r=n.getMxCAD();if(!r)return;var a=!0;r&&r.getGrip().onMouseLBDown(i)&&(a=!1),a&&s.MxFun.sendStringToExecute("Mx_IntelliSel",{pt1:i})}}}function v(t){var e=t||window.event||arguments.callee.caller.arguments[0];if(e&&27==e.keyCode)if(d.MxDrawData.m_isEnableIntelliSelect&&!c.MxJigCmdManager.isRunning()){var n=s.MxFun.getCurrentMxCAD();if(n){var i=n.getSelect().clearAllSelect(),r=n.getGrip().clearAll();(i||r)&&s.MxFun.getCurrentMx().updateDisplay()}}else c.MxJigCmdManager.isRunning()&&c.MxJigCmdManager.stopCmd()}i=n.MxWindowsEvent||(n.MxWindowsEvent={}),r=!1,o=new u.Vector2(0,0),a=new Array,i.addEvent=function(t){a.push(t)},i.getCurrentMousePostion=function(){return o},i.registEvent=function(){r||(r=!0,s.MxFun.isPC()&&(document.addEventListener("mousemove",f,!1),document.addEventListener("mouseup",m,!1),document.addEventListener("mousedown",g,!1),document.onkeydown=v))}},{"./MxDrawData":34,"./MxFun":39,"./MxJigCmdManager":42,"./MxManager":45,"./MxUiVue":58,three:19}],60:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=e("./MxFun");function r(){}(r.CreateMx=function(){i.MxFun.init(),"undefined"!=typeof MxMain&&0==MxMain(e)||i.MxFun.createMxObject();var t=i.MxFun.getUiObject();null!=t&&(t.sTitle=i.MxFun.getCurrentDraw().getOpenFile(),setTimeout(function(){t.init()},400))},r.Main=function(){if("undefined"!=typeof MxUiMain){MxUiMain(e);var t=i.MxFun.getUiObject();null!=t&&t.writeUICSS()}"undefined"==typeof MxDocumentReady?$(document).ready(function(){r.CreateMx()}):MxDocumentReady(e,r.CreateMx)},r).Main()},{"./MxFun":39}]},{},[60]);
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
})));
|