import{d as p,a9 as d,l as r,af as v,w as x,r as _,g,v as V,c as w,o as k,u as M}from"./app-DJb_CRLj.js";import{u as b}from"./useRandomStr-7r5tQ8Eq.js";const h=["name"],B=p({__name:"FormatedNumInput",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(i,{expose:m}){const a=d(i,"modelValue");r(async()=>{await v();const e=a.value;e!=null&&e!=""&&s(e+"")}),x(a,e=>{e!=null&&e!=""&&s(e)});const s=e=>{let c=(n=>n.replace(/[٠-٩]/g,l=>"٠١٢٣٤٥٦٧٨٩".indexOf(l)))((n=>n.replace(/[۰-۹]/g,l=>"۰۱۲۳۴۵۶۷۸۹".indexOf(l)))(e)).replace(/\D+/g,""),f=new Intl.NumberFormat("en-US");a.value=f.format(c)},o=_(null);return r(()=>{var e,t;(e=o.value)!=null&&e.hasAttribute("autofocus")&&((t=o.value)==null||t.focus())}),m({focus:()=>{var e;return(e=o.value)==null?void 0:e.focus()}}),(e,t)=>g((k(),w("input",{type:"text",class:"form-control","onUpdate:modelValue":t[0]||(t[0]=u=>a.value=u),ref_key:"input",ref:o,name:M(b)(15)},null,8,h)),[[V,a.value]])}});export{B as _};
