bootstrap.bundle.js 244 KB
Newer Older
XhmikosR's avatar
XhmikosR committed
6001
    data.show(this);
XhmikosR's avatar
Dist    
XhmikosR committed
6002
  });
XhmikosR's avatar
XhmikosR committed
6003
  var $$6 = getjQuery();
XhmikosR's avatar
Dist    
XhmikosR committed
6004
6005
6006
6007
  /**
   * ------------------------------------------------------------------------
   * jQuery
   * ------------------------------------------------------------------------
6008
   * add .modal to jQuery only if jQuery is present
XhmikosR's avatar
Dist    
XhmikosR committed
6009
   */
Mark Otto's avatar
dist  
Mark Otto committed
6010

6011
6012
  /* istanbul ignore if */

XhmikosR's avatar
XhmikosR committed
6013
6014
6015
6016
  if ($$6) {
    var JQUERY_NO_CONFLICT$5 = $$6.fn[NAME$5];
    $$6.fn[NAME$5] = Modal.jQueryInterface;
    $$6.fn[NAME$5].Constructor = Modal;
Mark Otto's avatar
dist  
Mark Otto committed
6017

XhmikosR's avatar
XhmikosR committed
6018
6019
6020
    $$6.fn[NAME$5].noConflict = function () {
      $$6.fn[NAME$5] = JQUERY_NO_CONFLICT$5;
      return Modal.jQueryInterface;
XhmikosR's avatar
XhmikosR committed
6021
6022
    };
  }
Mark Otto's avatar
dist  
Mark Otto committed
6023

XhmikosR's avatar
XhmikosR committed
6024
6025
  /**
   * --------------------------------------------------------------------------
XhmikosR's avatar
XhmikosR committed
6026
   * Bootstrap (v4.3.1): util/sanitizer.js
XhmikosR's avatar
XhmikosR committed
6027
6028
6029
6030
6031
   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
   * --------------------------------------------------------------------------
   */
  var uriAttrs = ['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href'];
  var ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i;
XhmikosR's avatar
XhmikosR committed
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
  /**
   * A pattern that recognizes a commonly useful subset of URLs that are safe.
   *
   * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
   */

  var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi;
  /**
   * A pattern that matches safe data URLs. Only matches image, video and audio types.
   *
   * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
   */

  var DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i;

  var allowedAttribute = function allowedAttribute(attr, allowedAttributeList) {
    var attrName = attr.nodeName.toLowerCase();

    if (allowedAttributeList.indexOf(attrName) !== -1) {
      if (uriAttrs.indexOf(attrName) !== -1) {
        return Boolean(attr.nodeValue.match(SAFE_URL_PATTERN) || attr.nodeValue.match(DATA_URL_PATTERN));
      }

      return true;
    }

    var regExp = allowedAttributeList.filter(function (attrRegex) {
      return attrRegex instanceof RegExp;
    }); // Check if a regular expression validates the attribute.

    for (var i = 0, l = regExp.length; i < l; i++) {
      if (attrName.match(regExp[i])) {
        return true;
      }
    }

    return false;
  };

XhmikosR's avatar
XhmikosR committed
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
  var DefaultWhitelist = {
    // Global attributes allowed on any supplied element below.
    '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],
    a: ['target', 'href', 'title', 'rel'],
    area: [],
    b: [],
    br: [],
    col: [],
    code: [],
    div: [],
    em: [],
    hr: [],
    h1: [],
    h2: [],
    h3: [],
    h4: [],
    h5: [],
    h6: [],
    i: [],
    img: ['src', 'alt', 'title', 'width', 'height'],
    li: [],
    ol: [],
    p: [],
    pre: [],
    s: [],
    small: [],
    span: [],
    sub: [],
    sup: [],
    strong: [],
    u: [],
    ul: []
  };
  function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) {
XhmikosR's avatar
XhmikosR committed
6105
    if (!unsafeHtml.length) {
XhmikosR's avatar
XhmikosR committed
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
      return unsafeHtml;
    }

    if (sanitizeFn && typeof sanitizeFn === 'function') {
      return sanitizeFn(unsafeHtml);
    }

    var domParser = new window.DOMParser();
    var createdDocument = domParser.parseFromString(unsafeHtml, 'text/html');
    var whitelistKeys = Object.keys(whiteList);
XhmikosR's avatar
XhmikosR committed
6116
    var elements = makeArray(createdDocument.body.querySelectorAll('*'));
XhmikosR's avatar
XhmikosR committed
6117
6118
6119
6120
6121

    var _loop = function _loop(i, len) {
      var el = elements[i];
      var elName = el.nodeName.toLowerCase();

XhmikosR's avatar
XhmikosR committed
6122
      if (whitelistKeys.indexOf(elName) === -1) {
XhmikosR's avatar
XhmikosR committed
6123
6124
6125
6126
        el.parentNode.removeChild(el);
        return "continue";
      }

XhmikosR's avatar
XhmikosR committed
6127
      var attributeList = makeArray(el.attributes);
XhmikosR's avatar
XhmikosR committed
6128
6129
6130
6131
6132
6133
6134
6135
6136
      var whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || []);
      attributeList.forEach(function (attr) {
        if (!allowedAttribute(attr, whitelistedAttributes)) {
          el.removeAttribute(attr.nodeName);
        }
      });
    };

    for (var i = 0, len = elements.length; i < len; i++) {
6137
      var _ret = _loop(i);
XhmikosR's avatar
XhmikosR committed
6138
6139
6140
6141
6142
6143
6144

      if (_ret === "continue") continue;
    }

    return createdDocument.body.innerHTML;
  }

XhmikosR's avatar
Dist    
XhmikosR committed
6145
6146
6147
6148
6149
6150
6151
  /**
   * ------------------------------------------------------------------------
   * Constants
   * ------------------------------------------------------------------------
   */

  var NAME$6 = 'tooltip';
XhmikosR's avatar
XhmikosR committed
6152
  var VERSION$6 = '4.3.1';
XhmikosR's avatar
Dist    
XhmikosR committed
6153
6154
6155
6156
  var DATA_KEY$6 = 'bs.tooltip';
  var EVENT_KEY$6 = "." + DATA_KEY$6;
  var CLASS_PREFIX = 'bs-tooltip';
  var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g');
XhmikosR's avatar
XhmikosR committed
6157
  var DISALLOWED_ATTRIBUTES = ['sanitize', 'whiteList', 'sanitizeFn'];
