@ionic/core 8.5.8-dev.11748374591.17686118 → 8.5.8-dev.11748450896.16232653
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/components/modal.js +25 -11
- package/dist/cjs/ion-modal.cjs.entry.js +25 -11
- package/dist/collection/components/modal/gestures/sheet.js +25 -11
- package/dist/docs.json +1 -1
- package/dist/esm/ion-modal.entry.js +25 -11
- package/dist/esm-es5/ion-modal.entry.js +1 -1
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/{p-b7242f55.entry.js → p-b1e199b2.entry.js} +1 -1
- package/dist/ionic/p-f2367bf2.system.entry.js +4 -0
- package/dist/ionic/p-f725bf9e.system.js +1 -1
- package/hydrate/index.js +25 -11
- package/hydrate/index.mjs +25 -11
- package/package.json +1 -1
- package/dist/ionic/p-db06d822.system.entry.js +0 -4
package/components/modal.js
CHANGED
|
@@ -876,12 +876,18 @@ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, ba
|
|
|
876
876
|
// Reset positioning styles to allow normal document flow
|
|
877
877
|
cachedFooterEl.classList.remove('modal-footer-moving');
|
|
878
878
|
cachedFooterEl.style.removeProperty('position');
|
|
879
|
-
cachedFooterEl.style.removeProperty('
|
|
879
|
+
cachedFooterEl.style.removeProperty('width');
|
|
880
|
+
cachedFooterEl.style.removeProperty('height');
|
|
881
|
+
cachedFooterEl.style.removeProperty('top');
|
|
882
|
+
cachedFooterEl.style.removeProperty('left');
|
|
880
883
|
page === null || page === void 0 ? void 0 : page.style.removeProperty('padding-bottom');
|
|
881
884
|
// Move to page
|
|
882
885
|
page === null || page === void 0 ? void 0 : page.appendChild(cachedFooterEl);
|
|
883
886
|
}
|
|
884
887
|
else {
|
|
888
|
+
// Get both the footer and document body positions
|
|
889
|
+
const cachedFooterElRect = cachedFooterEl.getBoundingClientRect();
|
|
890
|
+
const bodyRect = document.body.getBoundingClientRect();
|
|
885
891
|
// Add padding to the parent element to prevent content from being hidden
|
|
886
892
|
// when the footer is positioned absolutely. This has to be done before we
|
|
887
893
|
// make the footer absolutely positioned or we may accidentally cause the
|
|
@@ -890,12 +896,20 @@ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, ba
|
|
|
890
896
|
page === null || page === void 0 ? void 0 : page.style.setProperty('padding-bottom', `${footerHeight}px`);
|
|
891
897
|
// Apply positioning styles to keep footer at bottom
|
|
892
898
|
cachedFooterEl.classList.add('modal-footer-moving');
|
|
899
|
+
// Calculate absolute position relative to body
|
|
900
|
+
// We need to subtract the body's offsetTop to get true position within document.body
|
|
901
|
+
const absoluteTop = cachedFooterElRect.top - bodyRect.top;
|
|
902
|
+
const absoluteLeft = cachedFooterElRect.left - bodyRect.left;
|
|
903
|
+
// Capture the footer's current dimensions and hard code them during the drag
|
|
893
904
|
cachedFooterEl.style.setProperty('position', 'absolute');
|
|
894
|
-
cachedFooterEl.style.setProperty('
|
|
905
|
+
cachedFooterEl.style.setProperty('width', `${cachedFooterEl.clientWidth}px`);
|
|
906
|
+
cachedFooterEl.style.setProperty('height', `${cachedFooterEl.clientHeight}px`);
|
|
907
|
+
cachedFooterEl.style.setProperty('top', `${absoluteTop}px`);
|
|
908
|
+
cachedFooterEl.style.setProperty('left', `${absoluteLeft}px`);
|
|
895
909
|
// Also cache the footer Y position, which we use to determine if the
|
|
896
910
|
// sheet has been moved below the footer. When that happens, we need to swap
|
|
897
911
|
// the position back so it will collapse correctly.
|
|
898
|
-
cachedFooterYPosition =
|
|
912
|
+
cachedFooterYPosition = absoluteTop;
|
|
899
913
|
document.body.appendChild(cachedFooterEl);
|
|
900
914
|
}
|
|
901
915
|
};
|
|
@@ -1178,18 +1192,18 @@ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, ba
|
|
|
1178
1192
|
if (contentEl && (snapToBreakpoint === breakpoints[breakpoints.length - 1] || !expandToScroll)) {
|
|
1179
1193
|
contentEl.scrollY = true;
|
|
1180
1194
|
}
|
|
1195
|
+
/**
|
|
1196
|
+
* If expandToScroll is disabled, we need to swap
|
|
1197
|
+
* the footer position to stationary so that it
|
|
1198
|
+
* will act as it would by default
|
|
1199
|
+
*/
|
|
1200
|
+
if (!expandToScroll) {
|
|
1201
|
+
swapFooterPosition('stationary');
|
|
1202
|
+
}
|
|
1181
1203
|
return new Promise((resolve) => {
|
|
1182
1204
|
animation
|
|
1183
1205
|
.onFinish(() => {
|
|
1184
1206
|
if (shouldRemainOpen) {
|
|
1185
|
-
/**
|
|
1186
|
-
* If expandToScroll is disabled, we need to swap
|
|
1187
|
-
* the footer position to stationary so that it
|
|
1188
|
-
* will act as it would by default
|
|
1189
|
-
*/
|
|
1190
|
-
if (!expandToScroll) {
|
|
1191
|
-
swapFooterPosition('stationary');
|
|
1192
|
-
}
|
|
1193
1207
|
/**
|
|
1194
1208
|
* Once the snapping animation completes,
|
|
1195
1209
|
* we need to reset the animation to go
|
|
@@ -882,12 +882,18 @@ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, ba
|
|
|
882
882
|
// Reset positioning styles to allow normal document flow
|
|
883
883
|
cachedFooterEl.classList.remove('modal-footer-moving');
|
|
884
884
|
cachedFooterEl.style.removeProperty('position');
|
|
885
|
-
cachedFooterEl.style.removeProperty('
|
|
885
|
+
cachedFooterEl.style.removeProperty('width');
|
|
886
|
+
cachedFooterEl.style.removeProperty('height');
|
|
887
|
+
cachedFooterEl.style.removeProperty('top');
|
|
888
|
+
cachedFooterEl.style.removeProperty('left');
|
|
886
889
|
page === null || page === void 0 ? void 0 : page.style.removeProperty('padding-bottom');
|
|
887
890
|
// Move to page
|
|
888
891
|
page === null || page === void 0 ? void 0 : page.appendChild(cachedFooterEl);
|
|
889
892
|
}
|
|
890
893
|
else {
|
|
894
|
+
// Get both the footer and document body positions
|
|
895
|
+
const cachedFooterElRect = cachedFooterEl.getBoundingClientRect();
|
|
896
|
+
const bodyRect = document.body.getBoundingClientRect();
|
|
891
897
|
// Add padding to the parent element to prevent content from being hidden
|
|
892
898
|
// when the footer is positioned absolutely. This has to be done before we
|
|
893
899
|
// make the footer absolutely positioned or we may accidentally cause the
|
|
@@ -896,12 +902,20 @@ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, ba
|
|
|
896
902
|
page === null || page === void 0 ? void 0 : page.style.setProperty('padding-bottom', `${footerHeight}px`);
|
|
897
903
|
// Apply positioning styles to keep footer at bottom
|
|
898
904
|
cachedFooterEl.classList.add('modal-footer-moving');
|
|
905
|
+
// Calculate absolute position relative to body
|
|
906
|
+
// We need to subtract the body's offsetTop to get true position within document.body
|
|
907
|
+
const absoluteTop = cachedFooterElRect.top - bodyRect.top;
|
|
908
|
+
const absoluteLeft = cachedFooterElRect.left - bodyRect.left;
|
|
909
|
+
// Capture the footer's current dimensions and hard code them during the drag
|
|
899
910
|
cachedFooterEl.style.setProperty('position', 'absolute');
|
|
900
|
-
cachedFooterEl.style.setProperty('
|
|
911
|
+
cachedFooterEl.style.setProperty('width', `${cachedFooterEl.clientWidth}px`);
|
|
912
|
+
cachedFooterEl.style.setProperty('height', `${cachedFooterEl.clientHeight}px`);
|
|
913
|
+
cachedFooterEl.style.setProperty('top', `${absoluteTop}px`);
|
|
914
|
+
cachedFooterEl.style.setProperty('left', `${absoluteLeft}px`);
|
|
901
915
|
// Also cache the footer Y position, which we use to determine if the
|
|
902
916
|
// sheet has been moved below the footer. When that happens, we need to swap
|
|
903
917
|
// the position back so it will collapse correctly.
|
|
904
|
-
cachedFooterYPosition =
|
|
918
|
+
cachedFooterYPosition = absoluteTop;
|
|
905
919
|
document.body.appendChild(cachedFooterEl);
|
|
906
920
|
}
|
|
907
921
|
};
|
|
@@ -1184,18 +1198,18 @@ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, ba
|
|
|
1184
1198
|
if (contentEl && (snapToBreakpoint === breakpoints[breakpoints.length - 1] || !expandToScroll)) {
|
|
1185
1199
|
contentEl.scrollY = true;
|
|
1186
1200
|
}
|
|
1201
|
+
/**
|
|
1202
|
+
* If expandToScroll is disabled, we need to swap
|
|
1203
|
+
* the footer position to stationary so that it
|
|
1204
|
+
* will act as it would by default
|
|
1205
|
+
*/
|
|
1206
|
+
if (!expandToScroll) {
|
|
1207
|
+
swapFooterPosition('stationary');
|
|
1208
|
+
}
|
|
1187
1209
|
return new Promise((resolve) => {
|
|
1188
1210
|
animation
|
|
1189
1211
|
.onFinish(() => {
|
|
1190
1212
|
if (shouldRemainOpen) {
|
|
1191
|
-
/**
|
|
1192
|
-
* If expandToScroll is disabled, we need to swap
|
|
1193
|
-
* the footer position to stationary so that it
|
|
1194
|
-
* will act as it would by default
|
|
1195
|
-
*/
|
|
1196
|
-
if (!expandToScroll) {
|
|
1197
|
-
swapFooterPosition('stationary');
|
|
1198
|
-
}
|
|
1199
1213
|
/**
|
|
1200
1214
|
* Once the snapping animation completes,
|
|
1201
1215
|
* we need to reset the animation to go
|
|
@@ -84,12 +84,18 @@ export const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpo
|
|
|
84
84
|
// Reset positioning styles to allow normal document flow
|
|
85
85
|
cachedFooterEl.classList.remove('modal-footer-moving');
|
|
86
86
|
cachedFooterEl.style.removeProperty('position');
|
|
87
|
-
cachedFooterEl.style.removeProperty('
|
|
87
|
+
cachedFooterEl.style.removeProperty('width');
|
|
88
|
+
cachedFooterEl.style.removeProperty('height');
|
|
89
|
+
cachedFooterEl.style.removeProperty('top');
|
|
90
|
+
cachedFooterEl.style.removeProperty('left');
|
|
88
91
|
page === null || page === void 0 ? void 0 : page.style.removeProperty('padding-bottom');
|
|
89
92
|
// Move to page
|
|
90
93
|
page === null || page === void 0 ? void 0 : page.appendChild(cachedFooterEl);
|
|
91
94
|
}
|
|
92
95
|
else {
|
|
96
|
+
// Get both the footer and document body positions
|
|
97
|
+
const cachedFooterElRect = cachedFooterEl.getBoundingClientRect();
|
|
98
|
+
const bodyRect = document.body.getBoundingClientRect();
|
|
93
99
|
// Add padding to the parent element to prevent content from being hidden
|
|
94
100
|
// when the footer is positioned absolutely. This has to be done before we
|
|
95
101
|
// make the footer absolutely positioned or we may accidentally cause the
|
|
@@ -98,12 +104,20 @@ export const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpo
|
|
|
98
104
|
page === null || page === void 0 ? void 0 : page.style.setProperty('padding-bottom', `${footerHeight}px`);
|
|
99
105
|
// Apply positioning styles to keep footer at bottom
|
|
100
106
|
cachedFooterEl.classList.add('modal-footer-moving');
|
|
107
|
+
// Calculate absolute position relative to body
|
|
108
|
+
// We need to subtract the body's offsetTop to get true position within document.body
|
|
109
|
+
const absoluteTop = cachedFooterElRect.top - bodyRect.top;
|
|
110
|
+
const absoluteLeft = cachedFooterElRect.left - bodyRect.left;
|
|
111
|
+
// Capture the footer's current dimensions and hard code them during the drag
|
|
101
112
|
cachedFooterEl.style.setProperty('position', 'absolute');
|
|
102
|
-
cachedFooterEl.style.setProperty('
|
|
113
|
+
cachedFooterEl.style.setProperty('width', `${cachedFooterEl.clientWidth}px`);
|
|
114
|
+
cachedFooterEl.style.setProperty('height', `${cachedFooterEl.clientHeight}px`);
|
|
115
|
+
cachedFooterEl.style.setProperty('top', `${absoluteTop}px`);
|
|
116
|
+
cachedFooterEl.style.setProperty('left', `${absoluteLeft}px`);
|
|
103
117
|
// Also cache the footer Y position, which we use to determine if the
|
|
104
118
|
// sheet has been moved below the footer. When that happens, we need to swap
|
|
105
119
|
// the position back so it will collapse correctly.
|
|
106
|
-
cachedFooterYPosition =
|
|
120
|
+
cachedFooterYPosition = absoluteTop;
|
|
107
121
|
document.body.appendChild(cachedFooterEl);
|
|
108
122
|
}
|
|
109
123
|
};
|
|
@@ -386,18 +400,18 @@ export const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpo
|
|
|
386
400
|
if (contentEl && (snapToBreakpoint === breakpoints[breakpoints.length - 1] || !expandToScroll)) {
|
|
387
401
|
contentEl.scrollY = true;
|
|
388
402
|
}
|
|
403
|
+
/**
|
|
404
|
+
* If expandToScroll is disabled, we need to swap
|
|
405
|
+
* the footer position to stationary so that it
|
|
406
|
+
* will act as it would by default
|
|
407
|
+
*/
|
|
408
|
+
if (!expandToScroll) {
|
|
409
|
+
swapFooterPosition('stationary');
|
|
410
|
+
}
|
|
389
411
|
return new Promise((resolve) => {
|
|
390
412
|
animation
|
|
391
413
|
.onFinish(() => {
|
|
392
414
|
if (shouldRemainOpen) {
|
|
393
|
-
/**
|
|
394
|
-
* If expandToScroll is disabled, we need to swap
|
|
395
|
-
* the footer position to stationary so that it
|
|
396
|
-
* will act as it would by default
|
|
397
|
-
*/
|
|
398
|
-
if (!expandToScroll) {
|
|
399
|
-
swapFooterPosition('stationary');
|
|
400
|
-
}
|
|
401
415
|
/**
|
|
402
416
|
* Once the snapping animation completes,
|
|
403
417
|
* we need to reset the animation to go
|
package/dist/docs.json
CHANGED
|
@@ -878,12 +878,18 @@ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, ba
|
|
|
878
878
|
// Reset positioning styles to allow normal document flow
|
|
879
879
|
cachedFooterEl.classList.remove('modal-footer-moving');
|
|
880
880
|
cachedFooterEl.style.removeProperty('position');
|
|
881
|
-
cachedFooterEl.style.removeProperty('
|
|
881
|
+
cachedFooterEl.style.removeProperty('width');
|
|
882
|
+
cachedFooterEl.style.removeProperty('height');
|
|
883
|
+
cachedFooterEl.style.removeProperty('top');
|
|
884
|
+
cachedFooterEl.style.removeProperty('left');
|
|
882
885
|
page === null || page === void 0 ? void 0 : page.style.removeProperty('padding-bottom');
|
|
883
886
|
// Move to page
|
|
884
887
|
page === null || page === void 0 ? void 0 : page.appendChild(cachedFooterEl);
|
|
885
888
|
}
|
|
886
889
|
else {
|
|
890
|
+
// Get both the footer and document body positions
|
|
891
|
+
const cachedFooterElRect = cachedFooterEl.getBoundingClientRect();
|
|
892
|
+
const bodyRect = document.body.getBoundingClientRect();
|
|
887
893
|
// Add padding to the parent element to prevent content from being hidden
|
|
888
894
|
// when the footer is positioned absolutely. This has to be done before we
|
|
889
895
|
// make the footer absolutely positioned or we may accidentally cause the
|
|
@@ -892,12 +898,20 @@ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, ba
|
|
|
892
898
|
page === null || page === void 0 ? void 0 : page.style.setProperty('padding-bottom', `${footerHeight}px`);
|
|
893
899
|
// Apply positioning styles to keep footer at bottom
|
|
894
900
|
cachedFooterEl.classList.add('modal-footer-moving');
|
|
901
|
+
// Calculate absolute position relative to body
|
|
902
|
+
// We need to subtract the body's offsetTop to get true position within document.body
|
|
903
|
+
const absoluteTop = cachedFooterElRect.top - bodyRect.top;
|
|
904
|
+
const absoluteLeft = cachedFooterElRect.left - bodyRect.left;
|
|
905
|
+
// Capture the footer's current dimensions and hard code them during the drag
|
|
895
906
|
cachedFooterEl.style.setProperty('position', 'absolute');
|
|
896
|
-
cachedFooterEl.style.setProperty('
|
|
907
|
+
cachedFooterEl.style.setProperty('width', `${cachedFooterEl.clientWidth}px`);
|
|
908
|
+
cachedFooterEl.style.setProperty('height', `${cachedFooterEl.clientHeight}px`);
|
|
909
|
+
cachedFooterEl.style.setProperty('top', `${absoluteTop}px`);
|
|
910
|
+
cachedFooterEl.style.setProperty('left', `${absoluteLeft}px`);
|
|
897
911
|
// Also cache the footer Y position, which we use to determine if the
|
|
898
912
|
// sheet has been moved below the footer. When that happens, we need to swap
|
|
899
913
|
// the position back so it will collapse correctly.
|
|
900
|
-
cachedFooterYPosition =
|
|
914
|
+
cachedFooterYPosition = absoluteTop;
|
|
901
915
|
document.body.appendChild(cachedFooterEl);
|
|
902
916
|
}
|
|
903
917
|
};
|
|
@@ -1180,18 +1194,18 @@ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, ba
|
|
|
1180
1194
|
if (contentEl && (snapToBreakpoint === breakpoints[breakpoints.length - 1] || !expandToScroll)) {
|
|
1181
1195
|
contentEl.scrollY = true;
|
|
1182
1196
|
}
|
|
1197
|
+
/**
|
|
1198
|
+
* If expandToScroll is disabled, we need to swap
|
|
1199
|
+
* the footer position to stationary so that it
|
|
1200
|
+
* will act as it would by default
|
|
1201
|
+
*/
|
|
1202
|
+
if (!expandToScroll) {
|
|
1203
|
+
swapFooterPosition('stationary');
|
|
1204
|
+
}
|
|
1183
1205
|
return new Promise((resolve) => {
|
|
1184
1206
|
animation
|
|
1185
1207
|
.onFinish(() => {
|
|
1186
1208
|
if (shouldRemainOpen) {
|
|
1187
|
-
/**
|
|
1188
|
-
* If expandToScroll is disabled, we need to swap
|
|
1189
|
-
* the footer position to stationary so that it
|
|
1190
|
-
* will act as it would by default
|
|
1191
|
-
*/
|
|
1192
|
-
if (!expandToScroll) {
|
|
1193
|
-
swapFooterPosition('stationary');
|
|
1194
|
-
}
|
|
1195
1209
|
/**
|
|
1196
1210
|
* Once the snapping animation completes,
|
|
1197
1211
|
* we need to reset the animation to go
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import{__awaiter,__generator,__spreadArray}from"tslib";
|
|
2
2
|
/*!
|
|
3
3
|
* (C) Ionic http://ionicframework.com - MIT License
|
|
4
|
-
*/import{r as registerInstance,c as createEvent,w as writeTask,h,e as Host,f as getElement}from"./index-527b9e34.js";import{f as findClosestIonContent,i as isIonContent,d as disableContentScrollY,r as resetContentScrollY,a as findIonContent,p as printIonContentErrorMsg}from"./index-9a17db3d.js";import{C as CoreDelegate,a as attachComponent,d as detachComponent}from"./framework-delegate-56b467ad.js";import{g as getElementRoot,j as clamp,r as raf,h as inheritAttributes,k as hasLazyBuild}from"./helpers-d94bc8ad.js";import{c as createLockController}from"./lock-controller-316928be.js";import{p as printIonWarning,c as config}from"./index-cfd9c1f2.js";import{g as getCapacitor}from"./capacitor-59395cbd.js";import{G as GESTURE,O as OVERLAY_GESTURE_PRIORITY,F as FOCUS_TRAP_DISABLE_CLASS,e as createTriggerController,B as BACKDROP,j as prepareOverlay,k as setOverlayId,f as present,g as dismiss,h as eventMethod}from"./overlays-d99dcb0a.js";import{g as getClassMap}from"./theme-01f3f29c.js";import{e as deepReady,w as waitForMount}from"./index-68c0d151.js";import{b as getIonMode}from"./ionic-global-b26f573e.js";import{KEYBOARD_DID_OPEN}from"./keyboard-52278bd7.js";import{c as createAnimation}from"./animation-8b25e105.js";import{g as getTimeGivenProgression}from"./cubic-bezier-fe2083dc.js";import{createGesture}from"./index-39782642.js";import{w as win}from"./index-a5d50daf.js";import"./hardware-back-button-a7eb8233.js";import"./gesture-controller-314a54f6.js";import"./keyboard-73175e24.js";var Style;(function(t){t["Dark"]="DARK";t["Light"]="LIGHT";t["Default"]="DEFAULT"})(Style||(Style={}));var StatusBar={getEngine:function(){var t=getCapacitor();if(t===null||t===void 0?void 0:t.isPluginAvailable("StatusBar")){return t.Plugins.StatusBar}return undefined},setStyle:function(t){var e=this.getEngine();if(!e){return}e.setStyle(t)},getStyle:function(){return __awaiter(this,void 0,void 0,(function(){var t,e;return __generator(this,(function(r){switch(r.label){case 0:t=this.getEngine();if(!t){return[2,Style.Default]}return[4,t.getInfo()];case 1:e=r.sent().style;return[2,e]}}))}))}};var getBackdropValueForSheet=function(t,e){if(e===1){return 0}var r=1/(1-e);var a=-(e*r);return t*r+a};var setCardStatusBarDark=function(){if(!win||win.innerWidth>=768){return}StatusBar.setStyle({style:Style.Dark})};var setCardStatusBarDefault=function(t){if(t===void 0){t=Style.Default}if(!win||win.innerWidth>=768){return}StatusBar.setStyle({style:t})};var handleCanDismiss=function(t,e){return __awaiter(void 0,void 0,void 0,(function(){var r;return __generator(this,(function(a){switch(a.label){case 0:if(typeof t.canDismiss!=="function"){return[2]}return[4,t.canDismiss(undefined,GESTURE)];case 1:r=a.sent();if(!r){return[2]}if(e.isRunning()){e.onFinish((function(){t.dismiss(undefined,"handler")}),{oneTimeCallback:true})}else{t.dismiss(undefined,"handler")}return[2]}}))}))};var calculateSpringStep=function(t){return.00255275*Math.pow(2.71828,-14.9619*t)-1.00255*Math.pow(2.71828,-.0380968*t)+1};var SwipeToCloseDefaults={MIN_PRESENTING_SCALE:.915};var createSwipeToCloseGesture=function(t,e,r,a){var n=.5;var i=t.offsetHeight;var o=false;var s=false;var d=null;var l=null;var f=.2;var c=true;var u=0;var h=function(){if(d&&isIonContent(d)){return d.scrollY}else{return true}};var p=function(t){var e=t.event.target;if(e===null||!e.closest){return true}d=findClosestIonContent(e);if(d){if(isIonContent(d)){var r=getElementRoot(d);l=r.querySelector(".inner-scroll")}else{l=d}var a=!!d.querySelector("ion-refresher");return!a&&l.scrollTop===0}var n=e.closest("ion-footer");if(n===null){return true}return false};var v=function(r){var a=r.deltaY;c=h();s=t.canDismiss!==undefined&&t.canDismiss!==true;if(a>0&&d){disableContentScrollY(d)}e.progressStart(true,o?1:0)};var m=function(t){var a=t.deltaY;if(a>0&&d){disableContentScrollY(d)}var o=t.deltaY/i;var l=o>=0&&s;var c=l?f:.9999;var h=l?calculateSpringStep(o/c):o;var p=clamp(1e-4,h,c);e.progressStep(p);if(p>=n&&u<n){setCardStatusBarDefault(r)}else if(p<n&&u>=n){setCardStatusBarDark()}u=p};var b=function(r){var l=r.velocityY;var u=r.deltaY/i;var h=u>=0&&s;var p=h?f:.9999;var v=h?calculateSpringStep(u/p):u;var m=clamp(1e-4,v,p);var b=(r.deltaY+l*1e3)/i;var w=!h&&b>=n;var x=w?-.001:.001;if(!w){e.easing("cubic-bezier(1, 0, 0.68, 0.28)");x+=getTimeGivenProgression([0,0],[1,0],[.68,.28],[1,1],m)[0]}else{e.easing("cubic-bezier(0.32, 0.72, 0, 1)");x+=getTimeGivenProgression([0,0],[.32,.72],[0,1],[1,1],m)[0]}var y=w?computeDuration(u*i,l):computeDuration((1-m)*i,l);o=w;g.enable(false);if(d){resetContentScrollY(d,c)}e.onFinish((function(){if(!w){g.enable(true)}})).progressEnd(w?1:0,x,y);if(h&&m>p/4){handleCanDismiss(t,e)}else if(w){a()}};var g=createGesture({el:t,gestureName:"modalSwipeToClose",gesturePriority:OVERLAY_GESTURE_PRIORITY,direction:"y",threshold:10,canStart:p,onStart:v,onMove:m,onEnd:b});return g};var computeDuration=function(t,e){return clamp(400,t/Math.abs(e*1.1),500)};var createSheetEnterAnimation=function(t){var e=t.currentBreakpoint,r=t.backdropBreakpoint,a=t.expandToScroll;var n=r===undefined||r<e;var i=n?"calc(var(--backdrop-opacity) * ".concat(e,")"):"0";var o=createAnimation("backdropAnimation").fromTo("opacity",0,i);if(n){o.beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"])}var s=createAnimation("wrapperAnimation").keyframes([{offset:0,opacity:1,transform:"translateY(100%)"},{offset:1,opacity:1,transform:"translateY(".concat(100-e*100,"%)")}]);var d=!a?createAnimation("contentAnimation").keyframes([{offset:0,opacity:1,maxHeight:"".concat((1-e)*100,"%")},{offset:1,opacity:1,maxHeight:"".concat(e*100,"%")}]):undefined;return{wrapperAnimation:s,backdropAnimation:o,contentAnimation:d}};var createSheetLeaveAnimation=function(t){var e=t.currentBreakpoint,r=t.backdropBreakpoint;var a="calc(var(--backdrop-opacity) * ".concat(getBackdropValueForSheet(e,r),")");var n=[{offset:0,opacity:a},{offset:1,opacity:0}];var i=[{offset:0,opacity:a},{offset:r,opacity:0},{offset:1,opacity:0}];var o=createAnimation("backdropAnimation").keyframes(r!==0?i:n);var s=createAnimation("wrapperAnimation").keyframes([{offset:0,opacity:1,transform:"translateY(".concat(100-e*100,"%)")},{offset:1,opacity:1,transform:"translateY(100%)"}]);return{wrapperAnimation:s,backdropAnimation:o}};var createEnterAnimation$1=function(){var t=createAnimation().fromTo("opacity",.01,"var(--backdrop-opacity)").beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"]);var e=createAnimation().fromTo("transform","translateY(100vh)","translateY(0vh)");return{backdropAnimation:t,wrapperAnimation:e,contentAnimation:undefined}};var iosEnterAnimation=function(t,e){var r=e.presentingEl,a=e.currentBreakpoint,n=e.expandToScroll;var i=getElementRoot(t);var o=a!==undefined?createSheetEnterAnimation(e):createEnterAnimation$1(),s=o.wrapperAnimation,d=o.backdropAnimation,l=o.contentAnimation;d.addElement(i.querySelector("ion-backdrop"));s.addElement(i.querySelectorAll(".modal-wrapper, .modal-shadow")).beforeStyles({opacity:1});!n&&(l===null||l===void 0?void 0:l.addElement(t.querySelector(".ion-page")));var f=createAnimation("entering-base").addElement(t).easing("cubic-bezier(0.32,0.72,0,1)").duration(500).addAnimation([s]);if(l){f.addAnimation(l)}if(r){var c=window.innerWidth<768;var u=r.tagName==="ION-MODAL"&&r.presentingElement!==undefined;var h=getElementRoot(r);var p=createAnimation().beforeStyles({transform:"translateY(0)","transform-origin":"top center",overflow:"hidden"});var v=document.body;if(c){var m=!CSS.supports("width","max(0px, 1px)")?"30px":"max(30px, var(--ion-safe-area-top))";var b=u?"-10px":m;var g=SwipeToCloseDefaults.MIN_PRESENTING_SCALE;var w="translateY(".concat(b,") scale(").concat(g,")");p.afterStyles({transform:w}).beforeAddWrite((function(){return v.style.setProperty("background-color","black")})).addElement(r).keyframes([{offset:0,filter:"contrast(1)",transform:"translateY(0px) scale(1)",borderRadius:"0px"},{offset:1,filter:"contrast(0.85)",transform:w,borderRadius:"10px 10px 0 0"}]);f.addAnimation(p)}else{f.addAnimation(d);if(!u){s.fromTo("opacity","0","1")}else{var g=u?SwipeToCloseDefaults.MIN_PRESENTING_SCALE:1;var w="translateY(-10px) scale(".concat(g,")");p.afterStyles({transform:w}).addElement(h.querySelector(".modal-wrapper")).keyframes([{offset:0,filter:"contrast(1)",transform:"translateY(0) scale(1)"},{offset:1,filter:"contrast(0.85)",transform:w}]);var x=createAnimation().afterStyles({transform:w}).addElement(h.querySelector(".modal-shadow")).keyframes([{offset:0,opacity:"1",transform:"translateY(0) scale(1)"},{offset:1,opacity:"0",transform:w}]);f.addAnimation([p,x])}}}else{f.addAnimation(d)}return f};var createLeaveAnimation$1=function(){var t=createAnimation().fromTo("opacity","var(--backdrop-opacity)",0);var e=createAnimation().fromTo("transform","translateY(0vh)","translateY(100vh)");return{backdropAnimation:t,wrapperAnimation:e}};var iosLeaveAnimation=function(t,e,r){if(r===void 0){r=500}var a=e.presentingEl,n=e.currentBreakpoint;var i=getElementRoot(t);var o=n!==undefined?createSheetLeaveAnimation(e):createLeaveAnimation$1(),s=o.wrapperAnimation,d=o.backdropAnimation;d.addElement(i.querySelector("ion-backdrop"));s.addElement(i.querySelectorAll(".modal-wrapper, .modal-shadow")).beforeStyles({opacity:1});var l=createAnimation("leaving-base").addElement(t).easing("cubic-bezier(0.32,0.72,0,1)").duration(r).addAnimation(s);if(a){var f=window.innerWidth<768;var c=a.tagName==="ION-MODAL"&&a.presentingElement!==undefined;var u=getElementRoot(a);var h=createAnimation().beforeClearStyles(["transform"]).afterClearStyles(["transform"]).onFinish((function(t){if(t!==1){return}a.style.setProperty("overflow","");var e=Array.from(p.querySelectorAll("ion-modal:not(.overlay-hidden)")).filter((function(t){return t.presentingElement!==undefined})).length;if(e<=1){p.style.setProperty("background-color","")}}));var p=document.body;if(f){var v=!CSS.supports("width","max(0px, 1px)")?"30px":"max(30px, var(--ion-safe-area-top))";var m=c?"-10px":v;var b=SwipeToCloseDefaults.MIN_PRESENTING_SCALE;var g="translateY(".concat(m,") scale(").concat(b,")");h.addElement(a).keyframes([{offset:0,filter:"contrast(0.85)",transform:g,borderRadius:"10px 10px 0 0"},{offset:1,filter:"contrast(1)",transform:"translateY(0px) scale(1)",borderRadius:"0px"}]);l.addAnimation(h)}else{l.addAnimation(d);if(!c){s.fromTo("opacity","1","0")}else{var b=c?SwipeToCloseDefaults.MIN_PRESENTING_SCALE:1;var g="translateY(-10px) scale(".concat(b,")");h.addElement(u.querySelector(".modal-wrapper")).afterStyles({transform:"translate3d(0, 0, 0)"}).keyframes([{offset:0,filter:"contrast(0.85)",transform:g},{offset:1,filter:"contrast(1)",transform:"translateY(0) scale(1)"}]);var w=createAnimation().addElement(u.querySelector(".modal-shadow")).afterStyles({transform:"translateY(0) scale(1)"}).keyframes([{offset:0,opacity:"0",transform:g},{offset:1,opacity:"1",transform:"translateY(0) scale(1)"}]);l.addAnimation([h,w])}}}else{l.addAnimation(d)}return l};var createEnterAnimation=function(){var t=createAnimation().fromTo("opacity",.01,"var(--backdrop-opacity)").beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"]);var e=createAnimation().keyframes([{offset:0,opacity:.01,transform:"translateY(40px)"},{offset:1,opacity:1,transform:"translateY(0px)"}]);return{backdropAnimation:t,wrapperAnimation:e,contentAnimation:undefined}};var mdEnterAnimation=function(t,e){var r=e.currentBreakpoint,a=e.expandToScroll;var n=getElementRoot(t);var i=r!==undefined?createSheetEnterAnimation(e):createEnterAnimation(),o=i.wrapperAnimation,s=i.backdropAnimation,d=i.contentAnimation;s.addElement(n.querySelector("ion-backdrop"));o.addElement(n.querySelector(".modal-wrapper"));a&&(d===null||d===void 0?void 0:d.addElement(t.querySelector(".ion-page")));var l=createAnimation().addElement(t).easing("cubic-bezier(0.36,0.66,0.04,1)").duration(280).addAnimation([s,o]);if(d){l.addAnimation(d)}return l};var createLeaveAnimation=function(){var t=createAnimation().fromTo("opacity","var(--backdrop-opacity)",0);var e=createAnimation().keyframes([{offset:0,opacity:.99,transform:"translateY(0px)"},{offset:1,opacity:0,transform:"translateY(40px)"}]);return{backdropAnimation:t,wrapperAnimation:e}};var mdLeaveAnimation=function(t,e){var r=e.currentBreakpoint;var a=getElementRoot(t);var n=r!==undefined?createSheetLeaveAnimation(e):createLeaveAnimation(),i=n.wrapperAnimation,o=n.backdropAnimation;o.addElement(a.querySelector("ion-backdrop"));i.addElement(a.querySelector(".modal-wrapper"));var s=createAnimation().easing("cubic-bezier(0.47,0,0.745,0.715)").duration(200).addAnimation([o,i]);return s};var createSheetGesture=function(t,e,r,a,n,i,o,s,d,l,f){if(o===void 0){o=[]}var c=[{offset:0,opacity:"var(--backdrop-opacity)"},{offset:1,opacity:.01}];var u=[{offset:0,opacity:"var(--backdrop-opacity)"},{offset:1-n,opacity:0},{offset:1,opacity:0}];var h={WRAPPER_KEYFRAMES:[{offset:0,transform:"translateY(0%)"},{offset:1,transform:"translateY(100%)"}],BACKDROP_KEYFRAMES:n!==0?u:c,CONTENT_KEYFRAMES:[{offset:0,maxHeight:"100%"},{offset:1,maxHeight:"0%"}]};var p=t.querySelector("ion-content");var v=r.clientHeight;var m=a;var b=0;var g=false;var w=null;var x=null;var y=null;var k=null;var A=.95;var S=o[o.length-1];var E=o[0];var _=i.childAnimations.find((function(t){return t.id==="wrapperAnimation"}));var C=i.childAnimations.find((function(t){return t.id==="backdropAnimation"}));var D=i.childAnimations.find((function(t){return t.id==="contentAnimation"}));var I=function(){t.style.setProperty("pointer-events","auto");e.style.setProperty("pointer-events","auto");t.classList.remove(FOCUS_TRAP_DISABLE_CLASS)};var M=function(){t.style.setProperty("pointer-events","none");e.style.setProperty("pointer-events","none");t.classList.add(FOCUS_TRAP_DISABLE_CLASS)};var R=function(e){if(!x){x=t.querySelector("ion-footer");if(!x){return}}var r=t.querySelector(".ion-page");k=e;if(e==="stationary"){x.classList.remove("modal-footer-moving");x.style.removeProperty("position");x.style.removeProperty("bottom");r===null||r===void 0?void 0:r.style.removeProperty("padding-bottom");r===null||r===void 0?void 0:r.appendChild(x)}else{var a=x.clientHeight;r===null||r===void 0?void 0:r.style.setProperty("padding-bottom","".concat(a,"px"));x.classList.add("modal-footer-moving");x.style.setProperty("position","absolute");x.style.setProperty("bottom","0");y=x.getBoundingClientRect().top+window.scrollY;document.body.appendChild(x)}};if(_&&C){_.keyframes(__spreadArray([],h.WRAPPER_KEYFRAMES,true));C.keyframes(__spreadArray([],h.BACKDROP_KEYFRAMES,true));D===null||D===void 0?void 0:D.keyframes(__spreadArray([],h.CONTENT_KEYFRAMES,true));i.progressStart(true,1-m);var Y=m>n;if(Y){I()}else{M()}}if(p&&m!==S&&s){p.scrollY=false}var T=function(t){var e=findClosestIonContent(t.event.target);m=d();if(!s&&e){var r=isIonContent(e)?getElementRoot(e).querySelector(".inner-scroll"):e;return r.scrollTop===0}if(m===1&&e){var r=isIonContent(e)?getElementRoot(e).querySelector(".inner-scroll"):e;var a=!!e.querySelector("ion-refresher");return!a&&r.scrollTop===0}return true};var B=function(e){g=t.canDismiss!==undefined&&t.canDismiss!==true&&E===0;if(!s){var r=findClosestIonContent(e.event.target);w=r&&isIonContent(r)?getElementRoot(r).querySelector(".inner-scroll"):r}if(!s){R("moving")}if(e.deltaY>0&&p){p.scrollY=false}raf((function(){t.focus()}));i.progressStart(true,1-m)};var L=function(t){if(!s&&y!==null&&k!==null){if(t.currentY>=y&&k==="moving"){R("stationary")}else if(t.currentY<y&&k==="stationary"){R("moving")}}if(!s&&t.deltaY<=0&&w){return}if(t.deltaY>0&&p){p.scrollY=false}var e=1-m;var r=o.length>1?1-o[1]:undefined;var a=e+t.deltaY/v;var n=r!==undefined&&a>=r&&g;var d=n?A:.9999;var l=n&&r!==undefined?r+calculateSpringStep((a-r)/(d-r)):a;b=clamp(1e-4,l,d);i.progressStep(b)};var O=function(t){if(!s&&t.deltaY<=0&&w&&w.scrollTop>0){return}var e=t.velocityY;var r=(t.deltaY+e*350)/v;var a=m-r;var n=o.reduce((function(t,e){return Math.abs(e-a)<Math.abs(t-a)?e:t}));P({breakpoint:n,breakpointOffset:b,canDismiss:g,animated:true})};var P=function(e){var r=e.breakpoint,a=e.canDismiss,d=e.breakpointOffset,c=e.animated;var u=a&&r===0;var v=u?m:r;var b=v!==0;m=0;if(_&&C){_.keyframes([{offset:0,transform:"translateY(".concat(d*100,"%)")},{offset:1,transform:"translateY(".concat((1-v)*100,"%)")}]);C.keyframes([{offset:0,opacity:"calc(var(--backdrop-opacity) * ".concat(getBackdropValueForSheet(1-d,n),")")},{offset:1,opacity:"calc(var(--backdrop-opacity) * ".concat(getBackdropValueForSheet(v,n),")")}]);if(D){D.keyframes([{offset:0,maxHeight:"".concat((1-d)*100,"%")},{offset:1,maxHeight:"".concat(v*100,"%")}])}i.progressStep(0)}j.enable(false);if(u){handleCanDismiss(t,i)}else if(!b){l()}if(p&&(v===o[o.length-1]||!s)){p.scrollY=true}return new Promise((function(t){i.onFinish((function(){if(b){if(!s){R("stationary")}if(_&&C){raf((function(){_.keyframes(__spreadArray([],h.WRAPPER_KEYFRAMES,true));C.keyframes(__spreadArray([],h.BACKDROP_KEYFRAMES,true));D===null||D===void 0?void 0:D.keyframes(__spreadArray([],h.CONTENT_KEYFRAMES,true));i.progressStart(true,1-v);m=v;f(m);var e=m>n;if(e){I()}else{M()}j.enable(true);t()}))}else{j.enable(true);t()}}else{t()}}),{oneTimeCallback:true}).progressEnd(1,0,c?500:0)}))};var j=createGesture({el:r,gestureName:"modalSheet",gesturePriority:40,direction:"y",threshold:10,canStart:T,onStart:B,onMove:L,onEnd:O});return{gesture:j,moveSheetToBreakpoint:P}};var modalIosCss=':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;--ion-safe-area-top:0px;--ion-safe-area-bottom:0px;--ion-safe-area-right:0px;--ion-safe-area-left:0px}}@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}:host(.modal-sheet.modal-no-expand-scroll) ion-footer ion-toolbar:first-of-type{padding-top:6px}';var IonModalIosStyle0=modalIosCss;var modalMdCss=':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;--ion-safe-area-top:0px;--ion-safe-area-bottom:0px;--ion-safe-area-right:0px;--ion-safe-area-left:0px}}@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}';var IonModalMdStyle0=modalMdCss;var Modal=function(){function t(t){var e=this;registerInstance(this,t);this.didPresent=createEvent(this,"ionModalDidPresent",7);this.willPresent=createEvent(this,"ionModalWillPresent",7);this.willDismiss=createEvent(this,"ionModalWillDismiss",7);this.didDismiss=createEvent(this,"ionModalDidDismiss",7);this.ionBreakpointDidChange=createEvent(this,"ionBreakpointDidChange",7);this.didPresentShorthand=createEvent(this,"didPresent",7);this.willPresentShorthand=createEvent(this,"willPresent",7);this.willDismissShorthand=createEvent(this,"willDismiss",7);this.didDismissShorthand=createEvent(this,"didDismiss",7);this.ionMount=createEvent(this,"ionMount",7);this.lockController=createLockController();this.triggerController=createTriggerController();this.coreDelegate=CoreDelegate();this.isSheetModal=false;this.inheritedAttributes={};this.inline=false;this.gestureAnimationDismissing=false;this.onHandleClick=function(){var t=e,r=t.sheetTransition,a=t.handleBehavior;if(a!=="cycle"||r!==undefined){return}e.moveToNextBreakpoint()};this.onBackdropTap=function(){var t=e.sheetTransition;if(t!==undefined){return}e.dismiss(undefined,BACKDROP)};this.onLifecycle=function(t){var r=e.usersElement;var a=LIFECYCLE_MAP[t.type];if(r&&a){var n=new CustomEvent(a,{bubbles:false,cancelable:false,detail:t.detail});r.dispatchEvent(n)}};this.presented=false;this.hasController=false;this.overlayIndex=undefined;this.delegate=undefined;this.keyboardClose=true;this.enterAnimation=undefined;this.leaveAnimation=undefined;this.breakpoints=undefined;this.expandToScroll=true;this.initialBreakpoint=undefined;this.backdropBreakpoint=0;this.handle=undefined;this.handleBehavior="none";this.component=undefined;this.componentProps=undefined;this.cssClass=undefined;this.backdropDismiss=true;this.showBackdrop=true;this.animated=true;this.presentingElement=undefined;this.htmlAttributes=undefined;this.isOpen=false;this.trigger=undefined;this.keepContentsMounted=false;this.focusTrap=true;this.canDismiss=true}t.prototype.onIsOpenChange=function(t,e){if(t===true&&e===false){this.present()}else if(t===false&&e===true){this.dismiss()}};t.prototype.triggerChanged=function(){var t=this,e=t.trigger,r=t.el,a=t.triggerController;if(e){a.addClickListener(r,e)}};t.prototype.breakpointsChanged=function(t){if(t!==undefined){this.sortedBreakpoints=t.sort((function(t,e){return t-e}))}};t.prototype.connectedCallback=function(){var t=this.el;prepareOverlay(t);this.triggerChanged()};t.prototype.disconnectedCallback=function(){this.triggerController.removeClickListener()};t.prototype.componentWillLoad=function(){var t=this;var e;var r=this,a=r.breakpoints,n=r.initialBreakpoint,i=r.el,o=r.htmlAttributes;var s=this.isSheetModal=a!==undefined&&n!==undefined;var d=["aria-label","role"];this.inheritedAttributes=inheritAttributes(i,d);if(o!==undefined){d.forEach((function(e){var r;var a=o[e];if(a){t.inheritedAttributes=Object.assign(Object.assign({},t.inheritedAttributes),(r={},r[e]=o[e],r));delete o[e]}}))}if(s){this.currentBreakpoint=this.initialBreakpoint}if(a!==undefined&&n!==undefined&&!a.includes(n)){printIonWarning("[ion-modal] - Your breakpoints array must include the initialBreakpoint value.")}if(!((e=this.htmlAttributes)===null||e===void 0?void 0:e.id)){setOverlayId(this.el)}};t.prototype.componentDidLoad=function(){var t=this;if(this.isOpen===true){raf((function(){return t.present()}))}this.breakpointsChanged(this.breakpoints);this.triggerChanged()};t.prototype.getDelegate=function(t){if(t===void 0){t=false}if(this.workingDelegate&&!t){return{delegate:this.workingDelegate,inline:this.inline}}var e=this.el.parentNode;var r=this.inline=e!==null&&!this.hasController;var a=this.workingDelegate=r?this.delegate||this.coreDelegate:this.delegate;return{inline:r,delegate:a}};t.prototype.checkCanDismiss=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r;return __generator(this,(function(a){r=this.canDismiss;if(typeof r==="function"){return[2,r(t,e)]}return[2,r]}))}))};t.prototype.present=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,r,a,n,i,o,s,d,l;var f=this;return __generator(this,(function(c){switch(c.label){case 0:return[4,this.lockController.lock()];case 1:t=c.sent();if(this.presented){t();return[2]}e=this,r=e.presentingElement,a=e.el;this.currentBreakpoint=this.initialBreakpoint;n=this.getDelegate(true),i=n.inline,o=n.delegate;this.ionMount.emit();s=this;return[4,attachComponent(o,a,this.component,["ion-page"],this.componentProps,i)];case 2:s.usersElement=c.sent();if(!hasLazyBuild(a))return[3,4];return[4,deepReady(this.usersElement)];case 3:c.sent();return[3,6];case 4:if(!!this.keepContentsMounted)return[3,6];return[4,waitForMount()];case 5:c.sent();c.label=6;case 6:writeTask((function(){return f.el.classList.add("show-modal")}));d=r!==undefined;if(!(d&&getIonMode(this)==="ios"))return[3,8];l=this;return[4,StatusBar.getStyle()];case 7:l.statusBarStyle=c.sent();setCardStatusBarDark();c.label=8;case 8:return[4,present(this,"modalEnter",iosEnterAnimation,mdEnterAnimation,{presentingEl:r,currentBreakpoint:this.initialBreakpoint,backdropBreakpoint:this.backdropBreakpoint,expandToScroll:this.expandToScroll})];case 9:c.sent();if(typeof window!=="undefined"){this.keyboardOpenCallback=function(){if(f.gesture){f.gesture.enable(false);raf((function(){if(f.gesture){f.gesture.enable(true)}}))}};window.addEventListener(KEYBOARD_DID_OPEN,this.keyboardOpenCallback)}if(this.isSheetModal){this.initSheetGesture()}else if(d){this.initSwipeToClose()}t();return[2]}}))}))};t.prototype.initSwipeToClose=function(){var t=this;var e;if(getIonMode(this)!=="ios"){return}var r=this.el;var a=this.leaveAnimation||config.get("modalLeave",iosLeaveAnimation);var n=this.animation=a(r,{presentingEl:this.presentingElement,expandToScroll:this.expandToScroll});var i=findIonContent(r);if(!i){printIonContentErrorMsg(r);return}var o=(e=this.statusBarStyle)!==null&&e!==void 0?e:Style.Default;this.gesture=createSwipeToCloseGesture(r,n,o,(function(){t.gestureAnimationDismissing=true;setCardStatusBarDefault(t.statusBarStyle);t.animation.onFinish((function(){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.dismiss(undefined,GESTURE)];case 1:t.sent();this.gestureAnimationDismissing=false;return[2]}}))}))}))}));this.gesture.enable(true)};t.prototype.initSheetGesture=function(){var t=this;var e=this,r=e.wrapperEl,a=e.initialBreakpoint,n=e.backdropBreakpoint;if(!r||a===undefined){return}var i=this.enterAnimation||config.get("modalEnter",iosEnterAnimation);var o=this.animation=i(this.el,{presentingEl:this.presentingElement,currentBreakpoint:a,backdropBreakpoint:n,expandToScroll:this.expandToScroll});o.progressStart(true,1);var s=createSheetGesture(this.el,this.backdropEl,r,a,n,o,this.sortedBreakpoints,this.expandToScroll,(function(){var e;return(e=t.currentBreakpoint)!==null&&e!==void 0?e:0}),(function(){return t.sheetOnDismiss()}),(function(e){if(t.currentBreakpoint!==e){t.currentBreakpoint=e;t.ionBreakpointDidChange.emit({breakpoint:e})}})),d=s.gesture,l=s.moveSheetToBreakpoint;this.gesture=d;this.moveSheetToBreakpoint=l;this.gesture.enable(true)};t.prototype.sheetOnDismiss=function(){var t=this;this.gestureAnimationDismissing=true;this.animation.onFinish((function(){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:this.currentBreakpoint=0;this.ionBreakpointDidChange.emit({breakpoint:this.currentBreakpoint});return[4,this.dismiss(undefined,GESTURE)];case 1:t.sent();this.gestureAnimationDismissing=false;return[2]}}))}))}))};t.prototype.dismiss=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r,a,n,i,o,s,d;var l=this;return __generator(this,(function(f){switch(f.label){case 0:if(this.gestureAnimationDismissing&&e!==GESTURE){return[2,false]}return[4,this.lockController.lock()];case 1:a=f.sent();n=e!=="handler";if(!n)return[3,3];return[4,this.checkCanDismiss(t,e)];case 2:n=!f.sent();f.label=3;case 3:if(n){a();return[2,false]}i=this.presentingElement;o=i!==undefined;if(o&&getIonMode(this)==="ios"){setCardStatusBarDefault(this.statusBarStyle)}if(typeof window!=="undefined"&&this.keyboardOpenCallback){window.removeEventListener(KEYBOARD_DID_OPEN,this.keyboardOpenCallback);this.keyboardOpenCallback=undefined}return[4,dismiss(this,t,e,"modalLeave",iosLeaveAnimation,mdLeaveAnimation,{presentingEl:i,currentBreakpoint:(r=this.currentBreakpoint)!==null&&r!==void 0?r:this.initialBreakpoint,backdropBreakpoint:this.backdropBreakpoint,expandToScroll:this.expandToScroll})];case 4:s=f.sent();if(!s)return[3,6];d=this.getDelegate().delegate;return[4,detachComponent(d,this.usersElement)];case 5:f.sent();writeTask((function(){return l.el.classList.remove("show-modal")}));if(this.animation){this.animation.destroy()}if(this.gesture){this.gesture.destroy()}f.label=6;case 6:this.currentBreakpoint=undefined;this.animation=undefined;a();return[2,s]}}))}))};t.prototype.onDidDismiss=function(){return eventMethod(this.el,"ionModalDidDismiss")};t.prototype.onWillDismiss=function(){return eventMethod(this.el,"ionModalWillDismiss")};t.prototype.setCurrentBreakpoint=function(t){return __awaiter(this,void 0,void 0,(function(){var e,r,a,n,i,o;return __generator(this,(function(s){switch(s.label){case 0:if(!this.isSheetModal){printIonWarning("[ion-modal] - setCurrentBreakpoint is only supported on sheet modals.");return[2]}if(!this.breakpoints.includes(t)){printIonWarning("[ion-modal] - Attempted to set invalid breakpoint value ".concat(t,". Please double check that the breakpoint value is part of your defined breakpoints."));return[2]}e=this,r=e.currentBreakpoint,a=e.moveSheetToBreakpoint,n=e.canDismiss,i=e.breakpoints,o=e.animated;if(r===t){return[2]}if(!a)return[3,2];this.sheetTransition=a({breakpoint:t,breakpointOffset:1-r,canDismiss:n!==undefined&&n!==true&&i[0]===0,animated:o});return[4,this.sheetTransition];case 1:s.sent();this.sheetTransition=undefined;s.label=2;case 2:return[2]}}))}))};t.prototype.getCurrentBreakpoint=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.currentBreakpoint]}))}))};t.prototype.moveToNextBreakpoint=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,r,a,n,i,o;return __generator(this,(function(s){switch(s.label){case 0:t=this,e=t.breakpoints,r=t.currentBreakpoint;if(!e||r==null){return[2,false]}a=e.filter((function(t){return t!==0}));n=a.indexOf(r);i=(n+1)%a.length;o=a[i];return[4,this.setCurrentBreakpoint(o)];case 1:s.sent();return[2,true]}}))}))};t.prototype.render=function(){var t;var e=this;var r=this,a=r.handle,n=r.isSheetModal,i=r.presentingElement,o=r.htmlAttributes,s=r.handleBehavior,d=r.inheritedAttributes,l=r.focusTrap,f=r.expandToScroll;var c=a!==false&&n;var u=getIonMode(this);var p=i!==undefined&&u==="ios";var v=s==="cycle";return h(Host,Object.assign({key:"0991b2e4e32da511e59fb1463b47e4ac1b86d1ca","no-router":true,tabindex:"-1"},o,{style:{zIndex:"".concat(2e4+this.overlayIndex)},class:Object.assign((t={},t[u]=true,t["modal-default"]=!p&&!n,t["modal-card"]=p,t["modal-sheet"]=n,t["modal-no-expand-scroll"]=n&&!f,t["overlay-hidden"]=true,t[FOCUS_TRAP_DISABLE_CLASS]=l===false,t),getClassMap(this.cssClass)),onIonBackdropTap:this.onBackdropTap,onIonModalDidPresent:this.onLifecycle,onIonModalWillPresent:this.onLifecycle,onIonModalWillDismiss:this.onLifecycle,onIonModalDidDismiss:this.onLifecycle}),h("ion-backdrop",{key:"ca9453ffe1021fb252ad9460676cfabb5633f00f",ref:function(t){return e.backdropEl=t},visible:this.showBackdrop,tappable:this.backdropDismiss,part:"backdrop"}),u==="ios"&&h("div",{key:"9f8da446a7b0f3b26aec856e13f6d6d131a7e37b",class:"modal-shadow"}),h("div",Object.assign({key:"9d08bf600571849c97b58f66df40b496a358d1e1",role:"dialog"},d,{"aria-modal":"true",class:"modal-wrapper ion-overlay-wrapper",part:"content",ref:function(t){return e.wrapperEl=t}}),c&&h("button",{key:"f8bf0d1126e5376519101225d9965727121ee042",class:"modal-handle",tabIndex:!v?-1:0,"aria-label":"Activate to adjust the size of the dialog overlaying the screen",onClick:v?this.onHandleClick:undefined,part:"handle"}),h("slot",{key:"6d52849df98f2c6c8fbc03996a931ea6a39a512b"})))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{isOpen:["onIsOpenChange"],trigger:["triggerChanged"]}},enumerable:false,configurable:true});return t}();var LIFECYCLE_MAP={ionModalDidPresent:"ionViewDidEnter",ionModalWillPresent:"ionViewWillEnter",ionModalWillDismiss:"ionViewWillLeave",ionModalDidDismiss:"ionViewDidLeave"};Modal.style={ios:IonModalIosStyle0,md:IonModalMdStyle0};export{Modal as ion_modal};
|
|
4
|
+
*/import{r as registerInstance,c as createEvent,w as writeTask,h,e as Host,f as getElement}from"./index-527b9e34.js";import{f as findClosestIonContent,i as isIonContent,d as disableContentScrollY,r as resetContentScrollY,a as findIonContent,p as printIonContentErrorMsg}from"./index-9a17db3d.js";import{C as CoreDelegate,a as attachComponent,d as detachComponent}from"./framework-delegate-56b467ad.js";import{g as getElementRoot,j as clamp,r as raf,h as inheritAttributes,k as hasLazyBuild}from"./helpers-d94bc8ad.js";import{c as createLockController}from"./lock-controller-316928be.js";import{p as printIonWarning,c as config}from"./index-cfd9c1f2.js";import{g as getCapacitor}from"./capacitor-59395cbd.js";import{G as GESTURE,O as OVERLAY_GESTURE_PRIORITY,F as FOCUS_TRAP_DISABLE_CLASS,e as createTriggerController,B as BACKDROP,j as prepareOverlay,k as setOverlayId,f as present,g as dismiss,h as eventMethod}from"./overlays-d99dcb0a.js";import{g as getClassMap}from"./theme-01f3f29c.js";import{e as deepReady,w as waitForMount}from"./index-68c0d151.js";import{b as getIonMode}from"./ionic-global-b26f573e.js";import{KEYBOARD_DID_OPEN}from"./keyboard-52278bd7.js";import{c as createAnimation}from"./animation-8b25e105.js";import{g as getTimeGivenProgression}from"./cubic-bezier-fe2083dc.js";import{createGesture}from"./index-39782642.js";import{w as win}from"./index-a5d50daf.js";import"./hardware-back-button-a7eb8233.js";import"./gesture-controller-314a54f6.js";import"./keyboard-73175e24.js";var Style;(function(t){t["Dark"]="DARK";t["Light"]="LIGHT";t["Default"]="DEFAULT"})(Style||(Style={}));var StatusBar={getEngine:function(){var t=getCapacitor();if(t===null||t===void 0?void 0:t.isPluginAvailable("StatusBar")){return t.Plugins.StatusBar}return undefined},setStyle:function(t){var e=this.getEngine();if(!e){return}e.setStyle(t)},getStyle:function(){return __awaiter(this,void 0,void 0,(function(){var t,e;return __generator(this,(function(r){switch(r.label){case 0:t=this.getEngine();if(!t){return[2,Style.Default]}return[4,t.getInfo()];case 1:e=r.sent().style;return[2,e]}}))}))}};var getBackdropValueForSheet=function(t,e){if(e===1){return 0}var r=1/(1-e);var a=-(e*r);return t*r+a};var setCardStatusBarDark=function(){if(!win||win.innerWidth>=768){return}StatusBar.setStyle({style:Style.Dark})};var setCardStatusBarDefault=function(t){if(t===void 0){t=Style.Default}if(!win||win.innerWidth>=768){return}StatusBar.setStyle({style:t})};var handleCanDismiss=function(t,e){return __awaiter(void 0,void 0,void 0,(function(){var r;return __generator(this,(function(a){switch(a.label){case 0:if(typeof t.canDismiss!=="function"){return[2]}return[4,t.canDismiss(undefined,GESTURE)];case 1:r=a.sent();if(!r){return[2]}if(e.isRunning()){e.onFinish((function(){t.dismiss(undefined,"handler")}),{oneTimeCallback:true})}else{t.dismiss(undefined,"handler")}return[2]}}))}))};var calculateSpringStep=function(t){return.00255275*Math.pow(2.71828,-14.9619*t)-1.00255*Math.pow(2.71828,-.0380968*t)+1};var SwipeToCloseDefaults={MIN_PRESENTING_SCALE:.915};var createSwipeToCloseGesture=function(t,e,r,a){var i=.5;var n=t.offsetHeight;var o=false;var s=false;var d=null;var l=null;var f=.2;var c=true;var u=0;var h=function(){if(d&&isIonContent(d)){return d.scrollY}else{return true}};var p=function(t){var e=t.event.target;if(e===null||!e.closest){return true}d=findClosestIonContent(e);if(d){if(isIonContent(d)){var r=getElementRoot(d);l=r.querySelector(".inner-scroll")}else{l=d}var a=!!d.querySelector("ion-refresher");return!a&&l.scrollTop===0}var i=e.closest("ion-footer");if(i===null){return true}return false};var v=function(r){var a=r.deltaY;c=h();s=t.canDismiss!==undefined&&t.canDismiss!==true;if(a>0&&d){disableContentScrollY(d)}e.progressStart(true,o?1:0)};var m=function(t){var a=t.deltaY;if(a>0&&d){disableContentScrollY(d)}var o=t.deltaY/n;var l=o>=0&&s;var c=l?f:.9999;var h=l?calculateSpringStep(o/c):o;var p=clamp(1e-4,h,c);e.progressStep(p);if(p>=i&&u<i){setCardStatusBarDefault(r)}else if(p<i&&u>=i){setCardStatusBarDark()}u=p};var b=function(r){var l=r.velocityY;var u=r.deltaY/n;var h=u>=0&&s;var p=h?f:.9999;var v=h?calculateSpringStep(u/p):u;var m=clamp(1e-4,v,p);var b=(r.deltaY+l*1e3)/n;var w=!h&&b>=i;var x=w?-.001:.001;if(!w){e.easing("cubic-bezier(1, 0, 0.68, 0.28)");x+=getTimeGivenProgression([0,0],[1,0],[.68,.28],[1,1],m)[0]}else{e.easing("cubic-bezier(0.32, 0.72, 0, 1)");x+=getTimeGivenProgression([0,0],[.32,.72],[0,1],[1,1],m)[0]}var y=w?computeDuration(u*n,l):computeDuration((1-m)*n,l);o=w;g.enable(false);if(d){resetContentScrollY(d,c)}e.onFinish((function(){if(!w){g.enable(true)}})).progressEnd(w?1:0,x,y);if(h&&m>p/4){handleCanDismiss(t,e)}else if(w){a()}};var g=createGesture({el:t,gestureName:"modalSwipeToClose",gesturePriority:OVERLAY_GESTURE_PRIORITY,direction:"y",threshold:10,canStart:p,onStart:v,onMove:m,onEnd:b});return g};var computeDuration=function(t,e){return clamp(400,t/Math.abs(e*1.1),500)};var createSheetEnterAnimation=function(t){var e=t.currentBreakpoint,r=t.backdropBreakpoint,a=t.expandToScroll;var i=r===undefined||r<e;var n=i?"calc(var(--backdrop-opacity) * ".concat(e,")"):"0";var o=createAnimation("backdropAnimation").fromTo("opacity",0,n);if(i){o.beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"])}var s=createAnimation("wrapperAnimation").keyframes([{offset:0,opacity:1,transform:"translateY(100%)"},{offset:1,opacity:1,transform:"translateY(".concat(100-e*100,"%)")}]);var d=!a?createAnimation("contentAnimation").keyframes([{offset:0,opacity:1,maxHeight:"".concat((1-e)*100,"%")},{offset:1,opacity:1,maxHeight:"".concat(e*100,"%")}]):undefined;return{wrapperAnimation:s,backdropAnimation:o,contentAnimation:d}};var createSheetLeaveAnimation=function(t){var e=t.currentBreakpoint,r=t.backdropBreakpoint;var a="calc(var(--backdrop-opacity) * ".concat(getBackdropValueForSheet(e,r),")");var i=[{offset:0,opacity:a},{offset:1,opacity:0}];var n=[{offset:0,opacity:a},{offset:r,opacity:0},{offset:1,opacity:0}];var o=createAnimation("backdropAnimation").keyframes(r!==0?n:i);var s=createAnimation("wrapperAnimation").keyframes([{offset:0,opacity:1,transform:"translateY(".concat(100-e*100,"%)")},{offset:1,opacity:1,transform:"translateY(100%)"}]);return{wrapperAnimation:s,backdropAnimation:o}};var createEnterAnimation$1=function(){var t=createAnimation().fromTo("opacity",.01,"var(--backdrop-opacity)").beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"]);var e=createAnimation().fromTo("transform","translateY(100vh)","translateY(0vh)");return{backdropAnimation:t,wrapperAnimation:e,contentAnimation:undefined}};var iosEnterAnimation=function(t,e){var r=e.presentingEl,a=e.currentBreakpoint,i=e.expandToScroll;var n=getElementRoot(t);var o=a!==undefined?createSheetEnterAnimation(e):createEnterAnimation$1(),s=o.wrapperAnimation,d=o.backdropAnimation,l=o.contentAnimation;d.addElement(n.querySelector("ion-backdrop"));s.addElement(n.querySelectorAll(".modal-wrapper, .modal-shadow")).beforeStyles({opacity:1});!i&&(l===null||l===void 0?void 0:l.addElement(t.querySelector(".ion-page")));var f=createAnimation("entering-base").addElement(t).easing("cubic-bezier(0.32,0.72,0,1)").duration(500).addAnimation([s]);if(l){f.addAnimation(l)}if(r){var c=window.innerWidth<768;var u=r.tagName==="ION-MODAL"&&r.presentingElement!==undefined;var h=getElementRoot(r);var p=createAnimation().beforeStyles({transform:"translateY(0)","transform-origin":"top center",overflow:"hidden"});var v=document.body;if(c){var m=!CSS.supports("width","max(0px, 1px)")?"30px":"max(30px, var(--ion-safe-area-top))";var b=u?"-10px":m;var g=SwipeToCloseDefaults.MIN_PRESENTING_SCALE;var w="translateY(".concat(b,") scale(").concat(g,")");p.afterStyles({transform:w}).beforeAddWrite((function(){return v.style.setProperty("background-color","black")})).addElement(r).keyframes([{offset:0,filter:"contrast(1)",transform:"translateY(0px) scale(1)",borderRadius:"0px"},{offset:1,filter:"contrast(0.85)",transform:w,borderRadius:"10px 10px 0 0"}]);f.addAnimation(p)}else{f.addAnimation(d);if(!u){s.fromTo("opacity","0","1")}else{var g=u?SwipeToCloseDefaults.MIN_PRESENTING_SCALE:1;var w="translateY(-10px) scale(".concat(g,")");p.afterStyles({transform:w}).addElement(h.querySelector(".modal-wrapper")).keyframes([{offset:0,filter:"contrast(1)",transform:"translateY(0) scale(1)"},{offset:1,filter:"contrast(0.85)",transform:w}]);var x=createAnimation().afterStyles({transform:w}).addElement(h.querySelector(".modal-shadow")).keyframes([{offset:0,opacity:"1",transform:"translateY(0) scale(1)"},{offset:1,opacity:"0",transform:w}]);f.addAnimation([p,x])}}}else{f.addAnimation(d)}return f};var createLeaveAnimation$1=function(){var t=createAnimation().fromTo("opacity","var(--backdrop-opacity)",0);var e=createAnimation().fromTo("transform","translateY(0vh)","translateY(100vh)");return{backdropAnimation:t,wrapperAnimation:e}};var iosLeaveAnimation=function(t,e,r){if(r===void 0){r=500}var a=e.presentingEl,i=e.currentBreakpoint;var n=getElementRoot(t);var o=i!==undefined?createSheetLeaveAnimation(e):createLeaveAnimation$1(),s=o.wrapperAnimation,d=o.backdropAnimation;d.addElement(n.querySelector("ion-backdrop"));s.addElement(n.querySelectorAll(".modal-wrapper, .modal-shadow")).beforeStyles({opacity:1});var l=createAnimation("leaving-base").addElement(t).easing("cubic-bezier(0.32,0.72,0,1)").duration(r).addAnimation(s);if(a){var f=window.innerWidth<768;var c=a.tagName==="ION-MODAL"&&a.presentingElement!==undefined;var u=getElementRoot(a);var h=createAnimation().beforeClearStyles(["transform"]).afterClearStyles(["transform"]).onFinish((function(t){if(t!==1){return}a.style.setProperty("overflow","");var e=Array.from(p.querySelectorAll("ion-modal:not(.overlay-hidden)")).filter((function(t){return t.presentingElement!==undefined})).length;if(e<=1){p.style.setProperty("background-color","")}}));var p=document.body;if(f){var v=!CSS.supports("width","max(0px, 1px)")?"30px":"max(30px, var(--ion-safe-area-top))";var m=c?"-10px":v;var b=SwipeToCloseDefaults.MIN_PRESENTING_SCALE;var g="translateY(".concat(m,") scale(").concat(b,")");h.addElement(a).keyframes([{offset:0,filter:"contrast(0.85)",transform:g,borderRadius:"10px 10px 0 0"},{offset:1,filter:"contrast(1)",transform:"translateY(0px) scale(1)",borderRadius:"0px"}]);l.addAnimation(h)}else{l.addAnimation(d);if(!c){s.fromTo("opacity","1","0")}else{var b=c?SwipeToCloseDefaults.MIN_PRESENTING_SCALE:1;var g="translateY(-10px) scale(".concat(b,")");h.addElement(u.querySelector(".modal-wrapper")).afterStyles({transform:"translate3d(0, 0, 0)"}).keyframes([{offset:0,filter:"contrast(0.85)",transform:g},{offset:1,filter:"contrast(1)",transform:"translateY(0) scale(1)"}]);var w=createAnimation().addElement(u.querySelector(".modal-shadow")).afterStyles({transform:"translateY(0) scale(1)"}).keyframes([{offset:0,opacity:"0",transform:g},{offset:1,opacity:"1",transform:"translateY(0) scale(1)"}]);l.addAnimation([h,w])}}}else{l.addAnimation(d)}return l};var createEnterAnimation=function(){var t=createAnimation().fromTo("opacity",.01,"var(--backdrop-opacity)").beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"]);var e=createAnimation().keyframes([{offset:0,opacity:.01,transform:"translateY(40px)"},{offset:1,opacity:1,transform:"translateY(0px)"}]);return{backdropAnimation:t,wrapperAnimation:e,contentAnimation:undefined}};var mdEnterAnimation=function(t,e){var r=e.currentBreakpoint,a=e.expandToScroll;var i=getElementRoot(t);var n=r!==undefined?createSheetEnterAnimation(e):createEnterAnimation(),o=n.wrapperAnimation,s=n.backdropAnimation,d=n.contentAnimation;s.addElement(i.querySelector("ion-backdrop"));o.addElement(i.querySelector(".modal-wrapper"));a&&(d===null||d===void 0?void 0:d.addElement(t.querySelector(".ion-page")));var l=createAnimation().addElement(t).easing("cubic-bezier(0.36,0.66,0.04,1)").duration(280).addAnimation([s,o]);if(d){l.addAnimation(d)}return l};var createLeaveAnimation=function(){var t=createAnimation().fromTo("opacity","var(--backdrop-opacity)",0);var e=createAnimation().keyframes([{offset:0,opacity:.99,transform:"translateY(0px)"},{offset:1,opacity:0,transform:"translateY(40px)"}]);return{backdropAnimation:t,wrapperAnimation:e}};var mdLeaveAnimation=function(t,e){var r=e.currentBreakpoint;var a=getElementRoot(t);var i=r!==undefined?createSheetLeaveAnimation(e):createLeaveAnimation(),n=i.wrapperAnimation,o=i.backdropAnimation;o.addElement(a.querySelector("ion-backdrop"));n.addElement(a.querySelector(".modal-wrapper"));var s=createAnimation().easing("cubic-bezier(0.47,0,0.745,0.715)").duration(200).addAnimation([o,n]);return s};var createSheetGesture=function(t,e,r,a,i,n,o,s,d,l,f){if(o===void 0){o=[]}var c=[{offset:0,opacity:"var(--backdrop-opacity)"},{offset:1,opacity:.01}];var u=[{offset:0,opacity:"var(--backdrop-opacity)"},{offset:1-i,opacity:0},{offset:1,opacity:0}];var h={WRAPPER_KEYFRAMES:[{offset:0,transform:"translateY(0%)"},{offset:1,transform:"translateY(100%)"}],BACKDROP_KEYFRAMES:i!==0?u:c,CONTENT_KEYFRAMES:[{offset:0,maxHeight:"100%"},{offset:1,maxHeight:"0%"}]};var p=t.querySelector("ion-content");var v=r.clientHeight;var m=a;var b=0;var g=false;var w=null;var x=null;var y=null;var k=null;var A=.95;var S=o[o.length-1];var E=o[0];var _=n.childAnimations.find((function(t){return t.id==="wrapperAnimation"}));var C=n.childAnimations.find((function(t){return t.id==="backdropAnimation"}));var D=n.childAnimations.find((function(t){return t.id==="contentAnimation"}));var I=function(){t.style.setProperty("pointer-events","auto");e.style.setProperty("pointer-events","auto");t.classList.remove(FOCUS_TRAP_DISABLE_CLASS)};var M=function(){t.style.setProperty("pointer-events","none");e.style.setProperty("pointer-events","none");t.classList.add(FOCUS_TRAP_DISABLE_CLASS)};var R=function(e){if(!x){x=t.querySelector("ion-footer");if(!x){return}}var r=t.querySelector(".ion-page");k=e;if(e==="stationary"){x.classList.remove("modal-footer-moving");x.style.removeProperty("position");x.style.removeProperty("width");x.style.removeProperty("height");x.style.removeProperty("top");x.style.removeProperty("left");r===null||r===void 0?void 0:r.style.removeProperty("padding-bottom");r===null||r===void 0?void 0:r.appendChild(x)}else{var a=x.getBoundingClientRect();var i=document.body.getBoundingClientRect();var n=x.clientHeight;r===null||r===void 0?void 0:r.style.setProperty("padding-bottom","".concat(n,"px"));x.classList.add("modal-footer-moving");var o=a.top-i.top;var s=a.left-i.left;x.style.setProperty("position","absolute");x.style.setProperty("width","".concat(x.clientWidth,"px"));x.style.setProperty("height","".concat(x.clientHeight,"px"));x.style.setProperty("top","".concat(o,"px"));x.style.setProperty("left","".concat(s,"px"));y=o;document.body.appendChild(x)}};if(_&&C){_.keyframes(__spreadArray([],h.WRAPPER_KEYFRAMES,true));C.keyframes(__spreadArray([],h.BACKDROP_KEYFRAMES,true));D===null||D===void 0?void 0:D.keyframes(__spreadArray([],h.CONTENT_KEYFRAMES,true));n.progressStart(true,1-m);var Y=m>i;if(Y){I()}else{M()}}if(p&&m!==S&&s){p.scrollY=false}var T=function(t){var e=findClosestIonContent(t.event.target);m=d();if(!s&&e){var r=isIonContent(e)?getElementRoot(e).querySelector(".inner-scroll"):e;return r.scrollTop===0}if(m===1&&e){var r=isIonContent(e)?getElementRoot(e).querySelector(".inner-scroll"):e;var a=!!e.querySelector("ion-refresher");return!a&&r.scrollTop===0}return true};var B=function(e){g=t.canDismiss!==undefined&&t.canDismiss!==true&&E===0;if(!s){var r=findClosestIonContent(e.event.target);w=r&&isIonContent(r)?getElementRoot(r).querySelector(".inner-scroll"):r}if(!s){R("moving")}if(e.deltaY>0&&p){p.scrollY=false}raf((function(){t.focus()}));n.progressStart(true,1-m)};var L=function(t){if(!s&&y!==null&&k!==null){if(t.currentY>=y&&k==="moving"){R("stationary")}else if(t.currentY<y&&k==="stationary"){R("moving")}}if(!s&&t.deltaY<=0&&w){return}if(t.deltaY>0&&p){p.scrollY=false}var e=1-m;var r=o.length>1?1-o[1]:undefined;var a=e+t.deltaY/v;var i=r!==undefined&&a>=r&&g;var d=i?A:.9999;var l=i&&r!==undefined?r+calculateSpringStep((a-r)/(d-r)):a;b=clamp(1e-4,l,d);n.progressStep(b)};var O=function(t){if(!s&&t.deltaY<=0&&w&&w.scrollTop>0){return}var e=t.velocityY;var r=(t.deltaY+e*350)/v;var a=m-r;var i=o.reduce((function(t,e){return Math.abs(e-a)<Math.abs(t-a)?e:t}));P({breakpoint:i,breakpointOffset:b,canDismiss:g,animated:true})};var P=function(e){var r=e.breakpoint,a=e.canDismiss,d=e.breakpointOffset,c=e.animated;var u=a&&r===0;var v=u?m:r;var b=v!==0;m=0;if(_&&C){_.keyframes([{offset:0,transform:"translateY(".concat(d*100,"%)")},{offset:1,transform:"translateY(".concat((1-v)*100,"%)")}]);C.keyframes([{offset:0,opacity:"calc(var(--backdrop-opacity) * ".concat(getBackdropValueForSheet(1-d,i),")")},{offset:1,opacity:"calc(var(--backdrop-opacity) * ".concat(getBackdropValueForSheet(v,i),")")}]);if(D){D.keyframes([{offset:0,maxHeight:"".concat((1-d)*100,"%")},{offset:1,maxHeight:"".concat(v*100,"%")}])}n.progressStep(0)}j.enable(false);if(u){handleCanDismiss(t,n)}else if(!b){l()}if(p&&(v===o[o.length-1]||!s)){p.scrollY=true}if(!s){R("stationary")}return new Promise((function(t){n.onFinish((function(){if(b){if(_&&C){raf((function(){_.keyframes(__spreadArray([],h.WRAPPER_KEYFRAMES,true));C.keyframes(__spreadArray([],h.BACKDROP_KEYFRAMES,true));D===null||D===void 0?void 0:D.keyframes(__spreadArray([],h.CONTENT_KEYFRAMES,true));n.progressStart(true,1-v);m=v;f(m);var e=m>i;if(e){I()}else{M()}j.enable(true);t()}))}else{j.enable(true);t()}}else{t()}}),{oneTimeCallback:true}).progressEnd(1,0,c?500:0)}))};var j=createGesture({el:r,gestureName:"modalSheet",gesturePriority:40,direction:"y",threshold:10,canStart:T,onStart:B,onMove:L,onEnd:O});return{gesture:j,moveSheetToBreakpoint:P}};var modalIosCss=':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;--ion-safe-area-top:0px;--ion-safe-area-bottom:0px;--ion-safe-area-right:0px;--ion-safe-area-left:0px}}@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}:host(.modal-sheet.modal-no-expand-scroll) ion-footer ion-toolbar:first-of-type{padding-top:6px}';var IonModalIosStyle0=modalIosCss;var modalMdCss=':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;--ion-safe-area-top:0px;--ion-safe-area-bottom:0px;--ion-safe-area-right:0px;--ion-safe-area-left:0px}}@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}';var IonModalMdStyle0=modalMdCss;var Modal=function(){function t(t){var e=this;registerInstance(this,t);this.didPresent=createEvent(this,"ionModalDidPresent",7);this.willPresent=createEvent(this,"ionModalWillPresent",7);this.willDismiss=createEvent(this,"ionModalWillDismiss",7);this.didDismiss=createEvent(this,"ionModalDidDismiss",7);this.ionBreakpointDidChange=createEvent(this,"ionBreakpointDidChange",7);this.didPresentShorthand=createEvent(this,"didPresent",7);this.willPresentShorthand=createEvent(this,"willPresent",7);this.willDismissShorthand=createEvent(this,"willDismiss",7);this.didDismissShorthand=createEvent(this,"didDismiss",7);this.ionMount=createEvent(this,"ionMount",7);this.lockController=createLockController();this.triggerController=createTriggerController();this.coreDelegate=CoreDelegate();this.isSheetModal=false;this.inheritedAttributes={};this.inline=false;this.gestureAnimationDismissing=false;this.onHandleClick=function(){var t=e,r=t.sheetTransition,a=t.handleBehavior;if(a!=="cycle"||r!==undefined){return}e.moveToNextBreakpoint()};this.onBackdropTap=function(){var t=e.sheetTransition;if(t!==undefined){return}e.dismiss(undefined,BACKDROP)};this.onLifecycle=function(t){var r=e.usersElement;var a=LIFECYCLE_MAP[t.type];if(r&&a){var i=new CustomEvent(a,{bubbles:false,cancelable:false,detail:t.detail});r.dispatchEvent(i)}};this.presented=false;this.hasController=false;this.overlayIndex=undefined;this.delegate=undefined;this.keyboardClose=true;this.enterAnimation=undefined;this.leaveAnimation=undefined;this.breakpoints=undefined;this.expandToScroll=true;this.initialBreakpoint=undefined;this.backdropBreakpoint=0;this.handle=undefined;this.handleBehavior="none";this.component=undefined;this.componentProps=undefined;this.cssClass=undefined;this.backdropDismiss=true;this.showBackdrop=true;this.animated=true;this.presentingElement=undefined;this.htmlAttributes=undefined;this.isOpen=false;this.trigger=undefined;this.keepContentsMounted=false;this.focusTrap=true;this.canDismiss=true}t.prototype.onIsOpenChange=function(t,e){if(t===true&&e===false){this.present()}else if(t===false&&e===true){this.dismiss()}};t.prototype.triggerChanged=function(){var t=this,e=t.trigger,r=t.el,a=t.triggerController;if(e){a.addClickListener(r,e)}};t.prototype.breakpointsChanged=function(t){if(t!==undefined){this.sortedBreakpoints=t.sort((function(t,e){return t-e}))}};t.prototype.connectedCallback=function(){var t=this.el;prepareOverlay(t);this.triggerChanged()};t.prototype.disconnectedCallback=function(){this.triggerController.removeClickListener()};t.prototype.componentWillLoad=function(){var t=this;var e;var r=this,a=r.breakpoints,i=r.initialBreakpoint,n=r.el,o=r.htmlAttributes;var s=this.isSheetModal=a!==undefined&&i!==undefined;var d=["aria-label","role"];this.inheritedAttributes=inheritAttributes(n,d);if(o!==undefined){d.forEach((function(e){var r;var a=o[e];if(a){t.inheritedAttributes=Object.assign(Object.assign({},t.inheritedAttributes),(r={},r[e]=o[e],r));delete o[e]}}))}if(s){this.currentBreakpoint=this.initialBreakpoint}if(a!==undefined&&i!==undefined&&!a.includes(i)){printIonWarning("[ion-modal] - Your breakpoints array must include the initialBreakpoint value.")}if(!((e=this.htmlAttributes)===null||e===void 0?void 0:e.id)){setOverlayId(this.el)}};t.prototype.componentDidLoad=function(){var t=this;if(this.isOpen===true){raf((function(){return t.present()}))}this.breakpointsChanged(this.breakpoints);this.triggerChanged()};t.prototype.getDelegate=function(t){if(t===void 0){t=false}if(this.workingDelegate&&!t){return{delegate:this.workingDelegate,inline:this.inline}}var e=this.el.parentNode;var r=this.inline=e!==null&&!this.hasController;var a=this.workingDelegate=r?this.delegate||this.coreDelegate:this.delegate;return{inline:r,delegate:a}};t.prototype.checkCanDismiss=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r;return __generator(this,(function(a){r=this.canDismiss;if(typeof r==="function"){return[2,r(t,e)]}return[2,r]}))}))};t.prototype.present=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,r,a,i,n,o,s,d,l;var f=this;return __generator(this,(function(c){switch(c.label){case 0:return[4,this.lockController.lock()];case 1:t=c.sent();if(this.presented){t();return[2]}e=this,r=e.presentingElement,a=e.el;this.currentBreakpoint=this.initialBreakpoint;i=this.getDelegate(true),n=i.inline,o=i.delegate;this.ionMount.emit();s=this;return[4,attachComponent(o,a,this.component,["ion-page"],this.componentProps,n)];case 2:s.usersElement=c.sent();if(!hasLazyBuild(a))return[3,4];return[4,deepReady(this.usersElement)];case 3:c.sent();return[3,6];case 4:if(!!this.keepContentsMounted)return[3,6];return[4,waitForMount()];case 5:c.sent();c.label=6;case 6:writeTask((function(){return f.el.classList.add("show-modal")}));d=r!==undefined;if(!(d&&getIonMode(this)==="ios"))return[3,8];l=this;return[4,StatusBar.getStyle()];case 7:l.statusBarStyle=c.sent();setCardStatusBarDark();c.label=8;case 8:return[4,present(this,"modalEnter",iosEnterAnimation,mdEnterAnimation,{presentingEl:r,currentBreakpoint:this.initialBreakpoint,backdropBreakpoint:this.backdropBreakpoint,expandToScroll:this.expandToScroll})];case 9:c.sent();if(typeof window!=="undefined"){this.keyboardOpenCallback=function(){if(f.gesture){f.gesture.enable(false);raf((function(){if(f.gesture){f.gesture.enable(true)}}))}};window.addEventListener(KEYBOARD_DID_OPEN,this.keyboardOpenCallback)}if(this.isSheetModal){this.initSheetGesture()}else if(d){this.initSwipeToClose()}t();return[2]}}))}))};t.prototype.initSwipeToClose=function(){var t=this;var e;if(getIonMode(this)!=="ios"){return}var r=this.el;var a=this.leaveAnimation||config.get("modalLeave",iosLeaveAnimation);var i=this.animation=a(r,{presentingEl:this.presentingElement,expandToScroll:this.expandToScroll});var n=findIonContent(r);if(!n){printIonContentErrorMsg(r);return}var o=(e=this.statusBarStyle)!==null&&e!==void 0?e:Style.Default;this.gesture=createSwipeToCloseGesture(r,i,o,(function(){t.gestureAnimationDismissing=true;setCardStatusBarDefault(t.statusBarStyle);t.animation.onFinish((function(){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.dismiss(undefined,GESTURE)];case 1:t.sent();this.gestureAnimationDismissing=false;return[2]}}))}))}))}));this.gesture.enable(true)};t.prototype.initSheetGesture=function(){var t=this;var e=this,r=e.wrapperEl,a=e.initialBreakpoint,i=e.backdropBreakpoint;if(!r||a===undefined){return}var n=this.enterAnimation||config.get("modalEnter",iosEnterAnimation);var o=this.animation=n(this.el,{presentingEl:this.presentingElement,currentBreakpoint:a,backdropBreakpoint:i,expandToScroll:this.expandToScroll});o.progressStart(true,1);var s=createSheetGesture(this.el,this.backdropEl,r,a,i,o,this.sortedBreakpoints,this.expandToScroll,(function(){var e;return(e=t.currentBreakpoint)!==null&&e!==void 0?e:0}),(function(){return t.sheetOnDismiss()}),(function(e){if(t.currentBreakpoint!==e){t.currentBreakpoint=e;t.ionBreakpointDidChange.emit({breakpoint:e})}})),d=s.gesture,l=s.moveSheetToBreakpoint;this.gesture=d;this.moveSheetToBreakpoint=l;this.gesture.enable(true)};t.prototype.sheetOnDismiss=function(){var t=this;this.gestureAnimationDismissing=true;this.animation.onFinish((function(){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:this.currentBreakpoint=0;this.ionBreakpointDidChange.emit({breakpoint:this.currentBreakpoint});return[4,this.dismiss(undefined,GESTURE)];case 1:t.sent();this.gestureAnimationDismissing=false;return[2]}}))}))}))};t.prototype.dismiss=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r,a,i,n,o,s,d;var l=this;return __generator(this,(function(f){switch(f.label){case 0:if(this.gestureAnimationDismissing&&e!==GESTURE){return[2,false]}return[4,this.lockController.lock()];case 1:a=f.sent();i=e!=="handler";if(!i)return[3,3];return[4,this.checkCanDismiss(t,e)];case 2:i=!f.sent();f.label=3;case 3:if(i){a();return[2,false]}n=this.presentingElement;o=n!==undefined;if(o&&getIonMode(this)==="ios"){setCardStatusBarDefault(this.statusBarStyle)}if(typeof window!=="undefined"&&this.keyboardOpenCallback){window.removeEventListener(KEYBOARD_DID_OPEN,this.keyboardOpenCallback);this.keyboardOpenCallback=undefined}return[4,dismiss(this,t,e,"modalLeave",iosLeaveAnimation,mdLeaveAnimation,{presentingEl:n,currentBreakpoint:(r=this.currentBreakpoint)!==null&&r!==void 0?r:this.initialBreakpoint,backdropBreakpoint:this.backdropBreakpoint,expandToScroll:this.expandToScroll})];case 4:s=f.sent();if(!s)return[3,6];d=this.getDelegate().delegate;return[4,detachComponent(d,this.usersElement)];case 5:f.sent();writeTask((function(){return l.el.classList.remove("show-modal")}));if(this.animation){this.animation.destroy()}if(this.gesture){this.gesture.destroy()}f.label=6;case 6:this.currentBreakpoint=undefined;this.animation=undefined;a();return[2,s]}}))}))};t.prototype.onDidDismiss=function(){return eventMethod(this.el,"ionModalDidDismiss")};t.prototype.onWillDismiss=function(){return eventMethod(this.el,"ionModalWillDismiss")};t.prototype.setCurrentBreakpoint=function(t){return __awaiter(this,void 0,void 0,(function(){var e,r,a,i,n,o;return __generator(this,(function(s){switch(s.label){case 0:if(!this.isSheetModal){printIonWarning("[ion-modal] - setCurrentBreakpoint is only supported on sheet modals.");return[2]}if(!this.breakpoints.includes(t)){printIonWarning("[ion-modal] - Attempted to set invalid breakpoint value ".concat(t,". Please double check that the breakpoint value is part of your defined breakpoints."));return[2]}e=this,r=e.currentBreakpoint,a=e.moveSheetToBreakpoint,i=e.canDismiss,n=e.breakpoints,o=e.animated;if(r===t){return[2]}if(!a)return[3,2];this.sheetTransition=a({breakpoint:t,breakpointOffset:1-r,canDismiss:i!==undefined&&i!==true&&n[0]===0,animated:o});return[4,this.sheetTransition];case 1:s.sent();this.sheetTransition=undefined;s.label=2;case 2:return[2]}}))}))};t.prototype.getCurrentBreakpoint=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.currentBreakpoint]}))}))};t.prototype.moveToNextBreakpoint=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,r,a,i,n,o;return __generator(this,(function(s){switch(s.label){case 0:t=this,e=t.breakpoints,r=t.currentBreakpoint;if(!e||r==null){return[2,false]}a=e.filter((function(t){return t!==0}));i=a.indexOf(r);n=(i+1)%a.length;o=a[n];return[4,this.setCurrentBreakpoint(o)];case 1:s.sent();return[2,true]}}))}))};t.prototype.render=function(){var t;var e=this;var r=this,a=r.handle,i=r.isSheetModal,n=r.presentingElement,o=r.htmlAttributes,s=r.handleBehavior,d=r.inheritedAttributes,l=r.focusTrap,f=r.expandToScroll;var c=a!==false&&i;var u=getIonMode(this);var p=n!==undefined&&u==="ios";var v=s==="cycle";return h(Host,Object.assign({key:"0991b2e4e32da511e59fb1463b47e4ac1b86d1ca","no-router":true,tabindex:"-1"},o,{style:{zIndex:"".concat(2e4+this.overlayIndex)},class:Object.assign((t={},t[u]=true,t["modal-default"]=!p&&!i,t["modal-card"]=p,t["modal-sheet"]=i,t["modal-no-expand-scroll"]=i&&!f,t["overlay-hidden"]=true,t[FOCUS_TRAP_DISABLE_CLASS]=l===false,t),getClassMap(this.cssClass)),onIonBackdropTap:this.onBackdropTap,onIonModalDidPresent:this.onLifecycle,onIonModalWillPresent:this.onLifecycle,onIonModalWillDismiss:this.onLifecycle,onIonModalDidDismiss:this.onLifecycle}),h("ion-backdrop",{key:"ca9453ffe1021fb252ad9460676cfabb5633f00f",ref:function(t){return e.backdropEl=t},visible:this.showBackdrop,tappable:this.backdropDismiss,part:"backdrop"}),u==="ios"&&h("div",{key:"9f8da446a7b0f3b26aec856e13f6d6d131a7e37b",class:"modal-shadow"}),h("div",Object.assign({key:"9d08bf600571849c97b58f66df40b496a358d1e1",role:"dialog"},d,{"aria-modal":"true",class:"modal-wrapper ion-overlay-wrapper",part:"content",ref:function(t){return e.wrapperEl=t}}),c&&h("button",{key:"f8bf0d1126e5376519101225d9965727121ee042",class:"modal-handle",tabIndex:!v?-1:0,"aria-label":"Activate to adjust the size of the dialog overlaying the screen",onClick:v?this.onHandleClick:undefined,part:"handle"}),h("slot",{key:"6d52849df98f2c6c8fbc03996a931ea6a39a512b"})))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{isOpen:["onIsOpenChange"],trigger:["triggerChanged"]}},enumerable:false,configurable:true});return t}();var LIFECYCLE_MAP={ionModalDidPresent:"ionViewDidEnter",ionModalWillPresent:"ionViewWillEnter",ionModalWillDismiss:"ionViewWillLeave",ionModalDidDismiss:"ionViewDidLeave"};Modal.style={ios:IonModalIosStyle0,md:IonModalMdStyle0};export{Modal as ion_modal};
|