text: import{r as t,e as s,j as i,h as e,H as n,d as a}from"./p-f5b6b644.js";import"./p-3e9c62cb.js";import{B as o,i as c,p as r,a as h,d as l,e as p,s as u}from"./p-1dde19fb.js";import{g as d}from"./p-f1a4df63.js";import{c as b}from"./p-39c54535.js";const m=t=>{const s=b(),i=b(),e=b();return i.addElement(t.querySelector("ion-backdrop")).fromTo("opacity",.01,.4),e.addElement(t.querySelector(".action-sheet-wrapper")).fromTo("transform","translateY(100%)","translateY(0%)"),s.addElement(t).easing("cubic-bezier(.36,.66,.04,1)").duration(400).addAnimation([i,e])},f=t=>{const s=b(),i=b(),e=b();return i.addElement(t.querySelector("ion-backdrop")).fromTo("opacity",.4,0),e.addElement(t.querySelector(".action-sheet-wrapper")).fromTo("transform","translateY(0%)","translateY(100%)"),s.addElement(t).easing("cubic-bezier(.36,.66,.04,1)").duration(450).addAnimation([i,e])},v=t=>{const s=b(),i=b(),e=b();return i.addElement(t.querySelector("ion-backdrop")).fromTo("opacity",.01,.32),e.addElement(t.querySelector(".action-sheet-wrapper")).fromTo("transform","translateY(100%)","translateY(0%)"),s.addElement(t).easing("cubic-bezier(.36,.66,.04,1)").duration(400).addAnimation([i,e])},y=t=>{const s=b(),i=b(),e=b();return i.addElement(t.querySelector("ion-backdrop")).fromTo("opacity",.32,0),e.addElement(t.querySelector(".action-sheet-wrapper")).fromTo("transform","translateY(0%)","translateY(100%)"),s.addElement(t).easing("cubic-bezier(.36,.66,.04,1)").duration(450).addAnimation([i,e])},D=class{constructor(e){t(this,e),this.presented=!1,this.mode=s(this),this.keyboardClose=!0,this.buttons=[],this.backdropDismiss=!0,this.translucent=!1,this.animated=!0,this.onBackdropTap=()=>{this.dismiss(void 0,o)},this.dispatchCancelHandler=t=>{if(c(t.detail.role)){const t=this.getButtons().find(t=>"cancel"===t.role);this.callButtonHandler(t)}},r(this.el),this.didPresent=i(this,"ionActionSheetDidPresent",7),this.willPresent=i(this,"ionActionSheetWillPresent",7),this.willDismiss=i(this,"ionActionSheetWillDismiss",7),this.didDismiss=i(this,"ionActionSheetDidDismiss",7)}present(){return h(this,"actionSheetEnter",m,v)}dismiss(t,s){return l(this,t,s,"actionSheetLeave",f,y)}onDidDismiss(){return p(this.el,"ionActionSheetDidDismiss")}onWillDismiss(){return p(this.el,"ionActionSheetWillDismiss")}async buttonClick(t){const s=t.role;return c(s)?this.dismiss(void 0,s):await this.callButtonHandler(t)?this.dismiss(void 0,t.role):Promise.resolve()}async callButtonHandler(t){return!t||!1!==await u(t.handler)}getButtons(){return this.buttons.map(t=>"string"==typeof t?{text:t}:t)}render(){const t=s(this),i=this.getButtons(),a=i.find(t=>"cancel"===t.role),o=i.filter(t=>"cancel"!==t.role);return e(n,{role:"dialog","aria-modal":"true",style:{zIndex:`${2e4+this.overlayIndex}`},class:Object.assign(Object.assign({[t]:!0},d(this.cssClass)),{"action-sheet-translucent":this.translucent}),onIonActionSheetWillDismiss:this.dispatchCancelHandler,onIonBackdropTap:this.onBackdropTap},e("ion-backdrop",{tappable:this.backdropDismiss}),e("div",{class:"action-sheet-wrapper",role:"dialog"},e("div",{class:"action-sheet-container"},e("div",{class:"action-sheet-group"},void 0!==this.header&&e("div",{class:"action-sheet-title"},this.header,this.subHeader&&e("div",{class:"action-sheet-sub-title"},this.subHeader)),o.map(s=>e("button",{type:"button","ion-activatable":!0,class:g(s),onClick:()=>this.buttonClick(s)},e("span",{class:"action-sheet-button-inner"},s.icon&&e("ion-icon",{icon:s.icon,lazy:!1,class:"action-sheet-icon"}),s.text),"md"===t&&e("ion-ripple-effect",null)))),a&&e("div",{class:"action-sheet-group action-sheet-group-cancel"},e("button",{type:"button",class:g(a),onClick:()=>this.buttonClick(a)},e("span",{class:"action-sheet-button-inner"},a.icon&&e("ion-icon",{icon:a.icon,lazy:!1,class:"action-sheet-icon"}),a.text))))))}get el(){return a(this)}static get style(){return".sc-ion-action-sheet-md-h{--color:initial;--min-width:auto;--width:100%;--max-width:500px;--min-height:auto;--height:100%;--max-height:100%;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;left:0;right:0;top:0;bottom:0;display:block;position:fixed;font-family:var(--ion-font-family,inherit);-ms-touch-action:none;touch-action:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:1001}.overlay-hidden.sc-ion-action-sheet-md-h{display:none}.action-sheet-wrapper.sc-ion-action-sheet-md{left:0;right:0;bottom:0;margin-left:auto;margin-right:auto;margin-top:auto;margin-bottom:auto;-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0);display:block;position:absolute;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);z-index:10;pointer-events:none}\@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){.action-sheet-wrapper.sc-ion-action-sheet-md{margin-left:unset;margin-right:unset;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto}}.action-sheet-button.sc-ion-action-sheet-md{display:block;width:100%;border:0;outline:none;font-family:inherit}.action-sheet-button.activated.sc-ion-action-sheet-md{background:var(--background-activated)}.action-sheet-button-inner.sc-ion-action-sheet-md{display:-ms-flexbox;display:flex;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-negative:0;flex-shrink:0;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:100%;height:100%}.action-sheet-container.sc-ion-action-sheet-md{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;-ms-flex-pack:end;justify-content:flex-end;height:100%;max-height:100%}.action-sheet-group.sc-ion-action-sheet-md{-ms-flex-negative:2;flex-shrink:2;overscroll-behavior-y:contain;overflow-y:auto;-webkit-overflow-scrolling:touch;pointer-events:all;background:var(--background)}.action-sheet-group.sc-ion-action-sheet-md::-webkit-scrollbar{display:none}.action-sheet-group-cancel.sc-ion-action-sheet-md{-ms-flex-negative:0;flex-shrink:0;overflow:hidden}.action-sheet-selected.sc-ion-action-sheet-md{background:var(--background-selected)}.sc-ion-action-sheet-md-h{--background:var(--ion-overlay-background-color,var(--ion-background-color,#fff));--background-selected:var(--background,);--background-activated:var(--background)}.action-sheet-title.sc-ion-action-sheet-md{padding-left:16px;padding-right:16px;padding-top:20px;padding-bottom:17px;height:60px;color:var(--color,rgba(var(--ion-text-color-rgb,0,0,0),.54));font-size:16px;text-align:start}\@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){.action-sheet-title.sc-ion-action-sheet-md{padding-left:unset;padding-right:unset;-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px}}.action-sheet-sub-title.sc-ion-action-sheet-md{padding-left:0;padding-right:0;padding-top:16px;padding-bottom:0;font-size:14px}.action-sheet-group.sc-ion-action-sheet-md:first-child{padding-top:0}.action-sheet-group.sc-ion-action-sheet-md:last-child{padding-bottom:0}.action-sheet-button.sc-ion-action-sheet-md{padding-left:16px;padding-right:16px;padding-top:0;padding-bottom:0;position:relative;height:52px;background:transparent;color:var(--color,var(--ion-color-step-850,#262626));font-size:16px;text-align:start;contain:strict;overflow:hidden}\@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){.action-sheet-button.sc-ion-action-sheet-md{padding-left:unset;padding-right:unset;-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px}}.action-sheet-icon.sc-ion-action-sheet-md{padding-bottom:4px;margin-left:0;margin-right:32px;margin-top:0;margin-bottom:0;color:var(--color,rgba(var(--ion-text-color-rgb,0,0,0),.54));font-size:24px}\@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){.action-sheet-icon.sc-ion-action-sheet-md{margin-left:unset;margin-right:unset;-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:32px;margin-inline-end:32px}}.action-sheet-button-inner.sc-ion-action-sheet-md{-ms-flex-pack:start;justify-content:flex-start}.action-sheet-selected.sc-ion-action-sheet-md{font-weight:700}"}},g=t=>Object.assign({"action-sheet-button":!0,"ion-activatable":!0,[`action-sheet-${t.role}`]:void 0!==t.role},d(t.cssClass));export{D as ion_action_sheet};