/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */
import{w as o}from"./p-W-2TssC9.js";import{r}from"./p-BiTKUjko.js";import{j as t}from"./p-C8IsBmNU.js";const i=(t,i,s)=>{let e,n;if(void 0!==o&&"MutationObserver"in o){const o=Array.isArray(i)?i:[i];e=new MutationObserver((t=>{for(const i of t)for(const t of i.addedNodes)if(t.nodeType===Node.ELEMENT_NODE&&o.includes(t.slot))return s(),void r((()=>c(t)))})),e.observe(t,{childList:!0,subtree:!0})}const c=o=>{var r;n&&(n.disconnect(),n=void 0),n=new MutationObserver((o=>{s();for(const r of o)for(const o of r.removedNodes)o.nodeType===Node.ELEMENT_NODE&&o.slot===i&&d()})),n.observe(null!==(r=o.parentElement)&&void 0!==r?r:o,{subtree:!0,childList:!0})},d=()=>{n&&(n.disconnect(),n=void 0)};return{destroy:()=>{e&&(e.disconnect(),e=void 0),d()}}},s=(o,r,i)=>{const s=null==o?0:o.toString().length,n=e(s,r);if(void 0===i)return n;try{return i(s,r)}catch(o){return t("[ion-input] - Exception in provided `counterFormatter`:",o),n}},e=(o,r)=>`${o} / ${r}`;export{i as c,s as g}