XhmikosR's avatar
Dist    
XhmikosR committed
6158
6159
6160
6161
6162
6163
6164
6165
6166
  var DefaultType$4 = {
    animation: 'boolean',
    template: 'string',
    title: '(string|element|function)',
    trigger: 'string',
    delay: '(number|object)',
    html: 'boolean',
    selector: '(string|boolean)',
    placement: '(string|function)',
Mark Otto's avatar
Mark Otto committed
6167
    offset: '(number|string|function)',
XhmikosR's avatar
Dist    
XhmikosR committed
6168
6169
    container: '(string|element|boolean)',
    fallbackPlacement: '(string|array)',
XhmikosR's avatar
XhmikosR committed
6170
6171
6172
    boundary: '(string|element)',
    sanitize: 'boolean',
    sanitizeFn: '(null|function)',
XhmikosR's avatar
XhmikosR committed
6173
6174
    whiteList: 'object',
    popperConfig: '(null|object)'
XhmikosR's avatar
Dist    
XhmikosR committed
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
  };
  var AttachmentMap$1 = {
    AUTO: 'auto',
    TOP: 'top',
    RIGHT: 'right',
    BOTTOM: 'bottom',
    LEFT: 'left'
  };
  var Default$4 = {
    animation: true,
XhmikosR's avatar
XhmikosR committed
6185
    template: '<div class="tooltip" role="tooltip">' + '<div class="tooltip-arrow"></div>' + '<div class="tooltip-inner"></div></div>',
XhmikosR's avatar
Dist    
XhmikosR committed
6186
6187
6188
6189
6190
6191
6192
6193
6194
    trigger: 'hover focus',
    title: '',
    delay: 0,
    html: false,
    selector: false,
    placement: 'top',
    offset: 0,
    container: false,
    fallbackPlacement: 'flip',
XhmikosR's avatar
XhmikosR committed
6195
6196
6197
    boundary: 'scrollParent',
    sanitize: true,
    sanitizeFn: null,
XhmikosR's avatar
XhmikosR committed
6198
6199
    whiteList: DefaultWhitelist,
    popperConfig: null
XhmikosR's avatar
Dist    
XhmikosR committed
6200
6201
6202
6203
6204
  };
  var HoverState = {
    SHOW: 'show',
    OUT: 'out'
  };
