@ionic/core 7.8.3-dev.11712097102.11ba32e2 → 7.8.3-dev.11712114476.152fc43d
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/ion-modal.js +43 -19
- package/dist/cjs/ion-modal.cjs.entry.js +43 -19
- package/dist/collection/components/modal/gestures/sheet.js +45 -20
- package/dist/docs.json +1 -1
- package/dist/esm/ion-modal.entry.js +43 -19
- package/dist/esm-es5/ion-modal.entry.js +1 -1
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/p-3c1d5fe3.system.entry.js +4 -0
- package/dist/ionic/p-6f79eef9.entry.js +4 -0
- package/dist/ionic/p-f7d53467.system.js +1 -1
- package/hydrate/index.js +43 -19
- package/package.json +1 -1
- package/dist/ionic/p-5f06ce0e.system.entry.js +0 -4
- package/dist/ionic/p-7827a8be.entry.js +0 -4
package/components/ion-modal.js
CHANGED
|
@@ -875,19 +875,32 @@ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, ba
|
|
|
875
875
|
}
|
|
876
876
|
const canStart = (detail) => {
|
|
877
877
|
/**
|
|
878
|
-
* If the
|
|
879
|
-
*
|
|
880
|
-
*
|
|
881
|
-
*
|
|
878
|
+
* If we are swiping on the content, swiping should only be possible if the content
|
|
879
|
+
* is scrolled all the way to the top so that we do not interfere with scrolling.
|
|
880
|
+
*
|
|
881
|
+
* We cannot assume that the `ion-content` target will remain consistent between swipes.
|
|
882
|
+
* For example, when using ion-nav within a modal it is possible to swipe, push a view,
|
|
883
|
+
* and then swipe again. The target content will not be the same between swipes.
|
|
882
884
|
*/
|
|
883
|
-
const
|
|
885
|
+
const contentEl = findClosestIonContent(detail.event.target);
|
|
884
886
|
currentBreakpoint = getCurrentBreakpoint();
|
|
885
|
-
if (currentBreakpoint === 1 &&
|
|
886
|
-
|
|
887
|
+
if (currentBreakpoint === 1 && contentEl) {
|
|
888
|
+
/**
|
|
889
|
+
* The modal should never swipe to close on the content with a refresher.
|
|
890
|
+
* Note 1: We cannot solve this by making this gesture have a higher priority than
|
|
891
|
+
* the refresher gesture as the iOS native refresh gesture uses a scroll listener in
|
|
892
|
+
* addition to a gesture.
|
|
893
|
+
*
|
|
894
|
+
* Note 2: Do not use getScrollElement here because we need this to be a synchronous
|
|
895
|
+
* operation, and getScrollElement is asynchronous.
|
|
896
|
+
*/
|
|
897
|
+
const scrollEl = isIonContent(contentEl) ? getElementRoot(contentEl).querySelector('.inner-scroll') : contentEl;
|
|
898
|
+
const hasRefresherInContent = !!contentEl.querySelector('ion-refresher');
|
|
899
|
+
return !hasRefresherInContent && scrollEl.scrollTop === 0;
|
|
887
900
|
}
|
|
888
901
|
return true;
|
|
889
902
|
};
|
|
890
|
-
const onStart = () => {
|
|
903
|
+
const onStart = (detail) => {
|
|
891
904
|
/**
|
|
892
905
|
* If canDismiss is anything other than `true`
|
|
893
906
|
* then users should be able to swipe down
|
|
@@ -902,11 +915,10 @@ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, ba
|
|
|
902
915
|
*/
|
|
903
916
|
canDismissBlocksGesture = baseEl.canDismiss !== undefined && baseEl.canDismiss !== true && minBreakpoint === 0;
|
|
904
917
|
/**
|
|
905
|
-
* If
|
|
906
|
-
*
|
|
907
|
-
* the sheet will expand and the content will scroll.
|
|
918
|
+
* If we are pulling down, then it is possible we are pulling on the content.
|
|
919
|
+
* We do not want scrolling to happen at the same time as the gesture.
|
|
908
920
|
*/
|
|
909
|
-
if (contentEl) {
|
|
921
|
+
if (detail.deltaY > 0 && contentEl) {
|
|
910
922
|
contentEl.scrollY = false;
|
|
911
923
|
}
|
|
912
924
|
raf(() => {
|
|
@@ -919,6 +931,15 @@ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, ba
|
|
|
919
931
|
animation.progressStart(true, 1 - currentBreakpoint);
|
|
920
932
|
};
|
|
921
933
|
const onMove = (detail) => {
|
|
934
|
+
/**
|
|
935
|
+
* If we are pulling down, then it is possible we are pulling on the content.
|
|
936
|
+
* We do not want scrolling to happen at the same time as the gesture.
|
|
937
|
+
* This accounts for when the user scrolls down, scrolls all the way up, and then
|
|
938
|
+
* pulls down again such that the modal should start to move.
|
|
939
|
+
*/
|
|
940
|
+
if (detail.deltaY > 0 && contentEl) {
|
|
941
|
+
contentEl.scrollY = false;
|
|
942
|
+
}
|
|
922
943
|
/**
|
|
923
944
|
* Given the change in gesture position on the Y axis,
|
|
924
945
|
* compute where the offset of the animation should be
|
|
@@ -1021,6 +1042,16 @@ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, ba
|
|
|
1021
1042
|
else if (!shouldRemainOpen) {
|
|
1022
1043
|
onDismiss();
|
|
1023
1044
|
}
|
|
1045
|
+
/**
|
|
1046
|
+
* If the sheet is going to be fully expanded then we should enable
|
|
1047
|
+
* scrolling immediately. The sheet modal animation takes ~500ms to finish
|
|
1048
|
+
* so if we wait until then there is a visible delay for when scrolling is
|
|
1049
|
+
* re-enabled. Native iOS allows for scrolling on the sheet modal as soon
|
|
1050
|
+
* as the gesture is released, so we align with that.
|
|
1051
|
+
*/
|
|
1052
|
+
if (contentEl && snapToBreakpoint === breakpoints[breakpoints.length - 1]) {
|
|
1053
|
+
contentEl.scrollY = true;
|
|
1054
|
+
}
|
|
1024
1055
|
return new Promise((resolve) => {
|
|
1025
1056
|
animation
|
|
1026
1057
|
.onFinish(() => {
|
|
@@ -1039,13 +1070,6 @@ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, ba
|
|
|
1039
1070
|
animation.progressStart(true, 1 - snapToBreakpoint);
|
|
1040
1071
|
currentBreakpoint = snapToBreakpoint;
|
|
1041
1072
|
onBreakpointChange(currentBreakpoint);
|
|
1042
|
-
/**
|
|
1043
|
-
* If the sheet is fully expanded, we can safely
|
|
1044
|
-
* enable scrolling again.
|
|
1045
|
-
*/
|
|
1046
|
-
if (contentEl && currentBreakpoint === breakpoints[breakpoints.length - 1]) {
|
|
1047
|
-
contentEl.scrollY = true;
|
|
1048
|
-
}
|
|
1049
1073
|
/**
|
|
1050
1074
|
* Backdrop should become enabled
|
|
1051
1075
|
* after the backdropBreakpoint value
|
|
@@ -881,19 +881,32 @@ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, ba
|
|
|
881
881
|
}
|
|
882
882
|
const canStart = (detail) => {
|
|
883
883
|
/**
|
|
884
|
-
* If the
|
|
885
|
-
*
|
|
886
|
-
*
|
|
887
|
-
*
|
|
884
|
+
* If we are swiping on the content, swiping should only be possible if the content
|
|
885
|
+
* is scrolled all the way to the top so that we do not interfere with scrolling.
|
|
886
|
+
*
|
|
887
|
+
* We cannot assume that the `ion-content` target will remain consistent between swipes.
|
|
888
|
+
* For example, when using ion-nav within a modal it is possible to swipe, push a view,
|
|
889
|
+
* and then swipe again. The target content will not be the same between swipes.
|
|
888
890
|
*/
|
|
889
|
-
const
|
|
891
|
+
const contentEl = index$2.findClosestIonContent(detail.event.target);
|
|
890
892
|
currentBreakpoint = getCurrentBreakpoint();
|
|
891
|
-
if (currentBreakpoint === 1 &&
|
|
892
|
-
|
|
893
|
+
if (currentBreakpoint === 1 && contentEl) {
|
|
894
|
+
/**
|
|
895
|
+
* The modal should never swipe to close on the content with a refresher.
|
|
896
|
+
* Note 1: We cannot solve this by making this gesture have a higher priority than
|
|
897
|
+
* the refresher gesture as the iOS native refresh gesture uses a scroll listener in
|
|
898
|
+
* addition to a gesture.
|
|
899
|
+
*
|
|
900
|
+
* Note 2: Do not use getScrollElement here because we need this to be a synchronous
|
|
901
|
+
* operation, and getScrollElement is asynchronous.
|
|
902
|
+
*/
|
|
903
|
+
const scrollEl = index$2.isIonContent(contentEl) ? helpers.getElementRoot(contentEl).querySelector('.inner-scroll') : contentEl;
|
|
904
|
+
const hasRefresherInContent = !!contentEl.querySelector('ion-refresher');
|
|
905
|
+
return !hasRefresherInContent && scrollEl.scrollTop === 0;
|
|
893
906
|
}
|
|
894
907
|
return true;
|
|
895
908
|
};
|
|
896
|
-
const onStart = () => {
|
|
909
|
+
const onStart = (detail) => {
|
|
897
910
|
/**
|
|
898
911
|
* If canDismiss is anything other than `true`
|
|
899
912
|
* then users should be able to swipe down
|
|
@@ -908,11 +921,10 @@ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, ba
|
|
|
908
921
|
*/
|
|
909
922
|
canDismissBlocksGesture = baseEl.canDismiss !== undefined && baseEl.canDismiss !== true && minBreakpoint === 0;
|
|
910
923
|
/**
|
|
911
|
-
* If
|
|
912
|
-
*
|
|
913
|
-
* the sheet will expand and the content will scroll.
|
|
924
|
+
* If we are pulling down, then it is possible we are pulling on the content.
|
|
925
|
+
* We do not want scrolling to happen at the same time as the gesture.
|
|
914
926
|
*/
|
|
915
|
-
if (contentEl) {
|
|
927
|
+
if (detail.deltaY > 0 && contentEl) {
|
|
916
928
|
contentEl.scrollY = false;
|
|
917
929
|
}
|
|
918
930
|
helpers.raf(() => {
|
|
@@ -925,6 +937,15 @@ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, ba
|
|
|
925
937
|
animation.progressStart(true, 1 - currentBreakpoint);
|
|
926
938
|
};
|
|
927
939
|
const onMove = (detail) => {
|
|
940
|
+
/**
|
|
941
|
+
* If we are pulling down, then it is possible we are pulling on the content.
|
|
942
|
+
* We do not want scrolling to happen at the same time as the gesture.
|
|
943
|
+
* This accounts for when the user scrolls down, scrolls all the way up, and then
|
|
944
|
+
* pulls down again such that the modal should start to move.
|
|
945
|
+
*/
|
|
946
|
+
if (detail.deltaY > 0 && contentEl) {
|
|
947
|
+
contentEl.scrollY = false;
|
|
948
|
+
}
|
|
928
949
|
/**
|
|
929
950
|
* Given the change in gesture position on the Y axis,
|
|
930
951
|
* compute where the offset of the animation should be
|
|
@@ -1027,6 +1048,16 @@ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, ba
|
|
|
1027
1048
|
else if (!shouldRemainOpen) {
|
|
1028
1049
|
onDismiss();
|
|
1029
1050
|
}
|
|
1051
|
+
/**
|
|
1052
|
+
* If the sheet is going to be fully expanded then we should enable
|
|
1053
|
+
* scrolling immediately. The sheet modal animation takes ~500ms to finish
|
|
1054
|
+
* so if we wait until then there is a visible delay for when scrolling is
|
|
1055
|
+
* re-enabled. Native iOS allows for scrolling on the sheet modal as soon
|
|
1056
|
+
* as the gesture is released, so we align with that.
|
|
1057
|
+
*/
|
|
1058
|
+
if (contentEl && snapToBreakpoint === breakpoints[breakpoints.length - 1]) {
|
|
1059
|
+
contentEl.scrollY = true;
|
|
1060
|
+
}
|
|
1030
1061
|
return new Promise((resolve) => {
|
|
1031
1062
|
animation
|
|
1032
1063
|
.onFinish(() => {
|
|
@@ -1045,13 +1076,6 @@ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, ba
|
|
|
1045
1076
|
animation.progressStart(true, 1 - snapToBreakpoint);
|
|
1046
1077
|
currentBreakpoint = snapToBreakpoint;
|
|
1047
1078
|
onBreakpointChange(currentBreakpoint);
|
|
1048
|
-
/**
|
|
1049
|
-
* If the sheet is fully expanded, we can safely
|
|
1050
|
-
* enable scrolling again.
|
|
1051
|
-
*/
|
|
1052
|
-
if (contentEl && currentBreakpoint === breakpoints[breakpoints.length - 1]) {
|
|
1053
|
-
contentEl.scrollY = true;
|
|
1054
|
-
}
|
|
1055
1079
|
/**
|
|
1056
1080
|
* Backdrop should become enabled
|
|
1057
1081
|
* after the backdropBreakpoint value
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* (C) Ionic http://ionicframework.com - MIT License
|
|
3
3
|
*/
|
|
4
|
+
import { isIonContent, findClosestIonContent } from "../../../utils/content/index";
|
|
4
5
|
import { createGesture } from "../../../utils/gesture/index";
|
|
5
|
-
import { clamp, raf } from "../../../utils/helpers";
|
|
6
|
+
import { clamp, raf, getElementRoot } from "../../../utils/helpers";
|
|
6
7
|
import { getBackdropValueForSheet } from "../utils";
|
|
7
8
|
import { calculateSpringStep, handleCanDismiss } from "./utils";
|
|
8
9
|
export const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, backdropBreakpoint, animation, breakpoints = [], getCurrentBreakpoint, onDismiss, onBreakpointChange) => {
|
|
@@ -87,19 +88,32 @@ export const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpo
|
|
|
87
88
|
}
|
|
88
89
|
const canStart = (detail) => {
|
|
89
90
|
/**
|
|
90
|
-
* If the
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
*
|
|
91
|
+
* If we are swiping on the content, swiping should only be possible if the content
|
|
92
|
+
* is scrolled all the way to the top so that we do not interfere with scrolling.
|
|
93
|
+
*
|
|
94
|
+
* We cannot assume that the `ion-content` target will remain consistent between swipes.
|
|
95
|
+
* For example, when using ion-nav within a modal it is possible to swipe, push a view,
|
|
96
|
+
* and then swipe again. The target content will not be the same between swipes.
|
|
94
97
|
*/
|
|
95
|
-
const
|
|
98
|
+
const contentEl = findClosestIonContent(detail.event.target);
|
|
96
99
|
currentBreakpoint = getCurrentBreakpoint();
|
|
97
|
-
if (currentBreakpoint === 1 &&
|
|
98
|
-
|
|
100
|
+
if (currentBreakpoint === 1 && contentEl) {
|
|
101
|
+
/**
|
|
102
|
+
* The modal should never swipe to close on the content with a refresher.
|
|
103
|
+
* Note 1: We cannot solve this by making this gesture have a higher priority than
|
|
104
|
+
* the refresher gesture as the iOS native refresh gesture uses a scroll listener in
|
|
105
|
+
* addition to a gesture.
|
|
106
|
+
*
|
|
107
|
+
* Note 2: Do not use getScrollElement here because we need this to be a synchronous
|
|
108
|
+
* operation, and getScrollElement is asynchronous.
|
|
109
|
+
*/
|
|
110
|
+
const scrollEl = isIonContent(contentEl) ? getElementRoot(contentEl).querySelector('.inner-scroll') : contentEl;
|
|
111
|
+
const hasRefresherInContent = !!contentEl.querySelector('ion-refresher');
|
|
112
|
+
return !hasRefresherInContent && scrollEl.scrollTop === 0;
|
|
99
113
|
}
|
|
100
114
|
return true;
|
|
101
115
|
};
|
|
102
|
-
const onStart = () => {
|
|
116
|
+
const onStart = (detail) => {
|
|
103
117
|
/**
|
|
104
118
|
* If canDismiss is anything other than `true`
|
|
105
119
|
* then users should be able to swipe down
|
|
@@ -114,11 +128,10 @@ export const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpo
|
|
|
114
128
|
*/
|
|
115
129
|
canDismissBlocksGesture = baseEl.canDismiss !== undefined && baseEl.canDismiss !== true && minBreakpoint === 0;
|
|
116
130
|
/**
|
|
117
|
-
* If
|
|
118
|
-
*
|
|
119
|
-
* the sheet will expand and the content will scroll.
|
|
131
|
+
* If we are pulling down, then it is possible we are pulling on the content.
|
|
132
|
+
* We do not want scrolling to happen at the same time as the gesture.
|
|
120
133
|
*/
|
|
121
|
-
if (contentEl) {
|
|
134
|
+
if (detail.deltaY > 0 && contentEl) {
|
|
122
135
|
contentEl.scrollY = false;
|
|
123
136
|
}
|
|
124
137
|
raf(() => {
|
|
@@ -131,6 +144,15 @@ export const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpo
|
|
|
131
144
|
animation.progressStart(true, 1 - currentBreakpoint);
|
|
132
145
|
};
|
|
133
146
|
const onMove = (detail) => {
|
|
147
|
+
/**
|
|
148
|
+
* If we are pulling down, then it is possible we are pulling on the content.
|
|
149
|
+
* We do not want scrolling to happen at the same time as the gesture.
|
|
150
|
+
* This accounts for when the user scrolls down, scrolls all the way up, and then
|
|
151
|
+
* pulls down again such that the modal should start to move.
|
|
152
|
+
*/
|
|
153
|
+
if (detail.deltaY > 0 && contentEl) {
|
|
154
|
+
contentEl.scrollY = false;
|
|
155
|
+
}
|
|
134
156
|
/**
|
|
135
157
|
* Given the change in gesture position on the Y axis,
|
|
136
158
|
* compute where the offset of the animation should be
|
|
@@ -233,6 +255,16 @@ export const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpo
|
|
|
233
255
|
else if (!shouldRemainOpen) {
|
|
234
256
|
onDismiss();
|
|
235
257
|
}
|
|
258
|
+
/**
|
|
259
|
+
* If the sheet is going to be fully expanded then we should enable
|
|
260
|
+
* scrolling immediately. The sheet modal animation takes ~500ms to finish
|
|
261
|
+
* so if we wait until then there is a visible delay for when scrolling is
|
|
262
|
+
* re-enabled. Native iOS allows for scrolling on the sheet modal as soon
|
|
263
|
+
* as the gesture is released, so we align with that.
|
|
264
|
+
*/
|
|
265
|
+
if (contentEl && snapToBreakpoint === breakpoints[breakpoints.length - 1]) {
|
|
266
|
+
contentEl.scrollY = true;
|
|
267
|
+
}
|
|
236
268
|
return new Promise((resolve) => {
|
|
237
269
|
animation
|
|
238
270
|
.onFinish(() => {
|
|
@@ -251,13 +283,6 @@ export const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpo
|
|
|
251
283
|
animation.progressStart(true, 1 - snapToBreakpoint);
|
|
252
284
|
currentBreakpoint = snapToBreakpoint;
|
|
253
285
|
onBreakpointChange(currentBreakpoint);
|
|
254
|
-
/**
|
|
255
|
-
* If the sheet is fully expanded, we can safely
|
|
256
|
-
* enable scrolling again.
|
|
257
|
-
*/
|
|
258
|
-
if (contentEl && currentBreakpoint === breakpoints[breakpoints.length - 1]) {
|
|
259
|
-
contentEl.scrollY = true;
|
|
260
|
-
}
|
|
261
286
|
/**
|
|
262
287
|
* Backdrop should become enabled
|
|
263
288
|
* after the backdropBreakpoint value
|
package/dist/docs.json
CHANGED
|
@@ -877,19 +877,32 @@ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, ba
|
|
|
877
877
|
}
|
|
878
878
|
const canStart = (detail) => {
|
|
879
879
|
/**
|
|
880
|
-
* If the
|
|
881
|
-
*
|
|
882
|
-
*
|
|
883
|
-
*
|
|
880
|
+
* If we are swiping on the content, swiping should only be possible if the content
|
|
881
|
+
* is scrolled all the way to the top so that we do not interfere with scrolling.
|
|
882
|
+
*
|
|
883
|
+
* We cannot assume that the `ion-content` target will remain consistent between swipes.
|
|
884
|
+
* For example, when using ion-nav within a modal it is possible to swipe, push a view,
|
|
885
|
+
* and then swipe again. The target content will not be the same between swipes.
|
|
884
886
|
*/
|
|
885
|
-
const
|
|
887
|
+
const contentEl = findClosestIonContent(detail.event.target);
|
|
886
888
|
currentBreakpoint = getCurrentBreakpoint();
|
|
887
|
-
if (currentBreakpoint === 1 &&
|
|
888
|
-
|
|
889
|
+
if (currentBreakpoint === 1 && contentEl) {
|
|
890
|
+
/**
|
|
891
|
+
* The modal should never swipe to close on the content with a refresher.
|
|
892
|
+
* Note 1: We cannot solve this by making this gesture have a higher priority than
|
|
893
|
+
* the refresher gesture as the iOS native refresh gesture uses a scroll listener in
|
|
894
|
+
* addition to a gesture.
|
|
895
|
+
*
|
|
896
|
+
* Note 2: Do not use getScrollElement here because we need this to be a synchronous
|
|
897
|
+
* operation, and getScrollElement is asynchronous.
|
|
898
|
+
*/
|
|
899
|
+
const scrollEl = isIonContent(contentEl) ? getElementRoot(contentEl).querySelector('.inner-scroll') : contentEl;
|
|
900
|
+
const hasRefresherInContent = !!contentEl.querySelector('ion-refresher');
|
|
901
|
+
return !hasRefresherInContent && scrollEl.scrollTop === 0;
|
|
889
902
|
}
|
|
890
903
|
return true;
|
|
891
904
|
};
|
|
892
|
-
const onStart = () => {
|
|
905
|
+
const onStart = (detail) => {
|
|
893
906
|
/**
|
|
894
907
|
* If canDismiss is anything other than `true`
|
|
895
908
|
* then users should be able to swipe down
|
|
@@ -904,11 +917,10 @@ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, ba
|
|
|
904
917
|
*/
|
|
905
918
|
canDismissBlocksGesture = baseEl.canDismiss !== undefined && baseEl.canDismiss !== true && minBreakpoint === 0;
|
|
906
919
|
/**
|
|
907
|
-
* If
|
|
908
|
-
*
|
|
909
|
-
* the sheet will expand and the content will scroll.
|
|
920
|
+
* If we are pulling down, then it is possible we are pulling on the content.
|
|
921
|
+
* We do not want scrolling to happen at the same time as the gesture.
|
|
910
922
|
*/
|
|
911
|
-
if (contentEl) {
|
|
923
|
+
if (detail.deltaY > 0 && contentEl) {
|
|
912
924
|
contentEl.scrollY = false;
|
|
913
925
|
}
|
|
914
926
|
raf(() => {
|
|
@@ -921,6 +933,15 @@ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, ba
|
|
|
921
933
|
animation.progressStart(true, 1 - currentBreakpoint);
|
|
922
934
|
};
|
|
923
935
|
const onMove = (detail) => {
|
|
936
|
+
/**
|
|
937
|
+
* If we are pulling down, then it is possible we are pulling on the content.
|
|
938
|
+
* We do not want scrolling to happen at the same time as the gesture.
|
|
939
|
+
* This accounts for when the user scrolls down, scrolls all the way up, and then
|
|
940
|
+
* pulls down again such that the modal should start to move.
|
|
941
|
+
*/
|
|
942
|
+
if (detail.deltaY > 0 && contentEl) {
|
|
943
|
+
contentEl.scrollY = false;
|
|
944
|
+
}
|
|
924
945
|
/**
|
|
925
946
|
* Given the change in gesture position on the Y axis,
|
|
926
947
|
* compute where the offset of the animation should be
|
|
@@ -1023,6 +1044,16 @@ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, ba
|
|
|
1023
1044
|
else if (!shouldRemainOpen) {
|
|
1024
1045
|
onDismiss();
|
|
1025
1046
|
}
|
|
1047
|
+
/**
|
|
1048
|
+
* If the sheet is going to be fully expanded then we should enable
|
|
1049
|
+
* scrolling immediately. The sheet modal animation takes ~500ms to finish
|
|
1050
|
+
* so if we wait until then there is a visible delay for when scrolling is
|
|
1051
|
+
* re-enabled. Native iOS allows for scrolling on the sheet modal as soon
|
|
1052
|
+
* as the gesture is released, so we align with that.
|
|
1053
|
+
*/
|
|
1054
|
+
if (contentEl && snapToBreakpoint === breakpoints[breakpoints.length - 1]) {
|
|
1055
|
+
contentEl.scrollY = true;
|
|
1056
|
+
}
|
|
1026
1057
|
return new Promise((resolve) => {
|
|
1027
1058
|
animation
|
|
1028
1059
|
.onFinish(() => {
|
|
@@ -1041,13 +1072,6 @@ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, ba
|
|
|
1041
1072
|
animation.progressStart(true, 1 - snapToBreakpoint);
|
|
1042
1073
|
currentBreakpoint = snapToBreakpoint;
|
|
1043
1074
|
onBreakpointChange(currentBreakpoint);
|
|
1044
|
-
/**
|
|
1045
|
-
* If the sheet is fully expanded, we can safely
|
|
1046
|
-
* enable scrolling again.
|
|
1047
|
-
*/
|
|
1048
|
-
if (contentEl && currentBreakpoint === breakpoints[breakpoints.length - 1]) {
|
|
1049
|
-
contentEl.scrollY = true;
|
|
1050
|
-
}
|
|
1051
1075
|
/**
|
|
1052
1076
|
* Backdrop should become enabled
|
|
1053
1077
|
* after the backdropBreakpoint value
|
|
@@ -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,d as createEvent,w as writeTask,h,H as Host,f as getElement}from"./index-73fa3fe8.js";import{f as findClosestIonContent,i as isIonContent,d as disableContentScrollY,r as resetContentScrollY,a as findIonContent,p as printIonContentErrorMsg}from"./index-f3946ac1.js";import{C as CoreDelegate,a as attachComponent,d as detachComponent}from"./framework-delegate-ed4ba327.js";import{g as getElementRoot,l as clamp,r as raf,k as inheritAttributes,m as hasLazyBuild}from"./helpers-be245865.js";import{c as createLockController}from"./lock-controller-316928be.js";import{p as printIonWarning}from"./index-9b0d46f4.js";import{g as getCapacitor}from"./capacitor-59395cbd.js";import{G as GESTURE,O as OVERLAY_GESTURE_PRIORITY,e as createTriggerController,B as BACKDROP,j as prepareOverlay,k as setOverlayId,f as present,g as dismiss,h as eventMethod}from"./overlays-ad4b0449.js";import{g as getClassMap}from"./theme-01f3f29c.js";import{e as deepReady,w as waitForMount}from"./index-4feaf001.js";import{b as getIonMode,c as config}from"./ionic-global-d89a6ff6.js";import{KEYBOARD_DID_OPEN}from"./keyboard-52278bd7.js";import{c as createAnimation}from"./animation-6a0c5338.js";import{g as getTimeGivenProgression}from"./cubic-bezier-fe2083dc.js";import{createGesture}from"./index-2cf77112.js";import{w as win}from"./index-a5d50daf.js";import"./hardware-back-button-65a9e284.js";import"./keyboard-73175e24.js";import"./gesture-controller-1bf57181.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},supportsDefaultStatusBarStyle:function(){var t=getCapacitor();return!!(t===null||t===void 0?void 0:t.PluginHeaders)},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||!StatusBar.supportsDefaultStatusBarStyle()){return}StatusBar.setStyle({style:Style.Dark})};var setCardStatusBarDefault=function(t){if(t===void 0){t=Style.Default}if(!win||win.innerWidth>=768||!StatusBar.supportsDefaultStatusBarStyle()){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:.93};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 u=true;var c=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;u=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 u=l?f:.9999;var h=l?calculateSpringStep(o/u):o;var p=clamp(1e-4,h,u);e.progressStep(p);if(p>=i&&c<i){setCardStatusBarDefault(r)}else if(p<i&&c>=i){setCardStatusBarDark()}c=p};var b=function(r){var l=r.velocityY;var c=r.deltaY/n;var h=c>=0&&s;var p=h?f:.9999;var v=h?calculateSpringStep(c/p):c;var m=clamp(1e-4,v,p);var b=(r.deltaY+l*1e3)/n;var g=!h&&b>=i;var x=g?-.001:.001;if(!g){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=g?computeDuration(c*n,l):computeDuration((1-m)*n,l);o=g;w.enable(false);if(d){resetContentScrollY(d,u)}e.onFinish((function(){if(!g){w.enable(true)}})).progressEnd(g?1:0,x,y);if(h&&m>p/4){handleCanDismiss(t,e)}else if(g){a()}};var w=createGesture({el:t,gestureName:"modalSwipeToClose",gesturePriority:OVERLAY_GESTURE_PRIORITY,direction:"y",threshold:10,canStart:p,onStart:v,onMove:m,onEnd:b});return w};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;var a=r===undefined||r<e;var i=a?"calc(var(--backdrop-opacity) * ".concat(e,")"):"0";var n=createAnimation("backdropAnimation").fromTo("opacity",0,i);if(a){n.beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"])}var o=createAnimation("wrapperAnimation").keyframes([{offset:0,opacity:1,transform:"translateY(100%)"},{offset:1,opacity:1,transform:"translateY(".concat(100-e*100,"%)")}]);return{wrapperAnimation:o,backdropAnimation:n}};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}};var iosEnterAnimation=function(t,e){var r=e.presentingEl,a=e.currentBreakpoint;var i=getElementRoot(t);var n=a!==undefined?createSheetEnterAnimation(e):createEnterAnimation$1(),o=n.wrapperAnimation,s=n.backdropAnimation;s.addElement(i.querySelector("ion-backdrop"));o.addElement(i.querySelectorAll(".modal-wrapper, .modal-shadow")).beforeStyles({opacity:1});var d=createAnimation("entering-base").addElement(t).easing("cubic-bezier(0.32,0.72,0,1)").duration(500).addAnimation(o);if(r){var l=window.innerWidth<768;var f=r.tagName==="ION-MODAL"&&r.presentingElement!==undefined;var u=getElementRoot(r);var c=createAnimation().beforeStyles({transform:"translateY(0)","transform-origin":"top center",overflow:"hidden"});var h=document.body;if(l){var p=!CSS.supports("width","max(0px, 1px)")?"30px":"max(30px, var(--ion-safe-area-top))";var v=f?"-10px":p;var m=SwipeToCloseDefaults.MIN_PRESENTING_SCALE;var b="translateY(".concat(v,") scale(").concat(m,")");c.afterStyles({transform:b}).beforeAddWrite((function(){return h.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:b,borderRadius:"10px 10px 0 0"}]);d.addAnimation(c)}else{d.addAnimation(s);if(!f){o.fromTo("opacity","0","1")}else{var m=f?SwipeToCloseDefaults.MIN_PRESENTING_SCALE:1;var b="translateY(-10px) scale(".concat(m,")");c.afterStyles({transform:b}).addElement(u.querySelector(".modal-wrapper")).keyframes([{offset:0,filter:"contrast(1)",transform:"translateY(0) scale(1)"},{offset:1,filter:"contrast(0.85)",transform:b}]);var w=createAnimation().afterStyles({transform:b}).addElement(u.querySelector(".modal-shadow")).keyframes([{offset:0,opacity:"1",transform:"translateY(0) scale(1)"},{offset:1,opacity:"0",transform:b}]);d.addAnimation([c,w])}}}else{d.addAnimation(s)}return d};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 u=a.tagName==="ION-MODAL"&&a.presentingElement!==undefined;var c=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=u?"-10px":v;var b=SwipeToCloseDefaults.MIN_PRESENTING_SCALE;var w="translateY(".concat(m,") scale(").concat(b,")");h.addElement(a).keyframes([{offset:0,filter:"contrast(0.85)",transform:w,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(!u){s.fromTo("opacity","1","0")}else{var b=u?SwipeToCloseDefaults.MIN_PRESENTING_SCALE:1;var w="translateY(-10px) scale(".concat(b,")");h.addElement(c.querySelector(".modal-wrapper")).afterStyles({transform:"translate3d(0, 0, 0)"}).keyframes([{offset:0,filter:"contrast(0.85)",transform:w},{offset:1,filter:"contrast(1)",transform:"translateY(0) scale(1)"}]);var g=createAnimation().addElement(c.querySelector(".modal-shadow")).afterStyles({transform:"translateY(0) scale(1)"}).keyframes([{offset:0,opacity:"0",transform:w},{offset:1,opacity:"1",transform:"translateY(0) scale(1)"}]);l.addAnimation([h,g])}}}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}};var mdEnterAnimation=function(t,e){var r=e.currentBreakpoint;var a=getElementRoot(t);var i=r!==undefined?createSheetEnterAnimation(e):createEnterAnimation(),n=i.wrapperAnimation,o=i.backdropAnimation;o.addElement(a.querySelector("ion-backdrop"));n.addElement(a.querySelector(".modal-wrapper"));return createAnimation().addElement(t).easing("cubic-bezier(0.36,0.66,0.04,1)").duration(280).addAnimation([o,n])};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"));return createAnimation().easing("cubic-bezier(0.47,0,0.745,0.715)").duration(200).addAnimation([o,n])};var createSheetGesture=function(t,e,r,a,i,n,o,s,d,l){if(o===void 0){o=[]}var f=[{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 c={WRAPPER_KEYFRAMES:[{offset:0,transform:"translateY(0%)"},{offset:1,transform:"translateY(100%)"}],BACKDROP_KEYFRAMES:i!==0?u:f};var h=t.querySelector("ion-content");var p=r.clientHeight;var v=a;var m=0;var b=false;var w=.95;var g=n.childAnimations.find((function(t){return t.id==="wrapperAnimation"}));var x=n.childAnimations.find((function(t){return t.id==="backdropAnimation"}));var y=o[o.length-1];var k=o[0];var A=function(){t.style.setProperty("pointer-events","auto");e.style.setProperty("pointer-events","auto");t.classList.remove("ion-disable-focus-trap")};var S=function(){t.style.setProperty("pointer-events","none");e.style.setProperty("pointer-events","none");t.classList.add("ion-disable-focus-trap")};if(g&&x){g.keyframes(__spreadArray([],c.WRAPPER_KEYFRAMES,true));x.keyframes(__spreadArray([],c.BACKDROP_KEYFRAMES,true));n.progressStart(true,1-v);var E=v>i;if(E){A()}else{S()}}if(h&&v!==y){h.scrollY=false}var C=function(t){var e=t.event.target.closest("ion-content");v=s();if(v===1&&e){return false}return true};var _=function(){b=t.canDismiss!==undefined&&t.canDismiss!==true&&k===0;if(h){h.scrollY=false}raf((function(){t.focus()}));n.progressStart(true,1-v)};var D=function(t){var e=1-v;var r=o.length>1?1-o[1]:undefined;var a=e+t.deltaY/p;var i=r!==undefined&&a>=r&&b;var s=i?w:.9999;var d=i&&r!==undefined?r+calculateSpringStep((a-r)/(s-r)):a;m=clamp(1e-4,d,s);n.progressStep(m)};var M=function(t){var e=t.velocityY;var r=(t.deltaY+e*350)/p;var a=v-r;var i=o.reduce((function(t,e){return Math.abs(e-a)<Math.abs(t-a)?e:t}));I({breakpoint:i,breakpointOffset:m,canDismiss:b,animated:true})};var I=function(e){var r=e.breakpoint,a=e.canDismiss,s=e.breakpointOffset,f=e.animated;var u=a&&r===0;var p=u?v:r;var m=p!==0;v=0;if(g&&x){g.keyframes([{offset:0,transform:"translateY(".concat(s*100,"%)")},{offset:1,transform:"translateY(".concat((1-p)*100,"%)")}]);x.keyframes([{offset:0,opacity:"calc(var(--backdrop-opacity) * ".concat(getBackdropValueForSheet(1-s,i),")")},{offset:1,opacity:"calc(var(--backdrop-opacity) * ".concat(getBackdropValueForSheet(p,i),")")}]);n.progressStep(0)}Y.enable(false);if(u){handleCanDismiss(t,n)}else if(!m){d()}return new Promise((function(t){n.onFinish((function(){if(m){if(g&&x){raf((function(){g.keyframes(__spreadArray([],c.WRAPPER_KEYFRAMES,true));x.keyframes(__spreadArray([],c.BACKDROP_KEYFRAMES,true));n.progressStart(true,1-p);v=p;l(v);if(h&&v===o[o.length-1]){h.scrollY=true}var e=v>i;if(e){A()}else{S()}Y.enable(true);t()}))}else{Y.enable(true);t()}}else{t()}}),{oneTimeCallback:true}).progressEnd(1,0,f?500:0)}))};var Y=createGesture({el:r,gestureName:"modalSheet",gesturePriority:40,direction:"y",threshold:10,canStart:C,onStart:_,onMove:D,onEnd:M});return{gesture:Y,moveSheetToBreakpoint:I}};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, #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{--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-top-left-radius:var(--border-radius);border-top-right-radius:var(--border-radius);border-bottom-right-radius:0;border-bottom-left-radius:0}:host-context([dir=rtl]):host(.modal-card) .modal-wrapper,:host-context([dir=rtl]).modal-card .modal-wrapper{border-top-left-radius:var(--border-radius);border-top-right-radius:var(--border-radius);border-bottom-right-radius:0;border-bottom-left-radius:0}@supports selector(:dir(rtl)){:host(.modal-card:dir(rtl)) .modal-wrapper{border-top-left-radius:var(--border-radius);border-top-right-radius:var(--border-radius);border-bottom-right-radius:0;border-bottom-left-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-top-left-radius:var(--border-radius);border-top-right-radius:var(--border-radius);border-bottom-right-radius:0;border-bottom-left-radius:0}:host-context([dir=rtl]):host(.modal-sheet) .modal-wrapper,:host-context([dir=rtl]).modal-sheet .modal-wrapper{border-top-left-radius:var(--border-radius);border-top-right-radius:var(--border-radius);border-bottom-right-radius:0;border-bottom-left-radius:0}@supports selector(:dir(rtl)){:host(.modal-sheet:dir(rtl)) .modal-wrapper{border-top-left-radius:var(--border-radius);border-top-right-radius:var(--border-radius);border-bottom-right-radius:0;border-bottom-left-radius:0}}';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, #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{--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.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.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=this,r=e.breakpoints,a=e.initialBreakpoint,i=e.el,n=e.htmlAttributes;var o=this.isSheetModal=r!==undefined&&a!==undefined;var s=["aria-label","role"];this.inheritedAttributes=inheritAttributes(i,s);if(n!==undefined){s.forEach((function(e){var r;var a=n[e];if(a){t.inheritedAttributes=Object.assign(Object.assign({},t.inheritedAttributes),(r={},r[e]=n[e],r));delete n[e]}}))}if(o){this.currentBreakpoint=this.initialBreakpoint}if(r!==undefined&&a!==undefined&&!r.includes(a)){printIonWarning("Your breakpoints array must include the initialBreakpoint value.")}setOverlayId(i)};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(u){switch(u.label){case 0:return[4,this.lockController.lock()];case 1:t=u.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=u.sent();if(!hasLazyBuild(a))return[3,4];return[4,deepReady(this.usersElement)];case 3:u.sent();return[3,6];case 4:if(!!this.keepContentsMounted)return[3,6];return[4,waitForMount()];case 5:u.sent();u.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=u.sent();setCardStatusBarDark();u.label=8;case 8:return[4,present(this,"modalEnter",iosEnterAnimation,mdEnterAnimation,{presentingEl:r,currentBreakpoint:this.initialBreakpoint,backdropBreakpoint:this.backdropBreakpoint})];case 9:u.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});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});o.progressStart(true,1);var s=createSheetGesture(this.el,this.backdropEl,r,a,i,o,this.sortedBreakpoints,(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})];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("setCurrentBreakpoint is only supported on sheet modals.");return[2]}if(!this.breakpoints.includes(t)){printIonWarning("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;var l=a!==false&&i;var f=getIonMode(this);var u=n!==undefined&&f==="ios";var c=s==="cycle";return h(Host,Object.assign({key:"67ef0269a5e9b542d0c2acaa03a2f7f46b8cf0b5","no-router":true,tabindex:"-1"},o,{style:{zIndex:"".concat(2e4+this.overlayIndex)},class:Object.assign((t={},t[f]=true,t["modal-default"]=!u&&!i,t["modal-card"]=u,t["modal-sheet"]=i,t["overlay-hidden"]=true,t),getClassMap(this.cssClass)),onIonBackdropTap:this.onBackdropTap,onIonModalDidPresent:this.onLifecycle,onIonModalWillPresent:this.onLifecycle,onIonModalWillDismiss:this.onLifecycle,onIonModalDidDismiss:this.onLifecycle}),h("ion-backdrop",{key:"edd98375e98d887dbea232adb81b74f164fa058b",ref:function(t){return e.backdropEl=t},visible:this.showBackdrop,tappable:this.backdropDismiss,part:"backdrop"}),f==="ios"&&h("div",{class:"modal-shadow"}),h("div",Object.assign({key:"40437670391544b57b8a9943ef3b49de7acbd873",role:"dialog"},d,{"aria-modal":"true",class:"modal-wrapper ion-overlay-wrapper",part:"content",ref:function(t){return e.wrapperEl=t}}),l&&h("button",{class:"modal-handle",tabIndex:!c?-1:0,"aria-label":"Activate to adjust the size of the dialog overlaying the screen",onClick:c?this.onHandleClick:undefined,part:"handle"}),h("slot",{key:"dfe2095d9e1adb075dc09d1927ef24ea09ea5435"})))};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,d as createEvent,w as writeTask,h,H as Host,f as getElement}from"./index-73fa3fe8.js";import{f as findClosestIonContent,i as isIonContent,d as disableContentScrollY,r as resetContentScrollY,a as findIonContent,p as printIonContentErrorMsg}from"./index-f3946ac1.js";import{C as CoreDelegate,a as attachComponent,d as detachComponent}from"./framework-delegate-ed4ba327.js";import{g as getElementRoot,l as clamp,r as raf,k as inheritAttributes,m as hasLazyBuild}from"./helpers-be245865.js";import{c as createLockController}from"./lock-controller-316928be.js";import{p as printIonWarning}from"./index-9b0d46f4.js";import{g as getCapacitor}from"./capacitor-59395cbd.js";import{G as GESTURE,O as OVERLAY_GESTURE_PRIORITY,e as createTriggerController,B as BACKDROP,j as prepareOverlay,k as setOverlayId,f as present,g as dismiss,h as eventMethod}from"./overlays-ad4b0449.js";import{g as getClassMap}from"./theme-01f3f29c.js";import{e as deepReady,w as waitForMount}from"./index-4feaf001.js";import{b as getIonMode,c as config}from"./ionic-global-d89a6ff6.js";import{KEYBOARD_DID_OPEN}from"./keyboard-52278bd7.js";import{c as createAnimation}from"./animation-6a0c5338.js";import{g as getTimeGivenProgression}from"./cubic-bezier-fe2083dc.js";import{createGesture}from"./index-2cf77112.js";import{w as win}from"./index-a5d50daf.js";import"./hardware-back-button-65a9e284.js";import"./keyboard-73175e24.js";import"./gesture-controller-1bf57181.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},supportsDefaultStatusBarStyle:function(){var t=getCapacitor();return!!(t===null||t===void 0?void 0:t.PluginHeaders)},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||!StatusBar.supportsDefaultStatusBarStyle()){return}StatusBar.setStyle({style:Style.Dark})};var setCardStatusBarDefault=function(t){if(t===void 0){t=Style.Default}if(!win||win.innerWidth>=768||!StatusBar.supportsDefaultStatusBarStyle()){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:.93};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 u=true;var c=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;u=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 u=l?f:.9999;var h=l?calculateSpringStep(o/u):o;var p=clamp(1e-4,h,u);e.progressStep(p);if(p>=i&&c<i){setCardStatusBarDefault(r)}else if(p<i&&c>=i){setCardStatusBarDark()}c=p};var b=function(r){var l=r.velocityY;var c=r.deltaY/n;var h=c>=0&&s;var p=h?f:.9999;var v=h?calculateSpringStep(c/p):c;var m=clamp(1e-4,v,p);var b=(r.deltaY+l*1e3)/n;var g=!h&&b>=i;var x=g?-.001:.001;if(!g){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=g?computeDuration(c*n,l):computeDuration((1-m)*n,l);o=g;w.enable(false);if(d){resetContentScrollY(d,u)}e.onFinish((function(){if(!g){w.enable(true)}})).progressEnd(g?1:0,x,y);if(h&&m>p/4){handleCanDismiss(t,e)}else if(g){a()}};var w=createGesture({el:t,gestureName:"modalSwipeToClose",gesturePriority:OVERLAY_GESTURE_PRIORITY,direction:"y",threshold:10,canStart:p,onStart:v,onMove:m,onEnd:b});return w};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;var a=r===undefined||r<e;var i=a?"calc(var(--backdrop-opacity) * ".concat(e,")"):"0";var n=createAnimation("backdropAnimation").fromTo("opacity",0,i);if(a){n.beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"])}var o=createAnimation("wrapperAnimation").keyframes([{offset:0,opacity:1,transform:"translateY(100%)"},{offset:1,opacity:1,transform:"translateY(".concat(100-e*100,"%)")}]);return{wrapperAnimation:o,backdropAnimation:n}};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}};var iosEnterAnimation=function(t,e){var r=e.presentingEl,a=e.currentBreakpoint;var i=getElementRoot(t);var n=a!==undefined?createSheetEnterAnimation(e):createEnterAnimation$1(),o=n.wrapperAnimation,s=n.backdropAnimation;s.addElement(i.querySelector("ion-backdrop"));o.addElement(i.querySelectorAll(".modal-wrapper, .modal-shadow")).beforeStyles({opacity:1});var d=createAnimation("entering-base").addElement(t).easing("cubic-bezier(0.32,0.72,0,1)").duration(500).addAnimation(o);if(r){var l=window.innerWidth<768;var f=r.tagName==="ION-MODAL"&&r.presentingElement!==undefined;var u=getElementRoot(r);var c=createAnimation().beforeStyles({transform:"translateY(0)","transform-origin":"top center",overflow:"hidden"});var h=document.body;if(l){var p=!CSS.supports("width","max(0px, 1px)")?"30px":"max(30px, var(--ion-safe-area-top))";var v=f?"-10px":p;var m=SwipeToCloseDefaults.MIN_PRESENTING_SCALE;var b="translateY(".concat(v,") scale(").concat(m,")");c.afterStyles({transform:b}).beforeAddWrite((function(){return h.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:b,borderRadius:"10px 10px 0 0"}]);d.addAnimation(c)}else{d.addAnimation(s);if(!f){o.fromTo("opacity","0","1")}else{var m=f?SwipeToCloseDefaults.MIN_PRESENTING_SCALE:1;var b="translateY(-10px) scale(".concat(m,")");c.afterStyles({transform:b}).addElement(u.querySelector(".modal-wrapper")).keyframes([{offset:0,filter:"contrast(1)",transform:"translateY(0) scale(1)"},{offset:1,filter:"contrast(0.85)",transform:b}]);var w=createAnimation().afterStyles({transform:b}).addElement(u.querySelector(".modal-shadow")).keyframes([{offset:0,opacity:"1",transform:"translateY(0) scale(1)"},{offset:1,opacity:"0",transform:b}]);d.addAnimation([c,w])}}}else{d.addAnimation(s)}return d};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 u=a.tagName==="ION-MODAL"&&a.presentingElement!==undefined;var c=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=u?"-10px":v;var b=SwipeToCloseDefaults.MIN_PRESENTING_SCALE;var w="translateY(".concat(m,") scale(").concat(b,")");h.addElement(a).keyframes([{offset:0,filter:"contrast(0.85)",transform:w,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(!u){s.fromTo("opacity","1","0")}else{var b=u?SwipeToCloseDefaults.MIN_PRESENTING_SCALE:1;var w="translateY(-10px) scale(".concat(b,")");h.addElement(c.querySelector(".modal-wrapper")).afterStyles({transform:"translate3d(0, 0, 0)"}).keyframes([{offset:0,filter:"contrast(0.85)",transform:w},{offset:1,filter:"contrast(1)",transform:"translateY(0) scale(1)"}]);var g=createAnimation().addElement(c.querySelector(".modal-shadow")).afterStyles({transform:"translateY(0) scale(1)"}).keyframes([{offset:0,opacity:"0",transform:w},{offset:1,opacity:"1",transform:"translateY(0) scale(1)"}]);l.addAnimation([h,g])}}}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}};var mdEnterAnimation=function(t,e){var r=e.currentBreakpoint;var a=getElementRoot(t);var i=r!==undefined?createSheetEnterAnimation(e):createEnterAnimation(),n=i.wrapperAnimation,o=i.backdropAnimation;o.addElement(a.querySelector("ion-backdrop"));n.addElement(a.querySelector(".modal-wrapper"));return createAnimation().addElement(t).easing("cubic-bezier(0.36,0.66,0.04,1)").duration(280).addAnimation([o,n])};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"));return createAnimation().easing("cubic-bezier(0.47,0,0.745,0.715)").duration(200).addAnimation([o,n])};var createSheetGesture=function(t,e,r,a,i,n,o,s,d,l){if(o===void 0){o=[]}var f=[{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 c={WRAPPER_KEYFRAMES:[{offset:0,transform:"translateY(0%)"},{offset:1,transform:"translateY(100%)"}],BACKDROP_KEYFRAMES:i!==0?u:f};var h=t.querySelector("ion-content");var p=r.clientHeight;var v=a;var m=0;var b=false;var w=.95;var g=n.childAnimations.find((function(t){return t.id==="wrapperAnimation"}));var x=n.childAnimations.find((function(t){return t.id==="backdropAnimation"}));var y=o[o.length-1];var k=o[0];var A=function(){t.style.setProperty("pointer-events","auto");e.style.setProperty("pointer-events","auto");t.classList.remove("ion-disable-focus-trap")};var E=function(){t.style.setProperty("pointer-events","none");e.style.setProperty("pointer-events","none");t.classList.add("ion-disable-focus-trap")};if(g&&x){g.keyframes(__spreadArray([],c.WRAPPER_KEYFRAMES,true));x.keyframes(__spreadArray([],c.BACKDROP_KEYFRAMES,true));n.progressStart(true,1-v);var S=v>i;if(S){A()}else{E()}}if(h&&v!==y){h.scrollY=false}var C=function(t){var e=findClosestIonContent(t.event.target);v=s();if(v===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 _=function(e){b=t.canDismiss!==undefined&&t.canDismiss!==true&&k===0;if(e.deltaY>0&&h){h.scrollY=false}raf((function(){t.focus()}));n.progressStart(true,1-v)};var D=function(t){if(t.deltaY>0&&h){h.scrollY=false}var e=1-v;var r=o.length>1?1-o[1]:undefined;var a=e+t.deltaY/p;var i=r!==undefined&&a>=r&&b;var s=i?w:.9999;var d=i&&r!==undefined?r+calculateSpringStep((a-r)/(s-r)):a;m=clamp(1e-4,d,s);n.progressStep(m)};var I=function(t){var e=t.velocityY;var r=(t.deltaY+e*350)/p;var a=v-r;var i=o.reduce((function(t,e){return Math.abs(e-a)<Math.abs(t-a)?e:t}));M({breakpoint:i,breakpointOffset:m,canDismiss:b,animated:true})};var M=function(e){var r=e.breakpoint,a=e.canDismiss,s=e.breakpointOffset,f=e.animated;var u=a&&r===0;var p=u?v:r;var m=p!==0;v=0;if(g&&x){g.keyframes([{offset:0,transform:"translateY(".concat(s*100,"%)")},{offset:1,transform:"translateY(".concat((1-p)*100,"%)")}]);x.keyframes([{offset:0,opacity:"calc(var(--backdrop-opacity) * ".concat(getBackdropValueForSheet(1-s,i),")")},{offset:1,opacity:"calc(var(--backdrop-opacity) * ".concat(getBackdropValueForSheet(p,i),")")}]);n.progressStep(0)}Y.enable(false);if(u){handleCanDismiss(t,n)}else if(!m){d()}if(h&&p===o[o.length-1]){h.scrollY=true}return new Promise((function(t){n.onFinish((function(){if(m){if(g&&x){raf((function(){g.keyframes(__spreadArray([],c.WRAPPER_KEYFRAMES,true));x.keyframes(__spreadArray([],c.BACKDROP_KEYFRAMES,true));n.progressStart(true,1-p);v=p;l(v);var e=v>i;if(e){A()}else{E()}Y.enable(true);t()}))}else{Y.enable(true);t()}}else{t()}}),{oneTimeCallback:true}).progressEnd(1,0,f?500:0)}))};var Y=createGesture({el:r,gestureName:"modalSheet",gesturePriority:40,direction:"y",threshold:10,canStart:C,onStart:_,onMove:D,onEnd:I});return{gesture:Y,moveSheetToBreakpoint:M}};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, #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{--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-top-left-radius:var(--border-radius);border-top-right-radius:var(--border-radius);border-bottom-right-radius:0;border-bottom-left-radius:0}:host-context([dir=rtl]):host(.modal-card) .modal-wrapper,:host-context([dir=rtl]).modal-card .modal-wrapper{border-top-left-radius:var(--border-radius);border-top-right-radius:var(--border-radius);border-bottom-right-radius:0;border-bottom-left-radius:0}@supports selector(:dir(rtl)){:host(.modal-card:dir(rtl)) .modal-wrapper{border-top-left-radius:var(--border-radius);border-top-right-radius:var(--border-radius);border-bottom-right-radius:0;border-bottom-left-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-top-left-radius:var(--border-radius);border-top-right-radius:var(--border-radius);border-bottom-right-radius:0;border-bottom-left-radius:0}:host-context([dir=rtl]):host(.modal-sheet) .modal-wrapper,:host-context([dir=rtl]).modal-sheet .modal-wrapper{border-top-left-radius:var(--border-radius);border-top-right-radius:var(--border-radius);border-bottom-right-radius:0;border-bottom-left-radius:0}@supports selector(:dir(rtl)){:host(.modal-sheet:dir(rtl)) .modal-wrapper{border-top-left-radius:var(--border-radius);border-top-right-radius:var(--border-radius);border-bottom-right-radius:0;border-bottom-left-radius:0}}';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, #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{--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.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.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=this,r=e.breakpoints,a=e.initialBreakpoint,i=e.el,n=e.htmlAttributes;var o=this.isSheetModal=r!==undefined&&a!==undefined;var s=["aria-label","role"];this.inheritedAttributes=inheritAttributes(i,s);if(n!==undefined){s.forEach((function(e){var r;var a=n[e];if(a){t.inheritedAttributes=Object.assign(Object.assign({},t.inheritedAttributes),(r={},r[e]=n[e],r));delete n[e]}}))}if(o){this.currentBreakpoint=this.initialBreakpoint}if(r!==undefined&&a!==undefined&&!r.includes(a)){printIonWarning("Your breakpoints array must include the initialBreakpoint value.")}setOverlayId(i)};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(u){switch(u.label){case 0:return[4,this.lockController.lock()];case 1:t=u.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=u.sent();if(!hasLazyBuild(a))return[3,4];return[4,deepReady(this.usersElement)];case 3:u.sent();return[3,6];case 4:if(!!this.keepContentsMounted)return[3,6];return[4,waitForMount()];case 5:u.sent();u.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=u.sent();setCardStatusBarDark();u.label=8;case 8:return[4,present(this,"modalEnter",iosEnterAnimation,mdEnterAnimation,{presentingEl:r,currentBreakpoint:this.initialBreakpoint,backdropBreakpoint:this.backdropBreakpoint})];case 9:u.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});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});o.progressStart(true,1);var s=createSheetGesture(this.el,this.backdropEl,r,a,i,o,this.sortedBreakpoints,(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})];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("setCurrentBreakpoint is only supported on sheet modals.");return[2]}if(!this.breakpoints.includes(t)){printIonWarning("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;var l=a!==false&&i;var f=getIonMode(this);var u=n!==undefined&&f==="ios";var c=s==="cycle";return h(Host,Object.assign({key:"67ef0269a5e9b542d0c2acaa03a2f7f46b8cf0b5","no-router":true,tabindex:"-1"},o,{style:{zIndex:"".concat(2e4+this.overlayIndex)},class:Object.assign((t={},t[f]=true,t["modal-default"]=!u&&!i,t["modal-card"]=u,t["modal-sheet"]=i,t["overlay-hidden"]=true,t),getClassMap(this.cssClass)),onIonBackdropTap:this.onBackdropTap,onIonModalDidPresent:this.onLifecycle,onIonModalWillPresent:this.onLifecycle,onIonModalWillDismiss:this.onLifecycle,onIonModalDidDismiss:this.onLifecycle}),h("ion-backdrop",{key:"edd98375e98d887dbea232adb81b74f164fa058b",ref:function(t){return e.backdropEl=t},visible:this.showBackdrop,tappable:this.backdropDismiss,part:"backdrop"}),f==="ios"&&h("div",{class:"modal-shadow"}),h("div",Object.assign({key:"40437670391544b57b8a9943ef3b49de7acbd873",role:"dialog"},d,{"aria-modal":"true",class:"modal-wrapper ion-overlay-wrapper",part:"content",ref:function(t){return e.wrapperEl=t}}),l&&h("button",{class:"modal-handle",tabIndex:!c?-1:0,"aria-label":"Activate to adjust the size of the dialog overlaying the screen",onClick:c?this.onHandleClick:undefined,part:"handle"}),h("slot",{key:"dfe2095d9e1adb075dc09d1927ef24ea09ea5435"})))};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};
|