File: /var/www/quadcode/frontend/node_modules/highcharts/es5/indicators/pivot-points.js
/*
Highstock JS v10.3.3 (2023-01-20)
Indicator series type for Highcharts Stock
(c) 2010-2021 Pawe Fus
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/indicators/pivot-points",["highcharts","highcharts/modules/stock"],function(k){a(k);a.Highcharts=k;return a}):a("undefined"!==typeof Highcharts?Highcharts:void 0)})(function(a){function k(a,f,d,g){a.hasOwnProperty(f)||(a[f]=g.apply(null,d),"function"===typeof CustomEvent&&window.dispatchEvent(new CustomEvent("HighchartsModuleLoaded",{detail:{path:f,module:a[f]}})))}
a=a?a._modules:{};k(a,"Stock/Indicators/PivotPoints/PivotPointsPoint.js",[a["Core/Series/SeriesRegistry.js"]],function(a){function f(g,c){var e=g.series.pointArrayMap,f=e.length;for(a.seriesTypes.sma.prototype.pointClass.prototype[c].call(g);f--;)c="dataLabel"+e[f],g[c]&&g[c].element&&g[c].destroy(),g[c]=null}var d=this&&this.__extends||function(){var a=function(c,e){a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,c){a.__proto__=c}||function(a,c){for(var e in c)Object.prototype.hasOwnProperty.call(c,
e)&&(a[e]=c[e])};return a(c,e)};return function(c,e){function f(){this.constructor=c}if("function"!==typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");a(c,e);c.prototype=null===e?Object.create(e):(f.prototype=e.prototype,new f)}}();return function(a){function c(){var c=null!==a&&a.apply(this,arguments)||this;c.P=void 0;c.pivotLine=void 0;c.series=void 0;return c}d(c,a);c.prototype.destroyElements=function(){f(this,"destroyElements")};c.prototype.destroy=
function(){f(this,"destroyElements")};return c}(a.seriesTypes.sma.prototype.pointClass)});k(a,"Stock/Indicators/PivotPoints/PivotPointsIndicator.js",[a["Stock/Indicators/PivotPoints/PivotPointsPoint.js"],a["Core/Series/SeriesRegistry.js"],a["Core/Utilities.js"]],function(a,f,d){var g=this&&this.__extends||function(){var a=function(c,b){a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,a){b.__proto__=a}||function(b,a){for(var h in a)Object.prototype.hasOwnProperty.call(a,h)&&(b[h]=
a[h])};return a(c,b)};return function(c,b){function h(){this.constructor=c}if("function"!==typeof b&&null!==b)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");a(c,b);c.prototype=null===b?Object.create(b):(h.prototype=b.prototype,new h)}}(),c=f.seriesTypes.sma,e=d.merge,k=d.extend,n=d.defined,t=d.isArray;d=function(a){function d(){var b=null!==a&&a.apply(this,arguments)||this;b.data=void 0;b.options=void 0;b.points=void 0;b.endPoint=void 0;b.plotEndPoint=void 0;
return b}g(d,a);d.prototype.toYData=function(b){return[b.P]};d.prototype.translate=function(){var b=this;f.seriesTypes.sma.prototype.translate.apply(b);b.points.forEach(function(a){b.pointArrayMap.forEach(function(h){n(a[h])&&(a["plot"+h]=b.yAxis.toPixels(a[h],!0))})});b.plotEndPoint=b.xAxis.toPixels(b.endPoint,!0)};d.prototype.getGraphPath=function(b){for(var a=this,c=b.length,d=[[],[],[],[],[],[],[],[],[]],e=[],g=a.plotEndPoint,u=a.pointArrayMap.length,p,l,m;c--;){l=b[c];for(m=0;m<u;m++)p=a.pointArrayMap[m],
n(l[p])&&d[m].push({plotX:l.plotX,plotY:l["plot"+p],isNull:!1},{plotX:g,plotY:l["plot"+p],isNull:!1},{plotX:g,plotY:null,isNull:!0});g=l.plotX}d.forEach(function(b){e=e.concat(f.seriesTypes.sma.prototype.getGraphPath.call(a,b))});return e};d.prototype.drawDataLabels=function(){var b=this,a=b.pointArrayMap,c,d,e;if(b.options.dataLabels.enabled){var g=b.points.length;a.concat([!1]).forEach(function(h,q){for(e=g;e--;)d=b.points[e],h?(d.y=d[h],d.pivotLine=h,d.plotY=d["plot"+h],c=d["dataLabel"+h],q&&(d["dataLabel"+
a[q-1]]=d.dataLabel),d.dataLabels||(d.dataLabels=[]),d.dataLabels[0]=d.dataLabel=c=c&&c.element?c:null):d["dataLabel"+a[q-1]]=d.dataLabel;f.seriesTypes.sma.prototype.drawDataLabels.call(b)})}};d.prototype.getValues=function(b,a){var c=a.period,d=b.xData,h=(b=b.yData)?b.length:0;a=this[a.algorithm+"Placement"];var e=[],f=[],g=[],l;if(!(d.length<c)&&t(b[0])&&4===b[0].length){for(l=c+1;l<=h+c;l+=c){var m=d.slice(l-c-1,l);var k=b.slice(l-c-1,l);var n=m.length;var r=m[n-1];k=this.getPivotAndHLC(k);k=a(k);
k=e.push([r].concat(k));f.push(r);g.push(e[k-1].slice(1))}this.endPoint=m[0]+(r-m[0])/n*c;return{values:e,xData:f,yData:g}}};d.prototype.getPivotAndHLC=function(b){var a=-Infinity,c=Infinity,d=b[b.length-1][3];b.forEach(function(b){a=Math.max(a,b[1]);c=Math.min(c,b[2])});return[(a+c+d)/3,a,c,d]};d.prototype.standardPlacement=function(b){var a=b[1]-b[2];return[null,null,b[0]+a,2*b[0]-b[2],b[0],2*b[0]-b[1],b[0]-a,null,null]};d.prototype.camarillaPlacement=function(b){var a=b[1]-b[2];return[b[3]+1.5*
a,b[3]+1.25*a,b[3]+1.1666*a,b[3]+1.0833*a,b[0],b[3]-1.0833*a,b[3]-1.1666*a,b[3]-1.25*a,b[3]-1.5*a]};d.prototype.fibonacciPlacement=function(a){var b=a[1]-a[2];return[null,a[0]+b,a[0]+.618*b,a[0]+.382*b,a[0],a[0]-.382*b,a[0]-.618*b,a[0]-b,null]};d.defaultOptions=e(c.defaultOptions,{params:{index:void 0,period:28,algorithm:"standard"},marker:{enabled:!1},enableMouseTracking:!1,dataLabels:{enabled:!0,format:"{point.pivotLine}"},dataGrouping:{approximation:"averages"}});return d}(c);k(d.prototype,{nameBase:"Pivot Points",
pointArrayMap:"R4 R3 R2 R1 P S1 S2 S3 S4".split(" "),pointValKey:"P",pointClass:a});f.registerSeriesType("pivotpoints",d);"";return d});k(a,"masters/indicators/pivot-points.src.js",[],function(){})});
//# sourceMappingURL=pivot-points.js.map