PageSourceSearch

https://adaptlink.com.br/wp-content/plugins/logo-showcase-ultimate//assets/js/tooltip.js?ver=7.0.5

js adaptlink.com.br collected 2026-09-24 13:56:19 UTC 28,411 bytes, 679 lines download raw bytes

1(function ($) {
2
3    function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }
4
5    function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
7    function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
8
9    function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
10
11    /**
12     * --------------------------------------------------------------------------
13     * Bootstrap (v4.1.0): tooltip.js
14     * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
15     * --------------------------------------------------------------------------
16     */
17    var Tooltip = function ($) {
18        /**
19         * ------------------------------------------------------------------------
20         * Constants
21         * ------------------------------------------------------------------------
22         */
23        var NAME = 'tooltip';
24        var VERSION = '4.1.0';
25        var DATA_KEY = 'bs.tooltip';
26        var EVENT_KEY = "." + DATA_KEY;
27        var JQUERY_NO_CONFLICT = $.fn[NAME];
28        var CLASS_PREFIX = 'bs-tooltip';
29        var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g');
30        var DefaultType = {
31            animation: 'boolean',
32            template: 'string',
33            title: '(string|element|function)',
34            trigger: 'string',
35            delay: '(number|object)',
36            html: 'boolean',
37            selector: '(string|boolean)',
38            placement: '(string|function)',
39            offset: '(number|string)',
40            container: '(string|element|boolean)',
41            fallbackPlacement: '(string|array)',
42            boundary: '(string|element)'
43        };
44        var AttachmentMap = {
45            AUTO: 'auto',
46            TOP: 'top',
47            RIGHT: 'right',
48            BOTTOM: 'bottom',
49            LEFT: 'left'
50        };
51        var Default = {
52            animation: true,
53            template: '<div class="tooltip" role="tooltip">' + '<div class="arrow"></div>' + '<div class="tooltip-inner"></div></div>',
54            trigger: 'hover focus',
55            title: '',
56            delay: 0,
57            html: false,
58            selector: false,
59            placement: 'top',
60            offset: 0,
61            container: false,
62            fallbackPlacement: 'flip',
63            boundary: 'scrollParent'
64        };
65        var HoverState = {
66            SHOW: 'show',
67            OUT: 'out'
68        };
69        var Event = {
70            HIDE: "hide" + EVENT_KEY,
71            HIDDEN: "hidden" + EVENT_KEY,
72            SHOW: "show" + EVENT_KEY,
73            SHOWN: "shown" + EVENT_KEY,
74            INSERTED: "inserted" + EVENT_KEY,
75            CLICK: "click" + EVENT_KEY,
76            FOCUSIN: "focusin" + EVENT_KEY,
77            FOCUSOUT: "focusout" + EVENT_KEY,
78            MOUSEENTER: "mouseenter" + EVENT_KEY,
79            MOUSELEAVE: "mouseleave" + EVENT_KEY
80        };
81        var ClassName = {
82            FADE: 'fade',
83            SHOW: 'show'
84        };
85        var Selector = {
86            TOOLTIP: '.tooltip',
87            TOOLTIP_INNER: '.tooltip-inner',
88            ARROW: '.arrow'
89        };
90        var Trigger = {
91            HOVER: 'hover',
92            FOCUS: 'focus',
93            CLICK: 'click',
94            MANUAL: 'manual'
95            /**
96             * ------------------------------------------------------------------------
97             * Class Definition
98             * ------------------------------------------------------------------------
99             */
100
101        };
102
103        var Tooltip =
104            /*#__PURE__*/
105            function () {
106                function Tooltip(element, config) {
107                    /**
108                     * Check for Popper dependency
109                     * Popper - https://popper.js.org
110                     */
111                    if (typeof Popper === 'undefined') {
112                        throw new TypeError('Bootstrap tooltips require Popper.js (https://popper.js.org)');
113                    } // private
114
115
116                    this._isEnabled = true;
117                    this._timeout = 0;
118                    this._hoverState = '';
119                    this._activeTrigger = {};
120                    this._popper = null; // Protected
121
122                    this.element = element;
123                    this.config = this._getConfig(config);
124                    this.tip = null;
125
126                    this._setListeners();
127                } // Getters
128
129
130                var _proto = Tooltip.prototype;
131
132                // Public
133                _proto.enable = function enable() {
134                    this._isEnabled = true;
135                };
136
137                _proto.disable = function disable() {
138                    this._isEnabled = false;
139                };
140
141                _proto.toggleEnabled = function toggleEnabled() {
142                    this._isEnabled = !this._isEnabled;
143                };
144
145                _proto.toggle = function toggle(event) {
146                    if (!this._isEnabled) {
147                        return;
148                    }
149
150                    if (event) {
151                        var dataKey = this.constructor.DATA_KEY;
152                        var context = $(event.currentTarget).data(dataKey);
153
154                        if (!context) {
155                            context = new this.constructor(event.currentTarget, this._getDelegateConfig());
156                            $(event.currentTarget).data(dataKey, context);
157                        }
158
159                        context._activeTrigger.click = !context._activeTrigger.click;
160
161                        if (context._isWithActiveTrigger()) {
162                            context._enter(null, context);
163                        } else {
164                            context._leave(null, context);
165                        }
166                    } else {
167                        if ($(this.getTipElement()).hasClass(ClassName.SHOW)) {
168                            this._leave(null, this);
169
170                            return;
171                        }
172
173                        this._enter(null, this);
174                    }
175                };
176
177                _proto.dispose = function dispose() {
178                    clearTimeout(this._timeout);
179                    $.removeData(this.element, this.constructor.DATA_KEY);
180                    $(this.element).off(this.constructor.EVENT_KEY);
181                    $(this.element).closest('.modal').off('hide.bs.modal');
182
183                    if (this.tip) {
184                        $(this.tip).remove();
185                    }
186
187                    this._isEnabled = null;
188                    this._timeout = null;
189                    this._hoverState = null;
190                    this._activeTrigger = null;
191
192                    if (this._popper !== null) {
193                        this._popper.destroy();
194                    }
195
196                    this._popper = null;
197                    this.element = null;
198                    this.config = null;
199                    this.tip = null;
200                };
201
202                _proto.show = function show() {
203                    var _this = this;
204
205                    if ($(this.element).css('display') === 'none') {
206                        throw new Error('Please use show on visible elements');
207                    }
208
209                    var showEvent = $.Event(this.constructor.Event.SHOW);
210
211                    if (this.isWithContent() && this._isEnabled) {
212                        $(this.element).trigger(showEvent);
213                        var isInTheDom = $.contains(this.element.ownerDocument.documentElement, this.element);
214
215                        if (showEvent.isDefaultPrevented() || !isInTheDom) {
216                            return;
217                        }
218
219                        var tip = this.getTipElement();
220                        var tipId = Util.getUID(this.constructor.NAME);
221                        tip.setAttribute('id', tipId);
222                        this.element.setAttribute('aria-describedby', tipId);
223                        this.setContent();
224
225                        if (this.config.animation) {
226                            $(tip).addClass(ClassName.FADE);
227                        }
228
229                        var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement;
230
231                        var attachment = this._getAttachment(placement);
232
233                        this.addAttachmentClass(attachment);
234                        var container = this.config.container === false ? document.body : $(this.config.container);
235                        $(tip).data(this.constructor.DATA_KEY, this);
236
237                        if (!$.contains(this.element.ownerDocument.documentElement, this.tip)) {
238                            $(tip).appendTo(container);
239                        }
240
241                        $(this.element).trigger(this.constructor.Event.INSERTED);
242                        this._popper = new Popper(this.element, tip, {
243                            placement: attachment,
244                            modifiers: {
245                                offset: {
246                                    offset: this.config.offset
247                                },
248                                flip: {
249                                    behavior: this.config.fallbackPlacement
250                                },
251                                arrow: {
252                                    element: Selector.ARROW
253                                },
254                                preventOverflow: {
255                                    boundariesElement: this.config.boundary
256                                }
257                            },
258                            onCreate: function onCreate(data) {
259                                if (data.originalPlacement !== data.placement) {
260                                    _this._handlePopperPlacementChange(data);
261                                }
262                            },
263                            onUpdate: function onUpdate(data) {
264                                _this._handlePopperPlacementChange(data);
265                            }
266                        });
267                        $(tip).addClass(ClassName.SHOW); // If this is a touch-enabled device we add extra
268                        // empty mouseover listeners to the body's immediate children;
269                        // only needed because of broken event delegation on iOS
270                        // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
271
272                        if ('ontouchstart' in document.documentElement) {
273                            $(document.body).children().on('mouseover', null, $.noop);
274                        }
275
276                        var complete = function complete() {
277                            if (_this.config.animation) {
278                                _this._fixTransition();
279                            }
280
281                            var prevHoverState = _this._hoverState;
282                            _this._hoverState = null;
283                            $(_this.element).trigger(_this.constructor.Event.SHOWN);
284
285                            if (prevHoverState === HoverState.OUT) {
286                                _this._leave(null, _this);
287                            }
288                        };
289
290                        if ($(this.tip).hasClass(ClassName.FADE)) {
291                            var transitionDuration = Util.getTransitionDurationFromElement(this.tip);
292                            $(this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
293                        } else {
294                            complete();
295                        }
296                    }
297                };
298
299                _proto.hide = function hide(callback) {
300                    var _this2 = this;
301
302                    var tip = this.getTipElement();
303                    var hideEvent = $.Event(this.constructor.Event.HIDE);
304
305                    var complete = function complete() {
306                        if (_this2._hoverState !== HoverState.SHOW && tip.parentNode) {
307                            tip.parentNode.removeChild(tip);
308                        }
309
310                        _this2._cleanTipClass();
311
312                        _this2.element.removeAttribute('aria-describedby');
313
314                        $(_this2.element).trigger(_this2.constructor.Event.HIDDEN);
315
316                        if (_this2._popper !== null) {
317                            _this2._popper.destroy();
318                        }
319
320                        if (callback) {
321                            callback();
322                        }
323                    };
324
325                    $(this.element).trigger(hideEvent);
326
327                    if (hideEvent.isDefaultPrevented()) {
328                        return;
329                    }
330
331                    $(tip).removeClass(ClassName.SHOW); // If this is a touch-enabled device we remove the extra
332                    // empty mouseover listeners we added for iOS support
333
334                    if ('ontouchstart' in document.documentElement) {
335                        $(document.body).children().off('mouseover', null, $.noop);
336                    }
337
338                    this._activeTrigger[Trigger.CLICK] = false;
339                    this._activeTrigger[Trigger.FOCUS] = false;
340                    this._activeTrigger[Trigger.HOVER] = false;
341
342                    if ($(this.tip).hasClass(ClassName.FADE)) {
343                        var transitionDuration = Util.getTransitionDurationFromElement(tip);
344                        $(tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
345                    } else {
346                        complete();
347                    }
348
349                    this._hoverState = '';
350                };
351
352                _proto.update = function update() {
353                    if (this._popper !== null) {
354                        this._popper.scheduleUpdate();
355                    }
356                }; // Protected
357
358
359                _proto.isWithContent = function isWithContent() {
360                    return Boolean(this.getTitle());
361                };
362
363                _proto.addAttachmentClass = function addAttachmentClass(attachment) {
364                    $(this.getTipElement()).addClass(CLASS_PREFIX + "-" + attachment);
365                };
366
367                _proto.getTipElement = function getTipElement() {
368                    this.tip = this.tip || $(this.config.template)[0];
369                    return this.tip;
370                };
371
372                _proto.setContent = function setContent() {
373                    var $tip = $(this.getTipElement());
374                    this.setElementContent($tip.find(Selector.TOOLTIP_INNER), this.getTitle());
375                    $tip.removeClass(ClassName.FADE + " " + ClassName.SHOW);
376                };
377
378                _proto.setElementContent = function setElementContent($element, content) {
379                    var html = this.config.html;
380
381                    if (typeof content === 'object' && (content.nodeType || content.jquery)) {
382                        // Content is a DOM node or a jQuery
383                        if (html) {
384                            if (!$(content).parent().is($element)) {
385                                $element.empty().append(content);
386                            }
387                        } else {
388                            $element.text($(content).text());
389                        }
390                    } else {
391                        $element[html ? 'html' : 'text'](content);
392                    }
393                };
394
395                _proto.getTitle = function getTitle() {
396                    var title = this.element.getAttribute('data-original-title');
397
398                    if (!title) {
399                        title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title;
400                    }
401
402                    return title;
403                }; // Private
404
405
406                _proto._getAttachment = function _getAttachment(placement) {
407                    return AttachmentMap[placement.toUpperCase()];
408                };
409
410                _proto._setListeners = function _setListeners() {
411                    var _this3 = this;
412
413                    var triggers = this.config.trigger.split(' ');
414                    triggers.forEach(function (trigger) {
415                        if (trigger === 'click') {
416                            $(_this3.element).on(_this3.constructor.Event.CLICK, _this3.config.selector, function (event) {
417                                return _this3.toggle(event);
418                            });
419                        } else if (trigger !== Trigger.MANUAL) {
420                            var eventIn = trigger === Trigger.HOVER ? _this3.constructor.Event.MOUSEENTER : _this3.constructor.Event.FOCUSIN;
421                            var eventOut = trigger === Trigger.HOVER ? _this3.constructor.Event.MOUSELEAVE : _this3.constructor.Event.FOCUSOUT;
422                            $(_this3.element).on(eventIn, _this3.config.selector, function (event) {
423                                return _this3._enter(event);
424                            }).on(eventOut, _this3.config.selector, function (event) {
425                                return _this3._leave(event);
426                            });
427                        }
428
429                        $(_this3.element).closest('.modal').on('hide.bs.modal', function () {
430                            return _this3.hide();
431                        });
432                    });
433
434                    if (this.config.selector) {
435                        this.config = _objectSpread({}, this.config, {
436                            trigger: 'manual',
437                            selector: ''
438                        });
439                    } else {
440                        this._fixTitle();
441                    }
442                };
443
444                _proto._fixTitle = function _fixTitle() {
445                    var titleType = typeof this.element.getAttribute('data-original-title');
446
447                    if (this.element.getAttribute('title') || titleType !== 'string') {
448                        this.element.setAttribute('data-original-title', this.element.getAttribute('title') || '');
449                        this.element.setAttribute('title', '');
450                    }
451                };
452
453                _proto._enter = function _enter(event, context) {
454                    var dataKey = this.constructor.DATA_KEY;
455                    context = context || $(event.currentTarget).data(dataKey);
456
457                    if (!context) {
458                        context = new this.constructor(event.currentTarget, this._getDelegateConfig());
459                        $(event.currentTarget).data(dataKey, context);
460                    }
461
462                    if (event) {
463                        context._activeTrigger[event.type === 'focusin' ? Trigger.FOCUS : Trigger.HOVER] = true;
464                    }
465
466                    if ($(context.getTipElement()).hasClass(ClassName.SHOW) || context._hoverState === HoverState.SHOW) {
467                        context._hoverState = HoverState.SHOW;
468                        return;
469                    }
470
471                    clearTimeout(context._timeout);
472                    context._hoverState = HoverState.SHOW;
473
474                    if (!context.config.delay || !context.config.delay.show) {
475                        context.show();
476                        return;
477                    }
478
479                    context._timeout = setTimeout(function () {
480                        if (context._hoverState === HoverState.SHOW) {
481                            context.show();
482                        }
483                    }, context.config.delay.show);
484                };
485
486                _proto._leave = function _leave(event, context) {
487                    var dataKey = this.constructor.DATA_KEY;
488                    context = context || $(event.currentTarget).data(dataKey);
489
490                    if (!context) {
491                        context = new this.constructor(event.currentTarget, this._getDelegateConfig());
492                        $(event.currentTarget).data(dataKey, context);
493                    }
494
495                    if (event) {
496                        context._activeTrigger[event.type === 'focusout' ? Trigger.FOCUS : Trigger.HOVER] = false;
497                    }
498
499                    if (context._isWithActiveTrigger()) {
500                        return;
501                    }
502
503                    clearTimeout(context._timeout);
504                    context._hoverState = HoverState.OUT;
505
506                    if (!context.config.delay || !context.config.delay.hide) {
507                        context.hide();
508                        return;
509                    }
510
511                    context._timeout = setTimeout(function () {
512                        if (context._hoverState === HoverState.OUT) {
513                            context.hide();
514                        }
515                    }, context.config.delay.hide);
516                };
517
518                _proto._isWithActiveTrigger = function _isWithActiveTrigger() {
519                    for (var trigger in this._activeTrigger) {
520                        if (this._activeTrigger[trigger]) {
521                            return true;
522                        }
523                    }
524
525                    return false;
526                };
527
528                _proto._getConfig = function _getConfig(config) {
529                    config = _objectSpread({}, this.constructor.Default, $(this.element).data(), config);
530
531                    if (typeof config.delay === 'number') {
532                        config.delay = {
533                            show: config.delay,
534                            hide: config.delay
535                        };
536                    }
537
538                    if (typeof config.title === 'number') {
539                        config.title = config.title.toString();
540                    }
541
542                    if (typeof config.content === 'number') {
543                        config.content = config.content.toString();
544                    }
545
546                    Util.typeCheckConfig(NAME, config, this.constructor.DefaultType);
547                    return config;
548                };
549
550                _proto._getDelegateConfig = function _getDelegateConfig() {
551                    var config = {};
552
553                    if (this.config) {
554                        for (var key in this.config) {
555                            if (this.constructor.Default[key] !== this.config[key]) {
556                                config[key] = this.config[key];
557                            }
558                        }
559                    }
560
561                    return config;
562                };
563
564                _proto._cleanTipClass = function _cleanTipClass() {
565                    var $tip = $(this.getTipElement());
566                    var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX);
567
568                    if (tabClass !== null && tabClass.length > 0) {
569                        $tip.removeClass(tabClass.join(''));
570                    }
571                };
572
573                _proto._handlePopperPlacementChange = function _handlePopperPlacementChange(data) {
574                    this._cleanTipClass();
575
576                    this.addAttachmentClass(this._getAttachment(data.placement));
577                };
578
579                _proto._fixTransition = function _fixTransition() {
580                    var tip = this.getTipElement();
581                    var initConfigAnimation = this.config.animation;
582
583                    if (tip.getAttribute('x-placement') !== null) {
584                        return;
585                    }
586
587                    $(tip).removeClass(ClassName.FADE);
588                    this.config.animation = false;
589                    this.hide();
590                    this.show();
591                    this.config.animation = initConfigAnimation;
592                }; // Static
593
594
595                Tooltip._jQueryInterface = function _jQueryInterface(config) {
596                    return this.each(function () {
597                        var data = $(this).data(DATA_KEY);
598
599                        var _config = typeof config === 'object' && config;
600
601                        if (!data && /dispose|hide/.test(config)) {
602                            return;
603                        }
604
605                        if (!data) {
606                            data = new Tooltip(this, _config);
607                            $(this).data(DATA_KEY, data);
608                        }
609
610                        if (typeof config === 'string') {
611                            if (typeof data[config] === 'undefined') {
612                                throw new TypeError("No method named \"" + config + "\"");
613                            }
614
615                            data[config]();
616                        }
617                    });
618                };
619
620                _createClass(Tooltip, null, [{
621                    key: "VERSION",
622                    get: function get() {
623                        return VERSION;
624                    }
625                }, {
626                    key: "Default",
627                    get: function get() {
628                        return Default;
629                    }
630                }, {
631                    key: "NAME",
632                    get: function get() {
633                        return NAME;
634                    }
635                }, {
636                    key: "DATA_KEY",
637                    get: function get() {
638                        return DATA_KEY;
639                    }
640                }, {
641                    key: "Event",
642                    get: function get() {
643                        return Event;
644                    }
645                }, {
646                    key: "EVENT_KEY",
647                    get: function get() {
648                        return EVENT_KEY;
649                    }
650                }, {
651                    key: "DefaultType",
652                    get: function get() {
653                        return DefaultType;
654                    }
655                }]);
656
657                return Tooltip;
658            }();
659        /**
660         * ------------------------------------------------------------------------
661         * jQuery
662         * ------------------------------------------------------------------------
663         */
664
665
666        $.fn[NAME] = Tooltip._jQueryInterface;
667        $.fn[NAME].Constructor = Tooltip;
668
669        $.fn[NAME].noConflict = function () {
670            $.fn[NAME] = JQUERY_NO_CONFLICT;
671            return Tooltip._jQueryInterface;
672        };
673
674        return Tooltip;
675    }($, Popper);
676    //# sourceMappingURL=tooltip.js.map
677
678}(jQuery));
679

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.