import BaseSeries from"../../Core/Series/Series.js";import ReduceArrayMixin from"../../Mixins/ReduceArray.js";var getArrayExtremes=ReduceArrayMixin.getArrayExtremes;import U from"../../Core/Utilities.js";var isArray=U.isArray;BaseSeries.seriesType("williamsr","sma",{params:{period:14}},{nameBase:"Williams %R",getValues:function(r,e){var a,s,i,t,m,o,y=e.period,l=r.xData,n=r.yData,p=n?n.length:0,u=[],A=[],x=[];if(!(l.length<y)&&isArray(n[0])&&4===n[0].length){for(o=y-1;o<p;o++)a=n.slice(o-y+1,o+1),m=(s=getArrayExtremes(a,2,1))[0],i=((t=s[1])-n[o][3])/(t-m)*-100,l[o]&&(u.push([l[o],i]),A.push(l[o]),x.push(i));return{values:u,xData:A,yData:x}}}});