function W(n){return Math.abs(n=Math.round(n))>=1e21?n.toLocaleString("en").replace(/,/g,""):n.toString(10)}function j(n,t){if((e=(n=t?n.toExponential(t-1):n.toExponential()).indexOf("e"))<0)return null;var e,i=n.slice(0,e);return[i.length>1?i[0]+i.slice(2):i,+n.slice(e+1)]}function b(n){return n=j(Math.abs(n)),n?n[1]:NaN}function _(n,t){return function(e,i){for(var o=e.length,f=[],c=0,m=n[0],x=0;o>0&&m>0&&!(x+m+1>i&&(m=Math.max(1,i-x)),f.push(e.substring(o-=m,o+m)),(x+=m+1)>i);)m=n[c=(c+1)%n.length];return f.reverse().join(t)}}function v(n){return function(t){return t.replace(/[0-9]/g,function(e){return n[+e]})}}var nn=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function E(n){if(!(t=nn.exec(n)))throw new Error("invalid format: "+n);var t;return new F({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}E.prototype=F.prototype;function F(n){this.fill=n.fill===void 0?" ":n.fill+"",this.align=n.align===void 0?">":n.align+"",this.sign=n.sign===void 0?"-":n.sign+"",this.symbol=n.symbol===void 0?"":n.symbol+"",this.zero=!!n.zero,this.width=n.width===void 0?void 0:+n.width,this.comma=!!n.comma,this.precision=n.precision===void 0?void 0:+n.precision,this.trim=!!n.trim,this.type=n.type===void 0?"":n.type+""}F.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function tn(n){n:for(var t=n.length,e=1,i=-1,o;e<t;++e)switch(n[e]){case".":i=o=e;break;case"0":i===0&&(i=e),o=e;break;default:if(!+n[e])break n;i>0&&(i=0);break}return i>0?n.slice(0,i)+n.slice(o+1):n}var I;function rn(n,t){var e=j(n,t);if(!e)return n+"";var i=e[0],o=e[1],f=o-(I=Math.max(-8,Math.min(8,Math.floor(o/3)))*3)+1,c=i.length;return f===c?i:f>c?i+new Array(f-c+1).join("0"):f>0?i.slice(0,f)+"."+i.slice(f):"0."+new Array(1-f).join("0")+j(n,Math.max(0,t+f-1))[0]}function R(n,t){var e=j(n,t);if(!e)return n+"";var i=e[0],o=e[1];return o<0?"0."+new Array(-o).join("0")+i:i.length>o+1?i.slice(0,o+1)+"."+i.slice(o+1):i+new Array(o-i.length+2).join("0")}var X={"%":(n,t)=>(n*100).toFixed(t),b:n=>Math.round(n).toString(2),c:n=>n+"",d:W,e:(n,t)=>n.toExponential(t),f:(n,t)=>n.toFixed(t),g:(n,t)=>n.toPrecision(t),o:n=>Math.round(n).toString(8),p:(n,t)=>R(n*100,t),r:R,s:rn,X:n=>Math.round(n).toString(16).toUpperCase(),x:n=>Math.round(n).toString(16)};function O(n){return n}var U=Array.prototype.map,Y=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"];function Z(n){var t=n.grouping===void 0||n.thousands===void 0?O:_(U.call(n.grouping,Number),n.thousands+""),e=n.currency===void 0?"":n.currency[0]+"",i=n.currency===void 0?"":n.currency[1]+"",o=n.decimal===void 0?".":n.decimal+"",f=n.numerals===void 0?O:v(U.call(n.numerals,String)),c=n.percent===void 0?"%":n.percent+"",m=n.minus===void 0?"\u2212":n.minus+"",x=n.nan===void 0?"NaN":n.nan+"";function $(a){a=E(a);var p=a.fill,w=a.align,d=a.sign,S=a.symbol,l=a.zero,k=a.width,N=a.comma,g=a.precision,T=a.trim,h=a.type;h==="n"?(N=!0,h="g"):X[h]||(g===void 0&&(g=12),T=!0,h="g"),(l||p==="0"&&w==="=")&&(l=!0,p="0",w="=");var K=S==="$"?e:S==="#"&&/[boxX]/.test(h)?"0"+h.toLowerCase():"",Q=S==="$"?i:/[%p]/.test(h)?c:"",C=X[h],V=/[defgprs%]/.test(h);g=g===void 0?6:/[gprs]/.test(h)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g));function D(r){var y=K,u=Q,M,G,P;if(h==="c")u=C(r)+u,r="";else{r=+r;var z=r<0||1/r<0;if(r=isNaN(r)?x:C(Math.abs(r),g),T&&(r=tn(r)),z&&+r===0&&d!=="+"&&(z=!1),y=(z?d==="("?d:m:d==="-"||d==="("?"":d)+y,u=(h==="s"?Y[8+I/3]:"")+u+(z&&d==="("?")":""),V){for(M=-1,G=r.length;++M<G;)if(P=r.charCodeAt(M),48>P||P>57){u=(P===46?o+r.slice(M+1):r.slice(M))+u,r=r.slice(0,M);break}}}N&&!l&&(r=t(r,Infinity));var A=y.length+r.length+u.length,s=A<k?new Array(k-A+1).join(p):"";N&&l&&(r=t(s+r,s.length?k-u.length:Infinity),s="");switch(w){case"<":r=y+r+u+s;break;case"=":r=y+s+r+u;break;case"^":r=s.slice(0,A=s.length>>1)+y+r+u+s.slice(A);break;default:r=s+y+r+u;break}return f(r)}return D.toString=function(){return a+""},D}function J(a,p){var w=$((a=E(a),a.type="f",a)),d=Math.max(-8,Math.min(8,Math.floor(b(p)/3)))*3,S=Math.pow(10,-d),l=Y[8+d/3];return function(k){return w(S*k)+l}}return{format:$,formatPrefix:J}}var L,q,B;H({thousands:",",grouping:[3],currency:["$",""]});function H(n){return L=Z(n),q=L.format,B=L.formatPrefix,L}function en(n){return Math.max(0,-b(Math.abs(n)))}function on(n,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(b(t)/3)))*3-b(Math.abs(n)))}function an(n,t){return n=Math.abs(n),t=Math.abs(t)-n,Math.max(0,b(t)-b(n))+1}export{F as FormatSpecifier,q as format,H as formatDefaultLocale,Z as formatLocale,B as formatPrefix,E as formatSpecifier,en as precisionFixed,on as precisionPrefix,an as precisionRound};export default null;
