1var w=Object.defineProperty;var x=(s,r,e)=>r in s?w(s,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[r]=e;var f=(s,r,e)=>x(s,typeof r!="symbol"?r+"":r,e);import{C as S}from"./main-scipts-CJTdcIum.js";import{d as y}from"./dependencies-DAqhMBIg.js";class M extends S{constructor(e){super(e);f(this,"pendingCharts",[]);f(this,"resizeTimer");f(this,"hasChartsSrc",!1);f(this,"onScroll",()=>{this.pendingCharts=this.pendingCharts.filter(e=>window.Theme.isOutOfViewport(e).bottom?!0:(this.renderDoughnut(e),!1)),this.pendingCharts.length===0&&document.removeEventListener("scroll",this.onScroll)});this.pendingCharts=Array.from(e.querySelectorAll(".chart")),this.pendingCharts.length>0&&document.addEventListener("scroll",this.onScroll,window.Theme.passiveSupported()?{passive:!0}:!1)}resizeGraph(e){window.clearTimeout(this.resizeTimer),this.resizeTimer=window.setTimeout(()=>{e.render()},250)}renderDoughnut(e){const i=window.Chart;if(!i){this.hasChartsSrc||y.dynamicLoadByName("charts",()=>{this.hasChartsSrc=!0,this.renderDoughnut(e)});return}const n=e instanceof HTMLCanvasElement?e:e.querySelector("canvas");if(!(n instanceof HTMLCanvasElement))return;const a=n.getAttribute("data-values");if(!a)return;const d=JSON.parse(a),c=n.dataset.centerText??"",h=n.dataset.color??"#000000",l=[],p=[],g=[],C=[];d.forEach(t=>{l.push(t.data_value),p.push(t.data_label);let o=t.data_color,u=t.data_color;t.data_color==="#fff200"||t.data_color==="#eeee22"?(o=this.lightenDarkenColor(t.data_color,20),u=t.data_color):t.data_color!=="#000000"&&(u=this.lightenDarkenColor(t.data_color,20)),g.push(o),C.push(u)});const v={type:"doughnut",data:{labels:p,datasets:[{data:l,backgroundColor:g,hoverBackgroundColor:C,borderWidth:0}]},options:{cutoutPercentage:65,legend:{display:!1},animation:{duration:0},hover:{animationDuration:0},responsiveAnimationDuration:0,elements:{center:{text:c,color:h,fontStyle:"wwf",sidePadding:20}},onResize:t=>this.resizeGraph(t),tooltips:{callbacks:{label:(t,o)=>o.labels[t.index],title:(t,o)=>o.labels[t[0].index]},displayColors:!1,cornerRadius:0,bodyFontSize:18}},plugins:[{beforeInit:t=>{t.config.data.labels.forEach((o,u,b)=>{typeof o=="string"&&o.includes(" || ")&&(b[u]=o.split(" || "))})}}]},m=n.getContext("2d");m&&new i(m,v)}lightenDarkenColor(e,i){if(e==="#000000")return e;let n=!1,a=e;a[0]==="#"&&(a=a.slice(1),n=!0);const d=Number.parseInt(a,16);let c=(d>>16)+i;c=Math.max(0,Math.min(255,c));let h=(d>>8&255)+i;h=Math.max(0,Math.min(255,h));let l=(d&255)+i;return l=Math.max(0,Math.min(255,l)),`${n?"#":""}${(l|h<<8|c<<16).toString(16)}`}}export{M as default};
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.