"use strict";var MapGui=function(t,i){this.parentMap=t,this.mapScale=1,this.mapAbsoluteScale=null,this.computeAbsoluteMinimapScale(),this._tmp_mapCoord=new THREE.Vector2,this._tmp_imgCoord=new THREE.Vector2,this.underlyingMap=i,Util.isInitialized(i)||(Preferences.Map.USE_WORLD_HEIGHTMAP_WIDTH_HEIGHT_AND_MATRIX?this.underlyingMap=heightmapWorld.map:this.underlyingMap=heightmapWorld.map)};MapGui.prototype._resizeCallback=function(){this.computeAbsoluteMinimapScale(),!Preferences.Dev.RUN_APPLICATION&&Preferences.Application.isDevMode()&&this.parentMap.updateMinimap(player)},MapGui.prototype.zoomIn=function(){this._scaleMinimap(Preferences.Map.MINIMAP_SCALE_FACTOR)&&this.parentMap.updateMinimap(player)},MapGui.prototype.zoomOut=function(){this._scaleMinimap(1/Preferences.Map.MINIMAP_SCALE_FACTOR)&&this.parentMap.updateMinimap(player)},MapGui.prototype._scaleMinimap=function(t){var i=this.mapScale;return this.mapScale*=t,this.mapScale<Preferences.Map.MINIMAP_MIN_SCALE||this.mapScale>Preferences.Map.MINIMAP_MAX_SCALE?(this.mapScale=i,!1):(this.computeAbsoluteMinimapScale(),!0)},MapGui.prototype.computeAbsoluteMinimapScale=function(){this.mapAbsoluteScale=this.mapScale*(1/gui.windowDisplayScaleRatio.y)},MapGui.prototype.computeCoordinatesInMapImage=function(t,i){return this.underlyingMap.computeScreenCoordinates(t.getPosition(),this._tmp_mapCoord),this._tmp_imgCoord.x=this._tmp_mapCoord.x,this._tmp_imgCoord.y=this.underlyingMap.height-this._tmp_mapCoord.y,i&&(this._tmp_imgCoord.multiplyScalar(this.mapAbsoluteScale),this._tmp_imgCoord.x=Math.round(this._tmp_imgCoord.x),this._tmp_imgCoord.y=Math.round(this._tmp_imgCoord.y)),this._tmp_imgCoord},MapGui.prototype.getLastCoordinatesInMap=function(){return this._tmp_mapCoord},MapGui.prototype.getUnderlyingMap=function(){return this.underlyingMap};