import{r as a,c$ as d,j as o,d0 as N}from"./index-C4inJ1rU.js";import{A as g}from"./index-BXWmGYBj.js";const b=a.memo(function({value:t,format:e,prefix:r,suffix:s,className:n,priority:m="medium"}){const[u,p]=a.useState(!1),[f,l]=a.useState(t);a.useEffect(()=>d(()=>{p(!0),l(0)},m),[m]),a.useEffect(()=>{u&&l(t)},[u,t]);const A=`${r??""}${t.toLocaleString(void 0,e)}${s??""}`;return u?o.jsx(g,{className:`${n??""} overflow-hidden`,format:e,prefix:r,suffix:s,transition:N.numberTicker,children:f}):o.jsx("span",{className:n,children:A})}),x={",":"punc",".":"punc-period",":":"punc-colon","/":"punc-slash"},c=/([,\.:\/])/g;function j(i){return i.split(c).map((e,r)=>{const s=x[e];return s?o.jsx("span",{className:s,children:e},r):e})}const I=a.memo(function({children:t,className:e="",as:r="span"}){const s=a.useMemo(()=>{let n;return typeof t=="number"?n=t.toLocaleString():Array.isArray(t)?n=t.join(""):n=String(t??""),c.test(n)?(c.lastIndex=0,j(n)):n},[t]);return o.jsx(r,{className:`data-tight ${e}`.trim(),children:s})});export{b as A,I as D};
