YUI.add("series-stacked",function(t,e){var f=t.Lang;function s(){}s.prototype={_stacked:!0,_stackCoordinates:function(){"vertical"===this.get("direction")?this._stackXCoords():this._stackYCoords()},_stackXCoords:function(){for(var t,e,s,o,i,r=this.get("order"),a=this.get("seriesTypeCollection"),d=0,c=this.get("xcoords"),n=this.get("ycoords"),h=c.concat(),g=[],l=0<r?(o=a[r-1].get("stackedXCoords"),a[r-1].get("stackedYCoords"),o.length):c.length;d<l;d+=1)if(f.isNumber(c[d])){if(0<r){if(e=o[d],!f.isNumber(e))for(s=r;-1<s&&!f.isNumber(e);)e=-1<(s-=1)?a[s].get("stackedXCoords")[d]:this._leftOrigin;c[d]=c[d]+e}h[d]=c[d]}else g.push(d);if(this._cleanXNaN(h,n),0<(l=g.length))for(d=0;d<l;d+=1)i=g[d],t=0<r?o[i]:this._leftOrigin,h[i]=Math.max(h[i],t);this.set("stackedXCoords",h),this.set("stackedYCoords",n)},_stackYCoords:function(){for(var t,e,s,o,i,r=this.get("order"),a=this.get("graphic").get("height"),d=this.get("seriesTypeCollection"),c=0,n=this.get("xcoords"),h=this.get("ycoords"),g=h.concat(),l=[],u=0<r?(d[r-1].get("stackedXCoords"),(o=d[r-1].get("stackedYCoords")).length):h.length;c<u;c+=1)if(f.isNumber(h[c])){if(0<r){if(e=o[c],!f.isNumber(e))for(s=r;-1<s&&!f.isNumber(e);)e=-1<(s-=1)?d[s].get("stackedYCoords")[c]:this._bottomOrigin;h[c]=e-(a-h[c])}g[c]=h[c]}else l.push(c);if(this._cleanYNaN(n,g),0<(u=l.length))for(c=0;c<u;c+=1)i=l[c],t=0<r?o[i]:a,g[i]=Math.min(g[i],t);this.set("stackedXCoords",n),this.set("stackedYCoords",g)},_cleanXNaN:function(t,e){for(var s,o,i,r,a,d=f.isNumber,c=0,n=e.length;c<n;++c)o=t[c],a=e[c],!d(o)&&0<c&&c<n-1&&(o=e[c-1],s=this._getPreviousValidCoordValue(t,c),r=e[c+1],i=this._getNextValidCoordValue(t,c),d(s)&&d(i)&&(t[c]=(a+(a=(r-o)/(i-s))*s-o)/a),NaN)},_getPreviousValidCoordValue:function(t,e){for(var s,o=f.isNumber;!o(s)&&-1<e;)s=t[e-=1];return s},_getNextValidCoordValue:function(t,e){for(var s,o=f.isNumber,i=t.length;!o(s)&&e<i;)s=t[e+=1];return s},_cleanYNaN:function(t,e){for(var s,o,i,r,a,d=f.isNumber,c=0,n=t.length;c<n;++c)i=t[c],!d(e[c])&&0<c&&c<n-1&&(s=t[c-1],o=this._getPreviousValidCoordValue(e,c),r=t[c+1],a=this._getNextValidCoordValue(e,c),d(o)&&d(a)&&(e[c]=o+((a=(a-o)/(r-s))*i-a*s)),NaN)}},t.StackingUtil=s},"patched-v3.18.4",{requires:["axis-stacked"]});