@ionic/core 8.7.17-dev.11767796972.148e4bc4 → 8.7.17-dev.11767891829.1a63afa3

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.
package/hydrate/index.js CHANGED
@@ -10583,7 +10583,11 @@ class Content {
10583
10583
  this.inheritedAttributes = inheritAriaAttributes(this.el);
10584
10584
  }
10585
10585
  connectedCallback() {
10586
- this.isMainContent = this.el.closest('ion-menu, ion-popover, ion-modal') === null;
10586
+ var _a;
10587
+ // Content is "main" if not inside menu/popover/modal and not nested in another ion-content
10588
+ this.isMainContent =
10589
+ this.el.closest('ion-menu, ion-popover, ion-modal') === null &&
10590
+ ((_a = this.el.parentElement) === null || _a === void 0 ? void 0 : _a.closest('ion-content')) === null;
10587
10591
  // Detect sibling header/footer for safe-area handling
10588
10592
  this.detectSiblingElements();
10589
10593
  /**
@@ -10616,7 +10620,11 @@ class Content {
10616
10620
  * bubbles, we can catch any instances of child tab bars loading by listening
10617
10621
  * on IonTabs.
10618
10622
  */
10619
- this.tabsLoadCallback = () => this.resize();
10623
+ this.tabsLoadCallback = () => {
10624
+ this.resize();
10625
+ // Re-detect footer when tab bar loads (it may not exist during initial detection)
10626
+ this.updateSiblingDetection();
10627
+ };
10620
10628
  closestTabs.addEventListener('ionTabBarLoaded', this.tabsLoadCallback);
10621
10629
  }
10622
10630
  }