XhmikosR's avatar
XhmikosR committed
6205
  var Event$7 = {
XhmikosR's avatar
Dist    
XhmikosR committed
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
    HIDE: "hide" + EVENT_KEY$6,
    HIDDEN: "hidden" + EVENT_KEY$6,
    SHOW: "show" + EVENT_KEY$6,
    SHOWN: "shown" + EVENT_KEY$6,
    INSERTED: "inserted" + EVENT_KEY$6,
    CLICK: "click" + EVENT_KEY$6,
    FOCUSIN: "focusin" + EVENT_KEY$6,
    FOCUSOUT: "focusout" + EVENT_KEY$6,
    MOUSEENTER: "mouseenter" + EVENT_KEY$6,
    MOUSELEAVE: "mouseleave" + EVENT_KEY$6
  };
  var ClassName$6 = {
    FADE: 'fade',
    SHOW: 'show'
  };
  var Selector$6 = {
Mark Otto's avatar
dist v5    
Mark Otto committed
6222
    TOOLTIP_INNER: '.tooltip-inner'
XhmikosR's avatar
Dist    
XhmikosR committed
6223
6224
6225
6226
6227
6228
  };
  var Trigger = {
    HOVER: 'hover',
    FOCUS: 'focus',
    CLICK: 'click',
    MANUAL: 'manual'
Mark Otto's avatar
dist    
Mark Otto committed
6229
6230
    /**
     * ------------------------------------------------------------------------
XhmikosR's avatar
Dist    
XhmikosR committed
6231
     * Class Definition
Mark Otto's avatar
dist    
Mark Otto committed
6232
6233
     * ------------------------------------------------------------------------
     */
XhmikosR's avatar
Dist    
XhmikosR committed
6234
6235
6236
6237
6238
6239
6240
6241

  };

  var Tooltip =
  /*#__PURE__*/
  function () {
    function Tooltip(element, config) {
      if (typeof Popper === 'undefined') {
XhmikosR's avatar
XhmikosR committed
6242
        throw new TypeError('Bootstrap\'s tooltips require Popper.js (https://popper.js.org)');
XhmikosR's avatar
Dist    
XhmikosR committed
6243
      } // private
Mark Otto's avatar
dist    
Mark Otto committed
6244
6245


XhmikosR's avatar
Dist    
XhmikosR committed
6246
6247
6248
6249
6250
      this._isEnabled = true;
      this._timeout = 0;
      this._hoverState = '';
      this._activeTrigger = {};
      this._popper = null; // Protected
Mark Otto's avatar
dist  
Mark Otto committed
6251

XhmikosR's avatar
Dist    
XhmikosR committed
6252
6253
6254
      this.element = element;
      this.config = this._getConfig(config);
      this.tip = null;
Mark Otto's avatar
dist  
Mark Otto committed
6255

XhmikosR's avatar
Dist    
XhmikosR committed
6256
      this._setListeners();
XhmikosR's avatar
XhmikosR committed
6257
6258

      Data.setData(element, this.constructor.DATA_KEY, this);
XhmikosR's avatar
Dist    
XhmikosR committed
6259
    } // Getters
Mark Otto's avatar
dist  
Mark Otto committed
6260
6261


XhmikosR's avatar
Dist    
XhmikosR committed
6262
    var _proto = Tooltip.prototype;
Mark Otto's avatar
dist  
Mark Otto committed
6263

XhmikosR's avatar
Dist    
XhmikosR committed
6264
6265
6266
6267
    // Public
    _proto.enable = function enable() {
      this._isEnabled = true;
    };
Mark Otto's avatar
dist  
Mark Otto committed
6268

XhmikosR's avatar
Dist    
XhmikosR committed
6269
6270
6271
    _proto.disable = function disable() {
      this._isEnabled = false;
    };
Mark Otto's avatar
dist  
Mark Otto committed
6272

XhmikosR's avatar
Dist    
XhmikosR committed
6273
6274
6275
    _proto.toggleEnabled = function toggleEnabled() {
      this._isEnabled = !this._isEnabled;
    };
Mark Otto's avatar
dist  
Mark Otto committed
6276

XhmikosR's avatar
Dist    
XhmikosR committed
6277
6278
6279
6280
    _proto.toggle = function toggle(event) {
      if (!this._isEnabled) {
        return;
      }
Mark Otto's avatar
dist  
Mark Otto committed
6281

XhmikosR's avatar
Dist    
XhmikosR committed
6282
6283
      if (event) {
        var dataKey = this.constructor.DATA_KEY;
XhmikosR's avatar
XhmikosR committed
6284
        var context = Data.getData(event.delegateTarget, dataKey);
Mark Otto's avatar
dist  
Mark Otto committed
6285

XhmikosR's avatar
Dist    
XhmikosR committed
6286
        if (!context) {
XhmikosR's avatar
XhmikosR committed
6287
6288
          context = new this.constructor(event.delegateTarget, this._getDelegateConfig());
          Data.setData(event.delegateTarget, dataKey, context);
Mark Otto's avatar
dist  
Mark Otto committed
6289
6290
        }

XhmikosR's avatar
Dist    
XhmikosR committed
6291
        context._activeTrigger.click = !context._activeTrigger.click;
Mark Otto's avatar
dist    
Mark Otto committed
6292

XhmikosR's avatar
Dist    
XhmikosR committed
6293
6294
        if (context._isWithActiveTrigger()) {
          context._enter(null, context);
Mark Otto's avatar
dist  
Mark Otto committed
6295
        } else {
XhmikosR's avatar
Dist    
XhmikosR committed
6296
6297
6298
          context._leave(null, context);
        }
      } else {
XhmikosR's avatar
XhmikosR committed
6299
        if (this.getTipElement().classList.contains(ClassName$6.SHOW)) {
XhmikosR's avatar
Dist    
XhmikosR committed
6300
          this._leave(null, this);
Mark Otto's avatar
dist  
Mark Otto committed
6301

XhmikosR's avatar
Dist    
XhmikosR committed
6302
          return;
Mark Otto's avatar
dist    
Mark Otto committed
6303
        }
Mark Otto's avatar
dist  
Mark Otto committed
6304

XhmikosR's avatar
Dist    
XhmikosR committed
6305
6306
6307
        this._enter(null, this);
      }
    };
Mark Otto's avatar
dist  
Mark Otto committed
6308

XhmikosR's avatar
Dist    
XhmikosR committed
6309
6310
    _proto.dispose = function dispose() {
      clearTimeout(this._timeout);
XhmikosR's avatar
XhmikosR committed
6311
6312
      Data.removeData(this.element, this.constructor.DATA_KEY);
      EventHandler.off(this.element, this.constructor.EVENT_KEY);
Mark Otto's avatar
dist v5    
Mark Otto committed
6313
      EventHandler.off(SelectorEngine.closest(this.element, '.modal'), 'hide.bs.modal', this._hideModalHandler);
Mark Otto's avatar
dist  
Mark Otto committed
6314

XhmikosR's avatar
Dist    
XhmikosR committed
6315
      if (this.tip) {
XhmikosR's avatar
XhmikosR committed
6316
        this.tip.parentNode.removeChild(this.tip);
XhmikosR's avatar
Dist    
XhmikosR committed
6317
      }
Mark Otto's avatar
dist    
Mark Otto committed
6318

XhmikosR's avatar
Dist    
XhmikosR committed
6319
6320
6321
6322
      this._isEnabled = null;
      this._timeout = null;
      this._hoverState = null;
      this._activeTrigger = null;
Mark Otto's avatar
dist  
Mark Otto committed
6323

XhmikosR's avatar
XhmikosR committed
6324
      if (this._popper) {
XhmikosR's avatar
Dist    
XhmikosR committed
6325
6326
        this._popper.destroy();
      }
Mark Otto's avatar
dist  
Mark Otto committed
6327

XhmikosR's avatar
Dist    
XhmikosR committed
6328
6329
6330
6331
6332
      this._popper = null;
      this.element = null;
      this.config = null;
      this.tip = null;
    };
Mark Otto's avatar
dist  
Mark Otto committed
6333

XhmikosR's avatar
Dist    
XhmikosR committed
6334
6335
    _proto.show = function show() {
      var _this = this;
Mark Otto's avatar
dist  
Mark Otto committed
6336

XhmikosR's avatar
XhmikosR committed
6337
      if (this.element.style.display === 'none') {
XhmikosR's avatar
Dist    
XhmikosR committed
6338
6339
        throw new Error('Please use show on visible elements');
      }
Mark Otto's avatar
dist    
Mark Otto committed
6340

XhmikosR's avatar
Dist    
XhmikosR committed
6341
      if (this.isWithContent() && this._isEnabled) {
XhmikosR's avatar
XhmikosR committed
6342
6343
        var showEvent = EventHandler.trigger(this.element, this.constructor.Event.SHOW);
        var shadowRoot = findShadowRoot(this.element);
XhmikosR's avatar
Dist.    
XhmikosR committed
6344
        var isInTheDom = shadowRoot === null ? this.element.ownerDocument.documentElement.contains(this.element) : shadowRoot.contains(this.element);
Mark Otto's avatar
dist  
Mark Otto committed
6345

XhmikosR's avatar
XhmikosR committed
6346
        if (showEvent.defaultPrevented || !isInTheDom) {
XhmikosR's avatar
Dist    
XhmikosR committed
6347
6348
          return;
        }
Mark Otto's avatar
dist  
Mark Otto committed
6349

XhmikosR's avatar
Dist    
XhmikosR committed
6350
        var tip = this.getTipElement();
XhmikosR's avatar
XhmikosR committed
6351
        var tipId = getUID(this.constructor.NAME);
XhmikosR's avatar
Dist    
XhmikosR committed
6352
6353
6354
        tip.setAttribute('id', tipId);
        this.element.setAttribute('aria-describedby', tipId);
        this.setContent();
Mark Otto's avatar
dist  
Mark Otto committed
6355

XhmikosR's avatar
Dist    
XhmikosR committed
6356
        if (this.config.animation) {
XhmikosR's avatar
XhmikosR committed
6357
          tip.classList.add(ClassName$6.FADE);
XhmikosR's avatar
Dist    
XhmikosR committed
6358
        }
Mark Otto's avatar
dist  
Mark Otto committed
6359

XhmikosR's avatar
Dist    
XhmikosR committed
6360
        var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement;
Mark Otto's avatar
dist  
Mark Otto committed
6361

XhmikosR's avatar
Dist    
XhmikosR committed
6362
        var attachment = this._getAttachment(placement);
Mark Otto's avatar
dist  
Mark Otto committed
6363

6364
        this._addAttachmentClass(attachment);
Mark Otto's avatar
dist    
Mark Otto committed
6365
6366
6367

        var container = this._getContainer();

XhmikosR's avatar
XhmikosR committed
6368
        Data.setData(tip, this.constructor.DATA_KEY, this);
Mark Otto's avatar
dist  
Mark Otto committed
6369

XhmikosR's avatar
XhmikosR committed
6370
6371
        if (!this.element.ownerDocument.documentElement.contains(this.tip)) {
          container.appendChild(tip);
XhmikosR's avatar
Dist    
XhmikosR committed
6372
6373
        }

XhmikosR's avatar
XhmikosR committed
6374
        EventHandler.trigger(this.element, this.constructor.Event.INSERTED);
XhmikosR's avatar
XhmikosR committed
6375
        this._popper = new Popper(this.element, tip, this._getPopperConfig(attachment));
XhmikosR's avatar
XhmikosR committed
6376
        tip.classList.add(ClassName$6.SHOW); // If this is a touch-enabled device we add extra
XhmikosR's avatar
Dist    
XhmikosR committed
6377
6378
6379
        // empty mouseover listeners to the body's immediate children;
        // only needed because of broken event delegation on iOS
        // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
Mark Otto's avatar
dist    
Mark Otto committed
6380

XhmikosR's avatar
Dist    
XhmikosR committed
6381
        if ('ontouchstart' in document.documentElement) {
XhmikosR's avatar
XhmikosR committed
6382
6383
6384
          makeArray(document.body.children).forEach(function (element) {
            EventHandler.on(element, 'mouseover', noop());
          });
XhmikosR's avatar
Dist    
XhmikosR committed
6385
        }
Mark Otto's avatar
dist  
Mark Otto committed
6386

XhmikosR's avatar
Dist    
XhmikosR committed
6387
6388
6389
6390
        var complete = function complete() {
          if (_this.config.animation) {
            _this._fixTransition();
          }
Mark Otto's avatar
dist    
Mark Otto committed
6391

XhmikosR's avatar
Dist    
XhmikosR committed
6392
6393
          var prevHoverState = _this._hoverState;
          _this._hoverState = null;
XhmikosR's avatar
XhmikosR committed
6394
          EventHandler.trigger(_this.element, _this.constructor.Event.SHOWN);
Mark Otto's avatar
dist  
Mark Otto committed
6395

XhmikosR's avatar
Dist    
XhmikosR committed
6396
6397
          if (prevHoverState === HoverState.OUT) {
            _this._leave(null, _this);
Mark Otto's avatar
dist  
Mark Otto committed
6398
          }
XhmikosR's avatar
Dist    
XhmikosR committed
6399
6400
        };

XhmikosR's avatar
XhmikosR committed
6401
6402
6403
6404
        if (this.tip.classList.contains(ClassName$6.FADE)) {
          var transitionDuration = getTransitionDurationFromElement(this.tip);
          EventHandler.one(this.tip, TRANSITION_END, complete);
          emulateTransitionEnd(this.tip, transitionDuration);
XhmikosR's avatar
Dist    
XhmikosR committed
6405
6406
        } else {
          complete();
Mark Otto's avatar
dist  
Mark Otto committed
6407
        }
XhmikosR's avatar
Dist    
XhmikosR committed
6408
6409
      }
    };
Mark Otto's avatar
dist  
Mark Otto committed
6410

6411
    _proto.hide = function hide() {
XhmikosR's avatar
Dist    
XhmikosR committed
6412
      var _this2 = this;
Mark Otto's avatar
dist  
Mark Otto committed
6413

XhmikosR's avatar
Dist    
XhmikosR committed
6414
      var tip = this.getTipElement();
Mark Otto's avatar
dist    
Mark Otto committed
6415

XhmikosR's avatar
Dist    
XhmikosR committed
6416
6417
6418
6419
      var complete = function complete() {
        if (_this2._hoverState !== HoverState.SHOW && tip.parentNode) {
          tip.parentNode.removeChild(tip);
        }
Mark Otto's avatar
dist  
Mark Otto committed
6420

XhmikosR's avatar
Dist    
XhmikosR committed
6421
        _this2._cleanTipClass();
Mark Otto's avatar
dist    
Mark Otto committed
6422

XhmikosR's avatar
Dist    
XhmikosR committed
6423
        _this2.element.removeAttribute('aria-describedby');
Mark Otto's avatar
dist    
Mark Otto committed
6424

XhmikosR's avatar
XhmikosR committed
6425
        EventHandler.trigger(_this2.element, _this2.constructor.Event.HIDDEN);
Mark Otto's avatar
dist    
Mark Otto committed
6426

6427
        _this2._popper.destroy();
XhmikosR's avatar
Dist    
XhmikosR committed
6428
      };
Mark Otto's avatar
dist  
Mark Otto committed
6429

XhmikosR's avatar
XhmikosR committed
6430
      var hideEvent = EventHandler.trigger(this.element, this.constructor.Event.HIDE);
Mark Otto's avatar
dist  
Mark Otto committed
6431

XhmikosR's avatar
XhmikosR committed
6432
      if (hideEvent.defaultPrevented) {
XhmikosR's avatar
Dist    
XhmikosR committed
6433
6434
        return;
      }
Mark Otto's avatar
dist  
Mark Otto committed
6435

XhmikosR's avatar
XhmikosR committed
6436
      tip.classList.remove(ClassName$6.SHOW); // If this is a touch-enabled device we remove the extra
XhmikosR's avatar
Dist    
XhmikosR committed
6437
      // empty mouseover listeners we added for iOS support
Mark Otto's avatar
dist    
Mark Otto committed
6438

XhmikosR's avatar
Dist    
XhmikosR committed
6439
      if ('ontouchstart' in document.documentElement) {
XhmikosR's avatar
XhmikosR committed
6440
6441
6442
        makeArray(document.body.children).forEach(function (element) {
          return EventHandler.off(element, 'mouseover', noop);
        });
XhmikosR's avatar
Dist    
XhmikosR committed
6443
      }
Mark Otto's avatar
dist  
Mark Otto committed
6444

XhmikosR's avatar
Dist    
XhmikosR committed
6445
6446
6447
      this._activeTrigger[Trigger.CLICK] = false;
      this._activeTrigger[Trigger.FOCUS] = false;
      this._activeTrigger[Trigger.HOVER] = false;
Mark Otto's avatar
dist  
Mark Otto committed
6448

XhmikosR's avatar
XhmikosR committed
6449
6450
6451
6452
      if (this.tip.classList.contains(ClassName$6.FADE)) {
        var transitionDuration = getTransitionDurationFromElement(tip);
        EventHandler.one(tip, TRANSITION_END, complete);
        emulateTransitionEnd(tip, transitionDuration);
XhmikosR's avatar
Dist    
XhmikosR committed
6453
6454
6455
      } else {
        complete();
      }
Mark Otto's avatar
dist  
Mark Otto committed
6456

XhmikosR's avatar
Dist    
XhmikosR committed
6457
6458
      this._hoverState = '';
    };
Mark Otto's avatar
dist  
Mark Otto committed
6459

XhmikosR's avatar
Dist    
XhmikosR committed
6460
6461
6462
6463
    _proto.update = function update() {
      if (this._popper !== null) {
        this._popper.scheduleUpdate();
      }
Mark Otto's avatar
Mark Otto committed
6464
6465
    } // Protected
    ;
Mark Otto's avatar
dist  
Mark Otto committed
6466

XhmikosR's avatar
Dist    
XhmikosR committed
6467
6468
6469
    _proto.isWithContent = function isWithContent() {
      return Boolean(this.getTitle());
    };
Mark Otto's avatar
dist  
Mark Otto committed
6470

XhmikosR's avatar
Dist    
XhmikosR committed
6471
    _proto.getTipElement = function getTipElement() {
XhmikosR's avatar
XhmikosR committed
6472
6473
6474
6475
6476
6477
6478
      if (this.tip) {
        return this.tip;
      }

      var element = document.createElement('div');
      element.innerHTML = this.config.template;
      this.tip = element.children[0];
XhmikosR's avatar
Dist    
XhmikosR committed
6479
6480
      return this.tip;
    };
Mark Otto's avatar
dist  
Mark Otto committed
6481

XhmikosR's avatar
Dist    
XhmikosR committed
6482
6483
    _proto.setContent = function setContent() {
      var tip = this.getTipElement();
XhmikosR's avatar
XhmikosR committed
6484
6485
6486
      this.setElementContent(SelectorEngine.findOne(Selector$6.TOOLTIP_INNER, tip), this.getTitle());
      tip.classList.remove(ClassName$6.FADE);
      tip.classList.remove(ClassName$6.SHOW);
XhmikosR's avatar
Dist    
XhmikosR committed
6487
    };
Mark Otto's avatar
dist  
Mark Otto committed
6488

XhmikosR's avatar
XhmikosR committed
6489
6490
6491
6492
6493
    _proto.setElementContent = function setElementContent(element, content) {
      if (element === null) {
        return;
      }

6494
      if (typeof content === 'object' && isElement(content)) {
XhmikosR's avatar
XhmikosR committed
6495
6496
6497
6498
6499
        if (content.jquery) {
          content = content[0];
        } // content is a DOM node or a jQuery


XhmikosR's avatar
XhmikosR committed
6500
        if (this.config.html) {
XhmikosR's avatar
XhmikosR committed
6501
6502
6503
          if (content.parentNode !== element) {
            element.innerHTML = '';
            element.appendChild(content);
Mark Otto's avatar
dist  
Mark Otto committed
6504
6505
          }
        } else {
XhmikosR's avatar
XhmikosR committed
6506
          element.innerText = content.textContent;
Mark Otto's avatar
dist  
Mark Otto committed
6507
        }
XhmikosR's avatar
XhmikosR committed
6508
6509
6510
6511
6512
6513
6514
6515
6516

        return;
      }

      if (this.config.html) {
        if (this.config.sanitize) {
          content = sanitizeHtml(content, this.config.whiteList, this.config.sanitizeFn);
        }

XhmikosR's avatar
XhmikosR committed
6517
        element.innerHTML = content;
XhmikosR's avatar
Dist    
XhmikosR committed
6518
      } else {
XhmikosR's avatar
XhmikosR committed
6519
        element.innerText = content;
XhmikosR's avatar
Dist    
XhmikosR committed
6520
6521
      }
    };
Mark Otto's avatar
dist  
Mark Otto committed
6522

XhmikosR's avatar
Dist    
XhmikosR committed
6523
6524
    _proto.getTitle = function getTitle() {
      var title = this.element.getAttribute('data-original-title');
Mark Otto's avatar
dist  
Mark Otto committed
6525

XhmikosR's avatar
Dist    
XhmikosR committed
6526
6527
6528
      if (!title) {
        title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title;
      }
Mark Otto's avatar
dist  
Mark Otto committed
6529

XhmikosR's avatar
Dist    
XhmikosR committed
6530
      return title;
Mark Otto's avatar
Mark Otto committed
6531
6532
    } // Private
    ;
Mark Otto's avatar
dist  
Mark Otto committed
6533

XhmikosR's avatar
XhmikosR committed
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
    _proto._getPopperConfig = function _getPopperConfig(attachment) {
      var _this3 = this;

      var defaultBsConfig = {
        placement: attachment,
        modifiers: {
          offset: this._getOffset(),
          flip: {
            behavior: this.config.fallbackPlacement
          },
          arrow: {
            element: "." + this.constructor.NAME + "-arrow"
          },
          preventOverflow: {
            boundariesElement: this.config.boundary
          }
        },
        onCreate: function onCreate(data) {
          if (data.originalPlacement !== data.placement) {
            _this3._handlePopperPlacementChange(data);
          }
        },
        onUpdate: function onUpdate(data) {
          return _this3._handlePopperPlacementChange(data);
        }
      };
      return _objectSpread2({}, defaultBsConfig, {}, this.config.popperConfig);
    };

6563
6564
6565
6566
    _proto._addAttachmentClass = function _addAttachmentClass(attachment) {
      this.getTipElement().classList.add(CLASS_PREFIX + "-" + attachment);
    };

Mark Otto's avatar
Mark Otto committed
6567
    _proto._getOffset = function _getOffset() {
XhmikosR's avatar
XhmikosR committed
6568
      var _this4 = this;
Mark Otto's avatar
Mark Otto committed
6569
6570
6571
6572
6573

      var offset = {};

      if (typeof this.config.offset === 'function') {
        offset.fn = function (data) {
XhmikosR's avatar
XhmikosR committed
6574
          data.offsets = _objectSpread2({}, data.offsets, {}, _this4.config.offset(data.offsets, _this4.element) || {});
Mark Otto's avatar
Mark Otto committed
6575
6576
6577
6578
6579
6580
6581
6582
6583
          return data;
        };
      } else {
        offset.offset = this.config.offset;
      }

      return offset;
    };

Mark Otto's avatar
dist    
Mark Otto committed
6584
6585
6586
6587
6588
    _proto._getContainer = function _getContainer() {
      if (this.config.container === false) {
        return document.body;
      }

XhmikosR's avatar
XhmikosR committed
6589
6590
      if (isElement(this.config.container)) {
        return this.config.container;
Mark Otto's avatar
dist    
Mark Otto committed
6591
6592
      }

XhmikosR's avatar
XhmikosR committed
6593
      return SelectorEngine.findOne(this.config.container);
Mark Otto's avatar
dist    
Mark Otto committed
6594
6595
    };

XhmikosR's avatar
Dist    
XhmikosR committed
6596
6597
6598
    _proto._getAttachment = function _getAttachment(placement) {
      return AttachmentMap$1[placement.toUpperCase()];
    };
Mark Otto's avatar
dist    
Mark Otto committed
6599

XhmikosR's avatar
Dist    
XhmikosR committed
6600
    _proto._setListeners = function _setListeners() {
XhmikosR's avatar
XhmikosR committed
6601
      var _this5 = this;
Mark Otto's avatar
dist  
Mark Otto committed
6602

XhmikosR's avatar
Dist    
XhmikosR committed
6603
6604
6605
      var triggers = this.config.trigger.split(' ');
      triggers.forEach(function (trigger) {
        if (trigger === 'click') {
XhmikosR's avatar
XhmikosR committed
6606
6607
          EventHandler.on(_this5.element, _this5.constructor.Event.CLICK, _this5.config.selector, function (event) {
            return _this5.toggle(event);
Mark Otto's avatar
dist  
Mark Otto committed
6608
          });
XhmikosR's avatar
Dist    
XhmikosR committed
6609
        } else if (trigger !== Trigger.MANUAL) {
XhmikosR's avatar
XhmikosR committed
6610
6611
6612
6613
          var eventIn = trigger === Trigger.HOVER ? _this5.constructor.Event.MOUSEENTER : _this5.constructor.Event.FOCUSIN;
          var eventOut = trigger === Trigger.HOVER ? _this5.constructor.Event.MOUSELEAVE : _this5.constructor.Event.FOCUSOUT;
          EventHandler.on(_this5.element, eventIn, _this5.config.selector, function (event) {
            return _this5._enter(event);
XhmikosR's avatar
XhmikosR committed
6614
          });
XhmikosR's avatar
XhmikosR committed
6615
6616
          EventHandler.on(_this5.element, eventOut, _this5.config.selector, function (event) {
            return _this5._leave(event);
Mark Otto's avatar
dist  
Mark Otto committed
6617
6618
          });
        }
XhmikosR's avatar
Dist    
XhmikosR committed
6619
      });
Mark Otto's avatar
dist v5    
Mark Otto committed
6620
6621

      this._hideModalHandler = function () {
XhmikosR's avatar
XhmikosR committed
6622
6623
        if (_this5.element) {
          _this5.hide();
XhmikosR's avatar
Dist    
XhmikosR committed
6624
        }
Mark Otto's avatar
dist v5    
Mark Otto committed
6625
6626
6627
      };

      EventHandler.on(SelectorEngine.closest(this.element, '.modal'), 'hide.bs.modal', this._hideModalHandler);
Mark Otto's avatar
dist  
Mark Otto committed
6628

XhmikosR's avatar
Dist    
XhmikosR committed
6629
      if (this.config.selector) {
6630
        this.config = _objectSpread2({}, this.config, {
XhmikosR's avatar
Dist    
XhmikosR committed
6631
6632
6633
6634
6635
6636
6637
          trigger: 'manual',
          selector: ''
        });
      } else {
        this._fixTitle();
      }
    };
Mark Otto's avatar
dist  
Mark Otto committed
6638

XhmikosR's avatar
Dist    
XhmikosR committed
6639
6640
    _proto._fixTitle = function _fixTitle() {
      var titleType = typeof this.element.getAttribute('data-original-title');
Mark Otto's avatar
dist    
Mark Otto committed
6641

XhmikosR's avatar
Dist    
XhmikosR committed
6642
6643
6644
6645
6646
      if (this.element.getAttribute('title') || titleType !== 'string') {
        this.element.setAttribute('data-original-title', this.element.getAttribute('title') || '');
        this.element.setAttribute('title', '');
      }
    };
Mark Otto's avatar
dist  
Mark Otto committed
6647

XhmikosR's avatar
Dist    
XhmikosR committed
6648
6649
    _proto._enter = function _enter(event, context) {
      var dataKey = this.constructor.DATA_KEY;
XhmikosR's avatar
XhmikosR committed
6650
      context = context || Data.getData(event.delegateTarget, dataKey);
Mark Otto's avatar
dist  
Mark Otto committed
6651

XhmikosR's avatar
Dist    
XhmikosR committed
6652
      if (!context) {
XhmikosR's avatar
XhmikosR committed
6653
6654
        context = new this.constructor(event.delegateTarget, this._getDelegateConfig());
        Data.setData(event.delegateTarget, dataKey, context);
XhmikosR's avatar
Dist    
XhmikosR committed
6655
      }
Mark Otto's avatar
dist  
Mark Otto committed
6656

XhmikosR's avatar
Dist    
XhmikosR committed
6657
6658
6659
      if (event) {
        context._activeTrigger[event.type === 'focusin' ? Trigger.FOCUS : Trigger.HOVER] = true;
      }
Mark Otto's avatar
dist  
Mark Otto committed
6660

XhmikosR's avatar
XhmikosR committed
6661
      if (context.getTipElement().classList.contains(ClassName$6.SHOW) || context._hoverState === HoverState.SHOW) {
Mark Otto's avatar
dist  
Mark Otto committed
6662
        context._hoverState = HoverState.SHOW;
XhmikosR's avatar
Dist    
XhmikosR committed
6663
6664
        return;
      }
Mark Otto's avatar
dist  
Mark Otto committed
6665

XhmikosR's avatar
Dist    
XhmikosR committed
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
      clearTimeout(context._timeout);
      context._hoverState = HoverState.SHOW;

      if (!context.config.delay || !context.config.delay.show) {
        context.show();
        return;
      }

      context._timeout = setTimeout(function () {
        if (context._hoverState === HoverState.SHOW) {
Mark Otto's avatar
dist  
Mark Otto committed
6676
6677
          context.show();
        }
XhmikosR's avatar
Dist    
XhmikosR committed
6678
6679
      }, context.config.delay.show);
    };
Mark Otto's avatar
dist  
Mark Otto committed
6680

XhmikosR's avatar
Dist    
XhmikosR committed
6681
6682
    _proto._leave = function _leave(event, context) {
      var dataKey = this.constructor.DATA_KEY;
XhmikosR's avatar
XhmikosR committed
6683
      context = context || Data.getData(event.delegateTarget, dataKey);
Mark Otto's avatar
dist  
Mark Otto committed
6684

XhmikosR's avatar
Dist    
XhmikosR committed
6685
      if (!context) {
XhmikosR's avatar
XhmikosR committed
6686
6687
        context = new this.constructor(event.delegateTarget, this._getDelegateConfig());
        Data.setData(event.delegateTarget, dataKey, context);
XhmikosR's avatar
Dist    
XhmikosR committed
6688
      }
Mark Otto's avatar
dist  
Mark Otto committed
6689

XhmikosR's avatar
Dist    
XhmikosR committed
6690
6691
6692
      if (event) {
        context._activeTrigger[event.type === 'focusout' ? Trigger.FOCUS : Trigger.HOVER] = false;
      }
Mark Otto's avatar
dist  
Mark Otto committed
6693

XhmikosR's avatar
Dist    
XhmikosR committed
6694
6695
6696
      if (context._isWithActiveTrigger()) {
        return;
      }
Mark Otto's avatar
dist  
Mark Otto committed
6697

XhmikosR's avatar
Dist    
XhmikosR committed
6698
6699
      clearTimeout(context._timeout);
      context._hoverState = HoverState.OUT;
Mark Otto's avatar
dist  
Mark Otto committed
6700

XhmikosR's avatar
Dist    
XhmikosR committed
6701
6702
6703
6704
      if (!context.config.delay || !context.config.delay.hide) {
        context.hide();
        return;
      }
Mark Otto's avatar
dist  
Mark Otto committed
6705

XhmikosR's avatar
Dist    
XhmikosR committed
6706
6707
      context._timeout = setTimeout(function () {
        if (context._hoverState === HoverState.OUT) {
Mark Otto's avatar
dist  
Mark Otto committed
6708
6709
          context.hide();
        }
XhmikosR's avatar
Dist    
XhmikosR committed
6710
6711
      }, context.config.delay.hide);
    };
Mark Otto's avatar
dist  
Mark Otto committed
6712

XhmikosR's avatar
Dist    
XhmikosR committed
6713
6714
6715
6716
    _proto._isWithActiveTrigger = function _isWithActiveTrigger() {
      for (var trigger in this._activeTrigger) {
        if (this._activeTrigger[trigger]) {
          return true;
Mark Otto's avatar
dist  
Mark Otto committed
6717
        }
XhmikosR's avatar
Dist    
XhmikosR committed
6718
      }
Mark Otto's avatar
dist  
Mark Otto committed
6719

XhmikosR's avatar
Dist    
XhmikosR committed
6720
6721
      return false;
    };
Mark Otto's avatar
dist  
Mark Otto committed
6722

XhmikosR's avatar
Dist    
XhmikosR committed
6723
    _proto._getConfig = function _getConfig(config) {
XhmikosR's avatar
XhmikosR committed
6724
      var dataAttributes = Manipulator.getDataAttributes(this.element);
XhmikosR's avatar
XhmikosR committed
6725
6726
6727
6728
6729
      Object.keys(dataAttributes).forEach(function (dataAttr) {
        if (DISALLOWED_ATTRIBUTES.indexOf(dataAttr) !== -1) {
          delete dataAttributes[dataAttr];
        }
      });
XhmikosR's avatar
XhmikosR committed
6730
6731
6732
6733
6734

      if (config && typeof config.container === 'object' && config.container.jquery) {
        config.container = config.container[0];
      }

6735
      config = _objectSpread2({}, this.constructor.Default, {}, dataAttributes, {}, typeof config === 'object' && config ? config : {});
Mark Otto's avatar
dist  
Mark Otto committed
6736

XhmikosR's avatar
Dist    
XhmikosR committed
6737
6738
6739
6740
6741
6742
      if (typeof config.delay === 'number') {
        config.delay = {
          show: config.delay,
          hide: config.delay
        };
      }
Mark Otto's avatar
dist  
Mark Otto committed
6743

XhmikosR's avatar
Dist    
XhmikosR committed
6744
6745
6746
      if (typeof config.title === 'number') {
        config.title = config.title.toString();
      }
Mark Otto's avatar
dist  
Mark Otto committed
6747

XhmikosR's avatar
Dist    
XhmikosR committed
6748
6749
6750
      if (typeof config.content === 'number') {
        config.content = config.content.toString();
      }
Mark Otto's avatar
dist  
Mark Otto committed
6751

XhmikosR's avatar
XhmikosR committed
6752
      typeCheckConfig(NAME$6, config, this.constructor.DefaultType);
XhmikosR's avatar
XhmikosR committed
6753
6754
6755
6756
6757

      if (config.sanitize) {
        config.template = sanitizeHtml(config.template, config.whiteList, config.sanitizeFn);
      }

XhmikosR's avatar
Dist    
XhmikosR committed
6758
6759
      return config;
    };
Mark Otto's avatar
dist  
Mark Otto committed
6760

XhmikosR's avatar
Dist    
XhmikosR committed
6761
6762
    _proto._getDelegateConfig = function _getDelegateConfig() {
      var config = {};
Mark Otto's avatar
dist  
Mark Otto committed
6763

XhmikosR's avatar
Dist    
XhmikosR committed
6764
6765
6766
6767
      if (this.config) {
        for (var key in this.config) {
          if (this.constructor.Default[key] !== this.config[key]) {
            config[key] = this.config[key];
Mark Otto's avatar
dist  
Mark Otto committed
6768
6769
          }
        }
XhmikosR's avatar
Dist    
XhmikosR committed
6770
      }
Mark Otto's avatar
dist  
Mark Otto committed
6771

XhmikosR's avatar
Dist    
XhmikosR committed
6772
6773
      return config;
    };
Mark Otto's avatar
dist    
Mark Otto committed
6774

XhmikosR's avatar
Dist    
XhmikosR committed
6775
    _proto._cleanTipClass = function _cleanTipClass() {
XhmikosR's avatar
XhmikosR committed
6776
6777
      var tip = this.getTipElement();
      var tabClass = tip.getAttribute('class').match(BSCLS_PREFIX_REGEX);
Mark Otto's avatar
dist  
Mark Otto committed
6778

XhmikosR's avatar
Dist    
XhmikosR committed
6779
      if (tabClass !== null && tabClass.length) {
XhmikosR's avatar
XhmikosR committed
6780
6781
6782
6783
6784
        tabClass.map(function (token) {
          return token.trim();
        }).forEach(function (tClass) {
          return tip.classList.remove(tClass);
        });
XhmikosR's avatar
Dist    
XhmikosR committed
6785
6786
      }
    };
Mark Otto's avatar
dist    
Mark Otto committed
6787

XhmikosR's avatar
Dist    
XhmikosR committed
6788
6789
6790
    _proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) {
      var popperInstance = popperData.instance;
      this.tip = popperInstance.popper;
Mark Otto's avatar
dist    
Mark Otto committed
6791

XhmikosR's avatar
Dist    
XhmikosR committed
6792
      this._cleanTipClass();
Mark Otto's avatar
dist  
Mark Otto committed
6793

6794
      this._addAttachmentClass(this._getAttachment(popperData.placement));
XhmikosR's avatar
Dist    
XhmikosR committed
6795
    };
