import{g as e}from"./index-B1MHyEgd.js";function t(e,t){return t.forEach(function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach(function(s){if("default"!==s&&!(s in e)){var i=Object.getOwnPropertyDescriptor(t,s);Object.defineProperty(e,s,i.get?i:{enumerable:!0,get:function(){return t[s]}})}})}),Object.freeze(e)}var s,i={exports:{}};var r,a=s?i.exports:(s=1,r="undefined"==typeof window?i.exports:window,i.exports=((e,t,s)=>(()=>{var i,r={512:e=>{e.exports=s},820:e=>{e.exports=t},944:t=>{t.exports=e}},a={};function n(e){var t=a[e];if(void 0!==t)return t.exports;var s=a[e]={exports:{}};return r[e](s,s.exports,n),s.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var s in t)n.o(t,s)&&!n.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var o={};n.d(o,{default:()=>q});var h=n(944),l=n.n(h),d=n(820),u=n.n(d);let{noop:p}=l(),{addEvent:c,defined:v}=l();!function(e){function t(){u().prototype.init.apply(this,arguments),this.initialised=!1,this.baseSeries=null,this.eventRemovers=[],this.addEvents()}function s(){let e=this.chart,t=this.options.baseSeries,s=v(t)&&(e.series[t]||e.get(t));this.baseSeries=s||null}function i(){this.eventRemovers.push(c(this.chart,"afterLinkSeries",()=>{this.setBaseSeries(),this.baseSeries&&!this.initialised&&(this.setDerivedData(),this.addBaseSeriesEvents(),this.initialised=!0)}))}function r(){this.eventRemovers.push(c(this.baseSeries,"updatedData",()=>{this.setDerivedData()}),c(this.baseSeries,"destroy",()=>{this.baseSeries=null,this.initialised=!1}))}function a(){this.eventRemovers.forEach(e=>{e()}),u().prototype.destroy.apply(this,arguments)}e.hasDerivedData=!0,e.setDerivedData=p,e.compose=function(e){let n=e.prototype;return n.addBaseSeriesEvents=r,n.addEvents=i,n.destroy=a,n.init=t,n.setBaseSeries=s,e},e.init=t,e.setBaseSeries=s,e.addEvents=i,e.addBaseSeriesEvents=r,e.destroy=a}(i||(i={}));let f=i;var b=n(512),m=n.n(b);let{column:g}=m().seriesTypes,{arrayMax:y,arrayMin:D,correctFloat:x,isNumber:S,merge:M}=l(),O={"square-root":function(e){return Math.ceil(Math.sqrt(e.length))},sturges:function(e){return Math.ceil(Math.log(e.length)*Math.LOG2E)},rice:function(e){return Math.ceil(2*Math.pow(e.length,1/3))}};class E extends g{binsNumber(e){let t=this.options.binsNumber,s=O[t]||"function"==typeof t&&t;return Math.ceil(s&&s(e)||(S(t)?t:O["square-root"](e)))}setData(e,t=!0,s,i){let r;void 0!==e&&e.length>0&&(r=this.derivedData(e.filter(S),this.binsNumber(e),this.options.binWidth)),super.setData.call(this,r,t,s,i)}derivedData(e,t,s){var i;let r,a=x(y(e)),n=x(D(e)),o=[],h={},l=[];for(s=this.binWidth=x(S(s)?s||1:(a-n)/t),this.options.pointRange=Math.max(s,0),r=n;r<a&&(this.userOptions.binWidth||x(a-r)>=s||0>=x(x(n+o.length*s)-r));r=x(r+s))o.push(r),h[r]=0;0!==h[n]&&(o.push(n),h[n]=0);let d=(i=o.map(e=>parseFloat(e)),function(e){let t=1;for(;i[t]<=e;)t++;return i[--t]});for(let t of e)h[x(d(t))]++;for(let e of Object.keys(h))l.push({x:Number(e),y:h[e],x2:x(Number(e)+s)});return l.sort((e,t)=>e.x-t.x),l[l.length-1].x2=a,l}setDerivedData(){let e=this.baseSeries?.getColumn("y");e?.length?this.setData(e,!1,void 0,!1):this.setData([])}}E.defaultOptions=M(g.defaultOptions,{binsNumber:"square-root",binWidth:void 0,pointPadding:0,groupPadding:0,grouping:!1,pointPlacement:"between",tooltip:{headerFormat:"",pointFormat:'<span style="font-size: 0.8em">{point.x} - {point.x2}</span><br/><span style="color:{point.color}">●</span> {series.name} <b>{point.y}</b><br/>'}}),f.compose(E),m().registerSeriesType("histogram",E);let{areaspline:_}=m().seriesTypes,{correctFloat:j,isNumber:w,merge:N}=l();class P extends _{static mean(e){let t=e.length,s=e.reduce(function(e,t){return e+t},0);return t>0&&s/t}static standardDeviation(e,t){let s=e.length;t=w(t)?t:P.mean(e);let i=e.reduce((e,s)=>{let i=s-t;return e+i*i},0);return s>1&&Math.sqrt(i/(s-1))}static normalDensity(e,t,s){let i=e-t;return Math.exp(-i*i/(2*s*s))/(s*Math.sqrt(2*Math.PI))}setData(e,t=!0,s,i){let r;void 0!==e&&e.length>0&&(e=e.filter(w),this.setMean(e),this.setStandardDeviation(e),r=this.derivedData(this.mean||0,this.standardDeviation||0)),super.setData.call(this,r,t,s,i)}derivedData(e,t){let s=this.options,i=s.intervals,r=s.pointsInInterval,a=i*r*2+1,n=t/r,o=[],h=e-i*t;for(let s=0;s<a;s++)o.push([h,P.normalDensity(h,e,t)]),h+=n;return o}setDerivedData(){this.baseSeries?.getColumn("y").length&&this.setData(this.baseSeries?.getColumn("y"),!1,void 0,!1)}setMean(e){this.mean=j(P.mean(e||[]))}setStandardDeviation(e){this.standardDeviation=j(P.standardDeviation(e||[],this.mean))}}P.defaultOptions=N(_.defaultOptions,{intervals:3,pointsInInterval:3,marker:{enabled:!1}}),f.compose(P),m().registerSeriesType("bellcurve",P);let q=l();return o.default})())(r._Highcharts,r._Highcharts.Series,r._Highcharts.SeriesRegistry)),n=t({__proto__:null,default:e(a)},[a]);export{n as h};
//# sourceMappingURL=histogram-bellcurve-DtSEgfhm.js.map
