SafeDispatch/Safedispatch_4_0/resource/extra.min.js
2024-02-22 18:43:59 +02:00

1 line
29 KiB
JavaScript

function InfoBubble(t){this.extend(InfoBubble,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)}function InfoBox(t){t=t||{},google.maps.OverlayView.apply(this,arguments),this.content_=t.content||"",this.disableAutoPan_=t.disableAutoPan||!1,this.maxWidth_=t.maxWidth||0,this.pixelOffset_=t.pixelOffset||new google.maps.Size(0,0),this.position_=t.position||new google.maps.LatLng(0,0),this.zIndex_=t.zIndex||null,this.boxStyle_=t.boxStyle||{},this.closeBoxMargin_=t.closeBoxMargin||"2px",this.closeBoxURL_=t.closeBoxURL||"http://www.google.com/intl/en_us/mapfiles/close.gif",""===t.closeBoxURL&&(this.closeBoxURL_=""),this.infoBoxClearance_=t.infoBoxClearance||new google.maps.Size(1,1),this.isHidden_=t.isHidden||!1,this.pane_=t.pane||"floatPane",this.div_=null,this.closeListener_=null,this.fixedWidthSet_=null}window.InfoBubble=InfoBubble,InfoBubble.prototype.ARROW_SIZE_=15,InfoBubble.prototype.ARROW_STYLE_=0,InfoBubble.prototype.SHADOW_STYLE_=1,InfoBubble.prototype.MIN_WIDTH_=50,InfoBubble.prototype.ARROW_POSITION_=50,InfoBubble.prototype.PADDING_=10,InfoBubble.prototype.BORDER_WIDTH_=1,InfoBubble.prototype.BORDER_COLOR_="#ccc",InfoBubble.prototype.BORDER_RADIUS_=10,InfoBubble.prototype.BACKGROUND_COLOR_="#fff",InfoBubble.prototype.CLOSE_SRC_="https://maps.gstatic.com/intl/en_us/mapfiles/iw_close.gif",InfoBubble.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])},InfoBubble.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 s=this.arrow_=document.createElement("DIV");s.style.position="relative";var r=this.arrowOuter_=document.createElement("DIV"),a=this.arrowInner_=document.createElement("DIV"),h=this.getArrowSize_();r.style.position=a.style.position="absolute",r.style.left=a.style.left="50%",r.style.height=a.style.height="0",r.style.width=a.style.width="0",r.style.marginLeft=this.px(-h),r.style.borderWidth=this.px(h),r.style.borderBottomWidth=0;var l=this.bubbleShadow_=document.createElement("DIV");l.style.position="absolute",t.style.display=l.style.display="none",t.appendChild(this.tabsContainer_),t.appendChild(e),t.appendChild(i),s.appendChild(r),s.appendChild(a),t.appendChild(s);var b=document.createElement("style");b.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)}}";b.textContent=d,document.getElementsByTagName("head")[0].appendChild(b)},InfoBubble.prototype.setBackgroundClassName=function(t){this.set("backgroundClassName",t)},InfoBubble.prototype.setBackgroundClassName=InfoBubble.prototype.setBackgroundClassName,InfoBubble.prototype.backgroundClassName_changed=function(){this.content_.className=this.get("backgroundClassName")},InfoBubble.prototype.backgroundClassName_changed=InfoBubble.prototype.backgroundClassName_changed,InfoBubble.prototype.setTabClassName=function(t){this.set("tabClassName",t)},InfoBubble.prototype.setTabClassName=InfoBubble.prototype.setTabClassName,InfoBubble.prototype.tabClassName_changed=function(){this.updateTabStyles_()},InfoBubble.prototype.tabClassName_changed=InfoBubble.prototype.tabClassName_changed,InfoBubble.prototype.getArrowStyle_=function(){return parseInt(this.get("arrowStyle"),10)||0},InfoBubble.prototype.setArrowStyle=function(t){this.set("arrowStyle",t)},InfoBubble.prototype.setArrowStyle=InfoBubble.prototype.setArrowStyle,InfoBubble.prototype.arrowStyle_changed=function(){this.arrowSize_changed()},InfoBubble.prototype.arrowStyle_changed=InfoBubble.prototype.arrowStyle_changed,InfoBubble.prototype.getArrowSize_=function(){return parseInt(this.get("arrowSize"),10)||0},InfoBubble.prototype.setArrowSize=function(t){this.set("arrowSize",t)},InfoBubble.prototype.setArrowSize=InfoBubble.prototype.setArrowSize,InfoBubble.prototype.arrowSize_changed=function(){this.borderWidth_changed()},InfoBubble.prototype.arrowSize_changed=InfoBubble.prototype.arrowSize_changed,InfoBubble.prototype.setArrowPosition=function(t){this.set("arrowPosition",t)},InfoBubble.prototype.setArrowPosition=InfoBubble.prototype.setArrowPosition,InfoBubble.prototype.getArrowPosition_=function(){return parseInt(this.get("arrowPosition"),10)||0},InfoBubble.prototype.arrowPosition_changed=function(){var t=this.getArrowPosition_();this.arrowOuter_.style.left=this.arrowInner_.style.left=t+"%",this.redraw_()},InfoBubble.prototype.arrowPosition_changed=InfoBubble.prototype.arrowPosition_changed,InfoBubble.prototype.setZIndex=function(t){this.set("zIndex",t)},InfoBubble.prototype.setZIndex=InfoBubble.prototype.setZIndex,InfoBubble.prototype.getZIndex=function(){return parseInt(this.get("zIndex"),10)||this.baseZIndex_},InfoBubble.prototype.zIndex_changed=function(){var t=this.getZIndex();this.bubble_.style.zIndex=this.baseZIndex_=t,this.close_.style.zIndex=t+1},InfoBubble.prototype.zIndex_changed=InfoBubble.prototype.zIndex_changed,InfoBubble.prototype.setShadowStyle=function(t){this.set("shadowStyle",t)},InfoBubble.prototype.setShadowStyle=InfoBubble.prototype.setShadowStyle,InfoBubble.prototype.getShadowStyle_=function(){return parseInt(this.get("shadowStyle"),10)||0},InfoBubble.prototype.shadowStyle_changed=function(){var t="",e="",o="";switch(this.getShadowStyle_()){case 0:t="none";break;case 1:e="40px 15px 10px rgba(33,33,33,0.3)",o="transparent";break;case 2:e="0 0 2px rgba(33,33,33,0.3)",o="rgba(33,33,33,0.35)"}this.bubbleShadow_.style.boxShadow=this.bubbleShadow_.style.webkitBoxShadow=this.bubbleShadow_.style.MozBoxShadow=e,this.bubbleShadow_.style.backgroundColor=o,this.isOpen_&&(this.bubbleShadow_.style.display=t,this.draw())},InfoBubble.prototype.shadowStyle_changed=InfoBubble.prototype.shadowStyle_changed,InfoBubble.prototype.showCloseButton=function(){this.set("hideCloseButton",!1)},InfoBubble.prototype.showCloseButton=InfoBubble.prototype.showCloseButton,InfoBubble.prototype.hideCloseButton=function(){this.set("hideCloseButton",!0)},InfoBubble.prototype.hideCloseButton=InfoBubble.prototype.hideCloseButton,InfoBubble.prototype.hideCloseButton_changed=function(){this.close_.style.display=this.get("hideCloseButton")?"none":""},InfoBubble.prototype.hideCloseButton_changed=InfoBubble.prototype.hideCloseButton_changed,InfoBubble.prototype.setBackgroundColor=function(t){t&&this.set("backgroundColor",t)},InfoBubble.prototype.setBackgroundColor=InfoBubble.prototype.setBackgroundColor,InfoBubble.prototype.backgroundColor_changed=function(){var t=this.get("backgroundColor");this.contentContainer_.style.backgroundColor=t,this.arrowInner_.style.borderColor=t+" transparent transparent",this.updateTabStyles_()},InfoBubble.prototype.backgroundColor_changed=InfoBubble.prototype.backgroundColor_changed,InfoBubble.prototype.setBorderColor=function(t){t&&this.set("borderColor",t)},InfoBubble.prototype.setBorderColor=InfoBubble.prototype.setBorderColor,InfoBubble.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_()},InfoBubble.prototype.borderColor_changed=InfoBubble.prototype.borderColor_changed,InfoBubble.prototype.setBorderRadius=function(t){this.set("borderRadius",t)},InfoBubble.prototype.setBorderRadius=InfoBubble.prototype.setBorderRadius,InfoBubble.prototype.getBorderRadius_=function(){return parseInt(this.get("borderRadius"),10)||0},InfoBubble.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_()},InfoBubble.prototype.borderRadius_changed=InfoBubble.prototype.borderRadius_changed,InfoBubble.prototype.getBorderWidth_=function(){return parseInt(this.get("borderWidth"),10)||0},InfoBubble.prototype.setBorderWidth=function(t){this.set("borderWidth",t)},InfoBubble.prototype.setBorderWidth=InfoBubble.prototype.setBorderWidth,InfoBubble.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_()},InfoBubble.prototype.borderWidth_changed=InfoBubble.prototype.borderWidth_changed,InfoBubble.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)),s=this.arrowOuter_,r=this.arrowInner_;this.arrow_.style.marginTop=this.px(-t),s.style.borderTopWidth=i,r.style.borderTopWidth=n,0==o||1==o?(s.style.borderLeftWidth=i,r.style.borderLeftWidth=n):s.style.borderLeftWidth=r.style.borderLeftWidth=0,0==o||2==o?(s.style.borderRightWidth=i,r.style.borderRightWidth=n):s.style.borderRightWidth=r.style.borderRightWidth=0,o<2?(s.style.marginLeft=this.px(-e),r.style.marginLeft=this.px(-(e-t))):s.style.marginLeft=r.style.marginLeft=0,s.style.display=0==t?"none":""},InfoBubble.prototype.setPadding=function(t){this.set("padding",t)},InfoBubble.prototype.setPadding=InfoBubble.prototype.setPadding,InfoBubble.prototype.setCloseSrc=function(t){t&&this.close_&&(this.close_.src=t)},InfoBubble.prototype.setCloseSrc=InfoBubble.prototype.setCloseSrc,InfoBubble.prototype.getPadding_=function(){return parseInt(this.get("padding"),10)||0},InfoBubble.prototype.padding_changed=function(){var t=this.getPadding_();this.contentContainer_.style.padding=this.px(t),this.updateTabStyles_(),this.redraw_()},InfoBubble.prototype.padding_changed=InfoBubble.prototype.padding_changed,InfoBubble.prototype.px=function(t){return t?t+"px":t},InfoBubble.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()}))},InfoBubble.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")},InfoBubble.prototype.onAdd=InfoBubble.prototype.onAdd,InfoBubble.prototype.draw=function(){var t=this.getProjection();if(t){var e=this.get("position");if(e){var o=0;this.activeTab_&&(o=this.activeTab_.offsetHeight);var i=this.getAnchorHeight_(),n=this.getArrowSize_(),s=this.getArrowPosition_();s/=100;var r=t.fromLatLngToDivPixel(e),a=this.contentContainer_.offsetWidth,h=this.bubble_.offsetHeight;if(a){var l=r.y-(h+n);i&&(l-=i);var b=r.x-a*s;switch(this.bubble_.style.top=this.px(l),this.bubble_.style.left=this.px(b),parseInt(this.get("shadowStyle"),10)){case 1:this.bubbleShadow_.style.top=this.px(l+o-1),this.bubbleShadow_.style.left=this.px(b),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(r.y):this.px(r.y+n),this.bubbleShadow_.style.left=this.px(r.x-a*s),this.bubbleShadow_.style.width=this.px(a),this.bubbleShadow_.style.height=this.px(2)}}}else this.close()}},InfoBubble.prototype.draw=InfoBubble.prototype.draw,InfoBubble.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)},InfoBubble.prototype.onRemove=InfoBubble.prototype.onRemove,InfoBubble.prototype.isOpen=function(){return this.isOpen_},InfoBubble.prototype.isOpen=InfoBubble.prototype.isOpen,InfoBubble.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},InfoBubble.prototype.close=InfoBubble.prototype.close,InfoBubble.prototype.open=function(t,e){var o=this;window.setTimeout(function(){o.open_(t,e)},0)},InfoBubble.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)}},InfoBubble.prototype.open=InfoBubble.prototype.open,InfoBubble.prototype.setPosition=function(t){t&&this.set("position",t)},InfoBubble.prototype.setPosition=InfoBubble.prototype.setPosition,InfoBubble.prototype.getPosition=function(){return this.get("position")},InfoBubble.prototype.getPosition=InfoBubble.prototype.getPosition,InfoBubble.prototype.position_changed=function(){this.draw()},InfoBubble.prototype.position_changed=InfoBubble.prototype.position_changed,InfoBubble.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().offsetHeight,s=this.getPosition(),r=t.fromLatLngToContainerPixel(i.getCenter()),a=t.fromLatLngToContainerPixel(s),h=r.y-o,l=n-r.y,b=0;h<0&&(b=((h*=-1)+l)/2),a.y-=b,s=t.fromContainerPixelToLatLng(a),i.getCenter()!=s&&i.panTo(s)}},InfoBubble.prototype.panToView=InfoBubble.prototype.panToView,InfoBubble.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},InfoBubble.prototype.removeChildren_=function(t){if(t)for(var e;e=t.firstChild;)t.removeChild(e)},InfoBubble.prototype.setContent=function(t){this.set("content",t)},InfoBubble.prototype.setContent=InfoBubble.prototype.setContent,InfoBubble.prototype.getContent=function(){return this.get("content")},InfoBubble.prototype.getContent=InfoBubble.prototype.getContent,InfoBubble.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_()}},InfoBubble.prototype.imageLoaded_=function(){var t=!this.get("disableAutoPan");this.redraw_(),!t||0!=this.tabs_.length&&0!=this.activeTab_.index||this.panToView()},InfoBubble.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)}},InfoBubble.prototype.setTabStyle_=function(t){var e=this.get("backgroundColor"),o=this.get("borderColor"),i=this.getBorderRadius_(),n=this.getBorderWidth_(),s=this.getPadding_(),r=this.px(-Math.max(s,i)),a=this.px(i),h=this.baseZIndex_;t.index&&(h-=t.index);var l={cssFloat:"left",position:"relative",cursor:"pointer",backgroundColor:e,border:this.px(n)+" solid "+o,padding:this.px(s/2)+" "+this.px(s),marginRight:r,whiteSpace:"nowrap",borderRadiusTopLeft:a,MozBorderRadiusTopleft:a,webkitBorderTopLeftRadius:a,borderRadiusTopRight:a,MozBorderRadiusTopright:a,webkitBorderTopRightRadius:a,zIndex:h,display:"inline"};for(var b in l)t.style[b]=l[b];var d=this.get("tabClassName");void 0!=d&&(t.className+=" "+d)},InfoBubble.prototype.addTabActions_=function(t){var e=this;t.listener_=google.maps.event.addDomListener(t,"click",function(){e.setTabActive_(this)})},InfoBubble.prototype.setTabActive=function(t){var e=this.tabs_[t-1];e&&this.setTabActive_(e.tab)},InfoBubble.prototype.setTabActive=InfoBubble.prototype.setTabActive,InfoBubble.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_()},InfoBubble.prototype.setMaxWidth=function(t){this.set("maxWidth",t)},InfoBubble.prototype.setMaxWidth=InfoBubble.prototype.setMaxWidth,InfoBubble.prototype.maxWidth_changed=function(){this.redraw_()},InfoBubble.prototype.maxWidth_changed=InfoBubble.prototype.maxWidth_changed,InfoBubble.prototype.setMaxHeight=function(t){this.set("maxHeight",t)},InfoBubble.prototype.setMaxHeight=InfoBubble.prototype.setMaxHeight,InfoBubble.prototype.maxHeight_changed=function(){this.redraw_()},InfoBubble.prototype.maxHeight_changed=InfoBubble.prototype.maxHeight_changed,InfoBubble.prototype.setMinWidth=function(t){this.set("minWidth",t)},InfoBubble.prototype.setMinWidth=InfoBubble.prototype.setMinWidth,InfoBubble.prototype.minWidth_changed=function(){this.redraw_()},InfoBubble.prototype.minWidth_changed=InfoBubble.prototype.minWidth_changed,InfoBubble.prototype.setMinHeight=function(t){this.set("minHeight",t)},InfoBubble.prototype.setMinHeight=InfoBubble.prototype.setMinHeight,InfoBubble.prototype.minHeight_changed=function(){this.redraw_()},InfoBubble.prototype.minHeight_changed=InfoBubble.prototype.minHeight_changed,InfoBubble.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_()},InfoBubble.prototype.addTab=InfoBubble.prototype.addTab,InfoBubble.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_()}},InfoBubble.prototype.updateTab=InfoBubble.prototype.updateTab,InfoBubble.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_()}},InfoBubble.prototype.removeTab=InfoBubble.prototype.removeTab,InfoBubble.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},InfoBubble.prototype.redraw_=function(){this.figureOutSize_(),this.positionCloseButton_(),this.draw()},InfoBubble.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,s=i.offsetWidth-n,r=i.offsetHeight-n-this.getAnchorHeight_(),a=0,h=this.get("minWidth")||0,l=this.get("minHeight")||0,b=this.get("maxWidth")||0,d=this.get("maxHeight")||0;b=Math.min(s,b),d=Math.min(r,d);var p=0;if(this.tabs_.length)for(var u,f=0;u=this.tabs_[f];f++){var _=this.getElementSize_(u.tab,b,d),c=this.getElementSize_(u.content,b,d);h<_.width&&(h=_.width),p+=_.width,l<_.height&&(l=_.height),_.height>a&&(a=_.height),h<c.width&&(h=c.width),l<c.height&&(l=c.height)}else{var y=this.get("content");"string"==typeof y&&(y=this.htmlToDocumentFragment_(y)),y&&(h<(c=this.getElementSize_(y,b,d)).width&&(h=c.width),l<c.height&&(l=c.height))}b&&(h=Math.min(h,b)),d&&(l=Math.min(l,d)),(h=Math.max(h,p))==p&&(h+=2*e),o*=2,(h=Math.max(h,o))>s&&(h=s),l>r&&(l=r-a),this.tabsContainer_&&(this.tabHeight_=a,this.tabsContainer_.style.width=this.px(p)),this.contentContainer_.style.width=this.px(h),this.contentContainer_.style.height=this.px(l)}},InfoBubble.prototype.getAnchorHeight_=function(){if(this.get("anchor")){var t=this.get("anchorPoint");if(t)return-1*t.y}return 0},InfoBubble.prototype.anchorPoint_changed=function(){this.draw()},InfoBubble.prototype.anchorPoint_changed=InfoBubble.prototype.anchorPoint_changed,InfoBubble.prototype.positionCloseButton_=function(){this.getBorderRadius_();var t=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)},InfoBox.prototype=new google.maps.OverlayView,InfoBox.prototype.createInfoBoxDiv_=function(){var t;this.div_||(this.div_=document.createElement("div"),this.setBoxStyle_(),this.div_.style.position="absolute",this.div_.style.visibility="hidden",null!==this.zIndex_&&(this.div_.style.zIndex=this.zIndex_),this.div_.innerHTML=this.getCloseBoxImg_()+this.content_,this.getPanes()[this.pane_].appendChild(this.div_),this.addClickHandler_(),this.div_.style.width?this.fixedWidthSet_=!0:0!==this.maxWidth_&&this.div_.offsetWidth>this.maxWidth_?(this.div_.style.width=this.maxWidth_,this.div_.style.overflow="auto",this.fixedWidthSet_=!0):(t=this.getBoxWidths_(),this.div_.style.width=this.div_.offsetWidth-t.left-t.right+"px",this.fixedWidthSet_=!1),this.panBox_(this.disableAutoPan_),google.maps.event.trigger(this,"domready"))},InfoBox.prototype.getCloseBoxImg_=function(){var t="";return""!==this.closeBoxURL_&&(t="<img",t+=" src='"+this.closeBoxURL_+"'",t+=" align=right",t+=" style='",t+=" position: relative;",t+=" cursor: pointer;",t+=" margin: "+this.closeBoxMargin_+";",t+="'>"),t},InfoBox.prototype.addClickHandler_=function(){var t;""!==this.closeBoxURL_?(t=this.div_.firstChild,this.closeListener_=google.maps.event.addDomListener(t,"click",this.getCloseClickHandler_())):this.closeListener_=null},InfoBox.prototype.getCloseClickHandler_=function(){var t=this;return function(){t.close(),google.maps.event.trigger(t,"closeclick")}},InfoBox.prototype.panBox_=function(t){if(!t){var e=this.getMap(),o=e.getBounds(),i=e.getDiv(),n=i.offsetWidth,s=i.offsetHeight,r=o.toSpan(),a=r.lng()/n,h=r.lat()/s,l=o.getSouthWest().lng(),b=o.getNorthEast().lng(),d=o.getNorthEast().lat(),p=o.getSouthWest().lat(),u=this.position_,f=this.pixelOffset_.width,_=this.pixelOffset_.height,c=this.infoBoxClearance_.width,y=this.infoBoxClearance_.height,g=u.lng()+(f-c)*a,B=u.lng()+(f+this.div_.offsetWidth+c)*a,I=u.lat()-(_-y)*h,m=u.lat()-(_+this.div_.offsetHeight+y)*h,v=(g<l?l-g:0)+(B>b?b-B:0),x=(I>d?d-I:0)+(m<p?p-m:0);if(0!==x||0!==v){var w=e.getCenter();e.setCenter(new google.maps.LatLng(w.lat()-x,w.lng()-v))}}},InfoBox.prototype.setBoxStyle_=function(){var t,e=this.boxStyle_;for(t in e)e.hasOwnProperty(t)&&(this.div_.style[t]=e[t]);void 0!==this.div_.style.opacity&&(this.div_.style.filter="alpha(opacity="+100*this.div_.style.opacity+")")},InfoBox.prototype.getBoxWidths_=function(){var t,e={top:0,bottom:0,left:0,right:0},o=this.div_;return document.defaultView&&document.defaultView.getComputedStyle?(t=o.ownerDocument.defaultView.getComputedStyle(o,""))&&(e.top=parseInt(t.borderTopWidth,10)||0,e.bottom=parseInt(t.borderBottomWidth,10)||0,e.left=parseInt(t.borderLeftWidth,10)||0,e.right=parseInt(t.borderRightWidth,10)||0):document.documentElement.currentStyle&&o.currentStyle&&(e.top=parseInt(o.currentStyle.borderTopWidth,10)||0,e.bottom=parseInt(o.currentStyle.borderBottomWidth,10)||0,e.left=parseInt(o.currentStyle.borderLeftWidth,10)||0,e.right=parseInt(o.currentStyle.borderRightWidth,10)||0),e},InfoBox.prototype.onRemove=function(){this.div_&&(this.div_.parentNode.removeChild(this.div_),this.div_=null)},InfoBox.prototype.draw=function(){this.createInfoBoxDiv_();var t=this.getProjection().fromLatLngToDivPixel(this.position_);this.div_.style.left=t.x+this.pixelOffset_.width+"px",this.div_.style.top=t.y+this.pixelOffset_.height+"px",this.isHidden_?this.div_.style.visibility="hidden":this.div_.style.visibility="visible"},InfoBox.prototype.setOptions=function(t){void 0!==t.boxStyle&&(this.boxStyle_=t.boxStyle,this.setBoxStyle_()),void 0!==t.content&&this.setContent(t.content),void 0!==t.disableAutoPan&&(this.disableAutoPan_=t.disableAutoPan),void 0!==t.maxWidth&&(this.maxWidth_=t.maxWidth),void 0!==t.pixelOffset&&(this.pixelOffset_=t.pixelOffset),void 0!==t.position&&this.setPosition(t.position),void 0!==t.zIndex&&this.setZIndex(t.zIndex),void 0!==t.closeBoxMargin&&(this.closeBoxMargin_=t.closeBoxMargin),void 0!==t.closeBoxURL&&(this.closeBoxURL_=t.closeBoxURL),void 0!==t.infoBoxClearance&&(this.infoBoxClearance_=t.infoBoxClearance),void 0!==t.isHidden&&(this.isHidden_=t.isHidden),this.div_&&this.draw()},InfoBox.prototype.setContent=function(t){this.content_=t,this.div_&&(this.closeListener_&&(google.maps.event.removeListener(this.closeListener_),this.closeListener_=null),this.fixedWidthSet_||(this.div_.style.width=""),this.div_.innerHTML=this.getCloseBoxImg_()+t,this.fixedWidthSet_||(this.div_.style.width=this.div_.offsetWidth+"px",this.div_.innerHTML=this.getCloseBoxImg_()+t),this.addClickHandler_()),google.maps.event.trigger(this,"content_changed")},InfoBox.prototype.setPosition=function(t){this.position_=t,this.div_&&this.draw(),google.maps.event.trigger(this,"position_changed")},InfoBox.prototype.setZIndex=function(t){this.zIndex_=t,this.div_&&(this.div_.style.zIndex=t),google.maps.event.trigger(this,"zindex_changed")},InfoBox.prototype.getContent=function(){return this.content_},InfoBox.prototype.getPosition=function(){return this.position_},InfoBox.prototype.getZIndex=function(){return this.zIndex_},InfoBox.prototype.show=function(){this.isHidden_=!1,this.div_.style.visibility="visible"},InfoBox.prototype.hide=function(){this.isHidden_=!0,this.div_.style.visibility="hidden"},InfoBox.prototype.open=function(t,e){e&&(this.position_=e.getPosition()),this.setMap(t),this.div_&&this.panBox_()},InfoBox.prototype.close=function(){this.closeListener_&&(google.maps.event.removeListener(this.closeListener_),this.closeListener_=null),this.setMap(null)};