Mark Otto's avatar
dist    
Mark Otto committed
6796

XhmikosR's avatar
Dist    
XhmikosR committed
6797
6798
6799
    _proto._fixTransition = function _fixTransition() {
      var tip = this.getTipElement();
      var initConfigAnimation = this.config.animation;
Mark Otto's avatar
dist    
Mark Otto committed
6800

XhmikosR's avatar
Dist    
XhmikosR committed
6801
6802
6803
      if (tip.getAttribute('x-placement') !== null) {
        return;
      }
Mark Otto's avatar
dist    
Mark Otto committed
6804

XhmikosR's avatar
XhmikosR committed
6805
      tip.classList.remove(ClassName$6.FADE);
XhmikosR's avatar
Dist    
XhmikosR committed
6806
6807
6808
6809
      this.config.animation = false;
      this.hide();
      this.show();
      this.config.animation = initConfigAnimation;
Mark Otto's avatar
Mark Otto committed
6810
6811
    } // Static
    ;
Mark Otto's avatar
dist  
Mark Otto committed
6812

XhmikosR's avatar
XhmikosR committed
6813
    Tooltip.jQueryInterface = function jQueryInterface(config) {
XhmikosR's avatar
Dist    
XhmikosR committed
6814
      return this.each(function () {
XhmikosR's avatar
XhmikosR committed
6815
        var data = Data.getData(this, DATA_KEY$6);
Mark Otto's avatar
dist    
Mark Otto committed
6816

XhmikosR's avatar
Dist    
XhmikosR committed
6817
        var _config = typeof config === 'object' && config;
Mark Otto's avatar
dist  
Mark Otto committed
6818

XhmikosR's avatar
Dist    
XhmikosR committed
6819
6820
6821
        if (!data && /dispose|hide/.test(config)) {
          return;
        }
Mark Otto's avatar
dist  
Mark Otto committed
6822

XhmikosR's avatar
Dist    
XhmikosR committed
6823
6824
6825
        if (!data) {
          data = new Tooltip(this, _config);
        }
Mark Otto's avatar
dist  
Mark Otto committed
6826

XhmikosR's avatar
Dist    
XhmikosR committed
6827
6828
6829
        if (typeof config === 'string') {
          if (typeof data[config] === 'undefined') {
            throw new TypeError("No method named \"" + config + "\"");
Mark Otto's avatar
dist  
Mark Otto committed
6830
          }
Mark Otto's avatar
dist    
Mark Otto committed
6831

XhmikosR's avatar
Dist    
XhmikosR committed
6832
          data[config]();
Mark Otto's avatar
dist    
Mark Otto committed
6833
        }
XhmikosR's avatar
Dist    
XhmikosR committed
6834
6835
      });
    };
