import{__spreadArray}from"tslib";
/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */var componentOnReady=function(e,a){if(e.componentOnReady){e.componentOnReady().then((function(e){return a(e)}))}else{raf((function(){return a(e)}))}};var inheritAttributes=function(e,a){if(a===void 0){a=[]}var r={};a.forEach((function(a){if(e.hasAttribute(a)){var t=e.getAttribute(a);if(t!==null){r[a]=e.getAttribute(a)}e.removeAttribute(a)}}));return r};var ariaAttributes=["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"];var inheritAriaAttributes=function(e){return inheritAttributes(e,ariaAttributes)};var addEventListener=function(e,a,r,t){if(typeof window!=="undefined"){var i=window;var n=i&&i.Ionic&&i.Ionic.config;if(n){var o=n.get("_ael");if(o){return o(e,a,r,t)}else if(n._ael){return n._ael(e,a,r,t)}}}return e.addEventListener(a,r,t)};var removeEventListener=function(e,a,r,t){if(typeof window!=="undefined"){var i=window;var n=i&&i.Ionic&&i.Ionic.config;if(n){var o=n.get("_rel");if(o){return o(e,a,r,t)}else if(n._rel){return n._rel(e,a,r,t)}}}return e.removeEventListener(a,r,t)};var getElementRoot=function(e,a){if(a===void 0){a=e}return e.shadowRoot||a};var raf=function(e){if(typeof __zone_symbol__requestAnimationFrame==="function"){return __zone_symbol__requestAnimationFrame(e)}if(typeof requestAnimationFrame==="function"){return requestAnimationFrame(e)}return setTimeout(e)};var hasShadowDom=function(e){return!!e.shadowRoot&&!!e.attachShadow};var findItemLabel=function(e){var a=e.closest("ion-item");if(a){return a.querySelector("ion-label")}return null};var getAriaLabel=function(e,a){var r;var t=e.getAttribute("aria-labelledby");var i=e.id;var n=t!==null&&t.trim()!==""?t:a+"-lbl";var o=t!==null&&t.trim()!==""?document.getElementById(t):findItemLabel(e);if(o){if(t===null){o.id=n}r=o.textContent;o.setAttribute("aria-hidden","true")}else if(i.trim()!==""){o=document.querySelector('label[for="'.concat(i,'"]'));if(o){if(o.id!==""){n=o.id}else{o.id=n="".concat(i,"-lbl")}r=o.textContent}}return{label:o,labelId:n,labelText:r}};var renderHiddenInput=function(e,a,r,t,i){if(e||hasShadowDom(a)){var n=a.querySelector("input.aux-input");if(!n){n=a.ownerDocument.createElement("input");n.type="hidden";n.classList.add("aux-input");a.appendChild(n)}n.disabled=i;n.name=r;n.value=t||""}};var clamp=function(e,a,r){return Math.max(e,Math.min(a,r))};var assert=function(e,a){if(!e){var r="ASSERT: "+a;console.error(r);debugger;throw new Error(r)}};var now=function(e){return e.timeStamp||Date.now()};var pointerCoord=function(e){if(e){var a=e.changedTouches;if(a&&a.length>0){var r=a[0];return{x:r.clientX,y:r.clientY}}if(e.pageX!==undefined){return{x:e.pageX,y:e.pageY}}}return{x:0,y:0}};var isEndSide=function(e){var a=document.dir==="rtl";switch(e){case"start":return a;case"end":return!a;default:throw new Error('"'.concat(e,'" is not a valid value for [side]. Use "start" or "end" instead.'))}};var debounceEvent=function(e,a){var r=e._original||e;return{_original:e,emit:debounce(r.emit.bind(r),a)}};var debounce=function(e,a){if(a===void 0){a=0}var r;return function(){var t=[];for(var i=0;i<arguments.length;i++){t[i]=arguments[i]}clearTimeout(r);r=setTimeout.apply(void 0,__spreadArray([e,a],t,false))}};export{addEventListener as a,removeEventListener as b,componentOnReady as c,getAriaLabel as d,renderHiddenInput as e,debounceEvent as f,getElementRoot as g,inheritAttributes as h,inheritAriaAttributes as i,findItemLabel as j,clamp as k,hasShadowDom as l,assert as m,isEndSide as n,debounce as o,pointerCoord as p,now as q,raf as r};