嘉禾二期设备管理
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

78 lines
1.1 MiB

!function(){"use strict";var e=window.Glodon=window.Glodon||{};e.Version="2022-7-20-9-58",function(){function t(e,t){let i=t.split("."),n=e,o=i.length;for(let e=0;e<o;e++)void 0===n[i[e]]&&(n[i[e]]={}),n=n[i[e]];return n}t(e,"Web.Lang.Utility.Namespace").ensureNamespace=t}(),function(){let t=e.Web.Lang.Utility.Namespace.ensureNamespace(e,"Web.Common"),i=function(e){"string"==typeof e&&(e=JSON.parse(res)),this.code=e.code,this.message=e.message};i.prototype={getErrorCode:function(){return this.code},getErrorMessage:function(){return this.message}},t.Error=i}();class t{constructor(e,t,i){this.x=e||0,this.y=t||0,this.z=i||0}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}clone(){return new this.constructor(this.x,this.y,this.z)}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}distanceToSquared(e){var t=this.x-e.x,i=this.y-e.y,n=this.z-e.z;return t*t+i*i+n*n}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}}class i{constructor(e,i){this.min=e||new t(1/0,1/0,1/0),this.max=i||new t(-1/0,-1/0,-1/0)}getSize(){return new t(this.max.x-this.min.x,this.max.y-this.min.y,this.max.z-this.min.z)}setFromCenterAndSize(e,i){let n=new t(i.x,i.y).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}getCenter(){return new t(this.min.x+this.max.x,this.min.y+this.max.y,this.min.z+this.max.z).multiplyScalar(.5)}intersectsBox(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z)}union(e){return this.min.min(e.min),this.max.max(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}expandByPoint(e){return this.min.min(e),this.max.max(e),this}setFromPoints(e){this.makeEmpty();for(var t=0,i=e.length;t<i;t++)this.expandByPoint(e[t]);return this}}!function(){let n=e.Web.Lang.Utility.Namespace.ensureNamespace(e,"Web.Algorithm");n.MeanShift=class{constructor(e,t){this.points=e,this.searchRangeSquared=t**2,this.EPSILON_SQR=.1,this.clusters=[]}setSearchRange(e){this.searchRangeSquared=e**2}setPoints(e){this.points=e}meanShift(e){let t=e.clone(),i=[];for(;;){let e=this.rangeSearch(t);i=this.connect(i,e);let n=this.mean(e);if(t.distanceToSquared(n)<=this.EPSILON_SQR)break;t=n}return i}mean(e){let i=new t;for(const t of e)i.add(t);return i.multiplyScalar(1/e.length),i}rangeSearch(e){let t=[];for(const i of this.points)e.distanceToSquared(i)<=this.searchRangeSquared&&t.push(i);return t}clustering(e,t){0===this.clusters.length?this.clusteringPrepare():this.clusteringAfter(e,t),this.clusters.forEach((e=>{this.resetPointStatus(e.points)}))}clusteringPrepare(){for(const e of this.points){if(e.stopMoving)continue;const t=this.meanShift(e),i=t.length,n=`${t[0].index}_${i}`;this.mergeClusters({points:t,center:this.mean(t),id:n,parent:null,children:[]})}}clusteringAfter(e,t){this.tmpPoints=this.points,this.points=[];let i=[...this.clusters];if(this.clusters=[],!1!==e){for(let e=0;e<i.length;e++){const n=i[e];let o=[];t||this.resetClusterPoints(n.points),this.points=n.points,this.clusteringZoomIn(n,o),this.clusters.push.apply(this.clusters,o)}this.clusters.forEach((e=>{this.resetPointStatus(e.points)}))}else this.clusteringZoomOut(i,t)}clusteringZoomIn(e,t){for(const i of e.points){if(i.stopMoving)continue;const n=this.meanShift(i),o=n.length,s=`${n[0].index}_${o}`;this.mergeClustersInTarget({points:n,center:this.mean(n),id:s,parent:e.id,children:[]},t)}}clusteringZoomOut(e,t){for(let i=0;i<e.length;i++){const n=e[i];t||this.r
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
var C=function(e,t){return C=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},C(e,t)};function P(e,t){function i(){this.constructor=e}C(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}var M,I=function(){function e(){this.xmlns="http://www.w3.org/2000/svg",this.material=null,this.svgNode=null,this.children=[],this.glodonColor="#11DAB7",this.position=new THREE.Vector2}return e.prototype.add=function(e){this.children.push(e)},e.prototype.getSvgNode=function(){return this.svgNode},e.prototype.abtainRenderables=function(e){e.appendChild(this.svgNode)},e.prototype.isMatch=function(e){return this.name==e},e.prototype.highlight=function(){this.svgNode.setAttribute("style","stroke:"+this.glodonColor)},e.prototype.cancelHighlight=function(){this.svgNode.setAttribute("style","stroke:"+this.material.color.getStyle())},e.prototype.locate=function(e,t){this.position.set(e,t),this.move(0,0)},e.prototype.move=function(e,t){var i=this.position.x+e,n=this.position.y+t;this.svgNode.setAttribute("transform","translate("+i+","+n+")")},e}(),D=function(){function e(){this._boxSize=new THREE.Vector2,this._boxCenter=new THREE.Vector2,this._intersect=new THREE.Vector3}return e.prototype.cross=function(e,t,i,n){return(t.x-e.x)*(n.y-i.y)-(t.y-e.y)*(n.x-i.x)},e.prototype.getArea=function(e,t,i){return this.cross(e,t,e,i)},e.prototype.getAbsArea=function(e,t,i){return Math.abs(this.getArea(e,t,i))},e.prototype.getInterPoint=function(e,t,i,n){var o=this.getAbsArea(e,t,i),s=this.getAbsArea(e,t,n);return new THREE.Vector2((n.x*o+i.x*s)/(o+s),(n.y*o+i.y*s)/(o+s))},e.prototype.isAngleGreaterThanPi=function(e,t,i){var n=new THREE.Vector3;return n.crossVectors(e,t),!(n.dot(i)>=0)},e.prototype.normalizedPointToScreen=function(e,t){e.x=e.x*t.width,e.y=-e.y*t.height},e.prototype.screenToNormalizedPoint=function(e,t){e.x=e.x/t.width,e.y=-e.y/t.height},e.prototype.normalizedPointToWorld=function(e,t){t.getSize(this._boxSize),e.x=.5*(e.x+1)*this._boxSize.x+t.min.x,e.y=.5*(e.y+1)*this._boxSize.y+t.min.y},e.prototype.worldToNormalizedPoint=function(e,t){t.getSize(this._boxSize),e.x=(e.x-t.min.x)/this._boxSize.x*2-1,e.y=(e.y-t.min.y)/this._boxSize.y*2-1},e.prototype.toWorldPoint=function(e,t,i,n){e.x<0&&(e.x=0),e.x>t&&(e.x=t),e.y<0&&(e.y=0),e.y>i&&(e.y=i),e.x=e.x/t*2-1,e.y=-e.y/i*2+1,this.normalizedPointToWorld(e,n)},e.prototype.getCuttingBoxOnCanvas=function(e,t,i,n){var o=new THREE.Box3,s=new THREE.Vector2(e.x,e.y),r=new THREE.Vector2(t.x,t.y);this.toWorldPoint(s,i[0],i[1],n),this.toWorldPoint(r,i[0],i[1],n);var a=[];return a.push(new THREE.Vector3(s.x,s.y)),a.push(new THREE.Vector3(s.x,s.y)),a.push(new THREE.Vector3(s.x,r.y)),a.push(new THREE.Vector3(s.x,r.y)),a.push(new THREE.Vector3(r.x,r.y)),a.push(new THREE.Vector3(r.x,r.y)),a.push(new THREE.Vector3(r.x,s.y)),a.push(new THREE.Vector3(r.x,s.y)),o.setFromPoints(a),{min:{x:o.min.x,y:o.min.y,z:0},max:{x:o.max.x,y:o.max.y,z:0}}},e.prototype.canvasPointToClient=function(e,t){var i=t.mapContainer;if(!i||!t.floorPlaneBox)return null;var n=this.getContainerOffsetToClient(i);if(0===n.width||0===n.height)return null;var o=new THREE.Vector2;return o.x=e.x+n.left,o.y=e.y+n.top,o},e.prototype.getMainSceneMatrix=function(e){return e.getScene().getMatrixGlobal()},e.prototype.transformWorldPoint=function(e,t){var i=this.getMainSceneMatrix(e);t.applyMatrix4(i)},e.prototype.expandBbox=function(e,t){var i=e.getCenter(this._boxCenter);e.getSize(this._boxSize);var n=new THREE.Vector2,o=t,s=this._boxSize.x/this._boxSize.y,r=this._boxSize.x,a=this._boxSize.y;s>o?a=r/o:s<o&&(r=a*o),n.set(r,a),e.setFromCenterAndSize(i,n)},e.prototype.containsPointInMainScene=function(e,t){var i=e.getScene().getBoundingBoxWorld();return!!i&&i.containsPoint(t)},e.prototype.isMouseOverCanvas=function(e,t,i){if(e){var n=this.getContainerOffsetToClient(e),o=new THREE.Vector2;if(o.x=i.x-n.left,o.y=i.y-n.top,0===n.width||0===n.height)return!1;var s={width:t[0],height:t[0]};if(o.x>0&&o.x<s.width&&o.y>0&&o.y<s.height)return!0}return!1}
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
var te=function(e,t){return te=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},te(e,t)};function ie(e,t){function i(){this.constructor=e}te(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}var ne,oe=function(){function e(){this.xmlns="http://www.w3.org/2000/svg",this.material=null,this.svgNode=null,this.children=[],this.glodonColor="#11DAB7",this.position=new THREE.Vector2}return e.prototype.add=function(e){this.children.push(e)},e.prototype.getSvgNode=function(){return this.svgNode},e.prototype.abtainRenderables=function(e){e.appendChild(this.svgNode)},e.prototype.isMatch=function(e){return this.name==e},e.prototype.highlight=function(){this.svgNode.setAttribute("style","stroke:"+this.glodonColor)},e.prototype.cancelHighlight=function(){this.svgNode.setAttribute("style","stroke:"+this.material.color.getStyle())},e.prototype.locate=function(e,t){this.position.set(e,t),this.move(0,0)},e.prototype.move=function(e,t){var i=this.position.x+e,n=this.position.y+t;this.svgNode.setAttribute("transform","translate("+i+","+n+")")},e}(),se=function(){function e(){this._boxSize=new THREE.Vector2,this._boxCenter=new THREE.Vector2,this._intersect=new THREE.Vector3}return e.prototype.cross=function(e,t,i,n){return(t.x-e.x)*(n.y-i.y)-(t.y-e.y)*(n.x-i.x)},e.prototype.getArea=function(e,t,i){return this.cross(e,t,e,i)},e.prototype.getAbsArea=function(e,t,i){return Math.abs(this.getArea(e,t,i))},e.prototype.getInterPoint=function(e,t,i,n){var o=this.getAbsArea(e,t,i),s=this.getAbsArea(e,t,n);return new THREE.Vector2((n.x*o+i.x*s)/(o+s),(n.y*o+i.y*s)/(o+s))},e.prototype.isAngleGreaterThanPi=function(e,t,i){var n=new THREE.Vector3;return n.crossVectors(e,t),!(n.dot(i)>=0)},e.prototype.normalizedPointToScreen=function(e,t){e.x=e.x*t.width,e.y=-e.y*t.height},e.prototype.screenToNormalizedPoint=function(e,t){e.x=e.x/t.width,e.y=-e.y/t.height},e.prototype.normalizedPointToWorld=function(e,t){t.getSize(this._boxSize),e.x=.5*(e.x+1)*this._boxSize.x+t.min.x,e.y=.5*(e.y+1)*this._boxSize.y+t.min.y},e.prototype.worldToNormalizedPoint=function(e,t){t.getSize(this._boxSize),e.x=(e.x-t.min.x)/this._boxSize.x*2-1,e.y=(e.y-t.min.y)/this._boxSize.y*2-1},e.prototype.toWorldPoint=function(e,t,i,n){e.x<0&&(e.x=0),e.x>t&&(e.x=t),e.y<0&&(e.y=0),e.y>i&&(e.y=i),e.x=e.x/t*2-1,e.y=-e.y/i*2+1,this.normalizedPointToWorld(e,n)},e.prototype.getCuttingBoxOnCanvas=function(e,t,i,n){var o=new THREE.Box3,s=new THREE.Vector2(e.x,e.y),r=new THREE.Vector2(t.x,t.y);this.toWorldPoint(s,i[0],i[1],n),this.toWorldPoint(r,i[0],i[1],n);var a=[];return a.push(new THREE.Vector3(s.x,s.y)),a.push(new THREE.Vector3(s.x,s.y)),a.push(new THREE.Vector3(s.x,r.y)),a.push(new THREE.Vector3(s.x,r.y)),a.push(new THREE.Vector3(r.x,r.y)),a.push(new THREE.Vector3(r.x,r.y)),a.push(new THREE.Vector3(r.x,s.y)),a.push(new THREE.Vector3(r.x,s.y)),o.setFromPoints(a),{min:{x:o.min.x,y:o.min.y,z:0},max:{x:o.max.x,y:o.max.y,z:0}}},e.prototype.canvasPointToClient=function(e,t){var i=t.mapContainer;if(!i||!t.floorPlaneBox)return null;var n=this.getContainerOffsetToClient(i);if(0===n.width||0===n.height)return null;var o=new THREE.Vector2;return o.x=e.x+n.left,o.y=e.y+n.top,o},e.prototype.getMainSceneMatrix=function(e){return e.getScene().getMatrixGlobal()},e.prototype.transformWorldPoint=function(e,t){var i=this.getMainSceneMatrix(e);t.applyMatrix4(i)},e.prototype.expandBbox=function(e,t){var i=e.getCenter(this._boxCenter);e.getSize(this._boxSize);var n=new THREE.Vector2,o=t,s=this._boxSize.x/this._boxSize.y,r=this._boxSize.x,a=this._boxSize.y;s>o?a=r/o:s<o&&(r=a*o),n.set(r,a),e.setFromCenterAndSize(i,n)},e.prototype.containsPointInMainScene=function(e,t){var i=e.getScene().getBoundingBoxWorld();return!!i&&i.containsPoint(t)},e.prototype.isMouseOverCanvas=function(e,t,i){if(e){var n=this.getContainerOffsetToClient(e),o=new THREE.Vector2;if(o.x=i.x-n.left,o.y=i.y-n.top,0===n.width||0===n.height)return!1;var s={width:t[0],height:t[0]};if(o.x>0&&o.x<s.width&&o.y>0&&o.y<s.height)return!0}r
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
var Ne=function(e,t){return Ne=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},Ne(e,t)};function He(e,t){function i(){this.constructor=e}Ne(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}var ze,Ue,We=function(){function e(){this.faceDefaultColor=14936556,this.wireframeDefaultColor=13421772,this.faceHighlightColor=12255212,this.wireframeHighlightColor=3330982}return e.prototype.createMesh=function(e){for(var t=new THREE.BufferGeometry,i=e.length-2,n=new Uint32Array(3*i),o=0,s=1;s<=i;s++)n[o++]=0,n[o++]=s,n[o++]=s+1;var r=new THREE.MeshBasicMaterial({color:this.faceDefaultColor,side:THREE.DoubleSide}),a=new Float32Array(3*e.length);t.setAttribute("position",new THREE.BufferAttribute(a,3).copyVector3sArray(e)),t.setIndex(new THREE.BufferAttribute(n,1));var l=new THREE.Mesh(t,r);return l.componentId=this.componentId,l},e.prototype.createWireframe=function(e){for(var t=new THREE.LineGeometry,i=[],n=0;n<e.length;n++){var o=e[n];i.push(o.x,o.y,o.z)}t.setPositions(i);var s=new THREE.LineMaterial({color:this.wireframeDefaultColor,linewidth:1});s.resolution.set(160,160);var r=new THREE.Line2(t,s);return r.componentId=this.componentId,r},e.prototype.getMesh=function(){return this.mesh},e.prototype.getWireframe=function(){return this.wireframeMesh},e.prototype.transparent=function(e){e.material&&(e.material.transparent=!0,e.material.opacity=0)},e.prototype.opaque=function(e){e.material&&(e.material.transparent=!1,e.material.opacity=1)},e.prototype.getId=function(){return this.componentId},e}(),Fe=function(e){function t(t,i,n){var o=e.call(this)||this;return o.highlightWidth=3,o.width=15,o.vertices=t,o.indices=i,o.componentId=n,o.highlightWireframeMesh=null,o.testWireframe=null,o.build(),o}return He(t,e),t.prototype.build=function(){var e=this.indices[0],t=this.indices[1],i=this.vertices[e],n=this.vertices[t],o=i.clone().add(n).multiplyScalar(.5).clone().multiplyScalar(-1),s=o.clone().normalize(),r=[],a=n.clone().sub(i).normalize(),l=i.clone().add(a.clone().multiplyScalar(20)),h=i.clone().add(a.clone().multiplyScalar(80)),c=[];if(0!==o.x){var d=o.x>0?this.width:-this.width;c.push((new THREE.Vector3).setX(d).add(s))}if(0!==o.y){var u=o.y>0?this.width:-this.width;c.push((new THREE.Vector3).setY(u).add(s))}if(0!==o.z){var g=o.z>0?this.width:-this.width;c.push((new THREE.Vector3).setZ(g).add(s))}2===c.length&&(r.push(l.clone().add(s)),r.push(l.clone().add(c[0])),r.push(h.clone().add(c[0])),r.push(h.clone().add(s)),r.push(h.clone().add(c[1])),r.push(l.clone().add(c[1]))),this.mesh=this.createMesh(r),this.transparent(this.mesh),this.wireframeMesh=this.createWireframe([l,h]),this.highlightWireframeMesh=this.createHighlightWireframe([l.sub(s),h.sub(s)])},t.prototype.createHighlightWireframe=function(e){for(var t=[],i=0;i<e.length;i++){var n=e[i];t.push(n.x,n.y,n.z)}var o=new THREE.LineGeometry;o.setPositions(t);var s=new THREE.LineMaterial({color:this.wireframeHighlightColor,linewidth:this.highlightWidth,dashed:!1});s.resolution.set(160,160);var r=new THREE.Line2(o,s);return r.computeLineDistances(),r.scale.set(1,1,1),r.visible=!1,r.renderOrder=100,r},t.prototype.getTestWireframe=function(){return this.testWireframe},t.prototype.getHighlightWireframeMesh=function(){return this.highlightWireframeMesh},t.prototype.highlight=function(){this.highlightWireframeMesh.visible=!0,this.highlightWireframeMesh.renderOrder=100},t.prototype.cancelHighlight=function(){this.highlightWireframeMesh.visible=!1},t}(We),Ge=function(e){function t(t,i){var n=e.call(this)||this;return n.length=20,n.vertex=t,n.cornerFace=null,n.cornerWireframe=null,n.componentId=i,n.cornerVertices=null,n.build(),n}return He(t,e),t.prototype.build=function(){var e=[],t=this.vertex.clone(),i=t.clone().multiplyScalar(-1);e.push(t);var n=this.vertex.clone(),o=i.x>0?this.length:-this.length;n.x+=o,e.push(n);var s=this.vertex.clone(),r=i.y>0?this.length:-this.length;s.y+=r,e.push(s);var a=this.vertex.clone(),l=i.z>0?this.length:-this.length;a.z+=l,e.push(a),this
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
var Ke=function(e,t){return Ke=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},Ke(e,t)};function Je(e,t){function i(){this.constructor=e}Ke(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}var Qe,et=function(){return et=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var o in t=arguments[i])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},et.apply(this,arguments)},tt=function(){function e(){}return e.prototype.onDrawing=function(e,t,i,n){this.markup&&(t.strokeStyle=this.markup.strokeStyle,t.lineWidth=this.markup.lineWidth,t.fillStyle=this.markup.fillStyle,this.markup.draw(e,t,i,n))},e.prototype.addMarkup=function(e,t){t.drawEnd=!0,this.markupManager.add(t),"function"==typeof e.itemCompleted&&e.itemCompleted(t)},e.prototype.redraw=function(e){},e.prototype.onExit=function(e){},e.prototype.onMouseMove=function(e,t,i,n){},e}(),it=function(){function e(){}return e.prototype.getCenter=function(e){var t=e.worldToClientPoint(this.drawPoints[0]),i=e.worldToClientPoint(this.drawPoints[1]);return[(t[0]+i[0])/2,(t[1]+i[1])/2]},e.prototype.getColor=function(){return this.strokeStyle},e.prototype.getHighlightFillColor=function(){return"rgba(61, 204, 147, 0.5)"},e.prototype.getHoverColor=function(e){return(e.markupManager.getHighlightConfig&&e.markupManager.getHighlightConfig()||{}).hoverColor||""},e.prototype.getHighlightColor=function(e){return(e.markupManager.getHighlightConfig&&e.markupManager.getHighlightConfig()||{}).highlightColor||""},e}(),nt=function(e){function t(t,i,n,o,s){var r=e.call(this)||this;return r.rotation=o||0,r.markupType="Ellipse",r.drawPoints=t,r.strokeStyle=i,r.lineWidth=n,r.fillStyle=s,r.bNeedHitByBbox=!0,r}return Je(t,e),t.prototype.draw=function(e,t,i,n,o){if(!(this.drawPoints.length<2)){var s=e.worldToClientPoint([this.drawPoints[0][0],this.drawPoints[0][1],this.drawPoints[0][2]]),r=e.worldToClientPoint([this.drawPoints[1][0],this.drawPoints[1][1],this.drawPoints[1][2]]),a=.5*Math.abs(r[0]-s[0]),l=.5*Math.abs(r[1]-s[1]),h=this.getCenter(e);t.save(),t.translate(h[0],h[1]),t.rotate(this.rotation),t.beginPath(),t.ellipse(0,0,a,l,0,0,2*Math.PI),t.restore(),t.closePath(),this.highlightColor?(t.fillStyle=this.getHighlightFillColor(),"rgba(255,255,255,0)"===this.fillStyle&&(t.fillStyle=this.fillStyle),t.strokeStyle=this.highlightColor):(t.fillStyle=this.fillStyle,t.strokeStyle=this.strokeStyle);var c=this.getHoverColor(e);c&&o?(t.shadowColor=c,t.shadowBlur=2):(t.shadowColor="",t.shadowBlur=0),this.fillStyle&&t.fill(),t.stroke(),i.ctx.lineWidth=Lt.isMobile?18:this.lineWidth+i.lineWidth,i.ctx.fillStyle=this.fillStyle,i.drawEllips(s,r,h,this.rotation,n,a,l)}},t.prototype.setPoints=function(e){this.drawPoints=e},t.prototype.getPoints=function(){return this.drawPoints},t.prototype.getGrips=function(e){var t=e.worldToClientPoint(this.drawPoints[0]),i=e.worldToClientPoint(this.drawPoints[1]),n=[(t[0]+i[0])/2,(t[1]+i[1])/2],o=[];return o.push(t[0],t[1]),o.push(t[0],n[1]),o.push(t[0],i[1]),o.push(n[0],i[1]),o.push(i[0],i[1]),o.push(i[0],n[1]),o.push(i[0],t[1]),o.push(n[0],t[1]),o},t}(it);!function(e){e[e.CONTINUE=0]="CONTINUE",e[e.FINISHED=1]="FINISHED",e[e.LelftButton=1]="LelftButton",e[e.RightButton=2]="RightButton",e[e.MiddleButton=4]="MiddleButton",e[e.MouseMode=1]="MouseMode",e[e.TouchMode=2]="TouchMode"}(Qe||(Qe={}));var ot=Qe,st=function(e){function t(t){var i=e.call(this)||this;return i.markupManager=t,i}return Je(t,e),t.prototype.begin=function(e,t,i,n){this.startX=t,this.startY=i;var o=e.markupManager.getColor(),s=e.markupManager.getLineWidth(),r=e.markupManager.getFillStyleState()?e.markupManager.getFillColor():void 0;this.markup=new nt([],o,s,0,r)},t.prototype.onEditing=function(e,t,i,n){var o=e.clientToWorldPoint([this.startX,this.startY]),s=e.clientToWorldPoint([t,i]);this.markup.setPoints([o,s]),this.redraw(e)},t.prototype.end=function(e,t,i,n){return this.startX==t&&this.startY==i?(console.log("Ignore single point."),ot.FINISHED):(this.addMar
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
var Ut=function(e,t){return Ut=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},Ut(e,t)};function Wt(e,t){function i(){this.constructor=e}Ut(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}var Ft=function(){function e(){}return e.create=function(e,t,i){var n=document.createElement(e);return n.id=t||"",n.style.position="absolute",n.style.width="100%",n.style.top=0,n.style.bottom=0,i&&i.appendChild(n),n},e.remove=function(e){var t=e.parentNode;t&&t.removeChild(e)},e.setPosition=function(e,t){e.position=t,e.style.left=t.x+"px",e.style.top=t.y+"px"},e.setOpacity=function(t,i){"opacity"in t.style?t.style.opacity=i:"filter"in t.style&&e._setOpacityIE(t,i)},e._setOpacityIE=function(e,t){var i=!1,n="DXImageTransform.Microsoft.Alpha";try{i=e.filters.item(n)}catch(e){if(1===t)return}t=Math.round(100*t),i?(i.Enabled=100!==t,i.Opacity=t):e.style.filter+=" progid:"+n+"(opacity="+t+")"},e.splitStr=function(e){return e.trim().split(/\s+/g)},e.getContainerOffsetToClient=function(e){var t,i;if(e!=document){var n=(i=e).getBoundingClientRect?function(e){var t=e.getBoundingClientRect(),i=document.body,n=document.documentElement,o=n.clientTop||i.clientTop,s=n.clientLeft||i.clientLeft,r=t.top-o,a=t.left-s;return{top:Math.round(r),left:Math.round(a)}}(i):function(e){for(var t=0,i=0;e;)t+=e.offsetTop,i+=e.offsetLeft,e=e.offsetParent;var n=document.body,o=document.documentElement;return{top:t-=window.pageYOffset||o.scrollTop||n.scrollTop,left:i-=window.pageXOffset||o.scrollLeft||n.scrollLeft}}(i);t={width:e.offsetWidth,height:e.offsetHeight,left:n.left,top:n.top}}else t={width:window.innerWidth,height:window.innerHeight,left:0,top:0};return t},e.setClassName=function(e,t){var i=document.getElementById(e);i&&(i.className=t)},e.addClassName=function(e,t){var i,n,o,s,r,a=document.getElementById(e);if(a&&(n=a,t&&"string"==typeof t&&(i=t.split(/\s+/),1===n.nodeType)))if(n.className||1!==i.length){for(o=" "+n.className+" ",s=0,r=i.length;s<r;++s)o.indexOf(" "+i[s]+" ")<0&&(o+=i[0]+" ");n.className=o.trim()}else n.className=t},e.removeClassName=function(e,t){var i,n,o,s,r,a=document.getElementById(e);if(a&&(o=a,t&&"string"==typeof t&&(i=(t||"").split(/\s+/),1===o.nodeType&&o.className))){for(n=(" "+o.className+" ").replace("O"," "),s=0,r=i.length;s<r;s++)for(;n.indexOf(" "+i[s]+" ")>=0;)n=n.replace(" "+i[s]+" "," ");o.className=t?n.trim():""}},e.showOrHideElement=function(e,t){var i=document.getElementById(e);i&&(i.style.display=t?"":"none")},e.prototype.getStyleString=function(e){var t=[];for(var i in e){var n=e[i];t.push(i),t.push(":"),t.push(n),t.push("; ")}return t.join("")},e.cloneStyle=function(e){var t={};for(var i in e)t[i]=e[i];return t},e.removeStyleAttribute=function(e,t){Array.isArray(t)||(t=[t]),t.forEach((function(t){t in e&&delete e[t]}))},e.trimRight=function(e){if(0===e.length)return"";for(var t=e.length-1,i=t;i>=0;--i)if(" "!==e.charAt(i)){t=i;break}return e.substr(0,t+1)},e.trimLeft=function(e){if(0===e.length)return"";for(var t=0,i=0;i<e.length;++i)if(" "!==e.charAt(i)){t=i;break}return e.substr(t)},e.matchesSelector=function(e,t){if(e.matches)return e.matches(t);if(e.matchesSelector)return e.matchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.mozMatchesSelector)return e.mozMatchesSelector(t);if(e.oMatchesSelector)return e.oMatchesSelector(t);if(e.querySelectorAll){for(var i=(e.document||e.ownerDocument).querySelectorAll(t),n=0;i[n]&&i[n]!==e;)n++;return!!i[n]}return!1},e.toTranslate3d=function(e,t){return"translate3d("+e+"px,"+t+"px,0)"},e.setCursorStyle=function(e,t){var i;switch(t){case"n":case"s":i="ns-resize";break;case"w":case"e":i="ew-resize";break;case"ne":case"sw":i="nesw-resize";break;case"nw":case"se":i="nwse-resize"}e.style.cursor=i},e.debounce=function(e,t){var i,n=this;return void 0===t&&(t=500),function(){for(var o=[],s=0;s<arguments.length;s++)o[s]=arguments[s];i||e.apply(n,o),clearTimeout(i),i=setTimeout((f
//!!
this.opacity[t]=e,this.viewer.SetGlobalOpacity(e,t)}},{key:"getGlobalOpacity",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.opacity[e]||1}},{key:"restoreGlobalColor",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.dc.printMode[e]==this.dc.Custom?this.setGlobalColor({red:128,green:128,blue:128,alpha:1},e):this.dc.printMode[e]==this.dc.Black?this.setGlobalColor({red:0,green:0,blue:0,alpha:1},e):this.viewer.RestoreGlobalColor(e)}},{key:"getGlobalColor",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.dc.globalColor[e]||{red:128,green:128,blue:128,alpha:1}}},{key:"setPrintMode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.dc.setPrintMode(e,t),"Black"==e?(this.setGlobalColor({red:0,green:0,blue:0,alpha:1},t),this.viewer.RestoreOverrideElementsColor(t)):"Custom"==e?(this.setGlobalColor(this.dc.customColor[t]||this.dc.customColor[0],t),this.viewer.RestoreOverrideElementsColor(t)):(this.viewer.RestoreGlobalColor(t),this.viewer.RestoreOverrideElementsColor(t))}},{key:"overrideElementsColorById",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=.0039*t.red,o=.0039*t.green,s=.0039*t.blue,r=new this.butterfly.ObjectIDList;r.clear();for(var a=0,l=e.length;a<l;a++)r.push_back(e[a]);this.viewer.OverrideElementsColorById(r,n,o,s,t.alpha,i),this.update()}},{key:"restoreElementsColorById",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=new this.butterfly.ObjectIDList;i.clear();for(var n=0,o=e.length;n<o;n++)i.push_back(e[n]);this.viewer.RestoreElementsColorById(i,t),this.update()}},{key:"setClearColor",value:function(e,t,i,n){var o=.0039*e,s=.0039*t,r=.0039*i;this.viewer.SetClearColor(o,s,r,n)}},{key:"setElementColor",value:function(e,t,i,n){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=.0039*e,r=.0039*t,a=.0039*i;this.viewer.SetGlobalColor(s,r,a,n,o)}},{key:"alignDrawing",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.viewer.AlignDrawing(e[0],e[1],t[0],t[1],i)}},{key:"getAlignTranslate",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=this.viewer.GetAlignTranslate(e);return[t.x,t.y]}},{key:"scaleDrawing",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.viewer.AlignDrawingWithScale(null==e.x?e[0]:e.x,null==e.y?e[1]:e.y,t,i),this.update()}},{key:"getAlignScale",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.viewer.GetAlignScale(e)}},{key:"getAlignState",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=this.viewer.GetAlignMatrixCol(0,e),i={x:t.x,y:t.y,z:t.z,w:t.w},n=this.viewer.GetAlignMatrixCol(1,e),o={x:n.x,y:n.y,z:n.z,w:n.w},s=this.viewer.GetAlignMatrixCol(2,e),r={x:s.x,y:s.y,z:s.z,w:s.w},a=this.viewer.GetAlignMatrixCol(3,e),l={x:a.x,y:a.y,z:a.z,w:a.w},h={ver:1,AlignMatrixCol1:[i.x,i.y,i.z,i.w],AlignMatrixCol2:[o.x,o.y,o.z,o.w],AlignMatrixCol3:[r.x,r.y,r.z,r.w],AlignMatrixCol4:[l.x,l.y,l.z,l.w]};return JSON.stringify(h)}},{key:"setAlignState",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=JSON.parse(e);return 1===i.ver&&(null!=i.AlignMatrixCol1&&null!=i.AlignMatrixCol1&&(this.viewer.SetAlignMatrixCol(0,i.AlignMatrixCol1[0],i.AlignMatrixCol1[1],i.AlignMatrixCol1[2],i.AlignMatrixCol1[3],t),this.viewer.SetAlignMatrixCol(1,i.AlignMatrixCol2[0],i.AlignMatrixCol2[1],i.AlignMatrixCol2[2],i.AlignMatrixCol2[3],t),this.viewer.SetAlignMatrixCol(2,i.AlignMatrixCol3[0],i.AlignMatrixCol3[1],i.AlignMatrixCol3[2],i.AlignMatrixCol3[3],t),this.viewer.SetAlignMatrixCol(3,i.AlignMatrixCol4[0],i.AlignMatrixCol4[1],i.AlignMatrixCol4[2],i.AlignMatrixCol4[3],t)),this.viewer.UpdateViewMatrix(),!0)}},{key:"setModelTransformation",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.viewer.SetAlignMatrixCol(0,e[0],e[1],0,0,t),this.viewer.SetAlignMatrixCol(1