Mark Otto's avatar
dist  
Mark Otto committed
6836

XhmikosR's avatar
XhmikosR committed
6837
    Tooltip.getInstance = function getInstance(element) {
XhmikosR's avatar
XhmikosR committed
6838
6839
6840
      return Data.getData(element, DATA_KEY$6);
    };

XhmikosR's avatar
Dist    
XhmikosR committed
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
    _createClass(Tooltip, null, [{
      key: "VERSION",
      get: function get() {
        return VERSION$6;
      }
    }, {
      key: "Default",
      get: function get() {
        return Default$4;
      }
    }, {
      key: "NAME",
      get: function get() {
        return NAME$6;
      }
    }, {
      key: "DATA_KEY",
      get: function get() {
        return DATA_KEY$6;
      }
    }, {
      key: "Event",
      get: function get() {
XhmikosR's avatar
XhmikosR committed
6864
        return Event$7;
XhmikosR's avatar
Dist    
XhmikosR committed
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
      }
    }, {
      key: "EVENT_KEY",
      get: function get() {
        return EVENT_KEY$6;
      }
    }, {
      key: "DefaultType",
      get: function get() {
        return DefaultType$4;
      }
    }]);
Mark Otto's avatar
dist    
Mark Otto committed
6877

XhmikosR's avatar
Dist    
XhmikosR committed
6878
6879
    return Tooltip;
  }();
