/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */
const t="ionKeyboardDidShow";const o="ionKeyboardDidHide";const e=150;let s={};let n={};let c=false;const i=()=>{s={};n={};c=false};const a=t=>{d(t);if(!t.visualViewport){return}n=y(t.visualViewport);t.visualViewport.onresize=()=>{w(t);if(l()||h(t)){f(t)}else if(b(t)){r(t)}}};const d=t=>{t.addEventListener("keyboardDidShow",(o=>f(t,o)));t.addEventListener("keyboardDidHide",(()=>r(t)))};const f=(t,o)=>{p(t,o);c=true};const r=t=>{u(t);c=false};const l=()=>{const t=(s.height-n.height)*n.scale;return!c&&s.width===n.width&&t>e};const h=t=>c&&!b(t);const b=t=>c&&n.height===t.innerHeight;const p=(o,e)=>{const s=e?e.keyboardHeight:o.innerHeight-n.height;const c=new CustomEvent(t,{detail:{keyboardHeight:s}});o.dispatchEvent(c)};const u=t=>{const e=new CustomEvent(o);t.dispatchEvent(e)};const w=t=>{s=Object.assign({},n);n=y(t.visualViewport)};const y=t=>({width:Math.round(t.width),height:Math.round(t.height),offsetTop:t.offsetTop,offsetLeft:t.offsetLeft,pageTop:t.pageTop,pageLeft:t.pageLeft,scale:t.scale});export{o as KEYBOARD_DID_CLOSE,t as KEYBOARD_DID_OPEN,y as copyVisualViewport,b as keyboardDidClose,l as keyboardDidOpen,h as keyboardDidResize,i as resetKeyboardAssist,r as setKeyboardClose,f as setKeyboardOpen,a as startKeyboardAssist,w as trackViewportChanges};
//# sourceMappingURL=p-7e7ce516.js.map