import{U as e,w as t}from"./runtime-core.esm-bundler-Babufkcf.js";function n(n,r,i){let a=()=>typeof n==`function`?n():n.value;function o(){let e=a();if(Array.isArray(e)){for(;e.length>1&&r(e[e.length-1])&&r(e[e.length-2]);)e.pop();(e.length===0||!r(e[e.length-1]))&&e.push(i())}}let s=e(a,()=>t(o),{deep:!0,immediate:!0});function c(){return(a()||[]).filter(e=>!r(e))}function l(e){let t=a()||[];return e===t.length-1&&r(t[e])}function u(e,n){o(),t(()=>{let t=e?.querySelectorAll?.(n),r=t?.[t.length-1];r&&(r.scrollIntoView?.({block:`nearest`,behavior:`smooth`}),r.querySelector(`input:not([disabled]):not([type=hidden])`)?.focus())})}return{trim:o,filled:c,isSpare:l,isBlank:r,add:u,stop:s}}export{n as t};