XhmikosR's avatar
XhmikosR committed
6880
6881

  var $$7 = getjQuery();
XhmikosR's avatar
Dist    
XhmikosR committed
6882
6883
6884
6885
  /**
   * ------------------------------------------------------------------------
   * jQuery
   * ------------------------------------------------------------------------
XhmikosR's avatar
XhmikosR committed
6886
   * add .tooltip to jQuery only if jQuery is present
XhmikosR's avatar
Dist    
XhmikosR committed
6887
   */
Mark Otto's avatar
dist    
Mark Otto committed
6888

6889
6890
  /* istanbul ignore if */

XhmikosR's avatar
XhmikosR committed
6891
6892
6893
6894
  if ($$7) {
    var JQUERY_NO_CONFLICT$6 = $$7.fn[NAME$6];
    $$7.fn[NAME$6] = Tooltip.jQueryInterface;
    $$7.fn[NAME$6].Constructor = Tooltip;
Mark Otto's avatar
dist  
Mark Otto committed
6895

XhmikosR's avatar
XhmikosR committed
6896
6897
6898
    $$7.fn[NAME$6].noConflict = function () {
      $$7.fn[NAME$6] = JQUERY_NO_CONFLICT$6;
      return Tooltip.jQueryInterface;
XhmikosR's avatar
XhmikosR committed
6899
6900
    };
  }
