1import{b as O,d as N,f as k}from"./chunk-PW6GA5NL.js";import{b as F,c as H}from"./chunk-JNMFIV4M.js";import{b as p,f as I,g as T,i as _}from"./chunk-DXRS3GW7.js";import"./chunk-ZDL7X67C.js";import{a as S,b as A}from"./chunk-CLVRMGG4.js";import{g as b}from"./chunk-NMDLJX5Q.js";var C=new WeakMap,P=(e,t,s,o=0,r=!1)=>{C.has(e)!==s&&(s?G(e,t,o,r):z(e,t))},q=e=>e===e.getRootNode().activeElement,G=(e,t,s,o=!1)=>{let r=t.parentNode,n=t.cloneNode(!1);n.classList.add("cloned-input"),n.tabIndex=-1,o&&(n.disabled=!0);let a=e.ownerDocument.dir==="rtl";if(a){let u=r.offsetWidth-t.offsetLeft-t.offsetWidth;n.style.insetInlineStart=`${u}px`}else n.style.insetInlineStart=`${t.offsetLeft}px`;r.appendChild(n),C.set(e,n);let f=a?9999:-9999;e.style.pointerEvents="none",t.style.transform=`translate3d(${f}px,${s}px,0) scale(0)`},z=(e,t)=>{let s=C.get(e);s&&(C.delete(e),s.remove()),e.style.pointerEvents="",t.style.transform=""},Y=50,j=(e,t,s)=>{if(!s||!t)return()=>{};let o=a=>{q(t)&&P(e,t,a)},r=()=>P(e,t,!1),n=()=>o(!0),c=()=>o(!1);return I(s,"ionScrollStart",n),I(s,"ionScrollEnd",c),t.addEventListener("blur",r),()=>{T(s,"ionScrollStart",n),T(s,"ionScrollEnd",c),t.removeEventListener("blur",r)}},B="input, textarea, [no-blur], [contenteditable]",J=()=>{let e=!0,t=!1,s=document,o=()=>{t=!0},r=()=>{e=!0},n=c=>{if(t){t=!1;return}let a=s.activeElement;if(!a||a.matches(B))return;let f=c.target;f!==a&&(f.matches(B)||f.closest(B)||(e=!1,setTimeout(()=>{e||a.blur()},50)))};return I(s,"ionScrollStart",o),s.addEventListener("focusin",r,!0),s.addEventListener("touchend",n,!1),()=>{T(s,"ionScrollStart",o,!0),s.removeEventListener("focusin",r,!0),s.removeEventListener("touchend",n,!1)}},Q=.3,V=(e,t,s,o)=>{var r;let n=(r=e.closest("ion-item,[ion-item]"))!==null&&r!==void 0?r:e;return X(n.getBoundingClientRect(),t.getBoundingClientRect(),s,o)},X=(e,t,s,o)=>{let r=e.top,n=e.bottom,c=t.top,a=Math.min(t.bottom,o-s),f=c+15,u=a-Y-n,d=f-r,m=Math.round(u<0?-u:d>0?-d:0),v=Math.min(m,r-c),i=Math.abs(v)/Q,h=Math.min(400,Math.max(150,i));return{scrollAmount:v,scrollDuration:h,scrollPadding:s,inputSafeY:-(r-f)+4}},$="$ionPaddingTimer",K=(e,t,s)=>{let o=e[$];o&&clearTimeout(o),t>0?e.style.setProperty("--keyboard-offset",`${t}px`):e[$]=setTimeout(()=>{e.style.setProperty("--keyboard-offset","0px"),s&&s()},120)},W=(e,t,s)=>{let o=()=>{t&&K(t,0,s)};e.addEventListener("focusout",o,{once:!0})},D=0,x="data-ionic-skip-scroll-assist",Z=(e,t,s,o,r,n,c,a=!1)=>{let f=n&&(c===void 0||c.mode===F.None),l=!1,u=S!==void 0?S.innerHeight:0,d=y=>{if(l===!1){l=!0;return}U(e,t,s,o,y.detail.keyboardHeight,f,a,u,!1)},m=()=>{l=!1,S===null||S===void 0||S.removeEventListener("ionKeyboardDidShow",d),e.removeEventListener("focusout",m)},v=()=>b(null,null,function*(){if(t.hasAttribute(x)){t.removeAttribute(x);return}U(e,t,s,o,r,f,a,u),S===null||S===void 0||S.addEventListener("ionKeyboardDidShow",d),e.addEventListener("focusout",m)});return e.addEventListener("focusin",v),()=>{e.removeEventListener("focusin",v),S===null||S===void 0||S.removeEventListener("ionKeyboardDidShow",d),e.removeEventListener("focusout",m)}},M=e=>{var t;if(document.activeElement===e)return;let s=e.getAttribute("id"),o=e.closest(`label[for="${s}"]`),r=(t=document.activeElement)===null||t===void 0?void 0:t.closest(`label[for="${s}"]`);o!==null&&o===r||(e.setAttribute(x,"true"),e.focus())},U=(e,t,s,o,r,n,c=!1,a=0,f=!0)=>b(null,null,function*(){if(!s&&!o)return;let l=V(e,s||o,r,a);if(s&&Math.abs(l.scrollAmount)<4){M(t),n&&s!==null&&(K(s,D),W(t,s,()=>D=0));return}if(P(e,t,!0,l.inputSafeY,c),M(t),_(()=>e.click()),n&&s&&(D=l.scrollPadding,K(s,D)),typeof window<"u"){let u,d=()=>b(null,null,function*(){u!==void 0&&clearTimeout(u),window.removeEventListener("ionKeyboardDidShow",m),window.removeEventListener("ionKeyboardDidShow",d),s&&(yield k(s,0,l.scrollAmount,l.scrollDuration)),P(e,t,!1,l.inputSafeY),document.activeElement===t&&M(t),n&&W(t,s,()=>D=0)}),m=()=>{window.removeEventListener("ionKeyboardDidShow",m),window.addEventListener("ionKeyboardDidShow",d)};if(s){let v=yield O(s),y=v.scrollHeight-v.clientHeight;if(f&&l.scrollAmount>y-v.scrollTop){t.type==="password"?(l.scrollAmount+=Y,window.addEventListener("ionKeyboardDidShow",m)):window.addEventListener("ionKeyboardDidShow",d),u=setTimeout(d,1e3);return}}d()}}),E=!0,ne=(e,t)=>b(null,null,function*(){if(A===void 0)return;let s=t==="ios",o=t==="android",r=e.getNumber("keyboardHeight",290),n=e.getBoolean("scrollAssist",!0),c=e.getBoolean("hideCaretOnScroll",s),a=e.getBoolean("inputBlurring",!1),f=e.getBoolean("scrollPadding",!0),l=Array.from(A.querySelectorAll("ion-input, ion-textarea")),u=new WeakMap,d=new WeakMap,m=yield H.getResizeMode(),v=i=>b(null,null,function*(){yield new Promise(g=>p(i,g));let h=i.shadowRoot||i,L=h.querySelector("input")||h.querySelector("textarea"),w=N(i),R=w?null:i.closest("ion-footer");if(!L)return;if(w&&c&&!u.has(i)){let g=j(i,L,w);u.set(i,g)}if(!(L.type==="date"||L.type==="datetime-local")&&(w||R)&&n&&!d.has(i)){let g=Z(i,L,w,R,r,f,m,o);d.set(i,g)}}),y=i=>{if(c){let h=u.get(i);h&&h(),u.delete(i)}if(n){let h=d.get(i);h&&h(),d.delete(i)}};a&&E&&J();for(let i of l)v(i);A.addEventListener("ionInputDidLoad",i=>{v(i.detail)}),A.addEventListener("ionInputDidUnload",i=>{y(i.detail)})});export{ne as startInputShims};
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.