嘉禾二期设备管理
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.

76 lines
2.6 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("."),o=e,n=i.length;for(let e=0;e<n;e++)void 0===o[i[e]]&&(o[i[e]]={}),o=o[i[e]];return o}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,o=this.z-e.z;return t*t+i*i+o*o}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 o=new t(i.x,i.y).multiplyScalar(.5);return this.min.copy(e).sub(o),this.max.copy(e).add(o),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 o=e.Web.Lang.Utility.Namespace.ensureNamespace(e,"Web.Algorithm");o.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 o=this.mean(e);if(t.distanceToSquared(o)<=this.EPSILON_SQR)break;t=o}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,o=`${t[0].index}_${i}`;this.mergeClusters({points:t,center:this.mean(t),id:o,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 o=i[e];let n=[];t||this.resetClusterPoints(o.points),this.points=o.points,this.clusteringZoomIn(o,n),this.clusters.push.apply(this.clusters,n)}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 o=this.meanShift(i),n=o.length,s=`${o[0].index}_${n}`;this.mergeClustersInTarget({points:o,center:this.mean(o),id:s,parent:e.id,children:[]},t)}}clusteringZoomOut(e,t){for(let i=0;i<e.length;i++){const o=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 Ie=function(e,t){return Ie=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])},Ie(e,t)};function Se(e,t){function i(){this.constructor=e}Ie(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}var Me,ve=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,o=this.position.y+t;this.svgNode.setAttribute("transform","translate("+i+","+o+")")},e}(),xe=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,o){return(t.x-e.x)*(o.y-i.y)-(t.y-e.y)*(o.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,o){var n=this.getAbsArea(e,t,i),s=this.getAbsArea(e,t,o);return new THREE.Vector2((o.x*n+i.x*s)/(n+s),(o.y*n+i.y*s)/(n+s))},e.prototype.isAngleGreaterThanPi=function(e,t,i){var o=new THREE.Vector3;return o.crossVectors(e,t),!(o.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,o){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,o)},e.prototype.getCuttingBoxOnCanvas=function(e,t,i,o){var n=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],o),this.toWorldPoint(r,i[0],i[1],o);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)),n.setFromPoints(a),{min:{x:n.min.x,y:n.min.y,z:0},max:{x:n.max.x,y:n.max.y,z:0}}},e.prototype.canvasPointToClient=function(e,t){var i=t.mapContainer;if(!i||!t.floorPlaneBox)return null;var o=this.getContainerOffsetToClient(i);if(0===o.width||0===o.height)return null;var n=new THREE.Vector2;return n.x=e.x+o.left,n.y=e.y+o.top,n},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 o=new THREE.Vector2,n=t,s=this._boxSize.x/this._boxSize.y,r=this._boxSize.x,a=this._boxSize.y;s>n?a=r/n:s<n&&(r=a*n),o.set(r,a),e.setFromCenterAndSize(i,o)},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 o=this.getContainerOffsetToClient(e),n=new THREE.Vector2;if(n.x=i.x-o.left,n.y=i.y-o.top,0===o.width||0===o.height)return!1;var s={width:t[0],height:t[0]};if(n.x>0&&n.x<s.width&&n.y>0&&n.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 tt=function(e,t){return tt=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])},tt(e,t)};function it(e,t){function i(){this.constructor=e}tt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}var ot,nt=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,o=this.position.y+t;this.svgNode.setAttribute("transform","translate("+i+","+o+")")},e}(),st=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,o){return(t.x-e.x)*(o.y-i.y)-(t.y-e.y)*(o.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,o){var n=this.getAbsArea(e,t,i),s=this.getAbsArea(e,t,o);return new THREE.Vector2((o.x*n+i.x*s)/(n+s),(o.y*n+i.y*s)/(n+s))},e.prototype.isAngleGreaterThanPi=function(e,t,i){var o=new THREE.Vector3;return o.crossVectors(e,t),!(o.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,o){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,o)},e.prototype.getCuttingBoxOnCanvas=function(e,t,i,o){var n=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],o),this.toWorldPoint(r,i[0],i[1],o);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)),n.setFromPoints(a),{min:{x:n.min.x,y:n.min.y,z:0},max:{x:n.max.x,y:n.max.y,z:0}}},e.prototype.canvasPointToClient=function(e,t){var i=t.mapContainer;if(!i||!t.floorPlaneBox)return null;var o=this.getContainerOffsetToClient(i);if(0===o.width||0===o.height)return null;var n=new THREE.Vector2;return n.x=e.x+o.left,n.y=e.y+o.top,n},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 o=new THREE.Vector2,n=t,s=this._boxSize.x/this._boxSize.y,r=this._boxSize.x,a=this._boxSize.y;s>n?a=r/n:s<n&&(r=a*n),o.set(r,a),e.setFromCenterAndSize(i,o)},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 o=this.getContainerOffsetToClient(e),n=new THREE.Vector2;if(n.x=i.x-o.left,n.y=i.y-o.top,0===o.width||0===o.height)return!1;var s={width:t[0],height:t[0]};if(n.x>0&&n.x<s.width&&n.y>0&&n.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 Lt=function(e,t){return Lt=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])},Lt(e,t)};function Kt(e,t){function i(){this.constructor=e}Lt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}var Gt,Ht,qt=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,o=new Uint32Array(3*i),n=0,s=1;s<=i;s++)o[n++]=0,o[n++]=s,o[n++]=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(o,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=[],o=0;o<e.length;o++){var n=e[o];i.push(n.x,n.y,n.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}(),Yt=function(e){function t(t,i,o){var n=e.call(this)||this;return n.highlightWidth=3,n.width=15,n.vertices=t,n.indices=i,n.componentId=o,n.highlightWireframeMesh=null,n.testWireframe=null,n.build(),n}return Kt(t,e),t.prototype.build=function(){var e=this.indices[0],t=this.indices[1],i=this.vertices[e],o=this.vertices[t],n=i.clone().add(o).multiplyScalar(.5).clone().multiplyScalar(-1),s=n.clone().normalize(),r=[],a=o.clone().sub(i).normalize(),l=i.clone().add(a.clone().multiplyScalar(20)),h=i.clone().add(a.clone().multiplyScalar(80)),c=[];if(0!==n.x){var d=n.x>0?this.width:-this.width;c.push((new THREE.Vector3).setX(d).add(s))}if(0!==n.y){var g=n.y>0?this.width:-this.width;c.push((new THREE.Vector3).setY(g).add(s))}if(0!==n.z){var u=n.z>0?this.width:-this.width;c.push((new THREE.Vector3).setZ(u).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 o=e[i];t.push(o.x,o.y,o.z)}var n=new THREE.LineGeometry;n.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(n,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}(qt),jt=function(e){function t(t,i){var o=e.call(this)||this;return o.length=20,o.vertex=t,o.cornerFace=null,o.cornerWireframe=null,o.componentId=i,o.cornerVertices=null,o.build(),o}return Kt(t,e),t.prototype.build=function(){var e=[],t=this.vertex.clone(),i=t.clone().multiplyScalar(-1);e.push(t);var o=this.vertex.clone(),n=i.x>0?this.length:-this.length;o.x+=n,e.push(o);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 Xt=function(e,t){return Xt=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])},Xt(e,t)};function _t(e,t){function i(){this.constructor=e}Xt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}var $t,ei=function(){return ei=Object.assign||function(e){for(var t,i=1,o=arguments.length;i<o;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},ei.apply(this,arguments)},ti=function(){function e(){}return e.prototype.onDrawing=function(e,t,i,o){this.markup&&(t.strokeStyle=this.markup.strokeStyle,t.lineWidth=this.markup.lineWidth,t.fillStyle=this.markup.fillStyle,this.markup.draw(e,t,i,o))},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,o){},e}(),ii=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}(),oi=function(e){function t(t,i,o,n,s){var r=e.call(this)||this;return r.rotation=n||0,r.markupType="Ellipse",r.drawPoints=t,r.strokeStyle=i,r.lineWidth=o,r.fillStyle=s,r.bNeedHitByBbox=!0,r}return _t(t,e),t.prototype.draw=function(e,t,i,o,n){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&&n?(t.shadowColor=c,t.shadowBlur=2):(t.shadowColor="",t.shadowBlur=0),this.fillStyle&&t.fill(),t.stroke(),i.ctx.lineWidth=ki.isMobile?18:this.lineWidth+i.lineWidth,i.ctx.fillStyle=this.fillStyle,i.drawEllips(s,r,h,this.rotation,o,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]),o=[(t[0]+i[0])/2,(t[1]+i[1])/2],n=[];return n.push(t[0],t[1]),n.push(t[0],o[1]),n.push(t[0],i[1]),n.push(o[0],i[1]),n.push(i[0],i[1]),n.push(i[0],o[1]),n.push(i[0],t[1]),n.push(o[0],t[1]),n},t}(ii);!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"}($t||($t={}));var ni=$t,si=function(e){function t(t){var i=e.call(this)||this;return i.markupManager=t,i}return _t(t,e),t.prototype.begin=function(e,t,i,o){this.startX=t,this.startY=i;var n=e.markupManager.getColor(),s=e.markupManager.getLineWidth(),r=e.markupManager.getFillStyleState()?e.markupManager.getFillColor():void 0;this.markup=new oi([],n,s,0,r)},t.prototype.onEditing=function(e,t,i,o){var n=e.clientToWorldPoint([this.startX,this.startY]),s=e.clientToWorldPoint([t,i]);this.markup.setPoints([n,s]),this.redraw(e)},t.prototype.end=function(e,t,i,o){return this.startX==t&&this.startY==i?(console.log("Ignore single point."),ni.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 Hi=function(e,t){return Hi=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])},Hi(e,t)};function qi(e,t){function i(){this.constructor=e}Hi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}var Yi=function(){function e(){}return e.create=function(e,t,i){var o=document.createElement(e);return o.id=t||"",o.style.position="absolute",o.style.width="100%",o.style.top=0,o.style.bottom=0,i&&i.appendChild(o),o},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,o="DXImageTransform.Microsoft.Alpha";try{i=e.filters.item(o)}catch(e){if(1===t)return}t=Math.round(100*t),i?(i.Enabled=100!==t,i.Opacity=t):e.style.filter+=" progid:"+o+"(opacity="+t+")"},e.splitStr=function(e){return e.trim().split(/\s+/g)},e.getContainerOffsetToClient=function(e){var t,i;if(e!=document){var o=(i=e).getBoundingClientRect?function(e){var t=e.getBoundingClientRect(),i=document.body,o=document.documentElement,n=o.clientTop||i.clientTop,s=o.clientLeft||i.clientLeft,r=t.top-n,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 o=document.body,n=document.documentElement;return{top:t-=window.pageYOffset||n.scrollTop||o.scrollTop,left:i-=window.pageXOffset||n.scrollLeft||o.scrollLeft}}(i);t={width:e.offsetWidth,height:e.offsetHeight,left:o.left,top:o.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,o,n,s,r,a=document.getElementById(e);if(a&&(o=a,t&&"string"==typeof t&&(i=t.split(/\s+/),1===o.nodeType)))if(o.className||1!==i.length){for(n=" "+o.className+" ",s=0,r=i.length;s<r;++s)n.indexOf(" "+i[s]+" ")<0&&(n+=i[0]+" ");o.className=n.trim()}else o.className=t},e.removeClassName=function(e,t){var i,o,n,s,r,a=document.getElementById(e);if(a&&(n=a,t&&"string"==typeof t&&(i=(t||"").split(/\s+/),1===n.nodeType&&n.className))){for(o=(" "+n.className+" ").replace("O"," "),s=0,r=i.length;s<r;s++)for(;o.indexOf(" "+i[s]+" ")>=0;)o=o.replace(" "+i[s]+" "," ");n.className=t?o.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 o=e[i];t.push(i),t.push(":"),t.push(o),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),o=0;i[o]&&i[o]!==e;)o++;return!!i[o]}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,o=this;return void 0===t&&(t=500),function(){for(var n=[],s=0;s<arguments.length;s++)n[s]=arguments[s];i||e.apply(o,n),clearTimeout(i),i=setTimeout((f