!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.NDSWebViewer=t():e.NDSWebViewer=t()}(window,function(){return n=[function(e,t){var n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,O,L){!function(e){var x=L(19),o=L(20),s=L(21);function n(){return h.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function l(e,t){if(n()=n())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n().toString(16)+" bytes");return 0|e}function u(e,t){if(h.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;var n=(e="string"!=typeof e?""+e:e).length;if(0===n)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return P(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return C(e).length;default:if(i)return P(e).length;t=(""+t).toLowerCase(),i=!0}}function t(e,t,n){var i,r=!1;if((t=void 0===t||t<0?0:t)>this.length)return"";if((n=void 0===n||n>this.length?this.length:n)<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e=e||"utf8";;)switch(e){case"hex":var o=this,a=t,s=n,l=o.length;(!s||s<0||l=e.length){if(r)return-1;n=e.length-1}else if(n<0){if(!r)return-1;n=0}if("string"==typeof t&&(t=h.from(t,i)),h.isBuffer(t))return 0===t.length?-1:m(e,t,n,i,r);if("number"==typeof t)return t&=255,h.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?(r?Uint8Array.prototype.indexOf:Uint8Array.prototype.lastIndexOf).call(e,t,n):m(e,[t],n,i,r);throw new TypeError("val must be string, number or Buffer")}function m(e,t,n,i,r){var o=1,a=e.length,s=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;a/=o=2,s/=2,n/=2}function l(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(r)for(var d=-1,c=n;c>8,r.push(n%256),r.push(i);return r}(t,e.length-n),e,n,i)}function I(e,t,n){n=Math.min(e.length,n);for(var i=[],r=t;r>>10&1023|55296),c=56320|1023&c),i.push(c),r+=h}var u=i,p=u.length;if(p<=A)return String.fromCharCode.apply(String,u);for(var f="",m=0;mt)&&(e+=" ... "),""},h.prototype.compare=function(e,t,n,i,r){if(!h.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===n&&(n=e?e.length:0),void 0===i&&(i=0),void 0===r&&(r=this.length),(t=void 0===t?0:t)<0||n>e.length||i<0||r>this.length)throw new RangeError("out of range index");if(r<=i&&n<=t)return 0;if(r<=i)return-1;if(n<=t)return 1;if(this===e)return 0;for(var o=(r>>>=0)-(i>>>=0),a=(n>>>=0)-(t>>>=0),s=Math.min(o,a),l=this.slice(i,r),d=e.slice(t,n),c=0;cthis.length)throw new RangeError("Attempt to write outside buffer bounds");i=i||"utf8";for(var o,a,s,l=!1;;)switch(i){case"hex":var d=this,c=e,h=t,u=n,p=(h=Number(h)||0,d.length-h);if((!u||p<(u=Number(u)))&&(u=p),(p=c.length)%2!=0)throw new TypeError("Invalid hex string");p/2e.length)throw new RangeError("Index out of range")}function M(e,t,n,i){t<0&&(t=65535+t+1);for(var r=0,o=Math.min(e.length-n,2);r>>8*(i?r:1-r)}function w(e,t,n,i){t<0&&(t=4294967295+t+1);for(var r=0,o=Math.min(e.length-n,4);r>>8*(i?r:3-r)&255}function b(e,t,n,i){if(n+i>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function T(e,t,n,i,r){return r||b(e,0,n,4),o.write(e,t,n,i,23,4),n+4}function S(e,t,n,i,r){return r||b(e,0,n,8),o.write(e,t,n,i,52,8),n+8}h.prototype.slice=function(e,t){var n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):n>>8):M(this,e,t,!0),t+2},h.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||E(this,e,t,2,65535,0),h.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):M(this,e,t,!1),t+2},h.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||E(this,e,t,4,4294967295,0),h.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):w(this,e,t,!0),t+4},h.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||E(this,e,t,4,4294967295,0),h.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):w(this,e,t,!1),t+4},h.prototype.writeIntLE=function(e,t,n,i){e=+e,t|=0,i||E(this,e,t,n,(i=Math.pow(2,8*n-1))-1,-i);var r=0,o=1,a=0;for(this[t]=255&e;++r>0)-a&255;return t+n},h.prototype.writeIntBE=function(e,t,n,i){e=+e,t|=0,i||E(this,e,t,n,(i=Math.pow(2,8*n-1))-1,-i);var r=n-1,o=1,a=0;for(this[t+r]=255&e;0<=--r&&(o*=256);)e<0&&0===a&&0!==this[t+r+1]&&(a=1),this[t+r]=(e/o>>0)-a&255;return t+n},h.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||E(this,e,t,1,127,-128),h.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&(e=e<0?255+e+1:e),t+1},h.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||E(this,e,t,2,32767,-32768),h.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):M(this,e,t,!0),t+2},h.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||E(this,e,t,2,32767,-32768),h.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):M(this,e,t,!1),t+2},h.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||E(this,e,t,4,2147483647,-2147483648),h.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):w(this,e,t,!0),t+4},h.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||E(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),h.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):w(this,e,t,!1),t+4},h.prototype.writeFloatLE=function(e,t,n){return T(this,e,t,!0,n)},h.prototype.writeFloatBE=function(e,t,n){return T(this,e,t,!1,n)},h.prototype.writeDoubleLE=function(e,t,n){return S(this,e,t,!0,n)},h.prototype.writeDoubleBE=function(e,t,n){return S(this,e,t,!1,n)},h.prototype.copy=function(e,t,n,i){if(n=n||0,i||0===i||(i=this.length),t>=e.length&&(t=e.length),(i=0=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length);var r,o=(i=e.length-t>>=0,n=void 0===n?this.length:n>>>0,"number"==typeof(e=e||0))for(s=t;s>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function C(e){return x.toByteArray(function(e){var t;if((e=((t=e).trim?t.trim():t.replace(/^\s+|\s+$/g,"")).replace(B,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function R(e,t,n,i){for(var r=0;r=t.length||r>=e.length);++r)t[r+n]=e[r];return r}}.call(this,L(0))},function(e,t){var n,i,e=e.exports={};function r(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}try{n="function"==typeof setTimeout?setTimeout:r}catch(e){n=r}try{i="function"==typeof clearTimeout?clearTimeout:o}catch(e){i=o}function a(t){if(n===setTimeout)return setTimeout(t,0);if((n===r||!n)&&setTimeout)return(n=setTimeout)(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}var s,l=[],d=!1,c=-1;function h(){d&&s&&(d=!1,s.length?l=s.concat(l):c=-1,l.length)&&u()}function u(){if(!d){for(var e=a(h),t=(d=!0,l.length);t;){for(s=l,l=[];++c>4,o=1>6:64,a=2>2)+u.charAt(r)+u.charAt(o)+u.charAt(a));return s.join("")},n.decode=function(e){var t,n,i,r,o,a=0,s=0;if("data:"===e.substr(0,"data:".length))throw new Error("Invalid base64 input, it looks like a data url.");var l,d=3*(e=e.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(e.charAt(e.length-1)===u.charAt(64)&&d--,e.charAt(e.length-2)===u.charAt(64)&&d--,d%1!=0)throw new Error("Invalid base64 input, bad content length.");for(l=new(c.uint8array?Uint8Array:Array)(0|d);a>4,n=(15&r)<<4|(r=u.indexOf(e.charAt(a++)))>>2,i=(3&r)<<6|(o=u.indexOf(e.charAt(a++))),l[s++]=t,64!==r&&(l[s++]=n),64!==o&&(l[s++]=i);return l}},{"./support":30,"./utils":32}],2:[function(e,t,n){var i=e("./external"),r=e("./stream/DataWorker"),o=e("./stream/Crc32Probe"),a=e("./stream/DataLengthProbe");function s(e,t,n,i,r){this.compressedSize=e,this.uncompressedSize=t,this.crc32=n,this.compression=i,this.compressedContent=r}s.prototype={getContentWorker:function(){var e=new r(i.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new a("data_length")),t=this;return e.on("end",function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),e},getCompressedWorker:function(){return new r(i.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},s.createWorkerFrom=function(e,t,n){return e.pipe(new o).pipe(new a("uncompressedSize")).pipe(t.compressWorker(n)).pipe(new a("compressedSize")).withStreamInfo("compression",t)},t.exports=s},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(e,t,n){var i=e("./stream/GenericWorker");n.STORE={magic:"\0\0",compressWorker:function(){return new i("STORE compression")},uncompressWorker:function(){return new i("STORE decompression")}},n.DEFLATE=e("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(e,t,n){var i=e("./utils"),a=function(){for(var e=[],t=0;t<256;t++){for(var n=t,i=0;i<8;i++)n=1&n?3988292384^n>>>1:n>>>1;e[t]=n}return e}();t.exports=function(e,t){return void 0!==e&&e.length?("string"!==i.getTypeOf(e)?function(e,t,n){var i=a,r=0+n;e^=-1;for(var o=0;o>>8^i[255&(e^t[o])];return-1^e}:function(e,t,n){var i=a,r=0+n;e^=-1;for(var o=0;o>>8^i[255&(e^t.charCodeAt(o))];return-1^e})(0|t,e,e.length):0}},{"./utils":32}],5:[function(e,t,n){n.base64=!1,n.binary=!1,n.dir=!1,n.createFolders=!0,n.date=null,n.compression=null,n.compressionOptions=null,n.comment=null,n.unixPermissions=null,n.dosPermissions=null},{}],6:[function(e,t,n){e="undefined"!=typeof Promise?Promise:e("lie");t.exports={Promise:e}},{lie:37}],7:[function(e,t,n){var i="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,r=e("pako"),o=e("./utils"),a=e("./stream/GenericWorker"),s=i?"uint8array":"array";function l(e,t){a.call(this,"FlateWorker/"+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}n.magic="\b\0",o.inherits(l,a),l.prototype.processChunk=function(e){this.meta=e.meta,null===this._pako&&this._createPako(),this._pako.push(o.transformTo(s,e.data),!1)},l.prototype.flush=function(){a.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},l.prototype.cleanUp=function(){a.prototype.cleanUp.call(this),this._pako=null},l.prototype._createPako=function(){this._pako=new r[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var t=this;this._pako.onData=function(e){t.push({data:e,meta:t.meta})}},n.compressWorker=function(e){return new l("Deflate",e)},n.uncompressWorker=function(){return new l("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(e,t,n){function A(e,t){for(var n="",i=0;i>>=8;return n}function i(e,t,n,i,r,o){var a=e.file,s=e.compression,l=o!==E.utf8encode,d=y.transformTo("string",o(a.name)),c=y.transformTo("string",E.utf8encode(a.name)),h=a.comment,o=y.transformTo("string",o(h)),u=y.transformTo("string",E.utf8encode(h)),p=c.length!==a.name.length,h=u.length!==h.length,f="",m=a.dir,g=a.date,v={crc32:0,compressedSize:0,uncompressedSize:0},n=(t&&!n||(v.crc32=e.crc32,v.compressedSize=e.compressedSize,v.uncompressedSize=e.uncompressedSize),0),e=(t&&(n|=8),l||!p&&!h||(n|=2048),0),t=0,g=(m&&(e|=16),"UNIX"===r?(t=798,e|=(65535&((l=a.unixPermissions)?l:m?16893:33204))<<16):(t=20,e|=63&(a.dosPermissions||0)),r=g.getUTCHours(),r=(r=((r<<=6)|g.getUTCMinutes())<<5)|g.getUTCSeconds()/2,l=g.getUTCFullYear()-1980,l=(l=((l<<=4)|g.getUTCMonth()+1)<<5)|g.getUTCDate(),p&&(m=A(1,1)+A(M(d),4)+c,f+="up"+A(m.length,2)+m),h&&(a=A(1,1)+A(M(o),4)+u,f+="uc"+A(a.length,2)+a),""),g=(g=(g=(g=(g=(g=(g=(g=(g=(g+="\n\0")+A(n,2))+s.magic)+A(r,2))+A(l,2))+A(v.crc32,4))+A(v.compressedSize,4))+A(v.uncompressedSize,4))+A(d.length,2))+A(f.length,2);return{fileRecord:w.LOCAL_FILE_HEADER+g+d+f,dirRecord:w.CENTRAL_FILE_HEADER+A(t,2)+g+A(o.length,2)+"\0\0\0\0"+A(e,4)+A(i,4)+d+f+o}}var y=e("../utils"),r=e("../stream/GenericWorker"),E=e("../utf8"),M=e("../crc32"),w=e("../signature");function o(e,t,n,i){r.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=n,this.encodeFileName=i,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}y.inherits(o,r),o.prototype.push=function(e){var t=e.meta.percent||0,n=this.entriesCount,i=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,r.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:n?(t+100*(n-i-1))/n:100}}))},o.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;t?(e=i(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName),this.push({data:e.fileRecord,meta:{percent:0}})):this.accumulate=!0},o.prototype.closedSource=function(e){this.accumulate=!1;var t=this.streamFiles&&!e.file.dir,n=i(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(n.dirRecord),t)this.push({data:(t=e,w.DATA_DESCRIPTOR+A(t.crc32,4)+A(t.compressedSize,4)+A(t.uncompressedSize,4)),meta:{percent:100}});else for(this.push({data:n.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},o.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t=this.index;t--)n=(n<<8)+this.byteAt(t);return this.index+=e,n},readString:function(e){return i.transformTo("string",this.readData(e))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1))}},t.exports=r},{"../utils":32}],19:[function(e,t,n){var i=e("./Uint8ArrayReader");function r(e){i.call(this,e)}e("../utils").inherits(r,i),r.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=r},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(e,t,n){var i=e("./DataReader");function r(e){i.call(this,e)}e("../utils").inherits(r,i),r.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},r.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},r.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},r.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=r},{"../utils":32,"./DataReader":18}],21:[function(e,t,n){var i=e("./ArrayReader");function r(e){i.call(this,e)}e("../utils").inherits(r,i),r.prototype.readData=function(e){var t;return this.checkOffset(e),0===e?new Uint8Array(0):(t=this.data.subarray(this.zero+this.index,this.zero+this.index+e),this.index+=e,t)},t.exports=r},{"../utils":32,"./ArrayReader":17}],22:[function(e,t,n){var i=e("../utils"),r=e("../support"),o=e("./ArrayReader"),a=e("./StringReader"),s=e("./NodeBufferReader"),l=e("./Uint8ArrayReader");t.exports=function(e){var t=i.getTypeOf(e);return i.checkSupport(t),"string"!==t||r.uint8array?"nodebuffer"===t?new s(e):r.uint8array?new l(i.transformTo("uint8array",e)):new o(i.transformTo("array",e)):new a(e)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(e,t,n){n.LOCAL_FILE_HEADER="PK",n.CENTRAL_FILE_HEADER="PK",n.CENTRAL_DIRECTORY_END="PK",n.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",n.ZIP64_CENTRAL_DIRECTORY_END="PK",n.DATA_DESCRIPTOR="PK\b"},{}],24:[function(e,t,n){var i=e("./GenericWorker"),r=e("../utils");function o(e){i.call(this,"ConvertWorker to "+e),this.destType=e}r.inherits(o,i),o.prototype.processChunk=function(e){this.push({data:r.transformTo(this.destType,e.data),meta:e.meta})},t.exports=o},{"../utils":32,"./GenericWorker":28}],25:[function(e,t,n){var i=e("./GenericWorker"),r=e("../crc32");function o(){i.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}e("../utils").inherits(o,i),o.prototype.processChunk=function(e){this.streamInfo.crc32=r(e.data,this.streamInfo.crc32||0),this.push(e)},t.exports=o},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(e,t,n){var i=e("../utils"),r=e("./GenericWorker");function o(e){r.call(this,"DataLengthProbe for "+e),this.propName=e,this.withStreamInfo(e,0)}i.inherits(o,r),o.prototype.processChunk=function(e){var t;e&&(t=this.streamInfo[this.propName]||0,this.streamInfo[this.propName]=t+e.data.length),r.prototype.processChunk.call(this,e)},t.exports=o},{"../utils":32,"./GenericWorker":28}],27:[function(e,t,n){var i=e("../utils"),r=e("./GenericWorker");function o(e){r.call(this,"DataWorker");var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,e.then(function(e){t.dataIsReady=!0,t.data=e,t.max=e&&e.length||0,t.type=i.getTypeOf(e),t.isPaused||t._tickAndRepeat()},function(e){t.error(e)})}i.inherits(o,r),o.prototype.cleanUp=function(){r.prototype.cleanUp.call(this),this.data=null},o.prototype.resume=function(){return!!r.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,i.delay(this._tickAndRepeat,[],this)),!0)},o.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished)||(i.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0)},o.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=null,t=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":e=this.data.substring(this.index,t);break;case"uint8array":e=this.data.subarray(this.index,t);break;case"array":case"nodebuffer":e=this.data.slice(this.index,t)}return this.index=t,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})},t.exports=o},{"../utils":32,"./GenericWorker":28}],28:[function(e,t,n){function i(e){this.name=e||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}i.prototype={push:function(e){this.emit("data",e)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(e){this.emit("error",e)}return!0},error:function(e){return!this.isFinished&&(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit("error",e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(e,t){if(this._listeners[e])for(var n=0;n "+e:e}},t.exports=i},{}],29:[function(e,t,n){var d=e("../utils"),r=e("./ConvertWorker"),o=e("./GenericWorker"),c=e("../base64"),i=e("../support"),a=e("../external"),s=null;if(i.nodestream)try{s=e("../nodejs/NodejsStreamOutputAdapter")}catch(e){}function l(e,t,n){var i=t;switch(t){case"blob":case"arraybuffer":i="uint8array";break;case"base64":i="string"}try{this._internalType=i,this._outputType=t,this._mimeType=n,d.checkSupport(i),this._worker=e.pipe(new r(i)),e.lock()}catch(e){this._worker=new o("error"),this._worker.error(e)}}l.prototype={accumulate:function(e){return s=this,l=e,new a.Promise(function(t,n){var i=[],r=s._internalType,o=s._outputType,a=s._mimeType;s.on("data",function(e,t){i.push(e),l&&l(t)}).on("error",function(e){i=[],n(e)}).on("end",function(){try{var e=function(e,t,n){switch(e){case"blob":return d.newBlob(d.transformTo("arraybuffer",t),n);case"base64":return c.encode(t);default:return d.transformTo(e,t)}}(o,function(e,t){for(var n=0,i=null,r=0,o=0;o>>6:(n<65536?t[r++]=224|n>>>12:(t[r++]=240|n>>>18,t[r++]=128|n>>>12&63),t[r++]=128|n>>>6&63),t[r++]=128|63&n);return t},r.utf8decode=function(e){if(d.nodebuffer)return l.transformTo("nodebuffer",e).toString("utf-8");for(var t,n,i,r=e=l.transformTo(d.uint8array?"uint8array":"array",e),o=r.length,a=new Array(2*o),s=t=0;s>10&1023,a[t++]=56320|1023&n)}return a.length!==t&&(a.subarray?a=a.subarray(0,t):a.length=t),l.applyFromCharCode(a)},l.inherits(o,n),o.prototype.processChunk=function(e){var t=l.transformTo(d.uint8array?"uint8array":"array",e.data),n=(this.leftOver&&this.leftOver.length&&(d.uint8array?(n=t,(t=new Uint8Array(n.length+this.leftOver.length)).set(this.leftOver,0),t.set(n,this.leftOver.length)):t=this.leftOver.concat(t),this.leftOver=null),function(e,t){for(var n=(t=(t=t||e.length)>e.length?e.length:t)-1;0<=n&&128==(192&e[n]);)n--;return!(n<0)&&0!==n&&n+h[e[n]]>t?n:t}(t)),i=t;n!==t.length&&(d.uint8array?(i=t.subarray(0,n),this.leftOver=t.subarray(n,t.length)):(i=t.slice(0,n),this.leftOver=t.slice(n,t.length))),this.push({data:r.utf8decode(i),meta:e.meta})},o.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:r.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},r.Utf8DecodeWorker=o,l.inherits(a,n),a.prototype.processChunk=function(e){this.push({data:r.utf8encode(e.data),meta:e.meta})},r.Utf8EncodeWorker=a},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(e,t,a){var s=e("./support"),l=e("./base64"),n=e("./nodejsUtils"),d=e("./external");function i(e){return e}function c(e,t){for(var n=0;n>8;this.dir=!!(16&this.externalFileAttributes),0==e&&(this.dosPermissions=63&this.externalFileAttributes),3==e&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(){var e;this.extraFields[1]&&(e=i(this.extraFields[1].value),this.uncompressedSize===r.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===r.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===r.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===r.MAX_VALUE_32BITS)&&(this.diskNumberStart=e.readInt(4))},readExtraFields:function(e){var t,n,i,r=e.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});e.index+4>>6:(n<65536?t[r++]=224|n>>>12:(t[r++]=240|n>>>18,t[r++]=128|n>>>12&63),t[r++]=128|n>>>6&63),t[r++]=128|63&n);return t},n.buf2binstring=function(e){return c(e,e.length)},n.binstring2buf=function(e){for(var t=new l.Buf8(e.length),n=0,i=t.length;n>10&1023,a[n++]=56320|1023&i)}return c(a,n)},n.utf8border=function(e,t){for(var n=(t=(t=t||e.length)>e.length?e.length:t)-1;0<=n&&128==(192&e[n]);)n--;return!(n<0)&&0!==n&&n+d[e[n]]>t?n:t}},{"./common":41}],43:[function(e,t,n){t.exports=function(e,t,n,i){for(var r=65535&e|0,o=e>>>16&65535|0,a=0;0!==n;){for(n-=a=2e3>>1:n>>>1;e[t]=n}return e}();t.exports=function(e,t,n,i){var r=s,o=i+n;e^=-1;for(var a=i;a>>8^r[255&(e^t[a])];return-1^e}},{}],46:[function(e,F,t){var s,h=e("../utils/common"),l=e("./trees"),u=e("./adler32"),p=e("./crc32"),n=e("./messages"),d=0,c=0,f=-2,i=2,m=8,r=286,o=30,a=19,N=2*r+1,j=15,g=3,v=258,A=v+g+1,y=42,E=113;function M(e,t){return e.msg=n[t],t}function w(e){return(e<<1)-(4e.avail_out?e.avail_out:n)&&(h.arraySet(e.output,t.pending_buf,t.pending_out,n,e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,0===t.pending)&&(t.pending_out=0)}function I(e,t){l._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,x(e.strm)}function T(e,t){e.pending_buf[e.pending++]=t}function S(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function B(e,t){var n,i,r=e.max_chain_length,o=e.strstart,a=e.prev_length,s=e.nice_match,l=e.strstart>e.w_size-A?e.strstart-(e.w_size-A):0,d=e.window,c=e.w_mask,h=e.prev,u=e.strstart+v,p=d[o+a-1],f=d[o+a];e.prev_length>=e.good_match&&(r>>=2),s>e.lookahead&&(s=e.lookahead);do{if(d[(n=t)+a]===f&&d[n+a-1]===p&&d[n]===d[o]&&d[++n]===d[o+1]){for(o+=2,n++;d[++o]===d[++n]&&d[++o]===d[++n]&&d[++o]===d[++n]&&d[++o]===d[++n]&&d[++o]===d[++n]&&d[++o]===d[++n]&&d[++o]===d[++n]&&d[++o]===d[++n]&&ol&&0!=--r);return a<=e.lookahead?a:e.lookahead}function P(e){var t,n,i,r,o,a,s,l,d,c=e.w_size;do{if(l=e.window_size-e.lookahead-e.strstart,e.strstart>=c+(c-A)){for(h.arraySet(e.window,e.window,c,c,0),e.match_start-=c,e.strstart-=c,e.block_start-=c,t=n=e.hash_size;i=e.head[--t],e.head[t]=c<=i?i-c:0,--n;);for(t=n=c;i=e.prev[--t],e.prev[t]=c<=i?i-c:0,--n;);l+=c}if(0===e.strm.avail_in)break;if(o=e.strm,a=e.window,s=e.strstart+e.lookahead,d=void 0,n=0===(d=(l=l)<(d=o.avail_in)?l:d)?0:(o.avail_in-=d,h.arraySet(a,o.input,o.next_in,d,s),1===o.state.wrap?o.adler=u(o.adler,a,d,s):2===o.state.wrap&&(o.adler=p(o.adler,a,d,s)),o.next_in+=d,o.total_in+=d,d),e.lookahead+=n,e.lookahead+e.insert>=g)for(r=e.strstart-e.insert,e.ins_h=e.window[r],e.ins_h=(e.ins_h<=g&&(e.ins_h=(e.ins_h<=g)if(i=l._tr_tally(e,e.strstart-e.match_start,e.match_length-g),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=g){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<=g&&(e.ins_h=(e.ins_h<=g&&e.match_length<=e.prev_length){for(r=e.strstart+e.lookahead-g,i=l._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-g),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=r&&(e.ins_h=(e.ins_h<e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(P(e),0===e.lookahead&&t===d)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var i=e.block_start+n;if((0===e.strstart||e.strstart>=i)&&(e.lookahead=e.strstart-i,e.strstart=i,I(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-A&&(I(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(I(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(I(e,!1),e.strm.avail_out),1)}),new O(4,4,8,4,C),new O(4,5,16,8,C),new O(4,6,32,32,C),new O(4,4,16,16,R),new O(8,16,32,32,R),new O(8,16,128,128,R),new O(8,32,128,256,R),new O(32,128,258,1024,R),new O(32,258,258,4096,R)],t.deflateInit=function(e,t){return H(e,t,m,15,8,0)},t.deflateInit2=H,t.deflateReset=D,t.deflateResetKeep=L,t.deflateSetHeader=function(e,t){return!e||!e.state||2!==e.state.wrap?f:(e.state.gzhead=t,c)},t.deflate=function(e,t){var n,i,r,o;if(!e||!e.state||5>8&255),T(i,i.gzhead.time>>16&255),T(i,i.gzhead.time>>24&255),T(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),T(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(T(i,255&i.gzhead.extra.length),T(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=p(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(T(i,0),T(i,0),T(i,0),T(i,0),T(i,0),T(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),T(i,3),i.status=E)):(a=m+(i.w_bits-8<<4)<<8,a|=(2<=i.strategy||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(a|=32),a+=31-a%31,i.status=E,S(i,a),0!==i.strstart&&(S(i,e.adler>>>16),S(i,65535&e.adler)),e.adler=1)),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&&(e.adler=p(e.adler,i.pending_buf,i.pending-r,r)),x(e),r=i.pending,i.pending!==i.pending_buf_size));)T(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>r&&(e.adler=p(e.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&&(e.adler=p(e.adler,i.pending_buf,i.pending-r,r)),x(e),r=i.pending,i.pending===i.pending_buf_size)){o=1;break}}while(o=i.gzindexr&&(e.adler=p(e.adler,i.pending_buf,i.pending-r,r)),0===o&&(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&&(e.adler=p(e.adler,i.pending_buf,i.pending-r,r)),x(e),r=i.pending,i.pending===i.pending_buf_size)){o=1;break}}while(o=i.gzindexr&&(e.adler=p(e.adler,i.pending_buf,i.pending-r,r)),0===o&&(i.status=103)}else i.status=103;if(103===i.status&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&x(e),i.pending+2<=i.pending_buf_size&&(T(i,255&e.adler),T(i,e.adler>>8&255),e.adler=0,i.status=E)):i.status=E),0!==i.pending){if(x(e),0===e.avail_out)return i.last_flush=-1,c}else if(0===e.avail_in&&w(t)<=w(n)&&4!==t)return M(e,-5);if(666===i.status&&0!==e.avail_in)return M(e,-5);if(0!==e.avail_in||0!==i.lookahead||t!==d&&666!==i.status){var a=2===i.strategy?function(e,t){for(var n;;){if(0===e.lookahead&&(P(e),0===e.lookahead)){if(t===d)return 1;break}if(e.match_length=0,n=l._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(I(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(I(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(I(e,!1),0===e.strm.avail_out)?1:2}(i,t):3===i.strategy?function(e,t){for(var n,i,r,o,a=e.window;;){if(e.lookahead<=v){if(P(e),e.lookahead<=v&&t===d)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=g&&0e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=g?(n=l._tr_tally(e,1,e.match_length-g),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=l._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(I(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(I(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(I(e,!1),0===e.strm.avail_out)?1:2}(i,t):s[i.level].func(i,t);if(3!==a&&4!==a||(i.status=666),1===a||3===a)return 0===e.avail_out&&(i.last_flush=-1),c;if(2===a&&(1===t?l._tr_align(i):5!==t&&(l._tr_stored_block(i,0,0,!1),3===t)&&(b(i.head),0===i.lookahead)&&(i.strstart=0,i.block_start=0,i.insert=0),x(e),0===e.avail_out))return i.last_flush=-1,c}return 4!==t||!(i.wrap<=0)&&(2===i.wrap?(T(i,255&e.adler),T(i,e.adler>>8&255),T(i,e.adler>>16&255),T(i,e.adler>>24&255),T(i,255&e.total_in),T(i,e.total_in>>8&255),T(i,e.total_in>>16&255),T(i,e.total_in>>24&255)):(S(i,e.adler>>>16),S(i,65535&e.adler)),x(e),0=n.w_size&&(0===o&&(b(n.head),n.strstart=0,n.block_start=0,n.insert=0),l=new h.Buf8(n.w_size),h.arraySet(l,t,d-n.w_size,n.w_size,0),t=l,d=n.w_size),l=e.avail_in,a=e.next_in,s=e.input,e.avail_in=d,e.next_in=0,e.input=t,P(n);n.lookahead>=g;){for(i=n.strstart,r=n.lookahead-(g-1);n.ins_h=(n.ins_h<>>=i=n>>>24,w-=i,0==(i=n>>>16&255))p[u++]=65535&n;else{if(!(16&i)){if(0==(64&i)){n=b[(65535&n)+(M&(1<>>=i,w-=i),w<15&&(M+=c[d++]<>>=i=n>>>24,w-=i,!(16&(i=n>>>16&255))){if(0==(64&i)){n=x[(65535&n)+(M&(1<>>=i,w-=i,(i=u-f)>3,M&=(1<<(w-=r<<3))-1,e.next_in=d,e.next_out=u,e.avail_in=d>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function o(){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 R.Buf16(320),this.work=new R.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function a(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=j,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new R.Buf32(i),t.distcode=t.distdyn=new R.Buf32(r),t.sane=1,t.back=-1,F):N}function s(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,a(e)):N}function l(e,t){var n,i;return!e||!e.state||(i=e.state,t<0?(n=0,t=-t):(n=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15=e.wsize?(R.arraySet(e.window,t,n-e.wsize,e.wsize,0),e.wnext=0,e.whave=e.wsize):(i<(r=e.wsize-e.wnext)&&(r=i),R.arraySet(e.window,t,n-i,r,e.wnext),(i-=r)?(R.arraySet(e.window,t,n-i,i,0),e.wnext=i,e.whave=e.wsize):(e.wnext+=r,e.wnext===e.wsize&&(e.wnext=0),e.whave>>8&255,n.check=L(n.check,S,2,0),c=d=0,n.mode=2;else if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&d)<<8)+(d>>8))%31)e.msg="incorrect header check",n.mode=30;else if(8!=(15&d))e.msg="unknown compression method",n.mode=30;else{if(c-=4,w=8+(15&(d>>>=4)),0===n.wbits)n.wbits=w;else if(w>n.wbits){e.msg="invalid window size",n.mode=30;break}n.dmax=1<>8&1),512&n.flags&&(S[0]=255&d,S[1]=d>>>8&255,n.check=L(n.check,S,2,0)),c=d=0,n.mode=3;case 3:for(;c<32;){if(0===s)break e;s--,d+=i[o++]<>>8&255,S[2]=d>>>16&255,S[3]=d>>>24&255,n.check=L(n.check,S,4,0)),c=d=0,n.mode=4;case 4:for(;c<16;){if(0===s)break e;s--,d+=i[o++]<>8),512&n.flags&&(S[0]=255&d,S[1]=d>>>8&255,n.check=L(n.check,S,2,0)),c=d=0,n.mode=5;case 5:if(1024&n.flags){for(;c<16;){if(0===s)break e;s--,d+=i[o++]<>>8&255,n.check=L(n.check,S,2,0)),c=d=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&((p=s<(p=n.length)?s:p)&&(n.head&&(w=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),R.arraySet(n.head.extra,i,o,p,w)),512&n.flags&&(n.check=L(n.check,i,p,o)),s-=p,o+=p,n.length-=p),n.length))break e;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(0===s)break e;for(p=0;w=i[o+p++],n.head&&w&&n.length<65536&&(n.head.name+=String.fromCharCode(w)),w&&p>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=12;break;case 10:for(;c<32;){if(0===s)break e;s--,d+=i[o++]<>>=7&c,c-=7&c,n.mode=27;else{for(;c<3;){if(0===s)break e;s--,d+=i[o++]<>>=1)){case 0:n.mode=14;break;case 1:P=C=void 0;var P,C=n;if(U){for(V=new R.Buf32(512),k=new R.Buf32(32),P=0;P<144;)C.lens[P++]=8;for(;P<256;)C.lens[P++]=9;for(;P<280;)C.lens[P++]=7;for(;P<288;)C.lens[P++]=8;for(H(1,C.lens,0,288,V,0,C.work,{bits:9}),P=0;P<32;)C.lens[P++]=5;H(2,C.lens,0,32,k,0,C.work,{bits:5}),U=!1}if(C.lencode=V,C.lenbits=9,C.distcode=k,C.distbits=5,n.mode=20,6!==t)break;d>>>=2,c-=2;break e;case 2:n.mode=17;break;case 3:e.msg="invalid block type",n.mode=30}d>>>=2,c-=2}break;case 14:for(d>>>=7&c,c-=7&c;c<32;){if(0===s)break e;s--,d+=i[o++]<>>16^65535)){e.msg="invalid stored block lengths",n.mode=30;break}if(n.length=65535&d,c=d=0,n.mode=15,6===t)break e;case 15:n.mode=16;case 16:if(p=n.length){if(0===(p=l<(p=s>>=5,c-=5,n.ndist=1+(31&d),d>>>=5,c-=5,n.ncode=4+(15&d),d>>>=4,c-=4,286>>=3,c-=3}for(;n.have<19;)n.lens[B[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,x={bits:n.lenbits},b=H(0,n.lens,0,19,n.lencode,0,n.work,x),n.lenbits=x.bits,b){e.msg="invalid code lengths set",n.mode=30;break}n.have=0,n.mode=19;case 19:for(;n.have>>16&255,A=65535&T,!((g=T>>>24)<=c);){if(0===s)break e;s--,d+=i[o++]<>>=g,c-=g,n.lens[n.have++]=A;else{if(16===A){for(I=g+2;c>>=g,c-=g,0===n.have){e.msg="invalid bit length repeat",n.mode=30;break}w=n.lens[n.have-1],p=3+(3&d),d>>>=2,c-=2}else if(17===A){for(I=g+3;c>>=g)),d>>>=3,c=c-g-3}else{for(I=g+7;c>>=g)),d>>>=7,c=c-g-7}if(n.have+p>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=30;break}for(;p--;)n.lens[n.have++]=w}}if(30===n.mode)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=30;break}if(n.lenbits=9,x={bits:n.lenbits},b=H(1,n.lens,0,n.nlen,n.lencode,0,n.work,x),n.lenbits=x.bits,b){e.msg="invalid literal/lengths set",n.mode=30;break}if(n.distbits=6,n.distcode=n.distdyn,x={bits:n.distbits},b=H(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,x),n.distbits=x.bits,b){e.msg="invalid distances set",n.mode=30;break}if(n.mode=20,6===t)break e;case 20:n.mode=21;case 21:if(6<=s&&258<=l){e.next_out=a,e.avail_out=l,e.next_in=o,e.avail_in=s,n.hold=d,n.bits=c,D(e,u),a=e.next_out,r=e.output,l=e.avail_out,o=e.next_in,i=e.input,s=e.avail_in,d=n.hold,c=n.bits,12===n.mode&&(n.back=-1);break}for(n.back=0;v=(T=n.lencode[d&(1<>>16&255,A=65535&T,!((g=T>>>24)<=c);){if(0===s)break e;s--,d+=i[o++]<>y)])>>>16&255,A=65535&T,!(y+(g=T>>>24)<=c);){if(0===s)break e;s--,d+=i[o++]<>>=y,c-=y,n.back+=y}if(d>>>=g,c-=g,n.back+=g,n.length=A,0===v){n.mode=26;break}if(32&v){n.back=-1,n.mode=12;break}if(64&v){e.msg="invalid literal/length code",n.mode=30;break}n.extra=15&v,n.mode=22;case 22:if(n.extra){for(I=n.extra;c>>=n.extra,c-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;v=(T=n.distcode[d&(1<>>16&255,A=65535&T,!((g=T>>>24)<=c);){if(0===s)break e;s--,d+=i[o++]<>y)])>>>16&255,A=65535&T,!(y+(g=T>>>24)<=c);){if(0===s)break e;s--,d+=i[o++]<>>=y,c-=y,n.back+=y}if(d>>>=g,c-=g,n.back+=g,64&v){e.msg="invalid distance code",n.mode=30;break}n.offset=A,n.extra=15&v,n.mode=24;case 24:if(n.extra){for(I=n.extra;c>>=n.extra,c-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=30;break}n.mode=25;case 25:if(0===l)break e;if(n.offset>(p=u-l)){if((p=n.offset-p)>n.whave&&n.sane){e.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=a-n.offset,p=n.length;for(l-=p=lp?(m=O[L+a[y]],B[P+a[y]]):(m=96,0),l=1<<(f=A-x),E=d=1<>x)+(d-=l)]=f<<24|m<<16|g|0,0!==d;);for(l=1<>=1;if(0!==l?S=(S&l-1)+l:S=0,y++,0==--C[A]){if(A===M)break;A=t[n+a[y]]}if(w>>7)]}function o(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function b(e,t,n){e.bi_valid>i-n?(e.bi_buf|=t<>i-e.bi_valid,e.bi_valid+=n-i):(e.bi_buf|=t<>>=1,n<<=1,0<--t;);return n>>>1}function T(e,t,n){for(var i,r=new Array(16),o=0,a=1;a<=15;a++)r[a]=o=o+n[a-1]<<1;for(i=0;i<=t;i++){var s=e[2*i+1];0!==s&&(e[2*i]=I(r[s]++,s))}}function S(e){for(var t=0;t<286;t++)e.dyn_ltree[2*t]=0;for(t=0;t<30;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function B(e){8>1;1<=n;n--)P(e,o,n);for(r=l;n=e.heap[1],e.heap[1]=e.heap[e.heap_len--],P(e,o,1),i=e.heap[1],e.heap[--e.heap_max]=n,e.heap[--e.heap_max]=i,o[2*r]=o[2*n]+o[2*i],e.depth[r]=(e.depth[n]>=e.depth[i]?e.depth[n]:e.depth[i])+1,o[2*n+1]=o[2*i+1]=r,e.heap[1]=r++,P(e,o,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1];for(var c,h,u,p,f,m=e,g=t.dyn_tree,v=t.max_code,A=t.stat_desc.static_tree,y=t.stat_desc.has_stree,E=t.stat_desc.extra_bits,M=t.stat_desc.extra_base,w=t.stat_desc.max_length,b=0,x=0;x<=15;x++)m.bl_count[x]=0;for(g[2*m.heap[m.heap_max]+1]=0,c=m.heap_max+1;c<573;c++)w<(x=g[2*g[2*(h=m.heap[c])+1]+1]+1)&&(x=w,b++),g[2*h+1]=x,v>=7;a<30;a++)for(y[a]=r<<7,t=0;t<1<>>=1)if(1&t&&0!==e.dyn_ltree[2*n])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(n=32;n<256;n++)if(0!==e.dyn_ltree[2*n])return 1;return 0}(e)),R(e,e.l_desc),R(e,e.d_desc),s=function(e){var t;for(O(e,e.dyn_ltree,e.l_desc.max_code),O(e,e.dyn_dtree,e.d_desc.max_code),R(e,e.bl_desc),t=18;3<=t&&0===e.bl_tree[2*c[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),r=e.opt_len+3+7>>>3,(o=e.static_len+3+7>>>3)<=r&&(r=o)):r=o=n+5,n+4<=r&&-1!==t)H(e,t,n,i);else if(4===e.strategy||o===r)b(e,2+(i?1:0),3),C(e,h,u);else{b(e,4+(i?1:0),3);var l=e,d=(t=e.l_desc.max_code+1,n=e.d_desc.max_code+1,s+1);for(b(l,t-257,5),b(l,n-1,5),b(l,d-4,4),a=0;a>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&n,e.last_lit++,0===t?e.dyn_ltree[2*n]++:(e.matches++,t--,e.dyn_ltree[2*(f[n]+256+1)]++,e.dyn_dtree[2*w(t)]++),e.last_lit===e.lit_bufsize-1},t._tr_align=function(e){b(e,2,3),x(e,256,h),16===(e=e).bi_valid?(o(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":41}],53:[function(e,t,n){t.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}},{}],54:[function(e,t,n){!function(e){function r(e){delete c[e]}function o(e){if(h)setTimeout(o,0,e);else{var t=c[e];if(t){h=!0;try{var n=t.callback,i=t.args;switch(i.length){case 0:n();break;case 1:n(i[0]);break;case 2:n(i[0],i[1]);break;case 3:n(i[0],i[1],i[2]);break;default:n.apply(a,i)}}finally{r(e),h=!1}}}}function t(e){e.source===n&&"string"==typeof e.data&&0===e.data.indexOf(l)&&o(+e.data.slice(l.length))}var n,a,i,s,l,d,c,h,u,p;(n="undefined"==typeof self?void 0===e?this:e:self).setImmediate||(d=1,h=!(c={}),u=n.document,e=(e=Object.getPrototypeOf&&Object.getPrototypeOf(n))&&e.setTimeout?e:n,p="[object process]"==={}.toString.call(n.process)?function(e){f.nextTick(function(){o(e)})}:function(){var e,t;if(n.postMessage&&!n.importScripts)return e=!0,t=n.onmessage,n.onmessage=function(){e=!1},n.postMessage("","*"),n.onmessage=t,e}()?(l="setImmediate$"+Math.random()+"$",n.addEventListener?n.addEventListener("message",t,!1):n.attachEvent("onmessage",t),function(e){n.postMessage(l+e,"*")}):n.MessageChannel?((s=new MessageChannel).port1.onmessage=function(e){o(e.data)},function(e){s.port2.postMessage(e)}):u&&"onreadystatechange"in u.createElement("script")?(i=u.documentElement,function(e){var t=u.createElement("script");t.onreadystatechange=function(){o(e),t.onreadystatechange=null,i.removeChild(t),t=null},i.appendChild(t)}):function(e){setTimeout(o,0,e)},e.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n>>6:(n<65536?t[r++]=224|n>>>12:(t[r++]=240|n>>>18,t[r++]=128|n>>>12&63),t[r++]=128|n>>>6&63),t[r++]=128|63&n);return t},n.buf2binstring=function(e){return c(e,e.length)},n.binstring2buf=function(e){for(var t=new l.Buf8(e.length),n=0,i=t.length;n>10&1023,o[a++]=56320|1023&n)}return c(o,a)},n.utf8border=function(e,t){for(var n=(t=(t=t||e.length)>e.length?e.length:t)-1;0<=n&&128==(192&e[n]);)n--;return!(n<0)&&0!==n&&n+d[e[n]]>t?n:t}},{"./common":3}],5:[function(e,t,n){t.exports=function(e,t,n,i){for(var r=65535&e|0,o=e>>>16&65535|0,a=0;0!==n;){for(n-=a=2e3>>1:n>>>1;e[t]=n}return e}();t.exports=function(e,t,n,i){var r=s,o=i+n;e^=-1;for(var a=i;a>>8^r[255&(e^t[a])];return-1^e}},{}],8:[function(e,F,t){var s,h=e("../utils/common"),l=e("./trees"),u=e("./adler32"),p=e("./crc32"),N=e("./messages"),d=0,c=4,f=0,m=-2,j=-1,_=4,V=2,g=8,k=9,n=286,U=30,G=19,z=2*n+1,W=15,v=3,A=258,y=A+v+1,E=42,M=113,w=1,b=2,x=3,I=4;function T(e,t){return e.msg=N[t],t}function S(e){return(e<<1)-(4e.avail_out?e.avail_out:n)&&(h.arraySet(e.output,t.pending_buf,t.pending_out,n,e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,0===t.pending)&&(t.pending_out=0)}function C(e,t){l._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,P(e.strm)}function R(e,t){e.pending_buf[e.pending++]=t}function O(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function o(e,t){var n,i,r=e.max_chain_length,o=e.strstart,a=e.prev_length,s=e.nice_match,l=e.strstart>e.w_size-y?e.strstart-(e.w_size-y):0,d=e.window,c=e.w_mask,h=e.prev,u=e.strstart+A,p=d[o+a-1],f=d[o+a];e.prev_length>=e.good_match&&(r>>=2),s>e.lookahead&&(s=e.lookahead);do{if(d[(n=t)+a]===f&&d[n+a-1]===p&&d[n]===d[o]&&d[++n]===d[o+1]){for(o+=2,n++;d[++o]===d[++n]&&d[++o]===d[++n]&&d[++o]===d[++n]&&d[++o]===d[++n]&&d[++o]===d[++n]&&d[++o]===d[++n]&&d[++o]===d[++n]&&d[++o]===d[++n]&&ol&&0!=--r);return a<=e.lookahead?a:e.lookahead}function L(e){var t,n,i,r,o,a,s,l,d,c=e.w_size;do{if(l=e.window_size-e.lookahead-e.strstart,e.strstart>=c+(c-y)){for(h.arraySet(e.window,e.window,c,c,0),e.match_start-=c,e.strstart-=c,e.block_start-=c,t=n=e.hash_size;i=e.head[--t],e.head[t]=c<=i?i-c:0,--n;);for(t=n=c;i=e.prev[--t],e.prev[t]=c<=i?i-c:0,--n;);l+=c}if(0===e.strm.avail_in)break;if(o=e.strm,a=e.window,s=e.strstart+e.lookahead,l=l,d=void 0,d=o.avail_in,n=0===(d=l=v)for(r=e.strstart-e.insert,e.ins_h=e.window[r],e.ins_h=(e.ins_h<=v&&(e.ins_h=(e.ins_h<=v)if(i=l._tr_tally(e,e.strstart-e.match_start,e.match_length-v),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=v){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<=v&&(e.ins_h=(e.ins_h<=v&&e.match_length<=e.prev_length){for(r=e.strstart+e.lookahead-v,i=l._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-v),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=r&&(e.ins_h=(e.ins_h<e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(L(e),0===e.lookahead&&t===d)return w;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var i=e.block_start+n;if((0===e.strstart||e.strstart>=i)&&(e.lookahead=e.strstart-i,e.strstart=i,C(e,!1),0===e.strm.avail_out))return w;if(e.strstart-e.block_start>=e.w_size-y&&(C(e,!1),0===e.strm.avail_out))return w}return e.insert=0,t===c?(C(e,!0),0===e.strm.avail_out?x:I):(e.strstart>e.block_start&&(C(e,!1),e.strm.avail_out),w)}),new a(4,4,8,4,i),new a(4,5,16,8,i),new a(4,6,32,32,i),new a(4,4,16,16,r),new a(8,16,32,32,r),new a(8,16,128,128,r),new a(8,32,128,256,r),new a(32,128,258,1024,r),new a(32,258,258,4096,r)],t.deflateInit=function(e,t){return X(e,t,g,15,8,0)},t.deflateInit2=X,t.deflateReset=H,t.deflateResetKeep=D,t.deflateSetHeader=function(e,t){return!e||!e.state||2!==e.state.wrap?m:(e.state.gzhead=t,f)},t.deflate=function(e,t){var n,i,r,o;if(!e||!e.state||5>8&255),R(i,i.gzhead.time>>16&255),R(i,i.gzhead.time>>24&255),R(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),R(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(R(i,255&i.gzhead.extra.length),R(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=p(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(R(i,0),R(i,0),R(i,0),R(i,0),R(i,0),R(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),R(i,3),i.status=M)):(a=g+(i.w_bits-8<<4)<<8,a|=(2<=i.strategy||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(a|=32),a+=31-a%31,i.status=M,O(i,a),0!==i.strstart&&(O(i,e.adler>>>16),O(i,65535&e.adler)),e.adler=1)),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&&(e.adler=p(e.adler,i.pending_buf,i.pending-r,r)),P(e),r=i.pending,i.pending!==i.pending_buf_size));)R(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>r&&(e.adler=p(e.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&&(e.adler=p(e.adler,i.pending_buf,i.pending-r,r)),P(e),r=i.pending,i.pending===i.pending_buf_size)){o=1;break}}while(o=i.gzindexr&&(e.adler=p(e.adler,i.pending_buf,i.pending-r,r)),0===o&&(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&&(e.adler=p(e.adler,i.pending_buf,i.pending-r,r)),P(e),r=i.pending,i.pending===i.pending_buf_size)){o=1;break}}while(o=i.gzindexr&&(e.adler=p(e.adler,i.pending_buf,i.pending-r,r)),0===o&&(i.status=103)}else i.status=103;if(103===i.status&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&P(e),i.pending+2<=i.pending_buf_size&&(R(i,255&e.adler),R(i,e.adler>>8&255),e.adler=0,i.status=M)):i.status=M),0!==i.pending){if(P(e),0===e.avail_out)return i.last_flush=-1,f}else if(0===e.avail_in&&S(t)<=S(n)&&t!==c)return T(e,-5);if(666===i.status&&0!==e.avail_in)return T(e,-5);if(0!==e.avail_in||0!==i.lookahead||t!==d&&666!==i.status){var a=2===i.strategy?function(e,t){for(var n;;){if(0===e.lookahead&&(L(e),0===e.lookahead)){if(t===d)return w;break}if(e.match_length=0,n=l._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(C(e,!1),0===e.strm.avail_out))return w}return e.insert=0,t===c?(C(e,!0),0===e.strm.avail_out?x:I):e.last_lit&&(C(e,!1),0===e.strm.avail_out)?w:b}(i,t):3===i.strategy?function(e,t){for(var n,i,r,o,a=e.window;;){if(e.lookahead<=A){if(L(e),e.lookahead<=A&&t===d)return w;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=v&&0e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=v?(n=l._tr_tally(e,1,e.match_length-v),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=l._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(C(e,!1),0===e.strm.avail_out))return w}return e.insert=0,t===c?(C(e,!0),0===e.strm.avail_out?x:I):e.last_lit&&(C(e,!1),0===e.strm.avail_out)?w:b}(i,t):s[i.level].func(i,t);if(a!==x&&a!==I||(i.status=666),a===w||a===x)return 0===e.avail_out&&(i.last_flush=-1),f;if(a===b&&(1===t?l._tr_align(i):5!==t&&(l._tr_stored_block(i,0,0,!1),3===t)&&(B(i.head),0===i.lookahead)&&(i.strstart=0,i.block_start=0,i.insert=0),P(e),0===e.avail_out))return i.last_flush=-1,f}return t!==c||!(i.wrap<=0)&&(2===i.wrap?(R(i,255&e.adler),R(i,e.adler>>8&255),R(i,e.adler>>16&255),R(i,e.adler>>24&255),R(i,255&e.total_in),R(i,e.total_in>>8&255),R(i,e.total_in>>16&255),R(i,e.total_in>>24&255)):(O(i,e.adler>>>16),O(i,65535&e.adler)),P(e),0=n.w_size&&(0===o&&(B(n.head),n.strstart=0,n.block_start=0,n.insert=0),l=new h.Buf8(n.w_size),h.arraySet(l,t,d-n.w_size,n.w_size,0),t=l,d=n.w_size),l=e.avail_in,a=e.next_in,s=e.input,e.avail_in=d,e.next_in=0,e.input=t,L(n);n.lookahead>=v;){for(i=n.strstart,r=n.lookahead-(v-1);n.ins_h=(n.ins_h<>>=i=n>>>24,w-=i,0===(i=n>>>16&255))p[u++]=65535&n;else{if(!(16&i)){if(0==(64&i)){n=b[(65535&n)+(M&(1<>>=i,w-=i),w<15&&(M+=c[d++]<>>=i=n>>>24,w-=i,!(16&(i=n>>>16&255))){if(0==(64&i)){n=x[(65535&n)+(M&(1<>>=i,w-=i,(i=u-f)>3)<<3))-1,e.next_in=d-=r,e.next_out=u,e.avail_in=d>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function o(){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 R.Buf16(320),this.work=new R.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function a(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=V,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new R.Buf32(i),t.distcode=t.distdyn=new R.Buf32(r),t.sane=1,t.back=-1,j):_}function s(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,a(e)):_}function l(e,t){var n,i;return!e||!e.state||(i=e.state,t<0?(n=0,t=-t):(n=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15=e.wsize?(R.arraySet(e.window,t,n-e.wsize,e.wsize,0),e.wnext=0,e.whave=e.wsize):(i<(r=e.wsize-e.wnext)&&(r=i),R.arraySet(e.window,t,n-i,r,e.wnext),(i-=r)?(R.arraySet(e.window,t,n-i,i,0),e.wnext=i,e.whave=e.wsize):(e.wnext+=r,e.wnext===e.wsize&&(e.wnext=0),e.whave>>8&255,n.check=L(n.check,S,2,0),c=d=0,n.mode=2;else if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&d)<<8)+(d>>8))%31)e.msg="incorrect header check",n.mode=30;else if(8!=(15&d))e.msg="unknown compression method",n.mode=30;else{if(c-=4,w=8+(15&(d>>>=4)),0===n.wbits)n.wbits=w;else if(w>n.wbits){e.msg="invalid window size",n.mode=30;break}n.dmax=1<>8&1),512&n.flags&&(S[0]=255&d,S[1]=d>>>8&255,n.check=L(n.check,S,2,0)),c=d=0,n.mode=3;case 3:for(;c<32;){if(0===s)break e;s--,d+=i[o++]<>>8&255,S[2]=d>>>16&255,S[3]=d>>>24&255,n.check=L(n.check,S,4,0)),c=d=0,n.mode=4;case 4:for(;c<16;){if(0===s)break e;s--,d+=i[o++]<>8),512&n.flags&&(S[0]=255&d,S[1]=d>>>8&255,n.check=L(n.check,S,2,0)),c=d=0,n.mode=5;case 5:if(1024&n.flags){for(;c<16;){if(0===s)break e;s--,d+=i[o++]<>>8&255,n.check=L(n.check,S,2,0)),c=d=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&((p=s<(p=n.length)?s:p)&&(n.head&&(w=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),R.arraySet(n.head.extra,i,o,p,w)),512&n.flags&&(n.check=L(n.check,i,p,o)),s-=p,o+=p,n.length-=p),n.length))break e;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(0===s)break e;for(p=0;w=i[o+p++],n.head&&w&&n.length<65536&&(n.head.name+=String.fromCharCode(w)),w&&p>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=12;break;case 10:for(;c<32;){if(0===s)break e;s--,d+=i[o++]<>>=7&c,c-=7&c,n.mode=27;else{for(;c<3;){if(0===s)break e;s--,d+=i[o++]<>>=1)){case 0:n.mode=14;break;case 1:P=C=void 0;var P,C=n;if(z){for(U=new R.Buf32(512),G=new R.Buf32(32),P=0;P<144;)C.lens[P++]=8;for(;P<256;)C.lens[P++]=9;for(;P<280;)C.lens[P++]=7;for(;P<288;)C.lens[P++]=8;for(H(F,C.lens,0,288,U,0,C.work,{bits:9}),P=0;P<32;)C.lens[P++]=5;H(N,C.lens,0,32,G,0,C.work,{bits:5}),z=!1}if(C.lencode=U,C.lenbits=9,C.distcode=G,C.distbits=5,n.mode=20,6!==t)break;d>>>=2,c-=2;break e;case 2:n.mode=17;break;case 3:e.msg="invalid block type",n.mode=30}d>>>=2,c-=2}break;case 14:for(d>>>=7&c,c-=7&c;c<32;){if(0===s)break e;s--,d+=i[o++]<>>16^65535)){e.msg="invalid stored block lengths",n.mode=30;break}if(n.length=65535&d,c=d=0,n.mode=15,6===t)break e;case 15:n.mode=16;case 16:if(p=n.length){if(0===(p=l<(p=s>>=5,c-=5,n.ndist=1+(31&d),d>>>=5,c-=5,n.ncode=4+(15&d),d>>>=4,c-=4,286>>=3,c-=3}for(;n.have<19;)n.lens[B[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,x={bits:n.lenbits},b=H(0,n.lens,0,19,n.lencode,0,n.work,x),n.lenbits=x.bits,b){e.msg="invalid code lengths set",n.mode=30;break}n.have=0,n.mode=19;case 19:for(;n.have>>16&255,A=65535&T,!((g=T>>>24)<=c);){if(0===s)break e;s--,d+=i[o++]<>>=g,c-=g,n.lens[n.have++]=A;else{if(16===A){for(I=g+2;c>>=g,c-=g,0===n.have){e.msg="invalid bit length repeat",n.mode=30;break}w=n.lens[n.have-1],p=3+(3&d),d>>>=2,c-=2}else if(17===A){for(I=g+3;c>>=g)),d>>>=3,c=c-g-3}else{for(I=g+7;c>>=g)),d>>>=7,c=c-g-7}if(n.have+p>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=30;break}for(;p--;)n.lens[n.have++]=w}}if(30===n.mode)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=30;break}if(n.lenbits=9,x={bits:n.lenbits},b=H(F,n.lens,0,n.nlen,n.lencode,0,n.work,x),n.lenbits=x.bits,b){e.msg="invalid literal/lengths set",n.mode=30;break}if(n.distbits=6,n.distcode=n.distdyn,x={bits:n.distbits},b=H(N,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,x),n.distbits=x.bits,b){e.msg="invalid distances set",n.mode=30;break}if(n.mode=20,6===t)break e;case 20:n.mode=21;case 21:if(6<=s&&258<=l){e.next_out=a,e.avail_out=l,e.next_in=o,e.avail_in=s,n.hold=d,n.bits=c,D(e,u),a=e.next_out,r=e.output,l=e.avail_out,o=e.next_in,i=e.input,s=e.avail_in,d=n.hold,c=n.bits,12===n.mode&&(n.back=-1);break}for(n.back=0;v=(T=n.lencode[d&(1<>>16&255,A=65535&T,!((g=T>>>24)<=c);){if(0===s)break e;s--,d+=i[o++]<>y)])>>>16&255,A=65535&T,!(y+(g=T>>>24)<=c);){if(0===s)break e;s--,d+=i[o++]<>>=y,c-=y,n.back+=y}if(d>>>=g,c-=g,n.back+=g,n.length=A,0===v){n.mode=26;break}if(32&v){n.back=-1,n.mode=12;break}if(64&v){e.msg="invalid literal/length code",n.mode=30;break}n.extra=15&v,n.mode=22;case 22:if(n.extra){for(I=n.extra;c>>=n.extra,c-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;v=(T=n.distcode[d&(1<>>16&255,A=65535&T,!((g=T>>>24)<=c);){if(0===s)break e;s--,d+=i[o++]<>y)])>>>16&255,A=65535&T,!(y+(g=T>>>24)<=c);){if(0===s)break e;s--,d+=i[o++]<>>=y,c-=y,n.back+=y}if(d>>>=g,c-=g,n.back+=g,64&v){e.msg="invalid distance code",n.mode=30;break}n.offset=A,n.extra=15&v,n.mode=24;case 24:if(n.extra){for(I=n.extra;c>>=n.extra,c-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=30;break}n.mode=25;case 25:if(0===l)break e;if(n.offset>(p=u-l)){if((p=n.offset-p)>n.whave&&n.sane){e.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=a-n.offset,p=n.length;for(l-=p=lp?(m=O[L+a[y]],B[P+a[y]]):(m=96,0),l=1<<(f=A-x),E=d=1<>x)+(d-=l)]=f<<24|m<<16|g|0,0!==d;);for(l=1<>=1;if(S=0!==l?(S&l-1)+l:0,y++,0==--C[A]){if(A===M)break;A=t[n+a[y]]}if(w>>7)]}function r(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function H(e,t,n){e.bi_valid>i-n?(e.bi_buf|=t<>i-e.bi_valid,e.bi_valid+=n-i):(e.bi_buf|=t<>>=1,n<<=1,0<--t;);return n>>>1}function U(e,t,n){for(var i,r=new Array(T+1),o=0,a=1;a<=T;a++)r[a]=o=o+n[a-1]<<1;for(i=0;i<=t;i++){var s=e[2*i+1];0!==s&&(e[2*i]=k(r[s]++,s))}}function G(e){for(var t=0;t>1;1<=n;n--)N(e,o,n);for(r=l;n=e.heap[1],e.heap[1]=e.heap[e.heap_len--],N(e,o,1),i=e.heap[1],e.heap[--e.heap_max]=n,e.heap[--e.heap_max]=i,o[2*r]=o[2*n]+o[2*i],e.depth[r]=(e.depth[n]>=e.depth[i]?e.depth[n]:e.depth[i])+1,o[2*n+1]=o[2*i+1]=r,e.heap[1]=r++,N(e,o,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1];for(var c,h,u,p,f,m=e,g=t.dyn_tree,v=t.max_code,A=t.stat_desc.static_tree,y=t.stat_desc.has_stree,E=t.stat_desc.extra_bits,M=t.stat_desc.extra_base,w=t.stat_desc.max_length,b=0,x=0;x<=T;x++)m.bl_count[x]=0;for(g[2*m.heap[m.heap_max]+1]=0,c=m.heap_max+1;c>=7;a>>=1)if(1&t&&0!==e.dyn_ltree[2*n])return c;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return h;for(n=32;n>>3,(o=e.static_len+3+7>>>3)<=r&&(r=o)):r=o=n+5,n+4<=r&&-1!==t)q(e,t,n,i);else if(4===e.strategy||o===r)H(e,2+(i?1:0),3),Y(e,x,S);else{H(e,4+(i?1:0),3);var s,l=e,t=e.l_desc.max_code+1,n=e.d_desc.max_code+1,d=a+1;for(H(l,t-257,5),H(l,n-1,5),H(l,d-4,4),s=0;s>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&n,e.last_lit++,0===t?e.dyn_ltree[2*n]++:(e.matches++,t--,e.dyn_ltree[2*(P[n]+p+1)]++,e.dyn_dtree[2*D(t)]++),e.last_lit===e.lit_bufsize-1},e._tr_align=function(e){H(e,2,3),F(e,v,x),16===(e=e).bi_valid?(r(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":3}],15:[function(e,t,n){t.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}},{}],"/":[function(e,t,n){var i={};(0,e("./lib/utils/common").assign)(i,e("./lib/deflate"),e("./lib/inflate"),e("./lib/zlib/constants")),t.exports=i},{"./lib/deflate":1,"./lib/inflate":2,"./lib/utils/common":3,"./lib/zlib/constants":6}]},{},[])("/")},function(e,t,n){function d(){}function c(e,t,n,i,r,o,a,s,l,d){for(var c,h,u=0,p=r;p!==a;p+=o)for(h=s;h!==d;h+=l,u++)c=t[u],e[4*(h+i*p)+3]=255,e[4*(h+i*p)+2]=n[3*c+0],e[4*(h+i*p)+1]=n[3*c+1],e[4*(h+i*p)+0]=n[3*c+2];return e}function h(e,t,n,i,r,o,a,s,l,d){for(var c,h,u=0,p=r;p!==a;p+=o)for(h=s;h!==d;h+=l,u+=2)c=t[u+0]|t[u+1]<<8,e[4*(h+i*p)+0]=(31744&c)>>7,e[4*(h+i*p)+1]=(992&c)>>2,e[4*(h+i*p)+2]=(31&c)>>3,e[4*(h+i*p)+3]=32768&c?0:255;return e}function u(e,t,n,i,r,o,a,s,l,d){for(var c,h=0,u=r;u!==a;u+=o)for(c=s;c!==d;c+=l,h+=3)e[4*(c+i*u)+3]=255,e[4*(c+i*u)+2]=t[h+0],e[4*(c+i*u)+1]=t[h+1],e[4*(c+i*u)+0]=t[h+2];return e}function p(e,t,n,i,r,o,a,s,l,d){for(var c,h=0,u=r;u!==a;u+=o)for(c=s;c!==d;c+=l,h+=4)e[4*(c+i*u)+2]=t[h+0],e[4*(c+i*u)+1]=t[h+1],e[4*(c+i*u)+0]=t[h+2],e[4*(c+i*u)+3]=t[h+3];return e}function f(e,t,n,i,r,o,a,s,l,d){for(var c,h,u=0,p=r;p!==a;p+=o)for(h=s;h!==d;h+=l,u++)c=t[u],e[4*(h+i*p)+0]=c,e[4*(h+i*p)+1]=c,e[4*(h+i*p)+2]=c,e[4*(h+i*p)+3]=255;return e}function m(e,t,n,i,r,o,a,s,l,d){for(var c,h=0,u=r;u!==a;u+=o)for(c=s;c!==d;c+=l,h+=2)e[4*(c+i*u)+0]=t[h+0],e[4*(c+i*u)+1]=t[h+0],e[4*(c+i*u)+2]=t[h+0],e[4*(c+i*u)+3]=t[h+1];return e}var i;d.Type={NO_DATA:0,INDEXED:1,RGB:2,GREY:3,RLE_INDEXED:9,RLE_RGB:10,RLE_GREY:11},d.Origin={BOTTOM_LEFT:0,BOTTOM_RIGHT:1,TOP_LEFT:2,TOP_RIGHT:3,SHIFT:4,MASK:48},d.prototype.open=function(e,t){var n=this,i=new XMLHttpRequest;i.overrideMimeType("text/plain"),i.open("GET",e,!0),i.responseType="arraybuffer",i.onload=function(){200===this.status&&(n.load(new Uint8Array(i.response)),t)&&t.call(n)},i.send(null)},d.prototype.load=function(e){var t=0;if(e.length<18)throw new Error("Targa::load() - Not enough data to contain header");this.header={idLength:e[t++],colorMapType:e[t++],imageType:e[t++],colorMapIndex:e[t++]|e[t++]<<8,colorMapLength:e[t++]|e[t++]<<8,colorMapDepth:e[t++],offsetX:e[t++]|e[t++]<<8,offsetY:e[t++]|e[t++]<<8,width:e[t++]|e[t++]<<8,height:e[t++]|e[t++]<<8,pixelDepth:e[t++],flags:e[t++]},this.header.hasEncoding=this.header.imageType===d.Type.RLE_INDEXED||this.header.imageType===d.Type.RLE_RGB||this.header.imageType===d.Type.RLE_GREY,this.header.hasColorMap=this.header.imageType===d.Type.RLE_INDEXED||this.header.imageType===d.Type.INDEXED,this.header.isGreyColor=this.header.imageType===d.Type.RLE_GREY||this.header.imageType===d.Type.GREY;var n=this.header;if(n.imageType===d.Type.NO_DATA)throw new Error("Targa::checkHeader() - No data");if(n.hasColorMap){if(256=e.length)throw new Error("Targa::load() - No data");this.header.hasColorMap&&(n=this.header.colorMapLength*(this.header.colorMapDepth>>3),this.palette=e.subarray(t,t+n),t+=n);var n=this.header.pixelDepth>>3,i=this.header.width*this.header.height,r=i*n;this.header.hasEncoding?this.imageData=function(e,t,n,i){for(var r,o,a,s=new Uint8Array(i),l=new Uint8Array(n),d=0;d>d.Origin.SHIFT;switch(e=e||(document?document.createElement("canvas").getContext("2d").createImageData(a,s):{width:a,height:s,data:new Uint8ClampedArray(a*s*4)}),s=l===d.Origin.TOP_LEFT||l===d.Origin.TOP_RIGHT?(i=0,r=1,s):(i=s-1,r=-1),l=l===d.Origin.TOP_LEFT||l===d.Origin.BOTTOM_LEFT?(t=0,n=1,a):(t=a-1,n=-1),this.header.pixelDepth){case 8:o=this.header.isGreyColor?f:c;break;case 16:o=this.header.isGreyColor?m:h;break;case 24:o=u;break;case 32:o=p}return o(e.data,this.imageData,this.palette,a,i,r,s,t,n,l),e},d.prototype.getCanvas=function(){var e=document.createElement("canvas"),t=e.getContext("2d"),n=t.createImageData(this.header.width,this.header.height);return e.width=this.header.width,e.height=this.header.height,t.putImageData(this.getImageData(n),0,0),e},d.prototype.getDataURL=function(e){return this.getCanvas().toDataURL(e||"image/png")},(i={}).exports=t,i.exports&&(i.exports.TGA=d)},function(e,t){THREE.RGBFormat=THREE.RGBAFormat,THREE.RGBIntegerFormat=THREE.RGBAIntegerFormat},function(e,t){THREE.Geometry=THREE.CompatibleGeometry,THREE.Geometry.prototype.applyMatrix=THREE.Geometry.prototype.applyMatrix4;var n=0;THREE.GeometryIdCount=function(){return n++}},function(e,t){THREE.Matrix3.prototype.getInverse=function(e,t){e&&e.isMatrix4&&console.error("THREE.Matrix3: .getInverse() no longer takes a Matrix4 argument.");var e=e.elements,n=this.elements,i=e[0],r=e[1],o=e[2],a=e[3],s=e[4],l=e[5],d=e[6],c=e[7],e=e[8],h=e*s-l*c,u=l*d-e*a,p=c*a-s*d,f=i*h+r*u+o*p;if(0==f){var m="THREE.Matrix3: .getInverse() can't invert matrix, determinant is 0";if(!0===t)throw new Error(m);return console.warn(m),this.identity()}t=1/f;return n[0]=h*t,n[1]=(o*c-e*r)*t,n[2]=(l*r-o*s)*t,n[3]=u*t,n[4]=(e*i-o*d)*t,n[5]=(o*a-l*i)*t,n[6]=p*t,n[7]=(r*d-c*i)*t,n[8]=(s*i-r*a)*t,this}},function(e,t){THREE.Matrix4.prototype.getInverse=function(e,t){var n=this.elements,e=e.elements,i=e[0],r=e[1],o=e[2],a=e[3],s=e[4],l=e[5],d=e[6],c=e[7],h=e[8],u=e[9],p=e[10],f=e[11],m=e[12],g=e[13],v=e[14],e=e[15],A=u*v*c-g*p*c+g*d*f-l*v*f-u*d*e+l*p*e,y=m*p*c-h*v*c-m*d*f+s*v*f+h*d*e-s*p*e,E=h*g*c-m*u*c+m*l*f-s*g*f-h*l*e+s*u*e,M=m*u*d-h*g*d-m*l*p+s*g*p+h*l*v-s*u*v,w=i*A+r*y+o*E+a*M;if(0==w){var b="THREE.Matrix4: .getInverse() can't invert matrix, determinant is 0";if(!0===t)throw new Error(b);return console.warn(b),this.identity()}t=1/w;return n[0]=A*t,n[1]=(g*p*a-u*v*a-g*o*f+r*v*f+u*o*e-r*p*e)*t,n[2]=(l*v*a-g*d*a+g*o*c-r*v*c-l*o*e+r*d*e)*t,n[3]=(u*d*a-l*p*a-u*o*c+r*p*c+l*o*f-r*d*f)*t,n[4]=y*t,n[5]=(h*v*a-m*p*a+m*o*f-i*v*f-h*o*e+i*p*e)*t,n[6]=(m*d*a-s*v*a-m*o*c+i*v*c+s*o*e-i*d*e)*t,n[7]=(s*p*a-h*d*a+h*o*c-i*p*c-s*o*f+i*d*f)*t,n[8]=E*t,n[9]=(m*u*a-h*g*a-m*r*f+i*g*f+h*r*e-i*u*e)*t,n[10]=(s*g*a-m*l*a+m*r*c-i*g*c-s*r*e+i*l*e)*t,n[11]=(h*l*a-s*u*a-h*r*c+i*u*c+s*r*f-i*l*f)*t,n[12]=M*t,n[13]=(h*g*o-m*u*o+m*r*p-i*g*p-h*r*v+i*u*v)*t,n[14]=(m*l*o-s*g*o-m*r*d+i*g*d+s*r*v-i*l*v)*t,n[15]=(s*u*o-h*l*o+h*r*d-i*u*d-s*r*p+i*l*p)*t,this}},function(e,t){THREE.Quaternion.prototype.inverse=function(){return this.conjugate().normalize()}},function(e,t){THREE.Object3D.prototype.applyMatrix=function(e){this.applyMatrix4(e)}},function(e,t){THREE.BufferGeometry.prototype.addAttribute=THREE.BufferGeometry.prototype.setAttribute,THREE.BufferGeometry.prototype.applyMatrix=THREE.BufferGeometry.prototype.applyMatrix4},function(e,t){THREE.Math=THREE.MathUtils},function(e,t){THREE.Triangle.normal=function(e,t,n){return THREE.Triangle.getNormal(e,t,n,new THREE.Vector3)}},function(e,t){THREE.Matrix4D=function(){THREE.Matrix4.call(this),this.elements=new Float64Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])},THREE.Matrix4D.prototype=Object.create(THREE.Matrix4.prototype)},function(e,t){THREE.Plane.prototype.transformProvidingInverse=function(e){var t=new THREE.Vector4(this.normal.x,this.normal.y,this.normal.z,this.constant);t.applyMatrix4(e.clone().transpose()),this.setComponents(t.x,t.y,t.z,t.w),this.normalize()}},function(e,t){var o,n,r,i,E,M,w,a,s;THREE.Polytope=function(e){function i(e){for(var t=f.planes,n=e,i=[],r=0,o=t.length;re.far||t.push({distance:v,point:l.clone().applyMatrix4(this.matrixWorld),index:p,face:null,faceIndex:null,object:this})}else for(p=0,f=h.length/3-1;pe.far||t.push({distance:v,point:l.clone().applyMatrix4(this.matrixWorld),index:p,face:null,faceIndex:null,object:this})}else if(r.isGeometry)for(var v,A=r.vertices,y=A.length,p=0;pe.far||t.push({distance:v,point:l.clone().applyMatrix4(this.matrixWorld),index:p,face:null,faceIndex:null,object:this})}}),THREE.Box3.prototype.intersectsPlane=function(e){return s=0=-e.constant}},function(e,t,n){t.byteLength=function(e){var e=c(e),t=e[0],e=e[1];return 3*(t+e)/4-e},t.toByteArray=function(e){var t,n,i=c(e),r=i[0],i=i[1],o=new d(function(e,t){return 3*(e+t)/4-t}(r,i)),a=0,s=0>16&255,o[a++]=t>>8&255,o[a++]=255&t;2===i&&(t=l[e.charCodeAt(n)]<<2|l[e.charCodeAt(n+1)]>>4,o[a++]=255&t);1===i&&(t=l[e.charCodeAt(n)]<<10|l[e.charCodeAt(n+1)]<<4|l[e.charCodeAt(n+2)]>>2,o[a++]=t>>8&255,o[a++]=255&t);return o},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,r=[],o=0,a=n-i;o>18&63]+s[e>>12&63]+s[e>>6&63]+s[63&e]}(i));return r.join("")}(e,o,a>2]+s[t<<4&63]+"==")):2==i&&(t=(e[n-2]<<8)+e[n-1],r.push(s[t>>10]+s[t>>4&63]+s[t<<2&63]+"="));return r.join("")};for(var s=[],l=[],d="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,o=i.length;r>1,c=-7,h=n?r-1:0,u=n?-1:1,r=e[t+h];for(h+=u,o=r&(1<<-c)-1,r>>=-c,c+=s;0>=-c,c+=i;0>1,h=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,u=i?0:o-1,p=i?1:-1,o=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=d):(a=Math.floor(Math.log(t)/Math.LN2),t*(i=Math.pow(2,-a))<1&&(a--,i*=2),2<=(t+=1<=a+c?h/i:h*Math.pow(2,1-c))*i&&(a++,i/=2),d<=a+c?(s=0,a=d):1<=a+c?(s=(t*i-1)*Math.pow(2,r),a+=c):(s=t*Math.pow(2,c-1)*Math.pow(2,r),a=0));8<=r;e[n+u]=255&s,u+=p,s/=256,r-=8);for(a=a<'+('
'+e+"
")+'
×
'+''+'
'+"
"+"",e=document.getElementById("nds-mbdlg-content"),t=f(),x=t,e.appendChild(t),l.viewer.addEventListener("selectObject",function(e){l.getTreeNodeByClickModel(e.object)}),l.viewer.addEventListener("clearSelection",function(e){E&&(E.className="headerunselected")}),h("modelbrowserclose").onclick=function(){h("modelbrowserdialog").style.display="none",l.visible=!1,window.clearTimeout(c)},h("newdimmove_part").addEventListener("mousedown",function(e){e=e||window.event;r=e.pageX,o=e.pageY,a=h("modelbrowserdialog").offsetLeft,s=h("modelbrowserdialog").offsetTop,d=!0}),h("newdimmove_part").addEventListener("mouseup",function(){d=!1})),h("modelbrowserdialog").style.display="block",u(h("modelbrowserdialog")),l.visible=!0}}function ge(e,t,n){THREE.Camera.call(this),this.fov=45,this.near=.5,this.far=1e4,this.aspect=e/t,this.orthoNear=-200,this.perpNear=.5,this.viewer=n,this.left=-e/2,this.right=e/2,this.top=t/2,this.bottom=-t/2,this.target=new THREE.Vector3(0,0,0),this.worldup=new THREE.Vector3(0,1,0),this.position.set(0,0,1),this.orthographicCamera=new THREE.OrthographicCamera(this.left,this.right,this.top,this.bottom,this.near,this.far),this.perspectiveCamera=new THREE.PerspectiveCamera(this.fov,this.aspect,this.near,this.far),this.updateMatrixWorld(!0),this.zoom=1,this.isPerspective=!0,this.zoomToFitRatio=5,this.orginalCameraInfo=void 0,this.toPerspective()}var ve={},_e=(t(5),t(6),t(7),t(8),t(9),t(10),t(11),t(12),t(13),t(14),t(15),t(16),{REVISION:"01",toolbarButtonClickedBkgColor:"",toolbarOpacity:.2,dialogOpacity:.2,bodyOpacity:.4,lineOpacity:.2,OES_element_index_uint:!1,avoidCaching:!0,lineSegAnnotationGridCount:200,enableBroadcast:!1,broadcastMajor:!1});_e.selectedMaterial=new THREE.MeshStandardMaterial({color:16763200,metalness:.2,roughness:1,side:THREE.DoubleSide,polygonOffset:!0,polygonOffsetFactor:1,polygonOffsetUnits:2,skinning:!1}),_e.BIMselectedMaterial=new THREE.MeshBasicMaterial({opacity:.7,color:4168151,side:THREE.DoubleSide,depthTest:!1,depthWrite:!1,transparent:!0}),_e.selectedColor=new THREE.Color(16776960),_e.selectedLineMaterial=new THREE.LineBasicMaterial({color:16776960}),_e.selectedPointMaterial=new THREE.MeshBasicMaterial({color:16776960,side:THREE.DoubleSide}),_e.selectedFaceMaterial=new THREE.MeshBasicMaterial({opacity:.8,color:979390,side:THREE.DoubleSide,transparent:!0}),_e.selectedFace2DMaterial=new THREE.MeshBasicMaterial({opacity:.8,color:16763200,side:THREE.DoubleSide,transparent:!0}),_e.preSelectedFaceMaterial=new THREE.MeshBasicMaterial({opacity:.8,color:65535,side:THREE.DoubleSide,transparent:!0}),_e.selectedEdgeMaterial=new THREE.LineBasicMaterial({color:16744512,opacity:.9,transparent:!0,depthTest:!1,depthWrite:!1,linewidth:1}),_e.preSelectedEdgeMaterial=new THREE.LineBasicMaterial({color:65535,opacity:.9,transparent:!0,depthTest:!1,depthWrite:!1,linewidth:1}),_e.SelectedEdgeMaterial1=new THREE.LineBasicMaterial({color:16711680,depthTest:!0,depthWrite:!0,linewidth:1}),_e.selectedVertexMaterial=new THREE.MeshBasicMaterial({color:16711680,opacity:.8,transparent:!0,depthTest:!1,depthWrite:!1}),_e.preSelectedVertexMaterial=new THREE.MeshBasicMaterial({color:65535,opacity:.8,transparent:!0,depthTest:!1,depthWrite:!1}),_e.dashedMaterial=new THREE.ShaderMaterial({uniforms:{lineStyle:{value:-1},dashSize:{value:12},dashNum:{value:1},grapSize:{value:3},pointSize:{value:.5},pointNum:{value:1},opacity:{value:.8},diffuse:{value:new THREE.Color(16711680)}},linewidth:1,transparent:!0,fragmentShader:["uniform vec3 diffuse;","uniform float opacity;","uniform float dashSize;","uniform float dashNum;","uniform float pointNum;","uniform float grapSize;","uniform float pointSize;","varying float vLineDistance;","#include ","#include ","#include ","#include ","#include ","void main() {","#include ","float totalSize = dashSize * dashNum + grapSize * (dashNum + pointNum) + pointSize * pointNum;","float modSize = mod( vLineDistance, totalSize );","bool grap = false;","for(float i = 1.0; i< 4.0; ++i){","if(i > dashNum){","break;","}","if(modSize < i * (grapSize + dashSize) && modSize > i * (grapSize + dashSize) - grapSize){","grap = true;","break;","}","}","if ( grap ) {","discard;","}","float dashlength = dashNum * (grapSize + dashSize);","for(float i = 1.0;i <4.0; ++i){","if(i > pointNum){","break;","}","if(modSize < i * (grapSize + pointSize) + dashlength && ","modSize > i * (grapSize + pointSize) - grapSize + dashlength){","grap = true;","break;","}","}","if ( grap ) {","discard;","}","vec3 outgoingLight = vec3( 0.0 );","vec4 diffuseColor = vec4( diffuse, opacity );","#include ","#include ","outgoingLight = diffuseColor.rgb;","gl_FragColor = vec4( outgoingLight, diffuseColor.a );","#include ","#include ","#include ","#include ","}"].join("\n"),vertexShader:["attribute float lineDistance;","varying float vLineDistance;","#include ","#include ","#include ","#include ","#include ","void main() {","#include ","vLineDistance = lineDistance;","vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );","gl_Position = projectionMatrix * mvPosition;","#include ","#include ","#include ","}"].join("\n")}),_e.enableSelect=!1,_e.autoSwitchFirstPersonView=!1,_e.tangentEdgeVisible=!0,_e.enableArrowKeyOp=!0,_e.dynamicRotateCenter=!0,_e.NdsLoadWorkerUrl="./coreviewer/NDSRequestWorker.min.js",_e.enableOutlineEffect=!1,_e.enableBodyVolumeMeasure=!1,_e.enablePreSelectBrep=!1,_e.selectObjectWithPropertyOnly=!1,_e.enableDirectMove=!1,_e.enableDirectRotate=!1,_e.inAssemblyContext=!1,_e.inBIMContext=!1,_e.ScenarioEditor=!1,_e.ScenarioEditorid=-1,_e.AnimationEdit=!1,_e.StopPMIOcclusion=!0,_e.singleHTML=!1,_e.HideLeafBody=!1,_e.New2DAPPMeasure=!1;function P(){P=function(){return a};var l,a={},e=Object.prototype,d=e.hasOwnProperty,c=Object.defineProperty||function(e,t,n){e[t]=n.value},t="function"==typeof Symbol?Symbol:{},i=t.iterator||"@@iterator",n=t.asyncIterator||"@@asyncIterator",r=t.toStringTag||"@@toStringTag";function o(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{o({},"")}catch(l){o=function(e,t,n){return e[t]=n}}function s(e,t,n,i){var r,o,a,s,t=t&&t.prototype instanceof v?t:v,t=Object.create(t.prototype),i=new T(i||[]);return c(t,"_invoke",{value:(r=e,o=n,a=i,s=u,function(e,t){if(s===f)throw Error("Generator is already running");if(s===m){if("throw"===e)throw t;return{value:l,done:!0}}for(a.method=e,a.arg=t;;){var n=a.delegate;if(n){n=function e(t,n){var i=n.method,r=t.iterator[i];if(r===l)return n.delegate=null,"throw"===i&&t.iterator.return&&(n.method="return",n.arg=l,e(t,n),"throw"===n.method)||"return"!==i&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+i+"' method")),g;i=h(r,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;r=i.arg;return r?r.done?(n[t.resultName]=r.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=l),n.delegate=null,g):r:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}(n,a);if(n){if(n===g)continue;return n}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(s===u)throw s=m,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);s=f;n=h(r,o,a);if("normal"===n.type){if(s=a.done?m:p,n.arg===g)continue;return{value:n.arg,done:a.done}}"throw"===n.type&&(s=m,a.method="throw",a.arg=n.arg)}})}),t}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}a.wrap=s;var u="suspendedStart",p="suspendedYield",f="executing",m="completed",g={};function v(){}function A(){}function y(){}var t={},E=(o(t,i,function(){return this}),Object.getPrototypeOf),E=E&&E(E(S([]))),M=(E&&E!==e&&d.call(E,i)&&(t=E),y.prototype=v.prototype=Object.create(t));function w(e){["next","throw","return"].forEach(function(t){o(e,t,function(e){return this._invoke(t,e)})})}function b(a,s){var t;c(this,"_invoke",{value:function(n,i){function e(){return new s(function(e,t){!function t(e,n,i,r){var o,e=h(a[e],a,n);if("throw"!==e.type)return(n=(o=e.arg).value)&&"object"==typeof n&&d.call(n,"__await")?s.resolve(n.__await).then(function(e){t("next",e,i,r)},function(e){t("throw",e,i,r)}):s.resolve(n).then(function(e){o.value=e,i(o)},function(e){return t("throw",e,i,r)});r(e.arg)}(n,i,e,t)})}return t=t?t.then(e,e):e()}})}function x(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function I(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function S(t){if(t||""===t){var n,e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return n=-1,(e=function e(){for(;++n.25*n.length()&&(this.near=.25*n.length())):(this.near=-t,this.far=t),this.updateProjectionMatrix()},ge.prototype.setFarNear=function(e,t){this.far=e,this.near=t},ge.prototype.setOrthoNear=function(e){e=e.min.distanceTo(e.max);-eMath.abs(t.z))&&(this.activePlane=this.planes.XZ),"Y"===e&&(this.activePlane=this.planes.XY,Math.abs(t.x)>Math.abs(t.z))&&(this.activePlane=this.planes.YZ),"Z"===e&&(this.activePlane=this.planes.XZ,Math.abs(t.x)>Math.abs(t.y))&&(this.activePlane=this.planes.YZ),"XYZ"===e&&(this.activePlane=this.planes.XYZE),"XY"===e&&(this.activePlane=this.planes.XY),"YZ"===e&&(this.activePlane=this.planes.YZ),"XZ"===e&&(this.activePlane=this.planes.XZ)},this.showAxis=function(e,t){if(void 0!==e&&""!==e)switch(e){case"x":for(var n=0;nMath.abs(t.z))&&(this.activePlane=this.planes.XZ),"Y"===e&&(this.activePlane=this.planes.XY,Math.abs(t.x)>Math.abs(t.z))&&(this.activePlane=this.planes.YZ),"Z"===e&&(this.activePlane=this.planes.XZ,Math.abs(t.x)>Math.abs(t.y))&&(this.activePlane=this.planes.YZ),"XYZ"===e&&(this.activePlane=this.planes.XYZE)},this.init()}function Pe(u){for(var l,e,h=u.lights,o=u.camera,t=u.scene,p=(this.viewer=u,new THREE.Group),a=(p.name="lightctrls",t.add(p),null),a=u.canvas2D||u.canvas3D,c=[],f=null,m=null,d=null,g=null,v=null,A=null,y=null,E=null,M=null,w=null,b=null,x=null,t=h.length,n=!1,i=.7,s=(a.width,a.height),I=new Array(t),r=null,T=2,S=.7,B=1e3,P=this,C=(this._scene=p,this._transformScene=new THREE.Scene,new THREE.TextureLoader(new THREE.LoadingManager)),R=0;Rl&&(l=s[d]);B=4*l,l/=10,P.setDirLength(2);for(var c=0;cs&&(s=a[l]);B=4*s;for(l=0;l=h.length)return!1;if("None"==t)this.setIconVisible(h[e],!1),this.setLightEnabled(h[e],!1),h[e].type="None";else if(this.setLightEnabled(h[e],!0),h[e].type!=t){"DirectionalLight"==h[e].type&&h[e]._followCamera&&(P.viewer.removeFrameListener(h[e]._followCameraListener),h[e]._followCamera=null);var n,i=null,r=(h[e]._iconVisible?(i=I[e].position,p.remove(I[e]),n=O(I[e]),D(I[e].children[n])):(p.remove(h[e]),i=h[e].position),h[e]._iconVisible);switch(t){case"DirectionalLight":h[e]=new THREE.DirectionalLight(16777215,1),h[e]._enabled=!0,h[e]._visible=!0,h[e]._iconVisible=!1,h[e]._followCamera=!1,h[e].position.copy(i),p.add(h[e]),x.detach();break;case"PointLight":h[e]=new THREE.PointLight(16777215),h[e]._enabled=!0,h[e]._visible=!0,h[e]._iconVisible=!1,h[e]._distance=50,h[e].distance=.5*B,h[e].position.copy(i),r?k(e):p.add(h[e]);break;case"HemisphereLight":h[e]=new THREE.HemisphereLight(16777215,16777215,1),h[e]._enabled=!0,h[e]._visible=!0,h[e]._iconVisible=!1,h[e].position.copy(i),r?U(e):p.add(h[e]);break;case"SpotLight":h[e]=new THREE.SpotLight(16777215,1),h[e]._enabled=!0,h[e]._visible=!0,h[e]._iconVisible=!1,h[e]._distance=50,h[e].distance=.5*B,h[e].position.copy(i),h[e].target.position.set(i.x,i.y-1,i.z),r?V(e):p.add(h[e])}h[e]._iconVisible&&(x.detach(),n=O(I[e]),x.attachTo(I[e].children[n])),u.render()}return!0},this.addLight=function(e){for(var t=u.controls.getBoundingBox(),n=t.min.x,i=t.min.y,r=t.min.z,o=t.max.x,a=t.max.y,t=t.max.z,s=new Array(3),l=(s[0]=a-i,s[1]=o-n,s[2]=t-r,s[0]),d=0;d<3;d++)s[d]>l&&(l=s[d]);B=4*l,l/=10;var c=h.length;switch(e){case"DirectionalLight":h[c]=new THREE.DirectionalLight(16777215,1),h[c]._enabled=!0,h[c]._visible=!0,h[c]._iconVisible=!1,h[c]._followCamera=!1,h[c].position.set(1,2,0),p.add(h[c]);break;case"PointLight":h[c]=new THREE.PointLight(16777215),h[c]._enabled=!0,h[c]._visible=!0,h[c]._iconVisible=!1,h[c]._distance=50,h[c].distance=.5*B,h[c].position.set(0,0,0),p.add(h[c]);break;case"HemisphereLight":h[c]=new THREE.HemisphereLight(16777215,16777215,1),h[c]._enabled=!0,h[c]._visible=!0,h[c]._iconVisible=!1,h[c].position.set(0,5,0),p.add(h[c]);break;case"SpotLight":h[c]=new THREE.SpotLight(16777215,1),h[c]._enabled=!0,h[c]._visible=!0,h[c]._iconVisible=!1,h[c]._distance=50,h[c].distance=.5*B,h[c].position.set(10,10,10),h[c].target.position.set(10,9,10),p.add(h[c]);break;case"None":h[c]=new THREE.DirectionalLight(16777215,1),h[c]._enabled=!1,h[c]._visible=!1,h[c]._iconVisible=!1,h[c]._followCamera=!1,h[c].position.set(1,2,0),h[c].type="None"}h[c]&&(h[c].position.set(n+(o-n)/2+l*c,a+l,r-l+l*c),h[c].updateMatrixWorld(!0)),u.render()},this.removeLight=function(e){var t,e=H(e);"DirectionalLight"==h[e].type&&h[e]._followCamera&&(P.viewer.removeFrameListener(h[e]._followCameraListener),h[e]._followCamera=null),h[e]._iconVisible?(p.remove(I[e]),t=O(I[e]),D(I[e].children[t])):p.remove(h[e]),I.splice(e,1),h.splice(e,1);for(var n,i=0;i=h.length?null:h[e]},this.showLightGizmo=function(e){var t,n;e._enabled&&e._iconVisible&&(n=H(e),t=O(I[n]),n=I[n].children[t],e._enabled?x.attachTo(n):x.detach())},this.getLightEnabled=function(e){if(null!=e)return e._enabled},this.setLightVisible=function(e,t){if(null==e)return!1;if(e._visible==t)return!0;if("DirectionalLight"==e.type)return!0;e._visible=t;var n=H(e),i=e.type;if(t){switch(i){case"DirectionalLight":null==f&&(f=new THREE.SpriteMaterial({map:m,side:THREE.DoubleSide,transparent:!0})),(a=new THREE.Sprite(f)).name="dirlightctrl";break;case"HemisphereLight":null==y&&(y=new THREE.SpriteMaterial({map:E,side:THREE.DoubleSide,transparent:!0})),(a=new THREE.Sprite(y)).name="hemilightctrl";break;case"PointLight":null==g&&(g=new THREE.SpriteMaterial({map:v,side:THREE.DoubleSide,transparent:!0})),(a=new THREE.Sprite(g)).name="pointlightctrl";break;case"SpotLight":null==b&&(b=new new THREE.SpriteMaterial({map:w,side:THREE.DoubleSide,transparent:!0})),(a=new THREE.Sprite(b)).name="spotlightctrl";var r=_();I[n].add(r)}o=O(I[n]);I[n].remove(I[n].children[o]),I[n].add(a),I[n].add(e),c.push(a)}else{I[n].remove(e);var o=O(I[n]),a=(D(I[n].children[o]),null);switch(i){case"DirectionalLight":null==d&&(d=new THREE.SpriteMaterial({map:null,side:THREE.DoubleSide,transparent:!0})),a=new THREE.Sprite(d);break;case"HemisphereLight":null==M&&(M=new THREE.SpriteMaterial({map:null,side:THREE.DoubleSide,transparent:!0})),a=new THREE.Sprite(M);break;case"PointLight":null==A&&(A=new THREE.SpriteMaterial({map:void 0,side:THREE.DoubleSide,transparent:!0})),a=new THREE.Sprite(A);break;case"SpotLight":null==l&&(l=new THREE.SpriteMaterial({map:void 0,side:THREE.DoubleSide,transparent:!0}));var a=new THREE.Sprite(l),s=F(I[n]);I[n].remove(I[n].children[s])}x.getCurrAttachObj()==I[n]&&x.detach();var o=O(I[n]);I[n].remove(I[n].children[o]),I[n].add(a)}},this.setLightEnabled=function(e,t){if(null==e)return!1;var n=H(e);if(e._enabled!=t){e._enabled=t;var i,r,o=e.type;switch(o){case"DirectionalLight":t?(e._iconVisible?p.add(I[n]):(p.add(e),p.add(e.target)),e._followCamera&&(i=new L(n),P.viewer.addFrameListener(i),e._followCameraListener=i)):(e._followCamera&&P.viewer.removeFrameListener(e._followCameraListener),e._iconVisible?p.remove(I[n]):(p.remove(e),p.remove(e.target)));break;case"PointLight":case"SpotLight":case"HemisphereLight":t?e._iconVisible?p.add(I[n]):(p.add(e),"SpotLight"==o&&p.add(e.target)):e._iconVisible?p.remove(I[n]):(p.remove(e),"SpotLight"==o&&p.remove(e.target))}t&&e._iconVisible?(r=O(I[n]),x.attachTo(I[n].children[r])):!t&&e._iconVisible&&null!=x&&x.getCurrAttachObj()==I[n]&&x.detach(),t&&P.setIconVisible(e,!0),u.render()}return!0},this.getLightParam=function(e){switch(e.type){case"PointLight":return this.getPointLightParam(e);case"DirectionalLight":return this.getDirLightParam(e);case"SpotLight":return this.getSpotLightParam(e);case"HemisphereLight":return this.getHemiLightParam(e);default:return null}},this.getPointLightParam=function(e){var t,n,i,r={};if(null!=e&&"PointLight"==e.type)return r.color=e.color.getHex(),r.intensity=e.intensity,r.distance=e._distance,t=new THREE.Vector3,n=new THREE.Quaternion,i=new THREE.Vector3,e.matrixWorld.decompose(t,n,i),r.position={},r.position.x=t.x,r.position.y=t.y,r.position.z=t.z,r.iconVisible=e._iconVisible,r},this.setPointLightParam=function(e,t){var n,i,r;return void 0!==t&&null!=e&&!!e._enabled&&"PointLight"==e.type&&(n=!1,i=H(e),e._visible&&(null!=t.color&&"null"!=t.color&&(r=parseInt(t.color),e.color=new THREE.Color(r),n=!0),null!=t.intensity&&"null"!=t.intensity&&(r=parseFloat(t.intensity),e.intensity=r,n=!0),null!=t.distance&&"null"!=t.distance&&(r=parseFloat(t.distance),e._distance=r,e.distance=r/100*B+.1,n=!0),null!=t.position)&&"null"!=t.position&&(r=null,r="[object String]"===Object.prototype.toString.call(t.position)?JSON.parse(t.position):t.position,(e._iconVisible?(I[i].position.set(r.x,r.y,r.z),I[i]):(e.position.set(r.x,r.y,r.z),e)).updateMatrixWorld(!0),n=!0),null!=t.visible&&"null"!=t.visible&&(i=null,"[object String]"===Object.prototype.toString.call(t.visible)?"true"==t.visible?i=!0:"false"==t.visible&&(i=!1):i=t.visible,this.setLightVisible(e,i),n=!0),null!=t.iconVisible&&"null"!=t.iconVisible&&(r=null,"[object String]"===Object.prototype.toString.call(t.iconVisible)?"true"==t.iconVisible?r=!0:"false"==t.iconVisible&&(r=!1):r=t.iconVisible,this.setIconVisible(e,r),n=!0),u.render(),n)},this.getDirLightParam=function(e){var t={};if(null!=e&&("DirectionalLight"==e.type||"None"==e.type))return t.color=e.color.getHex(),t.intensity=e.intensity,t.followCamera=e._followCamera,t.position={},t.position.x=e.position.x,t.position.y=e.position.y,t.position.z=e.position.z,t.target={},t.target.x=e.target.position.x,t.target.y=e.target.position.y,t.target.z=e.target.position.z,t.iconVisible=e._iconVisible,t.rotate=e.rotate,t.bias=e.bias,t},this.setDirLightParam=function(e,t){var n,i,r,o,a,s,l,d,c,h;return void 0!==t&&null!=e&&(n=H(e),!!e._enabled)&&"DirectionalLight"==e.type&&(i=!1,e._visible&&(null!=t.color&&"null"!=t.color&&(h=parseInt(t.color),e.color=new THREE.Color(h),i=!0),null!=t.intensity&&"null"!=t.intensity&&(h=parseFloat(t.intensity),e.intensity=h,i=!0),null!=t.followCamera&&"null"!=t.followCamera&&(h=null,"[object String]"===Object.prototype.toString.call(t.followCamera)?"true"==t.followCamera?h=!0:t.followCamera:h=t.followCamera,h?e._followCamera||(c=new L(n),e._followCameraListener=c,e.oldDir=e.target.getWorldPosition(),e.oldDir.sub(e.getWorldPosition()),e.oldDir.normalize(),P.viewer.addFrameListener(c),u.render()):e._followCamera&&(P.viewer.removeFrameListener(e._followCameraListener),c=new THREE.Vector3,void 0===e.oldDir&&(e.oldDir=e.target.getWorldPosition(),e.oldDir.sub(e.getWorldPosition()),e.oldDir.normalize()),c.addVectors(e.getWorldPosition(),e.oldDir),e.target.position.copy(c),e.target.updateMatrixWorld(!0),e._iconVisible)&&(c=x.getCurrAttachObj()==I[n],p.remove(I[n]),0<=(a=O(I[n]))&&D(I[n].children[a]),e.position.copy(I[n].position),G(n),c)&&0<=(a=O(I[n]))&&(c=I[n].children[a],x.attachTo(c)),e._followCamera=h,i=!0),null!=t.position&&"null"!=t.position&&(s=null,s="[object String]"===Object.prototype.toString.call(t.position)?JSON.parse(t.position):t.position,(e._iconVisible?(I[n].position.set(s.x,s.y,s.z),I[n]):(e.position.set(s.x,s.y,s.z),e)).updateMatrixWorld(!0),i=!0),null!=t.target&&"null"!=t.target&&t.position&&(l=null,l="[object String]"===Object.prototype.toString.call(t.target)?JSON.parse(t.target):t.target,e._iconVisible?(d=I[n].position,e.target.position.set(l.x-d.x,l.y-d.y,l.z-d.z)):e.target.position.set(l.x,l.y,l.z),e.target.updateMatrixWorld(!0),i=!0),null!=t.rotate&&"null"!=t.rotate&&((r=e.target.getWorldPosition()).sub(e.getWorldPosition()),r.normalize(),(o=new THREE.Vector3(-1,-1,0)).applyAxisAngle(new THREE.Vector3(0,1,0),t.rotate*Math.PI/180),o.normalize(),s=new THREE.Vector3,e._iconVisible?s.copy(I[n].position):s.copy(e.position),l=s.add(o),e._iconVisible?(d=I[n].position,e.target.position.set(l.x-d.x,l.y-d.y,l.z-d.z)):e.target.position.set(l.x,l.y,l.z),e.target.updateMatrixWorld(!0),e.rotate=t.rotate),null!=t.bias)&&"null"!=t.bias&&((r=e.target.getWorldPosition()).sub(e.getWorldPosition()),r.normalize(),o=new THREE.Vector3(r.x,0,r.z),a=(new THREE.Vector3).crossVectors(o,r),o.applyAxisAngle(a,t.bias*Math.PI/180),o.normalize(),s=new THREE.Vector3,e._iconVisible?s.copy(I[n].position):s.copy(e.position),l=s.add(o),e._iconVisible?(d=I[n].position,e.target.position.set(l.x-d.x,l.y-d.y,l.z-d.z)):e.target.position.set(l.x,l.y,l.z),e.target.updateMatrixWorld(!0),e.bias=t.bias),null!=t.visible&&"null"!=t.visible&&(c=null,"[object String]"===Object.prototype.toString.call(t.visible)?"true"==t.visible?c=!0:"false"==t.visible&&(c=!1):c=t.visible,this.setLightVisible(e,c),i=!0),null!=t.iconVisible&&"null"!=t.iconVisible&&(h=null,"[object String]"===Object.prototype.toString.call(t.iconVisible)?"true"==t.iconVisible?h=!0:"false"==t.iconVisible&&(h=!1):h=t.iconVisible,this.setIconVisible(e,h),i=!0),u.render(),i)},this.getSpotLightParam=function(e){var t,n,i,r={};if(null!=e&&"SpotLight"==e.type)return r.color=e.color.getHex(),r.intensity=e.intensity,r.distance=e._distance,r.angle=e.angle,r.penumbra=e.penumbra,t=new THREE.Vector3,n=new THREE.Quaternion,i=new THREE.Vector3,e.matrixWorld.decompose(t,n,i),r.position={},r.position.x=t.x,r.position.y=t.y,r.position.z=t.z,r.target={},e.target.matrixWorld.decompose(t,n,i),r.target.x=t.x,r.target.y=t.y,r.target.z=t.z,r.iconVisible=e._iconVisible,r},this.setSpotLightParam=function(e,t){var n,i,r;return void 0!==t&&null!=e&&!!e._enabled&&"SpotLight"==e.type&&(i=H(e),n=!1,e._visible&&(null!=t.color&&"null"!=t.color&&(r=parseInt(t.color),e.color=new THREE.Color(r),n=!0),null!=t.intensity&&"null"!=t.intensity&&(r=parseFloat(t.intensity),e.intensity=r,n=!0),null!=t.distance&&"null"!=t.distance&&(r=parseFloat(t.distance),e._distance=r,e.distance=r/100*B+.1,n=!0),null!=t.angle&&"null"!=t.angle&&(r=parseFloat(t.angle),e.angle=r,n=!0),null!=t.penumbra&&"null"!=t.penumbra&&(r=parseFloat(t.penumbra),e.penumbra=r,n=!0),null!=t.position&&"null"!=t.position&&(r=null,r="[object String]"===Object.prototype.toString.call(t.position)?JSON.parse(t.position):t.position,(e._iconVisible?(I[i].position.set(r.x,r.y,r.z),I[i]):(e.position.set(r.x,r.y,r.z),e)).updateMatrixWorld(!0),n=!0),null!=t.target)&&"null"!=t.target&&t.position&&(r=null,r="[object String]"===Object.prototype.toString.call(t.target)?JSON.parse(t.target):t.target,e._iconVisible?(i=I[i].position,e.target.position.set(r.x-i.x,r.y-i.y,r.z-i.z)):e.target.position.set(r.x,r.y,r.z),e.target.updateMatrixWorld(!0),n=!0),null!=t.visible&&"null"!=t.visible&&(i=null,"[object String]"===Object.prototype.toString.call(t.visible)?"true"==t.visible?i=!0:"false"==t.visible&&(i=!1):i=t.visible,this.setLightVisible(e,i),n=!0),null!=t.iconVisible&&"null"!=t.iconVisible&&(r=null,"[object String]"===Object.prototype.toString.call(t.iconVisible)?"true"==t.iconVisible?r=!0:"false"==t.iconVisible&&(r=!1):r=t.iconVisible,this.setIconVisible(e,r),n=!0),u.render(),n)},this.getHemiLightParam=function(e){var t,n,i,r={};if(null!=e&&"HemisphereLight"==e.type)return r.skyColor=e.color.getHex(),r.groundColor=e.groundColor.getHex(),r.intensity=e.intensity,t=new THREE.Vector3,n=new THREE.Quaternion,i=new THREE.Vector3,e.matrixWorld.decompose(t,n,i),r.position={},r.position.x=t.x,r.position.y=t.y,r.position.z=t.z,r.iconVisible=e._iconVisible,r},this.setHemiLightParam=function(e,t){var n,i,r;return void 0!==t&&null!=e&&!!e._enabled&&"HemisphereLight"==e.type&&(n=!1,i=H(e),e._visible&&(null!=t.skyColor&&"null"!=t.skyColor&&(r=parseInt(t.skyColor),e.color=new THREE.Color(r),n=!0),null!=t.groundColor&&"null"!=t.groundColor&&(r=parseInt(t.groundColor),e.groundColor=new THREE.Color(r),n=!0),null!=t.intensity&&"null"!=t.intensity&&(r=parseFloat(t.intensity),e.intensity=r,n=!0),null!=t.position)&&"null"!=t.position&&(r=null,r="[object String]"===Object.prototype.toString.call(t.position)?JSON.parse(t.position):t.position,(e._iconVisible?(I[i].position.set(r.x,r.y,r.z),I[i]):(e.position.set(r.x,r.y,r.z),e)).updateMatrixWorld(!0),n=!0),null!=t.visible&&"null"!=t.visible&&(i=null,"[object String]"===Object.prototype.toString.call(t.visible)?"true"==t.visible?i=!0:"false"==t.visible&&(i=!1):i=t.visible,this.setLightVisible(e,i),n=!0),null!=t.iconVisible&&"null"!=t.iconVisible&&(r=null,"[object String]"===Object.prototype.toString.call(t.iconVisible)?"true"==t.iconVisible?r=!0:"false"==t.iconVisible&&(r=!1):r=t.iconVisible,this.setIconVisible(e,r),n=!0),u.render(),n)},this.setLightParam=function(e,t){if(null==e||null==t)return!1;switch(e.type){case"DirectionalLight":return setDirLightParam(e,t);case"SpotLight":return setSpotLightParam(e,t);case"PointLight":return setPointLightParam(e,t);case"HemisphereLight":return setHemiLightParam(e,t)}},this.isLightEditControlSelected=function(){return!(null==x||!x.isActive())&&x.isSelected()}}function Ce(e,t){function F(){f.style.opacity="1.0",x=!1,requestAnimationFrame(A.render)}function N(e){var t;x||A.viewCubeMenuOpen||(t=Math.max(4*Math.abs((e.clientX-u.x)/u.w-.5)-1,0),e=Math.max(4*Math.abs((e.clientY-u.y)/u.h-.5)-1,0),t=Math.max(0,Math.min(Math.sqrt(t*t+e*e),1)),f.style.opacity=1-t*(1-A.inactiveOpacity))}function j(){f.style.opacity=A.inactiveOpacity,x=!0,A.render()}var _,V,r,k,n,c,U,G,o,z,h,a,s,l,u,A=this,p=(this.viewer=e).cameraControl,W=e.camera,f=e.viewBoxDiv,i=(this.viewCubeMenuOpen=!1,{}),Y=(this.boxSize=void 0===t?235:t,A.currentFace="front",["top,front","top,right","top,left","top,back","bottom,front","bottom,right","bottom,left","bottom,back","left,front","front,right","right,back","back,left"]),X=["front,top,right","back,top,right","front,top,left","back,top,left","front,bottom,right","back,bottom,right","front,bottom,left","back,bottom,left"],y=null,d=(f.getBoundingClientRect(),A.camera=new THREE.PerspectiveCamera(45,window.innerWidth/window.innerHeight,1,2e3),this.originCamInfo={},[]),m=[],g=[],v=[],E=[],Q=null,Z=null,M=null,w=0,q=0,K=!0,J=!1,$=!1,ee=!1,b=!1,x=!1,I=[],te=(this.width=0,this.height=0,this.animSpeed=500,this.animate=!0,this.compass=!1,this.viewScaleFactorCompass=1.5,this.viewScale=1,this.draggable=!1,this.wantHomeButton=!1,this.wantRollArrows=!0,this.wantContextMenu=!1,this.inactiveOpacity=.5,this.getPicSrc=function(e){e=e.split("/"),e=e[e.length-1];return"VCarrows.png"==e?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAACXBIWXMAAArwAAAK8AFCrDSYAAAAIGNIUk0AAHxpAAB8jwAA/qkAAICUAAB5PAAA8TsAADeRAAAmhApr+WQAAAa2SURBVHja7J1PaJNnHMd/T5Jp98bM+i7TGrBZtzTtDoMGqlawUvQileKEIXqwOYkXRTxZFKQMlN6c6EXKDomHjl6cBMt2UMQeLBhIwUubZWtSR4wue42LeVddkmeHJKNIq++bv++f7wdCIeR9S9/vp7/f8z7v+z5hnHMC5sWCQwABAAQAEABAAAABAAQAEACYBpve/wDGGBHRV4yxY7zEOGI1eAUoh16h12KxHIvH492I0wQCMMaoMn3NGOu1WCzH4/F4d7FYRJpGF2C98HE9wwQCIHwTC4DwG3hstX4QVYRfdLvdsXV2Ey//zJRfKSLKcM5TEEDDAqj8zy+uV9GSyeQzIqJYLPY6k8kUwuFw/tGjR5ZoNGory5Eq/4xzzlcggD7LfrGalpZMJp+Fw+FX4XA4HwqFrJIk/UlEC0S0YIYKoYcWoLTnVyXAWkLcu3fvZTAYpGg0+rosw7xRZdB6C1Az4KuLAKuRJCl99+7dF2UZ0kQ0V64MKxBAW+E3RIDVxGKxp8Fg8FUgECiWRZgzggiaFcBqtX6XSCQ8Kmb4GipAhVwul52cnFwOBAIWSZIeE9EDPYuAClAl+Xz+zczMzNKZM2fe6rkiaPosgEoXelo2BlBTEa5evVogop855/MQoDUStESA1QPGS5cupUKhULIsQgoC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5Dp8AFAwgnwMHwAUiiBfwwcABSLI5/ABQJkI8jZ8Ivx/AZoPKwAAIABAAIAAAAEAAgAEAAgAEAAgAEAAgAAAAQACAAQACAAQACAAQACAAAABAAIABAAIABAAIABAAIAAAAEAAgAEAAgAEAAgAEAAgOTZvwMATRi8gArAJm8AAAAASUVORK5CYII=":"VCcontext.png"==e?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAAAsSAAALEgHS3X78AAAAIGNIUk0AAH7FAACLdgAA9UcAAIsOAABxUAAA6BUAADlYAAAfBMec4XAAAAEBSURBVHja7JcxCsIwFIb/V3oFx04v4iB4A3ev4Ak9iOABOhQcageHDh7iuVSwpW1eYmIFEwiFQvN9SZP/ERIRLNkyLNySQBLIhy+I6AhgE5F5FZHTpACAbV3X61h0Zs5nVwBAJiL0rd+eNuHvnQIArTEmplhrE7gAWEUUePSO/Vg1jJgFvQyYWoFoWTDMgLlNWDFzIyIUqjNzA6DSCpwBlMaYW4iZd+OU3bh2ARG5h5J4h3fj6nIghIQNbg2iTyQ0cFUS+kho4eoodpFwgTvVAo2EK9y5GM1J+MC9quGYhC98shaoPiQqAOwB7Hzhrxn1umMrABy6pxeT0t3w7wWeAwD5qe4YizvzugAAAABJRU5ErkJggg==":"VCcontextS.png"==e?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAAAsSAAALEgHS3X78AAAAIGNIUk0AAH7FAACLdgAA9UcAAIsOAABxUAAA6BUAADlYAAAfBMec4XAAAAEVSURBVHja7JcxDoJAEEX/rvY2HMEb6AEsaTDxBngKIzfgDBR6AxJtiI0egN7Ght6GWBIYGzVKQHaQDYU7yYSwxb5HMvs3CCJCnyXRcxkBIzAsLwyWpx0ARyNzn29m81oBAE60mmqj237smBkwAl9PAfIssv3Y1kbMs+j9VZQvIyHEGMBI40enRHSpFdCcBR8ZUJcD2rKgnAH1Q5gmnu3HXcO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zxFQnPBYyU0JzxGQnPDD0mIbVnh+xJTgeKv4L/MRFGawLyqqt56RiaTyVUO+HA4nAPBtvlaIACPwIUtz3cJA228RBHiHrgHVsACCKXtvAHvwJldRMRA2xUi+16BT8ABqzKE4IFl422IrR8zENn3FUL4MB7ZH7pOvgdOAieBk0DO2vgvEJFz4BYYRITQb0F0KIymwEMziLYbesClrQt6AL5LQPbE8MJif7krPtUWpCIhWlOi29na41v9G+ao7wEA29D8X0f9dpYAAAAASUVORK5CYII=":"VChomeS.png"==e?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAAAsSAAALEgHS3X78AAAAIGNIUk0AAH8nAAB4zgABAecAAH1lAAB+pAAA60MAADfoAAAl6h9/B7IAAAF8SURBVHja7JdNTsJAFIC/eW1QYzyFV+ACLgS27q1hJ3gCjsAJUHdGDuCWIgkX4ABsPIOLxh9+2uemNQURaGnLhpfMos30fd+bSV87RlXZZ9hpHjLGGLl5vUXsewCCeTN4vnzUNNWoaqIBGHHcptSHOhh7Ohh7KvWhiuM2AZM0nySu3HEbWKVOv1X+vd9vlcEqdcRxG8YYkySn7ArfVUKygO8iIVnB00pIlvA0EpI1PKmE5AFPIiF5wbeVkDzh20hI3vBNElIEfJ2ECXt77vB4VNoj8Kd3Qbf6IIBVJDy+EoBlAxb+rFdpj2oLE/KqPAp/1osENOhWroFTwJb68C1RouXKNkTwdHEOzIEPQO3wwgM+geMCduAd+AZ8YG6ragBMo7ehAIGJqn6FvGQ/JHnEQeAgcBDYu4CJn6aMMSfi9F6wjqq50PyJG3RrV/FGtNz5SsBZ+F34b3U0NhaKiY2Vn4Gw/3tR52XFZAkPrNaaRGlDo/4fyvzdgn3EzwAYdgRqNummZQAAAABJRU5ErkJggg==":"back.png"==e?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcw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AGAGcAcAYAZwBwBgBnAHAGAGcAcAYAZwBwBgBnAHAGAGcAcAYAZwBwBoAWwn8GG/BweZN80wAAAABJRU5ErkJggg==":void 0},function(e){e=e.getBoundingClientRect();return{x:e.left,y:e.top,w:e.width,h:e.height}}),e=function(e){e.preventDefault(),e.stopPropagation(),$=document.pointerLockElement===f||document.mozPointerLockElement===f||document.webkitPointerLockElement===f},t=function(e){return e},T=(this.getView=function(){return A.center.clone().sub(A.camera.position)},function(){var e=new THREE.Vector3(1,1,1);e.normalize(),e.multiplyScalar(A.viewScale),A.camera.position.copy(e),A.center=new THREE.Vector3(0,0,0),A.camera.up.set(0,1,0),A.camera.lookAt(A.center),A.originCamInfo.position=e,A.originCamInfo.center=A.center.clone(),A.originCamInfo.up=new THREE.Vector3(0,1,0)}),S=function(e){var t=new Image,n=(t.crossOrigin="anonymous",new THREE.Texture(t));return t.onload=function(){n.needsUpdate=!0,11<=++q&&requestAnimationFrame(A.render)},_e.singleHTML?t.src=A.getPicSrc(e):t.src=e,n},ne=function(){var e,t,n=[],i=[];for(n[0]=P(0,0),n[1]=P(0,Math.PI/2),n[2]=P(0,-Math.PI/2),n[3]=P(0,Math.PI),n[4]=P(Math.PI/2,0),n[5]=P(Math.PI/2,Math.PI/2),n[6]=P(Math.PI/2,-Math.PI/2),n[7]=P(Math.PI/2,Math.PI),i[0]=B(0,0,0),i[1]=B(0,Math.PI/2,0),i[2]=B(0,-Math.PI/2,0),i[3]=B(0,Math.PI,0),i[4]=B(Math.PI/2,0,0),i[5]=B(Math.PI/2,Math.PI/2,0),i[6]=B(Math.PI/2,-Math.PI/2,0),i[7]=B(Math.PI/2,Math.PI,0),i[8]=B(0,0,Math.PI/2),i[9]=B(0,0,-Math.PI/2),i[10]=B(-Math.PI/2,0,-Math.PI/2),i[11]=B(-Math.PI,0,-Math.PI/2),d.push(ue(0,0)),d[0].name="front",g.push(d[0]),E.push(d[0]),r.add(d[0]),d.push(ue(0,Math.PI/2)),d[1].name="right",g.push(d[1]),E.push(d[1]),r.add(d[1]),d.push(ue(0,Math.PI)),d[2].name="back",g.push(d[2]),E.push(d[2]),r.add(d[2]),d.push(ue(0,-Math.PI/2)),d[3].name="left",g.push(d[3]),E.push(d[3]),r.add(d[3]),d.push(ue(Math.PI/2,0)),d[4].name="bottom",g.push(d[4]),E.push(d[4]),r.add(d[4]),d.push(ue(-Math.PI/2,0)),d[5].name="top",g.push(d[5]),E.push(d[5]),r.add(d[5]),e=d.length,t=0;tn)return},Se.isEmptyObject=function(e){for(var t in e)return!1;return!0},Se.getObjectSize=function(e){var t,n=0;for(t in e)++n;return n},Se.disposeObject=function(e){if(0==e.children.length)e.geometry&&e.geometry.dispose(),e.material&&e.material.dispose();else for(var t=0;to.x||r.y>o.y||r.z>o.z)return;p.controls.setBoundingBox(r,o)}i=new THREE.Vector3,i.x=.5*(o.x+r.x),i.y=.5*(o.y+r.y),i.z=.5*(o.z+r.z),a=new THREE.Vector3;(a=a.subVectors(o,r)).length()<1e-6&&a.set(1,1,1);var o=.5*a.length()/Math.sin(Math.PI/180*p.camera.fov*.5),r=(p.camera.IsPerspective()&&p.camera.aspect<1&&(o/=p.camera.aspect),0==o&&(o=1e-4),1!=Number(p.disratio)&&(o*=Number(p.disratio)),p.controls.getExplosionBoundingBox()||(p.camera.far=5*o,p.camera.setZoomToFitRatio(5),p.camera.far<1e3&&(p.camera.setZoomToFitRatio(1e3/o),p.camera.far=1e3),2e3.25*a.length()&&(p.camera.near=.25*a.length()),p.camera.perpNear>.25*a.length()&&(p.camera.perpNear=.25*a.length())),null),a=null;n?((r=n.dir.clone().normalize()).multiplyScalar(o),a=i.clone().sub(r)):((r=new THREE.Vector3(0,0,1).applyQuaternion(p.camera.quaternion)).multiplyScalar(o),(a=new THREE.Vector3).addVectors(i,r)),s||(p.groundShadow.updateGroundTransform(p.camera,p.controls.getBoundingBox()),p.is2DModel?p.camera.setOrthoNear(p.modelRootObject.boundingBox.clone()):p.camera.setOrthoNear(p.controls.getBoundingBox()),p.camera.getOrginalCameraInfo())||p.camera.setOrginalCameraInfo({center:i.clone(),up:n?n.up.clone():new THREE.Vector3(0,1,0),position:a}),!0===t&&p.camera.getOrginalCameraInfo()&&(i.copy(p.camera.getOrginalCameraInfo().center),a.copy(p.camera.getOrginalCameraInfo().position),p.camera.getOrginalCameraInfo().fov&&(p.camera.fov=p.camera.getOrginalCameraInfo().fov),p.camera.getOrginalCameraInfo().near&&p.camera.IsPerspective()==p.camera.getOrginalCameraInfo().isPerspective&&(p.camera.near=p.camera.getOrginalCameraInfo().near),p.camera.getOrginalCameraInfo().far)&&p.camera.IsPerspective()==p.camera.getOrginalCameraInfo().isPerspective&&(p.camera.far=p.camera.getOrginalCameraInfo().far),p.camera.updateProjectionMatrix(),p.camera.updateMatrixWorld(!0),void 0===e||e?(o={center:i,up:(n||p.camera).up.clone(),position:a},!0===t&&p.camera.getOrginalCameraInfo()&&p.camera.getOrginalCameraInfo().up&&(o.up=p.camera.getOrginalCameraInfo().up),n&&n.animationSpeed&&(o.animationSpeed=n.animationSpeed),n&&!0===n.sphericalTransition?v.sphericalTransition(o,n.callback):p.startSmoothTranslation(o,l)):(n&&n.up&&p.camera.up.copy(n.up.clone()),!0===t&&p.camera.getOrginalCameraInfo()&&p.camera.getOrginalCameraInfo().up&&p.camera.up.copy(p.camera.getOrginalCameraInfo().up),p.camera.position.copy(a),p.camera.setCameraTarget(i),p.camera.updateProjectionMatrix(),p.camera.updateMatrixWorld(!0),A&&v.updateViewBoxCamDir(),p.render(),l()),_e.autoSwitchFirstPersonView&&"FirstPerson"==p.getModelOperationMode()&&p.setModelOperationModeInternal(p.originalModelOperationMode)},this.sphericalTransition=function(e,a){var s,l,t,n,d,c,i,r,o,h,u;f=Date.now(),m=0,null==g&&(s=new THREE.Quaternion,l=new THREE.Quaternion,t=new THREE.Quaternion,n=new THREE.Quaternion,d=p.camera.getCameraTarget().clone().sub(p.camera.position).length(),c=e.center.clone().sub(e.position).length(),i=e.center.clone().sub(e.position).normalize(),h=(o=(r=p.camera.getCameraTarget().clone().sub(p.camera.position).normalize()).clone().cross(p.camera.up).normalize()).clone().cross(r).normalize(),(u=new THREE.Matrix4).set(r.x,h.x,o.x,0,r.y,h.y,o.y,0,r.z,h.z,o.z,0,0,0,0,1),s.setFromRotationMatrix(u),h=(o=(r=i).clone().cross(e.up).normalize()).clone().cross(r).normalize(),u.set(r.x,h.x,o.x,0,r.y,h.y,o.y,0,r.z,h.z,o.z,0,0,0,0,1),t.setFromAxisAngle(r,0),n.setFromAxisAngle(h,0),l.setFromRotationMatrix(u),l.multiply(t).multiply(n).normalize(),function e(t,n){var i,r,o;_e.enableBroadcast&&!_e.broadcastMajor||(r=p.camera.position.distanceToSquared(t.position),(i=new THREE.Vector3).subVectors(p.camera.up,t.up),r=r<1e-6&&Math.abs(i.x)<1e-5&&Math.abs(i.y)<1e-5&&Math.abs(i.z)<1e-5,!p.getEnableSmoothTranslation()||1<=m||r?(m=1,p.camera.position.copy(t.position),p.camera.up.copy(t.up),p.camera.setCameraTarget(t.center.clone()),p.camera.lookAt(v.center()),p.camera.updateMatrixWorld(!0),p.camera.updateProjectionMatrix(),p.render(),A&&(i=t.center.clone().sub(t.position),(r=A.center.clone().sub(i).normalize()).multiplyScalar(A.viewScale),A.camera.position.copy(r),A.camera.up.copy(t.up),A.camera.lookAt(A.center),A.render()),null!=g&&cancelAnimationFrame(g),g=null,A&&A.render(),void 0!==(i=p.getLoadingManager()).onSmoothTranslationDone&&i.onSmoothTranslationDone(),n&&n()):(i=1-(r=Se.linearClamp(m,0,1)),o=(n=Date.now())-f,f=n,t.animationSpeed?m+=o/t.animationSpeed:m+=o/500,n=new THREE.Matrix4,(o=s.clone()).slerp(l,r),n.makeRotationFromQuaternion(o),o=Se.linearInterp(r,d,c),n=n.elements,i=p.camera.getCameraTarget().clone().multiplyScalar(i).add(t.center.clone().multiplyScalar(r)),r=t.center.clone().sub(new THREE.Vector3(n[0],n[1],n[2]).multiplyScalar(o)),o=new THREE.Vector3(n[4],n[5],n[6]),p.camera.position.copy(r),p.camera.up.copy(o),p.camera.setCameraTarget(i),p.camera.updateProjectionMatrix(),p.render(),A&&(r=A.center.clone().sub(new THREE.Vector3(n[0],n[1],n[2]).multiplyScalar(A.viewScale)),A.camera.position.copy(r),A.camera.up.copy(o),A.camera.lookAt(A.center),A.render()),g=requestAnimationFrame(function(){e(t,a)})))}(e,a))},this.startSmoothTranslation=function(e,t){f=Date.now(),m=0,null!=g&&(cancelAnimationFrame(g),g=null),v.smoothTranslation(e,t)},this.isSmoothTranslationDone=function(){return null==g},this.smoothTranslation=function(e,t){var n,i,r,o,a,s;_e.enableBroadcast&&!_e.broadcastMajor||e&&(o=p.camera.position.distanceToSquared(e.position),(i=new THREE.Vector3).subVectors(p.camera.up,e.up),r=e.center.clone().sub(e.position),A&&(n=A.center.clone().sub(r).normalize()).multiplyScalar(A.viewScale),r=o<1e-6&&Math.abs(i.x)<1e-5&&Math.abs(i.y)<1e-5&&Math.abs(i.z)<1e-5,!p.getEnableSmoothTranslation()||1<=m||r?(m=1,p.camera.position.copy(e.position),p.camera.up.copy(e.up),p.camera.setCameraTarget(e.center.clone()),p.camera.lookAt(v.center()),p.camera.updateMatrixWorld(!0),p.camera.updateProjectionMatrix(),p.render(),A&&(A.camera.position.copy(n),A.camera.up.copy(e.up),A.camera.lookAt(A.center),v.updateViewBoxCamDir()),null!=g&&cancelAnimationFrame(g),g=null,A&&A.render(),void 0!==(o=p.getLoadingManager()).onSmoothTranslationDone&&o.onSmoothTranslationDone(),t&&t()):(r=1-(i=Se.linearClamp(m,0,1)),a=(o=Date.now())-f,f=o,e.animationSpeed?m+=a/e.animationSpeed:m+=a/1e3,o=p.camera.getCameraTarget().clone().multiplyScalar(r).add(e.center.clone().multiplyScalar(i)),a=p.camera.position.clone().multiplyScalar(r).add(e.position.clone().multiplyScalar(i)),s=p.camera.up.clone().multiplyScalar(r).add(e.up.clone().multiplyScalar(i)),p.camera.position.copy(a),p.camera.up.copy(s),p.camera.setCameraTarget(o),p.camera.updateProjectionMatrix(),p.camera.updateMatrixWorld(!0),p.render(),A&&((a=A.camera.position.clone().multiplyScalar(r).add(n.clone().multiplyScalar(i))).normalize(),a.multiplyScalar(A.viewScale),A.camera.position.copy(a),A.camera.up.copy(s),A.camera.lookAt(A.center),A.render()),g=requestAnimationFrame(function(){v.smoothTranslation(e,t)})))},this.resetOperationMode=function(){var e=p.getModelOperationMode();_e.autoSwitchFirstPersonView&&"FirstPerson"==e&&!p.controls.getBoundingBox().containsPoint(p.camera.position)&&p.setModelOperationModeInternal(p.originalModelOperationMode)},this.zoomToObject=function(e,t){var n=new THREE.Vector3,i=new THREE.Vector3,r=p.controls.IsBoundingBoxUpdated(),e=(p.computeBoundingBox(e,n,i,{flag:!0}),new THREE.Vector3),o=(e.x=.5*(i.x+n.x),e.y=.5*(i.y+n.y),e.z=.5*(i.z+n.z),new THREE.Vector3);(i=.5*(o=o.subVectors(i,n)).length())<1e-6||(n=i/Math.sin(Math.PI/180*p.camera.fov*.5),p.camera.IsPerspective()&&p.camera.aspect<1&&(n/=p.camera.aspect),0==n&&(n=1e-4),p.controls.getExplosionBoundingBox()||(p.camera.far<5*n&&(p.camera.far=5*n),p.camera.setZoomToFitRatio(5),p.camera.far<1e3&&(p.camera.setZoomToFitRatio(1e3/n),p.camera.far=1e3),2e3.5*o.length()&&(p.camera.near=.25*o.length())),(i=new THREE.Vector3(0,0,1).applyQuaternion(p.camera.quaternion)).multiplyScalar(n),(o=new THREE.Vector3).addVectors(e,i),r||(p.groundShadow.updateGroundTransform(p.camera,p.controls.getBoundingBox()),p.camera.setOrthoNear(p.controls.getBoundingBox()),p.camera.getOrginalCameraInfo())||p.camera.setOrginalCameraInfo({center:e.clone(),up:new THREE.Vector3(0,1,0),position:o}),p.camera.updateProjectionMatrix(),void 0===t||t?(n={center:e,up:p.camera.up,position:o},v.startSmoothTranslation(n,l)):(p.camera.position.copy(o),p.camera.setCameraTarget(e),p.render(),l()),i=p.controls.getBoundingBox().containsPoint(o),r=p.getModelOperationMode(),_e.autoSwitchFirstPersonView&&"hall"!=r&&(i?"FirstPerson"!=r&&p.setModelOperationModeInternal("FirstPerson"):"FirstPerson"==r&&p.setModelOperationModeInternal(p.originalModelOperationMode)))},this.setModelUpDirection=function(e,t){var n=-1;0-.25*Math.PI&&e.latAngle<.25*Math.PI?s.applyAxisAngle(d,n):e.latAngle+=n,o.addVectors(r,s),this.adjustNearAndFar(),this.viewer.camera.lookAt(o),e.render(),A&&v.updateViewBoxCamDir()},this.calFarthestDistToCamera=function(){var e=this.viewer.controls.getExplosionBoundingBox(),t=(e=null==e?this.viewer.controls.getBoundingBox():e).getCenter(new THREE.Vector3),e=.5*(new THREE.Vector3).subVectors(e.max,e.min).length(),t=this.viewer.camera.position.distanceTo(t);return t+=e},this.pan=function(e,t,n){var i=[e.downModelPnt.x,e.downModelPnt.y,e.downModelPnt.z],i=this.viewer.modelCoordToClientCoord(i),t=[i[0]+t.x,i[1]-t.y,i[2]],i=this.viewer.clientCoordToModelCoord(t),t=new THREE.Vector3(i[0],i[1],i[2]).clone();t.sub(e.downModelPnt),this.viewer.camera.position.add(t),this.center().add(t),!1!==n&&e.render()},this.moveForwardBack=function(e,t,n){var i=this.center(),r=this.viewer.camera.position,o=(r.distanceTo(i),new THREE.Vector3),i=(o.subVectors(i,r),.03);this.viewer.controls.getBoundingBox().containsPoint(this.viewer.camera.position)&&(i=.01),o.multiplyScalar(i),0==t&&o.negate(),this.viewer.camera.position.add(o),this.center().add(o),!1!==n&&p.render()},this.setBoundingBox=function(e,t){i.set(e,t),a=i.getCenter()},this.setBoundingBoxCenter=function(e){a=e},this.adjustNearAndFar=function(){var e,t,n;this.viewer.is2DModel||(e=null,e=(this.viewer.controls.getExplosionBoundingBox()?this.viewer.controls.getExplosionBoundingBox():a?i:this.viewer.controls.getBoundingBox()).clone(),this.viewer.pmiObject&&(n=this.viewer.calculatePMIBoundingBox())&&!e.containsBox(n)&&e.union(n),n=new THREE.Vector3,e.getCenter(n),e=e.min.distanceTo(e.max),t=this.viewer.camera.position.clone(),n=Math.abs(n.distanceTo(t))+1.2*e,this.viewer.camera.adjustNearFar(n,n))},this.zoom=function(e,t,n,i){if(this.viewer.is2DViewer)(o=this.camDisTo2DViewer())o)||(t.applyMatrix3(e.normalMatrix.getNormalMatrix(this.viewer.camera.matrix)),r=this.viewer.camera.IsPerspective(),this.viewer.camera.position.add(t),r&&this.center().add(t),this.adjustNearAndFar(),this.viewer.camera.updateProjectionMatrix(),!1!==i&&e.render());else{if(n){if(this.zoomByMouse(e,t,n,i))return}else if("hall"==this.viewer.getModelOperationMode())return void(0!=t.z&&(0this.viewer.camera.far&&(this.viewer.camera.far=n),!1!==i&&e.render()}},this.zoomByMouse=function(e,t,n,i){var r=this.viewer.renderer.domElement,o=this.viewer.renderer.getPixelRatio(),a=n.offsetX||n.clientX-this.viewer.container.getBoundingClientRect().left,s=n.offsetY||n.clientY-this.viewer.container.getBoundingClientRect().top,n=(n.srcElement&&n.srcElement!==this.viewer.renderer.domElement&&(a=n.clientX-this.viewer.container.getBoundingClientRect().left,s=n.clientY-this.viewer.container.getBoundingClientRect().top),null==n.srcElement&&n.target&&n.target!==this.viewer.renderer.domElement&&(a=n.clientX-this.viewer.container.getBoundingClientRect().left,s=n.clientY-this.viewer.container.getBoundingClientRect().top),this.viewer.camera.position.clone()),l=(n.sub(this.center()),n.length()),a=(n.multiplyScalar(.7),n.add(this.center()),n.project(this.viewer.camera),new THREE.Vector3(a*o/r.width*2-1,2*-(s*o/r.height)+1,n.z)),s=this.viewer.camera.IsPerspective(),o=this.viewer.getModelOperationMode();if("hall"==o&&((r=this.viewer.controls.getBoundingBox().getCenter()).project(this.viewer.camera),a.copy(r)),a.unproject(this.viewer.camera),!isFinite(a.x)||!isFinite(a.y)||!isFinite(a.z))return!1;var n=this.viewer.camera.position.clone(),r=(n.sub(this.center()),n.length(),this.center().clone()),a=(r.sub(a),M),t=t.z,d=this.viewer.controls.getBoundingBox(),c=d.containsPoint(this.viewer.camera.position),c=(c&&t<0&&(a*=.6),_e.autoSwitchFirstPersonView&&"hall"!=o&&(c?"FirstPerson"!=o&&(this.viewer.setModelOperationModeInternal("FirstPerson"),e.latAngle=0):"FirstPerson"==o&&this.viewer.setModelOperationModeInternal(this.viewer.originalModelOperationMode)),this.viewer.camera.position.clone()),o=this.center().clone(),h=new THREE.Vector3,u=(h.x=(n.x+r.x)*a/t,h.y=(n.y+r.y)*a/t,h.z=(n.z+r.z)*a/t,new THREE.Vector3);u.x=r.x*a/t,u.y=r.y*a/t,u.z=r.z*a/t,c.add(h),o.add(u);var p,f,m,r=.8*d.min.distanceTo(d.max),a=(lthis.viewer.camera.far&&(this.viewer.camera.far=l),this.viewer.camera.updateProjectionMatrix(),s||(p=this.viewer.camera.getOrginalCameraInfo(),m=20/(f=new THREE.Vector3(p.position.x-p.center.x,p.position.y-p.center.y,p.position.z-p.center.z).length())*this.viewer.camera.position.clone().sub(this.center()).length(),this.viewer.dispatchEvent({type:"dischange",distance:m=(m=100= edgeVert;","float lengthSign = horzSpan ? -resolution.y : -resolution.x;","if(!horzSpan){"," lumaN = lumaW;"," lumaS = lumaE;","}","float gradientN = abs(lumaN - lumaM);","float gradientS = abs(lumaS - lumaM);","lumaN = (lumaN + lumaM) * 0.5;","lumaS = (lumaS + lumaM) * 0.5;","bool pairN = gradientN >= gradientS;","if(!pairN){"," lumaN = lumaS;"," gradientN = gradientS;"," lengthSign *= -1.0;","}","vec2 posN;","posN.x = vUv.x + (horzSpan ? 0.0 : lengthSign * 0.5);","posN.y = vUv.y + (horzSpan ? lengthSign * 0.5 : 0.0);","gradientN *= FXAA_SEARCH_THRESHOLD;","vec2 posP = posN;","vec2 offNP = horzSpan ? vec2(resolution.x, 0.0) : vec2(0.0, resolution.y);","float lumaEndN = lumaN;","float lumaEndP = lumaN;","bool doneN = false;","bool doneP = false;","posN += offNP * vec2(-1.0, -1.0);","posP += offNP * vec2( 1.0, 1.0);","for(int i = 0; i < FXAA_SEARCH_STEPS; i++) {"," if(!doneN) lumaEndN = FxaaLuma(texture2D( tDiffuse, posN.xy).xyz);"," if(!doneP) lumaEndP = FxaaLuma(texture2D( tDiffuse, posP.xy).xyz);"," doneN = doneN || (abs(lumaEndN - lumaN) >= gradientN);"," doneP = doneP || (abs(lumaEndP - lumaN) >= gradientN);"," if(doneN && doneP) break;"," if(!doneN) posN -= offNP;"," if(!doneP) posP += offNP;","}","float dstN = horzSpan ? vUv.x - posN.x : vUv.y - posN.y;","float dstP = horzSpan ? posP.x - vUv.x : posP.y - vUv.y;","bool directionN = dstN < dstP;","lumaEndN = directionN ? lumaEndN : lumaEndP;","if(((lumaM - lumaN) < 0.0) == ((lumaEndN - lumaN) < 0.0))"," lengthSign = 0.0;","float spanLength = (dstP + dstN);","dstN = directionN ? dstN : dstP;","float subPixelOffset = (0.5 + (dstN * (-1.0/spanLength))) * lengthSign;","vec3 rgbF = texture2D(tDiffuse, vec2("," vUv.x + (horzSpan ? 0.0 : subPixelOffset),"," vUv.y + (horzSpan ? subPixelOffset : 0.0))).xyz;","gl_FragColor = vec4(FxaaLerp3(rgbL, rgbF, blendL), opacity);","}"].join("\n"),{uniforms:{tDiffuse:{type:"t",value:null},resolution:{type:"v2",value:new THREE.Vector2(1/1024,1/512)}},vertexShader:["void main() {","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform vec2 resolution;","#define FXAA_REDUCE_MIN (1.0/128.0)","#define FXAA_REDUCE_MUL (1.0/8.0)","#define FXAA_SPAN_MAX 8.0","void main() {","vec3 rgbNW = texture2D( tDiffuse, ( gl_FragCoord.xy + vec2( -1.0, -1.0 ) ) * resolution ).xyz;","vec3 rgbNE = texture2D( tDiffuse, ( gl_FragCoord.xy + vec2( 1.0, -1.0 ) ) * resolution ).xyz;","vec3 rgbSW = texture2D( tDiffuse, ( gl_FragCoord.xy + vec2( -1.0, 1.0 ) ) * resolution ).xyz;","vec3 rgbSE = texture2D( tDiffuse, ( gl_FragCoord.xy + vec2( 1.0, 1.0 ) ) * resolution ).xyz;","vec4 rgbaM = texture2D( tDiffuse, gl_FragCoord.xy * resolution );","vec3 rgbM = rgbaM.xyz;","vec3 luma = vec3( 0.299, 0.587, 0.114 );","float lumaNW = dot( rgbNW, luma );","float lumaNE = dot( rgbNE, luma );","float lumaSW = dot( rgbSW, luma );","float lumaSE = dot( rgbSE, luma );","float lumaM = dot( rgbM, luma );","float lumaMin = min( lumaM, min( min( lumaNW, lumaNE ), min( lumaSW, lumaSE ) ) );","float lumaMax = max( lumaM, max( max( lumaNW, lumaNE) , max( lumaSW, lumaSE ) ) );","vec2 dir;","dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));","dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));","float dirReduce = max( ( lumaNW + lumaNE + lumaSW + lumaSE ) * ( 0.25 * FXAA_REDUCE_MUL ), FXAA_REDUCE_MIN );","float rcpDirMin = 1.0 / ( min( abs( dir.x ), abs( dir.y ) ) + dirReduce );","dir = min( vec2( FXAA_SPAN_MAX, FXAA_SPAN_MAX),","max( vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),","dir * rcpDirMin)) * resolution;","vec4 rgbA = (1.0/2.0) * (","texture2D(tDiffuse, gl_FragCoord.xy * resolution + dir * (1.0/3.0 - 0.5)) +","texture2D(tDiffuse, gl_FragCoord.xy * resolution + dir * (2.0/3.0 - 0.5)));","vec4 rgbB = rgbA * (1.0/2.0) + (1.0/4.0) * (","texture2D(tDiffuse, gl_FragCoord.xy * resolution + dir * (0.0/3.0 - 0.5)) +","texture2D(tDiffuse, gl_FragCoord.xy * resolution + dir * (3.0/3.0 - 0.5)));","float lumaB = dot(rgbB, vec4(luma, 0.0));","if ( ( lumaB < lumaMin ) || ( lumaB > lumaMax ) ) {","gl_FragColor = rgbA;","} else {","gl_FragColor = rgbB;","}","}"].join("\n")}),ze={uniforms:{tDiffuse:{type:"t",value:null},resolution:{type:"v2",value:new THREE.Vector2(1/1024,1/512)}},vertexShader:["uniform vec2 resolution;","varying vec2 vPos;","varying vec4 vPosPos;","void main() {","vPos = uv;","vPosPos.xy = uv + vec2(-0.5, -0.5) * resolution;","vPosPos.zw = uv + vec2( 0.5, 0.5) * resolution;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#define FXAA_EDGE_SHARPNESS (8.0)","#define FXAA_EDGE_THRESHOLD (0.125)","#define FXAA_EDGE_THRESHOLD_MIN (0.05)","#define FXAA_RCP_FRAME_OPT (0.50)","#define FXAA_RCP_FRAME_OPT2 (2.0)","uniform sampler2D tDiffuse;","uniform highp vec2 resolution;","varying vec2 vPos;","varying vec4 vPosPos;","float FxaaLuma(vec3 rgb) {","return dot(rgb, vec3(0.299, 0.587, 0.114));","}","void main() {","float lumaNw = FxaaLuma(texture2D(tDiffuse, vPosPos.xy).rgb);","float lumaSw = FxaaLuma(texture2D(tDiffuse, vPosPos.xw).rgb);","float lumaNe = FxaaLuma(texture2D(tDiffuse, vPosPos.zy).rgb) + 1.0/384.0;","float lumaSe = FxaaLuma(texture2D(tDiffuse, vPosPos.zw).rgb);","vec3 rgbM = texture2D(tDiffuse, vPos.xy).rgb;","float lumaM = FxaaLuma(rgbM.rgb);","float lumaMax = max(max(lumaNe, lumaSe), max(lumaNw, lumaSw));","float lumaMin = min(min(lumaNe, lumaSe), min(lumaNw, lumaSw));","float lumaMaxSubMinM = max(lumaMax, lumaM) - min(lumaMin, lumaM);","float lumaMaxScaledClamped = max(FXAA_EDGE_THRESHOLD_MIN, lumaMax * FXAA_EDGE_THRESHOLD);","if (lumaMaxSubMinM < lumaMaxScaledClamped) {","gl_FragColor = vec4(rgbM, 1.0);","return;","}","float dirSwMinusNe = lumaSw - lumaNe;","float dirSeMinusNw = lumaSe - lumaNw;","vec2 dir1 = normalize(vec2(dirSwMinusNe + dirSeMinusNw, dirSwMinusNe - dirSeMinusNw));","vec3 rgbN1 = texture2D(tDiffuse, vPos.xy - dir1 * FXAA_RCP_FRAME_OPT*resolution).rgb;","vec3 rgbP1 = texture2D(tDiffuse, vPos.xy + dir1 * FXAA_RCP_FRAME_OPT*resolution).rgb;","float dirAbsMinTimesC = min(abs(dir1.x), abs(dir1.y)) * FXAA_EDGE_SHARPNESS;","vec2 dir2 = clamp(dir1.xy / dirAbsMinTimesC, -2.0, 2.0);","vec3 rgbN2 = texture2D(tDiffuse, vPos.xy - dir2 * FXAA_RCP_FRAME_OPT2*resolution).rgb;","vec3 rgbP2 = texture2D(tDiffuse, vPos.xy + dir2 * FXAA_RCP_FRAME_OPT2*resolution).rgb;","vec3 rgbA = rgbN1 + rgbP1;","vec3 rgbB = ((rgbN2 + rgbP2) * 0.25) + (rgbA * 0.25);","float lumaB = FxaaLuma(rgbB);","if ((lumaB < lumaMin) || (lumaB > lumaMax))","gl_FragColor = vec4(rgbA * 0.5, 1.0);","else","gl_FragColor = vec4(rgbB, 1.0);","}"].join("\n")},We=new THREE.ShaderMaterial({defines:{MAX_RADIUS:4},uniforms:{tDiffuse:{value:null},texSize:{value:new THREE.Vector2(.5,.5)},direction:{value:new THREE.Vector2(.5,.5)},kernelRadius:{value:1}},vertexShader:"varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n }",fragmentShader:"#include varying vec2 vUv; uniform sampler2D tDiffuse; uniform vec2 texSize; uniform vec2 direction; uniform float kernelRadius; float gaussianPdf(in float x, in float sigma) { return 0.39894 * exp( -0.5 * x * x/( sigma * sigma))/sigma; } void main() { vec2 invSize = 1.0 / texSize; float weightSum = gaussianPdf(0.0, kernelRadius); vec3 diffuseSum = texture2D( tDiffuse, vUv).rgb * weightSum; vec2 delta = direction * invSize * kernelRadius/float(MAX_RADIUS) * 0.5; vec2 uvOffset = delta; for( int i = 1; i <= MAX_RADIUS; i ++ ) { float w = gaussianPdf(uvOffset.x, kernelRadius); vec3 sample1 = texture2D( tDiffuse, vUv + uvOffset).rgb; vec3 sample2 = texture2D( tDiffuse, vUv - uvOffset).rgb; diffuseSum += ((sample1 + sample2) * w); weightSum += (2.0 * w); uvOffset += delta; } float alpha = texture2D( tDiffuse, vUv).a; gl_FragColor = vec4(diffuseSum/weightSum, alpha); }"}),Ye={uniforms:{tDiffuse:{value:null},resolution:{value:new THREE.Vector2}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","uniform sampler2D tDiffuse;","uniform vec2 resolution;","varying vec2 vUv;","bool IsSelected (vec3 color) {"," return (color.g<1e-8 && color.b < 1e-8 && color.r > 1e-3);","}","void main() {","float Alpha = 0.0;","vec2 texel = vec2( 0.5 / resolution.x, 0.5 / resolution.y );","texel = texel * vec2(2.0,2.0); ","bool Selected = false;","for( int i = -1; i <= 1;++i ) {","for (int j = -1; j <= 1; ++j){","Selected = IsSelected(texture2D( tDiffuse, vUv + texel * vec2( i,j ) ).rgb);","if (Selected) break;","}","if (Selected) break;","}","if(Selected)","Alpha = 1.0;","vec4 color = texture2D( tDiffuse, vUv);","float l = linearToRelativeLuminance( color.rgb );","gl_FragColor = vec4( l, l, l, Alpha );","}"].join("\n")},Xe=new THREE.ShaderMaterial({uniforms:{tDiffuse:{value:null},resolution:{value:new THREE.Vector2},selectColor:{value:new THREE.Color}},vertexShader:["varying vec2 vUv;","void main() { ","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform vec2 resolution;","uniform vec3 selectColor;","varying vec2 vUv;","void main() {","vec2 texel = vec2( 1.0 / resolution.x, 1.0 / resolution.y );","texel = texel * vec2(0.3,0.3); ","vec3 colorDest = vec3(0.0,0.0,0.0);","const mat3 Gx = mat3( -1, -2, -1, 0, 0, 0, 1, 2, 1 );","const mat3 Gy = mat3( -1, 0, 1, -2, 0, 2, -1, 0, 1 );","float tx0y0 = texture2D( tDiffuse, vUv + texel * vec2( -1, -1 ) ).r;","float tx0y1 = texture2D( tDiffuse, vUv + texel * vec2( -1, 0 ) ).r;","float tx0y2 = texture2D( tDiffuse, vUv + texel * vec2( -1, 1 ) ).r;","float tx1y0 = texture2D( tDiffuse, vUv + texel * vec2( 0, -1 ) ).r;","float tx1y1 = texture2D( tDiffuse, vUv + texel * vec2( 0, 0 ) ).r;","float tx1y2 = texture2D( tDiffuse, vUv + texel * vec2( 0, 1 ) ).r;","float tx2y0 = texture2D( tDiffuse, vUv + texel * vec2( 1, -1 ) ).r;","float tx2y1 = texture2D( tDiffuse, vUv + texel * vec2( 1, 0 ) ).r;","float tx2y2 = texture2D( tDiffuse, vUv + texel * vec2( 1, 1 ) ).r;","float valueGx = Gx[0][0] * tx0y0 + Gx[1][0] * tx1y0 + Gx[2][0] * tx2y0 + ","Gx[0][1] * tx0y1 + Gx[1][1] * tx1y1 + Gx[2][1] * tx2y1 + ","Gx[0][2] * tx0y2 + Gx[1][2] * tx1y2 + Gx[2][2] * tx2y2; ","float valueGy = Gy[0][0] * tx0y0 + Gy[1][0] * tx1y0 + Gy[2][0] * tx2y0 + ","Gy[0][1] * tx0y1 + Gy[1][1] * tx1y1 + Gy[2][1] * tx2y1 + ","Gy[0][2] * tx0y2 + Gy[1][2] * tx1y2 + Gy[2][2] * tx2y2; ","float G = sqrt( ( valueGx * valueGx ) + ( valueGy * valueGy ) );","float Alpha = 1.0;","float select = texture2D( tDiffuse, vUv ).a;","if(G < 0.95) ","{","discard;","}","if( abs(select - 1.0) < 1e-6)","{","colorDest = selectColor;","}","gl_FragColor = vec4( colorDest, Alpha );","}"].join("\n"),blending:THREE.NormalBlending,depthTest:!1,depthWrite:!1,transparent:!0}),V={vertexShader:["void main() {\n","#ifdef USE_MODELMATRIXATTRIB\n\tmat4 ndsModelViewMatrix = viewMatrix * modelMatrixAttrib;\n\tgl_Position = projectionMatrix * ndsModelViewMatrix * vec4( position, 1.0 );\n#else\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n#endif\n","}"].join("\n"),fragmentShader:["const float PackUpscale = 256. / 255.; // fraction -> 0..1 (including 1)","const float UnpackDownscale = 255. / 256.; // 0..1 -> fraction (excluding 1)","const vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );","const vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );","const float ShiftRight8 = 1. / 256.;","vec4 packDepthToRGBA( const in float v ) {","vec4 r = vec4( fract( v * PackFactors ), v );","r.yzw -= r.xyz * ShiftRight8; // tidy overflow","return r * PackUpscale;","}","float unpackRGBAToDepth( const in vec4 v ) {","return dot( v, UnpackFactors );","}","void main() {","gl_FragColor = packDepthToRGBA( gl_FragCoord.z);","}"].join("\n")},S=(["varying vec4 mvPosition;","void main() {","#ifdef USE_MODELMATRIXATTRIB\n\tmat4 ndsModelViewMatrix = viewMatrix * modelMatrixAttrib;\n\tmvPosition = ndsModelViewMatrix * vec4( position, 1.0 );\n#else\n\tmvPosition = modelViewMatrix * vec4( position, 1.0 );\n#endif\n","gl_Position = projectionMatrix * mvPosition;","}"].join("\n"),["uniform float cameraNear;","uniform float cameraFar;","varying vec4 mvPosition;","void main() {","float depth = gl_FragCoord.z / gl_FragCoord.w;","depth =smoothstep( cameraNear, cameraFar, depth );","gl_FragColor = vec4( mvPosition.xyz, depth);","}"].join("\n"),["varying vec3 vNormal;","void main() {","#ifdef USE_MODELMATRIXATTRIB\n\tmat4 ndsModelViewMatrix = viewMatrix * modelMatrixAttrib;\n\tvNormal = normalize( mat3(ndsModelViewMatrix) * normal );\n\tgl_Position = projectionMatrix * ndsModelViewMatrix * vec4( position, 1.0 );\n#else\n\tvNormal = normalize( mat3(modelViewMatrix) * normal );\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n#endif\n","}"].join("\n"),["varying vec3 vNormal;","void main() {","gl_FragColor = vec4( normalize(vNormal).xyz, 1.0);","}"].join("\n"),new THREE.Vector2(512,512),new THREE.Vector3(1,0,1),["varying vec2 vUv;","varying vec2 vExtent; ","vec2 getExtent() {"," vec2 extent;"," float a = projectionMatrix[2][2];"," float b = projectionMatrix[3][2];"," float nearOrthographic = (b + 1.0) / a;"," float farOrthographic = (b - 1.0) / a;"," float nearPerspective = b / (a - 1.0);"," float farPerspective = b / (a + 1.0);"," extent[0] = projectionMatrix[3][3] * nearOrthographic - projectionMatrix[2][3] * nearPerspective;"," extent[1] = projectionMatrix[3][3] * farOrthographic - projectionMatrix[2][3] * farPerspective;"," extent[1] -= extent[0];"," return extent;"," }","void main() {","vUv = uv;","vExtent = getExtent();","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),["varying vec2 vUv;","varying vec2 vExtent; ","uniform sampler2D tDiffuse;","uniform sampler2D tPosition;","uniform sampler2D tNormal;","uniform vec2 vSize;","uniform float fOccluderBias;","uniform vec3 vAttenuation;","uniform float fDistScale;","uniform float fOnlyAo;","uniform float fLumInfluence;","uniform float fRadiusNear;","uniform float fRadiusFar;","uniform float fIntensity;","#define nRadial 5 ","#define nAngular 5 ","#define minResolution 2e-4 ","float SamplePixels (vec3 srcPosition, vec3 srcNormal, vec2 uv)","{"," vec3 dstPosition = texture2D(tPosition, uv).xyz;"," vec3 positionVec = dstPosition - srcPosition;"," float len = length(positionVec);"," float intensity = fIntensity * max((dot(positionVec, srcNormal)- minResolution* vExtent[1])/len- fOccluderBias, 0.0);"," float dist = fDistScale * len / vExtent[1];"," float attenuation = 1.0 / (vAttenuation.x + (vAttenuation.y * dist) + vAttenuation.z*dist*dist);"," return intensity * attenuation ;","}","vec2 rand( const vec2 coord ) {","vec2 noise;","float nx = dot ( coord, vec2( 12.9898, 78.233 ) );","float ny = dot ( coord, vec2( 12.9898, 78.233 ) * 2.0 );","noise = clamp( fract ( 43758.5453 * sin( vec2( nx, ny ) ) ), 0.0, 1.0 );","return ( noise * 2.0 - 1.0 );","}","float getRandomAngle(vec2 pos) {","vec2 rnd = rand(pos);","return atan(rnd.y, rnd.x);","}","void main ()","{"," vec3 srcPosition = texture2D(tPosition, vUv).xyz;"," float srcDepth = texture2D(tPosition, vUv).w;"," vec3 srcNormal = texture2D(tNormal, vUv).xyz;"," float ao = 0.0;"," float radiusMax = fRadiusNear + (fRadiusFar- fRadiusNear) * srcDepth;"," float radiusMin = radiusMax/float(nRadial);"," float angleStep = 6.2831853/float(nAngular);"," vec2 texelSize= 1.0/vSize;"," float angle = getRandomAngle(vUv);"," for (int i = 0; i < nRadial; ++i)"," {"," float radius = radiusMin*float(i+1);"," for(int j=0; j< nAngular; ++j){"," vec2 offset = radius * vec2(cos(angle),sin(angle));"," offset *= texelSize; "," ao += SamplePixels(srcPosition, srcNormal, vUv + offset);"," angle += angleStep;"," }"," angle -= angleStep/2.0;"," }"," ao /= float(nRadial * nAngular);","\tao *= float(srcDepth < 1.0);"," ao = clamp(ao, 0.0, 1.0);","\tgl_FragColor.r = ao;"," gl_FragColor.a = 1.0;","}"].join("\n"),new THREE.Vector2(512,512),["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),["varying vec2 vUv;","uniform sampler2D tDiffuse;","uniform sampler2D tDiffuseOrginal;","uniform sampler2D tSSAOMap;","uniform vec2 vSize;","uniform float fOnlyAo;","uniform float fLumInfluence;","#define uFilterRadius 3","void main ()","{"," float occlusion = 0.0;"," float count = 0.0;"," vec2 texelSize= 1.0/vSize;"," for(int x= -uFilterRadius; x<= uFilterRadius; ++ x){"," for(int y = -uFilterRadius; y<= uFilterRadius; ++y){"," vec2 offset = vec2(x,y);"," float occulusionSample = texture2D(tSSAOMap, vUv + offset*texelSize).r;"," float weight = 1.0 / (1.0 + dot(offset, offset));"," occlusion += weight * occulusionSample;"," count += weight;"," }","}","occlusion /= count;","occlusion = clamp(occlusion, 0.0, 1.0);","occlusion = 1.0 - occlusion;","vec4 texelValue = texture2D(tDiffuseOrginal,vUv).rgba;","vec3 color = texelValue.rgb;","vec3 lumcoeff = vec3( 0.299, 0.587, 0.114 );","float lum = dot( color.rgb, lumcoeff );","vec3 luminance = vec3( lum );","vec3 aoResult = vec3( mix( vec3( occlusion ), vec3( 1.0 ), luminance * fLumInfluence ) );","if ( fOnlyAo == 1.0 )","\tgl_FragColor.xyz= aoResult;","else if ( fOnlyAo == 2.0 )"," gl_FragColor.xyz = color;","else","{"," gl_FragColor.xyz = color * aoResult;","}","gl_FragColor.w = texelValue.a;","}"].join("\n"),c.prototype={constructor:c,setSize:function(e,t){},render:function(e,t,n,i,r){console.error("Pass: .render() must be implemented in derived pass.")}},u.prototype=Object.create(c.prototype),Object.assign(u.prototype,{render:function(e,t,n,i,r){var o,a,s=e.context,l=e.state;l.buffers.color.setMask(!1),l.buffers.depth.setMask(!1),l.buffers.color.setLocked(!0),l.buffers.depth.setLocked(!0),a=this.inverse?(o=0,1):(o=1,0),l.buffers.stencil.setTest(!0),l.buffers.stencil.setOp(s.REPLACE,s.REPLACE,s.REPLACE),l.buffers.stencil.setFunc(s.ALWAYS,o,4294967295),l.buffers.stencil.setClear(a),e.render(this.scene,this.camera,n,this.clear),e.render(this.scene,this.camera,t,this.clear),l.buffers.color.setLocked(!1),l.buffers.depth.setLocked(!1),l.buffers.stencil.setFunc(s.EQUAL,1,4294967295),l.buffers.stencil.setOp(s.KEEP,s.KEEP,s.KEEP)}}),w.prototype=Object.create(c.prototype),Object.assign(w.prototype,{render:function(e,t,n,i,r){e.state.buffers.stencil.setTest(!1)}}),Re.prototype=Object.assign(Object.create(c.prototype),{constructor:Re,render:function(e,t,n,i,r,o){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=n.texture),this.quad.material=this.material,this.renderToColor&&i?e.render(this.scene,this.camera,i,this.clear):this.renderToScreen?e.render(this.scene,this.camera):e.render(this.scene,this.camera,t,this.clear)}}),Object.assign(Oe.prototype,{swapBuffers:function(){var e=this.readBuffer;this.readBuffer=this.writeBuffer,this.writeBuffer=e},addPass:function(e){this.passes.push(e);var t=this.renderer.getSize();e.setSize(t.width,t.height)},insertPass:function(e,t){this.passes.splice(t,0,e)},render:function(e){this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2;for(var t,n,i=!1,r=this.passes.length,o=0;oe._leafBodyAttri._bodyBbox[t]&&(n[t]=e._leafBodyAttri._bodyBbox[t]),n[3+t]=this.geoms.length||e<0))return this.geoms[e]},getGeomIdFromUuid:function(e,t){var n=this.uuidToIdMap[e];if(n=n||this.uuidToIdMap[e.toUpperCase()])for(var i=0,i=0;i\n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\n\t\tuniform float linewidth;\n\t\tuniform float linewidthScale;\n\t\tuniform vec2 resolution;\n\n\t\tattribute vec3 instanceStart;\n\t\tattribute vec3 instanceEnd;\n\n\t\tattribute vec3 instanceColorStart;\n\t\tattribute vec3 instanceColorEnd;\n\n\t\tvarying float vLineWidth;\n\n\t\t#ifdef WORLD_UNITS\n\n\t\t\tvarying vec4 worldPos;\n\t\t\tvarying vec3 worldStart;\n\t\t\tvarying vec3 worldEnd;\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tvarying vec2 vUv;\n\n\t\t\t#endif\n\n\t\t#else\n\n\t\t\tvarying vec2 vUv;\n\n\t\t#endif\n\n\t\t//#ifdef USE_DASH\n\t\t\tattribute float instanceDistanceStart;\n\t\t\tattribute float instanceDistanceEnd;\n\t\t\tvarying float vLineDistance;\n\n\t\t//#endif\n\n\t\t#ifdef MUTI_WIDTH\n\t\t\tattribute float instanceWidthStart;\n\t\t\tattribute float instanceWidthEnd;\n\t\t#endif\n\n\t\tvoid trimSegment( const in vec4 start, inout vec4 end ) {\n\n\t\t\t// trim end segment so it terminates between the camera plane and the near plane\n\n\t\t\t// conservative estimate of the near plane\n\t\t\tfloat a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column\n\t\t\tfloat b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column\n\t\t\tfloat nearEstimate = - 0.5 * b / a;\n\n\t\t\tfloat alpha = ( nearEstimate - start.z ) / ( end.z - start.z );\n\n\t\t\tend.xyz = mix( start.xyz, end.xyz, alpha );\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\t#ifdef USE_COLOR\n\n\t\t\t\tvColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd;\n\n\t\t\t#endif\n\n\t\t\t#ifdef MUTI_WIDTH\n\t\t\t\tvLineWidth = ( position.y < 0.5 ) ? instanceWidthStart : instanceWidthEnd;\n\t\t\t#else\n\t\t\t\tvLineWidth = linewidth;\n\t\t\t#endif\n\n\t\t\tvLineWidth = vLineWidth * linewidthScale;\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tvLineDistance = ( position.y < 0.5 ) ? instanceDistanceStart : instanceDistanceEnd;\n\t\t\t\tvUv = uv;\n\n\t\t\t#endif\n\n\t\t\tfloat aspect = resolution.x / resolution.y;\n\n\t\t\t#ifdef USE_MODELMATRIXATTRIB\n\t\t\t\tmat4 ndsModelViewMatrix = viewMatrix * modelMatrixAttrib;\n\t\t\t\t// camera space\n\t\t\t\tvec4 start = ndsModelViewMatrix * vec4( instanceStart, 1.0 );\n\t\t\t\tvec4 end = ndsModelViewMatrix * vec4( instanceEnd, 1.0 );\n\t\t\t#else\n\t\t\t\t// camera space\n\t\t\t\tvec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );\n\t\t\t\tvec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 );\n\t\t\t#endif\n\n\t\t\t#ifdef WORLD_UNITS\n\n\t\t\t\tworldStart = start.xyz;\n\t\t\t\tworldEnd = end.xyz;\n\n\t\t\t#else\n\n\t\t\t\tvUv = uv;\n\n\t\t\t#endif\n\n\t\t\t// special case for perspective projection, and segments that terminate either in, or behind, the camera plane\n\t\t\t// clearly the gpu firmware has a way of addressing this issue when projecting into ndc space\n\t\t\t// but we need to perform ndc-space calculations in the shader, so we must address this issue directly\n\t\t\t// perhaps there is a more elegant solution -- WestLangley\n\n\t\t\tbool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column\n\n\t\t\tif ( perspective ) {\n\n\t\t\t\tif ( start.z < 0.0 && end.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( start, end );\n\n\t\t\t\t} else if ( end.z < 0.0 && start.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( end, start );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// clip space\n\t\t\tvec4 clipStart = projectionMatrix * start;\n\t\t\tvec4 clipEnd = projectionMatrix * end;\n\n\t\t\t// ndc space\n\t\t\tvec3 ndcStart = clipStart.xyz / clipStart.w;\n\t\t\tvec3 ndcEnd = clipEnd.xyz / clipEnd.w;\n\n\t\t\t// direction\n\t\t\tvec2 dir = ndcEnd.xy - ndcStart.xy;\n\n\t\t\t// account for clip-space aspect ratio\n\t\t\tdir.x *= aspect;\n\t\t\tdir = normalize( dir );\n\n\t\t\t#ifdef WORLD_UNITS\n\n\t\t\t\t// get the offset direction as perpendicular to the view vector\n\t\t\t\tvec3 worldDir = normalize( end.xyz - start.xyz );\n\t\t\t\tvec3 offset;\n\t\t\t\tif ( position.y < 0.5 ) {\n\n\t\t\t\t\toffset = normalize( cross( start.xyz, worldDir ) );\n\n\t\t\t\t} else {\n\n\t\t\t\t\toffset = normalize( cross( end.xyz, worldDir ) );\n\n\t\t\t\t}\n\n\t\t\t\t// sign flip\n\t\t\t\tif ( position.x < 0.0 ) offset *= - 1.0;\n\n\t\t\t\tfloat forwardOffset = dot( worldDir, vec3( 0.0, 0.0, 1.0 ) );\n\n\t\t\t\t// don't extend the line if we're rendering dashes because we\n\t\t\t\t// won't be rendering the endcaps\n\t\t\t\t#ifndef USE_DASH\n\n\t\t\t\t\tif(instanceDistanceStart > 0.0){\n\t\t\t\t\t// extend the line bounds to encompass endcaps\n\t\t\t\t\tstart.xyz += - worldDir * vLineWidth * 0.5;\n\t\t\t\t\t//end.xyz += worldDir * vLineWidth * 0.5;\n\n\t\t\t\t\t// shift the position of the quad so it hugs the forward edge of the line\n\t\t\t\t\t//offset.xy -= dir * forwardOffset;\n\t\t\t\t\t//offset.z += 0.5;\n\t\t\t\t\t}\t\n\n\t\t\t\t#endif\n\n\t\t\t\t// endcaps\n\t\t\t\tif ( position.y > 1.0 || position.y < 0.0 ) {\n\n\t\t\t\t\toffset.xy += dir * 2.0 * forwardOffset;\n\n\t\t\t\t}\n\n\t\t\t\t// adjust for linewidth\n\t\t\t\toffset *= vLineWidth * 0.5;\n\n\t\t\t\t// set the world position\n\t\t\t\tworldPos = ( position.y < 0.5 ) ? start : end;\n\t\t\t\tworldPos.xyz += offset;\n\n\t\t\t\t// project the worldpos\n\t\t\t\tvec4 clip = projectionMatrix * worldPos;\n\n\t\t\t\t// shift the depth of the projected points so the line\n\t\t\t\t// segments overlap neatly\n\t\t\t\tvec3 clipPose = ( position.y < 0.5 ) ? ndcStart : ndcEnd;\n\t\t\t\tclip.z = clipPose.z * clip.w;\n\n\t\t\t#else\n\n\t\t\t\tvec2 offset = vec2( dir.y, - dir.x );\n\t\t\t\t// undo aspect ratio adjustment\n\t\t\t\tdir.x /= aspect;\n\t\t\t\toffset.x /= aspect;\n\n\t\t\t\t// sign flip\n\t\t\t\tif ( position.x < 0.0 ) offset *= - 1.0;\n\n\t\t\t\t// endcaps\n\t\t\t\tif ( position.y < 0.0 ) {\n\n\t\t\t\t\toffset += - dir;\n\n\t\t\t\t} else if ( position.y > 1.0 ) {\n\n\t\t\t\t\toffset += dir;\n\n\t\t\t\t}\n\n\t\t\t\t// adjust for linewidth\n\t\t\t\toffset *= vLineWidth;\n\n\t\t\t\t// adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ...\n\t\t\t\toffset /= resolution.y;\n\n\t\t\t\t// select end\n\t\t\t\tvec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;\n\n\t\t\t\t// back to clip space\n\t\t\t\toffset *= clip.w;\n\n\t\t\t\tclip.xy += offset;\n\n\t\t\t#endif\n\n\t\t\tgl_Position = clip;\n\n\t\t\tvec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation\n\n\t\t\t#include \n\t\t\t#include \n\t\t\t#include \n\n\t\t}\n\t\t",fragmentShader:"\n\t\tuniform vec3 diffuse;\n\t\tuniform float opacity;\n\t\tuniform float linewidth;\n\t\tvarying float vLineWidth;\n\t\t\n\t\t#ifdef USE_DASH\n\t\t\tuniform float patternLength;\n\t\t\tuniform float lineScale;\n\t\t\tuniform sampler2D uSampler;\n\t\t#endif\n\n\t\tvarying float vLineDistance;\n\n\t\t#ifdef WORLD_UNITS\n\n\t\t\tvarying vec4 worldPos;\n\t\t\tvarying vec3 worldStart;\n\t\t\tvarying vec3 worldEnd;\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tvarying vec2 vUv;\n\n\t\t\t#endif\n\n\t\t#else\n\n\t\t\tvarying vec2 vUv;\n\n\t\t#endif\n\n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\n\t\tvec2 closestLineToLine(vec3 p1, vec3 p2, vec3 p3, vec3 p4) {\n\n\t\t\tfloat mua;\n\t\t\tfloat mub;\n\n\t\t\tvec3 p13 = p1 - p3;\n\t\t\tvec3 p43 = p4 - p3;\n\n\t\t\tvec3 p21 = p2 - p1;\n\n\t\t\tfloat d1343 = dot( p13, p43 );\n\t\t\tfloat d4321 = dot( p43, p21 );\n\t\t\tfloat d1321 = dot( p13, p21 );\n\t\t\tfloat d4343 = dot( p43, p43 );\n\t\t\tfloat d2121 = dot( p21, p21 );\n\n\t\t\tfloat denom = d2121 * d4343 - d4321 * d4321;\n\n\t\t\tfloat numer = d1343 * d4321 - d1321 * d4343;\n\n\t\t\tmua = numer / denom;\n\t\t\tmua = clamp( mua, 0.0, 1.0 );\n\t\t\tmub = ( d1343 + d4321 * ( mua ) ) / d4343;\n\t\t\tmub = clamp( mub, 0.0, 1.0 );\n\n\t\t\treturn vec2( mua, mub );\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\t#include \n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tif ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps\n\n float newDistance = vLineDistance/lineScale;\n float modSize = mod( newDistance, patternLength);\n vec3 value = texture2D(uSampler,vec2(modSize/patternLength,0.0)).rgb;\n if(value.r > 0.9){\n \tdiscard;\n }\n\t\t\t\tif(value.r <=0.9 && value.r >=0.8){\n\t\t\t\t\tfloat a = vUv.x;\n\t\t\t\t\tfloat b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;\n\t\t\t\t\tfloat len2 = a * a + b * b;\n\n\t\t\t\t\tif ( len2 > 1.0 ) discard;\n\t\t\t\t}\n\n\t\t\t#endif\n\n\t\t\tfloat alpha = opacity;\n\n\t\t\t#ifdef WORLD_UNITS\n\n\t\t\t\t// Find the closest points on the view ray and the line segment\n\t\t\t\tvec3 rayEnd = normalize( worldPos.xyz ) * 1e5;\n\t\t\t\tvec3 lineDir = worldEnd - worldStart;\n\t\t\t\tvec2 params = closestLineToLine( worldStart, worldEnd, vec3( 0.0, 0.0, 0.0 ), rayEnd );\n\n\t\t\t\tvec3 p1 = worldStart + lineDir * params.x;\n\t\t\t\tvec3 p2 = rayEnd * params.y;\n\t\t\t\tvec3 delta = p1 - p2;\n\t\t\t\tfloat len = length( delta );\n\t\t\t\tfloat norm = len / vLineWidth;\n\n\t\t\t\t#ifndef USE_DASH\n\n\t\t\t\t\t#ifdef USE_ALPHA_TO_COVERAGE\n\n\t\t\t\t\t\tfloat dnorm = fwidth( norm );\n\t\t\t\t\t\talpha = 1.0 - smoothstep( 0.5 - dnorm, 0.5 + dnorm, norm );\n\n\t\t\t\t\t#else\n\n\t\t\t\t\t\tif ( norm > 0.5 ) {\n\n\t\t\t\t\t\t\tdiscard;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t#endif\n\n\t\t\t\t#endif\n\n\t\t\t#else\n\n\t\t\t\t#ifdef USE_ALPHA_TO_COVERAGE\n\n\t\t\t\t\t// artifacts appear on some hardware if a derivative is taken within a conditional\n\t\t\t\t\tfloat a = vUv.x;\n\t\t\t\t\tfloat b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;\n\t\t\t\t\tfloat len2 = a * a + b * b;\n\t\t\t\t\tfloat dlen = fwidth( len2 );\n\n\t\t\t\t\tif ( abs( vUv.y ) > 1.0 ) {\n\n\t\t\t\t\t\talpha = 1.0 - smoothstep( 1.0 - dlen, 1.0 + dlen, len2 );\n\n\t\t\t\t\t}\n\n\t\t\t\t#else\n\n\t\t\t\t\tif ( abs( vUv.y ) > 1.0 ) {\n\n\t\t\t\t\t\tfloat a = vUv.x;\n\t\t\t\t\t\tfloat b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;\n\t\t\t\t\t\tfloat len2 = a * a + b * b;\n\n\t\t\t\t\t\tif ( len2 > 1.0 ) discard;\n\n\t\t\t\t\t}\n\n\t\t\t\t#endif\n\n\t\t\t#endif\n\n\t\t\tvec4 diffuseColor = vec4( diffuse, alpha );\n\n\t\t\t#include \n\t\t\t#include \n\n\t\t\tgl_FragColor = vec4( diffuseColor.rgb, alpha );\n\n\t\t\t#include \n\t\t\t#include \n\t\t\t#include \n\t\t\t#include \n\n\t\t}\n\t\t"};var Q=function(n){function e(e){var t=n.call(this,{type:"LineMaterial",uniforms:THREE.UniformsUtils.clone(THREE.ShaderLib.line2.uniforms),vertexShader:THREE.ShaderLib.line2.vertexShader,fragmentShader:THREE.ShaderLib.line2.fragmentShader,clipping:!0})||this;return t.isLineMaterial=!0,t.setValues(e),t}var t,i,r;return i=n,(t=e).prototype=Object.create(i.prototype),X(t.prototype.constructor=t,i),t=e,(i=[{key:"color",get:function(){return this.uniforms.diffuse.value},set:function(e){this.uniforms.diffuse.value=e}},{key:"worldUnits",get:function(){return"WORLD_UNITS"in this.defines},set:function(e){!0===e?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}},{key:"linewidth",get:function(){return this.uniforms.linewidth.value},set:function(e){this.uniforms.linewidth&&(this.uniforms.linewidth.value=e)}},{key:"linewidthScale",get:function(){return this.uniforms.linewidthScale.value},set:function(e){this.uniforms.linewidthScale&&(this.uniforms.linewidthScale.value=e)}},{key:"dashed",get:function(){return"USE_DASH"in this.defines},set:function(e){!0===e!==this.dashed&&(this.needsUpdate=!0),!0===e?this.defines.USE_DASH="":delete this.defines.USE_DASH}},{key:"dashScale",get:function(){return this.uniforms.dashScale.value},set:function(e){this.uniforms.dashScale.value=e}},{key:"dashSize",get:function(){return this.uniforms.dashSize.value},set:function(e){this.uniforms.dashSize.value=e}},{key:"dashOffset",get:function(){return this.uniforms.dashOffset.value},set:function(e){this.uniforms.dashOffset.value=e}},{key:"gapSize",get:function(){return this.uniforms.gapSize.value},set:function(e){this.uniforms.gapSize.value=e}},{key:"opacity",get:function(){return this.uniforms.opacity.value},set:function(e){this.uniforms&&(this.uniforms.opacity.value=e)}},{key:"resolution",get:function(){return this.uniforms.resolution.value},set:function(e){this.uniforms.resolution.value.copy(e)}},{key:"alphaToCoverage",get:function(){return"USE_ALPHA_TO_COVERAGE"in this.defines},set:function(e){this.defines&&(!0===e!==this.alphaToCoverage&&(this.needsUpdate=!0),!0===e?(this.defines.USE_ALPHA_TO_COVERAGE="",this.extensions.derivatives=!0):(delete this.defines.USE_ALPHA_TO_COVERAGE,this.extensions.derivatives=!1))}},{key:"lineScale",get:function(){return this.uniforms.lineScale.value},set:function(e){this.uniforms.lineScale.value=e}},{key:"lineTypeId",get:function(){return this.uniforms.lineTypeId.value},set:function(e){this.uniforms.lineTypeId.value=e}},{key:"patternLength",get:function(){return this.uniforms.patternLength.value},set:function(e){this.uniforms.patternLength.value=e}},{key:"uSampler",get:function(){return this.uniforms.uSampler.value},set:function(e){this.uniforms.uSampler.value=e}},{key:"mutiWidth",get:function(){return"MUTI_WIDTH"in this.defines},set:function(e){!0===e?this.defines.MUTI_WIDTH="":delete this.defines.MUTI_WIDTH}}])&&W(t.prototype,i),r&&W(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}(THREE.ShaderMaterial);function Z(e,t){return(Z=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}var te,ne,ie=new THREE.Vector3,re=new THREE.Vector3,oe=new THREE.Vector4,ae=new THREE.Vector4,se=new THREE.Vector4,ce=new THREE.Vector3,he=new THREE.Matrix4,ue=new THREE.Line3,pe=new THREE.Vector3,fe=new THREE.Box3,me=new THREE.Sphere,Qe=new THREE.Vector4;function Ze(e,t,n){return Qe.set(0,0,-t,1).applyMatrix4(e.projectionMatrix),Qe.multiplyScalar(1/Qe.w),Qe.x=ne/n.width,Qe.y=ne/n.height,Qe.applyMatrix4(e.projectionMatrixInverse),Qe.multiplyScalar(1/Qe.w),Math.abs(Math.max(Qe.x,Qe.y))}var qe=function(n){function e(e,t){return void 0===e&&(e=new G),void 0===t&&(t=new Q({color:16777215*Math.random()})),(e=n.call(this,e,t)||this).isLineSegments2=!0,e.type="LineSegments2",e}t=n,(i=e).prototype=Object.create(t.prototype),Z(i.prototype.constructor=i,t);var t,i=e.prototype;return i.computeLineDistances=function(){for(var e=this.geometry,t=e.attributes.instanceStart,n=e.attributes.instanceEnd,i=new Float32Array(2*t.count),r=0,o=0,a=t.count;rb&&ae.z>b||(oe.z>b?(x=oe.z-ae.z,x=(oe.z-b)/x,oe.lerp(ae,x)):ae.z>b&&(x=ae.z-oe.z,I=(ae.z-b)/x,ae.lerp(oe,I)),oe.applyMatrix4(A),ae.applyMatrix4(A),oe.multiplyScalar(1/oe.w),ae.multiplyScalar(1/ae.w),oe.x*=y.x/2,oe.y*=y.y/2,ae.x*=y.x/2,ae.y*=y.y/2,ue.start.copy(oe),ue.start.z=0,ue.end.copy(ae),ue.end.z=0,I=ue.closestPointToPointParameter(ce,!0),ue.at(I,pe),T=-1<=(T=THREE.Math.lerp(oe.z,ae.z,I))&&T<=1,S=ce.distanceTo(pe),T&&(ne<5?S<5:S\n\t\t\tuniform float linewidth;\n\t\t\tuniform vec2 resolution;\n\n\t\t\tattribute vec3 instancePos;\n\n\t\t\tvarying vec2 vUv;\n\n\t\t\tvoid main() {\n\t\t\t\tvUv = uv;\n\t\t\t\tvec4 modelPos;\n\n\t\t\t\t#ifdef USE_MODELMATRIXATTRIB\n\t\t\t\t\tmat4 ndsModelViewMatrix = viewMatrix * modelMatrixAttrib;\n\t\t\t\t\tmodelPos = ndsModelViewMatrix * vec4( instancePos, 1.0 );\n\t\t\t\t#else\n\t\t\t\t\tmodelPos = modelViewMatrix * vec4( instancePos, 1.0 );\n\t\t\t\t#endif\n\n\t\t\t\t#ifdef WORLD_UNITS\n\t\t\t\t modelPos += vec4(position * linewidth * 0.5, 0.0);\n\t\t\t\t\tmodelPos = projectionMatrix * modelPos;\n\t\t\t\t#else\n\t\t\t\t\tmodelPos = projectionMatrix * modelPos;\n\t\t\t\t\tfloat lenX = linewidth / resolution.x * modelPos.w;\n\t\t\t\t\tfloat lenY = linewidth / resolution.y * modelPos.w;\n\t\t\t\t\tmodelPos.xy += vec2(position.x * lenX, position.y * lenY);\n\t\t\t\t#endif\n\n\t\t\t\tgl_Position = modelPos;\n\t\t\t}\n\t\t\t",fragmentShader:"\n\t\t\tvarying vec2 vUv;\n\t\t\tuniform vec3 diffuse;\n\t\t\tvoid main(){\n\t\t\t\tif(length(vUv -0.5)>0.5) discard;\n\t\t\t\tgl_FragColor = vec4(diffuse, 1.0);\n\t\t\t}\n\t\t\t"})||this;return t.isPoint2Material=!0,t.setValues(e),t}var t,i,r;return i=n,(t=e).prototype=Object.create(i.prototype),tt(t.prototype.constructor=t,i),t=e,(i=[{key:"color",get:function(){return this.uniforms.diffuse.value},set:function(e){this.uniforms.diffuse.value=e}},{key:"worldUnits",get:function(){return"WORLD_UNITS"in this.defines},set:function(e){!0===e?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}},{key:"linewidth",get:function(){return this.uniforms.linewidth.value},set:function(e){this.uniforms.linewidth&&(this.uniforms.linewidth.value=e)}},{key:"resolution",get:function(){return this.uniforms.resolution.value},set:function(e){this.uniforms.resolution.value.copy(e)}}])&&et(t.prototype,i),r&&et(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}(THREE.ShaderMaterial);function it(e,t){return(it=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}var rt=function(n){function e(e,t){return void 0===e&&(e=new $e),void 0===t&&(t=new nt({color:16777215*Math.random()})),(e=n.call(this,e,t)||this).isPoint2=!0,e.type="Point2",e}var t,i;return i=n,(t=e).prototype=Object.create(i.prototype),it(t.prototype.constructor=t,i),e}(THREE.Mesh);function ot(e,t){return e-t}function at(e){var n=this;this.boundingBox=new THREE.Box3,this.boundingSphere=new THREE.Sphere,this.children=[],this.meshes=null,this.lines=null,this.texts=null,this.parent=null,this.addSubTree=function(e){((e=e.isSpatialIndex?e:new ft(e)).root.parent=n).children.push(e.root);for(var t=n;t;)t.boundingBox.expandByPoint(e.root.boundingBox.min),t.boundingBox.expandByPoint(e.root.boundingBox.max),t=t.parent;return e.root},this.queryByRayCast=function(){function o(e,t,n){if(t.intersectsBox(e.boundingBox)){0<=e.meshSetId&&(n[n.length]=e.meshSetId);for(var i=0,r=e.children.length;ithis.geomId.length){for(var e=100<=e?e:100,r=new Float32Array(this.bboxes.length+6*e),o=0,a=this.bboxes.length;o=this.mats.length/2&&(t.geometry.refMeshesSameMaterial&&this.supportInstancedArrays&&!t.geometry.useSharedGlBuffer||(e-=this.mats.length/2)),t.material=this.mats[e],t.matrixWorld||(t.matrixWorld=new THREE.Matrix4),n.worldMatrix);t.matrixWorld.copy(e),t.matrixWorld.elements[12]+=i[0],t.matrixWorld.elements[13]+=i[1],t.matrixWorld.elements[14]+=i[2]},getSingleMesh:function(e){var t=this.supportInstancedArrays,e=(this.supportInstancedArrays=!1,this.getMesh(e));return this.supportInstancedArrays=t,e},getMeshMaterialByMeshId:function(t,e,n){var i,r,o,a,s=e;if(e||!(s=this.bodyNodes[t]).isHidden())return(e=n)||(e=this.geomManager.getGeomFromId(this.geomId[t])),n=s.getMaterialBodyNodeUUid(),(i=s.getUserMaterial())?(i.colors&&i.colors.forEach(function(e){e.meshId==t&&(i.color.copy(e.value),i.needsUpdate=!0,i.needsRefresh=!0)}),i.opacities&&i.opacities.forEach(function(e){e.meshId==t&&(i.opacity=e.value,i.opacity<1?i.transparent=!0:i.transparent=!1,i.needsUpdate=!0,i.needsRefresh=!0)}),(a=this.materialId[t])>=this.mats.length/2&&(e.refMeshesSameMaterial&&this.supportInstancedArrays&&!e.useSharedGlBuffer||(a-=this.mats.length/2)),o=this.mats[a],i.backMaterial||(i.backMaterial=i.clone(),i.backMaterial.transparent=!0,i.backMaterial.opacity=_e.bodyOpacity,i.backoriMaterial=i.clone(),i.backoriMaterial.transparent=o.transparent,i.backoriMaterial.opacity=o.opacity),o=i,e.refMeshesSameMaterial=!1,0=this.mats.length/2&&(e.refMeshesSameMaterial&&this.supportInstancedArrays&&!e.useSharedGlBuffer||(a-=this.mats.length/2)),o=this.mats[a],0=this.mats.length/2&&(this.mesh.geometry.refMeshesSameMaterial&&this.supportInstancedArrays&&!this.mesh.geometry.useSharedGlBuffer||(i-=this.mats.length/2)),n=this.mats[i],a.backMaterial||(a.backMaterial=a.clone(),a.backMaterial.transparent=!0,a.backMaterial.opacity=_e.bodyOpacity,a.backoriMaterial=a.clone(),a.backoriMaterial.transparent=n.transparent,a.backoriMaterial.opacity=n.opacity),s=a,0this.lineSegGeomId.length&&(e=100<=e?e:100,(r=new Int32Array(this.lineSegGeomId.length+e)).set(this.lineSegGeomId),this.lineSegGeomId=r,(r=new Int32Array(this.lineSegMaterialId.length+e)).set(this.lineSegMaterialId),this.lineSegMaterialId=r,(r=new Uint8Array(this.lineSegFlag.length+e)).set(this.lineSegFlag),this.lineSegFlag=r,this.lineSegBodyNodes=this.lineSegBodyNodes.concat(new Array(e)),this.lineSegBodyUuids=this.lineSegBodyUuids.concat(new Array(e)),t&&(this.lineSegObjectUuids=this.lineSegObjectUuids.concat(new Array(e))),n)&&((r=new Int32Array(this.lineSegMatrixId.length+e)).set(this.lineSegMatrixId),this.lineSegMatrixId=r),i)},deleteLineSegments:function(e){e.sort(ot).reverse(),this.nLineSegments-=e.length;var t=new Array,t=(t.extend(this.lineSegGeomId),t.deletefromIds(e),this.lineSegGeomId=new Int32Array(t),new Array),t=(t.extend(this.lineSegGeomUuid),t.deletefromIds(e),this.lineSegGeomUuid=t,new Array),t=(t.extend(this.lineSegMaterialId),t.deletefromIds(e),this.lineSegMaterialId=new Int32Array(t),new Array),t=(t.extend(this.lineSegFlag),t.deletefromIds(e),this.lineSegFlag=new Uint8Array(t),new Array),t=(t.extend(this.lineSegBodyUuids),t.deletefromIds(e),this.lineSegBodyUuids=t,new Array);t.extend(this.lineSegBodyNodes),t.deletefromIds(e),this.lineSegBodyNodes=t},setLineSegmentsFromGeomUuid:function(e,t,n,i,r,o){this.lineSegGeomUuid[e]=t,this.lineSegBodyUuids[e]=n,this.lineSegMaterialId[e]=i||-1,this.lineSegObjectUuids&&(this.lineSegObjectUuids[e]=r),this.lineSegMatrixId&&(this.lineSegMatrixId[e]=o)},calcLineSegmentsBox:function(){for(var e=0;er.leafBodyAttri.bodyBbox[3+a]&&(r.leafBodyAttri.bodyBbox[3+a]=o.max.getComponent(a));else for(a=0;a<3;++a)r.leafBodyAttri.bodyBbox[a]=o.min.getComponent(a),r.leafBodyAttri.bodyBbox[3+a]=o.max.getComponent(a)}}for(n=0;n=.9*t.maxMemory&&(t.stopLoading=!0,t.allGeomInMemory=!1)}return!0},getLineSegmentsWithState:function(e,t,n){i=e.lineSegIds?(r=e).lineSegIds[0]:e;var i,r,e={state:1,lineSegments:null,lineStyle:null};if((n=void 0===n?!1:n)&&this.instancedLineSegs.has(i))e.state=0;else if(this.isLineSegmentsLoaded(i)){this.instanceMats||(this.instanceMats=new Map);n=this.geomManager.getGeomFromId(this.lineSegGeomId[i]);if(0===n.drawRange.count)e.state=0;else if(!1===_e.tangentEdgeVisible&&n.tangentEdgeObject)e.state=0;else{var o=this.lineSegBodyNodes[i],a=void 0;if(o.isSelected()&&(a=o.isHidden(),o.show()),_e.HideLeafBody&&!o.sketchBody){var s=o.parent.FirstVisibleNode||0;if(o.parent.children[s].isHidden()||o.unload)return e.state=0,e}else if(o.isHidden())return e.state=0,e;this.lineSegments.geometry=n,this.lineSegments.geometry.isInstancedBufferGeometry=!1;var s=null,l=this.lineSegMaterialId[i];if(-1d.max.x+n||t.origin.yd.max.y+n))&&(i||!1!==t.intersectsBox(d))){var d=new THREE.Vector3,c=new THREE.Quaternion,l=(s.decompose(l,c,d),new THREE.Matrix4),h=(l.getInverse(s),new THREE.Ray),u=(h.copy(t).applyMatrix4(l),{}),c=(u.distance=F,u.point=new THREE.Vector3,u.face=null,u.faceIndex=-1,u.meshId=-1,u.lineSegId=-1,n/((d.x+d.y+d.z)/3)),p=c*c,f=new THREE.Vector3,m=new THREE.Vector3,g=r.index,v=r.attributes.position;if(!g)return null;new THREE.Vector3;var A,y=new THREE.Vector3,E=new THREE.Vector3,l=new THREE.Plane(new THREE.Vector3(0,0,-1),0),M=new THREE.Vector3,w=(h.intersectPlane(l,M),new THREE.Vector3),b=new THREE.Vector3;if(r.isPoints)for(var x=r.drawRange.start,I=r.drawRange.start+r.drawRange.count;xa[p]&&(a[p]=u[p])}i.min.x+=o[0],i.min.y+=o[1],i.min.z+=o[2],i.max.x+=a[0],i.max.y+=a[1],i.max.z+=a[2],i.min.x+=s[0],i.min.y+=s[1],i.min.z+=s[2],i.max.x+=s[0],i.max.y+=s[1],i.max.z+=s[2]}if(this.visible=e.intersectsBox(i),!this.visible&&(_e.AnimationEdit||_e.ScenarioEditor))for(var f=this.sptIndex.getNumMeshes(this.node),m=new THREE.Box3,g=0;g>1):r>>1,e[o]=i*n},Ve.calcSmoothNormals=function(e,t){for(var n,i,r,o,a,s,l,d,c,h,u,p=new Float32Array(t.length),f=0,m=e.length;f=this.len&&(this.offset-=this.len-4,this.offset>=this.count)&&(this.offset-=this.count+(Ve.isLittleEndian?1:-1))},Ve.BIMStream=function(e,t,n){this.data=e,this.offset=t,this.count=n,this.len=this.data.length},Ve.BIMStream.prototype.writeByte=function(e){this.data[this.offset]=e,this.offset+=this.count,this.offset>=this.len&&(this.offset=0)},Ve.Stream=function(e){this.data=e,this.dataView=new DataView(e.buffer),this.offset=0},Ve.Stream.prototype.TWO_POW_MINUS23=Math.pow(2,-23),Ve.Stream.prototype.TWO_POW_MINUS126=Math.pow(2,-126),Ve.Stream.prototype.readByte=function(){return 255&this.data[this.offset++]},Ve.Stream.prototype.readUInt8=function(){return this.dataView.getUint8(this.offset++,!0)},Ve.Stream.prototype.readInt32=function(){var e=this.dataView.getInt32(this.offset,!0);return this.offset+=4,e},Ve.Stream.prototype.readUInt32=function(){var e=this.dataView.getUint32(this.offset,!0);return this.offset+=4,e},Ve.Stream.prototype.readInt64=function(){var e=this.dataView.getUint32(this.offset,!0),t=(this.offset+=4,this.dataView.getUint32(this.offset,!0)),t=(this.offset+=4,BigInt(t)<=this._windowSize&&(this._pos=0),this._streamPos=this._pos}},M.OutWindow.prototype.releaseStream=function(){this.flush(),this._stream=null},M.OutWindow.prototype.setStream=function(e){this.releaseStream(),this._stream=e},M.OutWindow.prototype.init=function(e){e||(this._streamPos=0,this._pos=0)},M.OutWindow.prototype.copyBlock=function(e,t){var n=this._pos-e-1;for(n<0&&(n+=this._windowSize);t--;)n>=this._windowSize&&(n=0),this._buffer[this._pos++]=this._buffer[n++],this._pos>=this._windowSize&&this.flush()},M.OutWindow.prototype.putByte=function(e){this._buffer[this._pos++]=e,this._pos>=this._windowSize&&this.flush()},M.OutWindow.prototype.getByte=function(e){e=this._pos-e-1;return e<0&&(e+=this._windowSize),this._buffer[e]},M.RangeDecoder=function(){},M.RangeDecoder.prototype.setStream=function(e){this._stream=e},M.RangeDecoder.prototype.releaseStream=function(){this._stream=null},M.RangeDecoder.prototype.init=function(){var e=5;for(this._code=0,this._range=-1;e--;)this._code=this._code<<8|this._stream.readByte()},M.RangeDecoder.prototype.decodeDirectBits=function(e){for(var t,n=0,i=e;i--;)this._range>>>=1,t=this._code-this._range>>>31,this._code-=this._range&t-1,n=n<<1|1-t,0==(4278190080&this._range)&&(this._code=this._code<<8|this._stream.readByte(),this._range<<=8);return n},M.RangeDecoder.prototype.decodeBit=function(e,t){var n=e[t],i=(this._range>>>11)*n;return(2147483648^this._code)<(2147483648^i)?(this._range=i,e[t]+=2048-n>>>5,0==(4278190080&this._range)&&(this._code=this._code<<8|this._stream.readByte(),this._range<<=8),0):(this._range-=i,this._code-=i,e[t]-=n>>>5,0==(4278190080&this._range)&&(this._code=this._code<<8|this._stream.readByte(),this._range<<=8),1)},M.initBitModels=function(e,t){for(;t--;)e[t]=1024},M.BitTreeDecoder=function(e){this._models=[],this._numBitLevels=e},M.BitTreeDecoder.prototype.init=function(){M.initBitModels(this._models,1<>7&1,t<<=1,r=r<<1|(i=e.decodeBit(this._decoders,(1+n<<8)+r)),n!==i){for(;r<256;)r=r<<1|e.decodeBit(this._decoders,r);break}}while(r<256);return 255&r},M.LiteralDecoder=function(){},M.LiteralDecoder.prototype.create=function(e,t){var n;if(!this._coders||this._numPrevBits!==t||this._numPosBits!==e)for(this._numPosBits=e,this._posMask=(1<>>8-this._numPrevBits)]},M.Decoder=function(){this._outWindow=new M.OutWindow,this._rangeDecoder=new M.RangeDecoder,this._isMatchDecoders=[],this._isRepDecoders=[],this._isRepG0Decoders=[],this._isRepG1Decoders=[],this._isRepG2Decoders=[],this._isRep0LongDecoders=[],this._posSlotDecoder=[],this._posDecoders=[],this._posAlignDecoder=new M.BitTreeDecoder(4),this._lenDecoder=new M.LenDecoder,this._repLenDecoder=new M.LenDecoder,this._literalDecoder=new M.LiteralDecoder,this._dictionarySize=-1,this._dictionarySizeCheck=-1,this._posSlotDecoder[0]=new M.BitTreeDecoder(6),this._posSlotDecoder[1]=new M.BitTreeDecoder(6),this._posSlotDecoder[2]=new M.BitTreeDecoder(6),this._posSlotDecoder[3]=new M.BitTreeDecoder(6)},M.Decoder.prototype.setDictionarySize=function(e){return!(e<0||(this._dictionarySize!==e&&(this._dictionarySize=e,this._dictionarySizeCheck=Math.max(this._dictionarySize,1),this._outWindow.create(Math.max(this._dictionarySizeCheck,4096))),0))},M.Decoder.prototype.setLcLpPb=function(e,t,n){var i=1<>1)-1),o<14)l+=M.reverseDecode2(this._posDecoders,l-o-1,this._rangeDecoder,a);else if((l=(l+=this._rangeDecoder.decodeDirectBits(a-4)<<4)+this._posAlignDecoder.reverseDecode(this._rangeDecoder))<0){if(-1===l)break;return!1}}else l=o;if(u<=l||l>=this._dictionarySizeCheck)return!1;this._outWindow.copyBlock(l,i),u+=i,p=this._outWindow.getByte(0)}return this._outWindow.flush(),this._outWindow.releaseStream(),this._rangeDecoder.releaseStream(),!0},M.Decoder.prototype.setDecoderProperties=function(e){var t;return!(e.size<5||(t=e.readByte(),!this.setLcLpPb(t%9,(t=~~(t/9))%5,~~(t/5))))&&(t=e.readByte(),t=(t=(t|=e.readByte()<<8)|e.readByte()<<16)+16777216*e.readByte(),this.setDictionarySize(t))},M.decompress=function(e,t,n,i){var r=new M.Decoder;if(!r.setDecoderProperties(e))throw"Incorrect stream properties";if(r.decode(t,n,i))return!0;throw"Error in data stream"},$n=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),ht=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]),"object"!=typeof WebAssembly?{supported:!1}:(e="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ICLFHIAECUFGEMBKKK9MBDNADCD4AE2GEtMBINABABYDBGDCWTCW91+yADCE91CJJJ/8IFCJJJ98g++nuDBABCLFHBAECUFGEMBKKK9TEIUCBCBYDJ1JJBGEABCIFC98gFGBbDJ1JJBDNDNABzBCZTGD9NMBCUHIABAD9rCffIFCZ4NBCUsMEKAEHIKAIK/lEEEUDNDNAEABvCIgtMBABHIXEKDNDNADCZ9PMBABHIXEKABHIINAIAEYDBbDBAICLFAECLFYDBbDBAICWFAECWFYDBbDBAICXFAECXFYDBbDBAICZFHIAECZFHEADC9wFGDCS0MBKKADCL6MBINAIAEYDBbDBAECLFHEAICLFHIADC98FGDCI0MBKKDNADtMBINAIAErBB86BBAICEFHIAECEFHEADCUFGDMBKKABK/AEEDUDNDNABCIgtMBABHIXEKAECfEgC+B+C+EW2HLDNDNADCZ9PMBABHIXEKABHIINAIALbDBAICXFALbDBAICWFALbDBAICLFALbDBAICZFHIADC9wFGDCS0MBKKADCL6MBINAIALbDBAICLFHIADC98FGDCI0MBKKDNADtMBINAIAE86BBAICEFHIADCUFGDMBKKABKKKEBCJWKLZ9kBB",WebAssembly.validate($n)&&(e="B9h79tEBBBEkL9gBB9gVUUUUUEU9gIUUUB9gEUEUIKQBBEBEEDDDILVE9wEEEVIEBEOWEUEC+Q/aEKR/LEdO9tw9t9vv95DBh9f9f939h79t9f9j9h229f9jT9vv7BB8a9tw79o9v9wT9f9kw9j9v9kw9WwvTw949C919m9mwvBDy9tw79o9v9wT9f9kw9j9v9kw69u9kw949C919m9mwvBLe9tw79o9v9wT9f9kw9j9v9kw69u9kw949Twg91w9u9jwBVl9tw79o9v9wT9f9kw9j9v9kws9p2Twv9P9jTBOk9tw79o9v9wT9f9kw9j9v9kws9p2Twv9R919hTBRl9tw79o9v9wT9f9kw9j9v9kws9p2Twvt949wBWL79iv9rBdQ/49TQLBZIK9+EVU8jJJJJBCZ9rHBCBHEINCBHDCBHIINABCWFADFAICJUAEAD4CEgGLe86BBAIALFHIADCEF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VCkF9CU83IBAVCZF9CU83IBAV9CU83IWAV9CU83IBALAIFC9wFHQAICEFGWARFHODNAEtMBCMCSAdCEseHKCBHXCBHMCBHdCBHICBHLINDNAOAQ9NMBC9+HOXIKDNDNAWrBBGRC/vE0MBAVC/ABFALARCL4CU7FCSgCITFGpYDLHSApYDBHZDNARCSgGpAK9PMBAVAIARCU7FCSgCDTFYDBAXApeHRAptHpDNDNADCD9HMBABAdCETFGhAZ87EBAhCDFAS87EBAhCLFAR87EBXEKABAdCDTFGhAZbDBAhCLFASbDBAhCWFARbDBKAXApFHXAVC/ABFALCITFGhARbDBAhASbDLAVAICDTFARbDBAVC/ABFALCEFCSgGLCITFGhAZbDBAhARbDLAIApFHIALCEFHLXDKDNDNApCSsMBAMApFApC987FCEFHMXEKAOCEFHRAO8sBBGpCfEgHhDNDNApCU9MMBARHOXEKAOCVFHOAhCfBgHhCRHpDNINAR8sBBGoCfBgApTAhvHhAoCU9KMEARCEFHRApCRFGpC8j9HMBXDKKARCEFHOKAhCE4CBAhCEg9r7AMFHMKDNDNADCD9HMBABAdCETFGRAZ87EBARCDFAS87EBARCLFAM87EBXEKABAdCDTFGRAZbDBARCLFASbDBARCWFAMbDBKAVC/ABFALCITFGRAMbDBARASbDLAVAICDTFAMbDBAVC/ABFALCEFCSgGLCITFGRAZbDBARAMbDLAICEFHIALCEFHLXEKDNARCPE0MBAXCEFGoAVAIAQARCSgFrBBGpCL49rCSgCDTFYDBApCZ6GheHRAVAIAp9rCSgCDTFYDBAoAhFGSApCSgGoeHpAotHoDNDNADCD9HMBABAdCETFGZAX87EBAZCDFAR87EBAZCLFAp87EBXEKABAdCDTFGZAXbDBAZCLFARbDBAZCWFApbDBKAVAICDTFAXbDBAVC/ABFALCITFGZARbDBAZAXbDLAVAICEFGICSgCDTFARbDBAVC/ABFALCEFCSgCITFGZApbDBAZARbDLAVAIAhFCSgGICDTFApbDBAVC/ABFALCDFCSgGLCITFGRAXbDBARApbDLALCEFHLAIAoFHIASAoF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L81zAKPXIBBBIBBBIBBBIBBBP9QP/6EP/nEGKARAdPMBEDIWdQKZhoaky8aeGRCZP+rECZP+sEP/6EP/mEGdAdP/mEAKARCZP+sEP/6EP/mEGXAXP/mEAKAQCZP+rECZP+sEP/6EP/mEGQAQP/mEP/kEP/kEP/lEPXBBBBBBBBBBBBBBBBP+4EP/jEPXB/+fsB/+fsB/+fsB/+fsGKP/mEPXBBN0BBN0BBN0BBN0GRP/kEPXffBBffBBffBBffBBGMP9OAXAKP/mEARP/kECZP+rEP9QGXAQAKP/mEARP/kECZP+rEAdAKP/mEARP/kEAMP9OP9QGKPMBEZhDIoaLVcxORqlGRP5BAIPBLAPeB+t+J83IBAIARP5EAIPBLAPeE+t+J83IWAIAXAKPMWdkyQK8aeXM35pS8e8fGKP5BAIPBLAPeD+t+J83IZAIAKP5EAIPBLAPeI+t+J83IkKAWAIAO/8QBBKK+pDDIUE978jJJJJBC/AB9rHIDNADCD4AE2GLC98gGVtMBCBHDABHEINAEAEPBBBGOCWP+rECWP+sEP/6EAOCEP+sEPXBBJzBBJzBBJzBBJzP+uEPXBBJfBBJfBBJfBBJfP9OP/mEPKBBAECZFHEADCLFGDAV6MBKKDNAVAL9PMBAIALCIgGDCDTGEvCBC/ABAE9r/8KBAIABAVCDTFGVAE/8QBBDNADtMBAIAIPBLBGOCWP+rECWP+sEP/6EAOCEP+sEPXBBJzBBJzBBJzBBJzP+uEPXBBJfBBJfBBJfBBJfP9OP/mEPKLBKAVAIAE/8QBBKK9TEIUCBCBYDJ1JJBGEABCIFC98gFGBbDJ1JJBDNDNABzBCZTGD9NMBCUHIABAD9rCffIFCZ4NBCUsMEKAEHIKAIKKKEBCJWKLZ9tBB"),$n=WebAssembly.instantiate(function(e){for(var t=new Uint8Array(e.length),n=0;nH.boundingBox.max.x||H.boundingBox.min.y>H.boundingBox.max.y||H.boundingBox.min.z>H.boundingBox.max.z)&&P.equals(C)?(H.boundingBox=null,H.attributes.position&&H.computeBoundingBox()):H.boundingBox.set(P,C),0===R&&H.attributes.normal,H.boundingSphere=null,F&&F()}j&&j()},k.prototype.readBIMBufferVersion8=function(e,F,N,j){for(var _=e.readInt32(),V=(e.readInt32(),e.readInt32()),k=[],t=(NDSWebViewer.Viewer.renderer.context,0);tH.boundingBox.max.x||H.boundingBox.min.y>H.boundingBox.max.y||H.boundingBox.min.z>H.boundingBox.max.z)&&P.equals(C)?(H.boundingBox=null,H.attributes.position&&H.computeBoundingBox()):H.boundingBox.set(P,C),0===R&&H.attributes.normal,H.boundingSphere=null,F&&F()}j&&j()},k.prototype.readBIMBufferVersion9=function(e,F,N,j){for(var t,n,i,r,o,a,s=gt,_=e.readInt32(),V=(e.readInt32(),e.readInt32()),k=[],l=(NDSWebViewer.Viewer.renderer.context,0);lH.boundingBox.max.x||H.boundingBox.min.y>H.boundingBox.max.y||H.boundingBox.min.z>H.boundingBox.max.z)&&P.equals(C)?(H.boundingBox=null,H.attributes.position&&H.computeBoundingBox()):H.boundingBox.set(P,C),0===R&&H.attributes.normal,H.boundingSphere=null,F&&F()}j&&j()},k.prototype.readBIMBufferVersion7_=function(e,F,N,j){for(var _=e.readInt32(),V=(e.readInt32(),e.readInt32()),k=[],t=0;t>>0,e.readInt32()>>>0,e.readInt32()>>>0,e.readInt32()>>>0],n="",i=0,i=0;i<4;++i){var r=t[i].toString(16);r.length<8&&(n+="00000000".slice(0,8-r.length)),n+=r}return n=0!=_e.ScenarioEditorid?Se.addSceneID(n):n},k.prototype.readUuid3=function(e){e=(e.readInt32()>>>0).toString();return e=0!=_e.ScenarioEditorid?Se.addSceneID(e):e},k.prototype.readBvhV1=function(e,t){for(var n,i,r=e.readInt32(),o=(t.setNumNodes(r),new Float32Array(6)),a=0,s=0;se[3]||e[1]>e[4]||e[2]>e[5])},F=function(){u.min.fromArray(m,0),u.max.fromArray(m,3),u.applyMatrix4(n),m[0]=u.min.x,m[1]=u.min.y,m[2]=u.min.z,m[3]=u.max.x,m[4]=u.max.y,m[5]=u.max.z},A=0;Ae.length&&console.error("TGALoader: No data."),n+=Ce.id_length;var r=!1,o=!1,Re=!1;switch(Ce.image_type){case 9:o=r=!0;break;case 1:o=!0;break;case 10:r=!0;break;case 2:break;case 11:Re=r=!0;break;case 3:Re=!0}e=function(e,t,n,i,r){var o,a=n.pixel_size>>3,s=n.width*n.height*a;if(t&&(o=r.subarray(i,i+=n.colormap_length*(n.colormap_size>>3))),e)for(var l,d,c,h=new Uint8Array(s),u=0,p=new Uint8Array(a);u>4){default:case 2:s=e,r=i=0,a=o=1,l=t;break;case 0:i=0,s=e,r=t-(o=1),l=a=-1;break;case 3:i=e-1,s=o=-1,r=0,a=1,l=t;break;case 1:i=e-1,r=t-1,l=a=s=o=-1}if(Re)switch(Ce.pixel_size){case 8:for(var c,h,u=d,N=r,j=a,_=l,V=i,k=o,U=s,G=n,z=0,p=Ce.width,f=N;f!==_;f+=j)for(h=V;h!==U;h+=k,z++)c=G[z],u[4*(h+p*f)+0]=c,u[4*(h+p*f)+1]=c,u[4*(h+p*f)+2]=c,u[4*(h+p*f)+3]=255;break;case 16:for(var m,g=d,N=r,W=a,Y=l,X=i,Q=o,Z=s,v=n,A=0,y=Ce.width,E=N;E!==Y;E+=W)for(m=X;m!==Z;m+=Q,A+=2)g[4*(m+y*E)+0]=v[A+0],g[4*(m+y*E)+1]=v[A+0],g[4*(m+y*E)+2]=v[A+0],g[4*(m+y*E)+3]=v[A+1];break;default:console.error("TGALoader: Format not supported.")}else switch(Ce.pixel_size){case 8:for(var M,w,b=d,q=r,K=a,J=l,$=i,ee=o,te=s,ne=n,ie=F,re=0,x=Ce.width,I=q;I!==J;I+=K)for(w=$;w!==te;w+=ee,re++)M=ne[re],b[4*(w+x*I)+3]=255,b[4*(w+x*I)+2]=ie[3*M+0],b[4*(w+x*I)+1]=ie[3*M+1],b[4*(w+x*I)+0]=ie[3*M+2];break;case 16:for(var T,S,B=d,q=r,oe=a,ae=l,se=i,le=o,de=s,ce=n,he=0,P=Ce.width,C=q;C!==ae;C+=oe)for(S=se;S!==de;S+=le,he+=2)T=ce[he+0]+(ce[he+1]<<8),B[4*(S+P*C)+0]=(31744&T)>>7,B[4*(S+P*C)+1]=(992&T)>>2,B[4*(S+P*C)+2]=(31&T)>>3,B[4*(S+P*C)+3]=32768&T?0:255;break;case 24:for(var R,ue=d,pe=r,fe=a,me=l,ge=i,ve=o,Ae=s,ye=n,Ee=0,Me=Ce.width,O=pe;O!==me;O+=fe)for(R=ge;R!==Ae;R+=ve,Ee+=3)ue[4*(R+Me*O)+3]=255,ue[4*(R+Me*O)+2]=ye[Ee+0],ue[4*(R+Me*O)+1]=ye[Ee+1],ue[4*(R+Me*O)+0]=ye[Ee+2];break;case 32:for(var L,we=d,pe=r,be=a,xe=l,Ie=i,Te=o,Se=s,Be=n,D=0,Pe=Ce.width,H=pe;H!==xe;H+=be)for(L=Ie;L!==Se;L+=Te,D+=4)we[4*(L+Pe*H)+2]=Be[D+0],we[4*(L+Pe*H)+1]=Be[D+1],we[4*(L+Pe*H)+0]=Be[D+2],we[4*(L+Pe*H)+3]=Be[D+3];break;default:console.error("TGALoader: Format not supported.")}return d}(Ce.width,Ce.height,e.pixel_data,e.palettes);return{width:Ce.width,height:Ce.height,data:n,magFilter:THREE.NearestFilter,minFilter:THREE.NearestFilter}}},function(e){var a=this;this.is2DModel=e,this.metrics={},this.TextMaterial={},this.TextMaterialItalic={},this.TextMaterialBold={},this.TextMaterialIandB={},this.blendMaterial=null,this.newblendMaterial=null,this.shxMaterial=null,this.mappableUnit=4096,this.textSize=100,this.textUnit=parseInt(1.125*this.textSize),this.specialCodeArray=[],this.AddSpecialCode(),this.AttributeArray=[],this.HashTable=[],this.textString="",this.textPos=[],this.geometrytoRange=[],this.lines=[],this.objectuuidToGeo={},this.numTextGeom=0,this.ttfCompositeStride=6,this.ttfGeometryBuffers=[],this.shxCompositeStride=3,this.ttfMeshCompositeStride=3,this.shxGeometryBuffers=[],this.ttfMeshGeometryBuffers=[],this.genTTFGeometryBuffer=function(e){void 0===e&&(e=1024);e={compositeIBuffer:new THREE.InterleavedBuffer(new Float32Array(4*e*a.ttfCompositeStride),a.ttfCompositeStride),index:new THREE.Uint32BufferAttribute(new Uint32Array(6*e),1),bufferOffset:0,indexOffset:0};return e.compositePositionAttrib=new THREE.InterleavedBufferAttribute(e.compositeIBuffer,3,0,!1),e.compositeUvAttrib=new THREE.InterleavedBufferAttribute(e.compositeIBuffer,2,3,!1),e.compositeTextureAttrib=new THREE.InterleavedBufferAttribute(e.compositeIBuffer,1,5,!1),a.ttfGeometryBuffers[a.ttfGeometryBuffers.length]=e,a.ttfGeometryBuffers.length-1},this.getTTFGeometryBuffer=function(e){for(var t=-1,n=0,i=a.ttfGeometryBuffers.length;ng?this.textUnit/2-g:0,d=((l=l+d+x+28)+(b>>1)>this.mappableUnit&&(l=(l=14)+((d=0)>>1)+(b>>1)+28,c++),s.textAlign="center",s.fillText(p,l,this.textUnit*c),v>this.textUnit/2?v-this.textUnit/2:0),I=l,T=this.textUnit*c,x={height:1,width:f?1:(b+28)/this.textUnit,left:this.textUnit/2>g?(I-x-7)/this.mappableUnit:(I+g-this.textUnit/2-7)/this.mappableUnit,top:1-(T-this.textUnit+7)/this.mappableUnit,right:this.textUnit/2>g?(I-x+b+7)/this.mappableUnit:(I+g-this.textUnit/2+b+7)/this.mappableUnit,bottom:1-T/this.mappableUnit};n&&f&&(x.height=1.5,x.width=1.5),o&&(I=x.right-x.left,x.right-=(I*=.35)/2,x.left+=I/2,T=x.top-x.bottom,x.top-=(T*=.35)/2,x.bottom+=T/2),h[m]||(h[m]=new Object),h[m][p]=x}var S=null;return t&&((S=document.createElement("img")).src=yt.toDataURL("image/png")),S}),addHash:function(e){this.HashTable.push(e)},containHash:function(e){return-1!=this.HashTable.indexOf(e)},getHashKey:function(){return this.HashTable.concat()},SetTexture:function(e,t,n){this.textures=e;for(var i=0;i -0.5 && vtextureid < 0.5){","dist = texture2D(uSampler0, vUv).a;","}","if( vtextureid > 0.5 && vtextureid < 1.5){","dist = texture2D(uSampler1, vUv).a;","}","if( vtextureid > 1.5 && vtextureid < 2.5){","dist = texture2D(uSampler2, vUv).a;","}","if( vtextureid > 2.5 && vtextureid < 3.5){","dist = texture2D(uSampler3, vUv).a;","}","if( vtextureid > 3.5 && vtextureid < 4.5){","dist = texture2D(uSampler4, vUv).a;","}","float alpha = smoothstep(cBuffer - uGamma, cBuffer + uGamma, dist);","vec3 destColor = vColor;","if(destColor.r> 1.0){","destColor.r = 1.0;","alpha = 0.0;","}","if(destColor.g> 1.0){","destColor.r = 0.090;","destColor.g = 0.501;","destColor.b = 0.890;","}","gl_FragColor = vec4(destColor, alpha);","}"].join("\n")});if(1 -0.5 && vtextureid < 0.5){","dist = texture2D(uSampler0, vUv).a;","}","if( vtextureid > 0.5 && vtextureid < 1.5){","dist = texture2D(uSampler1, vUv).a;","}","if( vtextureid > 1.5 && vtextureid < 2.5){","dist = texture2D(uSampler2, vUv).a;","}","if( vtextureid > 2.5 && vtextureid < 3.5){","dist = texture2D(uSampler3, vUv).a;","}","if( vtextureid > 3.5 && vtextureid < 4.5){","dist = texture2D(uSampler4, vUv).a;","}","float alpha = smoothstep(cBuffer - uGamma, cBuffer + uGamma, dist);","vec3 destColor = diffuse;","if(destColor.r> 1.0){","destColor.r = 1.0;","alpha = 0.0;","}","if(destColor.g> 1.0){","destColor.r = 0.090;","destColor.g = 0.501;","destColor.b = 0.890;","}","gl_FragColor = vec4(destColor, alpha);","}"].join("\n")});if(1 min2.x && max2.y > min2.y && (posxy.x < min2.x || posxy.x > max2.x || posxy.y < min2.y || posxy.y > max2.y)){","alpha = 0.0;","}","gl_FragColor = vec4(diffuse, alpha);","}"].join("\n")}),this.shxMaterial.transparent=!0,this.shxMaterial.depthWrite=!1,this.blendMaterial=new THREE.ShaderMaterial({uniforms:{diffuse:{value:new THREE.Color(16777215)},max2:{value:new THREE.Vector2(0,0)},min2:{value:new THREE.Vector2(0,0)}},vertexShader:["varying vec2 posxy;","void main() { ","vec4 tmp = modelMatrix * vec4(position, 1.0);","posxy.xy= tmp.xy;","gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);","}"].join("\n"),fragmentShader:["#ifdef GL_ES","precision mediump float;","#endif","uniform vec3 diffuse;","uniform vec2 max2;","uniform vec2 min2;","varying vec2 posxy;","void main(void) {","float alpha=1.0;","if(max2.x > min2.x && max2.y > min2.y && (posxy.x < min2.x || posxy.x > max2.x || posxy.y < min2.y || posxy.y > max2.y)){","alpha = 0.0;","}","gl_FragColor = vec4(diffuse, alpha);","}"].join("\n")}),this.blendMaterial.transparent=!0,this.blendMaterial.depthWrite=!1,this.TextMaterialItalic=this.blendMaterial,this.TextMaterial=this.blendMaterial,this.TextMaterialBold=this.blendMaterial,this.TextMaterialIandB=this.blendMaterial}else if(3==e&&this.SDFVerison==e&&a){for(var V=new Object,v=0;vw?T.height:w,x=T.bearingY=E.superscriptbegin&&I<=E.superscriptend||E.subscript&&I>=E.subscriptbegin&&I<=E.subscriptend)&&(T.height*=.5,T.width*=.5,T.bearingX*=.5,T.bearingY*=.5,T.advanceX*=.5,T.advanceY*=.5),E.superscript&&I>=E.superscriptbegin&&I<=E.superscriptend&&(T.bearingY-=T.height),pw?T.height:w,x=T.bearingY=n.regResult.superscriptbegin&&p<=n.regResult.superscriptend||n.regResult.subscript&&p>=n.regResult.subscriptbegin&&p<=n.regResult.subscriptend)&&(m.height*=.5,m.width*=.5,m.bearingX*=.5,m.bearingY*=.5,m.advanceX*=.5,m.advanceY*=.5),n.regResult.superscript)&&p>=n.regResult.superscriptbegin&&p<=n.regResult.superscriptend&&(m.bearingY+=m.height);for(var g=m.height,v=m.width,A=m.shxRange[0],y=1;y=n.regResult.superscriptbegin&&g<=n.regResult.superscriptend||n.regResult.subscript&&g>=n.regResult.subscriptbegin&&g<=n.regResult.subscriptend)&&(A.height*=.5,A.width*=.5,A.bearingX*=.5,A.bearingY*=.5,A.advanceX*=.5,A.advanceY*=.5),n.regResult.superscript)&&g>=n.regResult.superscriptbegin&&g<=n.regResult.superscriptend&&(A.bearingY+=A.height);for(var y=A.height,E=A.width,M=A.shxRange[0],w=1;wp?A.height:p,m=A.bearingYp?A.height:p,m=A.bearingY=s.superscriptbegin&&E<=s.superscriptend||s.subscript&&E>=s.subscriptbegin&&E<=s.subscriptend)&&(M.height*=.5,M.width*=.5,M.bearingX*=.5,M.bearingY*=.5,M.advanceX*=.5,M.advanceY*=.5),s.superscript&&E>=s.superscriptbegin&&E<=s.superscriptend&&(M.bearingY+=M.height);var w=M.height,b=M.width,J=e.textFont.rotate&&this.IsChinese2(q),x=M.shxRange[0];if(f.set(new THREE.Vector3(0,0,0),new THREE.Vector3(0,0,0)),l.isShx)for(var $=1;$m&&(m=M.top);for(var ee=1;eeMath.PI/2?(B-Math.PI)*P:B*P;E.set(0,0,1);for(var R=0;RMath.PI/2&&(y.addScaledVector(m,G),D.isShx||y.addScaledVector(M,z)),D.isShx&&D.shapeId<=0&&(M.y=Math.abs(M.y)),y.addScaledVector(m,D.offset.x),y.addScaledVector(M,D.offset.y),(130==D.shapeId||132==D.shapeId||133==D.shapeId)&&this.viewer.modelContentVersion<2&&y.addScaledVector(M,-M.y*z*.5);H={x:y.x,y:y.y,z:y.z};X.push(H),D.isShx&&2<=this.viewer.modelContentVersion?this.addShxTextAttribute(x,k,U,W,y,E,C+D.rotation):3Math.PI/2?(x-Math.PI)*I:x*I;m.set(0,0,1);for(var S=0;SMath.PI/2&&(f.addScaledVector(c,O),R.isShx||f.addScaledVector(g,F)),R.isShx&&0==R.shapeId&&(g.y=Math.abs(g.y)),f.addScaledVector(c,R.offset.x),f.addScaledVector(g,R.offset.y),L.data.push(f.x,f.y,T+R.rotation)}}}}}return{styleText:v,stylePoint:A,styleLine:y}}}return{styleText:null,stylePoint:null,styleLine:null}}},this.addTextAttribute=function(e,t,n,i,r,o,a){for(var s=new THREE.Vector3,l=i.start,d=Math.min(i.count,n.count),c=n.array[l],h=c,u=l;un.array[u]?n.array[u]:c,h=h>n.array[u]?h:n.array[u];for(var p=c;p<=h;p++)s.fromArray(t.array,6*p),s.applyAxisAngle(o,a),s.add(r),e.data.push(s.x),e.data.push(s.y),e.data.push(s.z),e.data.push(t.array[6*p+3]),e.data.push(t.array[6*p+4]),e.data.push(t.array[6*p+5]);for(var f=l;fn.array[u]?n.array[u]:c,h=h>n.array[u]?h:n.array[u];for(var p=c;p<=h;p++)s.fromArray(t.array,3*p),s.applyAxisAngle(o,a),s.add(r),e.data.push(s.x),e.data.push(s.y),e.data.push(s.z);for(var f=l;fn.array[u]?n.array[u]:c,h=h>n.array[u]?h:n.array[u];for(var p=c;p<=h;++p)s.fromArray(t.array,3*p),s.applyAxisAngle(o,a),s.add(r),e.data.push(s.x),e.data.push(s.y),e.data.push(s.z);for(var f=l;f 0.9){","discard;","}","vec3 outgoingLight = vec3( 0.0 );","vec4 diffuseColor = vec4( diffuse, opacity );","outgoingLight = diffuseColor.rgb;","gl_FragColor = vec4(outgoingLight, diffuseColor.a );","}"].join("\n"),vertexShader:["attribute float lineDistance;","varying float vLineDistance;","void main() {","vLineDistance = lineDistance;","#ifdef USE_MODELMATRIXATTRIB\n\tmat4 ndsModelViewMatrix = viewMatrix * modelMatrixAttrib;\n\tgl_Position = projectionMatrix * ndsModelViewMatrix * vec4( position, 1.0 );\n#else\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n#endif\n","}"].join("\n")}));return this.lineMaterials.push(e),e},this.getTextMaterial=function(){return this.viewer.SDFMaker.GetLineStyleMaterial(this.viewer.modelContentVersion)},this.getShxTextMaterial=function(){return 2<=this.viewer.modelContentVersion?this.viewer.SDFMaker.GetMaterial(le.SHX):this.getTextMaterial()},this.getPointMaterial=function(){return this.pointMaterial||(this.pointMaterial=new THREE.ShaderMaterial({uniforms:{diffuse:{value:new THREE.Color(16711680)},linewidth:{value:1}},vertexShader:["uniform float linewidth;","void main() { ","gl_PointSize = linewidth;","#ifdef USE_MODELMATRIXATTRIB\n\tmat4 ndsModelViewMatrix = viewMatrix * modelMatrixAttrib;\n\tgl_Position = projectionMatrix * ndsModelViewMatrix * vec4( position, 1.0 );\n#else\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n#endif\n","}"].join("\n"),fragmentShader:["#ifdef GL_ES","precision mediump float;","#endif","uniform vec3 diffuse;","void main(void) {","gl_FragColor = vec4(diffuse, 1.0);","}"].join("\n")}),0==_e.enableTextRenderingBothSide?this.pointMaterial.side=THREE.DoubleSide:this.pointMaterial.side=THREE.FrontSide),this.pointMaterial},this.getLineMaterial=function(){return this.lineMaterial||(this.lineMaterial=new THREE.ShaderMaterial({uniforms:{diffuse:{value:new THREE.Color(16711680)}},vertexShader:["void main() { ","#ifdef USE_MODELMATRIXATTRIB\n\tmat4 ndsModelViewMatrix = viewMatrix * modelMatrixAttrib;\n\tgl_Position = projectionMatrix * ndsModelViewMatrix * vec4( position, 1.0 );\n#else\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n#endif\n","}"].join("\n"),fragmentShader:["#ifdef GL_ES","precision mediump float;","#endif","uniform vec3 diffuse;","void main(void) {","gl_FragColor = vec4(diffuse, 1.0);","}"].join("\n")})),this.lineMaterial},this.getLineStyleArray=function(e){return this.uuidToLineStyle[e].linePattern},this.clearLineType=function(){for(var e=0;e\n\t\t\tuniform vec3 minPos;\n\t\t\tvarying vec2 vUv;\n\t\t\tvoid main() {\n\n\t\t\t\tvUv = uv;\n\n\t\t\t\t#ifdef USE_MODELMATRIXATTRIB\n\t\t\t\t\tmat4 ndsModelViewMatrix = viewMatrix * modelMatrixAttrib;\n\t\t\t\t\tgl_Position = projectionMatrix * ndsModelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t#else\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t#endif\n\t\t\t}\n\t\t\t",fragmentShader:"\n\t\t\tuniform vec3 diffuse1;\n uniform vec3 diffuse2;\n\t\t\tuniform float hatchType;\n\t\t\tuniform float shift;\n\t\t\tuniform float params;\n\t\t\tvarying vec2 vUv;\n\n\t\t\t#define SQRT_2_VALUE 1.414213562373\n\t\t\t#define PI_VALUE 3.14159265359\n\n\t\t\tvoid main(){\n\t\t\t\tvec3 outColor;\n\t\t\t\tfloat dist = 0.0;\n\n\t\t\t\t// 直线形\n\t\t\t\tif( hatchType >0.5 && hatchType <1.5){\n\t\t\t\t\tdist = vUv.x;\n\t\t\t\t}\n\n\t\t\t\t// 球形\n\t\t\t\tif( hatchType >1.5 && hatchType <2.5){\n\t\t\t\t\tdist = length(vUv);\n\t\t\t\t\tdist = dist > 1.0 ? 0.0 : (sqrt(2.0-dist*dist)-1.0)/(SQRT_2_VALUE-1.0);\n\t\t\t\t}\n\n\t\t\t\t// 半球形\n\t\t\t\tif( hatchType >2.5 && hatchType <3.5){\n\t\t\t\t\tdist = sin((1.0 - length(vUv)) *PI_VALUE*0.5);\n\t\t\t\t}\n\n\t\t\t\t// 曲线形\n\t\t\t\tif( hatchType >3.5 && hatchType <4.5){\n\t\t\t\t\t//dist = cos(length(vUv)*PI_VALUE/2.0);\n\n\t\t\t\t\tdist = cos((length(vUv) - params)*PI_VALUE/2.0);\n\t\t\t\t}\n\n\t\t\t\t// 圆柱形\n\t\t\t\tif( hatchType >4.5 && hatchType <5.5){\n\t\t\t\t\t//dist = abs(vUv.x);\n\t\t\t\t\t//dist = vUv.x < 0.0 ? dist / (1.0-shift/2.0) : dist/(1.0+shift/2.0);\n\t\t\t\t\t//dist = 1.0 - dist;\n\t\t\t\t\t//dist = (sin(dist * PI_VALUE *3.0/4.0 - PI_VALUE/4.0)+SQRT_2_VALUE/2.0)/(1.0 + SQRT_2_VALUE/2.0);\n\n\t\t\t\t\tdist = vUv.x < 0.0 ? 1.0 + vUv.x /(1.0-shift/2.0): 1.0 - vUv.x/(1.0+shift/2.0);\n\t\t\t\t\tdist = (sin(dist * PI_VALUE *3.0/4.0 - PI_VALUE/4.0)+SQRT_2_VALUE/2.0)/(1.0 + SQRT_2_VALUE/2.0);\n\t\t\t\t}\n\n\t\t\t\toutColor = mix(diffuse1,diffuse2,dist);\n\t\t\t\tgl_FragColor = vec4(outColor, 1.0);\n\t\t\t}\n\t\t\t"})||this;return t.isMeshGradientShader=!0,t.setValues(e),t}var t,i,r;return i=n,(t=e).prototype=Object.create(i.prototype),wt(t.prototype.constructor=t,i),t=e,(i=[{key:"color",get:function(){return this.uniforms.diffuse.value},set:function(e){this.uniforms.diffuse.value=e}},{key:"color1",get:function(){return this.uniforms.diffuse1.value},set:function(e){this.uniforms.diffuse1.value=e}},{key:"color2",get:function(){return this.uniforms.diffuse2.value},set:function(e){this.uniforms.diffuse2.value=e}},{key:"hatchType",get:function(){return this.uniforms.hatchType.value},set:function(e){this.uniforms.hatchType.value=e}},{key:"shift",get:function(){return this.uniforms.shift.value},set:function(e){this.uniforms.shift.value=e}},{key:"params",get:function(){return this.uniforms.params.value},set:function(e){this.uniforms.params.value=e}}])&&Mt(t.prototype,i),r&&Mt(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}(THREE.ShaderMaterial),Tt=(ve.DASHTYPE={SOLID:0,DASH:1,DASHSPACE:2,LONGDASH_DOT:3,LONGDASH_DOUBLEDOT:4,LONGDASH_TRIPLEDOT:5,DOT0:6,LONGDASH_SHORTDASH:7,LONGDASH_DOUBLESHORTDASH:8,DASH_DOT:9,DOUBLEDASH_DOT:10,DASH_DOUBLEDOT:11,DOUBLEDASH_DOUBLEDOT:12,DASH_TRIPLEDOT:13,DOUBLEDASH_TRIPLEDOT:14,BATTING:15,BORDER:16,BORDER2:17,BORDERX2:18,CENTER:19,CENTER2:20,CENTERX2:21,DASHDOT:22,DASHDOT2:23,DASHDOTX2:24,DASHED:25,DASHED2:26,DASHEDX2:27,DIVIDE:28,DIVIDE2:29,DIVIDEX2:30,DOT:31,DOT2:32,DOTX2:33,FENCELINE1:34,FENCELINE2:35,GAS_LINE:36,HIDDEN:37,HIDDEN2:38,HIDDENX2:39,HOT_WATER_SUPPLY:40,JIS_02_07:41,JIS_02_10:42,JIS_02_12:43,JIS_02_20:44,JIS_02_40:45,JIS_08_11:46,JIS_08_15:47,JIS_08_25:48,JIS_08_37:49,JIS_08_50:50,JIS_09_08:51,JIS_09_15:52,JIS_09_29:53,JIS_09_50:54,PHANTOM:55,PHANTOM2:56,PHANTOMX2:57,TRACKS:58,ZIGZAG:59,CUSTOM:999},bt.prototype={constructor:bt,crossOrigin:void 0,addStatusElement:function(){var e=document.createElement("div");return e.style.position="absolute",e.style.right="0px",e.style.top="0px",e.style.fontSize="0.8em",e.style.textAlign="left",e.style.background="rgba(0,0,0,0.25)",e.style.color="#fff",e.style.width="120px",e.style.padding="0.5em 0.5em 0.5em 0.5em",e.style.zIndex=1e3,e.innerHTML="Loading ...",e},updateProgress:function(e){var t="Loaded ";e.total?t+=(100*e.loaded/e.total).toFixed(0)+"%":t+=(e.loaded/1024).toFixed(2)+" KB",this.statusDomElement.innerHTML=t},extractUrlBase:function(e){e=e.split("/");return 1===e.length?"./":(e.pop(),e.join("/")+"/")},loadTexture:function(t,e,n,i,r,o){var a,s,l,d;return void 0!==e[n]?e[n]:(a=null,s=n,_e.avoidCaching&&(s=n+"?time="+Date.now()),_e.singleHTML&&this.viewer.ZIPData?(l=new THREE.Texture,(d=this).viewer.ZIPData.file(n).async("blob").then(function(e){(a=new THREE.ImageLoader(ve.TextureLoadingManager)).crossOrigin=d.crossOrigin,a.crossOrigin="anonymous",a.load(window.URL.createObjectURL(e),function(e){l.image=e,l.needsUpdate=!0,r&&r(l)},void 0,function(){t.map=null,t.needsUpdate=!0,o&&o()})})):null!==a?l=a.load(s,r):-1>t;return e+1},function(e,t){this.viewer=e,this.type=2,this.version=0;function l(e,i){function t(e){for(var t=0,n=e.length;t=e.length?{done:!0}:{done:!1,value:e[n++]}};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Rt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n=c.superscriptbegin&&x<=c.superscriptend||c.subscript&&x>=c.subscriptbegin&&x<=c.subscriptend)&&(L.height*=.5,L.width*=.5),L.height*=P,L.width*=P;var D=L.height*this.SDFMaker.GetTextOffset(I,e.textFont.name),j=(c.superscript&&x>=c.superscriptbegin&&x<=c.superscriptend&&(D-=L.height),lGt&&(Gt=this.id+1),this.dataVersion=-1,this.nodeRequestor=n.nodeRequestor||new Lt(this,{loadingManager:n.loadingManager,onLoadCallback:n.onLoadCallback,onRenderSettingCallback:n.onRenderSettingCallback,onBufferChunkCallback:n.onBufferChunkCallback,onLoadErrorCallback:n.onLoadErrorCallback}),this.modelUri=t,this.geomManager=new R(e),this.meshManager=new ut(this.geomManager,this),this.referenceEntityDispManager=new st(this),this.meshSets=[],this.sptIndex=new ft(null,this.meshManager),this.lineSegmentsSet=new O(this.meshManager),this.SHADED_WITH_EDGES=1,this.SHADED=2,this.WIREFRAME=3,this.HIDDEN_LINE_REMOVE=4,this.HIDDEN_LINE_VISIBLE=5,this.TRANSPARENT=6,this.drawMode=1,this.renderOnce=!1,this.renderMeshSetCount=0,this.spriteDirty=!0,this.SDFMaker=new le(this.viewer.is2DModel),this.pmiObject=null,this.rootBodyNode=null,this.bodyUuid2NodeMap={},this.meshUuid2GeomUuidMap={},this.fileguidTouuid={},this.objectidTouuid={},this.is2DModel=!1,this.state=0,this.forceRenderAll=!1,this.wholeLeafBodyNodes=[],this.wholeRefEntityNodes=[],this.wholeCoordinateNodes=[],this.emptyBodyNodes=[],this.hasRawMesh=!1,this.transparentBodies=[],this.transparentBodiesDirty=!1,this.transparentBodyChanged=!1,this.containsOriginalTransparentBodies=!1,this.transparentizedBodies=[],this.transparentModeBodiesMap=new Map,this.selectedBodies=[],this.selectedBodiesDirty=!1,this.draggedBodies=[],this.hideBodies=[],this.UnloadNodes=[],this.pureLineBody=[],this.preselectedObject=null,this.hasHiddenBodies=!1,this.referenceEntityDirty=!1,this.explodeFactor=0,this.explodeFactorX=0,this.explodeFactorY=0,this.explodeFactorZ=0,this.explodeMode=ve.EXPLODEMODE.NORMAL,this.explodeLevel=0,this.explodeObject=null,this.LeafbodyToFirstBodyMap=new Map,this.leafNodeCount=0,this.tempCenterBox=new THREE.Vector3,this.bodyNodeUUidToMaterial={},this.ModelUpMatrix4=[],this.NeedsMergeBodyNode=!1,this.sortMeshSets=(o=[],a=new THREE.Vector3,s=new THREE.Box3,l=new THREE.Vector3,d=new THREE.Vector3,function(e,t){for(var n=o.length=0,i=e.length;no)&&(Math.abs(a.BaseLine.start.x-a.BaseLine.end.x)<1e-6&&Math.abs(i.x-a.BaseLine.end.x)<1e-6||Math.abs(a.BaseLine.start.y-a.BaseLine.end.y)<1e-6&&Math.abs(i.y-a.BaseLine.end.y)<1e-6||Math.abs(a.BaseLine.start.z-a.BaseLine.end.z)<1e-6&&Math.abs(i.z-a.BaseLine.end.z)<1e-6)&&(t.distance=o,t.axis=r)}}}},preparePMI:function(){},afterAllGeomLoaded:function(){var h=this,u=new THREE.Matrix4,e=new THREE.Matrix4;if(this.viewer.pmiObject&&!_e.ScenarioEditor&&!this.viewer.is2DModel){0<(t=this.viewer.SDFMaker.getHashKey()).length&&(t=this.viewer.SDFMaker.CreateImage(t),this.viewer.SDFMaker.CreateOldMaterialFromImage(t)),this.viewer.pmiObject.children[0].traverse(function(e){e.geometry&&"TextBufferGeometry"==e.geometry.type&&null!=e.geometry.styleId&&(e.material=h.viewer.SDFMaker.TextMaterial)});for(var t,n=this.pmiObject.children[0].children[0],i=1;iy.leafBodyAttri.bodyBbox[3+d]&&(y.leafBodyAttri.bodyBbox[3+d]=this.meshManager.bboxes[6*a+3+d])}}}for(var v=[],a=0;af[0].distance+2*t&&(r.length=0)}return 0t[0].distance&&(o[0]=t[0],a.activeModel=e))}),o},intersectReferenceEntity:function(e,t){if(this.activeModel)return this.activeModel.intersectReferenceEntity(e,t)},setExplodeFactor:function(t,n){this.models.forEach(function(e){if(e.sketchFileUrl)return!0;e.setExplodeFactor(t,n)})},getExplodeTranslate:function(e,t){return this.viewer.currentSketchFileUrl?this.staticModel.getExplodeTranslate(e,t):this.activeModel?this.activeModel.getExplodeTranslate(e,t):void 0},getBodyTranslate:function(t){var n=[];return this.models.forEach(function(e){if(e.sketchFileUrl)return!0;e.rootBodyNode&&e.rootBodyNode.uuid==t.getModel().rootBodyNode.uuid&&(n=e.getBodyTranslate(t))}),n},getBodyTranslateWithoutExplode:function(e){return this.viewer.currentSketchFileUrl?this.staticModel.getBodyTranslateWithoutExplode(e):this.activeModel?this.activeModel.getBodyTranslateWithoutExplode(e):void 0},getBodyTransform:function(e){if(this.activeModel)return this.activeModel.getBodyTransform(e)},getLeafBodyBoundingBox:function(e){if(this.activeModel)return this.activeModel.getLeafBodyBoundingBox(e)},getLeafBodyBoundingBoxTrue:function(e){if(this.activeModel)return this.activeModel.getLeafBodyBoundingBoxTrue(e)},calculateMeshBodyBoundingBox:function(e){if(this.activeModel)return this.activeModel.calculateMeshBodyBoundingBox(e)},calculateLineBodyBoundingBox:function(e){if(this.activeModel)return this.activeModel.calculateLineBodyBoundingBox(e)},getBodyBoundingBox:function(t){var n=new THREE.Box3,i=this;return"parentNode"==t.type?t.children.forEach(function(e){n.union(i.getBodyBoundingBox(e))}):this.models.forEach(function(e){if(e.sketchFileUrl)return!0;e.rootBodyNode&&e.rootBodyNode.uuid==t.getModel().rootBodyNode.uuid&&(n=e.getBodyBoundingBox(t))}),n},getVisibleBodyBoundingBox:function(t,n){var i=new THREE.Box3,r=this;return n&&!t.visible||("parentNode"==t.type?t.children.forEach(function(e){n?e.visible&&i.union(r.getVisibleBodyBoundingBox(e)):i.union(r.getBodyBoundingBox(e))}):this.models.forEach(function(e){if(e.sketchFileUrl)return!0;e.rootBodyNode.uuid==t.getModel().rootBodyNode.uuid&&(n?child.visible&&(i=e.getVisibleBodyBoundingBox(t,n)):i=e.getBodyBoundingBox(t,n))})),i},getTotalVisibleBoundingBox:function(n){var i=new THREE.Box3;return this.models.forEach(function(e){if(e.sketchFileUrl)return!0;var t;(t=e.rootBodyNode?e.getVisibleBodyBoundingBox(e.rootBodyNode,n):t)&&i.union(t)}),i},getTotalBodyBoundingBox:function(){var n=new THREE.Box3;return this.models.forEach(function(e){if(e.sketchFileUrl)return!0;var t;(t=e.rootBodyNode?e.getBodyBoundingBox(e.rootBodyNode):t)&&n.union(t)}),n},getBodyBoundingBoxTrue:function(t){var n=null;return this.models.forEach(function(e){if(e.sketchFileUrl)return!0;e.rootBodyNode.uuid==t.getModel().rootBodyNode.uuid&&(n=e.getBodyBoundingBoxTrue(t))}),n},RemoveElement:function(e,t){if(this.activeModel)return this.activeModel.RemoveElement(e,t)},hasDraggedBodies:function(){var t=!1;return this.models.forEach(function(e){e.hasDraggedBodies()&&(t=!0)}),t},dragBody:function(t,n){this.models.forEach(function(e){e.rootBodyNode.uuid==t.getModel().rootBodyNode.uuid&&e.dragBody(t,n)})},restoreDraggedBody:function(t){this.models.forEach(function(e){e.rootBodyNode.uuid==t.getModel().rootBodyNode.uuid&&e.restoreDraggedBody(t)})},changeBodyColor:function(t,n,i){this.models.forEach(function(e){e.rootBodyNode.uuid==t.getModel().rootBodyNode.uuid&&e.changeBodyColor(t,n,i)})},hasTransparentBodies:function(){var t=!1;return this.models.forEach(function(e){e.hasTransparentBodies()&&(t=!0)}),t},transparentBody:function(t,n,i){var r=this;"parentNode"==t.type?t.children.forEach(function(e){r.transparentBody(e,n,i)}):this.models.forEach(function(e){e.rootBodyNode.uuid==t.getModel().rootBodyNode.uuid&&e.transparentBody(t,n,i)})},opaqueBody:function(t){var n=this;"parentNode"==t.type?t.children.forEach(function(e){n.opaqueBody(e)}):this.models.forEach(function(e){e.rootBodyNode.uuid==t.getModel().rootBodyNode.uuid&&e.opaqueBody(t)})},transparentizeBodies:function(r){var t=this;1==r.length&&"parentNode"==r[0].type?body.children.forEach(function(e){t.transparentizeBodies([e])}):this.models.forEach(function(e){for(var t=[],n=0;n=i._clip.duration&&(i.reset(),v=new THREE.Clock),i.enabled=!0,i.paused=!t,i.play()}}},this.startSkeletonAnimationByUUID=function(e,t){if(this.bHasSkeletonAnimation)if(p=s=!1,null==e){if(null==t||t){g=this.skeletonAnimationObjects[0].actionSkinMeshs[0].actions[0]._clip.animationUUID;for(var n=0;n=o._clip.duration&&(o.reset(),v=new THREE.Clock),o.enabled=!0,o.paused=!t,o.play())}},this.startSolidAnimationByUUID=function(e,t){if(d&&0=i._clip.duration&&(i.reset(),v=new THREE.Clock),i.paused=!1,i.play(),s=p=!1,f=1e3/a.fps):i.paused=!0)}return a},this.getAnimationLoopModeByUUID=function(e){var t="loopRepeat";if(d&&0O.width&&(o.max.x=O.width),o.max.y>O.height&&(o.max.y=O.height),o.isEmpty()||(c=x.viewer.scene.overrideMaterial,h=x.viewer.renderer.getClearColor(x.viewer.oldClearColor).clone(),u=x.viewer.renderer.getClearAlpha(),x.viewer.scene.overrideMaterial=D,x.viewer.renderer.setClearColor(3),x.viewer.ndsModel&&(x.viewer.ndsModel.backupDirty(),x.viewer.ndsModel.setDirty(),x.viewer.ndsModel.setDrawMode(x.viewer.ndsModel.SHADED),x.viewer.scene.children.push(x.viewer.ndsModel),x.viewer.ndsModel.setOverrideMaterial(D,H,!1)),x.viewer.renderer.render(x.viewer.scene,x.viewer.camera,O,!0),x.viewer.scene.overrideMaterial=c,x.viewer.ndsModel&&(x.viewer.ndsModel.setOverrideMaterial(null,null,!1),x.viewer.ndsModel.resetDirty()),x.viewer.renderer.render(L,x.viewer.camera,O,!1),A=o.max.x-o.min.x,y=o.max.y-o.min.y,r=new Uint8Array(4*A*y),x.viewer.renderer.readRenderTargetPixels(O,o.min.x,O.height-o.max.y,A,y,r),x.viewer.renderer.setRenderTarget(null),x.viewer.renderer.setClearColor(h,u));for(p in I)if(f=I[p]){var m=!0;if("1"!=f.version){var g=T[f.uuid];if(g&&r)for(var v=g.material.color.getHex(""),A=o.max.x-o.min.x,y=o.max.y-o.min.y,m=!1,E=f.screenPosition.x-1;E<=f.screenPosition.x+1&&E<=o.max.x&&E>=o.min.x;++E){for(var M=f.screenPosition.y-1;M<=f.screenPosition.y+1&&M<=o.max.y&&M>=o.min.y;++M){var w=4*((y-(M-o.min.y))*A+(E-o.min.x)),w=r[w]<<16|r[1+w]<<8|r[2+w];if(Math.abs(w-v)<3){m=!0;break}}if(1==m)break}}else{var g=f.worldPosition.clone(),b=(g.clone(),x.viewer.camera.position.distanceTo(g)),b=new THREE.Raycaster(x.viewer.camera.position,g.sub(x.viewer.camera.position).normalize(),0,.9999*b).intersectObjects(x.viewer.selectionManager.getTargetList());0=t?i.style.visibility="visible":(i.style.visibility="hidden",E==n&&(E="")))}},this.setAnnotationsVisiblilityForAnimation=function(e){if(this.viewer.canvas2D)for(var t in A){var n=A[t];n&&"animation"==I[t].ownerType&&(n.style.visibility=e?"visible":"hidden")}},this.hideAllAnnotations=function(e){if(this.viewer.canvas2D)for(var t in w&&(this.viewer.canvas2D.getContext("2d").clearRect(w.min.x,w.min.y,w.max.x-w.min.x,w.max.y-w.min.y),w=null),E="",A){var n,i=A[t];i&&(n=!0,n=("animation"!=I[t].ownerType||e!=I[t].ownerUuid)&&n)&&(i.style.visibility="hidden")}},this.setAnnotationsVisibility=function(e){if(this.viewer.canvas2D){for(var t in i=!e,w&&(this.viewer.canvas2D.getContext("2d").clearRect(w.min.x,w.min.y,w.max.x-w.min.x,w.max.y-w.min.y),w=null),E="",A){t=A[t];t&&(t.style.visibility=e?"visible":"hidden")}x.viewer.render()}},this.isAnnotationsVisible=function(){i=!0;var e,t=0;for(e in A)if(A.hasOwnProperty(e)){t++;var n=A[e];if(n&&("visible"==n.style.visibility||n.style.hidemodel)){i=!1;break}}return!(i=0==t?!1:i)},this.getHotPoint=function(e,t){function n(e){return e.parent?e.parent.fileguid||n(e.parent):null}var i,r,o,a,s,l=this.viewer.renderer.getPixelRatio(),d=new THREE.Matrix4,c=(d.multiplyMatrices(this.viewer.camera.matrixWorld,d.getInverse(this.viewer.camera.projectionMatrix)),!1),h=new Object,u=this.viewer.selectionManager.getPickIntersects(e,t);return u&&0U.maxPrimitivesPerFrame)&&!(i=0)});if(r&&0u+U.maxTrianglesPerFrame||f+1===m)&&(u=U.info.render.triangles,h=performance.now(),i-=h-p,p=h,c()))break}var v=e.getMeshSets(),A=[];if(0==v.length&&(d=!1),0c+U.maxLinesPerFrame||h===E)&&(c=U.info.render.lines,a=performance.now(),(o=d-(a-l))<0||o<300&&U.info.render.triangles+U.info.render.lines>U.maxPrimitivesPerFrame)&&!(o=0))return o}if(n){f=e.getMeshSets();for(y=0,E=n.length;y=A.length,d&&e.renderOnce&&(e.renderOnce=e.getLineSegmentsSet().dirty),null==e.renderOnce)&&(e.renderOnce=!0),e.renderOnce||(e.renderMeshSetCount=0)}}function Y(e,t,n,i){if(e.selectedBodiesDirty&&!_e.inBIMContext){for(var r=e.getSelectedBodies(),o=0,a=r.length;o varying vec2 vUv; uniform sampler2D colorTexture; uniform vec2 texSize; uniform vec2 direction; uniform float kernelRadius; float gaussianPdf(in float x, in float sigma) { return 0.39894 * exp( -0.5 * x * x/( sigma * sigma))/sigma; } void main() { vec2 invSize = 1.0 / texSize; float weightSum = gaussianPdf(0.0, kernelRadius); vec3 diffuseSum = texture2D( colorTexture, vUv).rgb * weightSum; vec2 delta = direction * invSize * kernelRadius/float(MAX_RADIUS); vec2 uvOffset = delta; for( int i = 1; i <= MAX_RADIUS; i ++ ) { float w = gaussianPdf(uvOffset.x, kernelRadius); vec3 sample1 = texture2D( colorTexture, vUv + uvOffset).rgb; vec3 sample2 = texture2D( colorTexture, vUv - uvOffset).rgb; diffuseSum += ((sample1 + sample2) * w); weightSum += (2.0 * w); uvOffset += delta; } float alpha = texture2D( colorTexture, vUv).a; gl_FragColor = vec4(diffuseSum/weightSum, alpha); }"})},getOverlayMaterial:function(){return new THREE.ShaderMaterial({uniforms:{maskTexture:{value:null},edgeTexture1:{value:null},edgeStrength:{value:1}},vertexShader:"varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n }",fragmentShader:"varying vec2 vUv; uniform sampler2D maskTexture; uniform sampler2D edgeTexture1; uniform float edgeStrength; void main() { vec4 edgeValue = texture2D(edgeTexture1, vUv); vec4 maskColor = texture2D(maskTexture, vUv); vec4 finalColor = edgeStrength * maskColor.r * edgeValue; gl_FragColor = finalColor; }",blending:THREE.NormalBlending,depthTest:!1,depthWrite:!1,transparent:!0})}}),Zt.BlurDirectionX=new THREE.Vector2(1,0),Zt.BlurDirectionY=new THREE.Vector2(0,1),qt.prototype=Object.assign(Object.create(Zt.prototype),{constructor:qt,renderToMaskBuffer:function(e){if(0>t;return e+1},$t.prototype=Object.create(THREE.EventDispatcher.prototype),en.prototype={constructor:en,load:function(t,e,i,r,o){function n(e){var n=e,e=(n&&n.preload(),new THREE.XHRLoader(a.manager));e.setCrossOrigin(this.crossOrigin),e.load(t,function(e){e=a.parse(e);e.traverse(function(e){var t;e instanceof THREE.Mesh&&e.material.name&&(t=n?n.create(e.material.name):null)&&(e.material=t)}),i(e)},r,o)}var a=this;e?new $t(t.substr(0,t.lastIndexOf("/")+1)).load(e,n,r,o):n()},parse:function(e,t){function n(e,t,n){return new THREE.Vector3(e,t,n)}function r(e,t,n,i){return new THREE.Face3(e,t,n,i)}var o=0;function i(e,t){0i||a.pointer.y>r)&&(a.pointer2nd.x>i||a.pointer2nd.y>r))return void a.touchend(e)}}switch(a.state){case ve.TOUCH.TOUCH_SINGLE:a.viewer.controls.getOperator().type!=a.type&&1!=e.force||a.onTouchSingleMove(e);break;case ve.TOUCH.TOUCH_DOUBLE:a.onTouchDoubleMove(e)}a.pointerOld.copy(a.pointer),a.pointerOld2nd.copy(a.pointer2nd)}},this.touchend=function(e){if((!_e.enableBroadcast||_e.broadcastMajor)&&!(a.viewer.isClipTransformControlSelected()||"Lineargauge"==a.measureType&&a.MeasureOper.lineargaugediv&&"block"==a.MeasureOper.lineargaugediv.style.display)){switch(a.state){case ve.TOUCH.TOUCH_SINGLE:var t,n;e.changedTouches&&0n.x||t.y>n.y||t.z>n.z||this.viewer.cameraControl.setBoundingBox(t,n))},ye.prototype.onTouchSingleStart=function(e){g.prototype.onTouchSingleStart.call(this,e)},ye.prototype.onTouchSingleMove=function(e){0<(this.viewer.ndsModel?this.viewer.selectionManager.getSelectedObjects():this.viewer.selectionManager.getSelectedMeshes()).length&&"move"==this.opMode?this.onOpDrag():g.prototype.onTouchSingleMove.call(this,e)},ye.prototype.onTouchSingleEnd=function(e){this.state=-1,Math.abs(this.singleTouchEndPos.x-this.singleTouchStartPos.x)<1&&Math.abs(this.singleTouchEndPos.y-this.singleTouchStartPos.y)<1&&("move"==this.opMode||"default"==this.opMode?(this.viewer.selectionManager.selectByClick(this.singleTouchEndPos.x,this.singleTouchEndPos.y),this.render()):"restore"==this.opMode&&this.onOpRestore(this.singleTouchEndPos.x,this.singleTouchEndPos.y)),this.hideRotateCenterHelper()},0),An=function(e){var r,E=e,o=null,a=null,s=null,l=!1,d=null,p=Number.MAX_VALUE,c=null,h=null;this.isSnapped=function(){return l},this.getSnappedType=function(){return d},this.getSnappedVertex=function(){return a},this.isEqualWithPrecision=function(e,t){return Math.abs(e-t)<=.001},this.isEqualVectorsWithPrecision=function(e,t){return Math.abs(e.x-t.x)<=.001&&Math.abs(e.y-t.y)<=.001&&Math.abs(e.z-t.z)<=.001},this.isInverseVectorsWithPrecision=function(e,t){return Math.abs(e.x+t.x)<=.001&&Math.abs(e.y+t.y)<=.001&&Math.abs(e.z+t.z)<=.001},this.trianglesSharedEdge=function(e,t,n,i,r,o){var a=!1,s=!1,l=!1;return(e.equals(i)||e.equals(r)||e.equals(o))&&(a=!0),(t.equals(i)||t.equals(r)||t.equals(o))&&(s=!0),(n.equals(i)||n.equals(r)||n.equals(o))&&(l=!0),!!(a&s||a&l||s&l)},this.getTrianglesOnSameFace=function(e,t,n,i){var r=!1,o=e.vertices.slice(),a=new THREE.Geometry,s=(a.vertices.push(t),a.vertices.push(n),a.vertices.push(i),a.faces.push(new THREE.Face3(0,1,2)),[]);do{for(var s=[],l=0;li||Math.abs(t[1]-n[1])>i)?(o.OpMeasure.startPoint=t,o.OpMeasure.unsteadyTextBox=this,o.OpMeasure.unsteadyMoving=!0,n=document.createEvent("HTMLEvents"),Se.isMobileDevice()?(n.initEvent("touchmove",!0,!0),n.touches=e.touches,n.force=!0,1==e.touches.length&&(o.OpMeasure.state=ve.TOUCH.TOUCH_SINGLE)):(n.initEvent("mousemove",!0,!0),0===e.button&&(o.OpMeasure.state=ve.MOUSE.NONE),n.offsetX=e.offsetX,n.clientX=e.clientX,n.offsetY=e.offsetY,n.clientY=e.clientY),(o.viewer.canvas2D||o.viewer.canvas3D).dispatchEvent(n),e.preventDefault()):Se.isMobileDevice()||o.OpMeasure.InfoType!=ve.INFOTYPE.MOUSEENTER&&o.OpMeasure.InfoType!=ve.INFOTYPE.CROSSENTER&&o.OpMeasure.PostInfo(ve.INFOTYPE.MOUSEENTER)},this.mouseenter=function(){o.OpMeasure.InfoType!=ve.INFOTYPE.MOUSEENTER&&o.OpMeasure.InfoType!=ve.INFOTYPE.CROSSENTER&&o.OpMeasure.InfoType!=ve.INFOTYPE.MEASURENOTICEBEGIN&&(o.InfoType=o.OpMeasure.InfoType),o.OpMeasure.PostInfo(ve.INFOTYPE.MOUSEENTER),o.clearPreInfo()},this.mouseleave=function(e){o.OpMeasure.unsteady||o.OpMeasure.PostInfo(o.InfoType)},this.sectionCrossend=function(e){if(e&&e.preventDefault(),!o.OpMeasure.unsteadyMoving){o.OpMeasure.unsteadyuuid=this.parentElement.getAttribute("group");for(var e=o.OpMeasure.rootObject.getObjectByProperty("uuid",o.OpMeasure.unsteadyuuid),t=(delete o.OpMeasure.unsteadyData[o.OpMeasure.unsteadyuuid],o.OpMeasure.rootObject.remove(e),o.viewer.container.removeChild(this.parentElement),999),n=0;n=h))break;if(c instanceof THREE.Line){h=s[d];s[d]=s[0],s[0]=h;break}}}return s},h.prototype.createAndShowDistanceDimension=function(e,t){var n,i,r,o,a,s,l,d,c,h,u,p,f,m,g,v,A,y,E,M,w,b,x,I,T;this.distanceInfo.firstSelObj&&this.distanceInfo.secondSelObj&&(n=!1,r=((n=this.distanceInfo.firstSelInfo&&"plane"==this.distanceInfo.firstSelInfo.type&&this.distanceInfo.secondSelInfo&&"plane"==this.distanceInfo.secondSelInfo.type?!0:n)?(i=this.distanceInfo.firstSelInfo.intersect.clone(),this.distanceInfo.secondSelInfo.intersect):(i=this.distanceInfo.firstPoint.clone(),this.distanceInfo.secondPoint)).clone(),this.distanceInfo.fstClndPos||(this.distanceInfo.fstClndPos=this.distanceInfo.firstPoint.clone()),this.distanceInfo.sndClndPos||(this.distanceInfo.sndClndPos=this.distanceInfo.secondPoint.clone()),this.distanceInfo.textPos&&e&&((T=new THREE.Plane).setFromCoplanarPoints(i,this.distanceInfo.fstClndPos,this.distanceInfo.sndClndPos),T.normal.length()<1e-8&&T.setFromCoplanarPoints(i.clone().add(new THREE.Vector3(1,-1,1)),this.distanceInfo.fstClndPos,this.distanceInfo.sndClndPos),w=this.clientCoordToModelCoordOnPlane(e.x,e.y,T))&&(this.viewer.is2DModel&&(w.z=0),this.distanceInfo.textPos.copy(w)),this.distanceInfo.fstClnd&&this.distanceInfo.sndClnd?!n&&this.distanceInfo.textPos?(l=(new THREE.Vector3).subVectors(this.distanceInfo.sndClndPos,this.distanceInfo.fstClndPos),(o=this.getProjectPntToLine(r,this.distanceInfo.sndClndPos,this.distanceInfo.textPos.clone()))&&(1e-5<(w=o.clone().sub(r)).length()?(this.distanceInfo.sndClndPos.addVectors(r,w),this.distanceInfo.fstClndPos.subVectors(this.distanceInfo.sndClndPos,l)):(a=this.viewer.camera.position,s=(new THREE.Vector3).subVectors(a,this.distanceInfo.fstClndPos),(d=(l=(new THREE.Vector3).subVectors(this.distanceInfo.secondPoint,this.distanceInfo.firstPoint)).length())<1e-8?(d=(l=new THREE.Vector3(100,100,100)).length(),(c=(new THREE.Vector3).crossVectors(l,s)).normalize().multiplyScalar(Math.max(.001*d,1e-4)),this.distanceInfo.fstClndPos.add(c),this.distanceInfo.sndClndPos.sub(c)):((c=(new THREE.Vector3).crossVectors(l,s)).normalize().multiplyScalar(Math.max(.001*d,1e-4)),this.distanceInfo.fstClndPos.add(c),this.distanceInfo.sndClndPos.add(c))))):n&&(w=(new THREE.Vector3).subVectors(this.distanceInfo.sndClndPos,this.distanceInfo.fstClndPos),b=(new THREE.Vector3).subVectors(this.distanceInfo.textPos,this.distanceInfo.fstClndPos),(T=new THREE.Plane).setFromCoplanarPoints(i,r,this.distanceInfo.sndClndPos),(e=this.clientCoordToModelCoordOnPlane(e.x,e.y,T))&&(o=this.getProjectPntToLine(this.distanceInfo.secondSelInfo.intersect,this.distanceInfo.sndClndPos,e))&&this.distanceInfo.sndClndPos.copy(o),this.distanceInfo.fstClndPos=this.distanceInfo.sndClndPos.clone().sub(w),this.distanceInfo.textPos.copy(this.distanceInfo.fstClndPos.clone().add(b))):n?(T=(new THREE.Vector3).subVectors(r,i),(e=this.distanceInfo.firstSelInfo.worldNormal.clone()).normalize(),this.distanceInfo.fstClndPos=i.clone(),this.distanceInfo.sndClndPos=new THREE.Vector3,o=this.distanceInfo.dimString,o*=x=this.viewer.getUnitScale(this.distanceInfo.unit),o=Math.max(o,1e-4),0dis:"+c:"距离:"+c,this.distanceInfo.textBox.appendChild(u),e=document.createElement("p"),f=Math.abs(this.distanceInfo.firstPoint.x-this.distanceInfo.secondPoint.x),d=this.viewer.getDispalyModelUnit(f),e.innerHTML="X:"+(f*this.viewer.measuringScale*d.scale).toFixed(2)+this.getUnitStringmap(d.unit),this.distanceInfo.textBox.appendChild(e),m=document.createElement("p"),g=Math.abs(this.distanceInfo.firstPoint.z-this.distanceInfo.secondPoint.z),d=this.viewer.getDispalyModelUnit(g),m.innerHTML="Y:"+(g*this.viewer.measuringScale*d.scale).toFixed(2)+this.getUnitStringmap(d.unit),this.distanceInfo.textBox.appendChild(m),v=document.createElement("p"),A=Math.abs(this.distanceInfo.firstPoint.y-this.distanceInfo.secondPoint.y),d=this.viewer.getDispalyModelUnit(A),v.innerHTML="Z:"+(A*this.viewer.measuringScale*d.scale).toFixed(2)+this.getUnitStringmap(d.unit),this.distanceInfo.textBox.appendChild(v)):(this.distanceInfo.textBox=document.createElement("div"),this.distanceInfo.textBox.className="section10",this.distanceInfo.textBox.innerHTML=c,(y=document.createElement("div")).className="sectionPoint",this.distanceInfo.textBox.appendChild(y),(h=document.createElement("div")).className="sectionCross",this.distanceInfo.textBox.appendChild(h)),this.viewer.container.appendChild(this.distanceInfo.textBox)),this.distanceInfo.boxToClndLine&&(this.OpMeasure.rootObject.remove(this.distanceInfo.boxToClndLine),this.distanceInfo.boxToClndLine=null),E=this.distanceInfo.firstPoint.clone().add(this.distanceInfo.secondPoint).divideScalar(2),this.distanceInfo.boxToClndLine||(this.distanceInfo.boxToClndLine=this.createLineMesh2(E,this.distanceInfo.textPos,this.appmaterialLine,1),this.distanceInfo.boxToClndLine.name="unsteady",this.OpMeasure.rootObject.add(this.distanceInfo.boxToClndLine)),M=this.get2dPoint(this.distanceInfo.textPos.clone()),w=this.viewer.renderer.getPixelRatio(),this.distanceInfo.textBox.style.left=Math.round(M.x/w-49)+"px",this.distanceInfo.textBox.style.top=Math.round(M.y/w-26)+"px",1==t)&&((b={}).dimString=c,b.textPos=this.distanceInfo.textPos.clone(),b.textBox=this.distanceInfo.textBox,x=this,(I=new THREE.Group).objectType="Group",x.OpMeasure.rootObject.remove(x.distanceInfo.boxToClndLine),x.OpMeasure.rootObject.remove(x.distanceInfo.fstToSndLine),x.OpMeasure.rootObject.remove(x.distanceInfo.firstSelObj),x.OpMeasure.rootObject.remove(x.distanceInfo.secondSelObj),x.distanceInfo.FstToFstPointLine&&(x.OpMeasure.rootObject.remove(x.distanceInfo.FstToFstPointLine),I.add(x.distanceInfo.FstToFstPointLine)),x.distanceInfo.SndToSndPointLine&&(x.OpMeasure.rootObject.remove(x.distanceInfo.SndToSndPointLine),I.add(x.distanceInfo.SndToSndPointLine)),x.distanceInfo.axisLineObj&&(x.OpMeasure.rootObject.remove(x.distanceInfo.axisLineObj),I.add(x.distanceInfo.axisLineObj)),x.distanceInfo.secaxisLineObj&&(x.OpMeasure.rootObject.remove(x.distanceInfo.secaxisLineObj),I.add(x.distanceInfo.secaxisLineObj)),I.add(x.distanceInfo.fstToSndLine),I.add(x.distanceInfo.firstSelObj),I.add(x.distanceInfo.secondSelObj),x.OpMeasure.rootObject.add(I),Se.isMobileDevice()?(b.textBox.addEventListener("touchstart",this.touchstart,!1),b.textBox.addEventListener("touchend",this.touchend,!1),b.textBox.addEventListener("touchmove",this.touchmove,!1)):(b.textBox.addEventListener("mousedown",this.touchstart,!1),b.textBox.addEventListener("mouseup",this.touchend,!1),b.textBox.addEventListener("mousemove",this.touchmove,!1),b.textBox.addEventListener("mouseleave",this.mouseleave,!1),b.textBox.addEventListener("mouseenter",this.mouseenter,!1)),Se.isMobileDevice()?h.addEventListener("touchend",this.sectionCrossend,!1):(h.addEventListener("mousedown",this.sectionCrossend,!1),h.addEventListener("mouseleave",this.crossleave,!1),h.addEventListener("mouseenter",this.crossenter,!1)),(T={}).start=this.distanceInfo.textPos.clone(),T.end=E.clone(),T.uuid=I.uuid,this.OpMeasure.textLines.push(T),b.textBox.setAttribute("mobile","up"),b.textBox.setAttribute("group",I.uuid),b.textBox.setAttribute("type","length"),b.textBox.setAttribute("dimString",this.distanceInfo.dimString),b.textBox.setAttribute("dimStringPrefix",this.distanceInfo.dimStringPrefix),b.textBox.setAttribute("unit",this.distanceInfo.unit),b.textBox.setAttribute("lineInfo",this.OpMeasure.textLines.length-1),this.OpMeasure.boxInfos.push(b),this.OpMeasure.unsteadyData[I.uuid]=this.DeepCopy(this.distanceInfo,"Distance"),this.OpMeasure.unsteadyData[I.uuid].p1=n,this.OpMeasure.unsteadyData[I.uuid].p2=i,this.clearDistanceInfo(!0),Se.isMobileDevice())&&this.ChangeMeasureFlag()},h.prototype.changeMeasureDistance=function(e){var t=this.OpMeasure.unsteadyData[this.OpMeasure.unsteadyuuid],n=(t.textPos&&e&&((i=new THREE.Plane).setFromCoplanarPoints(t.p1,t.fstClndPos,t.sndClndPos),i.normal.length()<1e-8&&i.setFromCoplanarPoints(t.p2,t.fstClndPos,t.sndClndPos),i.normal.length()<1e-8&&i.setFromCoplanarPoints(t.p1.clone().add(new THREE.Vector3(1,-1,1)),t.fstClndPos,t.sndClndPos),i.normal.length()<1e-8&&i.setFromCoplanarPoints(t.p1,t.fstClndPos.clone().add(new THREE.Vector3(1,-1,1)),t.sndClndPos),i.normal.length()<1e-8&&i.setFromCoplanarPoints(t.p1,t.fstClndPos,t.sndClndPos.clone().add(new THREE.Vector3(1,-1,1))),e=this.clientCoordToModelCoordOnPlane(e.x,e.y,i))&&t.textPos.copy(e),null),n=("Lineargauge3D"==this.measureClass?t.fstClndPos.clone().add(t.sndClndPos):t.firstPoint.clone().add(t.secondPoint)).divideScalar(2),i=this.get2dPoint(t.textPos.clone()),e=this.get2dPoint(n.clone()),i=new THREE.Vector2(i.x-e.x,i.y-e.y);i.normalize(),i.y>=i.x/2&&i.y>=-i.x/2?(this.OpMeasure.unsteadyTextBox.childNodes[1].style.left="calc(50% - 6px)",this.OpMeasure.unsteadyTextBox.childNodes[1].style.top="-5.5px",this.OpMeasure.unsteadyTextBox.setAttribute("mobile","down")):i.y>i.x/2&&i.y<-i.x/2?(this.OpMeasure.unsteadyTextBox.childNodes[1].style.left="calc(100% - 4px)",this.OpMeasure.unsteadyTextBox.childNodes[1].style.top="calc(50% - 5.5px)",this.OpMeasure.unsteadyTextBox.setAttribute("mobile","right")):i.y-i.x/2&&(this.OpMeasure.unsteadyTextBox.childNodes[1].style.left="-5.5px",this.OpMeasure.unsteadyTextBox.childNodes[1].style.top="calc(50% - 5.5px)",this.OpMeasure.unsteadyTextBox.setAttribute("mobile","left"));for(var r=0;rve.INFOTYPE.MEASURENOTICEBEGIN&&(this.OpMeasure.InfoType=ve.INFOTYPE.MEASURENOTICEBEGIN),this.distanceInfo.preSelInfo=null,this.distanceInfo.preSelObj&&(this.OpMeasure.rootObject.remove(this.distanceInfo.preSelObj),this.distanceInfo.preSelObj=null),t)null==this.distanceInfo.firstSelInfo?(this.distanceInfo.firstSelInfo={type:"point",point:t},this.distanceInfo.firstPoint=this.distanceInfo.firstSelInfo.point):(this.distanceInfo.secondSelInfo={type:"point",point:t},this.distanceInfo.secondPoint=this.distanceInfo.secondSelInfo.point,this.calculateDistanceFromPoint(this.distanceInfo));else if(-1!=i.indexOf("point")&&-1==i.indexOf(e.type))a=e.intersect.clone(),null==this.distanceInfo.firstSelInfo?(this.distanceInfo.firstPoint=a,this.distanceInfo.firstSelInfo={type:"point",point:a}):(this.distanceInfo.secondSelInfo={type:"point",point:a},this.distanceInfo.secondPoint=this.distanceInfo.secondSelInfo.point,this.calculateDistanceFromPoint(this.distanceInfo));else if(this.distanceInfo.firstSelInfo){if(this.isTwoTopolInfoTheSame(this.distanceInfo.firstSelInfo,e))this.distanceInfo.firstSelObj&&(this.OpMeasure.rootObject.remove(this.distanceInfo.firstSelObj),this.distanceInfo.firstSelObj=null,this.distanceInfo.firstSelInfo=null),this.distanceInfo.axisLineObj&&(this.OpMeasure.rootObject.remove(this.distanceInfo.axisLineObj),this.distanceInfo.axisLineObj=null);else if(-1!=i.indexOf(e.type)||-1!=i.indexOf("point")){if("line"==this.distanceInfo.firstSelInfo.type){var s=this.getLineStartEndPoints(this.distanceInfo.firstSelInfo);if("line"==e.type){var l=this.getLineStartEndPoints(e);if(s&&l){(g=(new THREE.Vector3).subVectors(s.end,s.start)).normalize();(y=(new THREE.Vector3).subVectors(l.end,l.start)).normalize();var d=g.dot(y);if(1-Math.abs(d)<1e-4){if((M=(E=new THREE.Line3(s.start,s.end).closestPointToPoint(l.start,!1)).distanceTo(l.start))<1e-5)return void this.OpMeasure.PostInfo("bodyDistance"==this.measureType?ve.INFOTYPE.TWOBODYNOTPARALLEL:ve.INFOTYPE.INTERSECT);this.distanceInfo.dimString=M.toFixed(2),this.distanceInfo.secondSelInfo=e,this.distanceInfo.firstPoint=E,this.distanceInfo.secondPoint=l.start.clone()}else{var c=l.start.clone().sub(s.start),h=Math.pow(g.clone().cross(y).length(),2),u=c.clone().cross(y).dot(g.clone().cross(y))/h,p=c.clone().cross(g).dot(g.clone().cross(y))/h,f=g.clone().multiplyScalar(u).add(s.start),m=y.clone().multiplyScalar(p).add(l.start);if((M=f.distanceTo(m))<1e-5)return void this.OpMeasure.PostInfo("bodyDistance"==this.measureType?ve.INFOTYPE.TWOBODYNOTPARALLEL:ve.INFOTYPE.INTERSECT);this.distanceInfo.secondSelInfo=e,this.distanceInfo.dimString=M.toFixed(2),this.distanceInfo.firstPoint=f,this.distanceInfo.secondPoint=m}}}else"plane"==e.type?((g=(new THREE.Vector3).subVectors(s.end,s.start)).normalize(),Math.abs(e.worldNormal.dot(g))<1e-5?(this.distanceInfo.secondSelInfo=e,(v=new THREE.Plane).setFromNormalAndCoplanarPoint(e.worldNormal,e.worldOrigin),A=new THREE.Vector3,v.projectPoint(s.start,A),M=A.distanceTo(s.start),this.distanceInfo.dimString=M.toFixed(2),this.distanceInfo.firstPoint=s.start.clone(),this.distanceInfo.secondPoint=A):this.OpMeasure.PostInfo("bodyDistance"==this.measureType?ve.INFOTYPE.TWOBODYNOTPARALLEL:ve.INFOTYPE.PLANENOPARALLEL)):"circle"!=e.type&&"cylinder"!=e.type&&"cone"!=e.type||(l=this.getLineStartEndPoints(e),"bodyDistance"==this.measureType&&"circle"==e.type?s&&l&&(M=(E=new THREE.Line3(s.start,s.end).closestPointToPoint(l.start,!1)).distanceTo(l.start),this.distanceInfo.dimString=M.toFixed(2),this.distanceInfo.firstPoint=E,this.distanceInfo.secondPoint=l.start.clone(),this.distanceInfo.secondSelInfo=e):s&&l&&((g=(new THREE.Vector3).subVectors(s.end,s.start)).normalize(),(y=(new THREE.Vector3).subVectors(l.end,l.start)).normalize(),d=g.dot(y),1-Math.abs(d)<1e-4?(this.distanceInfo.secondSelInfo=e,M=(E=new THREE.Line3(s.start,s.end).closestPointToPoint(l.start,!1)).distanceTo(l.start),this.distanceInfo.dimString=M.toFixed(2),this.distanceInfo.firstPoint=E,this.distanceInfo.secondPoint=l.start.clone()):(c=l.start.clone().sub(s.start),h=Math.pow(g.clone().cross(y).length(),2),u=c.clone().cross(y).dot(g.clone().cross(y))/h,p=c.clone().cross(g).dot(g.clone().cross(y))/h,f=g.clone().multiplyScalar(u).add(s.start),m=y.clone().multiplyScalar(p).add(l.start),M=f.distanceTo(m),this.distanceInfo.secondSelInfo=e,this.distanceInfo.dimString=M.toFixed(2),this.distanceInfo.firstPoint=f,this.distanceInfo.secondPoint=m)))}else if("point"==this.distanceInfo.firstSelInfo.type||"bodyDistance"==this.measureType&&"circle"==this.distanceInfo.firstSelInfo.type)"bodyDistance"==this.measureType&&"circle"==this.distanceInfo.firstSelInfo.type?(s=this.getLineStartEndPoints(this.distanceInfo.firstSelInfo),this.distanceInfo.firstPoint=s.start.clone()):this.distanceInfo.firstPoint=this.distanceInfo.firstSelInfo.point,"line"==(this.distanceInfo.secondSelInfo=e).type?(s=this.getLineStartEndPoints(e))&&(M=(E=new THREE.Line3(s.start,s.end).closestPointToPoint(this.distanceInfo.firstPoint,!1)).distanceTo(this.distanceInfo.firstPoint),this.distanceInfo.dimString=M.toFixed(2),this.distanceInfo.secondPoint=E):"plane"==e.type?((v=new THREE.Plane).setFromNormalAndCoplanarPoint(e.worldNormal,e.worldOrigin),A=new THREE.Vector3,v.projectPoint(this.distanceInfo.firstPoint,A),M=A.distanceTo(this.distanceInfo.firstPoint),this.distanceInfo.dimString=M.toFixed(2),this.distanceInfo.secondPoint=A):"circle"!=e.type&&"cylinder"!=e.type&&"cone"!=e.type||("bodyDistance"==this.measureType&&"circle"==e.type?(s=this.getLineStartEndPoints(e))&&(M=s.start.distanceTo(this.distanceInfo.firstPoint),this.distanceInfo.dimString=M.toFixed(2),this.distanceInfo.secondPoint=s.start.clone()):(s=this.getLineStartEndPoints(e))&&(M=(E=new THREE.Line3(s.start,s.end).closestPointToPoint(this.distanceInfo.firstPoint,!1)).distanceTo(this.distanceInfo.firstPoint),this.distanceInfo.dimString=M.toFixed(2),this.distanceInfo.secondPoint=E));else if("plane"==this.distanceInfo.firstSelInfo.type)"line"==e.type?(s=this.getLineStartEndPoints(e))&&((g=(new THREE.Vector3).subVectors(s.end,s.start)).normalize(),Math.abs(this.distanceInfo.firstSelInfo.worldNormal.dot(g))<1e-5?((v=new THREE.Plane).setFromNormalAndCoplanarPoint(this.distanceInfo.firstSelInfo.worldNormal,this.distanceInfo.firstSelInfo.worldOrigin),A=new THREE.Vector3,v.projectPoint(s.start,A),M=A.distanceTo(s.start),this.distanceInfo.dimString=M.toFixed(2),this.distanceInfo.secondSelInfo=e,this.distanceInfo.firstPoint=A,this.distanceInfo.secondPoint=s.start.clone()):this.OpMeasure.PostInfo("bodyDistance"==this.measureType?ve.INFOTYPE.TWOBODYNOTPARALLEL:ve.INFOTYPE.LINENOPARALLEL)):"plane"==e.type?(o=this.distanceInfo.firstSelInfo.worldNormal,w=e.worldNormal.clone(),o.normalize(),w.normalize(),o=Math.abs(o.dot(w)),Math.abs(o-1)<1e-5?(this.distanceInfo.secondSelInfo=e,this.distanceInfo.firstPoint=this.distanceInfo.firstSelInfo.intersect,(v=new THREE.Plane).setFromNormalAndCoplanarPoint(e.worldNormal,e.worldOrigin),A=new THREE.Vector3,v.projectPoint(this.distanceInfo.firstPoint,A),M=A.distanceTo(this.distanceInfo.firstPoint),this.distanceInfo.dimString=M.toFixed(2),this.distanceInfo.secondPoint=A):this.OpMeasure.PostInfo("bodyDistance"==this.measureType?ve.INFOTYPE.TWOBODYNOTPARALLEL:ve.INFOTYPE.PLANENOPARALLEL)):"circle"!=e.type&&"cylinder"!=e.type&&"cone"!=e.type||(s=this.getLineStartEndPoints(e),"bodyDistance"==this.measureType&&"circle"==e.type?s&&((v=new THREE.Plane).setFromNormalAndCoplanarPoint(this.distanceInfo.firstSelInfo.worldNormal,this.distanceInfo.firstSelInfo.worldOrigin),A=new THREE.Vector3,v.projectPoint(s.start,A),M=A.distanceTo(s.start),this.distanceInfo.dimString=M.toFixed(2),this.distanceInfo.firstPoint=A,this.distanceInfo.secondPoint=s.start.clone(),this.distanceInfo.secondSelInfo=e):s&&((g=(new THREE.Vector3).subVectors(s.end,s.start)).normalize(),Math.abs(this.distanceInfo.firstSelInfo.worldNormal.dot(g))<1e-5?(this.distanceInfo.secondSelInfo=e,(v=new THREE.Plane).setFromNormalAndCoplanarPoint(this.distanceInfo.firstSelInfo.worldNormal,this.distanceInfo.firstSelInfo.worldOrigin),A=new THREE.Vector3,v.projectPoint(s.start,A),M=A.distanceTo(s.start),this.distanceInfo.dimString=M.toFixed(2),this.distanceInfo.firstPoint=A,this.distanceInfo.secondPoint=s.start.clone()):this.OpMeasure.PostInfo("bodyDistance"==this.measureType?ve.INFOTYPE.TWOBODYNOTPARALLEL:ve.INFOTYPE.AXISNOPARALLEL)));else if("circle"==this.distanceInfo.firstSelInfo.type||"cylinder"==this.distanceInfo.firstSelInfo.type||"cone"==this.distanceInfo.firstSelInfo.type){var g,v,A,s=this.getLineStartEndPoints(this.distanceInfo.firstSelInfo),l=this.getLineStartEndPoints(e);if("line"==e.type||"circle"==e.type||"cylinder"==e.type||"cone"==e.type){if("bodyDistance"==this.measureType&&"circle"==e.type)s&&l&&(M=(E=new THREE.Line3(s.start,s.end).closestPointToPoint(l.start,!1)).distanceTo(l.start),this.distanceInfo.dimString=M.toFixed(2),this.distanceInfo.secondSelInfo=e,this.distanceInfo.firstPoint=E,this.distanceInfo.secondPoint=l.start.clone());else if(s&&l){(g=(new THREE.Vector3).subVectors(s.end,s.start)).normalize();(y=(new THREE.Vector3).subVectors(l.end,l.start)).normalize();var y,d=g.dot(y);if(1-Math.abs(d)<1e-4){this.distanceInfo.secondSelInfo=e;var E,M=(E=new THREE.Line3(s.start,s.end).closestPointToPoint(l.start,!1)).distanceTo(l.start);this.distanceInfo.dimString=M.toFixed(2),this.distanceInfo.firstPoint=E,this.distanceInfo.secondPoint=l.start.clone()}else{if("bodyDistance"==this.measureType&&("line"==e.type||"cylinder"==e.type||"cone"==e.type)){c=l.start.clone().sub(s.start),h=Math.pow(g.clone().cross(y).length(),2),u=c.clone().cross(y).dot(g.clone().cross(y))/h,p=c.clone().cross(g).dot(g.clone().cross(y))/h,f=g.clone().multiplyScalar(u).add(s.start),m=y.clone().multiplyScalar(p).add(l.start);if((M=f.distanceTo(m))<1e-5)return void this.OpMeasure.PostInfo("bodyDistance"==this.measureType?ve.INFOTYPE.TWOBODYNOTPARALLEL:ve.INFOTYPE.INTERSECT);this.distanceInfo.secondSelInfo=e,this.distanceInfo.dimString=M.toFixed(2),this.distanceInfo.firstPoint=f,this.distanceInfo.secondPoint=m}if("circle"==e.type||"cylinder"==e.type||"cone"==e.type)return void this.OpMeasure.PostInfo("bodyDistance"==this.measureType?ve.INFOTYPE.TWOBODYNOTPARALLEL:ve.INFOTYPE.TWOAXISNOPARALLEL);c=l.start.clone().sub(s.start),h=Math.pow(g.clone().cross(y).length(),2),u=c.clone().cross(y).dot(g.clone().cross(y))/h,p=c.clone().cross(g).dot(g.clone().cross(y))/h,f=g.clone().multiplyScalar(u).add(s.start),m=y.clone().multiplyScalar(p).add(l.start);M=f.distanceTo(m),this.distanceInfo.secondSelInfo=e,this.distanceInfo.dimString=M.toFixed(2),this.distanceInfo.firstPoint=f,this.distanceInfo.secondPoint=m}}}else"plane"==e.type&&((g=(new THREE.Vector3).subVectors(s.end,s.start)).normalize(),Math.abs(e.worldNormal.dot(g))<1e-4?((v=new THREE.Plane).setFromNormalAndCoplanarPoint(e.worldNormal,e.worldOrigin),A=new THREE.Vector3,v.projectPoint(s.start,A),M=A.distanceTo(s.start),this.distanceInfo.dimString=M.toFixed(2),this.distanceInfo.secondSelInfo=e,this.distanceInfo.firstPoint=s.start.clone(),this.distanceInfo.secondPoint=A):this.OpMeasure.PostInfo("bodyDistance"==this.measureType?ve.INFOTYPE.TWOBODYNOTPARALLEL:ve.INFOTYPE.PLANENOPARALLEL))}var w=this.viewer.getDispalyModelUnit(M=M<1&&.999999s[0]&&l--,t.index),t=t.attributes.position.array;if(null!=d)return d=d.array,r=new THREE.Vector3,o=new THREE.Vector3,r.fromArray(t,3*d[2*s[0]]),o.fromArray(t,3*d[2*l]),s=(new THREE.Vector3).subVectors(r,i),t=(new THREE.Vector3).subVectors(o,i),a=(new THREE.Vector3).crossVectors(s,t),i.applyMatrix4(e.matrixWorld),a.applyQuaternion(n),a.normalize(),{center:i,axis:a}}return null},dn.prototype.measureRadiusAndDiameter=function(e,t,n){if(""==this.holeInfo.unit&&(this.holeInfo.unit=this.getUnitString()),this.holeInfo.firstSelHoleObj)this.holeInfo.preSelHoleObj&&(this.OpMeasure.rootObject.remove(this.holeInfo.preSelHoleObj),this.holeInfo.preSelHoleObj=null,this.holeInfo.preSelHoleInfo=null);else{var i=this.viewer,e=this.doRaycasterPick(e,t,!0);if(e&&0!=e.length){if(0=r.x/2&&r.y>=-r.x/2?(this.OpMeasure.unsteadyTextBox.childNodes[1].style.left="calc(50% - 6px)",this.OpMeasure.unsteadyTextBox.childNodes[1].style.top="-5.5px",this.OpMeasure.unsteadyTextBox.setAttribute("mobile","down")):r.y>r.x/2&&r.y<-r.x/2?(this.OpMeasure.unsteadyTextBox.childNodes[1].style.left="calc(100% - 4px)",this.OpMeasure.unsteadyTextBox.childNodes[1].style.top="calc(50% - 5.5px)",this.OpMeasure.unsteadyTextBox.setAttribute("mobile","right")):r.y-r.x/2&&(this.OpMeasure.unsteadyTextBox.childNodes[1].style.left="-5.5px",this.OpMeasure.unsteadyTextBox.childNodes[1].style.top="calc(50% - 5.5px)",this.OpMeasure.unsteadyTextBox.setAttribute("mobile","left")),this.OpMeasure.viewer.render()},(cn.prototype=Object.create(h.prototype)).OperatorStart=function(e){switch(this.measureType=e,this.measureType){case"bodyEdgeLength":this.OpMeasure.PostInfo(ve.INFOTYPE.MEASUREBODY);break;case"measureEdges":this.OpMeasure.PostInfo(ve.INFOTYPE.LINEANDCIRCLE)}},cn.prototype.onNMouseMove=function(e,t){var n=new THREE.Vector3(e,t,0);this.OpMeasure.unsteady?this.changeMeasureEdge(n):this.edgeInfo.selLineObj&&!Se.isMobileDevice()?this.createAndShowMeasureEdgesDimension(n):(this.measureEdges(e,t,!0),this.viewer.is2DModel?this.updateMeasureEdgesScene("true",n):this.update3DMeasureEdgesScene("true",n))},cn.prototype.onLMouseClick=function(e,t,n){var i=new THREE.Vector3(e,t,0);this.edgeInfo.selLineObj?this.viewer.is2DModel?(this.createAndShowMeasureEdgesDimension(i,!0),this.OpMeasure.PostInfo(ve.INFOTYPE.LINEANDCIRCLE)):this.createAndShow3DMeasureEdgesDimension(i,!0):(this.measureEdges(e,t,!1),this.viewer.is2DModel?(this.updateMeasureEdgesScene("false",i),this.edgeInfo.selLineObj&&this.OpMeasure.PostInfo(ve.INFOTYPE.ENDMEASURE)):this.update3DMeasureEdgesScene("false",i))},cn.prototype.createAndShowMeasureEdgesDimension=function(e,t){var n,i,r,o,a,s,l,d;"measureEdges"!=this.measureType&&"bodyEdgeLength"!=this.measureType||this.edgeInfo.selLineInfo&&this.edgeInfo.selLineObj&&(n=!1,(n=this.edgeInfo.thirdPos?!0:n)?((i=new THREE.Plane).setFromCoplanarPoints(this.edgeInfo.startPos,this.edgeInfo.midPos,this.edgeInfo.thirdPos),this.edgeInfo.textPos||(this.edgeInfo.textPos=this.edgeInfo.startPos.clone()),e&&((n=this.clientCoordToModelCoordOnPlane(e.x,e.y,i))&&(this.edgeInfo.textPos=n),this.edgeInfo.boxToClndLine&&this.OpMeasure.rootObject.remove(this.edgeInfo.boxToClndLine),this.edgeInfo.boxToClndLine=this.createLineMesh2(this.edgeInfo.startPos,this.edgeInfo.textPos,this.materialLine,1),this.OpMeasure.rootObject.add(this.edgeInfo.boxToClndLine))):(this.edgeInfo.fstClndPos||(this.edgeInfo.fstClndPos=this.edgeInfo.startPos.clone()),this.edgeInfo.sndClndPos||(this.edgeInfo.sndClndPos=this.edgeInfo.endPos.clone()),n=(new THREE.Vector3).subVectors(this.edgeInfo.endPos,this.edgeInfo.startPos),this.edgeInfo.fstClnd&&this.edgeInfo.sndClnd?e&&((i=new THREE.Plane).setFromCoplanarPoints(this.edgeInfo.startPos,this.edgeInfo.endPos,this.edgeInfo.fstClndPos),r=this.clientCoordToModelCoordOnPlane(e.x,e.y,i))&&(o=this.getProjectPntToLine(this.edgeInfo.startPos,this.edgeInfo.fstClndPos,r))&&(a=o.clone().sub(this.edgeInfo.startPos),this.edgeInfo.fstClndPos.addVectors(this.edgeInfo.startPos,a),this.edgeInfo.sndClndPos=this.edgeInfo.fstClndPos.clone().add(n)):"line"==this.edgeInfo.selLineInfo.type?(d=this.viewer.camera.getWorldDirection(),l=(new THREE.Vector3).crossVectors(n,d),l=this.getBaceFaceDir(l),s=(s=n.length())<1?.01:.5,l.normalize().multiplyScalar(s),this.edgeInfo.fstClndPos.add(l),this.edgeInfo.sndClndPos.add(l)):(a=(new THREE.Vector3).subVectors(this.edgeInfo.midPos,this.edgeInfo.startPos),1e-7<(a=(new THREE.Vector3).crossVectors(n,a)).lengthSq()?((a=(new THREE.Vector3).crossVectors(a,n)).normalize().multiplyScalar(.5),this.edgeInfo.fstClndPos.add(a),this.edgeInfo.sndClndPos.add(a)):(d=this.viewer.camera.getWorldDirection(),l=(new THREE.Vector3).crossVectors(n,d),(l=this.getBaceFaceDir(l)).normalize().multiplyScalar(.5),this.edgeInfo.fstClndPos.add(l),this.edgeInfo.sndClndPos.add(l))),this.edgeInfo.textPos?e&&((i=new THREE.Plane).setFromCoplanarPoints(this.edgeInfo.startPos,this.edgeInfo.endPos,this.edgeInfo.fstClndPos),r=this.clientCoordToModelCoordOnPlane(e.x,e.y,i))&&(o=this.getProjectPntToLine(this.edgeInfo.fstClndPos,this.edgeInfo.sndClndPos,r))&&this.edgeInfo.textPos.copy(o):this.edgeInfo.textPos=this.edgeInfo.sndClndPos.clone(),this.edgeInfo.startToClndLine&&this.OpMeasure.rootObject.remove(this.edgeInfo.startToClndLine),this.edgeInfo.startToClndLine=this.createLineMesh2(this.edgeInfo.startPos,this.edgeInfo.fstClndPos,this.materialLine,1),this.OpMeasure.rootObject.add(this.edgeInfo.startToClndLine),this.edgeInfo.endToClndLine&&this.OpMeasure.rootObject.remove(this.edgeInfo.endToClndLine),this.edgeInfo.endToClndLine=this.createLineMesh2(this.edgeInfo.endPos,this.edgeInfo.sndClndPos,this.materialLine,1),this.OpMeasure.rootObject.add(this.edgeInfo.endToClndLine),a=this.isPointBetweenIn(this.edgeInfo.textPos,this.edgeInfo.fstClndPos,this.edgeInfo.sndClndPos),this.edgeInfo.fstClnd&&this.OpMeasure.rootObject.remove(this.edgeInfo.fstClnd),n.normalize(),a?(this.edgeInfo.fstClnd=this.createCylinderMesh(this.edgeInfo.sndClndPos,this.edgeInfo.fstClndPos,this.materialLine),s=this.OpMeasure.getScale(this.edgeInfo.fstClnd,this.CYLINDERWIDTH),n.multiplyScalar(.5*this.edgeInfo.fstClnd.geometry.parameters.height),this.edgeInfo.fstClnd.oldPosition=this.edgeInfo.fstClndPos.clone(),this.edgeInfo.fstClnd.offsetPos=n.clone(),this.edgeInfo.fstClnd.position.addVectors(this.edgeInfo.fstClndPos,n.clone().multiplyScalar(s))):(this.edgeInfo.fstClnd=this.createCylinderMesh(this.edgeInfo.fstClndPos,this.edgeInfo.sndClndPos,this.materialLine),s=this.OpMeasure.getScale(this.edgeInfo.fstClnd,this.CYLINDERWIDTH),n.multiplyScalar(.5*this.edgeInfo.fstClnd.geometry.parameters.height),this.edgeInfo.fstClnd.oldPosition=this.edgeInfo.fstClndPos.clone(),this.edgeInfo.fstClnd.offsetPos=n.clone().multiplyScalar(-1),this.edgeInfo.fstClnd.position.subVectors(this.edgeInfo.fstClndPos,n.clone().multiplyScalar(s))),this.OpMeasure.rootObject.add(this.edgeInfo.fstClnd),this.edgeInfo.sndClnd&&this.OpMeasure.rootObject.remove(this.edgeInfo.sndClnd),a?(this.edgeInfo.sndClnd=this.createCylinderMesh(this.edgeInfo.fstClndPos,this.edgeInfo.sndClndPos,this.materialLine),this.edgeInfo.sndClnd.oldPosition=this.edgeInfo.sndClndPos.clone(),this.edgeInfo.sndClnd.offsetPos=n.clone().multiplyScalar(-1),this.edgeInfo.sndClnd.position.subVectors(this.edgeInfo.sndClndPos,n.clone().multiplyScalar(s))):(this.edgeInfo.sndClnd=this.createCylinderMesh(this.edgeInfo.sndClndPos,this.edgeInfo.fstClndPos,this.materialLine),this.edgeInfo.sndClnd.oldPosition=this.edgeInfo.sndClndPos.clone(),this.edgeInfo.sndClnd.offsetPos=n.clone(),this.edgeInfo.sndClnd.position.addVectors(this.edgeInfo.sndClndPos,n.clone().multiplyScalar(s))),this.OpMeasure.rootObject.add(this.edgeInfo.sndClnd),this.edgeInfo.clndToClndLine&&this.OpMeasure.rootObject.remove(this.edgeInfo.clndToClndLine),this.edgeInfo.clndToClndLine=this.createLineMesh2(this.edgeInfo.fstClndPos,this.edgeInfo.sndClndPos,this.materialLine,1),this.OpMeasure.rootObject.add(this.edgeInfo.clndToClndLine),this.edgeInfo.boxToClndLine&&this.OpMeasure.rootObject.remove(this.edgeInfo.boxToClndLine),this.edgeInfo.boxToClndLine=this.createLineMesh2(this.edgeInfo.fstClndPos,this.edgeInfo.textPos,this.materialLine,1),this.OpMeasure.rootObject.add(this.edgeInfo.boxToClndLine)),d="",d="⌒"==this.edgeInfo.dimString[0]?"⌒ "+(this.edgeInfo.dimString.slice(2)*this.viewer.measuringScale).toFixed(2)+this.edgeInfo.unit:(this.edgeInfo.dimString*this.viewer.measuringScale).toFixed(2)+this.edgeInfo.unit,this.edgeInfo.textBox||(this.edgeInfo.textBox=document.createElement("div"),this.edgeInfo.textBox.className="mearesult",this.viewer.container.appendChild(this.edgeInfo.textBox)),this.getAndShowTextBox(this.edgeInfo.textPos.clone(),d,this.edgeInfo.textBox),1==t)&&((l={}).dimString=d,l.textPos=this.edgeInfo.textPos.clone(),l.textBox=this.edgeInfo.textBox,l.textBox.setAttribute("type","length"),l.textBox.setAttribute("dimString",this.edgeInfo.dimString),l.textBox.setAttribute("dimStringPrefix",""),l.textBox.setAttribute("unit",this.edgeInfo.unit),this.OpMeasure.boxInfos.push(l),this.clearEdgeInfo(!0),Se.isMobileDevice()&&this.ChangeMeasureFlag(),_e.enableBroadcast)&&_e.broadcastMajor&&this.OpMeasure.addmeasureTimes()},cn.prototype.measureEdges=function(e,t,n){if(""==this.edgeInfo.unit&&(this.edgeInfo.unit=this.getUnitString()),this.edgeInfo.selLineObj)this.edgeInfo.preSelLineObj&&(this.OpMeasure.rootObject.remove(this.edgeInfo.preSelLineObj),this.edgeInfo.preSelLineObj=null,this.edgeInfo.preSelLineInfo=null);else{var i=this.viewer,e=this.doRaycasterPick(e,t,!0);if(e&&0!=e.length){if(0=e.x/2&&e.y>=-e.x/2?(this.OpMeasure.unsteadyTextBox.childNodes[1].style.left="calc(50% - 6px)",this.OpMeasure.unsteadyTextBox.childNodes[1].style.top="-5.5px",this.OpMeasure.unsteadyTextBox.setAttribute("mobile","down")):e.y>e.x/2&&e.y<-e.x/2?(this.OpMeasure.unsteadyTextBox.childNodes[1].style.left="calc(100% - 4px)",this.OpMeasure.unsteadyTextBox.childNodes[1].style.top="calc(50% - 5.5px)",this.OpMeasure.unsteadyTextBox.setAttribute("mobile","right")):e.y-e.x/2&&(this.OpMeasure.unsteadyTextBox.childNodes[1].style.left="-5.5px",this.OpMeasure.unsteadyTextBox.childNodes[1].style.top="calc(50% - 5.5px)",this.OpMeasure.unsteadyTextBox.setAttribute("mobile","left"));for(var s=0;sve.INFOTYPE.MEASURENOTICEBEGIN&&(this.OpMeasure.InfoType=ve.INFOTYPE.MEASURENOTICEBEGIN);var o,a,e=new THREE.Plane;if(this.lineAngleInfo.firstLineInfo.type==r.type)s=this.getLineStartEndPoints(this.lineAngleInfo.firstLineInfo),o=this.getLineStartEndPoints(r);else{"line"==this.lineAngleInfo.firstLineInfo.type?(s=this.getLineStartEndPoints(this.lineAngleInfo.firstLineInfo),(e=new THREE.Plane).setFromNormalAndCoplanarPoint(r.worldNormal,r.worldOrigin),a=r.intersect):"plane"==this.lineAngleInfo.firstLineInfo.type&&(s=this.getLineStartEndPoints(r),e.setFromNormalAndCoplanarPoint(this.lineAngleInfo.firstLineInfo.worldNormal,this.lineAngleInfo.firstLineInfo.worldOrigin),a=this.lineAngleInfo.firstLineInfo.intersect);var s,t=this.intersectLine(s.start,s.end,e);if(!t)return void("line"==r.type?this.OpMeasure.PostInfo("bodyAngle"==this.measureType?ve.INFOTYPE.TWOBODYPARALLEL:ve.INFOTYPE.LINEPARALLELPLANE):"plane"==r.type&&this.OpMeasure.PostInfo("bodyAngle"==this.measureType?ve.INFOTYPE.TWOBODYPARALLEL:ve.INFOTYPE.PLANEPARALLELLINE));var n=new THREE.Vector3,l=(e.projectPoint(s.start,n),new THREE.Vector3);e.projectPoint(s.end,l),o=n.distanceTo(l)<1e-5?{start:t,end:a}:n.distanceTo(t)<1e-4?{start:t,end:l}:{start:t,end:n}}s&&o&&((e=(new THREE.Vector3).subVectors(s.end,s.start)).normalize(),(a=(new THREE.Vector3).subVectors(o.end,o.start)).normalize(),l=e.dot(a),1-Math.abs(l)<1e-6?(this.lineAngleInfo.preSelLineInfo=null,this.lineAngleInfo.preSelLineObj&&(this.OpMeasure.rootObject.remove(this.lineAngleInfo.preSelLineObj),this.lineAngleInfo.preSelLineObj=null),this.OpMeasure.PostInfo("bodyAngle"==this.measureType?ve.INFOTYPE.TWOBODYPARALLEL:ve.INFOTYPE.LINEPARALLEL)):(this.lineAngleInfo.secondLineInfo=r,this.lineAngleInfo.firstLineInfo.start=s.start.clone(),this.lineAngleInfo.firstLineInfo.end=s.end.clone(),this.lineAngleInfo.secondLineInfo.start=o.start.clone(),this.lineAngleInfo.secondLineInfo.end=o.end.clone(),this.lineAngleInfo.preSelLineInfo=null,this.lineAngleInfo.preSelLineObj&&(this.OpMeasure.rootObject.remove(this.lineAngleInfo.preSelLineObj),this.lineAngleInfo.preSelLineObj=null)))}}else this.OpMeasure.PostInfo(ve.INFOTYPE.NOTFACE);else-1!=i.indexOf(r.type)||-1==i.indexOf("plane")||"cylinder"!==r.type&&"other"!==r.type?-1!=i.indexOf(r.type)&&(this.lineAngleInfo.firstLineInfo=r,this.OpMeasure.InfoType>ve.INFOTYPE.MEASURENOTICEBEGIN)&&(this.OpMeasure.InfoType=ve.INFOTYPE.MEASURENOTICEBEGIN):this.OpMeasure.PostInfo(ve.INFOTYPE.NOTFACE);else this.lineAngleInfo.preSelLineObj&&(this.OpMeasure.rootObject.remove(this.lineAngleInfo.preSelLineObj),this.lineAngleInfo.preSelLineObj=null,this.lineAngleInfo.preSelLineInfo=null)}}else this.lineAngleInfo.preSelLineObj&&(this.OpMeasure.rootObject.remove(this.lineAngleInfo.preSelLineObj),this.lineAngleInfo.preSelLineObj=null,this.lineAngleInfo.preSelLineInfo=null)}},r.prototype.updateLineAngleScene=function(e){var t;"LineAngle"!==this.measureType&&"LineFaceAngle"!==this.measureType&&"angle"!==this.measureType||(this.lineAngleInfo.firstLineObj&&this.lineAngleInfo.secondLineObj?this.lineAngleInfo.preSelLineObj&&(this.OpMeasure.rootObject.remove(this.lineAngleInfo.preSelLineObj),this.lineAngleInfo.preSelLineObj=null,this.lineAngleInfo.preSelLineInfo=null):!(!e||"true"!==e.toLowerCase())?this.lineAngleInfo.preSelLineInfo&&!this.lineAngleInfo.preSelLineObj&&("line"==this.lineAngleInfo.preSelLineInfo.type&&(t=this.createLine(this.lineAngleInfo.preSelLineInfo,!0)),t="plane"==this.lineAngleInfo.preSelLineInfo.type?this.createFace(this.lineAngleInfo.preSelLineInfo,!0):t)&&(this.OpMeasure.rootObject.add(t),this.lineAngleInfo.preSelLineObj=t):(this.lineAngleInfo.firstLineInfo&&!this.lineAngleInfo.firstLineObj&&("line"==this.lineAngleInfo.firstLineInfo.type&&(t=this.createLine(this.lineAngleInfo.firstLineInfo,!1)),"plane"==this.lineAngleInfo.firstLineInfo.type&&(t=this.createFace(this.lineAngleInfo.firstLineInfo,!1)),t="helpline"==this.lineAngleInfo.firstLineInfo.type?this.createLineMesh2(this.lineAngleInfo.firstLineInfo.start,this.lineAngleInfo.firstLineInfo.end,this.materialLine,1):t)&&(this.OpMeasure.rootObject.add(t),this.lineAngleInfo.firstLineObj=t),this.lineAngleInfo.secondLineInfo&&!this.lineAngleInfo.secondLineObj&&("line"==this.lineAngleInfo.secondLineInfo.type&&(t=this.createLine(this.lineAngleInfo.secondLineInfo,!1)),"plane"==this.lineAngleInfo.secondLineInfo.type&&(t=this.createFace(this.lineAngleInfo.secondLineInfo,!1)),t="helpline"==this.lineAngleInfo.secondLineInfo.type?this.createLineMesh2(this.lineAngleInfo.secondLineInfo.start,this.lineAngleInfo.secondLineInfo.end,this.materialLine,1):t)&&(this.OpMeasure.rootObject.add(t),this.lineAngleInfo.secondLineObj=t),this.lineAngleInfo.firstHelpPointInfo&&!this.lineAngleInfo.firstHelpPointobj&&(t=this.createPointMesh(this.lineAngleInfo.firstHelpPointInfo.point,this.materialPoint,this.POINTSIZE))&&(this.OpMeasure.rootObject.add(t),this.lineAngleInfo.firstHelpPointobj=t),this.lineAngleInfo.secHelpPointInfo&&!this.lineAngleInfo.secHelpPointobj&&(t=this.createPointMesh(this.lineAngleInfo.secHelpPointInfo.point,this.materialPoint,this.POINTSIZE))&&(this.OpMeasure.rootObject.add(t),this.lineAngleInfo.secHelpPointobj=t),this.lineAngleInfo.thrHelpPointInfo&&!this.lineAngleInfo.thrHelpPointobj&&(this.lineAngleInfo.secHelpPointobj&&(this.OpMeasure.rootObject.remove(this.lineAngleInfo.secHelpPointobj),this.lineAngleInfo.secHelpPointInfo=null),this.lineAngleInfo.firstHelpPointobj)&&(this.OpMeasure.rootObject.remove(this.lineAngleInfo.firstHelpPointobj),this.lineAngleInfo.firstHelpPointInfo=null)))},r.prototype.measurefaceAngle=function(e,t,n){if(""==this.lineAngleInfo.unit&&(this.lineAngleInfo.unit="°"),this.faceInfo.fstSelFaceObj&&this.faceInfo.sndSelFaceObj)this.faceInfo.preSelFaceObj&&(this.OpMeasure.rootObject.remove(this.faceInfo.preSelFaceObj),this.faceInfo.preSelFaceObj=null,this.faceInfo.preSelFaceInfo=null);else{this.viewer;var i=this.doRaycasterPick(e,t,!1);if(i){for(var r=0;rve.INFOTYPE.MEASURENOTICEBEGIN&&(this.OpMeasure.InfoType=ve.INFOTYPE.MEASURENOTICEBEGIN),this.faceInfo.firstFaceInfo)if(this.isTwoTopolInfoTheSame(this.faceInfo.firstFaceInfo,o))this.faceInfo.fstSelFaceObj&&(this.OpMeasure.rootObject.remove(this.faceInfo.fstSelFaceObj),this.faceInfo.fstSelFaceObj=null,this.faceInfo.firstFaceInfo=null);else{var a=this.faceInfo.firstFaceInfo.worldNormal.clone(),s=o.worldNormal.clone(),l=(a.normalize(),s.normalize(),a.dot(s)),a=null,s=null;if(Math.abs(Math.abs(l)-1)<1e-5)return this.OpMeasure.PostInfo("bodyAngle"==this.measureType?ve.INFOTYPE.TWOBODYPARALLEL:ve.INFOTYPE.PLANEPARALLEL),this.faceInfo.preSelFaceInfo=null,void(this.faceInfo.preSelFaceObj&&(this.OpMeasure.rootObject.remove(this.faceInfo.preSelFaceObj),this.faceInfo.preSelFaceObj=null));this.faceInfo.secondFaceInfo=o,this.faceInfo.sndIntersect=o.intersect,this.faceInfo.preSelFaceInfo=null,this.faceInfo.preSelFaceObj&&(this.OpMeasure.rootObject.remove(this.faceInfo.preSelFaceObj),this.faceInfo.preSelFaceObj=null)}else this.faceInfo.firstFaceInfo=o,this.faceInfo.fstIntersect=o.intersect,this.faceInfo.preSelFaceInfo=null,this.faceInfo.preSelFaceObj&&(this.OpMeasure.rootObject.remove(this.faceInfo.preSelFaceObj),this.faceInfo.preSelFaceObj=null);return}r++}1==n&&this.faceInfo.preSelFaceInfo&&(this.faceInfo.preSelFaceInfo=null,this.faceInfo.preSelFaceObj)&&(this.OpMeasure.rootObject.remove(this.faceInfo.preSelFaceObj),this.faceInfo.preSelFaceObj=null)}else this.faceInfo.preSelFaceObj&&(this.OpMeasure.rootObject.remove(this.faceInfo.preSelFaceObj),this.faceInfo.preSelFaceObj=null,this.faceInfo.preSelFaceInfo=null),this.viewer.outlinePass&&this.viewer.outlinePass.enabled&&(this.viewer.outlinePass.tempSelectedObjects.length=0)}},r.prototype.updateFaceAngleScene=function(e){var t,n,i,r,o;"faceAngle"===this.measureType&&(this.faceInfo.fstSelFaceObj&&this.faceInfo.sndSelFaceObj?this.faceInfo.preSelFaceObj&&(this.OpMeasure.rootObject.remove(this.faceInfo.preSelFaceObj),this.faceInfo.preSelFaceObj=null,this.faceInfo.preSelFaceInfo=null):(!(!e||"true"!==e.toLowerCase())?this.faceInfo.preSelFaceInfo&&!this.faceInfo.preSelFaceObj&&(t=this.createFace(this.faceInfo.preSelFaceInfo,!0))&&((e=[]).push(t),this.viewer.outlinePass&&this.viewer.outlinePass.enabled&&(this.viewer.outlinePass.tempSelectedObjects=e),this.OpMeasure.rootObject.add(t),this.faceInfo.preSelFaceObj=t):(this.faceInfo.firstFaceInfo&&!this.faceInfo.fstSelFaceObj&&(t=this.createFace(this.faceInfo.firstFaceInfo,!1))&&(this.OpMeasure.rootObject.add(t),this.faceInfo.fstSelFaceObj=t),this.faceInfo.secondFaceInfo&&!this.faceInfo.sndSelFaceObj&&(t=this.createFace(this.faceInfo.secondFaceInfo,!1))&&(this.OpMeasure.rootObject.add(t),this.faceInfo.sndSelFaceObj=t)),this.faceInfo.fstIntersect&&this.faceInfo.sndIntersect&&(e=this.faceInfo.fstIntersect,t=this.faceInfo.sndIntersect,this.lineAngleInfo.firstLineInfo=this.faceInfo.firstFaceInfo,this.lineAngleInfo.secondLineInfo=this.faceInfo.secondFaceInfo,n=this.faceInfo.firstFaceInfo.worldNormal.clone(),i=this.faceInfo.secondFaceInfo.worldNormal.clone(),n.normalize(),i.normalize(),r=new THREE.Vector3,o=new THREE.Vector3,this.getIntersectLineOfTwoPlane(e,n,t,i,r,o),this.lineAngleInfo.firstLineInfo.start=e.clone(),this.lineAngleInfo.firstLineInfo.end=r.clone(),this.getIntersectLineOfTwoPlane(t,i,e,n,r,o),this.lineAngleInfo.secondLineInfo.start=t.clone(),this.lineAngleInfo.secondLineInfo.end=r.clone())))},r.prototype.measureBodyAngle=function(e,t,n,i){if(""==this.lineAngleInfo.unit&&(this.lineAngleInfo.unit="°"),""==this.faceInfo.unit&&(this.faceInfo.unit="°"),this.lineAngleInfo.firstLineObj&&this.lineAngleInfo.secondLineObj)this.lineAngleInfo.preSelLineObj&&(this.OpMeasure.rootObject.remove(this.lineAngleInfo.preSelLineObj),this.lineAngleInfo.preSelLineObj=null,this.lineAngleInfo.preSelLineInfo=null);else{var r=this.viewer,e=this.doRaycasterPick(e,t,!0);if(e&&0!=e.length){t=null;if(t=r.ndsModel||e[0].object instanceof THREE.Line||e[0].object instanceof THREE.LineSegments?e[0]:t){r=this.getSelectInfoFromIntersect(t);if(r)if("bodyAngle"==this.measureType&&-1==i.indexOf(r.type))this.lineAngleInfo.preSelLineInfo=null,this.lineAngleInfo.preSelLineObj&&(this.OpMeasure.rootObject.remove(this.lineAngleInfo.preSelLineObj),this.lineAngleInfo.preSelLineObj=null);else if("line"!=r.type||this.Bline(r))if(1==n)this.isTwoTopolInfoTheSame(this.lineAngleInfo.preSelLineInfo,r)||-1!=i.indexOf(r.type)&&(this.lineAngleInfo.preSelLineInfo=r,this.lineAngleInfo.preSelLineObj)&&(this.OpMeasure.rootObject.remove(this.lineAngleInfo.preSelLineObj),this.lineAngleInfo.preSelLineObj=null);else if(this.lineAngleInfo.preSelLineInfo=null,this.lineAngleInfo.preSelLineObj&&(this.OpMeasure.rootObject.remove(this.lineAngleInfo.preSelLineObj),this.lineAngleInfo.preSelLineObj=null),this.lineAngleInfo.firstLineInfo){if(this.isTwoTopolInfoTheSame(this.lineAngleInfo.firstLineInfo,r))this.lineAngleInfo.firstLineObj&&(this.OpMeasure.rootObject.remove(this.lineAngleInfo.firstLineObj),this.lineAngleInfo.firstLineObj=null,this.lineAngleInfo.firstLineInfo=null);else if(-1==i.indexOf(r.type)&&-1!=i.indexOf("plane")&&"other"===r.type)this.OpMeasure.PostInfo(ve.INFOTYPE.NOTFACE);else if(-1!=i.indexOf(r.type)){this.OpMeasure.InfoType>ve.INFOTYPE.MEASURENOTICEBEGIN&&(this.OpMeasure.InfoType=ve.INFOTYPE.MEASURENOTICEBEGIN);var o,e=new THREE.Plane;if("line"!=this.lineAngleInfo.firstLineInfo.type&&"cylinder"!=this.lineAngleInfo.firstLineInfo.type&&"cone"!=this.lineAngleInfo.firstLineInfo.type||"line"!=r.type&&"cylinder"!=r.type&&"cone"!=r.type){if("plane"==this.lineAngleInfo.firstLineInfo.type&&"plane"==r.type)return this.lineAngleInfo.twoPlane=!0,t=this.lineAngleInfo.firstLineInfo.worldNormal.clone(),n=r.worldNormal.clone(),t.normalize(),n.normalize(),t=t.dot(n),Math.abs(Math.abs(t)-1)<1e-5?(this.OpMeasure.PostInfo(ve.INFOTYPE.TWOBODYPARALLEL),void(this.lineAngleInfo.twoPlane=!1)):(this.faceInfo.firstFaceInfo=this.lineAngleInfo.firstLineInfo,this.faceInfo.fstIntersect=this.lineAngleInfo.firstLineInfo.intersect,this.faceInfo.secondFaceInfo=r,this.faceInfo.sndIntersect=r.intersect,void(this.lineAngleInfo.secondLineInfo=r));"line"!=this.lineAngleInfo.firstLineInfo.type&&"cylinder"!=this.lineAngleInfo.firstLineInfo.type&&"cone"!=this.lineAngleInfo.firstLineInfo.type||"plane"!=r.type?"plane"!=this.lineAngleInfo.firstLineInfo.type||"line"!=r.type&&"cylinder"!=r.type&&"cone"!=r.type||(a=this.getLineStartEndPoints(r),e.setFromNormalAndCoplanarPoint(this.lineAngleInfo.firstLineInfo.worldNormal,this.lineAngleInfo.firstLineInfo.worldOrigin),o=this.lineAngleInfo.firstLineInfo.intersect):(a=this.getLineStartEndPoints(this.lineAngleInfo.firstLineInfo),(e=new THREE.Plane).setFromNormalAndCoplanarPoint(r.worldNormal,r.worldOrigin),o=r.intersect);var a,n=this.intersectLine(a.start,a.end,e);if(!n)return void("line"==r.type||"cylinder"==r.type||"cone"==r.type?this.OpMeasure.PostInfo("bodyAngle"==this.measureType?ve.INFOTYPE.TWOBODYPARALLEL:ve.INFOTYPE.LINEPARALLELPLANE):"plane"==r.type&&this.OpMeasure.PostInfo("bodyAngle"==this.measureType?ve.INFOTYPE.TWOBODYPARALLEL:ve.INFOTYPE.PLANEPARALLELLINE));var t=new THREE.Vector3,s=(e.projectPoint(a.start,t),new THREE.Vector3);e.projectPoint(a.end,s),o=t.distanceTo(s)<1e-5?{start:n,end:o}:t.distanceTo(n)<1e-4?{start:n,end:s}:{start:n,end:t}}else a=this.getLineStartEndPoints(this.lineAngleInfo.firstLineInfo),o=this.getLineStartEndPoints(r);a&&o&&((e=(new THREE.Vector3).subVectors(a.end,a.start)).normalize(),(s=(new THREE.Vector3).subVectors(o.end,o.start)).normalize(),n=e.dot(s),1-Math.abs(n)<1e-6?(this.lineAngleInfo.preSelLineInfo=null,this.lineAngleInfo.preSelLineObj&&(this.OpMeasure.rootObject.remove(this.lineAngleInfo.preSelLineObj),this.lineAngleInfo.preSelLineObj=null),"line"==this.lineAngleInfo.firstLineInfo.type&&"line"==r.type||"line"==this.lineAngleInfo.firstLineInfo.type&&"line"==r.type||"cylinder"!=this.lineAngleInfo.firstLineInfo.type&&"cone"!=this.lineAngleInfo.firstLineInfo.type||"cylinder"!=r.type&&"cone"!=r.type?this.OpMeasure.PostInfo("bodyAngle"==this.measureType?ve.INFOTYPE.TWOBODYPARALLEL:ve.INFOTYPE.LINEPARALLEL):this.OpMeasure.PostInfo("bodyAngle"==this.measureType?ve.INFOTYPE.TWOBODYPARALLEL:ve.INFOTYPE.AXISNOPARALLEL)):(this.lineAngleInfo.secondLineInfo=r,this.lineAngleInfo.firstLineInfo.start=a.start.clone(),this.lineAngleInfo.firstLineInfo.end=a.end.clone(),this.lineAngleInfo.secondLineInfo.start=o.start.clone(),this.lineAngleInfo.secondLineInfo.end=o.end.clone(),this.lineAngleInfo.preSelLineInfo=null,this.lineAngleInfo.preSelLineObj&&(this.OpMeasure.rootObject.remove(this.lineAngleInfo.preSelLineObj),this.lineAngleInfo.preSelLineObj=null)))}}else-1==i.indexOf(r.type)&&-1!=i.indexOf("plane")&&"other"===r.type?this.OpMeasure.PostInfo(ve.INFOTYPE.NOTFACE):-1!=i.indexOf(r.type)&&(this.lineAngleInfo.firstLineInfo=r,this.OpMeasure.InfoType>ve.INFOTYPE.MEASURENOTICEBEGIN)&&(this.OpMeasure.InfoType=ve.INFOTYPE.MEASURENOTICEBEGIN);else this.lineAngleInfo.preSelLineObj&&(this.OpMeasure.rootObject.remove(this.lineAngleInfo.preSelLineObj),this.lineAngleInfo.preSelLineObj=null,this.lineAngleInfo.preSelLineInfo=null)}}else this.lineAngleInfo.preSelLineObj&&(this.OpMeasure.rootObject.remove(this.lineAngleInfo.preSelLineObj),this.lineAngleInfo.preSelLineObj=null,this.lineAngleInfo.preSelLineInfo=null)}},r.prototype.updateBodyAngleScene=function(e){var t,n,i,r,o;"bodyAngle"===this.measureType&&(this.lineAngleInfo.firstLineObj&&this.lineAngleInfo.secondLineObj?this.lineAngleInfo.preSelLineObj&&(this.OpMeasure.rootObject.remove(this.lineAngleInfo.preSelLineObj),this.lineAngleInfo.preSelLineObj=null,this.lineAngleInfo.preSelLineInfo=null):(!(!e||"true"!==e.toLowerCase())?this.lineAngleInfo.preSelLineInfo&&!this.lineAngleInfo.preSelLineObj&&("line"==this.lineAngleInfo.preSelLineInfo.type&&(t=this.createLine(this.lineAngleInfo.preSelLineInfo,!0)),"plane"==this.lineAngleInfo.preSelLineInfo.type&&(t=this.createFace(this.lineAngleInfo.preSelLineInfo,!0)),"cylinder"==this.lineAngleInfo.preSelLineInfo.type&&(t=this.createFace(this.lineAngleInfo.preSelLineInfo,!0)),t="cone"==this.lineAngleInfo.preSelLineInfo.type?this.createFace(this.lineAngleInfo.preSelLineInfo,!0):t)&&(this.OpMeasure.rootObject.add(t),this.lineAngleInfo.preSelLineObj=t):(this.lineAngleInfo.firstLineInfo&&!this.lineAngleInfo.firstLineObj&&("line"==this.lineAngleInfo.firstLineInfo.type&&(t=this.createLine(this.lineAngleInfo.firstLineInfo,!1)),"plane"==this.lineAngleInfo.firstLineInfo.type&&(t=this.createFace(this.lineAngleInfo.firstLineInfo,!1)),"cylinder"==this.lineAngleInfo.firstLineInfo.type&&(t=this.createFace(this.lineAngleInfo.firstLineInfo,!0)),t="cone"==this.lineAngleInfo.firstLineInfo.type?this.createFace(this.lineAngleInfo.firstLineInfo,!0):t)&&(this.OpMeasure.rootObject.add(t),this.lineAngleInfo.firstLineObj=t),this.lineAngleInfo.secondLineInfo&&!this.lineAngleInfo.secondLineObj&&("line"==this.lineAngleInfo.secondLineInfo.type&&(t=this.createLine(this.lineAngleInfo.secondLineInfo,!1)),"plane"==this.lineAngleInfo.secondLineInfo.type&&(t=this.createFace(this.lineAngleInfo.secondLineInfo,!1),this.faceInfo.fstSelFaceObj=this.lineAngleInfo.firstLineObj,this.faceInfo.sndSelFaceObj=t),"cylinder"==this.lineAngleInfo.secondLineInfo.type&&(t=this.createFace(this.lineAngleInfo.secondLineInfo,!0)),t="cone"==this.lineAngleInfo.secondLineInfo.type?this.createFace(this.lineAngleInfo.secondLineInfo,!0):t)&&(this.OpMeasure.rootObject.add(t),this.lineAngleInfo.secondLineObj=t)),this.faceInfo.fstIntersect&&this.faceInfo.sndIntersect&&(e=this.faceInfo.fstIntersect,t=this.faceInfo.sndIntersect,this.lineAngleInfo.firstLineInfo=this.faceInfo.firstFaceInfo,this.lineAngleInfo.secondLineInfo=this.faceInfo.secondFaceInfo,n=this.faceInfo.firstFaceInfo.worldNormal.clone(),i=this.faceInfo.secondFaceInfo.worldNormal.clone(),n.normalize(),i.normalize(),r=new THREE.Vector3,o=new THREE.Vector3,this.getIntersectLineOfTwoPlane(e,n,t,i,r,o),this.lineAngleInfo.firstLineInfo.start=e.clone(),this.lineAngleInfo.firstLineInfo.end=r.clone(),this.getIntersectLineOfTwoPlane(t,i,e,n,r,o),this.lineAngleInfo.secondLineInfo.start=t.clone(),this.lineAngleInfo.secondLineInfo.end=r.clone())))},(un.prototype=Object.create(h.prototype)).OperatorStart=function(e){switch(this.measureType=e,this.measureType){case"TotalArea":var t=this.viewer.getObjectProperty(this.viewer.ndsModel.rootBodyNode);this.viewer.dispatchAsyncEvent({type:"BodyTotalAreaEvent",totalArea:t.area,modelUnit:t.unit});break;case"TotalVolume":t=this.viewer.getObjectProperty(this.viewer.ndsModel.rootBodyNode);this.viewer.dispatchAsyncEvent({type:"BodyTotalVolumeEvent",totalVolume:t.volume,modelUnit:t.unit});break;case"BoundingBox":this.measureBoundingBox(!0),_e.enableBroadcast&&_e.broadcastMajor&&this.viewer.dispatchEvent({type:"broadcastEvent"});break;case"BodyArea":case"BodyVolume":this.OpMeasure.PostInfo(ve.INFOTYPE.BODY);break;case"bodyBoundingBox":Se.isMobileDevice()||this.OpMeasure.PostInfo(ve.INFOTYPE.BODY)}},un.prototype.onNMouseMove=function(e,t){switch(this.measureType){case"BodyArea":case"BodyVolume":case"bodyBoundingBox":this.measureBodyVolumeAndAreaPre(e,t,this.measureType)}},un.prototype.onLMouseClick=function(e,t,n){switch(this.ClearmeasureBodyVolumeAndAreaPre(),this.measureType){case"BodyArea":this.measureBodyVolumeAndArea(e,t,"FaceMeasure",n);break;case"BodyVolume":this.measureBodyVolumeAndArea(e,t,"VolumeMeasure",n);break;case"bodyBoundingBox":this.measureBodyBoundingBox(e,t)}},un.prototype.measureBodyVolumeAndAreaPre=function(e,t,n){var i=this.getIntersectsByPriorityOfLine(e,t),e=!1;if(this.preSelectBodyMat&&this.preSelectBody?(this.preSelectBody.setUserMaterial(this.preSelectBodyMat),e=!0,this.preSelectBodyMat=null):this.preSelectBody&&(this.preSelectBody.setUserMaterial(null),e=!0),i&&0Y:"+parseFloat(this.snappedPoint.y.toFixed(4).toString()),i=this.snappedPoint.clone(),this.getAndShowTextBox(i.clone(),n,this.coordinatediv),this.coordinatedivtextPos=i,this.coordinatedivdims=n):(r=(s=this.viewer).renderer.domElement,o=s.renderer.getPixelRatio(),a=new THREE.Raycaster,s.camera.setCastRay(a,(e+l)*o/r.width*2-1,2*-((t+l)*o/r.height)+1),s=new THREE.Plane(new THREE.Vector3(0,0,-1),0),e=new THREE.Vector3,a.ray.intersectPlane(s,e),e&&(n="X:"+parseFloat(e.x.toFixed(4).toString())+"
Y:"+parseFloat(e.y.toFixed(4).toString()),i=e.clone(),this.getAndShowTextBox(i.clone(),n,this.coordinatediv),this.coordinatedivtextPos=i,this.coordinatedivdims=n))},pn.prototype.onLMouseClick=function(e,t,n){var i,r,o,a,s,l,d=document.createElement("div"),c=(d.className="mearesult",this.viewer.container.appendChild(d),48),h=(Se.isMobileDevice()&&this.viewer.is2DModel&&(c=0),new THREE.Vector3),t=(this.snappedPoint?(i="X:"+parseFloat(this.snappedPoint.x.toFixed(4).toString())+"
Y:"+parseFloat(this.snappedPoint.y.toFixed(4).toString()),r=this.snappedPoint.clone(),this.getAndShowTextBox(r.clone(),i,d),h.copy(this.snappedPoint),this.snappedPoint=null):(o=(l=this.viewer).renderer.domElement,a=l.renderer.getPixelRatio(),s=new THREE.Raycaster,l.camera.setCastRay(s,(e+c)*a/o.width*2-1,2*-((t+c)*a/o.height)+1),l=new THREE.Plane(new THREE.Vector3(0,0,-1),0),s.ray.intersectPlane(l,h),h&&(i="X:"+parseFloat(h.x.toFixed(4).toString())+"
Y:"+parseFloat(h.y.toFixed(4).toString()),r=h.clone(),this.getAndShowTextBox(r.clone(),i,d))),h&&(e=this.createPointMesh(h,this.materialPoint,10*this.POINTSIZE))&&this.OpMeasure.rootObject.add(e),{});t.dimString=i,t.textPos=r,t.textBox=d,t.textBox.setAttribute("type","coordinate"),t.textBox.setAttribute("dimString",i),this.OpMeasure.boxInfos.push(t),Se.isMobileDevice()&&this.ChangeMeasureFlag(),_e.enableBroadcast&&_e.broadcastMajor&&this.OpMeasure.addmeasureTimes()};function yn(){this.start=new THREE.Vector2,this.end=new THREE.Vector2,this.p1=-1,this.p2=-1}function En(){this.edgeIndex=-1,this.Pos=-1}function Mn(){this.dimString="",this.textBox=null,this.textPos=null,this.lineobj=null,this.start=new THREE.Vector2,this.end=new THREE.Vector2,this.lineInfo=null,this.LineSegments=[],this.intersectMouse=null,this.intersectPos=[]}(fn.prototype=Object.create(h.prototype)).OperatorStart=function(e){var t,n,i,r;this.measureType=e,Se.isMobileDevice()&&this.viewer.is2DModel&&(t=this,Se.getLanguage(),this.lineargaugediv||(this.lineargaugediv=document.createElement("div"),this.lineargaugediv.className="tc-box ts-tc",(e=document.createElement("p")).innerHTML=Se.translateString("MEASURE_SELECTDIR"),(n=document.createElement("div")).className="ts-tcCnt",n.appendChild(e),(e=document.createElement("span")).innerHTML=Se.translateString("MEASURE_Horizontal"),e.onclick=function(){t.distanceInfo.XorY=0,t.lineargaugediv.style.display="none",t.shadowdiv.style.display="none",t.ShowLineargaugeDimension(null,!0,t.distanceInfo.XorY),t.OpMeasure.PostInfo(ve.INFOTYPE.FIRSTPOINT),_e.enableBroadcast&&_e.broadcastMajor&&t.viewer.dispatchEvent({type:"broadcastEvent"})},(i=document.createElement("span")).innerHTML=Se.translateString("MEASURE_Vertical"),i.onclick=function(){t.distanceInfo.XorY=1,t.lineargaugediv.style.display="none",t.shadowdiv.style.display="none",t.ShowLineargaugeDimension(null,!0,t.distanceInfo.XorY),t.OpMeasure.PostInfo(ve.INFOTYPE.FIRSTPOINT),_e.enableBroadcast&&_e.broadcastMajor&&t.viewer.dispatchEvent({type:"broadcastEvent"})},(r=document.createElement("div")).className="clearfix ts-tcBtn ts-tcBtn02",r.appendChild(e),r.appendChild(i),this.lineargaugediv.appendChild(n),this.lineargaugediv.appendChild(r),this.lineargaugediv.style.display="none",this.lineargaugediv.style.zIndex=10,this.viewer.container.appendChild(this.lineargaugediv),this.shadowdiv=document.createElement("div"),this.shadowdiv.className="shadowvtc",this.shadowdiv.style.display="none",this.viewer.container.appendChild(this.shadowdiv))),this.OpMeasure.PostInfo(ve.INFOTYPE.FIRSTPOINT)},fn.prototype.onNMouseMove=function(e,t){var n,i,r,o,a,s=new THREE.Vector3(e,t,0);this.distanceInfo.firstSelObj&&this.distanceInfo.secondSelObj&&!Se.isMobileDevice()?(n=this.distanceInfo.firstPoint.clone(),i=this.distanceInfo.secondPoint.clone(),s&&(r=new THREE.Plane(new THREE.Vector3(0,0,-1),0),r=this.clientCoordToModelCoordOnPlane(s.x,s.y,r))&&(this.distanceInfo.mousePos||(this.distanceInfo.mousePos=r.clone()),a=o=!1,(o=this.distanceInfo.mousePos.yMath.min(n.y,i.y)&&this.distanceInfo.mousePos.xMath.min(n.x,i.x)?!0:o)!=(a=r.yMath.min(n.y,i.y)&&r.xMath.min(n.x,i.x)?!0:a)&&(n.yMath.min(this.distanceInfo.mousePos.y,r.y)||i.yMath.min(this.distanceInfo.mousePos.y,r.y)?this.distanceInfo.XorY=0:(n.xMath.min(this.distanceInfo.mousePos.x,r.x)||i.xMath.min(this.distanceInfo.mousePos.x,r.x))&&(this.distanceInfo.XorY=1)),this.distanceInfo.mousePos.set(r.x,r.y,0)),this.ShowLineargaugeDimension(s,!1,this.distanceInfo.XorY)):this.previewSnappedPoint(e,t,!0)},fn.prototype.onLMouseClick=function(e,t,n){var i=new THREE.Vector3(e,t,0);this.distanceInfo.firstSelObj&&this.distanceInfo.secondSelObj?(this.ShowLineargaugeDimension(i,!0,this.distanceInfo.XorY),this.OpMeasure.PostInfo(ve.INFOTYPE.FIRSTPOINT)):(this.PtToPtMeasure(e,t,!1),this.updatePtToPtScene(),this.distanceInfo.firstSelObj&&this.distanceInfo.secondSelObj&&Se.isMobileDevice()&&(this.lineargaugediv.style.display="block",this.shadowdiv.style.display="block"))},fn.prototype.PtToPtMeasure=function(e,t,n){if(null!=this.snappedPoint)null==this.distanceInfo.firstPoint?this.distanceInfo.firstPoint=this.snappedPoint.clone():this.distanceInfo.secondPoint=this.snappedPoint.clone(),this.snappedPoint=null;else{var i=this.getIntersectsByPriorityOfLine(e,t);if(i&&0=i&&n.intersectMouse.Pos<=n.intersectPos[o].Pos){r=n.intersectPos[o].Pos;break}i=n.intersectPos[o].Pos}var a=n.LineSegments[0].start.distanceTo(n.LineSegments[0].end),s=n.LineSegments[0].end.clone().sub(n.LineSegments[0].start).normalize(),l=((p=[])[0]=n.LineSegments[0].start.x+i*a*s.x,p[1]=n.LineSegments[0].start.y+i*a*s.y,p[2]=0,p[3]=n.LineSegments[0].start.x+r*a*s.x,p[4]=n.LineSegments[0].start.y+r*a*s.y,p[5]=0,t==R.lineContoursInfo.Contours.length-1&&(e=new THREE.Vector3(p[3],p[4],p[5])),R.createContour(p));R.OpMeasure.rootObject.add(l),n.lineobj=l,n.textPos=new THREE.Vector3((p[0]+p[3])/2,(p[1]+p[4])/2,0),n.dimString=(r-i)*a}else{for(var i=0,d=0,r=n.LineSegments.length-1,c=1,o=0;oi||n.intersectMouse.edgeIndex==i&&n.intersectMouse.Pos>d)&&(n.intersectMouse.edgeIndex=i&&n.intersectMouse.Pos<=n.intersectPos[o].Pos){r=n.intersectPos[o].Pos;break}i=n.intersectPos[o].Pos}var a=n.LineSegments[0].start.distanceTo(n.LineSegments[0].end),s=n.LineSegments[0].end.clone().sub(n.LineSegments[0].start).normalize(),l=((p=[])[0]=n.LineSegments[0].start.x+i*a*s.x,p[1]=n.LineSegments[0].start.y+i*a*s.y,p[2]=0,p[3]=n.LineSegments[0].start.x+r*a*s.x,p[4]=n.LineSegments[0].start.y+r*a*s.y,p[5]=0,t==this.lineContoursInfo.Contours.length-1&&(e=new THREE.Vector3(p[3],p[4],p[5])),this.createContour(p));this.OpMeasure.rootObject.add(l),n.lineobj=l,n.textPos=new THREE.Vector3((p[0]+p[3])/2,(p[1]+p[4])/2,0),n.dimString=(r-i)*a}else{for(var i=0,d=0,r=n.LineSegments.length-1,c=1,o=0;oi||n.intersectMouse.edgeIndex==i&&n.intersectMouse.Pos>d)&&(n.intersectMouse.edgeIndexP.edgeIndex){b.intersectPos.splice(R,0,P),C=!0;break}if(b.intersectPos[R].edgeIndex==P.edgeIndex&&b.intersectPos[R].Pos>P.Pos){b.intersectPos.splice(R,0,P),C=!0;break}}C||b.intersectPos.push(P);var O=new En;O.edgeIndex=l,O.Pos=U.s;for(C=!1,R=0;RO.edgeIndex){B.intersectPos.splice(R,0,O),C=!0;break}if(B.intersectPos[R].edgeIndex==O.edgeIndex&&B.intersectPos[R].Pos>O.Pos){B.intersectPos.splice(R,0,O),C=!0;break}}C||B.intersectPos.push(O),N=!0}}}E=y=null}if(N){e&&(this.lineContoursInfo.divPos=e);d=this.createLine(this.lineContoursInfo.preSelLineInfo,!1);this.OpMeasure.rootObject.add(d),b.intersectMouse=x,b.dimString=this.lineContoursInfo.preSelLineInfo.length,b.lineobj=d,b.lineInfo=this.lineContoursInfo.preSelLineInfo;(L=document.createElement("div")).className="mearesult",this.viewer.container.appendChild(L),b.textBox=L;var L,D,c=b.lineInfo.geometry;if((D=b.lineInfo.indexRange.concat())[0]+=c.drawRange.start/2,D[1]+=c.drawRange.start/2,c.isBufferGeometry){h=c.index,u=c.attributes.position.array;if(null!=h)for(p=h.array,f=0,m=M=D[0],g=w=D[1];m<=g;m++,f+=1){var H,v=p[2*m],A=p[2*m+1],y=new THREE.Vector3,E=new THREE.Vector3;y.fromArray(u,3*v),E.fromArray(u,3*A),y.x==E.x&&y.y==E.y?(f--,E=y=null):(y.applyMatrix4(b.lineInfo.matrixWorld),E.applyMatrix4(b.lineInfo.matrixWorld),(H=new yn).start.set(y.x,y.y),H.end.set(E.x,E.y),b.LineSegments.push(H),E=y=null)}}b.start.set(this.edgeInfo.startPos.x,this.edgeInfo.startPos.y),b.end.set(this.edgeInfo.endPos.x,this.edgeInfo.endPos.y),b.textPos=new THREE.Vector3((b.start.x+b.end.x)/2,(b.start.y+b.end.y)/2,0),this.lineContoursInfo.Contours.push(b),this.lineContoursInfo.start.copy(b.start),this.lineContoursInfo.end.copy(b.end),this.OpMeasure.PostInfo(ve.INFOTYPE.CIRCLEANDLINE)}else this.OpMeasure.PostInfo(ve.INFOTYPE.NOCONJOINT)}}}this.lineContoursInfo.preSelLineInfo=null}}else this.lineContoursInfo.preSelLineObj&&(this.OpMeasure.rootObject.remove(this.lineContoursInfo.preSelLineObj),this.lineContoursInfo.preSelLineObj=null,this.lineContoursInfo.preSelLineInfo=null),this.OpMeasure.PostInfo(ve.INFOTYPE.CIRCLEANDLINE)};function xn(e,t){var n,i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(i)return(i=i.call(e)).next.bind(i);if(Array.isArray(e)||(i=function(e,t){{var n;if(e)return"string"==typeof e?In(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?In(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length)return i&&(e=i),n=0,function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function In(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);nx.distLen?x:m},(o.prototype=Object.create(h.prototype)).OperatorClear=function(e){this.allowType=[],this.selectProjectPlane=!1,this.matrxTrans=null,this.sectionCross=null,this.projectDirectionXorY=null,this.isBoxMoving=!1},o.prototype.OperatorStart=function(e){this.measureType=e,this.allowType=this.MeasurePostInfo(e,!0,!0),this.selectProjectPlane=!1,this.distanceInfo.projectPlane=null,this.matrxTrans=null,this.sectionCross=null,this.projectDirectionXorY=null,this.isBoxMoving=!1},o.prototype.MeasurePostInfo=function(e,t,n){var i=[];switch(e){case"LmPt2Pt":this.OpMeasure.PostInfo(t?ve.INFOTYPE.CLICKFIRSTPOINT:ve.INFOTYPE.CLICKSECONDPOINT),n&&(i=["point"]);break;case"LmPt2Line":this.OpMeasure.PostInfo(t?ve.INFOTYPE.POINT:ve.INFOTYPE.LINE),n&&(i=t?["point"]:["line"]);break;case"LmLine2Line":this.OpMeasure.PostInfo(t?ve.INFOTYPE.FIRSTLINE:ve.INFOTYPE.SECONDLINE),n&&(i=["line"]);break;case"LmHole2Hole":this.OpMeasure.PostInfo(t?ve.INFOTYPE.CIRCLE:ve.INFOTYPE.SECONDCIRCLE),n&&(i=["circle","cylinder"]);break;case"LmAxis2Pt":this.OpMeasure.PostInfo(t?ve.INFOTYPE.POINT:ve.INFOTYPE.AXIS),n&&(i=t?["point"]:["circle","cone","cylinder"]);break;case"LmAxis2Line":this.OpMeasure.PostInfo(t?ve.INFOTYPE.AXIS:ve.INFOTYPE.LINE),n&&(i=t?["circle","cone","cylinder"]:["line"])}return i},o.prototype.onNMouseMove=function(e,t){var n,i,r,o,a,s=new THREE.Vector3(e,t,0);this.OpMeasure.unsteady?this.changeMeasureDistance(s):this.distanceInfo.firstSelObj&&this.distanceInfo.secondSelObj||this.selectProjectPlane?null==this.distanceInfo.projectPlane?this.selectProjectPlane&&(this.LineargaugeMeasure(e,t,!0,["plane"]),this.updateLineargaugeMeasure(!0,!0)):Se.isMobileDevice()||(this.distanceInfo.projectFstPos&&this.distanceInfo.projectSecPos||(this.distanceInfo.projectFstPos=new THREE.Vector3,this.distanceInfo.projectSecPos=new THREE.Vector3,this.distanceInfo.projectPlane.projectPoint(this.distanceInfo.firstPoint,this.distanceInfo.projectFstPos),this.distanceInfo.projectPlane.projectPoint(this.distanceInfo.secondPoint,this.distanceInfo.projectSecPos),this.distanceInfo.projectFstClnd&&this.OpMeasure.rootObject.remove(this.distanceInfo.projectFstClnd),this.distanceInfo.projectFstClnd=this.createPointMesh(this.distanceInfo.projectFstPos,this.materialProjectPoint,this.POINTSIZE),this.OpMeasure.rootObject.add(this.distanceInfo.projectFstClnd),this.distanceInfo.projectSecClnd&&this.OpMeasure.rootObject.remove(this.distanceInfo.projectSecClnd),this.distanceInfo.projectSecClnd=this.createPointMesh(this.distanceInfo.projectSecPos,this.materialProjectPoint,this.POINTSIZE),this.OpMeasure.rootObject.add(this.distanceInfo.projectSecClnd)),this.matrxTrans||this.lineargaugeRotateOnly(this.distanceInfo.projectPlane),n=this.distanceInfo.projectFstPos.clone(),i=this.distanceInfo.projectSecPos.clone(),this.lineargaugeModelCoord2PlaneCoord(n),this.lineargaugeModelCoord2PlaneCoord(i),s&&(r=this.distanceInfo.projectPlane,r=this.clientCoordToModelCoordOnPlane(s.x,s.y,r),this.lineargaugeModelCoord2PlaneCoord(r),r)&&(this.distanceInfo.mousePos||(this.distanceInfo.mousePos=r.clone()),a=o=!1,(o=this.distanceInfo.mousePos.y+Math.min(n.y,i.y)&&this.distanceInfo.mousePos.x+Math.min(n.x,i.x)?!0:o)!=(a=r.y+Math.min(n.y,i.y)&&r.x+Math.min(n.x,i.x)?!0:a)&&(n.yMath.min(this.distanceInfo.mousePos.y,r.y)||i.yMath.min(this.distanceInfo.mousePos.y,r.y)?this.distanceInfo.XorY=0:(n.xMath.min(this.distanceInfo.mousePos.x,r.x)||i.xMath.min(this.distanceInfo.mousePos.x,r.x))&&(this.distanceInfo.XorY=1)),this.distanceInfo.mousePos.set(r.x,r.y,0)),this.ShowLineargaugeDimension(s,!1,this.distanceInfo.XorY)):(this.LineargaugeMeasure(e,t,!0,this.allowType),this.updateLineargaugeMeasure(!0,!1))},o.prototype.onLMouseClick=function(e,t,n){var i=new THREE.Vector3(e,t,0);this.distanceInfo.firstSelObj&&this.distanceInfo.secondSelObj||this.selectProjectPlane?null==this.distanceInfo.projectPlane?this.selectProjectPlane&&(this.LineargaugeMeasure(e,t,!1,["plane"]),this.updateLineargaugeMeasure(!1,!0),this.distanceInfo.projectPlane)&&this.LineargaugePostNotify():(this.matrxTrans||this.lineargaugeRotateOnly(this.distanceInfo.projectPlane),Se.isMobileDevice()||(this.ShowLineargaugeDimension(i,!0,this.distanceInfo.XorY),this.allowType=this.MeasurePostInfo(this.measureType,!0,!0))):(this.LineargaugeMeasure(e,t,!1,this.allowType),this.updateLineargaugeMeasure(!1,!1))},o.prototype.LineargaugeMeasure=function(e,t,n,i){e=this.doRaycasterPick(e,t,!0);if(e&&0!=e.length)if(n)-1!=i.indexOf("point")&&(this.previewSnappedPoint2(e),null!=this.snappedPoint)?this.LineargaugeClearPreSelect():(t=e[0])&&(n=this.getSelectInfoFromIntersect(t))&&(-1==i.indexOf(n.type)||"line"==n.type&&!this.Bline(n)?this.LineargaugeClearPreSelect():null!=this.distanceInfo.preSelInfo&&this.isTwoTopolInfoTheSame(this.distanceInfo.preSelInfo,n)||(this.distanceInfo.preSelInfo=n,this.distanceInfo.preSelObj&&(this.OpMeasure.rootObject.remove(this.distanceInfo.preSelObj),this.distanceInfo.preSelObj=null)));else if(null!=this.snappedPoint&&-1!=i.indexOf("point"))null==this.distanceInfo.firstSelInfo?(this.distanceInfo.firstPoint=this.snappedPoint.clone(),this.distanceInfo.firstSelInfo={type:"point",point:this.snappedPoint},this.LineargaugePostNotify()):"point"==this.distanceInfo.firstSelInfo.type&&this.distanceInfo.firstSelObj&&this.isTwoPointTheSame(this.distanceInfo.firstSelInfo.point,this.snappedPoint)?(this.LineargaugeClearFirstSelect(),this.LineargaugePostNotify()):(this.distanceInfo.secondPoint=this.snappedPoint.clone(),this.distanceInfo.secondSelInfo={type:"point",point:this.snappedPoint},this.LineargaugePostSelectPorjectPlane()),this.snappedPoint=null;else{t=e[0];if(t){var r,o,a,s,l,d,c,n=this.getSelectInfoFromIntersect(t);if(n){if(-1!=i.indexOf("line")&&"line"==n.type&&!this.Bline(n))return void this.LineargaugeClearPreSelect();if(-1==i.indexOf(n.type)&&-1!=i.indexOf("point")){var e=n.intersect.clone();null==this.distanceInfo.firstSelInfo?(this.distanceInfo.firstPoint=e,this.distanceInfo.firstSelInfo={type:"point",point:e},this.LineargaugePostNotify()):(this.distanceInfo.secondSelInfo={type:"point",point:e},this.distanceInfo.secondPoint=e,this.LineargaugePostSelectPorjectPlane())}else if(-1!=i.indexOf(n.type)){if("plane"==n.type&&this.selectProjectPlane&&null==this.distanceInfo.projectPlane)return e=(new THREE.Plane).setFromNormalAndCoplanarPoint(n.worldNormal,n.worldOrigin),this.distanceInfo.projectPlaneInfo=n,this.LineargaugePostSelectPorjectPlane(e),void this.LineargaugeClearPreSelect();null==this.distanceInfo.firstSelInfo?(this.distanceInfo.firstSelInfo=n,this.LineargaugePostNotify()):this.distanceInfo.firstSelInfo&&(this.isTwoTopolInfoTheSame(this.distanceInfo.firstSelInfo,n)?(this.LineargaugeClearFirstSelect(),this.LineargaugePostNotify()):(e=null,"point"==(r=this.distanceInfo.firstSelInfo).type&&"line"==n.type?(a=this.getLineStartEndPoints(n))&&(d=new THREE.Line3(a.start,a.end).closestPointToPoint(this.distanceInfo.firstPoint,!1),this.distanceInfo.secondPoint=d,this.distanceInfo.secondSelInfo=n,a=(new THREE.Vector3).subVectors(a.start,a.end),e=(new THREE.Plane).setFromNormalAndCoplanarPoint(a,d).normalize()):"line"==r.type&&"line"==n.type?(a=this.getLineStartEndPoints(r),d=this.getLineStartEndPoints(n),a&&d&&((o=(new THREE.Vector3).subVectors(a.end,a.start)).normalize(),(c=(new THREE.Vector3).subVectors(d.end,d.start)).normalize(),s=o.dot(c),l=new THREE.Line3(a.start,a.end).closestPointToPoint(d.start,!1),1-Math.abs(s)<1e-7?(this.distanceInfo.secondSelInfo=n,this.distanceInfo.firstPoint=l,this.distanceInfo.secondPoint=d.start.clone(),e=(new THREE.Plane).setFromNormalAndCoplanarPoint(c,this.distanceInfo.secondPoint).normalize()):this.OpMeasure.PostInfo(ve.INFOTYPE.LINENOPARALLEL))):"circle"!=r.type&&"cylinder"!=r.type||"circle"!=n.type&&"cylinder"!=n.type?"point"!=r.type||"circle"!=n.type&&"cylinder"!=n.type&&"cone"!=n.type?"circle"!=r.type&&"cylinder"!=r.type&&"cone"!=r.type||"line"!=n.type||(a=this.getLineStartEndPoints(r),d=this.getLineStartEndPoints(n),a&&d&&((o=(new THREE.Vector3).subVectors(a.end,a.start)).normalize(),(c=(new THREE.Vector3).subVectors(d.end,d.start)).normalize(),s=o.dot(c),l=new THREE.Line3(a.start,a.end).closestPointToPoint(d.start,!1),1-Math.abs(s)<1e-7?(this.distanceInfo.secondSelInfo=n,this.distanceInfo.firstPoint=l,this.distanceInfo.secondPoint=d.start.clone(),e=(new THREE.Plane).setFromNormalAndCoplanarPoint(c,this.distanceInfo.secondPoint).normalize()):this.OpMeasure.PostInfo(ve.INFOTYPE.AXISNOPARALLELLINE))):(o=this.getLineStartEndPoints(n))&&(a=new THREE.Line3(o.start,o.end).closestPointToPoint(this.distanceInfo.firstPoint,!1),this.distanceInfo.secondPoint=a.clone(),this.distanceInfo.secondSelInfo=n,s=(new THREE.Vector3).subVectors(o.start,o.end),e=(new THREE.Plane).setFromNormalAndCoplanarPoint(s,a).normalize()):(l=this.getLineStartEndPoints(r),this.distanceInfo.firstPoint=l.start,d=this.getLineStartEndPoints(n),this.distanceInfo.secondPoint=d.start.clone(),this.distanceInfo.secondSelInfo=n,this.LineargaugePostSelectPorjectPlane()),e&&this.LineargaugePostSelectPorjectPlane(e)))}}else-1!=i.indexOf("point")&&(c=t.point,null==this.distanceInfo.firstSelInfo?(this.distanceInfo.firstPoint=c,this.distanceInfo.firstSelInfo={type:"point",point:c},this.LineargaugePostNotify()):(this.distanceInfo.secondSelInfo={type:"point",point:c},this.distanceInfo.secondPoint=c,this.LineargaugePostSelectPorjectPlane()))}this.LineargaugeClearPreSelect()}else this.LineargaugeClearPreSelect()},o.prototype.updateLineargaugeMeasure=function(e,t){var n;this.distanceInfo.firstSelObj&&this.distanceInfo.secondSelObj&&!t?this.LineargaugeClearPreSelect():e?this.distanceInfo.preSelInfo&&!this.distanceInfo.preSelObj&&("line"==this.distanceInfo.preSelInfo.type||"circle"==this.distanceInfo.preSelInfo.type?(n=this.createLine(this.distanceInfo.preSelInfo,!(n=null)))&&(this.OpMeasure.rootObject.add(n),this.distanceInfo.preSelObj=n):"plane"!=this.distanceInfo.preSelInfo.type&&"cylinder"!=this.distanceInfo.preSelInfo.type&&"cone"!=this.distanceInfo.preSelInfo.type||(n=this.createFace(this.distanceInfo.preSelInfo,!0))&&(this.OpMeasure.rootObject.add(n),this.distanceInfo.preSelObj=n)):(this.distanceInfo.firstSelInfo&&!this.distanceInfo.firstSelObj&&(this.LineargaugeClearPreSelect(),n=null,"point"==this.distanceInfo.firstSelInfo.type?n=this.createPointMesh(this.distanceInfo.firstSelInfo.point,this.materialPoint,this.POINTSIZE):"line"==this.distanceInfo.firstSelInfo.type||"circle"==this.distanceInfo.firstSelInfo.type?n=this.createLine(this.distanceInfo.firstSelInfo,!1):"plane"!=this.distanceInfo.firstSelInfo.type&&"cylinder"!=this.distanceInfo.firstSelInfo.type&&"cone"!=this.distanceInfo.firstSelInfo.type||(n=this.createFace(this.distanceInfo.firstSelInfo,!1),"cylinder"!=this.distanceInfo.firstSelInfo.type&&"cone"!=this.distanceInfo.firstSelInfo.type)||(this.distanceInfo.axisLineObj=this.createAxisLine(this.distanceInfo.firstSelInfo),this.OpMeasure.rootObject.add(this.distanceInfo.axisLineObj)),n)&&(this.OpMeasure.rootObject.add(n),this.distanceInfo.firstSelObj=n),this.distanceInfo.secondSelInfo&&!this.distanceInfo.secondSelObj&&(this.LineargaugeClearPreSelect(),n=null,"point"==this.distanceInfo.secondSelInfo.type?n=this.createPointMesh(this.distanceInfo.secondSelInfo.point,this.materialPoint,this.POINTSIZE):"line"==this.distanceInfo.secondSelInfo.type||"circle"==this.distanceInfo.secondSelInfo.type?n=this.createLine(this.distanceInfo.secondSelInfo,!1):"plane"!=this.distanceInfo.secondSelInfo.type&&"cylinder"!=this.distanceInfo.secondSelInfo.type&&"cone"!=this.distanceInfo.secondSelInfo.type||(n=this.createFace(this.distanceInfo.secondSelInfo,!1),"cylinder"!=this.distanceInfo.secondSelInfo.type&&"cone"!=this.distanceInfo.secondSelInfo.type)||(this.distanceInfo.secaxisLineObj=this.createAxisLine(this.distanceInfo.secondSelInfo),this.OpMeasure.rootObject.add(this.distanceInfo.secaxisLineObj)),n)&&(this.OpMeasure.rootObject.add(n),this.distanceInfo.secondSelObj=n),this.distanceInfo.projectPlaneInfo&&!this.distanceInfo.projectPlaneObj&&(this.LineargaugeClearPreSelect(),n=null,(n="plane"==this.distanceInfo.projectPlaneInfo.type?this.createFace(this.distanceInfo.projectPlaneInfo,!1):n)&&(this.OpMeasure.rootObject.add(n),this.distanceInfo.projectPlaneObj=n),this.lineargaugeRotateOnly(this.distanceInfo.projectPlane)),this.distanceInfo.firstSelObj&&this.distanceInfo.secondSelObj&&this.distanceInfo.projectPlane&&(_e.enableBroadcast&&_e.broadcastMajor&&this.OpMeasure.addmeasureTimes(),this.LineargaugeClearPreSelect(),this.matrxTrans||this.lineargaugeRotateOnly(this.distanceInfo.projectPlane),Se.isMobileDevice()?null!=this.projectDirectionXorY?(this.ShowLineargaugeDimension(null,!0,this.projectDirectionXorY),this.LineargaugePostNotify()):this.OpMeasure.PostInfo(ve.INFOTYPE.SELECTPLACELINELOCATION):(this.OpMeasure.PostInfo(ve.INFOTYPE.PLACELINELOCATION),this.ShowLineargaugeDimension())))},o.prototype.ShowLineargaugeDimension=function(e,t,n,i){var r,o,a,s,l;this.distanceInfo.firstSelObj&&this.distanceInfo.secondSelObj&&(this.distanceInfo.projectFstPos&&this.distanceInfo.projectSecPos||(this.distanceInfo.projectFstPos=new THREE.Vector3,this.distanceInfo.projectSecPos=new THREE.Vector3,this.distanceInfo.projectPlane.projectPoint(this.distanceInfo.firstPoint,this.distanceInfo.projectFstPos),this.distanceInfo.projectPlane.projectPoint(this.distanceInfo.secondPoint,this.distanceInfo.projectSecPos),this.distanceInfo.projectFstClnd&&this.OpMeasure.rootObject.remove(this.distanceInfo.projectFstClnd),this.distanceInfo.projectFstClnd=this.createPointMesh(this.distanceInfo.projectFstPos,this.materialProjectPoint,this.POINTSIZE),this.OpMeasure.rootObject.add(this.distanceInfo.projectFstClnd),this.distanceInfo.projectSecClnd&&this.OpMeasure.rootObject.remove(this.distanceInfo.projectSecClnd),this.distanceInfo.projectSecClnd=this.createPointMesh(this.distanceInfo.projectSecPos,this.materialProjectPoint,this.POINTSIZE),this.OpMeasure.rootObject.add(this.distanceInfo.projectSecClnd)),null==n&&(n=0),i||(this.distanceInfo.fstClndPos?this.distanceInfo.fstClndPos.set(this.distanceInfo.projectFstPos.x,this.distanceInfo.projectFstPos.y,this.distanceInfo.projectFstPos.z):this.distanceInfo.fstClndPos=this.distanceInfo.projectFstPos.clone(),this.distanceInfo.sndClndPos?this.distanceInfo.sndClndPos.set(this.distanceInfo.projectSecPos.x,this.distanceInfo.projectSecPos.y,this.distanceInfo.projectSecPos.z):this.distanceInfo.sndClndPos=this.distanceInfo.projectSecPos.clone()),this.lineargaugeModelCoord2PlaneCoord(this.distanceInfo.fstClndPos),this.lineargaugeModelCoord2PlaneCoord(this.distanceInfo.sndClndPos),e?(i=this.distanceInfo.projectPlane,e=this.clientCoordToModelCoordOnPlane(e.x,e.y,i),this.lineargaugeModelCoord2PlaneCoord(e),e&&0==n?(this.distanceInfo.fstClndPos.y=e.y,this.distanceInfo.sndClndPos.y=e.y,this.distanceInfo.fstClndPos.z=0,this.distanceInfo.sndClndPos.z=0):e&&1==n&&(this.distanceInfo.fstClndPos.x=e.x,this.distanceInfo.sndClndPos.x=e.x,this.distanceInfo.fstClndPos.z=0,this.distanceInfo.sndClndPos.z=0)):0==n?(i=(this.distanceInfo.fstClndPos.y+this.distanceInfo.sndClndPos.y)/2,this.distanceInfo.fstClndPos.y=i,this.distanceInfo.sndClndPos.y=i,this.distanceInfo.fstClndPos.z=0,this.distanceInfo.sndClndPos.z=0):1==n&&(e=(this.distanceInfo.fstClndPos.x+this.distanceInfo.sndClndPos.x)/2,this.distanceInfo.fstClndPos.x=e,this.distanceInfo.sndClndPos.x=e,this.distanceInfo.fstClndPos.z=0,this.distanceInfo.sndClndPos.z=0),i=this.distanceInfo.fstClndPos.clone(),e=this.distanceInfo.sndClndPos.clone(),i.distanceTo(e)<1e-6&&(0==n?(i.x+=.5,e.x-=.5):(i.y+=.5,e.y-=.5)),this.lineargaugePlaneCoord2ModelCoord(this.distanceInfo.fstClndPos),this.lineargaugePlaneCoord2ModelCoord(this.distanceInfo.sndClndPos),this.lineargaugePlaneCoord2ModelCoord(i),this.lineargaugePlaneCoord2ModelCoord(e),this.distanceInfo.textPos?(this.distanceInfo.textPos.x=(this.distanceInfo.fstClndPos.x+this.distanceInfo.sndClndPos.x)/2,this.distanceInfo.textPos.y=(this.distanceInfo.fstClndPos.y+this.distanceInfo.sndClndPos.y)/2,this.distanceInfo.textPos.z=(this.distanceInfo.fstClndPos.z+this.distanceInfo.sndClndPos.z)/2):this.distanceInfo.textPos=new THREE.Vector3((this.distanceInfo.fstClndPos.x+this.distanceInfo.sndClndPos.x)/2,(this.distanceInfo.fstClndPos.y+this.distanceInfo.sndClndPos.y)/2,(this.distanceInfo.fstClndPos.z+this.distanceInfo.sndClndPos.z)/2),(r=(new THREE.Vector3).subVectors(e,i)).normalize(),this.distanceInfo.fstClnd&&this.OpMeasure.rootObject.remove(this.distanceInfo.fstClnd),this.distanceInfo.fstClnd=this.createCylinderMesh(e,this.distanceInfo.fstClndPos,this.appmaterialLine),a=this.OpMeasure.getScale(this.distanceInfo.fstClnd,this.CYLINDERWIDTH),r.multiplyScalar(.5*this.distanceInfo.fstClnd.geometry.parameters.height),this.distanceInfo.fstClnd.oldPosition=this.distanceInfo.fstClndPos.clone(),this.distanceInfo.fstClnd.offsetPos=r.clone(),this.distanceInfo.fstClnd.position.addVectors(this.distanceInfo.fstClndPos,r.clone().multiplyScalar(a)),this.distanceInfo.fstClnd.updateMatrixWorld(),this.OpMeasure.rootObject.add(this.distanceInfo.fstClnd),this.distanceInfo.sndClnd&&this.OpMeasure.rootObject.remove(this.distanceInfo.sndClnd),this.distanceInfo.sndClnd=this.createCylinderMesh(i,this.distanceInfo.sndClndPos,this.appmaterialLine),this.distanceInfo.sndClnd.oldPosition=this.distanceInfo.sndClndPos.clone(),this.distanceInfo.sndClnd.offsetPos=r.clone().multiplyScalar(-1),this.distanceInfo.sndClnd.position.subVectors(this.distanceInfo.sndClndPos,r.clone().multiplyScalar(a)),this.distanceInfo.sndClnd.updateMatrixWorld(),this.OpMeasure.rootObject.add(this.distanceInfo.sndClnd),this.distanceInfo.clndToClndLine&&this.OpMeasure.rootObject.remove(this.distanceInfo.clndToClndLine),this.distanceInfo.clndToClndLine=this.createLineMesh2(this.distanceInfo.fstClndPos,this.distanceInfo.sndClndPos,this.appmaterialLine,1),this.OpMeasure.rootObject.add(this.distanceInfo.clndToClndLine),this.distanceInfo.fstToClndLine&&this.OpMeasure.rootObject.remove(this.distanceInfo.fstToClndLine),this.distanceInfo.fstToClndLine=this.createLineMesh2(this.distanceInfo.projectFstPos,this.distanceInfo.fstClndPos,this.appmaterialLine,1),this.OpMeasure.rootObject.add(this.distanceInfo.fstToClndLine),this.distanceInfo.sndToClndLine&&this.OpMeasure.rootObject.remove(this.distanceInfo.sndToClndLine),this.distanceInfo.sndToClndLine=this.createLineMesh2(this.distanceInfo.projectSecPos,this.distanceInfo.sndClndPos,this.appmaterialLine,1),this.OpMeasure.rootObject.add(this.distanceInfo.sndToClndLine),this.distanceInfo.FstToFstPointLine&&this.OpMeasure.rootObject.remove(this.distanceInfo.FstToFstPointLine),this.distanceInfo.FstToFstPointLine=this.createLineMesh2(this.distanceInfo.projectFstPos,this.distanceInfo.firstPoint,this.appmaterialLine,1),this.OpMeasure.rootObject.add(this.distanceInfo.FstToFstPointLine),this.distanceInfo.SndToSndPointLine&&this.OpMeasure.rootObject.remove(this.distanceInfo.SndToSndPointLine),this.distanceInfo.SndToSndPointLine=this.createLineMesh2(this.distanceInfo.projectSecPos,this.distanceInfo.secondPoint,this.appmaterialLine,1),this.OpMeasure.rootObject.add(this.distanceInfo.SndToSndPointLine),r=this.distanceInfo.projectFstPos.clone(),a=this.distanceInfo.projectSecPos.clone(),this.lineargaugeModelCoord2PlaneCoord(r),this.lineargaugeModelCoord2PlaneCoord(a),this.distanceInfo.dimString=r.distanceTo(a),0==n?this.distanceInfo.dimString=Math.abs(r.x-a.x):1==n&&(this.distanceInfo.dimString=Math.abs(r.y-a.y)),this.distanceInfo.dimString<1&&.999999dis:"+r:"距离:"+r,this.distanceInfo.textBox.appendChild(a),s=document.createElement("p"),a=Math.abs(this.distanceInfo.firstPoint.x-this.distanceInfo.secondPoint.x),n=this.viewer.getDispalyModelUnit(a),s.innerHTML="X:"+(a*this.viewer.measuringScale*n.scale).toFixed(2)+this.getUnitStringmap(n.unit),this.distanceInfo.textBox.appendChild(s),a=document.createElement("p"),s=Math.abs(this.distanceInfo.firstPoint.z-this.distanceInfo.secondPoint.z),n=this.viewer.getDispalyModelUnit(s),a.innerHTML="Y:"+(s*this.viewer.measuringScale*n.scale).toFixed(2)+this.getUnitStringmap(n.unit),this.distanceInfo.textBox.appendChild(a),s=document.createElement("p"),a=Math.abs(this.distanceInfo.firstPoint.y-this.distanceInfo.secondPoint.y),n=this.viewer.getDispalyModelUnit(a),s.innerHTML="Z:"+(a*this.viewer.measuringScale*n.scale).toFixed(2)+this.getUnitStringmap(n.unit),this.distanceInfo.textBox.appendChild(s)):(this.distanceInfo.textBox=document.createElement("div"),this.distanceInfo.textBox.className="section10",this.distanceInfo.textBox.innerHTML=r,this.distanceInfo.textBox.setAttribute("mobile","up"),(l=document.createElement("div")).className="sectionPoint",this.distanceInfo.textBox.appendChild(l),this.sectionCross=document.createElement("div"),this.sectionCross.className="sectionCross",this.distanceInfo.textBox.appendChild(this.sectionCross),Se.isMobileDevice()||(this.distanceInfo.textBox.addEventListener("mousedown",this.clickBoxInfo,!1),(o=this).distanceInfo.textBox.addEventListener("click",function e(t){0===t.button&&_e.enableBroadcast&&_e.broadcastMajor&&o.viewer.dispatchEvent({type:"broadcastEvent"}),this.removeEventListener("click",e)},!1))),this.viewer.container.appendChild(this.distanceInfo.textBox)),this.getAndShowTextBox(this.distanceInfo.textPos.clone(),r,this.distanceInfo.textBox),null!=r&&(this.distanceInfo.textBox.childNodes[0].data=r),1==t)&&(Se.isMobileDevice()||this.distanceInfo.textBox.removeEventListener("mousedown",this.clickBoxInfo,!1),(a={}).dimString=r,a.textPos=this.distanceInfo.textPos.clone(),a.textBox=this.distanceInfo.textBox,n=this,(s=new THREE.Group).objectType="Group",n.distanceInfo.firstSelObj&&(n.OpMeasure.rootObject.remove(n.distanceInfo.firstSelObj),s.add(n.distanceInfo.firstSelObj)),n.distanceInfo.secondSelObj&&(n.OpMeasure.rootObject.remove(n.distanceInfo.secondSelObj),s.add(n.distanceInfo.secondSelObj)),n.distanceInfo.projectPlaneObj&&(n.OpMeasure.rootObject.remove(n.distanceInfo.projectPlaneObj),s.add(n.distanceInfo.projectPlaneObj)),n.distanceInfo.boxToClndLine&&(n.OpMeasure.rootObject.remove(n.distanceInfo.boxToClndLine),s.add(n.distanceInfo.boxToClndLine)),n.distanceInfo.axisLineObj&&(n.OpMeasure.rootObject.remove(n.distanceInfo.axisLineObj),s.add(n.distanceInfo.axisLineObj)),n.distanceInfo.secaxisLineObj&&(n.OpMeasure.rootObject.remove(n.distanceInfo.secaxisLineObj),s.add(n.distanceInfo.secaxisLineObj)),n.distanceInfo.projectFstClnd&&(n.OpMeasure.rootObject.remove(n.distanceInfo.projectFstClnd),s.add(n.distanceInfo.projectFstClnd)),n.distanceInfo.projectSecClnd&&(n.OpMeasure.rootObject.remove(n.distanceInfo.projectSecClnd),s.add(n.distanceInfo.projectSecClnd)),n.distanceInfo.fstClnd&&(n.OpMeasure.rootObject.remove(n.distanceInfo.fstClnd),s.add(n.distanceInfo.fstClnd)),n.distanceInfo.sndClnd&&(n.OpMeasure.rootObject.remove(n.distanceInfo.sndClnd),s.add(n.distanceInfo.sndClnd)),n.distanceInfo.clndToClndLine&&(n.OpMeasure.rootObject.remove(n.distanceInfo.clndToClndLine),s.add(n.distanceInfo.clndToClndLine)),n.distanceInfo.fstToClndLine&&(n.OpMeasure.rootObject.remove(n.distanceInfo.fstToClndLine),s.add(n.distanceInfo.fstToClndLine)),n.distanceInfo.sndToClndLine&&(n.OpMeasure.rootObject.remove(n.distanceInfo.sndToClndLine),s.add(n.distanceInfo.sndToClndLine)),n.distanceInfo.FstToFstPointLine&&(n.OpMeasure.rootObject.remove(n.distanceInfo.FstToFstPointLine),s.add(n.distanceInfo.FstToFstPointLine)),n.distanceInfo.SndToSndPointLine&&(n.OpMeasure.rootObject.remove(n.distanceInfo.SndToSndPointLine),s.add(n.distanceInfo.SndToSndPointLine)),n.OpMeasure.rootObject.add(s),Se.isMobileDevice()?(a.textBox.addEventListener("touchstart",this.touchstart,!1),a.textBox.addEventListener("touchend",this.touchend,!1),a.textBox.addEventListener("touchmove",this.touchmove,!1)):(a.textBox.addEventListener("mousedown",this.touchstart,!1),a.textBox.addEventListener("mouseup",this.touchend,!1),a.textBox.addEventListener("mousemove",this.touchmove,!1),a.textBox.addEventListener("mouseleave",this.mouseleave,!1),a.textBox.addEventListener("mouseenter",this.mouseenter,!1)),Se.isMobileDevice()?this.sectionCross.addEventListener("touchend",this.sectionCrossend,!1):(this.sectionCross.addEventListener("mousedown",this.sectionCrossend,!1),this.sectionCross.addEventListener("mouseleave",this.crossleave,!1),this.sectionCross.addEventListener("mouseenter",this.crossenter,!1)),(l={}).start=this.distanceInfo.textPos.clone(),l.end=this.distanceInfo.textPos.clone(),l.uuid=s.uuid,this.OpMeasure.textLines.push(l),a.textBox.setAttribute("mobile","up"),a.textBox.setAttribute("group",s.uuid),a.textBox.setAttribute("type","length"),a.textBox.setAttribute("dimString",this.distanceInfo.dimString),a.textBox.setAttribute("dimStringPrefix",""),a.textBox.setAttribute("unit",this.distanceInfo.unit),a.textBox.setAttribute("lineInfo",this.OpMeasure.textLines.length-1),this.OpMeasure.boxInfos.push(a),this.OpMeasure.unsteadyData[s.uuid]=this.DeepCopy(this.distanceInfo,"Lineargauge3D"),this.OpMeasure.unsteadyData[s.uuid].p1=i,this.OpMeasure.unsteadyData[s.uuid].p2=e,this.sectionCross=null,this.matrxTrans=null,this.selectProjectPlane=!1,this.projectDirectionXorY=null,this.isBoxMoving=!1,!Se.isMobileDevice()&&"LmPt2Pt"!=this.measureType&&"LmHole2Hole"!=this.measureType||this.viewer.dispatchEvent({type:"Lineargauge3DMeasureEndEvent"}),this.clearDistanceInfo(!0),Se.isMobileDevice())&&this.ChangeMeasureFlag()},o.prototype.LineargaugeClearPreSelect=function(){this.distanceInfo.preSelObj&&(this.OpMeasure.rootObject.remove(this.distanceInfo.preSelObj),this.distanceInfo.preSelObj=null,this.distanceInfo.preSelInfo=null)},o.prototype.LineargaugeClearProjectPlaneSelect=function(){this.distanceInfo.projectPlaneObj&&(this.OpMeasure.rootObject.remove(this.distanceInfo.projectPlaneObj),this.distanceInfo.projectPlaneObj=null,this.distanceInfo.projectPlaneInfo=null)},o.prototype.LineargaugeClearFirstSelect=function(){this.distanceInfo.firstSelObj&&(this.OpMeasure.rootObject.remove(this.distanceInfo.firstSelObj),this.distanceInfo.firstSelObj=null,this.distanceInfo.firstSelInfo=null),this.distanceInfo.axisLineObj&&(this.OpMeasure.rootObject.remove(this.distanceInfo.axisLineObj),this.distanceInfo.axisLineObj=null)},o.prototype.LineargaugePostSelectPorjectPlane=function(e){switch(this.measureType){case"LmPt2Pt":case"LmHole2Hole":this.distanceInfo.projectPlane?this.selectProjectPlane=!1:e?(this.distanceInfo.projectPlane=e,this.selectProjectPlane=!1,this.lineargaugeRotate(this.distanceInfo.projectPlane)):(this.OpMeasure.PostInfo(ve.INFOTYPE.SELECTPROJECTPLANE),this.selectProjectPlane=!1);break;default:this.selectProjectPlane=!1,this.distanceInfo.projectPlane=e}},o.prototype.LineargaugePostNotify=function(){this.distanceInfo.firstSelInfo?this.distanceInfo.firstSelInfo&&!this.distanceInfo.secondSelInfo&&(this.allowType=this.MeasurePostInfo(this.measureType,!1,!0)):this.allowType=this.MeasurePostInfo(this.measureType,!0,!0)},o.prototype.lineargaugeRotate=function(e,t){e=this.viewer.cameraControl.rotateToPlane(e);this.distanceInfo.projectFstPos=null,this.distanceInfo.projectSecPos=null,this.matrxTrans=e,this.viewer.render(),this.LineargaugePostNotify(),this.distanceInfo.firstSelInfo&&this.distanceInfo.secondSelInfo&&(Se.isMobileDevice()?null!=this.projectDirectionXorY?this.lineargaugeSelectPlaceLine(this.projectDirectionXorY):this.OpMeasure.PostInfo(ve.INFOTYPE.SELECTPLACELINELOCATION):(t&&this.ShowLineargaugeDimension(null,!1,this.distanceInfo.XorY),this.OpMeasure.PostInfo(ve.INFOTYPE.PLACELINELOCATION)))},o.prototype.lineargaugeRotateOnly=function(e){e&&(e=this.viewer.cameraControl.rotateToPlane(e),this.distanceInfo.projectFstPos=null,this.distanceInfo.projectSecPos=null,this.viewer.render(),this.matrxTrans=e)},o.prototype.lineargaugeModelCoord2PlaneCoord=function(e){e.sub(this.matrxTrans.origin),e.applyMatrix3(this.matrxTrans.matrixInvert)},o.prototype.lineargaugePlaneCoord2ModelCoord=function(e){e.applyMatrix3(this.matrxTrans.matrix),e.add(this.matrxTrans.origin)},o.prototype.lineargaugeSelectPlaceLine=function(e){this.projectDirectionXorY=e,this.distanceInfo.firstSelInfo&&this.distanceInfo.secondSelInfo&&this.distanceInfo.projectPlane&&(this.matrxTrans||this.lineargaugeRotateOnly(this.distanceInfo.projectPlane),this.ShowLineargaugeDimension(null,!0,this.projectDirectionXorY),this.LineargaugePostNotify())};function Sn(e){this.viewer=e;var k=this,T=null,U=null,S=!1,G=null,B=null,P=null;this.broadcastInfo=null,this.initialization=!0,this.onTouchMove=function(e){if(!k.viewer.isClipTransformControlSelected()&&!k.viewer.isLightEditControlSelected()){switch(e.stopPropagation(),e.touches.length){case 1:var t=e.touches[0].offsetX||e.touches[0].clientX-k.viewer.container.getBoundingClientRect().left,n=e.touches[0].offsetY||e.touches[0].clientY-k.viewer.container.getBoundingClientRect().top;if(k.viewer.limitEventArea){var i=k.viewer.container.getBoundingClientRect().width,r=k.viewer.container.getBoundingClientRect().height;if(ii||k.pointer.y>r)&&(k.pointer2nd.x>i||k.pointer2nd.y>r))return}}if(null==T&&(T=new THREE.Vector2),"OpMeasure"==k.viewer.getCurrentOperatorID()){null==B&&(B=new THREE.Vector3);var o=k.viewer.controls.getOperator().MeasureOper.getIntersectsByPriorityOfLine(t,n),a=null;if(o&&0i?n.x=Math.max(n.x,-1*t[r].normal.x*t[r].constant):Math.abs(t[r].normal.y)>i?n.y=Math.max(n.y,-1*t[r].normal.y*t[r].constant):n.z=Math.max(n.z,-1*t[r].normal.z*t[r].constant);i=1e-6;var o,a=n.clone().sub(I.position),s=(a.x=Math.abs(a.x)se.clipTransRotControls.length-1)){for(var t=0;tse.clipActiveId&&se.planeNameToId[t]--;se.clipTransRotControls[se.clipActiveId].visible=!1,se.clipTransRotControls[se.clipActiveId].dispose(),fe.remove(se.clipTransRotControls[se.clipActiveId]),fe.remove(h[se.clipActiveId]),se.clipTransRotControls.splice(se.clipActiveId,1),h.splice(se.clipActiveId,1),se.viewer.renderer.clippingPlanes.splice(se.clipActiveId,1),3===c&&g(),se.viewer.render()}},this.renderClipScene=function(e,t){fe&&(e?se.viewer.renderer.render(fe,se.viewer.camera,e,t):se.viewer.renderer.render(fe,se.viewer.camera))},this.renderClipPlane=function(e,t){var n,i;p&&(n=se.viewer.scene.overrideMaterial,se.viewer.renderer.state.buffers.stencil.setTest(!0),i=se.viewer.renderer.context,se.viewer.renderer.state.buffers.stencil.setFunc(i.ALWAYS,1,255),se.viewer.renderer.state.buffers.stencil.setOp(i.KEEP,i.KEEP,i.INCR),se.viewer.scene.overrideMaterial=l,e?se.viewer.renderer.render(se.viewer.scene,se.viewer.camera,e,t):se.viewer.renderer.render(se.viewer.scene,se.viewer.camera),se.viewer.renderer.state.buffers.stencil.setFunc(i.ALWAYS,1,255),se.viewer.renderer.state.buffers.stencil.setOp(i.KEEP,i.KEEP,i.DECR),se.viewer.scene.overrideMaterial=u,e?se.viewer.renderer.render(se.viewer.scene,se.viewer.camera,e,!1):se.viewer.renderer.render(se.viewer.scene,se.viewer.camera),se.viewer.scene.overrideMaterial=n,se.viewer.renderer.state.buffers.stencil.setFunc(i.EQUAL,1,255),se.viewer.renderer.state.buffers.stencil.setOp(i.KEEP,i.KEEP,i.KEEP),e?se.viewer.renderer.render(p,se.viewer.camera,e,!1):se.viewer.renderer.render(p,se.viewer.camera),se.viewer.renderer.state.buffers.stencil.setTest(!1))},this.isClipTransformControlSelected=function(){return!!se.clipTransRotControl&&se.clipTransRotControl.isSelected()},this.setClipTransControlMode=function(e){se.clipModeState=e=void 0===e||"translate"!==e&&"rotate"!==e?"both":e;for(var t=0;t=r.customComments.length?null:r.customComments[e]},this.setCommentVisible=function(e,t){null==e||null==t||e<0||e>=r.customComments.length||null!=t&&(r.customComments[e].visible=t,r.viewer.render())},this.removeComment=function(e){null==e||e<0||e>=r.customComments.length||(r.customComments.splice(e,1),r.viewer.render())},this.removeAllComments=function(){var e=r.customComments.length;r.customComments.splice(0,e),r.viewer.render()},this.get2dPoint=function(e){var e=(new THREE.Vector3).copy(e),t=(e.project(r.viewer.camera),r.viewer.container.offsetWidth/2),n=r.viewer.container.offsetHeight/2;return{x:Math.round(e.x*t+t),y:Math.round(-e.y*n+n)}},this.setAllCommentsVisible=function(e){if(null!=e){for(var t=0;tMath.abs(t.z))&&(this.activePlane=this.planes.XZ),"Y"===e&&(this.activePlane=this.planes.XY,Math.abs(t.x)>Math.abs(t.z))&&(this.activePlane=this.planes.YZ),"Z"===e&&(this.activePlane=this.planes.XZ,Math.abs(t.x)>Math.abs(t.y))&&(this.activePlane=this.planes.YZ),"XYZ"===e&&(this.activePlane=this.planes.XYZE),"XY"===e&&(this.activePlane=this.planes.XY),"YZ"===e&&(this.activePlane=this.planes.YZ),"XZ"===e&&(this.activePlane=this.planes.XZ)},this.init()}function Fn(e){Dn.call(this);var t=new THREE.BufferGeometry,n=new Float32Array([-.1,0,0,0,.3,0,0,0,-.1,0,0,-.1,0,.3,0,.1,0,0,.1,0,0,0,.3,0,0,0,.1,0,0,.1,0,.3,0,-.1,0,0,-.1,0,0,0,-.3,0,0,0,-.1,0,0,-.1,0,-.3,0,.1,0,0,.1,0,0,0,-.3,0,0,0,.1,0,0,.1,0,-.3,0,-.1,0,0]),i=(t.addAttribute("position",new THREE.BufferAttribute(n,3)),new THREE.MeshBasicMaterial({color:16711680}));new THREE.Mesh(t,i).position.set(.5,0,0),t.addAttribute("position",new THREE.BufferAttribute(n,3)),(i=new THREE.Mesh(t,new y({color:16711680}))).scale.set(.5,.5,.5),i.position.set(0,0,.5),(n=new THREE.Mesh(t,new y({color:65280}))).scale.set(.5,.5,.5),n.rotateZ(Math.PI/2),n.position.set(0,0,.5);(t=new THREE.Mesh(t,new y({color:255}))).scale.set(.5,.5,.5),t.position.set(.5,0,0);var r=e?2*Math.PI:Math.PI;this.handleGizmos={X:[[new THREE.Mesh(new THREE.TorusGeometry(.5,.01,10,40,r),new y({color:16711680})),[0,0,0],[0,-Math.PI/2,-Math.PI/2]],[i]],Y:[[new THREE.Mesh(new THREE.TorusGeometry(.5,.01,10,40,Math.PI),new y({color:65280})),[0,0,0],[Math.PI/2,0,0]],[n]],Z:[[new THREE.Mesh(new THREE.TorusGeometry(.5,.01,10,40,Math.PI),new y({color:255})),[0,0,0],[0,0,-Math.PI/2]],[t]],XYZE:[[new THREE.Line(new function(e,t,n){var i=new THREE.BufferGeometry,r=[];n=n||1;for(var o=0;o<=64*n;++o)"x"===t&&r.push(0,Math.cos(o/32*Math.PI)*e,Math.sin(o/32*Math.PI)*e),"y"===t&&r.push(Math.cos(o/32*Math.PI)*e,0,Math.sin(o/32*Math.PI)*e),"z"===t&&r.push(Math.sin(o/32*Math.PI)*e,Math.cos(o/32*Math.PI)*e,0);return i.addAttribute("position",new THREE.Float32BufferAttribute(r,3)),i}(.5,"z",1),new E({color:7895160}))]]},this.pickerGizmos={X:[[new THREE.Mesh(new THREE.TorusGeometry(.5,.12,4,12,r),di),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new THREE.Mesh(new THREE.TorusGeometry(.5,.12,4,12,Math.PI),di),[0,0,0],[Math.PI/2,0,0]]],Z:[[new THREE.Mesh(new THREE.TorusGeometry(.5,.12,4,12,Math.PI),di),[0,0,0],[0,0,-Math.PI/2]]],XYZE:[[new THREE.Mesh(new THREE.Geometry)]]},this.setActivePlane=function(e){"E"===e&&(this.activePlane=this.planes.XYZE),"X"===e&&(this.activePlane=this.planes.YZ),"Y"===e&&(this.activePlane=this.planes.XZ),"Z"===e&&(this.activePlane=this.planes.XY)},this.update=function(e,t){Dn.prototype.update.apply(this,arguments);this.handles,this.pickers;var n=new THREE.Matrix4,i=new THREE.Euler(0,0,1),r=new THREE.Quaternion,o=new THREE.Vector3(1,0,0),a=new THREE.Vector3(0,1,0),s=new THREE.Vector3(0,0,1),l=new THREE.Quaternion,d=new THREE.Quaternion,c=new THREE.Quaternion,h=t.clone();i.copy(this.planes.XY.rotation),r.setFromEuler(i),n.makeRotationFromQuaternion(r).getInverse(n),h.applyMatrix4(n),this.traverse(function(e){r.setFromEuler(i),"X"===e.name&&(l.setFromAxisAngle(o,Math.atan2(-h.y,h.z)),r.multiplyQuaternions(r,l),e.quaternion.copy(r)),"Y"===e.name&&(d.setFromAxisAngle(a,Math.atan2(h.x,h.z)),r.multiplyQuaternions(r,d),e.quaternion.copy(r)),"Z"===e.name&&(c.setFromAxisAngle(s,Math.atan2(h.y,h.x)),r.multiplyQuaternions(r,c),e.quaternion.copy(r))})},this.showAxis=function(e,t){if(void 0!==e&&""!==e)switch(e){case"x":this.handleGizmos.X[0][0].visible=t,this.handleGizmos.X[1][0].visible=t,this.pickerGizmos.X[0][0].visible=t;break;case"y":this.handleGizmos.Y[0][0].visible=t,this.handleGizmos.Y[1][0].visible=t,this.pickerGizmos.Y[0][0].visible=t;break;case"z":this.handleGizmos.Z[0][0].visible=t,this.handleGizmos.Z[1][0].visible=t,this.pickerGizmos.Z[0][0].visible=t;break;case"e":this.handleGizmos.XYZE[0][0].visible=t,this.pickerGizmos.XYZE[0][0].visible=t}},this.init(),e&&"translateX"==e[0]&&(this.showAxis("y",!1),this.showAxis("z",!1),this.showAxis("e",!1))}function Nn(){var n=this;THREE.Object3D.call(this),this._gizmoTranslate=new Hn,this._gizmoRotate=new Fn,this.add(this._gizmoTranslate),this.add(this._gizmoRotate),this._translatePickers=this._gizmoTranslate.pickers,this._rotatePickers=this._gizmoRotate.pickers,this.activePlane=this._gizmoTranslate.activePlane,this.highlight=function(e,t){"translate"==t?(this._gizmoRotate.highlight(null),this._gizmoTranslate.highlight(e)):"rotate"==t&&(this._gizmoTranslate.highlight(null),this._gizmoRotate.highlight(e))},this.setActivePlane=function(e,t){"translate"==n.pickType?(this._gizmoTranslate.setActivePlane(e,t),this.activePlane=this._gizmoTranslate.activePlane):"rotate"==n.pickType&&(this._gizmoRotate.setActivePlane(e,t),this.activePlane=this._gizmoRotate.activePlane)},this.update=function(e,t){this._gizmoTranslate.update(e,t),this._gizmoRotate.update(e,t)}}function jn(){Dn.call(this);var e=new THREE.BoxGeometry(.125,.125,.125),t=new THREE.Mesh(e);t.position.y=.5,t.updateMatrix(),e.applyMatrix(t.matrix);(t=new THREE.BufferGeometry).addAttribute("position",new THREE.Float32BufferAttribute([0,0,0,1,0,0],3));var n=new THREE.BufferGeometry,i=(n.addAttribute("position",new THREE.Float32BufferAttribute([0,0,0,0,1,0],3)),new THREE.BufferGeometry);i.addAttribute("position",new THREE.Float32BufferAttribute([0,0,0,0,0,1],3)),this.handleGizmos={X:[[new THREE.Mesh(e,new y({color:16711680})),[.5,0,0],[0,0,-Math.PI/2]],[new THREE.Line(t,new E({color:16711680}))]],Y:[[new THREE.Mesh(e,new y({color:65280})),[0,.5,0]],[new THREE.Line(n,new E({color:65280}))]],Z:[[new THREE.Mesh(e,new y({color:255})),[0,0,.5],[Math.PI/2,0,0]],[new THREE.Line(i,new E({color:255}))]],XYZ:[[new THREE.Mesh(new THREE.BoxGeometry(.125,.125,.125),new y({color:16777215,opacity:.25}))]]},this.pickerGizmos={X:[[new THREE.Mesh(new THREE.CylinderGeometry(.2,0,1,4,1,!1),di),[.6,0,0],[0,0,-Math.PI/2]]],Y:[[new THREE.Mesh(new THREE.CylinderGeometry(.2,0,1,4,1,!1),di),[0,.6,0]]],Z:[[new THREE.Mesh(new THREE.CylinderGeometry(.2,0,1,4,1,!1),di),[0,0,.6],[Math.PI/2,0,0]]],XYZ:[[new THREE.Mesh(new THREE.BoxGeometry(.4,.4,.4),di)]]},this.setActivePlane=function(e,t){var n=new THREE.Matrix4;t.applyMatrix4(n.getInverse(n.extractRotation(this.planes.XY.matrixWorld))),"X"===e&&(this.activePlane=this.planes.XY,Math.abs(t.y)>Math.abs(t.z))&&(this.activePlane=this.planes.XZ),"Y"===e&&(this.activePlane=this.planes.XY,Math.abs(t.x)>Math.abs(t.z))&&(this.activePlane=this.planes.YZ),"Z"===e&&(this.activePlane=this.planes.XZ,Math.abs(t.x)>Math.abs(t.y))&&(this.activePlane=this.planes.YZ),"XYZ"===e&&(this.activePlane=this.planes.XYZE)},this.init()}function _n(l,d,F,N,j){THREE.Object3D.call(this),d=void 0!==d?d:document,this.object=void 0,this.viewer=F,this.visible=!1,this.translationSnap=null,this.rotationSnap=null,this.space="world",this.size=.5,this.axis=null,this.pickType=null,this.newPosition=new THREE.Vector3,this.down=!1,this.opBall=N,this.piovtDir=null;var _,c=this,r="translate",i=!1,o={translate:new Hn(j),rotate:new Fn(j),both:new Nn,scale:new jn};for(_ in o){var V=o[_];V.visible=_===r,this.add(V)}var a={type:"change"},k={type:"mouseDown"},U={type:"mouseUp",mode:r},G=(document.createEvent("HTMLEvents").initEvent("mousemove",!0,!0),{type:"objectChange"}),z=new THREE.Raycaster,W=new THREE.Vector2,n=new THREE.Vector3,s=new THREE.Vector3,Y=new THREE.Vector3,h=0,u=0,e=new THREE.Vector3,t=new THREE.Vector3,p=1,X=new THREE.Matrix4,f=new THREE.Vector3,m=new THREE.Matrix4,g=new THREE.Vector3,v=new THREE.Quaternion,A=new THREE.Vector3(1,0,0),y=new THREE.Vector3(0,1,0),E=new THREE.Vector3(0,0,1),M=new THREE.Quaternion,w=new THREE.Quaternion,b=new THREE.Quaternion,x=new THREE.Quaternion,I=new THREE.Quaternion,T=new THREE.Quaternion,S=new THREE.Vector3,Q=new THREE.Vector3,B=new THREE.Vector3,Z=new THREE.Matrix4,P=new THREE.Matrix4,C=new THREE.Vector3(1,1,1),R=new THREE.Vector3,q=new THREE.Euler,O=new THREE.Matrix4,K=new THREE.Vector3,J=new THREE.Euler;function L(e){var t,n;_e.enableBroadcast&&!_e.broadcastMajor||void 0===c.object||!0===i||void 0!==e.button&&0!==e.button||c.down||(n=e.changedTouches?e.changedTouches[0]:e,t=null,"both"!=r?t=H(n,o[r].pickers.children):(t=H(n,o[r]._rotatePickers.children))?c.pickType="rotate":(t=H(n,o[r]._translatePickers.children))&&(c.pickType="translate"),n=null,t&&(n=t.object.name,e.preventDefault()),c.axis!==n&&(c.axis=n,c.update(),c.dispatchEvent(a)))}function $(e){var t,n;_e.enableBroadcast&&!_e.broadcastMajor||(e.offsetX||(e.clientX,this.viewer.container.getBoundingClientRect().left),e.offsetY||(e.clientY,this.viewer.container.getBoundingClientRect().top),e.srcElement&&e.srcElement!==this&&(e.clientX,this.viewer.container.getBoundingClientRect().left,e.clientY,this.viewer.container.getBoundingClientRect().top),null==e.srcElement&&e.target&&e.target!==this&&(e.clientX,this.viewer.container.getBoundingClientRect().left,e.clientY,this.viewer.container.getBoundingClientRect().top),void 0===c.object)||!0===i||void 0!==e.button&&0!==e.button||(0!==(t=e.changedTouches?e.changedTouches[0]:e).button&&void 0!==t.button||(n=null,"both"!=r?(n=H(t,o[r].pickers.children))&&(c.pickType=r):(n=H(t,o[r]._rotatePickers.children))?c.pickType="rotate":(n=H(t,o[r]._translatePickers.children))&&(c.pickType="translate"),n?(e.preventDefault(),e.stopPropagation(),c.dispatchEvent(k),c.axis=n.object.name,c.down=!0,c.update(),f.copy(K).sub(R).normalize(),o[r].setActivePlane(c.axis,f),(e=H(t,[o[r].activePlane]))&&(S.copy(c.object.position),Q.copy(c.object.position),B.copy(c.object.scale),Z.extractRotation(c.object.matrix),O.extractRotation(c.object.matrixWorld),c.object.parent&&(P.extractRotation(c.object.parent.matrixWorld),C.setFromMatrixScale(m.getInverse(c.object.parent.matrixWorld))),s.copy(e.point))):(c.axis=null,c.update(),c.down=!1,c.pickType="default",c.dispatchEvent(a))),i=!0)}function ee(){"translate"===r||"translate"==c.pickType?(n.sub(s),"local"===c.space&&(c.piovtDir?n.projectOnVector(c.piovtDir):(-1===c.axis.search("X")&&(n.x=0),-1===c.axis.search("Y")&&(n.y=0),-1===c.axis.search("Z")&&(n.z=0)),c.object.position.copy(S),c.object.position.add(n),(Y=c.object.position.clone()).sub(Q),c.newPosition=c.object.position.clone(),Q.copy(c.newPosition)),"world"!==c.space&&-1===c.axis.search("XYZ")||(-1===c.axis.search("X")&&(n.x=0),-1===c.axis.search("Y")&&(n.y=0),-1===c.axis.search("Z")&&(n.z=0),n.applyMatrix4(m.getInverse(P)),c.object.position.copy(S),c.object.position.add(n)),null!==c.translationSnap&&("local"===c.space&&c.object.position.applyMatrix4(m.getInverse(O)),-1!==c.axis.search("X")&&(c.object.position.x=Math.round(c.object.position.x/c.translationSnap)*c.translationSnap),-1!==c.axis.search("Y")&&(c.object.position.y=Math.round(c.object.position.y/c.translationSnap)*c.translationSnap),-1!==c.axis.search("Z")&&(c.object.position.z=Math.round(c.object.position.z/c.translationSnap)*c.translationSnap),"local"===c.space)&&c.object.position.applyMatrix4(O)):"scale"===r?(n.sub(s),n.multiply(C),"local"===c.space&&("XYZ"===c.axis?(p=1+n.y/Math.max(B.x,B.y,B.z),c.object.scale.x=B.x*p,c.object.scale.y=B.y*p,c.object.scale.z=B.z*p):(n.applyMatrix4(m.getInverse(O)),"X"===c.axis&&(c.object.scale.x=B.x*(1+n.x/B.x)),"Y"===c.axis&&(c.object.scale.y=B.y*(1+n.y/B.y)),"Z"===c.axis&&(c.object.scale.z=B.z*(1+n.z/B.z))))):"rotate"!==r&&"rotate"!=c.pickType||(n.sub(R),n.multiply(C),g.copy(s).sub(R),g.multiply(C),"E"===c.axis?(n.applyMatrix4(m.getInverse(X)),g.applyMatrix4(m.getInverse(X)),e.set(Math.atan2(n.z,n.y),Math.atan2(n.x,n.z),Math.atan2(n.y,n.x)),t.set(Math.atan2(g.z,g.y),Math.atan2(g.x,g.z),Math.atan2(g.y,g.x)),v.setFromRotationMatrix(m.getInverse(P)),I.setFromAxisAngle(f,e.z-t.z),M.setFromRotationMatrix(O),v.multiplyQuaternions(v,I),v.multiplyQuaternions(v,M),c.object.quaternion.copy(v)):"XYZE"===c.axis?(I.setFromEuler(n.clone().cross(g).normalize()),v.setFromRotationMatrix(m.getInverse(P)),w.setFromAxisAngle(I,-n.clone().angleTo(g)),M.setFromRotationMatrix(O),v.multiplyQuaternions(v,w),v.multiplyQuaternions(v,M),c.object.quaternion.copy(v)):"local"===c.space?(n.applyMatrix4(m.getInverse(O)),g.applyMatrix4(m.getInverse(O)),e.set(Math.atan2(n.z,n.y),Math.atan2(n.x,n.z),Math.atan2(n.y,n.x)),t.set(Math.atan2(g.z,g.y),Math.atan2(g.x,g.z),Math.atan2(g.y,g.x)),M.setFromRotationMatrix(Z),null!==c.rotationSnap?(w.setFromAxisAngle(A,Math.round((e.x-t.x)/c.rotationSnap)*c.rotationSnap),b.setFromAxisAngle(y,Math.round((e.y-t.y)/c.rotationSnap)*c.rotationSnap),x.setFromAxisAngle(E,Math.round((e.z-t.z)/c.rotationSnap)*c.rotationSnap)):(w.setFromAxisAngle(A,e.x-t.x),b.setFromAxisAngle(y,e.y-t.y),x.setFromAxisAngle(E,e.z-t.z)),"X"===c.axis&&M.multiplyQuaternions(M,w),"Y"===c.axis&&M.multiplyQuaternions(M,b),"Z"===c.axis&&M.multiplyQuaternions(M,x),c.object.quaternion.copy(M)):"world"===c.space&&(e.set(Math.atan2(n.z,n.y),Math.atan2(n.x,n.z),Math.atan2(n.y,n.x)),t.set(Math.atan2(g.z,g.y),Math.atan2(g.x,g.z),Math.atan2(g.y,g.x)),v.setFromRotationMatrix(m.getInverse(P)),null!==c.rotationSnap?(w.setFromAxisAngle(A,Math.round((e.x-t.x)/c.rotationSnap)*c.rotationSnap),b.setFromAxisAngle(y,Math.round((e.y-t.y)/c.rotationSnap)*c.rotationSnap),x.setFromAxisAngle(E,Math.round((e.z-t.z)/c.rotationSnap)*c.rotationSnap)):(w.setFromAxisAngle(A,e.x-t.x),b.setFromAxisAngle(y,e.y-t.y),x.setFromAxisAngle(E,e.z-t.z)),M.setFromRotationMatrix(O),"X"===c.axis&&v.multiplyQuaternions(v,w),"Y"===c.axis&&v.multiplyQuaternions(v,b),"Z"===c.axis&&v.multiplyQuaternions(v,x),v.multiplyQuaternions(v,M),c.object.quaternion.copy(v))),c.update(),c.dispatchEvent(a),c.dispatchEvent(G)}function te(e){var t;_e.enableBroadcast&&!_e.broadcastMajor||void 0===c.object||null===c.axis||!1===i||void 0!==e.button&&0!==e.button||!1!==(t=H(e.changedTouches?e.changedTouches[0]:e,[o[r].activePlane]))&&(e.preventDefault(),e.stopPropagation(),n.copy(t.point),ee())}function D(e){_e.enableBroadcast&&!_e.broadcastMajor||(e.preventDefault(),void 0!==e.button&&0!==e.button)||(i&&null!==c.axis&&(U.mode=r,c.dispatchEvent(U)),i=!1,c.down=!1,"TouchEvent"in window&&e instanceof TouchEvent?(c.axis=null,c.update(),c.dispatchEvent(a)):L(e))}function H(e,t){var n=d.getBoundingClientRect(),i=n.width,r=n.height,i=(null!=d.clientWidth&&null!=d.clientHeight&&(10e;){var t=this.boxInfos[0].textBox.children[1];"sectionCross"==t.className&&this.MeasureOper.sectionCrossend.apply(t,[])}},Me.prototype.setMeasureVisible=function(e){this.rootObject&&(this.rootObject.visible=e);for(var t=0,n=this.boxInfos.length;t
"+Se.translateString("MEASURE_APP_AXISNOPARALLELLINE_2")+"
",this.prompt.style.height=2*i+"px";break;case ve.INFOTYPE.NOBREPNOPLNE:n=Se.translateString("MEASURE_APP_NOBREPNOPLNE")}else switch(e){case ve.INFOTYPE.POINT:n=Se.translateString("MEASURE_POINT");break;case ve.INFOTYPE.COORDINATEPOINT:n=Se.translateString("MEASURE_COORDINATEPOINT");break;case ve.INFOTYPE.SECONDPOINT:n=_e.inBIMContext?Se.translateString("MEASURE_BIM_SECONDPOINT"):Se.translateString("MEASURE_SECONDPOINT");break;case ve.INFOTYPE.THIRDPOINT:n=_e.inBIMContext?Se.translateString("MEASURE_BIM_THIRDPOINT"):Se.translateString("MEASURE_THIRDPOINT");break;case ve.INFOTYPE.POINTLINE:n=Se.translateString("MEASURE_POINTLINE");break;case ve.INFOTYPE.LINE:n=Se.translateString("MEASURE_LINE");break;case ve.INFOTYPE.LINEANDCIRCLE:n=Se.translateString("MEASURE_LINEANDCIRCLE");break;case ve.INFOTYPE.POINTPLANE:n=Se.translateString("MEASURE_POINTPLANE");break;case ve.INFOTYPE.PLANE:n=Se.translateString("MEASURE_PLANE");break;case ve.INFOTYPE.FIRSTLINE:n=Se.translateString("MEASURE_FIRSTLINE");break;case ve.INFOTYPE.SECONDLINE:n=Se.translateString("MEASURE_SECONDLINE");break;case ve.INFOTYPE.LINEPLANE:n=Se.translateString("MEASURE_LINEPLANE");break;case ve.INFOTYPE.PARALLELLINE:n=Se.translateString("MEASURE_PARALLELLINE");break;case ve.INFOTYPE.FIRSTPARALLELPLANE:n=Se.translateString("MEASURE_FIRSTPARALLELPLANE");break;case ve.INFOTYPE.PARALLELPLANE:n=Se.translateString("MEASURE_PARALLELPLANE");break;case ve.INFOTYPE.CIRCLE:n=this.viewer.is2DModel?Se.translateString("MEASURE_2D_CIRCLE"):Se.translateString("MEASURE_CIRCLE");break;case ve.INFOTYPE.CIRCLEA:n=this.viewer.is2DModel?Se.translateString("MEASURE_2D_CIRCLEA"):Se.translateString("MEASURE_CIRCLEA");break;case ve.INFOTYPE.SECONDCIRCLE:n=this.viewer.is2DModel?Se.translateString("MEASURE_2D_SECONDCIRCLE"):Se.translateString("MEASURE_SECONDCIRCLE");break;case ve.INFOTYPE.SECONDPLANE:n=Se.translateString("MEASURE_SECONDPLANE");break;case ve.INFOTYPE.FIRSTPLANE:n=Se.translateString("MEASURE_FIRSTPLANE");break;case ve.INFOTYPE.AXISLINE:n=this.viewer.is2DModel?Se.translateString("MEASURE_2D_AXISLINE"):Se.translateString("MEASURE_AXISLINE");break;case ve.INFOTYPE.AXISPOINT:n=this.viewer.is2DModel?Se.translateString("MEASURE_2D_AXISPOINT"):Se.translateString("MEASURE_AXISPOINT");break;case ve.INFOTYPE.AXIS:n=Se.translateString("MEASURE_AXIS");break;case ve.INFOTYPE.AXISPLANE:n=Se.translateString("MEASURE_AXISPLANE");break;case ve.INFOTYPE.FACE:n=Se.translateString("MEASURE_FACE");break;case ve.INFOTYPE.CIRCLEANDLINE:n="
"+Se.translateString("MEASURE_CIRCLEANDLINE_1")+"
"+Se.translateString("MEASURE_CIRCLEANDLINE_2")+"
",this.prompt.style.height=2*i+"px";break;case ve.INFOTYPE.FIRSTPOINT:n=_e.inBIMContext?Se.translateString("MEASURE_FIRSTPOINT_BIM"):Se.translateString("MEASURE_FIRSTPOINT");break;case ve.INFOTYPE.BODY:n=Se.translateString("MEASURE_BODY");break;case ve.INFOTYPE.LINEPOSITION:n=Se.translateString("MEASURE_LINEPOSITION");break;case ve.INFOTYPE.ENDMEASURE:n=Se.translateString("MEASURE_ENDMEASURE");break;case ve.INFOTYPE.CANCELLINE:n="
"+Se.translateString("MEASURE_CANCELLINE_1")+"
"+Se.translateString("MEASURE_CANCELLINE_2")+"
",this.prompt.style.height=2*i+"px";break;case ve.INFOTYPE.LINENOPARALLEL:n="
"+Se.translateString("MEASURE_LINENOPARALLEL_1")+"
"+Se.translateString("MEASURE_LINENOPARALLEL_2")+"
",this.prompt.style.height=2*i+"px";break;case ve.INFOTYPE.PLANENOPARALLEL:n="
"+Se.translateString("MEASURE_PLANENOPARALLEL_1")+"
"+Se.translateString("MEASURE_PLANENOPARALLEL_2")+"
",this.prompt.style.height=2*i+"px";break;case ve.INFOTYPE.NOTFACE:n="
"+Se.translateString("MEASURE_NOTFACE_1")+"
"+Se.translateString("MEASURE_NOTFACE_2")+"
",this.prompt.style.height=2*i+"px";break;case ve.INFOTYPE.NOTFACESECOND:n="
"+Se.translateString("MEASURE_NOTFACESECOND_1")+"
"+Se.translateString("MEASURE_NOTFACESECOND_2")+"
",this.prompt.style.height=2*i+"px";break;case ve.INFOTYPE.NOTFACEPARALLEL:n="
"+Se.translateString("MEASURE_NOTFACEPARALLEL_1")+"
"+Se.translateString("MEASURE_NOTFACEPARALLEL_2")+"
",this.prompt.style.height=2*i+"px";break;case ve.INFOTYPE.AXISNOPARALLEL:n="
"+Se.translateString("MEASURE_AXISNOPARALLEL_1")+"
"+Se.translateString("MEASURE_AXISNOPARALLEL_2")+"
",this.prompt.style.height=2*i+"px";break;case ve.INFOTYPE.MOUSEENTER:n=Se.translateString("MEASURE_MOUSEENTER");break;case ve.INFOTYPE.CROSSENTER:n=Se.translateString("MEASURE_CROSSENTER");break;case ve.INFOTYPE.NOBREP:n=Se.translateString("MEASURE_NOBREP");break;case ve.INFOTYPE.NOPARALLEL:n=Se.translateString("MEASURE_NOPARALLEL");break;case ve.INFOTYPE.INTERSECT:n="
"+Se.translateString("MEASURE_INTERSECT_1")+"
"+Se.translateString("MEASURE_INTERSECT_2")+"
",this.prompt.style.height=2*i+"px";break;case ve.INFOTYPE.LINEPARALLEL:n="
"+Se.translateString("MEASURE_LINEPARALLEL_1")+"
"+Se.translateString("MEASURE_LINEPARALLEL_2")+"
",this.viewer.is2DModel&&(n="
"+Se.translateString("MEASURE_LINEPARALLEL_2D_1")+"
"+Se.translateString("MEASURE_LINEPARALLEL_2D_2")+"
"),this.prompt.style.height=2*i+"px";break;case ve.INFOTYPE.PLANEPARALLELLINE:n="
"+Se.translateString("MEASURE_PLANEPARALLELLINE_1")+"
"+Se.translateString("MEASURE_PLANEPARALLELLINE_2")+"
",this.prompt.style.height=2*i+"px";break;case ve.INFOTYPE.LINEPARALLELPLANE:n="
"+Se.translateString("MEASURE_LINEPARALLELPLANE_1")+"
"+Se.translateString("MEASURE_LINEPARALLELPLANE_2")+"
",this.prompt.style.height=2*i+"px";break;case ve.INFOTYPE.PLANEPARALLEL:n="
"+Se.translateString("MEASURE_PLANEPARALLEL_1")+"
"+Se.translateString("MEASURE_PLANEPARALLEL_2")+"
",this.prompt.style.height=2*i+"px";break;case ve.INFOTYPE.TWOAXISNOPARALLEL:var r=this.viewer.is2DModel?Se.translateString("MEASURE_TWOAXISNOPARALLEL_2D_2"):Se.translateString("MEASURE_TWOAXISNOPARALLEL_2"),n="
"+Se.translateString("MEASURE_TWOAXISNOPARALLEL_1")+"
"+r+"
";this.prompt.style.height=2*i+"px";break;case ve.INFOTYPE.NOCONJOINT:n="
"+Se.translateString("MEASURE_NOCONJOINT_1")+"
"+Se.translateString("MEASURE_NOCONJOINT_2")+"
"+Se.translateString("MEASURE_NOCONJOINT_3")+"
",this.prompt.style.height=3*i+"px";break;case ve.INFOTYPE.NOCLOSE:n="
"+Se.translateString("MEASURE_NOCLOSE_1")+"
"+Se.translateString("MEASURE_NOCLOSE_2")+"
"+Se.translateString("MEASURE_NOCLOSE_3")+"
",this.prompt.style.height=3*i+"px";break;case ve.INFOTYPE.FIRMEASUREBODY:n=Se.translateString("MEASURE_FIRMEASUREBODY");break;case ve.INFOTYPE.SECMEASUREBODY:n=Se.translateString("MEASURE_SECMEASUREBODY");break;case ve.INFOTYPE.MEASUREBODY:n=Se.translateString("MEASURE_MEASUREBODY");break;case ve.INFOTYPE.TWOBODYPARALLEL:n="
"+Se.translateString("MEASURE_TWOBODYPARALLEL_1")+"
"+Se.translateString("MEASURE_TWOBODYPARALLEL_2")+"
",this.prompt.style.height=2*i+"px";break;case ve.INFOTYPE.TWOBODYNOTPARALLEL:n="
"+Se.translateString("MEASURE_TWOBODYNOTPARALLEL_1")+"
"+Se.translateString("MEASURE_TWOBODYNOTPARALLEL_2")+"
",this.prompt.style.height=2*i+"px";break;case ve.INFOTYPE.LOADDATE:n=Se.translateString("MEASURE_LOADDATE");break;case ve.INFOTYPE.CLICKFIRSTPOINT:n=Se.translateString("MEASURE_CLICKFIRSTPOINT");break;case ve.INFOTYPE.CLICKSECONDPOINT:n=Se.translateString("MEASURE_CLICKSECONDPOINT");break;case ve.INFOTYPE.PROJECTPLANE:n=Se.translateString("MEASURE_PROJECTPLANE");break;case ve.INFOTYPE.SELECTPROJECTPLANE:n=Se.translateString("MEASURE_SELECTPROJECTPLANE");break;case ve.INFOTYPE.PLACELINELOCATION:n=Se.translateString("MEASURE_PLACELINELOCATION");break;case ve.INFOTYPE.SELECTPLACELINELOCATION:n=Se.translateString("MEASURE_SELECTPLACELINELOCATION");break;case ve.INFOTYPE.FIRSTMESH:n=Se.translateString("MEASURE_FIRSTMESH");break;case ve.INFOTYPE.SECONDMESH:n=Se.translateString("MEASURE_SECONDMESH");break;case ve.INFOTYPE.MESHVERTICAL:n=Se.translateString("MEASURE_MESHVERTICAL");break;case ve.INFOTYPE.AXISNOPARALLELLINE:n="
"+Se.translateString("MEASURE_AXISNOPARALLELLINE_1")+"
"+Se.translateString("MEASURE_AXISNOPARALLELLINE_2")+"
",this.prompt.style.height=2*i+"px";break;case ve.INFOTYPE.NOBREPNOPLNE:n=Se.translateString("MEASURE_NOBREPNOPLNE")}""==n||!_e.broadcastMajor&&_e.enableBroadcast?(this.prompt.style.display="none",this.prompt.innerHTML=n):(this.prompt.innerHTML=n,this.prompt.style.display="block",Se.isMobileDevice()&&(e=this.viewer.renderer.getSize().height/2-21+"px",this.prompt.style.top=e),this.InfoType>ve.INFOTYPE.MEASURENOTICEBEGIN?this.prompt.style.color="#ff7d2c":Se.isMobileDevice()?this.prompt.style.color="rgba(27,27,27,1)":this.prompt.style.color="rgba(51,51,51,1)",e=2e3,(t=this).InfoType>ve.INFOTYPE.MEASURENOTICEBEGIN&&(e=3e3),Se.isMobileDevice()&&(this.Popup=setTimeout(function(){t.prompt.style.display="none"},e)))}},Me.prototype.setMeasureType=function(e){switch(""!=e&&this.viewer.hasBrepFile()?this.showMouseZoomArea=!0:this.showMouseZoomArea=!1,this.measureType=e,this.viewer.brepInfo.BfacePerimeter||"facePerimeter"!=this.measureType||(this.measureType="Base"),_e.enableBroadcast&&!_e.broadcastMajor&&this.viewer.dispatchEvent({type:"FaceSelectionChangeEvent"}),this.viewer.selectionManager.clearSelection(),this.viewer.onOpChanged({id:"MeasureType"}),this.MeasureOper.OperatorEnd(),this.measureType){case"bodyDistance":case"PointToLine":case"PointToFace":case"AxisToPoint":case"LineToLine":case"LineToFace":case"faceDist":case"AxisToLine":case"AxisToFace":case"holeDist":case"pt2pt":case"pt2ptbim":"Distance"!=this.MeasureOper.measureClass&&(this.MeasureOper=new ln(this));break;case"radius":"Hole"!=this.MeasureOper.measureClass&&(this.MeasureOper=new dn(this));break;case"measureEdges":case"bodyEdgeLength":"Edge"!=this.MeasureOper.measureClass&&(this.MeasureOper=new cn(this));break;case"facePerimeter":case"faceArea":"Face"!=this.MeasureOper.measureClass&&(this.MeasureOper=new hn(this));break;case"bodyAngle":case"LineAngle":case"LineFaceAngle":case"faceAngle":case"angle":"Angle"!=this.MeasureOper.measureClass&&(this.MeasureOper=new r(this));break;case"BodyArea":case"BodyVolume":case"bodyBoundingBox":case"TotalArea":case"TotalVolume":case"BoundingBox":"BodyAndTotal"!=this.MeasureOper.measureClass&&(this.MeasureOper=new un(this));break;case"coordinate":"Coordinate"!=this.MeasureOper.measureClass&&(this.MeasureOper=new pn(this));break;case"Lineargauge":"Lineargauge"!=this.MeasureOper.measureClass&&(this.MeasureOper=new fn(this));break;case"LmPt2Pt":case"LmPt2Line":case"LmLine2Line":case"LmHole2Hole":case"LmAxis2Pt":case"LmAxis2Line":"Lineargauge3D"!=this.MeasureOper.measureClass&&(this.MeasureOper=new o(this)),this.MeasureOper.OperatorClear(this.measureType);break;case"contour":case"contourarea":"Contour"!=this.MeasureOper.measureClass&&(this.MeasureOper=new wn(this));break;case"thickness":"Wall"!=this.MeasureOper.measureClass&&(this.MeasureOper=new bn(this));break;case"faceThickness":"Thickness"!=this.MeasureOper.measureClass&&(this.MeasureOper=new Tn(this));break;case"WallThickness":"WallThickness"!=this.MeasureOper.measureClass&&(this.MeasureOper=new a(this));break;default:"Base"!=this.MeasureOper.measureClass&&(this.MeasureOper=new h(this))}"Base"!=this.MeasureOper.measureClass&&!this.viewer.hasBrepInfo()&&this.viewer.hasBrepFile()?this.PostInfo(ve.INFOTYPE.LOADDATE):!this.viewer.hasBrepFile()&&this.measureType&&"pt2pt"!=this.measureType&&"pt2ptbim"!=this.measureType&&"angle"!=this.measureType&&"LmPt2Pt"!=this.measureType&&"BoundingBox"!=this.measureType&&"bodyBoundingBox"!=this.measureType||"facePerimeter"==e&&this.viewer.brepInfo&&!this.viewer.brepInfo.BfacePerimeter||"BodyArea"==e&&this.viewer.brepInfo&&!this.viewer.brepInfo.BbodyArea||("BodyVolume"==e||"TotalVolume"==e)&&this.viewer.brepInfo&&!this.viewer.brepInfo.BbodyVolume||"faceArea"==e&&this.viewer.brepInfo&&!this.viewer.brepInfo.BfaceArea||"TotalArea"==e&&this.viewer.brepInfo&&!this.viewer.brepInfo.BtotalArea?this.PostInfo(ve.INFOTYPE.NOBREP):this.MeasureOper.OperatorStart(this.measureType),this.prompt&&!Se.isMobileDevice()&&(this.prompt.style.display="none"),Se.isMobileDevice()&&(this.hasMouseZoomArea?this.createMouseZoomArea():this.createZoomArea()),this.render()},Me.prototype.setPointScale=function(e,t){t=this.getScale(e,t);e.scale.x=t,e.scale.y=t,e.scale.z=t,e.updateMatrixWorld()},Me.prototype.setCylinderScale=function(e,t){Se.isMobileDevice()&&(t*=1.5);t=this.getScale(e,t);e.scale.x=t,e.scale.y=t,e.scale.z=t,e.oldPosition&&e.offsetPos&&e.position.addVectors(e.oldPosition,e.offsetPos.clone().multiplyScalar(t)),e.updateMatrixWorld()},Me.prototype.setResolution=function(e){var t=this.viewer.renderer.getPixelRatio(),n=this.viewer.renderer.domElement.width/t,t=this.viewer.renderer.domElement.height/t;e.material.resolution.set(n,t)},Me.prototype.getScale=function(e,t){var n=5,t=(null!=t&&(n=t),this.viewer.camera.getCameraTarget()),i=this.viewer.camera.position,r=new THREE.Vector3,t=(r.subVectors(t,i),e.position.clone()),e=this.viewer.camera.isPerspective?t.sub(i).dot(r.normalize()):r.length(),t=this.viewer.camera.fov,i=2*e*Math.tan(THREE.Math.degToRad(.5*t)),r=this.viewer.renderer.domElement.height;return n*i*this.viewer.renderer.getPixelRatio()/r},Me.prototype.renderScale=function(e){for(var t=0;t=n.x/2&&n.y>=-n.x/2?(l.childNodes[1].style.left="calc(50% - 6px)",l.childNodes[1].style.top="-5.5px",l.setAttribute("mobile","down")):n.y>n.x/2&&n.y<-n.x/2?(l.childNodes[1].style.left="calc(100% - 4px)",l.childNodes[1].style.top="calc(50% - 5.5px)",l.setAttribute("mobile","right")):n.y-n.x/2&&(l.childNodes[1].style.left="-5.5px",l.childNodes[1].style.top="calc(50% - 5.5px)",l.setAttribute("mobile","left")),l.setAttribute("group",t[e[2]].uuid),l.setAttribute("lineInfo",e[2])):(l.childNodes[1].style.left="calc(50% - 6px)",l.childNodes[1].style.top="calc(100% - 5.5px)",l.setAttribute("mobile","up"),l.setAttribute("group",e[2]))),o.textBox=l}return o}var h=this,u=[];if(e){var n=0;for(n=0;nn&&(n=this.lMouseUp.x),this.lMouseUp.yr&&(r=this.lMouseUp.y),this.selectRect(e,i,n,r),this.viewer.logOperatorTime&&this.viewer.logOperatorTimeShow("[框选-高亮]",t)},Zn.prototype.onTouchSingleStart=function(e){e.preventDefault(),g.prototype.onTouchSingleStart.call(this,e)},Zn.prototype.onTouchSingleMove=function(e){e.preventDefault();e=this.viewer.renderer.getPixelRatio();this.drawRectangle(this.singleTouchStartPos.x*e,this.singleTouchStartPos.y*e,this.pointer.x*e,this.pointer.y*e)},Zn.prototype.onTouchSingleEnd=function(e){var t=Date.now(),e=(e.preventDefault(),g.prototype.onTouchSingleEnd.call(this,e),this.clearCanvas2D(),this.singleTouchStartPos.x),n=this.singleTouchStartPos.x,i=this.singleTouchStartPos.y,r=this.singleTouchStartPos.y;this.singleTouchEndPos.xn&&(n=this.singleTouchEndPos.x),this.singleTouchEndPos.yr&&(r=this.singleTouchEndPos.y),this.selectRect(e,i,n,r),this.viewer.logOperatorTime&&this.viewer.logOperatorTimeShow("[框选-高亮]",t)},function(e){var t=e.viewer,n=t.camera,i=e.objects,r=e.domElement,o=e.group,a=null,s=(new THREE.Plane,new THREE.Raycaster),l=new THREE.Vector2,d=new THREE.Vector2,c=(new THREE.Vector3,null),h=!1,u=!0,p=!1,f=!1,m=!(this._enabled=!0),g=1,v=this;function A(e,t){if(e)switch(e){case"translate":v.setTransformEnable();break;case"rotate":v.setRotateEnable();break;case"both":v.setTransRotEnable()}Se.isMobileDevice()?(r.addEventListener("touchstart",E,!1),r.addEventListener("touchmove",M,!1),r.addEventListener("touchend",w,!1)):(r.addEventListener("mousemove",M,!1),r.addEventListener("mousedown",E,!1),r.addEventListener("mouseup",w,!1)),u?((a=new _(n,r,t)).setMode("translate"),a.setSpace("local"),o.add(a)):p?((a=new _(n,r,t)).setMode("rotate"),a.setSpace("local"),o.add(a)):f&&((a=new _(n,r,t)).setMode("both"),a.setSpace("local"),o.add(a)),v.setSize(g),m=!0}function y(){null!=a&&a.detach(a.object),Se.isMobileDevice()?(r.removeEventListener("touchstart",E,!1),r.removeEventListener("touchmove",M,!1),r.removeEventListener("touchend",w,!1)):(r.removeEventListener("mousemove",M,!1),r.removeEventListener("mousedown",E,!1),r.removeEventListener("mouseup",w,!1))}function E(e){h=!1,e.preventDefault(),e.stopPropagation();var t=e,e=(Se.isMobileDevice()&&0 0","#if ! defined( PHYSICAL ) && ! defined( PHONG )","vViewPosition = - mvPosition.xyz;","#endif","vec4 tempWorldPosition = modelMatrix * vec4( position, 1.0 );","vClippingWorldPosition = tempWorldPosition.xyz;","#endif"].join("\n"),["#if NUM_CLIPPING_PLANES > 0","#if ! defined( PHYSICAL ) && ! defined( PHONG )","varying vec3 vViewPosition;","#endif","varying vec3 vClippingWorldPosition;","#endif"].join("\n"),["#if NUM_CLIPPING_PLANES > 0 ","uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];","varying vec3 vClipPosition;","bvec2 checkClippingPlanes() {","bool isCut = false;","bool isCutEdge = false;","#if defined( STANDARD )","for (int i=0; i 0.0 );","if (!isCut) {","isCutEdge = isCutEdge || (abs(dotPlane) < abs(0.0012 * length(vViewPosition)));","}","}","#else","vec4 plane;","#pragma unroll_loop_start","for (int i=0; i plane.w ) isCut = true;","}","#pragma unroll_loop_end","#endif","return bvec2(isCut,isCutEdge);","}","#endif"].join("\n")),Jn=["#if NUM_CLIPPING_PLANES > 0 && !defined( NOCLIPPING )","bvec2 clipRetVec2NDS = checkClippingPlanes();","if (clipRetVec2NDS.x) discard;","#endif"].join("\n"),e=["#if NUM_CLIPPING_PLANES > 0","if(clipRetVec2NDS.y) gl_FragColor = vec4(0.8, 0.4, 0.298, 1.0);","#endif","}"].join("\n"),$n=(ei=THREE.ShaderChunk.meshphong_frag).lastIndexOf("}"),ei=ei.substr(0,$n)+e,$n=(ti=THREE.ShaderChunk.meshphysical_frag).lastIndexOf("}"),ti=ti.substr(0,$n)+e,ni=(["#if NUM_CLIPPING_PLANES > 0","for ( int i = 0; i < NUM_CLIPPING_PLANES; ++ i ) {","vec4 plane = clippingPlanes[ i ];","if ( dot( vViewPosition, plane.xyz ) > plane.w ) discard;","}","if (!gl_FrontFacing) {","gl_FragColor = vec4(0.8, 0.4, 0.298, 1.0);","return;","}","#endif"].join("\n"),{defines:{NUM_CLIPPING_PLANES_NDS:1},uniforms:{clipping:{color:{type:"c",value:new THREE.Color(16711680)},clippingPlaneNDS:{type:"v4v",value:[0,0,-1,0]}},caps:{color:{type:"c",value:new THREE.Color(.8,.4,.298)}}},vertex:["void main() {","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),vertexClipping:["varying vec4 worldPosition;","varying vec3 camPosition;","void main() {","worldPosition = modelMatrix * vec4( position, 1.0 );","camPosition = cameraPosition;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragment:["uniform vec3 color;","void main( void ) {","gl_FragColor = vec4( color , 1.0 );","}"].join("\n"),fragmentClippingFront:["uniform vec3 color;","uniform vec4 clippingPlaneNDS[NUM_CLIPPING_PLANES_NDS];","varying vec4 worldPosition;","varying vec3 camPosition;","void main() {","#if NUM_CLIPPING_PLANES_NDS > 0","for ( int i = 0; i < NUM_CLIPPING_PLANES_NDS; ++ i ) {","vec4 plane = clippingPlaneNDS[i];","if ( -dot( worldPosition.xyz, plane.xyz ) > plane.w && -dot( camPosition, plane.xyz ) > plane.w) discard;","else {","gl_FragColor = vec4( color , 1.0 );","}","}","#endif","}"].join("\n")}),ii={vertex:["void main() {","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragment:["uniform vec3 color;","uniform vec2 hatchParams;","uniform vec3 hatchTintColor;","uniform float hatchTintIntensity;","vec4 calculateHatchPattern(vec2 hatchParams, vec2 coord, vec4 fragColor, vec3 hatchTintColor, float hatchTintIntensity ) {","float hatchSlope = hatchParams.x;","float hatchPeriod = hatchParams.y;","if (abs(hatchSlope) <= 1.0) {","float hatchPhase = coord.y - hatchSlope * coord.x;","float dist = abs(mod((hatchPhase), (hatchPeriod)));","if (dist < 2.0) {","fragColor = vec4(0.0,0.0,0.0,1.0);","} else {","fragColor.xyz = mix(fragColor.xyz, hatchTintColor, hatchTintIntensity);","}","} else {","float hatchPhase = - coord.y / hatchSlope + coord.x;","float dist = abs(mod((hatchPhase), (hatchPeriod)));","if (dist < 1.0) {","fragColor = vec4(0.0,0.0,0.0,1.0);","} else {","fragColor.xyz = mix(fragColor.xyz, hatchTintColor, hatchTintIntensity);","}","}","return fragColor;","}","void main( void ) {","gl_FragColor = vec4( color , 1.0 );","gl_FragColor = calculateHatchPattern(hatchParams, gl_FragCoord.xy, gl_FragColor, hatchTintColor, hatchTintIntensity);","}"].join("\n")},ri=function(e,t,n){THREE.Mesh.call(this,e,t,!1),this.tempVector3=new THREE.Vector3,this.plane=n,this.planeVec=new THREE.Vector4(n.normal.x,n.normal.y,n.normal.z,n.constant),this.connectivity=[],this.outlines=[]},oi=(ri.prototype=Object.create(THREE.Mesh.prototype),(ri.prototype.constructor=ri).prototype.update=function(){this.plane.normal.set(0,0,-1),this.plane.normal.applyQuaternion(this.quaternion);var e=this.plane.normal,t=-1*this.getWorldPosition(this.tempVector3).dot(e);this.planeVec.set(e.x,e.y,e.z,t),this.plane.constant=t},function(e){this.manager=void 0!==e?e:THREE.DefaultLoadingManager}),ai=(oi.prototype={constructor:oi,load:function(e,t,n,i,r,o){var a=this,s="?time=",l=(0t.x||e.y>t.y||e.z>t.z||(h.viewer.controls.setBoundingBox(e,t),h.viewer.switchRotateCenterBySelection()))},this.onOpBall=function(){if(h.clipTransRotControl){var e=h.viewer.selectionManager.getSelectedleafObjects(!0),t=h.clipTransRotControl.getOffset(),n=h.clipTransRotControl.getRotateOffset(),i=(h.rotateAngle=h.clipTransRotControl.getRotateAngle(),t.clone());if(t.set(0,0,0),null==h.viewer.draggedObjects&&(h.viewer.draggedObjects=new Array),"translate"==h.clipTransRotControl.pickType){if(h.viewer.ndsModel)for(var r=0;rMath.PI/4?-1:1)*r.length(),r.y=0,r.z=0),this.viewer.dispatchEvent({type:"OpBallModel",position:{x:s(this.position.x)?0:this.position.x,y:s(this.position.y)?0:this.position.y,z:s(this.position.z)?0:this.position.z},angle:{x:s(this.angle.x)?0:this.angle.x,y:s(this.angle.y)?0:this.angle.y,z:s(this.angle.z)?0:this.angle.z},deltaAngle:{x:1!=o.length||this.piovtRotateDir?this.angle.x:180*i.x/Math.PI,y:1!=o.length||this.piovtRotateDir?this.angle.y:180*i.y/Math.PI,z:1!=o.length||this.piovtRotateDir?this.angle.z:180*i.z/Math.PI},deltaPosition:{x:r.x,y:r.y,z:r.z}}))},we.prototype.addDraggedObject=function(e){for(var t=0;tthis.x_2?[this.x_2,this.y_2,this.x_1,this.y_1]:[this.x_1,this.y_1,this.x_2,this.y_2];this.viewer.getPrintData("temp","A4","l","color","select",e)},pi.prototype.onMMouseDown=function(e){this.state=ve.MOUSE.MIDDLE,this.viewer.getPrintData("temp","A4","l","color",null,null)},pi.prototype.onRMouseDown=function(e){this.state=ve.MOUSE.RIGHT,this.viewer.getPrintData("temp","A4","l","color","view",null)},pi.prototype.onTouchSingleMove=function(e){},function(){function e(e){this.viewer=e;var t=void 0,n=void 0,i=new THREE.LoadingManager;Object.defineProperties(this,{cachedProperties:{get:function(){return t},set:function(e){t=e}},cachedPropertyFileName:{get:function(){return n},set:function(e){n=e}},loadingManager:{get:function(){return i}}})}var t=e.prototype;return t.getObjectProperty=function(e,i,r){function t(e){return 1===(e=e.split("/")).length?"./":(e.pop(),e.join("/")+"/")}var o=e.uuid,a=((e=this.viewer.getObjectByUUID(o)).refModelUri&&this.referenceMap&&this.referenceMap.has(o)&&(o=this.referenceMap.get(o)),e.propertyfile);if(null==a)null!=i&&i(null,r);else if(void 0!==this.cachedProperties&&this.cachedPropertyFileName==a&&null!=this.cachedProperties[o]&&null!=i)i(this.cachedProperties[o],r);else{var n=new oi(this.loadingManager),s=(n.setCrossOrigin("anonymous"),n.setResponseType("arraybuffer"),e.getModel()),l=t(s.modelUri);if(e.refModelUri&&this.referenceMap&&0=e.length?{done:!0}:{done:!1,value:e[n++]}};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function vi(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n=t.width-15&&i<=15,a=n<=15&&i>=t.height-15,n=n>=t.width-15&&i>=t.height-15;if((r||o||a||n)&&c.enableMove)c._isResizing=!0,c.onLMouseDown(e),c.startWidth=e.target.parentNode.children[0].offsetWidth,c.startHeight=e.target.parentNode.children[0].offsetHeight,c.stratLeft=parseInt(e.target.parentNode.style.left),c.startTop=parseInt(e.target.parentNode.style.top),c.startX=e.clientX,c.startY=e.clientY,c._currentTarget=e.target,r&&(c.cornerStyle=0),o&&(c.cornerStyle=1),a&&(c.cornerStyle=2),n&&(c.cornerStyle=3),r||n?d.style.cursor="nwse-resize":(o||a)&&(d.style.cursor="nesw-resize");else{c.enableMove&&(c._isDragging=!0);for(var s=0;s=r.width-15&&e<=15,i=t<=15&&e>=r.height-15,r=t>=r.width-15&&e>=r.height-15,d.style.cursor=t<=15&&e<=15||r?"nwse-resize":n||i?"nesw-resize":"default"),c.viewer.render()}),n.addEventListener("click",function(){for(var e=0;en.width?(n.style.height="160px",n.style.width=160*n.width/n.height+"px"):(n.style.height=160*n.height/n.width+"px",n.style.width="160px"),d.aspect=n.width/n.height,n.style.display="block",d.style.top="19px",d.style.left="56px","OpAnnotationNew"==c.viewer.getCurrentOperatorID()&&(c.viewer.dispatchEvent({type:"PicAdd",data:r}),c.viewer.dispatchEvent({type:"PicSelect",data:[]}))},n.onerror=function(){c.deleteNoteAnnotation(i)};for(var o=0;od.width?(d.style.height=t+"px",d.style.width=t*d.width/d.height+"px"):(d.style.height=t*d.height/d.width+"px",d.style.width=t+"px"),a.aspect=d.width/d.height,c.setPicTextVisible(n,!0)},d.addEventListener("mousemove",function(e){var t,n,i,r,o={clientX:e.clientX,clientY:e.clientY};c._isResizing&&c.state==ve.MOUSE.LEFT?(c.reSize(e),c.viewer.render()):(c._isDragging&&c.state==ve.MOUSE.LEFT?c.onLMouseMove(o):c.state==ve.MOUSE.LEFT?(o=e.clientX-c.viewer.container.getBoundingClientRect().left,r=e.clientY-c.viewer.container.getBoundingClientRect().top,c.pointer.set(o,r),g.prototype.onLMouseMove.call(c,e),c.pointerOld.set(o,r)):c.state==ve.MOUSE.MIDDLE?c.onMMouseMove(e):(o=a.getBoundingClientRect(),r=e.clientX-o.left,t=e.clientY-o.top,n=r>=o.width-20&&t<=20,i=r<=20&&t>=o.height-20,o=r>=o.width-20&&t>=o.height-20,a.style.cursor!=(r=r<=20&&t<=20||o?"nwse-resize":n||i?"nesw-resize":"default")&&(a.style.cursor=r,d.style.cursor=a.style.cursor)),Math.abs(c.startX-e.clientX)<3&&Math.abs(c.startY-e.clientY)<3||(c.update2DScene(),c.viewer.render()))}),d.addEventListener("mousewheel",function(e){c.onMouseWheel(e),c.viewer.render()}),d.addEventListener("mousedown",function(e){e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation(),c.startX=e.clientX,c.startY=e.clientY,c.onLMouseDown(e),c.selectID!=e.target.parentNode.id&&-1==c.selectIDs.indexOf(e.target.parentNode.id)||"NoteEdit"==c.mode||!c.enableMove||(c.oldmode=c.mode,c.mode="NoteMove",c.MoveTarget=e.target.parentNode);var t,n=e.target.parentNode,i=e.target.parentNode.getBoundingClientRect(),r=Math.abs(e.clientX-i.left),o=Math.abs(e.clientY-i.top),a=r<=20&&o<=20,s=r>=i.width-20&&o<=20,l=r<=20&&o>=i.height-20,r=r>=i.width-20&&o>=i.height-20;(a||s||l||r)&&c.enableMove?(c._isResizing=!0,c.onLMouseDown(e),c.startWidth=e.target.parentNode.children[0].offsetWidth,c.startHeight=e.target.parentNode.children[0].offsetHeight,c.stratLeft=parseInt(e.target.parentNode.style.left),c.startTop=parseInt(e.target.parentNode.style.top),c.startX=e.clientX,c.startY=e.clientY,c._currentTarget=e.target,a&&(c.cornerStyle=0),s&&(c.cornerStyle=1),l&&(c.cornerStyle=2),r&&(c.cornerStyle=3),a||r?t="nwse-resize":(s||l)&&(t="nesw-resize"),c.setMode("picNote")):(c._isDragging=!0,e.target.parentNode.style.zIndex=21,c._currentTarget=e.target,c.startX=e.clientX-e.target.parentNode.offsetLeft,c.startY=e.clientY-e.target.parentNode.offsetTop,t="default"),n.style.cursor!=t&&(n.style.cursor=t,d.style.cursor=n.style.cursor),n.readOnly=!1,n.focus(),n.blur()}),d.addEventListener("mouseup",function(e){e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation(),"NoteMove"==c.mode&&(c.mode=c.oldmode,"NoteMove"==c.mode&&(c.mode="normal"),e.target.readOnly=!1),c.onLMouseUp(e)}),d.addEventListener("click",function(e){e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation();for(var t,n,i=0;i=2*e.x&&e.y>=2*-e.x?(n.setAttribute("mobile","down"),n.style.left=parseInt((t.x-parseInt(n.childNodes[0].style.width)*this.dpr/2)/this.dpr)+"px",n.style.top=parseInt(t.y/this.dpr)+"px"):e.y>2*e.x&&e.y<2*-e.x?(n.setAttribute("mobile","right"),n.style.left=parseInt((t.x-parseInt(n.childNodes[0].style.width)*this.dpr)/this.dpr)+"px",n.style.top=parseInt((t.y-parseInt(n.childNodes[0].style.height)*this.dpr/2)/this.dpr)+"px"):e.y<2*e.x&&e.y<2*-e.x?(n.setAttribute("mobile","up"),n.style.left=parseInt((t.x-parseInt(n.childNodes[0].style.width)/2)/this.dpr)+"px",n.style.top=parseInt((t.y-parseInt(n.childNodes[0].style.height))/this.dpr)+"px"):e.y<2*e.x&&e.y>2*-e.x&&(n.setAttribute("mobile","left"),n.style.left=parseInt(t.x/this.dpr)+"px",n.style.top=parseInt((t.y-parseInt(n.childNodes[0].style.height)/2)/this.dpr)+"px")},Ee.prototype.clientCoordToModelCoordOnPlane=function(e,t,n){e=[e,t,.99],t=this.viewer.clientCoordToModelCoord(e),t=new THREE.Vector3(t[0],t[1],t[2]),e[2]=-.99,e=this.viewer.clientCoordToModelCoord(e),e=new THREE.Vector3(e[0],e[1],e[2]);return this.intersectLine(t,e,n)},Ee.prototype.intersectLine=function(e,t,n){var i,r;return!(e&&t&&n)||(i=e.clone(),(e=(new THREE.Vector3).subVectors(t,e)).normalize(),r=e.dot(n.normal),Math.abs(r)<=1e-8)?null:(t=n.coplanarPoint(t.clone()),t=(new THREE.Vector3).subVectors(t,i).dot(n.normal)/r,i.add(e.multiplyScalar(t)))},Ee.prototype.update2DScene=function(){var e,t,n,i,r=this.viewer.renderer.getPixelRatio(),o=this.viewer.canvas2D.getContext("2d");if(!this.viewer.controls.staticmeasureOp&&this.viewer.is2DModel&&(o.clearRect(0,0,window.innerWidth*r,window.innerHeight*r),4==this.viewer.Rectangle.length&&(i=this.viewer.Rectangle[0],t=this.viewer.Rectangle[1],e=this.viewer.Rectangle[2],n=this.viewer.Rectangle[3],o.strokeStyle="#00FFFF",o.setLineDash([5,5]),o.beginPath(),o.moveTo(i,e),o.lineTo(t,e),o.lineTo(t,n),o.lineTo(i,n),o.lineTo(i,e),o.closePath(),o.stroke(),o.setLineDash([])),this.viewer.renderWaterMark()),this.rootObject.visible){this.Textbox&&this.intersectPnt&&(o.strokeStyle="#FF6302",o.lineWidth=r,o.beginPath(),"up"==(t=this.Textbox.getAttribute("mobile"))||"down"==t?(l=this.get2dPoint(this.intersectPnt.clone()),d=this.get2dPoint(this.Textbox.pos.clone()),o.moveTo(l.x,l.y),o.lineTo(d.x,d.y)):"left"!=t&&"right"!=t||(n=this.get2dPoint(this.intersectPnt.clone()),i=this.get2dPoint(this.Textbox.pos.clone()),o.moveTo(n.x,n.y),o.lineTo(Math.round((n.x+i.x)/2),i.y),o.lineTo(i.x,i.y)),o.stroke());for(var a=0;at.x?t:e).x,this.pdfInfo.xSelMax=(e.xt.y?t:e).y,this.pdfInfo.ySelMax=(e.yt.x?t:e).x,this.pdfInfo.xSelMax=(e.xt.y?t:e).y,this.pdfInfo.ySelMax=(e.yr.x&&(r.x=i[2]),i[3]>r.y&&(r.y=i[3]))),this.pdfInfo.xSelMin=n.x-.001,this.pdfInfo.ySelMin=n.y-.001,this.pdfInfo.xSelMax=r.x+.001,this.pdfInfo.ySelMax=r.y+.001),this.setPaperSize(this.pdfInfo.size,this.pdfInfo.orientation),this.setAlign(),this.drawPDFInfo())},this.getBoundingBox=function(e,t,F){this.viewer.ndsModel.setDirty();for(var n=0,N=this.viewer.ndsModel.meshManager.getNumInstancedMeshes();nt.x&&(t.x=g.x),g.y>t.y&&(t.y=g.y))}else{u.copy(c.matrixWorld),p.makeTranslation(-this.transPosition.x,-this.transPosition.y,-this.transPosition.z),u.premultiply(p),u.premultiply(this.matrixWorld),p.makeTranslation(this.transPosition.x,this.transPosition.y,this.transPosition.z),u.premultiply(p);var v=h.boundingBox.min.clone().applyMatrix4(u),A=h.boundingBox.max.clone().applyMatrix4(u);this.textflag?(this.textflag=!1,e.x=v.x,e.y=v.y,t.x=A.x,t.y=A.y):(v.xt.x&&(t.x=A.x),A.y>t.y&&(t.y=A.y))}}}}for(var y=0,U=l.getNumTexts();yt.x&&(t.x=M.x),M.y>t.y&&(t.y=M.y))):console.log("boundingBox is null")}else if(E.geometry){var b=new THREE.Vector3(0,0,0),x=this.getUUidToTextInfo(E.geometry.uuid),G={bigName:this.fontSaveArray[x.fontId].bigName,name:this.fontSaveArray[x.fontId].name,size:this.fontSaveArray[x.fontId].size,style:this.fontSaveArray[x.fontId].style,weight:this.fontSaveArray[x.fontId].weight,width:this.fontSaveArray[x.fontId].width},I=new THREE.Matrix4,T=new THREE.Matrix4,z=new THREE.Vector3,W=new THREE.Quaternion,S=new THREE.Vector3;if(0t.x&&(t.x=r[2]),r[3]>t.y&&(t.y=r[3])));for(var Y=this.viewer.ndsModel.getLineSegmentsSet(),P=0,X=Y.getNumLineSegments();Pt.x&&(t.x=H.x),H.y>t.y&&(t.y=H.y));else{var R=O.boundingBox.min.clone().applyMatrix4(L),D=O.boundingBox.max.clone().applyMatrix4(L);this.textflag?(this.textflag=!1,e.x=R.x,e.y=R.y,t.x=D.x,t.y=D.y):(R.xt.x&&(t.x=D.x),D.y>t.y&&(t.y=D.y)),C.lineStyle&&(R=C.lineStyle.textMesh)&&(R.geometry.computeBoundingBox(),D=R.geometry.boundingBox.min.clone().applyMatrix4(L),C=R.geometry.boundingBox.max.clone().applyMatrix4(L),this.textflag?(this.textflag=!1,e.x=D.x,e.y=D.y,t.x=C.x,t.y=C.y):(D.xt.x&&(t.x=C.x),C.y>t.y&&(t.y=C.y)))}}}}}},this.setPaperSize=function(e,t){switch(e){case"A5":var n=[210,148];this.pdfInfo.width=n[0],this.pdfInfo.height=n[1];break;case"A4":n=[297,210];this.pdfInfo.width=n[0],this.pdfInfo.height=n[1];break;case"A3":n=[420,297];this.pdfInfo.width=n[0],this.pdfInfo.height=n[1];break;case"A2":n=[594,420];this.pdfInfo.width=n[0],this.pdfInfo.height=n[1];break;case"A1":n=[841,594];this.pdfInfo.width=n[0],this.pdfInfo.height=n[1];break;case"A0":n=[1189,841];this.pdfInfo.width=n[0],this.pdfInfo.height=n[1];break;default:n=[297,210];this.pdfInfo.width=n[0],this.pdfInfo.height=n[1]}"l"!=t&&(e=this.pdfInfo.width,this.pdfInfo.width=this.pdfInfo.height,this.pdfInfo.height=e)},this.getPaperSize=function(){return["A5","A4","A3","A2","A1","A0"]},this.setAlign=function(){this.pdfInfo.xLen=this.pdfInfo.xSelMax-this.pdfInfo.xSelMin,this.pdfInfo.yLen=this.pdfInfo.ySelMax-this.pdfInfo.ySelMin;var e=this.pdfInfo.xLen/this.pdfInfo.yLen;this.pdfInfo.height,this.pdfInfo.width;e>this.pdfInfo.width/this.pdfInfo.height?(this.pdfInfo.xAlign=.02*this.pdfInfo.width,this.pdfInfo.yAlign=(this.pdfInfo.height-(this.pdfInfo.width-2*this.pdfInfo.xAlign)/e)/2,this.pdfInfo.scale=(this.pdfInfo.height-2*this.pdfInfo.yAlign)/this.pdfInfo.yLen):(this.pdfInfo.yAlign=.02*this.pdfInfo.height,this.pdfInfo.xAlign=(this.pdfInfo.width-(this.pdfInfo.height-2*this.pdfInfo.yAlign)*e)/2,this.pdfInfo.scale=(this.pdfInfo.width-2*this.pdfInfo.xAlign)/this.pdfInfo.xLen)},this.normalize=function(e){e.x=(e.x-this.pdfInfo.xSelMin)/this.pdfInfo.xLen,e.y=(e.y-this.pdfInfo.ySelMin)/this.pdfInfo.yLen},this.convertToPDFCood=function(e,t,n){var i,r,o=this.pdfInfo.width-2*this.pdfInfo.xAlign,a=this.pdfInfo.height-2*this.pdfInfo.yAlign,s=e.x*o+this.pdfInfo.xAlign,e=(1-e.y)*a+this.pdfInfo.yAlign;return t&&(i=t.x*o+this.pdfInfo.xAlign,r=(1-t.y)*a+this.pdfInfo.yAlign),n?[s,e,i,r,n.x*o+this.pdfInfo.xAlign,(1-n.y)*a+this.pdfInfo.yAlign]:t?[s,e,i,r]:[s,e]},this.colorTest=function(e){16777215==e.getHex()&&e.setHex(16777215-e.getHex())},this.getFontSaveTableId=function(e){for(var t,n=0;na&&(r[0]=a),r[1]>t&&(r[1]=t),r[2]=i.tEnd?(i.tCur=Math.abs(n/i.tEnd),i.updateModel(i.tCur),i.clipTransRotControl.update(),i.clipTransRotControl.updateMatrixWorld(!0),i.updateTransContorlOnce=!0):0Math.abs(i.tEnd)&&(i.tCur=1,i.updateModel(i.tCur),e=(new THREE.Quaternion).setFromUnitVectors(new THREE.Vector3(1,0,0),i.lineNormal),t=(new THREE.Matrix4).makeRotationFromQuaternion(e),n=(new THREE.Matrix4).makeTranslation(i.endPoint.x,i.endPoint.y,i.endPoint.z),i.objectBox.matrix.identity(),i.objectBox.matrixAutoUpdate=!1,i.objectBox.applyMatrix(t),i.objectBox.applyMatrix(n),i.objectBox.updateMatrixWorld(!0),i.objectBox.matrixAutoUpdate=!0,i.updateTransContorlOnce)&&(i.clipTransRotControl.position.copy(i.endPoint),i.clipTransRotControl.update(),i.clipTransRotControl.updateMatrixWorld(!0))}}function Ie(e){g.call(this,e),this.type="OpPiovt",this.tempCenterBox=new THREE.Vector3,this.OpUtils=new n(e),this.selectedObjectUUID=[],!this.viewer.hasBrepInfo()&&this.viewer.hasBrepFile()?this.viewer.loadBrepInfo(!1):this.viewer.dispatchEvent({type:"BrepInfoEvent"}),this.piovtPrompt=document.createElement("div"),Se.isMobileDevice()?this.piovtPrompt.className="app-alert":this.piovtPrompt.className="pc-alert",this.viewer.container.appendChild(this.piovtPrompt),this.piovtType="",this.PointSize=4,this.allowType=[],this.preSelectInfo=null,this.preSelectObj=null,this.piovtScene=new THREE.Group,this.piovtScene.name="OpPiovt",this.init()}(Ai.prototype=Object.create(g.prototype)).changeSelobject=function(){var e=this.viewer.getExplodeMode();if(this.updateNodeMatrix(),this.TransRotControl){this.MoveObjects=this.viewer.selectionManager.getSelectedleafObjects();for(var t,n,i=new THREE.Box3,r=0;rthis.drawCount&&this.drawArray.pop(),2<=this.drawArray.length?this.addSpline(1,!0):this.clearUnCompleteMesh(),this.drawArray=[],this.drawCount=0)},be.prototype.cricle3=function(e,t,n,i){var r=(new THREE.Vector3).subVectors(t,e).normalize(),o=(new THREE.Vector3).subVectors(n,t).normalize(),a=(new THREE.Vector3).crossVectors(r,o);if(Math.abs(a.x)<1e-7&&Math.abs(a.y)<1e-7&&Math.abs(a.z)<1e-7)return l=new THREE.LineCurve3(e,t).getPoints(this.ARC_SEGMENTS/2),d=new THREE.LineCurve3(t,n).getPoints(this.ARC_SEGMENTS/2),l.concat(d);for(var s=[i],l=this.projectPlane.normal.clone(),d=l.angleTo(a)<1e-4,c=(new THREE.Vector3).crossVectors(r,a),o=(new THREE.Vector3).crossVectors(o,a),a=(new THREE.Vector3).addVectors(e,t).divideScalar(2),n=(new THREE.Vector3).addVectors(t,n).divideScalar(2),n=(new THREE.Vector3).subVectors(n,a).cross(o),o=(new THREE.Vector3).crossVectors(c,o),n=n.dot(o)/o.dot(o),h=(new THREE.Vector3).copy(a).addScaledVector(c,n),u=h.distanceTo(e),p=(new THREE.Vector3).subVectors(e,h).normalize(),o=(new THREE.Vector3).subVectors(t,h).normalize(),a=(new THREE.Vector3).subVectors(h,t).normalize(),c=(new THREE.Vector3).crossVectors(r,a).normalize(),f=p.angleTo(o),m=(d==l.angleTo(c)<1e-4&&(f=2*Math.PI-f),new THREE.Vector3),g=(new THREE.Vector3).copy(l),v=d?-1:1,A=0;A=Math.PI/2&&t.negate(),this.projectPlane=(new THREE.Plane).setFromNormalAndCoplanarPoint(t,e),this.viewer.cameraControl.rotateToPlane(this.projectPlane),this.isDrawType()?this.viewer.onChangeCursor("OpDrawGeom"):this.viewer.onChangeCursor("OpOrbit")},be.prototype.createPlaneFace=function(e,t){e=this.OpUtils.createFace(e,t);return e.updateMatrixWorld(!0),e},be.prototype.clearParams=function(){this.drawArray=[],this.drawCount=0,this.needAddScene=!1,this.needSelectPlane=!1},be.prototype.clearUnCompleteMesh=function(){this.currentMesh&&(this.needAddScene||(this.drawScene.remove(this.currentMesh),this.currentMesh.geometry.dispose()),this.clearParams(),this.currentMesh=null)},be.prototype.clearPreSelectPlane=function(){this.preSelectPlaneInfo=null,this.preSelectPlaneObj&&(this.drawScene.remove(this.preSelectPlaneObj),this.preSelectPlaneObj=null,this.viewer.render())},be.prototype.clearSelectPlane=function(){this.selectPlaneObj&&(this.drawScene.remove(this.selectPlaneObj),this.selectPlaneObj=null,this.viewer.render())},be.prototype.notifyCreateMesh=function(e){this.viewer.dispatchEvent({type:"drawGeom",uuid:e.uuid,name:e.name,id:e.objectType}),this.viewer.render()},be.prototype.removeMesh=function(e,t){for(var n=!1,i=0;i=t.value)return this.search_node_=t}else for(;t=t.next;)if(e=e.basin.bottom_node.next.point.y;)e.basin.bottom_node=e.basin.bottom_node.next;if(e.basin.bottom_node!==e.basin.left_node){for(e.basin.right_node=e.basin.bottom_node;e.basin.right_node.next&&e.basin.right_node.point.ye.basin.right_node.point.y,function e(t,n){if(Ui(t,n))return;_i(t,n);{if(n.prev===t.basin.left_node&&n.next===t.basin.right_node)return;if(n.prev===t.basin.left_node){if(v(n.point,n.next.point,n.next.next.point)===m.CW)return;n=n.next}else if(n.next===t.basin.right_node){if(v(n.point,n.prev.point,n.prev.prev.point)===m.CCW)return;n=n.prev}else n=n.prev.point.yt.q.x,!ji(n.triangle,t.p,t.q)){!function(e,t,n){(e.edge_event.right?function(e,t,n){for(;n.next.point.xt.p.x;)v(t.q,n.prev.point,t.p)===m.CW?function e(t,n,i){i.point.x>n.p.x&&(v(i.point,i.prev.point,i.prev.prev.point)===m.CW?Yi:(Wi(t,n,i),e))(t,n,i)}(e,t,n):n=n.prev})(e,t,n)}(e,t,n);try{Ni(e,t.p,t.q,n.triangle,t.q)}catch(e){}}}(e,o[a],r)}(e),function(e){var t=e.front().head().next.triangle,n=e.front().head().next.point;for(;!t.getConstrainedEdgeCW(n);)t=t.neighborCCW(n);e.meshClean(t)}(e)}});function Ni(e,t,n,i,r){if(!ji(i,t,n)){var o=i.pointCCW(r),a=v(n,o,t);if(a===m.COLLINEAR)throw new Pi("poly2tri EdgeEvent: Collinear not supported!",[n,o,t]);var o=i.pointCW(r),s=v(n,o,t);if(s===m.COLLINEAR)throw new Pi("poly2tri EdgeEvent: Collinear not supported!",[n,o,t]);a===s?Ni(e,t,n,i=a===m.CW?i.neighborCCW(r):i.neighborCW(r),r):Xi(e,t,n,i,r)}}function ji(e,t,n){var i=e.edgeIndex(t,n);if(-1!==i)return e.markConstrainedEdgeByIndex(i),(e=e.getNeighbor(i))&&e.markConstrainedEdgeByPoints(t,n),1}function _i(e,t){var n=new s(t.prev.point,t.point,t.next.point);n.markNeighbor(t.prev.triangle),n.markNeighbor(t.triangle),e.addToMap(n),t.prev.next=t.next,t.next.prev=t.prev,Vi(e,n)||e.mapTriangleToNodes(n)}function Vi(e,t){for(var n=0;n<3;++n)if(!t.delaunay_edge[n]){var i=t.getNeighbor(n);if(i){var r=t.getPoint(n),o=i.oppositePoint(t,r),a=i.index(o);if(i.constrained_edge[a]||i.delaunay_edge[a])t.constrained_edge[n]=i.constrained_edge[a];else if(function(e,t,n,i){var r=e.x-i.x,e=e.y-i.y,o=t.x-i.x,t=t.y-i.y,a=r*t-o*e;if(a<=0)return!1;var s=n.x-i.x,n=n.y-i.y,i=s*e-r*n;if(i<=0)return!1;return 0<(r*r+e*e)*(o*n-s*t)+(o*o+t*t)*i+(s*s+n*n)*a}(r,t.pointCCW(r),t.pointCW(r),o))return t.delaunay_edge[n]=!0,i.delaunay_edge[a]=!0,ki(t,r,i,o),!Vi(e,t)&&e.mapTriangleToNodes(t),!Vi(e,i)&&e.mapTriangleToNodes(i),t.delaunay_edge[n]=!1,i.delaunay_edge[a]=!1,1}}}function ki(e,t,n,i){var r=e.neighborCCW(t),o=e.neighborCW(t),a=n.neighborCCW(i),s=n.neighborCW(i),l=e.getConstrainedEdgeCCW(t),d=e.getConstrainedEdgeCW(t),c=n.getConstrainedEdgeCCW(i),h=n.getConstrainedEdgeCW(i),u=e.getDelaunayEdgeCCW(t),p=e.getDelaunayEdgeCW(t),f=n.getDelaunayEdgeCCW(i),m=n.getDelaunayEdgeCW(i);e.legalize(t,i),n.legalize(i,t),n.setDelaunayEdgeCCW(t,u),e.setDelaunayEdgeCW(t,p),e.setDelaunayEdgeCCW(i,f),n.setDelaunayEdgeCW(i,m),n.setConstrainedEdgeCCW(t,l),e.setConstrainedEdgeCW(t,d),e.setConstrainedEdgeCCW(i,c),n.setConstrainedEdgeCW(i,h),e.clearNeighbors(),n.clearNeighbors(),r&&n.markNeighbor(r),o&&e.markNeighbor(o),a&&e.markNeighbor(a),s&&n.markNeighbor(s),e.markNeighbor(n)}function Ui(e,t){t=e.basin.left_highest?e.basin.left_node.point.y-t.point.y:e.basin.right_node.point.y-t.point.y;return e.basin.width>t}function Gi(e,t,n){_i(e,n.next),n.next.point!==t.p&&v(t.q,n.next.point,t.p)===m.CCW&&v(n.point,n.next.point,n.next.next.point)===m.CCW&&Gi(e,t,n)}function zi(e,t,n){v(n.next.point,n.next.next.point,n.next.next.next.point)===m.CCW?Gi(e,t,n.next):v(t.q,n.next.next.point,t.p)===m.CCW&&zi(e,t,n.next)}function Wi(e,t,n){v(n.prev.point,n.prev.prev.point,n.prev.prev.prev.point)===m.CW?Yi(e,t,n.prev):v(t.q,n.prev.prev.point,t.p)===m.CW&&Wi(e,t,n.prev)}function Yi(e,t,n){_i(e,n.prev),n.prev.point!==t.p&&v(t.q,n.prev.point,t.p)===m.CW&&v(n.point,n.prev.point,n.prev.prev.point)===m.CW&&Yi(e,t,n)}function Xi(e,t,n,i,r){var o,a,s,l,d,c,h,u=i.neighborAcross(r),p=(Oi(u,"FLIP failed due to missing triangle!"),u.oppositePoint(i,r));if(i.getConstrainedEdgeAcross(r))throw o=i.index(r),new Pi("poly2tri Intersecting Constraints",[r,p,i.getPoint((o+1)%3),i.getPoint((o+2)%3)]);Ri(r,i.pointCCW(r),i.pointCW(r),p)?(ki(i,r,u,p),e.mapTriangleToNodes(i),e.mapTriangleToNodes(u),r===n&&p===t?n===e.edge_event.constrained_edge.q&&t===e.edge_event.constrained_edge.p&&(i.markConstrainedEdgeByPoints(t,n),u.markConstrainedEdgeByPoints(t,n),Vi(e,i),Vi(e,u)):(o=v(n,p,t),s=i,l=u,d=r,c=p,Xi(a=e,t,n,i=o!==m.CCW?(h=s.edgeIndex(d,c),s.delaunay_edge[h]=!0,Vi(a,s),s.clearDelaunayEdges(),l):(h=l.edgeIndex(d,c),l.delaunay_edge[h]=!0,Vi(a,l),l.clearDelaunayEdges(),s),r))):(function e(t,n,i,r,o,a){var s=o.neighborAcross(a);Oi(s,"FLIP failed due to missing triangle");o=s.oppositePoint(o,a);Ri(i,r.pointCCW(i),r.pointCW(i),o)?Xi(t,i,o,s,o):(a=Qi(n,i,s,o),e(t,n,i,r,s,a))}(e,t,n,i,u,Qi(t,n,u,p)),Ni(e,t,n,i,r))}function Qi(e,t,n,i){var r=v(t,i,e);if(r===m.CW)return n.pointCCW(i);if(r===m.CCW)return n.pointCW(i);throw new Pi("poly2tri [Unsupported] nextFlipPoint: opposing point on constrained edge!",[t,i,e])}function Zi(e,t){if(this.p=e,this.q=t,e.y>t.y)this.q=e,this.p=t;else if(e.y===t.y)if(e.x>t.x)this.q=e,this.p=t;else if(e.x===t.x)throw new Pi("poly2tri Invalid Edge constructor: repeated points!",[e]);this.q._p2t_edge_list||(this.q._p2t_edge_list=[]),this.q._p2t_edge_list.push(this)}function qi(){this.left_node=null,this.bottom_node=null,this.right_node=null,this.width=0,this.left_highest=!1}function Ki(){this.constrained_edge=null,this.right=!1}function p(e,t){t=t||{},this.triangles_=[],this.map_=[],this.points_=t.cloneArrays?e.slice(0):e,this.edge_list=[],this.pmin_=this.pmax_=null,this.front_=null,this.head_=null,this.tail_=null,this.af_head_=null,this.af_middle_=null,this.af_tail_=null,this.basin=new qi,this.edge_event=new Ki,this.initEdges(this.points_)}function Ji(e,t,n){var r,i,o,a,s,l,d,c,h,u,p,f,m=e,g=t,v=!1,A=new THREE.Color,y=this,E={texSize:64,pixScale:1,blurRadius:7,debug:!1};function M(e){return new THREE.ShaderMaterial({uniforms:THREE.UniformsUtils.clone(e.uniforms),vertexShader:e.vertexShader,fragmentShader:e.fragmentShader,defines:THREE.UniformsUtils.clone(e.defines)})}if(this.setTransform=function(e,t,n,i){r.left=-t.z/2,r.right=t.z/2,r.top=t.x/2,r.bottom=-t.x/2,r.near=1,r.far=t.y+r.near,r.updateProjectionMatrix(),r.position.addVectors(e,n.clone().multiplyScalar(-t.y/2-r.near)),i&&r.up.set(i.x,i.y,i.z),r.lookAt(e),o.position.set(e.x,e.y,e.z),o.rotation.set(r.rotation.x,r.rotation.y,r.rotation.z),o.scale.set(t.z,t.x,t.y),E.debug&&(f.position.set(e.x,e.y,e.z),f.rotation.set(r.rotation.x,r.rotation.y,r.rotation.z),f.scale.set(t.z,t.x,t.y)),p.uniforms.worldSize.value.copy(t)},this.renderIntoShadow=function(e){var t,n;!this.enabled||e.overrideMaterial&&e.overrideMaterial.transparent||(t=e.overrideMaterial,e.overrideMaterial=l,(n=e.getObjectByName("GridHelper"))&&(e.gridvisible=n.visible,n.visible=!1),m.ndsModel&&(m.ndsModel.backupDirty(),m.ndsModel.setDirty(),m.ndsModel.setDrawMode(m.ndsModel.SHADED),m.scene.children.push(m.ndsModel),m.ndsModel.setOverrideMaterial(l,d,!1)),g.render(e,r,a,!1),e.overrideMaterial=t,m.ndsModel&&(m.ndsModel.setOverrideMaterial(null,null,!1),m.ndsModel.resetDirty()),n&&(n.visible=e.gridvisible))},this.renderShadow=function(e,t){this.enabled&&v&&(t?g.render(i,e,t,!1):g.render(i,e))},this.postprocess=function(){this.enabled&&(u.render(g,s,a),h.render(g,a,s),v=!0)},this.clear=function(){var e,t,n;this.enabled&&(e=g.getClearColor(A),t=g.getClearAlpha(),n=g.getRenderTarget(),g.setClearColor(16777215,0),g.setRenderTarget(a),g.clear(!0,!0,!1),g.setClearColor(e,t),v=!1,g.setRenderTarget(n))},this.getRenderTarget=function(){return a},this.setColor=function(e){c.uniforms.uShadowColor.value.x=e.r,c.uniforms.uShadowColor.value.y=e.g,c.uniforms.uShadowColor.value.z=e.b},this.getColor=function(){return new THREE.Color(c.uniforms.uShadowColor.value.x,c.uniforms.uShadowColor.value.y,c.uniforms.uShadowColor.value.z)},this.setAlpha=function(e){c.uniforms.uShadowColor.value.w=e},this.getAlpha=function(){return c.uniforms.uShadowColor.value.w},this.isValid=function(){return v},this.getDepthMaterial=function(){return l},this.updateGroundTransform=function(e,t,n){var i,r,o;y.enabled&&t&&(y.needClear=!0,t=t.clone(),i=new THREE.Vector3(1,0,0),r=t.getCenter(new THREE.Vector3),o=t.getSize(new THREE.Vector3),e.worldUpTransform&&(i.applyMatrix4(e.worldUpTransform),t.applyMatrix4(e.worldUpTransform),o=t.size()),t=o.x>o.z?o.x/o.z:o.z/o.x,o.multiply(new THREE.Vector3(1.25,1.01,1.25)),o.x=o.z=Math.max(o.x,o.z),n?y.setTransform(r,o,n,i):y.setTransform(r,o,e.up,i),--t<5&&(t/=500),0<(t=2/Math.PI*Math.atan(t)))&&(c.defines.DARKNESS_SCALE=1.00001+t)},n)for(var w in E)E[w]=n[w]||E[w];i=new THREE.Scene,r=new THREE.OrthographicCamera,(a=new THREE.WebGLRenderTarget(E.texSize,E.texSize,{minFilter:THREE.LinearFilter,magFilter:THREE.LinearFilter,format:THREE.RGBAFormat,stencilBuffer:!1})).texture.generateMipmaps=!1,(s=new THREE.WebGLRenderTarget(E.texSize,E.texSize,{minFilter:THREE.LinearFilter,magFilter:THREE.LinearFilter,format:THREE.RGBAFormat,stencilBuffer:!1})).texture.generateMipmaps=!1,(l=M(er)).defines.NUM_CUTPLANES=0,l.side=THREE.DoubleSide,l.blending=THREE.NoBlending,d=(new l.constructor).copy(l),h=new Jt(nr,"tDepth"),u=new Jt(nr,"tDepth"),p=new Jt(tr,"tDepth"),h.material.defines.KERNEL_SCALE=u.material.defines.KERNEL_SCALE=(E.pixScale/E.texSize).toFixed(4),h.material.defines.KERNEL_RADIUS=u.material.defines.KERNEL_RADIUS=E.blurRadius.toFixed(2),p.material.blending=h.material.blending=u.material.blending=THREE.NoBlending,p.material.depthWrite=h.material.depthWrite=u.material.depthWrite=!1,p.material.depthTest=h.material.depthTest=u.material.depthTest=!1,h.material.defines.HORIZONTAL=1,(c=M(ir)).uniforms.tDepth.value=a.texture,c.depthWrite=!1,c.transparent=!0,c.defines.NUM_CUTPLANES=0,(e=new THREE.BufferGeometry).addAttribute("position",new THREE.BufferAttribute(new Float32Array([-.5,-.5,.5,-.5,.5,.5,.5,.5,.5,.5,-.5,.5]),3)),e.addAttribute("uv",new THREE.BufferAttribute(new Float32Array([0,0,0,1,1,1,1,0]),2)),e.setIndex(new THREE.BufferAttribute(new Uint16Array([0,1,2,2,3,0]),1)),o=new THREE.Mesh(e,c),i.add(o),E.debug&&(f=new THREE.Mesh(new THREE.BoxGeometry(1,1,1),new THREE.MeshBasicMaterial({color:65280,wireframe:!0})),i.add(f)),this.setTransform(new THREE.Vector3(0,0,0),new THREE.Vector3(1,1,1),new THREE.Vector3(0,1,0))}var s=function(e,t,n){this.points_=[e,t,n],this.neighbors_=[null,null,null],this.interior_=!1,this.constrained_edge=[!1,!1,!1],this.delaunay_edge=[!1,!1,!1]},$i=Ci.toString,$n=(s.prototype.toString=function(){return"["+$i(this.points_[0])+$i(this.points_[1])+$i(this.points_[2])+"]"},s.prototype.getPoint=function(e){return this.points_[e]},s.prototype.GetPoint=s.prototype.getPoint,s.prototype.getPoints=function(){return this.points_},s.prototype.getNeighbor=function(e){return this.neighbors_[e]},s.prototype.containsPoint=function(e){var t=this.points_;return e===t[0]||e===t[1]||e===t[2]},s.prototype.containsEdge=function(e){return this.containsPoint(e.p)&&this.containsPoint(e.q)},s.prototype.containsPoints=function(e,t){return this.containsPoint(e)&&this.containsPoint(t)},s.prototype.isInterior=function(){return this.interior_},s.prototype.setInterior=function(e){return this.interior_=e,this},s.prototype.markNeighborPointers=function(e,t,n){var i=this.points_;if(e===i[2]&&t===i[1]||e===i[1]&&t===i[2])this.neighbors_[0]=n;else if(e===i[0]&&t===i[2]||e===i[2]&&t===i[0])this.neighbors_[1]=n;else{if(!(e===i[0]&&t===i[1]||e===i[1]&&t===i[0]))throw new Error("poly2tri Invalid Triangle.markNeighborPointers() call");this.neighbors_[2]=n}},s.prototype.markNeighbor=function(e){var t=this.points_;e.containsPoints(t[1],t[2])?(this.neighbors_[0]=e).markNeighborPointers(t[1],t[2],this):e.containsPoints(t[0],t[2])?(this.neighbors_[1]=e).markNeighborPointers(t[0],t[2],this):e.containsPoints(t[0],t[1])&&(this.neighbors_[2]=e).markNeighborPointers(t[0],t[1],this)},s.prototype.clearNeighbors=function(){this.neighbors_[0]=null,this.neighbors_[1]=null,this.neighbors_[2]=null},s.prototype.clearDelaunayEdges=function(){this.delaunay_edge[0]=!1,this.delaunay_edge[1]=!1,this.delaunay_edge[2]=!1},s.prototype.pointCW=function(e){var t=this.points_;return e===t[0]?t[2]:e===t[1]?t[0]:e===t[2]?t[1]:null},s.prototype.pointCCW=function(e){var t=this.points_;return e===t[0]?t[1]:e===t[1]?t[2]:e===t[2]?t[0]:null},s.prototype.neighborCW=function(e){return e===this.points_[0]?this.neighbors_[1]:e===this.points_[1]?this.neighbors_[2]:this.neighbors_[0]},s.prototype.neighborCCW=function(e){return e===this.points_[0]?this.neighbors_[2]:e===this.points_[1]?this.neighbors_[0]:this.neighbors_[1]},s.prototype.getConstrainedEdgeCW=function(e){return e===this.points_[0]?this.constrained_edge[1]:e===this.points_[1]?this.constrained_edge[2]:this.constrained_edge[0]},s.prototype.getConstrainedEdgeCCW=function(e){return e===this.points_[0]?this.constrained_edge[2]:e===this.points_[1]?this.constrained_edge[0]:this.constrained_edge[1]},s.prototype.getConstrainedEdgeAcross=function(e){return e===this.points_[0]?this.constrained_edge[0]:e===this.points_[1]?this.constrained_edge[1]:this.constrained_edge[2]},s.prototype.setConstrainedEdgeCW=function(e,t){e===this.points_[0]?this.constrained_edge[1]=t:e===this.points_[1]?this.constrained_edge[2]=t:this.constrained_edge[0]=t},s.prototype.setConstrainedEdgeCCW=function(e,t){e===this.points_[0]?this.constrained_edge[2]=t:e===this.points_[1]?this.constrained_edge[0]=t:this.constrained_edge[1]=t},s.prototype.getDelaunayEdgeCW=function(e){return e===this.points_[0]?this.delaunay_edge[1]:e===this.points_[1]?this.delaunay_edge[2]:this.delaunay_edge[0]},s.prototype.getDelaunayEdgeCCW=function(e){return e===this.points_[0]?this.delaunay_edge[2]:e===this.points_[1]?this.delaunay_edge[0]:this.delaunay_edge[1]},s.prototype.setDelaunayEdgeCW=function(e,t){e===this.points_[0]?this.delaunay_edge[1]=t:e===this.points_[1]?this.delaunay_edge[2]=t:this.delaunay_edge[0]=t},s.prototype.setDelaunayEdgeCCW=function(e,t){e===this.points_[0]?this.delaunay_edge[2]=t:e===this.points_[1]?this.delaunay_edge[0]=t:this.delaunay_edge[1]=t},s.prototype.neighborAcross=function(e){return e===this.points_[0]?this.neighbors_[0]:e===this.points_[1]?this.neighbors_[1]:this.neighbors_[2]},s.prototype.oppositePoint=function(e,t){e=e.pointCW(t);return this.pointCW(e)},s.prototype.legalize=function(e,t){var n=this.points_;if(e===n[0])n[1]=n[0],n[0]=n[2],n[2]=t;else if(e===n[1])n[2]=n[1],n[1]=n[0],n[0]=t;else{if(e!==n[2])throw new Error("poly2tri Invalid Triangle.legalize() call");n[0]=n[2],n[2]=n[1],n[1]=t}},s.prototype.index=function(e){var t=this.points_;if(e===t[0])return 0;if(e===t[1])return 1;if(e===t[2])return 2;throw new Error("poly2tri Invalid Triangle.index() call")},s.prototype.edgeIndex=function(e,t){var n=this.points_;if(e===n[0]){if(t===n[1])return 2;if(t===n[2])return 1}else if(e===n[1]){if(t===n[2])return 0;if(t===n[0])return 2}else if(e===n[2]){if(t===n[0])return 1;if(t===n[1])return 0}return-1},s.prototype.markConstrainedEdgeByIndex=function(e){this.constrained_edge[e]=!0},s.prototype.markConstrainedEdgeByEdge=function(e){this.markConstrainedEdgeByPoints(e.p,e.q)},s.prototype.markConstrainedEdgeByPoints=function(e,t){var n=this.points_;t===n[0]&&e===n[1]||t===n[1]&&e===n[0]?this.constrained_edge[2]=!0:t===n[0]&&e===n[2]||t===n[2]&&e===n[0]?this.constrained_edge[1]=!0:(t===n[1]&&e===n[2]||t===n[2]&&e===n[1])&&(this.constrained_edge[0]=!0)},qi.prototype.clear=function(){this.left_node=null,this.bottom_node=null,this.right_node=null,this.width=0,this.left_highest=!1},p.prototype.AddHole=p.prototype.addHole=function(e){this.initEdges(e);for(var t=e.length,n=0;ne&&(e=a.x),a.xn&&(n=a.y),a.y=e.bbox.max.y||e.node_edges.length<3)){for(var t=.5*(e.bbox.min.y+e.bbox.max.y),n=(e.left=new h,e.right=new h,this.pts),i=e.node_edges,r=[],o=new THREE.Vector2,a=0;a=n)for(var i=this.pts,r=e.node_edges,o=0,a=r.length;o=n&&this.pointInPolygonRec(u,t,n),e.right);u&&u.bbox.min.y<=n&&u.bbox.max.y>=n&&this.pointInPolygonRec(u,t,n)},u.prototype.pointInPolygon=function(e,t){return this.pipResult=!1,this.pointInPolygonRec(this.root,e,t),this.pipResult};var n=new THREE.Vector3;function e(e,t){this.edges=e,this.bbox=t,this.pts=[],this.idmap={},this.xymap={},this.contours=[],this.scale=1e6/this.bbox.getSize(n).length()}function t(e){this.indices=[],this.cset=e;var t=this.pts=e.pts;this.intervalTree=new u(e.pts,e.edges,e.bbox),this.intervalTree.build();for(var n=0;nS&&(g=r,v=o,u=y.clone()):(p=r,f=o,h=y)),0==A&&0==c?s.push(new B(n.clone(),i.clone(),o,o,a,a,l)):(M*e<0&&(m=1/(e-M),g=o,v=a,y=n.clone().multiplyScalar(e*m).sub(i.clone().multiplyScalar(M*m)),h?y.distanceTo(h)>S&&(g=o,v=a,u=y.clone()):(p=o,f=a,h=y.clone())),0==d&&0==c?s.push(new B(i.clone(),t.clone(),a,a,r,r,l)):(e*E<0&&(A=1/(E-e),y=i.clone().multiplyScalar(E*A).sub(t.clone().multiplyScalar(e*A)),h?y.distanceTo(h)>S&&(g=a,v=r,u=y.clone()):(p=a,f=r,h=y.clone())),h&&u&&s.push(new B(h,u,p,f,g,v,l)))))))},this.intersectBoxPlane=function(e,t){var n=new THREE.Vector3,i=(n.set(t.min.x,t.min.y,t.min.z),e.distanceToPoint(n)),i=Math.sign(i),r=(n.set(t.min.x,t.min.y,t.max.z),e.distanceToPoint(n));return Math.sign(r)!==i||(n.set(t.min.x,t.max.y,t.min.z),r=e.distanceToPoint(n),Math.sign(r)!==i)||(n.set(t.min.x,t.max.y,t.max.z),r=e.distanceToPoint(n),Math.sign(r)!==i)||(n.set(t.max.x,t.min.y,t.min.z),r=e.distanceToPoint(n),Math.sign(r)!==i)||(n.set(t.max.x,t.min.y,t.max.z),r=e.distanceToPoint(n),Math.sign(r)!==i)||(n.set(t.max.x,t.max.y,t.min.z),r=e.distanceToPoint(n),Math.sign(r)!==i)||(n.set(t.max.x,t.max.y,t.max.z),r=e.distanceToPoint(n),Math.sign(r)!==i)},this.intersectMeshPlane=(w=new THREE.Vector3,b=new THREE.Vector3,x=new THREE.Vector3,I=new THREE.Matrix4,T=new THREE.Plane,function(e,t,n,i,r){var o,a,s,l=r.length,d=t.attributes,c=n;if(I.getInverse(c),T.copy(e).applyMatrix4(I),void 0!==d.index||null!=t.index){var h=(d.index?d:t).index.array,u=t.vb||d.position.array,p=t.vb?t.vbstride:3,f=(d.position&&d.position instanceof THREE.InterleavedBufferAttribute&&(u=d.position.data.array,p=d.position.data.stride),t.groups);f&&0!==f.length||(f=[{start:0,count:h.length,index:0}],t.drawRange&&t.drawRange.count!=1/0&&(f[0].start=t.drawRange.start,f[0].count=t.drawRange.count));for(var m=0,g=f.length;m 0","uniform vec4 cutplanes[NUM_CUTPLANES];","#ifdef CUTPLANES_LINE","uniform vec3 cutplanesOutlineColor;","uniform float cutplanesOutlineThickness;","#endif","bool checkCutPlanes() {","bool isCut = false;","#ifdef CUTPLANES_LINE","bool isCutEdge = false;","float eyeDist = length(vViewPosition);","#endif","for (int i=0; i 0.0);","#ifdef CUTPLANES_LINE","isCutEdge = isCutEdge || (dotPlane > -cutplanesOutlineThickness*eyeDist);","#endif","}","if (isCut) {","discard;","return true;","}","#ifdef CUTPLANES_LINE","else if (isCutEdge) {","gl_FragColor = vec4(cutplanesOutlineColor, 1.0);","return true;","}","#endif","return false;","}","#endif"].join("\n")),t=["vec4 packDepth( const in float depth ) {","vec4 enc = vec4(1.0, 255.0, 65025.0, 160581375.0) * depth;","enc = fract(enc);","enc -= enc.yzww * vec4(1.0/255.0,1.0/255.0,1.0/255.0,0.0);","return enc;","}","float unpackDepth( const in vec4 rgba_depth ) {","return dot( rgba_depth, vec4(1.0, 1.0/255.0, 1.0/65025.0, 1.0/160581375.0) );","}"].join("\n"),er={uniforms:{cutplanes:{type:"v4v",value:[]}},vertexShader:["#ifdef USE_LOGDEPTHBUF"," #ifdef USE_LOGDEPTHBUF_EXT"," varying float vFragDepth;"," #endif"," uniform float logDepthBufFC;","#endif","#if NUM_CUTPLANES > 0","varying vec3 vWorldPosition;","#endif","void main() {","#ifdef USE_MODELMATRIXATTRIB"," mat4 ndsModelViewMatrix = viewMatrix * modelMatrixAttrib;"," gl_Position = projectionMatrix * ndsModelViewMatrix * vec4( position, 1.0 );","#else"," gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );;","#endif","#if NUM_CUTPLANES > 0"," vec4 worldPosition = modelMatrix * vec4( position, 1.0 );"," vWorldPosition = worldPosition.xyz;","#endif","#ifdef USE_LOGDEPTHBUF"," gl_Position.z = log2(max(1e-6, gl_Position.w + 1.0)) * logDepthBufFC;"," #ifdef USE_LOGDEPTHBUF_EXT"," vFragDepth = 1.0 + gl_Position.w;"," #else"," gl_Position.z = (gl_Position.z - 1.0) * gl_Position.w;"," #endif","#endif","}"].join("\n"),fragmentShader:["#ifdef USE_LOGDEPTHBUF"," uniform float logDepthBufFC;"," #ifdef USE_LOGDEPTHBUF_EXT"," #extension GL_EXT_frag_depth : enable"," varying float vFragDepth;"," #endif","#endif",t,"#if NUM_CUTPLANES > 0","varying vec3 vWorldPosition;","#endif",$n,"void main() {","#if NUM_CUTPLANES > 0","if (checkCutPlanes()) return;","#endif","#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)","gl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;","#endif","#ifdef USE_LOGDEPTHBUF_EXT","float depth = gl_FragDepthEXT / gl_FragCoord.w;","#else","float depth = gl_FragCoord.z / gl_FragCoord.w;","#endif","depth = 1.0 - depth;","gl_FragColor = packDepth(depth);","}"].join("\n")},tr={uniforms:{tDepth:{type:"t",value:null},worldSize:{type:"v3",value:new THREE.Vector3(1,1,1)}},defines:{},vertexShader:["varying vec2 vUv;","void main() {","vUv = vec2(uv.x, uv.y);","gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);","}"].join("\n"),fragmentShader:["#define NUM_SAMPLES 29.0","#define NUM_SPIRAL_TURNS 7.0","uniform sampler2D tDepth;","uniform vec3 worldSize;","varying vec2 vUv;","#ifdef PRESET_2","#define SAMPLE_RADIUS 0.3","#define AO_GAMMA 1.0","#define AO_INTENSITY 1.0","#else","#define SAMPLE_RADIUS 0.2","#define AO_GAMMA 3.0","#define AO_INTENSITY 0.8","#endif",t,"#define PI 3.14159265358979","float rand(vec2 co) {","return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);","}","float getRandomAngle(vec2 pos) {","return rand(pos) * (2.0 * PI);","}","vec2 tapLocation(float sampleNumber, float spinAngle, out float ssR){","float alpha = float(sampleNumber + 0.5) * (1.0 / NUM_SAMPLES);","float angle = alpha * (NUM_SPIRAL_TURNS * PI * 2.0) + spinAngle;","ssR = alpha;","return vec2(cos(angle), sin(angle));","}","vec2 sampleAO(vec2 unitDirection, float radius) {","vec2 sampleOffset = unitDirection * radius;","float idepth = unpackDepth(texture2D(tDepth, vUv + sampleOffset));","float depth = 1.0 - idepth;","if (depth < 1e-6) {","if (radius == 0.0)","return vec2(1.0, 1.0);","else","return vec2(0.0, 1.0);","}","vec3 dir = vec3(sampleOffset.x, depth, sampleOffset.y) * worldSize;","float distance2 = dot(dir,dir);","float idistance = 1.0 / sqrt(distance2);","vec3 ndir = dir * idistance;","#ifdef PRESET_2","float importance = ndir.y * idistance;","#else","float importance = ndir.y / distance2;","#endif","vec2 ret;","ret.x = (idepth == 0.0) ? 0.0 : importance;","ret.y = importance;","return ret;","}","void main() {","vec2 sum = vec2(0.0);","float angle = getRandomAngle(vUv);","for (float i = 0.0; ithis.m_value[0]&&(e=1),e=this.m_value[2]>this.m_value[e]?2:e},t.DistanceToPoint=function(e){return Math.sqrt(Math.pow(this.m_value[0]-e.m_value[0],2)+Math.pow(this.m_value[1]-e.m_value[1],2)+Math.pow(this.m_value[2]-e.m_value[2],2))},t.GetValue=function(e){return this.m_value[e]},e}(),Y=function(){function n(){this.m_value=[],this.m_value[0]=this.m_value[1]=this.m_value[2]=1/0,this.m_value[3]=this.m_value[4]=this.m_value[5]=-1/0}var e=n.prototype;return e.Init=function(){this.m_value[0]=this.m_value[1]=this.m_value[2]=1/0,this.m_value[3]=this.m_value[4]=this.m_value[5]=-1/0},e.GetCentriod=function(){return new ur(.5*(this.m_value[0]+this.m_value[3]),.5*(this.m_value[1]+this.m_value[4]),.5*(this.m_value[2]+this.m_value[5]))},e.GetMinMaxPoint=function(e,t){new ur(this.m_value[0],this.m_value[1],this.m_value[2]),new ur(this.m_value[3],this.m_value[4],this.m_value[5])},e.SetMinMaxPoint=function(e,t){this.m_value[0]=e.m_value[0],this.m_value[1]=e.m_value[1],this.m_value[2]=e.m_value[2],this.m_value[3]=t.m_value[0],this.m_value[4]=t.m_value[1],this.m_value[5]=t.m_value[2]},e.SetMinMaxPointFromArray=function(e){this.m_value[0]=e[0],this.m_value[1]=e[1],this.m_value[2]=e[2],this.m_value[3]=e[3],this.m_value[4]=e[4],this.m_value[5]=e[5]},e.GetSize=function(){return new ur(this.m_value[3]-this.m_value[0],this.m_value[4]-this.m_value[1],this.m_value[5]-this.m_value[2])},e.Area=function(){var e=this.m_value[3]-this.m_value[0],t=this.m_value[4]-this.m_value[1],n=this.m_value[5]-this.m_value[2];return e<0||t<0||n<0?0:2*(e*t+t*n+e*n)},e.DiagonalLength=function(){return Math.sqrt(Math.pow(this.m_value[0]-this.m_value[3],2)+Math.pow(this.m_value[1]-this.m_value[4],2)+Math.pow(this.m_value[2]-this.m_value[5],2))},e.AddPoint=function(e){e.m_value[0]this.m_value[3]&&(this.m_value[3]=e.m_value[0]),e.m_value[1]this.m_value[4]&&(this.m_value[4]=e.m_value[1]),e.m_value[2]this.m_value[5]&&(this.m_value[5]=e.m_value[2])},e.AddVector=function(e){this.m_value[0]=Math.min(e.x,this.m_value[0]),this.m_value[1]=Math.min(e.y,this.m_value[1]),this.m_value[2]=Math.min(e.z,this.m_value[2]),this.m_value[3]=Math.max(e.x,this.m_value[3]),this.m_value[4]=Math.max(e.y,this.m_value[4]),this.m_value[5]=Math.max(e.z,this.m_value[5])},e.AddBox=function(e){e.m_value[0]this.m_value[3]&&(this.m_value[3]=e.m_value[3]),e.m_value[1]this.m_value[4]&&(this.m_value[4]=e.m_value[4]),e.m_value[2]this.m_value[5]&&(this.m_value[5]=e.m_value[5])},e.IsIntersectBox=function(e){return!(e.m_value[3]this.m_value[3]||e.m_value[4]this.m_value[4]||e.m_value[5]this.m_value[5])},e.GetValue=function(e){return this.m_value[e]},e.SetFromBox=function(e){this.m_value[0]=e.m_value[0],this.m_value[1]=e.m_value[1],this.m_value[2]=e.m_value[2],this.m_value[3]=e.m_value[3],this.m_value[4]=e.m_value[4],this.m_value[5]=e.m_value[5]},e.MultiplyMatrix=function(e){n.points[0].set(this.m_value[0],this.m_value[1],this.m_value[2]).applyMatrix4(e),n.points[1].set(this.m_value[3],this.m_value[1],this.m_value[2]).applyMatrix4(e),n.points[2].set(this.m_value[3],this.m_value[1],this.m_value[5]).applyMatrix4(e),n.points[3].set(this.m_value[0],this.m_value[1],this.m_value[5]).applyMatrix4(e),n.points[4].set(this.m_value[0],this.m_value[4],this.m_value[2]).applyMatrix4(e),n.points[5].set(this.m_value[3],this.m_value[4],this.m_value[2]).applyMatrix4(e),n.points[6].set(this.m_value[3],this.m_value[4],this.m_value[5]).applyMatrix4(e),n.points[7].set(this.m_value[0],this.m_value[4],this.m_value[5]).applyMatrix4(e),this.Init();for(var t=0;t<8;++t)this.AddVector(n.points[t])},e.toArray=function(){return this.m_value},n}(),pr=(Y.points=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3],function(){function e(){this.m_size=0,this.m_nodes=[],this.m_primIds=[]}var t=e.prototype;return t.Reset=function(){this.m_nodes=[],this.m_primIds=[],this.m_size=0},t.SetNumEstimateNodes=function(e){for(var t=0;tt){var n=t/4;(n=n<16?16:n)=this.m_maxLevel||f.m_value[m]P&&(i[z+W]=O[H-r],++W);return N.SetFromBox(m[P]),j.SetFromBox(w[P+1]),_.SetFromBox(g[P]),V.SetFromBox(b[P+1]),z},t.getMatrixId=function(e){for(var t=0,n=this.matrixs.length;t\n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\n\t\tuniform float linewidth;\n\t\tuniform vec2 resolution;\n\n\t\tattribute vec3 instanceStart;\n\t\tattribute vec3 instanceEnd;\n\n\t\tattribute vec3 instanceColorStart;\n\t\tattribute vec3 instanceColorEnd;\n\n\t\t#ifdef WORLD_UNITS\n\n\t\t\tvarying vec4 worldPos;\n\t\t\tvarying vec3 worldStart;\n\t\t\tvarying vec3 worldEnd;\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tvarying vec2 vUv;\n\n\t\t\t#endif\n\n\t\t#else\n\n\t\t\tvarying vec2 vUv;\n\n\t\t#endif\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashScale;\n\t\t\tattribute float instanceDistanceStart;\n\t\t\tattribute float instanceDistanceEnd;\n\t\t\tvarying float vLineDistance;\n\n\t\t#endif\n\n\t\tvoid trimSegment( const in vec4 start, inout vec4 end ) {\n\n\t\t\t// trim end segment so it terminates between the camera plane and the near plane\n\n\t\t\t// conservative estimate of the near plane\n\t\t\tfloat a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column\n\t\t\tfloat b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column\n\t\t\tfloat nearEstimate = - 0.5 * b / a;\n\n\t\t\tfloat alpha = ( nearEstimate - start.z ) / ( end.z - start.z );\n\n\t\t\tend.xyz = mix( start.xyz, end.xyz, alpha );\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\t#ifdef USE_COLOR\n\n\t\t\t\tvColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd;\n\n\t\t\t#endif\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tvLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd;\n\t\t\t\tvUv = uv;\n\n\t\t\t#endif\n\n\t\t\tfloat aspect = resolution.x / resolution.y;\n\n\t\t\t#ifdef USE_MODELMATRIXATTRIB\n\t\t\t\tmat4 ndsModelViewMatrix = viewMatrix * modelMatrixAttrib;\n\t\t\t\t// camera space\n\t\t\t\tvec4 start = ndsModelViewMatrix * vec4( instanceStart, 1.0 );\n\t\t\t\tvec4 end = ndsModelViewMatrix * vec4( instanceEnd, 1.0 );\n\t\t\t#else\n\t\t\t\t// camera space\n\t\t\t\tvec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );\n\t\t\t\tvec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 );\n\t\t\t#endif\n\n\t\t\t#ifdef WORLD_UNITS\n\n\t\t\t\tworldStart = start.xyz;\n\t\t\t\tworldEnd = end.xyz;\n\n\t\t\t#else\n\n\t\t\t\tvUv = uv;\n\n\t\t\t#endif\n\n\t\t\t// special case for perspective projection, and segments that terminate either in, or behind, the camera plane\n\t\t\t// clearly the gpu firmware has a way of addressing this issue when projecting into ndc space\n\t\t\t// but we need to perform ndc-space calculations in the shader, so we must address this issue directly\n\t\t\t// perhaps there is a more elegant solution -- WestLangley\n\n\t\t\tbool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column\n\n\t\t\tif ( perspective ) {\n\n\t\t\t\tif ( start.z < 0.0 && end.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( start, end );\n\n\t\t\t\t} else if ( end.z < 0.0 && start.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( end, start );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// clip space\n\t\t\tvec4 clipStart = projectionMatrix * start;\n\t\t\tvec4 clipEnd = projectionMatrix * end;\n\n\t\t\t// ndc space\n\t\t\tvec3 ndcStart = clipStart.xyz / clipStart.w;\n\t\t\tvec3 ndcEnd = clipEnd.xyz / clipEnd.w;\n\n\t\t\t// direction\n\t\t\tvec2 dir = ndcEnd.xy - ndcStart.xy;\n\n\t\t\t// account for clip-space aspect ratio\n\t\t\tdir.x *= aspect;\n\t\t\tdir = normalize( dir );\n\n\t\t\t#ifdef WORLD_UNITS\n\n\t\t\t\t// get the offset direction as perpendicular to the view vector\n\t\t\t\tvec3 worldDir = normalize( end.xyz - start.xyz );\n\t\t\t\tvec3 offset;\n\t\t\t\tif ( position.y < 0.5 ) {\n\n\t\t\t\t\toffset = normalize( cross( start.xyz, worldDir ) );\n\n\t\t\t\t} else {\n\n\t\t\t\t\toffset = normalize( cross( end.xyz, worldDir ) );\n\n\t\t\t\t}\n\n\t\t\t\t// sign flip\n\t\t\t\tif ( position.x < 0.0 ) offset *= - 1.0;\n\n\t\t\t\tfloat forwardOffset = dot( worldDir, vec3( 0.0, 0.0, 1.0 ) );\n\n\t\t\t\t// don't extend the line if we're rendering dashes because we\n\t\t\t\t// won't be rendering the endcaps\n\t\t\t\t#ifndef USE_DASH\n\n\t\t\t\t\t// extend the line bounds to encompass endcaps\n\t\t\t\t\tstart.xyz += - worldDir * linewidth * 0.5;\n\t\t\t\t\tend.xyz += worldDir * linewidth * 0.5;\n\n\t\t\t\t\t// shift the position of the quad so it hugs the forward edge of the line\n\t\t\t\t\toffset.xy -= dir * forwardOffset;\n\t\t\t\t\toffset.z += 0.5;\n\n\t\t\t\t#endif\n\n\t\t\t\t// endcaps\n\t\t\t\tif ( position.y > 1.0 || position.y < 0.0 ) {\n\n\t\t\t\t\toffset.xy += dir * 2.0 * forwardOffset;\n\n\t\t\t\t}\n\n\t\t\t\t// adjust for linewidth\n\t\t\t\toffset *= linewidth * 0.5;\n\n\t\t\t\t// set the world position\n\t\t\t\tworldPos = ( position.y < 0.5 ) ? start : end;\n\t\t\t\tworldPos.xyz += offset;\n\n\t\t\t\t// project the worldpos\n\t\t\t\tvec4 clip = projectionMatrix * worldPos;\n\n\t\t\t\t// shift the depth of the projected points so the line\n\t\t\t\t// segments overlap neatly\n\t\t\t\tvec3 clipPose = ( position.y < 0.5 ) ? ndcStart : ndcEnd;\n\t\t\t\tclip.z = clipPose.z * clip.w;\n\n\t\t\t#else\n\n\t\t\t\tvec2 offset = vec2( dir.y, - dir.x );\n\t\t\t\t// undo aspect ratio adjustment\n\t\t\t\tdir.x /= aspect;\n\t\t\t\toffset.x /= aspect;\n\n\t\t\t\t// sign flip\n\t\t\t\tif ( position.x < 0.0 ) offset *= - 1.0;\n\n\t\t\t\t// endcaps\n\t\t\t\tif ( position.y < 0.0 ) {\n\n\t\t\t\t\toffset += - dir;\n\n\t\t\t\t} else if ( position.y > 1.0 ) {\n\n\t\t\t\t\toffset += dir;\n\n\t\t\t\t}\n\n\t\t\t\t// adjust for linewidth\n\t\t\t\toffset *= linewidth;\n\n\t\t\t\t// adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ...\n\t\t\t\toffset /= resolution.y;\n\n\t\t\t\t// select end\n\t\t\t\tvec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;\n\n\t\t\t\t// back to clip space\n\t\t\t\toffset *= clip.w;\n\n\t\t\t\tclip.xy += offset;\n\n\t\t\t#endif\n\n\t\t\tgl_Position = clip;\n\n\t\t\tvec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation\n\n\t\t\t#include \n\t\t\t#include \n\t\t\t#include \n\n\t\t}\n\t\t",fragmentShader:"\n\t\tuniform vec3 diffuse;\n\t\tuniform float opacity;\n\t\tuniform float linewidth;\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashOffset;\n\t\t\tuniform float dashSize;\n\t\t\tuniform float gapSize;\n\n\t\t#endif\n\n\t\tvarying float vLineDistance;\n\n\t\t#ifdef WORLD_UNITS\n\n\t\t\tvarying vec4 worldPos;\n\t\t\tvarying vec3 worldStart;\n\t\t\tvarying vec3 worldEnd;\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tvarying vec2 vUv;\n\n\t\t\t#endif\n\n\t\t#else\n\n\t\t\tvarying vec2 vUv;\n\n\t\t#endif\n\n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\n\t\tvec2 closestLineToLine(vec3 p1, vec3 p2, vec3 p3, vec3 p4) {\n\n\t\t\tfloat mua;\n\t\t\tfloat mub;\n\n\t\t\tvec3 p13 = p1 - p3;\n\t\t\tvec3 p43 = p4 - p3;\n\n\t\t\tvec3 p21 = p2 - p1;\n\n\t\t\tfloat d1343 = dot( p13, p43 );\n\t\t\tfloat d4321 = dot( p43, p21 );\n\t\t\tfloat d1321 = dot( p13, p21 );\n\t\t\tfloat d4343 = dot( p43, p43 );\n\t\t\tfloat d2121 = dot( p21, p21 );\n\n\t\t\tfloat denom = d2121 * d4343 - d4321 * d4321;\n\n\t\t\tfloat numer = d1343 * d4321 - d1321 * d4343;\n\n\t\t\tmua = numer / denom;\n\t\t\tmua = clamp( mua, 0.0, 1.0 );\n\t\t\tmub = ( d1343 + d4321 * ( mua ) ) / d4343;\n\t\t\tmub = clamp( mub, 0.0, 1.0 );\n\n\t\t\treturn vec2( mua, mub );\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\t#include \n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tif ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps\n\n\t\t\t\tif ( mod( vLineDistance + dashOffset, dashSize + gapSize ) > dashSize ) discard; // todo - FIX\n\n\t\t\t#endif\n\n\t\t\tfloat alpha = opacity;\n\n\t\t\t#ifdef WORLD_UNITS\n\n\t\t\t\t// Find the closest points on the view ray and the line segment\n\t\t\t\tvec3 rayEnd = normalize( worldPos.xyz ) * 1e5;\n\t\t\t\tvec3 lineDir = worldEnd - worldStart;\n\t\t\t\tvec2 params = closestLineToLine( worldStart, worldEnd, vec3( 0.0, 0.0, 0.0 ), rayEnd );\n\n\t\t\t\tvec3 p1 = worldStart + lineDir * params.x;\n\t\t\t\tvec3 p2 = rayEnd * params.y;\n\t\t\t\tvec3 delta = p1 - p2;\n\t\t\t\tfloat len = length( delta );\n\t\t\t\tfloat norm = len / linewidth;\n\n\t\t\t\t#ifndef USE_DASH\n\n\t\t\t\t\t#ifdef USE_ALPHA_TO_COVERAGE\n\n\t\t\t\t\t\tfloat dnorm = fwidth( norm );\n\t\t\t\t\t\talpha = 1.0 - smoothstep( 0.5 - dnorm, 0.5 + dnorm, norm );\n\n\t\t\t\t\t#else\n\n\t\t\t\t\t\tif ( norm > 0.5 ) {\n\n\t\t\t\t\t\t\tdiscard;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t#endif\n\n\t\t\t\t#endif\n\n\t\t\t#else\n\n\t\t\t\t#ifdef USE_ALPHA_TO_COVERAGE\n\n\t\t\t\t\t// artifacts appear on some hardware if a derivative is taken within a conditional\n\t\t\t\t\tfloat a = vUv.x;\n\t\t\t\t\tfloat b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;\n\t\t\t\t\tfloat len2 = a * a + b * b;\n\t\t\t\t\tfloat dlen = fwidth( len2 );\n\n\t\t\t\t\tif ( abs( vUv.y ) > 1.0 ) {\n\n\t\t\t\t\t\talpha = 1.0 - smoothstep( 1.0 - dlen, 1.0 + dlen, len2 );\n\n\t\t\t\t\t}\n\n\t\t\t\t#else\n\n\t\t\t\t\tif ( abs( vUv.y ) > 1.0 ) {\n\n\t\t\t\t\t\tfloat a = vUv.x;\n\t\t\t\t\t\tfloat b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;\n\t\t\t\t\t\tfloat len2 = a * a + b * b;\n\n\t\t\t\t\t\tif ( len2 > 1.0 ) discard;\n\n\t\t\t\t\t}\n\n\t\t\t\t#endif\n\n\t\t\t#endif\n\n\t\t\tvec4 diffuseColor = vec4( diffuse, alpha );\n\n\t\t\t#include \n\t\t\t#include \n\n\t\t\tgl_FragColor = vec4( diffuseColor.rgb, alpha );\n\n\t\t\t#include \n\t\t\t#include \n\t\t\t#include \n\t\t\t#include \n\n\t\t}\n\t\t"};var Ar=function(n){function e(e){var t=n.call(this,{type:"LineMaterialOrigin",uniforms:THREE.UniformsUtils.clone(THREE.ShaderLib.line.uniforms),vertexShader:THREE.ShaderLib.line.vertexShader,fragmentShader:THREE.ShaderLib.line.fragmentShader,clipping:!0})||this;return t.isLineMaterial=!0,t.setValues(e),t}var t,i,r;return i=n,(t=e).prototype=Object.create(i.prototype),gr(t.prototype.constructor=t,i),t=e,(i=[{key:"color",get:function(){return this.uniforms.diffuse.value},set:function(e){this.uniforms.diffuse.value=e}},{key:"worldUnits",get:function(){return"WORLD_UNITS"in this.defines},set:function(e){!0===e?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}},{key:"linewidth",get:function(){return this.uniforms.linewidth.value},set:function(e){this.uniforms.linewidth&&(this.uniforms.linewidth.value=e)}},{key:"dashed",get:function(){return"USE_DASH"in this.defines},set:function(e){!0===e!==this.dashed&&(this.needsUpdate=!0),!0===e?this.defines.USE_DASH="":delete this.defines.USE_DASH}},{key:"dashScale",get:function(){return this.uniforms.dashScale.value},set:function(e){this.uniforms.dashScale.value=e}},{key:"dashSize",get:function(){return this.uniforms.dashSize.value},set:function(e){this.uniforms.dashSize.value=e}},{key:"dashOffset",get:function(){return this.uniforms.dashOffset.value},set:function(e){this.uniforms.dashOffset.value=e}},{key:"gapSize",get:function(){return this.uniforms.gapSize.value},set:function(e){this.uniforms.gapSize.value=e}},{key:"opacity",get:function(){return this.uniforms.opacity.value},set:function(e){this.uniforms&&(this.uniforms.opacity.value=e)}},{key:"resolution",get:function(){return this.uniforms.resolution.value},set:function(e){this.uniforms.resolution.value.copy(e)}},{key:"alphaToCoverage",get:function(){return"USE_ALPHA_TO_COVERAGE"in this.defines},set:function(e){this.defines&&(!0===e!==this.alphaToCoverage&&(this.needsUpdate=!0),!0===e?(this.defines.USE_ALPHA_TO_COVERAGE="",this.extensions.derivatives=!0):(delete this.defines.USE_ALPHA_TO_COVERAGE,this.extensions.derivatives=!1))}}])&&mr(t.prototype,i),r&&mr(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}(THREE.ShaderMaterial);function yr(e,t){var n,i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(i)return(i=i.call(e)).next.bind(i);if(Array.isArray(e)||(i=function(e,t){{var n;if(e)return"string"==typeof e?Er(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Er(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length)return i&&(e=i),n=0,function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Er(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n=T.maxFPS+5)A=T.maxFPS;else{1<=e-v&&(v=e);var n=0===e?100:A/T.minFPS*T.maxFrameTime;if((_T.minFPS&&o>T.renderer.maxPrimitivesPerFrame&&(T.renderer.maxPrimitivesPerFrame=o)}E.length=y.length=0}e={timeStamp:e,fps:A,needsRedraw:!1};if(f.modelRequestor&&f.modelRequestor.request(),f.ndsModel&&!f.ndsModel.isEmpty()&&f.ndsModel.update(e),Te.update(e),t){if(f.enableProgressiveRender||(n=1e4),null!=m)for(var a=0,s=m.length;a=T.renderer.maxPrimitivesPerFrame&&y.push(d)):(T.showLineObjects(T.scene,!1),T.positionMaterial.uniforms.cameraNear.value=T.camera.near,T.positionMaterial.uniforms.cameraFar.value=T.camera.far,T.scene.overrideMaterial=T.positionMaterial,T.renderer.render(T.scene,T.camera,T.positionTarget,!0),T.scene.overrideMaterial=T.normalMaterial,T.renderer.render(T.scene,T.camera,T.normalTarget,!0),T.scene.overrideMaterial=null,T.showLineObjects(T.scene,!0),T.renderer.render(T.scene,T.camera,T.normalRenderTarget,!0)),T.ssaoComposer.render();else if(T.ndsModel){if(T.forceClear&&(T.renderer.clearTarget(T.renderer.colorTarget,!0,!0,!1),T.ndsModel.setDirty()),void 0!==T.backGroundScene&&!g&&T.forceClear&&T.renderer.render(T.backGroundScene,T.backGroundCamera,T.renderer.colorTarget),T.envMapScene&&!w&&T.forceClear&&(b?(T.renderer.render(T.envMapScene,T.envMapCamera,T.envMapBlurTargetH),T.envMapBlurPassV.render(T.renderer,T.envMapBlurTargetV,T.envMapBlurTargetH),T.envMapBlurPassH.render(T.renderer,T.renderer.colorTarget,T.envMapBlurTargetV)):T.renderer.render(T.envMapScene,T.envMapCamera,T.renderer.colorTarget)),D&&T.groundShadow.needClear&&(T.groundShadow.clear(),T.groundShadow.needClear=!1),D&&!T.groundShadow.isValid()&&F&&(T.groundShadow.renderIntoShadow(T.scene),T.groundShadow.postprocess()),F||g){T.clipPlaneManager.renderClipPlane(),T.renderer.clippingPlanes=t;for(var d=0,c=T.ndsModel.SHADED_WITH_EDGES,h=(4===O?c=T.ndsModel.SHADED_WITH_EDGES:5===O?c=T.ndsModel.SHADED:2===O?c=T.ndsModel.WIREFRAME:6===O?c=T.ndsModel.HIDDEN_LINE_REMOVE:7===O?c=T.ndsModel.HIDDEN_LINE_VISIBLE:8===O&&(c=T.ndsModel.TRANSPARENT),c!==T.ndsModel.SHADED_WITH_EDGES||T.bLinesVisibility||(c=T.ndsModel.SHADED),T.ndsModel.setDrawMode(c),T.scene.children.push(T.ndsModel),T.renderer.render(T.scene,T.camera,T.renderer.colorTarget,!1,!1,!1,n),d+=T.renderer.info.render.triangles+T.renderer.info.render.lines,_e.enableOutlineEffect&&T.forceClear?f.outlinePass.render(T.renderer,null,T.renderer.colorTarget):f.selectionOutlinePass&&T.selectionManager.shouldApplySelectedMaterial&&!f.isNdsModelInWireframeMode(O)&&T.forceClear&&f.selectionOutlinePass.render(T.renderer,null,T.renderer.colorTarget),ee&&f.isNdsModelInWireframeMode(O)&&!T.is2DModel&&(T.composer.colorTarget.uuid!=T.renderer.colorTarget.uuid&&T.composer.setColorTarget(T.renderer.colorTarget),T.composer.render()),T.renderer.clippingPlanes=[],T.renderer.colorTarget&&T.forceClear&&D&&T.groundShadow.isValid()&&T.groundShadow.renderShadow(T.camera,T.renderer.colorTarget),T.forceClear&&(T.clipPlaneManager.renderClipScene(T.renderer.colorTarget),T.clipBoxManager.renderClipBox(T.renderer.colorTarget),T.selectionManager.renderSelectionScene(T.renderer.colorTarget),T.additionalObjectsScene)&&(T.renderer.render(T.additionalObjectsScene,T.camera,T.renderer.colorTarget),d+=T.renderer.info.render.triangles+T.renderer.info.render.lines),T.ndsModel.referenceEntityDirty&&0=T.renderer.maxPrimitivesPerFrame&&y.push(d),T.renderer.colorTarget&&(T.forceClear||F)&&$.render(T.renderer,null,T.renderer.colorTarget.texture),T.forceClear=!1,T.controls.staticDrawGeomOp&&T.controls.staticDrawGeomOp.renderGeomScene(),f.renderWaterMark(),T.controls.staticmeasureOp&&T.controls.staticmeasureOp.renderMeasureScene(),T.controls.staticAnnotation&&T.controls.staticAnnotation.renderAnnotation(),T.ndsModel.getMeshSets()),u=0,p=0,s=h.length;pT.camera.far&&(T.camera.far=a),T.viewBox&&T.cameraControl.updateViewBoxCamDir(),T.camera.updateProjectionMatrix(),T.camera.updateMatrixWorld(!0),T.ScenarioEditorInfo.EulerAngle.set(THREE.Math.degToRad(e.x),THREE.Math.degToRad(e.y),THREE.Math.degToRad(e.z))}t&&(i=T.camera.getOrginalCameraInfo(),n=new THREE.Vector3(i.position.x-i.center.x,i.position.y-i.center.y,i.position.z-i.center.z).length(),r=T.getCameraInfo(),o=new THREE.Vector3(r.target.x,r.target.y,r.target.z),s=new THREE.Vector3(r.position.x,r.position.y,r.position.z).sub(o).normalize().multiplyScalar(n/20*t),T.camera.position.copy(s.add(o)),(a=T.cameraControl.calFarthestDistToCamera())>T.camera.far&&(T.camera.far=a),T.camera.updateProjectionMatrix(),T.camera.updateMatrixWorld(!0)),T.groundShadowChange(),T.render()},f.getDwgScale=function(){return this.dwgScale},f.getScreenCapture=function(e,t,n){return this.getScreenCapture2(e,!1,!1,t,n),"111"},f.getScreenCapture2=function(a,s,e,l,d,t,c){function h(e,t,n,i){t&&t(e),n&&T.dispatchEvent({type:"snapEvent",cameraInfo:T.getCameraInfo(),imgData:e}),i&&(t="
",(n=window.open()).document.open(),n.document.write(t),n.document.close())}void 0===c&&(c=!1);var u,p=!0===t,f=e&&T.watermark&&T.excalibur,m=(T.lightControls.getVisible()&&(u=!0),null!=d&&d||u&&T.lightControls.setVisible(!1),!1),g=!1,v=!1,A=!1,y=!1,E=!1;function M(e){var t,n,i,r,e=e.userData.precent,o=T.ndsModel.getLineSegmentsSet();e<.99||4===O&&o.dirty||(t=document.createElement("canvas"),n=t.getContext("2d"),e=T.renderer.domElement.toDataURL(),i=T.canvas2D.toDataURL(),t.width=T.renderer.domElement.width,t.height=T.renderer.domElement.height,n.fillStyle=T.container.style.backgroundColor,n.fillRect(0,0,t.width,t.height),(r=new Image).onload=function(){var e;n.globalAlpha=1,n.drawImage(r,0,0),f||p?((e=new Image).onload=function(){c||n.drawImage(e,0,0),h(t.toDataURL(),a,s,l)},e.src=i):h(t.toDataURL(),a,s,l)},r.src=e,T.removeEventListener("updateProgress",M),T.isSectionViewEnabled()&&(m&&T.clipPlaneManager.hideShowClipPlane(!0),g)&&T.clipPlaneManager.onOpenClipControl(),v&&T.isSectionBoxViewEnabled()&&T.clipBoxManager.displaySectionBox(!0),A&&T.controls.staticmeasureOp&&T.controls.staticmeasureOp.setMeasureVisible(!0),E&&T.controls.staticAnnotation&&(T.controls.staticAnnotation.rootObject.visible=!0),y&&T.ndsModel.explodeObject&&T.explodeAxis&&this.setExplodeAxisVisible(!0,T.explodeAxis),null!=d&&d||u&&T.lightControls.setVisible(!0),T.render())}!c&&this.isSectionViewEnabled()&&(this.clipPlaneManager.getClipPlaneVisible()&&(this.clipPlaneManager.hideShowClipPlane(!1),m=!0),this.clipPlaneManager.getClipControlVisible())&&(this.clipPlaneManager.onCloseClipControl(),g=!0),!c&&this.isSectionBoxViewEnabled()&&this.clipBoxManager.getSectionBoxVisible()&&(this.clipBoxManager.displaySectionBox(!1),v=!0),!c&&T.controls.staticmeasureOp&&!p&&T.controls.staticmeasureOp.getMeasureVisible()&&(T.controls.staticmeasureOp.setMeasureVisible(!1),A=!0),!c&&T.controls.staticAnnotation&&(T.controls.staticAnnotation.rootObject.visible=!1,E=!0),!c&&this.ndsModel.explodeObject&&this.ndsModel.explodeObject.visible&&this.explodeAxis&&this.ndsModel.explodeObject.getAxisVisible(this.explodeAxis)&&(this.setExplodeAxisVisible(!1),y=!0),T.render(),T.addEventListener("updateProgress",M,!1)},f.getImagePortion=function(e,t,n,i,r,o){var a=document.createElement("canvas"),s=a.getContext("2d"),l=(a.width=t,a.height=n,document.createElement("canvas")),d=l.getContext("2d");return l.width=e.width,l.height=e.height,d.drawImage(e,0,0),s.drawImage(l,i,r,t*o,n*o,0,0,t,n),a.toDataURL()},f.getScreenCapturethumbnailByData=function(a,e){var s,l=1280,d=768,c=(e&&(l=e.width||l,d=e.height||d,s=e.backgroundColor,t=e.opacity,f=e.cameraPosition,m=e.cameraTarget),this.getBackgroundstate()),h=(c.alpha=this.renderer.getClearAlpha(),c.alpha),e=(void 0!==s&&s&&("envmap"==c.backgroundtype?(c.envmapUrls=this.envmapUrls,c.envmapUrlsindex=this.envmapUrlsindex,c.envMapCamera=this.envMapCamera,c.envMapScene=this.envMapScene,this.envMapTexture&&(c.envMapTexture=this.envMapTexture.clone()),this.envMapMaterial&&(c.envMapMaterial=this.envMapMaterial.clone()),c.exchangeBackImage=this.exchangeBackImage):"Image"==c.backgroundtype&&(c.backGroundScene=this.backGroundScene,c.backGroundCamera=this.backGroundCamera,c.backGroundMesh=this.backGroundMesh,this.backGroundMesh)&&this.backGroundMesh.material&&this.backGroundMesh.material.map&&(c.backGroundMesh.material.map=this.backGroundMesh.material.map.clone()),(e=new THREE.Color).set(s),this.setBackGroundColor(e.getHex())),void 0!==t&&(h=t,this.bBackGroundTransparent?this.renderer.setClearAlpha(0):this.renderer.setClearAlpha(t)),this.onWindowResize(null,2*l,2*d),new THREE.Vector3),t=new THREE.Vector3,n={flag:!0},i=(this.is2DModel?(p=this.modelRootObject.boundingBox.clone(),this.computeVisibleBoundingBox(this.scene,e,t,n,void 0,!0),i=p.max.x-p.min.x,o=p.max.y-p.min.y,r=this.modelRootObject.boundingBox.max.x-this.modelRootObject.boundingBox.min.x,u=this.modelRootObject.boundingBox.max.y-this.modelRootObject.boundingBox.min.y,(i.25*r.length()&&(this.camera.near=.25*r.length()),this.camera.perpNear>.25*r.length()&&(this.camera.perpNear=.25*r.length()),new THREE.Vector3(0,0,0).sub(new THREE.Vector3(1,1,1))),t=(this.camera.getOrginalCameraInfo()&&(p=new THREE.Vector3,n=new THREE.Vector3,p.copy(this.camera.getOrginalCameraInfo().center),n.copy(this.camera.getOrginalCameraInfo().position),p.sub(n),p.normalize(),u.copy(p)),u.normalize(),u.multiplyScalar(o),i.clone().sub(u)),e=(this.groundShadow.updateGroundTransform(this.camera,this.modelRootObject.boundingBox),this.camera.setOrthoNear(this.modelRootObject.boundingBox),f?this.camera.position.set(f.x,f.y,f.z):this.camera.position.copy(t),m?this.camera.setCameraTarget(new THREE.Vector3(m.x,m.y,m.z)):this.camera.setCameraTarget(i),this.camera.updateProjectionMatrix(),this.camera.updateMatrixWorld(!0),this.render(),this.modelRootObject.boundingBox),r=[],n=(r[0]=e.max.x,r[1]=e.max.y,r[2]=e.max.z,this.modelCoordToClientCoord(r)),p=((r=[])[0]=e.min.x,r[1]=e.max.y,r[2]=e.min.z,this.modelCoordToClientCoord(r)),o=((r=[])[0]=e.min.x,r[1]=e.max.y,r[2]=e.max.z,this.modelCoordToClientCoord(r)),u=((r=[])[0]=e.max.x,r[1]=e.max.y,r[2]=e.min.z,this.modelCoordToClientCoord(r)),f=((r=[])[0]=e.min.x,r[1]=e.min.y,r[2]=e.min.z,this.modelCoordToClientCoord(r)),t=((r=[])[0]=e.min.x,r[1]=e.min.y,r[2]=e.max.z,this.modelCoordToClientCoord(r)),m=((r=[])[0]=e.max.x,r[1]=e.min.y,r[2]=e.min.z,this.modelCoordToClientCoord(r)),i=((r=[])[0]=e.max.x,r[1]=e.min.y,r[2]=e.max.z,this.modelCoordToClientCoord(r)),e=Math.max(n[0],p[0],o[0],u[0],f[0],t[0],m[0],i[0]),r=Math.min(n[0],p[0],o[0],u[0],f[0],t[0],m[0],i[0]),g=Math.max(n[1],p[1],o[1],u[1],f[1],t[1],m[1],i[1]),n=Math.min(n[1],p[1],o[1],u[1],f[1],t[1],m[1],i[1]),v=(e*=this.renderer.getPixelRatio(),r*=this.renderer.getPixelRatio(),g*=this.renderer.getPixelRatio(),n*=this.renderer.getPixelRatio(),e-r),A=g-n,y=0,E=0,M=(dmodify the model and try again":"存在重复实体
请修改后重新上传",o.style.height="84px",o.style.display="block",Se.isMobileDevice()||(o.innerHTML=t?"Entity already exist please modify the model and try again":"提示:存在重复实体请修改后重新上传",o.style.height="42px"),setTimeout(function(){T.container.removeChild(o)},3e3)),T.is2DModel||!T.sceneInfo&&T.CADViewer||(y=T.ndsModel.rootBodyNode,T.camera.setOrginalCameraInfo(void 0),m=new THREE.Vector3,g=new THREE.Vector3,T.computeBoundingBox(T.scene,m,g,v={flag:!0}),T.controls.setBoundingBox(m,g),T.selectionManager.clearSelection(),T.switchRotateCenterBySelection(),T.resetCamera(A={smoothTranslation:!1}),e=T.getCameraInfo(),T.camera.setOrginalCameraInfo({center:new THREE.Vector3(e.target.x,e.target.y,e.target.z),up:new THREE.Vector3(e.up.x,e.up.y,e.up.z),position:new THREE.Vector3(e.position.x,e.position.y,e.position.z)}),1=r.start&&e<=r.end&&r.start!=r.end)return n.end=r.end,1}}function pe(e){for(var t=[],n=null,i=null,r=0;rmodify the model and try again":"当前模型暂不支持插入",e.style.height="84px",e.style.display="block",Se.isMobileDevice()||(e.innerHTML=i?"Entity already exist please modify the model and try again":"当前模型暂不支持插入",e.style.height="42px"),setTimeout(function(){T.container.removeChild(e)},3e3),T.dispatchEvent({type:"loadBegin"}),T.dispatchEvent({type:"BrepInfoEvent",faceArea:!1,bodyVolume:!1,totalVolume:!1,bodyArea:!1,totalArea:!1,boundingbox:!1,facePerimeter:!1}),T.dispatchEvent({type:"BVHInfoEvent",hasbvh:!1}),T.dispatchEvent({type:"PMIInfoEvent",PMI:!1}),T.dispatchAsyncEvent({type:"geometryAllLoadedEvent",modelLoadedTime:-1,wholeModelLoadedTime:-1,modelInfo:{}}),T.dispatchEvent({type:"insertfailed",ModelLength:T.ndsModel.models.length}),F=!0,void(T.sceneInfo=null);T.sceneInfo.setScene=!0,T.sceneInfo.ScenarioEditorid=_e.ScenarioEditorid}if(T.sceneInfo)for(var r=0;rr.characterWidthHeight[2*h+1]?c:r.characterWidthHeight[2*h+1]);if(r.mirrorX&&"number"==typeof r.rectWidth&&(p=d,d=r.rectWidth-l,l=r.rectWidth-p),D.has(n)){var u=[],p={},f={},m=1/0,g=1/0,v=1/0,A=1/0,y=-1/0,E=1/0;if(t.forEach(function(e){var t=D.get(e)[0],t=(m=Math.min(t.x,m),g=Math.min(t.y,g),v=Math.min(t.z,v),D.get(e)[3]);A=Math.min(t.x,A),y=Math.max(t.y,y),E=Math.min(t.z,E)}),p.x=m,p.y=g,p.z=v,f.x=A,f.y=y,f.z=E,u.push(b={x:p.x+d+s,y:p.y,z:0},I={x:p.x+l+i,y:p.y,z:0},T={x:f.x+l+i,y:f.y,z:0},x={x:f.x+d+s,y:f.y,z:0}),a.worldMatrix&&a.worldMatrix.length)for(var M=0;M=Math.abs(l.y)*Math.PI/180,e=0=Math.abs(l.x)*Math.PI/180,t||e)&&(this.scene.updateMatrixWorld(!0),this.controls.SetBoundingBoxUpdated(!1),this.scene.traverse(function(e){e.hasOwnProperty("geometry")&&"lightctrls"!=e.name&&(e.matrixWorldTransOrginal&&(e.matrixWorldTransOrginal=void 0),e.matrixWorldTransOrginalDrag)&&(e.matrixWorldTransOrginalDrag=void 0)}),null!=T.modelSceneOrgin&&T.modelSceneOrgin!=this.scene&&(T.modelSceneOrgin.updateMatrixWorld(!0),T.modelSceneOrgin.traverse(function(e){e.hasOwnProperty("geometry")&&"lightctrls"!=e.name&&(e.matrixWorldTransOrginal&&(e.matrixWorldTransOrginal=void 0),e.matrixWorldTransOrginalDrag)&&(e.matrixWorldTransOrginalDrag=void 0)})),this.camera.setOrginalCameraInfo(void 0),this.camera.up.set(0,1,0),t=new THREE.Matrix4,Math.abs(l.y)<4.5?t.lookAt(new THREE.Vector3(1,0,1),new THREE.Vector3,this.camera.up):t.lookAt(new THREE.Vector3(1,.1,1),new THREE.Vector3,this.camera.up),this.camera.quaternion.setFromRotationMatrix(t),this.resetCamera({useOrginal:!0}))},f.getModelOperationVerticalRotationRange=function(){return l},f.isLineExisted=function(){var t=!1;return this.scene.traverse(function(e){(e instanceof THREE.Line||e instanceof THREE.LineSegments)&&e.hasOwnProperty("geometry")&&e.hasOwnProperty("material")&&(T.materialsSetting&&T.materialsSetting.getMaterialsMarkersMat()==e.material||(t=!0))}),t},f.isModelExplosionAbled=function(){void 0===THREE.Object3D.prototype.tranverseWithCondition&&(THREE.Object3D.prototype.tranverseWithCondition=function(e){if(!e(this))for(var t=this.children,n=0,i=t.length;nthis.countermandarray.length-2||!e&&this.countermandflag<1||this.countermandarray.length<2)){e?this.countermandflag++:this.countermandflag--;var t=this.countermandarray[this.countermandflag];if(t.meshVisible&&T.ndsModel){T.ndsModel.hideBody(T.ndsModel.rootBodyNode);for(var n=0;nthis.countermandarray.length-2||!e&&this.countermandflag<1||this.countermandarray.length<2)},f.getObjectProByName=function(e,o){var t,a=new Array(o.length);return"string"!=typeof e&&(e=e.toString()),T.bodyUuid2ClonedNodeMap[e]&&T.bodyUuid2ClonedNodeMap[e].propertyfile&&T.bodyUuid2ClonedNodeMap[e].propertyList?(T.bodyUuid2ClonedNodeMap[e].propertyList.forEach(function(e){for(var t in e)for(var n=e[t],i=0;i