/*! * Angular Material Design * https://github.com/angular/material * @license MIT * v1.0.5-master-f171fd2 */ function MdTooltipDirective(t,e,o,n,i,r,a,l,c){function u(a,u,f){function h(){a.delay=a.delay||d}function m(){var t="center top";switch(a.direction){case"left":t="right center";break;case"right":t="left center";break;case"top":t="center bottom";break;case"bottom":t="center top"}T.css("transform-origin",t)}function p(){a.$on("$destroy",function(){a.visible=!1,u.remove(),angular.element(e).off("resize",q)}),a.$watch("visible",function(t){t?$():y()}),a.$watch("direction",E)}function v(){x.attr("aria-label")||x.text().trim()||x.attr("aria-label",u.text().trim())}function g(){u.detach(),u.attr("role","tooltip")}function b(){function t(){w(!1)}var o=!1,i=angular.element(e);if(x[0]&&"MutationObserver"in e){var r=new MutationObserver(function(t){t.forEach(function(t){"disabled"===t.attributeName&&x[0].disabled&&(w(!1),a.$digest())})});r.observe(x[0],{attributes:!0})}var l=function(){c=document.activeElement===x[0]},c=!1;i.on("blur",l),i.on("resize",q),document.addEventListener("scroll",t,!0),a.$on("$destroy",function(){i.off("blur",l),i.off("resize",q),document.removeEventListener("scroll",t,!0),r&&r.disconnect()});var u=function(t){return"focus"===t.type&&c?void(c=!1):(x.on("blur mouseleave touchend touchcancel",d),void w(!0))},d=function(){var t=a.hasOwnProperty("autohide")?a.autohide:f.hasOwnProperty("mdAutohide");(t||o||n[0].activeElement!==x[0])&&(x.off("blur mouseleave touchend touchcancel",d),x.triggerHandler("blur"),w(!1)),o=!1};x.on("mousedown",function(){o=!0}),x.on("focus mouseenter touchstart",u)}function w(e){w.value=!!e,w.queued||(e?(w.queued=!0,t(function(){a.visible=w.value,w.queued=!1},a.delay)):i.nextTick(function(){a.visible=!1}))}function $(){return k.append(u),i.hasComputedStyle(u,"display","none")?(a.visible=!1,void u.detach()):(E(),void angular.forEach([u,T],function(t){l.addClass(t,"_md-show")}))}function y(){var t=[];angular.forEach([u,T],function(e){e.parent()&&e.hasClass("_md-show")&&t.push(l.removeClass(e,"_md-show"))}),c.all(t).then(function(){a.visible||u.detach()})}function E(){a.visible&&(m(),M())}function M(){function t(t){var e={left:t.left,top:t.top};return e.left=Math.min(e.left,k.prop("scrollWidth")-o.width-s),e.left=Math.max(e.left,s),e.top=Math.min(e.top,k.prop("scrollHeight")-o.height-s),e.top=Math.max(e.top,s),e}function e(t){return"left"===t?{left:n.left-o.width-s,top:n.top+n.height/2-o.height/2}:"right"===t?{left:n.left+n.width+s,top:n.top+n.height/2-o.height/2}:"top"===t?{left:n.left+n.width/2-o.width/2,top:n.top-o.height-s}:{left:n.left+n.width/2-o.width/2,top:n.top+n.height+s}}var o=i.offsetRect(u,k),n=i.offsetRect(x,k),r=e(a.direction),l=u.prop("offsetParent");a.direction?r=t(r):l&&r.top>l.scrollHeight-o.height-s&&(r=t(e("top"))),u.css({left:r.left+"px",top:r.top+"px"})}r(u);var x=i.getParentWithPointerEvents(u),T=angular.element(u[0].getElementsByClassName("_md-content")[0]),k=angular.element(document.body),q=o.throttle(function(){E()});l.pin&&l.pin(u,x),h(),g(),b(),m(),p(),v()}var d=0,s=8;return{restrict:"E",transclude:!0,priority:210,template:'<div class="_md-content" ng-transclude></div>',scope:{delay:"=?mdDelay",visible:"=?mdVisible",autohide:"=?mdAutohide",direction:"@?mdDirection"},link:u}}goog.provide("ng.material.components.tooltip"),goog.require("ng.material.core"),angular.module("material.components.tooltip",["material.core"]).directive("mdTooltip",MdTooltipDirective),MdTooltipDirective.$inject=["$timeout","$window","$$rAF","$document","$mdUtil","$mdTheming","$rootElement","$animate","$q"],ng.material.components.tooltip=angular.module("material.components.tooltip");