Mark Otto's avatar
dist  
Mark Otto committed
6901

XhmikosR's avatar
Dist    
XhmikosR committed
6902
6903
6904
6905
6906
6907
6908
  /**
   * ------------------------------------------------------------------------
   * Constants
   * ------------------------------------------------------------------------
   */

  var NAME$7 = 'popover';
XhmikosR's avatar
XhmikosR committed
6909
  var VERSION$7 = '4.3.1';
XhmikosR's avatar
Dist    
XhmikosR committed
6910
6911
6912
6913
6914
  var DATA_KEY$7 = 'bs.popover';
  var EVENT_KEY$7 = "." + DATA_KEY$7;
  var CLASS_PREFIX$1 = 'bs-popover';
  var BSCLS_PREFIX_REGEX$1 = new RegExp("(^|\\s)" + CLASS_PREFIX$1 + "\\S+", 'g');

6915
  var Default$5 = _objectSpread2({}, Tooltip.Default, {
XhmikosR's avatar
Dist    
XhmikosR committed
6916
6917
6918
    placement: 'right',
    trigger: 'click',
    content: '',
XhmikosR's avatar
XhmikosR committed
6919
    template: '<div class="popover" role="tooltip">' + '<div class="popover-arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div></div>'
XhmikosR's avatar
Dist    
XhmikosR committed
6920
6921
  });

