@unlk/keymaster 1.4.2 → 1.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Unlock Keymaster v1.4.2 (https://keymaster.unlock.com)
2
+ * Unlock Keymaster v1.4.5 (https://keymaster.unlock.com)
3
3
  * Copyright 2022-2026 Unlk Developers
4
4
  */
5
5
  (function (global, factory) {
@@ -59,7 +59,7 @@
59
59
  function requireData () {
60
60
  if (hasRequiredData) return data$1.exports;
61
61
  hasRequiredData = 1;
62
- (function (module, exports) {
62
+ (function (module, exports$1) {
63
63
  (function (global, factory) {
64
64
  module.exports = factory() ;
65
65
  })(data, function () {
@@ -132,10 +132,10 @@
132
132
  function requireUtil () {
133
133
  if (hasRequiredUtil) return util$1.exports;
134
134
  hasRequiredUtil = 1;
135
- (function (module, exports) {
135
+ (function (module, exports$1) {
136
136
  (function (global, factory) {
137
- factory(exports) ;
138
- })(util, function (exports) {
137
+ factory(exports$1) ;
138
+ })(util, function (exports$1) {
139
139
 
140
140
  /**
141
141
  * --------------------------------------------------------------------------
@@ -381,26 +381,26 @@
381
381
  }
382
382
  return list[Math.max(0, Math.min(index, listLength - 1))];
383
383
  };
384
- exports.defineJQueryPlugin = defineJQueryPlugin;
385
- exports.execute = execute;
386
- exports.executeAfterTransition = executeAfterTransition;
387
- exports.findShadowRoot = findShadowRoot;
388
- exports.getElement = getElement;
389
- exports.getNextActiveElement = getNextActiveElement;
390
- exports.getTransitionDurationFromElement = getTransitionDurationFromElement;
391
- exports.getUID = getUID;
392
- exports.getjQuery = getjQuery;
393
- exports.isDisabled = isDisabled;
394
- exports.isElement = isElement;
395
- exports.isRTL = isRTL;
396
- exports.isVisible = isVisible;
397
- exports.noop = noop;
398
- exports.onDOMContentLoaded = onDOMContentLoaded;
399
- exports.parseSelector = parseSelector;
400
- exports.reflow = reflow;
401
- exports.toType = toType;
402
- exports.triggerTransitionEnd = triggerTransitionEnd;
403
- Object.defineProperty(exports, Symbol.toStringTag, {
384
+ exports$1.defineJQueryPlugin = defineJQueryPlugin;
385
+ exports$1.execute = execute;
386
+ exports$1.executeAfterTransition = executeAfterTransition;
387
+ exports$1.findShadowRoot = findShadowRoot;
388
+ exports$1.getElement = getElement;
389
+ exports$1.getNextActiveElement = getNextActiveElement;
390
+ exports$1.getTransitionDurationFromElement = getTransitionDurationFromElement;
391
+ exports$1.getUID = getUID;
392
+ exports$1.getjQuery = getjQuery;
393
+ exports$1.isDisabled = isDisabled;
394
+ exports$1.isElement = isElement;
395
+ exports$1.isRTL = isRTL;
396
+ exports$1.isVisible = isVisible;
397
+ exports$1.noop = noop;
398
+ exports$1.onDOMContentLoaded = onDOMContentLoaded;
399
+ exports$1.parseSelector = parseSelector;
400
+ exports$1.reflow = reflow;
401
+ exports$1.toType = toType;
402
+ exports$1.triggerTransitionEnd = triggerTransitionEnd;
403
+ Object.defineProperty(exports$1, Symbol.toStringTag, {
404
404
  value: 'Module'
405
405
  });
406
406
  });
@@ -420,7 +420,7 @@
420
420
  function requireEventHandler () {
421
421
  if (hasRequiredEventHandler) return eventHandler$1.exports;
422
422
  hasRequiredEventHandler = 1;
423
- (function (module, exports) {
423
+ (function (module, exports$1) {
424
424
  (function (global, factory) {
425
425
  module.exports = factory(requireUtil()) ;
426
426
  })(eventHandler, function (index_js) {
@@ -666,7 +666,7 @@
666
666
  function requireManipulator () {
667
667
  if (hasRequiredManipulator) return manipulator$1.exports;
668
668
  hasRequiredManipulator = 1;
669
- (function (module, exports) {
669
+ (function (module, exports$1) {
670
670
  (function (global, factory) {
671
671
  module.exports = factory() ;
672
672
  })(manipulator, function () {
@@ -744,7 +744,7 @@
744
744
  function requireConfig () {
745
745
  if (hasRequiredConfig) return config$1.exports;
746
746
  hasRequiredConfig = 1;
747
- (function (module, exports) {
747
+ (function (module, exports$1) {
748
748
  (function (global, factory) {
749
749
  module.exports = factory(requireManipulator(), requireUtil()) ;
750
750
  })(config, function (Manipulator, index_js) {
@@ -817,7 +817,7 @@
817
817
  function requireBaseComponent () {
818
818
  if (hasRequiredBaseComponent) return baseComponent$1.exports;
819
819
  hasRequiredBaseComponent = 1;
820
- (function (module, exports) {
820
+ (function (module, exports$1) {
821
821
  (function (global, factory) {
822
822
  module.exports = factory(requireData(), requireEventHandler(), requireConfig(), requireUtil()) ;
823
823
  })(baseComponent, function (Data, EventHandler, Config, index_js) {
@@ -912,7 +912,7 @@
912
912
  function requireSelectorEngine () {
913
913
  if (hasRequiredSelectorEngine) return selectorEngine$1.exports;
914
914
  hasRequiredSelectorEngine = 1;
915
- (function (module, exports) {
915
+ (function (module, exports$1) {
916
916
  (function (global, factory) {
917
917
  module.exports = factory(requireUtil()) ;
918
918
  })(selectorEngine, function (index_js) {
@@ -1022,10 +1022,10 @@
1022
1022
  function requireComponentFunctions () {
1023
1023
  if (hasRequiredComponentFunctions) return componentFunctions$1.exports;
1024
1024
  hasRequiredComponentFunctions = 1;
1025
- (function (module, exports) {
1025
+ (function (module, exports$1) {
1026
1026
  (function (global, factory) {
1027
- factory(exports, requireEventHandler(), requireSelectorEngine(), requireUtil()) ;
1028
- })(componentFunctions, function (exports, EventHandler, SelectorEngine, index_js) {
1027
+ factory(exports$1, requireEventHandler(), requireSelectorEngine(), requireUtil()) ;
1028
+ })(componentFunctions, function (exports$1, EventHandler, SelectorEngine, index_js) {
1029
1029
 
1030
1030
  /**
1031
1031
  * --------------------------------------------------------------------------
@@ -1050,8 +1050,8 @@
1050
1050
  instance[method]();
1051
1051
  });
1052
1052
  };
1053
- exports.enableDismissTrigger = enableDismissTrigger;
1054
- Object.defineProperty(exports, Symbol.toStringTag, {
1053
+ exports$1.enableDismissTrigger = enableDismissTrigger;
1054
+ Object.defineProperty(exports$1, Symbol.toStringTag, {
1055
1055
  value: 'Module'
1056
1056
  });
1057
1057
  });
@@ -1071,7 +1071,7 @@
1071
1071
  function requireAlert () {
1072
1072
  if (hasRequiredAlert) return alert$2.exports;
1073
1073
  hasRequiredAlert = 1;
1074
- (function (module, exports) {
1074
+ (function (module, exports$1) {
1075
1075
  (function (global, factory) {
1076
1076
  module.exports = factory(requireBaseComponent(), requireEventHandler(), requireComponentFunctions(), requireUtil()) ;
1077
1077
  })(alert$1, function (BaseComponent, EventHandler, componentFunctions_js, index_js) {
@@ -1173,7 +1173,7 @@
1173
1173
  function requireSwipe () {
1174
1174
  if (hasRequiredSwipe) return swipe$1.exports;
1175
1175
  hasRequiredSwipe = 1;
1176
- (function (module, exports) {
1176
+ (function (module, exports$1) {
1177
1177
  (function (global, factory) {
1178
1178
  module.exports = factory(requireEventHandler(), requireConfig(), requireUtil()) ;
1179
1179
  })(swipe, function (EventHandler, Config, index_js) {
@@ -1313,7 +1313,7 @@
1313
1313
  function requireCarousel () {
1314
1314
  if (hasRequiredCarousel) return carousel$2.exports;
1315
1315
  hasRequiredCarousel = 1;
1316
- (function (module, exports) {
1316
+ (function (module, exports$1) {
1317
1317
  (function (global, factory) {
1318
1318
  module.exports = factory(requireBaseComponent(), requireEventHandler(), requireManipulator(), requireSelectorEngine(), requireUtil(), requireSwipe()) ;
1319
1319
  })(carousel$1, function (BaseComponent, EventHandler, Manipulator, SelectorEngine, index_js, Swipe) {
@@ -1711,7 +1711,7 @@
1711
1711
  function requireButton () {
1712
1712
  if (hasRequiredButton) return button$2.exports;
1713
1713
  hasRequiredButton = 1;
1714
- (function (module, exports) {
1714
+ (function (module, exports$1) {
1715
1715
  (function (global, factory) {
1716
1716
  module.exports = factory(requireBaseComponent(), requireEventHandler(), requireUtil()) ;
1717
1717
  })(button$1, function (BaseComponent, EventHandler, index_js) {
@@ -3465,7 +3465,7 @@
3465
3465
  function requireDropdown () {
3466
3466
  if (hasRequiredDropdown) return dropdown$2.exports;
3467
3467
  hasRequiredDropdown = 1;
3468
- (function (module, exports) {
3468
+ (function (module, exports$1) {
3469
3469
  (function (global, factory) {
3470
3470
  module.exports = factory(require$$0, requireBaseComponent(), requireEventHandler(), requireManipulator(), requireSelectorEngine(), requireUtil()) ;
3471
3471
  })(dropdown$1, function (Popper, BaseComponent, EventHandler, Manipulator, SelectorEngine, index_js) {
@@ -3881,7 +3881,7 @@
3881
3881
  function requireCollapse () {
3882
3882
  if (hasRequiredCollapse) return collapse$2.exports;
3883
3883
  hasRequiredCollapse = 1;
3884
- (function (module, exports) {
3884
+ (function (module, exports$1) {
3885
3885
  (function (global, factory) {
3886
3886
  module.exports = factory(requireBaseComponent(), requireEventHandler(), requireSelectorEngine(), requireUtil()) ;
3887
3887
  })(collapse$1, function (BaseComponent, EventHandler, SelectorEngine, index_js) {
@@ -4142,7 +4142,7 @@
4142
4142
  function requireBackdrop () {
4143
4143
  if (hasRequiredBackdrop) return backdrop$1.exports;
4144
4144
  hasRequiredBackdrop = 1;
4145
- (function (module, exports) {
4145
+ (function (module, exports$1) {
4146
4146
  (function (global, factory) {
4147
4147
  module.exports = factory(requireEventHandler(), requireConfig(), requireUtil()) ;
4148
4148
  })(backdrop, function (EventHandler, Config, index_js) {
@@ -4288,7 +4288,7 @@
4288
4288
  function requireFocustrap () {
4289
4289
  if (hasRequiredFocustrap) return focustrap$1.exports;
4290
4290
  hasRequiredFocustrap = 1;
4291
- (function (module, exports) {
4291
+ (function (module, exports$1) {
4292
4292
  (function (global, factory) {
4293
4293
  module.exports = factory(requireEventHandler(), requireSelectorEngine(), requireConfig()) ;
4294
4294
  })(focustrap, function (EventHandler, SelectorEngine, Config) {
@@ -4408,7 +4408,7 @@
4408
4408
  function requireScrollbar () {
4409
4409
  if (hasRequiredScrollbar) return scrollbar$1.exports;
4410
4410
  hasRequiredScrollbar = 1;
4411
- (function (module, exports) {
4411
+ (function (module, exports$1) {
4412
4412
  (function (global, factory) {
4413
4413
  module.exports = factory(requireManipulator(), requireSelectorEngine(), requireUtil()) ;
4414
4414
  })(scrollbar, function (Manipulator, SelectorEngine, index_js) {
@@ -4526,7 +4526,7 @@
4526
4526
  function requireOffcanvas () {
4527
4527
  if (hasRequiredOffcanvas) return offcanvas$2.exports;
4528
4528
  hasRequiredOffcanvas = 1;
4529
- (function (module, exports) {
4529
+ (function (module, exports$1) {
4530
4530
  (function (global, factory) {
4531
4531
  module.exports = factory(requireBaseComponent(), requireEventHandler(), requireSelectorEngine(), requireBackdrop(), requireComponentFunctions(), requireFocustrap(), requireUtil(), requireScrollbar()) ;
4532
4532
  })(offcanvas$1, function (BaseComponent, EventHandler, SelectorEngine, Backdrop, componentFunctions_js, FocusTrap, index_js, ScrollBarHelper) {
@@ -4782,7 +4782,7 @@
4782
4782
  function requireModal () {
4783
4783
  if (hasRequiredModal) return modal$2.exports;
4784
4784
  hasRequiredModal = 1;
4785
- (function (module, exports) {
4785
+ (function (module, exports$1) {
4786
4786
  (function (global, factory) {
4787
4787
  module.exports = factory(requireBaseComponent(), requireEventHandler(), requireSelectorEngine(), requireBackdrop(), requireComponentFunctions(), requireFocustrap(), requireUtil(), requireScrollbar()) ;
4788
4788
  })(modal$1, function (BaseComponent, EventHandler, SelectorEngine, Backdrop, componentFunctions_js, FocusTrap, index_js, ScrollBarHelper) {
@@ -5112,7 +5112,7 @@
5112
5112
  function requireScrollspy () {
5113
5113
  if (hasRequiredScrollspy) return scrollspy$2.exports;
5114
5114
  hasRequiredScrollspy = 1;
5115
- (function (module, exports) {
5115
+ (function (module, exports$1) {
5116
5116
  (function (global, factory) {
5117
5117
  module.exports = factory(requireBaseComponent(), requireEventHandler(), requireSelectorEngine(), requireUtil()) ;
5118
5118
  })(scrollspy$1, function (BaseComponent, EventHandler, SelectorEngine, index_js) {
@@ -5401,10 +5401,10 @@
5401
5401
  function requireSanitizer () {
5402
5402
  if (hasRequiredSanitizer) return sanitizer$1.exports;
5403
5403
  hasRequiredSanitizer = 1;
5404
- (function (module, exports) {
5404
+ (function (module, exports$1) {
5405
5405
  (function (global, factory) {
5406
- factory(exports) ;
5407
- })(sanitizer, function (exports) {
5406
+ factory(exports$1) ;
5407
+ })(sanitizer, function (exports$1) {
5408
5408
 
5409
5409
  /**
5410
5410
  * --------------------------------------------------------------------------
@@ -5500,9 +5500,9 @@
5500
5500
  }
5501
5501
  return createdDocument.body.innerHTML;
5502
5502
  }
5503
- exports.DefaultAllowlist = DefaultAllowlist;
5504
- exports.sanitizeHtml = sanitizeHtml;
5505
- Object.defineProperty(exports, Symbol.toStringTag, {
5503
+ exports$1.DefaultAllowlist = DefaultAllowlist;
5504
+ exports$1.sanitizeHtml = sanitizeHtml;
5505
+ Object.defineProperty(exports$1, Symbol.toStringTag, {
5506
5506
  value: 'Module'
5507
5507
  });
5508
5508
  });
@@ -5524,7 +5524,7 @@
5524
5524
  function requireTemplateFactory () {
5525
5525
  if (hasRequiredTemplateFactory) return templateFactory$1.exports;
5526
5526
  hasRequiredTemplateFactory = 1;
5527
- (function (module, exports) {
5527
+ (function (module, exports$1) {
5528
5528
  (function (global, factory) {
5529
5529
  module.exports = factory(requireSelectorEngine(), requireConfig(), requireSanitizer(), requireUtil()) ;
5530
5530
  })(templateFactory, function (SelectorEngine, Config, sanitizer_js, index_js) {
@@ -5680,7 +5680,7 @@
5680
5680
  function requireTooltip () {
5681
5681
  if (hasRequiredTooltip) return tooltip$2.exports;
5682
5682
  hasRequiredTooltip = 1;
5683
- (function (module, exports) {
5683
+ (function (module, exports$1) {
5684
5684
  (function (global, factory) {
5685
5685
  module.exports = factory(require$$0, requireBaseComponent(), requireEventHandler(), requireManipulator(), requireUtil(), requireSanitizer(), requireTemplateFactory()) ;
5686
5686
  })(tooltip$1, function (Popper, BaseComponent, EventHandler, Manipulator, index_js, sanitizer_js, TemplateFactory) {
@@ -6235,7 +6235,7 @@
6235
6235
  function requirePopover () {
6236
6236
  if (hasRequiredPopover) return popover$2.exports;
6237
6237
  hasRequiredPopover = 1;
6238
- (function (module, exports) {
6238
+ (function (module, exports$1) {
6239
6239
  (function (global, factory) {
6240
6240
  module.exports = factory(requireTooltip(), requireUtil()) ;
6241
6241
  })(popover$1, function (Tooltip, index_js) {
@@ -6341,7 +6341,7 @@
6341
6341
  function requireToast () {
6342
6342
  if (hasRequiredToast) return toast$2.exports;
6343
6343
  hasRequiredToast = 1;
6344
- (function (module, exports) {
6344
+ (function (module, exports$1) {
6345
6345
  (function (global, factory) {
6346
6346
  module.exports = factory(requireBaseComponent(), requireEventHandler(), requireComponentFunctions(), requireUtil()) ;
6347
6347
  })(toast$1, function (BaseComponent, EventHandler, componentFunctions_js, index_js) {
@@ -6549,7 +6549,7 @@
6549
6549
  function requireTab () {
6550
6550
  if (hasRequiredTab) return tab$2.exports;
6551
6551
  hasRequiredTab = 1;
6552
- (function (module, exports) {
6552
+ (function (module, exports$1) {
6553
6553
  (function (global, factory) {
6554
6554
  module.exports = factory(requireBaseComponent(), requireEventHandler(), requireSelectorEngine(), requireUtil()) ;
6555
6555
  })(tab$1, function (BaseComponent, EventHandler, SelectorEngine, index_js) {
@@ -7459,7 +7459,7 @@
7459
7459
  }
7460
7460
  }
7461
7461
 
7462
- const NAME$2 = 'datepicker';
7462
+ const NAME$3 = 'datepicker';
7463
7463
  const DATA_KEY = 'bs.datepicker';
7464
7464
  const EVENT_KEY = `.${DATA_KEY}`;
7465
7465
  const DATA_API_KEY = '.data-api';
@@ -7468,7 +7468,7 @@
7468
7468
  class Datepicker extends BaseComponent {
7469
7469
  // Getters
7470
7470
  static get NAME() {
7471
- return NAME$2;
7471
+ return NAME$3;
7472
7472
  }
7473
7473
 
7474
7474
  // Static
@@ -7513,7 +7513,7 @@
7513
7513
  }
7514
7514
  });
7515
7515
  function isTouchDevice() {
7516
- return 'ontouchstart' in window || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0;
7516
+ return 'ontouchstart' in globalThis || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0;
7517
7517
  }
7518
7518
 
7519
7519
  /**
@@ -7610,39 +7610,26 @@
7610
7610
  }
7611
7611
  };
7612
7612
 
7613
- const NAME$1 = 'carouselCaption';
7614
- const EVENT_SLID = 'slid.bs.carousel';
7615
- const SELECTOR_CAROUSEL = '.carousel';
7613
+ const NAME$2 = 'carouselCaption';
7614
+ const EVENT_SLID$1 = 'slid.bs.carousel';
7615
+ const SELECTOR_CAROUSEL$1 = '.carousel';
7616
7616
  const SELECTOR_CAPTION = '.carousel-caption-container p';
7617
7617
  class CarouselCaption extends BaseComponent {
7618
7618
  constructor(element) {
7619
7619
  super(element);
7620
7620
  this._captionEl = this._findCaptionEl();
7621
- if (!this._captionEl) {
7622
- return;
7623
- }
7624
- this._updateCaption(); // Initialize
7625
- this._bindEvents();
7626
- }
7627
- dispose() {
7628
- EventHandler.off(this._element, EVENT_SLID);
7629
- super.dispose();
7630
- }
7631
- _bindEvents() {
7632
- EventHandler.on(this._element, EVENT_SLID, () => this._updateCaption());
7621
+ this._updateCaption();
7633
7622
  }
7634
7623
  _updateCaption() {
7624
+ if (!this._captionEl) return;
7635
7625
  const activeItem = SelectorEngine.findOne('.carousel-item.active', this._element);
7636
- const newCaption = activeItem?.getAttribute('data-caption');
7637
- if (this._captionEl && newCaption) {
7638
- this._captionEl.textContent = newCaption || '';
7639
- }
7626
+ this._captionEl.textContent = activeItem?.getAttribute('data-caption') ?? '';
7640
7627
  }
7641
7628
  _findCaptionEl() {
7642
7629
  return this._element.querySelector(SELECTOR_CAPTION) || null;
7643
7630
  }
7644
7631
  static get NAME() {
7645
- return NAME$1;
7632
+ return NAME$2;
7646
7633
  }
7647
7634
  static jQueryInterface(config) {
7648
7635
  return this.each(function () {
@@ -7650,26 +7637,63 @@
7650
7637
  });
7651
7638
  }
7652
7639
  }
7640
+ EventHandler.on(document, EVENT_SLID$1, SELECTOR_CAROUSEL$1, function () {
7641
+ CarouselCaption.getOrCreateInstance(this)._updateCaption();
7642
+ });
7643
+ defineJQueryPlugin(CarouselCaption);
7653
7644
 
7654
- // Auto-init on DOMContentLoaded
7655
- document.addEventListener('DOMContentLoaded', () => {
7656
- for (const el of SelectorEngine.find(SELECTOR_CAROUSEL)) {
7657
- CarouselCaption.getOrCreateInstance(el);
7645
+ const NAME$1 = 'carouselHeight';
7646
+ const EVENT_SLIDE = 'slide.bs.carousel';
7647
+ const EVENT_SLID = 'slid.bs.carousel';
7648
+ const SELECTOR_CAROUSEL = '.carousel';
7649
+ const SELECTOR_INNER = '.carousel-inner';
7650
+ class CarouselHeight extends BaseComponent {
7651
+ constructor(element) {
7652
+ super(element);
7653
+ this._inner = SelectorEngine.findOne(SELECTOR_INNER, this._element);
7658
7654
  }
7655
+ _onSlide(e) {
7656
+ if (!this._inner) return;
7657
+ const nextSlide = e.relatedTarget;
7658
+ if (!nextSlide) return;
7659
+ this._inner.style.height = `${this._inner.offsetHeight}px`;
7660
+ requestAnimationFrame(() => {
7661
+ this._inner.style.height = `${nextSlide.offsetHeight}px`;
7662
+ });
7663
+ }
7664
+ _onSlid() {
7665
+ if (!this._inner) return;
7666
+ this._inner.style.height = '';
7667
+ }
7668
+ static get NAME() {
7669
+ return NAME$1;
7670
+ }
7671
+ static jQueryInterface(config) {
7672
+ return this.each(function () {
7673
+ CarouselHeight.getOrCreateInstance(this, config);
7674
+ });
7675
+ }
7676
+ }
7677
+ EventHandler.on(document, EVENT_SLIDE, SELECTOR_CAROUSEL, function (e) {
7678
+ CarouselHeight.getOrCreateInstance(this)._onSlide(e);
7659
7679
  });
7660
- defineJQueryPlugin(CarouselCaption);
7680
+ EventHandler.on(document, EVENT_SLID, SELECTOR_CAROUSEL, function () {
7681
+ CarouselHeight.getOrCreateInstance(this)._onSlid();
7682
+ });
7683
+ defineJQueryPlugin(CarouselHeight);
7661
7684
 
7662
7685
  const NAME = 'videoModal';
7663
7686
  const EVENT_SHOW = 'show.bs.modal';
7664
7687
  const EVENT_HIDDEN = 'hidden.bs.modal';
7688
+ const SELECTOR_MODAL = '.modal';
7665
7689
  const SELECTOR_DIALOG = '.modal-dialog-media';
7666
7690
  const SELECTOR_RATIO = '.ratio';
7667
7691
  const youTubeAPIInitPromise = new Promise(resolve => {
7668
- if (window.YT?.Player) {
7692
+ if (globalThis.YT?.Player) {
7669
7693
  resolve();
7670
7694
  } else {
7671
- const prev = window.onYouTubeIframeAPIReady;
7672
- window.onYouTubeIframeAPIReady = () => {
7695
+ const prev = globalThis.onYouTubeIframeAPIReady;
7696
+ globalThis.onYouTubeIframeAPIReady = () => {
7673
7697
  try {
7674
7698
  if (typeof prev === 'function') prev();
7675
7699
  } catch {}
@@ -7681,7 +7705,7 @@
7681
7705
  }
7682
7706
  });
7683
7707
  const vimeoAPIInitPromise = new Promise(resolve => {
7684
- if (window.Vimeo?.Player) {
7708
+ if (globalThis.Vimeo?.Player) {
7685
7709
  resolve();
7686
7710
  } else {
7687
7711
  const script = document.createElement('script');
@@ -7697,15 +7721,10 @@
7697
7721
  super(element);
7698
7722
  this._dialog = SelectorEngine.findOne(SELECTOR_DIALOG, this._element);
7699
7723
  this._container = SelectorEngine.findOne(SELECTOR_RATIO, this._element);
7700
- if (!this._dialog || !this._container) {
7701
- return;
7702
- }
7703
- this._youtubeSrc = this._container.getAttribute('data-src');
7704
- this._vimeoUrl = this._container.getAttribute('data-vimeo-url');
7724
+ this._youtubeSrc = this._container?.getAttribute('data-src');
7725
+ this._vimeoUrl = this._container?.getAttribute('data-vimeo-url');
7705
7726
  this._youtubePlayer = null;
7706
7727
  this._vimeoPlayer = null;
7707
- EventHandler.on(this._element, EVENT_SHOW, () => this._onShow());
7708
- EventHandler.on(this._element, EVENT_HIDDEN, () => this._onHide());
7709
7728
  }
7710
7729
  dispose() {
7711
7730
  this._onHide();
@@ -7719,7 +7738,7 @@
7719
7738
  if (this._vimeoUrl) {
7720
7739
  await vimeoAPIInitPromise;
7721
7740
  const vimeoId = this._getVimeoId(this._vimeoUrl);
7722
- this._vimeoPlayer = new window.Vimeo.Player(this._container, {
7741
+ this._vimeoPlayer = new globalThis.Vimeo.Player(this._container, {
7723
7742
  id: vimeoId,
7724
7743
  autoplay: true
7725
7744
  });
@@ -7731,7 +7750,7 @@
7731
7750
  await youTubeAPIInitPromise;
7732
7751
  const youtubeId = this._getYouTubeId(this._youtubeSrc);
7733
7752
  const playerDiv = this._container.querySelector(`#${playerID}`);
7734
- this._youtubePlayer = new window.YT.Player(playerDiv, {
7753
+ this._youtubePlayer = new globalThis.YT.Player(playerDiv, {
7735
7754
  videoId: youtubeId,
7736
7755
  playerVars: {
7737
7756
  autoplay: 1,
@@ -7773,17 +7792,13 @@
7773
7792
  });
7774
7793
  }
7775
7794
  }
7776
-
7777
- // Auto-init
7778
- document.addEventListener('DOMContentLoaded', () => {
7779
- const modals = SelectorEngine.find('[data-bs-toggle="modal"][data-bs-target]');
7780
- for (const btn of modals) {
7781
- const targetSelector = btn.getAttribute('data-bs-target');
7782
- const modal = document.querySelector(targetSelector);
7783
- if (modal?.querySelector(SELECTOR_DIALOG)) {
7784
- VideoModal.getOrCreateInstance(modal);
7785
- }
7786
- }
7795
+ EventHandler.on(document, EVENT_SHOW, SELECTOR_MODAL, function () {
7796
+ if (!SelectorEngine.findOne(SELECTOR_DIALOG, this)) return;
7797
+ VideoModal.getOrCreateInstance(this)._onShow();
7798
+ });
7799
+ EventHandler.on(document, EVENT_HIDDEN, SELECTOR_MODAL, function () {
7800
+ if (!SelectorEngine.findOne(SELECTOR_DIALOG, this)) return;
7801
+ VideoModal.getOrCreateInstance(this)._onHide();
7787
7802
  });
7788
7803
  defineJQueryPlugin(VideoModal);
7789
7804
 
@@ -7791,6 +7806,7 @@
7791
7806
  exports.Button = button;
7792
7807
  exports.Carousel = carousel;
7793
7808
  exports.CarouselCaption = CarouselCaption;
7809
+ exports.CarouselHeight = CarouselHeight;
7794
7810
  exports.Collapse = collapse;
7795
7811
  exports.Datepicker = Datepicker;
7796
7812
  exports.Dropdown = dropdown;