/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */
import{focusElements as a}from"./p-vXpMhGrs.js";import{j as i,e}from"./p-gD7P82jx.js";const r=(a,i=0)=>new Promise((e=>{t(a,i,e)})),t=(a,i=0,e)=>{let r,t;const n={passive:!0},o=()=>{r&&r()},s=i=>{void 0!==i&&a!==i.target||(o(),e(i))};return a&&(a.addEventListener("webkitTransitionEnd",s,n),a.addEventListener("transitionend",s,n),t=setTimeout(s,i+500),r=()=>{void 0!==t&&(clearTimeout(t),t=void 0),a.removeEventListener("webkitTransitionEnd",s,n),a.removeEventListener("transitionend",s,n)}),o},n=(a,i)=>{a.componentOnReady?a.componentOnReady().then((a=>i(a))):p((()=>i(a)))},o=a=>void 0!==a.componentOnReady,s=(a,i=[])=>{const e={};return i.forEach((i=>{a.hasAttribute(i)&&(null!==a.getAttribute(i)&&(e[i]=a.getAttribute(i)),a.removeAttribute(i))})),e},l=["role","aria-activedescendant","aria-atomic","aria-autocomplete","aria-braillelabel","aria-brailleroledescription","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colindextext","aria-colspan","aria-controls","aria-current","aria-describedby","aria-description","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowindextext","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext"],u=a=>s(a,l),c=(a,i,e,r)=>a.addEventListener(i,e,r),d=(a,i,e,r)=>a.removeEventListener(i,e,r),m=(a,i=a)=>a.shadowRoot||i,p=a=>"function"==typeof __zone_symbol__requestAnimationFrame?__zone_symbol__requestAnimationFrame(a):"function"==typeof requestAnimationFrame?requestAnimationFrame(a):setTimeout(a),f=a=>!!a.shadowRoot&&!!a.attachShadow,b=i=>{i.focus();let r=i;if(!i.classList.contains("ion-focusable")){const a=i.getRootNode();a instanceof ShadowRoot&&a.host instanceof HTMLElement&&(r=a.host)}if(r.classList.contains("ion-focusable")){const i=e.get("appRootSelector","ion-app"),t=r.closest(i);t&&("ion-app"===i?t.setFocus([r]):requestAnimationFrame((()=>{a([r])})))}},v=(a,i,e,r,t)=>{{let a=i.querySelector("input.aux-input");a||(a=i.ownerDocument.createElement("input"),a.type="hidden",a.classList.add("aux-input"),i.appendChild(a)),a.disabled=t,a.name=e,a.value=r||""}},w=(a,i,e)=>Math.max(a,Math.min(i,e)),x=(a,e)=>{if(!a){const a="ASSERT: "+e;throw i(a),new Error(a)}},h=a=>{if(a){const i=a.changedTouches;if(i&&i.length>0){const a=i[0];return{x:a.clientX,y:a.clientY}}if(void 0!==a.pageX)return{x:a.pageX,y:a.pageY}}return{x:0,y:0}},y=a=>{const i="rtl"===document.dir;switch(a){case"start":return i;case"end":return!i;default:throw new Error(`"${a}" is not a valid value for [side]. Use "start" or "end" instead.`)}},_=(a,i)=>{const e=a._original||a;return{_original:a,emit:T(e.emit.bind(e),i)}},T=(a,i=0)=>{let e;return(...r)=>{clearTimeout(e),e=setTimeout(a,i,...r)}},j=(a,i)=>{if(null!=a||(a={}),null!=i||(i={}),a===i)return!0;const e=Object.keys(a);if(e.length!==Object.keys(i).length)return!1;for(const r of e){if(!(r in i))return!1;if(a[r]!==i[r])return!1}return!0},q=a=>"number"==typeof a&&!isNaN(a)&&isFinite(a);export{v as a,s as b,n as c,_ as d,w as e,c as f,m as g,o as h,u as i,q as j,f as k,x as l,d as m,b as n,y as o,T as p,h as q,p as r,j as s,r as t}