maptoolkit
Version:
Utilidades para trabajar con el mapa de google web.
1 lines • 67.2 kB
JavaScript
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("MapTk",[],e):"object"==typeof exports?exports.MapTk=e():t.MapTk=e()}(this,function(){return function(t){function e(i){if(o[i])return o[i].exports;var n=o[i]={i:i,l:!1,exports:{}};return t[i].call(n.exports,n,n.exports,e),n.l=!0,n.exports}var o={};return e.m=t,e.c=o,e.d=function(t,o,i){e.o(t,o)||Object.defineProperty(t,o,{configurable:!1,enumerable:!0,get:i})},e.n=function(t){var o=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(o,"a",o),o},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=1)}([function(t,e,o){"use strict";o.d(e,"a",function(){return r});var i=o(4),n=o.n(i),r=function(){function t(){this.eventDispatcher=n.a.create()}return t.prototype.event=function(t){return this.eventDispatcher.event(t)},t.prototype.removeAllListeners=function(){this.eventDispatcher.removeAllListeners()},t.prototype.setMaxListeners=function(t){this.eventDispatcher.setMaxListeners(t)},t}();r.EVT_MAP_IDLE="onMapIdle",r.EVT_MAP_CLICK="onMapClick",r.EVT_MAP_ZOOM_CHANGED="onZoomChanged",r.EVT_MAP_MARKER_CLICK="onMarkerClick"},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=o(2);o.d(e,"MapToolkit",function(){return i.a});var n=o(8);o.d(e,"MtMarker",function(){return n.a});var r=o(0);o.d(e,"MtEventSource",function(){return r.a});var s=o(9);o.d(e,"MapMath",function(){return s.a})},function(t,e,o){"use strict";o.d(e,"a",function(){return p});var i=o(3),n=(o.n(i),o(0)),r=o(6),s=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])};return function(e,o){function i(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),a={travelMode:"TRANSIT",strokeColor:"pink",strokeOpacity:1,strokeWeight:6},h={content:"",position:null,shadowStyle:1,padding:0,backgroundColor:"#fff",borderRadius:2,arrowSize:0,borderWidth:1,borderColor:"#f3f3f3",disableAutoPan:!1,hideCloseButton:!1,arrowPosition:50,backgroundClassName:"",minWidth:300,minHeight:50,arrowStyle:0},p=function(t){function e(o,i){var n=t.call(this)||this;n.nativeMap=o,n._bubbleMarkup="<div>{{name}}</div>";var s=n;return n._options=i||{},google.maps.event.addListener(s.nativeMap,"idle",function(){s.event(e.EVT_MAP_IDLE).emit({source:s,evt:{}})}),google.maps.event.addListener(s.nativeMap,"click",function(t){s.event(e.EVT_MAP_CLICK).emit({source:s,evt:t})}),google.maps.event.addListener(s.nativeMap,"zoom_changed",function(){s.event(e.EVT_MAP_ZOOM_CHANGED).emit({source:s,evt:{}}),s._markerSelected&&s._ubicarInfoBubble(s.nativeMap.getZoom(),s._markerSelected)}),n._markerGroupCollection=new r.a,n}return s(e,t),e.prototype.option=function(t,e){return void 0!=this._options[t]?this._options[t]:e},e.prototype.getSelectedMarker=function(){return this._markerSelected},e.prototype.addMarker=function(t,e){return t&&this.addAllMarkers([t],e),this},e.prototype.addAllMarkers=function(t,o){var i=this;return t&&t.length&&this._markerGroupCollection.addAllMarkers(t,o).forEach(function(t){t.event(e.EVT_MAP_MARKER_CLICK).addListener(function(t){i._markerSelected=t.source,i.event(e.EVT_MAP_MARKER_CLICK).emit({source:i,marker:t.source,evt:t.evt})}),i.option("markerIconSelector")&&t.setIcon(i.option("markerIconSelector")(t.model)),t.show(i.nativeMap)}),this},e.prototype.setMarker=function(t,e){this.setAllMarkers([t],e)},e.prototype.setAllMarkers=function(t,e){if(t&&t.length){var o=[],i=[],n=[],r=this._markerGroupCollection.getGroup(e),s={};t.forEach(function(t){s[t.getId()]=!0,r.containsKey(t.getId())?i.push(t):n.push(t)}),r.forEach(function(t,e){s[e.getId()]||o.push(e)}),i.forEach(function(t){var e=r.getValue(t.getId());e.setPosition(t.getPosition()),e.setModel(t.model)}),this.removeAllMarkers(o,e),this.addAllMarkers(n,e)}return this},e.prototype.removeMarker=function(t,e){var o=this._markerGroupCollection.removeMarker(t,e);if(o)return o.remove(),o},e.prototype.removeAllMarkers=function(t,e){t&&t.length&&this._markerGroupCollection.removeMarkers(t,e).forEach(function(t){t.remove()})},e.prototype.removeGroup=function(t){var e=this._markerGroupCollection.removeGroup(t);e&&e.forEach(function(t){t.remove()})},e.prototype.centerMapToMarkers=function(){var t=this._markerGroupCollection.toArray();if(t.length>0){var e,o=t[0].getPosition().lat(),i=t[0].getPosition().lat(),n=t[0].getPosition().lng(),r=t[0].getPosition().lng();for(e=1;e<t.length;e++)o=t[e].getPosition().lat()<o?t[e].getPosition().lat():o,i=t[e].getPosition().lat()>i?t[e].getPosition().lat():i,n=t[e].getPosition().lng()<n?t[e].getPosition().lng():n,r=t[e].getPosition().lng()>r?t[e].getPosition().lng():r;var s=(o+i)/2,a=(n+r)/2,h=t[0],p=Math.abs(Math.abs(h.getPosition().lat())-Math.abs(s))+Math.abs(Math.abs(h.getPosition().lng()-Math.abs(a)));for(e=1;e<t.length;e++){var u=Math.abs(Math.abs(t[e].getPosition().lat())-Math.abs(s))+Math.abs(Math.abs(t[e].getPosition().lng())-Math.abs(a));u<p&&(h=t[e],p=u)}this.centerMap(h.getPosition(),5)}},e.prototype.centerMap=function(t,e){if("string"==typeof t){var o=t.split(",");t=new google.maps.LatLng(parseFloat(o[0]),parseFloat(o[1]))}this.nativeMap.setCenter(t),this.nativeMap.setZoom(e)},e.prototype.centerAndZoomToMarkers=function(t){t=t||this._markerGroupCollection.toArray().map(function(t){return t.getPosition()});for(var e=new google.maps.LatLngBounds,o=0;o<t.length;o++)e.extend(new google.maps.LatLng(t[o].lat(),t[o].lng()));var i=this.nativeMap.getZoom();this.nativeMap.fitBounds(e),this.nativeMap.setZoom(i)},e.prototype.getZoom=function(){return this.nativeMap.getZoom()},e.prototype.getCenter=function(){return this.nativeMap.getCenter()},e.prototype.getBounds=function(){return this.nativeMap.getBounds()},e.prototype.paintCircle=function(t,e,o,i){var n=this;return n._radioSearchPaint&&n._radioSearchPaint.setMap(null),n._radioSearchPaint=new google.maps.Circle(o),i&&google.maps.event.addListener(n._radioSearchPaint,"click",function(t){i(t)}),n._radioSearchPaint},e.prototype.showInfoBubble=function(t){t=Object.assign({},h,t,{map:this.nativeMap,position:this._getInfoBubblePositionForMarkerPosition(this.nativeMap.getZoom(),t.position)}),this.closeInfoBubble();var e=new i.InfoBubble(t);e.open(),this._infoBubbleOpened=e},e.prototype.closeInfoBubble=function(){this._infoBubbleOpened&&this._infoBubbleOpened.close()},e.prototype.showRoute=function(t,e,o){var i=this;return o=Object.assign({},a,o),new Promise(function(n,r){var s={origin:t,destination:e,travelMode:o.travelMode},a=new google.maps.DirectionsService,h=new google.maps.DirectionsRenderer({polylineOptions:{strokeColor:o.strokeColor},suppressMarkers:!0});a.route(s,function(t,e){e==google.maps.DirectionsStatus.OK?(h.setDirections(t),h.setMap(i.nativeMap),i._routeDrawed=h,n(i._routeDrawed)):r({response:t,status:e})})})},e.prototype.clearRoute=function(){this._routeDrawed&&(this._routeDrawed.setMap(null),this._routeDrawed=null)},e.prototype._getInfoBubblePositionForMarkerPosition=function(t,e){var o=e.lat()+4e-5*Math.pow(2,19-t);return new google.maps.LatLng(o,e.lng())},e.prototype._ubicarInfoBubble=function(t,e){this._infoBubbleOpened&&this._infoBubbleOpened.setPosition(this._getInfoBubblePositionForMarkerPosition(t,e.getPosition()))},e}(n.a)},function(t,e){function o(t){this.extend(o,google.maps.OverlayView),this.tabs_=[],this.activeTab_=null,this.baseZIndex_=100,this.isOpen_=!1;var e=t||{};void 0==e.backgroundColor&&(e.backgroundColor=this.BACKGROUND_COLOR_),void 0==e.borderColor&&(e.borderColor=this.BORDER_COLOR_),void 0==e.borderRadius&&(e.borderRadius=this.BORDER_RADIUS_),void 0==e.borderWidth&&(e.borderWidth=this.BORDER_WIDTH_),void 0==e.padding&&(e.padding=this.PADDING_),void 0==e.arrowPosition&&(e.arrowPosition=this.ARROW_POSITION_),void 0==e.disableAutoPan&&(e.disableAutoPan=!1),void 0==e.disableAnimation&&(e.disableAnimation=!1),void 0==e.minWidth&&(e.minWidth=this.MIN_WIDTH_),void 0==e.shadowStyle&&(e.shadowStyle=this.SHADOW_STYLE_),void 0==e.arrowSize&&(e.arrowSize=this.ARROW_SIZE_),void 0==e.arrowStyle&&(e.arrowStyle=this.ARROW_STYLE_),void 0==e.closeSrc&&(e.closeSrc=this.CLOSE_SRC_),this.buildDom_(),this.setValues(e)}window.InfoBubble=o,o.prototype.ARROW_SIZE_=15,o.prototype.ARROW_STYLE_=0,o.prototype.SHADOW_STYLE_=1,o.prototype.MIN_WIDTH_=50,o.prototype.ARROW_POSITION_=50,o.prototype.PADDING_=10,o.prototype.BORDER_WIDTH_=1,o.prototype.BORDER_COLOR_="#ccc",o.prototype.BORDER_RADIUS_=10,o.prototype.BACKGROUND_COLOR_="#fff",o.prototype.CLOSE_SRC_="https://maps.gstatic.com/intl/en_us/mapfiles/iw_close.gif",o.prototype.extend=function(t,e){return function(t){for(var e in t.prototype)this.prototype[e]=t.prototype[e];return this}.apply(t,[e])},o.prototype.buildDom_=function(){var t=this.bubble_=document.createElement("DIV");t.style.position="absolute",t.style.zIndex=this.baseZIndex_,(this.tabsContainer_=document.createElement("DIV")).style.position="relative";var e=this.close_=document.createElement("IMG");e.style.position="absolute",e.style.border=0,e.style.zIndex=this.baseZIndex_+1,e.style.cursor="pointer",e.src=this.get("closeSrc");var o=this;google.maps.event.addDomListener(e,"click",function(){o.close(),google.maps.event.trigger(o,"closeclick")});var i=this.contentContainer_=document.createElement("DIV");i.style.overflowX="auto",i.style.overflowY="auto",i.style.cursor="default",i.style.clear="both",i.style.position="relative";var n=this.content_=document.createElement("DIV");i.appendChild(n);var r=this.arrow_=document.createElement("DIV");r.style.position="relative";var s=this.arrowOuter_=document.createElement("DIV"),a=this.arrowInner_=document.createElement("DIV"),h=this.getArrowSize_();s.style.position=a.style.position="absolute",s.style.left=a.style.left="50%",s.style.height=a.style.height="0",s.style.width=a.style.width="0",s.style.marginLeft=this.px(-h),s.style.borderWidth=this.px(h),s.style.borderBottomWidth=0;var p=this.bubbleShadow_=document.createElement("DIV");p.style.position="absolute",t.style.display=p.style.display="none",t.appendChild(this.tabsContainer_),t.appendChild(e),t.appendChild(i),r.appendChild(s),r.appendChild(a),t.appendChild(r);var u=document.createElement("style");u.setAttribute("type","text/css"),this.animationName_="_ibani_"+Math.round(1e4*Math.random());var d="."+this.animationName_+"{-webkit-animation-name:"+this.animationName_+";-webkit-animation-duration:0.5s;-webkit-animation-iteration-count:1;}@-webkit-keyframes "+this.animationName_+" {from {-webkit-transform: scale(0)}50% {-webkit-transform: scale(1.2)}90% {-webkit-transform: scale(0.95)}to {-webkit-transform: scale(1)}}";u.textContent=d,document.getElementsByTagName("head")[0].appendChild(u)},o.prototype.setBackgroundClassName=function(t){this.set("backgroundClassName",t)},o.prototype.setBackgroundClassName=o.prototype.setBackgroundClassName,o.prototype.backgroundClassName_changed=function(){this.content_.className=this.get("backgroundClassName")},o.prototype.backgroundClassName_changed=o.prototype.backgroundClassName_changed,o.prototype.setTabClassName=function(t){this.set("tabClassName",t)},o.prototype.setTabClassName=o.prototype.setTabClassName,o.prototype.tabClassName_changed=function(){this.updateTabStyles_()},o.prototype.tabClassName_changed=o.prototype.tabClassName_changed,o.prototype.getArrowStyle_=function(){return parseInt(this.get("arrowStyle"),10)||0},o.prototype.setArrowStyle=function(t){this.set("arrowStyle",t)},o.prototype.setArrowStyle=o.prototype.setArrowStyle,o.prototype.arrowStyle_changed=function(){this.arrowSize_changed()},o.prototype.arrowStyle_changed=o.prototype.arrowStyle_changed,o.prototype.getArrowSize_=function(){return parseInt(this.get("arrowSize"),10)||0},o.prototype.setArrowSize=function(t){this.set("arrowSize",t)},o.prototype.setArrowSize=o.prototype.setArrowSize,o.prototype.arrowSize_changed=function(){this.borderWidth_changed()},o.prototype.arrowSize_changed=o.prototype.arrowSize_changed,o.prototype.setArrowPosition=function(t){this.set("arrowPosition",t)},o.prototype.setArrowPosition=o.prototype.setArrowPosition,o.prototype.getArrowPosition_=function(){return parseInt(this.get("arrowPosition"),10)||0},o.prototype.arrowPosition_changed=function(){var t=this.getArrowPosition_();this.arrowOuter_.style.left=this.arrowInner_.style.left=t+"%",this.redraw_()},o.prototype.arrowPosition_changed=o.prototype.arrowPosition_changed,o.prototype.setZIndex=function(t){this.set("zIndex",t)},o.prototype.setZIndex=o.prototype.setZIndex,o.prototype.getZIndex=function(){return parseInt(this.get("zIndex"),10)||this.baseZIndex_},o.prototype.zIndex_changed=function(){var t=this.getZIndex();this.bubble_.style.zIndex=this.baseZIndex_=t,this.close_.style.zIndex=t+1},o.prototype.zIndex_changed=o.prototype.zIndex_changed,o.prototype.setShadowStyle=function(t){this.set("shadowStyle",t)},o.prototype.setShadowStyle=o.prototype.setShadowStyle,o.prototype.getShadowStyle_=function(){return parseInt(this.get("shadowStyle"),10)||0},o.prototype.shadowStyle_changed=function(){var t=this.getShadowStyle_(),e="",o="",i="";switch(t){case 0:e="none";break;case 1:o="40px 15px 10px rgba(33,33,33,0.3)",i="transparent";break;case 2:o="0 0 2px rgba(33,33,33,0.3)",i="rgba(33,33,33,0.35)"}this.bubbleShadow_.style.boxShadow=this.bubbleShadow_.style.webkitBoxShadow=this.bubbleShadow_.style.MozBoxShadow=o,this.bubbleShadow_.style.backgroundColor=i,this.isOpen_&&(this.bubbleShadow_.style.display=e,this.draw())},o.prototype.shadowStyle_changed=o.prototype.shadowStyle_changed,o.prototype.showCloseButton=function(){this.set("hideCloseButton",!1)},o.prototype.showCloseButton=o.prototype.showCloseButton,o.prototype.hideCloseButton=function(){this.set("hideCloseButton",!0)},o.prototype.hideCloseButton=o.prototype.hideCloseButton,o.prototype.hideCloseButton_changed=function(){this.close_.style.display=this.get("hideCloseButton")?"none":""},o.prototype.hideCloseButton_changed=o.prototype.hideCloseButton_changed,o.prototype.setBackgroundColor=function(t){t&&this.set("backgroundColor",t)},o.prototype.setBackgroundColor=o.prototype.setBackgroundColor,o.prototype.backgroundColor_changed=function(){var t=this.get("backgroundColor");this.contentContainer_.style.backgroundColor=t,this.arrowInner_.style.borderColor=t+" transparent transparent",this.updateTabStyles_()},o.prototype.backgroundColor_changed=o.prototype.backgroundColor_changed,o.prototype.setBorderColor=function(t){t&&this.set("borderColor",t)},o.prototype.setBorderColor=o.prototype.setBorderColor,o.prototype.borderColor_changed=function(){var t=this.get("borderColor"),e=this.contentContainer_,o=this.arrowOuter_;e.style.borderColor=t,o.style.borderColor=t+" transparent transparent",e.style.borderStyle=o.style.borderStyle=this.arrowInner_.style.borderStyle="solid",this.updateTabStyles_()},o.prototype.borderColor_changed=o.prototype.borderColor_changed,o.prototype.setBorderRadius=function(t){this.set("borderRadius",t)},o.prototype.setBorderRadius=o.prototype.setBorderRadius,o.prototype.getBorderRadius_=function(){return parseInt(this.get("borderRadius"),10)||0},o.prototype.borderRadius_changed=function(){var t=this.getBorderRadius_(),e=this.getBorderWidth_();this.contentContainer_.style.borderRadius=this.contentContainer_.style.MozBorderRadius=this.contentContainer_.style.webkitBorderRadius=this.bubbleShadow_.style.borderRadius=this.bubbleShadow_.style.MozBorderRadius=this.bubbleShadow_.style.webkitBorderRadius=this.px(t),this.tabsContainer_.style.paddingLeft=this.tabsContainer_.style.paddingRight=this.px(t+e),this.redraw_()},o.prototype.borderRadius_changed=o.prototype.borderRadius_changed,o.prototype.getBorderWidth_=function(){return parseInt(this.get("borderWidth"),10)||0},o.prototype.setBorderWidth=function(t){this.set("borderWidth",t)},o.prototype.setBorderWidth=o.prototype.setBorderWidth,o.prototype.borderWidth_changed=function(){var t=this.getBorderWidth_();this.contentContainer_.style.borderWidth=this.px(t),this.tabsContainer_.style.top=this.px(t),this.updateArrowStyle_(),this.updateTabStyles_(),this.borderRadius_changed(),this.redraw_()},o.prototype.borderWidth_changed=o.prototype.borderWidth_changed,o.prototype.updateArrowStyle_=function(){var t=this.getBorderWidth_(),e=this.getArrowSize_(),o=this.getArrowStyle_(),i=this.px(e),n=this.px(Math.max(0,e-t)),r=this.arrowOuter_,s=this.arrowInner_;this.arrow_.style.marginTop=this.px(-t),r.style.borderTopWidth=i,s.style.borderTopWidth=n,0==o||1==o?(r.style.borderLeftWidth=i,s.style.borderLeftWidth=n):r.style.borderLeftWidth=s.style.borderLeftWidth=0,0==o||2==o?(r.style.borderRightWidth=i,s.style.borderRightWidth=n):r.style.borderRightWidth=s.style.borderRightWidth=0,o<2?(r.style.marginLeft=this.px(-e),s.style.marginLeft=this.px(-(e-t))):r.style.marginLeft=s.style.marginLeft=0,r.style.display=0==t?"none":""},o.prototype.setPadding=function(t){this.set("padding",t)},o.prototype.setPadding=o.prototype.setPadding,o.prototype.setCloseSrc=function(t){t&&this.close_&&(this.close_.src=t)},o.prototype.setCloseSrc=o.prototype.setCloseSrc,o.prototype.getPadding_=function(){return parseInt(this.get("padding"),10)||0},o.prototype.padding_changed=function(){var t=this.getPadding_();this.contentContainer_.style.padding=this.px(t),this.updateTabStyles_(),this.redraw_()},o.prototype.padding_changed=o.prototype.padding_changed,o.prototype.px=function(t){return t?t+"px":t},o.prototype.addEvents_=function(){var t=["mousedown","mousemove","mouseover","mouseout","mouseup","mousewheel","DOMMouseScroll","touchstart","touchend","touchmove","dblclick","contextmenu","click"],e=this.bubble_;this.listeners_=[];for(var o,i=0;o=t[i];i++)this.listeners_.push(google.maps.event.addDomListener(e,o,function(t){t.cancelBubble=!0,t.stopPropagation&&t.stopPropagation()}))},o.prototype.onAdd=function(){this.bubble_||this.buildDom_(),this.addEvents_();var t=this.getPanes();t&&(t.floatPane.appendChild(this.bubble_),t.floatShadow.appendChild(this.bubbleShadow_)),google.maps.event.trigger(this,"domready")},o.prototype.onAdd=o.prototype.onAdd,o.prototype.draw=function(){var t=this.getProjection();if(t){var e=this.get("position");if(!e)return void this.close();var o=0;this.activeTab_&&(o=this.activeTab_.offsetHeight);var i=this.getAnchorHeight_(),n=this.getArrowSize_(),r=this.getArrowPosition_();r/=100;var s=t.fromLatLngToDivPixel(e),a=this.contentContainer_.offsetWidth,h=this.bubble_.offsetHeight;if(a){var p=s.y-(h+n);i&&(p-=i);var u=s.x-a*r;this.bubble_.style.top=this.px(p),this.bubble_.style.left=this.px(u);switch(parseInt(this.get("shadowStyle"),10)){case 1:this.bubbleShadow_.style.top=this.px(p+o-1),this.bubbleShadow_.style.left=this.px(u),this.bubbleShadow_.style.width=this.px(a),this.bubbleShadow_.style.height=this.px(this.contentContainer_.offsetHeight-n);break;case 2:a*=.8,this.bubbleShadow_.style.top=i?this.px(s.y):this.px(s.y+n),this.bubbleShadow_.style.left=this.px(s.x-a*r),this.bubbleShadow_.style.width=this.px(a),this.bubbleShadow_.style.height=this.px(2)}}}},o.prototype.draw=o.prototype.draw,o.prototype.onRemove=function(){this.bubble_&&this.bubble_.parentNode&&this.bubble_.parentNode.removeChild(this.bubble_),this.bubbleShadow_&&this.bubbleShadow_.parentNode&&this.bubbleShadow_.parentNode.removeChild(this.bubbleShadow_);for(var t,e=0;t=this.listeners_[e];e++)google.maps.event.removeListener(t)},o.prototype.onRemove=o.prototype.onRemove,o.prototype.isOpen=function(){return this.isOpen_},o.prototype.isOpen=o.prototype.isOpen,o.prototype.close=function(){this.bubble_&&(this.bubble_.style.display="none",this.bubble_.className=this.bubble_.className.replace(this.animationName_,"")),this.bubbleShadow_&&(this.bubbleShadow_.style.display="none",this.bubbleShadow_.className=this.bubbleShadow_.className.replace(this.animationName_,"")),this.isOpen_=!1},o.prototype.close=o.prototype.close,o.prototype.open=function(t,e){var o=this;window.setTimeout(function(){o.open_(t,e)},0)},o.prototype.open_=function(t,e){if(this.updateContent_(),t&&this.setMap(t),e&&(this.set("anchor",e),this.bindTo("anchorPoint",e),this.bindTo("position",e)),this.bubble_.style.display=this.bubbleShadow_.style.display="",!this.get("disableAnimation")&&(this.bubble_.className+=" "+this.animationName_,this.bubbleShadow_.className+=" "+this.animationName_),this.redraw_(),this.isOpen_=!0,!this.get("disableAutoPan")){var o=this;window.setTimeout(function(){o.panToView()},200)}},o.prototype.open=o.prototype.open,o.prototype.setPosition=function(t){t&&this.set("position",t)},o.prototype.setPosition=o.prototype.setPosition,o.prototype.getPosition=function(){return this.get("position")},o.prototype.getPosition=o.prototype.getPosition,o.prototype.position_changed=function(){this.draw()},o.prototype.position_changed=o.prototype.position_changed,o.prototype.panToView=function(){var t=this.getProjection();if(t&&this.bubble_){var e=this.getAnchorHeight_(),o=this.bubble_.offsetHeight+e,i=this.get("map"),n=i.getDiv(),r=n.offsetHeight,s=this.getPosition(),a=t.fromLatLngToContainerPixel(i.getCenter()),h=t.fromLatLngToContainerPixel(s),p=a.y-o,u=r-a.y,d=p<0,l=0;d&&(p*=-1,l=(p+u)/2),h.y-=l,s=t.fromContainerPixelToLatLng(h),i.getCenter()!=s&&i.panTo(s)}},o.prototype.panToView=o.prototype.panToView,o.prototype.htmlToDocumentFragment_=function(t){t=t.replace(/^\s*([\S\s]*)\b\s*$/,"$1");var e=document.createElement("DIV");if(e.innerHTML=t,1==e.childNodes.length)return e.removeChild(e.firstChild);for(var o=document.createDocumentFragment();e.firstChild;)o.appendChild(e.firstChild);return o},o.prototype.removeChildren_=function(t){if(t)for(var e;e=t.firstChild;)t.removeChild(e)},o.prototype.setContent=function(t){this.set("content",t)},o.prototype.setContent=o.prototype.setContent,o.prototype.getContent=function(){return this.get("content")},o.prototype.getContent=o.prototype.getContent,o.prototype.updateContent_=function(){if(this.content_){this.removeChildren_(this.content_);var t=this.getContent();if(t){"string"==typeof t&&(t=this.htmlToDocumentFragment_(t)),this.content_.appendChild(t);for(var e,o=this,i=this.content_.getElementsByTagName("IMG"),n=0;e=i[n];n++)google.maps.event.addDomListener(e,"load",function(){o.imageLoaded_()})}this.redraw_()}},o.prototype.imageLoaded_=function(){var t=!this.get("disableAutoPan");this.redraw_(),!t||0!=this.tabs_.length&&0!=this.activeTab_.index||this.panToView()},o.prototype.updateTabStyles_=function(){if(this.tabs_&&this.tabs_.length){for(var t,e=0;t=this.tabs_[e];e++)this.setTabStyle_(t.tab);this.activeTab_.style.zIndex=this.baseZIndex_;var o=this.getBorderWidth_(),i=this.getPadding_()/2;this.activeTab_.style.borderBottomWidth=0,this.activeTab_.style.paddingBottom=this.px(i+o)}},o.prototype.setTabStyle_=function(t){var e=this.get("backgroundColor"),o=this.get("borderColor"),i=this.getBorderRadius_(),n=this.getBorderWidth_(),r=this.getPadding_(),s=this.px(-Math.max(r,i)),a=this.px(i),h=this.baseZIndex_;t.index&&(h-=t.index);var p={cssFloat:"left",position:"relative",cursor:"pointer",backgroundColor:e,border:this.px(n)+" solid "+o,padding:this.px(r/2)+" "+this.px(r),marginRight:s,whiteSpace:"nowrap",borderRadiusTopLeft:a,MozBorderRadiusTopleft:a,webkitBorderTopLeftRadius:a,borderRadiusTopRight:a,MozBorderRadiusTopright:a,webkitBorderTopRightRadius:a,zIndex:h,display:"inline"};for(var u in p)t.style[u]=p[u];var d=this.get("tabClassName");void 0!=d&&(t.className+=" "+d)},o.prototype.addTabActions_=function(t){var e=this;t.listener_=google.maps.event.addDomListener(t,"click",function(){e.setTabActive_(this)})},o.prototype.setTabActive=function(t){var e=this.tabs_[t-1];e&&this.setTabActive_(e.tab)},o.prototype.setTabActive=o.prototype.setTabActive,o.prototype.setTabActive_=function(t){if(!t)return this.setContent(""),void this.updateContent_();var e=this.getPadding_()/2,o=this.getBorderWidth_();if(this.activeTab_){var i=this.activeTab_;i.style.zIndex=this.baseZIndex_-i.index,i.style.paddingBottom=this.px(e),i.style.borderBottomWidth=this.px(o)}t.style.zIndex=this.baseZIndex_,t.style.borderBottomWidth=0,t.style.marginBottomWidth="-10px",t.style.paddingBottom=this.px(e+o),this.setContent(this.tabs_[t.index].content),this.updateContent_(),this.activeTab_=t,this.redraw_()},o.prototype.setMaxWidth=function(t){this.set("maxWidth",t)},o.prototype.setMaxWidth=o.prototype.setMaxWidth,o.prototype.maxWidth_changed=function(){this.redraw_()},o.prototype.maxWidth_changed=o.prototype.maxWidth_changed,o.prototype.setMaxHeight=function(t){this.set("maxHeight",t)},o.prototype.setMaxHeight=o.prototype.setMaxHeight,o.prototype.maxHeight_changed=function(){this.redraw_()},o.prototype.maxHeight_changed=o.prototype.maxHeight_changed,o.prototype.setMinWidth=function(t){this.set("minWidth",t)},o.prototype.setMinWidth=o.prototype.setMinWidth,o.prototype.minWidth_changed=function(){this.redraw_()},o.prototype.minWidth_changed=o.prototype.minWidth_changed,o.prototype.setMinHeight=function(t){this.set("minHeight",t)},o.prototype.setMinHeight=o.prototype.setMinHeight,o.prototype.minHeight_changed=function(){this.redraw_()},o.prototype.minHeight_changed=o.prototype.minHeight_changed,o.prototype.addTab=function(t,e){var o=document.createElement("DIV");o.innerHTML=t,this.setTabStyle_(o),this.addTabActions_(o),this.tabsContainer_.appendChild(o),this.tabs_.push({label:t,content:e,tab:o}),o.index=this.tabs_.length-1,o.style.zIndex=this.baseZIndex_-o.index,this.activeTab_||this.setTabActive_(o),o.className=o.className+" "+this.animationName_,this.redraw_()},o.prototype.addTab=o.prototype.addTab,o.prototype.updateTab=function(t,e,o){if(!(!this.tabs_.length||t<0||t>=this.tabs_.length)){var i=this.tabs_[t];void 0!=e&&(i.tab.innerHTML=i.label=e),void 0!=o&&(i.content=o),this.activeTab_==i.tab&&(this.setContent(i.content),this.updateContent_()),this.redraw_()}},o.prototype.updateTab=o.prototype.updateTab,o.prototype.removeTab=function(t){if(!(!this.tabs_.length||t<0||t>=this.tabs_.length)){var e=this.tabs_[t];e.tab.parentNode.removeChild(e.tab),google.maps.event.removeListener(e.tab.listener_),this.tabs_.splice(t,1),delete e;for(var o,i=0;o=this.tabs_[i];i++)o.tab.index=i;e.tab==this.activeTab_&&(this.tabs_[t]?this.activeTab_=this.tabs_[t].tab:this.tabs_[t-1]?this.activeTab_=this.tabs_[t-1].tab:this.activeTab_=void 0,this.setTabActive_(this.activeTab_)),this.redraw_()}},o.prototype.removeTab=o.prototype.removeTab,o.prototype.getElementSize_=function(t,e,o){var i=document.createElement("DIV");i.style.display="inline",i.style.position="absolute",i.style.visibility="hidden","string"==typeof t?i.innerHTML=t:i.appendChild(t.cloneNode(!0)),document.body.appendChild(i);var n=new google.maps.Size(i.offsetWidth,i.offsetHeight);return e&&n.width>e&&(i.style.width=this.px(e),n=new google.maps.Size(i.offsetWidth,i.offsetHeight)),o&&n.height>o&&(i.style.height=this.px(o),n=new google.maps.Size(i.offsetWidth,i.offsetHeight)),document.body.removeChild(i),delete i,n},o.prototype.redraw_=function(){this.figureOutSize_(),this.positionCloseButton_(),this.draw()},o.prototype.figureOutSize_=function(){var t=this.get("map");if(t){var e=this.getPadding_(),o=(this.getBorderWidth_(),this.getBorderRadius_(),this.getArrowSize_()),i=t.getDiv(),n=2*o,r=i.offsetWidth-n,s=i.offsetHeight-n-this.getAnchorHeight_(),a=0,h=this.get("minWidth")||0,p=this.get("minHeight")||0,u=this.get("maxWidth")||0,d=this.get("maxHeight")||0;u=Math.min(r,u),d=Math.min(s,d);var l=0;if(this.tabs_.length)for(var c,f=0;c=this.tabs_[f];f++){var y=this.getElementSize_(c.tab,u,d),v=this.getElementSize_(c.content,u,d);h<y.width&&(h=y.width),l+=y.width,p<y.height&&(p=y.height),y.height>a&&(a=y.height),h<v.width&&(h=v.width),p<v.height&&(p=v.height)}else{var _=this.get("content");if("string"==typeof _&&(_=this.htmlToDocumentFragment_(_)),_){var v=this.getElementSize_(_,u,d);h<v.width&&(h=v.width),p<v.height&&(p=v.height)}}u&&(h=Math.min(h,u)),d&&(p=Math.min(p,d)),h=Math.max(h,l),h==l&&(h+=2*e),o*=2,h=Math.max(h,o),h>r&&(h=r),p>s&&(p=s-a),this.tabsContainer_&&(this.tabHeight_=a,this.tabsContainer_.style.width=this.px(l)),this.contentContainer_.style.width=this.px(h),this.contentContainer_.style.height=this.px(p)}},o.prototype.getAnchorHeight_=function(){if(this.get("anchor")){var t=this.get("anchorPoint");if(t)return-1*t.y}return 0},o.prototype.anchorPoint_changed=function(){this.draw()},o.prototype.anchorPoint_changed=o.prototype.anchorPoint_changed,o.prototype.positionCloseButton_=function(){var t=(this.getBorderRadius_(),this.getBorderWidth_()),e=2,o=2;this.tabs_.length&&this.tabHeight_&&(o+=this.tabHeight_),o+=t,e+=t;var i=this.contentContainer_;i&&i.clientHeight<i.scrollHeight&&(e+=15),this.close_.style.right=this.px(e),this.close_.style.top=this.px(o)}},function(t,e,o){"use strict";var i,n=o(5),r=function(){function t(){this.eventEmitter=new n.EventEmitter}return t.prototype.event=function(t){return new s(this,this.eventEmitter,t)},t.prototype.removeAllListeners=function(){this.eventEmitter.removeAllListeners()},t.prototype.setMaxListeners=function(t){this.eventEmitter.setMaxListeners(t)},t}(),s=function(){function t(t,e,o){this.tsEventEmitter=t,this.eventEmitter=e,this.name=o}return t.prototype.on=function(t){return this.eventEmitter.on(this.name,t),this.tsEventEmitter},t.prototype.addListener=function(t){return this.eventEmitter.addListener(this.name,t),this.tsEventEmitter},t.prototype.off=function(t){return this.removeListener(t)},t.prototype.removeListener=function(t){return this.eventEmitter.removeListener(this.name,t),this.tsEventEmitter},t.prototype.removeAllListeners=function(){return this.eventEmitter.removeAllListeners(this.name),this.tsEventEmitter},t.prototype.listeners=function(){return this.eventEmitter.listeners(this.name)},t.prototype.once=function(t){return this.eventEmitter.once(this.name,t),this.tsEventEmitter},t.prototype.emit=function(){for(var t=[],e=0;e<arguments.length;e++)t[e-0]=arguments[e];return t.unshift(this.name),this.eventEmitter.emit.apply(this.eventEmitter,t)},t}();!function(t){function e(){return new r}t.create=e}(i||(i={})),e.__esModule=!0,e.default=i},function(t,e){function o(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function i(t){return"function"==typeof t}function n(t){return"number"==typeof t}function r(t){return"object"==typeof t&&null!==t}function s(t){return void 0===t}t.exports=o,o.EventEmitter=o,o.prototype._events=void 0,o.prototype._maxListeners=void 0,o.defaultMaxListeners=10,o.prototype.setMaxListeners=function(t){if(!n(t)||t<0||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},o.prototype.emit=function(t){var e,o,n,a,h,p;if(this._events||(this._events={}),"error"===t&&(!this._events.error||r(this._events.error)&&!this._events.error.length)){if((e=arguments[1])instanceof Error)throw e;var u=new Error('Uncaught, unspecified "error" event. ('+e+")");throw u.context=e,u}if(o=this._events[t],s(o))return!1;if(i(o))switch(arguments.length){case 1:o.call(this);break;case 2:o.call(this,arguments[1]);break;case 3:o.call(this,arguments[1],arguments[2]);break;default:a=Array.prototype.slice.call(arguments,1),o.apply(this,a)}else if(r(o))for(a=Array.prototype.slice.call(arguments,1),p=o.slice(),n=p.length,h=0;h<n;h++)p[h].apply(this,a);return!0},o.prototype.addListener=function(t,e){var n;if(!i(e))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",t,i(e.listener)?e.listener:e),this._events[t]?r(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,r(this._events[t])&&!this._events[t].warned&&(n=s(this._maxListeners)?o.defaultMaxListeners:this._maxListeners)&&n>0&&this._events[t].length>n&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace()),this},o.prototype.on=o.prototype.addListener,o.prototype.once=function(t,e){function o(){this.removeListener(t,o),n||(n=!0,e.apply(this,arguments))}if(!i(e))throw TypeError("listener must be a function");var n=!1;return o.listener=e,this.on(t,o),this},o.prototype.removeListener=function(t,e){var o,n,s,a;if(!i(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(o=this._events[t],s=o.length,n=-1,o===e||i(o.listener)&&o.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(r(o)){for(a=s;a-- >0;)if(o[a]===e||o[a].listener&&o[a].listener===e){n=a;break}if(n<0)return this;1===o.length?(o.length=0,delete this._events[t]):o.splice(n,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},o.prototype.removeAllListeners=function(t){var e,o;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(o=this._events[t],i(o))this.removeListener(t,o);else if(o)for(;o.length;)this.removeListener(t,o[o.length-1]);return delete this._events[t],this},o.prototype.listeners=function(t){return this._events&&this._events[t]?i(this._events[t])?[this._events[t]]:this._events[t].slice():[]},o.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(i(e))return 1;if(e)return e.length}return 0},o.listenerCount=function(t,e){return t.listenerCount(e)}},function(t,e,o){"use strict";o.d(e,"a",function(){return n});var i=o(7),n=(o.n(i),function(){function t(){this._defGroup="defaultGroup",this._markersDic=new i.Dictionary}return Object.defineProperty(t.prototype,"defaultGroup",{get:function(){return this._defGroup},enumerable:!0,configurable:!0}),t.prototype.addMarker=function(t,e){return void 0===e&&(e=this._defGroup),this.addAllMarkers([t],e),this},t.prototype.addAllMarkers=function(t,e){if(void 0===e&&(e=this._defGroup),t){var o=[],i=this._ensureGroup(e);return t.forEach(function(t){void 0==t||i.containsKey(t.getId())||(i.setValue(t.getId(),t),o.push(t))}),o}},t.prototype.removeMarkerById=function(t,e){if(void 0===e&&(e=this._defGroup),this._markersDic.containsKey(e))return this._markersDic.getValue(e).remove(t)},t.prototype.removeMarker=function(t,e){return this.removeMarkerById(t.getId(),e)},t.prototype.removeMarkers=function(t,e){if(t){var o=t.map(function(t){return t.getId()});return this.removeMarkersById(o,e)}return[]},t.prototype.removeMarkersById=function(t,e){var o=this;if(void 0===e&&(e=this._defGroup),!(t&&t instanceof Array))throw Error("removeMarkersById: The first argument must be an array with the marker ids.");var i=[];return t.forEach(function(t){i.push(o.removeMarkerById(t,e))}),i},t.prototype.removeGroup=function(t){if(!t||"string"!=typeof t)throw new Error("removeGroup: The group argument must be an string.");var e;return this.getGroup(t)?(e=this.getGroup(t).values(),this.getGroup(t).clear()):e=[],e},t.prototype.clear=function(){this._markersDic.clear()},t.prototype.getMarker=function(t,e){if(void 0!=e){if(void 0!=this._markersDic.getValue(e))return this._markersDic.getValue(e).getValue(t)}else for(var o=this._markersDic.values(),i=0;i<o.length;i++){var n=o[i];if(n.containsKey(t))return n.getValue(t)}},t.prototype.getCount=function(t){if(void 0!=t){if(!this._markersDic.containsKey(t))throw new Error("The marker group "+t+"doesn't exist.");return this._markersDic.size()}return this._markersDic.values().reduce(function(t,e){return t+e.size()},0)},t.prototype.getGroup=function(t){return void 0===t&&(t=this._defGroup),this._ensureGroup(t)},t.prototype.contains=function(t){for(var e=this._markersDic.values(),o=0;o<e.length;o++){if(e[o].containsKey(t))return!0}return!1},t.prototype.toArray=function(){return this._markersDic.values().reduce(function(t,e){return t.concat(e.values())},[])},t.prototype._ensureGroup=function(t){return this._markersDic.getValue(t)||this._markersDic.setValue(t,new i.Dictionary),this._markersDic.getValue(t)},t}())},function(t,e,o){var i,i,i;!function(e){t.exports=e()}(function(){return(i=function t(e,o,n){function r(a,h){if(!o[a]){if(!e[a]){var p="function"==typeof i&&i;if(!h&&p)return i(a,!0);if(s)return s(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var d=o[a]={exports:{}};e[a][0].call(d.exports,function(t){var o=e[a][1][t];return r(o||t)},d,d.exports,t,e,o,n)}return o[a].exports}for(var s="function"==typeof i&&i,a=0;a<n.length;a++)r(n[a]);return r}({1:[function(t,e,o){"use strict";var i=t("./util"),n=t("./Queue"),r=function(){function t(t){this.root=null,this.compare=t||i.defaultCompare,this.nElements=0}return t.prototype.add=function(t){return!i.isUndefined(t)&&(null!==this.insertNode(this.createNode(t))&&(this.nElements++,!0))},t.prototype.clear=function(){this.root=null,this.nElements=0},t.prototype.isEmpty=function(){return 0===this.nElements},t.prototype.size=function(){return this.nElements},t.prototype.contains=function(t){return!i.isUndefined(t)&&null!==this.searchNode(this.root,t)},t.prototype.remove=function(t){var e=this.searchNode(this.root,t);return null!==e&&(this.removeNode(e),this.nElements--,!0)},t.prototype.inorderTraversal=function(t){this.inorderTraversalAux(this.root,t,{stop:!1})},t.prototype.preorderTraversal=function(t){this.preorderTraversalAux(this.root,t,{stop:!1})},t.prototype.postorderTraversal=function(t){this.postorderTraversalAux(this.root,t,{stop:!1})},t.prototype.levelTraversal=function(t){this.levelTraversalAux(this.root,t)},t.prototype.minimum=function(){if(!this.isEmpty())return this.minimumAux(this.root).element},t.prototype.maximum=function(){if(!this.isEmpty())return this.maximumAux(this.root).element},t.prototype.forEach=function(t){this.inorderTraversal(t)},t.prototype.toArray=function(){var t=[];return this.inorderTraversal(function(e){return t.push(e),!0}),t},t.prototype.height=function(){return this.heightAux(this.root)},t.prototype.searchNode=function(t,e){for(var o=null;null!==t&&0!==o;)o=this.compare(e,t.element),o<0?t=t.leftCh:o>0&&(t=t.rightCh);return t},t.prototype.transplant=function(t,e){null===t.parent?this.root=e:t===t.parent.leftCh?t.parent.leftCh=e:t.parent.rightCh=e,null!==e&&(e.parent=t.parent)},t.prototype.removeNode=function(t){if(null===t.leftCh)this.transplant(t,t.rightCh);else if(null===t.rightCh)this.transplant(t,t.leftCh);else{var e=this.minimumAux(t.rightCh);e.parent!==t&&(this.transplant(e,e.rightCh),e.rightCh=t.rightCh,e.rightCh.parent=e),this.transplant(t,e),e.leftCh=t.leftCh,e.leftCh.parent=e}},t.prototype.inorderTraversalAux=function(t,e,o){null===t||o.stop||(this.inorderTraversalAux(t.leftCh,e,o),o.stop||(o.stop=!1===e(t.element),o.stop||this.inorderTraversalAux(t.rightCh,e,o)))},t.prototype.levelTraversalAux=function(t,e){var o=new n.default;for(null!==t&&o.enqueue(t);!o.isEmpty();){if(t=o.dequeue(),!1===e(t.element))return;null!==t.leftCh&&o.enqueue(t.leftCh),null!==t.rightCh&&o.enqueue(t.rightCh)}},t.prototype.preorderTraversalAux=function(t,e,o){null===t||o.stop||(o.stop=!1===e(t.element),o.stop||(this.preorderTraversalAux(t.leftCh,e,o),o.stop||this.preorderTraversalAux(t.rightCh,e,o)))},t.prototype.postorderTraversalAux=function(t,e,o){null===t||o.stop||(this.postorderTraversalAux(t.leftCh,e,o),o.stop||(this.postorderTraversalAux(t.rightCh,e,o),o.stop||(o.stop=!1===e(t.element))))},t.prototype.minimumAux=function(t){for(;null!==t.leftCh;)t=t.leftCh;return t},t.prototype.maximumAux=function(t){for(;null!==t.rightCh;)t=t.rightCh;return t},t.prototype.heightAux=function(t){return null===t?-1:Math.max(this.heightAux(t.leftCh),this.heightAux(t.rightCh))+1},t.prototype.insertNode=function(t){for(var e=null,o=this.root,i=null;null!==o;){if(0===(i=this.compare(t.element,o.element)))return null;i<0?(e=o,o=o.leftCh):(e=o,o=o.rightCh)}return t.parent=e,null===e?this.root=t:this.compare(t.element,e.element)<0?e.leftCh=t:e.rightCh=t,t},t.prototype.createNode=function(t){return{element:t,leftCh:null,rightCh:null,parent:null}},t}();Object.defineProperty(o,"__esModule",{value:!0}),o.default=r},{"./Queue":11,"./util":15}],2:[function(t,e,o){"use strict";var i=t("./util"),n=t("./Dictionary"),r=t("./Set"),s=function(){function t(t){this.toStrF=t||i.defaultToString,this.dictionary=new n.default(this.toStrF),this.nElements=0}return t.prototype.add=function(t,e){if(void 0===e&&(e=1),i.isUndefined(t)||e<=0)return!1;if(this.contains(t))this.dictionary.getValue(t).copies+=e;else{var o={value:t,copies:e};this.dictionary.setValue(t,o)}return this.nElements+=e,!0},t.prototype.count=function(t){return this.contains(t)?this.dictionary.getValue(t).copies:0},t.prototype.contains=function(t){return this.dictionary.containsKey(t)},t.prototype.remove=function(t,e){if(void 0===e&&(e=1),i.isUndefined(t)||e<=0)return!1;if(this.contains(t)){var o=this.dictionary.getValue(t);return e>o.copies?this.nElements-=o.copies:this.nElements-=e,o.copies-=e,o.copies<=0&&this.dictionary.remove(t),!0}return!1},t.prototype.toArray=function(){for(var t=[],e=this.dictionary.values(),o=0,i=e;o<i.length;o++)for(var n=i[o],r=n.value,s=n.copies,a=0;a<s;a++)t.push(r);return t},t.prototype.toSet=function(){for(var t=new r.default(this.toStrF),e=this.dictionary.values(),o=0,i=e;o<i.length;o++){var n=i[o],s=n.value;t.add(s)}return t},t.prototype.forEach=function(t){this.dictionary.forEach(function(e,o){for(var i=o.value,n=o.copies,r=0;r<n;r++)if(!1===t(i))return!1;return!0})},t.prototype.size=function(){return this.nElements},t.prototype.isEmpty=function(){return 0===this.nElements},t.prototype.clear=function(){this.nElements=0,this.dictionary.clear()},t}();Object.defineProperty(o,"__esModule",{value:!0}),o.default=s},{"./Dictionary":3,"./Set":12,"./util":15}],3:[function(t,e,o){"use strict";var i=t("./util"),n=function(){function t(t){this.table={},this.nElements=0,this.toStr=t||i.defaultToString}return t.prototype.getValue=function(t){var e=this.table["$"+this.toStr(t)];if(!i.isUndefined(e))return e.value},t.prototype.setValue=function(t,e){if(!i.isUndefined(t)&&!i.isUndefined(e)){var o,n="$"+this.toStr(t),r=this.table[n];return i.isUndefined(r)?(this.nElements++,o=void 0):o=r.value,this.table[n]={key:t,value:e},o}},t.prototype.remove=function(t){var e="$"+this.toStr(t),o=this.table[e];if(!i.isUndefined(o))return delete this.table[e],this.nElements--,o.value},t.prototype.keys=function(){var t=[];for(var e in this.table)if(i.has(this.table,e)){var o=this.table[e];t.push(o.key)}return t},t.prototype.values=function(){var t=[];for(var e in this.table)if(i.has(this.table,e)){var o=this.table[e];t.push(o.value)}return t},t.prototype.forEach=function(t){for(var e in this.table)if(i.has(this.table,e)){var o=this.table[e],n=t(o.key,o.value);if(!1===n)return}},t.prototype.containsKey=function(t){return!i.isUndefined(this.getValue(t))},t.prototype.clear=function(){this.table={},this.nElements=0},t.prototype.size=function(){return this.nElements},t.prototype.isEmpty=function(){return this.nElements<=0},t.prototype.toString=function(){var t="{";return this.forEach(function(e,o){t+="\n\t"+e+" : "+o}),t+"\n}"},t}();Object.defineProperty(o,"__esModule",{value:!0}),o.default=n},{"./util":15}],4:[function(t,e,o){"use strict";var i=this&&this.__extends||function(t,e){function o(){this.constructor=t}for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)},n=t("./Dictionary"),r=t("./util"),s=function(t){function e(e,o){t.call(this,o),this.defaultFactoryFunction=e}return i(e,t),e.prototype.setDefault=function(e,o){var i=t.prototype.getValue.call(this,e);return r.isUndefined(i)?(this.setValue(e,o),o):i},e.prototype.getValue=function(t){return this.setDefault(t,this.defaultFactoryFunction())},e}(n.default);Object.defineProperty(o,"__esModule",{value:!0}),o.default=s},{"./Dictionary":3,"./util":15}],5:[function(t,e,o){"use strict";var i=t("./util"),n=t("./arrays"),r=function(){function t(t){this.data=[],this.compare=t||i.defaultCompare}return t.prototype.leftChildIndex=function(t){return 2*t+1},t.prototype.rightChildIndex=function(t){return 2*t+2},t.prototype.parentIndex=function(t){return Math.floor((t-1)/2)},t.prototype.minIndex=function(t,e){return e>=this.data.length?t>=this.data.length?-1:t:this.compare(this.data[t],this.data[e])<=0?t:e},t.prototype.siftUp=function(t){for(var e=this.parentIndex(t);t>0&&this.compare(this.data[e],this.data[t])>0;)n.swap(this.data,e,t),t=e,e=this.parentIndex(t)},t.prototype.siftDown=function(t){for(var e=this.minIndex(this.leftChildIndex(t),this.rightChildIndex(t));e>=0&&this.compare(this.data[t],this.data[e])>0;)n.swap(this.data,e,t),t=e,e=this.minIndex(this.leftChildIndex(t),this.rightChildIndex(t))},t.prototype.peek=function(){return this.data.length>0?this.data[0]:void 0},t.prototype.add=function(t){if(!i.isUndefined(t))return this.data.push(t),this.siftUp(this.data.length-1),!0},t.prototype.removeRoot=function(){if(this.data.length>0){var t=this.data[0];return this.data[0]=this.data[this.data.length-1],this.data.splice(this.data.length-1,1),this.data.length>0&&this.siftDown(0),t}},t.prototype.contains=function(t){var e=i.compareToEquals(this.compare);return n.contains(this.data,t,e)},t.prototype.size=function(){return this.data.length},t.prototype.isEmpty=function(){return this.data.length<=0},t.prototype.clear=function(){this.data.length=0},t.prototype.forEach=function(t){n.forEach(this.data,t)},t}();Object.defineProperty(o,"__esModule",{value:!0}),o.default=r},{"./arrays":14,"./util":15}],6:[function(t,e,o){"use strict";var i=this&&this.__extends||function(t,e){function o(){this.constructor=t}for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)},n=t("./Dictionary"),r=t("./util"),s=function(){function t(t,e){this.key=t,this.value=e}return t.prototype.unlink=function(){this.prev.next=this.next,this.next.prev=this.prev},t}(),a=function(t){function e(e){t.call(this,e),this.head=new s(null,null),this.tail=new s(null,null),this.head.next=this.tail,this.tail.prev=this.head}return i(e,t),e.prototype.appendToTail=function(t){var e=this.tail.prev;e.next=t,t.prev=e,t.next=this.tail,this.tail.prev=t},e.prototype.getLinkedDictionaryPair=function(t){if(!r.isUndefined(t)){var e="$"+this.toStr(t);return this.table[e]}},e.prototype.getValue=function(t){var e=this.getLinkedDictionaryPair(t);if(!r.isUndefined(e))return e.value},e.prototype.remove=function(e){var o=this.getLinkedDictionaryPair(e);if(!r.isUndefined(o))return t.prototype.remove.call(this,e),o.unlink(),o.value},e.prototype.clear=function(){t.prototype.clear.call(this),this.head.next=this.tail,this.tail.prev=this.head},e.prototype.replace=function(t,e){var o="$"+this.toStr(e.key);e.next=t.next,e.prev=t.prev,this.remove(t.key),e.prev.next=e,e.next.prev=e,this.table[o]=e,++this.nElements},e.prototype.setValue=function(t,e){if(!r.isUndefined(t)&&!r.isUndefined(e)){var o=this.getLinkedDictionaryPair(t),i=new s(t,e),n="$"+this.toStr(t);return r.isUndefined(o)?(this.appendToTail(i),this.table[n]=i,void++this.nElements):(this.replace(o,i),o.value)}},e.prototype.keys=function(){var t=[];return this.forEach(function(e,o){t.push(e)}),t},e.prototype.values=function(){var t=[];return this.forEach(function(e,o){t.push(o)}),t},e.prototype.forEach=function(t){for(var e=this.head.next;null!=e.next;){if(!1===t(e.key,e.value))return;e=e.next}},e}(n.default);Object.defineProperty(o,"__esModule",{value:!0}),o.default=a},{"./Dictionary":3,"./util":15}],7:[function(t,e,o){"use strict";var i=t("./util"),n=t("./arrays"),r=function(){function t(){this.firstNode=null,this.lastNode=null,this.nElements=0}return t.prototype.add=function(t,e){if(i.isUndefined(e)&&(e=this.nElements),e<0||e>this.nElements||i.isUndefined(t))return!1;var o=this.createNode(t);if(0===this.nElements)this.firstNode=o,this.lastNode=o;else if(e===this.nElements)this.lastNode.next=o,this.lastNode=o;else if(0===e)o.next=this.firstNode,this.firstNode=o;else{var n=this.nodeAtIndex(e-1);o.next=n.next,n.next=o}return this.nElements++,!0},t.prototype.first=function(){if(null!==this.firstNode)return this.firstNode.element},t.prototype.last=function(){if(null!==this.lastNode)return this.lastNode.element},t.prototype.elementAtIndex=function(t){var e=this.nodeAtIndex(t);if(null!==e)return e.element},t.prototype.indexOf=function(t,e){var o=e||i.defaultEquals;if(i.isUndefined(t))return-1;for(var n=this.firstNode,r=0;null!==n;){if(o(n.element,t))return r;r++,n=n.next}return-1},t.prototype.contains=function(t,e){return this.indexOf(t,e)>=0},t.prototype.remove=function(t,e){var o=e||i.defaultEquals;if(this.nElements<1||i.isUndefined(t))return!1;for(var n=null,r=this.firstNode;null!==r;){if(o(r.element,t))return r===this.firstNode?(this.firstNode=this.firstNode.next,r===this.lastNode&&(this.lastNode=null)):r===this.lastNode?(this.lastNode=n,n.next=r.next,r.next=null):(n.next=r.next,r.next=null),this.nElements--,!0;n=r,r=r.next}return!1},t.prototype.clear=function(){this.firstNode=null,this.lastNode=null,this.nElements=0},t.prototype.equals=function(e,o){var n=o||i.defaultEquals;return e instanceof t&&(this.size()===e.size()&&this.equalsAux(this.firstNode,e.firstNode,n))},t.prototype.equalsAux=function(t,e,o){for(;null!==t;){if(!o(t.element,e.element))return!1;t=t.next,e=e.next}return!0},t.prototype.removeElementAtIndex=function(t){if(!(t<0||t>=this.nElements)){var e;if(1===this.nElements)e=this.firstNode.element,this.firstNode=null,this.lastNode=null;else{var o=this.nodeAtIndex(t-1);null===o?(e=this.firstNode.element,this.firstNode=this.firstNode.next):o.next===this.lastNode&&(e=this.lastNode.element,this.lastNode=o),null!==o&&(e=o.next.element,o.next=o.next.next)}return this.nElements--,e}},t.prototype.forEach=function(t){for(var e=this.