2 lines
8.9 KiB
JavaScript
Raw Normal View History

2024-08-24 20:48:14 +02:00
import{a4 as rn,a5 as en}from"./index-BPCszWWQ.js";import{i as an}from"./init-Gi6I4Gst.js";function F(n,t){return n==null||t==null?NaN:n<t?-1:n>t?1:n>=t?0:NaN}function on(n,t){return n==null||t==null?NaN:t<n?-1:t>n?1:t>=n?0:NaN}function K(n){let t,e,r;n.length!==2?(t=F,e=(o,c)=>F(n(o),c),r=(o,c)=>n(o)-c):(t=n===F||n===on?n:un,e=n,r=n);function a(o,c,i=0,l=o.length){if(i<l){if(t(c,c)!==0)return l;do{const h=i+l>>>1;e(o[h],c)<0?i=h+1:l=h}while(i<l)}return i}function f(o,c,i=0,l=o.length){if(i<l){if(t(c,c)!==0)return l;do{const h=i+l>>>1;e(o[h],c)<=0?i=h+1:l=h}while(i<l)}return i}function u(o,c,i=0,l=o.length){const h=a(o,c,i,l-1);return h>i&&r(o[h-1],c)>-r(o[h],c)?h-1:h}return{left:a,center:u,right:f}}function un(){return 0}function fn(n){return n===null?NaN:+n}const cn=K(F),hn=cn.right;K(fn).center;const mn=Math.sqrt(50),sn=Math.sqrt(10),ln=Math.sqrt(2);function E(n,t,e){const r=(t-n)/Math.max(0,e),a=Math.floor(Math.log10(r)),f=r/Math.pow(10,a),u=f>=mn?10:f>=sn?5:f>=ln?2:1;let o,c,i;return a<0?(i=Math.pow(10,-a)/u,o=Math.round(n*i),c=Math.round(t*i),o/i<n&&++o,c/i>t&&--c,i=-i):(i=Math.pow(10,a)*u,o=Math.round(n/i),c=Math.round(t/i),o*i<n&&++o,c*i>t&&--c),c<o&&.5<=e&&e<2?E(n,t,e*2):[o,c,i]}function dn(n,t,e){if(t=+t,n=+n,e=+e,!(e>0))return[];if(n===t)return[n];const r=t<n,[a,f,u]=r?E(t,n,e):E(n,t,e);if(!(f>=a))return[];const o=f-a+1,c=new Array(o);if(r)if(u<0)for(let i=0;i<o;++i)c[i]=(f-i)/-u;else for(let i=0;i<o;++i)c[i]=(f-i)*u;else if(u<0)for(let i=0;i<o;++i)c[i]=(a+i)/-u;else for(let i=0;i<o;++i)c[i]=(a+i)*u;return c}function T(n,t,e){return t=+t,n=+n,e=+e,E(n,t,e)[2]}function gn(n,t,e){t=+t,n=+n,e=+e;const r=t<n,a=r?T(t,n,e):T(n,t,e);return(r?-1:1)*(a<0?1/-a:a)}function Mn(n,t){return n=+n,t=+t,function(e){return Math.round(n*(1-e)+t*e)}}function yn(n){return Math.abs(n=Math.round(n))>=1e21?n.toLocaleString("en").replace(/,/g,""):n.toString(10)}function R(n,t){if((e=(n=t?n.toExponential(t-1):n.toExponential()).indexOf("e"))<0)return null;var e,r=n.slice(0,e);return[r.length>1?r[0]+r.slice(2):r,+n.slice(e+1)]}function S(n){return n=R(Math.abs(n)),n?n[1]:NaN}function pn(n,t){return function(e,r){for(var a=e.length,f=[],u=0,o=n[0],c=0;a>0&&o>0&&(c+o+1>r&&(o=Math.max(1,r-c)),f.push(e.substring(a-=o,a+o)),!((c+=o+1)>r));)o=n[u=(u+1)%n.length];return f.reverse().join(t)}}function wn(n){return function(t){return t.replace(/[0-9]/g,function(e){return n[+e]})}}var bn=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function I(n){if(!(t=bn.exec(n)))throw new Error("invalid format: "+n);var t;return new C({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]})}I.prototype=C.prototype;function C(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+""}C.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 Nn(n){n:for(var t=n.length,e=1,r=-1,a;e<t;++e)switch(n[e]){case".":r=a=e;break;case"0":r===0&&(r=e),a=e;break;default:if(!+n[e])break n;r>0&&(r=0);break}return r>0?n.slice(0,r)+n.slice(a+1):n}var Q;function kn(n,t){var e=R(n,t);if(!e)return n+"";var r=e[0],a=e[1],f=a-(Q=Math.max(-8,Math.min(8,Math.floor(a/3)))*3)+1,u=r.length;return f===u?r:f>u?r+new Array(f-u+1).join("0"):f>0?r.slice(0,f)+"."+r.slice(f):"0."+new Array(1-f).join("0")+R(n,Math.max(0,t+f-1))[0]}function O(n,t){var e=R(n,t);if(!e)return n+"";var r=e[0],a=e[1];return a<0?"0."+new Array(-a).join("0")+r:r.length>a+1?r.slice(0,a+1)+"."+r.slice(a+1):r+new Array(a-r.length+2).join("0")}const U={"%":(n,t)=>(n*100).toFixed(t),b:n=>Math.round(n).toString(2)