/*
 Highstock JS v10.3.2 (2022-11-28)

 HeikinAshi series type for Highcharts Stock

 (c) 2010-2021 Karol Kolodziej

 License: www.highcharts.com/license
*/
(function(a){"object"===typeof module&&module.exports?(a["default"]=a,module.exports=a):"function"===typeof define&&define.amd?define("highcharts/modules/heikinashi",["highcharts","highcharts/modules/stock"],function(e){a(e);a.Highcharts=e;return a}):a("undefined"!==typeof Highcharts?Highcharts:void 0)})(function(a){function e(a,b,g,c){a.hasOwnProperty(b)||(a[b]=c.apply(null,g),"function"===typeof CustomEvent&&window.dispatchEvent(new CustomEvent("HighchartsModuleLoaded",{detail:{path:b,module:a[b]}})))}
a=a?a._modules:{};e(a,"Series/HeikinAshi/HeikinAshiPoint.js",[a["Core/Series/SeriesRegistry.js"]],function(a){var b=this&&this.__extends||function(){var a=function(c,b){a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,c){a.__proto__=c}||function(a,c){for(var b in c)c.hasOwnProperty(b)&&(a[b]=c[b])};return a(c,b)};return function(c,b){function g(){this.constructor=c}a(c,b);c.prototype=null===b?Object.create(b):(g.prototype=b.prototype,new g)}}();return function(a){function c(){return null!==
a&&a.apply(this,arguments)||this}b(c,a);return c}(a.seriesTypes.candlestick.prototype.pointClass)});e(a,"Series/HeikinAshi/HeikinAshiSeriesDefaults.js",[],function(){"";return{dataGrouping:{groupAll:!0}}});e(a,"Series/HeikinAshi/HeikinAshiSeries.js",[a["Series/HeikinAshi/HeikinAshiPoint.js"],a["Series/HeikinAshi/HeikinAshiSeriesDefaults.js"],a["Core/Series/SeriesRegistry.js"],a["Core/Utilities.js"]],function(a,b,e,c){function g(){this.series.forEach(function(a){a.is("heikinashi")&&(a.heikiashiData.length=
0,a.getHeikinashiData())})}function n(){for(var a=this.points,c=this.heikiashiData,d=this.cropStart||0,h=this.processedYData.length=0;h<a.length;h++){var f=a[h],b=c[h+d];f.open=b[0];f.high=b[1];f.low=b[2];f.close=b[3];this.processedYData.push([f.open,f.high,f.low,f.close])}}function p(){this.heikiashiData.length&&(this.heikiashiData.length=0)}var q=this&&this.__extends||function(){var a=function(b,d){a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,d){a.__proto__=d}||function(a,
d){for(var b in d)d.hasOwnProperty(b)&&(a[b]=d[b])};return a(b,d)};return function(b,d){function c(){this.constructor=b}a(b,d);b.prototype=null===d?Object.create(d):(c.prototype=d.prototype,new c)}}(),l=e.seriesTypes.candlestick,m=c.addEvent,r=c.merge,k=[];c=function(a){function c(){var d=null!==a&&a.apply(this,arguments)||this;d.data=void 0;d.heikiashiData=[];d.options=void 0;d.points=void 0;d.yData=void 0;d.processedYData=void 0;return d}q(c,a);c.compose=function(a,b){for(var d=2;d<arguments.length;d++);
l.compose(a);-1===k.indexOf(b)&&(k.push(b),m(b,"postProcessData",g));-1===k.indexOf(c)&&(k.push(c),m(c,"afterTranslate",n),m(c,"updatedData",p))};c.prototype.getHeikinashiData=function(){var a=this.allGroupedData||this.yData,c=this.heikiashiData;if(!c.length&&a&&a.length){this.modifyFirstPointValue(a[0]);for(var b=1;b<a.length;b++)this.modifyDataPoint(a[b],c[b-1])}this.heikiashiData=c};c.prototype.init=function(){a.prototype.init.apply(this,arguments);this.heikiashiData=[]};c.prototype.modifyFirstPointValue=
function(a){this.heikiashiData.push([(a[0]+a[1]+a[2]+a[3])/4,a[1],a[2],(a[0]+a[3])/2])};c.prototype.modifyDataPoint=function(a,b){b=(b[0]+b[3])/2;var c=(a[0]+a[1]+a[2]+a[3])/4;this.heikiashiData.push([b,Math.max(a[1],c,b),Math.min(a[2],c,b),c])};c.defaultOptions=r(l.defaultOptions,b);return c}(l);c.prototype.pointClass=a;e.registerSeriesType("heikinashi",c);return c});e(a,"masters/modules/heikinashi.src.js",[a["Core/Globals.js"],a["Series/HeikinAshi/HeikinAshiSeries.js"]],function(a,b){b.compose(a.Series,
a.Axis)})});
//# sourceMappingURL=heikinashi.js.map