import{a2 as k,_ as f,G as m,A as t,R as _,I as b}from"./qex-fw8l.js";function i(e,a,v=a){var c=new WeakSet;k(e,"input",async r=>{var l=r?e.defaultValue:e.value;if(l=s(e)?u(l):l,v(l),f!==null&&c.add(f),await m(),l!==(l=a())){var n=e.selectionStart,d=e.selectionEnd,h=e.value.length;if(e.value=l??"",d!==null){var o=e.value.length;n===d&&d===h&&o>h?(e.selectionStart=o,e.selectionEnd=o):(e.selectionStart=n,e.selectionEnd=Math.min(d,o))}}}),(b&&e.defaultValue!==e.value||t(a)==null&&e.value)&&(v(s(e)?u(e.value):e.value),f!==null&&c.add(f)),_(()=>{var r=a();if(e===document.activeElement){var l=f;if(c.has(l))return}s(e)&&r===u(e.value)||e.type==="date"&&!r&&!e.value||r!==e.value&&(e.value=r??"")})}function E(e,a,v=a){k(e,"change",c=>{var r=c?e.defaultChecked:e.checked;v(r)}),(b&&e.defaultChecked!==e.checked||t(a)==null)&&v(e.checked),_(()=>{var c=a();e.checked=!!c})}function s(e){var a=e.type;return a==="number"||a==="range"}function u(e){return e===""?null:+e}export{E as a,i as b};
