PageSourceSearch

https://wordy.education/assets/StatsView-BjhLuM4A.js

js wordy.education collected 2026-10-02 01:52:54 UTC 48,321 bytes, 6 lines download raw bytes

1import{d as Sn,e as rt,E as xn,O as Tn,r as Pe,k as J,H as Cn,K as vn,J as kn,l as st,q as it,o as at,n as se,t as D,w as O,U as lt,V as Mn,W as ie,v as dt,x as j,S as ct,X as _e,Y as Dn,_ as In}from"./index-8jHllbXX.js";import{L as ut,D as ft}from"./index-Dkr-HQf1.js";import{i as Z,a as ee,C as pe,E as K,t as Y,d as We,b as z,c as Se,P as E,e as An,u as Pn,f as Q,R as zt,g as _n,h as On,D as En,A as Rn,v as ue,j as Ht,k as Xe,Q as ae,H as ye,T as ht,l as Yt,m as Nn,n as gt,o as Oe,p as bt,q as Ln,r as jn,s as zn,w as Hn,L as Yn,x as Wn,y as Xn,z as $n,B as Bn,F as Un}from"./chart-B31RG-90.js";import{f as yt,a as pt}from"./dateFormatService-DtKzJl89.js";import{u as Vn}from"./numberFormatService-CRWbEL2X.js";/*!
2* chartjs-plugin-annotation v3.1.0
3* https://www.chartjs.org/chartjs-plugin-annotation/index
4 * (c) 2024 chartjs-plugin-annotation Contributors
5 * Released under the MIT License
6 */const mt={modes:{point(t,e){return me(t,e,{intersect:!0})},nearest(t,e,n){return Fn(t,e,n)},x(t,e,n){return me(t,e,{intersect:n.intersect,axis:"x"})},y(t,e,n){return me(t,e,{intersect:n.intersect,axis:"y"})}}};function $e(t,e,n){return(mt.modes[n.mode]||mt.modes.nearest)(t,e,n)}function Kn(t,e,n){return n!=="x"&&n!=="y"?t.inRange(e.x,e.y,"x",!0)||t.inRange(e.x,e.y,"y",!0):t.inRange(e.x,e.y,n,!0)}function Gn(t,e,n){return n==="x"?{x:t.x,y:e.y}:n==="y"?{x:e.x,y:t.y}:e}function me(t,e,n){return t.filter(o=>n.intersect?o.inRange(e.x,e.y):Kn(o,e,n.axis))}function Fn(t,e,n){let o=Number.POSITIVE_INFINITY;return me(t,e,n).reduce((r,s)=>{const i=s.getCenterPoint(),a=Gn(e,i,n.axis),l=We(e,a);return l<o?(r=[s],o=l):l===o&&r.push(s),r},[]).sort((r,s)=>r._index-s._index).slice(0,1)}function G(t,e,n){const o=Math.cos(n),r=Math.sin(n),s=e.x,i=e.y;return{x:s+o*(t.x-s)-r*(t.y-i),y:i+r*(t.x-s)+o*(t.y-i)}}const qn=(t,e)=>e>t||t.length>e.length&&t.slice(0,e.length)===e,U=.001,xe=(t,e,n)=>Math.min(n,Math.max(e,t)),Wt=(t,e)=>t.value>=t.start-e&&t.value<=t.end+e;function Jn(t,e,n){for(const o of Object.keys(t))t[o]=xe(t[o],e,n);return t}function Qn(t,e,n,o){return!t||!e||n<=0?!1:Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)<=Math.pow(n+o,2)}function Xt(t,{x:e,y:n,x2:o,y2:r},s,{borderWidth:i,hitTolerance:a}){const l=(i+a)/2,d=t.x>=e-l-U&&t.x<=o+l+U,c=t.y>=n-l-U&&t.y<=r+l+U;return s==="x"?d:(s==="y"||d)&&c}function $t(t,{rect:e,center:n},o,{rotation:r,borderWidth:s,hitTolerance:i}){const a=G(t,n,Y(-r));return Xt(a,e,o,{borderWidth:s,hitTolerance:i})}function F(t,e){const{centerX:n,centerY:o}=t.getProps(["centerX","centerY"],e);return{x:n,y:o}}function Zn(t,e,n,o=!0){const r=n.split(".");let s=0;for(const i of e.split(".")){const a=r[s++];if(parseInt(i,10)<parseInt(a,10))break;if(qn(a,i)){if(o)throw new Error(`${t} v${n} is not supported. v${e} or newer is required.`);return!1}}return!0}const Bt=t=>typeof t=="string"&&t.endsWith("%"),Ut=t=>parseFloat(t)/100,Vt=t=>xe(Ut(t),0,1),le=(t,e)=>({x:t,y:e,x2:t,y2:e,width:0,height:0}),eo={box:t=>le(t.centerX,t.centerY),doughnutLabel:t=>le(t.centerX,t.centerY),ellipse:t=>({centerX:t.centerX,centerY:t.centerX,radius:0,width:0,height:0}),label:t=>le(t.centerX,t.centerY),line:t=>le(t.x,t.y),point:t=>({centerX:t.centerX,centerY:t.centerY,radius:0,width:0,height:0}),polygon:t=>le(t.centerX,t.centerY)};function Be(t,e){return e==="start"?0:e==="end"?t:Bt(e)?Vt(e)*t:t/2}function $(t,e,n=!0){return typeof e=="number"?e:Bt(e)?(n?Vt(e):Ut(e))*t:t}function to(t,e){const{x:n,width:o}=t,r=e.textAlign;return r==="center"?n+o/2:r==="end"||r==="right"?n+o:n}function Kt(t,e,{borderWidth:n,position:o,xAdjust:r,yAdjust:s},i){const a=Z(i),l=e.width+(a?i.width:0)+n,d=e.height+(a?i.height:0)+n,c=Ue(o),u=wt(t.x,l,r,c.x),h=wt(t.y,d,s,c.y);return{x:u,y:h,x2:u+l,y2:h+d,width:l,height:d,centerX:u+l/2,centerY:h+d/2}}function Ue(t,e="center"){return Z(t)?{x:ue(t.x,e),y:ue(t.y,e)}:(t=ue(t,e),{x:t,y:t})}const Gt=(t,e)=>t&&t.autoFit&&e<1;function Ft(t,e){const n=t.font,o=ee(n)?n:[n];return Gt(t,e)?o.map(function(r){const s=Oe(r);return s.size=Math.floor(r.size*e),s.lineHeight=r.lineHeight,Oe(s)}):o.map(r=>Oe(r))}function qt(t){return t&&(z(t.xValue)||z(t.yValue))}function wt(t,e,n=0,o){return t-Be(e,o)+n}function ne(t,e,n){const o=n.init;if(o){if(o===!0)return Qt(e,n)}else return;return no(t,e,n)}function Jt(t,e,n){let o=!1;return e.forEach(r=>{Q(t[r])?(o=!0,n[r]=t[r]):z(n[r])&&delete n[r]}),o}function Qt(t,e){const n=e.type||"line";return eo[n](t)}function no(t,e,n){const o=Xe(n.init,[{chart:t,properties:e,options:n}]);if(o===!0)return Qt(e,n);if(Z(o))return o}const Ee=new Map,oo=t=>isNaN(t)||t<=0,ro=t=>t.reduce(function(e,n){return e+=n.string,e},"");function Te(t){if(t&&typeof t=="object"){const e=t.toString();return e==="[object HTMLImageElement]"||e==="[object HTMLCanvasElement]"}}function Ce(t,{x:e,y:n},o){o&&(t.translate(e,n),t.rotate(Y(o)),t.translate(-e,-n))}function H(t,e){if(e&&e.borderWidth)return t.lineCap=e.borderCapStyle||"butt",t.setLineDash(e.borderDash),t.lineDashOffset=e.borderDashOffset,t.lineJoin=e.borderJoinStyle||"miter",t.lineWidth=e.borderWidth,t.strokeStyle=e.borderColor,!0}function oe(t,e){t.shadowColor=e.backgroundShadowColor,t.shadowBlur=e.shadowBlur,t.shadowOffsetX=e.shadowOffsetX,t.shadowOffsetY=e.shadowOffsetY}function ve(t,e){const n=e.content;if(Te(n))return{width:$(n.width,e.width),height:$(n.height,e.height)};const o=Ft(e),r=e.textStrokeWidth,s=ee(n)?n:[n],i=s.join()+ro(o)+r+(t._measureText?"-spriting":"");return Ee.has(i)||Ee.set(i,lo(t,s,o,r)),Ee.get(i)}function Zt(t,e,n){const{x:o,y:r,width:s,height:i}=e;t.save(),oe(t,n);const a=H(t,n);t.fillStyle=n.backgroundColor,t.beginPath(),_n(t,{x:o,y:r,w:s,h:i,radius:Jn(On(n.borderRadius),0,Math.min(s,i)/2)}
6),t.closePath(),t.fill(),a&&(t.shadowColor=n.borderShadowColor,t.stroke()),t.restore()}function en(t,e,n,o){const r=n.content;if(Te(r)){t.save(),t.globalAlpha=fo(n.opacity,r.style.opacity),t.drawImage(r,e.x,e.y,e.width,e.height),t.restore();return}const s=ee(r)?r:[r],i=Ft(n,o),a=n.color,l=ee(a)?a:[a],d=to(e,n),c=e.y+n.textStrokeWidth/2;t.save(),t.textBaseline="middle",t.textAlign=n.textAlign,so(t,n)&&co(t,{x:d,y:c},s,i),uo(t,{x:d,y:c},s,{fonts:i,colors:l}),t.restore()}function so(t,e){if(e.textStrokeWidth>0)return t.lineJoin="round",t.miterLimit=2,t.lineWidth=e.textStrokeWidth,t.strokeStyle=e.textStrokeColor,!0}function io(t,e,n,o){const{radius:r,options:s}=e,i=s.pointStyle,a=s.rotation;let l=(a||0)*zt;if(Te(i)){t.save(),t.translate(n,o),t.rotate(l),t.drawImage(i,-i.width/2,-i.height/2,i.width,i.height),t.restore();return}oo(r)||ao(t,{x:n,y:o,radius:r,rotation:a,style:i,rad:l})}function ao(t,{x:e,y:n,radius:o,rotation:r,style:s,rad:i}){let a,l,d,c;switch(t.beginPath(),s){default:t.arc(e,n,o,0,Yt),t.closePath();break;case"triangle":t.moveTo(e+Math.sin(i)*o,n-Math.cos(i)*o),i+=ht,t.lineTo(e+Math.sin(i)*o,n-Math.cos(i)*o),i+=ht,t.lineTo(e+Math.sin(i)*o,n-Math.cos(i)*o),t.closePath();break;case"rectRounded":c=o*.516,d=o-c,a=Math.cos(i+ae)*d,l=Math.sin(i+ae)*d,t.arc(e-a,n-l,c,i-E,i-ye),t.arc(e+l,n-a,c,i-ye,i),t.arc(e+a,n+l,c,i,i+ye),t.arc(e-l,n+a,c,i+ye,i+E),t.closePath();break;case"rect":if(!r){d=Math.SQRT1_2*o,t.rect(e-d,n-d,2*d,2*d);break}i+=ae;case"rectRot":a=Math.cos(i)*o,l=Math.sin(i)*o,t.moveTo(e-a,n-l),t.lineTo(e+l,n-a),t.lineTo(e+a,n+l),t.lineTo(e-l,n+a),t.closePath();break;case"crossRot":i+=ae;case"cross":a=Math.cos(i)*o,l=Math.sin(i)*o,t.moveTo(e-a,n-l),t.lineTo(e+a,n+l),t.moveTo(e+l,n-a),t.lineTo(e-l,n+a);break;case"star":a=Math.cos(i)*o,l=Math.sin(i)*o,t.moveTo(e-a,n-l),t.lineTo(e+a,n+l),t.moveTo(e+l,n-a),t.lineTo(e-l,n+a),i+=ae,a=Math.cos(i)*o,l=Math.sin(i)*o,t.moveTo(e-a,n-l),t.lineTo(e+a,n+l),t.moveTo(e+l,n-a),t.lineTo(e-l,n+a);break;case"line":a=Math.cos(i)*o,l=Math.sin(i)*o,t.moveTo(e-a,n-l),t.lineTo(e+a,n+l);break;case"dash":t.moveTo(e,n),t.lineTo(e+Math.cos(i)*o,n+Math.sin(i)*o);break}t.fill()}function lo(t,e,n,o){t.save();const r=e.length;let s=0,i=o;for(let a=0;a<r;a++){const l=n[Math.min(a,n.length-1)];t.font=l.string;const d=e[a];s=Math.max(s,t.measureText(d).width+o),i+=l.lineHeight}return t.restore(),{width:s,height:i}}function co(t,{x:e,y:n},o,r){t.beginPath();let s=0;o.forEach(function(i,a){const l=r[Math.min(a,r.length-1)],d=l.lineHeight;t.font=l.string,t.strokeText(i,e,n+d/2+s),s+=d}),t.stroke()}function uo(t,{x:e,y:n},o,{fonts:r,colors:s}){let i=0;o.forEach(function(a,l){const d=s[Math.min(l,s.length-1)],c=r[Math.min(l,r.length-1)],u=c.lineHeight;t.beginPath(),t.font=c.string,t.fillStyle=d,t.fillText(a,e,n+u/2+i),i+=u,t.fill()})}function fo(t,e){const n=gt(t)?t:e;return gt(n)?xe(n,0,1):1}const tn=["left","bottom","top","right"];function ho(t,e){const{pointX:n,pointY:o,options:r}=e,s=r.callout,i=s&&s.display&&mo(e,s);if(!i||So(e,s,i))return;if(t.save(),t.beginPath(),!H(t,s))return t.restore();const{separatorStart:l,separatorEnd:d}=go(e,i),{sideStart:c,sideEnd:u}=yo(e,i,l);(s.margin>0||r.borderWidth===0)&&(t.moveTo(l.x,l.y),t.lineTo(d.x,d.y)),t.moveTo(c.x,c.y),t.lineTo(u.x,u.y);const h=G({x:n,y:o},e.getCenterPoint(),Y(-e.rotation));t.lineTo(h.x,h.y),t.stroke(),t.restore()}function go(t,e){const{x:n,y:o,x2:r,y2:s}=t,i=bo(t,e);let a,l;return e==="left"||e==="right"?(a={x:n+i,y:o},l={x:a.x,y:s}):(a={x:n,y:o+i},l={x:r,y:a.y}),{separatorStart:a,separatorEnd:l}}function bo(t,e){const{width:n,height:o,options:r}=t,s=r.callout.margin+r.borderWidth/2;return e==="right"?n+s:e==="bottom"?o+s:-s}function yo(t,e,n){const{y:o,width:r,height:s,options:i}=t,a=i.callout.start,l=po(e,i.callout);let d,c;return e==="left"||e==="right"?(d={x:n.x,y:o+$(s,a)},c={x:d.x+l,y:d.y}):(d={x:n.x+$(r,a),y:n.y},c={x:d.x,y:d.y+l}),{sideStart:d,sideEnd:c}}function po(t,e){const n=e.side;return t==="left"||t==="top"?-n:n}function mo(t,e){const n=e.position;return tn.includes(n)?n:wo(t,e)}function wo(t,e){const{x:n,y:o,x2:r,y2:s,width:i,height:a,pointX:l,pointY:d,centerX:c,centerY:u,rotation:h}=t,x={x:c,y:u},C=e.start,A=$(i,C),R=$(a,C),P=[n,n+A,n+A,r],_=[o+R,s,o,s],N=[];for(let L=0;L<4;L++){const q=G({x:P[L],y:_[L]},x,Y(h));N.push({position:tn[L],distance:We(q,{x:l,y:d})})}return N.sort((L,q)=>L.distance-q.distance)[0].position}function So(t,e,n){const{pointX:o,pointY:r}=t,s=e.margin;let i=o,a=r;return n==="left"?i+=s:n==="right"?i-=s:n==="top"?a+=s:n==="bottom"&&(a-=s),t.inRange(i,a)}const St={xScaleID:{min:"xMin",max:"xMax",start:"left",end:"right",startProp:"x",endProp:"x2"},yScaleID:{min:"yMin",max:"yMax",start:"bottom",end:"top",startProp:"y",endProp:"y2"}};function te(t,e,n){return e=typeof e=="number"?e:t.parse(e),Ht(e)?t.getPixelForValue(e):n}function V(t,e,n){const o=e[n];if(o||n==="scaleID")return o;const r=n.charAt(0),s=Object.values(t).filter(i=>i.axis&&i.axis===r);return s.length?s[0].id:r}
6function nn(t,e){if(t){const n=t.options.reverse,o=te(t,e.min,n?e.end:e.start),r=te(t,e.max,n?e.start:e.end);return{start:o,end:r}}}function on(t,e){const{chartArea:n,scales:o}=t,r=o[V(o,e,"xScaleID")],s=o[V(o,e,"yScaleID")];let i=n.width/2,a=n.height/2;return r&&(i=te(r,e.xValue,r.left+r.width/2)),s&&(a=te(s,e.yValue,s.top+s.height/2)),{x:i,y:a}}function Ve(t,e){const n=t.scales,o=n[V(n,e,"xScaleID")],r=n[V(n,e,"yScaleID")];if(!o&&!r)return{};let{left:s,right:i}=o||t.chartArea,{top:a,bottom:l}=r||t.chartArea;const d=xt(o,{min:e.xMin,max:e.xMax,start:s,end:i});s=d.start,i=d.end;const c=xt(r,{min:e.yMin,max:e.yMax,start:l,end:a});return a=c.start,l=c.end,{x:s,y:a,x2:i,y2:l,width:i-s,height:l-a,centerX:s+(i-s)/2,centerY:a+(l-a)/2}}function rn(t,e){if(!qt(e)){const n=Ve(t,e);let o=e.radius;(!o||isNaN(o))&&(o=Math.min(n.width,n.height)/2,e.radius=o);const r=o*2,s=n.centerX+e.xAdjust,i=n.centerY+e.yAdjust;return{x:s-o,y:i-o,x2:s+o,y2:i+o,centerX:s,centerY:i,width:r,height:r,radius:o}}return To(t,e)}function xo(t,e){const{scales:n,chartArea:o}=t,r=n[e.scaleID],s={x:o.left,y:o.top,x2:o.right,y2:o.bottom};return r?Co(r,s,e):vo(n,s,e),s}function sn(t,e){const n=Ve(t,e);return n.initProperties=ne(t,n,e),n.elements=[{type:"label",optionScope:"label",properties:Do(t,n,e),initProperties:n.initProperties}],n}function To(t,e){const n=on(t,e),o=e.radius*2;return{x:n.x-e.radius+e.xAdjust,y:n.y-e.radius+e.yAdjust,x2:n.x+e.radius+e.xAdjust,y2:n.y+e.radius+e.yAdjust,centerX:n.x+e.xAdjust,centerY:n.y+e.yAdjust,radius:e.radius,width:o,height:o}}function xt(t,e){const n=nn(t,e)||e;return{start:Math.min(n.start,n.end),end:Math.max(n.start,n.end)}}function Co(t,e,n){const o=te(t,n.value,NaN),r=te(t,n.endValue,o);t.isHorizontal()?(e.x=o,e.x2=r):(e.y=o,e.y2=r)}function vo(t,e,n){for(const o of Object.keys(St)){const r=t[V(t,n,o)];if(r){const{min:s,max:i,start:a,end:l,startProp:d,endProp:c}=St[o],u=nn(r,{min:n[s],max:n[i],start:r[a],end:r[l]});e[d]=u.start,e[c]=u.end}}}function ko({properties:t,options:e},n,o,r){const{x:s,x2:i,width:a}=t;return an({start:s,end:i,borderWidth:e.borderWidth},{position:o.x,padding:{start:r.left,end:r.right},adjust:e.label.xAdjust,size:n.width})}function Mo({properties:t,options:e},n,o,r){const{y:s,y2:i,height:a}=t;return an({start:s,end:i,borderWidth:e.borderWidth},{position:o.y,padding:{start:r.top,end:r.bottom},adjust:e.label.yAdjust,size:n.height})}function an(t,e){const{start:n,end:o,borderWidth:r}=t,{position:s,padding:{start:i,end:a},adjust:l}=e,d=o-r-n-i-a-e.size;return n+r/2+l+Be(d,s)}function Do(t,e,n){const o=n.label;o.backgroundColor="transparent",o.callout.display=!1;const r=Ue(o.position),s=Se(o.padding),i=ve(t.ctx,o),a=ko({properties:e,options:n},i,r,s),l=Mo({properties:e,options:n},i,r,s),d=i.width+s.width,c=i.height+s.height;return{x:a,y:l,x2:a+d,y2:l+c,width:d,height:c,centerX:a+d/2,centerY:l+c/2,rotation:o.rotation}}const Re=["enter","leave"],Ke=Re.concat("click");function Io(t,e,n){e.listened=Jt(n,Ke,e.listeners),e.moveListened=!1,Re.forEach(o=>{Q(n[o])&&(e.moveListened=!0)}),(!e.listened||!e.moveListened)&&e.annotations.forEach(o=>{!e.listened&&Q(o.click)&&(e.listened=!0),e.moveListened||Re.forEach(r=>{Q(o[r])&&(e.listened=!0,e.moveListened=!0)})})}function Ao(t,e,n){if(t.listened)switch(e.type){case"mousemove":case"mouseout":return Po(t,e,n);case"click":return _o(t,e,n)}}function Po(t,e,n){if(!t.moveListened)return;let o;e.type==="mousemove"?o=$e(t.visibleElements,e,n.interaction):o=[];const r=t.hovered;t.hovered=o;const s={state:t,event:e};let i=Tt(s,"leave",r,o);return Tt(s,"enter",o,r)||i}function Tt({state:t,event:e},n,o,r){let s;for(const i of o)r.indexOf(i)<0&&(s=ln(i.options[n]||t.listeners[n],i,e)||s);return s}
6function _o(t,e,n){const o=t.listeners,r=$e(t.visibleElements,e,n.interaction);let s;for(const i of r)s=ln(i.options.click||o.click,i,e)||s;return s}function ln(t,e,n){return Xe(t,[e.$context,n])===!0}const we=["afterDraw","beforeDraw"];function Oo(t,e,n){const o=e.visibleElements;e.hooked=Jt(n,we,e.hooks),e.hooked||o.forEach(r=>{e.hooked||we.forEach(s=>{Q(r.options[s])&&(e.hooked=!0)})})}function Ct(t,e,n){if(t.hooked){const o=e.options[n]||t.hooks[n];return Xe(o,[e.$context])}}function Eo(t,e,n){const o=zo(t.scales,e,n);let r=vt(e,o,"min","suggestedMin");r=vt(e,o,"max","suggestedMax")||r,r&&Q(e.handleTickRangeOptions)&&e.handleTickRangeOptions()}function Ro(t,e){for(const n of t)Lo(n,e)}function vt(t,e,n,o){if(Ht(e[n])&&!No(t.options,n,o)){const r=t[n]!==e[n];return t[n]=e[n],r}}function No(t,e,n){return z(t[e])||z(t[n])}function Lo(t,e){for(const n of["scaleID","xScaleID","yScaleID"]){const o=V(e,t,n);o&&!e[o]&&jo(t,n)&&console.warn(`No scale found with id '${o}' for annotation '${t.id}'`)}}function jo(t,e){if(e==="scaleID")return!0;const n=e.charAt(0);for(const o of["Min","Max","Value"])if(z(t[n+o]))return!0;return!1}function zo(t,e,n){const o=e.axis,r=e.id,s=o+"ScaleID",i={min:ue(e.min,Number.NEGATIVE_INFINITY),max:ue(e.max,Number.POSITIVE_INFINITY)};for(const a of n)a.scaleID===r?kt(a,e,["value","endValue"],i):V(t,a,s)===r&&kt(a,e,[o+"Min",o+"Max",o+"Value"],i);return i}function kt(t,e,n,o){for(const r of n){const s=t[r];if(z(s)){const i=e.parse(s);o.min=Math.min(o.min,i),o.max=Math.max(o.max,i)}}}class re extends K{inRange(e,n,o,r){const{x:s,y:i}=G({x:e,y:n},this.getCenterPoint(r),Y(-this.options.rotation));return Xt({x:s,y:i},this.getProps(["x","y","x2","y2"],r),o,this.options)}getCenterPoint(e){return F(this,e)}draw(e){e.save(),Ce(e,this.getCenterPoint(),this.options.rotation),Zt(e,this,this.options),e.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(e,n){return sn(e,n)}}re.id="boxAnnotation";re.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 0,hitTolerance:0,label:{backgroundColor:"transparent",borderWidth:0,callout:{display:!1},color:"black",content:null,display:!1,drawTime:void 0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:"bold"},height:void 0,hitTolerance:void 0,opacity:void 0,padding:6,position:"center",rotation:void 0,textAlign:"start",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0,z:void 0},rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0};re.defaultRoutes={borderColor:"color",backgroundColor:"color"};re.descriptors={label:{_fallback:!0}};class ke extends K{inRange(e,n,o,r){return $t({x:e,y:n},{rect:this.getProps(["x","y","x2","y2"],r),center:this.getCenterPoint(r)},o,{rotation:this.rotation,borderWidth:0,hitTolerance:this.options.hitTolerance})}getCenterPoint(e){return F(this,e)}draw(e){const n=this.options;!n.display||!n.content||(Bo(e,this),e.save(),Ce(e,this.getCenterPoint(),this.rotation),en(e,this,n,this._fitRatio),e.restore())}resolveElementProperties(e,n){const o=Ho(e,n);if(!o)return{};const{controllerMeta:r,point:s,radius:i}=Wo(e,n,o);let a=ve(e.ctx,n);const l=Xo(a,i);Gt(n,l)&&(a={width:a.width*l,height:a.height*l});const{position:d,xAdjust:c,yAdjust:u}=n,h=Kt(s,a,{borderWidth:0,position:d,xAdjust:c,yAdjust:u});return{initProperties:ne(e,h,n),...h,...r,rotation:n.rotation,_fitRatio:l}}}ke.id="doughnutLabelAnnotation";ke.defaults={autoFit:!0,autoHide:!0,backgroundColor:"transparent",backgroundShadowColor:"transparent",borderColor:"transparent",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderShadowColor:"transparent",borderWidth:0,color:"black",content:null,display:!0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:void 0},height:void 0,hitTolerance:0,init:void 0,opacity:void 0,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,spacing:1,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0};ke.defaultRoutes={};function Ho(t,e){return t.getSortedVisibleDatasetMetas().reduce(function(n,o){const r=o.controller;return r instanceof En&&Yo(t,e,o.data)&&(!n||r.innerRadius<n.controller.innerRadius)&&r.options.circumference>=90?o:n},void 0)}function Yo(t,e,n){if(!e.autoHide)return!0;for(let o=0;o<n.length;o++)if(!n[o].hidden&&t.getDataVisibility(o))return!0}function Wo({chartArea:t},e,n){const{left:o,top:r,right:s,bottom:i}=t,{innerRadius:a,offsetX:l,offsetY:d}=n.controller,c=(o+s)/2+l,u=(r+i)/2+d,h={left:Math.max(c-a,o),right:Math.min(c+a,s),top:Math.max(u-a,r),bottom:Math.min(u+a,i)},x={x:(h.left+h.right)/2,y:(h.top+h.bottom)/2},C=e.spacing+e.borderWidth/2,A=a-C,R=x.y>u,P=R?r+C:i-C,_=$o(P,c,u,A);return{controllerMeta:{_centerX:c,_centerY:u,_radius:A,_counterclockwise:R,..._},point:x,radius:Math.min(a,Math.min(h.right-h.left,h.bottom-h.top)/2)}}function Xo({width:t,height:e},n){const o=Math.sqrt(Math.pow(t,2)+Math.pow(e,2));return n*2/o}function $o(t,e,n,o){const r=Math.pow(n-t,2),s=Math.pow(o,2),i=e*-2,a=Math.pow(e,2)+r-s,l=Math.pow(i,2)-4*a;if(l<=0)return{_startAngle:0,_endAngle:Yt};const d=(-i-Math.sqrt(l))/2,c=(-i+Math.sqrt(l))/2;return{_startAngle:bt({x:e,y:n},{x:d,y:t}).angle,_endAngle:bt({x:e,y:n},{x:c,y:t}).angle}}function Bo(t,e){const{_centerX:n,_centerY:o,_radius:r,_startAngle:s,_endAngle:i,_counterclockwise:a,options:l}=e;t.save();const d=H(t,l);t.fillStyle=l.backgroundColor,t.beginPath(),t.arc(n,o,r,s,i,a),t.closePath(),t.fill(),d&&t.stroke(),t.restore(
6)}class fe extends K{inRange(e,n,o,r){return $t({x:e,y:n},{rect:this.getProps(["x","y","x2","y2"],r),center:this.getCenterPoint(r)},o,{rotation:this.rotation,borderWidth:this.options.borderWidth,hitTolerance:this.options.hitTolerance})}getCenterPoint(e){return F(this,e)}draw(e){const n=this.options,o=!z(this._visible)||this._visible;!n.display||!n.content||!o||(e.save(),Ce(e,this.getCenterPoint(),this.rotation),ho(e,this),Zt(e,this,n),en(e,Uo(this),n),e.restore())}resolveElementProperties(e,n){let o;if(qt(n))o=on(e,n);else{const{centerX:a,centerY:l}=Ve(e,n);o={x:a,y:l}}const r=Se(n.padding),s=ve(e.ctx,n),i=Kt(o,s,n,r);return{initProperties:ne(e,i,n),pointX:o.x,pointY:o.y,...i,rotation:n.rotation}}}fe.id="labelAnnotation";fe.defaults={adjustScaleRange:!0,backgroundColor:"transparent",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:0,callout:{borderCapStyle:"butt",borderColor:void 0,borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:1,display:!1,margin:5,position:"auto",side:5,start:"50%"},color:"black",content:null,display:!0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:void 0},height:void 0,hitTolerance:0,init:void 0,opacity:void 0,padding:6,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0};fe.defaultRoutes={borderColor:"color"};function Uo({x:t,y:e,width:n,height:o,options:r}){const s=r.borderWidth/2,i=Se(r.padding);return{x:t+i.left+s,y:e+i.top+s,width:n-i.left-i.right-r.borderWidth,height:o-i.top-i.bottom-r.borderWidth}}const Ge=(t,e,n)=>({x:t.x+n*(e.x-t.x),y:t.y+n*(e.y-t.y)}),Ne=(t,e,n)=>Ge(e,n,Math.abs((t-e.y)/(n.y-e.y))).x,Mt=(t,e,n)=>Ge(e,n,Math.abs((t-e.x)/(n.x-e.x))).y,ce=t=>t*t,Vo=(t,e,{x:n,y:o,x2:r,y2:s},i)=>i==="y"?{start:Math.min(o,s),end:Math.max(o,s),value:e}:{start:Math.min(n,r),end:Math.max(n,r),value:t},Dt=(t,e,n,o)=>(1-o)*(1-o)*t+2*(1-o)*o*e+o*o*n,Le=(t,e,n,o)=>({x:Dt(t.x,e.x,n.x,o),y:Dt(t.y,e.y,n.y,o)}),It=(t,e,n,o)=>2*(1-o)*(e-t)+2*o*(n-e),At=(t,e,n,o)=>-Math.atan2(It(t.x,e.x,n.x,o),It(t.y,e.y,n.y,o))+.5*E;class he extends K{inRange(e,n,o,r){const s=(this.options.borderWidth+this.options.hitTolerance)/2;if(o!=="x"&&o!=="y"){const i={mouseX:e,mouseY:n},{path:a,ctx:l}=this;if(a){H(l,this.options),l.lineWidth+=this.options.hitTolerance;const{chart:c}=this.$context,u=e*c.currentDevicePixelRatio,h=n*c.currentDevicePixelRatio,x=l.isPointInStroke(a,u,h)||je(this,i,r);return l.restore(),x}const d=ce(s);return qo(this,i,d,r)||je(this,i,r)}return Ko(this,{mouseX:e,mouseY:n},o,{hitSize:s,useFinalPosition:r})}getCenterPoint(e){return F(this,e)}draw(e){const{x:n,y:o,x2:r,y2:s,cp:i,options:a}=this;if(e.save(),!H(e,a))return e.restore();oe(e,a);const l=Math.sqrt(Math.pow(r-n,2)+Math.pow(s-o,2));if(a.curve&&i)return rr(e,this,i,l),e.restore();const{startOpts:d,endOpts:c,startAdjust:u,endAdjust:h}=dn(this),x=Math.atan2(s-o,r-n);e.translate(n,o),e.rotate(x),e.beginPath(),e.moveTo(0+u,0),e.lineTo(l-h,0),e.shadowColor=a.borderShadowColor,e.stroke(),ze(e,0,u,d),ze(e,l,-h,c),e.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(e,n){const o=xo(e,n),{x:r,y:s,x2:i,y2:a}=o,l=Go(o,e.chartArea),d=l?Fo({x:r,y:s},{x:i,y:a},e.chartArea):{x:r,y:s,x2:i,y2:a,width:Math.abs(i-r),height:Math.abs(a-s)};if(d.centerX=(i+r)/2,d.centerY=(a+s)/2,d.initProperties=ne(e,d,n),n.curve){const u={x:d.x,y:d.y},h={x:d.x2,y:d.y2};d.cp=or(d,n,We(u,h))}const c=Jo(e,d,n.label);return c._visible=l,d.elements=[{type:"label",optionScope:"label",properties:c,initProperties:d.initProperties}],d}}he.id="lineAnnotation";const Pt={backgroundColor:void 0,backgroundShadowColor:void 0,borderColor:void 0,borderDash:void 0,borderDashOffset:void 0,borderShadowColor:void 0,borderWidth:void 0,display:void 0,fill:void 0,length:void 0,shadowBlur:void 0,shadowOffsetX:void 0,shadowOffsetY:void 0,width:void 0};he.defaults={adjustScaleRange:!0,arrowHeads:{display:!1,end:Object.assign({},Pt),fill:!1,length:12,start:Object.assign({},Pt),width:6},borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:2,curve:!1,controlPoint:{y:"-50%"},display:!0,endValue:void 0,init:void 0,hitTolerance:0,label:{backgroundColor:"rgba(0,0,0,0.8)",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderColor:"black",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:6,borderShadowColor:"transparent",borderWidth:0,callout:Object.assign({},fe.defaults.callout),color:"#fff",content:null,display:!1,drawTime:void 0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:"bold"},height:void 0,hitTolerance:void 0,opacity:void 0,padding:6,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0,z:void 0},scaleID:void 0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,value:void 0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0};he.descriptors={arrowHeads:{start:{_fallback:!0},end:{_fallback:!0},_fallback:!0}};he.defaultRoutes={borderColor:"color"};function Ko(t,{mouseX:e,mouseY:n},o,{hitSize:r,useFinalPosition:s}){const i=Vo(e,n,t.getProps(["x","y","x2","y2"],s),o);return Wt(i,r)||je(t,{mouseX:e,mouseY:n},s,o)}function Go({x:t,y:e,x2:n,y2:o},{top:r,right:s,bottom:i,left:a}){return!(t<a&&n<a||t>s&&n>s||e<r&&o<r||e>i&&o>i)}function _t({x:t,y:e},n,{top:o,right:r,bottom:s,left:i}){return t<i&&(e=Mt(i,{x:t,y:e},n),t=i),t>r&&(e=Mt(r,{x:t,y:e},n),t=r),e<o&&(t=Ne(o,{x:t,y:e},n),e=o),e>s&&(t=Ne(s,{x:t,y:e},n),e=s),{x:t,y:e}}function Fo(t,e,n){const{x:o,y:r}=_t(t,e,n),{x:s,y:i}=_t(e,t,n);return{x:o,y:r,x2:s,y2:i,width:Math.abs(s-o),height:Math.abs(i-r)}}function qo(t,{mouseX:e,mouseY:n},o=U,r){const{x:s,y:i,x2:a,y2:l}=t.getProps(["x","y","x2","y2"],r),d=a-s,c=l-i,u=ce(d)+ce(c),h=u===0?-1:((e-s)*d+(n-i)*c)/u;let x,C;return h<0?(x=s,C=i):h>
61?(x=a,C=l):(x=s+h*d,C=i+h*c),ce(e-x)+ce(n-C)<=o}function je(t,{mouseX:e,mouseY:n},o,r){const s=t.label;return s.options.display&&s.inRange(e,n,r,o)}function Jo(t,e,n){const o=n.borderWidth,r=Se(n.padding),s=ve(t.ctx,n),i=s.width+r.width+o,a=s.height+r.height+o;return Zo(e,n,{width:i,height:a,padding:r},t.chartArea)}function Qo(t){const{x:e,y:n,x2:o,y2:r}=t,s=Math.atan2(r-n,o-e);return s>E/2?s-E:s<E/-2?s+E:s}function Zo(t,e,n,o){const{width:r,height:s,padding:i}=n,{xAdjust:a,yAdjust:l}=e,d={x:t.x,y:t.y},c={x:t.x2,y:t.y2},u=e.rotation==="auto"?Qo(t):Y(e.rotation),h=er(r,s,u),x=tr(t,e,{labelSize:h,padding:i},o),C=t.cp?Le(d,t.cp,c,x):Ge(d,c,x),A={size:h.w,min:o.left,max:o.right,padding:i.left},R={size:h.h,min:o.top,max:o.bottom,padding:i.top},P=Et(C.x,A)+a,_=Et(C.y,R)+l;return{x:P-r/2,y:_-s/2,x2:P+r/2,y2:_+s/2,centerX:P,centerY:_,pointX:C.x,pointY:C.y,width:r,height:s,rotation:Nn(u)}}function er(t,e,n){const o=Math.cos(n),r=Math.sin(n);return{w:Math.abs(t*o)+Math.abs(e*r),h:Math.abs(t*r)+Math.abs(e*o)}}function tr(t,e,n,o){let r;const s=nr(t,o);return e.position==="start"?r=Ot({w:t.x2-t.x,h:t.y2-t.y},n,e,s):e.position==="end"?r=1-Ot({w:t.x-t.x2,h:t.y-t.y2},n,e,s):r=Be(1,e.position),r}function Ot(t,e,n,o){const{labelSize:r,padding:s}=e,i=t.w*o.dx,a=t.h*o.dy,l=i>0&&(r.w/2+s.left-o.x)/i,d=a>0&&(r.h/2+s.top-o.y)/a;return xe(Math.max(l,d),0,.25)}function nr(t,e){const{x:n,x2:o,y:r,y2:s}=t,i=Math.min(r,s)-e.top,a=Math.min(n,o)-e.left,l=e.bottom-Math.max(r,s),d=e.right-Math.max(n,o);return{x:Math.min(a,d),y:Math.min(i,l),dx:a<=d?1:-1,dy:i<=l?1:-1}}function Et(t,e){const{size:n,min:o,max:r,padding:s}=e,i=n/2;return n>r-o?(r+o)/2:(o>=t-s-i&&(t=o+s+i),r<=t+s+i&&(t=r-s-i),t)}function dn(t){const e=t.options,n=e.arrowHeads&&e.arrowHeads.start,o=e.arrowHeads&&e.arrowHeads.end;return{startOpts:n,endOpts:o,startAdjust:Rt(t,n),endAdjust:Rt(t,o)}}function Rt(t,e){if(!e||!e.display)return 0;const{length:n,width:o}=e,r=t.options.borderWidth/2,s={x:n,y:o+r};return Math.abs(Ne(0,s,{x:0,y:r}))}function ze(t,e,n,o){if(!o||!o.display)return;const{length:r,width:s,fill:i,backgroundColor:a,borderColor:l}=o,d=Math.abs(e-r)+n;t.beginPath(),oe(t,o),H(t,o),t.moveTo(d,-s),t.lineTo(e+n,0),t.lineTo(d,s),i===!0?(t.fillStyle=a||l,t.closePath(),t.fill(),t.shadowColor="transparent"):t.shadowColor=o.borderShadowColor,t.stroke()}function or(t,e,n){const{x:o,y:r,x2:s,y2:i,centerX:a,centerY:l}=t,d=Math.atan2(i-r,s-o),c=Ue(e.controlPoint,0),u={x:a+$(n,c.x,!1),y:l+$(n,c.y,!1)};return G(u,{x:a,y:l},d)}function Nt(t,{x:e,y:n},{angle:o,adjust:r},s){!s||!s.display||(t.save(),t.translate(e,n),t.rotate(o),ze(t,0,-r,s),t.restore())}function rr(t,e,n,o){const{x:r,y:s,x2:i,y2:a,options:l}=e,{startOpts:d,endOpts:c,startAdjust:u,endAdjust:h}=dn(e),x={x:r,y:s},C={x:i,y:a},A=At(x,n,C,0),R=At(x,n,C,1)-E,P=Le(x,n,C,u/o),_=Le(x,n,C,1-h/o),N=new Path2D;t.beginPath(),N.moveTo(P.x,P.y),N.quadraticCurveTo(n.x,n.y,_.x,_.y),t.shadowColor=l.borderShadowColor,t.stroke(N),e.path=N,e.ctx=t,Nt(t,P,{angle:A,adjust:u},d),Nt(t,_,{angle:R,adjust:h},c)}class ge extends K{inRange(e,n,o,r){const s=this.options.rotation,i=(this.options.borderWidth+this.options.hitTolerance)/2;if(o!=="x"&&o!=="y")return sr({x:e,y:n},this.getProps(["width","height","centerX","centerY"],r),s,i);const{x:a,y:l,x2:d,y2:c}=this.getProps(["x","y","x2","y2"],r),u=o==="y"?{start:l,end:c}:{start:a,end:d},h=G({x:e,y:n},this.getCenterPoint(r),Y(-s));return h[o]>=u.start-i-U&&h[o]<=u.end+i+U}getCenterPoint(e){return F(this,e)}draw(e){const{width:n,height:o,centerX:r,centerY:s,options:i}=this;e.save(),Ce(e,this.getCenterPoint(),i.rotation),oe(e,this.options),e.beginPath(),e.fillStyle=i.backgroundColor;const a=H(e,i);e.ellipse(r,s,o/2,n/2,E/2,0,2*E),e.fill(),a&&(e.shadowColor=i.borderShadowColor,e.stroke()),e.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(e,n){return sn(e,n)}}ge.id="ellipseAnnotation";ge.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance:0,init:void 0,label:Object.assign({},re.defaults.label),rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0};ge.defaultRoutes={borderColor:"color",backgroundColor:"color"};ge.descriptors={label:{_fallback:!0}};function sr(t,e,n,o){const{width:r,height:s,centerX:i,centerY:a}=e,l=r/2,d=s/2;if(l<=0||d<=0)return!1;const c=Y(n||0),u=Math.cos(c),h=Math.sin(c),x=Math.pow(u*(t.x-i)+h*(t.y-a),2),C=Math.pow(h*(t.x-i)-u*(t.y-a),2);return x/Math.pow(l+o,2)+C/Math.pow(d+o,2)<=1.0001}class Me extends K{inRange(e,n,o,r){const{x:s,y:i,x2:a,y2:l,width:d}=this.getProps(["x","y","x2","y2","width"],r),c=(this.options.borderWidth+this.options.hitTolerance)/2;return o!=="x"&&o!=="y"?Qn({x:e,y:n},this.getCenterPoint(r),d/2,c):Wt(o==="y"?{start:i,end:l,value:n}:{start:s,end:a,value:e},c)}getCenterPoint(e){return F(this,e)}draw(e){const n=this.options,o=n.borderWidth;if(n.radius<.1)return;e.save(),e.fillStyle=n.backgroundColor,oe(e,n);const r=H(e,n);io(e,this,this.centerX,this.centerY),r&&!Te(n.pointStyle)&&(e.shadowColor=n.borderShadowColor,e.stroke()),e.restore(
6),n.borderWidth=o}resolveElementProperties(e,n){const o=rn(e,n);return o.initProperties=ne(e,o,n),o}}Me.id="pointAnnotation";Me.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance:0,init:void 0,pointStyle:"circle",radius:10,rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0};Me.defaultRoutes={borderColor:"color",backgroundColor:"color"};class De extends K{inRange(e,n,o,r){if(o!=="x"&&o!=="y")return this.options.radius>=.1&&this.elements.length>1&&ar(this.elements,e,n,r);const s=G({x:e,y:n},this.getCenterPoint(r),Y(-this.options.rotation)),i=this.elements.map(d=>o==="y"?d.bY:d.bX),a=Math.min(...i),l=Math.max(...i);return s[o]>=a&&s[o]<=l}getCenterPoint(e){return F(this,e)}draw(e){const{elements:n,options:o}=this;e.save(),e.beginPath(),e.fillStyle=o.backgroundColor,oe(e,o);const r=H(e,o);let s=!0;for(const i of n)s?(e.moveTo(i.x,i.y),s=!1):e.lineTo(i.x,i.y);e.closePath(),e.fill(),r&&(e.shadowColor=o.borderShadowColor,e.stroke()),e.restore()}resolveElementProperties(e,n){const o=rn(e,n),{sides:r,rotation:s}=n,i=[],a=2*E/r;let l=s*zt;for(let d=0;d<r;d++,l+=a){const c=ir(o,n,l);c.initProperties=ne(e,o,n),i.push(c)}return o.elements=i,o}}De.id="polygonAnnotation";De.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance:0,init:void 0,point:{radius:0},radius:10,rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,sides:3,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0};De.defaultRoutes={borderColor:"color",backgroundColor:"color"};function ir({centerX:t,centerY:e},{radius:n,borderWidth:o,hitTolerance:r},s){const i=(o+r)/2,a=Math.sin(s),l=Math.cos(s),d={x:t+a*n,y:e-l*n};return{type:"point",optionScope:"point",properties:{x:d.x,y:d.y,centerX:d.x,centerY:d.y,bX:t+a*(n+i),bY:e-l*(n+i)}}}function ar(t,e,n,o){let r=!1,s=t[t.length-1].getProps(["bX","bY"],o);for(const i of t){const a=i.getProps(["bX","bY"],o);a.bY>n!=s.bY>n&&e<(s.bX-a.bX)*(n-a.bY)/(s.bY-a.bY)+a.bX&&(r=!r),s=a}return r}const X={box:re,doughnutLabel:ke,ellipse:ge,label:fe,line:he,point:Me,polygon:De};Object.keys(X).forEach(t=>{Ln.describe(`elements.${X[t].id}`,{_fallback:"plugins.annotation.common"})});const lr={update:Object.assign},dr=Ke.concat(we),Lt=(t,e)=>Z(e)?Ye(t,e):t,He=t=>t==="color"||t==="font";function Fe(t="line"){return X[t]?t:(console.warn(`Unknown annotation type: '${t}', defaulting to 'line'`),"line")}function cr(t,e,n,o){const r=fr(t,n.animations,o),s=e.annotations,i=br(e.elements,s);for(let a=0;a<s.length;a++){const l=s[a],d=cn(i,a,l.type),c=l.setContext(gr(t,d,i,l)),u=d.resolveElementProperties(t,c);u.skip=ur(u),"elements"in u&&(hr(d,u.elements,c,r),delete u.elements),z(d.x)||Object.assign(d,u),Object.assign(d,u.initProperties),u.options=un(c),r.update(d,u)}}function ur(t){return isNaN(t.x)||isNaN(t.y)}function fr(t,e,n){return n==="reset"||n==="none"||n==="resize"?lr:new Rn(t,e)}function hr(t,e,n,o){const r=t.elements||(t.elements=[]);r.length=e.length;for(let s=0;s<e.length;s++){const i=e[s],a=i.properties,l=cn(r,s,i.type,i.initProperties),d=n[i.optionScope].override(i);a.options=un(d),o.update(l,a)}}function cn(t,e,n,o){const r=X[Fe(n)];let s=t[e];return(!s||!(s instanceof r))&&(s=t[e]=new r,Object.assign(s,o)),s}function un(t){const e=X[Fe(t.type)],n={};n.id=t.id,n.type=t.type,n.drawTime=t.drawTime,Object.assign(n,Ye(t,e.defaults),Ye(t,e.defaultRoutes));for(const o of dr)n[o]=t[o];return n}function Ye(t,e){const n={};for(const o of Object.keys(e)){const r=e[o],s=t[o];He(o)&&ee(s)?n[o]=s.map(i=>Lt(i,r)):n[o]=Lt(s,r)}return n}function gr(t,e,n,o){return e.$context||(e.$context=Object.assign(Object.create(t.getContext()),{element:e,get elements(){return n.filter(r=>r&&r.options)},id:o.id,type:"annotation"}))}function br(t,e){const n=e.length,o=t.length;if(o<n){const r=n-o;t.splice(o,0,...new Array(r))}else o>n&&t.splice(n,o-n);return t}var yr="3.1.0";const W=new Map,jt=t=>t.type!=="doughnutLabel",pr=Ke.concat(we);var mr={id:"annotation",version:yr,beforeRegister(){Zn("chart.js","4.0",pe.version)},afterRegister(){pe.register(X)},afterUnregister(){pe.unregister(X)},beforeInit(t){W.set(t,{annotations:[],elements:[],visibleElements:[],listeners:{},listened:!1,moveListened:!1,hooks:{},hooked:!1,hovered:[]})},beforeUpdate(t,e,n){const o=W.get(t),r=o.annotations=[];let s=n.annotations;
6Z(s)?Object.keys(s).forEach(i=>{const a=s[i];Z(a)&&(a.id=i,r.push(a))}):ee(s)&&r.push(...s),Ro(r.filter(jt),t.scales)},afterDataLimits(t,e){const n=W.get(t);Eo(t,e.scale,n.annotations.filter(jt).filter(o=>o.display&&o.adjustScaleRange))},afterUpdate(t,e,n){const o=W.get(t);Io(t,o,n),cr(t,o,n,e.mode),o.visibleElements=o.elements.filter(r=>!r.skip&&r.options.display),Oo(t,o,n)},beforeDatasetsDraw(t,e,n){de(t,"beforeDatasetsDraw",n.clip)},afterDatasetsDraw(t,e,n){de(t,"afterDatasetsDraw",n.clip)},beforeDatasetDraw(t,e,n){de(t,e.index,n.clip)},beforeDraw(t,e,n){de(t,"beforeDraw",n.clip)},afterDraw(t,e,n){de(t,"afterDraw",n.clip)},beforeEvent(t,e,n){const o=W.get(t);Ao(o,e.event,n)&&(e.changed=!0)},afterDestroy(t){W.delete(t)},getAnnotations(t){const e=W.get(t);return e?e.elements:[]},_getAnnotationElementsAtEventForMode(t,e,n){return $e(t,e,n)},defaults:{animations:{numbers:{properties:["x","y","x2","y2","width","height","centerX","centerY","pointX","pointY","radius"],type:"number"},colors:{properties:["backgroundColor","borderColor"],type:"color"}},clip:!0,interaction:{mode:void 0,axis:void 0,intersect:void 0},common:{drawTime:"afterDatasetsDraw",init:!1,label:{}}},descriptors:{_indexable:!1,_scriptable:t=>!pr.includes(t)&&t!=="init",annotations:{_allKeys:!1,_fallback:(t,e)=>`elements.${X[Fe(e.type)].id}`},interaction:{_fallback:!0},common:{label:{_indexable:He,_fallback:!0},_indexable:He}},additionalOptionScopes:[""]};function de(t,e,n){const{ctx:o,chartArea:r}=t,s=W.get(t);n&&An(o,r);const i=wr(s.visibleElements,e).sort((a,l)=>a.element.options.z-l.element.options.z);for(const a of i)Sr(o,r,s,a);n&&Pn(o)}function wr(t,e){const n=[];for(const o of t)if(o.options.drawTime===e&&n.push({element:o,main:!0}),o.elements&&o.elements.length)for(const r of o.elements)r.options.display&&r.options.drawTime===e&&n.push({element:r});return n}function Sr(t,e,n,o){const r=o.element;o.main?(Ct(n,r,"beforeDraw"),r.draw(t,e),Ct(n,r,"afterDraw")):r.draw(t,e)}const xr={class:"background-svg my-4"},Tr={class:"d-flex flex-column centering my-6"},Cr={class:"stats-title"},vr={class:"d-flex align-center justify-center",style:{gap:"16px"}},kr={class:"date__filter"},Mr=Sn({__name:"StatsView",props:{setHeaderSlot:{type:Function}},setup(t){var Ze,et,tt,nt,ot;pe.register(jn,zn,Hn,Yn,Wn,Xn,$n,Bn,Un,mr);const{getInterfaceLanguagesInfo:e,getMergedInterfaceLanguagesInfo:n}=rt(),o=xn(),{currentInstitution:r,orgStats:s,groupsStats:i}=Tn(o),{locale:a,translate:l}=rt(),{formatNumber:d}=Vn(),c=n(),u=Pe(new Date),h=Pe(new Date),x=["#59b8ef","#4ba6db","#5b84e3","#857bed","#5bbce3"],C=()=>{const f=Math.floor(Math.random()*90)+200,b=Math.floor(Math.random()*30)+50,p=Math.floor(Math.random()*25)+50;return`hsl(${f}, ${b}%, ${p}%)`},A=f=>f<x.length?x[f]:C(),R=[{title:d((et=(Ze=r.value)==null?void 0:Ze.accessPlan)==null?void 0:et.usedSeats),text:l("INSTITUTIONS.STATISTICS.TOTAL_STUDENTS")},{title:d((tt=r.value)==null?void 0:tt.active_groups),text:l("INSTITUTIONS.STATISTICS.TOTAL_GROUPS")},{title:d((ot=(nt=r.value)==null?void 0:nt.accessPlan)==null?void 0:ot.usedTokens),text:l("INSTITUTIONS.STATISTICS.USED_TOKENS_THIS_MONTH")}],P={responsive:!0,plugins:{legend:{position:"bottom"},tooltip:{mode:"index",intersect:!1,callbacks:{label:function(f){const b=f.dataset.label||"",p=f.parsed.y;return`${b}: ${d(p)}`}}}},interaction:{mode:"nearest",axis:"x",intersect:!1},scales:{x:{title:{display:!0,text:l("INSTITUTIONS.CHARTS.AXES.DATE")}},y:{title:{display:!0,text:l("INSTITUTIONS.CHARTS.AXES.TOKENS_USED")},stacked:!0,ticks:{callback:function(f){return d(f)}}}}},_=J(()=>{const f=new Date;f.setHours(0,0,0,0);const b=new Date(h.value);return b.setHours(0,0,0,0),b>=f}),N=()=>{const f=pt(u.value),b=pt(h.value);return`${f} - ${b}`},L=async f=>{const b=new Date(u.value),p=new Date(h.value);b.setDate(b.getDate()+f*7),p.setDate(p.getDate()+f*7);const m=new Date;p>m&&p.setTime(m.getTime()),u.value=b,h.value=p,await q()},q=async()=>{var v;if(!((v=r.value)!=null&&v.id))return;const f=w=>{const M=w.getFullYear(),y=String(w.getMonth()+1).padStart(2,"0"),g=String(w.getDate()).padStart(2,"0");return`${M}-${y}-${g}`},b=f(u.value),p=f(h.value),m=r.value.id;await Promise.all([o.getOrgUsage(b,p,m),o.getGroupsUsage(b,p,m)])},Ie=J(()=>{const f=s.value??[];if(!f.length)return{labels:[],datasets:[]};let b=-1;for(let g=1;g<f.length;g++){const k=new Date(f[g-1].date),S=new Date(f[g].date);if(k.getMonth()!==S.getMonth()||k.getFullYear()!==S.getFullYear()){b=g;break}}const p=f.map(g=>yt(g.date,a.value)),m=f.map(g=>g.remainingPool??0),v=f.map(g=>g.usedTokens??0),w=yn("--first-blue-color"),M="#ef5350",y=[];if(b>0){const g=m.map((S,T)=>T>=b?null:S);y.push({label:l("INSTITUTIONS.CHARTS.TOKENS_REMAINING"),data:g,borderColor:w,backgroundColor:"rgba(73, 171, 234, 0.1)",segment:{borderColor:S=>{const T=S.p0.$context.parsed.y,I=S.p1.$context.parsed.y;return T<0||I<0?M:w}},fill:{target:{value:0},above:"rgba(73, 171, 234, 0.1)",below:"rgba(239, 83, 80, 0.1)"},tension:0,pointRadius:3,pointHoverRadius:5,spanGaps:!1,pointBackgroun
6dColor:S=>{var I;const T=(I=S.parsed)==null?void 0:I.y;return T==null?"transparent":T<0?M:w},pointBorderColor:S=>{var I;const T=(I=S.parsed)==null?void 0:I.y;return T==null?"transparent":T<0?M:w}});const k=m.map((S,T)=>T<b?null:S);y.push({label:l("INSTITUTIONS.CHARTS.TOKENS_REMAINING")+" ",data:k,borderColor:w,backgroundColor:"rgba(73, 171, 234, 0.1)",segment:{borderColor:S=>{const T=S.p0.$context.parsed.y,I=S.p1.$context.parsed.y;return T<0||I<0?M:w}},fill:{target:{value:0},above:"rgba(73, 171, 234, 0.1)",below:"rgba(239, 83, 80, 0.1)"},tension:0,pointRadius:3,pointHoverRadius:5,spanGaps:!1,pointBackgroundColor:S=>{var I;const T=(I=S.parsed)==null?void 0:I.y;return T==null?"transparent":T<0?M:w},pointBorderColor:S=>{var I;const T=(I=S.parsed)==null?void 0:I.y;return T==null?"transparent":T<0?M:w}})}else y.push({label:l("INSTITUTIONS.CHARTS.TOKENS_REMAINING"),data:m,borderColor:w,backgroundColor:"rgba(73, 171, 234, 0.1)",segment:{borderColor:g=>{const k=g.p0.$context.parsed.y,S=g.p1.$context.parsed.y;return k<0||S<0?M:w}},fill:{target:{value:0},above:"rgba(73, 171, 234, 0.1)",below:"rgba(239, 83, 80, 0.1)"}
6,tension:0,pointRadius:3,pointHoverRadius:5,pointBackgroundColor:g=>{var S;const k=(S=g.parsed)==null?void 0:S.y;return k==null?"transparent":k<0?M:w},pointBorderColor:g=>{var S;const k=(S=g.parsed)==null?void 0:S.y;return k==null?"transparent":k<0?M:w}});return{labels:p,datasets:y,_monthTransitionIndex:b,_usedTokens:v}}),fn=J(()=>{const f=Ie.value._monthTransitionIndex??-1,b=Ie.value._usedTokens??[],p={};return f>0&&(p.monthBox={type:"box",xMin:f-1,xMax:f,backgroundColor:"rgba(158, 158, 158, 0.15)",borderColor:"#9E9E9E",borderWidth:0}),{responsive:!0,plugins:{legend:{position:"bottom",onClick:m=>{},labels:{filter:function(m){const v=m.text||"";return!v.includes("Limit")&&v===v.trim()}}},tooltip:{mode:"index",intersect:!1,callbacks:{label:function(m){const v=m.dataset.label||"",w=m.parsed.y;if(!(v.includes("Limit")||w===null))return`${v.trim()}: ${d(w)}`},footer:function(m){if(!m||m.length===0)return"";const v=m[0].dataIndex,w=b[v];return w!=null?`${l("INSTITUTIONS.CHARTS.AXES.TOKENS_USED")}: ${d(w)}`:""}}},annotation:{annotations:p}},interaction:{mode:"nearest",axis:"x",intersect:!1},scales:{x:{title:{display:!0,text:l("INSTITUTIONS.CHARTS.AXES.DATE")}},y:{title:{display:!0,text:l("INSTITUTIONS.CHARTS.AXES.TOKENS_USED")},beginAtZero:!0,ticks:{callback:function(m){return d(m)}},grid:{color:function(m){return m.tick.value===0?"#757575":"rgba(0, 0, 0, 0.1)"},lineWidth:function(m){return m.tick.value===0?2:1}}}}}}),hn=J(()=>{const f=i.value??[],b=[],p=new Date(u.value),m=new Date(h.value);for(;p<=m;)b.push(new Date(p)),p.setDate(p.getDate()+1);const v=b.map(y=>yt(y,a.value)),M=[...new Set(f.map(y=>y.groupName))].map((y,g)=>{const k=f.filter(B=>B.groupName===y),S=b.map(B=>{const be=k.find(wn=>{const Ae=new Date(wn.date);return Ae.getFullYear()===B.getFullYear()&&Ae.getMonth()===B.getMonth()&&Ae.getDate()===B.getDate()});return be?be.usedTokens:0}),T=A(g),I=S.reduce((B,be)=>B+be,0);return{label:y,data:S,borderColor:T,backgroundColor:T,fill:!0,tension:0,pointRadius:3,pointHoverRadius:5,_sum:I}});return M.sort((y,g)=>g._sum-y._sum),M.forEach((y,g)=>{y.order=M.length-g}),M.forEach(y=>delete y._sum),{labels:v,datasets:M}}),gn=J(()=>{const f=i.value??[];if(!f.length)return{labels:[],datasets:[]};const b=[...new Set(f.map(y=>y.groupLang||"other"))],p=new Map;f.forEach(y=>{const g=y.groupLang||"other",k=y.usedTokens||0;p.set(g,(p.get(g)||0)+k)});const m=Array.from(p.entries()).sort((y,g)=>g[1]-y[1]),v=m.map(([y])=>{const g=c.find(k=>k.lang===y);return g?l(g.localizeKey):y}),w=m.map(([y,g])=>g),M=m.map(([y])=>{const g=b.indexOf(y);return A(g>=0?g:b.length)});return{labels:v,datasets:[{data:w,backgroundColor:M,hoverOffset:4}]}}),bn=J(()=>{const f=i.value??[];if(!f.length)return{labels:[],datasets:[]};const b=new Map;f.forEach(y=>{const g=y.groupName||"Unknown",k=y.usedTokens||0;b.set(g,(b.get(g)||0)+k)});const p=Array.from(b.entries()).sort((y,g)=>g[1]-y[1]),m=p.map(([y])=>y),v=p.map(([y,g])=>g),w=[...new Set(f.map(y=>y.groupName))],M=p.map(([y])=>{const g=w.indexOf(y);return A(g>=0?g:w.length)});return{labels:m,datasets:[{data:v,backgroundColor:M,hoverOffset:4}]}}),qe={responsive:!0,maintainAspectRatio:!0,plugins:{legend:{position:"bottom",labels:{padding:10,font:{size:12}}},tooltip:{callbacks:{label:function(f){const b=f.label||"",p=f.parsed||0;return`${b}: ${d(p)}`}}}}},yn=f=>getComputedStyle(document.documentElement).getPropertyValue(f).trim(),Je=t,pn=Pe("en"),mn=e();function Qe(){Je.setHeaderSlot&&Je.setHeaderSlot(_e("div",{class:"d-flex flex-wrap",style:"gap: 8px"},mn.map(f=>_e(Dn,{key:f.lang,color:"var(--first-blue-color)",variant:"text",class:"d-flex align-center",label:!0},{default:()=>[_e("img",{src:f.img,alt:f.localizeKey?l(f.localizeKey):f.name,style:"width: 20px; height: 20px; margin-right: 6px;"}),f.localizeKey?l(f.localizeKey):f.name]}))))}return Cn(async()=>{var f;if(Qe(),(f=r.value)!=null&&f.id){const b=new Date,p=new Date;p.setDate(b.getDate()-28),h.value=new Date(b),u.value=new Date(p),await q()}}),vn(pn,Qe),kn(()=>{s.value=[],i.value=[]}),(f,b)=>{const p=st("v-col"),m=st("v-row");return at(),it(lt,null,[se("div",xr,[D(m,{class:"d-flex flex-wrap"},{default:O(()=>[(at(),it(lt,null,Mn(R,(v,w)=>D(p,{key:w,class:"d-flex flex-grow-2",style:{"min-width":"140px","max-width":"100%"}},{default:O(()=>[D(ie,{style:{"justify-content":"unset"},"title-localize-key":v.title,"text-localize-key":v.text,"white-mode":!0,class:"flex-grow-1"},null,8,["title-localize-key","text-localize-key"])]),_:2},1024)),64))]),_:1}
6)]),se("div",Tr,[se("span",Cr,dt(j(l)("INSTITUTIONS.CHARTS.ORG_TOKENS.TITLE")),1),se("div",vr,[D(ct,{icon:"mdi-chevron-left",onClick:b[0]||(b[0]=v=>L(-4))}),se("div",kr,dt(N()),1),D(ct,{icon:"mdi-chevron-right",onClick:b[1]||(b[1]=v=>L(4)),disabled:_.value},null,8,["disabled"])])]),D(m,null,{default:O(()=>[D(p,{cols:"12"},{default:O(()=>[D(ie,{"title-localize-key":j(l)("INSTITUTIONS.CHARTS.TOKEN_DEPLETION_PROGRESS")},{default:O(()=>[D(j(ut),{data:Ie.value,options:fn.value,style:{"max-height":"900px"}},null,8,["data","options"])]),_:1},8,["title-localize-key"])]),_:1})]),_:1}),D(m,null,{default:O(()=>[D(p,{cols:"12",md:"6"},{default:O(()=>[D(ie,{"title-localize-key":j(l)("INSTITUTIONS.CHARTS.LANG_TOKENS.TITLE")},{default:O(()=>[D(j(ft),{data:gn.value,options:qe,style:{"max-height":"250px"}},null,8,["data"])]),_:1},8,["title-localize-key"])]),_:1}),D(p,{cols:"12",md:"6"},{default:O(()=>[D(ie,{"title-localize-key":j(l)("INSTITUTIONS.CHARTS.GROUPS_TOKENS.TITLE")},{default:O(()=>[D(j(ft),{data:bn.value,options:qe,style:{"max-height":"250px"}},null,8,["data"])]),_:1},8,["title-localize-key"])]),_:1})]),_:1}),D(m,null,{default:O(()=>[D(p,{cols:"12"},{default:O(()=>[D(ie,{"title-localize-key":j(l)("INSTITUTIONS.CHARTS.GROUPS_TOKENS.TITLE")},{default:O(()=>[D(j(ut),{data:hn.value,options:P,style:{"max-height":"300px"}},null,8,["data"])]),_:1},8,["title-localize-key"])]),_:1})]),_:1})],64)}}}),Or=In(Mr,[["__scopeId","data-v-de4c12fd"]]);export{Or 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.