{
  "documentVersion": 37,
  "id": "project-98bcfafd-9d64-4638-a20d-cb93870d034d",
  "name": "Manual Chart Tutorial - Stacked Example",
  "description": "",
  "version": "0.1.0",
  "author": {
    "name": ""
  },
  "supportsRealTime": true,
  "supportsNonRealTime": true,
  "mainCompositionId": "comp-9b7555f7-7701-45e8-8d84-50a44f9318dc",
  "compositions": [
    {
      "id": "comp-9b7555f7-7701-45e8-8d84-50a44f9318dc",
      "name": "Main",
      "width": 1920,
      "height": 1080,
      "backgroundColor": "transparent",
      "frameRate": 50,
      "updateTransitionFrames": 0,
      "updateInterruption": "queue",
      "layout": {
        "showRulers": true,
        "showActionSafe": false,
        "showTitleSafe": false,
        "showCenterMarker": false,
        "dimOutsideCanvas": true,
        "presentationBackground": "none",
        "presentationBackgroundImageSource": "",
        "presentationBackgroundImageName": "",
        "snappingEnabled": true,
        "snapToGrid": false,
        "snapToGuides": true,
        "snapToLayers": true,
        "gridSize": 10,
        "snapThreshold": 6,
        "boundsMode": "allow",
        "overflowPreview": "visible",
        "guides": [],
        "timelineFolders": []
      },
      "layers": [
        {
          "id": "layer-372f17fe-6774-448f-81b0-b7d84db7ac68",
          "name": "Chart",
          "isVisible": true,
          "isGuide": false,
          "blendMode": "normal",
          "isLocked": false,
          "groupId": null,
          "parentId": null,
          "clipChildren": false,
          "isMaskOnly": false,
          "mask": null,
          "constraints": {
            "horizontal": "left",
            "vertical": "top"
          },
          "autoLayout": {
            "direction": "none",
            "gap": 0,
            "paddingTop": 0,
            "paddingRight": 0,
            "paddingBottom": 0,
            "paddingLeft": 0,
            "align": "start",
            "hugWidth": false,
            "hugHeight": false,
            "minWidth": 0,
            "maxWidth": 0,
            "collapseHidden": true
          },
          "updateTransition": {
            "style": "inherit",
            "durationFrames": 0,
            "distance": 24
          },
          "motionPath": null,
          "keyframes": [
            {
              "id": "layer-keyframe-0c3572e3-ceb1-442a-a664-5578cfc5a5bb",
              "frame": 0,
              "easing": "linear",
              "transform": {
                "x": 300,
                "y": 280,
                "width": 1000,
                "height": 550,
                "rotation": 0,
                "opacity": 1,
                "transformOriginX": 0.5,
                "transformOriginY": 0.5
              }
            },
            {
              "id": "layer-keyframe-70ec1b12-da5e-40e8-bdfd-4241e3ae8291",
              "frame": 100,
              "easing": "linear",
              "transform": {
                "x": 300,
                "y": 280,
                "width": 1000,
                "height": 550,
                "rotation": 0,
                "opacity": 1,
                "transformOriginX": 0.5,
                "transformOriginY": 0.5
              }
            },
            {
              "id": "layer-keyframe-2b21eb3f-47a1-4655-8ec8-4bb5784b9eae",
              "frame": 150,
              "easing": "cubic-in",
              "transform": {
                "x": 300,
                "y": 280,
                "width": 1000,
                "height": 550,
                "rotation": 0,
                "opacity": 1,
                "transformOriginX": 0.5,
                "transformOriginY": 0.5
              }
            }
          ],
          "animationTracks": {
            "clipTop": [
              {
                "id": "property-keyframe-766bdab2-0093-4a32-970c-fb21aa845c04",
                "frame": 100,
                "value": 0,
                "easing": "linear"
              },
              {
                "id": "property-keyframe-6faecc70-473f-4c51-9afd-93eeb7c2bed0",
                "frame": 150,
                "value": 1,
                "easing": "cubic-in"
              }
            ]
          },
          "loop": null,
          "element": {
            "type": "chart",
            "provider": {
              "id": "ograf.chartjs",
              "version": "1.3.1",
              "sha256": "7966be65e37e8c5fb6e6b7e5d5735120e6edd1821d6be84ad4b8fba9a822072e"
            },
            "preset": "stacked-bar",
            "data": {
              "labels": [
                "TEAM TOTAL"
              ],
              "datasets": [
                {
                  "label": "FALCONS",
                  "data": [
                    72
                  ],
                  "backgroundColor": [
                    "#2563eb"
                  ],
                  "borderColor": "#38bdf8"
                },
                {
                  "label": "COMETS",
                  "data": [
                    58
                  ],
                  "backgroundColor": "#f472b6",
                  "borderColor": "#f472b6"
                },
                {
                  "label": "WAVES",
                  "data": [
                    46
                  ],
                  "backgroundColor": "#34d399",
                  "borderColor": "#34d399"
                },
                {
                  "label": "WOLVES",
                  "data": [
                    33
                  ],
                  "backgroundColor": "#fbbf24",
                  "borderColor": "#fbbf24"
                }
              ]
            },
            "textColor": "#e5e7eb",
            "fontSize": 28,
            "showLegend": true,
            "showGrid": true,
            "animation": {
              "type": "none",
              "durationFrames": 36,
              "delayFrames": 12,
              "staggerFrames": 12,
              "easing": "cubic-out",
              "replayOnUpdate": true,
              "updateMode": "morph"
            },
            "presentation": {
              "valueAxis": {
                "min": 0,
                "max": 400,
                "step": 100
              },
              "maxBarThickness": 160,
              "valueLabels": {
                "show": true
              }
            }
          },
          "effects": {
            "blur": 0,
            "dropShadowEnabled": false,
            "dropShadowColor": "#000000",
            "dropShadowOpacity": 0.65,
            "dropShadowOffsetX": 8,
            "dropShadowOffsetY": 8,
            "dropShadowBlur": 12
          },
          "semantics": {
            "role": "none",
            "description": "",
            "tags": []
          },
          "designTokenBindings": [],
          "componentLink": null,
          "visualRules": [],
          "animationTrackMode": "independent",
          "motion": {
            "in": null,
            "out": {
              "style": "wipe",
              "direction": "down",
              "durationFrames": 50
            }
          },
          "bindings": [
            {
              "fieldId": "field-26b7b802-e0c1-4d19-a3b1-48e9269579a3",
              "targetProperty": "data",
              "sourcePath": []
            }
          ]
        }
      ],
      "dataFields": [
        {
          "id": "field-26b7b802-e0c1-4d19-a3b1-48e9269579a3",
          "key": "chart_data",
          "label": "Chart: Chart data (JSON)",
          "description": "",
          "type": "textarea",
          "defaultValue": "{\"labels\":[\"TEAM TOTAL\"],\"datasets\":[{\"label\":\"FALCONS\",\"data\":[72],\"backgroundColor\":[\"#2563eb\"],\"borderColor\":\"#38bdf8\"},{\"label\":\"COMETS\",\"data\":[58],\"backgroundColor\":\"#f472b6\",\"borderColor\":\"#f472b6\"},{\"label\":\"WAVES\",\"data\":[46],\"backgroundColor\":\"#34d399\",\"borderColor\":\"#34d399\"},{\"label\":\"WOLVES\",\"data\":[33],\"backgroundColor\":\"#fbbf24\",\"borderColor\":\"#fbbf24\"}]}",
          "required": false,
          "options": [],
          "constraints": {},
          "fileExtensions": [],
          "properties": [],
          "items": null
        }
      ],
      "runtimeCollections": [],
      "dataConnections": [
        {
          "id": "data-connection-53305fd9-f49f-4630-aef0-e49ecd5c006c",
          "name": "Data connection 1",
          "format": "json",
          "source": "embedded",
          "url": "",
          "embeddedText": "{\n  \"chart_data\": \"{\\\"labels\\\":[\\\"TEAM TOTAL\\\"],\\\"datasets\\\":[{\\\"label\\\":\\\"FALCONS\\\",\\\"data\\\":[80],\\\"backgroundColor\\\":\\\"#2563eb\\\",\\\"borderColor\\\":\\\"#2563eb\\\"},{\\\"label\\\":\\\"COMETS\\\",\\\"data\\\":[65],\\\"backgroundColor\\\":\\\"#f472b6\\\",\\\"borderColor\\\":\\\"#f472b6\\\"},{\\\"label\\\":\\\"WAVES\\\",\\\"data\\\":[40],\\\"backgroundColor\\\":\\\"#34d399\\\",\\\"borderColor\\\":\\\"#34d399\\\"},{\\\"label\\\":\\\"WOLVES\\\",\\\"data\\\":[20],\\\"backgroundColor\\\":\\\"#fbbf24\\\",\\\"borderColor\\\":\\\"#fbbf24\\\"}]}\"\n}",
          "refreshMs": 0,
          "missing": "default",
          "enabled": true,
          "mappings": [
            {
              "fieldId": "field-26b7b802-e0c1-4d19-a3b1-48e9269579a3",
              "sourcePath": "chart_data"
            }
          ]
        }
      ],
      "mediaCues": [],
      "patterns": [],
      "rendererPlugins": [
        {
          "manifest": {
            "schemaVersion": 1,
            "apiVersion": 1,
            "kind": "chart",
            "id": "ograf.chartjs",
            "version": "1.3.1",
            "name": "Chart.js renderer",
            "author": "Zero Density",
            "description": "Chart.js adapter sampled from the OGraf frame clock.",
            "library": {
              "name": "Chart.js",
              "version": "4.5.1",
              "license": "MIT",
              "author": "Chart.js contributors",
              "homepage": "https://www.chartjs.org"
            },
            "license": "AGPL-3.0-only",
            "presets": [
              "bar",
              "horizontal-bar",
              "stacked-bar",
              "line",
              "area",
              "pie",
              "doughnut",
              "radar",
              "polar-area"
            ],
            "chartFeatures": [
              "presentation-v1",
              "canonical-data-v1",
              "morph-update-v1",
              "mark-paint-v1",
              "mark-animation-v1"
            ]
          },
          "source": "/*!\n * @kurkle/color v0.3.4\n * https://github.com/kurkle/color#readme\n * (c) 2024 Jukka Kurkela\n * Released under the MIT License\n */function round(v){return v+0.5|0}var lim=(v,l,h)=>Math.max(Math.min(v,h),l);function p2b(v){return lim(round(v*2.55),0,255)}function n2b(v){return lim(round(v*255),0,255)}function b2n(v){return lim(round(v/2.55)/100,0,1)}function n2p(v){return lim(round(v*100),0,100)}var map$1={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},hex=[...\"0123456789ABCDEF\"],h1=(b)=>hex[b&15],h2=(b)=>hex[(b&240)>>4]+hex[b&15],eq=(b)=>(b&240)>>4===(b&15),isShort=(v)=>eq(v.r)&&eq(v.g)&&eq(v.b)&&eq(v.a);function hexParse(str){var len=str.length,ret;if(str[0]===\"#\"){if(len===4||len===5)ret={r:255&map$1[str[1]]*17,g:255&map$1[str[2]]*17,b:255&map$1[str[3]]*17,a:len===5?map$1[str[4]]*17:255};else if(len===7||len===9)ret={r:map$1[str[1]]<<4|map$1[str[2]],g:map$1[str[3]]<<4|map$1[str[4]],b:map$1[str[5]]<<4|map$1[str[6]],a:len===9?map$1[str[7]]<<4|map$1[str[8]]:255}}return ret}var alpha=(a,f)=>a<255?f(a):\"\";function hexString(v){var f=isShort(v)?h1:h2;return v?\"#\"+f(v.r)+f(v.g)+f(v.b)+alpha(v.a,f):void 0}var HUE_RE=/^(hsla?|hwb|hsv)\\(\\s*([-+.e\\d]+)(?:deg)?[\\s,]+([-+.e\\d]+)%[\\s,]+([-+.e\\d]+)%(?:[\\s,]+([-+.e\\d]+)(%)?)?\\s*\\)$/;function hsl2rgbn(h,s,l){let a=s*Math.min(l,1-l),f=(n,k=(n+h/30)%12)=>l-a*Math.max(Math.min(k-3,9-k,1),-1);return[f(0),f(8),f(4)]}function hsv2rgbn(h,s,v){let f=(n,k=(n+h/60)%6)=>v-v*s*Math.max(Math.min(k,4-k,1),0);return[f(5),f(3),f(1)]}function hwb2rgbn(h,w,b){let rgb=hsl2rgbn(h,1,0.5),i;if(w+b>1)i=1/(w+b),w*=i,b*=i;for(i=0;i<3;i++)rgb[i]*=1-w-b,rgb[i]+=w;return rgb}function hueValue(r,g,b,d,max){if(r===max)return(g-b)/d+(g<b?6:0);if(g===max)return(b-r)/d+2;return(r-g)/d+4}function rgb2hsl(v){let r=v.r/255,g=v.g/255,b=v.b/255,max=Math.max(r,g,b),min=Math.min(r,g,b),l=(max+min)/2,h,s,d;if(max!==min)d=max-min,s=l>0.5?d/(2-max-min):d/(max+min),h=hueValue(r,g,b,d,max),h=h*60+0.5;return[h|0,s||0,l]}function calln(f,a,b,c){return(Array.isArray(a)?f(a[0],a[1],a[2]):f(a,b,c)).map(n2b)}function hsl2rgb(h,s,l){return calln(hsl2rgbn,h,s,l)}function hwb2rgb(h,w,b){return calln(hwb2rgbn,h,w,b)}function hsv2rgb(h,s,v){return calln(hsv2rgbn,h,s,v)}function hue(h){return(h%360+360)%360}function hueParse(str){let m=HUE_RE.exec(str),a=255,v;if(!m)return;if(m[5]!==v)a=m[6]?p2b(+m[5]):n2b(+m[5]);let h=hue(+m[2]),p1=+m[3]/100,p2=+m[4]/100;if(m[1]===\"hwb\")v=hwb2rgb(h,p1,p2);else if(m[1]===\"hsv\")v=hsv2rgb(h,p1,p2);else v=hsl2rgb(h,p1,p2);return{r:v[0],g:v[1],b:v[2],a}}function rotate(v,deg){var h=rgb2hsl(v);h[0]=hue(h[0]+deg),h=hsl2rgb(h),v.r=h[0],v.g=h[1],v.b=h[2]}function hslString(v){if(!v)return;let a=rgb2hsl(v),h=a[0],s=n2p(a[1]),l=n2p(a[2]);return v.a<255?`hsla(${h}, ${s}%, ${l}%, ${b2n(v.a)})`:`hsl(${h}, ${s}%, ${l}%)`}var map={x:\"dark\",Z:\"light\",Y:\"re\",X:\"blu\",W:\"gr\",V:\"medium\",U:\"slate\",A:\"ee\",T:\"ol\",S:\"or\",B:\"ra\",C:\"lateg\",D:\"ights\",R:\"in\",Q:\"turquois\",E:\"hi\",P:\"ro\",O:\"al\",N:\"le\",M:\"de\",L:\"yello\",F:\"en\",K:\"ch\",G:\"arks\",H:\"ea\",I:\"ightg\",J:\"wh\"},names$1={OiceXe:\"f0f8ff\",antiquewEte:\"faebd7\",aqua:\"ffff\",aquamarRe:\"7fffd4\",azuY:\"f0ffff\",beige:\"f5f5dc\",bisque:\"ffe4c4\",black:\"0\",blanKedOmond:\"ffebcd\",Xe:\"ff\",XeviTet:\"8a2be2\",bPwn:\"a52a2a\",burlywood:\"deb887\",caMtXe:\"5f9ea0\",KartYuse:\"7fff00\",KocTate:\"d2691e\",cSO:\"ff7f50\",cSnflowerXe:\"6495ed\",cSnsilk:\"fff8dc\",crimson:\"dc143c\",cyan:\"ffff\",xXe:\"8b\",xcyan:\"8b8b\",xgTMnPd:\"b8860b\",xWay:\"a9a9a9\",xgYF:\"6400\",xgYy:\"a9a9a9\",xkhaki:\"bdb76b\",xmagFta:\"8b008b\",xTivegYF:\"556b2f\",xSange:\"ff8c00\",xScEd:\"9932cc\",xYd:\"8b0000\",xsOmon:\"e9967a\",xsHgYF:\"8fbc8f\",xUXe:\"483d8b\",xUWay:\"2f4f4f\",xUgYy:\"2f4f4f\",xQe:\"ced1\",xviTet:\"9400d3\",dAppRk:\"ff1493\",dApskyXe:\"bfff\",dimWay:\"696969\",dimgYy:\"696969\",dodgerXe:\"1e90ff\",fiYbrick:\"b22222\",flSOwEte:\"fffaf0\",foYstWAn:\"228b22\",fuKsia:\"ff00ff\",gaRsbSo:\"dcdcdc\",ghostwEte:\"f8f8ff\",gTd:\"ffd700\",gTMnPd:\"daa520\",Way:\"808080\",gYF:\"8000\",gYFLw:\"adff2f\",gYy:\"808080\",honeyMw:\"f0fff0\",hotpRk:\"ff69b4\",RdianYd:\"cd5c5c\",Rdigo:\"4b0082\",ivSy:\"fffff0\",khaki:\"f0e68c\",lavFMr:\"e6e6fa\",lavFMrXsh:\"fff0f5\",lawngYF:\"7cfc00\",NmoncEffon:\"fffacd\",ZXe:\"add8e6\",ZcSO:\"f08080\",Zcyan:\"e0ffff\",ZgTMnPdLw:\"fafad2\",ZWay:\"d3d3d3\",ZgYF:\"90ee90\",ZgYy:\"d3d3d3\",ZpRk:\"ffb6c1\",ZsOmon:\"ffa07a\",ZsHgYF:\"20b2aa\",ZskyXe:\"87cefa\",ZUWay:\"778899\",ZUgYy:\"778899\",ZstAlXe:\"b0c4de\",ZLw:\"ffffe0\",lime:\"ff00\",limegYF:\"32cd32\",lRF:\"faf0e6\",magFta:\"ff00ff\",maPon:\"800000\",VaquamarRe:\"66cdaa\",VXe:\"cd\",VScEd:\"ba55d3\",VpurpN:\"9370db\",VsHgYF:\"3cb371\",VUXe:\"7b68ee\",VsprRggYF:\"fa9a\",VQe:\"48d1cc\",VviTetYd:\"c71585\",midnightXe:\"191970\",mRtcYam:\"f5fffa\",mistyPse:\"ffe4e1\",moccasR:\"ffe4b5\",navajowEte:\"ffdead\",navy:\"80\",Tdlace:\"fdf5e6\",Tive:\"808000\",TivedBb:\"6b8e23\",Sange:\"ffa500\",SangeYd:\"ff4500\",ScEd:\"da70d6\",pOegTMnPd:\"eee8aa\",pOegYF:\"98fb98\",pOeQe:\"afeeee\",pOeviTetYd:\"db7093\",papayawEp:\"ffefd5\",pHKpuff:\"ffdab9\",peru:\"cd853f\",pRk:\"ffc0cb\",plum:\"dda0dd\",powMrXe:\"b0e0e6\",purpN:\"800080\",YbeccapurpN:\"663399\",Yd:\"ff0000\",Psybrown:\"bc8f8f\",PyOXe:\"4169e1\",saddNbPwn:\"8b4513\",sOmon:\"fa8072\",sandybPwn:\"f4a460\",sHgYF:\"2e8b57\",sHshell:\"fff5ee\",siFna:\"a0522d\",silver:\"c0c0c0\",skyXe:\"87ceeb\",UXe:\"6a5acd\",UWay:\"708090\",UgYy:\"708090\",snow:\"fffafa\",sprRggYF:\"ff7f\",stAlXe:\"4682b4\",tan:\"d2b48c\",teO:\"8080\",tEstN:\"d8bfd8\",tomato:\"ff6347\",Qe:\"40e0d0\",viTet:\"ee82ee\",JHt:\"f5deb3\",wEte:\"ffffff\",wEtesmoke:\"f5f5f5\",Lw:\"ffff00\",LwgYF:\"9acd32\"};function unpack(){let unpacked={},keys=Object.keys(names$1),tkeys=Object.keys(map),i,j,k,ok,nk;for(i=0;i<keys.length;i++){ok=nk=keys[i];for(j=0;j<tkeys.length;j++)k=tkeys[j],nk=nk.replace(k,map[k]);k=parseInt(names$1[ok],16),unpacked[nk]=[k>>16&255,k>>8&255,k&255]}return unpacked}var names;function nameParse(str){if(!names)names=unpack(),names.transparent=[0,0,0,0];let a=names[str.toLowerCase()];return a&&{r:a[0],g:a[1],b:a[2],a:a.length===4?a[3]:255}}var RGB_RE=/^rgba?\\(\\s*([-+.\\d]+)(%)?[\\s,]+([-+.e\\d]+)(%)?[\\s,]+([-+.e\\d]+)(%)?(?:[\\s,/]+([-+.e\\d]+)(%)?)?\\s*\\)$/;function rgbParse(str){let m=RGB_RE.exec(str),a=255,r,g,b;if(!m)return;if(m[7]!==r){let v=+m[7];a=m[8]?p2b(v):lim(v*255,0,255)}return r=+m[1],g=+m[3],b=+m[5],r=255&(m[2]?p2b(r):lim(r,0,255)),g=255&(m[4]?p2b(g):lim(g,0,255)),b=255&(m[6]?p2b(b):lim(b,0,255)),{r,g,b,a}}function rgbString(v){return v&&(v.a<255?`rgba(${v.r}, ${v.g}, ${v.b}, ${b2n(v.a)})`:`rgb(${v.r}, ${v.g}, ${v.b})`)}var to=(v)=>v<=0.0031308?v*12.92:Math.pow(v,0.4166666666666667)*1.055-0.055,from=(v)=>v<=0.04045?v/12.92:Math.pow((v+0.055)/1.055,2.4);function interpolate(rgb1,rgb2,t){let r=from(b2n(rgb1.r)),g=from(b2n(rgb1.g)),b=from(b2n(rgb1.b));return{r:n2b(to(r+t*(from(b2n(rgb2.r))-r))),g:n2b(to(g+t*(from(b2n(rgb2.g))-g))),b:n2b(to(b+t*(from(b2n(rgb2.b))-b))),a:rgb1.a+t*(rgb2.a-rgb1.a)}}function modHSL(v,i,ratio){if(v){let tmp=rgb2hsl(v);tmp[i]=Math.max(0,Math.min(tmp[i]+tmp[i]*ratio,i===0?360:1)),tmp=hsl2rgb(tmp),v.r=tmp[0],v.g=tmp[1],v.b=tmp[2]}}function clone(v,proto){return v?Object.assign(proto||{},v):v}function fromObject(input){var v={r:0,g:0,b:0,a:255};if(Array.isArray(input)){if(input.length>=3){if(v={r:input[0],g:input[1],b:input[2],a:255},input.length>3)v.a=n2b(input[3])}}else v=clone(input,{r:0,g:0,b:0,a:1}),v.a=n2b(v.a);return v}function functionParse(str){if(str.charAt(0)===\"r\")return rgbParse(str);return hueParse(str)}class Color{constructor(input){if(input instanceof Color)return input;let type=typeof input,v;if(type===\"object\")v=fromObject(input);else if(type===\"string\")v=hexParse(input)||nameParse(input)||functionParse(input);this._rgb=v,this._valid=!!v}get valid(){return this._valid}get rgb(){var v=clone(this._rgb);if(v)v.a=b2n(v.a);return v}set rgb(obj){this._rgb=fromObject(obj)}rgbString(){return this._valid?rgbString(this._rgb):void 0}hexString(){return this._valid?hexString(this._rgb):void 0}hslString(){return this._valid?hslString(this._rgb):void 0}mix(color,weight){if(color){let c1=this.rgb,c2=color.rgb,w2,p=weight===w2?0.5:weight,w=2*p-1,a=c1.a-c2.a,w1=((w*a===-1?w:(w+a)/(1+w*a))+1)/2;w2=1-w1,c1.r=255&w1*c1.r+w2*c2.r+0.5,c1.g=255&w1*c1.g+w2*c2.g+0.5,c1.b=255&w1*c1.b+w2*c2.b+0.5,c1.a=p*c1.a+(1-p)*c2.a,this.rgb=c1}return this}interpolate(color,t){if(color)this._rgb=interpolate(this._rgb,color._rgb,t);return this}clone(){return new Color(this.rgb)}alpha(a){return this._rgb.a=n2b(a),this}clearer(ratio){let rgb=this._rgb;return rgb.a*=1-ratio,this}greyscale(){let rgb=this._rgb,val=round(rgb.r*0.3+rgb.g*0.59+rgb.b*0.11);return rgb.r=rgb.g=rgb.b=val,this}opaquer(ratio){let rgb=this._rgb;return rgb.a*=1+ratio,this}negate(){let v=this._rgb;return v.r=255-v.r,v.g=255-v.g,v.b=255-v.b,this}lighten(ratio){return modHSL(this._rgb,2,ratio),this}darken(ratio){return modHSL(this._rgb,2,-ratio),this}saturate(ratio){return modHSL(this._rgb,1,ratio),this}desaturate(ratio){return modHSL(this._rgb,1,-ratio),this}rotate(deg){return rotate(this._rgb,deg),this}}/*!\n * Chart.js v4.5.1\n * https://www.chartjs.org\n * (c) 2025 Chart.js Contributors\n * Released under the MIT License\n */function noop(){}var uid=(()=>{let id=0;return()=>id++})();function isNullOrUndef(value){return value===null||value===void 0}function isArray(value){if(Array.isArray&&Array.isArray(value))return!0;let type=Object.prototype.toString.call(value);if(type.slice(0,7)===\"[object\"&&type.slice(-6)===\"Array]\")return!0;return!1}function isObject(value){return value!==null&&Object.prototype.toString.call(value)===\"[object Object]\"}function isNumberFinite(value){return(typeof value===\"number\"||value instanceof Number)&&isFinite(+value)}function finiteOrDefault(value,defaultValue){return isNumberFinite(value)?value:defaultValue}function valueOrDefault(value,defaultValue){return typeof value>\"u\"?defaultValue:value}var toPercentage=(value,dimension)=>typeof value===\"string\"&&value.endsWith(\"%\")?parseFloat(value)/100:+value/dimension,toDimension=(value,dimension)=>typeof value===\"string\"&&value.endsWith(\"%\")?parseFloat(value)/100*dimension:+value;function callback(fn,args,thisArg){if(fn&&typeof fn.call===\"function\")return fn.apply(thisArg,args)}function each(loopable,fn,thisArg,reverse){let i,len,keys;if(isArray(loopable))if(len=loopable.length,reverse)for(i=len-1;i>=0;i--)fn.call(thisArg,loopable[i],i);else for(i=0;i<len;i++)fn.call(thisArg,loopable[i],i);else if(isObject(loopable)){keys=Object.keys(loopable),len=keys.length;for(i=0;i<len;i++)fn.call(thisArg,loopable[keys[i]],keys[i])}}function _elementsEqual(a0,a1){let i,ilen,v0,v1;if(!a0||!a1||a0.length!==a1.length)return!1;for(i=0,ilen=a0.length;i<ilen;++i)if(v0=a0[i],v1=a1[i],v0.datasetIndex!==v1.datasetIndex||v0.index!==v1.index)return!1;return!0}function clone2(source){if(isArray(source))return source.map(clone2);if(isObject(source)){let target=Object.create(null),keys=Object.keys(source),klen=keys.length,k=0;for(;k<klen;++k)target[keys[k]]=clone2(source[keys[k]]);return target}return source}function isValidKey(key){return[\"__proto__\",\"prototype\",\"constructor\"].indexOf(key)===-1}function _merger(key,target,source,options){if(!isValidKey(key))return;let tval=target[key],sval=source[key];if(isObject(tval)&&isObject(sval))merge(tval,sval,options);else target[key]=clone2(sval)}function merge(target,source,options){let sources=isArray(source)?source:[source],ilen=sources.length;if(!isObject(target))return target;options=options||{};let merger=options.merger||_merger,current;for(let i=0;i<ilen;++i){if(current=sources[i],!isObject(current))continue;let keys=Object.keys(current);for(let k=0,klen=keys.length;k<klen;++k)merger(keys[k],target,current,options)}return target}function mergeIf(target,source){return merge(target,source,{merger:_mergerIf})}function _mergerIf(key,target,source){if(!isValidKey(key))return;let tval=target[key],sval=source[key];if(isObject(tval)&&isObject(sval))mergeIf(tval,sval);else if(!Object.prototype.hasOwnProperty.call(target,key))target[key]=clone2(sval)}var keyResolvers={\"\":(v)=>v,x:(o)=>o.x,y:(o)=>o.y};function _splitKey(key){let parts=key.split(\".\"),keys=[],tmp=\"\";for(let part of parts)if(tmp+=part,tmp.endsWith(\"\\\\\"))tmp=tmp.slice(0,-1)+\".\";else keys.push(tmp),tmp=\"\";return keys}function _getKeyResolver(key){let keys=_splitKey(key);return(obj)=>{for(let k of keys){if(k===\"\")break;obj=obj&&obj[k]}return obj}}function resolveObjectKey(obj,key){return(keyResolvers[key]||(keyResolvers[key]=_getKeyResolver(key)))(obj)}function _capitalize(str){return str.charAt(0).toUpperCase()+str.slice(1)}var defined=(value)=>typeof value<\"u\",isFunction=(value)=>typeof value===\"function\",setsEqual=(a,b)=>{if(a.size!==b.size)return!1;for(let item of a)if(!b.has(item))return!1;return!0};function _isClickEvent(e){return e.type===\"mouseup\"||e.type===\"click\"||e.type===\"contextmenu\"}var PI=Math.PI,TAU=2*PI,PITAU=TAU+PI,INFINITY=Number.POSITIVE_INFINITY,RAD_PER_DEG=PI/180,HALF_PI=PI/2,QUARTER_PI=PI/4,TWO_THIRDS_PI=PI*2/3,log10=Math.log10,sign=Math.sign;function almostEquals(x,y,epsilon){return Math.abs(x-y)<epsilon}function niceNum(range){let roundedRange=Math.round(range);range=almostEquals(range,roundedRange,range/1000)?roundedRange:range;let niceRange=Math.pow(10,Math.floor(log10(range))),fraction=range/niceRange;return(fraction<=1?1:fraction<=2?2:fraction<=5?5:10)*niceRange}function _factorize(value){let result=[],sqrt=Math.sqrt(value),i;for(i=1;i<sqrt;i++)if(value%i===0)result.push(i),result.push(value/i);if(sqrt===(sqrt|0))result.push(sqrt);return result.sort((a,b)=>a-b).pop(),result}function isNonPrimitive(n){return typeof n===\"symbol\"||typeof n===\"object\"&&n!==null&&!((Symbol.toPrimitive in n)||(\"toString\"in n)||(\"valueOf\"in n))}function isNumber(n){return!isNonPrimitive(n)&&!isNaN(parseFloat(n))&&isFinite(n)}function almostWhole(x,epsilon){let rounded=Math.round(x);return rounded-epsilon<=x&&rounded+epsilon>=x}function _setMinAndMaxByKey(array,target,property){let i,ilen,value;for(i=0,ilen=array.length;i<ilen;i++)if(value=array[i][property],!isNaN(value))target.min=Math.min(target.min,value),target.max=Math.max(target.max,value)}function toRadians(degrees){return degrees*(PI/180)}function toDegrees(radians){return radians*(180/PI)}function _decimalPlaces(x){if(!isNumberFinite(x))return;let e=1,p=0;while(Math.round(x*e)/e!==x)e*=10,p++;return p}function getAngleFromPoint(centrePoint,anglePoint){let distanceFromXCenter=anglePoint.x-centrePoint.x,distanceFromYCenter=anglePoint.y-centrePoint.y,radialDistanceFromCenter=Math.sqrt(distanceFromXCenter*distanceFromXCenter+distanceFromYCenter*distanceFromYCenter),angle=Math.atan2(distanceFromYCenter,distanceFromXCenter);if(angle<-0.5*PI)angle+=TAU;return{angle,distance:radialDistanceFromCenter}}function distanceBetweenPoints(pt1,pt2){return Math.sqrt(Math.pow(pt2.x-pt1.x,2)+Math.pow(pt2.y-pt1.y,2))}function _angleDiff(a,b){return(a-b+PITAU)%TAU-PI}function _normalizeAngle(a){return(a%TAU+TAU)%TAU}function _angleBetween(angle,start,end,sameAngleIsFullCircle){let a=_normalizeAngle(angle),s=_normalizeAngle(start),e=_normalizeAngle(end),angleToStart=_normalizeAngle(s-a),angleToEnd=_normalizeAngle(e-a),startToAngle=_normalizeAngle(a-s),endToAngle=_normalizeAngle(a-e);return a===s||a===e||sameAngleIsFullCircle&&s===e||angleToStart>angleToEnd&&startToAngle<endToAngle}function _limitValue(value,min,max){return Math.max(min,Math.min(max,value))}function _int16Range(value){return _limitValue(value,-32768,32767)}function _isBetween(value,start,end,epsilon=0.000001){return value>=Math.min(start,end)-epsilon&&value<=Math.max(start,end)+epsilon}function _lookup(table,value,cmp){cmp=cmp||((index)=>table[index]<value);let hi=table.length-1,lo=0,mid;while(hi-lo>1)if(mid=lo+hi>>1,cmp(mid))lo=mid;else hi=mid;return{lo,hi}}var _lookupByKey=(table,key,value,last)=>_lookup(table,value,last?(index)=>{let ti=table[index][key];return ti<value||ti===value&&table[index+1][key]===value}:(index)=>table[index][key]<value),_rlookupByKey=(table,key,value)=>_lookup(table,value,(index)=>table[index][key]>=value);function _filterBetween(values,min,max){let start=0,end=values.length;while(start<end&&values[start]<min)start++;while(end>start&&values[end-1]>max)end--;return start>0||end<values.length?values.slice(start,end):values}var arrayEvents=[\"push\",\"pop\",\"shift\",\"splice\",\"unshift\"];function listenArrayEvents(array,listener){if(array._chartjs){array._chartjs.listeners.push(listener);return}Object.defineProperty(array,\"_chartjs\",{configurable:!0,enumerable:!1,value:{listeners:[listener]}}),arrayEvents.forEach((key)=>{let method=\"_onData\"+_capitalize(key),base=array[key];Object.defineProperty(array,key,{configurable:!0,enumerable:!1,value(...args){let res=base.apply(this,args);return array._chartjs.listeners.forEach((object)=>{if(typeof object[method]===\"function\")object[method](...args)}),res}})})}function unlistenArrayEvents(array,listener){let stub=array._chartjs;if(!stub)return;let listeners=stub.listeners,index=listeners.indexOf(listener);if(index!==-1)listeners.splice(index,1);if(listeners.length>0)return;arrayEvents.forEach((key)=>{delete array[key]}),delete array._chartjs}function _arrayUnique(items){let set=new Set(items);if(set.size===items.length)return items;return Array.from(set)}var requestAnimFrame=function(){if(typeof window>\"u\")return function(callback2){return callback2()};return window.requestAnimationFrame}();function throttled(fn,thisArg){let argsToUse=[],ticking=!1;return function(...args){if(argsToUse=args,!ticking)ticking=!0,requestAnimFrame.call(window,()=>{ticking=!1,fn.apply(thisArg,argsToUse)})}}function debounce(fn,delay){let timeout;return function(...args){if(delay)clearTimeout(timeout),timeout=setTimeout(fn,delay,args);else fn.apply(this,args);return delay}}var _toLeftRightCenter=(align)=>align===\"start\"?\"left\":align===\"end\"?\"right\":\"center\",_alignStartEnd=(align,start,end)=>align===\"start\"?start:align===\"end\"?end:(start+end)/2,_textX=(align,left,right,rtl)=>{return align===(rtl?\"left\":\"right\")?right:align===\"center\"?(left+right)/2:left};function _getStartAndCountOfVisiblePoints(meta,points,animationsDisabled){let pointCount=points.length,start=0,count=pointCount;if(meta._sorted){let{iScale,vScale,_parsed}=meta,spanGaps=meta.dataset?meta.dataset.options?meta.dataset.options.spanGaps:null:null,axis=iScale.axis,{min,max,minDefined,maxDefined}=iScale.getUserBounds();if(minDefined){if(start=Math.min(_lookupByKey(_parsed,axis,min).lo,animationsDisabled?pointCount:_lookupByKey(points,axis,iScale.getPixelForValue(min)).lo),spanGaps){let distanceToDefinedLo=_parsed.slice(0,start+1).reverse().findIndex((point)=>!isNullOrUndef(point[vScale.axis]));start-=Math.max(0,distanceToDefinedLo)}start=_limitValue(start,0,pointCount-1)}if(maxDefined){let end=Math.max(_lookupByKey(_parsed,iScale.axis,max,!0).hi+1,animationsDisabled?0:_lookupByKey(points,axis,iScale.getPixelForValue(max),!0).hi+1);if(spanGaps){let distanceToDefinedHi=_parsed.slice(end-1).findIndex((point)=>!isNullOrUndef(point[vScale.axis]));end+=Math.max(0,distanceToDefinedHi)}count=_limitValue(end,start,pointCount)-start}else count=pointCount-start}return{start,count}}function _scaleRangesChanged(meta){let{xScale,yScale,_scaleRanges}=meta,newRanges={xmin:xScale.min,xmax:xScale.max,ymin:yScale.min,ymax:yScale.max};if(!_scaleRanges)return meta._scaleRanges=newRanges,!0;let changed=_scaleRanges.xmin!==xScale.min||_scaleRanges.xmax!==xScale.max||_scaleRanges.ymin!==yScale.min||_scaleRanges.ymax!==yScale.max;return Object.assign(_scaleRanges,newRanges),changed}var atEdge=(t)=>t===0||t===1,elasticIn=(t,s,p)=>-(Math.pow(2,10*(t-=1))*Math.sin((t-s)*TAU/p)),elasticOut=(t,s,p)=>Math.pow(2,-10*t)*Math.sin((t-s)*TAU/p)+1,effects={linear:(t)=>t,easeInQuad:(t)=>t*t,easeOutQuad:(t)=>-t*(t-2),easeInOutQuad:(t)=>(t/=0.5)<1?0.5*t*t:-0.5*(--t*(t-2)-1),easeInCubic:(t)=>t*t*t,easeOutCubic:(t)=>(t-=1)*t*t+1,easeInOutCubic:(t)=>(t/=0.5)<1?0.5*t*t*t:0.5*((t-=2)*t*t+2),easeInQuart:(t)=>t*t*t*t,easeOutQuart:(t)=>-((t-=1)*t*t*t-1),easeInOutQuart:(t)=>(t/=0.5)<1?0.5*t*t*t*t:-0.5*((t-=2)*t*t*t-2),easeInQuint:(t)=>t*t*t*t*t,easeOutQuint:(t)=>(t-=1)*t*t*t*t+1,easeInOutQuint:(t)=>(t/=0.5)<1?0.5*t*t*t*t*t:0.5*((t-=2)*t*t*t*t+2),easeInSine:(t)=>-Math.cos(t*HALF_PI)+1,easeOutSine:(t)=>Math.sin(t*HALF_PI),easeInOutSine:(t)=>-0.5*(Math.cos(PI*t)-1),easeInExpo:(t)=>t===0?0:Math.pow(2,10*(t-1)),easeOutExpo:(t)=>t===1?1:-Math.pow(2,-10*t)+1,easeInOutExpo:(t)=>atEdge(t)?t:t<0.5?0.5*Math.pow(2,10*(t*2-1)):0.5*(-Math.pow(2,-10*(t*2-1))+2),easeInCirc:(t)=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:(t)=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:(t)=>(t/=0.5)<1?-0.5*(Math.sqrt(1-t*t)-1):0.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:(t)=>atEdge(t)?t:elasticIn(t,0.075,0.3),easeOutElastic:(t)=>atEdge(t)?t:elasticOut(t,0.075,0.3),easeInOutElastic(t){return atEdge(t)?t:t<0.5?0.5*elasticIn(t*2,0.1125,0.45):0.5+0.5*elasticOut(t*2-1,0.1125,0.45)},easeInBack(t){return t*t*(2.70158*t-1.70158)},easeOutBack(t){return(t-=1)*t*(2.70158*t+1.70158)+1},easeInOutBack(t){let s=1.70158;if((t/=0.5)<1)return 0.5*(t*t*(((s*=1.525)+1)*t-s));return 0.5*((t-=2)*t*(((s*=1.525)+1)*t+s)+2)},easeInBounce:(t)=>1-effects.easeOutBounce(1-t),easeOutBounce(t){if(t<0.36363636363636365)return 7.5625*t*t;if(t<0.7272727272727273)return 7.5625*(t-=0.5454545454545454)*t+0.75;if(t<0.9090909090909091)return 7.5625*(t-=0.8181818181818182)*t+0.9375;return 7.5625*(t-=0.9545454545454546)*t+0.984375},easeInOutBounce:(t)=>t<0.5?effects.easeInBounce(t*2)*0.5:effects.easeOutBounce(t*2-1)*0.5+0.5};function isPatternOrGradient(value){if(value&&typeof value===\"object\"){let type=value.toString();return type===\"[object CanvasPattern]\"||type===\"[object CanvasGradient]\"}return!1}function color(value){return isPatternOrGradient(value)?value:new Color(value)}function getHoverColor(value){return isPatternOrGradient(value)?value:new Color(value).saturate(0.5).darken(0.1).hexString()}var numbers=[\"x\",\"y\",\"borderWidth\",\"radius\",\"tension\"],colors=[\"color\",\"borderColor\",\"backgroundColor\"];function applyAnimationsDefaults(defaults){defaults.set(\"animation\",{delay:void 0,duration:1000,easing:\"easeOutQuart\",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),defaults.describe(\"animation\",{_fallback:!1,_indexable:!1,_scriptable:(name)=>name!==\"onProgress\"&&name!==\"onComplete\"&&name!==\"fn\"}),defaults.set(\"animations\",{colors:{type:\"color\",properties:colors},numbers:{type:\"number\",properties:numbers}}),defaults.describe(\"animations\",{_fallback:\"animation\"}),defaults.set(\"transitions\",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:\"transparent\"},visible:{type:\"boolean\",duration:0}}},hide:{animations:{colors:{to:\"transparent\"},visible:{type:\"boolean\",easing:\"linear\",fn:(v)=>v|0}}}})}function applyLayoutsDefaults(defaults){defaults.set(\"layout\",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}var intlCache=new Map;function getNumberFormat(locale,options){options=options||{};let cacheKey=locale+JSON.stringify(options),formatter=intlCache.get(cacheKey);if(!formatter)formatter=new Intl.NumberFormat(locale,options),intlCache.set(cacheKey,formatter);return formatter}function formatNumber(num,locale,options){return getNumberFormat(locale,options).format(num)}var formatters={values(value){return isArray(value)?value:\"\"+value},numeric(tickValue,index,ticks){if(tickValue===0)return\"0\";let locale=this.chart.options.locale,notation,delta=tickValue;if(ticks.length>1){let maxTick=Math.max(Math.abs(ticks[0].value),Math.abs(ticks[ticks.length-1].value));if(maxTick<0.0001||maxTick>1000000000000000)notation=\"scientific\";delta=calculateDelta(tickValue,ticks)}let logDelta=log10(Math.abs(delta)),numDecimal=isNaN(logDelta)?1:Math.max(Math.min(-1*Math.floor(logDelta),20),0),options={notation,minimumFractionDigits:numDecimal,maximumFractionDigits:numDecimal};return Object.assign(options,this.options.ticks.format),formatNumber(tickValue,locale,options)},logarithmic(tickValue,index,ticks){if(tickValue===0)return\"0\";let remain=ticks[index].significand||tickValue/Math.pow(10,Math.floor(log10(tickValue)));if([1,2,3,5,10,15].includes(remain)||index>0.8*ticks.length)return formatters.numeric.call(this,tickValue,index,ticks);return\"\"}};function calculateDelta(tickValue,ticks){let delta=ticks.length>3?ticks[2].value-ticks[1].value:ticks[1].value-ticks[0].value;if(Math.abs(delta)>=1&&tickValue!==Math.floor(tickValue))delta=tickValue-Math.floor(tickValue);return delta}var Ticks={formatters};function applyScaleDefaults(defaults){defaults.set(\"scale\",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:\"ticks\",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(_ctx,options)=>options.lineWidth,tickColor:(_ctx,options)=>options.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:\"\",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:\"\",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Ticks.formatters.values,minor:{},major:{},align:\"center\",crossAlign:\"near\",showLabelBackdrop:!1,backdropColor:\"rgba(255, 255, 255, 0.75)\",backdropPadding:2}}),defaults.route(\"scale.ticks\",\"color\",\"\",\"color\"),defaults.route(\"scale.grid\",\"color\",\"\",\"borderColor\"),defaults.route(\"scale.border\",\"color\",\"\",\"borderColor\"),defaults.route(\"scale.title\",\"color\",\"\",\"color\"),defaults.describe(\"scale\",{_fallback:!1,_scriptable:(name)=>!name.startsWith(\"before\")&&!name.startsWith(\"after\")&&name!==\"callback\"&&name!==\"parser\",_indexable:(name)=>name!==\"borderDash\"&&name!==\"tickBorderDash\"&&name!==\"dash\"}),defaults.describe(\"scales\",{_fallback:\"scale\"}),defaults.describe(\"scale.ticks\",{_scriptable:(name)=>name!==\"backdropPadding\"&&name!==\"callback\",_indexable:(name)=>name!==\"backdropPadding\"})}var overrides=Object.create(null),descriptors=Object.create(null);function getScope$1(node,key){if(!key)return node;let keys=key.split(\".\");for(let i=0,n=keys.length;i<n;++i){let k=keys[i];node=node[k]||(node[k]=Object.create(null))}return node}function set(root,scope,values){if(typeof scope===\"string\")return merge(getScope$1(root,scope),values);return merge(getScope$1(root,\"\"),scope)}class Defaults{constructor(_descriptors,_appliers){this.animation=void 0,this.backgroundColor=\"rgba(0,0,0,0.1)\",this.borderColor=\"rgba(0,0,0,0.1)\",this.color=\"#666\",this.datasets={},this.devicePixelRatio=(context)=>context.chart.platform.getDevicePixelRatio(),this.elements={},this.events=[\"mousemove\",\"mouseout\",\"click\",\"touchstart\",\"touchmove\"],this.font={family:\"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif\",size:12,style:\"normal\",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(ctx,options)=>getHoverColor(options.backgroundColor),this.hoverBorderColor=(ctx,options)=>getHoverColor(options.borderColor),this.hoverColor=(ctx,options)=>getHoverColor(options.color),this.indexAxis=\"x\",this.interaction={mode:\"nearest\",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(_descriptors),this.apply(_appliers)}set(scope,values){return set(this,scope,values)}get(scope){return getScope$1(this,scope)}describe(scope,values){return set(descriptors,scope,values)}override(scope,values){return set(overrides,scope,values)}route(scope,name,targetScope,targetName){let scopeObject=getScope$1(this,scope),targetScopeObject=getScope$1(this,targetScope),privateName=\"_\"+name;Object.defineProperties(scopeObject,{[privateName]:{value:scopeObject[name],writable:!0},[name]:{enumerable:!0,get(){let local=this[privateName],target=targetScopeObject[targetName];if(isObject(local))return Object.assign({},target,local);return valueOrDefault(local,target)},set(value){this[privateName]=value}}})}apply(appliers){appliers.forEach((apply)=>apply(this))}}var defaults=new Defaults({_scriptable:(name)=>!name.startsWith(\"on\"),_indexable:(name)=>name!==\"events\",hover:{_fallback:\"interaction\"},interaction:{_scriptable:!1,_indexable:!1}},[applyAnimationsDefaults,applyLayoutsDefaults,applyScaleDefaults]);function toFontString(font){if(!font||isNullOrUndef(font.size)||isNullOrUndef(font.family))return null;return(font.style?font.style+\" \":\"\")+(font.weight?font.weight+\" \":\"\")+font.size+\"px \"+font.family}function _measureText(ctx,data,gc,longest,string){let textWidth=data[string];if(!textWidth)textWidth=data[string]=ctx.measureText(string).width,gc.push(string);if(textWidth>longest)longest=textWidth;return longest}function _longestText(ctx,font,arrayOfThings,cache){cache=cache||{};let data=cache.data=cache.data||{},gc=cache.garbageCollect=cache.garbageCollect||[];if(cache.font!==font)data=cache.data={},gc=cache.garbageCollect=[],cache.font=font;ctx.save(),ctx.font=font;let longest=0,ilen=arrayOfThings.length,i,j,jlen,thing,nestedThing;for(i=0;i<ilen;i++)if(thing=arrayOfThings[i],thing!==void 0&&thing!==null&&!isArray(thing))longest=_measureText(ctx,data,gc,longest,thing);else if(isArray(thing)){for(j=0,jlen=thing.length;j<jlen;j++)if(nestedThing=thing[j],nestedThing!==void 0&&nestedThing!==null&&!isArray(nestedThing))longest=_measureText(ctx,data,gc,longest,nestedThing)}ctx.restore();let gcLen=gc.length/2;if(gcLen>arrayOfThings.length){for(i=0;i<gcLen;i++)delete data[gc[i]];gc.splice(0,gcLen)}return longest}function _alignPixel(chart,pixel,width){let devicePixelRatio=chart.currentDevicePixelRatio,halfWidth=width!==0?Math.max(width/2,0.5):0;return Math.round((pixel-halfWidth)*devicePixelRatio)/devicePixelRatio+halfWidth}function clearCanvas(canvas,ctx){if(!ctx&&!canvas)return;ctx=ctx||canvas.getContext(\"2d\"),ctx.save(),ctx.resetTransform(),ctx.clearRect(0,0,canvas.width,canvas.height),ctx.restore()}function drawPoint(ctx,options,x,y){drawPointLegend(ctx,options,x,y,null)}function drawPointLegend(ctx,options,x,y,w){let type,xOffset,yOffset,size,cornerRadius,width,xOffsetW,yOffsetW,style=options.pointStyle,rotation=options.rotation,radius=options.radius,rad=(rotation||0)*RAD_PER_DEG;if(style&&typeof style===\"object\"){if(type=style.toString(),type===\"[object HTMLImageElement]\"||type===\"[object HTMLCanvasElement]\"){ctx.save(),ctx.translate(x,y),ctx.rotate(rad),ctx.drawImage(style,-style.width/2,-style.height/2,style.width,style.height),ctx.restore();return}}if(isNaN(radius)||radius<=0)return;switch(ctx.beginPath(),style){default:if(w)ctx.ellipse(x,y,w/2,radius,0,0,TAU);else ctx.arc(x,y,radius,0,TAU);ctx.closePath();break;case\"triangle\":width=w?w/2:radius,ctx.moveTo(x+Math.sin(rad)*width,y-Math.cos(rad)*radius),rad+=TWO_THIRDS_PI,ctx.lineTo(x+Math.sin(rad)*width,y-Math.cos(rad)*radius),rad+=TWO_THIRDS_PI,ctx.lineTo(x+Math.sin(rad)*width,y-Math.cos(rad)*radius),ctx.closePath();break;case\"rectRounded\":cornerRadius=radius*0.516,size=radius-cornerRadius,xOffset=Math.cos(rad+QUARTER_PI)*size,xOffsetW=Math.cos(rad+QUARTER_PI)*(w?w/2-cornerRadius:size),yOffset=Math.sin(rad+QUARTER_PI)*size,yOffsetW=Math.sin(rad+QUARTER_PI)*(w?w/2-cornerRadius:size),ctx.arc(x-xOffsetW,y-yOffset,cornerRadius,rad-PI,rad-HALF_PI),ctx.arc(x+yOffsetW,y-xOffset,cornerRadius,rad-HALF_PI,rad),ctx.arc(x+xOffsetW,y+yOffset,cornerRadius,rad,rad+HALF_PI),ctx.arc(x-yOffsetW,y+xOffset,cornerRadius,rad+HALF_PI,rad+PI),ctx.closePath();break;case\"rect\":if(!rotation){size=Math.SQRT1_2*radius,width=w?w/2:size,ctx.rect(x-width,y-size,2*width,2*size);break}rad+=QUARTER_PI;case\"rectRot\":xOffsetW=Math.cos(rad)*(w?w/2:radius),xOffset=Math.cos(rad)*radius,yOffset=Math.sin(rad)*radius,yOffsetW=Math.sin(rad)*(w?w/2:radius),ctx.moveTo(x-xOffsetW,y-yOffset),ctx.lineTo(x+yOffsetW,y-xOffset),ctx.lineTo(x+xOffsetW,y+yOffset),ctx.lineTo(x-yOffsetW,y+xOffset),ctx.closePath();break;case\"crossRot\":rad+=QUARTER_PI;case\"cross\":xOffsetW=Math.cos(rad)*(w?w/2:radius),xOffset=Math.cos(rad)*radius,yOffset=Math.sin(rad)*radius,yOffsetW=Math.sin(rad)*(w?w/2:radius),ctx.moveTo(x-xOffsetW,y-yOffset),ctx.lineTo(x+xOffsetW,y+yOffset),ctx.moveTo(x+yOffsetW,y-xOffset),ctx.lineTo(x-yOffsetW,y+xOffset);break;case\"star\":xOffsetW=Math.cos(rad)*(w?w/2:radius),xOffset=Math.cos(rad)*radius,yOffset=Math.sin(rad)*radius,yOffsetW=Math.sin(rad)*(w?w/2:radius),ctx.moveTo(x-xOffsetW,y-yOffset),ctx.lineTo(x+xOffsetW,y+yOffset),ctx.moveTo(x+yOffsetW,y-xOffset),ctx.lineTo(x-yOffsetW,y+xOffset),rad+=QUARTER_PI,xOffsetW=Math.cos(rad)*(w?w/2:radius),xOffset=Math.cos(rad)*radius,yOffset=Math.sin(rad)*radius,yOffsetW=Math.sin(rad)*(w?w/2:radius),ctx.moveTo(x-xOffsetW,y-yOffset),ctx.lineTo(x+xOffsetW,y+yOffset),ctx.moveTo(x+yOffsetW,y-xOffset),ctx.lineTo(x-yOffsetW,y+xOffset);break;case\"line\":xOffset=w?w/2:Math.cos(rad)*radius,yOffset=Math.sin(rad)*radius,ctx.moveTo(x-xOffset,y-yOffset),ctx.lineTo(x+xOffset,y+yOffset);break;case\"dash\":ctx.moveTo(x,y),ctx.lineTo(x+Math.cos(rad)*(w?w/2:radius),y+Math.sin(rad)*radius);break;case!1:ctx.closePath();break}if(ctx.fill(),options.borderWidth>0)ctx.stroke()}function _isPointInArea(point,area,margin){return margin=margin||0.5,!area||point&&point.x>area.left-margin&&point.x<area.right+margin&&point.y>area.top-margin&&point.y<area.bottom+margin}function clipArea(ctx,area){ctx.save(),ctx.beginPath(),ctx.rect(area.left,area.top,area.right-area.left,area.bottom-area.top),ctx.clip()}function unclipArea(ctx){ctx.restore()}function _steppedLineTo(ctx,previous,target,flip,mode){if(!previous)return ctx.lineTo(target.x,target.y);if(mode===\"middle\"){let midpoint=(previous.x+target.x)/2;ctx.lineTo(midpoint,previous.y),ctx.lineTo(midpoint,target.y)}else if(mode===\"after\"!==!!flip)ctx.lineTo(previous.x,target.y);else ctx.lineTo(target.x,previous.y);ctx.lineTo(target.x,target.y)}function _bezierCurveTo(ctx,previous,target,flip){if(!previous)return ctx.lineTo(target.x,target.y);ctx.bezierCurveTo(flip?previous.cp1x:previous.cp2x,flip?previous.cp1y:previous.cp2y,flip?target.cp2x:target.cp1x,flip?target.cp2y:target.cp1y,target.x,target.y)}function setRenderOpts(ctx,opts){if(opts.translation)ctx.translate(opts.translation[0],opts.translation[1]);if(!isNullOrUndef(opts.rotation))ctx.rotate(opts.rotation);if(opts.color)ctx.fillStyle=opts.color;if(opts.textAlign)ctx.textAlign=opts.textAlign;if(opts.textBaseline)ctx.textBaseline=opts.textBaseline}function decorateText(ctx,x,y,line,opts){if(opts.strikethrough||opts.underline){let metrics=ctx.measureText(line),left=x-metrics.actualBoundingBoxLeft,right=x+metrics.actualBoundingBoxRight,top=y-metrics.actualBoundingBoxAscent,bottom=y+metrics.actualBoundingBoxDescent,yDecoration=opts.strikethrough?(top+bottom)/2:bottom;ctx.strokeStyle=ctx.fillStyle,ctx.beginPath(),ctx.lineWidth=opts.decorationWidth||2,ctx.moveTo(left,yDecoration),ctx.lineTo(right,yDecoration),ctx.stroke()}}function drawBackdrop(ctx,opts){let oldColor=ctx.fillStyle;ctx.fillStyle=opts.color,ctx.fillRect(opts.left,opts.top,opts.width,opts.height),ctx.fillStyle=oldColor}function renderText(ctx,text,x,y,font,opts={}){let lines=isArray(text)?text:[text],stroke=opts.strokeWidth>0&&opts.strokeColor!==\"\",i,line;ctx.save(),ctx.font=font.string,setRenderOpts(ctx,opts);for(i=0;i<lines.length;++i){if(line=lines[i],opts.backdrop)drawBackdrop(ctx,opts.backdrop);if(stroke){if(opts.strokeColor)ctx.strokeStyle=opts.strokeColor;if(!isNullOrUndef(opts.strokeWidth))ctx.lineWidth=opts.strokeWidth;ctx.strokeText(line,x,y,opts.maxWidth)}ctx.fillText(line,x,y,opts.maxWidth),decorateText(ctx,x,y,line,opts),y+=Number(font.lineHeight)}ctx.restore()}function addRoundedRectPath(ctx,rect){let{x,y,w,h,radius}=rect;ctx.arc(x+radius.topLeft,y+radius.topLeft,radius.topLeft,1.5*PI,PI,!0),ctx.lineTo(x,y+h-radius.bottomLeft),ctx.arc(x+radius.bottomLeft,y+h-radius.bottomLeft,radius.bottomLeft,PI,HALF_PI,!0),ctx.lineTo(x+w-radius.bottomRight,y+h),ctx.arc(x+w-radius.bottomRight,y+h-radius.bottomRight,radius.bottomRight,HALF_PI,0,!0),ctx.lineTo(x+w,y+radius.topRight),ctx.arc(x+w-radius.topRight,y+radius.topRight,radius.topRight,0,-HALF_PI,!0),ctx.lineTo(x+radius.topLeft,y)}var LINE_HEIGHT=/^(normal|(\\d+(?:\\.\\d+)?)(px|em|%)?)$/,FONT_STYLE=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function toLineHeight(value,size){let matches=(\"\"+value).match(LINE_HEIGHT);if(!matches||matches[1]===\"normal\")return size*1.2;switch(value=+matches[2],matches[3]){case\"px\":return value;case\"%\":value/=100;break}return size*value}var numberOrZero=(v)=>+v||0;function _readValueToProps(value,props){let ret={},objProps=isObject(props),keys=objProps?Object.keys(props):props,read=isObject(value)?objProps?(prop)=>valueOrDefault(value[prop],value[props[prop]]):(prop)=>value[prop]:()=>value;for(let prop of keys)ret[prop]=numberOrZero(read(prop));return ret}function toTRBL(value){return _readValueToProps(value,{top:\"y\",right:\"x\",bottom:\"y\",left:\"x\"})}function toTRBLCorners(value){return _readValueToProps(value,[\"topLeft\",\"topRight\",\"bottomLeft\",\"bottomRight\"])}function toPadding(value){let obj=toTRBL(value);return obj.width=obj.left+obj.right,obj.height=obj.top+obj.bottom,obj}function toFont(options,fallback){options=options||{},fallback=fallback||defaults.font;let size=valueOrDefault(options.size,fallback.size);if(typeof size===\"string\")size=parseInt(size,10);let style=valueOrDefault(options.style,fallback.style);if(style&&!(\"\"+style).match(FONT_STYLE))console.warn('Invalid font style specified: \"'+style+'\"'),style=void 0;let font={family:valueOrDefault(options.family,fallback.family),lineHeight:toLineHeight(valueOrDefault(options.lineHeight,fallback.lineHeight),size),size,style,weight:valueOrDefault(options.weight,fallback.weight),string:\"\"};return font.string=toFontString(font),font}function resolve(inputs,context,index,info){let cacheable=!0,i,ilen,value;for(i=0,ilen=inputs.length;i<ilen;++i){if(value=inputs[i],value===void 0)continue;if(context!==void 0&&typeof value===\"function\")value=value(context),cacheable=!1;if(index!==void 0&&isArray(value))value=value[index%value.length],cacheable=!1;if(value!==void 0){if(info&&!cacheable)info.cacheable=!1;return value}}}function _addGrace(minmax,grace,beginAtZero){let{min,max}=minmax,change=toDimension(grace,(max-min)/2),keepZero=(value,add)=>beginAtZero&&value===0?0:value+add;return{min:keepZero(min,-Math.abs(change)),max:keepZero(max,change)}}function createContext(parentContext,context){return Object.assign(Object.create(parentContext),context)}function _createResolver(scopes,prefixes=[\"\"],rootScopes,fallback,getTarget=()=>scopes[0]){let finalRootScopes=rootScopes||scopes;if(typeof fallback>\"u\")fallback=_resolve(\"_fallback\",scopes);let cache={[Symbol.toStringTag]:\"Object\",_cacheable:!0,_scopes:scopes,_rootScopes:finalRootScopes,_fallback:fallback,_getTarget:getTarget,override:(scope)=>_createResolver([scope,...scopes],prefixes,finalRootScopes,fallback)};return new Proxy(cache,{deleteProperty(target,prop){return delete target[prop],delete target._keys,delete scopes[0][prop],!0},get(target,prop){return _cached(target,prop,()=>_resolveWithPrefixes(prop,prefixes,scopes,target))},getOwnPropertyDescriptor(target,prop){return Reflect.getOwnPropertyDescriptor(target._scopes[0],prop)},getPrototypeOf(){return Reflect.getPrototypeOf(scopes[0])},has(target,prop){return getKeysFromAllScopes(target).includes(prop)},ownKeys(target){return getKeysFromAllScopes(target)},set(target,prop,value){let storage=target._storage||(target._storage=getTarget());return target[prop]=storage[prop]=value,delete target._keys,!0}})}function _attachContext(proxy,context,subProxy,descriptorDefaults){let cache={_cacheable:!1,_proxy:proxy,_context:context,_subProxy:subProxy,_stack:new Set,_descriptors:_descriptors(proxy,descriptorDefaults),setContext:(ctx)=>_attachContext(proxy,ctx,subProxy,descriptorDefaults),override:(scope)=>_attachContext(proxy.override(scope),context,subProxy,descriptorDefaults)};return new Proxy(cache,{deleteProperty(target,prop){return delete target[prop],delete proxy[prop],!0},get(target,prop,receiver){return _cached(target,prop,()=>_resolveWithContext(target,prop,receiver))},getOwnPropertyDescriptor(target,prop){return target._descriptors.allKeys?Reflect.has(proxy,prop)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(proxy,prop)},getPrototypeOf(){return Reflect.getPrototypeOf(proxy)},has(target,prop){return Reflect.has(proxy,prop)},ownKeys(){return Reflect.ownKeys(proxy)},set(target,prop,value){return proxy[prop]=value,delete target[prop],!0}})}function _descriptors(proxy,defaults2={scriptable:!0,indexable:!0}){let{_scriptable=defaults2.scriptable,_indexable=defaults2.indexable,_allKeys=defaults2.allKeys}=proxy;return{allKeys:_allKeys,scriptable:_scriptable,indexable:_indexable,isScriptable:isFunction(_scriptable)?_scriptable:()=>_scriptable,isIndexable:isFunction(_indexable)?_indexable:()=>_indexable}}var readKey=(prefix,name)=>prefix?prefix+_capitalize(name):name,needsSubResolver=(prop,value)=>isObject(value)&&prop!==\"adapters\"&&(Object.getPrototypeOf(value)===null||value.constructor===Object);function _cached(target,prop,resolve2){if(Object.prototype.hasOwnProperty.call(target,prop)||prop===\"constructor\")return target[prop];let value=resolve2();return target[prop]=value,value}function _resolveWithContext(target,prop,receiver){let{_proxy,_context,_subProxy,_descriptors:descriptors2}=target,value=_proxy[prop];if(isFunction(value)&&descriptors2.isScriptable(prop))value=_resolveScriptable(prop,value,target,receiver);if(isArray(value)&&value.length)value=_resolveArray(prop,value,target,descriptors2.isIndexable);if(needsSubResolver(prop,value))value=_attachContext(value,_context,_subProxy&&_subProxy[prop],descriptors2);return value}function _resolveScriptable(prop,getValue,target,receiver){let{_proxy,_context,_subProxy,_stack}=target;if(_stack.has(prop))throw Error(\"Recursion detected: \"+Array.from(_stack).join(\"->\")+\"->\"+prop);_stack.add(prop);let value=getValue(_context,_subProxy||receiver);if(_stack.delete(prop),needsSubResolver(prop,value))value=createSubResolver(_proxy._scopes,_proxy,prop,value);return value}function _resolveArray(prop,value,target,isIndexable){let{_proxy,_context,_subProxy,_descriptors:descriptors2}=target;if(typeof _context.index<\"u\"&&isIndexable(prop))return value[_context.index%value.length];else if(isObject(value[0])){let arr=value,scopes=_proxy._scopes.filter((s)=>s!==arr);value=[];for(let item of arr){let resolver=createSubResolver(scopes,_proxy,prop,item);value.push(_attachContext(resolver,_context,_subProxy&&_subProxy[prop],descriptors2))}}return value}function resolveFallback(fallback,prop,value){return isFunction(fallback)?fallback(prop,value):fallback}var getScope=(key,parent)=>key===!0?parent:typeof key===\"string\"?resolveObjectKey(parent,key):void 0;function addScopes(set2,parentScopes,key,parentFallback,value){for(let parent of parentScopes){let scope=getScope(key,parent);if(scope){set2.add(scope);let fallback=resolveFallback(scope._fallback,key,value);if(typeof fallback<\"u\"&&fallback!==key&&fallback!==parentFallback)return fallback}else if(scope===!1&&typeof parentFallback<\"u\"&&key!==parentFallback)return null}return!1}function createSubResolver(parentScopes,resolver,prop,value){let rootScopes=resolver._rootScopes,fallback=resolveFallback(resolver._fallback,prop,value),allScopes=[...parentScopes,...rootScopes],set2=new Set;set2.add(value);let key=addScopesFromKey(set2,allScopes,prop,fallback||prop,value);if(key===null)return!1;if(typeof fallback<\"u\"&&fallback!==prop){if(key=addScopesFromKey(set2,allScopes,fallback,key,value),key===null)return!1}return _createResolver(Array.from(set2),[\"\"],rootScopes,fallback,()=>subGetTarget(resolver,prop,value))}function addScopesFromKey(set2,allScopes,key,fallback,item){while(key)key=addScopes(set2,allScopes,key,fallback,item);return key}function subGetTarget(resolver,prop,value){let parent=resolver._getTarget();if(!(prop in parent))parent[prop]={};let target=parent[prop];if(isArray(target)&&isObject(value))return value;return target||{}}function _resolveWithPrefixes(prop,prefixes,scopes,proxy){let value;for(let prefix of prefixes)if(value=_resolve(readKey(prefix,prop),scopes),typeof value<\"u\")return needsSubResolver(prop,value)?createSubResolver(scopes,proxy,prop,value):value}function _resolve(key,scopes){for(let scope of scopes){if(!scope)continue;let value=scope[key];if(typeof value<\"u\")return value}}function getKeysFromAllScopes(target){let keys=target._keys;if(!keys)keys=target._keys=resolveKeysFromAllScopes(target._scopes);return keys}function resolveKeysFromAllScopes(scopes){let set2=new Set;for(let scope of scopes)for(let key of Object.keys(scope).filter((k)=>!k.startsWith(\"_\")))set2.add(key);return Array.from(set2)}function _parseObjectDataRadialScale(meta,data,start,count){let{iScale}=meta,{key=\"r\"}=this._parsing,parsed=Array(count),i,ilen,index,item;for(i=0,ilen=count;i<ilen;++i)index=i+start,item=data[index],parsed[i]={r:iScale.parse(resolveObjectKey(item,key),index)};return parsed}var EPSILON=Number.EPSILON||0.00000000000001,getPoint=(points,i)=>i<points.length&&!points[i].skip&&points[i],getValueAxis=(indexAxis)=>indexAxis===\"x\"?\"y\":\"x\";function splineCurve(firstPoint,middlePoint,afterPoint,t){let previous=firstPoint.skip?middlePoint:firstPoint,current=middlePoint,next=afterPoint.skip?middlePoint:afterPoint,d01=distanceBetweenPoints(current,previous),d12=distanceBetweenPoints(next,current),s01=d01/(d01+d12),s12=d12/(d01+d12);s01=isNaN(s01)?0:s01,s12=isNaN(s12)?0:s12;let fa=t*s01,fb=t*s12;return{previous:{x:current.x-fa*(next.x-previous.x),y:current.y-fa*(next.y-previous.y)},next:{x:current.x+fb*(next.x-previous.x),y:current.y+fb*(next.y-previous.y)}}}function monotoneAdjust(points,deltaK,mK){let pointsLen=points.length,alphaK,betaK,tauK,squaredMagnitude,pointCurrent,pointAfter=getPoint(points,0);for(let i=0;i<pointsLen-1;++i){if(pointCurrent=pointAfter,pointAfter=getPoint(points,i+1),!pointCurrent||!pointAfter)continue;if(almostEquals(deltaK[i],0,EPSILON)){mK[i]=mK[i+1]=0;continue}if(alphaK=mK[i]/deltaK[i],betaK=mK[i+1]/deltaK[i],squaredMagnitude=Math.pow(alphaK,2)+Math.pow(betaK,2),squaredMagnitude<=9)continue;tauK=3/Math.sqrt(squaredMagnitude),mK[i]=alphaK*tauK*deltaK[i],mK[i+1]=betaK*tauK*deltaK[i]}}function monotoneCompute(points,mK,indexAxis=\"x\"){let valueAxis=getValueAxis(indexAxis),pointsLen=points.length,delta,pointBefore,pointCurrent,pointAfter=getPoint(points,0);for(let i=0;i<pointsLen;++i){if(pointBefore=pointCurrent,pointCurrent=pointAfter,pointAfter=getPoint(points,i+1),!pointCurrent)continue;let iPixel=pointCurrent[indexAxis],vPixel=pointCurrent[valueAxis];if(pointBefore)delta=(iPixel-pointBefore[indexAxis])/3,pointCurrent[`cp1${indexAxis}`]=iPixel-delta,pointCurrent[`cp1${valueAxis}`]=vPixel-delta*mK[i];if(pointAfter)delta=(pointAfter[indexAxis]-iPixel)/3,pointCurrent[`cp2${indexAxis}`]=iPixel+delta,pointCurrent[`cp2${valueAxis}`]=vPixel+delta*mK[i]}}function splineCurveMonotone(points,indexAxis=\"x\"){let valueAxis=getValueAxis(indexAxis),pointsLen=points.length,deltaK=Array(pointsLen).fill(0),mK=Array(pointsLen),i,pointBefore,pointCurrent,pointAfter=getPoint(points,0);for(i=0;i<pointsLen;++i){if(pointBefore=pointCurrent,pointCurrent=pointAfter,pointAfter=getPoint(points,i+1),!pointCurrent)continue;if(pointAfter){let slopeDelta=pointAfter[indexAxis]-pointCurrent[indexAxis];deltaK[i]=slopeDelta!==0?(pointAfter[valueAxis]-pointCurrent[valueAxis])/slopeDelta:0}mK[i]=!pointBefore?deltaK[i]:!pointAfter?deltaK[i-1]:sign(deltaK[i-1])!==sign(deltaK[i])?0:(deltaK[i-1]+deltaK[i])/2}monotoneAdjust(points,deltaK,mK),monotoneCompute(points,mK,indexAxis)}function capControlPoint(pt,min,max){return Math.max(Math.min(pt,max),min)}function capBezierPoints(points,area){let i,ilen,point,inArea,inAreaPrev,inAreaNext=_isPointInArea(points[0],area);for(i=0,ilen=points.length;i<ilen;++i){if(inAreaPrev=inArea,inArea=inAreaNext,inAreaNext=i<ilen-1&&_isPointInArea(points[i+1],area),!inArea)continue;if(point=points[i],inAreaPrev)point.cp1x=capControlPoint(point.cp1x,area.left,area.right),point.cp1y=capControlPoint(point.cp1y,area.top,area.bottom);if(inAreaNext)point.cp2x=capControlPoint(point.cp2x,area.left,area.right),point.cp2y=capControlPoint(point.cp2y,area.top,area.bottom)}}function _updateBezierControlPoints(points,options,area,loop,indexAxis){let i,ilen,point,controlPoints;if(options.spanGaps)points=points.filter((pt)=>!pt.skip);if(options.cubicInterpolationMode===\"monotone\")splineCurveMonotone(points,indexAxis);else{let prev=loop?points[points.length-1]:points[0];for(i=0,ilen=points.length;i<ilen;++i)point=points[i],controlPoints=splineCurve(prev,point,points[Math.min(i+1,ilen-(loop?0:1))%ilen],options.tension),point.cp1x=controlPoints.previous.x,point.cp1y=controlPoints.previous.y,point.cp2x=controlPoints.next.x,point.cp2y=controlPoints.next.y,prev=point}if(options.capBezierPoints)capBezierPoints(points,area)}function _isDomSupported(){return typeof window<\"u\"&&typeof document<\"u\"}function _getParentNode(domNode){let parent=domNode.parentNode;if(parent&&parent.toString()===\"[object ShadowRoot]\")parent=parent.host;return parent}function parseMaxStyle(styleValue,node,parentProperty){let valueInPixels;if(typeof styleValue===\"string\"){if(valueInPixels=parseInt(styleValue,10),styleValue.indexOf(\"%\")!==-1)valueInPixels=valueInPixels/100*node.parentNode[parentProperty]}else valueInPixels=styleValue;return valueInPixels}var getComputedStyle=(element)=>element.ownerDocument.defaultView.getComputedStyle(element,null);function getStyle(el,property){return getComputedStyle(el).getPropertyValue(property)}var positions=[\"top\",\"right\",\"bottom\",\"left\"];function getPositionedStyle(styles,style,suffix){let result={};suffix=suffix?\"-\"+suffix:\"\";for(let i=0;i<4;i++){let pos=positions[i];result[pos]=parseFloat(styles[style+\"-\"+pos+suffix])||0}return result.width=result.left+result.right,result.height=result.top+result.bottom,result}var useOffsetPos=(x,y,target)=>(x>0||y>0)&&(!target||!target.shadowRoot);function getCanvasPosition(e,canvas){let touches=e.touches,source=touches&&touches.length?touches[0]:e,{offsetX,offsetY}=source,box=!1,x,y;if(useOffsetPos(offsetX,offsetY,e.target))x=offsetX,y=offsetY;else{let rect=canvas.getBoundingClientRect();x=source.clientX-rect.left,y=source.clientY-rect.top,box=!0}return{x,y,box}}function getRelativePosition(event,chart){if(\"native\"in event)return event;let{canvas,currentDevicePixelRatio}=chart,style=getComputedStyle(canvas),borderBox=style.boxSizing===\"border-box\",paddings=getPositionedStyle(style,\"padding\"),borders=getPositionedStyle(style,\"border\",\"width\"),{x,y,box}=getCanvasPosition(event,canvas),xOffset=paddings.left+(box&&borders.left),yOffset=paddings.top+(box&&borders.top),{width,height}=chart;if(borderBox)width-=paddings.width+borders.width,height-=paddings.height+borders.height;return{x:Math.round((x-xOffset)/width*canvas.width/currentDevicePixelRatio),y:Math.round((y-yOffset)/height*canvas.height/currentDevicePixelRatio)}}function getContainerSize(canvas,width,height){let maxWidth,maxHeight;if(width===void 0||height===void 0){let container=canvas&&_getParentNode(canvas);if(!container)width=canvas.clientWidth,height=canvas.clientHeight;else{let rect=container.getBoundingClientRect(),containerStyle=getComputedStyle(container),containerBorder=getPositionedStyle(containerStyle,\"border\",\"width\"),containerPadding=getPositionedStyle(containerStyle,\"padding\");width=rect.width-containerPadding.width-containerBorder.width,height=rect.height-containerPadding.height-containerBorder.height,maxWidth=parseMaxStyle(containerStyle.maxWidth,container,\"clientWidth\"),maxHeight=parseMaxStyle(containerStyle.maxHeight,container,\"clientHeight\")}}return{width,height,maxWidth:maxWidth||INFINITY,maxHeight:maxHeight||INFINITY}}var round1=(v)=>Math.round(v*10)/10;function getMaximumSize(canvas,bbWidth,bbHeight,aspectRatio){let style=getComputedStyle(canvas),margins=getPositionedStyle(style,\"margin\"),maxWidth=parseMaxStyle(style.maxWidth,canvas,\"clientWidth\")||INFINITY,maxHeight=parseMaxStyle(style.maxHeight,canvas,\"clientHeight\")||INFINITY,containerSize=getContainerSize(canvas,bbWidth,bbHeight),{width,height}=containerSize;if(style.boxSizing===\"content-box\"){let borders=getPositionedStyle(style,\"border\",\"width\"),paddings=getPositionedStyle(style,\"padding\");width-=paddings.width+borders.width,height-=paddings.height+borders.height}if(width=Math.max(0,width-margins.width),height=Math.max(0,aspectRatio?width/aspectRatio:height-margins.height),width=round1(Math.min(width,maxWidth,containerSize.maxWidth)),height=round1(Math.min(height,maxHeight,containerSize.maxHeight)),width&&!height)height=round1(width/2);if((bbWidth!==void 0||bbHeight!==void 0)&&aspectRatio&&containerSize.height&&height>containerSize.height)height=containerSize.height,width=round1(Math.floor(height*aspectRatio));return{width,height}}function retinaScale(chart,forceRatio,forceStyle){let pixelRatio=forceRatio||1,deviceHeight=round1(chart.height*pixelRatio),deviceWidth=round1(chart.width*pixelRatio);chart.height=round1(chart.height),chart.width=round1(chart.width);let canvas=chart.canvas;if(canvas.style&&(forceStyle||!canvas.style.height&&!canvas.style.width))canvas.style.height=`${chart.height}px`,canvas.style.width=`${chart.width}px`;if(chart.currentDevicePixelRatio!==pixelRatio||canvas.height!==deviceHeight||canvas.width!==deviceWidth)return chart.currentDevicePixelRatio=pixelRatio,canvas.height=deviceHeight,canvas.width=deviceWidth,chart.ctx.setTransform(pixelRatio,0,0,pixelRatio,0,0),!0;return!1}var supportsEventListenerOptions=function(){let passiveSupported=!1;try{let options={get passive(){return passiveSupported=!0,!1}};if(_isDomSupported())window.addEventListener(\"test\",null,options),window.removeEventListener(\"test\",null,options)}catch(e){}return passiveSupported}();function readUsedSize(element,property){let value=getStyle(element,property),matches=value&&value.match(/^(\\d+)(\\.\\d+)?px$/);return matches?+matches[1]:void 0}function _pointInLine(p1,p2,t,mode){return{x:p1.x+t*(p2.x-p1.x),y:p1.y+t*(p2.y-p1.y)}}function _steppedInterpolation(p1,p2,t,mode){return{x:p1.x+t*(p2.x-p1.x),y:mode===\"middle\"?t<0.5?p1.y:p2.y:mode===\"after\"?t<1?p1.y:p2.y:t>0?p2.y:p1.y}}function _bezierInterpolation(p1,p2,t,mode){let cp1={x:p1.cp2x,y:p1.cp2y},cp2={x:p2.cp1x,y:p2.cp1y},a=_pointInLine(p1,cp1,t),b=_pointInLine(cp1,cp2,t),c=_pointInLine(cp2,p2,t),d=_pointInLine(a,b,t),e=_pointInLine(b,c,t);return _pointInLine(d,e,t)}var getRightToLeftAdapter=function(rectX,width){return{x(x){return rectX+rectX+width-x},setWidth(w){width=w},textAlign(align){if(align===\"center\")return align;return align===\"right\"?\"left\":\"right\"},xPlus(x,value){return x-value},leftForLtr(x,itemWidth){return x-itemWidth}}},getLeftToRightAdapter=function(){return{x(x){return x},setWidth(w){},textAlign(align){return align},xPlus(x,value){return x+value},leftForLtr(x,_itemWidth){return x}}};function getRtlAdapter(rtl,rectX,width){return rtl?getRightToLeftAdapter(rectX,width):getLeftToRightAdapter()}function overrideTextDirection(ctx,direction){let style,original;if(direction===\"ltr\"||direction===\"rtl\")style=ctx.canvas.style,original=[style.getPropertyValue(\"direction\"),style.getPropertyPriority(\"direction\")],style.setProperty(\"direction\",direction,\"important\"),ctx.prevTextDirection=original}function restoreTextDirection(ctx,original){if(original!==void 0)delete ctx.prevTextDirection,ctx.canvas.style.setProperty(\"direction\",original[0],original[1])}function propertyFn(property){if(property===\"angle\")return{between:_angleBetween,compare:_angleDiff,normalize:_normalizeAngle};return{between:_isBetween,compare:(a,b)=>a-b,normalize:(x)=>x}}function normalizeSegment({start,end,count,loop,style}){return{start:start%count,end:end%count,loop:loop&&(end-start+1)%count===0,style}}function getSegment(segment,points,bounds){let{property,start:startBound,end:endBound}=bounds,{between,normalize}=propertyFn(property),count=points.length,{start,end,loop}=segment,i,ilen;if(loop){start+=count,end+=count;for(i=0,ilen=count;i<ilen;++i){if(!between(normalize(points[start%count][property]),startBound,endBound))break;start--,end--}start%=count,end%=count}if(end<start)end+=count;return{start,end,loop,style:segment.style}}function _boundSegment(segment,points,bounds){if(!bounds)return[segment];let{property,start:startBound,end:endBound}=bounds,count=points.length,{compare,between,normalize}=propertyFn(property),{start,end,loop,style}=getSegment(segment,points,bounds),result=[],inside=!1,subStart=null,value,point,prevValue,startIsBefore=()=>between(startBound,prevValue,value)&&compare(startBound,prevValue)!==0,endIsBefore=()=>compare(endBound,value)===0||between(endBound,prevValue,value),shouldStart=()=>inside||startIsBefore(),shouldStop=()=>!inside||endIsBefore();for(let i=start,prev=start;i<=end;++i){if(point=points[i%count],point.skip)continue;if(value=normalize(point[property]),value===prevValue)continue;if(inside=between(value,startBound,endBound),subStart===null&&shouldStart())subStart=compare(value,startBound)===0?i:prev;if(subStart!==null&&shouldStop())result.push(normalizeSegment({start:subStart,end:i,loop,count,style})),subStart=null;prev=i,prevValue=value}if(subStart!==null)result.push(normalizeSegment({start:subStart,end,loop,count,style}));return result}function _boundSegments(line,bounds){let result=[],segments=line.segments;for(let i=0;i<segments.length;i++){let sub=_boundSegment(segments[i],line.points,bounds);if(sub.length)result.push(...sub)}return result}function findStartAndEnd(points,count,loop,spanGaps){let start=0,end=count-1;if(loop&&!spanGaps)while(start<count&&!points[start].skip)start++;while(start<count&&points[start].skip)start++;if(start%=count,loop)end+=start;while(end>start&&points[end%count].skip)end--;return end%=count,{start,end}}function solidSegments(points,start,max,loop){let count=points.length,result=[],last=start,prev=points[start],end;for(end=start+1;end<=max;++end){let cur=points[end%count];if(cur.skip||cur.stop){if(!prev.skip)loop=!1,result.push({start:start%count,end:(end-1)%count,loop}),start=last=cur.stop?end:null}else if(last=end,prev.skip)start=end;prev=cur}if(last!==null)result.push({start:start%count,end:last%count,loop});return result}function _computeSegments(line,segmentOptions){let points=line.points,spanGaps=line.options.spanGaps,count=points.length;if(!count)return[];let loop=!!line._loop,{start,end}=findStartAndEnd(points,count,loop,spanGaps);if(spanGaps===!0)return splitByStyles(line,[{start,end,loop}],points,segmentOptions);let max=end<start?end+count:end,completeLoop=!!line._fullLoop&&start===0&&end===count-1;return splitByStyles(line,solidSegments(points,start,max,completeLoop),points,segmentOptions)}function splitByStyles(line,segments,points,segmentOptions){if(!segmentOptions||!segmentOptions.setContext||!points)return segments;return doSplitByStyles(line,segments,points,segmentOptions)}function doSplitByStyles(line,segments,points,segmentOptions){let chartContext=line._chart.getContext(),baseStyle=readStyle(line.options),{_datasetIndex:datasetIndex,options:{spanGaps}}=line,count=points.length,result=[],prevStyle=baseStyle,start=segments[0].start,i=start;function addStyle(s,e,l,st){let dir=spanGaps?-1:1;if(s===e)return;s+=count;while(points[s%count].skip)s-=dir;while(points[e%count].skip)e+=dir;if(s%count!==e%count)result.push({start:s%count,end:e%count,loop:l,style:st}),prevStyle=st,start=e%count}for(let segment of segments){start=spanGaps?start:segment.start;let prev=points[start%count],style;for(i=start+1;i<=segment.end;i++){let pt=points[i%count];if(style=readStyle(segmentOptions.setContext(createContext(chartContext,{type:\"segment\",p0:prev,p1:pt,p0DataIndex:(i-1)%count,p1DataIndex:i%count,datasetIndex}))),styleChanged(style,prevStyle))addStyle(start,i-1,segment.loop,prevStyle);prev=pt,prevStyle=style}if(start<i-1)addStyle(start,i-1,segment.loop,prevStyle)}return result}function readStyle(options){return{backgroundColor:options.backgroundColor,borderCapStyle:options.borderCapStyle,borderDash:options.borderDash,borderDashOffset:options.borderDashOffset,borderJoinStyle:options.borderJoinStyle,borderWidth:options.borderWidth,borderColor:options.borderColor}}function styleChanged(style,prevStyle){if(!prevStyle)return!1;let cache=[],replacer=function(key,value){if(!isPatternOrGradient(value))return value;if(!cache.includes(value))cache.push(value);return cache.indexOf(value)};return JSON.stringify(style,replacer)!==JSON.stringify(prevStyle,replacer)}function getSizeForArea(scale,chartArea,field){return scale.options.clip?scale[field]:chartArea[field]}function getDatasetArea(meta,chartArea){let{xScale,yScale}=meta;if(xScale&&yScale)return{left:getSizeForArea(xScale,chartArea,\"left\"),right:getSizeForArea(xScale,chartArea,\"right\"),top:getSizeForArea(yScale,chartArea,\"top\"),bottom:getSizeForArea(yScale,chartArea,\"bottom\")};return chartArea}function getDatasetClipArea(chart,meta){let clip=meta._clip;if(clip.disabled)return!1;let area=getDatasetArea(meta,chart.chartArea);return{left:clip.left===!1?0:area.left-(clip.left===!0?0:clip.left),right:clip.right===!1?chart.width:area.right+(clip.right===!0?0:clip.right),top:clip.top===!1?0:area.top-(clip.top===!0?0:clip.top),bottom:clip.bottom===!1?chart.height:area.bottom+(clip.bottom===!0?0:clip.bottom)}}/*!\n * Chart.js v4.5.1\n * https://www.chartjs.org\n * (c) 2025 Chart.js Contributors\n * Released under the MIT License\n */class Animator{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(chart,anims,date,type){let callbacks=anims.listeners[type],numSteps=anims.duration;callbacks.forEach((fn)=>fn({chart,initial:anims.initial,numSteps,currentStep:Math.min(date-anims.start,numSteps)}))}_refresh(){if(this._request)return;this._running=!0,this._request=requestAnimFrame.call(window,()=>{if(this._update(),this._request=null,this._running)this._refresh()})}_update(date=Date.now()){let remaining=0;if(this._charts.forEach((anims,chart)=>{if(!anims.running||!anims.items.length)return;let items=anims.items,i=items.length-1,draw=!1,item;for(;i>=0;--i)if(item=items[i],item._active){if(item._total>anims.duration)anims.duration=item._total;item.tick(date),draw=!0}else items[i]=items[items.length-1],items.pop();if(draw)chart.draw(),this._notify(chart,anims,date,\"progress\");if(!items.length)anims.running=!1,this._notify(chart,anims,date,\"complete\"),anims.initial=!1;remaining+=items.length}),this._lastDate=date,remaining===0)this._running=!1}_getAnims(chart){let charts=this._charts,anims=charts.get(chart);if(!anims)anims={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},charts.set(chart,anims);return anims}listen(chart,event,cb){this._getAnims(chart).listeners[event].push(cb)}add(chart,items){if(!items||!items.length)return;this._getAnims(chart).items.push(...items)}has(chart){return this._getAnims(chart).items.length>0}start(chart){let anims=this._charts.get(chart);if(!anims)return;anims.running=!0,anims.start=Date.now(),anims.duration=anims.items.reduce((acc,cur)=>Math.max(acc,cur._duration),0),this._refresh()}running(chart){if(!this._running)return!1;let anims=this._charts.get(chart);if(!anims||!anims.running||!anims.items.length)return!1;return!0}stop(chart){let anims=this._charts.get(chart);if(!anims||!anims.items.length)return;let items=anims.items,i=items.length-1;for(;i>=0;--i)items[i].cancel();anims.items=[],this._notify(chart,anims,Date.now(),\"complete\")}remove(chart){return this._charts.delete(chart)}}var animator=new Animator,transparent=\"transparent\",interpolators={boolean(from2,to2,factor){return factor>0.5?to2:from2},color(from2,to2,factor){let c0=color(from2||transparent),c1=c0.valid&&color(to2||transparent);return c1&&c1.valid?c1.mix(c0,factor).hexString():to2},number(from2,to2,factor){return from2+(to2-from2)*factor}};class Animation{constructor(cfg,target,prop,to2){let currentValue=target[prop];to2=resolve([cfg.to,to2,currentValue,cfg.from]);let from2=resolve([cfg.from,currentValue,to2]);this._active=!0,this._fn=cfg.fn||interpolators[cfg.type||typeof from2],this._easing=effects[cfg.easing]||effects.linear,this._start=Math.floor(Date.now()+(cfg.delay||0)),this._duration=this._total=Math.floor(cfg.duration),this._loop=!!cfg.loop,this._target=target,this._prop=prop,this._from=from2,this._to=to2,this._promises=void 0}active(){return this._active}update(cfg,to2,date){if(this._active){this._notify(!1);let currentValue=this._target[this._prop],elapsed=date-this._start,remain=this._duration-elapsed;this._start=date,this._duration=Math.floor(Math.max(remain,cfg.duration)),this._total+=elapsed,this._loop=!!cfg.loop,this._to=resolve([cfg.to,to2,currentValue,cfg.from]),this._from=resolve([cfg.from,currentValue,to2])}}cancel(){if(this._active)this.tick(Date.now()),this._active=!1,this._notify(!1)}tick(date){let elapsed=date-this._start,duration=this._duration,prop=this._prop,from2=this._from,loop=this._loop,to2=this._to,factor;if(this._active=from2!==to2&&(loop||elapsed<duration),!this._active){this._target[prop]=to2,this._notify(!0);return}if(elapsed<0){this._target[prop]=from2;return}factor=elapsed/duration%2,factor=loop&&factor>1?2-factor:factor,factor=this._easing(Math.min(1,Math.max(0,factor))),this._target[prop]=this._fn(from2,to2,factor)}wait(){let promises=this._promises||(this._promises=[]);return new Promise((res,rej)=>{promises.push({res,rej})})}_notify(resolved){let method=resolved?\"res\":\"rej\",promises=this._promises||[];for(let i=0;i<promises.length;i++)promises[i][method]()}}class Animations{constructor(chart,config){this._chart=chart,this._properties=new Map,this.configure(config)}configure(config){if(!isObject(config))return;let animationOptions=Object.keys(defaults.animation),animatedProps=this._properties;Object.getOwnPropertyNames(config).forEach((key)=>{let cfg=config[key];if(!isObject(cfg))return;let resolved={};for(let option of animationOptions)resolved[option]=cfg[option];(isArray(cfg.properties)&&cfg.properties||[key]).forEach((prop)=>{if(prop===key||!animatedProps.has(prop))animatedProps.set(prop,resolved)})})}_animateOptions(target,values){let newOptions=values.options,options=resolveTargetOptions(target,newOptions);if(!options)return[];let animations=this._createAnimations(options,newOptions);if(newOptions.$shared)awaitAll(target.options.$animations,newOptions).then(()=>{target.options=newOptions},()=>{});return animations}_createAnimations(target,values){let animatedProps=this._properties,animations=[],running=target.$animations||(target.$animations={}),props=Object.keys(values),date=Date.now(),i;for(i=props.length-1;i>=0;--i){let prop=props[i];if(prop.charAt(0)===\"$\")continue;if(prop===\"options\"){animations.push(...this._animateOptions(target,values));continue}let value=values[prop],animation=running[prop],cfg=animatedProps.get(prop);if(animation)if(cfg&&animation.active()){animation.update(cfg,value,date);continue}else animation.cancel();if(!cfg||!cfg.duration){target[prop]=value;continue}running[prop]=animation=new Animation(cfg,target,prop,value),animations.push(animation)}return animations}update(target,values){if(this._properties.size===0){Object.assign(target,values);return}let animations=this._createAnimations(target,values);if(animations.length)return animator.add(this._chart,animations),!0}}function awaitAll(animations,properties){let running=[],keys=Object.keys(properties);for(let i=0;i<keys.length;i++){let anim=animations[keys[i]];if(anim&&anim.active())running.push(anim.wait())}return Promise.all(running)}function resolveTargetOptions(target,newOptions){if(!newOptions)return;let options=target.options;if(!options){target.options=newOptions;return}if(options.$shared)target.options=options=Object.assign({},options,{$shared:!1,$animations:{}});return options}function scaleClip(scale,allowedOverflow){let opts=scale&&scale.options||{},reverse=opts.reverse,min=opts.min===void 0?allowedOverflow:0,max=opts.max===void 0?allowedOverflow:0;return{start:reverse?max:min,end:reverse?min:max}}function defaultClip(xScale,yScale,allowedOverflow){if(allowedOverflow===!1)return!1;let x=scaleClip(xScale,allowedOverflow),y=scaleClip(yScale,allowedOverflow);return{top:y.end,right:x.end,bottom:y.start,left:x.start}}function toClip(value){let t,r,b,l;if(isObject(value))t=value.top,r=value.right,b=value.bottom,l=value.left;else t=r=b=l=value;return{top:t,right:r,bottom:b,left:l,disabled:value===!1}}function getSortedDatasetIndices(chart,filterVisible){let keys=[],metasets=chart._getSortedDatasetMetas(filterVisible),i,ilen;for(i=0,ilen=metasets.length;i<ilen;++i)keys.push(metasets[i].index);return keys}function applyStack(stack,value,dsIndex,options={}){let keys=stack.keys,singleMode=options.mode===\"single\",i,ilen,datasetIndex,otherValue;if(value===null)return;let found=!1;for(i=0,ilen=keys.length;i<ilen;++i){if(datasetIndex=+keys[i],datasetIndex===dsIndex){if(found=!0,options.all)continue;break}if(otherValue=stack.values[datasetIndex],isNumberFinite(otherValue)&&(singleMode||value===0||sign(value)===sign(otherValue)))value+=otherValue}if(!found&&!options.all)return 0;return value}function convertObjectDataToArray(data,meta){let{iScale,vScale}=meta,iAxisKey=iScale.axis===\"x\"?\"x\":\"y\",vAxisKey=vScale.axis===\"x\"?\"x\":\"y\",keys=Object.keys(data),adata=Array(keys.length),i,ilen,key;for(i=0,ilen=keys.length;i<ilen;++i)key=keys[i],adata[i]={[iAxisKey]:key,[vAxisKey]:data[key]};return adata}function isStacked(scale,meta){let stacked=scale&&scale.options.stacked;return stacked||stacked===void 0&&meta.stack!==void 0}function getStackKey(indexScale,valueScale,meta){return`${indexScale.id}.${valueScale.id}.${meta.stack||meta.type}`}function getUserBounds(scale){let{min,max,minDefined,maxDefined}=scale.getUserBounds();return{min:minDefined?min:Number.NEGATIVE_INFINITY,max:maxDefined?max:Number.POSITIVE_INFINITY}}function getOrCreateStack(stacks,stackKey,indexValue){let subStack=stacks[stackKey]||(stacks[stackKey]={});return subStack[indexValue]||(subStack[indexValue]={})}function getLastIndexInStack(stack,vScale,positive,type){for(let meta of vScale.getMatchingVisibleMetas(type).reverse()){let value=stack[meta.index];if(positive&&value>0||!positive&&value<0)return meta.index}return null}function updateStacks(controller,parsed){let{chart,_cachedMeta:meta}=controller,stacks=chart._stacks||(chart._stacks={}),{iScale,vScale,index:datasetIndex}=meta,iAxis=iScale.axis,vAxis=vScale.axis,key=getStackKey(iScale,vScale,meta),ilen=parsed.length,stack;for(let i=0;i<ilen;++i){let item=parsed[i],{[iAxis]:index,[vAxis]:value}=item,itemStacks=item._stacks||(item._stacks={});stack=itemStacks[vAxis]=getOrCreateStack(stacks,key,index),stack[datasetIndex]=value,stack._top=getLastIndexInStack(stack,vScale,!0,meta.type),stack._bottom=getLastIndexInStack(stack,vScale,!1,meta.type);let visualValues=stack._visualValues||(stack._visualValues={});visualValues[datasetIndex]=value}}function getFirstScaleId(chart,axis){let scales=chart.scales;return Object.keys(scales).filter((key)=>scales[key].axis===axis).shift()}function createDatasetContext(parent,index){return createContext(parent,{active:!1,dataset:void 0,datasetIndex:index,index,mode:\"default\",type:\"dataset\"})}function createDataContext(parent,index,element){return createContext(parent,{active:!1,dataIndex:index,parsed:void 0,raw:void 0,element,index,mode:\"default\",type:\"data\"})}function clearStacks(meta,items){let datasetIndex=meta.controller.index,axis=meta.vScale&&meta.vScale.axis;if(!axis)return;items=items||meta._parsed;for(let parsed of items){let stacks=parsed._stacks;if(!stacks||stacks[axis]===void 0||stacks[axis][datasetIndex]===void 0)return;if(delete stacks[axis][datasetIndex],stacks[axis]._visualValues!==void 0&&stacks[axis]._visualValues[datasetIndex]!==void 0)delete stacks[axis]._visualValues[datasetIndex]}}var isDirectUpdateMode=(mode)=>mode===\"reset\"||mode===\"none\",cloneIfNotShared=(cached,shared)=>shared?cached:Object.assign({},cached),createStack=(canStack,meta,chart)=>canStack&&!meta.hidden&&meta._stacked&&{keys:getSortedDatasetIndices(chart,!0),values:null};class DatasetController{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(chart,datasetIndex){this.chart=chart,this._ctx=chart.ctx,this.index=datasetIndex,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){let meta=this._cachedMeta;if(this.configure(),this.linkScales(),meta._stacked=isStacked(meta.vScale,meta),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled(\"filler\"))console.warn(\"Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options\")}updateIndex(datasetIndex){if(this.index!==datasetIndex)clearStacks(this._cachedMeta);this.index=datasetIndex}linkScales(){let chart=this.chart,meta=this._cachedMeta,dataset=this.getDataset(),chooseId=(axis,x,y,r)=>axis===\"x\"?x:axis===\"r\"?r:y,xid=meta.xAxisID=valueOrDefault(dataset.xAxisID,getFirstScaleId(chart,\"x\")),yid=meta.yAxisID=valueOrDefault(dataset.yAxisID,getFirstScaleId(chart,\"y\")),rid=meta.rAxisID=valueOrDefault(dataset.rAxisID,getFirstScaleId(chart,\"r\")),indexAxis=meta.indexAxis,iid=meta.iAxisID=chooseId(indexAxis,xid,yid,rid),vid=meta.vAxisID=chooseId(indexAxis,yid,xid,rid);meta.xScale=this.getScaleForId(xid),meta.yScale=this.getScaleForId(yid),meta.rScale=this.getScaleForId(rid),meta.iScale=this.getScaleForId(iid),meta.vScale=this.getScaleForId(vid)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(scaleID){return this.chart.scales[scaleID]}_getOtherScale(scale){let meta=this._cachedMeta;return scale===meta.iScale?meta.vScale:meta.iScale}reset(){this._update(\"reset\")}_destroy(){let meta=this._cachedMeta;if(this._data)unlistenArrayEvents(this._data,this);if(meta._stacked)clearStacks(meta)}_dataCheck(){let dataset=this.getDataset(),data=dataset.data||(dataset.data=[]),_data=this._data;if(isObject(data)){let meta=this._cachedMeta;this._data=convertObjectDataToArray(data,meta)}else if(_data!==data){if(_data){unlistenArrayEvents(_data,this);let meta=this._cachedMeta;clearStacks(meta),meta._parsed=[]}if(data&&Object.isExtensible(data))listenArrayEvents(data,this);this._syncList=[],this._data=data}}addElements(){let meta=this._cachedMeta;if(this._dataCheck(),this.datasetElementType)meta.dataset=new this.datasetElementType}buildOrUpdateElements(resetNewElements){let meta=this._cachedMeta,dataset=this.getDataset(),stackChanged=!1;this._dataCheck();let oldStacked=meta._stacked;if(meta._stacked=isStacked(meta.vScale,meta),meta.stack!==dataset.stack)stackChanged=!0,clearStacks(meta),meta.stack=dataset.stack;if(this._resyncElements(resetNewElements),stackChanged||oldStacked!==meta._stacked)updateStacks(this,meta._parsed),meta._stacked=isStacked(meta.vScale,meta)}configure(){let config=this.chart.config,scopeKeys=config.datasetScopeKeys(this._type),scopes=config.getOptionScopes(this.getDataset(),scopeKeys,!0);this.options=config.createResolver(scopes,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(start,count){let{_cachedMeta:meta,_data:data}=this,{iScale,_stacked}=meta,iAxis=iScale.axis,sorted=start===0&&count===data.length?!0:meta._sorted,prev=start>0&&meta._parsed[start-1],i,cur,parsed;if(this._parsing===!1)meta._parsed=data,meta._sorted=!0,parsed=data;else{if(isArray(data[start]))parsed=this.parseArrayData(meta,data,start,count);else if(isObject(data[start]))parsed=this.parseObjectData(meta,data,start,count);else parsed=this.parsePrimitiveData(meta,data,start,count);let isNotInOrderComparedToPrev=()=>cur[iAxis]===null||prev&&cur[iAxis]<prev[iAxis];for(i=0;i<count;++i)if(meta._parsed[i+start]=cur=parsed[i],sorted){if(isNotInOrderComparedToPrev())sorted=!1;prev=cur}meta._sorted=sorted}if(_stacked)updateStacks(this,parsed)}parsePrimitiveData(meta,data,start,count){let{iScale,vScale}=meta,iAxis=iScale.axis,vAxis=vScale.axis,labels=iScale.getLabels(),singleScale=iScale===vScale,parsed=Array(count),i,ilen,index;for(i=0,ilen=count;i<ilen;++i)index=i+start,parsed[i]={[iAxis]:singleScale||iScale.parse(labels[index],index),[vAxis]:vScale.parse(data[index],index)};return parsed}parseArrayData(meta,data,start,count){let{xScale,yScale}=meta,parsed=Array(count),i,ilen,index,item;for(i=0,ilen=count;i<ilen;++i)index=i+start,item=data[index],parsed[i]={x:xScale.parse(item[0],index),y:yScale.parse(item[1],index)};return parsed}parseObjectData(meta,data,start,count){let{xScale,yScale}=meta,{xAxisKey=\"x\",yAxisKey=\"y\"}=this._parsing,parsed=Array(count),i,ilen,index,item;for(i=0,ilen=count;i<ilen;++i)index=i+start,item=data[index],parsed[i]={x:xScale.parse(resolveObjectKey(item,xAxisKey),index),y:yScale.parse(resolveObjectKey(item,yAxisKey),index)};return parsed}getParsed(index){return this._cachedMeta._parsed[index]}getDataElement(index){return this._cachedMeta.data[index]}applyStack(scale,parsed,mode){let chart=this.chart,meta=this._cachedMeta,value=parsed[scale.axis],stack={keys:getSortedDatasetIndices(chart,!0),values:parsed._stacks[scale.axis]._visualValues};return applyStack(stack,value,meta.index,{mode})}updateRangeFromParsed(range,scale,parsed,stack){let parsedValue=parsed[scale.axis],value=parsedValue===null?NaN:parsedValue,values=stack&&parsed._stacks[scale.axis];if(stack&&values)stack.values=values,value=applyStack(stack,parsedValue,this._cachedMeta.index);range.min=Math.min(range.min,value),range.max=Math.max(range.max,value)}getMinMax(scale,canStack){let meta=this._cachedMeta,_parsed=meta._parsed,sorted=meta._sorted&&scale===meta.iScale,ilen=_parsed.length,otherScale=this._getOtherScale(scale),stack=createStack(canStack,meta,this.chart),range={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:otherMin,max:otherMax}=getUserBounds(otherScale),i,parsed;function _skip(){parsed=_parsed[i];let otherValue=parsed[otherScale.axis];return!isNumberFinite(parsed[scale.axis])||otherMin>otherValue||otherMax<otherValue}for(i=0;i<ilen;++i){if(_skip())continue;if(this.updateRangeFromParsed(range,scale,parsed,stack),sorted)break}if(sorted)for(i=ilen-1;i>=0;--i){if(_skip())continue;this.updateRangeFromParsed(range,scale,parsed,stack);break}return range}getAllParsedValues(scale){let parsed=this._cachedMeta._parsed,values=[],i,ilen,value;for(i=0,ilen=parsed.length;i<ilen;++i)if(value=parsed[i][scale.axis],isNumberFinite(value))values.push(value);return values}getMaxOverflow(){return!1}getLabelAndValue(index){let meta=this._cachedMeta,iScale=meta.iScale,vScale=meta.vScale,parsed=this.getParsed(index);return{label:iScale?\"\"+iScale.getLabelForValue(parsed[iScale.axis]):\"\",value:vScale?\"\"+vScale.getLabelForValue(parsed[vScale.axis]):\"\"}}_update(mode){let meta=this._cachedMeta;this.update(mode||\"default\"),meta._clip=toClip(valueOrDefault(this.options.clip,defaultClip(meta.xScale,meta.yScale,this.getMaxOverflow())))}update(mode){}draw(){let ctx=this._ctx,chart=this.chart,meta=this._cachedMeta,elements=meta.data||[],area=chart.chartArea,active=[],start=this._drawStart||0,count=this._drawCount||elements.length-start,drawActiveElementsOnTop=this.options.drawActiveElementsOnTop,i;if(meta.dataset)meta.dataset.draw(ctx,area,start,count);for(i=start;i<start+count;++i){let element=elements[i];if(element.hidden)continue;if(element.active&&drawActiveElementsOnTop)active.push(element);else element.draw(ctx,area)}for(i=0;i<active.length;++i)active[i].draw(ctx,area)}getStyle(index,active){let mode=active?\"active\":\"default\";return index===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(mode):this.resolveDataElementOptions(index||0,mode)}getContext(index,active,mode){let dataset=this.getDataset(),context;if(index>=0&&index<this._cachedMeta.data.length){let element=this._cachedMeta.data[index];context=element.$context||(element.$context=createDataContext(this.getContext(),index,element)),context.parsed=this.getParsed(index),context.raw=dataset.data[index],context.index=context.dataIndex=index}else context=this.$context||(this.$context=createDatasetContext(this.chart.getContext(),this.index)),context.dataset=dataset,context.index=context.datasetIndex=this.index;return context.active=!!active,context.mode=mode,context}resolveDatasetElementOptions(mode){return this._resolveElementOptions(this.datasetElementType.id,mode)}resolveDataElementOptions(index,mode){return this._resolveElementOptions(this.dataElementType.id,mode,index)}_resolveElementOptions(elementType,mode=\"default\",index){let active=mode===\"active\",cache=this._cachedDataOpts,cacheKey=elementType+\"-\"+mode,cached=cache[cacheKey],sharing=this.enableOptionSharing&&defined(index);if(cached)return cloneIfNotShared(cached,sharing);let config=this.chart.config,scopeKeys=config.datasetElementScopeKeys(this._type,elementType),prefixes=active?[`${elementType}Hover`,\"hover\",elementType,\"\"]:[elementType,\"\"],scopes=config.getOptionScopes(this.getDataset(),scopeKeys),names2=Object.keys(defaults.elements[elementType]),context=()=>this.getContext(index,active,mode),values=config.resolveNamedOptions(scopes,names2,context,prefixes);if(values.$shared)values.$shared=sharing,cache[cacheKey]=Object.freeze(cloneIfNotShared(values,sharing));return values}_resolveAnimations(index,transition,active){let chart=this.chart,cache=this._cachedDataOpts,cacheKey=`animation-${transition}`,cached=cache[cacheKey];if(cached)return cached;let options;if(chart.options.animation!==!1){let config=this.chart.config,scopeKeys=config.datasetAnimationScopeKeys(this._type,transition),scopes=config.getOptionScopes(this.getDataset(),scopeKeys);options=config.createResolver(scopes,this.getContext(index,active,transition))}let animations=new Animations(chart,options&&options.animations);if(options&&options._cacheable)cache[cacheKey]=Object.freeze(animations);return animations}getSharedOptions(options){if(!options.$shared)return;return this._sharedOptions||(this._sharedOptions=Object.assign({},options))}includeOptions(mode,sharedOptions){return!sharedOptions||isDirectUpdateMode(mode)||this.chart._animationsDisabled}_getSharedOptions(start,mode){let firstOpts=this.resolveDataElementOptions(start,mode),previouslySharedOptions=this._sharedOptions,sharedOptions=this.getSharedOptions(firstOpts),includeOptions=this.includeOptions(mode,sharedOptions)||sharedOptions!==previouslySharedOptions;return this.updateSharedOptions(sharedOptions,mode,firstOpts),{sharedOptions,includeOptions}}updateElement(element,index,properties,mode){if(isDirectUpdateMode(mode))Object.assign(element,properties);else this._resolveAnimations(index,mode).update(element,properties)}updateSharedOptions(sharedOptions,mode,newOptions){if(sharedOptions&&!isDirectUpdateMode(mode))this._resolveAnimations(void 0,mode).update(sharedOptions,newOptions)}_setStyle(element,index,mode,active){element.active=active;let options=this.getStyle(index,active);this._resolveAnimations(index,mode,active).update(element,{options:!active&&this.getSharedOptions(options)||options})}removeHoverStyle(element,datasetIndex,index){this._setStyle(element,index,\"active\",!1)}setHoverStyle(element,datasetIndex,index){this._setStyle(element,index,\"active\",!0)}_removeDatasetHoverStyle(){let element=this._cachedMeta.dataset;if(element)this._setStyle(element,void 0,\"active\",!1)}_setDatasetHoverStyle(){let element=this._cachedMeta.dataset;if(element)this._setStyle(element,void 0,\"active\",!0)}_resyncElements(resetNewElements){let data=this._data,elements=this._cachedMeta.data;for(let[method,arg1,arg2]of this._syncList)this[method](arg1,arg2);this._syncList=[];let numMeta=elements.length,numData=data.length,count=Math.min(numData,numMeta);if(count)this.parse(0,count);if(numData>numMeta)this._insertElements(numMeta,numData-numMeta,resetNewElements);else if(numData<numMeta)this._removeElements(numData,numMeta-numData)}_insertElements(start,count,resetNewElements=!0){let meta=this._cachedMeta,data=meta.data,end=start+count,i,move=(arr)=>{arr.length+=count;for(i=arr.length-1;i>=end;i--)arr[i]=arr[i-count]};move(data);for(i=start;i<end;++i)data[i]=new this.dataElementType;if(this._parsing)move(meta._parsed);if(this.parse(start,count),resetNewElements)this.updateElements(data,start,count,\"reset\")}updateElements(element,start,count,mode){}_removeElements(start,count){let meta=this._cachedMeta;if(this._parsing){let removed=meta._parsed.splice(start,count);if(meta._stacked)clearStacks(meta,removed)}meta.data.splice(start,count)}_sync(args){if(this._parsing)this._syncList.push(args);else{let[method,arg1,arg2]=args;this[method](arg1,arg2)}this.chart._dataChanges.push([this.index,...args])}_onDataPush(){let count=arguments.length;this._sync([\"_insertElements\",this.getDataset().data.length-count,count])}_onDataPop(){this._sync([\"_removeElements\",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync([\"_removeElements\",0,1])}_onDataSplice(start,count){if(count)this._sync([\"_removeElements\",start,count]);let newCount=arguments.length-2;if(newCount)this._sync([\"_insertElements\",start,newCount])}_onDataUnshift(){this._sync([\"_insertElements\",0,arguments.length])}}function getAllScaleValues(scale,type){if(!scale._cache.$bar){let visibleMetas=scale.getMatchingVisibleMetas(type),values=[];for(let i=0,ilen=visibleMetas.length;i<ilen;i++)values=values.concat(visibleMetas[i].controller.getAllParsedValues(scale));scale._cache.$bar=_arrayUnique(values.sort((a,b)=>a-b))}return scale._cache.$bar}function computeMinSampleSize(meta){let scale=meta.iScale,values=getAllScaleValues(scale,meta.type),min=scale._length,i,ilen,curr,prev,updateMinAndPrev=()=>{if(curr===32767||curr===-32768)return;if(defined(prev))min=Math.min(min,Math.abs(curr-prev)||min);prev=curr};for(i=0,ilen=values.length;i<ilen;++i)curr=scale.getPixelForValue(values[i]),updateMinAndPrev();prev=void 0;for(i=0,ilen=scale.ticks.length;i<ilen;++i)curr=scale.getPixelForTick(i),updateMinAndPrev();return min}function computeFitCategoryTraits(index,ruler,options,stackCount){let thickness=options.barThickness,size,ratio;if(isNullOrUndef(thickness))size=ruler.min*options.categoryPercentage,ratio=options.barPercentage;else size=thickness*stackCount,ratio=1;return{chunk:size/stackCount,ratio,start:ruler.pixels[index]-size/2}}function computeFlexCategoryTraits(index,ruler,options,stackCount){let pixels=ruler.pixels,curr=pixels[index],prev=index>0?pixels[index-1]:null,next=index<pixels.length-1?pixels[index+1]:null,percent=options.categoryPercentage;if(prev===null)prev=curr-(next===null?ruler.end-ruler.start:next-curr);if(next===null)next=curr+curr-prev;let start=curr-(curr-Math.min(prev,next))/2*percent;return{chunk:Math.abs(next-prev)/2*percent/stackCount,ratio:options.barPercentage,start}}function parseFloatBar(entry,item,vScale,i){let startValue=vScale.parse(entry[0],i),endValue=vScale.parse(entry[1],i),min=Math.min(startValue,endValue),max=Math.max(startValue,endValue),barStart=min,barEnd=max;if(Math.abs(min)>Math.abs(max))barStart=max,barEnd=min;item[vScale.axis]=barEnd,item._custom={barStart,barEnd,start:startValue,end:endValue,min,max}}function parseValue(entry,item,vScale,i){if(isArray(entry))parseFloatBar(entry,item,vScale,i);else item[vScale.axis]=vScale.parse(entry,i);return item}function parseArrayOrPrimitive(meta,data,start,count){let{iScale,vScale}=meta,labels=iScale.getLabels(),singleScale=iScale===vScale,parsed=[],i,ilen,item,entry;for(i=start,ilen=start+count;i<ilen;++i)entry=data[i],item={},item[iScale.axis]=singleScale||iScale.parse(labels[i],i),parsed.push(parseValue(entry,item,vScale,i));return parsed}function isFloatBar(custom){return custom&&custom.barStart!==void 0&&custom.barEnd!==void 0}function barSign(size,vScale,actualBase){if(size!==0)return sign(size);return(vScale.isHorizontal()?1:-1)*(vScale.min>=actualBase?1:-1)}function borderProps(properties){let reverse,start,end,top,bottom;if(properties.horizontal)reverse=properties.base>properties.x,start=\"left\",end=\"right\";else reverse=properties.base<properties.y,start=\"bottom\",end=\"top\";if(reverse)top=\"end\",bottom=\"start\";else top=\"start\",bottom=\"end\";return{start,end,reverse,top,bottom}}function setBorderSkipped(properties,options,stack,index){let edge=options.borderSkipped,res={};if(!edge){properties.borderSkipped=res;return}if(edge===!0){properties.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}let{start,end,reverse,top,bottom}=borderProps(properties);if(edge===\"middle\"&&stack)if(properties.enableBorderRadius=!0,(stack._top||0)===index)edge=top;else if((stack._bottom||0)===index)edge=bottom;else res[parseEdge(bottom,start,end,reverse)]=!0,edge=top;res[parseEdge(edge,start,end,reverse)]=!0,properties.borderSkipped=res}function parseEdge(edge,a,b,reverse){if(reverse)edge=swap(edge,a,b),edge=startEnd(edge,b,a);else edge=startEnd(edge,a,b);return edge}function swap(orig,v1,v2){return orig===v1?v2:orig===v2?v1:orig}function startEnd(v,start,end){return v===\"start\"?start:v===\"end\"?end:v}function setInflateAmount(properties,{inflateAmount},ratio){properties.inflateAmount=inflateAmount===\"auto\"?ratio===1?0.33:0:inflateAmount}class BarController extends DatasetController{static id=\"bar\";static defaults={datasetElementType:!1,dataElementType:\"bar\",categoryPercentage:0.8,barPercentage:0.9,grouped:!0,animations:{numbers:{type:\"number\",properties:[\"x\",\"y\",\"base\",\"width\",\"height\"]}}};static overrides={scales:{_index_:{type:\"category\",offset:!0,grid:{offset:!0}},_value_:{type:\"linear\",beginAtZero:!0}}};parsePrimitiveData(meta,data,start,count){return parseArrayOrPrimitive(meta,data,start,count)}parseArrayData(meta,data,start,count){return parseArrayOrPrimitive(meta,data,start,count)}parseObjectData(meta,data,start,count){let{iScale,vScale}=meta,{xAxisKey=\"x\",yAxisKey=\"y\"}=this._parsing,iAxisKey=iScale.axis===\"x\"?xAxisKey:yAxisKey,vAxisKey=vScale.axis===\"x\"?xAxisKey:yAxisKey,parsed=[],i,ilen,item,obj;for(i=start,ilen=start+count;i<ilen;++i)obj=data[i],item={},item[iScale.axis]=iScale.parse(resolveObjectKey(obj,iAxisKey),i),parsed.push(parseValue(resolveObjectKey(obj,vAxisKey),item,vScale,i));return parsed}updateRangeFromParsed(range,scale,parsed,stack){super.updateRangeFromParsed(range,scale,parsed,stack);let custom=parsed._custom;if(custom&&scale===this._cachedMeta.vScale)range.min=Math.min(range.min,custom.min),range.max=Math.max(range.max,custom.max)}getMaxOverflow(){return 0}getLabelAndValue(index){let meta=this._cachedMeta,{iScale,vScale}=meta,parsed=this.getParsed(index),custom=parsed._custom,value=isFloatBar(custom)?\"[\"+custom.start+\", \"+custom.end+\"]\":\"\"+vScale.getLabelForValue(parsed[vScale.axis]);return{label:\"\"+iScale.getLabelForValue(parsed[iScale.axis]),value}}initialize(){this.enableOptionSharing=!0,super.initialize();let meta=this._cachedMeta;meta.stack=this.getDataset().stack}update(mode){let meta=this._cachedMeta;this.updateElements(meta.data,0,meta.data.length,mode)}updateElements(bars,start,count,mode){let reset=mode===\"reset\",{index,_cachedMeta:{vScale}}=this,base=vScale.getBasePixel(),horizontal=vScale.isHorizontal(),ruler=this._getRuler(),{sharedOptions,includeOptions}=this._getSharedOptions(start,mode);for(let i=start;i<start+count;i++){let parsed=this.getParsed(i),vpixels=reset||isNullOrUndef(parsed[vScale.axis])?{base,head:base}:this._calculateBarValuePixels(i),ipixels=this._calculateBarIndexPixels(i,ruler),stack=(parsed._stacks||{})[vScale.axis],properties={horizontal,base:vpixels.base,enableBorderRadius:!stack||isFloatBar(parsed._custom)||index===stack._top||index===stack._bottom,x:horizontal?vpixels.head:ipixels.center,y:horizontal?ipixels.center:vpixels.head,height:horizontal?ipixels.size:Math.abs(vpixels.size),width:horizontal?Math.abs(vpixels.size):ipixels.size};if(includeOptions)properties.options=sharedOptions||this.resolveDataElementOptions(i,bars[i].active?\"active\":mode);let options=properties.options||bars[i].options;setBorderSkipped(properties,options,stack,index),setInflateAmount(properties,options,ruler.ratio),this.updateElement(bars[i],i,properties,mode)}}_getStacks(last,dataIndex){let{iScale}=this._cachedMeta,metasets=iScale.getMatchingVisibleMetas(this._type).filter((meta)=>meta.controller.options.grouped),stacked=iScale.options.stacked,stacks=[],currentParsed=this._cachedMeta.controller.getParsed(dataIndex),iScaleValue=currentParsed&&currentParsed[iScale.axis],skipNull=(meta)=>{let parsed=meta._parsed.find((item)=>item[iScale.axis]===iScaleValue),val=parsed&&parsed[meta.vScale.axis];if(isNullOrUndef(val)||isNaN(val))return!0};for(let meta of metasets){if(dataIndex!==void 0&&skipNull(meta))continue;if(stacked===!1||stacks.indexOf(meta.stack)===-1||stacked===void 0&&meta.stack===void 0)stacks.push(meta.stack);if(meta.index===last)break}if(!stacks.length)stacks.push(void 0);return stacks}_getStackCount(index){return this._getStacks(void 0,index).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){let scales=this.chart.scales,indexScaleId=this.chart.options.indexAxis;return Object.keys(scales).filter((key)=>scales[key].axis===indexScaleId).shift()}_getAxis(){let axis={},firstScaleAxisId=this.getFirstScaleIdForIndexAxis();for(let dataset of this.chart.data.datasets)axis[valueOrDefault(this.chart.options.indexAxis===\"x\"?dataset.xAxisID:dataset.yAxisID,firstScaleAxisId)]=!0;return Object.keys(axis)}_getStackIndex(datasetIndex,name,dataIndex){let stacks=this._getStacks(datasetIndex,dataIndex),index=name!==void 0?stacks.indexOf(name):-1;return index===-1?stacks.length-1:index}_getRuler(){let opts=this.options,meta=this._cachedMeta,iScale=meta.iScale,pixels=[],i,ilen;for(i=0,ilen=meta.data.length;i<ilen;++i)pixels.push(iScale.getPixelForValue(this.getParsed(i)[iScale.axis],i));let barThickness=opts.barThickness;return{min:barThickness||computeMinSampleSize(meta),pixels,start:iScale._startPixel,end:iScale._endPixel,stackCount:this._getStackCount(),scale:iScale,grouped:opts.grouped,ratio:barThickness?1:opts.categoryPercentage*opts.barPercentage}}_calculateBarValuePixels(index){let{_cachedMeta:{vScale,_stacked,index:datasetIndex},options:{base:baseValue,minBarLength}}=this,actualBase=baseValue||0,parsed=this.getParsed(index),custom=parsed._custom,floating=isFloatBar(custom),value=parsed[vScale.axis],start=0,length=_stacked?this.applyStack(vScale,parsed,_stacked):value,head,size;if(length!==value)start=length-value,length=value;if(floating){if(value=custom.barStart,length=custom.barEnd-custom.barStart,value!==0&&sign(value)!==sign(custom.barEnd))start=0;start+=value}let startValue=!isNullOrUndef(baseValue)&&!floating?baseValue:start,base=vScale.getPixelForValue(startValue);if(this.chart.getDataVisibility(index))head=vScale.getPixelForValue(start+length);else head=base;if(size=head-base,Math.abs(size)<minBarLength){if(size=barSign(size,vScale,actualBase)*minBarLength,value===actualBase)base-=size/2;let startPixel=vScale.getPixelForDecimal(0),endPixel=vScale.getPixelForDecimal(1),min=Math.min(startPixel,endPixel),max=Math.max(startPixel,endPixel);if(base=Math.max(Math.min(base,max),min),head=base+size,_stacked&&!floating)parsed._stacks[vScale.axis]._visualValues[datasetIndex]=vScale.getValueForPixel(head)-vScale.getValueForPixel(base)}if(base===vScale.getPixelForValue(actualBase)){let halfGrid=sign(size)*vScale.getLineWidthForValue(actualBase)/2;base+=halfGrid,size-=halfGrid}return{size,base,head,center:head+size/2}}_calculateBarIndexPixels(index,ruler){let scale=ruler.scale,options=this.options,skipNull=options.skipNull,maxBarThickness=valueOrDefault(options.maxBarThickness,1/0),center,size,axisCount=this._getAxisCount();if(ruler.grouped){let stackCount=skipNull?this._getStackCount(index):ruler.stackCount,range=options.barThickness===\"flex\"?computeFlexCategoryTraits(index,ruler,options,stackCount*axisCount):computeFitCategoryTraits(index,ruler,options,stackCount*axisCount),axisID=this.chart.options.indexAxis===\"x\"?this.getDataset().xAxisID:this.getDataset().yAxisID,axisNumber=this._getAxis().indexOf(valueOrDefault(axisID,this.getFirstScaleIdForIndexAxis())),stackIndex=this._getStackIndex(this.index,this._cachedMeta.stack,skipNull?index:void 0)+axisNumber;center=range.start+range.chunk*stackIndex+range.chunk/2,size=Math.min(maxBarThickness,range.chunk*range.ratio)}else center=scale.getPixelForValue(this.getParsed(index)[scale.axis],index),size=Math.min(maxBarThickness,ruler.min*ruler.ratio);return{base:center-size/2,head:center+size/2,center,size}}draw(){let meta=this._cachedMeta,vScale=meta.vScale,rects=meta.data,ilen=rects.length,i=0;for(;i<ilen;++i)if(this.getParsed(i)[vScale.axis]!==null&&!rects[i].hidden)rects[i].draw(this._ctx)}}class BubbleController extends DatasetController{static id=\"bubble\";static defaults={datasetElementType:!1,dataElementType:\"point\",animations:{numbers:{type:\"number\",properties:[\"x\",\"y\",\"borderWidth\",\"radius\"]}}};static overrides={scales:{x:{type:\"linear\"},y:{type:\"linear\"}}};initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(meta,data,start,count){let parsed=super.parsePrimitiveData(meta,data,start,count);for(let i=0;i<parsed.length;i++)parsed[i]._custom=this.resolveDataElementOptions(i+start).radius;return parsed}parseArrayData(meta,data,start,count){let parsed=super.parseArrayData(meta,data,start,count);for(let i=0;i<parsed.length;i++){let item=data[start+i];parsed[i]._custom=valueOrDefault(item[2],this.resolveDataElementOptions(i+start).radius)}return parsed}parseObjectData(meta,data,start,count){let parsed=super.parseObjectData(meta,data,start,count);for(let i=0;i<parsed.length;i++){let item=data[start+i];parsed[i]._custom=valueOrDefault(item&&item.r&&+item.r,this.resolveDataElementOptions(i+start).radius)}return parsed}getMaxOverflow(){let data=this._cachedMeta.data,max=0;for(let i=data.length-1;i>=0;--i)max=Math.max(max,data[i].size(this.resolveDataElementOptions(i))/2);return max>0&&max}getLabelAndValue(index){let meta=this._cachedMeta,labels=this.chart.data.labels||[],{xScale,yScale}=meta,parsed=this.getParsed(index),x=xScale.getLabelForValue(parsed.x),y=yScale.getLabelForValue(parsed.y),r=parsed._custom;return{label:labels[index]||\"\",value:\"(\"+x+\", \"+y+(r?\", \"+r:\"\")+\")\"}}update(mode){let points=this._cachedMeta.data;this.updateElements(points,0,points.length,mode)}updateElements(points,start,count,mode){let reset=mode===\"reset\",{iScale,vScale}=this._cachedMeta,{sharedOptions,includeOptions}=this._getSharedOptions(start,mode),iAxis=iScale.axis,vAxis=vScale.axis;for(let i=start;i<start+count;i++){let point=points[i],parsed=!reset&&this.getParsed(i),properties={},iPixel=properties[iAxis]=reset?iScale.getPixelForDecimal(0.5):iScale.getPixelForValue(parsed[iAxis]),vPixel=properties[vAxis]=reset?vScale.getBasePixel():vScale.getPixelForValue(parsed[vAxis]);if(properties.skip=isNaN(iPixel)||isNaN(vPixel),includeOptions){if(properties.options=sharedOptions||this.resolveDataElementOptions(i,point.active?\"active\":mode),reset)properties.options.radius=0}this.updateElement(point,i,properties,mode)}}resolveDataElementOptions(index,mode){let parsed=this.getParsed(index),values=super.resolveDataElementOptions(index,mode);if(values.$shared)values=Object.assign({},values,{$shared:!1});let radius=values.radius;if(mode!==\"active\")values.radius=0;return values.radius+=valueOrDefault(parsed&&parsed._custom,radius),values}}function getRatioAndOffset(rotation,circumference,cutout){let ratioX=1,ratioY=1,offsetX=0,offsetY=0;if(circumference<TAU){let startAngle=rotation,endAngle=startAngle+circumference,startX=Math.cos(startAngle),startY=Math.sin(startAngle),endX=Math.cos(endAngle),endY=Math.sin(endAngle),calcMax=(angle,a,b)=>_angleBetween(angle,startAngle,endAngle,!0)?1:Math.max(a,a*cutout,b,b*cutout),calcMin=(angle,a,b)=>_angleBetween(angle,startAngle,endAngle,!0)?-1:Math.min(a,a*cutout,b,b*cutout),maxX=calcMax(0,startX,endX),maxY=calcMax(HALF_PI,startY,endY),minX=calcMin(PI,startX,endX),minY=calcMin(PI+HALF_PI,startY,endY);ratioX=(maxX-minX)/2,ratioY=(maxY-minY)/2,offsetX=-(maxX+minX)/2,offsetY=-(maxY+minY)/2}return{ratioX,ratioY,offsetX,offsetY}}class DoughnutController extends DatasetController{static id=\"doughnut\";static defaults={datasetElementType:!1,dataElementType:\"arc\",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:\"number\",properties:[\"circumference\",\"endAngle\",\"innerRadius\",\"outerRadius\",\"startAngle\",\"x\",\"y\",\"offset\",\"borderWidth\",\"spacing\"]}},cutout:\"50%\",rotation:0,circumference:360,radius:\"100%\",spacing:0,indexAxis:\"r\"};static descriptors={_scriptable:(name)=>name!==\"spacing\",_indexable:(name)=>name!==\"spacing\"&&!name.startsWith(\"borderDash\")&&!name.startsWith(\"hoverBorderDash\")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(chart){let data=chart.data,{labels:{pointStyle,textAlign,color:color2,useBorderRadius,borderRadius}}=chart.legend.options;if(data.labels.length&&data.datasets.length)return data.labels.map((label,i)=>{let style=chart.getDatasetMeta(0).controller.getStyle(i);return{text:label,fillStyle:style.backgroundColor,fontColor:color2,hidden:!chart.getDataVisibility(i),lineDash:style.borderDash,lineDashOffset:style.borderDashOffset,lineJoin:style.borderJoinStyle,lineWidth:style.borderWidth,strokeStyle:style.borderColor,textAlign,pointStyle,borderRadius:useBorderRadius&&(borderRadius||style.borderRadius),index:i}});return[]}},onClick(e,legendItem,legend){legend.chart.toggleDataVisibility(legendItem.index),legend.chart.update()}}}};constructor(chart,datasetIndex){super(chart,datasetIndex);this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(start,count){let data=this.getDataset().data,meta=this._cachedMeta;if(this._parsing===!1)meta._parsed=data;else{let getter=(i2)=>+data[i2];if(isObject(data[start])){let{key=\"value\"}=this._parsing;getter=(i2)=>+resolveObjectKey(data[i2],key)}let i,ilen;for(i=start,ilen=start+count;i<ilen;++i)meta._parsed[i]=getter(i)}}_getRotation(){return toRadians(this.options.rotation-90)}_getCircumference(){return toRadians(this.options.circumference)}_getRotationExtents(){let min=TAU,max=-TAU;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){let controller=this.chart.getDatasetMeta(i).controller,rotation=controller._getRotation(),circumference=controller._getCircumference();min=Math.min(min,rotation),max=Math.max(max,rotation+circumference)}return{rotation:min,circumference:max-min}}update(mode){let chart=this.chart,{chartArea}=chart,meta=this._cachedMeta,arcs=meta.data,spacing=this.getMaxBorderWidth()+this.getMaxOffset(arcs)+this.options.spacing,maxSize=Math.max((Math.min(chartArea.width,chartArea.height)-spacing)/2,0),cutout=Math.min(toPercentage(this.options.cutout,maxSize),1),chartWeight=this._getRingWeight(this.index),{circumference,rotation}=this._getRotationExtents(),{ratioX,ratioY,offsetX,offsetY}=getRatioAndOffset(rotation,circumference,cutout),maxWidth=(chartArea.width-spacing)/ratioX,maxHeight=(chartArea.height-spacing)/ratioY,maxRadius=Math.max(Math.min(maxWidth,maxHeight)/2,0),outerRadius=toDimension(this.options.radius,maxRadius),innerRadius=Math.max(outerRadius*cutout,0),radiusLength=(outerRadius-innerRadius)/this._getVisibleDatasetWeightTotal();this.offsetX=offsetX*outerRadius,this.offsetY=offsetY*outerRadius,meta.total=this.calculateTotal(),this.outerRadius=outerRadius-radiusLength*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-radiusLength*chartWeight,0),this.updateElements(arcs,0,arcs.length,mode)}_circumference(i,reset){let opts=this.options,meta=this._cachedMeta,circumference=this._getCircumference();if(reset&&opts.animation.animateRotate||!this.chart.getDataVisibility(i)||meta._parsed[i]===null||meta.data[i].hidden)return 0;return this.calculateCircumference(meta._parsed[i]*circumference/TAU)}updateElements(arcs,start,count,mode){let reset=mode===\"reset\",chart=this.chart,chartArea=chart.chartArea,animationOpts=chart.options.animation,centerX=(chartArea.left+chartArea.right)/2,centerY=(chartArea.top+chartArea.bottom)/2,animateScale=reset&&animationOpts.animateScale,innerRadius=animateScale?0:this.innerRadius,outerRadius=animateScale?0:this.outerRadius,{sharedOptions,includeOptions}=this._getSharedOptions(start,mode),startAngle=this._getRotation(),i;for(i=0;i<start;++i)startAngle+=this._circumference(i,reset);for(i=start;i<start+count;++i){let circumference=this._circumference(i,reset),arc=arcs[i],properties={x:centerX+this.offsetX,y:centerY+this.offsetY,startAngle,endAngle:startAngle+circumference,circumference,outerRadius,innerRadius};if(includeOptions)properties.options=sharedOptions||this.resolveDataElementOptions(i,arc.active?\"active\":mode);startAngle+=circumference,this.updateElement(arc,i,properties,mode)}}calculateTotal(){let meta=this._cachedMeta,metaData=meta.data,total=0,i;for(i=0;i<metaData.length;i++){let value=meta._parsed[i];if(value!==null&&!isNaN(value)&&this.chart.getDataVisibility(i)&&!metaData[i].hidden)total+=Math.abs(value)}return total}calculateCircumference(value){let total=this._cachedMeta.total;if(total>0&&!isNaN(value))return TAU*(Math.abs(value)/total);return 0}getLabelAndValue(index){let meta=this._cachedMeta,chart=this.chart,labels=chart.data.labels||[],value=formatNumber(meta._parsed[index],chart.options.locale);return{label:labels[index]||\"\",value}}getMaxBorderWidth(arcs){let max=0,chart=this.chart,i,ilen,meta,controller,options;if(!arcs){for(i=0,ilen=chart.data.datasets.length;i<ilen;++i)if(chart.isDatasetVisible(i)){meta=chart.getDatasetMeta(i),arcs=meta.data,controller=meta.controller;break}}if(!arcs)return 0;for(i=0,ilen=arcs.length;i<ilen;++i)if(options=controller.resolveDataElementOptions(i),options.borderAlign!==\"inner\")max=Math.max(max,options.borderWidth||0,options.hoverBorderWidth||0);return max}getMaxOffset(arcs){let max=0;for(let i=0,ilen=arcs.length;i<ilen;++i){let options=this.resolveDataElementOptions(i);max=Math.max(max,options.offset||0,options.hoverOffset||0)}return max}_getRingWeightOffset(datasetIndex){let ringWeightOffset=0;for(let i=0;i<datasetIndex;++i)if(this.chart.isDatasetVisible(i))ringWeightOffset+=this._getRingWeight(i);return ringWeightOffset}_getRingWeight(datasetIndex){return Math.max(valueOrDefault(this.chart.data.datasets[datasetIndex].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class LineController extends DatasetController{static id=\"line\";static defaults={datasetElementType:\"line\",dataElementType:\"point\",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:\"category\"},_value_:{type:\"linear\"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(mode){let meta=this._cachedMeta,{dataset:line,data:points=[],_dataset}=meta,animationsDisabled=this.chart._animationsDisabled,{start,count}=_getStartAndCountOfVisiblePoints(meta,points,animationsDisabled);if(this._drawStart=start,this._drawCount=count,_scaleRangesChanged(meta))start=0,count=points.length;line._chart=this.chart,line._datasetIndex=this.index,line._decimated=!!_dataset._decimated,line.points=points;let options=this.resolveDatasetElementOptions(mode);if(!this.options.showLine)options.borderWidth=0;options.segment=this.options.segment,this.updateElement(line,void 0,{animated:!animationsDisabled,options},mode),this.updateElements(points,start,count,mode)}updateElements(points,start,count,mode){let reset=mode===\"reset\",{iScale,vScale,_stacked,_dataset}=this._cachedMeta,{sharedOptions,includeOptions}=this._getSharedOptions(start,mode),iAxis=iScale.axis,vAxis=vScale.axis,{spanGaps,segment}=this.options,maxGapLength=isNumber(spanGaps)?spanGaps:Number.POSITIVE_INFINITY,directUpdate=this.chart._animationsDisabled||reset||mode===\"none\",end=start+count,pointsCount=points.length,prevParsed=start>0&&this.getParsed(start-1);for(let i=0;i<pointsCount;++i){let point=points[i],properties=directUpdate?point:{};if(i<start||i>=end){properties.skip=!0;continue}let parsed=this.getParsed(i),nullData=isNullOrUndef(parsed[vAxis]),iPixel=properties[iAxis]=iScale.getPixelForValue(parsed[iAxis],i),vPixel=properties[vAxis]=reset||nullData?vScale.getBasePixel():vScale.getPixelForValue(_stacked?this.applyStack(vScale,parsed,_stacked):parsed[vAxis],i);if(properties.skip=isNaN(iPixel)||isNaN(vPixel)||nullData,properties.stop=i>0&&Math.abs(parsed[iAxis]-prevParsed[iAxis])>maxGapLength,segment)properties.parsed=parsed,properties.raw=_dataset.data[i];if(includeOptions)properties.options=sharedOptions||this.resolveDataElementOptions(i,point.active?\"active\":mode);if(!directUpdate)this.updateElement(point,i,properties,mode);prevParsed=parsed}}getMaxOverflow(){let meta=this._cachedMeta,dataset=meta.dataset,border=dataset.options&&dataset.options.borderWidth||0,data=meta.data||[];if(!data.length)return border;let firstPoint=data[0].size(this.resolveDataElementOptions(0)),lastPoint=data[data.length-1].size(this.resolveDataElementOptions(data.length-1));return Math.max(border,firstPoint,lastPoint)/2}draw(){let meta=this._cachedMeta;meta.dataset.updateControlPoints(this.chart.chartArea,meta.iScale.axis),super.draw()}}class PolarAreaController extends DatasetController{static id=\"polarArea\";static defaults={dataElementType:\"arc\",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:\"number\",properties:[\"x\",\"y\",\"startAngle\",\"endAngle\",\"innerRadius\",\"outerRadius\"]}},indexAxis:\"r\",startAngle:0};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(chart){let data=chart.data;if(data.labels.length&&data.datasets.length){let{labels:{pointStyle,color:color2}}=chart.legend.options;return data.labels.map((label,i)=>{let style=chart.getDatasetMeta(0).controller.getStyle(i);return{text:label,fillStyle:style.backgroundColor,strokeStyle:style.borderColor,fontColor:color2,lineWidth:style.borderWidth,pointStyle,hidden:!chart.getDataVisibility(i),index:i}})}return[]}},onClick(e,legendItem,legend){legend.chart.toggleDataVisibility(legendItem.index),legend.chart.update()}}},scales:{r:{type:\"radialLinear\",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(chart,datasetIndex){super(chart,datasetIndex);this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(index){let meta=this._cachedMeta,chart=this.chart,labels=chart.data.labels||[],value=formatNumber(meta._parsed[index].r,chart.options.locale);return{label:labels[index]||\"\",value}}parseObjectData(meta,data,start,count){return _parseObjectDataRadialScale.bind(this)(meta,data,start,count)}update(mode){let arcs=this._cachedMeta.data;this._updateRadius(),this.updateElements(arcs,0,arcs.length,mode)}getMinMax(){let meta=this._cachedMeta,range={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return meta.data.forEach((element,index)=>{let parsed=this.getParsed(index).r;if(!isNaN(parsed)&&this.chart.getDataVisibility(index)){if(parsed<range.min)range.min=parsed;if(parsed>range.max)range.max=parsed}}),range}_updateRadius(){let chart=this.chart,chartArea=chart.chartArea,opts=chart.options,minSize=Math.min(chartArea.right-chartArea.left,chartArea.bottom-chartArea.top),outerRadius=Math.max(minSize/2,0),innerRadius=Math.max(opts.cutoutPercentage?outerRadius/100*opts.cutoutPercentage:1,0),radiusLength=(outerRadius-innerRadius)/chart.getVisibleDatasetCount();this.outerRadius=outerRadius-radiusLength*this.index,this.innerRadius=this.outerRadius-radiusLength}updateElements(arcs,start,count,mode){let reset=mode===\"reset\",chart=this.chart,animationOpts=chart.options.animation,scale=this._cachedMeta.rScale,centerX=scale.xCenter,centerY=scale.yCenter,datasetStartAngle=scale.getIndexAngle(0)-0.5*PI,angle=datasetStartAngle,i,defaultAngle=360/this.countVisibleElements();for(i=0;i<start;++i)angle+=this._computeAngle(i,mode,defaultAngle);for(i=start;i<start+count;i++){let arc=arcs[i],startAngle=angle,endAngle=angle+this._computeAngle(i,mode,defaultAngle),outerRadius=chart.getDataVisibility(i)?scale.getDistanceFromCenterForValue(this.getParsed(i).r):0;if(angle=endAngle,reset){if(animationOpts.animateScale)outerRadius=0;if(animationOpts.animateRotate)startAngle=endAngle=datasetStartAngle}let properties={x:centerX,y:centerY,innerRadius:0,outerRadius,startAngle,endAngle,options:this.resolveDataElementOptions(i,arc.active?\"active\":mode)};this.updateElement(arc,i,properties,mode)}}countVisibleElements(){let meta=this._cachedMeta,count=0;return meta.data.forEach((element,index)=>{if(!isNaN(this.getParsed(index).r)&&this.chart.getDataVisibility(index))count++}),count}_computeAngle(index,mode,defaultAngle){return this.chart.getDataVisibility(index)?toRadians(this.resolveDataElementOptions(index,mode).angle||defaultAngle):0}}class PieController extends DoughnutController{static id=\"pie\";static defaults={cutout:0,rotation:0,circumference:360,radius:\"100%\"}}class RadarController extends DatasetController{static id=\"radar\";static defaults={datasetElementType:\"line\",dataElementType:\"point\",indexAxis:\"r\",showLine:!0,elements:{line:{fill:\"start\"}}};static overrides={aspectRatio:1,scales:{r:{type:\"radialLinear\"}}};getLabelAndValue(index){let vScale=this._cachedMeta.vScale,parsed=this.getParsed(index);return{label:vScale.getLabels()[index],value:\"\"+vScale.getLabelForValue(parsed[vScale.axis])}}parseObjectData(meta,data,start,count){return _parseObjectDataRadialScale.bind(this)(meta,data,start,count)}update(mode){let meta=this._cachedMeta,line=meta.dataset,points=meta.data||[],labels=meta.iScale.getLabels();if(line.points=points,mode!==\"resize\"){let options=this.resolveDatasetElementOptions(mode);if(!this.options.showLine)options.borderWidth=0;let properties={_loop:!0,_fullLoop:labels.length===points.length,options};this.updateElement(line,void 0,properties,mode)}this.updateElements(points,0,points.length,mode)}updateElements(points,start,count,mode){let scale=this._cachedMeta.rScale,reset=mode===\"reset\";for(let i=start;i<start+count;i++){let point=points[i],options=this.resolveDataElementOptions(i,point.active?\"active\":mode),pointPosition=scale.getPointPositionForValue(i,this.getParsed(i).r),x=reset?scale.xCenter:pointPosition.x,y=reset?scale.yCenter:pointPosition.y,properties={x,y,angle:pointPosition.angle,skip:isNaN(x)||isNaN(y),options};this.updateElement(point,i,properties,mode)}}}class ScatterController extends DatasetController{static id=\"scatter\";static defaults={datasetElementType:!1,dataElementType:\"point\",showLine:!1,fill:!1};static overrides={interaction:{mode:\"point\"},scales:{x:{type:\"linear\"},y:{type:\"linear\"}}};getLabelAndValue(index){let meta=this._cachedMeta,labels=this.chart.data.labels||[],{xScale,yScale}=meta,parsed=this.getParsed(index),x=xScale.getLabelForValue(parsed.x),y=yScale.getLabelForValue(parsed.y);return{label:labels[index]||\"\",value:\"(\"+x+\", \"+y+\")\"}}update(mode){let meta=this._cachedMeta,{data:points=[]}=meta,animationsDisabled=this.chart._animationsDisabled,{start,count}=_getStartAndCountOfVisiblePoints(meta,points,animationsDisabled);if(this._drawStart=start,this._drawCount=count,_scaleRangesChanged(meta))start=0,count=points.length;if(this.options.showLine){if(!this.datasetElementType)this.addElements();let{dataset:line,_dataset}=meta;line._chart=this.chart,line._datasetIndex=this.index,line._decimated=!!_dataset._decimated,line.points=points;let options=this.resolveDatasetElementOptions(mode);options.segment=this.options.segment,this.updateElement(line,void 0,{animated:!animationsDisabled,options},mode)}else if(this.datasetElementType)delete meta.dataset,this.datasetElementType=!1;this.updateElements(points,start,count,mode)}addElements(){let{showLine}=this.options;if(!this.datasetElementType&&showLine)this.datasetElementType=this.chart.registry.getElement(\"line\");super.addElements()}updateElements(points,start,count,mode){let reset=mode===\"reset\",{iScale,vScale,_stacked,_dataset}=this._cachedMeta,firstOpts=this.resolveDataElementOptions(start,mode),sharedOptions=this.getSharedOptions(firstOpts),includeOptions=this.includeOptions(mode,sharedOptions),iAxis=iScale.axis,vAxis=vScale.axis,{spanGaps,segment}=this.options,maxGapLength=isNumber(spanGaps)?spanGaps:Number.POSITIVE_INFINITY,directUpdate=this.chart._animationsDisabled||reset||mode===\"none\",prevParsed=start>0&&this.getParsed(start-1);for(let i=start;i<start+count;++i){let point=points[i],parsed=this.getParsed(i),properties=directUpdate?point:{},nullData=isNullOrUndef(parsed[vAxis]),iPixel=properties[iAxis]=iScale.getPixelForValue(parsed[iAxis],i),vPixel=properties[vAxis]=reset||nullData?vScale.getBasePixel():vScale.getPixelForValue(_stacked?this.applyStack(vScale,parsed,_stacked):parsed[vAxis],i);if(properties.skip=isNaN(iPixel)||isNaN(vPixel)||nullData,properties.stop=i>0&&Math.abs(parsed[iAxis]-prevParsed[iAxis])>maxGapLength,segment)properties.parsed=parsed,properties.raw=_dataset.data[i];if(includeOptions)properties.options=sharedOptions||this.resolveDataElementOptions(i,point.active?\"active\":mode);if(!directUpdate)this.updateElement(point,i,properties,mode);prevParsed=parsed}this.updateSharedOptions(sharedOptions,mode,firstOpts)}getMaxOverflow(){let meta=this._cachedMeta,data=meta.data||[];if(!this.options.showLine){let max=0;for(let i=data.length-1;i>=0;--i)max=Math.max(max,data[i].size(this.resolveDataElementOptions(i))/2);return max>0&&max}let dataset=meta.dataset,border=dataset.options&&dataset.options.borderWidth||0;if(!data.length)return border;let firstPoint=data[0].size(this.resolveDataElementOptions(0)),lastPoint=data[data.length-1].size(this.resolveDataElementOptions(data.length-1));return Math.max(border,firstPoint,lastPoint)/2}}var controllers=Object.freeze({__proto__:null,BarController,BubbleController,DoughnutController,LineController,PieController,PolarAreaController,RadarController,ScatterController});function abstract(){throw Error(\"This method is not implemented: Check that a complete date adapter is provided.\")}class DateAdapterBase{static override(members){Object.assign(DateAdapterBase.prototype,members)}options;constructor(options){this.options=options||{}}init(){}formats(){return abstract()}parse(){return abstract()}format(){return abstract()}add(){return abstract()}diff(){return abstract()}startOf(){return abstract()}endOf(){return abstract()}}var adapters={_date:DateAdapterBase};function binarySearch(metaset,axis,value,intersect){let{controller,data,_sorted}=metaset,iScale=controller._cachedMeta.iScale,spanGaps=metaset.dataset?metaset.dataset.options?metaset.dataset.options.spanGaps:null:null;if(iScale&&axis===iScale.axis&&axis!==\"r\"&&_sorted&&data.length){let lookupMethod=iScale._reversePixels?_rlookupByKey:_lookupByKey;if(!intersect){let result=lookupMethod(data,axis,value);if(spanGaps){let{vScale}=controller._cachedMeta,{_parsed}=metaset,distanceToDefinedLo=_parsed.slice(0,result.lo+1).reverse().findIndex((point)=>!isNullOrUndef(point[vScale.axis]));result.lo-=Math.max(0,distanceToDefinedLo);let distanceToDefinedHi=_parsed.slice(result.hi).findIndex((point)=>!isNullOrUndef(point[vScale.axis]));result.hi+=Math.max(0,distanceToDefinedHi)}return result}else if(controller._sharedOptions){let el=data[0],range=typeof el.getRange===\"function\"&&el.getRange(axis);if(range){let start=lookupMethod(data,axis,value-range),end=lookupMethod(data,axis,value+range);return{lo:start.lo,hi:end.hi}}}}return{lo:0,hi:data.length-1}}function evaluateInteractionItems(chart,axis,position,handler,intersect){let metasets=chart.getSortedVisibleDatasetMetas(),value=position[axis];for(let i=0,ilen=metasets.length;i<ilen;++i){let{index,data}=metasets[i],{lo,hi}=binarySearch(metasets[i],axis,value,intersect);for(let j=lo;j<=hi;++j){let element=data[j];if(!element.skip)handler(element,index,j)}}}function getDistanceMetricForAxis(axis){let useX=axis.indexOf(\"x\")!==-1,useY=axis.indexOf(\"y\")!==-1;return function(pt1,pt2){let deltaX=useX?Math.abs(pt1.x-pt2.x):0,deltaY=useY?Math.abs(pt1.y-pt2.y):0;return Math.sqrt(Math.pow(deltaX,2)+Math.pow(deltaY,2))}}function getIntersectItems(chart,position,axis,useFinalPosition,includeInvisible){let items=[];if(!includeInvisible&&!chart.isPointInArea(position))return items;return evaluateInteractionItems(chart,axis,position,function(element,datasetIndex,index){if(!includeInvisible&&!_isPointInArea(element,chart.chartArea,0))return;if(element.inRange(position.x,position.y,useFinalPosition))items.push({element,datasetIndex,index})},!0),items}function getNearestRadialItems(chart,position,axis,useFinalPosition){let items=[];function evaluationFunc(element,datasetIndex,index){let{startAngle,endAngle}=element.getProps([\"startAngle\",\"endAngle\"],useFinalPosition),{angle}=getAngleFromPoint(element,{x:position.x,y:position.y});if(_angleBetween(angle,startAngle,endAngle))items.push({element,datasetIndex,index})}return evaluateInteractionItems(chart,axis,position,evaluationFunc),items}function getNearestCartesianItems(chart,position,axis,intersect,useFinalPosition,includeInvisible){let items=[],distanceMetric=getDistanceMetricForAxis(axis),minDistance=Number.POSITIVE_INFINITY;function evaluationFunc(element,datasetIndex,index){let inRange=element.inRange(position.x,position.y,useFinalPosition);if(intersect&&!inRange)return;let center=element.getCenterPoint(useFinalPosition);if(!(!!includeInvisible||chart.isPointInArea(center))&&!inRange)return;let distance=distanceMetric(position,center);if(distance<minDistance)items=[{element,datasetIndex,index}],minDistance=distance;else if(distance===minDistance)items.push({element,datasetIndex,index})}return evaluateInteractionItems(chart,axis,position,evaluationFunc),items}function getNearestItems(chart,position,axis,intersect,useFinalPosition,includeInvisible){if(!includeInvisible&&!chart.isPointInArea(position))return[];return axis===\"r\"&&!intersect?getNearestRadialItems(chart,position,axis,useFinalPosition):getNearestCartesianItems(chart,position,axis,intersect,useFinalPosition,includeInvisible)}function getAxisItems(chart,position,axis,intersect,useFinalPosition){let items=[],rangeMethod=axis===\"x\"?\"inXRange\":\"inYRange\",intersectsItem=!1;if(evaluateInteractionItems(chart,axis,position,(element,datasetIndex,index)=>{if(element[rangeMethod]&&element[rangeMethod](position[axis],useFinalPosition))items.push({element,datasetIndex,index}),intersectsItem=intersectsItem||element.inRange(position.x,position.y,useFinalPosition)}),intersect&&!intersectsItem)return[];return items}var Interaction={evaluateInteractionItems,modes:{index(chart,e,options,useFinalPosition){let position=getRelativePosition(e,chart),axis=options.axis||\"x\",includeInvisible=options.includeInvisible||!1,items=options.intersect?getIntersectItems(chart,position,axis,useFinalPosition,includeInvisible):getNearestItems(chart,position,axis,!1,useFinalPosition,includeInvisible),elements=[];if(!items.length)return[];return chart.getSortedVisibleDatasetMetas().forEach((meta)=>{let index=items[0].index,element=meta.data[index];if(element&&!element.skip)elements.push({element,datasetIndex:meta.index,index})}),elements},dataset(chart,e,options,useFinalPosition){let position=getRelativePosition(e,chart),axis=options.axis||\"xy\",includeInvisible=options.includeInvisible||!1,items=options.intersect?getIntersectItems(chart,position,axis,useFinalPosition,includeInvisible):getNearestItems(chart,position,axis,!1,useFinalPosition,includeInvisible);if(items.length>0){let datasetIndex=items[0].datasetIndex,data=chart.getDatasetMeta(datasetIndex).data;items=[];for(let i=0;i<data.length;++i)items.push({element:data[i],datasetIndex,index:i})}return items},point(chart,e,options,useFinalPosition){let position=getRelativePosition(e,chart),axis=options.axis||\"xy\",includeInvisible=options.includeInvisible||!1;return getIntersectItems(chart,position,axis,useFinalPosition,includeInvisible)},nearest(chart,e,options,useFinalPosition){let position=getRelativePosition(e,chart),axis=options.axis||\"xy\",includeInvisible=options.includeInvisible||!1;return getNearestItems(chart,position,axis,options.intersect,useFinalPosition,includeInvisible)},x(chart,e,options,useFinalPosition){let position=getRelativePosition(e,chart);return getAxisItems(chart,position,\"x\",options.intersect,useFinalPosition)},y(chart,e,options,useFinalPosition){let position=getRelativePosition(e,chart);return getAxisItems(chart,position,\"y\",options.intersect,useFinalPosition)}}},STATIC_POSITIONS=[\"left\",\"top\",\"right\",\"bottom\"];function filterByPosition(array,position){return array.filter((v)=>v.pos===position)}function filterDynamicPositionByAxis(array,axis){return array.filter((v)=>STATIC_POSITIONS.indexOf(v.pos)===-1&&v.box.axis===axis)}function sortByWeight(array,reverse){return array.sort((a,b)=>{let v0=reverse?b:a,v1=reverse?a:b;return v0.weight===v1.weight?v0.index-v1.index:v0.weight-v1.weight})}function wrapBoxes(boxes){let layoutBoxes=[],i,ilen,box,pos,stack,stackWeight;for(i=0,ilen=(boxes||[]).length;i<ilen;++i)box=boxes[i],{position:pos,options:{stack,stackWeight=1}}=box,layoutBoxes.push({index:i,box,pos,horizontal:box.isHorizontal(),weight:box.weight,stack:stack&&pos+stack,stackWeight});return layoutBoxes}function buildStacks(layouts){let stacks={};for(let wrap of layouts){let{stack,pos,stackWeight}=wrap;if(!stack||!STATIC_POSITIONS.includes(pos))continue;let _stack=stacks[stack]||(stacks[stack]={count:0,placed:0,weight:0,size:0});_stack.count++,_stack.weight+=stackWeight}return stacks}function setLayoutDims(layouts,params){let stacks=buildStacks(layouts),{vBoxMaxWidth,hBoxMaxHeight}=params,i,ilen,layout;for(i=0,ilen=layouts.length;i<ilen;++i){layout=layouts[i];let{fullSize}=layout.box,stack=stacks[layout.stack],factor=stack&&layout.stackWeight/stack.weight;if(layout.horizontal)layout.width=factor?factor*vBoxMaxWidth:fullSize&&params.availableWidth,layout.height=hBoxMaxHeight;else layout.width=vBoxMaxWidth,layout.height=factor?factor*hBoxMaxHeight:fullSize&&params.availableHeight}return stacks}function buildLayoutBoxes(boxes){let layoutBoxes=wrapBoxes(boxes),fullSize=sortByWeight(layoutBoxes.filter((wrap)=>wrap.box.fullSize),!0),left=sortByWeight(filterByPosition(layoutBoxes,\"left\"),!0),right=sortByWeight(filterByPosition(layoutBoxes,\"right\")),top=sortByWeight(filterByPosition(layoutBoxes,\"top\"),!0),bottom=sortByWeight(filterByPosition(layoutBoxes,\"bottom\")),centerHorizontal=filterDynamicPositionByAxis(layoutBoxes,\"x\"),centerVertical=filterDynamicPositionByAxis(layoutBoxes,\"y\");return{fullSize,leftAndTop:left.concat(top),rightAndBottom:right.concat(centerVertical).concat(bottom).concat(centerHorizontal),chartArea:filterByPosition(layoutBoxes,\"chartArea\"),vertical:left.concat(right).concat(centerVertical),horizontal:top.concat(bottom).concat(centerHorizontal)}}function getCombinedMax(maxPadding,chartArea,a,b){return Math.max(maxPadding[a],chartArea[a])+Math.max(maxPadding[b],chartArea[b])}function updateMaxPadding(maxPadding,boxPadding){maxPadding.top=Math.max(maxPadding.top,boxPadding.top),maxPadding.left=Math.max(maxPadding.left,boxPadding.left),maxPadding.bottom=Math.max(maxPadding.bottom,boxPadding.bottom),maxPadding.right=Math.max(maxPadding.right,boxPadding.right)}function updateDims(chartArea,params,layout,stacks){let{pos,box}=layout,maxPadding=chartArea.maxPadding;if(!isObject(pos)){if(layout.size)chartArea[pos]-=layout.size;let stack=stacks[layout.stack]||{size:0,count:1};stack.size=Math.max(stack.size,layout.horizontal?box.height:box.width),layout.size=stack.size/stack.count,chartArea[pos]+=layout.size}if(box.getPadding)updateMaxPadding(maxPadding,box.getPadding());let newWidth=Math.max(0,params.outerWidth-getCombinedMax(maxPadding,chartArea,\"left\",\"right\")),newHeight=Math.max(0,params.outerHeight-getCombinedMax(maxPadding,chartArea,\"top\",\"bottom\")),widthChanged=newWidth!==chartArea.w,heightChanged=newHeight!==chartArea.h;return chartArea.w=newWidth,chartArea.h=newHeight,layout.horizontal?{same:widthChanged,other:heightChanged}:{same:heightChanged,other:widthChanged}}function handleMaxPadding(chartArea){let maxPadding=chartArea.maxPadding;function updatePos(pos){let change=Math.max(maxPadding[pos]-chartArea[pos],0);return chartArea[pos]+=change,change}chartArea.y+=updatePos(\"top\"),chartArea.x+=updatePos(\"left\"),updatePos(\"right\"),updatePos(\"bottom\")}function getMargins(horizontal,chartArea){let maxPadding=chartArea.maxPadding;function marginForPositions(positions2){let margin={left:0,top:0,right:0,bottom:0};return positions2.forEach((pos)=>{margin[pos]=Math.max(chartArea[pos],maxPadding[pos])}),margin}return horizontal?marginForPositions([\"left\",\"right\"]):marginForPositions([\"top\",\"bottom\"])}function fitBoxes(boxes,chartArea,params,stacks){let refitBoxes=[],i,ilen,layout,box,refit,changed;for(i=0,ilen=boxes.length,refit=0;i<ilen;++i){layout=boxes[i],box=layout.box,box.update(layout.width||chartArea.w,layout.height||chartArea.h,getMargins(layout.horizontal,chartArea));let{same,other}=updateDims(chartArea,params,layout,stacks);if(refit|=same&&refitBoxes.length,changed=changed||other,!box.fullSize)refitBoxes.push(layout)}return refit&&fitBoxes(refitBoxes,chartArea,params,stacks)||changed}function setBoxDims(box,left,top,width,height){box.top=top,box.left=left,box.right=left+width,box.bottom=top+height,box.width=width,box.height=height}function placeBoxes(boxes,chartArea,params,stacks){let userPadding=params.padding,{x,y}=chartArea;for(let layout of boxes){let box=layout.box,stack=stacks[layout.stack]||{count:1,placed:0,weight:1},weight=layout.stackWeight/stack.weight||1;if(layout.horizontal){let width=chartArea.w*weight,height=stack.size||box.height;if(defined(stack.start))y=stack.start;if(box.fullSize)setBoxDims(box,userPadding.left,y,params.outerWidth-userPadding.right-userPadding.left,height);else setBoxDims(box,chartArea.left+stack.placed,y,width,height);stack.start=y,stack.placed+=width,y=box.bottom}else{let height=chartArea.h*weight,width=stack.size||box.width;if(defined(stack.start))x=stack.start;if(box.fullSize)setBoxDims(box,x,userPadding.top,width,params.outerHeight-userPadding.bottom-userPadding.top);else setBoxDims(box,x,chartArea.top+stack.placed,width,height);stack.start=x,stack.placed+=height,x=box.right}}chartArea.x=x,chartArea.y=y}var layouts={addBox(chart,item){if(!chart.boxes)chart.boxes=[];item.fullSize=item.fullSize||!1,item.position=item.position||\"top\",item.weight=item.weight||0,item._layers=item._layers||function(){return[{z:0,draw(chartArea){item.draw(chartArea)}}]},chart.boxes.push(item)},removeBox(chart,layoutItem){let index=chart.boxes?chart.boxes.indexOf(layoutItem):-1;if(index!==-1)chart.boxes.splice(index,1)},configure(chart,item,options){item.fullSize=options.fullSize,item.position=options.position,item.weight=options.weight},update(chart,width,height,minPadding){if(!chart)return;let padding=toPadding(chart.options.layout.padding),availableWidth=Math.max(width-padding.width,0),availableHeight=Math.max(height-padding.height,0),boxes=buildLayoutBoxes(chart.boxes),verticalBoxes=boxes.vertical,horizontalBoxes=boxes.horizontal;each(chart.boxes,(box)=>{if(typeof box.beforeLayout===\"function\")box.beforeLayout()});let visibleVerticalBoxCount=verticalBoxes.reduce((total,wrap)=>wrap.box.options&&wrap.box.options.display===!1?total:total+1,0)||1,params=Object.freeze({outerWidth:width,outerHeight:height,padding,availableWidth,availableHeight,vBoxMaxWidth:availableWidth/2/visibleVerticalBoxCount,hBoxMaxHeight:availableHeight/2}),maxPadding=Object.assign({},padding);updateMaxPadding(maxPadding,toPadding(minPadding));let chartArea=Object.assign({maxPadding,w:availableWidth,h:availableHeight,x:padding.left,y:padding.top},padding),stacks=setLayoutDims(verticalBoxes.concat(horizontalBoxes),params);if(fitBoxes(boxes.fullSize,chartArea,params,stacks),fitBoxes(verticalBoxes,chartArea,params,stacks),fitBoxes(horizontalBoxes,chartArea,params,stacks))fitBoxes(verticalBoxes,chartArea,params,stacks);handleMaxPadding(chartArea),placeBoxes(boxes.leftAndTop,chartArea,params,stacks),chartArea.x+=chartArea.w,chartArea.y+=chartArea.h,placeBoxes(boxes.rightAndBottom,chartArea,params,stacks),chart.chartArea={left:chartArea.left,top:chartArea.top,right:chartArea.left+chartArea.w,bottom:chartArea.top+chartArea.h,height:chartArea.h,width:chartArea.w},each(boxes.chartArea,(layout)=>{let box=layout.box;Object.assign(box,chart.chartArea),box.update(chartArea.w,chartArea.h,{left:0,top:0,right:0,bottom:0})})}};class BasePlatform{acquireContext(canvas,aspectRatio){}releaseContext(context){return!1}addEventListener(chart,type,listener){}removeEventListener(chart,type,listener){}getDevicePixelRatio(){return 1}getMaximumSize(element,width,height,aspectRatio){return width=Math.max(0,width||element.width),height=height||element.height,{width,height:Math.max(0,aspectRatio?Math.floor(width/aspectRatio):height)}}isAttached(canvas){return!0}updateConfig(config){}}class BasicPlatform extends BasePlatform{acquireContext(item){return item&&item.getContext&&item.getContext(\"2d\")||null}updateConfig(config){config.options.animation=!1}}var EXPANDO_KEY=\"$chartjs\",EVENT_TYPES={touchstart:\"mousedown\",touchmove:\"mousemove\",touchend:\"mouseup\",pointerenter:\"mouseenter\",pointerdown:\"mousedown\",pointermove:\"mousemove\",pointerup:\"mouseup\",pointerleave:\"mouseout\",pointerout:\"mouseout\"},isNullOrEmpty=(value)=>value===null||value===\"\";function initCanvas(canvas,aspectRatio){let style=canvas.style,renderHeight=canvas.getAttribute(\"height\"),renderWidth=canvas.getAttribute(\"width\");if(canvas[EXPANDO_KEY]={initial:{height:renderHeight,width:renderWidth,style:{display:style.display,height:style.height,width:style.width}}},style.display=style.display||\"block\",style.boxSizing=style.boxSizing||\"border-box\",isNullOrEmpty(renderWidth)){let displayWidth=readUsedSize(canvas,\"width\");if(displayWidth!==void 0)canvas.width=displayWidth}if(isNullOrEmpty(renderHeight))if(canvas.style.height===\"\")canvas.height=canvas.width/(aspectRatio||2);else{let displayHeight=readUsedSize(canvas,\"height\");if(displayHeight!==void 0)canvas.height=displayHeight}return canvas}var eventListenerOptions=supportsEventListenerOptions?{passive:!0}:!1;function addListener(node,type,listener){if(node)node.addEventListener(type,listener,eventListenerOptions)}function removeListener(chart,type,listener){if(chart&&chart.canvas)chart.canvas.removeEventListener(type,listener,eventListenerOptions)}function fromNativeEvent(event,chart){let type=EVENT_TYPES[event.type]||event.type,{x,y}=getRelativePosition(event,chart);return{type,chart,native:event,x:x!==void 0?x:null,y:y!==void 0?y:null}}function nodeListContains(nodeList,canvas){for(let node of nodeList)if(node===canvas||node.contains(canvas))return!0}function createAttachObserver(chart,type,listener){let canvas=chart.canvas,observer=new MutationObserver((entries)=>{let trigger=!1;for(let entry of entries)trigger=trigger||nodeListContains(entry.addedNodes,canvas),trigger=trigger&&!nodeListContains(entry.removedNodes,canvas);if(trigger)listener()});return observer.observe(document,{childList:!0,subtree:!0}),observer}function createDetachObserver(chart,type,listener){let canvas=chart.canvas,observer=new MutationObserver((entries)=>{let trigger=!1;for(let entry of entries)trigger=trigger||nodeListContains(entry.removedNodes,canvas),trigger=trigger&&!nodeListContains(entry.addedNodes,canvas);if(trigger)listener()});return observer.observe(document,{childList:!0,subtree:!0}),observer}var drpListeningCharts=new Map,oldDevicePixelRatio=0;function onWindowResize(){let dpr=window.devicePixelRatio;if(dpr===oldDevicePixelRatio)return;oldDevicePixelRatio=dpr,drpListeningCharts.forEach((resize,chart)=>{if(chart.currentDevicePixelRatio!==dpr)resize()})}function listenDevicePixelRatioChanges(chart,resize){if(!drpListeningCharts.size)window.addEventListener(\"resize\",onWindowResize);drpListeningCharts.set(chart,resize)}function unlistenDevicePixelRatioChanges(chart){if(drpListeningCharts.delete(chart),!drpListeningCharts.size)window.removeEventListener(\"resize\",onWindowResize)}function createResizeObserver(chart,type,listener){let canvas=chart.canvas,container=canvas&&_getParentNode(canvas);if(!container)return;let resize=throttled((width,height)=>{let w=container.clientWidth;if(listener(width,height),w<container.clientWidth)listener()},window),observer=new ResizeObserver((entries)=>{let entry=entries[0],width=entry.contentRect.width,height=entry.contentRect.height;if(width===0&&height===0)return;resize(width,height)});return observer.observe(container),listenDevicePixelRatioChanges(chart,resize),observer}function releaseObserver(chart,type,observer){if(observer)observer.disconnect();if(type===\"resize\")unlistenDevicePixelRatioChanges(chart)}function createProxyAndListen(chart,type,listener){let canvas=chart.canvas,proxy=throttled((event)=>{if(chart.ctx!==null)listener(fromNativeEvent(event,chart))},chart);return addListener(canvas,type,proxy),proxy}class DomPlatform extends BasePlatform{acquireContext(canvas,aspectRatio){let context=canvas&&canvas.getContext&&canvas.getContext(\"2d\");if(context&&context.canvas===canvas)return initCanvas(canvas,aspectRatio),context;return null}releaseContext(context){let canvas=context.canvas;if(!canvas[EXPANDO_KEY])return!1;let initial=canvas[EXPANDO_KEY].initial;[\"height\",\"width\"].forEach((prop)=>{let value=initial[prop];if(isNullOrUndef(value))canvas.removeAttribute(prop);else canvas.setAttribute(prop,value)});let style=initial.style||{};return Object.keys(style).forEach((key)=>{canvas.style[key]=style[key]}),canvas.width=canvas.width,delete canvas[EXPANDO_KEY],!0}addEventListener(chart,type,listener){this.removeEventListener(chart,type);let proxies=chart.$proxies||(chart.$proxies={}),handler={attach:createAttachObserver,detach:createDetachObserver,resize:createResizeObserver}[type]||createProxyAndListen;proxies[type]=handler(chart,type,listener)}removeEventListener(chart,type){let proxies=chart.$proxies||(chart.$proxies={}),proxy=proxies[type];if(!proxy)return;({attach:releaseObserver,detach:releaseObserver,resize:releaseObserver}[type]||removeListener)(chart,type,proxy),proxies[type]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(canvas,width,height,aspectRatio){return getMaximumSize(canvas,width,height,aspectRatio)}isAttached(canvas){let container=canvas&&_getParentNode(canvas);return!!(container&&container.isConnected)}}function _detectPlatform(canvas){if(!_isDomSupported()||typeof OffscreenCanvas<\"u\"&&canvas instanceof OffscreenCanvas)return BasicPlatform;return DomPlatform}class Element{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(useFinalPosition){let{x,y}=this.getProps([\"x\",\"y\"],useFinalPosition);return{x,y}}hasValue(){return isNumber(this.x)&&isNumber(this.y)}getProps(props,final){let anims=this.$animations;if(!final||!anims)return this;let ret={};return props.forEach((prop)=>{ret[prop]=anims[prop]&&anims[prop].active()?anims[prop]._to:this[prop]}),ret}}function autoSkip(scale,ticks){let tickOpts=scale.options.ticks,determinedMaxTicks=determineMaxTicks(scale),ticksLimit=Math.min(tickOpts.maxTicksLimit||determinedMaxTicks,determinedMaxTicks),majorIndices=tickOpts.major.enabled?getMajorIndices(ticks):[],numMajorIndices=majorIndices.length,first=majorIndices[0],last=majorIndices[numMajorIndices-1],newTicks=[];if(numMajorIndices>ticksLimit)return skipMajors(ticks,newTicks,majorIndices,numMajorIndices/ticksLimit),newTicks;let spacing=calculateSpacing(majorIndices,ticks,ticksLimit);if(numMajorIndices>0){let i,ilen,avgMajorSpacing=numMajorIndices>1?Math.round((last-first)/(numMajorIndices-1)):null;skip(ticks,newTicks,spacing,isNullOrUndef(avgMajorSpacing)?0:first-avgMajorSpacing,first);for(i=0,ilen=numMajorIndices-1;i<ilen;i++)skip(ticks,newTicks,spacing,majorIndices[i],majorIndices[i+1]);return skip(ticks,newTicks,spacing,last,isNullOrUndef(avgMajorSpacing)?ticks.length:last+avgMajorSpacing),newTicks}return skip(ticks,newTicks,spacing),newTicks}function determineMaxTicks(scale){let offset=scale.options.offset,tickLength=scale._tickSize(),maxScale=scale._length/tickLength+(offset?0:1),maxChart=scale._maxLength/tickLength;return Math.floor(Math.min(maxScale,maxChart))}function calculateSpacing(majorIndices,ticks,ticksLimit){let evenMajorSpacing=getEvenSpacing(majorIndices),spacing=ticks.length/ticksLimit;if(!evenMajorSpacing)return Math.max(spacing,1);let factors=_factorize(evenMajorSpacing);for(let i=0,ilen=factors.length-1;i<ilen;i++){let factor=factors[i];if(factor>spacing)return factor}return Math.max(spacing,1)}function getMajorIndices(ticks){let result=[],i,ilen;for(i=0,ilen=ticks.length;i<ilen;i++)if(ticks[i].major)result.push(i);return result}function skipMajors(ticks,newTicks,majorIndices,spacing){let count=0,next=majorIndices[0],i;spacing=Math.ceil(spacing);for(i=0;i<ticks.length;i++)if(i===next)newTicks.push(ticks[i]),count++,next=majorIndices[count*spacing]}function skip(ticks,newTicks,spacing,majorStart,majorEnd){let start=valueOrDefault(majorStart,0),end=Math.min(valueOrDefault(majorEnd,ticks.length),ticks.length),count=0,length,i,next;if(spacing=Math.ceil(spacing),majorEnd)length=majorEnd-majorStart,spacing=length/Math.floor(length/spacing);next=start;while(next<0)count++,next=Math.round(start+count*spacing);for(i=Math.max(start,0);i<end;i++)if(i===next)newTicks.push(ticks[i]),count++,next=Math.round(start+count*spacing)}function getEvenSpacing(arr){let len=arr.length,i,diff;if(len<2)return!1;for(diff=arr[0],i=1;i<len;++i)if(arr[i]-arr[i-1]!==diff)return!1;return diff}var reverseAlign=(align)=>align===\"left\"?\"right\":align===\"right\"?\"left\":align,offsetFromEdge=(scale,edge,offset)=>edge===\"top\"||edge===\"left\"?scale[edge]+offset:scale[edge]-offset,getTicksLimit=(ticksLength,maxTicksLimit)=>Math.min(maxTicksLimit||ticksLength,ticksLength);function sample(arr,numItems){let result=[],increment=arr.length/numItems,len=arr.length,i=0;for(;i<len;i+=increment)result.push(arr[Math.floor(i)]);return result}function getPixelForGridLine(scale,index,offsetGridLines){let length=scale.ticks.length,validIndex=Math.min(index,length-1),start=scale._startPixel,end=scale._endPixel,epsilon=0.000001,lineValue=scale.getPixelForTick(validIndex),offset;if(offsetGridLines){if(length===1)offset=Math.max(lineValue-start,end-lineValue);else if(index===0)offset=(scale.getPixelForTick(1)-lineValue)/2;else offset=(lineValue-scale.getPixelForTick(validIndex-1))/2;if(lineValue+=validIndex<index?offset:-offset,lineValue<start-0.000001||lineValue>end+0.000001)return}return lineValue}function garbageCollect(caches,length){each(caches,(cache)=>{let gc=cache.gc,gcLen=gc.length/2,i;if(gcLen>length){for(i=0;i<gcLen;++i)delete cache.data[gc[i]];gc.splice(0,gcLen)}})}function getTickMarkLength(options){return options.drawTicks?options.tickLength:0}function getTitleHeight(options,fallback){if(!options.display)return 0;let font=toFont(options.font,fallback),padding=toPadding(options.padding);return(isArray(options.text)?options.text.length:1)*font.lineHeight+padding.height}function createScaleContext(parent,scale){return createContext(parent,{scale,type:\"scale\"})}function createTickContext(parent,index,tick){return createContext(parent,{tick,index,type:\"tick\"})}function titleAlign(align,position,reverse){let ret=_toLeftRightCenter(align);if(reverse&&position!==\"right\"||!reverse&&position===\"right\")ret=reverseAlign(ret);return ret}function titleArgs(scale,offset,position,align){let{top,left,bottom,right,chart}=scale,{chartArea,scales}=chart,rotation=0,maxWidth,titleX,titleY,height=bottom-top,width=right-left;if(scale.isHorizontal()){if(titleX=_alignStartEnd(align,left,right),isObject(position)){let positionAxisID=Object.keys(position)[0],value=position[positionAxisID];titleY=scales[positionAxisID].getPixelForValue(value)+height-offset}else if(position===\"center\")titleY=(chartArea.bottom+chartArea.top)/2+height-offset;else titleY=offsetFromEdge(scale,position,offset);maxWidth=right-left}else{if(isObject(position)){let positionAxisID=Object.keys(position)[0],value=position[positionAxisID];titleX=scales[positionAxisID].getPixelForValue(value)-width+offset}else if(position===\"center\")titleX=(chartArea.left+chartArea.right)/2-width+offset;else titleX=offsetFromEdge(scale,position,offset);titleY=_alignStartEnd(align,bottom,top),rotation=position===\"left\"?-HALF_PI:HALF_PI}return{titleX,titleY,maxWidth,rotation}}class Scale extends Element{constructor(cfg){super();this.id=cfg.id,this.type=cfg.type,this.options=void 0,this.ctx=cfg.ctx,this.chart=cfg.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(options){this.options=options.setContext(this.getContext()),this.axis=options.axis,this._userMin=this.parse(options.min),this._userMax=this.parse(options.max),this._suggestedMin=this.parse(options.suggestedMin),this._suggestedMax=this.parse(options.suggestedMax)}parse(raw,index){return raw}getUserBounds(){let{_userMin,_userMax,_suggestedMin,_suggestedMax}=this;return _userMin=finiteOrDefault(_userMin,Number.POSITIVE_INFINITY),_userMax=finiteOrDefault(_userMax,Number.NEGATIVE_INFINITY),_suggestedMin=finiteOrDefault(_suggestedMin,Number.POSITIVE_INFINITY),_suggestedMax=finiteOrDefault(_suggestedMax,Number.NEGATIVE_INFINITY),{min:finiteOrDefault(_userMin,_suggestedMin),max:finiteOrDefault(_userMax,_suggestedMax),minDefined:isNumberFinite(_userMin),maxDefined:isNumberFinite(_userMax)}}getMinMax(canStack){let{min,max,minDefined,maxDefined}=this.getUserBounds(),range;if(minDefined&&maxDefined)return{min,max};let metas=this.getMatchingVisibleMetas();for(let i=0,ilen=metas.length;i<ilen;++i){if(range=metas[i].controller.getMinMax(this,canStack),!minDefined)min=Math.min(min,range.min);if(!maxDefined)max=Math.max(max,range.max)}return min=maxDefined&&min>max?max:min,max=minDefined&&min>max?min:max,{min:finiteOrDefault(min,finiteOrDefault(max,min)),max:finiteOrDefault(max,finiteOrDefault(min,max))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){let data=this.chart.data;return this.options.labels||(this.isHorizontal()?data.xLabels:data.yLabels)||data.labels||[]}getLabelItems(chartArea=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(chartArea))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){callback(this.options.beforeUpdate,[this])}update(maxWidth,maxHeight,margins){let{beginAtZero,grace,ticks:tickOpts}=this.options,sampleSize=tickOpts.sampleSize;if(this.beforeUpdate(),this.maxWidth=maxWidth,this.maxHeight=maxHeight,this._margins=margins=Object.assign({left:0,right:0,top:0,bottom:0},margins),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+margins.left+margins.right:this.height+margins.top+margins.bottom,!this._dataLimitsCached)this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=_addGrace(this,grace,beginAtZero),this._dataLimitsCached=!0;this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();let samplingEnabled=sampleSize<this.ticks.length;if(this._convertTicksToLabels(samplingEnabled?sample(this.ticks,sampleSize):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),tickOpts.display&&(tickOpts.autoSkip||tickOpts.source===\"auto\"))this.ticks=autoSkip(this,this.ticks),this._labelSizes=null,this.afterAutoSkip();if(samplingEnabled)this._convertTicksToLabels(this.ticks);this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let reversePixels=this.options.reverse,startPixel,endPixel;if(this.isHorizontal())startPixel=this.left,endPixel=this.right;else startPixel=this.top,endPixel=this.bottom,reversePixels=!reversePixels;this._startPixel=startPixel,this._endPixel=endPixel,this._reversePixels=reversePixels,this._length=endPixel-startPixel,this._alignToPixels=this.options.alignToPixels}afterUpdate(){callback(this.options.afterUpdate,[this])}beforeSetDimensions(){callback(this.options.beforeSetDimensions,[this])}setDimensions(){if(this.isHorizontal())this.width=this.maxWidth,this.left=0,this.right=this.width;else this.height=this.maxHeight,this.top=0,this.bottom=this.height;this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){callback(this.options.afterSetDimensions,[this])}_callHooks(name){this.chart.notifyPlugins(name,this.getContext()),callback(this.options[name],[this])}beforeDataLimits(){this._callHooks(\"beforeDataLimits\")}determineDataLimits(){}afterDataLimits(){this._callHooks(\"afterDataLimits\")}beforeBuildTicks(){this._callHooks(\"beforeBuildTicks\")}buildTicks(){return[]}afterBuildTicks(){this._callHooks(\"afterBuildTicks\")}beforeTickToLabelConversion(){callback(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(ticks){let tickOpts=this.options.ticks,i,ilen,tick;for(i=0,ilen=ticks.length;i<ilen;i++)tick=ticks[i],tick.label=callback(tickOpts.callback,[tick.value,i,ticks],this)}afterTickToLabelConversion(){callback(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){callback(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){let options=this.options,tickOpts=options.ticks,numTicks=getTicksLimit(this.ticks.length,options.ticks.maxTicksLimit),minRotation=tickOpts.minRotation||0,maxRotation=tickOpts.maxRotation,labelRotation=minRotation,tickWidth,maxHeight,maxLabelDiagonal;if(!this._isVisible()||!tickOpts.display||minRotation>=maxRotation||numTicks<=1||!this.isHorizontal()){this.labelRotation=minRotation;return}let labelSizes=this._getLabelSizes(),maxLabelWidth=labelSizes.widest.width,maxLabelHeight=labelSizes.highest.height,maxWidth=_limitValue(this.chart.width-maxLabelWidth,0,this.maxWidth);if(tickWidth=options.offset?this.maxWidth/numTicks:maxWidth/(numTicks-1),maxLabelWidth+6>tickWidth)tickWidth=maxWidth/(numTicks-(options.offset?0.5:1)),maxHeight=this.maxHeight-getTickMarkLength(options.grid)-tickOpts.padding-getTitleHeight(options.title,this.chart.options.font),maxLabelDiagonal=Math.sqrt(maxLabelWidth*maxLabelWidth+maxLabelHeight*maxLabelHeight),labelRotation=toDegrees(Math.min(Math.asin(_limitValue((labelSizes.highest.height+6)/tickWidth,-1,1)),Math.asin(_limitValue(maxHeight/maxLabelDiagonal,-1,1))-Math.asin(_limitValue(maxLabelHeight/maxLabelDiagonal,-1,1)))),labelRotation=Math.max(minRotation,Math.min(maxRotation,labelRotation));this.labelRotation=labelRotation}afterCalculateLabelRotation(){callback(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){callback(this.options.beforeFit,[this])}fit(){let minSize={width:0,height:0},{chart,options:{ticks:tickOpts,title:titleOpts,grid:gridOpts}}=this,display=this._isVisible(),isHorizontal=this.isHorizontal();if(display){let titleHeight=getTitleHeight(titleOpts,chart.options.font);if(isHorizontal)minSize.width=this.maxWidth,minSize.height=getTickMarkLength(gridOpts)+titleHeight;else minSize.height=this.maxHeight,minSize.width=getTickMarkLength(gridOpts)+titleHeight;if(tickOpts.display&&this.ticks.length){let{first,last,widest,highest}=this._getLabelSizes(),tickPadding=tickOpts.padding*2,angleRadians=toRadians(this.labelRotation),cos=Math.cos(angleRadians),sin=Math.sin(angleRadians);if(isHorizontal){let labelHeight=tickOpts.mirror?0:sin*widest.width+cos*highest.height;minSize.height=Math.min(this.maxHeight,minSize.height+labelHeight+tickPadding)}else{let labelWidth=tickOpts.mirror?0:cos*widest.width+sin*highest.height;minSize.width=Math.min(this.maxWidth,minSize.width+labelWidth+tickPadding)}this._calculatePadding(first,last,sin,cos)}}if(this._handleMargins(),isHorizontal)this.width=this._length=chart.width-this._margins.left-this._margins.right,this.height=minSize.height;else this.width=minSize.width,this.height=this._length=chart.height-this._margins.top-this._margins.bottom}_calculatePadding(first,last,sin,cos){let{ticks:{align,padding},position}=this.options,isRotated=this.labelRotation!==0,labelsBelowTicks=position!==\"top\"&&this.axis===\"x\";if(this.isHorizontal()){let offsetLeft=this.getPixelForTick(0)-this.left,offsetRight=this.right-this.getPixelForTick(this.ticks.length-1),paddingLeft=0,paddingRight=0;if(isRotated)if(labelsBelowTicks)paddingLeft=cos*first.width,paddingRight=sin*last.height;else paddingLeft=sin*first.height,paddingRight=cos*last.width;else if(align===\"start\")paddingRight=last.width;else if(align===\"end\")paddingLeft=first.width;else if(align!==\"inner\")paddingLeft=first.width/2,paddingRight=last.width/2;this.paddingLeft=Math.max((paddingLeft-offsetLeft+padding)*this.width/(this.width-offsetLeft),0),this.paddingRight=Math.max((paddingRight-offsetRight+padding)*this.width/(this.width-offsetRight),0)}else{let paddingTop=last.height/2,paddingBottom=first.height/2;if(align===\"start\")paddingTop=0,paddingBottom=first.height;else if(align===\"end\")paddingTop=last.height,paddingBottom=0;this.paddingTop=paddingTop+padding,this.paddingBottom=paddingBottom+padding}}_handleMargins(){if(this._margins)this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom)}afterFit(){callback(this.options.afterFit,[this])}isHorizontal(){let{axis,position}=this.options;return position===\"top\"||position===\"bottom\"||axis===\"x\"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(ticks){this.beforeTickToLabelConversion(),this.generateTickLabels(ticks);let i,ilen;for(i=0,ilen=ticks.length;i<ilen;i++)if(isNullOrUndef(ticks[i].label))ticks.splice(i,1),ilen--,i--;this.afterTickToLabelConversion()}_getLabelSizes(){let labelSizes=this._labelSizes;if(!labelSizes){let sampleSize=this.options.ticks.sampleSize,ticks=this.ticks;if(sampleSize<ticks.length)ticks=sample(ticks,sampleSize);this._labelSizes=labelSizes=this._computeLabelSizes(ticks,ticks.length,this.options.ticks.maxTicksLimit)}return labelSizes}_computeLabelSizes(ticks,length,maxTicksLimit){let{ctx,_longestTextCache:caches}=this,widths=[],heights=[],increment=Math.floor(length/getTicksLimit(length,maxTicksLimit)),widestLabelSize=0,highestLabelSize=0,i,j,jlen,label,tickFont,fontString,cache,lineHeight,width,height,nestedLabel;for(i=0;i<length;i+=increment){if(label=ticks[i].label,tickFont=this._resolveTickFontOptions(i),ctx.font=fontString=tickFont.string,cache=caches[fontString]=caches[fontString]||{data:{},gc:[]},lineHeight=tickFont.lineHeight,width=height=0,!isNullOrUndef(label)&&!isArray(label))width=_measureText(ctx,cache.data,cache.gc,width,label),height=lineHeight;else if(isArray(label)){for(j=0,jlen=label.length;j<jlen;++j)if(nestedLabel=label[j],!isNullOrUndef(nestedLabel)&&!isArray(nestedLabel))width=_measureText(ctx,cache.data,cache.gc,width,nestedLabel),height+=lineHeight}widths.push(width),heights.push(height),widestLabelSize=Math.max(width,widestLabelSize),highestLabelSize=Math.max(height,highestLabelSize)}garbageCollect(caches,length);let widest=widths.indexOf(widestLabelSize),highest=heights.indexOf(highestLabelSize),valueAt=(idx)=>({width:widths[idx]||0,height:heights[idx]||0});return{first:valueAt(0),last:valueAt(length-1),widest:valueAt(widest),highest:valueAt(highest),widths,heights}}getLabelForValue(value){return value}getPixelForValue(value,index){return NaN}getValueForPixel(pixel){}getPixelForTick(index){let ticks=this.ticks;if(index<0||index>ticks.length-1)return null;return this.getPixelForValue(ticks[index].value)}getPixelForDecimal(decimal){if(this._reversePixels)decimal=1-decimal;let pixel=this._startPixel+decimal*this._length;return _int16Range(this._alignToPixels?_alignPixel(this.chart,pixel,0):pixel)}getDecimalForPixel(pixel){let decimal=(pixel-this._startPixel)/this._length;return this._reversePixels?1-decimal:decimal}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){let{min,max}=this;return min<0&&max<0?max:min>0&&max>0?min:0}getContext(index){let ticks=this.ticks||[];if(index>=0&&index<ticks.length){let tick=ticks[index];return tick.$context||(tick.$context=createTickContext(this.getContext(),index,tick))}return this.$context||(this.$context=createScaleContext(this.chart.getContext(),this))}_tickSize(){let optionTicks=this.options.ticks,rot=toRadians(this.labelRotation),cos=Math.abs(Math.cos(rot)),sin=Math.abs(Math.sin(rot)),labelSizes=this._getLabelSizes(),padding=optionTicks.autoSkipPadding||0,w=labelSizes?labelSizes.widest.width+padding:0,h=labelSizes?labelSizes.highest.height+padding:0;return this.isHorizontal()?h*cos>w*sin?w/cos:h/sin:h*sin<w*cos?h/cos:w/sin}_isVisible(){let display=this.options.display;if(display!==\"auto\")return!!display;return this.getMatchingVisibleMetas().length>0}_computeGridLineItems(chartArea){let axis=this.axis,chart=this.chart,options=this.options,{grid,position,border}=options,offset=grid.offset,isHorizontal=this.isHorizontal(),ticksLength=this.ticks.length+(offset?1:0),tl=getTickMarkLength(grid),items=[],borderOpts=border.setContext(this.getContext()),axisWidth=borderOpts.display?borderOpts.width:0,axisHalfWidth=axisWidth/2,alignBorderValue=function(pixel){return _alignPixel(chart,pixel,axisWidth)},borderValue,i,lineValue,alignedLineValue,tx1,ty1,tx2,ty2,x1,y1,x2,y2;if(position===\"top\")borderValue=alignBorderValue(this.bottom),ty1=this.bottom-tl,ty2=borderValue-axisHalfWidth,y1=alignBorderValue(chartArea.top)+axisHalfWidth,y2=chartArea.bottom;else if(position===\"bottom\")borderValue=alignBorderValue(this.top),y1=chartArea.top,y2=alignBorderValue(chartArea.bottom)-axisHalfWidth,ty1=borderValue+axisHalfWidth,ty2=this.top+tl;else if(position===\"left\")borderValue=alignBorderValue(this.right),tx1=this.right-tl,tx2=borderValue-axisHalfWidth,x1=alignBorderValue(chartArea.left)+axisHalfWidth,x2=chartArea.right;else if(position===\"right\")borderValue=alignBorderValue(this.left),x1=chartArea.left,x2=alignBorderValue(chartArea.right)-axisHalfWidth,tx1=borderValue+axisHalfWidth,tx2=this.left+tl;else if(axis===\"x\"){if(position===\"center\")borderValue=alignBorderValue((chartArea.top+chartArea.bottom)/2+0.5);else if(isObject(position)){let positionAxisID=Object.keys(position)[0],value=position[positionAxisID];borderValue=alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value))}y1=chartArea.top,y2=chartArea.bottom,ty1=borderValue+axisHalfWidth,ty2=ty1+tl}else if(axis===\"y\"){if(position===\"center\")borderValue=alignBorderValue((chartArea.left+chartArea.right)/2);else if(isObject(position)){let positionAxisID=Object.keys(position)[0],value=position[positionAxisID];borderValue=alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value))}tx1=borderValue-axisHalfWidth,tx2=tx1-tl,x1=chartArea.left,x2=chartArea.right}let limit=valueOrDefault(options.ticks.maxTicksLimit,ticksLength),step=Math.max(1,Math.ceil(ticksLength/limit));for(i=0;i<ticksLength;i+=step){let context=this.getContext(i),optsAtIndex=grid.setContext(context),optsAtIndexBorder=border.setContext(context),lineWidth=optsAtIndex.lineWidth,lineColor=optsAtIndex.color,borderDash=optsAtIndexBorder.dash||[],borderDashOffset=optsAtIndexBorder.dashOffset,tickWidth=optsAtIndex.tickWidth,tickColor=optsAtIndex.tickColor,tickBorderDash=optsAtIndex.tickBorderDash||[],tickBorderDashOffset=optsAtIndex.tickBorderDashOffset;if(lineValue=getPixelForGridLine(this,i,offset),lineValue===void 0)continue;if(alignedLineValue=_alignPixel(chart,lineValue,lineWidth),isHorizontal)tx1=tx2=x1=x2=alignedLineValue;else ty1=ty2=y1=y2=alignedLineValue;items.push({tx1,ty1,tx2,ty2,x1,y1,x2,y2,width:lineWidth,color:lineColor,borderDash,borderDashOffset,tickWidth,tickColor,tickBorderDash,tickBorderDashOffset})}return this._ticksLength=ticksLength,this._borderValue=borderValue,items}_computeLabelItems(chartArea){let axis=this.axis,options=this.options,{position,ticks:optionTicks}=options,isHorizontal=this.isHorizontal(),ticks=this.ticks,{align,crossAlign,padding,mirror}=optionTicks,tl=getTickMarkLength(options.grid),tickAndPadding=tl+padding,hTickAndPadding=mirror?-padding:tickAndPadding,rotation=-toRadians(this.labelRotation),items=[],i,ilen,tick,label,x,y,textAlign,pixel,font,lineHeight,lineCount,textOffset,textBaseline=\"middle\";if(position===\"top\")y=this.bottom-hTickAndPadding,textAlign=this._getXAxisLabelAlignment();else if(position===\"bottom\")y=this.top+hTickAndPadding,textAlign=this._getXAxisLabelAlignment();else if(position===\"left\"){let ret=this._getYAxisLabelAlignment(tl);textAlign=ret.textAlign,x=ret.x}else if(position===\"right\"){let ret=this._getYAxisLabelAlignment(tl);textAlign=ret.textAlign,x=ret.x}else if(axis===\"x\"){if(position===\"center\")y=(chartArea.top+chartArea.bottom)/2+tickAndPadding;else if(isObject(position)){let positionAxisID=Object.keys(position)[0],value=position[positionAxisID];y=this.chart.scales[positionAxisID].getPixelForValue(value)+tickAndPadding}textAlign=this._getXAxisLabelAlignment()}else if(axis===\"y\"){if(position===\"center\")x=(chartArea.left+chartArea.right)/2-tickAndPadding;else if(isObject(position)){let positionAxisID=Object.keys(position)[0],value=position[positionAxisID];x=this.chart.scales[positionAxisID].getPixelForValue(value)}textAlign=this._getYAxisLabelAlignment(tl).textAlign}if(axis===\"y\"){if(align===\"start\")textBaseline=\"top\";else if(align===\"end\")textBaseline=\"bottom\"}let labelSizes=this._getLabelSizes();for(i=0,ilen=ticks.length;i<ilen;++i){tick=ticks[i],label=tick.label;let optsAtIndex=optionTicks.setContext(this.getContext(i));pixel=this.getPixelForTick(i)+optionTicks.labelOffset,font=this._resolveTickFontOptions(i),lineHeight=font.lineHeight,lineCount=isArray(label)?label.length:1;let halfCount=lineCount/2,color2=optsAtIndex.color,strokeColor=optsAtIndex.textStrokeColor,strokeWidth=optsAtIndex.textStrokeWidth,tickTextAlign=textAlign;if(isHorizontal){if(x=pixel,textAlign===\"inner\")if(i===ilen-1)tickTextAlign=!this.options.reverse?\"right\":\"left\";else if(i===0)tickTextAlign=!this.options.reverse?\"left\":\"right\";else tickTextAlign=\"center\";if(position===\"top\")if(crossAlign===\"near\"||rotation!==0)textOffset=-lineCount*lineHeight+lineHeight/2;else if(crossAlign===\"center\")textOffset=-labelSizes.highest.height/2-halfCount*lineHeight+lineHeight;else textOffset=-labelSizes.highest.height+lineHeight/2;else if(crossAlign===\"near\"||rotation!==0)textOffset=lineHeight/2;else if(crossAlign===\"center\")textOffset=labelSizes.highest.height/2-halfCount*lineHeight;else textOffset=labelSizes.highest.height-lineCount*lineHeight;if(mirror)textOffset*=-1;if(rotation!==0&&!optsAtIndex.showLabelBackdrop)x+=lineHeight/2*Math.sin(rotation)}else y=pixel,textOffset=(1-lineCount)*lineHeight/2;let backdrop;if(optsAtIndex.showLabelBackdrop){let labelPadding=toPadding(optsAtIndex.backdropPadding),height=labelSizes.heights[i],width=labelSizes.widths[i],top=textOffset-labelPadding.top,left=0-labelPadding.left;switch(textBaseline){case\"middle\":top-=height/2;break;case\"bottom\":top-=height;break}switch(textAlign){case\"center\":left-=width/2;break;case\"right\":left-=width;break;case\"inner\":if(i===ilen-1)left-=width;else if(i>0)left-=width/2;break}backdrop={left,top,width:width+labelPadding.width,height:height+labelPadding.height,color:optsAtIndex.backdropColor}}items.push({label,font,textOffset,options:{rotation,color:color2,strokeColor,strokeWidth,textAlign:tickTextAlign,textBaseline,translation:[x,y],backdrop}})}return items}_getXAxisLabelAlignment(){let{position,ticks}=this.options;if(-toRadians(this.labelRotation))return position===\"top\"?\"left\":\"right\";let align=\"center\";if(ticks.align===\"start\")align=\"left\";else if(ticks.align===\"end\")align=\"right\";else if(ticks.align===\"inner\")align=\"inner\";return align}_getYAxisLabelAlignment(tl){let{position,ticks:{crossAlign,mirror,padding}}=this.options,labelSizes=this._getLabelSizes(),tickAndPadding=tl+padding,widest=labelSizes.widest.width,textAlign,x;if(position===\"left\")if(mirror)if(x=this.right+padding,crossAlign===\"near\")textAlign=\"left\";else if(crossAlign===\"center\")textAlign=\"center\",x+=widest/2;else textAlign=\"right\",x+=widest;else if(x=this.right-tickAndPadding,crossAlign===\"near\")textAlign=\"right\";else if(crossAlign===\"center\")textAlign=\"center\",x-=widest/2;else textAlign=\"left\",x=this.left;else if(position===\"right\")if(mirror)if(x=this.left+padding,crossAlign===\"near\")textAlign=\"right\";else if(crossAlign===\"center\")textAlign=\"center\",x-=widest/2;else textAlign=\"left\",x-=widest;else if(x=this.left+tickAndPadding,crossAlign===\"near\")textAlign=\"left\";else if(crossAlign===\"center\")textAlign=\"center\",x+=widest/2;else textAlign=\"right\",x=this.right;else textAlign=\"right\";return{textAlign,x}}_computeLabelArea(){if(this.options.ticks.mirror)return;let chart=this.chart,position=this.options.position;if(position===\"left\"||position===\"right\")return{top:0,left:this.left,bottom:chart.height,right:this.right};if(position===\"top\"||position===\"bottom\")return{top:this.top,left:0,bottom:this.bottom,right:chart.width}}drawBackground(){let{ctx,options:{backgroundColor},left,top,width,height}=this;if(backgroundColor)ctx.save(),ctx.fillStyle=backgroundColor,ctx.fillRect(left,top,width,height),ctx.restore()}getLineWidthForValue(value){let grid=this.options.grid;if(!this._isVisible()||!grid.display)return 0;let index=this.ticks.findIndex((t)=>t.value===value);if(index>=0)return grid.setContext(this.getContext(index)).lineWidth;return 0}drawGrid(chartArea){let grid=this.options.grid,ctx=this.ctx,items=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(chartArea)),i,ilen,drawLine=(p1,p2,style)=>{if(!style.width||!style.color)return;ctx.save(),ctx.lineWidth=style.width,ctx.strokeStyle=style.color,ctx.setLineDash(style.borderDash||[]),ctx.lineDashOffset=style.borderDashOffset,ctx.beginPath(),ctx.moveTo(p1.x,p1.y),ctx.lineTo(p2.x,p2.y),ctx.stroke(),ctx.restore()};if(grid.display)for(i=0,ilen=items.length;i<ilen;++i){let item=items[i];if(grid.drawOnChartArea)drawLine({x:item.x1,y:item.y1},{x:item.x2,y:item.y2},item);if(grid.drawTicks)drawLine({x:item.tx1,y:item.ty1},{x:item.tx2,y:item.ty2},{color:item.tickColor,width:item.tickWidth,borderDash:item.tickBorderDash,borderDashOffset:item.tickBorderDashOffset})}}drawBorder(){let{chart,ctx,options:{border,grid}}=this,borderOpts=border.setContext(this.getContext()),axisWidth=border.display?borderOpts.width:0;if(!axisWidth)return;let lastLineWidth=grid.setContext(this.getContext(0)).lineWidth,borderValue=this._borderValue,x1,x2,y1,y2;if(this.isHorizontal())x1=_alignPixel(chart,this.left,axisWidth)-axisWidth/2,x2=_alignPixel(chart,this.right,lastLineWidth)+lastLineWidth/2,y1=y2=borderValue;else y1=_alignPixel(chart,this.top,axisWidth)-axisWidth/2,y2=_alignPixel(chart,this.bottom,lastLineWidth)+lastLineWidth/2,x1=x2=borderValue;ctx.save(),ctx.lineWidth=borderOpts.width,ctx.strokeStyle=borderOpts.color,ctx.beginPath(),ctx.moveTo(x1,y1),ctx.lineTo(x2,y2),ctx.stroke(),ctx.restore()}drawLabels(chartArea){if(!this.options.ticks.display)return;let ctx=this.ctx,area=this._computeLabelArea();if(area)clipArea(ctx,area);let items=this.getLabelItems(chartArea);for(let item of items){let{options:renderTextOptions,font:tickFont,label,textOffset:y}=item;renderText(ctx,label,0,y,tickFont,renderTextOptions)}if(area)unclipArea(ctx)}drawTitle(){let{ctx,options:{position,title,reverse}}=this;if(!title.display)return;let font=toFont(title.font),padding=toPadding(title.padding),align=title.align,offset=font.lineHeight/2;if(position===\"bottom\"||position===\"center\"||isObject(position)){if(offset+=padding.bottom,isArray(title.text))offset+=font.lineHeight*(title.text.length-1)}else offset+=padding.top;let{titleX,titleY,maxWidth,rotation}=titleArgs(this,offset,position,align);renderText(ctx,title.text,0,0,font,{color:title.color,maxWidth,rotation,textAlign:titleAlign(align,position,reverse),textBaseline:\"middle\",translation:[titleX,titleY]})}draw(chartArea){if(!this._isVisible())return;this.drawBackground(),this.drawGrid(chartArea),this.drawBorder(),this.drawTitle(),this.drawLabels(chartArea)}_layers(){let opts=this.options,tz=opts.ticks&&opts.ticks.z||0,gz=valueOrDefault(opts.grid&&opts.grid.z,-1),bz=valueOrDefault(opts.border&&opts.border.z,0);if(!this._isVisible()||this.draw!==Scale.prototype.draw)return[{z:tz,draw:(chartArea)=>{this.draw(chartArea)}}];return[{z:gz,draw:(chartArea)=>{this.drawBackground(),this.drawGrid(chartArea),this.drawTitle()}},{z:bz,draw:()=>{this.drawBorder()}},{z:tz,draw:(chartArea)=>{this.drawLabels(chartArea)}}]}getMatchingVisibleMetas(type){let metas=this.chart.getSortedVisibleDatasetMetas(),axisID=this.axis+\"AxisID\",result=[],i,ilen;for(i=0,ilen=metas.length;i<ilen;++i){let meta=metas[i];if(meta[axisID]===this.id&&(!type||meta.type===type))result.push(meta)}return result}_resolveTickFontOptions(index){let opts=this.options.ticks.setContext(this.getContext(index));return toFont(opts.font)}_maxDigits(){let fontSize=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/fontSize}}class TypedRegistry{constructor(type,scope,override){this.type=type,this.scope=scope,this.override=override,this.items=Object.create(null)}isForType(type){return Object.prototype.isPrototypeOf.call(this.type.prototype,type.prototype)}register(item){let proto=Object.getPrototypeOf(item),parentScope;if(isIChartComponent(proto))parentScope=this.register(proto);let items=this.items,id=item.id,scope=this.scope+\".\"+id;if(!id)throw Error(\"class does not have id: \"+item);if(id in items)return scope;if(items[id]=item,registerDefaults(item,scope,parentScope),this.override)defaults.override(item.id,item.overrides);return scope}get(id){return this.items[id]}unregister(item){let items=this.items,id=item.id,scope=this.scope;if(id in items)delete items[id];if(scope&&id in defaults[scope]){if(delete defaults[scope][id],this.override)delete overrides[id]}}}function registerDefaults(item,scope,parentScope){let itemDefaults=merge(Object.create(null),[parentScope?defaults.get(parentScope):{},defaults.get(scope),item.defaults]);if(defaults.set(scope,itemDefaults),item.defaultRoutes)routeDefaults(scope,item.defaultRoutes);if(item.descriptors)defaults.describe(scope,item.descriptors)}function routeDefaults(scope,routes){Object.keys(routes).forEach((property)=>{let propertyParts=property.split(\".\"),sourceName=propertyParts.pop(),sourceScope=[scope].concat(propertyParts).join(\".\"),parts=routes[property].split(\".\"),targetName=parts.pop(),targetScope=parts.join(\".\");defaults.route(sourceScope,sourceName,targetScope,targetName)})}function isIChartComponent(proto){return\"id\"in proto&&\"defaults\"in proto}class Registry{constructor(){this.controllers=new TypedRegistry(DatasetController,\"datasets\",!0),this.elements=new TypedRegistry(Element,\"elements\"),this.plugins=new TypedRegistry(Object,\"plugins\"),this.scales=new TypedRegistry(Scale,\"scales\"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...args){this._each(\"register\",args)}remove(...args){this._each(\"unregister\",args)}addControllers(...args){this._each(\"register\",args,this.controllers)}addElements(...args){this._each(\"register\",args,this.elements)}addPlugins(...args){this._each(\"register\",args,this.plugins)}addScales(...args){this._each(\"register\",args,this.scales)}getController(id){return this._get(id,this.controllers,\"controller\")}getElement(id){return this._get(id,this.elements,\"element\")}getPlugin(id){return this._get(id,this.plugins,\"plugin\")}getScale(id){return this._get(id,this.scales,\"scale\")}removeControllers(...args){this._each(\"unregister\",args,this.controllers)}removeElements(...args){this._each(\"unregister\",args,this.elements)}removePlugins(...args){this._each(\"unregister\",args,this.plugins)}removeScales(...args){this._each(\"unregister\",args,this.scales)}_each(method,args,typedRegistry){[...args].forEach((arg)=>{let reg=typedRegistry||this._getRegistryForType(arg);if(typedRegistry||reg.isForType(arg)||reg===this.plugins&&arg.id)this._exec(method,reg,arg);else each(arg,(item)=>{let itemReg=typedRegistry||this._getRegistryForType(item);this._exec(method,itemReg,item)})})}_exec(method,registry,component){let camelMethod=_capitalize(method);callback(component[\"before\"+camelMethod],[],component),registry[method](component),callback(component[\"after\"+camelMethod],[],component)}_getRegistryForType(type){for(let i=0;i<this._typedRegistries.length;i++){let reg=this._typedRegistries[i];if(reg.isForType(type))return reg}return this.plugins}_get(id,typedRegistry,type){let item=typedRegistry.get(id);if(item===void 0)throw Error('\"'+id+'\" is not a registered '+type+\".\");return item}}var registry=new Registry;class PluginService{constructor(){this._init=void 0}notify(chart,hook,args,filter){if(hook===\"beforeInit\")this._init=this._createDescriptors(chart,!0),this._notify(this._init,chart,\"install\");if(this._init===void 0)return;let descriptors2=filter?this._descriptors(chart).filter(filter):this._descriptors(chart),result=this._notify(descriptors2,chart,hook,args);if(hook===\"afterDestroy\")this._notify(descriptors2,chart,\"stop\"),this._notify(this._init,chart,\"uninstall\"),this._init=void 0;return result}_notify(descriptors2,chart,hook,args){args=args||{};for(let descriptor of descriptors2){let plugin=descriptor.plugin,method=plugin[hook],params=[chart,args,descriptor.options];if(callback(method,params,plugin)===!1&&args.cancelable)return!1}return!0}invalidate(){if(!isNullOrUndef(this._cache))this._oldCache=this._cache,this._cache=void 0}_descriptors(chart){if(this._cache)return this._cache;let descriptors2=this._cache=this._createDescriptors(chart);return this._notifyStateChanges(chart),descriptors2}_createDescriptors(chart,all){let config=chart&&chart.config,options=valueOrDefault(config.options&&config.options.plugins,{}),plugins=allPlugins(config);return options===!1&&!all?[]:createDescriptors(chart,plugins,options,all)}_notifyStateChanges(chart){let previousDescriptors=this._oldCache||[],descriptors2=this._cache,diff=(a,b)=>a.filter((x)=>!b.some((y)=>x.plugin.id===y.plugin.id));this._notify(diff(previousDescriptors,descriptors2),chart,\"stop\"),this._notify(diff(descriptors2,previousDescriptors),chart,\"start\")}}function allPlugins(config){let localIds={},plugins=[],keys=Object.keys(registry.plugins.items);for(let i=0;i<keys.length;i++)plugins.push(registry.getPlugin(keys[i]));let local=config.plugins||[];for(let i=0;i<local.length;i++){let plugin=local[i];if(plugins.indexOf(plugin)===-1)plugins.push(plugin),localIds[plugin.id]=!0}return{plugins,localIds}}function getOpts(options,all){if(!all&&options===!1)return null;if(options===!0)return{};return options}function createDescriptors(chart,{plugins,localIds},options,all){let result=[],context=chart.getContext();for(let plugin of plugins){let id=plugin.id,opts=getOpts(options[id],all);if(opts===null)continue;result.push({plugin,options:pluginOpts(chart.config,{plugin,local:localIds[id]},opts,context)})}return result}function pluginOpts(config,{plugin,local},opts,context){let keys=config.pluginScopeKeys(plugin),scopes=config.getOptionScopes(opts,keys);if(local&&plugin.defaults)scopes.push(plugin.defaults);return config.createResolver(scopes,context,[\"\"],{scriptable:!1,indexable:!1,allKeys:!0})}function getIndexAxis(type,options){let datasetDefaults=defaults.datasets[type]||{};return((options.datasets||{})[type]||{}).indexAxis||options.indexAxis||datasetDefaults.indexAxis||\"x\"}function getAxisFromDefaultScaleID(id,indexAxis){let axis=id;if(id===\"_index_\")axis=indexAxis;else if(id===\"_value_\")axis=indexAxis===\"x\"?\"y\":\"x\";return axis}function getDefaultScaleIDFromAxis(axis,indexAxis){return axis===indexAxis?\"_index_\":\"_value_\"}function idMatchesAxis(id){if(id===\"x\"||id===\"y\"||id===\"r\")return id}function axisFromPosition(position){if(position===\"top\"||position===\"bottom\")return\"x\";if(position===\"left\"||position===\"right\")return\"y\"}function determineAxis(id,...scaleOptions){if(idMatchesAxis(id))return id;for(let opts of scaleOptions){let axis=opts.axis||axisFromPosition(opts.position)||id.length>1&&idMatchesAxis(id[0].toLowerCase());if(axis)return axis}throw Error(`Cannot determine type of '${id}' axis. Please provide 'axis' or 'position' option.`)}function getAxisFromDataset(id,axis,dataset){if(dataset[axis+\"AxisID\"]===id)return{axis}}function retrieveAxisFromDatasets(id,config){if(config.data&&config.data.datasets){let boundDs=config.data.datasets.filter((d)=>d.xAxisID===id||d.yAxisID===id);if(boundDs.length)return getAxisFromDataset(id,\"x\",boundDs[0])||getAxisFromDataset(id,\"y\",boundDs[0])}return{}}function mergeScaleConfig(config,options){let chartDefaults=overrides[config.type]||{scales:{}},configScales=options.scales||{},chartIndexAxis=getIndexAxis(config.type,options),scales=Object.create(null);return Object.keys(configScales).forEach((id)=>{let scaleConf=configScales[id];if(!isObject(scaleConf))return console.error(`Invalid scale configuration for scale: ${id}`);if(scaleConf._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${id}`);let axis=determineAxis(id,scaleConf,retrieveAxisFromDatasets(id,config),defaults.scales[scaleConf.type]),defaultId=getDefaultScaleIDFromAxis(axis,chartIndexAxis),defaultScaleOptions=chartDefaults.scales||{};scales[id]=mergeIf(Object.create(null),[{axis},scaleConf,defaultScaleOptions[axis],defaultScaleOptions[defaultId]])}),config.data.datasets.forEach((dataset)=>{let type=dataset.type||config.type,indexAxis=dataset.indexAxis||getIndexAxis(type,options),defaultScaleOptions=(overrides[type]||{}).scales||{};Object.keys(defaultScaleOptions).forEach((defaultID)=>{let axis=getAxisFromDefaultScaleID(defaultID,indexAxis),id=dataset[axis+\"AxisID\"]||axis;scales[id]=scales[id]||Object.create(null),mergeIf(scales[id],[{axis},configScales[id],defaultScaleOptions[defaultID]])})}),Object.keys(scales).forEach((key)=>{let scale=scales[key];mergeIf(scale,[defaults.scales[scale.type],defaults.scale])}),scales}function initOptions(config){let options=config.options||(config.options={});options.plugins=valueOrDefault(options.plugins,{}),options.scales=mergeScaleConfig(config,options)}function initData(data){return data=data||{},data.datasets=data.datasets||[],data.labels=data.labels||[],data}function initConfig(config){return config=config||{},config.data=initData(config.data),initOptions(config),config}var keyCache=new Map,keysCached=new Set;function cachedKeys(cacheKey,generate){let keys=keyCache.get(cacheKey);if(!keys)keys=generate(),keyCache.set(cacheKey,keys),keysCached.add(keys);return keys}var addIfFound=(set2,obj,key)=>{let opts=resolveObjectKey(obj,key);if(opts!==void 0)set2.add(opts)};class Config{constructor(config){this._config=initConfig(config),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(type){this._config.type=type}get data(){return this._config.data}set data(data){this._config.data=initData(data)}get options(){return this._config.options}set options(options){this._config.options=options}get plugins(){return this._config.plugins}update(){let config=this._config;this.clearCache(),initOptions(config)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(datasetType){return cachedKeys(datasetType,()=>[[`datasets.${datasetType}`,\"\"]])}datasetAnimationScopeKeys(datasetType,transition){return cachedKeys(`${datasetType}.transition.${transition}`,()=>[[`datasets.${datasetType}.transitions.${transition}`,`transitions.${transition}`],[`datasets.${datasetType}`,\"\"]])}datasetElementScopeKeys(datasetType,elementType){return cachedKeys(`${datasetType}-${elementType}`,()=>[[`datasets.${datasetType}.elements.${elementType}`,`datasets.${datasetType}`,`elements.${elementType}`,\"\"]])}pluginScopeKeys(plugin){let id=plugin.id,type=this.type;return cachedKeys(`${type}-plugin-${id}`,()=>[[`plugins.${id}`,...plugin.additionalOptionScopes||[]]])}_cachedScopes(mainScope,resetCache){let _scopeCache=this._scopeCache,cache=_scopeCache.get(mainScope);if(!cache||resetCache)cache=new Map,_scopeCache.set(mainScope,cache);return cache}getOptionScopes(mainScope,keyLists,resetCache){let{options,type}=this,cache=this._cachedScopes(mainScope,resetCache),cached=cache.get(keyLists);if(cached)return cached;let scopes=new Set;keyLists.forEach((keys)=>{if(mainScope)scopes.add(mainScope),keys.forEach((key)=>addIfFound(scopes,mainScope,key));keys.forEach((key)=>addIfFound(scopes,options,key)),keys.forEach((key)=>addIfFound(scopes,overrides[type]||{},key)),keys.forEach((key)=>addIfFound(scopes,defaults,key)),keys.forEach((key)=>addIfFound(scopes,descriptors,key))});let array=Array.from(scopes);if(array.length===0)array.push(Object.create(null));if(keysCached.has(keyLists))cache.set(keyLists,array);return array}chartOptionScopes(){let{options,type}=this;return[options,overrides[type]||{},defaults.datasets[type]||{},{type},defaults,descriptors]}resolveNamedOptions(scopes,names2,context,prefixes=[\"\"]){let result={$shared:!0},{resolver,subPrefixes}=getResolver(this._resolverCache,scopes,prefixes),options=resolver;if(needContext(resolver,names2)){result.$shared=!1,context=isFunction(context)?context():context;let subResolver=this.createResolver(scopes,context,subPrefixes);options=_attachContext(resolver,context,subResolver)}for(let prop of names2)result[prop]=options[prop];return result}createResolver(scopes,context,prefixes=[\"\"],descriptorDefaults){let{resolver}=getResolver(this._resolverCache,scopes,prefixes);return isObject(context)?_attachContext(resolver,context,void 0,descriptorDefaults):resolver}}function getResolver(resolverCache,scopes,prefixes){let cache=resolverCache.get(scopes);if(!cache)cache=new Map,resolverCache.set(scopes,cache);let cacheKey=prefixes.join(),cached=cache.get(cacheKey);if(!cached)cached={resolver:_createResolver(scopes,prefixes),subPrefixes:prefixes.filter((p)=>!p.toLowerCase().includes(\"hover\"))},cache.set(cacheKey,cached);return cached}var hasFunction=(value)=>isObject(value)&&Object.getOwnPropertyNames(value).some((key)=>isFunction(value[key]));function needContext(proxy,names2){let{isScriptable,isIndexable}=_descriptors(proxy);for(let prop of names2){let scriptable=isScriptable(prop),indexable=isIndexable(prop),value=(indexable||scriptable)&&proxy[prop];if(scriptable&&(isFunction(value)||hasFunction(value))||indexable&&isArray(value))return!0}return!1}var version=\"4.5.1\",KNOWN_POSITIONS=[\"top\",\"bottom\",\"left\",\"right\",\"chartArea\"];function positionIsHorizontal(position,axis){return position===\"top\"||position===\"bottom\"||KNOWN_POSITIONS.indexOf(position)===-1&&axis===\"x\"}function compare2Level(l1,l2){return function(a,b){return a[l1]===b[l1]?a[l2]-b[l2]:a[l1]-b[l1]}}function onAnimationsComplete(context){let chart=context.chart,animationOptions=chart.options.animation;chart.notifyPlugins(\"afterRender\"),callback(animationOptions&&animationOptions.onComplete,[context],chart)}function onAnimationProgress(context){let chart=context.chart,animationOptions=chart.options.animation;callback(animationOptions&&animationOptions.onProgress,[context],chart)}function getCanvas(item){if(_isDomSupported()&&typeof item===\"string\")item=document.getElementById(item);else if(item&&item.length)item=item[0];if(item&&item.canvas)item=item.canvas;return item}var instances={},getChart=(key)=>{let canvas=getCanvas(key);return Object.values(instances).filter((c)=>c.canvas===canvas).pop()};function moveNumericKeys(obj,start,move){let keys=Object.keys(obj);for(let key of keys){let intKey=+key;if(intKey>=start){let value=obj[key];if(delete obj[key],move>0||intKey>start)obj[intKey+move]=value}}}function determineLastEvent(e,lastEvent,inChartArea,isClick){if(!inChartArea||e.type===\"mouseout\")return null;if(isClick)return lastEvent;return e}class Chart{static defaults=defaults;static instances=instances;static overrides=overrides;static registry=registry;static version=version;static getChart=getChart;static register(...items){registry.add(...items),invalidatePlugins()}static unregister(...items){registry.remove(...items),invalidatePlugins()}constructor(item,userConfig){let config=this.config=new Config(userConfig),initialCanvas=getCanvas(item),existingChart=getChart(initialCanvas);if(existingChart)throw Error(\"Canvas is already in use. Chart with ID '\"+existingChart.id+\"' must be destroyed before the canvas with ID '\"+existingChart.canvas.id+\"' can be reused.\");let options=config.createResolver(config.chartOptionScopes(),this.getContext());this.platform=new(config.platform||_detectPlatform(initialCanvas)),this.platform.updateConfig(config);let context=this.platform.acquireContext(initialCanvas,options.aspectRatio),canvas=context&&context.canvas,height=canvas&&canvas.height,width=canvas&&canvas.width;if(this.id=uid(),this.ctx=context,this.canvas=canvas,this.width=width,this.height=height,this._options=options,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new PluginService,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=debounce((mode)=>this.update(mode),options.resizeDelay||0),this._dataChanges=[],instances[this.id]=this,!context||!canvas){console.error(\"Failed to create chart: can't acquire context from the given item\");return}if(animator.listen(this,\"complete\",onAnimationsComplete),animator.listen(this,\"progress\",onAnimationProgress),this._initialize(),this.attached)this.update()}get aspectRatio(){let{options:{aspectRatio,maintainAspectRatio},width,height,_aspectRatio}=this;if(!isNullOrUndef(aspectRatio))return aspectRatio;if(maintainAspectRatio&&_aspectRatio)return _aspectRatio;return height?width/height:null}get data(){return this.config.data}set data(data){this.config.data=data}get options(){return this._options}set options(options){this.config.options=options}get registry(){return registry}_initialize(){if(this.notifyPlugins(\"beforeInit\"),this.options.responsive)this.resize();else retinaScale(this,this.options.devicePixelRatio);return this.bindEvents(),this.notifyPlugins(\"afterInit\"),this}clear(){return clearCanvas(this.canvas,this.ctx),this}stop(){return animator.stop(this),this}resize(width,height){if(!animator.running(this))this._resize(width,height);else this._resizeBeforeDraw={width,height}}_resize(width,height){let options=this.options,canvas=this.canvas,aspectRatio=options.maintainAspectRatio&&this.aspectRatio,newSize=this.platform.getMaximumSize(canvas,width,height,aspectRatio),newRatio=options.devicePixelRatio||this.platform.getDevicePixelRatio(),mode=this.width?\"resize\":\"attach\";if(this.width=newSize.width,this.height=newSize.height,this._aspectRatio=this.aspectRatio,!retinaScale(this,newRatio,!0))return;if(this.notifyPlugins(\"resize\",{size:newSize}),callback(options.onResize,[this,newSize],this),this.attached){if(this._doResize(mode))this.render()}}ensureScalesHaveIDs(){let scalesOptions=this.options.scales||{};each(scalesOptions,(axisOptions,axisID)=>{axisOptions.id=axisID})}buildOrUpdateScales(){let options=this.options,scaleOpts=options.scales,scales=this.scales,updated=Object.keys(scales).reduce((obj,id)=>{return obj[id]=!1,obj},{}),items=[];if(scaleOpts)items=items.concat(Object.keys(scaleOpts).map((id)=>{let scaleOptions=scaleOpts[id],axis=determineAxis(id,scaleOptions),isRadial=axis===\"r\",isHorizontal=axis===\"x\";return{options:scaleOptions,dposition:isRadial?\"chartArea\":isHorizontal?\"bottom\":\"left\",dtype:isRadial?\"radialLinear\":isHorizontal?\"category\":\"linear\"}}));each(items,(item)=>{let scaleOptions=item.options,id=scaleOptions.id,axis=determineAxis(id,scaleOptions),scaleType=valueOrDefault(scaleOptions.type,item.dtype);if(scaleOptions.position===void 0||positionIsHorizontal(scaleOptions.position,axis)!==positionIsHorizontal(item.dposition))scaleOptions.position=item.dposition;updated[id]=!0;let scale=null;if(id in scales&&scales[id].type===scaleType)scale=scales[id];else scale=new(registry.getScale(scaleType))({id,type:scaleType,ctx:this.ctx,chart:this}),scales[scale.id]=scale;scale.init(scaleOptions,options)}),each(updated,(hasUpdated,id)=>{if(!hasUpdated)delete scales[id]}),each(scales,(scale)=>{layouts.configure(this,scale,scale.options),layouts.addBox(this,scale)})}_updateMetasets(){let metasets=this._metasets,numData=this.data.datasets.length,numMeta=metasets.length;if(metasets.sort((a,b)=>a.index-b.index),numMeta>numData){for(let i=numData;i<numMeta;++i)this._destroyDatasetMeta(i);metasets.splice(numData,numMeta-numData)}this._sortedMetasets=metasets.slice(0).sort(compare2Level(\"order\",\"index\"))}_removeUnreferencedMetasets(){let{_metasets:metasets,data:{datasets}}=this;if(metasets.length>datasets.length)delete this._stacks;metasets.forEach((meta,index)=>{if(datasets.filter((x)=>x===meta._dataset).length===0)this._destroyDatasetMeta(index)})}buildOrUpdateControllers(){let newControllers=[],datasets=this.data.datasets,i,ilen;this._removeUnreferencedMetasets();for(i=0,ilen=datasets.length;i<ilen;i++){let dataset=datasets[i],meta=this.getDatasetMeta(i),type=dataset.type||this.config.type;if(meta.type&&meta.type!==type)this._destroyDatasetMeta(i),meta=this.getDatasetMeta(i);if(meta.type=type,meta.indexAxis=dataset.indexAxis||getIndexAxis(type,this.options),meta.order=dataset.order||0,meta.index=i,meta.label=\"\"+dataset.label,meta.visible=this.isDatasetVisible(i),meta.controller)meta.controller.updateIndex(i),meta.controller.linkScales();else{let ControllerClass=registry.getController(type),{datasetElementType,dataElementType}=defaults.datasets[type];Object.assign(ControllerClass,{dataElementType:registry.getElement(dataElementType),datasetElementType:datasetElementType&&registry.getElement(datasetElementType)}),meta.controller=new ControllerClass(this,i),newControllers.push(meta.controller)}}return this._updateMetasets(),newControllers}_resetElements(){each(this.data.datasets,(dataset,datasetIndex)=>{this.getDatasetMeta(datasetIndex).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins(\"reset\")}update(mode){let config=this.config;config.update();let options=this._options=config.createResolver(config.chartOptionScopes(),this.getContext()),animsDisabled=this._animationsDisabled=!options.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins(\"beforeUpdate\",{mode,cancelable:!0})===!1)return;let newControllers=this.buildOrUpdateControllers();this.notifyPlugins(\"beforeElementsUpdate\");let minPadding=0;for(let i=0,ilen=this.data.datasets.length;i<ilen;i++){let{controller}=this.getDatasetMeta(i),reset=!animsDisabled&&newControllers.indexOf(controller)===-1;controller.buildOrUpdateElements(reset),minPadding=Math.max(+controller.getMaxOverflow(),minPadding)}if(minPadding=this._minPadding=options.layout.autoPadding?minPadding:0,this._updateLayout(minPadding),!animsDisabled)each(newControllers,(controller)=>{controller.reset()});this._updateDatasets(mode),this.notifyPlugins(\"afterUpdate\",{mode}),this._layers.sort(compare2Level(\"z\",\"_idx\"));let{_active,_lastEvent}=this;if(_lastEvent)this._eventHandler(_lastEvent,!0);else if(_active.length)this._updateHoverStyles(_active,_active,!0);this.render()}_updateScales(){each(this.scales,(scale)=>{layouts.removeBox(this,scale)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){let options=this.options,existingEvents=new Set(Object.keys(this._listeners)),newEvents=new Set(options.events);if(!setsEqual(existingEvents,newEvents)||!!this._responsiveListeners!==options.responsive)this.unbindEvents(),this.bindEvents()}_updateHiddenIndices(){let{_hiddenIndices}=this,changes=this._getUniformDataChanges()||[];for(let{method,start,count}of changes){let move=method===\"_removeElements\"?-count:count;moveNumericKeys(_hiddenIndices,start,move)}}_getUniformDataChanges(){let _dataChanges=this._dataChanges;if(!_dataChanges||!_dataChanges.length)return;this._dataChanges=[];let datasetCount=this.data.datasets.length,makeSet=(idx)=>new Set(_dataChanges.filter((c)=>c[0]===idx).map((c,i)=>i+\",\"+c.splice(1).join(\",\"))),changeSet=makeSet(0);for(let i=1;i<datasetCount;i++)if(!setsEqual(changeSet,makeSet(i)))return;return Array.from(changeSet).map((c)=>c.split(\",\")).map((a)=>({method:a[1],start:+a[2],count:+a[3]}))}_updateLayout(minPadding){if(this.notifyPlugins(\"beforeLayout\",{cancelable:!0})===!1)return;layouts.update(this,this.width,this.height,minPadding);let area=this.chartArea,noArea=area.width<=0||area.height<=0;this._layers=[],each(this.boxes,(box)=>{if(noArea&&box.position===\"chartArea\")return;if(box.configure)box.configure();this._layers.push(...box._layers())},this),this._layers.forEach((item,index)=>{item._idx=index}),this.notifyPlugins(\"afterLayout\")}_updateDatasets(mode){if(this.notifyPlugins(\"beforeDatasetsUpdate\",{mode,cancelable:!0})===!1)return;for(let i=0,ilen=this.data.datasets.length;i<ilen;++i)this.getDatasetMeta(i).controller.configure();for(let i=0,ilen=this.data.datasets.length;i<ilen;++i)this._updateDataset(i,isFunction(mode)?mode({datasetIndex:i}):mode);this.notifyPlugins(\"afterDatasetsUpdate\",{mode})}_updateDataset(index,mode){let meta=this.getDatasetMeta(index),args={meta,index,mode,cancelable:!0};if(this.notifyPlugins(\"beforeDatasetUpdate\",args)===!1)return;meta.controller._update(mode),args.cancelable=!1,this.notifyPlugins(\"afterDatasetUpdate\",args)}render(){if(this.notifyPlugins(\"beforeRender\",{cancelable:!0})===!1)return;if(animator.has(this)){if(this.attached&&!animator.running(this))animator.start(this)}else this.draw(),onAnimationsComplete({chart:this})}draw(){let i;if(this._resizeBeforeDraw){let{width,height}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(width,height)}if(this.clear(),this.width<=0||this.height<=0)return;if(this.notifyPlugins(\"beforeDraw\",{cancelable:!0})===!1)return;let layers=this._layers;for(i=0;i<layers.length&&layers[i].z<=0;++i)layers[i].draw(this.chartArea);this._drawDatasets();for(;i<layers.length;++i)layers[i].draw(this.chartArea);this.notifyPlugins(\"afterDraw\")}_getSortedDatasetMetas(filterVisible){let metasets=this._sortedMetasets,result=[],i,ilen;for(i=0,ilen=metasets.length;i<ilen;++i){let meta=metasets[i];if(!filterVisible||meta.visible)result.push(meta)}return result}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins(\"beforeDatasetsDraw\",{cancelable:!0})===!1)return;let metasets=this.getSortedVisibleDatasetMetas();for(let i=metasets.length-1;i>=0;--i)this._drawDataset(metasets[i]);this.notifyPlugins(\"afterDatasetsDraw\")}_drawDataset(meta){let ctx=this.ctx,args={meta,index:meta.index,cancelable:!0},clip=getDatasetClipArea(this,meta);if(this.notifyPlugins(\"beforeDatasetDraw\",args)===!1)return;if(clip)clipArea(ctx,clip);if(meta.controller.draw(),clip)unclipArea(ctx);args.cancelable=!1,this.notifyPlugins(\"afterDatasetDraw\",args)}isPointInArea(point){return _isPointInArea(point,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,mode,options,useFinalPosition){let method=Interaction.modes[mode];if(typeof method===\"function\")return method(this,e,options,useFinalPosition);return[]}getDatasetMeta(datasetIndex){let dataset=this.data.datasets[datasetIndex],metasets=this._metasets,meta=metasets.filter((x)=>x&&x._dataset===dataset).pop();if(!meta)meta={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:dataset&&dataset.order||0,index:datasetIndex,_dataset:dataset,_parsed:[],_sorted:!1},metasets.push(meta);return meta}getContext(){return this.$context||(this.$context=createContext(null,{chart:this,type:\"chart\"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(datasetIndex){let dataset=this.data.datasets[datasetIndex];if(!dataset)return!1;let meta=this.getDatasetMeta(datasetIndex);return typeof meta.hidden===\"boolean\"?!meta.hidden:!dataset.hidden}setDatasetVisibility(datasetIndex,visible){let meta=this.getDatasetMeta(datasetIndex);meta.hidden=!visible}toggleDataVisibility(index){this._hiddenIndices[index]=!this._hiddenIndices[index]}getDataVisibility(index){return!this._hiddenIndices[index]}_updateVisibility(datasetIndex,dataIndex,visible){let mode=visible?\"show\":\"hide\",meta=this.getDatasetMeta(datasetIndex),anims=meta.controller._resolveAnimations(void 0,mode);if(defined(dataIndex))meta.data[dataIndex].hidden=!visible,this.update();else this.setDatasetVisibility(datasetIndex,visible),anims.update(meta,{visible}),this.update((ctx)=>ctx.datasetIndex===datasetIndex?mode:void 0)}hide(datasetIndex,dataIndex){this._updateVisibility(datasetIndex,dataIndex,!1)}show(datasetIndex,dataIndex){this._updateVisibility(datasetIndex,dataIndex,!0)}_destroyDatasetMeta(datasetIndex){let meta=this._metasets[datasetIndex];if(meta&&meta.controller)meta.controller._destroy();delete this._metasets[datasetIndex]}_stop(){let i,ilen;this.stop(),animator.remove(this);for(i=0,ilen=this.data.datasets.length;i<ilen;++i)this._destroyDatasetMeta(i)}destroy(){this.notifyPlugins(\"beforeDestroy\");let{canvas,ctx}=this;if(this._stop(),this.config.clearCache(),canvas)this.unbindEvents(),clearCanvas(canvas,ctx),this.platform.releaseContext(ctx),this.canvas=null,this.ctx=null;delete instances[this.id],this.notifyPlugins(\"afterDestroy\")}toBase64Image(...args){return this.canvas.toDataURL(...args)}bindEvents(){if(this.bindUserEvents(),this.options.responsive)this.bindResponsiveEvents();else this.attached=!0}bindUserEvents(){let listeners=this._listeners,platform=this.platform,_add=(type,listener2)=>{platform.addEventListener(this,type,listener2),listeners[type]=listener2},listener=(e,x,y)=>{e.offsetX=x,e.offsetY=y,this._eventHandler(e)};each(this.options.events,(type)=>_add(type,listener))}bindResponsiveEvents(){if(!this._responsiveListeners)this._responsiveListeners={};let listeners=this._responsiveListeners,platform=this.platform,_add=(type,listener2)=>{platform.addEventListener(this,type,listener2),listeners[type]=listener2},_remove=(type,listener2)=>{if(listeners[type])platform.removeEventListener(this,type,listener2),delete listeners[type]},listener=(width,height)=>{if(this.canvas)this.resize(width,height)},detached,attached=()=>{_remove(\"attach\",attached),this.attached=!0,this.resize(),_add(\"resize\",listener),_add(\"detach\",detached)};if(detached=()=>{this.attached=!1,_remove(\"resize\",listener),this._stop(),this._resize(0,0),_add(\"attach\",attached)},platform.isAttached(this.canvas))attached();else detached()}unbindEvents(){each(this._listeners,(listener,type)=>{this.platform.removeEventListener(this,type,listener)}),this._listeners={},each(this._responsiveListeners,(listener,type)=>{this.platform.removeEventListener(this,type,listener)}),this._responsiveListeners=void 0}updateHoverStyle(items,mode,enabled){let prefix=enabled?\"set\":\"remove\",meta,item,i,ilen;if(mode===\"dataset\")meta=this.getDatasetMeta(items[0].datasetIndex),meta.controller[\"_\"+prefix+\"DatasetHoverStyle\"]();for(i=0,ilen=items.length;i<ilen;++i){item=items[i];let controller=item&&this.getDatasetMeta(item.datasetIndex).controller;if(controller)controller[prefix+\"HoverStyle\"](item.element,item.datasetIndex,item.index)}}getActiveElements(){return this._active||[]}setActiveElements(activeElements){let lastActive=this._active||[],active=activeElements.map(({datasetIndex,index})=>{let meta=this.getDatasetMeta(datasetIndex);if(!meta)throw Error(\"No dataset found at index \"+datasetIndex);return{datasetIndex,element:meta.data[index],index}});if(!_elementsEqual(active,lastActive))this._active=active,this._lastEvent=null,this._updateHoverStyles(active,lastActive)}notifyPlugins(hook,args,filter){return this._plugins.notify(this,hook,args,filter)}isPluginEnabled(pluginId){return this._plugins._cache.filter((p)=>p.plugin.id===pluginId).length===1}_updateHoverStyles(active,lastActive,replay){let hoverOptions=this.options.hover,diff=(a,b)=>a.filter((x)=>!b.some((y)=>x.datasetIndex===y.datasetIndex&&x.index===y.index)),deactivated=diff(lastActive,active),activated=replay?active:diff(active,lastActive);if(deactivated.length)this.updateHoverStyle(deactivated,hoverOptions.mode,!1);if(activated.length&&hoverOptions.mode)this.updateHoverStyle(activated,hoverOptions.mode,!0)}_eventHandler(e,replay){let args={event:e,replay,cancelable:!0,inChartArea:this.isPointInArea(e)},eventFilter=(plugin)=>(plugin.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins(\"beforeEvent\",args,eventFilter)===!1)return;let changed=this._handleEvent(e,replay,args.inChartArea);if(args.cancelable=!1,this.notifyPlugins(\"afterEvent\",args,eventFilter),changed||args.changed)this.render();return this}_handleEvent(e,replay,inChartArea){let{_active:lastActive=[],options}=this,useFinalPosition=replay,active=this._getActiveElements(e,lastActive,inChartArea,useFinalPosition),isClick=_isClickEvent(e),lastEvent=determineLastEvent(e,this._lastEvent,inChartArea,isClick);if(inChartArea){if(this._lastEvent=null,callback(options.onHover,[e,active,this],this),isClick)callback(options.onClick,[e,active,this],this)}let changed=!_elementsEqual(active,lastActive);if(changed||replay)this._active=active,this._updateHoverStyles(active,lastActive,replay);return this._lastEvent=lastEvent,changed}_getActiveElements(e,lastActive,inChartArea,useFinalPosition){if(e.type===\"mouseout\")return[];if(!inChartArea)return lastActive;let hoverOptions=this.options.hover;return this.getElementsAtEventForMode(e,hoverOptions.mode,hoverOptions,useFinalPosition)}}function invalidatePlugins(){return each(Chart.instances,(chart)=>chart._plugins.invalidate())}function clipSelf(ctx,element,endAngle){let{startAngle,x,y,outerRadius,innerRadius,options}=element,{borderWidth,borderJoinStyle}=options,outerAngleClip=Math.min(borderWidth/outerRadius,_normalizeAngle(startAngle-endAngle));if(ctx.beginPath(),ctx.arc(x,y,outerRadius-borderWidth/2,startAngle+outerAngleClip/2,endAngle-outerAngleClip/2),innerRadius>0){let innerAngleClip=Math.min(borderWidth/innerRadius,_normalizeAngle(startAngle-endAngle));ctx.arc(x,y,innerRadius+borderWidth/2,endAngle-innerAngleClip/2,startAngle+innerAngleClip/2,!0)}else{let clipWidth=Math.min(borderWidth/2,outerRadius*_normalizeAngle(startAngle-endAngle));if(borderJoinStyle===\"round\")ctx.arc(x,y,clipWidth,endAngle-PI/2,startAngle+PI/2,!0);else if(borderJoinStyle===\"bevel\"){let r=2*clipWidth*clipWidth,endX=-r*Math.cos(endAngle+PI/2)+x,endY=-r*Math.sin(endAngle+PI/2)+y,startX=r*Math.cos(startAngle+PI/2)+x,startY=r*Math.sin(startAngle+PI/2)+y;ctx.lineTo(endX,endY),ctx.lineTo(startX,startY)}}ctx.closePath(),ctx.moveTo(0,0),ctx.rect(0,0,ctx.canvas.width,ctx.canvas.height),ctx.clip(\"evenodd\")}function clipArc(ctx,element,endAngle){let{startAngle,pixelMargin,x,y,outerRadius,innerRadius}=element,angleMargin=pixelMargin/outerRadius;if(ctx.beginPath(),ctx.arc(x,y,outerRadius,startAngle-angleMargin,endAngle+angleMargin),innerRadius>pixelMargin)angleMargin=pixelMargin/innerRadius,ctx.arc(x,y,innerRadius,endAngle+angleMargin,startAngle-angleMargin,!0);else ctx.arc(x,y,pixelMargin,endAngle+HALF_PI,startAngle-HALF_PI);ctx.closePath(),ctx.clip()}function toRadiusCorners(value){return _readValueToProps(value,[\"outerStart\",\"outerEnd\",\"innerStart\",\"innerEnd\"])}function parseBorderRadius$1(arc,innerRadius,outerRadius,angleDelta){let o=toRadiusCorners(arc.options.borderRadius),halfThickness=(outerRadius-innerRadius)/2,innerLimit=Math.min(halfThickness,angleDelta*innerRadius/2),computeOuterLimit=(val)=>{let outerArcLimit=(outerRadius-Math.min(halfThickness,val))*angleDelta/2;return _limitValue(val,0,Math.min(halfThickness,outerArcLimit))};return{outerStart:computeOuterLimit(o.outerStart),outerEnd:computeOuterLimit(o.outerEnd),innerStart:_limitValue(o.innerStart,0,innerLimit),innerEnd:_limitValue(o.innerEnd,0,innerLimit)}}function rThetaToXY(r,theta,x,y){return{x:x+r*Math.cos(theta),y:y+r*Math.sin(theta)}}function pathArc(ctx,element,offset,spacing,end,circular){let{x,y,startAngle:start,pixelMargin,innerRadius:innerR}=element,outerRadius=Math.max(element.outerRadius+spacing+offset-pixelMargin,0),innerRadius=innerR>0?innerR+spacing+offset+pixelMargin:0,spacingOffset=0,alpha2=end-start;if(spacing){let noSpacingInnerRadius=innerR>0?innerR-spacing:0,noSpacingOuterRadius=outerRadius>0?outerRadius-spacing:0,avNogSpacingRadius=(noSpacingInnerRadius+noSpacingOuterRadius)/2,adjustedAngle=avNogSpacingRadius!==0?alpha2*avNogSpacingRadius/(avNogSpacingRadius+spacing):alpha2;spacingOffset=(alpha2-adjustedAngle)/2}let beta=Math.max(0.001,alpha2*outerRadius-offset/PI)/outerRadius,angleOffset=(alpha2-beta)/2,startAngle=start+angleOffset+spacingOffset,endAngle=end-angleOffset-spacingOffset,{outerStart,outerEnd,innerStart,innerEnd}=parseBorderRadius$1(element,innerRadius,outerRadius,endAngle-startAngle),outerStartAdjustedRadius=outerRadius-outerStart,outerEndAdjustedRadius=outerRadius-outerEnd,outerStartAdjustedAngle=startAngle+outerStart/outerStartAdjustedRadius,outerEndAdjustedAngle=endAngle-outerEnd/outerEndAdjustedRadius,innerStartAdjustedRadius=innerRadius+innerStart,innerEndAdjustedRadius=innerRadius+innerEnd,innerStartAdjustedAngle=startAngle+innerStart/innerStartAdjustedRadius,innerEndAdjustedAngle=endAngle-innerEnd/innerEndAdjustedRadius;if(ctx.beginPath(),circular){let outerMidAdjustedAngle=(outerStartAdjustedAngle+outerEndAdjustedAngle)/2;if(ctx.arc(x,y,outerRadius,outerStartAdjustedAngle,outerMidAdjustedAngle),ctx.arc(x,y,outerRadius,outerMidAdjustedAngle,outerEndAdjustedAngle),outerEnd>0){let pCenter=rThetaToXY(outerEndAdjustedRadius,outerEndAdjustedAngle,x,y);ctx.arc(pCenter.x,pCenter.y,outerEnd,outerEndAdjustedAngle,endAngle+HALF_PI)}let p4=rThetaToXY(innerEndAdjustedRadius,endAngle,x,y);if(ctx.lineTo(p4.x,p4.y),innerEnd>0){let pCenter=rThetaToXY(innerEndAdjustedRadius,innerEndAdjustedAngle,x,y);ctx.arc(pCenter.x,pCenter.y,innerEnd,endAngle+HALF_PI,innerEndAdjustedAngle+Math.PI)}let innerMidAdjustedAngle=(endAngle-innerEnd/innerRadius+(startAngle+innerStart/innerRadius))/2;if(ctx.arc(x,y,innerRadius,endAngle-innerEnd/innerRadius,innerMidAdjustedAngle,!0),ctx.arc(x,y,innerRadius,innerMidAdjustedAngle,startAngle+innerStart/innerRadius,!0),innerStart>0){let pCenter=rThetaToXY(innerStartAdjustedRadius,innerStartAdjustedAngle,x,y);ctx.arc(pCenter.x,pCenter.y,innerStart,innerStartAdjustedAngle+Math.PI,startAngle-HALF_PI)}let p8=rThetaToXY(outerStartAdjustedRadius,startAngle,x,y);if(ctx.lineTo(p8.x,p8.y),outerStart>0){let pCenter=rThetaToXY(outerStartAdjustedRadius,outerStartAdjustedAngle,x,y);ctx.arc(pCenter.x,pCenter.y,outerStart,startAngle-HALF_PI,outerStartAdjustedAngle)}}else{ctx.moveTo(x,y);let outerStartX=Math.cos(outerStartAdjustedAngle)*outerRadius+x,outerStartY=Math.sin(outerStartAdjustedAngle)*outerRadius+y;ctx.lineTo(outerStartX,outerStartY);let outerEndX=Math.cos(outerEndAdjustedAngle)*outerRadius+x,outerEndY=Math.sin(outerEndAdjustedAngle)*outerRadius+y;ctx.lineTo(outerEndX,outerEndY)}ctx.closePath()}function drawArc(ctx,element,offset,spacing,circular){let{fullCircles,startAngle,circumference}=element,endAngle=element.endAngle;if(fullCircles){pathArc(ctx,element,offset,spacing,endAngle,circular);for(let i=0;i<fullCircles;++i)ctx.fill();if(!isNaN(circumference))endAngle=startAngle+(circumference%TAU||TAU)}return pathArc(ctx,element,offset,spacing,endAngle,circular),ctx.fill(),endAngle}function drawBorder(ctx,element,offset,spacing,circular){let{fullCircles,startAngle,circumference,options}=element,{borderWidth,borderJoinStyle,borderDash,borderDashOffset,borderRadius}=options,inner=options.borderAlign===\"inner\";if(!borderWidth)return;if(ctx.setLineDash(borderDash||[]),ctx.lineDashOffset=borderDashOffset,inner)ctx.lineWidth=borderWidth*2,ctx.lineJoin=borderJoinStyle||\"round\";else ctx.lineWidth=borderWidth,ctx.lineJoin=borderJoinStyle||\"bevel\";let endAngle=element.endAngle;if(fullCircles){pathArc(ctx,element,offset,spacing,endAngle,circular);for(let i=0;i<fullCircles;++i)ctx.stroke();if(!isNaN(circumference))endAngle=startAngle+(circumference%TAU||TAU)}if(inner)clipArc(ctx,element,endAngle);if(options.selfJoin&&endAngle-startAngle>=PI&&borderRadius===0&&borderJoinStyle!==\"miter\")clipSelf(ctx,element,endAngle);if(!fullCircles)pathArc(ctx,element,offset,spacing,endAngle,circular),ctx.stroke()}class ArcElement extends Element{static id=\"arc\";static defaults={borderAlign:\"center\",borderColor:\"#fff\",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1};static defaultRoutes={backgroundColor:\"backgroundColor\"};static descriptors={_scriptable:!0,_indexable:(name)=>name!==\"borderDash\"};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(cfg){super();if(this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,cfg)Object.assign(this,cfg)}inRange(chartX,chartY,useFinalPosition){let point=this.getProps([\"x\",\"y\"],useFinalPosition),{angle,distance}=getAngleFromPoint(point,{x:chartX,y:chartY}),{startAngle,endAngle,innerRadius,outerRadius,circumference}=this.getProps([\"startAngle\",\"endAngle\",\"innerRadius\",\"outerRadius\",\"circumference\"],useFinalPosition),rAdjust=(this.options.spacing+this.options.borderWidth)/2,_circumference=valueOrDefault(circumference,endAngle-startAngle),nonZeroBetween=_angleBetween(angle,startAngle,endAngle)&&startAngle!==endAngle,betweenAngles=_circumference>=TAU||nonZeroBetween,withinRadius=_isBetween(distance,innerRadius+rAdjust,outerRadius+rAdjust);return betweenAngles&&withinRadius}getCenterPoint(useFinalPosition){let{x,y,startAngle,endAngle,innerRadius,outerRadius}=this.getProps([\"x\",\"y\",\"startAngle\",\"endAngle\",\"innerRadius\",\"outerRadius\"],useFinalPosition),{offset,spacing}=this.options,halfAngle=(startAngle+endAngle)/2,halfRadius=(innerRadius+outerRadius+spacing+offset)/2;return{x:x+Math.cos(halfAngle)*halfRadius,y:y+Math.sin(halfAngle)*halfRadius}}tooltipPosition(useFinalPosition){return this.getCenterPoint(useFinalPosition)}draw(ctx){let{options,circumference}=this,offset=(options.offset||0)/4,spacing=(options.spacing||0)/2,circular=options.circular;if(this.pixelMargin=options.borderAlign===\"inner\"?0.33:0,this.fullCircles=circumference>TAU?Math.floor(circumference/TAU):0,circumference===0||this.innerRadius<0||this.outerRadius<0)return;ctx.save();let halfAngle=(this.startAngle+this.endAngle)/2;ctx.translate(Math.cos(halfAngle)*offset,Math.sin(halfAngle)*offset);let fix=1-Math.sin(Math.min(PI,circumference||0)),radiusOffset=offset*fix;ctx.fillStyle=options.backgroundColor,ctx.strokeStyle=options.borderColor,drawArc(ctx,this,radiusOffset,spacing,circular),drawBorder(ctx,this,radiusOffset,spacing,circular),ctx.restore()}}function setStyle(ctx,options,style=options){ctx.lineCap=valueOrDefault(style.borderCapStyle,options.borderCapStyle),ctx.setLineDash(valueOrDefault(style.borderDash,options.borderDash)),ctx.lineDashOffset=valueOrDefault(style.borderDashOffset,options.borderDashOffset),ctx.lineJoin=valueOrDefault(style.borderJoinStyle,options.borderJoinStyle),ctx.lineWidth=valueOrDefault(style.borderWidth,options.borderWidth),ctx.strokeStyle=valueOrDefault(style.borderColor,options.borderColor)}function lineTo(ctx,previous,target){ctx.lineTo(target.x,target.y)}function getLineMethod(options){if(options.stepped)return _steppedLineTo;if(options.tension||options.cubicInterpolationMode===\"monotone\")return _bezierCurveTo;return lineTo}function pathVars(points,segment,params={}){let count=points.length,{start:paramsStart=0,end:paramsEnd=count-1}=params,{start:segmentStart,end:segmentEnd}=segment,start=Math.max(paramsStart,segmentStart),end=Math.min(paramsEnd,segmentEnd),outside=paramsStart<segmentStart&&paramsEnd<segmentStart||paramsStart>segmentEnd&&paramsEnd>segmentEnd;return{count,start,loop:segment.loop,ilen:end<start&&!outside?count+end-start:end-start}}function pathSegment(ctx,line,segment,params){let{points,options}=line,{count,start,loop,ilen}=pathVars(points,segment,params),lineMethod=getLineMethod(options),{move=!0,reverse}=params||{},i,point,prev;for(i=0;i<=ilen;++i){if(point=points[(start+(reverse?ilen-i:i))%count],point.skip)continue;else if(move)ctx.moveTo(point.x,point.y),move=!1;else lineMethod(ctx,prev,point,reverse,options.stepped);prev=point}if(loop)point=points[(start+(reverse?ilen:0))%count],lineMethod(ctx,prev,point,reverse,options.stepped);return!!loop}function fastPathSegment(ctx,line,segment,params){let points=line.points,{count,start,ilen}=pathVars(points,segment,params),{move=!0,reverse}=params||{},avgX=0,countX=0,i,point,prevX,minY,maxY,lastY,pointIndex=(index)=>(start+(reverse?ilen-index:index))%count,drawX=()=>{if(minY!==maxY)ctx.lineTo(avgX,maxY),ctx.lineTo(avgX,minY),ctx.lineTo(avgX,lastY)};if(move)point=points[pointIndex(0)],ctx.moveTo(point.x,point.y);for(i=0;i<=ilen;++i){if(point=points[pointIndex(i)],point.skip)continue;let{x,y}=point,truncX=x|0;if(truncX===prevX){if(y<minY)minY=y;else if(y>maxY)maxY=y;avgX=(countX*avgX+x)/++countX}else drawX(),ctx.lineTo(x,y),prevX=truncX,countX=0,minY=maxY=y;lastY=y}drawX()}function _getSegmentMethod(line){let opts=line.options,borderDash=opts.borderDash&&opts.borderDash.length;return!line._decimated&&!line._loop&&!opts.tension&&opts.cubicInterpolationMode!==\"monotone\"&&!opts.stepped&&!borderDash?fastPathSegment:pathSegment}function _getInterpolationMethod(options){if(options.stepped)return _steppedInterpolation;if(options.tension||options.cubicInterpolationMode===\"monotone\")return _bezierInterpolation;return _pointInLine}function strokePathWithCache(ctx,line,start,count){let path=line._path;if(!path){if(path=line._path=new Path2D,line.path(path,start,count))path.closePath()}setStyle(ctx,line.options),ctx.stroke(path)}function strokePathDirect(ctx,line,start,count){let{segments,options}=line,segmentMethod=_getSegmentMethod(line);for(let segment of segments){if(setStyle(ctx,options,segment.style),ctx.beginPath(),segmentMethod(ctx,line,segment,{start,end:start+count-1}))ctx.closePath();ctx.stroke()}}var usePath2D=typeof Path2D===\"function\";function draw(ctx,line,start,count){if(usePath2D&&!line.options.segment)strokePathWithCache(ctx,line,start,count);else strokePathDirect(ctx,line,start,count)}class LineElement extends Element{static id=\"line\";static defaults={borderCapStyle:\"butt\",borderDash:[],borderDashOffset:0,borderJoinStyle:\"miter\",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:\"default\",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:\"backgroundColor\",borderColor:\"borderColor\"};static descriptors={_scriptable:!0,_indexable:(name)=>name!==\"borderDash\"&&name!==\"fill\"};constructor(cfg){super();if(this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,cfg)Object.assign(this,cfg)}updateControlPoints(chartArea,indexAxis){let options=this.options;if((options.tension||options.cubicInterpolationMode===\"monotone\")&&!options.stepped&&!this._pointsUpdated){let loop=options.spanGaps?this._loop:this._fullLoop;_updateBezierControlPoints(this._points,options,chartArea,loop,indexAxis),this._pointsUpdated=!0}}set points(points){this._points=points,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=_computeSegments(this,this.options.segment))}first(){let segments=this.segments,points=this.points;return segments.length&&points[segments[0].start]}last(){let segments=this.segments,points=this.points,count=segments.length;return count&&points[segments[count-1].end]}interpolate(point,property){let options=this.options,value=point[property],points=this.points,segments=_boundSegments(this,{property,start:value,end:value});if(!segments.length)return;let result=[],_interpolate=_getInterpolationMethod(options),i,ilen;for(i=0,ilen=segments.length;i<ilen;++i){let{start,end}=segments[i],p1=points[start],p2=points[end];if(p1===p2){result.push(p1);continue}let t=Math.abs((value-p1[property])/(p2[property]-p1[property])),interpolated=_interpolate(p1,p2,t,options.stepped);interpolated[property]=point[property],result.push(interpolated)}return result.length===1?result[0]:result}pathSegment(ctx,segment,params){return _getSegmentMethod(this)(ctx,this,segment,params)}path(ctx,start,count){let segments=this.segments,segmentMethod=_getSegmentMethod(this),loop=this._loop;start=start||0,count=count||this.points.length-start;for(let segment of segments)loop&=segmentMethod(ctx,this,segment,{start,end:start+count-1});return!!loop}draw(ctx,chartArea,start,count){let options=this.options||{};if((this.points||[]).length&&options.borderWidth)ctx.save(),draw(ctx,this,start,count),ctx.restore();if(this.animated)this._pointsUpdated=!1,this._path=void 0}}function inRange$1(el,pos,axis,useFinalPosition){let options=el.options,{[axis]:value}=el.getProps([axis],useFinalPosition);return Math.abs(pos-value)<options.radius+options.hitRadius}class PointElement extends Element{static id=\"point\";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:\"circle\",radius:3,rotation:0};static defaultRoutes={backgroundColor:\"backgroundColor\",borderColor:\"borderColor\"};constructor(cfg){super();if(this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,cfg)Object.assign(this,cfg)}inRange(mouseX,mouseY,useFinalPosition){let options=this.options,{x,y}=this.getProps([\"x\",\"y\"],useFinalPosition);return Math.pow(mouseX-x,2)+Math.pow(mouseY-y,2)<Math.pow(options.hitRadius+options.radius,2)}inXRange(mouseX,useFinalPosition){return inRange$1(this,mouseX,\"x\",useFinalPosition)}inYRange(mouseY,useFinalPosition){return inRange$1(this,mouseY,\"y\",useFinalPosition)}getCenterPoint(useFinalPosition){let{x,y}=this.getProps([\"x\",\"y\"],useFinalPosition);return{x,y}}size(options){options=options||this.options||{};let radius=options.radius||0;radius=Math.max(radius,radius&&options.hoverRadius||0);let borderWidth=radius&&options.borderWidth||0;return(radius+borderWidth)*2}draw(ctx,area){let options=this.options;if(this.skip||options.radius<0.1||!_isPointInArea(this,area,this.size(options)/2))return;ctx.strokeStyle=options.borderColor,ctx.lineWidth=options.borderWidth,ctx.fillStyle=options.backgroundColor,drawPoint(ctx,options,this.x,this.y)}getRange(){let options=this.options||{};return options.radius+options.hitRadius}}function getBarBounds(bar,useFinalPosition){let{x,y,base,width,height}=bar.getProps([\"x\",\"y\",\"base\",\"width\",\"height\"],useFinalPosition),left,right,top,bottom,half;if(bar.horizontal)half=height/2,left=Math.min(x,base),right=Math.max(x,base),top=y-half,bottom=y+half;else half=width/2,left=x-half,right=x+half,top=Math.min(y,base),bottom=Math.max(y,base);return{left,top,right,bottom}}function skipOrLimit(skip2,value,min,max){return skip2?0:_limitValue(value,min,max)}function parseBorderWidth(bar,maxW,maxH){let value=bar.options.borderWidth,skip2=bar.borderSkipped,o=toTRBL(value);return{t:skipOrLimit(skip2.top,o.top,0,maxH),r:skipOrLimit(skip2.right,o.right,0,maxW),b:skipOrLimit(skip2.bottom,o.bottom,0,maxH),l:skipOrLimit(skip2.left,o.left,0,maxW)}}function parseBorderRadius(bar,maxW,maxH){let{enableBorderRadius}=bar.getProps([\"enableBorderRadius\"]),value=bar.options.borderRadius,o=toTRBLCorners(value),maxR=Math.min(maxW,maxH),skip2=bar.borderSkipped,enableBorder=enableBorderRadius||isObject(value);return{topLeft:skipOrLimit(!enableBorder||skip2.top||skip2.left,o.topLeft,0,maxR),topRight:skipOrLimit(!enableBorder||skip2.top||skip2.right,o.topRight,0,maxR),bottomLeft:skipOrLimit(!enableBorder||skip2.bottom||skip2.left,o.bottomLeft,0,maxR),bottomRight:skipOrLimit(!enableBorder||skip2.bottom||skip2.right,o.bottomRight,0,maxR)}}function boundingRects(bar){let bounds=getBarBounds(bar),width=bounds.right-bounds.left,height=bounds.bottom-bounds.top,border=parseBorderWidth(bar,width/2,height/2),radius=parseBorderRadius(bar,width/2,height/2);return{outer:{x:bounds.left,y:bounds.top,w:width,h:height,radius},inner:{x:bounds.left+border.l,y:bounds.top+border.t,w:width-border.l-border.r,h:height-border.t-border.b,radius:{topLeft:Math.max(0,radius.topLeft-Math.max(border.t,border.l)),topRight:Math.max(0,radius.topRight-Math.max(border.t,border.r)),bottomLeft:Math.max(0,radius.bottomLeft-Math.max(border.b,border.l)),bottomRight:Math.max(0,radius.bottomRight-Math.max(border.b,border.r))}}}}function inRange(bar,x,y,useFinalPosition){let skipX=x===null,skipY=y===null,bounds=bar&&!(skipX&&skipY)&&getBarBounds(bar,useFinalPosition);return bounds&&(skipX||_isBetween(x,bounds.left,bounds.right))&&(skipY||_isBetween(y,bounds.top,bounds.bottom))}function hasRadius(radius){return radius.topLeft||radius.topRight||radius.bottomLeft||radius.bottomRight}function addNormalRectPath(ctx,rect){ctx.rect(rect.x,rect.y,rect.w,rect.h)}function inflateRect(rect,amount,refRect={}){let x=rect.x!==refRect.x?-amount:0,y=rect.y!==refRect.y?-amount:0,w=(rect.x+rect.w!==refRect.x+refRect.w?amount:0)-x,h=(rect.y+rect.h!==refRect.y+refRect.h?amount:0)-y;return{x:rect.x+x,y:rect.y+y,w:rect.w+w,h:rect.h+h,radius:rect.radius}}class BarElement extends Element{static id=\"bar\";static defaults={borderSkipped:\"start\",borderWidth:0,borderRadius:0,inflateAmount:\"auto\",pointStyle:void 0};static defaultRoutes={backgroundColor:\"backgroundColor\",borderColor:\"borderColor\"};constructor(cfg){super();if(this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,cfg)Object.assign(this,cfg)}draw(ctx){let{inflateAmount,options:{borderColor,backgroundColor}}=this,{inner,outer}=boundingRects(this),addRectPath=hasRadius(outer.radius)?addRoundedRectPath:addNormalRectPath;if(ctx.save(),outer.w!==inner.w||outer.h!==inner.h)ctx.beginPath(),addRectPath(ctx,inflateRect(outer,inflateAmount,inner)),ctx.clip(),addRectPath(ctx,inflateRect(inner,-inflateAmount,outer)),ctx.fillStyle=borderColor,ctx.fill(\"evenodd\");ctx.beginPath(),addRectPath(ctx,inflateRect(inner,inflateAmount)),ctx.fillStyle=backgroundColor,ctx.fill(),ctx.restore()}inRange(mouseX,mouseY,useFinalPosition){return inRange(this,mouseX,mouseY,useFinalPosition)}inXRange(mouseX,useFinalPosition){return inRange(this,mouseX,null,useFinalPosition)}inYRange(mouseY,useFinalPosition){return inRange(this,null,mouseY,useFinalPosition)}getCenterPoint(useFinalPosition){let{x,y,base,horizontal}=this.getProps([\"x\",\"y\",\"base\",\"horizontal\"],useFinalPosition);return{x:horizontal?(x+base)/2:x,y:horizontal?y:(y+base)/2}}getRange(axis){return axis===\"x\"?this.width/2:this.height/2}}var elements=Object.freeze({__proto__:null,ArcElement,BarElement,LineElement,PointElement}),BORDER_COLORS=[\"rgb(54, 162, 235)\",\"rgb(255, 99, 132)\",\"rgb(255, 159, 64)\",\"rgb(255, 205, 86)\",\"rgb(75, 192, 192)\",\"rgb(153, 102, 255)\",\"rgb(201, 203, 207)\"],BACKGROUND_COLORS=BORDER_COLORS.map((color2)=>color2.replace(\"rgb(\",\"rgba(\").replace(\")\",\", 0.5)\"));function getBorderColor(i){return BORDER_COLORS[i%BORDER_COLORS.length]}function getBackgroundColor(i){return BACKGROUND_COLORS[i%BACKGROUND_COLORS.length]}function colorizeDefaultDataset(dataset,i){return dataset.borderColor=getBorderColor(i),dataset.backgroundColor=getBackgroundColor(i),++i}function colorizeDoughnutDataset(dataset,i){return dataset.backgroundColor=dataset.data.map(()=>getBorderColor(i++)),i}function colorizePolarAreaDataset(dataset,i){return dataset.backgroundColor=dataset.data.map(()=>getBackgroundColor(i++)),i}function getColorizer(chart){let i=0;return(dataset,datasetIndex)=>{let controller=chart.getDatasetMeta(datasetIndex).controller;if(controller instanceof DoughnutController)i=colorizeDoughnutDataset(dataset,i);else if(controller instanceof PolarAreaController)i=colorizePolarAreaDataset(dataset,i);else if(controller)i=colorizeDefaultDataset(dataset,i)}}function containsColorsDefinitions(descriptors2){let k;for(k in descriptors2)if(descriptors2[k].borderColor||descriptors2[k].backgroundColor)return!0;return!1}function containsColorsDefinition(descriptor){return descriptor&&(descriptor.borderColor||descriptor.backgroundColor)}function containsDefaultColorsDefenitions(){return defaults.borderColor!==\"rgba(0,0,0,0.1)\"||defaults.backgroundColor!==\"rgba(0,0,0,0.1)\"}var plugin_colors={id:\"colors\",defaults:{enabled:!0,forceOverride:!1},beforeLayout(chart,_args,options){if(!options.enabled)return;let{data:{datasets},options:chartOptions}=chart.config,{elements:elements2}=chartOptions,containsColorDefenition=containsColorsDefinitions(datasets)||containsColorsDefinition(chartOptions)||elements2&&containsColorsDefinitions(elements2)||containsDefaultColorsDefenitions();if(!options.forceOverride&&containsColorDefenition)return;let colorizer=getColorizer(chart);datasets.forEach(colorizer)}};function lttbDecimation(data,start,count,availableWidth,options){let samples=options.samples||availableWidth;if(samples>=count)return data.slice(start,start+count);let decimated=[],bucketWidth=(count-2)/(samples-2),sampledIndex=0,endIndex=start+count-1,a=start,i,maxAreaPoint,maxArea,area,nextA;decimated[sampledIndex++]=data[a];for(i=0;i<samples-2;i++){let avgX=0,avgY=0,j,avgRangeStart=Math.floor((i+1)*bucketWidth)+1+start,avgRangeEnd=Math.min(Math.floor((i+2)*bucketWidth)+1,count)+start,avgRangeLength=avgRangeEnd-avgRangeStart;for(j=avgRangeStart;j<avgRangeEnd;j++)avgX+=data[j].x,avgY+=data[j].y;avgX/=avgRangeLength,avgY/=avgRangeLength;let rangeOffs=Math.floor(i*bucketWidth)+1+start,rangeTo=Math.min(Math.floor((i+1)*bucketWidth)+1,count)+start,{x:pointAx,y:pointAy}=data[a];maxArea=area=-1;for(j=rangeOffs;j<rangeTo;j++)if(area=0.5*Math.abs((pointAx-avgX)*(data[j].y-pointAy)-(pointAx-data[j].x)*(avgY-pointAy)),area>maxArea)maxArea=area,maxAreaPoint=data[j],nextA=j;decimated[sampledIndex++]=maxAreaPoint,a=nextA}return decimated[sampledIndex++]=data[endIndex],decimated}function minMaxDecimation(data,start,count,availableWidth){let avgX=0,countX=0,i,point,x,y,prevX,minIndex,maxIndex,startIndex,minY,maxY,decimated=[],endIndex=start+count-1,xMin=data[start].x,dx=data[endIndex].x-xMin;for(i=start;i<start+count;++i){point=data[i],x=(point.x-xMin)/dx*availableWidth,y=point.y;let truncX=x|0;if(truncX===prevX){if(y<minY)minY=y,minIndex=i;else if(y>maxY)maxY=y,maxIndex=i;avgX=(countX*avgX+point.x)/++countX}else{let lastIndex=i-1;if(!isNullOrUndef(minIndex)&&!isNullOrUndef(maxIndex)){let intermediateIndex1=Math.min(minIndex,maxIndex),intermediateIndex2=Math.max(minIndex,maxIndex);if(intermediateIndex1!==startIndex&&intermediateIndex1!==lastIndex)decimated.push({...data[intermediateIndex1],x:avgX});if(intermediateIndex2!==startIndex&&intermediateIndex2!==lastIndex)decimated.push({...data[intermediateIndex2],x:avgX})}if(i>0&&lastIndex!==startIndex)decimated.push(data[lastIndex]);decimated.push(point),prevX=truncX,countX=0,minY=maxY=y,minIndex=maxIndex=startIndex=i}}return decimated}function cleanDecimatedDataset(dataset){if(dataset._decimated){let data=dataset._data;delete dataset._decimated,delete dataset._data,Object.defineProperty(dataset,\"data\",{configurable:!0,enumerable:!0,writable:!0,value:data})}}function cleanDecimatedData(chart){chart.data.datasets.forEach((dataset)=>{cleanDecimatedDataset(dataset)})}function getStartAndCountOfVisiblePointsSimplified(meta,points){let pointCount=points.length,start=0,count,{iScale}=meta,{min,max,minDefined,maxDefined}=iScale.getUserBounds();if(minDefined)start=_limitValue(_lookupByKey(points,iScale.axis,min).lo,0,pointCount-1);if(maxDefined)count=_limitValue(_lookupByKey(points,iScale.axis,max).hi+1,start,pointCount)-start;else count=pointCount-start;return{start,count}}var plugin_decimation={id:\"decimation\",defaults:{algorithm:\"min-max\",enabled:!1},beforeElementsUpdate:(chart,args,options)=>{if(!options.enabled){cleanDecimatedData(chart);return}let availableWidth=chart.width;chart.data.datasets.forEach((dataset,datasetIndex)=>{let{_data,indexAxis}=dataset,meta=chart.getDatasetMeta(datasetIndex),data=_data||dataset.data;if(resolve([indexAxis,chart.options.indexAxis])===\"y\")return;if(!meta.controller.supportsDecimation)return;let xAxis=chart.scales[meta.xAxisID];if(xAxis.type!==\"linear\"&&xAxis.type!==\"time\")return;if(chart.options.parsing)return;let{start,count}=getStartAndCountOfVisiblePointsSimplified(meta,data),threshold=options.threshold||4*availableWidth;if(count<=threshold){cleanDecimatedDataset(dataset);return}if(isNullOrUndef(_data))dataset._data=data,delete dataset.data,Object.defineProperty(dataset,\"data\",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(d){this._data=d}});let decimated;switch(options.algorithm){case\"lttb\":decimated=lttbDecimation(data,start,count,availableWidth,options);break;case\"min-max\":decimated=minMaxDecimation(data,start,count,availableWidth);break;default:throw Error(`Unsupported decimation algorithm '${options.algorithm}'`)}dataset._decimated=decimated})},destroy(chart){cleanDecimatedData(chart)}};function _segments(line,target,property){let{segments,points}=line,tpoints=target.points,parts=[];for(let segment of segments){let{start,end}=segment;end=_findSegmentEnd(start,end,points);let bounds=_getBounds(property,points[start],points[end],segment.loop);if(!target.segments){parts.push({source:segment,target:bounds,start:points[start],end:points[end]});continue}let targetSegments=_boundSegments(target,bounds);for(let tgt of targetSegments){let subBounds=_getBounds(property,tpoints[tgt.start],tpoints[tgt.end],tgt.loop),fillSources=_boundSegment(segment,points,subBounds);for(let fillSource of fillSources)parts.push({source:fillSource,target:tgt,start:{[property]:_getEdge(bounds,subBounds,\"start\",Math.max)},end:{[property]:_getEdge(bounds,subBounds,\"end\",Math.min)}})}}return parts}function _getBounds(property,first,last,loop){if(loop)return;let start=first[property],end=last[property];if(property===\"angle\")start=_normalizeAngle(start),end=_normalizeAngle(end);return{property,start,end}}function _pointsFromSegments(boundary,line){let{x=null,y=null}=boundary||{},linePoints=line.points,points=[];return line.segments.forEach(({start,end})=>{end=_findSegmentEnd(start,end,linePoints);let first=linePoints[start],last=linePoints[end];if(y!==null)points.push({x:first.x,y}),points.push({x:last.x,y});else if(x!==null)points.push({x,y:first.y}),points.push({x,y:last.y})}),points}function _findSegmentEnd(start,end,points){for(;end>start;end--){let point=points[end];if(!isNaN(point.x)&&!isNaN(point.y))break}return end}function _getEdge(a,b,prop,fn){if(a&&b)return fn(a[prop],b[prop]);return a?a[prop]:b?b[prop]:0}function _createBoundaryLine(boundary,line){let points=[],_loop=!1;if(isArray(boundary))_loop=!0,points=boundary;else points=_pointsFromSegments(boundary,line);return points.length?new LineElement({points,options:{tension:0},_loop,_fullLoop:_loop}):null}function _shouldApplyFill(source){return source&&source.fill!==!1}function _resolveTarget(sources,index,propagate){let fill=sources[index].fill,visited=[index],target;if(!propagate)return fill;while(fill!==!1&&visited.indexOf(fill)===-1){if(!isNumberFinite(fill))return fill;if(target=sources[fill],!target)return!1;if(target.visible)return fill;visited.push(fill),fill=target.fill}return!1}function _decodeFill(line,index,count){let fill=parseFillOption(line);if(isObject(fill))return isNaN(fill.value)?!1:fill;let target=parseFloat(fill);if(isNumberFinite(target)&&Math.floor(target)===target)return decodeTargetIndex(fill[0],index,target,count);return[\"origin\",\"start\",\"end\",\"stack\",\"shape\"].indexOf(fill)>=0&&fill}function decodeTargetIndex(firstCh,index,target,count){if(firstCh===\"-\"||firstCh===\"+\")target=index+target;if(target===index||target<0||target>=count)return!1;return target}function _getTargetPixel(fill,scale){let pixel=null;if(fill===\"start\")pixel=scale.bottom;else if(fill===\"end\")pixel=scale.top;else if(isObject(fill))pixel=scale.getPixelForValue(fill.value);else if(scale.getBasePixel)pixel=scale.getBasePixel();return pixel}function _getTargetValue(fill,scale,startValue){let value;if(fill===\"start\")value=startValue;else if(fill===\"end\")value=scale.options.reverse?scale.min:scale.max;else if(isObject(fill))value=fill.value;else value=scale.getBaseValue();return value}function parseFillOption(line){let options=line.options,fillOption=options.fill,fill=valueOrDefault(fillOption&&fillOption.target,fillOption);if(fill===void 0)fill=!!options.backgroundColor;if(fill===!1||fill===null)return!1;if(fill===!0)return\"origin\";return fill}function _buildStackLine(source){let{scale,index,line}=source,points=[],segments=line.segments,sourcePoints=line.points,linesBelow=getLinesBelow(scale,index);linesBelow.push(_createBoundaryLine({x:null,y:scale.bottom},line));for(let i=0;i<segments.length;i++){let segment=segments[i];for(let j=segment.start;j<=segment.end;j++)addPointsBelow(points,sourcePoints[j],linesBelow)}return new LineElement({points,options:{}})}function getLinesBelow(scale,index){let below=[],metas=scale.getMatchingVisibleMetas(\"line\");for(let i=0;i<metas.length;i++){let meta=metas[i];if(meta.index===index)break;if(!meta.hidden)below.unshift(meta.dataset)}return below}function addPointsBelow(points,sourcePoint,linesBelow){let postponed=[];for(let j=0;j<linesBelow.length;j++){let line=linesBelow[j],{first,last,point}=findPoint(line,sourcePoint,\"x\");if(!point||first&&last)continue;if(first)postponed.unshift(point);else if(points.push(point),!last)break}points.push(...postponed)}function findPoint(line,sourcePoint,property){let point=line.interpolate(sourcePoint,property);if(!point)return{};let pointValue=point[property],segments=line.segments,linePoints=line.points,first=!1,last=!1;for(let i=0;i<segments.length;i++){let segment=segments[i],firstValue=linePoints[segment.start][property],lastValue=linePoints[segment.end][property];if(_isBetween(pointValue,firstValue,lastValue)){first=pointValue===firstValue,last=pointValue===lastValue;break}}return{first,last,point}}class simpleArc{constructor(opts){this.x=opts.x,this.y=opts.y,this.radius=opts.radius}pathSegment(ctx,bounds,opts){let{x,y,radius}=this;return bounds=bounds||{start:0,end:TAU},ctx.arc(x,y,radius,bounds.end,bounds.start,!0),!opts.bounds}interpolate(point){let{x,y,radius}=this,angle=point.angle;return{x:x+Math.cos(angle)*radius,y:y+Math.sin(angle)*radius,angle}}}function _getTarget(source){let{chart,fill,line}=source;if(isNumberFinite(fill))return getLineByIndex(chart,fill);if(fill===\"stack\")return _buildStackLine(source);if(fill===\"shape\")return!0;let boundary=computeBoundary(source);if(boundary instanceof simpleArc)return boundary;return _createBoundaryLine(boundary,line)}function getLineByIndex(chart,index){let meta=chart.getDatasetMeta(index);return meta&&chart.isDatasetVisible(index)?meta.dataset:null}function computeBoundary(source){if((source.scale||{}).getPointPositionForValue)return computeCircularBoundary(source);return computeLinearBoundary(source)}function computeLinearBoundary(source){let{scale={},fill}=source,pixel=_getTargetPixel(fill,scale);if(isNumberFinite(pixel)){let horizontal=scale.isHorizontal();return{x:horizontal?pixel:null,y:horizontal?null:pixel}}return null}function computeCircularBoundary(source){let{scale,fill}=source,options=scale.options,length=scale.getLabels().length,start=options.reverse?scale.max:scale.min,value=_getTargetValue(fill,scale,start),target=[];if(options.grid.circular){let center=scale.getPointPositionForValue(0,start);return new simpleArc({x:center.x,y:center.y,radius:scale.getDistanceFromCenterForValue(value)})}for(let i=0;i<length;++i)target.push(scale.getPointPositionForValue(i,value));return target}function _drawfill(ctx,source,area){let target=_getTarget(source),{chart,index,line,scale,axis}=source,lineOpts=line.options,fillOption=lineOpts.fill,color2=lineOpts.backgroundColor,{above=color2,below=color2}=fillOption||{},meta=chart.getDatasetMeta(index),clip=getDatasetClipArea(chart,meta);if(target&&line.points.length)clipArea(ctx,area),doFill(ctx,{line,target,above,below,area,scale,axis,clip}),unclipArea(ctx)}function doFill(ctx,cfg){let{line,target,above,below,area,scale,clip}=cfg,property=line._loop?\"angle\":cfg.axis;ctx.save();let fillColor=below;if(below!==above){if(property===\"x\")clipVertical(ctx,target,area.top),fill(ctx,{line,target,color:above,scale,property,clip}),ctx.restore(),ctx.save(),clipVertical(ctx,target,area.bottom);else if(property===\"y\")clipHorizontal(ctx,target,area.left),fill(ctx,{line,target,color:below,scale,property,clip}),ctx.restore(),ctx.save(),clipHorizontal(ctx,target,area.right),fillColor=above}fill(ctx,{line,target,color:fillColor,scale,property,clip}),ctx.restore()}function clipVertical(ctx,target,clipY){let{segments,points}=target,first=!0,lineLoop=!1;ctx.beginPath();for(let segment of segments){let{start,end}=segment,firstPoint=points[start],lastPoint=points[_findSegmentEnd(start,end,points)];if(first)ctx.moveTo(firstPoint.x,firstPoint.y),first=!1;else ctx.lineTo(firstPoint.x,clipY),ctx.lineTo(firstPoint.x,firstPoint.y);if(lineLoop=!!target.pathSegment(ctx,segment,{move:lineLoop}),lineLoop)ctx.closePath();else ctx.lineTo(lastPoint.x,clipY)}ctx.lineTo(target.first().x,clipY),ctx.closePath(),ctx.clip()}function clipHorizontal(ctx,target,clipX){let{segments,points}=target,first=!0,lineLoop=!1;ctx.beginPath();for(let segment of segments){let{start,end}=segment,firstPoint=points[start],lastPoint=points[_findSegmentEnd(start,end,points)];if(first)ctx.moveTo(firstPoint.x,firstPoint.y),first=!1;else ctx.lineTo(clipX,firstPoint.y),ctx.lineTo(firstPoint.x,firstPoint.y);if(lineLoop=!!target.pathSegment(ctx,segment,{move:lineLoop}),lineLoop)ctx.closePath();else ctx.lineTo(clipX,lastPoint.y)}ctx.lineTo(clipX,target.first().y),ctx.closePath(),ctx.clip()}function fill(ctx,cfg){let{line,target,property,color:color2,scale,clip}=cfg,segments=_segments(line,target,property);for(let{source:src,target:tgt,start,end}of segments){let{style:{backgroundColor=color2}={}}=src,notShape=target!==!0;ctx.save(),ctx.fillStyle=backgroundColor,clipBounds(ctx,scale,clip,notShape&&_getBounds(property,start,end)),ctx.beginPath();let lineLoop=!!line.pathSegment(ctx,src),loop;if(notShape){if(lineLoop)ctx.closePath();else interpolatedLineTo(ctx,target,end,property);let targetLoop=!!target.pathSegment(ctx,tgt,{move:lineLoop,reverse:!0});if(loop=lineLoop&&targetLoop,!loop)interpolatedLineTo(ctx,target,start,property)}ctx.closePath(),ctx.fill(loop?\"evenodd\":\"nonzero\"),ctx.restore()}}function clipBounds(ctx,scale,clip,bounds){let chartArea=scale.chart.chartArea,{property,start,end}=bounds||{};if(property===\"x\"||property===\"y\"){let left,top,right,bottom;if(property===\"x\")left=start,top=chartArea.top,right=end,bottom=chartArea.bottom;else left=chartArea.left,top=start,right=chartArea.right,bottom=end;if(ctx.beginPath(),clip)left=Math.max(left,clip.left),right=Math.min(right,clip.right),top=Math.max(top,clip.top),bottom=Math.min(bottom,clip.bottom);ctx.rect(left,top,right-left,bottom-top),ctx.clip()}}function interpolatedLineTo(ctx,target,point,property){let interpolatedPoint=target.interpolate(point,property);if(interpolatedPoint)ctx.lineTo(interpolatedPoint.x,interpolatedPoint.y)}var index={id:\"filler\",afterDatasetsUpdate(chart,_args,options){let count=(chart.data.datasets||[]).length,sources=[],meta,i,line,source;for(i=0;i<count;++i){if(meta=chart.getDatasetMeta(i),line=meta.dataset,source=null,line&&line.options&&line instanceof LineElement)source={visible:chart.isDatasetVisible(i),index:i,fill:_decodeFill(line,i,count),chart,axis:meta.controller.options.indexAxis,scale:meta.vScale,line};meta.$filler=source,sources.push(source)}for(i=0;i<count;++i){if(source=sources[i],!source||source.fill===!1)continue;source.fill=_resolveTarget(sources,i,options.propagate)}},beforeDraw(chart,_args,options){let draw2=options.drawTime===\"beforeDraw\",metasets=chart.getSortedVisibleDatasetMetas(),area=chart.chartArea;for(let i=metasets.length-1;i>=0;--i){let source=metasets[i].$filler;if(!source)continue;if(source.line.updateControlPoints(area,source.axis),draw2&&source.fill)_drawfill(chart.ctx,source,area)}},beforeDatasetsDraw(chart,_args,options){if(options.drawTime!==\"beforeDatasetsDraw\")return;let metasets=chart.getSortedVisibleDatasetMetas();for(let i=metasets.length-1;i>=0;--i){let source=metasets[i].$filler;if(_shouldApplyFill(source))_drawfill(chart.ctx,source,chart.chartArea)}},beforeDatasetDraw(chart,args,options){let source=args.meta.$filler;if(!_shouldApplyFill(source)||options.drawTime!==\"beforeDatasetDraw\")return;_drawfill(chart.ctx,source,chart.chartArea)},defaults:{propagate:!0,drawTime:\"beforeDatasetDraw\"}},getBoxSize=(labelOpts,fontSize)=>{let{boxHeight=fontSize,boxWidth=fontSize}=labelOpts;if(labelOpts.usePointStyle)boxHeight=Math.min(boxHeight,fontSize),boxWidth=labelOpts.pointStyleWidth||Math.min(boxWidth,fontSize);return{boxWidth,boxHeight,itemHeight:Math.max(fontSize,boxHeight)}},itemsEqual=(a,b)=>a!==null&&b!==null&&a.datasetIndex===b.datasetIndex&&a.index===b.index;class Legend extends Element{constructor(config){super();this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=config.chart,this.options=config.options,this.ctx=config.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(maxWidth,maxHeight,margins){this.maxWidth=maxWidth,this.maxHeight=maxHeight,this._margins=margins,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){if(this.isHorizontal())this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width;else this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height}buildLabels(){let labelOpts=this.options.labels||{},legendItems=callback(labelOpts.generateLabels,[this.chart],this)||[];if(labelOpts.filter)legendItems=legendItems.filter((item)=>labelOpts.filter(item,this.chart.data));if(labelOpts.sort)legendItems=legendItems.sort((a,b)=>labelOpts.sort(a,b,this.chart.data));if(this.options.reverse)legendItems.reverse();this.legendItems=legendItems}fit(){let{options,ctx}=this;if(!options.display){this.width=this.height=0;return}let labelOpts=options.labels,labelFont=toFont(labelOpts.font),fontSize=labelFont.size,titleHeight=this._computeTitleHeight(),{boxWidth,itemHeight}=getBoxSize(labelOpts,fontSize),width,height;if(ctx.font=labelFont.string,this.isHorizontal())width=this.maxWidth,height=this._fitRows(titleHeight,fontSize,boxWidth,itemHeight)+10;else height=this.maxHeight,width=this._fitCols(titleHeight,labelFont,boxWidth,itemHeight)+10;this.width=Math.min(width,options.maxWidth||this.maxWidth),this.height=Math.min(height,options.maxHeight||this.maxHeight)}_fitRows(titleHeight,fontSize,boxWidth,itemHeight){let{ctx,maxWidth,options:{labels:{padding}}}=this,hitboxes=this.legendHitBoxes=[],lineWidths=this.lineWidths=[0],lineHeight=itemHeight+padding,totalHeight=titleHeight;ctx.textAlign=\"left\",ctx.textBaseline=\"middle\";let row=-1,top=-lineHeight;return this.legendItems.forEach((legendItem,i)=>{let itemWidth=boxWidth+fontSize/2+ctx.measureText(legendItem.text).width;if(i===0||lineWidths[lineWidths.length-1]+itemWidth+2*padding>maxWidth)totalHeight+=lineHeight,lineWidths[lineWidths.length-(i>0?0:1)]=0,top+=lineHeight,row++;hitboxes[i]={left:0,top,row,width:itemWidth,height:itemHeight},lineWidths[lineWidths.length-1]+=itemWidth+padding}),totalHeight}_fitCols(titleHeight,labelFont,boxWidth,_itemHeight){let{ctx,maxHeight,options:{labels:{padding}}}=this,hitboxes=this.legendHitBoxes=[],columnSizes=this.columnSizes=[],heightLimit=maxHeight-titleHeight,totalWidth=padding,currentColWidth=0,currentColHeight=0,left=0,col=0;return this.legendItems.forEach((legendItem,i)=>{let{itemWidth,itemHeight}=calculateItemSize(boxWidth,labelFont,ctx,legendItem,_itemHeight);if(i>0&&currentColHeight+itemHeight+2*padding>heightLimit)totalWidth+=currentColWidth+padding,columnSizes.push({width:currentColWidth,height:currentColHeight}),left+=currentColWidth+padding,col++,currentColWidth=currentColHeight=0;hitboxes[i]={left,top:currentColHeight,col,width:itemWidth,height:itemHeight},currentColWidth=Math.max(currentColWidth,itemWidth),currentColHeight+=itemHeight+padding}),totalWidth+=currentColWidth,columnSizes.push({width:currentColWidth,height:currentColHeight}),totalWidth}adjustHitBoxes(){if(!this.options.display)return;let titleHeight=this._computeTitleHeight(),{legendHitBoxes:hitboxes,options:{align,labels:{padding},rtl}}=this,rtlHelper=getRtlAdapter(rtl,this.left,this.width);if(this.isHorizontal()){let row=0,left=_alignStartEnd(align,this.left+padding,this.right-this.lineWidths[row]);for(let hitbox of hitboxes){if(row!==hitbox.row)row=hitbox.row,left=_alignStartEnd(align,this.left+padding,this.right-this.lineWidths[row]);hitbox.top+=this.top+titleHeight+padding,hitbox.left=rtlHelper.leftForLtr(rtlHelper.x(left),hitbox.width),left+=hitbox.width+padding}}else{let col=0,top=_alignStartEnd(align,this.top+titleHeight+padding,this.bottom-this.columnSizes[col].height);for(let hitbox of hitboxes){if(hitbox.col!==col)col=hitbox.col,top=_alignStartEnd(align,this.top+titleHeight+padding,this.bottom-this.columnSizes[col].height);hitbox.top=top,hitbox.left+=this.left+padding,hitbox.left=rtlHelper.leftForLtr(rtlHelper.x(hitbox.left),hitbox.width),top+=hitbox.height+padding}}}isHorizontal(){return this.options.position===\"top\"||this.options.position===\"bottom\"}draw(){if(this.options.display){let ctx=this.ctx;clipArea(ctx,this),this._draw(),unclipArea(ctx)}}_draw(){let{options:opts,columnSizes,lineWidths,ctx}=this,{align,labels:labelOpts}=opts,defaultColor=defaults.color,rtlHelper=getRtlAdapter(opts.rtl,this.left,this.width),labelFont=toFont(labelOpts.font),{padding}=labelOpts,fontSize=labelFont.size,halfFontSize=fontSize/2,cursor;this.drawTitle(),ctx.textAlign=rtlHelper.textAlign(\"left\"),ctx.textBaseline=\"middle\",ctx.lineWidth=0.5,ctx.font=labelFont.string;let{boxWidth,boxHeight,itemHeight}=getBoxSize(labelOpts,fontSize),drawLegendBox=function(x,y,legendItem){if(isNaN(boxWidth)||boxWidth<=0||isNaN(boxHeight)||boxHeight<0)return;ctx.save();let lineWidth=valueOrDefault(legendItem.lineWidth,1);if(ctx.fillStyle=valueOrDefault(legendItem.fillStyle,defaultColor),ctx.lineCap=valueOrDefault(legendItem.lineCap,\"butt\"),ctx.lineDashOffset=valueOrDefault(legendItem.lineDashOffset,0),ctx.lineJoin=valueOrDefault(legendItem.lineJoin,\"miter\"),ctx.lineWidth=lineWidth,ctx.strokeStyle=valueOrDefault(legendItem.strokeStyle,defaultColor),ctx.setLineDash(valueOrDefault(legendItem.lineDash,[])),labelOpts.usePointStyle){let drawOptions={radius:boxHeight*Math.SQRT2/2,pointStyle:legendItem.pointStyle,rotation:legendItem.rotation,borderWidth:lineWidth},centerX=rtlHelper.xPlus(x,boxWidth/2),centerY=y+halfFontSize;drawPointLegend(ctx,drawOptions,centerX,centerY,labelOpts.pointStyleWidth&&boxWidth)}else{let yBoxTop=y+Math.max((fontSize-boxHeight)/2,0),xBoxLeft=rtlHelper.leftForLtr(x,boxWidth),borderRadius=toTRBLCorners(legendItem.borderRadius);if(ctx.beginPath(),Object.values(borderRadius).some((v)=>v!==0))addRoundedRectPath(ctx,{x:xBoxLeft,y:yBoxTop,w:boxWidth,h:boxHeight,radius:borderRadius});else ctx.rect(xBoxLeft,yBoxTop,boxWidth,boxHeight);if(ctx.fill(),lineWidth!==0)ctx.stroke()}ctx.restore()},fillText=function(x,y,legendItem){renderText(ctx,legendItem.text,x,y+itemHeight/2,labelFont,{strikethrough:legendItem.hidden,textAlign:rtlHelper.textAlign(legendItem.textAlign)})},isHorizontal=this.isHorizontal(),titleHeight=this._computeTitleHeight();if(isHorizontal)cursor={x:_alignStartEnd(align,this.left+padding,this.right-lineWidths[0]),y:this.top+padding+titleHeight,line:0};else cursor={x:this.left+padding,y:_alignStartEnd(align,this.top+titleHeight+padding,this.bottom-columnSizes[0].height),line:0};overrideTextDirection(this.ctx,opts.textDirection);let lineHeight=itemHeight+padding;this.legendItems.forEach((legendItem,i)=>{ctx.strokeStyle=legendItem.fontColor,ctx.fillStyle=legendItem.fontColor;let textWidth=ctx.measureText(legendItem.text).width,textAlign=rtlHelper.textAlign(legendItem.textAlign||(legendItem.textAlign=labelOpts.textAlign)),width=boxWidth+halfFontSize+textWidth,x=cursor.x,y=cursor.y;if(rtlHelper.setWidth(this.width),isHorizontal){if(i>0&&x+width+padding>this.right)y=cursor.y+=lineHeight,cursor.line++,x=cursor.x=_alignStartEnd(align,this.left+padding,this.right-lineWidths[cursor.line])}else if(i>0&&y+lineHeight>this.bottom)x=cursor.x=x+columnSizes[cursor.line].width+padding,cursor.line++,y=cursor.y=_alignStartEnd(align,this.top+titleHeight+padding,this.bottom-columnSizes[cursor.line].height);let realX=rtlHelper.x(x);if(drawLegendBox(realX,y,legendItem),x=_textX(textAlign,x+boxWidth+halfFontSize,isHorizontal?x+width:this.right,opts.rtl),fillText(rtlHelper.x(x),y,legendItem),isHorizontal)cursor.x+=width+padding;else if(typeof legendItem.text!==\"string\"){let fontLineHeight=labelFont.lineHeight;cursor.y+=calculateLegendItemHeight(legendItem,fontLineHeight)+padding}else cursor.y+=lineHeight}),restoreTextDirection(this.ctx,opts.textDirection)}drawTitle(){let opts=this.options,titleOpts=opts.title,titleFont=toFont(titleOpts.font),titlePadding=toPadding(titleOpts.padding);if(!titleOpts.display)return;let rtlHelper=getRtlAdapter(opts.rtl,this.left,this.width),ctx=this.ctx,position=titleOpts.position,halfFontSize=titleFont.size/2,topPaddingPlusHalfFontSize=titlePadding.top+halfFontSize,y,left=this.left,maxWidth=this.width;if(this.isHorizontal())maxWidth=Math.max(...this.lineWidths),y=this.top+topPaddingPlusHalfFontSize,left=_alignStartEnd(opts.align,left,this.right-maxWidth);else{let maxHeight=this.columnSizes.reduce((acc,size)=>Math.max(acc,size.height),0);y=topPaddingPlusHalfFontSize+_alignStartEnd(opts.align,this.top,this.bottom-maxHeight-opts.labels.padding-this._computeTitleHeight())}let x=_alignStartEnd(position,left,left+maxWidth);ctx.textAlign=rtlHelper.textAlign(_toLeftRightCenter(position)),ctx.textBaseline=\"middle\",ctx.strokeStyle=titleOpts.color,ctx.fillStyle=titleOpts.color,ctx.font=titleFont.string,renderText(ctx,titleOpts.text,x,y,titleFont)}_computeTitleHeight(){let titleOpts=this.options.title,titleFont=toFont(titleOpts.font),titlePadding=toPadding(titleOpts.padding);return titleOpts.display?titleFont.lineHeight+titlePadding.height:0}_getLegendItemAt(x,y){let i,hitBox,lh;if(_isBetween(x,this.left,this.right)&&_isBetween(y,this.top,this.bottom)){lh=this.legendHitBoxes;for(i=0;i<lh.length;++i)if(hitBox=lh[i],_isBetween(x,hitBox.left,hitBox.left+hitBox.width)&&_isBetween(y,hitBox.top,hitBox.top+hitBox.height))return this.legendItems[i]}return null}handleEvent(e){let opts=this.options;if(!isListened(e.type,opts))return;let hoveredItem=this._getLegendItemAt(e.x,e.y);if(e.type===\"mousemove\"||e.type===\"mouseout\"){let previous=this._hoveredItem,sameItem=itemsEqual(previous,hoveredItem);if(previous&&!sameItem)callback(opts.onLeave,[e,previous,this],this);if(this._hoveredItem=hoveredItem,hoveredItem&&!sameItem)callback(opts.onHover,[e,hoveredItem,this],this)}else if(hoveredItem)callback(opts.onClick,[e,hoveredItem,this],this)}}function calculateItemSize(boxWidth,labelFont,ctx,legendItem,_itemHeight){let itemWidth=calculateItemWidth(legendItem,boxWidth,labelFont,ctx),itemHeight=calculateItemHeight(_itemHeight,legendItem,labelFont.lineHeight);return{itemWidth,itemHeight}}function calculateItemWidth(legendItem,boxWidth,labelFont,ctx){let legendItemText=legendItem.text;if(legendItemText&&typeof legendItemText!==\"string\")legendItemText=legendItemText.reduce((a,b)=>a.length>b.length?a:b);return boxWidth+labelFont.size/2+ctx.measureText(legendItemText).width}function calculateItemHeight(_itemHeight,legendItem,fontLineHeight){let itemHeight=_itemHeight;if(typeof legendItem.text!==\"string\")itemHeight=calculateLegendItemHeight(legendItem,fontLineHeight);return itemHeight}function calculateLegendItemHeight(legendItem,fontLineHeight){let labelHeight=legendItem.text?legendItem.text.length:0;return fontLineHeight*labelHeight}function isListened(type,opts){if((type===\"mousemove\"||type===\"mouseout\")&&(opts.onHover||opts.onLeave))return!0;if(opts.onClick&&(type===\"click\"||type===\"mouseup\"))return!0;return!1}var plugin_legend={id:\"legend\",_element:Legend,start(chart,_args,options){let legend=chart.legend=new Legend({ctx:chart.ctx,options,chart});layouts.configure(chart,legend,options),layouts.addBox(chart,legend)},stop(chart){layouts.removeBox(chart,chart.legend),delete chart.legend},beforeUpdate(chart,_args,options){let legend=chart.legend;layouts.configure(chart,legend,options),legend.options=options},afterUpdate(chart){let legend=chart.legend;legend.buildLabels(),legend.adjustHitBoxes()},afterEvent(chart,args){if(!args.replay)chart.legend.handleEvent(args.event)},defaults:{display:!0,position:\"top\",align:\"center\",fullSize:!0,reverse:!1,weight:1000,onClick(e,legendItem,legend){let index2=legendItem.datasetIndex,ci=legend.chart;if(ci.isDatasetVisible(index2))ci.hide(index2),legendItem.hidden=!0;else ci.show(index2),legendItem.hidden=!1},onHover:null,onLeave:null,labels:{color:(ctx)=>ctx.chart.options.color,boxWidth:40,padding:10,generateLabels(chart){let datasets=chart.data.datasets,{labels:{usePointStyle,pointStyle,textAlign,color:color2,useBorderRadius,borderRadius}}=chart.legend.options;return chart._getSortedDatasetMetas().map((meta)=>{let style=meta.controller.getStyle(usePointStyle?0:void 0),borderWidth=toPadding(style.borderWidth);return{text:datasets[meta.index].label,fillStyle:style.backgroundColor,fontColor:color2,hidden:!meta.visible,lineCap:style.borderCapStyle,lineDash:style.borderDash,lineDashOffset:style.borderDashOffset,lineJoin:style.borderJoinStyle,lineWidth:(borderWidth.width+borderWidth.height)/4,strokeStyle:style.borderColor,pointStyle:pointStyle||style.pointStyle,rotation:style.rotation,textAlign:textAlign||style.textAlign,borderRadius:useBorderRadius&&(borderRadius||style.borderRadius),datasetIndex:meta.index}},this)}},title:{color:(ctx)=>ctx.chart.options.color,display:!1,position:\"center\",text:\"\"}},descriptors:{_scriptable:(name)=>!name.startsWith(\"on\"),labels:{_scriptable:(name)=>![\"generateLabels\",\"filter\",\"sort\"].includes(name)}}};class Title extends Element{constructor(config){super();this.chart=config.chart,this.options=config.options,this.ctx=config.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(maxWidth,maxHeight){let opts=this.options;if(this.left=0,this.top=0,!opts.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=maxWidth,this.height=this.bottom=maxHeight;let lineCount=isArray(opts.text)?opts.text.length:1;this._padding=toPadding(opts.padding);let textSize=lineCount*toFont(opts.font).lineHeight+this._padding.height;if(this.isHorizontal())this.height=textSize;else this.width=textSize}isHorizontal(){let pos=this.options.position;return pos===\"top\"||pos===\"bottom\"}_drawArgs(offset){let{top,left,bottom,right,options}=this,align=options.align,rotation=0,maxWidth,titleX,titleY;if(this.isHorizontal())titleX=_alignStartEnd(align,left,right),titleY=top+offset,maxWidth=right-left;else{if(options.position===\"left\")titleX=left+offset,titleY=_alignStartEnd(align,bottom,top),rotation=PI*-0.5;else titleX=right-offset,titleY=_alignStartEnd(align,top,bottom),rotation=PI*0.5;maxWidth=bottom-top}return{titleX,titleY,maxWidth,rotation}}draw(){let ctx=this.ctx,opts=this.options;if(!opts.display)return;let fontOpts=toFont(opts.font),offset=fontOpts.lineHeight/2+this._padding.top,{titleX,titleY,maxWidth,rotation}=this._drawArgs(offset);renderText(ctx,opts.text,0,0,fontOpts,{color:opts.color,maxWidth,rotation,textAlign:_toLeftRightCenter(opts.align),textBaseline:\"middle\",translation:[titleX,titleY]})}}function createTitle(chart,titleOpts){let title=new Title({ctx:chart.ctx,options:titleOpts,chart});layouts.configure(chart,title,titleOpts),layouts.addBox(chart,title),chart.titleBlock=title}var plugin_title={id:\"title\",_element:Title,start(chart,_args,options){createTitle(chart,options)},stop(chart){let titleBlock=chart.titleBlock;layouts.removeBox(chart,titleBlock),delete chart.titleBlock},beforeUpdate(chart,_args,options){let title=chart.titleBlock;layouts.configure(chart,title,options),title.options=options},defaults:{align:\"center\",display:!1,font:{weight:\"bold\"},fullSize:!0,padding:10,position:\"top\",text:\"\",weight:2000},defaultRoutes:{color:\"color\"},descriptors:{_scriptable:!0,_indexable:!1}},map2=new WeakMap,plugin_subtitle={id:\"subtitle\",start(chart,_args,options){let title=new Title({ctx:chart.ctx,options,chart});layouts.configure(chart,title,options),layouts.addBox(chart,title),map2.set(chart,title)},stop(chart){layouts.removeBox(chart,map2.get(chart)),map2.delete(chart)},beforeUpdate(chart,_args,options){let title=map2.get(chart);layouts.configure(chart,title,options),title.options=options},defaults:{align:\"center\",display:!1,font:{weight:\"normal\"},fullSize:!0,padding:0,position:\"top\",text:\"\",weight:1500},defaultRoutes:{color:\"color\"},descriptors:{_scriptable:!0,_indexable:!1}},positioners={average(items){if(!items.length)return!1;let i,len,xSet=new Set,y=0,count=0;for(i=0,len=items.length;i<len;++i){let el=items[i].element;if(el&&el.hasValue()){let pos=el.tooltipPosition();xSet.add(pos.x),y+=pos.y,++count}}if(count===0||xSet.size===0)return!1;return{x:[...xSet].reduce((a,b)=>a+b)/xSet.size,y:y/count}},nearest(items,eventPosition){if(!items.length)return!1;let{x,y}=eventPosition,minDistance=Number.POSITIVE_INFINITY,i,len,nearestElement;for(i=0,len=items.length;i<len;++i){let el=items[i].element;if(el&&el.hasValue()){let center=el.getCenterPoint(),d=distanceBetweenPoints(eventPosition,center);if(d<minDistance)minDistance=d,nearestElement=el}}if(nearestElement){let tp=nearestElement.tooltipPosition();x=tp.x,y=tp.y}return{x,y}}};function pushOrConcat(base,toPush){if(toPush)if(isArray(toPush))Array.prototype.push.apply(base,toPush);else base.push(toPush);return base}function splitNewlines(str){if((typeof str===\"string\"||str instanceof String)&&str.indexOf(`\n`)>-1)return str.split(`\n`);return str}function createTooltipItem(chart,item){let{element,datasetIndex,index:index2}=item,controller=chart.getDatasetMeta(datasetIndex).controller,{label,value}=controller.getLabelAndValue(index2);return{chart,label,parsed:controller.getParsed(index2),raw:chart.data.datasets[datasetIndex].data[index2],formattedValue:value,dataset:controller.getDataset(),dataIndex:index2,datasetIndex,element}}function getTooltipSize(tooltip,options){let ctx=tooltip.chart.ctx,{body,footer,title}=tooltip,{boxWidth,boxHeight}=options,bodyFont=toFont(options.bodyFont),titleFont=toFont(options.titleFont),footerFont=toFont(options.footerFont),titleLineCount=title.length,footerLineCount=footer.length,bodyLineItemCount=body.length,padding=toPadding(options.padding),height=padding.height,width=0,combinedBodyLength=body.reduce((count,bodyItem)=>count+bodyItem.before.length+bodyItem.lines.length+bodyItem.after.length,0);if(combinedBodyLength+=tooltip.beforeBody.length+tooltip.afterBody.length,titleLineCount)height+=titleLineCount*titleFont.lineHeight+(titleLineCount-1)*options.titleSpacing+options.titleMarginBottom;if(combinedBodyLength){let bodyLineHeight=options.displayColors?Math.max(boxHeight,bodyFont.lineHeight):bodyFont.lineHeight;height+=bodyLineItemCount*bodyLineHeight+(combinedBodyLength-bodyLineItemCount)*bodyFont.lineHeight+(combinedBodyLength-1)*options.bodySpacing}if(footerLineCount)height+=options.footerMarginTop+footerLineCount*footerFont.lineHeight+(footerLineCount-1)*options.footerSpacing;let widthPadding=0,maxLineWidth=function(line){width=Math.max(width,ctx.measureText(line).width+widthPadding)};return ctx.save(),ctx.font=titleFont.string,each(tooltip.title,maxLineWidth),ctx.font=bodyFont.string,each(tooltip.beforeBody.concat(tooltip.afterBody),maxLineWidth),widthPadding=options.displayColors?boxWidth+2+options.boxPadding:0,each(body,(bodyItem)=>{each(bodyItem.before,maxLineWidth),each(bodyItem.lines,maxLineWidth),each(bodyItem.after,maxLineWidth)}),widthPadding=0,ctx.font=footerFont.string,each(tooltip.footer,maxLineWidth),ctx.restore(),width+=padding.width,{width,height}}function determineYAlign(chart,size){let{y,height}=size;if(y<height/2)return\"top\";else if(y>chart.height-height/2)return\"bottom\";return\"center\"}function doesNotFitWithAlign(xAlign,chart,options,size){let{x,width}=size,caret=options.caretSize+options.caretPadding;if(xAlign===\"left\"&&x+width+caret>chart.width)return!0;if(xAlign===\"right\"&&x-width-caret<0)return!0}function determineXAlign(chart,options,size,yAlign){let{x,width}=size,{width:chartWidth,chartArea:{left,right}}=chart,xAlign=\"center\";if(yAlign===\"center\")xAlign=x<=(left+right)/2?\"left\":\"right\";else if(x<=width/2)xAlign=\"left\";else if(x>=chartWidth-width/2)xAlign=\"right\";if(doesNotFitWithAlign(xAlign,chart,options,size))xAlign=\"center\";return xAlign}function determineAlignment(chart,options,size){let yAlign=size.yAlign||options.yAlign||determineYAlign(chart,size);return{xAlign:size.xAlign||options.xAlign||determineXAlign(chart,options,size,yAlign),yAlign}}function alignX(size,xAlign){let{x,width}=size;if(xAlign===\"right\")x-=width;else if(xAlign===\"center\")x-=width/2;return x}function alignY(size,yAlign,paddingAndSize){let{y,height}=size;if(yAlign===\"top\")y+=paddingAndSize;else if(yAlign===\"bottom\")y-=height+paddingAndSize;else y-=height/2;return y}function getBackgroundPoint(options,size,alignment,chart){let{caretSize,caretPadding,cornerRadius}=options,{xAlign,yAlign}=alignment,paddingAndSize=caretSize+caretPadding,{topLeft,topRight,bottomLeft,bottomRight}=toTRBLCorners(cornerRadius),x=alignX(size,xAlign),y=alignY(size,yAlign,paddingAndSize);if(yAlign===\"center\"){if(xAlign===\"left\")x+=paddingAndSize;else if(xAlign===\"right\")x-=paddingAndSize}else if(xAlign===\"left\")x-=Math.max(topLeft,bottomLeft)+caretSize;else if(xAlign===\"right\")x+=Math.max(topRight,bottomRight)+caretSize;return{x:_limitValue(x,0,chart.width-size.width),y:_limitValue(y,0,chart.height-size.height)}}function getAlignedX(tooltip,align,options){let padding=toPadding(options.padding);return align===\"center\"?tooltip.x+tooltip.width/2:align===\"right\"?tooltip.x+tooltip.width-padding.right:tooltip.x+padding.left}function getBeforeAfterBodyLines(callback2){return pushOrConcat([],splitNewlines(callback2))}function createTooltipContext(parent,tooltip,tooltipItems){return createContext(parent,{tooltip,tooltipItems,type:\"tooltip\"})}function overrideCallbacks(callbacks,context){let override=context&&context.dataset&&context.dataset.tooltip&&context.dataset.tooltip.callbacks;return override?callbacks.override(override):callbacks}var defaultCallbacks={beforeTitle:noop,title(tooltipItems){if(tooltipItems.length>0){let item=tooltipItems[0],labels=item.chart.data.labels,labelCount=labels?labels.length:0;if(this&&this.options&&this.options.mode===\"dataset\")return item.dataset.label||\"\";else if(item.label)return item.label;else if(labelCount>0&&item.dataIndex<labelCount)return labels[item.dataIndex]}return\"\"},afterTitle:noop,beforeBody:noop,beforeLabel:noop,label(tooltipItem){if(this&&this.options&&this.options.mode===\"dataset\")return tooltipItem.label+\": \"+tooltipItem.formattedValue||tooltipItem.formattedValue;let label=tooltipItem.dataset.label||\"\";if(label)label+=\": \";let value=tooltipItem.formattedValue;if(!isNullOrUndef(value))label+=value;return label},labelColor(tooltipItem){let options=tooltipItem.chart.getDatasetMeta(tooltipItem.datasetIndex).controller.getStyle(tooltipItem.dataIndex);return{borderColor:options.borderColor,backgroundColor:options.backgroundColor,borderWidth:options.borderWidth,borderDash:options.borderDash,borderDashOffset:options.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(tooltipItem){let options=tooltipItem.chart.getDatasetMeta(tooltipItem.datasetIndex).controller.getStyle(tooltipItem.dataIndex);return{pointStyle:options.pointStyle,rotation:options.rotation}},afterLabel:noop,afterBody:noop,beforeFooter:noop,footer:noop,afterFooter:noop};function invokeCallbackWithFallback(callbacks,name,ctx,arg){let result=callbacks[name].call(ctx,arg);if(typeof result>\"u\")return defaultCallbacks[name].call(ctx,arg);return result}class Tooltip extends Element{static positioners=positioners;constructor(config){super();this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=config.chart,this.options=config.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(options){this.options=options,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){let cached=this._cachedAnimations;if(cached)return cached;let chart=this.chart,options=this.options.setContext(this.getContext()),opts=options.enabled&&chart.options.animation&&options.animations,animations=new Animations(this.chart,opts);if(opts._cacheable)this._cachedAnimations=Object.freeze(animations);return animations}getContext(){return this.$context||(this.$context=createTooltipContext(this.chart.getContext(),this,this._tooltipItems))}getTitle(context,options){let{callbacks}=options,beforeTitle=invokeCallbackWithFallback(callbacks,\"beforeTitle\",this,context),title=invokeCallbackWithFallback(callbacks,\"title\",this,context),afterTitle=invokeCallbackWithFallback(callbacks,\"afterTitle\",this,context),lines=[];return lines=pushOrConcat(lines,splitNewlines(beforeTitle)),lines=pushOrConcat(lines,splitNewlines(title)),lines=pushOrConcat(lines,splitNewlines(afterTitle)),lines}getBeforeBody(tooltipItems,options){return getBeforeAfterBodyLines(invokeCallbackWithFallback(options.callbacks,\"beforeBody\",this,tooltipItems))}getBody(tooltipItems,options){let{callbacks}=options,bodyItems=[];return each(tooltipItems,(context)=>{let bodyItem={before:[],lines:[],after:[]},scoped=overrideCallbacks(callbacks,context);pushOrConcat(bodyItem.before,splitNewlines(invokeCallbackWithFallback(scoped,\"beforeLabel\",this,context))),pushOrConcat(bodyItem.lines,invokeCallbackWithFallback(scoped,\"label\",this,context)),pushOrConcat(bodyItem.after,splitNewlines(invokeCallbackWithFallback(scoped,\"afterLabel\",this,context))),bodyItems.push(bodyItem)}),bodyItems}getAfterBody(tooltipItems,options){return getBeforeAfterBodyLines(invokeCallbackWithFallback(options.callbacks,\"afterBody\",this,tooltipItems))}getFooter(tooltipItems,options){let{callbacks}=options,beforeFooter=invokeCallbackWithFallback(callbacks,\"beforeFooter\",this,tooltipItems),footer=invokeCallbackWithFallback(callbacks,\"footer\",this,tooltipItems),afterFooter=invokeCallbackWithFallback(callbacks,\"afterFooter\",this,tooltipItems),lines=[];return lines=pushOrConcat(lines,splitNewlines(beforeFooter)),lines=pushOrConcat(lines,splitNewlines(footer)),lines=pushOrConcat(lines,splitNewlines(afterFooter)),lines}_createItems(options){let active=this._active,data=this.chart.data,labelColors=[],labelPointStyles=[],labelTextColors=[],tooltipItems=[],i,len;for(i=0,len=active.length;i<len;++i)tooltipItems.push(createTooltipItem(this.chart,active[i]));if(options.filter)tooltipItems=tooltipItems.filter((element,index2,array)=>options.filter(element,index2,array,data));if(options.itemSort)tooltipItems=tooltipItems.sort((a,b)=>options.itemSort(a,b,data));return each(tooltipItems,(context)=>{let scoped=overrideCallbacks(options.callbacks,context);labelColors.push(invokeCallbackWithFallback(scoped,\"labelColor\",this,context)),labelPointStyles.push(invokeCallbackWithFallback(scoped,\"labelPointStyle\",this,context)),labelTextColors.push(invokeCallbackWithFallback(scoped,\"labelTextColor\",this,context))}),this.labelColors=labelColors,this.labelPointStyles=labelPointStyles,this.labelTextColors=labelTextColors,this.dataPoints=tooltipItems,tooltipItems}update(changed,replay){let options=this.options.setContext(this.getContext()),active=this._active,properties,tooltipItems=[];if(!active.length){if(this.opacity!==0)properties={opacity:0}}else{let position=positioners[options.position].call(this,active,this._eventPosition);tooltipItems=this._createItems(options),this.title=this.getTitle(tooltipItems,options),this.beforeBody=this.getBeforeBody(tooltipItems,options),this.body=this.getBody(tooltipItems,options),this.afterBody=this.getAfterBody(tooltipItems,options),this.footer=this.getFooter(tooltipItems,options);let size=this._size=getTooltipSize(this,options),positionAndSize=Object.assign({},position,size),alignment=determineAlignment(this.chart,options,positionAndSize),backgroundPoint=getBackgroundPoint(options,positionAndSize,alignment,this.chart);this.xAlign=alignment.xAlign,this.yAlign=alignment.yAlign,properties={opacity:1,x:backgroundPoint.x,y:backgroundPoint.y,width:size.width,height:size.height,caretX:position.x,caretY:position.y}}if(this._tooltipItems=tooltipItems,this.$context=void 0,properties)this._resolveAnimations().update(this,properties);if(changed&&options.external)options.external.call(this,{chart:this.chart,tooltip:this,replay})}drawCaret(tooltipPoint,ctx,size,options){let caretPosition=this.getCaretPosition(tooltipPoint,size,options);ctx.lineTo(caretPosition.x1,caretPosition.y1),ctx.lineTo(caretPosition.x2,caretPosition.y2),ctx.lineTo(caretPosition.x3,caretPosition.y3)}getCaretPosition(tooltipPoint,size,options){let{xAlign,yAlign}=this,{caretSize,cornerRadius}=options,{topLeft,topRight,bottomLeft,bottomRight}=toTRBLCorners(cornerRadius),{x:ptX,y:ptY}=tooltipPoint,{width,height}=size,x1,x2,x3,y1,y2,y3;if(yAlign===\"center\"){if(y2=ptY+height/2,xAlign===\"left\")x1=ptX,x2=x1-caretSize,y1=y2+caretSize,y3=y2-caretSize;else x1=ptX+width,x2=x1+caretSize,y1=y2-caretSize,y3=y2+caretSize;x3=x1}else{if(xAlign===\"left\")x2=ptX+Math.max(topLeft,bottomLeft)+caretSize;else if(xAlign===\"right\")x2=ptX+width-Math.max(topRight,bottomRight)-caretSize;else x2=this.caretX;if(yAlign===\"top\")y1=ptY,y2=y1-caretSize,x1=x2-caretSize,x3=x2+caretSize;else y1=ptY+height,y2=y1+caretSize,x1=x2+caretSize,x3=x2-caretSize;y3=y1}return{x1,x2,x3,y1,y2,y3}}drawTitle(pt,ctx,options){let title=this.title,length=title.length,titleFont,titleSpacing,i;if(length){let rtlHelper=getRtlAdapter(options.rtl,this.x,this.width);pt.x=getAlignedX(this,options.titleAlign,options),ctx.textAlign=rtlHelper.textAlign(options.titleAlign),ctx.textBaseline=\"middle\",titleFont=toFont(options.titleFont),titleSpacing=options.titleSpacing,ctx.fillStyle=options.titleColor,ctx.font=titleFont.string;for(i=0;i<length;++i)if(ctx.fillText(title[i],rtlHelper.x(pt.x),pt.y+titleFont.lineHeight/2),pt.y+=titleFont.lineHeight+titleSpacing,i+1===length)pt.y+=options.titleMarginBottom-titleSpacing}}_drawColorBox(ctx,pt,i,rtlHelper,options){let labelColor=this.labelColors[i],labelPointStyle=this.labelPointStyles[i],{boxHeight,boxWidth}=options,bodyFont=toFont(options.bodyFont),colorX=getAlignedX(this,\"left\",options),rtlColorX=rtlHelper.x(colorX),yOffSet=boxHeight<bodyFont.lineHeight?(bodyFont.lineHeight-boxHeight)/2:0,colorY=pt.y+yOffSet;if(options.usePointStyle){let drawOptions={radius:Math.min(boxWidth,boxHeight)/2,pointStyle:labelPointStyle.pointStyle,rotation:labelPointStyle.rotation,borderWidth:1},centerX=rtlHelper.leftForLtr(rtlColorX,boxWidth)+boxWidth/2,centerY=colorY+boxHeight/2;ctx.strokeStyle=options.multiKeyBackground,ctx.fillStyle=options.multiKeyBackground,drawPoint(ctx,drawOptions,centerX,centerY),ctx.strokeStyle=labelColor.borderColor,ctx.fillStyle=labelColor.backgroundColor,drawPoint(ctx,drawOptions,centerX,centerY)}else{ctx.lineWidth=isObject(labelColor.borderWidth)?Math.max(...Object.values(labelColor.borderWidth)):labelColor.borderWidth||1,ctx.strokeStyle=labelColor.borderColor,ctx.setLineDash(labelColor.borderDash||[]),ctx.lineDashOffset=labelColor.borderDashOffset||0;let outerX=rtlHelper.leftForLtr(rtlColorX,boxWidth),innerX=rtlHelper.leftForLtr(rtlHelper.xPlus(rtlColorX,1),boxWidth-2),borderRadius=toTRBLCorners(labelColor.borderRadius);if(Object.values(borderRadius).some((v)=>v!==0))ctx.beginPath(),ctx.fillStyle=options.multiKeyBackground,addRoundedRectPath(ctx,{x:outerX,y:colorY,w:boxWidth,h:boxHeight,radius:borderRadius}),ctx.fill(),ctx.stroke(),ctx.fillStyle=labelColor.backgroundColor,ctx.beginPath(),addRoundedRectPath(ctx,{x:innerX,y:colorY+1,w:boxWidth-2,h:boxHeight-2,radius:borderRadius}),ctx.fill();else ctx.fillStyle=options.multiKeyBackground,ctx.fillRect(outerX,colorY,boxWidth,boxHeight),ctx.strokeRect(outerX,colorY,boxWidth,boxHeight),ctx.fillStyle=labelColor.backgroundColor,ctx.fillRect(innerX,colorY+1,boxWidth-2,boxHeight-2)}ctx.fillStyle=this.labelTextColors[i]}drawBody(pt,ctx,options){let{body}=this,{bodySpacing,bodyAlign,displayColors,boxHeight,boxWidth,boxPadding}=options,bodyFont=toFont(options.bodyFont),bodyLineHeight=bodyFont.lineHeight,xLinePadding=0,rtlHelper=getRtlAdapter(options.rtl,this.x,this.width),fillLineOfText=function(line){ctx.fillText(line,rtlHelper.x(pt.x+xLinePadding),pt.y+bodyLineHeight/2),pt.y+=bodyLineHeight+bodySpacing},bodyAlignForCalculation=rtlHelper.textAlign(bodyAlign),bodyItem,textColor,lines,i,j,ilen,jlen;ctx.textAlign=bodyAlign,ctx.textBaseline=\"middle\",ctx.font=bodyFont.string,pt.x=getAlignedX(this,bodyAlignForCalculation,options),ctx.fillStyle=options.bodyColor,each(this.beforeBody,fillLineOfText),xLinePadding=displayColors&&bodyAlignForCalculation!==\"right\"?bodyAlign===\"center\"?boxWidth/2+boxPadding:boxWidth+2+boxPadding:0;for(i=0,ilen=body.length;i<ilen;++i){if(bodyItem=body[i],textColor=this.labelTextColors[i],ctx.fillStyle=textColor,each(bodyItem.before,fillLineOfText),lines=bodyItem.lines,displayColors&&lines.length)this._drawColorBox(ctx,pt,i,rtlHelper,options),bodyLineHeight=Math.max(bodyFont.lineHeight,boxHeight);for(j=0,jlen=lines.length;j<jlen;++j)fillLineOfText(lines[j]),bodyLineHeight=bodyFont.lineHeight;each(bodyItem.after,fillLineOfText)}xLinePadding=0,bodyLineHeight=bodyFont.lineHeight,each(this.afterBody,fillLineOfText),pt.y-=bodySpacing}drawFooter(pt,ctx,options){let footer=this.footer,length=footer.length,footerFont,i;if(length){let rtlHelper=getRtlAdapter(options.rtl,this.x,this.width);pt.x=getAlignedX(this,options.footerAlign,options),pt.y+=options.footerMarginTop,ctx.textAlign=rtlHelper.textAlign(options.footerAlign),ctx.textBaseline=\"middle\",footerFont=toFont(options.footerFont),ctx.fillStyle=options.footerColor,ctx.font=footerFont.string;for(i=0;i<length;++i)ctx.fillText(footer[i],rtlHelper.x(pt.x),pt.y+footerFont.lineHeight/2),pt.y+=footerFont.lineHeight+options.footerSpacing}}drawBackground(pt,ctx,tooltipSize,options){let{xAlign,yAlign}=this,{x,y}=pt,{width,height}=tooltipSize,{topLeft,topRight,bottomLeft,bottomRight}=toTRBLCorners(options.cornerRadius);if(ctx.fillStyle=options.backgroundColor,ctx.strokeStyle=options.borderColor,ctx.lineWidth=options.borderWidth,ctx.beginPath(),ctx.moveTo(x+topLeft,y),yAlign===\"top\")this.drawCaret(pt,ctx,tooltipSize,options);if(ctx.lineTo(x+width-topRight,y),ctx.quadraticCurveTo(x+width,y,x+width,y+topRight),yAlign===\"center\"&&xAlign===\"right\")this.drawCaret(pt,ctx,tooltipSize,options);if(ctx.lineTo(x+width,y+height-bottomRight),ctx.quadraticCurveTo(x+width,y+height,x+width-bottomRight,y+height),yAlign===\"bottom\")this.drawCaret(pt,ctx,tooltipSize,options);if(ctx.lineTo(x+bottomLeft,y+height),ctx.quadraticCurveTo(x,y+height,x,y+height-bottomLeft),yAlign===\"center\"&&xAlign===\"left\")this.drawCaret(pt,ctx,tooltipSize,options);if(ctx.lineTo(x,y+topLeft),ctx.quadraticCurveTo(x,y,x+topLeft,y),ctx.closePath(),ctx.fill(),options.borderWidth>0)ctx.stroke()}_updateAnimationTarget(options){let chart=this.chart,anims=this.$animations,animX=anims&&anims.x,animY=anims&&anims.y;if(animX||animY){let position=positioners[options.position].call(this,this._active,this._eventPosition);if(!position)return;let size=this._size=getTooltipSize(this,options),positionAndSize=Object.assign({},position,this._size),alignment=determineAlignment(chart,options,positionAndSize),point=getBackgroundPoint(options,positionAndSize,alignment,chart);if(animX._to!==point.x||animY._to!==point.y)this.xAlign=alignment.xAlign,this.yAlign=alignment.yAlign,this.width=size.width,this.height=size.height,this.caretX=position.x,this.caretY=position.y,this._resolveAnimations().update(this,point)}}_willRender(){return!!this.opacity}draw(ctx){let options=this.options.setContext(this.getContext()),opacity=this.opacity;if(!opacity)return;this._updateAnimationTarget(options);let tooltipSize={width:this.width,height:this.height},pt={x:this.x,y:this.y};opacity=Math.abs(opacity)<0.001?0:opacity;let padding=toPadding(options.padding),hasTooltipContent=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;if(options.enabled&&hasTooltipContent)ctx.save(),ctx.globalAlpha=opacity,this.drawBackground(pt,ctx,tooltipSize,options),overrideTextDirection(ctx,options.textDirection),pt.y+=padding.top,this.drawTitle(pt,ctx,options),this.drawBody(pt,ctx,options),this.drawFooter(pt,ctx,options),restoreTextDirection(ctx,options.textDirection),ctx.restore()}getActiveElements(){return this._active||[]}setActiveElements(activeElements,eventPosition){let lastActive=this._active,active=activeElements.map(({datasetIndex,index:index2})=>{let meta=this.chart.getDatasetMeta(datasetIndex);if(!meta)throw Error(\"Cannot find a dataset at index \"+datasetIndex);return{datasetIndex,element:meta.data[index2],index:index2}}),changed=!_elementsEqual(lastActive,active),positionChanged=this._positionChanged(active,eventPosition);if(changed||positionChanged)this._active=active,this._eventPosition=eventPosition,this._ignoreReplayEvents=!0,this.update(!0)}handleEvent(e,replay,inChartArea=!0){if(replay&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;let options=this.options,lastActive=this._active||[],active=this._getActiveElements(e,lastActive,replay,inChartArea),positionChanged=this._positionChanged(active,e),changed=replay||!_elementsEqual(active,lastActive)||positionChanged;if(changed){if(this._active=active,options.enabled||options.external)this._eventPosition={x:e.x,y:e.y},this.update(!0,replay)}return changed}_getActiveElements(e,lastActive,replay,inChartArea){let options=this.options;if(e.type===\"mouseout\")return[];if(!inChartArea)return lastActive.filter((i)=>this.chart.data.datasets[i.datasetIndex]&&this.chart.getDatasetMeta(i.datasetIndex).controller.getParsed(i.index)!==void 0);let active=this.chart.getElementsAtEventForMode(e,options.mode,options,replay);if(options.reverse)active.reverse();return active}_positionChanged(active,e){let{caretX,caretY,options}=this,position=positioners[options.position].call(this,active,e);return position!==!1&&(caretX!==position.x||caretY!==position.y)}}var plugin_tooltip={id:\"tooltip\",_element:Tooltip,positioners,afterInit(chart,_args,options){if(options)chart.tooltip=new Tooltip({chart,options})},beforeUpdate(chart,_args,options){if(chart.tooltip)chart.tooltip.initialize(options)},reset(chart,_args,options){if(chart.tooltip)chart.tooltip.initialize(options)},afterDraw(chart){let tooltip=chart.tooltip;if(tooltip&&tooltip._willRender()){let args={tooltip};if(chart.notifyPlugins(\"beforeTooltipDraw\",{...args,cancelable:!0})===!1)return;tooltip.draw(chart.ctx),chart.notifyPlugins(\"afterTooltipDraw\",args)}},afterEvent(chart,args){if(chart.tooltip){let useFinalPosition=args.replay;if(chart.tooltip.handleEvent(args.event,useFinalPosition,args.inChartArea))args.changed=!0}},defaults:{enabled:!0,external:null,position:\"average\",backgroundColor:\"rgba(0,0,0,0.8)\",titleColor:\"#fff\",titleFont:{weight:\"bold\"},titleSpacing:2,titleMarginBottom:6,titleAlign:\"left\",bodyColor:\"#fff\",bodySpacing:2,bodyFont:{},bodyAlign:\"left\",footerColor:\"#fff\",footerSpacing:2,footerMarginTop:6,footerFont:{weight:\"bold\"},footerAlign:\"left\",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(ctx,opts)=>opts.bodyFont.size,boxWidth:(ctx,opts)=>opts.bodyFont.size,multiKeyBackground:\"#fff\",displayColors:!0,boxPadding:0,borderColor:\"rgba(0,0,0,0)\",borderWidth:0,animation:{duration:400,easing:\"easeOutQuart\"},animations:{numbers:{type:\"number\",properties:[\"x\",\"y\",\"width\",\"height\",\"caretX\",\"caretY\"]},opacity:{easing:\"linear\",duration:200}},callbacks:defaultCallbacks},defaultRoutes:{bodyFont:\"font\",footerFont:\"font\",titleFont:\"font\"},descriptors:{_scriptable:(name)=>name!==\"filter\"&&name!==\"itemSort\"&&name!==\"external\",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:\"animation\"}},additionalOptionScopes:[\"interaction\"]},plugins=Object.freeze({__proto__:null,Colors:plugin_colors,Decimation:plugin_decimation,Filler:index,Legend:plugin_legend,SubTitle:plugin_subtitle,Title:plugin_title,Tooltip:plugin_tooltip}),addIfString=(labels,raw,index2,addedLabels)=>{if(typeof raw===\"string\")index2=labels.push(raw)-1,addedLabels.unshift({index:index2,label:raw});else if(isNaN(raw))index2=null;return index2};function findOrAddLabel(labels,raw,index2,addedLabels){let first=labels.indexOf(raw);if(first===-1)return addIfString(labels,raw,index2,addedLabels);let last=labels.lastIndexOf(raw);return first!==last?index2:first}var validIndex=(index2,max)=>index2===null?null:_limitValue(Math.round(index2),0,max);function _getLabelForValue(value){let labels=this.getLabels();if(value>=0&&value<labels.length)return labels[value];return value}class CategoryScale extends Scale{static id=\"category\";static defaults={ticks:{callback:_getLabelForValue}};constructor(cfg){super(cfg);this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(scaleOptions){let added=this._addedLabels;if(added.length){let labels=this.getLabels();for(let{index:index2,label}of added)if(labels[index2]===label)labels.splice(index2,1);this._addedLabels=[]}super.init(scaleOptions)}parse(raw,index2){if(isNullOrUndef(raw))return null;let labels=this.getLabels();return index2=isFinite(index2)&&labels[index2]===raw?index2:findOrAddLabel(labels,raw,valueOrDefault(index2,raw),this._addedLabels),validIndex(index2,labels.length-1)}determineDataLimits(){let{minDefined,maxDefined}=this.getUserBounds(),{min,max}=this.getMinMax(!0);if(this.options.bounds===\"ticks\"){if(!minDefined)min=0;if(!maxDefined)max=this.getLabels().length-1}this.min=min,this.max=max}buildTicks(){let min=this.min,max=this.max,offset=this.options.offset,ticks=[],labels=this.getLabels();labels=min===0&&max===labels.length-1?labels:labels.slice(min,max+1),this._valueRange=Math.max(labels.length-(offset?0:1),1),this._startValue=this.min-(offset?0.5:0);for(let value=min;value<=max;value++)ticks.push({value});return ticks}getLabelForValue(value){return _getLabelForValue.call(this,value)}configure(){if(super.configure(),!this.isHorizontal())this._reversePixels=!this._reversePixels}getPixelForValue(value){if(typeof value!==\"number\")value=this.parse(value);return value===null?NaN:this.getPixelForDecimal((value-this._startValue)/this._valueRange)}getPixelForTick(index2){let ticks=this.ticks;if(index2<0||index2>ticks.length-1)return null;return this.getPixelForValue(ticks[index2].value)}getValueForPixel(pixel){return Math.round(this._startValue+this.getDecimalForPixel(pixel)*this._valueRange)}getBasePixel(){return this.bottom}}function generateTicks$1(generationOptions,dataRange){let ticks=[],MIN_SPACING=0.00000000000001,{bounds,step,min,max,precision,count,maxTicks,maxDigits,includeBounds}=generationOptions,unit=step||1,maxSpaces=maxTicks-1,{min:rmin,max:rmax}=dataRange,minDefined=!isNullOrUndef(min),maxDefined=!isNullOrUndef(max),countDefined=!isNullOrUndef(count),minSpacing=(rmax-rmin)/(maxDigits+1),spacing=niceNum((rmax-rmin)/maxSpaces/unit)*unit,factor,niceMin,niceMax,numSpaces;if(spacing<0.00000000000001&&!minDefined&&!maxDefined)return[{value:rmin},{value:rmax}];if(numSpaces=Math.ceil(rmax/spacing)-Math.floor(rmin/spacing),numSpaces>maxSpaces)spacing=niceNum(numSpaces*spacing/maxSpaces/unit)*unit;if(!isNullOrUndef(precision))factor=Math.pow(10,precision),spacing=Math.ceil(spacing*factor)/factor;if(bounds===\"ticks\")niceMin=Math.floor(rmin/spacing)*spacing,niceMax=Math.ceil(rmax/spacing)*spacing;else niceMin=rmin,niceMax=rmax;if(minDefined&&maxDefined&&step&&almostWhole((max-min)/step,spacing/1000))numSpaces=Math.round(Math.min((max-min)/spacing,maxTicks)),spacing=(max-min)/numSpaces,niceMin=min,niceMax=max;else if(countDefined)niceMin=minDefined?min:niceMin,niceMax=maxDefined?max:niceMax,numSpaces=count-1,spacing=(niceMax-niceMin)/numSpaces;else if(numSpaces=(niceMax-niceMin)/spacing,almostEquals(numSpaces,Math.round(numSpaces),spacing/1000))numSpaces=Math.round(numSpaces);else numSpaces=Math.ceil(numSpaces);let decimalPlaces=Math.max(_decimalPlaces(spacing),_decimalPlaces(niceMin));factor=Math.pow(10,isNullOrUndef(precision)?decimalPlaces:precision),niceMin=Math.round(niceMin*factor)/factor,niceMax=Math.round(niceMax*factor)/factor;let j=0;if(minDefined){if(includeBounds&&niceMin!==min){if(ticks.push({value:min}),niceMin<min)j++;if(almostEquals(Math.round((niceMin+j*spacing)*factor)/factor,min,relativeLabelSize(min,minSpacing,generationOptions)))j++}else if(niceMin<min)j++}for(;j<numSpaces;++j){let tickValue=Math.round((niceMin+j*spacing)*factor)/factor;if(maxDefined&&tickValue>max)break;ticks.push({value:tickValue})}if(maxDefined&&includeBounds&&niceMax!==max)if(ticks.length&&almostEquals(ticks[ticks.length-1].value,max,relativeLabelSize(max,minSpacing,generationOptions)))ticks[ticks.length-1].value=max;else ticks.push({value:max});else if(!maxDefined||niceMax===max)ticks.push({value:niceMax});return ticks}function relativeLabelSize(value,minSpacing,{horizontal,minRotation}){let rad=toRadians(minRotation),ratio=(horizontal?Math.sin(rad):Math.cos(rad))||0.001,length=0.75*minSpacing*(\"\"+value).length;return Math.min(minSpacing/ratio,length)}class LinearScaleBase extends Scale{constructor(cfg){super(cfg);this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(raw,index2){if(isNullOrUndef(raw))return null;if((typeof raw===\"number\"||raw instanceof Number)&&!isFinite(+raw))return null;return+raw}handleTickRangeOptions(){let{beginAtZero}=this.options,{minDefined,maxDefined}=this.getUserBounds(),{min,max}=this,setMin=(v)=>min=minDefined?min:v,setMax=(v)=>max=maxDefined?max:v;if(beginAtZero){let minSign=sign(min),maxSign=sign(max);if(minSign<0&&maxSign<0)setMax(0);else if(minSign>0&&maxSign>0)setMin(0)}if(min===max){let offset=max===0?1:Math.abs(max*0.05);if(setMax(max+offset),!beginAtZero)setMin(min-offset)}this.min=min,this.max=max}getTickLimit(){let tickOpts=this.options.ticks,{maxTicksLimit,stepSize}=tickOpts,maxTicks;if(stepSize){if(maxTicks=Math.ceil(this.max/stepSize)-Math.floor(this.min/stepSize)+1,maxTicks>1000)console.warn(`scales.${this.id}.ticks.stepSize: ${stepSize} would result generating up to ${maxTicks} ticks. Limiting to 1000.`),maxTicks=1000}else maxTicks=this.computeTickLimit(),maxTicksLimit=maxTicksLimit||11;if(maxTicksLimit)maxTicks=Math.min(maxTicksLimit,maxTicks);return maxTicks}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){let opts=this.options,tickOpts=opts.ticks,maxTicks=this.getTickLimit();maxTicks=Math.max(2,maxTicks);let numericGeneratorOptions={maxTicks,bounds:opts.bounds,min:opts.min,max:opts.max,precision:tickOpts.precision,step:tickOpts.stepSize,count:tickOpts.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:tickOpts.minRotation||0,includeBounds:tickOpts.includeBounds!==!1},dataRange=this._range||this,ticks=generateTicks$1(numericGeneratorOptions,dataRange);if(opts.bounds===\"ticks\")_setMinAndMaxByKey(ticks,this,\"value\");if(opts.reverse)ticks.reverse(),this.start=this.max,this.end=this.min;else this.start=this.min,this.end=this.max;return ticks}configure(){let ticks=this.ticks,start=this.min,end=this.max;if(super.configure(),this.options.offset&&ticks.length){let offset=(end-start)/Math.max(ticks.length-1,1)/2;start-=offset,end+=offset}this._startValue=start,this._endValue=end,this._valueRange=end-start}getLabelForValue(value){return formatNumber(value,this.chart.options.locale,this.options.ticks.format)}}class LinearScale extends LinearScaleBase{static id=\"linear\";static defaults={ticks:{callback:Ticks.formatters.numeric}};determineDataLimits(){let{min,max}=this.getMinMax(!0);this.min=isNumberFinite(min)?min:0,this.max=isNumberFinite(max)?max:1,this.handleTickRangeOptions()}computeTickLimit(){let horizontal=this.isHorizontal(),length=horizontal?this.width:this.height,minRotation=toRadians(this.options.ticks.minRotation),ratio=(horizontal?Math.sin(minRotation):Math.cos(minRotation))||0.001,tickFont=this._resolveTickFontOptions(0);return Math.ceil(length/Math.min(40,tickFont.lineHeight/ratio))}getPixelForValue(value){return value===null?NaN:this.getPixelForDecimal((value-this._startValue)/this._valueRange)}getValueForPixel(pixel){return this._startValue+this.getDecimalForPixel(pixel)*this._valueRange}}var log10Floor=(v)=>Math.floor(log10(v)),changeExponent=(v,m)=>Math.pow(10,log10Floor(v)+m);function isMajor(tickVal){return tickVal/Math.pow(10,log10Floor(tickVal))===1}function steps(min,max,rangeExp){let rangeStep=Math.pow(10,rangeExp),start=Math.floor(min/rangeStep);return Math.ceil(max/rangeStep)-start}function startExp(min,max){let range=max-min,rangeExp=log10Floor(range);while(steps(min,max,rangeExp)>10)rangeExp++;while(steps(min,max,rangeExp)<10)rangeExp--;return Math.min(rangeExp,log10Floor(min))}function generateTicks(generationOptions,{min,max}){min=finiteOrDefault(generationOptions.min,min);let ticks=[],minExp=log10Floor(min),exp=startExp(min,max),precision=exp<0?Math.pow(10,Math.abs(exp)):1,stepSize=Math.pow(10,exp),base=minExp>exp?Math.pow(10,minExp):0,start=Math.round((min-base)*precision)/precision,offset=Math.floor((min-base)/stepSize/10)*stepSize*10,significand=Math.floor((start-offset)/Math.pow(10,exp)),value=finiteOrDefault(generationOptions.min,Math.round((base+offset+significand*Math.pow(10,exp))*precision)/precision);while(value<max){if(ticks.push({value,major:isMajor(value),significand}),significand>=10)significand=significand<15?15:20;else significand++;if(significand>=20)exp++,significand=2,precision=exp>=0?1:precision;value=Math.round((base+offset+significand*Math.pow(10,exp))*precision)/precision}let lastTick=finiteOrDefault(generationOptions.max,value);return ticks.push({value:lastTick,major:isMajor(lastTick),significand}),ticks}class LogarithmicScale extends Scale{static id=\"logarithmic\";static defaults={ticks:{callback:Ticks.formatters.logarithmic,major:{enabled:!0}}};constructor(cfg){super(cfg);this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(raw,index2){let value=LinearScaleBase.prototype.parse.apply(this,[raw,index2]);if(value===0){this._zero=!0;return}return isNumberFinite(value)&&value>0?value:null}determineDataLimits(){let{min,max}=this.getMinMax(!0);if(this.min=isNumberFinite(min)?Math.max(0,min):null,this.max=isNumberFinite(max)?Math.max(0,max):null,this.options.beginAtZero)this._zero=!0;if(this._zero&&this.min!==this._suggestedMin&&!isNumberFinite(this._userMin))this.min=min===changeExponent(this.min,0)?changeExponent(this.min,-1):changeExponent(this.min,0);this.handleTickRangeOptions()}handleTickRangeOptions(){let{minDefined,maxDefined}=this.getUserBounds(),min=this.min,max=this.max,setMin=(v)=>min=minDefined?min:v,setMax=(v)=>max=maxDefined?max:v;if(min===max)if(min<=0)setMin(1),setMax(10);else setMin(changeExponent(min,-1)),setMax(changeExponent(max,1));if(min<=0)setMin(changeExponent(max,-1));if(max<=0)setMax(changeExponent(min,1));this.min=min,this.max=max}buildTicks(){let opts=this.options,generationOptions={min:this._userMin,max:this._userMax},ticks=generateTicks(generationOptions,this);if(opts.bounds===\"ticks\")_setMinAndMaxByKey(ticks,this,\"value\");if(opts.reverse)ticks.reverse(),this.start=this.max,this.end=this.min;else this.start=this.min,this.end=this.max;return ticks}getLabelForValue(value){return value===void 0?\"0\":formatNumber(value,this.chart.options.locale,this.options.ticks.format)}configure(){let start=this.min;super.configure(),this._startValue=log10(start),this._valueRange=log10(this.max)-log10(start)}getPixelForValue(value){if(value===void 0||value===0)value=this.min;if(value===null||isNaN(value))return NaN;return this.getPixelForDecimal(value===this.min?0:(log10(value)-this._startValue)/this._valueRange)}getValueForPixel(pixel){let decimal=this.getDecimalForPixel(pixel);return Math.pow(10,this._startValue+decimal*this._valueRange)}}function getTickBackdropHeight(opts){let tickOpts=opts.ticks;if(tickOpts.display&&opts.display){let padding=toPadding(tickOpts.backdropPadding);return valueOrDefault(tickOpts.font&&tickOpts.font.size,defaults.font.size)+padding.height}return 0}function measureLabelSize(ctx,font,label){return label=isArray(label)?label:[label],{w:_longestText(ctx,font.string,label),h:label.length*font.lineHeight}}function determineLimits(angle,pos,size,min,max){if(angle===min||angle===max)return{start:pos-size/2,end:pos+size/2};else if(angle<min||angle>max)return{start:pos-size,end:pos};return{start:pos,end:pos+size}}function fitWithPointLabels(scale){let orig={l:scale.left+scale._padding.left,r:scale.right-scale._padding.right,t:scale.top+scale._padding.top,b:scale.bottom-scale._padding.bottom},limits=Object.assign({},orig),labelSizes=[],padding=[],valueCount=scale._pointLabels.length,pointLabelOpts=scale.options.pointLabels,additionalAngle=pointLabelOpts.centerPointLabels?PI/valueCount:0;for(let i=0;i<valueCount;i++){let opts=pointLabelOpts.setContext(scale.getPointLabelContext(i));padding[i]=opts.padding;let pointPosition=scale.getPointPosition(i,scale.drawingArea+padding[i],additionalAngle),plFont=toFont(opts.font),textSize=measureLabelSize(scale.ctx,plFont,scale._pointLabels[i]);labelSizes[i]=textSize;let angleRadians=_normalizeAngle(scale.getIndexAngle(i)+additionalAngle),angle=Math.round(toDegrees(angleRadians)),hLimits=determineLimits(angle,pointPosition.x,textSize.w,0,180),vLimits=determineLimits(angle,pointPosition.y,textSize.h,90,270);updateLimits(limits,orig,angleRadians,hLimits,vLimits)}scale.setCenterPoint(orig.l-limits.l,limits.r-orig.r,orig.t-limits.t,limits.b-orig.b),scale._pointLabelItems=buildPointLabelItems(scale,labelSizes,padding)}function updateLimits(limits,orig,angle,hLimits,vLimits){let sin=Math.abs(Math.sin(angle)),cos=Math.abs(Math.cos(angle)),x=0,y=0;if(hLimits.start<orig.l)x=(orig.l-hLimits.start)/sin,limits.l=Math.min(limits.l,orig.l-x);else if(hLimits.end>orig.r)x=(hLimits.end-orig.r)/sin,limits.r=Math.max(limits.r,orig.r+x);if(vLimits.start<orig.t)y=(orig.t-vLimits.start)/cos,limits.t=Math.min(limits.t,orig.t-y);else if(vLimits.end>orig.b)y=(vLimits.end-orig.b)/cos,limits.b=Math.max(limits.b,orig.b+y)}function createPointLabelItem(scale,index2,itemOpts){let outerDistance=scale.drawingArea,{extra,additionalAngle,padding,size}=itemOpts,pointLabelPosition=scale.getPointPosition(index2,outerDistance+extra+padding,additionalAngle),angle=Math.round(toDegrees(_normalizeAngle(pointLabelPosition.angle+HALF_PI))),y=yForAngle(pointLabelPosition.y,size.h,angle),textAlign=getTextAlignForAngle(angle),left=leftForTextAlign(pointLabelPosition.x,size.w,textAlign);return{visible:!0,x:pointLabelPosition.x,y,textAlign,left,top:y,right:left+size.w,bottom:y+size.h}}function isNotOverlapped(item,area){if(!area)return!0;let{left,top,right,bottom}=item;return!(_isPointInArea({x:left,y:top},area)||_isPointInArea({x:left,y:bottom},area)||_isPointInArea({x:right,y:top},area)||_isPointInArea({x:right,y:bottom},area))}function buildPointLabelItems(scale,labelSizes,padding){let items=[],valueCount=scale._pointLabels.length,opts=scale.options,{centerPointLabels,display}=opts.pointLabels,itemOpts={extra:getTickBackdropHeight(opts)/2,additionalAngle:centerPointLabels?PI/valueCount:0},area;for(let i=0;i<valueCount;i++){itemOpts.padding=padding[i],itemOpts.size=labelSizes[i];let item=createPointLabelItem(scale,i,itemOpts);if(items.push(item),display===\"auto\"){if(item.visible=isNotOverlapped(item,area),item.visible)area=item}}return items}function getTextAlignForAngle(angle){if(angle===0||angle===180)return\"center\";else if(angle<180)return\"left\";return\"right\"}function leftForTextAlign(x,w,align){if(align===\"right\")x-=w;else if(align===\"center\")x-=w/2;return x}function yForAngle(y,h,angle){if(angle===90||angle===270)y-=h/2;else if(angle>270||angle<90)y-=h;return y}function drawPointLabelBox(ctx,opts,item){let{left,top,right,bottom}=item,{backdropColor}=opts;if(!isNullOrUndef(backdropColor)){let borderRadius=toTRBLCorners(opts.borderRadius),padding=toPadding(opts.backdropPadding);ctx.fillStyle=backdropColor;let backdropLeft=left-padding.left,backdropTop=top-padding.top,backdropWidth=right-left+padding.width,backdropHeight=bottom-top+padding.height;if(Object.values(borderRadius).some((v)=>v!==0))ctx.beginPath(),addRoundedRectPath(ctx,{x:backdropLeft,y:backdropTop,w:backdropWidth,h:backdropHeight,radius:borderRadius}),ctx.fill();else ctx.fillRect(backdropLeft,backdropTop,backdropWidth,backdropHeight)}}function drawPointLabels(scale,labelCount){let{ctx,options:{pointLabels}}=scale;for(let i=labelCount-1;i>=0;i--){let item=scale._pointLabelItems[i];if(!item.visible)continue;let optsAtIndex=pointLabels.setContext(scale.getPointLabelContext(i));drawPointLabelBox(ctx,optsAtIndex,item);let plFont=toFont(optsAtIndex.font),{x,y,textAlign}=item;renderText(ctx,scale._pointLabels[i],x,y+plFont.lineHeight/2,plFont,{color:optsAtIndex.color,textAlign,textBaseline:\"middle\"})}}function pathRadiusLine(scale,radius,circular,labelCount){let{ctx}=scale;if(circular)ctx.arc(scale.xCenter,scale.yCenter,radius,0,TAU);else{let pointPosition=scale.getPointPosition(0,radius);ctx.moveTo(pointPosition.x,pointPosition.y);for(let i=1;i<labelCount;i++)pointPosition=scale.getPointPosition(i,radius),ctx.lineTo(pointPosition.x,pointPosition.y)}}function drawRadiusLine(scale,gridLineOpts,radius,labelCount,borderOpts){let ctx=scale.ctx,circular=gridLineOpts.circular,{color:color2,lineWidth}=gridLineOpts;if(!circular&&!labelCount||!color2||!lineWidth||radius<0)return;ctx.save(),ctx.strokeStyle=color2,ctx.lineWidth=lineWidth,ctx.setLineDash(borderOpts.dash||[]),ctx.lineDashOffset=borderOpts.dashOffset,ctx.beginPath(),pathRadiusLine(scale,radius,circular,labelCount),ctx.closePath(),ctx.stroke(),ctx.restore()}function createPointLabelContext(parent,index2,label){return createContext(parent,{label,index:index2,type:\"pointLabel\"})}class RadialLinearScale extends LinearScaleBase{static id=\"radialLinear\";static defaults={display:!0,animate:!0,position:\"chartArea\",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Ticks.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(label){return label},padding:5,centerPointLabels:!1}};static defaultRoutes={\"angleLines.color\":\"borderColor\",\"pointLabels.color\":\"color\",\"ticks.color\":\"color\"};static descriptors={angleLines:{_fallback:\"grid\"}};constructor(cfg){super(cfg);this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){let padding=this._padding=toPadding(getTickBackdropHeight(this.options)/2),w=this.width=this.maxWidth-padding.width,h=this.height=this.maxHeight-padding.height;this.xCenter=Math.floor(this.left+w/2+padding.left),this.yCenter=Math.floor(this.top+h/2+padding.top),this.drawingArea=Math.floor(Math.min(w,h)/2)}determineDataLimits(){let{min,max}=this.getMinMax(!1);this.min=isNumberFinite(min)&&!isNaN(min)?min:0,this.max=isNumberFinite(max)&&!isNaN(max)?max:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/getTickBackdropHeight(this.options))}generateTickLabels(ticks){LinearScaleBase.prototype.generateTickLabels.call(this,ticks),this._pointLabels=this.getLabels().map((value,index2)=>{let label=callback(this.options.pointLabels.callback,[value,index2],this);return label||label===0?label:\"\"}).filter((v,i)=>this.chart.getDataVisibility(i))}fit(){let opts=this.options;if(opts.display&&opts.pointLabels.display)fitWithPointLabels(this);else this.setCenterPoint(0,0,0,0)}setCenterPoint(leftMovement,rightMovement,topMovement,bottomMovement){this.xCenter+=Math.floor((leftMovement-rightMovement)/2),this.yCenter+=Math.floor((topMovement-bottomMovement)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(leftMovement,rightMovement,topMovement,bottomMovement))}getIndexAngle(index2){let angleMultiplier=TAU/(this._pointLabels.length||1),startAngle=this.options.startAngle||0;return _normalizeAngle(index2*angleMultiplier+toRadians(startAngle))}getDistanceFromCenterForValue(value){if(isNullOrUndef(value))return NaN;let scalingFactor=this.drawingArea/(this.max-this.min);if(this.options.reverse)return(this.max-value)*scalingFactor;return(value-this.min)*scalingFactor}getValueForDistanceFromCenter(distance){if(isNullOrUndef(distance))return NaN;let scaledDistance=distance/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-scaledDistance:this.min+scaledDistance}getPointLabelContext(index2){let pointLabels=this._pointLabels||[];if(index2>=0&&index2<pointLabels.length){let pointLabel=pointLabels[index2];return createPointLabelContext(this.getContext(),index2,pointLabel)}}getPointPosition(index2,distanceFromCenter,additionalAngle=0){let angle=this.getIndexAngle(index2)-HALF_PI+additionalAngle;return{x:Math.cos(angle)*distanceFromCenter+this.xCenter,y:Math.sin(angle)*distanceFromCenter+this.yCenter,angle}}getPointPositionForValue(index2,value){return this.getPointPosition(index2,this.getDistanceFromCenterForValue(value))}getBasePosition(index2){return this.getPointPositionForValue(index2||0,this.getBaseValue())}getPointLabelPosition(index2){let{left,top,right,bottom}=this._pointLabelItems[index2];return{left,top,right,bottom}}drawBackground(){let{backgroundColor,grid:{circular}}=this.options;if(backgroundColor){let ctx=this.ctx;ctx.save(),ctx.beginPath(),pathRadiusLine(this,this.getDistanceFromCenterForValue(this._endValue),circular,this._pointLabels.length),ctx.closePath(),ctx.fillStyle=backgroundColor,ctx.fill(),ctx.restore()}}drawGrid(){let ctx=this.ctx,opts=this.options,{angleLines,grid,border}=opts,labelCount=this._pointLabels.length,i,offset,position;if(opts.pointLabels.display)drawPointLabels(this,labelCount);if(grid.display)this.ticks.forEach((tick,index2)=>{if(index2!==0||index2===0&&this.min<0){offset=this.getDistanceFromCenterForValue(tick.value);let context=this.getContext(index2),optsAtIndex=grid.setContext(context),optsAtIndexBorder=border.setContext(context);drawRadiusLine(this,optsAtIndex,offset,labelCount,optsAtIndexBorder)}});if(angleLines.display){ctx.save();for(i=labelCount-1;i>=0;i--){let optsAtIndex=angleLines.setContext(this.getPointLabelContext(i)),{color:color2,lineWidth}=optsAtIndex;if(!lineWidth||!color2)continue;ctx.lineWidth=lineWidth,ctx.strokeStyle=color2,ctx.setLineDash(optsAtIndex.borderDash),ctx.lineDashOffset=optsAtIndex.borderDashOffset,offset=this.getDistanceFromCenterForValue(opts.reverse?this.min:this.max),position=this.getPointPosition(i,offset),ctx.beginPath(),ctx.moveTo(this.xCenter,this.yCenter),ctx.lineTo(position.x,position.y),ctx.stroke()}ctx.restore()}}drawBorder(){}drawLabels(){let ctx=this.ctx,opts=this.options,tickOpts=opts.ticks;if(!tickOpts.display)return;let startAngle=this.getIndexAngle(0),offset,width;ctx.save(),ctx.translate(this.xCenter,this.yCenter),ctx.rotate(startAngle),ctx.textAlign=\"center\",ctx.textBaseline=\"middle\",this.ticks.forEach((tick,index2)=>{if(index2===0&&this.min>=0&&!opts.reverse)return;let optsAtIndex=tickOpts.setContext(this.getContext(index2)),tickFont=toFont(optsAtIndex.font);if(offset=this.getDistanceFromCenterForValue(this.ticks[index2].value),optsAtIndex.showLabelBackdrop){ctx.font=tickFont.string,width=ctx.measureText(tick.label).width,ctx.fillStyle=optsAtIndex.backdropColor;let padding=toPadding(optsAtIndex.backdropPadding);ctx.fillRect(-width/2-padding.left,-offset-tickFont.size/2-padding.top,width+padding.width,tickFont.size+padding.height)}renderText(ctx,tick.label,0,-offset,tickFont,{color:optsAtIndex.color,strokeColor:optsAtIndex.textStrokeColor,strokeWidth:optsAtIndex.textStrokeWidth})}),ctx.restore()}drawTitle(){}}var INTERVALS={millisecond:{common:!0,size:1,steps:1000},second:{common:!0,size:1000,steps:60},minute:{common:!0,size:60000,steps:60},hour:{common:!0,size:3600000,steps:24},day:{common:!0,size:86400000,steps:30},week:{common:!1,size:604800000,steps:4},month:{common:!0,size:2628000000,steps:12},quarter:{common:!1,size:7884000000,steps:4},year:{common:!0,size:31540000000}},UNITS=Object.keys(INTERVALS);function sorter(a,b){return a-b}function parse(scale,input){if(isNullOrUndef(input))return null;let adapter=scale._adapter,{parser,round:round2,isoWeekday}=scale._parseOpts,value=input;if(typeof parser===\"function\")value=parser(value);if(!isNumberFinite(value))value=typeof parser===\"string\"?adapter.parse(value,parser):adapter.parse(value);if(value===null)return null;if(round2)value=round2===\"week\"&&(isNumber(isoWeekday)||isoWeekday===!0)?adapter.startOf(value,\"isoWeek\",isoWeekday):adapter.startOf(value,round2);return+value}function determineUnitForAutoTicks(minUnit,min,max,capacity){let ilen=UNITS.length;for(let i=UNITS.indexOf(minUnit);i<ilen-1;++i){let interval=INTERVALS[UNITS[i]],factor=interval.steps?interval.steps:Number.MAX_SAFE_INTEGER;if(interval.common&&Math.ceil((max-min)/(factor*interval.size))<=capacity)return UNITS[i]}return UNITS[ilen-1]}function determineUnitForFormatting(scale,numTicks,minUnit,min,max){for(let i=UNITS.length-1;i>=UNITS.indexOf(minUnit);i--){let unit=UNITS[i];if(INTERVALS[unit].common&&scale._adapter.diff(max,min,unit)>=numTicks-1)return unit}return UNITS[minUnit?UNITS.indexOf(minUnit):0]}function determineMajorUnit(unit){for(let i=UNITS.indexOf(unit)+1,ilen=UNITS.length;i<ilen;++i)if(INTERVALS[UNITS[i]].common)return UNITS[i]}function addTick(ticks,time,timestamps){if(!timestamps)ticks[time]=!0;else if(timestamps.length){let{lo,hi}=_lookup(timestamps,time),timestamp=timestamps[lo]>=time?timestamps[lo]:timestamps[hi];ticks[timestamp]=!0}}function setMajorTicks(scale,ticks,map3,majorUnit){let adapter=scale._adapter,first=+adapter.startOf(ticks[0].value,majorUnit),last=ticks[ticks.length-1].value,major,index2;for(major=first;major<=last;major=+adapter.add(major,1,majorUnit))if(index2=map3[major],index2>=0)ticks[index2].major=!0;return ticks}function ticksFromTimestamps(scale,values,majorUnit){let ticks=[],map3={},ilen=values.length,i,value;for(i=0;i<ilen;++i)value=values[i],map3[value]=i,ticks.push({value,major:!1});return ilen===0||!majorUnit?ticks:setMajorTicks(scale,ticks,map3,majorUnit)}class TimeScale extends Scale{static id=\"time\";static defaults={bounds:\"data\",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:\"millisecond\",displayFormats:{}},ticks:{source:\"auto\",callback:!1,major:{enabled:!1}}};constructor(props){super(props);this._cache={data:[],labels:[],all:[]},this._unit=\"day\",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(scaleOpts,opts={}){let time=scaleOpts.time||(scaleOpts.time={}),adapter=this._adapter=new adapters._date(scaleOpts.adapters.date);adapter.init(opts),mergeIf(time.displayFormats,adapter.formats()),this._parseOpts={parser:time.parser,round:time.round,isoWeekday:time.isoWeekday},super.init(scaleOpts),this._normalized=opts.normalized}parse(raw,index2){if(raw===void 0)return null;return parse(this,raw)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){let options=this.options,adapter=this._adapter,unit=options.time.unit||\"day\",{min,max,minDefined,maxDefined}=this.getUserBounds();function _applyBounds(bounds){if(!minDefined&&!isNaN(bounds.min))min=Math.min(min,bounds.min);if(!maxDefined&&!isNaN(bounds.max))max=Math.max(max,bounds.max)}if(!minDefined||!maxDefined){if(_applyBounds(this._getLabelBounds()),options.bounds!==\"ticks\"||options.ticks.source!==\"labels\")_applyBounds(this.getMinMax(!1))}min=isNumberFinite(min)&&!isNaN(min)?min:+adapter.startOf(Date.now(),unit),max=isNumberFinite(max)&&!isNaN(max)?max:+adapter.endOf(Date.now(),unit)+1,this.min=Math.min(min,max-1),this.max=Math.max(min+1,max)}_getLabelBounds(){let arr=this.getLabelTimestamps(),min=Number.POSITIVE_INFINITY,max=Number.NEGATIVE_INFINITY;if(arr.length)min=arr[0],max=arr[arr.length-1];return{min,max}}buildTicks(){let options=this.options,timeOpts=options.time,tickOpts=options.ticks,timestamps=tickOpts.source===\"labels\"?this.getLabelTimestamps():this._generate();if(options.bounds===\"ticks\"&&timestamps.length)this.min=this._userMin||timestamps[0],this.max=this._userMax||timestamps[timestamps.length-1];let min=this.min,max=this.max,ticks=_filterBetween(timestamps,min,max);if(this._unit=timeOpts.unit||(tickOpts.autoSkip?determineUnitForAutoTicks(timeOpts.minUnit,this.min,this.max,this._getLabelCapacity(min)):determineUnitForFormatting(this,ticks.length,timeOpts.minUnit,this.min,this.max)),this._majorUnit=!tickOpts.major.enabled||this._unit===\"year\"?void 0:determineMajorUnit(this._unit),this.initOffsets(timestamps),options.reverse)ticks.reverse();return ticksFromTimestamps(this,ticks,this._majorUnit)}afterAutoSkip(){if(this.options.offsetAfterAutoskip)this.initOffsets(this.ticks.map((tick)=>+tick.value))}initOffsets(timestamps=[]){let start=0,end=0,first,last;if(this.options.offset&&timestamps.length){if(first=this.getDecimalForValue(timestamps[0]),timestamps.length===1)start=1-first;else start=(this.getDecimalForValue(timestamps[1])-first)/2;if(last=this.getDecimalForValue(timestamps[timestamps.length-1]),timestamps.length===1)end=last;else end=(last-this.getDecimalForValue(timestamps[timestamps.length-2]))/2}let limit=timestamps.length<3?0.5:0.25;start=_limitValue(start,0,limit),end=_limitValue(end,0,limit),this._offsets={start,end,factor:1/(start+1+end)}}_generate(){let adapter=this._adapter,min=this.min,max=this.max,options=this.options,timeOpts=options.time,minor=timeOpts.unit||determineUnitForAutoTicks(timeOpts.minUnit,min,max,this._getLabelCapacity(min)),stepSize=valueOrDefault(options.ticks.stepSize,1),weekday=minor===\"week\"?timeOpts.isoWeekday:!1,hasWeekday=isNumber(weekday)||weekday===!0,ticks={},first=min,time,count;if(hasWeekday)first=+adapter.startOf(first,\"isoWeek\",weekday);if(first=+adapter.startOf(first,hasWeekday?\"day\":minor),adapter.diff(max,min,minor)>1e5*stepSize)throw Error(min+\" and \"+max+\" are too far apart with stepSize of \"+stepSize+\" \"+minor);let timestamps=options.ticks.source===\"data\"&&this.getDataTimestamps();for(time=first,count=0;time<max;time=+adapter.add(time,stepSize,minor),count++)addTick(ticks,time,timestamps);if(time===max||options.bounds===\"ticks\"||count===1)addTick(ticks,time,timestamps);return Object.keys(ticks).sort(sorter).map((x)=>+x)}getLabelForValue(value){let adapter=this._adapter,timeOpts=this.options.time;if(timeOpts.tooltipFormat)return adapter.format(value,timeOpts.tooltipFormat);return adapter.format(value,timeOpts.displayFormats.datetime)}format(value,format){let formats=this.options.time.displayFormats,unit=this._unit,fmt=format||formats[unit];return this._adapter.format(value,fmt)}_tickFormatFunction(time,index2,ticks,format){let options=this.options,formatter=options.ticks.callback;if(formatter)return callback(formatter,[time,index2,ticks],this);let formats=options.time.displayFormats,unit=this._unit,majorUnit=this._majorUnit,minorFormat=unit&&formats[unit],majorFormat=majorUnit&&formats[majorUnit],tick=ticks[index2],major=majorUnit&&majorFormat&&tick&&tick.major;return this._adapter.format(time,format||(major?majorFormat:minorFormat))}generateTickLabels(ticks){let i,ilen,tick;for(i=0,ilen=ticks.length;i<ilen;++i)tick=ticks[i],tick.label=this._tickFormatFunction(tick.value,i,ticks)}getDecimalForValue(value){return value===null?NaN:(value-this.min)/(this.max-this.min)}getPixelForValue(value){let offsets=this._offsets,pos=this.getDecimalForValue(value);return this.getPixelForDecimal((offsets.start+pos)*offsets.factor)}getValueForPixel(pixel){let offsets=this._offsets,pos=this.getDecimalForPixel(pixel)/offsets.factor-offsets.end;return this.min+pos*(this.max-this.min)}_getLabelSize(label){let ticksOpts=this.options.ticks,tickLabelWidth=this.ctx.measureText(label).width,angle=toRadians(this.isHorizontal()?ticksOpts.maxRotation:ticksOpts.minRotation),cosRotation=Math.cos(angle),sinRotation=Math.sin(angle),tickFontSize=this._resolveTickFontOptions(0).size;return{w:tickLabelWidth*cosRotation+tickFontSize*sinRotation,h:tickLabelWidth*sinRotation+tickFontSize*cosRotation}}_getLabelCapacity(exampleTime){let timeOpts=this.options.time,displayFormats=timeOpts.displayFormats,format=displayFormats[timeOpts.unit]||displayFormats.millisecond,exampleLabel=this._tickFormatFunction(exampleTime,0,ticksFromTimestamps(this,[exampleTime],this._majorUnit),format),size=this._getLabelSize(exampleLabel),capacity=Math.floor(this.isHorizontal()?this.width/size.w:this.height/size.h)-1;return capacity>0?capacity:1}getDataTimestamps(){let timestamps=this._cache.data||[],i,ilen;if(timestamps.length)return timestamps;let metas=this.getMatchingVisibleMetas();if(this._normalized&&metas.length)return this._cache.data=metas[0].controller.getAllParsedValues(this);for(i=0,ilen=metas.length;i<ilen;++i)timestamps=timestamps.concat(metas[i].controller.getAllParsedValues(this));return this._cache.data=this.normalize(timestamps)}getLabelTimestamps(){let timestamps=this._cache.labels||[],i,ilen;if(timestamps.length)return timestamps;let labels=this.getLabels();for(i=0,ilen=labels.length;i<ilen;++i)timestamps.push(parse(this,labels[i]));return this._cache.labels=this._normalized?timestamps:this.normalize(timestamps)}normalize(values){return _arrayUnique(values.sort(sorter))}}function interpolate2(table,val,reverse){let lo=0,hi=table.length-1,prevSource,nextSource,prevTarget,nextTarget;if(reverse){if(val>=table[lo].pos&&val<=table[hi].pos)({lo,hi}=_lookupByKey(table,\"pos\",val));({pos:prevSource,time:prevTarget}=table[lo]),{pos:nextSource,time:nextTarget}=table[hi]}else{if(val>=table[lo].time&&val<=table[hi].time)({lo,hi}=_lookupByKey(table,\"time\",val));({time:prevSource,pos:prevTarget}=table[lo]),{time:nextSource,pos:nextTarget}=table[hi]}let span=nextSource-prevSource;return span?prevTarget+(nextTarget-prevTarget)*(val-prevSource)/span:prevTarget}class TimeSeriesScale extends TimeScale{static id=\"timeseries\";static defaults=TimeScale.defaults;constructor(props){super(props);this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){let timestamps=this._getTimestampsForTable(),table=this._table=this.buildLookupTable(timestamps);this._minPos=interpolate2(table,this.min),this._tableRange=interpolate2(table,this.max)-this._minPos,super.initOffsets(timestamps)}buildLookupTable(timestamps){let{min,max}=this,items=[],table=[],i,ilen,prev,curr,next;for(i=0,ilen=timestamps.length;i<ilen;++i)if(curr=timestamps[i],curr>=min&&curr<=max)items.push(curr);if(items.length<2)return[{time:min,pos:0},{time:max,pos:1}];for(i=0,ilen=items.length;i<ilen;++i)if(next=items[i+1],prev=items[i-1],curr=items[i],Math.round((next+prev)/2)!==curr)table.push({time:curr,pos:i/(ilen-1)});return table}_generate(){let min=this.min,max=this.max,timestamps=super.getDataTimestamps();if(!timestamps.includes(min)||!timestamps.length)timestamps.splice(0,0,min);if(!timestamps.includes(max)||timestamps.length===1)timestamps.push(max);return timestamps.sort((a,b)=>a-b)}_getTimestampsForTable(){let timestamps=this._cache.all||[];if(timestamps.length)return timestamps;let data=this.getDataTimestamps(),label=this.getLabelTimestamps();if(data.length&&label.length)timestamps=this.normalize(data.concat(label));else timestamps=data.length?data:label;return timestamps=this._cache.all=timestamps,timestamps}getDecimalForValue(value){return(interpolate2(this._table,value)-this._minPos)/this._tableRange}getValueForPixel(pixel){let offsets=this._offsets,decimal=this.getDecimalForPixel(pixel)/offsets.factor-offsets.end;return interpolate2(this._table,decimal*this._tableRange+this._minPos,!0)}}var scales=Object.freeze({__proto__:null,CategoryScale,LinearScale,LogarithmicScale,RadialLinearScale,TimeScale,TimeSeriesScale}),registerables=[controllers,elements,plugins,scales];Chart.register(...registerables);var auto_default=Chart;var COLOR=/^#[\\da-f]{6}$/i;function text(value,label,maximum=120){if(typeof value!==\"string\"||value.length>maximum)throw Error(`${label} must be text with at most ${maximum} characters.`);return value}function canonicalChartData(value){if(value.mode!==\"counts\"&&value.mode!==\"percentages\")throw Error(\"Chart data mode must be counts or percentages.\");if(!Array.isArray(value.rows)||!value.rows.length||value.rows.length>100)throw Error(\"Chart data needs 1–100 canonical rows.\");let ids=new Set,rows=value.rows.map((item)=>{if(!item||typeof item!==\"object\"||Array.isArray(item))throw Error(\"Each chart row must be an object.\");let row=item,id=text(row.id,\"Chart row ID\");if(!id.trim()||ids.has(id))throw Error(\"Chart row IDs must be non-empty and unique.\");ids.add(id);let label=text(row.label,\"Chart category\");if(typeof row.value!==\"number\"||!Number.isFinite(row.value)||row.value<0)throw Error(\"Chart row values must be finite and non-negative.\");if(value.mode===\"percentages\"&&row.value>100)throw Error(\"Each direct percentage must be between 0 and 100.\");if(row.color!==void 0&&(typeof row.color!==\"string\"||!COLOR.test(row.color)))throw Error(\"Chart row colors must be #RRGGBB.\");return{id,label,value:row.value,...row.color===void 0?{}:{color:row.color}}}),total=rows.reduce((sum,row)=>sum+row.value,0);if(!Number.isFinite(total)||total<=0)throw Error(\"Chart rows need a finite positive total.\");if(value.mode===\"percentages\"&&Math.abs(total-100)>0.000001){let difference=Number(Math.abs(total-100).toFixed(6));throw Error(`Percentage total is ${Number(total.toFixed(6))}%; ${total<100?\"missing\":\"excess\"} ${difference}%. Expected 100%.`)}let seriesLabel=value.seriesLabel===void 0?\"Share\":text(value.seriesLabel,\"Chart series label\"),color2=value.color??\"#2676EF\";if(typeof color2!==\"string\"||!COLOR.test(color2))throw Error(\"Chart color must be #RRGGBB.\");return{mode:value.mode,rows,seriesLabel,color:color2,labels:rows.map((row)=>row.label),datasets:[{label:seriesLabel,data:rows.map((row)=>value.mode===\"counts\"?row.value/total*100:row.value),backgroundColor:rows.map((row)=>row.color??color2),borderColor:color2}]}}function parseChartData(input){let raw=typeof input===\"string\"?JSON.parse(input):input;if(!raw||typeof raw!==\"object\"||Array.isArray(raw))throw Error(\"Chart data must be an object.\");let value=raw;if(value.mode!==void 0||value.rows!==void 0)return canonicalChartData(value);if(!Array.isArray(value.labels)||value.labels.length<1||value.labels.length>100||!value.labels.every((label)=>typeof label===\"string\"&&label.length<=120))throw Error(\"Chart labels must contain 1–100 short text entries.\");if(!Array.isArray(value.datasets)||value.datasets.length<1||value.datasets.length>12)throw Error(\"A chart needs 1–12 datasets.\");let labels=value.labels,datasets=value.datasets.map((item)=>{if(!item||typeof item!==\"object\"||Array.isArray(item))throw Error(\"Each chart dataset must be an object.\");let dataset=item;if(typeof dataset.label!==\"string\"||dataset.label.length>120)throw Error(\"Each chart dataset needs a short label.\");if(!Array.isArray(dataset.data)||dataset.data.length!==labels.length||!dataset.data.every((point)=>typeof point===\"number\"&&Number.isFinite(point)))throw Error(\"Each dataset needs one finite number per label.\");let colors2=dataset.backgroundColor;if(!(typeof colors2===\"string\"&&COLOR.test(colors2))&&!(Array.isArray(colors2)&&colors2.length===labels.length&&colors2.every((color2)=>typeof color2===\"string\"&&COLOR.test(color2))))throw Error(\"Background colors must be #RRGGBB hex values.\");if(typeof dataset.borderColor!==\"string\"||!COLOR.test(dataset.borderColor))throw Error(\"Each dataset needs a #RRGGBB border color.\");return{label:dataset.label,data:[...dataset.data],backgroundColor:Array.isArray(colors2)?[...colors2]:colors2,borderColor:dataset.borderColor}});return{labels,datasets}}function chartPresentationErrors(input){if(input===void 0)return[];if(!input||typeof input!==\"object\"||Array.isArray(input))return[\"Chart presentation must be an object.\"];let value=input,errors=[],number=(item,label,minimum,maximum,integer=!1)=>{if(item!==void 0&&(typeof item!==\"number\"||!Number.isFinite(item)||item<minimum||item>maximum||integer&&!Number.isInteger(item)))errors.push(`Chart ${label} must be ${integer?\"an integer\":\"a finite number\"} from ${minimum} to ${maximum}.`)};if(value.fontFamily!==void 0&&(typeof value.fontFamily!==\"string\"||!value.fontFamily.trim()||value.fontFamily.length>200))errors.push(\"Chart fontFamily must be non-empty text with at most 200 characters.\");number(value.fontWeight,\"fontWeight\",100,900,!0),number(value.maxBarThickness,\"maxBarThickness\",1,500);for(let name of[\"valueAxis\",\"valueLabels\",\"gradient\"]){let item=value[name];if(item!==void 0&&(!item||typeof item!==\"object\"||Array.isArray(item)))errors.push(`Chart ${name} must be an object.`)}let axis=value.valueAxis;if(axis&&typeof axis===\"object\"){if(number(axis.min,\"axis minimum\",-1000000000000,1000000000000),number(axis.max,\"axis maximum\",-1000000000000,1000000000000),number(axis.step,\"axis step\",Number.MIN_VALUE,1000000000000),number(axis.decimals,\"axis decimals\",0,6,!0),axis.min!==void 0&&axis.max!==void 0&&axis.min>=axis.max)errors.push(\"Chart axis maximum must be greater than its minimum.\");if(axis.format!==void 0&&![\"number\",\"percent\"].includes(axis.format))errors.push(\"Chart axis format must be number or percent.\")}let labels=value.valueLabels;if(labels&&typeof labels===\"object\"){if(typeof labels.show!==\"boolean\")errors.push(\"Chart value-label show must be a boolean.\");if(number(labels.decimals,\"value-label decimals\",0,6,!0),labels.suffix!==void 0&&(typeof labels.suffix!==\"string\"||labels.suffix.length>12))errors.push(\"Chart value-label suffix must be text with at most 12 characters.\")}let gradient=value.gradient;if(gradient&&typeof gradient===\"object\"&&(!COLOR.test(gradient.from)||!COLOR.test(gradient.to)))errors.push(\"Chart gradient endpoints must be #RRGGBB.\");return errors}var EFFECT_CATALOG={blur:{label:\"Blur\",params:{radius:{label:\"Radius\",default:8,min:0,max:256,step:0.5}}},\"backdrop-blur\":{label:\"Backdrop blur\",params:{radius:{label:\"Radius\",default:12,min:0,max:128,step:0.5}}},\"drop-shadow\":{label:\"Drop shadow\",params:{offsetX:{label:\"Offset X\",default:8,min:-2048,max:2048},offsetY:{label:\"Offset Y\",default:8,min:-2048,max:2048},radius:{label:\"Softness\",default:12,min:0,max:256,step:0.5},color:{label:\"Color\",default:\"#000000\"},opacity:{label:\"Opacity\",default:0.65,min:0,max:1,step:0.01}}},glow:{label:\"Glow\",params:{radius:{label:\"Radius\",default:12,min:0,max:256,step:0.5},color:{label:\"Color\",default:\"#a8d8ff\"},opacity:{label:\"Intensity\",default:0.5,min:0,max:1,step:0.01}}},brightness:{label:\"Brightness\",params:{amount:{label:\"Amount\",default:1,min:0,max:4,step:0.05}}},contrast:{label:\"Contrast\",params:{amount:{label:\"Amount\",default:1,min:0,max:4,step:0.05}}},saturate:{label:\"Saturation\",params:{amount:{label:\"Amount\",default:1,min:0,max:4,step:0.05}}},\"hue-rotate\":{label:\"Hue rotation\",params:{angle:{label:\"Angle\",default:0,min:-3600,max:3600,step:1}}},shader:{label:\"Shader\",params:{}}},EFFECT_TYPES=Object.keys(EFFECT_CATALOG);var dimension=(label,value=0,min=0)=>({label,default:value,min,max:32768,step:1}),count=(label,value,min,max)=>({label,default:value,min,max,step:1}),signed=(label,value=0,limit=32768)=>({label,default:value,min:-limit,max:limit,step:1}),anchor=(label)=>({label,default:0,min:0,max:1,step:0.01}),MODIFIER_CATALOG={\"max-text-width\":{label:\"Max Text Width\",params:{maxWidth:dimension(\"Maximum Width\",600,1),minFontSize:dimension(\"Minimum Font Size\",1,1)}},\"auto-size\":{label:\"Auto Size\",params:{paddingTop:dimension(\"Padding Top\"),paddingRight:dimension(\"Padding Right\"),paddingBottom:dimension(\"Padding Bottom\"),paddingLeft:dimension(\"Padding Left\"),minWidth:dimension(\"Minimum Width\"),maxWidth:dimension(\"Maximum Width\"),minHeight:dimension(\"Minimum Height\"),maxHeight:dimension(\"Maximum Height\"),anchorX:anchor(\"Anchor X\"),anchorY:anchor(\"Anchor Y\")}},\"auto-follow\":{label:\"Auto Follow\",params:{sourceAnchorX:anchor(\"Source Anchor X\"),sourceAnchorY:anchor(\"Source Anchor Y\"),targetAnchorX:anchor(\"Target Anchor X\"),targetAnchorY:anchor(\"Target Anchor Y\"),offsetX:{...dimension(\"Offset X\"),min:-32768},offsetY:{...dimension(\"Offset Y\"),min:-32768}}},\"hide-empty\":{label:\"Hide on Empty\",params:{}},\"grid-arrange\":{label:\"Grid Arrange\",params:{columns:count(\"Columns\",3,1,256),rows:count(\"Rows\",0,0,256),spreadX:dimension(\"Spread X\",200),spreadY:dimension(\"Spread Y\",100)}},\"radial-arrange\":{label:\"Radial Arrange\",params:{count:count(\"Count\",0,0,1024),rings:count(\"Rings\",1,1,64),innerRadius:dimension(\"Inner Radius\",200),outerRadius:dimension(\"Outer Radius\",400),startAngle:signed(\"Start Angle\",0,720),endAngle:signed(\"End Angle\",360,720),baseRotation:signed(\"Base Rotation\",0,360)}},justify:{label:\"Justify\",params:{offsetX:signed(\"Offset X\"),offsetY:signed(\"Offset Y\")}},\"look-at\":{label:\"Look At\",params:{rotationOffset:signed(\"Rotation Offset\",0,360)}}};var TRANSFORM_ANIMATION_PROPERTIES=[\"x\",\"y\",\"width\",\"height\",\"rotation\",\"opacity\",\"transformOriginX\",\"transformOriginY\"],EFFECT_ANIMATION_PROPERTIES=[\"blur\",\"dropShadowOpacity\",\"dropShadowOffsetX\",\"dropShadowOffsetY\",\"dropShadowBlur\"],REVEAL_ANIMATION_PROPERTIES=[\"scale\",\"clipLeft\",\"clipRight\",\"clipTop\",\"clipBottom\"];var ANIMATABLE_LAYER_PROPERTIES=[...TRANSFORM_ANIMATION_PROPERTIES,\"strokeWidth\",...EFFECT_ANIMATION_PROPERTIES,\"motionPathProgress\",...REVEAL_ANIMATION_PROPERTIES];var HEADER=`#pragma ograf ink color\nvec4 ink = vec4(0.05, 0.09, 0.15, 1.0);\n#pragma ograf accent color\nvec4 accent = vec4(0.15, 0.65, 0.85, 1.0);\n#pragma ograf strength slider min(0) max(0.5) step(0.01)\nfloat strength = 0.18;\n#pragma ograf speed slider min(0) max(2) step(0.05)\nfloat speed = 1.0;\n\nvoid mainImage(out vec4 color, in vec2 pixel) {\n  vec2 uv = pixel / iResolution.xy;\n  vec2 p = vec2(uv.x * iResolution.x / iResolution.y, uv.y);\n  float aa = 1.5 / max(1.0, iResolution.y);\n  float t = iTime * speed;\n`,FOOTER=`\n  // Keep the text area calm and preserve the original panel's subtle alpha falloff.\n  float edge = 0.40 + 0.60 * pow(abs(uv.y - 0.5) * 2.0, 2.0);\n  vec3 surface = ink.rgb * mix(1.06, 0.90, uv.x);\n  float reflectionDistance = abs(uv.x + uv.y * 0.18 - mix(-0.35, 1.35, fract(t / 7.0)));\n  float reflection = pow(max(0.0, 1.0 - reflectionDistance / 0.24), 3.0);\n  surface = mix(surface, vec3(1.0), reflection * strength * 0.32 * edge);\n  float light = clamp(motif * strength * accent.a * edge, 0.0, 0.35);\n  color = vec4(mix(surface, accent.rgb, light), ink.a * mix(0.97, 0.78, uv.x));\n}`,BACKGROUNDS={news:{name:\"News / Signal grid\",source:HEADER+`  vec2 cell = abs(fract(p / 0.34 + 0.5) - 0.5) * 0.34;\n  float grid = 1.0 - smoothstep(aa, aa * 2.0, min(cell.x, cell.y));\n  float signal = pow(0.5 + 0.5 * sin(p.x * 1.2 - t * 0.32), 8.0);\n  float horizon = exp(-abs(uv.y - 0.22) * 14.0);\n  float motif = grid * (0.25 + signal * 0.45) + horizon * signal * 0.45;`+FOOTER},sports:{name:\"Sports / Velocity diagonals\",source:HEADER+`  float diagonal = p.x * 0.68 + p.y;\n  float lane = abs(fract(diagonal / 0.38 + 0.5) - 0.5) * 0.38;\n  float stripes = 1.0 - smoothstep(0.025, 0.025 + aa, lane);\n  float energy = 0.5 + 0.5 * sin(diagonal * 2.1 - t * 0.58);\n  float motif = stripes * (0.25 + energy * 0.55) + energy * 0.12;`+FOOTER},entertainment:{name:\"Entertainment / Studio ribbons\",source:HEADER+`  float wave = sin(p.x * 0.9 - t * 0.18) * 0.18;\n  float ribbonDistance = (uv.y - 0.35 - wave) * 9.0;\n  float secondDistance = (uv.y - 0.72 + wave * 0.7) * 12.0;\n  float ribbon = exp(-ribbonDistance * ribbonDistance);\n  float second = exp(-secondDistance * secondDistance);\n  vec2 lightPosition = vec2(0.68 + 0.12 * sin(t * 0.13), 0.18);\n  float bloom = exp(-dot(uv - lightPosition, uv - lightPosition) * 8.0);\n  float motif = ribbon * 0.60 + second * 0.38 + bloom * 0.24;`+FOOTER},documentary:{name:\"Documentary / Contour atlas\",source:HEADER+`  float terrain = p.y + sin(p.x * 0.8 + t * 0.035) * 0.17\n    + sin(p.x * 1.9 - t * 0.025) * 0.045;\n  float contours = abs(fract(terrain * 7.0 + 0.5) - 0.5) / 7.0;\n  float lines = 1.0 - smoothstep(aa * 0.65, aa * 1.5, contours);\n  float motif = lines * 0.42 + (0.5 + 0.5 * sin(p.x * 0.45)) * 0.10;`+FOOTER}};var ImportType=function(A){return A[A.Static=1]=\"Static\",A[A.Dynamic=2]=\"Dynamic\",A[A.ImportMeta=3]=\"ImportMeta\",A[A.StaticSourcePhase=4]=\"StaticSourcePhase\",A[A.DynamicSourcePhase=5]=\"DynamicSourcePhase\",A[A.StaticDeferPhase=6]=\"StaticDeferPhase\",A[A.DynamicDeferPhase=7]=\"DynamicDeferPhase\",A}({}),A=new Uint8Array(new Uint16Array([1]).buffer)[0]===1;var E,C=()=>{return A2=\"AGFzbQEAAAABKwhgAAF/YAF/AX9gAABgAn9/AX9gBH9/f38AYAN/f38Bf2ABfwBgA39/fwADPj0CAgEEBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgABBQICAgYBAQYBAQEFAQEBAQECAgIBAQEDAQEHAQMDBAUBcAECAgUHAQGCAoCAAgYPAn8BQaCLBAt/AEGgiwQLB80BHgZtZW1vcnkCAAJzYQACAWUABQJpcwAGAmllAAcCc3MACAJzZQAJAml0AAoCYWkACwJpZAAMAmlwAA0CZXMADgJlZQAPA2VscwAQA2VsZQARA2VzcwASAnJpABMCcmUAFAFmABUCbXMAFgJyYQAXA2FrcwAYA2FrZQAZA2F2cwAaA2F2ZQAbA3JzYQAcBXBhcnNlAB0LX19oZWFwX2Jhc2UDAQtfaW5pdGlhbGl6ZQABGV9faW5kaXJlY3RfZnVuY3Rpb25fdGFibGUBAAkHAQBBAQsBAAwBAQrcVD0oAEHYCkGAwAA2AgBB0ApBoIsENgIAQbgKQSo2AgBB1ApBgIAENgIACwQAEAALWQBB6AkgADYCACAAQQF0IgBBADsBoIsEQewJIABBoosEajYCAEHECUEANgIAQdQJQQA2AgBBzAlBADYCAEHICUEANgIAQdwJQQA2AgBB0AlBADYCAEGgiwQLuAEBAn9B7AlB7AkoAgAiBEEoajYCAAJAQdQJKAIAIgVFBEBBxAkgBDYCAAwBCyAFIAQ2AiQLQdQJIAQ2AgBB2AkgBTYCACAEIAA2AgggBEIANwIgIAQgA0EBRiIAOgAYIAQgAzYCFCAEQQA2AhAgBCACNgIEIAQgATYCACAEQQNBAUECIAAbIANBAkYiARs2AhwgBCACIAJBAmpBACAAGyABGzYCDCADQQFrQQFNBEBB8AlBAToAAAsLdwECf0HsCUHsCSgCACIEQRhqNgIAAkBB3AkoAgAiBUUEQEHICSAENgIADAELIAUgBDYCFAtB3AkgBDYCACAEIAM2AgwgBCACNgIIIAQgATYCBCAEIAA2AgBB4AkoAgAhACAEQQA2AhQgBCAANgIQQfAJQQE6AAALCABB9AkoAgALEwBBzAkoAgAoAgBBoIsEa0EBdQscAQF/QcwJKAIAKAIEIgBBoIsEa0EBdUF/IAAbCxMAQcwJKAIAKAIIQaCLBGtBAXULHAEBf0HMCSgCACgCDCIAQaCLBGtBAXVBfyAAGwsLAEHMCSgCACgCHAscAQF/QcwJKAIAKAIQIgBBoIsEa0EBdUF/IAAbCzUBAn9BfyEAAkACQAJAQcwJKAIAKAIUIgFBAWsOAgIBAAsgAUGgiwRrQQF1DwtBfiEACyAACwsAQcwJKAIALQAYCxMAQdAJKAIAKAIAQaCLBGtBAXULEwBB0AkoAgAoAgRBoIsEa0EBdQscAQF/QdAJKAIAKAIIIgBBoIsEa0EBdUF/IAAbCxwBAX9B0AkoAgAoAgwiAEGgiwRrQQF1QX8gABsLEwBB0AkoAgAoAhBBoIsEa0EBdQslAQF/QcwJQcwJKAIAIgBBJGpBxAkgABsoAgAiADYCACAAQQBHCyUBAX9B0AlB0AkoAgAiAEEUakHICSAAGygCACIANgIAIABBAEcLCABB+AktAAALCABB8AktAAALKwEBf0H8CUH8CSgCACIAQRBqQcwJKAIAQSBqIAAbKAIAIgA2AgAgAEEARwsTAEH8CSgCACgCAEGgiwRrQQF1CxMAQfwJKAIAKAIEQaCLBGtBAXULEwBB/AkoAgAoAghBoIsEa0EBdQsTAEH8CSgCACgCDEGgiwRrQQF1CwoAQfwJQQA2AgALow4BBn8jAEGA0ABrIgQkAEH4CUEBOgAAQYAIIQBBhApBgAg2AgBBnApBnosEIgFB6AkoAgBBAXRqIgU2AgBB8AlBADoAAEGACkEAOwEAQYIKQQA7AQBBiApBADoAAEH0CUEANgIAQeQJQQA6AABBjAogBEGAEGo2AgBBkAogBDYCAEGUCkEAOgAAA0AgACECQZgKIAFBAmoiADYCAAJAAkACfwJAAkAgASAFSQRAIAAvAQAiA0EJa0EFSQ0EAkACQAJAAkACQCADQeUAaw4FAQYGBgIACyADQSBGDQggA0EvRg0DIANBO0YNAgwFC0GCCi8BAA0BIAAQHkUNASABQQRqQYIIQQoQHw0BECBBmAooAgAhAEH4CS0AAA0BQYQKIAA2AgAgACICIQEMBQsgAS8BBEHtAEcNACAAEB5FDQAgASkABkLwgLyDoI6AOlINABAhQZgKKAIAIQALQYQKIAA2AgAMBgsgAS8BBCIAQSpHBEAgAEEvRw0CECIMBQtBARAjDAQLIAAhAUEAQeQJLQAADQIaDAELQfgJQQA6AAALA0ACQEGYCiABQQJqIgA2AgACQAJAAkAgASAFSQRAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAAvAQAiA0Egaw4QDw4IDg4ODggBBQ4OBA4OCQALAkACQAJAAkAgA0HbAGsODwURBhERDRERAxEBERERAgALIANBCWtBBUkNESADQfsAaw4DCBAJEAtBggovAQANDyAAEB5FDQ8gAUEEakGCCEEKEB8NDxAgDA8LIAEvAQRB7QBHDQ4gABAeRQ0OIAEpAAZC8IC8g6COgDpSDQ4QIQwOCyABLwEEQewARw0NIAAQHkUNDSABQQZqQbIIQQYQHw0NIAEvAQwQJEUNDUGUCkEBOgAADA0LQYIKQYIKLwEAIgBBAWo7AQAgBEGAEGogAEEDdGoiAEEBNgIAIAAgAjYCBAwMC0GCCkGCCi8BACIAQQFqOwEAIARBgBBqIABBA3RqIgBBCDYCACAAIAI2AgQMCwtBggovAQAiAEUNDEGCCiAAQQFrOwEADAoLQYAKLwEAIgBFDQlBggovAQAiA0UNCSADQQN0IARqQfgPaigCAEEFRw0JIAQgAEECdGpBBGsoAgAiACgCBA0JIAAgAkECajYCBEGYCiABQQRqNgIAQQEQJRogAEGYCigCACIANgIQQZgKIABBAms2AgAMCQtBggovAQAiAEUNCkGCCiAAQQFrIgM7AQBBgAovAQAiAEUNCCAEQYAQaiADQf//A3FBA3RqKAIAQQVHDQggBCAAQQJ0akEEaygCACIDKAIERQRAIAMgAkECajYCBAsgAyABQQRqNgIMQYAKIABBAWs7AQAMCAsCQCACLwEAQSlHDQBB1AkoAgAiAEUNACAAKAIMIAJBAmpHDQBB1AlB2AkoAgAiADYCACAABEAgAEEANgIkDAELQcQJQQA2AgALQYIKQYIKLwEAIgBBAWo7AQAgBEGAEGogAEEDdGoiAEEGQQJBlAotAAAbNgIAIAAgAjYCBEGUCkEAOgAADAcLQYIKLwEAIgBFDQhBggogAEEBayIAOwEAIARBgBBqIABB//8DcUEDdGooAgBBBEYNAwwGCyADECYMBQsCQCABLwEEIgBBKkcEQCAAQS9HDQEQIgwHC0EBECMMBgsCQCACLwEAIgEQJwRAAkACQAJAIAFBK2sOBAEIAgAICyACQQJrLwEAQTBrQf//A3FBCkkNAwwHCyACQQJrLwEAQStGDQIMBgsgAkECay8BAEEtRg0BDAULIAFBKUcNACAEQYAQakGCCi8BAEEDdGooAgQQKA0ECwJAAkBBggovAQAiAEUgAUHmAEdyDQAgBEGAEGogAEEDdGoiA0EIaygCAEEBRw0AIAJBAmsvAQBB7wBHDQEgAkEEaxApRQ0BIANBBGsoAgBBnglBAxAqRQ0BDAULIAFB/QBHDQAgBEGAEGogAEEDdGoiACgCBBArDQQgACgCAEEGRg0ECyACECwNA0GICi0AACABQS9GcSABQQBHc0UNAwJAQdwJKAIAIgBFDQAgAiAAKAIASQ0AIAIgACgCBE0NBAsDQCACQaCLBEsEQEGECiACQQJrIgI2AgAgAi8BACIBEC1FDQELCyABQf//A3EQLgRAA0AgAkGgiwRLBEBBhAogAkECayICNgIAIAIvAQAQLg0BCwsgAhAvDQQLQYgKQQE6AAAMBAtBggpBggovAQAiAEEBajsBACAEQYAQaiAAQQN0aiIAIAI2AgQgAEEDNgIACxAwDAILQYAKLwEARUGCCi8BAEVB5AktAABBf3NxcQwFCxAxQYgKQQA6AAALQYQKQZgKKAIAIgI2AgALQZgKKAIAIQEMAQsLEDJBAAshAyAEQYDQAGokACADDwsgAiEAC0GYCigCACEBDAALAAsWACAAQaCLBEYEQEEBDwsgAEECaxAzC0MBA38CQCACRQ0AA0AgAC0AACIEIAEtAAAiBUYEQCABQQFqIQEgAEEBaiEAIAJBAWsiAg0BDAILCyAEIAVrIQMLIAML0ggBBX9BmApBmAooAgAiBEEMaiIBNgIAQdwJKAIAIQNBARAlIQICQAJAAkACQAJAAkAgAUGYCigCACIARgRAIAIQNEUNAQtB4AkgBDYCAAJAAkACQCACQSpHBEAgAkH7AEcNAUGYCiAAQQJqNgIAQQEQJSECQZwKKAIAIQFBmAooAgAhAANAAkAgAkH//wNxIgJBIkYgAkEnRnJFBEAgAhA1GkGYCigCACECDAELIAIQJkGYCkGYCigCAEECaiICNgIAC0EBECUaIAAgAhA2IgJBLEYEQEGYCkGYCigCAEECajYCAEEBECUhAgsgAkH9AEYNAyAAQZgKKAIAIgBGDQggACABTQ0ACwwHC0GYCiAAQQJqNgIAQQEQJRpBmAooAgAiACAAEDYaDAILQfgJQQA6AAACQAJAAkACQAJAAkAgAkHhAGsODAIIBAEIAwgICAgIBQALIAJB9gBGDQQMBwtBmAogAEEOaiIENgIAAkACQAJAAkBBARAlQeEAaw4GAAwCDAwBDAtBmAooAgAiASkAAkLzgOSD4I3AMVINCyABLwEKEC5FDQtBmAogAUEKajYCAEEAECUaC0GYCigCACIDQQJqQaIIQQ4QHw0KAkAgAy8BECIBECQNACABQShrDgMACwALC0GYCiADQRBqNgIAQQEQJSIBQSpGBEBBmApBmAooAgBBAmo2AgBBARAlIQELIAFBKEcNAQwKC0GYCigCACIDKQACQuyAhIOwjsA5Ug0JIAMvAQoiARAkRSABQfsAR3ENCUGYCiADQQpqNgIAQQEQJSIBQfsARg0JC0GYCigCACEDIAEQNRpBmAooAgAiASADTQ0IIAAgBCADIAEQBAwKC0GYCiAAQQpqNgIAQQAQJRpBmAooAgAhAAtBmAogAEEQajYCAEEBECUiAEEqRgRAQZgKQZgKKAIAQQJqNgIAQQEQJSEACwwJCwJAIAApAAJC7ICEg7COwDlSDQAgAC8BChAtRQ0AQZgKIABBCmo2AgBBARAlIQAMCQsgAEEEaiEAC0GYCiAAQQZqNgIAQZwKKAIAIQMDQEEBECUhAEGYCigCACIBIANLDQcgABA3IQJBmAooAgAiACABRg0EIAJBPUYEQEEBEDghAkGYCigCACEACyACQSxHDQRBmAogAEECajYCAAwACwALQfAJQQE6AABBmApBmAooAgBBAmo2AgALQQEQJSEAQZgKKAIAIQECQCAAQeYARw0AIAFBAmpBnAhBBhAfDQBBmAogAUEIajYCACAEQQEQJUEAEDkgA0EUakHICSADGyECA0AgAigCACIARQ0CIABCADcCCCAAQRRqIQIMAAsAC0GYCiABQQJrNgIACw8LIAAhAQwCCyAAIARBAEEAEARBmAogAEEMajYCAA8LEDIPC0GYCiABQQJrNgIADwtBmAooAgAhASAAEDUaIAFBmAooAgAiACABIAAQBEGYCiAAQQJrNgIAC4oLAQp/QZgKQZgKKAIAIgZBDGoiCTYCAEEBECUhAEGYCigCACECAkACQAJAAkACQAJAAn8gAEEuRgRAQZgKIAJBAmo2AgBBARAlIgBB5ABHBEAgAEHzAEcEQCAAQe0ARw0HQZgKKAIAIgBBAmpBjAhBBhAfDQdBhAooAgAiARA6RQRAIAEvAQBBLkYNCAsgBiAGIABBCGpBAhADDwtBmAooAgAiAEECakGSCEEKEB8NBkGECigCACIBEDpFBEAgAS8BAEEuRg0HC0GYCiAAQQxqNgIAQQEhCEEFIQRBARAlIQBBAQwCC0GYCigCACIAKQACQuWAmIPQjIA5Ug0FQYQKKAIAIgEQOkUEQCABLwEAQS5GDQYLQZgKIABBCmo2AgBBByEEQQEhBUEBECUhAEEBIQhBAgwBCwJAAkAgAEHzAEcgAiAJTXJFBEBB8wAhACACQQJqQZIIQQoQHw0BIAIvAQwQJEUNAUGYCiACQQxqIgA2AgBBASEIQQEQJSEBIABBmAooAgAiBEcEQEHmACEAIAFB5gBHBEBBBSEEIAEhAEEBDAULQQEhAyAEQQJqQZwIQQYQHw0FIAQvAQgQLUUNBQtBmAogAjYCAEEHIQRBASEHQQAhCCABIQBBAAwDC0EHIQRBASEHIABB5ABHIAIgBkEKak1yDQFB5AAhACACKQACQuWAmIPQjIA5Ug0AIAIvAQoQJEUNAEGYCiACQQpqNgIAQSohAEEBIQVBAiEDQQEQJSIBQSpGDQRBmAogAjYCAEEAIQUgASEAQQAMAgsgAiEEDAILQQALIQMgAEEoRgRAQYwKKAIAQYIKLwEAIgVBA3RqIgBBBTYCAEGCCiAFQQFqOwEAIABBmAooAgAiAjYCBEGECigCAC8BAEEuRg0EQZgKIAJBAmo2AgBBARAlIQAgBkGYCigCACIBQQAgAhADQdQJKAIAIQMgCARAIAMgBDYCHAtBgApBgAovAQAiBEEBajsBAEGQCigCACAEQQJ0aiADNgIAAkAgAEEiRiAAQSdGckUEQAJAIABB4ABHDQBBnAooAgAhBiABIQADQCAAIgIgBk8NAQJAAkAgAEECaiIALwEAIgdB3ABrDgUAAgICBQELIAJBBGohAAwBCyAHQSRHDQAgAi8BBEH7AEcNAAsLQZgKIAFBAms2AgAPCyAAECZBmAooAgAhAAtBmAogAEECaiIANgIAAkACQAJAQQEQJUEpaw4EAQICAAILQZgKQZgKKAIAQQJqNgIAQQEQJRogAyAANgIEQZgKKAIAIQAgA0EBOgAYIAMgADYCEAwIC0GCCiAFOwEAIAMgADYCBEGYCigCACEAIANBAToAGCADIABBAmo2AgxBgAogBDsBAA8LQZgKQZgKKAIAQQJrNgIADwsgB0UgAEH7AEdyRQRAQZgKKAIAIQBBggovAQANBkGcCigCACEBA0ACQAJAIAAgAUkEQEEBECUiAEEiRiAAQSdGcg0BIABB/QBHDQJBmApBmAooAgBBAmo2AgALQQEQJSEBQZgKKAIAIQAgAUHmAEYEQCAAQQJqQZwIQQYQHw0HC0GYCiAAQQhqNgIAQQEQJSIAQSJHIABBJ0dxDQYgBiAAQQAQOQ8LIAAQJgtBmApBmAooAgBBAmoiADYCAAwACwALAkACQCAAQSdrDgQDAQEDAAsgAEEiRg0CC0GYCigCACEECyAEIAlHDQBBmAogBEECazYCAA8LIABBKkcgBXENAkGCCi8BAA0CQZgKKAIAIQBBnAooAgAhAgNAIAAgAk8NASAALwEAIgFBJ0cgAUEiR3EEQEGYCiAAQQJqIgA2AgAMAQUgBiABIAMQOQ8LAAsACxAyCw8LQZgKQZgKKAIAQQJrNgIADwtBmAogAEECazYCAAtDAQN/QZgKKAIAIQBBnAooAgAhAgNAAkAgAEECaiEBIAAgAk8NACABIQAgAS8BAEEKaw4EAAEBAAELC0GYCiABNgIAC3ABBH9BmAooAgBBAmohAUGcCigCACEEAkADQCABIgJBAmohASACIARPDQEgAS8BACEDAkAgAEUEQCADQSpGDQEgA0EKaw4EAwICAwILIANBKkcNAQsgAi8BBEEvRw0ACyACQQRqIQELQZgKIAE2AgALCwAgAEGfgIAEEDwLfQEEf0GcCigCACEDQZgKKAIAIQEDQAJAAkACQCABLwEAIgJBL0YEQCABLwECIgFBKkcEQCABQS9GDQJBLw8LIAAQIwwCCyAABEAgAhAkDQIMAwsgAhAuDQEMAgsQIgtBmApBmAooAgAiBEECaiIBNgIAIAMgBEsNAQsLIAILhgEBBH9BmAooAgAhAUGcCigCACEEAkADQAJAIAEiAkECaiEBIAIgBE8NACABLwEAIgMgAEYNAiADQdwARwRAIANBCmsOBAECAgECCyACQQRqIQEgAi8BBEENRw0BIAJBBmogASACLwEGQQpGGyEBDAELC0GYCiABNgIAEDIPC0GYCiABNgIAC24BAX8CQCAAQSlHIABBKGtB//8DcUEHSXEgAEEhayIBQQVNQQBBASABdEExcRtyRQRAIABBOmsiAUH//wNxQSVPQr+AgICgAiABrYinQQFxRXINAQtBAQ8LIABB/QBHIABB+wBrQf//A3FBBElxCy4BAX9BASEBAkAgAEGUCUEFECoNACAAQZ4JQQMQKg0AIABBpAlBAhAqIQELIAELbwEBfwJ/IAAvAQAiARAkIAFBKUZyIAFB/QBGckUEQEEAIAFB3QBHDQEaCwNAAkAgAEGgiwRNDQAgARAkRQ0AIABBAmsiAC8BACEBDAELC0EBIAFBKUYgAUHdAEZyIAFB/QBGcg0AGiABEDRBAXMLCz4BAn8CQCAAIAJBAXQiAmsiBEECaiIAQaCLBEkNACAAIAEgAhAfDQAgAEGgiwRGBEBBAQ8LIAQQMyEDCyADC4MBAQJ/QQEhAgJAAkACQAJAAkACQCAALwEAIgFBO2sOBAUEBAEACwJAIAFB5QBrDgQDBAQCAAsgAUEpRg0EIAFB+QBHDQMgAEECa0GwCUEGECoPCyAAQQJrLwEAQT1GDwsgAEECa0GoCUEEECoPCyAAQQJrQbwJQQMQKg8LQQAhAgsgAguqAwECfwJAAkACQAJAAkACQAJAAkACQAJAIAAvAQBB5ABrDhQAAQIJCQkJAwkJBAUJCQYJBwkJCAkLAkACQCAAQQJrLwEAQekAaw4EAAoKAQoLIABBBGtBuAhBAhAqDwsgAEEEa0G8CEEDECoPCwJAAkACQCAAQQJrLwEAQfMAaw4DAAECCgsgAEEEay8BACIBQeEARwRAIAFB7ABHDQogAEEGa0HlABA7DwsgAEEGa0HjABA7DwsgAEEEa0HCCEEEECoPCyAAQQRrQcoIQQYQKg8LIABBAmsvAQBB7wBHDQYgAEEEay8BAEHlAEcNBiAAQQZrLwEAIgFB8ABHBEAgAUHjAEcNByAAQQhrQdYIQQYQKg8LIABBCGtB4ghBAhAqDwsgAEECa0HmCEEEECoPC0EBIQIgAEECayIAQekAEDsNBCAAQe4IQQUQKg8LIABBAmtB5AAQOw8LIABBAmtB+AhBBxAqDwsgAEECa0GGCUEEECoPCyAAQQJrLwEAIgFB7wBHBEAgAUHlAEcNASAAQQRrQe4AEDsPCyAAQQRrQY4JQQMQKiECCyACCzQBAX8gAEGgAUYgAEEJayIBQRdNQQBBASABdEGfgIAEcRtyRQRAIAAQNCAAQS5HcQ8LQQELCwAgAEGNgIAEEDwLSAECfwJAIAAvAQAiAkHlAEcEQCACQesARw0BIABBAmtB5ghBBBAqDwsgAEECay8BAEH1AEcNACAAQQRrQcoIQQYQKiEBCyABC94BAQR/QZgKKAIAIQBBnAooAgAhAwJAAkADQAJAIAAiAUECaiEAIAEgA08NAAJAAkACQCAALwEAIgJB3ABrDgUCBAQEAQALIAJBJEcNAyABLwEEQfsARw0DQZgKIAFBBGoiAjYCAEGMCigCAEGCCi8BACIAQQN0aiIBQQQ2AgBBggogAEEBajsBACABIAI2AgQPC0GYCiAANgIAQYIKQYIKLwEAQQFrIgE7AQBBjAooAgAgAUH//wNxQQN0aigCAEEDRw0DDAQLIAFBBGohAAwBCwtBmAogADYCAAsQMgsL2wEBBH9BmAooAgAhAEGcCigCACEDA0AgAEECaiEBAkACQCAAIANPDQACQAJAAkAgAS8BACICQdsAaw4CAQIACyABIQAgAkEKaw4EAgQEAgMLAkADQAJAIAFBAmohACABIANPDQACQAJAIAAvAQAiAkHcAGsOAgAEAQsgAUEEaiEBDAILIAAhASACQQprDgQAAQEAAQsLQZgKIAA2AgAQMkGYCigCACEADAQLQZgKIAA2AgAMAwsgAEEEaiEADAILQZgKIAE2AgAQMg8LIAJBL0cNAAtBmAogADYCAAszAQF/QeQJQQE6AABBmAooAgAhAEGYCkGcCigCAEECajYCAEH0CSAAQaCLBGtBAXU2AgALPQEBfwJ/QQEgAC8BACIBQQlrQf//A3FBBUkgAUGAAXJBoAFGcg0AGkEAIAEQNEUNABogABA6IAFBLkdyCwteAQF/AkAgAEH4/wNxQShGIABBIWsiAUEFTUEAQQEgAXRBMXEbckUEQCAAQTprIgFB//8DcUElT0K/gICAoAMgAa2Ip0EBcUVyDQELQQEPCyAAQfsAa0H//wNxQQRJC1cBA39BmAooAgAhAQNAAkAgAEH//wNxIgIQJARAIAAhAwwBCyAAIQMgAhA0DQBBACEDQZgKIAFBAmoiAjYCACABLwECIQAgAiEBIAANAQsLIANB//8DcQulAQEEfwJAQZgKKAIAIgMvAQAiBUHhAEcEQCABIQIgACEEDAELQZgKIANBBGo2AgBBARAlIQJBmAooAgAhBAJAIAJBIkYgAkEnRnJFBEAgAhA1GkGYCigCACECDAELIAIQJkGYCkGYCigCAEECaiICNgIAC0EBECUhBUGYCigCACEDCyADIARHBEAgBCACQQAgACAAIAFGIgAbQQAgASAAGxAECyAFC9MEAQd/QZgKKAIAIQECQCAAQd//A3FB2wBGBEAgAS8BACEFQZgKIAFBAmo2AgBB/QBB3QAgBUH7AEYbIQZBARAlIQNBnAooAgAhBwNAAkAgBiADQf//A3EiAkZBmAooAgAiASAHS3INAAJAIAJBLkcNACABLwECQS5HDQAgAS8BBEEuRw0AQZgKIAFBBmo2AgBBARAlEDchAwwCCwJAAn8CQCAFQfsARgRAAkAgAkEiRiACQSdGckUEQCACQdsARw0BQQAQOBpBmApBmAooAgBBAmo2AgAgAQwECyACECZBmApBmAooAgBBAmo2AgAgAQwDCyABIQAgA0Ewa0H//wNxQQlLDQEDQCAAIgJBAmohACACLwECIgNBMGtB//8DcUEKSQ0AIANBwQBrIgRBHk1BAEEBIAR0Qb+AgYQEcRsNACADQeEAayIEQRdNQQBBASAEdEG/wIEEcRsNAAJAAkAgA0Eraw4EAAEAAgELIAIvAQBBIHJB5QBGDQELC0GYCiAANgIAIAEMAgsgAkEsRgRAQZgKIAFBAmo2AgBBARAlIQMMBQsgAhA3IQIMAgsgAhA1GkGYCigCAAshAEEBECUiAkE6RgRAQZgKQZgKKAIAQQJqNgIAQQEQJRA3IQIMAQsgACABTQ0AIAEgACABIAAQBAsgAkE9RgRAQQAQOCECC0GYCigCACEBIAJBLEcNAEGYCiABQQJqNgIAQQEQJSEDDAELC0GYCiABQQJqNgIADAELIAAQNRpBmAooAgAiACABTQ0AIAEgACABIAAQBAtBARAlC54NAQx/QYQKQZgKKAIAIgE2AgBBkAooAgAhCkGMCigCACEHQZwKKAIAIQxBggovAQAhCyABIgQhAgJAA0BBmAogAkECaiIJNgIAIAIgDE8EQEEAIQYMAgsCQAJAIAkvAQAiAxAuDQACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkBBggovAQAiBSALRw0AIAMhBgJAAkAgA0Epaw4EGgEBGgALIANBO0YgA0HdAEZyIANB/QBGcg0XCyAAIAhxQQFHDQACQCADQSJrDg4MExMTEwwFCRMTCBMTDQALAkAgA0HbAGsODwYTBxMTDhMTBBMCExMTAwALAkAgA0H7AGsOAwoTCwALIANBCmsOBBgSEhgSCwJAIANBImsODgsSEhISCwQIEhIHEhIMAAsCQCADQdsAaw4PBRIGEhINEhIDEgESEhICAAsCQCADQQprDgQVEhIVAAsgA0H7AGsOAwgRCRELIAUNECAJEB5FDRAgAkEEakGCCEEKEB8NEBAgDBALIAIvAQRB7QBHDQ8gCRAeRQ0PIAIpAAZC8IC8g6COgDpSDQ8QIQwPCyACLwEEQewARw0OIAkQHkUNDiACQQZqQbIIQQYQHw0OIAIvAQwQJEUNDkGUCkEBOgAADA4LIAcgBUEDdGoiAUEBNgIAQYIKIAVBAWo7AQAgASAENgIEDA0LIAcgBUEDdGoiAUEINgIAQYIKIAVBAWo7AQAgASAENgIEDAwLIAVFDQxBggogBUEBazsBAAwLCyAFRQ0KQYAKLwEAIgFFDQogByAFQQN0akEIaygCAEEFRw0KIAogAUECdGpBBGsoAgAiASgCBA0KIAEgBEECajYCBEGYCiACQQRqNgIAQQEQJRogAUGYCigCACIBNgIQQZgKIAFBAms2AgAMCgsgBUUNCkGCCiAFQQFrIgY7AQBBgAovAQAiAUUNCSAHIAZB//8DcUEDdGooAgBBBUcNCSAKIAFBAnRqQQRrKAIAIgYoAgRFBEAgBiAEQQJqNgIECyAGIAJBBGo2AgxBgAogAUEBazsBAAwJCwJAIAQvAQBBKUcNAEHUCSgCACIBRQ0AIAEoAgwgBEECakcNAEHUCUHYCSgCACIBNgIAIAEEQCABQQA2AiQMAQtBxAlBADYCAAsgByAFQQN0aiIBQQZBAkGUCi0AABs2AgBBggogBUEBajsBACABIAQ2AgRBlApBADoAAAwICyAFRQ0IQYIKIAVBAWsiATsBACAHIAFB//8DcUEDdGooAgBBBEYNAwwHCyADECYMBgsCQCACLwEEIgJBKkcEQCACQS9HDQEQIgwJC0EBECMMCAsCQCAELwEAIgEQJwRAAkACQAJAIAFBK2sOBAEJAgAJCyAEQQJrLwEAQTBrQf//A3FBCkkNAwwICyAEQQJrLwEAQStGDQIMBwsgBEECay8BAEEtRg0BDAYLIAFBKUcNACAHIAVBA3RqKAIEECgNBQsCQAJAIAVFIAFB5gBHcg0AIAcgBUEDdGoiAkEIaygCAEEBRw0AIARBAmsvAQBB7wBHDQEgBEEEaxApRQ0BIAJBBGsoAgBBnglBAxAqRQ0BDAYLIAFB/QBHDQAgByAFQQN0aiICKAIEECsNBSACKAIAQQZGDQULIAQQLA0EQYgKLQAAIAFBL0ZxIAFBAEdzRQ0EQdwJKAIAIgZFDQIgBCAGKAIASQ0CIAQiAiAGKAIETQ0EDAMLIAcgBUEDdGoiASAENgIEQYIKIAVBAWo7AQAgAUEDNgIACxAwDAMLIAQhAgsDQCACQaCLBEsEQCACQQJrIgIvAQAiARAtRQ0BCwsgARAuBEADQCACQaCLBEsEQEGECiACQQJrIgI2AgAgAi8BABAuDQELCyACEC8NAQtBiApBAToAAAwBCxAxQYgKQQA6AAALQYQKQZgKKAIAIgE2AgAMAQsQMgtBACEGQeQJLQAADQMCQCABIARGBEAgAEUNAUGCCi8BACALRiAIcUUNAUEBIQggASEEQZgKKAIALwEAIgZBCmsOBAUCAgUCCyADQS9GBEBBiAotAABBAXMhCAwBC0EBIQggA0Ewa0H//wNxQQpJIANB3/8DcUHBAGtB//8DcUEaSXIgA0EkRiADQd8ARnJyIANB/wBLcg0AIAEhBAJAAkAgA0Enaw4DAwEDAAsCQCADQd0Aaw4EAwEBAwALIANBIkYgA0H9AEZyDQELQQAhCAsgASEEC0GYCigCACECDAELCyADDwsgBguvBAEHfyABQSJGIAFBJ0ZyRQRAEDIPC0GYCigCACEDIAEQJiAAIANBAmpBmAooAgBBARADIAIEQEHUCSgCAEEEQQYgAkEBRhs2AhwLQZgKQZgKKAIAQQJqNgIAQQAQJSEAQZgKKAIAIQQCQAJAIABB9wBHDQAgBC8BAkHpAEcNACAELwEEQfQARw0AIAQvAQZB6ABGDQELQZgKIARBAms2AgAPC0GYCiAEQQhqNgIAAkBBARAlQfsARwRADAELQewJKAIAIQNB1AkoAgAhBUGYCigCACIGIQBBACECA0AgAyEBQZgKIABBAmo2AgBBARAlIQBBmAooAgAhBwJAAkACQCAAQSJHBEAgAEEnRw0BQScQJgwCC0EiECYMAQsgABA1IQNBmAooAgAhAAwBC0GYCigCAEECaiEAQZgKIAA2AgBBARAlIQMLIANBOkcEQAwCC0GYCkGYCigCAEECajYCAEEBECUiA0EiRiADQSdGckUEQAwCC0GYCigCACEIIAMQJkHsCSABQRRqIgM2AgBBmAooAgAhCSABQQA2AhAgASAINgIIIAEgADYCBCABIAc2AgAgASAJQQJqIgA2AgwCQCACRQRAIAUgATYCIAwBCyACIAE2AhALQZgKIAA2AgACQEEBECUiAEEsRwRAIABB/QBGDQEMAwtBmApBmAooAgBBAmoiADYCACABIQIMAQsLIAUgBjYCECAFQZgKKAIAQQJqNgIMDwtBmAogBDYCAAstAQF/AkAgAC8BAEEuRw0AIABBAmsvAQBBLkcNACAAQQRrLwEAQS5GIQELIAELNQEBfwJAIABBoIsESQ0AIAAvAQAgAUcNACAAQaCLBEYEQEEBDwsgAEECay8BABAtIQILIAILKQEBfyAAQaABRiAAQQlrIgJBF01BAEEBIAJ0IAFxG3JFBEBBAA8LQQELC8cBAQBBgggLvwF4AHAAbwByAHQAZQB0AGEAbwB1AHIAYwBlAHIAbwBtAHUAbgBjAHQAaQBvAG4AbABhAHMAcwB2AG8AeQBpAGUAZABlAGwAZQBjAG8AbgB0AGkAbgBpAG4AcwB0AGEAbgB0AHkAYgByAGUAYQByAGUAdAB1AHIAZABlAGIAdQBnAGcAZQBhAHcAYQBpAHQAaAByAHcAaABpAGwAZQBmAG8AcgBpAGYAYwBhAHQAYwBmAGkAbgBhAGwAbABlAGwAcw==\",typeof Buffer<\"u\"?Buffer.from(A2,\"base64\"):Uint8Array.from(atob(A2),(A3)=>A3.charCodeAt(0));var A2},init=WebAssembly.compile(C()).then(WebAssembly.instantiate).then(({exports:A2})=>{E=A2});var number=(value,fallback=0)=>typeof value===\"number\"&&Number.isFinite(value)?value:fallback;function chartMarkBounds(target){let x=number(target.x),y=number(target.y);if(typeof target.outerRadius!==\"number\"){let horizontal=target.horizontal===!0,base=number(target.base,horizontal?x:y),width=Math.max(0,number(target.width)),height=Math.max(0,number(target.height));return horizontal?{x:Math.min(x,base),y:y-height/2,width:Math.abs(x-base),height}:{x:x-width/2,y:Math.min(y,base),width,height:Math.abs(y-base)}}let outer=Math.max(0,number(target.outerRadius)),inner=Math.max(0,number(target.innerRadius)),start=number(target.startAngle),end=number(target.endAngle,start);if(Math.max(0,end-start)>=Math.PI*2)return{x:x-outer,y:y-outer,width:outer*2,height:outer*2};let angles=[start,end],quarter=Math.PI/2;for(let angle=Math.ceil(start/quarter)*quarter;angle<end;angle+=quarter)angles.push(angle);let points=angles.flatMap((angle)=>[inner,outer].map((radius)=>({x:x+Math.cos(angle)*radius,y:y+Math.sin(angle)*radius}))),left=Math.min(...points.map((point)=>point.x)),top=Math.min(...points.map((point)=>point.y));return{x:left,y:top,width:Math.max(...points.map((point)=>point.x))-left,height:Math.max(...points.map((point)=>point.y))-top}}function drawChartMarkPose(ctx,bounds,pose2,draw2,clip=!0){if(!pose2){draw2();return}ctx.save();try{let centerX=bounds.x+bounds.width/2,centerY=bounds.y+bounds.height/2;if(ctx.translate(centerX+pose2.x,centerY+pose2.y),ctx.rotate(pose2.rotation*Math.PI/180),ctx.scale(pose2.scale,pose2.scale),ctx.translate(-centerX,-centerY),ctx.globalAlpha*=pose2.opacity,pose2.blur>0)ctx.filter=(ctx.filter&&ctx.filter!==\"none\"?ctx.filter+\" \":\"\")+`blur(${pose2.blur}px)`;if(clip&&(pose2.clipLeft||pose2.clipRight||pose2.clipTop||pose2.clipBottom))ctx.beginPath(),ctx.rect(bounds.x+pose2.clipLeft*bounds.width,bounds.y+pose2.clipTop*bounds.height,Math.max(0,bounds.width*(1-pose2.clipLeft-pose2.clipRight)),Math.max(0,bounds.height*(1-pose2.clipTop-pose2.clipBottom))),ctx.clip();draw2()}finally{ctx.restore()}}var GEOMETRY_KEYS=[\"x\",\"y\",\"base\",\"width\",\"height\",\"startAngle\",\"endAngle\",\"circumference\",\"outerRadius\",\"innerRadius\"];function pointKey(element,datasetIndex,index2){return JSON.stringify([datasetIndex,element.data.rows?.[index2]?.id??element.data.labels[index2],element.data.rows?\"\":index2])}function sampledValue(state,entry){let animation=state.hostAPI.normalizeChartAnimation(state.element.animation),progress=animation.type===\"grow\"&&!state.element.markAnimations?.in||state.updateFrom?state.hostAPI.chartAnimationProgress(animation,state.frame,entry.index):1;return entry.fromValue+(entry.value-entry.fromValue)*progress}function normalizedElement(element){let errors=chartPresentationErrors(element.presentation);if(errors.length)throw Error(errors.join(\" \"));return{...structuredClone(element),data:parseChartData(element.data)}}function readGeometry(target){return Object.fromEntries(GEOMETRY_KEYS.flatMap((key)=>typeof target[key]===\"number\"&&Number.isFinite(target[key])?[[key,target[key]]]:[]))}function applyGeometry(state){let animation=state.hostAPI.normalizeChartAnimation(state.element.animation);for(let{target,from:from2,to:to2,index:index2}of state.geometry){let progress=animation.type===\"grow\"&&!state.element.markAnimations?.in||state.updateFrom?state.hostAPI.chartAnimationProgress(animation,state.frame,index2):1;for(let key of GEOMETRY_KEYS){let end=to2[key];if(end===void 0)continue;let start=from2[key]??end,value=progress===1?end:start+(end-start)*progress;target[key]=[\"width\",\"height\",\"circumference\",\"outerRadius\",\"innerRadius\"].includes(key)?Math.max(0,value):value}}let chart2=state.chart;if(!chart2)return;for(let index2=0;index2<chart2.data.datasets.length;index2++){let meta=chart2.getDatasetMeta(index2);if(meta.dataset&&\"points\"in meta.dataset)meta.dataset.points=meta.data}}function animationPlugin(state){let savedContext=!1,restoreContext=(chart2)=>{if(savedContext)chart2.ctx.restore(),savedContext=!1};return{id:\"ograf-chart-animation\",afterUpdate(chart2){state.chart=chart2;let targets=chart2.data.datasets.flatMap((_,datasetIndex)=>chart2.getDatasetMeta(datasetIndex).data.map((target,index2)=>({target,to:readGeometry(target),index:index2,markIndex:datasetIndex*state.element.data.labels.length+index2,key:pointKey(state.element,datasetIndex,index2),value:state.element.data.datasets[datasetIndex].data[index2]})));if(chart2.reset(),state.geometry=targets.map((entry)=>{let baseline=readGeometry(entry.target);if(state.element.preset===\"horizontal-bar\")baseline.width=0;else if(state.element.preset===\"bar\"||state.element.preset===\"stacked-bar\")baseline.height=0;return{...entry,fromValue:state.updateFrom?state.updateValues?.get(entry.key)??0:0,from:state.updateFrom?state.updateValues?.get(entry.key)===entry.value?entry.to:state.updateFrom.get(entry.key)??baseline:baseline}}),state.element.markAnimations)for(let{target,markIndex}of state.geometry){let existing=state.wrappedMarks.get(target);if(existing){existing.index=markIndex;continue}let sampling={index:markIndex},mark=target,draw2=mark.draw;mark.draw=function(ctx){drawChartMarkPose(ctx,chartMarkBounds(this),state.element.markAnimations?state.hostAPI.sampleChartMarkAnimation?.(sampling.index)??null:null,()=>draw2.call(this,ctx))},state.wrappedMarks.set(target,sampling)}applyGeometry(state)},beforeDraw(chart2){if(restoreContext(chart2),applyGeometry(state),state.paintLayer)return chart2._drawDatasets(),!1},beforeDatasetsDraw(chart2){if(state.element.fill!==void 0&&!state.paintLayer)return!1;let animation=state.hostAPI.normalizeChartAnimation(state.element.animation);if(state.updateFrom||state.element.markAnimations?.in)return;let progress=Math.max(0,Math.min(1,state.hostAPI.chartAnimationProgress(animation,state.frame)));if(animation.type!==\"reveal\"&&animation.type!==\"fade\")return;if(chart2.ctx.save(),savedContext=!0,animation.type===\"reveal\"){let{left,top,width,height}=chart2.chartArea;chart2.ctx.beginPath(),chart2.ctx.rect(left,top,width*progress,height),chart2.ctx.clip()}else chart2.ctx.globalAlpha*=progress},afterDatasetsDraw:restoreContext,afterDraw:restoreContext}}function valueLabelPlugin(state){return{id:\"ograf-chart-value-labels\",afterDatasetsDraw(chart2){if(state.paintLayer===\"mask\"||state.element.fill!==void 0&&!state.paintLayer)return;let settings=state.element.presentation?.valueLabels;if(!settings?.show||![\"bar\",\"horizontal-bar\",\"stacked-bar\"].includes(state.element.preset))return;let{ctx,chartArea}=chart2,horizontal=state.element.preset===\"horizontal-bar\",font=`${state.element.presentation?.fontWeight??400} ${state.element.fontSize}px ${state.element.presentation?.fontFamily??\"sans-serif\"}`,suffix=settings.suffix??(state.element.data.mode?\"%\":\"\");ctx.save(),ctx.font=font,ctx.fillStyle=state.element.textColor,ctx.textBaseline=\"middle\";for(let[datasetIndex,dataset]of state.element.data.datasets.entries())chart2.getDatasetMeta(datasetIndex).data.forEach((point,index2)=>{let bar=point,value=dataset.data[index2],entry=state.geometry.find((candidate)=>candidate.key===pointKey(state.element,datasetIndex,index2)),label=(entry?sampledValue(state,entry):value).toFixed(settings.decimals??0)+suffix,width=ctx.measureText(label).width;drawChartMarkPose(ctx,chartMarkBounds(point),state.element.markAnimations?state.hostAPI.sampleChartMarkAnimation?.(datasetIndex*state.element.data.labels.length+index2)??null:null,()=>{if(horizontal){let preferred=value>=0?bar.x+6:bar.x-width-6;ctx.textAlign=\"left\",ctx.fillText(label,Math.max(0,Math.min(chart2.width-width,preferred)),bar.y)}else{ctx.textAlign=\"center\";let y=value>=0?bar.y-state.element.fontSize/2-4:bar.y+state.element.fontSize/2+4;ctx.fillText(label,Math.max(width/2,Math.min(chart2.width-width/2,bar.x)),Math.max(state.element.fontSize/2,Math.min(chartArea.bottom,y)))}},!1)});ctx.restore()}}}function configuration(state){let element=state.element,radial=element.preset===\"radar\"||element.preset===\"polar-area\",cartesian=!radial&&element.preset!==\"pie\"&&element.preset!==\"doughnut\",type=element.preset===\"horizontal-bar\"||element.preset===\"stacked-bar\"?\"bar\":element.preset===\"area\"?\"line\":element.preset===\"polar-area\"?\"polarArea\":element.preset,clockAnimation={duration:0,animateRotate:!0,animateScale:!0},presentation=element.presentation,font={size:element.fontSize,...presentation?.fontFamily?{family:presentation.fontFamily}:{},...presentation?.fontWeight?{weight:presentation.fontWeight}:{}},axis=element.data.mode?{min:0,max:100,step:presentation?.valueAxis?.step,format:\"percent\",decimals:presentation?.valueAxis?.decimals}:presentation?.valueAxis,numericTicks={...axis?.step===void 0?{}:{stepSize:axis.step},...axis?.format||axis?.decimals!==void 0?{callback:(value)=>Number(value).toFixed(axis.decimals??0)+(axis.format===\"percent\"?\"%\":\"\")}:{}},numericScale={...axis?.min===void 0?{}:{min:axis.min},...axis?.max===void 0?{}:{max:axis.max}},numericAxis=element.preset===\"horizontal-bar\"?\"x\":\"y\";return{type,data:{labels:[...element.data.labels],datasets:element.data.datasets.map((dataset)=>({...structuredClone(dataset),...presentation?.maxBarThickness?{maxBarThickness:presentation.maxBarThickness}:{},...presentation?.gradient?{backgroundColor:(context2)=>{let area=context2.chart.chartArea;if(!area)return presentation.gradient.from;let gradient=context2.chart.ctx.createLinearGradient(area.left,area.bottom,element.preset===\"horizontal-bar\"?area.right:area.left,element.preset===\"horizontal-bar\"?area.bottom:area.top);return gradient.addColorStop(0,presentation.gradient.from),gradient.addColorStop(1,presentation.gradient.to),gradient}}:{},...element.preset===\"area\"?{fill:!0}:{},...element.fill===void 0?{}:{backgroundColor:\"transparent\"}}))},options:{responsive:!1,maintainAspectRatio:!1,devicePixelRatio:1,animation:clockAnimation,events:[],layout:presentation?.valueLabels?.show?{padding:{right:element.preset===\"horizontal-bar\"?element.fontSize*4:0,top:element.preset===\"horizontal-bar\"?0:element.fontSize+8}}:{},indexAxis:element.preset===\"horizontal-bar\"?\"y\":\"x\",plugins:{legend:{display:element.showLegend,labels:{color:element.textColor,font}},tooltip:{enabled:!1}},...radial?{scales:{r:{grid:{display:element.showGrid,color:\"#ffffff44\"},angleLines:{display:element.showGrid,color:\"#ffffff44\"},pointLabels:{color:element.textColor,font},ticks:{color:element.textColor,backdropColor:\"transparent\",font}}}}:cartesian?{scales:{x:{...numericAxis===\"x\"?numericScale:{},stacked:element.preset===\"stacked-bar\",grid:{display:element.showGrid},ticks:{color:element.textColor,font,...numericAxis===\"x\"?numericTicks:{}}},y:{...numericAxis===\"y\"?numericScale:{},stacked:element.preset===\"stacked-bar\",beginAtZero:!0,grid:{display:element.showGrid},ticks:{color:element.textColor,font,...numericAxis===\"y\"?numericTicks:{}}}}}:{},elements:{line:{fill:element.preset===\"area\"}}},plugins:[animationPlugin(state),valueLabelPlugin(state)]}}var chartJsProvider={apiVersion:1,create(canvas,element,hostAPI){let assertMarkSupport=(candidate)=>{if(candidate.markAnimations&&!hostAPI.sampleChartMarkAnimation)throw Error(\"Chart mark animations require an updated OGraf Studio/runtime host.\");if(candidate.markAnimations&&![\"bar\",\"horizontal-bar\",\"stacked-bar\",\"pie\",\"doughnut\",\"polar-area\"].includes(candidate.preset))throw Error(\"Individual mark animations support bars and slices, not connected charts.\")};assertMarkSupport(element);let state={element:normalizedElement(element),frame:0,geometry:[],hostAPI,wrappedMarks:new WeakMap},containerSize=()=>{let parent=canvas.parentElement,width=parent?.clientWidth,height=parent?.clientHeight;return typeof width===\"number\"&&Number.isFinite(width)&&width>0&&typeof height===\"number\"&&Number.isFinite(height)&&height>0?{width,height}:null},fitDisplay=()=>{canvas.style.width=\"100%\",canvas.style.height=\"100%\"},resizeToContainer=()=>{let chart2=state.chart,size=containerSize();if(!chart2||!size)return;if(chart2.width!==size.width||chart2.height!==size.height)chart2.resize(size.width,size.height);fitDisplay()},mount=()=>{let size=containerSize();canvas.width=size?.width??Math.max(1,canvas.width||1),canvas.height=size?.height??Math.max(1,canvas.height||1),fitDisplay(),state.chart=new auto_default(canvas,configuration(state)),resizeToContainer()};return mount(),{renderAtFrame(frame){state.frame=frame,resizeToContainer(),applyGeometry(state),state.chart?.draw()},update(nextElement){assertMarkSupport(nextElement);let normalized=normalizedElement(nextElement);if(resizeToContainer(),JSON.stringify(state.element)===JSON.stringify(normalized))return;let chart2=state.chart,sameType=state.element.preset===normalized.preset,dataChanged=JSON.stringify(state.element.data)!==JSON.stringify(normalized.data),displayedValues=new Map(state.geometry.map((entry)=>[entry.key,sampledValue(state,entry)]));if(state.updateFrom=dataChanged&&normalized.animation?.updateMode===\"morph\"?new Map(state.geometry.map(({key,target})=>[key,readGeometry(target)])):void 0,state.updateValues=state.updateFrom?displayedValues:void 0,state.element=normalized,dataChanged&&normalized.animation?.replayOnUpdate!==!1)state.frame=0;if(!chart2||!sameType){chart2?.destroy(),state.geometry=[],mount();return}let config=configuration(state);chart2.data=config.data,chart2.options=config.options,chart2.update(\"none\")},resetAnimation(){state.updateFrom=void 0,state.updateValues=void 0,state.frame=0,resizeToContainer(),state.chart?.update(\"none\")},renderMarkLayers(mask,foreground){resizeToContainer();let chart2=state.chart;if(!chart2)return;let mutable=chart2,original={canvas:mutable.canvas,ctx:mutable.ctx},targets=chart2.data.datasets.flatMap((_,index2)=>{let meta=chart2.getDatasetMeta(index2);return[...meta.dataset?[meta.dataset]:[],...meta.data]}),controllers2=chart2.data.datasets.map((_,index2)=>chart2.getDatasetMeta(index2).controller),contexts=controllers2.map((controller)=>controller._ctx),options=targets.map((target)=>({target,options:target.options}));try{for(let[layer,canvas2]of[[\"mask\",mask],[\"foreground\",foreground]]){if(canvas2.width!==original.canvas.width)canvas2.width=original.canvas.width;if(canvas2.height!==original.canvas.height)canvas2.height=original.canvas.height;let ctx=canvas2.getContext(\"2d\");if(!ctx)throw Error(\"Chart mark paint requires Canvas 2D rendering.\");state.paintLayer=layer;for(let entry of options)entry.target.options={...entry.options,backgroundColor:layer===\"mask\"?\"#ffffff\":\"transparent\",...layer===\"mask\"?{borderColor:\"transparent\",borderWidth:0}:{}};mutable.canvas=canvas2,mutable.ctx=ctx;for(let controller of controllers2)controller._ctx=ctx;chart2.draw()}}finally{for(let entry of options)entry.target.options=entry.options;mutable.canvas=original.canvas,mutable.ctx=original.ctx,controllers2.forEach((controller,index2)=>{controller._ctx=contexts[index2]}),delete state.paintLayer}},dispose(){state.chart?.destroy(),state.chart=void 0,state.geometry=[]}}}};export{chartJsProvider as default};\n",
          "licenseText": "OGraf Studio renderer adapter:\n                    GNU AFFERO GENERAL PUBLIC LICENSE\n                       Version 3, 19 November 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n                            Preamble\n\n  The GNU Affero General Public License is a free, copyleft license for\nsoftware and other kinds of works, specifically designed to ensure\ncooperation with the community in the case of network server software.\n\n  The licenses for most software and other practical works are designed\nto take away your freedom to share and change the works.  By contrast,\nour General Public Licenses are intended to guarantee your freedom to\nshare and change all versions of a program--to make sure it remains free\nsoftware for all its users.\n\n  When we speak of free software, we are referring to freedom, not\nprice.  Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthem if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs, and that you know you can do these things.\n\n  Developers that use our General Public Licenses protect your rights\nwith two steps: (1) assert copyright on the software, and (2) offer\nyou this License which gives you legal permission to copy, distribute\nand/or modify the software.\n\n  A secondary benefit of defending all users' freedom is that\nimprovements made in alternate versions of the program, if they\nreceive widespread use, become available for other developers to\nincorporate.  Many developers of free software are heartened and\nencouraged by the resulting cooperation.  However, in the case of\nsoftware used on network servers, this result may fail to come about.\nThe GNU General Public License permits making a modified version and\nletting the public access it on a server without ever releasing its\nsource code to the public.\n\n  The GNU Affero General Public License is designed specifically to\nensure that, in such cases, the modified source code becomes available\nto the community.  It requires the operator of a network server to\nprovide the source code of the modified version running there to the\nusers of that server.  Therefore, public use of a modified version, on\na publicly accessible server, gives the public access to the source\ncode of the modified version.\n\n  An older license, called the Affero General Public License and\npublished by Affero, was designed to accomplish similar goals.  This is\na different license, not a version of the Affero GPL, but Affero has\nreleased a new version of the Affero GPL which permits relicensing under\nthis license.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.\n\n                       TERMS AND CONDITIONS\n\n  0. Definitions.\n\n  \"This License\" refers to version 3 of the GNU Affero General Public License.\n\n  \"Copyright\" also means copyright-like laws that apply to other kinds of\nworks, such as semiconductor masks.\n\n  \"The Program\" refers to any copyrightable work licensed under this\nLicense.  Each licensee is addressed as \"you\".  \"Licensees\" and\n\"recipients\" may be individuals or organizations.\n\n  To \"modify\" a work means to copy from or adapt all or part of the work\nin a fashion requiring copyright permission, other than the making of an\nexact copy.  The resulting work is called a \"modified version\" of the\nearlier work or a work \"based on\" the earlier work.\n\n  A \"covered work\" means either the unmodified Program or a work based\non the Program.\n\n  To \"propagate\" a work means to do anything with it that, without\npermission, would make you directly or secondarily liable for\ninfringement under applicable copyright law, except executing it on a\ncomputer or modifying a private copy.  Propagation includes copying,\ndistribution (with or without modification), making available to the\npublic, and in some countries other activities as well.\n\n  To \"convey\" a work means any kind of propagation that enables other\nparties to make or receive copies.  Mere interaction with a user through\na computer network, with no transfer of a copy, is not conveying.\n\n  An interactive user interface displays \"Appropriate Legal Notices\"\nto the extent that it includes a convenient and prominently visible\nfeature that (1) displays an appropriate copyright notice, and (2)\ntells the user that there is no warranty for the work (except to the\nextent that warranties are provided), that licensees may convey the\nwork under this License, and how to view a copy of this License.  If\nthe interface presents a list of user commands or options, such as a\nmenu, a prominent item in the list meets this criterion.\n\n  1. Source Code.\n\n  The \"source code\" for a work means the preferred form of the work\nfor making modifications to it.  \"Object code\" means any non-source\nform of a work.\n\n  A \"Standard Interface\" means an interface that either is an official\nstandard defined by a recognized standards body, or, in the case of\ninterfaces specified for a particular programming language, one that\nis widely used among developers working in that language.\n\n  The \"System Libraries\" of an executable work include anything, other\nthan the work as a whole, that (a) is included in the normal form of\npackaging a Major Component, but which is not part of that Major\nComponent, and (b) serves only to enable use of the work with that\nMajor Component, or to implement a Standard Interface for which an\nimplementation is available to the public in source code form.  A\n\"Major Component\", in this context, means a major essential component\n(kernel, window system, and so on) of the specific operating system\n(if any) on which the executable work runs, or a compiler used to\nproduce the work, or an object code interpreter used to run it.\n\n  The \"Corresponding Source\" for a work in object code form means all\nthe source code needed to generate, install, and (for an executable\nwork) run the object code and to modify the work, including scripts to\ncontrol those activities.  However, it does not include the work's\nSystem Libraries, or general-purpose tools or generally available free\nprograms which are used unmodified in performing those activities but\nwhich are not part of the work.  For example, Corresponding Source\nincludes interface definition files associated with source files for\nthe work, and the source code for shared libraries and dynamically\nlinked subprograms that the work is specifically designed to require,\nsuch as by intimate data communication or control flow between those\nsubprograms and other parts of the work.\n\n  The Corresponding Source need not include anything that users\ncan regenerate automatically from other parts of the Corresponding\nSource.\n\n  The Corresponding Source for a work in source code form is that\nsame work.\n\n  2. Basic Permissions.\n\n  All rights granted under this License are granted for the term of\ncopyright on the Program, and are irrevocable provided the stated\nconditions are met.  This License explicitly affirms your unlimited\npermission to run the unmodified Program.  The output from running a\ncovered work is covered by this License only if the output, given its\ncontent, constitutes a covered work.  This License acknowledges your\nrights of fair use or other equivalent, as provided by copyright law.\n\n  You may make, run and propagate covered works that you do not\nconvey, without conditions so long as your license otherwise remains\nin force.  You may convey covered works to others for the sole purpose\nof having them make modifications exclusively for you, or provide you\nwith facilities for running those works, provided that you comply with\nthe terms of this License in conveying all material for which you do\nnot control copyright.  Those thus making or running the covered works\nfor you must do so exclusively on your behalf, under your direction\nand control, on terms that prohibit them from making any copies of\nyour copyrighted material outside their relationship with you.\n\n  Conveying under any other circumstances is permitted solely under\nthe conditions stated below.  Sublicensing is not allowed; section 10\nmakes it unnecessary.\n\n  3. Protecting Users' Legal Rights From Anti-Circumvention Law.\n\n  No covered work shall be deemed part of an effective technological\nmeasure under any applicable law fulfilling obligations under article\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\nsimilar laws prohibiting or restricting circumvention of such\nmeasures.\n\n  When you convey a covered work, you waive any legal power to forbid\ncircumvention of technological measures to the extent such circumvention\nis effected by exercising rights under this License with respect to\nthe covered work, and you disclaim any intention to limit operation or\nmodification of the work as a means of enforcing, against the work's\nusers, your or third parties' legal rights to forbid circumvention of\ntechnological measures.\n\n  4. Conveying Verbatim Copies.\n\n  You may convey verbatim copies of the Program's source code as you\nreceive it, in any medium, provided that you conspicuously and\nappropriately publish on each copy an appropriate copyright notice;\nkeep intact all notices stating that this License and any\nnon-permissive terms added in accord with section 7 apply to the code;\nkeep intact all notices of the absence of any warranty; and give all\nrecipients a copy of this License along with the Program.\n\n  You may charge any price or no price for each copy that you convey,\nand you may offer support or warranty protection for a fee.\n\n  5. Conveying Modified Source Versions.\n\n  You may convey a work based on the Program, or the modifications to\nproduce it from the Program, in the form of source code under the\nterms of section 4, provided that you also meet all of these conditions:\n\n    a) The work must carry prominent notices stating that you modified\n    it, and giving a relevant date.\n\n    b) The work must carry prominent notices stating that it is\n    released under this License and any conditions added under section\n    7.  This requirement modifies the requirement in section 4 to\n    \"keep intact all notices\".\n\n    c) You must license the entire work, as a whole, under this\n    License to anyone who comes into possession of a copy.  This\n    License will therefore apply, along with any applicable section 7\n    additional terms, to the whole of the work, and all its parts,\n    regardless of how they are packaged.  This License gives no\n    permission to license the work in any other way, but it does not\n    invalidate such permission if you have separately received it.\n\n    d) If the work has interactive user interfaces, each must display\n    Appropriate Legal Notices; however, if the Program has interactive\n    interfaces that do not display Appropriate Legal Notices, your\n    work need not make them do so.\n\n  A compilation of a covered work with other separate and independent\nworks, which are not by their nature extensions of the covered work,\nand which are not combined with it such as to form a larger program,\nin or on a volume of a storage or distribution medium, is called an\n\"aggregate\" if the compilation and its resulting copyright are not\nused to limit the access or legal rights of the compilation's users\nbeyond what the individual works permit.  Inclusion of a covered work\nin an aggregate does not cause this License to apply to the other\nparts of the aggregate.\n\n  6. Conveying Non-Source Forms.\n\n  You may convey a covered work in object code form under the terms\nof sections 4 and 5, provided that you also convey the\nmachine-readable Corresponding Source under the terms of this License,\nin one of these ways:\n\n    a) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by the\n    Corresponding Source fixed on a durable physical medium\n    customarily used for software interchange.\n\n    b) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by a\n    written offer, valid for at least three years and valid for as\n    long as you offer spare parts or customer support for that product\n    model, to give anyone who possesses the object code either (1) a\n    copy of the Corresponding Source for all the software in the\n    product that is covered by this License, on a durable physical\n    medium customarily used for software interchange, for a price no\n    more than your reasonable cost of physically performing this\n    conveying of source, or (2) access to copy the\n    Corresponding Source from a network server at no charge.\n\n    c) Convey individual copies of the object code with a copy of the\n    written offer to provide the Corresponding Source.  This\n    alternative is allowed only occasionally and noncommercially, and\n    only if you received the object code with such an offer, in accord\n    with subsection 6b.\n\n    d) Convey the object code by offering access from a designated\n    place (gratis or for a charge), and offer equivalent access to the\n    Corresponding Source in the same way through the same place at no\n    further charge.  You need not require recipients to copy the\n    Corresponding Source along with the object code.  If the place to\n    copy the object code is a network server, the Corresponding Source\n    may be on a different server (operated by you or a third party)\n    that supports equivalent copying facilities, provided you maintain\n    clear directions next to the object code saying where to find the\n    Corresponding Source.  Regardless of what server hosts the\n    Corresponding Source, you remain obligated to ensure that it is\n    available for as long as needed to satisfy these requirements.\n\n    e) Convey the object code using peer-to-peer transmission, provided\n    you inform other peers where the object code and Corresponding\n    Source of the work are being offered to the general public at no\n    charge under subsection 6d.\n\n  A separable portion of the object code, whose source code is excluded\nfrom the Corresponding Source as a System Library, need not be\nincluded in conveying the object code work.\n\n  A \"User Product\" is either (1) a \"consumer product\", which means any\ntangible personal property which is normally used for personal, family,\nor household purposes, or (2) anything designed or sold for incorporation\ninto a dwelling.  In determining whether a product is a consumer product,\ndoubtful cases shall be resolved in favor of coverage.  For a particular\nproduct received by a particular user, \"normally used\" refers to a\ntypical or common use of that class of product, regardless of the status\nof the particular user or of the way in which the particular user\nactually uses, or expects or is expected to use, the product.  A product\nis a consumer product regardless of whether the product has substantial\ncommercial, industrial or non-consumer uses, unless such uses represent\nthe only significant mode of use of the product.\n\n  \"Installation Information\" for a User Product means any methods,\nprocedures, authorization keys, or other information required to install\nand execute modified versions of a covered work in that User Product from\na modified version of its Corresponding Source.  The information must\nsuffice to ensure that the continued functioning of the modified object\ncode is in no case prevented or interfered with solely because\nmodification has been made.\n\n  If you convey an object code work under this section in, or with, or\nspecifically for use in, a User Product, and the conveying occurs as\npart of a transaction in which the right of possession and use of the\nUser Product is transferred to the recipient in perpetuity or for a\nfixed term (regardless of how the transaction is characterized), the\nCorresponding Source conveyed under this section must be accompanied\nby the Installation Information.  But this requirement does not apply\nif neither you nor any third party retains the ability to install\nmodified object code on the User Product (for example, the work has\nbeen installed in ROM).\n\n  The requirement to provide Installation Information does not include a\nrequirement to continue to provide support service, warranty, or updates\nfor a work that has been modified or installed by the recipient, or for\nthe User Product in which it has been modified or installed.  Access to a\nnetwork may be denied when the modification itself materially and\nadversely affects the operation of the network or violates the rules and\nprotocols for communication across the network.\n\n  Corresponding Source conveyed, and Installation Information provided,\nin accord with this section must be in a format that is publicly\ndocumented (and with an implementation available to the public in\nsource code form), and must require no special password or key for\nunpacking, reading or copying.\n\n  7. Additional Terms.\n\n  \"Additional permissions\" are terms that supplement the terms of this\nLicense by making exceptions from one or more of its conditions.\nAdditional permissions that are applicable to the entire Program shall\nbe treated as though they were included in this License, to the extent\nthat they are valid under applicable law.  If additional permissions\napply only to part of the Program, that part may be used separately\nunder those permissions, but the entire Program remains governed by\nthis License without regard to the additional permissions.\n\n  When you convey a copy of a covered work, you may at your option\nremove any additional permissions from that copy, or from any part of\nit.  (Additional permissions may be written to require their own\nremoval in certain cases when you modify the work.)  You may place\nadditional permissions on material, added by you to a covered work,\nfor which you have or can give appropriate copyright permission.\n\n  Notwithstanding any other provision of this License, for material you\nadd to a covered work, you may (if authorized by the copyright holders of\nthat material) supplement the terms of this License with terms:\n\n    a) Disclaiming warranty or limiting liability differently from the\n    terms of sections 15 and 16 of this License; or\n\n    b) Requiring preservation of specified reasonable legal notices or\n    author attributions in that material or in the Appropriate Legal\n    Notices displayed by works containing it; or\n\n    c) Prohibiting misrepresentation of the origin of that material, or\n    requiring that modified versions of such material be marked in\n    reasonable ways as different from the original version; or\n\n    d) Limiting the use for publicity purposes of names of licensors or\n    authors of the material; or\n\n    e) Declining to grant rights under trademark law for use of some\n    trade names, trademarks, or service marks; or\n\n    f) Requiring indemnification of licensors and authors of that\n    material by anyone who conveys the material (or modified versions of\n    it) with contractual assumptions of liability to the recipient, for\n    any liability that these contractual assumptions directly impose on\n    those licensors and authors.\n\n  All other non-permissive additional terms are considered \"further\nrestrictions\" within the meaning of section 10.  If the Program as you\nreceived it, or any part of it, contains a notice stating that it is\ngoverned by this License along with a term that is a further\nrestriction, you may remove that term.  If a license document contains\na further restriction but permits relicensing or conveying under this\nLicense, you may add to a covered work material governed by the terms\nof that license document, provided that the further restriction does\nnot survive such relicensing or conveying.\n\n  If you add terms to a covered work in accord with this section, you\nmust place, in the relevant source files, a statement of the\nadditional terms that apply to those files, or a notice indicating\nwhere to find the applicable terms.\n\n  Additional terms, permissive or non-permissive, may be stated in the\nform of a separately written license, or stated as exceptions;\nthe above requirements apply either way.\n\n  8. Termination.\n\n  You may not propagate or modify a covered work except as expressly\nprovided under this License.  Any attempt otherwise to propagate or\nmodify it is void, and will automatically terminate your rights under\nthis License (including any patent licenses granted under the third\nparagraph of section 11).\n\n  However, if you cease all violation of this License, then your\nlicense from a particular copyright holder is reinstated (a)\nprovisionally, unless and until the copyright holder explicitly and\nfinally terminates your license, and (b) permanently, if the copyright\nholder fails to notify you of the violation by some reasonable means\nprior to 60 days after the cessation.\n\n  Moreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\n\n  Termination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License.  If your rights have been terminated and not permanently\nreinstated, you do not qualify to receive new licenses for the same\nmaterial under section 10.\n\n  9. Acceptance Not Required for Having Copies.\n\n  You are not required to accept this License in order to receive or\nrun a copy of the Program.  Ancillary propagation of a covered work\noccurring solely as a consequence of using peer-to-peer transmission\nto receive a copy likewise does not require acceptance.  However,\nnothing other than this License grants you permission to propagate or\nmodify any covered work.  These actions infringe copyright if you do\nnot accept this License.  Therefore, by modifying or propagating a\ncovered work, you indicate your acceptance of this License to do so.\n\n  10. Automatic Licensing of Downstream Recipients.\n\n  Each time you convey a covered work, the recipient automatically\nreceives a license from the original licensors, to run, modify and\npropagate that work, subject to this License.  You are not responsible\nfor enforcing compliance by third parties with this License.\n\n  An \"entity transaction\" is a transaction transferring control of an\norganization, or substantially all assets of one, or subdividing an\norganization, or merging organizations.  If propagation of a covered\nwork results from an entity transaction, each party to that\ntransaction who receives a copy of the work also receives whatever\nlicenses to the work the party's predecessor in interest had or could\ngive under the previous paragraph, plus a right to possession of the\nCorresponding Source of the work from the predecessor in interest, if\nthe predecessor has it or can get it with reasonable efforts.\n\n  You may not impose any further restrictions on the exercise of the\nrights granted or affirmed under this License.  For example, you may\nnot impose a license fee, royalty, or other charge for exercise of\nrights granted under this License, and you may not initiate litigation\n(including a cross-claim or counterclaim in a lawsuit) alleging that\nany patent claim is infringed by making, using, selling, offering for\nsale, or importing the Program or any portion of it.\n\n  11. Patents.\n\n  A \"contributor\" is a copyright holder who authorizes use under this\nLicense of the Program or a work on which the Program is based.  The\nwork thus licensed is called the contributor's \"contributor version\".\n\n  A contributor's \"essential patent claims\" are all patent claims\nowned or controlled by the contributor, whether already acquired or\nhereafter acquired, that would be infringed by some manner, permitted\nby this License, of making, using, or selling its contributor version,\nbut do not include claims that would be infringed only as a\nconsequence of further modification of the contributor version.  For\npurposes of this definition, \"control\" includes the right to grant\npatent sublicenses in a manner consistent with the requirements of\nthis License.\n\n  Each contributor grants you a non-exclusive, worldwide, royalty-free\npatent license under the contributor's essential patent claims, to\nmake, use, sell, offer for sale, import and otherwise run, modify and\npropagate the contents of its contributor version.\n\n  In the following three paragraphs, a \"patent license\" is any express\nagreement or commitment, however denominated, not to enforce a patent\n(such as an express permission to practice a patent or covenant not to\nsue for patent infringement).  To \"grant\" such a patent license to a\nparty means to make such an agreement or commitment not to enforce a\npatent against the party.\n\n  If you convey a covered work, knowingly relying on a patent license,\nand the Corresponding Source of the work is not available for anyone\nto copy, free of charge and under the terms of this License, through a\npublicly available network server or other readily accessible means,\nthen you must either (1) cause the Corresponding Source to be so\navailable, or (2) arrange to deprive yourself of the benefit of the\npatent license for this particular work, or (3) arrange, in a manner\nconsistent with the requirements of this License, to extend the patent\nlicense to downstream recipients.  \"Knowingly relying\" means you have\nactual knowledge that, but for the patent license, your conveying the\ncovered work in a country, or your recipient's use of the covered work\nin a country, would infringe one or more identifiable patents in that\ncountry that you have reason to believe are valid.\n\n  If, pursuant to or in connection with a single transaction or\narrangement, you convey, or propagate by procuring conveyance of, a\ncovered work, and grant a patent license to some of the parties\nreceiving the covered work authorizing them to use, propagate, modify\nor convey a specific copy of the covered work, then the patent license\nyou grant is automatically extended to all recipients of the covered\nwork and works based on it.\n\n  A patent license is \"discriminatory\" if it does not include within\nthe scope of its coverage, prohibits the exercise of, or is\nconditioned on the non-exercise of one or more of the rights that are\nspecifically granted under this License.  You may not convey a covered\nwork if you are a party to an arrangement with a third party that is\nin the business of distributing software, under which you make payment\nto the third party based on the extent of your activity of conveying\nthe work, and under which the third party grants, to any of the\nparties who would receive the covered work from you, a discriminatory\npatent license (a) in connection with copies of the covered work\nconveyed by you (or copies made from those copies), or (b) primarily\nfor and in connection with specific products or compilations that\ncontain the covered work, unless you entered into that arrangement,\nor that patent license was granted, prior to 28 March 2007.\n\n  Nothing in this License shall be construed as excluding or limiting\nany implied license or other defenses to infringement that may\notherwise be available to you under applicable patent law.\n\n  12. No Surrender of Others' Freedom.\n\n  If conditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot convey a\ncovered work so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you may\nnot convey it at all.  For example, if you agree to terms that obligate you\nto collect a royalty for further conveying from those to whom you convey\nthe Program, the only way you could satisfy both those terms and this\nLicense would be to refrain entirely from conveying the Program.\n\n  13. Remote Network Interaction; Use with the GNU General Public License.\n\n  Notwithstanding any other provision of this License, if you modify the\nProgram, your modified version must prominently offer all users\ninteracting with it remotely through a computer network (if your version\nsupports such interaction) an opportunity to receive the Corresponding\nSource of your version by providing access to the Corresponding Source\nfrom a network server at no charge, through some standard or customary\nmeans of facilitating copying of software.  This Corresponding Source\nshall include the Corresponding Source for any work covered by version 3\nof the GNU General Public License that is incorporated pursuant to the\nfollowing paragraph.\n\n  Notwithstanding any other provision of this License, you have\npermission to link or combine any covered work with a work licensed\nunder version 3 of the GNU General Public License into a single\ncombined work, and to convey the resulting work.  The terms of this\nLicense will continue to apply to the part which is the covered work,\nbut the work with which it is combined will remain governed by version\n3 of the GNU General Public License.\n\n  14. Revised Versions of this License.\n\n  The Free Software Foundation may publish revised and/or new versions of\nthe GNU Affero General Public License from time to time.  Such new versions\nwill be similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\n  Each version is given a distinguishing version number.  If the\nProgram specifies that a certain numbered version of the GNU Affero General\nPublic License \"or any later version\" applies to it, you have the\noption of following the terms and conditions either of that numbered\nversion or of any later version published by the Free Software\nFoundation.  If the Program does not specify a version number of the\nGNU Affero General Public License, you may choose any version ever published\nby the Free Software Foundation.\n\n  If the Program specifies that a proxy can decide which future\nversions of the GNU Affero General Public License can be used, that proxy's\npublic statement of acceptance of a version permanently authorizes you\nto choose that version for the Program.\n\n  Later license versions may give you additional or different\npermissions.  However, no additional obligations are imposed on any\nauthor or copyright holder as a result of your choosing to follow a\nlater version.\n\n  15. Disclaimer of Warranty.\n\n  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\nIS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n  16. Limitation of Liability.\n\n  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGES.\n\n  17. Interpretation of Sections 15 and 16.\n\n  If the disclaimer of warranty and limitation of liability provided\nabove cannot be given local legal effect according to their terms,\nreviewing courts shall apply local law that most closely approximates\nan absolute waiver of all civil liability in connection with the\nProgram, unless a warranty or assumption of liability accompanies a\ncopy of the Program in return for a fee.\n\n                     END OF TERMS AND CONDITIONS\n\n            How to Apply These Terms to Your New Programs\n\n  If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n  To do so, attach the following notices to the program.  It is safest\nto attach them to the start of each source file to most effectively\nstate the exclusion of warranty; and each file should have at least\nthe \"copyright\" line and a pointer to where the full notice is found.\n\n    <one line to give the program's name and a brief idea of what it does.>\n    Copyright (C) <year>  <name of author>\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU Affero General Public License as published\n    by the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU Affero General Public License for more details.\n\n    You should have received a copy of the GNU Affero General Public License\n    along with this program.  If not, see <https://www.gnu.org/licenses/>.\n\nAlso add information on how to contact you by electronic and paper mail.\n\n  If your software can interact with users remotely through a computer\nnetwork, you should also make sure that it provides a way for users to\nget its source.  For example, if your program is a web application, its\ninterface could display a \"Source\" link that leads users to an archive\nof the code.  There are many ways you could offer source, and different\nsolutions will be better for different programs; see section 13 for the\nspecific requirements.\n\n  You should also get your employer (if you work as a programmer) or school,\nif any, to sign a \"copyright disclaimer\" for the program, if necessary.\nFor more information on this, and how to apply and follow the GNU AGPL, see\n<https://www.gnu.org/licenses/>.\n\n\nChart.js:\nThe MIT License (MIT)\n\nCopyright (c) 2014-2024 Chart.js Contributors\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\n@kurkle/color:\nThe MIT License (MIT)\n\nCopyright (c) 2018-2024 Jukka Kurkela\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n",
          "sha256": "7966be65e37e8c5fb6e6b7e5d5735120e6edd1821d6be84ad4b8fba9a822072e"
        }
      ],
      "customActions": [],
      "assets": [],
      "designSystem": {
        "name": "Brand Kit",
        "tokens": []
      },
      "components": [],
      "keyframes": [
        {
          "id": "keyframe-11b9b499-dd07-4995-8464-643428e8c5e5",
          "name": "Start",
          "role": "start"
        },
        {
          "id": "keyframe-f046d7e2-77eb-4406-92cc-bd201079f768",
          "name": "Step 1",
          "role": "step"
        },
        {
          "id": "keyframe-a7d8ad41-5376-43d3-8e8f-9632db809f2e",
          "name": "End",
          "role": "end"
        }
      ],
      "transitions": [
        {
          "id": "transition-eccfd53e-2f1f-47f8-b6f8-5011d78005f4",
          "fromKeyframeId": "keyframe-11b9b499-dd07-4995-8464-643428e8c5e5",
          "toKeyframeId": "keyframe-f046d7e2-77eb-4406-92cc-bd201079f768",
          "durationFrames": 100,
          "easing": "linear"
        },
        {
          "id": "transition-2702552a-e611-46ee-9a91-f11edcfba515",
          "fromKeyframeId": "keyframe-f046d7e2-77eb-4406-92cc-bd201079f768",
          "toKeyframeId": "keyframe-a7d8ad41-5376-43d3-8e8f-9632db809f2e",
          "durationFrames": 50,
          "easing": "linear"
        }
      ],
      "shortOutFrames": 25
    }
  ],
  "shaders": [],
  "thumbnailFrame": 100
}
