text: var __extends=this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);r.prototype=t.prototype,e.prototype=new r},wijmo;(function(e){(function(t){"use strict";var n=jQuery,r="wijtooltip",i="@wijtp@",s="wijmo-wijtooltip",o=s+"-arrow-",u=parseFloat,a=window,f=document,l=Math,c=l.max,h,p=function(e){function t(){e.apply(this,arguments)}return __extends(t,e),t.prototype._setOption=function(t,r){var i=this,s="_set_"+t,o=i.options[t];if(t==="controlwidth"){i._setSize("width",r);return}if(t==="controlheight"){i._setSize("height",r);return}e.prototype._baseWidget.call(this).prototype._setOption.apply(i,arguments),n.isPlainObject(r)&&(i.options[t]=n.extend({},o,r)),i[s]&&i[s](o),i._isDisabled()&&i._hideTooltip()},t.prototype._set_cssClass=function(){var e=this,t=e.options,n=e._tooltipCache._$tooltip;if(!n)return;n.hasClass(t.cssClass)||n.addClass(t.cssClass)},t.prototype._set_content=function(e){var t=this;t._isAjaxCallback?(t._callbacked=!0,t.show(),t._callbacked=!1):t._setText()},t.prototype._create=function(){var n=this,r=n.options,s=n.element,o=s&&s.attr("id"),u="",a="",f=r.group||i,l=t._getTooltip(f);l?l.count++:(l=n._createTooltip(),l.count=1,t._tooltips[f]=l),a=r.cssClass?r.cssClass:"",l._$tooltip.hasClass(a)||l._$tooltip.addClass(a),r.position.of=n.element,n._bindLiveEvents(),n._tooltipCache=l,o&&(u=l._$tooltip.attr("aria-describedby"),u=u===undefined?"":u+" ",l._$tooltip.attr("aria-describedby",u+o)),r.controlwidth&&r.controlwidth!==""&&n._setSize("width",r.controlwidth),r.controlheight&&r.controlheight!==""&&n._setSize("height",r.controlheight),e.prototype._baseWidget.call(this).prototype._create.apply(n,arguments)},t.prototype.destroy=function(){var n=this,r=n.element,s=n.options.group||i;r.unbind(".tooltip"),r.attr("title",n._content),e.prototype.destroy.call(this),t._removeTooltip(s),n._tooltipCache=null},t.prototype.widget=function(){return this._tooltipCache._$tooltip},t.prototype.show=function(){this.showAt(null)},t.prototype.showAt=function(e){var t=this,r=t._tooltipCache,i=r?r._$tooltip:null,s=t.options;if(!r||t._isDisabled())return;i.stop(!0,!0),r._showAnimationTimer&&(clearTimeout(r._showAnimationTimer),r._showAnimationTimer=null),r._showAtAnimationTimer&&(clearTimeout(r._showAtAnimationTimer),r._showAtAnimationTimer=null),r._hideAnimationTimer&&(clearTimeout(r._hideAnimationTimer),r._hideAnimationTimer=null);if(!e){if(s.ajaxCallback&&n.isFunction(s.ajaxCallback)&&!t._callbacked){t._isAjaxCallback=!0,s.ajaxCallback.call(t.element);return}t._setText()}s.showDelay?r._showAtAnimationTimer=setTimeout(function(){t._showToolTipHelper(e,i)},s.showDelay):t._showToolTipHelper(e,i)},t.prototype.hide=function(){var e=this,t=e._tooltipCache;if(!t)return;t._showAnimationTimer&&(clearTimeout(t._showAnimationTimer),t._showAnimationTimer=null),t._showAtAnimationTimer&&(clearTimeout(t._showAtAnimationTimer),t._showAtAnimationTimer=null),t._hideAnimationTimer&&(clearTimeout(t._hideAnimationTimer),t._hideAnimationTimer=null),e.options.hideDelay?t._hideAnimationTimer=setTimeout(n.proxy(e._hideTooltip,e),e.options.hideDelay):e._hideTooltip()},t.prototype._createTooltip=function(){var e=this,t=e.options,r=new TooltipCache,i=n("<div></div>").addClass(t.wijCSS.tooltip).addClass(t.wijCSS.widget).addClass(t.wijCSS.content).addClass(t.wijCSS.cornerAll),s=n("<div></div>").addClass(t.wijCSS.tooltipContainer),o=n("<div></div>").addClass(t.wijCSS.content).addClass(t.wijCSS.tooltipPointer).append(n("<div></div>").addClass(t.wijCSS.tooltipPointerInner)),u=n("<div></div>").addClass(t.wijCSS.tooltipTitle).addClass(t.wijCSS.header).addClass(t.wijCSS.cornerAll),a=n("<a href='#'></a>").addClass(t.wijCSS.tooltipClose).addClass(t.wijCSS.stateDefault).addClass(t.wijCSS.cornerAll);return a.append(n("<span></span>").addClass(t.wijCSS.icon).addClass(t.wijCSS.iconClose)).unbind("click").bind("click",n.proxy(e._onClickCloseBtn,e)),t.closeBehavior!=="sticky"&&a.hide(),t.showCallout||o.hide(),i.append(u).append(a).append(s).append(o).css("position","absolute").attr("role","tooltip").appendTo("body").hide(),r._$tooltip=i,r._container=s,r._callout=o,r._closeBtn=a,r._title=u,r},t.prototype._showToolTipHelper=function(e,t){if(e){var n=this,r=n._tooltipCache,i={},s,o,u=t.is(":visible"),a=r?r._callout:null;if(!a)return;n._setText(),h=t.offset(),t.offset({left:0,top:0}).show(),s=n._getCalloutShape(),i=this._getOffsetPosition(e,t,a,s),o=n._flipTooltip(i,s),n._setUnfilledCallout(o),t&&o!=s&&(i=this._getOffsetPosition(e,t,a,o)),t.offset(i),u||t.hide(),n._calloutShape=o}else{h=t.offset();if(this.options.mouseTrailing){this._setCalloutCss();return}this._setPosition()}this._showTooltip()},t.prototype._getOffsetPosition=function(e,t,n,r){var i={left:0,top:0},s=t.width(),u=t.height(),a,f,l,c,h;this._removeCalloutCss(),t.addClass(o+r),c=n.position().left,h=n.position().top,a=this._getBorder(n),f=a.left||a.right,l=a.top||a.bottom;switch(r){case"rt":i={left:e.x-s-f,top:e.y-h};break;case"rc":i={left:e.x-s-f,top:e.y-u/2};break;case"rb":i={left:e.x-s-f,top:e.y-h-l};break;case"lt":i={left:e.x+f,top:e.y-h};break;case"lc":i={left:e.x+f,top:e.y-u/2};break;case"lb":i={left:e.x+f,top:e.y-h-l};break;case"tl":i={left:e.x-c,top:e.y+l};break;case"tc":i={left:e.x-s/2,top:e.y+l};break;case"tr":i={left:e.x-c-f,top:e.y+l};break;case"bl":i={left:e.x-c,top:e.y-u-l};break;case"bc":i={left:e.x-s/2,top:e.y-u-l};break;case"br":i={left:e.x-c-f,top:e.y-u-l};break;case"cc":i={left:e.x-s/2,top:e.y-u/2}}return i},t.prototype._bindLiveEvents=function(){var e=this,t=e.options,r=e.element;e._content===undefined&&(e._content=r.attr("title"),r.attr("title","")),r.unbind(".tooltip"),t.mouseTrailing&&r.bind("mousemove.tooltip",function(n){if(e._isDisabled())return;var r=t.position.offset||"",i=r.split(" ");i.length===2?e.showAt({x:n.pageX+parseInt(i[0],10),y:n.pageY+parseInt(i[1],10)}):e.showAt({x:n.pageX,y:n.pageY})}),r.bind("mouseout.tooltip",n.proxy(e._hideIfNeeded,e));switch(t.triggers){case"hover":r.bind("mouseover.tooltip",n.proxy(e.show,e));break;case"click":r.bind("click.tooltip",n.proxy(e.show,e));break;case"focus":r.bind("focus.tooltip",n.proxy(e.show,e)).bind("blur.tooltip",n.proxy(e._hideIfNeeded,e));break;case"rightClick":r.bind("contextmenu.tooltip",function(t){e.show(),t.preventDefault()})}},t.prototype._hideIfNeeded=function(){var e=this,t=e.options,n=t.closeBehavior,r=e._tooltipCache&&e._tooltipCache._$tooltip&&e._tooltipCache._$tooltip.is(":visible");if(n==="sticky"||t.modal||!r||n==="none"||e._isDisabled())return;e.hide()},t.prototype._flipTooltip=function(e,t){var n=this,r=n._tooltipCache,i=r?r._$tooltip:null,s={width:i.width(),height:i.height()},o,u,a,f;return o=n._flipCallout(e,s,t),o.calloutShape},t.prototype._flipCallout=function(e,t,r){var i=this,s=i.options,u=i._tooltipCache,f=u._$tooltip,l={h:!1,v:!1},c=n(a),h=(s.position.collision||"flip").split(" ");h.length===1&&(h[1]=h[0]);if(!u||h[0]!=="flip"&&h[1]!=="flip")return{flip:l,calloutShape:null};h[0]==="flip"&&(e.left<0&&(l.h=!0,r.indexOf("r")>-1&&(r=r.replace(/r/,"l"),l.h="r")),e.left+t.width>c.width()+c.scrollLeft()&&(l.h=!0,r.indexOf("l")>-1&&(r=r.replace(/l/,"r"),l.h="l"))),h[0]==="flip"&&(e.top<0&&(l.v=!0,r.indexOf("b")>-1&&(r=r.replace(/b/,"t"),l.v="b")),e.top+t.height>c.height()+c.scrollTop()&&(l.v=!0,r.indexOf("t")>-1&&(r=r.replace(/t/,"b"),l.v="t")));if(l.h||l.v)i._removeCalloutCss(),f.addClass(o+r);return{flip:l,calloutShape:r}},t.prototype._set_position=function(e){var t=this,n=t.options,r=n.position;n.showCallout&&((e.my!==r.my||e.at!==r.at)&&t._setPosition(),t._setCalloutOffset(!0)),t._setText()},t.prototype._set_showCallout=function(){var e=this,t=e._tooltipCache,n=t?t._callout:null;if(!t||!n)return;e.options.showCallout?(e._setCalloutCss(),n.show()):n.hide(),e._setPosition()},t.prototype._set_closeBehavior=function(){var e=this,t=e._tooltipCache,n=t?t._closeBtn:null;n&&n[e.options.closeBehavior==="sticky"?"show":"hide"]()},t.prototype._set_triggers=function(){this._bindLiveEvents()},t.prototype._set_mouseTrailing=function(){this._bindLiveEvents()},t.prototype._getCalloutShape=function(){var e=this,t=e.options.position,r=function(e){return n.makeArray(n.map(e,function(e){return e.substr(0,1)}))},i=r(t.my.split(" ")),s=r(t.at.split(" ")),o=[];return i.length===2&&(o=i),i[0]===s[0]?(i[1]==="t"&&s[1]==="b"||i[1]==="b"&&s[1]==="t")&&o.reverse():s[0]==="c"&&o.reverse(),o[0]==="c"&&o.reverse(),o.join("")},t.prototype._setCalloutCss=function(){var e=this,t=e.options,r=e._tooltipCache,i=r?r._$tooltip:null,s="",u="",a=n.support.isTouchEnabled;if(!t.showCallout&&!a)return;e._removeCalloutCss(),u=e._getCalloutShape(),s=o+u,i&&i.addClass(s)},t.prototype._removeCalloutCss=function(){var e=this._tooltipCache,t;e&&(t=e._$tooltip,n.each(["tl","tc","tr","bl","bc","br","rt","rc","rb","lt","lc","lb","cc"],function(e,n){var r=o+n;if(t.hasClass(r))return t.removeClass(r),!1}))},t.prototype._getBorder=function(e){var t={};return n.each(["top","right","left","bottom"],function(n,r){t[r]=u(e.css("border-"+r+"-width"))}),t},t.prototype._setPosition=function(){var e=this,t=e.options,r=t.position,i=r.my,s=e._tooltipCache,o=s?s._$tooltip:null,a=o.is(":hidden"),f=e._getCalloutShape(),l=f?f.split(""):null,c=[0,0],h=s._callout,p,d,v,m,g,y={width:o.width(),height:o.height()},b,w,E=n.support.isTouchEnabled;e._setCalloutCss(),a&&o.show(),o.css({left:0,top:0});if(t.showCallout){p=e._getBorder(h),v=u(h.css("left")),d=u(h.css("top")),m=u(h.css("right")),g=u(h.css("bottom"));switch(l[0]){case"l":c[0]=p.right;break;case"r":c[0]=-p.left;break;case"b":c[1]=g;break;case"t":c[1]=-d}switch(l[1]){case"t":c[1]=-d;break;case"b":c[1]=g;break;case"r":c[0]=m;break;case"l":c[0]=-v}}if(E&&E()){switch(l[0]){case"l":c[0]=c[0]+30;break;case"r":c[0]=c[0]-30;break;case"b":c[1]=c[1]-30;break;case"t":c[1]=c[1]+30}switch(l[1]){case"t":c[1]=c[1]+30;break;case"b":c[1]=c[1]-30;break;case"r":c[0]=c[0]-30;break;case"l":c[0]=c[0]+30}}r.my.indexOf(" ")>-1?i=r.my.split(" ")[0]+"+"+c[0]+" "+r.my.split(" ")[1]+"+"+c[1]:i=r.my+"+"+c[0]+" "+r.my+"+"+c[1],o.position({my:i,at:r.at,of:r.of,collision:"none none"}),b=e._flipCallout(o.offset(),y,f),w=b.flip;if(w.h||w.v)o.css({left:0,top:0}),o.position({my:i,at:r.at,of:r.of,collision:r.collision});t.showCallout&&e._setUnfilledCallout(f),e._calloutShape=f,a&&o.hide()},t.prototype._setCalloutOffset=function(e){var t=this,r=t.options,i=t._tooltipCache,s=i?i._$tooltip:null,o=i&&i._callout,u=t._calloutShape,a=!1,f=r.position.offset,l="",c=[],h=r.calloutAnimation;if(!o)return;if(!f||f.length===0)return;o.stop(!0,!0),n.each(["tr","tc","tl","bl","bc","br"],function(e,t){if(u===t)return a=!0,!1}),f&&(c=f.split(" "),c.length===2?l=a?c[0]:c[1]:c.length===1&&(l=c[0])),c&&c.length===2&&c[0]==="none"&&c[1]==="none"?o.css("left","").css("top",""):l==="none"?o.css(a?"left":"top",""):l!==""&&(e&&!e.disabled?a?o.animate({left:l},h.duration,h.easing):o.animate({top:l},h.duration,h.easing):o.css(a?"left":"top",l))},t.prototype._setUnfilledCallout=function(e){var t=this,n=t._tooltipCache,r=n?n._$tooltip:null,i=n&&n._callout,s=i&&i.children(),o=e.split(""),u=r?r.css("background-color"):"";if(!s)return;s.css({"border-left-color":"","border-top-color":"","border-bottom-color":"","border-right-color":""});if(!t.options.calloutFilled)switch(o[0]){case"l":s.css("border-right-color",u);break;case"t":s.css("border-bottom-color",u);break;case"r":s.css("border-left-color",u);break;case"b":s.css("border-top-color",u)}},t.prototype._showTooltip=function(){var e=this,r=e.options,i=e._tooltipCache,s=i?i._$tooltip:null,o,u,a;if(!i)return;if(e._trigger("showing",null,e)===!1){s.is(":visible")&&s.hide();return}e._showModalLayer(),s.css("z-index",99999),n.fn.wijshow?(u={show:!0,context:s},o=n.extend({},r.animation,r.showAnimation),s.is(":visible")&&(a=s.offset(),s.offset(h),n.extend(u,{pos:a}),o.animated="tooltipSlide"),s.wijshow(o,t.animations,u,null,function(){e._trigger("shown")})):(s.show(),e._trigger("shown")),e._setCalloutOffset(!1)},t.prototype._hideTooltip=function(){var e=this,r=e.options,i=e._tooltipCache,s=i?i._$tooltip:null,o=n.extend({},r.animation,r.hideAnimation),u;if(!i)return;if(e._trigger("hiding",null,e)===!1)return;e._hideModalLayer(),n.fn.wijhide?(u={show:!1,context:s},s.wijhide(o,t.animations,u,null,function(){e._trigger("hidden"),s.css("z-index","")})):(s.hide(),e._trigger("hidden"),s.css("z-index",""))},t.prototype._getContent=function(e){var t={data:""},r;return n.isFunction(e)?(r=e.call(this.element,t),t.data!==""?t.data:r):window[e]&&n.isFunction(window[e])?(r=window[e].call(this.element,t),t.data!==""?t.data:r):e},t.prototype._setText=function(){var e=this,t=e.options,n=e._tooltipCache,r="",i="",s=n?n._title:null;if(!n)return;r=e._getContent(t.content),r=r===""?e._content:r,n._container.html(r),i=e._getContent(t.title),i!==""?s.html(i).show():s.hide()},t.prototype._showModalLayer=function(){var e=this,t=e.options,r=null;e.options.modal&&(r=n("<div>").addClass(t.wijCSS.overlay).css("z-index",99e3).width(e._getDocSize("Width")).height(e._getDocSize("Height")).appendTo("body"),n(window).bind("resize.wijtooltip",function(){r.width(e._getDocSize("Width")).height(e._getDocSize("Height"))}),e._tooltipCache._modalLayer=r)},t.prototype._hideModalLayer=function(){var e=this,t=e._tooltipCache._modalLayer;t&&(t.css("z-index","").remove(),t=null,n(window).unbind("resize.wijtooltip"))},t.prototype._getDocSize=function(e){var t,r,i="documentElement",s="body";return n.browser.msie&&parseFloat(n.browser.version)<9?(t=c(f[i]["scroll"+e],f[s]["scroll"+e]),r=c(f[i]["offset"+e],f[s]["offset"+e]),t<r?n(a)[e.toLowerCase()]()+"px":t+"px"):n(f)[e.toLowerCase()]()+"px"},t.prototype._setSize=function(e,t){var n=this,r=n._tooltipCache,i=r?r._$tooltip:null;i&&i.css(e,t)},t.prototype._onClickCloseBtn=function(e){this.hide(),e.preventDefault()},t._getTooltip=function(e){return t._tooltips[e]},t._removeTooltip=function(e){var n=t._tooltips[e];n&&(n.count--,n.count<=0&&(n._title.remove(),delete n._title,n._closeBtn.unbind(),n._closeBtn.remove(),delete n._closeBtn,n._callout.remove(),delete n._callout,n._container.remove(),delete n._container,n._$tooltip.remove(),delete n._$tooltip,n._modalLayer&&(n._modalLayer.remove(),delete n._modalLayer),t._tooltips[e]=null,delete t._tooltips[e]))},t._tooltips=new Array,t.animations={fade:function(e,t){e=n.extend({duration:300,easing:"swing"},e,t),e.context.stop(!0,!0).animate(e.show?{opacity:"show"}:{opacity:"hide"},e)},tooltipSlide:function(e,t){e=n.extend({duration:300,easing:"swing"},e,t),e.context.stop(!0,!0).animate({left:e.pos.left,top:e.pos.top},e)}},t}(e.wijmoWidget);t.wijtooltip=p;var d=function(){function e(){this.initSelector=":jqmData(role='wijtooltip')",this.wijCSS={tooltip:"wijmo-wijtooltip",tooltipContainer:"wijmo-wijtooltip-container",tooltipPointer:"wijmo-wijtooltip-pointer",tooltipPointerInner:"wijmo-wijtooltip-pointer-inner",tooltipTitle:"wijmo-wijtooltip-title",tooltipClose:"wijmo-wijtooltip-close"},this.wijMobileCSS={header:"ui-header ui-bar-a",content:"ui-body-a",stateDefault:"ui-btn ui-btn-a",stateHover:"ui-btn-down-a",stateActive:"ui-btn-down-a"},this.content="",this.title="",this.closeBehavior="auto",this.mouseTrailing=!1,this.triggers="hover",this.position={my:"left bottom",at:"right top",offset:null},this.showCallout=!0,this.animation={animated:"fade",duration:500,easing:null},this.showAnimation={},this.hideAnimation={},this.showDelay=150,this.hideDelay=150,this.calloutAnimation={duration:1e3,disabled:!1,easing:null},this.calloutFilled=!1,this.modal=!1,this.group=null,this.ajaxCallback=null,this.showing=null,this.shown=null,this.hiding=null,this.hidden=null,this.cssClass="",this.controlwidth=null,this.controlheight=null}return e}();p.prototype.options=n.extend(!0,{},e.wijmoWidget.prototype.options,new d),n.wijmo.registerWidget(r,p.prototype)})(e.tooltip||(e.tooltip={}));var t=e.tooltip})(wijmo||(wijmo={}));var TooltipCache=function(){function e(){}return e}();