@@ -10629,7 +10637,7 @@ class Content {
10629
10637
  this.updateSiblingDetection();
10630
10638
  // Watch for dynamic header/footer changes (common in React conditional rendering)
10631
10639
  const parent = this.el.parentElement;
10632
- if (parent && !this.parentMutationObserver) {
10640
+ if (parent && !this.parentMutationObserver && win$1 !== undefined && 'MutationObserver' in win$1) {
10633
10641
  this.parentMutationObserver = new MutationObserver(() => {
10634
10642
  this.updateSiblingDetection();
10635
10643
  });
@@ -10919,7 +10927,7 @@ class Content {
10919
10927
  const forceOverscroll = this.shouldForceOverscroll();
10920
10928
  const transitionShadow = mode === 'ios';
10921
10929
  this.resize();
10922
- return (hAsync(Host, Object.assign({ key: 'c8e3a93e0b1ba6f7aa81a6a6065145ece9a6e2ef', role: isMainContent ? 'main' : undefined, class: createColorClasses$1(this.color, {
10930
+ return (hAsync(Host, Object.assign({ key: 'f7218f733e4022a30875441bd949747537d28aa1', role: isMainContent ? 'main' : undefined, class: createColorClasses$1(this.color, {
10923
10931
  [mode]: true,
10924
10932
  'content-sizing': hostContext('ion-popover', this.el),
10925
10933
  overscroll: forceOverscroll,
@@ -10929,12 +10937,12 @@ class Content {
10929
10937
  }), style: {
10930
10938
  '--offset-top': `${this.cTop}px`,
10931
10939
  '--offset-bottom': `${this.cBottom}px`,
10932
- } }, inheritedAttributes), hAsync("div", { key: '4c0482cda885348eea9eb66d7f076af6b38c52e5', ref: (el) => (this.backgroundContentEl = el), id: "background-content", part: "background" }), fixedSlotPlacement === 'before' ? hAsync("slot", { name: "fixed" }) : null, hAsync("div", { key: '6fbb39bf7ab7120009c56aea9340de45c934eeed', class: {
10940
+ } }, inheritedAttributes), hAsync("div", { key: 'b735ec68c18c0b99c3595bb194029830e6542cde', ref: (el) => (this.backgroundContentEl = el), id: "background-content", part: "background" }), fixedSlotPlacement === 'before' ? hAsync("slot", { name: "fixed" }) : null, hAsync("div", { key: 'e76c00d030342d44ade6648c3f9e32ca990787ba', class: {
10933
10941
  'inner-scroll': true,
10934
10942
  'scroll-x': scrollX,
10935
10943
  'scroll-y': scrollY,
10936
10944
  overscroll: (scrollX || scrollY) && forceOverscroll,
10937
- }, ref: (scrollEl) => (this.scrollEl = scrollEl), onScroll: this.scrollEvents ? (ev) => this.onScroll(ev) : undefined, part: "scroll" }, hAsync("slot", { key: '6425bc84edbc0c5b1f2764a1d611df1b46628274' })), transitionShadow ? (hAsync("div", { class: "transition-effect" }, hAsync("div", { class: "transition-cover" }), hAsync("div", { class: "transition-shadow" }))) : null, fixedSlotPlacement === 'after' ? hAsync("slot", { name: "fixed" }) : null));
10945
+ }, ref: (scrollEl) => (this.scrollEl = scrollEl), onScroll: this.scrollEvents ? (ev) => this.onScroll(ev) : undefined, part: "scroll" }, hAsync("slot", { key: '9049be4cea9b5da5ec1e1012248b05286fddeb7a' })), transitionShadow ? (hAsync("div", { class: "transition-effect" }, hAsync("div", { class: "transition-cover" }), hAsync("div", { class: "transition-shadow" }))) : null, fixedSlotPlacement === 'after' ? hAsync("slot", { name: "fixed" }) : null));
10938
10946
  }
10939
10947
  get el() { return getElement(this); }
10940
10948
  static get style() { return contentCss; }
@@ -23089,6 +23097,8 @@ class Modal {
23089
23097
  this.triggerController.removeClickListener();
23090
23098
  this.cleanupViewTransitionListener();
23091
23099
  this.cleanupParentRemovalObserver();
23100
+ // Reset safe-area state to handle removal without dismiss (e.g., framework unmount)
23101
+ this.resetSafeAreaState();
23092
23102
  }
23093
23103
  componentWillLoad() {
23094
23104
  var _a;
@@ -23525,7 +23535,9 @@ class Modal {
23525
23535
  this.skipSafeAreaCoordinateDetection = true;
23526
23536
  this.updateFooterPadding();
23527
23537
  // Watch for dynamic footer additions/removals (e.g., async data loading)
23528
- if (!this.footerObserver) {
23538
+ // Use subtree:true to support wrapped footers in framework components
23539
+ // (e.g., <my-footer><ion-footer>...</ion-footer></my-footer>)
23540
+ if (!this.footerObserver && win$1 !== undefined && 'MutationObserver' in win$1) {
23529
23541
  this.footerObserver = new MutationObserver(() => this.updateFooterPadding());
23530
23542
  this.footerObserver.observe(this.el, { childList: true, subtree: true });
23531
23543
  }
@@ -23558,6 +23570,30 @@ class Modal {
23558
23570
  style.setProperty('--ion-safe-area-left', '0px');
23559
23571
  style.setProperty('--ion-safe-area-right', '0px');
23560
23572
  }
23573
+ /**
23574
+ * Resets all safe-area related state and styles.
23575
+ * Called during dismiss and disconnectedCallback to ensure clean state
23576
+ * for re-presentation of inline modals.
23577
+ */
23578
+ resetSafeAreaState() {
23579
+ var _a;
23580
+ this.skipSafeAreaCoordinateDetection = false;
23581
+ this.cachedSafeAreas = undefined;
23582
+ this.prevSafeAreaState = { top: false, bottom: false, left: false, right: false };
23583
+ (_a = this.footerObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
23584
+ this.footerObserver = undefined;
23585
+ // Clear wrapper styles that may have been set for safe-area handling
23586
+ if (this.wrapperEl) {
23587
+ this.wrapperEl.style.removeProperty('padding-bottom');
23588
+ this.wrapperEl.style.removeProperty('box-sizing');
23589
+ }
23590
+ // Clear safe-area CSS variable overrides
23591
+ const style = this.el.style;
23592
+ style.removeProperty('--ion-safe-area-top');
23593
+ style.removeProperty('--ion-safe-area-bottom');
23594
+ style.removeProperty('--ion-safe-area-left');
23595
+ style.removeProperty('--ion-safe-area-right');
23596
+ }
23561
23597
  /**
23562
23598
  * Gets the root safe-area values from the document element.
23563
23599
  * Uses cached values during gestures to avoid getComputedStyle calls.
@@ -23649,7 +23685,7 @@ class Modal {
23649
23685
  * For example, `cancel` or `backdrop`.
23650
23686
  */
23651
23687
  async dismiss(data, role) {
23652
- var _a, _b;
23688
+ var _a;
23653
23689
  if (this.gestureAnimationDismissing && role !== GESTURE) {
23654
23690
  return false;
23655
23691
  }
@@ -23712,22 +23748,7 @@ class Modal {
23712
23748
  this.currentBreakpoint = undefined;
23713
23749
  this.animation = undefined;
23714
23750
  // Reset safe-area state for potential re-presentation
23715
- this.skipSafeAreaCoordinateDetection = false;
23716
- this.cachedSafeAreas = undefined;
23717
- this.prevSafeAreaState = { top: false, bottom: false, left: false, right: false };
23718
- (_b = this.footerObserver) === null || _b === void 0 ? void 0 : _b.disconnect();
23719
- this.footerObserver = undefined;
23720
- // Clear styles that may have been set for safe-area handling
23721
- if (this.wrapperEl) {
23722
- this.wrapperEl.style.removeProperty('padding-bottom');
23723
- this.wrapperEl.style.removeProperty('box-sizing');
23724
- }
23725
- // Clear safe-area CSS variable overrides
23726
- const style = this.el.style;
23727
- style.removeProperty('--ion-safe-area-top');
23728
- style.removeProperty('--ion-safe-area-bottom');
23729
- style.removeProperty('--ion-safe-area-left');
23730
- style.removeProperty('--ion-safe-area-right');
23751
+ this.resetSafeAreaState();
23731
23752
  unlock();
23732
23753
  return dismissed;
23733
23754
  }
@@ -23977,20 +23998,20 @@ class Modal {
23977
23998
  const isCardModal = presentingElement !== undefined && mode === 'ios';
23978
23999
  const isHandleCycle = handleBehavior === 'cycle';
23979
24000
  const isSheetModalWithHandle = isSheetModal && showHandle;
23980
- return (hAsync(Host, Object.assign({ key: '11cd16cc481093a38a327abdd94467be3f71718d', "no-router": true,
24001
+ return (hAsync(Host, Object.assign({ key: '44022099fcaf047b97d1c2cb45b9b51c930e707c', "no-router": true,
23981
24002
  // Allow the modal to be navigable when the handle is focusable
23982
24003
  tabIndex: isHandleCycle && isSheetModalWithHandle ? 0 : -1 }, htmlAttributes, { style: {
23983
24004
  zIndex: `${20000 + this.overlayIndex}`,
23984
- }, class: Object.assign({ [mode]: true, ['modal-default']: !isCardModal && !isSheetModal, [`modal-card`]: isCardModal, [`modal-sheet`]: isSheetModal, [`modal-no-expand-scroll`]: isSheetModal && !expandToScroll, 'overlay-hidden': true, [FOCUS_TRAP_DISABLE_CLASS]: focusTrap === false }, getClassMap(this.cssClass)), onIonBackdropTap: this.onBackdropTap, onIonModalDidPresent: this.onLifecycle, onIonModalWillPresent: this.onLifecycle, onIonModalWillDismiss: this.onLifecycle, onIonModalDidDismiss: this.onLifecycle, onFocus: this.onModalFocus }), hAsync("ion-backdrop", { key: '125658fbb071960da3905854668078e15bce56da', ref: (el) => (this.backdropEl = el), visible: this.showBackdrop, tappable: this.backdropDismiss, part: "backdrop" }), mode === 'ios' && hAsync("div", { key: '4a63815ef165e5806fef85ef48bf509813ff55c9', class: "modal-shadow" }), hAsync("div", Object.assign({ key: 'cfc4b20354cbf2c0f873f6aee91c9b8f553de61d',
24005
+ }, class: Object.assign({ [mode]: true, ['modal-default']: !isCardModal && !isSheetModal, [`modal-card`]: isCardModal, [`modal-sheet`]: isSheetModal, [`modal-no-expand-scroll`]: isSheetModal && !expandToScroll, 'overlay-hidden': true, [FOCUS_TRAP_DISABLE_CLASS]: focusTrap === false }, getClassMap(this.cssClass)), onIonBackdropTap: this.onBackdropTap, onIonModalDidPresent: this.onLifecycle, onIonModalWillPresent: this.onLifecycle, onIonModalWillDismiss: this.onLifecycle, onIonModalDidDismiss: this.onLifecycle, onFocus: this.onModalFocus }), hAsync("ion-backdrop", { key: 'ddd7e4f6eef51ac1f62ac70e0af10fb01e707f07', ref: (el) => (this.backdropEl = el), visible: this.showBackdrop, tappable: this.backdropDismiss, part: "backdrop" }), mode === 'ios' && hAsync("div", { key: '58620980e3e4ec273c6787bde026e1c010b904b7', class: "modal-shadow" }), hAsync("div", Object.assign({ key: '3fb7f6218644ba898fc504467775593eb89426a0',
23985
24006
  /*
23986
24007
  role and aria-modal must be used on the
23987
24008
  same element. They must also be set inside the
23988
24009
  shadow DOM otherwise ion-button will not be highlighted
23989
24010
  when using VoiceOver: https://bugs.webkit.org/show_bug.cgi?id=247134
23990
24011
  */
23991
- role: "dialog" }, inheritedAttributes, { "aria-modal": "true", class: "modal-wrapper ion-overlay-wrapper", part: "content", ref: (el) => (this.wrapperEl = el) }), showHandle && (hAsync("button", { key: '33a4ee89bb8b6512883cb8756641c1e27fdb0ebc', class: "modal-handle",
24012
+ role: "dialog" }, inheritedAttributes, { "aria-modal": "true", class: "modal-wrapper ion-overlay-wrapper", part: "content", ref: (el) => (this.wrapperEl = el) }), showHandle && (hAsync("button", { key: '9745cd590fdaa9d023a14b487ec2c87ddbafd7f7', class: "modal-handle",
23992
24013
  // Prevents the handle from receiving keyboard focus when it does not cycle
23993
- tabIndex: !isHandleCycle ? -1 : 0, "aria-label": "Activate to adjust the size of the dialog overlaying the screen", onClick: isHandleCycle ? this.onHandleClick : undefined, part: "handle", ref: (el) => (this.dragHandleEl = el) })), hAsync("slot", { key: '986fafb71234591c96e927f92b7330bb5c76fc2e', onSlotchange: this.onSlotChange }))));
24014
+ tabIndex: !isHandleCycle ? -1 : 0, "aria-label": "Activate to adjust the size of the dialog overlaying the screen", onClick: isHandleCycle ? this.onHandleClick : undefined, part: "handle", ref: (el) => (this.dragHandleEl = el) })), hAsync("slot", { key: 'b9a8b5d2d3d3c9b06f99179f496c9f08907d0bad', onSlotchange: this.onSlotChange }))));
23994
24015
  }
23995
24016
  get el() { return getElement(this); }
23996
24017
  static get watchers() { return {
@@ -27856,7 +27877,7 @@ const mdEnterAnimation$1 = (baseEl, opts) => {
27856
27877
  };
27857
27878
  const results = getPopoverPosition(isRTL, contentWidth, contentHeight, 0, 0, reference, side, align, defaultPosition, trigger, ev);
27858
27879
  const padding = size === 'cover' ? 0 : POPOVER_MD_BODY_PADDING;
27859
- const { originX, originY, top, left, bottom, checkSafeAreaTop, checkSafeAreaBottom } = calculateWindowAdjustment(side, results.top, results.left, padding, bodyWidth, bodyHeight, contentWidth, contentHeight, 0, results.originX, results.originY, results.referenceCoordinates);
27880
+ const { originX, originY, top, left, bottom, checkSafeAreaTop, checkSafeAreaBottom, checkSafeAreaLeft, checkSafeAreaRight, } = calculateWindowAdjustment(side, results.top, results.left, padding, bodyWidth, bodyHeight, contentWidth, contentHeight, 0, results.originX, results.originY, results.referenceCoordinates);
27860
27881
  /**
27861
27882
  * Safe area CSS variable adjustments.
27862
27883
  * When the popover is positioned near an edge, we add the corresponding
@@ -27865,14 +27886,23 @@ const mdEnterAnimation$1 = (baseEl, opts) => {
27865
27886
  */
27866
27887
  const safeAreaTop = ' + var(--ion-safe-area-top, 0)';
27867
27888
  const safeAreaBottom = ' + var(--ion-safe-area-bottom, 0)';
27889
+ const safeAreaLeft = ' + var(--ion-safe-area-left, 0)';
27890
+ const safeAreaRight = ' - var(--ion-safe-area-right, 0)';
27868
27891
  let topValue = `${top}px`;
27869
27892
  let bottomValue = bottom !== undefined ? `${bottom}px` : undefined;
27893
+ let leftValue = `${left}px`;
27870
27894
  if (checkSafeAreaTop) {
27871
27895
  topValue = `${top}px${safeAreaTop}`;
27872
27896
  }
27873
27897
  if (checkSafeAreaBottom && bottomValue !== undefined) {
27874
27898
  bottomValue = `${bottom}px${safeAreaBottom}`;
27875
27899
  }
27900
+ if (checkSafeAreaLeft) {
27901
+ leftValue = `${left}px${safeAreaLeft}`;
27902
+ }
27903
+ if (checkSafeAreaRight) {
27904
+ leftValue = `${left}px${safeAreaRight}`;
27905
+ }
27876
27906
  const baseAnimation = createAnimation();
27877
27907
  const backdropAnimation = createAnimation();
27878
27908
  const wrapperAnimation = createAnimation();
@@ -27890,7 +27920,7 @@ const mdEnterAnimation$1 = (baseEl, opts) => {
27890
27920
  .addElement(contentEl)
27891
27921
  .beforeStyles({
27892
27922
  top: `calc(${topValue} + var(--offset-y, 0px))`,
27893
- left: `calc(${left}px + var(--offset-x, 0px))`,
27923
+ left: `calc(${leftValue} + var(--offset-x, 0px))`,
27894
27924
  'transform-origin': `${originY} ${originX}`,
27895
27925
  })
27896
27926
  .beforeAddWrite(() => {
package/hydrate/index.mjs CHANGED
@@ -10581,7 +10581,11 @@ class Content {
10581
10581
  this.inheritedAttributes = inheritAriaAttributes(this.el);
10582
10582
  }
10583
10583
  connectedCallback() {
10584
- this.isMainContent = this.el.closest('ion-menu, ion-popover, ion-modal') === null;
10584
+ var _a;
10585
+ // Content is "main" if not inside menu/popover/modal and not nested in another ion-content
10586
+ this.isMainContent =
10587
+ this.el.closest('ion-menu, ion-popover, ion-modal') === null &&
10588
+ ((_a = this.el.parentElement) === null || _a === void 0 ? void 0 : _a.closest('ion-content')) === null;
10585
10589
  // Detect sibling header/footer for safe-area handling
10586
10590
  this.detectSiblingElements();
10587
10591
  /**
@@ -10614,7 +10618,11 @@ class Content {
10614
10618
  * bubbles, we can catch any instances of child tab bars loading by listening
10615
10619
  * on IonTabs.
10616
10620
  */
10617
- this.tabsLoadCallback = () => this.resize();
10621
+ this.tabsLoadCallback = () => {
10622
+ this.resize();
10623
+ // Re-detect footer when tab bar loads (it may not exist during initial detection)
10624
+ this.updateSiblingDetection();
10625
+ };
10618
10626
  closestTabs.addEventListener('ionTabBarLoaded', this.tabsLoadCallback);
10619
10627
  }
10620
10628
  }
@@ -10627,7 +10635,7 @@ class Content {
10627
10635
  this.updateSiblingDetection();
10628
10636
  // Watch for dynamic header/footer changes (common in React conditional rendering)
10629
10637
  const parent = this.el.parentElement;
10630
- if (parent && !this.parentMutationObserver) {
10638
+ if (parent && !this.parentMutationObserver && win$1 !== undefined && 'MutationObserver' in win$1) {
10631
10639
  this.parentMutationObserver = new MutationObserver(() => {
10632
10640
  this.updateSiblingDetection();
10633
10641
  });
@@ -10917,7 +10925,7 @@ class Content {
10917
10925
  const forceOverscroll = this.shouldForceOverscroll();
10918
10926
  const transitionShadow = mode === 'ios';
10919
10927
  this.resize();
10920
- return (hAsync(Host, Object.assign({ key: 'c8e3a93e0b1ba6f7aa81a6a6065145ece9a6e2ef', role: isMainContent ? 'main' : undefined, class: createColorClasses$1(this.color, {
10928
+ return (hAsync(Host, Object.assign({ key: 'f7218f733e4022a30875441bd949747537d28aa1', role: isMainContent ? 'main' : undefined, class: createColorClasses$1(this.color, {
10921
10929
  [mode]: true,
10922
10930
  'content-sizing': hostContext('ion-popover', this.el),
10923
10931
  overscroll: forceOverscroll,
@@ -10927,12 +10935,12 @@ class Content {
10927
10935
  }), style: {
10928
10936
  '--offset-top': `${this.cTop}px`,
10929
10937
  '--offset-bottom': `${this.cBottom}px`,
10930
- } }, inheritedAttributes), hAsync("div", { key: '4c0482cda885348eea9eb66d7f076af6b38c52e5', ref: (el) => (this.backgroundContentEl = el), id: "background-content", part: "background" }), fixedSlotPlacement === 'before' ? hAsync("slot", { name: "fixed" }) : null, hAsync("div", { key: '6fbb39bf7ab7120009c56aea9340de45c934eeed', class: {
10938
+ } }, inheritedAttributes), hAsync("div", { key: 'b735ec68c18c0b99c3595bb194029830e6542cde', ref: (el) => (this.backgroundContentEl = el), id: "background-content", part: "background" }), fixedSlotPlacement === 'before' ? hAsync("slot", { name: "fixed" }) : null, hAsync("div", { key: 'e76c00d030342d44ade6648c3f9e32ca990787ba', class: {
10931
10939
  'inner-scroll': true,
10932
10940
  'scroll-x': scrollX,
10933
10941
  'scroll-y': scrollY,
10934
10942
  overscroll: (scrollX || scrollY) && forceOverscroll,
10935
- }, ref: (scrollEl) => (this.scrollEl = scrollEl), onScroll: this.scrollEvents ? (ev) => this.onScroll(ev) : undefined, part: "scroll" }, hAsync("slot", { key: '6425bc84edbc0c5b1f2764a1d611df1b46628274' })), transitionShadow ? (hAsync("div", { class: "transition-effect" }, hAsync("div", { class: "transition-cover" }), hAsync("div", { class: "transition-shadow" }))) : null, fixedSlotPlacement === 'after' ? hAsync("slot", { name: "fixed" }) : null));
10943
+ }, ref: (scrollEl) => (this.scrollEl = scrollEl), onScroll: this.scrollEvents ? (ev) => this.onScroll(ev) : undefined, part: "scroll" }, hAsync("slot", { key: '9049be4cea9b5da5ec1e1012248b05286fddeb7a' })), transitionShadow ? (hAsync("div", { class: "transition-effect" }, hAsync("div", { class: "transition-cover" }), hAsync("div", { class: "transition-shadow" }))) : null, fixedSlotPlacement === 'after' ? hAsync("slot", { name: "fixed" }) : null));
10936
10944
  }
10937
10945
  get el() { return getElement(this); }
10938
10946
  static get style() { return contentCss; }
@@ -23087,6 +23095,8 @@ class Modal {
23087
23095
  this.triggerController.removeClickListener();
23088
23096
  this.cleanupViewTransitionListener();
23089
23097
  this.cleanupParentRemovalObserver();
23098
+ // Reset safe-area state to handle removal without dismiss (e.g., framework unmount)
23099
+ this.resetSafeAreaState();
23090
23100
  }
23091
23101
  componentWillLoad() {
23092
23102
  var _a;
@@ -23523,7 +23533,9 @@ class Modal {
23523
23533
  this.skipSafeAreaCoordinateDetection = true;
23524
23534
  this.updateFooterPadding();
23525
23535
  // Watch for dynamic footer additions/removals (e.g., async data loading)
23526
- if (!this.footerObserver) {
23536
+ // Use subtree:true to support wrapped footers in framework components
23537
+ // (e.g., <my-footer><ion-footer>...</ion-footer></my-footer>)
23538
+ if (!this.footerObserver && win$1 !== undefined && 'MutationObserver' in win$1) {
23527
23539
  this.footerObserver = new MutationObserver(() => this.updateFooterPadding());
23528
23540
  this.footerObserver.observe(this.el, { childList: true, subtree: true });
23529
23541
  }
@@ -23556,6 +23568,30 @@ class Modal {
23556
23568
  style.setProperty('--ion-safe-area-left', '0px');
23557
23569
  style.setProperty('--ion-safe-area-right', '0px');
23558
23570
  }
23571
+ /**
23572
+ * Resets all safe-area related state and styles.
23573
+ * Called during dismiss and disconnectedCallback to ensure clean state
23574
+ * for re-presentation of inline modals.
23575
+ */
23576
+ resetSafeAreaState() {
23577
+ var _a;
23578
+ this.skipSafeAreaCoordinateDetection = false;
23579
+ this.cachedSafeAreas = undefined;
23580
+ this.prevSafeAreaState = { top: false, bottom: false, left: false, right: false };
23581
+ (_a = this.footerObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
23582
+ this.footerObserver = undefined;
23583
+ // Clear wrapper styles that may have been set for safe-area handling
23584
+ if (this.wrapperEl) {
23585
+ this.wrapperEl.style.removeProperty('padding-bottom');
23586
+ this.wrapperEl.style.removeProperty('box-sizing');
23587
+ }
23588
+ // Clear safe-area CSS variable overrides
23589
+ const style = this.el.style;
23590
+ style.removeProperty('--ion-safe-area-top');
23591
+ style.removeProperty('--ion-safe-area-bottom');
23592
+ style.removeProperty('--ion-safe-area-left');
23593
+ style.removeProperty('--ion-safe-area-right');
23594
+ }
23559
23595
  /**
23560
23596
  * Gets the root safe-area values from the document element.
23561
23597
  * Uses cached values during gestures to avoid getComputedStyle calls.
@@ -23647,7 +23683,7 @@ class Modal {
23647
23683
  * For example, `cancel` or `backdrop`.
23648
23684
  */
23649
23685
  async dismiss(data, role) {
23650
- var _a, _b;
23686
+ var _a;
23651
23687
  if (this.gestureAnimationDismissing && role !== GESTURE) {
23652
23688
  return false;
23653
23689
  }
@@ -23710,22 +23746,7 @@ class Modal {
23710
23746
  this.currentBreakpoint = undefined;
23711
23747
  this.animation = undefined;
23712
23748
  // Reset safe-area state for potential re-presentation
23713
- this.skipSafeAreaCoordinateDetection = false;
23714
- this.cachedSafeAreas = undefined;
23715
- this.prevSafeAreaState = { top: false, bottom: false, left: false, right: false };
23716
- (_b = this.footerObserver) === null || _b === void 0 ? void 0 : _b.disconnect();
23717
- this.footerObserver = undefined;
23718
- // Clear styles that may have been set for safe-area handling
23719
- if (this.wrapperEl) {
23720
- this.wrapperEl.style.removeProperty('padding-bottom');
23721
- this.wrapperEl.style.removeProperty('box-sizing');
23722
- }
23723
- // Clear safe-area CSS variable overrides
23724
- const style = this.el.style;
23725
- style.removeProperty('--ion-safe-area-top');
23726
- style.removeProperty('--ion-safe-area-bottom');
23727
- style.removeProperty('--ion-safe-area-left');
23728
- style.removeProperty('--ion-safe-area-right');
23749
+ this.resetSafeAreaState();
23729
23750
  unlock();
23730
23751
  return dismissed;
23731
23752
  }
@@ -23975,20 +23996,20 @@ class Modal {
23975
23996
  const isCardModal = presentingElement !== undefined && mode === 'ios';
23976
23997
  const isHandleCycle = handleBehavior === 'cycle';
23977
23998
  const isSheetModalWithHandle = isSheetModal && showHandle;
23978
- return (hAsync(Host, Object.assign({ key: '11cd16cc481093a38a327abdd94467be3f71718d', "no-router": true,
23999
+ return (hAsync(Host, Object.assign({ key: '44022099fcaf047b97d1c2cb45b9b51c930e707c', "no-router": true,
23979
24000
  // Allow the modal to be navigable when the handle is focusable
23980
24001
  tabIndex: isHandleCycle && isSheetModalWithHandle ? 0 : -1 }, htmlAttributes, { style: {
23981
24002
  zIndex: `${20000 + this.overlayIndex}`,
23982
- }, class: Object.assign({ [mode]: true, ['modal-default']: !isCardModal && !isSheetModal, [`modal-card`]: isCardModal, [`modal-sheet`]: isSheetModal, [`modal-no-expand-scroll`]: isSheetModal && !expandToScroll, 'overlay-hidden': true, [FOCUS_TRAP_DISABLE_CLASS]: focusTrap === false }, getClassMap(this.cssClass)), onIonBackdropTap: this.onBackdropTap, onIonModalDidPresent: this.onLifecycle, onIonModalWillPresent: this.onLifecycle, onIonModalWillDismiss: this.onLifecycle, onIonModalDidDismiss: this.onLifecycle, onFocus: this.onModalFocus }), hAsync("ion-backdrop", { key: '125658fbb071960da3905854668078e15bce56da', ref: (el) => (this.backdropEl = el), visible: this.showBackdrop, tappable: this.backdropDismiss, part: "backdrop" }), mode === 'ios' && hAsync("div", { key: '4a63815ef165e5806fef85ef48bf509813ff55c9', class: "modal-shadow" }), hAsync("div", Object.assign({ key: 'cfc4b20354cbf2c0f873f6aee91c9b8f553de61d',
24003
+ }, class: Object.assign({ [mode]: true, ['modal-default']: !isCardModal && !isSheetModal, [`modal-card`]: isCardModal, [`modal-sheet`]: isSheetModal, [`modal-no-expand-scroll`]: isSheetModal && !expandToScroll, 'overlay-hidden': true, [FOCUS_TRAP_DISABLE_CLASS]: focusTrap === false }, getClassMap(this.cssClass)), onIonBackdropTap: this.onBackdropTap, onIonModalDidPresent: this.onLifecycle, onIonModalWillPresent: this.onLifecycle, onIonModalWillDismiss: this.onLifecycle, onIonModalDidDismiss: this.onLifecycle, onFocus: this.onModalFocus }), hAsync("ion-backdrop", { key: 'ddd7e4f6eef51ac1f62ac70e0af10fb01e707f07', ref: (el) => (this.backdropEl = el), visible: this.showBackdrop, tappable: this.backdropDismiss, part: "backdrop" }), mode === 'ios' && hAsync("div", { key: '58620980e3e4ec273c6787bde026e1c010b904b7', class: "modal-shadow" }), hAsync("div", Object.assign({ key: '3fb7f6218644ba898fc504467775593eb89426a0',
23983
24004
  /*
23984
24005
  role and aria-modal must be used on the
23985
24006
  same element. They must also be set inside the
23986
24007
  shadow DOM otherwise ion-button will not be highlighted
23987
24008
  when using VoiceOver: https://bugs.webkit.org/show_bug.cgi?id=247134
23988
24009
  */
23989
- role: "dialog" }, inheritedAttributes, { "aria-modal": "true", class: "modal-wrapper ion-overlay-wrapper", part: "content", ref: (el) => (this.wrapperEl = el) }), showHandle && (hAsync("button", { key: '33a4ee89bb8b6512883cb8756641c1e27fdb0ebc', class: "modal-handle",
24010
+ role: "dialog" }, inheritedAttributes, { "aria-modal": "true", class: "modal-wrapper ion-overlay-wrapper", part: "content", ref: (el) => (this.wrapperEl = el) }), showHandle && (hAsync("button", { key: '9745cd590fdaa9d023a14b487ec2c87ddbafd7f7', class: "modal-handle",
23990
24011
  // Prevents the handle from receiving keyboard focus when it does not cycle
23991
- tabIndex: !isHandleCycle ? -1 : 0, "aria-label": "Activate to adjust the size of the dialog overlaying the screen", onClick: isHandleCycle ? this.onHandleClick : undefined, part: "handle", ref: (el) => (this.dragHandleEl = el) })), hAsync("slot", { key: '986fafb71234591c96e927f92b7330bb5c76fc2e', onSlotchange: this.onSlotChange }))));
24012
+ tabIndex: !isHandleCycle ? -1 : 0, "aria-label": "Activate to adjust the size of the dialog overlaying the screen", onClick: isHandleCycle ? this.onHandleClick : undefined, part: "handle", ref: (el) => (this.dragHandleEl = el) })), hAsync("slot", { key: 'b9a8b5d2d3d3c9b06f99179f496c9f08907d0bad', onSlotchange: this.onSlotChange }))));
23992
24013
  }
23993
24014
  get el() { return getElement(this); }
23994
24015
  static get watchers() { return {
@@ -27854,7 +27875,7 @@ const mdEnterAnimation$1 = (baseEl, opts) => {
27854
27875
  };
27855
27876
  const results = getPopoverPosition(isRTL, contentWidth, contentHeight, 0, 0, reference, side, align, defaultPosition, trigger, ev);
27856
27877
  const padding = size === 'cover' ? 0 : POPOVER_MD_BODY_PADDING;
27857
- const { originX, originY, top, left, bottom, checkSafeAreaTop, checkSafeAreaBottom } = calculateWindowAdjustment(side, results.top, results.left, padding, bodyWidth, bodyHeight, contentWidth, contentHeight, 0, results.originX, results.originY, results.referenceCoordinates);
27878
+ const { originX, originY, top, left, bottom, checkSafeAreaTop, checkSafeAreaBottom, checkSafeAreaLeft, checkSafeAreaRight, } = calculateWindowAdjustment(side, results.top, results.left, padding, bodyWidth, bodyHeight, contentWidth, contentHeight, 0, results.originX, results.originY, results.referenceCoordinates);
27858
27879
  /**
27859
27880
  * Safe area CSS variable adjustments.
27860
27881
  * When the popover is positioned near an edge, we add the corresponding
@@ -27863,14 +27884,23 @@ const mdEnterAnimation$1 = (baseEl, opts) => {
27863
27884
  */
27864
27885
  const safeAreaTop = ' + var(--ion-safe-area-top, 0)';
27865
27886
  const safeAreaBottom = ' + var(--ion-safe-area-bottom, 0)';
27887
+ const safeAreaLeft = ' + var(--ion-safe-area-left, 0)';
27888
+ const safeAreaRight = ' - var(--ion-safe-area-right, 0)';
27866
27889
  let topValue = `${top}px`;
27867
27890
  let bottomValue = bottom !== undefined ? `${bottom}px` : undefined;
27891
+ let leftValue = `${left}px`;
27868
27892
  if (checkSafeAreaTop) {
27869
27893
  topValue = `${top}px${safeAreaTop}`;
27870
27894
  }
27871
27895
  if (checkSafeAreaBottom && bottomValue !== undefined) {
27872
27896
  bottomValue = `${bottom}px${safeAreaBottom}`;
27873
27897
  }
27898
+ if (checkSafeAreaLeft) {
27899
+ leftValue = `${left}px${safeAreaLeft}`;
27900
+ }
27901
+ if (checkSafeAreaRight) {
27902
+ leftValue = `${left}px${safeAreaRight}`;
27903
+ }
27874
27904
  const baseAnimation = createAnimation();
27875
27905
  const backdropAnimation = createAnimation();
27876
27906
  const wrapperAnimation = createAnimation();
@@ -27888,7 +27918,7 @@ const mdEnterAnimation$1 = (baseEl, opts) => {
27888
27918
  .addElement(contentEl)
27889
27919
  .beforeStyles({
27890
27920
  top: `calc(${topValue} + var(--offset-y, 0px))`,
27891
- left: `calc(${left}px + var(--offset-x, 0px))`,
27921
+ left: `calc(${leftValue} + var(--offset-x, 0px))`,
27892
27922
  'transform-origin': `${originY} ${originX}`,
27893
27923
  })
27894
27924
  .beforeAddWrite(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ionic/core",
3
- "version": "8.7.17-dev.11767796972.148e4bc4",
3
+ "version": "8.7.17-dev.11767891829.1a63afa3",
4
4
  "description": "Base components for Ionic",
5
5
  "engines": {
6
6
  "node": ">= 16"
@@ -1,4 +0,0 @@
1
- /*!
2
- * (C) Ionic http://ionicframework.com - MIT License
3
- */
4
- import{r as t,c as i,f as o,w as a,e,h as s,d as r,g as n}from"./p-C8IsBmNU.js";import{f as d,i as h,d as l,r as p,a as c,p as m}from"./p-CwgG81ZD.js";import{C as f,a as b,d as u}from"./p-D-eFFUkA.js";import{e as v,g as x,r as w,b as g,h as k}from"./p-CTfR9YZG.js";import{c as y}from"./p-B-hirT0v.js";import{g as A}from"./p-CIGNaXM1.js";import{G as Y,O as D,F as S,e as E,B as O,j as B,k as T,f as C,g as M,h as P}from"./p-DdR6rpbR.js";import{g as j}from"./p-DiVJyqlX.js";import{e as R,w as L}from"./p-DUt5fQmA.js";import{b as I}from"./p-BFvmZNyx.js";import{KEYBOARD_DID_OPEN as $}from"./p-9eeaBrnk.js";import{c as N}from"./p-DDb5r57F.js";import{g as z}from"./p-hHmYLOfE.js";import{createGesture as F}from"./p-Cl0B-RWe.js";import{w as W}from"./p-ZjP4CjeZ.js";import"./p-B0q1YL7N.js";import"./p-BTEOs1at.js";import"./p-D13Eaw-8.js";var H;!function(t){t.Dark="DARK",t.Light="LIGHT",t.Default="DEFAULT"}(H||(H={}));const V={getEngine(){const t=A();if(null==t?void 0:t.isPluginAvailable("StatusBar"))return t.Plugins.StatusBar},setStyle(t){const i=this.getEngine();i&&i.setStyle(t)},getStyle:async function(){const t=this.getEngine();if(!t)return H.Default;const{style:i}=await t.getInfo();return i}},Z=(t,i)=>{if(1===i)return 0;const o=1/(1-i);return t*o+-i*o},G=()=>{!W||W.innerWidth>=768||V.setStyle({style:H.Dark})},U=(t=H.Default)=>{!W||W.innerWidth>=768||V.setStyle({style:t})},K=async(t,i)=>{"function"==typeof t.canDismiss&&await t.canDismiss(void 0,Y)&&(i.isRunning()?i.onFinish((()=>{t.dismiss(void 0,"handler")}),{oneTimeCallback:!0}):t.dismiss(void 0,"handler"))},_=t=>.00255275*2.71828**(-14.9619*t)-1.00255*2.71828**(-.0380968*t)+1,q=.915,X=(t,i)=>v(400,t/Math.abs(1.1*i),500),J=t=>{const{currentBreakpoint:i,backdropBreakpoint:o,expandToScroll:a}=t,e=void 0===o||o<i,s=e?`calc(var(--backdrop-opacity) * ${i})`:"0",r=N("backdropAnimation").fromTo("opacity",0,s);return e&&r.beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"]),{wrapperAnimation:N("wrapperAnimation").keyframes([{offset:0,opacity:1,transform:"translateY(100%)"},{offset:1,opacity:1,transform:`translateY(${100-100*i}%)`}]),backdropAnimation:r,contentAnimation:a?void 0:N("contentAnimation").keyframes([{offset:0,opacity:1,maxHeight:100*(1-i)+"%"},{offset:1,opacity:1,maxHeight:100*i+"%"}])}},Q=t=>{const{currentBreakpoint:i,backdropBreakpoint:o}=t,a=`calc(var(--backdrop-opacity) * ${Z(i,o)})`,e=[{offset:0,opacity:a},{offset:1,opacity:0}],s=[{offset:0,opacity:a},{offset:o,opacity:0},{offset:1,opacity:0}],r=N("backdropAnimation").keyframes(0!==o?s:e);return{wrapperAnimation:N("wrapperAnimation").keyframes([{offset:0,opacity:1,transform:`translateY(${100-100*i}%)`},{offset:1,opacity:1,transform:"translateY(100%)"}]),backdropAnimation:r}},tt=(t,i)=>{const{presentingEl:o,currentBreakpoint:a,expandToScroll:e}=i,s=x(t),{wrapperAnimation:r,backdropAnimation:n,contentAnimation:d}=void 0!==a?J(i):{backdropAnimation:N().fromTo("opacity",.01,"var(--backdrop-opacity)").beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"]),wrapperAnimation:N().fromTo("transform","translateY(100vh)","translateY(0vh)"),contentAnimation:void 0};n.addElement(s.querySelector("ion-backdrop")),r.addElement(s.querySelectorAll(".modal-wrapper, .modal-shadow")).beforeStyles({opacity:1}),!e&&(null==d||d.addElement(t.querySelector(".ion-page")));const h=N("entering-base").addElement(t).easing("cubic-bezier(0.32,0.72,0,1)").duration(500).addAnimation([r]);if(d&&h.addAnimation(d),o){const t=window.innerWidth<768,i="ION-MODAL"===o.tagName&&void 0!==o.presentingElement,a=x(o),e=N().beforeStyles({transform:"translateY(0)","transform-origin":"top center",overflow:"hidden"}),s=document.body;if(t){const t=CSS.supports("width","max(0px, 1px)")?"max(30px, var(--ion-safe-area-top))":"30px",a=`translateY(${i?"-10px":t}) scale(0.915)`;e.afterStyles({transform:a}).beforeAddWrite((()=>s.style.setProperty("background-color","black"))).addElement(o).keyframes([{offset:0,filter:"contrast(1)",transform:"translateY(0px) scale(1)",borderRadius:"0px"},{offset:1,filter:"contrast(0.85)",transform:a,borderRadius:"10px 10px 0 0"}]),h.addAnimation(e)}else if(h.addAnimation(n),i){const t=`translateY(-10px) scale(${i?q:1})`;e.afterStyles({transform:t}).addElement(a.querySelector(".modal-wrapper")).keyframes([{offset:0,filter:"contrast(1)",transform:"translateY(0) scale(1)"},{offset:1,filter:"contrast(0.85)",transform:t}]);const o=N().afterStyles({transform:t}).addElement(a.querySelector(".modal-shadow")).keyframes([{offset:0,opacity:"1",transform:"translateY(0) scale(1)"},{offset:1,opacity:"0",transform:t}]);h.addAnimation([e,o])}else r.fromTo("opacity","0","1")}else h.addAnimation(n);return h},it=(t,i,o=500)=>{const{presentingEl:a,currentBreakpoint:e}=i,s=x(t),{wrapperAnimation:r,backdropAnimation:n}=void 0!==e?Q(i):{backdropAnimation:N().fromTo("opacity","var(--backdrop-opacity)",0),wrapperAnimation:N().fromTo("transform","translateY(0vh)","translateY(100vh)")};n.addElement(s.querySelector("ion-backdrop")),r.addElement(s.querySelectorAll(".modal-wrapper, .modal-shadow")).beforeStyles({opacity:1});const d=N("leaving-base").addElement(t).easing("cubic-bezier(0.32,0.72,0,1)").duration(o).addAnimation(r);if(a){const t=window.innerWidth<768,i="ION-MODAL"===a.tagName&&void 0!==a.presentingElement,o=x(a),e=N().beforeClearStyles(["transform"]).afterClearStyles(["transform"]).onFinish((t=>{1===t&&(a.style.setProperty("overflow",""),Array.from(s.querySelectorAll("ion-modal:not(.overlay-hidden)")).filter((t=>void 0!==t.presentingElement)).length<=1&&s.style.setProperty("background-color",""))})),s=document.body;if(t){const t=CSS.supports("width","max(0px, 1px)")?"max(30px, var(--ion-safe-area-top))":"30px",o=`translateY(${i?"-10px":t}) scale(0.915)`;e.addElement(a).keyframes([{offset:0,filter:"contrast(0.85)",transform:o,borderRadius:"10px 10px 0 0"},{offset:1,filter:"contrast(1)",transform:"translateY(0px) scale(1)",borderRadius:"0px"}]),d.addAnimation(e)}else if(d.addAnimation(n),i){const t=`translateY(-10px) scale(${i?q:1})`;e.addElement(o.querySelector(".modal-wrapper")).afterStyles({transform:"translate3d(0, 0, 0)"}).keyframes([{offset:0,filter:"contrast(0.85)",transform:t},{offset:1,filter:"contrast(1)",transform:"translateY(0) scale(1)"}]);const a=N().addElement(o.querySelector(".modal-shadow")).afterStyles({transform:"translateY(0) scale(1)"}).keyframes([{offset:0,opacity:"0",transform:t},{offset:1,opacity:"1",transform:"translateY(0) scale(1)"}]);d.addAnimation([e,a])}else r.fromTo("opacity","1","0")}else d.addAnimation(n);return d},ot=(t,i)=>{const{currentBreakpoint:o,expandToScroll:a}=i,e=x(t),{wrapperAnimation:s,backdropAnimation:r,contentAnimation:n}=void 0!==o?J(i):{backdropAnimation:N().fromTo("opacity",.01,"var(--backdrop-opacity)").beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"]),wrapperAnimation:N().keyframes([{offset:0,opacity:.01,transform:"translateY(40px)"},{offset:1,opacity:1,transform:"translateY(0px)"}]),contentAnimation:void 0};r.addElement(e.querySelector("ion-backdrop")),s.addElement(e.querySelector(".modal-wrapper")),!a&&(null==n||n.addElement(t.querySelector(".ion-page")));const d=N().addElement(t).easing("cubic-bezier(0.36,0.66,0.04,1)").duration(280).addAnimation([r,s]);return n&&d.addAnimation(n),d},at=(t,i)=>{const{currentBreakpoint:o}=i,a=x(t),{wrapperAnimation:e,backdropAnimation:s}=void 0!==o?Q(i):{backdropAnimation:N().fromTo("opacity","var(--backdrop-opacity)",0),wrapperAnimation:N().keyframes([{offset:0,opacity:.99,transform:"translateY(0px)"},{offset:1,opacity:0,transform:"translateY(40px)"}])};return s.addElement(a.querySelector("ion-backdrop")),e.addElement(a.querySelector(".modal-wrapper")),N().easing("cubic-bezier(0.47,0,0.745,0.715)").duration(200).addAnimation([s,e])},et=class{constructor(o){t(this,o),this.didPresent=i(this,"ionModalDidPresent",7),this.willPresent=i(this,"ionModalWillPresent",7),this.willDismiss=i(this,"ionModalWillDismiss",7),this.didDismiss=i(this,"ionModalDidDismiss",7),this.ionBreakpointDidChange=i(this,"ionBreakpointDidChange",7),this.didPresentShorthand=i(this,"didPresent",7),this.willPresentShorthand=i(this,"willPresent",7),this.willDismissShorthand=i(this,"willDismiss",7),this.didDismissShorthand=i(this,"didDismiss",7),this.ionMount=i(this,"ionMount",7),this.lockController=y(),this.triggerController=E(),this.coreDelegate=f(),this.isSheetModal=!1,this.inheritedAttributes={},this.inline=!1,this.gestureAnimationDismissing=!1,this.skipSafeAreaCoordinateDetection=!1,this.prevSafeAreaState={top:!1,bottom:!1,left:!1,right:!1},this.presented=!1,this.hasController=!1,this.keyboardClose=!0,this.expandToScroll=!0,this.backdropBreakpoint=0,this.handleBehavior="none",this.backdropDismiss=!0,this.showBackdrop=!0,this.animated=!0,this.isOpen=!1,this.keepContentsMounted=!1,this.focusTrap=!0,this.canDismiss=!0,this.onHandleClick=()=>{const{sheetTransition:t,handleBehavior:i}=this;"cycle"===i&&void 0===t&&this.moveToNextBreakpoint()},this.onBackdropTap=()=>{const{sheetTransition:t}=this;void 0===t&&this.dismiss(void 0,O)},this.onLifecycle=t=>{const i=this.usersElement,o=st[t.type];if(i&&o){const a=new CustomEvent(o,{bubbles:!1,cancelable:!1,detail:t.detail});i.dispatchEvent(a)}},this.onModalFocus=t=>{const{dragHandleEl:i,el:o}=this;t.target===o&&i&&-1!==i.tabIndex&&i.focus()},this.onSlotChange=({target:t})=>{t.assignedElements().forEach((t=>{t.querySelectorAll("ion-modal").forEach((t=>{null===t.getAttribute("data-parent-ion-modal")&&t.setAttribute("data-parent-ion-modal",this.el.id)}))}))}}onIsOpenChange(t,i){!0===t&&!1===i?this.present():!1===t&&!0===i&&this.dismiss()}triggerChanged(){const{trigger:t,el:i,triggerController:o}=this;t&&o.addClickListener(i,t)}onWindowResize(){this.cachedSafeAreas=void 0,this.updateSafeAreaOverrides(),"ios"!==I(this)||!this.presentingElement||this.enterAnimation||this.leaveAnimation||(clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout((()=>{this.handleViewTransition()}),50))}breakpointsChanged(t){void 0!==t&&(this.sortedBreakpoints=t.sort(((t,i)=>t-i)))}connectedCallback(){const{el:t}=this;B(t),this.triggerChanged()}disconnectedCallback(){this.triggerController.removeClickListener(),this.cleanupViewTransitionListener(),this.cleanupParentRemovalObserver()}componentWillLoad(){var t;const{breakpoints:i,initialBreakpoint:a,el:e,htmlAttributes:s}=this,r=this.isSheetModal=void 0!==i&&void 0!==a,n=["aria-label","role"];this.inheritedAttributes=g(e,n),e.parentNode&&(this.cachedOriginalParent=e.parentNode),void 0!==s&&n.forEach((t=>{s[t]&&(this.inheritedAttributes=Object.assign(Object.assign({},this.inheritedAttributes),{[t]:s[t]}),delete s[t])})),r&&(this.currentBreakpoint=this.initialBreakpoint),void 0===i||void 0===a||i.includes(a)||o("[ion-modal] - Your breakpoints array must include the initialBreakpoint value."),(null===(t=this.htmlAttributes)||void 0===t?void 0:t.id)||T(this.el)}componentDidLoad(){!0===this.isOpen&&w((()=>this.present())),this.breakpointsChanged(this.breakpoints),this.triggerChanged()}getDelegate(t=!1){if(this.workingDelegate&&!t)return{delegate:this.workingDelegate,inline:this.inline};const i=this.inline=null!==this.el.parentNode&&!this.hasController;return{inline:i,delegate:this.workingDelegate=i?this.delegate||this.coreDelegate:this.delegate}}async checkCanDismiss(t,i){const{canDismiss:o}=this;return"function"==typeof o?o(t,i):o}async present(){const t=await this.lockController.lock();if(this.presented)return void t();const{presentingElement:i,el:o}=this;this.currentBreakpoint=this.initialBreakpoint;const{inline:e,delegate:s}=this.getDelegate(!0);this.ionMount.emit(),this.usersElement=await b(s,o,this.component,["ion-page"],this.componentProps,e),k(o)?await R(this.usersElement):this.keepContentsMounted||await L(),this.setInitialSafeAreaOverrides(i),a((()=>this.el.classList.add("show-modal")));const r=void 0!==i;r&&"ios"===I(this)&&(this.statusBarStyle=await V.getStyle(),G()),await C(this,"modalEnter",tt,ot,{presentingEl:i,currentBreakpoint:this.initialBreakpoint,backdropBreakpoint:this.backdropBreakpoint,expandToScroll:this.expandToScroll}),"undefined"!=typeof window&&(this.keyboardOpenCallback=()=>{this.gesture&&(this.gesture.enable(!1),w((()=>{this.gesture&&this.gesture.enable(!0)})))},window.addEventListener($,this.keyboardOpenCallback));const n=void 0!==this.breakpoints&&void 0!==this.initialBreakpoint;this.isSheetModal=n,n?this.initSheetGesture():r&&this.initSwipeToClose(),this.updateSafeAreaOverrides(),this.initViewTransitionListener(),this.initParentRemovalObserver(),t()}initSwipeToClose(){var t;if("ios"!==I(this))return;const{el:i}=this,o=this.leaveAnimation||e.get("modalLeave",it),a=this.animation=o(i,{presentingEl:this.presentingElement,expandToScroll:this.expandToScroll});if(!c(i))return void m(i);const s=null!==(t=this.statusBarStyle)&&void 0!==t?t:H.Default;this.gesture=((t,i,o,a,e)=>{const s=.5,r=t.offsetHeight;let n=!1,c=!1,m=null,f=null,b=!0,u=0;const w=F({el:t,gestureName:"modalSwipeToClose",gesturePriority:D,direction:"y",threshold:10,canStart:t=>{const i=t.event.target;if(null===i||!i.closest)return!0;if(m=d(i),m){if(h(m)){const t=x(m);f=t.querySelector(".inner-scroll")}else f=m;return!m.querySelector("ion-refresher")&&0===f.scrollTop}return null===i.closest("ion-footer")},onStart:o=>{const{deltaY:a}=o;b=!m||!h(m)||m.scrollY,c=void 0!==t.canDismiss&&!0!==t.canDismiss,a>0&&m&&l(m),i.progressStart(!0,n?1:0)},onMove:t=>{const{deltaY:a}=t;a>0&&m&&l(m);const n=t.deltaY/r,d=n>=0&&c,h=d?.2:.9999,p=d?_(n/h):n,f=v(1e-4,p,h);i.progressStep(f),null==e||e(),f>=s&&u<s?U(o):f<s&&u>=s&&G(),u=f},onEnd:o=>{const e=o.velocityY,d=o.deltaY/r,h=d>=0&&c,l=h?.2:.9999,f=h?_(d/l):d,u=v(1e-4,f,l),x=!h&&(o.deltaY+1e3*e)/r>=s;let g=x?-.001:.001;x?(i.easing("cubic-bezier(0.32, 0.72, 0, 1)"),g+=z([0,0],[.32,.72],[0,1],[1,1],u)[0]):(i.easing("cubic-bezier(1, 0, 0.68, 0.28)"),g+=z([0,0],[1,0],[.68,.28],[1,1],u)[0]);const k=X(x?d*r:(1-u)*r,e);n=x,w.enable(!1),m&&p(m,b),i.onFinish((()=>{x||w.enable(!0)})).progressEnd(x?1:0,g,k),h&&u>l/4?K(t,i):x&&a()}});return w})(i,a,s,(()=>{this.gestureAnimationDismissing=!0,U(this.statusBarStyle),this.animation.onFinish((async()=>{await this.dismiss(void 0,Y),this.gestureAnimationDismissing=!1}))}),(()=>this.updateSafeAreaOverrides())),this.gesture.enable(!0)}initSheetGesture(){const{wrapperEl:t,initialBreakpoint:i,backdropBreakpoint:o}=this;if(!t||void 0===i)return;const a=this.enterAnimation||e.get("modalEnter",tt),s=this.animation=a(this.el,{presentingEl:this.presentingElement,currentBreakpoint:i,backdropBreakpoint:o,expandToScroll:this.expandToScroll});s.progressStart(!0,1);const{gesture:r,moveSheetToBreakpoint:n}=((t,i,o,a,e,s,r=[],n,l,p,c,m)=>{const f={WRAPPER_KEYFRAMES:[{offset:0,transform:"translateY(0%)"},{offset:1,transform:"translateY(100%)"}],BACKDROP_KEYFRAMES:0!==e?[{offset:0,opacity:"var(--backdrop-opacity)"},{offset:1-e,opacity:0},{offset:1,opacity:0}]:[{offset:0,opacity:"var(--backdrop-opacity)"},{offset:1,opacity:.01}],CONTENT_KEYFRAMES:[{offset:0,maxHeight:"100%"},{offset:1,maxHeight:"0%"}]},b=t.querySelector("ion-content"),u=o.clientHeight;let g=a,k=0,y=!1,A=null,Y=null,D=null,E=null;const O=r[r.length-1],B=r[0],T=s.childAnimations.find((t=>"wrapperAnimation"===t.id)),C=s.childAnimations.find((t=>"backdropAnimation"===t.id)),M=s.childAnimations.find((t=>"contentAnimation"===t.id)),P=()=>{!1!==t.focusTrap&&!1!==t.showBackdrop&&(t.style.setProperty("pointer-events","auto"),i.style.setProperty("pointer-events","auto"),t.classList.remove(S))},j=()=>{t.style.setProperty("pointer-events","none"),i.style.setProperty("pointer-events","none"),t.classList.add(S)},R=i=>{if(!Y&&(Y=Array.from(t.querySelectorAll("ion-footer")),!Y.length))return;const o=t.querySelector(".ion-page");if(E=i,"stationary"===i)Y.forEach((t=>{t.classList.remove("modal-footer-moving"),t.style.removeProperty("position"),t.style.removeProperty("width"),t.style.removeProperty("height"),t.style.removeProperty("top"),t.style.removeProperty("left"),null==o||o.style.removeProperty("padding-bottom"),null==o||o.appendChild(t)}));else{let i=0;Y.forEach(((o,a)=>{const e=o.getBoundingClientRect(),s=document.body.getBoundingClientRect();i+=o.clientHeight;const r=e.top-s.top,n=e.left-s.left;if(o.style.setProperty("--pinned-width",`${o.clientWidth}px`),o.style.setProperty("--pinned-height",`${o.clientHeight}px`),o.style.setProperty("--pinned-top",`${r}px`),o.style.setProperty("--pinned-left",`${n}px`),0===a){D=r;const i=t.querySelector("ion-header");i&&(D-=i.clientHeight)}})),Y.forEach((t=>{null==o||o.style.setProperty("padding-bottom",`${i}px`),t.classList.add("modal-footer-moving"),t.style.setProperty("position","absolute"),t.style.setProperty("width","var(--pinned-width)"),t.style.setProperty("height","var(--pinned-height)"),t.style.setProperty("top","var(--pinned-top)"),t.style.setProperty("left","var(--pinned-left)"),document.body.appendChild(t)}))}};T&&C&&(T.keyframes([...f.WRAPPER_KEYFRAMES]),C.keyframes([...f.BACKDROP_KEYFRAMES]),null==M||M.keyframes([...f.CONTENT_KEYFRAMES]),s.progressStart(!0,1-g),g>e&&!1!==t.focusTrap&&!1!==t.showBackdrop?P():j()),b&&g!==O&&n&&(b.scrollY=!1);const L=i=>{const{breakpoint:o,canDismiss:a,breakpointOffset:d,animated:h}=i,l=a&&0===o,m=l?g:o,u=0!==m;return g=0,T&&C&&(T.keyframes([{offset:0,transform:`translateY(${100*d}%)`},{offset:1,transform:`translateY(${100*(1-m)}%)`}]),C.keyframes([{offset:0,opacity:`calc(var(--backdrop-opacity) * ${Z(1-d,e)})`},{offset:1,opacity:`calc(var(--backdrop-opacity) * ${Z(m,e)})`}]),M&&M.keyframes([{offset:0,maxHeight:100*(1-d)+"%"},{offset:1,maxHeight:100*m+"%"}]),s.progressStep(0)),I.enable(!1),l?K(t,s):u||p(),!b||m!==r[r.length-1]&&n||(b.scrollY=!0),n||0!==m||R("stationary"),new Promise((i=>{s.onFinish((()=>{u?(n||R("stationary"),T&&C?w((()=>{T.keyframes([...f.WRAPPER_KEYFRAMES]),C.keyframes([...f.BACKDROP_KEYFRAMES]),null==M||M.keyframes([...f.CONTENT_KEYFRAMES]),s.progressStart(!0,1-m),g=m,c(g),g>e&&!1!==t.focusTrap&&!1!==t.showBackdrop?P():j(),I.enable(!0),i()})):(I.enable(!0),i())):i()}),{oneTimeCallback:!0}).progressEnd(1,0,h?500:0)}))},I=F({el:o,gestureName:"modalSheet",gesturePriority:40,direction:"y",threshold:10,canStart:t=>{const i=d(t.event.target);if(g=l(),!n&&i)return 0===(h(i)?x(i).querySelector(".inner-scroll"):i).scrollTop;if(1===g&&i){const t=h(i)?x(i).querySelector(".inner-scroll"):i;return!i.querySelector("ion-refresher")&&0===t.scrollTop}return!0},onStart:i=>{if(y=void 0!==t.canDismiss&&!0!==t.canDismiss&&0===B,!n){const t=d(i.event.target);A=t&&h(t)?x(t).querySelector(".inner-scroll"):t}n||R("moving"),i.deltaY>0&&b&&(b.scrollY=!1),w((()=>{t.focus()})),s.progressStart(!0,1-g)},onMove:t=>{if(n||null===D||null===E||(t.currentY>=D&&"moving"===E?R("stationary"):t.currentY<D&&"stationary"===E&&R("moving")),!n&&t.deltaY<=0&&A)return;t.deltaY>0&&b&&(b.scrollY=!1);const i=r.length>1?1-r[1]:void 0,o=1-g+t.deltaY/u,a=void 0!==i&&o>=i&&y,e=a?.95:.9999,d=a&&void 0!==i?i+_((o-i)/(e-i)):o;k=v(1e-4,d,e),s.progressStep(k),null==m||m()},onEnd:t=>{if(!n&&t.deltaY<=0&&A&&A.scrollTop>0)return void R("stationary");const i=g-(t.deltaY+350*t.velocityY)/u,o=r.reduce(((t,o)=>Math.abs(o-i)<Math.abs(t-i)?o:t));L({breakpoint:o,breakpointOffset:k,canDismiss:y,animated:!0})}});return{gesture:I,moveSheetToBreakpoint:L}})(this.el,this.backdropEl,t,i,o,s,this.sortedBreakpoints,this.expandToScroll,(()=>{var t;return null!==(t=this.currentBreakpoint)&&void 0!==t?t:0}),(()=>this.sheetOnDismiss()),(t=>{this.currentBreakpoint!==t&&(this.currentBreakpoint=t,this.ionBreakpointDidChange.emit({breakpoint:t})),this.updateSafeAreaOverrides()}),(()=>this.updateSafeAreaOverrides()));this.gesture=r,this.moveSheetToBreakpoint=n,this.gesture.enable(!0),(!1===this.showBackdrop||!1===this.focusTrap||o>0)&&this.setupChildRoutePassthrough()}setupChildRoutePassthrough(){var t;this.cachedPageParent=this.getOriginalPageParent();const i=this.cachedPageParent;if(!i||"ION-APP"===i.tagName)return;const o=Array.from(i.children).some((t=>{var i;return!(t===this.el||t instanceof HTMLElement&&"none"===window.getComputedStyle(t).display||"TEMPLATE"===t.tagName||"SLOT"===t.tagName||t.nodeType===Node.TEXT_NODE&&!(null===(i=t.textContent)||void 0===i?void 0:i.trim()))}));if(o)return;i.classList.add("ion-page-overlay-passthrough");const a=i.parentElement;"ION-ROUTER-OUTLET"===(null==a?void 0:a.tagName)&&"ION-APP"!==(null===(t=a.parentElement)||void 0===t?void 0:t.tagName)&&(a.style.setProperty("pointer-events","none"),a.setAttribute("data-overlay-passthrough","true"))}getOriginalPageParent(){if(!this.cachedOriginalParent)return null;let t=this.cachedOriginalParent;for(;t&&!t.classList.contains("ion-page");)t=t.parentElement;return t}cleanupChildRoutePassthrough(){const t=this.cachedPageParent;if(!t)return;t.classList.remove("ion-page-overlay-passthrough");const i=t.parentElement;(null==i?void 0:i.hasAttribute("data-overlay-passthrough"))&&(i.style.removeProperty("pointer-events"),i.removeAttribute("data-overlay-passthrough")),this.cachedPageParent=void 0}setInitialSafeAreaOverrides(t){const i=this.el.style,o=I(this),a=void 0!==t&&"ios"===o,e=window.innerWidth>=768;if(void 0!==this.breakpoints&&void 0!==this.initialBreakpoint)return i.setProperty("--ion-safe-area-top","0px"),i.setProperty("--ion-safe-area-left","0px"),void i.setProperty("--ion-safe-area-right","0px");if(a)return i.setProperty("--ion-safe-area-top","0px"),void(e?this.zeroAllSafeAreas():(i.setProperty("--ion-safe-area-left","0px"),i.setProperty("--ion-safe-area-right","0px"),this.applyFullscreenSafeArea()));if(!e)return void this.applyFullscreenSafeArea();const s=getComputedStyle(this.el),r=s.getPropertyValue("--width").trim(),n=s.getPropertyValue("--height").trim();"100%"===r&&"100%"===n?this.applyFullscreenSafeArea():this.zeroAllSafeAreas()}applyFullscreenSafeArea(){this.skipSafeAreaCoordinateDetection=!0,this.updateFooterPadding(),this.footerObserver||(this.footerObserver=new MutationObserver((()=>this.updateFooterPadding())),this.footerObserver.observe(this.el,{childList:!0,subtree:!0}))}updateFooterPadding(){this.wrapperEl&&(null!==this.el.querySelector("ion-footer")?(this.wrapperEl.style.removeProperty("padding-bottom"),this.wrapperEl.style.removeProperty("box-sizing")):(this.wrapperEl.style.setProperty("padding-bottom","var(--ion-safe-area-bottom, 0px)"),this.wrapperEl.style.setProperty("box-sizing","border-box")))}zeroAllSafeAreas(){const t=this.el.style;t.setProperty("--ion-safe-area-top","0px"),t.setProperty("--ion-safe-area-bottom","0px"),t.setProperty("--ion-safe-area-left","0px"),t.setProperty("--ion-safe-area-right","0px")}getSafeAreaValues(){if(!this.cachedSafeAreas){const t=getComputedStyle(document.documentElement);this.cachedSafeAreas={top:parseFloat(t.getPropertyValue("--ion-safe-area-top"))||0,bottom:parseFloat(t.getPropertyValue("--ion-safe-area-bottom"))||0,left:parseFloat(t.getPropertyValue("--ion-safe-area-left"))||0,right:parseFloat(t.getPropertyValue("--ion-safe-area-right"))||0}}return this.cachedSafeAreas}updateSafeAreaOverrides(){if(this.skipSafeAreaCoordinateDetection)return;const t=this.wrapperEl;if(!t)return;const i=t.getBoundingClientRect(),o=this.getSafeAreaValues(),a=i.top<o.top,e=i.bottom>window.innerHeight-o.bottom,s=i.left<o.left,r=i.right>window.innerWidth-o.right,n=this.prevSafeAreaState,d=this.el.style;a!==n.top&&(a?d.removeProperty("--ion-safe-area-top"):d.setProperty("--ion-safe-area-top","0px"),n.top=a),e!==n.bottom&&(e?d.removeProperty("--ion-safe-area-bottom"):d.setProperty("--ion-safe-area-bottom","0px"),n.bottom=e),s!==n.left&&(s?d.removeProperty("--ion-safe-area-left"):d.setProperty("--ion-safe-area-left","0px"),n.left=s),r!==n.right&&(r?d.removeProperty("--ion-safe-area-right"):d.setProperty("--ion-safe-area-right","0px"),n.right=r)}sheetOnDismiss(){this.gestureAnimationDismissing=!0,this.animation.onFinish((async()=>{this.currentBreakpoint=0,this.ionBreakpointDidChange.emit({breakpoint:this.currentBreakpoint}),await this.dismiss(void 0,Y),this.gestureAnimationDismissing=!1}))}async dismiss(t,i){var o,e;if(this.gestureAnimationDismissing&&i!==Y)return!1;const s=await this.lockController.lock();if(await this.dismissNestedModals(),"handler"!==i&&!await this.checkCanDismiss(t,i))return s(),!1;const{presentingElement:r}=this;void 0!==r&&"ios"===I(this)&&U(this.statusBarStyle),"undefined"!=typeof window&&this.keyboardOpenCallback&&(window.removeEventListener($,this.keyboardOpenCallback),this.keyboardOpenCallback=void 0);const n=await M(this,t,i,"modalLeave",it,at,{presentingEl:r,currentBreakpoint:null!==(o=this.currentBreakpoint)&&void 0!==o?o:this.initialBreakpoint,backdropBreakpoint:this.backdropBreakpoint,expandToScroll:this.expandToScroll});if(n){const{delegate:t}=this.getDelegate();await u(t,this.usersElement),a((()=>this.el.classList.remove("show-modal"))),this.animation&&this.animation.destroy(),this.gesture&&this.gesture.destroy(),this.cleanupViewTransitionListener(),this.cleanupParentRemovalObserver(),this.cleanupChildRoutePassthrough()}this.currentBreakpoint=void 0,this.animation=void 0,this.skipSafeAreaCoordinateDetection=!1,this.cachedSafeAreas=void 0,this.prevSafeAreaState={top:!1,bottom:!1,left:!1,right:!1},null===(e=this.footerObserver)||void 0===e||e.disconnect(),this.footerObserver=void 0,this.wrapperEl&&(this.wrapperEl.style.removeProperty("padding-bottom"),this.wrapperEl.style.removeProperty("box-sizing"));const d=this.el.style;return d.removeProperty("--ion-safe-area-top"),d.removeProperty("--ion-safe-area-bottom"),d.removeProperty("--ion-safe-area-left"),d.removeProperty("--ion-safe-area-right"),s(),n}onDidDismiss(){return P(this.el,"ionModalDidDismiss")}onWillDismiss(){return P(this.el,"ionModalWillDismiss")}async setCurrentBreakpoint(t){if(!this.isSheetModal)return void o("[ion-modal] - setCurrentBreakpoint is only supported on sheet modals.");if(!this.breakpoints.includes(t))return void o(`[ion-modal] - Attempted to set invalid breakpoint value ${t}. Please double check that the breakpoint value is part of your defined breakpoints.`);const{currentBreakpoint:i,moveSheetToBreakpoint:a,canDismiss:e,breakpoints:s,animated:r}=this;i!==t&&a&&(this.sheetTransition=a({breakpoint:t,breakpointOffset:1-i,canDismiss:void 0!==e&&!0!==e&&0===s[0],animated:r}),await this.sheetTransition,this.sheetTransition=void 0)}async getCurrentBreakpoint(){return this.currentBreakpoint}async moveToNextBreakpoint(){const{breakpoints:t,currentBreakpoint:i}=this;if(!t||null==i)return!1;const o=t.filter((t=>0!==t)),a=o.indexOf(i),e=o[(a+1)%o.length];return await this.setCurrentBreakpoint(e),!0}initViewTransitionListener(){"ios"!==I(this)||!this.presentingElement||this.enterAnimation||this.leaveAnimation||(this.currentViewIsPortrait=window.innerWidth<768)}handleViewTransition(){if(!this.presented)return;const t=window.innerWidth<768;if(this.currentViewIsPortrait===t)return;this.viewTransitionAnimation&&(this.viewTransitionAnimation.destroy(),this.viewTransitionAnimation=void 0);const{presentingElement:i}=this;if(!i)return;let o;o=this.currentViewIsPortrait&&!t?((t,i,o=300)=>{const{presentingEl:a}=i;if(!a)return N("portrait-to-landscape-transition");const e="ION-MODAL"===a.tagName&&void 0!==a.presentingElement,s=x(a),r=document.body,n=N("portrait-to-landscape-transition").addElement(t).easing("cubic-bezier(0.32,0.72,0,1)").duration(o),d=N().beforeStyles({transform:"translateY(0)","transform-origin":"top center",overflow:"hidden"});if(e){const t="translateY(-10px) scale(0.915)",i="translateY(0px) scale(1)";d.addElement(a).afterStyles({transform:i}).fromTo("transform",t,i).fromTo("filter","contrast(0.85)","contrast(1)");const o=N().addElement(s.querySelector(".modal-shadow")).afterStyles({transform:i,opacity:"0"}).fromTo("transform",t,i);n.addAnimation([d,o])}else{const i=x(t),o=N().addElement(i.querySelectorAll(".modal-wrapper, .modal-shadow")).fromTo("opacity","1","1"),e=N().addElement(i.querySelector("ion-backdrop")).fromTo("opacity","var(--backdrop-opacity)","var(--backdrop-opacity)"),s=`translateY(${CSS.supports("width","max(0px, 1px)")?"max(30px, var(--ion-safe-area-top))":"30px"}) scale(0.915)`;d.addElement(a).afterStyles({transform:"translateY(0px) scale(1)","border-radius":"0px"}).beforeAddWrite((()=>r.style.setProperty("background-color",""))).fromTo("transform",s,"translateY(0px) scale(1)").fromTo("filter","contrast(0.85)","contrast(1)").fromTo("border-radius","10px 10px 0 0","0px"),n.addAnimation([d,o,e])}return n})(this.el,{presentingEl:i}):((t,i,o=300)=>{const{presentingEl:a}=i;if(!a)return N("landscape-to-portrait-transition");const e="ION-MODAL"===a.tagName&&void 0!==a.presentingElement,s=x(a),r=document.body,n=N("landscape-to-portrait-transition").addElement(t).easing("cubic-bezier(0.32,0.72,0,1)").duration(o),d=N().beforeStyles({transform:"translateY(0)","transform-origin":"top center",overflow:"hidden"});if(e){const t="translateY(-10px) scale(0.915)",i="translateY(0) scale(1)";d.addElement(a).afterStyles({transform:i}).fromTo("transform",t,i);const o=N().addElement(s.querySelector(".modal-shadow")).afterStyles({transform:i,opacity:"0"}).fromTo("transform",t,i);n.addAnimation([d,o])}else{const i=x(t),o=N().addElement(i.querySelectorAll(".modal-wrapper, .modal-shadow")).fromTo("opacity","1","1"),e=N().addElement(i.querySelector("ion-backdrop")).fromTo("opacity","var(--backdrop-opacity)","var(--backdrop-opacity)"),s=`translateY(${CSS.supports("width","max(0px, 1px)")?"max(30px, var(--ion-safe-area-top))":"30px"}) scale(0.915)`;d.addElement(a).afterStyles({transform:s}).beforeAddWrite((()=>r.style.setProperty("background-color","black"))).keyframes([{offset:0,transform:"translateY(0px) scale(1)",filter:"contrast(1)",borderRadius:"0px"},{offset:.2,transform:"translateY(0px) scale(1)",filter:"contrast(1)",borderRadius:"10px 10px 0 0"},{offset:1,transform:s,filter:"contrast(0.85)",borderRadius:"10px 10px 0 0"}]),n.addAnimation([d,o,e])}return n})(this.el,{presentingEl:i}),this.currentViewIsPortrait=t,this.viewTransitionAnimation=o,o.play().then((()=>{this.viewTransitionAnimation=void 0,this.reinitSwipeToClose()}))}cleanupViewTransitionListener(){this.resizeTimeout&&(clearTimeout(this.resizeTimeout),this.resizeTimeout=void 0),this.viewTransitionAnimation&&(this.viewTransitionAnimation.destroy(),this.viewTransitionAnimation=void 0)}reinitSwipeToClose(){"ios"===I(this)&&this.presentingElement&&(this.gesture&&(this.gesture.destroy(),this.gesture=void 0),this.animation&&(this.animation.progressEnd(0,0,0),this.animation.destroy(),this.animation=void 0),w((()=>{this.ensureCorrectModalPosition(),this.initSwipeToClose()})))}ensureCorrectModalPosition(){const{el:t,presentingElement:i}=this,o=x(t).querySelector(".modal-wrapper");if(o&&(o.style.transform="translateY(0vh)",o.style.opacity="1"),"ION-MODAL"===(null==i?void 0:i.tagName))if(window.innerWidth<768){const t=CSS.supports("width","max(0px, 1px)")?"max(30px, var(--ion-safe-area-top))":"30px";i.style.transform=`translateY(${t}) scale(0.915)`}else i.style.transform="translateY(0px) scale(1)"}async dismissNestedModals(){const t=document.querySelectorAll(`ion-modal[data-parent-ion-modal="${this.el.id}"]`);null==t||t.forEach((async t=>{await t.dismiss(void 0,"parent-dismissed")}))}initParentRemovalObserver(){"undefined"!=typeof MutationObserver&&"undefined"!=typeof window&&this.cachedOriginalParent&&this.cachedOriginalParent.nodeType!==Node.DOCUMENT_NODE&&this.cachedOriginalParent.nodeType!==Node.DOCUMENT_FRAGMENT_NODE&&(this.hasController||this.cachedOriginalParent===document.body||"ION-APP"===this.cachedOriginalParent.tagName||(this.parentRemovalObserver=new MutationObserver((t=>{t.forEach((t=>{"childList"===t.type&&t.removedNodes.length>0&&(Array.from(t.removedNodes).some((t=>{var i,o;const a=t===this.cachedOriginalParent,e=!!this.cachedOriginalParent&&(null===(o=(i=t).contains)||void 0===o?void 0:o.call(i,this.cachedOriginalParent));return a||e}))||this.cachedOriginalParent&&!this.cachedOriginalParent.isConnected)&&(this.dismiss(void 0,"parent-removed"),this.cachedOriginalParent=void 0)}))})),this.parentRemovalObserver.observe(document.body,{childList:!0,subtree:!0})))}cleanupParentRemovalObserver(){var t;null===(t=this.parentRemovalObserver)||void 0===t||t.disconnect(),this.parentRemovalObserver=void 0}render(){const{handle:t,isSheetModal:i,presentingElement:o,htmlAttributes:a,handleBehavior:e,inheritedAttributes:n,focusTrap:d,expandToScroll:h}=this,l=!1!==t&&i,p=I(this),c=void 0!==o&&"ios"===p,m="cycle"===e;return s(r,Object.assign({key:"11cd16cc481093a38a327abdd94467be3f71718d","no-router":!0,tabIndex:m&&i&&l?0:-1},a,{style:{zIndex:`${2e4+this.overlayIndex}`},class:Object.assign({[p]:!0,"modal-default":!c&&!i,"modal-card":c,"modal-sheet":i,"modal-no-expand-scroll":i&&!h,"overlay-hidden":!0,[S]:!1===d},j(this.cssClass)),onIonBackdropTap:this.onBackdropTap,onIonModalDidPresent:this.onLifecycle,onIonModalWillPresent:this.onLifecycle,onIonModalWillDismiss:this.onLifecycle,onIonModalDidDismiss:this.onLifecycle,onFocus:this.onModalFocus}),s("ion-backdrop",{key:"125658fbb071960da3905854668078e15bce56da",ref:t=>this.backdropEl=t,visible:this.showBackdrop,tappable:this.backdropDismiss,part:"backdrop"}),"ios"===p&&s("div",{key:"4a63815ef165e5806fef85ef48bf509813ff55c9",class:"modal-shadow"}),s("div",Object.assign({key:"cfc4b20354cbf2c0f873f6aee91c9b8f553de61d",role:"dialog"},n,{"aria-modal":"true",class:"modal-wrapper ion-overlay-wrapper",part:"content",ref:t=>this.wrapperEl=t}),l&&s("button",{key:"33a4ee89bb8b6512883cb8756641c1e27fdb0ebc",class:"modal-handle",tabIndex:m?0:-1,"aria-label":"Activate to adjust the size of the dialog overlaying the screen",onClick:m?this.onHandleClick:void 0,part:"handle",ref:t=>this.dragHandleEl=t}),s("slot",{key:"986fafb71234591c96e927f92b7330bb5c76fc2e",onSlotchange:this.onSlotChange})))}get el(){return n(this)}static get watchers(){return{isOpen:["onIsOpenChange"],trigger:["triggerChanged"]}}},st={ionModalDidPresent:"ionViewDidEnter",ionModalWillPresent:"ionViewWillEnter",ionModalWillDismiss:"ionViewWillLeave",ionModalDidDismiss:"ionViewDidLeave"};et.style={ios:':host{--width:100%;--min-width:auto;--max-width:auto;--height:100%;--min-height:auto;--max-height:auto;--overflow:hidden;--border-radius:0;--border-width:0;--border-style:none;--border-color:transparent;--background:var(--ion-background-color, #fff);--box-shadow:none;--backdrop-opacity:0;left:0;right:0;top:0;bottom:0;display:-ms-flexbox;display:flex;position:absolute;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;outline:none;color:var(--ion-text-color, #000);contain:strict}.modal-wrapper,ion-backdrop{pointer-events:auto}:host(.overlay-hidden){display:none}.modal-wrapper,.modal-shadow{border-radius:var(--border-radius);width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow);overflow:var(--overflow);z-index:10}.modal-shadow{position:absolute;background:transparent}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--width:600px;--height:500px}}@media only screen and (min-width: 768px) and (min-height: 768px){:host{--width:600px;--height:600px}}.modal-handle{left:0px;right:0px;top:5px;border-radius:8px;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;position:absolute;width:36px;height:5px;-webkit-transform:translateZ(0);transform:translateZ(0);border:0;background:var(--ion-color-step-350, var(--ion-background-color-step-350, #c0c0be));cursor:pointer;z-index:11}.modal-handle::before{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:4px;padding-inline-end:4px;padding-top:4px;padding-bottom:4px;position:absolute;width:36px;height:5px;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);content:""}:host(.modal-sheet){--height:calc(100% - (var(--ion-safe-area-top) + 10px))}:host(.modal-sheet) .modal-wrapper,:host(.modal-sheet) .modal-shadow{position:absolute;bottom:0}:host(.modal-sheet.modal-no-expand-scroll) ion-footer{position:absolute;bottom:0;width:var(--width)}:host{--backdrop-opacity:var(--ion-backdrop-opacity, 0.4)}:host(.modal-card),:host(.modal-sheet){--border-radius:10px}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--border-radius:10px}}.modal-wrapper{-webkit-transform:translate3d(0, 100%, 0);transform:translate3d(0, 100%, 0)}@media screen and (max-width: 767px){@supports (width: max(0px, 1px)){:host(.modal-card){--height:calc(100% - max(30px, var(--ion-safe-area-top)) - 10px)}}@supports not (width: max(0px, 1px)){:host(.modal-card){--height:calc(100% - 40px)}}:host(.modal-card) .modal-wrapper{border-start-start-radius:var(--border-radius);border-start-end-radius:var(--border-radius);border-end-end-radius:0;border-end-start-radius:0}:host(.modal-card){--backdrop-opacity:0;--width:100%;-ms-flex-align:end;align-items:flex-end}:host(.modal-card) .modal-shadow{display:none}:host(.modal-card) ion-backdrop{pointer-events:none}}@media screen and (min-width: 768px){:host(.modal-card){--width:calc(100% - 120px);--height:calc(100% - (120px + var(--ion-safe-area-top) + var(--ion-safe-area-bottom)));--max-width:720px;--max-height:1000px;--backdrop-opacity:0;--box-shadow:0px 0px 30px 10px rgba(0, 0, 0, 0.1);-webkit-transition:all 0.5s ease-in-out;transition:all 0.5s ease-in-out}:host(.modal-card) .modal-wrapper{-webkit-box-shadow:none;box-shadow:none}:host(.modal-card) .modal-shadow{-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow)}}:host(.modal-sheet) .modal-wrapper{border-start-start-radius:var(--border-radius);border-start-end-radius:var(--border-radius);border-end-end-radius:0;border-end-start-radius:0}',md:':host{--width:100%;--min-width:auto;--max-width:auto;--height:100%;--min-height:auto;--max-height:auto;--overflow:hidden;--border-radius:0;--border-width:0;--border-style:none;--border-color:transparent;--background:var(--ion-background-color, #fff);--box-shadow:none;--backdrop-opacity:0;left:0;right:0;top:0;bottom:0;display:-ms-flexbox;display:flex;position:absolute;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;outline:none;color:var(--ion-text-color, #000);contain:strict}.modal-wrapper,ion-backdrop{pointer-events:auto}:host(.overlay-hidden){display:none}.modal-wrapper,.modal-shadow{border-radius:var(--border-radius);width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow);overflow:var(--overflow);z-index:10}.modal-shadow{position:absolute;background:transparent}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--width:600px;--height:500px}}@media only screen and (min-width: 768px) and (min-height: 768px){:host{--width:600px;--height:600px}}.modal-handle{left:0px;right:0px;top:5px;border-radius:8px;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;position:absolute;width:36px;height:5px;-webkit-transform:translateZ(0);transform:translateZ(0);border:0;background:var(--ion-color-step-350, var(--ion-background-color-step-350, #c0c0be));cursor:pointer;z-index:11}.modal-handle::before{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:4px;padding-inline-end:4px;padding-top:4px;padding-bottom:4px;position:absolute;width:36px;height:5px;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);content:""}:host(.modal-sheet){--height:calc(100% - (var(--ion-safe-area-top) + 10px))}:host(.modal-sheet) .modal-wrapper,:host(.modal-sheet) .modal-shadow{position:absolute;bottom:0}:host(.modal-sheet.modal-no-expand-scroll) ion-footer{position:absolute;bottom:0;width:var(--width)}:host{--backdrop-opacity:var(--ion-backdrop-opacity, 0.32)}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--border-radius:2px;--box-shadow:0 28px 48px rgba(0, 0, 0, 0.4)}}.modal-wrapper{-webkit-transform:translate3d(0, 40px, 0);transform:translate3d(0, 40px, 0);opacity:0.01}'};export{et as ion_modal}
@@ -1,4 +0,0 @@
1
- /*!
2
- * (C) Ionic http://ionicframework.com - MIT License
3
- */
4
- import{r as t,c as o,f as e,h as r,d as i,g as s}from"./p-C8IsBmNU.js";import{B as n,j as a,k as p,f as c,n as d,g as h,h as l,F as v}from"./p-DdR6rpbR.js";import{C as f,a as g,d as m}from"./p-D-eFFUkA.js";import{g as x,r as b,f as u,h as w}from"./p-CTfR9YZG.js";import{c as k}from"./p-B-hirT0v.js";import{b as y,a as D}from"./p-BFvmZNyx.js";import{g as P}from"./p-DiVJyqlX.js";import{e as T,w as $}from"./p-DUt5fQmA.js";import{c as A}from"./p-DDb5r57F.js";import"./p-ZjP4CjeZ.js";import"./p-B0q1YL7N.js";import"./p-BTEOs1at.js";const I=(t,o,e)=>{const r=o.getBoundingClientRect(),i=r.height;let s=r.width;return"cover"===t&&e&&(s=e.getBoundingClientRect().width),{contentWidth:s,contentHeight:i}},N=(t,o)=>o&&"ION-ITEM"===o.tagName?t.findIndex((t=>t===o)):-1,j=t=>{const o=x(t).querySelector("button");o&&b((()=>o.focus()))},L=(t,o,e,r,i,s,n,a,p,c,d)=>{var h;let l={top:0,left:0,width:0,height:0};if("event"===s){if(!d)return p;l={top:d.clientY,left:d.clientX,width:1,height:1}}else{const t=c||(null===(h=null==d?void 0:d.detail)||void 0===h?void 0:h.ionShadowTarget)||(null==d?void 0:d.target);if(!t)return p;const o=t.getBoundingClientRect();l={top:o.top,left:o.left,width:o.width,height:o.height}}const v=z(n,l,o,e,r,i,t),f=X(a,n,l,o,e),g=v.top+f.top,m=v.left+f.left,{arrowTop:x,arrowLeft:b}=Y(n,r,i,g,m,o,e,t),{originX:u,originY:w}=C(n,a,t);return{top:g,left:m,referenceCoordinates:l,arrowTop:x,arrowLeft:b,originX:u,originY:w}},C=(t,o,e)=>{switch(t){case"top":return{originX:O(o),originY:"bottom"};case"bottom":return{originX:O(o),originY:"top"};case"left":return{originX:"right",originY:W(o)};case"right":return{originX:"left",originY:W(o)};case"start":return{originX:e?"left":"right",originY:W(o)};case"end":return{originX:e?"right":"left",originY:W(o)}}},O=t=>{switch(t){case"start":return"left";case"center":return"center";case"end":return"right"}},W=t=>{switch(t){case"start":return"top";case"center":return"center";case"end":return"bottom"}},Y=(t,o,e,r,i,s,n,a)=>{const p={arrowTop:r+n/2-o/2,arrowLeft:i+s-o/2},c={arrowTop:r+n/2-o/2,arrowLeft:i-1.5*o};switch(t){case"top":return{arrowTop:r+n,arrowLeft:i+s/2-o/2};case"bottom":return{arrowTop:r-e,arrowLeft:i+s/2-o/2};case"left":return p;case"right":return c;case"start":return a?c:p;case"end":return a?p:c;default:return{arrowTop:0,arrowLeft:0}}},z=(t,o,e,r,i,s,n)=>{const a={top:o.top,left:o.left-e-i},p={top:o.top,left:o.left+o.width+i};switch(t){case"top":return{top:o.top-r-s,left:o.left};case"right":return p;case"bottom":return{top:o.top+o.height+s,left:o.left};case"left":return a;case"start":return n?p:a;case"end":return n?a:p}},X=(t,o,e,r,i)=>{switch(t){case"center":return E(o,e,r,i);case"end":return B(o,e,r,i);default:return{top:0,left:0}}},B=(t,o,e,r)=>{switch(t){case"start":case"end":case"left":case"right":return{top:-(r-o.height),left:0};default:return{top:0,left:-(e-o.width)}}},E=(t,o,e,r)=>{switch(t){case"start":case"end":case"left":case"right":return{top:-(r/2-o.height/2),left:0};default:return{top:0,left:-(e/2-o.width/2)}}},S=(t,o,e,r,i,s,n,a,p,c,d,h,l=0,v=0,f=0)=>{let g=l;const m=v;let x,b=e,u=o,w=c,k=d,y=!1,D=!1,P=!1,T=!1;const $=h?h.top+h.height:s/2-a/2,A=h?h.height:0;let I=!1;return b<r+p?(b=r,P=!0,w="left"):n+r+b+p>i&&(T=!0,b=i-n-r,w="right"),$+A+a>s&&("top"===t||"bottom"===t)&&($-a>0?(u=Math.max(r,$-a-A-(f-1)),g=u+a,k="bottom",I=!0,u<=r+p&&(y=!0,u=r)):(x=r,D=!0)),(void 0!==x?s-x:u+a)+p>s&&(D=!0),u<p&&(y=!0),{top:u,left:b,bottom:x,originX:w,originY:k,checkSafeAreaTop:y,checkSafeAreaBottom:D,checkSafeAreaLeft:P,checkSafeAreaRight:T,arrowTop:g,arrowLeft:m,addPopoverBottomClass:I}},R=(t,o)=>{var e;const{event:r,size:i,trigger:s,reference:n,side:a,align:p}=o,c=t.ownerDocument,d="rtl"===c.dir,h=c.defaultView.innerWidth,l=c.defaultView.innerHeight,v=x(t),f=v.querySelector(".popover-content"),g=v.querySelector(".popover-arrow"),m=s||(null===(e=null==r?void 0:r.detail)||void 0===e?void 0:e.ionShadowTarget)||(null==r?void 0:r.target),{contentWidth:b,contentHeight:u}=I(i,f,m),{arrowWidth:w,arrowHeight:k}=(t=>{if(!t)return{arrowWidth:0,arrowHeight:0};const{width:o,height:e}=t.getBoundingClientRect();return{arrowWidth:o,arrowHeight:e}})(g),y=L(d,b,u,w,k,n,a,p,{top:l/2-u/2,left:h/2-b/2,originX:d?"right":"left",originY:"top"},s,r),D="cover"===i?0:5,P="cover"===i?0:25,{originX:T,originY:$,top:N,left:j,bottom:C,checkSafeAreaTop:O,checkSafeAreaBottom:W,checkSafeAreaLeft:Y,checkSafeAreaRight:z,arrowTop:X,arrowLeft:B,addPopoverBottomClass:E}=S(a,y.top,y.left,D,h,l,b,u,P,y.originX,y.originY,y.referenceCoordinates,y.arrowTop,y.arrowLeft,k),R=A(),H=A(),F=A();return H.addElement(v.querySelector("ion-backdrop")).fromTo("opacity",.01,"var(--backdrop-opacity)").beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"]),F.addElement(v.querySelector(".popover-arrow")).addElement(v.querySelector(".popover-content")).fromTo("opacity",.01,1),R.easing("ease").duration(100).beforeAddWrite((()=>{"cover"===i&&t.style.setProperty("--width",`${b}px`),E&&t.classList.add("popover-bottom");let o=`${N}px`,e=void 0!==C?`${C}px`:void 0,n=`${j}px`;if(O&&(o=`${N}px + var(--ion-safe-area-top, 0)`),W&&void 0!==e&&(e=`${C}px + var(--ion-safe-area-bottom, 0)`),Y&&(n=`${j}px + var(--ion-safe-area-left, 0)`),z&&(n=`${j}px - var(--ion-safe-area-right, 0)`),void 0!==e&&f.style.setProperty("bottom",`calc(${e})`),f.style.setProperty("top",`calc(${o} + var(--offset-y, 0))`),f.style.setProperty("left",`calc(${n} + var(--offset-x, 0))`),f.style.setProperty("transform-origin",`${$} ${T}`),null!==g){const t=((t,o=!1,e,r)=>!(!e&&!r||"top"!==t&&"bottom"!==t&&o))(a,y.top!==N||y.left!==j,r,s);t?(g.style.setProperty("top",`calc(${X}px + var(--offset-y, 0))`),g.style.setProperty("left",`calc(${B}px + var(--offset-x, 0))`)):g.style.setProperty("display","none")}})).addAnimation([H,F])},H=t=>{const o=x(t),e=o.querySelector(".popover-content"),r=o.querySelector(".popover-arrow"),i=A(),s=A(),n=A();return s.addElement(o.querySelector("ion-backdrop")).fromTo("opacity","var(--backdrop-opacity)",0),n.addElement(o.querySelector(".popover-arrow")).addElement(o.querySelector(".popover-content")).fromTo("opacity",.99,0),i.easing("ease").afterAddWrite((()=>{t.style.removeProperty("--width"),t.classList.remove("popover-bottom"),e.style.removeProperty("top"),e.style.removeProperty("left"),e.style.removeProperty("bottom"),e.style.removeProperty("transform-origin"),r&&(r.style.removeProperty("top"),r.style.removeProperty("left"),r.style.removeProperty("display"))})).duration(300).addAnimation([s,n])},F=(t,o)=>{var e;const{event:r,size:i,trigger:s,reference:n,side:a,align:p}=o,c=t.ownerDocument,d="rtl"===c.dir,h=c.defaultView.innerWidth,l=c.defaultView.innerHeight,v=x(t),f=v.querySelector(".popover-content"),g=s||(null===(e=null==r?void 0:r.detail)||void 0===e?void 0:e.ionShadowTarget)||(null==r?void 0:r.target),{contentWidth:m,contentHeight:b}=I(i,f,g),u=L(d,m,b,0,0,n,a,p,{top:l/2-b/2,left:h/2-m/2,originX:d?"right":"left",originY:"top"},s,r),w="cover"===i?0:12,{originX:k,originY:y,top:D,left:P,bottom:T,checkSafeAreaTop:$,checkSafeAreaBottom:N}=S(a,u.top,u.left,w,h,l,m,b,0,u.originX,u.originY,u.referenceCoordinates);let j=`${D}px`,C=void 0!==T?`${T}px`:void 0;$&&(j=`${D}px + var(--ion-safe-area-top, 0)`),N&&void 0!==C&&(C=`${T}px + var(--ion-safe-area-bottom, 0)`);const O=A(),W=A(),Y=A(),z=A(),X=A();return W.addElement(v.querySelector("ion-backdrop")).fromTo("opacity",.01,"var(--backdrop-opacity)").beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"]),Y.addElement(v.querySelector(".popover-wrapper")).duration(150).fromTo("opacity",.01,1),z.addElement(f).beforeStyles({top:`calc(${j} + var(--offset-y, 0px))`,left:`calc(${P}px + var(--offset-x, 0px))`,"transform-origin":`${y} ${k}`}).beforeAddWrite((()=>{void 0!==C&&f.style.setProperty("bottom",`calc(${C})`)})).fromTo("transform","scale(0.8)","scale(1)"),X.addElement(v.querySelector(".popover-viewport")).fromTo("opacity",.01,1),O.easing("cubic-bezier(0.36,0.66,0.04,1)").duration(300).beforeAddWrite((()=>{"cover"===i&&t.style.setProperty("--width",`${m}px`),"bottom"===y&&t.classList.add("popover-bottom")})).addAnimation([W,Y,z,X])},M=t=>{const o=x(t),e=o.querySelector(".popover-content"),r=A(),i=A(),s=A();return i.addElement(o.querySelector("ion-backdrop")).fromTo("opacity","var(--backdrop-opacity)",0),s.addElement(o.querySelector(".popover-wrapper")).fromTo("opacity",.99,0),r.easing("ease").afterAddWrite((()=>{t.style.removeProperty("--width"),t.classList.remove("popover-bottom"),e.style.removeProperty("top"),e.style.removeProperty("left"),e.style.removeProperty("bottom"),e.style.removeProperty("transform-origin")})).duration(150).addAnimation([i,s])},V=class{constructor(r){t(this,r),this.didPresent=o(this,"ionPopoverDidPresent",7),this.willPresent=o(this,"ionPopoverWillPresent",7),this.willDismiss=o(this,"ionPopoverWillDismiss",7),this.didDismiss=o(this,"ionPopoverDidDismiss",7),this.didPresentShorthand=o(this,"didPresent",7),this.willPresentShorthand=o(this,"willPresent",7),this.willDismissShorthand=o(this,"willDismiss",7),this.didDismissShorthand=o(this,"didDismiss",7),this.ionMount=o(this,"ionMount",7),this.parentPopover=null,this.coreDelegate=f(),this.lockController=k(),this.inline=!1,this.focusDescendantOnPresent=!1,this.presented=!1,this.hasController=!1,this.keyboardClose=!0,this.backdropDismiss=!0,this.showBackdrop=!0,this.translucent=!1,this.animated=!0,this.triggerAction="click",this.size="auto",this.dismissOnSelect=!1,this.reference="trigger",this.side="bottom",this.arrow=!0,this.isOpen=!1,this.keyboardEvents=!1,this.focusTrap=!0,this.keepContentsMounted=!1,this.onBackdropTap=()=>{this.dismiss(void 0,n)},this.onLifecycle=t=>{const o=this.usersElement,e=U[t.type];if(o&&e){const r=new CustomEvent(e,{bubbles:!1,cancelable:!1,detail:t.detail});o.dispatchEvent(r)}},this.configureTriggerInteraction=()=>{const{trigger:t,triggerAction:o,el:r,destroyTriggerInteraction:i}=this;if(i&&i(),void 0===t)return;const s=this.triggerEl=void 0!==t?document.getElementById(t):null;s?this.destroyTriggerInteraction=((t,o,e)=>{let r=[];switch(o){case"hover":let t;r=[{eventName:"mouseenter",callback:async o=>{o.stopPropagation(),t&&clearTimeout(t),t=setTimeout((()=>{b((()=>{e.presentFromTrigger(o),t=void 0}))}),100)}},{eventName:"mouseleave",callback:o=>{t&&clearTimeout(t);const r=o.relatedTarget;r&&r.closest("ion-popover")!==e&&e.dismiss(void 0,void 0,!1)}},{eventName:"click",callback:t=>t.stopPropagation()},{eventName:"ionPopoverActivateTrigger",callback:t=>e.presentFromTrigger(t,!0)}];break;case"context-menu":r=[{eventName:"contextmenu",callback:t=>{t.preventDefault(),e.presentFromTrigger(t)}},{eventName:"click",callback:t=>t.stopPropagation()},{eventName:"ionPopoverActivateTrigger",callback:t=>e.presentFromTrigger(t,!0)}];break;default:r=[{eventName:"click",callback:t=>e.presentFromTrigger(t)},{eventName:"ionPopoverActivateTrigger",callback:t=>e.presentFromTrigger(t,!0)}]}return r.forEach((({eventName:o,callback:e})=>t.addEventListener(o,e))),t.setAttribute("data-ion-popover-trigger","true"),()=>{r.forEach((({eventName:o,callback:e})=>t.removeEventListener(o,e))),t.removeAttribute("data-ion-popover-trigger")}})(s,o,r):e(`[ion-popover] - A trigger element with the ID "${t}" was not found in the DOM. The trigger element must be in the DOM when the "trigger" property is set on ion-popover.`,this.el)},this.configureKeyboardInteraction=()=>{const{destroyKeyboardInteraction:t,el:o}=this;t&&t(),this.destroyKeyboardInteraction=(t=>{const o=async o=>{var e;const r=document.activeElement;let i=[];const s=null===(e=o.target)||void 0===e?void 0:e.tagName;if("ION-POPOVER"===s||"ION-ITEM"===s){try{i=Array.from(t.querySelectorAll("ion-item:not(ion-popover ion-popover *):not([disabled])"))}catch(t){}switch(o.key){case"ArrowLeft":await t.getParentPopover()&&t.dismiss(void 0,void 0,!1);break;case"ArrowDown":o.preventDefault();const e=((t,o)=>t[N(t,o)+1])(i,r);void 0!==e&&j(e);break;case"ArrowUp":o.preventDefault();const s=((t,o)=>t[N(t,o)-1])(i,r);void 0!==s&&j(s);break;case"Home":o.preventDefault();const n=i[0];void 0!==n&&j(n);break;case"End":o.preventDefault();const a=i[i.length-1];void 0!==a&&j(a);break;case"ArrowRight":case" ":case"Enter":if(r&&r.hasAttribute("data-ion-popover-trigger")){const t=new CustomEvent("ionPopoverActivateTrigger");r.dispatchEvent(t)}}}};return t.addEventListener("keydown",o),()=>t.removeEventListener("keydown",o)})(o)},this.configureDismissInteraction=()=>{const{destroyDismissInteraction:t,parentPopover:o,triggerAction:e,triggerEl:r,el:i}=this;o&&r&&(t&&t(),this.destroyDismissInteraction=((t,o,e,r)=>{let i=[];const s=x(r).querySelector(".popover-content");return i="hover"===o?[{eventName:"mouseenter",callback:o=>{document.elementFromPoint(o.clientX,o.clientY)!==t&&e.dismiss(void 0,void 0,!1)}}]:[{eventName:"click",callback:o=>{o.target.closest("[data-ion-popover-trigger]")!==t?e.dismiss(void 0,void 0,!1):o.stopPropagation()}}],i.forEach((({eventName:t,callback:o})=>s.addEventListener(t,o))),()=>{i.forEach((({eventName:t,callback:o})=>s.removeEventListener(t,o)))}})(r,e,i,o))}}onTriggerChange(){this.configureTriggerInteraction()}onIsOpenChange(t,o){!0===t&&!1===o?this.present():!1===t&&!0===o&&this.dismiss()}connectedCallback(){const{configureTriggerInteraction:t,el:o}=this;a(o),t()}disconnectedCallback(){const{destroyTriggerInteraction:t}=this;t&&t(),this.headerResizeObserver&&(this.headerResizeObserver.disconnect(),this.headerResizeObserver=void 0)}componentWillLoad(){var t,o;const{el:e}=this,r=null!==(o=null===(t=this.htmlAttributes)||void 0===t?void 0:t.id)&&void 0!==o?o:p(e);this.parentPopover=e.closest(`ion-popover:not(#${r})`),void 0===this.alignment&&(this.alignment="ios"===y(this)?"center":"start")}componentDidLoad(){const{parentPopover:t,isOpen:o}=this;!0===o&&b((()=>this.present())),t&&u(t,"ionPopoverWillDismiss",(()=>{this.dismiss(void 0,void 0,!1)})),this.configureTriggerInteraction()}async presentFromTrigger(t,o=!1){this.focusDescendantOnPresent=o,await this.present(t),this.focusDescendantOnPresent=!1}getDelegate(t=!1){if(this.workingDelegate&&!t)return{delegate:this.workingDelegate,inline:this.inline};const o=this.inline=null!==this.el.parentNode&&!this.hasController;return{inline:o,delegate:this.workingDelegate=o?this.delegate||this.coreDelegate:this.delegate}}async present(t){const o=await this.lockController.lock();if(this.presented)return void o();const{el:e}=this,{inline:r,delegate:i}=this.getDelegate(!0);this.ionMount.emit(),this.usersElement=await g(i,e,this.component,["popover-viewport"],this.componentProps,r),this.recalculateContentOnHeaderReady(),this.keyboardEvents||this.configureKeyboardInteraction(),this.configureDismissInteraction(),w(e)?await T(this.usersElement):this.keepContentsMounted||await $(),await c(this,"popoverEnter",R,F,{event:t||this.event,size:this.size,trigger:this.triggerEl,reference:this.reference,side:this.side,align:this.alignment}),this.focusDescendantOnPresent&&d(e),o()}recalculateContentOnHeaderReady(){var t;const o=null===(t=this.el.shadowRoot)||void 0===t?void 0:t.querySelector(".popover-content");if(!o)return;const e=this.usersElement||o,r=e.querySelector("ion-header"),i=e.querySelectorAll("ion-content");r&&0!==i.length&&(this.headerResizeObserver=new ResizeObserver((async()=>{var t;if(r.offsetHeight>0){null===(t=this.headerResizeObserver)||void 0===t||t.disconnect(),this.headerResizeObserver=void 0;for(const t of i)await t.recalculateDimensions()}})),this.headerResizeObserver.observe(r))}async dismiss(t,o,e=!0){const r=await this.lockController.lock(),{destroyKeyboardInteraction:i,destroyDismissInteraction:s}=this;e&&this.parentPopover&&this.parentPopover.dismiss(t,o,e);const n=await h(this,t,o,"popoverLeave",H,M,this.event);if(n){i&&(i(),this.destroyKeyboardInteraction=void 0),s&&(s(),this.destroyDismissInteraction=void 0);const{delegate:t}=this.getDelegate();await m(t,this.usersElement)}return r(),n}async getParentPopover(){return this.parentPopover}onDidDismiss(){return l(this.el,"ionPopoverDidDismiss")}onWillDismiss(){return l(this.el,"ionPopoverWillDismiss")}render(){const t=y(this),{onLifecycle:o,parentPopover:e,dismissOnSelect:s,side:n,arrow:a,htmlAttributes:p,focusTrap:c}=this,d=D("desktop"),h=a&&!e;return r(i,Object.assign({key:"42863f748c93f709d433931d969230137b37d42d","aria-modal":"true","no-router":!0,tabindex:"-1"},p,{style:{zIndex:`${2e4+this.overlayIndex}`},class:Object.assign(Object.assign({},P(this.cssClass)),{[t]:!0,"popover-translucent":this.translucent,"overlay-hidden":!0,"popover-desktop":d,[`popover-side-${n}`]:!0,[v]:!1===c,"popover-nested":!!e}),onIonPopoverDidPresent:o,onIonPopoverWillPresent:o,onIonPopoverWillDismiss:o,onIonPopoverDidDismiss:o,onIonBackdropTap:this.onBackdropTap}),!e&&r("ion-backdrop",{key:"22b6d82178b52158b76ab3fd9a7dd738fd6e4bbf",tappable:this.backdropDismiss,visible:this.showBackdrop,part:"backdrop"}),r("div",{key:"b76335c64e992a964ed3fb91d17a992c3474b4cd",class:"popover-wrapper ion-overlay-wrapper",onClick:s?()=>this.dismiss():void 0},h&&r("div",{key:"018c846c32e7ff7fa010528e6b37a17e5f03c84c",class:"popover-arrow",part:"arrow"}),r("div",{key:"350c468c80052da3a07768bceab98fe159c35a43",class:"popover-content",part:"content"},r("slot",{key:"686443c17ac9873d33905c1cdb67e6d6da675282"}))))}get el(){return s(this)}static get watchers(){return{trigger:["onTriggerChange"],triggerAction:["onTriggerChange"],isOpen:["onIsOpenChange"]}}},U={ionPopoverDidPresent:"ionViewDidEnter",ionPopoverWillPresent:"ionViewWillEnter",ionPopoverWillDismiss:"ionViewWillLeave",ionPopoverDidDismiss:"ionViewDidLeave"};V.style={ios:':host{--background:var(--ion-background-color, #fff);--min-width:0;--min-height:0;--max-width:auto;--height:auto;--offset-x:0px;--offset-y:0px;left:0;right:0;top:0;bottom:0;display:-ms-flexbox;display:flex;position:fixed;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;outline:none;color:var(--ion-text-color, #000);z-index:1001}:host(.popover-nested){pointer-events:none}:host(.popover-nested) .popover-wrapper{pointer-events:auto}:host(.overlay-hidden){display:none}.popover-wrapper{z-index:10}.popover-content{display:-ms-flexbox;display:flex;position:absolute;-ms-flex-direction:column;flex-direction:column;width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);background:var(--background);-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow);overflow:auto;z-index:10}::slotted(.popover-viewport){--ion-safe-area-top:0px;--ion-safe-area-right:0px;--ion-safe-area-bottom:0px;--ion-safe-area-left:0px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host(.popover-nested.popover-side-left){--offset-x:5px}:host(.popover-nested.popover-side-right){--offset-x:-5px}:host(.popover-nested.popover-side-start){--offset-x:5px}:host-context([dir=rtl]):host(.popover-nested.popover-side-start),:host-context([dir=rtl]).popover-nested.popover-side-start{--offset-x:-5px}@supports selector(:dir(rtl)){:host(.popover-nested.popover-side-start:dir(rtl)){--offset-x:-5px}}:host(.popover-nested.popover-side-end){--offset-x:-5px}:host-context([dir=rtl]):host(.popover-nested.popover-side-end),:host-context([dir=rtl]).popover-nested.popover-side-end{--offset-x:5px}@supports selector(:dir(rtl)){:host(.popover-nested.popover-side-end:dir(rtl)){--offset-x:5px}}:host{--width:200px;--max-height:90%;--box-shadow:none;--backdrop-opacity:var(--ion-backdrop-opacity, 0.08)}:host(.popover-desktop){--box-shadow:0px 4px 16px 0px rgba(0, 0, 0, 0.12)}.popover-content{border-radius:10px}:host(.popover-desktop) .popover-content{border:0.5px solid var(--ion-color-step-100, var(--ion-background-color-step-100, #e6e6e6))}.popover-arrow{display:block;position:absolute;width:20px;height:10px;overflow:hidden;z-index:11}.popover-arrow::after{top:3px;border-radius:3px;position:absolute;width:14px;height:14px;-webkit-transform:rotate(45deg);transform:rotate(45deg);background:var(--background);content:"";z-index:10}.popover-arrow::after{inset-inline-start:3px}:host(.popover-bottom) .popover-arrow{top:auto;bottom:-10px}:host(.popover-bottom) .popover-arrow::after{top:-6px}:host(.popover-side-left) .popover-arrow{-webkit-transform:rotate(90deg);transform:rotate(90deg)}:host(.popover-side-right) .popover-arrow{-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}:host(.popover-side-top) .popover-arrow{-webkit-transform:rotate(180deg);transform:rotate(180deg)}:host(.popover-side-start) .popover-arrow{-webkit-transform:rotate(90deg);transform:rotate(90deg)}:host-context([dir=rtl]):host(.popover-side-start) .popover-arrow,:host-context([dir=rtl]).popover-side-start .popover-arrow{-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}@supports selector(:dir(rtl)){:host(.popover-side-start:dir(rtl)) .popover-arrow{-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}}:host(.popover-side-end) .popover-arrow{-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}:host-context([dir=rtl]):host(.popover-side-end) .popover-arrow,:host-context([dir=rtl]).popover-side-end .popover-arrow{-webkit-transform:rotate(90deg);transform:rotate(90deg)}@supports selector(:dir(rtl)){:host(.popover-side-end:dir(rtl)) .popover-arrow{-webkit-transform:rotate(90deg);transform:rotate(90deg)}}.popover-arrow,.popover-content{opacity:0}@supports ((-webkit-backdrop-filter: blur(0)) or (backdrop-filter: blur(0))){:host(.popover-translucent) .popover-content,:host(.popover-translucent) .popover-arrow::after{background:rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8);-webkit-backdrop-filter:saturate(180%) blur(20px);backdrop-filter:saturate(180%) blur(20px)}}',md:":host{--background:var(--ion-background-color, #fff);--min-width:0;--min-height:0;--max-width:auto;--height:auto;--offset-x:0px;--offset-y:0px;left:0;right:0;top:0;bottom:0;display:-ms-flexbox;display:flex;position:fixed;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;outline:none;color:var(--ion-text-color, #000);z-index:1001}:host(.popover-nested){pointer-events:none}:host(.popover-nested) .popover-wrapper{pointer-events:auto}:host(.overlay-hidden){display:none}.popover-wrapper{z-index:10}.popover-content{display:-ms-flexbox;display:flex;position:absolute;-ms-flex-direction:column;flex-direction:column;width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);background:var(--background);-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow);overflow:auto;z-index:10}::slotted(.popover-viewport){--ion-safe-area-top:0px;--ion-safe-area-right:0px;--ion-safe-area-bottom:0px;--ion-safe-area-left:0px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host(.popover-nested.popover-side-left){--offset-x:5px}:host(.popover-nested.popover-side-right){--offset-x:-5px}:host(.popover-nested.popover-side-start){--offset-x:5px}:host-context([dir=rtl]):host(.popover-nested.popover-side-start),:host-context([dir=rtl]).popover-nested.popover-side-start{--offset-x:-5px}@supports selector(:dir(rtl)){:host(.popover-nested.popover-side-start:dir(rtl)){--offset-x:-5px}}:host(.popover-nested.popover-side-end){--offset-x:-5px}:host-context([dir=rtl]):host(.popover-nested.popover-side-end),:host-context([dir=rtl]).popover-nested.popover-side-end{--offset-x:5px}@supports selector(:dir(rtl)){:host(.popover-nested.popover-side-end:dir(rtl)){--offset-x:5px}}:host{--width:250px;--max-height:90%;--box-shadow:0 5px 5px -3px rgba(0, 0, 0, 0.2), 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12);--backdrop-opacity:var(--ion-backdrop-opacity, 0.32)}.popover-content{border-radius:4px;-webkit-transform-origin:left top;transform-origin:left top}:host-context([dir=rtl]) .popover-content{-webkit-transform-origin:right top;transform-origin:right top}[dir=rtl] .popover-content{-webkit-transform-origin:right top;transform-origin:right top}@supports selector(:dir(rtl)){.popover-content:dir(rtl){-webkit-transform-origin:right top;transform-origin:right top}}.popover-viewport{-webkit-transition-delay:100ms;transition-delay:100ms}.popover-wrapper{opacity:0}"};export{V as ion_popover}