@ionic/core 7.7.3 → 7.7.4-dev.11709154993.1b49c313
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 +37 -5
- package/dist/cjs/ion-modal.cjs.entry.js +37 -5
- package/dist/collection/components/modal/modal.js +37 -5
- package/dist/collection/components/modal/test/modal-attributes.spec.js +32 -0
- package/dist/docs.json +1 -1
- package/dist/esm/ion-modal.entry.js +37 -5
- package/dist/esm-es5/ion-modal.entry.js +1 -1
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/p-0061c257.entry.js +4 -0
- package/dist/ionic/p-0b34d3a7.system.js +1 -1
- package/dist/ionic/{p-7d09d61a.system.entry.js → p-0b782305.system.entry.js} +1 -1
- package/hydrate/index.js +37 -5
- package/package.json +1 -2
- package/dist/collection/components/modal/test/a11y/modal.spec.js +0 -22
- package/dist/ionic/p-1c5fb08b.entry.js +0 -4
package/components/ion-modal.js
CHANGED
|
@@ -1214,9 +1214,41 @@ const Modal = /*@__PURE__*/ proxyCustomElement(class Modal extends HTMLElement {
|
|
|
1214
1214
|
this.triggerController.removeClickListener();
|
|
1215
1215
|
}
|
|
1216
1216
|
componentWillLoad() {
|
|
1217
|
-
const { breakpoints, initialBreakpoint, el } = this;
|
|
1217
|
+
const { breakpoints, initialBreakpoint, el, htmlAttributes } = this;
|
|
1218
1218
|
const isSheetModal = (this.isSheetModal = breakpoints !== undefined && initialBreakpoint !== undefined);
|
|
1219
|
-
|
|
1219
|
+
const attributesToInherit = ['aria-label', 'role'];
|
|
1220
|
+
this.inheritedAttributes = inheritAttributes(el, attributesToInherit);
|
|
1221
|
+
/**
|
|
1222
|
+
* When using a controller modal you can set attributes
|
|
1223
|
+
* using the htmlAttributes property. Since the above attributes
|
|
1224
|
+
* need to be inherited inside of the modal, we need to look
|
|
1225
|
+
* and see if these attributes are being set via htmlAttributes.
|
|
1226
|
+
*
|
|
1227
|
+
* We could alternatively move this to componentDidLoad to simplify the work
|
|
1228
|
+
* here, but we'd then need to make inheritedAttributes a State variable,
|
|
1229
|
+
* thus causing another render to always happen after the first render.
|
|
1230
|
+
*/
|
|
1231
|
+
if (htmlAttributes !== undefined) {
|
|
1232
|
+
attributesToInherit.forEach((attribute) => {
|
|
1233
|
+
const attributeValue = htmlAttributes[attribute];
|
|
1234
|
+
if (attributeValue) {
|
|
1235
|
+
/**
|
|
1236
|
+
* If an attribute we need to inherit was
|
|
1237
|
+
* set using htmlAttributes then add it to
|
|
1238
|
+
* inheritedAttributes and remove it from htmlAttributes.
|
|
1239
|
+
* This ensures the attribute is inherited and not
|
|
1240
|
+
* set on the host.
|
|
1241
|
+
*
|
|
1242
|
+
* In this case, if an inherited attribute is set
|
|
1243
|
+
* on the host element and using htmlAttributes then
|
|
1244
|
+
* htmlAttributes wins, but that's not a pattern that we recommend.
|
|
1245
|
+
* The only time you'd need htmlAttributes is when using modalController.
|
|
1246
|
+
*/
|
|
1247
|
+
this.inheritedAttributes = Object.assign(Object.assign({}, this.inheritedAttributes), { [attribute]: htmlAttributes[attribute] });
|
|
1248
|
+
delete htmlAttributes[attribute];
|
|
1249
|
+
}
|
|
1250
|
+
});
|
|
1251
|
+
}
|
|
1220
1252
|
if (isSheetModal) {
|
|
1221
1253
|
this.currentBreakpoint = this.initialBreakpoint;
|
|
1222
1254
|
}
|
|
@@ -1613,9 +1645,9 @@ const Modal = /*@__PURE__*/ proxyCustomElement(class Modal extends HTMLElement {
|
|
|
1613
1645
|
const mode = getIonMode(this);
|
|
1614
1646
|
const isCardModal = presentingElement !== undefined && mode === 'ios';
|
|
1615
1647
|
const isHandleCycle = handleBehavior === 'cycle';
|
|
1616
|
-
return (h(Host, Object.assign({ key: '
|
|
1648
|
+
return (h(Host, Object.assign({ key: 'dc2a6eeef178248a43690fe5b2176ca7b4417032', "no-router": true, tabindex: "-1" }, htmlAttributes, { style: {
|
|
1617
1649
|
zIndex: `${20000 + this.overlayIndex}`,
|
|
1618
|
-
}, class: Object.assign({ [mode]: true, ['modal-default']: !isCardModal && !isSheetModal, [`modal-card`]: isCardModal, [`modal-sheet`]: isSheetModal, 'overlay-hidden': true }, getClassMap(this.cssClass)), onIonBackdropTap: this.onBackdropTap, onIonModalDidPresent: this.onLifecycle, onIonModalWillPresent: this.onLifecycle, onIonModalWillDismiss: this.onLifecycle, onIonModalDidDismiss: this.onLifecycle }), h("ion-backdrop", { key: '
|
|
1650
|
+
}, class: Object.assign({ [mode]: true, ['modal-default']: !isCardModal && !isSheetModal, [`modal-card`]: isCardModal, [`modal-sheet`]: isSheetModal, 'overlay-hidden': true }, getClassMap(this.cssClass)), onIonBackdropTap: this.onBackdropTap, onIonModalDidPresent: this.onLifecycle, onIonModalWillPresent: this.onLifecycle, onIonModalWillDismiss: this.onLifecycle, onIonModalDidDismiss: this.onLifecycle }), h("ion-backdrop", { key: '9cc78514469001d8366ce381ad50a73bd333fd1d', ref: (el) => (this.backdropEl = el), visible: this.showBackdrop, tappable: this.backdropDismiss, part: "backdrop" }), mode === 'ios' && h("div", { class: "modal-shadow" }), h("div", Object.assign({ key: '3814c9453017e61107003e2a599baa8fb5865436',
|
|
1619
1651
|
/*
|
|
1620
1652
|
role and aria-modal must be used on the
|
|
1621
1653
|
same element. They must also be set inside the
|
|
@@ -1624,7 +1656,7 @@ const Modal = /*@__PURE__*/ proxyCustomElement(class Modal extends HTMLElement {
|
|
|
1624
1656
|
*/
|
|
1625
1657
|
role: "dialog" }, inheritedAttributes, { "aria-modal": "true", class: "modal-wrapper ion-overlay-wrapper", part: "content", ref: (el) => (this.wrapperEl = el) }), showHandle && (h("button", { class: "modal-handle",
|
|
1626
1658
|
// Prevents the handle from receiving keyboard focus when it does not cycle
|
|
1627
|
-
tabIndex: !isHandleCycle ? -1 : 0, "aria-label": "Activate to adjust the size of the dialog overlaying the screen", onClick: isHandleCycle ? this.onHandleClick : undefined, part: "handle" })), h("slot", { key: '
|
|
1659
|
+
tabIndex: !isHandleCycle ? -1 : 0, "aria-label": "Activate to adjust the size of the dialog overlaying the screen", onClick: isHandleCycle ? this.onHandleClick : undefined, part: "handle" })), h("slot", { key: '49a2f27e0e1e742ffab2b45d94fc2906f3a1a098' }))));
|
|
1628
1660
|
}
|
|
1629
1661
|
get el() { return this; }
|
|
1630
1662
|
static get watchers() { return {
|
|
@@ -1218,9 +1218,41 @@ const Modal = class {
|
|
|
1218
1218
|
this.triggerController.removeClickListener();
|
|
1219
1219
|
}
|
|
1220
1220
|
componentWillLoad() {
|
|
1221
|
-
const { breakpoints, initialBreakpoint, el } = this;
|
|
1221
|
+
const { breakpoints, initialBreakpoint, el, htmlAttributes } = this;
|
|
1222
1222
|
const isSheetModal = (this.isSheetModal = breakpoints !== undefined && initialBreakpoint !== undefined);
|
|
1223
|
-
|
|
1223
|
+
const attributesToInherit = ['aria-label', 'role'];
|
|
1224
|
+
this.inheritedAttributes = helpers.inheritAttributes(el, attributesToInherit);
|
|
1225
|
+
/**
|
|
1226
|
+
* When using a controller modal you can set attributes
|
|
1227
|
+
* using the htmlAttributes property. Since the above attributes
|
|
1228
|
+
* need to be inherited inside of the modal, we need to look
|
|
1229
|
+
* and see if these attributes are being set via htmlAttributes.
|
|
1230
|
+
*
|
|
1231
|
+
* We could alternatively move this to componentDidLoad to simplify the work
|
|
1232
|
+
* here, but we'd then need to make inheritedAttributes a State variable,
|
|
1233
|
+
* thus causing another render to always happen after the first render.
|
|
1234
|
+
*/
|
|
1235
|
+
if (htmlAttributes !== undefined) {
|
|
1236
|
+
attributesToInherit.forEach((attribute) => {
|
|
1237
|
+
const attributeValue = htmlAttributes[attribute];
|
|
1238
|
+
if (attributeValue) {
|
|
1239
|
+
/**
|
|
1240
|
+
* If an attribute we need to inherit was
|
|
1241
|
+
* set using htmlAttributes then add it to
|
|
1242
|
+
* inheritedAttributes and remove it from htmlAttributes.
|
|
1243
|
+
* This ensures the attribute is inherited and not
|
|
1244
|
+
* set on the host.
|
|
1245
|
+
*
|
|
1246
|
+
* In this case, if an inherited attribute is set
|
|
1247
|
+
* on the host element and using htmlAttributes then
|
|
1248
|
+
* htmlAttributes wins, but that's not a pattern that we recommend.
|
|
1249
|
+
* The only time you'd need htmlAttributes is when using modalController.
|
|
1250
|
+
*/
|
|
1251
|
+
this.inheritedAttributes = Object.assign(Object.assign({}, this.inheritedAttributes), { [attribute]: htmlAttributes[attribute] });
|
|
1252
|
+
delete htmlAttributes[attribute];
|
|
1253
|
+
}
|
|
1254
|
+
});
|
|
1255
|
+
}
|
|
1224
1256
|
if (isSheetModal) {
|
|
1225
1257
|
this.currentBreakpoint = this.initialBreakpoint;
|
|
1226
1258
|
}
|
|
@@ -1617,9 +1649,9 @@ const Modal = class {
|
|
|
1617
1649
|
const mode = ionicGlobal.getIonMode(this);
|
|
1618
1650
|
const isCardModal = presentingElement !== undefined && mode === 'ios';
|
|
1619
1651
|
const isHandleCycle = handleBehavior === 'cycle';
|
|
1620
|
-
return (index$3.h(index$3.Host, Object.assign({ key: '
|
|
1652
|
+
return (index$3.h(index$3.Host, Object.assign({ key: 'dc2a6eeef178248a43690fe5b2176ca7b4417032', "no-router": true, tabindex: "-1" }, htmlAttributes, { style: {
|
|
1621
1653
|
zIndex: `${20000 + this.overlayIndex}`,
|
|
1622
|
-
}, class: Object.assign({ [mode]: true, ['modal-default']: !isCardModal && !isSheetModal, [`modal-card`]: isCardModal, [`modal-sheet`]: isSheetModal, 'overlay-hidden': true }, theme.getClassMap(this.cssClass)), onIonBackdropTap: this.onBackdropTap, onIonModalDidPresent: this.onLifecycle, onIonModalWillPresent: this.onLifecycle, onIonModalWillDismiss: this.onLifecycle, onIonModalDidDismiss: this.onLifecycle }), index$3.h("ion-backdrop", { key: '
|
|
1654
|
+
}, class: Object.assign({ [mode]: true, ['modal-default']: !isCardModal && !isSheetModal, [`modal-card`]: isCardModal, [`modal-sheet`]: isSheetModal, 'overlay-hidden': true }, theme.getClassMap(this.cssClass)), onIonBackdropTap: this.onBackdropTap, onIonModalDidPresent: this.onLifecycle, onIonModalWillPresent: this.onLifecycle, onIonModalWillDismiss: this.onLifecycle, onIonModalDidDismiss: this.onLifecycle }), index$3.h("ion-backdrop", { key: '9cc78514469001d8366ce381ad50a73bd333fd1d', ref: (el) => (this.backdropEl = el), visible: this.showBackdrop, tappable: this.backdropDismiss, part: "backdrop" }), mode === 'ios' && index$3.h("div", { class: "modal-shadow" }), index$3.h("div", Object.assign({ key: '3814c9453017e61107003e2a599baa8fb5865436',
|
|
1623
1655
|
/*
|
|
1624
1656
|
role and aria-modal must be used on the
|
|
1625
1657
|
same element. They must also be set inside the
|
|
@@ -1628,7 +1660,7 @@ const Modal = class {
|
|
|
1628
1660
|
*/
|
|
1629
1661
|
role: "dialog" }, inheritedAttributes, { "aria-modal": "true", class: "modal-wrapper ion-overlay-wrapper", part: "content", ref: (el) => (this.wrapperEl = el) }), showHandle && (index$3.h("button", { class: "modal-handle",
|
|
1630
1662
|
// Prevents the handle from receiving keyboard focus when it does not cycle
|
|
1631
|
-
tabIndex: !isHandleCycle ? -1 : 0, "aria-label": "Activate to adjust the size of the dialog overlaying the screen", onClick: isHandleCycle ? this.onHandleClick : undefined, part: "handle" })), index$3.h("slot", { key: '
|
|
1663
|
+
tabIndex: !isHandleCycle ? -1 : 0, "aria-label": "Activate to adjust the size of the dialog overlaying the screen", onClick: isHandleCycle ? this.onHandleClick : undefined, part: "handle" })), index$3.h("slot", { key: '49a2f27e0e1e742ffab2b45d94fc2906f3a1a098' }))));
|
|
1632
1664
|
}
|
|
1633
1665
|
get el() { return index$3.getElement(this); }
|
|
1634
1666
|
static get watchers() { return {
|
|
@@ -131,9 +131,41 @@ export class Modal {
|
|
|
131
131
|
this.triggerController.removeClickListener();
|
|
132
132
|
}
|
|
133
133
|
componentWillLoad() {
|
|
134
|
-
const { breakpoints, initialBreakpoint, el } = this;
|
|
134
|
+
const { breakpoints, initialBreakpoint, el, htmlAttributes } = this;
|
|
135
135
|
const isSheetModal = (this.isSheetModal = breakpoints !== undefined && initialBreakpoint !== undefined);
|
|
136
|
-
|
|
136
|
+
const attributesToInherit = ['aria-label', 'role'];
|
|
137
|
+
this.inheritedAttributes = inheritAttributes(el, attributesToInherit);
|
|
138
|
+
/**
|
|
139
|
+
* When using a controller modal you can set attributes
|
|
140
|
+
* using the htmlAttributes property. Since the above attributes
|
|
141
|
+
* need to be inherited inside of the modal, we need to look
|
|
142
|
+
* and see if these attributes are being set via htmlAttributes.
|
|
143
|
+
*
|
|
144
|
+
* We could alternatively move this to componentDidLoad to simplify the work
|
|
145
|
+
* here, but we'd then need to make inheritedAttributes a State variable,
|
|
146
|
+
* thus causing another render to always happen after the first render.
|
|
147
|
+
*/
|
|
148
|
+
if (htmlAttributes !== undefined) {
|
|
149
|
+
attributesToInherit.forEach((attribute) => {
|
|
150
|
+
const attributeValue = htmlAttributes[attribute];
|
|
151
|
+
if (attributeValue) {
|
|
152
|
+
/**
|
|
153
|
+
* If an attribute we need to inherit was
|
|
154
|
+
* set using htmlAttributes then add it to
|
|
155
|
+
* inheritedAttributes and remove it from htmlAttributes.
|
|
156
|
+
* This ensures the attribute is inherited and not
|
|
157
|
+
* set on the host.
|
|
158
|
+
*
|
|
159
|
+
* In this case, if an inherited attribute is set
|
|
160
|
+
* on the host element and using htmlAttributes then
|
|
161
|
+
* htmlAttributes wins, but that's not a pattern that we recommend.
|
|
162
|
+
* The only time you'd need htmlAttributes is when using modalController.
|
|
163
|
+
*/
|
|
164
|
+
this.inheritedAttributes = Object.assign(Object.assign({}, this.inheritedAttributes), { [attribute]: htmlAttributes[attribute] });
|
|
165
|
+
delete htmlAttributes[attribute];
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
}
|
|
137
169
|
if (isSheetModal) {
|
|
138
170
|
this.currentBreakpoint = this.initialBreakpoint;
|
|
139
171
|
}
|
|
@@ -530,9 +562,9 @@ export class Modal {
|
|
|
530
562
|
const mode = getIonMode(this);
|
|
531
563
|
const isCardModal = presentingElement !== undefined && mode === 'ios';
|
|
532
564
|
const isHandleCycle = handleBehavior === 'cycle';
|
|
533
|
-
return (h(Host, Object.assign({ key: '
|
|
565
|
+
return (h(Host, Object.assign({ key: 'dc2a6eeef178248a43690fe5b2176ca7b4417032', "no-router": true, tabindex: "-1" }, htmlAttributes, { style: {
|
|
534
566
|
zIndex: `${20000 + this.overlayIndex}`,
|
|
535
|
-
}, class: Object.assign({ [mode]: true, ['modal-default']: !isCardModal && !isSheetModal, [`modal-card`]: isCardModal, [`modal-sheet`]: isSheetModal, 'overlay-hidden': true }, getClassMap(this.cssClass)), onIonBackdropTap: this.onBackdropTap, onIonModalDidPresent: this.onLifecycle, onIonModalWillPresent: this.onLifecycle, onIonModalWillDismiss: this.onLifecycle, onIonModalDidDismiss: this.onLifecycle }), h("ion-backdrop", { key: '
|
|
567
|
+
}, class: Object.assign({ [mode]: true, ['modal-default']: !isCardModal && !isSheetModal, [`modal-card`]: isCardModal, [`modal-sheet`]: isSheetModal, 'overlay-hidden': true }, getClassMap(this.cssClass)), onIonBackdropTap: this.onBackdropTap, onIonModalDidPresent: this.onLifecycle, onIonModalWillPresent: this.onLifecycle, onIonModalWillDismiss: this.onLifecycle, onIonModalDidDismiss: this.onLifecycle }), h("ion-backdrop", { key: '9cc78514469001d8366ce381ad50a73bd333fd1d', ref: (el) => (this.backdropEl = el), visible: this.showBackdrop, tappable: this.backdropDismiss, part: "backdrop" }), mode === 'ios' && h("div", { class: "modal-shadow" }), h("div", Object.assign({ key: '3814c9453017e61107003e2a599baa8fb5865436',
|
|
536
568
|
/*
|
|
537
569
|
role and aria-modal must be used on the
|
|
538
570
|
same element. They must also be set inside the
|
|
@@ -541,7 +573,7 @@ export class Modal {
|
|
|
541
573
|
*/
|
|
542
574
|
role: "dialog" }, inheritedAttributes, { "aria-modal": "true", class: "modal-wrapper ion-overlay-wrapper", part: "content", ref: (el) => (this.wrapperEl = el) }), showHandle && (h("button", { class: "modal-handle",
|
|
543
575
|
// Prevents the handle from receiving keyboard focus when it does not cycle
|
|
544
|
-
tabIndex: !isHandleCycle ? -1 : 0, "aria-label": "Activate to adjust the size of the dialog overlaying the screen", onClick: isHandleCycle ? this.onHandleClick : undefined, part: "handle" })), h("slot", { key: '
|
|
576
|
+
tabIndex: !isHandleCycle ? -1 : 0, "aria-label": "Activate to adjust the size of the dialog overlaying the screen", onClick: isHandleCycle ? this.onHandleClick : undefined, part: "handle" })), h("slot", { key: '49a2f27e0e1e742ffab2b45d94fc2906f3a1a098' }))));
|
|
545
577
|
}
|
|
546
578
|
static get is() { return "ion-modal"; }
|
|
547
579
|
static get encapsulation() { return "shadow"; }
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* (C) Ionic http://ionicframework.com - MIT License
|
|
3
|
+
*/
|
|
4
|
+
import { h } from "@stencil/core";
|
|
5
|
+
import { newSpecPage } from "@stencil/core/testing";
|
|
6
|
+
import { Modal } from "../modal";
|
|
7
|
+
it('should inherit attributes', async () => {
|
|
8
|
+
/**
|
|
9
|
+
* Note: This example should not be used in production.
|
|
10
|
+
* This only serves to check that `role` can be customized.
|
|
11
|
+
*/
|
|
12
|
+
const page = await newSpecPage({
|
|
13
|
+
components: [Modal],
|
|
14
|
+
template: () => h("ion-modal", { overlayIndex: 1, "aria-label": "my label", role: "presentation" }),
|
|
15
|
+
});
|
|
16
|
+
const modal = page.body.querySelector('ion-modal');
|
|
17
|
+
const contentWrapper = modal.shadowRoot.querySelector('[part="content"]');
|
|
18
|
+
expect(contentWrapper.getAttribute('aria-label')).toBe('my label');
|
|
19
|
+
expect(contentWrapper.getAttribute('role')).toBe('presentation');
|
|
20
|
+
});
|
|
21
|
+
it('should inherit attributes when set via htmlAttributes', async () => {
|
|
22
|
+
const page = await newSpecPage({
|
|
23
|
+
components: [Modal],
|
|
24
|
+
template: () => (h("ion-modal", { overlayIndex: 1, htmlAttributes: { 'aria-label': 'my label', role: 'presentation' } })),
|
|
25
|
+
});
|
|
26
|
+
const modal = page.body.querySelector('ion-modal');
|
|
27
|
+
const contentWrapper = modal.shadowRoot.querySelector('[part="content"]');
|
|
28
|
+
expect(contentWrapper.getAttribute('aria-label')).toBe('my label');
|
|
29
|
+
expect(contentWrapper.getAttribute('role')).toBe('presentation');
|
|
30
|
+
expect(modal.hasAttribute('aria-label')).toBe(false);
|
|
31
|
+
expect(modal.hasAttribute('role')).toBe(false);
|
|
32
|
+
});
|
package/dist/docs.json
CHANGED
|
@@ -1214,9 +1214,41 @@ const Modal = class {
|
|
|
1214
1214
|
this.triggerController.removeClickListener();
|
|
1215
1215
|
}
|
|
1216
1216
|
componentWillLoad() {
|
|
1217
|
-
const { breakpoints, initialBreakpoint, el } = this;
|
|
1217
|
+
const { breakpoints, initialBreakpoint, el, htmlAttributes } = this;
|
|
1218
1218
|
const isSheetModal = (this.isSheetModal = breakpoints !== undefined && initialBreakpoint !== undefined);
|
|
1219
|
-
|
|
1219
|
+
const attributesToInherit = ['aria-label', 'role'];
|
|
1220
|
+
this.inheritedAttributes = inheritAttributes(el, attributesToInherit);
|
|
1221
|
+
/**
|
|
1222
|
+
* When using a controller modal you can set attributes
|
|
1223
|
+
* using the htmlAttributes property. Since the above attributes
|
|
1224
|
+
* need to be inherited inside of the modal, we need to look
|
|
1225
|
+
* and see if these attributes are being set via htmlAttributes.
|
|
1226
|
+
*
|
|
1227
|
+
* We could alternatively move this to componentDidLoad to simplify the work
|
|
1228
|
+
* here, but we'd then need to make inheritedAttributes a State variable,
|
|
1229
|
+
* thus causing another render to always happen after the first render.
|
|
1230
|
+
*/
|
|
1231
|
+
if (htmlAttributes !== undefined) {
|
|
1232
|
+
attributesToInherit.forEach((attribute) => {
|
|
1233
|
+
const attributeValue = htmlAttributes[attribute];
|
|
1234
|
+
if (attributeValue) {
|
|
1235
|
+
/**
|
|
1236
|
+
* If an attribute we need to inherit was
|
|
1237
|
+
* set using htmlAttributes then add it to
|
|
1238
|
+
* inheritedAttributes and remove it from htmlAttributes.
|
|
1239
|
+
* This ensures the attribute is inherited and not
|
|
1240
|
+
* set on the host.
|
|
1241
|
+
*
|
|
1242
|
+
* In this case, if an inherited attribute is set
|
|
1243
|
+
* on the host element and using htmlAttributes then
|
|
1244
|
+
* htmlAttributes wins, but that's not a pattern that we recommend.
|
|
1245
|
+
* The only time you'd need htmlAttributes is when using modalController.
|
|
1246
|
+
*/
|
|
1247
|
+
this.inheritedAttributes = Object.assign(Object.assign({}, this.inheritedAttributes), { [attribute]: htmlAttributes[attribute] });
|
|
1248
|
+
delete htmlAttributes[attribute];
|
|
1249
|
+
}
|
|
1250
|
+
});
|
|
1251
|
+
}
|
|
1220
1252
|
if (isSheetModal) {
|
|
1221
1253
|
this.currentBreakpoint = this.initialBreakpoint;
|
|
1222
1254
|
}
|
|
@@ -1613,9 +1645,9 @@ const Modal = class {
|
|
|
1613
1645
|
const mode = getIonMode(this);
|
|
1614
1646
|
const isCardModal = presentingElement !== undefined && mode === 'ios';
|
|
1615
1647
|
const isHandleCycle = handleBehavior === 'cycle';
|
|
1616
|
-
return (h(Host, Object.assign({ key: '
|
|
1648
|
+
return (h(Host, Object.assign({ key: 'dc2a6eeef178248a43690fe5b2176ca7b4417032', "no-router": true, tabindex: "-1" }, htmlAttributes, { style: {
|
|
1617
1649
|
zIndex: `${20000 + this.overlayIndex}`,
|
|
1618
|
-
}, class: Object.assign({ [mode]: true, ['modal-default']: !isCardModal && !isSheetModal, [`modal-card`]: isCardModal, [`modal-sheet`]: isSheetModal, 'overlay-hidden': true }, getClassMap(this.cssClass)), onIonBackdropTap: this.onBackdropTap, onIonModalDidPresent: this.onLifecycle, onIonModalWillPresent: this.onLifecycle, onIonModalWillDismiss: this.onLifecycle, onIonModalDidDismiss: this.onLifecycle }), h("ion-backdrop", { key: '
|
|
1650
|
+
}, class: Object.assign({ [mode]: true, ['modal-default']: !isCardModal && !isSheetModal, [`modal-card`]: isCardModal, [`modal-sheet`]: isSheetModal, 'overlay-hidden': true }, getClassMap(this.cssClass)), onIonBackdropTap: this.onBackdropTap, onIonModalDidPresent: this.onLifecycle, onIonModalWillPresent: this.onLifecycle, onIonModalWillDismiss: this.onLifecycle, onIonModalDidDismiss: this.onLifecycle }), h("ion-backdrop", { key: '9cc78514469001d8366ce381ad50a73bd333fd1d', ref: (el) => (this.backdropEl = el), visible: this.showBackdrop, tappable: this.backdropDismiss, part: "backdrop" }), mode === 'ios' && h("div", { class: "modal-shadow" }), h("div", Object.assign({ key: '3814c9453017e61107003e2a599baa8fb5865436',
|
|
1619
1651
|
/*
|
|
1620
1652
|
role and aria-modal must be used on the
|
|
1621
1653
|
same element. They must also be set inside the
|
|
@@ -1624,7 +1656,7 @@ const Modal = class {
|
|
|
1624
1656
|
*/
|
|
1625
1657
|
role: "dialog" }, inheritedAttributes, { "aria-modal": "true", class: "modal-wrapper ion-overlay-wrapper", part: "content", ref: (el) => (this.wrapperEl = el) }), showHandle && (h("button", { class: "modal-handle",
|
|
1626
1658
|
// Prevents the handle from receiving keyboard focus when it does not cycle
|
|
1627
|
-
tabIndex: !isHandleCycle ? -1 : 0, "aria-label": "Activate to adjust the size of the dialog overlaying the screen", onClick: isHandleCycle ? this.onHandleClick : undefined, part: "handle" })), h("slot", { key: '
|
|
1659
|
+
tabIndex: !isHandleCycle ? -1 : 0, "aria-label": "Activate to adjust the size of the dialog overlaying the screen", onClick: isHandleCycle ? this.onHandleClick : undefined, part: "handle" })), h("slot", { key: '49a2f27e0e1e742ffab2b45d94fc2906f3a1a098' }))));
|
|
1628
1660
|
}
|
|
1629
1661
|
get el() { return getElement(this); }
|
|
1630
1662
|
static get watchers() { return {
|
|
@@ -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-4c30cddd.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-19b26885.js";import{g as getClassMap}from"./theme-01f3f29c.js";import{e as deepReady,w as waitForMount}from"./index-348ed70a.js";import{b as getIonMode,c as config}from"./ionic-global-ad9a1810.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-b410a047.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 c=true;var u=0;var h=function(){if(d&&isIonContent(d)){return d.scrollY}else{return true}};var p=function(t){var e=t.event.target;if(e===null||!e.closest){return true}d=findClosestIonContent(e);if(d){if(isIonContent(d)){var r=getElementRoot(d);l=r.querySelector(".inner-scroll")}else{l=d}var a=!!d.querySelector("ion-refresher");return!a&&l.scrollTop===0}var i=e.closest("ion-footer");if(i===null){return true}return false};var m=function(r){var a=r.deltaY;c=h();s=t.canDismiss!==undefined&&t.canDismiss!==true;if(a>0&&d){disableContentScrollY(d)}e.progressStart(true,o?1:0)};var v=function(t){var a=t.deltaY;if(a>0&&d){disableContentScrollY(d)}var o=t.deltaY/n;var l=o>=0&&s;var c=l?f:.9999;var h=l?calculateSpringStep(o/c):o;var p=clamp(1e-4,h,c);e.progressStep(p);if(p>=i&&u<i){setCardStatusBarDefault(r)}else if(p<i&&u>=i){setCardStatusBarDark()}u=p};var b=function(r){var l=r.velocityY;var u=r.deltaY/n;var h=u>=0&&s;var p=h?f:.9999;var m=h?calculateSpringStep(u/p):u;var v=clamp(1e-4,m,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],v)[0]}else{e.easing("cubic-bezier(0.32, 0.72, 0, 1)");x+=getTimeGivenProgression([0,0],[.32,.72],[0,1],[1,1],v)[0]}var y=g?computeDuration(u*n,l):computeDuration((1-v)*n,l);o=g;w.enable(false);if(d){resetContentScrollY(d,c)}e.onFinish((function(){if(!g){w.enable(true)}})).progressEnd(g?1:0,x,y);if(h&&v>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:m,onMove:v,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 c=getElementRoot(r);var u=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 m=f?"-10px":p;var v=SwipeToCloseDefaults.MIN_PRESENTING_SCALE;var b="translateY(".concat(m,") scale(").concat(v,")");u.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(u)}else{d.addAnimation(s);if(!f){o.fromTo("opacity","0","1")}else{var v=f?SwipeToCloseDefaults.MIN_PRESENTING_SCALE:1;var b="translateY(-10px) scale(".concat(v,")");u.afterStyles({transform:b}).addElement(c.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(c.querySelector(".modal-shadow")).keyframes([{offset:0,opacity:"1",transform:"translateY(0) scale(1)"},{offset:1,opacity:"0",transform:b}]);d.addAnimation([u,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 c=a.tagName==="ION-MODAL"&&a.presentingElement!==undefined;var u=getElementRoot(a);var h=createAnimation().beforeClearStyles(["transform"]).afterClearStyles(["transform"]).onFinish((function(t){if(t!==1){return}a.style.setProperty("overflow","");var e=Array.from(p.querySelectorAll("ion-modal:not(.overlay-hidden)")).filter((function(t){return t.presentingElement!==undefined})).length;if(e<=1){p.style.setProperty("background-color","")}}));var p=document.body;if(f){var m=!CSS.supports("width","max(0px, 1px)")?"30px":"max(30px, var(--ion-safe-area-top))";var v=c?"-10px":m;var b=SwipeToCloseDefaults.MIN_PRESENTING_SCALE;var w="translateY(".concat(v,") 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(!c){s.fromTo("opacity","1","0")}else{var b=c?SwipeToCloseDefaults.MIN_PRESENTING_SCALE:1;var w="translateY(-10px) scale(".concat(b,")");h.addElement(u.querySelector(".modal-wrapper")).afterStyles({transform:"translate3d(0, 0, 0)"}).keyframes([{offset:0,filter:"contrast(0.85)",transform:w},{offset:1,filter:"contrast(1)",transform:"translateY(0) scale(1)"}]);var g=createAnimation().addElement(u.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 c=[{offset:0,opacity:"var(--backdrop-opacity)"},{offset:1-i,opacity:0},{offset:1,opacity:0}];var u={WRAPPER_KEYFRAMES:[{offset:0,transform:"translateY(0%)"},{offset:1,transform:"translateY(100%)"}],BACKDROP_KEYFRAMES:i!==0?c:f};var h=t.querySelector("ion-content");var p=r.clientHeight;var m=a;var v=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([],u.WRAPPER_KEYFRAMES,true));x.keyframes(__spreadArray([],u.BACKDROP_KEYFRAMES,true));n.progressStart(true,1-m);var E=m>i;if(E){A()}else{S()}}if(h&&m!==y){h.scrollY=false}var C=function(t){var e=t.event.target.closest("ion-content");m=s();if(m===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-m)};var D=function(t){var e=1-m;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;v=clamp(1e-4,d,s);n.progressStep(v)};var M=function(t){var e=t.velocityY;var r=(t.deltaY+e*350)/p;var a=m-r;var i=o.reduce((function(t,e){return Math.abs(e-a)<Math.abs(t-a)?e:t}));I({breakpoint:i,breakpointOffset:v,canDismiss:b,animated:true})};var I=function(e){var r=e.breakpoint,a=e.canDismiss,s=e.breakpointOffset,f=e.animated;var c=a&&r===0;var p=c?m:r;var v=p!==0;m=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(c){handleCanDismiss(t,n)}else if(!v){d()}return new Promise((function(t){n.onFinish((function(){if(v){if(g&&x){raf((function(){g.keyframes(__spreadArray([],u.WRAPPER_KEYFRAMES,true));x.keyframes(__spreadArray([],u.BACKDROP_KEYFRAMES,true));n.progressStart(true,1-p);m=p;l(m);if(h&&m===o[o.length-1]){h.scrollY=true}var e=m>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,e=t.breakpoints,r=t.initialBreakpoint,a=t.el;var i=this.isSheetModal=e!==undefined&&r!==undefined;this.inheritedAttributes=inheritAttributes(a,["aria-label","role"]);if(i){this.currentBreakpoint=this.initialBreakpoint}if(e!==undefined&&r!==undefined&&!e.includes(r)){printIonWarning("Your breakpoints array must include the initialBreakpoint value.")}setOverlayId(a)};t.prototype.componentDidLoad=function(){var t=this;if(this.isOpen===true){raf((function(){return t.present()}))}this.breakpointsChanged(this.breakpoints);this.triggerChanged()};t.prototype.getDelegate=function(t){if(t===void 0){t=false}if(this.workingDelegate&&!t){return{delegate:this.workingDelegate,inline:this.inline}}var e=this.el.parentNode;var r=this.inline=e!==null&&!this.hasController;var a=this.workingDelegate=r?this.delegate||this.coreDelegate:this.delegate;return{inline:r,delegate:a}};t.prototype.checkCanDismiss=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r;return __generator(this,(function(a){r=this.canDismiss;if(typeof r==="function"){return[2,r(t,e)]}return[2,r]}))}))};t.prototype.present=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,r,a,i,n,o,s,d,l;var f=this;return __generator(this,(function(c){switch(c.label){case 0:return[4,this.lockController.lock()];case 1:t=c.sent();if(this.presented){t();return[2]}e=this,r=e.presentingElement,a=e.el;this.currentBreakpoint=this.initialBreakpoint;i=this.getDelegate(true),n=i.inline,o=i.delegate;this.ionMount.emit();s=this;return[4,attachComponent(o,a,this.component,["ion-page"],this.componentProps,n)];case 2:s.usersElement=c.sent();if(!hasLazyBuild(a))return[3,4];return[4,deepReady(this.usersElement)];case 3:c.sent();return[3,6];case 4:if(!!this.keepContentsMounted)return[3,6];return[4,waitForMount()];case 5:c.sent();c.label=6;case 6:writeTask((function(){return f.el.classList.add("show-modal")}));d=r!==undefined;if(!(d&&getIonMode(this)==="ios"))return[3,8];l=this;return[4,StatusBar.getStyle()];case 7:l.statusBarStyle=c.sent();setCardStatusBarDark();c.label=8;case 8:return[4,present(this,"modalEnter",iosEnterAnimation,mdEnterAnimation,{presentingEl:r,currentBreakpoint:this.initialBreakpoint,backdropBreakpoint:this.backdropBreakpoint})];case 9:c.sent();if(typeof window!=="undefined"){this.keyboardOpenCallback=function(){if(f.gesture){f.gesture.enable(false);raf((function(){if(f.gesture){f.gesture.enable(true)}}))}};window.addEventListener(KEYBOARD_DID_OPEN,this.keyboardOpenCallback)}if(this.isSheetModal){this.initSheetGesture()}else if(d){this.initSwipeToClose()}t();return[2]}}))}))};t.prototype.initSwipeToClose=function(){var t=this;var e;if(getIonMode(this)!=="ios"){return}var r=this.el;var a=this.leaveAnimation||config.get("modalLeave",iosLeaveAnimation);var i=this.animation=a(r,{presentingEl:this.presentingElement});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 c=n!==undefined&&f==="ios";var u=s==="cycle";return h(Host,Object.assign({key:"0c2c4369ab2df4ef4660addea5e927c6a0232864","no-router":true,tabindex:"-1"},o,{style:{zIndex:"".concat(2e4+this.overlayIndex)},class:Object.assign((t={},t[f]=true,t["modal-default"]=!c&&!i,t["modal-card"]=c,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:"d044383a776c2ee1703f996caedaedca47f2948f",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:"8d23b6a3cc9069e4d46fa0645cde9db3e6f89507",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:!u?-1:0,"aria-label":"Activate to adjust the size of the dialog overlaying the screen",onClick:u?this.onHandleClick:undefined,part:"handle"}),h("slot",{key:"3fbb689e4bf5575fbb26ad1000f6ac5993f3bf8f"})))};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-4c30cddd.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-19b26885.js";import{g as getClassMap}from"./theme-01f3f29c.js";import{e as deepReady,w as waitForMount}from"./index-348ed70a.js";import{b as getIonMode,c as config}from"./ionic-global-ad9a1810.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-b410a047.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:"dc2a6eeef178248a43690fe5b2176ca7b4417032","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:"9cc78514469001d8366ce381ad50a73bd333fd1d",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:"3814c9453017e61107003e2a599baa8fb5865436",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:"49a2f27e0e1e742ffab2b45d94fc2906f3a1a098"})))};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};
|