1import{L as e,S as t,T as o,P as n,O as i,U as r,V as s,X as a,Y as d,Z as l}from"./index-B7717Xy-.js";const c=new WeakMap,u=(e,t,o,n=0,i=!1)=>{c.has(e)!==o&&(o?f(e,t,n,i):m(e,t))},f=(e,t,o,n=!1)=>{const i=t.parentNode,r=t.cloneNode(!1);r.classList.add("cloned-input"),r.tabIndex=-1,n&&(r.disabled=!0);const s="rtl"===e.ownerDocument.dir;r.style.insetInlineStart=s?i.offsetWidth-t.offsetLeft-t.offsetWidth+"px":"".concat(t.offsetLeft,"px"),i.appendChild(r),c.set(e,r);const a=s?9999:-9999;e.style.pointerEvents="none",t.style.transform="translate3d(".concat(a,"px,").concat(o,"px,0) scale(0)")},m=(e,t)=>{const o=c.get(e);o&&(c.delete(e),o.remove()),e.style.pointerEvents="",t.style.transform=""},v="input, textarea, [no-blur], [contenteditable]",p="$ionPaddingTimer",y=(e,t,o)=>{const n=e[p];n&&clearTimeout(n),t>0?e.style.setProperty("--keyboard-offset","".concat(t,"px")):e[p]=setTimeout(()=>{e.style.setProperty("--keyboard-offset","0px"),o&&o()},120)},h=(e,t,o)=>{e.addEventListener("focusout",()=>{t&&y(t,0,o)},{once:!0})};let w=0;const b="data-ionic-skip-scroll-assist",E=e=>{var t;if(document.activeElement===e)return;const o=e.getAttribute("id"),n=e.closest('label[for="'.concat(o,'"]')),i=null===(t=document.activeElement)||void 0===t?void 0:t.closest('label[for="'.concat(o,'"]'));null!==n&&n===i||(e.setAttribute(b,"true"),e.focus())},S=async(e,t,o,n,i,r,s=!1,a=0,c=!0)=>{if(!o&&!n)return;const f=(v=o||n,p=i,b=a,((e,t,o,n)=>{const i=e.top,r=e.bottom,s=t.top,a=s+15,d=Math.min(t.bottom,n-o)-50-r,l=a-i,c=Math.round(d<0?-d:l>0?-l:0),u=Math.min(c,i-s),f=Math.abs(u);return{scrollAmount:u,scrollDuration:Math.min(400,Math.max(150,f/.3)),scrollPadding:o,inputSafeY:4-(i-a)}})((null!==(S=(m=e).closest("ion-item,[ion-item]"))&&void 0!==S?S:m).getBoundingClientRect(),v.getBoundingClientRect(),p,b));var m,v,p,b,S;if(o&&Math.abs(f.scrollAmount)<4)return E(t),void(r&&null!==o&&(y(o,w),h(t,o,()=>w=0)));if(u(e,t,!0,f.inputSafeY,s),E(t),r&&o&&(w=f.scrollPadding,y(o,w)),"undefined"!=typeof window){let n;const i=async()=>{void 0!==n&&clearTimeout(n),window.removeEventListener("ionKeyboardDidShow",s),window.removeEventListener("ionKeyboardDidShow",i),o&&await l(o,0,f.scrollAmount,f.scrollDuration),u(e,t,!1,f.inputSafeY),document.activeElement===t&&E(t),r&&h(t,o,()=>w=0)},s=()=>{window.removeEventListener("ionKeyboardDidShow",s),window.addEventListener("ionKeyboardDidShow",i)};if(o){const e=await d(o);if(c&&f.scrollAmount>e.scrollHeight-e.clientHeight-e.scrollTop)return"password"===t.type?(f.scrollAmount+=50,window.addEventListener("ionKeyboardDidShow",s)):window.addEventListener("ionKeyboardDidShow",i),void(n=setTimeout(i,1e3))}i()}},g=async(d,l)=>{if(void 0===e)return;const c="ios"===l,f="android"===l,m=d.getNumber("keyboardHeight",290),p=d.getBoolean("scrollAssist",!0),y=d.getBoolean("hideCaretOnScroll",c),h=d.getBoolean("inputBlurring",!1),w=d.getBoolean("scrollPadding",!0),E=Array.from(e.querySelectorAll("ion-input, ion-textarea")),g=new WeakMap,L=new WeakMap,D=await t.getResizeMode(),x=async e=>{await new Promise(t=>n(e,t));const t=e.shadowRoot||e,d=t.querySelector("input")||t.querySelector("textarea"),l=i(e),c=l?null:e.closest("ion-footer");if(d){if(l&&y&&!g.has(e)){const t=((e,t,n)=>{if(!n||!t)return()=>{};const i=o=>{var n;(n=t)===n.getRootNode().activeElement&&u(e,t,o)},s=()=>u(e,t,!1),a=()=>i(!0),d=()=>i(!1);return o(n,"ionScrollStart",a),o(n,"ionScrollEnd",d),t.addEventListener("blur",s),()=>{r(n,"ionScrollStart",a),r(n,"ionScrollEnd",d),t.removeEventListener("blur",s)}})(e,d,l);g.set(e,t)}if("date"!==d.type&&"datetime-local"!==d.type&&(l||c)&&p&&!L.has(e)){const t=((e,t,o,n,i,r,d,l=!1)=>{const c=r&&(void 0===d||d.mode===s.None);let u=!1;const f=void 0!==a?a.innerHeight:0,m=i=>{!1!==u?S(e,t,o,n,i.detail.keyboardHeight,c,l,f,!1):u=!0},v=()=>{u=!1,null==a||a.removeEventListener("ionKeyboardDidShow",m),e.removeEventListener("focusout",v)},p=async()=>{t.hasAttribute(b)?t.removeAttribute(b):(S(e,t,o,n,i,c,l,f),null==a||a.addEventListener("ionKeyboardDidShow",m),e.addEventListener("focusout",v))};return e.addEventListener("focusin",p),()=>{e.removeEventListener("focusin",p),null==a||a.removeEventListener("ionKeyboardDidShow",m),e.removeEventListener("focusout",v)}})(e,d,l,c,m,w,D,f);L.set(e,t)}}};h&&(()=>{let e=!0,t=!1;const n=document;o(n,"ionScrollStart",()=>{t=!0}),n.addEventListener("focusin",()=>{e=!0},!0),n.addEventListener("touchend",o=>{if(t)return void(t=!1);const i=n.activeElement;if(!i)return;if(i.matches(v))return;const r=o.target;r!==i&&(r.matches(v)||r.closest(v)||(e=!1,setTimeout(()=>{e||i.blur()},50)))},!1)})();for(const e of E)x(e);e.addEventListener("ionInputDidLoad",e=>{x(e.detail)}),e.addEventListener("ionInputDidUnload",e=>{(e=>{if(y){const t=g.get(e);t&&t(),g.delete(e)}if(p){const t=L.get(e);t&&t(),L.delete(e)}})(e.detail)})};export{g as startInputShims}; 2//# sourceMappingURL=p-D5Ubpm7D-CTEBUdxY.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.