6922
  var DefaultType$5 = _objectSpread2({}, Tooltip.DefaultType, {
XhmikosR's avatar
Dist    
XhmikosR committed
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
    content: '(string|element|function)'
  });

  var ClassName$7 = {
    FADE: 'fade',
    SHOW: 'show'
  };
  var Selector$7 = {
    TITLE: '.popover-header',
    CONTENT: '.popover-body'
  };
XhmikosR's avatar
XhmikosR committed
6934
  var Event$8 = {
XhmikosR's avatar
Dist    
XhmikosR committed
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
    HIDE: "hide" + EVENT_KEY$7,
    HIDDEN: "hidden" + EVENT_KEY$7,
    SHOW: "show" + EVENT_KEY$7,
    SHOWN: "shown" + EVENT_KEY$7,
    INSERTED: "inserted" + EVENT_KEY$7,
    CLICK: "click" + EVENT_KEY$7,
    FOCUSIN: "focusin" + EVENT_KEY$7,
    FOCUSOUT: "focusout" + EVENT_KEY$7,
    MOUSEENTER: "mouseenter" + EVENT_KEY$7,
    MOUSELEAVE: "mouseleave" + EVENT_KEY$7
Mark Otto's avatar
dist    
Mark Otto committed
6945
6946
    /**
     * ------------------------------------------------------------------------
XhmikosR's avatar
Dist    
XhmikosR committed
6947
     * Class Definition
Mark Otto's avatar
dist    
Mark Otto committed
6948
6949
     * ------------------------------------------------------------------------
     */
Mark Otto's avatar
dist  
Mark Otto committed
6950

XhmikosR's avatar
Dist    
XhmikosR committed
6951
  };
Mark Otto's avatar
dist  
Mark Otto committed
6952

XhmikosR's avatar
Dist    
XhmikosR committed
6953
6954
6955
6956
  var Popover =
  /*#__PURE__*/
  function (_Tooltip) {
    _inheritsLoose(Popover, _Tooltip);
Mark Otto's avatar
dist  
Mark Otto committed
6957

XhmikosR's avatar
Dist    
XhmikosR committed
6958
6959
6960
    function Popover() {
      return _Tooltip.apply(this, arguments) || this;
    }
Mark Otto's avatar
Mark Otto committed
6961

XhmikosR's avatar
Dist    
XhmikosR committed
6962
    var _proto = Popover.prototype;
Mark Otto's avatar
Mark Otto committed
6963

XhmikosR's avatar
Dist    
XhmikosR committed
6964
6965
6966
6967
    // Overrides
    _proto.isWithContent = function isWithContent() {
      return this.getTitle() || this._getContent();
    };
Mark Otto's avatar
dist    
Mark Otto committed
6968

XhmikosR's avatar
Dist    
XhmikosR committed
6969
    _proto.setContent = function setContent() {
XhmikosR's avatar
XhmikosR committed
6970
      var tip = this.getTipElement(); // we use append for html objects to maintain js events
Mark Otto's avatar
dist  
Mark Otto committed
6971

XhmikosR's avatar
XhmikosR committed
6972
      this.setElementContent(SelectorEngine.findOne(Selector$7.TITLE, tip), this.getTitle());
Mark Otto's avatar
dist  
Mark Otto committed
6973

XhmikosR's avatar
Dist    
XhmikosR committed
6974
      var content = this._getContent();
Mark Otto's avatar
dist    
Mark Otto committed
6975

XhmikosR's avatar
Dist    
XhmikosR committed
6976
6977
6978
      if (typeof content === 'function') {
        content = content.call(this.element);
      }
Mark Otto's avatar
dist    
Mark Otto committed
6979

XhmikosR's avatar
XhmikosR committed
6980
6981
6982
      this.setElementContent(SelectorEngine.findOne(Selector$7.CONTENT, tip), content);
      tip.classList.remove(ClassName$7.FADE);
      tip.classList.remove(ClassName$7.SHOW);
XhmikosR's avatar
XhmikosR committed
6983
6984
6985
6986
    };

    _proto._addAttachmentClass = function _addAttachmentClass(attachment) {
      this.getTipElement().classList.add(CLASS_PREFIX$1 + "-" + attachment);
Mark Otto's avatar
Mark Otto committed
6987
6988
    } // Private
    ;
Mark Otto's avatar
dist  
Mark Otto committed
6989

XhmikosR's avatar
Dist    
XhmikosR committed
6990
6991
6992
    _proto._getContent = function _getContent() {
      return this.element.getAttribute('data-content') || this.config.content;
    };
Mark Otto's avatar
dist    
Mark Otto committed
6993

XhmikosR's avatar
Dist    
XhmikosR committed
6994
    _proto._cleanTipClass = function _cleanTipClass() {
XhmikosR's avatar
XhmikosR committed
6995
6996
      var tip = this.getTipElement();
      var tabClass = tip.getAttribute('class').match(BSCLS_PREFIX_REGEX$1);
Mark Otto's avatar
dist  
Mark Otto committed
6997

XhmikosR's avatar
Dist    
XhmikosR committed
6998
      if (tabClass !== null && tabClass.length > 0) {
XhmikosR's avatar
XhmikosR committed
6999
7000
        tabClass.map(function (token) {
          return token.trim();
For faster browsing, not all history is shown. View entire blame