import{t as n}from"./c28185803-DaSdt7Xo.js";import{t}from"./ce37f0136-C-OQMol4.js";function r(){var e,u,a=n().unknown(void 0),i=a.domain,o=a.range,d=0,c=1,g=!1,f=0,p=0,h=.5;function l(){var n=i().length,t=c<d,r=t?c:d,a=t?d:c;e=(a-r)/Math.max(1,n-f+2*p),g&&(e=Math.floor(e)),r+=(a-r-e*(n-f))*h,u=e*(1-f),g&&(r=Math.round(r),u=Math.round(u));var l=function(n,t,r){n=+n,t=+t,r=(u=arguments.length)<2?(t=n,n=0,1):u<3?1:+r;for(var e=-1,u=0|Math.max(0,Math.ceil((t-n)/r)),a=new Array(u);++e<u;)a[e]=n+e*r;return a}(n).map(function(n){return r+e*n});return o(t?l.reverse():l)}return delete a.unknown,a.domain=function(n){return arguments.length?(i(n),l()):i()},a.range=function(n){return arguments.length?([d,c]=n,d=+d,c=+c,l()):[d,c]},a.rangeRound=function(n){return[d,c]=n,d=+d,c=+c,g=!0,l()},a.bandwidth=function(){return u},a.step=function(){return e},a.round=function(n){return arguments.length?(g=!!n,l()):g},a.padding=function(n){return arguments.length?(f=Math.min(1,p=+n),l()):f},a.paddingInner=function(n){return arguments.length?(f=Math.min(1,n),l()):f},a.paddingOuter=function(n){return arguments.length?(p=+n,l()):p},a.align=function(n){return arguments.length?(h=Math.max(0,Math.min(1,n)),l()):h},a.copy=function(){return r(i(),[d,c]).round(g).paddingInner(f).paddingOuter(p).align(h)},t.apply(l(),arguments)}function e(n){var t=n.copy;return n.padding=n.paddingOuter,delete n.paddingInner,delete n.paddingOuter,n.copy=function(){return e(t())},n}function u(){return e(r.apply(null,arguments).paddingInner(1))}export{u as n,r as t};