https://www.rea-group.com/wp-content/themes/reagroup/static/dist/js/chunks/pie-chart.c0a694aa.min.js
1"use strict";(self.webpackChunkreagroup=self.webpackChunkreagroup||[]).push([[280],{8416(t,i,e){e.r(i),e(5773);class s extends HTMLElement{constructor(t){return super(t)}static get is(){return"pie-chart"}get values(){return this.hasAttribute("values")?JSON.parse(this.getAttribute("values")):[]}set values(t){this.setAttribute("values",JSON.parse(t))}get width(){return this.hasAttribute("width")?parseFloat(this.getAttribute("width")):550}set width(t){this.setAttribute("width",parseInt(t))}get thickness(){return this.hasAttribute("thickness")?parseFloat(this.getAttribute("thickness")):this.width/5}set thickness(t){this.setAttribute("thickness",parseInt(t))}get strokeWidth(){return this.hasAttribute("strokeWidth")?this.getAttribute("strokeWidth"):"1%"}set strokeWidth(t){this.setAttribute("strokeWidth",t)}get padding(){return this.hasAttribute("padding")?parseInt(this.getAttribute("padding")):30}set padding(t){this.setAttribute("padding",parseInt(t))}get animationDuration(){return this.hasAttribute("animationDuration")?parseInt(this.getAttribute("animationDuration")):500}get animationDelay(){return this.hasAttribute("animationDelay")?parseInt(this.getAttribute("animationDelay")):300}connectedCallback(){if(this._created)return;if(this._created=!0,this._origin={x:this.width/2,y:this.width/2},!this.values)return!1;this._percentages=this.values.map(t=>parseFloat(t.stat_percentage)),this._container=Snap(this);const t=Snap(this.width,this.width).attr({viewBox:`0 0 ${this.width} ${this.width}`});this._arcs=[],this.values.forEach((i,e)=>{this._arcs[e]=t.path(this.createSegment(this._origin.x,this._origin.y,this.width/2-this.padding,this.thickness,0,3.6*parseFloat(i.stat_percentage))).attr({fill:`${i.stat_color}`,stroke:"#FFF",strokeWidth:this.strokeWidth,opacity:0})}),this._container.add(t),this.hasAttribute("data-aos")||this.animate()}createSegment(t,i,e,s,a,r){const h=this._polarToCartesian(t,i,e,r),n=this._polarToCartesian(t,i,e,a),o=this._polarToCartesian(t,i,e-s,a),u=this._polarToCartesian(t,i,e-s,r),c=r-a<=180?"0":"1";return["M",h.x,h.y,"A",e,e,0,c,0,n.x,n.y,"L",o.x,o.y,"A",e-s,e-s,0,c,1,u.x,u.y,"L",h.x,h.y,"z"].join(" ")}sumArr(t){return t.reduce((t,i)=>parseFloat(t)+parseFloat(i),0)}_polarToCartesian(t,i,e,s){var a=(s-90)*Math.PI/180;return{x:t+e*Math.cos(a),y:i+e*Math.sin(a)}}animate(){const t=this._percentages.map((t,i)=>3.6*(100-this.sumArr(this._percentages.slice(0,i+1))));this._arcs.forEach((i,e)=>{setTimeout(()=>{var s=`r${t[e]},${this._origin.x},${this._origin.y}`;i.animate({opacity:1},this.animationDuration).animate({transform:s},this.animationDuration,mina.bounce)},this.animationDelay*e)})}}customElements.define(s.is,s)}}]); 2//# sourceMappingURL=pie-chart.c0a694aa.min.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.