! function (a, b) { "function" == typeof define && define.amd ? define(["jquery"], b) : "object" == typeof module && module.exports ? module.exports = b(require("jquery")) : a.Tipped = b(jQuery) }(this, function ($) { function degrees(a) { return 180 * a / Math.PI } function radian(a) { return a * Math.PI / 180 } function sec(a) { return 1 / Math.cos(a) } function sfcc(a) { return String.fromCharCode.apply(String, a.replace(" ", "").split(",")) } function deepExtend(a, b) { for (var c in b) b[c] && b[c].constructor && b[c].constructor === Object ? (a[c] = $.extend({}, a[c]) || {}, deepExtend(a[c], b[c])) : a[c] = b[c]; return a } function Spin() { return this.initialize.apply(this, _slice.call(arguments)) } function Visible() { return this.initialize.apply(this, _slice.call(arguments)) } function Skin() { this.initialize.apply(this, _slice.call(arguments)) } function Stem() { this.initialize.apply(this, _slice.call(arguments)) } function Tooltip() { this.initialize.apply(this, _slice.call(arguments)) } function Collection() { this.initialize.apply(this, _slice.call(arguments)) } var X = {}; $.extend(X, { version: "4.5.7" }), X.Skins = { base: { afterUpdate: !1 , ajax: {} , cache: !0 , container: !1 , containment: { selector: "viewport" , padding: 5 } , close: !1 , detach: !0 , fadeIn: 200 , fadeOut: 200 , showDelay: 75 , hideDelay: 25 , hideAfter: !1 , hideOn: { element: "mouseleave" } , hideOthers: !1 , position: "top" , inline: !1 , offset: { x: 0 , y: 0 } , onHide: !1 , onShow: !1 , padding: !0 , radius: !0 , shadow: !0 , showOn: { element: "mousemove" } , size: "medium" , spinner: !0 , stem: !0 , target: "element" , voila: !0 } , reset: { ajax: !1 , hideOn: { element: "mouseleave" , tooltip: "mouseleave" } , showOn: { element: "mouseenter" , tooltip: "mouseenter" } } }, $.each("dark light gray red green blue lightyellow lightblue lightpink".split(" "), function (a, b) { X.Skins[b] = {} }); var Y = function (a) { function b(b) { var c = new RegExp(b + "([\\d.]+)").exec(a); return c ? parseFloat(c[1]) : !0 } return { IE: !(!window.attachEvent || -1 !== a.indexOf("Opera")) && b("MSIE ") , Opera: a.indexOf("Opera") > -1 && (!!window.opera && opera.version && parseFloat(opera.version()) || 7.55) , WebKit: a.indexOf("AppleWebKit/") > -1 && b("AppleWebKit/") , Gecko: a.indexOf("Gecko") > -1 && -1 === a.indexOf("KHTML") && b("rv:") , MobileSafari: !!a.match(/Apple.*Mobile.*Safari/) , Chrome: a.indexOf("Chrome") > -1 && b("Chrome/") , ChromeMobile: a.indexOf("CrMo") > -1 && b("CrMo/") , Android: a.indexOf("Android") > -1 && b("Android ") , IEMobile: a.indexOf("IEMobile") > -1 && b("IEMobile/") } }(navigator.userAgent) , Support = function () { function a(a) { return c(a, "prefix") } function b(a, b) { for (var c in a) if (void 0 !== d.style[a[c]]) return "prefix" == b ? a[c] : !0; return !1 } function c(a, c) { var d = a.charAt(0).toUpperCase() + a.substr(1) , f = (a + " " + e.join(d + " ") + d).split(" "); return b(f, c) } var d = document.createElement("div") , e = "Webkit Moz O ms Khtml".split(" "); return { css: { animation: c("animation") , transform: c("transform") , prefixed: a } , shadow: c("boxShadow") && c("pointerEvents") , touch: function () { try { return !!("ontouchstart" in window || window.DocumentTouch && document instanceof DocumentTouch) } catch (a) { return !1 } }() } }() , _slice = Array.prototype.slice , _ = { wrap: function (a, b) { var c = a; return function () { var a = [$.proxy(c, this)].concat(_slice.call(arguments)); return b.apply(this, a) } } , isElement: function (a) { return a && 1 == a.nodeType } , isText: function (a) { return a && 3 == a.nodeType } , isDocumentFragment: function (a) { return a && 11 == a.nodeType } , delay: function (a, b) { var c = _slice.call(arguments, 2); return setTimeout(function () { return a.apply(a, c) }, b) } , defer: function (a) { return _.delay.apply(this, [a, 1].concat(_slice.call(arguments, 1))) } , pointer: function (a) { return { x: a.pageX , y: a.pageY } } , element: { isAttached: function () { function a(a) { for (var b = a; b && b.parentNode;) b = b.parentNode; return b } return function (b) { var c = a(b); return !(!c || !c.body) } }() } } , getUID = function () { var a = 0 , b = "_tipped-uid-"; return function (c) { for (c = c || b, a++; document.getElementById(c + a) ;) a++; return c + a } }() , Position = { positions: ["topleft", "topmiddle", "topright", "righttop", "rightmiddle", "rightbottom", "bottomright", "bottommiddle", "bottomleft", "leftbottom", "leftmiddle", "lefttop"] , regex: { toOrientation: /^(top|left|bottom|right)(top|left|bottom|right|middle|center)$/ , horizontal: /^(top|bottom)/ , isCenter: /(middle|center)/ , side: /^(top|bottom|left|right)/ } , toDimension: function () { var a = { top: "height" , left: "width" , bottom: "height" , right: "width" }; return function (b) { return a[b] } }() , isCenter: function (a) { return !!a.toLowerCase().match(this.regex.isCenter) } , isCorner: function (a) { return !this.isCenter(a) } , getOrientation: function (a) { return a.toLowerCase().match(this.regex.horizontal) ? "horizontal" : "vertical" } , getSide: function (a) { var b = null , c = a.toLowerCase().match(this.regex.side); return c && c[1] && (b = c[1]), b } , split: function (a) { return a.toLowerCase().match(this.regex.toOrientation) } , _flip: { top: "bottom" , bottom: "top" , left: "right" , right: "left" } , flip: function (a, b) { var c = this.split(a); return b ? this.inverseCornerPlane(this.flip(this.inverseCornerPlane(a))) : this._flip[c[1]] + c[2] } , inverseCornerPlane: function (a) { if (Position.isCorner(a)) { var b = this.split(a); return b[2] + b[1] } return a } , adjustOffsetBasedOnPosition: function (a, b, c) { var d = $.extend({}, a) , e = { horizontal: "x" , vertical: "y" } , f = { x: "y" , y: "x" } , g = { top: { right: "x" } , bottom: { left: "x" } , left: { bottom: "y" } , right: { top: "y" } } , h = Position.getOrientation(b); if (h == Position.getOrientation(c)) { if (Position.getSide(b) != Position.getSide(c)) { var i = f[e[h]]; d[i] *= -1 } } else { var j = d.x; d.x = d.y, d.y = j; var k = g[Position.getSide(b)][Position.getSide(c)]; k && (d[k] *= -1), d[e[Position.getOrientation(c)]] = 0 } return d } , getBoxFromPoints: function (a, b, c, d) { var e = Math.min(a, c) , f = Math.max(a, c) , g = Math.min(b, d) , h = Math.max(b, d); return { left: e , top: g , width: Math.max(f - e, 0) , height: Math.max(h - g, 0) } } , isPointWithinBox: function (a, b, c, d, e, f) { var g = this.getBoxFromPoints(c, d, e, f); return a >= g.left && a <= g.left + g.width && b >= g.top && b <= g.top + g.height } , isPointWithinBoxLayout: function (a, b, c) { return this.isPointWithinBox(a, b, c.position.left, c.position.top, c.position.left + c.dimensions.width, c.position.top + c.dimensions.height) } , getDistance: function (a, b, c, d) { return Math.sqrt(Math.pow(Math.abs(c - a), 2) + Math.pow(Math.abs(d - b), 2)) } , intersectsLine: function () { var a = function (a, b, c, d, e, f) { var g = (f - b) * (c - a) - (d - b) * (e - a); return g > 0 ? !0 : 0 > g ? !1 : !0 }; return function (b, c, d, e, f, g, h, i, j) { if (!j) return a(b, c, f, g, h, i) != a(d, e, f, g, h, i) && a(b, c, d, e, f, g) != a(b, c, d, e, h, i); var k, l, m, n; k = d - b, l = e - c, m = h - f, n = i - g; var o, p; if (o = (-l * (b - f) + k * (c - g)) / (-m * l + k * n), p = (m * (c - g) - n * (b - f)) / (-m * l + k * n), o >= 0 && 1 >= o && p >= 0 && 1 >= p) { var q = b + p * k , r = c + p * l; return { x: q , y: r } } return !1 } }() } , Bounds = { viewport: function () { var a; return a = Y.MobileSafari || Y.Android && Y.Gecko ? { width: window.innerWidth , height: window.innerHeight } : { height: $(window).height() , width: $(window).width() } } } , Mouse = { _buffer: { pageX: 0 , pageY: 0 } , _dimensions: { width: 30 , height: 30 } , _shift: { x: 2 , y: 10 } , getPosition: function (a) { var b = this.getActualPosition(a); return { left: b.left - Math.round(.5 * this._dimensions.width) + this._shift.x , top: b.top - Math.round(.5 * this._dimensions.height) + this._shift.y } } , getActualPosition: function (a) { var b = a && "number" == $.type(a.pageX) ? a : this._buffer; return { left: b.pageX , top: b.pageY } } , getDimensions: function () { return this._dimensions } } , Color = function () { function a(a) { return ("0" + parseInt(a).toString(16)).slice(-2) } function b(b) { return b = b.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+))?\)$/), "#" + a(b[1]) + a(b[2]) + a(b[3]) } var c = { _default: "#000000" , aqua: "#00ffff" , black: "#000000" , blue: "#0000ff" , fuchsia: "#ff00ff" , gray: "#808080" , green: "#008000" , lime: "#00ff00" , maroon: "#800000" , navy: "#000080" , olive: "#808000" , purple: "#800080" , red: "#ff0000" , silver: "#c0c0c0" , teal: "#008080" , white: "#ffffff" , yellow: "#ffff00" }; return { toRGB: function (a) { if (/^rgba?\(/.test(a)) return b(a); c[a] && (a = c[a]); var d = a.replace("#", ""); return /^(?:[0-9a-fA-F]{3}){1,2}$/.test(d) || c._default, 3 == d.length && (d = d.charAt(0) + d.charAt(0) + d.charAt(1) + d.charAt(1) + d.charAt(2) + d.charAt(2)), "#" + d } } }(); Spin.supported = Support.css.transform && Support.css.animation, $.extend(Spin.prototype, { initialize: function () { this.options = $.extend({}, arguments[0] || {}), this.build(), this.start() } , build: function () { var a = 2 * (this.options.length + this.options.radius) , b = { height: a , width: a }; this.element = $("
").addClass("tpd-spin").css(b), this.element.append(this._rotate = $("
").addClass("tpd-spin-rotate")), this.element.css({ "margin-left": -.5 * b.width , "margin-top": -.5 * b.height }); for (var c = this.options.lines, d = 0; c > d; d++) { var e, f; this._rotate.append(e = $("
").addClass("tpd-spin-frame").append(f = $("
").addClass("tpd-spin-line"))), f.css({ "background-color": this.options.color , width: this.options.width , height: this.options.length , "margin-left": -.5 * this.options.width , "border-radius": Math.round(.5 * this.options.width) }), e.css({ opacity: (1 / c * (d + 1)).toFixed(2) }); var g = {}; g[Support.css.prefixed("transform")] = "rotate(" + 360 / c * (d + 1) + "deg)", e.css(g) } } , start: function () { var a = {}; a[Support.css.prefixed("animation")] = "tpd-spin 1s infinite steps(" + this.options.lines + ")", this._rotate.css(a) } , stop: function () { var a = {}; a[Support.css.prefixed("animation")] = "none", this._rotate.css(a), this.element.detach() } }), $.extend(Visible.prototype, { initialize: function (a) { return a = "array" == $.type(a) ? a : [a], this.elements = a, this._restore = [], $.each(a, $.proxy(function (a, b) { var c = $(b).is(":visible"); c || $(b).show(), this._restore.push({ element: b , visible: c }) }, this)), this } , restore: function () { $.each(this._restore, function (a, b) { b.visible || $(b.element).show() }), this._restore = null } }); var Z = function () { var a = []; return { get: function (b) { for (var c = null, d = 0; d < a.length; d++) a[d] && a[d].url == b.url && (a[d].type || "GET").toUpperCase() == (b.type || "GET").toUpperCase() && $.param(a[d].data || {}) == $.param(b.data || {}) && (c = a[d]); return c } , set: function (b, c, d) { var e = this.get(b); e || (e = $.extend({ callbacks: {} }, b), a.push(e)), e.callbacks[c] = d } , remove: function (b) { for (var c = 0; c < a.length; c++) a[c] && a[c].url == b && delete a[c] } , clear: function () { a = [] } } }() , Voila = function (a) { function b(c, d, e) { if (!(this instanceof b)) return new b(c, d, e); var f = a.type(arguments[1]) , g = "object" === f ? arguments[1] : {} , h = "function" === f ? arguments[1] : "function" === a.type(arguments[2]) ? arguments[2] : !1; return this.options = a.extend({ method: "onload" }, g), this.deferred = new jQuery.Deferred, h && this.always(h), this._processed = 0, this.images = [], this._add(c), this } a.extend(b.prototype, { _add: function (b) { var d = "string" == a.type(b) ? a(b) : b instanceof jQuery || b.length > 0 ? b : [b]; a.each(d, a.proxy(function (b, d) { var e = a() , f = a(d); e = f.is("img") ? e.add(f) : e.add(f.find("img")), e.each(a.proxy(function (b, d) { this.images.push(new c(d, a.proxy(function (a) { this._progress(a) }, this), a.proxy(function (a) { this._progress(a) }, this), this.options)) }, this)) }, this)), this.images.length < 1 && setTimeout(a.proxy(function () { this._resolve() }, this)) } , abort: function () { this._progress = this._notify = this._reject = this._resolve = function () { }, a.each(this.images, function (a, b) { b.abort() }), this.images = [] } , _progress: function (a) { this._processed++, a.isLoaded || (this._broken = !0), this._notify(a), this._processed == this.images.length && this[this._broken ? "_reject" : "_resolve"]() } , _notify: function (a) { this.deferred.notify(this, a) } , _reject: function () { this.deferred.reject(this) } , _resolve: function () { this.deferred.resolve(this) } , always: function (a) { return this.deferred.always(a), this } , done: function (a) { return this.deferred.done(a), this } , fail: function (a) { return this.deferred.fail(a), this } , progress: function (a) { return this.deferred.progress(a), this } }); var c = function (a) { var b = function () { return this.initialize.apply(this, Array.prototype.slice.call(arguments)) }; a.extend(b.prototype, { initialize: function () { this.options = a.extend({ test: function () { } , success: function () { } , timeout: function () { } , callAt: !1 , intervals: [[0, 0], [1e3, 10], [2e3, 50], [4e3, 100], [2e4, 500]] }, arguments[0] || {}), this._test = this.options.test, this._success = this.options.success, this._timeout = this.options.timeout, this._ipos = 0, this._time = 0, this._delay = this.options.intervals[this._ipos][1], this._callTimeouts = [], this.poll(), this._createCallsAt() } , poll: function () { this._polling = setTimeout(a.proxy(function () { if (this._test()) return this.success(), void 0; if (this._time += this._delay, this._time >= this.options.intervals[this._ipos][0]) { if (!this.options.intervals[this._ipos + 1]) return "function" == a.type(this._timeout) && this._timeout(), void 0; this._ipos++, this._delay = this.options.intervals[this._ipos][1] } this.poll() }, this), this._delay) } , success: function () { this.abort(), this._success() } , _createCallsAt: function () { this.options.callAt && a.each(this.options.callAt, a.proxy(function (b, c) { var d = c[0] , e = c[1] , f = setTimeout(a.proxy(function () { e() }, this), d); this._callTimeouts.push(f) }, this)) } , _stopCallTimeouts: function () { a.each(this._callTimeouts, function (a, b) { clearTimeout(b) }), this._callTimeouts = [] } , abort: function () { this._stopCallTimeouts(), this._polling && (clearTimeout(this._polling), this._polling = null) } }); var c = function () { return this.initialize.apply(this, Array.prototype.slice.call(arguments)) }; return a.extend(c.prototype, { supports: { naturalWidth: function () { return "naturalWidth" in new Image }() } , initialize: function (b, c, d) { return this.img = a(b)[0], this.successCallback = c, this.errorCallback = d, this.isLoaded = !1, this.options = a.extend({ method: "onload" , pollFallbackAfter: 1e3 }, arguments[3] || {}), "onload" != this.options.method && this.supports.naturalWidth ? (this.poll(), void 0) : (this.load(), void 0) } , poll: function () { this._poll = new b({ test: a.proxy(function () { return this.img.naturalWidth > 0 }, this) , success: a.proxy(function () { this.success() }, this) , timeout: a.proxy(function () { this.error() }, this) , callAt: [[this.options.pollFallbackAfter, a.proxy(function () { this.load() }, this)]] }) } , load: function () { this._loading = setTimeout(a.proxy(function () { var b = new Image; this._onloadImage = b, b.onload = a.proxy(function () { b.onload = function () { }, this.supports.naturalWidth || (this.img.naturalWidth = b.width, this.img.naturalHeight = b.height, b.naturalWidth = b.width, b.naturalHeight = b.height), this.success() }, this), b.onerror = a.proxy(this.error, this), b.src = this.img.src }, this)) } , success: function () { this._calledSuccess || (this._calledSuccess = !0, this.abort(), this.waitForRender(a.proxy(function () { this.isLoaded = !0, this.successCallback(this) }, this))) } , error: function () { this._calledError || (this._calledError = !0, this.abort(), this._errorRenderTimeout = setTimeout(a.proxy(function () { this.errorCallback && this.errorCallback(this) }, this))) } , abort: function () { this.stopLoading(), this.stopPolling(), this.stopWaitingForRender() } , stopPolling: function () { this._poll && (this._poll.abort(), this._poll = null) } , stopLoading: function () { this._loading && (clearTimeout(this._loading), this._loading = null), this._onloadImage && (this._onloadImage.onload = function () { }, this._onloadImage.onerror = function () { }) } , waitForRender: function (a) { this._renderTimeout = setTimeout(a) } , stopWaitingForRender: function () { this._renderTimeout && (clearTimeout(this._renderTimeout), this._renderTimeout = null), this._errorRenderTimeout && (clearTimeout(this._errorRenderTimeout), this._errorRenderTimeout = null) } }), c }(jQuery); return b }(jQuery); X.Behaviors = { hide: { showOn: { element: "mouseenter" , tooltip: !1 } , hideOn: { element: "mouseleave" , tooltip: "mouseenter" } } , mouse: { showOn: { element: "mouseenter" , tooltip: !1 } , hideOn: { element: "mouseleave" , tooltip: "mouseenter" } , target: "mouse" , showDelay: 100 , fadeIn: 0 , hideDelay: 0 , fadeOut: 0 } , sticky: { showOn: { element: "mouseenter" , tooltip: "mouseenter" } , hideOn: { element: "mouseleave" , tooltip: "mouseleave" } , showDelay: 150 , target: "mouse" , fixed: !0 } }; var ba = { create: function () { function a(b) { return e = X.Skins.base, f = deepExtend($.extend({}, e), X.Skins.reset), a = d, d(b) } function b(a) { return a.match(/^(top|left|bottom|right)$/) && (a += "middle"), a.replace("center", "middle").replace(" ", ""), a } function c(a) { var b, c; return b = a.behavior && (c = X.Behaviors[a.behavior]) ? deepExtend($.extend({}, c), a) : a } function d(a) { var d = a.skin ? a.skin : bb.options.defaultSkin , g = $.extend({}, X.Skins[d] || {}); g.skin || (g.skin = bb.options.defaultSkin || "dark"); var h = deepExtend($.extend({}, f), c(g)) , i = deepExtend($.extend({}, h), c(a)); if (i.ajax) { var j = (f.ajax || {}, e.ajax); "boolean" == $.type(i.ajax) && (i.ajax = {}), i.ajax = deepExtend($.extend({}, j), i.ajax) } var k, l = l = i.position && i.position.target || "string" == $.type(i.position) && i.position || f.position && f.position.target || "string" == $.type(f.position) && f.position || e.position && e.position.target || e.position; l = b(l); var m = i.position && i.position.tooltip || f.position && f.position.tooltip || e.position && e.position.tooltip || bb.Position.getInversedPosition(l); if (m = b(m), i.position ? "string" == $.type(i.position) ? (i.position = b(i.position), k = { target: i.position , tooltip: bb.Position.getTooltipPositionFromTarget(i.position) }) : (k = { tooltip: m , target: l }, i.position.tooltip && (k.tooltip = b(i.position.tooltip)), i.position.target && (k.target = b(i.position.target))) : k = { tooltip: m , target: l }, Position.isCorner(k.target) && Position.getOrientation(k.target) != Position.getOrientation(k.tooltip) && (k.target = Position.inverseCornerPlane(k.target)), "mouse" == i.target) { var n = Position.getOrientation(k.target); k.target = "horizontal" == n ? k.target.replace(/(left|right)/, "middle") : k.target.replace(/(top|bottom)/, "middle") } i.position = k; var o; if ("mouse" == i.target ? (o = $.extend({}, e.offset), $.extend(o, X.Skins.reset.offset || {}), a.skin && $.extend(o, (X.Skins[a.skin] || X.Skins[bb.options.defaultSkin] || {}).offset || {}), o = Position.adjustOffsetBasedOnPosition(e.offset, e.position, k.target, !0), a.offset && (o = $.extend(o, a.offset || {}))) : o = { x: i.offset.x , y: i.offset.y }, i.offset = o, i.hideOn && "click-outside" == i.hideOn && (i.hideOnClickOutside = !0, i.hideOn = !1, i.fadeOut = 0), i.showOn) { var p = i.showOn; "string" == $.type(p) && (p = { element: p }), i.showOn = p } if (i.hideOn) { var q = i.hideOn; "string" == $.type(q) && (q = { element: q }), i.hideOn = q } return i.inline && "string" != $.type(i.inline) && (i.inline = !1), Y.IE && Y.IE < 9 && $.extend(i, { fadeIn: 0 , fadeOut: 0 , hideDelay: 0 }), i.spinner && (Spin.supported ? "boolean" == $.type(i.spinner) && (i.spinner = f.spinner || e.spinner || {}) : i.spinner = !1), i.container || (i.container = document.body), i.containment && "string" == $.type(i.containment) && (i.containment = { selector: i.containment , padding: f.containment && f.containment.padding || e.padding && e.containment.padding }), i.shadow && (i.shadow = Support.shadow), i } var e, f; return a }() }; $.extend(Skin.prototype, { initialize: function (a) { this.tooltip = a, this.element = a._skin; var b = this.tooltip.options; this.tooltip._tooltip[(b.shadow ? "remove" : "add") + "Class"]("tpd-no-shadow")[(b.radius ? "remove" : "add") + "Class"]("tpd-no-radius")[(b.stem ? "remove" : "add") + "Class"]("tpd-no-stem"); var c, d, e, f, g = Support.css.prefixed("borderTopLeftRadius"); this.element.append(c = $("
").addClass("tpd-frames").append($("
").addClass("tpd-frame").append($("
").addClass("tpd-backgrounds").append(d = $("
").addClass("tpd-background").append(e = $("
").addClass("tpd-background-content")))))).append(f = $("
").addClass("tpd-spinner")), d.css({ width: 999 , height: 999 , zoom: 1 }), this._css = { border: parseFloat(d.css("border-top-width")) , radius: parseFloat(g ? d.css(g) : 0) , padding: parseFloat(a._content.css("padding-top")) , borderColor: d.css("border-top-color") , backgroundColor: e.css("background-color") , backgroundOpacity: e.css("opacity") , spinner: { dimensions: { width: f.innerWidth() , height: f.innerHeight() } } }, f.remove(), c.remove(), this._side = Position.getSide(a.options.position.tooltip) || "top", this._vars = {} } , destroy: function () { this.frames && ($.each("top right bottom left".split(" "), $.proxy(function (a, b) { this["stem_" + b] && this["stem_" + b].destroy() }, this)), this.frames.remove(), this.frames = null) } , build: function () { this.frames || (this.element.append(this.frames = $("
").addClass("tpd-frames")), $.each("top right bottom left".split(" "), $.proxy(function (a, b) { this.insertFrame(b) }, this)), this._spinner || this.tooltip._tooltip.append(this._spinner = $("
").addClass("tpd-spinner").hide().append($("
").addClass("tpd-spinner-spin")))) } , _frame: function () { var a, b = $("
").addClass("tpd-frame").append(a = $("
").addClass("tpd-backgrounds").append($("
").addClass("tpd-background-shadow"))).append($("
").addClass("tpd-shift-stem").append($("
").addClass("tpd-shift-stem-side tpd-shift-stem-side-before")).append($("
").addClass("tpd-stem")).append($("
").addClass("tpd-shift-stem-side tpd-shift-stem-side-after"))); return $.each("top right bottom left".split(" "), $.proxy(function (b, c) { a.append($("
").addClass("tpd-background-box tpd-background-box-" + c).append($("
").addClass("tpd-background-box-shift").append($("
").addClass("tpd-background-box-shift-further").append($("
").addClass("tpd-background").append($("
").addClass("tpd-background-title")).append($("
").addClass("tpd-background-content"))).append($("
").addClass("tpd-background tpd-background-loading")).append($("
").addClass("tpd-background-border-hack").hide())))) }, this)), b }() , _getFrame: function (a) { var b = this._frame.clone(); b.addClass("tpd-frame-" + a), b.find(".tpd-background-shadow").css({ "border-radius": this._css.radius }), this.tooltip.options.stem && b.find(".tpd-stem").attr("data-stem-position", a); var c = Math.max(this._css.radius - this._css.border, 0); b.find(".tpd-background-title").css({ "border-top-left-radius": c , "border-top-right-radius": c }), b.find(".tpd-background-content").css({ "border-bottom-left-radius": c , "border-bottom-right-radius": c }), b.find(".tpd-background-loading").css({ "border-radius": c }); var d = { backgroundColor: this._css.borderColor } , e = Position.getOrientation(a) , f = "horizontal" == e; d[f ? "height" : "width"] = this._css.border + "px"; var g = { top: "bottom" , bottom: "top" , left: "right" , right: "left" }; return d[g[a]] = 0, b.find(".tpd-shift-stem-side").css(d), b } , insertFrame: function (a) { var b = this["frame_" + a] = this._getFrame(a); if (this.frames.append(b), this.tooltip.options.stem) { var c = b.find(".tpd-stem"); this["stem_" + a] = new Stem(c, this, {}) } } , startLoading: function () { this.tooltip.supportsLoading && (this.build(), this._spinner || this.tooltip.is("resize-to-content") || this.setDimensions(this._css.spinner.dimensions), this._spinner && this._spinner.show()) } , stopLoading: function () { this.tooltip.supportsLoading && this._spinner && (this.build(), this._spinner.hide()) } , updateBackground: function () { var a = this._vars.frames[this._side] , b = $.extend({}, a.background.dimensions); if (this.tooltip.title && !this.tooltip.is("loading")) { this.element.find(".tpd-background-title, .tpd-background-content").show(), this.element.find(".tpd-background").css({ "background-color": "transparent" }); var c = $.extend({}, b) , d = Math.max(this._css.radius - this._css.border, 0) , e = { "border-top-left-radius": d , "border-top-right-radius": d , "border-bottom-left-radius": d , "border-bottom-right-radius": d } , f = new Visible(this.tooltip._tooltip) , g = this.tooltip._titleWrapper.innerHeight(); c.height -= g, this.element.find(".tpd-background-title").css({ height: g , width: b.width }), e["border-top-left-radius"] = 0, e["border-top-right-radius"] = 0, f.restore(), this.element.find(".tpd-background-content").css(c).css(e), this.element.find(".tpd-background-loading").css({ "background-color": this._css.backgroundColor }) } else this.element.find(".tpd-background-title, .tpd-background-content").hide(), this.element.find(".tpd-background").css({ "background-color": this._css.backgroundColor }); this._css.border && (this.element.find(".tpd-background").css({ "border-color": "transparent" }), this.element.find(".tpd-background-border-hack").css({ width: b.width , height: b.height , "border-radius": this._css.radius , "border-width": this._css.border , "border-color": this._css.borderColor }).show()) } , paint: function () { if (!this._paintedDimensions || this._paintedDimensions.width != this._dimensions.width || this._paintedDimensions.height != this._dimensions.height || this._paintedStemPosition != this._stemPosition) { this._paintedDimensions = this._dimensions, this._paintedStemPosition = this._stemPosition, this.element.removeClass("tpd-visible-frame-top tpd-visible-frame-bottom tpd-visible-frame-left tpd-visible-frame-right").addClass("tpd-visible-frame-" + this._side); var a = this._vars.frames[this._side] , b = $.extend({}, a.background.dimensions); this.element.find(".tpd-background").css(b), this.element.find(".tpd-background-shadow").css({ width: b.width + 2 * this._css.border , height: b.height + 2 * this._css.border }), this.updateBackground(), this.element.find(".tpd-background-box-shift, .tpd-background-box-shift-further").removeAttr("style"), this.element.add(this.frames).add(this.tooltip._tooltip).css(a.dimensions); var c = this._side , d = this._vars.frames[c] , e = this.element.find(".tpd-frame-" + this._side) , f = this._vars.frames[c].dimensions; e.css(f), e.find(".tpd-backgrounds").css($.extend({}, d.background.position, { width: f.width - d.background.position.left , height: f.height - d.background.position.top })); var g = Position.getOrientation(c); if (this.tooltip.options.stem) if (e.find(".tpd-shift-stem").css($.extend({}, d.shift.dimensions, d.shift.position)), "vertical" == g) { var h = e.find(".tpd-background-box-top, .tpd-background-box-bottom"); h.css({ height: this._vars.cut , width: this._css.border }), e.find(".tpd-background-box-bottom").css({ top: d.dimensions.height - this._vars.cut }).find(".tpd-background-box-shift").css({ "margin-top": -1 * d.dimensions.height + this._vars.cut }); var i = "right" == c ? d.dimensions.width - d.stemPx - this._css.border : 0; h.css({ left: i }).find(".tpd-background-box-shift").css({ "margin-left": -1 * i }), e.find(".tpd-background-box-" + ("left" == c ? "left" : "right")).hide(), "right" == c ? e.find(".tpd-background-box-left").css({ width: d.dimensions.width - d.stemPx - this._css.border }) : e.find(".tpd-background-box-right").css({ "margin-left": this._css.border }).find(".tpd-background-box-shift").css({ "margin-left": -1 * this._css.border }); var j = e.find(".tpd-background-box-" + this._side); j.css({ height: d.dimensions.height - 2 * this._vars.cut , "margin-top": this._vars.cut }), j.find(".tpd-background-box-shift").css({ "margin-top": -1 * this._vars.cut }) } else { var h = e.find(".tpd-background-box-left, .tpd-background-box-right"); h.css({ width: this._vars.cut , height: this._css.border }), e.find(".tpd-background-box-right").css({ left: d.dimensions.width - this._vars.cut }).find(".tpd-background-box-shift").css({ "margin-left": -1 * d.dimensions.width + this._vars.cut }); var i = "bottom" == c ? d.dimensions.height - d.stemPx - this._css.border : 0; h.css({ top: i }).find(".tpd-background-box-shift").css({ "margin-top": -1 * i }), e.find(".tpd-background-box-" + ("top" == c ? "top" : "bottom")).hide(), "bottom" == c ? e.find(".tpd-background-box-top").css({ height: d.dimensions.height - d.stemPx - this._css.border }) : e.find(".tpd-background-box-bottom").css({ "margin-top": this._css.border }).find(".tpd-background-box-shift").css({ "margin-top": -1 * this._css.border }); var j = e.find(".tpd-background-box-" + this._side); j.css({ width: d.dimensions.width - 2 * this._vars.cut , "margin-left": this._vars.cut }), j.find(".tpd-background-box-shift").css({ "margin-left": -1 * this._vars.cut }) } var k = a.background , l = k.position , m = k.dimensions; this._spinner.css({ top: l.top + this._css.border + (.5 * m.height - .5 * this._css.spinner.dimensions.height) , left: l.left + this._css.border + (.5 * m.width - .5 * this._css.spinner.dimensions.width) }) } } , getVars: function () { var a = (this._css.padding, this._css.radius, this._css.border) , b = this._vars.maxStemHeight || 0 , c = $.extend({}, this._dimensions || {}) , d = { frames: {} , dimensions: c , maxStemHeight: b }; d.cut = Math.max(this._css.border, this._css.radius) || 0; var e = { width: 0 , height: 0 } , f = 0 , g = 0; return this.tooltip.options.stem && (e = this.stem_top.getMath().dimensions.outside, f = this.stem_top._css.offset, g = Math.max(e.height - this._css.border, 0)), d.stemDimensions = e, d.stemOffset = f, Position.getOrientation(this._side), $.each("top right bottom left".split(" "), $.proxy(function (b, f) { var h = Position.getOrientation(f) , i = "vertical" == h , j = { width: c.width + 2 * a , height: c.height + 2 * a } , k = j[i ? "height" : "width"] - 2 * d.cut , l = { dimensions: j , stemPx: g , position: { top: 0 , left: 0 } , background: { dimensions: $.extend({}, c) , position: { top: 0 , left: 0 } } }; if (d.frames[f] = l, l.dimensions[i ? "width" : "height"] += g, ("top" == f || "left" == f) && (l.background.position[f] += g), $.extend(l, { shift: { position: { top: 0 , left: 0 } , dimensions: { width: i ? e.height : k , height: i ? k : e.height } } }), Y.IE && Y.IE < 9) { var m = l.shift.dimensions; m.width = Math.round(m.width), m.height = Math.round(m.height) } switch (f) { case "top": case "bottom": l.shift.position.left += d.cut, "bottom" == f && (l.shift.position.top += j.height - a - g); break; case "left": case "right": l.shift.position.top += d.cut, "right" == f && (l.shift.position.left += j.width - a - g) } }, this)), d.connections = {}, $.each(Position.positions, $.proxy(function (a, b) { d.connections[b] = this.getConnectionLayout(b, d) }, this)), d } , setDimensions: function (a) { this.build(); var b = this._dimensions; b && b.width == a.width && b.height == a.height || (this._dimensions = a, this._vars = this.getVars()) } , setSide: function (a) { this._side = a, this._vars = this.getVars() } , getConnectionLayout: function (a, b) { var c = Position.getSide(a) , d = Position.getOrientation(a) , e = (b.dimensions, b.cut) , f = this["stem_" + c] , g = b.stemOffset , h = this.tooltip.options.stem ? f.getMath().dimensions.outside.width : 0 , i = e + g + .5 * h , j = { stem: {} } , k = { left: 0 , right: 0 , up: 0 , down: 0 } , l = { top: 0 , left: 0 } , m = { top: 0 , left: 0 } , n = b.frames[c] , i = 0; if ("horizontal" == d) { var o = n.dimensions.width; this.tooltip.options.stem && (o = n.shift.dimensions.width, 2 * g > o - h && (g = Math.floor(.5 * (o - h)) || 0), i = e + g + .5 * h); var p = o - 2 * g , q = Position.split(a) , r = g; switch (q[2]) { case "left": k.right = p - h, l.left = i; break; case "middle": r += Math.round(.5 * p - .5 * h), k.left = r - g, k.right = r - g, l.left = m.left = Math.round(.5 * n.dimensions.width); break; case "right": r += p - h, k.left = p - h, l.left = n.dimensions.width - i, m.left = n.dimensions.width } "bottom" == q[1] && (l.top += n.dimensions.height, m.top += n.dimensions.height), $.extend(j.stem, { position: { left: r } , before: { width: r } , after: { left: r + h , width: o - r - h + 1 } }) } else { var s = n.dimensions.height; this.tooltip.options.stem && (s = n.shift.dimensions.height, 2 * g > s - h && (g = Math.floor(.5 * (s - h)) || 0), i = e + g + .5 * h); var t = s - 2 * g , q = Position.split(a) , u = g; switch (q[2]) { case "top": k.down = t - h, l.top = i; break; case "middle": u += Math.round(.5 * t - .5 * h), k.up = u - g, k.down = u - g, l.top = m.top = Math.round(.5 * n.dimensions.height); break; case "bottom": u += t - h, k.up = t - h, l.top = n.dimensions.height - i, m.top = n.dimensions.height } "right" == q[1] && (l.left += n.dimensions.width, m.left += n.dimensions.width), $.extend(j.stem, { position: { top: u } , before: { height: u } , after: { top: u + h , height: s - u - h + 1 } }) } return j.move = k, j.stem.connection = l, j.connection = m, j } , setStemPosition: function (a, b) { if (this._stemPosition != a) { this._stemPosition = a; var c = Position.getSide(a); this.setSide(c) } this.tooltip.options.stem && this.setStemShift(a, b) } , setStemShift: function (a, b) { var c = this._shift , d = this._dimensions; if (!c || c.stemPosition != a || c.shift.x != b.x || c.shift.y != b.y || !d || c.dimensions.width != d.width || c.dimensions.height != d.height) { this._shift = { stemPosition: a , shift: b , dimensions: d }; var e = Position.getSide(a) , f = { horizontal: "x" , vertical: "y" }[Position.getOrientation(a)] , g = { x: { left: "left" , width: "width" } , y: { left: "top" , width: "height" } }[f] , h = this["stem_" + e] , i = deepExtend({}, this._vars.connections[a].stem); b && 0 !== b[f] && (i.before[g.width] += b[f], i.position[g.left] += b[f], i.after[g.left] += b[f], i.after[g.width] -= b[f]), h.element.css(i.position), h.element.siblings(".tpd-shift-stem-side-before").css(i.before), h.element.siblings(".tpd-shift-stem-side-after").css(i.after) } } }), $.extend(Stem.prototype, { initialize: function (a, b) { this.element = $(a), this.element[0] && (this.skin = b, this.element.removeClass("tpd-stem-reset"), this._css = $.extend({}, b._css, { width: this.element.innerWidth() , height: this.element.innerHeight() , offset: parseFloat(this.element.css("margin-left")) , spacing: parseFloat(this.element.css("margin-top")) }), this.element.addClass("tpd-stem-reset"), this.options = $.extend({}, arguments[2] || {}), this._position = this.element.attr("data-stem-position") || "top", this._m = 100, this.build()) } , destroy: function () { this.element.html("") } , build: function () { this.destroy(); var a = this._css.backgroundColor , b = a.indexOf("rgba") > -1 && parseFloat(a.replace(/^.*,(.+)\)/, "$1")) , c = b && 1 > b; this._useTransform = c && Support.css.transform, this._css.border || (this._useTransform = !1), this[(this._useTransform ? "build" : "buildNo") + "Transform"]() } , buildTransform: function () { this.element.append(this.spacer = $("
").addClass("tpd-stem-spacer").append(this.downscale = $("
").addClass("tpd-stem-downscale").append(this.transform = $("
").addClass("tpd-stem-transform").append(this.first = $("
").addClass("tpd-stem-side").append(this.border = $("
").addClass("tpd-stem-border")).append($("
").addClass("tpd-stem-border-corner")).append($("
").addClass("tpd-stem-triangle")))))), this.transform.append(this.last = this.first.clone().addClass("tpd-stem-side-inversed")), this.sides = this.first.add(this.last); var a = this.getMath() , b = a.dimensions , c = this._m , d = Position.getSide(this._position); if (this.element.find(".tpd-stem-spacer").css({ width: l ? b.inside.height : b.inside.width , height: l ? b.inside.width : b.inside.height }), "top" == d || "left" == d) { var e = {}; "top" == d ? (e.bottom = 0, e.top = "auto") : "left" == d && (e.right = 0, e.left = "auto"), this.element.find(".tpd-stem-spacer").css(e) } this.transform.css({ width: b.inside.width * c , height: b.inside.height * c }); var f = Support.css.prefixed("transform") , g = { "background-color": "transparent" , "border-bottom-color": this._css.backgroundColor , "border-left-width": .5 * b.inside.width * c , "border-bottom-width": b.inside.height * c }; g[f] = "translate(" + a.border * c + "px, 0)", this.element.find(".tpd-stem-triangle").css(g); var h = this._css.borderColor; alpha = h.indexOf("rgba") > -1 && parseFloat(h.replace(/^.*,(.+)\)/, "$1")), alpha && 1 > alpha ? h = (h.substring(0, h.lastIndexOf(",")) + ")").replace("rgba", "rgb") : alpha = 1; var i = { "background-color": "transparent" , "border-right-width": a.border * c , width: a.border * c , "margin-left": -2 * a.border * c , "border-color": h , opacity: alpha }; i[f] = "skew(" + a.skew + "deg) translate(" + a.border * c + "px, " + -1 * this._css.border * c + "px)", this.element.find(".tpd-stem-border").css(i); var h = this._css.borderColor; alpha = h.indexOf("rgba") > -1 && parseFloat(h.replace(/^.*,(.+)\)/, "$1")), alpha && 1 > alpha ? h = (h.substring(0, h.lastIndexOf(",")) + ")").replace("rgba", "rgb") : alpha = 1; var j = { width: a.border * c , "border-right-width": a.border * c , "border-right-color": h , background: h , opacity: alpha , "margin-left": -2 * a.border * c }; if (j[f] = "skew(" + a.skew + "deg) translate(" + a.border * c + "px, " + (b.inside.height - this._css.border) * c + "px)", this.element.find(".tpd-stem-border-corner").css(j), this.setPosition(this._position), c > 1) { var k = {}; k[f] = "scale(" + 1 / c + "," + 1 / c + ")", this.downscale.css(k) } var l = /^(left|right)$/.test(this._position); this._css.border || this.element.find(".tpd-stem-border, .tpd-stem-border-corner").hide(), this.element.css({ width: l ? b.outside.height : b.outside.width , height: l ? b.outside.width : b.outside.height }) } , buildNoTransform: function () { this.element.append(this.spacer = $("
").addClass("tpd-stem-spacer").append($("
").addClass("tpd-stem-notransform").append($("
").addClass("tpd-stem-border").append($("
").addClass("tpd-stem-border-corner")).append($("
").addClass("tpd-stem-border-center-offset").append($("
").addClass("tpd-stem-border-center-offset-inverse").append($("
").addClass("tpd-stem-border-center"))))).append($("
").addClass("tpd-stem-triangle")))); var a = this.getMath() , b = a.dimensions , c = /^(left|right)$/.test(this._position) , d = /^(bottom)$/.test(this._position) , e = /^(right)$/.test(this._position) , f = Position.getSide(this._position); if (this.element.css({ width: c ? b.outside.height : b.outside.width , height: c ? b.outside.width : b.outside.height }), this.element.find(".tpd-stem-notransform").add(this.element.find(".tpd-stem-spacer")).css({ width: c ? b.inside.height : b.inside.width , height: c ? b.inside.width : b.inside.height }), "top" == f || "left" == f) { var g = {}; "top" == f ? (g.bottom = 0, g.top = "auto") : "left" == f && (g.right = 0, g.left = "auto"), this.element.find(".tpd-stem-spacer").css(g) } this.element.find(".tpd-stem-border").css({ width: "100%" , background: "transparent" }); var h = { opacity: Y.IE && Y.IE < 9 ? this._css.borderOpacity : 1 }; h[c ? "height" : "width"] = "100%", h[c ? "width" : "height"] = this._css.border, h[d ? "top" : "bottom"] = 0, $.extend(h, e ? { left: 0 } : { right: 0 }), this.element.find(".tpd-stem-border-corner").css(h); var i = { width: 0 , "background-color": "transparent" , opacity: Y.IE && Y.IE < 9 ? this._css.borderOpacity : 1 } , j = .5 * b.inside.width + "px solid transparent" , k = { "background-color": "transparent" }; if (.5 * b.inside.width - a.border + "px solid transparent", c) { var l = { left: "auto" , top: "50%" , "margin-top": -.5 * b.inside.width , "border-top": j , "border-bottom": j }; if ($.extend(i, l), i[e ? "right" : "left"] = 0, i[e ? "border-left" : "border-right"] = b.inside.height + "px solid " + this._css.borderColor, $.extend(k, l), k[e ? "border-left" : "border-right"] = b.inside.height + "px solid " + this._css.backgroundColor, k[e ? "right" : "left"] = a.top, k[e ? "left" : "right"] = "auto", Y.IE && Y.IE < 8) { var m = .5 * this._css.width + "px solid transparent"; $.extend(k, { "margin-top": -.5 * this._css.width , "border-top": m , "border-bottom": m }), k[e ? "border-left" : "border-right"] = this._css.height + "px solid " + this._css.backgroundColor } this.element.find(".tpd-stem-border-center-offset").css({ "margin-left": -1 * this._css.border * (e ? -1 : 1) }).find(".tpd-stem-border-center-offset-inverse").css({ "margin-left": this._css.border * (e ? -1 : 1) }) } else { var l = { "margin-left": -.5 * b.inside.width , "border-left": j , "border-right": j }; if ($.extend(i, l), i[d ? "border-top" : "border-bottom"] = b.inside.height + "px solid " + this._css.borderColor, $.extend(k, l), k[d ? "border-top" : "border-bottom"] = b.inside.height + "px solid " + this._css.backgroundColor, k[d ? "bottom" : "top"] = a.top, k[d ? "top" : "bottom"] = "auto", Y.IE && Y.IE < 8) { var m = .5 * this._css.width + "px solid transparent"; $.extend(k, { "margin-left": -.5 * this._css.width , "border-left": m , "border-right": m }), k[d ? "border-top" : "border-bottom"] = this._css.height + "px solid " + this._css.backgroundColor } this.element.find(".tpd-stem-border-center-offset").css({ "margin-top": -1 * this._css.border * (d ? -1 : 1) }).find(".tpd-stem-border-center-offset-inverse").css({ "margin-top": this._css.border * (d ? -1 : 1) }) } this.element.find(".tpd-stem-border-center").css(i), this.element.find(".tpd-stem-border-corner").css({ "background-color": this._css.borderColor }), this.element.find(".tpd-stem-triangle").css(k), this._css.border || this.element.find(".tpd-stem-border").hide() } , setPosition: function (a) { this._position = a, this.transform.attr("class", "tpd-stem-transform tpd-stem-transform-" + a) } , getMath: function () { var a = this._css.height , b = this._css.width , c = this._css.border; this._useTransform && Math.floor(b) % 2 && (b = Math.max(Math.floor(b) - 1, 0)); var d = degrees(Math.atan(.5 * b / a)) , e = 90 - d , f = c / Math.cos((90 - e) * Math.PI / 180) , g = c / Math.cos((90 - d) * Math.PI / 180) , h = { width: b + 2 * f , height: a + g }; Math.max(c, this._css.radius), a = h.height, b = .5 * h.width; var i = degrees(Math.atan(a / b)) , j = 90 - i , k = c / Math.cos(j * Math.PI / 180) , l = 180 * Math.atan(a / b) / Math.PI , m = -1 * (90 - l) , n = 90 - l , o = c * Math.tan(n * Math.PI / 180) , g = c / Math.cos((90 - n) * Math.PI / 180) , p = $.extend({}, h) , q = $.extend({}, h); q.height += this._css.spacing, q.height = Math.ceil(q.height); var r = !0; return 2 * c >= h.width && (r = !1), { enabled: r , outside: q , dimensions: { inside: p , outside: q } , top: g , border: k , skew: m , corner: o } } }); var bb = { tooltips: {} , options: { defaultSkin: "dark" , startingZIndex: 999999 } , _emptyClickHandler: function () { } , init: function () { this.reset(), this._resizeHandler = $.proxy(this.onWindowResize, this), $(window).bind("resize orientationchange", this._resizeHandler), Y.MobileSafari && $("body").bind("click", this._emptyClickHandler) } , reset: function () { bb.removeAll(), bd.removeAll(), this._resizeHandler && $(window).unbind("resize orientationchange", this._resizeHandler), Y.MobileSafari && $("body").unbind("click", this._emptyClickHandler) } , onWindowResize: function () { this._resizeTimer && (window.clearTimeout(this._resizeTimer), this._resizeTimer = null), this._resizeTimer = _.delay($.proxy(function () { var a = this.getVisible(); $.each(a, function (a, b) { b.clearUpdatedTo(), b.position() }) }, this), 15) } , _getTooltips: function (a, b) { var c, d = [] , e = []; if (_.isElement(a) ? (c = $(a).data("tipped-uids")) && (d = d.concat(c)) : $(a).each(function (a, b) { (c = $(b).data("tipped-uids")) && (d = d.concat(c)) }), !d[0] && !b) { var f = this.getTooltipByTooltipElement($(a).closest(".tpd-tooltip")[0]); f && f.element && (c = $(f.element).data("tipped-uids") || [], c && (d = d.concat(c))) } return d.length > 0 && $.each(d, $.proxy(function (a, b) { var c; (c = this.tooltips[b]) && e.push(c) }, this)), e } , findElement: function (a) { var b = []; return _.isElement(a) && (b = this._getTooltips(a)), b[0] && b[0].element } , get: function (a) { var b = $.extend({ api: !1 }, arguments[1] || {}) , c = []; return _.isElement(a) ? c = this._getTooltips(a) : a instanceof $ ? a.each($.proxy(function (a, b) { var d = this._getTooltips(b, !0); d.length > 0 && (c = c.concat(d)) }, this)) : "string" == $.type(a) && $.each(this.tooltips, function (b, d) { d.element && $(d.element).is(a) && c.push(d) }), b.api && $.each(c, function (a, b) { b.is("api", !0) }), c } , getTooltipByTooltipElement: function (a) { if (!a) return null; var b = null; return $.each(this.tooltips, function (c, d) { d.is("build") && d._tooltip[0] === a && (b = d) }), b } , getBySelector: function (a) { var b = []; return $.each(this.tooltips, function (c, d) { d.element && $(d.element).is(a) && b.push(d) }), b } , getNests: function () { var a = []; return $.each(this.tooltips, function (b, c) { c.is("nest") && a.push(c) }), a } , show: function (a) { $(this.get(a)).each(function (a, b) { b.show(!1, !0) }) } , hide: function (a) { $(this.get(a)).each(function (a, b) { b.hide() }) } , toggle: function (a) { $(this.get(a)).each(function (a, b) { b.toggle() }) } , hideAll: function (a) { $.each(this.getVisible(), function (b, c) { a && a == c || c.hide() }) } , refresh: function (a) { var b; b = a ? $.grep(this.get(a), function (a) { return a.is("visible") }) : this.getVisible(), $.each(b, function (a, b) { b.refresh() }) } , getVisible: function () { var a = []; return $.each(this.tooltips, function (b, c) { c.visible() && a.push(c) }), a } , isVisibleByElement: function (a) { var b = !1; return _.isElement(a) && $.each(this.getVisible() || [], function (c, d) { return d.element == a ? (b = !0, !1) : void 0 }), b } , getHighestTooltip: function () { var a, b = 0; return $.each(this.tooltips, function (c, d) { d.zIndex > b && (b = d.zIndex, a = d) }), a } , resetZ: function () { this.getVisible().length <= 1 && $.each(this.tooltips, function (a, b) { b.is("build") && !b.options.zIndex && b._tooltip.css({ zIndex: b.zIndex = +bb.options.startingZIndex }) }) } , clearAjaxCache: function () { $.each(this.tooltips, $.proxy(function (a, b) { b.options.ajax && (b._cache && b._cache.xhr && (b._cache.xhr.abort(), b._cache.xhr = null), b.is("updated", !1), b.is("updating", !1), b.is("sanitized", !1)) }, this)), Z.clear() } , add: function (a) { this.tooltips[a.uid] = a } , remove: function (a) { var b = this._getTooltips(a); this.removeTooltips(b) } , removeTooltips: function (a) { a && $.each(a, $.proxy(function (a, b) { var c = b.uid; delete this.tooltips[c], Y.IE && Y.IE < 9 ? _.defer(function () { b.remove() }) : b.remove() }, this)) } , removeDetached: function () { var a = this.getNests() , b = []; a.length > 0 && $.each(a, function (a, c) { c.is("detached") && (b.push(c), c.attach()) }), $.each(this.tooltips, $.proxy(function (a, b) { b.element && !_.element.isAttached(b.element) && this.remove(b.element) }, this)), $.each(b, function (a, b) { b.detach() }) } , removeAll: function () { $.each(this.tooltips, $.proxy(function (a, b) { b.element && this.remove(b.element) }, this)), this.tooltips = {} } , setDefaultSkin: function (a) { this.options.defaultSkin = a || "dark" } , setStartingZIndex: function (a) { this.options.startingZIndex = a || 0 } }; bb.Position = { inversedPosition: { left: "right" , right: "left" , top: "bottom" , bottom: "top" , middle: "middle" , center: "center" } , getInversedPosition: function (a) { var b = Position.split(a) , c = b[1] , d = b[2] , e = Position.getOrientation(a) , f = $.extend({ horizontal: !0 , vertical: !0 }, arguments[1] || {}); return "horizontal" == e ? (f.vertical && (c = this.inversedPosition[c]), f.horizontal && (d = this.inversedPosition[d])) : (f.vertical && (d = this.inversedPosition[d]), f.horizontal && (c = this.inversedPosition[c])), c + d } , getTooltipPositionFromTarget: function (a) { var b = Position.split(a); return this.getInversedPosition(b[1] + this.inversedPosition[b[2]]) } }, $.extend(Tooltip.prototype, { supportsLoading: Support.css.transform && Support.css.animation , initialize: function (a, b) { if (this.element = a, this.element) { var c; "object" != $.type(b) || _.isElement(b) || _.isText(b) || _.isDocumentFragment(b) || b instanceof $ ? c = arguments[2] || {} : (c = b, b = null); var d = $(a).data("tipped-options"); d && (c = deepExtend($.extend({}, c), eval("({" + d + "})"))), this.options = ba.create(c), this._cache = { dimensions: { width: 0 , height: 0 } , events: [] , timers: {} , layouts: {} , is: {} , fnCallFn: "" , updatedTo: {} }, this.queues = { showhide: $({}) }; var e = $(a).attr("title") || $(a).data("tipped-restore-title"); if (!b) { var f = $(a).attr("data-tipped"); if (f ? b = f : e && (b = e), b) { var g = /)<[^<]*)*<\/script>/gi; b = b.replace(g, "") } } if ((!b || b instanceof $ && !b[0]) && !(this.options.ajax && this.options.ajax.url || this.options.inline)) return this._aborted = !0, void 0; e && ($(a).data("tipped-restore-title", e), $(a)[0].setAttribute("title", "")), this.content = b, this.title = $(this.element).data("tipped-title"), "undefined" != $.type(this.options.title) && (this.title = this.options.title), this.zIndex = this.options.zIndex || +bb.options.startingZIndex; var h = $(a).data("tipped-uids"); h || (h = []); var i = getUID(); this.uid = i, h.push(i), $(a).data("tipped-uids", h); var j = $(this.element).closest(".tpd-tooltip")[0] , parentTooltip; j && (parentTooltip = bb.getTooltipByTooltipElement(j)) && parentTooltip.is("nest", !0); var k = this.options.target; this.target = "mouse" == k ? this.element : "element" != k && k ? _.isElement(k) ? k : k instanceof $ && k[0] ? k[0] : this.element : this.element, this.options.inline && (this.content = $("#" + this.options.inline)[0]), this.options.ajax && (this.__content = this.content), "function" == $.type(this.content) && (this._fn = this.content), this.preBuild(), bb.add(this) } } , remove: function () { this.unbind(), this.clearTimers(), this.restoreElementToMarker(), this.stopLoading(), this.abort(), this.is("build") && this._tooltip && (this._tooltip.remove(), this._tooltip = null); var a = $(this.element).data("tipped-uids") || [] , b = $.inArray(this.uid, a); if (b > -1 && (a.splice(b, 1), $(this.element).data("tipped-uids", a)), a.length < 1) { var c, d = "tipped-restore-title"; (c = $(this.element).data(d)) && ("" != !$(this.element)[0].getAttribute("title") && $(this.element).attr("title", c), $(this.element).removeData(d)), $(this.element).removeData("tipped-uids") } var e = $(this.element).attr("class") || "" , f = e.replace(/(tpd-delegation-uid-)\d+/g, "").replace(/^\s\s*/, "").replace(/\s\s*$/, ""); $(this.element).attr("class", f) } , detach: function () { this.options.detach && !this.is("detached") && (this._tooltip && this._tooltip.detach(), this.is("detached", !0)) } , attach: function () { if (this.is("detached")) { var a; if ("string" == $.type(this.options.container)) { var b = this.target; "mouse" == b && (b = this.element), a = $($(b).closest(this.options.container).first()) } else a = $(this.options.container); a[0] || (a = $(document.body)), a.append(this._tooltip), this.is("detached", !1) } } , preBuild: function () { this.is("detached", !0); var a = { left: "-10000px" , top: "-10000px" , opacity: 0 , zIndex: this.zIndex }; this._tooltip = $("
").addClass("tpd-tooltip").addClass("tpd-skin-" + this.options.skin).addClass("tpd-size-" + this.options.size).css(a).hide(), this.createPreBuildObservers() } , build: function () { this.is("build") || (this.attach(), Y.IE && Y.IE < 7 && this._tooltip.append(this.iframeShim = $("