diff --git a/css/6700.0530e224.css b/css/1095.0530e224.css similarity index 100% rename from css/6700.0530e224.css rename to css/1095.0530e224.css diff --git a/css/5917.4149415b.css b/css/3805.4149415b.css similarity index 100% rename from css/5917.4149415b.css rename to css/3805.4149415b.css diff --git a/css/663.ea261962.css b/css/8493.ea261962.css similarity index 100% rename from css/663.ea261962.css rename to css/8493.ea261962.css diff --git a/index.html b/index.html index 93fcc4d46..46de4e4ab 100644 --- a/index.html +++ b/index.html @@ -1 +1 @@ -STAC Browser
\ No newline at end of file +STAC Browser
\ No newline at end of file diff --git a/js/2005.3b769dc8.js b/js/2005.0c79f882.js similarity index 57% rename from js/2005.3b769dc8.js rename to js/2005.0c79f882.js index c1980d46e..a1dff1b96 100644 --- a/js/2005.3b769dc8.js +++ b/js/2005.0c79f882.js @@ -5,19 +5,19 @@ * (c) 2023 Jukka Kurkela * Released under the MIT License */ -function s(t){return t+.5|0}i.d(e,{qi:function(){return ia},vn:function(){return Rs},ZL:function(){return ua},uw:function(){return Qa},kL:function(){return Xo},wL:function(){return wa},f$:function(){return er},tt:function(){return zs},Dx:function(){return Pa},u:function(){return Ua}});const n=(t,e,i)=>Math.max(Math.min(t,i),e);function o(t){return n(s(2.55*t),0,255)}function a(t){return n(s(255*t),0,255)}function r(t){return n(s(t/2.55)/100,0,1)}function h(t){return n(s(100*t),0,100)}const l={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},c=[..."0123456789ABCDEF"],d=t=>c[15&t],u=t=>c[(240&t)>>4]+c[15&t],f=t=>(240&t)>>4===(15&t),g=t=>f(t.r)&&f(t.g)&&f(t.b)&&f(t.a);function p(t){var e,i=t.length;return"#"===t[0]&&(4===i||5===i?e={r:255&17*l[t[1]],g:255&17*l[t[2]],b:255&17*l[t[3]],a:5===i?17*l[t[4]]:255}:7!==i&&9!==i||(e={r:l[t[1]]<<4|l[t[2]],g:l[t[3]]<<4|l[t[4]],b:l[t[5]]<<4|l[t[6]],a:9===i?l[t[7]]<<4|l[t[8]]:255})),e}const m=(t,e)=>t<255?e(t):"";function b(t){var e=g(t)?d:u;return t?"#"+e(t.r)+e(t.g)+e(t.b)+m(t.a,e):void 0}const x=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function _(t,e,i){const s=e*Math.min(i,1-i),n=(e,n=(e+t/30)%12)=>i-s*Math.max(Math.min(n-3,9-n,1),-1);return[n(0),n(8),n(4)]}function y(t,e,i){const s=(s,n=(s+t/60)%6)=>i-i*e*Math.max(Math.min(n,4-n,1),0);return[s(5),s(3),s(1)]}function v(t,e,i){const s=_(t,1,.5);let n;for(e+i>1&&(n=1/(e+i),e*=n,i*=n),n=0;n<3;n++)s[n]*=1-e-i,s[n]+=e;return s}function M(t,e,i,s,n){return t===n?(e-i)/s+(e.5?c/(2-o-a):c/(o+a),h=M(i,s,n,c,o),h=60*h+.5),[0|h,l||0,r]}function k(t,e,i,s){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,i,s)).map(a)}function S(t,e,i){return k(_,t,e,i)}function P(t,e,i){return k(v,t,e,i)}function O(t,e,i){return k(y,t,e,i)}function A(t){return(t%360+360)%360}function D(t){const e=x.exec(t);let i,s=255;if(!e)return;e[5]!==i&&(s=e[6]?o(+e[5]):a(+e[5]));const n=A(+e[2]),r=+e[3]/100,h=+e[4]/100;return i="hwb"===e[1]?P(n,r,h):"hsv"===e[1]?O(n,r,h):S(n,r,h),{r:i[0],g:i[1],b:i[2],a:s}}function C(t,e){var i=w(t);i[0]=A(i[0]+e),i=S(i),t.r=i[0],t.g=i[1],t.b=i[2]}function T(t){if(!t)return;const e=w(t),i=e[0],s=h(e[1]),n=h(e[2]);return t.a<255?`hsla(${i}, ${s}%, ${n}%, ${r(t.a)})`:`hsl(${i}, ${s}%, ${n}%)`}const R={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"},E={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 L(){const t={},e=Object.keys(E),i=Object.keys(R);let s,n,o,a,r;for(s=0;s>16&255,o>>8&255,255&o]}return t}let I;function z(t){I||(I=L(),I.transparent=[0,0,0,0]);const e=I[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}const F=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function V(t){const e=F.exec(t);let i,s,a,r=255;if(e){if(e[7]!==i){const t=+e[7];r=e[8]?o(t):n(255*t,0,255)}return i=+e[1],s=+e[3],a=+e[5],i=255&(e[2]?o(i):n(i,0,255)),s=255&(e[4]?o(s):n(s,0,255)),a=255&(e[6]?o(a):n(a,0,255)),{r:i,g:s,b:a,a:r}}}function B(t){return t&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${r(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`)}const j=t=>t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055,W=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function N(t,e,i){const s=W(r(t.r)),n=W(r(t.g)),o=W(r(t.b));return{r:a(j(s+i*(W(r(e.r))-s))),g:a(j(n+i*(W(r(e.g))-n))),b:a(j(o+i*(W(r(e.b))-o))),a:t.a+i*(e.a-t.a)}}function H(t,e,i){if(t){let s=w(t);s[e]=Math.max(0,Math.min(s[e]+s[e]*i,0===e?360:1)),s=S(s),t.r=s[0],t.g=s[1],t.b=s[2]}}function $(t,e){return t?Object.assign(e||{},t):t}function Y(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=a(t[3]))):(e=$(t,{r:0,g:0,b:0,a:1}),e.a=a(e.a)),e}function U(t){return"r"===t.charAt(0)?V(t):D(t)}class X{constructor(t){if(t instanceof X)return t;const e=typeof t;let i;"object"===e?i=Y(t):"string"===e&&(i=p(t)||z(t)||U(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=$(this._rgb);return t&&(t.a=r(t.a)),t}set rgb(t){this._rgb=Y(t)}rgbString(){return this._valid?B(this._rgb):void 0}hexString(){return this._valid?b(this._rgb):void 0}hslString(){return this._valid?T(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,s=t.rgb;let n;const o=e===n?.5:e,a=2*o-1,r=i.a-s.a,h=((a*r===-1?a:(a+r)/(1+a*r))+1)/2;n=1-h,i.r=255&h*i.r+n*s.r+.5,i.g=255&h*i.g+n*s.g+.5,i.b=255&h*i.b+n*s.b+.5,i.a=o*i.a+(1-o)*s.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=N(this._rgb,t._rgb,e)),this}clone(){return new X(this.rgb)}alpha(t){return this._rgb.a=a(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=s(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){const e=this._rgb;return e.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return H(this._rgb,2,t),this}darken(t){return H(this._rgb,2,-t),this}saturate(t){return H(this._rgb,1,t),this}desaturate(t){return H(this._rgb,1,-t),this}rotate(t){return C(this._rgb,t),this}} +function s(t){return t+.5|0}i.d(e,{qi:function(){return sa},vn:function(){return Rs},ZL:function(){return fa},uw:function(){return Ga},kL:function(){return qo},wL:function(){return ka},f$:function(){return ir},tt:function(){return zs},Dx:function(){return Oa},u:function(){return Xa}});const n=(t,e,i)=>Math.max(Math.min(t,i),e);function o(t){return n(s(2.55*t),0,255)}function a(t){return n(s(255*t),0,255)}function r(t){return n(s(t/2.55)/100,0,1)}function h(t){return n(s(100*t),0,100)}const l={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},c=[..."0123456789ABCDEF"],d=t=>c[15&t],u=t=>c[(240&t)>>4]+c[15&t],f=t=>(240&t)>>4===(15&t),g=t=>f(t.r)&&f(t.g)&&f(t.b)&&f(t.a);function p(t){var e,i=t.length;return"#"===t[0]&&(4===i||5===i?e={r:255&17*l[t[1]],g:255&17*l[t[2]],b:255&17*l[t[3]],a:5===i?17*l[t[4]]:255}:7!==i&&9!==i||(e={r:l[t[1]]<<4|l[t[2]],g:l[t[3]]<<4|l[t[4]],b:l[t[5]]<<4|l[t[6]],a:9===i?l[t[7]]<<4|l[t[8]]:255})),e}const m=(t,e)=>t<255?e(t):"";function b(t){var e=g(t)?d:u;return t?"#"+e(t.r)+e(t.g)+e(t.b)+m(t.a,e):void 0}const x=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function _(t,e,i){const s=e*Math.min(i,1-i),n=(e,n=(e+t/30)%12)=>i-s*Math.max(Math.min(n-3,9-n,1),-1);return[n(0),n(8),n(4)]}function y(t,e,i){const s=(s,n=(s+t/60)%6)=>i-i*e*Math.max(Math.min(n,4-n,1),0);return[s(5),s(3),s(1)]}function v(t,e,i){const s=_(t,1,.5);let n;for(e+i>1&&(n=1/(e+i),e*=n,i*=n),n=0;n<3;n++)s[n]*=1-e-i,s[n]+=e;return s}function M(t,e,i,s,n){return t===n?(e-i)/s+(e.5?c/(2-o-a):c/(o+a),h=M(i,s,n,c,o),h=60*h+.5),[0|h,l||0,r]}function k(t,e,i,s){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,i,s)).map(a)}function S(t,e,i){return k(_,t,e,i)}function P(t,e,i){return k(v,t,e,i)}function O(t,e,i){return k(y,t,e,i)}function A(t){return(t%360+360)%360}function D(t){const e=x.exec(t);let i,s=255;if(!e)return;e[5]!==i&&(s=e[6]?o(+e[5]):a(+e[5]));const n=A(+e[2]),r=+e[3]/100,h=+e[4]/100;return i="hwb"===e[1]?P(n,r,h):"hsv"===e[1]?O(n,r,h):S(n,r,h),{r:i[0],g:i[1],b:i[2],a:s}}function C(t,e){var i=w(t);i[0]=A(i[0]+e),i=S(i),t.r=i[0],t.g=i[1],t.b=i[2]}function T(t){if(!t)return;const e=w(t),i=e[0],s=h(e[1]),n=h(e[2]);return t.a<255?`hsla(${i}, ${s}%, ${n}%, ${r(t.a)})`:`hsl(${i}, ${s}%, ${n}%)`}const R={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"},E={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 L(){const t={},e=Object.keys(E),i=Object.keys(R);let s,n,o,a,r;for(s=0;s>16&255,o>>8&255,255&o]}return t}let I;function z(t){I||(I=L(),I.transparent=[0,0,0,0]);const e=I[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}const F=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function V(t){const e=F.exec(t);let i,s,a,r=255;if(e){if(e[7]!==i){const t=+e[7];r=e[8]?o(t):n(255*t,0,255)}return i=+e[1],s=+e[3],a=+e[5],i=255&(e[2]?o(i):n(i,0,255)),s=255&(e[4]?o(s):n(s,0,255)),a=255&(e[6]?o(a):n(a,0,255)),{r:i,g:s,b:a,a:r}}}function B(t){return t&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${r(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`)}const j=t=>t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055,W=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function N(t,e,i){const s=W(r(t.r)),n=W(r(t.g)),o=W(r(t.b));return{r:a(j(s+i*(W(r(e.r))-s))),g:a(j(n+i*(W(r(e.g))-n))),b:a(j(o+i*(W(r(e.b))-o))),a:t.a+i*(e.a-t.a)}}function H(t,e,i){if(t){let s=w(t);s[e]=Math.max(0,Math.min(s[e]+s[e]*i,0===e?360:1)),s=S(s),t.r=s[0],t.g=s[1],t.b=s[2]}}function $(t,e){return t?Object.assign(e||{},t):t}function Y(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=a(t[3]))):(e=$(t,{r:0,g:0,b:0,a:1}),e.a=a(e.a)),e}function U(t){return"r"===t.charAt(0)?V(t):D(t)}class X{constructor(t){if(t instanceof X)return t;const e=typeof t;let i;"object"===e?i=Y(t):"string"===e&&(i=p(t)||z(t)||U(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=$(this._rgb);return t&&(t.a=r(t.a)),t}set rgb(t){this._rgb=Y(t)}rgbString(){return this._valid?B(this._rgb):void 0}hexString(){return this._valid?b(this._rgb):void 0}hslString(){return this._valid?T(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,s=t.rgb;let n;const o=e===n?.5:e,a=2*o-1,r=i.a-s.a,h=((a*r===-1?a:(a+r)/(1+a*r))+1)/2;n=1-h,i.r=255&h*i.r+n*s.r+.5,i.g=255&h*i.g+n*s.g+.5,i.b=255&h*i.b+n*s.b+.5,i.a=o*i.a+(1-o)*s.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=N(this._rgb,t._rgb,e)),this}clone(){return new X(this.rgb)}alpha(t){return this._rgb.a=a(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=s(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){const e=this._rgb;return e.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return H(this._rgb,2,t),this}darken(t){return H(this._rgb,2,-t),this}saturate(t){return H(this._rgb,1,t),this}desaturate(t){return H(this._rgb,1,-t),this}rotate(t){return C(this._rgb,t),this}} /*! - * Chart.js v4.3.3 + * Chart.js v4.4.0 * https://www.chartjs.org * (c) 2023 Chart.js Contributors * Released under the MIT License */ -function q(){}const K=(()=>{let t=0;return()=>t++})();function Z(t){return null===t||"undefined"===typeof t}function Q(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return"[object"===e.slice(0,7)&&"Array]"===e.slice(-6)}function G(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}function J(t){return("number"===typeof t||t instanceof Number)&&isFinite(+t)}function tt(t,e){return J(t)?t:e}function et(t,e){return"undefined"===typeof t?e:t}const it=(t,e)=>"string"===typeof t&&t.endsWith("%")?parseFloat(t)/100:+t/e,st=(t,e)=>"string"===typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function nt(t,e,i){if(t&&"function"===typeof t.call)return t.apply(i,e)}function ot(t,e,i,s){let n,o,a;if(Q(t))if(o=t.length,s)for(n=o-1;n>=0;n--)e.call(i,t[n],n);else for(n=0;nt,x:t=>t.x,y:t=>t.y};function gt(t){const e=t.split("."),i=[];let s="";for(const n of e)s+=n,s.endsWith("\\")?s=s.slice(0,-1)+".":(i.push(s),s="");return i}function pt(t){const e=gt(t);return t=>{for(const i of e){if(""===i)break;t=t&&t[i]}return t}}function mt(t,e){const i=ft[e]||(ft[e]=pt(e));return i(t)}function bt(t){return t.charAt(0).toUpperCase()+t.slice(1)}const xt=t=>"undefined"!==typeof t,_t=t=>"function"===typeof t,yt=(t,e)=>{if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0};function vt(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}const Mt=Math.PI,wt=2*Mt,kt=Number.POSITIVE_INFINITY,St=Mt/180,Pt=Mt/2,Ot=Mt/4,At=2*Mt/3,Dt=Math.log10,Ct=Math.sign;function Tt(t,e,i){return Math.abs(t-e)t-e)).pop(),e}function Lt(t){return!isNaN(parseFloat(t))&&isFinite(t)}function It(t,e){const i=Math.round(t);return i-e<=t&&i+e>=t}function zt(t,e,i){let s,n,o;for(s=0,n=t.length;sh&&l=Math.min(e,i)-s&&t<=Math.max(e,i)+s}function Xt(t,e,i){i=i||(i=>t[i]1)s=o+n>>1,i(s)?o=s:n=s;return{lo:o,hi:n}}const qt=(t,e,i,s)=>Xt(t,i,s?s=>{const n=t[s][e];return nt[s][e]Xt(t,i,(s=>t[s][e]>=i));function Zt(t,e,i){let s=0,n=t.length;while(ss&&t[n-1]>i)n--;return s>0||n{const i="_onData"+bt(e),s=t[e];Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value(...e){const n=s.apply(this,e);return t._chartjs.listeners.forEach((t=>{"function"===typeof t[i]&&t[i](...e)})),n}})})))}function Jt(t,e){const i=t._chartjs;if(!i)return;const s=i.listeners,n=s.indexOf(e);-1!==n&&s.splice(n,1),s.length>0||(Qt.forEach((e=>{delete t[e]})),delete t._chartjs)}function te(t){const e=new Set(t);return e.size===t.length?t:Array.from(e)}const ee=function(){return"undefined"===typeof window?function(t){return t()}:window.requestAnimationFrame}();function ie(t,e){let i=[],s=!1;return function(...n){i=n,s||(s=!0,ee.call(window,(()=>{s=!1,t.apply(e,i)})))}}function se(t,e){let i;return function(...s){return e?(clearTimeout(i),i=setTimeout(t,e,s)):t.apply(this,s),e}}const ne=t=>"start"===t?"left":"end"===t?"right":"center",oe=(t,e,i)=>"start"===t?e:"end"===t?i:(e+i)/2;const ae=t=>0===t||1===t,re=(t,e,i)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*wt/i),he=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*wt/i)+1,le={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.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/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*Pt),easeOutSine:t=>Math.sin(t*Pt),easeInOutSine:t=>-.5*(Math.cos(Mt*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>ae(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>ae(t)?t:re(t,.075,.3),easeOutElastic:t=>ae(t)?t:he(t,.075,.3),easeInOutElastic(t){const e=.1125,i=.45;return ae(t)?t:t<.5?.5*re(2*t,e,i):.5+.5*he(2*t-1,e,i)},easeInBack(t){const e=1.70158;return t*t*((e+1)*t-e)},easeOutBack(t){const e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:t=>1-le.easeOutBounce(1-t),easeOutBounce(t){const e=7.5625,i=2.75;return t<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375},easeInOutBounce:t=>t<.5?.5*le.easeInBounce(2*t):.5*le.easeOutBounce(2*t-1)+.5};function ce(t){if(t&&"object"===typeof t){const e=t.toString();return"[object CanvasPattern]"===e||"[object CanvasGradient]"===e}return!1}function de(t){return ce(t)?t:new X(t)}function ue(t){return ce(t)?t:new X(t).saturate(.5).darken(.1).hexString()}const fe=["x","y","borderWidth","radius","tension"],ge=["color","borderColor","backgroundColor"];function pe(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),t.set("animations",{colors:{type:"color",properties:ge},numbers:{type:"number",properties:fe}}),t.describe("animations",{_fallback:"animation"}),t.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:t=>0|t}}}})}function me(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const be=new Map;function xe(t,e){e=e||{};const i=t+JSON.stringify(e);let s=be.get(i);return s||(s=new Intl.NumberFormat(t,e),be.set(i,s)),s}function _e(t,e,i){return xe(e,i).format(t)}const ye={values(t){return Q(t)?t:""+t},numeric(t,e,i){if(0===t)return"0";const s=this.chart.options.locale;let n,o=t;if(i.length>1){const e=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(e<1e-4||e>1e15)&&(n="scientific"),o=ve(t,i)}const a=Dt(Math.abs(o)),r=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),h={notation:n,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(h,this.options.ticks.format),_e(t,s,h)},logarithmic(t,e,i){if(0===t)return"0";const s=i[e].significand||t/Math.pow(10,Math.floor(Dt(t)));return[1,2,3,5,10,15].includes(s)||e>.8*i.length?ye.numeric.call(this,t,e,i):""}};function ve(t,e){let i=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(i)>=1&&t!==Math.floor(t)&&(i=t-Math.floor(t)),i}var Me={formatters:ye};function we(t){t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.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:Me.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t&&"dash"!==t}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t})}const ke=Object.create(null),Se=Object.create(null);function Pe(t,e){if(!e)return t;const i=e.split(".");for(let s=0,n=i.length;st.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=(t,e)=>ue(e.backgroundColor),this.hoverBorderColor=(t,e)=>ue(e.borderColor),this.hoverColor=(t,e)=>ue(e.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(t),this.apply(e)}set(t,e){return Oe(this,t,e)}get(t){return Pe(this,t)}describe(t,e){return Oe(Se,t,e)}override(t,e){return Oe(ke,t,e)}route(t,e,i,s){const n=Pe(this,t),o=Pe(this,i),a="_"+e;Object.defineProperties(n,{[a]:{value:n[e],writable:!0},[e]:{enumerable:!0,get(){const t=this[a],e=o[s];return G(t)?Object.assign({},e,t):et(t,e)},set(t){this[a]=t}}})}apply(t){t.forEach((t=>t(this)))}}var De=new Ae({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[pe,me,we]);function Ce(t){return!t||Z(t.size)||Z(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function Te(t,e,i,s,n){let o=e[n];return o||(o=e[n]=t.measureText(n).width,i.push(n)),o>s&&(s=o),s}function Re(t,e,i){const s=t.currentDevicePixelRatio,n=0!==i?Math.max(i/2,.5):0;return Math.round((e-n)*s)/s+n}function Ee(t,e){e=e||t.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore()}function Le(t,e,i,s){Ie(t,e,i,s,null)}function Ie(t,e,i,s,n){let o,a,r,h,l,c,d,u;const f=e.pointStyle,g=e.rotation,p=e.radius;let m=(g||0)*St;if(f&&"object"===typeof f&&(o=f.toString(),"[object HTMLImageElement]"===o||"[object HTMLCanvasElement]"===o))return t.save(),t.translate(i,s),t.rotate(m),t.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),void t.restore();if(!(isNaN(p)||p<=0)){switch(t.beginPath(),f){default:n?t.ellipse(i,s,n/2,p,0,0,wt):t.arc(i,s,p,0,wt),t.closePath();break;case"triangle":c=n?n/2:p,t.moveTo(i+Math.sin(m)*c,s-Math.cos(m)*p),m+=At,t.lineTo(i+Math.sin(m)*c,s-Math.cos(m)*p),m+=At,t.lineTo(i+Math.sin(m)*c,s-Math.cos(m)*p),t.closePath();break;case"rectRounded":l=.516*p,h=p-l,a=Math.cos(m+Ot)*h,d=Math.cos(m+Ot)*(n?n/2-l:h),r=Math.sin(m+Ot)*h,u=Math.sin(m+Ot)*(n?n/2-l:h),t.arc(i-d,s-r,l,m-Mt,m-Pt),t.arc(i+u,s-a,l,m-Pt,m),t.arc(i+d,s+r,l,m,m+Pt),t.arc(i-u,s+a,l,m+Pt,m+Mt),t.closePath();break;case"rect":if(!g){h=Math.SQRT1_2*p,c=n?n/2:h,t.rect(i-c,s-h,2*c,2*h);break}m+=Ot;case"rectRot":d=Math.cos(m)*(n?n/2:p),a=Math.cos(m)*p,r=Math.sin(m)*p,u=Math.sin(m)*(n?n/2:p),t.moveTo(i-d,s-r),t.lineTo(i+u,s-a),t.lineTo(i+d,s+r),t.lineTo(i-u,s+a),t.closePath();break;case"crossRot":m+=Ot;case"cross":d=Math.cos(m)*(n?n/2:p),a=Math.cos(m)*p,r=Math.sin(m)*p,u=Math.sin(m)*(n?n/2:p),t.moveTo(i-d,s-r),t.lineTo(i+d,s+r),t.moveTo(i+u,s-a),t.lineTo(i-u,s+a);break;case"star":d=Math.cos(m)*(n?n/2:p),a=Math.cos(m)*p,r=Math.sin(m)*p,u=Math.sin(m)*(n?n/2:p),t.moveTo(i-d,s-r),t.lineTo(i+d,s+r),t.moveTo(i+u,s-a),t.lineTo(i-u,s+a),m+=Ot,d=Math.cos(m)*(n?n/2:p),a=Math.cos(m)*p,r=Math.sin(m)*p,u=Math.sin(m)*(n?n/2:p),t.moveTo(i-d,s-r),t.lineTo(i+d,s+r),t.moveTo(i+u,s-a),t.lineTo(i-u,s+a);break;case"line":a=n?n/2:Math.cos(m)*p,r=Math.sin(m)*p,t.moveTo(i-a,s-r),t.lineTo(i+a,s+r);break;case"dash":t.moveTo(i,s),t.lineTo(i+Math.cos(m)*(n?n/2:p),s+Math.sin(m)*p);break;case!1:t.closePath();break}t.fill(),e.borderWidth>0&&t.stroke()}}function ze(t,e,i){return i=i||.5,!e||t&&t.x>e.left-i&&t.xe.top-i&&t.y0&&""!==o.strokeColor;let h,l;for(t.save(),t.font=n.string,Be(t,o),h=0;h+t||0;function qe(t,e){const i={},s=G(e),n=s?Object.keys(e):e,o=G(t)?s?i=>et(t[i],t[e[i]]):e=>t[e]:()=>t;for(const a of n)i[a]=Xe(o(a));return i}function Ke(t){return qe(t,{top:"y",right:"x",bottom:"y",left:"x"})}function Ze(t){return qe(t,["topLeft","topRight","bottomLeft","bottomRight"])}function Qe(t){const e=Ke(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function Ge(t,e){t=t||{},e=e||De.font;let i=et(t.size,e.size);"string"===typeof i&&(i=parseInt(i,10));let s=et(t.style,e.style);s&&!(""+s).match(Ye)&&(console.warn('Invalid font style specified: "'+s+'"'),s=void 0);const n={family:et(t.family,e.family),lineHeight:Ue(et(t.lineHeight,e.lineHeight),i),size:i,style:s,weight:et(t.weight,e.weight),string:""};return n.string=Ce(n),n}function Je(t,e,i,s){let n,o,a,r=!0;for(n=0,o=t.length;ni&&0===t?0:t+e;return{min:a(s,-Math.abs(o)),max:a(n,o)}}function ei(t,e){return Object.assign(Object.create(t),e)}function ii(t,e=[""],i,s,n=(()=>t[0])){const o=i||t;"undefined"===typeof s&&(s=xi("_fallback",t));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:o,_fallback:s,_getTarget:n,override:i=>ii([i,...t],e,o,s)};return new Proxy(a,{deleteProperty(e,i){return delete e[i],delete e._keys,delete t[0][i],!0},get(i,s){return ri(i,s,(()=>bi(s,e,t,i)))},getOwnPropertyDescriptor(t,e){return Reflect.getOwnPropertyDescriptor(t._scopes[0],e)},getPrototypeOf(){return Reflect.getPrototypeOf(t[0])},has(t,e){return _i(t).includes(e)},ownKeys(t){return _i(t)},set(t,e,i){const s=t._storage||(t._storage=n());return t[e]=s[e]=i,delete t._keys,!0}})}function si(t,e,i,s){const n={_cacheable:!1,_proxy:t,_context:e,_subProxy:i,_stack:new Set,_descriptors:ni(t,s),setContext:e=>si(t,e,i,s),override:n=>si(t.override(n),e,i,s)};return new Proxy(n,{deleteProperty(e,i){return delete e[i],delete t[i],!0},get(t,e,i){return ri(t,e,(()=>hi(t,e,i)))},getOwnPropertyDescriptor(e,i){return e._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i)},getPrototypeOf(){return Reflect.getPrototypeOf(t)},has(e,i){return Reflect.has(t,i)},ownKeys(){return Reflect.ownKeys(t)},set(e,i,s){return t[i]=s,delete e[i],!0}})}function ni(t,e={scriptable:!0,indexable:!0}){const{_scriptable:i=e.scriptable,_indexable:s=e.indexable,_allKeys:n=e.allKeys}=t;return{allKeys:n,scriptable:i,indexable:s,isScriptable:_t(i)?i:()=>i,isIndexable:_t(s)?s:()=>s}}const oi=(t,e)=>t?t+bt(e):e,ai=(t,e)=>G(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function ri(t,e,i){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];const s=i();return t[e]=s,s}function hi(t,e,i){const{_proxy:s,_context:n,_subProxy:o,_descriptors:a}=t;let r=s[e];return _t(r)&&a.isScriptable(e)&&(r=li(e,r,t,i)),Q(r)&&r.length&&(r=ci(e,r,t,a.isIndexable)),ai(e,r)&&(r=si(r,n,o&&o[e],a)),r}function li(t,e,i,s){const{_proxy:n,_context:o,_subProxy:a,_stack:r}=i;if(r.has(t))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+t);r.add(t);let h=e(o,a||s);return r.delete(t),ai(t,h)&&(h=gi(n._scopes,n,t,h)),h}function ci(t,e,i,s){const{_proxy:n,_context:o,_subProxy:a,_descriptors:r}=i;if("undefined"!==typeof o.index&&s(t))return e[o.index%e.length];if(G(e[0])){const i=e,s=n._scopes.filter((t=>t!==i));e=[];for(const h of i){const i=gi(s,n,t,h);e.push(si(i,o,a&&a[t],r))}}return e}function di(t,e,i){return _t(t)?t(e,i):t}const ui=(t,e)=>!0===t?e:"string"===typeof t?mt(e,t):void 0;function fi(t,e,i,s,n){for(const o of e){const e=ui(i,o);if(e){t.add(e);const o=di(e._fallback,i,n);if("undefined"!==typeof o&&o!==i&&o!==s)return o}else if(!1===e&&"undefined"!==typeof s&&i!==s)return null}return!1}function gi(t,e,i,s){const n=e._rootScopes,o=di(e._fallback,i,s),a=[...t,...n],r=new Set;r.add(s);let h=pi(r,a,i,o||i,s);return null!==h&&(("undefined"===typeof o||o===i||(h=pi(r,a,o,h,s),null!==h))&&ii(Array.from(r),[""],n,o,(()=>mi(e,i,s))))}function pi(t,e,i,s,n){while(i)i=fi(t,e,i,s,n);return i}function mi(t,e,i){const s=t._getTarget();e in s||(s[e]={});const n=s[e];return Q(n)&&G(i)?i:n||{}}function bi(t,e,i,s){let n;for(const o of e)if(n=xi(oi(o,t),i),"undefined"!==typeof n)return ai(t,n)?gi(i,s,t,n):n}function xi(t,e){for(const i of e){if(!i)continue;const e=i[t];if("undefined"!==typeof e)return e}}function _i(t){let e=t._keys;return e||(e=t._keys=yi(t._scopes)),e}function yi(t){const e=new Set;for(const i of t)for(const t of Object.keys(i).filter((t=>!t.startsWith("_"))))e.add(t);return Array.from(e)}function vi(t,e,i,s){const{iScale:n}=t,{key:o="r"}=this._parsing,a=new Array(s);let r,h,l,c;for(r=0,h=s;rt.ownerDocument.defaultView.getComputedStyle(t,null);function Pi(t,e){return Si(t).getPropertyValue(e)}const Oi=["top","right","bottom","left"];function Ai(t,e,i){const s={};i=i?"-"+i:"";for(let n=0;n<4;n++){const o=Oi[n];s[o]=parseFloat(t[e+"-"+o+i])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}const Di=(t,e,i)=>(t>0||e>0)&&(!i||!i.shadowRoot);function Ci(t,e){const i=t.touches,s=i&&i.length?i[0]:t,{offsetX:n,offsetY:o}=s;let a,r,h=!1;if(Di(n,o,t.target))a=n,r=o;else{const t=e.getBoundingClientRect();a=s.clientX-t.left,r=s.clientY-t.top,h=!0}return{x:a,y:r,box:h}}function Ti(t,e){if("native"in t)return t;const{canvas:i,currentDevicePixelRatio:s}=e,n=Si(i),o="border-box"===n.boxSizing,a=Ai(n,"padding"),r=Ai(n,"border","width"),{x:h,y:l,box:c}=Ci(t,i),d=a.left+(c&&r.left),u=a.top+(c&&r.top);let{width:f,height:g}=e;return o&&(f-=a.width+r.width,g-=a.height+r.height),{x:Math.round((h-d)/f*i.width/s),y:Math.round((l-u)/g*i.height/s)}}function Ri(t,e,i){let s,n;if(void 0===e||void 0===i){const o=wi(t);if(o){const t=o.getBoundingClientRect(),a=Si(o),r=Ai(a,"border","width"),h=Ai(a,"padding");e=t.width-h.width-r.width,i=t.height-h.height-r.height,s=ki(a.maxWidth,o,"clientWidth"),n=ki(a.maxHeight,o,"clientHeight")}else e=t.clientWidth,i=t.clientHeight}return{width:e,height:i,maxWidth:s||kt,maxHeight:n||kt}}const Ei=t=>Math.round(10*t)/10;function Li(t,e,i,s){const n=Si(t),o=Ai(n,"margin"),a=ki(n.maxWidth,t,"clientWidth")||kt,r=ki(n.maxHeight,t,"clientHeight")||kt,h=Ri(t,e,i);let{width:l,height:c}=h;if("content-box"===n.boxSizing){const t=Ai(n,"border","width"),e=Ai(n,"padding");l-=e.width+t.width,c-=e.height+t.height}l=Math.max(0,l-o.width),c=Math.max(0,s?l/s:c-o.height),l=Ei(Math.min(l,a,h.maxWidth)),c=Ei(Math.min(c,r,h.maxHeight)),l&&!c&&(c=Ei(l/2));const d=void 0!==e||void 0!==i;return d&&s&&h.height&&c>h.height&&(c=h.height,l=Ei(Math.floor(c*s))),{width:l,height:c}}function Ii(t,e,i){const s=e||1,n=Math.floor(t.height*s),o=Math.floor(t.width*s);t.height=Math.floor(t.height),t.width=Math.floor(t.width);const a=t.canvas;return a.style&&(i||!a.style.height&&!a.style.width)&&(a.style.height=`${t.height}px`,a.style.width=`${t.width}px`),(t.currentDevicePixelRatio!==s||a.height!==n||a.width!==o)&&(t.currentDevicePixelRatio=s,a.height=n,a.width=o,t.ctx.setTransform(s,0,0,s,0,0),!0)}const zi=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(e){}return t}();function Fi(t,e){const i=Pi(t,e),s=i&&i.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}const Vi=function(t,e){return{x(i){return t+t+e-i},setWidth(t){e=t},textAlign(t){return"center"===t?t:"right"===t?"left":"right"},xPlus(t,e){return t-e},leftForLtr(t,e){return t-e}}},Bi=function(){return{x(t){return t},setWidth(t){},textAlign(t){return t},xPlus(t,e){return t+e},leftForLtr(t,e){return t}}};function ji(t,e,i){return t?Vi(e,i):Bi()}function Wi(t,e){let i,s;"ltr"!==e&&"rtl"!==e||(i=t.canvas.style,s=[i.getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=s)}function Ni(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))} +function q(){}const K=(()=>{let t=0;return()=>t++})();function Z(t){return null===t||"undefined"===typeof t}function Q(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return"[object"===e.slice(0,7)&&"Array]"===e.slice(-6)}function G(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}function J(t){return("number"===typeof t||t instanceof Number)&&isFinite(+t)}function tt(t,e){return J(t)?t:e}function et(t,e){return"undefined"===typeof t?e:t}const it=(t,e)=>"string"===typeof t&&t.endsWith("%")?parseFloat(t)/100:+t/e,st=(t,e)=>"string"===typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function nt(t,e,i){if(t&&"function"===typeof t.call)return t.apply(i,e)}function ot(t,e,i,s){let n,o,a;if(Q(t))if(o=t.length,s)for(n=o-1;n>=0;n--)e.call(i,t[n],n);else for(n=0;nt,x:t=>t.x,y:t=>t.y};function gt(t){const e=t.split("."),i=[];let s="";for(const n of e)s+=n,s.endsWith("\\")?s=s.slice(0,-1)+".":(i.push(s),s="");return i}function pt(t){const e=gt(t);return t=>{for(const i of e){if(""===i)break;t=t&&t[i]}return t}}function mt(t,e){const i=ft[e]||(ft[e]=pt(e));return i(t)}function bt(t){return t.charAt(0).toUpperCase()+t.slice(1)}const xt=t=>"undefined"!==typeof t,_t=t=>"function"===typeof t,yt=(t,e)=>{if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0};function vt(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}const Mt=Math.PI,wt=2*Mt,kt=Number.POSITIVE_INFINITY,St=Mt/180,Pt=Mt/2,Ot=Mt/4,At=2*Mt/3,Dt=Math.log10,Ct=Math.sign;function Tt(t,e,i){return Math.abs(t-e)t-e)).pop(),e}function Lt(t){return!isNaN(parseFloat(t))&&isFinite(t)}function It(t,e){const i=Math.round(t);return i-e<=t&&i+e>=t}function zt(t,e,i){let s,n,o;for(s=0,n=t.length;sh&&l=Math.min(e,i)-s&&t<=Math.max(e,i)+s}function Xt(t,e,i){i=i||(i=>t[i]1)s=o+n>>1,i(s)?o=s:n=s;return{lo:o,hi:n}}const qt=(t,e,i,s)=>Xt(t,i,s?s=>{const n=t[s][e];return nt[s][e]Xt(t,i,(s=>t[s][e]>=i));function Zt(t,e,i){let s=0,n=t.length;while(ss&&t[n-1]>i)n--;return s>0||n{const i="_onData"+bt(e),s=t[e];Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value(...e){const n=s.apply(this,e);return t._chartjs.listeners.forEach((t=>{"function"===typeof t[i]&&t[i](...e)})),n}})})))}function Jt(t,e){const i=t._chartjs;if(!i)return;const s=i.listeners,n=s.indexOf(e);-1!==n&&s.splice(n,1),s.length>0||(Qt.forEach((e=>{delete t[e]})),delete t._chartjs)}function te(t){const e=new Set(t);return e.size===t.length?t:Array.from(e)}const ee=function(){return"undefined"===typeof window?function(t){return t()}:window.requestAnimationFrame}();function ie(t,e){let i=[],s=!1;return function(...n){i=n,s||(s=!0,ee.call(window,(()=>{s=!1,t.apply(e,i)})))}}function se(t,e){let i;return function(...s){return e?(clearTimeout(i),i=setTimeout(t,e,s)):t.apply(this,s),e}}const ne=t=>"start"===t?"left":"end"===t?"right":"center",oe=(t,e,i)=>"start"===t?e:"end"===t?i:(e+i)/2;const ae=t=>0===t||1===t,re=(t,e,i)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*wt/i),he=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*wt/i)+1,le={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.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/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*Pt),easeOutSine:t=>Math.sin(t*Pt),easeInOutSine:t=>-.5*(Math.cos(Mt*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>ae(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>ae(t)?t:re(t,.075,.3),easeOutElastic:t=>ae(t)?t:he(t,.075,.3),easeInOutElastic(t){const e=.1125,i=.45;return ae(t)?t:t<.5?.5*re(2*t,e,i):.5+.5*he(2*t-1,e,i)},easeInBack(t){const e=1.70158;return t*t*((e+1)*t-e)},easeOutBack(t){const e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:t=>1-le.easeOutBounce(1-t),easeOutBounce(t){const e=7.5625,i=2.75;return t<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375},easeInOutBounce:t=>t<.5?.5*le.easeInBounce(2*t):.5*le.easeOutBounce(2*t-1)+.5};function ce(t){if(t&&"object"===typeof t){const e=t.toString();return"[object CanvasPattern]"===e||"[object CanvasGradient]"===e}return!1}function de(t){return ce(t)?t:new X(t)}function ue(t){return ce(t)?t:new X(t).saturate(.5).darken(.1).hexString()}const fe=["x","y","borderWidth","radius","tension"],ge=["color","borderColor","backgroundColor"];function pe(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),t.set("animations",{colors:{type:"color",properties:ge},numbers:{type:"number",properties:fe}}),t.describe("animations",{_fallback:"animation"}),t.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:t=>0|t}}}})}function me(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const be=new Map;function xe(t,e){e=e||{};const i=t+JSON.stringify(e);let s=be.get(i);return s||(s=new Intl.NumberFormat(t,e),be.set(i,s)),s}function _e(t,e,i){return xe(e,i).format(t)}const ye={values(t){return Q(t)?t:""+t},numeric(t,e,i){if(0===t)return"0";const s=this.chart.options.locale;let n,o=t;if(i.length>1){const e=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(e<1e-4||e>1e15)&&(n="scientific"),o=ve(t,i)}const a=Dt(Math.abs(o)),r=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),h={notation:n,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(h,this.options.ticks.format),_e(t,s,h)},logarithmic(t,e,i){if(0===t)return"0";const s=i[e].significand||t/Math.pow(10,Math.floor(Dt(t)));return[1,2,3,5,10,15].includes(s)||e>.8*i.length?ye.numeric.call(this,t,e,i):""}};function ve(t,e){let i=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(i)>=1&&t!==Math.floor(t)&&(i=t-Math.floor(t)),i}var Me={formatters:ye};function we(t){t.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:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.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:Me.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t&&"dash"!==t}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t})}const ke=Object.create(null),Se=Object.create(null);function Pe(t,e){if(!e)return t;const i=e.split(".");for(let s=0,n=i.length;st.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=(t,e)=>ue(e.backgroundColor),this.hoverBorderColor=(t,e)=>ue(e.borderColor),this.hoverColor=(t,e)=>ue(e.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(t),this.apply(e)}set(t,e){return Oe(this,t,e)}get(t){return Pe(this,t)}describe(t,e){return Oe(Se,t,e)}override(t,e){return Oe(ke,t,e)}route(t,e,i,s){const n=Pe(this,t),o=Pe(this,i),a="_"+e;Object.defineProperties(n,{[a]:{value:n[e],writable:!0},[e]:{enumerable:!0,get(){const t=this[a],e=o[s];return G(t)?Object.assign({},e,t):et(t,e)},set(t){this[a]=t}}})}apply(t){t.forEach((t=>t(this)))}}var De=new Ae({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[pe,me,we]);function Ce(t){return!t||Z(t.size)||Z(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function Te(t,e,i,s,n){let o=e[n];return o||(o=e[n]=t.measureText(n).width,i.push(n)),o>s&&(s=o),s}function Re(t,e,i){const s=t.currentDevicePixelRatio,n=0!==i?Math.max(i/2,.5):0;return Math.round((e-n)*s)/s+n}function Ee(t,e){e=e||t.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore()}function Le(t,e,i,s){Ie(t,e,i,s,null)}function Ie(t,e,i,s,n){let o,a,r,h,l,c,d,u;const f=e.pointStyle,g=e.rotation,p=e.radius;let m=(g||0)*St;if(f&&"object"===typeof f&&(o=f.toString(),"[object HTMLImageElement]"===o||"[object HTMLCanvasElement]"===o))return t.save(),t.translate(i,s),t.rotate(m),t.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),void t.restore();if(!(isNaN(p)||p<=0)){switch(t.beginPath(),f){default:n?t.ellipse(i,s,n/2,p,0,0,wt):t.arc(i,s,p,0,wt),t.closePath();break;case"triangle":c=n?n/2:p,t.moveTo(i+Math.sin(m)*c,s-Math.cos(m)*p),m+=At,t.lineTo(i+Math.sin(m)*c,s-Math.cos(m)*p),m+=At,t.lineTo(i+Math.sin(m)*c,s-Math.cos(m)*p),t.closePath();break;case"rectRounded":l=.516*p,h=p-l,a=Math.cos(m+Ot)*h,d=Math.cos(m+Ot)*(n?n/2-l:h),r=Math.sin(m+Ot)*h,u=Math.sin(m+Ot)*(n?n/2-l:h),t.arc(i-d,s-r,l,m-Mt,m-Pt),t.arc(i+u,s-a,l,m-Pt,m),t.arc(i+d,s+r,l,m,m+Pt),t.arc(i-u,s+a,l,m+Pt,m+Mt),t.closePath();break;case"rect":if(!g){h=Math.SQRT1_2*p,c=n?n/2:h,t.rect(i-c,s-h,2*c,2*h);break}m+=Ot;case"rectRot":d=Math.cos(m)*(n?n/2:p),a=Math.cos(m)*p,r=Math.sin(m)*p,u=Math.sin(m)*(n?n/2:p),t.moveTo(i-d,s-r),t.lineTo(i+u,s-a),t.lineTo(i+d,s+r),t.lineTo(i-u,s+a),t.closePath();break;case"crossRot":m+=Ot;case"cross":d=Math.cos(m)*(n?n/2:p),a=Math.cos(m)*p,r=Math.sin(m)*p,u=Math.sin(m)*(n?n/2:p),t.moveTo(i-d,s-r),t.lineTo(i+d,s+r),t.moveTo(i+u,s-a),t.lineTo(i-u,s+a);break;case"star":d=Math.cos(m)*(n?n/2:p),a=Math.cos(m)*p,r=Math.sin(m)*p,u=Math.sin(m)*(n?n/2:p),t.moveTo(i-d,s-r),t.lineTo(i+d,s+r),t.moveTo(i+u,s-a),t.lineTo(i-u,s+a),m+=Ot,d=Math.cos(m)*(n?n/2:p),a=Math.cos(m)*p,r=Math.sin(m)*p,u=Math.sin(m)*(n?n/2:p),t.moveTo(i-d,s-r),t.lineTo(i+d,s+r),t.moveTo(i+u,s-a),t.lineTo(i-u,s+a);break;case"line":a=n?n/2:Math.cos(m)*p,r=Math.sin(m)*p,t.moveTo(i-a,s-r),t.lineTo(i+a,s+r);break;case"dash":t.moveTo(i,s),t.lineTo(i+Math.cos(m)*(n?n/2:p),s+Math.sin(m)*p);break;case!1:t.closePath();break}t.fill(),e.borderWidth>0&&t.stroke()}}function ze(t,e,i){return i=i||.5,!e||t&&t.x>e.left-i&&t.xe.top-i&&t.y0&&""!==o.strokeColor;let h,l;for(t.save(),t.font=n.string,Be(t,o),h=0;h+t||0;function qe(t,e){const i={},s=G(e),n=s?Object.keys(e):e,o=G(t)?s?i=>et(t[i],t[e[i]]):e=>t[e]:()=>t;for(const a of n)i[a]=Xe(o(a));return i}function Ke(t){return qe(t,{top:"y",right:"x",bottom:"y",left:"x"})}function Ze(t){return qe(t,["topLeft","topRight","bottomLeft","bottomRight"])}function Qe(t){const e=Ke(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function Ge(t,e){t=t||{},e=e||De.font;let i=et(t.size,e.size);"string"===typeof i&&(i=parseInt(i,10));let s=et(t.style,e.style);s&&!(""+s).match(Ye)&&(console.warn('Invalid font style specified: "'+s+'"'),s=void 0);const n={family:et(t.family,e.family),lineHeight:Ue(et(t.lineHeight,e.lineHeight),i),size:i,style:s,weight:et(t.weight,e.weight),string:""};return n.string=Ce(n),n}function Je(t,e,i,s){let n,o,a,r=!0;for(n=0,o=t.length;ni&&0===t?0:t+e;return{min:a(s,-Math.abs(o)),max:a(n,o)}}function ei(t,e){return Object.assign(Object.create(t),e)}function ii(t,e=[""],i,s,n=(()=>t[0])){const o=i||t;"undefined"===typeof s&&(s=xi("_fallback",t));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:o,_fallback:s,_getTarget:n,override:i=>ii([i,...t],e,o,s)};return new Proxy(a,{deleteProperty(e,i){return delete e[i],delete e._keys,delete t[0][i],!0},get(i,s){return ri(i,s,(()=>bi(s,e,t,i)))},getOwnPropertyDescriptor(t,e){return Reflect.getOwnPropertyDescriptor(t._scopes[0],e)},getPrototypeOf(){return Reflect.getPrototypeOf(t[0])},has(t,e){return _i(t).includes(e)},ownKeys(t){return _i(t)},set(t,e,i){const s=t._storage||(t._storage=n());return t[e]=s[e]=i,delete t._keys,!0}})}function si(t,e,i,s){const n={_cacheable:!1,_proxy:t,_context:e,_subProxy:i,_stack:new Set,_descriptors:ni(t,s),setContext:e=>si(t,e,i,s),override:n=>si(t.override(n),e,i,s)};return new Proxy(n,{deleteProperty(e,i){return delete e[i],delete t[i],!0},get(t,e,i){return ri(t,e,(()=>hi(t,e,i)))},getOwnPropertyDescriptor(e,i){return e._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i)},getPrototypeOf(){return Reflect.getPrototypeOf(t)},has(e,i){return Reflect.has(t,i)},ownKeys(){return Reflect.ownKeys(t)},set(e,i,s){return t[i]=s,delete e[i],!0}})}function ni(t,e={scriptable:!0,indexable:!0}){const{_scriptable:i=e.scriptable,_indexable:s=e.indexable,_allKeys:n=e.allKeys}=t;return{allKeys:n,scriptable:i,indexable:s,isScriptable:_t(i)?i:()=>i,isIndexable:_t(s)?s:()=>s}}const oi=(t,e)=>t?t+bt(e):e,ai=(t,e)=>G(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function ri(t,e,i){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];const s=i();return t[e]=s,s}function hi(t,e,i){const{_proxy:s,_context:n,_subProxy:o,_descriptors:a}=t;let r=s[e];return _t(r)&&a.isScriptable(e)&&(r=li(e,r,t,i)),Q(r)&&r.length&&(r=ci(e,r,t,a.isIndexable)),ai(e,r)&&(r=si(r,n,o&&o[e],a)),r}function li(t,e,i,s){const{_proxy:n,_context:o,_subProxy:a,_stack:r}=i;if(r.has(t))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+t);r.add(t);let h=e(o,a||s);return r.delete(t),ai(t,h)&&(h=gi(n._scopes,n,t,h)),h}function ci(t,e,i,s){const{_proxy:n,_context:o,_subProxy:a,_descriptors:r}=i;if("undefined"!==typeof o.index&&s(t))return e[o.index%e.length];if(G(e[0])){const i=e,s=n._scopes.filter((t=>t!==i));e=[];for(const h of i){const i=gi(s,n,t,h);e.push(si(i,o,a&&a[t],r))}}return e}function di(t,e,i){return _t(t)?t(e,i):t}const ui=(t,e)=>!0===t?e:"string"===typeof t?mt(e,t):void 0;function fi(t,e,i,s,n){for(const o of e){const e=ui(i,o);if(e){t.add(e);const o=di(e._fallback,i,n);if("undefined"!==typeof o&&o!==i&&o!==s)return o}else if(!1===e&&"undefined"!==typeof s&&i!==s)return null}return!1}function gi(t,e,i,s){const n=e._rootScopes,o=di(e._fallback,i,s),a=[...t,...n],r=new Set;r.add(s);let h=pi(r,a,i,o||i,s);return null!==h&&(("undefined"===typeof o||o===i||(h=pi(r,a,o,h,s),null!==h))&&ii(Array.from(r),[""],n,o,(()=>mi(e,i,s))))}function pi(t,e,i,s,n){while(i)i=fi(t,e,i,s,n);return i}function mi(t,e,i){const s=t._getTarget();e in s||(s[e]={});const n=s[e];return Q(n)&&G(i)?i:n||{}}function bi(t,e,i,s){let n;for(const o of e)if(n=xi(oi(o,t),i),"undefined"!==typeof n)return ai(t,n)?gi(i,s,t,n):n}function xi(t,e){for(const i of e){if(!i)continue;const e=i[t];if("undefined"!==typeof e)return e}}function _i(t){let e=t._keys;return e||(e=t._keys=yi(t._scopes)),e}function yi(t){const e=new Set;for(const i of t)for(const t of Object.keys(i).filter((t=>!t.startsWith("_"))))e.add(t);return Array.from(e)}function vi(t,e,i,s){const{iScale:n}=t,{key:o="r"}=this._parsing,a=new Array(s);let r,h,l,c;for(r=0,h=s;rt.ownerDocument.defaultView.getComputedStyle(t,null);function Pi(t,e){return Si(t).getPropertyValue(e)}const Oi=["top","right","bottom","left"];function Ai(t,e,i){const s={};i=i?"-"+i:"";for(let n=0;n<4;n++){const o=Oi[n];s[o]=parseFloat(t[e+"-"+o+i])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}const Di=(t,e,i)=>(t>0||e>0)&&(!i||!i.shadowRoot);function Ci(t,e){const i=t.touches,s=i&&i.length?i[0]:t,{offsetX:n,offsetY:o}=s;let a,r,h=!1;if(Di(n,o,t.target))a=n,r=o;else{const t=e.getBoundingClientRect();a=s.clientX-t.left,r=s.clientY-t.top,h=!0}return{x:a,y:r,box:h}}function Ti(t,e){if("native"in t)return t;const{canvas:i,currentDevicePixelRatio:s}=e,n=Si(i),o="border-box"===n.boxSizing,a=Ai(n,"padding"),r=Ai(n,"border","width"),{x:h,y:l,box:c}=Ci(t,i),d=a.left+(c&&r.left),u=a.top+(c&&r.top);let{width:f,height:g}=e;return o&&(f-=a.width+r.width,g-=a.height+r.height),{x:Math.round((h-d)/f*i.width/s),y:Math.round((l-u)/g*i.height/s)}}function Ri(t,e,i){let s,n;if(void 0===e||void 0===i){const o=wi(t);if(o){const t=o.getBoundingClientRect(),a=Si(o),r=Ai(a,"border","width"),h=Ai(a,"padding");e=t.width-h.width-r.width,i=t.height-h.height-r.height,s=ki(a.maxWidth,o,"clientWidth"),n=ki(a.maxHeight,o,"clientHeight")}else e=t.clientWidth,i=t.clientHeight}return{width:e,height:i,maxWidth:s||kt,maxHeight:n||kt}}const Ei=t=>Math.round(10*t)/10;function Li(t,e,i,s){const n=Si(t),o=Ai(n,"margin"),a=ki(n.maxWidth,t,"clientWidth")||kt,r=ki(n.maxHeight,t,"clientHeight")||kt,h=Ri(t,e,i);let{width:l,height:c}=h;if("content-box"===n.boxSizing){const t=Ai(n,"border","width"),e=Ai(n,"padding");l-=e.width+t.width,c-=e.height+t.height}l=Math.max(0,l-o.width),c=Math.max(0,s?l/s:c-o.height),l=Ei(Math.min(l,a,h.maxWidth)),c=Ei(Math.min(c,r,h.maxHeight)),l&&!c&&(c=Ei(l/2));const d=void 0!==e||void 0!==i;return d&&s&&h.height&&c>h.height&&(c=h.height,l=Ei(Math.floor(c*s))),{width:l,height:c}}function Ii(t,e,i){const s=e||1,n=Math.floor(t.height*s),o=Math.floor(t.width*s);t.height=Math.floor(t.height),t.width=Math.floor(t.width);const a=t.canvas;return a.style&&(i||!a.style.height&&!a.style.width)&&(a.style.height=`${t.height}px`,a.style.width=`${t.width}px`),(t.currentDevicePixelRatio!==s||a.height!==n||a.width!==o)&&(t.currentDevicePixelRatio=s,a.height=n,a.width=o,t.ctx.setTransform(s,0,0,s,0,0),!0)}const zi=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(e){}return t}();function Fi(t,e){const i=Pi(t,e),s=i&&i.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}const Vi=function(t,e){return{x(i){return t+t+e-i},setWidth(t){e=t},textAlign(t){return"center"===t?t:"right"===t?"left":"right"},xPlus(t,e){return t-e},leftForLtr(t,e){return t-e}}},Bi=function(){return{x(t){return t},setWidth(t){},textAlign(t){return t},xPlus(t,e){return t+e},leftForLtr(t,e){return t}}};function ji(t,e,i){return t?Vi(e,i):Bi()}function Wi(t,e){let i,s;"ltr"!==e&&"rtl"!==e||(i=t.canvas.style,s=[i.getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=s)}function Ni(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))} /*! - * Chart.js v4.3.3 + * Chart.js v4.4.0 * https://www.chartjs.org * (c) 2023 Chart.js Contributors * Released under the MIT License */ -class Hi{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,s){const n=e.listeners[s],o=e.duration;n.forEach((s=>s({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(i-e.start,o)})))}_refresh(){this._request||(this._running=!0,this._request=ee.call(window,(()=>{this._update(),this._request=null,this._running&&this._refresh()})))}_update(t=Date.now()){let e=0;this._charts.forEach(((i,s)=>{if(!i.running||!i.items.length)return;const n=i.items;let o,a=n.length-1,r=!1;for(;a>=0;--a)o=n[a],o._active?(o._total>i.duration&&(i.duration=o._total),o.tick(t),r=!0):(n[a]=n[n.length-1],n.pop());r&&(s.draw(),this._notify(s,i,t,"progress")),n.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),e+=n.length})),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce(((t,e)=>Math.max(t,e._duration)),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!!(e&&e.running&&e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var $i=new Hi;const Yi="transparent",Ui={boolean(t,e,i){return i>.5?e:t},color(t,e,i){const s=de(t||Yi),n=s.valid&&de(e||Yi);return n&&n.valid?n.mix(s,i).hexString():e},number(t,e,i){return t+(e-t)*i}};class Xi{constructor(t,e,i,s){const n=e[i];s=Je([t.to,s,n,t.from]);const o=Je([t.from,n,s]);this._active=!0,this._fn=t.fn||Ui[t.type||typeof o],this._easing=le[t.easing]||le.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const s=this._target[this._prop],n=i-this._start,o=this._duration-n;this._start=i,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=n,this._loop=!!t.loop,this._to=Je([t.to,e,s,t.from]),this._from=Je([t.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,s=this._prop,n=this._from,o=this._loop,a=this._to;let r;if(this._active=n!==a&&(o||e1?2-r:r,r=this._easing(Math.min(1,Math.max(0,r))),this._target[s]=this._fn(n,a,r))}wait(){const t=this._promises||(this._promises=[]);return new Promise(((e,i)=>{t.push({res:e,rej:i})}))}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let s=0;s{const n=t[s];if(!G(n))return;const o={};for(const t of e)o[t]=n[t];(Q(n.properties)&&n.properties||[s]).forEach((t=>{t!==s&&i.has(t)||i.set(t,o)}))}))}_animateOptions(t,e){const i=e.options,s=Zi(t,i);if(!s)return[];const n=this._createAnimations(s,i);return i.$shared&&Ki(t.options.$animations,i).then((()=>{t.options=i}),(()=>{})),n}_createAnimations(t,e){const i=this._properties,s=[],n=t.$animations||(t.$animations={}),o=Object.keys(e),a=Date.now();let r;for(r=o.length-1;r>=0;--r){const h=o[r];if("$"===h.charAt(0))continue;if("options"===h){s.push(...this._animateOptions(t,e));continue}const l=e[h];let c=n[h];const d=i.get(h);if(c){if(d&&c.active()){c.update(d,l,a);continue}c.cancel()}d&&d.duration?(n[h]=c=new Xi(d,t,h,l),s.push(c)):t[h]=l}return s}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const i=this._createAnimations(t,e);return i.length?($i.add(this._chart,i),!0):void 0}}function Ki(t,e){const i=[],s=Object.keys(e);for(let n=0;n0||!i&&e<0)return n.index}return null}function hs(t,e){const{chart:i,_cachedMeta:s}=t,n=i._stacks||(i._stacks={}),{iScale:o,vScale:a,index:r}=s,h=o.axis,l=a.axis,c=ns(o,a,s),d=e.length;let u;for(let f=0;fi[t].axis===e)).shift()}function cs(t,e){return ei(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function ds(t,e,i){return ei(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:i,index:e,mode:"default",type:"data"})}function us(t,e){const i=t.controller.index,s=t.vScale&&t.vScale.axis;if(s){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[s]||void 0===e[s][i])return;delete e[s][i],void 0!==e[s]._visualValues&&void 0!==e[s]._visualValues[i]&&delete e[s]._visualValues[i]}}}const fs=t=>"reset"===t||"none"===t,gs=(t,e)=>e?t:Object.assign({},t),ps=(t,e,i)=>t&&!e.hidden&&e._stacked&&{keys:ts(i,!0),values:null};class ms{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,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(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=ss(t.vScale,t),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(t){this.index!==t&&us(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),s=(t,e,i,s)=>"x"===t?e:"r"===t?s:i,n=e.xAxisID=et(i.xAxisID,ls(t,"x")),o=e.yAxisID=et(i.yAxisID,ls(t,"y")),a=e.rAxisID=et(i.rAxisID,ls(t,"r")),r=e.indexAxis,h=e.iAxisID=s(r,n,o,a),l=e.vAxisID=s(r,o,n,a);e.xScale=this.getScaleForId(n),e.yScale=this.getScaleForId(o),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(h),e.vScale=this.getScaleForId(l)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Jt(this._data,this),t._stacked&&us(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(G(e))this._data=is(e);else if(i!==e){if(i){Jt(i,this);const t=this._cachedMeta;us(t),t._parsed=[]}e&&Object.isExtensible(e)&&Gt(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let s=!1;this._dataCheck();const n=e._stacked;e._stacked=ss(e.vScale,e),e.stack!==i.stack&&(s=!0,us(e),e.stack=i.stack),this._resyncElements(t),(s||n!==e._stacked)&&hs(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:s}=this,{iScale:n,_stacked:o}=i,a=n.axis;let r,h,l,c=0===t&&e===s.length||i._sorted,d=t>0&&i._parsed[t-1];if(!1===this._parsing)i._parsed=s,i._sorted=!0,l=s;else{l=Q(s[t])?this.parseArrayData(i,s,t,e):G(s[t])?this.parseObjectData(i,s,t,e):this.parsePrimitiveData(i,s,t,e);const n=()=>null===h[a]||d&&h[a]e||c=0;--d)if(!f()){this.updateRangeFromParsed(h,t,u,r);break}return h}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let s,n,o;for(s=0,n=e.length;s=0&&tthis.getContext(i,s,e),g=h.resolveNamedOptions(d,u,f,c);return g.$shared&&(g.$shared=r,n[o]=Object.freeze(gs(g,r))),g}_resolveAnimations(t,e,i){const s=this.chart,n=this._cachedDataOpts,o=`animation-${e}`,a=n[o];if(a)return a;let r;if(!1!==s.options.animation){const s=this.chart.config,n=s.datasetAnimationScopeKeys(this._type,e),o=s.getOptionScopes(this.getDataset(),n);r=s.createResolver(o,this.getContext(t,i,e))}const h=new qi(s,r&&r.animations);return r&&r._cacheable&&(n[o]=Object.freeze(h)),h}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||fs(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),s=this._sharedOptions,n=this.getSharedOptions(i),o=this.includeOptions(e,n)||n!==s;return this.updateSharedOptions(n,e,i),{sharedOptions:n,includeOptions:o}}updateElement(t,e,i,s){fs(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i)}updateSharedOptions(t,e,i){t&&!fs(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,s){t.active=s;const n=this.getStyle(e,s);this._resolveAnimations(e,i,s).update(t,{options:!s&&this.getSharedOptions(n)||n})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[a,r,h]of this._syncList)this[a](r,h);this._syncList=[];const s=i.length,n=e.length,o=Math.min(n,s);o&&this.parse(0,o),n>s?this._insertElements(s,n-s,t):n{for(t.length+=e,a=t.length-1;a>=o;a--)t[a]=t[a-e]};for(r(n),a=t;at-e)))}return t._cache.$bar}function xs(t){const e=t.iScale,i=bs(e,t.type);let s,n,o,a,r=e._length;const h=()=>{32767!==o&&-32768!==o&&(xt(a)&&(r=Math.min(r,Math.abs(o-a)||r)),a=o)};for(s=0,n=i.length;s0?n[t-1]:null,r=tMath.abs(r)&&(h=r,l=a),e[i.axis]=l,e._custom={barStart:h,barEnd:l,start:n,end:o,min:a,max:r}}function Ms(t,e,i,s){return Q(t)?vs(t,e,i,s):e[i.axis]=i.parse(t,s),e}function ws(t,e,i,s){const n=t.iScale,o=t.vScale,a=n.getLabels(),r=n===o,h=[];let l,c,d,u;for(l=i,c=i+s;l=i?1:-1)}function Ps(t){let e,i,s,n,o;return t.horizontal?(e=t.base>t.x,i="left",s="right"):(e=t.baset.controller.options.grouped)),n=i.options.stacked,o=[],a=t=>{const i=t.controller.getParsed(e),s=i&&i[t.vScale.axis];if(Z(s)||isNaN(s))return!0};for(const r of s)if((void 0===e||!a(r))&&((!1===n||-1===o.indexOf(r.stack)||void 0===n&&void 0===r.stack)&&o.push(r.stack),r.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){const s=this._getStacks(t,i),n=void 0!==e?s.indexOf(e):-1;return-1===n?s.length-1:n}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,s=[];let n,o;for(n=0,o=e.data.length;nHt(t,r,h,!0)?1:Math.max(e,e*i,s,s*i),g=(t,e,s)=>Ht(t,r,h,!0)?-1:Math.min(e,e*i,s,s*i),p=f(0,l,d),m=f(Pt,c,u),b=g(Mt,l,d),x=g(Mt+Pt,c,u);s=(p-b)/2,n=(m-x)/2,o=-(p+b)/2,a=-(m+x)/2}return{ratioX:s,ratioY:n,offsetX:o,offsetY:a}}class Ls extends ms{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:t=>"spacing"!==t,_indexable:t=>"spacing"!==t&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return e.labels.map(((e,n)=>{const o=t.getDatasetMeta(0),a=o.controller.getStyle(n);return{text:e,fillStyle:a.backgroundColor,strokeStyle:a.borderColor,fontColor:s,lineWidth:a.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(n),index:n}}))}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}};constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,s=this._cachedMeta;if(!1===this._parsing)s._parsed=i;else{let n,o,a=t=>+i[t];if(G(i[t])){const{key:t="value"}=this._parsing;a=e=>+mt(i[e],t)}for(n=t,o=t+e;n0&&!isNaN(t)?wt*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],n=_e(e._parsed[t],i.options.locale);return{label:s[t]||"",value:n}}getMaxBorderWidth(t){let e=0;const i=this.chart;let s,n,o,a,r;if(!t)for(s=0,n=i.data.datasets.length;s{const o=t.getDatasetMeta(0),a=o.controller.getStyle(n);return{text:e,fillStyle:a.backgroundColor,strokeStyle:a.borderColor,fontColor:s,lineWidth:a.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(n),index:n}}))}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],n=_e(e._parsed[t].r,i.options.locale);return{label:s[t]||"",value:n}}parseObjectData(t,e,i,s){return vi.bind(this)(t,e,i,s)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach(((t,i)=>{const s=this.getParsed(i).r;!isNaN(s)&&this.chart.getDataVisibility(i)&&(se.max&&(e.max=s))})),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,s=Math.min(e.right-e.left,e.bottom-e.top),n=Math.max(s/2,0),o=Math.max(i.cutoutPercentage?n/100*i.cutoutPercentage:1,0),a=(n-o)/t.getVisibleDatasetCount();this.outerRadius=n-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,e,i,s){const n="reset"===s,o=this.chart,a=o.options,r=a.animation,h=this._cachedMeta.rScale,l=h.xCenter,c=h.yCenter,d=h.getIndexAngle(0)-.5*Mt;let u,f=d;const g=360/this.countVisibleElements();for(u=0;u{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&e++})),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?Ft(this.resolveDataElementOptions(t,e).angle||i):0}}class zs extends Ls{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}}function Fs(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Vs{static override(t){Object.assign(Vs.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return Fs()}parse(){return Fs()}format(){return Fs()}add(){return Fs()}diff(){return Fs()}startOf(){return Fs()}endOf(){return Fs()}}var Bs={_date:Vs};function js(t,e,i,s){const{controller:n,data:o,_sorted:a}=t,r=n._cachedMeta.iScale;if(r&&e===r.axis&&"r"!==e&&a&&o.length){const t=r._reversePixels?Kt:qt;if(!s)return t(o,e,i);if(n._sharedOptions){const s=o[0],n="function"===typeof s.getRange&&s.getRange(e);if(n){const s=t(o,e,i-n),a=t(o,e,i+n);return{lo:s.lo,hi:a.hi}}}}return{lo:0,hi:o.length-1}}function Ws(t,e,i,s,n){const o=t.getSortedVisibleDatasetMetas(),a=i[e];for(let r=0,h=o.length;r{t[a](e[i],n)&&(o.push({element:t,datasetIndex:s,index:h}),r=r||t.inRange(e.x,e.y,n))})),s&&!r?[]:o}var qs={evaluateInteractionItems:Ws,modes:{index(t,e,i,s){const n=Ti(e,t),o=i.axis||"x",a=i.includeInvisible||!1,r=i.intersect?Hs(t,n,o,s,a):Us(t,n,o,!1,s,a),h=[];return r.length?(t.getSortedVisibleDatasetMetas().forEach((t=>{const e=r[0].index,i=t.data[e];i&&!i.skip&&h.push({element:i,datasetIndex:t.index,index:e})})),h):[]},dataset(t,e,i,s){const n=Ti(e,t),o=i.axis||"xy",a=i.includeInvisible||!1;let r=i.intersect?Hs(t,n,o,s,a):Us(t,n,o,!1,s,a);if(r.length>0){const e=r[0].datasetIndex,i=t.getDatasetMeta(e).data;r=[];for(let t=0;tt.pos===e))}function Qs(t,e){return t.filter((t=>-1===Ks.indexOf(t.pos)&&t.box.axis===e))}function Gs(t,e){return t.sort(((t,i)=>{const s=e?i:t,n=e?t:i;return s.weight===n.weight?s.index-n.index:s.weight-n.weight}))}function Js(t){const e=[];let i,s,n,o,a,r;for(i=0,s=(t||[]).length;it.box.fullSize)),!0),s=Gs(Zs(e,"left"),!0),n=Gs(Zs(e,"right")),o=Gs(Zs(e,"top"),!0),a=Gs(Zs(e,"bottom")),r=Qs(e,"x"),h=Qs(e,"y");return{fullSize:i,leftAndTop:s.concat(o),rightAndBottom:n.concat(h).concat(a).concat(r),chartArea:Zs(e,"chartArea"),vertical:s.concat(n).concat(h),horizontal:o.concat(a).concat(r)}}function nn(t,e,i,s){return Math.max(t[i],e[i])+Math.max(t[s],e[s])}function on(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function an(t,e,i,s){const{pos:n,box:o}=i,a=t.maxPadding;if(!G(n)){i.size&&(t[n]-=i.size);const e=s[i.stack]||{size:0,count:1};e.size=Math.max(e.size,i.horizontal?o.height:o.width),i.size=e.size/e.count,t[n]+=i.size}o.getPadding&&on(a,o.getPadding());const r=Math.max(0,e.outerWidth-nn(a,t,"left","right")),h=Math.max(0,e.outerHeight-nn(a,t,"top","bottom")),l=r!==t.w,c=h!==t.h;return t.w=r,t.h=h,i.horizontal?{same:l,other:c}:{same:c,other:l}}function rn(t){const e=t.maxPadding;function i(i){const s=Math.max(e[i]-t[i],0);return t[i]+=s,s}t.y+=i("top"),t.x+=i("left"),i("right"),i("bottom")}function hn(t,e){const i=e.maxPadding;function s(t){const s={left:0,top:0,right:0,bottom:0};return t.forEach((t=>{s[t]=Math.max(e[t],i[t])})),s}return s(t?["left","right"]:["top","bottom"])}function ln(t,e,i,s){const n=[];let o,a,r,h,l,c;for(o=0,a=t.length,l=0;o{"function"===typeof t.beforeLayout&&t.beforeLayout()}));const c=h.reduce(((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1),0)||1,d=Object.freeze({outerWidth:e,outerHeight:i,padding:n,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/c,hBoxMaxHeight:a/2}),u=Object.assign({},n);on(u,Qe(s));const f=Object.assign({maxPadding:u,w:o,h:a,x:n.left,y:n.top},n),g=en(h.concat(l),d);ln(r.fullSize,f,d,g),ln(h,f,d,g),ln(l,f,d,g)&&ln(h,f,d,g),rn(f),dn(r.leftAndTop,f,d,g),f.x+=f.w,f.y+=f.h,dn(r.rightAndBottom,f,d,g),t.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},ot(r.chartArea,(e=>{const i=e.box;Object.assign(i,t.chartArea),i.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})}))}};class fn{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,s){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):i)}}isAttached(t){return!0}updateConfig(t){}}class gn extends fn{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const pn="$chartjs",mn={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},bn=t=>null===t||""===t;function xn(t,e){const i=t.style,s=t.getAttribute("height"),n=t.getAttribute("width");if(t[pn]={initial:{height:s,width:n,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",bn(n)){const e=Fi(t,"width");void 0!==e&&(t.width=e)}if(bn(s))if(""===t.style.height)t.height=t.width/(e||2);else{const e=Fi(t,"height");void 0!==e&&(t.height=e)}return t}const _n=!!zi&&{passive:!0};function yn(t,e,i){t.addEventListener(e,i,_n)}function vn(t,e,i){t.canvas.removeEventListener(e,i,_n)}function Mn(t,e){const i=mn[t.type]||t.type,{x:s,y:n}=Ti(t,e);return{type:i,chart:e,native:t,x:void 0!==s?s:null,y:void 0!==n?n:null}}function wn(t,e){for(const i of t)if(i===e||i.contains(e))return!0}function kn(t,e,i){const s=t.canvas,n=new MutationObserver((t=>{let e=!1;for(const i of t)e=e||wn(i.addedNodes,s),e=e&&!wn(i.removedNodes,s);e&&i()}));return n.observe(document,{childList:!0,subtree:!0}),n}function Sn(t,e,i){const s=t.canvas,n=new MutationObserver((t=>{let e=!1;for(const i of t)e=e||wn(i.removedNodes,s),e=e&&!wn(i.addedNodes,s);e&&i()}));return n.observe(document,{childList:!0,subtree:!0}),n}const Pn=new Map;let On=0;function An(){const t=window.devicePixelRatio;t!==On&&(On=t,Pn.forEach(((e,i)=>{i.currentDevicePixelRatio!==t&&e()})))}function Dn(t,e){Pn.size||window.addEventListener("resize",An),Pn.set(t,e)}function Cn(t){Pn.delete(t),Pn.size||window.removeEventListener("resize",An)}function Tn(t,e,i){const s=t.canvas,n=s&&wi(s);if(!n)return;const o=ie(((t,e)=>{const s=n.clientWidth;i(t,e),s{const e=t[0],i=e.contentRect.width,s=e.contentRect.height;0===i&&0===s||o(i,s)}));return a.observe(n),Dn(t,o),a}function Rn(t,e,i){i&&i.disconnect(),"resize"===e&&Cn(t)}function En(t,e,i){const s=t.canvas,n=ie((e=>{null!==t.ctx&&i(Mn(e,t))}),t);return yn(s,e,n),n}class Ln extends fn{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(xn(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[pn])return!1;const i=e[pn].initial;["height","width"].forEach((t=>{const s=i[t];Z(s)?e.removeAttribute(t):e.setAttribute(t,s)}));const s=i.style||{};return Object.keys(s).forEach((t=>{e.style[t]=s[t]})),e.width=e.width,delete e[pn],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),n={attach:kn,detach:Sn,resize:Tn},o=n[e]||En;s[e]=o(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),s=i[e];if(!s)return;const n={attach:Rn,detach:Rn,resize:Rn},o=n[e]||vn;o(t,e,s),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,s){return Li(t,e,i,s)}isAttached(t){const e=wi(t);return!(!e||!e.isConnected)}}function In(t){return!Mi()||"undefined"!==typeof OffscreenCanvas&&t instanceof OffscreenCanvas?gn:Ln}class zn{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return Lt(this.x)&&Lt(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const s={};return t.forEach((t=>{s[t]=i[t]&&i[t].active()?i[t]._to:this[t]})),s}}function Fn(t,e){const i=t.options.ticks,s=Vn(t),n=Math.min(i.maxTicksLimit||s,s),o=i.major.enabled?jn(e):[],a=o.length,r=o[0],h=o[a-1],l=[];if(a>n)return Wn(e,l,o,a/n),l;const c=Bn(o,e,n);if(a>0){let t,i;const s=a>1?Math.round((h-r)/(a-1)):null;for(Nn(e,l,c,Z(s)?0:r-s,r),t=0,i=a-1;tn)return t}return Math.max(n,1)}function jn(t){const e=[];let i,s;for(i=0,s=t.length;i"left"===t?"right":"right"===t?"left":t,Yn=(t,e,i)=>"top"===e||"left"===e?t[e]+i:t[e]-i,Un=(t,e)=>Math.min(e||t,t);function Xn(t,e){const i=[],s=t.length/e,n=t.length;let o=0;for(;oa+r)))return l}function Kn(t,e){ot(t,(t=>{const i=t.gc,s=i.length/2;let n;if(s>e){for(n=0;ns?s:i,s=n&&i>s?i:s,{min:tt(i,tt(s,i)),max:tt(s,tt(i,s))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){const e=this._labelItems||(this._labelItems=this._computeLabelItems(t));return e}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){nt(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:s,grace:n,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=ti(this,n,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const r=a=n||i<=1||!this.isHorizontal())return void(this.labelRotation=s);const l=this._getLabelSizes(),c=l.widest.width,d=l.highest.height,u=$t(this.chart.width-c,0,this.maxWidth);o=t.offset?this.maxWidth/i:u/(i-1),c+6>o&&(o=u/(i-(t.offset?.5:1)),a=this.maxHeight-Zn(t.grid)-e.padding-Qn(t.title,this.chart.options.font),r=Math.sqrt(c*c+d*d),h=Vt(Math.min(Math.asin($t((l.highest.height+6)/o,-1,1)),Math.asin($t(a/r,-1,1))-Math.asin($t(d/r,-1,1)))),h=Math.max(s,Math.min(n,h))),this.labelRotation=h}afterCalculateLabelRotation(){nt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){nt(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:s,grid:n}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const o=Qn(s,e.options.font);if(a?(t.width=this.maxWidth,t.height=Zn(n)+o):(t.height=this.maxHeight,t.width=Zn(n)+o),i.display&&this.ticks.length){const{first:e,last:s,widest:n,highest:o}=this._getLabelSizes(),r=2*i.padding,h=Ft(this.labelRotation),l=Math.cos(h),c=Math.sin(h);if(a){const e=i.mirror?0:c*n.width+l*o.height;t.height=Math.min(this.maxHeight,t.height+e+r)}else{const e=i.mirror?0:l*n.width+c*o.height;t.width=Math.min(this.maxWidth,t.width+e+r)}this._calculatePadding(e,s,c,l)}}this._handleMargins(),a?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,s){const{ticks:{align:n,padding:o},position:a}=this.options,r=0!==this.labelRotation,h="top"!==a&&"x"===this.axis;if(this.isHorizontal()){const a=this.getPixelForTick(0)-this.left,l=this.right-this.getPixelForTick(this.ticks.length-1);let c=0,d=0;r?h?(c=s*t.width,d=i*e.height):(c=i*t.height,d=s*e.width):"start"===n?d=e.width:"end"===n?c=t.width:"inner"!==n&&(c=t.width/2,d=e.width/2),this.paddingLeft=Math.max((c-a+o)*this.width/(this.width-a),0),this.paddingRight=Math.max((d-l+o)*this.width/(this.width-l),0)}else{let i=e.height/2,s=t.height/2;"start"===n?(i=0,s=t.height):"end"===n&&(i=e.height,s=0),this.paddingTop=i+o,this.paddingBottom=s+o}}_handleMargins(){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(){nt(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,i=t.length;e({width:o[t]||0,height:a[t]||0});return{first:w(0),last:w(e-1),widest:w(v),highest:w(M),widths:o,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return Yt(this._alignToPixels?Re(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&ta*s?a/i:r/s:r*s0}_computeGridLineItems(t){const e=this.axis,i=this.chart,s=this.options,{grid:n,position:o,border:a}=s,r=n.offset,h=this.isHorizontal(),l=this.ticks,c=l.length+(r?1:0),d=Zn(n),u=[],f=a.setContext(this.getContext()),g=f.display?f.width:0,p=g/2,m=function(t){return Re(i,t,g)};let b,x,_,y,v,M,w,k,S,P,O,A;if("top"===o)b=m(this.bottom),M=this.bottom-d,k=b-p,P=m(t.top)+p,A=t.bottom;else if("bottom"===o)b=m(this.top),P=t.top,A=m(t.bottom)-p,M=b+p,k=this.top+d;else if("left"===o)b=m(this.right),v=this.right-d,w=b-p,S=m(t.left)+p,O=t.right;else if("right"===o)b=m(this.left),S=t.left,O=m(t.right)-p,v=b+p,w=this.left+d;else if("x"===e){if("center"===o)b=m((t.top+t.bottom)/2+.5);else if(G(o)){const t=Object.keys(o)[0],e=o[t];b=m(this.chart.scales[t].getPixelForValue(e))}P=t.top,A=t.bottom,M=b+p,k=M+d}else if("y"===e){if("center"===o)b=m((t.left+t.right)/2);else if(G(o)){const t=Object.keys(o)[0],e=o[t];b=m(this.chart.scales[t].getPixelForValue(e))}v=b-p,w=v-d,S=t.left,O=t.right}const D=et(s.ticks.maxTicksLimit,c),C=Math.max(1,Math.ceil(c/D));for(x=0;xe.value===t));if(s>=0){const t=e.setContext(this.getContext(s));return t.lineWidth}return 0}drawGrid(t){const e=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let n,o;const a=(t,e,s)=>{s.width&&s.color&&(i.save(),i.lineWidth=s.width,i.strokeStyle=s.color,i.setLineDash(s.borderDash||[]),i.lineDashOffset=s.borderDashOffset,i.beginPath(),i.moveTo(t.x,t.y),i.lineTo(e.x,e.y),i.stroke(),i.restore())};if(e.display)for(n=0,o=s.length;n{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let n,o;for(n=0,o=e.length;n{const s=i.split("."),n=s.pop(),o=[t].concat(s).join("."),a=e[i].split("."),r=a.pop(),h=a.join(".");De.route(o,n,h,r)}))}function ao(t){return"id"in t&&"defaults"in t}class ro{constructor(){this.controllers=new so(ms,"datasets",!0),this.elements=new so(zn,"elements"),this.plugins=new so(Object,"plugins"),this.scales=new so(io,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach((e=>{const s=i||this._getRegistryForType(e);i||s.isForType(e)||s===this.plugins&&e.id?this._exec(t,s,e):ot(e,(e=>{const s=i||this._getRegistryForType(e);this._exec(t,s,e)}))}))}_exec(t,e,i){const s=bt(t);nt(i["before"+s],[],i),e[t](i),nt(i["after"+s],[],i)}_getRegistryForType(t){for(let e=0;et.filter((t=>!e.some((e=>t.plugin.id===e.plugin.id))));this._notify(s(e,i),t,"stop"),this._notify(s(i,e),t,"start")}}function co(t){const e={},i=[],s=Object.keys(ho.plugins.items);for(let o=0;o1&&xo(t[0].toLowerCase());if(e)return e}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function vo(t,e,i){if(i[e+"AxisID"]===t)return{axis:e}}function Mo(t,e){if(e.data&&e.data.datasets){const i=e.data.datasets.filter((e=>e.xAxisID===t||e.yAxisID===t));if(i.length)return vo(t,"x",i[0])||vo(t,"y",i[0])}return{}}function wo(t,e){const i=ke[t.type]||{scales:{}},s=e.scales||{},n=po(t.type,e),o=Object.create(null);return Object.keys(s).forEach((e=>{const a=s[e];if(!G(a))return console.error(`Invalid scale configuration for scale: ${e}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${e}`);const r=yo(e,a,Mo(e,t),De.scales[a.type]),h=bo(r,n),l=i.scales||{};o[e]=dt(Object.create(null),[{axis:r},a,l[r],l[h]])})),t.data.datasets.forEach((i=>{const n=i.type||t.type,a=i.indexAxis||po(n,e),r=ke[n]||{},h=r.scales||{};Object.keys(h).forEach((t=>{const e=mo(t,a),n=i[e+"AxisID"]||e;o[n]=o[n]||Object.create(null),dt(o[n],[{axis:e},s[n],h[t]])}))})),Object.keys(o).forEach((t=>{const e=o[t];dt(e,[De.scales[e.type],De.scale])})),o}function ko(t){const e=t.options||(t.options={});e.plugins=et(e.plugins,{}),e.scales=wo(t,e)}function So(t){return t=t||{},t.datasets=t.datasets||[],t.labels=t.labels||[],t}function Po(t){return t=t||{},t.data=So(t.data),ko(t),t}const Oo=new Map,Ao=new Set;function Do(t,e){let i=Oo.get(t);return i||(i=e(),Oo.set(t,i),Ao.add(i)),i}const Co=(t,e,i)=>{const s=mt(e,i);void 0!==s&&t.add(s)};class To{constructor(t){this._config=Po(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=So(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),ko(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Do(t,(()=>[[`datasets.${t}`,""]]))}datasetAnimationScopeKeys(t,e){return Do(`${t}.transition.${e}`,(()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]]))}datasetElementScopeKeys(t,e){return Do(`${t}-${e}`,(()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]]))}pluginScopeKeys(t){const e=t.id,i=this.type;return Do(`${i}-plugin-${e}`,(()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]]))}_cachedScopes(t,e){const i=this._scopeCache;let s=i.get(t);return s&&!e||(s=new Map,i.set(t,s)),s}getOptionScopes(t,e,i){const{options:s,type:n}=this,o=this._cachedScopes(t,i),a=o.get(e);if(a)return a;const r=new Set;e.forEach((e=>{t&&(r.add(t),e.forEach((e=>Co(r,t,e)))),e.forEach((t=>Co(r,s,t))),e.forEach((t=>Co(r,ke[n]||{},t))),e.forEach((t=>Co(r,De,t))),e.forEach((t=>Co(r,Se,t)))}));const h=Array.from(r);return 0===h.length&&h.push(Object.create(null)),Ao.has(e)&&o.set(e,h),h}chartOptionScopes(){const{options:t,type:e}=this;return[t,ke[e]||{},De.datasets[e]||{},{type:e},De,Se]}resolveNamedOptions(t,e,i,s=[""]){const n={$shared:!0},{resolver:o,subPrefixes:a}=Ro(this._resolverCache,t,s);let r=o;if(Lo(o,e)){n.$shared=!1,i=_t(i)?i():i;const e=this.createResolver(t,i,a);r=si(o,i,e)}for(const h of e)n[h]=r[h];return n}createResolver(t,e,i=[""],s){const{resolver:n}=Ro(this._resolverCache,t,i);return G(e)?si(n,e,void 0,s):n}}function Ro(t,e,i){let s=t.get(e);s||(s=new Map,t.set(e,s));const n=i.join();let o=s.get(n);if(!o){const t=ii(e,i);o={resolver:t,subPrefixes:i.filter((t=>!t.toLowerCase().includes("hover")))},s.set(n,o)}return o}const Eo=t=>G(t)&&Object.getOwnPropertyNames(t).reduce(((e,i)=>e||_t(t[i])),!1);function Lo(t,e){const{isScriptable:i,isIndexable:s}=ni(t);for(const n of e){const e=i(n),o=s(n),a=(o||e)&&t[n];if(e&&(_t(a)||Eo(a))||o&&Q(a))return!0}return!1}var Io="4.3.3";const zo=["top","bottom","left","right","chartArea"];function Fo(t,e){return"top"===t||"bottom"===t||-1===zo.indexOf(t)&&"x"===e}function Vo(t,e){return function(i,s){return i[t]===s[t]?i[e]-s[e]:i[t]-s[t]}}function Bo(t){const e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),nt(i&&i.onComplete,[t],e)}function jo(t){const e=t.chart,i=e.options.animation;nt(i&&i.onProgress,[t],e)}function Wo(t){return Mi()&&"string"===typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const No={},Ho=t=>{const e=Wo(t);return Object.values(No).filter((t=>t.canvas===e)).pop()};function $o(t,e,i){const s=Object.keys(t);for(const n of s){const s=+n;if(s>=e){const o=t[n];delete t[n],(i>0||s>e)&&(t[s+i]=o)}}}function Yo(t,e,i,s){return i&&"mouseout"!==t.type?s?e:t:null}function Uo(t){const{xScale:e,yScale:i}=t;if(e&&i)return{left:e.left,right:e.right,top:i.top,bottom:i.bottom}}class Xo{static defaults=De;static instances=No;static overrides=ke;static registry=ho;static version=Io;static getChart=Ho;static register(...t){ho.add(...t),qo()}static unregister(...t){ho.remove(...t),qo()}constructor(t,e){const i=this.config=new To(e),s=Wo(t),n=Ho(s);if(n)throw new Error("Canvas is already in use. Chart with ID '"+n.id+"' must be destroyed before the canvas with ID '"+n.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||In(s)),this.platform.updateConfig(i);const a=this.platform.acquireContext(s,o.aspectRatio),r=a&&a.canvas,h=r&&r.height,l=r&&r.width;this.id=K(),this.ctx=a,this.canvas=r,this.width=l,this.height=h,this._options=o,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 lo,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=se((t=>this.update(t)),o.resizeDelay||0),this._dataChanges=[],No[this.id]=this,a&&r?($i.listen(this,"complete",Bo),$i.listen(this,"progress",jo),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:s,_aspectRatio:n}=this;return Z(t)?e&&n?n:s?i/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return ho}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Ii(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Ee(this.canvas,this.ctx),this}stop(){return $i.stop(this),this}resize(t,e){$i.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,s=this.canvas,n=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(s,t,e,n),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),r=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,Ii(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),nt(i.onResize,[this,o],this),this.attached&&this._doResize(r)&&this.render())}ensureScalesHaveIDs(){const t=this.options,e=t.scales||{};ot(e,((t,e)=>{t.id=e}))}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,s=Object.keys(i).reduce(((t,e)=>(t[e]=!1,t)),{});let n=[];e&&(n=n.concat(Object.keys(e).map((t=>{const i=e[t],s=yo(t,i),n="r"===s,o="x"===s;return{options:i,dposition:n?"chartArea":o?"bottom":"left",dtype:n?"radialLinear":o?"category":"linear"}})))),ot(n,(e=>{const n=e.options,o=n.id,a=yo(o,n),r=et(n.type,e.dtype);void 0!==n.position&&Fo(n.position,a)===Fo(e.dposition)||(n.position=e.dposition),s[o]=!0;let h=null;if(o in i&&i[o].type===r)h=i[o];else{const t=ho.getScale(r);h=new t({id:o,type:r,ctx:this.ctx,chart:this}),i[h.id]=h}h.init(n,t)})),ot(s,((t,e)=>{t||delete i[e]})),ot(i,(t=>{un.configure(this,t,t.options),un.addBox(this,t)}))}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort(((t,e)=>t.index-e.index)),i>e){for(let t=e;te.length&&delete this._stacks,t.forEach(((t,i)=>{0===e.filter((e=>e===t._dataset)).length&&this._destroyDatasetMeta(i)}))}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=e.length;i{this.getDatasetMeta(e).controller.reset()}),this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const n=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let h=0,l=this.data.datasets.length;h{t.reset()})),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Vo("z","_idx"));const{_active:a,_lastEvent:r}=this;r?this._eventHandler(r,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){ot(this.scales,(t=>{un.removeBox(this,t)})),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);yt(e,i)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:n}of e){const e="_removeElements"===i?-n:n;$o(t,s,e)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=e=>new Set(t.filter((t=>t[0]===e)).map(((t,e)=>e+","+t.splice(1).join(",")))),s=i(0);for(let n=1;nt.split(","))).map((t=>({method:t[1],start:+t[2],count:+t[3]})))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;un.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],ot(this.boxes,(t=>{i&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))}),this),this._layers.forEach(((t,e)=>{t._idx=e})),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i=t._clip,s=!i.disabled,n=Uo(t)||this.chartArea,o={meta:t,index:t.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",o)&&(s&&Fe(e,{left:!1===i.left?0:n.left-i.left,right:!1===i.right?this.width:n.right+i.right,top:!1===i.top?0:n.top-i.top,bottom:!1===i.bottom?this.height:n.bottom+i.bottom}),t.controller.draw(),s&&Ve(e),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(t){return ze(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,s){const n=qs.modes[e];return"function"===typeof n?n(this,t,i,s):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let s=i.filter((t=>t&&t._dataset===e)).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=ei(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return"boolean"===typeof i.hidden?!i.hidden:!e.hidden}setDatasetVisibility(t,e){const i=this.getDatasetMeta(t);i.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const s=i?"show":"hide",n=this.getDatasetMeta(t),o=n.controller._resolveAnimations(void 0,s);xt(e)?(n.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),o.update(n,{visible:i}),this.update((e=>e.datasetIndex===t?s:void 0)))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),$i.remove(this),t=0,e=this.data.datasets.length;t{e.addEventListener(this,i,s),t[i]=s},s=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};ot(this.options.events,(t=>i(t,s)))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(i,s)=>{e.addEventListener(this,i,s),t[i]=s},s=(i,s)=>{t[i]&&(e.removeEventListener(this,i,s),delete t[i])},n=(t,e)=>{this.canvas&&this.resize(t,e)};let o;const a=()=>{s("attach",a),this.attached=!0,this.resize(),i("resize",n),i("detach",o)};o=()=>{this.attached=!1,s("resize",n),this._stop(),this._resize(0,0),i("attach",a)},e.isAttached(this.canvas)?a():o()}unbindEvents(){ot(this._listeners,((t,e)=>{this.platform.removeEventListener(this,e,t)})),this._listeners={},ot(this._responsiveListeners,((t,e)=>{this.platform.removeEventListener(this,e,t)})),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const s=i?"set":"remove";let n,o,a,r;for("dataset"===e&&(n=this.getDatasetMeta(t[0].datasetIndex),n.controller["_"+s+"DatasetHoverStyle"]()),a=0,r=t.length;a{const i=this.getDatasetMeta(t);if(!i)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:i.data[e],index:e}})),s=!at(i,e);s&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return 1===this._plugins._cache.filter((e=>e.plugin.id===t)).length}_updateHoverStyles(t,e,i){const s=this.options.hover,n=(t,e)=>t.filter((t=>!e.some((e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)))),o=n(e,t),a=i?t:n(t,e);o.length&&this.updateHoverStyle(o,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",i,s))return;const n=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(n||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:s=[],options:n}=this,o=e,a=this._getActiveElements(t,s,i,o),r=vt(t),h=Yo(t,this._lastEvent,i,r);i&&(this._lastEvent=null,nt(n.onHover,[t,a,this],this),r&&nt(n.onClick,[t,a,this],this));const l=!at(a,s);return(l||e)&&(this._active=a,this._updateHoverStyles(a,s,e)),this._lastEvent=h,l}_getActiveElements(t,e,i,s){if("mouseout"===t.type)return[];if(!i)return e;const n=this.options.hover;return this.getElementsAtEventForMode(t,n.mode,n,s)}}function qo(){return ot(Xo.instances,(t=>t._plugins.invalidate()))}function Ko(t,e,i){const{startAngle:s,pixelMargin:n,x:o,y:a,outerRadius:r,innerRadius:h}=e;let l=n/r;t.beginPath(),t.arc(o,a,r,s-l,i+l),h>n?(l=n/h,t.arc(o,a,h,i+l,s-l,!0)):t.arc(o,a,n,i+Pt,s-Pt),t.closePath(),t.clip()}function Zo(t){return qe(t,["outerStart","outerEnd","innerStart","innerEnd"])}function Qo(t,e,i,s){const n=Zo(t.options.borderRadius),o=(i-e)/2,a=Math.min(o,s*e/2),r=t=>{const e=(i-Math.min(o,t))*s/2;return $t(t,0,Math.min(o,e))};return{outerStart:r(n.outerStart),outerEnd:r(n.outerEnd),innerStart:$t(n.innerStart,0,a),innerEnd:$t(n.innerEnd,0,a)}}function Go(t,e,i,s){return{x:i+t*Math.cos(e),y:s+t*Math.sin(e)}}function Jo(t,e,i,s,n,o){const{x:a,y:r,startAngle:h,pixelMargin:l,innerRadius:c}=e,d=Math.max(e.outerRadius+s+i-l,0),u=c>0?c+s+i+l:0;let f=0;const g=n-h;if(s){const t=c>0?c-s:0,e=d>0?d-s:0,i=(t+e)/2,n=0!==i?g*i/(i+s):g;f=(g-n)/2}const p=Math.max(.001,g*d-i/Mt)/d,m=(g-p)/2,b=h+m+f,x=n-m-f,{outerStart:_,outerEnd:y,innerStart:v,innerEnd:M}=Qo(e,u,d,x-b),w=d-_,k=d-y,S=b+_/w,P=x-y/k,O=u+v,A=u+M,D=b+v/O,C=x-M/A;if(t.beginPath(),o){const e=(S+P)/2;if(t.arc(a,r,d,S,e),t.arc(a,r,d,e,P),y>0){const e=Go(k,P,a,r);t.arc(e.x,e.y,y,P,x+Pt)}const i=Go(A,x,a,r);if(t.lineTo(i.x,i.y),M>0){const e=Go(A,C,a,r);t.arc(e.x,e.y,M,x+Pt,C+Math.PI)}const s=(x-M/u+(b+v/u))/2;if(t.arc(a,r,u,x-M/u,s,!0),t.arc(a,r,u,s,b+v/u,!0),v>0){const e=Go(O,D,a,r);t.arc(e.x,e.y,v,D+Math.PI,b-Pt)}const n=Go(w,b,a,r);if(t.lineTo(n.x,n.y),_>0){const e=Go(w,S,a,r);t.arc(e.x,e.y,_,b-Pt,S)}}else{t.moveTo(a,r);const e=Math.cos(S)*d+a,i=Math.sin(S)*d+r;t.lineTo(e,i);const s=Math.cos(P)*d+a,n=Math.sin(P)*d+r;t.lineTo(s,n)}t.closePath()}function ta(t,e,i,s,n){const{fullCircles:o,startAngle:a,circumference:r}=e;let h=e.endAngle;if(o){Jo(t,e,i,s,h,n);for(let e=0;e"borderDash"!==t};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(t){super(),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,t&&Object.assign(this,t)}inRange(t,e,i){const s=this.getProps(["x","y"],i),{angle:n,distance:o}=jt(s,{x:t,y:e}),{startAngle:a,endAngle:r,innerRadius:h,outerRadius:l,circumference:c}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),d=(this.options.spacing+this.options.borderWidth)/2,u=et(c,r-a),f=u>=wt||Ht(n,a,r),g=Ut(o,h+d,l+d);return f&&g}getCenterPoint(t){const{x:e,y:i,startAngle:s,endAngle:n,innerRadius:o,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:r,spacing:h}=this.options,l=(s+n)/2,c=(o+a+h+r)/2;return{x:e+Math.cos(l)*c,y:i+Math.sin(l)*c}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:i}=this,s=(e.offset||0)/4,n=(e.spacing||0)/2,o=e.circular;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=i>wt?Math.floor(i/wt):0,0===i||this.innerRadius<0||this.outerRadius<0)return;t.save();const a=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(a)*s,Math.sin(a)*s);const r=1-Math.sin(Math.min(Mt,i||0)),h=s*r;t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor,ta(t,this,h,n,o),ea(t,this,h,n,o),t.restore()}}function sa(t,e){const{x:i,y:s,base:n,width:o,height:a}=t.getProps(["x","y","base","width","height"],e);let r,h,l,c,d;return t.horizontal?(d=a/2,r=Math.min(i,n),h=Math.max(i,n),l=s-d,c=s+d):(d=o/2,r=i-d,h=i+d,l=Math.min(s,n),c=Math.max(s,n)),{left:r,top:l,right:h,bottom:c}}function na(t,e,i,s){return t?0:$t(e,i,s)}function oa(t,e,i){const s=t.options.borderWidth,n=t.borderSkipped,o=Ke(s);return{t:na(n.top,o.top,0,i),r:na(n.right,o.right,0,e),b:na(n.bottom,o.bottom,0,i),l:na(n.left,o.left,0,e)}}function aa(t,e,i){const{enableBorderRadius:s}=t.getProps(["enableBorderRadius"]),n=t.options.borderRadius,o=Ze(n),a=Math.min(e,i),r=t.borderSkipped,h=s||G(n);return{topLeft:na(!h||r.top||r.left,o.topLeft,0,a),topRight:na(!h||r.top||r.right,o.topRight,0,a),bottomLeft:na(!h||r.bottom||r.left,o.bottomLeft,0,a),bottomRight:na(!h||r.bottom||r.right,o.bottomRight,0,a)}}function ra(t){const e=sa(t),i=e.right-e.left,s=e.bottom-e.top,n=oa(t,i/2,s/2),o=aa(t,i/2,s/2);return{outer:{x:e.left,y:e.top,w:i,h:s,radius:o},inner:{x:e.left+n.l,y:e.top+n.t,w:i-n.l-n.r,h:s-n.t-n.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(n.t,n.l)),topRight:Math.max(0,o.topRight-Math.max(n.t,n.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(n.b,n.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(n.b,n.r))}}}}function ha(t,e,i,s){const n=null===e,o=null===i,a=n&&o,r=t&&!a&&sa(t,s);return r&&(n||Ut(e,r.left,r.right))&&(o||Ut(i,r.top,r.bottom))}function la(t){return t.topLeft||t.topRight||t.bottomLeft||t.bottomRight}function ca(t,e){t.rect(e.x,e.y,e.w,e.h)}function da(t,e,i={}){const s=t.x!==i.x?-e:0,n=t.y!==i.y?-e:0,o=(t.x+t.w!==i.x+i.w?e:0)-s,a=(t.y+t.h!==i.y+i.h?e:0)-n;return{x:t.x+s,y:t.y+n,w:t.w+o,h:t.h+a,radius:t.radius}}class ua extends zn{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:i,backgroundColor:s}}=this,{inner:n,outer:o}=ra(this),a=la(o.radius)?He:ca;t.save(),o.w===n.w&&o.h===n.h||(t.beginPath(),a(t,da(o,e,n)),t.clip(),a(t,da(n,-e,o)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),a(t,da(n,e)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,e,i){return ha(this,t,e,i)}inXRange(t,e){return ha(this,t,null,e)}inYRange(t,e){return ha(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:s,horizontal:n}=this.getProps(["x","y","base","horizontal"],t);return{x:n?(e+s)/2:e,y:n?i:(i+s)/2}}getRange(t){return"x"===t?this.width/2:this.height/2}}const fa=["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)"],ga=fa.map((t=>t.replace("rgb(","rgba(").replace(")",", 0.5)")));function pa(t){return fa[t%fa.length]}function ma(t){return ga[t%ga.length]}function ba(t,e){return t.borderColor=pa(e),t.backgroundColor=ma(e),++e}function xa(t,e){return t.backgroundColor=t.data.map((()=>pa(e++))),e}function _a(t,e){return t.backgroundColor=t.data.map((()=>ma(e++))),e}function ya(t){let e=0;return(i,s)=>{const n=t.getDatasetMeta(s).controller;n instanceof Ls?e=xa(i,e):n instanceof Is?e=_a(i,e):n&&(e=ba(i,e))}}function va(t){let e;for(e in t)if(t[e].borderColor||t[e].backgroundColor)return!0;return!1}function Ma(t){return t&&(t.borderColor||t.backgroundColor)}var wa={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(t,e,i){if(!i.enabled)return;const{data:{datasets:s},options:n}=t.config,{elements:o}=n;if(!i.forceOverride&&(va(s)||Ma(n)||o&&va(o)))return;const a=ya(t);s.forEach(a)}};class ka extends zn{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.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(t,e){const i=this.options;if(this.left=0,this.top=0,!i.display)return void(this.width=this.height=this.right=this.bottom=0);this.width=this.right=t,this.height=this.bottom=e;const s=Q(i.text)?i.text.length:1;this._padding=Qe(i.padding);const n=s*Ge(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=n:this.width=n}isHorizontal(){const t=this.options.position;return"top"===t||"bottom"===t}_drawArgs(t){const{top:e,left:i,bottom:s,right:n,options:o}=this,a=o.align;let r,h,l,c=0;return this.isHorizontal()?(h=oe(a,i,n),l=e+t,r=n-i):("left"===o.position?(h=i+t,l=oe(a,s,e),c=-.5*Mt):(h=n-t,l=oe(a,e,s),c=.5*Mt),r=s-e),{titleX:h,titleY:l,maxWidth:r,rotation:c}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=Ge(e.font),s=i.lineHeight,n=s/2+this._padding.top,{titleX:o,titleY:a,maxWidth:r,rotation:h}=this._drawArgs(n);Ne(t,e.text,0,0,i,{color:e.color,maxWidth:r,rotation:h,textAlign:ne(e.align),textBaseline:"middle",translation:[o,a]})}}function Sa(t,e){const i=new ka({ctx:t.ctx,options:e,chart:t});un.configure(t,i,e),un.addBox(t,i),t.titleBlock=i}var Pa={id:"title",_element:ka,start(t,e,i){Sa(t,i)},stop(t){const e=t.titleBlock;un.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,i){const s=t.titleBlock;un.configure(t,s,i),s.options=i},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};new WeakMap;const Oa={average(t){if(!t.length)return!1;let e,i,s=0,n=0,o=0;for(e=0,i=t.length;e-1?t.split("\n"):t}function Ca(t,e){const{element:i,datasetIndex:s,index:n}=e,o=t.getDatasetMeta(s).controller,{label:a,value:r}=o.getLabelAndValue(n);return{chart:t,label:a,parsed:o.getParsed(n),raw:t.data.datasets[s].data[n],formattedValue:r,dataset:o.getDataset(),dataIndex:n,datasetIndex:s,element:i}}function Ta(t,e){const i=t.chart.ctx,{body:s,footer:n,title:o}=t,{boxWidth:a,boxHeight:r}=e,h=Ge(e.bodyFont),l=Ge(e.titleFont),c=Ge(e.footerFont),d=o.length,u=n.length,f=s.length,g=Qe(e.padding);let p=g.height,m=0,b=s.reduce(((t,e)=>t+e.before.length+e.lines.length+e.after.length),0);if(b+=t.beforeBody.length+t.afterBody.length,d&&(p+=d*l.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),b){const t=e.displayColors?Math.max(r,h.lineHeight):h.lineHeight;p+=f*t+(b-f)*h.lineHeight+(b-1)*e.bodySpacing}u&&(p+=e.footerMarginTop+u*c.lineHeight+(u-1)*e.footerSpacing);let x=0;const _=function(t){m=Math.max(m,i.measureText(t).width+x)};return i.save(),i.font=l.string,ot(t.title,_),i.font=h.string,ot(t.beforeBody.concat(t.afterBody),_),x=e.displayColors?a+2+e.boxPadding:0,ot(s,(t=>{ot(t.before,_),ot(t.lines,_),ot(t.after,_)})),x=0,i.font=c.string,ot(t.footer,_),i.restore(),m+=g.width,{width:m,height:p}}function Ra(t,e){const{y:i,height:s}=e;return it.height-s/2?"bottom":"center"}function Ea(t,e,i,s){const{x:n,width:o}=s,a=i.caretSize+i.caretPadding;return"left"===t&&n+o+a>e.width||("right"===t&&n-o-a<0||void 0)}function La(t,e,i,s){const{x:n,width:o}=i,{width:a,chartArea:{left:r,right:h}}=t;let l="center";return"center"===s?l=n<=(r+h)/2?"left":"right":n<=o/2?l="left":n>=a-o/2&&(l="right"),Ea(l,t,e,i)&&(l="center"),l}function Ia(t,e,i){const s=i.yAlign||e.yAlign||Ra(t,i);return{xAlign:i.xAlign||e.xAlign||La(t,e,i,s),yAlign:s}}function za(t,e){let{x:i,width:s}=t;return"right"===e?i-=s:"center"===e&&(i-=s/2),i}function Fa(t,e,i){let{y:s,height:n}=t;return"top"===e?s+=i:s-="bottom"===e?n+i:n/2,s}function Va(t,e,i,s){const{caretSize:n,caretPadding:o,cornerRadius:a}=t,{xAlign:r,yAlign:h}=i,l=n+o,{topLeft:c,topRight:d,bottomLeft:u,bottomRight:f}=Ze(a);let g=za(e,r);const p=Fa(e,h,l);return"center"===h?"left"===r?g+=l:"right"===r&&(g-=l):"left"===r?g-=Math.max(c,u)+n:"right"===r&&(g+=Math.max(d,f)+n),{x:$t(g,0,s.width-e.width),y:$t(p,0,s.height-e.height)}}function Ba(t,e,i){const s=Qe(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-s.right:t.x+s.left}function ja(t){return Aa([],Da(t))}function Wa(t,e,i){return ei(t,{tooltip:e,tooltipItems:i,type:"tooltip"})}function Na(t,e){const i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}const Ha={beforeTitle:q,title(t){if(t.length>0){const e=t[0],i=e.chart.data.labels,s=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(s>0&&e.dataIndex{const e={before:[],lines:[],after:[]},n=Na(i,t);Aa(e.before,Da($a(n,"beforeLabel",this,t))),Aa(e.lines,$a(n,"label",this,t)),Aa(e.after,Da($a(n,"afterLabel",this,t))),s.push(e)})),s}getAfterBody(t,e){return ja($a(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,s=$a(i,"beforeFooter",this,t),n=$a(i,"footer",this,t),o=$a(i,"afterFooter",this,t);let a=[];return a=Aa(a,Da(s)),a=Aa(a,Da(n)),a=Aa(a,Da(o)),a}_createItems(t){const e=this._active,i=this.chart.data,s=[],n=[],o=[];let a,r,h=[];for(a=0,r=e.length;at.filter(e,s,n,i)))),t.itemSort&&(h=h.sort(((e,s)=>t.itemSort(e,s,i)))),ot(h,(e=>{const i=Na(t.callbacks,e);s.push($a(i,"labelColor",this,e)),n.push($a(i,"labelPointStyle",this,e)),o.push($a(i,"labelTextColor",this,e))})),this.labelColors=s,this.labelPointStyles=n,this.labelTextColors=o,this.dataPoints=h,h}update(t,e){const i=this.options.setContext(this.getContext()),s=this._active;let n,o=[];if(s.length){const t=Oa[i.position].call(this,s,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const e=this._size=Ta(this,i),a=Object.assign({},t,e),r=Ia(this.chart,i,a),h=Va(i,a,r,this.chart);this.xAlign=r.xAlign,this.yAlign=r.yAlign,n={opacity:1,x:h.x,y:h.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(n={opacity:0});this._tooltipItems=o,this.$context=void 0,n&&this._resolveAnimations().update(this,n),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,s){const n=this.getCaretPosition(t,i,s);e.lineTo(n.x1,n.y1),e.lineTo(n.x2,n.y2),e.lineTo(n.x3,n.y3)}getCaretPosition(t,e,i){const{xAlign:s,yAlign:n}=this,{caretSize:o,cornerRadius:a}=i,{topLeft:r,topRight:h,bottomLeft:l,bottomRight:c}=Ze(a),{x:d,y:u}=t,{width:f,height:g}=e;let p,m,b,x,_,y;return"center"===n?(_=u+g/2,"left"===s?(p=d,m=p-o,x=_+o,y=_-o):(p=d+f,m=p+o,x=_-o,y=_+o),b=p):(m="left"===s?d+Math.max(r,l)+o:"right"===s?d+f-Math.max(h,c)-o:this.caretX,"top"===n?(x=u,_=x-o,p=m-o,b=m+o):(x=u+g,_=x+o,p=m+o,b=m-o),y=x),{x1:p,x2:m,x3:b,y1:x,y2:_,y3:y}}drawTitle(t,e,i){const s=this.title,n=s.length;let o,a,r;if(n){const h=ji(i.rtl,this.x,this.width);for(t.x=Ba(this,i.titleAlign,i),e.textAlign=h.textAlign(i.titleAlign),e.textBaseline="middle",o=Ge(i.titleFont),a=i.titleSpacing,e.fillStyle=i.titleColor,e.font=o.string,r=0;r0!==t))?(t.beginPath(),t.fillStyle=n.multiKeyBackground,He(t,{x:e,y:f,w:h,h:r,radius:a}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),He(t,{x:i,y:f+1,w:h-2,h:r-2,radius:a}),t.fill()):(t.fillStyle=n.multiKeyBackground,t.fillRect(e,f,h,r),t.strokeRect(e,f,h,r),t.fillStyle=o.backgroundColor,t.fillRect(i,f+1,h-2,r-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:s}=this,{bodySpacing:n,bodyAlign:o,displayColors:a,boxHeight:r,boxWidth:h,boxPadding:l}=i,c=Ge(i.bodyFont);let d=c.lineHeight,u=0;const f=ji(i.rtl,this.x,this.width),g=function(i){e.fillText(i,f.x(t.x+u),t.y+d/2),t.y+=d+n},p=f.textAlign(o);let m,b,x,_,y,v,M;for(e.textAlign=o,e.textBaseline="middle",e.font=c.string,t.x=Ba(this,p,i),e.fillStyle=i.bodyColor,ot(this.beforeBody,g),u=a&&"right"!==p?"center"===o?h/2+l:h+2+l:0,_=0,v=s.length;_0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,s=i&&i.x,n=i&&i.y;if(s||n){const i=Oa[t.position].call(this,this._active,this._eventPosition);if(!i)return;const o=this._size=Ta(this,t),a=Object.assign({},i,this._size),r=Ia(e,t,a),h=Va(t,a,r,e);s._to===h.x&&n._to===h.y||(this.xAlign=r.xAlign,this.yAlign=r.yAlign,this.width=o.width,this.height=o.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const s={width:this.width,height:this.height},n={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=Qe(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=i,this.drawBackground(n,t,s,e),Wi(t,e.textDirection),n.y+=o.top,this.drawTitle(n,t,e),this.drawBody(n,t,e),this.drawFooter(n,t,e),Ni(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,s=t.map((({datasetIndex:t,index:e})=>{const i=this.chart.getDatasetMeta(t);if(!i)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:i.data[e],index:e}})),n=!at(i,s),o=this._positionChanged(s,e);(n||o)&&(this._active=s,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,n=this._active||[],o=this._getActiveElements(t,n,e,i),a=this._positionChanged(o,t),r=e||!at(o,n)||a;return r&&(this._active=o,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),r}_getActiveElements(t,e,i,s){const n=this.options;if("mouseout"===t.type)return[];if(!s)return e;const o=this.chart.getElementsAtEventForMode(t,n.mode,n,i);return n.reverse&&o.reverse(),o}_positionChanged(t,e){const{caretX:i,caretY:s,options:n}=this,o=Oa[n.position].call(this,t,e);return!1!==o&&(i!==o.x||s!==o.y)}}var Ua={id:"tooltip",_element:Ya,positioners:Oa,afterInit(t,e,i){i&&(t.tooltip=new Ya({chart:t,options:i}))},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const i={tooltip:e};if(!1===t.notifyPlugins("beforeTooltipDraw",{...i,cancelable:!0}))return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i)}},afterEvent(t,e){if(t.tooltip){const i=e.replay;t.tooltip.handleEvent(e.event,i,e.inChartArea)&&(e.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:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.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:Ha},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const Xa=(t,e,i,s)=>("string"===typeof e?(i=t.push(e)-1,s.unshift({index:i,label:e})):isNaN(e)&&(i=null),i);function qa(t,e,i,s){const n=t.indexOf(e);if(-1===n)return Xa(t,e,i,s);const o=t.lastIndexOf(e);return n!==o?i:n}const Ka=(t,e)=>null===t?null:$t(Math.round(t),0,e);function Za(t){const e=this.getLabels();return t>=0&&te.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function Ga(t,e){const i=[],s=1e-14,{bounds:n,step:o,min:a,max:r,precision:h,count:l,maxTicks:c,maxDigits:d,includeBounds:u}=t,f=o||1,g=c-1,{min:p,max:m}=e,b=!Z(a),x=!Z(r),_=!Z(l),y=(m-p)/(d+1);let v,M,w,k,S=Rt((m-p)/g/f)*f;if(Sg&&(S=Rt(k*S/g/f)*f),Z(h)||(v=Math.pow(10,h),S=Math.ceil(S*v)/v),"ticks"===n?(M=Math.floor(p/S)*S,w=Math.ceil(m/S)*S):(M=p,w=m),b&&x&&o&&It((r-a)/o,S/1e3)?(k=Math.round(Math.min((r-a)/S,c)),S=(r-a)/k,M=a,w=r):_?(M=b?a:M,w=x?r:w,k=l-1,S=(w-M)/k):(k=(w-M)/S,k=Tt(k,Math.round(k),S/1e3)?Math.round(k):Math.ceil(k));const P=Math.max(Bt(S),Bt(M));v=Math.pow(10,Z(h)?P:h),M=Math.round(M*v)/v,w=Math.round(w*v)/v;let O=0;for(b&&(u&&M!==a?(i.push({value:a}),Mr)break;i.push({value:t})}return x&&u&&w!==r?i.length&&Tt(i[i.length-1].value,r,Ja(r,y,t))?i[i.length-1].value=r:i.push({value:r}):x&&w!==r||i.push({value:w}),i}function Ja(t,e,{horizontal:i,minRotation:s}){const n=Ft(s),o=(i?Math.sin(n):Math.cos(n))||.001,a=.75*e*(""+t).length;return Math.min(e/o,a)}class tr extends io{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return Z(t)||("number"===typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:s,max:n}=this;const o=t=>s=e?s:t,a=t=>n=i?n:t;if(t){const t=Ct(s),e=Ct(n);t<0&&e<0?a(0):t>0&&e>0&&o(0)}if(s===n){let e=0===n?1:Math.abs(.05*n);a(n+e),t||o(s-e)}this.min=s,this.max=n}getTickLimit(){const t=this.options.ticks;let e,{maxTicksLimit:i,stepSize:s}=t;return s?(e=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,e>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${e} ticks. Limiting to 1000.`),e=1e3)):(e=this.computeTickLimit(),i=i||11),i&&(e=Math.min(i,e)),e}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:!1!==e.includeBounds},n=this._range||this,o=Ga(s,n);return"ticks"===t.bounds&&zt(o,this,"value"),t.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const s=(i-e)/Math.max(t.length-1,1)/2;e-=s,i+=s}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return _e(t,this.chart.options.locale,this.options.ticks.format)}}class er extends tr{static id="linear";static defaults={ticks:{callback:Me.formatters.numeric}};determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=J(t)?t:0,this.max=J(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=Ft(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,n=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,n.lineHeight/s))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}Me.formatters.logarithmic;Me.formatters.numeric;const ir={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},sr=Object.keys(ir);function nr(t,e){return t-e}function or(t,e){if(Z(e))return null;const i=t._adapter,{parser:s,round:n,isoWeekday:o}=t._parseOpts;let a=e;return"function"===typeof s&&(a=s(a)),J(a)||(a="string"===typeof s?i.parse(a,s):i.parse(a)),null===a?null:(n&&(a="week"!==n||!Lt(o)&&!0!==o?i.startOf(a,n):i.startOf(a,"isoWeek",o)),+a)}function ar(t,e,i,s){const n=sr.length;for(let o=sr.indexOf(t);o=sr.indexOf(i);o--){const i=sr[o];if(ir[i].common&&t._adapter.diff(n,s,i)>=e-1)return i}return sr[i?sr.indexOf(i):0]}function hr(t){for(let e=sr.indexOf(t)+1,i=sr.length;e=e?i[s]:i[n];t[o]=!0}}else t[e]=!0}function cr(t,e,i,s){const n=t._adapter,o=+n.startOf(e[0].value,s),a=e[e.length-1].value;let r,h;for(r=o;r<=a;r=+n.add(r,1,s))h=i[r],h>=0&&(e[h].major=!0);return e}function dr(t,e,i){const s=[],n={},o=e.length;let a,r;for(a=0;a+t.value)))}initOffsets(t=[]){let e,i,s=0,n=0;this.options.offset&&t.length&&(e=this.getDecimalForValue(t[0]),s=1===t.length?1-e:(this.getDecimalForValue(t[1])-e)/2,i=this.getDecimalForValue(t[t.length-1]),n=1===t.length?i:(i-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;s=$t(s,0,o),n=$t(n,0,o),this._offsets={start:s,end:n,factor:1/(s+1+n)}}_generate(){const t=this._adapter,e=this.min,i=this.max,s=this.options,n=s.time,o=n.unit||ar(n.minUnit,e,i,this._getLabelCapacity(e)),a=et(s.ticks.stepSize,1),r="week"===o&&n.isoWeekday,h=Lt(r)||!0===r,l={};let c,d,u=e;if(h&&(u=+t.startOf(u,"isoWeek",r)),u=+t.startOf(u,h?"day":o),t.diff(i,e,o)>1e5*a)throw new Error(e+" and "+i+" are too far apart with stepSize of "+a+" "+o);const f="data"===s.ticks.source&&this.getDataTimestamps();for(c=u,d=0;c+t))}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){const i=this.options,s=i.time.displayFormats,n=this._unit,o=e||s[n];return this._adapter.format(t,o)}_tickFormatFunction(t,e,i,s){const n=this.options,o=n.ticks.callback;if(o)return nt(o,[t,e,i],this);const a=n.time.displayFormats,r=this._unit,h=this._majorUnit,l=r&&a[r],c=h&&a[h],d=i[e],u=h&&c&&d&&d.major;return this._adapter.format(t,s||(u?c:l))}generateTickLabels(t){let e,i,s;for(e=0,i=t.length;e0?a:1}getDataTimestamps(){let t,e,i=this._cache.data||[];if(i.length)return i;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(t=0,e=s.length;t({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},a={type:{type:String,required:!0},...o},r="2"===s.i8[0]?(t,e)=>Object.assign(t,{attrs:e}):(t,e)=>Object.assign(t,e);function h(t){return(0,s.X3)(t)?(0,s.IU)(t):t}function l(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;return(0,s.X3)(e)?new Proxy(t,{}):t}function c(t,e){const i=t.options;i&&e&&Object.assign(i,e)}function d(t,e){t.labels=e}function u(t,e,i){const s=[];t.datasets=e.map((e=>{const n=t.datasets.find((t=>t[i]===e[i]));return n&&e.data&&!s.includes(n)?(s.push(n),Object.assign(n,e),n):{...e}}))}function f(t,e){const i={labels:[],datasets:[]};return d(i,t.labels),u(i,t.datasets,e),i}const g=(0,s.aZ)({props:a,setup(t,e){let{expose:i}=e;const o=(0,s.iH)(null),a=(0,s.XI)(null);i({chart:a});const r=()=>{if(!o.value)return;const{type:e,data:i,options:s,plugins:r,datasetIdKey:h}=t,c=f(i,h),d=l(c,i);a.value=new n.kL(o.value,{type:e,data:d,options:{...s},plugins:r})},g=()=>{const t=(0,s.IU)(a.value);t&&(t.destroy(),a.value=null)},p=e=>{e.update(t.updateMode)};return(0,s.bv)(r),(0,s.Jd)(g),(0,s.YP)([()=>t.options,()=>t.data],((e,i)=>{let[n,o]=e,[r,l]=i;const f=(0,s.IU)(a.value);if(!f)return;let g=!1;if(n){const t=h(n),e=h(r);t&&t!==e&&(c(f,t),g=!0)}if(o){const e=h(o.labels),i=h(l.labels),s=h(o.datasets),n=h(l.datasets);e!==i&&(d(f.config.data,e),g=!0),s&&s!==n&&(u(f.config.data,s,t.datasetIdKey),g=!0)}g&&p(f)}),{deep:!0}),()=>(0,s.h)("canvas",{ref:o})}});function p(t,e){return n.kL.register(e),(0,s.aZ)({props:o,setup(e,i){let{expose:n}=i;const o=(0,s.XI)(null),a=t=>{o.value=t?.chart};return n({chart:o}),()=>(0,s.h)(g,r({ref:a},{type:t,...e}))}})}const m=p("bar",n.vn),b=p("pie",n.tt)}}]); -//# sourceMappingURL=2005.3b769dc8.js.map \ No newline at end of file +class Hi{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,s){const n=e.listeners[s],o=e.duration;n.forEach((s=>s({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(i-e.start,o)})))}_refresh(){this._request||(this._running=!0,this._request=ee.call(window,(()=>{this._update(),this._request=null,this._running&&this._refresh()})))}_update(t=Date.now()){let e=0;this._charts.forEach(((i,s)=>{if(!i.running||!i.items.length)return;const n=i.items;let o,a=n.length-1,r=!1;for(;a>=0;--a)o=n[a],o._active?(o._total>i.duration&&(i.duration=o._total),o.tick(t),r=!0):(n[a]=n[n.length-1],n.pop());r&&(s.draw(),this._notify(s,i,t,"progress")),n.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),e+=n.length})),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce(((t,e)=>Math.max(t,e._duration)),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!!(e&&e.running&&e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var $i=new Hi;const Yi="transparent",Ui={boolean(t,e,i){return i>.5?e:t},color(t,e,i){const s=de(t||Yi),n=s.valid&&de(e||Yi);return n&&n.valid?n.mix(s,i).hexString():e},number(t,e,i){return t+(e-t)*i}};class Xi{constructor(t,e,i,s){const n=e[i];s=Je([t.to,s,n,t.from]);const o=Je([t.from,n,s]);this._active=!0,this._fn=t.fn||Ui[t.type||typeof o],this._easing=le[t.easing]||le.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const s=this._target[this._prop],n=i-this._start,o=this._duration-n;this._start=i,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=n,this._loop=!!t.loop,this._to=Je([t.to,e,s,t.from]),this._from=Je([t.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,s=this._prop,n=this._from,o=this._loop,a=this._to;let r;if(this._active=n!==a&&(o||e1?2-r:r,r=this._easing(Math.min(1,Math.max(0,r))),this._target[s]=this._fn(n,a,r))}wait(){const t=this._promises||(this._promises=[]);return new Promise(((e,i)=>{t.push({res:e,rej:i})}))}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let s=0;s{const n=t[s];if(!G(n))return;const o={};for(const t of e)o[t]=n[t];(Q(n.properties)&&n.properties||[s]).forEach((t=>{t!==s&&i.has(t)||i.set(t,o)}))}))}_animateOptions(t,e){const i=e.options,s=Zi(t,i);if(!s)return[];const n=this._createAnimations(s,i);return i.$shared&&Ki(t.options.$animations,i).then((()=>{t.options=i}),(()=>{})),n}_createAnimations(t,e){const i=this._properties,s=[],n=t.$animations||(t.$animations={}),o=Object.keys(e),a=Date.now();let r;for(r=o.length-1;r>=0;--r){const h=o[r];if("$"===h.charAt(0))continue;if("options"===h){s.push(...this._animateOptions(t,e));continue}const l=e[h];let c=n[h];const d=i.get(h);if(c){if(d&&c.active()){c.update(d,l,a);continue}c.cancel()}d&&d.duration?(n[h]=c=new Xi(d,t,h,l),s.push(c)):t[h]=l}return s}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const i=this._createAnimations(t,e);return i.length?($i.add(this._chart,i),!0):void 0}}function Ki(t,e){const i=[],s=Object.keys(e);for(let n=0;n0||!i&&e<0)return n.index}return null}function hs(t,e){const{chart:i,_cachedMeta:s}=t,n=i._stacks||(i._stacks={}),{iScale:o,vScale:a,index:r}=s,h=o.axis,l=a.axis,c=ns(o,a,s),d=e.length;let u;for(let f=0;fi[t].axis===e)).shift()}function cs(t,e){return ei(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function ds(t,e,i){return ei(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:i,index:e,mode:"default",type:"data"})}function us(t,e){const i=t.controller.index,s=t.vScale&&t.vScale.axis;if(s){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[s]||void 0===e[s][i])return;delete e[s][i],void 0!==e[s]._visualValues&&void 0!==e[s]._visualValues[i]&&delete e[s]._visualValues[i]}}}const fs=t=>"reset"===t||"none"===t,gs=(t,e)=>e?t:Object.assign({},t),ps=(t,e,i)=>t&&!e.hidden&&e._stacked&&{keys:ts(i,!0),values:null};class ms{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,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(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=ss(t.vScale,t),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(t){this.index!==t&&us(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),s=(t,e,i,s)=>"x"===t?e:"r"===t?s:i,n=e.xAxisID=et(i.xAxisID,ls(t,"x")),o=e.yAxisID=et(i.yAxisID,ls(t,"y")),a=e.rAxisID=et(i.rAxisID,ls(t,"r")),r=e.indexAxis,h=e.iAxisID=s(r,n,o,a),l=e.vAxisID=s(r,o,n,a);e.xScale=this.getScaleForId(n),e.yScale=this.getScaleForId(o),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(h),e.vScale=this.getScaleForId(l)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Jt(this._data,this),t._stacked&&us(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(G(e))this._data=is(e);else if(i!==e){if(i){Jt(i,this);const t=this._cachedMeta;us(t),t._parsed=[]}e&&Object.isExtensible(e)&&Gt(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let s=!1;this._dataCheck();const n=e._stacked;e._stacked=ss(e.vScale,e),e.stack!==i.stack&&(s=!0,us(e),e.stack=i.stack),this._resyncElements(t),(s||n!==e._stacked)&&hs(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:s}=this,{iScale:n,_stacked:o}=i,a=n.axis;let r,h,l,c=0===t&&e===s.length||i._sorted,d=t>0&&i._parsed[t-1];if(!1===this._parsing)i._parsed=s,i._sorted=!0,l=s;else{l=Q(s[t])?this.parseArrayData(i,s,t,e):G(s[t])?this.parseObjectData(i,s,t,e):this.parsePrimitiveData(i,s,t,e);const n=()=>null===h[a]||d&&h[a]e||c=0;--d)if(!f()){this.updateRangeFromParsed(h,t,u,r);break}return h}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let s,n,o;for(s=0,n=e.length;s=0&&tthis.getContext(i,s,e),g=h.resolveNamedOptions(d,u,f,c);return g.$shared&&(g.$shared=r,n[o]=Object.freeze(gs(g,r))),g}_resolveAnimations(t,e,i){const s=this.chart,n=this._cachedDataOpts,o=`animation-${e}`,a=n[o];if(a)return a;let r;if(!1!==s.options.animation){const s=this.chart.config,n=s.datasetAnimationScopeKeys(this._type,e),o=s.getOptionScopes(this.getDataset(),n);r=s.createResolver(o,this.getContext(t,i,e))}const h=new qi(s,r&&r.animations);return r&&r._cacheable&&(n[o]=Object.freeze(h)),h}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||fs(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),s=this._sharedOptions,n=this.getSharedOptions(i),o=this.includeOptions(e,n)||n!==s;return this.updateSharedOptions(n,e,i),{sharedOptions:n,includeOptions:o}}updateElement(t,e,i,s){fs(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i)}updateSharedOptions(t,e,i){t&&!fs(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,s){t.active=s;const n=this.getStyle(e,s);this._resolveAnimations(e,i,s).update(t,{options:!s&&this.getSharedOptions(n)||n})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[a,r,h]of this._syncList)this[a](r,h);this._syncList=[];const s=i.length,n=e.length,o=Math.min(n,s);o&&this.parse(0,o),n>s?this._insertElements(s,n-s,t):n{for(t.length+=e,a=t.length-1;a>=o;a--)t[a]=t[a-e]};for(r(n),a=t;at-e)))}return t._cache.$bar}function xs(t){const e=t.iScale,i=bs(e,t.type);let s,n,o,a,r=e._length;const h=()=>{32767!==o&&-32768!==o&&(xt(a)&&(r=Math.min(r,Math.abs(o-a)||r)),a=o)};for(s=0,n=i.length;s0?n[t-1]:null,r=tMath.abs(r)&&(h=r,l=a),e[i.axis]=l,e._custom={barStart:h,barEnd:l,start:n,end:o,min:a,max:r}}function Ms(t,e,i,s){return Q(t)?vs(t,e,i,s):e[i.axis]=i.parse(t,s),e}function ws(t,e,i,s){const n=t.iScale,o=t.vScale,a=n.getLabels(),r=n===o,h=[];let l,c,d,u;for(l=i,c=i+s;l=i?1:-1)}function Ps(t){let e,i,s,n,o;return t.horizontal?(e=t.base>t.x,i="left",s="right"):(e=t.baset.controller.options.grouped)),n=i.options.stacked,o=[],a=t=>{const i=t.controller.getParsed(e),s=i&&i[t.vScale.axis];if(Z(s)||isNaN(s))return!0};for(const r of s)if((void 0===e||!a(r))&&((!1===n||-1===o.indexOf(r.stack)||void 0===n&&void 0===r.stack)&&o.push(r.stack),r.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){const s=this._getStacks(t,i),n=void 0!==e?s.indexOf(e):-1;return-1===n?s.length-1:n}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,s=[];let n,o;for(n=0,o=e.data.length;nHt(t,r,h,!0)?1:Math.max(e,e*i,s,s*i),g=(t,e,s)=>Ht(t,r,h,!0)?-1:Math.min(e,e*i,s,s*i),p=f(0,l,d),m=f(Pt,c,u),b=g(Mt,l,d),x=g(Mt+Pt,c,u);s=(p-b)/2,n=(m-x)/2,o=-(p+b)/2,a=-(m+x)/2}return{ratioX:s,ratioY:n,offsetX:o,offsetY:a}}class Ls extends ms{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:t=>"spacing"!==t,_indexable:t=>"spacing"!==t&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return e.labels.map(((e,n)=>{const o=t.getDatasetMeta(0),a=o.controller.getStyle(n);return{text:e,fillStyle:a.backgroundColor,strokeStyle:a.borderColor,fontColor:s,lineWidth:a.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(n),index:n}}))}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}};constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,s=this._cachedMeta;if(!1===this._parsing)s._parsed=i;else{let n,o,a=t=>+i[t];if(G(i[t])){const{key:t="value"}=this._parsing;a=e=>+mt(i[e],t)}for(n=t,o=t+e;n0&&!isNaN(t)?wt*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],n=_e(e._parsed[t],i.options.locale);return{label:s[t]||"",value:n}}getMaxBorderWidth(t){let e=0;const i=this.chart;let s,n,o,a,r;if(!t)for(s=0,n=i.data.datasets.length;s{const o=t.getDatasetMeta(0),a=o.controller.getStyle(n);return{text:e,fillStyle:a.backgroundColor,strokeStyle:a.borderColor,fontColor:s,lineWidth:a.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(n),index:n}}))}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],n=_e(e._parsed[t].r,i.options.locale);return{label:s[t]||"",value:n}}parseObjectData(t,e,i,s){return vi.bind(this)(t,e,i,s)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach(((t,i)=>{const s=this.getParsed(i).r;!isNaN(s)&&this.chart.getDataVisibility(i)&&(se.max&&(e.max=s))})),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,s=Math.min(e.right-e.left,e.bottom-e.top),n=Math.max(s/2,0),o=Math.max(i.cutoutPercentage?n/100*i.cutoutPercentage:1,0),a=(n-o)/t.getVisibleDatasetCount();this.outerRadius=n-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,e,i,s){const n="reset"===s,o=this.chart,a=o.options,r=a.animation,h=this._cachedMeta.rScale,l=h.xCenter,c=h.yCenter,d=h.getIndexAngle(0)-.5*Mt;let u,f=d;const g=360/this.countVisibleElements();for(u=0;u{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&e++})),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?Ft(this.resolveDataElementOptions(t,e).angle||i):0}}class zs extends Ls{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}}function Fs(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Vs{static override(t){Object.assign(Vs.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return Fs()}parse(){return Fs()}format(){return Fs()}add(){return Fs()}diff(){return Fs()}startOf(){return Fs()}endOf(){return Fs()}}var Bs={_date:Vs};function js(t,e,i,s){const{controller:n,data:o,_sorted:a}=t,r=n._cachedMeta.iScale;if(r&&e===r.axis&&"r"!==e&&a&&o.length){const t=r._reversePixels?Kt:qt;if(!s)return t(o,e,i);if(n._sharedOptions){const s=o[0],n="function"===typeof s.getRange&&s.getRange(e);if(n){const s=t(o,e,i-n),a=t(o,e,i+n);return{lo:s.lo,hi:a.hi}}}}return{lo:0,hi:o.length-1}}function Ws(t,e,i,s,n){const o=t.getSortedVisibleDatasetMetas(),a=i[e];for(let r=0,h=o.length;r{t[a](e[i],n)&&(o.push({element:t,datasetIndex:s,index:h}),r=r||t.inRange(e.x,e.y,n))})),s&&!r?[]:o}var qs={evaluateInteractionItems:Ws,modes:{index(t,e,i,s){const n=Ti(e,t),o=i.axis||"x",a=i.includeInvisible||!1,r=i.intersect?Hs(t,n,o,s,a):Us(t,n,o,!1,s,a),h=[];return r.length?(t.getSortedVisibleDatasetMetas().forEach((t=>{const e=r[0].index,i=t.data[e];i&&!i.skip&&h.push({element:i,datasetIndex:t.index,index:e})})),h):[]},dataset(t,e,i,s){const n=Ti(e,t),o=i.axis||"xy",a=i.includeInvisible||!1;let r=i.intersect?Hs(t,n,o,s,a):Us(t,n,o,!1,s,a);if(r.length>0){const e=r[0].datasetIndex,i=t.getDatasetMeta(e).data;r=[];for(let t=0;tt.pos===e))}function Qs(t,e){return t.filter((t=>-1===Ks.indexOf(t.pos)&&t.box.axis===e))}function Gs(t,e){return t.sort(((t,i)=>{const s=e?i:t,n=e?t:i;return s.weight===n.weight?s.index-n.index:s.weight-n.weight}))}function Js(t){const e=[];let i,s,n,o,a,r;for(i=0,s=(t||[]).length;it.box.fullSize)),!0),s=Gs(Zs(e,"left"),!0),n=Gs(Zs(e,"right")),o=Gs(Zs(e,"top"),!0),a=Gs(Zs(e,"bottom")),r=Qs(e,"x"),h=Qs(e,"y");return{fullSize:i,leftAndTop:s.concat(o),rightAndBottom:n.concat(h).concat(a).concat(r),chartArea:Zs(e,"chartArea"),vertical:s.concat(n).concat(h),horizontal:o.concat(a).concat(r)}}function nn(t,e,i,s){return Math.max(t[i],e[i])+Math.max(t[s],e[s])}function on(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function an(t,e,i,s){const{pos:n,box:o}=i,a=t.maxPadding;if(!G(n)){i.size&&(t[n]-=i.size);const e=s[i.stack]||{size:0,count:1};e.size=Math.max(e.size,i.horizontal?o.height:o.width),i.size=e.size/e.count,t[n]+=i.size}o.getPadding&&on(a,o.getPadding());const r=Math.max(0,e.outerWidth-nn(a,t,"left","right")),h=Math.max(0,e.outerHeight-nn(a,t,"top","bottom")),l=r!==t.w,c=h!==t.h;return t.w=r,t.h=h,i.horizontal?{same:l,other:c}:{same:c,other:l}}function rn(t){const e=t.maxPadding;function i(i){const s=Math.max(e[i]-t[i],0);return t[i]+=s,s}t.y+=i("top"),t.x+=i("left"),i("right"),i("bottom")}function hn(t,e){const i=e.maxPadding;function s(t){const s={left:0,top:0,right:0,bottom:0};return t.forEach((t=>{s[t]=Math.max(e[t],i[t])})),s}return s(t?["left","right"]:["top","bottom"])}function ln(t,e,i,s){const n=[];let o,a,r,h,l,c;for(o=0,a=t.length,l=0;o{"function"===typeof t.beforeLayout&&t.beforeLayout()}));const c=h.reduce(((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1),0)||1,d=Object.freeze({outerWidth:e,outerHeight:i,padding:n,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/c,hBoxMaxHeight:a/2}),u=Object.assign({},n);on(u,Qe(s));const f=Object.assign({maxPadding:u,w:o,h:a,x:n.left,y:n.top},n),g=en(h.concat(l),d);ln(r.fullSize,f,d,g),ln(h,f,d,g),ln(l,f,d,g)&&ln(h,f,d,g),rn(f),dn(r.leftAndTop,f,d,g),f.x+=f.w,f.y+=f.h,dn(r.rightAndBottom,f,d,g),t.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},ot(r.chartArea,(e=>{const i=e.box;Object.assign(i,t.chartArea),i.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})}))}};class fn{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,s){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):i)}}isAttached(t){return!0}updateConfig(t){}}class gn extends fn{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const pn="$chartjs",mn={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},bn=t=>null===t||""===t;function xn(t,e){const i=t.style,s=t.getAttribute("height"),n=t.getAttribute("width");if(t[pn]={initial:{height:s,width:n,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",bn(n)){const e=Fi(t,"width");void 0!==e&&(t.width=e)}if(bn(s))if(""===t.style.height)t.height=t.width/(e||2);else{const e=Fi(t,"height");void 0!==e&&(t.height=e)}return t}const _n=!!zi&&{passive:!0};function yn(t,e,i){t.addEventListener(e,i,_n)}function vn(t,e,i){t.canvas.removeEventListener(e,i,_n)}function Mn(t,e){const i=mn[t.type]||t.type,{x:s,y:n}=Ti(t,e);return{type:i,chart:e,native:t,x:void 0!==s?s:null,y:void 0!==n?n:null}}function wn(t,e){for(const i of t)if(i===e||i.contains(e))return!0}function kn(t,e,i){const s=t.canvas,n=new MutationObserver((t=>{let e=!1;for(const i of t)e=e||wn(i.addedNodes,s),e=e&&!wn(i.removedNodes,s);e&&i()}));return n.observe(document,{childList:!0,subtree:!0}),n}function Sn(t,e,i){const s=t.canvas,n=new MutationObserver((t=>{let e=!1;for(const i of t)e=e||wn(i.removedNodes,s),e=e&&!wn(i.addedNodes,s);e&&i()}));return n.observe(document,{childList:!0,subtree:!0}),n}const Pn=new Map;let On=0;function An(){const t=window.devicePixelRatio;t!==On&&(On=t,Pn.forEach(((e,i)=>{i.currentDevicePixelRatio!==t&&e()})))}function Dn(t,e){Pn.size||window.addEventListener("resize",An),Pn.set(t,e)}function Cn(t){Pn.delete(t),Pn.size||window.removeEventListener("resize",An)}function Tn(t,e,i){const s=t.canvas,n=s&&wi(s);if(!n)return;const o=ie(((t,e)=>{const s=n.clientWidth;i(t,e),s{const e=t[0],i=e.contentRect.width,s=e.contentRect.height;0===i&&0===s||o(i,s)}));return a.observe(n),Dn(t,o),a}function Rn(t,e,i){i&&i.disconnect(),"resize"===e&&Cn(t)}function En(t,e,i){const s=t.canvas,n=ie((e=>{null!==t.ctx&&i(Mn(e,t))}),t);return yn(s,e,n),n}class Ln extends fn{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(xn(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[pn])return!1;const i=e[pn].initial;["height","width"].forEach((t=>{const s=i[t];Z(s)?e.removeAttribute(t):e.setAttribute(t,s)}));const s=i.style||{};return Object.keys(s).forEach((t=>{e.style[t]=s[t]})),e.width=e.width,delete e[pn],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),n={attach:kn,detach:Sn,resize:Tn},o=n[e]||En;s[e]=o(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),s=i[e];if(!s)return;const n={attach:Rn,detach:Rn,resize:Rn},o=n[e]||vn;o(t,e,s),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,s){return Li(t,e,i,s)}isAttached(t){const e=wi(t);return!(!e||!e.isConnected)}}function In(t){return!Mi()||"undefined"!==typeof OffscreenCanvas&&t instanceof OffscreenCanvas?gn:Ln}class zn{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return Lt(this.x)&&Lt(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const s={};return t.forEach((t=>{s[t]=i[t]&&i[t].active()?i[t]._to:this[t]})),s}}function Fn(t,e){const i=t.options.ticks,s=Vn(t),n=Math.min(i.maxTicksLimit||s,s),o=i.major.enabled?jn(e):[],a=o.length,r=o[0],h=o[a-1],l=[];if(a>n)return Wn(e,l,o,a/n),l;const c=Bn(o,e,n);if(a>0){let t,i;const s=a>1?Math.round((h-r)/(a-1)):null;for(Nn(e,l,c,Z(s)?0:r-s,r),t=0,i=a-1;tn)return t}return Math.max(n,1)}function jn(t){const e=[];let i,s;for(i=0,s=t.length;i"left"===t?"right":"right"===t?"left":t,Yn=(t,e,i)=>"top"===e||"left"===e?t[e]+i:t[e]-i,Un=(t,e)=>Math.min(e||t,t);function Xn(t,e){const i=[],s=t.length/e,n=t.length;let o=0;for(;oa+r)))return l}function Kn(t,e){ot(t,(t=>{const i=t.gc,s=i.length/2;let n;if(s>e){for(n=0;ns?s:i,s=n&&i>s?i:s,{min:tt(i,tt(s,i)),max:tt(s,tt(i,s))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){const e=this._labelItems||(this._labelItems=this._computeLabelItems(t));return e}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){nt(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:s,grace:n,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=ti(this,n,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const r=a=n||i<=1||!this.isHorizontal())return void(this.labelRotation=s);const l=this._getLabelSizes(),c=l.widest.width,d=l.highest.height,u=$t(this.chart.width-c,0,this.maxWidth);o=t.offset?this.maxWidth/i:u/(i-1),c+6>o&&(o=u/(i-(t.offset?.5:1)),a=this.maxHeight-Zn(t.grid)-e.padding-Qn(t.title,this.chart.options.font),r=Math.sqrt(c*c+d*d),h=Vt(Math.min(Math.asin($t((l.highest.height+6)/o,-1,1)),Math.asin($t(a/r,-1,1))-Math.asin($t(d/r,-1,1)))),h=Math.max(s,Math.min(n,h))),this.labelRotation=h}afterCalculateLabelRotation(){nt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){nt(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:s,grid:n}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const o=Qn(s,e.options.font);if(a?(t.width=this.maxWidth,t.height=Zn(n)+o):(t.height=this.maxHeight,t.width=Zn(n)+o),i.display&&this.ticks.length){const{first:e,last:s,widest:n,highest:o}=this._getLabelSizes(),r=2*i.padding,h=Ft(this.labelRotation),l=Math.cos(h),c=Math.sin(h);if(a){const e=i.mirror?0:c*n.width+l*o.height;t.height=Math.min(this.maxHeight,t.height+e+r)}else{const e=i.mirror?0:l*n.width+c*o.height;t.width=Math.min(this.maxWidth,t.width+e+r)}this._calculatePadding(e,s,c,l)}}this._handleMargins(),a?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,s){const{ticks:{align:n,padding:o},position:a}=this.options,r=0!==this.labelRotation,h="top"!==a&&"x"===this.axis;if(this.isHorizontal()){const a=this.getPixelForTick(0)-this.left,l=this.right-this.getPixelForTick(this.ticks.length-1);let c=0,d=0;r?h?(c=s*t.width,d=i*e.height):(c=i*t.height,d=s*e.width):"start"===n?d=e.width:"end"===n?c=t.width:"inner"!==n&&(c=t.width/2,d=e.width/2),this.paddingLeft=Math.max((c-a+o)*this.width/(this.width-a),0),this.paddingRight=Math.max((d-l+o)*this.width/(this.width-l),0)}else{let i=e.height/2,s=t.height/2;"start"===n?(i=0,s=t.height):"end"===n&&(i=e.height,s=0),this.paddingTop=i+o,this.paddingBottom=s+o}}_handleMargins(){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(){nt(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,i=t.length;e({width:o[t]||0,height:a[t]||0});return{first:w(0),last:w(e-1),widest:w(v),highest:w(M),widths:o,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return Yt(this._alignToPixels?Re(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&ta*s?a/i:r/s:r*s0}_computeGridLineItems(t){const e=this.axis,i=this.chart,s=this.options,{grid:n,position:o,border:a}=s,r=n.offset,h=this.isHorizontal(),l=this.ticks,c=l.length+(r?1:0),d=Zn(n),u=[],f=a.setContext(this.getContext()),g=f.display?f.width:0,p=g/2,m=function(t){return Re(i,t,g)};let b,x,_,y,v,M,w,k,S,P,O,A;if("top"===o)b=m(this.bottom),M=this.bottom-d,k=b-p,P=m(t.top)+p,A=t.bottom;else if("bottom"===o)b=m(this.top),P=t.top,A=m(t.bottom)-p,M=b+p,k=this.top+d;else if("left"===o)b=m(this.right),v=this.right-d,w=b-p,S=m(t.left)+p,O=t.right;else if("right"===o)b=m(this.left),S=t.left,O=m(t.right)-p,v=b+p,w=this.left+d;else if("x"===e){if("center"===o)b=m((t.top+t.bottom)/2+.5);else if(G(o)){const t=Object.keys(o)[0],e=o[t];b=m(this.chart.scales[t].getPixelForValue(e))}P=t.top,A=t.bottom,M=b+p,k=M+d}else if("y"===e){if("center"===o)b=m((t.left+t.right)/2);else if(G(o)){const t=Object.keys(o)[0],e=o[t];b=m(this.chart.scales[t].getPixelForValue(e))}v=b-p,w=v-d,S=t.left,O=t.right}const D=et(s.ticks.maxTicksLimit,c),C=Math.max(1,Math.ceil(c/D));for(x=0;xe.value===t));if(s>=0){const t=e.setContext(this.getContext(s));return t.lineWidth}return 0}drawGrid(t){const e=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let n,o;const a=(t,e,s)=>{s.width&&s.color&&(i.save(),i.lineWidth=s.width,i.strokeStyle=s.color,i.setLineDash(s.borderDash||[]),i.lineDashOffset=s.borderDashOffset,i.beginPath(),i.moveTo(t.x,t.y),i.lineTo(e.x,e.y),i.stroke(),i.restore())};if(e.display)for(n=0,o=s.length;n{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let n,o;for(n=0,o=e.length;n{const s=i.split("."),n=s.pop(),o=[t].concat(s).join("."),a=e[i].split("."),r=a.pop(),h=a.join(".");De.route(o,n,h,r)}))}function ao(t){return"id"in t&&"defaults"in t}class ro{constructor(){this.controllers=new so(ms,"datasets",!0),this.elements=new so(zn,"elements"),this.plugins=new so(Object,"plugins"),this.scales=new so(io,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach((e=>{const s=i||this._getRegistryForType(e);i||s.isForType(e)||s===this.plugins&&e.id?this._exec(t,s,e):ot(e,(e=>{const s=i||this._getRegistryForType(e);this._exec(t,s,e)}))}))}_exec(t,e,i){const s=bt(t);nt(i["before"+s],[],i),e[t](i),nt(i["after"+s],[],i)}_getRegistryForType(t){for(let e=0;et.filter((t=>!e.some((e=>t.plugin.id===e.plugin.id))));this._notify(s(e,i),t,"stop"),this._notify(s(i,e),t,"start")}}function co(t){const e={},i=[],s=Object.keys(ho.plugins.items);for(let o=0;o1&&xo(t[0].toLowerCase());if(e)return e}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function vo(t,e,i){if(i[e+"AxisID"]===t)return{axis:e}}function Mo(t,e){if(e.data&&e.data.datasets){const i=e.data.datasets.filter((e=>e.xAxisID===t||e.yAxisID===t));if(i.length)return vo(t,"x",i[0])||vo(t,"y",i[0])}return{}}function wo(t,e){const i=ke[t.type]||{scales:{}},s=e.scales||{},n=po(t.type,e),o=Object.create(null);return Object.keys(s).forEach((e=>{const a=s[e];if(!G(a))return console.error(`Invalid scale configuration for scale: ${e}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${e}`);const r=yo(e,a,Mo(e,t),De.scales[a.type]),h=bo(r,n),l=i.scales||{};o[e]=dt(Object.create(null),[{axis:r},a,l[r],l[h]])})),t.data.datasets.forEach((i=>{const n=i.type||t.type,a=i.indexAxis||po(n,e),r=ke[n]||{},h=r.scales||{};Object.keys(h).forEach((t=>{const e=mo(t,a),n=i[e+"AxisID"]||e;o[n]=o[n]||Object.create(null),dt(o[n],[{axis:e},s[n],h[t]])}))})),Object.keys(o).forEach((t=>{const e=o[t];dt(e,[De.scales[e.type],De.scale])})),o}function ko(t){const e=t.options||(t.options={});e.plugins=et(e.plugins,{}),e.scales=wo(t,e)}function So(t){return t=t||{},t.datasets=t.datasets||[],t.labels=t.labels||[],t}function Po(t){return t=t||{},t.data=So(t.data),ko(t),t}const Oo=new Map,Ao=new Set;function Do(t,e){let i=Oo.get(t);return i||(i=e(),Oo.set(t,i),Ao.add(i)),i}const Co=(t,e,i)=>{const s=mt(e,i);void 0!==s&&t.add(s)};class To{constructor(t){this._config=Po(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=So(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),ko(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Do(t,(()=>[[`datasets.${t}`,""]]))}datasetAnimationScopeKeys(t,e){return Do(`${t}.transition.${e}`,(()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]]))}datasetElementScopeKeys(t,e){return Do(`${t}-${e}`,(()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]]))}pluginScopeKeys(t){const e=t.id,i=this.type;return Do(`${i}-plugin-${e}`,(()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]]))}_cachedScopes(t,e){const i=this._scopeCache;let s=i.get(t);return s&&!e||(s=new Map,i.set(t,s)),s}getOptionScopes(t,e,i){const{options:s,type:n}=this,o=this._cachedScopes(t,i),a=o.get(e);if(a)return a;const r=new Set;e.forEach((e=>{t&&(r.add(t),e.forEach((e=>Co(r,t,e)))),e.forEach((t=>Co(r,s,t))),e.forEach((t=>Co(r,ke[n]||{},t))),e.forEach((t=>Co(r,De,t))),e.forEach((t=>Co(r,Se,t)))}));const h=Array.from(r);return 0===h.length&&h.push(Object.create(null)),Ao.has(e)&&o.set(e,h),h}chartOptionScopes(){const{options:t,type:e}=this;return[t,ke[e]||{},De.datasets[e]||{},{type:e},De,Se]}resolveNamedOptions(t,e,i,s=[""]){const n={$shared:!0},{resolver:o,subPrefixes:a}=Ro(this._resolverCache,t,s);let r=o;if(Lo(o,e)){n.$shared=!1,i=_t(i)?i():i;const e=this.createResolver(t,i,a);r=si(o,i,e)}for(const h of e)n[h]=r[h];return n}createResolver(t,e,i=[""],s){const{resolver:n}=Ro(this._resolverCache,t,i);return G(e)?si(n,e,void 0,s):n}}function Ro(t,e,i){let s=t.get(e);s||(s=new Map,t.set(e,s));const n=i.join();let o=s.get(n);if(!o){const t=ii(e,i);o={resolver:t,subPrefixes:i.filter((t=>!t.toLowerCase().includes("hover")))},s.set(n,o)}return o}const Eo=t=>G(t)&&Object.getOwnPropertyNames(t).reduce(((e,i)=>e||_t(t[i])),!1);function Lo(t,e){const{isScriptable:i,isIndexable:s}=ni(t);for(const n of e){const e=i(n),o=s(n),a=(o||e)&&t[n];if(e&&(_t(a)||Eo(a))||o&&Q(a))return!0}return!1}var Io="4.4.0";const zo=["top","bottom","left","right","chartArea"];function Fo(t,e){return"top"===t||"bottom"===t||-1===zo.indexOf(t)&&"x"===e}function Vo(t,e){return function(i,s){return i[t]===s[t]?i[e]-s[e]:i[t]-s[t]}}function Bo(t){const e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),nt(i&&i.onComplete,[t],e)}function jo(t){const e=t.chart,i=e.options.animation;nt(i&&i.onProgress,[t],e)}function Wo(t){return Mi()&&"string"===typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const No={},Ho=t=>{const e=Wo(t);return Object.values(No).filter((t=>t.canvas===e)).pop()};function $o(t,e,i){const s=Object.keys(t);for(const n of s){const s=+n;if(s>=e){const o=t[n];delete t[n],(i>0||s>e)&&(t[s+i]=o)}}}function Yo(t,e,i,s){return i&&"mouseout"!==t.type?s?e:t:null}function Uo(t,e,i){return t.options.clip?t[i]:e[i]}function Xo(t,e){const{xScale:i,yScale:s}=t;return i&&s?{left:Uo(i,e,"left"),right:Uo(i,e,"right"),top:Uo(s,e,"top"),bottom:Uo(s,e,"bottom")}:e}class qo{static defaults=De;static instances=No;static overrides=ke;static registry=ho;static version=Io;static getChart=Ho;static register(...t){ho.add(...t),Ko()}static unregister(...t){ho.remove(...t),Ko()}constructor(t,e){const i=this.config=new To(e),s=Wo(t),n=Ho(s);if(n)throw new Error("Canvas is already in use. Chart with ID '"+n.id+"' must be destroyed before the canvas with ID '"+n.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||In(s)),this.platform.updateConfig(i);const a=this.platform.acquireContext(s,o.aspectRatio),r=a&&a.canvas,h=r&&r.height,l=r&&r.width;this.id=K(),this.ctx=a,this.canvas=r,this.width=l,this.height=h,this._options=o,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 lo,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=se((t=>this.update(t)),o.resizeDelay||0),this._dataChanges=[],No[this.id]=this,a&&r?($i.listen(this,"complete",Bo),$i.listen(this,"progress",jo),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:s,_aspectRatio:n}=this;return Z(t)?e&&n?n:s?i/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return ho}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Ii(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Ee(this.canvas,this.ctx),this}stop(){return $i.stop(this),this}resize(t,e){$i.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,s=this.canvas,n=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(s,t,e,n),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),r=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,Ii(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),nt(i.onResize,[this,o],this),this.attached&&this._doResize(r)&&this.render())}ensureScalesHaveIDs(){const t=this.options,e=t.scales||{};ot(e,((t,e)=>{t.id=e}))}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,s=Object.keys(i).reduce(((t,e)=>(t[e]=!1,t)),{});let n=[];e&&(n=n.concat(Object.keys(e).map((t=>{const i=e[t],s=yo(t,i),n="r"===s,o="x"===s;return{options:i,dposition:n?"chartArea":o?"bottom":"left",dtype:n?"radialLinear":o?"category":"linear"}})))),ot(n,(e=>{const n=e.options,o=n.id,a=yo(o,n),r=et(n.type,e.dtype);void 0!==n.position&&Fo(n.position,a)===Fo(e.dposition)||(n.position=e.dposition),s[o]=!0;let h=null;if(o in i&&i[o].type===r)h=i[o];else{const t=ho.getScale(r);h=new t({id:o,type:r,ctx:this.ctx,chart:this}),i[h.id]=h}h.init(n,t)})),ot(s,((t,e)=>{t||delete i[e]})),ot(i,(t=>{un.configure(this,t,t.options),un.addBox(this,t)}))}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort(((t,e)=>t.index-e.index)),i>e){for(let t=e;te.length&&delete this._stacks,t.forEach(((t,i)=>{0===e.filter((e=>e===t._dataset)).length&&this._destroyDatasetMeta(i)}))}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=e.length;i{this.getDatasetMeta(e).controller.reset()}),this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const n=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let h=0,l=this.data.datasets.length;h{t.reset()})),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Vo("z","_idx"));const{_active:a,_lastEvent:r}=this;r?this._eventHandler(r,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){ot(this.scales,(t=>{un.removeBox(this,t)})),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);yt(e,i)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:n}of e){const e="_removeElements"===i?-n:n;$o(t,s,e)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=e=>new Set(t.filter((t=>t[0]===e)).map(((t,e)=>e+","+t.splice(1).join(",")))),s=i(0);for(let n=1;nt.split(","))).map((t=>({method:t[1],start:+t[2],count:+t[3]})))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;un.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],ot(this.boxes,(t=>{i&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))}),this),this._layers.forEach(((t,e)=>{t._idx=e})),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i=t._clip,s=!i.disabled,n=Xo(t,this.chartArea),o={meta:t,index:t.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",o)&&(s&&Fe(e,{left:!1===i.left?0:n.left-i.left,right:!1===i.right?this.width:n.right+i.right,top:!1===i.top?0:n.top-i.top,bottom:!1===i.bottom?this.height:n.bottom+i.bottom}),t.controller.draw(),s&&Ve(e),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(t){return ze(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,s){const n=qs.modes[e];return"function"===typeof n?n(this,t,i,s):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let s=i.filter((t=>t&&t._dataset===e)).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=ei(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return"boolean"===typeof i.hidden?!i.hidden:!e.hidden}setDatasetVisibility(t,e){const i=this.getDatasetMeta(t);i.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const s=i?"show":"hide",n=this.getDatasetMeta(t),o=n.controller._resolveAnimations(void 0,s);xt(e)?(n.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),o.update(n,{visible:i}),this.update((e=>e.datasetIndex===t?s:void 0)))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),$i.remove(this),t=0,e=this.data.datasets.length;t{e.addEventListener(this,i,s),t[i]=s},s=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};ot(this.options.events,(t=>i(t,s)))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(i,s)=>{e.addEventListener(this,i,s),t[i]=s},s=(i,s)=>{t[i]&&(e.removeEventListener(this,i,s),delete t[i])},n=(t,e)=>{this.canvas&&this.resize(t,e)};let o;const a=()=>{s("attach",a),this.attached=!0,this.resize(),i("resize",n),i("detach",o)};o=()=>{this.attached=!1,s("resize",n),this._stop(),this._resize(0,0),i("attach",a)},e.isAttached(this.canvas)?a():o()}unbindEvents(){ot(this._listeners,((t,e)=>{this.platform.removeEventListener(this,e,t)})),this._listeners={},ot(this._responsiveListeners,((t,e)=>{this.platform.removeEventListener(this,e,t)})),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const s=i?"set":"remove";let n,o,a,r;for("dataset"===e&&(n=this.getDatasetMeta(t[0].datasetIndex),n.controller["_"+s+"DatasetHoverStyle"]()),a=0,r=t.length;a{const i=this.getDatasetMeta(t);if(!i)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:i.data[e],index:e}})),s=!at(i,e);s&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return 1===this._plugins._cache.filter((e=>e.plugin.id===t)).length}_updateHoverStyles(t,e,i){const s=this.options.hover,n=(t,e)=>t.filter((t=>!e.some((e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)))),o=n(e,t),a=i?t:n(t,e);o.length&&this.updateHoverStyle(o,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",i,s))return;const n=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(n||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:s=[],options:n}=this,o=e,a=this._getActiveElements(t,s,i,o),r=vt(t),h=Yo(t,this._lastEvent,i,r);i&&(this._lastEvent=null,nt(n.onHover,[t,a,this],this),r&&nt(n.onClick,[t,a,this],this));const l=!at(a,s);return(l||e)&&(this._active=a,this._updateHoverStyles(a,s,e)),this._lastEvent=h,l}_getActiveElements(t,e,i,s){if("mouseout"===t.type)return[];if(!i)return e;const n=this.options.hover;return this.getElementsAtEventForMode(t,n.mode,n,s)}}function Ko(){return ot(qo.instances,(t=>t._plugins.invalidate()))}function Zo(t,e,i){const{startAngle:s,pixelMargin:n,x:o,y:a,outerRadius:r,innerRadius:h}=e;let l=n/r;t.beginPath(),t.arc(o,a,r,s-l,i+l),h>n?(l=n/h,t.arc(o,a,h,i+l,s-l,!0)):t.arc(o,a,n,i+Pt,s-Pt),t.closePath(),t.clip()}function Qo(t){return qe(t,["outerStart","outerEnd","innerStart","innerEnd"])}function Go(t,e,i,s){const n=Qo(t.options.borderRadius),o=(i-e)/2,a=Math.min(o,s*e/2),r=t=>{const e=(i-Math.min(o,t))*s/2;return $t(t,0,Math.min(o,e))};return{outerStart:r(n.outerStart),outerEnd:r(n.outerEnd),innerStart:$t(n.innerStart,0,a),innerEnd:$t(n.innerEnd,0,a)}}function Jo(t,e,i,s){return{x:i+t*Math.cos(e),y:s+t*Math.sin(e)}}function ta(t,e,i,s,n,o){const{x:a,y:r,startAngle:h,pixelMargin:l,innerRadius:c}=e,d=Math.max(e.outerRadius+s+i-l,0),u=c>0?c+s+i+l:0;let f=0;const g=n-h;if(s){const t=c>0?c-s:0,e=d>0?d-s:0,i=(t+e)/2,n=0!==i?g*i/(i+s):g;f=(g-n)/2}const p=Math.max(.001,g*d-i/Mt)/d,m=(g-p)/2,b=h+m+f,x=n-m-f,{outerStart:_,outerEnd:y,innerStart:v,innerEnd:M}=Go(e,u,d,x-b),w=d-_,k=d-y,S=b+_/w,P=x-y/k,O=u+v,A=u+M,D=b+v/O,C=x-M/A;if(t.beginPath(),o){const e=(S+P)/2;if(t.arc(a,r,d,S,e),t.arc(a,r,d,e,P),y>0){const e=Jo(k,P,a,r);t.arc(e.x,e.y,y,P,x+Pt)}const i=Jo(A,x,a,r);if(t.lineTo(i.x,i.y),M>0){const e=Jo(A,C,a,r);t.arc(e.x,e.y,M,x+Pt,C+Math.PI)}const s=(x-M/u+(b+v/u))/2;if(t.arc(a,r,u,x-M/u,s,!0),t.arc(a,r,u,s,b+v/u,!0),v>0){const e=Jo(O,D,a,r);t.arc(e.x,e.y,v,D+Math.PI,b-Pt)}const n=Jo(w,b,a,r);if(t.lineTo(n.x,n.y),_>0){const e=Jo(w,S,a,r);t.arc(e.x,e.y,_,b-Pt,S)}}else{t.moveTo(a,r);const e=Math.cos(S)*d+a,i=Math.sin(S)*d+r;t.lineTo(e,i);const s=Math.cos(P)*d+a,n=Math.sin(P)*d+r;t.lineTo(s,n)}t.closePath()}function ea(t,e,i,s,n){const{fullCircles:o,startAngle:a,circumference:r}=e;let h=e.endAngle;if(o){ta(t,e,i,s,h,n);for(let e=0;e"borderDash"!==t};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(t){super(),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,t&&Object.assign(this,t)}inRange(t,e,i){const s=this.getProps(["x","y"],i),{angle:n,distance:o}=jt(s,{x:t,y:e}),{startAngle:a,endAngle:r,innerRadius:h,outerRadius:l,circumference:c}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),d=(this.options.spacing+this.options.borderWidth)/2,u=et(c,r-a),f=u>=wt||Ht(n,a,r),g=Ut(o,h+d,l+d);return f&&g}getCenterPoint(t){const{x:e,y:i,startAngle:s,endAngle:n,innerRadius:o,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:r,spacing:h}=this.options,l=(s+n)/2,c=(o+a+h+r)/2;return{x:e+Math.cos(l)*c,y:i+Math.sin(l)*c}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:i}=this,s=(e.offset||0)/4,n=(e.spacing||0)/2,o=e.circular;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=i>wt?Math.floor(i/wt):0,0===i||this.innerRadius<0||this.outerRadius<0)return;t.save();const a=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(a)*s,Math.sin(a)*s);const r=1-Math.sin(Math.min(Mt,i||0)),h=s*r;t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor,ea(t,this,h,n,o),ia(t,this,h,n,o),t.restore()}}function na(t,e){const{x:i,y:s,base:n,width:o,height:a}=t.getProps(["x","y","base","width","height"],e);let r,h,l,c,d;return t.horizontal?(d=a/2,r=Math.min(i,n),h=Math.max(i,n),l=s-d,c=s+d):(d=o/2,r=i-d,h=i+d,l=Math.min(s,n),c=Math.max(s,n)),{left:r,top:l,right:h,bottom:c}}function oa(t,e,i,s){return t?0:$t(e,i,s)}function aa(t,e,i){const s=t.options.borderWidth,n=t.borderSkipped,o=Ke(s);return{t:oa(n.top,o.top,0,i),r:oa(n.right,o.right,0,e),b:oa(n.bottom,o.bottom,0,i),l:oa(n.left,o.left,0,e)}}function ra(t,e,i){const{enableBorderRadius:s}=t.getProps(["enableBorderRadius"]),n=t.options.borderRadius,o=Ze(n),a=Math.min(e,i),r=t.borderSkipped,h=s||G(n);return{topLeft:oa(!h||r.top||r.left,o.topLeft,0,a),topRight:oa(!h||r.top||r.right,o.topRight,0,a),bottomLeft:oa(!h||r.bottom||r.left,o.bottomLeft,0,a),bottomRight:oa(!h||r.bottom||r.right,o.bottomRight,0,a)}}function ha(t){const e=na(t),i=e.right-e.left,s=e.bottom-e.top,n=aa(t,i/2,s/2),o=ra(t,i/2,s/2);return{outer:{x:e.left,y:e.top,w:i,h:s,radius:o},inner:{x:e.left+n.l,y:e.top+n.t,w:i-n.l-n.r,h:s-n.t-n.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(n.t,n.l)),topRight:Math.max(0,o.topRight-Math.max(n.t,n.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(n.b,n.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(n.b,n.r))}}}}function la(t,e,i,s){const n=null===e,o=null===i,a=n&&o,r=t&&!a&&na(t,s);return r&&(n||Ut(e,r.left,r.right))&&(o||Ut(i,r.top,r.bottom))}function ca(t){return t.topLeft||t.topRight||t.bottomLeft||t.bottomRight}function da(t,e){t.rect(e.x,e.y,e.w,e.h)}function ua(t,e,i={}){const s=t.x!==i.x?-e:0,n=t.y!==i.y?-e:0,o=(t.x+t.w!==i.x+i.w?e:0)-s,a=(t.y+t.h!==i.y+i.h?e:0)-n;return{x:t.x+s,y:t.y+n,w:t.w+o,h:t.h+a,radius:t.radius}}class fa extends zn{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:i,backgroundColor:s}}=this,{inner:n,outer:o}=ha(this),a=ca(o.radius)?He:da;t.save(),o.w===n.w&&o.h===n.h||(t.beginPath(),a(t,ua(o,e,n)),t.clip(),a(t,ua(n,-e,o)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),a(t,ua(n,e)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,e,i){return la(this,t,e,i)}inXRange(t,e){return la(this,t,null,e)}inYRange(t,e){return la(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:s,horizontal:n}=this.getProps(["x","y","base","horizontal"],t);return{x:n?(e+s)/2:e,y:n?i:(i+s)/2}}getRange(t){return"x"===t?this.width/2:this.height/2}}const ga=["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)"],pa=ga.map((t=>t.replace("rgb(","rgba(").replace(")",", 0.5)")));function ma(t){return ga[t%ga.length]}function ba(t){return pa[t%pa.length]}function xa(t,e){return t.borderColor=ma(e),t.backgroundColor=ba(e),++e}function _a(t,e){return t.backgroundColor=t.data.map((()=>ma(e++))),e}function ya(t,e){return t.backgroundColor=t.data.map((()=>ba(e++))),e}function va(t){let e=0;return(i,s)=>{const n=t.getDatasetMeta(s).controller;n instanceof Ls?e=_a(i,e):n instanceof Is?e=ya(i,e):n&&(e=xa(i,e))}}function Ma(t){let e;for(e in t)if(t[e].borderColor||t[e].backgroundColor)return!0;return!1}function wa(t){return t&&(t.borderColor||t.backgroundColor)}var ka={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(t,e,i){if(!i.enabled)return;const{data:{datasets:s},options:n}=t.config,{elements:o}=n;if(!i.forceOverride&&(Ma(s)||wa(n)||o&&Ma(o)))return;const a=va(t);s.forEach(a)}};class Sa extends zn{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.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(t,e){const i=this.options;if(this.left=0,this.top=0,!i.display)return void(this.width=this.height=this.right=this.bottom=0);this.width=this.right=t,this.height=this.bottom=e;const s=Q(i.text)?i.text.length:1;this._padding=Qe(i.padding);const n=s*Ge(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=n:this.width=n}isHorizontal(){const t=this.options.position;return"top"===t||"bottom"===t}_drawArgs(t){const{top:e,left:i,bottom:s,right:n,options:o}=this,a=o.align;let r,h,l,c=0;return this.isHorizontal()?(h=oe(a,i,n),l=e+t,r=n-i):("left"===o.position?(h=i+t,l=oe(a,s,e),c=-.5*Mt):(h=n-t,l=oe(a,e,s),c=.5*Mt),r=s-e),{titleX:h,titleY:l,maxWidth:r,rotation:c}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=Ge(e.font),s=i.lineHeight,n=s/2+this._padding.top,{titleX:o,titleY:a,maxWidth:r,rotation:h}=this._drawArgs(n);Ne(t,e.text,0,0,i,{color:e.color,maxWidth:r,rotation:h,textAlign:ne(e.align),textBaseline:"middle",translation:[o,a]})}}function Pa(t,e){const i=new Sa({ctx:t.ctx,options:e,chart:t});un.configure(t,i,e),un.addBox(t,i),t.titleBlock=i}var Oa={id:"title",_element:Sa,start(t,e,i){Pa(t,i)},stop(t){const e=t.titleBlock;un.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,i){const s=t.titleBlock;un.configure(t,s,i),s.options=i},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};new WeakMap;const Aa={average(t){if(!t.length)return!1;let e,i,s=0,n=0,o=0;for(e=0,i=t.length;e-1?t.split("\n"):t}function Ta(t,e){const{element:i,datasetIndex:s,index:n}=e,o=t.getDatasetMeta(s).controller,{label:a,value:r}=o.getLabelAndValue(n);return{chart:t,label:a,parsed:o.getParsed(n),raw:t.data.datasets[s].data[n],formattedValue:r,dataset:o.getDataset(),dataIndex:n,datasetIndex:s,element:i}}function Ra(t,e){const i=t.chart.ctx,{body:s,footer:n,title:o}=t,{boxWidth:a,boxHeight:r}=e,h=Ge(e.bodyFont),l=Ge(e.titleFont),c=Ge(e.footerFont),d=o.length,u=n.length,f=s.length,g=Qe(e.padding);let p=g.height,m=0,b=s.reduce(((t,e)=>t+e.before.length+e.lines.length+e.after.length),0);if(b+=t.beforeBody.length+t.afterBody.length,d&&(p+=d*l.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),b){const t=e.displayColors?Math.max(r,h.lineHeight):h.lineHeight;p+=f*t+(b-f)*h.lineHeight+(b-1)*e.bodySpacing}u&&(p+=e.footerMarginTop+u*c.lineHeight+(u-1)*e.footerSpacing);let x=0;const _=function(t){m=Math.max(m,i.measureText(t).width+x)};return i.save(),i.font=l.string,ot(t.title,_),i.font=h.string,ot(t.beforeBody.concat(t.afterBody),_),x=e.displayColors?a+2+e.boxPadding:0,ot(s,(t=>{ot(t.before,_),ot(t.lines,_),ot(t.after,_)})),x=0,i.font=c.string,ot(t.footer,_),i.restore(),m+=g.width,{width:m,height:p}}function Ea(t,e){const{y:i,height:s}=e;return it.height-s/2?"bottom":"center"}function La(t,e,i,s){const{x:n,width:o}=s,a=i.caretSize+i.caretPadding;return"left"===t&&n+o+a>e.width||("right"===t&&n-o-a<0||void 0)}function Ia(t,e,i,s){const{x:n,width:o}=i,{width:a,chartArea:{left:r,right:h}}=t;let l="center";return"center"===s?l=n<=(r+h)/2?"left":"right":n<=o/2?l="left":n>=a-o/2&&(l="right"),La(l,t,e,i)&&(l="center"),l}function za(t,e,i){const s=i.yAlign||e.yAlign||Ea(t,i);return{xAlign:i.xAlign||e.xAlign||Ia(t,e,i,s),yAlign:s}}function Fa(t,e){let{x:i,width:s}=t;return"right"===e?i-=s:"center"===e&&(i-=s/2),i}function Va(t,e,i){let{y:s,height:n}=t;return"top"===e?s+=i:s-="bottom"===e?n+i:n/2,s}function Ba(t,e,i,s){const{caretSize:n,caretPadding:o,cornerRadius:a}=t,{xAlign:r,yAlign:h}=i,l=n+o,{topLeft:c,topRight:d,bottomLeft:u,bottomRight:f}=Ze(a);let g=Fa(e,r);const p=Va(e,h,l);return"center"===h?"left"===r?g+=l:"right"===r&&(g-=l):"left"===r?g-=Math.max(c,u)+n:"right"===r&&(g+=Math.max(d,f)+n),{x:$t(g,0,s.width-e.width),y:$t(p,0,s.height-e.height)}}function ja(t,e,i){const s=Qe(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-s.right:t.x+s.left}function Wa(t){return Da([],Ca(t))}function Na(t,e,i){return ei(t,{tooltip:e,tooltipItems:i,type:"tooltip"})}function Ha(t,e){const i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}const $a={beforeTitle:q,title(t){if(t.length>0){const e=t[0],i=e.chart.data.labels,s=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(s>0&&e.dataIndex{const e={before:[],lines:[],after:[]},n=Ha(i,t);Da(e.before,Ca(Ya(n,"beforeLabel",this,t))),Da(e.lines,Ya(n,"label",this,t)),Da(e.after,Ca(Ya(n,"afterLabel",this,t))),s.push(e)})),s}getAfterBody(t,e){return Wa(Ya(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,s=Ya(i,"beforeFooter",this,t),n=Ya(i,"footer",this,t),o=Ya(i,"afterFooter",this,t);let a=[];return a=Da(a,Ca(s)),a=Da(a,Ca(n)),a=Da(a,Ca(o)),a}_createItems(t){const e=this._active,i=this.chart.data,s=[],n=[],o=[];let a,r,h=[];for(a=0,r=e.length;at.filter(e,s,n,i)))),t.itemSort&&(h=h.sort(((e,s)=>t.itemSort(e,s,i)))),ot(h,(e=>{const i=Ha(t.callbacks,e);s.push(Ya(i,"labelColor",this,e)),n.push(Ya(i,"labelPointStyle",this,e)),o.push(Ya(i,"labelTextColor",this,e))})),this.labelColors=s,this.labelPointStyles=n,this.labelTextColors=o,this.dataPoints=h,h}update(t,e){const i=this.options.setContext(this.getContext()),s=this._active;let n,o=[];if(s.length){const t=Aa[i.position].call(this,s,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const e=this._size=Ra(this,i),a=Object.assign({},t,e),r=za(this.chart,i,a),h=Ba(i,a,r,this.chart);this.xAlign=r.xAlign,this.yAlign=r.yAlign,n={opacity:1,x:h.x,y:h.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(n={opacity:0});this._tooltipItems=o,this.$context=void 0,n&&this._resolveAnimations().update(this,n),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,s){const n=this.getCaretPosition(t,i,s);e.lineTo(n.x1,n.y1),e.lineTo(n.x2,n.y2),e.lineTo(n.x3,n.y3)}getCaretPosition(t,e,i){const{xAlign:s,yAlign:n}=this,{caretSize:o,cornerRadius:a}=i,{topLeft:r,topRight:h,bottomLeft:l,bottomRight:c}=Ze(a),{x:d,y:u}=t,{width:f,height:g}=e;let p,m,b,x,_,y;return"center"===n?(_=u+g/2,"left"===s?(p=d,m=p-o,x=_+o,y=_-o):(p=d+f,m=p+o,x=_-o,y=_+o),b=p):(m="left"===s?d+Math.max(r,l)+o:"right"===s?d+f-Math.max(h,c)-o:this.caretX,"top"===n?(x=u,_=x-o,p=m-o,b=m+o):(x=u+g,_=x+o,p=m+o,b=m-o),y=x),{x1:p,x2:m,x3:b,y1:x,y2:_,y3:y}}drawTitle(t,e,i){const s=this.title,n=s.length;let o,a,r;if(n){const h=ji(i.rtl,this.x,this.width);for(t.x=ja(this,i.titleAlign,i),e.textAlign=h.textAlign(i.titleAlign),e.textBaseline="middle",o=Ge(i.titleFont),a=i.titleSpacing,e.fillStyle=i.titleColor,e.font=o.string,r=0;r0!==t))?(t.beginPath(),t.fillStyle=n.multiKeyBackground,He(t,{x:e,y:f,w:h,h:r,radius:a}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),He(t,{x:i,y:f+1,w:h-2,h:r-2,radius:a}),t.fill()):(t.fillStyle=n.multiKeyBackground,t.fillRect(e,f,h,r),t.strokeRect(e,f,h,r),t.fillStyle=o.backgroundColor,t.fillRect(i,f+1,h-2,r-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:s}=this,{bodySpacing:n,bodyAlign:o,displayColors:a,boxHeight:r,boxWidth:h,boxPadding:l}=i,c=Ge(i.bodyFont);let d=c.lineHeight,u=0;const f=ji(i.rtl,this.x,this.width),g=function(i){e.fillText(i,f.x(t.x+u),t.y+d/2),t.y+=d+n},p=f.textAlign(o);let m,b,x,_,y,v,M;for(e.textAlign=o,e.textBaseline="middle",e.font=c.string,t.x=ja(this,p,i),e.fillStyle=i.bodyColor,ot(this.beforeBody,g),u=a&&"right"!==p?"center"===o?h/2+l:h+2+l:0,_=0,v=s.length;_0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,s=i&&i.x,n=i&&i.y;if(s||n){const i=Aa[t.position].call(this,this._active,this._eventPosition);if(!i)return;const o=this._size=Ra(this,t),a=Object.assign({},i,this._size),r=za(e,t,a),h=Ba(t,a,r,e);s._to===h.x&&n._to===h.y||(this.xAlign=r.xAlign,this.yAlign=r.yAlign,this.width=o.width,this.height=o.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const s={width:this.width,height:this.height},n={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=Qe(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=i,this.drawBackground(n,t,s,e),Wi(t,e.textDirection),n.y+=o.top,this.drawTitle(n,t,e),this.drawBody(n,t,e),this.drawFooter(n,t,e),Ni(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,s=t.map((({datasetIndex:t,index:e})=>{const i=this.chart.getDatasetMeta(t);if(!i)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:i.data[e],index:e}})),n=!at(i,s),o=this._positionChanged(s,e);(n||o)&&(this._active=s,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,n=this._active||[],o=this._getActiveElements(t,n,e,i),a=this._positionChanged(o,t),r=e||!at(o,n)||a;return r&&(this._active=o,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),r}_getActiveElements(t,e,i,s){const n=this.options;if("mouseout"===t.type)return[];if(!s)return e;const o=this.chart.getElementsAtEventForMode(t,n.mode,n,i);return n.reverse&&o.reverse(),o}_positionChanged(t,e){const{caretX:i,caretY:s,options:n}=this,o=Aa[n.position].call(this,t,e);return!1!==o&&(i!==o.x||s!==o.y)}}var Xa={id:"tooltip",_element:Ua,positioners:Aa,afterInit(t,e,i){i&&(t.tooltip=new Ua({chart:t,options:i}))},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const i={tooltip:e};if(!1===t.notifyPlugins("beforeTooltipDraw",{...i,cancelable:!0}))return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i)}},afterEvent(t,e){if(t.tooltip){const i=e.replay;t.tooltip.handleEvent(e.event,i,e.inChartArea)&&(e.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:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.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:$a},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const qa=(t,e,i,s)=>("string"===typeof e?(i=t.push(e)-1,s.unshift({index:i,label:e})):isNaN(e)&&(i=null),i);function Ka(t,e,i,s){const n=t.indexOf(e);if(-1===n)return qa(t,e,i,s);const o=t.lastIndexOf(e);return n!==o?i:n}const Za=(t,e)=>null===t?null:$t(Math.round(t),0,e);function Qa(t){const e=this.getLabels();return t>=0&&te.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function Ja(t,e){const i=[],s=1e-14,{bounds:n,step:o,min:a,max:r,precision:h,count:l,maxTicks:c,maxDigits:d,includeBounds:u}=t,f=o||1,g=c-1,{min:p,max:m}=e,b=!Z(a),x=!Z(r),_=!Z(l),y=(m-p)/(d+1);let v,M,w,k,S=Rt((m-p)/g/f)*f;if(Sg&&(S=Rt(k*S/g/f)*f),Z(h)||(v=Math.pow(10,h),S=Math.ceil(S*v)/v),"ticks"===n?(M=Math.floor(p/S)*S,w=Math.ceil(m/S)*S):(M=p,w=m),b&&x&&o&&It((r-a)/o,S/1e3)?(k=Math.round(Math.min((r-a)/S,c)),S=(r-a)/k,M=a,w=r):_?(M=b?a:M,w=x?r:w,k=l-1,S=(w-M)/k):(k=(w-M)/S,k=Tt(k,Math.round(k),S/1e3)?Math.round(k):Math.ceil(k));const P=Math.max(Bt(S),Bt(M));v=Math.pow(10,Z(h)?P:h),M=Math.round(M*v)/v,w=Math.round(w*v)/v;let O=0;for(b&&(u&&M!==a?(i.push({value:a}),Mr)break;i.push({value:t})}return x&&u&&w!==r?i.length&&Tt(i[i.length-1].value,r,tr(r,y,t))?i[i.length-1].value=r:i.push({value:r}):x&&w!==r||i.push({value:w}),i}function tr(t,e,{horizontal:i,minRotation:s}){const n=Ft(s),o=(i?Math.sin(n):Math.cos(n))||.001,a=.75*e*(""+t).length;return Math.min(e/o,a)}class er extends io{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return Z(t)||("number"===typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:s,max:n}=this;const o=t=>s=e?s:t,a=t=>n=i?n:t;if(t){const t=Ct(s),e=Ct(n);t<0&&e<0?a(0):t>0&&e>0&&o(0)}if(s===n){let e=0===n?1:Math.abs(.05*n);a(n+e),t||o(s-e)}this.min=s,this.max=n}getTickLimit(){const t=this.options.ticks;let e,{maxTicksLimit:i,stepSize:s}=t;return s?(e=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,e>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${e} ticks. Limiting to 1000.`),e=1e3)):(e=this.computeTickLimit(),i=i||11),i&&(e=Math.min(i,e)),e}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:!1!==e.includeBounds},n=this._range||this,o=Ja(s,n);return"ticks"===t.bounds&&zt(o,this,"value"),t.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const s=(i-e)/Math.max(t.length-1,1)/2;e-=s,i+=s}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return _e(t,this.chart.options.locale,this.options.ticks.format)}}class ir extends er{static id="linear";static defaults={ticks:{callback:Me.formatters.numeric}};determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=J(t)?t:0,this.max=J(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=Ft(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,n=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,n.lineHeight/s))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}Me.formatters.logarithmic;Me.formatters.numeric;const sr={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},nr=Object.keys(sr);function or(t,e){return t-e}function ar(t,e){if(Z(e))return null;const i=t._adapter,{parser:s,round:n,isoWeekday:o}=t._parseOpts;let a=e;return"function"===typeof s&&(a=s(a)),J(a)||(a="string"===typeof s?i.parse(a,s):i.parse(a)),null===a?null:(n&&(a="week"!==n||!Lt(o)&&!0!==o?i.startOf(a,n):i.startOf(a,"isoWeek",o)),+a)}function rr(t,e,i,s){const n=nr.length;for(let o=nr.indexOf(t);o=nr.indexOf(i);o--){const i=nr[o];if(sr[i].common&&t._adapter.diff(n,s,i)>=e-1)return i}return nr[i?nr.indexOf(i):0]}function lr(t){for(let e=nr.indexOf(t)+1,i=nr.length;e=e?i[s]:i[n];t[o]=!0}}else t[e]=!0}function dr(t,e,i,s){const n=t._adapter,o=+n.startOf(e[0].value,s),a=e[e.length-1].value;let r,h;for(r=o;r<=a;r=+n.add(r,1,s))h=i[r],h>=0&&(e[h].major=!0);return e}function ur(t,e,i){const s=[],n={},o=e.length;let a,r;for(a=0;a+t.value)))}initOffsets(t=[]){let e,i,s=0,n=0;this.options.offset&&t.length&&(e=this.getDecimalForValue(t[0]),s=1===t.length?1-e:(this.getDecimalForValue(t[1])-e)/2,i=this.getDecimalForValue(t[t.length-1]),n=1===t.length?i:(i-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;s=$t(s,0,o),n=$t(n,0,o),this._offsets={start:s,end:n,factor:1/(s+1+n)}}_generate(){const t=this._adapter,e=this.min,i=this.max,s=this.options,n=s.time,o=n.unit||rr(n.minUnit,e,i,this._getLabelCapacity(e)),a=et(s.ticks.stepSize,1),r="week"===o&&n.isoWeekday,h=Lt(r)||!0===r,l={};let c,d,u=e;if(h&&(u=+t.startOf(u,"isoWeek",r)),u=+t.startOf(u,h?"day":o),t.diff(i,e,o)>1e5*a)throw new Error(e+" and "+i+" are too far apart with stepSize of "+a+" "+o);const f="data"===s.ticks.source&&this.getDataTimestamps();for(c=u,d=0;c+t))}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){const i=this.options,s=i.time.displayFormats,n=this._unit,o=e||s[n];return this._adapter.format(t,o)}_tickFormatFunction(t,e,i,s){const n=this.options,o=n.ticks.callback;if(o)return nt(o,[t,e,i],this);const a=n.time.displayFormats,r=this._unit,h=this._majorUnit,l=r&&a[r],c=h&&a[h],d=i[e],u=h&&c&&d&&d.major;return this._adapter.format(t,s||(u?c:l))}generateTickLabels(t){let e,i,s;for(e=0,i=t.length;e0?a:1}getDataTimestamps(){let t,e,i=this._cache.data||[];if(i.length)return i;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(t=0,e=s.length;t({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},a={type:{type:String,required:!0},...o},r="2"===s.i8[0]?(t,e)=>Object.assign(t,{attrs:e}):(t,e)=>Object.assign(t,e);function h(t){return(0,s.X3)(t)?(0,s.IU)(t):t}function l(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;return(0,s.X3)(e)?new Proxy(t,{}):t}function c(t,e){const i=t.options;i&&e&&Object.assign(i,e)}function d(t,e){t.labels=e}function u(t,e,i){const s=[];t.datasets=e.map((e=>{const n=t.datasets.find((t=>t[i]===e[i]));return n&&e.data&&!s.includes(n)?(s.push(n),Object.assign(n,e),n):{...e}}))}function f(t,e){const i={labels:[],datasets:[]};return d(i,t.labels),u(i,t.datasets,e),i}const g=(0,s.aZ)({props:a,setup(t,e){let{expose:i}=e;const o=(0,s.iH)(null),a=(0,s.XI)(null);i({chart:a});const r=()=>{if(!o.value)return;const{type:e,data:i,options:s,plugins:r,datasetIdKey:h}=t,c=f(i,h),d=l(c,i);a.value=new n.kL(o.value,{type:e,data:d,options:{...s},plugins:r})},g=()=>{const t=(0,s.IU)(a.value);t&&(t.destroy(),a.value=null)},p=e=>{e.update(t.updateMode)};return(0,s.bv)(r),(0,s.Jd)(g),(0,s.YP)([()=>t.options,()=>t.data],((e,i)=>{let[n,o]=e,[r,l]=i;const f=(0,s.IU)(a.value);if(!f)return;let g=!1;if(n){const t=h(n),e=h(r);t&&t!==e&&(c(f,t),g=!0)}if(o){const e=h(o.labels),i=h(l.labels),s=h(o.datasets),n=h(l.datasets);e!==i&&(d(f.config.data,e),g=!0),s&&s!==n&&(u(f.config.data,s,t.datasetIdKey),g=!0)}g&&p(f)}),{deep:!0}),()=>(0,s.h)("canvas",{ref:o})}});function p(t,e){return n.kL.register(e),(0,s.aZ)({props:o,setup(e,i){let{expose:n}=i;const o=(0,s.XI)(null),a=t=>{o.value=t?.chart};return n({chart:o}),()=>(0,s.h)(g,r({ref:a},{type:t,...e}))}})}const m=p("bar",n.vn),b=p("pie",n.tt)}}]); +//# sourceMappingURL=2005.0c79f882.js.map \ No newline at end of file diff --git a/js/2005.0c79f882.js.map b/js/2005.0c79f882.js.map new file mode 100644 index 000000000..380180f87 --- /dev/null +++ b/js/2005.0c79f882.js.map @@ -0,0 +1 @@ +{"version":3,"file":"js/2005.0c79f882.js","mappings":";;;;;;;AAMA,SAASA,EAAMC,GACb,OAAOA,EAAI,GAAM,CACnB,C,kQACA,MAAMC,EAAM,CAACD,EAAGE,EAAGC,IAAMC,KAAKC,IAAID,KAAKE,IAAIN,EAAGG,GAAID,GAClD,SAASK,EAAIP,GACX,OAAOC,EAAIF,EAAU,KAAJC,GAAW,EAAG,IACjC,CAIA,SAASQ,EAAIR,GACX,OAAOC,EAAIF,EAAU,IAAJC,GAAU,EAAG,IAChC,CACA,SAASS,EAAIT,GACX,OAAOC,EAAIF,EAAMC,EAAI,MAAQ,IAAK,EAAG,EACvC,CACA,SAASU,EAAIV,GACX,OAAOC,EAAIF,EAAU,IAAJC,GAAU,EAAG,IAChC,CAEA,MAAMW,EAAQ,CAAC,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAA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GAAQ,QAAM0vD,EAAS//D,OAC7B,IAAKqQ,EACD,OAEJ,IAAIowD,GAAe,EACnB,GAAIJ,EAAkB,CAClB,MAAMtB,EAAcJ,EAAa0B,GAC3BK,EAAc/B,EAAa4B,GAC7BxB,GAAeA,IAAgB2B,IAC/B5B,EAAWzuD,EAAO0uD,GAClB0B,GAAe,EAEvB,CACA,GAAIH,EAAe,CACf,MAAMpB,EAAaP,EAAa2B,EAAclsC,QACxCusC,EAAahC,EAAa6B,EAAcpsC,QACxCgrC,EAAeT,EAAa2B,EAAcnsD,UAC1CysD,EAAejC,EAAa6B,EAAcrsD,UAC5C+qD,IAAeyB,IACf3B,EAAU3uD,EAAMkb,OAAOzU,KAAMooD,GAC7BuB,GAAe,GAEfrB,GAAgBA,IAAiBwB,IACjCzB,EAAY9uD,EAAMkb,OAAOzU,KAAMsoD,EAAc7iD,EAAM8hD,cACnDoC,GAAe,EAEvB,CACIA,GACA11C,EAAO1a,EACX,GACD,CACCwwD,MAAM,IAEH,KACI,IAAAvzE,GAAE,SAAU,CACfwzE,IAAKhB,GAGjB,IAGJ,SAASiB,EAAiB1iE,EAAM2iE,GAE5B,OADA,KAAQvnB,SAASunB,IACV,QAAgB,CACnBzkD,MAAO2hD,EACP,KAAAyB,CAAOpjD,EAAOqjD,GACV,IAAI,OAAEC,GAAYD,EAClB,MAAMkB,GAAM,QAAW,MACjBG,EAAgBlB,IAClBe,EAAI9gE,MAAQ+/D,GAAU1vD,KAAK,EAK/B,OAHAwvD,EAAO,CACHxvD,MAAOywD,IAEJ,KACI,IAAAxzE,GAAEk0D,EAAOgd,EAAY,CACxBsC,IAAKG,GACN,CACC5iE,UACGke,IAGf,GAER,CACA,MAAM2kD,EAAsBH,EAAiB,MAAO,MAG9CI,EAAsBJ,EAAiB,MAAO,K","sources":["webpack://@radiantearth/stac-browser/./node_modules/@kurkle/color/dist/color.esm.js","webpack://@radiantearth/stac-browser/./node_modules/chart.js/dist/chunks/helpers.segment.js","webpack://@radiantearth/stac-browser/./node_modules/chart.js/dist/chart.js","webpack://@radiantearth/stac-browser/./node_modules/vue-chartjs/dist/index.js"],"sourcesContent":["/*!\n * @kurkle/color v0.3.2\n * https://github.com/kurkle/color#readme\n * (c) 2023 Jukka Kurkela\n * Released under the MIT License\n */\nfunction round(v) {\n return v + 0.5 | 0;\n}\nconst lim = (v, l, h) => Math.max(Math.min(v, h), l);\nfunction p2b(v) {\n return lim(round(v * 2.55), 0, 255);\n}\nfunction b2p(v) {\n return lim(round(v / 2.55), 0, 100);\n}\nfunction n2b(v) {\n return lim(round(v * 255), 0, 255);\n}\nfunction b2n(v) {\n return lim(round(v / 2.55) / 100, 0, 1);\n}\nfunction n2p(v) {\n return lim(round(v * 100), 0, 100);\n}\n\nconst 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};\nconst hex = [...'0123456789ABCDEF'];\nconst h1 = b => hex[b & 0xF];\nconst h2 = b => hex[(b & 0xF0) >> 4] + hex[b & 0xF];\nconst eq = b => ((b & 0xF0) >> 4) === (b & 0xF);\nconst isShort = v => eq(v.r) && eq(v.g) && eq(v.b) && eq(v.a);\nfunction hexParse(str) {\n var len = str.length;\n var ret;\n if (str[0] === '#') {\n if (len === 4 || len === 5) {\n ret = {\n r: 255 & map$1[str[1]] * 17,\n g: 255 & map$1[str[2]] * 17,\n b: 255 & map$1[str[3]] * 17,\n a: len === 5 ? map$1[str[4]] * 17 : 255\n };\n } else if (len === 7 || len === 9) {\n ret = {\n r: map$1[str[1]] << 4 | map$1[str[2]],\n g: map$1[str[3]] << 4 | map$1[str[4]],\n b: map$1[str[5]] << 4 | map$1[str[6]],\n a: len === 9 ? (map$1[str[7]] << 4 | map$1[str[8]]) : 255\n };\n }\n }\n return ret;\n}\nconst alpha = (a, f) => a < 255 ? f(a) : '';\nfunction hexString(v) {\n var f = isShort(v) ? h1 : h2;\n return v\n ? '#' + f(v.r) + f(v.g) + f(v.b) + alpha(v.a, f)\n : undefined;\n}\n\nconst HUE_RE = /^(hsla?|hwb|hsv)\\(\\s*([-+.e\\d]+)(?:deg)?[\\s,]+([-+.e\\d]+)%[\\s,]+([-+.e\\d]+)%(?:[\\s,]+([-+.e\\d]+)(%)?)?\\s*\\)$/;\nfunction hsl2rgbn(h, s, l) {\n const a = s * Math.min(l, 1 - l);\n const f = (n, k = (n + h / 30) % 12) => l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);\n return [f(0), f(8), f(4)];\n}\nfunction hsv2rgbn(h, s, v) {\n const f = (n, k = (n + h / 60) % 6) => v - v * s * Math.max(Math.min(k, 4 - k, 1), 0);\n return [f(5), f(3), f(1)];\n}\nfunction hwb2rgbn(h, w, b) {\n const rgb = hsl2rgbn(h, 1, 0.5);\n let i;\n if (w + b > 1) {\n i = 1 / (w + b);\n w *= i;\n b *= i;\n }\n for (i = 0; i < 3; i++) {\n rgb[i] *= 1 - w - b;\n rgb[i] += w;\n }\n return rgb;\n}\nfunction hueValue(r, g, b, d, max) {\n if (r === max) {\n return ((g - b) / d) + (g < b ? 6 : 0);\n }\n if (g === max) {\n return (b - r) / d + 2;\n }\n return (r - g) / d + 4;\n}\nfunction rgb2hsl(v) {\n const range = 255;\n const r = v.r / range;\n const g = v.g / range;\n const b = v.b / range;\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n const l = (max + min) / 2;\n let h, s, d;\n if (max !== min) {\n d = max - min;\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n h = hueValue(r, g, b, d, max);\n h = h * 60 + 0.5;\n }\n return [h | 0, s || 0, l];\n}\nfunction calln(f, a, b, c) {\n return (\n Array.isArray(a)\n ? f(a[0], a[1], a[2])\n : f(a, b, c)\n ).map(n2b);\n}\nfunction hsl2rgb(h, s, l) {\n return calln(hsl2rgbn, h, s, l);\n}\nfunction hwb2rgb(h, w, b) {\n return calln(hwb2rgbn, h, w, b);\n}\nfunction hsv2rgb(h, s, v) {\n return calln(hsv2rgbn, h, s, v);\n}\nfunction hue(h) {\n return (h % 360 + 360) % 360;\n}\nfunction hueParse(str) {\n const m = HUE_RE.exec(str);\n let a = 255;\n let v;\n if (!m) {\n return;\n }\n if (m[5] !== v) {\n a = m[6] ? p2b(+m[5]) : n2b(+m[5]);\n }\n const h = hue(+m[2]);\n const p1 = +m[3] / 100;\n const p2 = +m[4] / 100;\n if (m[1] === 'hwb') {\n v = hwb2rgb(h, p1, p2);\n } else if (m[1] === 'hsv') {\n v = hsv2rgb(h, p1, p2);\n } else {\n v = hsl2rgb(h, p1, p2);\n }\n return {\n r: v[0],\n g: v[1],\n b: v[2],\n a: a\n };\n}\nfunction rotate(v, deg) {\n var h = rgb2hsl(v);\n h[0] = hue(h[0] + deg);\n h = hsl2rgb(h);\n v.r = h[0];\n v.g = h[1];\n v.b = h[2];\n}\nfunction hslString(v) {\n if (!v) {\n return;\n }\n const a = rgb2hsl(v);\n const h = a[0];\n const s = n2p(a[1]);\n const l = n2p(a[2]);\n return v.a < 255\n ? `hsla(${h}, ${s}%, ${l}%, ${b2n(v.a)})`\n : `hsl(${h}, ${s}%, ${l}%)`;\n}\n\nconst map = {\n x: 'dark',\n Z: 'light',\n Y: 're',\n X: 'blu',\n W: 'gr',\n V: 'medium',\n U: 'slate',\n A: 'ee',\n T: 'ol',\n S: 'or',\n B: 'ra',\n C: 'lateg',\n D: 'ights',\n R: 'in',\n Q: 'turquois',\n E: 'hi',\n P: 'ro',\n O: 'al',\n N: 'le',\n M: 'de',\n L: 'yello',\n F: 'en',\n K: 'ch',\n G: 'arks',\n H: 'ea',\n I: 'ightg',\n J: 'wh'\n};\nconst names$1 = {\n OiceXe: 'f0f8ff',\n antiquewEte: 'faebd7',\n aqua: 'ffff',\n aquamarRe: '7fffd4',\n azuY: 'f0ffff',\n beige: 'f5f5dc',\n bisque: 'ffe4c4',\n black: '0',\n blanKedOmond: 'ffebcd',\n Xe: 'ff',\n XeviTet: '8a2be2',\n bPwn: 'a52a2a',\n burlywood: 'deb887',\n caMtXe: '5f9ea0',\n KartYuse: '7fff00',\n KocTate: 'd2691e',\n cSO: 'ff7f50',\n cSnflowerXe: '6495ed',\n cSnsilk: 'fff8dc',\n crimson: 'dc143c',\n cyan: 'ffff',\n xXe: '8b',\n xcyan: '8b8b',\n xgTMnPd: 'b8860b',\n xWay: 'a9a9a9',\n xgYF: '6400',\n xgYy: 'a9a9a9',\n xkhaki: 'bdb76b',\n xmagFta: '8b008b',\n xTivegYF: '556b2f',\n xSange: 'ff8c00',\n xScEd: '9932cc',\n xYd: '8b0000',\n xsOmon: 'e9967a',\n xsHgYF: '8fbc8f',\n xUXe: '483d8b',\n xUWay: '2f4f4f',\n xUgYy: '2f4f4f',\n xQe: 'ced1',\n xviTet: '9400d3',\n dAppRk: 'ff1493',\n dApskyXe: 'bfff',\n dimWay: '696969',\n dimgYy: '696969',\n dodgerXe: '1e90ff',\n fiYbrick: 'b22222',\n flSOwEte: 'fffaf0',\n foYstWAn: '228b22',\n fuKsia: 'ff00ff',\n gaRsbSo: 'dcdcdc',\n ghostwEte: 'f8f8ff',\n gTd: 'ffd700',\n gTMnPd: 'daa520',\n Way: '808080',\n gYF: '8000',\n gYFLw: 'adff2f',\n gYy: '808080',\n honeyMw: 'f0fff0',\n hotpRk: 'ff69b4',\n RdianYd: 'cd5c5c',\n Rdigo: '4b0082',\n ivSy: 'fffff0',\n khaki: 'f0e68c',\n lavFMr: 'e6e6fa',\n lavFMrXsh: 'fff0f5',\n lawngYF: '7cfc00',\n NmoncEffon: 'fffacd',\n ZXe: 'add8e6',\n ZcSO: 'f08080',\n Zcyan: 'e0ffff',\n ZgTMnPdLw: 'fafad2',\n ZWay: 'd3d3d3',\n ZgYF: '90ee90',\n ZgYy: 'd3d3d3',\n ZpRk: 'ffb6c1',\n ZsOmon: 'ffa07a',\n ZsHgYF: '20b2aa',\n ZskyXe: '87cefa',\n ZUWay: '778899',\n ZUgYy: '778899',\n ZstAlXe: 'b0c4de',\n ZLw: 'ffffe0',\n lime: 'ff00',\n limegYF: '32cd32',\n lRF: 'faf0e6',\n magFta: 'ff00ff',\n maPon: '800000',\n VaquamarRe: '66cdaa',\n VXe: 'cd',\n VScEd: 'ba55d3',\n VpurpN: '9370db',\n VsHgYF: '3cb371',\n VUXe: '7b68ee',\n VsprRggYF: 'fa9a',\n VQe: '48d1cc',\n VviTetYd: 'c71585',\n midnightXe: '191970',\n mRtcYam: 'f5fffa',\n mistyPse: 'ffe4e1',\n moccasR: 'ffe4b5',\n navajowEte: 'ffdead',\n navy: '80',\n Tdlace: 'fdf5e6',\n Tive: '808000',\n TivedBb: '6b8e23',\n Sange: 'ffa500',\n SangeYd: 'ff4500',\n ScEd: 'da70d6',\n pOegTMnPd: 'eee8aa',\n pOegYF: '98fb98',\n pOeQe: 'afeeee',\n pOeviTetYd: 'db7093',\n papayawEp: 'ffefd5',\n pHKpuff: 'ffdab9',\n peru: 'cd853f',\n pRk: 'ffc0cb',\n plum: 'dda0dd',\n powMrXe: 'b0e0e6',\n purpN: '800080',\n YbeccapurpN: '663399',\n Yd: 'ff0000',\n Psybrown: 'bc8f8f',\n PyOXe: '4169e1',\n saddNbPwn: '8b4513',\n sOmon: 'fa8072',\n sandybPwn: 'f4a460',\n sHgYF: '2e8b57',\n sHshell: 'fff5ee',\n siFna: 'a0522d',\n silver: 'c0c0c0',\n skyXe: '87ceeb',\n UXe: '6a5acd',\n UWay: '708090',\n UgYy: '708090',\n snow: 'fffafa',\n sprRggYF: 'ff7f',\n stAlXe: '4682b4',\n tan: 'd2b48c',\n teO: '8080',\n tEstN: 'd8bfd8',\n tomato: 'ff6347',\n Qe: '40e0d0',\n viTet: 'ee82ee',\n JHt: 'f5deb3',\n wEte: 'ffffff',\n wEtesmoke: 'f5f5f5',\n Lw: 'ffff00',\n LwgYF: '9acd32'\n};\nfunction unpack() {\n const unpacked = {};\n const keys = Object.keys(names$1);\n const tkeys = Object.keys(map);\n let i, j, k, ok, nk;\n for (i = 0; i < keys.length; i++) {\n ok = nk = keys[i];\n for (j = 0; j < tkeys.length; j++) {\n k = tkeys[j];\n nk = nk.replace(k, map[k]);\n }\n k = parseInt(names$1[ok], 16);\n unpacked[nk] = [k >> 16 & 0xFF, k >> 8 & 0xFF, k & 0xFF];\n }\n return unpacked;\n}\n\nlet names;\nfunction nameParse(str) {\n if (!names) {\n names = unpack();\n names.transparent = [0, 0, 0, 0];\n }\n const a = names[str.toLowerCase()];\n return a && {\n r: a[0],\n g: a[1],\n b: a[2],\n a: a.length === 4 ? a[3] : 255\n };\n}\n\nconst RGB_RE = /^rgba?\\(\\s*([-+.\\d]+)(%)?[\\s,]+([-+.e\\d]+)(%)?[\\s,]+([-+.e\\d]+)(%)?(?:[\\s,/]+([-+.e\\d]+)(%)?)?\\s*\\)$/;\nfunction rgbParse(str) {\n const m = RGB_RE.exec(str);\n let a = 255;\n let r, g, b;\n if (!m) {\n return;\n }\n if (m[7] !== r) {\n const v = +m[7];\n a = m[8] ? p2b(v) : lim(v * 255, 0, 255);\n }\n r = +m[1];\n g = +m[3];\n b = +m[5];\n r = 255 & (m[2] ? p2b(r) : lim(r, 0, 255));\n g = 255 & (m[4] ? p2b(g) : lim(g, 0, 255));\n b = 255 & (m[6] ? p2b(b) : lim(b, 0, 255));\n return {\n r: r,\n g: g,\n b: b,\n a: a\n };\n}\nfunction rgbString(v) {\n return v && (\n v.a < 255\n ? `rgba(${v.r}, ${v.g}, ${v.b}, ${b2n(v.a)})`\n : `rgb(${v.r}, ${v.g}, ${v.b})`\n );\n}\n\nconst to = v => v <= 0.0031308 ? v * 12.92 : Math.pow(v, 1.0 / 2.4) * 1.055 - 0.055;\nconst from = v => v <= 0.04045 ? v / 12.92 : Math.pow((v + 0.055) / 1.055, 2.4);\nfunction interpolate(rgb1, rgb2, t) {\n const r = from(b2n(rgb1.r));\n const g = from(b2n(rgb1.g));\n const b = from(b2n(rgb1.b));\n return {\n r: n2b(to(r + t * (from(b2n(rgb2.r)) - r))),\n g: n2b(to(g + t * (from(b2n(rgb2.g)) - g))),\n b: n2b(to(b + t * (from(b2n(rgb2.b)) - b))),\n a: rgb1.a + t * (rgb2.a - rgb1.a)\n };\n}\n\nfunction modHSL(v, i, ratio) {\n if (v) {\n let tmp = rgb2hsl(v);\n tmp[i] = Math.max(0, Math.min(tmp[i] + tmp[i] * ratio, i === 0 ? 360 : 1));\n tmp = hsl2rgb(tmp);\n v.r = tmp[0];\n v.g = tmp[1];\n v.b = tmp[2];\n }\n}\nfunction clone(v, proto) {\n return v ? Object.assign(proto || {}, v) : v;\n}\nfunction fromObject(input) {\n var v = {r: 0, g: 0, b: 0, a: 255};\n if (Array.isArray(input)) {\n if (input.length >= 3) {\n v = {r: input[0], g: input[1], b: input[2], a: 255};\n if (input.length > 3) {\n v.a = n2b(input[3]);\n }\n }\n } else {\n v = clone(input, {r: 0, g: 0, b: 0, a: 1});\n v.a = n2b(v.a);\n }\n return v;\n}\nfunction functionParse(str) {\n if (str.charAt(0) === 'r') {\n return rgbParse(str);\n }\n return hueParse(str);\n}\nclass Color {\n constructor(input) {\n if (input instanceof Color) {\n return input;\n }\n const type = typeof input;\n let v;\n if (type === 'object') {\n v = fromObject(input);\n } else if (type === 'string') {\n v = hexParse(input) || nameParse(input) || functionParse(input);\n }\n this._rgb = v;\n this._valid = !!v;\n }\n get valid() {\n return this._valid;\n }\n get rgb() {\n var v = clone(this._rgb);\n if (v) {\n v.a = b2n(v.a);\n }\n return v;\n }\n set rgb(obj) {\n this._rgb = fromObject(obj);\n }\n rgbString() {\n return this._valid ? rgbString(this._rgb) : undefined;\n }\n hexString() {\n return this._valid ? hexString(this._rgb) : undefined;\n }\n hslString() {\n return this._valid ? hslString(this._rgb) : undefined;\n }\n mix(color, weight) {\n if (color) {\n const c1 = this.rgb;\n const c2 = color.rgb;\n let w2;\n const p = weight === w2 ? 0.5 : weight;\n const w = 2 * p - 1;\n const a = c1.a - c2.a;\n const w1 = ((w * a === -1 ? w : (w + a) / (1 + w * a)) + 1) / 2.0;\n w2 = 1 - w1;\n c1.r = 0xFF & w1 * c1.r + w2 * c2.r + 0.5;\n c1.g = 0xFF & w1 * c1.g + w2 * c2.g + 0.5;\n c1.b = 0xFF & w1 * c1.b + w2 * c2.b + 0.5;\n c1.a = p * c1.a + (1 - p) * c2.a;\n this.rgb = c1;\n }\n return this;\n }\n interpolate(color, t) {\n if (color) {\n this._rgb = interpolate(this._rgb, color._rgb, t);\n }\n return this;\n }\n clone() {\n return new Color(this.rgb);\n }\n alpha(a) {\n this._rgb.a = n2b(a);\n return this;\n }\n clearer(ratio) {\n const rgb = this._rgb;\n rgb.a *= 1 - ratio;\n return this;\n }\n greyscale() {\n const rgb = this._rgb;\n const val = round(rgb.r * 0.3 + rgb.g * 0.59 + rgb.b * 0.11);\n rgb.r = rgb.g = rgb.b = val;\n return this;\n }\n opaquer(ratio) {\n const rgb = this._rgb;\n rgb.a *= 1 + ratio;\n return this;\n }\n negate() {\n const v = this._rgb;\n v.r = 255 - v.r;\n v.g = 255 - v.g;\n v.b = 255 - v.b;\n return this;\n }\n lighten(ratio) {\n modHSL(this._rgb, 2, ratio);\n return this;\n }\n darken(ratio) {\n modHSL(this._rgb, 2, -ratio);\n return this;\n }\n saturate(ratio) {\n modHSL(this._rgb, 1, ratio);\n return this;\n }\n desaturate(ratio) {\n modHSL(this._rgb, 1, -ratio);\n return this;\n }\n rotate(deg) {\n rotate(this._rgb, deg);\n return this;\n }\n}\n\nfunction index_esm(input) {\n return new Color(input);\n}\n\nexport { Color, b2n, b2p, index_esm as default, hexParse, hexString, hsl2rgb, hslString, hsv2rgb, hueParse, hwb2rgb, lim, n2b, n2p, nameParse, p2b, rgb2hsl, rgbParse, rgbString, rotate, round };\n","/*!\n * Chart.js v4.4.0\n * https://www.chartjs.org\n * (c) 2023 Chart.js Contributors\n * Released under the MIT License\n */\nimport { Color } from '@kurkle/color';\n\n/**\n * @namespace Chart.helpers\n */ /**\n * An empty function that can be used, for example, for optional callback.\n */ function noop() {\n/* noop */ }\n/**\n * Returns a unique id, sequentially generated from a global variable.\n */ const uid = (()=>{\n let id = 0;\n return ()=>id++;\n})();\n/**\n * Returns true if `value` is neither null nor undefined, else returns false.\n * @param value - The value to test.\n * @since 2.7.0\n */ function isNullOrUndef(value) {\n return value === null || typeof value === 'undefined';\n}\n/**\n * Returns true if `value` is an array (including typed arrays), else returns false.\n * @param value - The value to test.\n * @function\n */ function isArray(value) {\n if (Array.isArray && Array.isArray(value)) {\n return true;\n }\n const type = Object.prototype.toString.call(value);\n if (type.slice(0, 7) === '[object' && type.slice(-6) === 'Array]') {\n return true;\n }\n return false;\n}\n/**\n * Returns true if `value` is an object (excluding null), else returns false.\n * @param value - The value to test.\n * @since 2.7.0\n */ function isObject(value) {\n return value !== null && Object.prototype.toString.call(value) === '[object Object]';\n}\n/**\n * Returns true if `value` is a finite number, else returns false\n * @param value - The value to test.\n */ function isNumberFinite(value) {\n return (typeof value === 'number' || value instanceof Number) && isFinite(+value);\n}\n/**\n * Returns `value` if finite, else returns `defaultValue`.\n * @param value - The value to return if defined.\n * @param defaultValue - The value to return if `value` is not finite.\n */ function finiteOrDefault(value, defaultValue) {\n return isNumberFinite(value) ? value : defaultValue;\n}\n/**\n * Returns `value` if defined, else returns `defaultValue`.\n * @param value - The value to return if defined.\n * @param defaultValue - The value to return if `value` is undefined.\n */ function valueOrDefault(value, defaultValue) {\n return typeof value === 'undefined' ? defaultValue : value;\n}\nconst toPercentage = (value, dimension)=>typeof value === 'string' && value.endsWith('%') ? parseFloat(value) / 100 : +value / dimension;\nconst toDimension = (value, dimension)=>typeof value === 'string' && value.endsWith('%') ? parseFloat(value) / 100 * dimension : +value;\n/**\n * Calls `fn` with the given `args` in the scope defined by `thisArg` and returns the\n * value returned by `fn`. If `fn` is not a function, this method returns undefined.\n * @param fn - The function to call.\n * @param args - The arguments with which `fn` should be called.\n * @param [thisArg] - The value of `this` provided for the call to `fn`.\n */ function callback(fn, args, thisArg) {\n if (fn && typeof fn.call === 'function') {\n return fn.apply(thisArg, args);\n }\n}\nfunction each(loopable, fn, thisArg, reverse) {\n let i, len, keys;\n if (isArray(loopable)) {\n len = loopable.length;\n if (reverse) {\n for(i = len - 1; i >= 0; i--){\n fn.call(thisArg, loopable[i], i);\n }\n } else {\n for(i = 0; i < len; i++){\n fn.call(thisArg, loopable[i], i);\n }\n }\n } else if (isObject(loopable)) {\n keys = Object.keys(loopable);\n len = keys.length;\n for(i = 0; i < len; i++){\n fn.call(thisArg, loopable[keys[i]], keys[i]);\n }\n }\n}\n/**\n * Returns true if the `a0` and `a1` arrays have the same content, else returns false.\n * @param a0 - The array to compare\n * @param a1 - The array to compare\n * @private\n */ function _elementsEqual(a0, a1) {\n let i, ilen, v0, v1;\n if (!a0 || !a1 || a0.length !== a1.length) {\n return false;\n }\n for(i = 0, ilen = a0.length; i < ilen; ++i){\n v0 = a0[i];\n v1 = a1[i];\n if (v0.datasetIndex !== v1.datasetIndex || v0.index !== v1.index) {\n return false;\n }\n }\n return true;\n}\n/**\n * Returns a deep copy of `source` without keeping references on objects and arrays.\n * @param source - The value to clone.\n */ function clone(source) {\n if (isArray(source)) {\n return source.map(clone);\n }\n if (isObject(source)) {\n const target = Object.create(null);\n const keys = Object.keys(source);\n const klen = keys.length;\n let k = 0;\n for(; k < klen; ++k){\n target[keys[k]] = clone(source[keys[k]]);\n }\n return target;\n }\n return source;\n}\nfunction isValidKey(key) {\n return [\n '__proto__',\n 'prototype',\n 'constructor'\n ].indexOf(key) === -1;\n}\n/**\n * The default merger when Chart.helpers.merge is called without merger option.\n * Note(SB): also used by mergeConfig and mergeScaleConfig as fallback.\n * @private\n */ function _merger(key, target, source, options) {\n if (!isValidKey(key)) {\n return;\n }\n const tval = target[key];\n const sval = source[key];\n if (isObject(tval) && isObject(sval)) {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n merge(tval, sval, options);\n } else {\n target[key] = clone(sval);\n }\n}\nfunction merge(target, source, options) {\n const sources = isArray(source) ? source : [\n source\n ];\n const ilen = sources.length;\n if (!isObject(target)) {\n return target;\n }\n options = options || {};\n const merger = options.merger || _merger;\n let current;\n for(let i = 0; i < ilen; ++i){\n current = sources[i];\n if (!isObject(current)) {\n continue;\n }\n const keys = Object.keys(current);\n for(let k = 0, klen = keys.length; k < klen; ++k){\n merger(keys[k], target, current, options);\n }\n }\n return target;\n}\nfunction mergeIf(target, source) {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n return merge(target, source, {\n merger: _mergerIf\n });\n}\n/**\n * Merges source[key] in target[key] only if target[key] is undefined.\n * @private\n */ function _mergerIf(key, target, source) {\n if (!isValidKey(key)) {\n return;\n }\n const tval = target[key];\n const sval = source[key];\n if (isObject(tval) && isObject(sval)) {\n mergeIf(tval, sval);\n } else if (!Object.prototype.hasOwnProperty.call(target, key)) {\n target[key] = clone(sval);\n }\n}\n/**\n * @private\n */ function _deprecated(scope, value, previous, current) {\n if (value !== undefined) {\n console.warn(scope + ': \"' + previous + '\" is deprecated. Please use \"' + current + '\" instead');\n }\n}\n// resolveObjectKey resolver cache\nconst keyResolvers = {\n // Chart.helpers.core resolveObjectKey should resolve empty key to root object\n '': (v)=>v,\n // default resolvers\n x: (o)=>o.x,\n y: (o)=>o.y\n};\n/**\n * @private\n */ function _splitKey(key) {\n const parts = key.split('.');\n const keys = [];\n let tmp = '';\n for (const part of parts){\n tmp += part;\n if (tmp.endsWith('\\\\')) {\n tmp = tmp.slice(0, -1) + '.';\n } else {\n keys.push(tmp);\n tmp = '';\n }\n }\n return keys;\n}\nfunction _getKeyResolver(key) {\n const keys = _splitKey(key);\n return (obj)=>{\n for (const k of keys){\n if (k === '') {\n break;\n }\n obj = obj && obj[k];\n }\n return obj;\n };\n}\nfunction resolveObjectKey(obj, key) {\n const resolver = keyResolvers[key] || (keyResolvers[key] = _getKeyResolver(key));\n return resolver(obj);\n}\n/**\n * @private\n */ function _capitalize(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}\nconst defined = (value)=>typeof value !== 'undefined';\nconst isFunction = (value)=>typeof value === 'function';\n// Adapted from https://stackoverflow.com/questions/31128855/comparing-ecma6-sets-for-equality#31129384\nconst setsEqual = (a, b)=>{\n if (a.size !== b.size) {\n return false;\n }\n for (const item of a){\n if (!b.has(item)) {\n return false;\n }\n }\n return true;\n};\n/**\n * @param e - The event\n * @private\n */ function _isClickEvent(e) {\n return e.type === 'mouseup' || e.type === 'click' || e.type === 'contextmenu';\n}\n\n/**\n * @alias Chart.helpers.math\n * @namespace\n */ const PI = Math.PI;\nconst TAU = 2 * PI;\nconst PITAU = TAU + PI;\nconst INFINITY = Number.POSITIVE_INFINITY;\nconst RAD_PER_DEG = PI / 180;\nconst HALF_PI = PI / 2;\nconst QUARTER_PI = PI / 4;\nconst TWO_THIRDS_PI = PI * 2 / 3;\nconst log10 = Math.log10;\nconst sign = Math.sign;\nfunction almostEquals(x, y, epsilon) {\n return Math.abs(x - y) < epsilon;\n}\n/**\n * Implementation of the nice number algorithm used in determining where axis labels will go\n */ function niceNum(range) {\n const roundedRange = Math.round(range);\n range = almostEquals(range, roundedRange, range / 1000) ? roundedRange : range;\n const niceRange = Math.pow(10, Math.floor(log10(range)));\n const fraction = range / niceRange;\n const niceFraction = fraction <= 1 ? 1 : fraction <= 2 ? 2 : fraction <= 5 ? 5 : 10;\n return niceFraction * niceRange;\n}\n/**\n * Returns an array of factors sorted from 1 to sqrt(value)\n * @private\n */ function _factorize(value) {\n const result = [];\n const sqrt = Math.sqrt(value);\n let i;\n for(i = 1; i < sqrt; i++){\n if (value % i === 0) {\n result.push(i);\n result.push(value / i);\n }\n }\n if (sqrt === (sqrt | 0)) {\n result.push(sqrt);\n }\n result.sort((a, b)=>a - b).pop();\n return result;\n}\nfunction isNumber(n) {\n return !isNaN(parseFloat(n)) && isFinite(n);\n}\nfunction almostWhole(x, epsilon) {\n const rounded = Math.round(x);\n return rounded - epsilon <= x && rounded + epsilon >= x;\n}\n/**\n * @private\n */ function _setMinAndMaxByKey(array, target, property) {\n let i, ilen, value;\n for(i = 0, ilen = array.length; i < ilen; i++){\n value = array[i][property];\n if (!isNaN(value)) {\n target.min = Math.min(target.min, value);\n target.max = Math.max(target.max, value);\n }\n }\n}\nfunction toRadians(degrees) {\n return degrees * (PI / 180);\n}\nfunction toDegrees(radians) {\n return radians * (180 / PI);\n}\n/**\n * Returns the number of decimal places\n * i.e. the number of digits after the decimal point, of the value of this Number.\n * @param x - A number.\n * @returns The number of decimal places.\n * @private\n */ function _decimalPlaces(x) {\n if (!isNumberFinite(x)) {\n return;\n }\n let e = 1;\n let p = 0;\n while(Math.round(x * e) / e !== x){\n e *= 10;\n p++;\n }\n return p;\n}\n// Gets the angle from vertical upright to the point about a centre.\nfunction getAngleFromPoint(centrePoint, anglePoint) {\n const distanceFromXCenter = anglePoint.x - centrePoint.x;\n const distanceFromYCenter = anglePoint.y - centrePoint.y;\n const radialDistanceFromCenter = Math.sqrt(distanceFromXCenter * distanceFromXCenter + distanceFromYCenter * distanceFromYCenter);\n let angle = Math.atan2(distanceFromYCenter, distanceFromXCenter);\n if (angle < -0.5 * PI) {\n angle += TAU; // make sure the returned angle is in the range of (-PI/2, 3PI/2]\n }\n return {\n angle,\n distance: radialDistanceFromCenter\n };\n}\nfunction distanceBetweenPoints(pt1, pt2) {\n return Math.sqrt(Math.pow(pt2.x - pt1.x, 2) + Math.pow(pt2.y - pt1.y, 2));\n}\n/**\n * Shortest distance between angles, in either direction.\n * @private\n */ function _angleDiff(a, b) {\n return (a - b + PITAU) % TAU - PI;\n}\n/**\n * Normalize angle to be between 0 and 2*PI\n * @private\n */ function _normalizeAngle(a) {\n return (a % TAU + TAU) % TAU;\n}\n/**\n * @private\n */ function _angleBetween(angle, start, end, sameAngleIsFullCircle) {\n const a = _normalizeAngle(angle);\n const s = _normalizeAngle(start);\n const e = _normalizeAngle(end);\n const angleToStart = _normalizeAngle(s - a);\n const angleToEnd = _normalizeAngle(e - a);\n const startToAngle = _normalizeAngle(a - s);\n const endToAngle = _normalizeAngle(a - e);\n return a === s || a === e || sameAngleIsFullCircle && s === e || angleToStart > angleToEnd && startToAngle < endToAngle;\n}\n/**\n * Limit `value` between `min` and `max`\n * @param value\n * @param min\n * @param max\n * @private\n */ function _limitValue(value, min, max) {\n return Math.max(min, Math.min(max, value));\n}\n/**\n * @param {number} value\n * @private\n */ function _int16Range(value) {\n return _limitValue(value, -32768, 32767);\n}\n/**\n * @param value\n * @param start\n * @param end\n * @param [epsilon]\n * @private\n */ function _isBetween(value, start, end, epsilon = 1e-6) {\n return value >= Math.min(start, end) - epsilon && value <= Math.max(start, end) + epsilon;\n}\n\nfunction _lookup(table, value, cmp) {\n cmp = cmp || ((index)=>table[index] < value);\n let hi = table.length - 1;\n let lo = 0;\n let mid;\n while(hi - lo > 1){\n mid = lo + hi >> 1;\n if (cmp(mid)) {\n lo = mid;\n } else {\n hi = mid;\n }\n }\n return {\n lo,\n hi\n };\n}\n/**\n * Binary search\n * @param table - the table search. must be sorted!\n * @param key - property name for the value in each entry\n * @param value - value to find\n * @param last - lookup last index\n * @private\n */ const _lookupByKey = (table, key, value, last)=>_lookup(table, value, last ? (index)=>{\n const ti = table[index][key];\n return ti < value || ti === value && table[index + 1][key] === value;\n } : (index)=>table[index][key] < value);\n/**\n * Reverse binary search\n * @param table - the table search. must be sorted!\n * @param key - property name for the value in each entry\n * @param value - value to find\n * @private\n */ const _rlookupByKey = (table, key, value)=>_lookup(table, value, (index)=>table[index][key] >= value);\n/**\n * Return subset of `values` between `min` and `max` inclusive.\n * Values are assumed to be in sorted order.\n * @param values - sorted array of values\n * @param min - min value\n * @param max - max value\n */ function _filterBetween(values, min, max) {\n let start = 0;\n let end = values.length;\n while(start < end && values[start] < min){\n start++;\n }\n while(end > start && values[end - 1] > max){\n end--;\n }\n return start > 0 || end < values.length ? values.slice(start, end) : values;\n}\nconst arrayEvents = [\n 'push',\n 'pop',\n 'shift',\n 'splice',\n 'unshift'\n];\nfunction listenArrayEvents(array, listener) {\n if (array._chartjs) {\n array._chartjs.listeners.push(listener);\n return;\n }\n Object.defineProperty(array, '_chartjs', {\n configurable: true,\n enumerable: false,\n value: {\n listeners: [\n listener\n ]\n }\n });\n arrayEvents.forEach((key)=>{\n const method = '_onData' + _capitalize(key);\n const base = array[key];\n Object.defineProperty(array, key, {\n configurable: true,\n enumerable: false,\n value (...args) {\n const res = base.apply(this, args);\n array._chartjs.listeners.forEach((object)=>{\n if (typeof object[method] === 'function') {\n object[method](...args);\n }\n });\n return res;\n }\n });\n });\n}\nfunction unlistenArrayEvents(array, listener) {\n const stub = array._chartjs;\n if (!stub) {\n return;\n }\n const listeners = stub.listeners;\n const index = listeners.indexOf(listener);\n if (index !== -1) {\n listeners.splice(index, 1);\n }\n if (listeners.length > 0) {\n return;\n }\n arrayEvents.forEach((key)=>{\n delete array[key];\n });\n delete array._chartjs;\n}\n/**\n * @param items\n */ function _arrayUnique(items) {\n const set = new Set(items);\n if (set.size === items.length) {\n return items;\n }\n return Array.from(set);\n}\n\nfunction fontString(pixelSize, fontStyle, fontFamily) {\n return fontStyle + ' ' + pixelSize + 'px ' + fontFamily;\n}\n/**\n* Request animation polyfill\n*/ const requestAnimFrame = function() {\n if (typeof window === 'undefined') {\n return function(callback) {\n return callback();\n };\n }\n return window.requestAnimationFrame;\n}();\n/**\n * Throttles calling `fn` once per animation frame\n * Latest arguments are used on the actual call\n */ function throttled(fn, thisArg) {\n let argsToUse = [];\n let ticking = false;\n return function(...args) {\n // Save the args for use later\n argsToUse = args;\n if (!ticking) {\n ticking = true;\n requestAnimFrame.call(window, ()=>{\n ticking = false;\n fn.apply(thisArg, argsToUse);\n });\n }\n };\n}\n/**\n * Debounces calling `fn` for `delay` ms\n */ function debounce(fn, delay) {\n let timeout;\n return function(...args) {\n if (delay) {\n clearTimeout(timeout);\n timeout = setTimeout(fn, delay, args);\n } else {\n fn.apply(this, args);\n }\n return delay;\n };\n}\n/**\n * Converts 'start' to 'left', 'end' to 'right' and others to 'center'\n * @private\n */ const _toLeftRightCenter = (align)=>align === 'start' ? 'left' : align === 'end' ? 'right' : 'center';\n/**\n * Returns `start`, `end` or `(start + end) / 2` depending on `align`. Defaults to `center`\n * @private\n */ const _alignStartEnd = (align, start, end)=>align === 'start' ? start : align === 'end' ? end : (start + end) / 2;\n/**\n * Returns `left`, `right` or `(left + right) / 2` depending on `align`. Defaults to `left`\n * @private\n */ const _textX = (align, left, right, rtl)=>{\n const check = rtl ? 'left' : 'right';\n return align === check ? right : align === 'center' ? (left + right) / 2 : left;\n};\n/**\n * Return start and count of visible points.\n * @private\n */ function _getStartAndCountOfVisiblePoints(meta, points, animationsDisabled) {\n const pointCount = points.length;\n let start = 0;\n let count = pointCount;\n if (meta._sorted) {\n const { iScale , _parsed } = meta;\n const axis = iScale.axis;\n const { min , max , minDefined , maxDefined } = iScale.getUserBounds();\n if (minDefined) {\n start = _limitValue(Math.min(// @ts-expect-error Need to type _parsed\n _lookupByKey(_parsed, axis, min).lo, // @ts-expect-error Need to fix types on _lookupByKey\n animationsDisabled ? pointCount : _lookupByKey(points, axis, iScale.getPixelForValue(min)).lo), 0, pointCount - 1);\n }\n if (maxDefined) {\n count = _limitValue(Math.max(// @ts-expect-error Need to type _parsed\n _lookupByKey(_parsed, iScale.axis, max, true).hi + 1, // @ts-expect-error Need to fix types on _lookupByKey\n animationsDisabled ? 0 : _lookupByKey(points, axis, iScale.getPixelForValue(max), true).hi + 1), start, pointCount) - start;\n } else {\n count = pointCount - start;\n }\n }\n return {\n start,\n count\n };\n}\n/**\n * Checks if the scale ranges have changed.\n * @param {object} meta - dataset meta.\n * @returns {boolean}\n * @private\n */ function _scaleRangesChanged(meta) {\n const { xScale , yScale , _scaleRanges } = meta;\n const newRanges = {\n xmin: xScale.min,\n xmax: xScale.max,\n ymin: yScale.min,\n ymax: yScale.max\n };\n if (!_scaleRanges) {\n meta._scaleRanges = newRanges;\n return true;\n }\n const changed = _scaleRanges.xmin !== xScale.min || _scaleRanges.xmax !== xScale.max || _scaleRanges.ymin !== yScale.min || _scaleRanges.ymax !== yScale.max;\n Object.assign(_scaleRanges, newRanges);\n return changed;\n}\n\nconst atEdge = (t)=>t === 0 || t === 1;\nconst elasticIn = (t, s, p)=>-(Math.pow(2, 10 * (t -= 1)) * Math.sin((t - s) * TAU / p));\nconst elasticOut = (t, s, p)=>Math.pow(2, -10 * t) * Math.sin((t - s) * TAU / p) + 1;\n/**\n * Easing functions adapted from Robert Penner's easing equations.\n * @namespace Chart.helpers.easing.effects\n * @see http://www.robertpenner.com/easing/\n */ const effects = {\n linear: (t)=>t,\n easeInQuad: (t)=>t * t,\n easeOutQuad: (t)=>-t * (t - 2),\n easeInOutQuad: (t)=>(t /= 0.5) < 1 ? 0.5 * t * t : -0.5 * (--t * (t - 2) - 1),\n easeInCubic: (t)=>t * t * t,\n easeOutCubic: (t)=>(t -= 1) * t * t + 1,\n easeInOutCubic: (t)=>(t /= 0.5) < 1 ? 0.5 * t * t * t : 0.5 * ((t -= 2) * t * t + 2),\n easeInQuart: (t)=>t * t * t * t,\n easeOutQuart: (t)=>-((t -= 1) * t * t * t - 1),\n easeInOutQuart: (t)=>(t /= 0.5) < 1 ? 0.5 * t * t * t * t : -0.5 * ((t -= 2) * t * t * t - 2),\n easeInQuint: (t)=>t * t * t * t * t,\n easeOutQuint: (t)=>(t -= 1) * t * t * t * t + 1,\n easeInOutQuint: (t)=>(t /= 0.5) < 1 ? 0.5 * t * t * t * t * t : 0.5 * ((t -= 2) * t * t * t * t + 2),\n easeInSine: (t)=>-Math.cos(t * HALF_PI) + 1,\n easeOutSine: (t)=>Math.sin(t * HALF_PI),\n easeInOutSine: (t)=>-0.5 * (Math.cos(PI * t) - 1),\n easeInExpo: (t)=>t === 0 ? 0 : Math.pow(2, 10 * (t - 1)),\n easeOutExpo: (t)=>t === 1 ? 1 : -Math.pow(2, -10 * t) + 1,\n 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),\n easeInCirc: (t)=>t >= 1 ? t : -(Math.sqrt(1 - t * t) - 1),\n easeOutCirc: (t)=>Math.sqrt(1 - (t -= 1) * t),\n easeInOutCirc: (t)=>(t /= 0.5) < 1 ? -0.5 * (Math.sqrt(1 - t * t) - 1) : 0.5 * (Math.sqrt(1 - (t -= 2) * t) + 1),\n easeInElastic: (t)=>atEdge(t) ? t : elasticIn(t, 0.075, 0.3),\n easeOutElastic: (t)=>atEdge(t) ? t : elasticOut(t, 0.075, 0.3),\n easeInOutElastic (t) {\n const s = 0.1125;\n const p = 0.45;\n return atEdge(t) ? t : t < 0.5 ? 0.5 * elasticIn(t * 2, s, p) : 0.5 + 0.5 * elasticOut(t * 2 - 1, s, p);\n },\n easeInBack (t) {\n const s = 1.70158;\n return t * t * ((s + 1) * t - s);\n },\n easeOutBack (t) {\n const s = 1.70158;\n return (t -= 1) * t * ((s + 1) * t + s) + 1;\n },\n easeInOutBack (t) {\n let s = 1.70158;\n if ((t /= 0.5) < 1) {\n return 0.5 * (t * t * (((s *= 1.525) + 1) * t - s));\n }\n return 0.5 * ((t -= 2) * t * (((s *= 1.525) + 1) * t + s) + 2);\n },\n easeInBounce: (t)=>1 - effects.easeOutBounce(1 - t),\n easeOutBounce (t) {\n const m = 7.5625;\n const d = 2.75;\n if (t < 1 / d) {\n return m * t * t;\n }\n if (t < 2 / d) {\n return m * (t -= 1.5 / d) * t + 0.75;\n }\n if (t < 2.5 / d) {\n return m * (t -= 2.25 / d) * t + 0.9375;\n }\n return m * (t -= 2.625 / d) * t + 0.984375;\n },\n easeInOutBounce: (t)=>t < 0.5 ? effects.easeInBounce(t * 2) * 0.5 : effects.easeOutBounce(t * 2 - 1) * 0.5 + 0.5\n};\n\nfunction isPatternOrGradient(value) {\n if (value && typeof value === 'object') {\n const type = value.toString();\n return type === '[object CanvasPattern]' || type === '[object CanvasGradient]';\n }\n return false;\n}\nfunction color(value) {\n return isPatternOrGradient(value) ? value : new Color(value);\n}\nfunction getHoverColor(value) {\n return isPatternOrGradient(value) ? value : new Color(value).saturate(0.5).darken(0.1).hexString();\n}\n\nconst numbers = [\n 'x',\n 'y',\n 'borderWidth',\n 'radius',\n 'tension'\n];\nconst colors = [\n 'color',\n 'borderColor',\n 'backgroundColor'\n];\nfunction applyAnimationsDefaults(defaults) {\n defaults.set('animation', {\n delay: undefined,\n duration: 1000,\n easing: 'easeOutQuart',\n fn: undefined,\n from: undefined,\n loop: undefined,\n to: undefined,\n type: undefined\n });\n defaults.describe('animation', {\n _fallback: false,\n _indexable: false,\n _scriptable: (name)=>name !== 'onProgress' && name !== 'onComplete' && name !== 'fn'\n });\n defaults.set('animations', {\n colors: {\n type: 'color',\n properties: colors\n },\n numbers: {\n type: 'number',\n properties: numbers\n }\n });\n defaults.describe('animations', {\n _fallback: 'animation'\n });\n defaults.set('transitions', {\n active: {\n animation: {\n duration: 400\n }\n },\n resize: {\n animation: {\n duration: 0\n }\n },\n show: {\n animations: {\n colors: {\n from: 'transparent'\n },\n visible: {\n type: 'boolean',\n duration: 0\n }\n }\n },\n hide: {\n animations: {\n colors: {\n to: 'transparent'\n },\n visible: {\n type: 'boolean',\n easing: 'linear',\n fn: (v)=>v | 0\n }\n }\n }\n });\n}\n\nfunction applyLayoutsDefaults(defaults) {\n defaults.set('layout', {\n autoPadding: true,\n padding: {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n }\n });\n}\n\nconst intlCache = new Map();\nfunction getNumberFormat(locale, options) {\n options = options || {};\n const cacheKey = locale + JSON.stringify(options);\n let formatter = intlCache.get(cacheKey);\n if (!formatter) {\n formatter = new Intl.NumberFormat(locale, options);\n intlCache.set(cacheKey, formatter);\n }\n return formatter;\n}\nfunction formatNumber(num, locale, options) {\n return getNumberFormat(locale, options).format(num);\n}\n\nconst formatters = {\n values (value) {\n return isArray(value) ? value : '' + value;\n },\n numeric (tickValue, index, ticks) {\n if (tickValue === 0) {\n return '0';\n }\n const locale = this.chart.options.locale;\n let notation;\n let delta = tickValue;\n if (ticks.length > 1) {\n const maxTick = Math.max(Math.abs(ticks[0].value), Math.abs(ticks[ticks.length - 1].value));\n if (maxTick < 1e-4 || maxTick > 1e+15) {\n notation = 'scientific';\n }\n delta = calculateDelta(tickValue, ticks);\n }\n const logDelta = log10(Math.abs(delta));\n const numDecimal = isNaN(logDelta) ? 1 : Math.max(Math.min(-1 * Math.floor(logDelta), 20), 0);\n const options = {\n notation,\n minimumFractionDigits: numDecimal,\n maximumFractionDigits: numDecimal\n };\n Object.assign(options, this.options.ticks.format);\n return formatNumber(tickValue, locale, options);\n },\n logarithmic (tickValue, index, ticks) {\n if (tickValue === 0) {\n return '0';\n }\n const remain = ticks[index].significand || tickValue / Math.pow(10, Math.floor(log10(tickValue)));\n if ([\n 1,\n 2,\n 3,\n 5,\n 10,\n 15\n ].includes(remain) || index > 0.8 * ticks.length) {\n return formatters.numeric.call(this, tickValue, index, ticks);\n }\n return '';\n }\n};\nfunction calculateDelta(tickValue, ticks) {\n let delta = ticks.length > 3 ? ticks[2].value - ticks[1].value : ticks[1].value - ticks[0].value;\n if (Math.abs(delta) >= 1 && tickValue !== Math.floor(tickValue)) {\n delta = tickValue - Math.floor(tickValue);\n }\n return delta;\n}\n var Ticks = {\n formatters\n};\n\nfunction applyScaleDefaults(defaults) {\n defaults.set('scale', {\n display: true,\n offset: false,\n reverse: false,\n beginAtZero: false,\n bounds: 'ticks',\n clip: true,\n grace: 0,\n grid: {\n display: true,\n lineWidth: 1,\n drawOnChartArea: true,\n drawTicks: true,\n tickLength: 8,\n tickWidth: (_ctx, options)=>options.lineWidth,\n tickColor: (_ctx, options)=>options.color,\n offset: false\n },\n border: {\n display: true,\n dash: [],\n dashOffset: 0.0,\n width: 1\n },\n title: {\n display: false,\n text: '',\n padding: {\n top: 4,\n bottom: 4\n }\n },\n ticks: {\n minRotation: 0,\n maxRotation: 50,\n mirror: false,\n textStrokeWidth: 0,\n textStrokeColor: '',\n padding: 3,\n display: true,\n autoSkip: true,\n autoSkipPadding: 3,\n labelOffset: 0,\n callback: Ticks.formatters.values,\n minor: {},\n major: {},\n align: 'center',\n crossAlign: 'near',\n showLabelBackdrop: false,\n backdropColor: 'rgba(255, 255, 255, 0.75)',\n backdropPadding: 2\n }\n });\n defaults.route('scale.ticks', 'color', '', 'color');\n defaults.route('scale.grid', 'color', '', 'borderColor');\n defaults.route('scale.border', 'color', '', 'borderColor');\n defaults.route('scale.title', 'color', '', 'color');\n defaults.describe('scale', {\n _fallback: false,\n _scriptable: (name)=>!name.startsWith('before') && !name.startsWith('after') && name !== 'callback' && name !== 'parser',\n _indexable: (name)=>name !== 'borderDash' && name !== 'tickBorderDash' && name !== 'dash'\n });\n defaults.describe('scales', {\n _fallback: 'scale'\n });\n defaults.describe('scale.ticks', {\n _scriptable: (name)=>name !== 'backdropPadding' && name !== 'callback',\n _indexable: (name)=>name !== 'backdropPadding'\n });\n}\n\nconst overrides = Object.create(null);\nconst descriptors = Object.create(null);\n function getScope$1(node, key) {\n if (!key) {\n return node;\n }\n const keys = key.split('.');\n for(let i = 0, n = keys.length; i < n; ++i){\n const k = keys[i];\n node = node[k] || (node[k] = Object.create(null));\n }\n return node;\n}\nfunction set(root, scope, values) {\n if (typeof scope === 'string') {\n return merge(getScope$1(root, scope), values);\n }\n return merge(getScope$1(root, ''), scope);\n}\n class Defaults {\n constructor(_descriptors, _appliers){\n this.animation = undefined;\n this.backgroundColor = 'rgba(0,0,0,0.1)';\n this.borderColor = 'rgba(0,0,0,0.1)';\n this.color = '#666';\n this.datasets = {};\n this.devicePixelRatio = (context)=>context.chart.platform.getDevicePixelRatio();\n this.elements = {};\n this.events = [\n 'mousemove',\n 'mouseout',\n 'click',\n 'touchstart',\n 'touchmove'\n ];\n this.font = {\n family: \"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif\",\n size: 12,\n style: 'normal',\n lineHeight: 1.2,\n weight: null\n };\n this.hover = {};\n this.hoverBackgroundColor = (ctx, options)=>getHoverColor(options.backgroundColor);\n this.hoverBorderColor = (ctx, options)=>getHoverColor(options.borderColor);\n this.hoverColor = (ctx, options)=>getHoverColor(options.color);\n this.indexAxis = 'x';\n this.interaction = {\n mode: 'nearest',\n intersect: true,\n includeInvisible: false\n };\n this.maintainAspectRatio = true;\n this.onHover = null;\n this.onClick = null;\n this.parsing = true;\n this.plugins = {};\n this.responsive = true;\n this.scale = undefined;\n this.scales = {};\n this.showLine = true;\n this.drawActiveElementsOnTop = true;\n this.describe(_descriptors);\n this.apply(_appliers);\n }\n set(scope, values) {\n return set(this, scope, values);\n }\n get(scope) {\n return getScope$1(this, scope);\n }\n describe(scope, values) {\n return set(descriptors, scope, values);\n }\n override(scope, values) {\n return set(overrides, scope, values);\n }\n route(scope, name, targetScope, targetName) {\n const scopeObject = getScope$1(this, scope);\n const targetScopeObject = getScope$1(this, targetScope);\n const privateName = '_' + name;\n Object.defineProperties(scopeObject, {\n [privateName]: {\n value: scopeObject[name],\n writable: true\n },\n [name]: {\n enumerable: true,\n get () {\n const local = this[privateName];\n const target = targetScopeObject[targetName];\n if (isObject(local)) {\n return Object.assign({}, target, local);\n }\n return valueOrDefault(local, target);\n },\n set (value) {\n this[privateName] = value;\n }\n }\n });\n }\n apply(appliers) {\n appliers.forEach((apply)=>apply(this));\n }\n}\nvar defaults = /* #__PURE__ */ new Defaults({\n _scriptable: (name)=>!name.startsWith('on'),\n _indexable: (name)=>name !== 'events',\n hover: {\n _fallback: 'interaction'\n },\n interaction: {\n _scriptable: false,\n _indexable: false\n }\n}, [\n applyAnimationsDefaults,\n applyLayoutsDefaults,\n applyScaleDefaults\n]);\n\n/**\n * Converts the given font object into a CSS font string.\n * @param font - A font object.\n * @return The CSS font string. See https://developer.mozilla.org/en-US/docs/Web/CSS/font\n * @private\n */ function toFontString(font) {\n if (!font || isNullOrUndef(font.size) || isNullOrUndef(font.family)) {\n return null;\n }\n return (font.style ? font.style + ' ' : '') + (font.weight ? font.weight + ' ' : '') + font.size + 'px ' + font.family;\n}\n/**\n * @private\n */ function _measureText(ctx, data, gc, longest, string) {\n let textWidth = data[string];\n if (!textWidth) {\n textWidth = data[string] = ctx.measureText(string).width;\n gc.push(string);\n }\n if (textWidth > longest) {\n longest = textWidth;\n }\n return longest;\n}\n/**\n * @private\n */ // eslint-disable-next-line complexity\nfunction _longestText(ctx, font, arrayOfThings, cache) {\n cache = cache || {};\n let data = cache.data = cache.data || {};\n let gc = cache.garbageCollect = cache.garbageCollect || [];\n if (cache.font !== font) {\n data = cache.data = {};\n gc = cache.garbageCollect = [];\n cache.font = font;\n }\n ctx.save();\n ctx.font = font;\n let longest = 0;\n const ilen = arrayOfThings.length;\n let i, j, jlen, thing, nestedThing;\n for(i = 0; i < ilen; i++){\n thing = arrayOfThings[i];\n // Undefined strings and arrays should not be measured\n if (thing !== undefined && thing !== null && !isArray(thing)) {\n longest = _measureText(ctx, data, gc, longest, thing);\n } else if (isArray(thing)) {\n // if it is an array lets measure each element\n // to do maybe simplify this function a bit so we can do this more recursively?\n for(j = 0, jlen = thing.length; j < jlen; j++){\n nestedThing = thing[j];\n // Undefined strings and arrays should not be measured\n if (nestedThing !== undefined && nestedThing !== null && !isArray(nestedThing)) {\n longest = _measureText(ctx, data, gc, longest, nestedThing);\n }\n }\n }\n }\n ctx.restore();\n const gcLen = gc.length / 2;\n if (gcLen > arrayOfThings.length) {\n for(i = 0; i < gcLen; i++){\n delete data[gc[i]];\n }\n gc.splice(0, gcLen);\n }\n return longest;\n}\n/**\n * Returns the aligned pixel value to avoid anti-aliasing blur\n * @param chart - The chart instance.\n * @param pixel - A pixel value.\n * @param width - The width of the element.\n * @returns The aligned pixel value.\n * @private\n */ function _alignPixel(chart, pixel, width) {\n const devicePixelRatio = chart.currentDevicePixelRatio;\n const halfWidth = width !== 0 ? Math.max(width / 2, 0.5) : 0;\n return Math.round((pixel - halfWidth) * devicePixelRatio) / devicePixelRatio + halfWidth;\n}\n/**\n * Clears the entire canvas.\n */ function clearCanvas(canvas, ctx) {\n ctx = ctx || canvas.getContext('2d');\n ctx.save();\n // canvas.width and canvas.height do not consider the canvas transform,\n // while clearRect does\n ctx.resetTransform();\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n ctx.restore();\n}\nfunction drawPoint(ctx, options, x, y) {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n drawPointLegend(ctx, options, x, y, null);\n}\n// eslint-disable-next-line complexity\nfunction drawPointLegend(ctx, options, x, y, w) {\n let type, xOffset, yOffset, size, cornerRadius, width, xOffsetW, yOffsetW;\n const style = options.pointStyle;\n const rotation = options.rotation;\n const radius = options.radius;\n let rad = (rotation || 0) * RAD_PER_DEG;\n if (style && typeof style === 'object') {\n type = style.toString();\n if (type === '[object HTMLImageElement]' || type === '[object HTMLCanvasElement]') {\n ctx.save();\n ctx.translate(x, y);\n ctx.rotate(rad);\n ctx.drawImage(style, -style.width / 2, -style.height / 2, style.width, style.height);\n ctx.restore();\n return;\n }\n }\n if (isNaN(radius) || radius <= 0) {\n return;\n }\n ctx.beginPath();\n switch(style){\n // Default includes circle\n default:\n if (w) {\n ctx.ellipse(x, y, w / 2, radius, 0, 0, TAU);\n } else {\n ctx.arc(x, y, radius, 0, TAU);\n }\n ctx.closePath();\n break;\n case 'triangle':\n width = w ? w / 2 : radius;\n ctx.moveTo(x + Math.sin(rad) * width, y - Math.cos(rad) * radius);\n rad += TWO_THIRDS_PI;\n ctx.lineTo(x + Math.sin(rad) * width, y - Math.cos(rad) * radius);\n rad += TWO_THIRDS_PI;\n ctx.lineTo(x + Math.sin(rad) * width, y - Math.cos(rad) * radius);\n ctx.closePath();\n break;\n case 'rectRounded':\n // NOTE: the rounded rect implementation changed to use `arc` instead of\n // `quadraticCurveTo` since it generates better results when rect is\n // almost a circle. 0.516 (instead of 0.5) produces results with visually\n // closer proportion to the previous impl and it is inscribed in the\n // circle with `radius`. For more details, see the following PRs:\n // https://github.com/chartjs/Chart.js/issues/5597\n // https://github.com/chartjs/Chart.js/issues/5858\n cornerRadius = radius * 0.516;\n size = radius - cornerRadius;\n xOffset = Math.cos(rad + QUARTER_PI) * size;\n xOffsetW = Math.cos(rad + QUARTER_PI) * (w ? w / 2 - cornerRadius : size);\n yOffset = Math.sin(rad + QUARTER_PI) * size;\n yOffsetW = Math.sin(rad + QUARTER_PI) * (w ? w / 2 - cornerRadius : size);\n ctx.arc(x - xOffsetW, y - yOffset, cornerRadius, rad - PI, rad - HALF_PI);\n ctx.arc(x + yOffsetW, y - xOffset, cornerRadius, rad - HALF_PI, rad);\n ctx.arc(x + xOffsetW, y + yOffset, cornerRadius, rad, rad + HALF_PI);\n ctx.arc(x - yOffsetW, y + xOffset, cornerRadius, rad + HALF_PI, rad + PI);\n ctx.closePath();\n break;\n case 'rect':\n if (!rotation) {\n size = Math.SQRT1_2 * radius;\n width = w ? w / 2 : size;\n ctx.rect(x - width, y - size, 2 * width, 2 * size);\n break;\n }\n rad += QUARTER_PI;\n /* falls through */ case 'rectRot':\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n ctx.closePath();\n break;\n case 'crossRot':\n rad += QUARTER_PI;\n /* falls through */ case 'cross':\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.moveTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n break;\n case 'star':\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.moveTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n rad += QUARTER_PI;\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.moveTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n break;\n case 'line':\n xOffset = w ? w / 2 : Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n ctx.moveTo(x - xOffset, y - yOffset);\n ctx.lineTo(x + xOffset, y + yOffset);\n break;\n case 'dash':\n ctx.moveTo(x, y);\n ctx.lineTo(x + Math.cos(rad) * (w ? w / 2 : radius), y + Math.sin(rad) * radius);\n break;\n case false:\n ctx.closePath();\n break;\n }\n ctx.fill();\n if (options.borderWidth > 0) {\n ctx.stroke();\n }\n}\n/**\n * Returns true if the point is inside the rectangle\n * @param point - The point to test\n * @param area - The rectangle\n * @param margin - allowed margin\n * @private\n */ function _isPointInArea(point, area, margin) {\n margin = margin || 0.5; // margin - default is to match rounded decimals\n return !area || point && point.x > area.left - margin && point.x < area.right + margin && point.y > area.top - margin && point.y < area.bottom + margin;\n}\nfunction clipArea(ctx, area) {\n ctx.save();\n ctx.beginPath();\n ctx.rect(area.left, area.top, area.right - area.left, area.bottom - area.top);\n ctx.clip();\n}\nfunction unclipArea(ctx) {\n ctx.restore();\n}\n/**\n * @private\n */ function _steppedLineTo(ctx, previous, target, flip, mode) {\n if (!previous) {\n return ctx.lineTo(target.x, target.y);\n }\n if (mode === 'middle') {\n const midpoint = (previous.x + target.x) / 2.0;\n ctx.lineTo(midpoint, previous.y);\n ctx.lineTo(midpoint, target.y);\n } else if (mode === 'after' !== !!flip) {\n ctx.lineTo(previous.x, target.y);\n } else {\n ctx.lineTo(target.x, previous.y);\n }\n ctx.lineTo(target.x, target.y);\n}\n/**\n * @private\n */ function _bezierCurveTo(ctx, previous, target, flip) {\n if (!previous) {\n return ctx.lineTo(target.x, target.y);\n }\n 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);\n}\nfunction setRenderOpts(ctx, opts) {\n if (opts.translation) {\n ctx.translate(opts.translation[0], opts.translation[1]);\n }\n if (!isNullOrUndef(opts.rotation)) {\n ctx.rotate(opts.rotation);\n }\n if (opts.color) {\n ctx.fillStyle = opts.color;\n }\n if (opts.textAlign) {\n ctx.textAlign = opts.textAlign;\n }\n if (opts.textBaseline) {\n ctx.textBaseline = opts.textBaseline;\n }\n}\nfunction decorateText(ctx, x, y, line, opts) {\n if (opts.strikethrough || opts.underline) {\n /**\n * Now that IE11 support has been dropped, we can use more\n * of the TextMetrics object. The actual bounding boxes\n * are unflagged in Chrome, Firefox, Edge, and Safari so they\n * can be safely used.\n * See https://developer.mozilla.org/en-US/docs/Web/API/TextMetrics#Browser_compatibility\n */ const metrics = ctx.measureText(line);\n const left = x - metrics.actualBoundingBoxLeft;\n const right = x + metrics.actualBoundingBoxRight;\n const top = y - metrics.actualBoundingBoxAscent;\n const bottom = y + metrics.actualBoundingBoxDescent;\n const yDecoration = opts.strikethrough ? (top + bottom) / 2 : bottom;\n ctx.strokeStyle = ctx.fillStyle;\n ctx.beginPath();\n ctx.lineWidth = opts.decorationWidth || 2;\n ctx.moveTo(left, yDecoration);\n ctx.lineTo(right, yDecoration);\n ctx.stroke();\n }\n}\nfunction drawBackdrop(ctx, opts) {\n const oldColor = ctx.fillStyle;\n ctx.fillStyle = opts.color;\n ctx.fillRect(opts.left, opts.top, opts.width, opts.height);\n ctx.fillStyle = oldColor;\n}\n/**\n * Render text onto the canvas\n */ function renderText(ctx, text, x, y, font, opts = {}) {\n const lines = isArray(text) ? text : [\n text\n ];\n const stroke = opts.strokeWidth > 0 && opts.strokeColor !== '';\n let i, line;\n ctx.save();\n ctx.font = font.string;\n setRenderOpts(ctx, opts);\n for(i = 0; i < lines.length; ++i){\n line = lines[i];\n if (opts.backdrop) {\n drawBackdrop(ctx, opts.backdrop);\n }\n if (stroke) {\n if (opts.strokeColor) {\n ctx.strokeStyle = opts.strokeColor;\n }\n if (!isNullOrUndef(opts.strokeWidth)) {\n ctx.lineWidth = opts.strokeWidth;\n }\n ctx.strokeText(line, x, y, opts.maxWidth);\n }\n ctx.fillText(line, x, y, opts.maxWidth);\n decorateText(ctx, x, y, line, opts);\n y += Number(font.lineHeight);\n }\n ctx.restore();\n}\n/**\n * Add a path of a rectangle with rounded corners to the current sub-path\n * @param ctx - Context\n * @param rect - Bounding rect\n */ function addRoundedRectPath(ctx, rect) {\n const { x , y , w , h , radius } = rect;\n // top left arc\n ctx.arc(x + radius.topLeft, y + radius.topLeft, radius.topLeft, 1.5 * PI, PI, true);\n // line from top left to bottom left\n ctx.lineTo(x, y + h - radius.bottomLeft);\n // bottom left arc\n ctx.arc(x + radius.bottomLeft, y + h - radius.bottomLeft, radius.bottomLeft, PI, HALF_PI, true);\n // line from bottom left to bottom right\n ctx.lineTo(x + w - radius.bottomRight, y + h);\n // bottom right arc\n ctx.arc(x + w - radius.bottomRight, y + h - radius.bottomRight, radius.bottomRight, HALF_PI, 0, true);\n // line from bottom right to top right\n ctx.lineTo(x + w, y + radius.topRight);\n // top right arc\n ctx.arc(x + w - radius.topRight, y + radius.topRight, radius.topRight, 0, -HALF_PI, true);\n // line from top right to top left\n ctx.lineTo(x + radius.topLeft, y);\n}\n\nconst LINE_HEIGHT = /^(normal|(\\d+(?:\\.\\d+)?)(px|em|%)?)$/;\nconst FONT_STYLE = /^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;\n/**\n * @alias Chart.helpers.options\n * @namespace\n */ /**\n * Converts the given line height `value` in pixels for a specific font `size`.\n * @param value - The lineHeight to parse (eg. 1.6, '14px', '75%', '1.6em').\n * @param size - The font size (in pixels) used to resolve relative `value`.\n * @returns The effective line height in pixels (size * 1.2 if value is invalid).\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/line-height\n * @since 2.7.0\n */ function toLineHeight(value, size) {\n const matches = ('' + value).match(LINE_HEIGHT);\n if (!matches || matches[1] === 'normal') {\n return size * 1.2;\n }\n value = +matches[2];\n switch(matches[3]){\n case 'px':\n return value;\n case '%':\n value /= 100;\n break;\n }\n return size * value;\n}\nconst numberOrZero = (v)=>+v || 0;\nfunction _readValueToProps(value, props) {\n const ret = {};\n const objProps = isObject(props);\n const keys = objProps ? Object.keys(props) : props;\n const read = isObject(value) ? objProps ? (prop)=>valueOrDefault(value[prop], value[props[prop]]) : (prop)=>value[prop] : ()=>value;\n for (const prop of keys){\n ret[prop] = numberOrZero(read(prop));\n }\n return ret;\n}\n/**\n * Converts the given value into a TRBL object.\n * @param value - If a number, set the value to all TRBL component,\n * else, if an object, use defined properties and sets undefined ones to 0.\n * x / y are shorthands for same value for left/right and top/bottom.\n * @returns The padding values (top, right, bottom, left)\n * @since 3.0.0\n */ function toTRBL(value) {\n return _readValueToProps(value, {\n top: 'y',\n right: 'x',\n bottom: 'y',\n left: 'x'\n });\n}\n/**\n * Converts the given value into a TRBL corners object (similar with css border-radius).\n * @param value - If a number, set the value to all TRBL corner components,\n * else, if an object, use defined properties and sets undefined ones to 0.\n * @returns The TRBL corner values (topLeft, topRight, bottomLeft, bottomRight)\n * @since 3.0.0\n */ function toTRBLCorners(value) {\n return _readValueToProps(value, [\n 'topLeft',\n 'topRight',\n 'bottomLeft',\n 'bottomRight'\n ]);\n}\n/**\n * Converts the given value into a padding object with pre-computed width/height.\n * @param value - If a number, set the value to all TRBL component,\n * else, if an object, use defined properties and sets undefined ones to 0.\n * x / y are shorthands for same value for left/right and top/bottom.\n * @returns The padding values (top, right, bottom, left, width, height)\n * @since 2.7.0\n */ function toPadding(value) {\n const obj = toTRBL(value);\n obj.width = obj.left + obj.right;\n obj.height = obj.top + obj.bottom;\n return obj;\n}\n/**\n * Parses font options and returns the font object.\n * @param options - A object that contains font options to be parsed.\n * @param fallback - A object that contains fallback font options.\n * @return The font object.\n * @private\n */ function toFont(options, fallback) {\n options = options || {};\n fallback = fallback || defaults.font;\n let size = valueOrDefault(options.size, fallback.size);\n if (typeof size === 'string') {\n size = parseInt(size, 10);\n }\n let style = valueOrDefault(options.style, fallback.style);\n if (style && !('' + style).match(FONT_STYLE)) {\n console.warn('Invalid font style specified: \"' + style + '\"');\n style = undefined;\n }\n const font = {\n family: valueOrDefault(options.family, fallback.family),\n lineHeight: toLineHeight(valueOrDefault(options.lineHeight, fallback.lineHeight), size),\n size,\n style,\n weight: valueOrDefault(options.weight, fallback.weight),\n string: ''\n };\n font.string = toFontString(font);\n return font;\n}\n/**\n * Evaluates the given `inputs` sequentially and returns the first defined value.\n * @param inputs - An array of values, falling back to the last value.\n * @param context - If defined and the current value is a function, the value\n * is called with `context` as first argument and the result becomes the new input.\n * @param index - If defined and the current value is an array, the value\n * at `index` become the new input.\n * @param info - object to return information about resolution in\n * @param info.cacheable - Will be set to `false` if option is not cacheable.\n * @since 2.7.0\n */ function resolve(inputs, context, index, info) {\n let cacheable = true;\n let i, ilen, value;\n for(i = 0, ilen = inputs.length; i < ilen; ++i){\n value = inputs[i];\n if (value === undefined) {\n continue;\n }\n if (context !== undefined && typeof value === 'function') {\n value = value(context);\n cacheable = false;\n }\n if (index !== undefined && isArray(value)) {\n value = value[index % value.length];\n cacheable = false;\n }\n if (value !== undefined) {\n if (info && !cacheable) {\n info.cacheable = false;\n }\n return value;\n }\n }\n}\n/**\n * @param minmax\n * @param grace\n * @param beginAtZero\n * @private\n */ function _addGrace(minmax, grace, beginAtZero) {\n const { min , max } = minmax;\n const change = toDimension(grace, (max - min) / 2);\n const keepZero = (value, add)=>beginAtZero && value === 0 ? 0 : value + add;\n return {\n min: keepZero(min, -Math.abs(change)),\n max: keepZero(max, change)\n };\n}\nfunction createContext(parentContext, context) {\n return Object.assign(Object.create(parentContext), context);\n}\n\n/**\n * Creates a Proxy for resolving raw values for options.\n * @param scopes - The option scopes to look for values, in resolution order\n * @param prefixes - The prefixes for values, in resolution order.\n * @param rootScopes - The root option scopes\n * @param fallback - Parent scopes fallback\n * @param getTarget - callback for getting the target for changed values\n * @returns Proxy\n * @private\n */ function _createResolver(scopes, prefixes = [\n ''\n], rootScopes, fallback, getTarget = ()=>scopes[0]) {\n const finalRootScopes = rootScopes || scopes;\n if (typeof fallback === 'undefined') {\n fallback = _resolve('_fallback', scopes);\n }\n const cache = {\n [Symbol.toStringTag]: 'Object',\n _cacheable: true,\n _scopes: scopes,\n _rootScopes: finalRootScopes,\n _fallback: fallback,\n _getTarget: getTarget,\n override: (scope)=>_createResolver([\n scope,\n ...scopes\n ], prefixes, finalRootScopes, fallback)\n };\n return new Proxy(cache, {\n /**\n * A trap for the delete operator.\n */ deleteProperty (target, prop) {\n delete target[prop]; // remove from cache\n delete target._keys; // remove cached keys\n delete scopes[0][prop]; // remove from top level scope\n return true;\n },\n /**\n * A trap for getting property values.\n */ get (target, prop) {\n return _cached(target, prop, ()=>_resolveWithPrefixes(prop, prefixes, scopes, target));\n },\n /**\n * A trap for Object.getOwnPropertyDescriptor.\n * Also used by Object.hasOwnProperty.\n */ getOwnPropertyDescriptor (target, prop) {\n return Reflect.getOwnPropertyDescriptor(target._scopes[0], prop);\n },\n /**\n * A trap for Object.getPrototypeOf.\n */ getPrototypeOf () {\n return Reflect.getPrototypeOf(scopes[0]);\n },\n /**\n * A trap for the in operator.\n */ has (target, prop) {\n return getKeysFromAllScopes(target).includes(prop);\n },\n /**\n * A trap for Object.getOwnPropertyNames and Object.getOwnPropertySymbols.\n */ ownKeys (target) {\n return getKeysFromAllScopes(target);\n },\n /**\n * A trap for setting property values.\n */ set (target, prop, value) {\n const storage = target._storage || (target._storage = getTarget());\n target[prop] = storage[prop] = value; // set to top level scope + cache\n delete target._keys; // remove cached keys\n return true;\n }\n });\n}\n/**\n * Returns an Proxy for resolving option values with context.\n * @param proxy - The Proxy returned by `_createResolver`\n * @param context - Context object for scriptable/indexable options\n * @param subProxy - The proxy provided for scriptable options\n * @param descriptorDefaults - Defaults for descriptors\n * @private\n */ function _attachContext(proxy, context, subProxy, descriptorDefaults) {\n const cache = {\n _cacheable: false,\n _proxy: proxy,\n _context: context,\n _subProxy: subProxy,\n _stack: new Set(),\n _descriptors: _descriptors(proxy, descriptorDefaults),\n setContext: (ctx)=>_attachContext(proxy, ctx, subProxy, descriptorDefaults),\n override: (scope)=>_attachContext(proxy.override(scope), context, subProxy, descriptorDefaults)\n };\n return new Proxy(cache, {\n /**\n * A trap for the delete operator.\n */ deleteProperty (target, prop) {\n delete target[prop]; // remove from cache\n delete proxy[prop]; // remove from proxy\n return true;\n },\n /**\n * A trap for getting property values.\n */ get (target, prop, receiver) {\n return _cached(target, prop, ()=>_resolveWithContext(target, prop, receiver));\n },\n /**\n * A trap for Object.getOwnPropertyDescriptor.\n * Also used by Object.hasOwnProperty.\n */ getOwnPropertyDescriptor (target, prop) {\n return target._descriptors.allKeys ? Reflect.has(proxy, prop) ? {\n enumerable: true,\n configurable: true\n } : undefined : Reflect.getOwnPropertyDescriptor(proxy, prop);\n },\n /**\n * A trap for Object.getPrototypeOf.\n */ getPrototypeOf () {\n return Reflect.getPrototypeOf(proxy);\n },\n /**\n * A trap for the in operator.\n */ has (target, prop) {\n return Reflect.has(proxy, prop);\n },\n /**\n * A trap for Object.getOwnPropertyNames and Object.getOwnPropertySymbols.\n */ ownKeys () {\n return Reflect.ownKeys(proxy);\n },\n /**\n * A trap for setting property values.\n */ set (target, prop, value) {\n proxy[prop] = value; // set to proxy\n delete target[prop]; // remove from cache\n return true;\n }\n });\n}\n/**\n * @private\n */ function _descriptors(proxy, defaults = {\n scriptable: true,\n indexable: true\n}) {\n const { _scriptable =defaults.scriptable , _indexable =defaults.indexable , _allKeys =defaults.allKeys } = proxy;\n return {\n allKeys: _allKeys,\n scriptable: _scriptable,\n indexable: _indexable,\n isScriptable: isFunction(_scriptable) ? _scriptable : ()=>_scriptable,\n isIndexable: isFunction(_indexable) ? _indexable : ()=>_indexable\n };\n}\nconst readKey = (prefix, name)=>prefix ? prefix + _capitalize(name) : name;\nconst needsSubResolver = (prop, value)=>isObject(value) && prop !== 'adapters' && (Object.getPrototypeOf(value) === null || value.constructor === Object);\nfunction _cached(target, prop, resolve) {\n if (Object.prototype.hasOwnProperty.call(target, prop)) {\n return target[prop];\n }\n const value = resolve();\n // cache the resolved value\n target[prop] = value;\n return value;\n}\nfunction _resolveWithContext(target, prop, receiver) {\n const { _proxy , _context , _subProxy , _descriptors: descriptors } = target;\n let value = _proxy[prop]; // resolve from proxy\n // resolve with context\n if (isFunction(value) && descriptors.isScriptable(prop)) {\n value = _resolveScriptable(prop, value, target, receiver);\n }\n if (isArray(value) && value.length) {\n value = _resolveArray(prop, value, target, descriptors.isIndexable);\n }\n if (needsSubResolver(prop, value)) {\n // if the resolved value is an object, create a sub resolver for it\n value = _attachContext(value, _context, _subProxy && _subProxy[prop], descriptors);\n }\n return value;\n}\nfunction _resolveScriptable(prop, getValue, target, receiver) {\n const { _proxy , _context , _subProxy , _stack } = target;\n if (_stack.has(prop)) {\n throw new Error('Recursion detected: ' + Array.from(_stack).join('->') + '->' + prop);\n }\n _stack.add(prop);\n let value = getValue(_context, _subProxy || receiver);\n _stack.delete(prop);\n if (needsSubResolver(prop, value)) {\n // When scriptable option returns an object, create a resolver on that.\n value = createSubResolver(_proxy._scopes, _proxy, prop, value);\n }\n return value;\n}\nfunction _resolveArray(prop, value, target, isIndexable) {\n const { _proxy , _context , _subProxy , _descriptors: descriptors } = target;\n if (typeof _context.index !== 'undefined' && isIndexable(prop)) {\n return value[_context.index % value.length];\n } else if (isObject(value[0])) {\n // Array of objects, return array or resolvers\n const arr = value;\n const scopes = _proxy._scopes.filter((s)=>s !== arr);\n value = [];\n for (const item of arr){\n const resolver = createSubResolver(scopes, _proxy, prop, item);\n value.push(_attachContext(resolver, _context, _subProxy && _subProxy[prop], descriptors));\n }\n }\n return value;\n}\nfunction resolveFallback(fallback, prop, value) {\n return isFunction(fallback) ? fallback(prop, value) : fallback;\n}\nconst getScope = (key, parent)=>key === true ? parent : typeof key === 'string' ? resolveObjectKey(parent, key) : undefined;\nfunction addScopes(set, parentScopes, key, parentFallback, value) {\n for (const parent of parentScopes){\n const scope = getScope(key, parent);\n if (scope) {\n set.add(scope);\n const fallback = resolveFallback(scope._fallback, key, value);\n if (typeof fallback !== 'undefined' && fallback !== key && fallback !== parentFallback) {\n // When we reach the descriptor that defines a new _fallback, return that.\n // The fallback will resume to that new scope.\n return fallback;\n }\n } else if (scope === false && typeof parentFallback !== 'undefined' && key !== parentFallback) {\n // Fallback to `false` results to `false`, when falling back to different key.\n // For example `interaction` from `hover` or `plugins.tooltip` and `animation` from `animations`\n return null;\n }\n }\n return false;\n}\nfunction createSubResolver(parentScopes, resolver, prop, value) {\n const rootScopes = resolver._rootScopes;\n const fallback = resolveFallback(resolver._fallback, prop, value);\n const allScopes = [\n ...parentScopes,\n ...rootScopes\n ];\n const set = new Set();\n set.add(value);\n let key = addScopesFromKey(set, allScopes, prop, fallback || prop, value);\n if (key === null) {\n return false;\n }\n if (typeof fallback !== 'undefined' && fallback !== prop) {\n key = addScopesFromKey(set, allScopes, fallback, key, value);\n if (key === null) {\n return false;\n }\n }\n return _createResolver(Array.from(set), [\n ''\n ], rootScopes, fallback, ()=>subGetTarget(resolver, prop, value));\n}\nfunction addScopesFromKey(set, allScopes, key, fallback, item) {\n while(key){\n key = addScopes(set, allScopes, key, fallback, item);\n }\n return key;\n}\nfunction subGetTarget(resolver, prop, value) {\n const parent = resolver._getTarget();\n if (!(prop in parent)) {\n parent[prop] = {};\n }\n const target = parent[prop];\n if (isArray(target) && isObject(value)) {\n // For array of objects, the object is used to store updated values\n return value;\n }\n return target || {};\n}\nfunction _resolveWithPrefixes(prop, prefixes, scopes, proxy) {\n let value;\n for (const prefix of prefixes){\n value = _resolve(readKey(prefix, prop), scopes);\n if (typeof value !== 'undefined') {\n return needsSubResolver(prop, value) ? createSubResolver(scopes, proxy, prop, value) : value;\n }\n }\n}\nfunction _resolve(key, scopes) {\n for (const scope of scopes){\n if (!scope) {\n continue;\n }\n const value = scope[key];\n if (typeof value !== 'undefined') {\n return value;\n }\n }\n}\nfunction getKeysFromAllScopes(target) {\n let keys = target._keys;\n if (!keys) {\n keys = target._keys = resolveKeysFromAllScopes(target._scopes);\n }\n return keys;\n}\nfunction resolveKeysFromAllScopes(scopes) {\n const set = new Set();\n for (const scope of scopes){\n for (const key of Object.keys(scope).filter((k)=>!k.startsWith('_'))){\n set.add(key);\n }\n }\n return Array.from(set);\n}\nfunction _parseObjectDataRadialScale(meta, data, start, count) {\n const { iScale } = meta;\n const { key ='r' } = this._parsing;\n const parsed = new Array(count);\n let i, ilen, index, item;\n for(i = 0, ilen = count; i < ilen; ++i){\n index = i + start;\n item = data[index];\n parsed[i] = {\n r: iScale.parse(resolveObjectKey(item, key), index)\n };\n }\n return parsed;\n}\n\nconst EPSILON = Number.EPSILON || 1e-14;\nconst getPoint = (points, i)=>i < points.length && !points[i].skip && points[i];\nconst getValueAxis = (indexAxis)=>indexAxis === 'x' ? 'y' : 'x';\nfunction splineCurve(firstPoint, middlePoint, afterPoint, t) {\n // Props to Rob Spencer at scaled innovation for his post on splining between points\n // http://scaledinnovation.com/analytics/splines/aboutSplines.html\n // This function must also respect \"skipped\" points\n const previous = firstPoint.skip ? middlePoint : firstPoint;\n const current = middlePoint;\n const next = afterPoint.skip ? middlePoint : afterPoint;\n const d01 = distanceBetweenPoints(current, previous);\n const d12 = distanceBetweenPoints(next, current);\n let s01 = d01 / (d01 + d12);\n let s12 = d12 / (d01 + d12);\n // If all points are the same, s01 & s02 will be inf\n s01 = isNaN(s01) ? 0 : s01;\n s12 = isNaN(s12) ? 0 : s12;\n const fa = t * s01; // scaling factor for triangle Ta\n const fb = t * s12;\n return {\n previous: {\n x: current.x - fa * (next.x - previous.x),\n y: current.y - fa * (next.y - previous.y)\n },\n next: {\n x: current.x + fb * (next.x - previous.x),\n y: current.y + fb * (next.y - previous.y)\n }\n };\n}\n/**\n * Adjust tangents to ensure monotonic properties\n */ function monotoneAdjust(points, deltaK, mK) {\n const pointsLen = points.length;\n let alphaK, betaK, tauK, squaredMagnitude, pointCurrent;\n let pointAfter = getPoint(points, 0);\n for(let i = 0; i < pointsLen - 1; ++i){\n pointCurrent = pointAfter;\n pointAfter = getPoint(points, i + 1);\n if (!pointCurrent || !pointAfter) {\n continue;\n }\n if (almostEquals(deltaK[i], 0, EPSILON)) {\n mK[i] = mK[i + 1] = 0;\n continue;\n }\n alphaK = mK[i] / deltaK[i];\n betaK = mK[i + 1] / deltaK[i];\n squaredMagnitude = Math.pow(alphaK, 2) + Math.pow(betaK, 2);\n if (squaredMagnitude <= 9) {\n continue;\n }\n tauK = 3 / Math.sqrt(squaredMagnitude);\n mK[i] = alphaK * tauK * deltaK[i];\n mK[i + 1] = betaK * tauK * deltaK[i];\n }\n}\nfunction monotoneCompute(points, mK, indexAxis = 'x') {\n const valueAxis = getValueAxis(indexAxis);\n const pointsLen = points.length;\n let delta, pointBefore, pointCurrent;\n let pointAfter = getPoint(points, 0);\n for(let i = 0; i < pointsLen; ++i){\n pointBefore = pointCurrent;\n pointCurrent = pointAfter;\n pointAfter = getPoint(points, i + 1);\n if (!pointCurrent) {\n continue;\n }\n const iPixel = pointCurrent[indexAxis];\n const vPixel = pointCurrent[valueAxis];\n if (pointBefore) {\n delta = (iPixel - pointBefore[indexAxis]) / 3;\n pointCurrent[`cp1${indexAxis}`] = iPixel - delta;\n pointCurrent[`cp1${valueAxis}`] = vPixel - delta * mK[i];\n }\n if (pointAfter) {\n delta = (pointAfter[indexAxis] - iPixel) / 3;\n pointCurrent[`cp2${indexAxis}`] = iPixel + delta;\n pointCurrent[`cp2${valueAxis}`] = vPixel + delta * mK[i];\n }\n }\n}\n/**\n * This function calculates Bézier control points in a similar way than |splineCurve|,\n * but preserves monotonicity of the provided data and ensures no local extremums are added\n * between the dataset discrete points due to the interpolation.\n * See : https://en.wikipedia.org/wiki/Monotone_cubic_interpolation\n */ function splineCurveMonotone(points, indexAxis = 'x') {\n const valueAxis = getValueAxis(indexAxis);\n const pointsLen = points.length;\n const deltaK = Array(pointsLen).fill(0);\n const mK = Array(pointsLen);\n // Calculate slopes (deltaK) and initialize tangents (mK)\n let i, pointBefore, pointCurrent;\n let pointAfter = getPoint(points, 0);\n for(i = 0; i < pointsLen; ++i){\n pointBefore = pointCurrent;\n pointCurrent = pointAfter;\n pointAfter = getPoint(points, i + 1);\n if (!pointCurrent) {\n continue;\n }\n if (pointAfter) {\n const slopeDelta = pointAfter[indexAxis] - pointCurrent[indexAxis];\n // In the case of two points that appear at the same x pixel, slopeDeltaX is 0\n deltaK[i] = slopeDelta !== 0 ? (pointAfter[valueAxis] - pointCurrent[valueAxis]) / slopeDelta : 0;\n }\n mK[i] = !pointBefore ? deltaK[i] : !pointAfter ? deltaK[i - 1] : sign(deltaK[i - 1]) !== sign(deltaK[i]) ? 0 : (deltaK[i - 1] + deltaK[i]) / 2;\n }\n monotoneAdjust(points, deltaK, mK);\n monotoneCompute(points, mK, indexAxis);\n}\nfunction capControlPoint(pt, min, max) {\n return Math.max(Math.min(pt, max), min);\n}\nfunction capBezierPoints(points, area) {\n let i, ilen, point, inArea, inAreaPrev;\n let inAreaNext = _isPointInArea(points[0], area);\n for(i = 0, ilen = points.length; i < ilen; ++i){\n inAreaPrev = inArea;\n inArea = inAreaNext;\n inAreaNext = i < ilen - 1 && _isPointInArea(points[i + 1], area);\n if (!inArea) {\n continue;\n }\n point = points[i];\n if (inAreaPrev) {\n point.cp1x = capControlPoint(point.cp1x, area.left, area.right);\n point.cp1y = capControlPoint(point.cp1y, area.top, area.bottom);\n }\n if (inAreaNext) {\n point.cp2x = capControlPoint(point.cp2x, area.left, area.right);\n point.cp2y = capControlPoint(point.cp2y, area.top, area.bottom);\n }\n }\n}\n/**\n * @private\n */ function _updateBezierControlPoints(points, options, area, loop, indexAxis) {\n let i, ilen, point, controlPoints;\n // Only consider points that are drawn in case the spanGaps option is used\n if (options.spanGaps) {\n points = points.filter((pt)=>!pt.skip);\n }\n if (options.cubicInterpolationMode === 'monotone') {\n splineCurveMonotone(points, indexAxis);\n } else {\n let prev = loop ? points[points.length - 1] : points[0];\n for(i = 0, ilen = points.length; i < ilen; ++i){\n point = points[i];\n controlPoints = splineCurve(prev, point, points[Math.min(i + 1, ilen - (loop ? 0 : 1)) % ilen], options.tension);\n point.cp1x = controlPoints.previous.x;\n point.cp1y = controlPoints.previous.y;\n point.cp2x = controlPoints.next.x;\n point.cp2y = controlPoints.next.y;\n prev = point;\n }\n }\n if (options.capBezierPoints) {\n capBezierPoints(points, area);\n }\n}\n\n/**\n * Note: typedefs are auto-exported, so use a made-up `dom` namespace where\n * necessary to avoid duplicates with `export * from './helpers`; see\n * https://github.com/microsoft/TypeScript/issues/46011\n * @typedef { import('../core/core.controller.js').default } dom.Chart\n * @typedef { import('../../types').ChartEvent } ChartEvent\n */ /**\n * @private\n */ function _isDomSupported() {\n return typeof window !== 'undefined' && typeof document !== 'undefined';\n}\n/**\n * @private\n */ function _getParentNode(domNode) {\n let parent = domNode.parentNode;\n if (parent && parent.toString() === '[object ShadowRoot]') {\n parent = parent.host;\n }\n return parent;\n}\n/**\n * convert max-width/max-height values that may be percentages into a number\n * @private\n */ function parseMaxStyle(styleValue, node, parentProperty) {\n let valueInPixels;\n if (typeof styleValue === 'string') {\n valueInPixels = parseInt(styleValue, 10);\n if (styleValue.indexOf('%') !== -1) {\n // percentage * size in dimension\n valueInPixels = valueInPixels / 100 * node.parentNode[parentProperty];\n }\n } else {\n valueInPixels = styleValue;\n }\n return valueInPixels;\n}\nconst getComputedStyle = (element)=>element.ownerDocument.defaultView.getComputedStyle(element, null);\nfunction getStyle(el, property) {\n return getComputedStyle(el).getPropertyValue(property);\n}\nconst positions = [\n 'top',\n 'right',\n 'bottom',\n 'left'\n];\nfunction getPositionedStyle(styles, style, suffix) {\n const result = {};\n suffix = suffix ? '-' + suffix : '';\n for(let i = 0; i < 4; i++){\n const pos = positions[i];\n result[pos] = parseFloat(styles[style + '-' + pos + suffix]) || 0;\n }\n result.width = result.left + result.right;\n result.height = result.top + result.bottom;\n return result;\n}\nconst useOffsetPos = (x, y, target)=>(x > 0 || y > 0) && (!target || !target.shadowRoot);\n/**\n * @param e\n * @param canvas\n * @returns Canvas position\n */ function getCanvasPosition(e, canvas) {\n const touches = e.touches;\n const source = touches && touches.length ? touches[0] : e;\n const { offsetX , offsetY } = source;\n let box = false;\n let x, y;\n if (useOffsetPos(offsetX, offsetY, e.target)) {\n x = offsetX;\n y = offsetY;\n } else {\n const rect = canvas.getBoundingClientRect();\n x = source.clientX - rect.left;\n y = source.clientY - rect.top;\n box = true;\n }\n return {\n x,\n y,\n box\n };\n}\n/**\n * Gets an event's x, y coordinates, relative to the chart area\n * @param event\n * @param chart\n * @returns x and y coordinates of the event\n */ function getRelativePosition(event, chart) {\n if ('native' in event) {\n return event;\n }\n const { canvas , currentDevicePixelRatio } = chart;\n const style = getComputedStyle(canvas);\n const borderBox = style.boxSizing === 'border-box';\n const paddings = getPositionedStyle(style, 'padding');\n const borders = getPositionedStyle(style, 'border', 'width');\n const { x , y , box } = getCanvasPosition(event, canvas);\n const xOffset = paddings.left + (box && borders.left);\n const yOffset = paddings.top + (box && borders.top);\n let { width , height } = chart;\n if (borderBox) {\n width -= paddings.width + borders.width;\n height -= paddings.height + borders.height;\n }\n return {\n x: Math.round((x - xOffset) / width * canvas.width / currentDevicePixelRatio),\n y: Math.round((y - yOffset) / height * canvas.height / currentDevicePixelRatio)\n };\n}\nfunction getContainerSize(canvas, width, height) {\n let maxWidth, maxHeight;\n if (width === undefined || height === undefined) {\n const container = _getParentNode(canvas);\n if (!container) {\n width = canvas.clientWidth;\n height = canvas.clientHeight;\n } else {\n const rect = container.getBoundingClientRect(); // this is the border box of the container\n const containerStyle = getComputedStyle(container);\n const containerBorder = getPositionedStyle(containerStyle, 'border', 'width');\n const containerPadding = getPositionedStyle(containerStyle, 'padding');\n width = rect.width - containerPadding.width - containerBorder.width;\n height = rect.height - containerPadding.height - containerBorder.height;\n maxWidth = parseMaxStyle(containerStyle.maxWidth, container, 'clientWidth');\n maxHeight = parseMaxStyle(containerStyle.maxHeight, container, 'clientHeight');\n }\n }\n return {\n width,\n height,\n maxWidth: maxWidth || INFINITY,\n maxHeight: maxHeight || INFINITY\n };\n}\nconst round1 = (v)=>Math.round(v * 10) / 10;\n// eslint-disable-next-line complexity\nfunction getMaximumSize(canvas, bbWidth, bbHeight, aspectRatio) {\n const style = getComputedStyle(canvas);\n const margins = getPositionedStyle(style, 'margin');\n const maxWidth = parseMaxStyle(style.maxWidth, canvas, 'clientWidth') || INFINITY;\n const maxHeight = parseMaxStyle(style.maxHeight, canvas, 'clientHeight') || INFINITY;\n const containerSize = getContainerSize(canvas, bbWidth, bbHeight);\n let { width , height } = containerSize;\n if (style.boxSizing === 'content-box') {\n const borders = getPositionedStyle(style, 'border', 'width');\n const paddings = getPositionedStyle(style, 'padding');\n width -= paddings.width + borders.width;\n height -= paddings.height + borders.height;\n }\n width = Math.max(0, width - margins.width);\n height = Math.max(0, aspectRatio ? width / aspectRatio : height - margins.height);\n width = round1(Math.min(width, maxWidth, containerSize.maxWidth));\n height = round1(Math.min(height, maxHeight, containerSize.maxHeight));\n if (width && !height) {\n // https://github.com/chartjs/Chart.js/issues/4659\n // If the canvas has width, but no height, default to aspectRatio of 2 (canvas default)\n height = round1(width / 2);\n }\n const maintainHeight = bbWidth !== undefined || bbHeight !== undefined;\n if (maintainHeight && aspectRatio && containerSize.height && height > containerSize.height) {\n height = containerSize.height;\n width = round1(Math.floor(height * aspectRatio));\n }\n return {\n width,\n height\n };\n}\n/**\n * @param chart\n * @param forceRatio\n * @param forceStyle\n * @returns True if the canvas context size or transformation has changed.\n */ function retinaScale(chart, forceRatio, forceStyle) {\n const pixelRatio = forceRatio || 1;\n const deviceHeight = Math.floor(chart.height * pixelRatio);\n const deviceWidth = Math.floor(chart.width * pixelRatio);\n chart.height = Math.floor(chart.height);\n chart.width = Math.floor(chart.width);\n const canvas = chart.canvas;\n // If no style has been set on the canvas, the render size is used as display size,\n // making the chart visually bigger, so let's enforce it to the \"correct\" values.\n // See https://github.com/chartjs/Chart.js/issues/3575\n if (canvas.style && (forceStyle || !canvas.style.height && !canvas.style.width)) {\n canvas.style.height = `${chart.height}px`;\n canvas.style.width = `${chart.width}px`;\n }\n if (chart.currentDevicePixelRatio !== pixelRatio || canvas.height !== deviceHeight || canvas.width !== deviceWidth) {\n chart.currentDevicePixelRatio = pixelRatio;\n canvas.height = deviceHeight;\n canvas.width = deviceWidth;\n chart.ctx.setTransform(pixelRatio, 0, 0, pixelRatio, 0, 0);\n return true;\n }\n return false;\n}\n/**\n * Detects support for options object argument in addEventListener.\n * https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Safely_detecting_option_support\n * @private\n */ const supportsEventListenerOptions = function() {\n let passiveSupported = false;\n try {\n const options = {\n get passive () {\n passiveSupported = true;\n return false;\n }\n };\n window.addEventListener('test', null, options);\n window.removeEventListener('test', null, options);\n } catch (e) {\n // continue regardless of error\n }\n return passiveSupported;\n}();\n/**\n * The \"used\" size is the final value of a dimension property after all calculations have\n * been performed. This method uses the computed style of `element` but returns undefined\n * if the computed style is not expressed in pixels. That can happen in some cases where\n * `element` has a size relative to its parent and this last one is not yet displayed,\n * for example because of `display: none` on a parent node.\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/used_value\n * @returns Size in pixels or undefined if unknown.\n */ function readUsedSize(element, property) {\n const value = getStyle(element, property);\n const matches = value && value.match(/^(\\d+)(\\.\\d+)?px$/);\n return matches ? +matches[1] : undefined;\n}\n\n/**\n * @private\n */ function _pointInLine(p1, p2, t, mode) {\n return {\n x: p1.x + t * (p2.x - p1.x),\n y: p1.y + t * (p2.y - p1.y)\n };\n}\n/**\n * @private\n */ function _steppedInterpolation(p1, p2, t, mode) {\n return {\n x: p1.x + t * (p2.x - p1.x),\n y: mode === 'middle' ? t < 0.5 ? p1.y : p2.y : mode === 'after' ? t < 1 ? p1.y : p2.y : t > 0 ? p2.y : p1.y\n };\n}\n/**\n * @private\n */ function _bezierInterpolation(p1, p2, t, mode) {\n const cp1 = {\n x: p1.cp2x,\n y: p1.cp2y\n };\n const cp2 = {\n x: p2.cp1x,\n y: p2.cp1y\n };\n const a = _pointInLine(p1, cp1, t);\n const b = _pointInLine(cp1, cp2, t);\n const c = _pointInLine(cp2, p2, t);\n const d = _pointInLine(a, b, t);\n const e = _pointInLine(b, c, t);\n return _pointInLine(d, e, t);\n}\n\nconst getRightToLeftAdapter = function(rectX, width) {\n return {\n x (x) {\n return rectX + rectX + width - x;\n },\n setWidth (w) {\n width = w;\n },\n textAlign (align) {\n if (align === 'center') {\n return align;\n }\n return align === 'right' ? 'left' : 'right';\n },\n xPlus (x, value) {\n return x - value;\n },\n leftForLtr (x, itemWidth) {\n return x - itemWidth;\n }\n };\n};\nconst getLeftToRightAdapter = function() {\n return {\n x (x) {\n return x;\n },\n setWidth (w) {},\n textAlign (align) {\n return align;\n },\n xPlus (x, value) {\n return x + value;\n },\n leftForLtr (x, _itemWidth) {\n return x;\n }\n };\n};\nfunction getRtlAdapter(rtl, rectX, width) {\n return rtl ? getRightToLeftAdapter(rectX, width) : getLeftToRightAdapter();\n}\nfunction overrideTextDirection(ctx, direction) {\n let style, original;\n if (direction === 'ltr' || direction === 'rtl') {\n style = ctx.canvas.style;\n original = [\n style.getPropertyValue('direction'),\n style.getPropertyPriority('direction')\n ];\n style.setProperty('direction', direction, 'important');\n ctx.prevTextDirection = original;\n }\n}\nfunction restoreTextDirection(ctx, original) {\n if (original !== undefined) {\n delete ctx.prevTextDirection;\n ctx.canvas.style.setProperty('direction', original[0], original[1]);\n }\n}\n\nfunction propertyFn(property) {\n if (property === 'angle') {\n return {\n between: _angleBetween,\n compare: _angleDiff,\n normalize: _normalizeAngle\n };\n }\n return {\n between: _isBetween,\n compare: (a, b)=>a - b,\n normalize: (x)=>x\n };\n}\nfunction normalizeSegment({ start , end , count , loop , style }) {\n return {\n start: start % count,\n end: end % count,\n loop: loop && (end - start + 1) % count === 0,\n style\n };\n}\nfunction getSegment(segment, points, bounds) {\n const { property , start: startBound , end: endBound } = bounds;\n const { between , normalize } = propertyFn(property);\n const count = points.length;\n let { start , end , loop } = segment;\n let i, ilen;\n if (loop) {\n start += count;\n end += count;\n for(i = 0, ilen = count; i < ilen; ++i){\n if (!between(normalize(points[start % count][property]), startBound, endBound)) {\n break;\n }\n start--;\n end--;\n }\n start %= count;\n end %= count;\n }\n if (end < start) {\n end += count;\n }\n return {\n start,\n end,\n loop,\n style: segment.style\n };\n}\n function _boundSegment(segment, points, bounds) {\n if (!bounds) {\n return [\n segment\n ];\n }\n const { property , start: startBound , end: endBound } = bounds;\n const count = points.length;\n const { compare , between , normalize } = propertyFn(property);\n const { start , end , loop , style } = getSegment(segment, points, bounds);\n const result = [];\n let inside = false;\n let subStart = null;\n let value, point, prevValue;\n const startIsBefore = ()=>between(startBound, prevValue, value) && compare(startBound, prevValue) !== 0;\n const endIsBefore = ()=>compare(endBound, value) === 0 || between(endBound, prevValue, value);\n const shouldStart = ()=>inside || startIsBefore();\n const shouldStop = ()=>!inside || endIsBefore();\n for(let i = start, prev = start; i <= end; ++i){\n point = points[i % count];\n if (point.skip) {\n continue;\n }\n value = normalize(point[property]);\n if (value === prevValue) {\n continue;\n }\n inside = between(value, startBound, endBound);\n if (subStart === null && shouldStart()) {\n subStart = compare(value, startBound) === 0 ? i : prev;\n }\n if (subStart !== null && shouldStop()) {\n result.push(normalizeSegment({\n start: subStart,\n end: i,\n loop,\n count,\n style\n }));\n subStart = null;\n }\n prev = i;\n prevValue = value;\n }\n if (subStart !== null) {\n result.push(normalizeSegment({\n start: subStart,\n end,\n loop,\n count,\n style\n }));\n }\n return result;\n}\n function _boundSegments(line, bounds) {\n const result = [];\n const segments = line.segments;\n for(let i = 0; i < segments.length; i++){\n const sub = _boundSegment(segments[i], line.points, bounds);\n if (sub.length) {\n result.push(...sub);\n }\n }\n return result;\n}\n function findStartAndEnd(points, count, loop, spanGaps) {\n let start = 0;\n let end = count - 1;\n if (loop && !spanGaps) {\n while(start < count && !points[start].skip){\n start++;\n }\n }\n while(start < count && points[start].skip){\n start++;\n }\n start %= count;\n if (loop) {\n end += start;\n }\n while(end > start && points[end % count].skip){\n end--;\n }\n end %= count;\n return {\n start,\n end\n };\n}\n function solidSegments(points, start, max, loop) {\n const count = points.length;\n const result = [];\n let last = start;\n let prev = points[start];\n let end;\n for(end = start + 1; end <= max; ++end){\n const cur = points[end % count];\n if (cur.skip || cur.stop) {\n if (!prev.skip) {\n loop = false;\n result.push({\n start: start % count,\n end: (end - 1) % count,\n loop\n });\n start = last = cur.stop ? end : null;\n }\n } else {\n last = end;\n if (prev.skip) {\n start = end;\n }\n }\n prev = cur;\n }\n if (last !== null) {\n result.push({\n start: start % count,\n end: last % count,\n loop\n });\n }\n return result;\n}\n function _computeSegments(line, segmentOptions) {\n const points = line.points;\n const spanGaps = line.options.spanGaps;\n const count = points.length;\n if (!count) {\n return [];\n }\n const loop = !!line._loop;\n const { start , end } = findStartAndEnd(points, count, loop, spanGaps);\n if (spanGaps === true) {\n return splitByStyles(line, [\n {\n start,\n end,\n loop\n }\n ], points, segmentOptions);\n }\n const max = end < start ? end + count : end;\n const completeLoop = !!line._fullLoop && start === 0 && end === count - 1;\n return splitByStyles(line, solidSegments(points, start, max, completeLoop), points, segmentOptions);\n}\n function splitByStyles(line, segments, points, segmentOptions) {\n if (!segmentOptions || !segmentOptions.setContext || !points) {\n return segments;\n }\n return doSplitByStyles(line, segments, points, segmentOptions);\n}\n function doSplitByStyles(line, segments, points, segmentOptions) {\n const chartContext = line._chart.getContext();\n const baseStyle = readStyle(line.options);\n const { _datasetIndex: datasetIndex , options: { spanGaps } } = line;\n const count = points.length;\n const result = [];\n let prevStyle = baseStyle;\n let start = segments[0].start;\n let i = start;\n function addStyle(s, e, l, st) {\n const dir = spanGaps ? -1 : 1;\n if (s === e) {\n return;\n }\n s += count;\n while(points[s % count].skip){\n s -= dir;\n }\n while(points[e % count].skip){\n e += dir;\n }\n if (s % count !== e % count) {\n result.push({\n start: s % count,\n end: e % count,\n loop: l,\n style: st\n });\n prevStyle = st;\n start = e % count;\n }\n }\n for (const segment of segments){\n start = spanGaps ? start : segment.start;\n let prev = points[start % count];\n let style;\n for(i = start + 1; i <= segment.end; i++){\n const pt = points[i % count];\n style = readStyle(segmentOptions.setContext(createContext(chartContext, {\n type: 'segment',\n p0: prev,\n p1: pt,\n p0DataIndex: (i - 1) % count,\n p1DataIndex: i % count,\n datasetIndex\n })));\n if (styleChanged(style, prevStyle)) {\n addStyle(start, i - 1, segment.loop, prevStyle);\n }\n prev = pt;\n prevStyle = style;\n }\n if (start < i - 1) {\n addStyle(start, i - 1, segment.loop, prevStyle);\n }\n }\n return result;\n}\nfunction readStyle(options) {\n return {\n backgroundColor: options.backgroundColor,\n borderCapStyle: options.borderCapStyle,\n borderDash: options.borderDash,\n borderDashOffset: options.borderDashOffset,\n borderJoinStyle: options.borderJoinStyle,\n borderWidth: options.borderWidth,\n borderColor: options.borderColor\n };\n}\nfunction styleChanged(style, prevStyle) {\n if (!prevStyle) {\n return false;\n }\n const cache = [];\n const replacer = function(key, value) {\n if (!isPatternOrGradient(value)) {\n return value;\n }\n if (!cache.includes(value)) {\n cache.push(value);\n }\n return cache.indexOf(value);\n };\n return JSON.stringify(style, replacer) !== JSON.stringify(prevStyle, replacer);\n}\n\nexport { unclipArea as $, _rlookupByKey as A, _lookupByKey as B, _isPointInArea as C, getAngleFromPoint as D, toPadding as E, each as F, getMaximumSize as G, HALF_PI as H, _getParentNode as I, readUsedSize as J, supportsEventListenerOptions as K, throttled as L, _isDomSupported as M, _factorize as N, finiteOrDefault as O, PI as P, callback as Q, _addGrace as R, _limitValue as S, TAU as T, toDegrees as U, _measureText as V, _int16Range as W, _alignPixel as X, clipArea as Y, renderText as Z, _arrayUnique as _, resolve as a, fontString as a$, toFont as a0, _toLeftRightCenter as a1, _alignStartEnd as a2, overrides as a3, merge as a4, _capitalize as a5, descriptors as a6, isFunction as a7, _attachContext as a8, _createResolver as a9, overrideTextDirection as aA, _textX as aB, restoreTextDirection as aC, drawPointLegend as aD, distanceBetweenPoints as aE, noop as aF, _setMinAndMaxByKey as aG, niceNum as aH, almostWhole as aI, almostEquals as aJ, _decimalPlaces as aK, Ticks as aL, log10 as aM, _longestText as aN, _filterBetween as aO, _lookup as aP, isPatternOrGradient as aQ, getHoverColor as aR, clone as aS, _merger as aT, _mergerIf as aU, _deprecated as aV, _splitKey as aW, toFontString as aX, splineCurve as aY, splineCurveMonotone as aZ, getStyle as a_, _descriptors as aa, mergeIf as ab, uid as ac, debounce as ad, retinaScale as ae, clearCanvas as af, setsEqual as ag, _elementsEqual as ah, _isClickEvent as ai, _isBetween as aj, _readValueToProps as ak, _updateBezierControlPoints as al, _computeSegments as am, _boundSegments as an, _steppedInterpolation as ao, _bezierInterpolation as ap, _pointInLine as aq, _steppedLineTo as ar, _bezierCurveTo as as, drawPoint as at, addRoundedRectPath as au, toTRBL as av, toTRBLCorners as aw, _boundSegment as ax, _normalizeAngle as ay, getRtlAdapter as az, isArray as b, toLineHeight as b0, PITAU as b1, INFINITY as b2, RAD_PER_DEG as b3, QUARTER_PI as b4, TWO_THIRDS_PI as b5, _angleDiff as b6, color as c, defaults as d, effects as e, resolveObjectKey as f, isNumberFinite as g, defined as h, isObject as i, createContext as j, isNullOrUndef as k, listenArrayEvents as l, toPercentage as m, toDimension as n, formatNumber as o, _angleBetween as p, _getStartAndCountOfVisiblePoints as q, requestAnimFrame as r, sign as s, toRadians as t, unlistenArrayEvents as u, valueOrDefault as v, _scaleRangesChanged as w, isNumber as x, _parseObjectDataRadialScale as y, getRelativePosition as z };\n//# sourceMappingURL=helpers.segment.js.map\n","/*!\n * Chart.js v4.4.0\n * https://www.chartjs.org\n * (c) 2023 Chart.js Contributors\n * Released under the MIT License\n */\nimport { r as requestAnimFrame, a as resolve, e as effects, c as color, i as isObject, d as defaults, b as isArray, v as valueOrDefault, u as unlistenArrayEvents, l as listenArrayEvents, f as resolveObjectKey, g as isNumberFinite, h as defined, s as sign, j as createContext, k as isNullOrUndef, _ as _arrayUnique, t as toRadians, m as toPercentage, n as toDimension, T as TAU, o as formatNumber, p as _angleBetween, H as HALF_PI, P as PI, q as _getStartAndCountOfVisiblePoints, w as _scaleRangesChanged, x as isNumber, y as _parseObjectDataRadialScale, z as getRelativePosition, A as _rlookupByKey, B as _lookupByKey, C as _isPointInArea, D as getAngleFromPoint, E as toPadding, F as each, G as getMaximumSize, I as _getParentNode, J as readUsedSize, K as supportsEventListenerOptions, L as throttled, M as _isDomSupported, N as _factorize, O as finiteOrDefault, Q as callback, R as _addGrace, S as _limitValue, U as toDegrees, V as _measureText, W as _int16Range, X as _alignPixel, Y as clipArea, Z as renderText, $ as unclipArea, a0 as toFont, a1 as _toLeftRightCenter, a2 as _alignStartEnd, a3 as overrides, a4 as merge, a5 as _capitalize, a6 as descriptors, a7 as isFunction, a8 as _attachContext, a9 as _createResolver, aa as _descriptors, ab as mergeIf, ac as uid, ad as debounce, ae as retinaScale, af as clearCanvas, ag as setsEqual, ah as _elementsEqual, ai as _isClickEvent, aj as _isBetween, ak as _readValueToProps, al as _updateBezierControlPoints, am as _computeSegments, an as _boundSegments, ao as _steppedInterpolation, ap as _bezierInterpolation, aq as _pointInLine, ar as _steppedLineTo, as as _bezierCurveTo, at as drawPoint, au as addRoundedRectPath, av as toTRBL, aw as toTRBLCorners, ax as _boundSegment, ay as _normalizeAngle, az as getRtlAdapter, aA as overrideTextDirection, aB as _textX, aC as restoreTextDirection, aD as drawPointLegend, aE as distanceBetweenPoints, aF as noop, aG as _setMinAndMaxByKey, aH as niceNum, aI as almostWhole, aJ as almostEquals, aK as _decimalPlaces, aL as Ticks, aM as log10, aN as _longestText, aO as _filterBetween, aP as _lookup } from './chunks/helpers.segment.js';\nimport '@kurkle/color';\n\nclass Animator {\n constructor(){\n this._request = null;\n this._charts = new Map();\n this._running = false;\n this._lastDate = undefined;\n }\n _notify(chart, anims, date, type) {\n const callbacks = anims.listeners[type];\n const numSteps = anims.duration;\n callbacks.forEach((fn)=>fn({\n chart,\n initial: anims.initial,\n numSteps,\n currentStep: Math.min(date - anims.start, numSteps)\n }));\n }\n _refresh() {\n if (this._request) {\n return;\n }\n this._running = true;\n this._request = requestAnimFrame.call(window, ()=>{\n this._update();\n this._request = null;\n if (this._running) {\n this._refresh();\n }\n });\n }\n _update(date = Date.now()) {\n let remaining = 0;\n this._charts.forEach((anims, chart)=>{\n if (!anims.running || !anims.items.length) {\n return;\n }\n const items = anims.items;\n let i = items.length - 1;\n let draw = false;\n let item;\n for(; i >= 0; --i){\n item = items[i];\n if (item._active) {\n if (item._total > anims.duration) {\n anims.duration = item._total;\n }\n item.tick(date);\n draw = true;\n } else {\n items[i] = items[items.length - 1];\n items.pop();\n }\n }\n if (draw) {\n chart.draw();\n this._notify(chart, anims, date, 'progress');\n }\n if (!items.length) {\n anims.running = false;\n this._notify(chart, anims, date, 'complete');\n anims.initial = false;\n }\n remaining += items.length;\n });\n this._lastDate = date;\n if (remaining === 0) {\n this._running = false;\n }\n }\n _getAnims(chart) {\n const charts = this._charts;\n let anims = charts.get(chart);\n if (!anims) {\n anims = {\n running: false,\n initial: true,\n items: [],\n listeners: {\n complete: [],\n progress: []\n }\n };\n charts.set(chart, anims);\n }\n return anims;\n }\n listen(chart, event, cb) {\n this._getAnims(chart).listeners[event].push(cb);\n }\n add(chart, items) {\n if (!items || !items.length) {\n return;\n }\n this._getAnims(chart).items.push(...items);\n }\n has(chart) {\n return this._getAnims(chart).items.length > 0;\n }\n start(chart) {\n const anims = this._charts.get(chart);\n if (!anims) {\n return;\n }\n anims.running = true;\n anims.start = Date.now();\n anims.duration = anims.items.reduce((acc, cur)=>Math.max(acc, cur._duration), 0);\n this._refresh();\n }\n running(chart) {\n if (!this._running) {\n return false;\n }\n const anims = this._charts.get(chart);\n if (!anims || !anims.running || !anims.items.length) {\n return false;\n }\n return true;\n }\n stop(chart) {\n const anims = this._charts.get(chart);\n if (!anims || !anims.items.length) {\n return;\n }\n const items = anims.items;\n let i = items.length - 1;\n for(; i >= 0; --i){\n items[i].cancel();\n }\n anims.items = [];\n this._notify(chart, anims, Date.now(), 'complete');\n }\n remove(chart) {\n return this._charts.delete(chart);\n }\n}\nvar animator = /* #__PURE__ */ new Animator();\n\nconst transparent = 'transparent';\nconst interpolators = {\n boolean (from, to, factor) {\n return factor > 0.5 ? to : from;\n },\n color (from, to, factor) {\n const c0 = color(from || transparent);\n const c1 = c0.valid && color(to || transparent);\n return c1 && c1.valid ? c1.mix(c0, factor).hexString() : to;\n },\n number (from, to, factor) {\n return from + (to - from) * factor;\n }\n};\nclass Animation {\n constructor(cfg, target, prop, to){\n const currentValue = target[prop];\n to = resolve([\n cfg.to,\n to,\n currentValue,\n cfg.from\n ]);\n const from = resolve([\n cfg.from,\n currentValue,\n to\n ]);\n this._active = true;\n this._fn = cfg.fn || interpolators[cfg.type || typeof from];\n this._easing = effects[cfg.easing] || effects.linear;\n this._start = Math.floor(Date.now() + (cfg.delay || 0));\n this._duration = this._total = Math.floor(cfg.duration);\n this._loop = !!cfg.loop;\n this._target = target;\n this._prop = prop;\n this._from = from;\n this._to = to;\n this._promises = undefined;\n }\n active() {\n return this._active;\n }\n update(cfg, to, date) {\n if (this._active) {\n this._notify(false);\n const currentValue = this._target[this._prop];\n const elapsed = date - this._start;\n const remain = this._duration - elapsed;\n this._start = date;\n this._duration = Math.floor(Math.max(remain, cfg.duration));\n this._total += elapsed;\n this._loop = !!cfg.loop;\n this._to = resolve([\n cfg.to,\n to,\n currentValue,\n cfg.from\n ]);\n this._from = resolve([\n cfg.from,\n currentValue,\n to\n ]);\n }\n }\n cancel() {\n if (this._active) {\n this.tick(Date.now());\n this._active = false;\n this._notify(false);\n }\n }\n tick(date) {\n const elapsed = date - this._start;\n const duration = this._duration;\n const prop = this._prop;\n const from = this._from;\n const loop = this._loop;\n const to = this._to;\n let factor;\n this._active = from !== to && (loop || elapsed < duration);\n if (!this._active) {\n this._target[prop] = to;\n this._notify(true);\n return;\n }\n if (elapsed < 0) {\n this._target[prop] = from;\n return;\n }\n factor = elapsed / duration % 2;\n factor = loop && factor > 1 ? 2 - factor : factor;\n factor = this._easing(Math.min(1, Math.max(0, factor)));\n this._target[prop] = this._fn(from, to, factor);\n }\n wait() {\n const promises = this._promises || (this._promises = []);\n return new Promise((res, rej)=>{\n promises.push({\n res,\n rej\n });\n });\n }\n _notify(resolved) {\n const method = resolved ? 'res' : 'rej';\n const promises = this._promises || [];\n for(let i = 0; i < promises.length; i++){\n promises[i][method]();\n }\n }\n}\n\nclass Animations {\n constructor(chart, config){\n this._chart = chart;\n this._properties = new Map();\n this.configure(config);\n }\n configure(config) {\n if (!isObject(config)) {\n return;\n }\n const animationOptions = Object.keys(defaults.animation);\n const animatedProps = this._properties;\n Object.getOwnPropertyNames(config).forEach((key)=>{\n const cfg = config[key];\n if (!isObject(cfg)) {\n return;\n }\n const resolved = {};\n for (const option of animationOptions){\n resolved[option] = cfg[option];\n }\n (isArray(cfg.properties) && cfg.properties || [\n key\n ]).forEach((prop)=>{\n if (prop === key || !animatedProps.has(prop)) {\n animatedProps.set(prop, resolved);\n }\n });\n });\n }\n _animateOptions(target, values) {\n const newOptions = values.options;\n const options = resolveTargetOptions(target, newOptions);\n if (!options) {\n return [];\n }\n const animations = this._createAnimations(options, newOptions);\n if (newOptions.$shared) {\n awaitAll(target.options.$animations, newOptions).then(()=>{\n target.options = newOptions;\n }, ()=>{\n });\n }\n return animations;\n }\n _createAnimations(target, values) {\n const animatedProps = this._properties;\n const animations = [];\n const running = target.$animations || (target.$animations = {});\n const props = Object.keys(values);\n const date = Date.now();\n let i;\n for(i = props.length - 1; i >= 0; --i){\n const prop = props[i];\n if (prop.charAt(0) === '$') {\n continue;\n }\n if (prop === 'options') {\n animations.push(...this._animateOptions(target, values));\n continue;\n }\n const value = values[prop];\n let animation = running[prop];\n const cfg = animatedProps.get(prop);\n if (animation) {\n if (cfg && animation.active()) {\n animation.update(cfg, value, date);\n continue;\n } else {\n animation.cancel();\n }\n }\n if (!cfg || !cfg.duration) {\n target[prop] = value;\n continue;\n }\n running[prop] = animation = new Animation(cfg, target, prop, value);\n animations.push(animation);\n }\n return animations;\n }\n update(target, values) {\n if (this._properties.size === 0) {\n Object.assign(target, values);\n return;\n }\n const animations = this._createAnimations(target, values);\n if (animations.length) {\n animator.add(this._chart, animations);\n return true;\n }\n }\n}\nfunction awaitAll(animations, properties) {\n const running = [];\n const keys = Object.keys(properties);\n for(let i = 0; i < keys.length; i++){\n const anim = animations[keys[i]];\n if (anim && anim.active()) {\n running.push(anim.wait());\n }\n }\n return Promise.all(running);\n}\nfunction resolveTargetOptions(target, newOptions) {\n if (!newOptions) {\n return;\n }\n let options = target.options;\n if (!options) {\n target.options = newOptions;\n return;\n }\n if (options.$shared) {\n target.options = options = Object.assign({}, options, {\n $shared: false,\n $animations: {}\n });\n }\n return options;\n}\n\nfunction scaleClip(scale, allowedOverflow) {\n const opts = scale && scale.options || {};\n const reverse = opts.reverse;\n const min = opts.min === undefined ? allowedOverflow : 0;\n const max = opts.max === undefined ? allowedOverflow : 0;\n return {\n start: reverse ? max : min,\n end: reverse ? min : max\n };\n}\nfunction defaultClip(xScale, yScale, allowedOverflow) {\n if (allowedOverflow === false) {\n return false;\n }\n const x = scaleClip(xScale, allowedOverflow);\n const y = scaleClip(yScale, allowedOverflow);\n return {\n top: y.end,\n right: x.end,\n bottom: y.start,\n left: x.start\n };\n}\nfunction toClip(value) {\n let t, r, b, l;\n if (isObject(value)) {\n t = value.top;\n r = value.right;\n b = value.bottom;\n l = value.left;\n } else {\n t = r = b = l = value;\n }\n return {\n top: t,\n right: r,\n bottom: b,\n left: l,\n disabled: value === false\n };\n}\nfunction getSortedDatasetIndices(chart, filterVisible) {\n const keys = [];\n const metasets = chart._getSortedDatasetMetas(filterVisible);\n let i, ilen;\n for(i = 0, ilen = metasets.length; i < ilen; ++i){\n keys.push(metasets[i].index);\n }\n return keys;\n}\nfunction applyStack(stack, value, dsIndex, options = {}) {\n const keys = stack.keys;\n const singleMode = options.mode === 'single';\n let i, ilen, datasetIndex, otherValue;\n if (value === null) {\n return;\n }\n for(i = 0, ilen = keys.length; i < ilen; ++i){\n datasetIndex = +keys[i];\n if (datasetIndex === dsIndex) {\n if (options.all) {\n continue;\n }\n break;\n }\n otherValue = stack.values[datasetIndex];\n if (isNumberFinite(otherValue) && (singleMode || value === 0 || sign(value) === sign(otherValue))) {\n value += otherValue;\n }\n }\n return value;\n}\nfunction convertObjectDataToArray(data) {\n const keys = Object.keys(data);\n const adata = new Array(keys.length);\n let i, ilen, key;\n for(i = 0, ilen = keys.length; i < ilen; ++i){\n key = keys[i];\n adata[i] = {\n x: key,\n y: data[key]\n };\n }\n return adata;\n}\nfunction isStacked(scale, meta) {\n const stacked = scale && scale.options.stacked;\n return stacked || stacked === undefined && meta.stack !== undefined;\n}\nfunction getStackKey(indexScale, valueScale, meta) {\n return `${indexScale.id}.${valueScale.id}.${meta.stack || meta.type}`;\n}\nfunction getUserBounds(scale) {\n const { min , max , minDefined , maxDefined } = scale.getUserBounds();\n return {\n min: minDefined ? min : Number.NEGATIVE_INFINITY,\n max: maxDefined ? max : Number.POSITIVE_INFINITY\n };\n}\nfunction getOrCreateStack(stacks, stackKey, indexValue) {\n const subStack = stacks[stackKey] || (stacks[stackKey] = {});\n return subStack[indexValue] || (subStack[indexValue] = {});\n}\nfunction getLastIndexInStack(stack, vScale, positive, type) {\n for (const meta of vScale.getMatchingVisibleMetas(type).reverse()){\n const value = stack[meta.index];\n if (positive && value > 0 || !positive && value < 0) {\n return meta.index;\n }\n }\n return null;\n}\nfunction updateStacks(controller, parsed) {\n const { chart , _cachedMeta: meta } = controller;\n const stacks = chart._stacks || (chart._stacks = {});\n const { iScale , vScale , index: datasetIndex } = meta;\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const key = getStackKey(iScale, vScale, meta);\n const ilen = parsed.length;\n let stack;\n for(let i = 0; i < ilen; ++i){\n const item = parsed[i];\n const { [iAxis]: index , [vAxis]: value } = item;\n const itemStacks = item._stacks || (item._stacks = {});\n stack = itemStacks[vAxis] = getOrCreateStack(stacks, key, index);\n stack[datasetIndex] = value;\n stack._top = getLastIndexInStack(stack, vScale, true, meta.type);\n stack._bottom = getLastIndexInStack(stack, vScale, false, meta.type);\n const visualValues = stack._visualValues || (stack._visualValues = {});\n visualValues[datasetIndex] = value;\n }\n}\nfunction getFirstScaleId(chart, axis) {\n const scales = chart.scales;\n return Object.keys(scales).filter((key)=>scales[key].axis === axis).shift();\n}\nfunction createDatasetContext(parent, index) {\n return createContext(parent, {\n active: false,\n dataset: undefined,\n datasetIndex: index,\n index,\n mode: 'default',\n type: 'dataset'\n });\n}\nfunction createDataContext(parent, index, element) {\n return createContext(parent, {\n active: false,\n dataIndex: index,\n parsed: undefined,\n raw: undefined,\n element,\n index,\n mode: 'default',\n type: 'data'\n });\n}\nfunction clearStacks(meta, items) {\n const datasetIndex = meta.controller.index;\n const axis = meta.vScale && meta.vScale.axis;\n if (!axis) {\n return;\n }\n items = items || meta._parsed;\n for (const parsed of items){\n const stacks = parsed._stacks;\n if (!stacks || stacks[axis] === undefined || stacks[axis][datasetIndex] === undefined) {\n return;\n }\n delete stacks[axis][datasetIndex];\n if (stacks[axis]._visualValues !== undefined && stacks[axis]._visualValues[datasetIndex] !== undefined) {\n delete stacks[axis]._visualValues[datasetIndex];\n }\n }\n}\nconst isDirectUpdateMode = (mode)=>mode === 'reset' || mode === 'none';\nconst cloneIfNotShared = (cached, shared)=>shared ? cached : Object.assign({}, cached);\nconst createStack = (canStack, meta, chart)=>canStack && !meta.hidden && meta._stacked && {\n keys: getSortedDatasetIndices(chart, true),\n values: null\n };\nclass DatasetController {\n static defaults = {};\n static datasetElementType = null;\n static dataElementType = null;\n constructor(chart, datasetIndex){\n this.chart = chart;\n this._ctx = chart.ctx;\n this.index = datasetIndex;\n this._cachedDataOpts = {};\n this._cachedMeta = this.getMeta();\n this._type = this._cachedMeta.type;\n this.options = undefined;\n this._parsing = false;\n this._data = undefined;\n this._objectData = undefined;\n this._sharedOptions = undefined;\n this._drawStart = undefined;\n this._drawCount = undefined;\n this.enableOptionSharing = false;\n this.supportsDecimation = false;\n this.$context = undefined;\n this._syncList = [];\n this.datasetElementType = new.target.datasetElementType;\n this.dataElementType = new.target.dataElementType;\n this.initialize();\n }\n initialize() {\n const meta = this._cachedMeta;\n this.configure();\n this.linkScales();\n meta._stacked = isStacked(meta.vScale, meta);\n this.addElements();\n if (this.options.fill && !this.chart.isPluginEnabled('filler')) {\n 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\");\n }\n }\n updateIndex(datasetIndex) {\n if (this.index !== datasetIndex) {\n clearStacks(this._cachedMeta);\n }\n this.index = datasetIndex;\n }\n linkScales() {\n const chart = this.chart;\n const meta = this._cachedMeta;\n const dataset = this.getDataset();\n const chooseId = (axis, x, y, r)=>axis === 'x' ? x : axis === 'r' ? r : y;\n const xid = meta.xAxisID = valueOrDefault(dataset.xAxisID, getFirstScaleId(chart, 'x'));\n const yid = meta.yAxisID = valueOrDefault(dataset.yAxisID, getFirstScaleId(chart, 'y'));\n const rid = meta.rAxisID = valueOrDefault(dataset.rAxisID, getFirstScaleId(chart, 'r'));\n const indexAxis = meta.indexAxis;\n const iid = meta.iAxisID = chooseId(indexAxis, xid, yid, rid);\n const vid = meta.vAxisID = chooseId(indexAxis, yid, xid, rid);\n meta.xScale = this.getScaleForId(xid);\n meta.yScale = this.getScaleForId(yid);\n meta.rScale = this.getScaleForId(rid);\n meta.iScale = this.getScaleForId(iid);\n meta.vScale = this.getScaleForId(vid);\n }\n getDataset() {\n return this.chart.data.datasets[this.index];\n }\n getMeta() {\n return this.chart.getDatasetMeta(this.index);\n }\n getScaleForId(scaleID) {\n return this.chart.scales[scaleID];\n }\n _getOtherScale(scale) {\n const meta = this._cachedMeta;\n return scale === meta.iScale ? meta.vScale : meta.iScale;\n }\n reset() {\n this._update('reset');\n }\n _destroy() {\n const meta = this._cachedMeta;\n if (this._data) {\n unlistenArrayEvents(this._data, this);\n }\n if (meta._stacked) {\n clearStacks(meta);\n }\n }\n _dataCheck() {\n const dataset = this.getDataset();\n const data = dataset.data || (dataset.data = []);\n const _data = this._data;\n if (isObject(data)) {\n this._data = convertObjectDataToArray(data);\n } else if (_data !== data) {\n if (_data) {\n unlistenArrayEvents(_data, this);\n const meta = this._cachedMeta;\n clearStacks(meta);\n meta._parsed = [];\n }\n if (data && Object.isExtensible(data)) {\n listenArrayEvents(data, this);\n }\n this._syncList = [];\n this._data = data;\n }\n }\n addElements() {\n const meta = this._cachedMeta;\n this._dataCheck();\n if (this.datasetElementType) {\n meta.dataset = new this.datasetElementType();\n }\n }\n buildOrUpdateElements(resetNewElements) {\n const meta = this._cachedMeta;\n const dataset = this.getDataset();\n let stackChanged = false;\n this._dataCheck();\n const oldStacked = meta._stacked;\n meta._stacked = isStacked(meta.vScale, meta);\n if (meta.stack !== dataset.stack) {\n stackChanged = true;\n clearStacks(meta);\n meta.stack = dataset.stack;\n }\n this._resyncElements(resetNewElements);\n if (stackChanged || oldStacked !== meta._stacked) {\n updateStacks(this, meta._parsed);\n }\n }\n configure() {\n const config = this.chart.config;\n const scopeKeys = config.datasetScopeKeys(this._type);\n const scopes = config.getOptionScopes(this.getDataset(), scopeKeys, true);\n this.options = config.createResolver(scopes, this.getContext());\n this._parsing = this.options.parsing;\n this._cachedDataOpts = {};\n }\n parse(start, count) {\n const { _cachedMeta: meta , _data: data } = this;\n const { iScale , _stacked } = meta;\n const iAxis = iScale.axis;\n let sorted = start === 0 && count === data.length ? true : meta._sorted;\n let prev = start > 0 && meta._parsed[start - 1];\n let i, cur, parsed;\n if (this._parsing === false) {\n meta._parsed = data;\n meta._sorted = true;\n parsed = data;\n } else {\n if (isArray(data[start])) {\n parsed = this.parseArrayData(meta, data, start, count);\n } else if (isObject(data[start])) {\n parsed = this.parseObjectData(meta, data, start, count);\n } else {\n parsed = this.parsePrimitiveData(meta, data, start, count);\n }\n const isNotInOrderComparedToPrev = ()=>cur[iAxis] === null || prev && cur[iAxis] < prev[iAxis];\n for(i = 0; i < count; ++i){\n meta._parsed[i + start] = cur = parsed[i];\n if (sorted) {\n if (isNotInOrderComparedToPrev()) {\n sorted = false;\n }\n prev = cur;\n }\n }\n meta._sorted = sorted;\n }\n if (_stacked) {\n updateStacks(this, parsed);\n }\n }\n parsePrimitiveData(meta, data, start, count) {\n const { iScale , vScale } = meta;\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const labels = iScale.getLabels();\n const singleScale = iScale === vScale;\n const parsed = new Array(count);\n let i, ilen, index;\n for(i = 0, ilen = count; i < ilen; ++i){\n index = i + start;\n parsed[i] = {\n [iAxis]: singleScale || iScale.parse(labels[index], index),\n [vAxis]: vScale.parse(data[index], index)\n };\n }\n return parsed;\n }\n parseArrayData(meta, data, start, count) {\n const { xScale , yScale } = meta;\n const parsed = new Array(count);\n let i, ilen, index, item;\n for(i = 0, ilen = count; i < ilen; ++i){\n index = i + start;\n item = data[index];\n parsed[i] = {\n x: xScale.parse(item[0], index),\n y: yScale.parse(item[1], index)\n };\n }\n return parsed;\n }\n parseObjectData(meta, data, start, count) {\n const { xScale , yScale } = meta;\n const { xAxisKey ='x' , yAxisKey ='y' } = this._parsing;\n const parsed = new Array(count);\n let i, ilen, index, item;\n for(i = 0, ilen = count; i < ilen; ++i){\n index = i + start;\n item = data[index];\n parsed[i] = {\n x: xScale.parse(resolveObjectKey(item, xAxisKey), index),\n y: yScale.parse(resolveObjectKey(item, yAxisKey), index)\n };\n }\n return parsed;\n }\n getParsed(index) {\n return this._cachedMeta._parsed[index];\n }\n getDataElement(index) {\n return this._cachedMeta.data[index];\n }\n applyStack(scale, parsed, mode) {\n const chart = this.chart;\n const meta = this._cachedMeta;\n const value = parsed[scale.axis];\n const stack = {\n keys: getSortedDatasetIndices(chart, true),\n values: parsed._stacks[scale.axis]._visualValues\n };\n return applyStack(stack, value, meta.index, {\n mode\n });\n }\n updateRangeFromParsed(range, scale, parsed, stack) {\n const parsedValue = parsed[scale.axis];\n let value = parsedValue === null ? NaN : parsedValue;\n const values = stack && parsed._stacks[scale.axis];\n if (stack && values) {\n stack.values = values;\n value = applyStack(stack, parsedValue, this._cachedMeta.index);\n }\n range.min = Math.min(range.min, value);\n range.max = Math.max(range.max, value);\n }\n getMinMax(scale, canStack) {\n const meta = this._cachedMeta;\n const _parsed = meta._parsed;\n const sorted = meta._sorted && scale === meta.iScale;\n const ilen = _parsed.length;\n const otherScale = this._getOtherScale(scale);\n const stack = createStack(canStack, meta, this.chart);\n const range = {\n min: Number.POSITIVE_INFINITY,\n max: Number.NEGATIVE_INFINITY\n };\n const { min: otherMin , max: otherMax } = getUserBounds(otherScale);\n let i, parsed;\n function _skip() {\n parsed = _parsed[i];\n const otherValue = parsed[otherScale.axis];\n return !isNumberFinite(parsed[scale.axis]) || otherMin > otherValue || otherMax < otherValue;\n }\n for(i = 0; i < ilen; ++i){\n if (_skip()) {\n continue;\n }\n this.updateRangeFromParsed(range, scale, parsed, stack);\n if (sorted) {\n break;\n }\n }\n if (sorted) {\n for(i = ilen - 1; i >= 0; --i){\n if (_skip()) {\n continue;\n }\n this.updateRangeFromParsed(range, scale, parsed, stack);\n break;\n }\n }\n return range;\n }\n getAllParsedValues(scale) {\n const parsed = this._cachedMeta._parsed;\n const values = [];\n let i, ilen, value;\n for(i = 0, ilen = parsed.length; i < ilen; ++i){\n value = parsed[i][scale.axis];\n if (isNumberFinite(value)) {\n values.push(value);\n }\n }\n return values;\n }\n getMaxOverflow() {\n return false;\n }\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const iScale = meta.iScale;\n const vScale = meta.vScale;\n const parsed = this.getParsed(index);\n return {\n label: iScale ? '' + iScale.getLabelForValue(parsed[iScale.axis]) : '',\n value: vScale ? '' + vScale.getLabelForValue(parsed[vScale.axis]) : ''\n };\n }\n _update(mode) {\n const meta = this._cachedMeta;\n this.update(mode || 'default');\n meta._clip = toClip(valueOrDefault(this.options.clip, defaultClip(meta.xScale, meta.yScale, this.getMaxOverflow())));\n }\n update(mode) {}\n draw() {\n const ctx = this._ctx;\n const chart = this.chart;\n const meta = this._cachedMeta;\n const elements = meta.data || [];\n const area = chart.chartArea;\n const active = [];\n const start = this._drawStart || 0;\n const count = this._drawCount || elements.length - start;\n const drawActiveElementsOnTop = this.options.drawActiveElementsOnTop;\n let i;\n if (meta.dataset) {\n meta.dataset.draw(ctx, area, start, count);\n }\n for(i = start; i < start + count; ++i){\n const element = elements[i];\n if (element.hidden) {\n continue;\n }\n if (element.active && drawActiveElementsOnTop) {\n active.push(element);\n } else {\n element.draw(ctx, area);\n }\n }\n for(i = 0; i < active.length; ++i){\n active[i].draw(ctx, area);\n }\n }\n getStyle(index, active) {\n const mode = active ? 'active' : 'default';\n return index === undefined && this._cachedMeta.dataset ? this.resolveDatasetElementOptions(mode) : this.resolveDataElementOptions(index || 0, mode);\n }\n getContext(index, active, mode) {\n const dataset = this.getDataset();\n let context;\n if (index >= 0 && index < this._cachedMeta.data.length) {\n const element = this._cachedMeta.data[index];\n context = element.$context || (element.$context = createDataContext(this.getContext(), index, element));\n context.parsed = this.getParsed(index);\n context.raw = dataset.data[index];\n context.index = context.dataIndex = index;\n } else {\n context = this.$context || (this.$context = createDatasetContext(this.chart.getContext(), this.index));\n context.dataset = dataset;\n context.index = context.datasetIndex = this.index;\n }\n context.active = !!active;\n context.mode = mode;\n return context;\n }\n resolveDatasetElementOptions(mode) {\n return this._resolveElementOptions(this.datasetElementType.id, mode);\n }\n resolveDataElementOptions(index, mode) {\n return this._resolveElementOptions(this.dataElementType.id, mode, index);\n }\n _resolveElementOptions(elementType, mode = 'default', index) {\n const active = mode === 'active';\n const cache = this._cachedDataOpts;\n const cacheKey = elementType + '-' + mode;\n const cached = cache[cacheKey];\n const sharing = this.enableOptionSharing && defined(index);\n if (cached) {\n return cloneIfNotShared(cached, sharing);\n }\n const config = this.chart.config;\n const scopeKeys = config.datasetElementScopeKeys(this._type, elementType);\n const prefixes = active ? [\n `${elementType}Hover`,\n 'hover',\n elementType,\n ''\n ] : [\n elementType,\n ''\n ];\n const scopes = config.getOptionScopes(this.getDataset(), scopeKeys);\n const names = Object.keys(defaults.elements[elementType]);\n const context = ()=>this.getContext(index, active, mode);\n const values = config.resolveNamedOptions(scopes, names, context, prefixes);\n if (values.$shared) {\n values.$shared = sharing;\n cache[cacheKey] = Object.freeze(cloneIfNotShared(values, sharing));\n }\n return values;\n }\n _resolveAnimations(index, transition, active) {\n const chart = this.chart;\n const cache = this._cachedDataOpts;\n const cacheKey = `animation-${transition}`;\n const cached = cache[cacheKey];\n if (cached) {\n return cached;\n }\n let options;\n if (chart.options.animation !== false) {\n const config = this.chart.config;\n const scopeKeys = config.datasetAnimationScopeKeys(this._type, transition);\n const scopes = config.getOptionScopes(this.getDataset(), scopeKeys);\n options = config.createResolver(scopes, this.getContext(index, active, transition));\n }\n const animations = new Animations(chart, options && options.animations);\n if (options && options._cacheable) {\n cache[cacheKey] = Object.freeze(animations);\n }\n return animations;\n }\n getSharedOptions(options) {\n if (!options.$shared) {\n return;\n }\n return this._sharedOptions || (this._sharedOptions = Object.assign({}, options));\n }\n includeOptions(mode, sharedOptions) {\n return !sharedOptions || isDirectUpdateMode(mode) || this.chart._animationsDisabled;\n }\n _getSharedOptions(start, mode) {\n const firstOpts = this.resolveDataElementOptions(start, mode);\n const previouslySharedOptions = this._sharedOptions;\n const sharedOptions = this.getSharedOptions(firstOpts);\n const includeOptions = this.includeOptions(mode, sharedOptions) || sharedOptions !== previouslySharedOptions;\n this.updateSharedOptions(sharedOptions, mode, firstOpts);\n return {\n sharedOptions,\n includeOptions\n };\n }\n updateElement(element, index, properties, mode) {\n if (isDirectUpdateMode(mode)) {\n Object.assign(element, properties);\n } else {\n this._resolveAnimations(index, mode).update(element, properties);\n }\n }\n updateSharedOptions(sharedOptions, mode, newOptions) {\n if (sharedOptions && !isDirectUpdateMode(mode)) {\n this._resolveAnimations(undefined, mode).update(sharedOptions, newOptions);\n }\n }\n _setStyle(element, index, mode, active) {\n element.active = active;\n const options = this.getStyle(index, active);\n this._resolveAnimations(index, mode, active).update(element, {\n options: !active && this.getSharedOptions(options) || options\n });\n }\n removeHoverStyle(element, datasetIndex, index) {\n this._setStyle(element, index, 'active', false);\n }\n setHoverStyle(element, datasetIndex, index) {\n this._setStyle(element, index, 'active', true);\n }\n _removeDatasetHoverStyle() {\n const element = this._cachedMeta.dataset;\n if (element) {\n this._setStyle(element, undefined, 'active', false);\n }\n }\n _setDatasetHoverStyle() {\n const element = this._cachedMeta.dataset;\n if (element) {\n this._setStyle(element, undefined, 'active', true);\n }\n }\n _resyncElements(resetNewElements) {\n const data = this._data;\n const elements = this._cachedMeta.data;\n for (const [method, arg1, arg2] of this._syncList){\n this[method](arg1, arg2);\n }\n this._syncList = [];\n const numMeta = elements.length;\n const numData = data.length;\n const count = Math.min(numData, numMeta);\n if (count) {\n this.parse(0, count);\n }\n if (numData > numMeta) {\n this._insertElements(numMeta, numData - numMeta, resetNewElements);\n } else if (numData < numMeta) {\n this._removeElements(numData, numMeta - numData);\n }\n }\n _insertElements(start, count, resetNewElements = true) {\n const meta = this._cachedMeta;\n const data = meta.data;\n const end = start + count;\n let i;\n const move = (arr)=>{\n arr.length += count;\n for(i = arr.length - 1; i >= end; i--){\n arr[i] = arr[i - count];\n }\n };\n move(data);\n for(i = start; i < end; ++i){\n data[i] = new this.dataElementType();\n }\n if (this._parsing) {\n move(meta._parsed);\n }\n this.parse(start, count);\n if (resetNewElements) {\n this.updateElements(data, start, count, 'reset');\n }\n }\n updateElements(element, start, count, mode) {}\n _removeElements(start, count) {\n const meta = this._cachedMeta;\n if (this._parsing) {\n const removed = meta._parsed.splice(start, count);\n if (meta._stacked) {\n clearStacks(meta, removed);\n }\n }\n meta.data.splice(start, count);\n }\n _sync(args) {\n if (this._parsing) {\n this._syncList.push(args);\n } else {\n const [method, arg1, arg2] = args;\n this[method](arg1, arg2);\n }\n this.chart._dataChanges.push([\n this.index,\n ...args\n ]);\n }\n _onDataPush() {\n const count = arguments.length;\n this._sync([\n '_insertElements',\n this.getDataset().data.length - count,\n count\n ]);\n }\n _onDataPop() {\n this._sync([\n '_removeElements',\n this._cachedMeta.data.length - 1,\n 1\n ]);\n }\n _onDataShift() {\n this._sync([\n '_removeElements',\n 0,\n 1\n ]);\n }\n _onDataSplice(start, count) {\n if (count) {\n this._sync([\n '_removeElements',\n start,\n count\n ]);\n }\n const newCount = arguments.length - 2;\n if (newCount) {\n this._sync([\n '_insertElements',\n start,\n newCount\n ]);\n }\n }\n _onDataUnshift() {\n this._sync([\n '_insertElements',\n 0,\n arguments.length\n ]);\n }\n}\n\nfunction getAllScaleValues(scale, type) {\n if (!scale._cache.$bar) {\n const visibleMetas = scale.getMatchingVisibleMetas(type);\n let values = [];\n for(let i = 0, ilen = visibleMetas.length; i < ilen; i++){\n values = values.concat(visibleMetas[i].controller.getAllParsedValues(scale));\n }\n scale._cache.$bar = _arrayUnique(values.sort((a, b)=>a - b));\n }\n return scale._cache.$bar;\n}\n function computeMinSampleSize(meta) {\n const scale = meta.iScale;\n const values = getAllScaleValues(scale, meta.type);\n let min = scale._length;\n let i, ilen, curr, prev;\n const updateMinAndPrev = ()=>{\n if (curr === 32767 || curr === -32768) {\n return;\n }\n if (defined(prev)) {\n min = Math.min(min, Math.abs(curr - prev) || min);\n }\n prev = curr;\n };\n for(i = 0, ilen = values.length; i < ilen; ++i){\n curr = scale.getPixelForValue(values[i]);\n updateMinAndPrev();\n }\n prev = undefined;\n for(i = 0, ilen = scale.ticks.length; i < ilen; ++i){\n curr = scale.getPixelForTick(i);\n updateMinAndPrev();\n }\n return min;\n}\n function computeFitCategoryTraits(index, ruler, options, stackCount) {\n const thickness = options.barThickness;\n let size, ratio;\n if (isNullOrUndef(thickness)) {\n size = ruler.min * options.categoryPercentage;\n ratio = options.barPercentage;\n } else {\n size = thickness * stackCount;\n ratio = 1;\n }\n return {\n chunk: size / stackCount,\n ratio,\n start: ruler.pixels[index] - size / 2\n };\n}\n function computeFlexCategoryTraits(index, ruler, options, stackCount) {\n const pixels = ruler.pixels;\n const curr = pixels[index];\n let prev = index > 0 ? pixels[index - 1] : null;\n let next = index < pixels.length - 1 ? pixels[index + 1] : null;\n const percent = options.categoryPercentage;\n if (prev === null) {\n prev = curr - (next === null ? ruler.end - ruler.start : next - curr);\n }\n if (next === null) {\n next = curr + curr - prev;\n }\n const start = curr - (curr - Math.min(prev, next)) / 2 * percent;\n const size = Math.abs(next - prev) / 2 * percent;\n return {\n chunk: size / stackCount,\n ratio: options.barPercentage,\n start\n };\n}\nfunction parseFloatBar(entry, item, vScale, i) {\n const startValue = vScale.parse(entry[0], i);\n const endValue = vScale.parse(entry[1], i);\n const min = Math.min(startValue, endValue);\n const max = Math.max(startValue, endValue);\n let barStart = min;\n let barEnd = max;\n if (Math.abs(min) > Math.abs(max)) {\n barStart = max;\n barEnd = min;\n }\n item[vScale.axis] = barEnd;\n item._custom = {\n barStart,\n barEnd,\n start: startValue,\n end: endValue,\n min,\n max\n };\n}\nfunction parseValue(entry, item, vScale, i) {\n if (isArray(entry)) {\n parseFloatBar(entry, item, vScale, i);\n } else {\n item[vScale.axis] = vScale.parse(entry, i);\n }\n return item;\n}\nfunction parseArrayOrPrimitive(meta, data, start, count) {\n const iScale = meta.iScale;\n const vScale = meta.vScale;\n const labels = iScale.getLabels();\n const singleScale = iScale === vScale;\n const parsed = [];\n let i, ilen, item, entry;\n for(i = start, ilen = start + count; i < ilen; ++i){\n entry = data[i];\n item = {};\n item[iScale.axis] = singleScale || iScale.parse(labels[i], i);\n parsed.push(parseValue(entry, item, vScale, i));\n }\n return parsed;\n}\nfunction isFloatBar(custom) {\n return custom && custom.barStart !== undefined && custom.barEnd !== undefined;\n}\nfunction barSign(size, vScale, actualBase) {\n if (size !== 0) {\n return sign(size);\n }\n return (vScale.isHorizontal() ? 1 : -1) * (vScale.min >= actualBase ? 1 : -1);\n}\nfunction borderProps(properties) {\n let reverse, start, end, top, bottom;\n if (properties.horizontal) {\n reverse = properties.base > properties.x;\n start = 'left';\n end = 'right';\n } else {\n reverse = properties.base < properties.y;\n start = 'bottom';\n end = 'top';\n }\n if (reverse) {\n top = 'end';\n bottom = 'start';\n } else {\n top = 'start';\n bottom = 'end';\n }\n return {\n start,\n end,\n reverse,\n top,\n bottom\n };\n}\nfunction setBorderSkipped(properties, options, stack, index) {\n let edge = options.borderSkipped;\n const res = {};\n if (!edge) {\n properties.borderSkipped = res;\n return;\n }\n if (edge === true) {\n properties.borderSkipped = {\n top: true,\n right: true,\n bottom: true,\n left: true\n };\n return;\n }\n const { start , end , reverse , top , bottom } = borderProps(properties);\n if (edge === 'middle' && stack) {\n properties.enableBorderRadius = true;\n if ((stack._top || 0) === index) {\n edge = top;\n } else if ((stack._bottom || 0) === index) {\n edge = bottom;\n } else {\n res[parseEdge(bottom, start, end, reverse)] = true;\n edge = top;\n }\n }\n res[parseEdge(edge, start, end, reverse)] = true;\n properties.borderSkipped = res;\n}\nfunction parseEdge(edge, a, b, reverse) {\n if (reverse) {\n edge = swap(edge, a, b);\n edge = startEnd(edge, b, a);\n } else {\n edge = startEnd(edge, a, b);\n }\n return edge;\n}\nfunction swap(orig, v1, v2) {\n return orig === v1 ? v2 : orig === v2 ? v1 : orig;\n}\nfunction startEnd(v, start, end) {\n return v === 'start' ? start : v === 'end' ? end : v;\n}\nfunction setInflateAmount(properties, { inflateAmount }, ratio) {\n properties.inflateAmount = inflateAmount === 'auto' ? ratio === 1 ? 0.33 : 0 : inflateAmount;\n}\nclass BarController extends DatasetController {\n static id = 'bar';\n static defaults = {\n datasetElementType: false,\n dataElementType: 'bar',\n categoryPercentage: 0.8,\n barPercentage: 0.9,\n grouped: true,\n animations: {\n numbers: {\n type: 'number',\n properties: [\n 'x',\n 'y',\n 'base',\n 'width',\n 'height'\n ]\n }\n }\n };\n static overrides = {\n scales: {\n _index_: {\n type: 'category',\n offset: true,\n grid: {\n offset: true\n }\n },\n _value_: {\n type: 'linear',\n beginAtZero: true\n }\n }\n };\n parsePrimitiveData(meta, data, start, count) {\n return parseArrayOrPrimitive(meta, data, start, count);\n }\n parseArrayData(meta, data, start, count) {\n return parseArrayOrPrimitive(meta, data, start, count);\n }\n parseObjectData(meta, data, start, count) {\n const { iScale , vScale } = meta;\n const { xAxisKey ='x' , yAxisKey ='y' } = this._parsing;\n const iAxisKey = iScale.axis === 'x' ? xAxisKey : yAxisKey;\n const vAxisKey = vScale.axis === 'x' ? xAxisKey : yAxisKey;\n const parsed = [];\n let i, ilen, item, obj;\n for(i = start, ilen = start + count; i < ilen; ++i){\n obj = data[i];\n item = {};\n item[iScale.axis] = iScale.parse(resolveObjectKey(obj, iAxisKey), i);\n parsed.push(parseValue(resolveObjectKey(obj, vAxisKey), item, vScale, i));\n }\n return parsed;\n }\n updateRangeFromParsed(range, scale, parsed, stack) {\n super.updateRangeFromParsed(range, scale, parsed, stack);\n const custom = parsed._custom;\n if (custom && scale === this._cachedMeta.vScale) {\n range.min = Math.min(range.min, custom.min);\n range.max = Math.max(range.max, custom.max);\n }\n }\n getMaxOverflow() {\n return 0;\n }\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const { iScale , vScale } = meta;\n const parsed = this.getParsed(index);\n const custom = parsed._custom;\n const value = isFloatBar(custom) ? '[' + custom.start + ', ' + custom.end + ']' : '' + vScale.getLabelForValue(parsed[vScale.axis]);\n return {\n label: '' + iScale.getLabelForValue(parsed[iScale.axis]),\n value\n };\n }\n initialize() {\n this.enableOptionSharing = true;\n super.initialize();\n const meta = this._cachedMeta;\n meta.stack = this.getDataset().stack;\n }\n update(mode) {\n const meta = this._cachedMeta;\n this.updateElements(meta.data, 0, meta.data.length, mode);\n }\n updateElements(bars, start, count, mode) {\n const reset = mode === 'reset';\n const { index , _cachedMeta: { vScale } } = this;\n const base = vScale.getBasePixel();\n const horizontal = vScale.isHorizontal();\n const ruler = this._getRuler();\n const { sharedOptions , includeOptions } = this._getSharedOptions(start, mode);\n for(let i = start; i < start + count; i++){\n const parsed = this.getParsed(i);\n const vpixels = reset || isNullOrUndef(parsed[vScale.axis]) ? {\n base,\n head: base\n } : this._calculateBarValuePixels(i);\n const ipixels = this._calculateBarIndexPixels(i, ruler);\n const stack = (parsed._stacks || {})[vScale.axis];\n const properties = {\n horizontal,\n base: vpixels.base,\n enableBorderRadius: !stack || isFloatBar(parsed._custom) || index === stack._top || index === stack._bottom,\n x: horizontal ? vpixels.head : ipixels.center,\n y: horizontal ? ipixels.center : vpixels.head,\n height: horizontal ? ipixels.size : Math.abs(vpixels.size),\n width: horizontal ? Math.abs(vpixels.size) : ipixels.size\n };\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, bars[i].active ? 'active' : mode);\n }\n const options = properties.options || bars[i].options;\n setBorderSkipped(properties, options, stack, index);\n setInflateAmount(properties, options, ruler.ratio);\n this.updateElement(bars[i], i, properties, mode);\n }\n }\n _getStacks(last, dataIndex) {\n const { iScale } = this._cachedMeta;\n const metasets = iScale.getMatchingVisibleMetas(this._type).filter((meta)=>meta.controller.options.grouped);\n const stacked = iScale.options.stacked;\n const stacks = [];\n const skipNull = (meta)=>{\n const parsed = meta.controller.getParsed(dataIndex);\n const val = parsed && parsed[meta.vScale.axis];\n if (isNullOrUndef(val) || isNaN(val)) {\n return true;\n }\n };\n for (const meta of metasets){\n if (dataIndex !== undefined && skipNull(meta)) {\n continue;\n }\n if (stacked === false || stacks.indexOf(meta.stack) === -1 || stacked === undefined && meta.stack === undefined) {\n stacks.push(meta.stack);\n }\n if (meta.index === last) {\n break;\n }\n }\n if (!stacks.length) {\n stacks.push(undefined);\n }\n return stacks;\n }\n _getStackCount(index) {\n return this._getStacks(undefined, index).length;\n }\n _getStackIndex(datasetIndex, name, dataIndex) {\n const stacks = this._getStacks(datasetIndex, dataIndex);\n const index = name !== undefined ? stacks.indexOf(name) : -1;\n return index === -1 ? stacks.length - 1 : index;\n }\n _getRuler() {\n const opts = this.options;\n const meta = this._cachedMeta;\n const iScale = meta.iScale;\n const pixels = [];\n let i, ilen;\n for(i = 0, ilen = meta.data.length; i < ilen; ++i){\n pixels.push(iScale.getPixelForValue(this.getParsed(i)[iScale.axis], i));\n }\n const barThickness = opts.barThickness;\n const min = barThickness || computeMinSampleSize(meta);\n return {\n min,\n pixels,\n start: iScale._startPixel,\n end: iScale._endPixel,\n stackCount: this._getStackCount(),\n scale: iScale,\n grouped: opts.grouped,\n ratio: barThickness ? 1 : opts.categoryPercentage * opts.barPercentage\n };\n }\n _calculateBarValuePixels(index) {\n const { _cachedMeta: { vScale , _stacked , index: datasetIndex } , options: { base: baseValue , minBarLength } } = this;\n const actualBase = baseValue || 0;\n const parsed = this.getParsed(index);\n const custom = parsed._custom;\n const floating = isFloatBar(custom);\n let value = parsed[vScale.axis];\n let start = 0;\n let length = _stacked ? this.applyStack(vScale, parsed, _stacked) : value;\n let head, size;\n if (length !== value) {\n start = length - value;\n length = value;\n }\n if (floating) {\n value = custom.barStart;\n length = custom.barEnd - custom.barStart;\n if (value !== 0 && sign(value) !== sign(custom.barEnd)) {\n start = 0;\n }\n start += value;\n }\n const startValue = !isNullOrUndef(baseValue) && !floating ? baseValue : start;\n let base = vScale.getPixelForValue(startValue);\n if (this.chart.getDataVisibility(index)) {\n head = vScale.getPixelForValue(start + length);\n } else {\n head = base;\n }\n size = head - base;\n if (Math.abs(size) < minBarLength) {\n size = barSign(size, vScale, actualBase) * minBarLength;\n if (value === actualBase) {\n base -= size / 2;\n }\n const startPixel = vScale.getPixelForDecimal(0);\n const endPixel = vScale.getPixelForDecimal(1);\n const min = Math.min(startPixel, endPixel);\n const max = Math.max(startPixel, endPixel);\n base = Math.max(Math.min(base, max), min);\n head = base + size;\n if (_stacked && !floating) {\n parsed._stacks[vScale.axis]._visualValues[datasetIndex] = vScale.getValueForPixel(head) - vScale.getValueForPixel(base);\n }\n }\n if (base === vScale.getPixelForValue(actualBase)) {\n const halfGrid = sign(size) * vScale.getLineWidthForValue(actualBase) / 2;\n base += halfGrid;\n size -= halfGrid;\n }\n return {\n size,\n base,\n head,\n center: head + size / 2\n };\n }\n _calculateBarIndexPixels(index, ruler) {\n const scale = ruler.scale;\n const options = this.options;\n const skipNull = options.skipNull;\n const maxBarThickness = valueOrDefault(options.maxBarThickness, Infinity);\n let center, size;\n if (ruler.grouped) {\n const stackCount = skipNull ? this._getStackCount(index) : ruler.stackCount;\n const range = options.barThickness === 'flex' ? computeFlexCategoryTraits(index, ruler, options, stackCount) : computeFitCategoryTraits(index, ruler, options, stackCount);\n const stackIndex = this._getStackIndex(this.index, this._cachedMeta.stack, skipNull ? index : undefined);\n center = range.start + range.chunk * stackIndex + range.chunk / 2;\n size = Math.min(maxBarThickness, range.chunk * range.ratio);\n } else {\n center = scale.getPixelForValue(this.getParsed(index)[scale.axis], index);\n size = Math.min(maxBarThickness, ruler.min * ruler.ratio);\n }\n return {\n base: center - size / 2,\n head: center + size / 2,\n center,\n size\n };\n }\n draw() {\n const meta = this._cachedMeta;\n const vScale = meta.vScale;\n const rects = meta.data;\n const ilen = rects.length;\n let i = 0;\n for(; i < ilen; ++i){\n if (this.getParsed(i)[vScale.axis] !== null) {\n rects[i].draw(this._ctx);\n }\n }\n }\n}\n\nclass BubbleController extends DatasetController {\n static id = 'bubble';\n static defaults = {\n datasetElementType: false,\n dataElementType: 'point',\n animations: {\n numbers: {\n type: 'number',\n properties: [\n 'x',\n 'y',\n 'borderWidth',\n 'radius'\n ]\n }\n }\n };\n static overrides = {\n scales: {\n x: {\n type: 'linear'\n },\n y: {\n type: 'linear'\n }\n }\n };\n initialize() {\n this.enableOptionSharing = true;\n super.initialize();\n }\n parsePrimitiveData(meta, data, start, count) {\n const parsed = super.parsePrimitiveData(meta, data, start, count);\n for(let i = 0; i < parsed.length; i++){\n parsed[i]._custom = this.resolveDataElementOptions(i + start).radius;\n }\n return parsed;\n }\n parseArrayData(meta, data, start, count) {\n const parsed = super.parseArrayData(meta, data, start, count);\n for(let i = 0; i < parsed.length; i++){\n const item = data[start + i];\n parsed[i]._custom = valueOrDefault(item[2], this.resolveDataElementOptions(i + start).radius);\n }\n return parsed;\n }\n parseObjectData(meta, data, start, count) {\n const parsed = super.parseObjectData(meta, data, start, count);\n for(let i = 0; i < parsed.length; i++){\n const item = data[start + i];\n parsed[i]._custom = valueOrDefault(item && item.r && +item.r, this.resolveDataElementOptions(i + start).radius);\n }\n return parsed;\n }\n getMaxOverflow() {\n const data = this._cachedMeta.data;\n let max = 0;\n for(let i = data.length - 1; i >= 0; --i){\n max = Math.max(max, data[i].size(this.resolveDataElementOptions(i)) / 2);\n }\n return max > 0 && max;\n }\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const labels = this.chart.data.labels || [];\n const { xScale , yScale } = meta;\n const parsed = this.getParsed(index);\n const x = xScale.getLabelForValue(parsed.x);\n const y = yScale.getLabelForValue(parsed.y);\n const r = parsed._custom;\n return {\n label: labels[index] || '',\n value: '(' + x + ', ' + y + (r ? ', ' + r : '') + ')'\n };\n }\n update(mode) {\n const points = this._cachedMeta.data;\n this.updateElements(points, 0, points.length, mode);\n }\n updateElements(points, start, count, mode) {\n const reset = mode === 'reset';\n const { iScale , vScale } = this._cachedMeta;\n const { sharedOptions , includeOptions } = this._getSharedOptions(start, mode);\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n for(let i = start; i < start + count; i++){\n const point = points[i];\n const parsed = !reset && this.getParsed(i);\n const properties = {};\n const iPixel = properties[iAxis] = reset ? iScale.getPixelForDecimal(0.5) : iScale.getPixelForValue(parsed[iAxis]);\n const vPixel = properties[vAxis] = reset ? vScale.getBasePixel() : vScale.getPixelForValue(parsed[vAxis]);\n properties.skip = isNaN(iPixel) || isNaN(vPixel);\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? 'active' : mode);\n if (reset) {\n properties.options.radius = 0;\n }\n }\n this.updateElement(point, i, properties, mode);\n }\n }\n resolveDataElementOptions(index, mode) {\n const parsed = this.getParsed(index);\n let values = super.resolveDataElementOptions(index, mode);\n if (values.$shared) {\n values = Object.assign({}, values, {\n $shared: false\n });\n }\n const radius = values.radius;\n if (mode !== 'active') {\n values.radius = 0;\n }\n values.radius += valueOrDefault(parsed && parsed._custom, radius);\n return values;\n }\n}\n\nfunction getRatioAndOffset(rotation, circumference, cutout) {\n let ratioX = 1;\n let ratioY = 1;\n let offsetX = 0;\n let offsetY = 0;\n if (circumference < TAU) {\n const startAngle = rotation;\n const endAngle = startAngle + circumference;\n const startX = Math.cos(startAngle);\n const startY = Math.sin(startAngle);\n const endX = Math.cos(endAngle);\n const endY = Math.sin(endAngle);\n const calcMax = (angle, a, b)=>_angleBetween(angle, startAngle, endAngle, true) ? 1 : Math.max(a, a * cutout, b, b * cutout);\n const calcMin = (angle, a, b)=>_angleBetween(angle, startAngle, endAngle, true) ? -1 : Math.min(a, a * cutout, b, b * cutout);\n const maxX = calcMax(0, startX, endX);\n const maxY = calcMax(HALF_PI, startY, endY);\n const minX = calcMin(PI, startX, endX);\n const minY = calcMin(PI + HALF_PI, startY, endY);\n ratioX = (maxX - minX) / 2;\n ratioY = (maxY - minY) / 2;\n offsetX = -(maxX + minX) / 2;\n offsetY = -(maxY + minY) / 2;\n }\n return {\n ratioX,\n ratioY,\n offsetX,\n offsetY\n };\n}\nclass DoughnutController extends DatasetController {\n static id = 'doughnut';\n static defaults = {\n datasetElementType: false,\n dataElementType: 'arc',\n animation: {\n animateRotate: true,\n animateScale: false\n },\n animations: {\n numbers: {\n type: 'number',\n properties: [\n 'circumference',\n 'endAngle',\n 'innerRadius',\n 'outerRadius',\n 'startAngle',\n 'x',\n 'y',\n 'offset',\n 'borderWidth',\n 'spacing'\n ]\n }\n },\n cutout: '50%',\n rotation: 0,\n circumference: 360,\n radius: '100%',\n spacing: 0,\n indexAxis: 'r'\n };\n static descriptors = {\n _scriptable: (name)=>name !== 'spacing',\n _indexable: (name)=>name !== 'spacing' && !name.startsWith('borderDash') && !name.startsWith('hoverBorderDash')\n };\n static overrides = {\n aspectRatio: 1,\n plugins: {\n legend: {\n labels: {\n generateLabels (chart) {\n const data = chart.data;\n if (data.labels.length && data.datasets.length) {\n const { labels: { pointStyle , color } } = chart.legend.options;\n return data.labels.map((label, i)=>{\n const meta = chart.getDatasetMeta(0);\n const style = meta.controller.getStyle(i);\n return {\n text: label,\n fillStyle: style.backgroundColor,\n strokeStyle: style.borderColor,\n fontColor: color,\n lineWidth: style.borderWidth,\n pointStyle: pointStyle,\n hidden: !chart.getDataVisibility(i),\n index: i\n };\n });\n }\n return [];\n }\n },\n onClick (e, legendItem, legend) {\n legend.chart.toggleDataVisibility(legendItem.index);\n legend.chart.update();\n }\n }\n }\n };\n constructor(chart, datasetIndex){\n super(chart, datasetIndex);\n this.enableOptionSharing = true;\n this.innerRadius = undefined;\n this.outerRadius = undefined;\n this.offsetX = undefined;\n this.offsetY = undefined;\n }\n linkScales() {}\n parse(start, count) {\n const data = this.getDataset().data;\n const meta = this._cachedMeta;\n if (this._parsing === false) {\n meta._parsed = data;\n } else {\n let getter = (i)=>+data[i];\n if (isObject(data[start])) {\n const { key ='value' } = this._parsing;\n getter = (i)=>+resolveObjectKey(data[i], key);\n }\n let i, ilen;\n for(i = start, ilen = start + count; i < ilen; ++i){\n meta._parsed[i] = getter(i);\n }\n }\n }\n _getRotation() {\n return toRadians(this.options.rotation - 90);\n }\n _getCircumference() {\n return toRadians(this.options.circumference);\n }\n _getRotationExtents() {\n let min = TAU;\n let max = -TAU;\n for(let i = 0; i < this.chart.data.datasets.length; ++i){\n if (this.chart.isDatasetVisible(i) && this.chart.getDatasetMeta(i).type === this._type) {\n const controller = this.chart.getDatasetMeta(i).controller;\n const rotation = controller._getRotation();\n const circumference = controller._getCircumference();\n min = Math.min(min, rotation);\n max = Math.max(max, rotation + circumference);\n }\n }\n return {\n rotation: min,\n circumference: max - min\n };\n }\n update(mode) {\n const chart = this.chart;\n const { chartArea } = chart;\n const meta = this._cachedMeta;\n const arcs = meta.data;\n const spacing = this.getMaxBorderWidth() + this.getMaxOffset(arcs) + this.options.spacing;\n const maxSize = Math.max((Math.min(chartArea.width, chartArea.height) - spacing) / 2, 0);\n const cutout = Math.min(toPercentage(this.options.cutout, maxSize), 1);\n const chartWeight = this._getRingWeight(this.index);\n const { circumference , rotation } = this._getRotationExtents();\n const { ratioX , ratioY , offsetX , offsetY } = getRatioAndOffset(rotation, circumference, cutout);\n const maxWidth = (chartArea.width - spacing) / ratioX;\n const maxHeight = (chartArea.height - spacing) / ratioY;\n const maxRadius = Math.max(Math.min(maxWidth, maxHeight) / 2, 0);\n const outerRadius = toDimension(this.options.radius, maxRadius);\n const innerRadius = Math.max(outerRadius * cutout, 0);\n const radiusLength = (outerRadius - innerRadius) / this._getVisibleDatasetWeightTotal();\n this.offsetX = offsetX * outerRadius;\n this.offsetY = offsetY * outerRadius;\n meta.total = this.calculateTotal();\n this.outerRadius = outerRadius - radiusLength * this._getRingWeightOffset(this.index);\n this.innerRadius = Math.max(this.outerRadius - radiusLength * chartWeight, 0);\n this.updateElements(arcs, 0, arcs.length, mode);\n }\n _circumference(i, reset) {\n const opts = this.options;\n const meta = this._cachedMeta;\n const circumference = this._getCircumference();\n if (reset && opts.animation.animateRotate || !this.chart.getDataVisibility(i) || meta._parsed[i] === null || meta.data[i].hidden) {\n return 0;\n }\n return this.calculateCircumference(meta._parsed[i] * circumference / TAU);\n }\n updateElements(arcs, start, count, mode) {\n const reset = mode === 'reset';\n const chart = this.chart;\n const chartArea = chart.chartArea;\n const opts = chart.options;\n const animationOpts = opts.animation;\n const centerX = (chartArea.left + chartArea.right) / 2;\n const centerY = (chartArea.top + chartArea.bottom) / 2;\n const animateScale = reset && animationOpts.animateScale;\n const innerRadius = animateScale ? 0 : this.innerRadius;\n const outerRadius = animateScale ? 0 : this.outerRadius;\n const { sharedOptions , includeOptions } = this._getSharedOptions(start, mode);\n let startAngle = this._getRotation();\n let i;\n for(i = 0; i < start; ++i){\n startAngle += this._circumference(i, reset);\n }\n for(i = start; i < start + count; ++i){\n const circumference = this._circumference(i, reset);\n const arc = arcs[i];\n const properties = {\n x: centerX + this.offsetX,\n y: centerY + this.offsetY,\n startAngle,\n endAngle: startAngle + circumference,\n circumference,\n outerRadius,\n innerRadius\n };\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, arc.active ? 'active' : mode);\n }\n startAngle += circumference;\n this.updateElement(arc, i, properties, mode);\n }\n }\n calculateTotal() {\n const meta = this._cachedMeta;\n const metaData = meta.data;\n let total = 0;\n let i;\n for(i = 0; i < metaData.length; i++){\n const value = meta._parsed[i];\n if (value !== null && !isNaN(value) && this.chart.getDataVisibility(i) && !metaData[i].hidden) {\n total += Math.abs(value);\n }\n }\n return total;\n }\n calculateCircumference(value) {\n const total = this._cachedMeta.total;\n if (total > 0 && !isNaN(value)) {\n return TAU * (Math.abs(value) / total);\n }\n return 0;\n }\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const chart = this.chart;\n const labels = chart.data.labels || [];\n const value = formatNumber(meta._parsed[index], chart.options.locale);\n return {\n label: labels[index] || '',\n value\n };\n }\n getMaxBorderWidth(arcs) {\n let max = 0;\n const chart = this.chart;\n let i, ilen, meta, controller, options;\n if (!arcs) {\n for(i = 0, ilen = chart.data.datasets.length; i < ilen; ++i){\n if (chart.isDatasetVisible(i)) {\n meta = chart.getDatasetMeta(i);\n arcs = meta.data;\n controller = meta.controller;\n break;\n }\n }\n }\n if (!arcs) {\n return 0;\n }\n for(i = 0, ilen = arcs.length; i < ilen; ++i){\n options = controller.resolveDataElementOptions(i);\n if (options.borderAlign !== 'inner') {\n max = Math.max(max, options.borderWidth || 0, options.hoverBorderWidth || 0);\n }\n }\n return max;\n }\n getMaxOffset(arcs) {\n let max = 0;\n for(let i = 0, ilen = arcs.length; i < ilen; ++i){\n const options = this.resolveDataElementOptions(i);\n max = Math.max(max, options.offset || 0, options.hoverOffset || 0);\n }\n return max;\n }\n _getRingWeightOffset(datasetIndex) {\n let ringWeightOffset = 0;\n for(let i = 0; i < datasetIndex; ++i){\n if (this.chart.isDatasetVisible(i)) {\n ringWeightOffset += this._getRingWeight(i);\n }\n }\n return ringWeightOffset;\n }\n _getRingWeight(datasetIndex) {\n return Math.max(valueOrDefault(this.chart.data.datasets[datasetIndex].weight, 1), 0);\n }\n _getVisibleDatasetWeightTotal() {\n return this._getRingWeightOffset(this.chart.data.datasets.length) || 1;\n }\n}\n\nclass LineController extends DatasetController {\n static id = 'line';\n static defaults = {\n datasetElementType: 'line',\n dataElementType: 'point',\n showLine: true,\n spanGaps: false\n };\n static overrides = {\n scales: {\n _index_: {\n type: 'category'\n },\n _value_: {\n type: 'linear'\n }\n }\n };\n initialize() {\n this.enableOptionSharing = true;\n this.supportsDecimation = true;\n super.initialize();\n }\n update(mode) {\n const meta = this._cachedMeta;\n const { dataset: line , data: points = [] , _dataset } = meta;\n const animationsDisabled = this.chart._animationsDisabled;\n let { start , count } = _getStartAndCountOfVisiblePoints(meta, points, animationsDisabled);\n this._drawStart = start;\n this._drawCount = count;\n if (_scaleRangesChanged(meta)) {\n start = 0;\n count = points.length;\n }\n line._chart = this.chart;\n line._datasetIndex = this.index;\n line._decimated = !!_dataset._decimated;\n line.points = points;\n const options = this.resolveDatasetElementOptions(mode);\n if (!this.options.showLine) {\n options.borderWidth = 0;\n }\n options.segment = this.options.segment;\n this.updateElement(line, undefined, {\n animated: !animationsDisabled,\n options\n }, mode);\n this.updateElements(points, start, count, mode);\n }\n updateElements(points, start, count, mode) {\n const reset = mode === 'reset';\n const { iScale , vScale , _stacked , _dataset } = this._cachedMeta;\n const { sharedOptions , includeOptions } = this._getSharedOptions(start, mode);\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const { spanGaps , segment } = this.options;\n const maxGapLength = isNumber(spanGaps) ? spanGaps : Number.POSITIVE_INFINITY;\n const directUpdate = this.chart._animationsDisabled || reset || mode === 'none';\n const end = start + count;\n const pointsCount = points.length;\n let prevParsed = start > 0 && this.getParsed(start - 1);\n for(let i = 0; i < pointsCount; ++i){\n const point = points[i];\n const properties = directUpdate ? point : {};\n if (i < start || i >= end) {\n properties.skip = true;\n continue;\n }\n const parsed = this.getParsed(i);\n const nullData = isNullOrUndef(parsed[vAxis]);\n const iPixel = properties[iAxis] = iScale.getPixelForValue(parsed[iAxis], i);\n const vPixel = properties[vAxis] = reset || nullData ? vScale.getBasePixel() : vScale.getPixelForValue(_stacked ? this.applyStack(vScale, parsed, _stacked) : parsed[vAxis], i);\n properties.skip = isNaN(iPixel) || isNaN(vPixel) || nullData;\n properties.stop = i > 0 && Math.abs(parsed[iAxis] - prevParsed[iAxis]) > maxGapLength;\n if (segment) {\n properties.parsed = parsed;\n properties.raw = _dataset.data[i];\n }\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? 'active' : mode);\n }\n if (!directUpdate) {\n this.updateElement(point, i, properties, mode);\n }\n prevParsed = parsed;\n }\n }\n getMaxOverflow() {\n const meta = this._cachedMeta;\n const dataset = meta.dataset;\n const border = dataset.options && dataset.options.borderWidth || 0;\n const data = meta.data || [];\n if (!data.length) {\n return border;\n }\n const firstPoint = data[0].size(this.resolveDataElementOptions(0));\n const lastPoint = data[data.length - 1].size(this.resolveDataElementOptions(data.length - 1));\n return Math.max(border, firstPoint, lastPoint) / 2;\n }\n draw() {\n const meta = this._cachedMeta;\n meta.dataset.updateControlPoints(this.chart.chartArea, meta.iScale.axis);\n super.draw();\n }\n}\n\nclass PolarAreaController extends DatasetController {\n static id = 'polarArea';\n static defaults = {\n dataElementType: 'arc',\n animation: {\n animateRotate: true,\n animateScale: true\n },\n animations: {\n numbers: {\n type: 'number',\n properties: [\n 'x',\n 'y',\n 'startAngle',\n 'endAngle',\n 'innerRadius',\n 'outerRadius'\n ]\n }\n },\n indexAxis: 'r',\n startAngle: 0\n };\n static overrides = {\n aspectRatio: 1,\n plugins: {\n legend: {\n labels: {\n generateLabels (chart) {\n const data = chart.data;\n if (data.labels.length && data.datasets.length) {\n const { labels: { pointStyle , color } } = chart.legend.options;\n return data.labels.map((label, i)=>{\n const meta = chart.getDatasetMeta(0);\n const style = meta.controller.getStyle(i);\n return {\n text: label,\n fillStyle: style.backgroundColor,\n strokeStyle: style.borderColor,\n fontColor: color,\n lineWidth: style.borderWidth,\n pointStyle: pointStyle,\n hidden: !chart.getDataVisibility(i),\n index: i\n };\n });\n }\n return [];\n }\n },\n onClick (e, legendItem, legend) {\n legend.chart.toggleDataVisibility(legendItem.index);\n legend.chart.update();\n }\n }\n },\n scales: {\n r: {\n type: 'radialLinear',\n angleLines: {\n display: false\n },\n beginAtZero: true,\n grid: {\n circular: true\n },\n pointLabels: {\n display: false\n },\n startAngle: 0\n }\n }\n };\n constructor(chart, datasetIndex){\n super(chart, datasetIndex);\n this.innerRadius = undefined;\n this.outerRadius = undefined;\n }\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const chart = this.chart;\n const labels = chart.data.labels || [];\n const value = formatNumber(meta._parsed[index].r, chart.options.locale);\n return {\n label: labels[index] || '',\n value\n };\n }\n parseObjectData(meta, data, start, count) {\n return _parseObjectDataRadialScale.bind(this)(meta, data, start, count);\n }\n update(mode) {\n const arcs = this._cachedMeta.data;\n this._updateRadius();\n this.updateElements(arcs, 0, arcs.length, mode);\n }\n getMinMax() {\n const meta = this._cachedMeta;\n const range = {\n min: Number.POSITIVE_INFINITY,\n max: Number.NEGATIVE_INFINITY\n };\n meta.data.forEach((element, index)=>{\n const parsed = this.getParsed(index).r;\n if (!isNaN(parsed) && this.chart.getDataVisibility(index)) {\n if (parsed < range.min) {\n range.min = parsed;\n }\n if (parsed > range.max) {\n range.max = parsed;\n }\n }\n });\n return range;\n }\n _updateRadius() {\n const chart = this.chart;\n const chartArea = chart.chartArea;\n const opts = chart.options;\n const minSize = Math.min(chartArea.right - chartArea.left, chartArea.bottom - chartArea.top);\n const outerRadius = Math.max(minSize / 2, 0);\n const innerRadius = Math.max(opts.cutoutPercentage ? outerRadius / 100 * opts.cutoutPercentage : 1, 0);\n const radiusLength = (outerRadius - innerRadius) / chart.getVisibleDatasetCount();\n this.outerRadius = outerRadius - radiusLength * this.index;\n this.innerRadius = this.outerRadius - radiusLength;\n }\n updateElements(arcs, start, count, mode) {\n const reset = mode === 'reset';\n const chart = this.chart;\n const opts = chart.options;\n const animationOpts = opts.animation;\n const scale = this._cachedMeta.rScale;\n const centerX = scale.xCenter;\n const centerY = scale.yCenter;\n const datasetStartAngle = scale.getIndexAngle(0) - 0.5 * PI;\n let angle = datasetStartAngle;\n let i;\n const defaultAngle = 360 / this.countVisibleElements();\n for(i = 0; i < start; ++i){\n angle += this._computeAngle(i, mode, defaultAngle);\n }\n for(i = start; i < start + count; i++){\n const arc = arcs[i];\n let startAngle = angle;\n let endAngle = angle + this._computeAngle(i, mode, defaultAngle);\n let outerRadius = chart.getDataVisibility(i) ? scale.getDistanceFromCenterForValue(this.getParsed(i).r) : 0;\n angle = endAngle;\n if (reset) {\n if (animationOpts.animateScale) {\n outerRadius = 0;\n }\n if (animationOpts.animateRotate) {\n startAngle = endAngle = datasetStartAngle;\n }\n }\n const properties = {\n x: centerX,\n y: centerY,\n innerRadius: 0,\n outerRadius,\n startAngle,\n endAngle,\n options: this.resolveDataElementOptions(i, arc.active ? 'active' : mode)\n };\n this.updateElement(arc, i, properties, mode);\n }\n }\n countVisibleElements() {\n const meta = this._cachedMeta;\n let count = 0;\n meta.data.forEach((element, index)=>{\n if (!isNaN(this.getParsed(index).r) && this.chart.getDataVisibility(index)) {\n count++;\n }\n });\n return count;\n }\n _computeAngle(index, mode, defaultAngle) {\n return this.chart.getDataVisibility(index) ? toRadians(this.resolveDataElementOptions(index, mode).angle || defaultAngle) : 0;\n }\n}\n\nclass PieController extends DoughnutController {\n static id = 'pie';\n static defaults = {\n cutout: 0,\n rotation: 0,\n circumference: 360,\n radius: '100%'\n };\n}\n\nclass RadarController extends DatasetController {\n static id = 'radar';\n static defaults = {\n datasetElementType: 'line',\n dataElementType: 'point',\n indexAxis: 'r',\n showLine: true,\n elements: {\n line: {\n fill: 'start'\n }\n }\n };\n static overrides = {\n aspectRatio: 1,\n scales: {\n r: {\n type: 'radialLinear'\n }\n }\n };\n getLabelAndValue(index) {\n const vScale = this._cachedMeta.vScale;\n const parsed = this.getParsed(index);\n return {\n label: vScale.getLabels()[index],\n value: '' + vScale.getLabelForValue(parsed[vScale.axis])\n };\n }\n parseObjectData(meta, data, start, count) {\n return _parseObjectDataRadialScale.bind(this)(meta, data, start, count);\n }\n update(mode) {\n const meta = this._cachedMeta;\n const line = meta.dataset;\n const points = meta.data || [];\n const labels = meta.iScale.getLabels();\n line.points = points;\n if (mode !== 'resize') {\n const options = this.resolveDatasetElementOptions(mode);\n if (!this.options.showLine) {\n options.borderWidth = 0;\n }\n const properties = {\n _loop: true,\n _fullLoop: labels.length === points.length,\n options\n };\n this.updateElement(line, undefined, properties, mode);\n }\n this.updateElements(points, 0, points.length, mode);\n }\n updateElements(points, start, count, mode) {\n const scale = this._cachedMeta.rScale;\n const reset = mode === 'reset';\n for(let i = start; i < start + count; i++){\n const point = points[i];\n const options = this.resolveDataElementOptions(i, point.active ? 'active' : mode);\n const pointPosition = scale.getPointPositionForValue(i, this.getParsed(i).r);\n const x = reset ? scale.xCenter : pointPosition.x;\n const y = reset ? scale.yCenter : pointPosition.y;\n const properties = {\n x,\n y,\n angle: pointPosition.angle,\n skip: isNaN(x) || isNaN(y),\n options\n };\n this.updateElement(point, i, properties, mode);\n }\n }\n}\n\nclass ScatterController extends DatasetController {\n static id = 'scatter';\n static defaults = {\n datasetElementType: false,\n dataElementType: 'point',\n showLine: false,\n fill: false\n };\n static overrides = {\n interaction: {\n mode: 'point'\n },\n scales: {\n x: {\n type: 'linear'\n },\n y: {\n type: 'linear'\n }\n }\n };\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const labels = this.chart.data.labels || [];\n const { xScale , yScale } = meta;\n const parsed = this.getParsed(index);\n const x = xScale.getLabelForValue(parsed.x);\n const y = yScale.getLabelForValue(parsed.y);\n return {\n label: labels[index] || '',\n value: '(' + x + ', ' + y + ')'\n };\n }\n update(mode) {\n const meta = this._cachedMeta;\n const { data: points = [] } = meta;\n const animationsDisabled = this.chart._animationsDisabled;\n let { start , count } = _getStartAndCountOfVisiblePoints(meta, points, animationsDisabled);\n this._drawStart = start;\n this._drawCount = count;\n if (_scaleRangesChanged(meta)) {\n start = 0;\n count = points.length;\n }\n if (this.options.showLine) {\n if (!this.datasetElementType) {\n this.addElements();\n }\n const { dataset: line , _dataset } = meta;\n line._chart = this.chart;\n line._datasetIndex = this.index;\n line._decimated = !!_dataset._decimated;\n line.points = points;\n const options = this.resolveDatasetElementOptions(mode);\n options.segment = this.options.segment;\n this.updateElement(line, undefined, {\n animated: !animationsDisabled,\n options\n }, mode);\n } else if (this.datasetElementType) {\n delete meta.dataset;\n this.datasetElementType = false;\n }\n this.updateElements(points, start, count, mode);\n }\n addElements() {\n const { showLine } = this.options;\n if (!this.datasetElementType && showLine) {\n this.datasetElementType = this.chart.registry.getElement('line');\n }\n super.addElements();\n }\n updateElements(points, start, count, mode) {\n const reset = mode === 'reset';\n const { iScale , vScale , _stacked , _dataset } = this._cachedMeta;\n const firstOpts = this.resolveDataElementOptions(start, mode);\n const sharedOptions = this.getSharedOptions(firstOpts);\n const includeOptions = this.includeOptions(mode, sharedOptions);\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const { spanGaps , segment } = this.options;\n const maxGapLength = isNumber(spanGaps) ? spanGaps : Number.POSITIVE_INFINITY;\n const directUpdate = this.chart._animationsDisabled || reset || mode === 'none';\n let prevParsed = start > 0 && this.getParsed(start - 1);\n for(let i = start; i < start + count; ++i){\n const point = points[i];\n const parsed = this.getParsed(i);\n const properties = directUpdate ? point : {};\n const nullData = isNullOrUndef(parsed[vAxis]);\n const iPixel = properties[iAxis] = iScale.getPixelForValue(parsed[iAxis], i);\n const vPixel = properties[vAxis] = reset || nullData ? vScale.getBasePixel() : vScale.getPixelForValue(_stacked ? this.applyStack(vScale, parsed, _stacked) : parsed[vAxis], i);\n properties.skip = isNaN(iPixel) || isNaN(vPixel) || nullData;\n properties.stop = i > 0 && Math.abs(parsed[iAxis] - prevParsed[iAxis]) > maxGapLength;\n if (segment) {\n properties.parsed = parsed;\n properties.raw = _dataset.data[i];\n }\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? 'active' : mode);\n }\n if (!directUpdate) {\n this.updateElement(point, i, properties, mode);\n }\n prevParsed = parsed;\n }\n this.updateSharedOptions(sharedOptions, mode, firstOpts);\n }\n getMaxOverflow() {\n const meta = this._cachedMeta;\n const data = meta.data || [];\n if (!this.options.showLine) {\n let max = 0;\n for(let i = data.length - 1; i >= 0; --i){\n max = Math.max(max, data[i].size(this.resolveDataElementOptions(i)) / 2);\n }\n return max > 0 && max;\n }\n const dataset = meta.dataset;\n const border = dataset.options && dataset.options.borderWidth || 0;\n if (!data.length) {\n return border;\n }\n const firstPoint = data[0].size(this.resolveDataElementOptions(0));\n const lastPoint = data[data.length - 1].size(this.resolveDataElementOptions(data.length - 1));\n return Math.max(border, firstPoint, lastPoint) / 2;\n }\n}\n\nvar controllers = /*#__PURE__*/Object.freeze({\n__proto__: null,\nBarController: BarController,\nBubbleController: BubbleController,\nDoughnutController: DoughnutController,\nLineController: LineController,\nPieController: PieController,\nPolarAreaController: PolarAreaController,\nRadarController: RadarController,\nScatterController: ScatterController\n});\n\n/**\n * @namespace Chart._adapters\n * @since 2.8.0\n * @private\n */ function abstract() {\n throw new Error('This method is not implemented: Check that a complete date adapter is provided.');\n}\n/**\n * Date adapter (current used by the time scale)\n * @namespace Chart._adapters._date\n * @memberof Chart._adapters\n * @private\n */ class DateAdapterBase {\n /**\n * Override default date adapter methods.\n * Accepts type parameter to define options type.\n * @example\n * Chart._adapters._date.override<{myAdapterOption: string}>({\n * init() {\n * console.log(this.options.myAdapterOption);\n * }\n * })\n */ static override(members) {\n Object.assign(DateAdapterBase.prototype, members);\n }\n options;\n constructor(options){\n this.options = options || {};\n }\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n init() {}\n formats() {\n return abstract();\n }\n parse() {\n return abstract();\n }\n format() {\n return abstract();\n }\n add() {\n return abstract();\n }\n diff() {\n return abstract();\n }\n startOf() {\n return abstract();\n }\n endOf() {\n return abstract();\n }\n}\nvar adapters = {\n _date: DateAdapterBase\n};\n\nfunction binarySearch(metaset, axis, value, intersect) {\n const { controller , data , _sorted } = metaset;\n const iScale = controller._cachedMeta.iScale;\n if (iScale && axis === iScale.axis && axis !== 'r' && _sorted && data.length) {\n const lookupMethod = iScale._reversePixels ? _rlookupByKey : _lookupByKey;\n if (!intersect) {\n return lookupMethod(data, axis, value);\n } else if (controller._sharedOptions) {\n const el = data[0];\n const range = typeof el.getRange === 'function' && el.getRange(axis);\n if (range) {\n const start = lookupMethod(data, axis, value - range);\n const end = lookupMethod(data, axis, value + range);\n return {\n lo: start.lo,\n hi: end.hi\n };\n }\n }\n }\n return {\n lo: 0,\n hi: data.length - 1\n };\n}\n function evaluateInteractionItems(chart, axis, position, handler, intersect) {\n const metasets = chart.getSortedVisibleDatasetMetas();\n const value = position[axis];\n for(let i = 0, ilen = metasets.length; i < ilen; ++i){\n const { index , data } = metasets[i];\n const { lo , hi } = binarySearch(metasets[i], axis, value, intersect);\n for(let j = lo; j <= hi; ++j){\n const element = data[j];\n if (!element.skip) {\n handler(element, index, j);\n }\n }\n }\n}\n function getDistanceMetricForAxis(axis) {\n const useX = axis.indexOf('x') !== -1;\n const useY = axis.indexOf('y') !== -1;\n return function(pt1, pt2) {\n const deltaX = useX ? Math.abs(pt1.x - pt2.x) : 0;\n const deltaY = useY ? Math.abs(pt1.y - pt2.y) : 0;\n return Math.sqrt(Math.pow(deltaX, 2) + Math.pow(deltaY, 2));\n };\n}\n function getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible) {\n const items = [];\n if (!includeInvisible && !chart.isPointInArea(position)) {\n return items;\n }\n const evaluationFunc = function(element, datasetIndex, index) {\n if (!includeInvisible && !_isPointInArea(element, chart.chartArea, 0)) {\n return;\n }\n if (element.inRange(position.x, position.y, useFinalPosition)) {\n items.push({\n element,\n datasetIndex,\n index\n });\n }\n };\n evaluateInteractionItems(chart, axis, position, evaluationFunc, true);\n return items;\n}\n function getNearestRadialItems(chart, position, axis, useFinalPosition) {\n let items = [];\n function evaluationFunc(element, datasetIndex, index) {\n const { startAngle , endAngle } = element.getProps([\n 'startAngle',\n 'endAngle'\n ], useFinalPosition);\n const { angle } = getAngleFromPoint(element, {\n x: position.x,\n y: position.y\n });\n if (_angleBetween(angle, startAngle, endAngle)) {\n items.push({\n element,\n datasetIndex,\n index\n });\n }\n }\n evaluateInteractionItems(chart, axis, position, evaluationFunc);\n return items;\n}\n function getNearestCartesianItems(chart, position, axis, intersect, useFinalPosition, includeInvisible) {\n let items = [];\n const distanceMetric = getDistanceMetricForAxis(axis);\n let minDistance = Number.POSITIVE_INFINITY;\n function evaluationFunc(element, datasetIndex, index) {\n const inRange = element.inRange(position.x, position.y, useFinalPosition);\n if (intersect && !inRange) {\n return;\n }\n const center = element.getCenterPoint(useFinalPosition);\n const pointInArea = !!includeInvisible || chart.isPointInArea(center);\n if (!pointInArea && !inRange) {\n return;\n }\n const distance = distanceMetric(position, center);\n if (distance < minDistance) {\n items = [\n {\n element,\n datasetIndex,\n index\n }\n ];\n minDistance = distance;\n } else if (distance === minDistance) {\n items.push({\n element,\n datasetIndex,\n index\n });\n }\n }\n evaluateInteractionItems(chart, axis, position, evaluationFunc);\n return items;\n}\n function getNearestItems(chart, position, axis, intersect, useFinalPosition, includeInvisible) {\n if (!includeInvisible && !chart.isPointInArea(position)) {\n return [];\n }\n return axis === 'r' && !intersect ? getNearestRadialItems(chart, position, axis, useFinalPosition) : getNearestCartesianItems(chart, position, axis, intersect, useFinalPosition, includeInvisible);\n}\n function getAxisItems(chart, position, axis, intersect, useFinalPosition) {\n const items = [];\n const rangeMethod = axis === 'x' ? 'inXRange' : 'inYRange';\n let intersectsItem = false;\n evaluateInteractionItems(chart, axis, position, (element, datasetIndex, index)=>{\n if (element[rangeMethod](position[axis], useFinalPosition)) {\n items.push({\n element,\n datasetIndex,\n index\n });\n intersectsItem = intersectsItem || element.inRange(position.x, position.y, useFinalPosition);\n }\n });\n if (intersect && !intersectsItem) {\n return [];\n }\n return items;\n}\n var Interaction = {\n evaluateInteractionItems,\n modes: {\n index (chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n const axis = options.axis || 'x';\n const includeInvisible = options.includeInvisible || false;\n const items = options.intersect ? getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible) : getNearestItems(chart, position, axis, false, useFinalPosition, includeInvisible);\n const elements = [];\n if (!items.length) {\n return [];\n }\n chart.getSortedVisibleDatasetMetas().forEach((meta)=>{\n const index = items[0].index;\n const element = meta.data[index];\n if (element && !element.skip) {\n elements.push({\n element,\n datasetIndex: meta.index,\n index\n });\n }\n });\n return elements;\n },\n dataset (chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n const axis = options.axis || 'xy';\n const includeInvisible = options.includeInvisible || false;\n let items = options.intersect ? getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible) : getNearestItems(chart, position, axis, false, useFinalPosition, includeInvisible);\n if (items.length > 0) {\n const datasetIndex = items[0].datasetIndex;\n const data = chart.getDatasetMeta(datasetIndex).data;\n items = [];\n for(let i = 0; i < data.length; ++i){\n items.push({\n element: data[i],\n datasetIndex,\n index: i\n });\n }\n }\n return items;\n },\n point (chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n const axis = options.axis || 'xy';\n const includeInvisible = options.includeInvisible || false;\n return getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible);\n },\n nearest (chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n const axis = options.axis || 'xy';\n const includeInvisible = options.includeInvisible || false;\n return getNearestItems(chart, position, axis, options.intersect, useFinalPosition, includeInvisible);\n },\n x (chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n return getAxisItems(chart, position, 'x', options.intersect, useFinalPosition);\n },\n y (chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n return getAxisItems(chart, position, 'y', options.intersect, useFinalPosition);\n }\n }\n};\n\nconst STATIC_POSITIONS = [\n 'left',\n 'top',\n 'right',\n 'bottom'\n];\nfunction filterByPosition(array, position) {\n return array.filter((v)=>v.pos === position);\n}\nfunction filterDynamicPositionByAxis(array, axis) {\n return array.filter((v)=>STATIC_POSITIONS.indexOf(v.pos) === -1 && v.box.axis === axis);\n}\nfunction sortByWeight(array, reverse) {\n return array.sort((a, b)=>{\n const v0 = reverse ? b : a;\n const v1 = reverse ? a : b;\n return v0.weight === v1.weight ? v0.index - v1.index : v0.weight - v1.weight;\n });\n}\nfunction wrapBoxes(boxes) {\n const layoutBoxes = [];\n let i, ilen, box, pos, stack, stackWeight;\n for(i = 0, ilen = (boxes || []).length; i < ilen; ++i){\n box = boxes[i];\n ({ position: pos , options: { stack , stackWeight =1 } } = box);\n layoutBoxes.push({\n index: i,\n box,\n pos,\n horizontal: box.isHorizontal(),\n weight: box.weight,\n stack: stack && pos + stack,\n stackWeight\n });\n }\n return layoutBoxes;\n}\nfunction buildStacks(layouts) {\n const stacks = {};\n for (const wrap of layouts){\n const { stack , pos , stackWeight } = wrap;\n if (!stack || !STATIC_POSITIONS.includes(pos)) {\n continue;\n }\n const _stack = stacks[stack] || (stacks[stack] = {\n count: 0,\n placed: 0,\n weight: 0,\n size: 0\n });\n _stack.count++;\n _stack.weight += stackWeight;\n }\n return stacks;\n}\n function setLayoutDims(layouts, params) {\n const stacks = buildStacks(layouts);\n const { vBoxMaxWidth , hBoxMaxHeight } = params;\n let i, ilen, layout;\n for(i = 0, ilen = layouts.length; i < ilen; ++i){\n layout = layouts[i];\n const { fullSize } = layout.box;\n const stack = stacks[layout.stack];\n const factor = stack && layout.stackWeight / stack.weight;\n if (layout.horizontal) {\n layout.width = factor ? factor * vBoxMaxWidth : fullSize && params.availableWidth;\n layout.height = hBoxMaxHeight;\n } else {\n layout.width = vBoxMaxWidth;\n layout.height = factor ? factor * hBoxMaxHeight : fullSize && params.availableHeight;\n }\n }\n return stacks;\n}\nfunction buildLayoutBoxes(boxes) {\n const layoutBoxes = wrapBoxes(boxes);\n const fullSize = sortByWeight(layoutBoxes.filter((wrap)=>wrap.box.fullSize), true);\n const left = sortByWeight(filterByPosition(layoutBoxes, 'left'), true);\n const right = sortByWeight(filterByPosition(layoutBoxes, 'right'));\n const top = sortByWeight(filterByPosition(layoutBoxes, 'top'), true);\n const bottom = sortByWeight(filterByPosition(layoutBoxes, 'bottom'));\n const centerHorizontal = filterDynamicPositionByAxis(layoutBoxes, 'x');\n const centerVertical = filterDynamicPositionByAxis(layoutBoxes, 'y');\n return {\n fullSize,\n leftAndTop: left.concat(top),\n rightAndBottom: right.concat(centerVertical).concat(bottom).concat(centerHorizontal),\n chartArea: filterByPosition(layoutBoxes, 'chartArea'),\n vertical: left.concat(right).concat(centerVertical),\n horizontal: top.concat(bottom).concat(centerHorizontal)\n };\n}\nfunction getCombinedMax(maxPadding, chartArea, a, b) {\n return Math.max(maxPadding[a], chartArea[a]) + Math.max(maxPadding[b], chartArea[b]);\n}\nfunction updateMaxPadding(maxPadding, boxPadding) {\n maxPadding.top = Math.max(maxPadding.top, boxPadding.top);\n maxPadding.left = Math.max(maxPadding.left, boxPadding.left);\n maxPadding.bottom = Math.max(maxPadding.bottom, boxPadding.bottom);\n maxPadding.right = Math.max(maxPadding.right, boxPadding.right);\n}\nfunction updateDims(chartArea, params, layout, stacks) {\n const { pos , box } = layout;\n const maxPadding = chartArea.maxPadding;\n if (!isObject(pos)) {\n if (layout.size) {\n chartArea[pos] -= layout.size;\n }\n const stack = stacks[layout.stack] || {\n size: 0,\n count: 1\n };\n stack.size = Math.max(stack.size, layout.horizontal ? box.height : box.width);\n layout.size = stack.size / stack.count;\n chartArea[pos] += layout.size;\n }\n if (box.getPadding) {\n updateMaxPadding(maxPadding, box.getPadding());\n }\n const newWidth = Math.max(0, params.outerWidth - getCombinedMax(maxPadding, chartArea, 'left', 'right'));\n const newHeight = Math.max(0, params.outerHeight - getCombinedMax(maxPadding, chartArea, 'top', 'bottom'));\n const widthChanged = newWidth !== chartArea.w;\n const heightChanged = newHeight !== chartArea.h;\n chartArea.w = newWidth;\n chartArea.h = newHeight;\n return layout.horizontal ? {\n same: widthChanged,\n other: heightChanged\n } : {\n same: heightChanged,\n other: widthChanged\n };\n}\nfunction handleMaxPadding(chartArea) {\n const maxPadding = chartArea.maxPadding;\n function updatePos(pos) {\n const change = Math.max(maxPadding[pos] - chartArea[pos], 0);\n chartArea[pos] += change;\n return change;\n }\n chartArea.y += updatePos('top');\n chartArea.x += updatePos('left');\n updatePos('right');\n updatePos('bottom');\n}\nfunction getMargins(horizontal, chartArea) {\n const maxPadding = chartArea.maxPadding;\n function marginForPositions(positions) {\n const margin = {\n left: 0,\n top: 0,\n right: 0,\n bottom: 0\n };\n positions.forEach((pos)=>{\n margin[pos] = Math.max(chartArea[pos], maxPadding[pos]);\n });\n return margin;\n }\n return horizontal ? marginForPositions([\n 'left',\n 'right'\n ]) : marginForPositions([\n 'top',\n 'bottom'\n ]);\n}\nfunction fitBoxes(boxes, chartArea, params, stacks) {\n const refitBoxes = [];\n let i, ilen, layout, box, refit, changed;\n for(i = 0, ilen = boxes.length, refit = 0; i < ilen; ++i){\n layout = boxes[i];\n box = layout.box;\n box.update(layout.width || chartArea.w, layout.height || chartArea.h, getMargins(layout.horizontal, chartArea));\n const { same , other } = updateDims(chartArea, params, layout, stacks);\n refit |= same && refitBoxes.length;\n changed = changed || other;\n if (!box.fullSize) {\n refitBoxes.push(layout);\n }\n }\n return refit && fitBoxes(refitBoxes, chartArea, params, stacks) || changed;\n}\nfunction setBoxDims(box, left, top, width, height) {\n box.top = top;\n box.left = left;\n box.right = left + width;\n box.bottom = top + height;\n box.width = width;\n box.height = height;\n}\nfunction placeBoxes(boxes, chartArea, params, stacks) {\n const userPadding = params.padding;\n let { x , y } = chartArea;\n for (const layout of boxes){\n const box = layout.box;\n const stack = stacks[layout.stack] || {\n count: 1,\n placed: 0,\n weight: 1\n };\n const weight = layout.stackWeight / stack.weight || 1;\n if (layout.horizontal) {\n const width = chartArea.w * weight;\n const height = stack.size || box.height;\n if (defined(stack.start)) {\n y = stack.start;\n }\n if (box.fullSize) {\n setBoxDims(box, userPadding.left, y, params.outerWidth - userPadding.right - userPadding.left, height);\n } else {\n setBoxDims(box, chartArea.left + stack.placed, y, width, height);\n }\n stack.start = y;\n stack.placed += width;\n y = box.bottom;\n } else {\n const height = chartArea.h * weight;\n const width = stack.size || box.width;\n if (defined(stack.start)) {\n x = stack.start;\n }\n if (box.fullSize) {\n setBoxDims(box, x, userPadding.top, width, params.outerHeight - userPadding.bottom - userPadding.top);\n } else {\n setBoxDims(box, x, chartArea.top + stack.placed, width, height);\n }\n stack.start = x;\n stack.placed += height;\n x = box.right;\n }\n }\n chartArea.x = x;\n chartArea.y = y;\n}\nvar layouts = {\n addBox (chart, item) {\n if (!chart.boxes) {\n chart.boxes = [];\n }\n item.fullSize = item.fullSize || false;\n item.position = item.position || 'top';\n item.weight = item.weight || 0;\n item._layers = item._layers || function() {\n return [\n {\n z: 0,\n draw (chartArea) {\n item.draw(chartArea);\n }\n }\n ];\n };\n chart.boxes.push(item);\n },\n removeBox (chart, layoutItem) {\n const index = chart.boxes ? chart.boxes.indexOf(layoutItem) : -1;\n if (index !== -1) {\n chart.boxes.splice(index, 1);\n }\n },\n configure (chart, item, options) {\n item.fullSize = options.fullSize;\n item.position = options.position;\n item.weight = options.weight;\n },\n update (chart, width, height, minPadding) {\n if (!chart) {\n return;\n }\n const padding = toPadding(chart.options.layout.padding);\n const availableWidth = Math.max(width - padding.width, 0);\n const availableHeight = Math.max(height - padding.height, 0);\n const boxes = buildLayoutBoxes(chart.boxes);\n const verticalBoxes = boxes.vertical;\n const horizontalBoxes = boxes.horizontal;\n each(chart.boxes, (box)=>{\n if (typeof box.beforeLayout === 'function') {\n box.beforeLayout();\n }\n });\n const visibleVerticalBoxCount = verticalBoxes.reduce((total, wrap)=>wrap.box.options && wrap.box.options.display === false ? total : total + 1, 0) || 1;\n const params = Object.freeze({\n outerWidth: width,\n outerHeight: height,\n padding,\n availableWidth,\n availableHeight,\n vBoxMaxWidth: availableWidth / 2 / visibleVerticalBoxCount,\n hBoxMaxHeight: availableHeight / 2\n });\n const maxPadding = Object.assign({}, padding);\n updateMaxPadding(maxPadding, toPadding(minPadding));\n const chartArea = Object.assign({\n maxPadding,\n w: availableWidth,\n h: availableHeight,\n x: padding.left,\n y: padding.top\n }, padding);\n const stacks = setLayoutDims(verticalBoxes.concat(horizontalBoxes), params);\n fitBoxes(boxes.fullSize, chartArea, params, stacks);\n fitBoxes(verticalBoxes, chartArea, params, stacks);\n if (fitBoxes(horizontalBoxes, chartArea, params, stacks)) {\n fitBoxes(verticalBoxes, chartArea, params, stacks);\n }\n handleMaxPadding(chartArea);\n placeBoxes(boxes.leftAndTop, chartArea, params, stacks);\n chartArea.x += chartArea.w;\n chartArea.y += chartArea.h;\n placeBoxes(boxes.rightAndBottom, chartArea, params, stacks);\n chart.chartArea = {\n left: chartArea.left,\n top: chartArea.top,\n right: chartArea.left + chartArea.w,\n bottom: chartArea.top + chartArea.h,\n height: chartArea.h,\n width: chartArea.w\n };\n each(boxes.chartArea, (layout)=>{\n const box = layout.box;\n Object.assign(box, chart.chartArea);\n box.update(chartArea.w, chartArea.h, {\n left: 0,\n top: 0,\n right: 0,\n bottom: 0\n });\n });\n }\n};\n\nclass BasePlatform {\n acquireContext(canvas, aspectRatio) {}\n releaseContext(context) {\n return false;\n }\n addEventListener(chart, type, listener) {}\n removeEventListener(chart, type, listener) {}\n getDevicePixelRatio() {\n return 1;\n }\n getMaximumSize(element, width, height, aspectRatio) {\n width = Math.max(0, width || element.width);\n height = height || element.height;\n return {\n width,\n height: Math.max(0, aspectRatio ? Math.floor(width / aspectRatio) : height)\n };\n }\n isAttached(canvas) {\n return true;\n }\n updateConfig(config) {\n }\n}\n\nclass BasicPlatform extends BasePlatform {\n acquireContext(item) {\n return item && item.getContext && item.getContext('2d') || null;\n }\n updateConfig(config) {\n config.options.animation = false;\n }\n}\n\nconst EXPANDO_KEY = '$chartjs';\n const EVENT_TYPES = {\n touchstart: 'mousedown',\n touchmove: 'mousemove',\n touchend: 'mouseup',\n pointerenter: 'mouseenter',\n pointerdown: 'mousedown',\n pointermove: 'mousemove',\n pointerup: 'mouseup',\n pointerleave: 'mouseout',\n pointerout: 'mouseout'\n};\nconst isNullOrEmpty = (value)=>value === null || value === '';\n function initCanvas(canvas, aspectRatio) {\n const style = canvas.style;\n const renderHeight = canvas.getAttribute('height');\n const renderWidth = canvas.getAttribute('width');\n canvas[EXPANDO_KEY] = {\n initial: {\n height: renderHeight,\n width: renderWidth,\n style: {\n display: style.display,\n height: style.height,\n width: style.width\n }\n }\n };\n style.display = style.display || 'block';\n style.boxSizing = style.boxSizing || 'border-box';\n if (isNullOrEmpty(renderWidth)) {\n const displayWidth = readUsedSize(canvas, 'width');\n if (displayWidth !== undefined) {\n canvas.width = displayWidth;\n }\n }\n if (isNullOrEmpty(renderHeight)) {\n if (canvas.style.height === '') {\n canvas.height = canvas.width / (aspectRatio || 2);\n } else {\n const displayHeight = readUsedSize(canvas, 'height');\n if (displayHeight !== undefined) {\n canvas.height = displayHeight;\n }\n }\n }\n return canvas;\n}\nconst eventListenerOptions = supportsEventListenerOptions ? {\n passive: true\n} : false;\nfunction addListener(node, type, listener) {\n node.addEventListener(type, listener, eventListenerOptions);\n}\nfunction removeListener(chart, type, listener) {\n chart.canvas.removeEventListener(type, listener, eventListenerOptions);\n}\nfunction fromNativeEvent(event, chart) {\n const type = EVENT_TYPES[event.type] || event.type;\n const { x , y } = getRelativePosition(event, chart);\n return {\n type,\n chart,\n native: event,\n x: x !== undefined ? x : null,\n y: y !== undefined ? y : null\n };\n}\nfunction nodeListContains(nodeList, canvas) {\n for (const node of nodeList){\n if (node === canvas || node.contains(canvas)) {\n return true;\n }\n }\n}\nfunction createAttachObserver(chart, type, listener) {\n const canvas = chart.canvas;\n const observer = new MutationObserver((entries)=>{\n let trigger = false;\n for (const entry of entries){\n trigger = trigger || nodeListContains(entry.addedNodes, canvas);\n trigger = trigger && !nodeListContains(entry.removedNodes, canvas);\n }\n if (trigger) {\n listener();\n }\n });\n observer.observe(document, {\n childList: true,\n subtree: true\n });\n return observer;\n}\nfunction createDetachObserver(chart, type, listener) {\n const canvas = chart.canvas;\n const observer = new MutationObserver((entries)=>{\n let trigger = false;\n for (const entry of entries){\n trigger = trigger || nodeListContains(entry.removedNodes, canvas);\n trigger = trigger && !nodeListContains(entry.addedNodes, canvas);\n }\n if (trigger) {\n listener();\n }\n });\n observer.observe(document, {\n childList: true,\n subtree: true\n });\n return observer;\n}\nconst drpListeningCharts = new Map();\nlet oldDevicePixelRatio = 0;\nfunction onWindowResize() {\n const dpr = window.devicePixelRatio;\n if (dpr === oldDevicePixelRatio) {\n return;\n }\n oldDevicePixelRatio = dpr;\n drpListeningCharts.forEach((resize, chart)=>{\n if (chart.currentDevicePixelRatio !== dpr) {\n resize();\n }\n });\n}\nfunction listenDevicePixelRatioChanges(chart, resize) {\n if (!drpListeningCharts.size) {\n window.addEventListener('resize', onWindowResize);\n }\n drpListeningCharts.set(chart, resize);\n}\nfunction unlistenDevicePixelRatioChanges(chart) {\n drpListeningCharts.delete(chart);\n if (!drpListeningCharts.size) {\n window.removeEventListener('resize', onWindowResize);\n }\n}\nfunction createResizeObserver(chart, type, listener) {\n const canvas = chart.canvas;\n const container = canvas && _getParentNode(canvas);\n if (!container) {\n return;\n }\n const resize = throttled((width, height)=>{\n const w = container.clientWidth;\n listener(width, height);\n if (w < container.clientWidth) {\n listener();\n }\n }, window);\n const observer = new ResizeObserver((entries)=>{\n const entry = entries[0];\n const width = entry.contentRect.width;\n const height = entry.contentRect.height;\n if (width === 0 && height === 0) {\n return;\n }\n resize(width, height);\n });\n observer.observe(container);\n listenDevicePixelRatioChanges(chart, resize);\n return observer;\n}\nfunction releaseObserver(chart, type, observer) {\n if (observer) {\n observer.disconnect();\n }\n if (type === 'resize') {\n unlistenDevicePixelRatioChanges(chart);\n }\n}\nfunction createProxyAndListen(chart, type, listener) {\n const canvas = chart.canvas;\n const proxy = throttled((event)=>{\n if (chart.ctx !== null) {\n listener(fromNativeEvent(event, chart));\n }\n }, chart);\n addListener(canvas, type, proxy);\n return proxy;\n}\n class DomPlatform extends BasePlatform {\n acquireContext(canvas, aspectRatio) {\n const context = canvas && canvas.getContext && canvas.getContext('2d');\n if (context && context.canvas === canvas) {\n initCanvas(canvas, aspectRatio);\n return context;\n }\n return null;\n }\n releaseContext(context) {\n const canvas = context.canvas;\n if (!canvas[EXPANDO_KEY]) {\n return false;\n }\n const initial = canvas[EXPANDO_KEY].initial;\n [\n 'height',\n 'width'\n ].forEach((prop)=>{\n const value = initial[prop];\n if (isNullOrUndef(value)) {\n canvas.removeAttribute(prop);\n } else {\n canvas.setAttribute(prop, value);\n }\n });\n const style = initial.style || {};\n Object.keys(style).forEach((key)=>{\n canvas.style[key] = style[key];\n });\n canvas.width = canvas.width;\n delete canvas[EXPANDO_KEY];\n return true;\n }\n addEventListener(chart, type, listener) {\n this.removeEventListener(chart, type);\n const proxies = chart.$proxies || (chart.$proxies = {});\n const handlers = {\n attach: createAttachObserver,\n detach: createDetachObserver,\n resize: createResizeObserver\n };\n const handler = handlers[type] || createProxyAndListen;\n proxies[type] = handler(chart, type, listener);\n }\n removeEventListener(chart, type) {\n const proxies = chart.$proxies || (chart.$proxies = {});\n const proxy = proxies[type];\n if (!proxy) {\n return;\n }\n const handlers = {\n attach: releaseObserver,\n detach: releaseObserver,\n resize: releaseObserver\n };\n const handler = handlers[type] || removeListener;\n handler(chart, type, proxy);\n proxies[type] = undefined;\n }\n getDevicePixelRatio() {\n return window.devicePixelRatio;\n }\n getMaximumSize(canvas, width, height, aspectRatio) {\n return getMaximumSize(canvas, width, height, aspectRatio);\n }\n isAttached(canvas) {\n const container = _getParentNode(canvas);\n return !!(container && container.isConnected);\n }\n}\n\nfunction _detectPlatform(canvas) {\n if (!_isDomSupported() || typeof OffscreenCanvas !== 'undefined' && canvas instanceof OffscreenCanvas) {\n return BasicPlatform;\n }\n return DomPlatform;\n}\n\nclass Element {\n static defaults = {};\n static defaultRoutes = undefined;\n x;\n y;\n active = false;\n options;\n $animations;\n tooltipPosition(useFinalPosition) {\n const { x , y } = this.getProps([\n 'x',\n 'y'\n ], useFinalPosition);\n return {\n x,\n y\n };\n }\n hasValue() {\n return isNumber(this.x) && isNumber(this.y);\n }\n getProps(props, final) {\n const anims = this.$animations;\n if (!final || !anims) {\n // let's not create an object, if not needed\n return this;\n }\n const ret = {};\n props.forEach((prop)=>{\n ret[prop] = anims[prop] && anims[prop].active() ? anims[prop]._to : this[prop];\n });\n return ret;\n }\n}\n\nfunction autoSkip(scale, ticks) {\n const tickOpts = scale.options.ticks;\n const determinedMaxTicks = determineMaxTicks(scale);\n const ticksLimit = Math.min(tickOpts.maxTicksLimit || determinedMaxTicks, determinedMaxTicks);\n const majorIndices = tickOpts.major.enabled ? getMajorIndices(ticks) : [];\n const numMajorIndices = majorIndices.length;\n const first = majorIndices[0];\n const last = majorIndices[numMajorIndices - 1];\n const newTicks = [];\n if (numMajorIndices > ticksLimit) {\n skipMajors(ticks, newTicks, majorIndices, numMajorIndices / ticksLimit);\n return newTicks;\n }\n const spacing = calculateSpacing(majorIndices, ticks, ticksLimit);\n if (numMajorIndices > 0) {\n let i, ilen;\n const avgMajorSpacing = numMajorIndices > 1 ? Math.round((last - first) / (numMajorIndices - 1)) : null;\n skip(ticks, newTicks, spacing, isNullOrUndef(avgMajorSpacing) ? 0 : first - avgMajorSpacing, first);\n for(i = 0, ilen = numMajorIndices - 1; i < ilen; i++){\n skip(ticks, newTicks, spacing, majorIndices[i], majorIndices[i + 1]);\n }\n skip(ticks, newTicks, spacing, last, isNullOrUndef(avgMajorSpacing) ? ticks.length : last + avgMajorSpacing);\n return newTicks;\n }\n skip(ticks, newTicks, spacing);\n return newTicks;\n}\nfunction determineMaxTicks(scale) {\n const offset = scale.options.offset;\n const tickLength = scale._tickSize();\n const maxScale = scale._length / tickLength + (offset ? 0 : 1);\n const maxChart = scale._maxLength / tickLength;\n return Math.floor(Math.min(maxScale, maxChart));\n}\n function calculateSpacing(majorIndices, ticks, ticksLimit) {\n const evenMajorSpacing = getEvenSpacing(majorIndices);\n const spacing = ticks.length / ticksLimit;\n if (!evenMajorSpacing) {\n return Math.max(spacing, 1);\n }\n const factors = _factorize(evenMajorSpacing);\n for(let i = 0, ilen = factors.length - 1; i < ilen; i++){\n const factor = factors[i];\n if (factor > spacing) {\n return factor;\n }\n }\n return Math.max(spacing, 1);\n}\n function getMajorIndices(ticks) {\n const result = [];\n let i, ilen;\n for(i = 0, ilen = ticks.length; i < ilen; i++){\n if (ticks[i].major) {\n result.push(i);\n }\n }\n return result;\n}\n function skipMajors(ticks, newTicks, majorIndices, spacing) {\n let count = 0;\n let next = majorIndices[0];\n let i;\n spacing = Math.ceil(spacing);\n for(i = 0; i < ticks.length; i++){\n if (i === next) {\n newTicks.push(ticks[i]);\n count++;\n next = majorIndices[count * spacing];\n }\n }\n}\n function skip(ticks, newTicks, spacing, majorStart, majorEnd) {\n const start = valueOrDefault(majorStart, 0);\n const end = Math.min(valueOrDefault(majorEnd, ticks.length), ticks.length);\n let count = 0;\n let length, i, next;\n spacing = Math.ceil(spacing);\n if (majorEnd) {\n length = majorEnd - majorStart;\n spacing = length / Math.floor(length / spacing);\n }\n next = start;\n while(next < 0){\n count++;\n next = Math.round(start + count * spacing);\n }\n for(i = Math.max(start, 0); i < end; i++){\n if (i === next) {\n newTicks.push(ticks[i]);\n count++;\n next = Math.round(start + count * spacing);\n }\n }\n}\n function getEvenSpacing(arr) {\n const len = arr.length;\n let i, diff;\n if (len < 2) {\n return false;\n }\n for(diff = arr[0], i = 1; i < len; ++i){\n if (arr[i] - arr[i - 1] !== diff) {\n return false;\n }\n }\n return diff;\n}\n\nconst reverseAlign = (align)=>align === 'left' ? 'right' : align === 'right' ? 'left' : align;\nconst offsetFromEdge = (scale, edge, offset)=>edge === 'top' || edge === 'left' ? scale[edge] + offset : scale[edge] - offset;\nconst getTicksLimit = (ticksLength, maxTicksLimit)=>Math.min(maxTicksLimit || ticksLength, ticksLength);\n function sample(arr, numItems) {\n const result = [];\n const increment = arr.length / numItems;\n const len = arr.length;\n let i = 0;\n for(; i < len; i += increment){\n result.push(arr[Math.floor(i)]);\n }\n return result;\n}\n function getPixelForGridLine(scale, index, offsetGridLines) {\n const length = scale.ticks.length;\n const validIndex = Math.min(index, length - 1);\n const start = scale._startPixel;\n const end = scale._endPixel;\n const epsilon = 1e-6;\n let lineValue = scale.getPixelForTick(validIndex);\n let offset;\n if (offsetGridLines) {\n if (length === 1) {\n offset = Math.max(lineValue - start, end - lineValue);\n } else if (index === 0) {\n offset = (scale.getPixelForTick(1) - lineValue) / 2;\n } else {\n offset = (lineValue - scale.getPixelForTick(validIndex - 1)) / 2;\n }\n lineValue += validIndex < index ? offset : -offset;\n if (lineValue < start - epsilon || lineValue > end + epsilon) {\n return;\n }\n }\n return lineValue;\n}\n function garbageCollect(caches, length) {\n each(caches, (cache)=>{\n const gc = cache.gc;\n const gcLen = gc.length / 2;\n let i;\n if (gcLen > length) {\n for(i = 0; i < gcLen; ++i){\n delete cache.data[gc[i]];\n }\n gc.splice(0, gcLen);\n }\n });\n}\n function getTickMarkLength(options) {\n return options.drawTicks ? options.tickLength : 0;\n}\n function getTitleHeight(options, fallback) {\n if (!options.display) {\n return 0;\n }\n const font = toFont(options.font, fallback);\n const padding = toPadding(options.padding);\n const lines = isArray(options.text) ? options.text.length : 1;\n return lines * font.lineHeight + padding.height;\n}\nfunction createScaleContext(parent, scale) {\n return createContext(parent, {\n scale,\n type: 'scale'\n });\n}\nfunction createTickContext(parent, index, tick) {\n return createContext(parent, {\n tick,\n index,\n type: 'tick'\n });\n}\nfunction titleAlign(align, position, reverse) {\n let ret = _toLeftRightCenter(align);\n if (reverse && position !== 'right' || !reverse && position === 'right') {\n ret = reverseAlign(ret);\n }\n return ret;\n}\nfunction titleArgs(scale, offset, position, align) {\n const { top , left , bottom , right , chart } = scale;\n const { chartArea , scales } = chart;\n let rotation = 0;\n let maxWidth, titleX, titleY;\n const height = bottom - top;\n const width = right - left;\n if (scale.isHorizontal()) {\n titleX = _alignStartEnd(align, left, right);\n if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n titleY = scales[positionAxisID].getPixelForValue(value) + height - offset;\n } else if (position === 'center') {\n titleY = (chartArea.bottom + chartArea.top) / 2 + height - offset;\n } else {\n titleY = offsetFromEdge(scale, position, offset);\n }\n maxWidth = right - left;\n } else {\n if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n titleX = scales[positionAxisID].getPixelForValue(value) - width + offset;\n } else if (position === 'center') {\n titleX = (chartArea.left + chartArea.right) / 2 - width + offset;\n } else {\n titleX = offsetFromEdge(scale, position, offset);\n }\n titleY = _alignStartEnd(align, bottom, top);\n rotation = position === 'left' ? -HALF_PI : HALF_PI;\n }\n return {\n titleX,\n titleY,\n maxWidth,\n rotation\n };\n}\nclass Scale extends Element {\n constructor(cfg){\n super();\n this.id = cfg.id;\n this.type = cfg.type;\n this.options = undefined;\n this.ctx = cfg.ctx;\n this.chart = cfg.chart;\n this.top = undefined;\n this.bottom = undefined;\n this.left = undefined;\n this.right = undefined;\n this.width = undefined;\n this.height = undefined;\n this._margins = {\n left: 0,\n right: 0,\n top: 0,\n bottom: 0\n };\n this.maxWidth = undefined;\n this.maxHeight = undefined;\n this.paddingTop = undefined;\n this.paddingBottom = undefined;\n this.paddingLeft = undefined;\n this.paddingRight = undefined;\n this.axis = undefined;\n this.labelRotation = undefined;\n this.min = undefined;\n this.max = undefined;\n this._range = undefined;\n this.ticks = [];\n this._gridLineItems = null;\n this._labelItems = null;\n this._labelSizes = null;\n this._length = 0;\n this._maxLength = 0;\n this._longestTextCache = {};\n this._startPixel = undefined;\n this._endPixel = undefined;\n this._reversePixels = false;\n this._userMax = undefined;\n this._userMin = undefined;\n this._suggestedMax = undefined;\n this._suggestedMin = undefined;\n this._ticksLength = 0;\n this._borderValue = 0;\n this._cache = {};\n this._dataLimitsCached = false;\n this.$context = undefined;\n }\n init(options) {\n this.options = options.setContext(this.getContext());\n this.axis = options.axis;\n this._userMin = this.parse(options.min);\n this._userMax = this.parse(options.max);\n this._suggestedMin = this.parse(options.suggestedMin);\n this._suggestedMax = this.parse(options.suggestedMax);\n }\n parse(raw, index) {\n return raw;\n }\n getUserBounds() {\n let { _userMin , _userMax , _suggestedMin , _suggestedMax } = this;\n _userMin = finiteOrDefault(_userMin, Number.POSITIVE_INFINITY);\n _userMax = finiteOrDefault(_userMax, Number.NEGATIVE_INFINITY);\n _suggestedMin = finiteOrDefault(_suggestedMin, Number.POSITIVE_INFINITY);\n _suggestedMax = finiteOrDefault(_suggestedMax, Number.NEGATIVE_INFINITY);\n return {\n min: finiteOrDefault(_userMin, _suggestedMin),\n max: finiteOrDefault(_userMax, _suggestedMax),\n minDefined: isNumberFinite(_userMin),\n maxDefined: isNumberFinite(_userMax)\n };\n }\n getMinMax(canStack) {\n let { min , max , minDefined , maxDefined } = this.getUserBounds();\n let range;\n if (minDefined && maxDefined) {\n return {\n min,\n max\n };\n }\n const metas = this.getMatchingVisibleMetas();\n for(let i = 0, ilen = metas.length; i < ilen; ++i){\n range = metas[i].controller.getMinMax(this, canStack);\n if (!minDefined) {\n min = Math.min(min, range.min);\n }\n if (!maxDefined) {\n max = Math.max(max, range.max);\n }\n }\n min = maxDefined && min > max ? max : min;\n max = minDefined && min > max ? min : max;\n return {\n min: finiteOrDefault(min, finiteOrDefault(max, min)),\n max: finiteOrDefault(max, finiteOrDefault(min, max))\n };\n }\n getPadding() {\n return {\n left: this.paddingLeft || 0,\n top: this.paddingTop || 0,\n right: this.paddingRight || 0,\n bottom: this.paddingBottom || 0\n };\n }\n getTicks() {\n return this.ticks;\n }\n getLabels() {\n const data = this.chart.data;\n return this.options.labels || (this.isHorizontal() ? data.xLabels : data.yLabels) || data.labels || [];\n }\n getLabelItems(chartArea = this.chart.chartArea) {\n const items = this._labelItems || (this._labelItems = this._computeLabelItems(chartArea));\n return items;\n }\n beforeLayout() {\n this._cache = {};\n this._dataLimitsCached = false;\n }\n beforeUpdate() {\n callback(this.options.beforeUpdate, [\n this\n ]);\n }\n update(maxWidth, maxHeight, margins) {\n const { beginAtZero , grace , ticks: tickOpts } = this.options;\n const sampleSize = tickOpts.sampleSize;\n this.beforeUpdate();\n this.maxWidth = maxWidth;\n this.maxHeight = maxHeight;\n this._margins = margins = Object.assign({\n left: 0,\n right: 0,\n top: 0,\n bottom: 0\n }, margins);\n this.ticks = null;\n this._labelSizes = null;\n this._gridLineItems = null;\n this._labelItems = null;\n this.beforeSetDimensions();\n this.setDimensions();\n this.afterSetDimensions();\n this._maxLength = this.isHorizontal() ? this.width + margins.left + margins.right : this.height + margins.top + margins.bottom;\n if (!this._dataLimitsCached) {\n this.beforeDataLimits();\n this.determineDataLimits();\n this.afterDataLimits();\n this._range = _addGrace(this, grace, beginAtZero);\n this._dataLimitsCached = true;\n }\n this.beforeBuildTicks();\n this.ticks = this.buildTicks() || [];\n this.afterBuildTicks();\n const samplingEnabled = sampleSize < this.ticks.length;\n this._convertTicksToLabels(samplingEnabled ? sample(this.ticks, sampleSize) : this.ticks);\n this.configure();\n this.beforeCalculateLabelRotation();\n this.calculateLabelRotation();\n this.afterCalculateLabelRotation();\n if (tickOpts.display && (tickOpts.autoSkip || tickOpts.source === 'auto')) {\n this.ticks = autoSkip(this, this.ticks);\n this._labelSizes = null;\n this.afterAutoSkip();\n }\n if (samplingEnabled) {\n this._convertTicksToLabels(this.ticks);\n }\n this.beforeFit();\n this.fit();\n this.afterFit();\n this.afterUpdate();\n }\n configure() {\n let reversePixels = this.options.reverse;\n let startPixel, endPixel;\n if (this.isHorizontal()) {\n startPixel = this.left;\n endPixel = this.right;\n } else {\n startPixel = this.top;\n endPixel = this.bottom;\n reversePixels = !reversePixels;\n }\n this._startPixel = startPixel;\n this._endPixel = endPixel;\n this._reversePixels = reversePixels;\n this._length = endPixel - startPixel;\n this._alignToPixels = this.options.alignToPixels;\n }\n afterUpdate() {\n callback(this.options.afterUpdate, [\n this\n ]);\n }\n beforeSetDimensions() {\n callback(this.options.beforeSetDimensions, [\n this\n ]);\n }\n setDimensions() {\n if (this.isHorizontal()) {\n this.width = this.maxWidth;\n this.left = 0;\n this.right = this.width;\n } else {\n this.height = this.maxHeight;\n this.top = 0;\n this.bottom = this.height;\n }\n this.paddingLeft = 0;\n this.paddingTop = 0;\n this.paddingRight = 0;\n this.paddingBottom = 0;\n }\n afterSetDimensions() {\n callback(this.options.afterSetDimensions, [\n this\n ]);\n }\n _callHooks(name) {\n this.chart.notifyPlugins(name, this.getContext());\n callback(this.options[name], [\n this\n ]);\n }\n beforeDataLimits() {\n this._callHooks('beforeDataLimits');\n }\n determineDataLimits() {}\n afterDataLimits() {\n this._callHooks('afterDataLimits');\n }\n beforeBuildTicks() {\n this._callHooks('beforeBuildTicks');\n }\n buildTicks() {\n return [];\n }\n afterBuildTicks() {\n this._callHooks('afterBuildTicks');\n }\n beforeTickToLabelConversion() {\n callback(this.options.beforeTickToLabelConversion, [\n this\n ]);\n }\n generateTickLabels(ticks) {\n const tickOpts = this.options.ticks;\n let i, ilen, tick;\n for(i = 0, ilen = ticks.length; i < ilen; i++){\n tick = ticks[i];\n tick.label = callback(tickOpts.callback, [\n tick.value,\n i,\n ticks\n ], this);\n }\n }\n afterTickToLabelConversion() {\n callback(this.options.afterTickToLabelConversion, [\n this\n ]);\n }\n beforeCalculateLabelRotation() {\n callback(this.options.beforeCalculateLabelRotation, [\n this\n ]);\n }\n calculateLabelRotation() {\n const options = this.options;\n const tickOpts = options.ticks;\n const numTicks = getTicksLimit(this.ticks.length, options.ticks.maxTicksLimit);\n const minRotation = tickOpts.minRotation || 0;\n const maxRotation = tickOpts.maxRotation;\n let labelRotation = minRotation;\n let tickWidth, maxHeight, maxLabelDiagonal;\n if (!this._isVisible() || !tickOpts.display || minRotation >= maxRotation || numTicks <= 1 || !this.isHorizontal()) {\n this.labelRotation = minRotation;\n return;\n }\n const labelSizes = this._getLabelSizes();\n const maxLabelWidth = labelSizes.widest.width;\n const maxLabelHeight = labelSizes.highest.height;\n const maxWidth = _limitValue(this.chart.width - maxLabelWidth, 0, this.maxWidth);\n tickWidth = options.offset ? this.maxWidth / numTicks : maxWidth / (numTicks - 1);\n if (maxLabelWidth + 6 > tickWidth) {\n tickWidth = maxWidth / (numTicks - (options.offset ? 0.5 : 1));\n maxHeight = this.maxHeight - getTickMarkLength(options.grid) - tickOpts.padding - getTitleHeight(options.title, this.chart.options.font);\n maxLabelDiagonal = Math.sqrt(maxLabelWidth * maxLabelWidth + maxLabelHeight * maxLabelHeight);\n 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))));\n labelRotation = Math.max(minRotation, Math.min(maxRotation, labelRotation));\n }\n this.labelRotation = labelRotation;\n }\n afterCalculateLabelRotation() {\n callback(this.options.afterCalculateLabelRotation, [\n this\n ]);\n }\n afterAutoSkip() {}\n beforeFit() {\n callback(this.options.beforeFit, [\n this\n ]);\n }\n fit() {\n const minSize = {\n width: 0,\n height: 0\n };\n const { chart , options: { ticks: tickOpts , title: titleOpts , grid: gridOpts } } = this;\n const display = this._isVisible();\n const isHorizontal = this.isHorizontal();\n if (display) {\n const titleHeight = getTitleHeight(titleOpts, chart.options.font);\n if (isHorizontal) {\n minSize.width = this.maxWidth;\n minSize.height = getTickMarkLength(gridOpts) + titleHeight;\n } else {\n minSize.height = this.maxHeight;\n minSize.width = getTickMarkLength(gridOpts) + titleHeight;\n }\n if (tickOpts.display && this.ticks.length) {\n const { first , last , widest , highest } = this._getLabelSizes();\n const tickPadding = tickOpts.padding * 2;\n const angleRadians = toRadians(this.labelRotation);\n const cos = Math.cos(angleRadians);\n const sin = Math.sin(angleRadians);\n if (isHorizontal) {\n const labelHeight = tickOpts.mirror ? 0 : sin * widest.width + cos * highest.height;\n minSize.height = Math.min(this.maxHeight, minSize.height + labelHeight + tickPadding);\n } else {\n const labelWidth = tickOpts.mirror ? 0 : cos * widest.width + sin * highest.height;\n minSize.width = Math.min(this.maxWidth, minSize.width + labelWidth + tickPadding);\n }\n this._calculatePadding(first, last, sin, cos);\n }\n }\n this._handleMargins();\n if (isHorizontal) {\n this.width = this._length = chart.width - this._margins.left - this._margins.right;\n this.height = minSize.height;\n } else {\n this.width = minSize.width;\n this.height = this._length = chart.height - this._margins.top - this._margins.bottom;\n }\n }\n _calculatePadding(first, last, sin, cos) {\n const { ticks: { align , padding } , position } = this.options;\n const isRotated = this.labelRotation !== 0;\n const labelsBelowTicks = position !== 'top' && this.axis === 'x';\n if (this.isHorizontal()) {\n const offsetLeft = this.getPixelForTick(0) - this.left;\n const offsetRight = this.right - this.getPixelForTick(this.ticks.length - 1);\n let paddingLeft = 0;\n let paddingRight = 0;\n if (isRotated) {\n if (labelsBelowTicks) {\n paddingLeft = cos * first.width;\n paddingRight = sin * last.height;\n } else {\n paddingLeft = sin * first.height;\n paddingRight = cos * last.width;\n }\n } else if (align === 'start') {\n paddingRight = last.width;\n } else if (align === 'end') {\n paddingLeft = first.width;\n } else if (align !== 'inner') {\n paddingLeft = first.width / 2;\n paddingRight = last.width / 2;\n }\n this.paddingLeft = Math.max((paddingLeft - offsetLeft + padding) * this.width / (this.width - offsetLeft), 0);\n this.paddingRight = Math.max((paddingRight - offsetRight + padding) * this.width / (this.width - offsetRight), 0);\n } else {\n let paddingTop = last.height / 2;\n let paddingBottom = first.height / 2;\n if (align === 'start') {\n paddingTop = 0;\n paddingBottom = first.height;\n } else if (align === 'end') {\n paddingTop = last.height;\n paddingBottom = 0;\n }\n this.paddingTop = paddingTop + padding;\n this.paddingBottom = paddingBottom + padding;\n }\n }\n _handleMargins() {\n if (this._margins) {\n this._margins.left = Math.max(this.paddingLeft, this._margins.left);\n this._margins.top = Math.max(this.paddingTop, this._margins.top);\n this._margins.right = Math.max(this.paddingRight, this._margins.right);\n this._margins.bottom = Math.max(this.paddingBottom, this._margins.bottom);\n }\n }\n afterFit() {\n callback(this.options.afterFit, [\n this\n ]);\n }\n isHorizontal() {\n const { axis , position } = this.options;\n return position === 'top' || position === 'bottom' || axis === 'x';\n }\n isFullSize() {\n return this.options.fullSize;\n }\n _convertTicksToLabels(ticks) {\n this.beforeTickToLabelConversion();\n this.generateTickLabels(ticks);\n let i, ilen;\n for(i = 0, ilen = ticks.length; i < ilen; i++){\n if (isNullOrUndef(ticks[i].label)) {\n ticks.splice(i, 1);\n ilen--;\n i--;\n }\n }\n this.afterTickToLabelConversion();\n }\n _getLabelSizes() {\n let labelSizes = this._labelSizes;\n if (!labelSizes) {\n const sampleSize = this.options.ticks.sampleSize;\n let ticks = this.ticks;\n if (sampleSize < ticks.length) {\n ticks = sample(ticks, sampleSize);\n }\n this._labelSizes = labelSizes = this._computeLabelSizes(ticks, ticks.length, this.options.ticks.maxTicksLimit);\n }\n return labelSizes;\n }\n _computeLabelSizes(ticks, length, maxTicksLimit) {\n const { ctx , _longestTextCache: caches } = this;\n const widths = [];\n const heights = [];\n const increment = Math.floor(length / getTicksLimit(length, maxTicksLimit));\n let widestLabelSize = 0;\n let highestLabelSize = 0;\n let i, j, jlen, label, tickFont, fontString, cache, lineHeight, width, height, nestedLabel;\n for(i = 0; i < length; i += increment){\n label = ticks[i].label;\n tickFont = this._resolveTickFontOptions(i);\n ctx.font = fontString = tickFont.string;\n cache = caches[fontString] = caches[fontString] || {\n data: {},\n gc: []\n };\n lineHeight = tickFont.lineHeight;\n width = height = 0;\n if (!isNullOrUndef(label) && !isArray(label)) {\n width = _measureText(ctx, cache.data, cache.gc, width, label);\n height = lineHeight;\n } else if (isArray(label)) {\n for(j = 0, jlen = label.length; j < jlen; ++j){\n nestedLabel = label[j];\n if (!isNullOrUndef(nestedLabel) && !isArray(nestedLabel)) {\n width = _measureText(ctx, cache.data, cache.gc, width, nestedLabel);\n height += lineHeight;\n }\n }\n }\n widths.push(width);\n heights.push(height);\n widestLabelSize = Math.max(width, widestLabelSize);\n highestLabelSize = Math.max(height, highestLabelSize);\n }\n garbageCollect(caches, length);\n const widest = widths.indexOf(widestLabelSize);\n const highest = heights.indexOf(highestLabelSize);\n const valueAt = (idx)=>({\n width: widths[idx] || 0,\n height: heights[idx] || 0\n });\n return {\n first: valueAt(0),\n last: valueAt(length - 1),\n widest: valueAt(widest),\n highest: valueAt(highest),\n widths,\n heights\n };\n }\n getLabelForValue(value) {\n return value;\n }\n getPixelForValue(value, index) {\n return NaN;\n }\n getValueForPixel(pixel) {}\n getPixelForTick(index) {\n const ticks = this.ticks;\n if (index < 0 || index > ticks.length - 1) {\n return null;\n }\n return this.getPixelForValue(ticks[index].value);\n }\n getPixelForDecimal(decimal) {\n if (this._reversePixels) {\n decimal = 1 - decimal;\n }\n const pixel = this._startPixel + decimal * this._length;\n return _int16Range(this._alignToPixels ? _alignPixel(this.chart, pixel, 0) : pixel);\n }\n getDecimalForPixel(pixel) {\n const decimal = (pixel - this._startPixel) / this._length;\n return this._reversePixels ? 1 - decimal : decimal;\n }\n getBasePixel() {\n return this.getPixelForValue(this.getBaseValue());\n }\n getBaseValue() {\n const { min , max } = this;\n return min < 0 && max < 0 ? max : min > 0 && max > 0 ? min : 0;\n }\n getContext(index) {\n const ticks = this.ticks || [];\n if (index >= 0 && index < ticks.length) {\n const tick = ticks[index];\n return tick.$context || (tick.$context = createTickContext(this.getContext(), index, tick));\n }\n return this.$context || (this.$context = createScaleContext(this.chart.getContext(), this));\n }\n _tickSize() {\n const optionTicks = this.options.ticks;\n const rot = toRadians(this.labelRotation);\n const cos = Math.abs(Math.cos(rot));\n const sin = Math.abs(Math.sin(rot));\n const labelSizes = this._getLabelSizes();\n const padding = optionTicks.autoSkipPadding || 0;\n const w = labelSizes ? labelSizes.widest.width + padding : 0;\n const h = labelSizes ? labelSizes.highest.height + padding : 0;\n return this.isHorizontal() ? h * cos > w * sin ? w / cos : h / sin : h * sin < w * cos ? h / cos : w / sin;\n }\n _isVisible() {\n const display = this.options.display;\n if (display !== 'auto') {\n return !!display;\n }\n return this.getMatchingVisibleMetas().length > 0;\n }\n _computeGridLineItems(chartArea) {\n const axis = this.axis;\n const chart = this.chart;\n const options = this.options;\n const { grid , position , border } = options;\n const offset = grid.offset;\n const isHorizontal = this.isHorizontal();\n const ticks = this.ticks;\n const ticksLength = ticks.length + (offset ? 1 : 0);\n const tl = getTickMarkLength(grid);\n const items = [];\n const borderOpts = border.setContext(this.getContext());\n const axisWidth = borderOpts.display ? borderOpts.width : 0;\n const axisHalfWidth = axisWidth / 2;\n const alignBorderValue = function(pixel) {\n return _alignPixel(chart, pixel, axisWidth);\n };\n let borderValue, i, lineValue, alignedLineValue;\n let tx1, ty1, tx2, ty2, x1, y1, x2, y2;\n if (position === 'top') {\n borderValue = alignBorderValue(this.bottom);\n ty1 = this.bottom - tl;\n ty2 = borderValue - axisHalfWidth;\n y1 = alignBorderValue(chartArea.top) + axisHalfWidth;\n y2 = chartArea.bottom;\n } else if (position === 'bottom') {\n borderValue = alignBorderValue(this.top);\n y1 = chartArea.top;\n y2 = alignBorderValue(chartArea.bottom) - axisHalfWidth;\n ty1 = borderValue + axisHalfWidth;\n ty2 = this.top + tl;\n } else if (position === 'left') {\n borderValue = alignBorderValue(this.right);\n tx1 = this.right - tl;\n tx2 = borderValue - axisHalfWidth;\n x1 = alignBorderValue(chartArea.left) + axisHalfWidth;\n x2 = chartArea.right;\n } else if (position === 'right') {\n borderValue = alignBorderValue(this.left);\n x1 = chartArea.left;\n x2 = alignBorderValue(chartArea.right) - axisHalfWidth;\n tx1 = borderValue + axisHalfWidth;\n tx2 = this.left + tl;\n } else if (axis === 'x') {\n if (position === 'center') {\n borderValue = alignBorderValue((chartArea.top + chartArea.bottom) / 2 + 0.5);\n } else if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n borderValue = alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value));\n }\n y1 = chartArea.top;\n y2 = chartArea.bottom;\n ty1 = borderValue + axisHalfWidth;\n ty2 = ty1 + tl;\n } else if (axis === 'y') {\n if (position === 'center') {\n borderValue = alignBorderValue((chartArea.left + chartArea.right) / 2);\n } else if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n borderValue = alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value));\n }\n tx1 = borderValue - axisHalfWidth;\n tx2 = tx1 - tl;\n x1 = chartArea.left;\n x2 = chartArea.right;\n }\n const limit = valueOrDefault(options.ticks.maxTicksLimit, ticksLength);\n const step = Math.max(1, Math.ceil(ticksLength / limit));\n for(i = 0; i < ticksLength; i += step){\n const context = this.getContext(i);\n const optsAtIndex = grid.setContext(context);\n const optsAtIndexBorder = border.setContext(context);\n const lineWidth = optsAtIndex.lineWidth;\n const lineColor = optsAtIndex.color;\n const borderDash = optsAtIndexBorder.dash || [];\n const borderDashOffset = optsAtIndexBorder.dashOffset;\n const tickWidth = optsAtIndex.tickWidth;\n const tickColor = optsAtIndex.tickColor;\n const tickBorderDash = optsAtIndex.tickBorderDash || [];\n const tickBorderDashOffset = optsAtIndex.tickBorderDashOffset;\n lineValue = getPixelForGridLine(this, i, offset);\n if (lineValue === undefined) {\n continue;\n }\n alignedLineValue = _alignPixel(chart, lineValue, lineWidth);\n if (isHorizontal) {\n tx1 = tx2 = x1 = x2 = alignedLineValue;\n } else {\n ty1 = ty2 = y1 = y2 = alignedLineValue;\n }\n items.push({\n tx1,\n ty1,\n tx2,\n ty2,\n x1,\n y1,\n x2,\n y2,\n width: lineWidth,\n color: lineColor,\n borderDash,\n borderDashOffset,\n tickWidth,\n tickColor,\n tickBorderDash,\n tickBorderDashOffset\n });\n }\n this._ticksLength = ticksLength;\n this._borderValue = borderValue;\n return items;\n }\n _computeLabelItems(chartArea) {\n const axis = this.axis;\n const options = this.options;\n const { position , ticks: optionTicks } = options;\n const isHorizontal = this.isHorizontal();\n const ticks = this.ticks;\n const { align , crossAlign , padding , mirror } = optionTicks;\n const tl = getTickMarkLength(options.grid);\n const tickAndPadding = tl + padding;\n const hTickAndPadding = mirror ? -padding : tickAndPadding;\n const rotation = -toRadians(this.labelRotation);\n const items = [];\n let i, ilen, tick, label, x, y, textAlign, pixel, font, lineHeight, lineCount, textOffset;\n let textBaseline = 'middle';\n if (position === 'top') {\n y = this.bottom - hTickAndPadding;\n textAlign = this._getXAxisLabelAlignment();\n } else if (position === 'bottom') {\n y = this.top + hTickAndPadding;\n textAlign = this._getXAxisLabelAlignment();\n } else if (position === 'left') {\n const ret = this._getYAxisLabelAlignment(tl);\n textAlign = ret.textAlign;\n x = ret.x;\n } else if (position === 'right') {\n const ret = this._getYAxisLabelAlignment(tl);\n textAlign = ret.textAlign;\n x = ret.x;\n } else if (axis === 'x') {\n if (position === 'center') {\n y = (chartArea.top + chartArea.bottom) / 2 + tickAndPadding;\n } else if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n y = this.chart.scales[positionAxisID].getPixelForValue(value) + tickAndPadding;\n }\n textAlign = this._getXAxisLabelAlignment();\n } else if (axis === 'y') {\n if (position === 'center') {\n x = (chartArea.left + chartArea.right) / 2 - tickAndPadding;\n } else if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n x = this.chart.scales[positionAxisID].getPixelForValue(value);\n }\n textAlign = this._getYAxisLabelAlignment(tl).textAlign;\n }\n if (axis === 'y') {\n if (align === 'start') {\n textBaseline = 'top';\n } else if (align === 'end') {\n textBaseline = 'bottom';\n }\n }\n const labelSizes = this._getLabelSizes();\n for(i = 0, ilen = ticks.length; i < ilen; ++i){\n tick = ticks[i];\n label = tick.label;\n const optsAtIndex = optionTicks.setContext(this.getContext(i));\n pixel = this.getPixelForTick(i) + optionTicks.labelOffset;\n font = this._resolveTickFontOptions(i);\n lineHeight = font.lineHeight;\n lineCount = isArray(label) ? label.length : 1;\n const halfCount = lineCount / 2;\n const color = optsAtIndex.color;\n const strokeColor = optsAtIndex.textStrokeColor;\n const strokeWidth = optsAtIndex.textStrokeWidth;\n let tickTextAlign = textAlign;\n if (isHorizontal) {\n x = pixel;\n if (textAlign === 'inner') {\n if (i === ilen - 1) {\n tickTextAlign = !this.options.reverse ? 'right' : 'left';\n } else if (i === 0) {\n tickTextAlign = !this.options.reverse ? 'left' : 'right';\n } else {\n tickTextAlign = 'center';\n }\n }\n if (position === 'top') {\n if (crossAlign === 'near' || rotation !== 0) {\n textOffset = -lineCount * lineHeight + lineHeight / 2;\n } else if (crossAlign === 'center') {\n textOffset = -labelSizes.highest.height / 2 - halfCount * lineHeight + lineHeight;\n } else {\n textOffset = -labelSizes.highest.height + lineHeight / 2;\n }\n } else {\n if (crossAlign === 'near' || rotation !== 0) {\n textOffset = lineHeight / 2;\n } else if (crossAlign === 'center') {\n textOffset = labelSizes.highest.height / 2 - halfCount * lineHeight;\n } else {\n textOffset = labelSizes.highest.height - lineCount * lineHeight;\n }\n }\n if (mirror) {\n textOffset *= -1;\n }\n if (rotation !== 0 && !optsAtIndex.showLabelBackdrop) {\n x += lineHeight / 2 * Math.sin(rotation);\n }\n } else {\n y = pixel;\n textOffset = (1 - lineCount) * lineHeight / 2;\n }\n let backdrop;\n if (optsAtIndex.showLabelBackdrop) {\n const labelPadding = toPadding(optsAtIndex.backdropPadding);\n const height = labelSizes.heights[i];\n const width = labelSizes.widths[i];\n let top = textOffset - labelPadding.top;\n let left = 0 - labelPadding.left;\n switch(textBaseline){\n case 'middle':\n top -= height / 2;\n break;\n case 'bottom':\n top -= height;\n break;\n }\n switch(textAlign){\n case 'center':\n left -= width / 2;\n break;\n case 'right':\n left -= width;\n break;\n }\n backdrop = {\n left,\n top,\n width: width + labelPadding.width,\n height: height + labelPadding.height,\n color: optsAtIndex.backdropColor\n };\n }\n items.push({\n label,\n font,\n textOffset,\n options: {\n rotation,\n color,\n strokeColor,\n strokeWidth,\n textAlign: tickTextAlign,\n textBaseline,\n translation: [\n x,\n y\n ],\n backdrop\n }\n });\n }\n return items;\n }\n _getXAxisLabelAlignment() {\n const { position , ticks } = this.options;\n const rotation = -toRadians(this.labelRotation);\n if (rotation) {\n return position === 'top' ? 'left' : 'right';\n }\n let align = 'center';\n if (ticks.align === 'start') {\n align = 'left';\n } else if (ticks.align === 'end') {\n align = 'right';\n } else if (ticks.align === 'inner') {\n align = 'inner';\n }\n return align;\n }\n _getYAxisLabelAlignment(tl) {\n const { position , ticks: { crossAlign , mirror , padding } } = this.options;\n const labelSizes = this._getLabelSizes();\n const tickAndPadding = tl + padding;\n const widest = labelSizes.widest.width;\n let textAlign;\n let x;\n if (position === 'left') {\n if (mirror) {\n x = this.right + padding;\n if (crossAlign === 'near') {\n textAlign = 'left';\n } else if (crossAlign === 'center') {\n textAlign = 'center';\n x += widest / 2;\n } else {\n textAlign = 'right';\n x += widest;\n }\n } else {\n x = this.right - tickAndPadding;\n if (crossAlign === 'near') {\n textAlign = 'right';\n } else if (crossAlign === 'center') {\n textAlign = 'center';\n x -= widest / 2;\n } else {\n textAlign = 'left';\n x = this.left;\n }\n }\n } else if (position === 'right') {\n if (mirror) {\n x = this.left + padding;\n if (crossAlign === 'near') {\n textAlign = 'right';\n } else if (crossAlign === 'center') {\n textAlign = 'center';\n x -= widest / 2;\n } else {\n textAlign = 'left';\n x -= widest;\n }\n } else {\n x = this.left + tickAndPadding;\n if (crossAlign === 'near') {\n textAlign = 'left';\n } else if (crossAlign === 'center') {\n textAlign = 'center';\n x += widest / 2;\n } else {\n textAlign = 'right';\n x = this.right;\n }\n }\n } else {\n textAlign = 'right';\n }\n return {\n textAlign,\n x\n };\n }\n _computeLabelArea() {\n if (this.options.ticks.mirror) {\n return;\n }\n const chart = this.chart;\n const position = this.options.position;\n if (position === 'left' || position === 'right') {\n return {\n top: 0,\n left: this.left,\n bottom: chart.height,\n right: this.right\n };\n }\n if (position === 'top' || position === 'bottom') {\n return {\n top: this.top,\n left: 0,\n bottom: this.bottom,\n right: chart.width\n };\n }\n }\n drawBackground() {\n const { ctx , options: { backgroundColor } , left , top , width , height } = this;\n if (backgroundColor) {\n ctx.save();\n ctx.fillStyle = backgroundColor;\n ctx.fillRect(left, top, width, height);\n ctx.restore();\n }\n }\n getLineWidthForValue(value) {\n const grid = this.options.grid;\n if (!this._isVisible() || !grid.display) {\n return 0;\n }\n const ticks = this.ticks;\n const index = ticks.findIndex((t)=>t.value === value);\n if (index >= 0) {\n const opts = grid.setContext(this.getContext(index));\n return opts.lineWidth;\n }\n return 0;\n }\n drawGrid(chartArea) {\n const grid = this.options.grid;\n const ctx = this.ctx;\n const items = this._gridLineItems || (this._gridLineItems = this._computeGridLineItems(chartArea));\n let i, ilen;\n const drawLine = (p1, p2, style)=>{\n if (!style.width || !style.color) {\n return;\n }\n ctx.save();\n ctx.lineWidth = style.width;\n ctx.strokeStyle = style.color;\n ctx.setLineDash(style.borderDash || []);\n ctx.lineDashOffset = style.borderDashOffset;\n ctx.beginPath();\n ctx.moveTo(p1.x, p1.y);\n ctx.lineTo(p2.x, p2.y);\n ctx.stroke();\n ctx.restore();\n };\n if (grid.display) {\n for(i = 0, ilen = items.length; i < ilen; ++i){\n const item = items[i];\n if (grid.drawOnChartArea) {\n drawLine({\n x: item.x1,\n y: item.y1\n }, {\n x: item.x2,\n y: item.y2\n }, item);\n }\n if (grid.drawTicks) {\n drawLine({\n x: item.tx1,\n y: item.ty1\n }, {\n x: item.tx2,\n y: item.ty2\n }, {\n color: item.tickColor,\n width: item.tickWidth,\n borderDash: item.tickBorderDash,\n borderDashOffset: item.tickBorderDashOffset\n });\n }\n }\n }\n }\n drawBorder() {\n const { chart , ctx , options: { border , grid } } = this;\n const borderOpts = border.setContext(this.getContext());\n const axisWidth = border.display ? borderOpts.width : 0;\n if (!axisWidth) {\n return;\n }\n const lastLineWidth = grid.setContext(this.getContext(0)).lineWidth;\n const borderValue = this._borderValue;\n let x1, x2, y1, y2;\n if (this.isHorizontal()) {\n x1 = _alignPixel(chart, this.left, axisWidth) - axisWidth / 2;\n x2 = _alignPixel(chart, this.right, lastLineWidth) + lastLineWidth / 2;\n y1 = y2 = borderValue;\n } else {\n y1 = _alignPixel(chart, this.top, axisWidth) - axisWidth / 2;\n y2 = _alignPixel(chart, this.bottom, lastLineWidth) + lastLineWidth / 2;\n x1 = x2 = borderValue;\n }\n ctx.save();\n ctx.lineWidth = borderOpts.width;\n ctx.strokeStyle = borderOpts.color;\n ctx.beginPath();\n ctx.moveTo(x1, y1);\n ctx.lineTo(x2, y2);\n ctx.stroke();\n ctx.restore();\n }\n drawLabels(chartArea) {\n const optionTicks = this.options.ticks;\n if (!optionTicks.display) {\n return;\n }\n const ctx = this.ctx;\n const area = this._computeLabelArea();\n if (area) {\n clipArea(ctx, area);\n }\n const items = this.getLabelItems(chartArea);\n for (const item of items){\n const renderTextOptions = item.options;\n const tickFont = item.font;\n const label = item.label;\n const y = item.textOffset;\n renderText(ctx, label, 0, y, tickFont, renderTextOptions);\n }\n if (area) {\n unclipArea(ctx);\n }\n }\n drawTitle() {\n const { ctx , options: { position , title , reverse } } = this;\n if (!title.display) {\n return;\n }\n const font = toFont(title.font);\n const padding = toPadding(title.padding);\n const align = title.align;\n let offset = font.lineHeight / 2;\n if (position === 'bottom' || position === 'center' || isObject(position)) {\n offset += padding.bottom;\n if (isArray(title.text)) {\n offset += font.lineHeight * (title.text.length - 1);\n }\n } else {\n offset += padding.top;\n }\n const { titleX , titleY , maxWidth , rotation } = titleArgs(this, offset, position, align);\n renderText(ctx, title.text, 0, 0, font, {\n color: title.color,\n maxWidth,\n rotation,\n textAlign: titleAlign(align, position, reverse),\n textBaseline: 'middle',\n translation: [\n titleX,\n titleY\n ]\n });\n }\n draw(chartArea) {\n if (!this._isVisible()) {\n return;\n }\n this.drawBackground();\n this.drawGrid(chartArea);\n this.drawBorder();\n this.drawTitle();\n this.drawLabels(chartArea);\n }\n _layers() {\n const opts = this.options;\n const tz = opts.ticks && opts.ticks.z || 0;\n const gz = valueOrDefault(opts.grid && opts.grid.z, -1);\n const bz = valueOrDefault(opts.border && opts.border.z, 0);\n if (!this._isVisible() || this.draw !== Scale.prototype.draw) {\n return [\n {\n z: tz,\n draw: (chartArea)=>{\n this.draw(chartArea);\n }\n }\n ];\n }\n return [\n {\n z: gz,\n draw: (chartArea)=>{\n this.drawBackground();\n this.drawGrid(chartArea);\n this.drawTitle();\n }\n },\n {\n z: bz,\n draw: ()=>{\n this.drawBorder();\n }\n },\n {\n z: tz,\n draw: (chartArea)=>{\n this.drawLabels(chartArea);\n }\n }\n ];\n }\n getMatchingVisibleMetas(type) {\n const metas = this.chart.getSortedVisibleDatasetMetas();\n const axisID = this.axis + 'AxisID';\n const result = [];\n let i, ilen;\n for(i = 0, ilen = metas.length; i < ilen; ++i){\n const meta = metas[i];\n if (meta[axisID] === this.id && (!type || meta.type === type)) {\n result.push(meta);\n }\n }\n return result;\n }\n _resolveTickFontOptions(index) {\n const opts = this.options.ticks.setContext(this.getContext(index));\n return toFont(opts.font);\n }\n _maxDigits() {\n const fontSize = this._resolveTickFontOptions(0).lineHeight;\n return (this.isHorizontal() ? this.width : this.height) / fontSize;\n }\n}\n\nclass TypedRegistry {\n constructor(type, scope, override){\n this.type = type;\n this.scope = scope;\n this.override = override;\n this.items = Object.create(null);\n }\n isForType(type) {\n return Object.prototype.isPrototypeOf.call(this.type.prototype, type.prototype);\n }\n register(item) {\n const proto = Object.getPrototypeOf(item);\n let parentScope;\n if (isIChartComponent(proto)) {\n parentScope = this.register(proto);\n }\n const items = this.items;\n const id = item.id;\n const scope = this.scope + '.' + id;\n if (!id) {\n throw new Error('class does not have id: ' + item);\n }\n if (id in items) {\n return scope;\n }\n items[id] = item;\n registerDefaults(item, scope, parentScope);\n if (this.override) {\n defaults.override(item.id, item.overrides);\n }\n return scope;\n }\n get(id) {\n return this.items[id];\n }\n unregister(item) {\n const items = this.items;\n const id = item.id;\n const scope = this.scope;\n if (id in items) {\n delete items[id];\n }\n if (scope && id in defaults[scope]) {\n delete defaults[scope][id];\n if (this.override) {\n delete overrides[id];\n }\n }\n }\n}\nfunction registerDefaults(item, scope, parentScope) {\n const itemDefaults = merge(Object.create(null), [\n parentScope ? defaults.get(parentScope) : {},\n defaults.get(scope),\n item.defaults\n ]);\n defaults.set(scope, itemDefaults);\n if (item.defaultRoutes) {\n routeDefaults(scope, item.defaultRoutes);\n }\n if (item.descriptors) {\n defaults.describe(scope, item.descriptors);\n }\n}\nfunction routeDefaults(scope, routes) {\n Object.keys(routes).forEach((property)=>{\n const propertyParts = property.split('.');\n const sourceName = propertyParts.pop();\n const sourceScope = [\n scope\n ].concat(propertyParts).join('.');\n const parts = routes[property].split('.');\n const targetName = parts.pop();\n const targetScope = parts.join('.');\n defaults.route(sourceScope, sourceName, targetScope, targetName);\n });\n}\nfunction isIChartComponent(proto) {\n return 'id' in proto && 'defaults' in proto;\n}\n\nclass Registry {\n constructor(){\n this.controllers = new TypedRegistry(DatasetController, 'datasets', true);\n this.elements = new TypedRegistry(Element, 'elements');\n this.plugins = new TypedRegistry(Object, 'plugins');\n this.scales = new TypedRegistry(Scale, 'scales');\n this._typedRegistries = [\n this.controllers,\n this.scales,\n this.elements\n ];\n }\n add(...args) {\n this._each('register', args);\n }\n remove(...args) {\n this._each('unregister', args);\n }\n addControllers(...args) {\n this._each('register', args, this.controllers);\n }\n addElements(...args) {\n this._each('register', args, this.elements);\n }\n addPlugins(...args) {\n this._each('register', args, this.plugins);\n }\n addScales(...args) {\n this._each('register', args, this.scales);\n }\n getController(id) {\n return this._get(id, this.controllers, 'controller');\n }\n getElement(id) {\n return this._get(id, this.elements, 'element');\n }\n getPlugin(id) {\n return this._get(id, this.plugins, 'plugin');\n }\n getScale(id) {\n return this._get(id, this.scales, 'scale');\n }\n removeControllers(...args) {\n this._each('unregister', args, this.controllers);\n }\n removeElements(...args) {\n this._each('unregister', args, this.elements);\n }\n removePlugins(...args) {\n this._each('unregister', args, this.plugins);\n }\n removeScales(...args) {\n this._each('unregister', args, this.scales);\n }\n _each(method, args, typedRegistry) {\n [\n ...args\n ].forEach((arg)=>{\n const reg = typedRegistry || this._getRegistryForType(arg);\n if (typedRegistry || reg.isForType(arg) || reg === this.plugins && arg.id) {\n this._exec(method, reg, arg);\n } else {\n each(arg, (item)=>{\n const itemReg = typedRegistry || this._getRegistryForType(item);\n this._exec(method, itemReg, item);\n });\n }\n });\n }\n _exec(method, registry, component) {\n const camelMethod = _capitalize(method);\n callback(component['before' + camelMethod], [], component);\n registry[method](component);\n callback(component['after' + camelMethod], [], component);\n }\n _getRegistryForType(type) {\n for(let i = 0; i < this._typedRegistries.length; i++){\n const reg = this._typedRegistries[i];\n if (reg.isForType(type)) {\n return reg;\n }\n }\n return this.plugins;\n }\n _get(id, typedRegistry, type) {\n const item = typedRegistry.get(id);\n if (item === undefined) {\n throw new Error('\"' + id + '\" is not a registered ' + type + '.');\n }\n return item;\n }\n}\nvar registry = /* #__PURE__ */ new Registry();\n\nclass PluginService {\n constructor(){\n this._init = [];\n }\n notify(chart, hook, args, filter) {\n if (hook === 'beforeInit') {\n this._init = this._createDescriptors(chart, true);\n this._notify(this._init, chart, 'install');\n }\n const descriptors = filter ? this._descriptors(chart).filter(filter) : this._descriptors(chart);\n const result = this._notify(descriptors, chart, hook, args);\n if (hook === 'afterDestroy') {\n this._notify(descriptors, chart, 'stop');\n this._notify(this._init, chart, 'uninstall');\n }\n return result;\n }\n _notify(descriptors, chart, hook, args) {\n args = args || {};\n for (const descriptor of descriptors){\n const plugin = descriptor.plugin;\n const method = plugin[hook];\n const params = [\n chart,\n args,\n descriptor.options\n ];\n if (callback(method, params, plugin) === false && args.cancelable) {\n return false;\n }\n }\n return true;\n }\n invalidate() {\n if (!isNullOrUndef(this._cache)) {\n this._oldCache = this._cache;\n this._cache = undefined;\n }\n }\n _descriptors(chart) {\n if (this._cache) {\n return this._cache;\n }\n const descriptors = this._cache = this._createDescriptors(chart);\n this._notifyStateChanges(chart);\n return descriptors;\n }\n _createDescriptors(chart, all) {\n const config = chart && chart.config;\n const options = valueOrDefault(config.options && config.options.plugins, {});\n const plugins = allPlugins(config);\n return options === false && !all ? [] : createDescriptors(chart, plugins, options, all);\n }\n _notifyStateChanges(chart) {\n const previousDescriptors = this._oldCache || [];\n const descriptors = this._cache;\n const diff = (a, b)=>a.filter((x)=>!b.some((y)=>x.plugin.id === y.plugin.id));\n this._notify(diff(previousDescriptors, descriptors), chart, 'stop');\n this._notify(diff(descriptors, previousDescriptors), chart, 'start');\n }\n}\n function allPlugins(config) {\n const localIds = {};\n const plugins = [];\n const keys = Object.keys(registry.plugins.items);\n for(let i = 0; i < keys.length; i++){\n plugins.push(registry.getPlugin(keys[i]));\n }\n const local = config.plugins || [];\n for(let i = 0; i < local.length; i++){\n const plugin = local[i];\n if (plugins.indexOf(plugin) === -1) {\n plugins.push(plugin);\n localIds[plugin.id] = true;\n }\n }\n return {\n plugins,\n localIds\n };\n}\nfunction getOpts(options, all) {\n if (!all && options === false) {\n return null;\n }\n if (options === true) {\n return {};\n }\n return options;\n}\nfunction createDescriptors(chart, { plugins , localIds }, options, all) {\n const result = [];\n const context = chart.getContext();\n for (const plugin of plugins){\n const id = plugin.id;\n const opts = getOpts(options[id], all);\n if (opts === null) {\n continue;\n }\n result.push({\n plugin,\n options: pluginOpts(chart.config, {\n plugin,\n local: localIds[id]\n }, opts, context)\n });\n }\n return result;\n}\nfunction pluginOpts(config, { plugin , local }, opts, context) {\n const keys = config.pluginScopeKeys(plugin);\n const scopes = config.getOptionScopes(opts, keys);\n if (local && plugin.defaults) {\n scopes.push(plugin.defaults);\n }\n return config.createResolver(scopes, context, [\n ''\n ], {\n scriptable: false,\n indexable: false,\n allKeys: true\n });\n}\n\nfunction getIndexAxis(type, options) {\n const datasetDefaults = defaults.datasets[type] || {};\n const datasetOptions = (options.datasets || {})[type] || {};\n return datasetOptions.indexAxis || options.indexAxis || datasetDefaults.indexAxis || 'x';\n}\nfunction getAxisFromDefaultScaleID(id, indexAxis) {\n let axis = id;\n if (id === '_index_') {\n axis = indexAxis;\n } else if (id === '_value_') {\n axis = indexAxis === 'x' ? 'y' : 'x';\n }\n return axis;\n}\nfunction getDefaultScaleIDFromAxis(axis, indexAxis) {\n return axis === indexAxis ? '_index_' : '_value_';\n}\nfunction idMatchesAxis(id) {\n if (id === 'x' || id === 'y' || id === 'r') {\n return id;\n }\n}\nfunction axisFromPosition(position) {\n if (position === 'top' || position === 'bottom') {\n return 'x';\n }\n if (position === 'left' || position === 'right') {\n return 'y';\n }\n}\nfunction determineAxis(id, ...scaleOptions) {\n if (idMatchesAxis(id)) {\n return id;\n }\n for (const opts of scaleOptions){\n const axis = opts.axis || axisFromPosition(opts.position) || id.length > 1 && idMatchesAxis(id[0].toLowerCase());\n if (axis) {\n return axis;\n }\n }\n throw new Error(`Cannot determine type of '${id}' axis. Please provide 'axis' or 'position' option.`);\n}\nfunction getAxisFromDataset(id, axis, dataset) {\n if (dataset[axis + 'AxisID'] === id) {\n return {\n axis\n };\n }\n}\nfunction retrieveAxisFromDatasets(id, config) {\n if (config.data && config.data.datasets) {\n const boundDs = config.data.datasets.filter((d)=>d.xAxisID === id || d.yAxisID === id);\n if (boundDs.length) {\n return getAxisFromDataset(id, 'x', boundDs[0]) || getAxisFromDataset(id, 'y', boundDs[0]);\n }\n }\n return {};\n}\nfunction mergeScaleConfig(config, options) {\n const chartDefaults = overrides[config.type] || {\n scales: {}\n };\n const configScales = options.scales || {};\n const chartIndexAxis = getIndexAxis(config.type, options);\n const scales = Object.create(null);\n Object.keys(configScales).forEach((id)=>{\n const scaleConf = configScales[id];\n if (!isObject(scaleConf)) {\n return console.error(`Invalid scale configuration for scale: ${id}`);\n }\n if (scaleConf._proxy) {\n return console.warn(`Ignoring resolver passed as options for scale: ${id}`);\n }\n const axis = determineAxis(id, scaleConf, retrieveAxisFromDatasets(id, config), defaults.scales[scaleConf.type]);\n const defaultId = getDefaultScaleIDFromAxis(axis, chartIndexAxis);\n const defaultScaleOptions = chartDefaults.scales || {};\n scales[id] = mergeIf(Object.create(null), [\n {\n axis\n },\n scaleConf,\n defaultScaleOptions[axis],\n defaultScaleOptions[defaultId]\n ]);\n });\n config.data.datasets.forEach((dataset)=>{\n const type = dataset.type || config.type;\n const indexAxis = dataset.indexAxis || getIndexAxis(type, options);\n const datasetDefaults = overrides[type] || {};\n const defaultScaleOptions = datasetDefaults.scales || {};\n Object.keys(defaultScaleOptions).forEach((defaultID)=>{\n const axis = getAxisFromDefaultScaleID(defaultID, indexAxis);\n const id = dataset[axis + 'AxisID'] || axis;\n scales[id] = scales[id] || Object.create(null);\n mergeIf(scales[id], [\n {\n axis\n },\n configScales[id],\n defaultScaleOptions[defaultID]\n ]);\n });\n });\n Object.keys(scales).forEach((key)=>{\n const scale = scales[key];\n mergeIf(scale, [\n defaults.scales[scale.type],\n defaults.scale\n ]);\n });\n return scales;\n}\nfunction initOptions(config) {\n const options = config.options || (config.options = {});\n options.plugins = valueOrDefault(options.plugins, {});\n options.scales = mergeScaleConfig(config, options);\n}\nfunction initData(data) {\n data = data || {};\n data.datasets = data.datasets || [];\n data.labels = data.labels || [];\n return data;\n}\nfunction initConfig(config) {\n config = config || {};\n config.data = initData(config.data);\n initOptions(config);\n return config;\n}\nconst keyCache = new Map();\nconst keysCached = new Set();\nfunction cachedKeys(cacheKey, generate) {\n let keys = keyCache.get(cacheKey);\n if (!keys) {\n keys = generate();\n keyCache.set(cacheKey, keys);\n keysCached.add(keys);\n }\n return keys;\n}\nconst addIfFound = (set, obj, key)=>{\n const opts = resolveObjectKey(obj, key);\n if (opts !== undefined) {\n set.add(opts);\n }\n};\nclass Config {\n constructor(config){\n this._config = initConfig(config);\n this._scopeCache = new Map();\n this._resolverCache = new Map();\n }\n get platform() {\n return this._config.platform;\n }\n get type() {\n return this._config.type;\n }\n set type(type) {\n this._config.type = type;\n }\n get data() {\n return this._config.data;\n }\n set data(data) {\n this._config.data = initData(data);\n }\n get options() {\n return this._config.options;\n }\n set options(options) {\n this._config.options = options;\n }\n get plugins() {\n return this._config.plugins;\n }\n update() {\n const config = this._config;\n this.clearCache();\n initOptions(config);\n }\n clearCache() {\n this._scopeCache.clear();\n this._resolverCache.clear();\n }\n datasetScopeKeys(datasetType) {\n return cachedKeys(datasetType, ()=>[\n [\n `datasets.${datasetType}`,\n ''\n ]\n ]);\n }\n datasetAnimationScopeKeys(datasetType, transition) {\n return cachedKeys(`${datasetType}.transition.${transition}`, ()=>[\n [\n `datasets.${datasetType}.transitions.${transition}`,\n `transitions.${transition}`\n ],\n [\n `datasets.${datasetType}`,\n ''\n ]\n ]);\n }\n datasetElementScopeKeys(datasetType, elementType) {\n return cachedKeys(`${datasetType}-${elementType}`, ()=>[\n [\n `datasets.${datasetType}.elements.${elementType}`,\n `datasets.${datasetType}`,\n `elements.${elementType}`,\n ''\n ]\n ]);\n }\n pluginScopeKeys(plugin) {\n const id = plugin.id;\n const type = this.type;\n return cachedKeys(`${type}-plugin-${id}`, ()=>[\n [\n `plugins.${id}`,\n ...plugin.additionalOptionScopes || []\n ]\n ]);\n }\n _cachedScopes(mainScope, resetCache) {\n const _scopeCache = this._scopeCache;\n let cache = _scopeCache.get(mainScope);\n if (!cache || resetCache) {\n cache = new Map();\n _scopeCache.set(mainScope, cache);\n }\n return cache;\n }\n getOptionScopes(mainScope, keyLists, resetCache) {\n const { options , type } = this;\n const cache = this._cachedScopes(mainScope, resetCache);\n const cached = cache.get(keyLists);\n if (cached) {\n return cached;\n }\n const scopes = new Set();\n keyLists.forEach((keys)=>{\n if (mainScope) {\n scopes.add(mainScope);\n keys.forEach((key)=>addIfFound(scopes, mainScope, key));\n }\n keys.forEach((key)=>addIfFound(scopes, options, key));\n keys.forEach((key)=>addIfFound(scopes, overrides[type] || {}, key));\n keys.forEach((key)=>addIfFound(scopes, defaults, key));\n keys.forEach((key)=>addIfFound(scopes, descriptors, key));\n });\n const array = Array.from(scopes);\n if (array.length === 0) {\n array.push(Object.create(null));\n }\n if (keysCached.has(keyLists)) {\n cache.set(keyLists, array);\n }\n return array;\n }\n chartOptionScopes() {\n const { options , type } = this;\n return [\n options,\n overrides[type] || {},\n defaults.datasets[type] || {},\n {\n type\n },\n defaults,\n descriptors\n ];\n }\n resolveNamedOptions(scopes, names, context, prefixes = [\n ''\n ]) {\n const result = {\n $shared: true\n };\n const { resolver , subPrefixes } = getResolver(this._resolverCache, scopes, prefixes);\n let options = resolver;\n if (needContext(resolver, names)) {\n result.$shared = false;\n context = isFunction(context) ? context() : context;\n const subResolver = this.createResolver(scopes, context, subPrefixes);\n options = _attachContext(resolver, context, subResolver);\n }\n for (const prop of names){\n result[prop] = options[prop];\n }\n return result;\n }\n createResolver(scopes, context, prefixes = [\n ''\n ], descriptorDefaults) {\n const { resolver } = getResolver(this._resolverCache, scopes, prefixes);\n return isObject(context) ? _attachContext(resolver, context, undefined, descriptorDefaults) : resolver;\n }\n}\nfunction getResolver(resolverCache, scopes, prefixes) {\n let cache = resolverCache.get(scopes);\n if (!cache) {\n cache = new Map();\n resolverCache.set(scopes, cache);\n }\n const cacheKey = prefixes.join();\n let cached = cache.get(cacheKey);\n if (!cached) {\n const resolver = _createResolver(scopes, prefixes);\n cached = {\n resolver,\n subPrefixes: prefixes.filter((p)=>!p.toLowerCase().includes('hover'))\n };\n cache.set(cacheKey, cached);\n }\n return cached;\n}\nconst hasFunction = (value)=>isObject(value) && Object.getOwnPropertyNames(value).reduce((acc, key)=>acc || isFunction(value[key]), false);\nfunction needContext(proxy, names) {\n const { isScriptable , isIndexable } = _descriptors(proxy);\n for (const prop of names){\n const scriptable = isScriptable(prop);\n const indexable = isIndexable(prop);\n const value = (indexable || scriptable) && proxy[prop];\n if (scriptable && (isFunction(value) || hasFunction(value)) || indexable && isArray(value)) {\n return true;\n }\n }\n return false;\n}\n\nvar version = \"4.4.0\";\n\nconst KNOWN_POSITIONS = [\n 'top',\n 'bottom',\n 'left',\n 'right',\n 'chartArea'\n];\nfunction positionIsHorizontal(position, axis) {\n return position === 'top' || position === 'bottom' || KNOWN_POSITIONS.indexOf(position) === -1 && axis === 'x';\n}\nfunction compare2Level(l1, l2) {\n return function(a, b) {\n return a[l1] === b[l1] ? a[l2] - b[l2] : a[l1] - b[l1];\n };\n}\nfunction onAnimationsComplete(context) {\n const chart = context.chart;\n const animationOptions = chart.options.animation;\n chart.notifyPlugins('afterRender');\n callback(animationOptions && animationOptions.onComplete, [\n context\n ], chart);\n}\nfunction onAnimationProgress(context) {\n const chart = context.chart;\n const animationOptions = chart.options.animation;\n callback(animationOptions && animationOptions.onProgress, [\n context\n ], chart);\n}\n function getCanvas(item) {\n if (_isDomSupported() && typeof item === 'string') {\n item = document.getElementById(item);\n } else if (item && item.length) {\n item = item[0];\n }\n if (item && item.canvas) {\n item = item.canvas;\n }\n return item;\n}\nconst instances = {};\nconst getChart = (key)=>{\n const canvas = getCanvas(key);\n return Object.values(instances).filter((c)=>c.canvas === canvas).pop();\n};\nfunction moveNumericKeys(obj, start, move) {\n const keys = Object.keys(obj);\n for (const key of keys){\n const intKey = +key;\n if (intKey >= start) {\n const value = obj[key];\n delete obj[key];\n if (move > 0 || intKey > start) {\n obj[intKey + move] = value;\n }\n }\n }\n}\n function determineLastEvent(e, lastEvent, inChartArea, isClick) {\n if (!inChartArea || e.type === 'mouseout') {\n return null;\n }\n if (isClick) {\n return lastEvent;\n }\n return e;\n}\nfunction getSizeForArea(scale, chartArea, field) {\n return scale.options.clip ? scale[field] : chartArea[field];\n}\nfunction getDatasetArea(meta, chartArea) {\n const { xScale , yScale } = meta;\n if (xScale && yScale) {\n return {\n left: getSizeForArea(xScale, chartArea, 'left'),\n right: getSizeForArea(xScale, chartArea, 'right'),\n top: getSizeForArea(yScale, chartArea, 'top'),\n bottom: getSizeForArea(yScale, chartArea, 'bottom')\n };\n }\n return chartArea;\n}\nclass Chart {\n static defaults = defaults;\n static instances = instances;\n static overrides = overrides;\n static registry = registry;\n static version = version;\n static getChart = getChart;\n static register(...items) {\n registry.add(...items);\n invalidatePlugins();\n }\n static unregister(...items) {\n registry.remove(...items);\n invalidatePlugins();\n }\n constructor(item, userConfig){\n const config = this.config = new Config(userConfig);\n const initialCanvas = getCanvas(item);\n const existingChart = getChart(initialCanvas);\n if (existingChart) {\n throw new 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.');\n }\n const options = config.createResolver(config.chartOptionScopes(), this.getContext());\n this.platform = new (config.platform || _detectPlatform(initialCanvas))();\n this.platform.updateConfig(config);\n const context = this.platform.acquireContext(initialCanvas, options.aspectRatio);\n const canvas = context && context.canvas;\n const height = canvas && canvas.height;\n const width = canvas && canvas.width;\n this.id = uid();\n this.ctx = context;\n this.canvas = canvas;\n this.width = width;\n this.height = height;\n this._options = options;\n this._aspectRatio = this.aspectRatio;\n this._layers = [];\n this._metasets = [];\n this._stacks = undefined;\n this.boxes = [];\n this.currentDevicePixelRatio = undefined;\n this.chartArea = undefined;\n this._active = [];\n this._lastEvent = undefined;\n this._listeners = {};\n this._responsiveListeners = undefined;\n this._sortedMetasets = [];\n this.scales = {};\n this._plugins = new PluginService();\n this.$proxies = {};\n this._hiddenIndices = {};\n this.attached = false;\n this._animationsDisabled = undefined;\n this.$context = undefined;\n this._doResize = debounce((mode)=>this.update(mode), options.resizeDelay || 0);\n this._dataChanges = [];\n instances[this.id] = this;\n if (!context || !canvas) {\n console.error(\"Failed to create chart: can't acquire context from the given item\");\n return;\n }\n animator.listen(this, 'complete', onAnimationsComplete);\n animator.listen(this, 'progress', onAnimationProgress);\n this._initialize();\n if (this.attached) {\n this.update();\n }\n }\n get aspectRatio() {\n const { options: { aspectRatio , maintainAspectRatio } , width , height , _aspectRatio } = this;\n if (!isNullOrUndef(aspectRatio)) {\n return aspectRatio;\n }\n if (maintainAspectRatio && _aspectRatio) {\n return _aspectRatio;\n }\n return height ? width / height : null;\n }\n get data() {\n return this.config.data;\n }\n set data(data) {\n this.config.data = data;\n }\n get options() {\n return this._options;\n }\n set options(options) {\n this.config.options = options;\n }\n get registry() {\n return registry;\n }\n _initialize() {\n this.notifyPlugins('beforeInit');\n if (this.options.responsive) {\n this.resize();\n } else {\n retinaScale(this, this.options.devicePixelRatio);\n }\n this.bindEvents();\n this.notifyPlugins('afterInit');\n return this;\n }\n clear() {\n clearCanvas(this.canvas, this.ctx);\n return this;\n }\n stop() {\n animator.stop(this);\n return this;\n }\n resize(width, height) {\n if (!animator.running(this)) {\n this._resize(width, height);\n } else {\n this._resizeBeforeDraw = {\n width,\n height\n };\n }\n }\n _resize(width, height) {\n const options = this.options;\n const canvas = this.canvas;\n const aspectRatio = options.maintainAspectRatio && this.aspectRatio;\n const newSize = this.platform.getMaximumSize(canvas, width, height, aspectRatio);\n const newRatio = options.devicePixelRatio || this.platform.getDevicePixelRatio();\n const mode = this.width ? 'resize' : 'attach';\n this.width = newSize.width;\n this.height = newSize.height;\n this._aspectRatio = this.aspectRatio;\n if (!retinaScale(this, newRatio, true)) {\n return;\n }\n this.notifyPlugins('resize', {\n size: newSize\n });\n callback(options.onResize, [\n this,\n newSize\n ], this);\n if (this.attached) {\n if (this._doResize(mode)) {\n this.render();\n }\n }\n }\n ensureScalesHaveIDs() {\n const options = this.options;\n const scalesOptions = options.scales || {};\n each(scalesOptions, (axisOptions, axisID)=>{\n axisOptions.id = axisID;\n });\n }\n buildOrUpdateScales() {\n const options = this.options;\n const scaleOpts = options.scales;\n const scales = this.scales;\n const updated = Object.keys(scales).reduce((obj, id)=>{\n obj[id] = false;\n return obj;\n }, {});\n let items = [];\n if (scaleOpts) {\n items = items.concat(Object.keys(scaleOpts).map((id)=>{\n const scaleOptions = scaleOpts[id];\n const axis = determineAxis(id, scaleOptions);\n const isRadial = axis === 'r';\n const isHorizontal = axis === 'x';\n return {\n options: scaleOptions,\n dposition: isRadial ? 'chartArea' : isHorizontal ? 'bottom' : 'left',\n dtype: isRadial ? 'radialLinear' : isHorizontal ? 'category' : 'linear'\n };\n }));\n }\n each(items, (item)=>{\n const scaleOptions = item.options;\n const id = scaleOptions.id;\n const axis = determineAxis(id, scaleOptions);\n const scaleType = valueOrDefault(scaleOptions.type, item.dtype);\n if (scaleOptions.position === undefined || positionIsHorizontal(scaleOptions.position, axis) !== positionIsHorizontal(item.dposition)) {\n scaleOptions.position = item.dposition;\n }\n updated[id] = true;\n let scale = null;\n if (id in scales && scales[id].type === scaleType) {\n scale = scales[id];\n } else {\n const scaleClass = registry.getScale(scaleType);\n scale = new scaleClass({\n id,\n type: scaleType,\n ctx: this.ctx,\n chart: this\n });\n scales[scale.id] = scale;\n }\n scale.init(scaleOptions, options);\n });\n each(updated, (hasUpdated, id)=>{\n if (!hasUpdated) {\n delete scales[id];\n }\n });\n each(scales, (scale)=>{\n layouts.configure(this, scale, scale.options);\n layouts.addBox(this, scale);\n });\n }\n _updateMetasets() {\n const metasets = this._metasets;\n const numData = this.data.datasets.length;\n const numMeta = metasets.length;\n metasets.sort((a, b)=>a.index - b.index);\n if (numMeta > numData) {\n for(let i = numData; i < numMeta; ++i){\n this._destroyDatasetMeta(i);\n }\n metasets.splice(numData, numMeta - numData);\n }\n this._sortedMetasets = metasets.slice(0).sort(compare2Level('order', 'index'));\n }\n _removeUnreferencedMetasets() {\n const { _metasets: metasets , data: { datasets } } = this;\n if (metasets.length > datasets.length) {\n delete this._stacks;\n }\n metasets.forEach((meta, index)=>{\n if (datasets.filter((x)=>x === meta._dataset).length === 0) {\n this._destroyDatasetMeta(index);\n }\n });\n }\n buildOrUpdateControllers() {\n const newControllers = [];\n const datasets = this.data.datasets;\n let i, ilen;\n this._removeUnreferencedMetasets();\n for(i = 0, ilen = datasets.length; i < ilen; i++){\n const dataset = datasets[i];\n let meta = this.getDatasetMeta(i);\n const type = dataset.type || this.config.type;\n if (meta.type && meta.type !== type) {\n this._destroyDatasetMeta(i);\n meta = this.getDatasetMeta(i);\n }\n meta.type = type;\n meta.indexAxis = dataset.indexAxis || getIndexAxis(type, this.options);\n meta.order = dataset.order || 0;\n meta.index = i;\n meta.label = '' + dataset.label;\n meta.visible = this.isDatasetVisible(i);\n if (meta.controller) {\n meta.controller.updateIndex(i);\n meta.controller.linkScales();\n } else {\n const ControllerClass = registry.getController(type);\n const { datasetElementType , dataElementType } = defaults.datasets[type];\n Object.assign(ControllerClass, {\n dataElementType: registry.getElement(dataElementType),\n datasetElementType: datasetElementType && registry.getElement(datasetElementType)\n });\n meta.controller = new ControllerClass(this, i);\n newControllers.push(meta.controller);\n }\n }\n this._updateMetasets();\n return newControllers;\n }\n _resetElements() {\n each(this.data.datasets, (dataset, datasetIndex)=>{\n this.getDatasetMeta(datasetIndex).controller.reset();\n }, this);\n }\n reset() {\n this._resetElements();\n this.notifyPlugins('reset');\n }\n update(mode) {\n const config = this.config;\n config.update();\n const options = this._options = config.createResolver(config.chartOptionScopes(), this.getContext());\n const animsDisabled = this._animationsDisabled = !options.animation;\n this._updateScales();\n this._checkEventBindings();\n this._updateHiddenIndices();\n this._plugins.invalidate();\n if (this.notifyPlugins('beforeUpdate', {\n mode,\n cancelable: true\n }) === false) {\n return;\n }\n const newControllers = this.buildOrUpdateControllers();\n this.notifyPlugins('beforeElementsUpdate');\n let minPadding = 0;\n for(let i = 0, ilen = this.data.datasets.length; i < ilen; i++){\n const { controller } = this.getDatasetMeta(i);\n const reset = !animsDisabled && newControllers.indexOf(controller) === -1;\n controller.buildOrUpdateElements(reset);\n minPadding = Math.max(+controller.getMaxOverflow(), minPadding);\n }\n minPadding = this._minPadding = options.layout.autoPadding ? minPadding : 0;\n this._updateLayout(minPadding);\n if (!animsDisabled) {\n each(newControllers, (controller)=>{\n controller.reset();\n });\n }\n this._updateDatasets(mode);\n this.notifyPlugins('afterUpdate', {\n mode\n });\n this._layers.sort(compare2Level('z', '_idx'));\n const { _active , _lastEvent } = this;\n if (_lastEvent) {\n this._eventHandler(_lastEvent, true);\n } else if (_active.length) {\n this._updateHoverStyles(_active, _active, true);\n }\n this.render();\n }\n _updateScales() {\n each(this.scales, (scale)=>{\n layouts.removeBox(this, scale);\n });\n this.ensureScalesHaveIDs();\n this.buildOrUpdateScales();\n }\n _checkEventBindings() {\n const options = this.options;\n const existingEvents = new Set(Object.keys(this._listeners));\n const newEvents = new Set(options.events);\n if (!setsEqual(existingEvents, newEvents) || !!this._responsiveListeners !== options.responsive) {\n this.unbindEvents();\n this.bindEvents();\n }\n }\n _updateHiddenIndices() {\n const { _hiddenIndices } = this;\n const changes = this._getUniformDataChanges() || [];\n for (const { method , start , count } of changes){\n const move = method === '_removeElements' ? -count : count;\n moveNumericKeys(_hiddenIndices, start, move);\n }\n }\n _getUniformDataChanges() {\n const _dataChanges = this._dataChanges;\n if (!_dataChanges || !_dataChanges.length) {\n return;\n }\n this._dataChanges = [];\n const datasetCount = this.data.datasets.length;\n const makeSet = (idx)=>new Set(_dataChanges.filter((c)=>c[0] === idx).map((c, i)=>i + ',' + c.splice(1).join(',')));\n const changeSet = makeSet(0);\n for(let i = 1; i < datasetCount; i++){\n if (!setsEqual(changeSet, makeSet(i))) {\n return;\n }\n }\n return Array.from(changeSet).map((c)=>c.split(',')).map((a)=>({\n method: a[1],\n start: +a[2],\n count: +a[3]\n }));\n }\n _updateLayout(minPadding) {\n if (this.notifyPlugins('beforeLayout', {\n cancelable: true\n }) === false) {\n return;\n }\n layouts.update(this, this.width, this.height, minPadding);\n const area = this.chartArea;\n const noArea = area.width <= 0 || area.height <= 0;\n this._layers = [];\n each(this.boxes, (box)=>{\n if (noArea && box.position === 'chartArea') {\n return;\n }\n if (box.configure) {\n box.configure();\n }\n this._layers.push(...box._layers());\n }, this);\n this._layers.forEach((item, index)=>{\n item._idx = index;\n });\n this.notifyPlugins('afterLayout');\n }\n _updateDatasets(mode) {\n if (this.notifyPlugins('beforeDatasetsUpdate', {\n mode,\n cancelable: true\n }) === false) {\n return;\n }\n for(let i = 0, ilen = this.data.datasets.length; i < ilen; ++i){\n this.getDatasetMeta(i).controller.configure();\n }\n for(let i = 0, ilen = this.data.datasets.length; i < ilen; ++i){\n this._updateDataset(i, isFunction(mode) ? mode({\n datasetIndex: i\n }) : mode);\n }\n this.notifyPlugins('afterDatasetsUpdate', {\n mode\n });\n }\n _updateDataset(index, mode) {\n const meta = this.getDatasetMeta(index);\n const args = {\n meta,\n index,\n mode,\n cancelable: true\n };\n if (this.notifyPlugins('beforeDatasetUpdate', args) === false) {\n return;\n }\n meta.controller._update(mode);\n args.cancelable = false;\n this.notifyPlugins('afterDatasetUpdate', args);\n }\n render() {\n if (this.notifyPlugins('beforeRender', {\n cancelable: true\n }) === false) {\n return;\n }\n if (animator.has(this)) {\n if (this.attached && !animator.running(this)) {\n animator.start(this);\n }\n } else {\n this.draw();\n onAnimationsComplete({\n chart: this\n });\n }\n }\n draw() {\n let i;\n if (this._resizeBeforeDraw) {\n const { width , height } = this._resizeBeforeDraw;\n this._resize(width, height);\n this._resizeBeforeDraw = null;\n }\n this.clear();\n if (this.width <= 0 || this.height <= 0) {\n return;\n }\n if (this.notifyPlugins('beforeDraw', {\n cancelable: true\n }) === false) {\n return;\n }\n const layers = this._layers;\n for(i = 0; i < layers.length && layers[i].z <= 0; ++i){\n layers[i].draw(this.chartArea);\n }\n this._drawDatasets();\n for(; i < layers.length; ++i){\n layers[i].draw(this.chartArea);\n }\n this.notifyPlugins('afterDraw');\n }\n _getSortedDatasetMetas(filterVisible) {\n const metasets = this._sortedMetasets;\n const result = [];\n let i, ilen;\n for(i = 0, ilen = metasets.length; i < ilen; ++i){\n const meta = metasets[i];\n if (!filterVisible || meta.visible) {\n result.push(meta);\n }\n }\n return result;\n }\n getSortedVisibleDatasetMetas() {\n return this._getSortedDatasetMetas(true);\n }\n _drawDatasets() {\n if (this.notifyPlugins('beforeDatasetsDraw', {\n cancelable: true\n }) === false) {\n return;\n }\n const metasets = this.getSortedVisibleDatasetMetas();\n for(let i = metasets.length - 1; i >= 0; --i){\n this._drawDataset(metasets[i]);\n }\n this.notifyPlugins('afterDatasetsDraw');\n }\n _drawDataset(meta) {\n const ctx = this.ctx;\n const clip = meta._clip;\n const useClip = !clip.disabled;\n const area = getDatasetArea(meta, this.chartArea);\n const args = {\n meta,\n index: meta.index,\n cancelable: true\n };\n if (this.notifyPlugins('beforeDatasetDraw', args) === false) {\n return;\n }\n if (useClip) {\n clipArea(ctx, {\n left: clip.left === false ? 0 : area.left - clip.left,\n right: clip.right === false ? this.width : area.right + clip.right,\n top: clip.top === false ? 0 : area.top - clip.top,\n bottom: clip.bottom === false ? this.height : area.bottom + clip.bottom\n });\n }\n meta.controller.draw();\n if (useClip) {\n unclipArea(ctx);\n }\n args.cancelable = false;\n this.notifyPlugins('afterDatasetDraw', args);\n }\n isPointInArea(point) {\n return _isPointInArea(point, this.chartArea, this._minPadding);\n }\n getElementsAtEventForMode(e, mode, options, useFinalPosition) {\n const method = Interaction.modes[mode];\n if (typeof method === 'function') {\n return method(this, e, options, useFinalPosition);\n }\n return [];\n }\n getDatasetMeta(datasetIndex) {\n const dataset = this.data.datasets[datasetIndex];\n const metasets = this._metasets;\n let meta = metasets.filter((x)=>x && x._dataset === dataset).pop();\n if (!meta) {\n meta = {\n type: null,\n data: [],\n dataset: null,\n controller: null,\n hidden: null,\n xAxisID: null,\n yAxisID: null,\n order: dataset && dataset.order || 0,\n index: datasetIndex,\n _dataset: dataset,\n _parsed: [],\n _sorted: false\n };\n metasets.push(meta);\n }\n return meta;\n }\n getContext() {\n return this.$context || (this.$context = createContext(null, {\n chart: this,\n type: 'chart'\n }));\n }\n getVisibleDatasetCount() {\n return this.getSortedVisibleDatasetMetas().length;\n }\n isDatasetVisible(datasetIndex) {\n const dataset = this.data.datasets[datasetIndex];\n if (!dataset) {\n return false;\n }\n const meta = this.getDatasetMeta(datasetIndex);\n return typeof meta.hidden === 'boolean' ? !meta.hidden : !dataset.hidden;\n }\n setDatasetVisibility(datasetIndex, visible) {\n const meta = this.getDatasetMeta(datasetIndex);\n meta.hidden = !visible;\n }\n toggleDataVisibility(index) {\n this._hiddenIndices[index] = !this._hiddenIndices[index];\n }\n getDataVisibility(index) {\n return !this._hiddenIndices[index];\n }\n _updateVisibility(datasetIndex, dataIndex, visible) {\n const mode = visible ? 'show' : 'hide';\n const meta = this.getDatasetMeta(datasetIndex);\n const anims = meta.controller._resolveAnimations(undefined, mode);\n if (defined(dataIndex)) {\n meta.data[dataIndex].hidden = !visible;\n this.update();\n } else {\n this.setDatasetVisibility(datasetIndex, visible);\n anims.update(meta, {\n visible\n });\n this.update((ctx)=>ctx.datasetIndex === datasetIndex ? mode : undefined);\n }\n }\n hide(datasetIndex, dataIndex) {\n this._updateVisibility(datasetIndex, dataIndex, false);\n }\n show(datasetIndex, dataIndex) {\n this._updateVisibility(datasetIndex, dataIndex, true);\n }\n _destroyDatasetMeta(datasetIndex) {\n const meta = this._metasets[datasetIndex];\n if (meta && meta.controller) {\n meta.controller._destroy();\n }\n delete this._metasets[datasetIndex];\n }\n _stop() {\n let i, ilen;\n this.stop();\n animator.remove(this);\n for(i = 0, ilen = this.data.datasets.length; i < ilen; ++i){\n this._destroyDatasetMeta(i);\n }\n }\n destroy() {\n this.notifyPlugins('beforeDestroy');\n const { canvas , ctx } = this;\n this._stop();\n this.config.clearCache();\n if (canvas) {\n this.unbindEvents();\n clearCanvas(canvas, ctx);\n this.platform.releaseContext(ctx);\n this.canvas = null;\n this.ctx = null;\n }\n delete instances[this.id];\n this.notifyPlugins('afterDestroy');\n }\n toBase64Image(...args) {\n return this.canvas.toDataURL(...args);\n }\n bindEvents() {\n this.bindUserEvents();\n if (this.options.responsive) {\n this.bindResponsiveEvents();\n } else {\n this.attached = true;\n }\n }\n bindUserEvents() {\n const listeners = this._listeners;\n const platform = this.platform;\n const _add = (type, listener)=>{\n platform.addEventListener(this, type, listener);\n listeners[type] = listener;\n };\n const listener = (e, x, y)=>{\n e.offsetX = x;\n e.offsetY = y;\n this._eventHandler(e);\n };\n each(this.options.events, (type)=>_add(type, listener));\n }\n bindResponsiveEvents() {\n if (!this._responsiveListeners) {\n this._responsiveListeners = {};\n }\n const listeners = this._responsiveListeners;\n const platform = this.platform;\n const _add = (type, listener)=>{\n platform.addEventListener(this, type, listener);\n listeners[type] = listener;\n };\n const _remove = (type, listener)=>{\n if (listeners[type]) {\n platform.removeEventListener(this, type, listener);\n delete listeners[type];\n }\n };\n const listener = (width, height)=>{\n if (this.canvas) {\n this.resize(width, height);\n }\n };\n let detached;\n const attached = ()=>{\n _remove('attach', attached);\n this.attached = true;\n this.resize();\n _add('resize', listener);\n _add('detach', detached);\n };\n detached = ()=>{\n this.attached = false;\n _remove('resize', listener);\n this._stop();\n this._resize(0, 0);\n _add('attach', attached);\n };\n if (platform.isAttached(this.canvas)) {\n attached();\n } else {\n detached();\n }\n }\n unbindEvents() {\n each(this._listeners, (listener, type)=>{\n this.platform.removeEventListener(this, type, listener);\n });\n this._listeners = {};\n each(this._responsiveListeners, (listener, type)=>{\n this.platform.removeEventListener(this, type, listener);\n });\n this._responsiveListeners = undefined;\n }\n updateHoverStyle(items, mode, enabled) {\n const prefix = enabled ? 'set' : 'remove';\n let meta, item, i, ilen;\n if (mode === 'dataset') {\n meta = this.getDatasetMeta(items[0].datasetIndex);\n meta.controller['_' + prefix + 'DatasetHoverStyle']();\n }\n for(i = 0, ilen = items.length; i < ilen; ++i){\n item = items[i];\n const controller = item && this.getDatasetMeta(item.datasetIndex).controller;\n if (controller) {\n controller[prefix + 'HoverStyle'](item.element, item.datasetIndex, item.index);\n }\n }\n }\n getActiveElements() {\n return this._active || [];\n }\n setActiveElements(activeElements) {\n const lastActive = this._active || [];\n const active = activeElements.map(({ datasetIndex , index })=>{\n const meta = this.getDatasetMeta(datasetIndex);\n if (!meta) {\n throw new Error('No dataset found at index ' + datasetIndex);\n }\n return {\n datasetIndex,\n element: meta.data[index],\n index\n };\n });\n const changed = !_elementsEqual(active, lastActive);\n if (changed) {\n this._active = active;\n this._lastEvent = null;\n this._updateHoverStyles(active, lastActive);\n }\n }\n notifyPlugins(hook, args, filter) {\n return this._plugins.notify(this, hook, args, filter);\n }\n isPluginEnabled(pluginId) {\n return this._plugins._cache.filter((p)=>p.plugin.id === pluginId).length === 1;\n }\n _updateHoverStyles(active, lastActive, replay) {\n const hoverOptions = this.options.hover;\n const diff = (a, b)=>a.filter((x)=>!b.some((y)=>x.datasetIndex === y.datasetIndex && x.index === y.index));\n const deactivated = diff(lastActive, active);\n const activated = replay ? active : diff(active, lastActive);\n if (deactivated.length) {\n this.updateHoverStyle(deactivated, hoverOptions.mode, false);\n }\n if (activated.length && hoverOptions.mode) {\n this.updateHoverStyle(activated, hoverOptions.mode, true);\n }\n }\n _eventHandler(e, replay) {\n const args = {\n event: e,\n replay,\n cancelable: true,\n inChartArea: this.isPointInArea(e)\n };\n const eventFilter = (plugin)=>(plugin.options.events || this.options.events).includes(e.native.type);\n if (this.notifyPlugins('beforeEvent', args, eventFilter) === false) {\n return;\n }\n const changed = this._handleEvent(e, replay, args.inChartArea);\n args.cancelable = false;\n this.notifyPlugins('afterEvent', args, eventFilter);\n if (changed || args.changed) {\n this.render();\n }\n return this;\n }\n _handleEvent(e, replay, inChartArea) {\n const { _active: lastActive = [] , options } = this;\n const useFinalPosition = replay;\n const active = this._getActiveElements(e, lastActive, inChartArea, useFinalPosition);\n const isClick = _isClickEvent(e);\n const lastEvent = determineLastEvent(e, this._lastEvent, inChartArea, isClick);\n if (inChartArea) {\n this._lastEvent = null;\n callback(options.onHover, [\n e,\n active,\n this\n ], this);\n if (isClick) {\n callback(options.onClick, [\n e,\n active,\n this\n ], this);\n }\n }\n const changed = !_elementsEqual(active, lastActive);\n if (changed || replay) {\n this._active = active;\n this._updateHoverStyles(active, lastActive, replay);\n }\n this._lastEvent = lastEvent;\n return changed;\n }\n _getActiveElements(e, lastActive, inChartArea, useFinalPosition) {\n if (e.type === 'mouseout') {\n return [];\n }\n if (!inChartArea) {\n return lastActive;\n }\n const hoverOptions = this.options.hover;\n return this.getElementsAtEventForMode(e, hoverOptions.mode, hoverOptions, useFinalPosition);\n }\n}\nfunction invalidatePlugins() {\n return each(Chart.instances, (chart)=>chart._plugins.invalidate());\n}\n\nfunction clipArc(ctx, element, endAngle) {\n const { startAngle , pixelMargin , x , y , outerRadius , innerRadius } = element;\n let angleMargin = pixelMargin / outerRadius;\n // Draw an inner border by clipping the arc and drawing a double-width border\n // Enlarge the clipping arc by 0.33 pixels to eliminate glitches between borders\n ctx.beginPath();\n ctx.arc(x, y, outerRadius, startAngle - angleMargin, endAngle + angleMargin);\n if (innerRadius > pixelMargin) {\n angleMargin = pixelMargin / innerRadius;\n ctx.arc(x, y, innerRadius, endAngle + angleMargin, startAngle - angleMargin, true);\n } else {\n ctx.arc(x, y, pixelMargin, endAngle + HALF_PI, startAngle - HALF_PI);\n }\n ctx.closePath();\n ctx.clip();\n}\nfunction toRadiusCorners(value) {\n return _readValueToProps(value, [\n 'outerStart',\n 'outerEnd',\n 'innerStart',\n 'innerEnd'\n ]);\n}\n/**\n * Parse border radius from the provided options\n */ function parseBorderRadius$1(arc, innerRadius, outerRadius, angleDelta) {\n const o = toRadiusCorners(arc.options.borderRadius);\n const halfThickness = (outerRadius - innerRadius) / 2;\n const innerLimit = Math.min(halfThickness, angleDelta * innerRadius / 2);\n // Outer limits are complicated. We want to compute the available angular distance at\n // a radius of outerRadius - borderRadius because for small angular distances, this term limits.\n // We compute at r = outerRadius - borderRadius because this circle defines the center of the border corners.\n //\n // If the borderRadius is large, that value can become negative.\n // This causes the outer borders to lose their radius entirely, which is rather unexpected. To solve that, if borderRadius > outerRadius\n // we know that the thickness term will dominate and compute the limits at that point\n const computeOuterLimit = (val)=>{\n const outerArcLimit = (outerRadius - Math.min(halfThickness, val)) * angleDelta / 2;\n return _limitValue(val, 0, Math.min(halfThickness, outerArcLimit));\n };\n return {\n outerStart: computeOuterLimit(o.outerStart),\n outerEnd: computeOuterLimit(o.outerEnd),\n innerStart: _limitValue(o.innerStart, 0, innerLimit),\n innerEnd: _limitValue(o.innerEnd, 0, innerLimit)\n };\n}\n/**\n * Convert (r, 𝜃) to (x, y)\n */ function rThetaToXY(r, theta, x, y) {\n return {\n x: x + r * Math.cos(theta),\n y: y + r * Math.sin(theta)\n };\n}\n/**\n * Path the arc, respecting border radius by separating into left and right halves.\n *\n * Start End\n *\n * 1--->a--->2 Outer\n * / \\\n * 8 3\n * | |\n * | |\n * 7 4\n * \\ /\n * 6<---b<---5 Inner\n */ function pathArc(ctx, element, offset, spacing, end, circular) {\n const { x , y , startAngle: start , pixelMargin , innerRadius: innerR } = element;\n const outerRadius = Math.max(element.outerRadius + spacing + offset - pixelMargin, 0);\n const innerRadius = innerR > 0 ? innerR + spacing + offset + pixelMargin : 0;\n let spacingOffset = 0;\n const alpha = end - start;\n if (spacing) {\n // When spacing is present, it is the same for all items\n // So we adjust the start and end angle of the arc such that\n // the distance is the same as it would be without the spacing\n const noSpacingInnerRadius = innerR > 0 ? innerR - spacing : 0;\n const noSpacingOuterRadius = outerRadius > 0 ? outerRadius - spacing : 0;\n const avNogSpacingRadius = (noSpacingInnerRadius + noSpacingOuterRadius) / 2;\n const adjustedAngle = avNogSpacingRadius !== 0 ? alpha * avNogSpacingRadius / (avNogSpacingRadius + spacing) : alpha;\n spacingOffset = (alpha - adjustedAngle) / 2;\n }\n const beta = Math.max(0.001, alpha * outerRadius - offset / PI) / outerRadius;\n const angleOffset = (alpha - beta) / 2;\n const startAngle = start + angleOffset + spacingOffset;\n const endAngle = end - angleOffset - spacingOffset;\n const { outerStart , outerEnd , innerStart , innerEnd } = parseBorderRadius$1(element, innerRadius, outerRadius, endAngle - startAngle);\n const outerStartAdjustedRadius = outerRadius - outerStart;\n const outerEndAdjustedRadius = outerRadius - outerEnd;\n const outerStartAdjustedAngle = startAngle + outerStart / outerStartAdjustedRadius;\n const outerEndAdjustedAngle = endAngle - outerEnd / outerEndAdjustedRadius;\n const innerStartAdjustedRadius = innerRadius + innerStart;\n const innerEndAdjustedRadius = innerRadius + innerEnd;\n const innerStartAdjustedAngle = startAngle + innerStart / innerStartAdjustedRadius;\n const innerEndAdjustedAngle = endAngle - innerEnd / innerEndAdjustedRadius;\n ctx.beginPath();\n if (circular) {\n // The first arc segments from point 1 to point a to point 2\n const outerMidAdjustedAngle = (outerStartAdjustedAngle + outerEndAdjustedAngle) / 2;\n ctx.arc(x, y, outerRadius, outerStartAdjustedAngle, outerMidAdjustedAngle);\n ctx.arc(x, y, outerRadius, outerMidAdjustedAngle, outerEndAdjustedAngle);\n // The corner segment from point 2 to point 3\n if (outerEnd > 0) {\n const pCenter = rThetaToXY(outerEndAdjustedRadius, outerEndAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, outerEnd, outerEndAdjustedAngle, endAngle + HALF_PI);\n }\n // The line from point 3 to point 4\n const p4 = rThetaToXY(innerEndAdjustedRadius, endAngle, x, y);\n ctx.lineTo(p4.x, p4.y);\n // The corner segment from point 4 to point 5\n if (innerEnd > 0) {\n const pCenter = rThetaToXY(innerEndAdjustedRadius, innerEndAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, innerEnd, endAngle + HALF_PI, innerEndAdjustedAngle + Math.PI);\n }\n // The inner arc from point 5 to point b to point 6\n const innerMidAdjustedAngle = (endAngle - innerEnd / innerRadius + (startAngle + innerStart / innerRadius)) / 2;\n ctx.arc(x, y, innerRadius, endAngle - innerEnd / innerRadius, innerMidAdjustedAngle, true);\n ctx.arc(x, y, innerRadius, innerMidAdjustedAngle, startAngle + innerStart / innerRadius, true);\n // The corner segment from point 6 to point 7\n if (innerStart > 0) {\n const pCenter = rThetaToXY(innerStartAdjustedRadius, innerStartAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, innerStart, innerStartAdjustedAngle + Math.PI, startAngle - HALF_PI);\n }\n // The line from point 7 to point 8\n const p8 = rThetaToXY(outerStartAdjustedRadius, startAngle, x, y);\n ctx.lineTo(p8.x, p8.y);\n // The corner segment from point 8 to point 1\n if (outerStart > 0) {\n const pCenter = rThetaToXY(outerStartAdjustedRadius, outerStartAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, outerStart, startAngle - HALF_PI, outerStartAdjustedAngle);\n }\n } else {\n ctx.moveTo(x, y);\n const outerStartX = Math.cos(outerStartAdjustedAngle) * outerRadius + x;\n const outerStartY = Math.sin(outerStartAdjustedAngle) * outerRadius + y;\n ctx.lineTo(outerStartX, outerStartY);\n const outerEndX = Math.cos(outerEndAdjustedAngle) * outerRadius + x;\n const outerEndY = Math.sin(outerEndAdjustedAngle) * outerRadius + y;\n ctx.lineTo(outerEndX, outerEndY);\n }\n ctx.closePath();\n}\nfunction drawArc(ctx, element, offset, spacing, circular) {\n const { fullCircles , startAngle , circumference } = element;\n let endAngle = element.endAngle;\n if (fullCircles) {\n pathArc(ctx, element, offset, spacing, endAngle, circular);\n for(let i = 0; i < fullCircles; ++i){\n ctx.fill();\n }\n if (!isNaN(circumference)) {\n endAngle = startAngle + (circumference % TAU || TAU);\n }\n }\n pathArc(ctx, element, offset, spacing, endAngle, circular);\n ctx.fill();\n return endAngle;\n}\nfunction drawBorder(ctx, element, offset, spacing, circular) {\n const { fullCircles , startAngle , circumference , options } = element;\n const { borderWidth , borderJoinStyle , borderDash , borderDashOffset } = options;\n const inner = options.borderAlign === 'inner';\n if (!borderWidth) {\n return;\n }\n ctx.setLineDash(borderDash || []);\n ctx.lineDashOffset = borderDashOffset;\n if (inner) {\n ctx.lineWidth = borderWidth * 2;\n ctx.lineJoin = borderJoinStyle || 'round';\n } else {\n ctx.lineWidth = borderWidth;\n ctx.lineJoin = borderJoinStyle || 'bevel';\n }\n let endAngle = element.endAngle;\n if (fullCircles) {\n pathArc(ctx, element, offset, spacing, endAngle, circular);\n for(let i = 0; i < fullCircles; ++i){\n ctx.stroke();\n }\n if (!isNaN(circumference)) {\n endAngle = startAngle + (circumference % TAU || TAU);\n }\n }\n if (inner) {\n clipArc(ctx, element, endAngle);\n }\n if (!fullCircles) {\n pathArc(ctx, element, offset, spacing, endAngle, circular);\n ctx.stroke();\n }\n}\nclass ArcElement extends Element {\n static id = 'arc';\n static defaults = {\n borderAlign: 'center',\n borderColor: '#fff',\n borderDash: [],\n borderDashOffset: 0,\n borderJoinStyle: undefined,\n borderRadius: 0,\n borderWidth: 2,\n offset: 0,\n spacing: 0,\n angle: undefined,\n circular: true\n };\n static defaultRoutes = {\n backgroundColor: 'backgroundColor'\n };\n static descriptors = {\n _scriptable: true,\n _indexable: (name)=>name !== 'borderDash'\n };\n circumference;\n endAngle;\n fullCircles;\n innerRadius;\n outerRadius;\n pixelMargin;\n startAngle;\n constructor(cfg){\n super();\n this.options = undefined;\n this.circumference = undefined;\n this.startAngle = undefined;\n this.endAngle = undefined;\n this.innerRadius = undefined;\n this.outerRadius = undefined;\n this.pixelMargin = 0;\n this.fullCircles = 0;\n if (cfg) {\n Object.assign(this, cfg);\n }\n }\n inRange(chartX, chartY, useFinalPosition) {\n const point = this.getProps([\n 'x',\n 'y'\n ], useFinalPosition);\n const { angle , distance } = getAngleFromPoint(point, {\n x: chartX,\n y: chartY\n });\n const { startAngle , endAngle , innerRadius , outerRadius , circumference } = this.getProps([\n 'startAngle',\n 'endAngle',\n 'innerRadius',\n 'outerRadius',\n 'circumference'\n ], useFinalPosition);\n const rAdjust = (this.options.spacing + this.options.borderWidth) / 2;\n const _circumference = valueOrDefault(circumference, endAngle - startAngle);\n const betweenAngles = _circumference >= TAU || _angleBetween(angle, startAngle, endAngle);\n const withinRadius = _isBetween(distance, innerRadius + rAdjust, outerRadius + rAdjust);\n return betweenAngles && withinRadius;\n }\n getCenterPoint(useFinalPosition) {\n const { x , y , startAngle , endAngle , innerRadius , outerRadius } = this.getProps([\n 'x',\n 'y',\n 'startAngle',\n 'endAngle',\n 'innerRadius',\n 'outerRadius'\n ], useFinalPosition);\n const { offset , spacing } = this.options;\n const halfAngle = (startAngle + endAngle) / 2;\n const halfRadius = (innerRadius + outerRadius + spacing + offset) / 2;\n return {\n x: x + Math.cos(halfAngle) * halfRadius,\n y: y + Math.sin(halfAngle) * halfRadius\n };\n }\n tooltipPosition(useFinalPosition) {\n return this.getCenterPoint(useFinalPosition);\n }\n draw(ctx) {\n const { options , circumference } = this;\n const offset = (options.offset || 0) / 4;\n const spacing = (options.spacing || 0) / 2;\n const circular = options.circular;\n this.pixelMargin = options.borderAlign === 'inner' ? 0.33 : 0;\n this.fullCircles = circumference > TAU ? Math.floor(circumference / TAU) : 0;\n if (circumference === 0 || this.innerRadius < 0 || this.outerRadius < 0) {\n return;\n }\n ctx.save();\n const halfAngle = (this.startAngle + this.endAngle) / 2;\n ctx.translate(Math.cos(halfAngle) * offset, Math.sin(halfAngle) * offset);\n const fix = 1 - Math.sin(Math.min(PI, circumference || 0));\n const radiusOffset = offset * fix;\n ctx.fillStyle = options.backgroundColor;\n ctx.strokeStyle = options.borderColor;\n drawArc(ctx, this, radiusOffset, spacing, circular);\n drawBorder(ctx, this, radiusOffset, spacing, circular);\n ctx.restore();\n }\n}\n\nfunction setStyle(ctx, options, style = options) {\n ctx.lineCap = valueOrDefault(style.borderCapStyle, options.borderCapStyle);\n ctx.setLineDash(valueOrDefault(style.borderDash, options.borderDash));\n ctx.lineDashOffset = valueOrDefault(style.borderDashOffset, options.borderDashOffset);\n ctx.lineJoin = valueOrDefault(style.borderJoinStyle, options.borderJoinStyle);\n ctx.lineWidth = valueOrDefault(style.borderWidth, options.borderWidth);\n ctx.strokeStyle = valueOrDefault(style.borderColor, options.borderColor);\n}\nfunction lineTo(ctx, previous, target) {\n ctx.lineTo(target.x, target.y);\n}\n function getLineMethod(options) {\n if (options.stepped) {\n return _steppedLineTo;\n }\n if (options.tension || options.cubicInterpolationMode === 'monotone') {\n return _bezierCurveTo;\n }\n return lineTo;\n}\nfunction pathVars(points, segment, params = {}) {\n const count = points.length;\n const { start: paramsStart = 0 , end: paramsEnd = count - 1 } = params;\n const { start: segmentStart , end: segmentEnd } = segment;\n const start = Math.max(paramsStart, segmentStart);\n const end = Math.min(paramsEnd, segmentEnd);\n const outside = paramsStart < segmentStart && paramsEnd < segmentStart || paramsStart > segmentEnd && paramsEnd > segmentEnd;\n return {\n count,\n start,\n loop: segment.loop,\n ilen: end < start && !outside ? count + end - start : end - start\n };\n}\n function pathSegment(ctx, line, segment, params) {\n const { points , options } = line;\n const { count , start , loop , ilen } = pathVars(points, segment, params);\n const lineMethod = getLineMethod(options);\n let { move =true , reverse } = params || {};\n let i, point, prev;\n for(i = 0; i <= ilen; ++i){\n point = points[(start + (reverse ? ilen - i : i)) % count];\n if (point.skip) {\n continue;\n } else if (move) {\n ctx.moveTo(point.x, point.y);\n move = false;\n } else {\n lineMethod(ctx, prev, point, reverse, options.stepped);\n }\n prev = point;\n }\n if (loop) {\n point = points[(start + (reverse ? ilen : 0)) % count];\n lineMethod(ctx, prev, point, reverse, options.stepped);\n }\n return !!loop;\n}\n function fastPathSegment(ctx, line, segment, params) {\n const points = line.points;\n const { count , start , ilen } = pathVars(points, segment, params);\n const { move =true , reverse } = params || {};\n let avgX = 0;\n let countX = 0;\n let i, point, prevX, minY, maxY, lastY;\n const pointIndex = (index)=>(start + (reverse ? ilen - index : index)) % count;\n const drawX = ()=>{\n if (minY !== maxY) {\n ctx.lineTo(avgX, maxY);\n ctx.lineTo(avgX, minY);\n ctx.lineTo(avgX, lastY);\n }\n };\n if (move) {\n point = points[pointIndex(0)];\n ctx.moveTo(point.x, point.y);\n }\n for(i = 0; i <= ilen; ++i){\n point = points[pointIndex(i)];\n if (point.skip) {\n continue;\n }\n const x = point.x;\n const y = point.y;\n const truncX = x | 0;\n if (truncX === prevX) {\n if (y < minY) {\n minY = y;\n } else if (y > maxY) {\n maxY = y;\n }\n avgX = (countX * avgX + x) / ++countX;\n } else {\n drawX();\n ctx.lineTo(x, y);\n prevX = truncX;\n countX = 0;\n minY = maxY = y;\n }\n lastY = y;\n }\n drawX();\n}\n function _getSegmentMethod(line) {\n const opts = line.options;\n const borderDash = opts.borderDash && opts.borderDash.length;\n const useFastPath = !line._decimated && !line._loop && !opts.tension && opts.cubicInterpolationMode !== 'monotone' && !opts.stepped && !borderDash;\n return useFastPath ? fastPathSegment : pathSegment;\n}\n function _getInterpolationMethod(options) {\n if (options.stepped) {\n return _steppedInterpolation;\n }\n if (options.tension || options.cubicInterpolationMode === 'monotone') {\n return _bezierInterpolation;\n }\n return _pointInLine;\n}\nfunction strokePathWithCache(ctx, line, start, count) {\n let path = line._path;\n if (!path) {\n path = line._path = new Path2D();\n if (line.path(path, start, count)) {\n path.closePath();\n }\n }\n setStyle(ctx, line.options);\n ctx.stroke(path);\n}\nfunction strokePathDirect(ctx, line, start, count) {\n const { segments , options } = line;\n const segmentMethod = _getSegmentMethod(line);\n for (const segment of segments){\n setStyle(ctx, options, segment.style);\n ctx.beginPath();\n if (segmentMethod(ctx, line, segment, {\n start,\n end: start + count - 1\n })) {\n ctx.closePath();\n }\n ctx.stroke();\n }\n}\nconst usePath2D = typeof Path2D === 'function';\nfunction draw(ctx, line, start, count) {\n if (usePath2D && !line.options.segment) {\n strokePathWithCache(ctx, line, start, count);\n } else {\n strokePathDirect(ctx, line, start, count);\n }\n}\nclass LineElement extends Element {\n static id = 'line';\n static defaults = {\n borderCapStyle: 'butt',\n borderDash: [],\n borderDashOffset: 0,\n borderJoinStyle: 'miter',\n borderWidth: 3,\n capBezierPoints: true,\n cubicInterpolationMode: 'default',\n fill: false,\n spanGaps: false,\n stepped: false,\n tension: 0\n };\n static defaultRoutes = {\n backgroundColor: 'backgroundColor',\n borderColor: 'borderColor'\n };\n static descriptors = {\n _scriptable: true,\n _indexable: (name)=>name !== 'borderDash' && name !== 'fill'\n };\n constructor(cfg){\n super();\n this.animated = true;\n this.options = undefined;\n this._chart = undefined;\n this._loop = undefined;\n this._fullLoop = undefined;\n this._path = undefined;\n this._points = undefined;\n this._segments = undefined;\n this._decimated = false;\n this._pointsUpdated = false;\n this._datasetIndex = undefined;\n if (cfg) {\n Object.assign(this, cfg);\n }\n }\n updateControlPoints(chartArea, indexAxis) {\n const options = this.options;\n if ((options.tension || options.cubicInterpolationMode === 'monotone') && !options.stepped && !this._pointsUpdated) {\n const loop = options.spanGaps ? this._loop : this._fullLoop;\n _updateBezierControlPoints(this._points, options, chartArea, loop, indexAxis);\n this._pointsUpdated = true;\n }\n }\n set points(points) {\n this._points = points;\n delete this._segments;\n delete this._path;\n this._pointsUpdated = false;\n }\n get points() {\n return this._points;\n }\n get segments() {\n return this._segments || (this._segments = _computeSegments(this, this.options.segment));\n }\n first() {\n const segments = this.segments;\n const points = this.points;\n return segments.length && points[segments[0].start];\n }\n last() {\n const segments = this.segments;\n const points = this.points;\n const count = segments.length;\n return count && points[segments[count - 1].end];\n }\n interpolate(point, property) {\n const options = this.options;\n const value = point[property];\n const points = this.points;\n const segments = _boundSegments(this, {\n property,\n start: value,\n end: value\n });\n if (!segments.length) {\n return;\n }\n const result = [];\n const _interpolate = _getInterpolationMethod(options);\n let i, ilen;\n for(i = 0, ilen = segments.length; i < ilen; ++i){\n const { start , end } = segments[i];\n const p1 = points[start];\n const p2 = points[end];\n if (p1 === p2) {\n result.push(p1);\n continue;\n }\n const t = Math.abs((value - p1[property]) / (p2[property] - p1[property]));\n const interpolated = _interpolate(p1, p2, t, options.stepped);\n interpolated[property] = point[property];\n result.push(interpolated);\n }\n return result.length === 1 ? result[0] : result;\n }\n pathSegment(ctx, segment, params) {\n const segmentMethod = _getSegmentMethod(this);\n return segmentMethod(ctx, this, segment, params);\n }\n path(ctx, start, count) {\n const segments = this.segments;\n const segmentMethod = _getSegmentMethod(this);\n let loop = this._loop;\n start = start || 0;\n count = count || this.points.length - start;\n for (const segment of segments){\n loop &= segmentMethod(ctx, this, segment, {\n start,\n end: start + count - 1\n });\n }\n return !!loop;\n }\n draw(ctx, chartArea, start, count) {\n const options = this.options || {};\n const points = this.points || [];\n if (points.length && options.borderWidth) {\n ctx.save();\n draw(ctx, this, start, count);\n ctx.restore();\n }\n if (this.animated) {\n this._pointsUpdated = false;\n this._path = undefined;\n }\n }\n}\n\nfunction inRange$1(el, pos, axis, useFinalPosition) {\n const options = el.options;\n const { [axis]: value } = el.getProps([\n axis\n ], useFinalPosition);\n return Math.abs(pos - value) < options.radius + options.hitRadius;\n}\nclass PointElement extends Element {\n static id = 'point';\n parsed;\n skip;\n stop;\n /**\n * @type {any}\n */ static defaults = {\n borderWidth: 1,\n hitRadius: 1,\n hoverBorderWidth: 1,\n hoverRadius: 4,\n pointStyle: 'circle',\n radius: 3,\n rotation: 0\n };\n /**\n * @type {any}\n */ static defaultRoutes = {\n backgroundColor: 'backgroundColor',\n borderColor: 'borderColor'\n };\n constructor(cfg){\n super();\n this.options = undefined;\n this.parsed = undefined;\n this.skip = undefined;\n this.stop = undefined;\n if (cfg) {\n Object.assign(this, cfg);\n }\n }\n inRange(mouseX, mouseY, useFinalPosition) {\n const options = this.options;\n const { x , y } = this.getProps([\n 'x',\n 'y'\n ], useFinalPosition);\n return Math.pow(mouseX - x, 2) + Math.pow(mouseY - y, 2) < Math.pow(options.hitRadius + options.radius, 2);\n }\n inXRange(mouseX, useFinalPosition) {\n return inRange$1(this, mouseX, 'x', useFinalPosition);\n }\n inYRange(mouseY, useFinalPosition) {\n return inRange$1(this, mouseY, 'y', useFinalPosition);\n }\n getCenterPoint(useFinalPosition) {\n const { x , y } = this.getProps([\n 'x',\n 'y'\n ], useFinalPosition);\n return {\n x,\n y\n };\n }\n size(options) {\n options = options || this.options || {};\n let radius = options.radius || 0;\n radius = Math.max(radius, radius && options.hoverRadius || 0);\n const borderWidth = radius && options.borderWidth || 0;\n return (radius + borderWidth) * 2;\n }\n draw(ctx, area) {\n const options = this.options;\n if (this.skip || options.radius < 0.1 || !_isPointInArea(this, area, this.size(options) / 2)) {\n return;\n }\n ctx.strokeStyle = options.borderColor;\n ctx.lineWidth = options.borderWidth;\n ctx.fillStyle = options.backgroundColor;\n drawPoint(ctx, options, this.x, this.y);\n }\n getRange() {\n const options = this.options || {};\n // @ts-expect-error Fallbacks should never be hit in practice\n return options.radius + options.hitRadius;\n }\n}\n\nfunction getBarBounds(bar, useFinalPosition) {\n const { x , y , base , width , height } = bar.getProps([\n 'x',\n 'y',\n 'base',\n 'width',\n 'height'\n ], useFinalPosition);\n let left, right, top, bottom, half;\n if (bar.horizontal) {\n half = height / 2;\n left = Math.min(x, base);\n right = Math.max(x, base);\n top = y - half;\n bottom = y + half;\n } else {\n half = width / 2;\n left = x - half;\n right = x + half;\n top = Math.min(y, base);\n bottom = Math.max(y, base);\n }\n return {\n left,\n top,\n right,\n bottom\n };\n}\nfunction skipOrLimit(skip, value, min, max) {\n return skip ? 0 : _limitValue(value, min, max);\n}\nfunction parseBorderWidth(bar, maxW, maxH) {\n const value = bar.options.borderWidth;\n const skip = bar.borderSkipped;\n const o = toTRBL(value);\n return {\n t: skipOrLimit(skip.top, o.top, 0, maxH),\n r: skipOrLimit(skip.right, o.right, 0, maxW),\n b: skipOrLimit(skip.bottom, o.bottom, 0, maxH),\n l: skipOrLimit(skip.left, o.left, 0, maxW)\n };\n}\nfunction parseBorderRadius(bar, maxW, maxH) {\n const { enableBorderRadius } = bar.getProps([\n 'enableBorderRadius'\n ]);\n const value = bar.options.borderRadius;\n const o = toTRBLCorners(value);\n const maxR = Math.min(maxW, maxH);\n const skip = bar.borderSkipped;\n const enableBorder = enableBorderRadius || isObject(value);\n return {\n topLeft: skipOrLimit(!enableBorder || skip.top || skip.left, o.topLeft, 0, maxR),\n topRight: skipOrLimit(!enableBorder || skip.top || skip.right, o.topRight, 0, maxR),\n bottomLeft: skipOrLimit(!enableBorder || skip.bottom || skip.left, o.bottomLeft, 0, maxR),\n bottomRight: skipOrLimit(!enableBorder || skip.bottom || skip.right, o.bottomRight, 0, maxR)\n };\n}\nfunction boundingRects(bar) {\n const bounds = getBarBounds(bar);\n const width = bounds.right - bounds.left;\n const height = bounds.bottom - bounds.top;\n const border = parseBorderWidth(bar, width / 2, height / 2);\n const radius = parseBorderRadius(bar, width / 2, height / 2);\n return {\n outer: {\n x: bounds.left,\n y: bounds.top,\n w: width,\n h: height,\n radius\n },\n inner: {\n x: bounds.left + border.l,\n y: bounds.top + border.t,\n w: width - border.l - border.r,\n h: height - border.t - border.b,\n radius: {\n topLeft: Math.max(0, radius.topLeft - Math.max(border.t, border.l)),\n topRight: Math.max(0, radius.topRight - Math.max(border.t, border.r)),\n bottomLeft: Math.max(0, radius.bottomLeft - Math.max(border.b, border.l)),\n bottomRight: Math.max(0, radius.bottomRight - Math.max(border.b, border.r))\n }\n }\n };\n}\nfunction inRange(bar, x, y, useFinalPosition) {\n const skipX = x === null;\n const skipY = y === null;\n const skipBoth = skipX && skipY;\n const bounds = bar && !skipBoth && getBarBounds(bar, useFinalPosition);\n return bounds && (skipX || _isBetween(x, bounds.left, bounds.right)) && (skipY || _isBetween(y, bounds.top, bounds.bottom));\n}\nfunction hasRadius(radius) {\n return radius.topLeft || radius.topRight || radius.bottomLeft || radius.bottomRight;\n}\n function addNormalRectPath(ctx, rect) {\n ctx.rect(rect.x, rect.y, rect.w, rect.h);\n}\nfunction inflateRect(rect, amount, refRect = {}) {\n const x = rect.x !== refRect.x ? -amount : 0;\n const y = rect.y !== refRect.y ? -amount : 0;\n const w = (rect.x + rect.w !== refRect.x + refRect.w ? amount : 0) - x;\n const h = (rect.y + rect.h !== refRect.y + refRect.h ? amount : 0) - y;\n return {\n x: rect.x + x,\n y: rect.y + y,\n w: rect.w + w,\n h: rect.h + h,\n radius: rect.radius\n };\n}\nclass BarElement extends Element {\n static id = 'bar';\n static defaults = {\n borderSkipped: 'start',\n borderWidth: 0,\n borderRadius: 0,\n inflateAmount: 'auto',\n pointStyle: undefined\n };\n static defaultRoutes = {\n backgroundColor: 'backgroundColor',\n borderColor: 'borderColor'\n };\n constructor(cfg){\n super();\n this.options = undefined;\n this.horizontal = undefined;\n this.base = undefined;\n this.width = undefined;\n this.height = undefined;\n this.inflateAmount = undefined;\n if (cfg) {\n Object.assign(this, cfg);\n }\n }\n draw(ctx) {\n const { inflateAmount , options: { borderColor , backgroundColor } } = this;\n const { inner , outer } = boundingRects(this);\n const addRectPath = hasRadius(outer.radius) ? addRoundedRectPath : addNormalRectPath;\n ctx.save();\n if (outer.w !== inner.w || outer.h !== inner.h) {\n ctx.beginPath();\n addRectPath(ctx, inflateRect(outer, inflateAmount, inner));\n ctx.clip();\n addRectPath(ctx, inflateRect(inner, -inflateAmount, outer));\n ctx.fillStyle = borderColor;\n ctx.fill('evenodd');\n }\n ctx.beginPath();\n addRectPath(ctx, inflateRect(inner, inflateAmount));\n ctx.fillStyle = backgroundColor;\n ctx.fill();\n ctx.restore();\n }\n inRange(mouseX, mouseY, useFinalPosition) {\n return inRange(this, mouseX, mouseY, useFinalPosition);\n }\n inXRange(mouseX, useFinalPosition) {\n return inRange(this, mouseX, null, useFinalPosition);\n }\n inYRange(mouseY, useFinalPosition) {\n return inRange(this, null, mouseY, useFinalPosition);\n }\n getCenterPoint(useFinalPosition) {\n const { x , y , base , horizontal } = this.getProps([\n 'x',\n 'y',\n 'base',\n 'horizontal'\n ], useFinalPosition);\n return {\n x: horizontal ? (x + base) / 2 : x,\n y: horizontal ? y : (y + base) / 2\n };\n }\n getRange(axis) {\n return axis === 'x' ? this.width / 2 : this.height / 2;\n }\n}\n\nvar elements = /*#__PURE__*/Object.freeze({\n__proto__: null,\nArcElement: ArcElement,\nBarElement: BarElement,\nLineElement: LineElement,\nPointElement: PointElement\n});\n\nconst BORDER_COLORS = [\n 'rgb(54, 162, 235)',\n 'rgb(255, 99, 132)',\n 'rgb(255, 159, 64)',\n 'rgb(255, 205, 86)',\n 'rgb(75, 192, 192)',\n 'rgb(153, 102, 255)',\n 'rgb(201, 203, 207)' // grey\n];\n// Border colors with 50% transparency\nconst BACKGROUND_COLORS = /* #__PURE__ */ BORDER_COLORS.map((color)=>color.replace('rgb(', 'rgba(').replace(')', ', 0.5)'));\nfunction getBorderColor(i) {\n return BORDER_COLORS[i % BORDER_COLORS.length];\n}\nfunction getBackgroundColor(i) {\n return BACKGROUND_COLORS[i % BACKGROUND_COLORS.length];\n}\nfunction colorizeDefaultDataset(dataset, i) {\n dataset.borderColor = getBorderColor(i);\n dataset.backgroundColor = getBackgroundColor(i);\n return ++i;\n}\nfunction colorizeDoughnutDataset(dataset, i) {\n dataset.backgroundColor = dataset.data.map(()=>getBorderColor(i++));\n return i;\n}\nfunction colorizePolarAreaDataset(dataset, i) {\n dataset.backgroundColor = dataset.data.map(()=>getBackgroundColor(i++));\n return i;\n}\nfunction getColorizer(chart) {\n let i = 0;\n return (dataset, datasetIndex)=>{\n const controller = chart.getDatasetMeta(datasetIndex).controller;\n if (controller instanceof DoughnutController) {\n i = colorizeDoughnutDataset(dataset, i);\n } else if (controller instanceof PolarAreaController) {\n i = colorizePolarAreaDataset(dataset, i);\n } else if (controller) {\n i = colorizeDefaultDataset(dataset, i);\n }\n };\n}\nfunction containsColorsDefinitions(descriptors) {\n let k;\n for(k in descriptors){\n if (descriptors[k].borderColor || descriptors[k].backgroundColor) {\n return true;\n }\n }\n return false;\n}\nfunction containsColorsDefinition(descriptor) {\n return descriptor && (descriptor.borderColor || descriptor.backgroundColor);\n}\nvar plugin_colors = {\n id: 'colors',\n defaults: {\n enabled: true,\n forceOverride: false\n },\n beforeLayout (chart, _args, options) {\n if (!options.enabled) {\n return;\n }\n const { data: { datasets } , options: chartOptions } = chart.config;\n const { elements } = chartOptions;\n if (!options.forceOverride && (containsColorsDefinitions(datasets) || containsColorsDefinition(chartOptions) || elements && containsColorsDefinitions(elements))) {\n return;\n }\n const colorizer = getColorizer(chart);\n datasets.forEach(colorizer);\n }\n};\n\nfunction lttbDecimation(data, start, count, availableWidth, options) {\n const samples = options.samples || availableWidth;\n if (samples >= count) {\n return data.slice(start, start + count);\n }\n const decimated = [];\n const bucketWidth = (count - 2) / (samples - 2);\n let sampledIndex = 0;\n const endIndex = start + count - 1;\n let a = start;\n let i, maxAreaPoint, maxArea, area, nextA;\n decimated[sampledIndex++] = data[a];\n for(i = 0; i < samples - 2; i++){\n let avgX = 0;\n let avgY = 0;\n let j;\n const avgRangeStart = Math.floor((i + 1) * bucketWidth) + 1 + start;\n const avgRangeEnd = Math.min(Math.floor((i + 2) * bucketWidth) + 1, count) + start;\n const avgRangeLength = avgRangeEnd - avgRangeStart;\n for(j = avgRangeStart; j < avgRangeEnd; j++){\n avgX += data[j].x;\n avgY += data[j].y;\n }\n avgX /= avgRangeLength;\n avgY /= avgRangeLength;\n const rangeOffs = Math.floor(i * bucketWidth) + 1 + start;\n const rangeTo = Math.min(Math.floor((i + 1) * bucketWidth) + 1, count) + start;\n const { x: pointAx , y: pointAy } = data[a];\n maxArea = area = -1;\n for(j = rangeOffs; j < rangeTo; j++){\n area = 0.5 * Math.abs((pointAx - avgX) * (data[j].y - pointAy) - (pointAx - data[j].x) * (avgY - pointAy));\n if (area > maxArea) {\n maxArea = area;\n maxAreaPoint = data[j];\n nextA = j;\n }\n }\n decimated[sampledIndex++] = maxAreaPoint;\n a = nextA;\n }\n decimated[sampledIndex++] = data[endIndex];\n return decimated;\n}\nfunction minMaxDecimation(data, start, count, availableWidth) {\n let avgX = 0;\n let countX = 0;\n let i, point, x, y, prevX, minIndex, maxIndex, startIndex, minY, maxY;\n const decimated = [];\n const endIndex = start + count - 1;\n const xMin = data[start].x;\n const xMax = data[endIndex].x;\n const dx = xMax - xMin;\n for(i = start; i < start + count; ++i){\n point = data[i];\n x = (point.x - xMin) / dx * availableWidth;\n y = point.y;\n const truncX = x | 0;\n if (truncX === prevX) {\n if (y < minY) {\n minY = y;\n minIndex = i;\n } else if (y > maxY) {\n maxY = y;\n maxIndex = i;\n }\n avgX = (countX * avgX + point.x) / ++countX;\n } else {\n const lastIndex = i - 1;\n if (!isNullOrUndef(minIndex) && !isNullOrUndef(maxIndex)) {\n const intermediateIndex1 = Math.min(minIndex, maxIndex);\n const intermediateIndex2 = Math.max(minIndex, maxIndex);\n if (intermediateIndex1 !== startIndex && intermediateIndex1 !== lastIndex) {\n decimated.push({\n ...data[intermediateIndex1],\n x: avgX\n });\n }\n if (intermediateIndex2 !== startIndex && intermediateIndex2 !== lastIndex) {\n decimated.push({\n ...data[intermediateIndex2],\n x: avgX\n });\n }\n }\n if (i > 0 && lastIndex !== startIndex) {\n decimated.push(data[lastIndex]);\n }\n decimated.push(point);\n prevX = truncX;\n countX = 0;\n minY = maxY = y;\n minIndex = maxIndex = startIndex = i;\n }\n }\n return decimated;\n}\nfunction cleanDecimatedDataset(dataset) {\n if (dataset._decimated) {\n const data = dataset._data;\n delete dataset._decimated;\n delete dataset._data;\n Object.defineProperty(dataset, 'data', {\n configurable: true,\n enumerable: true,\n writable: true,\n value: data\n });\n }\n}\nfunction cleanDecimatedData(chart) {\n chart.data.datasets.forEach((dataset)=>{\n cleanDecimatedDataset(dataset);\n });\n}\nfunction getStartAndCountOfVisiblePointsSimplified(meta, points) {\n const pointCount = points.length;\n let start = 0;\n let count;\n const { iScale } = meta;\n const { min , max , minDefined , maxDefined } = iScale.getUserBounds();\n if (minDefined) {\n start = _limitValue(_lookupByKey(points, iScale.axis, min).lo, 0, pointCount - 1);\n }\n if (maxDefined) {\n count = _limitValue(_lookupByKey(points, iScale.axis, max).hi + 1, start, pointCount) - start;\n } else {\n count = pointCount - start;\n }\n return {\n start,\n count\n };\n}\nvar plugin_decimation = {\n id: 'decimation',\n defaults: {\n algorithm: 'min-max',\n enabled: false\n },\n beforeElementsUpdate: (chart, args, options)=>{\n if (!options.enabled) {\n cleanDecimatedData(chart);\n return;\n }\n const availableWidth = chart.width;\n chart.data.datasets.forEach((dataset, datasetIndex)=>{\n const { _data , indexAxis } = dataset;\n const meta = chart.getDatasetMeta(datasetIndex);\n const data = _data || dataset.data;\n if (resolve([\n indexAxis,\n chart.options.indexAxis\n ]) === 'y') {\n return;\n }\n if (!meta.controller.supportsDecimation) {\n return;\n }\n const xAxis = chart.scales[meta.xAxisID];\n if (xAxis.type !== 'linear' && xAxis.type !== 'time') {\n return;\n }\n if (chart.options.parsing) {\n return;\n }\n let { start , count } = getStartAndCountOfVisiblePointsSimplified(meta, data);\n const threshold = options.threshold || 4 * availableWidth;\n if (count <= threshold) {\n cleanDecimatedDataset(dataset);\n return;\n }\n if (isNullOrUndef(_data)) {\n dataset._data = data;\n delete dataset.data;\n Object.defineProperty(dataset, 'data', {\n configurable: true,\n enumerable: true,\n get: function() {\n return this._decimated;\n },\n set: function(d) {\n this._data = d;\n }\n });\n }\n let decimated;\n switch(options.algorithm){\n case 'lttb':\n decimated = lttbDecimation(data, start, count, availableWidth, options);\n break;\n case 'min-max':\n decimated = minMaxDecimation(data, start, count, availableWidth);\n break;\n default:\n throw new Error(`Unsupported decimation algorithm '${options.algorithm}'`);\n }\n dataset._decimated = decimated;\n });\n },\n destroy (chart) {\n cleanDecimatedData(chart);\n }\n};\n\nfunction _segments(line, target, property) {\n const segments = line.segments;\n const points = line.points;\n const tpoints = target.points;\n const parts = [];\n for (const segment of segments){\n let { start , end } = segment;\n end = _findSegmentEnd(start, end, points);\n const bounds = _getBounds(property, points[start], points[end], segment.loop);\n if (!target.segments) {\n parts.push({\n source: segment,\n target: bounds,\n start: points[start],\n end: points[end]\n });\n continue;\n }\n const targetSegments = _boundSegments(target, bounds);\n for (const tgt of targetSegments){\n const subBounds = _getBounds(property, tpoints[tgt.start], tpoints[tgt.end], tgt.loop);\n const fillSources = _boundSegment(segment, points, subBounds);\n for (const fillSource of fillSources){\n parts.push({\n source: fillSource,\n target: tgt,\n start: {\n [property]: _getEdge(bounds, subBounds, 'start', Math.max)\n },\n end: {\n [property]: _getEdge(bounds, subBounds, 'end', Math.min)\n }\n });\n }\n }\n }\n return parts;\n}\nfunction _getBounds(property, first, last, loop) {\n if (loop) {\n return;\n }\n let start = first[property];\n let end = last[property];\n if (property === 'angle') {\n start = _normalizeAngle(start);\n end = _normalizeAngle(end);\n }\n return {\n property,\n start,\n end\n };\n}\nfunction _pointsFromSegments(boundary, line) {\n const { x =null , y =null } = boundary || {};\n const linePoints = line.points;\n const points = [];\n line.segments.forEach(({ start , end })=>{\n end = _findSegmentEnd(start, end, linePoints);\n const first = linePoints[start];\n const last = linePoints[end];\n if (y !== null) {\n points.push({\n x: first.x,\n y\n });\n points.push({\n x: last.x,\n y\n });\n } else if (x !== null) {\n points.push({\n x,\n y: first.y\n });\n points.push({\n x,\n y: last.y\n });\n }\n });\n return points;\n}\nfunction _findSegmentEnd(start, end, points) {\n for(; end > start; end--){\n const point = points[end];\n if (!isNaN(point.x) && !isNaN(point.y)) {\n break;\n }\n }\n return end;\n}\nfunction _getEdge(a, b, prop, fn) {\n if (a && b) {\n return fn(a[prop], b[prop]);\n }\n return a ? a[prop] : b ? b[prop] : 0;\n}\n\nfunction _createBoundaryLine(boundary, line) {\n let points = [];\n let _loop = false;\n if (isArray(boundary)) {\n _loop = true;\n points = boundary;\n } else {\n points = _pointsFromSegments(boundary, line);\n }\n return points.length ? new LineElement({\n points,\n options: {\n tension: 0\n },\n _loop,\n _fullLoop: _loop\n }) : null;\n}\nfunction _shouldApplyFill(source) {\n return source && source.fill !== false;\n}\n\nfunction _resolveTarget(sources, index, propagate) {\n const source = sources[index];\n let fill = source.fill;\n const visited = [\n index\n ];\n let target;\n if (!propagate) {\n return fill;\n }\n while(fill !== false && visited.indexOf(fill) === -1){\n if (!isNumberFinite(fill)) {\n return fill;\n }\n target = sources[fill];\n if (!target) {\n return false;\n }\n if (target.visible) {\n return fill;\n }\n visited.push(fill);\n fill = target.fill;\n }\n return false;\n}\n function _decodeFill(line, index, count) {\n const fill = parseFillOption(line);\n if (isObject(fill)) {\n return isNaN(fill.value) ? false : fill;\n }\n let target = parseFloat(fill);\n if (isNumberFinite(target) && Math.floor(target) === target) {\n return decodeTargetIndex(fill[0], index, target, count);\n }\n return [\n 'origin',\n 'start',\n 'end',\n 'stack',\n 'shape'\n ].indexOf(fill) >= 0 && fill;\n}\nfunction decodeTargetIndex(firstCh, index, target, count) {\n if (firstCh === '-' || firstCh === '+') {\n target = index + target;\n }\n if (target === index || target < 0 || target >= count) {\n return false;\n }\n return target;\n}\n function _getTargetPixel(fill, scale) {\n let pixel = null;\n if (fill === 'start') {\n pixel = scale.bottom;\n } else if (fill === 'end') {\n pixel = scale.top;\n } else if (isObject(fill)) {\n pixel = scale.getPixelForValue(fill.value);\n } else if (scale.getBasePixel) {\n pixel = scale.getBasePixel();\n }\n return pixel;\n}\n function _getTargetValue(fill, scale, startValue) {\n let value;\n if (fill === 'start') {\n value = startValue;\n } else if (fill === 'end') {\n value = scale.options.reverse ? scale.min : scale.max;\n } else if (isObject(fill)) {\n value = fill.value;\n } else {\n value = scale.getBaseValue();\n }\n return value;\n}\n function parseFillOption(line) {\n const options = line.options;\n const fillOption = options.fill;\n let fill = valueOrDefault(fillOption && fillOption.target, fillOption);\n if (fill === undefined) {\n fill = !!options.backgroundColor;\n }\n if (fill === false || fill === null) {\n return false;\n }\n if (fill === true) {\n return 'origin';\n }\n return fill;\n}\n\nfunction _buildStackLine(source) {\n const { scale , index , line } = source;\n const points = [];\n const segments = line.segments;\n const sourcePoints = line.points;\n const linesBelow = getLinesBelow(scale, index);\n linesBelow.push(_createBoundaryLine({\n x: null,\n y: scale.bottom\n }, line));\n for(let i = 0; i < segments.length; i++){\n const segment = segments[i];\n for(let j = segment.start; j <= segment.end; j++){\n addPointsBelow(points, sourcePoints[j], linesBelow);\n }\n }\n return new LineElement({\n points,\n options: {}\n });\n}\n function getLinesBelow(scale, index) {\n const below = [];\n const metas = scale.getMatchingVisibleMetas('line');\n for(let i = 0; i < metas.length; i++){\n const meta = metas[i];\n if (meta.index === index) {\n break;\n }\n if (!meta.hidden) {\n below.unshift(meta.dataset);\n }\n }\n return below;\n}\n function addPointsBelow(points, sourcePoint, linesBelow) {\n const postponed = [];\n for(let j = 0; j < linesBelow.length; j++){\n const line = linesBelow[j];\n const { first , last , point } = findPoint(line, sourcePoint, 'x');\n if (!point || first && last) {\n continue;\n }\n if (first) {\n postponed.unshift(point);\n } else {\n points.push(point);\n if (!last) {\n break;\n }\n }\n }\n points.push(...postponed);\n}\n function findPoint(line, sourcePoint, property) {\n const point = line.interpolate(sourcePoint, property);\n if (!point) {\n return {};\n }\n const pointValue = point[property];\n const segments = line.segments;\n const linePoints = line.points;\n let first = false;\n let last = false;\n for(let i = 0; i < segments.length; i++){\n const segment = segments[i];\n const firstValue = linePoints[segment.start][property];\n const lastValue = linePoints[segment.end][property];\n if (_isBetween(pointValue, firstValue, lastValue)) {\n first = pointValue === firstValue;\n last = pointValue === lastValue;\n break;\n }\n }\n return {\n first,\n last,\n point\n };\n}\n\nclass simpleArc {\n constructor(opts){\n this.x = opts.x;\n this.y = opts.y;\n this.radius = opts.radius;\n }\n pathSegment(ctx, bounds, opts) {\n const { x , y , radius } = this;\n bounds = bounds || {\n start: 0,\n end: TAU\n };\n ctx.arc(x, y, radius, bounds.end, bounds.start, true);\n return !opts.bounds;\n }\n interpolate(point) {\n const { x , y , radius } = this;\n const angle = point.angle;\n return {\n x: x + Math.cos(angle) * radius,\n y: y + Math.sin(angle) * radius,\n angle\n };\n }\n}\n\nfunction _getTarget(source) {\n const { chart , fill , line } = source;\n if (isNumberFinite(fill)) {\n return getLineByIndex(chart, fill);\n }\n if (fill === 'stack') {\n return _buildStackLine(source);\n }\n if (fill === 'shape') {\n return true;\n }\n const boundary = computeBoundary(source);\n if (boundary instanceof simpleArc) {\n return boundary;\n }\n return _createBoundaryLine(boundary, line);\n}\n function getLineByIndex(chart, index) {\n const meta = chart.getDatasetMeta(index);\n const visible = meta && chart.isDatasetVisible(index);\n return visible ? meta.dataset : null;\n}\nfunction computeBoundary(source) {\n const scale = source.scale || {};\n if (scale.getPointPositionForValue) {\n return computeCircularBoundary(source);\n }\n return computeLinearBoundary(source);\n}\nfunction computeLinearBoundary(source) {\n const { scale ={} , fill } = source;\n const pixel = _getTargetPixel(fill, scale);\n if (isNumberFinite(pixel)) {\n const horizontal = scale.isHorizontal();\n return {\n x: horizontal ? pixel : null,\n y: horizontal ? null : pixel\n };\n }\n return null;\n}\nfunction computeCircularBoundary(source) {\n const { scale , fill } = source;\n const options = scale.options;\n const length = scale.getLabels().length;\n const start = options.reverse ? scale.max : scale.min;\n const value = _getTargetValue(fill, scale, start);\n const target = [];\n if (options.grid.circular) {\n const center = scale.getPointPositionForValue(0, start);\n return new simpleArc({\n x: center.x,\n y: center.y,\n radius: scale.getDistanceFromCenterForValue(value)\n });\n }\n for(let i = 0; i < length; ++i){\n target.push(scale.getPointPositionForValue(i, value));\n }\n return target;\n}\n\nfunction _drawfill(ctx, source, area) {\n const target = _getTarget(source);\n const { line , scale , axis } = source;\n const lineOpts = line.options;\n const fillOption = lineOpts.fill;\n const color = lineOpts.backgroundColor;\n const { above =color , below =color } = fillOption || {};\n if (target && line.points.length) {\n clipArea(ctx, area);\n doFill(ctx, {\n line,\n target,\n above,\n below,\n area,\n scale,\n axis\n });\n unclipArea(ctx);\n }\n}\nfunction doFill(ctx, cfg) {\n const { line , target , above , below , area , scale } = cfg;\n const property = line._loop ? 'angle' : cfg.axis;\n ctx.save();\n if (property === 'x' && below !== above) {\n clipVertical(ctx, target, area.top);\n fill(ctx, {\n line,\n target,\n color: above,\n scale,\n property\n });\n ctx.restore();\n ctx.save();\n clipVertical(ctx, target, area.bottom);\n }\n fill(ctx, {\n line,\n target,\n color: below,\n scale,\n property\n });\n ctx.restore();\n}\nfunction clipVertical(ctx, target, clipY) {\n const { segments , points } = target;\n let first = true;\n let lineLoop = false;\n ctx.beginPath();\n for (const segment of segments){\n const { start , end } = segment;\n const firstPoint = points[start];\n const lastPoint = points[_findSegmentEnd(start, end, points)];\n if (first) {\n ctx.moveTo(firstPoint.x, firstPoint.y);\n first = false;\n } else {\n ctx.lineTo(firstPoint.x, clipY);\n ctx.lineTo(firstPoint.x, firstPoint.y);\n }\n lineLoop = !!target.pathSegment(ctx, segment, {\n move: lineLoop\n });\n if (lineLoop) {\n ctx.closePath();\n } else {\n ctx.lineTo(lastPoint.x, clipY);\n }\n }\n ctx.lineTo(target.first().x, clipY);\n ctx.closePath();\n ctx.clip();\n}\nfunction fill(ctx, cfg) {\n const { line , target , property , color , scale } = cfg;\n const segments = _segments(line, target, property);\n for (const { source: src , target: tgt , start , end } of segments){\n const { style: { backgroundColor =color } = {} } = src;\n const notShape = target !== true;\n ctx.save();\n ctx.fillStyle = backgroundColor;\n clipBounds(ctx, scale, notShape && _getBounds(property, start, end));\n ctx.beginPath();\n const lineLoop = !!line.pathSegment(ctx, src);\n let loop;\n if (notShape) {\n if (lineLoop) {\n ctx.closePath();\n } else {\n interpolatedLineTo(ctx, target, end, property);\n }\n const targetLoop = !!target.pathSegment(ctx, tgt, {\n move: lineLoop,\n reverse: true\n });\n loop = lineLoop && targetLoop;\n if (!loop) {\n interpolatedLineTo(ctx, target, start, property);\n }\n }\n ctx.closePath();\n ctx.fill(loop ? 'evenodd' : 'nonzero');\n ctx.restore();\n }\n}\nfunction clipBounds(ctx, scale, bounds) {\n const { top , bottom } = scale.chart.chartArea;\n const { property , start , end } = bounds || {};\n if (property === 'x') {\n ctx.beginPath();\n ctx.rect(start, top, end - start, bottom - top);\n ctx.clip();\n }\n}\nfunction interpolatedLineTo(ctx, target, point, property) {\n const interpolatedPoint = target.interpolate(point, property);\n if (interpolatedPoint) {\n ctx.lineTo(interpolatedPoint.x, interpolatedPoint.y);\n }\n}\n\nvar index = {\n id: 'filler',\n afterDatasetsUpdate (chart, _args, options) {\n const count = (chart.data.datasets || []).length;\n const sources = [];\n let meta, i, line, source;\n for(i = 0; i < count; ++i){\n meta = chart.getDatasetMeta(i);\n line = meta.dataset;\n source = null;\n if (line && line.options && line instanceof LineElement) {\n source = {\n visible: chart.isDatasetVisible(i),\n index: i,\n fill: _decodeFill(line, i, count),\n chart,\n axis: meta.controller.options.indexAxis,\n scale: meta.vScale,\n line\n };\n }\n meta.$filler = source;\n sources.push(source);\n }\n for(i = 0; i < count; ++i){\n source = sources[i];\n if (!source || source.fill === false) {\n continue;\n }\n source.fill = _resolveTarget(sources, i, options.propagate);\n }\n },\n beforeDraw (chart, _args, options) {\n const draw = options.drawTime === 'beforeDraw';\n const metasets = chart.getSortedVisibleDatasetMetas();\n const area = chart.chartArea;\n for(let i = metasets.length - 1; i >= 0; --i){\n const source = metasets[i].$filler;\n if (!source) {\n continue;\n }\n source.line.updateControlPoints(area, source.axis);\n if (draw && source.fill) {\n _drawfill(chart.ctx, source, area);\n }\n }\n },\n beforeDatasetsDraw (chart, _args, options) {\n if (options.drawTime !== 'beforeDatasetsDraw') {\n return;\n }\n const metasets = chart.getSortedVisibleDatasetMetas();\n for(let i = metasets.length - 1; i >= 0; --i){\n const source = metasets[i].$filler;\n if (_shouldApplyFill(source)) {\n _drawfill(chart.ctx, source, chart.chartArea);\n }\n }\n },\n beforeDatasetDraw (chart, args, options) {\n const source = args.meta.$filler;\n if (!_shouldApplyFill(source) || options.drawTime !== 'beforeDatasetDraw') {\n return;\n }\n _drawfill(chart.ctx, source, chart.chartArea);\n },\n defaults: {\n propagate: true,\n drawTime: 'beforeDatasetDraw'\n }\n};\n\nconst getBoxSize = (labelOpts, fontSize)=>{\n let { boxHeight =fontSize , boxWidth =fontSize } = labelOpts;\n if (labelOpts.usePointStyle) {\n boxHeight = Math.min(boxHeight, fontSize);\n boxWidth = labelOpts.pointStyleWidth || Math.min(boxWidth, fontSize);\n }\n return {\n boxWidth,\n boxHeight,\n itemHeight: Math.max(fontSize, boxHeight)\n };\n};\nconst itemsEqual = (a, b)=>a !== null && b !== null && a.datasetIndex === b.datasetIndex && a.index === b.index;\nclass Legend extends Element {\n constructor(config){\n super();\n this._added = false;\n this.legendHitBoxes = [];\n this._hoveredItem = null;\n this.doughnutMode = false;\n this.chart = config.chart;\n this.options = config.options;\n this.ctx = config.ctx;\n this.legendItems = undefined;\n this.columnSizes = undefined;\n this.lineWidths = undefined;\n this.maxHeight = undefined;\n this.maxWidth = undefined;\n this.top = undefined;\n this.bottom = undefined;\n this.left = undefined;\n this.right = undefined;\n this.height = undefined;\n this.width = undefined;\n this._margins = undefined;\n this.position = undefined;\n this.weight = undefined;\n this.fullSize = undefined;\n }\n update(maxWidth, maxHeight, margins) {\n this.maxWidth = maxWidth;\n this.maxHeight = maxHeight;\n this._margins = margins;\n this.setDimensions();\n this.buildLabels();\n this.fit();\n }\n setDimensions() {\n if (this.isHorizontal()) {\n this.width = this.maxWidth;\n this.left = this._margins.left;\n this.right = this.width;\n } else {\n this.height = this.maxHeight;\n this.top = this._margins.top;\n this.bottom = this.height;\n }\n }\n buildLabels() {\n const labelOpts = this.options.labels || {};\n let legendItems = callback(labelOpts.generateLabels, [\n this.chart\n ], this) || [];\n if (labelOpts.filter) {\n legendItems = legendItems.filter((item)=>labelOpts.filter(item, this.chart.data));\n }\n if (labelOpts.sort) {\n legendItems = legendItems.sort((a, b)=>labelOpts.sort(a, b, this.chart.data));\n }\n if (this.options.reverse) {\n legendItems.reverse();\n }\n this.legendItems = legendItems;\n }\n fit() {\n const { options , ctx } = this;\n if (!options.display) {\n this.width = this.height = 0;\n return;\n }\n const labelOpts = options.labels;\n const labelFont = toFont(labelOpts.font);\n const fontSize = labelFont.size;\n const titleHeight = this._computeTitleHeight();\n const { boxWidth , itemHeight } = getBoxSize(labelOpts, fontSize);\n let width, height;\n ctx.font = labelFont.string;\n if (this.isHorizontal()) {\n width = this.maxWidth;\n height = this._fitRows(titleHeight, fontSize, boxWidth, itemHeight) + 10;\n } else {\n height = this.maxHeight;\n width = this._fitCols(titleHeight, labelFont, boxWidth, itemHeight) + 10;\n }\n this.width = Math.min(width, options.maxWidth || this.maxWidth);\n this.height = Math.min(height, options.maxHeight || this.maxHeight);\n }\n _fitRows(titleHeight, fontSize, boxWidth, itemHeight) {\n const { ctx , maxWidth , options: { labels: { padding } } } = this;\n const hitboxes = this.legendHitBoxes = [];\n const lineWidths = this.lineWidths = [\n 0\n ];\n const lineHeight = itemHeight + padding;\n let totalHeight = titleHeight;\n ctx.textAlign = 'left';\n ctx.textBaseline = 'middle';\n let row = -1;\n let top = -lineHeight;\n this.legendItems.forEach((legendItem, i)=>{\n const itemWidth = boxWidth + fontSize / 2 + ctx.measureText(legendItem.text).width;\n if (i === 0 || lineWidths[lineWidths.length - 1] + itemWidth + 2 * padding > maxWidth) {\n totalHeight += lineHeight;\n lineWidths[lineWidths.length - (i > 0 ? 0 : 1)] = 0;\n top += lineHeight;\n row++;\n }\n hitboxes[i] = {\n left: 0,\n top,\n row,\n width: itemWidth,\n height: itemHeight\n };\n lineWidths[lineWidths.length - 1] += itemWidth + padding;\n });\n return totalHeight;\n }\n _fitCols(titleHeight, labelFont, boxWidth, _itemHeight) {\n const { ctx , maxHeight , options: { labels: { padding } } } = this;\n const hitboxes = this.legendHitBoxes = [];\n const columnSizes = this.columnSizes = [];\n const heightLimit = maxHeight - titleHeight;\n let totalWidth = padding;\n let currentColWidth = 0;\n let currentColHeight = 0;\n let left = 0;\n let col = 0;\n this.legendItems.forEach((legendItem, i)=>{\n const { itemWidth , itemHeight } = calculateItemSize(boxWidth, labelFont, ctx, legendItem, _itemHeight);\n if (i > 0 && currentColHeight + itemHeight + 2 * padding > heightLimit) {\n totalWidth += currentColWidth + padding;\n columnSizes.push({\n width: currentColWidth,\n height: currentColHeight\n });\n left += currentColWidth + padding;\n col++;\n currentColWidth = currentColHeight = 0;\n }\n hitboxes[i] = {\n left,\n top: currentColHeight,\n col,\n width: itemWidth,\n height: itemHeight\n };\n currentColWidth = Math.max(currentColWidth, itemWidth);\n currentColHeight += itemHeight + padding;\n });\n totalWidth += currentColWidth;\n columnSizes.push({\n width: currentColWidth,\n height: currentColHeight\n });\n return totalWidth;\n }\n adjustHitBoxes() {\n if (!this.options.display) {\n return;\n }\n const titleHeight = this._computeTitleHeight();\n const { legendHitBoxes: hitboxes , options: { align , labels: { padding } , rtl } } = this;\n const rtlHelper = getRtlAdapter(rtl, this.left, this.width);\n if (this.isHorizontal()) {\n let row = 0;\n let left = _alignStartEnd(align, this.left + padding, this.right - this.lineWidths[row]);\n for (const hitbox of hitboxes){\n if (row !== hitbox.row) {\n row = hitbox.row;\n left = _alignStartEnd(align, this.left + padding, this.right - this.lineWidths[row]);\n }\n hitbox.top += this.top + titleHeight + padding;\n hitbox.left = rtlHelper.leftForLtr(rtlHelper.x(left), hitbox.width);\n left += hitbox.width + padding;\n }\n } else {\n let col = 0;\n let top = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - this.columnSizes[col].height);\n for (const hitbox of hitboxes){\n if (hitbox.col !== col) {\n col = hitbox.col;\n top = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - this.columnSizes[col].height);\n }\n hitbox.top = top;\n hitbox.left += this.left + padding;\n hitbox.left = rtlHelper.leftForLtr(rtlHelper.x(hitbox.left), hitbox.width);\n top += hitbox.height + padding;\n }\n }\n }\n isHorizontal() {\n return this.options.position === 'top' || this.options.position === 'bottom';\n }\n draw() {\n if (this.options.display) {\n const ctx = this.ctx;\n clipArea(ctx, this);\n this._draw();\n unclipArea(ctx);\n }\n }\n _draw() {\n const { options: opts , columnSizes , lineWidths , ctx } = this;\n const { align , labels: labelOpts } = opts;\n const defaultColor = defaults.color;\n const rtlHelper = getRtlAdapter(opts.rtl, this.left, this.width);\n const labelFont = toFont(labelOpts.font);\n const { padding } = labelOpts;\n const fontSize = labelFont.size;\n const halfFontSize = fontSize / 2;\n let cursor;\n this.drawTitle();\n ctx.textAlign = rtlHelper.textAlign('left');\n ctx.textBaseline = 'middle';\n ctx.lineWidth = 0.5;\n ctx.font = labelFont.string;\n const { boxWidth , boxHeight , itemHeight } = getBoxSize(labelOpts, fontSize);\n const drawLegendBox = function(x, y, legendItem) {\n if (isNaN(boxWidth) || boxWidth <= 0 || isNaN(boxHeight) || boxHeight < 0) {\n return;\n }\n ctx.save();\n const lineWidth = valueOrDefault(legendItem.lineWidth, 1);\n ctx.fillStyle = valueOrDefault(legendItem.fillStyle, defaultColor);\n ctx.lineCap = valueOrDefault(legendItem.lineCap, 'butt');\n ctx.lineDashOffset = valueOrDefault(legendItem.lineDashOffset, 0);\n ctx.lineJoin = valueOrDefault(legendItem.lineJoin, 'miter');\n ctx.lineWidth = lineWidth;\n ctx.strokeStyle = valueOrDefault(legendItem.strokeStyle, defaultColor);\n ctx.setLineDash(valueOrDefault(legendItem.lineDash, []));\n if (labelOpts.usePointStyle) {\n const drawOptions = {\n radius: boxHeight * Math.SQRT2 / 2,\n pointStyle: legendItem.pointStyle,\n rotation: legendItem.rotation,\n borderWidth: lineWidth\n };\n const centerX = rtlHelper.xPlus(x, boxWidth / 2);\n const centerY = y + halfFontSize;\n drawPointLegend(ctx, drawOptions, centerX, centerY, labelOpts.pointStyleWidth && boxWidth);\n } else {\n const yBoxTop = y + Math.max((fontSize - boxHeight) / 2, 0);\n const xBoxLeft = rtlHelper.leftForLtr(x, boxWidth);\n const borderRadius = toTRBLCorners(legendItem.borderRadius);\n ctx.beginPath();\n if (Object.values(borderRadius).some((v)=>v !== 0)) {\n addRoundedRectPath(ctx, {\n x: xBoxLeft,\n y: yBoxTop,\n w: boxWidth,\n h: boxHeight,\n radius: borderRadius\n });\n } else {\n ctx.rect(xBoxLeft, yBoxTop, boxWidth, boxHeight);\n }\n ctx.fill();\n if (lineWidth !== 0) {\n ctx.stroke();\n }\n }\n ctx.restore();\n };\n const fillText = function(x, y, legendItem) {\n renderText(ctx, legendItem.text, x, y + itemHeight / 2, labelFont, {\n strikethrough: legendItem.hidden,\n textAlign: rtlHelper.textAlign(legendItem.textAlign)\n });\n };\n const isHorizontal = this.isHorizontal();\n const titleHeight = this._computeTitleHeight();\n if (isHorizontal) {\n cursor = {\n x: _alignStartEnd(align, this.left + padding, this.right - lineWidths[0]),\n y: this.top + padding + titleHeight,\n line: 0\n };\n } else {\n cursor = {\n x: this.left + padding,\n y: _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - columnSizes[0].height),\n line: 0\n };\n }\n overrideTextDirection(this.ctx, opts.textDirection);\n const lineHeight = itemHeight + padding;\n this.legendItems.forEach((legendItem, i)=>{\n ctx.strokeStyle = legendItem.fontColor;\n ctx.fillStyle = legendItem.fontColor;\n const textWidth = ctx.measureText(legendItem.text).width;\n const textAlign = rtlHelper.textAlign(legendItem.textAlign || (legendItem.textAlign = labelOpts.textAlign));\n const width = boxWidth + halfFontSize + textWidth;\n let x = cursor.x;\n let y = cursor.y;\n rtlHelper.setWidth(this.width);\n if (isHorizontal) {\n if (i > 0 && x + width + padding > this.right) {\n y = cursor.y += lineHeight;\n cursor.line++;\n x = cursor.x = _alignStartEnd(align, this.left + padding, this.right - lineWidths[cursor.line]);\n }\n } else if (i > 0 && y + lineHeight > this.bottom) {\n x = cursor.x = x + columnSizes[cursor.line].width + padding;\n cursor.line++;\n y = cursor.y = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - columnSizes[cursor.line].height);\n }\n const realX = rtlHelper.x(x);\n drawLegendBox(realX, y, legendItem);\n x = _textX(textAlign, x + boxWidth + halfFontSize, isHorizontal ? x + width : this.right, opts.rtl);\n fillText(rtlHelper.x(x), y, legendItem);\n if (isHorizontal) {\n cursor.x += width + padding;\n } else if (typeof legendItem.text !== 'string') {\n const fontLineHeight = labelFont.lineHeight;\n cursor.y += calculateLegendItemHeight(legendItem, fontLineHeight) + padding;\n } else {\n cursor.y += lineHeight;\n }\n });\n restoreTextDirection(this.ctx, opts.textDirection);\n }\n drawTitle() {\n const opts = this.options;\n const titleOpts = opts.title;\n const titleFont = toFont(titleOpts.font);\n const titlePadding = toPadding(titleOpts.padding);\n if (!titleOpts.display) {\n return;\n }\n const rtlHelper = getRtlAdapter(opts.rtl, this.left, this.width);\n const ctx = this.ctx;\n const position = titleOpts.position;\n const halfFontSize = titleFont.size / 2;\n const topPaddingPlusHalfFontSize = titlePadding.top + halfFontSize;\n let y;\n let left = this.left;\n let maxWidth = this.width;\n if (this.isHorizontal()) {\n maxWidth = Math.max(...this.lineWidths);\n y = this.top + topPaddingPlusHalfFontSize;\n left = _alignStartEnd(opts.align, left, this.right - maxWidth);\n } else {\n const maxHeight = this.columnSizes.reduce((acc, size)=>Math.max(acc, size.height), 0);\n y = topPaddingPlusHalfFontSize + _alignStartEnd(opts.align, this.top, this.bottom - maxHeight - opts.labels.padding - this._computeTitleHeight());\n }\n const x = _alignStartEnd(position, left, left + maxWidth);\n ctx.textAlign = rtlHelper.textAlign(_toLeftRightCenter(position));\n ctx.textBaseline = 'middle';\n ctx.strokeStyle = titleOpts.color;\n ctx.fillStyle = titleOpts.color;\n ctx.font = titleFont.string;\n renderText(ctx, titleOpts.text, x, y, titleFont);\n }\n _computeTitleHeight() {\n const titleOpts = this.options.title;\n const titleFont = toFont(titleOpts.font);\n const titlePadding = toPadding(titleOpts.padding);\n return titleOpts.display ? titleFont.lineHeight + titlePadding.height : 0;\n }\n _getLegendItemAt(x, y) {\n let i, hitBox, lh;\n if (_isBetween(x, this.left, this.right) && _isBetween(y, this.top, this.bottom)) {\n lh = this.legendHitBoxes;\n for(i = 0; i < lh.length; ++i){\n hitBox = lh[i];\n if (_isBetween(x, hitBox.left, hitBox.left + hitBox.width) && _isBetween(y, hitBox.top, hitBox.top + hitBox.height)) {\n return this.legendItems[i];\n }\n }\n }\n return null;\n }\n handleEvent(e) {\n const opts = this.options;\n if (!isListened(e.type, opts)) {\n return;\n }\n const hoveredItem = this._getLegendItemAt(e.x, e.y);\n if (e.type === 'mousemove' || e.type === 'mouseout') {\n const previous = this._hoveredItem;\n const sameItem = itemsEqual(previous, hoveredItem);\n if (previous && !sameItem) {\n callback(opts.onLeave, [\n e,\n previous,\n this\n ], this);\n }\n this._hoveredItem = hoveredItem;\n if (hoveredItem && !sameItem) {\n callback(opts.onHover, [\n e,\n hoveredItem,\n this\n ], this);\n }\n } else if (hoveredItem) {\n callback(opts.onClick, [\n e,\n hoveredItem,\n this\n ], this);\n }\n }\n}\nfunction calculateItemSize(boxWidth, labelFont, ctx, legendItem, _itemHeight) {\n const itemWidth = calculateItemWidth(legendItem, boxWidth, labelFont, ctx);\n const itemHeight = calculateItemHeight(_itemHeight, legendItem, labelFont.lineHeight);\n return {\n itemWidth,\n itemHeight\n };\n}\nfunction calculateItemWidth(legendItem, boxWidth, labelFont, ctx) {\n let legendItemText = legendItem.text;\n if (legendItemText && typeof legendItemText !== 'string') {\n legendItemText = legendItemText.reduce((a, b)=>a.length > b.length ? a : b);\n }\n return boxWidth + labelFont.size / 2 + ctx.measureText(legendItemText).width;\n}\nfunction calculateItemHeight(_itemHeight, legendItem, fontLineHeight) {\n let itemHeight = _itemHeight;\n if (typeof legendItem.text !== 'string') {\n itemHeight = calculateLegendItemHeight(legendItem, fontLineHeight);\n }\n return itemHeight;\n}\nfunction calculateLegendItemHeight(legendItem, fontLineHeight) {\n const labelHeight = legendItem.text ? legendItem.text.length : 0;\n return fontLineHeight * labelHeight;\n}\nfunction isListened(type, opts) {\n if ((type === 'mousemove' || type === 'mouseout') && (opts.onHover || opts.onLeave)) {\n return true;\n }\n if (opts.onClick && (type === 'click' || type === 'mouseup')) {\n return true;\n }\n return false;\n}\nvar plugin_legend = {\n id: 'legend',\n _element: Legend,\n start (chart, _args, options) {\n const legend = chart.legend = new Legend({\n ctx: chart.ctx,\n options,\n chart\n });\n layouts.configure(chart, legend, options);\n layouts.addBox(chart, legend);\n },\n stop (chart) {\n layouts.removeBox(chart, chart.legend);\n delete chart.legend;\n },\n beforeUpdate (chart, _args, options) {\n const legend = chart.legend;\n layouts.configure(chart, legend, options);\n legend.options = options;\n },\n afterUpdate (chart) {\n const legend = chart.legend;\n legend.buildLabels();\n legend.adjustHitBoxes();\n },\n afterEvent (chart, args) {\n if (!args.replay) {\n chart.legend.handleEvent(args.event);\n }\n },\n defaults: {\n display: true,\n position: 'top',\n align: 'center',\n fullSize: true,\n reverse: false,\n weight: 1000,\n onClick (e, legendItem, legend) {\n const index = legendItem.datasetIndex;\n const ci = legend.chart;\n if (ci.isDatasetVisible(index)) {\n ci.hide(index);\n legendItem.hidden = true;\n } else {\n ci.show(index);\n legendItem.hidden = false;\n }\n },\n onHover: null,\n onLeave: null,\n labels: {\n color: (ctx)=>ctx.chart.options.color,\n boxWidth: 40,\n padding: 10,\n generateLabels (chart) {\n const datasets = chart.data.datasets;\n const { labels: { usePointStyle , pointStyle , textAlign , color , useBorderRadius , borderRadius } } = chart.legend.options;\n return chart._getSortedDatasetMetas().map((meta)=>{\n const style = meta.controller.getStyle(usePointStyle ? 0 : undefined);\n const borderWidth = toPadding(style.borderWidth);\n return {\n text: datasets[meta.index].label,\n fillStyle: style.backgroundColor,\n fontColor: color,\n hidden: !meta.visible,\n lineCap: style.borderCapStyle,\n lineDash: style.borderDash,\n lineDashOffset: style.borderDashOffset,\n lineJoin: style.borderJoinStyle,\n lineWidth: (borderWidth.width + borderWidth.height) / 4,\n strokeStyle: style.borderColor,\n pointStyle: pointStyle || style.pointStyle,\n rotation: style.rotation,\n textAlign: textAlign || style.textAlign,\n borderRadius: useBorderRadius && (borderRadius || style.borderRadius),\n datasetIndex: meta.index\n };\n }, this);\n }\n },\n title: {\n color: (ctx)=>ctx.chart.options.color,\n display: false,\n position: 'center',\n text: ''\n }\n },\n descriptors: {\n _scriptable: (name)=>!name.startsWith('on'),\n labels: {\n _scriptable: (name)=>![\n 'generateLabels',\n 'filter',\n 'sort'\n ].includes(name)\n }\n }\n};\n\nclass Title extends Element {\n constructor(config){\n super();\n this.chart = config.chart;\n this.options = config.options;\n this.ctx = config.ctx;\n this._padding = undefined;\n this.top = undefined;\n this.bottom = undefined;\n this.left = undefined;\n this.right = undefined;\n this.width = undefined;\n this.height = undefined;\n this.position = undefined;\n this.weight = undefined;\n this.fullSize = undefined;\n }\n update(maxWidth, maxHeight) {\n const opts = this.options;\n this.left = 0;\n this.top = 0;\n if (!opts.display) {\n this.width = this.height = this.right = this.bottom = 0;\n return;\n }\n this.width = this.right = maxWidth;\n this.height = this.bottom = maxHeight;\n const lineCount = isArray(opts.text) ? opts.text.length : 1;\n this._padding = toPadding(opts.padding);\n const textSize = lineCount * toFont(opts.font).lineHeight + this._padding.height;\n if (this.isHorizontal()) {\n this.height = textSize;\n } else {\n this.width = textSize;\n }\n }\n isHorizontal() {\n const pos = this.options.position;\n return pos === 'top' || pos === 'bottom';\n }\n _drawArgs(offset) {\n const { top , left , bottom , right , options } = this;\n const align = options.align;\n let rotation = 0;\n let maxWidth, titleX, titleY;\n if (this.isHorizontal()) {\n titleX = _alignStartEnd(align, left, right);\n titleY = top + offset;\n maxWidth = right - left;\n } else {\n if (options.position === 'left') {\n titleX = left + offset;\n titleY = _alignStartEnd(align, bottom, top);\n rotation = PI * -0.5;\n } else {\n titleX = right - offset;\n titleY = _alignStartEnd(align, top, bottom);\n rotation = PI * 0.5;\n }\n maxWidth = bottom - top;\n }\n return {\n titleX,\n titleY,\n maxWidth,\n rotation\n };\n }\n draw() {\n const ctx = this.ctx;\n const opts = this.options;\n if (!opts.display) {\n return;\n }\n const fontOpts = toFont(opts.font);\n const lineHeight = fontOpts.lineHeight;\n const offset = lineHeight / 2 + this._padding.top;\n const { titleX , titleY , maxWidth , rotation } = this._drawArgs(offset);\n renderText(ctx, opts.text, 0, 0, fontOpts, {\n color: opts.color,\n maxWidth,\n rotation,\n textAlign: _toLeftRightCenter(opts.align),\n textBaseline: 'middle',\n translation: [\n titleX,\n titleY\n ]\n });\n }\n}\nfunction createTitle(chart, titleOpts) {\n const title = new Title({\n ctx: chart.ctx,\n options: titleOpts,\n chart\n });\n layouts.configure(chart, title, titleOpts);\n layouts.addBox(chart, title);\n chart.titleBlock = title;\n}\nvar plugin_title = {\n id: 'title',\n _element: Title,\n start (chart, _args, options) {\n createTitle(chart, options);\n },\n stop (chart) {\n const titleBlock = chart.titleBlock;\n layouts.removeBox(chart, titleBlock);\n delete chart.titleBlock;\n },\n beforeUpdate (chart, _args, options) {\n const title = chart.titleBlock;\n layouts.configure(chart, title, options);\n title.options = options;\n },\n defaults: {\n align: 'center',\n display: false,\n font: {\n weight: 'bold'\n },\n fullSize: true,\n padding: 10,\n position: 'top',\n text: '',\n weight: 2000\n },\n defaultRoutes: {\n color: 'color'\n },\n descriptors: {\n _scriptable: true,\n _indexable: false\n }\n};\n\nconst map = new WeakMap();\nvar plugin_subtitle = {\n id: 'subtitle',\n start (chart, _args, options) {\n const title = new Title({\n ctx: chart.ctx,\n options,\n chart\n });\n layouts.configure(chart, title, options);\n layouts.addBox(chart, title);\n map.set(chart, title);\n },\n stop (chart) {\n layouts.removeBox(chart, map.get(chart));\n map.delete(chart);\n },\n beforeUpdate (chart, _args, options) {\n const title = map.get(chart);\n layouts.configure(chart, title, options);\n title.options = options;\n },\n defaults: {\n align: 'center',\n display: false,\n font: {\n weight: 'normal'\n },\n fullSize: true,\n padding: 0,\n position: 'top',\n text: '',\n weight: 1500\n },\n defaultRoutes: {\n color: 'color'\n },\n descriptors: {\n _scriptable: true,\n _indexable: false\n }\n};\n\nconst positioners = {\n average (items) {\n if (!items.length) {\n return false;\n }\n let i, len;\n let x = 0;\n let y = 0;\n let count = 0;\n for(i = 0, len = items.length; i < len; ++i){\n const el = items[i].element;\n if (el && el.hasValue()) {\n const pos = el.tooltipPosition();\n x += pos.x;\n y += pos.y;\n ++count;\n }\n }\n return {\n x: x / count,\n y: y / count\n };\n },\n nearest (items, eventPosition) {\n if (!items.length) {\n return false;\n }\n let x = eventPosition.x;\n let y = eventPosition.y;\n let minDistance = Number.POSITIVE_INFINITY;\n let i, len, nearestElement;\n for(i = 0, len = items.length; i < len; ++i){\n const el = items[i].element;\n if (el && el.hasValue()) {\n const center = el.getCenterPoint();\n const d = distanceBetweenPoints(eventPosition, center);\n if (d < minDistance) {\n minDistance = d;\n nearestElement = el;\n }\n }\n }\n if (nearestElement) {\n const tp = nearestElement.tooltipPosition();\n x = tp.x;\n y = tp.y;\n }\n return {\n x,\n y\n };\n }\n};\nfunction pushOrConcat(base, toPush) {\n if (toPush) {\n if (isArray(toPush)) {\n Array.prototype.push.apply(base, toPush);\n } else {\n base.push(toPush);\n }\n }\n return base;\n}\n function splitNewlines(str) {\n if ((typeof str === 'string' || str instanceof String) && str.indexOf('\\n') > -1) {\n return str.split('\\n');\n }\n return str;\n}\n function createTooltipItem(chart, item) {\n const { element , datasetIndex , index } = item;\n const controller = chart.getDatasetMeta(datasetIndex).controller;\n const { label , value } = controller.getLabelAndValue(index);\n return {\n chart,\n label,\n parsed: controller.getParsed(index),\n raw: chart.data.datasets[datasetIndex].data[index],\n formattedValue: value,\n dataset: controller.getDataset(),\n dataIndex: index,\n datasetIndex,\n element\n };\n}\n function getTooltipSize(tooltip, options) {\n const ctx = tooltip.chart.ctx;\n const { body , footer , title } = tooltip;\n const { boxWidth , boxHeight } = options;\n const bodyFont = toFont(options.bodyFont);\n const titleFont = toFont(options.titleFont);\n const footerFont = toFont(options.footerFont);\n const titleLineCount = title.length;\n const footerLineCount = footer.length;\n const bodyLineItemCount = body.length;\n const padding = toPadding(options.padding);\n let height = padding.height;\n let width = 0;\n let combinedBodyLength = body.reduce((count, bodyItem)=>count + bodyItem.before.length + bodyItem.lines.length + bodyItem.after.length, 0);\n combinedBodyLength += tooltip.beforeBody.length + tooltip.afterBody.length;\n if (titleLineCount) {\n height += titleLineCount * titleFont.lineHeight + (titleLineCount - 1) * options.titleSpacing + options.titleMarginBottom;\n }\n if (combinedBodyLength) {\n const bodyLineHeight = options.displayColors ? Math.max(boxHeight, bodyFont.lineHeight) : bodyFont.lineHeight;\n height += bodyLineItemCount * bodyLineHeight + (combinedBodyLength - bodyLineItemCount) * bodyFont.lineHeight + (combinedBodyLength - 1) * options.bodySpacing;\n }\n if (footerLineCount) {\n height += options.footerMarginTop + footerLineCount * footerFont.lineHeight + (footerLineCount - 1) * options.footerSpacing;\n }\n let widthPadding = 0;\n const maxLineWidth = function(line) {\n width = Math.max(width, ctx.measureText(line).width + widthPadding);\n };\n ctx.save();\n ctx.font = titleFont.string;\n each(tooltip.title, maxLineWidth);\n ctx.font = bodyFont.string;\n each(tooltip.beforeBody.concat(tooltip.afterBody), maxLineWidth);\n widthPadding = options.displayColors ? boxWidth + 2 + options.boxPadding : 0;\n each(body, (bodyItem)=>{\n each(bodyItem.before, maxLineWidth);\n each(bodyItem.lines, maxLineWidth);\n each(bodyItem.after, maxLineWidth);\n });\n widthPadding = 0;\n ctx.font = footerFont.string;\n each(tooltip.footer, maxLineWidth);\n ctx.restore();\n width += padding.width;\n return {\n width,\n height\n };\n}\nfunction determineYAlign(chart, size) {\n const { y , height } = size;\n if (y < height / 2) {\n return 'top';\n } else if (y > chart.height - height / 2) {\n return 'bottom';\n }\n return 'center';\n}\nfunction doesNotFitWithAlign(xAlign, chart, options, size) {\n const { x , width } = size;\n const caret = options.caretSize + options.caretPadding;\n if (xAlign === 'left' && x + width + caret > chart.width) {\n return true;\n }\n if (xAlign === 'right' && x - width - caret < 0) {\n return true;\n }\n}\nfunction determineXAlign(chart, options, size, yAlign) {\n const { x , width } = size;\n const { width: chartWidth , chartArea: { left , right } } = chart;\n let xAlign = 'center';\n if (yAlign === 'center') {\n xAlign = x <= (left + right) / 2 ? 'left' : 'right';\n } else if (x <= width / 2) {\n xAlign = 'left';\n } else if (x >= chartWidth - width / 2) {\n xAlign = 'right';\n }\n if (doesNotFitWithAlign(xAlign, chart, options, size)) {\n xAlign = 'center';\n }\n return xAlign;\n}\n function determineAlignment(chart, options, size) {\n const yAlign = size.yAlign || options.yAlign || determineYAlign(chart, size);\n return {\n xAlign: size.xAlign || options.xAlign || determineXAlign(chart, options, size, yAlign),\n yAlign\n };\n}\nfunction alignX(size, xAlign) {\n let { x , width } = size;\n if (xAlign === 'right') {\n x -= width;\n } else if (xAlign === 'center') {\n x -= width / 2;\n }\n return x;\n}\nfunction alignY(size, yAlign, paddingAndSize) {\n let { y , height } = size;\n if (yAlign === 'top') {\n y += paddingAndSize;\n } else if (yAlign === 'bottom') {\n y -= height + paddingAndSize;\n } else {\n y -= height / 2;\n }\n return y;\n}\n function getBackgroundPoint(options, size, alignment, chart) {\n const { caretSize , caretPadding , cornerRadius } = options;\n const { xAlign , yAlign } = alignment;\n const paddingAndSize = caretSize + caretPadding;\n const { topLeft , topRight , bottomLeft , bottomRight } = toTRBLCorners(cornerRadius);\n let x = alignX(size, xAlign);\n const y = alignY(size, yAlign, paddingAndSize);\n if (yAlign === 'center') {\n if (xAlign === 'left') {\n x += paddingAndSize;\n } else if (xAlign === 'right') {\n x -= paddingAndSize;\n }\n } else if (xAlign === 'left') {\n x -= Math.max(topLeft, bottomLeft) + caretSize;\n } else if (xAlign === 'right') {\n x += Math.max(topRight, bottomRight) + caretSize;\n }\n return {\n x: _limitValue(x, 0, chart.width - size.width),\n y: _limitValue(y, 0, chart.height - size.height)\n };\n}\nfunction getAlignedX(tooltip, align, options) {\n const padding = toPadding(options.padding);\n return align === 'center' ? tooltip.x + tooltip.width / 2 : align === 'right' ? tooltip.x + tooltip.width - padding.right : tooltip.x + padding.left;\n}\n function getBeforeAfterBodyLines(callback) {\n return pushOrConcat([], splitNewlines(callback));\n}\nfunction createTooltipContext(parent, tooltip, tooltipItems) {\n return createContext(parent, {\n tooltip,\n tooltipItems,\n type: 'tooltip'\n });\n}\nfunction overrideCallbacks(callbacks, context) {\n const override = context && context.dataset && context.dataset.tooltip && context.dataset.tooltip.callbacks;\n return override ? callbacks.override(override) : callbacks;\n}\nconst defaultCallbacks = {\n beforeTitle: noop,\n title (tooltipItems) {\n if (tooltipItems.length > 0) {\n const item = tooltipItems[0];\n const labels = item.chart.data.labels;\n const labelCount = labels ? labels.length : 0;\n if (this && this.options && this.options.mode === 'dataset') {\n return item.dataset.label || '';\n } else if (item.label) {\n return item.label;\n } else if (labelCount > 0 && item.dataIndex < labelCount) {\n return labels[item.dataIndex];\n }\n }\n return '';\n },\n afterTitle: noop,\n beforeBody: noop,\n beforeLabel: noop,\n label (tooltipItem) {\n if (this && this.options && this.options.mode === 'dataset') {\n return tooltipItem.label + ': ' + tooltipItem.formattedValue || tooltipItem.formattedValue;\n }\n let label = tooltipItem.dataset.label || '';\n if (label) {\n label += ': ';\n }\n const value = tooltipItem.formattedValue;\n if (!isNullOrUndef(value)) {\n label += value;\n }\n return label;\n },\n labelColor (tooltipItem) {\n const meta = tooltipItem.chart.getDatasetMeta(tooltipItem.datasetIndex);\n const options = meta.controller.getStyle(tooltipItem.dataIndex);\n return {\n borderColor: options.borderColor,\n backgroundColor: options.backgroundColor,\n borderWidth: options.borderWidth,\n borderDash: options.borderDash,\n borderDashOffset: options.borderDashOffset,\n borderRadius: 0\n };\n },\n labelTextColor () {\n return this.options.bodyColor;\n },\n labelPointStyle (tooltipItem) {\n const meta = tooltipItem.chart.getDatasetMeta(tooltipItem.datasetIndex);\n const options = meta.controller.getStyle(tooltipItem.dataIndex);\n return {\n pointStyle: options.pointStyle,\n rotation: options.rotation\n };\n },\n afterLabel: noop,\n afterBody: noop,\n beforeFooter: noop,\n footer: noop,\n afterFooter: noop\n};\n function invokeCallbackWithFallback(callbacks, name, ctx, arg) {\n const result = callbacks[name].call(ctx, arg);\n if (typeof result === 'undefined') {\n return defaultCallbacks[name].call(ctx, arg);\n }\n return result;\n}\nclass Tooltip extends Element {\n static positioners = positioners;\n constructor(config){\n super();\n this.opacity = 0;\n this._active = [];\n this._eventPosition = undefined;\n this._size = undefined;\n this._cachedAnimations = undefined;\n this._tooltipItems = [];\n this.$animations = undefined;\n this.$context = undefined;\n this.chart = config.chart;\n this.options = config.options;\n this.dataPoints = undefined;\n this.title = undefined;\n this.beforeBody = undefined;\n this.body = undefined;\n this.afterBody = undefined;\n this.footer = undefined;\n this.xAlign = undefined;\n this.yAlign = undefined;\n this.x = undefined;\n this.y = undefined;\n this.height = undefined;\n this.width = undefined;\n this.caretX = undefined;\n this.caretY = undefined;\n this.labelColors = undefined;\n this.labelPointStyles = undefined;\n this.labelTextColors = undefined;\n }\n initialize(options) {\n this.options = options;\n this._cachedAnimations = undefined;\n this.$context = undefined;\n }\n _resolveAnimations() {\n const cached = this._cachedAnimations;\n if (cached) {\n return cached;\n }\n const chart = this.chart;\n const options = this.options.setContext(this.getContext());\n const opts = options.enabled && chart.options.animation && options.animations;\n const animations = new Animations(this.chart, opts);\n if (opts._cacheable) {\n this._cachedAnimations = Object.freeze(animations);\n }\n return animations;\n }\n getContext() {\n return this.$context || (this.$context = createTooltipContext(this.chart.getContext(), this, this._tooltipItems));\n }\n getTitle(context, options) {\n const { callbacks } = options;\n const beforeTitle = invokeCallbackWithFallback(callbacks, 'beforeTitle', this, context);\n const title = invokeCallbackWithFallback(callbacks, 'title', this, context);\n const afterTitle = invokeCallbackWithFallback(callbacks, 'afterTitle', this, context);\n let lines = [];\n lines = pushOrConcat(lines, splitNewlines(beforeTitle));\n lines = pushOrConcat(lines, splitNewlines(title));\n lines = pushOrConcat(lines, splitNewlines(afterTitle));\n return lines;\n }\n getBeforeBody(tooltipItems, options) {\n return getBeforeAfterBodyLines(invokeCallbackWithFallback(options.callbacks, 'beforeBody', this, tooltipItems));\n }\n getBody(tooltipItems, options) {\n const { callbacks } = options;\n const bodyItems = [];\n each(tooltipItems, (context)=>{\n const bodyItem = {\n before: [],\n lines: [],\n after: []\n };\n const scoped = overrideCallbacks(callbacks, context);\n pushOrConcat(bodyItem.before, splitNewlines(invokeCallbackWithFallback(scoped, 'beforeLabel', this, context)));\n pushOrConcat(bodyItem.lines, invokeCallbackWithFallback(scoped, 'label', this, context));\n pushOrConcat(bodyItem.after, splitNewlines(invokeCallbackWithFallback(scoped, 'afterLabel', this, context)));\n bodyItems.push(bodyItem);\n });\n return bodyItems;\n }\n getAfterBody(tooltipItems, options) {\n return getBeforeAfterBodyLines(invokeCallbackWithFallback(options.callbacks, 'afterBody', this, tooltipItems));\n }\n getFooter(tooltipItems, options) {\n const { callbacks } = options;\n const beforeFooter = invokeCallbackWithFallback(callbacks, 'beforeFooter', this, tooltipItems);\n const footer = invokeCallbackWithFallback(callbacks, 'footer', this, tooltipItems);\n const afterFooter = invokeCallbackWithFallback(callbacks, 'afterFooter', this, tooltipItems);\n let lines = [];\n lines = pushOrConcat(lines, splitNewlines(beforeFooter));\n lines = pushOrConcat(lines, splitNewlines(footer));\n lines = pushOrConcat(lines, splitNewlines(afterFooter));\n return lines;\n }\n _createItems(options) {\n const active = this._active;\n const data = this.chart.data;\n const labelColors = [];\n const labelPointStyles = [];\n const labelTextColors = [];\n let tooltipItems = [];\n let i, len;\n for(i = 0, len = active.length; i < len; ++i){\n tooltipItems.push(createTooltipItem(this.chart, active[i]));\n }\n if (options.filter) {\n tooltipItems = tooltipItems.filter((element, index, array)=>options.filter(element, index, array, data));\n }\n if (options.itemSort) {\n tooltipItems = tooltipItems.sort((a, b)=>options.itemSort(a, b, data));\n }\n each(tooltipItems, (context)=>{\n const scoped = overrideCallbacks(options.callbacks, context);\n labelColors.push(invokeCallbackWithFallback(scoped, 'labelColor', this, context));\n labelPointStyles.push(invokeCallbackWithFallback(scoped, 'labelPointStyle', this, context));\n labelTextColors.push(invokeCallbackWithFallback(scoped, 'labelTextColor', this, context));\n });\n this.labelColors = labelColors;\n this.labelPointStyles = labelPointStyles;\n this.labelTextColors = labelTextColors;\n this.dataPoints = tooltipItems;\n return tooltipItems;\n }\n update(changed, replay) {\n const options = this.options.setContext(this.getContext());\n const active = this._active;\n let properties;\n let tooltipItems = [];\n if (!active.length) {\n if (this.opacity !== 0) {\n properties = {\n opacity: 0\n };\n }\n } else {\n const position = positioners[options.position].call(this, active, this._eventPosition);\n tooltipItems = this._createItems(options);\n this.title = this.getTitle(tooltipItems, options);\n this.beforeBody = this.getBeforeBody(tooltipItems, options);\n this.body = this.getBody(tooltipItems, options);\n this.afterBody = this.getAfterBody(tooltipItems, options);\n this.footer = this.getFooter(tooltipItems, options);\n const size = this._size = getTooltipSize(this, options);\n const positionAndSize = Object.assign({}, position, size);\n const alignment = determineAlignment(this.chart, options, positionAndSize);\n const backgroundPoint = getBackgroundPoint(options, positionAndSize, alignment, this.chart);\n this.xAlign = alignment.xAlign;\n this.yAlign = alignment.yAlign;\n properties = {\n opacity: 1,\n x: backgroundPoint.x,\n y: backgroundPoint.y,\n width: size.width,\n height: size.height,\n caretX: position.x,\n caretY: position.y\n };\n }\n this._tooltipItems = tooltipItems;\n this.$context = undefined;\n if (properties) {\n this._resolveAnimations().update(this, properties);\n }\n if (changed && options.external) {\n options.external.call(this, {\n chart: this.chart,\n tooltip: this,\n replay\n });\n }\n }\n drawCaret(tooltipPoint, ctx, size, options) {\n const caretPosition = this.getCaretPosition(tooltipPoint, size, options);\n ctx.lineTo(caretPosition.x1, caretPosition.y1);\n ctx.lineTo(caretPosition.x2, caretPosition.y2);\n ctx.lineTo(caretPosition.x3, caretPosition.y3);\n }\n getCaretPosition(tooltipPoint, size, options) {\n const { xAlign , yAlign } = this;\n const { caretSize , cornerRadius } = options;\n const { topLeft , topRight , bottomLeft , bottomRight } = toTRBLCorners(cornerRadius);\n const { x: ptX , y: ptY } = tooltipPoint;\n const { width , height } = size;\n let x1, x2, x3, y1, y2, y3;\n if (yAlign === 'center') {\n y2 = ptY + height / 2;\n if (xAlign === 'left') {\n x1 = ptX;\n x2 = x1 - caretSize;\n y1 = y2 + caretSize;\n y3 = y2 - caretSize;\n } else {\n x1 = ptX + width;\n x2 = x1 + caretSize;\n y1 = y2 - caretSize;\n y3 = y2 + caretSize;\n }\n x3 = x1;\n } else {\n if (xAlign === 'left') {\n x2 = ptX + Math.max(topLeft, bottomLeft) + caretSize;\n } else if (xAlign === 'right') {\n x2 = ptX + width - Math.max(topRight, bottomRight) - caretSize;\n } else {\n x2 = this.caretX;\n }\n if (yAlign === 'top') {\n y1 = ptY;\n y2 = y1 - caretSize;\n x1 = x2 - caretSize;\n x3 = x2 + caretSize;\n } else {\n y1 = ptY + height;\n y2 = y1 + caretSize;\n x1 = x2 + caretSize;\n x3 = x2 - caretSize;\n }\n y3 = y1;\n }\n return {\n x1,\n x2,\n x3,\n y1,\n y2,\n y3\n };\n }\n drawTitle(pt, ctx, options) {\n const title = this.title;\n const length = title.length;\n let titleFont, titleSpacing, i;\n if (length) {\n const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width);\n pt.x = getAlignedX(this, options.titleAlign, options);\n ctx.textAlign = rtlHelper.textAlign(options.titleAlign);\n ctx.textBaseline = 'middle';\n titleFont = toFont(options.titleFont);\n titleSpacing = options.titleSpacing;\n ctx.fillStyle = options.titleColor;\n ctx.font = titleFont.string;\n for(i = 0; i < length; ++i){\n ctx.fillText(title[i], rtlHelper.x(pt.x), pt.y + titleFont.lineHeight / 2);\n pt.y += titleFont.lineHeight + titleSpacing;\n if (i + 1 === length) {\n pt.y += options.titleMarginBottom - titleSpacing;\n }\n }\n }\n }\n _drawColorBox(ctx, pt, i, rtlHelper, options) {\n const labelColor = this.labelColors[i];\n const labelPointStyle = this.labelPointStyles[i];\n const { boxHeight , boxWidth } = options;\n const bodyFont = toFont(options.bodyFont);\n const colorX = getAlignedX(this, 'left', options);\n const rtlColorX = rtlHelper.x(colorX);\n const yOffSet = boxHeight < bodyFont.lineHeight ? (bodyFont.lineHeight - boxHeight) / 2 : 0;\n const colorY = pt.y + yOffSet;\n if (options.usePointStyle) {\n const drawOptions = {\n radius: Math.min(boxWidth, boxHeight) / 2,\n pointStyle: labelPointStyle.pointStyle,\n rotation: labelPointStyle.rotation,\n borderWidth: 1\n };\n const centerX = rtlHelper.leftForLtr(rtlColorX, boxWidth) + boxWidth / 2;\n const centerY = colorY + boxHeight / 2;\n ctx.strokeStyle = options.multiKeyBackground;\n ctx.fillStyle = options.multiKeyBackground;\n drawPoint(ctx, drawOptions, centerX, centerY);\n ctx.strokeStyle = labelColor.borderColor;\n ctx.fillStyle = labelColor.backgroundColor;\n drawPoint(ctx, drawOptions, centerX, centerY);\n } else {\n ctx.lineWidth = isObject(labelColor.borderWidth) ? Math.max(...Object.values(labelColor.borderWidth)) : labelColor.borderWidth || 1;\n ctx.strokeStyle = labelColor.borderColor;\n ctx.setLineDash(labelColor.borderDash || []);\n ctx.lineDashOffset = labelColor.borderDashOffset || 0;\n const outerX = rtlHelper.leftForLtr(rtlColorX, boxWidth);\n const innerX = rtlHelper.leftForLtr(rtlHelper.xPlus(rtlColorX, 1), boxWidth - 2);\n const borderRadius = toTRBLCorners(labelColor.borderRadius);\n if (Object.values(borderRadius).some((v)=>v !== 0)) {\n ctx.beginPath();\n ctx.fillStyle = options.multiKeyBackground;\n addRoundedRectPath(ctx, {\n x: outerX,\n y: colorY,\n w: boxWidth,\n h: boxHeight,\n radius: borderRadius\n });\n ctx.fill();\n ctx.stroke();\n ctx.fillStyle = labelColor.backgroundColor;\n ctx.beginPath();\n addRoundedRectPath(ctx, {\n x: innerX,\n y: colorY + 1,\n w: boxWidth - 2,\n h: boxHeight - 2,\n radius: borderRadius\n });\n ctx.fill();\n } else {\n ctx.fillStyle = options.multiKeyBackground;\n ctx.fillRect(outerX, colorY, boxWidth, boxHeight);\n ctx.strokeRect(outerX, colorY, boxWidth, boxHeight);\n ctx.fillStyle = labelColor.backgroundColor;\n ctx.fillRect(innerX, colorY + 1, boxWidth - 2, boxHeight - 2);\n }\n }\n ctx.fillStyle = this.labelTextColors[i];\n }\n drawBody(pt, ctx, options) {\n const { body } = this;\n const { bodySpacing , bodyAlign , displayColors , boxHeight , boxWidth , boxPadding } = options;\n const bodyFont = toFont(options.bodyFont);\n let bodyLineHeight = bodyFont.lineHeight;\n let xLinePadding = 0;\n const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width);\n const fillLineOfText = function(line) {\n ctx.fillText(line, rtlHelper.x(pt.x + xLinePadding), pt.y + bodyLineHeight / 2);\n pt.y += bodyLineHeight + bodySpacing;\n };\n const bodyAlignForCalculation = rtlHelper.textAlign(bodyAlign);\n let bodyItem, textColor, lines, i, j, ilen, jlen;\n ctx.textAlign = bodyAlign;\n ctx.textBaseline = 'middle';\n ctx.font = bodyFont.string;\n pt.x = getAlignedX(this, bodyAlignForCalculation, options);\n ctx.fillStyle = options.bodyColor;\n each(this.beforeBody, fillLineOfText);\n xLinePadding = displayColors && bodyAlignForCalculation !== 'right' ? bodyAlign === 'center' ? boxWidth / 2 + boxPadding : boxWidth + 2 + boxPadding : 0;\n for(i = 0, ilen = body.length; i < ilen; ++i){\n bodyItem = body[i];\n textColor = this.labelTextColors[i];\n ctx.fillStyle = textColor;\n each(bodyItem.before, fillLineOfText);\n lines = bodyItem.lines;\n if (displayColors && lines.length) {\n this._drawColorBox(ctx, pt, i, rtlHelper, options);\n bodyLineHeight = Math.max(bodyFont.lineHeight, boxHeight);\n }\n for(j = 0, jlen = lines.length; j < jlen; ++j){\n fillLineOfText(lines[j]);\n bodyLineHeight = bodyFont.lineHeight;\n }\n each(bodyItem.after, fillLineOfText);\n }\n xLinePadding = 0;\n bodyLineHeight = bodyFont.lineHeight;\n each(this.afterBody, fillLineOfText);\n pt.y -= bodySpacing;\n }\n drawFooter(pt, ctx, options) {\n const footer = this.footer;\n const length = footer.length;\n let footerFont, i;\n if (length) {\n const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width);\n pt.x = getAlignedX(this, options.footerAlign, options);\n pt.y += options.footerMarginTop;\n ctx.textAlign = rtlHelper.textAlign(options.footerAlign);\n ctx.textBaseline = 'middle';\n footerFont = toFont(options.footerFont);\n ctx.fillStyle = options.footerColor;\n ctx.font = footerFont.string;\n for(i = 0; i < length; ++i){\n ctx.fillText(footer[i], rtlHelper.x(pt.x), pt.y + footerFont.lineHeight / 2);\n pt.y += footerFont.lineHeight + options.footerSpacing;\n }\n }\n }\n drawBackground(pt, ctx, tooltipSize, options) {\n const { xAlign , yAlign } = this;\n const { x , y } = pt;\n const { width , height } = tooltipSize;\n const { topLeft , topRight , bottomLeft , bottomRight } = toTRBLCorners(options.cornerRadius);\n ctx.fillStyle = options.backgroundColor;\n ctx.strokeStyle = options.borderColor;\n ctx.lineWidth = options.borderWidth;\n ctx.beginPath();\n ctx.moveTo(x + topLeft, y);\n if (yAlign === 'top') {\n this.drawCaret(pt, ctx, tooltipSize, options);\n }\n ctx.lineTo(x + width - topRight, y);\n ctx.quadraticCurveTo(x + width, y, x + width, y + topRight);\n if (yAlign === 'center' && xAlign === 'right') {\n this.drawCaret(pt, ctx, tooltipSize, options);\n }\n ctx.lineTo(x + width, y + height - bottomRight);\n ctx.quadraticCurveTo(x + width, y + height, x + width - bottomRight, y + height);\n if (yAlign === 'bottom') {\n this.drawCaret(pt, ctx, tooltipSize, options);\n }\n ctx.lineTo(x + bottomLeft, y + height);\n ctx.quadraticCurveTo(x, y + height, x, y + height - bottomLeft);\n if (yAlign === 'center' && xAlign === 'left') {\n this.drawCaret(pt, ctx, tooltipSize, options);\n }\n ctx.lineTo(x, y + topLeft);\n ctx.quadraticCurveTo(x, y, x + topLeft, y);\n ctx.closePath();\n ctx.fill();\n if (options.borderWidth > 0) {\n ctx.stroke();\n }\n }\n _updateAnimationTarget(options) {\n const chart = this.chart;\n const anims = this.$animations;\n const animX = anims && anims.x;\n const animY = anims && anims.y;\n if (animX || animY) {\n const position = positioners[options.position].call(this, this._active, this._eventPosition);\n if (!position) {\n return;\n }\n const size = this._size = getTooltipSize(this, options);\n const positionAndSize = Object.assign({}, position, this._size);\n const alignment = determineAlignment(chart, options, positionAndSize);\n const point = getBackgroundPoint(options, positionAndSize, alignment, chart);\n if (animX._to !== point.x || animY._to !== point.y) {\n this.xAlign = alignment.xAlign;\n this.yAlign = alignment.yAlign;\n this.width = size.width;\n this.height = size.height;\n this.caretX = position.x;\n this.caretY = position.y;\n this._resolveAnimations().update(this, point);\n }\n }\n }\n _willRender() {\n return !!this.opacity;\n }\n draw(ctx) {\n const options = this.options.setContext(this.getContext());\n let opacity = this.opacity;\n if (!opacity) {\n return;\n }\n this._updateAnimationTarget(options);\n const tooltipSize = {\n width: this.width,\n height: this.height\n };\n const pt = {\n x: this.x,\n y: this.y\n };\n opacity = Math.abs(opacity) < 1e-3 ? 0 : opacity;\n const padding = toPadding(options.padding);\n const hasTooltipContent = this.title.length || this.beforeBody.length || this.body.length || this.afterBody.length || this.footer.length;\n if (options.enabled && hasTooltipContent) {\n ctx.save();\n ctx.globalAlpha = opacity;\n this.drawBackground(pt, ctx, tooltipSize, options);\n overrideTextDirection(ctx, options.textDirection);\n pt.y += padding.top;\n this.drawTitle(pt, ctx, options);\n this.drawBody(pt, ctx, options);\n this.drawFooter(pt, ctx, options);\n restoreTextDirection(ctx, options.textDirection);\n ctx.restore();\n }\n }\n getActiveElements() {\n return this._active || [];\n }\n setActiveElements(activeElements, eventPosition) {\n const lastActive = this._active;\n const active = activeElements.map(({ datasetIndex , index })=>{\n const meta = this.chart.getDatasetMeta(datasetIndex);\n if (!meta) {\n throw new Error('Cannot find a dataset at index ' + datasetIndex);\n }\n return {\n datasetIndex,\n element: meta.data[index],\n index\n };\n });\n const changed = !_elementsEqual(lastActive, active);\n const positionChanged = this._positionChanged(active, eventPosition);\n if (changed || positionChanged) {\n this._active = active;\n this._eventPosition = eventPosition;\n this._ignoreReplayEvents = true;\n this.update(true);\n }\n }\n handleEvent(e, replay, inChartArea = true) {\n if (replay && this._ignoreReplayEvents) {\n return false;\n }\n this._ignoreReplayEvents = false;\n const options = this.options;\n const lastActive = this._active || [];\n const active = this._getActiveElements(e, lastActive, replay, inChartArea);\n const positionChanged = this._positionChanged(active, e);\n const changed = replay || !_elementsEqual(active, lastActive) || positionChanged;\n if (changed) {\n this._active = active;\n if (options.enabled || options.external) {\n this._eventPosition = {\n x: e.x,\n y: e.y\n };\n this.update(true, replay);\n }\n }\n return changed;\n }\n _getActiveElements(e, lastActive, replay, inChartArea) {\n const options = this.options;\n if (e.type === 'mouseout') {\n return [];\n }\n if (!inChartArea) {\n return lastActive;\n }\n const active = this.chart.getElementsAtEventForMode(e, options.mode, options, replay);\n if (options.reverse) {\n active.reverse();\n }\n return active;\n }\n _positionChanged(active, e) {\n const { caretX , caretY , options } = this;\n const position = positioners[options.position].call(this, active, e);\n return position !== false && (caretX !== position.x || caretY !== position.y);\n }\n}\nvar plugin_tooltip = {\n id: 'tooltip',\n _element: Tooltip,\n positioners,\n afterInit (chart, _args, options) {\n if (options) {\n chart.tooltip = new Tooltip({\n chart,\n options\n });\n }\n },\n beforeUpdate (chart, _args, options) {\n if (chart.tooltip) {\n chart.tooltip.initialize(options);\n }\n },\n reset (chart, _args, options) {\n if (chart.tooltip) {\n chart.tooltip.initialize(options);\n }\n },\n afterDraw (chart) {\n const tooltip = chart.tooltip;\n if (tooltip && tooltip._willRender()) {\n const args = {\n tooltip\n };\n if (chart.notifyPlugins('beforeTooltipDraw', {\n ...args,\n cancelable: true\n }) === false) {\n return;\n }\n tooltip.draw(chart.ctx);\n chart.notifyPlugins('afterTooltipDraw', args);\n }\n },\n afterEvent (chart, args) {\n if (chart.tooltip) {\n const useFinalPosition = args.replay;\n if (chart.tooltip.handleEvent(args.event, useFinalPosition, args.inChartArea)) {\n args.changed = true;\n }\n }\n },\n defaults: {\n enabled: true,\n external: null,\n position: 'average',\n backgroundColor: 'rgba(0,0,0,0.8)',\n titleColor: '#fff',\n titleFont: {\n weight: 'bold'\n },\n titleSpacing: 2,\n titleMarginBottom: 6,\n titleAlign: 'left',\n bodyColor: '#fff',\n bodySpacing: 2,\n bodyFont: {},\n bodyAlign: 'left',\n footerColor: '#fff',\n footerSpacing: 2,\n footerMarginTop: 6,\n footerFont: {\n weight: 'bold'\n },\n footerAlign: 'left',\n padding: 6,\n caretPadding: 2,\n caretSize: 5,\n cornerRadius: 6,\n boxHeight: (ctx, opts)=>opts.bodyFont.size,\n boxWidth: (ctx, opts)=>opts.bodyFont.size,\n multiKeyBackground: '#fff',\n displayColors: true,\n boxPadding: 0,\n borderColor: 'rgba(0,0,0,0)',\n borderWidth: 0,\n animation: {\n duration: 400,\n easing: 'easeOutQuart'\n },\n animations: {\n numbers: {\n type: 'number',\n properties: [\n 'x',\n 'y',\n 'width',\n 'height',\n 'caretX',\n 'caretY'\n ]\n },\n opacity: {\n easing: 'linear',\n duration: 200\n }\n },\n callbacks: defaultCallbacks\n },\n defaultRoutes: {\n bodyFont: 'font',\n footerFont: 'font',\n titleFont: 'font'\n },\n descriptors: {\n _scriptable: (name)=>name !== 'filter' && name !== 'itemSort' && name !== 'external',\n _indexable: false,\n callbacks: {\n _scriptable: false,\n _indexable: false\n },\n animation: {\n _fallback: false\n },\n animations: {\n _fallback: 'animation'\n }\n },\n additionalOptionScopes: [\n 'interaction'\n ]\n};\n\nvar plugins = /*#__PURE__*/Object.freeze({\n__proto__: null,\nColors: plugin_colors,\nDecimation: plugin_decimation,\nFiller: index,\nLegend: plugin_legend,\nSubTitle: plugin_subtitle,\nTitle: plugin_title,\nTooltip: plugin_tooltip\n});\n\nconst addIfString = (labels, raw, index, addedLabels)=>{\n if (typeof raw === 'string') {\n index = labels.push(raw) - 1;\n addedLabels.unshift({\n index,\n label: raw\n });\n } else if (isNaN(raw)) {\n index = null;\n }\n return index;\n};\nfunction findOrAddLabel(labels, raw, index, addedLabels) {\n const first = labels.indexOf(raw);\n if (first === -1) {\n return addIfString(labels, raw, index, addedLabels);\n }\n const last = labels.lastIndexOf(raw);\n return first !== last ? index : first;\n}\nconst validIndex = (index, max)=>index === null ? null : _limitValue(Math.round(index), 0, max);\nfunction _getLabelForValue(value) {\n const labels = this.getLabels();\n if (value >= 0 && value < labels.length) {\n return labels[value];\n }\n return value;\n}\nclass CategoryScale extends Scale {\n static id = 'category';\n static defaults = {\n ticks: {\n callback: _getLabelForValue\n }\n };\n constructor(cfg){\n super(cfg);\n this._startValue = undefined;\n this._valueRange = 0;\n this._addedLabels = [];\n }\n init(scaleOptions) {\n const added = this._addedLabels;\n if (added.length) {\n const labels = this.getLabels();\n for (const { index , label } of added){\n if (labels[index] === label) {\n labels.splice(index, 1);\n }\n }\n this._addedLabels = [];\n }\n super.init(scaleOptions);\n }\n parse(raw, index) {\n if (isNullOrUndef(raw)) {\n return null;\n }\n const labels = this.getLabels();\n index = isFinite(index) && labels[index] === raw ? index : findOrAddLabel(labels, raw, valueOrDefault(index, raw), this._addedLabels);\n return validIndex(index, labels.length - 1);\n }\n determineDataLimits() {\n const { minDefined , maxDefined } = this.getUserBounds();\n let { min , max } = this.getMinMax(true);\n if (this.options.bounds === 'ticks') {\n if (!minDefined) {\n min = 0;\n }\n if (!maxDefined) {\n max = this.getLabels().length - 1;\n }\n }\n this.min = min;\n this.max = max;\n }\n buildTicks() {\n const min = this.min;\n const max = this.max;\n const offset = this.options.offset;\n const ticks = [];\n let labels = this.getLabels();\n labels = min === 0 && max === labels.length - 1 ? labels : labels.slice(min, max + 1);\n this._valueRange = Math.max(labels.length - (offset ? 0 : 1), 1);\n this._startValue = this.min - (offset ? 0.5 : 0);\n for(let value = min; value <= max; value++){\n ticks.push({\n value\n });\n }\n return ticks;\n }\n getLabelForValue(value) {\n return _getLabelForValue.call(this, value);\n }\n configure() {\n super.configure();\n if (!this.isHorizontal()) {\n this._reversePixels = !this._reversePixels;\n }\n }\n getPixelForValue(value) {\n if (typeof value !== 'number') {\n value = this.parse(value);\n }\n return value === null ? NaN : this.getPixelForDecimal((value - this._startValue) / this._valueRange);\n }\n getPixelForTick(index) {\n const ticks = this.ticks;\n if (index < 0 || index > ticks.length - 1) {\n return null;\n }\n return this.getPixelForValue(ticks[index].value);\n }\n getValueForPixel(pixel) {\n return Math.round(this._startValue + this.getDecimalForPixel(pixel) * this._valueRange);\n }\n getBasePixel() {\n return this.bottom;\n }\n}\n\nfunction generateTicks$1(generationOptions, dataRange) {\n const ticks = [];\n const MIN_SPACING = 1e-14;\n const { bounds , step , min , max , precision , count , maxTicks , maxDigits , includeBounds } = generationOptions;\n const unit = step || 1;\n const maxSpaces = maxTicks - 1;\n const { min: rmin , max: rmax } = dataRange;\n const minDefined = !isNullOrUndef(min);\n const maxDefined = !isNullOrUndef(max);\n const countDefined = !isNullOrUndef(count);\n const minSpacing = (rmax - rmin) / (maxDigits + 1);\n let spacing = niceNum((rmax - rmin) / maxSpaces / unit) * unit;\n let factor, niceMin, niceMax, numSpaces;\n if (spacing < MIN_SPACING && !minDefined && !maxDefined) {\n return [\n {\n value: rmin\n },\n {\n value: rmax\n }\n ];\n }\n numSpaces = Math.ceil(rmax / spacing) - Math.floor(rmin / spacing);\n if (numSpaces > maxSpaces) {\n spacing = niceNum(numSpaces * spacing / maxSpaces / unit) * unit;\n }\n if (!isNullOrUndef(precision)) {\n factor = Math.pow(10, precision);\n spacing = Math.ceil(spacing * factor) / factor;\n }\n if (bounds === 'ticks') {\n niceMin = Math.floor(rmin / spacing) * spacing;\n niceMax = Math.ceil(rmax / spacing) * spacing;\n } else {\n niceMin = rmin;\n niceMax = rmax;\n }\n if (minDefined && maxDefined && step && almostWhole((max - min) / step, spacing / 1000)) {\n numSpaces = Math.round(Math.min((max - min) / spacing, maxTicks));\n spacing = (max - min) / numSpaces;\n niceMin = min;\n niceMax = max;\n } else if (countDefined) {\n niceMin = minDefined ? min : niceMin;\n niceMax = maxDefined ? max : niceMax;\n numSpaces = count - 1;\n spacing = (niceMax - niceMin) / numSpaces;\n } else {\n numSpaces = (niceMax - niceMin) / spacing;\n if (almostEquals(numSpaces, Math.round(numSpaces), spacing / 1000)) {\n numSpaces = Math.round(numSpaces);\n } else {\n numSpaces = Math.ceil(numSpaces);\n }\n }\n const decimalPlaces = Math.max(_decimalPlaces(spacing), _decimalPlaces(niceMin));\n factor = Math.pow(10, isNullOrUndef(precision) ? decimalPlaces : precision);\n niceMin = Math.round(niceMin * factor) / factor;\n niceMax = Math.round(niceMax * factor) / factor;\n let j = 0;\n if (minDefined) {\n if (includeBounds && niceMin !== min) {\n ticks.push({\n value: min\n });\n if (niceMin < min) {\n j++;\n }\n if (almostEquals(Math.round((niceMin + j * spacing) * factor) / factor, min, relativeLabelSize(min, minSpacing, generationOptions))) {\n j++;\n }\n } else if (niceMin < min) {\n j++;\n }\n }\n for(; j < numSpaces; ++j){\n const tickValue = Math.round((niceMin + j * spacing) * factor) / factor;\n if (maxDefined && tickValue > max) {\n break;\n }\n ticks.push({\n value: tickValue\n });\n }\n if (maxDefined && includeBounds && niceMax !== max) {\n if (ticks.length && almostEquals(ticks[ticks.length - 1].value, max, relativeLabelSize(max, minSpacing, generationOptions))) {\n ticks[ticks.length - 1].value = max;\n } else {\n ticks.push({\n value: max\n });\n }\n } else if (!maxDefined || niceMax === max) {\n ticks.push({\n value: niceMax\n });\n }\n return ticks;\n}\nfunction relativeLabelSize(value, minSpacing, { horizontal , minRotation }) {\n const rad = toRadians(minRotation);\n const ratio = (horizontal ? Math.sin(rad) : Math.cos(rad)) || 0.001;\n const length = 0.75 * minSpacing * ('' + value).length;\n return Math.min(minSpacing / ratio, length);\n}\nclass LinearScaleBase extends Scale {\n constructor(cfg){\n super(cfg);\n this.start = undefined;\n this.end = undefined;\n this._startValue = undefined;\n this._endValue = undefined;\n this._valueRange = 0;\n }\n parse(raw, index) {\n if (isNullOrUndef(raw)) {\n return null;\n }\n if ((typeof raw === 'number' || raw instanceof Number) && !isFinite(+raw)) {\n return null;\n }\n return +raw;\n }\n handleTickRangeOptions() {\n const { beginAtZero } = this.options;\n const { minDefined , maxDefined } = this.getUserBounds();\n let { min , max } = this;\n const setMin = (v)=>min = minDefined ? min : v;\n const setMax = (v)=>max = maxDefined ? max : v;\n if (beginAtZero) {\n const minSign = sign(min);\n const maxSign = sign(max);\n if (minSign < 0 && maxSign < 0) {\n setMax(0);\n } else if (minSign > 0 && maxSign > 0) {\n setMin(0);\n }\n }\n if (min === max) {\n let offset = max === 0 ? 1 : Math.abs(max * 0.05);\n setMax(max + offset);\n if (!beginAtZero) {\n setMin(min - offset);\n }\n }\n this.min = min;\n this.max = max;\n }\n getTickLimit() {\n const tickOpts = this.options.ticks;\n let { maxTicksLimit , stepSize } = tickOpts;\n let maxTicks;\n if (stepSize) {\n maxTicks = Math.ceil(this.max / stepSize) - Math.floor(this.min / stepSize) + 1;\n if (maxTicks > 1000) {\n console.warn(`scales.${this.id}.ticks.stepSize: ${stepSize} would result generating up to ${maxTicks} ticks. Limiting to 1000.`);\n maxTicks = 1000;\n }\n } else {\n maxTicks = this.computeTickLimit();\n maxTicksLimit = maxTicksLimit || 11;\n }\n if (maxTicksLimit) {\n maxTicks = Math.min(maxTicksLimit, maxTicks);\n }\n return maxTicks;\n }\n computeTickLimit() {\n return Number.POSITIVE_INFINITY;\n }\n buildTicks() {\n const opts = this.options;\n const tickOpts = opts.ticks;\n let maxTicks = this.getTickLimit();\n maxTicks = Math.max(2, maxTicks);\n const numericGeneratorOptions = {\n maxTicks,\n bounds: opts.bounds,\n min: opts.min,\n max: opts.max,\n precision: tickOpts.precision,\n step: tickOpts.stepSize,\n count: tickOpts.count,\n maxDigits: this._maxDigits(),\n horizontal: this.isHorizontal(),\n minRotation: tickOpts.minRotation || 0,\n includeBounds: tickOpts.includeBounds !== false\n };\n const dataRange = this._range || this;\n const ticks = generateTicks$1(numericGeneratorOptions, dataRange);\n if (opts.bounds === 'ticks') {\n _setMinAndMaxByKey(ticks, this, 'value');\n }\n if (opts.reverse) {\n ticks.reverse();\n this.start = this.max;\n this.end = this.min;\n } else {\n this.start = this.min;\n this.end = this.max;\n }\n return ticks;\n }\n configure() {\n const ticks = this.ticks;\n let start = this.min;\n let end = this.max;\n super.configure();\n if (this.options.offset && ticks.length) {\n const offset = (end - start) / Math.max(ticks.length - 1, 1) / 2;\n start -= offset;\n end += offset;\n }\n this._startValue = start;\n this._endValue = end;\n this._valueRange = end - start;\n }\n getLabelForValue(value) {\n return formatNumber(value, this.chart.options.locale, this.options.ticks.format);\n }\n}\n\nclass LinearScale extends LinearScaleBase {\n static id = 'linear';\n static defaults = {\n ticks: {\n callback: Ticks.formatters.numeric\n }\n };\n determineDataLimits() {\n const { min , max } = this.getMinMax(true);\n this.min = isNumberFinite(min) ? min : 0;\n this.max = isNumberFinite(max) ? max : 1;\n this.handleTickRangeOptions();\n }\n computeTickLimit() {\n const horizontal = this.isHorizontal();\n const length = horizontal ? this.width : this.height;\n const minRotation = toRadians(this.options.ticks.minRotation);\n const ratio = (horizontal ? Math.sin(minRotation) : Math.cos(minRotation)) || 0.001;\n const tickFont = this._resolveTickFontOptions(0);\n return Math.ceil(length / Math.min(40, tickFont.lineHeight / ratio));\n }\n getPixelForValue(value) {\n return value === null ? NaN : this.getPixelForDecimal((value - this._startValue) / this._valueRange);\n }\n getValueForPixel(pixel) {\n return this._startValue + this.getDecimalForPixel(pixel) * this._valueRange;\n }\n}\n\nconst log10Floor = (v)=>Math.floor(log10(v));\nconst changeExponent = (v, m)=>Math.pow(10, log10Floor(v) + m);\nfunction isMajor(tickVal) {\n const remain = tickVal / Math.pow(10, log10Floor(tickVal));\n return remain === 1;\n}\nfunction steps(min, max, rangeExp) {\n const rangeStep = Math.pow(10, rangeExp);\n const start = Math.floor(min / rangeStep);\n const end = Math.ceil(max / rangeStep);\n return end - start;\n}\nfunction startExp(min, max) {\n const range = max - min;\n let rangeExp = log10Floor(range);\n while(steps(min, max, rangeExp) > 10){\n rangeExp++;\n }\n while(steps(min, max, rangeExp) < 10){\n rangeExp--;\n }\n return Math.min(rangeExp, log10Floor(min));\n}\n function generateTicks(generationOptions, { min , max }) {\n min = finiteOrDefault(generationOptions.min, min);\n const ticks = [];\n const minExp = log10Floor(min);\n let exp = startExp(min, max);\n let precision = exp < 0 ? Math.pow(10, Math.abs(exp)) : 1;\n const stepSize = Math.pow(10, exp);\n const base = minExp > exp ? Math.pow(10, minExp) : 0;\n const start = Math.round((min - base) * precision) / precision;\n const offset = Math.floor((min - base) / stepSize / 10) * stepSize * 10;\n let significand = Math.floor((start - offset) / Math.pow(10, exp));\n let value = finiteOrDefault(generationOptions.min, Math.round((base + offset + significand * Math.pow(10, exp)) * precision) / precision);\n while(value < max){\n ticks.push({\n value,\n major: isMajor(value),\n significand\n });\n if (significand >= 10) {\n significand = significand < 15 ? 15 : 20;\n } else {\n significand++;\n }\n if (significand >= 20) {\n exp++;\n significand = 2;\n precision = exp >= 0 ? 1 : precision;\n }\n value = Math.round((base + offset + significand * Math.pow(10, exp)) * precision) / precision;\n }\n const lastTick = finiteOrDefault(generationOptions.max, value);\n ticks.push({\n value: lastTick,\n major: isMajor(lastTick),\n significand\n });\n return ticks;\n}\nclass LogarithmicScale extends Scale {\n static id = 'logarithmic';\n static defaults = {\n ticks: {\n callback: Ticks.formatters.logarithmic,\n major: {\n enabled: true\n }\n }\n };\n constructor(cfg){\n super(cfg);\n this.start = undefined;\n this.end = undefined;\n this._startValue = undefined;\n this._valueRange = 0;\n }\n parse(raw, index) {\n const value = LinearScaleBase.prototype.parse.apply(this, [\n raw,\n index\n ]);\n if (value === 0) {\n this._zero = true;\n return undefined;\n }\n return isNumberFinite(value) && value > 0 ? value : null;\n }\n determineDataLimits() {\n const { min , max } = this.getMinMax(true);\n this.min = isNumberFinite(min) ? Math.max(0, min) : null;\n this.max = isNumberFinite(max) ? Math.max(0, max) : null;\n if (this.options.beginAtZero) {\n this._zero = true;\n }\n if (this._zero && this.min !== this._suggestedMin && !isNumberFinite(this._userMin)) {\n this.min = min === changeExponent(this.min, 0) ? changeExponent(this.min, -1) : changeExponent(this.min, 0);\n }\n this.handleTickRangeOptions();\n }\n handleTickRangeOptions() {\n const { minDefined , maxDefined } = this.getUserBounds();\n let min = this.min;\n let max = this.max;\n const setMin = (v)=>min = minDefined ? min : v;\n const setMax = (v)=>max = maxDefined ? max : v;\n if (min === max) {\n if (min <= 0) {\n setMin(1);\n setMax(10);\n } else {\n setMin(changeExponent(min, -1));\n setMax(changeExponent(max, +1));\n }\n }\n if (min <= 0) {\n setMin(changeExponent(max, -1));\n }\n if (max <= 0) {\n setMax(changeExponent(min, +1));\n }\n this.min = min;\n this.max = max;\n }\n buildTicks() {\n const opts = this.options;\n const generationOptions = {\n min: this._userMin,\n max: this._userMax\n };\n const ticks = generateTicks(generationOptions, this);\n if (opts.bounds === 'ticks') {\n _setMinAndMaxByKey(ticks, this, 'value');\n }\n if (opts.reverse) {\n ticks.reverse();\n this.start = this.max;\n this.end = this.min;\n } else {\n this.start = this.min;\n this.end = this.max;\n }\n return ticks;\n }\n getLabelForValue(value) {\n return value === undefined ? '0' : formatNumber(value, this.chart.options.locale, this.options.ticks.format);\n }\n configure() {\n const start = this.min;\n super.configure();\n this._startValue = log10(start);\n this._valueRange = log10(this.max) - log10(start);\n }\n getPixelForValue(value) {\n if (value === undefined || value === 0) {\n value = this.min;\n }\n if (value === null || isNaN(value)) {\n return NaN;\n }\n return this.getPixelForDecimal(value === this.min ? 0 : (log10(value) - this._startValue) / this._valueRange);\n }\n getValueForPixel(pixel) {\n const decimal = this.getDecimalForPixel(pixel);\n return Math.pow(10, this._startValue + decimal * this._valueRange);\n }\n}\n\nfunction getTickBackdropHeight(opts) {\n const tickOpts = opts.ticks;\n if (tickOpts.display && opts.display) {\n const padding = toPadding(tickOpts.backdropPadding);\n return valueOrDefault(tickOpts.font && tickOpts.font.size, defaults.font.size) + padding.height;\n }\n return 0;\n}\nfunction measureLabelSize(ctx, font, label) {\n label = isArray(label) ? label : [\n label\n ];\n return {\n w: _longestText(ctx, font.string, label),\n h: label.length * font.lineHeight\n };\n}\nfunction determineLimits(angle, pos, size, min, max) {\n if (angle === min || angle === max) {\n return {\n start: pos - size / 2,\n end: pos + size / 2\n };\n } else if (angle < min || angle > max) {\n return {\n start: pos - size,\n end: pos\n };\n }\n return {\n start: pos,\n end: pos + size\n };\n}\n function fitWithPointLabels(scale) {\n const orig = {\n l: scale.left + scale._padding.left,\n r: scale.right - scale._padding.right,\n t: scale.top + scale._padding.top,\n b: scale.bottom - scale._padding.bottom\n };\n const limits = Object.assign({}, orig);\n const labelSizes = [];\n const padding = [];\n const valueCount = scale._pointLabels.length;\n const pointLabelOpts = scale.options.pointLabels;\n const additionalAngle = pointLabelOpts.centerPointLabels ? PI / valueCount : 0;\n for(let i = 0; i < valueCount; i++){\n const opts = pointLabelOpts.setContext(scale.getPointLabelContext(i));\n padding[i] = opts.padding;\n const pointPosition = scale.getPointPosition(i, scale.drawingArea + padding[i], additionalAngle);\n const plFont = toFont(opts.font);\n const textSize = measureLabelSize(scale.ctx, plFont, scale._pointLabels[i]);\n labelSizes[i] = textSize;\n const angleRadians = _normalizeAngle(scale.getIndexAngle(i) + additionalAngle);\n const angle = Math.round(toDegrees(angleRadians));\n const hLimits = determineLimits(angle, pointPosition.x, textSize.w, 0, 180);\n const vLimits = determineLimits(angle, pointPosition.y, textSize.h, 90, 270);\n updateLimits(limits, orig, angleRadians, hLimits, vLimits);\n }\n scale.setCenterPoint(orig.l - limits.l, limits.r - orig.r, orig.t - limits.t, limits.b - orig.b);\n scale._pointLabelItems = buildPointLabelItems(scale, labelSizes, padding);\n}\nfunction updateLimits(limits, orig, angle, hLimits, vLimits) {\n const sin = Math.abs(Math.sin(angle));\n const cos = Math.abs(Math.cos(angle));\n let x = 0;\n let y = 0;\n if (hLimits.start < orig.l) {\n x = (orig.l - hLimits.start) / sin;\n limits.l = Math.min(limits.l, orig.l - x);\n } else if (hLimits.end > orig.r) {\n x = (hLimits.end - orig.r) / sin;\n limits.r = Math.max(limits.r, orig.r + x);\n }\n if (vLimits.start < orig.t) {\n y = (orig.t - vLimits.start) / cos;\n limits.t = Math.min(limits.t, orig.t - y);\n } else if (vLimits.end > orig.b) {\n y = (vLimits.end - orig.b) / cos;\n limits.b = Math.max(limits.b, orig.b + y);\n }\n}\nfunction createPointLabelItem(scale, index, itemOpts) {\n const outerDistance = scale.drawingArea;\n const { extra , additionalAngle , padding , size } = itemOpts;\n const pointLabelPosition = scale.getPointPosition(index, outerDistance + extra + padding, additionalAngle);\n const angle = Math.round(toDegrees(_normalizeAngle(pointLabelPosition.angle + HALF_PI)));\n const y = yForAngle(pointLabelPosition.y, size.h, angle);\n const textAlign = getTextAlignForAngle(angle);\n const left = leftForTextAlign(pointLabelPosition.x, size.w, textAlign);\n return {\n visible: true,\n x: pointLabelPosition.x,\n y,\n textAlign,\n left,\n top: y,\n right: left + size.w,\n bottom: y + size.h\n };\n}\nfunction isNotOverlapped(item, area) {\n if (!area) {\n return true;\n }\n const { left , top , right , bottom } = item;\n const apexesInArea = _isPointInArea({\n x: left,\n y: top\n }, area) || _isPointInArea({\n x: left,\n y: bottom\n }, area) || _isPointInArea({\n x: right,\n y: top\n }, area) || _isPointInArea({\n x: right,\n y: bottom\n }, area);\n return !apexesInArea;\n}\nfunction buildPointLabelItems(scale, labelSizes, padding) {\n const items = [];\n const valueCount = scale._pointLabels.length;\n const opts = scale.options;\n const { centerPointLabels , display } = opts.pointLabels;\n const itemOpts = {\n extra: getTickBackdropHeight(opts) / 2,\n additionalAngle: centerPointLabels ? PI / valueCount : 0\n };\n let area;\n for(let i = 0; i < valueCount; i++){\n itemOpts.padding = padding[i];\n itemOpts.size = labelSizes[i];\n const item = createPointLabelItem(scale, i, itemOpts);\n items.push(item);\n if (display === 'auto') {\n item.visible = isNotOverlapped(item, area);\n if (item.visible) {\n area = item;\n }\n }\n }\n return items;\n}\nfunction getTextAlignForAngle(angle) {\n if (angle === 0 || angle === 180) {\n return 'center';\n } else if (angle < 180) {\n return 'left';\n }\n return 'right';\n}\nfunction leftForTextAlign(x, w, align) {\n if (align === 'right') {\n x -= w;\n } else if (align === 'center') {\n x -= w / 2;\n }\n return x;\n}\nfunction yForAngle(y, h, angle) {\n if (angle === 90 || angle === 270) {\n y -= h / 2;\n } else if (angle > 270 || angle < 90) {\n y -= h;\n }\n return y;\n}\nfunction drawPointLabelBox(ctx, opts, item) {\n const { left , top , right , bottom } = item;\n const { backdropColor } = opts;\n if (!isNullOrUndef(backdropColor)) {\n const borderRadius = toTRBLCorners(opts.borderRadius);\n const padding = toPadding(opts.backdropPadding);\n ctx.fillStyle = backdropColor;\n const backdropLeft = left - padding.left;\n const backdropTop = top - padding.top;\n const backdropWidth = right - left + padding.width;\n const backdropHeight = bottom - top + padding.height;\n if (Object.values(borderRadius).some((v)=>v !== 0)) {\n ctx.beginPath();\n addRoundedRectPath(ctx, {\n x: backdropLeft,\n y: backdropTop,\n w: backdropWidth,\n h: backdropHeight,\n radius: borderRadius\n });\n ctx.fill();\n } else {\n ctx.fillRect(backdropLeft, backdropTop, backdropWidth, backdropHeight);\n }\n }\n}\nfunction drawPointLabels(scale, labelCount) {\n const { ctx , options: { pointLabels } } = scale;\n for(let i = labelCount - 1; i >= 0; i--){\n const item = scale._pointLabelItems[i];\n if (!item.visible) {\n continue;\n }\n const optsAtIndex = pointLabels.setContext(scale.getPointLabelContext(i));\n drawPointLabelBox(ctx, optsAtIndex, item);\n const plFont = toFont(optsAtIndex.font);\n const { x , y , textAlign } = item;\n renderText(ctx, scale._pointLabels[i], x, y + plFont.lineHeight / 2, plFont, {\n color: optsAtIndex.color,\n textAlign: textAlign,\n textBaseline: 'middle'\n });\n }\n}\nfunction pathRadiusLine(scale, radius, circular, labelCount) {\n const { ctx } = scale;\n if (circular) {\n ctx.arc(scale.xCenter, scale.yCenter, radius, 0, TAU);\n } else {\n let pointPosition = scale.getPointPosition(0, radius);\n ctx.moveTo(pointPosition.x, pointPosition.y);\n for(let i = 1; i < labelCount; i++){\n pointPosition = scale.getPointPosition(i, radius);\n ctx.lineTo(pointPosition.x, pointPosition.y);\n }\n }\n}\nfunction drawRadiusLine(scale, gridLineOpts, radius, labelCount, borderOpts) {\n const ctx = scale.ctx;\n const circular = gridLineOpts.circular;\n const { color , lineWidth } = gridLineOpts;\n if (!circular && !labelCount || !color || !lineWidth || radius < 0) {\n return;\n }\n ctx.save();\n ctx.strokeStyle = color;\n ctx.lineWidth = lineWidth;\n ctx.setLineDash(borderOpts.dash);\n ctx.lineDashOffset = borderOpts.dashOffset;\n ctx.beginPath();\n pathRadiusLine(scale, radius, circular, labelCount);\n ctx.closePath();\n ctx.stroke();\n ctx.restore();\n}\nfunction createPointLabelContext(parent, index, label) {\n return createContext(parent, {\n label,\n index,\n type: 'pointLabel'\n });\n}\nclass RadialLinearScale extends LinearScaleBase {\n static id = 'radialLinear';\n static defaults = {\n display: true,\n animate: true,\n position: 'chartArea',\n angleLines: {\n display: true,\n lineWidth: 1,\n borderDash: [],\n borderDashOffset: 0.0\n },\n grid: {\n circular: false\n },\n startAngle: 0,\n ticks: {\n showLabelBackdrop: true,\n callback: Ticks.formatters.numeric\n },\n pointLabels: {\n backdropColor: undefined,\n backdropPadding: 2,\n display: true,\n font: {\n size: 10\n },\n callback (label) {\n return label;\n },\n padding: 5,\n centerPointLabels: false\n }\n };\n static defaultRoutes = {\n 'angleLines.color': 'borderColor',\n 'pointLabels.color': 'color',\n 'ticks.color': 'color'\n };\n static descriptors = {\n angleLines: {\n _fallback: 'grid'\n }\n };\n constructor(cfg){\n super(cfg);\n this.xCenter = undefined;\n this.yCenter = undefined;\n this.drawingArea = undefined;\n this._pointLabels = [];\n this._pointLabelItems = [];\n }\n setDimensions() {\n const padding = this._padding = toPadding(getTickBackdropHeight(this.options) / 2);\n const w = this.width = this.maxWidth - padding.width;\n const h = this.height = this.maxHeight - padding.height;\n this.xCenter = Math.floor(this.left + w / 2 + padding.left);\n this.yCenter = Math.floor(this.top + h / 2 + padding.top);\n this.drawingArea = Math.floor(Math.min(w, h) / 2);\n }\n determineDataLimits() {\n const { min , max } = this.getMinMax(false);\n this.min = isNumberFinite(min) && !isNaN(min) ? min : 0;\n this.max = isNumberFinite(max) && !isNaN(max) ? max : 0;\n this.handleTickRangeOptions();\n }\n computeTickLimit() {\n return Math.ceil(this.drawingArea / getTickBackdropHeight(this.options));\n }\n generateTickLabels(ticks) {\n LinearScaleBase.prototype.generateTickLabels.call(this, ticks);\n this._pointLabels = this.getLabels().map((value, index)=>{\n const label = callback(this.options.pointLabels.callback, [\n value,\n index\n ], this);\n return label || label === 0 ? label : '';\n }).filter((v, i)=>this.chart.getDataVisibility(i));\n }\n fit() {\n const opts = this.options;\n if (opts.display && opts.pointLabels.display) {\n fitWithPointLabels(this);\n } else {\n this.setCenterPoint(0, 0, 0, 0);\n }\n }\n setCenterPoint(leftMovement, rightMovement, topMovement, bottomMovement) {\n this.xCenter += Math.floor((leftMovement - rightMovement) / 2);\n this.yCenter += Math.floor((topMovement - bottomMovement) / 2);\n this.drawingArea -= Math.min(this.drawingArea / 2, Math.max(leftMovement, rightMovement, topMovement, bottomMovement));\n }\n getIndexAngle(index) {\n const angleMultiplier = TAU / (this._pointLabels.length || 1);\n const startAngle = this.options.startAngle || 0;\n return _normalizeAngle(index * angleMultiplier + toRadians(startAngle));\n }\n getDistanceFromCenterForValue(value) {\n if (isNullOrUndef(value)) {\n return NaN;\n }\n const scalingFactor = this.drawingArea / (this.max - this.min);\n if (this.options.reverse) {\n return (this.max - value) * scalingFactor;\n }\n return (value - this.min) * scalingFactor;\n }\n getValueForDistanceFromCenter(distance) {\n if (isNullOrUndef(distance)) {\n return NaN;\n }\n const scaledDistance = distance / (this.drawingArea / (this.max - this.min));\n return this.options.reverse ? this.max - scaledDistance : this.min + scaledDistance;\n }\n getPointLabelContext(index) {\n const pointLabels = this._pointLabels || [];\n if (index >= 0 && index < pointLabels.length) {\n const pointLabel = pointLabels[index];\n return createPointLabelContext(this.getContext(), index, pointLabel);\n }\n }\n getPointPosition(index, distanceFromCenter, additionalAngle = 0) {\n const angle = this.getIndexAngle(index) - HALF_PI + additionalAngle;\n return {\n x: Math.cos(angle) * distanceFromCenter + this.xCenter,\n y: Math.sin(angle) * distanceFromCenter + this.yCenter,\n angle\n };\n }\n getPointPositionForValue(index, value) {\n return this.getPointPosition(index, this.getDistanceFromCenterForValue(value));\n }\n getBasePosition(index) {\n return this.getPointPositionForValue(index || 0, this.getBaseValue());\n }\n getPointLabelPosition(index) {\n const { left , top , right , bottom } = this._pointLabelItems[index];\n return {\n left,\n top,\n right,\n bottom\n };\n }\n drawBackground() {\n const { backgroundColor , grid: { circular } } = this.options;\n if (backgroundColor) {\n const ctx = this.ctx;\n ctx.save();\n ctx.beginPath();\n pathRadiusLine(this, this.getDistanceFromCenterForValue(this._endValue), circular, this._pointLabels.length);\n ctx.closePath();\n ctx.fillStyle = backgroundColor;\n ctx.fill();\n ctx.restore();\n }\n }\n drawGrid() {\n const ctx = this.ctx;\n const opts = this.options;\n const { angleLines , grid , border } = opts;\n const labelCount = this._pointLabels.length;\n let i, offset, position;\n if (opts.pointLabels.display) {\n drawPointLabels(this, labelCount);\n }\n if (grid.display) {\n this.ticks.forEach((tick, index)=>{\n if (index !== 0) {\n offset = this.getDistanceFromCenterForValue(tick.value);\n const context = this.getContext(index);\n const optsAtIndex = grid.setContext(context);\n const optsAtIndexBorder = border.setContext(context);\n drawRadiusLine(this, optsAtIndex, offset, labelCount, optsAtIndexBorder);\n }\n });\n }\n if (angleLines.display) {\n ctx.save();\n for(i = labelCount - 1; i >= 0; i--){\n const optsAtIndex = angleLines.setContext(this.getPointLabelContext(i));\n const { color , lineWidth } = optsAtIndex;\n if (!lineWidth || !color) {\n continue;\n }\n ctx.lineWidth = lineWidth;\n ctx.strokeStyle = color;\n ctx.setLineDash(optsAtIndex.borderDash);\n ctx.lineDashOffset = optsAtIndex.borderDashOffset;\n offset = this.getDistanceFromCenterForValue(opts.ticks.reverse ? this.min : this.max);\n position = this.getPointPosition(i, offset);\n ctx.beginPath();\n ctx.moveTo(this.xCenter, this.yCenter);\n ctx.lineTo(position.x, position.y);\n ctx.stroke();\n }\n ctx.restore();\n }\n }\n drawBorder() {}\n drawLabels() {\n const ctx = this.ctx;\n const opts = this.options;\n const tickOpts = opts.ticks;\n if (!tickOpts.display) {\n return;\n }\n const startAngle = this.getIndexAngle(0);\n let offset, width;\n ctx.save();\n ctx.translate(this.xCenter, this.yCenter);\n ctx.rotate(startAngle);\n ctx.textAlign = 'center';\n ctx.textBaseline = 'middle';\n this.ticks.forEach((tick, index)=>{\n if (index === 0 && !opts.reverse) {\n return;\n }\n const optsAtIndex = tickOpts.setContext(this.getContext(index));\n const tickFont = toFont(optsAtIndex.font);\n offset = this.getDistanceFromCenterForValue(this.ticks[index].value);\n if (optsAtIndex.showLabelBackdrop) {\n ctx.font = tickFont.string;\n width = ctx.measureText(tick.label).width;\n ctx.fillStyle = optsAtIndex.backdropColor;\n const padding = toPadding(optsAtIndex.backdropPadding);\n ctx.fillRect(-width / 2 - padding.left, -offset - tickFont.size / 2 - padding.top, width + padding.width, tickFont.size + padding.height);\n }\n renderText(ctx, tick.label, 0, -offset, tickFont, {\n color: optsAtIndex.color,\n strokeColor: optsAtIndex.textStrokeColor,\n strokeWidth: optsAtIndex.textStrokeWidth\n });\n });\n ctx.restore();\n }\n drawTitle() {}\n}\n\nconst INTERVALS = {\n millisecond: {\n common: true,\n size: 1,\n steps: 1000\n },\n second: {\n common: true,\n size: 1000,\n steps: 60\n },\n minute: {\n common: true,\n size: 60000,\n steps: 60\n },\n hour: {\n common: true,\n size: 3600000,\n steps: 24\n },\n day: {\n common: true,\n size: 86400000,\n steps: 30\n },\n week: {\n common: false,\n size: 604800000,\n steps: 4\n },\n month: {\n common: true,\n size: 2.628e9,\n steps: 12\n },\n quarter: {\n common: false,\n size: 7.884e9,\n steps: 4\n },\n year: {\n common: true,\n size: 3.154e10\n }\n};\n const UNITS = /* #__PURE__ */ Object.keys(INTERVALS);\n function sorter(a, b) {\n return a - b;\n}\n function parse(scale, input) {\n if (isNullOrUndef(input)) {\n return null;\n }\n const adapter = scale._adapter;\n const { parser , round , isoWeekday } = scale._parseOpts;\n let value = input;\n if (typeof parser === 'function') {\n value = parser(value);\n }\n if (!isNumberFinite(value)) {\n value = typeof parser === 'string' ? adapter.parse(value, parser) : adapter.parse(value);\n }\n if (value === null) {\n return null;\n }\n if (round) {\n value = round === 'week' && (isNumber(isoWeekday) || isoWeekday === true) ? adapter.startOf(value, 'isoWeek', isoWeekday) : adapter.startOf(value, round);\n }\n return +value;\n}\n function determineUnitForAutoTicks(minUnit, min, max, capacity) {\n const ilen = UNITS.length;\n for(let i = UNITS.indexOf(minUnit); i < ilen - 1; ++i){\n const interval = INTERVALS[UNITS[i]];\n const factor = interval.steps ? interval.steps : Number.MAX_SAFE_INTEGER;\n if (interval.common && Math.ceil((max - min) / (factor * interval.size)) <= capacity) {\n return UNITS[i];\n }\n }\n return UNITS[ilen - 1];\n}\n function determineUnitForFormatting(scale, numTicks, minUnit, min, max) {\n for(let i = UNITS.length - 1; i >= UNITS.indexOf(minUnit); i--){\n const unit = UNITS[i];\n if (INTERVALS[unit].common && scale._adapter.diff(max, min, unit) >= numTicks - 1) {\n return unit;\n }\n }\n return UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n}\n function determineMajorUnit(unit) {\n for(let i = UNITS.indexOf(unit) + 1, ilen = UNITS.length; i < ilen; ++i){\n if (INTERVALS[UNITS[i]].common) {\n return UNITS[i];\n }\n }\n}\n function addTick(ticks, time, timestamps) {\n if (!timestamps) {\n ticks[time] = true;\n } else if (timestamps.length) {\n const { lo , hi } = _lookup(timestamps, time);\n const timestamp = timestamps[lo] >= time ? timestamps[lo] : timestamps[hi];\n ticks[timestamp] = true;\n }\n}\n function setMajorTicks(scale, ticks, map, majorUnit) {\n const adapter = scale._adapter;\n const first = +adapter.startOf(ticks[0].value, majorUnit);\n const last = ticks[ticks.length - 1].value;\n let major, index;\n for(major = first; major <= last; major = +adapter.add(major, 1, majorUnit)){\n index = map[major];\n if (index >= 0) {\n ticks[index].major = true;\n }\n }\n return ticks;\n}\n function ticksFromTimestamps(scale, values, majorUnit) {\n const ticks = [];\n const map = {};\n const ilen = values.length;\n let i, value;\n for(i = 0; i < ilen; ++i){\n value = values[i];\n map[value] = i;\n ticks.push({\n value,\n major: false\n });\n }\n return ilen === 0 || !majorUnit ? ticks : setMajorTicks(scale, ticks, map, majorUnit);\n}\nclass TimeScale extends Scale {\n static id = 'time';\n static defaults = {\n bounds: 'data',\n adapters: {},\n time: {\n parser: false,\n unit: false,\n round: false,\n isoWeekday: false,\n minUnit: 'millisecond',\n displayFormats: {}\n },\n ticks: {\n source: 'auto',\n callback: false,\n major: {\n enabled: false\n }\n }\n };\n constructor(props){\n super(props);\n this._cache = {\n data: [],\n labels: [],\n all: []\n };\n this._unit = 'day';\n this._majorUnit = undefined;\n this._offsets = {};\n this._normalized = false;\n this._parseOpts = undefined;\n }\n init(scaleOpts, opts = {}) {\n const time = scaleOpts.time || (scaleOpts.time = {});\n const adapter = this._adapter = new adapters._date(scaleOpts.adapters.date);\n adapter.init(opts);\n mergeIf(time.displayFormats, adapter.formats());\n this._parseOpts = {\n parser: time.parser,\n round: time.round,\n isoWeekday: time.isoWeekday\n };\n super.init(scaleOpts);\n this._normalized = opts.normalized;\n }\n parse(raw, index) {\n if (raw === undefined) {\n return null;\n }\n return parse(this, raw);\n }\n beforeLayout() {\n super.beforeLayout();\n this._cache = {\n data: [],\n labels: [],\n all: []\n };\n }\n determineDataLimits() {\n const options = this.options;\n const adapter = this._adapter;\n const unit = options.time.unit || 'day';\n let { min , max , minDefined , maxDefined } = this.getUserBounds();\n function _applyBounds(bounds) {\n if (!minDefined && !isNaN(bounds.min)) {\n min = Math.min(min, bounds.min);\n }\n if (!maxDefined && !isNaN(bounds.max)) {\n max = Math.max(max, bounds.max);\n }\n }\n if (!minDefined || !maxDefined) {\n _applyBounds(this._getLabelBounds());\n if (options.bounds !== 'ticks' || options.ticks.source !== 'labels') {\n _applyBounds(this.getMinMax(false));\n }\n }\n min = isNumberFinite(min) && !isNaN(min) ? min : +adapter.startOf(Date.now(), unit);\n max = isNumberFinite(max) && !isNaN(max) ? max : +adapter.endOf(Date.now(), unit) + 1;\n this.min = Math.min(min, max - 1);\n this.max = Math.max(min + 1, max);\n }\n _getLabelBounds() {\n const arr = this.getLabelTimestamps();\n let min = Number.POSITIVE_INFINITY;\n let max = Number.NEGATIVE_INFINITY;\n if (arr.length) {\n min = arr[0];\n max = arr[arr.length - 1];\n }\n return {\n min,\n max\n };\n }\n buildTicks() {\n const options = this.options;\n const timeOpts = options.time;\n const tickOpts = options.ticks;\n const timestamps = tickOpts.source === 'labels' ? this.getLabelTimestamps() : this._generate();\n if (options.bounds === 'ticks' && timestamps.length) {\n this.min = this._userMin || timestamps[0];\n this.max = this._userMax || timestamps[timestamps.length - 1];\n }\n const min = this.min;\n const max = this.max;\n const ticks = _filterBetween(timestamps, min, max);\n 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));\n this._majorUnit = !tickOpts.major.enabled || this._unit === 'year' ? undefined : determineMajorUnit(this._unit);\n this.initOffsets(timestamps);\n if (options.reverse) {\n ticks.reverse();\n }\n return ticksFromTimestamps(this, ticks, this._majorUnit);\n }\n afterAutoSkip() {\n if (this.options.offsetAfterAutoskip) {\n this.initOffsets(this.ticks.map((tick)=>+tick.value));\n }\n }\n initOffsets(timestamps = []) {\n let start = 0;\n let end = 0;\n let first, last;\n if (this.options.offset && timestamps.length) {\n first = this.getDecimalForValue(timestamps[0]);\n if (timestamps.length === 1) {\n start = 1 - first;\n } else {\n start = (this.getDecimalForValue(timestamps[1]) - first) / 2;\n }\n last = this.getDecimalForValue(timestamps[timestamps.length - 1]);\n if (timestamps.length === 1) {\n end = last;\n } else {\n end = (last - this.getDecimalForValue(timestamps[timestamps.length - 2])) / 2;\n }\n }\n const limit = timestamps.length < 3 ? 0.5 : 0.25;\n start = _limitValue(start, 0, limit);\n end = _limitValue(end, 0, limit);\n this._offsets = {\n start,\n end,\n factor: 1 / (start + 1 + end)\n };\n }\n _generate() {\n const adapter = this._adapter;\n const min = this.min;\n const max = this.max;\n const options = this.options;\n const timeOpts = options.time;\n const minor = timeOpts.unit || determineUnitForAutoTicks(timeOpts.minUnit, min, max, this._getLabelCapacity(min));\n const stepSize = valueOrDefault(options.ticks.stepSize, 1);\n const weekday = minor === 'week' ? timeOpts.isoWeekday : false;\n const hasWeekday = isNumber(weekday) || weekday === true;\n const ticks = {};\n let first = min;\n let time, count;\n if (hasWeekday) {\n first = +adapter.startOf(first, 'isoWeek', weekday);\n }\n first = +adapter.startOf(first, hasWeekday ? 'day' : minor);\n if (adapter.diff(max, min, minor) > 100000 * stepSize) {\n throw new Error(min + ' and ' + max + ' are too far apart with stepSize of ' + stepSize + ' ' + minor);\n }\n const timestamps = options.ticks.source === 'data' && this.getDataTimestamps();\n for(time = first, count = 0; time < max; time = +adapter.add(time, stepSize, minor), count++){\n addTick(ticks, time, timestamps);\n }\n if (time === max || options.bounds === 'ticks' || count === 1) {\n addTick(ticks, time, timestamps);\n }\n return Object.keys(ticks).sort(sorter).map((x)=>+x);\n }\n getLabelForValue(value) {\n const adapter = this._adapter;\n const timeOpts = this.options.time;\n if (timeOpts.tooltipFormat) {\n return adapter.format(value, timeOpts.tooltipFormat);\n }\n return adapter.format(value, timeOpts.displayFormats.datetime);\n }\n format(value, format) {\n const options = this.options;\n const formats = options.time.displayFormats;\n const unit = this._unit;\n const fmt = format || formats[unit];\n return this._adapter.format(value, fmt);\n }\n _tickFormatFunction(time, index, ticks, format) {\n const options = this.options;\n const formatter = options.ticks.callback;\n if (formatter) {\n return callback(formatter, [\n time,\n index,\n ticks\n ], this);\n }\n const formats = options.time.displayFormats;\n const unit = this._unit;\n const majorUnit = this._majorUnit;\n const minorFormat = unit && formats[unit];\n const majorFormat = majorUnit && formats[majorUnit];\n const tick = ticks[index];\n const major = majorUnit && majorFormat && tick && tick.major;\n return this._adapter.format(time, format || (major ? majorFormat : minorFormat));\n }\n generateTickLabels(ticks) {\n let i, ilen, tick;\n for(i = 0, ilen = ticks.length; i < ilen; ++i){\n tick = ticks[i];\n tick.label = this._tickFormatFunction(tick.value, i, ticks);\n }\n }\n getDecimalForValue(value) {\n return value === null ? NaN : (value - this.min) / (this.max - this.min);\n }\n getPixelForValue(value) {\n const offsets = this._offsets;\n const pos = this.getDecimalForValue(value);\n return this.getPixelForDecimal((offsets.start + pos) * offsets.factor);\n }\n getValueForPixel(pixel) {\n const offsets = this._offsets;\n const pos = this.getDecimalForPixel(pixel) / offsets.factor - offsets.end;\n return this.min + pos * (this.max - this.min);\n }\n _getLabelSize(label) {\n const ticksOpts = this.options.ticks;\n const tickLabelWidth = this.ctx.measureText(label).width;\n const angle = toRadians(this.isHorizontal() ? ticksOpts.maxRotation : ticksOpts.minRotation);\n const cosRotation = Math.cos(angle);\n const sinRotation = Math.sin(angle);\n const tickFontSize = this._resolveTickFontOptions(0).size;\n return {\n w: tickLabelWidth * cosRotation + tickFontSize * sinRotation,\n h: tickLabelWidth * sinRotation + tickFontSize * cosRotation\n };\n }\n _getLabelCapacity(exampleTime) {\n const timeOpts = this.options.time;\n const displayFormats = timeOpts.displayFormats;\n const format = displayFormats[timeOpts.unit] || displayFormats.millisecond;\n const exampleLabel = this._tickFormatFunction(exampleTime, 0, ticksFromTimestamps(this, [\n exampleTime\n ], this._majorUnit), format);\n const size = this._getLabelSize(exampleLabel);\n const capacity = Math.floor(this.isHorizontal() ? this.width / size.w : this.height / size.h) - 1;\n return capacity > 0 ? capacity : 1;\n }\n getDataTimestamps() {\n let timestamps = this._cache.data || [];\n let i, ilen;\n if (timestamps.length) {\n return timestamps;\n }\n const metas = this.getMatchingVisibleMetas();\n if (this._normalized && metas.length) {\n return this._cache.data = metas[0].controller.getAllParsedValues(this);\n }\n for(i = 0, ilen = metas.length; i < ilen; ++i){\n timestamps = timestamps.concat(metas[i].controller.getAllParsedValues(this));\n }\n return this._cache.data = this.normalize(timestamps);\n }\n getLabelTimestamps() {\n const timestamps = this._cache.labels || [];\n let i, ilen;\n if (timestamps.length) {\n return timestamps;\n }\n const labels = this.getLabels();\n for(i = 0, ilen = labels.length; i < ilen; ++i){\n timestamps.push(parse(this, labels[i]));\n }\n return this._cache.labels = this._normalized ? timestamps : this.normalize(timestamps);\n }\n normalize(values) {\n return _arrayUnique(values.sort(sorter));\n }\n}\n\nfunction interpolate(table, val, reverse) {\n let lo = 0;\n let hi = table.length - 1;\n let prevSource, nextSource, prevTarget, nextTarget;\n if (reverse) {\n if (val >= table[lo].pos && val <= table[hi].pos) {\n ({ lo , hi } = _lookupByKey(table, 'pos', val));\n }\n ({ pos: prevSource , time: prevTarget } = table[lo]);\n ({ pos: nextSource , time: nextTarget } = table[hi]);\n } else {\n if (val >= table[lo].time && val <= table[hi].time) {\n ({ lo , hi } = _lookupByKey(table, 'time', val));\n }\n ({ time: prevSource , pos: prevTarget } = table[lo]);\n ({ time: nextSource , pos: nextTarget } = table[hi]);\n }\n const span = nextSource - prevSource;\n return span ? prevTarget + (nextTarget - prevTarget) * (val - prevSource) / span : prevTarget;\n}\nclass TimeSeriesScale extends TimeScale {\n static id = 'timeseries';\n static defaults = TimeScale.defaults;\n constructor(props){\n super(props);\n this._table = [];\n this._minPos = undefined;\n this._tableRange = undefined;\n }\n initOffsets() {\n const timestamps = this._getTimestampsForTable();\n const table = this._table = this.buildLookupTable(timestamps);\n this._minPos = interpolate(table, this.min);\n this._tableRange = interpolate(table, this.max) - this._minPos;\n super.initOffsets(timestamps);\n }\n buildLookupTable(timestamps) {\n const { min , max } = this;\n const items = [];\n const table = [];\n let i, ilen, prev, curr, next;\n for(i = 0, ilen = timestamps.length; i < ilen; ++i){\n curr = timestamps[i];\n if (curr >= min && curr <= max) {\n items.push(curr);\n }\n }\n if (items.length < 2) {\n return [\n {\n time: min,\n pos: 0\n },\n {\n time: max,\n pos: 1\n }\n ];\n }\n for(i = 0, ilen = items.length; i < ilen; ++i){\n next = items[i + 1];\n prev = items[i - 1];\n curr = items[i];\n if (Math.round((next + prev) / 2) !== curr) {\n table.push({\n time: curr,\n pos: i / (ilen - 1)\n });\n }\n }\n return table;\n }\n _generate() {\n const min = this.min;\n const max = this.max;\n let timestamps = super.getDataTimestamps();\n if (!timestamps.includes(min) || !timestamps.length) {\n timestamps.splice(0, 0, min);\n }\n if (!timestamps.includes(max) || timestamps.length === 1) {\n timestamps.push(max);\n }\n return timestamps.sort((a, b)=>a - b);\n }\n _getTimestampsForTable() {\n let timestamps = this._cache.all || [];\n if (timestamps.length) {\n return timestamps;\n }\n const data = this.getDataTimestamps();\n const label = this.getLabelTimestamps();\n if (data.length && label.length) {\n timestamps = this.normalize(data.concat(label));\n } else {\n timestamps = data.length ? data : label;\n }\n timestamps = this._cache.all = timestamps;\n return timestamps;\n }\n getDecimalForValue(value) {\n return (interpolate(this._table, value) - this._minPos) / this._tableRange;\n }\n getValueForPixel(pixel) {\n const offsets = this._offsets;\n const decimal = this.getDecimalForPixel(pixel) / offsets.factor - offsets.end;\n return interpolate(this._table, decimal * this._tableRange + this._minPos, true);\n }\n}\n\nvar scales = /*#__PURE__*/Object.freeze({\n__proto__: null,\nCategoryScale: CategoryScale,\nLinearScale: LinearScale,\nLogarithmicScale: LogarithmicScale,\nRadialLinearScale: RadialLinearScale,\nTimeScale: TimeScale,\nTimeSeriesScale: TimeSeriesScale\n});\n\nconst registerables = [\n controllers,\n elements,\n plugins,\n scales\n];\n\nexport { Animation, Animations, ArcElement, BarController, BarElement, BasePlatform, BasicPlatform, BubbleController, CategoryScale, Chart, plugin_colors as Colors, DatasetController, plugin_decimation as Decimation, DomPlatform, DoughnutController, Element, index as Filler, Interaction, plugin_legend as Legend, LineController, LineElement, LinearScale, LogarithmicScale, PieController, PointElement, PolarAreaController, RadarController, RadialLinearScale, Scale, ScatterController, plugin_subtitle as SubTitle, Ticks, TimeScale, TimeSeriesScale, plugin_title as Title, plugin_tooltip as Tooltip, adapters as _adapters, _detectPlatform, animator, controllers, defaults, elements, layouts, plugins, registerables, registry, scales };\n//# sourceMappingURL=chart.js.map\n","import { version, isProxy, toRaw, defineComponent, ref, shallowRef, onMounted, onBeforeUnmount, watch, h } from 'vue';\nimport { Chart as Chart$1, BarController, DoughnutController, LineController, PieController, PolarAreaController, RadarController, BubbleController, ScatterController } from 'chart.js';\n\nconst CommonProps = {\n data: {\n type: Object,\n required: true\n },\n options: {\n type: Object,\n default: ()=>({})\n },\n plugins: {\n type: Array,\n default: ()=>[]\n },\n datasetIdKey: {\n type: String,\n default: \"label\"\n },\n updateMode: {\n type: String,\n default: undefined\n }\n};\nconst Props = {\n type: {\n type: String,\n required: true\n },\n ...CommonProps\n};\n\nconst compatProps = version[0] === \"2\" ? (internals, props)=>Object.assign(internals, {\n attrs: props\n }) : (internals, props)=>Object.assign(internals, props);\nfunction toRawIfProxy(obj) {\n return isProxy(obj) ? toRaw(obj) : obj;\n}\nfunction cloneProxy(obj) {\n let src = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : obj;\n return isProxy(src) ? new Proxy(obj, {}) : obj;\n}\nfunction setOptions(chart, nextOptions) {\n const options = chart.options;\n if (options && nextOptions) {\n Object.assign(options, nextOptions);\n }\n}\nfunction setLabels(currentData, nextLabels) {\n currentData.labels = nextLabels;\n}\nfunction setDatasets(currentData, nextDatasets, datasetIdKey) {\n const addedDatasets = [];\n currentData.datasets = nextDatasets.map((nextDataset)=>{\n // given the new set, find it's current match\n const currentDataset = currentData.datasets.find((dataset)=>dataset[datasetIdKey] === nextDataset[datasetIdKey]);\n // There is no original to update, so simply add new one\n if (!currentDataset || !nextDataset.data || addedDatasets.includes(currentDataset)) {\n return {\n ...nextDataset\n };\n }\n addedDatasets.push(currentDataset);\n Object.assign(currentDataset, nextDataset);\n return currentDataset;\n });\n}\nfunction cloneData(data, datasetIdKey) {\n const nextData = {\n labels: [],\n datasets: []\n };\n setLabels(nextData, data.labels);\n setDatasets(nextData, data.datasets, datasetIdKey);\n return nextData;\n}\n/**\n * Get dataset from mouse click event\n * @param chart - Chart.js instance\n * @param event - Mouse click event\n * @returns Dataset\n */ function getDatasetAtEvent(chart, event) {\n return chart.getElementsAtEventForMode(event, \"dataset\", {\n intersect: true\n }, false);\n}\n/**\n * Get single dataset element from mouse click event\n * @param chart - Chart.js instance\n * @param event - Mouse click event\n * @returns Dataset\n */ function getElementAtEvent(chart, event) {\n return chart.getElementsAtEventForMode(event, \"nearest\", {\n intersect: true\n }, false);\n}\n/**\n * Get all dataset elements from mouse click event\n * @param chart - Chart.js instance\n * @param event - Mouse click event\n * @returns Dataset\n */ function getElementsAtEvent(chart, event) {\n return chart.getElementsAtEventForMode(event, \"index\", {\n intersect: true\n }, false);\n}\n\nconst Chart = defineComponent({\n props: Props,\n setup (props, param) {\n let { expose } = param;\n const canvasRef = ref(null);\n const chartRef = shallowRef(null);\n expose({\n chart: chartRef\n });\n const renderChart = ()=>{\n if (!canvasRef.value) return;\n const { type , data , options , plugins , datasetIdKey } = props;\n const clonedData = cloneData(data, datasetIdKey);\n const proxiedData = cloneProxy(clonedData, data);\n chartRef.value = new Chart$1(canvasRef.value, {\n type,\n data: proxiedData,\n options: {\n ...options\n },\n plugins\n });\n };\n const destroyChart = ()=>{\n const chart = toRaw(chartRef.value);\n if (chart) {\n chart.destroy();\n chartRef.value = null;\n }\n };\n const update = (chart)=>{\n chart.update(props.updateMode);\n };\n onMounted(renderChart);\n onBeforeUnmount(destroyChart);\n watch([\n ()=>props.options,\n ()=>props.data\n ], (param, param1)=>{\n let [nextOptionsProxy, nextDataProxy] = param, [prevOptionsProxy, prevDataProxy] = param1;\n const chart = toRaw(chartRef.value);\n if (!chart) {\n return;\n }\n let shouldUpdate = false;\n if (nextOptionsProxy) {\n const nextOptions = toRawIfProxy(nextOptionsProxy);\n const prevOptions = toRawIfProxy(prevOptionsProxy);\n if (nextOptions && nextOptions !== prevOptions) {\n setOptions(chart, nextOptions);\n shouldUpdate = true;\n }\n }\n if (nextDataProxy) {\n const nextLabels = toRawIfProxy(nextDataProxy.labels);\n const prevLabels = toRawIfProxy(prevDataProxy.labels);\n const nextDatasets = toRawIfProxy(nextDataProxy.datasets);\n const prevDatasets = toRawIfProxy(prevDataProxy.datasets);\n if (nextLabels !== prevLabels) {\n setLabels(chart.config.data, nextLabels);\n shouldUpdate = true;\n }\n if (nextDatasets && nextDatasets !== prevDatasets) {\n setDatasets(chart.config.data, nextDatasets, props.datasetIdKey);\n shouldUpdate = true;\n }\n }\n if (shouldUpdate) {\n update(chart);\n }\n }, {\n deep: true\n });\n return ()=>{\n return h(\"canvas\", {\n ref: canvasRef\n });\n };\n }\n});\n\nfunction createTypedChart(type, registerables) {\n Chart$1.register(registerables);\n return defineComponent({\n props: CommonProps,\n setup (props, param) {\n let { expose } = param;\n const ref = shallowRef(null);\n const reforwardRef = (chartRef)=>{\n ref.value = chartRef?.chart;\n };\n expose({\n chart: ref\n });\n return ()=>{\n return h(Chart, compatProps({\n ref: reforwardRef\n }, {\n type,\n ...props\n }));\n };\n }\n });\n}\nconst Bar = /* #__PURE__ */ createTypedChart(\"bar\", BarController);\nconst Doughnut = /* #__PURE__ */ createTypedChart(\"doughnut\", DoughnutController);\nconst Line = /* #__PURE__ */ createTypedChart(\"line\", LineController);\nconst Pie = /* #__PURE__ */ createTypedChart(\"pie\", PieController);\nconst PolarArea = /* #__PURE__ */ createTypedChart(\"polarArea\", PolarAreaController);\nconst Radar = /* #__PURE__ */ createTypedChart(\"radar\", RadarController);\nconst Bubble = /* #__PURE__ */ createTypedChart(\"bubble\", BubbleController);\nconst Scatter = /* #__PURE__ */ createTypedChart(\"scatter\", ScatterController);\n\nexport { Bar, Bubble, Chart, Doughnut, Line, Pie, PolarArea, Radar, Scatter, createTypedChart, getDatasetAtEvent, getElementAtEvent, getElementsAtEvent };\n//# sourceMappingURL=index.js.map\n"],"names":["round","v","lim","l","h","Math","max","min","p2b","n2b","b2n","n2p","map$1","A","B","C","D","E","F","a","b","c","d","e","f","hex","h1","h2","eq","isShort","r","g","hexParse","str","ret","len","length","alpha","hexString","undefined","HUE_RE","hsl2rgbn","s","n","k","hsv2rgbn","hwb2rgbn","w","rgb","i","hueValue","rgb2hsl","range","calln","Array","isArray","map","hsl2rgb","hwb2rgb","hsv2rgb","hue","hueParse","m","exec","p1","p2","rotate","deg","hslString","x","Z","Y","X","W","V","U","T","S","R","Q","P","O","N","M","L","K","G","H","I","J","names$1","OiceXe","antiquewEte","aqua","aquamarRe","azuY","beige","bisque","black","blanKedOmond","Xe","XeviTet","bPwn","burlywood","caMtXe","KartYuse","KocTate","cSO","cSnflowerXe","cSnsilk","crimson","cyan","xXe","xcyan","xgTMnPd","xWay","xgYF","xgYy","xkhaki","xmagFta","xTivegYF","xSange","xScEd","xYd","xsOmon","xsHgYF","xUXe","xUWay","xUgYy","xQe","xviTet","dAppRk","dApskyXe","dimWay","dimgYy","dodgerXe","fiYbrick","flSOwEte","foYstWAn","fuKsia","gaRsbSo","ghostwEte","gTd","gTMnPd","Way","gYF","gYFLw","gYy","honeyMw","hotpRk","RdianYd","Rdigo","ivSy","khaki","lavFMr","lavFMrXsh","lawngYF","NmoncEffon","ZXe","ZcSO","Zcyan","ZgTMnPdLw","ZWay","ZgYF","ZgYy","ZpRk","ZsOmon","ZsHgYF","ZskyXe","ZUWay","ZUgYy","ZstAlXe","ZLw","lime","limegYF","lRF","magFta","maPon","VaquamarRe","VXe","VScEd","VpurpN","VsHgYF","VUXe","VsprRggYF","VQe","VviTetYd","midnightXe","mRtcYam","mistyPse","moccasR","navajowEte","navy","Tdlace","Tive","TivedBb","Sange","SangeYd","ScEd","pOegTMnPd","pOegYF","pOeQe","pOeviTetYd","papayawEp","pHKpuff","peru","pRk","plum","powMrXe","purpN","YbeccapurpN","Yd","Psybrown","PyOXe","saddNbPwn","sOmon","sandybPwn","sHgYF","sHshell","siFna","silver","skyXe","UXe","UWay","UgYy","snow","sprRggYF","stAlXe","tan","teO","tEstN","tomato","Qe","viTet","JHt","wEte","wEtesmoke","Lw","LwgYF","unpack","unpacked","keys","Object","tkeys","j","ok","nk","replace","parseInt","names","nameParse","transparent","toLowerCase","RGB_RE","rgbParse","rgbString","to","pow","from","interpolate","rgb1","rgb2","t","modHSL","ratio","tmp","clone","proto","assign","fromObject","input","functionParse","charAt","Color","constructor","type","this","_rgb","_valid","valid","obj","mix","color","weight","c1","c2","w2","p","w1","clearer","greyscale","val","opaquer","negate","lighten","darken","saturate","desaturate","noop","uid","id","isNullOrUndef","value","prototype","toString","call","slice","isObject","isNumberFinite","Number","isFinite","finiteOrDefault","defaultValue","valueOrDefault","toPercentage","dimension","endsWith","parseFloat","toDimension","callback","fn","args","thisArg","apply","each","loopable","reverse","_elementsEqual","a0","a1","ilen","v0","v1","datasetIndex","index","source","target","create","klen","isValidKey","key","indexOf","_merger","options","tval","sval","merge","sources","merger","current","mergeIf","_mergerIf","hasOwnProperty","keyResolvers","o","y","_splitKey","parts","split","part","push","_getKeyResolver","resolveObjectKey","resolver","_capitalize","toUpperCase","defined","isFunction","setsEqual","size","item","has","_isClickEvent","PI","TAU","INFINITY","POSITIVE_INFINITY","RAD_PER_DEG","HALF_PI","QUARTER_PI","TWO_THIRDS_PI","log10","sign","almostEquals","epsilon","abs","niceNum","roundedRange","niceRange","floor","fraction","niceFraction","_factorize","result","sqrt","sort","pop","isNumber","isNaN","almostWhole","rounded","_setMinAndMaxByKey","array","property","toRadians","degrees","toDegrees","radians","_decimalPlaces","getAngleFromPoint","centrePoint","anglePoint","distanceFromXCenter","distanceFromYCenter","radialDistanceFromCenter","angle","atan2","distance","distanceBetweenPoints","pt1","pt2","_normalizeAngle","_angleBetween","start","end","sameAngleIsFullCircle","angleToStart","angleToEnd","startToAngle","endToAngle","_limitValue","_int16Range","_isBetween","_lookup","table","cmp","mid","hi","lo","_lookupByKey","last","ti","_rlookupByKey","_filterBetween","values","arrayEvents","listenArrayEvents","listener","_chartjs","listeners","defineProperty","configurable","enumerable","forEach","method","base","res","object","unlistenArrayEvents","stub","splice","_arrayUnique","items","set","Set","requestAnimFrame","window","requestAnimationFrame","throttled","argsToUse","ticking","debounce","delay","timeout","clearTimeout","setTimeout","_toLeftRightCenter","align","_alignStartEnd","atEdge","elasticIn","sin","elasticOut","effects","linear","easeInQuad","easeOutQuad","easeInOutQuad","easeInCubic","easeOutCubic","easeInOutCubic","easeInQuart","easeOutQuart","easeInOutQuart","easeInQuint","easeOutQuint","easeInOutQuint","easeInSine","cos","easeOutSine","easeInOutSine","easeInExpo","easeOutExpo","easeInOutExpo","easeInCirc","easeOutCirc","easeInOutCirc","easeInElastic","easeOutElastic","easeInOutElastic","easeInBack","easeOutBack","easeInOutBack","easeInBounce","easeOutBounce","easeInOutBounce","isPatternOrGradient","getHoverColor","numbers","colors","applyAnimationsDefaults","defaults","duration","easing","loop","describe","_fallback","_indexable","_scriptable","name","properties","active","animation","resize","show","animations","visible","hide","applyLayoutsDefaults","autoPadding","padding","top","right","bottom","left","intlCache","Map","getNumberFormat","locale","cacheKey","JSON","stringify","formatter","get","Intl","NumberFormat","formatNumber","num","format","formatters","numeric","tickValue","ticks","chart","notation","delta","maxTick","calculateDelta","logDelta","numDecimal","minimumFractionDigits","maximumFractionDigits","logarithmic","remain","significand","includes","Ticks","applyScaleDefaults","display","offset","beginAtZero","bounds","clip","grace","grid","lineWidth","drawOnChartArea","drawTicks","tickLength","tickWidth","_ctx","tickColor","border","dash","dashOffset","width","title","text","minRotation","maxRotation","mirror","textStrokeWidth","textStrokeColor","autoSkip","autoSkipPadding","labelOffset","minor","major","crossAlign","showLabelBackdrop","backdropColor","backdropPadding","route","startsWith","overrides","descriptors","getScope$1","node","root","scope","Defaults","_descriptors","_appliers","backgroundColor","borderColor","datasets","devicePixelRatio","context","platform","getDevicePixelRatio","elements","events","font","family","style","lineHeight","hover","hoverBackgroundColor","ctx","hoverBorderColor","hoverColor","indexAxis","interaction","mode","intersect","includeInvisible","maintainAspectRatio","onHover","onClick","parsing","plugins","responsive","scale","scales","showLine","drawActiveElementsOnTop","override","targetScope","targetName","scopeObject","targetScopeObject","privateName","defineProperties","writable","local","appliers","toFontString","_measureText","data","gc","longest","string","textWidth","measureText","_alignPixel","pixel","currentDevicePixelRatio","halfWidth","clearCanvas","canvas","getContext","save","resetTransform","clearRect","height","restore","drawPoint","drawPointLegend","xOffset","yOffset","cornerRadius","xOffsetW","yOffsetW","pointStyle","rotation","radius","rad","translate","drawImage","beginPath","ellipse","arc","closePath","moveTo","lineTo","SQRT1_2","rect","fill","borderWidth","stroke","_isPointInArea","point","area","margin","clipArea","unclipArea","setRenderOpts","opts","translation","fillStyle","textAlign","textBaseline","decorateText","line","strikethrough","underline","metrics","actualBoundingBoxLeft","actualBoundingBoxRight","actualBoundingBoxAscent","actualBoundingBoxDescent","yDecoration","strokeStyle","decorationWidth","drawBackdrop","oldColor","fillRect","renderText","lines","strokeWidth","strokeColor","backdrop","strokeText","maxWidth","fillText","addRoundedRectPath","topLeft","bottomLeft","bottomRight","topRight","LINE_HEIGHT","FONT_STYLE","toLineHeight","matches","match","numberOrZero","_readValueToProps","props","objProps","read","prop","toTRBL","toTRBLCorners","toPadding","toFont","fallback","console","warn","resolve","inputs","info","cacheable","_addGrace","minmax","change","keepZero","add","createContext","parentContext","_createResolver","scopes","prefixes","rootScopes","getTarget","finalRootScopes","_resolve","cache","Symbol","toStringTag","_cacheable","_scopes","_rootScopes","_getTarget","Proxy","deleteProperty","_keys","_cached","_resolveWithPrefixes","getOwnPropertyDescriptor","Reflect","getPrototypeOf","getKeysFromAllScopes","ownKeys","storage","_storage","_attachContext","proxy","subProxy","descriptorDefaults","_proxy","_context","_subProxy","_stack","setContext","receiver","_resolveWithContext","allKeys","scriptable","indexable","_allKeys","isScriptable","isIndexable","readKey","prefix","needsSubResolver","_resolveScriptable","_resolveArray","getValue","Error","join","delete","createSubResolver","arr","filter","resolveFallback","getScope","parent","addScopes","parentScopes","parentFallback","allScopes","addScopesFromKey","subGetTarget","resolveKeysFromAllScopes","_parseObjectDataRadialScale","meta","count","iScale","_parsing","parsed","parse","EPSILON","_isDomSupported","document","_getParentNode","domNode","parentNode","host","parseMaxStyle","styleValue","parentProperty","valueInPixels","getComputedStyle","element","ownerDocument","defaultView","getStyle","el","getPropertyValue","positions","getPositionedStyle","styles","suffix","pos","useOffsetPos","shadowRoot","getCanvasPosition","touches","offsetX","offsetY","box","getBoundingClientRect","clientX","clientY","getRelativePosition","event","borderBox","boxSizing","paddings","borders","getContainerSize","maxHeight","container","containerStyle","containerBorder","containerPadding","clientWidth","clientHeight","round1","getMaximumSize","bbWidth","bbHeight","aspectRatio","margins","containerSize","maintainHeight","retinaScale","forceRatio","forceStyle","pixelRatio","deviceHeight","deviceWidth","setTransform","supportsEventListenerOptions","passiveSupported","passive","addEventListener","removeEventListener","readUsedSize","getRightToLeftAdapter","rectX","setWidth","xPlus","leftForLtr","itemWidth","getLeftToRightAdapter","_itemWidth","getRtlAdapter","rtl","overrideTextDirection","direction","original","getPropertyPriority","setProperty","prevTextDirection","restoreTextDirection","Animator","_request","_charts","_running","_lastDate","_notify","anims","date","callbacks","numSteps","initial","currentStep","_refresh","_update","Date","now","remaining","running","draw","_active","_total","tick","_getAnims","charts","complete","progress","listen","cb","reduce","acc","cur","_duration","stop","cancel","remove","animator","interpolators","boolean","factor","c0","number","Animation","cfg","currentValue","_fn","_easing","_start","_loop","_target","_prop","_from","_to","_promises","update","elapsed","wait","promises","Promise","rej","resolved","Animations","config","_chart","_properties","configure","animationOptions","animatedProps","getOwnPropertyNames","option","_animateOptions","newOptions","resolveTargetOptions","_createAnimations","$shared","awaitAll","$animations","then","anim","all","scaleClip","allowedOverflow","defaultClip","xScale","yScale","toClip","disabled","getSortedDatasetIndices","filterVisible","metasets","_getSortedDatasetMetas","applyStack","stack","dsIndex","singleMode","otherValue","convertObjectDataToArray","adata","isStacked","stacked","getStackKey","indexScale","valueScale","getUserBounds","minDefined","maxDefined","NEGATIVE_INFINITY","getOrCreateStack","stacks","stackKey","indexValue","subStack","getLastIndexInStack","vScale","positive","getMatchingVisibleMetas","updateStacks","controller","_cachedMeta","_stacks","iAxis","axis","vAxis","itemStacks","_top","_bottom","visualValues","_visualValues","getFirstScaleId","shift","createDatasetContext","dataset","createDataContext","dataIndex","raw","clearStacks","_parsed","isDirectUpdateMode","cloneIfNotShared","cached","shared","createStack","canStack","hidden","_stacked","DatasetController","static","_cachedDataOpts","getMeta","_type","_data","_objectData","_sharedOptions","_drawStart","_drawCount","enableOptionSharing","supportsDecimation","$context","_syncList","datasetElementType","dataElementType","initialize","linkScales","addElements","isPluginEnabled","updateIndex","getDataset","chooseId","xid","xAxisID","yid","yAxisID","rid","rAxisID","iid","iAxisID","vid","vAxisID","getScaleForId","rScale","getDatasetMeta","scaleID","_getOtherScale","reset","_destroy","_dataCheck","isExtensible","buildOrUpdateElements","resetNewElements","stackChanged","oldStacked","_resyncElements","scopeKeys","datasetScopeKeys","getOptionScopes","createResolver","sorted","_sorted","prev","parseArrayData","parseObjectData","parsePrimitiveData","isNotInOrderComparedToPrev","labels","getLabels","singleScale","xAxisKey","yAxisKey","getParsed","getDataElement","updateRangeFromParsed","parsedValue","NaN","getMinMax","otherScale","otherMin","otherMax","_skip","getAllParsedValues","getMaxOverflow","getLabelAndValue","label","getLabelForValue","_clip","chartArea","resolveDatasetElementOptions","resolveDataElementOptions","_resolveElementOptions","elementType","sharing","datasetElementScopeKeys","resolveNamedOptions","freeze","_resolveAnimations","transition","datasetAnimationScopeKeys","getSharedOptions","includeOptions","sharedOptions","_animationsDisabled","_getSharedOptions","firstOpts","previouslySharedOptions","updateSharedOptions","updateElement","_setStyle","removeHoverStyle","setHoverStyle","_removeDatasetHoverStyle","_setDatasetHoverStyle","arg1","arg2","numMeta","numData","_insertElements","_removeElements","move","updateElements","removed","_sync","_dataChanges","_onDataPush","arguments","_onDataPop","_onDataShift","_onDataSplice","newCount","_onDataUnshift","getAllScaleValues","_cache","$bar","visibleMetas","concat","computeMinSampleSize","curr","_length","updateMinAndPrev","getPixelForValue","getPixelForTick","computeFitCategoryTraits","ruler","stackCount","thickness","barThickness","categoryPercentage","barPercentage","chunk","pixels","computeFlexCategoryTraits","next","percent","parseFloatBar","entry","startValue","endValue","barStart","barEnd","_custom","parseValue","parseArrayOrPrimitive","isFloatBar","custom","barSign","actualBase","isHorizontal","borderProps","horizontal","setBorderSkipped","edge","borderSkipped","enableBorderRadius","parseEdge","swap","startEnd","orig","v2","setInflateAmount","inflateAmount","BarController","grouped","_index_","_value_","iAxisKey","vAxisKey","super","bars","getBasePixel","_getRuler","vpixels","head","_calculateBarValuePixels","ipixels","_calculateBarIndexPixels","center","_getStacks","skipNull","_getStackCount","_getStackIndex","_startPixel","_endPixel","baseValue","minBarLength","floating","getDataVisibility","startPixel","getPixelForDecimal","endPixel","getValueForPixel","halfGrid","getLineWidthForValue","maxBarThickness","Infinity","stackIndex","rects","getRatioAndOffset","circumference","cutout","ratioX","ratioY","startAngle","endAngle","startX","startY","endX","endY","calcMax","calcMin","maxX","maxY","minX","minY","DoughnutController","animateRotate","animateScale","spacing","legend","generateLabels","fontColor","legendItem","toggleDataVisibility","innerRadius","outerRadius","getter","_getRotation","_getCircumference","_getRotationExtents","isDatasetVisible","arcs","getMaxBorderWidth","getMaxOffset","maxSize","chartWeight","_getRingWeight","maxRadius","radiusLength","_getVisibleDatasetWeightTotal","total","calculateTotal","_getRingWeightOffset","_circumference","calculateCircumference","animationOpts","centerX","centerY","metaData","borderAlign","hoverBorderWidth","hoverOffset","ringWeightOffset","PolarAreaController","angleLines","circular","pointLabels","bind","_updateRadius","minSize","cutoutPercentage","getVisibleDatasetCount","xCenter","yCenter","datasetStartAngle","getIndexAngle","defaultAngle","countVisibleElements","_computeAngle","getDistanceFromCenterForValue","PieController","DateAdapterBase","members","init","formats","diff","startOf","endOf","adapters","_date","binarySearch","metaset","lookupMethod","_reversePixels","getRange","evaluateInteractionItems","position","handler","getSortedVisibleDatasetMetas","skip","getDistanceMetricForAxis","useX","useY","deltaX","deltaY","getIntersectItems","useFinalPosition","isPointInArea","evaluationFunc","inRange","getNearestRadialItems","getProps","getNearestCartesianItems","distanceMetric","minDistance","getCenterPoint","pointInArea","getNearestItems","getAxisItems","rangeMethod","intersectsItem","Interaction","modes","nearest","STATIC_POSITIONS","filterByPosition","filterDynamicPositionByAxis","sortByWeight","wrapBoxes","boxes","layoutBoxes","stackWeight","buildStacks","layouts","wrap","placed","setLayoutDims","params","vBoxMaxWidth","hBoxMaxHeight","layout","fullSize","availableWidth","availableHeight","buildLayoutBoxes","centerHorizontal","centerVertical","leftAndTop","rightAndBottom","vertical","getCombinedMax","maxPadding","updateMaxPadding","boxPadding","updateDims","getPadding","newWidth","outerWidth","newHeight","outerHeight","widthChanged","heightChanged","same","other","handleMaxPadding","updatePos","getMargins","marginForPositions","fitBoxes","refitBoxes","refit","changed","setBoxDims","placeBoxes","userPadding","addBox","_layers","z","removeBox","layoutItem","minPadding","verticalBoxes","horizontalBoxes","beforeLayout","visibleVerticalBoxCount","BasePlatform","acquireContext","releaseContext","isAttached","updateConfig","BasicPlatform","EXPANDO_KEY","EVENT_TYPES","touchstart","touchmove","touchend","pointerenter","pointerdown","pointermove","pointerup","pointerleave","pointerout","isNullOrEmpty","initCanvas","renderHeight","getAttribute","renderWidth","displayWidth","displayHeight","eventListenerOptions","addListener","removeListener","fromNativeEvent","native","nodeListContains","nodeList","contains","createAttachObserver","observer","MutationObserver","entries","trigger","addedNodes","removedNodes","observe","childList","subtree","createDetachObserver","drpListeningCharts","oldDevicePixelRatio","onWindowResize","dpr","listenDevicePixelRatioChanges","unlistenDevicePixelRatioChanges","createResizeObserver","ResizeObserver","contentRect","releaseObserver","disconnect","createProxyAndListen","DomPlatform","removeAttribute","setAttribute","proxies","$proxies","handlers","attach","detach","isConnected","_detectPlatform","OffscreenCanvas","Element","tooltipPosition","hasValue","final","tickOpts","determinedMaxTicks","determineMaxTicks","ticksLimit","maxTicksLimit","majorIndices","enabled","getMajorIndices","numMajorIndices","first","newTicks","skipMajors","calculateSpacing","avgMajorSpacing","_tickSize","maxScale","maxChart","_maxLength","evenMajorSpacing","getEvenSpacing","factors","ceil","majorStart","majorEnd","reverseAlign","offsetFromEdge","getTicksLimit","ticksLength","sample","numItems","increment","getPixelForGridLine","offsetGridLines","validIndex","lineValue","garbageCollect","caches","gcLen","getTickMarkLength","getTitleHeight","createScaleContext","createTickContext","titleAlign","titleArgs","titleX","titleY","positionAxisID","Scale","_margins","paddingTop","paddingBottom","paddingLeft","paddingRight","labelRotation","_range","_gridLineItems","_labelItems","_labelSizes","_longestTextCache","_userMax","_userMin","_suggestedMax","_suggestedMin","_ticksLength","_borderValue","_dataLimitsCached","suggestedMin","suggestedMax","metas","getTicks","xLabels","yLabels","getLabelItems","_computeLabelItems","beforeUpdate","sampleSize","beforeSetDimensions","setDimensions","afterSetDimensions","beforeDataLimits","determineDataLimits","afterDataLimits","beforeBuildTicks","buildTicks","afterBuildTicks","samplingEnabled","_convertTicksToLabels","beforeCalculateLabelRotation","calculateLabelRotation","afterCalculateLabelRotation","afterAutoSkip","beforeFit","fit","afterFit","afterUpdate","reversePixels","_alignToPixels","alignToPixels","_callHooks","notifyPlugins","beforeTickToLabelConversion","generateTickLabels","afterTickToLabelConversion","numTicks","maxLabelDiagonal","_isVisible","labelSizes","_getLabelSizes","maxLabelWidth","widest","maxLabelHeight","highest","asin","titleOpts","gridOpts","titleHeight","tickPadding","angleRadians","labelHeight","labelWidth","_calculatePadding","_handleMargins","isRotated","labelsBelowTicks","offsetLeft","offsetRight","isFullSize","_computeLabelSizes","widths","heights","jlen","tickFont","fontString","nestedLabel","widestLabelSize","highestLabelSize","_resolveTickFontOptions","valueAt","idx","decimal","getDecimalForPixel","getBaseValue","optionTicks","rot","_computeGridLineItems","tl","borderOpts","axisWidth","axisHalfWidth","alignBorderValue","borderValue","alignedLineValue","tx1","ty1","tx2","ty2","x1","y1","x2","y2","limit","step","optsAtIndex","optsAtIndexBorder","lineColor","borderDash","borderDashOffset","tickBorderDash","tickBorderDashOffset","tickAndPadding","hTickAndPadding","lineCount","textOffset","_getXAxisLabelAlignment","_getYAxisLabelAlignment","halfCount","tickTextAlign","labelPadding","_computeLabelArea","drawBackground","findIndex","drawGrid","drawLine","setLineDash","lineDashOffset","drawBorder","lastLineWidth","drawLabels","renderTextOptions","drawTitle","tz","gz","bz","axisID","_maxDigits","fontSize","TypedRegistry","isForType","isPrototypeOf","register","parentScope","isIChartComponent","registerDefaults","unregister","itemDefaults","defaultRoutes","routeDefaults","routes","propertyParts","sourceName","sourceScope","Registry","controllers","_typedRegistries","_each","addControllers","addPlugins","addScales","getController","_get","getElement","getPlugin","getScale","removeControllers","removeElements","removePlugins","removeScales","typedRegistry","arg","reg","_getRegistryForType","_exec","itemReg","registry","component","camelMethod","PluginService","_init","notify","hook","_createDescriptors","descriptor","plugin","cancelable","invalidate","_oldCache","_notifyStateChanges","allPlugins","createDescriptors","previousDescriptors","some","localIds","getOpts","pluginOpts","pluginScopeKeys","getIndexAxis","datasetDefaults","datasetOptions","getAxisFromDefaultScaleID","getDefaultScaleIDFromAxis","idMatchesAxis","axisFromPosition","determineAxis","scaleOptions","getAxisFromDataset","retrieveAxisFromDatasets","boundDs","mergeScaleConfig","chartDefaults","configScales","chartIndexAxis","scaleConf","error","defaultId","defaultScaleOptions","defaultID","initOptions","initData","initConfig","keyCache","keysCached","cachedKeys","generate","addIfFound","Config","_config","_scopeCache","_resolverCache","clearCache","clear","datasetType","additionalOptionScopes","_cachedScopes","mainScope","resetCache","keyLists","chartOptionScopes","subPrefixes","getResolver","needContext","subResolver","resolverCache","hasFunction","version","KNOWN_POSITIONS","positionIsHorizontal","compare2Level","l1","l2","onAnimationsComplete","onComplete","onAnimationProgress","onProgress","getCanvas","getElementById","instances","getChart","moveNumericKeys","intKey","determineLastEvent","lastEvent","inChartArea","isClick","getSizeForArea","field","getDatasetArea","Chart","invalidatePlugins","userConfig","initialCanvas","existingChart","_options","_aspectRatio","_metasets","_lastEvent","_listeners","_responsiveListeners","_sortedMetasets","_plugins","_hiddenIndices","attached","_doResize","resizeDelay","_initialize","bindEvents","_resizeBeforeDraw","_resize","newSize","newRatio","onResize","render","ensureScalesHaveIDs","scalesOptions","axisOptions","buildOrUpdateScales","scaleOpts","updated","isRadial","dposition","dtype","scaleType","scaleClass","hasUpdated","_updateMetasets","_destroyDatasetMeta","_removeUnreferencedMetasets","_dataset","buildOrUpdateControllers","newControllers","order","ControllerClass","_resetElements","animsDisabled","_updateScales","_checkEventBindings","_updateHiddenIndices","_minPadding","_updateLayout","_updateDatasets","_eventHandler","_updateHoverStyles","existingEvents","newEvents","unbindEvents","changes","_getUniformDataChanges","datasetCount","makeSet","changeSet","noArea","_idx","_updateDataset","layers","_drawDatasets","_drawDataset","useClip","getElementsAtEventForMode","setDatasetVisibility","_updateVisibility","_stop","destroy","toBase64Image","toDataURL","bindUserEvents","bindResponsiveEvents","_add","_remove","detached","updateHoverStyle","getActiveElements","setActiveElements","activeElements","lastActive","pluginId","replay","hoverOptions","deactivated","activated","eventFilter","_handleEvent","_getActiveElements","clipArc","pixelMargin","angleMargin","toRadiusCorners","parseBorderRadius$1","angleDelta","borderRadius","halfThickness","innerLimit","computeOuterLimit","outerArcLimit","outerStart","outerEnd","innerStart","innerEnd","rThetaToXY","theta","pathArc","innerR","spacingOffset","noSpacingInnerRadius","noSpacingOuterRadius","avNogSpacingRadius","adjustedAngle","beta","angleOffset","outerStartAdjustedRadius","outerEndAdjustedRadius","outerStartAdjustedAngle","outerEndAdjustedAngle","innerStartAdjustedRadius","innerEndAdjustedRadius","innerStartAdjustedAngle","innerEndAdjustedAngle","outerMidAdjustedAngle","pCenter","p4","innerMidAdjustedAngle","p8","outerStartX","outerStartY","outerEndX","outerEndY","drawArc","fullCircles","borderJoinStyle","inner","lineJoin","ArcElement","chartX","chartY","rAdjust","betweenAngles","withinRadius","halfAngle","halfRadius","fix","radiusOffset","getBarBounds","bar","half","skipOrLimit","parseBorderWidth","maxW","maxH","parseBorderRadius","maxR","enableBorder","boundingRects","outer","skipX","skipY","skipBoth","hasRadius","addNormalRectPath","inflateRect","amount","refRect","BarElement","addRectPath","mouseX","mouseY","inXRange","inYRange","BORDER_COLORS","BACKGROUND_COLORS","getBorderColor","getBackgroundColor","colorizeDefaultDataset","colorizeDoughnutDataset","colorizePolarAreaDataset","getColorizer","containsColorsDefinitions","containsColorsDefinition","plugin_colors","forceOverride","_args","chartOptions","colorizer","Title","_padding","textSize","_drawArgs","fontOpts","createTitle","titleBlock","plugin_title","_element","WeakMap","positioners","average","eventPosition","nearestElement","tp","pushOrConcat","toPush","splitNewlines","String","createTooltipItem","formattedValue","getTooltipSize","tooltip","body","footer","boxWidth","boxHeight","bodyFont","titleFont","footerFont","titleLineCount","footerLineCount","bodyLineItemCount","combinedBodyLength","bodyItem","before","after","beforeBody","afterBody","titleSpacing","titleMarginBottom","bodyLineHeight","displayColors","bodySpacing","footerMarginTop","footerSpacing","widthPadding","maxLineWidth","determineYAlign","doesNotFitWithAlign","xAlign","caret","caretSize","caretPadding","determineXAlign","yAlign","chartWidth","determineAlignment","alignX","alignY","paddingAndSize","getBackgroundPoint","alignment","getAlignedX","getBeforeAfterBodyLines","createTooltipContext","tooltipItems","overrideCallbacks","defaultCallbacks","beforeTitle","labelCount","afterTitle","beforeLabel","tooltipItem","labelColor","labelTextColor","bodyColor","labelPointStyle","afterLabel","beforeFooter","afterFooter","invokeCallbackWithFallback","Tooltip","opacity","_eventPosition","_size","_cachedAnimations","_tooltipItems","dataPoints","caretX","caretY","labelColors","labelPointStyles","labelTextColors","getTitle","getBeforeBody","getBody","bodyItems","scoped","getAfterBody","getFooter","_createItems","itemSort","positionAndSize","backgroundPoint","external","drawCaret","tooltipPoint","caretPosition","getCaretPosition","x3","y3","ptX","ptY","pt","rtlHelper","titleColor","_drawColorBox","colorX","rtlColorX","yOffSet","colorY","usePointStyle","drawOptions","multiKeyBackground","outerX","innerX","strokeRect","drawBody","bodyAlign","xLinePadding","fillLineOfText","bodyAlignForCalculation","textColor","drawFooter","footerAlign","footerColor","tooltipSize","quadraticCurveTo","_updateAnimationTarget","animX","animY","_willRender","hasTooltipContent","globalAlpha","textDirection","positionChanged","_positionChanged","_ignoreReplayEvents","handleEvent","plugin_tooltip","afterInit","afterDraw","afterEvent","addIfString","addedLabels","unshift","findOrAddLabel","lastIndexOf","_getLabelForValue","CategoryScale","_startValue","_valueRange","_addedLabels","added","generateTicks$1","generationOptions","dataRange","MIN_SPACING","precision","maxTicks","maxDigits","includeBounds","unit","maxSpaces","rmin","rmax","countDefined","minSpacing","niceMin","niceMax","numSpaces","decimalPlaces","relativeLabelSize","LinearScaleBase","_endValue","handleTickRangeOptions","setMin","setMax","minSign","maxSign","getTickLimit","stepSize","computeTickLimit","numericGeneratorOptions","LinearScale","INTERVALS","millisecond","common","steps","second","minute","hour","day","week","month","quarter","year","UNITS","sorter","adapter","_adapter","parser","isoWeekday","_parseOpts","determineUnitForAutoTicks","minUnit","capacity","interval","MAX_SAFE_INTEGER","determineUnitForFormatting","determineMajorUnit","addTick","time","timestamps","timestamp","setMajorTicks","majorUnit","ticksFromTimestamps","TimeScale","displayFormats","_unit","_majorUnit","_offsets","_normalized","normalized","_applyBounds","_getLabelBounds","getLabelTimestamps","timeOpts","_generate","_getLabelCapacity","initOffsets","offsetAfterAutoskip","getDecimalForValue","weekday","hasWeekday","getDataTimestamps","tooltipFormat","datetime","fmt","_tickFormatFunction","minorFormat","majorFormat","offsets","_getLabelSize","ticksOpts","tickLabelWidth","cosRotation","sinRotation","tickFontSize","exampleTime","exampleLabel","normalize","CommonProps","required","default","datasetIdKey","updateMode","Props","compatProps","internals","attrs","toRawIfProxy","cloneProxy","src","setOptions","nextOptions","setLabels","currentData","nextLabels","setDatasets","nextDatasets","addedDatasets","nextDataset","currentDataset","find","cloneData","nextData","setup","param","expose","canvasRef","chartRef","renderChart","clonedData","proxiedData","destroyChart","param1","nextOptionsProxy","nextDataProxy","prevOptionsProxy","prevDataProxy","shouldUpdate","prevOptions","prevLabels","prevDatasets","deep","ref","createTypedChart","registerables","reforwardRef","Bar","Pie"],"sourceRoot":""} \ No newline at end of file diff --git a/js/2005.3b769dc8.js.map b/js/2005.3b769dc8.js.map deleted file mode 100644 index ef44233cd..000000000 --- a/js/2005.3b769dc8.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"js/2005.3b769dc8.js","mappings":";;;;;;;AAMA,SAASA,EAAMC,GACb,OAAOA,EAAI,GAAM,CACnB,C,kQACA,MAAMC,EAAM,CAACD,EAAGE,EAAGC,IAAMC,KAAKC,IAAID,KAAKE,IAAIN,EAAGG,G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GACN,CACC1iE,UACGke,IAGf,GAER,CACA,MAAMykD,EAAsBH,EAAiB,MAAO,MAG9CI,EAAsBJ,EAAiB,MAAO,K","sources":["webpack://@radiantearth/stac-browser/./node_modules/@kurkle/color/dist/color.esm.js","webpack://@radiantearth/stac-browser/./node_modules/chart.js/dist/chunks/helpers.segment.js","webpack://@radiantearth/stac-browser/./node_modules/chart.js/dist/chart.js","webpack://@radiantearth/stac-browser/./node_modules/vue-chartjs/dist/index.js"],"sourcesContent":["/*!\n * @kurkle/color v0.3.2\n * https://github.com/kurkle/color#readme\n * (c) 2023 Jukka Kurkela\n * Released under the MIT License\n */\nfunction round(v) {\n return v + 0.5 | 0;\n}\nconst lim = (v, l, h) => Math.max(Math.min(v, h), l);\nfunction p2b(v) {\n return lim(round(v * 2.55), 0, 255);\n}\nfunction b2p(v) {\n return lim(round(v / 2.55), 0, 100);\n}\nfunction n2b(v) {\n return lim(round(v * 255), 0, 255);\n}\nfunction b2n(v) {\n return lim(round(v / 2.55) / 100, 0, 1);\n}\nfunction n2p(v) {\n return lim(round(v * 100), 0, 100);\n}\n\nconst 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};\nconst hex = [...'0123456789ABCDEF'];\nconst h1 = b => hex[b & 0xF];\nconst h2 = b => hex[(b & 0xF0) >> 4] + hex[b & 0xF];\nconst eq = b => ((b & 0xF0) >> 4) === (b & 0xF);\nconst isShort = v => eq(v.r) && eq(v.g) && eq(v.b) && eq(v.a);\nfunction hexParse(str) {\n var len = str.length;\n var ret;\n if (str[0] === '#') {\n if (len === 4 || len === 5) {\n ret = {\n r: 255 & map$1[str[1]] * 17,\n g: 255 & map$1[str[2]] * 17,\n b: 255 & map$1[str[3]] * 17,\n a: len === 5 ? map$1[str[4]] * 17 : 255\n };\n } else if (len === 7 || len === 9) {\n ret = {\n r: map$1[str[1]] << 4 | map$1[str[2]],\n g: map$1[str[3]] << 4 | map$1[str[4]],\n b: map$1[str[5]] << 4 | map$1[str[6]],\n a: len === 9 ? (map$1[str[7]] << 4 | map$1[str[8]]) : 255\n };\n }\n }\n return ret;\n}\nconst alpha = (a, f) => a < 255 ? f(a) : '';\nfunction hexString(v) {\n var f = isShort(v) ? h1 : h2;\n return v\n ? '#' + f(v.r) + f(v.g) + f(v.b) + alpha(v.a, f)\n : undefined;\n}\n\nconst HUE_RE = /^(hsla?|hwb|hsv)\\(\\s*([-+.e\\d]+)(?:deg)?[\\s,]+([-+.e\\d]+)%[\\s,]+([-+.e\\d]+)%(?:[\\s,]+([-+.e\\d]+)(%)?)?\\s*\\)$/;\nfunction hsl2rgbn(h, s, l) {\n const a = s * Math.min(l, 1 - l);\n const f = (n, k = (n + h / 30) % 12) => l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);\n return [f(0), f(8), f(4)];\n}\nfunction hsv2rgbn(h, s, v) {\n const f = (n, k = (n + h / 60) % 6) => v - v * s * Math.max(Math.min(k, 4 - k, 1), 0);\n return [f(5), f(3), f(1)];\n}\nfunction hwb2rgbn(h, w, b) {\n const rgb = hsl2rgbn(h, 1, 0.5);\n let i;\n if (w + b > 1) {\n i = 1 / (w + b);\n w *= i;\n b *= i;\n }\n for (i = 0; i < 3; i++) {\n rgb[i] *= 1 - w - b;\n rgb[i] += w;\n }\n return rgb;\n}\nfunction hueValue(r, g, b, d, max) {\n if (r === max) {\n return ((g - b) / d) + (g < b ? 6 : 0);\n }\n if (g === max) {\n return (b - r) / d + 2;\n }\n return (r - g) / d + 4;\n}\nfunction rgb2hsl(v) {\n const range = 255;\n const r = v.r / range;\n const g = v.g / range;\n const b = v.b / range;\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n const l = (max + min) / 2;\n let h, s, d;\n if (max !== min) {\n d = max - min;\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n h = hueValue(r, g, b, d, max);\n h = h * 60 + 0.5;\n }\n return [h | 0, s || 0, l];\n}\nfunction calln(f, a, b, c) {\n return (\n Array.isArray(a)\n ? f(a[0], a[1], a[2])\n : f(a, b, c)\n ).map(n2b);\n}\nfunction hsl2rgb(h, s, l) {\n return calln(hsl2rgbn, h, s, l);\n}\nfunction hwb2rgb(h, w, b) {\n return calln(hwb2rgbn, h, w, b);\n}\nfunction hsv2rgb(h, s, v) {\n return calln(hsv2rgbn, h, s, v);\n}\nfunction hue(h) {\n return (h % 360 + 360) % 360;\n}\nfunction hueParse(str) {\n const m = HUE_RE.exec(str);\n let a = 255;\n let v;\n if (!m) {\n return;\n }\n if (m[5] !== v) {\n a = m[6] ? p2b(+m[5]) : n2b(+m[5]);\n }\n const h = hue(+m[2]);\n const p1 = +m[3] / 100;\n const p2 = +m[4] / 100;\n if (m[1] === 'hwb') {\n v = hwb2rgb(h, p1, p2);\n } else if (m[1] === 'hsv') {\n v = hsv2rgb(h, p1, p2);\n } else {\n v = hsl2rgb(h, p1, p2);\n }\n return {\n r: v[0],\n g: v[1],\n b: v[2],\n a: a\n };\n}\nfunction rotate(v, deg) {\n var h = rgb2hsl(v);\n h[0] = hue(h[0] + deg);\n h = hsl2rgb(h);\n v.r = h[0];\n v.g = h[1];\n v.b = h[2];\n}\nfunction hslString(v) {\n if (!v) {\n return;\n }\n const a = rgb2hsl(v);\n const h = a[0];\n const s = n2p(a[1]);\n const l = n2p(a[2]);\n return v.a < 255\n ? `hsla(${h}, ${s}%, ${l}%, ${b2n(v.a)})`\n : `hsl(${h}, ${s}%, ${l}%)`;\n}\n\nconst map = {\n x: 'dark',\n Z: 'light',\n Y: 're',\n X: 'blu',\n W: 'gr',\n V: 'medium',\n U: 'slate',\n A: 'ee',\n T: 'ol',\n S: 'or',\n B: 'ra',\n C: 'lateg',\n D: 'ights',\n R: 'in',\n Q: 'turquois',\n E: 'hi',\n P: 'ro',\n O: 'al',\n N: 'le',\n M: 'de',\n L: 'yello',\n F: 'en',\n K: 'ch',\n G: 'arks',\n H: 'ea',\n I: 'ightg',\n J: 'wh'\n};\nconst names$1 = {\n OiceXe: 'f0f8ff',\n antiquewEte: 'faebd7',\n aqua: 'ffff',\n aquamarRe: '7fffd4',\n azuY: 'f0ffff',\n beige: 'f5f5dc',\n bisque: 'ffe4c4',\n black: '0',\n blanKedOmond: 'ffebcd',\n Xe: 'ff',\n XeviTet: '8a2be2',\n bPwn: 'a52a2a',\n burlywood: 'deb887',\n caMtXe: '5f9ea0',\n KartYuse: '7fff00',\n KocTate: 'd2691e',\n cSO: 'ff7f50',\n cSnflowerXe: '6495ed',\n cSnsilk: 'fff8dc',\n crimson: 'dc143c',\n cyan: 'ffff',\n xXe: '8b',\n xcyan: '8b8b',\n xgTMnPd: 'b8860b',\n xWay: 'a9a9a9',\n xgYF: '6400',\n xgYy: 'a9a9a9',\n xkhaki: 'bdb76b',\n xmagFta: '8b008b',\n xTivegYF: '556b2f',\n xSange: 'ff8c00',\n xScEd: '9932cc',\n xYd: '8b0000',\n xsOmon: 'e9967a',\n xsHgYF: '8fbc8f',\n xUXe: '483d8b',\n xUWay: '2f4f4f',\n xUgYy: '2f4f4f',\n xQe: 'ced1',\n xviTet: '9400d3',\n dAppRk: 'ff1493',\n dApskyXe: 'bfff',\n dimWay: '696969',\n dimgYy: '696969',\n dodgerXe: '1e90ff',\n fiYbrick: 'b22222',\n flSOwEte: 'fffaf0',\n foYstWAn: '228b22',\n fuKsia: 'ff00ff',\n gaRsbSo: 'dcdcdc',\n ghostwEte: 'f8f8ff',\n gTd: 'ffd700',\n gTMnPd: 'daa520',\n Way: '808080',\n gYF: '8000',\n gYFLw: 'adff2f',\n gYy: '808080',\n honeyMw: 'f0fff0',\n hotpRk: 'ff69b4',\n RdianYd: 'cd5c5c',\n Rdigo: '4b0082',\n ivSy: 'fffff0',\n khaki: 'f0e68c',\n lavFMr: 'e6e6fa',\n lavFMrXsh: 'fff0f5',\n lawngYF: '7cfc00',\n NmoncEffon: 'fffacd',\n ZXe: 'add8e6',\n ZcSO: 'f08080',\n Zcyan: 'e0ffff',\n ZgTMnPdLw: 'fafad2',\n ZWay: 'd3d3d3',\n ZgYF: '90ee90',\n ZgYy: 'd3d3d3',\n ZpRk: 'ffb6c1',\n ZsOmon: 'ffa07a',\n ZsHgYF: '20b2aa',\n ZskyXe: '87cefa',\n ZUWay: '778899',\n ZUgYy: '778899',\n ZstAlXe: 'b0c4de',\n ZLw: 'ffffe0',\n lime: 'ff00',\n limegYF: '32cd32',\n lRF: 'faf0e6',\n magFta: 'ff00ff',\n maPon: '800000',\n VaquamarRe: '66cdaa',\n VXe: 'cd',\n VScEd: 'ba55d3',\n VpurpN: '9370db',\n VsHgYF: '3cb371',\n VUXe: '7b68ee',\n VsprRggYF: 'fa9a',\n VQe: '48d1cc',\n VviTetYd: 'c71585',\n midnightXe: '191970',\n mRtcYam: 'f5fffa',\n mistyPse: 'ffe4e1',\n moccasR: 'ffe4b5',\n navajowEte: 'ffdead',\n navy: '80',\n Tdlace: 'fdf5e6',\n Tive: '808000',\n TivedBb: '6b8e23',\n Sange: 'ffa500',\n SangeYd: 'ff4500',\n ScEd: 'da70d6',\n pOegTMnPd: 'eee8aa',\n pOegYF: '98fb98',\n pOeQe: 'afeeee',\n pOeviTetYd: 'db7093',\n papayawEp: 'ffefd5',\n pHKpuff: 'ffdab9',\n peru: 'cd853f',\n pRk: 'ffc0cb',\n plum: 'dda0dd',\n powMrXe: 'b0e0e6',\n purpN: '800080',\n YbeccapurpN: '663399',\n Yd: 'ff0000',\n Psybrown: 'bc8f8f',\n PyOXe: '4169e1',\n saddNbPwn: '8b4513',\n sOmon: 'fa8072',\n sandybPwn: 'f4a460',\n sHgYF: '2e8b57',\n sHshell: 'fff5ee',\n siFna: 'a0522d',\n silver: 'c0c0c0',\n skyXe: '87ceeb',\n UXe: '6a5acd',\n UWay: '708090',\n UgYy: '708090',\n snow: 'fffafa',\n sprRggYF: 'ff7f',\n stAlXe: '4682b4',\n tan: 'd2b48c',\n teO: '8080',\n tEstN: 'd8bfd8',\n tomato: 'ff6347',\n Qe: '40e0d0',\n viTet: 'ee82ee',\n JHt: 'f5deb3',\n wEte: 'ffffff',\n wEtesmoke: 'f5f5f5',\n Lw: 'ffff00',\n LwgYF: '9acd32'\n};\nfunction unpack() {\n const unpacked = {};\n const keys = Object.keys(names$1);\n const tkeys = Object.keys(map);\n let i, j, k, ok, nk;\n for (i = 0; i < keys.length; i++) {\n ok = nk = keys[i];\n for (j = 0; j < tkeys.length; j++) {\n k = tkeys[j];\n nk = nk.replace(k, map[k]);\n }\n k = parseInt(names$1[ok], 16);\n unpacked[nk] = [k >> 16 & 0xFF, k >> 8 & 0xFF, k & 0xFF];\n }\n return unpacked;\n}\n\nlet names;\nfunction nameParse(str) {\n if (!names) {\n names = unpack();\n names.transparent = [0, 0, 0, 0];\n }\n const a = names[str.toLowerCase()];\n return a && {\n r: a[0],\n g: a[1],\n b: a[2],\n a: a.length === 4 ? a[3] : 255\n };\n}\n\nconst RGB_RE = /^rgba?\\(\\s*([-+.\\d]+)(%)?[\\s,]+([-+.e\\d]+)(%)?[\\s,]+([-+.e\\d]+)(%)?(?:[\\s,/]+([-+.e\\d]+)(%)?)?\\s*\\)$/;\nfunction rgbParse(str) {\n const m = RGB_RE.exec(str);\n let a = 255;\n let r, g, b;\n if (!m) {\n return;\n }\n if (m[7] !== r) {\n const v = +m[7];\n a = m[8] ? p2b(v) : lim(v * 255, 0, 255);\n }\n r = +m[1];\n g = +m[3];\n b = +m[5];\n r = 255 & (m[2] ? p2b(r) : lim(r, 0, 255));\n g = 255 & (m[4] ? p2b(g) : lim(g, 0, 255));\n b = 255 & (m[6] ? p2b(b) : lim(b, 0, 255));\n return {\n r: r,\n g: g,\n b: b,\n a: a\n };\n}\nfunction rgbString(v) {\n return v && (\n v.a < 255\n ? `rgba(${v.r}, ${v.g}, ${v.b}, ${b2n(v.a)})`\n : `rgb(${v.r}, ${v.g}, ${v.b})`\n );\n}\n\nconst to = v => v <= 0.0031308 ? v * 12.92 : Math.pow(v, 1.0 / 2.4) * 1.055 - 0.055;\nconst from = v => v <= 0.04045 ? v / 12.92 : Math.pow((v + 0.055) / 1.055, 2.4);\nfunction interpolate(rgb1, rgb2, t) {\n const r = from(b2n(rgb1.r));\n const g = from(b2n(rgb1.g));\n const b = from(b2n(rgb1.b));\n return {\n r: n2b(to(r + t * (from(b2n(rgb2.r)) - r))),\n g: n2b(to(g + t * (from(b2n(rgb2.g)) - g))),\n b: n2b(to(b + t * (from(b2n(rgb2.b)) - b))),\n a: rgb1.a + t * (rgb2.a - rgb1.a)\n };\n}\n\nfunction modHSL(v, i, ratio) {\n if (v) {\n let tmp = rgb2hsl(v);\n tmp[i] = Math.max(0, Math.min(tmp[i] + tmp[i] * ratio, i === 0 ? 360 : 1));\n tmp = hsl2rgb(tmp);\n v.r = tmp[0];\n v.g = tmp[1];\n v.b = tmp[2];\n }\n}\nfunction clone(v, proto) {\n return v ? Object.assign(proto || {}, v) : v;\n}\nfunction fromObject(input) {\n var v = {r: 0, g: 0, b: 0, a: 255};\n if (Array.isArray(input)) {\n if (input.length >= 3) {\n v = {r: input[0], g: input[1], b: input[2], a: 255};\n if (input.length > 3) {\n v.a = n2b(input[3]);\n }\n }\n } else {\n v = clone(input, {r: 0, g: 0, b: 0, a: 1});\n v.a = n2b(v.a);\n }\n return v;\n}\nfunction functionParse(str) {\n if (str.charAt(0) === 'r') {\n return rgbParse(str);\n }\n return hueParse(str);\n}\nclass Color {\n constructor(input) {\n if (input instanceof Color) {\n return input;\n }\n const type = typeof input;\n let v;\n if (type === 'object') {\n v = fromObject(input);\n } else if (type === 'string') {\n v = hexParse(input) || nameParse(input) || functionParse(input);\n }\n this._rgb = v;\n this._valid = !!v;\n }\n get valid() {\n return this._valid;\n }\n get rgb() {\n var v = clone(this._rgb);\n if (v) {\n v.a = b2n(v.a);\n }\n return v;\n }\n set rgb(obj) {\n this._rgb = fromObject(obj);\n }\n rgbString() {\n return this._valid ? rgbString(this._rgb) : undefined;\n }\n hexString() {\n return this._valid ? hexString(this._rgb) : undefined;\n }\n hslString() {\n return this._valid ? hslString(this._rgb) : undefined;\n }\n mix(color, weight) {\n if (color) {\n const c1 = this.rgb;\n const c2 = color.rgb;\n let w2;\n const p = weight === w2 ? 0.5 : weight;\n const w = 2 * p - 1;\n const a = c1.a - c2.a;\n const w1 = ((w * a === -1 ? w : (w + a) / (1 + w * a)) + 1) / 2.0;\n w2 = 1 - w1;\n c1.r = 0xFF & w1 * c1.r + w2 * c2.r + 0.5;\n c1.g = 0xFF & w1 * c1.g + w2 * c2.g + 0.5;\n c1.b = 0xFF & w1 * c1.b + w2 * c2.b + 0.5;\n c1.a = p * c1.a + (1 - p) * c2.a;\n this.rgb = c1;\n }\n return this;\n }\n interpolate(color, t) {\n if (color) {\n this._rgb = interpolate(this._rgb, color._rgb, t);\n }\n return this;\n }\n clone() {\n return new Color(this.rgb);\n }\n alpha(a) {\n this._rgb.a = n2b(a);\n return this;\n }\n clearer(ratio) {\n const rgb = this._rgb;\n rgb.a *= 1 - ratio;\n return this;\n }\n greyscale() {\n const rgb = this._rgb;\n const val = round(rgb.r * 0.3 + rgb.g * 0.59 + rgb.b * 0.11);\n rgb.r = rgb.g = rgb.b = val;\n return this;\n }\n opaquer(ratio) {\n const rgb = this._rgb;\n rgb.a *= 1 + ratio;\n return this;\n }\n negate() {\n const v = this._rgb;\n v.r = 255 - v.r;\n v.g = 255 - v.g;\n v.b = 255 - v.b;\n return this;\n }\n lighten(ratio) {\n modHSL(this._rgb, 2, ratio);\n return this;\n }\n darken(ratio) {\n modHSL(this._rgb, 2, -ratio);\n return this;\n }\n saturate(ratio) {\n modHSL(this._rgb, 1, ratio);\n return this;\n }\n desaturate(ratio) {\n modHSL(this._rgb, 1, -ratio);\n return this;\n }\n rotate(deg) {\n rotate(this._rgb, deg);\n return this;\n }\n}\n\nfunction index_esm(input) {\n return new Color(input);\n}\n\nexport { Color, b2n, b2p, index_esm as default, hexParse, hexString, hsl2rgb, hslString, hsv2rgb, hueParse, hwb2rgb, lim, n2b, n2p, nameParse, p2b, rgb2hsl, rgbParse, rgbString, rotate, round };\n","/*!\n * Chart.js v4.3.3\n * https://www.chartjs.org\n * (c) 2023 Chart.js Contributors\n * Released under the MIT License\n */\nimport { Color } from '@kurkle/color';\n\n/**\n * @namespace Chart.helpers\n */ /**\n * An empty function that can be used, for example, for optional callback.\n */ function noop() {\n/* noop */ }\n/**\n * Returns a unique id, sequentially generated from a global variable.\n */ const uid = (()=>{\n let id = 0;\n return ()=>id++;\n})();\n/**\n * Returns true if `value` is neither null nor undefined, else returns false.\n * @param value - The value to test.\n * @since 2.7.0\n */ function isNullOrUndef(value) {\n return value === null || typeof value === 'undefined';\n}\n/**\n * Returns true if `value` is an array (including typed arrays), else returns false.\n * @param value - The value to test.\n * @function\n */ function isArray(value) {\n if (Array.isArray && Array.isArray(value)) {\n return true;\n }\n const type = Object.prototype.toString.call(value);\n if (type.slice(0, 7) === '[object' && type.slice(-6) === 'Array]') {\n return true;\n }\n return false;\n}\n/**\n * Returns true if `value` is an object (excluding null), else returns false.\n * @param value - The value to test.\n * @since 2.7.0\n */ function isObject(value) {\n return value !== null && Object.prototype.toString.call(value) === '[object Object]';\n}\n/**\n * Returns true if `value` is a finite number, else returns false\n * @param value - The value to test.\n */ function isNumberFinite(value) {\n return (typeof value === 'number' || value instanceof Number) && isFinite(+value);\n}\n/**\n * Returns `value` if finite, else returns `defaultValue`.\n * @param value - The value to return if defined.\n * @param defaultValue - The value to return if `value` is not finite.\n */ function finiteOrDefault(value, defaultValue) {\n return isNumberFinite(value) ? value : defaultValue;\n}\n/**\n * Returns `value` if defined, else returns `defaultValue`.\n * @param value - The value to return if defined.\n * @param defaultValue - The value to return if `value` is undefined.\n */ function valueOrDefault(value, defaultValue) {\n return typeof value === 'undefined' ? defaultValue : value;\n}\nconst toPercentage = (value, dimension)=>typeof value === 'string' && value.endsWith('%') ? parseFloat(value) / 100 : +value / dimension;\nconst toDimension = (value, dimension)=>typeof value === 'string' && value.endsWith('%') ? parseFloat(value) / 100 * dimension : +value;\n/**\n * Calls `fn` with the given `args` in the scope defined by `thisArg` and returns the\n * value returned by `fn`. If `fn` is not a function, this method returns undefined.\n * @param fn - The function to call.\n * @param args - The arguments with which `fn` should be called.\n * @param [thisArg] - The value of `this` provided for the call to `fn`.\n */ function callback(fn, args, thisArg) {\n if (fn && typeof fn.call === 'function') {\n return fn.apply(thisArg, args);\n }\n}\nfunction each(loopable, fn, thisArg, reverse) {\n let i, len, keys;\n if (isArray(loopable)) {\n len = loopable.length;\n if (reverse) {\n for(i = len - 1; i >= 0; i--){\n fn.call(thisArg, loopable[i], i);\n }\n } else {\n for(i = 0; i < len; i++){\n fn.call(thisArg, loopable[i], i);\n }\n }\n } else if (isObject(loopable)) {\n keys = Object.keys(loopable);\n len = keys.length;\n for(i = 0; i < len; i++){\n fn.call(thisArg, loopable[keys[i]], keys[i]);\n }\n }\n}\n/**\n * Returns true if the `a0` and `a1` arrays have the same content, else returns false.\n * @param a0 - The array to compare\n * @param a1 - The array to compare\n * @private\n */ function _elementsEqual(a0, a1) {\n let i, ilen, v0, v1;\n if (!a0 || !a1 || a0.length !== a1.length) {\n return false;\n }\n for(i = 0, ilen = a0.length; i < ilen; ++i){\n v0 = a0[i];\n v1 = a1[i];\n if (v0.datasetIndex !== v1.datasetIndex || v0.index !== v1.index) {\n return false;\n }\n }\n return true;\n}\n/**\n * Returns a deep copy of `source` without keeping references on objects and arrays.\n * @param source - The value to clone.\n */ function clone(source) {\n if (isArray(source)) {\n return source.map(clone);\n }\n if (isObject(source)) {\n const target = Object.create(null);\n const keys = Object.keys(source);\n const klen = keys.length;\n let k = 0;\n for(; k < klen; ++k){\n target[keys[k]] = clone(source[keys[k]]);\n }\n return target;\n }\n return source;\n}\nfunction isValidKey(key) {\n return [\n '__proto__',\n 'prototype',\n 'constructor'\n ].indexOf(key) === -1;\n}\n/**\n * The default merger when Chart.helpers.merge is called without merger option.\n * Note(SB): also used by mergeConfig and mergeScaleConfig as fallback.\n * @private\n */ function _merger(key, target, source, options) {\n if (!isValidKey(key)) {\n return;\n }\n const tval = target[key];\n const sval = source[key];\n if (isObject(tval) && isObject(sval)) {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n merge(tval, sval, options);\n } else {\n target[key] = clone(sval);\n }\n}\nfunction merge(target, source, options) {\n const sources = isArray(source) ? source : [\n source\n ];\n const ilen = sources.length;\n if (!isObject(target)) {\n return target;\n }\n options = options || {};\n const merger = options.merger || _merger;\n let current;\n for(let i = 0; i < ilen; ++i){\n current = sources[i];\n if (!isObject(current)) {\n continue;\n }\n const keys = Object.keys(current);\n for(let k = 0, klen = keys.length; k < klen; ++k){\n merger(keys[k], target, current, options);\n }\n }\n return target;\n}\nfunction mergeIf(target, source) {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n return merge(target, source, {\n merger: _mergerIf\n });\n}\n/**\n * Merges source[key] in target[key] only if target[key] is undefined.\n * @private\n */ function _mergerIf(key, target, source) {\n if (!isValidKey(key)) {\n return;\n }\n const tval = target[key];\n const sval = source[key];\n if (isObject(tval) && isObject(sval)) {\n mergeIf(tval, sval);\n } else if (!Object.prototype.hasOwnProperty.call(target, key)) {\n target[key] = clone(sval);\n }\n}\n/**\n * @private\n */ function _deprecated(scope, value, previous, current) {\n if (value !== undefined) {\n console.warn(scope + ': \"' + previous + '\" is deprecated. Please use \"' + current + '\" instead');\n }\n}\n// resolveObjectKey resolver cache\nconst keyResolvers = {\n // Chart.helpers.core resolveObjectKey should resolve empty key to root object\n '': (v)=>v,\n // default resolvers\n x: (o)=>o.x,\n y: (o)=>o.y\n};\n/**\n * @private\n */ function _splitKey(key) {\n const parts = key.split('.');\n const keys = [];\n let tmp = '';\n for (const part of parts){\n tmp += part;\n if (tmp.endsWith('\\\\')) {\n tmp = tmp.slice(0, -1) + '.';\n } else {\n keys.push(tmp);\n tmp = '';\n }\n }\n return keys;\n}\nfunction _getKeyResolver(key) {\n const keys = _splitKey(key);\n return (obj)=>{\n for (const k of keys){\n if (k === '') {\n break;\n }\n obj = obj && obj[k];\n }\n return obj;\n };\n}\nfunction resolveObjectKey(obj, key) {\n const resolver = keyResolvers[key] || (keyResolvers[key] = _getKeyResolver(key));\n return resolver(obj);\n}\n/**\n * @private\n */ function _capitalize(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}\nconst defined = (value)=>typeof value !== 'undefined';\nconst isFunction = (value)=>typeof value === 'function';\n// Adapted from https://stackoverflow.com/questions/31128855/comparing-ecma6-sets-for-equality#31129384\nconst setsEqual = (a, b)=>{\n if (a.size !== b.size) {\n return false;\n }\n for (const item of a){\n if (!b.has(item)) {\n return false;\n }\n }\n return true;\n};\n/**\n * @param e - The event\n * @private\n */ function _isClickEvent(e) {\n return e.type === 'mouseup' || e.type === 'click' || e.type === 'contextmenu';\n}\n\n/**\n * @alias Chart.helpers.math\n * @namespace\n */ const PI = Math.PI;\nconst TAU = 2 * PI;\nconst PITAU = TAU + PI;\nconst INFINITY = Number.POSITIVE_INFINITY;\nconst RAD_PER_DEG = PI / 180;\nconst HALF_PI = PI / 2;\nconst QUARTER_PI = PI / 4;\nconst TWO_THIRDS_PI = PI * 2 / 3;\nconst log10 = Math.log10;\nconst sign = Math.sign;\nfunction almostEquals(x, y, epsilon) {\n return Math.abs(x - y) < epsilon;\n}\n/**\n * Implementation of the nice number algorithm used in determining where axis labels will go\n */ function niceNum(range) {\n const roundedRange = Math.round(range);\n range = almostEquals(range, roundedRange, range / 1000) ? roundedRange : range;\n const niceRange = Math.pow(10, Math.floor(log10(range)));\n const fraction = range / niceRange;\n const niceFraction = fraction <= 1 ? 1 : fraction <= 2 ? 2 : fraction <= 5 ? 5 : 10;\n return niceFraction * niceRange;\n}\n/**\n * Returns an array of factors sorted from 1 to sqrt(value)\n * @private\n */ function _factorize(value) {\n const result = [];\n const sqrt = Math.sqrt(value);\n let i;\n for(i = 1; i < sqrt; i++){\n if (value % i === 0) {\n result.push(i);\n result.push(value / i);\n }\n }\n if (sqrt === (sqrt | 0)) {\n result.push(sqrt);\n }\n result.sort((a, b)=>a - b).pop();\n return result;\n}\nfunction isNumber(n) {\n return !isNaN(parseFloat(n)) && isFinite(n);\n}\nfunction almostWhole(x, epsilon) {\n const rounded = Math.round(x);\n return rounded - epsilon <= x && rounded + epsilon >= x;\n}\n/**\n * @private\n */ function _setMinAndMaxByKey(array, target, property) {\n let i, ilen, value;\n for(i = 0, ilen = array.length; i < ilen; i++){\n value = array[i][property];\n if (!isNaN(value)) {\n target.min = Math.min(target.min, value);\n target.max = Math.max(target.max, value);\n }\n }\n}\nfunction toRadians(degrees) {\n return degrees * (PI / 180);\n}\nfunction toDegrees(radians) {\n return radians * (180 / PI);\n}\n/**\n * Returns the number of decimal places\n * i.e. the number of digits after the decimal point, of the value of this Number.\n * @param x - A number.\n * @returns The number of decimal places.\n * @private\n */ function _decimalPlaces(x) {\n if (!isNumberFinite(x)) {\n return;\n }\n let e = 1;\n let p = 0;\n while(Math.round(x * e) / e !== x){\n e *= 10;\n p++;\n }\n return p;\n}\n// Gets the angle from vertical upright to the point about a centre.\nfunction getAngleFromPoint(centrePoint, anglePoint) {\n const distanceFromXCenter = anglePoint.x - centrePoint.x;\n const distanceFromYCenter = anglePoint.y - centrePoint.y;\n const radialDistanceFromCenter = Math.sqrt(distanceFromXCenter * distanceFromXCenter + distanceFromYCenter * distanceFromYCenter);\n let angle = Math.atan2(distanceFromYCenter, distanceFromXCenter);\n if (angle < -0.5 * PI) {\n angle += TAU; // make sure the returned angle is in the range of (-PI/2, 3PI/2]\n }\n return {\n angle,\n distance: radialDistanceFromCenter\n };\n}\nfunction distanceBetweenPoints(pt1, pt2) {\n return Math.sqrt(Math.pow(pt2.x - pt1.x, 2) + Math.pow(pt2.y - pt1.y, 2));\n}\n/**\n * Shortest distance between angles, in either direction.\n * @private\n */ function _angleDiff(a, b) {\n return (a - b + PITAU) % TAU - PI;\n}\n/**\n * Normalize angle to be between 0 and 2*PI\n * @private\n */ function _normalizeAngle(a) {\n return (a % TAU + TAU) % TAU;\n}\n/**\n * @private\n */ function _angleBetween(angle, start, end, sameAngleIsFullCircle) {\n const a = _normalizeAngle(angle);\n const s = _normalizeAngle(start);\n const e = _normalizeAngle(end);\n const angleToStart = _normalizeAngle(s - a);\n const angleToEnd = _normalizeAngle(e - a);\n const startToAngle = _normalizeAngle(a - s);\n const endToAngle = _normalizeAngle(a - e);\n return a === s || a === e || sameAngleIsFullCircle && s === e || angleToStart > angleToEnd && startToAngle < endToAngle;\n}\n/**\n * Limit `value` between `min` and `max`\n * @param value\n * @param min\n * @param max\n * @private\n */ function _limitValue(value, min, max) {\n return Math.max(min, Math.min(max, value));\n}\n/**\n * @param {number} value\n * @private\n */ function _int16Range(value) {\n return _limitValue(value, -32768, 32767);\n}\n/**\n * @param value\n * @param start\n * @param end\n * @param [epsilon]\n * @private\n */ function _isBetween(value, start, end, epsilon = 1e-6) {\n return value >= Math.min(start, end) - epsilon && value <= Math.max(start, end) + epsilon;\n}\n\nfunction _lookup(table, value, cmp) {\n cmp = cmp || ((index)=>table[index] < value);\n let hi = table.length - 1;\n let lo = 0;\n let mid;\n while(hi - lo > 1){\n mid = lo + hi >> 1;\n if (cmp(mid)) {\n lo = mid;\n } else {\n hi = mid;\n }\n }\n return {\n lo,\n hi\n };\n}\n/**\n * Binary search\n * @param table - the table search. must be sorted!\n * @param key - property name for the value in each entry\n * @param value - value to find\n * @param last - lookup last index\n * @private\n */ const _lookupByKey = (table, key, value, last)=>_lookup(table, value, last ? (index)=>{\n const ti = table[index][key];\n return ti < value || ti === value && table[index + 1][key] === value;\n } : (index)=>table[index][key] < value);\n/**\n * Reverse binary search\n * @param table - the table search. must be sorted!\n * @param key - property name for the value in each entry\n * @param value - value to find\n * @private\n */ const _rlookupByKey = (table, key, value)=>_lookup(table, value, (index)=>table[index][key] >= value);\n/**\n * Return subset of `values` between `min` and `max` inclusive.\n * Values are assumed to be in sorted order.\n * @param values - sorted array of values\n * @param min - min value\n * @param max - max value\n */ function _filterBetween(values, min, max) {\n let start = 0;\n let end = values.length;\n while(start < end && values[start] < min){\n start++;\n }\n while(end > start && values[end - 1] > max){\n end--;\n }\n return start > 0 || end < values.length ? values.slice(start, end) : values;\n}\nconst arrayEvents = [\n 'push',\n 'pop',\n 'shift',\n 'splice',\n 'unshift'\n];\nfunction listenArrayEvents(array, listener) {\n if (array._chartjs) {\n array._chartjs.listeners.push(listener);\n return;\n }\n Object.defineProperty(array, '_chartjs', {\n configurable: true,\n enumerable: false,\n value: {\n listeners: [\n listener\n ]\n }\n });\n arrayEvents.forEach((key)=>{\n const method = '_onData' + _capitalize(key);\n const base = array[key];\n Object.defineProperty(array, key, {\n configurable: true,\n enumerable: false,\n value (...args) {\n const res = base.apply(this, args);\n array._chartjs.listeners.forEach((object)=>{\n if (typeof object[method] === 'function') {\n object[method](...args);\n }\n });\n return res;\n }\n });\n });\n}\nfunction unlistenArrayEvents(array, listener) {\n const stub = array._chartjs;\n if (!stub) {\n return;\n }\n const listeners = stub.listeners;\n const index = listeners.indexOf(listener);\n if (index !== -1) {\n listeners.splice(index, 1);\n }\n if (listeners.length > 0) {\n return;\n }\n arrayEvents.forEach((key)=>{\n delete array[key];\n });\n delete array._chartjs;\n}\n/**\n * @param items\n */ function _arrayUnique(items) {\n const set = new Set(items);\n if (set.size === items.length) {\n return items;\n }\n return Array.from(set);\n}\n\nfunction fontString(pixelSize, fontStyle, fontFamily) {\n return fontStyle + ' ' + pixelSize + 'px ' + fontFamily;\n}\n/**\n* Request animation polyfill\n*/ const requestAnimFrame = function() {\n if (typeof window === 'undefined') {\n return function(callback) {\n return callback();\n };\n }\n return window.requestAnimationFrame;\n}();\n/**\n * Throttles calling `fn` once per animation frame\n * Latest arguments are used on the actual call\n */ function throttled(fn, thisArg) {\n let argsToUse = [];\n let ticking = false;\n return function(...args) {\n // Save the args for use later\n argsToUse = args;\n if (!ticking) {\n ticking = true;\n requestAnimFrame.call(window, ()=>{\n ticking = false;\n fn.apply(thisArg, argsToUse);\n });\n }\n };\n}\n/**\n * Debounces calling `fn` for `delay` ms\n */ function debounce(fn, delay) {\n let timeout;\n return function(...args) {\n if (delay) {\n clearTimeout(timeout);\n timeout = setTimeout(fn, delay, args);\n } else {\n fn.apply(this, args);\n }\n return delay;\n };\n}\n/**\n * Converts 'start' to 'left', 'end' to 'right' and others to 'center'\n * @private\n */ const _toLeftRightCenter = (align)=>align === 'start' ? 'left' : align === 'end' ? 'right' : 'center';\n/**\n * Returns `start`, `end` or `(start + end) / 2` depending on `align`. Defaults to `center`\n * @private\n */ const _alignStartEnd = (align, start, end)=>align === 'start' ? start : align === 'end' ? end : (start + end) / 2;\n/**\n * Returns `left`, `right` or `(left + right) / 2` depending on `align`. Defaults to `left`\n * @private\n */ const _textX = (align, left, right, rtl)=>{\n const check = rtl ? 'left' : 'right';\n return align === check ? right : align === 'center' ? (left + right) / 2 : left;\n};\n/**\n * Return start and count of visible points.\n * @private\n */ function _getStartAndCountOfVisiblePoints(meta, points, animationsDisabled) {\n const pointCount = points.length;\n let start = 0;\n let count = pointCount;\n if (meta._sorted) {\n const { iScale , _parsed } = meta;\n const axis = iScale.axis;\n const { min , max , minDefined , maxDefined } = iScale.getUserBounds();\n if (minDefined) {\n start = _limitValue(Math.min(// @ts-expect-error Need to type _parsed\n _lookupByKey(_parsed, axis, min).lo, // @ts-expect-error Need to fix types on _lookupByKey\n animationsDisabled ? pointCount : _lookupByKey(points, axis, iScale.getPixelForValue(min)).lo), 0, pointCount - 1);\n }\n if (maxDefined) {\n count = _limitValue(Math.max(// @ts-expect-error Need to type _parsed\n _lookupByKey(_parsed, iScale.axis, max, true).hi + 1, // @ts-expect-error Need to fix types on _lookupByKey\n animationsDisabled ? 0 : _lookupByKey(points, axis, iScale.getPixelForValue(max), true).hi + 1), start, pointCount) - start;\n } else {\n count = pointCount - start;\n }\n }\n return {\n start,\n count\n };\n}\n/**\n * Checks if the scale ranges have changed.\n * @param {object} meta - dataset meta.\n * @returns {boolean}\n * @private\n */ function _scaleRangesChanged(meta) {\n const { xScale , yScale , _scaleRanges } = meta;\n const newRanges = {\n xmin: xScale.min,\n xmax: xScale.max,\n ymin: yScale.min,\n ymax: yScale.max\n };\n if (!_scaleRanges) {\n meta._scaleRanges = newRanges;\n return true;\n }\n const changed = _scaleRanges.xmin !== xScale.min || _scaleRanges.xmax !== xScale.max || _scaleRanges.ymin !== yScale.min || _scaleRanges.ymax !== yScale.max;\n Object.assign(_scaleRanges, newRanges);\n return changed;\n}\n\nconst atEdge = (t)=>t === 0 || t === 1;\nconst elasticIn = (t, s, p)=>-(Math.pow(2, 10 * (t -= 1)) * Math.sin((t - s) * TAU / p));\nconst elasticOut = (t, s, p)=>Math.pow(2, -10 * t) * Math.sin((t - s) * TAU / p) + 1;\n/**\n * Easing functions adapted from Robert Penner's easing equations.\n * @namespace Chart.helpers.easing.effects\n * @see http://www.robertpenner.com/easing/\n */ const effects = {\n linear: (t)=>t,\n easeInQuad: (t)=>t * t,\n easeOutQuad: (t)=>-t * (t - 2),\n easeInOutQuad: (t)=>(t /= 0.5) < 1 ? 0.5 * t * t : -0.5 * (--t * (t - 2) - 1),\n easeInCubic: (t)=>t * t * t,\n easeOutCubic: (t)=>(t -= 1) * t * t + 1,\n easeInOutCubic: (t)=>(t /= 0.5) < 1 ? 0.5 * t * t * t : 0.5 * ((t -= 2) * t * t + 2),\n easeInQuart: (t)=>t * t * t * t,\n easeOutQuart: (t)=>-((t -= 1) * t * t * t - 1),\n easeInOutQuart: (t)=>(t /= 0.5) < 1 ? 0.5 * t * t * t * t : -0.5 * ((t -= 2) * t * t * t - 2),\n easeInQuint: (t)=>t * t * t * t * t,\n easeOutQuint: (t)=>(t -= 1) * t * t * t * t + 1,\n easeInOutQuint: (t)=>(t /= 0.5) < 1 ? 0.5 * t * t * t * t * t : 0.5 * ((t -= 2) * t * t * t * t + 2),\n easeInSine: (t)=>-Math.cos(t * HALF_PI) + 1,\n easeOutSine: (t)=>Math.sin(t * HALF_PI),\n easeInOutSine: (t)=>-0.5 * (Math.cos(PI * t) - 1),\n easeInExpo: (t)=>t === 0 ? 0 : Math.pow(2, 10 * (t - 1)),\n easeOutExpo: (t)=>t === 1 ? 1 : -Math.pow(2, -10 * t) + 1,\n 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),\n easeInCirc: (t)=>t >= 1 ? t : -(Math.sqrt(1 - t * t) - 1),\n easeOutCirc: (t)=>Math.sqrt(1 - (t -= 1) * t),\n easeInOutCirc: (t)=>(t /= 0.5) < 1 ? -0.5 * (Math.sqrt(1 - t * t) - 1) : 0.5 * (Math.sqrt(1 - (t -= 2) * t) + 1),\n easeInElastic: (t)=>atEdge(t) ? t : elasticIn(t, 0.075, 0.3),\n easeOutElastic: (t)=>atEdge(t) ? t : elasticOut(t, 0.075, 0.3),\n easeInOutElastic (t) {\n const s = 0.1125;\n const p = 0.45;\n return atEdge(t) ? t : t < 0.5 ? 0.5 * elasticIn(t * 2, s, p) : 0.5 + 0.5 * elasticOut(t * 2 - 1, s, p);\n },\n easeInBack (t) {\n const s = 1.70158;\n return t * t * ((s + 1) * t - s);\n },\n easeOutBack (t) {\n const s = 1.70158;\n return (t -= 1) * t * ((s + 1) * t + s) + 1;\n },\n easeInOutBack (t) {\n let s = 1.70158;\n if ((t /= 0.5) < 1) {\n return 0.5 * (t * t * (((s *= 1.525) + 1) * t - s));\n }\n return 0.5 * ((t -= 2) * t * (((s *= 1.525) + 1) * t + s) + 2);\n },\n easeInBounce: (t)=>1 - effects.easeOutBounce(1 - t),\n easeOutBounce (t) {\n const m = 7.5625;\n const d = 2.75;\n if (t < 1 / d) {\n return m * t * t;\n }\n if (t < 2 / d) {\n return m * (t -= 1.5 / d) * t + 0.75;\n }\n if (t < 2.5 / d) {\n return m * (t -= 2.25 / d) * t + 0.9375;\n }\n return m * (t -= 2.625 / d) * t + 0.984375;\n },\n easeInOutBounce: (t)=>t < 0.5 ? effects.easeInBounce(t * 2) * 0.5 : effects.easeOutBounce(t * 2 - 1) * 0.5 + 0.5\n};\n\nfunction isPatternOrGradient(value) {\n if (value && typeof value === 'object') {\n const type = value.toString();\n return type === '[object CanvasPattern]' || type === '[object CanvasGradient]';\n }\n return false;\n}\nfunction color(value) {\n return isPatternOrGradient(value) ? value : new Color(value);\n}\nfunction getHoverColor(value) {\n return isPatternOrGradient(value) ? value : new Color(value).saturate(0.5).darken(0.1).hexString();\n}\n\nconst numbers = [\n 'x',\n 'y',\n 'borderWidth',\n 'radius',\n 'tension'\n];\nconst colors = [\n 'color',\n 'borderColor',\n 'backgroundColor'\n];\nfunction applyAnimationsDefaults(defaults) {\n defaults.set('animation', {\n delay: undefined,\n duration: 1000,\n easing: 'easeOutQuart',\n fn: undefined,\n from: undefined,\n loop: undefined,\n to: undefined,\n type: undefined\n });\n defaults.describe('animation', {\n _fallback: false,\n _indexable: false,\n _scriptable: (name)=>name !== 'onProgress' && name !== 'onComplete' && name !== 'fn'\n });\n defaults.set('animations', {\n colors: {\n type: 'color',\n properties: colors\n },\n numbers: {\n type: 'number',\n properties: numbers\n }\n });\n defaults.describe('animations', {\n _fallback: 'animation'\n });\n defaults.set('transitions', {\n active: {\n animation: {\n duration: 400\n }\n },\n resize: {\n animation: {\n duration: 0\n }\n },\n show: {\n animations: {\n colors: {\n from: 'transparent'\n },\n visible: {\n type: 'boolean',\n duration: 0\n }\n }\n },\n hide: {\n animations: {\n colors: {\n to: 'transparent'\n },\n visible: {\n type: 'boolean',\n easing: 'linear',\n fn: (v)=>v | 0\n }\n }\n }\n });\n}\n\nfunction applyLayoutsDefaults(defaults) {\n defaults.set('layout', {\n autoPadding: true,\n padding: {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n }\n });\n}\n\nconst intlCache = new Map();\nfunction getNumberFormat(locale, options) {\n options = options || {};\n const cacheKey = locale + JSON.stringify(options);\n let formatter = intlCache.get(cacheKey);\n if (!formatter) {\n formatter = new Intl.NumberFormat(locale, options);\n intlCache.set(cacheKey, formatter);\n }\n return formatter;\n}\nfunction formatNumber(num, locale, options) {\n return getNumberFormat(locale, options).format(num);\n}\n\nconst formatters = {\n values (value) {\n return isArray(value) ? value : '' + value;\n },\n numeric (tickValue, index, ticks) {\n if (tickValue === 0) {\n return '0';\n }\n const locale = this.chart.options.locale;\n let notation;\n let delta = tickValue;\n if (ticks.length > 1) {\n const maxTick = Math.max(Math.abs(ticks[0].value), Math.abs(ticks[ticks.length - 1].value));\n if (maxTick < 1e-4 || maxTick > 1e+15) {\n notation = 'scientific';\n }\n delta = calculateDelta(tickValue, ticks);\n }\n const logDelta = log10(Math.abs(delta));\n const numDecimal = isNaN(logDelta) ? 1 : Math.max(Math.min(-1 * Math.floor(logDelta), 20), 0);\n const options = {\n notation,\n minimumFractionDigits: numDecimal,\n maximumFractionDigits: numDecimal\n };\n Object.assign(options, this.options.ticks.format);\n return formatNumber(tickValue, locale, options);\n },\n logarithmic (tickValue, index, ticks) {\n if (tickValue === 0) {\n return '0';\n }\n const remain = ticks[index].significand || tickValue / Math.pow(10, Math.floor(log10(tickValue)));\n if ([\n 1,\n 2,\n 3,\n 5,\n 10,\n 15\n ].includes(remain) || index > 0.8 * ticks.length) {\n return formatters.numeric.call(this, tickValue, index, ticks);\n }\n return '';\n }\n};\nfunction calculateDelta(tickValue, ticks) {\n let delta = ticks.length > 3 ? ticks[2].value - ticks[1].value : ticks[1].value - ticks[0].value;\n if (Math.abs(delta) >= 1 && tickValue !== Math.floor(tickValue)) {\n delta = tickValue - Math.floor(tickValue);\n }\n return delta;\n}\n var Ticks = {\n formatters\n};\n\nfunction applyScaleDefaults(defaults) {\n defaults.set('scale', {\n display: true,\n offset: false,\n reverse: false,\n beginAtZero: false,\n bounds: 'ticks',\n grace: 0,\n grid: {\n display: true,\n lineWidth: 1,\n drawOnChartArea: true,\n drawTicks: true,\n tickLength: 8,\n tickWidth: (_ctx, options)=>options.lineWidth,\n tickColor: (_ctx, options)=>options.color,\n offset: false\n },\n border: {\n display: true,\n dash: [],\n dashOffset: 0.0,\n width: 1\n },\n title: {\n display: false,\n text: '',\n padding: {\n top: 4,\n bottom: 4\n }\n },\n ticks: {\n minRotation: 0,\n maxRotation: 50,\n mirror: false,\n textStrokeWidth: 0,\n textStrokeColor: '',\n padding: 3,\n display: true,\n autoSkip: true,\n autoSkipPadding: 3,\n labelOffset: 0,\n callback: Ticks.formatters.values,\n minor: {},\n major: {},\n align: 'center',\n crossAlign: 'near',\n showLabelBackdrop: false,\n backdropColor: 'rgba(255, 255, 255, 0.75)',\n backdropPadding: 2\n }\n });\n defaults.route('scale.ticks', 'color', '', 'color');\n defaults.route('scale.grid', 'color', '', 'borderColor');\n defaults.route('scale.border', 'color', '', 'borderColor');\n defaults.route('scale.title', 'color', '', 'color');\n defaults.describe('scale', {\n _fallback: false,\n _scriptable: (name)=>!name.startsWith('before') && !name.startsWith('after') && name !== 'callback' && name !== 'parser',\n _indexable: (name)=>name !== 'borderDash' && name !== 'tickBorderDash' && name !== 'dash'\n });\n defaults.describe('scales', {\n _fallback: 'scale'\n });\n defaults.describe('scale.ticks', {\n _scriptable: (name)=>name !== 'backdropPadding' && name !== 'callback',\n _indexable: (name)=>name !== 'backdropPadding'\n });\n}\n\nconst overrides = Object.create(null);\nconst descriptors = Object.create(null);\n function getScope$1(node, key) {\n if (!key) {\n return node;\n }\n const keys = key.split('.');\n for(let i = 0, n = keys.length; i < n; ++i){\n const k = keys[i];\n node = node[k] || (node[k] = Object.create(null));\n }\n return node;\n}\nfunction set(root, scope, values) {\n if (typeof scope === 'string') {\n return merge(getScope$1(root, scope), values);\n }\n return merge(getScope$1(root, ''), scope);\n}\n class Defaults {\n constructor(_descriptors, _appliers){\n this.animation = undefined;\n this.backgroundColor = 'rgba(0,0,0,0.1)';\n this.borderColor = 'rgba(0,0,0,0.1)';\n this.color = '#666';\n this.datasets = {};\n this.devicePixelRatio = (context)=>context.chart.platform.getDevicePixelRatio();\n this.elements = {};\n this.events = [\n 'mousemove',\n 'mouseout',\n 'click',\n 'touchstart',\n 'touchmove'\n ];\n this.font = {\n family: \"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif\",\n size: 12,\n style: 'normal',\n lineHeight: 1.2,\n weight: null\n };\n this.hover = {};\n this.hoverBackgroundColor = (ctx, options)=>getHoverColor(options.backgroundColor);\n this.hoverBorderColor = (ctx, options)=>getHoverColor(options.borderColor);\n this.hoverColor = (ctx, options)=>getHoverColor(options.color);\n this.indexAxis = 'x';\n this.interaction = {\n mode: 'nearest',\n intersect: true,\n includeInvisible: false\n };\n this.maintainAspectRatio = true;\n this.onHover = null;\n this.onClick = null;\n this.parsing = true;\n this.plugins = {};\n this.responsive = true;\n this.scale = undefined;\n this.scales = {};\n this.showLine = true;\n this.drawActiveElementsOnTop = true;\n this.describe(_descriptors);\n this.apply(_appliers);\n }\n set(scope, values) {\n return set(this, scope, values);\n }\n get(scope) {\n return getScope$1(this, scope);\n }\n describe(scope, values) {\n return set(descriptors, scope, values);\n }\n override(scope, values) {\n return set(overrides, scope, values);\n }\n route(scope, name, targetScope, targetName) {\n const scopeObject = getScope$1(this, scope);\n const targetScopeObject = getScope$1(this, targetScope);\n const privateName = '_' + name;\n Object.defineProperties(scopeObject, {\n [privateName]: {\n value: scopeObject[name],\n writable: true\n },\n [name]: {\n enumerable: true,\n get () {\n const local = this[privateName];\n const target = targetScopeObject[targetName];\n if (isObject(local)) {\n return Object.assign({}, target, local);\n }\n return valueOrDefault(local, target);\n },\n set (value) {\n this[privateName] = value;\n }\n }\n });\n }\n apply(appliers) {\n appliers.forEach((apply)=>apply(this));\n }\n}\nvar defaults = /* #__PURE__ */ new Defaults({\n _scriptable: (name)=>!name.startsWith('on'),\n _indexable: (name)=>name !== 'events',\n hover: {\n _fallback: 'interaction'\n },\n interaction: {\n _scriptable: false,\n _indexable: false\n }\n}, [\n applyAnimationsDefaults,\n applyLayoutsDefaults,\n applyScaleDefaults\n]);\n\n/**\n * Converts the given font object into a CSS font string.\n * @param font - A font object.\n * @return The CSS font string. See https://developer.mozilla.org/en-US/docs/Web/CSS/font\n * @private\n */ function toFontString(font) {\n if (!font || isNullOrUndef(font.size) || isNullOrUndef(font.family)) {\n return null;\n }\n return (font.style ? font.style + ' ' : '') + (font.weight ? font.weight + ' ' : '') + font.size + 'px ' + font.family;\n}\n/**\n * @private\n */ function _measureText(ctx, data, gc, longest, string) {\n let textWidth = data[string];\n if (!textWidth) {\n textWidth = data[string] = ctx.measureText(string).width;\n gc.push(string);\n }\n if (textWidth > longest) {\n longest = textWidth;\n }\n return longest;\n}\n/**\n * @private\n */ // eslint-disable-next-line complexity\nfunction _longestText(ctx, font, arrayOfThings, cache) {\n cache = cache || {};\n let data = cache.data = cache.data || {};\n let gc = cache.garbageCollect = cache.garbageCollect || [];\n if (cache.font !== font) {\n data = cache.data = {};\n gc = cache.garbageCollect = [];\n cache.font = font;\n }\n ctx.save();\n ctx.font = font;\n let longest = 0;\n const ilen = arrayOfThings.length;\n let i, j, jlen, thing, nestedThing;\n for(i = 0; i < ilen; i++){\n thing = arrayOfThings[i];\n // Undefined strings and arrays should not be measured\n if (thing !== undefined && thing !== null && !isArray(thing)) {\n longest = _measureText(ctx, data, gc, longest, thing);\n } else if (isArray(thing)) {\n // if it is an array lets measure each element\n // to do maybe simplify this function a bit so we can do this more recursively?\n for(j = 0, jlen = thing.length; j < jlen; j++){\n nestedThing = thing[j];\n // Undefined strings and arrays should not be measured\n if (nestedThing !== undefined && nestedThing !== null && !isArray(nestedThing)) {\n longest = _measureText(ctx, data, gc, longest, nestedThing);\n }\n }\n }\n }\n ctx.restore();\n const gcLen = gc.length / 2;\n if (gcLen > arrayOfThings.length) {\n for(i = 0; i < gcLen; i++){\n delete data[gc[i]];\n }\n gc.splice(0, gcLen);\n }\n return longest;\n}\n/**\n * Returns the aligned pixel value to avoid anti-aliasing blur\n * @param chart - The chart instance.\n * @param pixel - A pixel value.\n * @param width - The width of the element.\n * @returns The aligned pixel value.\n * @private\n */ function _alignPixel(chart, pixel, width) {\n const devicePixelRatio = chart.currentDevicePixelRatio;\n const halfWidth = width !== 0 ? Math.max(width / 2, 0.5) : 0;\n return Math.round((pixel - halfWidth) * devicePixelRatio) / devicePixelRatio + halfWidth;\n}\n/**\n * Clears the entire canvas.\n */ function clearCanvas(canvas, ctx) {\n ctx = ctx || canvas.getContext('2d');\n ctx.save();\n // canvas.width and canvas.height do not consider the canvas transform,\n // while clearRect does\n ctx.resetTransform();\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n ctx.restore();\n}\nfunction drawPoint(ctx, options, x, y) {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n drawPointLegend(ctx, options, x, y, null);\n}\n// eslint-disable-next-line complexity\nfunction drawPointLegend(ctx, options, x, y, w) {\n let type, xOffset, yOffset, size, cornerRadius, width, xOffsetW, yOffsetW;\n const style = options.pointStyle;\n const rotation = options.rotation;\n const radius = options.radius;\n let rad = (rotation || 0) * RAD_PER_DEG;\n if (style && typeof style === 'object') {\n type = style.toString();\n if (type === '[object HTMLImageElement]' || type === '[object HTMLCanvasElement]') {\n ctx.save();\n ctx.translate(x, y);\n ctx.rotate(rad);\n ctx.drawImage(style, -style.width / 2, -style.height / 2, style.width, style.height);\n ctx.restore();\n return;\n }\n }\n if (isNaN(radius) || radius <= 0) {\n return;\n }\n ctx.beginPath();\n switch(style){\n // Default includes circle\n default:\n if (w) {\n ctx.ellipse(x, y, w / 2, radius, 0, 0, TAU);\n } else {\n ctx.arc(x, y, radius, 0, TAU);\n }\n ctx.closePath();\n break;\n case 'triangle':\n width = w ? w / 2 : radius;\n ctx.moveTo(x + Math.sin(rad) * width, y - Math.cos(rad) * radius);\n rad += TWO_THIRDS_PI;\n ctx.lineTo(x + Math.sin(rad) * width, y - Math.cos(rad) * radius);\n rad += TWO_THIRDS_PI;\n ctx.lineTo(x + Math.sin(rad) * width, y - Math.cos(rad) * radius);\n ctx.closePath();\n break;\n case 'rectRounded':\n // NOTE: the rounded rect implementation changed to use `arc` instead of\n // `quadraticCurveTo` since it generates better results when rect is\n // almost a circle. 0.516 (instead of 0.5) produces results with visually\n // closer proportion to the previous impl and it is inscribed in the\n // circle with `radius`. For more details, see the following PRs:\n // https://github.com/chartjs/Chart.js/issues/5597\n // https://github.com/chartjs/Chart.js/issues/5858\n cornerRadius = radius * 0.516;\n size = radius - cornerRadius;\n xOffset = Math.cos(rad + QUARTER_PI) * size;\n xOffsetW = Math.cos(rad + QUARTER_PI) * (w ? w / 2 - cornerRadius : size);\n yOffset = Math.sin(rad + QUARTER_PI) * size;\n yOffsetW = Math.sin(rad + QUARTER_PI) * (w ? w / 2 - cornerRadius : size);\n ctx.arc(x - xOffsetW, y - yOffset, cornerRadius, rad - PI, rad - HALF_PI);\n ctx.arc(x + yOffsetW, y - xOffset, cornerRadius, rad - HALF_PI, rad);\n ctx.arc(x + xOffsetW, y + yOffset, cornerRadius, rad, rad + HALF_PI);\n ctx.arc(x - yOffsetW, y + xOffset, cornerRadius, rad + HALF_PI, rad + PI);\n ctx.closePath();\n break;\n case 'rect':\n if (!rotation) {\n size = Math.SQRT1_2 * radius;\n width = w ? w / 2 : size;\n ctx.rect(x - width, y - size, 2 * width, 2 * size);\n break;\n }\n rad += QUARTER_PI;\n /* falls through */ case 'rectRot':\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n ctx.closePath();\n break;\n case 'crossRot':\n rad += QUARTER_PI;\n /* falls through */ case 'cross':\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.moveTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n break;\n case 'star':\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.moveTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n rad += QUARTER_PI;\n xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n ctx.moveTo(x - xOffsetW, y - yOffset);\n ctx.lineTo(x + xOffsetW, y + yOffset);\n ctx.moveTo(x + yOffsetW, y - xOffset);\n ctx.lineTo(x - yOffsetW, y + xOffset);\n break;\n case 'line':\n xOffset = w ? w / 2 : Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n ctx.moveTo(x - xOffset, y - yOffset);\n ctx.lineTo(x + xOffset, y + yOffset);\n break;\n case 'dash':\n ctx.moveTo(x, y);\n ctx.lineTo(x + Math.cos(rad) * (w ? w / 2 : radius), y + Math.sin(rad) * radius);\n break;\n case false:\n ctx.closePath();\n break;\n }\n ctx.fill();\n if (options.borderWidth > 0) {\n ctx.stroke();\n }\n}\n/**\n * Returns true if the point is inside the rectangle\n * @param point - The point to test\n * @param area - The rectangle\n * @param margin - allowed margin\n * @private\n */ function _isPointInArea(point, area, margin) {\n margin = margin || 0.5; // margin - default is to match rounded decimals\n return !area || point && point.x > area.left - margin && point.x < area.right + margin && point.y > area.top - margin && point.y < area.bottom + margin;\n}\nfunction clipArea(ctx, area) {\n ctx.save();\n ctx.beginPath();\n ctx.rect(area.left, area.top, area.right - area.left, area.bottom - area.top);\n ctx.clip();\n}\nfunction unclipArea(ctx) {\n ctx.restore();\n}\n/**\n * @private\n */ function _steppedLineTo(ctx, previous, target, flip, mode) {\n if (!previous) {\n return ctx.lineTo(target.x, target.y);\n }\n if (mode === 'middle') {\n const midpoint = (previous.x + target.x) / 2.0;\n ctx.lineTo(midpoint, previous.y);\n ctx.lineTo(midpoint, target.y);\n } else if (mode === 'after' !== !!flip) {\n ctx.lineTo(previous.x, target.y);\n } else {\n ctx.lineTo(target.x, previous.y);\n }\n ctx.lineTo(target.x, target.y);\n}\n/**\n * @private\n */ function _bezierCurveTo(ctx, previous, target, flip) {\n if (!previous) {\n return ctx.lineTo(target.x, target.y);\n }\n 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);\n}\nfunction setRenderOpts(ctx, opts) {\n if (opts.translation) {\n ctx.translate(opts.translation[0], opts.translation[1]);\n }\n if (!isNullOrUndef(opts.rotation)) {\n ctx.rotate(opts.rotation);\n }\n if (opts.color) {\n ctx.fillStyle = opts.color;\n }\n if (opts.textAlign) {\n ctx.textAlign = opts.textAlign;\n }\n if (opts.textBaseline) {\n ctx.textBaseline = opts.textBaseline;\n }\n}\nfunction decorateText(ctx, x, y, line, opts) {\n if (opts.strikethrough || opts.underline) {\n /**\n * Now that IE11 support has been dropped, we can use more\n * of the TextMetrics object. The actual bounding boxes\n * are unflagged in Chrome, Firefox, Edge, and Safari so they\n * can be safely used.\n * See https://developer.mozilla.org/en-US/docs/Web/API/TextMetrics#Browser_compatibility\n */ const metrics = ctx.measureText(line);\n const left = x - metrics.actualBoundingBoxLeft;\n const right = x + metrics.actualBoundingBoxRight;\n const top = y - metrics.actualBoundingBoxAscent;\n const bottom = y + metrics.actualBoundingBoxDescent;\n const yDecoration = opts.strikethrough ? (top + bottom) / 2 : bottom;\n ctx.strokeStyle = ctx.fillStyle;\n ctx.beginPath();\n ctx.lineWidth = opts.decorationWidth || 2;\n ctx.moveTo(left, yDecoration);\n ctx.lineTo(right, yDecoration);\n ctx.stroke();\n }\n}\nfunction drawBackdrop(ctx, opts) {\n const oldColor = ctx.fillStyle;\n ctx.fillStyle = opts.color;\n ctx.fillRect(opts.left, opts.top, opts.width, opts.height);\n ctx.fillStyle = oldColor;\n}\n/**\n * Render text onto the canvas\n */ function renderText(ctx, text, x, y, font, opts = {}) {\n const lines = isArray(text) ? text : [\n text\n ];\n const stroke = opts.strokeWidth > 0 && opts.strokeColor !== '';\n let i, line;\n ctx.save();\n ctx.font = font.string;\n setRenderOpts(ctx, opts);\n for(i = 0; i < lines.length; ++i){\n line = lines[i];\n if (opts.backdrop) {\n drawBackdrop(ctx, opts.backdrop);\n }\n if (stroke) {\n if (opts.strokeColor) {\n ctx.strokeStyle = opts.strokeColor;\n }\n if (!isNullOrUndef(opts.strokeWidth)) {\n ctx.lineWidth = opts.strokeWidth;\n }\n ctx.strokeText(line, x, y, opts.maxWidth);\n }\n ctx.fillText(line, x, y, opts.maxWidth);\n decorateText(ctx, x, y, line, opts);\n y += Number(font.lineHeight);\n }\n ctx.restore();\n}\n/**\n * Add a path of a rectangle with rounded corners to the current sub-path\n * @param ctx - Context\n * @param rect - Bounding rect\n */ function addRoundedRectPath(ctx, rect) {\n const { x , y , w , h , radius } = rect;\n // top left arc\n ctx.arc(x + radius.topLeft, y + radius.topLeft, radius.topLeft, -HALF_PI, PI, true);\n // line from top left to bottom left\n ctx.lineTo(x, y + h - radius.bottomLeft);\n // bottom left arc\n ctx.arc(x + radius.bottomLeft, y + h - radius.bottomLeft, radius.bottomLeft, PI, HALF_PI, true);\n // line from bottom left to bottom right\n ctx.lineTo(x + w - radius.bottomRight, y + h);\n // bottom right arc\n ctx.arc(x + w - radius.bottomRight, y + h - radius.bottomRight, radius.bottomRight, HALF_PI, 0, true);\n // line from bottom right to top right\n ctx.lineTo(x + w, y + radius.topRight);\n // top right arc\n ctx.arc(x + w - radius.topRight, y + radius.topRight, radius.topRight, 0, -HALF_PI, true);\n // line from top right to top left\n ctx.lineTo(x + radius.topLeft, y);\n}\n\nconst LINE_HEIGHT = /^(normal|(\\d+(?:\\.\\d+)?)(px|em|%)?)$/;\nconst FONT_STYLE = /^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;\n/**\n * @alias Chart.helpers.options\n * @namespace\n */ /**\n * Converts the given line height `value` in pixels for a specific font `size`.\n * @param value - The lineHeight to parse (eg. 1.6, '14px', '75%', '1.6em').\n * @param size - The font size (in pixels) used to resolve relative `value`.\n * @returns The effective line height in pixels (size * 1.2 if value is invalid).\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/line-height\n * @since 2.7.0\n */ function toLineHeight(value, size) {\n const matches = ('' + value).match(LINE_HEIGHT);\n if (!matches || matches[1] === 'normal') {\n return size * 1.2;\n }\n value = +matches[2];\n switch(matches[3]){\n case 'px':\n return value;\n case '%':\n value /= 100;\n break;\n }\n return size * value;\n}\nconst numberOrZero = (v)=>+v || 0;\nfunction _readValueToProps(value, props) {\n const ret = {};\n const objProps = isObject(props);\n const keys = objProps ? Object.keys(props) : props;\n const read = isObject(value) ? objProps ? (prop)=>valueOrDefault(value[prop], value[props[prop]]) : (prop)=>value[prop] : ()=>value;\n for (const prop of keys){\n ret[prop] = numberOrZero(read(prop));\n }\n return ret;\n}\n/**\n * Converts the given value into a TRBL object.\n * @param value - If a number, set the value to all TRBL component,\n * else, if an object, use defined properties and sets undefined ones to 0.\n * x / y are shorthands for same value for left/right and top/bottom.\n * @returns The padding values (top, right, bottom, left)\n * @since 3.0.0\n */ function toTRBL(value) {\n return _readValueToProps(value, {\n top: 'y',\n right: 'x',\n bottom: 'y',\n left: 'x'\n });\n}\n/**\n * Converts the given value into a TRBL corners object (similar with css border-radius).\n * @param value - If a number, set the value to all TRBL corner components,\n * else, if an object, use defined properties and sets undefined ones to 0.\n * @returns The TRBL corner values (topLeft, topRight, bottomLeft, bottomRight)\n * @since 3.0.0\n */ function toTRBLCorners(value) {\n return _readValueToProps(value, [\n 'topLeft',\n 'topRight',\n 'bottomLeft',\n 'bottomRight'\n ]);\n}\n/**\n * Converts the given value into a padding object with pre-computed width/height.\n * @param value - If a number, set the value to all TRBL component,\n * else, if an object, use defined properties and sets undefined ones to 0.\n * x / y are shorthands for same value for left/right and top/bottom.\n * @returns The padding values (top, right, bottom, left, width, height)\n * @since 2.7.0\n */ function toPadding(value) {\n const obj = toTRBL(value);\n obj.width = obj.left + obj.right;\n obj.height = obj.top + obj.bottom;\n return obj;\n}\n/**\n * Parses font options and returns the font object.\n * @param options - A object that contains font options to be parsed.\n * @param fallback - A object that contains fallback font options.\n * @return The font object.\n * @private\n */ function toFont(options, fallback) {\n options = options || {};\n fallback = fallback || defaults.font;\n let size = valueOrDefault(options.size, fallback.size);\n if (typeof size === 'string') {\n size = parseInt(size, 10);\n }\n let style = valueOrDefault(options.style, fallback.style);\n if (style && !('' + style).match(FONT_STYLE)) {\n console.warn('Invalid font style specified: \"' + style + '\"');\n style = undefined;\n }\n const font = {\n family: valueOrDefault(options.family, fallback.family),\n lineHeight: toLineHeight(valueOrDefault(options.lineHeight, fallback.lineHeight), size),\n size,\n style,\n weight: valueOrDefault(options.weight, fallback.weight),\n string: ''\n };\n font.string = toFontString(font);\n return font;\n}\n/**\n * Evaluates the given `inputs` sequentially and returns the first defined value.\n * @param inputs - An array of values, falling back to the last value.\n * @param context - If defined and the current value is a function, the value\n * is called with `context` as first argument and the result becomes the new input.\n * @param index - If defined and the current value is an array, the value\n * at `index` become the new input.\n * @param info - object to return information about resolution in\n * @param info.cacheable - Will be set to `false` if option is not cacheable.\n * @since 2.7.0\n */ function resolve(inputs, context, index, info) {\n let cacheable = true;\n let i, ilen, value;\n for(i = 0, ilen = inputs.length; i < ilen; ++i){\n value = inputs[i];\n if (value === undefined) {\n continue;\n }\n if (context !== undefined && typeof value === 'function') {\n value = value(context);\n cacheable = false;\n }\n if (index !== undefined && isArray(value)) {\n value = value[index % value.length];\n cacheable = false;\n }\n if (value !== undefined) {\n if (info && !cacheable) {\n info.cacheable = false;\n }\n return value;\n }\n }\n}\n/**\n * @param minmax\n * @param grace\n * @param beginAtZero\n * @private\n */ function _addGrace(minmax, grace, beginAtZero) {\n const { min , max } = minmax;\n const change = toDimension(grace, (max - min) / 2);\n const keepZero = (value, add)=>beginAtZero && value === 0 ? 0 : value + add;\n return {\n min: keepZero(min, -Math.abs(change)),\n max: keepZero(max, change)\n };\n}\nfunction createContext(parentContext, context) {\n return Object.assign(Object.create(parentContext), context);\n}\n\n/**\n * Creates a Proxy for resolving raw values for options.\n * @param scopes - The option scopes to look for values, in resolution order\n * @param prefixes - The prefixes for values, in resolution order.\n * @param rootScopes - The root option scopes\n * @param fallback - Parent scopes fallback\n * @param getTarget - callback for getting the target for changed values\n * @returns Proxy\n * @private\n */ function _createResolver(scopes, prefixes = [\n ''\n], rootScopes, fallback, getTarget = ()=>scopes[0]) {\n const finalRootScopes = rootScopes || scopes;\n if (typeof fallback === 'undefined') {\n fallback = _resolve('_fallback', scopes);\n }\n const cache = {\n [Symbol.toStringTag]: 'Object',\n _cacheable: true,\n _scopes: scopes,\n _rootScopes: finalRootScopes,\n _fallback: fallback,\n _getTarget: getTarget,\n override: (scope)=>_createResolver([\n scope,\n ...scopes\n ], prefixes, finalRootScopes, fallback)\n };\n return new Proxy(cache, {\n /**\n * A trap for the delete operator.\n */ deleteProperty (target, prop) {\n delete target[prop]; // remove from cache\n delete target._keys; // remove cached keys\n delete scopes[0][prop]; // remove from top level scope\n return true;\n },\n /**\n * A trap for getting property values.\n */ get (target, prop) {\n return _cached(target, prop, ()=>_resolveWithPrefixes(prop, prefixes, scopes, target));\n },\n /**\n * A trap for Object.getOwnPropertyDescriptor.\n * Also used by Object.hasOwnProperty.\n */ getOwnPropertyDescriptor (target, prop) {\n return Reflect.getOwnPropertyDescriptor(target._scopes[0], prop);\n },\n /**\n * A trap for Object.getPrototypeOf.\n */ getPrototypeOf () {\n return Reflect.getPrototypeOf(scopes[0]);\n },\n /**\n * A trap for the in operator.\n */ has (target, prop) {\n return getKeysFromAllScopes(target).includes(prop);\n },\n /**\n * A trap for Object.getOwnPropertyNames and Object.getOwnPropertySymbols.\n */ ownKeys (target) {\n return getKeysFromAllScopes(target);\n },\n /**\n * A trap for setting property values.\n */ set (target, prop, value) {\n const storage = target._storage || (target._storage = getTarget());\n target[prop] = storage[prop] = value; // set to top level scope + cache\n delete target._keys; // remove cached keys\n return true;\n }\n });\n}\n/**\n * Returns an Proxy for resolving option values with context.\n * @param proxy - The Proxy returned by `_createResolver`\n * @param context - Context object for scriptable/indexable options\n * @param subProxy - The proxy provided for scriptable options\n * @param descriptorDefaults - Defaults for descriptors\n * @private\n */ function _attachContext(proxy, context, subProxy, descriptorDefaults) {\n const cache = {\n _cacheable: false,\n _proxy: proxy,\n _context: context,\n _subProxy: subProxy,\n _stack: new Set(),\n _descriptors: _descriptors(proxy, descriptorDefaults),\n setContext: (ctx)=>_attachContext(proxy, ctx, subProxy, descriptorDefaults),\n override: (scope)=>_attachContext(proxy.override(scope), context, subProxy, descriptorDefaults)\n };\n return new Proxy(cache, {\n /**\n * A trap for the delete operator.\n */ deleteProperty (target, prop) {\n delete target[prop]; // remove from cache\n delete proxy[prop]; // remove from proxy\n return true;\n },\n /**\n * A trap for getting property values.\n */ get (target, prop, receiver) {\n return _cached(target, prop, ()=>_resolveWithContext(target, prop, receiver));\n },\n /**\n * A trap for Object.getOwnPropertyDescriptor.\n * Also used by Object.hasOwnProperty.\n */ getOwnPropertyDescriptor (target, prop) {\n return target._descriptors.allKeys ? Reflect.has(proxy, prop) ? {\n enumerable: true,\n configurable: true\n } : undefined : Reflect.getOwnPropertyDescriptor(proxy, prop);\n },\n /**\n * A trap for Object.getPrototypeOf.\n */ getPrototypeOf () {\n return Reflect.getPrototypeOf(proxy);\n },\n /**\n * A trap for the in operator.\n */ has (target, prop) {\n return Reflect.has(proxy, prop);\n },\n /**\n * A trap for Object.getOwnPropertyNames and Object.getOwnPropertySymbols.\n */ ownKeys () {\n return Reflect.ownKeys(proxy);\n },\n /**\n * A trap for setting property values.\n */ set (target, prop, value) {\n proxy[prop] = value; // set to proxy\n delete target[prop]; // remove from cache\n return true;\n }\n });\n}\n/**\n * @private\n */ function _descriptors(proxy, defaults = {\n scriptable: true,\n indexable: true\n}) {\n const { _scriptable =defaults.scriptable , _indexable =defaults.indexable , _allKeys =defaults.allKeys } = proxy;\n return {\n allKeys: _allKeys,\n scriptable: _scriptable,\n indexable: _indexable,\n isScriptable: isFunction(_scriptable) ? _scriptable : ()=>_scriptable,\n isIndexable: isFunction(_indexable) ? _indexable : ()=>_indexable\n };\n}\nconst readKey = (prefix, name)=>prefix ? prefix + _capitalize(name) : name;\nconst needsSubResolver = (prop, value)=>isObject(value) && prop !== 'adapters' && (Object.getPrototypeOf(value) === null || value.constructor === Object);\nfunction _cached(target, prop, resolve) {\n if (Object.prototype.hasOwnProperty.call(target, prop)) {\n return target[prop];\n }\n const value = resolve();\n // cache the resolved value\n target[prop] = value;\n return value;\n}\nfunction _resolveWithContext(target, prop, receiver) {\n const { _proxy , _context , _subProxy , _descriptors: descriptors } = target;\n let value = _proxy[prop]; // resolve from proxy\n // resolve with context\n if (isFunction(value) && descriptors.isScriptable(prop)) {\n value = _resolveScriptable(prop, value, target, receiver);\n }\n if (isArray(value) && value.length) {\n value = _resolveArray(prop, value, target, descriptors.isIndexable);\n }\n if (needsSubResolver(prop, value)) {\n // if the resolved value is an object, create a sub resolver for it\n value = _attachContext(value, _context, _subProxy && _subProxy[prop], descriptors);\n }\n return value;\n}\nfunction _resolveScriptable(prop, getValue, target, receiver) {\n const { _proxy , _context , _subProxy , _stack } = target;\n if (_stack.has(prop)) {\n throw new Error('Recursion detected: ' + Array.from(_stack).join('->') + '->' + prop);\n }\n _stack.add(prop);\n let value = getValue(_context, _subProxy || receiver);\n _stack.delete(prop);\n if (needsSubResolver(prop, value)) {\n // When scriptable option returns an object, create a resolver on that.\n value = createSubResolver(_proxy._scopes, _proxy, prop, value);\n }\n return value;\n}\nfunction _resolveArray(prop, value, target, isIndexable) {\n const { _proxy , _context , _subProxy , _descriptors: descriptors } = target;\n if (typeof _context.index !== 'undefined' && isIndexable(prop)) {\n return value[_context.index % value.length];\n } else if (isObject(value[0])) {\n // Array of objects, return array or resolvers\n const arr = value;\n const scopes = _proxy._scopes.filter((s)=>s !== arr);\n value = [];\n for (const item of arr){\n const resolver = createSubResolver(scopes, _proxy, prop, item);\n value.push(_attachContext(resolver, _context, _subProxy && _subProxy[prop], descriptors));\n }\n }\n return value;\n}\nfunction resolveFallback(fallback, prop, value) {\n return isFunction(fallback) ? fallback(prop, value) : fallback;\n}\nconst getScope = (key, parent)=>key === true ? parent : typeof key === 'string' ? resolveObjectKey(parent, key) : undefined;\nfunction addScopes(set, parentScopes, key, parentFallback, value) {\n for (const parent of parentScopes){\n const scope = getScope(key, parent);\n if (scope) {\n set.add(scope);\n const fallback = resolveFallback(scope._fallback, key, value);\n if (typeof fallback !== 'undefined' && fallback !== key && fallback !== parentFallback) {\n // When we reach the descriptor that defines a new _fallback, return that.\n // The fallback will resume to that new scope.\n return fallback;\n }\n } else if (scope === false && typeof parentFallback !== 'undefined' && key !== parentFallback) {\n // Fallback to `false` results to `false`, when falling back to different key.\n // For example `interaction` from `hover` or `plugins.tooltip` and `animation` from `animations`\n return null;\n }\n }\n return false;\n}\nfunction createSubResolver(parentScopes, resolver, prop, value) {\n const rootScopes = resolver._rootScopes;\n const fallback = resolveFallback(resolver._fallback, prop, value);\n const allScopes = [\n ...parentScopes,\n ...rootScopes\n ];\n const set = new Set();\n set.add(value);\n let key = addScopesFromKey(set, allScopes, prop, fallback || prop, value);\n if (key === null) {\n return false;\n }\n if (typeof fallback !== 'undefined' && fallback !== prop) {\n key = addScopesFromKey(set, allScopes, fallback, key, value);\n if (key === null) {\n return false;\n }\n }\n return _createResolver(Array.from(set), [\n ''\n ], rootScopes, fallback, ()=>subGetTarget(resolver, prop, value));\n}\nfunction addScopesFromKey(set, allScopes, key, fallback, item) {\n while(key){\n key = addScopes(set, allScopes, key, fallback, item);\n }\n return key;\n}\nfunction subGetTarget(resolver, prop, value) {\n const parent = resolver._getTarget();\n if (!(prop in parent)) {\n parent[prop] = {};\n }\n const target = parent[prop];\n if (isArray(target) && isObject(value)) {\n // For array of objects, the object is used to store updated values\n return value;\n }\n return target || {};\n}\nfunction _resolveWithPrefixes(prop, prefixes, scopes, proxy) {\n let value;\n for (const prefix of prefixes){\n value = _resolve(readKey(prefix, prop), scopes);\n if (typeof value !== 'undefined') {\n return needsSubResolver(prop, value) ? createSubResolver(scopes, proxy, prop, value) : value;\n }\n }\n}\nfunction _resolve(key, scopes) {\n for (const scope of scopes){\n if (!scope) {\n continue;\n }\n const value = scope[key];\n if (typeof value !== 'undefined') {\n return value;\n }\n }\n}\nfunction getKeysFromAllScopes(target) {\n let keys = target._keys;\n if (!keys) {\n keys = target._keys = resolveKeysFromAllScopes(target._scopes);\n }\n return keys;\n}\nfunction resolveKeysFromAllScopes(scopes) {\n const set = new Set();\n for (const scope of scopes){\n for (const key of Object.keys(scope).filter((k)=>!k.startsWith('_'))){\n set.add(key);\n }\n }\n return Array.from(set);\n}\nfunction _parseObjectDataRadialScale(meta, data, start, count) {\n const { iScale } = meta;\n const { key ='r' } = this._parsing;\n const parsed = new Array(count);\n let i, ilen, index, item;\n for(i = 0, ilen = count; i < ilen; ++i){\n index = i + start;\n item = data[index];\n parsed[i] = {\n r: iScale.parse(resolveObjectKey(item, key), index)\n };\n }\n return parsed;\n}\n\nconst EPSILON = Number.EPSILON || 1e-14;\nconst getPoint = (points, i)=>i < points.length && !points[i].skip && points[i];\nconst getValueAxis = (indexAxis)=>indexAxis === 'x' ? 'y' : 'x';\nfunction splineCurve(firstPoint, middlePoint, afterPoint, t) {\n // Props to Rob Spencer at scaled innovation for his post on splining between points\n // http://scaledinnovation.com/analytics/splines/aboutSplines.html\n // This function must also respect \"skipped\" points\n const previous = firstPoint.skip ? middlePoint : firstPoint;\n const current = middlePoint;\n const next = afterPoint.skip ? middlePoint : afterPoint;\n const d01 = distanceBetweenPoints(current, previous);\n const d12 = distanceBetweenPoints(next, current);\n let s01 = d01 / (d01 + d12);\n let s12 = d12 / (d01 + d12);\n // If all points are the same, s01 & s02 will be inf\n s01 = isNaN(s01) ? 0 : s01;\n s12 = isNaN(s12) ? 0 : s12;\n const fa = t * s01; // scaling factor for triangle Ta\n const fb = t * s12;\n return {\n previous: {\n x: current.x - fa * (next.x - previous.x),\n y: current.y - fa * (next.y - previous.y)\n },\n next: {\n x: current.x + fb * (next.x - previous.x),\n y: current.y + fb * (next.y - previous.y)\n }\n };\n}\n/**\n * Adjust tangents to ensure monotonic properties\n */ function monotoneAdjust(points, deltaK, mK) {\n const pointsLen = points.length;\n let alphaK, betaK, tauK, squaredMagnitude, pointCurrent;\n let pointAfter = getPoint(points, 0);\n for(let i = 0; i < pointsLen - 1; ++i){\n pointCurrent = pointAfter;\n pointAfter = getPoint(points, i + 1);\n if (!pointCurrent || !pointAfter) {\n continue;\n }\n if (almostEquals(deltaK[i], 0, EPSILON)) {\n mK[i] = mK[i + 1] = 0;\n continue;\n }\n alphaK = mK[i] / deltaK[i];\n betaK = mK[i + 1] / deltaK[i];\n squaredMagnitude = Math.pow(alphaK, 2) + Math.pow(betaK, 2);\n if (squaredMagnitude <= 9) {\n continue;\n }\n tauK = 3 / Math.sqrt(squaredMagnitude);\n mK[i] = alphaK * tauK * deltaK[i];\n mK[i + 1] = betaK * tauK * deltaK[i];\n }\n}\nfunction monotoneCompute(points, mK, indexAxis = 'x') {\n const valueAxis = getValueAxis(indexAxis);\n const pointsLen = points.length;\n let delta, pointBefore, pointCurrent;\n let pointAfter = getPoint(points, 0);\n for(let i = 0; i < pointsLen; ++i){\n pointBefore = pointCurrent;\n pointCurrent = pointAfter;\n pointAfter = getPoint(points, i + 1);\n if (!pointCurrent) {\n continue;\n }\n const iPixel = pointCurrent[indexAxis];\n const vPixel = pointCurrent[valueAxis];\n if (pointBefore) {\n delta = (iPixel - pointBefore[indexAxis]) / 3;\n pointCurrent[`cp1${indexAxis}`] = iPixel - delta;\n pointCurrent[`cp1${valueAxis}`] = vPixel - delta * mK[i];\n }\n if (pointAfter) {\n delta = (pointAfter[indexAxis] - iPixel) / 3;\n pointCurrent[`cp2${indexAxis}`] = iPixel + delta;\n pointCurrent[`cp2${valueAxis}`] = vPixel + delta * mK[i];\n }\n }\n}\n/**\n * This function calculates Bézier control points in a similar way than |splineCurve|,\n * but preserves monotonicity of the provided data and ensures no local extremums are added\n * between the dataset discrete points due to the interpolation.\n * See : https://en.wikipedia.org/wiki/Monotone_cubic_interpolation\n */ function splineCurveMonotone(points, indexAxis = 'x') {\n const valueAxis = getValueAxis(indexAxis);\n const pointsLen = points.length;\n const deltaK = Array(pointsLen).fill(0);\n const mK = Array(pointsLen);\n // Calculate slopes (deltaK) and initialize tangents (mK)\n let i, pointBefore, pointCurrent;\n let pointAfter = getPoint(points, 0);\n for(i = 0; i < pointsLen; ++i){\n pointBefore = pointCurrent;\n pointCurrent = pointAfter;\n pointAfter = getPoint(points, i + 1);\n if (!pointCurrent) {\n continue;\n }\n if (pointAfter) {\n const slopeDelta = pointAfter[indexAxis] - pointCurrent[indexAxis];\n // In the case of two points that appear at the same x pixel, slopeDeltaX is 0\n deltaK[i] = slopeDelta !== 0 ? (pointAfter[valueAxis] - pointCurrent[valueAxis]) / slopeDelta : 0;\n }\n mK[i] = !pointBefore ? deltaK[i] : !pointAfter ? deltaK[i - 1] : sign(deltaK[i - 1]) !== sign(deltaK[i]) ? 0 : (deltaK[i - 1] + deltaK[i]) / 2;\n }\n monotoneAdjust(points, deltaK, mK);\n monotoneCompute(points, mK, indexAxis);\n}\nfunction capControlPoint(pt, min, max) {\n return Math.max(Math.min(pt, max), min);\n}\nfunction capBezierPoints(points, area) {\n let i, ilen, point, inArea, inAreaPrev;\n let inAreaNext = _isPointInArea(points[0], area);\n for(i = 0, ilen = points.length; i < ilen; ++i){\n inAreaPrev = inArea;\n inArea = inAreaNext;\n inAreaNext = i < ilen - 1 && _isPointInArea(points[i + 1], area);\n if (!inArea) {\n continue;\n }\n point = points[i];\n if (inAreaPrev) {\n point.cp1x = capControlPoint(point.cp1x, area.left, area.right);\n point.cp1y = capControlPoint(point.cp1y, area.top, area.bottom);\n }\n if (inAreaNext) {\n point.cp2x = capControlPoint(point.cp2x, area.left, area.right);\n point.cp2y = capControlPoint(point.cp2y, area.top, area.bottom);\n }\n }\n}\n/**\n * @private\n */ function _updateBezierControlPoints(points, options, area, loop, indexAxis) {\n let i, ilen, point, controlPoints;\n // Only consider points that are drawn in case the spanGaps option is used\n if (options.spanGaps) {\n points = points.filter((pt)=>!pt.skip);\n }\n if (options.cubicInterpolationMode === 'monotone') {\n splineCurveMonotone(points, indexAxis);\n } else {\n let prev = loop ? points[points.length - 1] : points[0];\n for(i = 0, ilen = points.length; i < ilen; ++i){\n point = points[i];\n controlPoints = splineCurve(prev, point, points[Math.min(i + 1, ilen - (loop ? 0 : 1)) % ilen], options.tension);\n point.cp1x = controlPoints.previous.x;\n point.cp1y = controlPoints.previous.y;\n point.cp2x = controlPoints.next.x;\n point.cp2y = controlPoints.next.y;\n prev = point;\n }\n }\n if (options.capBezierPoints) {\n capBezierPoints(points, area);\n }\n}\n\n/**\n * Note: typedefs are auto-exported, so use a made-up `dom` namespace where\n * necessary to avoid duplicates with `export * from './helpers`; see\n * https://github.com/microsoft/TypeScript/issues/46011\n * @typedef { import('../core/core.controller.js').default } dom.Chart\n * @typedef { import('../../types').ChartEvent } ChartEvent\n */ /**\n * @private\n */ function _isDomSupported() {\n return typeof window !== 'undefined' && typeof document !== 'undefined';\n}\n/**\n * @private\n */ function _getParentNode(domNode) {\n let parent = domNode.parentNode;\n if (parent && parent.toString() === '[object ShadowRoot]') {\n parent = parent.host;\n }\n return parent;\n}\n/**\n * convert max-width/max-height values that may be percentages into a number\n * @private\n */ function parseMaxStyle(styleValue, node, parentProperty) {\n let valueInPixels;\n if (typeof styleValue === 'string') {\n valueInPixels = parseInt(styleValue, 10);\n if (styleValue.indexOf('%') !== -1) {\n // percentage * size in dimension\n valueInPixels = valueInPixels / 100 * node.parentNode[parentProperty];\n }\n } else {\n valueInPixels = styleValue;\n }\n return valueInPixels;\n}\nconst getComputedStyle = (element)=>element.ownerDocument.defaultView.getComputedStyle(element, null);\nfunction getStyle(el, property) {\n return getComputedStyle(el).getPropertyValue(property);\n}\nconst positions = [\n 'top',\n 'right',\n 'bottom',\n 'left'\n];\nfunction getPositionedStyle(styles, style, suffix) {\n const result = {};\n suffix = suffix ? '-' + suffix : '';\n for(let i = 0; i < 4; i++){\n const pos = positions[i];\n result[pos] = parseFloat(styles[style + '-' + pos + suffix]) || 0;\n }\n result.width = result.left + result.right;\n result.height = result.top + result.bottom;\n return result;\n}\nconst useOffsetPos = (x, y, target)=>(x > 0 || y > 0) && (!target || !target.shadowRoot);\n/**\n * @param e\n * @param canvas\n * @returns Canvas position\n */ function getCanvasPosition(e, canvas) {\n const touches = e.touches;\n const source = touches && touches.length ? touches[0] : e;\n const { offsetX , offsetY } = source;\n let box = false;\n let x, y;\n if (useOffsetPos(offsetX, offsetY, e.target)) {\n x = offsetX;\n y = offsetY;\n } else {\n const rect = canvas.getBoundingClientRect();\n x = source.clientX - rect.left;\n y = source.clientY - rect.top;\n box = true;\n }\n return {\n x,\n y,\n box\n };\n}\n/**\n * Gets an event's x, y coordinates, relative to the chart area\n * @param event\n * @param chart\n * @returns x and y coordinates of the event\n */ function getRelativePosition(event, chart) {\n if ('native' in event) {\n return event;\n }\n const { canvas , currentDevicePixelRatio } = chart;\n const style = getComputedStyle(canvas);\n const borderBox = style.boxSizing === 'border-box';\n const paddings = getPositionedStyle(style, 'padding');\n const borders = getPositionedStyle(style, 'border', 'width');\n const { x , y , box } = getCanvasPosition(event, canvas);\n const xOffset = paddings.left + (box && borders.left);\n const yOffset = paddings.top + (box && borders.top);\n let { width , height } = chart;\n if (borderBox) {\n width -= paddings.width + borders.width;\n height -= paddings.height + borders.height;\n }\n return {\n x: Math.round((x - xOffset) / width * canvas.width / currentDevicePixelRatio),\n y: Math.round((y - yOffset) / height * canvas.height / currentDevicePixelRatio)\n };\n}\nfunction getContainerSize(canvas, width, height) {\n let maxWidth, maxHeight;\n if (width === undefined || height === undefined) {\n const container = _getParentNode(canvas);\n if (!container) {\n width = canvas.clientWidth;\n height = canvas.clientHeight;\n } else {\n const rect = container.getBoundingClientRect(); // this is the border box of the container\n const containerStyle = getComputedStyle(container);\n const containerBorder = getPositionedStyle(containerStyle, 'border', 'width');\n const containerPadding = getPositionedStyle(containerStyle, 'padding');\n width = rect.width - containerPadding.width - containerBorder.width;\n height = rect.height - containerPadding.height - containerBorder.height;\n maxWidth = parseMaxStyle(containerStyle.maxWidth, container, 'clientWidth');\n maxHeight = parseMaxStyle(containerStyle.maxHeight, container, 'clientHeight');\n }\n }\n return {\n width,\n height,\n maxWidth: maxWidth || INFINITY,\n maxHeight: maxHeight || INFINITY\n };\n}\nconst round1 = (v)=>Math.round(v * 10) / 10;\n// eslint-disable-next-line complexity\nfunction getMaximumSize(canvas, bbWidth, bbHeight, aspectRatio) {\n const style = getComputedStyle(canvas);\n const margins = getPositionedStyle(style, 'margin');\n const maxWidth = parseMaxStyle(style.maxWidth, canvas, 'clientWidth') || INFINITY;\n const maxHeight = parseMaxStyle(style.maxHeight, canvas, 'clientHeight') || INFINITY;\n const containerSize = getContainerSize(canvas, bbWidth, bbHeight);\n let { width , height } = containerSize;\n if (style.boxSizing === 'content-box') {\n const borders = getPositionedStyle(style, 'border', 'width');\n const paddings = getPositionedStyle(style, 'padding');\n width -= paddings.width + borders.width;\n height -= paddings.height + borders.height;\n }\n width = Math.max(0, width - margins.width);\n height = Math.max(0, aspectRatio ? width / aspectRatio : height - margins.height);\n width = round1(Math.min(width, maxWidth, containerSize.maxWidth));\n height = round1(Math.min(height, maxHeight, containerSize.maxHeight));\n if (width && !height) {\n // https://github.com/chartjs/Chart.js/issues/4659\n // If the canvas has width, but no height, default to aspectRatio of 2 (canvas default)\n height = round1(width / 2);\n }\n const maintainHeight = bbWidth !== undefined || bbHeight !== undefined;\n if (maintainHeight && aspectRatio && containerSize.height && height > containerSize.height) {\n height = containerSize.height;\n width = round1(Math.floor(height * aspectRatio));\n }\n return {\n width,\n height\n };\n}\n/**\n * @param chart\n * @param forceRatio\n * @param forceStyle\n * @returns True if the canvas context size or transformation has changed.\n */ function retinaScale(chart, forceRatio, forceStyle) {\n const pixelRatio = forceRatio || 1;\n const deviceHeight = Math.floor(chart.height * pixelRatio);\n const deviceWidth = Math.floor(chart.width * pixelRatio);\n chart.height = Math.floor(chart.height);\n chart.width = Math.floor(chart.width);\n const canvas = chart.canvas;\n // If no style has been set on the canvas, the render size is used as display size,\n // making the chart visually bigger, so let's enforce it to the \"correct\" values.\n // See https://github.com/chartjs/Chart.js/issues/3575\n if (canvas.style && (forceStyle || !canvas.style.height && !canvas.style.width)) {\n canvas.style.height = `${chart.height}px`;\n canvas.style.width = `${chart.width}px`;\n }\n if (chart.currentDevicePixelRatio !== pixelRatio || canvas.height !== deviceHeight || canvas.width !== deviceWidth) {\n chart.currentDevicePixelRatio = pixelRatio;\n canvas.height = deviceHeight;\n canvas.width = deviceWidth;\n chart.ctx.setTransform(pixelRatio, 0, 0, pixelRatio, 0, 0);\n return true;\n }\n return false;\n}\n/**\n * Detects support for options object argument in addEventListener.\n * https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Safely_detecting_option_support\n * @private\n */ const supportsEventListenerOptions = function() {\n let passiveSupported = false;\n try {\n const options = {\n get passive () {\n passiveSupported = true;\n return false;\n }\n };\n window.addEventListener('test', null, options);\n window.removeEventListener('test', null, options);\n } catch (e) {\n // continue regardless of error\n }\n return passiveSupported;\n}();\n/**\n * The \"used\" size is the final value of a dimension property after all calculations have\n * been performed. This method uses the computed style of `element` but returns undefined\n * if the computed style is not expressed in pixels. That can happen in some cases where\n * `element` has a size relative to its parent and this last one is not yet displayed,\n * for example because of `display: none` on a parent node.\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/used_value\n * @returns Size in pixels or undefined if unknown.\n */ function readUsedSize(element, property) {\n const value = getStyle(element, property);\n const matches = value && value.match(/^(\\d+)(\\.\\d+)?px$/);\n return matches ? +matches[1] : undefined;\n}\n\n/**\n * @private\n */ function _pointInLine(p1, p2, t, mode) {\n return {\n x: p1.x + t * (p2.x - p1.x),\n y: p1.y + t * (p2.y - p1.y)\n };\n}\n/**\n * @private\n */ function _steppedInterpolation(p1, p2, t, mode) {\n return {\n x: p1.x + t * (p2.x - p1.x),\n y: mode === 'middle' ? t < 0.5 ? p1.y : p2.y : mode === 'after' ? t < 1 ? p1.y : p2.y : t > 0 ? p2.y : p1.y\n };\n}\n/**\n * @private\n */ function _bezierInterpolation(p1, p2, t, mode) {\n const cp1 = {\n x: p1.cp2x,\n y: p1.cp2y\n };\n const cp2 = {\n x: p2.cp1x,\n y: p2.cp1y\n };\n const a = _pointInLine(p1, cp1, t);\n const b = _pointInLine(cp1, cp2, t);\n const c = _pointInLine(cp2, p2, t);\n const d = _pointInLine(a, b, t);\n const e = _pointInLine(b, c, t);\n return _pointInLine(d, e, t);\n}\n\nconst getRightToLeftAdapter = function(rectX, width) {\n return {\n x (x) {\n return rectX + rectX + width - x;\n },\n setWidth (w) {\n width = w;\n },\n textAlign (align) {\n if (align === 'center') {\n return align;\n }\n return align === 'right' ? 'left' : 'right';\n },\n xPlus (x, value) {\n return x - value;\n },\n leftForLtr (x, itemWidth) {\n return x - itemWidth;\n }\n };\n};\nconst getLeftToRightAdapter = function() {\n return {\n x (x) {\n return x;\n },\n setWidth (w) {},\n textAlign (align) {\n return align;\n },\n xPlus (x, value) {\n return x + value;\n },\n leftForLtr (x, _itemWidth) {\n return x;\n }\n };\n};\nfunction getRtlAdapter(rtl, rectX, width) {\n return rtl ? getRightToLeftAdapter(rectX, width) : getLeftToRightAdapter();\n}\nfunction overrideTextDirection(ctx, direction) {\n let style, original;\n if (direction === 'ltr' || direction === 'rtl') {\n style = ctx.canvas.style;\n original = [\n style.getPropertyValue('direction'),\n style.getPropertyPriority('direction')\n ];\n style.setProperty('direction', direction, 'important');\n ctx.prevTextDirection = original;\n }\n}\nfunction restoreTextDirection(ctx, original) {\n if (original !== undefined) {\n delete ctx.prevTextDirection;\n ctx.canvas.style.setProperty('direction', original[0], original[1]);\n }\n}\n\nfunction propertyFn(property) {\n if (property === 'angle') {\n return {\n between: _angleBetween,\n compare: _angleDiff,\n normalize: _normalizeAngle\n };\n }\n return {\n between: _isBetween,\n compare: (a, b)=>a - b,\n normalize: (x)=>x\n };\n}\nfunction normalizeSegment({ start , end , count , loop , style }) {\n return {\n start: start % count,\n end: end % count,\n loop: loop && (end - start + 1) % count === 0,\n style\n };\n}\nfunction getSegment(segment, points, bounds) {\n const { property , start: startBound , end: endBound } = bounds;\n const { between , normalize } = propertyFn(property);\n const count = points.length;\n let { start , end , loop } = segment;\n let i, ilen;\n if (loop) {\n start += count;\n end += count;\n for(i = 0, ilen = count; i < ilen; ++i){\n if (!between(normalize(points[start % count][property]), startBound, endBound)) {\n break;\n }\n start--;\n end--;\n }\n start %= count;\n end %= count;\n }\n if (end < start) {\n end += count;\n }\n return {\n start,\n end,\n loop,\n style: segment.style\n };\n}\n function _boundSegment(segment, points, bounds) {\n if (!bounds) {\n return [\n segment\n ];\n }\n const { property , start: startBound , end: endBound } = bounds;\n const count = points.length;\n const { compare , between , normalize } = propertyFn(property);\n const { start , end , loop , style } = getSegment(segment, points, bounds);\n const result = [];\n let inside = false;\n let subStart = null;\n let value, point, prevValue;\n const startIsBefore = ()=>between(startBound, prevValue, value) && compare(startBound, prevValue) !== 0;\n const endIsBefore = ()=>compare(endBound, value) === 0 || between(endBound, prevValue, value);\n const shouldStart = ()=>inside || startIsBefore();\n const shouldStop = ()=>!inside || endIsBefore();\n for(let i = start, prev = start; i <= end; ++i){\n point = points[i % count];\n if (point.skip) {\n continue;\n }\n value = normalize(point[property]);\n if (value === prevValue) {\n continue;\n }\n inside = between(value, startBound, endBound);\n if (subStart === null && shouldStart()) {\n subStart = compare(value, startBound) === 0 ? i : prev;\n }\n if (subStart !== null && shouldStop()) {\n result.push(normalizeSegment({\n start: subStart,\n end: i,\n loop,\n count,\n style\n }));\n subStart = null;\n }\n prev = i;\n prevValue = value;\n }\n if (subStart !== null) {\n result.push(normalizeSegment({\n start: subStart,\n end,\n loop,\n count,\n style\n }));\n }\n return result;\n}\n function _boundSegments(line, bounds) {\n const result = [];\n const segments = line.segments;\n for(let i = 0; i < segments.length; i++){\n const sub = _boundSegment(segments[i], line.points, bounds);\n if (sub.length) {\n result.push(...sub);\n }\n }\n return result;\n}\n function findStartAndEnd(points, count, loop, spanGaps) {\n let start = 0;\n let end = count - 1;\n if (loop && !spanGaps) {\n while(start < count && !points[start].skip){\n start++;\n }\n }\n while(start < count && points[start].skip){\n start++;\n }\n start %= count;\n if (loop) {\n end += start;\n }\n while(end > start && points[end % count].skip){\n end--;\n }\n end %= count;\n return {\n start,\n end\n };\n}\n function solidSegments(points, start, max, loop) {\n const count = points.length;\n const result = [];\n let last = start;\n let prev = points[start];\n let end;\n for(end = start + 1; end <= max; ++end){\n const cur = points[end % count];\n if (cur.skip || cur.stop) {\n if (!prev.skip) {\n loop = false;\n result.push({\n start: start % count,\n end: (end - 1) % count,\n loop\n });\n start = last = cur.stop ? end : null;\n }\n } else {\n last = end;\n if (prev.skip) {\n start = end;\n }\n }\n prev = cur;\n }\n if (last !== null) {\n result.push({\n start: start % count,\n end: last % count,\n loop\n });\n }\n return result;\n}\n function _computeSegments(line, segmentOptions) {\n const points = line.points;\n const spanGaps = line.options.spanGaps;\n const count = points.length;\n if (!count) {\n return [];\n }\n const loop = !!line._loop;\n const { start , end } = findStartAndEnd(points, count, loop, spanGaps);\n if (spanGaps === true) {\n return splitByStyles(line, [\n {\n start,\n end,\n loop\n }\n ], points, segmentOptions);\n }\n const max = end < start ? end + count : end;\n const completeLoop = !!line._fullLoop && start === 0 && end === count - 1;\n return splitByStyles(line, solidSegments(points, start, max, completeLoop), points, segmentOptions);\n}\n function splitByStyles(line, segments, points, segmentOptions) {\n if (!segmentOptions || !segmentOptions.setContext || !points) {\n return segments;\n }\n return doSplitByStyles(line, segments, points, segmentOptions);\n}\n function doSplitByStyles(line, segments, points, segmentOptions) {\n const chartContext = line._chart.getContext();\n const baseStyle = readStyle(line.options);\n const { _datasetIndex: datasetIndex , options: { spanGaps } } = line;\n const count = points.length;\n const result = [];\n let prevStyle = baseStyle;\n let start = segments[0].start;\n let i = start;\n function addStyle(s, e, l, st) {\n const dir = spanGaps ? -1 : 1;\n if (s === e) {\n return;\n }\n s += count;\n while(points[s % count].skip){\n s -= dir;\n }\n while(points[e % count].skip){\n e += dir;\n }\n if (s % count !== e % count) {\n result.push({\n start: s % count,\n end: e % count,\n loop: l,\n style: st\n });\n prevStyle = st;\n start = e % count;\n }\n }\n for (const segment of segments){\n start = spanGaps ? start : segment.start;\n let prev = points[start % count];\n let style;\n for(i = start + 1; i <= segment.end; i++){\n const pt = points[i % count];\n style = readStyle(segmentOptions.setContext(createContext(chartContext, {\n type: 'segment',\n p0: prev,\n p1: pt,\n p0DataIndex: (i - 1) % count,\n p1DataIndex: i % count,\n datasetIndex\n })));\n if (styleChanged(style, prevStyle)) {\n addStyle(start, i - 1, segment.loop, prevStyle);\n }\n prev = pt;\n prevStyle = style;\n }\n if (start < i - 1) {\n addStyle(start, i - 1, segment.loop, prevStyle);\n }\n }\n return result;\n}\nfunction readStyle(options) {\n return {\n backgroundColor: options.backgroundColor,\n borderCapStyle: options.borderCapStyle,\n borderDash: options.borderDash,\n borderDashOffset: options.borderDashOffset,\n borderJoinStyle: options.borderJoinStyle,\n borderWidth: options.borderWidth,\n borderColor: options.borderColor\n };\n}\nfunction styleChanged(style, prevStyle) {\n if (!prevStyle) {\n return false;\n }\n const cache = [];\n const replacer = function(key, value) {\n if (!isPatternOrGradient(value)) {\n return value;\n }\n if (!cache.includes(value)) {\n cache.push(value);\n }\n return cache.indexOf(value);\n };\n return JSON.stringify(style, replacer) !== JSON.stringify(prevStyle, replacer);\n}\n\nexport { unclipArea as $, _rlookupByKey as A, _lookupByKey as B, _isPointInArea as C, getAngleFromPoint as D, toPadding as E, each as F, getMaximumSize as G, HALF_PI as H, _getParentNode as I, readUsedSize as J, supportsEventListenerOptions as K, throttled as L, _isDomSupported as M, _factorize as N, finiteOrDefault as O, PI as P, callback as Q, _addGrace as R, _limitValue as S, TAU as T, toDegrees as U, _measureText as V, _int16Range as W, _alignPixel as X, clipArea as Y, renderText as Z, _arrayUnique as _, resolve as a, fontString as a$, toFont as a0, _toLeftRightCenter as a1, _alignStartEnd as a2, overrides as a3, merge as a4, _capitalize as a5, descriptors as a6, isFunction as a7, _attachContext as a8, _createResolver as a9, overrideTextDirection as aA, _textX as aB, restoreTextDirection as aC, drawPointLegend as aD, distanceBetweenPoints as aE, noop as aF, _setMinAndMaxByKey as aG, niceNum as aH, almostWhole as aI, almostEquals as aJ, _decimalPlaces as aK, Ticks as aL, log10 as aM, _longestText as aN, _filterBetween as aO, _lookup as aP, isPatternOrGradient as aQ, getHoverColor as aR, clone as aS, _merger as aT, _mergerIf as aU, _deprecated as aV, _splitKey as aW, toFontString as aX, splineCurve as aY, splineCurveMonotone as aZ, getStyle as a_, _descriptors as aa, mergeIf as ab, uid as ac, debounce as ad, retinaScale as ae, clearCanvas as af, setsEqual as ag, _elementsEqual as ah, _isClickEvent as ai, _isBetween as aj, _readValueToProps as ak, _updateBezierControlPoints as al, _computeSegments as am, _boundSegments as an, _steppedInterpolation as ao, _bezierInterpolation as ap, _pointInLine as aq, _steppedLineTo as ar, _bezierCurveTo as as, drawPoint as at, addRoundedRectPath as au, toTRBL as av, toTRBLCorners as aw, _boundSegment as ax, _normalizeAngle as ay, getRtlAdapter as az, isArray as b, toLineHeight as b0, PITAU as b1, INFINITY as b2, RAD_PER_DEG as b3, QUARTER_PI as b4, TWO_THIRDS_PI as b5, _angleDiff as b6, color as c, defaults as d, effects as e, resolveObjectKey as f, isNumberFinite as g, defined as h, isObject as i, createContext as j, isNullOrUndef as k, listenArrayEvents as l, toPercentage as m, toDimension as n, formatNumber as o, _angleBetween as p, _getStartAndCountOfVisiblePoints as q, requestAnimFrame as r, sign as s, toRadians as t, unlistenArrayEvents as u, valueOrDefault as v, _scaleRangesChanged as w, isNumber as x, _parseObjectDataRadialScale as y, getRelativePosition as z };\n//# sourceMappingURL=helpers.segment.js.map\n","/*!\n * Chart.js v4.3.3\n * https://www.chartjs.org\n * (c) 2023 Chart.js Contributors\n * Released under the MIT License\n */\nimport { r as requestAnimFrame, a as resolve, e as effects, c as color, i as isObject, d as defaults, b as isArray, v as valueOrDefault, u as unlistenArrayEvents, l as listenArrayEvents, f as resolveObjectKey, g as isNumberFinite, h as defined, s as sign, j as createContext, k as isNullOrUndef, _ as _arrayUnique, t as toRadians, m as toPercentage, n as toDimension, T as TAU, o as formatNumber, p as _angleBetween, H as HALF_PI, P as PI, q as _getStartAndCountOfVisiblePoints, w as _scaleRangesChanged, x as isNumber, y as _parseObjectDataRadialScale, z as getRelativePosition, A as _rlookupByKey, B as _lookupByKey, C as _isPointInArea, D as getAngleFromPoint, E as toPadding, F as each, G as getMaximumSize, I as _getParentNode, J as readUsedSize, K as supportsEventListenerOptions, L as throttled, M as _isDomSupported, N as _factorize, O as finiteOrDefault, Q as callback, R as _addGrace, S as _limitValue, U as toDegrees, V as _measureText, W as _int16Range, X as _alignPixel, Y as clipArea, Z as renderText, $ as unclipArea, a0 as toFont, a1 as _toLeftRightCenter, a2 as _alignStartEnd, a3 as overrides, a4 as merge, a5 as _capitalize, a6 as descriptors, a7 as isFunction, a8 as _attachContext, a9 as _createResolver, aa as _descriptors, ab as mergeIf, ac as uid, ad as debounce, ae as retinaScale, af as clearCanvas, ag as setsEqual, ah as _elementsEqual, ai as _isClickEvent, aj as _isBetween, ak as _readValueToProps, al as _updateBezierControlPoints, am as _computeSegments, an as _boundSegments, ao as _steppedInterpolation, ap as _bezierInterpolation, aq as _pointInLine, ar as _steppedLineTo, as as _bezierCurveTo, at as drawPoint, au as addRoundedRectPath, av as toTRBL, aw as toTRBLCorners, ax as _boundSegment, ay as _normalizeAngle, az as getRtlAdapter, aA as overrideTextDirection, aB as _textX, aC as restoreTextDirection, aD as drawPointLegend, aE as distanceBetweenPoints, aF as noop, aG as _setMinAndMaxByKey, aH as niceNum, aI as almostWhole, aJ as almostEquals, aK as _decimalPlaces, aL as Ticks, aM as log10, aN as _longestText, aO as _filterBetween, aP as _lookup } from './chunks/helpers.segment.js';\nimport '@kurkle/color';\n\nclass Animator {\n constructor(){\n this._request = null;\n this._charts = new Map();\n this._running = false;\n this._lastDate = undefined;\n }\n _notify(chart, anims, date, type) {\n const callbacks = anims.listeners[type];\n const numSteps = anims.duration;\n callbacks.forEach((fn)=>fn({\n chart,\n initial: anims.initial,\n numSteps,\n currentStep: Math.min(date - anims.start, numSteps)\n }));\n }\n _refresh() {\n if (this._request) {\n return;\n }\n this._running = true;\n this._request = requestAnimFrame.call(window, ()=>{\n this._update();\n this._request = null;\n if (this._running) {\n this._refresh();\n }\n });\n }\n _update(date = Date.now()) {\n let remaining = 0;\n this._charts.forEach((anims, chart)=>{\n if (!anims.running || !anims.items.length) {\n return;\n }\n const items = anims.items;\n let i = items.length - 1;\n let draw = false;\n let item;\n for(; i >= 0; --i){\n item = items[i];\n if (item._active) {\n if (item._total > anims.duration) {\n anims.duration = item._total;\n }\n item.tick(date);\n draw = true;\n } else {\n items[i] = items[items.length - 1];\n items.pop();\n }\n }\n if (draw) {\n chart.draw();\n this._notify(chart, anims, date, 'progress');\n }\n if (!items.length) {\n anims.running = false;\n this._notify(chart, anims, date, 'complete');\n anims.initial = false;\n }\n remaining += items.length;\n });\n this._lastDate = date;\n if (remaining === 0) {\n this._running = false;\n }\n }\n _getAnims(chart) {\n const charts = this._charts;\n let anims = charts.get(chart);\n if (!anims) {\n anims = {\n running: false,\n initial: true,\n items: [],\n listeners: {\n complete: [],\n progress: []\n }\n };\n charts.set(chart, anims);\n }\n return anims;\n }\n listen(chart, event, cb) {\n this._getAnims(chart).listeners[event].push(cb);\n }\n add(chart, items) {\n if (!items || !items.length) {\n return;\n }\n this._getAnims(chart).items.push(...items);\n }\n has(chart) {\n return this._getAnims(chart).items.length > 0;\n }\n start(chart) {\n const anims = this._charts.get(chart);\n if (!anims) {\n return;\n }\n anims.running = true;\n anims.start = Date.now();\n anims.duration = anims.items.reduce((acc, cur)=>Math.max(acc, cur._duration), 0);\n this._refresh();\n }\n running(chart) {\n if (!this._running) {\n return false;\n }\n const anims = this._charts.get(chart);\n if (!anims || !anims.running || !anims.items.length) {\n return false;\n }\n return true;\n }\n stop(chart) {\n const anims = this._charts.get(chart);\n if (!anims || !anims.items.length) {\n return;\n }\n const items = anims.items;\n let i = items.length - 1;\n for(; i >= 0; --i){\n items[i].cancel();\n }\n anims.items = [];\n this._notify(chart, anims, Date.now(), 'complete');\n }\n remove(chart) {\n return this._charts.delete(chart);\n }\n}\nvar animator = /* #__PURE__ */ new Animator();\n\nconst transparent = 'transparent';\nconst interpolators = {\n boolean (from, to, factor) {\n return factor > 0.5 ? to : from;\n },\n color (from, to, factor) {\n const c0 = color(from || transparent);\n const c1 = c0.valid && color(to || transparent);\n return c1 && c1.valid ? c1.mix(c0, factor).hexString() : to;\n },\n number (from, to, factor) {\n return from + (to - from) * factor;\n }\n};\nclass Animation {\n constructor(cfg, target, prop, to){\n const currentValue = target[prop];\n to = resolve([\n cfg.to,\n to,\n currentValue,\n cfg.from\n ]);\n const from = resolve([\n cfg.from,\n currentValue,\n to\n ]);\n this._active = true;\n this._fn = cfg.fn || interpolators[cfg.type || typeof from];\n this._easing = effects[cfg.easing] || effects.linear;\n this._start = Math.floor(Date.now() + (cfg.delay || 0));\n this._duration = this._total = Math.floor(cfg.duration);\n this._loop = !!cfg.loop;\n this._target = target;\n this._prop = prop;\n this._from = from;\n this._to = to;\n this._promises = undefined;\n }\n active() {\n return this._active;\n }\n update(cfg, to, date) {\n if (this._active) {\n this._notify(false);\n const currentValue = this._target[this._prop];\n const elapsed = date - this._start;\n const remain = this._duration - elapsed;\n this._start = date;\n this._duration = Math.floor(Math.max(remain, cfg.duration));\n this._total += elapsed;\n this._loop = !!cfg.loop;\n this._to = resolve([\n cfg.to,\n to,\n currentValue,\n cfg.from\n ]);\n this._from = resolve([\n cfg.from,\n currentValue,\n to\n ]);\n }\n }\n cancel() {\n if (this._active) {\n this.tick(Date.now());\n this._active = false;\n this._notify(false);\n }\n }\n tick(date) {\n const elapsed = date - this._start;\n const duration = this._duration;\n const prop = this._prop;\n const from = this._from;\n const loop = this._loop;\n const to = this._to;\n let factor;\n this._active = from !== to && (loop || elapsed < duration);\n if (!this._active) {\n this._target[prop] = to;\n this._notify(true);\n return;\n }\n if (elapsed < 0) {\n this._target[prop] = from;\n return;\n }\n factor = elapsed / duration % 2;\n factor = loop && factor > 1 ? 2 - factor : factor;\n factor = this._easing(Math.min(1, Math.max(0, factor)));\n this._target[prop] = this._fn(from, to, factor);\n }\n wait() {\n const promises = this._promises || (this._promises = []);\n return new Promise((res, rej)=>{\n promises.push({\n res,\n rej\n });\n });\n }\n _notify(resolved) {\n const method = resolved ? 'res' : 'rej';\n const promises = this._promises || [];\n for(let i = 0; i < promises.length; i++){\n promises[i][method]();\n }\n }\n}\n\nclass Animations {\n constructor(chart, config){\n this._chart = chart;\n this._properties = new Map();\n this.configure(config);\n }\n configure(config) {\n if (!isObject(config)) {\n return;\n }\n const animationOptions = Object.keys(defaults.animation);\n const animatedProps = this._properties;\n Object.getOwnPropertyNames(config).forEach((key)=>{\n const cfg = config[key];\n if (!isObject(cfg)) {\n return;\n }\n const resolved = {};\n for (const option of animationOptions){\n resolved[option] = cfg[option];\n }\n (isArray(cfg.properties) && cfg.properties || [\n key\n ]).forEach((prop)=>{\n if (prop === key || !animatedProps.has(prop)) {\n animatedProps.set(prop, resolved);\n }\n });\n });\n }\n _animateOptions(target, values) {\n const newOptions = values.options;\n const options = resolveTargetOptions(target, newOptions);\n if (!options) {\n return [];\n }\n const animations = this._createAnimations(options, newOptions);\n if (newOptions.$shared) {\n awaitAll(target.options.$animations, newOptions).then(()=>{\n target.options = newOptions;\n }, ()=>{\n });\n }\n return animations;\n }\n _createAnimations(target, values) {\n const animatedProps = this._properties;\n const animations = [];\n const running = target.$animations || (target.$animations = {});\n const props = Object.keys(values);\n const date = Date.now();\n let i;\n for(i = props.length - 1; i >= 0; --i){\n const prop = props[i];\n if (prop.charAt(0) === '$') {\n continue;\n }\n if (prop === 'options') {\n animations.push(...this._animateOptions(target, values));\n continue;\n }\n const value = values[prop];\n let animation = running[prop];\n const cfg = animatedProps.get(prop);\n if (animation) {\n if (cfg && animation.active()) {\n animation.update(cfg, value, date);\n continue;\n } else {\n animation.cancel();\n }\n }\n if (!cfg || !cfg.duration) {\n target[prop] = value;\n continue;\n }\n running[prop] = animation = new Animation(cfg, target, prop, value);\n animations.push(animation);\n }\n return animations;\n }\n update(target, values) {\n if (this._properties.size === 0) {\n Object.assign(target, values);\n return;\n }\n const animations = this._createAnimations(target, values);\n if (animations.length) {\n animator.add(this._chart, animations);\n return true;\n }\n }\n}\nfunction awaitAll(animations, properties) {\n const running = [];\n const keys = Object.keys(properties);\n for(let i = 0; i < keys.length; i++){\n const anim = animations[keys[i]];\n if (anim && anim.active()) {\n running.push(anim.wait());\n }\n }\n return Promise.all(running);\n}\nfunction resolveTargetOptions(target, newOptions) {\n if (!newOptions) {\n return;\n }\n let options = target.options;\n if (!options) {\n target.options = newOptions;\n return;\n }\n if (options.$shared) {\n target.options = options = Object.assign({}, options, {\n $shared: false,\n $animations: {}\n });\n }\n return options;\n}\n\nfunction scaleClip(scale, allowedOverflow) {\n const opts = scale && scale.options || {};\n const reverse = opts.reverse;\n const min = opts.min === undefined ? allowedOverflow : 0;\n const max = opts.max === undefined ? allowedOverflow : 0;\n return {\n start: reverse ? max : min,\n end: reverse ? min : max\n };\n}\nfunction defaultClip(xScale, yScale, allowedOverflow) {\n if (allowedOverflow === false) {\n return false;\n }\n const x = scaleClip(xScale, allowedOverflow);\n const y = scaleClip(yScale, allowedOverflow);\n return {\n top: y.end,\n right: x.end,\n bottom: y.start,\n left: x.start\n };\n}\nfunction toClip(value) {\n let t, r, b, l;\n if (isObject(value)) {\n t = value.top;\n r = value.right;\n b = value.bottom;\n l = value.left;\n } else {\n t = r = b = l = value;\n }\n return {\n top: t,\n right: r,\n bottom: b,\n left: l,\n disabled: value === false\n };\n}\nfunction getSortedDatasetIndices(chart, filterVisible) {\n const keys = [];\n const metasets = chart._getSortedDatasetMetas(filterVisible);\n let i, ilen;\n for(i = 0, ilen = metasets.length; i < ilen; ++i){\n keys.push(metasets[i].index);\n }\n return keys;\n}\nfunction applyStack(stack, value, dsIndex, options = {}) {\n const keys = stack.keys;\n const singleMode = options.mode === 'single';\n let i, ilen, datasetIndex, otherValue;\n if (value === null) {\n return;\n }\n for(i = 0, ilen = keys.length; i < ilen; ++i){\n datasetIndex = +keys[i];\n if (datasetIndex === dsIndex) {\n if (options.all) {\n continue;\n }\n break;\n }\n otherValue = stack.values[datasetIndex];\n if (isNumberFinite(otherValue) && (singleMode || value === 0 || sign(value) === sign(otherValue))) {\n value += otherValue;\n }\n }\n return value;\n}\nfunction convertObjectDataToArray(data) {\n const keys = Object.keys(data);\n const adata = new Array(keys.length);\n let i, ilen, key;\n for(i = 0, ilen = keys.length; i < ilen; ++i){\n key = keys[i];\n adata[i] = {\n x: key,\n y: data[key]\n };\n }\n return adata;\n}\nfunction isStacked(scale, meta) {\n const stacked = scale && scale.options.stacked;\n return stacked || stacked === undefined && meta.stack !== undefined;\n}\nfunction getStackKey(indexScale, valueScale, meta) {\n return `${indexScale.id}.${valueScale.id}.${meta.stack || meta.type}`;\n}\nfunction getUserBounds(scale) {\n const { min , max , minDefined , maxDefined } = scale.getUserBounds();\n return {\n min: minDefined ? min : Number.NEGATIVE_INFINITY,\n max: maxDefined ? max : Number.POSITIVE_INFINITY\n };\n}\nfunction getOrCreateStack(stacks, stackKey, indexValue) {\n const subStack = stacks[stackKey] || (stacks[stackKey] = {});\n return subStack[indexValue] || (subStack[indexValue] = {});\n}\nfunction getLastIndexInStack(stack, vScale, positive, type) {\n for (const meta of vScale.getMatchingVisibleMetas(type).reverse()){\n const value = stack[meta.index];\n if (positive && value > 0 || !positive && value < 0) {\n return meta.index;\n }\n }\n return null;\n}\nfunction updateStacks(controller, parsed) {\n const { chart , _cachedMeta: meta } = controller;\n const stacks = chart._stacks || (chart._stacks = {});\n const { iScale , vScale , index: datasetIndex } = meta;\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const key = getStackKey(iScale, vScale, meta);\n const ilen = parsed.length;\n let stack;\n for(let i = 0; i < ilen; ++i){\n const item = parsed[i];\n const { [iAxis]: index , [vAxis]: value } = item;\n const itemStacks = item._stacks || (item._stacks = {});\n stack = itemStacks[vAxis] = getOrCreateStack(stacks, key, index);\n stack[datasetIndex] = value;\n stack._top = getLastIndexInStack(stack, vScale, true, meta.type);\n stack._bottom = getLastIndexInStack(stack, vScale, false, meta.type);\n const visualValues = stack._visualValues || (stack._visualValues = {});\n visualValues[datasetIndex] = value;\n }\n}\nfunction getFirstScaleId(chart, axis) {\n const scales = chart.scales;\n return Object.keys(scales).filter((key)=>scales[key].axis === axis).shift();\n}\nfunction createDatasetContext(parent, index) {\n return createContext(parent, {\n active: false,\n dataset: undefined,\n datasetIndex: index,\n index,\n mode: 'default',\n type: 'dataset'\n });\n}\nfunction createDataContext(parent, index, element) {\n return createContext(parent, {\n active: false,\n dataIndex: index,\n parsed: undefined,\n raw: undefined,\n element,\n index,\n mode: 'default',\n type: 'data'\n });\n}\nfunction clearStacks(meta, items) {\n const datasetIndex = meta.controller.index;\n const axis = meta.vScale && meta.vScale.axis;\n if (!axis) {\n return;\n }\n items = items || meta._parsed;\n for (const parsed of items){\n const stacks = parsed._stacks;\n if (!stacks || stacks[axis] === undefined || stacks[axis][datasetIndex] === undefined) {\n return;\n }\n delete stacks[axis][datasetIndex];\n if (stacks[axis]._visualValues !== undefined && stacks[axis]._visualValues[datasetIndex] !== undefined) {\n delete stacks[axis]._visualValues[datasetIndex];\n }\n }\n}\nconst isDirectUpdateMode = (mode)=>mode === 'reset' || mode === 'none';\nconst cloneIfNotShared = (cached, shared)=>shared ? cached : Object.assign({}, cached);\nconst createStack = (canStack, meta, chart)=>canStack && !meta.hidden && meta._stacked && {\n keys: getSortedDatasetIndices(chart, true),\n values: null\n };\nclass DatasetController {\n static defaults = {};\n static datasetElementType = null;\n static dataElementType = null;\n constructor(chart, datasetIndex){\n this.chart = chart;\n this._ctx = chart.ctx;\n this.index = datasetIndex;\n this._cachedDataOpts = {};\n this._cachedMeta = this.getMeta();\n this._type = this._cachedMeta.type;\n this.options = undefined;\n this._parsing = false;\n this._data = undefined;\n this._objectData = undefined;\n this._sharedOptions = undefined;\n this._drawStart = undefined;\n this._drawCount = undefined;\n this.enableOptionSharing = false;\n this.supportsDecimation = false;\n this.$context = undefined;\n this._syncList = [];\n this.datasetElementType = new.target.datasetElementType;\n this.dataElementType = new.target.dataElementType;\n this.initialize();\n }\n initialize() {\n const meta = this._cachedMeta;\n this.configure();\n this.linkScales();\n meta._stacked = isStacked(meta.vScale, meta);\n this.addElements();\n if (this.options.fill && !this.chart.isPluginEnabled('filler')) {\n 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\");\n }\n }\n updateIndex(datasetIndex) {\n if (this.index !== datasetIndex) {\n clearStacks(this._cachedMeta);\n }\n this.index = datasetIndex;\n }\n linkScales() {\n const chart = this.chart;\n const meta = this._cachedMeta;\n const dataset = this.getDataset();\n const chooseId = (axis, x, y, r)=>axis === 'x' ? x : axis === 'r' ? r : y;\n const xid = meta.xAxisID = valueOrDefault(dataset.xAxisID, getFirstScaleId(chart, 'x'));\n const yid = meta.yAxisID = valueOrDefault(dataset.yAxisID, getFirstScaleId(chart, 'y'));\n const rid = meta.rAxisID = valueOrDefault(dataset.rAxisID, getFirstScaleId(chart, 'r'));\n const indexAxis = meta.indexAxis;\n const iid = meta.iAxisID = chooseId(indexAxis, xid, yid, rid);\n const vid = meta.vAxisID = chooseId(indexAxis, yid, xid, rid);\n meta.xScale = this.getScaleForId(xid);\n meta.yScale = this.getScaleForId(yid);\n meta.rScale = this.getScaleForId(rid);\n meta.iScale = this.getScaleForId(iid);\n meta.vScale = this.getScaleForId(vid);\n }\n getDataset() {\n return this.chart.data.datasets[this.index];\n }\n getMeta() {\n return this.chart.getDatasetMeta(this.index);\n }\n getScaleForId(scaleID) {\n return this.chart.scales[scaleID];\n }\n _getOtherScale(scale) {\n const meta = this._cachedMeta;\n return scale === meta.iScale ? meta.vScale : meta.iScale;\n }\n reset() {\n this._update('reset');\n }\n _destroy() {\n const meta = this._cachedMeta;\n if (this._data) {\n unlistenArrayEvents(this._data, this);\n }\n if (meta._stacked) {\n clearStacks(meta);\n }\n }\n _dataCheck() {\n const dataset = this.getDataset();\n const data = dataset.data || (dataset.data = []);\n const _data = this._data;\n if (isObject(data)) {\n this._data = convertObjectDataToArray(data);\n } else if (_data !== data) {\n if (_data) {\n unlistenArrayEvents(_data, this);\n const meta = this._cachedMeta;\n clearStacks(meta);\n meta._parsed = [];\n }\n if (data && Object.isExtensible(data)) {\n listenArrayEvents(data, this);\n }\n this._syncList = [];\n this._data = data;\n }\n }\n addElements() {\n const meta = this._cachedMeta;\n this._dataCheck();\n if (this.datasetElementType) {\n meta.dataset = new this.datasetElementType();\n }\n }\n buildOrUpdateElements(resetNewElements) {\n const meta = this._cachedMeta;\n const dataset = this.getDataset();\n let stackChanged = false;\n this._dataCheck();\n const oldStacked = meta._stacked;\n meta._stacked = isStacked(meta.vScale, meta);\n if (meta.stack !== dataset.stack) {\n stackChanged = true;\n clearStacks(meta);\n meta.stack = dataset.stack;\n }\n this._resyncElements(resetNewElements);\n if (stackChanged || oldStacked !== meta._stacked) {\n updateStacks(this, meta._parsed);\n }\n }\n configure() {\n const config = this.chart.config;\n const scopeKeys = config.datasetScopeKeys(this._type);\n const scopes = config.getOptionScopes(this.getDataset(), scopeKeys, true);\n this.options = config.createResolver(scopes, this.getContext());\n this._parsing = this.options.parsing;\n this._cachedDataOpts = {};\n }\n parse(start, count) {\n const { _cachedMeta: meta , _data: data } = this;\n const { iScale , _stacked } = meta;\n const iAxis = iScale.axis;\n let sorted = start === 0 && count === data.length ? true : meta._sorted;\n let prev = start > 0 && meta._parsed[start - 1];\n let i, cur, parsed;\n if (this._parsing === false) {\n meta._parsed = data;\n meta._sorted = true;\n parsed = data;\n } else {\n if (isArray(data[start])) {\n parsed = this.parseArrayData(meta, data, start, count);\n } else if (isObject(data[start])) {\n parsed = this.parseObjectData(meta, data, start, count);\n } else {\n parsed = this.parsePrimitiveData(meta, data, start, count);\n }\n const isNotInOrderComparedToPrev = ()=>cur[iAxis] === null || prev && cur[iAxis] < prev[iAxis];\n for(i = 0; i < count; ++i){\n meta._parsed[i + start] = cur = parsed[i];\n if (sorted) {\n if (isNotInOrderComparedToPrev()) {\n sorted = false;\n }\n prev = cur;\n }\n }\n meta._sorted = sorted;\n }\n if (_stacked) {\n updateStacks(this, parsed);\n }\n }\n parsePrimitiveData(meta, data, start, count) {\n const { iScale , vScale } = meta;\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const labels = iScale.getLabels();\n const singleScale = iScale === vScale;\n const parsed = new Array(count);\n let i, ilen, index;\n for(i = 0, ilen = count; i < ilen; ++i){\n index = i + start;\n parsed[i] = {\n [iAxis]: singleScale || iScale.parse(labels[index], index),\n [vAxis]: vScale.parse(data[index], index)\n };\n }\n return parsed;\n }\n parseArrayData(meta, data, start, count) {\n const { xScale , yScale } = meta;\n const parsed = new Array(count);\n let i, ilen, index, item;\n for(i = 0, ilen = count; i < ilen; ++i){\n index = i + start;\n item = data[index];\n parsed[i] = {\n x: xScale.parse(item[0], index),\n y: yScale.parse(item[1], index)\n };\n }\n return parsed;\n }\n parseObjectData(meta, data, start, count) {\n const { xScale , yScale } = meta;\n const { xAxisKey ='x' , yAxisKey ='y' } = this._parsing;\n const parsed = new Array(count);\n let i, ilen, index, item;\n for(i = 0, ilen = count; i < ilen; ++i){\n index = i + start;\n item = data[index];\n parsed[i] = {\n x: xScale.parse(resolveObjectKey(item, xAxisKey), index),\n y: yScale.parse(resolveObjectKey(item, yAxisKey), index)\n };\n }\n return parsed;\n }\n getParsed(index) {\n return this._cachedMeta._parsed[index];\n }\n getDataElement(index) {\n return this._cachedMeta.data[index];\n }\n applyStack(scale, parsed, mode) {\n const chart = this.chart;\n const meta = this._cachedMeta;\n const value = parsed[scale.axis];\n const stack = {\n keys: getSortedDatasetIndices(chart, true),\n values: parsed._stacks[scale.axis]._visualValues\n };\n return applyStack(stack, value, meta.index, {\n mode\n });\n }\n updateRangeFromParsed(range, scale, parsed, stack) {\n const parsedValue = parsed[scale.axis];\n let value = parsedValue === null ? NaN : parsedValue;\n const values = stack && parsed._stacks[scale.axis];\n if (stack && values) {\n stack.values = values;\n value = applyStack(stack, parsedValue, this._cachedMeta.index);\n }\n range.min = Math.min(range.min, value);\n range.max = Math.max(range.max, value);\n }\n getMinMax(scale, canStack) {\n const meta = this._cachedMeta;\n const _parsed = meta._parsed;\n const sorted = meta._sorted && scale === meta.iScale;\n const ilen = _parsed.length;\n const otherScale = this._getOtherScale(scale);\n const stack = createStack(canStack, meta, this.chart);\n const range = {\n min: Number.POSITIVE_INFINITY,\n max: Number.NEGATIVE_INFINITY\n };\n const { min: otherMin , max: otherMax } = getUserBounds(otherScale);\n let i, parsed;\n function _skip() {\n parsed = _parsed[i];\n const otherValue = parsed[otherScale.axis];\n return !isNumberFinite(parsed[scale.axis]) || otherMin > otherValue || otherMax < otherValue;\n }\n for(i = 0; i < ilen; ++i){\n if (_skip()) {\n continue;\n }\n this.updateRangeFromParsed(range, scale, parsed, stack);\n if (sorted) {\n break;\n }\n }\n if (sorted) {\n for(i = ilen - 1; i >= 0; --i){\n if (_skip()) {\n continue;\n }\n this.updateRangeFromParsed(range, scale, parsed, stack);\n break;\n }\n }\n return range;\n }\n getAllParsedValues(scale) {\n const parsed = this._cachedMeta._parsed;\n const values = [];\n let i, ilen, value;\n for(i = 0, ilen = parsed.length; i < ilen; ++i){\n value = parsed[i][scale.axis];\n if (isNumberFinite(value)) {\n values.push(value);\n }\n }\n return values;\n }\n getMaxOverflow() {\n return false;\n }\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const iScale = meta.iScale;\n const vScale = meta.vScale;\n const parsed = this.getParsed(index);\n return {\n label: iScale ? '' + iScale.getLabelForValue(parsed[iScale.axis]) : '',\n value: vScale ? '' + vScale.getLabelForValue(parsed[vScale.axis]) : ''\n };\n }\n _update(mode) {\n const meta = this._cachedMeta;\n this.update(mode || 'default');\n meta._clip = toClip(valueOrDefault(this.options.clip, defaultClip(meta.xScale, meta.yScale, this.getMaxOverflow())));\n }\n update(mode) {}\n draw() {\n const ctx = this._ctx;\n const chart = this.chart;\n const meta = this._cachedMeta;\n const elements = meta.data || [];\n const area = chart.chartArea;\n const active = [];\n const start = this._drawStart || 0;\n const count = this._drawCount || elements.length - start;\n const drawActiveElementsOnTop = this.options.drawActiveElementsOnTop;\n let i;\n if (meta.dataset) {\n meta.dataset.draw(ctx, area, start, count);\n }\n for(i = start; i < start + count; ++i){\n const element = elements[i];\n if (element.hidden) {\n continue;\n }\n if (element.active && drawActiveElementsOnTop) {\n active.push(element);\n } else {\n element.draw(ctx, area);\n }\n }\n for(i = 0; i < active.length; ++i){\n active[i].draw(ctx, area);\n }\n }\n getStyle(index, active) {\n const mode = active ? 'active' : 'default';\n return index === undefined && this._cachedMeta.dataset ? this.resolveDatasetElementOptions(mode) : this.resolveDataElementOptions(index || 0, mode);\n }\n getContext(index, active, mode) {\n const dataset = this.getDataset();\n let context;\n if (index >= 0 && index < this._cachedMeta.data.length) {\n const element = this._cachedMeta.data[index];\n context = element.$context || (element.$context = createDataContext(this.getContext(), index, element));\n context.parsed = this.getParsed(index);\n context.raw = dataset.data[index];\n context.index = context.dataIndex = index;\n } else {\n context = this.$context || (this.$context = createDatasetContext(this.chart.getContext(), this.index));\n context.dataset = dataset;\n context.index = context.datasetIndex = this.index;\n }\n context.active = !!active;\n context.mode = mode;\n return context;\n }\n resolveDatasetElementOptions(mode) {\n return this._resolveElementOptions(this.datasetElementType.id, mode);\n }\n resolveDataElementOptions(index, mode) {\n return this._resolveElementOptions(this.dataElementType.id, mode, index);\n }\n _resolveElementOptions(elementType, mode = 'default', index) {\n const active = mode === 'active';\n const cache = this._cachedDataOpts;\n const cacheKey = elementType + '-' + mode;\n const cached = cache[cacheKey];\n const sharing = this.enableOptionSharing && defined(index);\n if (cached) {\n return cloneIfNotShared(cached, sharing);\n }\n const config = this.chart.config;\n const scopeKeys = config.datasetElementScopeKeys(this._type, elementType);\n const prefixes = active ? [\n `${elementType}Hover`,\n 'hover',\n elementType,\n ''\n ] : [\n elementType,\n ''\n ];\n const scopes = config.getOptionScopes(this.getDataset(), scopeKeys);\n const names = Object.keys(defaults.elements[elementType]);\n const context = ()=>this.getContext(index, active, mode);\n const values = config.resolveNamedOptions(scopes, names, context, prefixes);\n if (values.$shared) {\n values.$shared = sharing;\n cache[cacheKey] = Object.freeze(cloneIfNotShared(values, sharing));\n }\n return values;\n }\n _resolveAnimations(index, transition, active) {\n const chart = this.chart;\n const cache = this._cachedDataOpts;\n const cacheKey = `animation-${transition}`;\n const cached = cache[cacheKey];\n if (cached) {\n return cached;\n }\n let options;\n if (chart.options.animation !== false) {\n const config = this.chart.config;\n const scopeKeys = config.datasetAnimationScopeKeys(this._type, transition);\n const scopes = config.getOptionScopes(this.getDataset(), scopeKeys);\n options = config.createResolver(scopes, this.getContext(index, active, transition));\n }\n const animations = new Animations(chart, options && options.animations);\n if (options && options._cacheable) {\n cache[cacheKey] = Object.freeze(animations);\n }\n return animations;\n }\n getSharedOptions(options) {\n if (!options.$shared) {\n return;\n }\n return this._sharedOptions || (this._sharedOptions = Object.assign({}, options));\n }\n includeOptions(mode, sharedOptions) {\n return !sharedOptions || isDirectUpdateMode(mode) || this.chart._animationsDisabled;\n }\n _getSharedOptions(start, mode) {\n const firstOpts = this.resolveDataElementOptions(start, mode);\n const previouslySharedOptions = this._sharedOptions;\n const sharedOptions = this.getSharedOptions(firstOpts);\n const includeOptions = this.includeOptions(mode, sharedOptions) || sharedOptions !== previouslySharedOptions;\n this.updateSharedOptions(sharedOptions, mode, firstOpts);\n return {\n sharedOptions,\n includeOptions\n };\n }\n updateElement(element, index, properties, mode) {\n if (isDirectUpdateMode(mode)) {\n Object.assign(element, properties);\n } else {\n this._resolveAnimations(index, mode).update(element, properties);\n }\n }\n updateSharedOptions(sharedOptions, mode, newOptions) {\n if (sharedOptions && !isDirectUpdateMode(mode)) {\n this._resolveAnimations(undefined, mode).update(sharedOptions, newOptions);\n }\n }\n _setStyle(element, index, mode, active) {\n element.active = active;\n const options = this.getStyle(index, active);\n this._resolveAnimations(index, mode, active).update(element, {\n options: !active && this.getSharedOptions(options) || options\n });\n }\n removeHoverStyle(element, datasetIndex, index) {\n this._setStyle(element, index, 'active', false);\n }\n setHoverStyle(element, datasetIndex, index) {\n this._setStyle(element, index, 'active', true);\n }\n _removeDatasetHoverStyle() {\n const element = this._cachedMeta.dataset;\n if (element) {\n this._setStyle(element, undefined, 'active', false);\n }\n }\n _setDatasetHoverStyle() {\n const element = this._cachedMeta.dataset;\n if (element) {\n this._setStyle(element, undefined, 'active', true);\n }\n }\n _resyncElements(resetNewElements) {\n const data = this._data;\n const elements = this._cachedMeta.data;\n for (const [method, arg1, arg2] of this._syncList){\n this[method](arg1, arg2);\n }\n this._syncList = [];\n const numMeta = elements.length;\n const numData = data.length;\n const count = Math.min(numData, numMeta);\n if (count) {\n this.parse(0, count);\n }\n if (numData > numMeta) {\n this._insertElements(numMeta, numData - numMeta, resetNewElements);\n } else if (numData < numMeta) {\n this._removeElements(numData, numMeta - numData);\n }\n }\n _insertElements(start, count, resetNewElements = true) {\n const meta = this._cachedMeta;\n const data = meta.data;\n const end = start + count;\n let i;\n const move = (arr)=>{\n arr.length += count;\n for(i = arr.length - 1; i >= end; i--){\n arr[i] = arr[i - count];\n }\n };\n move(data);\n for(i = start; i < end; ++i){\n data[i] = new this.dataElementType();\n }\n if (this._parsing) {\n move(meta._parsed);\n }\n this.parse(start, count);\n if (resetNewElements) {\n this.updateElements(data, start, count, 'reset');\n }\n }\n updateElements(element, start, count, mode) {}\n _removeElements(start, count) {\n const meta = this._cachedMeta;\n if (this._parsing) {\n const removed = meta._parsed.splice(start, count);\n if (meta._stacked) {\n clearStacks(meta, removed);\n }\n }\n meta.data.splice(start, count);\n }\n _sync(args) {\n if (this._parsing) {\n this._syncList.push(args);\n } else {\n const [method, arg1, arg2] = args;\n this[method](arg1, arg2);\n }\n this.chart._dataChanges.push([\n this.index,\n ...args\n ]);\n }\n _onDataPush() {\n const count = arguments.length;\n this._sync([\n '_insertElements',\n this.getDataset().data.length - count,\n count\n ]);\n }\n _onDataPop() {\n this._sync([\n '_removeElements',\n this._cachedMeta.data.length - 1,\n 1\n ]);\n }\n _onDataShift() {\n this._sync([\n '_removeElements',\n 0,\n 1\n ]);\n }\n _onDataSplice(start, count) {\n if (count) {\n this._sync([\n '_removeElements',\n start,\n count\n ]);\n }\n const newCount = arguments.length - 2;\n if (newCount) {\n this._sync([\n '_insertElements',\n start,\n newCount\n ]);\n }\n }\n _onDataUnshift() {\n this._sync([\n '_insertElements',\n 0,\n arguments.length\n ]);\n }\n}\n\nfunction getAllScaleValues(scale, type) {\n if (!scale._cache.$bar) {\n const visibleMetas = scale.getMatchingVisibleMetas(type);\n let values = [];\n for(let i = 0, ilen = visibleMetas.length; i < ilen; i++){\n values = values.concat(visibleMetas[i].controller.getAllParsedValues(scale));\n }\n scale._cache.$bar = _arrayUnique(values.sort((a, b)=>a - b));\n }\n return scale._cache.$bar;\n}\n function computeMinSampleSize(meta) {\n const scale = meta.iScale;\n const values = getAllScaleValues(scale, meta.type);\n let min = scale._length;\n let i, ilen, curr, prev;\n const updateMinAndPrev = ()=>{\n if (curr === 32767 || curr === -32768) {\n return;\n }\n if (defined(prev)) {\n min = Math.min(min, Math.abs(curr - prev) || min);\n }\n prev = curr;\n };\n for(i = 0, ilen = values.length; i < ilen; ++i){\n curr = scale.getPixelForValue(values[i]);\n updateMinAndPrev();\n }\n prev = undefined;\n for(i = 0, ilen = scale.ticks.length; i < ilen; ++i){\n curr = scale.getPixelForTick(i);\n updateMinAndPrev();\n }\n return min;\n}\n function computeFitCategoryTraits(index, ruler, options, stackCount) {\n const thickness = options.barThickness;\n let size, ratio;\n if (isNullOrUndef(thickness)) {\n size = ruler.min * options.categoryPercentage;\n ratio = options.barPercentage;\n } else {\n size = thickness * stackCount;\n ratio = 1;\n }\n return {\n chunk: size / stackCount,\n ratio,\n start: ruler.pixels[index] - size / 2\n };\n}\n function computeFlexCategoryTraits(index, ruler, options, stackCount) {\n const pixels = ruler.pixels;\n const curr = pixels[index];\n let prev = index > 0 ? pixels[index - 1] : null;\n let next = index < pixels.length - 1 ? pixels[index + 1] : null;\n const percent = options.categoryPercentage;\n if (prev === null) {\n prev = curr - (next === null ? ruler.end - ruler.start : next - curr);\n }\n if (next === null) {\n next = curr + curr - prev;\n }\n const start = curr - (curr - Math.min(prev, next)) / 2 * percent;\n const size = Math.abs(next - prev) / 2 * percent;\n return {\n chunk: size / stackCount,\n ratio: options.barPercentage,\n start\n };\n}\nfunction parseFloatBar(entry, item, vScale, i) {\n const startValue = vScale.parse(entry[0], i);\n const endValue = vScale.parse(entry[1], i);\n const min = Math.min(startValue, endValue);\n const max = Math.max(startValue, endValue);\n let barStart = min;\n let barEnd = max;\n if (Math.abs(min) > Math.abs(max)) {\n barStart = max;\n barEnd = min;\n }\n item[vScale.axis] = barEnd;\n item._custom = {\n barStart,\n barEnd,\n start: startValue,\n end: endValue,\n min,\n max\n };\n}\nfunction parseValue(entry, item, vScale, i) {\n if (isArray(entry)) {\n parseFloatBar(entry, item, vScale, i);\n } else {\n item[vScale.axis] = vScale.parse(entry, i);\n }\n return item;\n}\nfunction parseArrayOrPrimitive(meta, data, start, count) {\n const iScale = meta.iScale;\n const vScale = meta.vScale;\n const labels = iScale.getLabels();\n const singleScale = iScale === vScale;\n const parsed = [];\n let i, ilen, item, entry;\n for(i = start, ilen = start + count; i < ilen; ++i){\n entry = data[i];\n item = {};\n item[iScale.axis] = singleScale || iScale.parse(labels[i], i);\n parsed.push(parseValue(entry, item, vScale, i));\n }\n return parsed;\n}\nfunction isFloatBar(custom) {\n return custom && custom.barStart !== undefined && custom.barEnd !== undefined;\n}\nfunction barSign(size, vScale, actualBase) {\n if (size !== 0) {\n return sign(size);\n }\n return (vScale.isHorizontal() ? 1 : -1) * (vScale.min >= actualBase ? 1 : -1);\n}\nfunction borderProps(properties) {\n let reverse, start, end, top, bottom;\n if (properties.horizontal) {\n reverse = properties.base > properties.x;\n start = 'left';\n end = 'right';\n } else {\n reverse = properties.base < properties.y;\n start = 'bottom';\n end = 'top';\n }\n if (reverse) {\n top = 'end';\n bottom = 'start';\n } else {\n top = 'start';\n bottom = 'end';\n }\n return {\n start,\n end,\n reverse,\n top,\n bottom\n };\n}\nfunction setBorderSkipped(properties, options, stack, index) {\n let edge = options.borderSkipped;\n const res = {};\n if (!edge) {\n properties.borderSkipped = res;\n return;\n }\n if (edge === true) {\n properties.borderSkipped = {\n top: true,\n right: true,\n bottom: true,\n left: true\n };\n return;\n }\n const { start , end , reverse , top , bottom } = borderProps(properties);\n if (edge === 'middle' && stack) {\n properties.enableBorderRadius = true;\n if ((stack._top || 0) === index) {\n edge = top;\n } else if ((stack._bottom || 0) === index) {\n edge = bottom;\n } else {\n res[parseEdge(bottom, start, end, reverse)] = true;\n edge = top;\n }\n }\n res[parseEdge(edge, start, end, reverse)] = true;\n properties.borderSkipped = res;\n}\nfunction parseEdge(edge, a, b, reverse) {\n if (reverse) {\n edge = swap(edge, a, b);\n edge = startEnd(edge, b, a);\n } else {\n edge = startEnd(edge, a, b);\n }\n return edge;\n}\nfunction swap(orig, v1, v2) {\n return orig === v1 ? v2 : orig === v2 ? v1 : orig;\n}\nfunction startEnd(v, start, end) {\n return v === 'start' ? start : v === 'end' ? end : v;\n}\nfunction setInflateAmount(properties, { inflateAmount }, ratio) {\n properties.inflateAmount = inflateAmount === 'auto' ? ratio === 1 ? 0.33 : 0 : inflateAmount;\n}\nclass BarController extends DatasetController {\n static id = 'bar';\n static defaults = {\n datasetElementType: false,\n dataElementType: 'bar',\n categoryPercentage: 0.8,\n barPercentage: 0.9,\n grouped: true,\n animations: {\n numbers: {\n type: 'number',\n properties: [\n 'x',\n 'y',\n 'base',\n 'width',\n 'height'\n ]\n }\n }\n };\n static overrides = {\n scales: {\n _index_: {\n type: 'category',\n offset: true,\n grid: {\n offset: true\n }\n },\n _value_: {\n type: 'linear',\n beginAtZero: true\n }\n }\n };\n parsePrimitiveData(meta, data, start, count) {\n return parseArrayOrPrimitive(meta, data, start, count);\n }\n parseArrayData(meta, data, start, count) {\n return parseArrayOrPrimitive(meta, data, start, count);\n }\n parseObjectData(meta, data, start, count) {\n const { iScale , vScale } = meta;\n const { xAxisKey ='x' , yAxisKey ='y' } = this._parsing;\n const iAxisKey = iScale.axis === 'x' ? xAxisKey : yAxisKey;\n const vAxisKey = vScale.axis === 'x' ? xAxisKey : yAxisKey;\n const parsed = [];\n let i, ilen, item, obj;\n for(i = start, ilen = start + count; i < ilen; ++i){\n obj = data[i];\n item = {};\n item[iScale.axis] = iScale.parse(resolveObjectKey(obj, iAxisKey), i);\n parsed.push(parseValue(resolveObjectKey(obj, vAxisKey), item, vScale, i));\n }\n return parsed;\n }\n updateRangeFromParsed(range, scale, parsed, stack) {\n super.updateRangeFromParsed(range, scale, parsed, stack);\n const custom = parsed._custom;\n if (custom && scale === this._cachedMeta.vScale) {\n range.min = Math.min(range.min, custom.min);\n range.max = Math.max(range.max, custom.max);\n }\n }\n getMaxOverflow() {\n return 0;\n }\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const { iScale , vScale } = meta;\n const parsed = this.getParsed(index);\n const custom = parsed._custom;\n const value = isFloatBar(custom) ? '[' + custom.start + ', ' + custom.end + ']' : '' + vScale.getLabelForValue(parsed[vScale.axis]);\n return {\n label: '' + iScale.getLabelForValue(parsed[iScale.axis]),\n value\n };\n }\n initialize() {\n this.enableOptionSharing = true;\n super.initialize();\n const meta = this._cachedMeta;\n meta.stack = this.getDataset().stack;\n }\n update(mode) {\n const meta = this._cachedMeta;\n this.updateElements(meta.data, 0, meta.data.length, mode);\n }\n updateElements(bars, start, count, mode) {\n const reset = mode === 'reset';\n const { index , _cachedMeta: { vScale } } = this;\n const base = vScale.getBasePixel();\n const horizontal = vScale.isHorizontal();\n const ruler = this._getRuler();\n const { sharedOptions , includeOptions } = this._getSharedOptions(start, mode);\n for(let i = start; i < start + count; i++){\n const parsed = this.getParsed(i);\n const vpixels = reset || isNullOrUndef(parsed[vScale.axis]) ? {\n base,\n head: base\n } : this._calculateBarValuePixels(i);\n const ipixels = this._calculateBarIndexPixels(i, ruler);\n const stack = (parsed._stacks || {})[vScale.axis];\n const properties = {\n horizontal,\n base: vpixels.base,\n enableBorderRadius: !stack || isFloatBar(parsed._custom) || index === stack._top || index === stack._bottom,\n x: horizontal ? vpixels.head : ipixels.center,\n y: horizontal ? ipixels.center : vpixels.head,\n height: horizontal ? ipixels.size : Math.abs(vpixels.size),\n width: horizontal ? Math.abs(vpixels.size) : ipixels.size\n };\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, bars[i].active ? 'active' : mode);\n }\n const options = properties.options || bars[i].options;\n setBorderSkipped(properties, options, stack, index);\n setInflateAmount(properties, options, ruler.ratio);\n this.updateElement(bars[i], i, properties, mode);\n }\n }\n _getStacks(last, dataIndex) {\n const { iScale } = this._cachedMeta;\n const metasets = iScale.getMatchingVisibleMetas(this._type).filter((meta)=>meta.controller.options.grouped);\n const stacked = iScale.options.stacked;\n const stacks = [];\n const skipNull = (meta)=>{\n const parsed = meta.controller.getParsed(dataIndex);\n const val = parsed && parsed[meta.vScale.axis];\n if (isNullOrUndef(val) || isNaN(val)) {\n return true;\n }\n };\n for (const meta of metasets){\n if (dataIndex !== undefined && skipNull(meta)) {\n continue;\n }\n if (stacked === false || stacks.indexOf(meta.stack) === -1 || stacked === undefined && meta.stack === undefined) {\n stacks.push(meta.stack);\n }\n if (meta.index === last) {\n break;\n }\n }\n if (!stacks.length) {\n stacks.push(undefined);\n }\n return stacks;\n }\n _getStackCount(index) {\n return this._getStacks(undefined, index).length;\n }\n _getStackIndex(datasetIndex, name, dataIndex) {\n const stacks = this._getStacks(datasetIndex, dataIndex);\n const index = name !== undefined ? stacks.indexOf(name) : -1;\n return index === -1 ? stacks.length - 1 : index;\n }\n _getRuler() {\n const opts = this.options;\n const meta = this._cachedMeta;\n const iScale = meta.iScale;\n const pixels = [];\n let i, ilen;\n for(i = 0, ilen = meta.data.length; i < ilen; ++i){\n pixels.push(iScale.getPixelForValue(this.getParsed(i)[iScale.axis], i));\n }\n const barThickness = opts.barThickness;\n const min = barThickness || computeMinSampleSize(meta);\n return {\n min,\n pixels,\n start: iScale._startPixel,\n end: iScale._endPixel,\n stackCount: this._getStackCount(),\n scale: iScale,\n grouped: opts.grouped,\n ratio: barThickness ? 1 : opts.categoryPercentage * opts.barPercentage\n };\n }\n _calculateBarValuePixels(index) {\n const { _cachedMeta: { vScale , _stacked , index: datasetIndex } , options: { base: baseValue , minBarLength } } = this;\n const actualBase = baseValue || 0;\n const parsed = this.getParsed(index);\n const custom = parsed._custom;\n const floating = isFloatBar(custom);\n let value = parsed[vScale.axis];\n let start = 0;\n let length = _stacked ? this.applyStack(vScale, parsed, _stacked) : value;\n let head, size;\n if (length !== value) {\n start = length - value;\n length = value;\n }\n if (floating) {\n value = custom.barStart;\n length = custom.barEnd - custom.barStart;\n if (value !== 0 && sign(value) !== sign(custom.barEnd)) {\n start = 0;\n }\n start += value;\n }\n const startValue = !isNullOrUndef(baseValue) && !floating ? baseValue : start;\n let base = vScale.getPixelForValue(startValue);\n if (this.chart.getDataVisibility(index)) {\n head = vScale.getPixelForValue(start + length);\n } else {\n head = base;\n }\n size = head - base;\n if (Math.abs(size) < minBarLength) {\n size = barSign(size, vScale, actualBase) * minBarLength;\n if (value === actualBase) {\n base -= size / 2;\n }\n const startPixel = vScale.getPixelForDecimal(0);\n const endPixel = vScale.getPixelForDecimal(1);\n const min = Math.min(startPixel, endPixel);\n const max = Math.max(startPixel, endPixel);\n base = Math.max(Math.min(base, max), min);\n head = base + size;\n if (_stacked && !floating) {\n parsed._stacks[vScale.axis]._visualValues[datasetIndex] = vScale.getValueForPixel(head) - vScale.getValueForPixel(base);\n }\n }\n if (base === vScale.getPixelForValue(actualBase)) {\n const halfGrid = sign(size) * vScale.getLineWidthForValue(actualBase) / 2;\n base += halfGrid;\n size -= halfGrid;\n }\n return {\n size,\n base,\n head,\n center: head + size / 2\n };\n }\n _calculateBarIndexPixels(index, ruler) {\n const scale = ruler.scale;\n const options = this.options;\n const skipNull = options.skipNull;\n const maxBarThickness = valueOrDefault(options.maxBarThickness, Infinity);\n let center, size;\n if (ruler.grouped) {\n const stackCount = skipNull ? this._getStackCount(index) : ruler.stackCount;\n const range = options.barThickness === 'flex' ? computeFlexCategoryTraits(index, ruler, options, stackCount) : computeFitCategoryTraits(index, ruler, options, stackCount);\n const stackIndex = this._getStackIndex(this.index, this._cachedMeta.stack, skipNull ? index : undefined);\n center = range.start + range.chunk * stackIndex + range.chunk / 2;\n size = Math.min(maxBarThickness, range.chunk * range.ratio);\n } else {\n center = scale.getPixelForValue(this.getParsed(index)[scale.axis], index);\n size = Math.min(maxBarThickness, ruler.min * ruler.ratio);\n }\n return {\n base: center - size / 2,\n head: center + size / 2,\n center,\n size\n };\n }\n draw() {\n const meta = this._cachedMeta;\n const vScale = meta.vScale;\n const rects = meta.data;\n const ilen = rects.length;\n let i = 0;\n for(; i < ilen; ++i){\n if (this.getParsed(i)[vScale.axis] !== null) {\n rects[i].draw(this._ctx);\n }\n }\n }\n}\n\nclass BubbleController extends DatasetController {\n static id = 'bubble';\n static defaults = {\n datasetElementType: false,\n dataElementType: 'point',\n animations: {\n numbers: {\n type: 'number',\n properties: [\n 'x',\n 'y',\n 'borderWidth',\n 'radius'\n ]\n }\n }\n };\n static overrides = {\n scales: {\n x: {\n type: 'linear'\n },\n y: {\n type: 'linear'\n }\n }\n };\n initialize() {\n this.enableOptionSharing = true;\n super.initialize();\n }\n parsePrimitiveData(meta, data, start, count) {\n const parsed = super.parsePrimitiveData(meta, data, start, count);\n for(let i = 0; i < parsed.length; i++){\n parsed[i]._custom = this.resolveDataElementOptions(i + start).radius;\n }\n return parsed;\n }\n parseArrayData(meta, data, start, count) {\n const parsed = super.parseArrayData(meta, data, start, count);\n for(let i = 0; i < parsed.length; i++){\n const item = data[start + i];\n parsed[i]._custom = valueOrDefault(item[2], this.resolveDataElementOptions(i + start).radius);\n }\n return parsed;\n }\n parseObjectData(meta, data, start, count) {\n const parsed = super.parseObjectData(meta, data, start, count);\n for(let i = 0; i < parsed.length; i++){\n const item = data[start + i];\n parsed[i]._custom = valueOrDefault(item && item.r && +item.r, this.resolveDataElementOptions(i + start).radius);\n }\n return parsed;\n }\n getMaxOverflow() {\n const data = this._cachedMeta.data;\n let max = 0;\n for(let i = data.length - 1; i >= 0; --i){\n max = Math.max(max, data[i].size(this.resolveDataElementOptions(i)) / 2);\n }\n return max > 0 && max;\n }\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const labels = this.chart.data.labels || [];\n const { xScale , yScale } = meta;\n const parsed = this.getParsed(index);\n const x = xScale.getLabelForValue(parsed.x);\n const y = yScale.getLabelForValue(parsed.y);\n const r = parsed._custom;\n return {\n label: labels[index] || '',\n value: '(' + x + ', ' + y + (r ? ', ' + r : '') + ')'\n };\n }\n update(mode) {\n const points = this._cachedMeta.data;\n this.updateElements(points, 0, points.length, mode);\n }\n updateElements(points, start, count, mode) {\n const reset = mode === 'reset';\n const { iScale , vScale } = this._cachedMeta;\n const { sharedOptions , includeOptions } = this._getSharedOptions(start, mode);\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n for(let i = start; i < start + count; i++){\n const point = points[i];\n const parsed = !reset && this.getParsed(i);\n const properties = {};\n const iPixel = properties[iAxis] = reset ? iScale.getPixelForDecimal(0.5) : iScale.getPixelForValue(parsed[iAxis]);\n const vPixel = properties[vAxis] = reset ? vScale.getBasePixel() : vScale.getPixelForValue(parsed[vAxis]);\n properties.skip = isNaN(iPixel) || isNaN(vPixel);\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? 'active' : mode);\n if (reset) {\n properties.options.radius = 0;\n }\n }\n this.updateElement(point, i, properties, mode);\n }\n }\n resolveDataElementOptions(index, mode) {\n const parsed = this.getParsed(index);\n let values = super.resolveDataElementOptions(index, mode);\n if (values.$shared) {\n values = Object.assign({}, values, {\n $shared: false\n });\n }\n const radius = values.radius;\n if (mode !== 'active') {\n values.radius = 0;\n }\n values.radius += valueOrDefault(parsed && parsed._custom, radius);\n return values;\n }\n}\n\nfunction getRatioAndOffset(rotation, circumference, cutout) {\n let ratioX = 1;\n let ratioY = 1;\n let offsetX = 0;\n let offsetY = 0;\n if (circumference < TAU) {\n const startAngle = rotation;\n const endAngle = startAngle + circumference;\n const startX = Math.cos(startAngle);\n const startY = Math.sin(startAngle);\n const endX = Math.cos(endAngle);\n const endY = Math.sin(endAngle);\n const calcMax = (angle, a, b)=>_angleBetween(angle, startAngle, endAngle, true) ? 1 : Math.max(a, a * cutout, b, b * cutout);\n const calcMin = (angle, a, b)=>_angleBetween(angle, startAngle, endAngle, true) ? -1 : Math.min(a, a * cutout, b, b * cutout);\n const maxX = calcMax(0, startX, endX);\n const maxY = calcMax(HALF_PI, startY, endY);\n const minX = calcMin(PI, startX, endX);\n const minY = calcMin(PI + HALF_PI, startY, endY);\n ratioX = (maxX - minX) / 2;\n ratioY = (maxY - minY) / 2;\n offsetX = -(maxX + minX) / 2;\n offsetY = -(maxY + minY) / 2;\n }\n return {\n ratioX,\n ratioY,\n offsetX,\n offsetY\n };\n}\nclass DoughnutController extends DatasetController {\n static id = 'doughnut';\n static defaults = {\n datasetElementType: false,\n dataElementType: 'arc',\n animation: {\n animateRotate: true,\n animateScale: false\n },\n animations: {\n numbers: {\n type: 'number',\n properties: [\n 'circumference',\n 'endAngle',\n 'innerRadius',\n 'outerRadius',\n 'startAngle',\n 'x',\n 'y',\n 'offset',\n 'borderWidth',\n 'spacing'\n ]\n }\n },\n cutout: '50%',\n rotation: 0,\n circumference: 360,\n radius: '100%',\n spacing: 0,\n indexAxis: 'r'\n };\n static descriptors = {\n _scriptable: (name)=>name !== 'spacing',\n _indexable: (name)=>name !== 'spacing' && !name.startsWith('borderDash') && !name.startsWith('hoverBorderDash')\n };\n static overrides = {\n aspectRatio: 1,\n plugins: {\n legend: {\n labels: {\n generateLabels (chart) {\n const data = chart.data;\n if (data.labels.length && data.datasets.length) {\n const { labels: { pointStyle , color } } = chart.legend.options;\n return data.labels.map((label, i)=>{\n const meta = chart.getDatasetMeta(0);\n const style = meta.controller.getStyle(i);\n return {\n text: label,\n fillStyle: style.backgroundColor,\n strokeStyle: style.borderColor,\n fontColor: color,\n lineWidth: style.borderWidth,\n pointStyle: pointStyle,\n hidden: !chart.getDataVisibility(i),\n index: i\n };\n });\n }\n return [];\n }\n },\n onClick (e, legendItem, legend) {\n legend.chart.toggleDataVisibility(legendItem.index);\n legend.chart.update();\n }\n }\n }\n };\n constructor(chart, datasetIndex){\n super(chart, datasetIndex);\n this.enableOptionSharing = true;\n this.innerRadius = undefined;\n this.outerRadius = undefined;\n this.offsetX = undefined;\n this.offsetY = undefined;\n }\n linkScales() {}\n parse(start, count) {\n const data = this.getDataset().data;\n const meta = this._cachedMeta;\n if (this._parsing === false) {\n meta._parsed = data;\n } else {\n let getter = (i)=>+data[i];\n if (isObject(data[start])) {\n const { key ='value' } = this._parsing;\n getter = (i)=>+resolveObjectKey(data[i], key);\n }\n let i, ilen;\n for(i = start, ilen = start + count; i < ilen; ++i){\n meta._parsed[i] = getter(i);\n }\n }\n }\n _getRotation() {\n return toRadians(this.options.rotation - 90);\n }\n _getCircumference() {\n return toRadians(this.options.circumference);\n }\n _getRotationExtents() {\n let min = TAU;\n let max = -TAU;\n for(let i = 0; i < this.chart.data.datasets.length; ++i){\n if (this.chart.isDatasetVisible(i) && this.chart.getDatasetMeta(i).type === this._type) {\n const controller = this.chart.getDatasetMeta(i).controller;\n const rotation = controller._getRotation();\n const circumference = controller._getCircumference();\n min = Math.min(min, rotation);\n max = Math.max(max, rotation + circumference);\n }\n }\n return {\n rotation: min,\n circumference: max - min\n };\n }\n update(mode) {\n const chart = this.chart;\n const { chartArea } = chart;\n const meta = this._cachedMeta;\n const arcs = meta.data;\n const spacing = this.getMaxBorderWidth() + this.getMaxOffset(arcs) + this.options.spacing;\n const maxSize = Math.max((Math.min(chartArea.width, chartArea.height) - spacing) / 2, 0);\n const cutout = Math.min(toPercentage(this.options.cutout, maxSize), 1);\n const chartWeight = this._getRingWeight(this.index);\n const { circumference , rotation } = this._getRotationExtents();\n const { ratioX , ratioY , offsetX , offsetY } = getRatioAndOffset(rotation, circumference, cutout);\n const maxWidth = (chartArea.width - spacing) / ratioX;\n const maxHeight = (chartArea.height - spacing) / ratioY;\n const maxRadius = Math.max(Math.min(maxWidth, maxHeight) / 2, 0);\n const outerRadius = toDimension(this.options.radius, maxRadius);\n const innerRadius = Math.max(outerRadius * cutout, 0);\n const radiusLength = (outerRadius - innerRadius) / this._getVisibleDatasetWeightTotal();\n this.offsetX = offsetX * outerRadius;\n this.offsetY = offsetY * outerRadius;\n meta.total = this.calculateTotal();\n this.outerRadius = outerRadius - radiusLength * this._getRingWeightOffset(this.index);\n this.innerRadius = Math.max(this.outerRadius - radiusLength * chartWeight, 0);\n this.updateElements(arcs, 0, arcs.length, mode);\n }\n _circumference(i, reset) {\n const opts = this.options;\n const meta = this._cachedMeta;\n const circumference = this._getCircumference();\n if (reset && opts.animation.animateRotate || !this.chart.getDataVisibility(i) || meta._parsed[i] === null || meta.data[i].hidden) {\n return 0;\n }\n return this.calculateCircumference(meta._parsed[i] * circumference / TAU);\n }\n updateElements(arcs, start, count, mode) {\n const reset = mode === 'reset';\n const chart = this.chart;\n const chartArea = chart.chartArea;\n const opts = chart.options;\n const animationOpts = opts.animation;\n const centerX = (chartArea.left + chartArea.right) / 2;\n const centerY = (chartArea.top + chartArea.bottom) / 2;\n const animateScale = reset && animationOpts.animateScale;\n const innerRadius = animateScale ? 0 : this.innerRadius;\n const outerRadius = animateScale ? 0 : this.outerRadius;\n const { sharedOptions , includeOptions } = this._getSharedOptions(start, mode);\n let startAngle = this._getRotation();\n let i;\n for(i = 0; i < start; ++i){\n startAngle += this._circumference(i, reset);\n }\n for(i = start; i < start + count; ++i){\n const circumference = this._circumference(i, reset);\n const arc = arcs[i];\n const properties = {\n x: centerX + this.offsetX,\n y: centerY + this.offsetY,\n startAngle,\n endAngle: startAngle + circumference,\n circumference,\n outerRadius,\n innerRadius\n };\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, arc.active ? 'active' : mode);\n }\n startAngle += circumference;\n this.updateElement(arc, i, properties, mode);\n }\n }\n calculateTotal() {\n const meta = this._cachedMeta;\n const metaData = meta.data;\n let total = 0;\n let i;\n for(i = 0; i < metaData.length; i++){\n const value = meta._parsed[i];\n if (value !== null && !isNaN(value) && this.chart.getDataVisibility(i) && !metaData[i].hidden) {\n total += Math.abs(value);\n }\n }\n return total;\n }\n calculateCircumference(value) {\n const total = this._cachedMeta.total;\n if (total > 0 && !isNaN(value)) {\n return TAU * (Math.abs(value) / total);\n }\n return 0;\n }\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const chart = this.chart;\n const labels = chart.data.labels || [];\n const value = formatNumber(meta._parsed[index], chart.options.locale);\n return {\n label: labels[index] || '',\n value\n };\n }\n getMaxBorderWidth(arcs) {\n let max = 0;\n const chart = this.chart;\n let i, ilen, meta, controller, options;\n if (!arcs) {\n for(i = 0, ilen = chart.data.datasets.length; i < ilen; ++i){\n if (chart.isDatasetVisible(i)) {\n meta = chart.getDatasetMeta(i);\n arcs = meta.data;\n controller = meta.controller;\n break;\n }\n }\n }\n if (!arcs) {\n return 0;\n }\n for(i = 0, ilen = arcs.length; i < ilen; ++i){\n options = controller.resolveDataElementOptions(i);\n if (options.borderAlign !== 'inner') {\n max = Math.max(max, options.borderWidth || 0, options.hoverBorderWidth || 0);\n }\n }\n return max;\n }\n getMaxOffset(arcs) {\n let max = 0;\n for(let i = 0, ilen = arcs.length; i < ilen; ++i){\n const options = this.resolveDataElementOptions(i);\n max = Math.max(max, options.offset || 0, options.hoverOffset || 0);\n }\n return max;\n }\n _getRingWeightOffset(datasetIndex) {\n let ringWeightOffset = 0;\n for(let i = 0; i < datasetIndex; ++i){\n if (this.chart.isDatasetVisible(i)) {\n ringWeightOffset += this._getRingWeight(i);\n }\n }\n return ringWeightOffset;\n }\n _getRingWeight(datasetIndex) {\n return Math.max(valueOrDefault(this.chart.data.datasets[datasetIndex].weight, 1), 0);\n }\n _getVisibleDatasetWeightTotal() {\n return this._getRingWeightOffset(this.chart.data.datasets.length) || 1;\n }\n}\n\nclass LineController extends DatasetController {\n static id = 'line';\n static defaults = {\n datasetElementType: 'line',\n dataElementType: 'point',\n showLine: true,\n spanGaps: false\n };\n static overrides = {\n scales: {\n _index_: {\n type: 'category'\n },\n _value_: {\n type: 'linear'\n }\n }\n };\n initialize() {\n this.enableOptionSharing = true;\n this.supportsDecimation = true;\n super.initialize();\n }\n update(mode) {\n const meta = this._cachedMeta;\n const { dataset: line , data: points = [] , _dataset } = meta;\n const animationsDisabled = this.chart._animationsDisabled;\n let { start , count } = _getStartAndCountOfVisiblePoints(meta, points, animationsDisabled);\n this._drawStart = start;\n this._drawCount = count;\n if (_scaleRangesChanged(meta)) {\n start = 0;\n count = points.length;\n }\n line._chart = this.chart;\n line._datasetIndex = this.index;\n line._decimated = !!_dataset._decimated;\n line.points = points;\n const options = this.resolveDatasetElementOptions(mode);\n if (!this.options.showLine) {\n options.borderWidth = 0;\n }\n options.segment = this.options.segment;\n this.updateElement(line, undefined, {\n animated: !animationsDisabled,\n options\n }, mode);\n this.updateElements(points, start, count, mode);\n }\n updateElements(points, start, count, mode) {\n const reset = mode === 'reset';\n const { iScale , vScale , _stacked , _dataset } = this._cachedMeta;\n const { sharedOptions , includeOptions } = this._getSharedOptions(start, mode);\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const { spanGaps , segment } = this.options;\n const maxGapLength = isNumber(spanGaps) ? spanGaps : Number.POSITIVE_INFINITY;\n const directUpdate = this.chart._animationsDisabled || reset || mode === 'none';\n const end = start + count;\n const pointsCount = points.length;\n let prevParsed = start > 0 && this.getParsed(start - 1);\n for(let i = 0; i < pointsCount; ++i){\n const point = points[i];\n const properties = directUpdate ? point : {};\n if (i < start || i >= end) {\n properties.skip = true;\n continue;\n }\n const parsed = this.getParsed(i);\n const nullData = isNullOrUndef(parsed[vAxis]);\n const iPixel = properties[iAxis] = iScale.getPixelForValue(parsed[iAxis], i);\n const vPixel = properties[vAxis] = reset || nullData ? vScale.getBasePixel() : vScale.getPixelForValue(_stacked ? this.applyStack(vScale, parsed, _stacked) : parsed[vAxis], i);\n properties.skip = isNaN(iPixel) || isNaN(vPixel) || nullData;\n properties.stop = i > 0 && Math.abs(parsed[iAxis] - prevParsed[iAxis]) > maxGapLength;\n if (segment) {\n properties.parsed = parsed;\n properties.raw = _dataset.data[i];\n }\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? 'active' : mode);\n }\n if (!directUpdate) {\n this.updateElement(point, i, properties, mode);\n }\n prevParsed = parsed;\n }\n }\n getMaxOverflow() {\n const meta = this._cachedMeta;\n const dataset = meta.dataset;\n const border = dataset.options && dataset.options.borderWidth || 0;\n const data = meta.data || [];\n if (!data.length) {\n return border;\n }\n const firstPoint = data[0].size(this.resolveDataElementOptions(0));\n const lastPoint = data[data.length - 1].size(this.resolveDataElementOptions(data.length - 1));\n return Math.max(border, firstPoint, lastPoint) / 2;\n }\n draw() {\n const meta = this._cachedMeta;\n meta.dataset.updateControlPoints(this.chart.chartArea, meta.iScale.axis);\n super.draw();\n }\n}\n\nclass PolarAreaController extends DatasetController {\n static id = 'polarArea';\n static defaults = {\n dataElementType: 'arc',\n animation: {\n animateRotate: true,\n animateScale: true\n },\n animations: {\n numbers: {\n type: 'number',\n properties: [\n 'x',\n 'y',\n 'startAngle',\n 'endAngle',\n 'innerRadius',\n 'outerRadius'\n ]\n }\n },\n indexAxis: 'r',\n startAngle: 0\n };\n static overrides = {\n aspectRatio: 1,\n plugins: {\n legend: {\n labels: {\n generateLabels (chart) {\n const data = chart.data;\n if (data.labels.length && data.datasets.length) {\n const { labels: { pointStyle , color } } = chart.legend.options;\n return data.labels.map((label, i)=>{\n const meta = chart.getDatasetMeta(0);\n const style = meta.controller.getStyle(i);\n return {\n text: label,\n fillStyle: style.backgroundColor,\n strokeStyle: style.borderColor,\n fontColor: color,\n lineWidth: style.borderWidth,\n pointStyle: pointStyle,\n hidden: !chart.getDataVisibility(i),\n index: i\n };\n });\n }\n return [];\n }\n },\n onClick (e, legendItem, legend) {\n legend.chart.toggleDataVisibility(legendItem.index);\n legend.chart.update();\n }\n }\n },\n scales: {\n r: {\n type: 'radialLinear',\n angleLines: {\n display: false\n },\n beginAtZero: true,\n grid: {\n circular: true\n },\n pointLabels: {\n display: false\n },\n startAngle: 0\n }\n }\n };\n constructor(chart, datasetIndex){\n super(chart, datasetIndex);\n this.innerRadius = undefined;\n this.outerRadius = undefined;\n }\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const chart = this.chart;\n const labels = chart.data.labels || [];\n const value = formatNumber(meta._parsed[index].r, chart.options.locale);\n return {\n label: labels[index] || '',\n value\n };\n }\n parseObjectData(meta, data, start, count) {\n return _parseObjectDataRadialScale.bind(this)(meta, data, start, count);\n }\n update(mode) {\n const arcs = this._cachedMeta.data;\n this._updateRadius();\n this.updateElements(arcs, 0, arcs.length, mode);\n }\n getMinMax() {\n const meta = this._cachedMeta;\n const range = {\n min: Number.POSITIVE_INFINITY,\n max: Number.NEGATIVE_INFINITY\n };\n meta.data.forEach((element, index)=>{\n const parsed = this.getParsed(index).r;\n if (!isNaN(parsed) && this.chart.getDataVisibility(index)) {\n if (parsed < range.min) {\n range.min = parsed;\n }\n if (parsed > range.max) {\n range.max = parsed;\n }\n }\n });\n return range;\n }\n _updateRadius() {\n const chart = this.chart;\n const chartArea = chart.chartArea;\n const opts = chart.options;\n const minSize = Math.min(chartArea.right - chartArea.left, chartArea.bottom - chartArea.top);\n const outerRadius = Math.max(minSize / 2, 0);\n const innerRadius = Math.max(opts.cutoutPercentage ? outerRadius / 100 * opts.cutoutPercentage : 1, 0);\n const radiusLength = (outerRadius - innerRadius) / chart.getVisibleDatasetCount();\n this.outerRadius = outerRadius - radiusLength * this.index;\n this.innerRadius = this.outerRadius - radiusLength;\n }\n updateElements(arcs, start, count, mode) {\n const reset = mode === 'reset';\n const chart = this.chart;\n const opts = chart.options;\n const animationOpts = opts.animation;\n const scale = this._cachedMeta.rScale;\n const centerX = scale.xCenter;\n const centerY = scale.yCenter;\n const datasetStartAngle = scale.getIndexAngle(0) - 0.5 * PI;\n let angle = datasetStartAngle;\n let i;\n const defaultAngle = 360 / this.countVisibleElements();\n for(i = 0; i < start; ++i){\n angle += this._computeAngle(i, mode, defaultAngle);\n }\n for(i = start; i < start + count; i++){\n const arc = arcs[i];\n let startAngle = angle;\n let endAngle = angle + this._computeAngle(i, mode, defaultAngle);\n let outerRadius = chart.getDataVisibility(i) ? scale.getDistanceFromCenterForValue(this.getParsed(i).r) : 0;\n angle = endAngle;\n if (reset) {\n if (animationOpts.animateScale) {\n outerRadius = 0;\n }\n if (animationOpts.animateRotate) {\n startAngle = endAngle = datasetStartAngle;\n }\n }\n const properties = {\n x: centerX,\n y: centerY,\n innerRadius: 0,\n outerRadius,\n startAngle,\n endAngle,\n options: this.resolveDataElementOptions(i, arc.active ? 'active' : mode)\n };\n this.updateElement(arc, i, properties, mode);\n }\n }\n countVisibleElements() {\n const meta = this._cachedMeta;\n let count = 0;\n meta.data.forEach((element, index)=>{\n if (!isNaN(this.getParsed(index).r) && this.chart.getDataVisibility(index)) {\n count++;\n }\n });\n return count;\n }\n _computeAngle(index, mode, defaultAngle) {\n return this.chart.getDataVisibility(index) ? toRadians(this.resolveDataElementOptions(index, mode).angle || defaultAngle) : 0;\n }\n}\n\nclass PieController extends DoughnutController {\n static id = 'pie';\n static defaults = {\n cutout: 0,\n rotation: 0,\n circumference: 360,\n radius: '100%'\n };\n}\n\nclass RadarController extends DatasetController {\n static id = 'radar';\n static defaults = {\n datasetElementType: 'line',\n dataElementType: 'point',\n indexAxis: 'r',\n showLine: true,\n elements: {\n line: {\n fill: 'start'\n }\n }\n };\n static overrides = {\n aspectRatio: 1,\n scales: {\n r: {\n type: 'radialLinear'\n }\n }\n };\n getLabelAndValue(index) {\n const vScale = this._cachedMeta.vScale;\n const parsed = this.getParsed(index);\n return {\n label: vScale.getLabels()[index],\n value: '' + vScale.getLabelForValue(parsed[vScale.axis])\n };\n }\n parseObjectData(meta, data, start, count) {\n return _parseObjectDataRadialScale.bind(this)(meta, data, start, count);\n }\n update(mode) {\n const meta = this._cachedMeta;\n const line = meta.dataset;\n const points = meta.data || [];\n const labels = meta.iScale.getLabels();\n line.points = points;\n if (mode !== 'resize') {\n const options = this.resolveDatasetElementOptions(mode);\n if (!this.options.showLine) {\n options.borderWidth = 0;\n }\n const properties = {\n _loop: true,\n _fullLoop: labels.length === points.length,\n options\n };\n this.updateElement(line, undefined, properties, mode);\n }\n this.updateElements(points, 0, points.length, mode);\n }\n updateElements(points, start, count, mode) {\n const scale = this._cachedMeta.rScale;\n const reset = mode === 'reset';\n for(let i = start; i < start + count; i++){\n const point = points[i];\n const options = this.resolveDataElementOptions(i, point.active ? 'active' : mode);\n const pointPosition = scale.getPointPositionForValue(i, this.getParsed(i).r);\n const x = reset ? scale.xCenter : pointPosition.x;\n const y = reset ? scale.yCenter : pointPosition.y;\n const properties = {\n x,\n y,\n angle: pointPosition.angle,\n skip: isNaN(x) || isNaN(y),\n options\n };\n this.updateElement(point, i, properties, mode);\n }\n }\n}\n\nclass ScatterController extends DatasetController {\n static id = 'scatter';\n static defaults = {\n datasetElementType: false,\n dataElementType: 'point',\n showLine: false,\n fill: false\n };\n static overrides = {\n interaction: {\n mode: 'point'\n },\n scales: {\n x: {\n type: 'linear'\n },\n y: {\n type: 'linear'\n }\n }\n };\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const labels = this.chart.data.labels || [];\n const { xScale , yScale } = meta;\n const parsed = this.getParsed(index);\n const x = xScale.getLabelForValue(parsed.x);\n const y = yScale.getLabelForValue(parsed.y);\n return {\n label: labels[index] || '',\n value: '(' + x + ', ' + y + ')'\n };\n }\n update(mode) {\n const meta = this._cachedMeta;\n const { data: points = [] } = meta;\n const animationsDisabled = this.chart._animationsDisabled;\n let { start , count } = _getStartAndCountOfVisiblePoints(meta, points, animationsDisabled);\n this._drawStart = start;\n this._drawCount = count;\n if (_scaleRangesChanged(meta)) {\n start = 0;\n count = points.length;\n }\n if (this.options.showLine) {\n if (!this.datasetElementType) {\n this.addElements();\n }\n const { dataset: line , _dataset } = meta;\n line._chart = this.chart;\n line._datasetIndex = this.index;\n line._decimated = !!_dataset._decimated;\n line.points = points;\n const options = this.resolveDatasetElementOptions(mode);\n options.segment = this.options.segment;\n this.updateElement(line, undefined, {\n animated: !animationsDisabled,\n options\n }, mode);\n } else if (this.datasetElementType) {\n delete meta.dataset;\n this.datasetElementType = false;\n }\n this.updateElements(points, start, count, mode);\n }\n addElements() {\n const { showLine } = this.options;\n if (!this.datasetElementType && showLine) {\n this.datasetElementType = this.chart.registry.getElement('line');\n }\n super.addElements();\n }\n updateElements(points, start, count, mode) {\n const reset = mode === 'reset';\n const { iScale , vScale , _stacked , _dataset } = this._cachedMeta;\n const firstOpts = this.resolveDataElementOptions(start, mode);\n const sharedOptions = this.getSharedOptions(firstOpts);\n const includeOptions = this.includeOptions(mode, sharedOptions);\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const { spanGaps , segment } = this.options;\n const maxGapLength = isNumber(spanGaps) ? spanGaps : Number.POSITIVE_INFINITY;\n const directUpdate = this.chart._animationsDisabled || reset || mode === 'none';\n let prevParsed = start > 0 && this.getParsed(start - 1);\n for(let i = start; i < start + count; ++i){\n const point = points[i];\n const parsed = this.getParsed(i);\n const properties = directUpdate ? point : {};\n const nullData = isNullOrUndef(parsed[vAxis]);\n const iPixel = properties[iAxis] = iScale.getPixelForValue(parsed[iAxis], i);\n const vPixel = properties[vAxis] = reset || nullData ? vScale.getBasePixel() : vScale.getPixelForValue(_stacked ? this.applyStack(vScale, parsed, _stacked) : parsed[vAxis], i);\n properties.skip = isNaN(iPixel) || isNaN(vPixel) || nullData;\n properties.stop = i > 0 && Math.abs(parsed[iAxis] - prevParsed[iAxis]) > maxGapLength;\n if (segment) {\n properties.parsed = parsed;\n properties.raw = _dataset.data[i];\n }\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? 'active' : mode);\n }\n if (!directUpdate) {\n this.updateElement(point, i, properties, mode);\n }\n prevParsed = parsed;\n }\n this.updateSharedOptions(sharedOptions, mode, firstOpts);\n }\n getMaxOverflow() {\n const meta = this._cachedMeta;\n const data = meta.data || [];\n if (!this.options.showLine) {\n let max = 0;\n for(let i = data.length - 1; i >= 0; --i){\n max = Math.max(max, data[i].size(this.resolveDataElementOptions(i)) / 2);\n }\n return max > 0 && max;\n }\n const dataset = meta.dataset;\n const border = dataset.options && dataset.options.borderWidth || 0;\n if (!data.length) {\n return border;\n }\n const firstPoint = data[0].size(this.resolveDataElementOptions(0));\n const lastPoint = data[data.length - 1].size(this.resolveDataElementOptions(data.length - 1));\n return Math.max(border, firstPoint, lastPoint) / 2;\n }\n}\n\nvar controllers = /*#__PURE__*/Object.freeze({\n__proto__: null,\nBarController: BarController,\nBubbleController: BubbleController,\nDoughnutController: DoughnutController,\nLineController: LineController,\nPieController: PieController,\nPolarAreaController: PolarAreaController,\nRadarController: RadarController,\nScatterController: ScatterController\n});\n\n/**\n * @namespace Chart._adapters\n * @since 2.8.0\n * @private\n */ function abstract() {\n throw new Error('This method is not implemented: Check that a complete date adapter is provided.');\n}\n/**\n * Date adapter (current used by the time scale)\n * @namespace Chart._adapters._date\n * @memberof Chart._adapters\n * @private\n */ class DateAdapterBase {\n /**\n * Override default date adapter methods.\n * Accepts type parameter to define options type.\n * @example\n * Chart._adapters._date.override<{myAdapterOption: string}>({\n * init() {\n * console.log(this.options.myAdapterOption);\n * }\n * })\n */ static override(members) {\n Object.assign(DateAdapterBase.prototype, members);\n }\n options;\n constructor(options){\n this.options = options || {};\n }\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n init() {}\n formats() {\n return abstract();\n }\n parse() {\n return abstract();\n }\n format() {\n return abstract();\n }\n add() {\n return abstract();\n }\n diff() {\n return abstract();\n }\n startOf() {\n return abstract();\n }\n endOf() {\n return abstract();\n }\n}\nvar adapters = {\n _date: DateAdapterBase\n};\n\nfunction binarySearch(metaset, axis, value, intersect) {\n const { controller , data , _sorted } = metaset;\n const iScale = controller._cachedMeta.iScale;\n if (iScale && axis === iScale.axis && axis !== 'r' && _sorted && data.length) {\n const lookupMethod = iScale._reversePixels ? _rlookupByKey : _lookupByKey;\n if (!intersect) {\n return lookupMethod(data, axis, value);\n } else if (controller._sharedOptions) {\n const el = data[0];\n const range = typeof el.getRange === 'function' && el.getRange(axis);\n if (range) {\n const start = lookupMethod(data, axis, value - range);\n const end = lookupMethod(data, axis, value + range);\n return {\n lo: start.lo,\n hi: end.hi\n };\n }\n }\n }\n return {\n lo: 0,\n hi: data.length - 1\n };\n}\n function evaluateInteractionItems(chart, axis, position, handler, intersect) {\n const metasets = chart.getSortedVisibleDatasetMetas();\n const value = position[axis];\n for(let i = 0, ilen = metasets.length; i < ilen; ++i){\n const { index , data } = metasets[i];\n const { lo , hi } = binarySearch(metasets[i], axis, value, intersect);\n for(let j = lo; j <= hi; ++j){\n const element = data[j];\n if (!element.skip) {\n handler(element, index, j);\n }\n }\n }\n}\n function getDistanceMetricForAxis(axis) {\n const useX = axis.indexOf('x') !== -1;\n const useY = axis.indexOf('y') !== -1;\n return function(pt1, pt2) {\n const deltaX = useX ? Math.abs(pt1.x - pt2.x) : 0;\n const deltaY = useY ? Math.abs(pt1.y - pt2.y) : 0;\n return Math.sqrt(Math.pow(deltaX, 2) + Math.pow(deltaY, 2));\n };\n}\n function getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible) {\n const items = [];\n if (!includeInvisible && !chart.isPointInArea(position)) {\n return items;\n }\n const evaluationFunc = function(element, datasetIndex, index) {\n if (!includeInvisible && !_isPointInArea(element, chart.chartArea, 0)) {\n return;\n }\n if (element.inRange(position.x, position.y, useFinalPosition)) {\n items.push({\n element,\n datasetIndex,\n index\n });\n }\n };\n evaluateInteractionItems(chart, axis, position, evaluationFunc, true);\n return items;\n}\n function getNearestRadialItems(chart, position, axis, useFinalPosition) {\n let items = [];\n function evaluationFunc(element, datasetIndex, index) {\n const { startAngle , endAngle } = element.getProps([\n 'startAngle',\n 'endAngle'\n ], useFinalPosition);\n const { angle } = getAngleFromPoint(element, {\n x: position.x,\n y: position.y\n });\n if (_angleBetween(angle, startAngle, endAngle)) {\n items.push({\n element,\n datasetIndex,\n index\n });\n }\n }\n evaluateInteractionItems(chart, axis, position, evaluationFunc);\n return items;\n}\n function getNearestCartesianItems(chart, position, axis, intersect, useFinalPosition, includeInvisible) {\n let items = [];\n const distanceMetric = getDistanceMetricForAxis(axis);\n let minDistance = Number.POSITIVE_INFINITY;\n function evaluationFunc(element, datasetIndex, index) {\n const inRange = element.inRange(position.x, position.y, useFinalPosition);\n if (intersect && !inRange) {\n return;\n }\n const center = element.getCenterPoint(useFinalPosition);\n const pointInArea = !!includeInvisible || chart.isPointInArea(center);\n if (!pointInArea && !inRange) {\n return;\n }\n const distance = distanceMetric(position, center);\n if (distance < minDistance) {\n items = [\n {\n element,\n datasetIndex,\n index\n }\n ];\n minDistance = distance;\n } else if (distance === minDistance) {\n items.push({\n element,\n datasetIndex,\n index\n });\n }\n }\n evaluateInteractionItems(chart, axis, position, evaluationFunc);\n return items;\n}\n function getNearestItems(chart, position, axis, intersect, useFinalPosition, includeInvisible) {\n if (!includeInvisible && !chart.isPointInArea(position)) {\n return [];\n }\n return axis === 'r' && !intersect ? getNearestRadialItems(chart, position, axis, useFinalPosition) : getNearestCartesianItems(chart, position, axis, intersect, useFinalPosition, includeInvisible);\n}\n function getAxisItems(chart, position, axis, intersect, useFinalPosition) {\n const items = [];\n const rangeMethod = axis === 'x' ? 'inXRange' : 'inYRange';\n let intersectsItem = false;\n evaluateInteractionItems(chart, axis, position, (element, datasetIndex, index)=>{\n if (element[rangeMethod](position[axis], useFinalPosition)) {\n items.push({\n element,\n datasetIndex,\n index\n });\n intersectsItem = intersectsItem || element.inRange(position.x, position.y, useFinalPosition);\n }\n });\n if (intersect && !intersectsItem) {\n return [];\n }\n return items;\n}\n var Interaction = {\n evaluateInteractionItems,\n modes: {\n index (chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n const axis = options.axis || 'x';\n const includeInvisible = options.includeInvisible || false;\n const items = options.intersect ? getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible) : getNearestItems(chart, position, axis, false, useFinalPosition, includeInvisible);\n const elements = [];\n if (!items.length) {\n return [];\n }\n chart.getSortedVisibleDatasetMetas().forEach((meta)=>{\n const index = items[0].index;\n const element = meta.data[index];\n if (element && !element.skip) {\n elements.push({\n element,\n datasetIndex: meta.index,\n index\n });\n }\n });\n return elements;\n },\n dataset (chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n const axis = options.axis || 'xy';\n const includeInvisible = options.includeInvisible || false;\n let items = options.intersect ? getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible) : getNearestItems(chart, position, axis, false, useFinalPosition, includeInvisible);\n if (items.length > 0) {\n const datasetIndex = items[0].datasetIndex;\n const data = chart.getDatasetMeta(datasetIndex).data;\n items = [];\n for(let i = 0; i < data.length; ++i){\n items.push({\n element: data[i],\n datasetIndex,\n index: i\n });\n }\n }\n return items;\n },\n point (chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n const axis = options.axis || 'xy';\n const includeInvisible = options.includeInvisible || false;\n return getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible);\n },\n nearest (chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n const axis = options.axis || 'xy';\n const includeInvisible = options.includeInvisible || false;\n return getNearestItems(chart, position, axis, options.intersect, useFinalPosition, includeInvisible);\n },\n x (chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n return getAxisItems(chart, position, 'x', options.intersect, useFinalPosition);\n },\n y (chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n return getAxisItems(chart, position, 'y', options.intersect, useFinalPosition);\n }\n }\n};\n\nconst STATIC_POSITIONS = [\n 'left',\n 'top',\n 'right',\n 'bottom'\n];\nfunction filterByPosition(array, position) {\n return array.filter((v)=>v.pos === position);\n}\nfunction filterDynamicPositionByAxis(array, axis) {\n return array.filter((v)=>STATIC_POSITIONS.indexOf(v.pos) === -1 && v.box.axis === axis);\n}\nfunction sortByWeight(array, reverse) {\n return array.sort((a, b)=>{\n const v0 = reverse ? b : a;\n const v1 = reverse ? a : b;\n return v0.weight === v1.weight ? v0.index - v1.index : v0.weight - v1.weight;\n });\n}\nfunction wrapBoxes(boxes) {\n const layoutBoxes = [];\n let i, ilen, box, pos, stack, stackWeight;\n for(i = 0, ilen = (boxes || []).length; i < ilen; ++i){\n box = boxes[i];\n ({ position: pos , options: { stack , stackWeight =1 } } = box);\n layoutBoxes.push({\n index: i,\n box,\n pos,\n horizontal: box.isHorizontal(),\n weight: box.weight,\n stack: stack && pos + stack,\n stackWeight\n });\n }\n return layoutBoxes;\n}\nfunction buildStacks(layouts) {\n const stacks = {};\n for (const wrap of layouts){\n const { stack , pos , stackWeight } = wrap;\n if (!stack || !STATIC_POSITIONS.includes(pos)) {\n continue;\n }\n const _stack = stacks[stack] || (stacks[stack] = {\n count: 0,\n placed: 0,\n weight: 0,\n size: 0\n });\n _stack.count++;\n _stack.weight += stackWeight;\n }\n return stacks;\n}\n function setLayoutDims(layouts, params) {\n const stacks = buildStacks(layouts);\n const { vBoxMaxWidth , hBoxMaxHeight } = params;\n let i, ilen, layout;\n for(i = 0, ilen = layouts.length; i < ilen; ++i){\n layout = layouts[i];\n const { fullSize } = layout.box;\n const stack = stacks[layout.stack];\n const factor = stack && layout.stackWeight / stack.weight;\n if (layout.horizontal) {\n layout.width = factor ? factor * vBoxMaxWidth : fullSize && params.availableWidth;\n layout.height = hBoxMaxHeight;\n } else {\n layout.width = vBoxMaxWidth;\n layout.height = factor ? factor * hBoxMaxHeight : fullSize && params.availableHeight;\n }\n }\n return stacks;\n}\nfunction buildLayoutBoxes(boxes) {\n const layoutBoxes = wrapBoxes(boxes);\n const fullSize = sortByWeight(layoutBoxes.filter((wrap)=>wrap.box.fullSize), true);\n const left = sortByWeight(filterByPosition(layoutBoxes, 'left'), true);\n const right = sortByWeight(filterByPosition(layoutBoxes, 'right'));\n const top = sortByWeight(filterByPosition(layoutBoxes, 'top'), true);\n const bottom = sortByWeight(filterByPosition(layoutBoxes, 'bottom'));\n const centerHorizontal = filterDynamicPositionByAxis(layoutBoxes, 'x');\n const centerVertical = filterDynamicPositionByAxis(layoutBoxes, 'y');\n return {\n fullSize,\n leftAndTop: left.concat(top),\n rightAndBottom: right.concat(centerVertical).concat(bottom).concat(centerHorizontal),\n chartArea: filterByPosition(layoutBoxes, 'chartArea'),\n vertical: left.concat(right).concat(centerVertical),\n horizontal: top.concat(bottom).concat(centerHorizontal)\n };\n}\nfunction getCombinedMax(maxPadding, chartArea, a, b) {\n return Math.max(maxPadding[a], chartArea[a]) + Math.max(maxPadding[b], chartArea[b]);\n}\nfunction updateMaxPadding(maxPadding, boxPadding) {\n maxPadding.top = Math.max(maxPadding.top, boxPadding.top);\n maxPadding.left = Math.max(maxPadding.left, boxPadding.left);\n maxPadding.bottom = Math.max(maxPadding.bottom, boxPadding.bottom);\n maxPadding.right = Math.max(maxPadding.right, boxPadding.right);\n}\nfunction updateDims(chartArea, params, layout, stacks) {\n const { pos , box } = layout;\n const maxPadding = chartArea.maxPadding;\n if (!isObject(pos)) {\n if (layout.size) {\n chartArea[pos] -= layout.size;\n }\n const stack = stacks[layout.stack] || {\n size: 0,\n count: 1\n };\n stack.size = Math.max(stack.size, layout.horizontal ? box.height : box.width);\n layout.size = stack.size / stack.count;\n chartArea[pos] += layout.size;\n }\n if (box.getPadding) {\n updateMaxPadding(maxPadding, box.getPadding());\n }\n const newWidth = Math.max(0, params.outerWidth - getCombinedMax(maxPadding, chartArea, 'left', 'right'));\n const newHeight = Math.max(0, params.outerHeight - getCombinedMax(maxPadding, chartArea, 'top', 'bottom'));\n const widthChanged = newWidth !== chartArea.w;\n const heightChanged = newHeight !== chartArea.h;\n chartArea.w = newWidth;\n chartArea.h = newHeight;\n return layout.horizontal ? {\n same: widthChanged,\n other: heightChanged\n } : {\n same: heightChanged,\n other: widthChanged\n };\n}\nfunction handleMaxPadding(chartArea) {\n const maxPadding = chartArea.maxPadding;\n function updatePos(pos) {\n const change = Math.max(maxPadding[pos] - chartArea[pos], 0);\n chartArea[pos] += change;\n return change;\n }\n chartArea.y += updatePos('top');\n chartArea.x += updatePos('left');\n updatePos('right');\n updatePos('bottom');\n}\nfunction getMargins(horizontal, chartArea) {\n const maxPadding = chartArea.maxPadding;\n function marginForPositions(positions) {\n const margin = {\n left: 0,\n top: 0,\n right: 0,\n bottom: 0\n };\n positions.forEach((pos)=>{\n margin[pos] = Math.max(chartArea[pos], maxPadding[pos]);\n });\n return margin;\n }\n return horizontal ? marginForPositions([\n 'left',\n 'right'\n ]) : marginForPositions([\n 'top',\n 'bottom'\n ]);\n}\nfunction fitBoxes(boxes, chartArea, params, stacks) {\n const refitBoxes = [];\n let i, ilen, layout, box, refit, changed;\n for(i = 0, ilen = boxes.length, refit = 0; i < ilen; ++i){\n layout = boxes[i];\n box = layout.box;\n box.update(layout.width || chartArea.w, layout.height || chartArea.h, getMargins(layout.horizontal, chartArea));\n const { same , other } = updateDims(chartArea, params, layout, stacks);\n refit |= same && refitBoxes.length;\n changed = changed || other;\n if (!box.fullSize) {\n refitBoxes.push(layout);\n }\n }\n return refit && fitBoxes(refitBoxes, chartArea, params, stacks) || changed;\n}\nfunction setBoxDims(box, left, top, width, height) {\n box.top = top;\n box.left = left;\n box.right = left + width;\n box.bottom = top + height;\n box.width = width;\n box.height = height;\n}\nfunction placeBoxes(boxes, chartArea, params, stacks) {\n const userPadding = params.padding;\n let { x , y } = chartArea;\n for (const layout of boxes){\n const box = layout.box;\n const stack = stacks[layout.stack] || {\n count: 1,\n placed: 0,\n weight: 1\n };\n const weight = layout.stackWeight / stack.weight || 1;\n if (layout.horizontal) {\n const width = chartArea.w * weight;\n const height = stack.size || box.height;\n if (defined(stack.start)) {\n y = stack.start;\n }\n if (box.fullSize) {\n setBoxDims(box, userPadding.left, y, params.outerWidth - userPadding.right - userPadding.left, height);\n } else {\n setBoxDims(box, chartArea.left + stack.placed, y, width, height);\n }\n stack.start = y;\n stack.placed += width;\n y = box.bottom;\n } else {\n const height = chartArea.h * weight;\n const width = stack.size || box.width;\n if (defined(stack.start)) {\n x = stack.start;\n }\n if (box.fullSize) {\n setBoxDims(box, x, userPadding.top, width, params.outerHeight - userPadding.bottom - userPadding.top);\n } else {\n setBoxDims(box, x, chartArea.top + stack.placed, width, height);\n }\n stack.start = x;\n stack.placed += height;\n x = box.right;\n }\n }\n chartArea.x = x;\n chartArea.y = y;\n}\nvar layouts = {\n addBox (chart, item) {\n if (!chart.boxes) {\n chart.boxes = [];\n }\n item.fullSize = item.fullSize || false;\n item.position = item.position || 'top';\n item.weight = item.weight || 0;\n item._layers = item._layers || function() {\n return [\n {\n z: 0,\n draw (chartArea) {\n item.draw(chartArea);\n }\n }\n ];\n };\n chart.boxes.push(item);\n },\n removeBox (chart, layoutItem) {\n const index = chart.boxes ? chart.boxes.indexOf(layoutItem) : -1;\n if (index !== -1) {\n chart.boxes.splice(index, 1);\n }\n },\n configure (chart, item, options) {\n item.fullSize = options.fullSize;\n item.position = options.position;\n item.weight = options.weight;\n },\n update (chart, width, height, minPadding) {\n if (!chart) {\n return;\n }\n const padding = toPadding(chart.options.layout.padding);\n const availableWidth = Math.max(width - padding.width, 0);\n const availableHeight = Math.max(height - padding.height, 0);\n const boxes = buildLayoutBoxes(chart.boxes);\n const verticalBoxes = boxes.vertical;\n const horizontalBoxes = boxes.horizontal;\n each(chart.boxes, (box)=>{\n if (typeof box.beforeLayout === 'function') {\n box.beforeLayout();\n }\n });\n const visibleVerticalBoxCount = verticalBoxes.reduce((total, wrap)=>wrap.box.options && wrap.box.options.display === false ? total : total + 1, 0) || 1;\n const params = Object.freeze({\n outerWidth: width,\n outerHeight: height,\n padding,\n availableWidth,\n availableHeight,\n vBoxMaxWidth: availableWidth / 2 / visibleVerticalBoxCount,\n hBoxMaxHeight: availableHeight / 2\n });\n const maxPadding = Object.assign({}, padding);\n updateMaxPadding(maxPadding, toPadding(minPadding));\n const chartArea = Object.assign({\n maxPadding,\n w: availableWidth,\n h: availableHeight,\n x: padding.left,\n y: padding.top\n }, padding);\n const stacks = setLayoutDims(verticalBoxes.concat(horizontalBoxes), params);\n fitBoxes(boxes.fullSize, chartArea, params, stacks);\n fitBoxes(verticalBoxes, chartArea, params, stacks);\n if (fitBoxes(horizontalBoxes, chartArea, params, stacks)) {\n fitBoxes(verticalBoxes, chartArea, params, stacks);\n }\n handleMaxPadding(chartArea);\n placeBoxes(boxes.leftAndTop, chartArea, params, stacks);\n chartArea.x += chartArea.w;\n chartArea.y += chartArea.h;\n placeBoxes(boxes.rightAndBottom, chartArea, params, stacks);\n chart.chartArea = {\n left: chartArea.left,\n top: chartArea.top,\n right: chartArea.left + chartArea.w,\n bottom: chartArea.top + chartArea.h,\n height: chartArea.h,\n width: chartArea.w\n };\n each(boxes.chartArea, (layout)=>{\n const box = layout.box;\n Object.assign(box, chart.chartArea);\n box.update(chartArea.w, chartArea.h, {\n left: 0,\n top: 0,\n right: 0,\n bottom: 0\n });\n });\n }\n};\n\nclass BasePlatform {\n acquireContext(canvas, aspectRatio) {}\n releaseContext(context) {\n return false;\n }\n addEventListener(chart, type, listener) {}\n removeEventListener(chart, type, listener) {}\n getDevicePixelRatio() {\n return 1;\n }\n getMaximumSize(element, width, height, aspectRatio) {\n width = Math.max(0, width || element.width);\n height = height || element.height;\n return {\n width,\n height: Math.max(0, aspectRatio ? Math.floor(width / aspectRatio) : height)\n };\n }\n isAttached(canvas) {\n return true;\n }\n updateConfig(config) {\n }\n}\n\nclass BasicPlatform extends BasePlatform {\n acquireContext(item) {\n return item && item.getContext && item.getContext('2d') || null;\n }\n updateConfig(config) {\n config.options.animation = false;\n }\n}\n\nconst EXPANDO_KEY = '$chartjs';\n const EVENT_TYPES = {\n touchstart: 'mousedown',\n touchmove: 'mousemove',\n touchend: 'mouseup',\n pointerenter: 'mouseenter',\n pointerdown: 'mousedown',\n pointermove: 'mousemove',\n pointerup: 'mouseup',\n pointerleave: 'mouseout',\n pointerout: 'mouseout'\n};\nconst isNullOrEmpty = (value)=>value === null || value === '';\n function initCanvas(canvas, aspectRatio) {\n const style = canvas.style;\n const renderHeight = canvas.getAttribute('height');\n const renderWidth = canvas.getAttribute('width');\n canvas[EXPANDO_KEY] = {\n initial: {\n height: renderHeight,\n width: renderWidth,\n style: {\n display: style.display,\n height: style.height,\n width: style.width\n }\n }\n };\n style.display = style.display || 'block';\n style.boxSizing = style.boxSizing || 'border-box';\n if (isNullOrEmpty(renderWidth)) {\n const displayWidth = readUsedSize(canvas, 'width');\n if (displayWidth !== undefined) {\n canvas.width = displayWidth;\n }\n }\n if (isNullOrEmpty(renderHeight)) {\n if (canvas.style.height === '') {\n canvas.height = canvas.width / (aspectRatio || 2);\n } else {\n const displayHeight = readUsedSize(canvas, 'height');\n if (displayHeight !== undefined) {\n canvas.height = displayHeight;\n }\n }\n }\n return canvas;\n}\nconst eventListenerOptions = supportsEventListenerOptions ? {\n passive: true\n} : false;\nfunction addListener(node, type, listener) {\n node.addEventListener(type, listener, eventListenerOptions);\n}\nfunction removeListener(chart, type, listener) {\n chart.canvas.removeEventListener(type, listener, eventListenerOptions);\n}\nfunction fromNativeEvent(event, chart) {\n const type = EVENT_TYPES[event.type] || event.type;\n const { x , y } = getRelativePosition(event, chart);\n return {\n type,\n chart,\n native: event,\n x: x !== undefined ? x : null,\n y: y !== undefined ? y : null\n };\n}\nfunction nodeListContains(nodeList, canvas) {\n for (const node of nodeList){\n if (node === canvas || node.contains(canvas)) {\n return true;\n }\n }\n}\nfunction createAttachObserver(chart, type, listener) {\n const canvas = chart.canvas;\n const observer = new MutationObserver((entries)=>{\n let trigger = false;\n for (const entry of entries){\n trigger = trigger || nodeListContains(entry.addedNodes, canvas);\n trigger = trigger && !nodeListContains(entry.removedNodes, canvas);\n }\n if (trigger) {\n listener();\n }\n });\n observer.observe(document, {\n childList: true,\n subtree: true\n });\n return observer;\n}\nfunction createDetachObserver(chart, type, listener) {\n const canvas = chart.canvas;\n const observer = new MutationObserver((entries)=>{\n let trigger = false;\n for (const entry of entries){\n trigger = trigger || nodeListContains(entry.removedNodes, canvas);\n trigger = trigger && !nodeListContains(entry.addedNodes, canvas);\n }\n if (trigger) {\n listener();\n }\n });\n observer.observe(document, {\n childList: true,\n subtree: true\n });\n return observer;\n}\nconst drpListeningCharts = new Map();\nlet oldDevicePixelRatio = 0;\nfunction onWindowResize() {\n const dpr = window.devicePixelRatio;\n if (dpr === oldDevicePixelRatio) {\n return;\n }\n oldDevicePixelRatio = dpr;\n drpListeningCharts.forEach((resize, chart)=>{\n if (chart.currentDevicePixelRatio !== dpr) {\n resize();\n }\n });\n}\nfunction listenDevicePixelRatioChanges(chart, resize) {\n if (!drpListeningCharts.size) {\n window.addEventListener('resize', onWindowResize);\n }\n drpListeningCharts.set(chart, resize);\n}\nfunction unlistenDevicePixelRatioChanges(chart) {\n drpListeningCharts.delete(chart);\n if (!drpListeningCharts.size) {\n window.removeEventListener('resize', onWindowResize);\n }\n}\nfunction createResizeObserver(chart, type, listener) {\n const canvas = chart.canvas;\n const container = canvas && _getParentNode(canvas);\n if (!container) {\n return;\n }\n const resize = throttled((width, height)=>{\n const w = container.clientWidth;\n listener(width, height);\n if (w < container.clientWidth) {\n listener();\n }\n }, window);\n const observer = new ResizeObserver((entries)=>{\n const entry = entries[0];\n const width = entry.contentRect.width;\n const height = entry.contentRect.height;\n if (width === 0 && height === 0) {\n return;\n }\n resize(width, height);\n });\n observer.observe(container);\n listenDevicePixelRatioChanges(chart, resize);\n return observer;\n}\nfunction releaseObserver(chart, type, observer) {\n if (observer) {\n observer.disconnect();\n }\n if (type === 'resize') {\n unlistenDevicePixelRatioChanges(chart);\n }\n}\nfunction createProxyAndListen(chart, type, listener) {\n const canvas = chart.canvas;\n const proxy = throttled((event)=>{\n if (chart.ctx !== null) {\n listener(fromNativeEvent(event, chart));\n }\n }, chart);\n addListener(canvas, type, proxy);\n return proxy;\n}\n class DomPlatform extends BasePlatform {\n acquireContext(canvas, aspectRatio) {\n const context = canvas && canvas.getContext && canvas.getContext('2d');\n if (context && context.canvas === canvas) {\n initCanvas(canvas, aspectRatio);\n return context;\n }\n return null;\n }\n releaseContext(context) {\n const canvas = context.canvas;\n if (!canvas[EXPANDO_KEY]) {\n return false;\n }\n const initial = canvas[EXPANDO_KEY].initial;\n [\n 'height',\n 'width'\n ].forEach((prop)=>{\n const value = initial[prop];\n if (isNullOrUndef(value)) {\n canvas.removeAttribute(prop);\n } else {\n canvas.setAttribute(prop, value);\n }\n });\n const style = initial.style || {};\n Object.keys(style).forEach((key)=>{\n canvas.style[key] = style[key];\n });\n canvas.width = canvas.width;\n delete canvas[EXPANDO_KEY];\n return true;\n }\n addEventListener(chart, type, listener) {\n this.removeEventListener(chart, type);\n const proxies = chart.$proxies || (chart.$proxies = {});\n const handlers = {\n attach: createAttachObserver,\n detach: createDetachObserver,\n resize: createResizeObserver\n };\n const handler = handlers[type] || createProxyAndListen;\n proxies[type] = handler(chart, type, listener);\n }\n removeEventListener(chart, type) {\n const proxies = chart.$proxies || (chart.$proxies = {});\n const proxy = proxies[type];\n if (!proxy) {\n return;\n }\n const handlers = {\n attach: releaseObserver,\n detach: releaseObserver,\n resize: releaseObserver\n };\n const handler = handlers[type] || removeListener;\n handler(chart, type, proxy);\n proxies[type] = undefined;\n }\n getDevicePixelRatio() {\n return window.devicePixelRatio;\n }\n getMaximumSize(canvas, width, height, aspectRatio) {\n return getMaximumSize(canvas, width, height, aspectRatio);\n }\n isAttached(canvas) {\n const container = _getParentNode(canvas);\n return !!(container && container.isConnected);\n }\n}\n\nfunction _detectPlatform(canvas) {\n if (!_isDomSupported() || typeof OffscreenCanvas !== 'undefined' && canvas instanceof OffscreenCanvas) {\n return BasicPlatform;\n }\n return DomPlatform;\n}\n\nclass Element {\n static defaults = {};\n static defaultRoutes = undefined;\n x;\n y;\n active = false;\n options;\n $animations;\n tooltipPosition(useFinalPosition) {\n const { x , y } = this.getProps([\n 'x',\n 'y'\n ], useFinalPosition);\n return {\n x,\n y\n };\n }\n hasValue() {\n return isNumber(this.x) && isNumber(this.y);\n }\n getProps(props, final) {\n const anims = this.$animations;\n if (!final || !anims) {\n // let's not create an object, if not needed\n return this;\n }\n const ret = {};\n props.forEach((prop)=>{\n ret[prop] = anims[prop] && anims[prop].active() ? anims[prop]._to : this[prop];\n });\n return ret;\n }\n}\n\nfunction autoSkip(scale, ticks) {\n const tickOpts = scale.options.ticks;\n const determinedMaxTicks = determineMaxTicks(scale);\n const ticksLimit = Math.min(tickOpts.maxTicksLimit || determinedMaxTicks, determinedMaxTicks);\n const majorIndices = tickOpts.major.enabled ? getMajorIndices(ticks) : [];\n const numMajorIndices = majorIndices.length;\n const first = majorIndices[0];\n const last = majorIndices[numMajorIndices - 1];\n const newTicks = [];\n if (numMajorIndices > ticksLimit) {\n skipMajors(ticks, newTicks, majorIndices, numMajorIndices / ticksLimit);\n return newTicks;\n }\n const spacing = calculateSpacing(majorIndices, ticks, ticksLimit);\n if (numMajorIndices > 0) {\n let i, ilen;\n const avgMajorSpacing = numMajorIndices > 1 ? Math.round((last - first) / (numMajorIndices - 1)) : null;\n skip(ticks, newTicks, spacing, isNullOrUndef(avgMajorSpacing) ? 0 : first - avgMajorSpacing, first);\n for(i = 0, ilen = numMajorIndices - 1; i < ilen; i++){\n skip(ticks, newTicks, spacing, majorIndices[i], majorIndices[i + 1]);\n }\n skip(ticks, newTicks, spacing, last, isNullOrUndef(avgMajorSpacing) ? ticks.length : last + avgMajorSpacing);\n return newTicks;\n }\n skip(ticks, newTicks, spacing);\n return newTicks;\n}\nfunction determineMaxTicks(scale) {\n const offset = scale.options.offset;\n const tickLength = scale._tickSize();\n const maxScale = scale._length / tickLength + (offset ? 0 : 1);\n const maxChart = scale._maxLength / tickLength;\n return Math.floor(Math.min(maxScale, maxChart));\n}\n function calculateSpacing(majorIndices, ticks, ticksLimit) {\n const evenMajorSpacing = getEvenSpacing(majorIndices);\n const spacing = ticks.length / ticksLimit;\n if (!evenMajorSpacing) {\n return Math.max(spacing, 1);\n }\n const factors = _factorize(evenMajorSpacing);\n for(let i = 0, ilen = factors.length - 1; i < ilen; i++){\n const factor = factors[i];\n if (factor > spacing) {\n return factor;\n }\n }\n return Math.max(spacing, 1);\n}\n function getMajorIndices(ticks) {\n const result = [];\n let i, ilen;\n for(i = 0, ilen = ticks.length; i < ilen; i++){\n if (ticks[i].major) {\n result.push(i);\n }\n }\n return result;\n}\n function skipMajors(ticks, newTicks, majorIndices, spacing) {\n let count = 0;\n let next = majorIndices[0];\n let i;\n spacing = Math.ceil(spacing);\n for(i = 0; i < ticks.length; i++){\n if (i === next) {\n newTicks.push(ticks[i]);\n count++;\n next = majorIndices[count * spacing];\n }\n }\n}\n function skip(ticks, newTicks, spacing, majorStart, majorEnd) {\n const start = valueOrDefault(majorStart, 0);\n const end = Math.min(valueOrDefault(majorEnd, ticks.length), ticks.length);\n let count = 0;\n let length, i, next;\n spacing = Math.ceil(spacing);\n if (majorEnd) {\n length = majorEnd - majorStart;\n spacing = length / Math.floor(length / spacing);\n }\n next = start;\n while(next < 0){\n count++;\n next = Math.round(start + count * spacing);\n }\n for(i = Math.max(start, 0); i < end; i++){\n if (i === next) {\n newTicks.push(ticks[i]);\n count++;\n next = Math.round(start + count * spacing);\n }\n }\n}\n function getEvenSpacing(arr) {\n const len = arr.length;\n let i, diff;\n if (len < 2) {\n return false;\n }\n for(diff = arr[0], i = 1; i < len; ++i){\n if (arr[i] - arr[i - 1] !== diff) {\n return false;\n }\n }\n return diff;\n}\n\nconst reverseAlign = (align)=>align === 'left' ? 'right' : align === 'right' ? 'left' : align;\nconst offsetFromEdge = (scale, edge, offset)=>edge === 'top' || edge === 'left' ? scale[edge] + offset : scale[edge] - offset;\nconst getTicksLimit = (ticksLength, maxTicksLimit)=>Math.min(maxTicksLimit || ticksLength, ticksLength);\n function sample(arr, numItems) {\n const result = [];\n const increment = arr.length / numItems;\n const len = arr.length;\n let i = 0;\n for(; i < len; i += increment){\n result.push(arr[Math.floor(i)]);\n }\n return result;\n}\n function getPixelForGridLine(scale, index, offsetGridLines) {\n const length = scale.ticks.length;\n const validIndex = Math.min(index, length - 1);\n const start = scale._startPixel;\n const end = scale._endPixel;\n const epsilon = 1e-6;\n let lineValue = scale.getPixelForTick(validIndex);\n let offset;\n if (offsetGridLines) {\n if (length === 1) {\n offset = Math.max(lineValue - start, end - lineValue);\n } else if (index === 0) {\n offset = (scale.getPixelForTick(1) - lineValue) / 2;\n } else {\n offset = (lineValue - scale.getPixelForTick(validIndex - 1)) / 2;\n }\n lineValue += validIndex < index ? offset : -offset;\n if (lineValue < start - epsilon || lineValue > end + epsilon) {\n return;\n }\n }\n return lineValue;\n}\n function garbageCollect(caches, length) {\n each(caches, (cache)=>{\n const gc = cache.gc;\n const gcLen = gc.length / 2;\n let i;\n if (gcLen > length) {\n for(i = 0; i < gcLen; ++i){\n delete cache.data[gc[i]];\n }\n gc.splice(0, gcLen);\n }\n });\n}\n function getTickMarkLength(options) {\n return options.drawTicks ? options.tickLength : 0;\n}\n function getTitleHeight(options, fallback) {\n if (!options.display) {\n return 0;\n }\n const font = toFont(options.font, fallback);\n const padding = toPadding(options.padding);\n const lines = isArray(options.text) ? options.text.length : 1;\n return lines * font.lineHeight + padding.height;\n}\nfunction createScaleContext(parent, scale) {\n return createContext(parent, {\n scale,\n type: 'scale'\n });\n}\nfunction createTickContext(parent, index, tick) {\n return createContext(parent, {\n tick,\n index,\n type: 'tick'\n });\n}\nfunction titleAlign(align, position, reverse) {\n let ret = _toLeftRightCenter(align);\n if (reverse && position !== 'right' || !reverse && position === 'right') {\n ret = reverseAlign(ret);\n }\n return ret;\n}\nfunction titleArgs(scale, offset, position, align) {\n const { top , left , bottom , right , chart } = scale;\n const { chartArea , scales } = chart;\n let rotation = 0;\n let maxWidth, titleX, titleY;\n const height = bottom - top;\n const width = right - left;\n if (scale.isHorizontal()) {\n titleX = _alignStartEnd(align, left, right);\n if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n titleY = scales[positionAxisID].getPixelForValue(value) + height - offset;\n } else if (position === 'center') {\n titleY = (chartArea.bottom + chartArea.top) / 2 + height - offset;\n } else {\n titleY = offsetFromEdge(scale, position, offset);\n }\n maxWidth = right - left;\n } else {\n if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n titleX = scales[positionAxisID].getPixelForValue(value) - width + offset;\n } else if (position === 'center') {\n titleX = (chartArea.left + chartArea.right) / 2 - width + offset;\n } else {\n titleX = offsetFromEdge(scale, position, offset);\n }\n titleY = _alignStartEnd(align, bottom, top);\n rotation = position === 'left' ? -HALF_PI : HALF_PI;\n }\n return {\n titleX,\n titleY,\n maxWidth,\n rotation\n };\n}\nclass Scale extends Element {\n constructor(cfg){\n super();\n this.id = cfg.id;\n this.type = cfg.type;\n this.options = undefined;\n this.ctx = cfg.ctx;\n this.chart = cfg.chart;\n this.top = undefined;\n this.bottom = undefined;\n this.left = undefined;\n this.right = undefined;\n this.width = undefined;\n this.height = undefined;\n this._margins = {\n left: 0,\n right: 0,\n top: 0,\n bottom: 0\n };\n this.maxWidth = undefined;\n this.maxHeight = undefined;\n this.paddingTop = undefined;\n this.paddingBottom = undefined;\n this.paddingLeft = undefined;\n this.paddingRight = undefined;\n this.axis = undefined;\n this.labelRotation = undefined;\n this.min = undefined;\n this.max = undefined;\n this._range = undefined;\n this.ticks = [];\n this._gridLineItems = null;\n this._labelItems = null;\n this._labelSizes = null;\n this._length = 0;\n this._maxLength = 0;\n this._longestTextCache = {};\n this._startPixel = undefined;\n this._endPixel = undefined;\n this._reversePixels = false;\n this._userMax = undefined;\n this._userMin = undefined;\n this._suggestedMax = undefined;\n this._suggestedMin = undefined;\n this._ticksLength = 0;\n this._borderValue = 0;\n this._cache = {};\n this._dataLimitsCached = false;\n this.$context = undefined;\n }\n init(options) {\n this.options = options.setContext(this.getContext());\n this.axis = options.axis;\n this._userMin = this.parse(options.min);\n this._userMax = this.parse(options.max);\n this._suggestedMin = this.parse(options.suggestedMin);\n this._suggestedMax = this.parse(options.suggestedMax);\n }\n parse(raw, index) {\n return raw;\n }\n getUserBounds() {\n let { _userMin , _userMax , _suggestedMin , _suggestedMax } = this;\n _userMin = finiteOrDefault(_userMin, Number.POSITIVE_INFINITY);\n _userMax = finiteOrDefault(_userMax, Number.NEGATIVE_INFINITY);\n _suggestedMin = finiteOrDefault(_suggestedMin, Number.POSITIVE_INFINITY);\n _suggestedMax = finiteOrDefault(_suggestedMax, Number.NEGATIVE_INFINITY);\n return {\n min: finiteOrDefault(_userMin, _suggestedMin),\n max: finiteOrDefault(_userMax, _suggestedMax),\n minDefined: isNumberFinite(_userMin),\n maxDefined: isNumberFinite(_userMax)\n };\n }\n getMinMax(canStack) {\n let { min , max , minDefined , maxDefined } = this.getUserBounds();\n let range;\n if (minDefined && maxDefined) {\n return {\n min,\n max\n };\n }\n const metas = this.getMatchingVisibleMetas();\n for(let i = 0, ilen = metas.length; i < ilen; ++i){\n range = metas[i].controller.getMinMax(this, canStack);\n if (!minDefined) {\n min = Math.min(min, range.min);\n }\n if (!maxDefined) {\n max = Math.max(max, range.max);\n }\n }\n min = maxDefined && min > max ? max : min;\n max = minDefined && min > max ? min : max;\n return {\n min: finiteOrDefault(min, finiteOrDefault(max, min)),\n max: finiteOrDefault(max, finiteOrDefault(min, max))\n };\n }\n getPadding() {\n return {\n left: this.paddingLeft || 0,\n top: this.paddingTop || 0,\n right: this.paddingRight || 0,\n bottom: this.paddingBottom || 0\n };\n }\n getTicks() {\n return this.ticks;\n }\n getLabels() {\n const data = this.chart.data;\n return this.options.labels || (this.isHorizontal() ? data.xLabels : data.yLabels) || data.labels || [];\n }\n getLabelItems(chartArea = this.chart.chartArea) {\n const items = this._labelItems || (this._labelItems = this._computeLabelItems(chartArea));\n return items;\n }\n beforeLayout() {\n this._cache = {};\n this._dataLimitsCached = false;\n }\n beforeUpdate() {\n callback(this.options.beforeUpdate, [\n this\n ]);\n }\n update(maxWidth, maxHeight, margins) {\n const { beginAtZero , grace , ticks: tickOpts } = this.options;\n const sampleSize = tickOpts.sampleSize;\n this.beforeUpdate();\n this.maxWidth = maxWidth;\n this.maxHeight = maxHeight;\n this._margins = margins = Object.assign({\n left: 0,\n right: 0,\n top: 0,\n bottom: 0\n }, margins);\n this.ticks = null;\n this._labelSizes = null;\n this._gridLineItems = null;\n this._labelItems = null;\n this.beforeSetDimensions();\n this.setDimensions();\n this.afterSetDimensions();\n this._maxLength = this.isHorizontal() ? this.width + margins.left + margins.right : this.height + margins.top + margins.bottom;\n if (!this._dataLimitsCached) {\n this.beforeDataLimits();\n this.determineDataLimits();\n this.afterDataLimits();\n this._range = _addGrace(this, grace, beginAtZero);\n this._dataLimitsCached = true;\n }\n this.beforeBuildTicks();\n this.ticks = this.buildTicks() || [];\n this.afterBuildTicks();\n const samplingEnabled = sampleSize < this.ticks.length;\n this._convertTicksToLabels(samplingEnabled ? sample(this.ticks, sampleSize) : this.ticks);\n this.configure();\n this.beforeCalculateLabelRotation();\n this.calculateLabelRotation();\n this.afterCalculateLabelRotation();\n if (tickOpts.display && (tickOpts.autoSkip || tickOpts.source === 'auto')) {\n this.ticks = autoSkip(this, this.ticks);\n this._labelSizes = null;\n this.afterAutoSkip();\n }\n if (samplingEnabled) {\n this._convertTicksToLabels(this.ticks);\n }\n this.beforeFit();\n this.fit();\n this.afterFit();\n this.afterUpdate();\n }\n configure() {\n let reversePixels = this.options.reverse;\n let startPixel, endPixel;\n if (this.isHorizontal()) {\n startPixel = this.left;\n endPixel = this.right;\n } else {\n startPixel = this.top;\n endPixel = this.bottom;\n reversePixels = !reversePixels;\n }\n this._startPixel = startPixel;\n this._endPixel = endPixel;\n this._reversePixels = reversePixels;\n this._length = endPixel - startPixel;\n this._alignToPixels = this.options.alignToPixels;\n }\n afterUpdate() {\n callback(this.options.afterUpdate, [\n this\n ]);\n }\n beforeSetDimensions() {\n callback(this.options.beforeSetDimensions, [\n this\n ]);\n }\n setDimensions() {\n if (this.isHorizontal()) {\n this.width = this.maxWidth;\n this.left = 0;\n this.right = this.width;\n } else {\n this.height = this.maxHeight;\n this.top = 0;\n this.bottom = this.height;\n }\n this.paddingLeft = 0;\n this.paddingTop = 0;\n this.paddingRight = 0;\n this.paddingBottom = 0;\n }\n afterSetDimensions() {\n callback(this.options.afterSetDimensions, [\n this\n ]);\n }\n _callHooks(name) {\n this.chart.notifyPlugins(name, this.getContext());\n callback(this.options[name], [\n this\n ]);\n }\n beforeDataLimits() {\n this._callHooks('beforeDataLimits');\n }\n determineDataLimits() {}\n afterDataLimits() {\n this._callHooks('afterDataLimits');\n }\n beforeBuildTicks() {\n this._callHooks('beforeBuildTicks');\n }\n buildTicks() {\n return [];\n }\n afterBuildTicks() {\n this._callHooks('afterBuildTicks');\n }\n beforeTickToLabelConversion() {\n callback(this.options.beforeTickToLabelConversion, [\n this\n ]);\n }\n generateTickLabels(ticks) {\n const tickOpts = this.options.ticks;\n let i, ilen, tick;\n for(i = 0, ilen = ticks.length; i < ilen; i++){\n tick = ticks[i];\n tick.label = callback(tickOpts.callback, [\n tick.value,\n i,\n ticks\n ], this);\n }\n }\n afterTickToLabelConversion() {\n callback(this.options.afterTickToLabelConversion, [\n this\n ]);\n }\n beforeCalculateLabelRotation() {\n callback(this.options.beforeCalculateLabelRotation, [\n this\n ]);\n }\n calculateLabelRotation() {\n const options = this.options;\n const tickOpts = options.ticks;\n const numTicks = getTicksLimit(this.ticks.length, options.ticks.maxTicksLimit);\n const minRotation = tickOpts.minRotation || 0;\n const maxRotation = tickOpts.maxRotation;\n let labelRotation = minRotation;\n let tickWidth, maxHeight, maxLabelDiagonal;\n if (!this._isVisible() || !tickOpts.display || minRotation >= maxRotation || numTicks <= 1 || !this.isHorizontal()) {\n this.labelRotation = minRotation;\n return;\n }\n const labelSizes = this._getLabelSizes();\n const maxLabelWidth = labelSizes.widest.width;\n const maxLabelHeight = labelSizes.highest.height;\n const maxWidth = _limitValue(this.chart.width - maxLabelWidth, 0, this.maxWidth);\n tickWidth = options.offset ? this.maxWidth / numTicks : maxWidth / (numTicks - 1);\n if (maxLabelWidth + 6 > tickWidth) {\n tickWidth = maxWidth / (numTicks - (options.offset ? 0.5 : 1));\n maxHeight = this.maxHeight - getTickMarkLength(options.grid) - tickOpts.padding - getTitleHeight(options.title, this.chart.options.font);\n maxLabelDiagonal = Math.sqrt(maxLabelWidth * maxLabelWidth + maxLabelHeight * maxLabelHeight);\n 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))));\n labelRotation = Math.max(minRotation, Math.min(maxRotation, labelRotation));\n }\n this.labelRotation = labelRotation;\n }\n afterCalculateLabelRotation() {\n callback(this.options.afterCalculateLabelRotation, [\n this\n ]);\n }\n afterAutoSkip() {}\n beforeFit() {\n callback(this.options.beforeFit, [\n this\n ]);\n }\n fit() {\n const minSize = {\n width: 0,\n height: 0\n };\n const { chart , options: { ticks: tickOpts , title: titleOpts , grid: gridOpts } } = this;\n const display = this._isVisible();\n const isHorizontal = this.isHorizontal();\n if (display) {\n const titleHeight = getTitleHeight(titleOpts, chart.options.font);\n if (isHorizontal) {\n minSize.width = this.maxWidth;\n minSize.height = getTickMarkLength(gridOpts) + titleHeight;\n } else {\n minSize.height = this.maxHeight;\n minSize.width = getTickMarkLength(gridOpts) + titleHeight;\n }\n if (tickOpts.display && this.ticks.length) {\n const { first , last , widest , highest } = this._getLabelSizes();\n const tickPadding = tickOpts.padding * 2;\n const angleRadians = toRadians(this.labelRotation);\n const cos = Math.cos(angleRadians);\n const sin = Math.sin(angleRadians);\n if (isHorizontal) {\n const labelHeight = tickOpts.mirror ? 0 : sin * widest.width + cos * highest.height;\n minSize.height = Math.min(this.maxHeight, minSize.height + labelHeight + tickPadding);\n } else {\n const labelWidth = tickOpts.mirror ? 0 : cos * widest.width + sin * highest.height;\n minSize.width = Math.min(this.maxWidth, minSize.width + labelWidth + tickPadding);\n }\n this._calculatePadding(first, last, sin, cos);\n }\n }\n this._handleMargins();\n if (isHorizontal) {\n this.width = this._length = chart.width - this._margins.left - this._margins.right;\n this.height = minSize.height;\n } else {\n this.width = minSize.width;\n this.height = this._length = chart.height - this._margins.top - this._margins.bottom;\n }\n }\n _calculatePadding(first, last, sin, cos) {\n const { ticks: { align , padding } , position } = this.options;\n const isRotated = this.labelRotation !== 0;\n const labelsBelowTicks = position !== 'top' && this.axis === 'x';\n if (this.isHorizontal()) {\n const offsetLeft = this.getPixelForTick(0) - this.left;\n const offsetRight = this.right - this.getPixelForTick(this.ticks.length - 1);\n let paddingLeft = 0;\n let paddingRight = 0;\n if (isRotated) {\n if (labelsBelowTicks) {\n paddingLeft = cos * first.width;\n paddingRight = sin * last.height;\n } else {\n paddingLeft = sin * first.height;\n paddingRight = cos * last.width;\n }\n } else if (align === 'start') {\n paddingRight = last.width;\n } else if (align === 'end') {\n paddingLeft = first.width;\n } else if (align !== 'inner') {\n paddingLeft = first.width / 2;\n paddingRight = last.width / 2;\n }\n this.paddingLeft = Math.max((paddingLeft - offsetLeft + padding) * this.width / (this.width - offsetLeft), 0);\n this.paddingRight = Math.max((paddingRight - offsetRight + padding) * this.width / (this.width - offsetRight), 0);\n } else {\n let paddingTop = last.height / 2;\n let paddingBottom = first.height / 2;\n if (align === 'start') {\n paddingTop = 0;\n paddingBottom = first.height;\n } else if (align === 'end') {\n paddingTop = last.height;\n paddingBottom = 0;\n }\n this.paddingTop = paddingTop + padding;\n this.paddingBottom = paddingBottom + padding;\n }\n }\n _handleMargins() {\n if (this._margins) {\n this._margins.left = Math.max(this.paddingLeft, this._margins.left);\n this._margins.top = Math.max(this.paddingTop, this._margins.top);\n this._margins.right = Math.max(this.paddingRight, this._margins.right);\n this._margins.bottom = Math.max(this.paddingBottom, this._margins.bottom);\n }\n }\n afterFit() {\n callback(this.options.afterFit, [\n this\n ]);\n }\n isHorizontal() {\n const { axis , position } = this.options;\n return position === 'top' || position === 'bottom' || axis === 'x';\n }\n isFullSize() {\n return this.options.fullSize;\n }\n _convertTicksToLabels(ticks) {\n this.beforeTickToLabelConversion();\n this.generateTickLabels(ticks);\n let i, ilen;\n for(i = 0, ilen = ticks.length; i < ilen; i++){\n if (isNullOrUndef(ticks[i].label)) {\n ticks.splice(i, 1);\n ilen--;\n i--;\n }\n }\n this.afterTickToLabelConversion();\n }\n _getLabelSizes() {\n let labelSizes = this._labelSizes;\n if (!labelSizes) {\n const sampleSize = this.options.ticks.sampleSize;\n let ticks = this.ticks;\n if (sampleSize < ticks.length) {\n ticks = sample(ticks, sampleSize);\n }\n this._labelSizes = labelSizes = this._computeLabelSizes(ticks, ticks.length, this.options.ticks.maxTicksLimit);\n }\n return labelSizes;\n }\n _computeLabelSizes(ticks, length, maxTicksLimit) {\n const { ctx , _longestTextCache: caches } = this;\n const widths = [];\n const heights = [];\n const increment = Math.floor(length / getTicksLimit(length, maxTicksLimit));\n let widestLabelSize = 0;\n let highestLabelSize = 0;\n let i, j, jlen, label, tickFont, fontString, cache, lineHeight, width, height, nestedLabel;\n for(i = 0; i < length; i += increment){\n label = ticks[i].label;\n tickFont = this._resolveTickFontOptions(i);\n ctx.font = fontString = tickFont.string;\n cache = caches[fontString] = caches[fontString] || {\n data: {},\n gc: []\n };\n lineHeight = tickFont.lineHeight;\n width = height = 0;\n if (!isNullOrUndef(label) && !isArray(label)) {\n width = _measureText(ctx, cache.data, cache.gc, width, label);\n height = lineHeight;\n } else if (isArray(label)) {\n for(j = 0, jlen = label.length; j < jlen; ++j){\n nestedLabel = label[j];\n if (!isNullOrUndef(nestedLabel) && !isArray(nestedLabel)) {\n width = _measureText(ctx, cache.data, cache.gc, width, nestedLabel);\n height += lineHeight;\n }\n }\n }\n widths.push(width);\n heights.push(height);\n widestLabelSize = Math.max(width, widestLabelSize);\n highestLabelSize = Math.max(height, highestLabelSize);\n }\n garbageCollect(caches, length);\n const widest = widths.indexOf(widestLabelSize);\n const highest = heights.indexOf(highestLabelSize);\n const valueAt = (idx)=>({\n width: widths[idx] || 0,\n height: heights[idx] || 0\n });\n return {\n first: valueAt(0),\n last: valueAt(length - 1),\n widest: valueAt(widest),\n highest: valueAt(highest),\n widths,\n heights\n };\n }\n getLabelForValue(value) {\n return value;\n }\n getPixelForValue(value, index) {\n return NaN;\n }\n getValueForPixel(pixel) {}\n getPixelForTick(index) {\n const ticks = this.ticks;\n if (index < 0 || index > ticks.length - 1) {\n return null;\n }\n return this.getPixelForValue(ticks[index].value);\n }\n getPixelForDecimal(decimal) {\n if (this._reversePixels) {\n decimal = 1 - decimal;\n }\n const pixel = this._startPixel + decimal * this._length;\n return _int16Range(this._alignToPixels ? _alignPixel(this.chart, pixel, 0) : pixel);\n }\n getDecimalForPixel(pixel) {\n const decimal = (pixel - this._startPixel) / this._length;\n return this._reversePixels ? 1 - decimal : decimal;\n }\n getBasePixel() {\n return this.getPixelForValue(this.getBaseValue());\n }\n getBaseValue() {\n const { min , max } = this;\n return min < 0 && max < 0 ? max : min > 0 && max > 0 ? min : 0;\n }\n getContext(index) {\n const ticks = this.ticks || [];\n if (index >= 0 && index < ticks.length) {\n const tick = ticks[index];\n return tick.$context || (tick.$context = createTickContext(this.getContext(), index, tick));\n }\n return this.$context || (this.$context = createScaleContext(this.chart.getContext(), this));\n }\n _tickSize() {\n const optionTicks = this.options.ticks;\n const rot = toRadians(this.labelRotation);\n const cos = Math.abs(Math.cos(rot));\n const sin = Math.abs(Math.sin(rot));\n const labelSizes = this._getLabelSizes();\n const padding = optionTicks.autoSkipPadding || 0;\n const w = labelSizes ? labelSizes.widest.width + padding : 0;\n const h = labelSizes ? labelSizes.highest.height + padding : 0;\n return this.isHorizontal() ? h * cos > w * sin ? w / cos : h / sin : h * sin < w * cos ? h / cos : w / sin;\n }\n _isVisible() {\n const display = this.options.display;\n if (display !== 'auto') {\n return !!display;\n }\n return this.getMatchingVisibleMetas().length > 0;\n }\n _computeGridLineItems(chartArea) {\n const axis = this.axis;\n const chart = this.chart;\n const options = this.options;\n const { grid , position , border } = options;\n const offset = grid.offset;\n const isHorizontal = this.isHorizontal();\n const ticks = this.ticks;\n const ticksLength = ticks.length + (offset ? 1 : 0);\n const tl = getTickMarkLength(grid);\n const items = [];\n const borderOpts = border.setContext(this.getContext());\n const axisWidth = borderOpts.display ? borderOpts.width : 0;\n const axisHalfWidth = axisWidth / 2;\n const alignBorderValue = function(pixel) {\n return _alignPixel(chart, pixel, axisWidth);\n };\n let borderValue, i, lineValue, alignedLineValue;\n let tx1, ty1, tx2, ty2, x1, y1, x2, y2;\n if (position === 'top') {\n borderValue = alignBorderValue(this.bottom);\n ty1 = this.bottom - tl;\n ty2 = borderValue - axisHalfWidth;\n y1 = alignBorderValue(chartArea.top) + axisHalfWidth;\n y2 = chartArea.bottom;\n } else if (position === 'bottom') {\n borderValue = alignBorderValue(this.top);\n y1 = chartArea.top;\n y2 = alignBorderValue(chartArea.bottom) - axisHalfWidth;\n ty1 = borderValue + axisHalfWidth;\n ty2 = this.top + tl;\n } else if (position === 'left') {\n borderValue = alignBorderValue(this.right);\n tx1 = this.right - tl;\n tx2 = borderValue - axisHalfWidth;\n x1 = alignBorderValue(chartArea.left) + axisHalfWidth;\n x2 = chartArea.right;\n } else if (position === 'right') {\n borderValue = alignBorderValue(this.left);\n x1 = chartArea.left;\n x2 = alignBorderValue(chartArea.right) - axisHalfWidth;\n tx1 = borderValue + axisHalfWidth;\n tx2 = this.left + tl;\n } else if (axis === 'x') {\n if (position === 'center') {\n borderValue = alignBorderValue((chartArea.top + chartArea.bottom) / 2 + 0.5);\n } else if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n borderValue = alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value));\n }\n y1 = chartArea.top;\n y2 = chartArea.bottom;\n ty1 = borderValue + axisHalfWidth;\n ty2 = ty1 + tl;\n } else if (axis === 'y') {\n if (position === 'center') {\n borderValue = alignBorderValue((chartArea.left + chartArea.right) / 2);\n } else if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n borderValue = alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value));\n }\n tx1 = borderValue - axisHalfWidth;\n tx2 = tx1 - tl;\n x1 = chartArea.left;\n x2 = chartArea.right;\n }\n const limit = valueOrDefault(options.ticks.maxTicksLimit, ticksLength);\n const step = Math.max(1, Math.ceil(ticksLength / limit));\n for(i = 0; i < ticksLength; i += step){\n const context = this.getContext(i);\n const optsAtIndex = grid.setContext(context);\n const optsAtIndexBorder = border.setContext(context);\n const lineWidth = optsAtIndex.lineWidth;\n const lineColor = optsAtIndex.color;\n const borderDash = optsAtIndexBorder.dash || [];\n const borderDashOffset = optsAtIndexBorder.dashOffset;\n const tickWidth = optsAtIndex.tickWidth;\n const tickColor = optsAtIndex.tickColor;\n const tickBorderDash = optsAtIndex.tickBorderDash || [];\n const tickBorderDashOffset = optsAtIndex.tickBorderDashOffset;\n lineValue = getPixelForGridLine(this, i, offset);\n if (lineValue === undefined) {\n continue;\n }\n alignedLineValue = _alignPixel(chart, lineValue, lineWidth);\n if (isHorizontal) {\n tx1 = tx2 = x1 = x2 = alignedLineValue;\n } else {\n ty1 = ty2 = y1 = y2 = alignedLineValue;\n }\n items.push({\n tx1,\n ty1,\n tx2,\n ty2,\n x1,\n y1,\n x2,\n y2,\n width: lineWidth,\n color: lineColor,\n borderDash,\n borderDashOffset,\n tickWidth,\n tickColor,\n tickBorderDash,\n tickBorderDashOffset\n });\n }\n this._ticksLength = ticksLength;\n this._borderValue = borderValue;\n return items;\n }\n _computeLabelItems(chartArea) {\n const axis = this.axis;\n const options = this.options;\n const { position , ticks: optionTicks } = options;\n const isHorizontal = this.isHorizontal();\n const ticks = this.ticks;\n const { align , crossAlign , padding , mirror } = optionTicks;\n const tl = getTickMarkLength(options.grid);\n const tickAndPadding = tl + padding;\n const hTickAndPadding = mirror ? -padding : tickAndPadding;\n const rotation = -toRadians(this.labelRotation);\n const items = [];\n let i, ilen, tick, label, x, y, textAlign, pixel, font, lineHeight, lineCount, textOffset;\n let textBaseline = 'middle';\n if (position === 'top') {\n y = this.bottom - hTickAndPadding;\n textAlign = this._getXAxisLabelAlignment();\n } else if (position === 'bottom') {\n y = this.top + hTickAndPadding;\n textAlign = this._getXAxisLabelAlignment();\n } else if (position === 'left') {\n const ret = this._getYAxisLabelAlignment(tl);\n textAlign = ret.textAlign;\n x = ret.x;\n } else if (position === 'right') {\n const ret = this._getYAxisLabelAlignment(tl);\n textAlign = ret.textAlign;\n x = ret.x;\n } else if (axis === 'x') {\n if (position === 'center') {\n y = (chartArea.top + chartArea.bottom) / 2 + tickAndPadding;\n } else if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n y = this.chart.scales[positionAxisID].getPixelForValue(value) + tickAndPadding;\n }\n textAlign = this._getXAxisLabelAlignment();\n } else if (axis === 'y') {\n if (position === 'center') {\n x = (chartArea.left + chartArea.right) / 2 - tickAndPadding;\n } else if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n x = this.chart.scales[positionAxisID].getPixelForValue(value);\n }\n textAlign = this._getYAxisLabelAlignment(tl).textAlign;\n }\n if (axis === 'y') {\n if (align === 'start') {\n textBaseline = 'top';\n } else if (align === 'end') {\n textBaseline = 'bottom';\n }\n }\n const labelSizes = this._getLabelSizes();\n for(i = 0, ilen = ticks.length; i < ilen; ++i){\n tick = ticks[i];\n label = tick.label;\n const optsAtIndex = optionTicks.setContext(this.getContext(i));\n pixel = this.getPixelForTick(i) + optionTicks.labelOffset;\n font = this._resolveTickFontOptions(i);\n lineHeight = font.lineHeight;\n lineCount = isArray(label) ? label.length : 1;\n const halfCount = lineCount / 2;\n const color = optsAtIndex.color;\n const strokeColor = optsAtIndex.textStrokeColor;\n const strokeWidth = optsAtIndex.textStrokeWidth;\n let tickTextAlign = textAlign;\n if (isHorizontal) {\n x = pixel;\n if (textAlign === 'inner') {\n if (i === ilen - 1) {\n tickTextAlign = !this.options.reverse ? 'right' : 'left';\n } else if (i === 0) {\n tickTextAlign = !this.options.reverse ? 'left' : 'right';\n } else {\n tickTextAlign = 'center';\n }\n }\n if (position === 'top') {\n if (crossAlign === 'near' || rotation !== 0) {\n textOffset = -lineCount * lineHeight + lineHeight / 2;\n } else if (crossAlign === 'center') {\n textOffset = -labelSizes.highest.height / 2 - halfCount * lineHeight + lineHeight;\n } else {\n textOffset = -labelSizes.highest.height + lineHeight / 2;\n }\n } else {\n if (crossAlign === 'near' || rotation !== 0) {\n textOffset = lineHeight / 2;\n } else if (crossAlign === 'center') {\n textOffset = labelSizes.highest.height / 2 - halfCount * lineHeight;\n } else {\n textOffset = labelSizes.highest.height - lineCount * lineHeight;\n }\n }\n if (mirror) {\n textOffset *= -1;\n }\n if (rotation !== 0 && !optsAtIndex.showLabelBackdrop) {\n x += lineHeight / 2 * Math.sin(rotation);\n }\n } else {\n y = pixel;\n textOffset = (1 - lineCount) * lineHeight / 2;\n }\n let backdrop;\n if (optsAtIndex.showLabelBackdrop) {\n const labelPadding = toPadding(optsAtIndex.backdropPadding);\n const height = labelSizes.heights[i];\n const width = labelSizes.widths[i];\n let top = textOffset - labelPadding.top;\n let left = 0 - labelPadding.left;\n switch(textBaseline){\n case 'middle':\n top -= height / 2;\n break;\n case 'bottom':\n top -= height;\n break;\n }\n switch(textAlign){\n case 'center':\n left -= width / 2;\n break;\n case 'right':\n left -= width;\n break;\n }\n backdrop = {\n left,\n top,\n width: width + labelPadding.width,\n height: height + labelPadding.height,\n color: optsAtIndex.backdropColor\n };\n }\n items.push({\n label,\n font,\n textOffset,\n options: {\n rotation,\n color,\n strokeColor,\n strokeWidth,\n textAlign: tickTextAlign,\n textBaseline,\n translation: [\n x,\n y\n ],\n backdrop\n }\n });\n }\n return items;\n }\n _getXAxisLabelAlignment() {\n const { position , ticks } = this.options;\n const rotation = -toRadians(this.labelRotation);\n if (rotation) {\n return position === 'top' ? 'left' : 'right';\n }\n let align = 'center';\n if (ticks.align === 'start') {\n align = 'left';\n } else if (ticks.align === 'end') {\n align = 'right';\n } else if (ticks.align === 'inner') {\n align = 'inner';\n }\n return align;\n }\n _getYAxisLabelAlignment(tl) {\n const { position , ticks: { crossAlign , mirror , padding } } = this.options;\n const labelSizes = this._getLabelSizes();\n const tickAndPadding = tl + padding;\n const widest = labelSizes.widest.width;\n let textAlign;\n let x;\n if (position === 'left') {\n if (mirror) {\n x = this.right + padding;\n if (crossAlign === 'near') {\n textAlign = 'left';\n } else if (crossAlign === 'center') {\n textAlign = 'center';\n x += widest / 2;\n } else {\n textAlign = 'right';\n x += widest;\n }\n } else {\n x = this.right - tickAndPadding;\n if (crossAlign === 'near') {\n textAlign = 'right';\n } else if (crossAlign === 'center') {\n textAlign = 'center';\n x -= widest / 2;\n } else {\n textAlign = 'left';\n x = this.left;\n }\n }\n } else if (position === 'right') {\n if (mirror) {\n x = this.left + padding;\n if (crossAlign === 'near') {\n textAlign = 'right';\n } else if (crossAlign === 'center') {\n textAlign = 'center';\n x -= widest / 2;\n } else {\n textAlign = 'left';\n x -= widest;\n }\n } else {\n x = this.left + tickAndPadding;\n if (crossAlign === 'near') {\n textAlign = 'left';\n } else if (crossAlign === 'center') {\n textAlign = 'center';\n x += widest / 2;\n } else {\n textAlign = 'right';\n x = this.right;\n }\n }\n } else {\n textAlign = 'right';\n }\n return {\n textAlign,\n x\n };\n }\n _computeLabelArea() {\n if (this.options.ticks.mirror) {\n return;\n }\n const chart = this.chart;\n const position = this.options.position;\n if (position === 'left' || position === 'right') {\n return {\n top: 0,\n left: this.left,\n bottom: chart.height,\n right: this.right\n };\n }\n if (position === 'top' || position === 'bottom') {\n return {\n top: this.top,\n left: 0,\n bottom: this.bottom,\n right: chart.width\n };\n }\n }\n drawBackground() {\n const { ctx , options: { backgroundColor } , left , top , width , height } = this;\n if (backgroundColor) {\n ctx.save();\n ctx.fillStyle = backgroundColor;\n ctx.fillRect(left, top, width, height);\n ctx.restore();\n }\n }\n getLineWidthForValue(value) {\n const grid = this.options.grid;\n if (!this._isVisible() || !grid.display) {\n return 0;\n }\n const ticks = this.ticks;\n const index = ticks.findIndex((t)=>t.value === value);\n if (index >= 0) {\n const opts = grid.setContext(this.getContext(index));\n return opts.lineWidth;\n }\n return 0;\n }\n drawGrid(chartArea) {\n const grid = this.options.grid;\n const ctx = this.ctx;\n const items = this._gridLineItems || (this._gridLineItems = this._computeGridLineItems(chartArea));\n let i, ilen;\n const drawLine = (p1, p2, style)=>{\n if (!style.width || !style.color) {\n return;\n }\n ctx.save();\n ctx.lineWidth = style.width;\n ctx.strokeStyle = style.color;\n ctx.setLineDash(style.borderDash || []);\n ctx.lineDashOffset = style.borderDashOffset;\n ctx.beginPath();\n ctx.moveTo(p1.x, p1.y);\n ctx.lineTo(p2.x, p2.y);\n ctx.stroke();\n ctx.restore();\n };\n if (grid.display) {\n for(i = 0, ilen = items.length; i < ilen; ++i){\n const item = items[i];\n if (grid.drawOnChartArea) {\n drawLine({\n x: item.x1,\n y: item.y1\n }, {\n x: item.x2,\n y: item.y2\n }, item);\n }\n if (grid.drawTicks) {\n drawLine({\n x: item.tx1,\n y: item.ty1\n }, {\n x: item.tx2,\n y: item.ty2\n }, {\n color: item.tickColor,\n width: item.tickWidth,\n borderDash: item.tickBorderDash,\n borderDashOffset: item.tickBorderDashOffset\n });\n }\n }\n }\n }\n drawBorder() {\n const { chart , ctx , options: { border , grid } } = this;\n const borderOpts = border.setContext(this.getContext());\n const axisWidth = border.display ? borderOpts.width : 0;\n if (!axisWidth) {\n return;\n }\n const lastLineWidth = grid.setContext(this.getContext(0)).lineWidth;\n const borderValue = this._borderValue;\n let x1, x2, y1, y2;\n if (this.isHorizontal()) {\n x1 = _alignPixel(chart, this.left, axisWidth) - axisWidth / 2;\n x2 = _alignPixel(chart, this.right, lastLineWidth) + lastLineWidth / 2;\n y1 = y2 = borderValue;\n } else {\n y1 = _alignPixel(chart, this.top, axisWidth) - axisWidth / 2;\n y2 = _alignPixel(chart, this.bottom, lastLineWidth) + lastLineWidth / 2;\n x1 = x2 = borderValue;\n }\n ctx.save();\n ctx.lineWidth = borderOpts.width;\n ctx.strokeStyle = borderOpts.color;\n ctx.beginPath();\n ctx.moveTo(x1, y1);\n ctx.lineTo(x2, y2);\n ctx.stroke();\n ctx.restore();\n }\n drawLabels(chartArea) {\n const optionTicks = this.options.ticks;\n if (!optionTicks.display) {\n return;\n }\n const ctx = this.ctx;\n const area = this._computeLabelArea();\n if (area) {\n clipArea(ctx, area);\n }\n const items = this.getLabelItems(chartArea);\n for (const item of items){\n const renderTextOptions = item.options;\n const tickFont = item.font;\n const label = item.label;\n const y = item.textOffset;\n renderText(ctx, label, 0, y, tickFont, renderTextOptions);\n }\n if (area) {\n unclipArea(ctx);\n }\n }\n drawTitle() {\n const { ctx , options: { position , title , reverse } } = this;\n if (!title.display) {\n return;\n }\n const font = toFont(title.font);\n const padding = toPadding(title.padding);\n const align = title.align;\n let offset = font.lineHeight / 2;\n if (position === 'bottom' || position === 'center' || isObject(position)) {\n offset += padding.bottom;\n if (isArray(title.text)) {\n offset += font.lineHeight * (title.text.length - 1);\n }\n } else {\n offset += padding.top;\n }\n const { titleX , titleY , maxWidth , rotation } = titleArgs(this, offset, position, align);\n renderText(ctx, title.text, 0, 0, font, {\n color: title.color,\n maxWidth,\n rotation,\n textAlign: titleAlign(align, position, reverse),\n textBaseline: 'middle',\n translation: [\n titleX,\n titleY\n ]\n });\n }\n draw(chartArea) {\n if (!this._isVisible()) {\n return;\n }\n this.drawBackground();\n this.drawGrid(chartArea);\n this.drawBorder();\n this.drawTitle();\n this.drawLabels(chartArea);\n }\n _layers() {\n const opts = this.options;\n const tz = opts.ticks && opts.ticks.z || 0;\n const gz = valueOrDefault(opts.grid && opts.grid.z, -1);\n const bz = valueOrDefault(opts.border && opts.border.z, 0);\n if (!this._isVisible() || this.draw !== Scale.prototype.draw) {\n return [\n {\n z: tz,\n draw: (chartArea)=>{\n this.draw(chartArea);\n }\n }\n ];\n }\n return [\n {\n z: gz,\n draw: (chartArea)=>{\n this.drawBackground();\n this.drawGrid(chartArea);\n this.drawTitle();\n }\n },\n {\n z: bz,\n draw: ()=>{\n this.drawBorder();\n }\n },\n {\n z: tz,\n draw: (chartArea)=>{\n this.drawLabels(chartArea);\n }\n }\n ];\n }\n getMatchingVisibleMetas(type) {\n const metas = this.chart.getSortedVisibleDatasetMetas();\n const axisID = this.axis + 'AxisID';\n const result = [];\n let i, ilen;\n for(i = 0, ilen = metas.length; i < ilen; ++i){\n const meta = metas[i];\n if (meta[axisID] === this.id && (!type || meta.type === type)) {\n result.push(meta);\n }\n }\n return result;\n }\n _resolveTickFontOptions(index) {\n const opts = this.options.ticks.setContext(this.getContext(index));\n return toFont(opts.font);\n }\n _maxDigits() {\n const fontSize = this._resolveTickFontOptions(0).lineHeight;\n return (this.isHorizontal() ? this.width : this.height) / fontSize;\n }\n}\n\nclass TypedRegistry {\n constructor(type, scope, override){\n this.type = type;\n this.scope = scope;\n this.override = override;\n this.items = Object.create(null);\n }\n isForType(type) {\n return Object.prototype.isPrototypeOf.call(this.type.prototype, type.prototype);\n }\n register(item) {\n const proto = Object.getPrototypeOf(item);\n let parentScope;\n if (isIChartComponent(proto)) {\n parentScope = this.register(proto);\n }\n const items = this.items;\n const id = item.id;\n const scope = this.scope + '.' + id;\n if (!id) {\n throw new Error('class does not have id: ' + item);\n }\n if (id in items) {\n return scope;\n }\n items[id] = item;\n registerDefaults(item, scope, parentScope);\n if (this.override) {\n defaults.override(item.id, item.overrides);\n }\n return scope;\n }\n get(id) {\n return this.items[id];\n }\n unregister(item) {\n const items = this.items;\n const id = item.id;\n const scope = this.scope;\n if (id in items) {\n delete items[id];\n }\n if (scope && id in defaults[scope]) {\n delete defaults[scope][id];\n if (this.override) {\n delete overrides[id];\n }\n }\n }\n}\nfunction registerDefaults(item, scope, parentScope) {\n const itemDefaults = merge(Object.create(null), [\n parentScope ? defaults.get(parentScope) : {},\n defaults.get(scope),\n item.defaults\n ]);\n defaults.set(scope, itemDefaults);\n if (item.defaultRoutes) {\n routeDefaults(scope, item.defaultRoutes);\n }\n if (item.descriptors) {\n defaults.describe(scope, item.descriptors);\n }\n}\nfunction routeDefaults(scope, routes) {\n Object.keys(routes).forEach((property)=>{\n const propertyParts = property.split('.');\n const sourceName = propertyParts.pop();\n const sourceScope = [\n scope\n ].concat(propertyParts).join('.');\n const parts = routes[property].split('.');\n const targetName = parts.pop();\n const targetScope = parts.join('.');\n defaults.route(sourceScope, sourceName, targetScope, targetName);\n });\n}\nfunction isIChartComponent(proto) {\n return 'id' in proto && 'defaults' in proto;\n}\n\nclass Registry {\n constructor(){\n this.controllers = new TypedRegistry(DatasetController, 'datasets', true);\n this.elements = new TypedRegistry(Element, 'elements');\n this.plugins = new TypedRegistry(Object, 'plugins');\n this.scales = new TypedRegistry(Scale, 'scales');\n this._typedRegistries = [\n this.controllers,\n this.scales,\n this.elements\n ];\n }\n add(...args) {\n this._each('register', args);\n }\n remove(...args) {\n this._each('unregister', args);\n }\n addControllers(...args) {\n this._each('register', args, this.controllers);\n }\n addElements(...args) {\n this._each('register', args, this.elements);\n }\n addPlugins(...args) {\n this._each('register', args, this.plugins);\n }\n addScales(...args) {\n this._each('register', args, this.scales);\n }\n getController(id) {\n return this._get(id, this.controllers, 'controller');\n }\n getElement(id) {\n return this._get(id, this.elements, 'element');\n }\n getPlugin(id) {\n return this._get(id, this.plugins, 'plugin');\n }\n getScale(id) {\n return this._get(id, this.scales, 'scale');\n }\n removeControllers(...args) {\n this._each('unregister', args, this.controllers);\n }\n removeElements(...args) {\n this._each('unregister', args, this.elements);\n }\n removePlugins(...args) {\n this._each('unregister', args, this.plugins);\n }\n removeScales(...args) {\n this._each('unregister', args, this.scales);\n }\n _each(method, args, typedRegistry) {\n [\n ...args\n ].forEach((arg)=>{\n const reg = typedRegistry || this._getRegistryForType(arg);\n if (typedRegistry || reg.isForType(arg) || reg === this.plugins && arg.id) {\n this._exec(method, reg, arg);\n } else {\n each(arg, (item)=>{\n const itemReg = typedRegistry || this._getRegistryForType(item);\n this._exec(method, itemReg, item);\n });\n }\n });\n }\n _exec(method, registry, component) {\n const camelMethod = _capitalize(method);\n callback(component['before' + camelMethod], [], component);\n registry[method](component);\n callback(component['after' + camelMethod], [], component);\n }\n _getRegistryForType(type) {\n for(let i = 0; i < this._typedRegistries.length; i++){\n const reg = this._typedRegistries[i];\n if (reg.isForType(type)) {\n return reg;\n }\n }\n return this.plugins;\n }\n _get(id, typedRegistry, type) {\n const item = typedRegistry.get(id);\n if (item === undefined) {\n throw new Error('\"' + id + '\" is not a registered ' + type + '.');\n }\n return item;\n }\n}\nvar registry = /* #__PURE__ */ new Registry();\n\nclass PluginService {\n constructor(){\n this._init = [];\n }\n notify(chart, hook, args, filter) {\n if (hook === 'beforeInit') {\n this._init = this._createDescriptors(chart, true);\n this._notify(this._init, chart, 'install');\n }\n const descriptors = filter ? this._descriptors(chart).filter(filter) : this._descriptors(chart);\n const result = this._notify(descriptors, chart, hook, args);\n if (hook === 'afterDestroy') {\n this._notify(descriptors, chart, 'stop');\n this._notify(this._init, chart, 'uninstall');\n }\n return result;\n }\n _notify(descriptors, chart, hook, args) {\n args = args || {};\n for (const descriptor of descriptors){\n const plugin = descriptor.plugin;\n const method = plugin[hook];\n const params = [\n chart,\n args,\n descriptor.options\n ];\n if (callback(method, params, plugin) === false && args.cancelable) {\n return false;\n }\n }\n return true;\n }\n invalidate() {\n if (!isNullOrUndef(this._cache)) {\n this._oldCache = this._cache;\n this._cache = undefined;\n }\n }\n _descriptors(chart) {\n if (this._cache) {\n return this._cache;\n }\n const descriptors = this._cache = this._createDescriptors(chart);\n this._notifyStateChanges(chart);\n return descriptors;\n }\n _createDescriptors(chart, all) {\n const config = chart && chart.config;\n const options = valueOrDefault(config.options && config.options.plugins, {});\n const plugins = allPlugins(config);\n return options === false && !all ? [] : createDescriptors(chart, plugins, options, all);\n }\n _notifyStateChanges(chart) {\n const previousDescriptors = this._oldCache || [];\n const descriptors = this._cache;\n const diff = (a, b)=>a.filter((x)=>!b.some((y)=>x.plugin.id === y.plugin.id));\n this._notify(diff(previousDescriptors, descriptors), chart, 'stop');\n this._notify(diff(descriptors, previousDescriptors), chart, 'start');\n }\n}\n function allPlugins(config) {\n const localIds = {};\n const plugins = [];\n const keys = Object.keys(registry.plugins.items);\n for(let i = 0; i < keys.length; i++){\n plugins.push(registry.getPlugin(keys[i]));\n }\n const local = config.plugins || [];\n for(let i = 0; i < local.length; i++){\n const plugin = local[i];\n if (plugins.indexOf(plugin) === -1) {\n plugins.push(plugin);\n localIds[plugin.id] = true;\n }\n }\n return {\n plugins,\n localIds\n };\n}\nfunction getOpts(options, all) {\n if (!all && options === false) {\n return null;\n }\n if (options === true) {\n return {};\n }\n return options;\n}\nfunction createDescriptors(chart, { plugins , localIds }, options, all) {\n const result = [];\n const context = chart.getContext();\n for (const plugin of plugins){\n const id = plugin.id;\n const opts = getOpts(options[id], all);\n if (opts === null) {\n continue;\n }\n result.push({\n plugin,\n options: pluginOpts(chart.config, {\n plugin,\n local: localIds[id]\n }, opts, context)\n });\n }\n return result;\n}\nfunction pluginOpts(config, { plugin , local }, opts, context) {\n const keys = config.pluginScopeKeys(plugin);\n const scopes = config.getOptionScopes(opts, keys);\n if (local && plugin.defaults) {\n scopes.push(plugin.defaults);\n }\n return config.createResolver(scopes, context, [\n ''\n ], {\n scriptable: false,\n indexable: false,\n allKeys: true\n });\n}\n\nfunction getIndexAxis(type, options) {\n const datasetDefaults = defaults.datasets[type] || {};\n const datasetOptions = (options.datasets || {})[type] || {};\n return datasetOptions.indexAxis || options.indexAxis || datasetDefaults.indexAxis || 'x';\n}\nfunction getAxisFromDefaultScaleID(id, indexAxis) {\n let axis = id;\n if (id === '_index_') {\n axis = indexAxis;\n } else if (id === '_value_') {\n axis = indexAxis === 'x' ? 'y' : 'x';\n }\n return axis;\n}\nfunction getDefaultScaleIDFromAxis(axis, indexAxis) {\n return axis === indexAxis ? '_index_' : '_value_';\n}\nfunction idMatchesAxis(id) {\n if (id === 'x' || id === 'y' || id === 'r') {\n return id;\n }\n}\nfunction axisFromPosition(position) {\n if (position === 'top' || position === 'bottom') {\n return 'x';\n }\n if (position === 'left' || position === 'right') {\n return 'y';\n }\n}\nfunction determineAxis(id, ...scaleOptions) {\n if (idMatchesAxis(id)) {\n return id;\n }\n for (const opts of scaleOptions){\n const axis = opts.axis || axisFromPosition(opts.position) || id.length > 1 && idMatchesAxis(id[0].toLowerCase());\n if (axis) {\n return axis;\n }\n }\n throw new Error(`Cannot determine type of '${id}' axis. Please provide 'axis' or 'position' option.`);\n}\nfunction getAxisFromDataset(id, axis, dataset) {\n if (dataset[axis + 'AxisID'] === id) {\n return {\n axis\n };\n }\n}\nfunction retrieveAxisFromDatasets(id, config) {\n if (config.data && config.data.datasets) {\n const boundDs = config.data.datasets.filter((d)=>d.xAxisID === id || d.yAxisID === id);\n if (boundDs.length) {\n return getAxisFromDataset(id, 'x', boundDs[0]) || getAxisFromDataset(id, 'y', boundDs[0]);\n }\n }\n return {};\n}\nfunction mergeScaleConfig(config, options) {\n const chartDefaults = overrides[config.type] || {\n scales: {}\n };\n const configScales = options.scales || {};\n const chartIndexAxis = getIndexAxis(config.type, options);\n const scales = Object.create(null);\n Object.keys(configScales).forEach((id)=>{\n const scaleConf = configScales[id];\n if (!isObject(scaleConf)) {\n return console.error(`Invalid scale configuration for scale: ${id}`);\n }\n if (scaleConf._proxy) {\n return console.warn(`Ignoring resolver passed as options for scale: ${id}`);\n }\n const axis = determineAxis(id, scaleConf, retrieveAxisFromDatasets(id, config), defaults.scales[scaleConf.type]);\n const defaultId = getDefaultScaleIDFromAxis(axis, chartIndexAxis);\n const defaultScaleOptions = chartDefaults.scales || {};\n scales[id] = mergeIf(Object.create(null), [\n {\n axis\n },\n scaleConf,\n defaultScaleOptions[axis],\n defaultScaleOptions[defaultId]\n ]);\n });\n config.data.datasets.forEach((dataset)=>{\n const type = dataset.type || config.type;\n const indexAxis = dataset.indexAxis || getIndexAxis(type, options);\n const datasetDefaults = overrides[type] || {};\n const defaultScaleOptions = datasetDefaults.scales || {};\n Object.keys(defaultScaleOptions).forEach((defaultID)=>{\n const axis = getAxisFromDefaultScaleID(defaultID, indexAxis);\n const id = dataset[axis + 'AxisID'] || axis;\n scales[id] = scales[id] || Object.create(null);\n mergeIf(scales[id], [\n {\n axis\n },\n configScales[id],\n defaultScaleOptions[defaultID]\n ]);\n });\n });\n Object.keys(scales).forEach((key)=>{\n const scale = scales[key];\n mergeIf(scale, [\n defaults.scales[scale.type],\n defaults.scale\n ]);\n });\n return scales;\n}\nfunction initOptions(config) {\n const options = config.options || (config.options = {});\n options.plugins = valueOrDefault(options.plugins, {});\n options.scales = mergeScaleConfig(config, options);\n}\nfunction initData(data) {\n data = data || {};\n data.datasets = data.datasets || [];\n data.labels = data.labels || [];\n return data;\n}\nfunction initConfig(config) {\n config = config || {};\n config.data = initData(config.data);\n initOptions(config);\n return config;\n}\nconst keyCache = new Map();\nconst keysCached = new Set();\nfunction cachedKeys(cacheKey, generate) {\n let keys = keyCache.get(cacheKey);\n if (!keys) {\n keys = generate();\n keyCache.set(cacheKey, keys);\n keysCached.add(keys);\n }\n return keys;\n}\nconst addIfFound = (set, obj, key)=>{\n const opts = resolveObjectKey(obj, key);\n if (opts !== undefined) {\n set.add(opts);\n }\n};\nclass Config {\n constructor(config){\n this._config = initConfig(config);\n this._scopeCache = new Map();\n this._resolverCache = new Map();\n }\n get platform() {\n return this._config.platform;\n }\n get type() {\n return this._config.type;\n }\n set type(type) {\n this._config.type = type;\n }\n get data() {\n return this._config.data;\n }\n set data(data) {\n this._config.data = initData(data);\n }\n get options() {\n return this._config.options;\n }\n set options(options) {\n this._config.options = options;\n }\n get plugins() {\n return this._config.plugins;\n }\n update() {\n const config = this._config;\n this.clearCache();\n initOptions(config);\n }\n clearCache() {\n this._scopeCache.clear();\n this._resolverCache.clear();\n }\n datasetScopeKeys(datasetType) {\n return cachedKeys(datasetType, ()=>[\n [\n `datasets.${datasetType}`,\n ''\n ]\n ]);\n }\n datasetAnimationScopeKeys(datasetType, transition) {\n return cachedKeys(`${datasetType}.transition.${transition}`, ()=>[\n [\n `datasets.${datasetType}.transitions.${transition}`,\n `transitions.${transition}`\n ],\n [\n `datasets.${datasetType}`,\n ''\n ]\n ]);\n }\n datasetElementScopeKeys(datasetType, elementType) {\n return cachedKeys(`${datasetType}-${elementType}`, ()=>[\n [\n `datasets.${datasetType}.elements.${elementType}`,\n `datasets.${datasetType}`,\n `elements.${elementType}`,\n ''\n ]\n ]);\n }\n pluginScopeKeys(plugin) {\n const id = plugin.id;\n const type = this.type;\n return cachedKeys(`${type}-plugin-${id}`, ()=>[\n [\n `plugins.${id}`,\n ...plugin.additionalOptionScopes || []\n ]\n ]);\n }\n _cachedScopes(mainScope, resetCache) {\n const _scopeCache = this._scopeCache;\n let cache = _scopeCache.get(mainScope);\n if (!cache || resetCache) {\n cache = new Map();\n _scopeCache.set(mainScope, cache);\n }\n return cache;\n }\n getOptionScopes(mainScope, keyLists, resetCache) {\n const { options , type } = this;\n const cache = this._cachedScopes(mainScope, resetCache);\n const cached = cache.get(keyLists);\n if (cached) {\n return cached;\n }\n const scopes = new Set();\n keyLists.forEach((keys)=>{\n if (mainScope) {\n scopes.add(mainScope);\n keys.forEach((key)=>addIfFound(scopes, mainScope, key));\n }\n keys.forEach((key)=>addIfFound(scopes, options, key));\n keys.forEach((key)=>addIfFound(scopes, overrides[type] || {}, key));\n keys.forEach((key)=>addIfFound(scopes, defaults, key));\n keys.forEach((key)=>addIfFound(scopes, descriptors, key));\n });\n const array = Array.from(scopes);\n if (array.length === 0) {\n array.push(Object.create(null));\n }\n if (keysCached.has(keyLists)) {\n cache.set(keyLists, array);\n }\n return array;\n }\n chartOptionScopes() {\n const { options , type } = this;\n return [\n options,\n overrides[type] || {},\n defaults.datasets[type] || {},\n {\n type\n },\n defaults,\n descriptors\n ];\n }\n resolveNamedOptions(scopes, names, context, prefixes = [\n ''\n ]) {\n const result = {\n $shared: true\n };\n const { resolver , subPrefixes } = getResolver(this._resolverCache, scopes, prefixes);\n let options = resolver;\n if (needContext(resolver, names)) {\n result.$shared = false;\n context = isFunction(context) ? context() : context;\n const subResolver = this.createResolver(scopes, context, subPrefixes);\n options = _attachContext(resolver, context, subResolver);\n }\n for (const prop of names){\n result[prop] = options[prop];\n }\n return result;\n }\n createResolver(scopes, context, prefixes = [\n ''\n ], descriptorDefaults) {\n const { resolver } = getResolver(this._resolverCache, scopes, prefixes);\n return isObject(context) ? _attachContext(resolver, context, undefined, descriptorDefaults) : resolver;\n }\n}\nfunction getResolver(resolverCache, scopes, prefixes) {\n let cache = resolverCache.get(scopes);\n if (!cache) {\n cache = new Map();\n resolverCache.set(scopes, cache);\n }\n const cacheKey = prefixes.join();\n let cached = cache.get(cacheKey);\n if (!cached) {\n const resolver = _createResolver(scopes, prefixes);\n cached = {\n resolver,\n subPrefixes: prefixes.filter((p)=>!p.toLowerCase().includes('hover'))\n };\n cache.set(cacheKey, cached);\n }\n return cached;\n}\nconst hasFunction = (value)=>isObject(value) && Object.getOwnPropertyNames(value).reduce((acc, key)=>acc || isFunction(value[key]), false);\nfunction needContext(proxy, names) {\n const { isScriptable , isIndexable } = _descriptors(proxy);\n for (const prop of names){\n const scriptable = isScriptable(prop);\n const indexable = isIndexable(prop);\n const value = (indexable || scriptable) && proxy[prop];\n if (scriptable && (isFunction(value) || hasFunction(value)) || indexable && isArray(value)) {\n return true;\n }\n }\n return false;\n}\n\nvar version = \"4.3.3\";\n\nconst KNOWN_POSITIONS = [\n 'top',\n 'bottom',\n 'left',\n 'right',\n 'chartArea'\n];\nfunction positionIsHorizontal(position, axis) {\n return position === 'top' || position === 'bottom' || KNOWN_POSITIONS.indexOf(position) === -1 && axis === 'x';\n}\nfunction compare2Level(l1, l2) {\n return function(a, b) {\n return a[l1] === b[l1] ? a[l2] - b[l2] : a[l1] - b[l1];\n };\n}\nfunction onAnimationsComplete(context) {\n const chart = context.chart;\n const animationOptions = chart.options.animation;\n chart.notifyPlugins('afterRender');\n callback(animationOptions && animationOptions.onComplete, [\n context\n ], chart);\n}\nfunction onAnimationProgress(context) {\n const chart = context.chart;\n const animationOptions = chart.options.animation;\n callback(animationOptions && animationOptions.onProgress, [\n context\n ], chart);\n}\n function getCanvas(item) {\n if (_isDomSupported() && typeof item === 'string') {\n item = document.getElementById(item);\n } else if (item && item.length) {\n item = item[0];\n }\n if (item && item.canvas) {\n item = item.canvas;\n }\n return item;\n}\nconst instances = {};\nconst getChart = (key)=>{\n const canvas = getCanvas(key);\n return Object.values(instances).filter((c)=>c.canvas === canvas).pop();\n};\nfunction moveNumericKeys(obj, start, move) {\n const keys = Object.keys(obj);\n for (const key of keys){\n const intKey = +key;\n if (intKey >= start) {\n const value = obj[key];\n delete obj[key];\n if (move > 0 || intKey > start) {\n obj[intKey + move] = value;\n }\n }\n }\n}\n function determineLastEvent(e, lastEvent, inChartArea, isClick) {\n if (!inChartArea || e.type === 'mouseout') {\n return null;\n }\n if (isClick) {\n return lastEvent;\n }\n return e;\n}\nfunction getDatasetArea(meta) {\n const { xScale , yScale } = meta;\n if (xScale && yScale) {\n return {\n left: xScale.left,\n right: xScale.right,\n top: yScale.top,\n bottom: yScale.bottom\n };\n }\n}\nclass Chart {\n static defaults = defaults;\n static instances = instances;\n static overrides = overrides;\n static registry = registry;\n static version = version;\n static getChart = getChart;\n static register(...items) {\n registry.add(...items);\n invalidatePlugins();\n }\n static unregister(...items) {\n registry.remove(...items);\n invalidatePlugins();\n }\n constructor(item, userConfig){\n const config = this.config = new Config(userConfig);\n const initialCanvas = getCanvas(item);\n const existingChart = getChart(initialCanvas);\n if (existingChart) {\n throw new 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.');\n }\n const options = config.createResolver(config.chartOptionScopes(), this.getContext());\n this.platform = new (config.platform || _detectPlatform(initialCanvas))();\n this.platform.updateConfig(config);\n const context = this.platform.acquireContext(initialCanvas, options.aspectRatio);\n const canvas = context && context.canvas;\n const height = canvas && canvas.height;\n const width = canvas && canvas.width;\n this.id = uid();\n this.ctx = context;\n this.canvas = canvas;\n this.width = width;\n this.height = height;\n this._options = options;\n this._aspectRatio = this.aspectRatio;\n this._layers = [];\n this._metasets = [];\n this._stacks = undefined;\n this.boxes = [];\n this.currentDevicePixelRatio = undefined;\n this.chartArea = undefined;\n this._active = [];\n this._lastEvent = undefined;\n this._listeners = {};\n this._responsiveListeners = undefined;\n this._sortedMetasets = [];\n this.scales = {};\n this._plugins = new PluginService();\n this.$proxies = {};\n this._hiddenIndices = {};\n this.attached = false;\n this._animationsDisabled = undefined;\n this.$context = undefined;\n this._doResize = debounce((mode)=>this.update(mode), options.resizeDelay || 0);\n this._dataChanges = [];\n instances[this.id] = this;\n if (!context || !canvas) {\n console.error(\"Failed to create chart: can't acquire context from the given item\");\n return;\n }\n animator.listen(this, 'complete', onAnimationsComplete);\n animator.listen(this, 'progress', onAnimationProgress);\n this._initialize();\n if (this.attached) {\n this.update();\n }\n }\n get aspectRatio() {\n const { options: { aspectRatio , maintainAspectRatio } , width , height , _aspectRatio } = this;\n if (!isNullOrUndef(aspectRatio)) {\n return aspectRatio;\n }\n if (maintainAspectRatio && _aspectRatio) {\n return _aspectRatio;\n }\n return height ? width / height : null;\n }\n get data() {\n return this.config.data;\n }\n set data(data) {\n this.config.data = data;\n }\n get options() {\n return this._options;\n }\n set options(options) {\n this.config.options = options;\n }\n get registry() {\n return registry;\n }\n _initialize() {\n this.notifyPlugins('beforeInit');\n if (this.options.responsive) {\n this.resize();\n } else {\n retinaScale(this, this.options.devicePixelRatio);\n }\n this.bindEvents();\n this.notifyPlugins('afterInit');\n return this;\n }\n clear() {\n clearCanvas(this.canvas, this.ctx);\n return this;\n }\n stop() {\n animator.stop(this);\n return this;\n }\n resize(width, height) {\n if (!animator.running(this)) {\n this._resize(width, height);\n } else {\n this._resizeBeforeDraw = {\n width,\n height\n };\n }\n }\n _resize(width, height) {\n const options = this.options;\n const canvas = this.canvas;\n const aspectRatio = options.maintainAspectRatio && this.aspectRatio;\n const newSize = this.platform.getMaximumSize(canvas, width, height, aspectRatio);\n const newRatio = options.devicePixelRatio || this.platform.getDevicePixelRatio();\n const mode = this.width ? 'resize' : 'attach';\n this.width = newSize.width;\n this.height = newSize.height;\n this._aspectRatio = this.aspectRatio;\n if (!retinaScale(this, newRatio, true)) {\n return;\n }\n this.notifyPlugins('resize', {\n size: newSize\n });\n callback(options.onResize, [\n this,\n newSize\n ], this);\n if (this.attached) {\n if (this._doResize(mode)) {\n this.render();\n }\n }\n }\n ensureScalesHaveIDs() {\n const options = this.options;\n const scalesOptions = options.scales || {};\n each(scalesOptions, (axisOptions, axisID)=>{\n axisOptions.id = axisID;\n });\n }\n buildOrUpdateScales() {\n const options = this.options;\n const scaleOpts = options.scales;\n const scales = this.scales;\n const updated = Object.keys(scales).reduce((obj, id)=>{\n obj[id] = false;\n return obj;\n }, {});\n let items = [];\n if (scaleOpts) {\n items = items.concat(Object.keys(scaleOpts).map((id)=>{\n const scaleOptions = scaleOpts[id];\n const axis = determineAxis(id, scaleOptions);\n const isRadial = axis === 'r';\n const isHorizontal = axis === 'x';\n return {\n options: scaleOptions,\n dposition: isRadial ? 'chartArea' : isHorizontal ? 'bottom' : 'left',\n dtype: isRadial ? 'radialLinear' : isHorizontal ? 'category' : 'linear'\n };\n }));\n }\n each(items, (item)=>{\n const scaleOptions = item.options;\n const id = scaleOptions.id;\n const axis = determineAxis(id, scaleOptions);\n const scaleType = valueOrDefault(scaleOptions.type, item.dtype);\n if (scaleOptions.position === undefined || positionIsHorizontal(scaleOptions.position, axis) !== positionIsHorizontal(item.dposition)) {\n scaleOptions.position = item.dposition;\n }\n updated[id] = true;\n let scale = null;\n if (id in scales && scales[id].type === scaleType) {\n scale = scales[id];\n } else {\n const scaleClass = registry.getScale(scaleType);\n scale = new scaleClass({\n id,\n type: scaleType,\n ctx: this.ctx,\n chart: this\n });\n scales[scale.id] = scale;\n }\n scale.init(scaleOptions, options);\n });\n each(updated, (hasUpdated, id)=>{\n if (!hasUpdated) {\n delete scales[id];\n }\n });\n each(scales, (scale)=>{\n layouts.configure(this, scale, scale.options);\n layouts.addBox(this, scale);\n });\n }\n _updateMetasets() {\n const metasets = this._metasets;\n const numData = this.data.datasets.length;\n const numMeta = metasets.length;\n metasets.sort((a, b)=>a.index - b.index);\n if (numMeta > numData) {\n for(let i = numData; i < numMeta; ++i){\n this._destroyDatasetMeta(i);\n }\n metasets.splice(numData, numMeta - numData);\n }\n this._sortedMetasets = metasets.slice(0).sort(compare2Level('order', 'index'));\n }\n _removeUnreferencedMetasets() {\n const { _metasets: metasets , data: { datasets } } = this;\n if (metasets.length > datasets.length) {\n delete this._stacks;\n }\n metasets.forEach((meta, index)=>{\n if (datasets.filter((x)=>x === meta._dataset).length === 0) {\n this._destroyDatasetMeta(index);\n }\n });\n }\n buildOrUpdateControllers() {\n const newControllers = [];\n const datasets = this.data.datasets;\n let i, ilen;\n this._removeUnreferencedMetasets();\n for(i = 0, ilen = datasets.length; i < ilen; i++){\n const dataset = datasets[i];\n let meta = this.getDatasetMeta(i);\n const type = dataset.type || this.config.type;\n if (meta.type && meta.type !== type) {\n this._destroyDatasetMeta(i);\n meta = this.getDatasetMeta(i);\n }\n meta.type = type;\n meta.indexAxis = dataset.indexAxis || getIndexAxis(type, this.options);\n meta.order = dataset.order || 0;\n meta.index = i;\n meta.label = '' + dataset.label;\n meta.visible = this.isDatasetVisible(i);\n if (meta.controller) {\n meta.controller.updateIndex(i);\n meta.controller.linkScales();\n } else {\n const ControllerClass = registry.getController(type);\n const { datasetElementType , dataElementType } = defaults.datasets[type];\n Object.assign(ControllerClass, {\n dataElementType: registry.getElement(dataElementType),\n datasetElementType: datasetElementType && registry.getElement(datasetElementType)\n });\n meta.controller = new ControllerClass(this, i);\n newControllers.push(meta.controller);\n }\n }\n this._updateMetasets();\n return newControllers;\n }\n _resetElements() {\n each(this.data.datasets, (dataset, datasetIndex)=>{\n this.getDatasetMeta(datasetIndex).controller.reset();\n }, this);\n }\n reset() {\n this._resetElements();\n this.notifyPlugins('reset');\n }\n update(mode) {\n const config = this.config;\n config.update();\n const options = this._options = config.createResolver(config.chartOptionScopes(), this.getContext());\n const animsDisabled = this._animationsDisabled = !options.animation;\n this._updateScales();\n this._checkEventBindings();\n this._updateHiddenIndices();\n this._plugins.invalidate();\n if (this.notifyPlugins('beforeUpdate', {\n mode,\n cancelable: true\n }) === false) {\n return;\n }\n const newControllers = this.buildOrUpdateControllers();\n this.notifyPlugins('beforeElementsUpdate');\n let minPadding = 0;\n for(let i = 0, ilen = this.data.datasets.length; i < ilen; i++){\n const { controller } = this.getDatasetMeta(i);\n const reset = !animsDisabled && newControllers.indexOf(controller) === -1;\n controller.buildOrUpdateElements(reset);\n minPadding = Math.max(+controller.getMaxOverflow(), minPadding);\n }\n minPadding = this._minPadding = options.layout.autoPadding ? minPadding : 0;\n this._updateLayout(minPadding);\n if (!animsDisabled) {\n each(newControllers, (controller)=>{\n controller.reset();\n });\n }\n this._updateDatasets(mode);\n this.notifyPlugins('afterUpdate', {\n mode\n });\n this._layers.sort(compare2Level('z', '_idx'));\n const { _active , _lastEvent } = this;\n if (_lastEvent) {\n this._eventHandler(_lastEvent, true);\n } else if (_active.length) {\n this._updateHoverStyles(_active, _active, true);\n }\n this.render();\n }\n _updateScales() {\n each(this.scales, (scale)=>{\n layouts.removeBox(this, scale);\n });\n this.ensureScalesHaveIDs();\n this.buildOrUpdateScales();\n }\n _checkEventBindings() {\n const options = this.options;\n const existingEvents = new Set(Object.keys(this._listeners));\n const newEvents = new Set(options.events);\n if (!setsEqual(existingEvents, newEvents) || !!this._responsiveListeners !== options.responsive) {\n this.unbindEvents();\n this.bindEvents();\n }\n }\n _updateHiddenIndices() {\n const { _hiddenIndices } = this;\n const changes = this._getUniformDataChanges() || [];\n for (const { method , start , count } of changes){\n const move = method === '_removeElements' ? -count : count;\n moveNumericKeys(_hiddenIndices, start, move);\n }\n }\n _getUniformDataChanges() {\n const _dataChanges = this._dataChanges;\n if (!_dataChanges || !_dataChanges.length) {\n return;\n }\n this._dataChanges = [];\n const datasetCount = this.data.datasets.length;\n const makeSet = (idx)=>new Set(_dataChanges.filter((c)=>c[0] === idx).map((c, i)=>i + ',' + c.splice(1).join(',')));\n const changeSet = makeSet(0);\n for(let i = 1; i < datasetCount; i++){\n if (!setsEqual(changeSet, makeSet(i))) {\n return;\n }\n }\n return Array.from(changeSet).map((c)=>c.split(',')).map((a)=>({\n method: a[1],\n start: +a[2],\n count: +a[3]\n }));\n }\n _updateLayout(minPadding) {\n if (this.notifyPlugins('beforeLayout', {\n cancelable: true\n }) === false) {\n return;\n }\n layouts.update(this, this.width, this.height, minPadding);\n const area = this.chartArea;\n const noArea = area.width <= 0 || area.height <= 0;\n this._layers = [];\n each(this.boxes, (box)=>{\n if (noArea && box.position === 'chartArea') {\n return;\n }\n if (box.configure) {\n box.configure();\n }\n this._layers.push(...box._layers());\n }, this);\n this._layers.forEach((item, index)=>{\n item._idx = index;\n });\n this.notifyPlugins('afterLayout');\n }\n _updateDatasets(mode) {\n if (this.notifyPlugins('beforeDatasetsUpdate', {\n mode,\n cancelable: true\n }) === false) {\n return;\n }\n for(let i = 0, ilen = this.data.datasets.length; i < ilen; ++i){\n this.getDatasetMeta(i).controller.configure();\n }\n for(let i = 0, ilen = this.data.datasets.length; i < ilen; ++i){\n this._updateDataset(i, isFunction(mode) ? mode({\n datasetIndex: i\n }) : mode);\n }\n this.notifyPlugins('afterDatasetsUpdate', {\n mode\n });\n }\n _updateDataset(index, mode) {\n const meta = this.getDatasetMeta(index);\n const args = {\n meta,\n index,\n mode,\n cancelable: true\n };\n if (this.notifyPlugins('beforeDatasetUpdate', args) === false) {\n return;\n }\n meta.controller._update(mode);\n args.cancelable = false;\n this.notifyPlugins('afterDatasetUpdate', args);\n }\n render() {\n if (this.notifyPlugins('beforeRender', {\n cancelable: true\n }) === false) {\n return;\n }\n if (animator.has(this)) {\n if (this.attached && !animator.running(this)) {\n animator.start(this);\n }\n } else {\n this.draw();\n onAnimationsComplete({\n chart: this\n });\n }\n }\n draw() {\n let i;\n if (this._resizeBeforeDraw) {\n const { width , height } = this._resizeBeforeDraw;\n this._resize(width, height);\n this._resizeBeforeDraw = null;\n }\n this.clear();\n if (this.width <= 0 || this.height <= 0) {\n return;\n }\n if (this.notifyPlugins('beforeDraw', {\n cancelable: true\n }) === false) {\n return;\n }\n const layers = this._layers;\n for(i = 0; i < layers.length && layers[i].z <= 0; ++i){\n layers[i].draw(this.chartArea);\n }\n this._drawDatasets();\n for(; i < layers.length; ++i){\n layers[i].draw(this.chartArea);\n }\n this.notifyPlugins('afterDraw');\n }\n _getSortedDatasetMetas(filterVisible) {\n const metasets = this._sortedMetasets;\n const result = [];\n let i, ilen;\n for(i = 0, ilen = metasets.length; i < ilen; ++i){\n const meta = metasets[i];\n if (!filterVisible || meta.visible) {\n result.push(meta);\n }\n }\n return result;\n }\n getSortedVisibleDatasetMetas() {\n return this._getSortedDatasetMetas(true);\n }\n _drawDatasets() {\n if (this.notifyPlugins('beforeDatasetsDraw', {\n cancelable: true\n }) === false) {\n return;\n }\n const metasets = this.getSortedVisibleDatasetMetas();\n for(let i = metasets.length - 1; i >= 0; --i){\n this._drawDataset(metasets[i]);\n }\n this.notifyPlugins('afterDatasetsDraw');\n }\n _drawDataset(meta) {\n const ctx = this.ctx;\n const clip = meta._clip;\n const useClip = !clip.disabled;\n const area = getDatasetArea(meta) || this.chartArea;\n const args = {\n meta,\n index: meta.index,\n cancelable: true\n };\n if (this.notifyPlugins('beforeDatasetDraw', args) === false) {\n return;\n }\n if (useClip) {\n clipArea(ctx, {\n left: clip.left === false ? 0 : area.left - clip.left,\n right: clip.right === false ? this.width : area.right + clip.right,\n top: clip.top === false ? 0 : area.top - clip.top,\n bottom: clip.bottom === false ? this.height : area.bottom + clip.bottom\n });\n }\n meta.controller.draw();\n if (useClip) {\n unclipArea(ctx);\n }\n args.cancelable = false;\n this.notifyPlugins('afterDatasetDraw', args);\n }\n isPointInArea(point) {\n return _isPointInArea(point, this.chartArea, this._minPadding);\n }\n getElementsAtEventForMode(e, mode, options, useFinalPosition) {\n const method = Interaction.modes[mode];\n if (typeof method === 'function') {\n return method(this, e, options, useFinalPosition);\n }\n return [];\n }\n getDatasetMeta(datasetIndex) {\n const dataset = this.data.datasets[datasetIndex];\n const metasets = this._metasets;\n let meta = metasets.filter((x)=>x && x._dataset === dataset).pop();\n if (!meta) {\n meta = {\n type: null,\n data: [],\n dataset: null,\n controller: null,\n hidden: null,\n xAxisID: null,\n yAxisID: null,\n order: dataset && dataset.order || 0,\n index: datasetIndex,\n _dataset: dataset,\n _parsed: [],\n _sorted: false\n };\n metasets.push(meta);\n }\n return meta;\n }\n getContext() {\n return this.$context || (this.$context = createContext(null, {\n chart: this,\n type: 'chart'\n }));\n }\n getVisibleDatasetCount() {\n return this.getSortedVisibleDatasetMetas().length;\n }\n isDatasetVisible(datasetIndex) {\n const dataset = this.data.datasets[datasetIndex];\n if (!dataset) {\n return false;\n }\n const meta = this.getDatasetMeta(datasetIndex);\n return typeof meta.hidden === 'boolean' ? !meta.hidden : !dataset.hidden;\n }\n setDatasetVisibility(datasetIndex, visible) {\n const meta = this.getDatasetMeta(datasetIndex);\n meta.hidden = !visible;\n }\n toggleDataVisibility(index) {\n this._hiddenIndices[index] = !this._hiddenIndices[index];\n }\n getDataVisibility(index) {\n return !this._hiddenIndices[index];\n }\n _updateVisibility(datasetIndex, dataIndex, visible) {\n const mode = visible ? 'show' : 'hide';\n const meta = this.getDatasetMeta(datasetIndex);\n const anims = meta.controller._resolveAnimations(undefined, mode);\n if (defined(dataIndex)) {\n meta.data[dataIndex].hidden = !visible;\n this.update();\n } else {\n this.setDatasetVisibility(datasetIndex, visible);\n anims.update(meta, {\n visible\n });\n this.update((ctx)=>ctx.datasetIndex === datasetIndex ? mode : undefined);\n }\n }\n hide(datasetIndex, dataIndex) {\n this._updateVisibility(datasetIndex, dataIndex, false);\n }\n show(datasetIndex, dataIndex) {\n this._updateVisibility(datasetIndex, dataIndex, true);\n }\n _destroyDatasetMeta(datasetIndex) {\n const meta = this._metasets[datasetIndex];\n if (meta && meta.controller) {\n meta.controller._destroy();\n }\n delete this._metasets[datasetIndex];\n }\n _stop() {\n let i, ilen;\n this.stop();\n animator.remove(this);\n for(i = 0, ilen = this.data.datasets.length; i < ilen; ++i){\n this._destroyDatasetMeta(i);\n }\n }\n destroy() {\n this.notifyPlugins('beforeDestroy');\n const { canvas , ctx } = this;\n this._stop();\n this.config.clearCache();\n if (canvas) {\n this.unbindEvents();\n clearCanvas(canvas, ctx);\n this.platform.releaseContext(ctx);\n this.canvas = null;\n this.ctx = null;\n }\n delete instances[this.id];\n this.notifyPlugins('afterDestroy');\n }\n toBase64Image(...args) {\n return this.canvas.toDataURL(...args);\n }\n bindEvents() {\n this.bindUserEvents();\n if (this.options.responsive) {\n this.bindResponsiveEvents();\n } else {\n this.attached = true;\n }\n }\n bindUserEvents() {\n const listeners = this._listeners;\n const platform = this.platform;\n const _add = (type, listener)=>{\n platform.addEventListener(this, type, listener);\n listeners[type] = listener;\n };\n const listener = (e, x, y)=>{\n e.offsetX = x;\n e.offsetY = y;\n this._eventHandler(e);\n };\n each(this.options.events, (type)=>_add(type, listener));\n }\n bindResponsiveEvents() {\n if (!this._responsiveListeners) {\n this._responsiveListeners = {};\n }\n const listeners = this._responsiveListeners;\n const platform = this.platform;\n const _add = (type, listener)=>{\n platform.addEventListener(this, type, listener);\n listeners[type] = listener;\n };\n const _remove = (type, listener)=>{\n if (listeners[type]) {\n platform.removeEventListener(this, type, listener);\n delete listeners[type];\n }\n };\n const listener = (width, height)=>{\n if (this.canvas) {\n this.resize(width, height);\n }\n };\n let detached;\n const attached = ()=>{\n _remove('attach', attached);\n this.attached = true;\n this.resize();\n _add('resize', listener);\n _add('detach', detached);\n };\n detached = ()=>{\n this.attached = false;\n _remove('resize', listener);\n this._stop();\n this._resize(0, 0);\n _add('attach', attached);\n };\n if (platform.isAttached(this.canvas)) {\n attached();\n } else {\n detached();\n }\n }\n unbindEvents() {\n each(this._listeners, (listener, type)=>{\n this.platform.removeEventListener(this, type, listener);\n });\n this._listeners = {};\n each(this._responsiveListeners, (listener, type)=>{\n this.platform.removeEventListener(this, type, listener);\n });\n this._responsiveListeners = undefined;\n }\n updateHoverStyle(items, mode, enabled) {\n const prefix = enabled ? 'set' : 'remove';\n let meta, item, i, ilen;\n if (mode === 'dataset') {\n meta = this.getDatasetMeta(items[0].datasetIndex);\n meta.controller['_' + prefix + 'DatasetHoverStyle']();\n }\n for(i = 0, ilen = items.length; i < ilen; ++i){\n item = items[i];\n const controller = item && this.getDatasetMeta(item.datasetIndex).controller;\n if (controller) {\n controller[prefix + 'HoverStyle'](item.element, item.datasetIndex, item.index);\n }\n }\n }\n getActiveElements() {\n return this._active || [];\n }\n setActiveElements(activeElements) {\n const lastActive = this._active || [];\n const active = activeElements.map(({ datasetIndex , index })=>{\n const meta = this.getDatasetMeta(datasetIndex);\n if (!meta) {\n throw new Error('No dataset found at index ' + datasetIndex);\n }\n return {\n datasetIndex,\n element: meta.data[index],\n index\n };\n });\n const changed = !_elementsEqual(active, lastActive);\n if (changed) {\n this._active = active;\n this._lastEvent = null;\n this._updateHoverStyles(active, lastActive);\n }\n }\n notifyPlugins(hook, args, filter) {\n return this._plugins.notify(this, hook, args, filter);\n }\n isPluginEnabled(pluginId) {\n return this._plugins._cache.filter((p)=>p.plugin.id === pluginId).length === 1;\n }\n _updateHoverStyles(active, lastActive, replay) {\n const hoverOptions = this.options.hover;\n const diff = (a, b)=>a.filter((x)=>!b.some((y)=>x.datasetIndex === y.datasetIndex && x.index === y.index));\n const deactivated = diff(lastActive, active);\n const activated = replay ? active : diff(active, lastActive);\n if (deactivated.length) {\n this.updateHoverStyle(deactivated, hoverOptions.mode, false);\n }\n if (activated.length && hoverOptions.mode) {\n this.updateHoverStyle(activated, hoverOptions.mode, true);\n }\n }\n _eventHandler(e, replay) {\n const args = {\n event: e,\n replay,\n cancelable: true,\n inChartArea: this.isPointInArea(e)\n };\n const eventFilter = (plugin)=>(plugin.options.events || this.options.events).includes(e.native.type);\n if (this.notifyPlugins('beforeEvent', args, eventFilter) === false) {\n return;\n }\n const changed = this._handleEvent(e, replay, args.inChartArea);\n args.cancelable = false;\n this.notifyPlugins('afterEvent', args, eventFilter);\n if (changed || args.changed) {\n this.render();\n }\n return this;\n }\n _handleEvent(e, replay, inChartArea) {\n const { _active: lastActive = [] , options } = this;\n const useFinalPosition = replay;\n const active = this._getActiveElements(e, lastActive, inChartArea, useFinalPosition);\n const isClick = _isClickEvent(e);\n const lastEvent = determineLastEvent(e, this._lastEvent, inChartArea, isClick);\n if (inChartArea) {\n this._lastEvent = null;\n callback(options.onHover, [\n e,\n active,\n this\n ], this);\n if (isClick) {\n callback(options.onClick, [\n e,\n active,\n this\n ], this);\n }\n }\n const changed = !_elementsEqual(active, lastActive);\n if (changed || replay) {\n this._active = active;\n this._updateHoverStyles(active, lastActive, replay);\n }\n this._lastEvent = lastEvent;\n return changed;\n }\n _getActiveElements(e, lastActive, inChartArea, useFinalPosition) {\n if (e.type === 'mouseout') {\n return [];\n }\n if (!inChartArea) {\n return lastActive;\n }\n const hoverOptions = this.options.hover;\n return this.getElementsAtEventForMode(e, hoverOptions.mode, hoverOptions, useFinalPosition);\n }\n}\nfunction invalidatePlugins() {\n return each(Chart.instances, (chart)=>chart._plugins.invalidate());\n}\n\nfunction clipArc(ctx, element, endAngle) {\n const { startAngle , pixelMargin , x , y , outerRadius , innerRadius } = element;\n let angleMargin = pixelMargin / outerRadius;\n // Draw an inner border by clipping the arc and drawing a double-width border\n // Enlarge the clipping arc by 0.33 pixels to eliminate glitches between borders\n ctx.beginPath();\n ctx.arc(x, y, outerRadius, startAngle - angleMargin, endAngle + angleMargin);\n if (innerRadius > pixelMargin) {\n angleMargin = pixelMargin / innerRadius;\n ctx.arc(x, y, innerRadius, endAngle + angleMargin, startAngle - angleMargin, true);\n } else {\n ctx.arc(x, y, pixelMargin, endAngle + HALF_PI, startAngle - HALF_PI);\n }\n ctx.closePath();\n ctx.clip();\n}\nfunction toRadiusCorners(value) {\n return _readValueToProps(value, [\n 'outerStart',\n 'outerEnd',\n 'innerStart',\n 'innerEnd'\n ]);\n}\n/**\n * Parse border radius from the provided options\n */ function parseBorderRadius$1(arc, innerRadius, outerRadius, angleDelta) {\n const o = toRadiusCorners(arc.options.borderRadius);\n const halfThickness = (outerRadius - innerRadius) / 2;\n const innerLimit = Math.min(halfThickness, angleDelta * innerRadius / 2);\n // Outer limits are complicated. We want to compute the available angular distance at\n // a radius of outerRadius - borderRadius because for small angular distances, this term limits.\n // We compute at r = outerRadius - borderRadius because this circle defines the center of the border corners.\n //\n // If the borderRadius is large, that value can become negative.\n // This causes the outer borders to lose their radius entirely, which is rather unexpected. To solve that, if borderRadius > outerRadius\n // we know that the thickness term will dominate and compute the limits at that point\n const computeOuterLimit = (val)=>{\n const outerArcLimit = (outerRadius - Math.min(halfThickness, val)) * angleDelta / 2;\n return _limitValue(val, 0, Math.min(halfThickness, outerArcLimit));\n };\n return {\n outerStart: computeOuterLimit(o.outerStart),\n outerEnd: computeOuterLimit(o.outerEnd),\n innerStart: _limitValue(o.innerStart, 0, innerLimit),\n innerEnd: _limitValue(o.innerEnd, 0, innerLimit)\n };\n}\n/**\n * Convert (r, 𝜃) to (x, y)\n */ function rThetaToXY(r, theta, x, y) {\n return {\n x: x + r * Math.cos(theta),\n y: y + r * Math.sin(theta)\n };\n}\n/**\n * Path the arc, respecting border radius by separating into left and right halves.\n *\n * Start End\n *\n * 1--->a--->2 Outer\n * / \\\n * 8 3\n * | |\n * | |\n * 7 4\n * \\ /\n * 6<---b<---5 Inner\n */ function pathArc(ctx, element, offset, spacing, end, circular) {\n const { x , y , startAngle: start , pixelMargin , innerRadius: innerR } = element;\n const outerRadius = Math.max(element.outerRadius + spacing + offset - pixelMargin, 0);\n const innerRadius = innerR > 0 ? innerR + spacing + offset + pixelMargin : 0;\n let spacingOffset = 0;\n const alpha = end - start;\n if (spacing) {\n // When spacing is present, it is the same for all items\n // So we adjust the start and end angle of the arc such that\n // the distance is the same as it would be without the spacing\n const noSpacingInnerRadius = innerR > 0 ? innerR - spacing : 0;\n const noSpacingOuterRadius = outerRadius > 0 ? outerRadius - spacing : 0;\n const avNogSpacingRadius = (noSpacingInnerRadius + noSpacingOuterRadius) / 2;\n const adjustedAngle = avNogSpacingRadius !== 0 ? alpha * avNogSpacingRadius / (avNogSpacingRadius + spacing) : alpha;\n spacingOffset = (alpha - adjustedAngle) / 2;\n }\n const beta = Math.max(0.001, alpha * outerRadius - offset / PI) / outerRadius;\n const angleOffset = (alpha - beta) / 2;\n const startAngle = start + angleOffset + spacingOffset;\n const endAngle = end - angleOffset - spacingOffset;\n const { outerStart , outerEnd , innerStart , innerEnd } = parseBorderRadius$1(element, innerRadius, outerRadius, endAngle - startAngle);\n const outerStartAdjustedRadius = outerRadius - outerStart;\n const outerEndAdjustedRadius = outerRadius - outerEnd;\n const outerStartAdjustedAngle = startAngle + outerStart / outerStartAdjustedRadius;\n const outerEndAdjustedAngle = endAngle - outerEnd / outerEndAdjustedRadius;\n const innerStartAdjustedRadius = innerRadius + innerStart;\n const innerEndAdjustedRadius = innerRadius + innerEnd;\n const innerStartAdjustedAngle = startAngle + innerStart / innerStartAdjustedRadius;\n const innerEndAdjustedAngle = endAngle - innerEnd / innerEndAdjustedRadius;\n ctx.beginPath();\n if (circular) {\n // The first arc segments from point 1 to point a to point 2\n const outerMidAdjustedAngle = (outerStartAdjustedAngle + outerEndAdjustedAngle) / 2;\n ctx.arc(x, y, outerRadius, outerStartAdjustedAngle, outerMidAdjustedAngle);\n ctx.arc(x, y, outerRadius, outerMidAdjustedAngle, outerEndAdjustedAngle);\n // The corner segment from point 2 to point 3\n if (outerEnd > 0) {\n const pCenter = rThetaToXY(outerEndAdjustedRadius, outerEndAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, outerEnd, outerEndAdjustedAngle, endAngle + HALF_PI);\n }\n // The line from point 3 to point 4\n const p4 = rThetaToXY(innerEndAdjustedRadius, endAngle, x, y);\n ctx.lineTo(p4.x, p4.y);\n // The corner segment from point 4 to point 5\n if (innerEnd > 0) {\n const pCenter = rThetaToXY(innerEndAdjustedRadius, innerEndAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, innerEnd, endAngle + HALF_PI, innerEndAdjustedAngle + Math.PI);\n }\n // The inner arc from point 5 to point b to point 6\n const innerMidAdjustedAngle = (endAngle - innerEnd / innerRadius + (startAngle + innerStart / innerRadius)) / 2;\n ctx.arc(x, y, innerRadius, endAngle - innerEnd / innerRadius, innerMidAdjustedAngle, true);\n ctx.arc(x, y, innerRadius, innerMidAdjustedAngle, startAngle + innerStart / innerRadius, true);\n // The corner segment from point 6 to point 7\n if (innerStart > 0) {\n const pCenter = rThetaToXY(innerStartAdjustedRadius, innerStartAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, innerStart, innerStartAdjustedAngle + Math.PI, startAngle - HALF_PI);\n }\n // The line from point 7 to point 8\n const p8 = rThetaToXY(outerStartAdjustedRadius, startAngle, x, y);\n ctx.lineTo(p8.x, p8.y);\n // The corner segment from point 8 to point 1\n if (outerStart > 0) {\n const pCenter = rThetaToXY(outerStartAdjustedRadius, outerStartAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, outerStart, startAngle - HALF_PI, outerStartAdjustedAngle);\n }\n } else {\n ctx.moveTo(x, y);\n const outerStartX = Math.cos(outerStartAdjustedAngle) * outerRadius + x;\n const outerStartY = Math.sin(outerStartAdjustedAngle) * outerRadius + y;\n ctx.lineTo(outerStartX, outerStartY);\n const outerEndX = Math.cos(outerEndAdjustedAngle) * outerRadius + x;\n const outerEndY = Math.sin(outerEndAdjustedAngle) * outerRadius + y;\n ctx.lineTo(outerEndX, outerEndY);\n }\n ctx.closePath();\n}\nfunction drawArc(ctx, element, offset, spacing, circular) {\n const { fullCircles , startAngle , circumference } = element;\n let endAngle = element.endAngle;\n if (fullCircles) {\n pathArc(ctx, element, offset, spacing, endAngle, circular);\n for(let i = 0; i < fullCircles; ++i){\n ctx.fill();\n }\n if (!isNaN(circumference)) {\n endAngle = startAngle + (circumference % TAU || TAU);\n }\n }\n pathArc(ctx, element, offset, spacing, endAngle, circular);\n ctx.fill();\n return endAngle;\n}\nfunction drawBorder(ctx, element, offset, spacing, circular) {\n const { fullCircles , startAngle , circumference , options } = element;\n const { borderWidth , borderJoinStyle , borderDash , borderDashOffset } = options;\n const inner = options.borderAlign === 'inner';\n if (!borderWidth) {\n return;\n }\n ctx.setLineDash(borderDash || []);\n ctx.lineDashOffset = borderDashOffset;\n if (inner) {\n ctx.lineWidth = borderWidth * 2;\n ctx.lineJoin = borderJoinStyle || 'round';\n } else {\n ctx.lineWidth = borderWidth;\n ctx.lineJoin = borderJoinStyle || 'bevel';\n }\n let endAngle = element.endAngle;\n if (fullCircles) {\n pathArc(ctx, element, offset, spacing, endAngle, circular);\n for(let i = 0; i < fullCircles; ++i){\n ctx.stroke();\n }\n if (!isNaN(circumference)) {\n endAngle = startAngle + (circumference % TAU || TAU);\n }\n }\n if (inner) {\n clipArc(ctx, element, endAngle);\n }\n if (!fullCircles) {\n pathArc(ctx, element, offset, spacing, endAngle, circular);\n ctx.stroke();\n }\n}\nclass ArcElement extends Element {\n static id = 'arc';\n static defaults = {\n borderAlign: 'center',\n borderColor: '#fff',\n borderDash: [],\n borderDashOffset: 0,\n borderJoinStyle: undefined,\n borderRadius: 0,\n borderWidth: 2,\n offset: 0,\n spacing: 0,\n angle: undefined,\n circular: true\n };\n static defaultRoutes = {\n backgroundColor: 'backgroundColor'\n };\n static descriptors = {\n _scriptable: true,\n _indexable: (name)=>name !== 'borderDash'\n };\n circumference;\n endAngle;\n fullCircles;\n innerRadius;\n outerRadius;\n pixelMargin;\n startAngle;\n constructor(cfg){\n super();\n this.options = undefined;\n this.circumference = undefined;\n this.startAngle = undefined;\n this.endAngle = undefined;\n this.innerRadius = undefined;\n this.outerRadius = undefined;\n this.pixelMargin = 0;\n this.fullCircles = 0;\n if (cfg) {\n Object.assign(this, cfg);\n }\n }\n inRange(chartX, chartY, useFinalPosition) {\n const point = this.getProps([\n 'x',\n 'y'\n ], useFinalPosition);\n const { angle , distance } = getAngleFromPoint(point, {\n x: chartX,\n y: chartY\n });\n const { startAngle , endAngle , innerRadius , outerRadius , circumference } = this.getProps([\n 'startAngle',\n 'endAngle',\n 'innerRadius',\n 'outerRadius',\n 'circumference'\n ], useFinalPosition);\n const rAdjust = (this.options.spacing + this.options.borderWidth) / 2;\n const _circumference = valueOrDefault(circumference, endAngle - startAngle);\n const betweenAngles = _circumference >= TAU || _angleBetween(angle, startAngle, endAngle);\n const withinRadius = _isBetween(distance, innerRadius + rAdjust, outerRadius + rAdjust);\n return betweenAngles && withinRadius;\n }\n getCenterPoint(useFinalPosition) {\n const { x , y , startAngle , endAngle , innerRadius , outerRadius } = this.getProps([\n 'x',\n 'y',\n 'startAngle',\n 'endAngle',\n 'innerRadius',\n 'outerRadius'\n ], useFinalPosition);\n const { offset , spacing } = this.options;\n const halfAngle = (startAngle + endAngle) / 2;\n const halfRadius = (innerRadius + outerRadius + spacing + offset) / 2;\n return {\n x: x + Math.cos(halfAngle) * halfRadius,\n y: y + Math.sin(halfAngle) * halfRadius\n };\n }\n tooltipPosition(useFinalPosition) {\n return this.getCenterPoint(useFinalPosition);\n }\n draw(ctx) {\n const { options , circumference } = this;\n const offset = (options.offset || 0) / 4;\n const spacing = (options.spacing || 0) / 2;\n const circular = options.circular;\n this.pixelMargin = options.borderAlign === 'inner' ? 0.33 : 0;\n this.fullCircles = circumference > TAU ? Math.floor(circumference / TAU) : 0;\n if (circumference === 0 || this.innerRadius < 0 || this.outerRadius < 0) {\n return;\n }\n ctx.save();\n const halfAngle = (this.startAngle + this.endAngle) / 2;\n ctx.translate(Math.cos(halfAngle) * offset, Math.sin(halfAngle) * offset);\n const fix = 1 - Math.sin(Math.min(PI, circumference || 0));\n const radiusOffset = offset * fix;\n ctx.fillStyle = options.backgroundColor;\n ctx.strokeStyle = options.borderColor;\n drawArc(ctx, this, radiusOffset, spacing, circular);\n drawBorder(ctx, this, radiusOffset, spacing, circular);\n ctx.restore();\n }\n}\n\nfunction setStyle(ctx, options, style = options) {\n ctx.lineCap = valueOrDefault(style.borderCapStyle, options.borderCapStyle);\n ctx.setLineDash(valueOrDefault(style.borderDash, options.borderDash));\n ctx.lineDashOffset = valueOrDefault(style.borderDashOffset, options.borderDashOffset);\n ctx.lineJoin = valueOrDefault(style.borderJoinStyle, options.borderJoinStyle);\n ctx.lineWidth = valueOrDefault(style.borderWidth, options.borderWidth);\n ctx.strokeStyle = valueOrDefault(style.borderColor, options.borderColor);\n}\nfunction lineTo(ctx, previous, target) {\n ctx.lineTo(target.x, target.y);\n}\n function getLineMethod(options) {\n if (options.stepped) {\n return _steppedLineTo;\n }\n if (options.tension || options.cubicInterpolationMode === 'monotone') {\n return _bezierCurveTo;\n }\n return lineTo;\n}\nfunction pathVars(points, segment, params = {}) {\n const count = points.length;\n const { start: paramsStart = 0 , end: paramsEnd = count - 1 } = params;\n const { start: segmentStart , end: segmentEnd } = segment;\n const start = Math.max(paramsStart, segmentStart);\n const end = Math.min(paramsEnd, segmentEnd);\n const outside = paramsStart < segmentStart && paramsEnd < segmentStart || paramsStart > segmentEnd && paramsEnd > segmentEnd;\n return {\n count,\n start,\n loop: segment.loop,\n ilen: end < start && !outside ? count + end - start : end - start\n };\n}\n function pathSegment(ctx, line, segment, params) {\n const { points , options } = line;\n const { count , start , loop , ilen } = pathVars(points, segment, params);\n const lineMethod = getLineMethod(options);\n let { move =true , reverse } = params || {};\n let i, point, prev;\n for(i = 0; i <= ilen; ++i){\n point = points[(start + (reverse ? ilen - i : i)) % count];\n if (point.skip) {\n continue;\n } else if (move) {\n ctx.moveTo(point.x, point.y);\n move = false;\n } else {\n lineMethod(ctx, prev, point, reverse, options.stepped);\n }\n prev = point;\n }\n if (loop) {\n point = points[(start + (reverse ? ilen : 0)) % count];\n lineMethod(ctx, prev, point, reverse, options.stepped);\n }\n return !!loop;\n}\n function fastPathSegment(ctx, line, segment, params) {\n const points = line.points;\n const { count , start , ilen } = pathVars(points, segment, params);\n const { move =true , reverse } = params || {};\n let avgX = 0;\n let countX = 0;\n let i, point, prevX, minY, maxY, lastY;\n const pointIndex = (index)=>(start + (reverse ? ilen - index : index)) % count;\n const drawX = ()=>{\n if (minY !== maxY) {\n ctx.lineTo(avgX, maxY);\n ctx.lineTo(avgX, minY);\n ctx.lineTo(avgX, lastY);\n }\n };\n if (move) {\n point = points[pointIndex(0)];\n ctx.moveTo(point.x, point.y);\n }\n for(i = 0; i <= ilen; ++i){\n point = points[pointIndex(i)];\n if (point.skip) {\n continue;\n }\n const x = point.x;\n const y = point.y;\n const truncX = x | 0;\n if (truncX === prevX) {\n if (y < minY) {\n minY = y;\n } else if (y > maxY) {\n maxY = y;\n }\n avgX = (countX * avgX + x) / ++countX;\n } else {\n drawX();\n ctx.lineTo(x, y);\n prevX = truncX;\n countX = 0;\n minY = maxY = y;\n }\n lastY = y;\n }\n drawX();\n}\n function _getSegmentMethod(line) {\n const opts = line.options;\n const borderDash = opts.borderDash && opts.borderDash.length;\n const useFastPath = !line._decimated && !line._loop && !opts.tension && opts.cubicInterpolationMode !== 'monotone' && !opts.stepped && !borderDash;\n return useFastPath ? fastPathSegment : pathSegment;\n}\n function _getInterpolationMethod(options) {\n if (options.stepped) {\n return _steppedInterpolation;\n }\n if (options.tension || options.cubicInterpolationMode === 'monotone') {\n return _bezierInterpolation;\n }\n return _pointInLine;\n}\nfunction strokePathWithCache(ctx, line, start, count) {\n let path = line._path;\n if (!path) {\n path = line._path = new Path2D();\n if (line.path(path, start, count)) {\n path.closePath();\n }\n }\n setStyle(ctx, line.options);\n ctx.stroke(path);\n}\nfunction strokePathDirect(ctx, line, start, count) {\n const { segments , options } = line;\n const segmentMethod = _getSegmentMethod(line);\n for (const segment of segments){\n setStyle(ctx, options, segment.style);\n ctx.beginPath();\n if (segmentMethod(ctx, line, segment, {\n start,\n end: start + count - 1\n })) {\n ctx.closePath();\n }\n ctx.stroke();\n }\n}\nconst usePath2D = typeof Path2D === 'function';\nfunction draw(ctx, line, start, count) {\n if (usePath2D && !line.options.segment) {\n strokePathWithCache(ctx, line, start, count);\n } else {\n strokePathDirect(ctx, line, start, count);\n }\n}\nclass LineElement extends Element {\n static id = 'line';\n static defaults = {\n borderCapStyle: 'butt',\n borderDash: [],\n borderDashOffset: 0,\n borderJoinStyle: 'miter',\n borderWidth: 3,\n capBezierPoints: true,\n cubicInterpolationMode: 'default',\n fill: false,\n spanGaps: false,\n stepped: false,\n tension: 0\n };\n static defaultRoutes = {\n backgroundColor: 'backgroundColor',\n borderColor: 'borderColor'\n };\n static descriptors = {\n _scriptable: true,\n _indexable: (name)=>name !== 'borderDash' && name !== 'fill'\n };\n constructor(cfg){\n super();\n this.animated = true;\n this.options = undefined;\n this._chart = undefined;\n this._loop = undefined;\n this._fullLoop = undefined;\n this._path = undefined;\n this._points = undefined;\n this._segments = undefined;\n this._decimated = false;\n this._pointsUpdated = false;\n this._datasetIndex = undefined;\n if (cfg) {\n Object.assign(this, cfg);\n }\n }\n updateControlPoints(chartArea, indexAxis) {\n const options = this.options;\n if ((options.tension || options.cubicInterpolationMode === 'monotone') && !options.stepped && !this._pointsUpdated) {\n const loop = options.spanGaps ? this._loop : this._fullLoop;\n _updateBezierControlPoints(this._points, options, chartArea, loop, indexAxis);\n this._pointsUpdated = true;\n }\n }\n set points(points) {\n this._points = points;\n delete this._segments;\n delete this._path;\n this._pointsUpdated = false;\n }\n get points() {\n return this._points;\n }\n get segments() {\n return this._segments || (this._segments = _computeSegments(this, this.options.segment));\n }\n first() {\n const segments = this.segments;\n const points = this.points;\n return segments.length && points[segments[0].start];\n }\n last() {\n const segments = this.segments;\n const points = this.points;\n const count = segments.length;\n return count && points[segments[count - 1].end];\n }\n interpolate(point, property) {\n const options = this.options;\n const value = point[property];\n const points = this.points;\n const segments = _boundSegments(this, {\n property,\n start: value,\n end: value\n });\n if (!segments.length) {\n return;\n }\n const result = [];\n const _interpolate = _getInterpolationMethod(options);\n let i, ilen;\n for(i = 0, ilen = segments.length; i < ilen; ++i){\n const { start , end } = segments[i];\n const p1 = points[start];\n const p2 = points[end];\n if (p1 === p2) {\n result.push(p1);\n continue;\n }\n const t = Math.abs((value - p1[property]) / (p2[property] - p1[property]));\n const interpolated = _interpolate(p1, p2, t, options.stepped);\n interpolated[property] = point[property];\n result.push(interpolated);\n }\n return result.length === 1 ? result[0] : result;\n }\n pathSegment(ctx, segment, params) {\n const segmentMethod = _getSegmentMethod(this);\n return segmentMethod(ctx, this, segment, params);\n }\n path(ctx, start, count) {\n const segments = this.segments;\n const segmentMethod = _getSegmentMethod(this);\n let loop = this._loop;\n start = start || 0;\n count = count || this.points.length - start;\n for (const segment of segments){\n loop &= segmentMethod(ctx, this, segment, {\n start,\n end: start + count - 1\n });\n }\n return !!loop;\n }\n draw(ctx, chartArea, start, count) {\n const options = this.options || {};\n const points = this.points || [];\n if (points.length && options.borderWidth) {\n ctx.save();\n draw(ctx, this, start, count);\n ctx.restore();\n }\n if (this.animated) {\n this._pointsUpdated = false;\n this._path = undefined;\n }\n }\n}\n\nfunction inRange$1(el, pos, axis, useFinalPosition) {\n const options = el.options;\n const { [axis]: value } = el.getProps([\n axis\n ], useFinalPosition);\n return Math.abs(pos - value) < options.radius + options.hitRadius;\n}\nclass PointElement extends Element {\n static id = 'point';\n parsed;\n skip;\n stop;\n /**\n * @type {any}\n */ static defaults = {\n borderWidth: 1,\n hitRadius: 1,\n hoverBorderWidth: 1,\n hoverRadius: 4,\n pointStyle: 'circle',\n radius: 3,\n rotation: 0\n };\n /**\n * @type {any}\n */ static defaultRoutes = {\n backgroundColor: 'backgroundColor',\n borderColor: 'borderColor'\n };\n constructor(cfg){\n super();\n this.options = undefined;\n this.parsed = undefined;\n this.skip = undefined;\n this.stop = undefined;\n if (cfg) {\n Object.assign(this, cfg);\n }\n }\n inRange(mouseX, mouseY, useFinalPosition) {\n const options = this.options;\n const { x , y } = this.getProps([\n 'x',\n 'y'\n ], useFinalPosition);\n return Math.pow(mouseX - x, 2) + Math.pow(mouseY - y, 2) < Math.pow(options.hitRadius + options.radius, 2);\n }\n inXRange(mouseX, useFinalPosition) {\n return inRange$1(this, mouseX, 'x', useFinalPosition);\n }\n inYRange(mouseY, useFinalPosition) {\n return inRange$1(this, mouseY, 'y', useFinalPosition);\n }\n getCenterPoint(useFinalPosition) {\n const { x , y } = this.getProps([\n 'x',\n 'y'\n ], useFinalPosition);\n return {\n x,\n y\n };\n }\n size(options) {\n options = options || this.options || {};\n let radius = options.radius || 0;\n radius = Math.max(radius, radius && options.hoverRadius || 0);\n const borderWidth = radius && options.borderWidth || 0;\n return (radius + borderWidth) * 2;\n }\n draw(ctx, area) {\n const options = this.options;\n if (this.skip || options.radius < 0.1 || !_isPointInArea(this, area, this.size(options) / 2)) {\n return;\n }\n ctx.strokeStyle = options.borderColor;\n ctx.lineWidth = options.borderWidth;\n ctx.fillStyle = options.backgroundColor;\n drawPoint(ctx, options, this.x, this.y);\n }\n getRange() {\n const options = this.options || {};\n // @ts-expect-error Fallbacks should never be hit in practice\n return options.radius + options.hitRadius;\n }\n}\n\nfunction getBarBounds(bar, useFinalPosition) {\n const { x , y , base , width , height } = bar.getProps([\n 'x',\n 'y',\n 'base',\n 'width',\n 'height'\n ], useFinalPosition);\n let left, right, top, bottom, half;\n if (bar.horizontal) {\n half = height / 2;\n left = Math.min(x, base);\n right = Math.max(x, base);\n top = y - half;\n bottom = y + half;\n } else {\n half = width / 2;\n left = x - half;\n right = x + half;\n top = Math.min(y, base);\n bottom = Math.max(y, base);\n }\n return {\n left,\n top,\n right,\n bottom\n };\n}\nfunction skipOrLimit(skip, value, min, max) {\n return skip ? 0 : _limitValue(value, min, max);\n}\nfunction parseBorderWidth(bar, maxW, maxH) {\n const value = bar.options.borderWidth;\n const skip = bar.borderSkipped;\n const o = toTRBL(value);\n return {\n t: skipOrLimit(skip.top, o.top, 0, maxH),\n r: skipOrLimit(skip.right, o.right, 0, maxW),\n b: skipOrLimit(skip.bottom, o.bottom, 0, maxH),\n l: skipOrLimit(skip.left, o.left, 0, maxW)\n };\n}\nfunction parseBorderRadius(bar, maxW, maxH) {\n const { enableBorderRadius } = bar.getProps([\n 'enableBorderRadius'\n ]);\n const value = bar.options.borderRadius;\n const o = toTRBLCorners(value);\n const maxR = Math.min(maxW, maxH);\n const skip = bar.borderSkipped;\n const enableBorder = enableBorderRadius || isObject(value);\n return {\n topLeft: skipOrLimit(!enableBorder || skip.top || skip.left, o.topLeft, 0, maxR),\n topRight: skipOrLimit(!enableBorder || skip.top || skip.right, o.topRight, 0, maxR),\n bottomLeft: skipOrLimit(!enableBorder || skip.bottom || skip.left, o.bottomLeft, 0, maxR),\n bottomRight: skipOrLimit(!enableBorder || skip.bottom || skip.right, o.bottomRight, 0, maxR)\n };\n}\nfunction boundingRects(bar) {\n const bounds = getBarBounds(bar);\n const width = bounds.right - bounds.left;\n const height = bounds.bottom - bounds.top;\n const border = parseBorderWidth(bar, width / 2, height / 2);\n const radius = parseBorderRadius(bar, width / 2, height / 2);\n return {\n outer: {\n x: bounds.left,\n y: bounds.top,\n w: width,\n h: height,\n radius\n },\n inner: {\n x: bounds.left + border.l,\n y: bounds.top + border.t,\n w: width - border.l - border.r,\n h: height - border.t - border.b,\n radius: {\n topLeft: Math.max(0, radius.topLeft - Math.max(border.t, border.l)),\n topRight: Math.max(0, radius.topRight - Math.max(border.t, border.r)),\n bottomLeft: Math.max(0, radius.bottomLeft - Math.max(border.b, border.l)),\n bottomRight: Math.max(0, radius.bottomRight - Math.max(border.b, border.r))\n }\n }\n };\n}\nfunction inRange(bar, x, y, useFinalPosition) {\n const skipX = x === null;\n const skipY = y === null;\n const skipBoth = skipX && skipY;\n const bounds = bar && !skipBoth && getBarBounds(bar, useFinalPosition);\n return bounds && (skipX || _isBetween(x, bounds.left, bounds.right)) && (skipY || _isBetween(y, bounds.top, bounds.bottom));\n}\nfunction hasRadius(radius) {\n return radius.topLeft || radius.topRight || radius.bottomLeft || radius.bottomRight;\n}\n function addNormalRectPath(ctx, rect) {\n ctx.rect(rect.x, rect.y, rect.w, rect.h);\n}\nfunction inflateRect(rect, amount, refRect = {}) {\n const x = rect.x !== refRect.x ? -amount : 0;\n const y = rect.y !== refRect.y ? -amount : 0;\n const w = (rect.x + rect.w !== refRect.x + refRect.w ? amount : 0) - x;\n const h = (rect.y + rect.h !== refRect.y + refRect.h ? amount : 0) - y;\n return {\n x: rect.x + x,\n y: rect.y + y,\n w: rect.w + w,\n h: rect.h + h,\n radius: rect.radius\n };\n}\nclass BarElement extends Element {\n static id = 'bar';\n static defaults = {\n borderSkipped: 'start',\n borderWidth: 0,\n borderRadius: 0,\n inflateAmount: 'auto',\n pointStyle: undefined\n };\n static defaultRoutes = {\n backgroundColor: 'backgroundColor',\n borderColor: 'borderColor'\n };\n constructor(cfg){\n super();\n this.options = undefined;\n this.horizontal = undefined;\n this.base = undefined;\n this.width = undefined;\n this.height = undefined;\n this.inflateAmount = undefined;\n if (cfg) {\n Object.assign(this, cfg);\n }\n }\n draw(ctx) {\n const { inflateAmount , options: { borderColor , backgroundColor } } = this;\n const { inner , outer } = boundingRects(this);\n const addRectPath = hasRadius(outer.radius) ? addRoundedRectPath : addNormalRectPath;\n ctx.save();\n if (outer.w !== inner.w || outer.h !== inner.h) {\n ctx.beginPath();\n addRectPath(ctx, inflateRect(outer, inflateAmount, inner));\n ctx.clip();\n addRectPath(ctx, inflateRect(inner, -inflateAmount, outer));\n ctx.fillStyle = borderColor;\n ctx.fill('evenodd');\n }\n ctx.beginPath();\n addRectPath(ctx, inflateRect(inner, inflateAmount));\n ctx.fillStyle = backgroundColor;\n ctx.fill();\n ctx.restore();\n }\n inRange(mouseX, mouseY, useFinalPosition) {\n return inRange(this, mouseX, mouseY, useFinalPosition);\n }\n inXRange(mouseX, useFinalPosition) {\n return inRange(this, mouseX, null, useFinalPosition);\n }\n inYRange(mouseY, useFinalPosition) {\n return inRange(this, null, mouseY, useFinalPosition);\n }\n getCenterPoint(useFinalPosition) {\n const { x , y , base , horizontal } = this.getProps([\n 'x',\n 'y',\n 'base',\n 'horizontal'\n ], useFinalPosition);\n return {\n x: horizontal ? (x + base) / 2 : x,\n y: horizontal ? y : (y + base) / 2\n };\n }\n getRange(axis) {\n return axis === 'x' ? this.width / 2 : this.height / 2;\n }\n}\n\nvar elements = /*#__PURE__*/Object.freeze({\n__proto__: null,\nArcElement: ArcElement,\nBarElement: BarElement,\nLineElement: LineElement,\nPointElement: PointElement\n});\n\nconst BORDER_COLORS = [\n 'rgb(54, 162, 235)',\n 'rgb(255, 99, 132)',\n 'rgb(255, 159, 64)',\n 'rgb(255, 205, 86)',\n 'rgb(75, 192, 192)',\n 'rgb(153, 102, 255)',\n 'rgb(201, 203, 207)' // grey\n];\n// Border colors with 50% transparency\nconst BACKGROUND_COLORS = /* #__PURE__ */ BORDER_COLORS.map((color)=>color.replace('rgb(', 'rgba(').replace(')', ', 0.5)'));\nfunction getBorderColor(i) {\n return BORDER_COLORS[i % BORDER_COLORS.length];\n}\nfunction getBackgroundColor(i) {\n return BACKGROUND_COLORS[i % BACKGROUND_COLORS.length];\n}\nfunction colorizeDefaultDataset(dataset, i) {\n dataset.borderColor = getBorderColor(i);\n dataset.backgroundColor = getBackgroundColor(i);\n return ++i;\n}\nfunction colorizeDoughnutDataset(dataset, i) {\n dataset.backgroundColor = dataset.data.map(()=>getBorderColor(i++));\n return i;\n}\nfunction colorizePolarAreaDataset(dataset, i) {\n dataset.backgroundColor = dataset.data.map(()=>getBackgroundColor(i++));\n return i;\n}\nfunction getColorizer(chart) {\n let i = 0;\n return (dataset, datasetIndex)=>{\n const controller = chart.getDatasetMeta(datasetIndex).controller;\n if (controller instanceof DoughnutController) {\n i = colorizeDoughnutDataset(dataset, i);\n } else if (controller instanceof PolarAreaController) {\n i = colorizePolarAreaDataset(dataset, i);\n } else if (controller) {\n i = colorizeDefaultDataset(dataset, i);\n }\n };\n}\nfunction containsColorsDefinitions(descriptors) {\n let k;\n for(k in descriptors){\n if (descriptors[k].borderColor || descriptors[k].backgroundColor) {\n return true;\n }\n }\n return false;\n}\nfunction containsColorsDefinition(descriptor) {\n return descriptor && (descriptor.borderColor || descriptor.backgroundColor);\n}\nvar plugin_colors = {\n id: 'colors',\n defaults: {\n enabled: true,\n forceOverride: false\n },\n beforeLayout (chart, _args, options) {\n if (!options.enabled) {\n return;\n }\n const { data: { datasets } , options: chartOptions } = chart.config;\n const { elements } = chartOptions;\n if (!options.forceOverride && (containsColorsDefinitions(datasets) || containsColorsDefinition(chartOptions) || elements && containsColorsDefinitions(elements))) {\n return;\n }\n const colorizer = getColorizer(chart);\n datasets.forEach(colorizer);\n }\n};\n\nfunction lttbDecimation(data, start, count, availableWidth, options) {\n const samples = options.samples || availableWidth;\n if (samples >= count) {\n return data.slice(start, start + count);\n }\n const decimated = [];\n const bucketWidth = (count - 2) / (samples - 2);\n let sampledIndex = 0;\n const endIndex = start + count - 1;\n let a = start;\n let i, maxAreaPoint, maxArea, area, nextA;\n decimated[sampledIndex++] = data[a];\n for(i = 0; i < samples - 2; i++){\n let avgX = 0;\n let avgY = 0;\n let j;\n const avgRangeStart = Math.floor((i + 1) * bucketWidth) + 1 + start;\n const avgRangeEnd = Math.min(Math.floor((i + 2) * bucketWidth) + 1, count) + start;\n const avgRangeLength = avgRangeEnd - avgRangeStart;\n for(j = avgRangeStart; j < avgRangeEnd; j++){\n avgX += data[j].x;\n avgY += data[j].y;\n }\n avgX /= avgRangeLength;\n avgY /= avgRangeLength;\n const rangeOffs = Math.floor(i * bucketWidth) + 1 + start;\n const rangeTo = Math.min(Math.floor((i + 1) * bucketWidth) + 1, count) + start;\n const { x: pointAx , y: pointAy } = data[a];\n maxArea = area = -1;\n for(j = rangeOffs; j < rangeTo; j++){\n area = 0.5 * Math.abs((pointAx - avgX) * (data[j].y - pointAy) - (pointAx - data[j].x) * (avgY - pointAy));\n if (area > maxArea) {\n maxArea = area;\n maxAreaPoint = data[j];\n nextA = j;\n }\n }\n decimated[sampledIndex++] = maxAreaPoint;\n a = nextA;\n }\n decimated[sampledIndex++] = data[endIndex];\n return decimated;\n}\nfunction minMaxDecimation(data, start, count, availableWidth) {\n let avgX = 0;\n let countX = 0;\n let i, point, x, y, prevX, minIndex, maxIndex, startIndex, minY, maxY;\n const decimated = [];\n const endIndex = start + count - 1;\n const xMin = data[start].x;\n const xMax = data[endIndex].x;\n const dx = xMax - xMin;\n for(i = start; i < start + count; ++i){\n point = data[i];\n x = (point.x - xMin) / dx * availableWidth;\n y = point.y;\n const truncX = x | 0;\n if (truncX === prevX) {\n if (y < minY) {\n minY = y;\n minIndex = i;\n } else if (y > maxY) {\n maxY = y;\n maxIndex = i;\n }\n avgX = (countX * avgX + point.x) / ++countX;\n } else {\n const lastIndex = i - 1;\n if (!isNullOrUndef(minIndex) && !isNullOrUndef(maxIndex)) {\n const intermediateIndex1 = Math.min(minIndex, maxIndex);\n const intermediateIndex2 = Math.max(minIndex, maxIndex);\n if (intermediateIndex1 !== startIndex && intermediateIndex1 !== lastIndex) {\n decimated.push({\n ...data[intermediateIndex1],\n x: avgX\n });\n }\n if (intermediateIndex2 !== startIndex && intermediateIndex2 !== lastIndex) {\n decimated.push({\n ...data[intermediateIndex2],\n x: avgX\n });\n }\n }\n if (i > 0 && lastIndex !== startIndex) {\n decimated.push(data[lastIndex]);\n }\n decimated.push(point);\n prevX = truncX;\n countX = 0;\n minY = maxY = y;\n minIndex = maxIndex = startIndex = i;\n }\n }\n return decimated;\n}\nfunction cleanDecimatedDataset(dataset) {\n if (dataset._decimated) {\n const data = dataset._data;\n delete dataset._decimated;\n delete dataset._data;\n Object.defineProperty(dataset, 'data', {\n configurable: true,\n enumerable: true,\n writable: true,\n value: data\n });\n }\n}\nfunction cleanDecimatedData(chart) {\n chart.data.datasets.forEach((dataset)=>{\n cleanDecimatedDataset(dataset);\n });\n}\nfunction getStartAndCountOfVisiblePointsSimplified(meta, points) {\n const pointCount = points.length;\n let start = 0;\n let count;\n const { iScale } = meta;\n const { min , max , minDefined , maxDefined } = iScale.getUserBounds();\n if (minDefined) {\n start = _limitValue(_lookupByKey(points, iScale.axis, min).lo, 0, pointCount - 1);\n }\n if (maxDefined) {\n count = _limitValue(_lookupByKey(points, iScale.axis, max).hi + 1, start, pointCount) - start;\n } else {\n count = pointCount - start;\n }\n return {\n start,\n count\n };\n}\nvar plugin_decimation = {\n id: 'decimation',\n defaults: {\n algorithm: 'min-max',\n enabled: false\n },\n beforeElementsUpdate: (chart, args, options)=>{\n if (!options.enabled) {\n cleanDecimatedData(chart);\n return;\n }\n const availableWidth = chart.width;\n chart.data.datasets.forEach((dataset, datasetIndex)=>{\n const { _data , indexAxis } = dataset;\n const meta = chart.getDatasetMeta(datasetIndex);\n const data = _data || dataset.data;\n if (resolve([\n indexAxis,\n chart.options.indexAxis\n ]) === 'y') {\n return;\n }\n if (!meta.controller.supportsDecimation) {\n return;\n }\n const xAxis = chart.scales[meta.xAxisID];\n if (xAxis.type !== 'linear' && xAxis.type !== 'time') {\n return;\n }\n if (chart.options.parsing) {\n return;\n }\n let { start , count } = getStartAndCountOfVisiblePointsSimplified(meta, data);\n const threshold = options.threshold || 4 * availableWidth;\n if (count <= threshold) {\n cleanDecimatedDataset(dataset);\n return;\n }\n if (isNullOrUndef(_data)) {\n dataset._data = data;\n delete dataset.data;\n Object.defineProperty(dataset, 'data', {\n configurable: true,\n enumerable: true,\n get: function() {\n return this._decimated;\n },\n set: function(d) {\n this._data = d;\n }\n });\n }\n let decimated;\n switch(options.algorithm){\n case 'lttb':\n decimated = lttbDecimation(data, start, count, availableWidth, options);\n break;\n case 'min-max':\n decimated = minMaxDecimation(data, start, count, availableWidth);\n break;\n default:\n throw new Error(`Unsupported decimation algorithm '${options.algorithm}'`);\n }\n dataset._decimated = decimated;\n });\n },\n destroy (chart) {\n cleanDecimatedData(chart);\n }\n};\n\nfunction _segments(line, target, property) {\n const segments = line.segments;\n const points = line.points;\n const tpoints = target.points;\n const parts = [];\n for (const segment of segments){\n let { start , end } = segment;\n end = _findSegmentEnd(start, end, points);\n const bounds = _getBounds(property, points[start], points[end], segment.loop);\n if (!target.segments) {\n parts.push({\n source: segment,\n target: bounds,\n start: points[start],\n end: points[end]\n });\n continue;\n }\n const targetSegments = _boundSegments(target, bounds);\n for (const tgt of targetSegments){\n const subBounds = _getBounds(property, tpoints[tgt.start], tpoints[tgt.end], tgt.loop);\n const fillSources = _boundSegment(segment, points, subBounds);\n for (const fillSource of fillSources){\n parts.push({\n source: fillSource,\n target: tgt,\n start: {\n [property]: _getEdge(bounds, subBounds, 'start', Math.max)\n },\n end: {\n [property]: _getEdge(bounds, subBounds, 'end', Math.min)\n }\n });\n }\n }\n }\n return parts;\n}\nfunction _getBounds(property, first, last, loop) {\n if (loop) {\n return;\n }\n let start = first[property];\n let end = last[property];\n if (property === 'angle') {\n start = _normalizeAngle(start);\n end = _normalizeAngle(end);\n }\n return {\n property,\n start,\n end\n };\n}\nfunction _pointsFromSegments(boundary, line) {\n const { x =null , y =null } = boundary || {};\n const linePoints = line.points;\n const points = [];\n line.segments.forEach(({ start , end })=>{\n end = _findSegmentEnd(start, end, linePoints);\n const first = linePoints[start];\n const last = linePoints[end];\n if (y !== null) {\n points.push({\n x: first.x,\n y\n });\n points.push({\n x: last.x,\n y\n });\n } else if (x !== null) {\n points.push({\n x,\n y: first.y\n });\n points.push({\n x,\n y: last.y\n });\n }\n });\n return points;\n}\nfunction _findSegmentEnd(start, end, points) {\n for(; end > start; end--){\n const point = points[end];\n if (!isNaN(point.x) && !isNaN(point.y)) {\n break;\n }\n }\n return end;\n}\nfunction _getEdge(a, b, prop, fn) {\n if (a && b) {\n return fn(a[prop], b[prop]);\n }\n return a ? a[prop] : b ? b[prop] : 0;\n}\n\nfunction _createBoundaryLine(boundary, line) {\n let points = [];\n let _loop = false;\n if (isArray(boundary)) {\n _loop = true;\n points = boundary;\n } else {\n points = _pointsFromSegments(boundary, line);\n }\n return points.length ? new LineElement({\n points,\n options: {\n tension: 0\n },\n _loop,\n _fullLoop: _loop\n }) : null;\n}\nfunction _shouldApplyFill(source) {\n return source && source.fill !== false;\n}\n\nfunction _resolveTarget(sources, index, propagate) {\n const source = sources[index];\n let fill = source.fill;\n const visited = [\n index\n ];\n let target;\n if (!propagate) {\n return fill;\n }\n while(fill !== false && visited.indexOf(fill) === -1){\n if (!isNumberFinite(fill)) {\n return fill;\n }\n target = sources[fill];\n if (!target) {\n return false;\n }\n if (target.visible) {\n return fill;\n }\n visited.push(fill);\n fill = target.fill;\n }\n return false;\n}\n function _decodeFill(line, index, count) {\n const fill = parseFillOption(line);\n if (isObject(fill)) {\n return isNaN(fill.value) ? false : fill;\n }\n let target = parseFloat(fill);\n if (isNumberFinite(target) && Math.floor(target) === target) {\n return decodeTargetIndex(fill[0], index, target, count);\n }\n return [\n 'origin',\n 'start',\n 'end',\n 'stack',\n 'shape'\n ].indexOf(fill) >= 0 && fill;\n}\nfunction decodeTargetIndex(firstCh, index, target, count) {\n if (firstCh === '-' || firstCh === '+') {\n target = index + target;\n }\n if (target === index || target < 0 || target >= count) {\n return false;\n }\n return target;\n}\n function _getTargetPixel(fill, scale) {\n let pixel = null;\n if (fill === 'start') {\n pixel = scale.bottom;\n } else if (fill === 'end') {\n pixel = scale.top;\n } else if (isObject(fill)) {\n pixel = scale.getPixelForValue(fill.value);\n } else if (scale.getBasePixel) {\n pixel = scale.getBasePixel();\n }\n return pixel;\n}\n function _getTargetValue(fill, scale, startValue) {\n let value;\n if (fill === 'start') {\n value = startValue;\n } else if (fill === 'end') {\n value = scale.options.reverse ? scale.min : scale.max;\n } else if (isObject(fill)) {\n value = fill.value;\n } else {\n value = scale.getBaseValue();\n }\n return value;\n}\n function parseFillOption(line) {\n const options = line.options;\n const fillOption = options.fill;\n let fill = valueOrDefault(fillOption && fillOption.target, fillOption);\n if (fill === undefined) {\n fill = !!options.backgroundColor;\n }\n if (fill === false || fill === null) {\n return false;\n }\n if (fill === true) {\n return 'origin';\n }\n return fill;\n}\n\nfunction _buildStackLine(source) {\n const { scale , index , line } = source;\n const points = [];\n const segments = line.segments;\n const sourcePoints = line.points;\n const linesBelow = getLinesBelow(scale, index);\n linesBelow.push(_createBoundaryLine({\n x: null,\n y: scale.bottom\n }, line));\n for(let i = 0; i < segments.length; i++){\n const segment = segments[i];\n for(let j = segment.start; j <= segment.end; j++){\n addPointsBelow(points, sourcePoints[j], linesBelow);\n }\n }\n return new LineElement({\n points,\n options: {}\n });\n}\n function getLinesBelow(scale, index) {\n const below = [];\n const metas = scale.getMatchingVisibleMetas('line');\n for(let i = 0; i < metas.length; i++){\n const meta = metas[i];\n if (meta.index === index) {\n break;\n }\n if (!meta.hidden) {\n below.unshift(meta.dataset);\n }\n }\n return below;\n}\n function addPointsBelow(points, sourcePoint, linesBelow) {\n const postponed = [];\n for(let j = 0; j < linesBelow.length; j++){\n const line = linesBelow[j];\n const { first , last , point } = findPoint(line, sourcePoint, 'x');\n if (!point || first && last) {\n continue;\n }\n if (first) {\n postponed.unshift(point);\n } else {\n points.push(point);\n if (!last) {\n break;\n }\n }\n }\n points.push(...postponed);\n}\n function findPoint(line, sourcePoint, property) {\n const point = line.interpolate(sourcePoint, property);\n if (!point) {\n return {};\n }\n const pointValue = point[property];\n const segments = line.segments;\n const linePoints = line.points;\n let first = false;\n let last = false;\n for(let i = 0; i < segments.length; i++){\n const segment = segments[i];\n const firstValue = linePoints[segment.start][property];\n const lastValue = linePoints[segment.end][property];\n if (_isBetween(pointValue, firstValue, lastValue)) {\n first = pointValue === firstValue;\n last = pointValue === lastValue;\n break;\n }\n }\n return {\n first,\n last,\n point\n };\n}\n\nclass simpleArc {\n constructor(opts){\n this.x = opts.x;\n this.y = opts.y;\n this.radius = opts.radius;\n }\n pathSegment(ctx, bounds, opts) {\n const { x , y , radius } = this;\n bounds = bounds || {\n start: 0,\n end: TAU\n };\n ctx.arc(x, y, radius, bounds.end, bounds.start, true);\n return !opts.bounds;\n }\n interpolate(point) {\n const { x , y , radius } = this;\n const angle = point.angle;\n return {\n x: x + Math.cos(angle) * radius,\n y: y + Math.sin(angle) * radius,\n angle\n };\n }\n}\n\nfunction _getTarget(source) {\n const { chart , fill , line } = source;\n if (isNumberFinite(fill)) {\n return getLineByIndex(chart, fill);\n }\n if (fill === 'stack') {\n return _buildStackLine(source);\n }\n if (fill === 'shape') {\n return true;\n }\n const boundary = computeBoundary(source);\n if (boundary instanceof simpleArc) {\n return boundary;\n }\n return _createBoundaryLine(boundary, line);\n}\n function getLineByIndex(chart, index) {\n const meta = chart.getDatasetMeta(index);\n const visible = meta && chart.isDatasetVisible(index);\n return visible ? meta.dataset : null;\n}\nfunction computeBoundary(source) {\n const scale = source.scale || {};\n if (scale.getPointPositionForValue) {\n return computeCircularBoundary(source);\n }\n return computeLinearBoundary(source);\n}\nfunction computeLinearBoundary(source) {\n const { scale ={} , fill } = source;\n const pixel = _getTargetPixel(fill, scale);\n if (isNumberFinite(pixel)) {\n const horizontal = scale.isHorizontal();\n return {\n x: horizontal ? pixel : null,\n y: horizontal ? null : pixel\n };\n }\n return null;\n}\nfunction computeCircularBoundary(source) {\n const { scale , fill } = source;\n const options = scale.options;\n const length = scale.getLabels().length;\n const start = options.reverse ? scale.max : scale.min;\n const value = _getTargetValue(fill, scale, start);\n const target = [];\n if (options.grid.circular) {\n const center = scale.getPointPositionForValue(0, start);\n return new simpleArc({\n x: center.x,\n y: center.y,\n radius: scale.getDistanceFromCenterForValue(value)\n });\n }\n for(let i = 0; i < length; ++i){\n target.push(scale.getPointPositionForValue(i, value));\n }\n return target;\n}\n\nfunction _drawfill(ctx, source, area) {\n const target = _getTarget(source);\n const { line , scale , axis } = source;\n const lineOpts = line.options;\n const fillOption = lineOpts.fill;\n const color = lineOpts.backgroundColor;\n const { above =color , below =color } = fillOption || {};\n if (target && line.points.length) {\n clipArea(ctx, area);\n doFill(ctx, {\n line,\n target,\n above,\n below,\n area,\n scale,\n axis\n });\n unclipArea(ctx);\n }\n}\nfunction doFill(ctx, cfg) {\n const { line , target , above , below , area , scale } = cfg;\n const property = line._loop ? 'angle' : cfg.axis;\n ctx.save();\n if (property === 'x' && below !== above) {\n clipVertical(ctx, target, area.top);\n fill(ctx, {\n line,\n target,\n color: above,\n scale,\n property\n });\n ctx.restore();\n ctx.save();\n clipVertical(ctx, target, area.bottom);\n }\n fill(ctx, {\n line,\n target,\n color: below,\n scale,\n property\n });\n ctx.restore();\n}\nfunction clipVertical(ctx, target, clipY) {\n const { segments , points } = target;\n let first = true;\n let lineLoop = false;\n ctx.beginPath();\n for (const segment of segments){\n const { start , end } = segment;\n const firstPoint = points[start];\n const lastPoint = points[_findSegmentEnd(start, end, points)];\n if (first) {\n ctx.moveTo(firstPoint.x, firstPoint.y);\n first = false;\n } else {\n ctx.lineTo(firstPoint.x, clipY);\n ctx.lineTo(firstPoint.x, firstPoint.y);\n }\n lineLoop = !!target.pathSegment(ctx, segment, {\n move: lineLoop\n });\n if (lineLoop) {\n ctx.closePath();\n } else {\n ctx.lineTo(lastPoint.x, clipY);\n }\n }\n ctx.lineTo(target.first().x, clipY);\n ctx.closePath();\n ctx.clip();\n}\nfunction fill(ctx, cfg) {\n const { line , target , property , color , scale } = cfg;\n const segments = _segments(line, target, property);\n for (const { source: src , target: tgt , start , end } of segments){\n const { style: { backgroundColor =color } = {} } = src;\n const notShape = target !== true;\n ctx.save();\n ctx.fillStyle = backgroundColor;\n clipBounds(ctx, scale, notShape && _getBounds(property, start, end));\n ctx.beginPath();\n const lineLoop = !!line.pathSegment(ctx, src);\n let loop;\n if (notShape) {\n if (lineLoop) {\n ctx.closePath();\n } else {\n interpolatedLineTo(ctx, target, end, property);\n }\n const targetLoop = !!target.pathSegment(ctx, tgt, {\n move: lineLoop,\n reverse: true\n });\n loop = lineLoop && targetLoop;\n if (!loop) {\n interpolatedLineTo(ctx, target, start, property);\n }\n }\n ctx.closePath();\n ctx.fill(loop ? 'evenodd' : 'nonzero');\n ctx.restore();\n }\n}\nfunction clipBounds(ctx, scale, bounds) {\n const { top , bottom } = scale.chart.chartArea;\n const { property , start , end } = bounds || {};\n if (property === 'x') {\n ctx.beginPath();\n ctx.rect(start, top, end - start, bottom - top);\n ctx.clip();\n }\n}\nfunction interpolatedLineTo(ctx, target, point, property) {\n const interpolatedPoint = target.interpolate(point, property);\n if (interpolatedPoint) {\n ctx.lineTo(interpolatedPoint.x, interpolatedPoint.y);\n }\n}\n\nvar index = {\n id: 'filler',\n afterDatasetsUpdate (chart, _args, options) {\n const count = (chart.data.datasets || []).length;\n const sources = [];\n let meta, i, line, source;\n for(i = 0; i < count; ++i){\n meta = chart.getDatasetMeta(i);\n line = meta.dataset;\n source = null;\n if (line && line.options && line instanceof LineElement) {\n source = {\n visible: chart.isDatasetVisible(i),\n index: i,\n fill: _decodeFill(line, i, count),\n chart,\n axis: meta.controller.options.indexAxis,\n scale: meta.vScale,\n line\n };\n }\n meta.$filler = source;\n sources.push(source);\n }\n for(i = 0; i < count; ++i){\n source = sources[i];\n if (!source || source.fill === false) {\n continue;\n }\n source.fill = _resolveTarget(sources, i, options.propagate);\n }\n },\n beforeDraw (chart, _args, options) {\n const draw = options.drawTime === 'beforeDraw';\n const metasets = chart.getSortedVisibleDatasetMetas();\n const area = chart.chartArea;\n for(let i = metasets.length - 1; i >= 0; --i){\n const source = metasets[i].$filler;\n if (!source) {\n continue;\n }\n source.line.updateControlPoints(area, source.axis);\n if (draw && source.fill) {\n _drawfill(chart.ctx, source, area);\n }\n }\n },\n beforeDatasetsDraw (chart, _args, options) {\n if (options.drawTime !== 'beforeDatasetsDraw') {\n return;\n }\n const metasets = chart.getSortedVisibleDatasetMetas();\n for(let i = metasets.length - 1; i >= 0; --i){\n const source = metasets[i].$filler;\n if (_shouldApplyFill(source)) {\n _drawfill(chart.ctx, source, chart.chartArea);\n }\n }\n },\n beforeDatasetDraw (chart, args, options) {\n const source = args.meta.$filler;\n if (!_shouldApplyFill(source) || options.drawTime !== 'beforeDatasetDraw') {\n return;\n }\n _drawfill(chart.ctx, source, chart.chartArea);\n },\n defaults: {\n propagate: true,\n drawTime: 'beforeDatasetDraw'\n }\n};\n\nconst getBoxSize = (labelOpts, fontSize)=>{\n let { boxHeight =fontSize , boxWidth =fontSize } = labelOpts;\n if (labelOpts.usePointStyle) {\n boxHeight = Math.min(boxHeight, fontSize);\n boxWidth = labelOpts.pointStyleWidth || Math.min(boxWidth, fontSize);\n }\n return {\n boxWidth,\n boxHeight,\n itemHeight: Math.max(fontSize, boxHeight)\n };\n};\nconst itemsEqual = (a, b)=>a !== null && b !== null && a.datasetIndex === b.datasetIndex && a.index === b.index;\nclass Legend extends Element {\n constructor(config){\n super();\n this._added = false;\n this.legendHitBoxes = [];\n this._hoveredItem = null;\n this.doughnutMode = false;\n this.chart = config.chart;\n this.options = config.options;\n this.ctx = config.ctx;\n this.legendItems = undefined;\n this.columnSizes = undefined;\n this.lineWidths = undefined;\n this.maxHeight = undefined;\n this.maxWidth = undefined;\n this.top = undefined;\n this.bottom = undefined;\n this.left = undefined;\n this.right = undefined;\n this.height = undefined;\n this.width = undefined;\n this._margins = undefined;\n this.position = undefined;\n this.weight = undefined;\n this.fullSize = undefined;\n }\n update(maxWidth, maxHeight, margins) {\n this.maxWidth = maxWidth;\n this.maxHeight = maxHeight;\n this._margins = margins;\n this.setDimensions();\n this.buildLabels();\n this.fit();\n }\n setDimensions() {\n if (this.isHorizontal()) {\n this.width = this.maxWidth;\n this.left = this._margins.left;\n this.right = this.width;\n } else {\n this.height = this.maxHeight;\n this.top = this._margins.top;\n this.bottom = this.height;\n }\n }\n buildLabels() {\n const labelOpts = this.options.labels || {};\n let legendItems = callback(labelOpts.generateLabels, [\n this.chart\n ], this) || [];\n if (labelOpts.filter) {\n legendItems = legendItems.filter((item)=>labelOpts.filter(item, this.chart.data));\n }\n if (labelOpts.sort) {\n legendItems = legendItems.sort((a, b)=>labelOpts.sort(a, b, this.chart.data));\n }\n if (this.options.reverse) {\n legendItems.reverse();\n }\n this.legendItems = legendItems;\n }\n fit() {\n const { options , ctx } = this;\n if (!options.display) {\n this.width = this.height = 0;\n return;\n }\n const labelOpts = options.labels;\n const labelFont = toFont(labelOpts.font);\n const fontSize = labelFont.size;\n const titleHeight = this._computeTitleHeight();\n const { boxWidth , itemHeight } = getBoxSize(labelOpts, fontSize);\n let width, height;\n ctx.font = labelFont.string;\n if (this.isHorizontal()) {\n width = this.maxWidth;\n height = this._fitRows(titleHeight, fontSize, boxWidth, itemHeight) + 10;\n } else {\n height = this.maxHeight;\n width = this._fitCols(titleHeight, labelFont, boxWidth, itemHeight) + 10;\n }\n this.width = Math.min(width, options.maxWidth || this.maxWidth);\n this.height = Math.min(height, options.maxHeight || this.maxHeight);\n }\n _fitRows(titleHeight, fontSize, boxWidth, itemHeight) {\n const { ctx , maxWidth , options: { labels: { padding } } } = this;\n const hitboxes = this.legendHitBoxes = [];\n const lineWidths = this.lineWidths = [\n 0\n ];\n const lineHeight = itemHeight + padding;\n let totalHeight = titleHeight;\n ctx.textAlign = 'left';\n ctx.textBaseline = 'middle';\n let row = -1;\n let top = -lineHeight;\n this.legendItems.forEach((legendItem, i)=>{\n const itemWidth = boxWidth + fontSize / 2 + ctx.measureText(legendItem.text).width;\n if (i === 0 || lineWidths[lineWidths.length - 1] + itemWidth + 2 * padding > maxWidth) {\n totalHeight += lineHeight;\n lineWidths[lineWidths.length - (i > 0 ? 0 : 1)] = 0;\n top += lineHeight;\n row++;\n }\n hitboxes[i] = {\n left: 0,\n top,\n row,\n width: itemWidth,\n height: itemHeight\n };\n lineWidths[lineWidths.length - 1] += itemWidth + padding;\n });\n return totalHeight;\n }\n _fitCols(titleHeight, labelFont, boxWidth, _itemHeight) {\n const { ctx , maxHeight , options: { labels: { padding } } } = this;\n const hitboxes = this.legendHitBoxes = [];\n const columnSizes = this.columnSizes = [];\n const heightLimit = maxHeight - titleHeight;\n let totalWidth = padding;\n let currentColWidth = 0;\n let currentColHeight = 0;\n let left = 0;\n let col = 0;\n this.legendItems.forEach((legendItem, i)=>{\n const { itemWidth , itemHeight } = calculateItemSize(boxWidth, labelFont, ctx, legendItem, _itemHeight);\n if (i > 0 && currentColHeight + itemHeight + 2 * padding > heightLimit) {\n totalWidth += currentColWidth + padding;\n columnSizes.push({\n width: currentColWidth,\n height: currentColHeight\n });\n left += currentColWidth + padding;\n col++;\n currentColWidth = currentColHeight = 0;\n }\n hitboxes[i] = {\n left,\n top: currentColHeight,\n col,\n width: itemWidth,\n height: itemHeight\n };\n currentColWidth = Math.max(currentColWidth, itemWidth);\n currentColHeight += itemHeight + padding;\n });\n totalWidth += currentColWidth;\n columnSizes.push({\n width: currentColWidth,\n height: currentColHeight\n });\n return totalWidth;\n }\n adjustHitBoxes() {\n if (!this.options.display) {\n return;\n }\n const titleHeight = this._computeTitleHeight();\n const { legendHitBoxes: hitboxes , options: { align , labels: { padding } , rtl } } = this;\n const rtlHelper = getRtlAdapter(rtl, this.left, this.width);\n if (this.isHorizontal()) {\n let row = 0;\n let left = _alignStartEnd(align, this.left + padding, this.right - this.lineWidths[row]);\n for (const hitbox of hitboxes){\n if (row !== hitbox.row) {\n row = hitbox.row;\n left = _alignStartEnd(align, this.left + padding, this.right - this.lineWidths[row]);\n }\n hitbox.top += this.top + titleHeight + padding;\n hitbox.left = rtlHelper.leftForLtr(rtlHelper.x(left), hitbox.width);\n left += hitbox.width + padding;\n }\n } else {\n let col = 0;\n let top = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - this.columnSizes[col].height);\n for (const hitbox of hitboxes){\n if (hitbox.col !== col) {\n col = hitbox.col;\n top = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - this.columnSizes[col].height);\n }\n hitbox.top = top;\n hitbox.left += this.left + padding;\n hitbox.left = rtlHelper.leftForLtr(rtlHelper.x(hitbox.left), hitbox.width);\n top += hitbox.height + padding;\n }\n }\n }\n isHorizontal() {\n return this.options.position === 'top' || this.options.position === 'bottom';\n }\n draw() {\n if (this.options.display) {\n const ctx = this.ctx;\n clipArea(ctx, this);\n this._draw();\n unclipArea(ctx);\n }\n }\n _draw() {\n const { options: opts , columnSizes , lineWidths , ctx } = this;\n const { align , labels: labelOpts } = opts;\n const defaultColor = defaults.color;\n const rtlHelper = getRtlAdapter(opts.rtl, this.left, this.width);\n const labelFont = toFont(labelOpts.font);\n const { padding } = labelOpts;\n const fontSize = labelFont.size;\n const halfFontSize = fontSize / 2;\n let cursor;\n this.drawTitle();\n ctx.textAlign = rtlHelper.textAlign('left');\n ctx.textBaseline = 'middle';\n ctx.lineWidth = 0.5;\n ctx.font = labelFont.string;\n const { boxWidth , boxHeight , itemHeight } = getBoxSize(labelOpts, fontSize);\n const drawLegendBox = function(x, y, legendItem) {\n if (isNaN(boxWidth) || boxWidth <= 0 || isNaN(boxHeight) || boxHeight < 0) {\n return;\n }\n ctx.save();\n const lineWidth = valueOrDefault(legendItem.lineWidth, 1);\n ctx.fillStyle = valueOrDefault(legendItem.fillStyle, defaultColor);\n ctx.lineCap = valueOrDefault(legendItem.lineCap, 'butt');\n ctx.lineDashOffset = valueOrDefault(legendItem.lineDashOffset, 0);\n ctx.lineJoin = valueOrDefault(legendItem.lineJoin, 'miter');\n ctx.lineWidth = lineWidth;\n ctx.strokeStyle = valueOrDefault(legendItem.strokeStyle, defaultColor);\n ctx.setLineDash(valueOrDefault(legendItem.lineDash, []));\n if (labelOpts.usePointStyle) {\n const drawOptions = {\n radius: boxHeight * Math.SQRT2 / 2,\n pointStyle: legendItem.pointStyle,\n rotation: legendItem.rotation,\n borderWidth: lineWidth\n };\n const centerX = rtlHelper.xPlus(x, boxWidth / 2);\n const centerY = y + halfFontSize;\n drawPointLegend(ctx, drawOptions, centerX, centerY, labelOpts.pointStyleWidth && boxWidth);\n } else {\n const yBoxTop = y + Math.max((fontSize - boxHeight) / 2, 0);\n const xBoxLeft = rtlHelper.leftForLtr(x, boxWidth);\n const borderRadius = toTRBLCorners(legendItem.borderRadius);\n ctx.beginPath();\n if (Object.values(borderRadius).some((v)=>v !== 0)) {\n addRoundedRectPath(ctx, {\n x: xBoxLeft,\n y: yBoxTop,\n w: boxWidth,\n h: boxHeight,\n radius: borderRadius\n });\n } else {\n ctx.rect(xBoxLeft, yBoxTop, boxWidth, boxHeight);\n }\n ctx.fill();\n if (lineWidth !== 0) {\n ctx.stroke();\n }\n }\n ctx.restore();\n };\n const fillText = function(x, y, legendItem) {\n renderText(ctx, legendItem.text, x, y + itemHeight / 2, labelFont, {\n strikethrough: legendItem.hidden,\n textAlign: rtlHelper.textAlign(legendItem.textAlign)\n });\n };\n const isHorizontal = this.isHorizontal();\n const titleHeight = this._computeTitleHeight();\n if (isHorizontal) {\n cursor = {\n x: _alignStartEnd(align, this.left + padding, this.right - lineWidths[0]),\n y: this.top + padding + titleHeight,\n line: 0\n };\n } else {\n cursor = {\n x: this.left + padding,\n y: _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - columnSizes[0].height),\n line: 0\n };\n }\n overrideTextDirection(this.ctx, opts.textDirection);\n const lineHeight = itemHeight + padding;\n this.legendItems.forEach((legendItem, i)=>{\n ctx.strokeStyle = legendItem.fontColor;\n ctx.fillStyle = legendItem.fontColor;\n const textWidth = ctx.measureText(legendItem.text).width;\n const textAlign = rtlHelper.textAlign(legendItem.textAlign || (legendItem.textAlign = labelOpts.textAlign));\n const width = boxWidth + halfFontSize + textWidth;\n let x = cursor.x;\n let y = cursor.y;\n rtlHelper.setWidth(this.width);\n if (isHorizontal) {\n if (i > 0 && x + width + padding > this.right) {\n y = cursor.y += lineHeight;\n cursor.line++;\n x = cursor.x = _alignStartEnd(align, this.left + padding, this.right - lineWidths[cursor.line]);\n }\n } else if (i > 0 && y + lineHeight > this.bottom) {\n x = cursor.x = x + columnSizes[cursor.line].width + padding;\n cursor.line++;\n y = cursor.y = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - columnSizes[cursor.line].height);\n }\n const realX = rtlHelper.x(x);\n drawLegendBox(realX, y, legendItem);\n x = _textX(textAlign, x + boxWidth + halfFontSize, isHorizontal ? x + width : this.right, opts.rtl);\n fillText(rtlHelper.x(x), y, legendItem);\n if (isHorizontal) {\n cursor.x += width + padding;\n } else if (typeof legendItem.text !== 'string') {\n const fontLineHeight = labelFont.lineHeight;\n cursor.y += calculateLegendItemHeight(legendItem, fontLineHeight) + padding;\n } else {\n cursor.y += lineHeight;\n }\n });\n restoreTextDirection(this.ctx, opts.textDirection);\n }\n drawTitle() {\n const opts = this.options;\n const titleOpts = opts.title;\n const titleFont = toFont(titleOpts.font);\n const titlePadding = toPadding(titleOpts.padding);\n if (!titleOpts.display) {\n return;\n }\n const rtlHelper = getRtlAdapter(opts.rtl, this.left, this.width);\n const ctx = this.ctx;\n const position = titleOpts.position;\n const halfFontSize = titleFont.size / 2;\n const topPaddingPlusHalfFontSize = titlePadding.top + halfFontSize;\n let y;\n let left = this.left;\n let maxWidth = this.width;\n if (this.isHorizontal()) {\n maxWidth = Math.max(...this.lineWidths);\n y = this.top + topPaddingPlusHalfFontSize;\n left = _alignStartEnd(opts.align, left, this.right - maxWidth);\n } else {\n const maxHeight = this.columnSizes.reduce((acc, size)=>Math.max(acc, size.height), 0);\n y = topPaddingPlusHalfFontSize + _alignStartEnd(opts.align, this.top, this.bottom - maxHeight - opts.labels.padding - this._computeTitleHeight());\n }\n const x = _alignStartEnd(position, left, left + maxWidth);\n ctx.textAlign = rtlHelper.textAlign(_toLeftRightCenter(position));\n ctx.textBaseline = 'middle';\n ctx.strokeStyle = titleOpts.color;\n ctx.fillStyle = titleOpts.color;\n ctx.font = titleFont.string;\n renderText(ctx, titleOpts.text, x, y, titleFont);\n }\n _computeTitleHeight() {\n const titleOpts = this.options.title;\n const titleFont = toFont(titleOpts.font);\n const titlePadding = toPadding(titleOpts.padding);\n return titleOpts.display ? titleFont.lineHeight + titlePadding.height : 0;\n }\n _getLegendItemAt(x, y) {\n let i, hitBox, lh;\n if (_isBetween(x, this.left, this.right) && _isBetween(y, this.top, this.bottom)) {\n lh = this.legendHitBoxes;\n for(i = 0; i < lh.length; ++i){\n hitBox = lh[i];\n if (_isBetween(x, hitBox.left, hitBox.left + hitBox.width) && _isBetween(y, hitBox.top, hitBox.top + hitBox.height)) {\n return this.legendItems[i];\n }\n }\n }\n return null;\n }\n handleEvent(e) {\n const opts = this.options;\n if (!isListened(e.type, opts)) {\n return;\n }\n const hoveredItem = this._getLegendItemAt(e.x, e.y);\n if (e.type === 'mousemove' || e.type === 'mouseout') {\n const previous = this._hoveredItem;\n const sameItem = itemsEqual(previous, hoveredItem);\n if (previous && !sameItem) {\n callback(opts.onLeave, [\n e,\n previous,\n this\n ], this);\n }\n this._hoveredItem = hoveredItem;\n if (hoveredItem && !sameItem) {\n callback(opts.onHover, [\n e,\n hoveredItem,\n this\n ], this);\n }\n } else if (hoveredItem) {\n callback(opts.onClick, [\n e,\n hoveredItem,\n this\n ], this);\n }\n }\n}\nfunction calculateItemSize(boxWidth, labelFont, ctx, legendItem, _itemHeight) {\n const itemWidth = calculateItemWidth(legendItem, boxWidth, labelFont, ctx);\n const itemHeight = calculateItemHeight(_itemHeight, legendItem, labelFont.lineHeight);\n return {\n itemWidth,\n itemHeight\n };\n}\nfunction calculateItemWidth(legendItem, boxWidth, labelFont, ctx) {\n let legendItemText = legendItem.text;\n if (legendItemText && typeof legendItemText !== 'string') {\n legendItemText = legendItemText.reduce((a, b)=>a.length > b.length ? a : b);\n }\n return boxWidth + labelFont.size / 2 + ctx.measureText(legendItemText).width;\n}\nfunction calculateItemHeight(_itemHeight, legendItem, fontLineHeight) {\n let itemHeight = _itemHeight;\n if (typeof legendItem.text !== 'string') {\n itemHeight = calculateLegendItemHeight(legendItem, fontLineHeight);\n }\n return itemHeight;\n}\nfunction calculateLegendItemHeight(legendItem, fontLineHeight) {\n const labelHeight = legendItem.text ? legendItem.text.length : 0;\n return fontLineHeight * labelHeight;\n}\nfunction isListened(type, opts) {\n if ((type === 'mousemove' || type === 'mouseout') && (opts.onHover || opts.onLeave)) {\n return true;\n }\n if (opts.onClick && (type === 'click' || type === 'mouseup')) {\n return true;\n }\n return false;\n}\nvar plugin_legend = {\n id: 'legend',\n _element: Legend,\n start (chart, _args, options) {\n const legend = chart.legend = new Legend({\n ctx: chart.ctx,\n options,\n chart\n });\n layouts.configure(chart, legend, options);\n layouts.addBox(chart, legend);\n },\n stop (chart) {\n layouts.removeBox(chart, chart.legend);\n delete chart.legend;\n },\n beforeUpdate (chart, _args, options) {\n const legend = chart.legend;\n layouts.configure(chart, legend, options);\n legend.options = options;\n },\n afterUpdate (chart) {\n const legend = chart.legend;\n legend.buildLabels();\n legend.adjustHitBoxes();\n },\n afterEvent (chart, args) {\n if (!args.replay) {\n chart.legend.handleEvent(args.event);\n }\n },\n defaults: {\n display: true,\n position: 'top',\n align: 'center',\n fullSize: true,\n reverse: false,\n weight: 1000,\n onClick (e, legendItem, legend) {\n const index = legendItem.datasetIndex;\n const ci = legend.chart;\n if (ci.isDatasetVisible(index)) {\n ci.hide(index);\n legendItem.hidden = true;\n } else {\n ci.show(index);\n legendItem.hidden = false;\n }\n },\n onHover: null,\n onLeave: null,\n labels: {\n color: (ctx)=>ctx.chart.options.color,\n boxWidth: 40,\n padding: 10,\n generateLabels (chart) {\n const datasets = chart.data.datasets;\n const { labels: { usePointStyle , pointStyle , textAlign , color , useBorderRadius , borderRadius } } = chart.legend.options;\n return chart._getSortedDatasetMetas().map((meta)=>{\n const style = meta.controller.getStyle(usePointStyle ? 0 : undefined);\n const borderWidth = toPadding(style.borderWidth);\n return {\n text: datasets[meta.index].label,\n fillStyle: style.backgroundColor,\n fontColor: color,\n hidden: !meta.visible,\n lineCap: style.borderCapStyle,\n lineDash: style.borderDash,\n lineDashOffset: style.borderDashOffset,\n lineJoin: style.borderJoinStyle,\n lineWidth: (borderWidth.width + borderWidth.height) / 4,\n strokeStyle: style.borderColor,\n pointStyle: pointStyle || style.pointStyle,\n rotation: style.rotation,\n textAlign: textAlign || style.textAlign,\n borderRadius: useBorderRadius && (borderRadius || style.borderRadius),\n datasetIndex: meta.index\n };\n }, this);\n }\n },\n title: {\n color: (ctx)=>ctx.chart.options.color,\n display: false,\n position: 'center',\n text: ''\n }\n },\n descriptors: {\n _scriptable: (name)=>!name.startsWith('on'),\n labels: {\n _scriptable: (name)=>![\n 'generateLabels',\n 'filter',\n 'sort'\n ].includes(name)\n }\n }\n};\n\nclass Title extends Element {\n constructor(config){\n super();\n this.chart = config.chart;\n this.options = config.options;\n this.ctx = config.ctx;\n this._padding = undefined;\n this.top = undefined;\n this.bottom = undefined;\n this.left = undefined;\n this.right = undefined;\n this.width = undefined;\n this.height = undefined;\n this.position = undefined;\n this.weight = undefined;\n this.fullSize = undefined;\n }\n update(maxWidth, maxHeight) {\n const opts = this.options;\n this.left = 0;\n this.top = 0;\n if (!opts.display) {\n this.width = this.height = this.right = this.bottom = 0;\n return;\n }\n this.width = this.right = maxWidth;\n this.height = this.bottom = maxHeight;\n const lineCount = isArray(opts.text) ? opts.text.length : 1;\n this._padding = toPadding(opts.padding);\n const textSize = lineCount * toFont(opts.font).lineHeight + this._padding.height;\n if (this.isHorizontal()) {\n this.height = textSize;\n } else {\n this.width = textSize;\n }\n }\n isHorizontal() {\n const pos = this.options.position;\n return pos === 'top' || pos === 'bottom';\n }\n _drawArgs(offset) {\n const { top , left , bottom , right , options } = this;\n const align = options.align;\n let rotation = 0;\n let maxWidth, titleX, titleY;\n if (this.isHorizontal()) {\n titleX = _alignStartEnd(align, left, right);\n titleY = top + offset;\n maxWidth = right - left;\n } else {\n if (options.position === 'left') {\n titleX = left + offset;\n titleY = _alignStartEnd(align, bottom, top);\n rotation = PI * -0.5;\n } else {\n titleX = right - offset;\n titleY = _alignStartEnd(align, top, bottom);\n rotation = PI * 0.5;\n }\n maxWidth = bottom - top;\n }\n return {\n titleX,\n titleY,\n maxWidth,\n rotation\n };\n }\n draw() {\n const ctx = this.ctx;\n const opts = this.options;\n if (!opts.display) {\n return;\n }\n const fontOpts = toFont(opts.font);\n const lineHeight = fontOpts.lineHeight;\n const offset = lineHeight / 2 + this._padding.top;\n const { titleX , titleY , maxWidth , rotation } = this._drawArgs(offset);\n renderText(ctx, opts.text, 0, 0, fontOpts, {\n color: opts.color,\n maxWidth,\n rotation,\n textAlign: _toLeftRightCenter(opts.align),\n textBaseline: 'middle',\n translation: [\n titleX,\n titleY\n ]\n });\n }\n}\nfunction createTitle(chart, titleOpts) {\n const title = new Title({\n ctx: chart.ctx,\n options: titleOpts,\n chart\n });\n layouts.configure(chart, title, titleOpts);\n layouts.addBox(chart, title);\n chart.titleBlock = title;\n}\nvar plugin_title = {\n id: 'title',\n _element: Title,\n start (chart, _args, options) {\n createTitle(chart, options);\n },\n stop (chart) {\n const titleBlock = chart.titleBlock;\n layouts.removeBox(chart, titleBlock);\n delete chart.titleBlock;\n },\n beforeUpdate (chart, _args, options) {\n const title = chart.titleBlock;\n layouts.configure(chart, title, options);\n title.options = options;\n },\n defaults: {\n align: 'center',\n display: false,\n font: {\n weight: 'bold'\n },\n fullSize: true,\n padding: 10,\n position: 'top',\n text: '',\n weight: 2000\n },\n defaultRoutes: {\n color: 'color'\n },\n descriptors: {\n _scriptable: true,\n _indexable: false\n }\n};\n\nconst map = new WeakMap();\nvar plugin_subtitle = {\n id: 'subtitle',\n start (chart, _args, options) {\n const title = new Title({\n ctx: chart.ctx,\n options,\n chart\n });\n layouts.configure(chart, title, options);\n layouts.addBox(chart, title);\n map.set(chart, title);\n },\n stop (chart) {\n layouts.removeBox(chart, map.get(chart));\n map.delete(chart);\n },\n beforeUpdate (chart, _args, options) {\n const title = map.get(chart);\n layouts.configure(chart, title, options);\n title.options = options;\n },\n defaults: {\n align: 'center',\n display: false,\n font: {\n weight: 'normal'\n },\n fullSize: true,\n padding: 0,\n position: 'top',\n text: '',\n weight: 1500\n },\n defaultRoutes: {\n color: 'color'\n },\n descriptors: {\n _scriptable: true,\n _indexable: false\n }\n};\n\nconst positioners = {\n average (items) {\n if (!items.length) {\n return false;\n }\n let i, len;\n let x = 0;\n let y = 0;\n let count = 0;\n for(i = 0, len = items.length; i < len; ++i){\n const el = items[i].element;\n if (el && el.hasValue()) {\n const pos = el.tooltipPosition();\n x += pos.x;\n y += pos.y;\n ++count;\n }\n }\n return {\n x: x / count,\n y: y / count\n };\n },\n nearest (items, eventPosition) {\n if (!items.length) {\n return false;\n }\n let x = eventPosition.x;\n let y = eventPosition.y;\n let minDistance = Number.POSITIVE_INFINITY;\n let i, len, nearestElement;\n for(i = 0, len = items.length; i < len; ++i){\n const el = items[i].element;\n if (el && el.hasValue()) {\n const center = el.getCenterPoint();\n const d = distanceBetweenPoints(eventPosition, center);\n if (d < minDistance) {\n minDistance = d;\n nearestElement = el;\n }\n }\n }\n if (nearestElement) {\n const tp = nearestElement.tooltipPosition();\n x = tp.x;\n y = tp.y;\n }\n return {\n x,\n y\n };\n }\n};\nfunction pushOrConcat(base, toPush) {\n if (toPush) {\n if (isArray(toPush)) {\n Array.prototype.push.apply(base, toPush);\n } else {\n base.push(toPush);\n }\n }\n return base;\n}\n function splitNewlines(str) {\n if ((typeof str === 'string' || str instanceof String) && str.indexOf('\\n') > -1) {\n return str.split('\\n');\n }\n return str;\n}\n function createTooltipItem(chart, item) {\n const { element , datasetIndex , index } = item;\n const controller = chart.getDatasetMeta(datasetIndex).controller;\n const { label , value } = controller.getLabelAndValue(index);\n return {\n chart,\n label,\n parsed: controller.getParsed(index),\n raw: chart.data.datasets[datasetIndex].data[index],\n formattedValue: value,\n dataset: controller.getDataset(),\n dataIndex: index,\n datasetIndex,\n element\n };\n}\n function getTooltipSize(tooltip, options) {\n const ctx = tooltip.chart.ctx;\n const { body , footer , title } = tooltip;\n const { boxWidth , boxHeight } = options;\n const bodyFont = toFont(options.bodyFont);\n const titleFont = toFont(options.titleFont);\n const footerFont = toFont(options.footerFont);\n const titleLineCount = title.length;\n const footerLineCount = footer.length;\n const bodyLineItemCount = body.length;\n const padding = toPadding(options.padding);\n let height = padding.height;\n let width = 0;\n let combinedBodyLength = body.reduce((count, bodyItem)=>count + bodyItem.before.length + bodyItem.lines.length + bodyItem.after.length, 0);\n combinedBodyLength += tooltip.beforeBody.length + tooltip.afterBody.length;\n if (titleLineCount) {\n height += titleLineCount * titleFont.lineHeight + (titleLineCount - 1) * options.titleSpacing + options.titleMarginBottom;\n }\n if (combinedBodyLength) {\n const bodyLineHeight = options.displayColors ? Math.max(boxHeight, bodyFont.lineHeight) : bodyFont.lineHeight;\n height += bodyLineItemCount * bodyLineHeight + (combinedBodyLength - bodyLineItemCount) * bodyFont.lineHeight + (combinedBodyLength - 1) * options.bodySpacing;\n }\n if (footerLineCount) {\n height += options.footerMarginTop + footerLineCount * footerFont.lineHeight + (footerLineCount - 1) * options.footerSpacing;\n }\n let widthPadding = 0;\n const maxLineWidth = function(line) {\n width = Math.max(width, ctx.measureText(line).width + widthPadding);\n };\n ctx.save();\n ctx.font = titleFont.string;\n each(tooltip.title, maxLineWidth);\n ctx.font = bodyFont.string;\n each(tooltip.beforeBody.concat(tooltip.afterBody), maxLineWidth);\n widthPadding = options.displayColors ? boxWidth + 2 + options.boxPadding : 0;\n each(body, (bodyItem)=>{\n each(bodyItem.before, maxLineWidth);\n each(bodyItem.lines, maxLineWidth);\n each(bodyItem.after, maxLineWidth);\n });\n widthPadding = 0;\n ctx.font = footerFont.string;\n each(tooltip.footer, maxLineWidth);\n ctx.restore();\n width += padding.width;\n return {\n width,\n height\n };\n}\nfunction determineYAlign(chart, size) {\n const { y , height } = size;\n if (y < height / 2) {\n return 'top';\n } else if (y > chart.height - height / 2) {\n return 'bottom';\n }\n return 'center';\n}\nfunction doesNotFitWithAlign(xAlign, chart, options, size) {\n const { x , width } = size;\n const caret = options.caretSize + options.caretPadding;\n if (xAlign === 'left' && x + width + caret > chart.width) {\n return true;\n }\n if (xAlign === 'right' && x - width - caret < 0) {\n return true;\n }\n}\nfunction determineXAlign(chart, options, size, yAlign) {\n const { x , width } = size;\n const { width: chartWidth , chartArea: { left , right } } = chart;\n let xAlign = 'center';\n if (yAlign === 'center') {\n xAlign = x <= (left + right) / 2 ? 'left' : 'right';\n } else if (x <= width / 2) {\n xAlign = 'left';\n } else if (x >= chartWidth - width / 2) {\n xAlign = 'right';\n }\n if (doesNotFitWithAlign(xAlign, chart, options, size)) {\n xAlign = 'center';\n }\n return xAlign;\n}\n function determineAlignment(chart, options, size) {\n const yAlign = size.yAlign || options.yAlign || determineYAlign(chart, size);\n return {\n xAlign: size.xAlign || options.xAlign || determineXAlign(chart, options, size, yAlign),\n yAlign\n };\n}\nfunction alignX(size, xAlign) {\n let { x , width } = size;\n if (xAlign === 'right') {\n x -= width;\n } else if (xAlign === 'center') {\n x -= width / 2;\n }\n return x;\n}\nfunction alignY(size, yAlign, paddingAndSize) {\n let { y , height } = size;\n if (yAlign === 'top') {\n y += paddingAndSize;\n } else if (yAlign === 'bottom') {\n y -= height + paddingAndSize;\n } else {\n y -= height / 2;\n }\n return y;\n}\n function getBackgroundPoint(options, size, alignment, chart) {\n const { caretSize , caretPadding , cornerRadius } = options;\n const { xAlign , yAlign } = alignment;\n const paddingAndSize = caretSize + caretPadding;\n const { topLeft , topRight , bottomLeft , bottomRight } = toTRBLCorners(cornerRadius);\n let x = alignX(size, xAlign);\n const y = alignY(size, yAlign, paddingAndSize);\n if (yAlign === 'center') {\n if (xAlign === 'left') {\n x += paddingAndSize;\n } else if (xAlign === 'right') {\n x -= paddingAndSize;\n }\n } else if (xAlign === 'left') {\n x -= Math.max(topLeft, bottomLeft) + caretSize;\n } else if (xAlign === 'right') {\n x += Math.max(topRight, bottomRight) + caretSize;\n }\n return {\n x: _limitValue(x, 0, chart.width - size.width),\n y: _limitValue(y, 0, chart.height - size.height)\n };\n}\nfunction getAlignedX(tooltip, align, options) {\n const padding = toPadding(options.padding);\n return align === 'center' ? tooltip.x + tooltip.width / 2 : align === 'right' ? tooltip.x + tooltip.width - padding.right : tooltip.x + padding.left;\n}\n function getBeforeAfterBodyLines(callback) {\n return pushOrConcat([], splitNewlines(callback));\n}\nfunction createTooltipContext(parent, tooltip, tooltipItems) {\n return createContext(parent, {\n tooltip,\n tooltipItems,\n type: 'tooltip'\n });\n}\nfunction overrideCallbacks(callbacks, context) {\n const override = context && context.dataset && context.dataset.tooltip && context.dataset.tooltip.callbacks;\n return override ? callbacks.override(override) : callbacks;\n}\nconst defaultCallbacks = {\n beforeTitle: noop,\n title (tooltipItems) {\n if (tooltipItems.length > 0) {\n const item = tooltipItems[0];\n const labels = item.chart.data.labels;\n const labelCount = labels ? labels.length : 0;\n if (this && this.options && this.options.mode === 'dataset') {\n return item.dataset.label || '';\n } else if (item.label) {\n return item.label;\n } else if (labelCount > 0 && item.dataIndex < labelCount) {\n return labels[item.dataIndex];\n }\n }\n return '';\n },\n afterTitle: noop,\n beforeBody: noop,\n beforeLabel: noop,\n label (tooltipItem) {\n if (this && this.options && this.options.mode === 'dataset') {\n return tooltipItem.label + ': ' + tooltipItem.formattedValue || tooltipItem.formattedValue;\n }\n let label = tooltipItem.dataset.label || '';\n if (label) {\n label += ': ';\n }\n const value = tooltipItem.formattedValue;\n if (!isNullOrUndef(value)) {\n label += value;\n }\n return label;\n },\n labelColor (tooltipItem) {\n const meta = tooltipItem.chart.getDatasetMeta(tooltipItem.datasetIndex);\n const options = meta.controller.getStyle(tooltipItem.dataIndex);\n return {\n borderColor: options.borderColor,\n backgroundColor: options.backgroundColor,\n borderWidth: options.borderWidth,\n borderDash: options.borderDash,\n borderDashOffset: options.borderDashOffset,\n borderRadius: 0\n };\n },\n labelTextColor () {\n return this.options.bodyColor;\n },\n labelPointStyle (tooltipItem) {\n const meta = tooltipItem.chart.getDatasetMeta(tooltipItem.datasetIndex);\n const options = meta.controller.getStyle(tooltipItem.dataIndex);\n return {\n pointStyle: options.pointStyle,\n rotation: options.rotation\n };\n },\n afterLabel: noop,\n afterBody: noop,\n beforeFooter: noop,\n footer: noop,\n afterFooter: noop\n};\n function invokeCallbackWithFallback(callbacks, name, ctx, arg) {\n const result = callbacks[name].call(ctx, arg);\n if (typeof result === 'undefined') {\n return defaultCallbacks[name].call(ctx, arg);\n }\n return result;\n}\nclass Tooltip extends Element {\n static positioners = positioners;\n constructor(config){\n super();\n this.opacity = 0;\n this._active = [];\n this._eventPosition = undefined;\n this._size = undefined;\n this._cachedAnimations = undefined;\n this._tooltipItems = [];\n this.$animations = undefined;\n this.$context = undefined;\n this.chart = config.chart;\n this.options = config.options;\n this.dataPoints = undefined;\n this.title = undefined;\n this.beforeBody = undefined;\n this.body = undefined;\n this.afterBody = undefined;\n this.footer = undefined;\n this.xAlign = undefined;\n this.yAlign = undefined;\n this.x = undefined;\n this.y = undefined;\n this.height = undefined;\n this.width = undefined;\n this.caretX = undefined;\n this.caretY = undefined;\n this.labelColors = undefined;\n this.labelPointStyles = undefined;\n this.labelTextColors = undefined;\n }\n initialize(options) {\n this.options = options;\n this._cachedAnimations = undefined;\n this.$context = undefined;\n }\n _resolveAnimations() {\n const cached = this._cachedAnimations;\n if (cached) {\n return cached;\n }\n const chart = this.chart;\n const options = this.options.setContext(this.getContext());\n const opts = options.enabled && chart.options.animation && options.animations;\n const animations = new Animations(this.chart, opts);\n if (opts._cacheable) {\n this._cachedAnimations = Object.freeze(animations);\n }\n return animations;\n }\n getContext() {\n return this.$context || (this.$context = createTooltipContext(this.chart.getContext(), this, this._tooltipItems));\n }\n getTitle(context, options) {\n const { callbacks } = options;\n const beforeTitle = invokeCallbackWithFallback(callbacks, 'beforeTitle', this, context);\n const title = invokeCallbackWithFallback(callbacks, 'title', this, context);\n const afterTitle = invokeCallbackWithFallback(callbacks, 'afterTitle', this, context);\n let lines = [];\n lines = pushOrConcat(lines, splitNewlines(beforeTitle));\n lines = pushOrConcat(lines, splitNewlines(title));\n lines = pushOrConcat(lines, splitNewlines(afterTitle));\n return lines;\n }\n getBeforeBody(tooltipItems, options) {\n return getBeforeAfterBodyLines(invokeCallbackWithFallback(options.callbacks, 'beforeBody', this, tooltipItems));\n }\n getBody(tooltipItems, options) {\n const { callbacks } = options;\n const bodyItems = [];\n each(tooltipItems, (context)=>{\n const bodyItem = {\n before: [],\n lines: [],\n after: []\n };\n const scoped = overrideCallbacks(callbacks, context);\n pushOrConcat(bodyItem.before, splitNewlines(invokeCallbackWithFallback(scoped, 'beforeLabel', this, context)));\n pushOrConcat(bodyItem.lines, invokeCallbackWithFallback(scoped, 'label', this, context));\n pushOrConcat(bodyItem.after, splitNewlines(invokeCallbackWithFallback(scoped, 'afterLabel', this, context)));\n bodyItems.push(bodyItem);\n });\n return bodyItems;\n }\n getAfterBody(tooltipItems, options) {\n return getBeforeAfterBodyLines(invokeCallbackWithFallback(options.callbacks, 'afterBody', this, tooltipItems));\n }\n getFooter(tooltipItems, options) {\n const { callbacks } = options;\n const beforeFooter = invokeCallbackWithFallback(callbacks, 'beforeFooter', this, tooltipItems);\n const footer = invokeCallbackWithFallback(callbacks, 'footer', this, tooltipItems);\n const afterFooter = invokeCallbackWithFallback(callbacks, 'afterFooter', this, tooltipItems);\n let lines = [];\n lines = pushOrConcat(lines, splitNewlines(beforeFooter));\n lines = pushOrConcat(lines, splitNewlines(footer));\n lines = pushOrConcat(lines, splitNewlines(afterFooter));\n return lines;\n }\n _createItems(options) {\n const active = this._active;\n const data = this.chart.data;\n const labelColors = [];\n const labelPointStyles = [];\n const labelTextColors = [];\n let tooltipItems = [];\n let i, len;\n for(i = 0, len = active.length; i < len; ++i){\n tooltipItems.push(createTooltipItem(this.chart, active[i]));\n }\n if (options.filter) {\n tooltipItems = tooltipItems.filter((element, index, array)=>options.filter(element, index, array, data));\n }\n if (options.itemSort) {\n tooltipItems = tooltipItems.sort((a, b)=>options.itemSort(a, b, data));\n }\n each(tooltipItems, (context)=>{\n const scoped = overrideCallbacks(options.callbacks, context);\n labelColors.push(invokeCallbackWithFallback(scoped, 'labelColor', this, context));\n labelPointStyles.push(invokeCallbackWithFallback(scoped, 'labelPointStyle', this, context));\n labelTextColors.push(invokeCallbackWithFallback(scoped, 'labelTextColor', this, context));\n });\n this.labelColors = labelColors;\n this.labelPointStyles = labelPointStyles;\n this.labelTextColors = labelTextColors;\n this.dataPoints = tooltipItems;\n return tooltipItems;\n }\n update(changed, replay) {\n const options = this.options.setContext(this.getContext());\n const active = this._active;\n let properties;\n let tooltipItems = [];\n if (!active.length) {\n if (this.opacity !== 0) {\n properties = {\n opacity: 0\n };\n }\n } else {\n const position = positioners[options.position].call(this, active, this._eventPosition);\n tooltipItems = this._createItems(options);\n this.title = this.getTitle(tooltipItems, options);\n this.beforeBody = this.getBeforeBody(tooltipItems, options);\n this.body = this.getBody(tooltipItems, options);\n this.afterBody = this.getAfterBody(tooltipItems, options);\n this.footer = this.getFooter(tooltipItems, options);\n const size = this._size = getTooltipSize(this, options);\n const positionAndSize = Object.assign({}, position, size);\n const alignment = determineAlignment(this.chart, options, positionAndSize);\n const backgroundPoint = getBackgroundPoint(options, positionAndSize, alignment, this.chart);\n this.xAlign = alignment.xAlign;\n this.yAlign = alignment.yAlign;\n properties = {\n opacity: 1,\n x: backgroundPoint.x,\n y: backgroundPoint.y,\n width: size.width,\n height: size.height,\n caretX: position.x,\n caretY: position.y\n };\n }\n this._tooltipItems = tooltipItems;\n this.$context = undefined;\n if (properties) {\n this._resolveAnimations().update(this, properties);\n }\n if (changed && options.external) {\n options.external.call(this, {\n chart: this.chart,\n tooltip: this,\n replay\n });\n }\n }\n drawCaret(tooltipPoint, ctx, size, options) {\n const caretPosition = this.getCaretPosition(tooltipPoint, size, options);\n ctx.lineTo(caretPosition.x1, caretPosition.y1);\n ctx.lineTo(caretPosition.x2, caretPosition.y2);\n ctx.lineTo(caretPosition.x3, caretPosition.y3);\n }\n getCaretPosition(tooltipPoint, size, options) {\n const { xAlign , yAlign } = this;\n const { caretSize , cornerRadius } = options;\n const { topLeft , topRight , bottomLeft , bottomRight } = toTRBLCorners(cornerRadius);\n const { x: ptX , y: ptY } = tooltipPoint;\n const { width , height } = size;\n let x1, x2, x3, y1, y2, y3;\n if (yAlign === 'center') {\n y2 = ptY + height / 2;\n if (xAlign === 'left') {\n x1 = ptX;\n x2 = x1 - caretSize;\n y1 = y2 + caretSize;\n y3 = y2 - caretSize;\n } else {\n x1 = ptX + width;\n x2 = x1 + caretSize;\n y1 = y2 - caretSize;\n y3 = y2 + caretSize;\n }\n x3 = x1;\n } else {\n if (xAlign === 'left') {\n x2 = ptX + Math.max(topLeft, bottomLeft) + caretSize;\n } else if (xAlign === 'right') {\n x2 = ptX + width - Math.max(topRight, bottomRight) - caretSize;\n } else {\n x2 = this.caretX;\n }\n if (yAlign === 'top') {\n y1 = ptY;\n y2 = y1 - caretSize;\n x1 = x2 - caretSize;\n x3 = x2 + caretSize;\n } else {\n y1 = ptY + height;\n y2 = y1 + caretSize;\n x1 = x2 + caretSize;\n x3 = x2 - caretSize;\n }\n y3 = y1;\n }\n return {\n x1,\n x2,\n x3,\n y1,\n y2,\n y3\n };\n }\n drawTitle(pt, ctx, options) {\n const title = this.title;\n const length = title.length;\n let titleFont, titleSpacing, i;\n if (length) {\n const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width);\n pt.x = getAlignedX(this, options.titleAlign, options);\n ctx.textAlign = rtlHelper.textAlign(options.titleAlign);\n ctx.textBaseline = 'middle';\n titleFont = toFont(options.titleFont);\n titleSpacing = options.titleSpacing;\n ctx.fillStyle = options.titleColor;\n ctx.font = titleFont.string;\n for(i = 0; i < length; ++i){\n ctx.fillText(title[i], rtlHelper.x(pt.x), pt.y + titleFont.lineHeight / 2);\n pt.y += titleFont.lineHeight + titleSpacing;\n if (i + 1 === length) {\n pt.y += options.titleMarginBottom - titleSpacing;\n }\n }\n }\n }\n _drawColorBox(ctx, pt, i, rtlHelper, options) {\n const labelColor = this.labelColors[i];\n const labelPointStyle = this.labelPointStyles[i];\n const { boxHeight , boxWidth } = options;\n const bodyFont = toFont(options.bodyFont);\n const colorX = getAlignedX(this, 'left', options);\n const rtlColorX = rtlHelper.x(colorX);\n const yOffSet = boxHeight < bodyFont.lineHeight ? (bodyFont.lineHeight - boxHeight) / 2 : 0;\n const colorY = pt.y + yOffSet;\n if (options.usePointStyle) {\n const drawOptions = {\n radius: Math.min(boxWidth, boxHeight) / 2,\n pointStyle: labelPointStyle.pointStyle,\n rotation: labelPointStyle.rotation,\n borderWidth: 1\n };\n const centerX = rtlHelper.leftForLtr(rtlColorX, boxWidth) + boxWidth / 2;\n const centerY = colorY + boxHeight / 2;\n ctx.strokeStyle = options.multiKeyBackground;\n ctx.fillStyle = options.multiKeyBackground;\n drawPoint(ctx, drawOptions, centerX, centerY);\n ctx.strokeStyle = labelColor.borderColor;\n ctx.fillStyle = labelColor.backgroundColor;\n drawPoint(ctx, drawOptions, centerX, centerY);\n } else {\n ctx.lineWidth = isObject(labelColor.borderWidth) ? Math.max(...Object.values(labelColor.borderWidth)) : labelColor.borderWidth || 1;\n ctx.strokeStyle = labelColor.borderColor;\n ctx.setLineDash(labelColor.borderDash || []);\n ctx.lineDashOffset = labelColor.borderDashOffset || 0;\n const outerX = rtlHelper.leftForLtr(rtlColorX, boxWidth);\n const innerX = rtlHelper.leftForLtr(rtlHelper.xPlus(rtlColorX, 1), boxWidth - 2);\n const borderRadius = toTRBLCorners(labelColor.borderRadius);\n if (Object.values(borderRadius).some((v)=>v !== 0)) {\n ctx.beginPath();\n ctx.fillStyle = options.multiKeyBackground;\n addRoundedRectPath(ctx, {\n x: outerX,\n y: colorY,\n w: boxWidth,\n h: boxHeight,\n radius: borderRadius\n });\n ctx.fill();\n ctx.stroke();\n ctx.fillStyle = labelColor.backgroundColor;\n ctx.beginPath();\n addRoundedRectPath(ctx, {\n x: innerX,\n y: colorY + 1,\n w: boxWidth - 2,\n h: boxHeight - 2,\n radius: borderRadius\n });\n ctx.fill();\n } else {\n ctx.fillStyle = options.multiKeyBackground;\n ctx.fillRect(outerX, colorY, boxWidth, boxHeight);\n ctx.strokeRect(outerX, colorY, boxWidth, boxHeight);\n ctx.fillStyle = labelColor.backgroundColor;\n ctx.fillRect(innerX, colorY + 1, boxWidth - 2, boxHeight - 2);\n }\n }\n ctx.fillStyle = this.labelTextColors[i];\n }\n drawBody(pt, ctx, options) {\n const { body } = this;\n const { bodySpacing , bodyAlign , displayColors , boxHeight , boxWidth , boxPadding } = options;\n const bodyFont = toFont(options.bodyFont);\n let bodyLineHeight = bodyFont.lineHeight;\n let xLinePadding = 0;\n const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width);\n const fillLineOfText = function(line) {\n ctx.fillText(line, rtlHelper.x(pt.x + xLinePadding), pt.y + bodyLineHeight / 2);\n pt.y += bodyLineHeight + bodySpacing;\n };\n const bodyAlignForCalculation = rtlHelper.textAlign(bodyAlign);\n let bodyItem, textColor, lines, i, j, ilen, jlen;\n ctx.textAlign = bodyAlign;\n ctx.textBaseline = 'middle';\n ctx.font = bodyFont.string;\n pt.x = getAlignedX(this, bodyAlignForCalculation, options);\n ctx.fillStyle = options.bodyColor;\n each(this.beforeBody, fillLineOfText);\n xLinePadding = displayColors && bodyAlignForCalculation !== 'right' ? bodyAlign === 'center' ? boxWidth / 2 + boxPadding : boxWidth + 2 + boxPadding : 0;\n for(i = 0, ilen = body.length; i < ilen; ++i){\n bodyItem = body[i];\n textColor = this.labelTextColors[i];\n ctx.fillStyle = textColor;\n each(bodyItem.before, fillLineOfText);\n lines = bodyItem.lines;\n if (displayColors && lines.length) {\n this._drawColorBox(ctx, pt, i, rtlHelper, options);\n bodyLineHeight = Math.max(bodyFont.lineHeight, boxHeight);\n }\n for(j = 0, jlen = lines.length; j < jlen; ++j){\n fillLineOfText(lines[j]);\n bodyLineHeight = bodyFont.lineHeight;\n }\n each(bodyItem.after, fillLineOfText);\n }\n xLinePadding = 0;\n bodyLineHeight = bodyFont.lineHeight;\n each(this.afterBody, fillLineOfText);\n pt.y -= bodySpacing;\n }\n drawFooter(pt, ctx, options) {\n const footer = this.footer;\n const length = footer.length;\n let footerFont, i;\n if (length) {\n const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width);\n pt.x = getAlignedX(this, options.footerAlign, options);\n pt.y += options.footerMarginTop;\n ctx.textAlign = rtlHelper.textAlign(options.footerAlign);\n ctx.textBaseline = 'middle';\n footerFont = toFont(options.footerFont);\n ctx.fillStyle = options.footerColor;\n ctx.font = footerFont.string;\n for(i = 0; i < length; ++i){\n ctx.fillText(footer[i], rtlHelper.x(pt.x), pt.y + footerFont.lineHeight / 2);\n pt.y += footerFont.lineHeight + options.footerSpacing;\n }\n }\n }\n drawBackground(pt, ctx, tooltipSize, options) {\n const { xAlign , yAlign } = this;\n const { x , y } = pt;\n const { width , height } = tooltipSize;\n const { topLeft , topRight , bottomLeft , bottomRight } = toTRBLCorners(options.cornerRadius);\n ctx.fillStyle = options.backgroundColor;\n ctx.strokeStyle = options.borderColor;\n ctx.lineWidth = options.borderWidth;\n ctx.beginPath();\n ctx.moveTo(x + topLeft, y);\n if (yAlign === 'top') {\n this.drawCaret(pt, ctx, tooltipSize, options);\n }\n ctx.lineTo(x + width - topRight, y);\n ctx.quadraticCurveTo(x + width, y, x + width, y + topRight);\n if (yAlign === 'center' && xAlign === 'right') {\n this.drawCaret(pt, ctx, tooltipSize, options);\n }\n ctx.lineTo(x + width, y + height - bottomRight);\n ctx.quadraticCurveTo(x + width, y + height, x + width - bottomRight, y + height);\n if (yAlign === 'bottom') {\n this.drawCaret(pt, ctx, tooltipSize, options);\n }\n ctx.lineTo(x + bottomLeft, y + height);\n ctx.quadraticCurveTo(x, y + height, x, y + height - bottomLeft);\n if (yAlign === 'center' && xAlign === 'left') {\n this.drawCaret(pt, ctx, tooltipSize, options);\n }\n ctx.lineTo(x, y + topLeft);\n ctx.quadraticCurveTo(x, y, x + topLeft, y);\n ctx.closePath();\n ctx.fill();\n if (options.borderWidth > 0) {\n ctx.stroke();\n }\n }\n _updateAnimationTarget(options) {\n const chart = this.chart;\n const anims = this.$animations;\n const animX = anims && anims.x;\n const animY = anims && anims.y;\n if (animX || animY) {\n const position = positioners[options.position].call(this, this._active, this._eventPosition);\n if (!position) {\n return;\n }\n const size = this._size = getTooltipSize(this, options);\n const positionAndSize = Object.assign({}, position, this._size);\n const alignment = determineAlignment(chart, options, positionAndSize);\n const point = getBackgroundPoint(options, positionAndSize, alignment, chart);\n if (animX._to !== point.x || animY._to !== point.y) {\n this.xAlign = alignment.xAlign;\n this.yAlign = alignment.yAlign;\n this.width = size.width;\n this.height = size.height;\n this.caretX = position.x;\n this.caretY = position.y;\n this._resolveAnimations().update(this, point);\n }\n }\n }\n _willRender() {\n return !!this.opacity;\n }\n draw(ctx) {\n const options = this.options.setContext(this.getContext());\n let opacity = this.opacity;\n if (!opacity) {\n return;\n }\n this._updateAnimationTarget(options);\n const tooltipSize = {\n width: this.width,\n height: this.height\n };\n const pt = {\n x: this.x,\n y: this.y\n };\n opacity = Math.abs(opacity) < 1e-3 ? 0 : opacity;\n const padding = toPadding(options.padding);\n const hasTooltipContent = this.title.length || this.beforeBody.length || this.body.length || this.afterBody.length || this.footer.length;\n if (options.enabled && hasTooltipContent) {\n ctx.save();\n ctx.globalAlpha = opacity;\n this.drawBackground(pt, ctx, tooltipSize, options);\n overrideTextDirection(ctx, options.textDirection);\n pt.y += padding.top;\n this.drawTitle(pt, ctx, options);\n this.drawBody(pt, ctx, options);\n this.drawFooter(pt, ctx, options);\n restoreTextDirection(ctx, options.textDirection);\n ctx.restore();\n }\n }\n getActiveElements() {\n return this._active || [];\n }\n setActiveElements(activeElements, eventPosition) {\n const lastActive = this._active;\n const active = activeElements.map(({ datasetIndex , index })=>{\n const meta = this.chart.getDatasetMeta(datasetIndex);\n if (!meta) {\n throw new Error('Cannot find a dataset at index ' + datasetIndex);\n }\n return {\n datasetIndex,\n element: meta.data[index],\n index\n };\n });\n const changed = !_elementsEqual(lastActive, active);\n const positionChanged = this._positionChanged(active, eventPosition);\n if (changed || positionChanged) {\n this._active = active;\n this._eventPosition = eventPosition;\n this._ignoreReplayEvents = true;\n this.update(true);\n }\n }\n handleEvent(e, replay, inChartArea = true) {\n if (replay && this._ignoreReplayEvents) {\n return false;\n }\n this._ignoreReplayEvents = false;\n const options = this.options;\n const lastActive = this._active || [];\n const active = this._getActiveElements(e, lastActive, replay, inChartArea);\n const positionChanged = this._positionChanged(active, e);\n const changed = replay || !_elementsEqual(active, lastActive) || positionChanged;\n if (changed) {\n this._active = active;\n if (options.enabled || options.external) {\n this._eventPosition = {\n x: e.x,\n y: e.y\n };\n this.update(true, replay);\n }\n }\n return changed;\n }\n _getActiveElements(e, lastActive, replay, inChartArea) {\n const options = this.options;\n if (e.type === 'mouseout') {\n return [];\n }\n if (!inChartArea) {\n return lastActive;\n }\n const active = this.chart.getElementsAtEventForMode(e, options.mode, options, replay);\n if (options.reverse) {\n active.reverse();\n }\n return active;\n }\n _positionChanged(active, e) {\n const { caretX , caretY , options } = this;\n const position = positioners[options.position].call(this, active, e);\n return position !== false && (caretX !== position.x || caretY !== position.y);\n }\n}\nvar plugin_tooltip = {\n id: 'tooltip',\n _element: Tooltip,\n positioners,\n afterInit (chart, _args, options) {\n if (options) {\n chart.tooltip = new Tooltip({\n chart,\n options\n });\n }\n },\n beforeUpdate (chart, _args, options) {\n if (chart.tooltip) {\n chart.tooltip.initialize(options);\n }\n },\n reset (chart, _args, options) {\n if (chart.tooltip) {\n chart.tooltip.initialize(options);\n }\n },\n afterDraw (chart) {\n const tooltip = chart.tooltip;\n if (tooltip && tooltip._willRender()) {\n const args = {\n tooltip\n };\n if (chart.notifyPlugins('beforeTooltipDraw', {\n ...args,\n cancelable: true\n }) === false) {\n return;\n }\n tooltip.draw(chart.ctx);\n chart.notifyPlugins('afterTooltipDraw', args);\n }\n },\n afterEvent (chart, args) {\n if (chart.tooltip) {\n const useFinalPosition = args.replay;\n if (chart.tooltip.handleEvent(args.event, useFinalPosition, args.inChartArea)) {\n args.changed = true;\n }\n }\n },\n defaults: {\n enabled: true,\n external: null,\n position: 'average',\n backgroundColor: 'rgba(0,0,0,0.8)',\n titleColor: '#fff',\n titleFont: {\n weight: 'bold'\n },\n titleSpacing: 2,\n titleMarginBottom: 6,\n titleAlign: 'left',\n bodyColor: '#fff',\n bodySpacing: 2,\n bodyFont: {},\n bodyAlign: 'left',\n footerColor: '#fff',\n footerSpacing: 2,\n footerMarginTop: 6,\n footerFont: {\n weight: 'bold'\n },\n footerAlign: 'left',\n padding: 6,\n caretPadding: 2,\n caretSize: 5,\n cornerRadius: 6,\n boxHeight: (ctx, opts)=>opts.bodyFont.size,\n boxWidth: (ctx, opts)=>opts.bodyFont.size,\n multiKeyBackground: '#fff',\n displayColors: true,\n boxPadding: 0,\n borderColor: 'rgba(0,0,0,0)',\n borderWidth: 0,\n animation: {\n duration: 400,\n easing: 'easeOutQuart'\n },\n animations: {\n numbers: {\n type: 'number',\n properties: [\n 'x',\n 'y',\n 'width',\n 'height',\n 'caretX',\n 'caretY'\n ]\n },\n opacity: {\n easing: 'linear',\n duration: 200\n }\n },\n callbacks: defaultCallbacks\n },\n defaultRoutes: {\n bodyFont: 'font',\n footerFont: 'font',\n titleFont: 'font'\n },\n descriptors: {\n _scriptable: (name)=>name !== 'filter' && name !== 'itemSort' && name !== 'external',\n _indexable: false,\n callbacks: {\n _scriptable: false,\n _indexable: false\n },\n animation: {\n _fallback: false\n },\n animations: {\n _fallback: 'animation'\n }\n },\n additionalOptionScopes: [\n 'interaction'\n ]\n};\n\nvar plugins = /*#__PURE__*/Object.freeze({\n__proto__: null,\nColors: plugin_colors,\nDecimation: plugin_decimation,\nFiller: index,\nLegend: plugin_legend,\nSubTitle: plugin_subtitle,\nTitle: plugin_title,\nTooltip: plugin_tooltip\n});\n\nconst addIfString = (labels, raw, index, addedLabels)=>{\n if (typeof raw === 'string') {\n index = labels.push(raw) - 1;\n addedLabels.unshift({\n index,\n label: raw\n });\n } else if (isNaN(raw)) {\n index = null;\n }\n return index;\n};\nfunction findOrAddLabel(labels, raw, index, addedLabels) {\n const first = labels.indexOf(raw);\n if (first === -1) {\n return addIfString(labels, raw, index, addedLabels);\n }\n const last = labels.lastIndexOf(raw);\n return first !== last ? index : first;\n}\nconst validIndex = (index, max)=>index === null ? null : _limitValue(Math.round(index), 0, max);\nfunction _getLabelForValue(value) {\n const labels = this.getLabels();\n if (value >= 0 && value < labels.length) {\n return labels[value];\n }\n return value;\n}\nclass CategoryScale extends Scale {\n static id = 'category';\n static defaults = {\n ticks: {\n callback: _getLabelForValue\n }\n };\n constructor(cfg){\n super(cfg);\n this._startValue = undefined;\n this._valueRange = 0;\n this._addedLabels = [];\n }\n init(scaleOptions) {\n const added = this._addedLabels;\n if (added.length) {\n const labels = this.getLabels();\n for (const { index , label } of added){\n if (labels[index] === label) {\n labels.splice(index, 1);\n }\n }\n this._addedLabels = [];\n }\n super.init(scaleOptions);\n }\n parse(raw, index) {\n if (isNullOrUndef(raw)) {\n return null;\n }\n const labels = this.getLabels();\n index = isFinite(index) && labels[index] === raw ? index : findOrAddLabel(labels, raw, valueOrDefault(index, raw), this._addedLabels);\n return validIndex(index, labels.length - 1);\n }\n determineDataLimits() {\n const { minDefined , maxDefined } = this.getUserBounds();\n let { min , max } = this.getMinMax(true);\n if (this.options.bounds === 'ticks') {\n if (!minDefined) {\n min = 0;\n }\n if (!maxDefined) {\n max = this.getLabels().length - 1;\n }\n }\n this.min = min;\n this.max = max;\n }\n buildTicks() {\n const min = this.min;\n const max = this.max;\n const offset = this.options.offset;\n const ticks = [];\n let labels = this.getLabels();\n labels = min === 0 && max === labels.length - 1 ? labels : labels.slice(min, max + 1);\n this._valueRange = Math.max(labels.length - (offset ? 0 : 1), 1);\n this._startValue = this.min - (offset ? 0.5 : 0);\n for(let value = min; value <= max; value++){\n ticks.push({\n value\n });\n }\n return ticks;\n }\n getLabelForValue(value) {\n return _getLabelForValue.call(this, value);\n }\n configure() {\n super.configure();\n if (!this.isHorizontal()) {\n this._reversePixels = !this._reversePixels;\n }\n }\n getPixelForValue(value) {\n if (typeof value !== 'number') {\n value = this.parse(value);\n }\n return value === null ? NaN : this.getPixelForDecimal((value - this._startValue) / this._valueRange);\n }\n getPixelForTick(index) {\n const ticks = this.ticks;\n if (index < 0 || index > ticks.length - 1) {\n return null;\n }\n return this.getPixelForValue(ticks[index].value);\n }\n getValueForPixel(pixel) {\n return Math.round(this._startValue + this.getDecimalForPixel(pixel) * this._valueRange);\n }\n getBasePixel() {\n return this.bottom;\n }\n}\n\nfunction generateTicks$1(generationOptions, dataRange) {\n const ticks = [];\n const MIN_SPACING = 1e-14;\n const { bounds , step , min , max , precision , count , maxTicks , maxDigits , includeBounds } = generationOptions;\n const unit = step || 1;\n const maxSpaces = maxTicks - 1;\n const { min: rmin , max: rmax } = dataRange;\n const minDefined = !isNullOrUndef(min);\n const maxDefined = !isNullOrUndef(max);\n const countDefined = !isNullOrUndef(count);\n const minSpacing = (rmax - rmin) / (maxDigits + 1);\n let spacing = niceNum((rmax - rmin) / maxSpaces / unit) * unit;\n let factor, niceMin, niceMax, numSpaces;\n if (spacing < MIN_SPACING && !minDefined && !maxDefined) {\n return [\n {\n value: rmin\n },\n {\n value: rmax\n }\n ];\n }\n numSpaces = Math.ceil(rmax / spacing) - Math.floor(rmin / spacing);\n if (numSpaces > maxSpaces) {\n spacing = niceNum(numSpaces * spacing / maxSpaces / unit) * unit;\n }\n if (!isNullOrUndef(precision)) {\n factor = Math.pow(10, precision);\n spacing = Math.ceil(spacing * factor) / factor;\n }\n if (bounds === 'ticks') {\n niceMin = Math.floor(rmin / spacing) * spacing;\n niceMax = Math.ceil(rmax / spacing) * spacing;\n } else {\n niceMin = rmin;\n niceMax = rmax;\n }\n if (minDefined && maxDefined && step && almostWhole((max - min) / step, spacing / 1000)) {\n numSpaces = Math.round(Math.min((max - min) / spacing, maxTicks));\n spacing = (max - min) / numSpaces;\n niceMin = min;\n niceMax = max;\n } else if (countDefined) {\n niceMin = minDefined ? min : niceMin;\n niceMax = maxDefined ? max : niceMax;\n numSpaces = count - 1;\n spacing = (niceMax - niceMin) / numSpaces;\n } else {\n numSpaces = (niceMax - niceMin) / spacing;\n if (almostEquals(numSpaces, Math.round(numSpaces), spacing / 1000)) {\n numSpaces = Math.round(numSpaces);\n } else {\n numSpaces = Math.ceil(numSpaces);\n }\n }\n const decimalPlaces = Math.max(_decimalPlaces(spacing), _decimalPlaces(niceMin));\n factor = Math.pow(10, isNullOrUndef(precision) ? decimalPlaces : precision);\n niceMin = Math.round(niceMin * factor) / factor;\n niceMax = Math.round(niceMax * factor) / factor;\n let j = 0;\n if (minDefined) {\n if (includeBounds && niceMin !== min) {\n ticks.push({\n value: min\n });\n if (niceMin < min) {\n j++;\n }\n if (almostEquals(Math.round((niceMin + j * spacing) * factor) / factor, min, relativeLabelSize(min, minSpacing, generationOptions))) {\n j++;\n }\n } else if (niceMin < min) {\n j++;\n }\n }\n for(; j < numSpaces; ++j){\n const tickValue = Math.round((niceMin + j * spacing) * factor) / factor;\n if (maxDefined && tickValue > max) {\n break;\n }\n ticks.push({\n value: tickValue\n });\n }\n if (maxDefined && includeBounds && niceMax !== max) {\n if (ticks.length && almostEquals(ticks[ticks.length - 1].value, max, relativeLabelSize(max, minSpacing, generationOptions))) {\n ticks[ticks.length - 1].value = max;\n } else {\n ticks.push({\n value: max\n });\n }\n } else if (!maxDefined || niceMax === max) {\n ticks.push({\n value: niceMax\n });\n }\n return ticks;\n}\nfunction relativeLabelSize(value, minSpacing, { horizontal , minRotation }) {\n const rad = toRadians(minRotation);\n const ratio = (horizontal ? Math.sin(rad) : Math.cos(rad)) || 0.001;\n const length = 0.75 * minSpacing * ('' + value).length;\n return Math.min(minSpacing / ratio, length);\n}\nclass LinearScaleBase extends Scale {\n constructor(cfg){\n super(cfg);\n this.start = undefined;\n this.end = undefined;\n this._startValue = undefined;\n this._endValue = undefined;\n this._valueRange = 0;\n }\n parse(raw, index) {\n if (isNullOrUndef(raw)) {\n return null;\n }\n if ((typeof raw === 'number' || raw instanceof Number) && !isFinite(+raw)) {\n return null;\n }\n return +raw;\n }\n handleTickRangeOptions() {\n const { beginAtZero } = this.options;\n const { minDefined , maxDefined } = this.getUserBounds();\n let { min , max } = this;\n const setMin = (v)=>min = minDefined ? min : v;\n const setMax = (v)=>max = maxDefined ? max : v;\n if (beginAtZero) {\n const minSign = sign(min);\n const maxSign = sign(max);\n if (minSign < 0 && maxSign < 0) {\n setMax(0);\n } else if (minSign > 0 && maxSign > 0) {\n setMin(0);\n }\n }\n if (min === max) {\n let offset = max === 0 ? 1 : Math.abs(max * 0.05);\n setMax(max + offset);\n if (!beginAtZero) {\n setMin(min - offset);\n }\n }\n this.min = min;\n this.max = max;\n }\n getTickLimit() {\n const tickOpts = this.options.ticks;\n let { maxTicksLimit , stepSize } = tickOpts;\n let maxTicks;\n if (stepSize) {\n maxTicks = Math.ceil(this.max / stepSize) - Math.floor(this.min / stepSize) + 1;\n if (maxTicks > 1000) {\n console.warn(`scales.${this.id}.ticks.stepSize: ${stepSize} would result generating up to ${maxTicks} ticks. Limiting to 1000.`);\n maxTicks = 1000;\n }\n } else {\n maxTicks = this.computeTickLimit();\n maxTicksLimit = maxTicksLimit || 11;\n }\n if (maxTicksLimit) {\n maxTicks = Math.min(maxTicksLimit, maxTicks);\n }\n return maxTicks;\n }\n computeTickLimit() {\n return Number.POSITIVE_INFINITY;\n }\n buildTicks() {\n const opts = this.options;\n const tickOpts = opts.ticks;\n let maxTicks = this.getTickLimit();\n maxTicks = Math.max(2, maxTicks);\n const numericGeneratorOptions = {\n maxTicks,\n bounds: opts.bounds,\n min: opts.min,\n max: opts.max,\n precision: tickOpts.precision,\n step: tickOpts.stepSize,\n count: tickOpts.count,\n maxDigits: this._maxDigits(),\n horizontal: this.isHorizontal(),\n minRotation: tickOpts.minRotation || 0,\n includeBounds: tickOpts.includeBounds !== false\n };\n const dataRange = this._range || this;\n const ticks = generateTicks$1(numericGeneratorOptions, dataRange);\n if (opts.bounds === 'ticks') {\n _setMinAndMaxByKey(ticks, this, 'value');\n }\n if (opts.reverse) {\n ticks.reverse();\n this.start = this.max;\n this.end = this.min;\n } else {\n this.start = this.min;\n this.end = this.max;\n }\n return ticks;\n }\n configure() {\n const ticks = this.ticks;\n let start = this.min;\n let end = this.max;\n super.configure();\n if (this.options.offset && ticks.length) {\n const offset = (end - start) / Math.max(ticks.length - 1, 1) / 2;\n start -= offset;\n end += offset;\n }\n this._startValue = start;\n this._endValue = end;\n this._valueRange = end - start;\n }\n getLabelForValue(value) {\n return formatNumber(value, this.chart.options.locale, this.options.ticks.format);\n }\n}\n\nclass LinearScale extends LinearScaleBase {\n static id = 'linear';\n static defaults = {\n ticks: {\n callback: Ticks.formatters.numeric\n }\n };\n determineDataLimits() {\n const { min , max } = this.getMinMax(true);\n this.min = isNumberFinite(min) ? min : 0;\n this.max = isNumberFinite(max) ? max : 1;\n this.handleTickRangeOptions();\n }\n computeTickLimit() {\n const horizontal = this.isHorizontal();\n const length = horizontal ? this.width : this.height;\n const minRotation = toRadians(this.options.ticks.minRotation);\n const ratio = (horizontal ? Math.sin(minRotation) : Math.cos(minRotation)) || 0.001;\n const tickFont = this._resolveTickFontOptions(0);\n return Math.ceil(length / Math.min(40, tickFont.lineHeight / ratio));\n }\n getPixelForValue(value) {\n return value === null ? NaN : this.getPixelForDecimal((value - this._startValue) / this._valueRange);\n }\n getValueForPixel(pixel) {\n return this._startValue + this.getDecimalForPixel(pixel) * this._valueRange;\n }\n}\n\nconst log10Floor = (v)=>Math.floor(log10(v));\nconst changeExponent = (v, m)=>Math.pow(10, log10Floor(v) + m);\nfunction isMajor(tickVal) {\n const remain = tickVal / Math.pow(10, log10Floor(tickVal));\n return remain === 1;\n}\nfunction steps(min, max, rangeExp) {\n const rangeStep = Math.pow(10, rangeExp);\n const start = Math.floor(min / rangeStep);\n const end = Math.ceil(max / rangeStep);\n return end - start;\n}\nfunction startExp(min, max) {\n const range = max - min;\n let rangeExp = log10Floor(range);\n while(steps(min, max, rangeExp) > 10){\n rangeExp++;\n }\n while(steps(min, max, rangeExp) < 10){\n rangeExp--;\n }\n return Math.min(rangeExp, log10Floor(min));\n}\n function generateTicks(generationOptions, { min , max }) {\n min = finiteOrDefault(generationOptions.min, min);\n const ticks = [];\n const minExp = log10Floor(min);\n let exp = startExp(min, max);\n let precision = exp < 0 ? Math.pow(10, Math.abs(exp)) : 1;\n const stepSize = Math.pow(10, exp);\n const base = minExp > exp ? Math.pow(10, minExp) : 0;\n const start = Math.round((min - base) * precision) / precision;\n const offset = Math.floor((min - base) / stepSize / 10) * stepSize * 10;\n let significand = Math.floor((start - offset) / Math.pow(10, exp));\n let value = finiteOrDefault(generationOptions.min, Math.round((base + offset + significand * Math.pow(10, exp)) * precision) / precision);\n while(value < max){\n ticks.push({\n value,\n major: isMajor(value),\n significand\n });\n if (significand >= 10) {\n significand = significand < 15 ? 15 : 20;\n } else {\n significand++;\n }\n if (significand >= 20) {\n exp++;\n significand = 2;\n precision = exp >= 0 ? 1 : precision;\n }\n value = Math.round((base + offset + significand * Math.pow(10, exp)) * precision) / precision;\n }\n const lastTick = finiteOrDefault(generationOptions.max, value);\n ticks.push({\n value: lastTick,\n major: isMajor(lastTick),\n significand\n });\n return ticks;\n}\nclass LogarithmicScale extends Scale {\n static id = 'logarithmic';\n static defaults = {\n ticks: {\n callback: Ticks.formatters.logarithmic,\n major: {\n enabled: true\n }\n }\n };\n constructor(cfg){\n super(cfg);\n this.start = undefined;\n this.end = undefined;\n this._startValue = undefined;\n this._valueRange = 0;\n }\n parse(raw, index) {\n const value = LinearScaleBase.prototype.parse.apply(this, [\n raw,\n index\n ]);\n if (value === 0) {\n this._zero = true;\n return undefined;\n }\n return isNumberFinite(value) && value > 0 ? value : null;\n }\n determineDataLimits() {\n const { min , max } = this.getMinMax(true);\n this.min = isNumberFinite(min) ? Math.max(0, min) : null;\n this.max = isNumberFinite(max) ? Math.max(0, max) : null;\n if (this.options.beginAtZero) {\n this._zero = true;\n }\n if (this._zero && this.min !== this._suggestedMin && !isNumberFinite(this._userMin)) {\n this.min = min === changeExponent(this.min, 0) ? changeExponent(this.min, -1) : changeExponent(this.min, 0);\n }\n this.handleTickRangeOptions();\n }\n handleTickRangeOptions() {\n const { minDefined , maxDefined } = this.getUserBounds();\n let min = this.min;\n let max = this.max;\n const setMin = (v)=>min = minDefined ? min : v;\n const setMax = (v)=>max = maxDefined ? max : v;\n if (min === max) {\n if (min <= 0) {\n setMin(1);\n setMax(10);\n } else {\n setMin(changeExponent(min, -1));\n setMax(changeExponent(max, +1));\n }\n }\n if (min <= 0) {\n setMin(changeExponent(max, -1));\n }\n if (max <= 0) {\n setMax(changeExponent(min, +1));\n }\n this.min = min;\n this.max = max;\n }\n buildTicks() {\n const opts = this.options;\n const generationOptions = {\n min: this._userMin,\n max: this._userMax\n };\n const ticks = generateTicks(generationOptions, this);\n if (opts.bounds === 'ticks') {\n _setMinAndMaxByKey(ticks, this, 'value');\n }\n if (opts.reverse) {\n ticks.reverse();\n this.start = this.max;\n this.end = this.min;\n } else {\n this.start = this.min;\n this.end = this.max;\n }\n return ticks;\n }\n getLabelForValue(value) {\n return value === undefined ? '0' : formatNumber(value, this.chart.options.locale, this.options.ticks.format);\n }\n configure() {\n const start = this.min;\n super.configure();\n this._startValue = log10(start);\n this._valueRange = log10(this.max) - log10(start);\n }\n getPixelForValue(value) {\n if (value === undefined || value === 0) {\n value = this.min;\n }\n if (value === null || isNaN(value)) {\n return NaN;\n }\n return this.getPixelForDecimal(value === this.min ? 0 : (log10(value) - this._startValue) / this._valueRange);\n }\n getValueForPixel(pixel) {\n const decimal = this.getDecimalForPixel(pixel);\n return Math.pow(10, this._startValue + decimal * this._valueRange);\n }\n}\n\nfunction getTickBackdropHeight(opts) {\n const tickOpts = opts.ticks;\n if (tickOpts.display && opts.display) {\n const padding = toPadding(tickOpts.backdropPadding);\n return valueOrDefault(tickOpts.font && tickOpts.font.size, defaults.font.size) + padding.height;\n }\n return 0;\n}\nfunction measureLabelSize(ctx, font, label) {\n label = isArray(label) ? label : [\n label\n ];\n return {\n w: _longestText(ctx, font.string, label),\n h: label.length * font.lineHeight\n };\n}\nfunction determineLimits(angle, pos, size, min, max) {\n if (angle === min || angle === max) {\n return {\n start: pos - size / 2,\n end: pos + size / 2\n };\n } else if (angle < min || angle > max) {\n return {\n start: pos - size,\n end: pos\n };\n }\n return {\n start: pos,\n end: pos + size\n };\n}\n function fitWithPointLabels(scale) {\n const orig = {\n l: scale.left + scale._padding.left,\n r: scale.right - scale._padding.right,\n t: scale.top + scale._padding.top,\n b: scale.bottom - scale._padding.bottom\n };\n const limits = Object.assign({}, orig);\n const labelSizes = [];\n const padding = [];\n const valueCount = scale._pointLabels.length;\n const pointLabelOpts = scale.options.pointLabels;\n const additionalAngle = pointLabelOpts.centerPointLabels ? PI / valueCount : 0;\n for(let i = 0; i < valueCount; i++){\n const opts = pointLabelOpts.setContext(scale.getPointLabelContext(i));\n padding[i] = opts.padding;\n const pointPosition = scale.getPointPosition(i, scale.drawingArea + padding[i], additionalAngle);\n const plFont = toFont(opts.font);\n const textSize = measureLabelSize(scale.ctx, plFont, scale._pointLabels[i]);\n labelSizes[i] = textSize;\n const angleRadians = _normalizeAngle(scale.getIndexAngle(i) + additionalAngle);\n const angle = Math.round(toDegrees(angleRadians));\n const hLimits = determineLimits(angle, pointPosition.x, textSize.w, 0, 180);\n const vLimits = determineLimits(angle, pointPosition.y, textSize.h, 90, 270);\n updateLimits(limits, orig, angleRadians, hLimits, vLimits);\n }\n scale.setCenterPoint(orig.l - limits.l, limits.r - orig.r, orig.t - limits.t, limits.b - orig.b);\n scale._pointLabelItems = buildPointLabelItems(scale, labelSizes, padding);\n}\nfunction updateLimits(limits, orig, angle, hLimits, vLimits) {\n const sin = Math.abs(Math.sin(angle));\n const cos = Math.abs(Math.cos(angle));\n let x = 0;\n let y = 0;\n if (hLimits.start < orig.l) {\n x = (orig.l - hLimits.start) / sin;\n limits.l = Math.min(limits.l, orig.l - x);\n } else if (hLimits.end > orig.r) {\n x = (hLimits.end - orig.r) / sin;\n limits.r = Math.max(limits.r, orig.r + x);\n }\n if (vLimits.start < orig.t) {\n y = (orig.t - vLimits.start) / cos;\n limits.t = Math.min(limits.t, orig.t - y);\n } else if (vLimits.end > orig.b) {\n y = (vLimits.end - orig.b) / cos;\n limits.b = Math.max(limits.b, orig.b + y);\n }\n}\nfunction createPointLabelItem(scale, index, itemOpts) {\n const outerDistance = scale.drawingArea;\n const { extra , additionalAngle , padding , size } = itemOpts;\n const pointLabelPosition = scale.getPointPosition(index, outerDistance + extra + padding, additionalAngle);\n const angle = Math.round(toDegrees(_normalizeAngle(pointLabelPosition.angle + HALF_PI)));\n const y = yForAngle(pointLabelPosition.y, size.h, angle);\n const textAlign = getTextAlignForAngle(angle);\n const left = leftForTextAlign(pointLabelPosition.x, size.w, textAlign);\n return {\n visible: true,\n x: pointLabelPosition.x,\n y,\n textAlign,\n left,\n top: y,\n right: left + size.w,\n bottom: y + size.h\n };\n}\nfunction isNotOverlapped(item, area) {\n if (!area) {\n return true;\n }\n const { left , top , right , bottom } = item;\n const apexesInArea = _isPointInArea({\n x: left,\n y: top\n }, area) || _isPointInArea({\n x: left,\n y: bottom\n }, area) || _isPointInArea({\n x: right,\n y: top\n }, area) || _isPointInArea({\n x: right,\n y: bottom\n }, area);\n return !apexesInArea;\n}\nfunction buildPointLabelItems(scale, labelSizes, padding) {\n const items = [];\n const valueCount = scale._pointLabels.length;\n const opts = scale.options;\n const { centerPointLabels , display } = opts.pointLabels;\n const itemOpts = {\n extra: getTickBackdropHeight(opts) / 2,\n additionalAngle: centerPointLabels ? PI / valueCount : 0\n };\n let area;\n for(let i = 0; i < valueCount; i++){\n itemOpts.padding = padding[i];\n itemOpts.size = labelSizes[i];\n const item = createPointLabelItem(scale, i, itemOpts);\n items.push(item);\n if (display === 'auto') {\n item.visible = isNotOverlapped(item, area);\n if (item.visible) {\n area = item;\n }\n }\n }\n return items;\n}\nfunction getTextAlignForAngle(angle) {\n if (angle === 0 || angle === 180) {\n return 'center';\n } else if (angle < 180) {\n return 'left';\n }\n return 'right';\n}\nfunction leftForTextAlign(x, w, align) {\n if (align === 'right') {\n x -= w;\n } else if (align === 'center') {\n x -= w / 2;\n }\n return x;\n}\nfunction yForAngle(y, h, angle) {\n if (angle === 90 || angle === 270) {\n y -= h / 2;\n } else if (angle > 270 || angle < 90) {\n y -= h;\n }\n return y;\n}\nfunction drawPointLabelBox(ctx, opts, item) {\n const { left , top , right , bottom } = item;\n const { backdropColor } = opts;\n if (!isNullOrUndef(backdropColor)) {\n const borderRadius = toTRBLCorners(opts.borderRadius);\n const padding = toPadding(opts.backdropPadding);\n ctx.fillStyle = backdropColor;\n const backdropLeft = left - padding.left;\n const backdropTop = top - padding.top;\n const backdropWidth = right - left + padding.width;\n const backdropHeight = bottom - top + padding.height;\n if (Object.values(borderRadius).some((v)=>v !== 0)) {\n ctx.beginPath();\n addRoundedRectPath(ctx, {\n x: backdropLeft,\n y: backdropTop,\n w: backdropWidth,\n h: backdropHeight,\n radius: borderRadius\n });\n ctx.fill();\n } else {\n ctx.fillRect(backdropLeft, backdropTop, backdropWidth, backdropHeight);\n }\n }\n}\nfunction drawPointLabels(scale, labelCount) {\n const { ctx , options: { pointLabels } } = scale;\n for(let i = labelCount - 1; i >= 0; i--){\n const item = scale._pointLabelItems[i];\n if (!item.visible) {\n continue;\n }\n const optsAtIndex = pointLabels.setContext(scale.getPointLabelContext(i));\n drawPointLabelBox(ctx, optsAtIndex, item);\n const plFont = toFont(optsAtIndex.font);\n const { x , y , textAlign } = item;\n renderText(ctx, scale._pointLabels[i], x, y + plFont.lineHeight / 2, plFont, {\n color: optsAtIndex.color,\n textAlign: textAlign,\n textBaseline: 'middle'\n });\n }\n}\nfunction pathRadiusLine(scale, radius, circular, labelCount) {\n const { ctx } = scale;\n if (circular) {\n ctx.arc(scale.xCenter, scale.yCenter, radius, 0, TAU);\n } else {\n let pointPosition = scale.getPointPosition(0, radius);\n ctx.moveTo(pointPosition.x, pointPosition.y);\n for(let i = 1; i < labelCount; i++){\n pointPosition = scale.getPointPosition(i, radius);\n ctx.lineTo(pointPosition.x, pointPosition.y);\n }\n }\n}\nfunction drawRadiusLine(scale, gridLineOpts, radius, labelCount, borderOpts) {\n const ctx = scale.ctx;\n const circular = gridLineOpts.circular;\n const { color , lineWidth } = gridLineOpts;\n if (!circular && !labelCount || !color || !lineWidth || radius < 0) {\n return;\n }\n ctx.save();\n ctx.strokeStyle = color;\n ctx.lineWidth = lineWidth;\n ctx.setLineDash(borderOpts.dash);\n ctx.lineDashOffset = borderOpts.dashOffset;\n ctx.beginPath();\n pathRadiusLine(scale, radius, circular, labelCount);\n ctx.closePath();\n ctx.stroke();\n ctx.restore();\n}\nfunction createPointLabelContext(parent, index, label) {\n return createContext(parent, {\n label,\n index,\n type: 'pointLabel'\n });\n}\nclass RadialLinearScale extends LinearScaleBase {\n static id = 'radialLinear';\n static defaults = {\n display: true,\n animate: true,\n position: 'chartArea',\n angleLines: {\n display: true,\n lineWidth: 1,\n borderDash: [],\n borderDashOffset: 0.0\n },\n grid: {\n circular: false\n },\n startAngle: 0,\n ticks: {\n showLabelBackdrop: true,\n callback: Ticks.formatters.numeric\n },\n pointLabels: {\n backdropColor: undefined,\n backdropPadding: 2,\n display: true,\n font: {\n size: 10\n },\n callback (label) {\n return label;\n },\n padding: 5,\n centerPointLabels: false\n }\n };\n static defaultRoutes = {\n 'angleLines.color': 'borderColor',\n 'pointLabels.color': 'color',\n 'ticks.color': 'color'\n };\n static descriptors = {\n angleLines: {\n _fallback: 'grid'\n }\n };\n constructor(cfg){\n super(cfg);\n this.xCenter = undefined;\n this.yCenter = undefined;\n this.drawingArea = undefined;\n this._pointLabels = [];\n this._pointLabelItems = [];\n }\n setDimensions() {\n const padding = this._padding = toPadding(getTickBackdropHeight(this.options) / 2);\n const w = this.width = this.maxWidth - padding.width;\n const h = this.height = this.maxHeight - padding.height;\n this.xCenter = Math.floor(this.left + w / 2 + padding.left);\n this.yCenter = Math.floor(this.top + h / 2 + padding.top);\n this.drawingArea = Math.floor(Math.min(w, h) / 2);\n }\n determineDataLimits() {\n const { min , max } = this.getMinMax(false);\n this.min = isNumberFinite(min) && !isNaN(min) ? min : 0;\n this.max = isNumberFinite(max) && !isNaN(max) ? max : 0;\n this.handleTickRangeOptions();\n }\n computeTickLimit() {\n return Math.ceil(this.drawingArea / getTickBackdropHeight(this.options));\n }\n generateTickLabels(ticks) {\n LinearScaleBase.prototype.generateTickLabels.call(this, ticks);\n this._pointLabels = this.getLabels().map((value, index)=>{\n const label = callback(this.options.pointLabels.callback, [\n value,\n index\n ], this);\n return label || label === 0 ? label : '';\n }).filter((v, i)=>this.chart.getDataVisibility(i));\n }\n fit() {\n const opts = this.options;\n if (opts.display && opts.pointLabels.display) {\n fitWithPointLabels(this);\n } else {\n this.setCenterPoint(0, 0, 0, 0);\n }\n }\n setCenterPoint(leftMovement, rightMovement, topMovement, bottomMovement) {\n this.xCenter += Math.floor((leftMovement - rightMovement) / 2);\n this.yCenter += Math.floor((topMovement - bottomMovement) / 2);\n this.drawingArea -= Math.min(this.drawingArea / 2, Math.max(leftMovement, rightMovement, topMovement, bottomMovement));\n }\n getIndexAngle(index) {\n const angleMultiplier = TAU / (this._pointLabels.length || 1);\n const startAngle = this.options.startAngle || 0;\n return _normalizeAngle(index * angleMultiplier + toRadians(startAngle));\n }\n getDistanceFromCenterForValue(value) {\n if (isNullOrUndef(value)) {\n return NaN;\n }\n const scalingFactor = this.drawingArea / (this.max - this.min);\n if (this.options.reverse) {\n return (this.max - value) * scalingFactor;\n }\n return (value - this.min) * scalingFactor;\n }\n getValueForDistanceFromCenter(distance) {\n if (isNullOrUndef(distance)) {\n return NaN;\n }\n const scaledDistance = distance / (this.drawingArea / (this.max - this.min));\n return this.options.reverse ? this.max - scaledDistance : this.min + scaledDistance;\n }\n getPointLabelContext(index) {\n const pointLabels = this._pointLabels || [];\n if (index >= 0 && index < pointLabels.length) {\n const pointLabel = pointLabels[index];\n return createPointLabelContext(this.getContext(), index, pointLabel);\n }\n }\n getPointPosition(index, distanceFromCenter, additionalAngle = 0) {\n const angle = this.getIndexAngle(index) - HALF_PI + additionalAngle;\n return {\n x: Math.cos(angle) * distanceFromCenter + this.xCenter,\n y: Math.sin(angle) * distanceFromCenter + this.yCenter,\n angle\n };\n }\n getPointPositionForValue(index, value) {\n return this.getPointPosition(index, this.getDistanceFromCenterForValue(value));\n }\n getBasePosition(index) {\n return this.getPointPositionForValue(index || 0, this.getBaseValue());\n }\n getPointLabelPosition(index) {\n const { left , top , right , bottom } = this._pointLabelItems[index];\n return {\n left,\n top,\n right,\n bottom\n };\n }\n drawBackground() {\n const { backgroundColor , grid: { circular } } = this.options;\n if (backgroundColor) {\n const ctx = this.ctx;\n ctx.save();\n ctx.beginPath();\n pathRadiusLine(this, this.getDistanceFromCenterForValue(this._endValue), circular, this._pointLabels.length);\n ctx.closePath();\n ctx.fillStyle = backgroundColor;\n ctx.fill();\n ctx.restore();\n }\n }\n drawGrid() {\n const ctx = this.ctx;\n const opts = this.options;\n const { angleLines , grid , border } = opts;\n const labelCount = this._pointLabels.length;\n let i, offset, position;\n if (opts.pointLabels.display) {\n drawPointLabels(this, labelCount);\n }\n if (grid.display) {\n this.ticks.forEach((tick, index)=>{\n if (index !== 0) {\n offset = this.getDistanceFromCenterForValue(tick.value);\n const context = this.getContext(index);\n const optsAtIndex = grid.setContext(context);\n const optsAtIndexBorder = border.setContext(context);\n drawRadiusLine(this, optsAtIndex, offset, labelCount, optsAtIndexBorder);\n }\n });\n }\n if (angleLines.display) {\n ctx.save();\n for(i = labelCount - 1; i >= 0; i--){\n const optsAtIndex = angleLines.setContext(this.getPointLabelContext(i));\n const { color , lineWidth } = optsAtIndex;\n if (!lineWidth || !color) {\n continue;\n }\n ctx.lineWidth = lineWidth;\n ctx.strokeStyle = color;\n ctx.setLineDash(optsAtIndex.borderDash);\n ctx.lineDashOffset = optsAtIndex.borderDashOffset;\n offset = this.getDistanceFromCenterForValue(opts.ticks.reverse ? this.min : this.max);\n position = this.getPointPosition(i, offset);\n ctx.beginPath();\n ctx.moveTo(this.xCenter, this.yCenter);\n ctx.lineTo(position.x, position.y);\n ctx.stroke();\n }\n ctx.restore();\n }\n }\n drawBorder() {}\n drawLabels() {\n const ctx = this.ctx;\n const opts = this.options;\n const tickOpts = opts.ticks;\n if (!tickOpts.display) {\n return;\n }\n const startAngle = this.getIndexAngle(0);\n let offset, width;\n ctx.save();\n ctx.translate(this.xCenter, this.yCenter);\n ctx.rotate(startAngle);\n ctx.textAlign = 'center';\n ctx.textBaseline = 'middle';\n this.ticks.forEach((tick, index)=>{\n if (index === 0 && !opts.reverse) {\n return;\n }\n const optsAtIndex = tickOpts.setContext(this.getContext(index));\n const tickFont = toFont(optsAtIndex.font);\n offset = this.getDistanceFromCenterForValue(this.ticks[index].value);\n if (optsAtIndex.showLabelBackdrop) {\n ctx.font = tickFont.string;\n width = ctx.measureText(tick.label).width;\n ctx.fillStyle = optsAtIndex.backdropColor;\n const padding = toPadding(optsAtIndex.backdropPadding);\n ctx.fillRect(-width / 2 - padding.left, -offset - tickFont.size / 2 - padding.top, width + padding.width, tickFont.size + padding.height);\n }\n renderText(ctx, tick.label, 0, -offset, tickFont, {\n color: optsAtIndex.color,\n strokeColor: optsAtIndex.textStrokeColor,\n strokeWidth: optsAtIndex.textStrokeWidth\n });\n });\n ctx.restore();\n }\n drawTitle() {}\n}\n\nconst INTERVALS = {\n millisecond: {\n common: true,\n size: 1,\n steps: 1000\n },\n second: {\n common: true,\n size: 1000,\n steps: 60\n },\n minute: {\n common: true,\n size: 60000,\n steps: 60\n },\n hour: {\n common: true,\n size: 3600000,\n steps: 24\n },\n day: {\n common: true,\n size: 86400000,\n steps: 30\n },\n week: {\n common: false,\n size: 604800000,\n steps: 4\n },\n month: {\n common: true,\n size: 2.628e9,\n steps: 12\n },\n quarter: {\n common: false,\n size: 7.884e9,\n steps: 4\n },\n year: {\n common: true,\n size: 3.154e10\n }\n};\n const UNITS = /* #__PURE__ */ Object.keys(INTERVALS);\n function sorter(a, b) {\n return a - b;\n}\n function parse(scale, input) {\n if (isNullOrUndef(input)) {\n return null;\n }\n const adapter = scale._adapter;\n const { parser , round , isoWeekday } = scale._parseOpts;\n let value = input;\n if (typeof parser === 'function') {\n value = parser(value);\n }\n if (!isNumberFinite(value)) {\n value = typeof parser === 'string' ? adapter.parse(value, parser) : adapter.parse(value);\n }\n if (value === null) {\n return null;\n }\n if (round) {\n value = round === 'week' && (isNumber(isoWeekday) || isoWeekday === true) ? adapter.startOf(value, 'isoWeek', isoWeekday) : adapter.startOf(value, round);\n }\n return +value;\n}\n function determineUnitForAutoTicks(minUnit, min, max, capacity) {\n const ilen = UNITS.length;\n for(let i = UNITS.indexOf(minUnit); i < ilen - 1; ++i){\n const interval = INTERVALS[UNITS[i]];\n const factor = interval.steps ? interval.steps : Number.MAX_SAFE_INTEGER;\n if (interval.common && Math.ceil((max - min) / (factor * interval.size)) <= capacity) {\n return UNITS[i];\n }\n }\n return UNITS[ilen - 1];\n}\n function determineUnitForFormatting(scale, numTicks, minUnit, min, max) {\n for(let i = UNITS.length - 1; i >= UNITS.indexOf(minUnit); i--){\n const unit = UNITS[i];\n if (INTERVALS[unit].common && scale._adapter.diff(max, min, unit) >= numTicks - 1) {\n return unit;\n }\n }\n return UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n}\n function determineMajorUnit(unit) {\n for(let i = UNITS.indexOf(unit) + 1, ilen = UNITS.length; i < ilen; ++i){\n if (INTERVALS[UNITS[i]].common) {\n return UNITS[i];\n }\n }\n}\n function addTick(ticks, time, timestamps) {\n if (!timestamps) {\n ticks[time] = true;\n } else if (timestamps.length) {\n const { lo , hi } = _lookup(timestamps, time);\n const timestamp = timestamps[lo] >= time ? timestamps[lo] : timestamps[hi];\n ticks[timestamp] = true;\n }\n}\n function setMajorTicks(scale, ticks, map, majorUnit) {\n const adapter = scale._adapter;\n const first = +adapter.startOf(ticks[0].value, majorUnit);\n const last = ticks[ticks.length - 1].value;\n let major, index;\n for(major = first; major <= last; major = +adapter.add(major, 1, majorUnit)){\n index = map[major];\n if (index >= 0) {\n ticks[index].major = true;\n }\n }\n return ticks;\n}\n function ticksFromTimestamps(scale, values, majorUnit) {\n const ticks = [];\n const map = {};\n const ilen = values.length;\n let i, value;\n for(i = 0; i < ilen; ++i){\n value = values[i];\n map[value] = i;\n ticks.push({\n value,\n major: false\n });\n }\n return ilen === 0 || !majorUnit ? ticks : setMajorTicks(scale, ticks, map, majorUnit);\n}\nclass TimeScale extends Scale {\n static id = 'time';\n static defaults = {\n bounds: 'data',\n adapters: {},\n time: {\n parser: false,\n unit: false,\n round: false,\n isoWeekday: false,\n minUnit: 'millisecond',\n displayFormats: {}\n },\n ticks: {\n source: 'auto',\n callback: false,\n major: {\n enabled: false\n }\n }\n };\n constructor(props){\n super(props);\n this._cache = {\n data: [],\n labels: [],\n all: []\n };\n this._unit = 'day';\n this._majorUnit = undefined;\n this._offsets = {};\n this._normalized = false;\n this._parseOpts = undefined;\n }\n init(scaleOpts, opts = {}) {\n const time = scaleOpts.time || (scaleOpts.time = {});\n const adapter = this._adapter = new adapters._date(scaleOpts.adapters.date);\n adapter.init(opts);\n mergeIf(time.displayFormats, adapter.formats());\n this._parseOpts = {\n parser: time.parser,\n round: time.round,\n isoWeekday: time.isoWeekday\n };\n super.init(scaleOpts);\n this._normalized = opts.normalized;\n }\n parse(raw, index) {\n if (raw === undefined) {\n return null;\n }\n return parse(this, raw);\n }\n beforeLayout() {\n super.beforeLayout();\n this._cache = {\n data: [],\n labels: [],\n all: []\n };\n }\n determineDataLimits() {\n const options = this.options;\n const adapter = this._adapter;\n const unit = options.time.unit || 'day';\n let { min , max , minDefined , maxDefined } = this.getUserBounds();\n function _applyBounds(bounds) {\n if (!minDefined && !isNaN(bounds.min)) {\n min = Math.min(min, bounds.min);\n }\n if (!maxDefined && !isNaN(bounds.max)) {\n max = Math.max(max, bounds.max);\n }\n }\n if (!minDefined || !maxDefined) {\n _applyBounds(this._getLabelBounds());\n if (options.bounds !== 'ticks' || options.ticks.source !== 'labels') {\n _applyBounds(this.getMinMax(false));\n }\n }\n min = isNumberFinite(min) && !isNaN(min) ? min : +adapter.startOf(Date.now(), unit);\n max = isNumberFinite(max) && !isNaN(max) ? max : +adapter.endOf(Date.now(), unit) + 1;\n this.min = Math.min(min, max - 1);\n this.max = Math.max(min + 1, max);\n }\n _getLabelBounds() {\n const arr = this.getLabelTimestamps();\n let min = Number.POSITIVE_INFINITY;\n let max = Number.NEGATIVE_INFINITY;\n if (arr.length) {\n min = arr[0];\n max = arr[arr.length - 1];\n }\n return {\n min,\n max\n };\n }\n buildTicks() {\n const options = this.options;\n const timeOpts = options.time;\n const tickOpts = options.ticks;\n const timestamps = tickOpts.source === 'labels' ? this.getLabelTimestamps() : this._generate();\n if (options.bounds === 'ticks' && timestamps.length) {\n this.min = this._userMin || timestamps[0];\n this.max = this._userMax || timestamps[timestamps.length - 1];\n }\n const min = this.min;\n const max = this.max;\n const ticks = _filterBetween(timestamps, min, max);\n 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));\n this._majorUnit = !tickOpts.major.enabled || this._unit === 'year' ? undefined : determineMajorUnit(this._unit);\n this.initOffsets(timestamps);\n if (options.reverse) {\n ticks.reverse();\n }\n return ticksFromTimestamps(this, ticks, this._majorUnit);\n }\n afterAutoSkip() {\n if (this.options.offsetAfterAutoskip) {\n this.initOffsets(this.ticks.map((tick)=>+tick.value));\n }\n }\n initOffsets(timestamps = []) {\n let start = 0;\n let end = 0;\n let first, last;\n if (this.options.offset && timestamps.length) {\n first = this.getDecimalForValue(timestamps[0]);\n if (timestamps.length === 1) {\n start = 1 - first;\n } else {\n start = (this.getDecimalForValue(timestamps[1]) - first) / 2;\n }\n last = this.getDecimalForValue(timestamps[timestamps.length - 1]);\n if (timestamps.length === 1) {\n end = last;\n } else {\n end = (last - this.getDecimalForValue(timestamps[timestamps.length - 2])) / 2;\n }\n }\n const limit = timestamps.length < 3 ? 0.5 : 0.25;\n start = _limitValue(start, 0, limit);\n end = _limitValue(end, 0, limit);\n this._offsets = {\n start,\n end,\n factor: 1 / (start + 1 + end)\n };\n }\n _generate() {\n const adapter = this._adapter;\n const min = this.min;\n const max = this.max;\n const options = this.options;\n const timeOpts = options.time;\n const minor = timeOpts.unit || determineUnitForAutoTicks(timeOpts.minUnit, min, max, this._getLabelCapacity(min));\n const stepSize = valueOrDefault(options.ticks.stepSize, 1);\n const weekday = minor === 'week' ? timeOpts.isoWeekday : false;\n const hasWeekday = isNumber(weekday) || weekday === true;\n const ticks = {};\n let first = min;\n let time, count;\n if (hasWeekday) {\n first = +adapter.startOf(first, 'isoWeek', weekday);\n }\n first = +adapter.startOf(first, hasWeekday ? 'day' : minor);\n if (adapter.diff(max, min, minor) > 100000 * stepSize) {\n throw new Error(min + ' and ' + max + ' are too far apart with stepSize of ' + stepSize + ' ' + minor);\n }\n const timestamps = options.ticks.source === 'data' && this.getDataTimestamps();\n for(time = first, count = 0; time < max; time = +adapter.add(time, stepSize, minor), count++){\n addTick(ticks, time, timestamps);\n }\n if (time === max || options.bounds === 'ticks' || count === 1) {\n addTick(ticks, time, timestamps);\n }\n return Object.keys(ticks).sort(sorter).map((x)=>+x);\n }\n getLabelForValue(value) {\n const adapter = this._adapter;\n const timeOpts = this.options.time;\n if (timeOpts.tooltipFormat) {\n return adapter.format(value, timeOpts.tooltipFormat);\n }\n return adapter.format(value, timeOpts.displayFormats.datetime);\n }\n format(value, format) {\n const options = this.options;\n const formats = options.time.displayFormats;\n const unit = this._unit;\n const fmt = format || formats[unit];\n return this._adapter.format(value, fmt);\n }\n _tickFormatFunction(time, index, ticks, format) {\n const options = this.options;\n const formatter = options.ticks.callback;\n if (formatter) {\n return callback(formatter, [\n time,\n index,\n ticks\n ], this);\n }\n const formats = options.time.displayFormats;\n const unit = this._unit;\n const majorUnit = this._majorUnit;\n const minorFormat = unit && formats[unit];\n const majorFormat = majorUnit && formats[majorUnit];\n const tick = ticks[index];\n const major = majorUnit && majorFormat && tick && tick.major;\n return this._adapter.format(time, format || (major ? majorFormat : minorFormat));\n }\n generateTickLabels(ticks) {\n let i, ilen, tick;\n for(i = 0, ilen = ticks.length; i < ilen; ++i){\n tick = ticks[i];\n tick.label = this._tickFormatFunction(tick.value, i, ticks);\n }\n }\n getDecimalForValue(value) {\n return value === null ? NaN : (value - this.min) / (this.max - this.min);\n }\n getPixelForValue(value) {\n const offsets = this._offsets;\n const pos = this.getDecimalForValue(value);\n return this.getPixelForDecimal((offsets.start + pos) * offsets.factor);\n }\n getValueForPixel(pixel) {\n const offsets = this._offsets;\n const pos = this.getDecimalForPixel(pixel) / offsets.factor - offsets.end;\n return this.min + pos * (this.max - this.min);\n }\n _getLabelSize(label) {\n const ticksOpts = this.options.ticks;\n const tickLabelWidth = this.ctx.measureText(label).width;\n const angle = toRadians(this.isHorizontal() ? ticksOpts.maxRotation : ticksOpts.minRotation);\n const cosRotation = Math.cos(angle);\n const sinRotation = Math.sin(angle);\n const tickFontSize = this._resolveTickFontOptions(0).size;\n return {\n w: tickLabelWidth * cosRotation + tickFontSize * sinRotation,\n h: tickLabelWidth * sinRotation + tickFontSize * cosRotation\n };\n }\n _getLabelCapacity(exampleTime) {\n const timeOpts = this.options.time;\n const displayFormats = timeOpts.displayFormats;\n const format = displayFormats[timeOpts.unit] || displayFormats.millisecond;\n const exampleLabel = this._tickFormatFunction(exampleTime, 0, ticksFromTimestamps(this, [\n exampleTime\n ], this._majorUnit), format);\n const size = this._getLabelSize(exampleLabel);\n const capacity = Math.floor(this.isHorizontal() ? this.width / size.w : this.height / size.h) - 1;\n return capacity > 0 ? capacity : 1;\n }\n getDataTimestamps() {\n let timestamps = this._cache.data || [];\n let i, ilen;\n if (timestamps.length) {\n return timestamps;\n }\n const metas = this.getMatchingVisibleMetas();\n if (this._normalized && metas.length) {\n return this._cache.data = metas[0].controller.getAllParsedValues(this);\n }\n for(i = 0, ilen = metas.length; i < ilen; ++i){\n timestamps = timestamps.concat(metas[i].controller.getAllParsedValues(this));\n }\n return this._cache.data = this.normalize(timestamps);\n }\n getLabelTimestamps() {\n const timestamps = this._cache.labels || [];\n let i, ilen;\n if (timestamps.length) {\n return timestamps;\n }\n const labels = this.getLabels();\n for(i = 0, ilen = labels.length; i < ilen; ++i){\n timestamps.push(parse(this, labels[i]));\n }\n return this._cache.labels = this._normalized ? timestamps : this.normalize(timestamps);\n }\n normalize(values) {\n return _arrayUnique(values.sort(sorter));\n }\n}\n\nfunction interpolate(table, val, reverse) {\n let lo = 0;\n let hi = table.length - 1;\n let prevSource, nextSource, prevTarget, nextTarget;\n if (reverse) {\n if (val >= table[lo].pos && val <= table[hi].pos) {\n ({ lo , hi } = _lookupByKey(table, 'pos', val));\n }\n ({ pos: prevSource , time: prevTarget } = table[lo]);\n ({ pos: nextSource , time: nextTarget } = table[hi]);\n } else {\n if (val >= table[lo].time && val <= table[hi].time) {\n ({ lo , hi } = _lookupByKey(table, 'time', val));\n }\n ({ time: prevSource , pos: prevTarget } = table[lo]);\n ({ time: nextSource , pos: nextTarget } = table[hi]);\n }\n const span = nextSource - prevSource;\n return span ? prevTarget + (nextTarget - prevTarget) * (val - prevSource) / span : prevTarget;\n}\nclass TimeSeriesScale extends TimeScale {\n static id = 'timeseries';\n static defaults = TimeScale.defaults;\n constructor(props){\n super(props);\n this._table = [];\n this._minPos = undefined;\n this._tableRange = undefined;\n }\n initOffsets() {\n const timestamps = this._getTimestampsForTable();\n const table = this._table = this.buildLookupTable(timestamps);\n this._minPos = interpolate(table, this.min);\n this._tableRange = interpolate(table, this.max) - this._minPos;\n super.initOffsets(timestamps);\n }\n buildLookupTable(timestamps) {\n const { min , max } = this;\n const items = [];\n const table = [];\n let i, ilen, prev, curr, next;\n for(i = 0, ilen = timestamps.length; i < ilen; ++i){\n curr = timestamps[i];\n if (curr >= min && curr <= max) {\n items.push(curr);\n }\n }\n if (items.length < 2) {\n return [\n {\n time: min,\n pos: 0\n },\n {\n time: max,\n pos: 1\n }\n ];\n }\n for(i = 0, ilen = items.length; i < ilen; ++i){\n next = items[i + 1];\n prev = items[i - 1];\n curr = items[i];\n if (Math.round((next + prev) / 2) !== curr) {\n table.push({\n time: curr,\n pos: i / (ilen - 1)\n });\n }\n }\n return table;\n }\n _generate() {\n const min = this.min;\n const max = this.max;\n let timestamps = super.getDataTimestamps();\n if (!timestamps.includes(min) || !timestamps.length) {\n timestamps.splice(0, 0, min);\n }\n if (!timestamps.includes(max) || timestamps.length === 1) {\n timestamps.push(max);\n }\n return timestamps.sort((a, b)=>a - b);\n }\n _getTimestampsForTable() {\n let timestamps = this._cache.all || [];\n if (timestamps.length) {\n return timestamps;\n }\n const data = this.getDataTimestamps();\n const label = this.getLabelTimestamps();\n if (data.length && label.length) {\n timestamps = this.normalize(data.concat(label));\n } else {\n timestamps = data.length ? data : label;\n }\n timestamps = this._cache.all = timestamps;\n return timestamps;\n }\n getDecimalForValue(value) {\n return (interpolate(this._table, value) - this._minPos) / this._tableRange;\n }\n getValueForPixel(pixel) {\n const offsets = this._offsets;\n const decimal = this.getDecimalForPixel(pixel) / offsets.factor - offsets.end;\n return interpolate(this._table, decimal * this._tableRange + this._minPos, true);\n }\n}\n\nvar scales = /*#__PURE__*/Object.freeze({\n__proto__: null,\nCategoryScale: CategoryScale,\nLinearScale: LinearScale,\nLogarithmicScale: LogarithmicScale,\nRadialLinearScale: RadialLinearScale,\nTimeScale: TimeScale,\nTimeSeriesScale: TimeSeriesScale\n});\n\nconst registerables = [\n controllers,\n elements,\n plugins,\n scales\n];\n\nexport { Animation, Animations, ArcElement, BarController, BarElement, BasePlatform, BasicPlatform, BubbleController, CategoryScale, Chart, plugin_colors as Colors, DatasetController, plugin_decimation as Decimation, DomPlatform, DoughnutController, Element, index as Filler, Interaction, plugin_legend as Legend, LineController, LineElement, LinearScale, LogarithmicScale, PieController, PointElement, PolarAreaController, RadarController, RadialLinearScale, Scale, ScatterController, plugin_subtitle as SubTitle, Ticks, TimeScale, TimeSeriesScale, plugin_title as Title, plugin_tooltip as Tooltip, adapters as _adapters, _detectPlatform, animator, controllers, defaults, elements, layouts, plugins, registerables, registry, scales };\n//# sourceMappingURL=chart.js.map\n","import { version, isProxy, toRaw, defineComponent, ref, shallowRef, onMounted, onBeforeUnmount, watch, h } from 'vue';\nimport { Chart as Chart$1, BarController, DoughnutController, LineController, PieController, PolarAreaController, RadarController, BubbleController, ScatterController } from 'chart.js';\n\nconst CommonProps = {\n data: {\n type: Object,\n required: true\n },\n options: {\n type: Object,\n default: ()=>({})\n },\n plugins: {\n type: Array,\n default: ()=>[]\n },\n datasetIdKey: {\n type: String,\n default: \"label\"\n },\n updateMode: {\n type: String,\n default: undefined\n }\n};\nconst Props = {\n type: {\n type: String,\n required: true\n },\n ...CommonProps\n};\n\nconst compatProps = version[0] === \"2\" ? (internals, props)=>Object.assign(internals, {\n attrs: props\n }) : (internals, props)=>Object.assign(internals, props);\nfunction toRawIfProxy(obj) {\n return isProxy(obj) ? toRaw(obj) : obj;\n}\nfunction cloneProxy(obj) {\n let src = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : obj;\n return isProxy(src) ? new Proxy(obj, {}) : obj;\n}\nfunction setOptions(chart, nextOptions) {\n const options = chart.options;\n if (options && nextOptions) {\n Object.assign(options, nextOptions);\n }\n}\nfunction setLabels(currentData, nextLabels) {\n currentData.labels = nextLabels;\n}\nfunction setDatasets(currentData, nextDatasets, datasetIdKey) {\n const addedDatasets = [];\n currentData.datasets = nextDatasets.map((nextDataset)=>{\n // given the new set, find it's current match\n const currentDataset = currentData.datasets.find((dataset)=>dataset[datasetIdKey] === nextDataset[datasetIdKey]);\n // There is no original to update, so simply add new one\n if (!currentDataset || !nextDataset.data || addedDatasets.includes(currentDataset)) {\n return {\n ...nextDataset\n };\n }\n addedDatasets.push(currentDataset);\n Object.assign(currentDataset, nextDataset);\n return currentDataset;\n });\n}\nfunction cloneData(data, datasetIdKey) {\n const nextData = {\n labels: [],\n datasets: []\n };\n setLabels(nextData, data.labels);\n setDatasets(nextData, data.datasets, datasetIdKey);\n return nextData;\n}\n/**\n * Get dataset from mouse click event\n * @param chart - Chart.js instance\n * @param event - Mouse click event\n * @returns Dataset\n */ function getDatasetAtEvent(chart, event) {\n return chart.getElementsAtEventForMode(event, \"dataset\", {\n intersect: true\n }, false);\n}\n/**\n * Get single dataset element from mouse click event\n * @param chart - Chart.js instance\n * @param event - Mouse click event\n * @returns Dataset\n */ function getElementAtEvent(chart, event) {\n return chart.getElementsAtEventForMode(event, \"nearest\", {\n intersect: true\n }, false);\n}\n/**\n * Get all dataset elements from mouse click event\n * @param chart - Chart.js instance\n * @param event - Mouse click event\n * @returns Dataset\n */ function getElementsAtEvent(chart, event) {\n return chart.getElementsAtEventForMode(event, \"index\", {\n intersect: true\n }, false);\n}\n\nconst Chart = defineComponent({\n props: Props,\n setup (props, param) {\n let { expose } = param;\n const canvasRef = ref(null);\n const chartRef = shallowRef(null);\n expose({\n chart: chartRef\n });\n const renderChart = ()=>{\n if (!canvasRef.value) return;\n const { type , data , options , plugins , datasetIdKey } = props;\n const clonedData = cloneData(data, datasetIdKey);\n const proxiedData = cloneProxy(clonedData, data);\n chartRef.value = new Chart$1(canvasRef.value, {\n type,\n data: proxiedData,\n options: {\n ...options\n },\n plugins\n });\n };\n const destroyChart = ()=>{\n const chart = toRaw(chartRef.value);\n if (chart) {\n chart.destroy();\n chartRef.value = null;\n }\n };\n const update = (chart)=>{\n chart.update(props.updateMode);\n };\n onMounted(renderChart);\n onBeforeUnmount(destroyChart);\n watch([\n ()=>props.options,\n ()=>props.data\n ], (param, param1)=>{\n let [nextOptionsProxy, nextDataProxy] = param, [prevOptionsProxy, prevDataProxy] = param1;\n const chart = toRaw(chartRef.value);\n if (!chart) {\n return;\n }\n let shouldUpdate = false;\n if (nextOptionsProxy) {\n const nextOptions = toRawIfProxy(nextOptionsProxy);\n const prevOptions = toRawIfProxy(prevOptionsProxy);\n if (nextOptions && nextOptions !== prevOptions) {\n setOptions(chart, nextOptions);\n shouldUpdate = true;\n }\n }\n if (nextDataProxy) {\n const nextLabels = toRawIfProxy(nextDataProxy.labels);\n const prevLabels = toRawIfProxy(prevDataProxy.labels);\n const nextDatasets = toRawIfProxy(nextDataProxy.datasets);\n const prevDatasets = toRawIfProxy(prevDataProxy.datasets);\n if (nextLabels !== prevLabels) {\n setLabels(chart.config.data, nextLabels);\n shouldUpdate = true;\n }\n if (nextDatasets && nextDatasets !== prevDatasets) {\n setDatasets(chart.config.data, nextDatasets, props.datasetIdKey);\n shouldUpdate = true;\n }\n }\n if (shouldUpdate) {\n update(chart);\n }\n }, {\n deep: true\n });\n return ()=>{\n return h(\"canvas\", {\n ref: canvasRef\n });\n };\n }\n});\n\nfunction createTypedChart(type, registerables) {\n Chart$1.register(registerables);\n return defineComponent({\n props: CommonProps,\n setup (props, param) {\n let { expose } = param;\n const ref = shallowRef(null);\n const reforwardRef = (chartRef)=>{\n ref.value = chartRef?.chart;\n };\n expose({\n chart: ref\n });\n return ()=>{\n return h(Chart, compatProps({\n ref: reforwardRef\n }, {\n type,\n ...props\n }));\n };\n }\n });\n}\nconst Bar = /* #__PURE__ */ createTypedChart(\"bar\", BarController);\nconst Doughnut = /* #__PURE__ */ createTypedChart(\"doughnut\", DoughnutController);\nconst Line = /* #__PURE__ */ createTypedChart(\"line\", LineController);\nconst Pie = /* #__PURE__ */ createTypedChart(\"pie\", PieController);\nconst PolarArea = /* #__PURE__ */ createTypedChart(\"polarArea\", PolarAreaController);\nconst Radar = /* #__PURE__ */ createTypedChart(\"radar\", RadarController);\nconst Bubble = /* #__PURE__ */ createTypedChart(\"bubble\", BubbleController);\nconst Scatter = /* #__PURE__ */ createTypedChart(\"scatter\", ScatterController);\n\nexport { Bar, Bubble, Chart, Doughnut, Line, Pie, PolarArea, Radar, Scatter, createTypedChart, getDatasetAtEvent, getElementAtEvent, getElementsAtEvent };\n//# sourceMappingURL=index.js.map\n"],"names":["round","v","lim","l","h","Math","max","min","p2b","n2b","b2n","n2p","map$1","A","B","C","D","E","F","a","b","c","d","e","f","hex","h1","h2","eq","isShort","r","g","hexParse","str","ret","len","length","alpha","hexString","undefined","HUE_RE","hsl2rgbn","s","n","k","hsv2rgbn","hwb2rgbn","w","rgb","i","hueValue","rgb2hsl","range","calln","Array","isArray","map","hsl2rgb","hwb2rgb","hsv2rgb","hue","hueParse","m","exec","p1","p2","rotate","deg","hslString","x","Z","Y","X","W","V","U","T","S","R","Q","P","O","N","M","L","K","G","H","I","J","names$1","OiceXe","antiquewEte","aqua","aquamarRe","azuY","beige","bisque","black","blanKedOmond","Xe","XeviTet","bPwn","burlywood","caMtXe","KartYuse","KocTate","cSO","cSnflowerXe","cSnsilk","crimson","cyan","xXe","xcyan","xgTMnPd","xWay","xgYF","xgYy","xkhaki","xmagFta","xTivegYF","xSange","xScEd","xYd","xsOmon","xsHgYF","xUXe","xUWay","xUgYy","xQe","xviTet","dAppRk","dApskyXe","dimWay","dimgYy","dodgerXe","fiYbrick","flSOwEte","foYstWAn","fuKsia","gaRsbSo","ghostwEte","gTd","gTMnPd","Way","gYF","gYFLw","gYy","honeyMw","hotpRk","RdianYd","Rdigo","ivSy","khaki","lavFMr","lavFMrXsh","lawngYF","NmoncEffon","ZXe","ZcSO","Zcyan","ZgTMnPdLw","ZWay","ZgYF","ZgYy","ZpRk","ZsOmon","ZsHgYF","ZskyXe","ZUWay","ZUgYy","ZstAlXe","ZLw","lime","limegYF","lRF","magFta","maPon","VaquamarRe","VXe","VScEd","VpurpN","VsHgYF","VUXe","VsprRggYF","VQe","VviTetYd","midnightXe","mRtcYam","mistyPse","moccasR","navajowEte","navy","Tdlace","Tive","TivedBb","Sange","SangeYd","ScEd","pOegTMnPd","pOegYF","pOeQe","pOeviTetYd","papayawEp","pHKpuff","peru","pRk","plum","powMrXe","purpN","YbeccapurpN","Yd","Psybrown","PyOXe","saddNbPwn","sOmon","sandybPwn","sHgYF","sHshell","siFna","silver","skyXe","UXe","UWay","UgYy","snow","sprRggYF","stAlXe","tan","teO","tEstN","tomato","Qe","viTet","JHt","wEte","wEtesmoke","Lw","LwgYF","unpack","unpacked","keys","Object","tkeys","j","ok","nk","replace","parseInt","names","nameParse","transparent","toLowerCase","RGB_RE","rgbParse","rgbString","to","pow","from","interpolate","rgb1","rgb2","t","modHSL","ratio","tmp","clone","proto","assign","fromObject","input","functionParse","charAt","Color","constructor","type","this","_rgb","_valid","valid","obj","mix","color","weight","c1","c2","w2","p","w1","clearer","greyscale","val","opaquer","negate","lighten","darken","saturate","desaturate","noop","uid","id","isNullOrUndef","value","prototype","toString","call","slice","isObject","isNumberFinite","Number","isFinite","finiteOrDefault","defaultValue","valueOrDefault","toPercentage","dimension","endsWith","parseFloat","toDimension","callback","fn","args","thisArg","apply","each","loopable","reverse","_elementsEqual","a0","a1","ilen","v0","v1","datasetIndex","index","source","target","create","klen","isValidKey","key","indexOf","_merger","options","tval","sval","merge","sources","merger","current","mergeIf","_mergerIf","hasOwnProperty","keyResolvers","o","y","_splitKey","parts","split","part","push","_getKeyResolver","resolveObjectKey","resolver","_capitalize","toUpperCase","defined","isFunction","setsEqual","size","item","has","_isClickEvent","PI","TAU","INFINITY","POSITIVE_INFINITY","RAD_PER_DEG","HALF_PI","QUARTER_PI","TWO_THIRDS_PI","log10","sign","almostEquals","epsilon","abs","niceNum","roundedRange","niceRange","floor","fraction","niceFraction","_factorize","result","sqrt","sort","pop","isNumber","isNaN","almostWhole","rounded","_setMinAndMaxByKey","array","property","toRadians","degrees","toDegrees","radians","_decimalPlaces","getAngleFromPoint","centrePoint","anglePoint","distanceFromXCenter","distanceFromYCenter","radialDistanceFromCenter","angle","atan2","distance","distanceBetweenPoints","pt1","pt2","_normalizeAngle","_angleBetween","start","end","sameAngleIsFullCircle","angleToStart","angleToEnd","startToAngle","endToAngle","_limitValue","_int16Range","_isBetween","_lookup","table","cmp","mid","hi","lo","_lookupByKey","last","ti","_rlookupByKey","_filterBetween","values","arrayEvents","listenArrayEvents","listener","_chartjs","listeners","defineProperty","configurable","enumerable","forEach","method","base","res","object","unlistenArrayEvents","stub","splice","_arrayUnique","items","set","Set","requestAnimFrame","window","requestAnimationFrame","throttled","argsToUse","ticking","debounce","delay","timeout","clearTimeout","setTimeout","_toLeftRightCenter","align","_alignStartEnd","atEdge","elasticIn","sin","elasticOut","effects","linear","easeInQuad","easeOutQuad","easeInOutQuad","easeInCubic","easeOutCubic","easeInOutCubic","easeInQuart","easeOutQuart","easeInOutQuart","easeInQuint","easeOutQuint","easeInOutQuint","easeInSine","cos","easeOutSine","easeInOutSine","easeInExpo","easeOutExpo","easeInOutExpo","easeInCirc","easeOutCirc","easeInOutCirc","easeInElastic","easeOutElastic","easeInOutElastic","easeInBack","easeOutBack","easeInOutBack","easeInBounce","easeOutBounce","easeInOutBounce","isPatternOrGradient","getHoverColor","numbers","colors","applyAnimationsDefaults","defaults","duration","easing","loop","describe","_fallback","_indexable","_scriptable","name","properties","active","animation","resize","show","animations","visible","hide","applyLayoutsDefaults","autoPadding","padding","top","right","bottom","left","intlCache","Map","getNumberFormat","locale","cacheKey","JSON","stringify","formatter","get","Intl","NumberFormat","formatNumber","num","format","formatters","numeric","tickValue","ticks","chart","notation","delta","maxTick","calculateDelta","logDelta","numDecimal","minimumFractionDigits","maximumFractionDigits","logarithmic","remain","significand","includes","Ticks","applyScaleDefaults","display","offset","beginAtZero","bounds","grace","grid","lineWidth","drawOnChartArea","drawTicks","tickLength","tickWidth","_ctx","tickColor","border","dash","dashOffset","width","title","text","minRotation","maxRotation","mirror","textStrokeWidth","textStrokeColor","autoSkip","autoSkipPadding","labelOffset","minor","major","crossAlign","showLabelBackdrop","backdropColor","backdropPadding","route","startsWith","overrides","descriptors","getScope$1","node","root","scope","Defaults","_descriptors","_appliers","backgroundColor","borderColor","datasets","devicePixelRatio","context","platform","getDevicePixelRatio","elements","events","font","family","style","lineHeight","hover","hoverBackgroundColor","ctx","hoverBorderColor","hoverColor","indexAxis","interaction","mode","intersect","includeInvisible","maintainAspectRatio","onHover","onClick","parsing","plugins","responsive","scale","scales","showLine","drawActiveElementsOnTop","override","targetScope","targetName","scopeObject","targetScopeObject","privateName","defineProperties","writable","local","appliers","toFontString","_measureText","data","gc","longest","string","textWidth","measureText","_alignPixel","pixel","currentDevicePixelRatio","halfWidth","clearCanvas","canvas","getContext","save","resetTransform","clearRect","height","restore","drawPoint","drawPointLegend","xOffset","yOffset","cornerRadius","xOffsetW","yOffsetW","pointStyle","rotation","radius","rad","translate","drawImage","beginPath","ellipse","arc","closePath","moveTo","lineTo","SQRT1_2","rect","fill","borderWidth","stroke","_isPointInArea","point","area","margin","clipArea","clip","unclipArea","setRenderOpts","opts","translation","fillStyle","textAlign","textBaseline","decorateText","line","strikethrough","underline","metrics","actualBoundingBoxLeft","actualBoundingBoxRight","actualBoundingBoxAscent","actualBoundingBoxDescent","yDecoration","strokeStyle","decorationWidth","drawBackdrop","oldColor","fillRect","renderText","lines","strokeWidth","strokeColor","backdrop","strokeText","maxWidth","fillText","addRoundedRectPath","topLeft","bottomLeft","bottomRight","topRight","LINE_HEIGHT","FONT_STYLE","toLineHeight","matches","match","numberOrZero","_readValueToProps","props","objProps","read","prop","toTRBL","toTRBLCorners","toPadding","toFont","fallback","console","warn","resolve","inputs","info","cacheable","_addGrace","minmax","change","keepZero","add","createContext","parentContext","_createResolver","scopes","prefixes","rootScopes","getTarget","finalRootScopes","_resolve","cache","Symbol","toStringTag","_cacheable","_scopes","_rootScopes","_getTarget","Proxy","deleteProperty","_keys","_cached","_resolveWithPrefixes","getOwnPropertyDescriptor","Reflect","getPrototypeOf","getKeysFromAllScopes","ownKeys","storage","_storage","_attachContext","proxy","subProxy","descriptorDefaults","_proxy","_context","_subProxy","_stack","setContext","receiver","_resolveWithContext","allKeys","scriptable","indexable","_allKeys","isScriptable","isIndexable","readKey","prefix","needsSubResolver","_resolveScriptable","_resolveArray","getValue","Error","join","delete","createSubResolver","arr","filter","resolveFallback","getScope","parent","addScopes","parentScopes","parentFallback","allScopes","addScopesFromKey","subGetTarget","resolveKeysFromAllScopes","_parseObjectDataRadialScale","meta","count","iScale","_parsing","parsed","parse","EPSILON","_isDomSupported","document","_getParentNode","domNode","parentNode","host","parseMaxStyle","styleValue","parentProperty","valueInPixels","getComputedStyle","element","ownerDocument","defaultView","getStyle","el","getPropertyValue","positions","getPositionedStyle","styles","suffix","pos","useOffsetPos","shadowRoot","getCanvasPosition","touches","offsetX","offsetY","box","getBoundingClientRect","clientX","clientY","getRelativePosition","event","borderBox","boxSizing","paddings","borders","getContainerSize","maxHeight","container","containerStyle","containerBorder","containerPadding","clientWidth","clientHeight","round1","getMaximumSize","bbWidth","bbHeight","aspectRatio","margins","containerSize","maintainHeight","retinaScale","forceRatio","forceStyle","pixelRatio","deviceHeight","deviceWidth","setTransform","supportsEventListenerOptions","passiveSupported","passive","addEventListener","removeEventListener","readUsedSize","getRightToLeftAdapter","rectX","setWidth","xPlus","leftForLtr","itemWidth","getLeftToRightAdapter","_itemWidth","getRtlAdapter","rtl","overrideTextDirection","direction","original","getPropertyPriority","setProperty","prevTextDirection","restoreTextDirection","Animator","_request","_charts","_running","_lastDate","_notify","anims","date","callbacks","numSteps","initial","currentStep","_refresh","_update","Date","now","remaining","running","draw","_active","_total","tick","_getAnims","charts","complete","progress","listen","cb","reduce","acc","cur","_duration","stop","cancel","remove","animator","interpolators","boolean","factor","c0","number","Animation","cfg","currentValue","_fn","_easing","_start","_loop","_target","_prop","_from","_to","_promises","update","elapsed","wait","promises","Promise","rej","resolved","Animations","config","_chart","_properties","configure","animationOptions","animatedProps","getOwnPropertyNames","option","_animateOptions","newOptions","resolveTargetOptions","_createAnimations","$shared","awaitAll","$animations","then","anim","all","scaleClip","allowedOverflow","defaultClip","xScale","yScale","toClip","disabled","getSortedDatasetIndices","filterVisible","metasets","_getSortedDatasetMetas","applyStack","stack","dsIndex","singleMode","otherValue","convertObjectDataToArray","adata","isStacked","stacked","getStackKey","indexScale","valueScale","getUserBounds","minDefined","maxDefined","NEGATIVE_INFINITY","getOrCreateStack","stacks","stackKey","indexValue","subStack","getLastIndexInStack","vScale","positive","getMatchingVisibleMetas","updateStacks","controller","_cachedMeta","_stacks","iAxis","axis","vAxis","itemStacks","_top","_bottom","visualValues","_visualValues","getFirstScaleId","shift","createDatasetContext","dataset","createDataContext","dataIndex","raw","clearStacks","_parsed","isDirectUpdateMode","cloneIfNotShared","cached","shared","createStack","canStack","hidden","_stacked","DatasetController","static","_cachedDataOpts","getMeta","_type","_data","_objectData","_sharedOptions","_drawStart","_drawCount","enableOptionSharing","supportsDecimation","$context","_syncList","datasetElementType","dataElementType","initialize","linkScales","addElements","isPluginEnabled","updateIndex","getDataset","chooseId","xid","xAxisID","yid","yAxisID","rid","rAxisID","iid","iAxisID","vid","vAxisID","getScaleForId","rScale","getDatasetMeta","scaleID","_getOtherScale","reset","_destroy","_dataCheck","isExtensible","buildOrUpdateElements","resetNewElements","stackChanged","oldStacked","_resyncElements","scopeKeys","datasetScopeKeys","getOptionScopes","createResolver","sorted","_sorted","prev","parseArrayData","parseObjectData","parsePrimitiveData","isNotInOrderComparedToPrev","labels","getLabels","singleScale","xAxisKey","yAxisKey","getParsed","getDataElement","updateRangeFromParsed","parsedValue","NaN","getMinMax","otherScale","otherMin","otherMax","_skip","getAllParsedValues","getMaxOverflow","getLabelAndValue","label","getLabelForValue","_clip","chartArea","resolveDatasetElementOptions","resolveDataElementOptions","_resolveElementOptions","elementType","sharing","datasetElementScopeKeys","resolveNamedOptions","freeze","_resolveAnimations","transition","datasetAnimationScopeKeys","getSharedOptions","includeOptions","sharedOptions","_animationsDisabled","_getSharedOptions","firstOpts","previouslySharedOptions","updateSharedOptions","updateElement","_setStyle","removeHoverStyle","setHoverStyle","_removeDatasetHoverStyle","_setDatasetHoverStyle","arg1","arg2","numMeta","numData","_insertElements","_removeElements","move","updateElements","removed","_sync","_dataChanges","_onDataPush","arguments","_onDataPop","_onDataShift","_onDataSplice","newCount","_onDataUnshift","getAllScaleValues","_cache","$bar","visibleMetas","concat","computeMinSampleSize","curr","_length","updateMinAndPrev","getPixelForValue","getPixelForTick","computeFitCategoryTraits","ruler","stackCount","thickness","barThickness","categoryPercentage","barPercentage","chunk","pixels","computeFlexCategoryTraits","next","percent","parseFloatBar","entry","startValue","endValue","barStart","barEnd","_custom","parseValue","parseArrayOrPrimitive","isFloatBar","custom","barSign","actualBase","isHorizontal","borderProps","horizontal","setBorderSkipped","edge","borderSkipped","enableBorderRadius","parseEdge","swap","startEnd","orig","v2","setInflateAmount","inflateAmount","BarController","grouped","_index_","_value_","iAxisKey","vAxisKey","super","bars","getBasePixel","_getRuler","vpixels","head","_calculateBarValuePixels","ipixels","_calculateBarIndexPixels","center","_getStacks","skipNull","_getStackCount","_getStackIndex","_startPixel","_endPixel","baseValue","minBarLength","floating","getDataVisibility","startPixel","getPixelForDecimal","endPixel","getValueForPixel","halfGrid","getLineWidthForValue","maxBarThickness","Infinity","stackIndex","rects","getRatioAndOffset","circumference","cutout","ratioX","ratioY","startAngle","endAngle","startX","startY","endX","endY","calcMax","calcMin","maxX","maxY","minX","minY","DoughnutController","animateRotate","animateScale","spacing","legend","generateLabels","fontColor","legendItem","toggleDataVisibility","innerRadius","outerRadius","getter","_getRotation","_getCircumference","_getRotationExtents","isDatasetVisible","arcs","getMaxBorderWidth","getMaxOffset","maxSize","chartWeight","_getRingWeight","maxRadius","radiusLength","_getVisibleDatasetWeightTotal","total","calculateTotal","_getRingWeightOffset","_circumference","calculateCircumference","animationOpts","centerX","centerY","metaData","borderAlign","hoverBorderWidth","hoverOffset","ringWeightOffset","PolarAreaController","angleLines","circular","pointLabels","bind","_updateRadius","minSize","cutoutPercentage","getVisibleDatasetCount","xCenter","yCenter","datasetStartAngle","getIndexAngle","defaultAngle","countVisibleElements","_computeAngle","getDistanceFromCenterForValue","PieController","DateAdapterBase","members","init","formats","diff","startOf","endOf","adapters","_date","binarySearch","metaset","lookupMethod","_reversePixels","getRange","evaluateInteractionItems","position","handler","getSortedVisibleDatasetMetas","skip","getDistanceMetricForAxis","useX","useY","deltaX","deltaY","getIntersectItems","useFinalPosition","isPointInArea","evaluationFunc","inRange","getNearestRadialItems","getProps","getNearestCartesianItems","distanceMetric","minDistance","getCenterPoint","pointInArea","getNearestItems","getAxisItems","rangeMethod","intersectsItem","Interaction","modes","nearest","STATIC_POSITIONS","filterByPosition","filterDynamicPositionByAxis","sortByWeight","wrapBoxes","boxes","layoutBoxes","stackWeight","buildStacks","layouts","wrap","placed","setLayoutDims","params","vBoxMaxWidth","hBoxMaxHeight","layout","fullSize","availableWidth","availableHeight","buildLayoutBoxes","centerHorizontal","centerVertical","leftAndTop","rightAndBottom","vertical","getCombinedMax","maxPadding","updateMaxPadding","boxPadding","updateDims","getPadding","newWidth","outerWidth","newHeight","outerHeight","widthChanged","heightChanged","same","other","handleMaxPadding","updatePos","getMargins","marginForPositions","fitBoxes","refitBoxes","refit","changed","setBoxDims","placeBoxes","userPadding","addBox","_layers","z","removeBox","layoutItem","minPadding","verticalBoxes","horizontalBoxes","beforeLayout","visibleVerticalBoxCount","BasePlatform","acquireContext","releaseContext","isAttached","updateConfig","BasicPlatform","EXPANDO_KEY","EVENT_TYPES","touchstart","touchmove","touchend","pointerenter","pointerdown","pointermove","pointerup","pointerleave","pointerout","isNullOrEmpty","initCanvas","renderHeight","getAttribute","renderWidth","displayWidth","displayHeight","eventListenerOptions","addListener","removeListener","fromNativeEvent","native","nodeListContains","nodeList","contains","createAttachObserver","observer","MutationObserver","entries","trigger","addedNodes","removedNodes","observe","childList","subtree","createDetachObserver","drpListeningCharts","oldDevicePixelRatio","onWindowResize","dpr","listenDevicePixelRatioChanges","unlistenDevicePixelRatioChanges","createResizeObserver","ResizeObserver","contentRect","releaseObserver","disconnect","createProxyAndListen","DomPlatform","removeAttribute","setAttribute","proxies","$proxies","handlers","attach","detach","isConnected","_detectPlatform","OffscreenCanvas","Element","tooltipPosition","hasValue","final","tickOpts","determinedMaxTicks","determineMaxTicks","ticksLimit","maxTicksLimit","majorIndices","enabled","getMajorIndices","numMajorIndices","first","newTicks","skipMajors","calculateSpacing","avgMajorSpacing","_tickSize","maxScale","maxChart","_maxLength","evenMajorSpacing","getEvenSpacing","factors","ceil","majorStart","majorEnd","reverseAlign","offsetFromEdge","getTicksLimit","ticksLength","sample","numItems","increment","getPixelForGridLine","offsetGridLines","validIndex","lineValue","garbageCollect","caches","gcLen","getTickMarkLength","getTitleHeight","createScaleContext","createTickContext","titleAlign","titleArgs","titleX","titleY","positionAxisID","Scale","_margins","paddingTop","paddingBottom","paddingLeft","paddingRight","labelRotation","_range","_gridLineItems","_labelItems","_labelSizes","_longestTextCache","_userMax","_userMin","_suggestedMax","_suggestedMin","_ticksLength","_borderValue","_dataLimitsCached","suggestedMin","suggestedMax","metas","getTicks","xLabels","yLabels","getLabelItems","_computeLabelItems","beforeUpdate","sampleSize","beforeSetDimensions","setDimensions","afterSetDimensions","beforeDataLimits","determineDataLimits","afterDataLimits","beforeBuildTicks","buildTicks","afterBuildTicks","samplingEnabled","_convertTicksToLabels","beforeCalculateLabelRotation","calculateLabelRotation","afterCalculateLabelRotation","afterAutoSkip","beforeFit","fit","afterFit","afterUpdate","reversePixels","_alignToPixels","alignToPixels","_callHooks","notifyPlugins","beforeTickToLabelConversion","generateTickLabels","afterTickToLabelConversion","numTicks","maxLabelDiagonal","_isVisible","labelSizes","_getLabelSizes","maxLabelWidth","widest","maxLabelHeight","highest","asin","titleOpts","gridOpts","titleHeight","tickPadding","angleRadians","labelHeight","labelWidth","_calculatePadding","_handleMargins","isRotated","labelsBelowTicks","offsetLeft","offsetRight","isFullSize","_computeLabelSizes","widths","heights","jlen","tickFont","fontString","nestedLabel","widestLabelSize","highestLabelSize","_resolveTickFontOptions","valueAt","idx","decimal","getDecimalForPixel","getBaseValue","optionTicks","rot","_computeGridLineItems","tl","borderOpts","axisWidth","axisHalfWidth","alignBorderValue","borderValue","alignedLineValue","tx1","ty1","tx2","ty2","x1","y1","x2","y2","limit","step","optsAtIndex","optsAtIndexBorder","lineColor","borderDash","borderDashOffset","tickBorderDash","tickBorderDashOffset","tickAndPadding","hTickAndPadding","lineCount","textOffset","_getXAxisLabelAlignment","_getYAxisLabelAlignment","halfCount","tickTextAlign","labelPadding","_computeLabelArea","drawBackground","findIndex","drawGrid","drawLine","setLineDash","lineDashOffset","drawBorder","lastLineWidth","drawLabels","renderTextOptions","drawTitle","tz","gz","bz","axisID","_maxDigits","fontSize","TypedRegistry","isForType","isPrototypeOf","register","parentScope","isIChartComponent","registerDefaults","unregister","itemDefaults","defaultRoutes","routeDefaults","routes","propertyParts","sourceName","sourceScope","Registry","controllers","_typedRegistries","_each","addControllers","addPlugins","addScales","getController","_get","getElement","getPlugin","getScale","removeControllers","removeElements","removePlugins","removeScales","typedRegistry","arg","reg","_getRegistryForType","_exec","itemReg","registry","component","camelMethod","PluginService","_init","notify","hook","_createDescriptors","descriptor","plugin","cancelable","invalidate","_oldCache","_notifyStateChanges","allPlugins","createDescriptors","previousDescriptors","some","localIds","getOpts","pluginOpts","pluginScopeKeys","getIndexAxis","datasetDefaults","datasetOptions","getAxisFromDefaultScaleID","getDefaultScaleIDFromAxis","idMatchesAxis","axisFromPosition","determineAxis","scaleOptions","getAxisFromDataset","retrieveAxisFromDatasets","boundDs","mergeScaleConfig","chartDefaults","configScales","chartIndexAxis","scaleConf","error","defaultId","defaultScaleOptions","defaultID","initOptions","initData","initConfig","keyCache","keysCached","cachedKeys","generate","addIfFound","Config","_config","_scopeCache","_resolverCache","clearCache","clear","datasetType","additionalOptionScopes","_cachedScopes","mainScope","resetCache","keyLists","chartOptionScopes","subPrefixes","getResolver","needContext","subResolver","resolverCache","hasFunction","version","KNOWN_POSITIONS","positionIsHorizontal","compare2Level","l1","l2","onAnimationsComplete","onComplete","onAnimationProgress","onProgress","getCanvas","getElementById","instances","getChart","moveNumericKeys","intKey","determineLastEvent","lastEvent","inChartArea","isClick","getDatasetArea","Chart","invalidatePlugins","userConfig","initialCanvas","existingChart","_options","_aspectRatio","_metasets","_lastEvent","_listeners","_responsiveListeners","_sortedMetasets","_plugins","_hiddenIndices","attached","_doResize","resizeDelay","_initialize","bindEvents","_resizeBeforeDraw","_resize","newSize","newRatio","onResize","render","ensureScalesHaveIDs","scalesOptions","axisOptions","buildOrUpdateScales","scaleOpts","updated","isRadial","dposition","dtype","scaleType","scaleClass","hasUpdated","_updateMetasets","_destroyDatasetMeta","_removeUnreferencedMetasets","_dataset","buildOrUpdateControllers","newControllers","order","ControllerClass","_resetElements","animsDisabled","_updateScales","_checkEventBindings","_updateHiddenIndices","_minPadding","_updateLayout","_updateDatasets","_eventHandler","_updateHoverStyles","existingEvents","newEvents","unbindEvents","changes","_getUniformDataChanges","datasetCount","makeSet","changeSet","noArea","_idx","_updateDataset","layers","_drawDatasets","_drawDataset","useClip","getElementsAtEventForMode","setDatasetVisibility","_updateVisibility","_stop","destroy","toBase64Image","toDataURL","bindUserEvents","bindResponsiveEvents","_add","_remove","detached","updateHoverStyle","getActiveElements","setActiveElements","activeElements","lastActive","pluginId","replay","hoverOptions","deactivated","activated","eventFilter","_handleEvent","_getActiveElements","clipArc","pixelMargin","angleMargin","toRadiusCorners","parseBorderRadius$1","angleDelta","borderRadius","halfThickness","innerLimit","computeOuterLimit","outerArcLimit","outerStart","outerEnd","innerStart","innerEnd","rThetaToXY","theta","pathArc","innerR","spacingOffset","noSpacingInnerRadius","noSpacingOuterRadius","avNogSpacingRadius","adjustedAngle","beta","angleOffset","outerStartAdjustedRadius","outerEndAdjustedRadius","outerStartAdjustedAngle","outerEndAdjustedAngle","innerStartAdjustedRadius","innerEndAdjustedRadius","innerStartAdjustedAngle","innerEndAdjustedAngle","outerMidAdjustedAngle","pCenter","p4","innerMidAdjustedAngle","p8","outerStartX","outerStartY","outerEndX","outerEndY","drawArc","fullCircles","borderJoinStyle","inner","lineJoin","ArcElement","chartX","chartY","rAdjust","betweenAngles","withinRadius","halfAngle","halfRadius","fix","radiusOffset","getBarBounds","bar","half","skipOrLimit","parseBorderWidth","maxW","maxH","parseBorderRadius","maxR","enableBorder","boundingRects","outer","skipX","skipY","skipBoth","hasRadius","addNormalRectPath","inflateRect","amount","refRect","BarElement","addRectPath","mouseX","mouseY","inXRange","inYRange","BORDER_COLORS","BACKGROUND_COLORS","getBorderColor","getBackgroundColor","colorizeDefaultDataset","colorizeDoughnutDataset","colorizePolarAreaDataset","getColorizer","containsColorsDefinitions","containsColorsDefinition","plugin_colors","forceOverride","_args","chartOptions","colorizer","Title","_padding","textSize","_drawArgs","fontOpts","createTitle","titleBlock","plugin_title","_element","WeakMap","positioners","average","eventPosition","nearestElement","tp","pushOrConcat","toPush","splitNewlines","String","createTooltipItem","formattedValue","getTooltipSize","tooltip","body","footer","boxWidth","boxHeight","bodyFont","titleFont","footerFont","titleLineCount","footerLineCount","bodyLineItemCount","combinedBodyLength","bodyItem","before","after","beforeBody","afterBody","titleSpacing","titleMarginBottom","bodyLineHeight","displayColors","bodySpacing","footerMarginTop","footerSpacing","widthPadding","maxLineWidth","determineYAlign","doesNotFitWithAlign","xAlign","caret","caretSize","caretPadding","determineXAlign","yAlign","chartWidth","determineAlignment","alignX","alignY","paddingAndSize","getBackgroundPoint","alignment","getAlignedX","getBeforeAfterBodyLines","createTooltipContext","tooltipItems","overrideCallbacks","defaultCallbacks","beforeTitle","labelCount","afterTitle","beforeLabel","tooltipItem","labelColor","labelTextColor","bodyColor","labelPointStyle","afterLabel","beforeFooter","afterFooter","invokeCallbackWithFallback","Tooltip","opacity","_eventPosition","_size","_cachedAnimations","_tooltipItems","dataPoints","caretX","caretY","labelColors","labelPointStyles","labelTextColors","getTitle","getBeforeBody","getBody","bodyItems","scoped","getAfterBody","getFooter","_createItems","itemSort","positionAndSize","backgroundPoint","external","drawCaret","tooltipPoint","caretPosition","getCaretPosition","x3","y3","ptX","ptY","pt","rtlHelper","titleColor","_drawColorBox","colorX","rtlColorX","yOffSet","colorY","usePointStyle","drawOptions","multiKeyBackground","outerX","innerX","strokeRect","drawBody","bodyAlign","xLinePadding","fillLineOfText","bodyAlignForCalculation","textColor","drawFooter","footerAlign","footerColor","tooltipSize","quadraticCurveTo","_updateAnimationTarget","animX","animY","_willRender","hasTooltipContent","globalAlpha","textDirection","positionChanged","_positionChanged","_ignoreReplayEvents","handleEvent","plugin_tooltip","afterInit","afterDraw","afterEvent","addIfString","addedLabels","unshift","findOrAddLabel","lastIndexOf","_getLabelForValue","CategoryScale","_startValue","_valueRange","_addedLabels","added","generateTicks$1","generationOptions","dataRange","MIN_SPACING","precision","maxTicks","maxDigits","includeBounds","unit","maxSpaces","rmin","rmax","countDefined","minSpacing","niceMin","niceMax","numSpaces","decimalPlaces","relativeLabelSize","LinearScaleBase","_endValue","handleTickRangeOptions","setMin","setMax","minSign","maxSign","getTickLimit","stepSize","computeTickLimit","numericGeneratorOptions","LinearScale","INTERVALS","millisecond","common","steps","second","minute","hour","day","week","month","quarter","year","UNITS","sorter","adapter","_adapter","parser","isoWeekday","_parseOpts","determineUnitForAutoTicks","minUnit","capacity","interval","MAX_SAFE_INTEGER","determineUnitForFormatting","determineMajorUnit","addTick","time","timestamps","timestamp","setMajorTicks","majorUnit","ticksFromTimestamps","TimeScale","displayFormats","_unit","_majorUnit","_offsets","_normalized","normalized","_applyBounds","_getLabelBounds","getLabelTimestamps","timeOpts","_generate","_getLabelCapacity","initOffsets","offsetAfterAutoskip","getDecimalForValue","weekday","hasWeekday","getDataTimestamps","tooltipFormat","datetime","fmt","_tickFormatFunction","minorFormat","majorFormat","offsets","_getLabelSize","ticksOpts","tickLabelWidth","cosRotation","sinRotation","tickFontSize","exampleTime","exampleLabel","normalize","CommonProps","required","default","datasetIdKey","updateMode","Props","compatProps","internals","attrs","toRawIfProxy","cloneProxy","src","setOptions","nextOptions","setLabels","currentData","nextLabels","setDatasets","nextDatasets","addedDatasets","nextDataset","currentDataset","find","cloneData","nextData","setup","param","expose","canvasRef","chartRef","renderChart","clonedData","proxiedData","destroyChart","param1","nextOptionsProxy","nextDataProxy","prevOptionsProxy","prevDataProxy","shouldUpdate","prevOptions","prevLabels","prevDatasets","deep","ref","createTypedChart","registerables","reforwardRef","Bar","Pie"],"sourceRoot":""} \ No newline at end of file diff --git a/js/5917.6759ba7a.js b/js/3805.ce6f439d.js similarity index 99% rename from js/5917.6759ba7a.js rename to js/3805.ce6f439d.js index b7244f0c5..1e7b2681b 100644 --- a/js/5917.6759ba7a.js +++ b/js/3805.ce6f439d.js @@ -1,4 +1,4 @@ -(self["webpackChunk_radiantearth_stac_browser"]=self["webpackChunk_radiantearth_stac_browser"]||[]).push([[5917],{62768:function(t){"use strict";var e=Math.PI/180,n=180/Math.PI;function r(t){var e=o(t[0]+1,t[2]),n=o(t[0],t[2]),r=s(t[1]+1,t[2]),i=s(t[1],t[2]);return[n,r,e,i]}function i(t){var e=r(t),n={type:"Polygon",coordinates:[[[e[0],e[3]],[e[0],e[1]],[e[2],e[1]],[e[2],e[3]],[e[0],e[3]]]]};return n}function o(t,e){return t/Math.pow(2,e)*360-180}function s(t,e){var r=Math.PI-2*Math.PI*t/Math.pow(2,e);return n*Math.atan(.5*(Math.exp(r)-Math.exp(-r)))}function a(t,e,n){var r=_(t,e,n);return r[0]=Math.floor(r[0]),r[1]=Math.floor(r[1]),r}function l(t){return[[2*t[0],2*t[1],t[2]+1],[2*t[0]+1,2*t[1],t[2]+1],[2*t[0]+1,2*t[1]+1,t[2]+1],[2*t[0],2*t[1]+1,t[2]+1]]}function u(t){return[t[0]>>1,t[1]>>1,t[2]-1]}function h(t){return l(u(t))}function c(t,e){for(var n=h(t),r=0;r0;n--){var r=0,i=1<0;i--){var o=1<>>32-i,s=r[1]>>>32-i;return[o,s,i]}function y(t){for(var e=28,n=0;n(0,h.createScaleFunction)(t,c,x)));if(1===u)return"string"===t?p.bind(null,a,w(r),...k):d.bind(null,a,r,...k);if(2===u)return"string"===t?g.bind(null,a,w(r),...k):m.bind(null,a,r,...k);if(3===u)return"string"===t?_.bind(null,a,w(r),...k):y.bind(null,a,r,...k);if(u>=4)return"string"===t?b.bind(null,a,w(r),...k):v.bind(null,a,r,...k);throw new Error("[pixel-utils/raw-to-rgb] invalid number of bands: "+u)}(function(t){t["[band][row][column]"]="[band][row][column]",t["[band][row,column]"]="[band][row,column]",t["[band,row,column]"]="[band,row,column]",t["[row,column,band]"]="[row,column,band]",t["[row,column][band]"]="[row,column][band]",t["[row][column][band]"]="[row][column][band]",t["[row][column,band]"]="[row][column,band]"})(c||(c={}));var k=n(31501),S=n(57903),M=n(52438),A=n(67062),E=n(47067),C=n(80042),T=n(71743),O=n(94699),P=n(31654);const I=(t,e)=>E(A(t.toString(),e.toString()),"2"),R=t=>Array.isArray(t),j=t=>void 0!==t&&null!==t&&""!==t,N=t=>"function"===typeof t,B=t=>"object"===typeof t,D=t=>"string"===typeof t,F=t=>"number"===typeof t,U=t=>D(t)&&!!t.match(/^[-|+]?[\d\.]+(, ?[-|+]?[\d\.]+){3}$/),z=t=>B(t)&&q(t,["getEast","getNorth","getSouth","getWest"]),G=(t,e)=>B(t)&&N(t[e]),H=(t,e)=>B(t)&&B(t[e]),q=(t,e)=>e.every((e=>G(t,e))),Z=(t,e)=>e.every((e=>H(t,e))),W=(t,e)=>B(t)&&void 0!==t[e]&&null!==t[e],V=(t,e)=>e.every((e=>W(t,e))),Q=t=>R(t)&&t.every(F),K=t=>R(t)&&t.every(D),Y=t=>"object"===typeof obj&&"function"===typeof obj.constructor||void 0,X=t=>{if(!t)return t;if(D(t)&&t.startsWith("EPSG:"))return t;if(D(t)&&t.match(/^\d+$/))return"EPSG:"+t;if(F(t))return"EPSG:"+t;const e=O(t);return F(e)?"EPSG:"+e:t};class J{constructor(t,{srs:e}={}){let n,r,i,o,s,a,l,u;if(this.srs=X(e),Y(t)===this.constructor&&(({xmin:n,xmax:r,ymin:i,ymax:o}=t),j(t.srs)&&(this.srs=X(t.srs))),U(t)&&(t=t.split(/, ?/)),R(t)&&4===t.length&&Q(t))[n,i,r,o]=t;else if(R(t)&&4===t.length&&K(t))[s,l,a,u]=t,[n,i,r,o]=t.map((t=>Number(t)));else if(R(t)&&2===t.length&&t.every(R)&&t.every((t=>2===t.length&&Q(t))))[[i,n],[o,r]]=t;else if(z(t))n=t.getWest(),r=t.getEast(),i=t.getSouth(),o=t.getNorth(),j(this.srs)||(this.srs="EPSG:4326");else if(R(t)&&2===t.length&&t.every((t=>V(t,["x","y"]))))[{x:n,y:i},{x:r,y:o}]=t;else if(B(t)&&V(t,["x","y"])&&F(t.x)&&F(t.y))n=r=t.x,i=o=t.y,W(t,"spatialReference")&&W(t.spatialReference,"wkid")&&(j(this.srs)||(this.srs=X(t.spatialReference.wkid)));else if(B(t)&&V(t,["xmin","xmax","ymin","ymax"])){({xmin:n,xmax:r,ymin:i,ymax:o}=t);const e=["srs","crs","proj","projection"];for(let n=0;n=e.xmin&&n.xmax<=e.xmax,i=n.ymin>=e.ymin&&n.ymax<=e.ymax;return r&&i}crop(t){if(t=new this.constructor(t),!1===this.overlaps(t,{quiet:!0})&&!1===t.overlaps(this,{quiet:!0}))return null;if(t.contains(this))return this.clone();if("EPSG:4326"===t.srs&&(t.xmin<-180||t.xmax>180)){const e=t.unwrap();let n=e.map((t=>this.crop(t)));if(n=n.filter(Boolean),0===n.length)return null;let r=n[0];for(let t=1;tt.toFixed(e))).join(","),i=t.bbox.map((t=>t.toFixed(e))).join(",");return r===i}overlaps(t,{quiet:e=!1}={quite:!1}){try{const[e,n]=this._pre(this,t),r=n.ymin<=e.ymax&&n.ymax>=e.ymin,i=n.xmin<=e.xmax&&n.xmax>=e.xmin;return i&&r}catch(n){if(e)return;throw n}}reproj(t,{quiet:e=!1}={quiet:!1}){if(t=X(t),j(this.srs)&&this.srs===X(t))return this.clone();if(!j(this.srs)){if(e)return;throw new Error(`[geo-extent] cannot reproject ${this.bbox} without a projection set`)}if("EPSG:4326"===this.srs&&(this.xmin<-180||this.xmax>180))try{const e=this.unwrap().map((e=>e.reproj(t)));let n=e[0];for(let t=1;t-180&&n<180)return[this.clone()];if(t<-180&&n>=t+360)return[new this.constructor([-180,e,180,r],{srs:4326})];if(n>180&&t<=n-360)return[new this.constructor([-180,e,180,r],{srs:4326})];let o=[];return t<-180&&o.push(new this.constructor([t+360,e,180,r],{srs:i})),o.push(new this.constructor([t<-180?-180:t,e,n>180?180:n,r],{srs:i})),this.xmax>180&&o.push(new this.constructor([-180,e,n-360,r],{srs:i})),o}asEsriJSON(){return{xmin:this.xmin,ymin:this.ymin,xmax:this.xmax,ymax:this.ymax,spatialReference:{wkid:this.srs}}}asGeoJSON(){const{xmin:t,ymin:e,xmax:n,ymax:r}="EPSG:4326"===this.srs?this:this.reproj(4326);return{type:"Feature",geometry:{type:"Polygon",coordinates:[[[t,r],[n,r],[n,e],[t,e],[t,r]]]}}}asObj(){const t={};for(let e in this){const n=this[e];N(n)||(t[e]=n)}return t}}"function"===typeof define&&define.amd&&define((function(){return J})),"object"===typeof self&&(self.GeoExtent=J),"object"===typeof window&&(window.GeoExtent=J);var $=n(11185);const tt=4326,et=new Set([3785,3857,4269,4326,900913,102113]),nt=1e3,rt=1e3,it=[0,0],ot=t=>console.log("[georaster-layer-for-leaflet] ",t),st=t=>{var e,n,r,i;return t===o.CRS.Simple||!t.code&&t.infinite&&1===(null===t||void 0===t||null===(e=t.transformation)||void 0===e?void 0:e._a)&&0===(null===t||void 0===t||null===(n=t.transformation)||void 0===n?void 0:n._b)&&-1===(null===t||void 0===t||null===(r=t.transformation)||void 0===r?void 0:r._c)&&0===(null===t||void 0===t||null===(i=t.transformation)||void 0===i?void 0:i._d)};s||console.warn("[georaster-layer-for-leaflet] can't find Leaflet. If you are loading via ","import mod from \"-!../@vue/vue-loader-v15/lib/index.js??vue-loader-options!./LControlFullscreen.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../@vue/vue-loader-v15/lib/index.js??vue-loader-options!./LControlFullscreen.vue?vue&type=script&lang=js&\"","import { CRS } from 'leaflet';\nimport STAC from './src/models/stac';\nimport Utils from './src/utils';\n\nconst USGS_ATTRIBUTION = 'USGS Astrogeology';\nconst WMS = 'LWMSTileLayer';\nconst XYZ = 'LTileLayer';\n\nconst BASEMAPS = {\n earth: {\n url: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',\n name: 'OpenStreetMap',\n is: XYZ,\n attribution: '© OpenStreetMap contributors.'\n },\n europa: {\n baseUrl: 'https://planetarymaps.usgs.gov/cgi-bin/mapserv?map=/maps/jupiter/europa_simp_cyl.map',\n is: WMS,\n name: 'USGS Europa',\n attribution: USGS_ATTRIBUTION,\n crs: CRS.EPSG4326,\n format: 'image/png',\n layers: 'GALILEO_VOYAGER'\n },\n mars: {\n baseUrl: 'https://planetarymaps.usgs.gov/cgi-bin/mapserv?map=/maps/mars/mars_simp_cyl.map',\n is: WMS,\n name: 'USGS Mars',\n attribution: USGS_ATTRIBUTION,\n crs: CRS.EPSG4326,\n format: 'image/png',\n layers: 'MDIM21'\n },\n moon: {\n baseUrl: 'https://planetarymaps.usgs.gov/cgi-bin/mapserv?map=/maps/earth/moon_simp_cyl.map',\n is: WMS,\n name: 'USGS Moon',\n attribution: USGS_ATTRIBUTION,\n crs: CRS.EPSG4326,\n format: 'image/png',\n layers: 'LROC_WAC'\n }\n};\n\n/**\n * @typedef BasemapOptions\n * @type {Object}\n * @property {string} is Component: LWMSTileLayer or LTileLayer\n * @see https://vue2-leaflet.netlify.app/components/\n */\n\n/**\n * \n * @param {Object} stac The STAC object\n * @param {Object} map The Leaflet map object\n * @param {Object} i18n Vue I18N object\n * @returns {Array.}\n */\nexport default function configureBasemap(stac, map, i18n) {\n let targets = ['earth'];\n if (stac instanceof STAC) {\n if (stac.isCollection() && Utils.isObject(stac.summaries) && Array.isArray(stac.summaries['ssys:targets'])) {\n targets = stac.summaries['ssys:targets'];\n }\n else if (stac.isCollection() && Array.isArray(stac['ssys:targets'])) {\n targets = stac['ssys:targets'];\n }\n else if (stac.isItem() && Array.isArray(stac.properties['ssys:targets'])) {\n targets = stac.properties['ssys:targets'];\n }\n }\n\n return targets.map(target => BASEMAPS[target.toLowerCase()]);\n};","\n\n\n\n\n","import mod from \"-!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!../../node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./Map.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!../../node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./Map.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./Map.vue?vue&type=template&id=286c2a7f&\"\nimport script from \"./Map.vue?vue&type=script&lang=js&\"\nexport * from \"./Map.vue?vue&type=script&lang=js&\"\nimport style0 from \"./Map.vue?vue&type=style&index=0&id=286c2a7f&prod&lang=scss&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/@vue/vue-loader-v15/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","/* This is based on https://github.com/heyman/leaflet-areaselect from @heymen\n * with contributions from @lweller and @ebrensi */\n\n/* eslint-disable no-undef */\n\nL.AreaSelect = L.Class.extend({\n includes: L.Evented.prototype,\n\n options: {\n width: 200,\n height: 300,\n minWidth: 30,\n minHeight: 30,\n minHorizontalSpacing: 30,\n minVerticalSpacing: 30,\n keepAspectRatio: false,\n },\n\n initialize: function (options) {\n L.Util.setOptions(this, options);\n\n this._width = this.options.width;\n this._height = this.options.height;\n },\n\n addTo: function (map) {\n this.map = map;\n if (this._container) { this.map._controlContainer.appendChild(this._container); }\n else { this._createElements(); }\n this.map.on(\"moveend\", this._onMapChange, this);\n this.map.on(\"zoomend\", this._onMapChange, this);\n this.map.on(\"resize\", this._onMapResize, this);\n\n this.fire(\"change\");\n this._render();\n return this;\n },\n\n getBounds: function () {\n const size = this.map.getSize();\n const topRight = new L.Point();\n const bottomLeft = new L.Point();\n\n bottomLeft.x = Math.round((size.x - this._width) / 2);\n topRight.y = Math.round((size.y - this._height) / 2);\n topRight.x = size.x - bottomLeft.x;\n bottomLeft.y = size.y - topRight.y;\n\n const sw = this.map.containerPointToLatLng(bottomLeft);\n const ne = this.map.containerPointToLatLng(topRight);\n\n return new L.LatLngBounds(sw, ne);\n },\n\n getBBoxCoordinates: function () {\n const size = this.map.getSize();\n\n const topRight = new L.Point();\n const bottomLeft = new L.Point();\n const topLeft = new L.Point();\n const bottomRight = new L.Point();\n\n bottomLeft.x = Math.round((size.x - this._width) / 2);\n topRight.y = Math.round((size.y - this._height) / 2);\n topRight.x = size.x - bottomLeft.x;\n bottomLeft.y = size.y - topRight.y;\n\n topLeft.x = bottomLeft.x;\n topLeft.y = topRight.y;\n bottomRight.x = topRight.x;\n bottomRight.y = bottomLeft.y;\n\n const coordinates = [\n { sw: this.map.containerPointToLatLng(bottomLeft) },\n { nw: this.map.containerPointToLatLng(topLeft) },\n { ne: this.map.containerPointToLatLng(topRight) },\n { se: this.map.containerPointToLatLng(bottomRight) },\n ];\n\n return coordinates;\n },\n\n remove: function () {\n this.map.off(\"moveend\", this._onMapChange);\n this.map.off(\"zoomend\", this._onMapChange);\n this.map.off(\"resize\", this._onMapResize);\n\n this._container.parentNode.removeChild(this._container);\n },\n\n setDimensions: function (dimensions) {\n if (!dimensions) { return; }\n\n this._height = parseInt(dimensions.height) || this._height;\n this._width = parseInt(dimensions.width) || this._width;\n this._render();\n this.fire(\"change\");\n },\n\n _createElements: function () {\n if (this._container) { return; }\n\n this._container = L.DomUtil.create(\n \"div\",\n \"leaflet-areaselect-container\",\n this.map._controlContainer\n );\n this._topShade = L.DomUtil.create(\n \"div\",\n \"leaflet-areaselect-shade leaflet-control\",\n this._container\n );\n this._bottomShade = L.DomUtil.create(\n \"div\",\n \"leaflet-areaselect-shade leaflet-control\",\n this._container\n );\n this._leftShade = L.DomUtil.create(\n \"div\",\n \"leaflet-areaselect-shade leaflet-control\",\n this._container\n );\n this._rightShade = L.DomUtil.create(\n \"div\",\n \"leaflet-areaselect-shade leaflet-control\",\n this._container\n );\n\n this._nwHandle = L.DomUtil.create(\n \"div\",\n \"leaflet-areaselect-handle leaflet-control\",\n this._container\n );\n this._swHandle = L.DomUtil.create(\n \"div\",\n \"leaflet-areaselect-handle leaflet-control\",\n this._container\n );\n this._neHandle = L.DomUtil.create(\n \"div\",\n \"leaflet-areaselect-handle leaflet-control\",\n this._container\n );\n this._seHandle = L.DomUtil.create(\n \"div\",\n \"leaflet-areaselect-handle leaflet-control\",\n this._container\n );\n\n this._setUpHandlerEvents(this._nwHandle);\n this._setUpHandlerEvents(this._neHandle, -1, 1);\n this._setUpHandlerEvents(this._swHandle, 1, -1);\n this._setUpHandlerEvents(this._seHandle, -1, -1);\n },\n\n _setUpHandlerEvents: function (handle, xMod, yMod) {\n xMod = xMod || 1;\n yMod = yMod || 1;\n\n const self = this;\n function onPointerDown(event) {\n event.stopPropagation();\n event.preventDefault();\n self.map.dragging.disable();\n L.DomEvent.removeListener(this, \"onpointerdown\", onPointerDown);\n let curX = event.pageX;\n let curY = event.pageY;\n const ratio = self._width / self._height;\n const size = self.map.getSize();\n const mapContainer = self.map.getContainer();\n\n function onPointerMove(event) {\n if (self.options.keepAspectRatio) {\n const maxHeight =\n (self._height >= self._width ? size.y : size.y * (1 / ratio)) -\n Math.max(\n self.options.minVerticalSpacing,\n self.options.minHorizontalSpacing\n );\n self._height += (curY - event.pageY) * 2 * yMod;\n self._height = Math.max(\n self.options.minHeight,\n self.options.minWidth,\n self._height\n );\n self._height = Math.min(maxHeight, self._height);\n self._width = self._height * ratio;\n } else {\n self._width += (curX - event.pageX) * 2 * xMod;\n self._height += (curY - event.pageY) * 2 * yMod;\n self._width = Math.max(self.options.minWidth, self._width);\n self._height = Math.max(self.options.minHeight, self._height);\n self._width = Math.min(\n size.x - self.options.minHorizontalSpacing,\n self._width\n );\n self._height = Math.min(\n size.y - self.options.minVerticalSpacing,\n self._height\n );\n }\n\n curX = event.pageX;\n curY = event.pageY;\n self._render();\n }\n function onPointerUp() {\n self.map.dragging.enable();\n L.DomEvent.removeListener(mapContainer, \"pointerup\", onPointerUp);\n L.DomEvent.removeListener(mapContainer, \"pointermove\", onPointerMove);\n L.DomEvent.addListener(handle, \"pointerdown\", onPointerDown);\n self.fire(\"change\");\n }\n L.DomEvent.addListener(mapContainer, \"pointermove\", onPointerMove);\n L.DomEvent.addListener(mapContainer, \"pointerup\", onPointerUp);\n }\n L.DomEvent.addListener(handle, \"pointerdown\", onPointerDown);\n },\n\n _onMapResize: function () {\n this._render();\n },\n\n _onMapChange: function () {\n this.fire(\"change\");\n },\n\n _render: function () {\n const size = this.map.getSize();\n const handleOffset = Math.round(this._nwHandle.offsetWidth / 2);\n\n var topBottomWidth = size.x;\n var topBottomHeight = Math.round((size.y - this._height) / 2);\n var leftRightWidth = Math.round((size.x - this._width) / 2);\n var leftRightHeight = size.y - (topBottomHeight * 2);\n\n function setDimensions(element, dimension) {\n element.style.width = dimension.width + \"px\";\n element.style.height = dimension.height + \"px\";\n element.style.top = dimension.top + \"px\";\n element.style.left = dimension.left + \"px\";\n element.style.bottom = dimension.bottom + \"px\";\n element.style.right = dimension.right + \"px\";\n }\n\n setDimensions(this._topShade, {\n width: topBottomWidth,\n height: topBottomHeight,\n top: 0,\n left: 0\n });\n setDimensions(this._bottomShade, {\n width: topBottomWidth,\n height: topBottomHeight,\n top: size.y - topBottomHeight,\n left: 0\n });\n setDimensions(this._leftShade, {\n width: leftRightWidth,\n height: leftRightHeight,\n top: topBottomHeight,\n left: 0\n });\n setDimensions(this._rightShade, {\n width: leftRightWidth,\n height: leftRightHeight,\n top: topBottomHeight,\n left: size.x - leftRightWidth\n });\n\n setDimensions(this._nwHandle, {\n left: leftRightWidth - handleOffset,\n top: topBottomHeight - 7,\n });\n setDimensions(this._neHandle, {\n right: leftRightWidth - handleOffset,\n top: topBottomHeight - 7,\n });\n setDimensions(this._swHandle, {\n left: leftRightWidth - handleOffset,\n bottom: topBottomHeight - 7,\n });\n setDimensions(this._seHandle, {\n right: leftRightWidth - handleOffset,\n bottom: topBottomHeight - 7,\n });\n },\n});\n\nL.areaSelect = function (options) {\n return new L.AreaSelect(options);\n};\n","\n/**\n * @license\n *\n * chroma.js - JavaScript library for color conversions\n * \n * Copyright (c) 2011-2017, Gregor Aisch\n * All rights reserved.\n * \n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n * \n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n * \n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n * \n * 3. The name Gregor Aisch may not be used to endorse or promote products\n * derived from this software without specific prior written permission.\n * \n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL GREGOR AISCH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,\n * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\n * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *\n */\n\n(function() {\n var Color, DEG2RAD, LAB_CONSTANTS, PI, PITHIRD, RAD2DEG, TWOPI, _average_lrgb, _guess_formats, _guess_formats_sorted, _input, _interpolators, abs, atan2, bezier, blend, blend_f, brewer, burn, chroma, clip_rgb, cmyk2rgb, colors, cos, css2rgb, darken, dodge, each, floor, hcg2rgb, hex2rgb, hsi2rgb, hsl2css, hsl2rgb, hsv2rgb, interpolate, interpolate_hsx, interpolate_lab, interpolate_lrgb, interpolate_num, interpolate_rgb, lab2lch, lab2rgb, lab_xyz, lch2lab, lch2rgb, lighten, limit, log, luminance_x, m, max, multiply, normal, num2rgb, overlay, pow, rgb2cmyk, rgb2css, rgb2hcg, rgb2hex, rgb2hsi, rgb2hsl, rgb2hsv, rgb2lab, rgb2lch, rgb2luminance, rgb2num, rgb2temperature, rgb2xyz, rgb_xyz, rnd, root, round, screen, sin, sqrt, temperature2rgb, type, unpack, w3cx11, xyz_lab, xyz_rgb,\n slice = [].slice;\n\n type = (function() {\n\n /*\n for browser-safe type checking+\n ported from jQuery's $.type\n */\n var classToType, len, name, o, ref;\n classToType = {};\n ref = \"Boolean Number String Function Array Date RegExp Undefined Null\".split(\" \");\n for (o = 0, len = ref.length; o < len; o++) {\n name = ref[o];\n classToType[\"[object \" + name + \"]\"] = name.toLowerCase();\n }\n return function(obj) {\n var strType;\n strType = Object.prototype.toString.call(obj);\n return classToType[strType] || \"object\";\n };\n })();\n\n limit = function(x, min, max) {\n if (min == null) {\n min = 0;\n }\n if (max == null) {\n max = 1;\n }\n if (x < min) {\n x = min;\n }\n if (x > max) {\n x = max;\n }\n return x;\n };\n\n unpack = function(args) {\n if (args.length >= 3) {\n return Array.prototype.slice.call(args);\n } else {\n return args[0];\n }\n };\n\n clip_rgb = function(rgb) {\n var i, o;\n rgb._clipped = false;\n rgb._unclipped = rgb.slice(0);\n for (i = o = 0; o < 3; i = ++o) {\n if (i < 3) {\n if (rgb[i] < 0 || rgb[i] > 255) {\n rgb._clipped = true;\n }\n if (rgb[i] < 0) {\n rgb[i] = 0;\n }\n if (rgb[i] > 255) {\n rgb[i] = 255;\n }\n } else if (i === 3) {\n if (rgb[i] < 0) {\n rgb[i] = 0;\n }\n if (rgb[i] > 1) {\n rgb[i] = 1;\n }\n }\n }\n if (!rgb._clipped) {\n delete rgb._unclipped;\n }\n return rgb;\n };\n\n PI = Math.PI, round = Math.round, cos = Math.cos, floor = Math.floor, pow = Math.pow, log = Math.log, sin = Math.sin, sqrt = Math.sqrt, atan2 = Math.atan2, max = Math.max, abs = Math.abs;\n\n TWOPI = PI * 2;\n\n PITHIRD = PI / 3;\n\n DEG2RAD = PI / 180;\n\n RAD2DEG = 180 / PI;\n\n chroma = function() {\n if (arguments[0] instanceof Color) {\n return arguments[0];\n }\n return (function(func, args, ctor) {\n ctor.prototype = func.prototype;\n var child = new ctor, result = func.apply(child, args);\n return Object(result) === result ? result : child;\n })(Color, arguments, function(){});\n };\n\n chroma[\"default\"] = chroma;\n\n _interpolators = [];\n\n if ((typeof module !== \"undefined\" && module !== null) && (module.exports != null)) {\n module.exports = chroma;\n }\n\n if (typeof define === 'function' && define.amd) {\n define([], function() {\n return chroma;\n });\n } else {\n root = typeof exports !== \"undefined\" && exports !== null ? exports : this;\n root.chroma = chroma;\n }\n\n chroma.version = '1.4.1';\n\n _input = {};\n\n _guess_formats = [];\n\n _guess_formats_sorted = false;\n\n Color = (function() {\n function Color() {\n var arg, args, chk, len, len1, me, mode, o, w;\n me = this;\n args = [];\n for (o = 0, len = arguments.length; o < len; o++) {\n arg = arguments[o];\n if (arg != null) {\n args.push(arg);\n }\n }\n if (args.length > 1) {\n mode = args[args.length - 1];\n }\n if (_input[mode] != null) {\n me._rgb = clip_rgb(_input[mode](unpack(args.slice(0, -1))));\n } else {\n if (!_guess_formats_sorted) {\n _guess_formats = _guess_formats.sort(function(a, b) {\n return b.p - a.p;\n });\n _guess_formats_sorted = true;\n }\n for (w = 0, len1 = _guess_formats.length; w < len1; w++) {\n chk = _guess_formats[w];\n mode = chk.test.apply(chk, args);\n if (mode) {\n break;\n }\n }\n if (mode) {\n me._rgb = clip_rgb(_input[mode].apply(_input, args));\n }\n }\n if (me._rgb == null) {\n console.warn('unknown format: ' + args);\n }\n if (me._rgb == null) {\n me._rgb = [0, 0, 0];\n }\n if (me._rgb.length === 3) {\n me._rgb.push(1);\n }\n }\n\n Color.prototype.toString = function() {\n return this.hex();\n };\n\n return Color;\n\n })();\n\n chroma._input = _input;\n\n\n /**\n \tColorBrewer colors for chroma.js\n \n \tCopyright (c) 2002 Cynthia Brewer, Mark Harrower, and The \n \tPennsylvania State University.\n \n \tLicensed under the Apache License, Version 2.0 (the \"License\"); \n \tyou may not use this file except in compliance with the License.\n \tYou may obtain a copy of the License at\t\n \thttp://www.apache.org/licenses/LICENSE-2.0\n \n \tUnless required by applicable law or agreed to in writing, software distributed\n \tunder the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n \tCONDITIONS OF ANY KIND, either express or implied. See the License for the\n \tspecific language governing permissions and limitations under the License.\n \n @preserve\n */\n\n chroma.brewer = brewer = {\n OrRd: ['#fff7ec', '#fee8c8', '#fdd49e', '#fdbb84', '#fc8d59', '#ef6548', '#d7301f', '#b30000', '#7f0000'],\n PuBu: ['#fff7fb', '#ece7f2', '#d0d1e6', '#a6bddb', '#74a9cf', '#3690c0', '#0570b0', '#045a8d', '#023858'],\n BuPu: ['#f7fcfd', '#e0ecf4', '#bfd3e6', '#9ebcda', '#8c96c6', '#8c6bb1', '#88419d', '#810f7c', '#4d004b'],\n Oranges: ['#fff5eb', '#fee6ce', '#fdd0a2', '#fdae6b', '#fd8d3c', '#f16913', '#d94801', '#a63603', '#7f2704'],\n BuGn: ['#f7fcfd', '#e5f5f9', '#ccece6', '#99d8c9', '#66c2a4', '#41ae76', '#238b45', '#006d2c', '#00441b'],\n YlOrBr: ['#ffffe5', '#fff7bc', '#fee391', '#fec44f', '#fe9929', '#ec7014', '#cc4c02', '#993404', '#662506'],\n YlGn: ['#ffffe5', '#f7fcb9', '#d9f0a3', '#addd8e', '#78c679', '#41ab5d', '#238443', '#006837', '#004529'],\n Reds: ['#fff5f0', '#fee0d2', '#fcbba1', '#fc9272', '#fb6a4a', '#ef3b2c', '#cb181d', '#a50f15', '#67000d'],\n RdPu: ['#fff7f3', '#fde0dd', '#fcc5c0', '#fa9fb5', '#f768a1', '#dd3497', '#ae017e', '#7a0177', '#49006a'],\n Greens: ['#f7fcf5', '#e5f5e0', '#c7e9c0', '#a1d99b', '#74c476', '#41ab5d', '#238b45', '#006d2c', '#00441b'],\n YlGnBu: ['#ffffd9', '#edf8b1', '#c7e9b4', '#7fcdbb', '#41b6c4', '#1d91c0', '#225ea8', '#253494', '#081d58'],\n Purples: ['#fcfbfd', '#efedf5', '#dadaeb', '#bcbddc', '#9e9ac8', '#807dba', '#6a51a3', '#54278f', '#3f007d'],\n GnBu: ['#f7fcf0', '#e0f3db', '#ccebc5', '#a8ddb5', '#7bccc4', '#4eb3d3', '#2b8cbe', '#0868ac', '#084081'],\n Greys: ['#ffffff', '#f0f0f0', '#d9d9d9', '#bdbdbd', '#969696', '#737373', '#525252', '#252525', '#000000'],\n YlOrRd: ['#ffffcc', '#ffeda0', '#fed976', '#feb24c', '#fd8d3c', '#fc4e2a', '#e31a1c', '#bd0026', '#800026'],\n PuRd: ['#f7f4f9', '#e7e1ef', '#d4b9da', '#c994c7', '#df65b0', '#e7298a', '#ce1256', '#980043', '#67001f'],\n Blues: ['#f7fbff', '#deebf7', '#c6dbef', '#9ecae1', '#6baed6', '#4292c6', '#2171b5', '#08519c', '#08306b'],\n PuBuGn: ['#fff7fb', '#ece2f0', '#d0d1e6', '#a6bddb', '#67a9cf', '#3690c0', '#02818a', '#016c59', '#014636'],\n Viridis: ['#440154', '#482777', '#3f4a8a', '#31678e', '#26838f', '#1f9d8a', '#6cce5a', '#b6de2b', '#fee825'],\n Spectral: ['#9e0142', '#d53e4f', '#f46d43', '#fdae61', '#fee08b', '#ffffbf', '#e6f598', '#abdda4', '#66c2a5', '#3288bd', '#5e4fa2'],\n RdYlGn: ['#a50026', '#d73027', '#f46d43', '#fdae61', '#fee08b', '#ffffbf', '#d9ef8b', '#a6d96a', '#66bd63', '#1a9850', '#006837'],\n RdBu: ['#67001f', '#b2182b', '#d6604d', '#f4a582', '#fddbc7', '#f7f7f7', '#d1e5f0', '#92c5de', '#4393c3', '#2166ac', '#053061'],\n PiYG: ['#8e0152', '#c51b7d', '#de77ae', '#f1b6da', '#fde0ef', '#f7f7f7', '#e6f5d0', '#b8e186', '#7fbc41', '#4d9221', '#276419'],\n PRGn: ['#40004b', '#762a83', '#9970ab', '#c2a5cf', '#e7d4e8', '#f7f7f7', '#d9f0d3', '#a6dba0', '#5aae61', '#1b7837', '#00441b'],\n RdYlBu: ['#a50026', '#d73027', '#f46d43', '#fdae61', '#fee090', '#ffffbf', '#e0f3f8', '#abd9e9', '#74add1', '#4575b4', '#313695'],\n BrBG: ['#543005', '#8c510a', '#bf812d', '#dfc27d', '#f6e8c3', '#f5f5f5', '#c7eae5', '#80cdc1', '#35978f', '#01665e', '#003c30'],\n RdGy: ['#67001f', '#b2182b', '#d6604d', '#f4a582', '#fddbc7', '#ffffff', '#e0e0e0', '#bababa', '#878787', '#4d4d4d', '#1a1a1a'],\n PuOr: ['#7f3b08', '#b35806', '#e08214', '#fdb863', '#fee0b6', '#f7f7f7', '#d8daeb', '#b2abd2', '#8073ac', '#542788', '#2d004b'],\n Set2: ['#66c2a5', '#fc8d62', '#8da0cb', '#e78ac3', '#a6d854', '#ffd92f', '#e5c494', '#b3b3b3'],\n Accent: ['#7fc97f', '#beaed4', '#fdc086', '#ffff99', '#386cb0', '#f0027f', '#bf5b17', '#666666'],\n Set1: ['#e41a1c', '#377eb8', '#4daf4a', '#984ea3', '#ff7f00', '#ffff33', '#a65628', '#f781bf', '#999999'],\n Set3: ['#8dd3c7', '#ffffb3', '#bebada', '#fb8072', '#80b1d3', '#fdb462', '#b3de69', '#fccde5', '#d9d9d9', '#bc80bd', '#ccebc5', '#ffed6f'],\n Dark2: ['#1b9e77', '#d95f02', '#7570b3', '#e7298a', '#66a61e', '#e6ab02', '#a6761d', '#666666'],\n Paired: ['#a6cee3', '#1f78b4', '#b2df8a', '#33a02c', '#fb9a99', '#e31a1c', '#fdbf6f', '#ff7f00', '#cab2d6', '#6a3d9a', '#ffff99', '#b15928'],\n Pastel2: ['#b3e2cd', '#fdcdac', '#cbd5e8', '#f4cae4', '#e6f5c9', '#fff2ae', '#f1e2cc', '#cccccc'],\n Pastel1: ['#fbb4ae', '#b3cde3', '#ccebc5', '#decbe4', '#fed9a6', '#ffffcc', '#e5d8bd', '#fddaec', '#f2f2f2']\n };\n\n (function() {\n var key, results;\n results = [];\n for (key in brewer) {\n results.push(brewer[key.toLowerCase()] = brewer[key]);\n }\n return results;\n })();\n\n\n /**\n \tX11 color names\n \n \thttp://www.w3.org/TR/css3-color/#svg-color\n */\n\n w3cx11 = {\n aliceblue: '#f0f8ff',\n antiquewhite: '#faebd7',\n aqua: '#00ffff',\n aquamarine: '#7fffd4',\n azure: '#f0ffff',\n beige: '#f5f5dc',\n bisque: '#ffe4c4',\n black: '#000000',\n blanchedalmond: '#ffebcd',\n blue: '#0000ff',\n blueviolet: '#8a2be2',\n brown: '#a52a2a',\n burlywood: '#deb887',\n cadetblue: '#5f9ea0',\n chartreuse: '#7fff00',\n chocolate: '#d2691e',\n coral: '#ff7f50',\n cornflower: '#6495ed',\n cornflowerblue: '#6495ed',\n cornsilk: '#fff8dc',\n crimson: '#dc143c',\n cyan: '#00ffff',\n darkblue: '#00008b',\n darkcyan: '#008b8b',\n darkgoldenrod: '#b8860b',\n darkgray: '#a9a9a9',\n darkgreen: '#006400',\n darkgrey: '#a9a9a9',\n darkkhaki: '#bdb76b',\n darkmagenta: '#8b008b',\n darkolivegreen: '#556b2f',\n darkorange: '#ff8c00',\n darkorchid: '#9932cc',\n darkred: '#8b0000',\n darksalmon: '#e9967a',\n darkseagreen: '#8fbc8f',\n darkslateblue: '#483d8b',\n darkslategray: '#2f4f4f',\n darkslategrey: '#2f4f4f',\n darkturquoise: '#00ced1',\n darkviolet: '#9400d3',\n deeppink: '#ff1493',\n deepskyblue: '#00bfff',\n dimgray: '#696969',\n dimgrey: '#696969',\n dodgerblue: '#1e90ff',\n firebrick: '#b22222',\n floralwhite: '#fffaf0',\n forestgreen: '#228b22',\n fuchsia: '#ff00ff',\n gainsboro: '#dcdcdc',\n ghostwhite: '#f8f8ff',\n gold: '#ffd700',\n goldenrod: '#daa520',\n gray: '#808080',\n green: '#008000',\n greenyellow: '#adff2f',\n grey: '#808080',\n honeydew: '#f0fff0',\n hotpink: '#ff69b4',\n indianred: '#cd5c5c',\n indigo: '#4b0082',\n ivory: '#fffff0',\n khaki: '#f0e68c',\n laserlemon: '#ffff54',\n lavender: '#e6e6fa',\n lavenderblush: '#fff0f5',\n lawngreen: '#7cfc00',\n lemonchiffon: '#fffacd',\n lightblue: '#add8e6',\n lightcoral: '#f08080',\n lightcyan: '#e0ffff',\n lightgoldenrod: '#fafad2',\n lightgoldenrodyellow: '#fafad2',\n lightgray: '#d3d3d3',\n lightgreen: '#90ee90',\n lightgrey: '#d3d3d3',\n lightpink: '#ffb6c1',\n lightsalmon: '#ffa07a',\n lightseagreen: '#20b2aa',\n lightskyblue: '#87cefa',\n lightslategray: '#778899',\n lightslategrey: '#778899',\n lightsteelblue: '#b0c4de',\n lightyellow: '#ffffe0',\n lime: '#00ff00',\n limegreen: '#32cd32',\n linen: '#faf0e6',\n magenta: '#ff00ff',\n maroon: '#800000',\n maroon2: '#7f0000',\n maroon3: '#b03060',\n mediumaquamarine: '#66cdaa',\n mediumblue: '#0000cd',\n mediumorchid: '#ba55d3',\n mediumpurple: '#9370db',\n mediumseagreen: '#3cb371',\n mediumslateblue: '#7b68ee',\n mediumspringgreen: '#00fa9a',\n mediumturquoise: '#48d1cc',\n mediumvioletred: '#c71585',\n midnightblue: '#191970',\n mintcream: '#f5fffa',\n mistyrose: '#ffe4e1',\n moccasin: '#ffe4b5',\n navajowhite: '#ffdead',\n navy: '#000080',\n oldlace: '#fdf5e6',\n olive: '#808000',\n olivedrab: '#6b8e23',\n orange: '#ffa500',\n orangered: '#ff4500',\n orchid: '#da70d6',\n palegoldenrod: '#eee8aa',\n palegreen: '#98fb98',\n paleturquoise: '#afeeee',\n palevioletred: '#db7093',\n papayawhip: '#ffefd5',\n peachpuff: '#ffdab9',\n peru: '#cd853f',\n pink: '#ffc0cb',\n plum: '#dda0dd',\n powderblue: '#b0e0e6',\n purple: '#800080',\n purple2: '#7f007f',\n purple3: '#a020f0',\n rebeccapurple: '#663399',\n red: '#ff0000',\n rosybrown: '#bc8f8f',\n royalblue: '#4169e1',\n saddlebrown: '#8b4513',\n salmon: '#fa8072',\n sandybrown: '#f4a460',\n seagreen: '#2e8b57',\n seashell: '#fff5ee',\n sienna: '#a0522d',\n silver: '#c0c0c0',\n skyblue: '#87ceeb',\n slateblue: '#6a5acd',\n slategray: '#708090',\n slategrey: '#708090',\n snow: '#fffafa',\n springgreen: '#00ff7f',\n steelblue: '#4682b4',\n tan: '#d2b48c',\n teal: '#008080',\n thistle: '#d8bfd8',\n tomato: '#ff6347',\n turquoise: '#40e0d0',\n violet: '#ee82ee',\n wheat: '#f5deb3',\n white: '#ffffff',\n whitesmoke: '#f5f5f5',\n yellow: '#ffff00',\n yellowgreen: '#9acd32'\n };\n\n chroma.colors = colors = w3cx11;\n\n lab2rgb = function() {\n var a, args, b, g, l, r, x, y, z;\n args = unpack(arguments);\n l = args[0], a = args[1], b = args[2];\n y = (l + 16) / 116;\n x = isNaN(a) ? y : y + a / 500;\n z = isNaN(b) ? y : y - b / 200;\n y = LAB_CONSTANTS.Yn * lab_xyz(y);\n x = LAB_CONSTANTS.Xn * lab_xyz(x);\n z = LAB_CONSTANTS.Zn * lab_xyz(z);\n r = xyz_rgb(3.2404542 * x - 1.5371385 * y - 0.4985314 * z);\n g = xyz_rgb(-0.9692660 * x + 1.8760108 * y + 0.0415560 * z);\n b = xyz_rgb(0.0556434 * x - 0.2040259 * y + 1.0572252 * z);\n return [r, g, b, args.length > 3 ? args[3] : 1];\n };\n\n xyz_rgb = function(r) {\n return 255 * (r <= 0.00304 ? 12.92 * r : 1.055 * pow(r, 1 / 2.4) - 0.055);\n };\n\n lab_xyz = function(t) {\n if (t > LAB_CONSTANTS.t1) {\n return t * t * t;\n } else {\n return LAB_CONSTANTS.t2 * (t - LAB_CONSTANTS.t0);\n }\n };\n\n LAB_CONSTANTS = {\n Kn: 18,\n Xn: 0.950470,\n Yn: 1,\n Zn: 1.088830,\n t0: 0.137931034,\n t1: 0.206896552,\n t2: 0.12841855,\n t3: 0.008856452\n };\n\n rgb2lab = function() {\n var b, g, r, ref, ref1, x, y, z;\n ref = unpack(arguments), r = ref[0], g = ref[1], b = ref[2];\n ref1 = rgb2xyz(r, g, b), x = ref1[0], y = ref1[1], z = ref1[2];\n return [116 * y - 16, 500 * (x - y), 200 * (y - z)];\n };\n\n rgb_xyz = function(r) {\n if ((r /= 255) <= 0.04045) {\n return r / 12.92;\n } else {\n return pow((r + 0.055) / 1.055, 2.4);\n }\n };\n\n xyz_lab = function(t) {\n if (t > LAB_CONSTANTS.t3) {\n return pow(t, 1 / 3);\n } else {\n return t / LAB_CONSTANTS.t2 + LAB_CONSTANTS.t0;\n }\n };\n\n rgb2xyz = function() {\n var b, g, r, ref, x, y, z;\n ref = unpack(arguments), r = ref[0], g = ref[1], b = ref[2];\n r = rgb_xyz(r);\n g = rgb_xyz(g);\n b = rgb_xyz(b);\n x = xyz_lab((0.4124564 * r + 0.3575761 * g + 0.1804375 * b) / LAB_CONSTANTS.Xn);\n y = xyz_lab((0.2126729 * r + 0.7151522 * g + 0.0721750 * b) / LAB_CONSTANTS.Yn);\n z = xyz_lab((0.0193339 * r + 0.1191920 * g + 0.9503041 * b) / LAB_CONSTANTS.Zn);\n return [x, y, z];\n };\n\n chroma.lab = function() {\n return (function(func, args, ctor) {\n ctor.prototype = func.prototype;\n var child = new ctor, result = func.apply(child, args);\n return Object(result) === result ? result : child;\n })(Color, slice.call(arguments).concat(['lab']), function(){});\n };\n\n _input.lab = lab2rgb;\n\n Color.prototype.lab = function() {\n return rgb2lab(this._rgb);\n };\n\n bezier = function(colors) {\n var I, I0, I1, c, lab0, lab1, lab2, lab3, ref, ref1, ref2;\n colors = (function() {\n var len, o, results;\n results = [];\n for (o = 0, len = colors.length; o < len; o++) {\n c = colors[o];\n results.push(chroma(c));\n }\n return results;\n })();\n if (colors.length === 2) {\n ref = (function() {\n var len, o, results;\n results = [];\n for (o = 0, len = colors.length; o < len; o++) {\n c = colors[o];\n results.push(c.lab());\n }\n return results;\n })(), lab0 = ref[0], lab1 = ref[1];\n I = function(t) {\n var i, lab;\n lab = (function() {\n var o, results;\n results = [];\n for (i = o = 0; o <= 2; i = ++o) {\n results.push(lab0[i] + t * (lab1[i] - lab0[i]));\n }\n return results;\n })();\n return chroma.lab.apply(chroma, lab);\n };\n } else if (colors.length === 3) {\n ref1 = (function() {\n var len, o, results;\n results = [];\n for (o = 0, len = colors.length; o < len; o++) {\n c = colors[o];\n results.push(c.lab());\n }\n return results;\n })(), lab0 = ref1[0], lab1 = ref1[1], lab2 = ref1[2];\n I = function(t) {\n var i, lab;\n lab = (function() {\n var o, results;\n results = [];\n for (i = o = 0; o <= 2; i = ++o) {\n results.push((1 - t) * (1 - t) * lab0[i] + 2 * (1 - t) * t * lab1[i] + t * t * lab2[i]);\n }\n return results;\n })();\n return chroma.lab.apply(chroma, lab);\n };\n } else if (colors.length === 4) {\n ref2 = (function() {\n var len, o, results;\n results = [];\n for (o = 0, len = colors.length; o < len; o++) {\n c = colors[o];\n results.push(c.lab());\n }\n return results;\n })(), lab0 = ref2[0], lab1 = ref2[1], lab2 = ref2[2], lab3 = ref2[3];\n I = function(t) {\n var i, lab;\n lab = (function() {\n var o, results;\n results = [];\n for (i = o = 0; o <= 2; i = ++o) {\n results.push((1 - t) * (1 - t) * (1 - t) * lab0[i] + 3 * (1 - t) * (1 - t) * t * lab1[i] + 3 * (1 - t) * t * t * lab2[i] + t * t * t * lab3[i]);\n }\n return results;\n })();\n return chroma.lab.apply(chroma, lab);\n };\n } else if (colors.length === 5) {\n I0 = bezier(colors.slice(0, 3));\n I1 = bezier(colors.slice(2, 5));\n I = function(t) {\n if (t < 0.5) {\n return I0(t * 2);\n } else {\n return I1((t - 0.5) * 2);\n }\n };\n }\n return I;\n };\n\n chroma.bezier = function(colors) {\n var f;\n f = bezier(colors);\n f.scale = function() {\n return chroma.scale(f);\n };\n return f;\n };\n\n chroma.cubehelix = function(start, rotations, hue, gamma, lightness) {\n var dh, dl, f;\n if (start == null) {\n start = 300;\n }\n if (rotations == null) {\n rotations = -1.5;\n }\n if (hue == null) {\n hue = 1;\n }\n if (gamma == null) {\n gamma = 1;\n }\n if (lightness == null) {\n lightness = [0, 1];\n }\n dh = 0;\n if (type(lightness) === 'array') {\n dl = lightness[1] - lightness[0];\n } else {\n dl = 0;\n lightness = [lightness, lightness];\n }\n f = function(fract) {\n var a, amp, b, cos_a, g, h, l, r, sin_a;\n a = TWOPI * ((start + 120) / 360 + rotations * fract);\n l = pow(lightness[0] + dl * fract, gamma);\n h = dh !== 0 ? hue[0] + fract * dh : hue;\n amp = h * l * (1 - l) / 2;\n cos_a = cos(a);\n sin_a = sin(a);\n r = l + amp * (-0.14861 * cos_a + 1.78277 * sin_a);\n g = l + amp * (-0.29227 * cos_a - 0.90649 * sin_a);\n b = l + amp * (+1.97294 * cos_a);\n return chroma(clip_rgb([r * 255, g * 255, b * 255, 1]));\n };\n f.start = function(s) {\n if (s == null) {\n return start;\n }\n start = s;\n return f;\n };\n f.rotations = function(r) {\n if (r == null) {\n return rotations;\n }\n rotations = r;\n return f;\n };\n f.gamma = function(g) {\n if (g == null) {\n return gamma;\n }\n gamma = g;\n return f;\n };\n f.hue = function(h) {\n if (h == null) {\n return hue;\n }\n hue = h;\n if (type(hue) === 'array') {\n dh = hue[1] - hue[0];\n if (dh === 0) {\n hue = hue[1];\n }\n } else {\n dh = 0;\n }\n return f;\n };\n f.lightness = function(h) {\n if (h == null) {\n return lightness;\n }\n if (type(h) === 'array') {\n lightness = h;\n dl = h[1] - h[0];\n } else {\n lightness = [h, h];\n dl = 0;\n }\n return f;\n };\n f.scale = function() {\n return chroma.scale(f);\n };\n f.hue(hue);\n return f;\n };\n\n chroma.random = function() {\n var code, digits, i, o;\n digits = '0123456789abcdef';\n code = '#';\n for (i = o = 0; o < 6; i = ++o) {\n code += digits.charAt(floor(Math.random() * 16));\n }\n return new Color(code);\n };\n\n _interpolators = [];\n\n interpolate = function(col1, col2, f, m) {\n var interpol, len, o, res;\n if (f == null) {\n f = 0.5;\n }\n if (m == null) {\n m = 'rgb';\n }\n\n /*\n interpolates between colors\n f = 0 --> me\n f = 1 --> col\n */\n if (type(col1) !== 'object') {\n col1 = chroma(col1);\n }\n if (type(col2) !== 'object') {\n col2 = chroma(col2);\n }\n for (o = 0, len = _interpolators.length; o < len; o++) {\n interpol = _interpolators[o];\n if (m === interpol[0]) {\n res = interpol[1](col1, col2, f, m);\n break;\n }\n }\n if (res == null) {\n throw \"color mode \" + m + \" is not supported\";\n }\n return res.alpha(col1.alpha() + f * (col2.alpha() - col1.alpha()));\n };\n\n chroma.interpolate = interpolate;\n\n Color.prototype.interpolate = function(col2, f, m) {\n return interpolate(this, col2, f, m);\n };\n\n chroma.mix = interpolate;\n\n Color.prototype.mix = Color.prototype.interpolate;\n\n _input.rgb = function() {\n var k, ref, results, v;\n ref = unpack(arguments);\n results = [];\n for (k in ref) {\n v = ref[k];\n results.push(v);\n }\n return results;\n };\n\n chroma.rgb = function() {\n return (function(func, args, ctor) {\n ctor.prototype = func.prototype;\n var child = new ctor, result = func.apply(child, args);\n return Object(result) === result ? result : child;\n })(Color, slice.call(arguments).concat(['rgb']), function(){});\n };\n\n Color.prototype.rgb = function(round) {\n if (round == null) {\n round = true;\n }\n if (round) {\n return this._rgb.map(Math.round).slice(0, 3);\n } else {\n return this._rgb.slice(0, 3);\n }\n };\n\n Color.prototype.rgba = function(round) {\n if (round == null) {\n round = true;\n }\n if (!round) {\n return this._rgb.slice(0);\n }\n return [Math.round(this._rgb[0]), Math.round(this._rgb[1]), Math.round(this._rgb[2]), this._rgb[3]];\n };\n\n _guess_formats.push({\n p: 3,\n test: function(n) {\n var a;\n a = unpack(arguments);\n if (type(a) === 'array' && a.length === 3) {\n return 'rgb';\n }\n if (a.length === 4 && type(a[3]) === \"number\" && a[3] >= 0 && a[3] <= 1) {\n return 'rgb';\n }\n }\n });\n\n _input.lrgb = _input.rgb;\n\n interpolate_lrgb = function(col1, col2, f, m) {\n var xyz0, xyz1;\n xyz0 = col1._rgb;\n xyz1 = col2._rgb;\n return new Color(sqrt(pow(xyz0[0], 2) * (1 - f) + pow(xyz1[0], 2) * f), sqrt(pow(xyz0[1], 2) * (1 - f) + pow(xyz1[1], 2) * f), sqrt(pow(xyz0[2], 2) * (1 - f) + pow(xyz1[2], 2) * f), m);\n };\n\n _average_lrgb = function(colors) {\n var col, f, len, o, rgb, xyz;\n f = 1 / colors.length;\n xyz = [0, 0, 0, 0];\n for (o = 0, len = colors.length; o < len; o++) {\n col = colors[o];\n rgb = col._rgb;\n xyz[0] += pow(rgb[0], 2) * f;\n xyz[1] += pow(rgb[1], 2) * f;\n xyz[2] += pow(rgb[2], 2) * f;\n xyz[3] += rgb[3] * f;\n }\n xyz[0] = sqrt(xyz[0]);\n xyz[1] = sqrt(xyz[1]);\n xyz[2] = sqrt(xyz[2]);\n if (xyz[3] > 1) {\n xyz[3] = 1;\n }\n return new Color(clip_rgb(xyz));\n };\n\n _interpolators.push(['lrgb', interpolate_lrgb]);\n\n chroma.average = function(colors, mode) {\n var A, alpha, c, cnt, dx, dy, first, i, l, len, o, xyz, xyz2;\n if (mode == null) {\n mode = 'rgb';\n }\n l = colors.length;\n colors = colors.map(function(c) {\n return chroma(c);\n });\n first = colors.splice(0, 1)[0];\n if (mode === 'lrgb') {\n return _average_lrgb(colors);\n }\n xyz = first.get(mode);\n cnt = [];\n dx = 0;\n dy = 0;\n for (i in xyz) {\n xyz[i] = xyz[i] || 0;\n cnt.push(isNaN(xyz[i]) ? 0 : 1);\n if (mode.charAt(i) === 'h' && !isNaN(xyz[i])) {\n A = xyz[i] / 180 * PI;\n dx += cos(A);\n dy += sin(A);\n }\n }\n alpha = first.alpha();\n for (o = 0, len = colors.length; o < len; o++) {\n c = colors[o];\n xyz2 = c.get(mode);\n alpha += c.alpha();\n for (i in xyz) {\n if (!isNaN(xyz2[i])) {\n cnt[i] += 1;\n if (mode.charAt(i) === 'h') {\n A = xyz2[i] / 180 * PI;\n dx += cos(A);\n dy += sin(A);\n } else {\n xyz[i] += xyz2[i];\n }\n }\n }\n }\n for (i in xyz) {\n if (mode.charAt(i) === 'h') {\n A = atan2(dy / cnt[i], dx / cnt[i]) / PI * 180;\n while (A < 0) {\n A += 360;\n }\n while (A >= 360) {\n A -= 360;\n }\n xyz[i] = A;\n } else {\n xyz[i] = xyz[i] / cnt[i];\n }\n }\n return chroma(xyz, mode).alpha(alpha / l);\n };\n\n hex2rgb = function(hex) {\n var a, b, g, r, rgb, u;\n if (hex.match(/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/)) {\n if (hex.length === 4 || hex.length === 7) {\n hex = hex.substr(1);\n }\n if (hex.length === 3) {\n hex = hex.split(\"\");\n hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2];\n }\n u = parseInt(hex, 16);\n r = u >> 16;\n g = u >> 8 & 0xFF;\n b = u & 0xFF;\n return [r, g, b, 1];\n }\n if (hex.match(/^#?([A-Fa-f0-9]{8})$/)) {\n if (hex.length === 9) {\n hex = hex.substr(1);\n }\n u = parseInt(hex, 16);\n r = u >> 24 & 0xFF;\n g = u >> 16 & 0xFF;\n b = u >> 8 & 0xFF;\n a = round((u & 0xFF) / 0xFF * 100) / 100;\n return [r, g, b, a];\n }\n if ((_input.css != null) && (rgb = _input.css(hex))) {\n return rgb;\n }\n throw \"unknown color: \" + hex;\n };\n\n rgb2hex = function(channels, mode) {\n var a, b, g, hxa, r, str, u;\n if (mode == null) {\n mode = 'auto';\n }\n r = channels[0], g = channels[1], b = channels[2], a = channels[3];\n if (mode === 'auto') {\n mode = a < 1 ? 'rgba' : 'rgb';\n }\n r = Math.round(r);\n g = Math.round(g);\n b = Math.round(b);\n u = r << 16 | g << 8 | b;\n str = \"000000\" + u.toString(16);\n str = str.substr(str.length - 6);\n hxa = '0' + round(a * 255).toString(16);\n hxa = hxa.substr(hxa.length - 2);\n return \"#\" + (function() {\n switch (mode.toLowerCase()) {\n case 'rgba':\n return str + hxa;\n case 'argb':\n return hxa + str;\n default:\n return str;\n }\n })();\n };\n\n _input.hex = function(h) {\n return hex2rgb(h);\n };\n\n chroma.hex = function() {\n return (function(func, args, ctor) {\n ctor.prototype = func.prototype;\n var child = new ctor, result = func.apply(child, args);\n return Object(result) === result ? result : child;\n })(Color, slice.call(arguments).concat(['hex']), function(){});\n };\n\n Color.prototype.hex = function(mode) {\n if (mode == null) {\n mode = 'auto';\n }\n return rgb2hex(this._rgb, mode);\n };\n\n _guess_formats.push({\n p: 4,\n test: function(n) {\n if (arguments.length === 1 && type(n) === \"string\") {\n return 'hex';\n }\n }\n });\n\n hsl2rgb = function() {\n var args, b, c, g, h, i, l, o, r, ref, s, t1, t2, t3;\n args = unpack(arguments);\n h = args[0], s = args[1], l = args[2];\n if (s === 0) {\n r = g = b = l * 255;\n } else {\n t3 = [0, 0, 0];\n c = [0, 0, 0];\n t2 = l < 0.5 ? l * (1 + s) : l + s - l * s;\n t1 = 2 * l - t2;\n h /= 360;\n t3[0] = h + 1 / 3;\n t3[1] = h;\n t3[2] = h - 1 / 3;\n for (i = o = 0; o <= 2; i = ++o) {\n if (t3[i] < 0) {\n t3[i] += 1;\n }\n if (t3[i] > 1) {\n t3[i] -= 1;\n }\n if (6 * t3[i] < 1) {\n c[i] = t1 + (t2 - t1) * 6 * t3[i];\n } else if (2 * t3[i] < 1) {\n c[i] = t2;\n } else if (3 * t3[i] < 2) {\n c[i] = t1 + (t2 - t1) * ((2 / 3) - t3[i]) * 6;\n } else {\n c[i] = t1;\n }\n }\n ref = [round(c[0] * 255), round(c[1] * 255), round(c[2] * 255)], r = ref[0], g = ref[1], b = ref[2];\n }\n if (args.length > 3) {\n return [r, g, b, args[3]];\n } else {\n return [r, g, b];\n }\n };\n\n rgb2hsl = function(r, g, b) {\n var h, l, min, ref, s;\n if (r !== void 0 && r.length >= 3) {\n ref = r, r = ref[0], g = ref[1], b = ref[2];\n }\n r /= 255;\n g /= 255;\n b /= 255;\n min = Math.min(r, g, b);\n max = Math.max(r, g, b);\n l = (max + min) / 2;\n if (max === min) {\n s = 0;\n h = Number.NaN;\n } else {\n s = l < 0.5 ? (max - min) / (max + min) : (max - min) / (2 - max - min);\n }\n if (r === max) {\n h = (g - b) / (max - min);\n } else if (g === max) {\n h = 2 + (b - r) / (max - min);\n } else if (b === max) {\n h = 4 + (r - g) / (max - min);\n }\n h *= 60;\n if (h < 0) {\n h += 360;\n }\n return [h, s, l];\n };\n\n chroma.hsl = function() {\n return (function(func, args, ctor) {\n ctor.prototype = func.prototype;\n var child = new ctor, result = func.apply(child, args);\n return Object(result) === result ? result : child;\n })(Color, slice.call(arguments).concat(['hsl']), function(){});\n };\n\n _input.hsl = hsl2rgb;\n\n Color.prototype.hsl = function() {\n return rgb2hsl(this._rgb);\n };\n\n hsv2rgb = function() {\n var args, b, f, g, h, i, p, q, r, ref, ref1, ref2, ref3, ref4, ref5, s, t, v;\n args = unpack(arguments);\n h = args[0], s = args[1], v = args[2];\n v *= 255;\n if (s === 0) {\n r = g = b = v;\n } else {\n if (h === 360) {\n h = 0;\n }\n if (h > 360) {\n h -= 360;\n }\n if (h < 0) {\n h += 360;\n }\n h /= 60;\n i = floor(h);\n f = h - i;\n p = v * (1 - s);\n q = v * (1 - s * f);\n t = v * (1 - s * (1 - f));\n switch (i) {\n case 0:\n ref = [v, t, p], r = ref[0], g = ref[1], b = ref[2];\n break;\n case 1:\n ref1 = [q, v, p], r = ref1[0], g = ref1[1], b = ref1[2];\n break;\n case 2:\n ref2 = [p, v, t], r = ref2[0], g = ref2[1], b = ref2[2];\n break;\n case 3:\n ref3 = [p, q, v], r = ref3[0], g = ref3[1], b = ref3[2];\n break;\n case 4:\n ref4 = [t, p, v], r = ref4[0], g = ref4[1], b = ref4[2];\n break;\n case 5:\n ref5 = [v, p, q], r = ref5[0], g = ref5[1], b = ref5[2];\n }\n }\n return [r, g, b, args.length > 3 ? args[3] : 1];\n };\n\n rgb2hsv = function() {\n var b, delta, g, h, min, r, ref, s, v;\n ref = unpack(arguments), r = ref[0], g = ref[1], b = ref[2];\n min = Math.min(r, g, b);\n max = Math.max(r, g, b);\n delta = max - min;\n v = max / 255.0;\n if (max === 0) {\n h = Number.NaN;\n s = 0;\n } else {\n s = delta / max;\n if (r === max) {\n h = (g - b) / delta;\n }\n if (g === max) {\n h = 2 + (b - r) / delta;\n }\n if (b === max) {\n h = 4 + (r - g) / delta;\n }\n h *= 60;\n if (h < 0) {\n h += 360;\n }\n }\n return [h, s, v];\n };\n\n chroma.hsv = function() {\n return (function(func, args, ctor) {\n ctor.prototype = func.prototype;\n var child = new ctor, result = func.apply(child, args);\n return Object(result) === result ? result : child;\n })(Color, slice.call(arguments).concat(['hsv']), function(){});\n };\n\n _input.hsv = hsv2rgb;\n\n Color.prototype.hsv = function() {\n return rgb2hsv(this._rgb);\n };\n\n num2rgb = function(num) {\n var b, g, r;\n if (type(num) === \"number\" && num >= 0 && num <= 0xFFFFFF) {\n r = num >> 16;\n g = (num >> 8) & 0xFF;\n b = num & 0xFF;\n return [r, g, b, 1];\n }\n console.warn(\"unknown num color: \" + num);\n return [0, 0, 0, 1];\n };\n\n rgb2num = function() {\n var b, g, r, ref;\n ref = unpack(arguments), r = ref[0], g = ref[1], b = ref[2];\n return (r << 16) + (g << 8) + b;\n };\n\n chroma.num = function(num) {\n return new Color(num, 'num');\n };\n\n Color.prototype.num = function(mode) {\n if (mode == null) {\n mode = 'rgb';\n }\n return rgb2num(this._rgb, mode);\n };\n\n _input.num = num2rgb;\n\n _guess_formats.push({\n p: 1,\n test: function(n) {\n if (arguments.length === 1 && type(n) === \"number\" && n >= 0 && n <= 0xFFFFFF) {\n return 'num';\n }\n }\n });\n\n hcg2rgb = function() {\n var _c, _g, args, b, c, f, g, h, i, p, q, r, ref, ref1, ref2, ref3, ref4, ref5, t, v;\n args = unpack(arguments);\n h = args[0], c = args[1], _g = args[2];\n c = c / 100;\n g = g / 100 * 255;\n _c = c * 255;\n if (c === 0) {\n r = g = b = _g;\n } else {\n if (h === 360) {\n h = 0;\n }\n if (h > 360) {\n h -= 360;\n }\n if (h < 0) {\n h += 360;\n }\n h /= 60;\n i = floor(h);\n f = h - i;\n p = _g * (1 - c);\n q = p + _c * (1 - f);\n t = p + _c * f;\n v = p + _c;\n switch (i) {\n case 0:\n ref = [v, t, p], r = ref[0], g = ref[1], b = ref[2];\n break;\n case 1:\n ref1 = [q, v, p], r = ref1[0], g = ref1[1], b = ref1[2];\n break;\n case 2:\n ref2 = [p, v, t], r = ref2[0], g = ref2[1], b = ref2[2];\n break;\n case 3:\n ref3 = [p, q, v], r = ref3[0], g = ref3[1], b = ref3[2];\n break;\n case 4:\n ref4 = [t, p, v], r = ref4[0], g = ref4[1], b = ref4[2];\n break;\n case 5:\n ref5 = [v, p, q], r = ref5[0], g = ref5[1], b = ref5[2];\n }\n }\n return [r, g, b, args.length > 3 ? args[3] : 1];\n };\n\n rgb2hcg = function() {\n var _g, b, c, delta, g, h, min, r, ref;\n ref = unpack(arguments), r = ref[0], g = ref[1], b = ref[2];\n min = Math.min(r, g, b);\n max = Math.max(r, g, b);\n delta = max - min;\n c = delta * 100 / 255;\n _g = min / (255 - delta) * 100;\n if (delta === 0) {\n h = Number.NaN;\n } else {\n if (r === max) {\n h = (g - b) / delta;\n }\n if (g === max) {\n h = 2 + (b - r) / delta;\n }\n if (b === max) {\n h = 4 + (r - g) / delta;\n }\n h *= 60;\n if (h < 0) {\n h += 360;\n }\n }\n return [h, c, _g];\n };\n\n chroma.hcg = function() {\n return (function(func, args, ctor) {\n ctor.prototype = func.prototype;\n var child = new ctor, result = func.apply(child, args);\n return Object(result) === result ? result : child;\n })(Color, slice.call(arguments).concat(['hcg']), function(){});\n };\n\n _input.hcg = hcg2rgb;\n\n Color.prototype.hcg = function() {\n return rgb2hcg(this._rgb);\n };\n\n css2rgb = function(css) {\n var aa, ab, hsl, i, m, o, rgb, w;\n css = css.toLowerCase();\n if ((chroma.colors != null) && chroma.colors[css]) {\n return hex2rgb(chroma.colors[css]);\n }\n if (m = css.match(/rgb\\(\\s*(\\-?\\d+),\\s*(\\-?\\d+)\\s*,\\s*(\\-?\\d+)\\s*\\)/)) {\n rgb = m.slice(1, 4);\n for (i = o = 0; o <= 2; i = ++o) {\n rgb[i] = +rgb[i];\n }\n rgb[3] = 1;\n } else if (m = css.match(/rgba\\(\\s*(\\-?\\d+),\\s*(\\-?\\d+)\\s*,\\s*(\\-?\\d+)\\s*,\\s*([01]|[01]?\\.\\d+)\\)/)) {\n rgb = m.slice(1, 5);\n for (i = w = 0; w <= 3; i = ++w) {\n rgb[i] = +rgb[i];\n }\n } else if (m = css.match(/rgb\\(\\s*(\\-?\\d+(?:\\.\\d+)?)%,\\s*(\\-?\\d+(?:\\.\\d+)?)%\\s*,\\s*(\\-?\\d+(?:\\.\\d+)?)%\\s*\\)/)) {\n rgb = m.slice(1, 4);\n for (i = aa = 0; aa <= 2; i = ++aa) {\n rgb[i] = round(rgb[i] * 2.55);\n }\n rgb[3] = 1;\n } else if (m = css.match(/rgba\\(\\s*(\\-?\\d+(?:\\.\\d+)?)%,\\s*(\\-?\\d+(?:\\.\\d+)?)%\\s*,\\s*(\\-?\\d+(?:\\.\\d+)?)%\\s*,\\s*([01]|[01]?\\.\\d+)\\)/)) {\n rgb = m.slice(1, 5);\n for (i = ab = 0; ab <= 2; i = ++ab) {\n rgb[i] = round(rgb[i] * 2.55);\n }\n rgb[3] = +rgb[3];\n } else if (m = css.match(/hsl\\(\\s*(\\-?\\d+(?:\\.\\d+)?),\\s*(\\-?\\d+(?:\\.\\d+)?)%\\s*,\\s*(\\-?\\d+(?:\\.\\d+)?)%\\s*\\)/)) {\n hsl = m.slice(1, 4);\n hsl[1] *= 0.01;\n hsl[2] *= 0.01;\n rgb = hsl2rgb(hsl);\n rgb[3] = 1;\n } else if (m = css.match(/hsla\\(\\s*(\\-?\\d+(?:\\.\\d+)?),\\s*(\\-?\\d+(?:\\.\\d+)?)%\\s*,\\s*(\\-?\\d+(?:\\.\\d+)?)%\\s*,\\s*([01]|[01]?\\.\\d+)\\)/)) {\n hsl = m.slice(1, 4);\n hsl[1] *= 0.01;\n hsl[2] *= 0.01;\n rgb = hsl2rgb(hsl);\n rgb[3] = +m[4];\n }\n return rgb;\n };\n\n rgb2css = function(rgba) {\n var mode;\n mode = rgba[3] < 1 ? 'rgba' : 'rgb';\n if (mode === 'rgb') {\n return mode + '(' + rgba.slice(0, 3).map(round).join(',') + ')';\n } else if (mode === 'rgba') {\n return mode + '(' + rgba.slice(0, 3).map(round).join(',') + ',' + rgba[3] + ')';\n } else {\n\n }\n };\n\n rnd = function(a) {\n return round(a * 100) / 100;\n };\n\n hsl2css = function(hsl, alpha) {\n var mode;\n mode = alpha < 1 ? 'hsla' : 'hsl';\n hsl[0] = rnd(hsl[0] || 0);\n hsl[1] = rnd(hsl[1] * 100) + '%';\n hsl[2] = rnd(hsl[2] * 100) + '%';\n if (mode === 'hsla') {\n hsl[3] = alpha;\n }\n return mode + '(' + hsl.join(',') + ')';\n };\n\n _input.css = function(h) {\n return css2rgb(h);\n };\n\n chroma.css = function() {\n return (function(func, args, ctor) {\n ctor.prototype = func.prototype;\n var child = new ctor, result = func.apply(child, args);\n return Object(result) === result ? result : child;\n })(Color, slice.call(arguments).concat(['css']), function(){});\n };\n\n Color.prototype.css = function(mode) {\n if (mode == null) {\n mode = 'rgb';\n }\n if (mode.slice(0, 3) === 'rgb') {\n return rgb2css(this._rgb);\n } else if (mode.slice(0, 3) === 'hsl') {\n return hsl2css(this.hsl(), this.alpha());\n }\n };\n\n _input.named = function(name) {\n return hex2rgb(w3cx11[name]);\n };\n\n _guess_formats.push({\n p: 5,\n test: function(n) {\n if (arguments.length === 1 && (w3cx11[n] != null)) {\n return 'named';\n }\n }\n });\n\n Color.prototype.name = function(n) {\n var h, k;\n if (arguments.length) {\n if (w3cx11[n]) {\n this._rgb = hex2rgb(w3cx11[n]);\n }\n this._rgb[3] = 1;\n this;\n }\n h = this.hex('rgb');\n for (k in w3cx11) {\n if (h === w3cx11[k]) {\n return k;\n }\n }\n return h;\n };\n\n lch2lab = function() {\n\n /*\n Convert from a qualitative parameter h and a quantitative parameter l to a 24-bit pixel.\n These formulas were invented by David Dalrymple to obtain maximum contrast without going\n out of gamut if the parameters are in the range 0-1.\n \n A saturation multiplier was added by Gregor Aisch\n */\n var c, h, l, ref;\n ref = unpack(arguments), l = ref[0], c = ref[1], h = ref[2];\n h = h * DEG2RAD;\n return [l, cos(h) * c, sin(h) * c];\n };\n\n lch2rgb = function() {\n var L, a, args, b, c, g, h, l, r, ref, ref1;\n args = unpack(arguments);\n l = args[0], c = args[1], h = args[2];\n ref = lch2lab(l, c, h), L = ref[0], a = ref[1], b = ref[2];\n ref1 = lab2rgb(L, a, b), r = ref1[0], g = ref1[1], b = ref1[2];\n return [r, g, b, args.length > 3 ? args[3] : 1];\n };\n\n lab2lch = function() {\n var a, b, c, h, l, ref;\n ref = unpack(arguments), l = ref[0], a = ref[1], b = ref[2];\n c = sqrt(a * a + b * b);\n h = (atan2(b, a) * RAD2DEG + 360) % 360;\n if (round(c * 10000) === 0) {\n h = Number.NaN;\n }\n return [l, c, h];\n };\n\n rgb2lch = function() {\n var a, b, g, l, r, ref, ref1;\n ref = unpack(arguments), r = ref[0], g = ref[1], b = ref[2];\n ref1 = rgb2lab(r, g, b), l = ref1[0], a = ref1[1], b = ref1[2];\n return lab2lch(l, a, b);\n };\n\n chroma.lch = function() {\n var args;\n args = unpack(arguments);\n return new Color(args, 'lch');\n };\n\n chroma.hcl = function() {\n var args;\n args = unpack(arguments);\n return new Color(args, 'hcl');\n };\n\n _input.lch = lch2rgb;\n\n _input.hcl = function() {\n var c, h, l, ref;\n ref = unpack(arguments), h = ref[0], c = ref[1], l = ref[2];\n return lch2rgb([l, c, h]);\n };\n\n Color.prototype.lch = function() {\n return rgb2lch(this._rgb);\n };\n\n Color.prototype.hcl = function() {\n return rgb2lch(this._rgb).reverse();\n };\n\n rgb2cmyk = function(mode) {\n var b, c, f, g, k, m, r, ref, y;\n if (mode == null) {\n mode = 'rgb';\n }\n ref = unpack(arguments), r = ref[0], g = ref[1], b = ref[2];\n r = r / 255;\n g = g / 255;\n b = b / 255;\n k = 1 - Math.max(r, Math.max(g, b));\n f = k < 1 ? 1 / (1 - k) : 0;\n c = (1 - r - k) * f;\n m = (1 - g - k) * f;\n y = (1 - b - k) * f;\n return [c, m, y, k];\n };\n\n cmyk2rgb = function() {\n var alpha, args, b, c, g, k, m, r, y;\n args = unpack(arguments);\n c = args[0], m = args[1], y = args[2], k = args[3];\n alpha = args.length > 4 ? args[4] : 1;\n if (k === 1) {\n return [0, 0, 0, alpha];\n }\n r = c >= 1 ? 0 : 255 * (1 - c) * (1 - k);\n g = m >= 1 ? 0 : 255 * (1 - m) * (1 - k);\n b = y >= 1 ? 0 : 255 * (1 - y) * (1 - k);\n return [r, g, b, alpha];\n };\n\n _input.cmyk = function() {\n return cmyk2rgb(unpack(arguments));\n };\n\n chroma.cmyk = function() {\n return (function(func, args, ctor) {\n ctor.prototype = func.prototype;\n var child = new ctor, result = func.apply(child, args);\n return Object(result) === result ? result : child;\n })(Color, slice.call(arguments).concat(['cmyk']), function(){});\n };\n\n Color.prototype.cmyk = function() {\n return rgb2cmyk(this._rgb);\n };\n\n _input.gl = function() {\n var i, k, o, rgb, v;\n rgb = (function() {\n var ref, results;\n ref = unpack(arguments);\n results = [];\n for (k in ref) {\n v = ref[k];\n results.push(v);\n }\n return results;\n }).apply(this, arguments);\n for (i = o = 0; o <= 2; i = ++o) {\n rgb[i] *= 255;\n }\n return rgb;\n };\n\n chroma.gl = function() {\n return (function(func, args, ctor) {\n ctor.prototype = func.prototype;\n var child = new ctor, result = func.apply(child, args);\n return Object(result) === result ? result : child;\n })(Color, slice.call(arguments).concat(['gl']), function(){});\n };\n\n Color.prototype.gl = function() {\n var rgb;\n rgb = this._rgb;\n return [rgb[0] / 255, rgb[1] / 255, rgb[2] / 255, rgb[3]];\n };\n\n rgb2luminance = function(r, g, b) {\n var ref;\n ref = unpack(arguments), r = ref[0], g = ref[1], b = ref[2];\n r = luminance_x(r);\n g = luminance_x(g);\n b = luminance_x(b);\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n };\n\n luminance_x = function(x) {\n x /= 255;\n if (x <= 0.03928) {\n return x / 12.92;\n } else {\n return pow((x + 0.055) / 1.055, 2.4);\n }\n };\n\n interpolate_rgb = function(col1, col2, f, m) {\n var xyz0, xyz1;\n xyz0 = col1._rgb;\n xyz1 = col2._rgb;\n return new Color(xyz0[0] + f * (xyz1[0] - xyz0[0]), xyz0[1] + f * (xyz1[1] - xyz0[1]), xyz0[2] + f * (xyz1[2] - xyz0[2]), m);\n };\n\n _interpolators.push(['rgb', interpolate_rgb]);\n\n Color.prototype.luminance = function(lum, mode) {\n var cur_lum, eps, max_iter, rgba, test;\n if (mode == null) {\n mode = 'rgb';\n }\n if (!arguments.length) {\n return rgb2luminance(this._rgb);\n }\n rgba = this._rgb;\n if (lum === 0) {\n rgba = [0, 0, 0, this._rgb[3]];\n } else if (lum === 1) {\n rgba = [255, 255, 255, this[3]];\n } else {\n cur_lum = rgb2luminance(this._rgb);\n eps = 1e-7;\n max_iter = 20;\n test = function(l, h) {\n var lm, m;\n m = l.interpolate(h, 0.5, mode);\n lm = m.luminance();\n if (Math.abs(lum - lm) < eps || !max_iter--) {\n return m;\n }\n if (lm > lum) {\n return test(l, m);\n }\n return test(m, h);\n };\n if (cur_lum > lum) {\n rgba = test(chroma('black'), this).rgba();\n } else {\n rgba = test(this, chroma('white')).rgba();\n }\n }\n return chroma(rgba).alpha(this.alpha());\n };\n\n temperature2rgb = function(kelvin) {\n var b, g, r, temp;\n temp = kelvin / 100;\n if (temp < 66) {\n r = 255;\n g = -155.25485562709179 - 0.44596950469579133 * (g = temp - 2) + 104.49216199393888 * log(g);\n b = temp < 20 ? 0 : -254.76935184120902 + 0.8274096064007395 * (b = temp - 10) + 115.67994401066147 * log(b);\n } else {\n r = 351.97690566805693 + 0.114206453784165 * (r = temp - 55) - 40.25366309332127 * log(r);\n g = 325.4494125711974 + 0.07943456536662342 * (g = temp - 50) - 28.0852963507957 * log(g);\n b = 255;\n }\n return [r, g, b];\n };\n\n rgb2temperature = function() {\n var b, eps, g, maxTemp, minTemp, r, ref, rgb, temp;\n ref = unpack(arguments), r = ref[0], g = ref[1], b = ref[2];\n minTemp = 1000;\n maxTemp = 40000;\n eps = 0.4;\n while (maxTemp - minTemp > eps) {\n temp = (maxTemp + minTemp) * 0.5;\n rgb = temperature2rgb(temp);\n if ((rgb[2] / rgb[0]) >= (b / r)) {\n maxTemp = temp;\n } else {\n minTemp = temp;\n }\n }\n return round(temp);\n };\n\n chroma.temperature = chroma.kelvin = function() {\n return (function(func, args, ctor) {\n ctor.prototype = func.prototype;\n var child = new ctor, result = func.apply(child, args);\n return Object(result) === result ? result : child;\n })(Color, slice.call(arguments).concat(['temperature']), function(){});\n };\n\n _input.temperature = _input.kelvin = _input.K = temperature2rgb;\n\n Color.prototype.temperature = function() {\n return rgb2temperature(this._rgb);\n };\n\n Color.prototype.kelvin = Color.prototype.temperature;\n\n chroma.contrast = function(a, b) {\n var l1, l2, ref, ref1;\n if ((ref = type(a)) === 'string' || ref === 'number') {\n a = new Color(a);\n }\n if ((ref1 = type(b)) === 'string' || ref1 === 'number') {\n b = new Color(b);\n }\n l1 = a.luminance();\n l2 = b.luminance();\n if (l1 > l2) {\n return (l1 + 0.05) / (l2 + 0.05);\n } else {\n return (l2 + 0.05) / (l1 + 0.05);\n }\n };\n\n chroma.distance = function(a, b, mode) {\n var d, i, l1, l2, ref, ref1, sum_sq;\n if (mode == null) {\n mode = 'lab';\n }\n if ((ref = type(a)) === 'string' || ref === 'number') {\n a = new Color(a);\n }\n if ((ref1 = type(b)) === 'string' || ref1 === 'number') {\n b = new Color(b);\n }\n l1 = a.get(mode);\n l2 = b.get(mode);\n sum_sq = 0;\n for (i in l1) {\n d = (l1[i] || 0) - (l2[i] || 0);\n sum_sq += d * d;\n }\n return Math.sqrt(sum_sq);\n };\n\n chroma.deltaE = function(a, b, L, C) {\n var L1, L2, a1, a2, b1, b2, c1, c2, c4, dH2, delA, delB, delC, delL, f, h1, ref, ref1, ref2, ref3, sc, sh, sl, t, v1, v2, v3;\n if (L == null) {\n L = 1;\n }\n if (C == null) {\n C = 1;\n }\n if ((ref = type(a)) === 'string' || ref === 'number') {\n a = new Color(a);\n }\n if ((ref1 = type(b)) === 'string' || ref1 === 'number') {\n b = new Color(b);\n }\n ref2 = a.lab(), L1 = ref2[0], a1 = ref2[1], b1 = ref2[2];\n ref3 = b.lab(), L2 = ref3[0], a2 = ref3[1], b2 = ref3[2];\n c1 = sqrt(a1 * a1 + b1 * b1);\n c2 = sqrt(a2 * a2 + b2 * b2);\n sl = L1 < 16.0 ? 0.511 : (0.040975 * L1) / (1.0 + 0.01765 * L1);\n sc = (0.0638 * c1) / (1.0 + 0.0131 * c1) + 0.638;\n h1 = c1 < 0.000001 ? 0.0 : (atan2(b1, a1) * 180.0) / PI;\n while (h1 < 0) {\n h1 += 360;\n }\n while (h1 >= 360) {\n h1 -= 360;\n }\n t = (h1 >= 164.0) && (h1 <= 345.0) ? 0.56 + abs(0.2 * cos((PI * (h1 + 168.0)) / 180.0)) : 0.36 + abs(0.4 * cos((PI * (h1 + 35.0)) / 180.0));\n c4 = c1 * c1 * c1 * c1;\n f = sqrt(c4 / (c4 + 1900.0));\n sh = sc * (f * t + 1.0 - f);\n delL = L1 - L2;\n delC = c1 - c2;\n delA = a1 - a2;\n delB = b1 - b2;\n dH2 = delA * delA + delB * delB - delC * delC;\n v1 = delL / (L * sl);\n v2 = delC / (C * sc);\n v3 = sh;\n return sqrt(v1 * v1 + v2 * v2 + (dH2 / (v3 * v3)));\n };\n\n Color.prototype.get = function(modechan) {\n var channel, i, me, mode, ref, src;\n me = this;\n ref = modechan.split('.'), mode = ref[0], channel = ref[1];\n src = me[mode]();\n if (channel) {\n i = mode.indexOf(channel);\n if (i > -1) {\n return src[i];\n } else {\n return console.warn('unknown channel ' + channel + ' in mode ' + mode);\n }\n } else {\n return src;\n }\n };\n\n Color.prototype.set = function(modechan, value) {\n var channel, i, me, mode, ref, src;\n me = this;\n ref = modechan.split('.'), mode = ref[0], channel = ref[1];\n if (channel) {\n src = me[mode]();\n i = mode.indexOf(channel);\n if (i > -1) {\n if (type(value) === 'string') {\n switch (value.charAt(0)) {\n case '+':\n src[i] += +value;\n break;\n case '-':\n src[i] += +value;\n break;\n case '*':\n src[i] *= +(value.substr(1));\n break;\n case '/':\n src[i] /= +(value.substr(1));\n break;\n default:\n src[i] = +value;\n }\n } else {\n src[i] = value;\n }\n } else {\n console.warn('unknown channel ' + channel + ' in mode ' + mode);\n }\n } else {\n src = value;\n }\n return chroma(src, mode).alpha(me.alpha());\n };\n\n Color.prototype.clipped = function() {\n return this._rgb._clipped || false;\n };\n\n Color.prototype.alpha = function(a) {\n if (arguments.length) {\n return chroma.rgb([this._rgb[0], this._rgb[1], this._rgb[2], a]);\n }\n return this._rgb[3];\n };\n\n Color.prototype.darken = function(amount) {\n var lab, me;\n if (amount == null) {\n amount = 1;\n }\n me = this;\n lab = me.lab();\n lab[0] -= LAB_CONSTANTS.Kn * amount;\n return chroma.lab(lab).alpha(me.alpha());\n };\n\n Color.prototype.brighten = function(amount) {\n if (amount == null) {\n amount = 1;\n }\n return this.darken(-amount);\n };\n\n Color.prototype.darker = Color.prototype.darken;\n\n Color.prototype.brighter = Color.prototype.brighten;\n\n Color.prototype.saturate = function(amount) {\n var lch, me;\n if (amount == null) {\n amount = 1;\n }\n me = this;\n lch = me.lch();\n lch[1] += amount * LAB_CONSTANTS.Kn;\n if (lch[1] < 0) {\n lch[1] = 0;\n }\n return chroma.lch(lch).alpha(me.alpha());\n };\n\n Color.prototype.desaturate = function(amount) {\n if (amount == null) {\n amount = 1;\n }\n return this.saturate(-amount);\n };\n\n Color.prototype.premultiply = function() {\n var a, rgb;\n rgb = this.rgb();\n a = this.alpha();\n return chroma(rgb[0] * a, rgb[1] * a, rgb[2] * a, a);\n };\n\n blend = function(bottom, top, mode) {\n if (!blend[mode]) {\n throw 'unknown blend mode ' + mode;\n }\n return blend[mode](bottom, top);\n };\n\n blend_f = function(f) {\n return function(bottom, top) {\n var c0, c1;\n c0 = chroma(top).rgb();\n c1 = chroma(bottom).rgb();\n return chroma(f(c0, c1), 'rgb');\n };\n };\n\n each = function(f) {\n return function(c0, c1) {\n var i, o, out;\n out = [];\n for (i = o = 0; o <= 3; i = ++o) {\n out[i] = f(c0[i], c1[i]);\n }\n return out;\n };\n };\n\n normal = function(a, b) {\n return a;\n };\n\n multiply = function(a, b) {\n return a * b / 255;\n };\n\n darken = function(a, b) {\n if (a > b) {\n return b;\n } else {\n return a;\n }\n };\n\n lighten = function(a, b) {\n if (a > b) {\n return a;\n } else {\n return b;\n }\n };\n\n screen = function(a, b) {\n return 255 * (1 - (1 - a / 255) * (1 - b / 255));\n };\n\n overlay = function(a, b) {\n if (b < 128) {\n return 2 * a * b / 255;\n } else {\n return 255 * (1 - 2 * (1 - a / 255) * (1 - b / 255));\n }\n };\n\n burn = function(a, b) {\n return 255 * (1 - (1 - b / 255) / (a / 255));\n };\n\n dodge = function(a, b) {\n if (a === 255) {\n return 255;\n }\n a = 255 * (b / 255) / (1 - a / 255);\n if (a > 255) {\n return 255;\n } else {\n return a;\n }\n };\n\n blend.normal = blend_f(each(normal));\n\n blend.multiply = blend_f(each(multiply));\n\n blend.screen = blend_f(each(screen));\n\n blend.overlay = blend_f(each(overlay));\n\n blend.darken = blend_f(each(darken));\n\n blend.lighten = blend_f(each(lighten));\n\n blend.dodge = blend_f(each(dodge));\n\n blend.burn = blend_f(each(burn));\n\n chroma.blend = blend;\n\n chroma.analyze = function(data) {\n var len, o, r, val;\n r = {\n min: Number.MAX_VALUE,\n max: Number.MAX_VALUE * -1,\n sum: 0,\n values: [],\n count: 0\n };\n for (o = 0, len = data.length; o < len; o++) {\n val = data[o];\n if ((val != null) && !isNaN(val)) {\n r.values.push(val);\n r.sum += val;\n if (val < r.min) {\n r.min = val;\n }\n if (val > r.max) {\n r.max = val;\n }\n r.count += 1;\n }\n }\n r.domain = [r.min, r.max];\n r.limits = function(mode, num) {\n return chroma.limits(r, mode, num);\n };\n return r;\n };\n\n chroma.scale = function(colors, positions) {\n var _classes, _colorCache, _colors, _correctLightness, _domain, _fixed, _gamma, _max, _min, _mode, _nacol, _out, _padding, _pos, _spread, _useCache, classifyValue, f, getClass, getColor, resetCache, setColors, tmap;\n _mode = 'rgb';\n _nacol = chroma('#ccc');\n _spread = 0;\n _fixed = false;\n _domain = [0, 1];\n _pos = [];\n _padding = [0, 0];\n _classes = false;\n _colors = [];\n _out = false;\n _min = 0;\n _max = 1;\n _correctLightness = false;\n _colorCache = {};\n _useCache = true;\n _gamma = 1;\n setColors = function(colors) {\n var c, col, o, ref, ref1, w;\n if (colors == null) {\n colors = ['#fff', '#000'];\n }\n if ((colors != null) && type(colors) === 'string' && (chroma.brewer != null)) {\n colors = chroma.brewer[colors] || chroma.brewer[colors.toLowerCase()] || colors;\n }\n if (type(colors) === 'array') {\n if (colors.length === 1) {\n colors = [colors[0], colors[0]];\n }\n colors = colors.slice(0);\n for (c = o = 0, ref = colors.length - 1; 0 <= ref ? o <= ref : o >= ref; c = 0 <= ref ? ++o : --o) {\n col = colors[c];\n if (type(col) === \"string\") {\n colors[c] = chroma(col);\n }\n }\n _pos.length = 0;\n for (c = w = 0, ref1 = colors.length - 1; 0 <= ref1 ? w <= ref1 : w >= ref1; c = 0 <= ref1 ? ++w : --w) {\n _pos.push(c / (colors.length - 1));\n }\n }\n resetCache();\n return _colors = colors;\n };\n getClass = function(value) {\n var i, n;\n if (_classes != null) {\n n = _classes.length - 1;\n i = 0;\n while (i < n && value >= _classes[i]) {\n i++;\n }\n return i - 1;\n }\n return 0;\n };\n tmap = function(t) {\n return t;\n };\n classifyValue = function(value) {\n var i, maxc, minc, n, val;\n val = value;\n if (_classes.length > 2) {\n n = _classes.length - 1;\n i = getClass(value);\n minc = _classes[0] + (_classes[1] - _classes[0]) * (0 + _spread * 0.5);\n maxc = _classes[n - 1] + (_classes[n] - _classes[n - 1]) * (1 - _spread * 0.5);\n val = _min + ((_classes[i] + (_classes[i + 1] - _classes[i]) * 0.5 - minc) / (maxc - minc)) * (_max - _min);\n }\n return val;\n };\n getColor = function(val, bypassMap) {\n var c, col, i, k, o, p, ref, t;\n if (bypassMap == null) {\n bypassMap = false;\n }\n if (isNaN(val) || val === null) {\n return _nacol;\n }\n if (!bypassMap) {\n if (_classes && _classes.length > 2) {\n c = getClass(val);\n t = c / (_classes.length - 2);\n } else if (_max !== _min) {\n t = (val - _min) / (_max - _min);\n } else {\n t = 1;\n }\n } else {\n t = val;\n }\n if (!bypassMap) {\n t = tmap(t);\n }\n if (_gamma !== 1) {\n t = pow(t, _gamma);\n }\n t = _padding[0] + (t * (1 - _padding[0] - _padding[1]));\n t = Math.min(1, Math.max(0, t));\n k = Math.floor(t * 10000);\n if (_useCache && _colorCache[k]) {\n col = _colorCache[k];\n } else {\n if (type(_colors) === 'array') {\n for (i = o = 0, ref = _pos.length - 1; 0 <= ref ? o <= ref : o >= ref; i = 0 <= ref ? ++o : --o) {\n p = _pos[i];\n if (t <= p) {\n col = _colors[i];\n break;\n }\n if (t >= p && i === _pos.length - 1) {\n col = _colors[i];\n break;\n }\n if (t > p && t < _pos[i + 1]) {\n t = (t - p) / (_pos[i + 1] - p);\n col = chroma.interpolate(_colors[i], _colors[i + 1], t, _mode);\n break;\n }\n }\n } else if (type(_colors) === 'function') {\n col = _colors(t);\n }\n if (_useCache) {\n _colorCache[k] = col;\n }\n }\n return col;\n };\n resetCache = function() {\n return _colorCache = {};\n };\n setColors(colors);\n f = function(v) {\n var c;\n c = chroma(getColor(v));\n if (_out && c[_out]) {\n return c[_out]();\n } else {\n return c;\n }\n };\n f.classes = function(classes) {\n var d;\n if (classes != null) {\n if (type(classes) === 'array') {\n _classes = classes;\n _domain = [classes[0], classes[classes.length - 1]];\n } else {\n d = chroma.analyze(_domain);\n if (classes === 0) {\n _classes = [d.min, d.max];\n } else {\n _classes = chroma.limits(d, 'e', classes);\n }\n }\n return f;\n }\n return _classes;\n };\n f.domain = function(domain) {\n var c, d, k, len, o, ref, w;\n if (!arguments.length) {\n return _domain;\n }\n _min = domain[0];\n _max = domain[domain.length - 1];\n _pos = [];\n k = _colors.length;\n if (domain.length === k && _min !== _max) {\n for (o = 0, len = domain.length; o < len; o++) {\n d = domain[o];\n _pos.push((d - _min) / (_max - _min));\n }\n } else {\n for (c = w = 0, ref = k - 1; 0 <= ref ? w <= ref : w >= ref; c = 0 <= ref ? ++w : --w) {\n _pos.push(c / (k - 1));\n }\n }\n _domain = [_min, _max];\n return f;\n };\n f.mode = function(_m) {\n if (!arguments.length) {\n return _mode;\n }\n _mode = _m;\n resetCache();\n return f;\n };\n f.range = function(colors, _pos) {\n setColors(colors, _pos);\n return f;\n };\n f.out = function(_o) {\n _out = _o;\n return f;\n };\n f.spread = function(val) {\n if (!arguments.length) {\n return _spread;\n }\n _spread = val;\n return f;\n };\n f.correctLightness = function(v) {\n if (v == null) {\n v = true;\n }\n _correctLightness = v;\n resetCache();\n if (_correctLightness) {\n tmap = function(t) {\n var L0, L1, L_actual, L_diff, L_ideal, max_iter, pol, t0, t1;\n L0 = getColor(0, true).lab()[0];\n L1 = getColor(1, true).lab()[0];\n pol = L0 > L1;\n L_actual = getColor(t, true).lab()[0];\n L_ideal = L0 + (L1 - L0) * t;\n L_diff = L_actual - L_ideal;\n t0 = 0;\n t1 = 1;\n max_iter = 20;\n while (Math.abs(L_diff) > 1e-2 && max_iter-- > 0) {\n (function() {\n if (pol) {\n L_diff *= -1;\n }\n if (L_diff < 0) {\n t0 = t;\n t += (t1 - t) * 0.5;\n } else {\n t1 = t;\n t += (t0 - t) * 0.5;\n }\n L_actual = getColor(t, true).lab()[0];\n return L_diff = L_actual - L_ideal;\n })();\n }\n return t;\n };\n } else {\n tmap = function(t) {\n return t;\n };\n }\n return f;\n };\n f.padding = function(p) {\n if (p != null) {\n if (type(p) === 'number') {\n p = [p, p];\n }\n _padding = p;\n return f;\n } else {\n return _padding;\n }\n };\n f.colors = function(numColors, out) {\n var dd, dm, i, o, ref, result, results, samples, w;\n if (arguments.length < 2) {\n out = 'hex';\n }\n result = [];\n if (arguments.length === 0) {\n result = _colors.slice(0);\n } else if (numColors === 1) {\n result = [f(0.5)];\n } else if (numColors > 1) {\n dm = _domain[0];\n dd = _domain[1] - dm;\n result = (function() {\n results = [];\n for (var o = 0; 0 <= numColors ? o < numColors : o > numColors; 0 <= numColors ? o++ : o--){ results.push(o); }\n return results;\n }).apply(this).map(function(i) {\n return f(dm + i / (numColors - 1) * dd);\n });\n } else {\n colors = [];\n samples = [];\n if (_classes && _classes.length > 2) {\n for (i = w = 1, ref = _classes.length; 1 <= ref ? w < ref : w > ref; i = 1 <= ref ? ++w : --w) {\n samples.push((_classes[i - 1] + _classes[i]) * 0.5);\n }\n } else {\n samples = _domain;\n }\n result = samples.map(function(v) {\n return f(v);\n });\n }\n if (chroma[out]) {\n result = result.map(function(c) {\n return c[out]();\n });\n }\n return result;\n };\n f.cache = function(c) {\n if (c != null) {\n _useCache = c;\n return f;\n } else {\n return _useCache;\n }\n };\n f.gamma = function(g) {\n if (g != null) {\n _gamma = g;\n return f;\n } else {\n return _gamma;\n }\n };\n f.nodata = function(d) {\n if (d != null) {\n _nacol = chroma(d);\n return f;\n } else {\n return _nacol;\n }\n };\n return f;\n };\n\n if (chroma.scales == null) {\n chroma.scales = {};\n }\n\n chroma.scales.cool = function() {\n return chroma.scale([chroma.hsl(180, 1, .9), chroma.hsl(250, .7, .4)]);\n };\n\n chroma.scales.hot = function() {\n return chroma.scale(['#000', '#f00', '#ff0', '#fff'], [0, .25, .75, 1]).mode('rgb');\n };\n\n chroma.analyze = function(data, key, filter) {\n var add, k, len, o, r, val, visit;\n r = {\n min: Number.MAX_VALUE,\n max: Number.MAX_VALUE * -1,\n sum: 0,\n values: [],\n count: 0\n };\n if (filter == null) {\n filter = function() {\n return true;\n };\n }\n add = function(val) {\n if ((val != null) && !isNaN(val)) {\n r.values.push(val);\n r.sum += val;\n if (val < r.min) {\n r.min = val;\n }\n if (val > r.max) {\n r.max = val;\n }\n r.count += 1;\n }\n };\n visit = function(val, k) {\n if (filter(val, k)) {\n if ((key != null) && type(key) === 'function') {\n return add(key(val));\n } else if ((key != null) && type(key) === 'string' || type(key) === 'number') {\n return add(val[key]);\n } else {\n return add(val);\n }\n }\n };\n if (type(data) === 'array') {\n for (o = 0, len = data.length; o < len; o++) {\n val = data[o];\n visit(val);\n }\n } else {\n for (k in data) {\n val = data[k];\n visit(val, k);\n }\n }\n r.domain = [r.min, r.max];\n r.limits = function(mode, num) {\n return chroma.limits(r, mode, num);\n };\n return r;\n };\n\n chroma.limits = function(data, mode, num) {\n var aa, ab, ac, ad, ae, af, ag, ah, ai, aj, ak, al, am, assignments, best, centroids, cluster, clusterSizes, dist, i, j, kClusters, limits, max_log, min, min_log, mindist, n, nb_iters, newCentroids, o, p, pb, pr, ref, ref1, ref10, ref11, ref12, ref13, ref14, ref2, ref3, ref4, ref5, ref6, ref7, ref8, ref9, repeat, sum, tmpKMeansBreaks, v, value, values, w;\n if (mode == null) {\n mode = 'equal';\n }\n if (num == null) {\n num = 7;\n }\n if (type(data) === 'array') {\n data = chroma.analyze(data);\n }\n min = data.min;\n max = data.max;\n sum = data.sum;\n values = data.values.sort(function(a, b) {\n return a - b;\n });\n if (num === 1) {\n return [min, max];\n }\n limits = [];\n if (mode.substr(0, 1) === 'c') {\n limits.push(min);\n limits.push(max);\n }\n if (mode.substr(0, 1) === 'e') {\n limits.push(min);\n for (i = o = 1, ref = num - 1; 1 <= ref ? o <= ref : o >= ref; i = 1 <= ref ? ++o : --o) {\n limits.push(min + (i / num) * (max - min));\n }\n limits.push(max);\n } else if (mode.substr(0, 1) === 'l') {\n if (min <= 0) {\n throw 'Logarithmic scales are only possible for values > 0';\n }\n min_log = Math.LOG10E * log(min);\n max_log = Math.LOG10E * log(max);\n limits.push(min);\n for (i = w = 1, ref1 = num - 1; 1 <= ref1 ? w <= ref1 : w >= ref1; i = 1 <= ref1 ? ++w : --w) {\n limits.push(pow(10, min_log + (i / num) * (max_log - min_log)));\n }\n limits.push(max);\n } else if (mode.substr(0, 1) === 'q') {\n limits.push(min);\n for (i = aa = 1, ref2 = num - 1; 1 <= ref2 ? aa <= ref2 : aa >= ref2; i = 1 <= ref2 ? ++aa : --aa) {\n p = (values.length - 1) * i / num;\n pb = floor(p);\n if (pb === p) {\n limits.push(values[pb]);\n } else {\n pr = p - pb;\n limits.push(values[pb] * (1 - pr) + values[pb + 1] * pr);\n }\n }\n limits.push(max);\n } else if (mode.substr(0, 1) === 'k') {\n\n /*\n implementation based on\n http://code.google.com/p/figue/source/browse/trunk/figue.js#336\n simplified for 1-d input values\n */\n n = values.length;\n assignments = new Array(n);\n clusterSizes = new Array(num);\n repeat = true;\n nb_iters = 0;\n centroids = null;\n centroids = [];\n centroids.push(min);\n for (i = ab = 1, ref3 = num - 1; 1 <= ref3 ? ab <= ref3 : ab >= ref3; i = 1 <= ref3 ? ++ab : --ab) {\n centroids.push(min + (i / num) * (max - min));\n }\n centroids.push(max);\n while (repeat) {\n for (j = ac = 0, ref4 = num - 1; 0 <= ref4 ? ac <= ref4 : ac >= ref4; j = 0 <= ref4 ? ++ac : --ac) {\n clusterSizes[j] = 0;\n }\n for (i = ad = 0, ref5 = n - 1; 0 <= ref5 ? ad <= ref5 : ad >= ref5; i = 0 <= ref5 ? ++ad : --ad) {\n value = values[i];\n mindist = Number.MAX_VALUE;\n for (j = ae = 0, ref6 = num - 1; 0 <= ref6 ? ae <= ref6 : ae >= ref6; j = 0 <= ref6 ? ++ae : --ae) {\n dist = abs(centroids[j] - value);\n if (dist < mindist) {\n mindist = dist;\n best = j;\n }\n }\n clusterSizes[best]++;\n assignments[i] = best;\n }\n newCentroids = new Array(num);\n for (j = af = 0, ref7 = num - 1; 0 <= ref7 ? af <= ref7 : af >= ref7; j = 0 <= ref7 ? ++af : --af) {\n newCentroids[j] = null;\n }\n for (i = ag = 0, ref8 = n - 1; 0 <= ref8 ? ag <= ref8 : ag >= ref8; i = 0 <= ref8 ? ++ag : --ag) {\n cluster = assignments[i];\n if (newCentroids[cluster] === null) {\n newCentroids[cluster] = values[i];\n } else {\n newCentroids[cluster] += values[i];\n }\n }\n for (j = ah = 0, ref9 = num - 1; 0 <= ref9 ? ah <= ref9 : ah >= ref9; j = 0 <= ref9 ? ++ah : --ah) {\n newCentroids[j] *= 1 / clusterSizes[j];\n }\n repeat = false;\n for (j = ai = 0, ref10 = num - 1; 0 <= ref10 ? ai <= ref10 : ai >= ref10; j = 0 <= ref10 ? ++ai : --ai) {\n if (newCentroids[j] !== centroids[i]) {\n repeat = true;\n break;\n }\n }\n centroids = newCentroids;\n nb_iters++;\n if (nb_iters > 200) {\n repeat = false;\n }\n }\n kClusters = {};\n for (j = aj = 0, ref11 = num - 1; 0 <= ref11 ? aj <= ref11 : aj >= ref11; j = 0 <= ref11 ? ++aj : --aj) {\n kClusters[j] = [];\n }\n for (i = ak = 0, ref12 = n - 1; 0 <= ref12 ? ak <= ref12 : ak >= ref12; i = 0 <= ref12 ? ++ak : --ak) {\n cluster = assignments[i];\n kClusters[cluster].push(values[i]);\n }\n tmpKMeansBreaks = [];\n for (j = al = 0, ref13 = num - 1; 0 <= ref13 ? al <= ref13 : al >= ref13; j = 0 <= ref13 ? ++al : --al) {\n tmpKMeansBreaks.push(kClusters[j][0]);\n tmpKMeansBreaks.push(kClusters[j][kClusters[j].length - 1]);\n }\n tmpKMeansBreaks = tmpKMeansBreaks.sort(function(a, b) {\n return a - b;\n });\n limits.push(tmpKMeansBreaks[0]);\n for (i = am = 1, ref14 = tmpKMeansBreaks.length - 1; am <= ref14; i = am += 2) {\n v = tmpKMeansBreaks[i];\n if (!isNaN(v) && limits.indexOf(v) === -1) {\n limits.push(v);\n }\n }\n }\n return limits;\n };\n\n hsi2rgb = function(h, s, i) {\n\n /*\n borrowed from here:\n http://hummer.stanford.edu/museinfo/doc/examples/humdrum/keyscape2/hsi2rgb.cpp\n */\n var args, b, g, r;\n args = unpack(arguments);\n h = args[0], s = args[1], i = args[2];\n if (isNaN(h)) {\n h = 0;\n }\n h /= 360;\n if (h < 1 / 3) {\n b = (1 - s) / 3;\n r = (1 + s * cos(TWOPI * h) / cos(PITHIRD - TWOPI * h)) / 3;\n g = 1 - (b + r);\n } else if (h < 2 / 3) {\n h -= 1 / 3;\n r = (1 - s) / 3;\n g = (1 + s * cos(TWOPI * h) / cos(PITHIRD - TWOPI * h)) / 3;\n b = 1 - (r + g);\n } else {\n h -= 2 / 3;\n g = (1 - s) / 3;\n b = (1 + s * cos(TWOPI * h) / cos(PITHIRD - TWOPI * h)) / 3;\n r = 1 - (g + b);\n }\n r = limit(i * r * 3);\n g = limit(i * g * 3);\n b = limit(i * b * 3);\n return [r * 255, g * 255, b * 255, args.length > 3 ? args[3] : 1];\n };\n\n rgb2hsi = function() {\n\n /*\n borrowed from here:\n http://hummer.stanford.edu/museinfo/doc/examples/humdrum/keyscape2/rgb2hsi.cpp\n */\n var b, g, h, i, min, r, ref, s;\n ref = unpack(arguments), r = ref[0], g = ref[1], b = ref[2];\n TWOPI = Math.PI * 2;\n r /= 255;\n g /= 255;\n b /= 255;\n min = Math.min(r, g, b);\n i = (r + g + b) / 3;\n s = 1 - min / i;\n if (s === 0) {\n h = 0;\n } else {\n h = ((r - g) + (r - b)) / 2;\n h /= Math.sqrt((r - g) * (r - g) + (r - b) * (g - b));\n h = Math.acos(h);\n if (b > g) {\n h = TWOPI - h;\n }\n h /= TWOPI;\n }\n return [h * 360, s, i];\n };\n\n chroma.hsi = function() {\n return (function(func, args, ctor) {\n ctor.prototype = func.prototype;\n var child = new ctor, result = func.apply(child, args);\n return Object(result) === result ? result : child;\n })(Color, slice.call(arguments).concat(['hsi']), function(){});\n };\n\n _input.hsi = hsi2rgb;\n\n Color.prototype.hsi = function() {\n return rgb2hsi(this._rgb);\n };\n\n interpolate_hsx = function(col1, col2, f, m) {\n var dh, hue, hue0, hue1, lbv, lbv0, lbv1, res, sat, sat0, sat1, xyz0, xyz1;\n if (m === 'hsl') {\n xyz0 = col1.hsl();\n xyz1 = col2.hsl();\n } else if (m === 'hsv') {\n xyz0 = col1.hsv();\n xyz1 = col2.hsv();\n } else if (m === 'hcg') {\n xyz0 = col1.hcg();\n xyz1 = col2.hcg();\n } else if (m === 'hsi') {\n xyz0 = col1.hsi();\n xyz1 = col2.hsi();\n } else if (m === 'lch' || m === 'hcl') {\n m = 'hcl';\n xyz0 = col1.hcl();\n xyz1 = col2.hcl();\n }\n if (m.substr(0, 1) === 'h') {\n hue0 = xyz0[0], sat0 = xyz0[1], lbv0 = xyz0[2];\n hue1 = xyz1[0], sat1 = xyz1[1], lbv1 = xyz1[2];\n }\n if (!isNaN(hue0) && !isNaN(hue1)) {\n if (hue1 > hue0 && hue1 - hue0 > 180) {\n dh = hue1 - (hue0 + 360);\n } else if (hue1 < hue0 && hue0 - hue1 > 180) {\n dh = hue1 + 360 - hue0;\n } else {\n dh = hue1 - hue0;\n }\n hue = hue0 + f * dh;\n } else if (!isNaN(hue0)) {\n hue = hue0;\n if ((lbv1 === 1 || lbv1 === 0) && m !== 'hsv') {\n sat = sat0;\n }\n } else if (!isNaN(hue1)) {\n hue = hue1;\n if ((lbv0 === 1 || lbv0 === 0) && m !== 'hsv') {\n sat = sat1;\n }\n } else {\n hue = Number.NaN;\n }\n if (sat == null) {\n sat = sat0 + f * (sat1 - sat0);\n }\n lbv = lbv0 + f * (lbv1 - lbv0);\n return res = chroma[m](hue, sat, lbv);\n };\n\n _interpolators = _interpolators.concat((function() {\n var len, o, ref, results;\n ref = ['hsv', 'hsl', 'hsi', 'hcl', 'lch', 'hcg'];\n results = [];\n for (o = 0, len = ref.length; o < len; o++) {\n m = ref[o];\n results.push([m, interpolate_hsx]);\n }\n return results;\n })());\n\n interpolate_num = function(col1, col2, f, m) {\n var n1, n2;\n n1 = col1.num();\n n2 = col2.num();\n return chroma.num(n1 + (n2 - n1) * f, 'num');\n };\n\n _interpolators.push(['num', interpolate_num]);\n\n interpolate_lab = function(col1, col2, f, m) {\n var res, xyz0, xyz1;\n xyz0 = col1.lab();\n xyz1 = col2.lab();\n return res = new Color(xyz0[0] + f * (xyz1[0] - xyz0[0]), xyz0[1] + f * (xyz1[1] - xyz0[1]), xyz0[2] + f * (xyz1[2] - xyz0[2]), m);\n };\n\n _interpolators.push(['lab', interpolate_lab]);\n\n}).call(this);\n","const getLineFromPoints = require(\"./get-line-from-points.js\");\nconst categorizeIntersection = require(\"./categorize-intersection.js\");\nconst clamp = require(\"./clamp.js\");\nconst couple = require(\"./couple.js\");\nconst clusterLineSegments = require(\"./cluster-line-segments.js\");\nconst getEdges = require(\"./get-edges.js\");\nconst getIntersectionOfTwoLines = require(\"./get-intersection-of-two-lines.js\");\nconst getPolygons = require(\"./get-polygons.js\");\nconst mergeRanges = require(\"./merge-ranges.js\");\nconst partition = require(\"./partition.js\");\nconst prepareSnap = require(\"./prepare-snap.js\");\nconst range = require(\"./range.js\");\n\nmodule.exports = function calculateCore({\n debug_level = 0,\n raster_bbox,\n raster_height, // number of rows of pixels in the raster\n raster_width, // number of columns of pixels in the raster\n pixel_height,\n pixel_width,\n geometry,\n per_pixel,\n per_row_segment\n}) {\n const [raster_xmin, raster_ymin, raster_xmax, raster_ymax] = raster_bbox;\n\n // iterate through image rows and convert each one to a line\n // running through the middle of the row\n const imageLines = [];\n\n if (raster_height === 0) return;\n\n for (let y = 0; y < raster_height; y++) {\n const lat = raster_ymax - pixel_height * y - pixel_height / 2;\n\n // use that point, plus another point along the same latitude to\n // create a line\n const point0 = [raster_xmin, lat];\n const point1 = [raster_xmin + 1, lat];\n const line = getLineFromPoints(point0, point1);\n imageLines.push(line);\n }\n if (debug_level >= 2) console.log(\"[dufour-peyton-intersection] imageLines:\", imageLines);\n\n // collapse geometry down to a list of edges\n // necessary for multi-part geometries\n const polygons = getPolygons(geometry);\n const polygonEdges = polygons.map(getEdges);\n\n polygonEdges.forEach(edges => {\n // iterate through the list of polygon vertices, convert them to\n // lines, and compute the intersections with each image row\n const intersectionsByRow = range(raster_height).map(() => []);\n const numberOfEdges = edges.length;\n for (let i = 0; i < numberOfEdges; i++) {\n // get vertices that make up an edge and convert that to a line\n const edge = edges[i];\n\n const [startPoint, endPoint] = edge;\n const [x1, y1] = startPoint;\n const [x2, y2] = endPoint;\n\n const direction = Math.sign(y2 - y1);\n const horizontal = y1 === y2;\n const vertical = x1 === x2;\n\n const edgeY = y1;\n\n const edgeLine = getLineFromPoints(startPoint, endPoint);\n\n const edgeYMin = Math.min(y1, y2);\n const edgeYMax = Math.max(y1, y2);\n\n let startLng, startLat, endLat, endLng;\n if (x1 < x2) {\n [startLng, startLat] = startPoint;\n [endLng, endLat] = endPoint;\n } else {\n [startLng, startLat] = endPoint;\n [endLng, endLat] = startPoint;\n }\n\n if (startLng === undefined) throw Error(\"startLng is \" + startLng);\n\n // find the y values in the image coordinate space\n const imageY1 = Math.round((raster_bbox[3] - 0.5 * pixel_height - startLat) / pixel_height);\n const imageY2 = Math.round((raster_bbox[3] - 0.5 * pixel_height - endLat) / pixel_height);\n\n // make sure to set the start and end points so that we are\n // incrementing upwards through rows\n let rowStart, rowEnd;\n if (imageY1 < imageY2) {\n rowStart = imageY1;\n rowEnd = imageY2;\n } else {\n rowStart = imageY2;\n rowEnd = imageY1;\n }\n\n rowStart = clamp(rowStart, 0, raster_height - 1);\n rowEnd = clamp(rowEnd, 0, raster_height - 1);\n // iterate through image lines within the change in y of\n // the edge line and find all intersections\n for (let j = rowStart; j < rowEnd + 1; j++) {\n const imageLine = imageLines[j];\n\n if (imageLine === undefined) {\n console.error(\"j:\", j);\n console.error(\"imageLines:\", imageLines);\n throw Error(\"imageLines\");\n }\n\n // because you know x is zero in ax + by = c, so by = c and b = -1, so -1 * y = c or y = -1 * c\n const imageLineY = -1 * imageLine.c;\n\n const startsOnLine = y1 === imageLineY;\n const endsOnLine = y2 === imageLineY;\n const endsOffLine = !endsOnLine;\n\n let xminOnLine, xmaxOnLine;\n if (horizontal) {\n if (edgeY === imageLineY) {\n xminOnLine = startLng;\n xmaxOnLine = endLng;\n } else {\n continue; // stop running calculations for this horizontal line because it doesn't intersect at all\n }\n } else if (vertical) {\n /* we have to have a seprate section for vertical because of floating point arithmetic probs with get_inter...\" */\n if (imageLineY >= edgeYMin && imageLineY <= edgeYMax) {\n xminOnLine = startLng;\n xmaxOnLine = endLng;\n }\n } else if (startsOnLine) {\n // we know that the other end is not on the line because then it would be horizontal\n xminOnLine = xmaxOnLine = x1;\n } else if (endsOnLine) {\n // we know that the other end is not on the line because then it would be horizontal\n xminOnLine = xmaxOnLine = x2;\n } else {\n try {\n xminOnLine = xmaxOnLine = getIntersectionOfTwoLines(edgeLine, imageLine).x;\n } catch (error) {\n throw error;\n }\n }\n\n // check to see if the intersection point is within the range of\n // the edge line segment. If it is, add the intersection to the\n // list of intersections at the corresponding index for that row\n // in intersectionsByRow\n if (\n xminOnLine !== undefined &&\n xmaxOnLine !== undefined &&\n (horizontal || (xminOnLine >= startLng && xmaxOnLine <= endLng && imageLineY <= edgeYMax && imageLineY >= edgeYMin))\n ) {\n intersectionsByRow[j].push({\n direction,\n index: i,\n edge,\n endsOnLine,\n endsOffLine,\n horizontal,\n startsOnLine,\n vertical,\n xmin: xminOnLine,\n xmax: xmaxOnLine,\n imageLineY\n });\n }\n }\n }\n\n const half_pixel_width = pixel_width / 2;\n const snap = prepareSnap(raster_xmin, pixel_width);\n\n intersectionsByRow.forEach((segmentsInRow, row_index) => {\n if (segmentsInRow.length > 0) {\n const clusters = clusterLineSegments(segmentsInRow, numberOfEdges);\n const categorized = clusters.map(categorizeIntersection);\n const [throughs, nonthroughs] = partition(categorized, item => item.through);\n\n if (throughs.length % 2 === 1) {\n if (debug_level >= 1) console.error(\"throughs:\", JSON.stringify(throughs));\n throw Error(\"throughs.length for \" + row_index + \" is odd with \" + throughs.length);\n }\n\n let insides = nonthroughs.map(intersection => [intersection.xmin, intersection.xmax]);\n\n // sorts throughs from left to right in-place\n throughs.sort((a, b) => a.xmin - b.xmin);\n\n const couples = couple(throughs).map(couple => {\n const [left, right] = couple;\n return [left.xmin, right.xmax];\n });\n\n insides = insides.concat(couples);\n\n /*\n This makes sure we don't double count pixels.\n For example, converts `[[0,10],[10,10]]` to `[[0,10]]`\n */\n insides = mergeRanges(insides);\n\n insides.forEach(pair => {\n const [xmin, xmax] = pair;\n\n if (xmax - xmin < half_pixel_width) return;\n\n // snap [xmin, xmax] in srs to raster coordinates\n const [left, right] = snap(pair);\n\n // intersection doesn't take up more than half of a pixel\n if (left === right) return;\n\n // skip because segment is beyond the right edge of the raster\n if (left > raster_width) return;\n\n // skip because segment is beyond the left edge of the raster\n if (right <= 0) return;\n\n const start_column_index = Math.max(left, 0);\n const end_column_index = Math.min(right - 1, raster_width - 1);\n\n if (per_row_segment) {\n per_row_segment({\n row: row_index,\n columns: [start_column_index, end_column_index]\n });\n }\n\n if (per_pixel) {\n for (let column_index = start_column_index; column_index <= end_column_index; column_index++) {\n per_pixel({ row: row_index, column: column_index });\n }\n }\n });\n }\n });\n });\n};\n","const calculateCallbacks = require(\"./calculate-core.js\");\nconst checkRows = require(\"./check-rows.js\");\nconst mergeConsecutiveRanges = require(\"./merge-consecutive-ranges.js\");\n\nmodule.exports = function calculate({\n debug = false,\n raster_bbox,\n raster_height,\n raster_width,\n pixel_height,\n pixel_width,\n geometry,\n per_pixel,\n per_row_segment\n}) {\n const [xmin, ymin, xmax, ymax] = raster_bbox;\n if (pixel_height === undefined || pixel_height === null) pixel_height = (ymax - ymin) / raster_height;\n if (pixel_width === undefined || pixel_width === null) pixel_width = (xmax - xmin) / raster_width;\n\n const rows = new Array(raster_height);\n\n calculateCallbacks({\n raster_bbox,\n raster_height,\n raster_width,\n pixel_height,\n pixel_width,\n geometry,\n per_pixel,\n per_row_segment: ({ row, columns }) => {\n if (!rows[row]) rows[row] = [];\n rows[row].push(columns);\n if (per_row_segment) per_row_segment({ row, columns });\n }\n });\n\n for (let irow = 0; irow < rows.length; irow++) {\n const ranges = rows[irow];\n if (ranges) {\n // sort from left to right\n ranges.sort((a, b) => (a === b ? a[1] - b[1] : a[0] - b[0]));\n\n // replace existing row with sorted and merged one\n rows[irow] = mergeConsecutiveRanges(ranges);\n }\n }\n\n if (debug) checkRows(insides);\n\n return { rows };\n};\n","module.exports = function categorizeIntersection(segments) {\n try {\n let through, xmin, xmax;\n\n const n = segments.length;\n\n const first = segments[0];\n\n if (n === 1) {\n through = true;\n xmin = first.xmin;\n xmax = first.xmax;\n } /* n > 1 */ else {\n const last = segments[n - 1];\n through = first.direction === last.direction;\n xmin = Math.min(first.xmin, last.xmin);\n xmax = Math.max(first.xmax, last.xmax);\n }\n\n if (xmin === undefined || xmax === undefined || through === undefined || isNaN(xmin) || isNaN(xmax)) {\n throw Error(\"categorizeIntersection failed with xmin\", xmin, \"and xmax\", xmax);\n }\n\n return { xmin, xmax, through };\n } catch (error) {\n console.error(\"[categorizeIntersection] segments:\", segments);\n console.error(\"[categorizeIntersection]\", error);\n throw error;\n }\n};\n","module.exports = function checkRanges(rows) {\n rows.forEach((ranges, irow) => {\n for (let irange = 0; irange < ranges.length; irange++) {\n const range = ranges[irange];\n const [start, end] = range;\n if (start > end) {\n console.warn(\"[dufour-peyton-intersection] uh oh, encountered invalid range\", range, \"at row index\", irow, \"with ranges\", ranges);\n }\n\n for (let iother = irange + 1; iother < ranges.length; iother++) {\n if (iother[0] <= end) {\n console.warn(\"[dufour-peyton-intersection] encountered range problem on row index\", irow, \":\", ranges);\n }\n }\n }\n });\n};\n","module.exports = function clamp(n, min, max) {\n if (n < min) return min;\n else if (n > max) return max;\n return n;\n};\n","const cluster = require(\"./cluster.js\");\n\nmodule.exports = function clusterLineSegments(lineSegments, numberOfEdges, debug = false) {\n try {\n const clusters = cluster(lineSegments, s => s.endsOffLine);\n\n const numberOfClusters = clusters.length;\n\n if (numberOfClusters >= 2) {\n const firstCluster = clusters[0];\n const firstSegment = firstCluster[0];\n const lastCluster = clusters[clusters.length - 1];\n const lastSegment = lastCluster[lastCluster.length - 1];\n\n if (lastSegment.index === numberOfEdges - 1 && firstSegment.index === 0 && lastSegment.endsOnLine) {\n clusters[0] = clusters.pop().concat(firstCluster);\n }\n }\n\n return clusters;\n } catch (error) {\n console.error(\"[clusterLineSegments]\", error);\n }\n};\n","module.exports = function cluster(items, newClusterTest) {\n try {\n const numberOfItems = items.length;\n const clusters = [];\n let cluster = [];\n for (let i = 0; i < numberOfItems; i++) {\n const item = items[i];\n cluster.push(item);\n if (newClusterTest(item)) {\n clusters.push(cluster);\n cluster = [];\n }\n }\n\n if (cluster.length > 0) clusters.push(cluster);\n\n return clusters;\n } catch (error) {\n console.error(\"[cluster]:\", error);\n }\n};\n","// This function takes in an array with an even number of elements and\n// returns an array that couples every two consecutive elements;\nmodule.exports = function couple(array) {\n const couples = [];\n const lengthOfArray = array.length;\n for (let i = 0; i < lengthOfArray; i += 2) {\n couples.push([array[i], array[i + 1]]);\n }\n return couples;\n};\n","module.exports = function eachEdge(polygon, callback) {\n polygon.forEach(ring => {\n for (let i = 1; i < ring.length; i++) {\n // should reuse previous endPoint as startPoint to save memory\n const startPoint = ring[i - 1];\n const endPoint = ring[i];\n const edgeIndex = i - 1;\n callback([startPoint, endPoint], edgeIndex);\n }\n });\n};\n","const getDepth = require(\"get-depth\");\n\n// call callback function for each polygon in geojson\nmodule.exports = function eachPolygon(geojson, callback) {\n if (geojson.type === \"FeatureCollection\") {\n geojson.features.forEach(feature => eachPolygon(feature, callback));\n } else if (geojson.type === \"Feature\") {\n eachPolygon(geojson.geometry, callback);\n } else if (geojson.type === \"Polygon\") {\n eachPolygon(geojson.coordinates, callback);\n } else if (geojson.type === \"MultiPolygon\") {\n geojson.coordinates.forEach(polygon => {\n callback(polygon);\n });\n } else if (Array.isArray(geojson)) {\n const depth = getDepth(geojson);\n if (depth === 4) {\n geojson.forEach(polygon => {\n callback(polygon);\n });\n } else if (depth === 3) {\n callback(geojson);\n }\n }\n};\n","const eachPolygon = require(\"./each-polygon.js\");\n\nmodule.exports = function getBoundingBox(geometry) {\n let xmin, ymin, xmax, ymax;\n\n eachPolygon(geometry, polygon => {\n const ring = polygon[0]; // only want the exterior ring\n const imax = ring.length - 1;\n\n let i;\n if (xmin === undefined) {\n xmin = xmax = ring[0][0];\n ymin = ymax = ring[0][1];\n i = 1;\n } else {\n i = 0;\n }\n\n for (; i <= imax; i++) {\n const [x, y] = ring[i];\n if (x < xmin) xmin = x;\n else if (x > xmax) xmax = x;\n if (y < ymin) ymin = y;\n else if (y > ymax) ymax = y;\n }\n });\n\n return [xmin, ymin, xmax, ymax];\n};\n","const eachEdge = require(\"./each-edge.js\");\n\nmodule.exports = function getEdges(polygon) {\n const edges = [];\n eachEdge(polygon, edge => edges.push(edge));\n return edges;\n};\n","// function to get the point at which two lines intersect\n// the input uses the line representations from the\n// getLineFromPoints function\nmodule.exports = function getIntersectionOfTwoLines(line1, line2) {\n // calculate the determinant, ad - cb in a square matrix |a b|\n const det = line1.a * line2.b - line2.a * line1.b; /* |c d| */\n\n if (det) {\n // this makes sure the lines aren't parallel, if they are, det will equal 0\n const x = (line2.b * line1.c - line1.b * line2.c) / det;\n const y = (line1.a * line2.c - line2.a * line1.c) / det;\n return { x, y };\n }\n};\n","// function to convert two points into a\n// representation of a line\nmodule.exports = function getLineFromPoints(startPoint, endPoint) {\n // get a, b, and c from line equation ax + by = c\n const [x1, y1] = startPoint;\n const [x2, y2] = endPoint;\n const a = y2 - y1;\n const b = x1 - x2;\n const c = a * x1 + b * y1;\n\n // return just a b and c since that is all we need\n // to compute the intersection\n return { a, b, c };\n};\n","const eachPolygon = require(\"./each-polygon.js\");\n\nmodule.exports = function getPolygons(geojson) {\n const polygons = [];\n eachPolygon(geojson, polygon => polygons.push(polygon));\n return polygons;\n};\n","const categorizeIntersection = require(\"./categorize-intersection.js\");\nconst clamp = require(\"./clamp.js\");\nconst cluster = require(\"./cluster.js\");\nconst clusterLineSegments = require(\"./cluster-line-segments.js\");\nconst calculate = require(\"./calculate.js\");\nconst calculateCore = require(\"./calculate-core.js\");\nconst couple = require(\"./couple.js\");\nconst getBoundingBox = require(\"./get-bounding-box.js\");\nconst getPolygons = require(\"./get-polygons.js\");\nconst eachEdge = require(\"./each-edge.js\");\nconst getIntersectionOfTwoLines = require(\"./get-intersection-of-two-lines.js\");\nconst getLineFromPoints = require(\"./get-line-from-points.js\");\nconst mergeRanges = require(\"./merge-ranges.js\");\nconst partition = require(\"./partition.js\");\nconst prepareSnap = require(\"./prepare-snap.js\");\nconst range = require(\"./range.js\");\nconst roundDown = require(\"./round-down.js\");\n\nconst dufour_peyton_intersection = {\n calculate,\n calculateCore,\n categorizeIntersection,\n clamp,\n cluster,\n clusterLineSegments,\n couple,\n eachEdge,\n getBoundingBox,\n getIntersectionOfTwoLines,\n getLineFromPoints,\n getPolygons,\n mergeRanges,\n partition,\n prepareSnap,\n range,\n roundDown\n};\n\nif (typeof define === \"function\" && define.amd) define(() => dufour_peyton_intersection);\nif (typeof module === \"object\") module.exports = dufour_peyton_intersection;\nif (typeof self == \"object\") self.dufour_peyton_intersection = dufour_peyton_intersection;\nif (typeof window == \"object\") window.dufour_peyton_intersection = dufour_peyton_intersection;\n","module.exports = function mergeConsecutiveRanges(ranges) {\n const numberOfRanges = ranges.length;\n if (numberOfRanges > 0) {\n const firstRange = ranges[0];\n let previousEnd = firstRange[1];\n const result = [firstRange];\n for (let i = 1; i < numberOfRanges; i++) {\n const tempRange = ranges[i];\n const [start, end] = tempRange;\n if (start <= previousEnd + 1) {\n result[result.length - 1][1] = end;\n } else {\n result.push(tempRange);\n }\n previousEnd = end;\n }\n return result;\n }\n};\n","// This function takes in an array of number pairs and combines where there's overlap\nmodule.exports = function mergeRanges(ranges) {\n const numberOfRanges = ranges.length;\n if (numberOfRanges > 0) {\n const firstRange = ranges[0];\n let previousEnd = firstRange[1];\n const result = [firstRange];\n for (let i = 1; i < numberOfRanges; i++) {\n const tempRange = ranges[i];\n const [start, end] = tempRange;\n if (start <= previousEnd) {\n result[result.length - 1][1] = end;\n } else {\n result.push(tempRange);\n }\n previousEnd = end;\n }\n return result;\n }\n};\n","module.exports = function partition(array, filter) {\n const passed = [];\n const unpassed = [];\n const len = array.length;\n for (let i = 0; i < len; i++) {\n const item = array[i];\n if (filter(item)) passed.push(item);\n else unpassed.push(item);\n }\n return [passed, unpassed];\n};\n","const roundDown = require(\"./round-down.js\");\n\n/**\n * @name prepareSnap\n * @description snap horizontal range in crs to model space\n * @private\n * @param {Number} raster_xmin\n * @param {Number} pixel_width\n * @return {([Number, Number]) => [Number, Number]}\n */\nmodule.exports = function prepareSnap(raster_xmin, pixel_width) {\n return ([xmin, xmax]) => {\n // use roundDown so 1.5 is rounded to 1 not 2\n xmin = roundDown((xmin - raster_xmin) / pixel_width);\n if (xmin === -0) xmin = 0;\n\n xmax = Math.round((xmax - raster_xmin) / pixel_width);\n if (xmax === -0) xmax = 0;\n\n return [xmin, xmax];\n };\n};\n","module.exports = function range(count) {\n const result = new Array(count);\n for (let i = 0; i < count; i++) result[i] = i;\n return result;\n};\n","/**\n * @name roundDown\n * @description like Math.round, but numbers in the middle are rounded down not up\n * @param {Number} n\n * @returns {Number} rounded number\n */\nmodule.exports = function roundDown(n) {\n return -1 * Math.round(-1 * n);\n};\n","var loadImageCache = {};\n\nfunction loadImage(url, options) {\n var debug = (options && options.debug) || false;\n var useCache = (options && options.useCache) || false;\n var crossOrigin = (options && options.crossOrigin) || null;\n if (debug) console.log(\"[easy-image-loader] starting to load\", url);\n\n if (useCache && loadImageCache[url]) return loadImageCache[url];\n\n const promise = new Promise(function (resolve, reject) {\n var timeout;\n var img = document.createElement(\"img\");\n img.onload = function () {\n if (debug) console.log(\"[easy-image-loader] successfully loaded\", url);\n if (timeout) clearTimeout(timeout);\n resolve(img);\n };\n img.onerror = function (error) {\n if (debug) console.error(\"[easy-image-loader] failed to load\", url);\n if (timeout) clearTimeout(timeout);\n reject(error);\n };\n img.src = url;\n img.crossOrigin = crossOrigin;\n if (options && typeof options.timeout === \"number\") {\n setTimeout(() => {\n if (debug) console.error(\"[easy-image-loader] timed out loading\", url);\n reject(new Error(\"timeout\"));\n }, options.timeout);\n }\n });\n\n if (useCache) loadImageCache[url] = promise;\n\n return promise;\n}\n\nif (typeof define === \"function\" && define.amd)\n define(function () {\n return loadImage;\n });\nif (typeof window !== \"undefined\") window.loadImage = loadImage;\nif (typeof self !== \"undefined\") self.loadImage = loadImage;\nif (typeof global !== \"undefined\") global.loadImage = loadImage;\nif (typeof module !== \"undefined\") module.exports = loadImage;\n","\"use strict\";\n\nconst clean = require(\"./clean.js\");\n\nfunction absolute(n) {\n n = clean(n);\n if (n[0] === \"-\") return n.substring(1);\n else return n;\n}\n\nmodule.exports = absolute;\nmodule.exports.default = absolute;\n","\"use strict\";\n\nconst compare_positive = require(\"./compare_positive.js\");\nconst clean = require(\"./clean.js\");\nconst long_addition = require(\"./long_addition.js\");\nconst long_subtraction = require(\"./long_subtraction.js\");\n\nfunction add(a, b) {\n a = clean(a);\n b = clean(b);\n\n const apos = a[0] !== \"-\";\n const bpos = b[0] !== \"-\";\n\n if (apos && bpos) {\n return long_addition(a, b);\n } else if (!apos && !bpos) {\n return \"-\" + long_addition(a.substring(1), b.substring(1));\n } else if (!apos && bpos) {\n a = a.substring(1);\n switch (compare_positive(a, b)) {\n case \"=\":\n return \"0\";\n case \"<\":\n return long_subtraction(b, a);\n case \">\":\n return \"-\" + long_subtraction(a, b);\n }\n } else if (apos && !bpos) {\n b = b.substring(1);\n switch (compare_positive(a, b)) {\n case \"=\":\n return \"0\";\n case \"<\":\n return \"-\" + long_subtraction(b, a);\n case \">\":\n return long_subtraction(a, b);\n }\n }\n}\n\nmodule.exports = add;\nmodule.exports.default = add;\n","\"use strict\";\n\nconst expand = require(\"./expand.js\");\n\nmodule.exports = function clean(n) {\n // remove + from beginning\n if (n[0] === \"+\") n = n.substring(1);\n\n n = expand(n);\n\n // remove extra zero in front\n // 03938.123 => 3938.123\n n = n.replace(/^0+(?=\\d)/, \"\");\n\n // remove extra zero at end\n if (n.includes(\".\")) n = n.replace(/\\.?0+$/, \"\");\n\n // should improve this, so it identifies zero earlier\n if (n === \"\") n = \"0\";\n\n if (n === \"-0\") n = \"0\";\n\n return n;\n};\n","\"use strict\";\n\n// given:\n// - a and b are positive numbers\n// - a and b have been cleaned (i.e. no + or leading zeros)\nfunction compare_positive(a, b) {\n const alen = a.length;\n const blen = b.length;\n\n const aidx = a.indexOf(\".\");\n const bidx = b.indexOf(\".\");\n\n // basically where would the dot be\n // if we add a dot at the end of integers\n // like 123.\n const a_adjusted_dot_index = aidx === -1 ? alen : aidx;\n const b_adjusted_dot_index = bidx === -1 ? blen : bidx;\n\n // how much you need to shift the second number\n // to line up the decimal with the first\n // 0.12345\n // 12345.0\n\n const offset = a_adjusted_dot_index - b_adjusted_dot_index;\n\n let left = Math.max(a_adjusted_dot_index, b_adjusted_dot_index);\n\n let right = Math.max(alen - a_adjusted_dot_index, blen - b_adjusted_dot_index);\n\n let aoffset = offset < 0 ? -1 * offset : 0;\n let boffset = offset <= 0 ? 0 : offset;\n\n let imax = left + 1 + right - 1; // -1 for zero-index\n\n let i = 0;\n while (i < imax) {\n const ai = i - aoffset;\n const achar = ai === a_adjusted_dot_index ? \".\" : a[ai] || \"0\";\n const bi = i - boffset;\n const bchar = bi === b_adjusted_dot_index ? \".\" : b[bi] || \"0\";\n if (achar !== bchar) {\n if (achar > bchar) return \">\";\n else if (achar < bchar) return \"<\";\n }\n i++;\n }\n\n return \"=\";\n}\n\nmodule.exports = compare_positive;\nmodule.exports.default = compare_positive;\n","\"use strict\";\n\n// Internet Explorer doesn't support Number.MAX_SAFE_INTEGER\n// so we just define the constant ourselves\nconst MAX_SAFE_INTEGER = 9007199254740991;\n\n// the greatest number of digits an integer can have\n// and be guaranteed to be stored safely as a floating point.\n// subtract 1 because MAX_SAFE_INTEGER isn't all 9's\nconst MAX_SAFE_INTEGER_LENGTH = MAX_SAFE_INTEGER.toString().length - 1;\n\nmodule.exports = {\n MAX_SAFE_INTEGER,\n MAX_SAFE_INTEGER_LENGTH\n};\n","\"use strict\";\n\nconst absolute = require(\"./absolute.js\");\nconst clean = require(\"./clean.js\");\nconst long_division = require(\"./long_division.js\");\n\nfunction divide(dividend, divisor, options) {\n dividend = clean(dividend);\n divisor = clean(divisor);\n\n if (divisor === \"0\") throw new Error(\"[preciso] division by zero\");\n\n // sometimes dividend can be cleaned to \"\"\n if (dividend === \"\" || dividend === \"0\") return \"0\";\n\n const dividend_is_positive = dividend[0] !== \"-\";\n const divisor_is_positive = divisor[0] !== \"-\";\n\n const out_sign = dividend_is_positive !== divisor_is_positive ? \"-\" : \"\";\n\n if (!dividend_is_positive) dividend = absolute(dividend);\n if (!divisor_is_positive) divisor = absolute(divisor);\n\n return out_sign + long_division(dividend, divisor, options);\n}\n\nmodule.exports = divide;\nmodule.exports.default = divide;\n","\"use strict\";\n\n// convert exponential notation to normal string\n// not optimized yet and no support for big numbers\nfunction expand(n) {\n // remove + from beginning\n if (n[0] === \"+\") n = n.substring(1);\n\n const sign = n[0] === \"-\" ? \"-\" : \"\";\n if (sign === \"-\") n = n.substring(1);\n\n const index_of_e = n.indexOf(\"e\");\n\n // number not in exponential notation\n if (index_of_e === -1) return sign + n;\n\n let index_of_dot = n.indexOf(\".\");\n\n // if number doesn't include a period dot\n // then just assume it at the end\n // such that 3e4 has index of dot at 1\n if (index_of_dot === -1) index_of_dot = index_of_e;\n\n const shift = Number(n.substring(index_of_e + 1));\n\n // remove old decimal place\n const base = n.substring(0, index_of_e).replace(\".\", \"\");\n\n // normalize shift to start of the string at index zero\n const normshift = index_of_dot + shift;\n\n const baselen = base.length;\n\n if (normshift >= baselen) {\n const zct = normshift - baselen;\n let result = base;\n for (let i = 0; i < zct; i++) result += \"0\";\n return sign + result;\n } else if (normshift < 0) {\n // need to add zeros in decimal places\n let result = \"0.\";\n for (let i = 0; i > normshift; i--) result += \"0\";\n result += base;\n return sign + result;\n } else {\n // shifting within the base\n return sign + base.substring(0, normshift) + \".\" + base.substring(normshift);\n }\n}\n\nmodule.exports = expand;\nmodule.exports.default = expand;\n","\"use strict\";\n\nconst { MAX_SAFE_INTEGER_LENGTH } = require(\"./constants.js\");\n\n// assumes both numbers are positive numbers\nfunction long_addition(a, b) {\n const alen = a.length;\n const blen = b.length;\n\n const aidx = a.indexOf(\".\");\n const bidx = b.indexOf(\".\");\n\n // basically where would the dot be\n // if we add a dot at the end of integers\n // like 123.\n const a_adjusted_dot_index = aidx === -1 ? alen : aidx;\n const b_adjusted_dot_index = bidx === -1 ? blen : bidx;\n\n // just use floating point arithmetic for small integers\n if (aidx === -1 && bidx === -1 && alen < MAX_SAFE_INTEGER_LENGTH && blen < MAX_SAFE_INTEGER_LENGTH) {\n return (Number(a) + Number(b)).toFixed();\n }\n\n // how much you need to shift the second number\n // to line up the decimal with the first\n // 0.12345\n // 12345.0\n\n const offset = a_adjusted_dot_index - b_adjusted_dot_index;\n\n let left = Math.max(a_adjusted_dot_index, b_adjusted_dot_index);\n\n let right = Math.max(alen - a_adjusted_dot_index - 1, blen - b_adjusted_dot_index - 1);\n\n let aoffset = offset < 0 ? -1 * offset : 0;\n let boffset = offset <= 0 ? 0 : offset;\n\n let imax = left + 1 + right - 1; // -1 for zero-index\n\n let result = \"\";\n\n let carried = 0;\n\n // to the right of the period\n // 0.12345\n // 12345.0\n let i = imax;\n if (right > 0) {\n while (i > imax - right) {\n const achar = a[i - aoffset] || \"0\";\n const bchar = b[i - boffset] || \"0\";\n let n = Number(achar) + Number(bchar) + carried;\n if (n >= 10) {\n n -= 10;\n carried = 1;\n } else {\n carried = 0;\n }\n if (result !== \"\" || n !== 0) {\n result = n + result;\n }\n i--;\n }\n if (result) result = \".\" + result;\n i--; // substract 1 for dot\n }\n\n if (left > 0) {\n while (i >= 0) {\n const achar = a[i - aoffset] || \"0\";\n const bchar = b[i - boffset] || \"0\";\n let n = Number(achar) + Number(bchar) + carried;\n if (n >= 10) {\n n -= 10;\n carried = 1;\n } else {\n carried = 0;\n }\n result = n + result;\n i--;\n }\n }\n\n if (carried === 1) {\n result = carried + result;\n }\n\n if (result[0] === \".\") result = \"0\" + result;\n\n return result;\n}\n\nmodule.exports = long_addition;\nmodule.exports.default = long_addition;\n","\"use strict\";\n\nconst compare_positive = require(\"./compare_positive.js\");\nconst add = require(\"./add.js\");\nconst subtract = require(\"./subtract.js\");\nconst round_last_decimal = require(\"./round_last_decimal.js\");\n\n// given dividend and divisor are positive numberical strings\nfunction long_division(dividend, divisor, { max_decimal_digits = 100, ellipsis = false } = {}) {\n // remove unnecessary starting zeros\n // ex: 0.5 => .5\n if (dividend[0] === \"0\") dividend = dividend.substring(1);\n if (divisor[0] === \"0\") divisor = divisor.substring(1);\n\n const dividend_index_of_dot = dividend.indexOf(\".\");\n const divisor_index_of_dot = divisor.indexOf(\".\");\n\n const adjusted_dividend_index_of_dot = dividend_index_of_dot === -1 ? dividend.length : dividend_index_of_dot;\n const divisor_num_decimal_places = divisor_index_of_dot === -1 ? 0 : divisor.length - 1 - divisor_index_of_dot;\n\n // whether the result has a repeating decimal\n // e.g. 1/3 is repeating as in \"0.333...\"\n let repeating = false;\n\n // remove decimals\n dividend = dividend.replace(/\\./, \"\");\n divisor = divisor.replace(/\\./, \"\");\n\n const dividend_length = dividend.length;\n\n let current = \"\";\n let quotient = \"\";\n let comparison;\n let offset = -1 * divisor_num_decimal_places;\n let skip = 0;\n for (let i = 0; i < dividend_length; i++) {\n const char = dividend[i];\n\n current += char;\n\n comparison = compare_positive(current, divisor);\n\n if (comparison === \">\") {\n // same as const times = Math.floor(current / divisor);\n // but without floating point problems\n let times = 1;\n let product = add(divisor, divisor);\n let passed_product = divisor;\n while (compare_positive(product, current) !== \">\") {\n times++;\n passed_product = product;\n product = add(product, divisor);\n }\n times = times.toString();\n\n if (quotient !== \"\") {\n for (let i = times.length; i <= skip; i++) quotient += \"0\";\n }\n quotient += times; // string concatentation\n\n current = subtract(current, passed_product);\n\n skip = 0;\n } else if (comparison === \"<\") {\n if (quotient === \"\") {\n offset++;\n }\n skip++;\n\n // outside greater than inside\n continue;\n } else if (comparison === \"=\") {\n if (quotient !== \"\") {\n for (let i = 0; i < skip; i++) quotient += \"0\";\n }\n quotient += \"1\";\n current = \"0\";\n skip = 0;\n }\n }\n\n if (current.match(/^0+$/g)) {\n if (comparison === \"<\") {\n quotient += current.substring(0, current.length - 1);\n }\n } else {\n const previous = {};\n\n // keep dividing until we have an answer\n // figure out current place of decimal number\n const idot = adjusted_dividend_index_of_dot - offset;\n const qlen = quotient.length;\n // add 1 extra for rounding purposes\n const imax = idot - qlen + max_decimal_digits + 1;\n\n // reset skip if just \"\" so far because don't want to count 0 in 0.\n if (quotient === \"\") {\n skip = 0;\n }\n\n for (let i = 0; i < imax; i++) {\n current += \"0\";\n if (ellipsis) {\n if (current in previous) {\n previous[current]++;\n if (previous[current] > 3) {\n quotient += \"...\";\n repeating = true;\n break;\n }\n } else {\n previous[current] = 1;\n }\n }\n const comparison = compare_positive(current, divisor);\n\n if (comparison === \">\") {\n // inside greater than outside\n\n // how many times the divisor goes into the current\n let times = 1;\n let product = add(divisor, divisor);\n let passed_product = divisor;\n while (compare_positive(product, current) !== \">\") {\n times++;\n passed_product = product;\n product = add(product, divisor);\n }\n\n times = times.toString();\n\n // pad left zeros\n for (let i = times.length; i <= skip; i++) quotient += \"0\";\n quotient += times; // string concatentation\n current = subtract(current, passed_product);\n\n if (current === \"0\") {\n break;\n }\n\n skip = 0;\n } else if (comparison === \"<\") {\n // outside greater than inside\n skip++;\n continue;\n } else if (comparison === \"=\") {\n // fill in previous with zeros\n for (let i = 0; i < skip; i++) quotient += \"0\";\n quotient += \"1\";\n skip = 0;\n break;\n }\n }\n }\n\n // reinsert decimal place\n\n const idot = adjusted_dividend_index_of_dot - offset;\n const qlen = quotient.length;\n\n let num_decimals;\n\n if (idot === qlen) {\n // integer number so don't do anything\n num_decimals = 0;\n } else if (idot < 0) {\n quotient = \"0.\" + \"0\".repeat(Math.abs(idot)) + quotient;\n num_decimals = qlen - idot; // idot is negative, so adding\n } else if (idot > qlen) {\n // add more zeros to integer\n for (let i = qlen; i < idot; i++) quotient += \"0\";\n num_decimals = 0;\n } else if (idot < qlen) {\n quotient = quotient.substring(0, idot) + \".\" + quotient.substring(idot);\n num_decimals = qlen - idot;\n } else if (idot === 0) {\n quotient = \"0.\" + quotient;\n num_decimals = qlen;\n }\n\n // remove zeros from front\n // 03938.123 => 3938.123\n quotient = quotient.replace(/^0+/, \"\");\n\n // remove extra zeros from the end\n quotient = quotient.replace(/\\.\\d+0+$/, \"\");\n\n // round if necessary\n if (!repeating) {\n const extra_decimals = num_decimals - max_decimal_digits;\n if (extra_decimals > 0) {\n quotient = round_last_decimal(quotient.substring(0, quotient.length - extra_decimals + 1));\n }\n }\n\n if (quotient[0] === \".\") quotient = \"0\" + quotient;\n\n return quotient;\n}\n\nmodule.exports = long_division;\nmodule.exports.default = long_division;\n","\"use strict\";\n\nconst { MAX_SAFE_INTEGER_LENGTH } = require(\"./constants.js\");\n\nconst CHUNK_SIZE = 15;\n\n/**\n *\n * @param {String} a - numerical string larger or equal to b\n * @param {String} b - numerical string smaller or equal to a\n * @returns {String} product - result of multiplying a with b\n */\n\nfunction long_multiplication(a, b) {\n if (a === \"0\" || b === \"0\") return \"0\";\n\n const top_index_of_dot = a.indexOf(\".\");\n const bottom_index_of_dot = b.indexOf(\".\");\n\n const a_num_integer_places = top_index_of_dot === -1 ? a.length : top_index_of_dot;\n const b_num_integer_places = bottom_index_of_dot === -1 ? b.length : bottom_index_of_dot;\n const max_total_num_integer_places = a_num_integer_places + b_num_integer_places;\n\n const a_num_decimal_places = top_index_of_dot === -1 ? 0 : a.length - 1 - top_index_of_dot;\n const b_num_decimal_places = bottom_index_of_dot === -1 ? 0 : b.length - 1 - bottom_index_of_dot;\n\n const out_num_decimal_places = a_num_decimal_places + b_num_decimal_places;\n\n if (out_num_decimal_places === 0 && max_total_num_integer_places < MAX_SAFE_INTEGER_LENGTH) {\n return (Number(a) * Number(b)).toFixed(0);\n }\n\n // remove decimals\n const aint = a.replace(\".\", \"\");\n const bint = b.replace(\".\", \"\");\n\n const alen = aint.length;\n const blen = bint.length;\n\n const chunks = [];\n let i = alen;\n while (i >= 0) {\n const end = i;\n const start = (i -= CHUNK_SIZE);\n const str = aint.substring(start, end);\n chunks.push([Number(str), str.length]);\n }\n\n const partial_products = [];\n const partials = [];\n\n // for each number in multiplier\n for (let i = 0, ireverse = blen - 1; ireverse >= 0; ireverse--, i++) {\n const bstr = bint[ireverse];\n\n const bnum = Number(bstr);\n\n let carried = 0;\n let partial = \"\";\n const ichunklast = chunks.length - 1;\n chunks.forEach(([chunk, chunklen], c) => {\n const subpartial = carried + bnum * chunk;\n let subpartstr = subpartial.toString();\n const subpartcharlen = subpartstr.length;\n if (subpartcharlen > chunklen && c !== ichunklast) {\n const islice = -1 * chunklen;\n partial = subpartstr.slice(islice) + partial;\n carried = Number(subpartstr.slice(0, islice));\n } else {\n const imax = chunklen - subpartcharlen;\n for (let i = 0; i < imax; i++) {\n subpartstr = \"0\" + subpartstr;\n }\n carried = 0;\n partial = subpartstr + partial;\n }\n });\n\n // add number of zeros at end\n partial += \"0\".repeat(i);\n\n partial_products.push(partial);\n\n partials.push([Array.from(partial).map(char => Number(char)), partial.length]);\n }\n\n // back to front, iterate through columns\n // and add partial products together\n const num_partials = partial_products.length;\n\n const number_of_columns = partials[partials.length - 1][1] + num_partials;\n\n let result = \"\";\n let carried = 0;\n for (let icol = 0; icol < number_of_columns; icol++) {\n let sum = carried;\n const pmax = Math.min(icol, num_partials - 1);\n for (let p = 0; p <= pmax; p++) {\n const [pnums, plen] = partials[p];\n const i = plen - 1 - icol;\n if (i >= 0) {\n sum += pnums[i];\n }\n }\n\n if (sum >= 10) {\n sum = sum.toString();\n result = sum[sum.length - 1] + result;\n carried = Number(sum.slice(0, -1));\n } else {\n result = sum + result;\n carried = 0;\n }\n }\n\n // add decimal back in\n if (out_num_decimal_places === 0) {\n // integer\n // remove extra zeros\n result = result.replace(/^0+/, \"\");\n } else {\n // decimal number\n const idot = result.length - out_num_decimal_places;\n\n result = result.substring(0, idot) + \".\" + result.substring(idot);\n\n // remove zeros from front\n result = result.replace(/^0+/, \"\");\n\n // remove extra zeros from the end\n result = result.replace(/\\.?0+$/, \"\");\n\n if (result[0] === \".\") result = \"0\" + result;\n }\n\n return result;\n}\n\nmodule.exports = long_multiplication;\nmodule.exports.default = long_multiplication;\n","\"use strict\";\n\n// const lookup = {};\n// const vals = [undefined, 0, 1, 2, 3, 4, 5, 6, 8, 9];\n// vals.forEach(top => {\n// lookup[top] = {};\n// vals.forEach(bottom => {\n// lookup[top][bottom] = (top || 0) - (bottom || 0);\n// })\n// });\n\nconst { MAX_SAFE_INTEGER_LENGTH } = require(\"./constants.js\");\n\n// assumes (1) both a and b are positive numbers\n// and (2) a is larger than b\nfunction long_subtraction(a, b) {\n const alen = a.length;\n const blen = b.length;\n\n const aidx = a.indexOf(\".\");\n const bidx = b.indexOf(\".\");\n\n // basically where would the dot be\n // if we add a dot at the end of integers\n // like 123.\n const a_adjusted_dot_index = aidx === -1 ? alen : aidx;\n const b_adjusted_dot_index = bidx === -1 ? blen : bidx;\n // console.log({a_adjusted_dot_index, b_adjusted_dot_index});\n\n // how much you need to shift the second number\n // to line up the decimal with the first\n // 0.12345\n // 12345.0\n\n // just use floating point arithmetic for small integers\n if (aidx === -1 && bidx === -1 && alen < MAX_SAFE_INTEGER_LENGTH && blen < MAX_SAFE_INTEGER_LENGTH) {\n return (Number(a) - Number(b)).toFixed();\n }\n\n const offset = a_adjusted_dot_index - b_adjusted_dot_index;\n // console.log(\"offset:\", offset);\n\n let left = Math.max(a_adjusted_dot_index, b_adjusted_dot_index);\n // console.log(\"left:\", left);\n\n let right = Math.max(alen - a_adjusted_dot_index - 1, blen - b_adjusted_dot_index - 1);\n // console.log(\"right:\", right);\n\n let aoffset = offset < 0 ? -1 * offset : 0;\n let boffset = offset <= 0 ? 0 : offset;\n // console.log({aoffset, boffset});\n\n let imax = left + 1 + right - 1; // -1 for zero-index\n // console.log({imax});\n\n let result = \"\";\n\n // number of borrowings\n let borrowed = 0;\n\n // to the right of the period\n // 100.5 6 7\n // 2.2 9 3\n // (-3 + 10) 4\n let i = imax;\n if (right > 0) {\n while (i > imax - right) {\n // console.log(\"\\n\\n\", {i});\n let top = a[i - aoffset] || \"0\";\n let bottom = b[i - boffset] || \"0\";\n\n // console.log(\"pre borrowing\", {top, bottom});\n top -= borrowed;\n borrowed = 0;\n\n // console.log(\"after borrowing\", {top, bottom});\n let n = top - bottom;\n\n // console.log({n});\n if (n < 0) {\n while (n < 0) {\n borrowed++;\n n += 10;\n }\n } else if (borrowed) {\n borrowed--;\n }\n // console.log({n});\n if (result !== \"\" || n !== 0) {\n result = n + result;\n }\n i--;\n }\n if (result !== \"\") {\n result = \".\" + result;\n }\n i--; // substract 1 for dot\n }\n\n // console.log({result});\n\n if (left > 0) {\n while (i > 0) {\n // console.log(\"\\n\\n\", {i});\n let top = a[i - aoffset] || \"0\";\n let bottom = b[i - boffset] || \"0\";\n\n // console.log(\"pre borrowing\", {top, bottom});\n top -= borrowed;\n borrowed = 0;\n\n // console.log(\"after borrowing\", {top, bottom});\n let n = top - bottom;\n\n // console.log({n});\n if (n < 0) {\n while (n < 0) {\n borrowed++;\n n += 10;\n }\n } else if (borrowed) {\n borrowed--;\n }\n // console.log({n});\n result = n + result;\n i--;\n }\n\n // console.log({borrowed});\n // special rule for last one\n const achar = a[0 - aoffset] || \"0\";\n const bchar = b[0 - boffset] || \"0\";\n let n = Number(achar) - (borrowed > 0 ? 1 : 0) - Number(bchar);\n if (n !== 0) {\n result = n + result;\n }\n\n // remove any zeros in front like in 0123\n result = result.replace(/^0+/, \"\");\n }\n\n // if decimal number add zero\n if (result[0] === \".\") result = \"0\" + result;\n\n return result;\n}\n\nmodule.exports = long_subtraction;\nmodule.exports.default = long_subtraction;\n","\"use strict\";\n\nconst absolute = require(\"./absolute.js\");\nconst clean = require(\"./clean.js\");\nconst compare_positive = require(\"./compare_positive.js\");\nconst long_multiplication = require(\"./long_multiplication.js\");\n\nfunction multiply(a, b) {\n a = clean(a);\n b = clean(b);\n\n const apos = a[0] !== \"-\";\n const bpos = b[0] !== \"-\";\n\n const out_sign = apos !== bpos ? \"-\" : \"\";\n\n a = absolute(a);\n b = absolute(b);\n\n const comparison = compare_positive(a, b);\n\n if (comparison === \"<\") {\n const aold = a;\n const bold = b;\n a = bold;\n b = aold;\n }\n\n return out_sign + long_multiplication(a, b);\n}\n\nmodule.exports = multiply;\nmodule.exports.default = multiply;\n","\"use strict\";\n\nconst add = require(\"./add.js\");\nconst truncate_decimal = require(\"./truncate_decimal.js\");\n\n// given n is a positive decimal number\nconst up = [\"5\", \"6\", \"7\", \"8\", \"9\"];\n\nfunction round_last_decimal(n) {\n // will round up to an integer\n if (n.match(/\\.9+$/)) {\n return add(truncate_decimal(n), \"1\");\n }\n\n // remove + from beginning\n if (n[0] === \"+\") n = n.substring(1);\n\n //console.log(\"rounding:\", {n});\n const len = n.length;\n //console.log({len});\n let result = \"\";\n\n const last_char = n[n.length - 1];\n //console.log({last_char});\n\n if (up.includes(last_char)) {\n let i;\n for (i = len - 2; i >= 0; i--) {\n const char = n[i];\n //console.log({char});\n // skip over . or -\n if (char === \".\" || char === \"-\") continue;\n\n const nchar = Number(char) + 1;\n //console.log({nchar});\n\n if (nchar === 10) {\n result = \"0\" + result;\n // keep rounding up\n } else {\n result = nchar + result;\n break;\n }\n }\n //console.log({i});\n if (i > 0) result = n.substring(0, i) + result;\n } else {\n result = n.substring(0, len - 1);\n }\n\n if (result[result.length - 1] === \".\") result = result.substring(0, result.length - 1);\n\n // remove trailing zeros in decimal number\n // 0.50 => 0.5\n if (result.indexOf(\".\") > -1) result = result.replace(/0+$/, \"\");\n\n return result;\n}\n\nmodule.exports = round_last_decimal;\nmodule.exports.default = round_last_decimal;\n","\"use strict\";\n\nconst clean = require(\"./clean\");\nconst compare_positive = require(\"./compare_positive.js\");\nconst long_addition = require(\"./long_addition.js\");\nconst long_subtraction = require(\"./long_subtraction.js\");\n\nfunction subtract(a, b) {\n a = clean(a);\n b = clean(b);\n\n const a_is_positive = a[0] !== \"-\";\n const b_is_positive = b[0] !== \"-\";\n if (a_is_positive) {\n if (b_is_positive) {\n const comparison = compare_positive(a, b);\n if (comparison === \">\") {\n return long_subtraction(a, b);\n } else if (comparison === \"<\") {\n return \"-\" + long_subtraction(b, a);\n } else {\n return \"0\";\n }\n } else {\n return long_addition(a, b.substring(1));\n }\n } else if (b_is_positive) {\n return \"-\" + long_addition(a.substring(1), b);\n } else {\n a = a.substring(1);\n b = b.substring(1);\n const comparison = compare_positive(a, b);\n if (comparison === \">\") {\n return \"-\" + long_subtraction(a, b);\n } else if (comparison === \"<\") {\n return long_subtraction(b, a);\n } else {\n return \"0\";\n }\n }\n}\n\nmodule.exports = subtract;\nmodule.exports.default = subtract;\n","\"use strict\";\n\n// given n is a decimal number\nfunction truncate_decimal(n) {\n return n.substring(0, n.indexOf(\".\"));\n}\n\nmodule.exports = truncate_decimal;\nmodule.exports.default = truncate_decimal;\n","// takes in image data array and sets alpha value to 0 for parts outside the mask geometry\nfunction maskImageData({\n data,\n data_bbox,\n data_height,\n data_width,\n data_srs,\n debug = false,\n geomask,\n mask,\n mask_srs,\n reproject,\n strategy = \"outside\",\n edition\n}) {\n if (![\"inside\", \"outside\"].includes(strategy)) {\n throw new Error(`[geocanvas] strategy can be either \"inside\" or \"outside\". you provided \"${strategy}\"`);\n }\n const { rows } = geomask[strategy]({\n raster_bbox: data_bbox,\n raster_height: data_height,\n raster_width: data_width,\n raster_srs: data_srs,\n mask,\n mask_srs,\n reproject\n });\n\n rows.forEach((ranges, r) => {\n if (ranges) {\n const row_offset = r * 4 * data_width;\n ranges.forEach(([start, end]) => {\n for (let c = start; c <= end; c++) {\n data[row_offset + c * 4 + 3] = 0; // set alpha to zero\n }\n });\n }\n });\n}\n\nfunction maskCanvas({\n canvas,\n canvas_bbox,\n canvas_srs,\n geomask,\n mask,\n mask_srs,\n reproject,\n strategy = \"outside\",\n edition,\n debug = false\n}) {\n if (debug) console.log(\"[geocanvas] starting to mask canvas\");\n if (![\"inside\", \"outside\"].includes(strategy)) {\n throw new Error(`[geocanvas] strategy can be either \"inside\" or \"outside\". you provided \"${strategy}\"`);\n }\n const context = canvas.getContext(\"2d\");\n const { height, width } = canvas;\n if (debug) console.log(`[geocanvas] canvas height is ${height} pixels`);\n if (debug) console.log(`[geocanvas] canvas width is ${width} pixels`);\n const imageData = context.getImageData(0, 0, width, height);\n maskImageData({\n data: imageData.data,\n data_bbox: canvas_bbox,\n data_height: height,\n data_srs: canvas_srs,\n data_width: width,\n debug,\n geomask,\n mask,\n mask_srs,\n reproject,\n strategy\n });\n if (debug) console.log(\"[geocanvas] image data after masking:\", imageData);\n context.putImageData(imageData, 0, 0);\n if (debug) console.log(\"[geocanvas] put image data back\");\n return canvas;\n}\n\nmodule.exports = { maskImageData, maskCanvas };\n","const geomask = require(\"geomask\");\nconst core = require(\"./core.js\");\n\nfunction maskImageData(options) {\n return core.maskImageData({ ...options, edition: \"full\", geomask });\n}\n\nfunction maskCanvas(options) {\n return core.maskCanvas({ ...options, edition: \"full\", geomask });\n}\n\nconst geocanvas = { maskImageData, maskCanvas };\n\nif (typeof define === \"function\" && define.amd)\n define(function () {\n return geocanvas;\n });\nif (typeof module === \"object\") module.exports = geocanvas;\nif (typeof self === \"object\") self.geocanvas = geocanvas;\nif (typeof window === \"object\") window.geocanvas = geocanvas;\n","const lite = require(\"./lite.js\");\nconst reprojectGeoJSON = require(\"reproject-geojson\");\n\nfunction calcMask({\n debug = false,\n fname,\n raster_bbox,\n raster_srs,\n raster_height,\n raster_width,\n pixel_height,\n pixel_width,\n mask,\n mask_srs\n}) {\n if (raster_srs !== mask_srs) {\n mask = reprojectGeoJSON(mask, { from: mask_srs, to: raster_srs });\n }\n\n return lite[fname]({\n debug,\n raster_bbox,\n raster_height,\n raster_width,\n pixel_height,\n pixel_width,\n mask\n });\n}\n\nfunction inside(options) {\n return calcMask({ ...options, fname: \"inside\" });\n}\n\nfunction outside(options) {\n return calcMask({ ...options, fname: \"outside\" });\n}\n\nconst geomask = { inside, outside };\n\nif (typeof module === \"object\") module.exports = geomask;\n","const dufour_peyton_intersection = require(\"dufour-peyton-intersection\");\nconst subtract = require(\"preciso/subtract.js\");\nconst divide = require(\"preciso/divide.js\");\nconst reprojectGeoJSON = require(\"reproject-geojson/pluggable.js\");\nconst segflip = require(\"segflip\");\n\nfunction checkRows({ rows }) {\n rows.forEach((segs, irow) => {\n if (segs) {\n segs.forEach(([start, end], iseg) => {\n if (start > end) {\n throw Error(`uh oh: invalid segment at row ${irow}, segment ${iseg}`);\n }\n });\n }\n });\n}\n\nfunction inside({\n debug = false,\n raster_bbox,\n raster_height,\n raster_width,\n pixel_height,\n pixel_width,\n mask,\n reproject\n}) {\n if (typeof reproject === \"function\") {\n // reproject geometry to the srs of the raster\n mask = reprojectGeoJSON(mask, { in_place: false, reproject });\n }\n\n if (pixel_height === undefined)\n pixel_height = Number(\n divide(subtract(raster_bbox[3].toString(), raster_bbox[1].toString()), raster_height.toString())\n );\n if (pixel_width === undefined)\n pixel_width = Number(\n divide(subtract(raster_bbox[2].toString(), raster_bbox[0].toString()), raster_width.toString())\n );\n\n const { rows } = dufour_peyton_intersection.calculate({\n raster_bbox,\n raster_height,\n raster_width,\n pixel_height,\n pixel_width,\n geometry: mask\n });\n\n if (debug) checkRows({ rows });\n\n return { rows };\n}\n\nfunction outside({\n debug = false,\n raster_bbox,\n raster_height,\n raster_width,\n pixel_height,\n pixel_width,\n mask,\n reproject\n}) {\n if (typeof reproject === \"function\") {\n // reproject geometry to the srs of the raster\n mask = reprojectGeoJSON(mask, { in_place: false, reproject });\n }\n\n if (pixel_height === undefined)\n pixel_height = Number(\n divide(subtract(raster_bbox[3].toString(), raster_bbox[1].toString()), raster_height.toString())\n );\n if (pixel_width === undefined)\n pixel_width = Number(\n divide(subtract(raster_bbox[2].toString(), raster_bbox[0].toString()), raster_width.toString())\n );\n\n // calculate inside segments\n const { rows: insides } = inside({\n debug,\n raster_bbox,\n raster_height,\n raster_width,\n pixel_height,\n pixel_width,\n mask\n });\n\n if (debug) checkRows({ rows: insides });\n\n const last_column_index = raster_width - 1;\n\n // consider optimizing memory and speed\n // by just returning a reference to a whole row\n // instead of generating a new array every time\n // const whole_row = [0, last_column_index];\n\n const outsides = [];\n // using for loop instead of map because\n // map skips empty insides/rows\n for (let i = 0; i < insides.length; i++) {\n const segs = insides[i];\n if (!Array.isArray(segs) || segs.length === 0) {\n outsides.push([[0, last_column_index]]);\n } else {\n outsides.push(\n segflip({\n segments: segs,\n min: 0,\n max: last_column_index,\n debug: false\n })\n );\n }\n }\n\n if (debug) checkRows({ rows: outsides });\n\n return { rows: outsides };\n}\n\nconst geomask = { inside, outside };\n\nif (typeof module === \"object\") module.exports = geomask;\n","const clean = require(\"./clean.js\");\nmodule.exports = function absolute(n) {\n n = clean(n);\n if (n[0] === \"-\") return n.substring(1);\n else return n;\n};\n","const compare_positive = require(\"./compare_positive.js\");\nconst clean = require(\"./clean.js\");\nconst long_addition = require(\"./long_addition.js\");\nconst long_subtraction = require(\"./long_subtraction.js\");\n\nmodule.exports = function add(a, b) {\n a = clean(a);\n b = clean(b);\n\n const apos = a[0] !== \"-\";\n const bpos = b[0] !== \"-\";\n\n if (apos && bpos) {\n return long_addition(a, b);\n } else if (!apos && !bpos) {\n return \"-\" + long_addition(a.substring(1), b.substring(1));\n } else if (!apos && bpos) {\n a = a.substring(1);\n switch (compare_positive(a, b)) {\n case \"=\":\n return \"0\";\n case \"<\":\n return long_subtraction(b, a);\n case \">\":\n return \"-\" + long_subtraction(a, b);\n }\n } else if (apos && !bpos) {\n b = b.substring(1);\n switch (compare_positive(a, b)) {\n case \"=\":\n return \"0\";\n case \"<\":\n return \"-\" + long_subtraction(b, a);\n case \">\":\n return long_subtraction(a, b);\n }\n }\n};\n","const expand = require(\"./expand.js\");\n\nmodule.exports = function clean(n) {\n // remove + from beginning\n if (n[0] === \"+\") n = n.substring(1);\n\n n = expand(n);\n\n // remove extra zero in front\n // 03938.123 => 3938.123\n n = n.replace(/^0+(?=\\d)/, \"\");\n\n // remove extra zero at end\n\n return n;\n};\n","const clean = require(\"./clean.js\");\n\n// given:\n// - a and b are positive numbers\n// - a and b have been cleaned (i.e. no + or leading zeros)\nmodule.exports = function compare_positive(a, b) {\n const alen = a.length;\n const blen = b.length;\n\n const aidx = a.indexOf(\".\");\n const bidx = b.indexOf(\".\");\n\n // basically where would the dot be\n // if we add a dot at the end of integers\n // like 123.\n const a_adjusted_dot_index = aidx === -1 ? alen : aidx;\n const b_adjusted_dot_index = bidx === -1 ? blen : bidx;\n\n // how much you need to shift the second number\n // to line up the decimal with the first\n // 0.12345\n // 12345.0\n\n const offset = a_adjusted_dot_index - b_adjusted_dot_index;\n\n let left = Math.max(a_adjusted_dot_index, b_adjusted_dot_index);\n\n let right = Math.max(alen - a_adjusted_dot_index, blen - b_adjusted_dot_index);\n\n let aoffset = offset < 0 ? -1 * offset : 0;\n let boffset = offset <= 0 ? 0 : offset;\n\n let imax = left + 1 + right - 1; // -1 for zero-index\n\n let i = 0;\n while (i < imax) {\n const achar = a[i - aoffset] || \"0\";\n const bchar = b[i - boffset] || \"0\";\n if (achar !== bchar) {\n if (achar > bchar) return \">\";\n else if (achar < bchar) return \"<\";\n }\n i++;\n }\n\n return \"=\";\n};\n","const absolute = require(\"./absolute.js\");\nconst clean = require(\"./clean.js\");\nconst long_division = require(\"./long_division.js\");\n\nmodule.exports = function (dividend, divisor, options) {\n dividend = clean(dividend);\n divisor = clean(divisor);\n\n const dividend_is_positive = dividend[0] !== \"-\";\n const divisor_is_positive = divisor[0] !== \"-\";\n\n const out_sign = dividend_is_positive !== divisor_is_positive ? \"-\" : \"\";\n\n if (!dividend_is_positive) dividend = absolute(dividend);\n if (!divisor_is_positive) divisor = absolute(divisor);\n\n return out_sign + long_division(dividend, divisor, options);\n};\n","// convert exponential notation to normal string\n// not optimized yet and no support for big numbers\nmodule.exports = function expand(n) {\n // remove + from beginning\n if (n[0] === \"+\") n = n.substring(1);\n\n const sign = n[0] === \"-\" ? \"-\" : \"\";\n if (sign === \"-\") n = n.substring(1);\n\n const index_of_e = n.indexOf(\"e\");\n\n // number not in exponential notation\n if (index_of_e === -1) return sign + n;\n\n let index_of_dot = n.indexOf(\".\");\n\n // if number doesn't include a period dot\n // then just assume it at the end\n // such that 3e4 has index of dot at 1\n if (index_of_dot === -1) index_of_dot = index_of_e;\n\n const shift = Number(n.substring(index_of_e + 1));\n\n // remove old decimal place\n const base = n.substring(0, index_of_e).replace(\".\", \"\");\n\n // normalize shift to start of the string at index zero\n const normshift = index_of_dot + shift;\n\n const baselen = base.length;\n\n if (normshift >= baselen) {\n const zct = normshift - baselen;\n let result = base;\n for (let i = 0; i < zct; i++) result += \"0\";\n return sign + result;\n } else if (normshift < 0) {\n // need to add zeros in decimal places\n result = \"0.\";\n for (let i = 0; i > normshift; i--) result += \"0\";\n result += base;\n return sign + result;\n } else {\n // shifting within the base\n return sign + base.substring(0, normshift) + \".\" + base.substring(normshift);\n }\n};\n","// assumes both numbers are positive integers\nmodule.exports = function long_addition(a, b) {\n // assuming both positive for now\n\n const alen = a.length;\n const blen = b.length;\n\n const aidx = a.indexOf(\".\");\n const bidx = b.indexOf(\".\");\n\n // basically where would the dot be\n // if we add a dot at the end of integers\n // like 123.\n const a_adjusted_dot_index = aidx === -1 ? alen : aidx;\n const b_adjusted_dot_index = bidx === -1 ? blen : bidx;\n\n // how much you need to shift the second number\n // to line up the decimal with the first\n // 0.12345\n // 12345.0\n\n const offset = a_adjusted_dot_index - b_adjusted_dot_index;\n\n let left = Math.max(a_adjusted_dot_index, b_adjusted_dot_index);\n\n let right = Math.max(alen - a_adjusted_dot_index - 1, blen - b_adjusted_dot_index - 1);\n\n let aoffset = offset < 0 ? -1 * offset : 0;\n let boffset = offset <= 0 ? 0 : offset;\n\n let imax = left + 1 + right - 1; // -1 for zero-index\n\n let result = \"\";\n\n let carried = 0;\n\n // to the right of the period\n // 0.12345\n // 12345.0\n let i = imax;\n if (right > 0) {\n while (i > imax - right) {\n const achar = a[i - aoffset] || \"0\";\n const bchar = b[i - boffset] || \"0\";\n let n = Number(achar) + Number(bchar) + carried;\n if (n >= 10) {\n n -= 10;\n carried = 1;\n } else {\n carried = 0;\n }\n if (result !== \"\" || n !== 0) {\n result = n + result;\n }\n i--;\n }\n if (result) result = \".\" + result;\n i--; // substract 1 for dot\n }\n\n if (left > 0) {\n while (i >= 0) {\n const achar = a[i - aoffset] || \"0\";\n const bchar = b[i - boffset] || \"0\";\n let n = Number(achar) + Number(bchar) + carried;\n if (n >= 10) {\n n -= 10;\n carried = 1;\n } else {\n carried = 0;\n }\n result = n + result;\n i--;\n }\n }\n\n if (carried === 1) {\n result = carried + result;\n }\n\n return result;\n};\n","const compare_positive = require(\"./compare_positive.js\");\nconst add = require(\"./add.js\");\nconst multiply = require(\"./multiply.js\");\nconst subtract = require(\"./subtract.js\");\nconst round_last_decimal = require(\"./round_last_decimal.js\");\n\n// given dividend and divisor are positive numberical strings\nmodule.exports = function long_division(dividend, divisor, { max_decimal_digits = 100, ellipsis = false } = {}) {\n // remove unnecessary starting zeros\n // ex: 0.5 => .5\n if (dividend[0] === \"0\") dividend = dividend.substring(1);\n if (divisor[0] === \"0\") divisor = divisor.substring(1);\n\n const dividend_index_of_dot = dividend.indexOf(\".\");\n const divisor_index_of_dot = divisor.indexOf(\".\");\n\n const adjusted_dividend_index_of_dot = dividend_index_of_dot === -1 ? dividend.length : dividend_index_of_dot;\n const divisor_num_decimal_places = divisor_index_of_dot === -1 ? 0 : divisor.length - 1 - divisor_index_of_dot;\n\n // whether the result has a repeating decimal\n // e.g. 1/3 is repeating as in \"0.333...\"\n let repeating = false;\n\n // remove decimals\n dividend = dividend.replace(/\\./, \"\");\n divisor = divisor.replace(/\\./, \"\");\n\n const dividend_length = dividend.length;\n\n let current = \"\";\n let quotient = \"\";\n let comparison;\n let offset = -1 * divisor_num_decimal_places;\n let skip = 0;\n for (let i = 0; i < dividend_length; i++) {\n const char = dividend[i];\n\n current += char;\n\n comparison = compare_positive(current, divisor);\n\n if (comparison === \">\") {\n // same as const times = Math.floor(current / divisor);\n // but without floating point problems\n let times = 1;\n let product = add(divisor, divisor);\n let passed_product = divisor;\n while (compare_positive(product, current) !== \">\") {\n times++;\n passed_product = product;\n product = add(product, divisor);\n }\n times = times.toString();\n\n if (quotient !== \"\") {\n for (let i = times.length; i <= skip; i++) quotient += \"0\";\n }\n quotient += times; // string concatentation\n\n current = subtract(current, passed_product);\n\n skip = 0;\n } else if (comparison === \"<\") {\n if (quotient === \"\") {\n offset++;\n }\n skip++;\n\n // outside greater than inside\n continue;\n } else if (comparison === \"=\") {\n if (quotient !== \"\") {\n for (let i = 0; i < skip; i++) quotient += \"0\";\n }\n quotient += \"1\";\n current = \"0\";\n skip = 0;\n }\n }\n\n if (current.match(/^0+$/g)) {\n if (comparison === \"<\") {\n quotient += current.substring(0, current.length - 1);\n }\n } else {\n const previous = {};\n\n // keep dividing until we have an answer\n // figure out current place of decimal number\n const idot = adjusted_dividend_index_of_dot - offset;\n const qlen = quotient.length;\n // add 1 extra for rounding purposes\n const imax = idot - qlen + max_decimal_digits + 1;\n\n // reset skip if just \"\" so far because don't want to count 0 in 0.\n if (quotient === \"\") {\n skip = 0;\n }\n\n for (let i = 0; i < imax; i++) {\n current += \"0\";\n if (ellipsis) {\n if (current in previous) {\n previous[current]++;\n if (previous[current] > 3) {\n quotient += \"...\";\n repeating = true;\n break;\n }\n } else {\n previous[current] = 1;\n }\n }\n const comparison = compare_positive(current, divisor);\n\n if (comparison === \">\") {\n // inside greater than outside\n\n // how many times the divisor goes into the current\n let times = 1;\n let product = add(divisor, divisor);\n let passed_product = divisor;\n while (compare_positive(product, current) !== \">\") {\n times++;\n passed_product = product;\n product = add(product, divisor);\n }\n\n times = times.toString();\n\n // pad left zeros\n for (let i = times.length; i <= skip; i++) quotient += \"0\";\n quotient += times; // string concatentation\n current = subtract(current, passed_product);\n\n if (current === \"0\") {\n break;\n }\n\n skip = 0;\n } else if (comparison === \"<\") {\n // outside greater than inside\n skip++;\n continue;\n } else if (comparison === \"=\") {\n // fill in previous with zeros\n for (let i = 0; i < skip; i++) quotient += \"0\";\n quotient += \"1\";\n skip = 0;\n break;\n }\n }\n }\n\n // reinsert decimal place\n\n const idot = adjusted_dividend_index_of_dot - offset;\n const qlen = quotient.length;\n\n let num_decimals;\n\n if (idot === qlen) {\n // integer number so don't do anything\n num_decimals = 0;\n } else if (idot < 0) {\n quotient = \"0.\" + \"0\".repeat(Math.abs(idot)) + quotient;\n num_decimals = qlen - idot; // idot is negative, so adding\n } else if (idot > qlen) {\n // add more zeros to integer\n for (let i = qlen; i < idot; i++) quotient += \"0\";\n num_decimals = 0;\n } else if (idot < qlen) {\n quotient = quotient.substring(0, idot) + \".\" + quotient.substring(idot);\n num_decimals = qlen - idot;\n } else if (idot === 0) {\n quotient = \"0.\" + quotient;\n num_decimals = qlen;\n }\n\n // remove zeros from front\n // 03938.123 => 3938.123\n quotient = quotient.replace(/^0+/, \"\");\n\n // remove extra zeros from the end\n quotient = quotient.replace(/\\.\\d+0+$/, \"\");\n\n // round if necessary\n if (!repeating) {\n const extra_decimals = num_decimals - max_decimal_digits;\n if (extra_decimals > 0) {\n quotient = round_last_decimal(quotient.substring(0, quotient.length - extra_decimals + 1));\n }\n }\n\n if (quotient[0] === \".\") quotient = \"0\" + quotient;\n\n return quotient;\n};\n","const CHUNK_SIZE = 15;\n\n/**\n *\n * @param {String} a - numerical string larger or equal to b\n * @param {String} b - numerical string smaller or equal to a\n * @returns {String} product - result of multiplying a with b\n */\n\nmodule.exports = function long_multiplication(a, b) {\n if (a === \"0\" || b === \"0\") return \"0\";\n\n const top_index_of_dot = a.indexOf(\".\");\n const bottom_index_of_dot = b.indexOf(\".\");\n\n const a_num_decimal_places = top_index_of_dot === -1 ? 0 : a.length - 1 - top_index_of_dot;\n const b_num_decimal_places = bottom_index_of_dot === -1 ? 0 : b.length - 1 - bottom_index_of_dot;\n\n const out_num_decimal_places = a_num_decimal_places + b_num_decimal_places;\n\n // remove decimals\n a = a.replace(\".\", \"\");\n b = b.replace(\".\", \"\");\n\n const alen = a.length;\n const blen = b.length;\n\n const chunks = [];\n let i = alen;\n while (i >= 0) {\n const end = i;\n const start = (i -= CHUNK_SIZE);\n const str = a.substring(start, end);\n chunks.push([Number(str), str.length]);\n }\n\n const partial_products = [];\n const partials = [];\n\n // for each number in multiplier\n for (let i = 0, ireverse = blen - 1; ireverse >= 0; ireverse--, i++) {\n const bstr = b[ireverse];\n\n const bnum = Number(bstr);\n\n let carried = 0;\n let partial = \"\";\n const ichunklast = chunks.length - 1;\n chunks.forEach(([chunk, chunklen], c) => {\n const subpartial = carried + bnum * chunk;\n let subpartstr = subpartial.toString();\n const subpartcharlen = subpartstr.length;\n if (subpartcharlen > chunklen && c !== ichunklast) {\n const islice = -1 * chunklen;\n partial = subpartstr.slice(islice) + partial;\n carried = Number(subpartstr.slice(0, islice));\n } else {\n const imax = chunklen - subpartcharlen;\n for (let i = 0; i < imax; i++) {\n subpartstr = \"0\" + subpartstr;\n }\n carried = 0;\n partial = subpartstr + partial;\n }\n });\n\n // add number of zeros at end\n partial += \"0\".repeat(i);\n\n partial_products.push(partial);\n\n partials.push([Array.from(partial).map(char => Number(char)), partial.length]);\n }\n\n // back to front, iterate through columns\n // and add partial products together\n const num_partials = partial_products.length;\n\n const number_of_columns = partials[partials.length - 1][1] + num_partials;\n\n let result = \"\";\n let carried = 0;\n for (let icol = 0; icol < number_of_columns; icol++) {\n let sum = carried;\n const pmax = Math.min(icol, num_partials - 1);\n for (let p = 0; p <= pmax; p++) {\n const [pnums, plen] = partials[p];\n const i = plen - 1 - icol;\n if (i >= 0) {\n sum += pnums[i];\n }\n }\n\n if (sum >= 10) {\n sum = sum.toString();\n result = sum[sum.length - 1] + result;\n carried = Number(sum.slice(0, -1));\n } else {\n result = sum + result;\n carried = 0;\n }\n }\n\n // add decimal back in\n if (out_num_decimal_places === 0) {\n // integer\n // remove extra zeros\n result = result.replace(/^0+/, \"\");\n } else {\n // decimal number\n const idot = result.length - out_num_decimal_places;\n\n result = result.substring(0, idot) + \".\" + result.substring(idot);\n\n // remove zeros from front\n result = result.replace(/^0+/, \"\");\n\n // remove extra zeros from the end\n result = result.replace(/\\.?0+$/, \"\");\n\n if (result[0] === \".\") result = \"0\" + result;\n }\n\n return result;\n};\n","// const lookup = {};\n// const vals = [undefined, 0, 1, 2, 3, 4, 5, 6, 8, 9];\n// vals.forEach(top => {\n// lookup[top] = {};\n// vals.forEach(bottom => {\n// lookup[top][bottom] = (top || 0) - (bottom || 0);\n// })\n// });\n\n// assumes (1) both a and b are positive numbers\n// and (2) a is larger than b\nmodule.exports = function long_subtraction(a, b) {\n const alen = a.length;\n const blen = b.length;\n\n const aidx = a.indexOf(\".\");\n const bidx = b.indexOf(\".\");\n\n // basically where would the dot be\n // if we add a dot at the end of integers\n // like 123.\n const a_adjusted_dot_index = aidx === -1 ? alen : aidx;\n const b_adjusted_dot_index = bidx === -1 ? blen : bidx;\n // console.log({a_adjusted_dot_index, b_adjusted_dot_index});\n\n // how much you need to shift the second number\n // to line up the decimal with the first\n // 0.12345\n // 12345.0\n\n const offset = a_adjusted_dot_index - b_adjusted_dot_index;\n // console.log(\"offset:\", offset);\n\n let left = Math.max(a_adjusted_dot_index, b_adjusted_dot_index);\n // console.log(\"left:\", left);\n\n let right = Math.max(alen - a_adjusted_dot_index - 1, blen - b_adjusted_dot_index - 1);\n // console.log(\"right:\", right);\n\n let aoffset = offset < 0 ? -1 * offset : 0;\n let boffset = offset <= 0 ? 0 : offset;\n // console.log({aoffset, boffset});\n\n let imax = left + 1 + right - 1; // -1 for zero-index\n // console.log({imax});\n\n let result = \"\";\n\n // number of borrowings\n let borrowed = 0;\n\n // to the right of the period\n // 100.5 6 7\n // 2.2 9 3\n // (-3 + 10) 4\n let i = imax;\n if (right > 0) {\n while (i > imax - right) {\n // console.log(\"\\n\\n\", {i});\n let top = a[i - aoffset] || \"0\";\n let bottom = b[i - boffset] || \"0\";\n\n // console.log(\"pre borrowing\", {top, bottom});\n top -= borrowed;\n borrowed = 0;\n\n // console.log(\"after borrowing\", {top, bottom});\n let n = top - bottom;\n\n // console.log({n});\n if (n < 0) {\n while (n < 0) {\n borrowed++;\n n += 10;\n }\n } else if (borrowed) {\n borrowed--;\n }\n // console.log({n});\n if (result !== \"\" || n !== 0) {\n result = n + result;\n }\n i--;\n }\n if (result !== \"\") {\n result = \".\" + result;\n }\n i--; // substract 1 for dot\n }\n\n // console.log({result});\n\n if (left > 0) {\n while (i > 0) {\n // console.log(\"\\n\\n\", {i});\n let top = a[i - aoffset] || \"0\";\n let bottom = b[i - boffset] || \"0\";\n\n // console.log(\"pre borrowing\", {top, bottom});\n top -= borrowed;\n borrowed = 0;\n\n // console.log(\"after borrowing\", {top, bottom});\n let n = top - bottom;\n\n // console.log({n});\n if (n < 0) {\n while (n < 0) {\n borrowed++;\n n += 10;\n }\n } else if (borrowed) {\n borrowed--;\n }\n // console.log({n});\n result = n + result;\n i--;\n }\n\n // console.log({borrowed});\n // special rule for last one\n const achar = a[0 - aoffset] || \"0\";\n const bchar = b[0 - boffset] || \"0\";\n let n = Number(achar) - (borrowed > 0 ? 1 : 0) - Number(bchar);\n if (n !== 0) {\n result = n + result;\n }\n\n // remove any zeros in front like in 0123\n result = result.replace(/^0+/, \"\");\n }\n\n // if decimal number add zero\n if (result[0] === \".\") result = \"0\" + result;\n\n return result;\n};\n","const absolute = require(\"./absolute.js\");\nconst clean = require(\"./clean.js\");\nconst compare_positive = require(\"./compare_positive.js\");\nconst long_multiplication = require(\"./long_multiplication.js\");\n\nmodule.exports = function multiply(a, b) {\n a = clean(a);\n b = clean(b);\n\n const apos = a[0] !== \"-\";\n const bpos = b[0] !== \"-\";\n\n const out_sign = apos !== bpos ? \"-\" : \"\";\n\n a = absolute(a);\n b = absolute(b);\n\n const comparison = compare_positive(a, b);\n\n if (comparison === \"<\") {\n const aold = a;\n const bold = b;\n a = bold;\n b = aold;\n }\n\n return out_sign + long_multiplication(a, b);\n};\n","// given n is a decimal number\nconst up = [\"5\", \"6\", \"7\", \"8\", \"9\"];\nmodule.exports = function round_last_decimal(n) {\n // remove + from beginning\n if (n[0] === \"+\") n = n.substring(1);\n\n //console.log(\"rounding:\", {n});\n const len = n.length;\n //console.log({len});\n let result = \"\";\n\n const last_char = n[n.length - 1];\n //console.log({last_char});\n\n if (up.includes(last_char)) {\n let i;\n for (i = len - 2; i >= 0; i--) {\n const char = n[i];\n //console.log({char});\n // skip over . or -\n if (char === \".\" || char === \"-\") continue;\n\n const nchar = Number(char) + 1;\n //console.log({nchar});\n\n if (nchar === 10) {\n result = \"0\" + result;\n // keep rounding up\n } else {\n result = nchar + result;\n break;\n }\n }\n //console.log({i});\n if (i > 0) result = n.substring(0, i) + result;\n } else {\n result = n.substring(0, len - 1);\n }\n\n if (result[result.length - 1] === \".\") result = result.substring(0, result.length - 1);\n\n // remove trailing zeros in decimal number\n // 0.50 => 0.5\n if (result.indexOf(\".\") > -1) result = result.replace(/0+$/, \"\");\n\n return result;\n};\n","const clean = require(\"./clean\");\nconst compare_positive = require(\"./compare_positive.js\");\nconst long_addition = require(\"./long_addition.js\");\nconst long_subtraction = require(\"./long_subtraction.js\");\n\nmodule.exports = function subtract(a, b) {\n a = clean(a);\n b = clean(b);\n\n const a_is_positive = a[0] !== \"-\";\n const b_is_positive = b[0] !== \"-\";\n if (a_is_positive) {\n if (b_is_positive) {\n const comparison = compare_positive(a, b);\n if (comparison === \">\") {\n return long_subtraction(a, b);\n } else if (comparison === \"<\") {\n return \"-\" + long_subtraction(b, a);\n } else {\n return \"0\";\n }\n } else {\n return long_addition(a, b.substring(1));\n }\n } else if (b_is_positive) {\n return \"-\" + long_addition(a.substring(1), b);\n } else {\n a = a.substring(1);\n b = b.substring(1);\n const comparison = compare_positive(a, b);\n if (comparison === \">\") {\n return \"-\" + long_subtraction(a, b);\n } else if (comparison === \"<\") {\n return long_subtraction(b, a);\n } else {\n return \"0\";\n }\n }\n};\n","let proj4 = require(\"proj4\");\nconst defs = require(\"proj4js-definitions\");\n\nif (typeof proj4 === \"object\" && typeof proj4.defs !== \"function\" && typeof proj4.default === \"function\") {\n // probably inside an Angular project\n proj4 = proj4.default;\n}\n\nproj4.defs(defs);\n\nmodule.exports = proj4;\n","const clone = data => JSON.parse(JSON.stringify(data));\n\nfunction reprojectGeoJSONPluggable(data, { in_place = false, reproject }) {\n if (typeof reproject !== \"function\") {\n throw new Error(`[reproject-geojson] you must specify a reproject function`);\n }\n if (in_place !== true) data = clone(data);\n\n if (data.type === \"FeatureCollection\") {\n data.features = data.features.map(feature => reprojectGeoJSONPluggable(feature, { in_place, reproject }));\n } else if (data.type === \"Feature\") {\n data.geometry = reprojectGeoJSONPluggable(data.geometry, { in_place, reproject });\n } else if (data.type === \"LineString\") {\n data.coordinates = data.coordinates.map(coord => reproject(coord));\n } else if (data.type === \"MultiLineString\") {\n data.coordinates = data.coordinates.map(line => line.map(coord => reproject(coord)));\n } else if (data.type === \"MultiPoint\") {\n data.coordinates = data.coordinates.map(point => reproject(point));\n } else if (data.type === \"MultiPolygon\") {\n data.coordinates = data.coordinates.map(polygon => {\n return polygon.map(ring => ring.map(coord => reproject(coord)));\n });\n } else if (data.type === \"Point\") {\n data.coordinates = reproject(data.coordinates);\n } else if (data.type === \"Polygon\") {\n data.coordinates = data.coordinates.map(ring => ring.map(coord => reproject(coord)));\n }\n return data;\n}\n\nif (typeof define === \"function\" && define.amd)\n define(function () {\n return reprojectGeoJSONPluggable;\n });\nif (typeof module === \"object\") module.exports = reprojectGeoJSONPluggable;\nif (typeof window === \"object\") window.reprojectGeoJSONPluggable = reprojectGeoJSONPluggable;\nif (typeof self === \"object\") self.reprojectGeoJSONPluggable = reprojectGeoJSONPluggable;\n","const proj4 = require(\"proj4-fully-loaded\");\nconst reprojectGeoJSONPluggable = require(\"./pluggable.js\");\n\nfunction reprojectGeoJSON(data, { from: _from = \"EPSG:4326\", in_place = false, to: _to = \"EPSG:4326\" }) {\n if (typeof _from === \"number\" || _from.match(/^\\d+$/)) _from = \"EPSG:\" + _from;\n if (typeof _to === \"number\" || _to.match(/^\\d+$/)) _to = \"EPSG:\" + _to;\n return reprojectGeoJSONPluggable(data, {\n in_place,\n reproject: proj4(_from, _to).forward\n });\n}\n\nif (typeof define === \"function\" && define.amd)\n define(function () {\n return reprojectGeoJSON;\n });\nif (typeof module === \"object\") module.exports = reprojectGeoJSON;\nif (typeof window === \"object\") window.reprojectGeoJSON = reprojectGeoJSON;\nif (typeof self === \"object\") self.reprojectGeoJSON = reprojectGeoJSON;\n","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; };\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n return obj[key];\n }\n try {\n // IE 8 has a broken Object.defineProperty that only works on DOM objects.\n define({}, \"\");\n } catch (err) {\n define = function(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n defineProperty(generator, \"_invoke\", { value: makeInvokeMethod(innerFn, self, context) });\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n define(IteratorPrototype, iteratorSymbol, function () {\n return this;\n });\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = GeneratorFunctionPrototype;\n defineProperty(Gp, \"constructor\", { value: GeneratorFunctionPrototype, configurable: true });\n defineProperty(\n GeneratorFunctionPrototype,\n \"constructor\",\n { value: GeneratorFunction, configurable: true }\n );\n GeneratorFunction.displayName = define(\n GeneratorFunctionPrototype,\n toStringTagSymbol,\n \"GeneratorFunction\"\n );\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n define(prototype, method, function(arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return PromiseImpl.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n defineProperty(this, \"_invoke\", { value: enqueue });\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n define(AsyncIterator.prototype, asyncIteratorSymbol, function () {\n return this;\n });\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var methodName = context.method;\n var method = delegate.iterator[methodName];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method, or a missing .next mehtod, always terminate the\n // yield* loop.\n context.delegate = null;\n\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (methodName === \"throw\" && delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n if (methodName !== \"return\") {\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a '\" + methodName + \"' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n define(Gp, iteratorSymbol, function() {\n return this;\n });\n\n define(Gp, \"toString\", function() {\n return \"[object Generator]\";\n });\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(val) {\n var object = Object(val);\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, in modern engines\n // we can explicitly access globalThis. In older engines we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n","!function(t,e){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=e():\"function\"==typeof define&&define.amd?define([],e):\"object\"==typeof exports?exports.GeoRaster=e():t.GeoRaster=e()}(\"undefined\"!=typeof self?self:this,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(t,\"__esModule\",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&\"object\"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,\"default\",{enumerable:!0,value:t}),2&e&&\"string\"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,\"a\",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p=\"\",r(r.s=107)}([function(t,e,r){\"use strict\";const n=r(73);t.exports=function(t){return\"+\"===t[0]&&(t=t.substring(1)),(t=(t=n(t)).replace(/^0+(?=\\d)/,\"\")).includes(\".\")&&(t=t.replace(/\\.?0+$/,\"\")),\"\"===t&&(t=\"0\"),\"-0\"===t&&(t=\"0\"),t}},function(t,e,r){\"use strict\";const n=r(4),i=r(0),o=r(15),s=r(32);function a(t,e,r){t=i(t),e=i(e);const a=\"-\"!==t[0],u=\"-\"!==e[0],c=o(t),l=o(e);if(c||l)return a==u?\"Infinity\":\"-Infinity\";if(\"0\"===e)throw new Error(\"[preciso] division by zero\");if(\"\"===t||\"0\"===t)return\"0\";const f=a!==u?\"-\":\"\";return a||(t=n(t)),u||(e=n(e)),f+s(t,e,r)}t.exports=a,t.exports.default=a},function(t,e,r){\"use strict\";r.d(e,\"a\",(function(){return n})),r.d(e,\"b\",(function(){return i})),r.d(e,\"c\",(function(){return o})),r.d(e,\"d\",(function(){return s})),r.d(e,\"e\",(function(){return a}));const n=Symbol(\"thread.errors\"),i=Symbol(\"thread.events\"),o=Symbol(\"thread.terminate\"),s=Symbol(\"thread.transferable\"),a=Symbol(\"thread.worker\")},function(t,e){var r;r=function(){return this}();try{r=r||new Function(\"return this\")()}catch(t){\"object\"==typeof window&&(r=window)}t.exports=r},function(t,e,r){\"use strict\";const n=r(0);function i(t){return\"-\"===(t=n(t))[0]?t.substring(1):t}t.exports=i,t.exports.default=i},function(t,e,r){\"use strict\";function n(t,e){const r=t.length,n=e.length,i=t.indexOf(\".\"),o=e.indexOf(\".\"),s=-1===i?r:i,a=-1===o?n:o,u=s-a;let c=u<0?-1*u:0,l=u<=0?0:u,f=Math.max(s,a)+1+Math.max(r-s,n-a)-1,h=0;for(;ho)return\">\";if(n\":return\"-\"+s(t,e)}else if(u&&!c)switch(e=e.substring(1),n(t,e)){case\"=\":return\"0\";case\"<\":return\"-\"+s(e,t);case\">\":return s(t,e)}}t.exports=u,t.exports.default=u},function(t,e,r){\"use strict\";(function(t){\n/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\nvar n=r(108),i=r(109),o=r(60);function s(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,e){if(s()=s())throw new RangeError(\"Attempt to allocate Buffer larger than maximum size: 0x\"+s().toString(16)+\" bytes\");return 0|t}function p(t,e){if(u.isBuffer(t))return t.length;if(\"undefined\"!=typeof ArrayBuffer&&\"function\"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;\"string\"!=typeof t&&(t=\"\"+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case\"ascii\":case\"latin1\":case\"binary\":return r;case\"utf8\":case\"utf-8\":case void 0:return B(t).length;case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return 2*r;case\"hex\":return r>>>1;case\"base64\":return G(t).length;default:if(n)return B(t).length;e=(\"\"+e).toLowerCase(),n=!0}}function y(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return\"\";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return\"\";if((r>>>=0)<=(e>>>=0))return\"\";for(t||(t=\"utf8\");;)switch(t){case\"hex\":return C(this,e,r);case\"utf8\":case\"utf-8\":return k(this,e,r);case\"ascii\":return T(this,e,r);case\"latin1\":case\"binary\":return O(this,e,r);case\"base64\":return E(this,e,r);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return P(this,e,r);default:if(n)throw new TypeError(\"Unknown encoding: \"+t);t=(t+\"\").toLowerCase(),n=!0}}function g(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function m(t,e,r,n,i){if(0===t.length)return-1;if(\"string\"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if(\"string\"==typeof e&&(e=u.from(e,n)),u.isBuffer(e))return 0===e.length?-1:b(t,e,r,n,i);if(\"number\"==typeof e)return e&=255,u.TYPED_ARRAY_SUPPORT&&\"function\"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):b(t,[e],r,n,i);throw new TypeError(\"val must be string, number or Buffer\")}function b(t,e,r,n,i){var o,s=1,a=t.length,u=e.length;if(void 0!==n&&(\"ucs2\"===(n=String(n).toLowerCase())||\"ucs-2\"===n||\"utf16le\"===n||\"utf-16le\"===n)){if(t.length<2||e.length<2)return-1;s=2,a/=2,u/=2,r/=2}function c(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){var l=-1;for(o=r;oa&&(r=a-u),o=r;o>=0;o--){for(var f=!0,h=0;hi&&(n=i):n=i;var o=e.length;if(o%2!=0)throw new TypeError(\"Invalid hex string\");n>o/2&&(n=o/2);for(var s=0;s>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function E(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function k(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i239?4:c>223?3:c>191?2:1;if(i+f<=r)switch(f){case 1:c<128&&(l=c);break;case 2:128==(192&(o=t[i+1]))&&(u=(31&c)<<6|63&o)>127&&(l=u);break;case 3:o=t[i+1],s=t[i+2],128==(192&o)&&128==(192&s)&&(u=(15&c)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:o=t[i+1],s=t[i+2],a=t[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(u=(15&c)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(l=u)}null===l?(l=65533,f=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),i+=f}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var r=\"\",n=0;for(;n0&&(t=this.toString(\"hex\",0,r).match(/.{2}/g).join(\" \"),this.length>r&&(t+=\" ... \")),\"\"},u.prototype.compare=function(t,e,r,n,i){if(!u.isBuffer(t))throw new TypeError(\"Argument must be a Buffer\");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError(\"out of range index\");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),a=Math.min(o,s),c=this.slice(n,i),l=t.slice(e,r),f=0;fi)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError(\"Attempt to write outside buffer bounds\");n||(n=\"utf8\");for(var o=!1;;)switch(n){case\"hex\":return v(this,t,e,r);case\"utf8\":case\"utf-8\":return w(this,t,e,r);case\"ascii\":return x(this,t,e,r);case\"latin1\":case\"binary\":return _(this,t,e,r);case\"base64\":return S(this,t,e,r);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return A(this,t,e,r);default:if(o)throw new TypeError(\"Unknown encoding: \"+n);n=(\"\"+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:\"Buffer\",data:Array.prototype.slice.call(this._arr||this,0)}};function T(t,e,r){var n=\"\";r=Math.min(t.length,r);for(var i=e;in)&&(r=n);for(var i=\"\",o=e;or)throw new RangeError(\"Trying to access beyond buffer length\")}function R(t,e,r,n,i,o){if(!u.isBuffer(t))throw new TypeError('\"buffer\" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError(\"Index out of range\")}function j(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i>>8*(n?i:1-i)}function M(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i>>8*(n?i:3-i)&255}function L(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError(\"Index out of range\");if(r<0)throw new RangeError(\"Index out of range\")}function F(t,e,r,n,o){return o||L(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function N(t,e,r,n,o){return o||L(t,0,r,8),i.write(t,e,r,n,52,8),r+8}u.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e0&&(i*=256);)n+=this[t+--e]*i;return n},u.prototype.readUInt8=function(t,e){return e||I(t,1,this.length),this[t]},u.prototype.readUInt16LE=function(t,e){return e||I(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function(t,e){return e||I(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUInt32LE=function(t,e){return e||I(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUInt32BE=function(t,e){return e||I(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||I(t,e,this.length);for(var n=this[t],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*e)),n},u.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||I(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},u.prototype.readInt8=function(t,e){return e||I(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){e||I(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){e||I(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return e||I(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return e||I(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,e){return e||I(t,4,this.length),i.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return e||I(t,4,this.length),i.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return e||I(t,8,this.length),i.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return e||I(t,8,this.length),i.read(this,t,!1,52,8)},u.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||R(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o=0&&(o*=256);)this[e+i]=t/o&255;return e+r},u.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||R(this,t,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||R(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):j(this,t,e,!0),e+2},u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||R(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):j(this,t,e,!1),e+2},u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||R(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):M(this,t,e,!0),e+4},u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||R(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):M(this,t,e,!1),e+4},u.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);R(this,t,e,r,i-1,-i)}var o=0,s=1,a=0;for(this[e]=255&t;++o>0)-a&255;return e+r},u.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);R(this,t,e,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},u.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||R(this,t,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||R(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):j(this,t,e,!0),e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||R(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):j(this,t,e,!1),e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||R(this,t,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):M(this,t,e,!0),e+4},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||R(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):M(this,t,e,!1),e+4},u.prototype.writeFloatLE=function(t,e,r){return F(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return F(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return N(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return N(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError(\"sourceStart out of bounds\");if(n<0)throw new RangeError(\"sourceEnd out of bounds\");n>this.length&&(n=this.length),t.length-e=0;--i)t[i+e]=this[i+r];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),\"number\"==typeof t)for(o=e;o55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error(\"Invalid code point\");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function G(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\\s+|\\s+$/g,\"\")}(t).replace(D,\"\")).length<2)return\"\";for(;t.length%4!=0;)t+=\"=\";return t}(t))}function q(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}}).call(this,r(3))},function(t,e){var r,n,i=t.exports={};function o(){throw new Error(\"setTimeout has not been defined\")}function s(){throw new Error(\"clearTimeout has not been defined\")}function a(t){if(r===setTimeout)return setTimeout(t,0);if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r=\"function\"==typeof setTimeout?setTimeout:o}catch(t){r=o}try{n=\"function\"==typeof clearTimeout?clearTimeout:s}catch(t){n=s}}();var u,c=[],l=!1,f=-1;function h(){l&&u&&(l=!1,u.length?c=u.concat(c):f=-1,c.length&&d())}function d(){if(!l){var t=a(h);l=!0;for(var e=c.length;e;){for(u=c,c=[];++f1)for(var r=1;r0){for(;m>p-f;){const r=t[m-h]||\"0\",n=e[m-d]||\"0\";let i=Number(r)+Number(n)+g;i>=10?(i-=10,g=1):g=0,\"\"===y&&0===i||(y=i+y),m--}y&&(y=\".\"+y),m--}if(l>0)for(;m>=0;){const r=t[m-h]||\"0\",n=e[m-d]||\"0\";let i=Number(r)+Number(n)+g;i>=10?(i-=10,g=1):g=0,y=i+y,m--}return 1===g&&(y=g+y),\".\"===y[0]&&(y=\"0\"+y),y}t.exports=i,t.exports.default=i},function(t,e){\"function\"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},function(t,e,r){\"use strict\";function n(t){return/^[-+]?0(\\.0+)?(e[\\.\\d]+)?$/.test(t)}t.exports=n,t.exports.default=n},function(t,e,r){(function(n){e.formatArgs=function(e){if(e[0]=(this.useColors?\"%c\":\"\")+this.namespace+(this.useColors?\" %c\":\" \")+e[0]+(this.useColors?\"%c \":\" \")+\"+\"+t.exports.humanize(this.diff),!this.useColors)return;const r=\"color: \"+this.color;e.splice(1,0,r,\"color: inherit\");let n=0,i=0;e[0].replace(/%[a-zA-Z%]/g,t=>{\"%%\"!==t&&(n++,\"%c\"===t&&(i=n))}),e.splice(i,0,r)},e.save=function(t){try{t?e.storage.setItem(\"debug\",t):e.storage.removeItem(\"debug\")}catch(t){}},e.load=function(){let t;try{t=e.storage.getItem(\"debug\")}catch(t){}!t&&void 0!==n&&\"env\"in n&&(t=n.env.DEBUG);return t},e.useColors=function(){if(\"undefined\"!=typeof window&&window.process&&(\"renderer\"===window.process.type||window.process.__nwjs))return!0;if(\"undefined\"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/))return!1;return\"undefined\"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||\"undefined\"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||\"undefined\"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/)&&parseInt(RegExp.$1,10)>=31||\"undefined\"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/)},e.storage=function(){try{return localStorage}catch(t){}}(),e.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn(\"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.\"))}})(),e.colors=[\"#0000CC\",\"#0000FF\",\"#0033CC\",\"#0033FF\",\"#0066CC\",\"#0066FF\",\"#0099CC\",\"#0099FF\",\"#00CC00\",\"#00CC33\",\"#00CC66\",\"#00CC99\",\"#00CCCC\",\"#00CCFF\",\"#3300CC\",\"#3300FF\",\"#3333CC\",\"#3333FF\",\"#3366CC\",\"#3366FF\",\"#3399CC\",\"#3399FF\",\"#33CC00\",\"#33CC33\",\"#33CC66\",\"#33CC99\",\"#33CCCC\",\"#33CCFF\",\"#6600CC\",\"#6600FF\",\"#6633CC\",\"#6633FF\",\"#66CC00\",\"#66CC33\",\"#9900CC\",\"#9900FF\",\"#9933CC\",\"#9933FF\",\"#99CC00\",\"#99CC33\",\"#CC0000\",\"#CC0033\",\"#CC0066\",\"#CC0099\",\"#CC00CC\",\"#CC00FF\",\"#CC3300\",\"#CC3333\",\"#CC3366\",\"#CC3399\",\"#CC33CC\",\"#CC33FF\",\"#CC6600\",\"#CC6633\",\"#CC9900\",\"#CC9933\",\"#CCCC00\",\"#CCCC33\",\"#FF0000\",\"#FF0033\",\"#FF0066\",\"#FF0099\",\"#FF00CC\",\"#FF00FF\",\"#FF3300\",\"#FF3333\",\"#FF3366\",\"#FF3399\",\"#FF33CC\",\"#FF33FF\",\"#FF6600\",\"#FF6633\",\"#FF9900\",\"#FF9933\",\"#FFCC00\",\"#FFCC33\"],e.log=console.debug||console.log||(()=>{}),t.exports=r(134)(e);const{formatters:i}=t.exports;i.j=function(t){try{return JSON.stringify(t)}catch(t){return\"[UnexpectedJSONParseError]: \"+t.message}}}).call(this,r(8))},function(t,e,r){\"use strict\";r.d(e,\"a\",(function(){return o})),r.d(e,\"b\",(function(){return s}));const n={deserialize:t=>Object.assign(Error(t.message),{name:t.name,stack:t.stack}),serialize:t=>({__error_marker:\"$$error\",message:t.message,name:t.name,stack:t.stack})};let i={deserialize(t){return(e=t)&&\"object\"==typeof e&&\"__error_marker\"in e&&\"$$error\"===e.__error_marker?n.deserialize(t):t;var e},serialize:t=>t instanceof Error?n.serialize(t):t};function o(t){return i.deserialize(t)}function s(t){return i.serialize(t)}},function(t,e,r){\"use strict\";var n=r(28),i=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=f;var o=Object.create(r(21));o.inherits=r(10);var s=r(61),a=r(65);o.inherits(f,s);for(var u=i(a.prototype),c=0;c/^[a-zA-Z][a-zA-Z\\d+\\-.]*:/.test(t);function a(t){const e=new Blob([t],{type:\"application/javascript\"});return URL.createObjectURL(e)}let u;function c(){return u||(u=function(){if(\"undefined\"==typeof Worker)return class{constructor(){throw Error(\"No web worker implementation available. You might have tried to spawn a worker within a worker in a browser that doesn't support workers in workers.\")}};class t extends Worker{constructor(t,e){var r,n;\"string\"==typeof t&&e&&e._baseURL?t=new URL(t,e._baseURL):\"string\"==typeof t&&!s(t)&&i().match(/^file:\\/\\//i)&&(t=new URL(t,i().replace(/\\/[^\\/]+$/,\"/\")),(null===(r=null==e?void 0:e.CORSWorkaround)||void 0===r||r)&&(t=a(`importScripts(${JSON.stringify(t)});`))),\"string\"==typeof t&&s(t)&&(null===(n=null==e?void 0:e.CORSWorkaround)||void 0===n||n)&&(t=a(`importScripts(${JSON.stringify(t)});`)),super(t,e)}}class e extends t{constructor(t,e){super(window.URL.createObjectURL(t),e)}static fromText(t,r){const n=new window.Blob([t],{type:\"text/javascript\"});return new e(n,r)}}return{blob:e,default:t}}()),u}},function(t,e,r){\"use strict\";var n,i;r.d(e,\"a\",(function(){return n})),r.d(e,\"b\",(function(){return i})),function(t){t.cancel=\"cancel\",t.run=\"run\"}(n||(n={})),function(t){t.error=\"error\",t.init=\"init\",t.result=\"result\",t.running=\"running\",t.uncaughtError=\"uncaughtError\"}(i||(i={}))},function(t,e,r){function n(t){return Object.prototype.toString.call(t)}e.isArray=function(t){return Array.isArray?Array.isArray(t):\"[object Array]\"===n(t)},e.isBoolean=function(t){return\"boolean\"==typeof t},e.isNull=function(t){return null===t},e.isNullOrUndefined=function(t){return null==t},e.isNumber=function(t){return\"number\"==typeof t},e.isString=function(t){return\"string\"==typeof t},e.isSymbol=function(t){return\"symbol\"==typeof t},e.isUndefined=function(t){return void 0===t},e.isRegExp=function(t){return\"[object RegExp]\"===n(t)},e.isObject=function(t){return\"object\"==typeof t&&null!==t},e.isDate=function(t){return\"[object Date]\"===n(t)},e.isError=function(t){return\"[object Error]\"===n(t)||t instanceof Error},e.isFunction=function(t){return\"function\"==typeof t},e.isPrimitive=function(t){return null===t||\"boolean\"==typeof t||\"number\"==typeof t||\"string\"==typeof t||\"symbol\"==typeof t||void 0===t},e.isBuffer=r(7).Buffer.isBuffer},function(t,e,r){\"use strict\";const n=r(11),i=r(50);function o(t){return n(t)?\"\":i(t)}t.exports=o,t.exports.default=o},function(t,e,r){\"use strict\";const n=r(35);function i(t,e){return n(t,\"2\",e)}t.exports=i,t.exports.default=i},function(t,e,r){\"use strict\";r.d(e,\"a\",(function(){return o}));var n=r(2);function i(t){throw Error(t)}const o={errors:t=>t[n.a]||i(\"Error observable not found. Make sure to pass a thread instance as returned by the spawn() promise.\"),events:t=>t[n.b]||i(\"Events observable not found. Make sure to pass a thread instance as returned by the spawn() promise.\"),terminate:t=>t[n.c]()}},function(t,e){},function(t,e,r){\"use strict\";const n=()=>\"function\"==typeof Symbol,i=t=>n()&&Boolean(Symbol[t]),o=t=>i(t)?Symbol[t]:\"@@\"+t;i(\"asyncIterator\")||(Symbol.asyncIterator=Symbol.asyncIterator||Symbol.for(\"Symbol.asyncIterator\"));const s=o(\"iterator\"),a=o(\"observable\"),u=o(\"species\");function c(t,e){const r=t[e];if(null!=r){if(\"function\"!=typeof r)throw new TypeError(r+\" is not a function\");return r}}function l(t){let e=t.constructor;return void 0!==e&&(e=e[u],null===e&&(e=void 0)),void 0!==e?e:v}function f(t){f.log?f.log(t):setTimeout(()=>{throw t},0)}function h(t){Promise.resolve().then(()=>{try{t()}catch(t){f(t)}})}function d(t){const e=t._cleanup;if(void 0!==e&&(t._cleanup=void 0,e))try{if(\"function\"==typeof e)e();else{const t=c(e,\"unsubscribe\");t&&t.call(e)}}catch(t){f(t)}}function p(t){t._observer=void 0,t._queue=void 0,t._state=\"closed\"}function y(t,e,r){t._state=\"running\";const n=t._observer;try{const i=n?c(n,e):void 0;switch(e){case\"next\":i&&i.call(n,r);break;case\"error\":if(p(t),!i)throw r;i.call(n,r);break;case\"complete\":p(t),i&&i.call(n)}}catch(t){f(t)}\"closed\"===t._state?d(t):\"running\"===t._state&&(t._state=\"ready\")}function g(t,e,r){if(\"closed\"!==t._state)return\"buffering\"===t._state?(t._queue=t._queue||[],void t._queue.push({type:e,value:r})):\"ready\"!==t._state?(t._state=\"buffering\",t._queue=[{type:e,value:r}],void h(()=>function(t){const e=t._queue;if(e){t._queue=void 0,t._state=\"ready\";for(const r of e)if(y(t,r.type,r.value),\"closed\"===t._state)break}}(t))):void y(t,e,r)}class m{constructor(t,e){this._cleanup=void 0,this._observer=t,this._queue=void 0,this._state=\"initializing\";const r=new b(this);try{this._cleanup=e.call(void 0,r)}catch(t){r.error(t)}\"initializing\"===this._state&&(this._state=\"ready\")}get closed(){return\"closed\"===this._state}unsubscribe(){\"closed\"!==this._state&&(p(this),d(this))}}class b{constructor(t){this._subscription=t}get closed(){return\"closed\"===this._subscription._state}next(t){g(this._subscription,\"next\",t)}error(t){g(this._subscription,\"error\",t)}complete(){g(this._subscription,\"complete\")}}class v{constructor(t){if(!(this instanceof v))throw new TypeError(\"Observable cannot be called as a function\");if(\"function\"!=typeof t)throw new TypeError(\"Observable initializer must be a function\");this._subscriber=t}subscribe(t,e,r){return\"object\"==typeof t&&null!==t||(t={next:t,error:e,complete:r}),new m(t,this._subscriber)}pipe(t,...e){let r=this;for(const n of[t,...e])r=n(r);return r}tap(t,e,r){const n=\"object\"!=typeof t||null===t?{next:t,error:e,complete:r}:t;return new v(t=>this.subscribe({next(e){n.next&&n.next(e),t.next(e)},error(e){n.error&&n.error(e),t.error(e)},complete(){n.complete&&n.complete(),t.complete()},start(t){n.start&&n.start(t)}}))}forEach(t){return new Promise((e,r)=>{if(\"function\"!=typeof t)return void r(new TypeError(t+\" is not a function\"));function n(){i.unsubscribe(),e(void 0)}const i=this.subscribe({next(e){try{t(e,n)}catch(t){r(t),i.unsubscribe()}},error(t){r(t)},complete(){e(void 0)}})})}map(t){if(\"function\"!=typeof t)throw new TypeError(t+\" is not a function\");return new(l(this))(e=>this.subscribe({next(r){let n=r;try{n=t(r)}catch(t){return e.error(t)}e.next(n)},error(t){e.error(t)},complete(){e.complete()}}))}filter(t){if(\"function\"!=typeof t)throw new TypeError(t+\" is not a function\");return new(l(this))(e=>this.subscribe({next(r){try{if(!t(r))return}catch(t){return e.error(t)}e.next(r)},error(t){e.error(t)},complete(){e.complete()}}))}reduce(t,e){if(\"function\"!=typeof t)throw new TypeError(t+\" is not a function\");const r=l(this),n=arguments.length>1;let i=!1,o=e;return new r(e=>this.subscribe({next(r){const s=!i;if(i=!0,!s||n)try{o=t(o,r)}catch(t){return e.error(t)}else o=r},error(t){e.error(t)},complete(){if(!i&&!n)return e.error(new TypeError(\"Cannot reduce an empty sequence\"));e.next(o),e.complete()}}))}concat(...t){const e=l(this);return new e(r=>{let n,i=0;return function o(s){n=s.subscribe({next(t){r.next(t)},error(t){r.error(t)},complete(){i===t.length?(n=void 0,r.complete()):o(e.from(t[i++]))}})}(this),()=>{n&&(n.unsubscribe(),n=void 0)}})}flatMap(t){if(\"function\"!=typeof t)throw new TypeError(t+\" is not a function\");const e=l(this);return new e(r=>{const n=[],i=this.subscribe({next(i){let s;if(t)try{s=t(i)}catch(t){return r.error(t)}else s=i;const a=e.from(s).subscribe({next(t){r.next(t)},error(t){r.error(t)},complete(){const t=n.indexOf(a);t>=0&&n.splice(t,1),o()}});n.push(a)},error(t){r.error(t)},complete(){o()}});function o(){i.closed&&0===n.length&&r.complete()}return()=>{n.forEach(t=>t.unsubscribe()),i.unsubscribe()}})}[(Symbol.observable,a)](){return this}static from(t){const e=\"function\"==typeof this?this:v;if(null==t)throw new TypeError(t+\" is not an object\");const r=c(t,a);if(r){const n=r.call(t);if(Object(n)!==n)throw new TypeError(n+\" is not an object\");return function(t){return t instanceof v}(n)&&n.constructor===e?n:new e(t=>n.subscribe(t))}if(i(\"iterator\")){const r=c(t,s);if(r)return new e(e=>{h(()=>{if(!e.closed){for(const n of r.call(t))if(e.next(n),e.closed)return;e.complete()}})})}if(Array.isArray(t))return new e(e=>{h(()=>{if(!e.closed){for(const r of t)if(e.next(r),e.closed)return;e.complete()}})});throw new TypeError(t+\" is not observable\")}static of(...t){return new(\"function\"==typeof this?this:v)(e=>{h(()=>{if(!e.closed){for(const r of t)if(e.next(r),e.closed)return;e.complete()}})})}static get[u](){return this}}n()&&Object.defineProperty(v,Symbol(\"extensions\"),{value:{symbol:a,hostReportError:f},configurable:!0});e.a=v},function(t,e,r){\"use strict\";var n;r.d(e,\"a\",(function(){return n})),function(t){t.internalError=\"internalError\",t.message=\"message\",t.termination=\"termination\"}(n||(n={}))},function(t,e,r){\"use strict\";(function(e){void 0===e||!e.version||0===e.version.indexOf(\"v0.\")||0===e.version.indexOf(\"v1.\")&&0!==e.version.indexOf(\"v1.8.\")?t.exports={nextTick:function(t,r,n,i){if(\"function\"!=typeof t)throw new TypeError('\"callback\" argument must be a function');var o,s,a=arguments.length;switch(a){case 0:case 1:return e.nextTick(t);case 2:return e.nextTick((function(){t.call(null,r)}));case 3:return e.nextTick((function(){t.call(null,r,n)}));case 4:return e.nextTick((function(){t.call(null,r,n,i)}));default:for(o=new Array(a-1),s=0;s0){for(;m>p-f;){let r=t[m-h]||\"0\",n=e[m-d]||\"0\";r-=g,g=0;let i=r-n;if(i<0)for(;i<0;)g++,i+=10;else g&&g--;\"\"===y&&0===i||(y=i+y),m--}\"\"!==y&&(y=\".\"+y),m--}if(l>0){for(;m>0;){let r=t[m-h]||\"0\",n=e[m-d]||\"0\";r-=g,g=0;let i=r-n;if(i<0)for(;i<0;)g++,i+=10;else g&&g--;y=i+y,m--}const r=t[0-h]||\"0\",n=e[0-d]||\"0\";let i=Number(r)-(g>0?1:0)-Number(n);0!==i&&(y=i+y),y=y.replace(/^0+/,\"\")}return\".\"===y[0]&&(y=\"0\"+y),y}t.exports=i,t.exports.default=i},function(t,e,r){\"use strict\";const n=r(5),i=r(6),o=r(33),s=r(49);function a(t,e,{format:r=\"string\",max_decimal_digits:a=100,ellipsis:u=!1}={}){\"0\"===t[0]&&(t=t.substring(1)),\"0\"===e[0]&&(e=e.substring(1));const c=t.indexOf(\".\"),l=e.indexOf(\".\"),f=-1===c?t.length:c,h=-1===l?0:e.length-1-l;let d=!1;t=t.replace(/\\./,\"\"),e=e.replace(/\\./,\"\");const p=t.length;let y,g=\"\",m=\"\",b=-1*h,v=0;for(let r=0;r\"===y){let t=1,r=i(e,e),s=e;for(;\">\"!==n(r,g);)t++,s=r,r=i(r,e);if(t=t.toString(),\"\"!==m)for(let e=t.length;e<=v;e++)m+=\"0\";m+=t,g=o(g,s),v=0}else{if(\"<\"===y){\"\"===m&&b++,v++;continue}if(\"=\"===y){if(\"\"!==m)for(let t=0;t3){m+=\"...\",d=!0;break}}else t[g]=1;const r=n(g,e);if(\">\"===r){let t=1,r=i(e,e),s=e;for(;\">\"!==n(r,g);)t++,s=r,r=i(r,e);t=t.toString();for(let e=t.length;e<=v;e++)m+=\"0\";if(m+=t,g=o(g,s),\"0\"===g)break;v=0}else{if(\"<\"===r){v++;continue}if(\"=\"===r){for(let t=0;tx){for(let t=x;t0&&(m=s(m.substring(0,m.length-S+1))),\".\"===m[0]&&(m=\"0\"+m),\"object\"===r?{quotient:m,extra_decimals:S}:m}t.exports=a,t.exports.default=a},function(t,e,r){\"use strict\";const n=r(0),i=r(5),o=r(15),s=r(9),a=r(31);function u(t,e,{infinity_minus_infinity:r=\"NaN\"}={}){t=n(t),e=n(e);const u=!(\"-\"===t[0]),c=!(\"-\"===e[0]),l=o(t),f=o(e);if(l&&f){if(u===c)return r;if(u)return\"Infinity\";if(c)return\"-Infinity\"}else{if(l)return t;if(f)return c?\"-Infinity\":\"Infinity\"}if(u){if(c){const r=i(t,e);return\">\"===r?a(t,e):\"<\"===r?\"-\"+a(e,t):\"0\"}return s(t,e.substring(1))}if(c)return\"-\"+s(t.substring(1),e);{t=t.substring(1),e=e.substring(1);const r=i(t,e);return\">\"===r?\"-\"+a(t,e):\"<\"===r?a(e,t):\"0\"}}t.exports=u,t.exports.default=u},function(t,e,r){\"use strict\";const n=r(0),i=r(5);function o(t,e){t=n(t),e=n(e);const r=\"-\"!==t[0],o=\"-\"!==e[0];return r?o?i(t,e):\">\":o?\"<\":i(e.substring(1),t.substring(1))}t.exports=o,t.exports.default=o},function(t,e,r){\"use strict\";const n=r(4),i=r(0),o=r(1),s=r(77),a=r(16),u=r(52),c=r(78),l=r(11),f=r(53),h=r(54),d=r(81),p=r(37),y=r(36),g=r(22),m=r(85);function b(t,e,{zero_to_the_power_of_zero:r=\"1\",ellipsis:b=!1,imaginary:v=!0,max_decimal_digits:w=100,fraction:x=!1}={}){t=i(t),e=i(e);const _=v&&u(t);_&&(t=t.replace(/i$/,\"\"));const S=l(t),A=l(e);if(S&&A)return r;if(A)return\"1\";const E=g(e);if(S){if(\"+\"===E)return\"0\";if(\"-\"===E)return\"Infinity\"}const k=a(e);if(\"+\"===E&&k){let r=h(t,e);return\"number\"==typeof w&&(r=y(r,{digits:w})),_&&c(e)&&(r+=\"i\"),r}if(\"-\"===E&&k){const r=\"1\",i=h(t,n(e));return o(r,i,{ellipsis:b,max_decimal_digits:w})}if(!k){e=n(e);let[r,i]=e.includes(\"/\")?e.split(\"/\"):s(e);[r,i]=m(r,i);let o=p(t,i,{imaginary:v}),a=f(r,o);return\"number\"==typeof w&&(a=y(a,{digits:w})),\"-\"===E&&(a=d(a,{fraction:x,max_decimal_digits:w})),a}}t.exports=b,t.exports.default=b},function(t,e,r){\"use strict\";const n=r(52),i=r(164);function o(t,{digits:e=0}={}){return n(t)?i(t.substring(0,t.length-1),{digits:e})+\"i\":i(t,{digits:e})}t.exports=o,t.exports.default=o},function(t,e,r){\"use strict\";const n=r(4),i=r(0),o=r(5),s=r(82),a=r(16),u=r(80),c=r(54),l=r(83);function f(t,e,{imaginary:r=!0,max_decimal_digits:f=100}={}){if(t=i(t),\"1\"===(e=i(e)))return t;if(\"1\"===t)return\"1\";if(!a(e))throw new Error(\"[preciso] can't find fractional roots\");if(u(e))throw new Error(\"[preciso] can't find root of negative indexes\");const h=n(t),d=u(t),p=s(e),y=d&&p;if(y&&!r)throw new Error(\"[preciso] root has an imaginary number\");const g=d&&!p?\"-\":\"\",m=l(h,e),b=[\"9\",\"8\",\"7\",\"6\",\"5\",\"4\",\"3\",\"2\",\"1\",\"0\"];let v=\"\";for(let t=0;to)return\">\";if(n\",'\"',\"`\",\" \",\"\\r\",\"\\n\",\"\\t\"]),c=[\"'\"].concat(u),l=[\"%\",\"/\",\"?\",\";\",\"#\"].concat(c),f=[\"/\",\"?\",\"#\"],h=/^[+a-z0-9A-Z_-]{0,63}$/,d=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,p={javascript:!0,\"javascript:\":!0},y={javascript:!0,\"javascript:\":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,\"http:\":!0,\"https:\":!0,\"ftp:\":!0,\"gopher:\":!0,\"file:\":!0},m=r(142);function b(t,e,r){if(t&&\"object\"==typeof t&&t instanceof i)return t;var n=new i;return n.parse(t,e,r),n}i.prototype.parse=function(t,e,r){if(\"string\"!=typeof t)throw new TypeError(\"Parameter 'url' must be a string, not \"+typeof t);var i=t.indexOf(\"?\"),s=-1!==i&&i127?R+=\"x\":R+=I[j];if(!R.match(h)){var L=C.slice(0,k),F=C.slice(k+1),N=I.match(d);N&&(L.push(N[1]),F.unshift(N[2])),F.length&&(b=\"/\"+F.join(\".\")+b),this.hostname=L.join(\".\");break}}}this.hostname.length>255?this.hostname=\"\":this.hostname=this.hostname.toLowerCase(),O||(this.hostname=n.toASCII(this.hostname));var D=this.port?\":\"+this.port:\"\",U=this.hostname||\"\";this.host=U+D,this.href+=this.host,O&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),\"/\"!==b[0]&&(b=\"/\"+b))}if(!p[x])for(k=0,P=c.length;k0)&&r.host.split(\"@\"))&&(r.auth=O.shift(),r.hostname=O.shift(),r.host=r.hostname);return r.search=t.search,r.query=t.query,null===r.pathname&&null===r.search||(r.path=(r.pathname?r.pathname:\"\")+(r.search?r.search:\"\")),r.href=r.format(),r}if(!_.length)return r.pathname=null,r.search?r.path=\"/\"+r.search:r.path=null,r.href=r.format(),r;for(var A=_.slice(-1)[0],E=(r.host||t.host||_.length>1)&&(\".\"===A||\"..\"===A)||\"\"===A,k=0,T=_.length;T>=0;T--)\".\"===(A=_[T])?_.splice(T,1):\"..\"===A?(_.splice(T,1),k++):k&&(_.splice(T,1),k--);if(!w&&!x)for(;k--;k)_.unshift(\"..\");!w||\"\"===_[0]||_[0]&&\"/\"===_[0].charAt(0)||_.unshift(\"\"),E&&\"/\"!==_.join(\"/\").substr(-1)&&_.push(\"\");var O,C=\"\"===_[0]||_[0]&&\"/\"===_[0].charAt(0);S&&(r.hostname=C?\"\":_.length?_.shift():\"\",r.host=r.hostname,(O=!!(r.host&&r.host.indexOf(\"@\")>0)&&r.host.split(\"@\"))&&(r.auth=O.shift(),r.hostname=O.shift(),r.host=r.hostname));return(w=w||r.host&&_.length)&&!C&&_.unshift(\"\"),_.length>0?r.pathname=_.join(\"/\"):(r.pathname=null,r.path=null),null===r.pathname&&null===r.search||(r.path=(r.pathname?r.pathname:\"\")+(r.search?r.search:\"\")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},i.prototype.parseHost=function(){var t=this.host,e=s.exec(t);e&&(\":\"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)},e.parse=b,e.resolve=function(t,e){return b(t,!1,!0).resolve(e)},e.resolveObject=function(t,e){return t?b(t,!1,!0).resolveObject(e):e},e.format=function(t){return\"string\"==typeof t&&(t=b(t)),t instanceof i?t.format():i.prototype.format.call(t)},e.Url=i},function(t,e,r){(function(t){var n=r(136),i=r(70),o=r(138),s=r(139),a=r(39),u=e;u.request=function(e,r){e=\"string\"==typeof e?a.parse(e):o(e);var i=-1===t.location.protocol.search(/^https?:$/)?\"http:\":\"\",s=e.protocol||i,u=e.hostname||e.host,c=e.port,l=e.path||\"/\";u&&-1!==u.indexOf(\":\")&&(u=\"[\"+u+\"]\"),e.url=(u?s+\"//\"+u:\"\")+(c?\":\"+c:\"\")+l,e.method=(e.method||\"GET\").toUpperCase(),e.headers=e.headers||{};var f=new n(e);return r&&f.on(\"response\",r),f},u.get=function(t,e){var r=u.request(t,e);return r.end(),r},u.ClientRequest=n,u.IncomingMessage=i.IncomingMessage,u.Agent=function(){},u.Agent.defaultMaxSockets=4,u.globalAgent=new u.Agent,u.STATUS_CODES=s,u.METHODS=[\"CHECKOUT\",\"CONNECT\",\"COPY\",\"DELETE\",\"GET\",\"HEAD\",\"LOCK\",\"M-SEARCH\",\"MERGE\",\"MKACTIVITY\",\"MKCOL\",\"MOVE\",\"NOTIFY\",\"OPTIONS\",\"PATCH\",\"POST\",\"PROPFIND\",\"PROPPATCH\",\"PURGE\",\"PUT\",\"REPORT\",\"SEARCH\",\"SUBSCRIBE\",\"TRACE\",\"UNLOCK\",\"UNSUBSCRIBE\"]}).call(this,r(3))},,function(t,e,r){(e=t.exports=r(61)).Stream=e,e.Readable=e,e.Writable=r(65),e.Duplex=r(14),e.Transform=r(67),e.PassThrough=r(122)},function(t,e,r){var n=r(7),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(o(n,e),e.Buffer=s),o(i,s),s.from=function(t,e,r){if(\"number\"==typeof t)throw new TypeError(\"Argument must not be a number\");return i(t,e,r)},s.alloc=function(t,e,r){if(\"number\"!=typeof t)throw new TypeError(\"Argument must be a number\");var n=i(t);return void 0!==e?\"string\"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},s.allocUnsafe=function(t){if(\"number\"!=typeof t)throw new TypeError(\"Argument must be a number\");return i(t)},s.allocUnsafeSlow=function(t){if(\"number\"!=typeof t)throw new TypeError(\"Argument must be a number\");return n.SlowBuffer(t)}},function(t,e,r){\"use strict\";var n=SyntaxError,i=Function,o=TypeError,s=function(t){try{return i('\"use strict\"; return ('+t+\").constructor;\")()}catch(t){}},a=Object.getOwnPropertyDescriptor;if(a)try{a({},\"\")}catch(t){a=null}var u=function(){throw new o},c=a?function(){try{return u}catch(t){try{return a(arguments,\"callee\").get}catch(t){return u}}}():u,l=r(145)(),f=r(147)(),h=Object.getPrototypeOf||(f?function(t){return t.__proto__}:null),d={},p=\"undefined\"!=typeof Uint8Array&&h?h(Uint8Array):void 0,y={\"%AggregateError%\":\"undefined\"==typeof AggregateError?void 0:AggregateError,\"%Array%\":Array,\"%ArrayBuffer%\":\"undefined\"==typeof ArrayBuffer?void 0:ArrayBuffer,\"%ArrayIteratorPrototype%\":l&&h?h([][Symbol.iterator]()):void 0,\"%AsyncFromSyncIteratorPrototype%\":void 0,\"%AsyncFunction%\":d,\"%AsyncGenerator%\":d,\"%AsyncGeneratorFunction%\":d,\"%AsyncIteratorPrototype%\":d,\"%Atomics%\":\"undefined\"==typeof Atomics?void 0:Atomics,\"%BigInt%\":\"undefined\"==typeof BigInt?void 0:BigInt,\"%BigInt64Array%\":\"undefined\"==typeof BigInt64Array?void 0:BigInt64Array,\"%BigUint64Array%\":\"undefined\"==typeof BigUint64Array?void 0:BigUint64Array,\"%Boolean%\":Boolean,\"%DataView%\":\"undefined\"==typeof DataView?void 0:DataView,\"%Date%\":Date,\"%decodeURI%\":decodeURI,\"%decodeURIComponent%\":decodeURIComponent,\"%encodeURI%\":encodeURI,\"%encodeURIComponent%\":encodeURIComponent,\"%Error%\":Error,\"%eval%\":eval,\"%EvalError%\":EvalError,\"%Float32Array%\":\"undefined\"==typeof Float32Array?void 0:Float32Array,\"%Float64Array%\":\"undefined\"==typeof Float64Array?void 0:Float64Array,\"%FinalizationRegistry%\":\"undefined\"==typeof FinalizationRegistry?void 0:FinalizationRegistry,\"%Function%\":i,\"%GeneratorFunction%\":d,\"%Int8Array%\":\"undefined\"==typeof Int8Array?void 0:Int8Array,\"%Int16Array%\":\"undefined\"==typeof Int16Array?void 0:Int16Array,\"%Int32Array%\":\"undefined\"==typeof Int32Array?void 0:Int32Array,\"%isFinite%\":isFinite,\"%isNaN%\":isNaN,\"%IteratorPrototype%\":l&&h?h(h([][Symbol.iterator]())):void 0,\"%JSON%\":\"object\"==typeof JSON?JSON:void 0,\"%Map%\":\"undefined\"==typeof Map?void 0:Map,\"%MapIteratorPrototype%\":\"undefined\"!=typeof Map&&l&&h?h((new Map)[Symbol.iterator]()):void 0,\"%Math%\":Math,\"%Number%\":Number,\"%Object%\":Object,\"%parseFloat%\":parseFloat,\"%parseInt%\":parseInt,\"%Promise%\":\"undefined\"==typeof Promise?void 0:Promise,\"%Proxy%\":\"undefined\"==typeof Proxy?void 0:Proxy,\"%RangeError%\":RangeError,\"%ReferenceError%\":ReferenceError,\"%Reflect%\":\"undefined\"==typeof Reflect?void 0:Reflect,\"%RegExp%\":RegExp,\"%Set%\":\"undefined\"==typeof Set?void 0:Set,\"%SetIteratorPrototype%\":\"undefined\"!=typeof Set&&l&&h?h((new Set)[Symbol.iterator]()):void 0,\"%SharedArrayBuffer%\":\"undefined\"==typeof SharedArrayBuffer?void 0:SharedArrayBuffer,\"%String%\":String,\"%StringIteratorPrototype%\":l&&h?h(\"\"[Symbol.iterator]()):void 0,\"%Symbol%\":l?Symbol:void 0,\"%SyntaxError%\":n,\"%ThrowTypeError%\":c,\"%TypedArray%\":p,\"%TypeError%\":o,\"%Uint8Array%\":\"undefined\"==typeof Uint8Array?void 0:Uint8Array,\"%Uint8ClampedArray%\":\"undefined\"==typeof Uint8ClampedArray?void 0:Uint8ClampedArray,\"%Uint16Array%\":\"undefined\"==typeof Uint16Array?void 0:Uint16Array,\"%Uint32Array%\":\"undefined\"==typeof Uint32Array?void 0:Uint32Array,\"%URIError%\":URIError,\"%WeakMap%\":\"undefined\"==typeof WeakMap?void 0:WeakMap,\"%WeakRef%\":\"undefined\"==typeof WeakRef?void 0:WeakRef,\"%WeakSet%\":\"undefined\"==typeof WeakSet?void 0:WeakSet};if(h)try{null.error}catch(t){var g=h(h(t));y[\"%Error.prototype%\"]=g}var m={\"%ArrayBufferPrototype%\":[\"ArrayBuffer\",\"prototype\"],\"%ArrayPrototype%\":[\"Array\",\"prototype\"],\"%ArrayProto_entries%\":[\"Array\",\"prototype\",\"entries\"],\"%ArrayProto_forEach%\":[\"Array\",\"prototype\",\"forEach\"],\"%ArrayProto_keys%\":[\"Array\",\"prototype\",\"keys\"],\"%ArrayProto_values%\":[\"Array\",\"prototype\",\"values\"],\"%AsyncFunctionPrototype%\":[\"AsyncFunction\",\"prototype\"],\"%AsyncGenerator%\":[\"AsyncGeneratorFunction\",\"prototype\"],\"%AsyncGeneratorPrototype%\":[\"AsyncGeneratorFunction\",\"prototype\",\"prototype\"],\"%BooleanPrototype%\":[\"Boolean\",\"prototype\"],\"%DataViewPrototype%\":[\"DataView\",\"prototype\"],\"%DatePrototype%\":[\"Date\",\"prototype\"],\"%ErrorPrototype%\":[\"Error\",\"prototype\"],\"%EvalErrorPrototype%\":[\"EvalError\",\"prototype\"],\"%Float32ArrayPrototype%\":[\"Float32Array\",\"prototype\"],\"%Float64ArrayPrototype%\":[\"Float64Array\",\"prototype\"],\"%FunctionPrototype%\":[\"Function\",\"prototype\"],\"%Generator%\":[\"GeneratorFunction\",\"prototype\"],\"%GeneratorPrototype%\":[\"GeneratorFunction\",\"prototype\",\"prototype\"],\"%Int8ArrayPrototype%\":[\"Int8Array\",\"prototype\"],\"%Int16ArrayPrototype%\":[\"Int16Array\",\"prototype\"],\"%Int32ArrayPrototype%\":[\"Int32Array\",\"prototype\"],\"%JSONParse%\":[\"JSON\",\"parse\"],\"%JSONStringify%\":[\"JSON\",\"stringify\"],\"%MapPrototype%\":[\"Map\",\"prototype\"],\"%NumberPrototype%\":[\"Number\",\"prototype\"],\"%ObjectPrototype%\":[\"Object\",\"prototype\"],\"%ObjProto_toString%\":[\"Object\",\"prototype\",\"toString\"],\"%ObjProto_valueOf%\":[\"Object\",\"prototype\",\"valueOf\"],\"%PromisePrototype%\":[\"Promise\",\"prototype\"],\"%PromiseProto_then%\":[\"Promise\",\"prototype\",\"then\"],\"%Promise_all%\":[\"Promise\",\"all\"],\"%Promise_reject%\":[\"Promise\",\"reject\"],\"%Promise_resolve%\":[\"Promise\",\"resolve\"],\"%RangeErrorPrototype%\":[\"RangeError\",\"prototype\"],\"%ReferenceErrorPrototype%\":[\"ReferenceError\",\"prototype\"],\"%RegExpPrototype%\":[\"RegExp\",\"prototype\"],\"%SetPrototype%\":[\"Set\",\"prototype\"],\"%SharedArrayBufferPrototype%\":[\"SharedArrayBuffer\",\"prototype\"],\"%StringPrototype%\":[\"String\",\"prototype\"],\"%SymbolPrototype%\":[\"Symbol\",\"prototype\"],\"%SyntaxErrorPrototype%\":[\"SyntaxError\",\"prototype\"],\"%TypedArrayPrototype%\":[\"TypedArray\",\"prototype\"],\"%TypeErrorPrototype%\":[\"TypeError\",\"prototype\"],\"%Uint8ArrayPrototype%\":[\"Uint8Array\",\"prototype\"],\"%Uint8ClampedArrayPrototype%\":[\"Uint8ClampedArray\",\"prototype\"],\"%Uint16ArrayPrototype%\":[\"Uint16Array\",\"prototype\"],\"%Uint32ArrayPrototype%\":[\"Uint32Array\",\"prototype\"],\"%URIErrorPrototype%\":[\"URIError\",\"prototype\"],\"%WeakMapPrototype%\":[\"WeakMap\",\"prototype\"],\"%WeakSetPrototype%\":[\"WeakSet\",\"prototype\"]},b=r(45),v=r(149),w=b.call(Function.call,Array.prototype.concat),x=b.call(Function.apply,Array.prototype.splice),_=b.call(Function.call,String.prototype.replace),S=b.call(Function.call,String.prototype.slice),A=b.call(Function.call,RegExp.prototype.exec),E=/[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g,k=/\\\\(\\\\)?/g,T=function(t){var e=S(t,0,1),r=S(t,-1);if(\"%\"===e&&\"%\"!==r)throw new n(\"invalid intrinsic syntax, expected closing `%`\");if(\"%\"===r&&\"%\"!==e)throw new n(\"invalid intrinsic syntax, expected opening `%`\");var i=[];return _(t,E,(function(t,e,r,n){i[i.length]=r?_(n,k,\"$1\"):e||t})),i},O=function(t,e){var r,i=t;if(v(m,i)&&(i=\"%\"+(r=m[i])[0]+\"%\"),v(y,i)){var a=y[i];if(a===d&&(a=function t(e){var r;if(\"%AsyncFunction%\"===e)r=s(\"async function () {}\");else if(\"%GeneratorFunction%\"===e)r=s(\"function* () {}\");else if(\"%AsyncGeneratorFunction%\"===e)r=s(\"async function* () {}\");else if(\"%AsyncGenerator%\"===e){var n=t(\"%AsyncGeneratorFunction%\");n&&(r=n.prototype)}else if(\"%AsyncIteratorPrototype%\"===e){var i=t(\"%AsyncGenerator%\");i&&h&&(r=h(i.prototype))}return y[e]=r,r}(i)),void 0===a&&!e)throw new o(\"intrinsic \"+t+\" exists, but is not available. Please file an issue!\");return{alias:r,name:i,value:a}}throw new n(\"intrinsic \"+t+\" does not exist!\")};t.exports=function(t,e){if(\"string\"!=typeof t||0===t.length)throw new o(\"intrinsic name must be a non-empty string\");if(arguments.length>1&&\"boolean\"!=typeof e)throw new o('\"allowMissing\" argument must be a boolean');if(null===A(/^%?[^%]*%?$/,t))throw new n(\"`%` may not be present anywhere but at the beginning and end of the intrinsic name\");var r=T(t),i=r.length>0?r[0]:\"\",s=O(\"%\"+i+\"%\",e),u=s.name,c=s.value,l=!1,f=s.alias;f&&(i=f[0],x(r,w([0,1],f)));for(var h=1,d=!0;h=r.length){var b=a(c,p);c=(d=!!b)&&\"get\"in b&&!(\"originalValue\"in b.get)?b.get:c[p]}else d=v(c,p),c=c[p];d&&!l&&(y[u]=c)}}return c}},function(t,e,r){\"use strict\";var n=r(148);t.exports=Function.prototype.bind||n},function(t,e,r){\"use strict\";var n=String.prototype.replace,i=/%20/g,o=\"RFC1738\",s=\"RFC3986\";t.exports={default:s,formatters:{RFC1738:function(t){return n.call(t,i,\"+\")},RFC3986:function(t){return String(t)}},RFC1738:o,RFC3986:s}},function(t,e,r){\"use strict\";const n=r(5),i=r(11),o=r(48),s=r(9);function a(t,e,r=\"1\"){if(i(t))return\"0\";let a=t,u=t;for(;\"<\"===n(u,e);)u=s(u,r),a=o(a,u);return a}t.exports=a,t.exports.default=a},function(t,e,r){\"use strict\";const{MAX_SAFE_INTEGER_LENGTH:n}=r(30);function i(t,e){if(\"0\"===t||\"0\"===e)return\"0\";const r=t.indexOf(\".\"),i=e.indexOf(\".\"),o=(-1===r?t.length:r)+(-1===i?e.length:i),s=(-1===r?0:t.length-1-r)+(-1===i?0:e.length-1-i);if(0===s&&o=0;){const t=h,e=h-=15,r=a.substring(e,t);f.push([Number(r),r.length])}const d=[],p=[];for(let t=0,e=l-1;e>=0;e--,t++){const r=u[e],n=Number(r);let i=0,o=\"\";const s=f.length-1;f.forEach(([t,e],r)=>{let a=(i+n*t).toString();const u=a.length;if(u>e&&r!==s){const t=-1*e;o=a.slice(t)+o,i=Number(a.slice(0,t))}else{const t=e-u;for(let e=0;eNumber(t)),o.length])}const y=d.length,g=p[p.length-1][1]+y;let m=\"\",b=0;for(let t=0;t=0&&(e+=r[o])}e>=10?(e=e.toString(),m=e[e.length-1]+m,b=Number(e.slice(0,-1))):(m=e+m,b=0)}if(0===s)m=m.replace(/^0+/,\"\");else{const t=m.length-s;m=m.substring(0,t)+\".\"+m.substring(t),m=m.replace(/^0+/,\"\"),m=m.replace(/\\.?0+$/,\"\"),\".\"===m[0]&&(m=\"0\"+m)}return m}t.exports=i,t.exports.default=i},function(t,e,r){\"use strict\";const n=r(6),i=r(160),o=[\"5\",\"6\",\"7\",\"8\",\"9\"];function s(t){if(t.match(/\\.9+$/))return n(i(t),\"1\");\"+\"===t[0]&&(t=t.substring(1));const e=t.length;let r=\"\";const s=t[t.length-1];if(o.includes(s)){let n;for(n=e-2;n>=0;n--){const e=t[n];if(\".\"===e||\"-\"===e)continue;const i=Number(e)+1;if(10!==i){r=i+r;break}r=\"0\"+r}n>0&&(r=t.substring(0,n)+r)}else r=t.substring(0,e-1);return\".\"===r[r.length-1]&&(r=r.substring(0,r.length-1)),r.indexOf(\".\")>-1&&(r=r.replace(/0+$/,\"\")),r}t.exports=s,t.exports.default=s},function(t,e,r){\"use strict\";function n(t){return\"-\"===t[0]?\"-\":\"+\"}t.exports=n,t.exports.default=n},function(t,e,r){\"use strict\";const n=r(0);function i(t){const e=(t=n(t)).indexOf(\".\");return-1===e?\"0\":(t.length-e-1).toString()}t.exports=i,t.exports.default=i},function(t,e,r){\"use strict\";function n(t){return t.includes(\"i\")}t.exports=n,t.exports.default=n},function(t,e,r){\"use strict\";const n=r(79);function i(){const t=Array.from(arguments),e=\"object\"==typeof t[t.length-1]?t[t.length-1]:void 0,r=Array.isArray(t[0])?t[0]:e?t.slice(0,t.length-1):t;return n(r,e)}t.exports=i,t.exports.default=i},function(t,e,r){\"use strict\";const n=r(17);function i(t,e){const r=Number(e);let i=t;for(let e=1;et.type===c.a.internalError).map(t=>t.error);return Object.assign(t,{[u.a]:i,[u.b]:r,[u.c]:n,[u.e]:e})}function m(t,e){return f(this,void 0,void 0,(function*(){d(\"Initializing new thread\");const r=e&&e.timeout?e.timeout:y,n=(yield function(t,e,r){return f(this,void 0,void 0,(function*(){let n;const i=new Promise((t,i)=>{n=setTimeout(()=>i(Error(r)),e)}),o=yield Promise.race([t,i]);return clearTimeout(n),o}))}(function(t){return new Promise((e,r)=>{const n=i=>{var o;h(\"Message from worker before finishing initialization:\",i.data),(o=i.data)&&\"init\"===o.type?(t.removeEventListener(\"message\",n),e(i.data)):(t=>t&&\"uncaughtError\"===t.type)(i.data)&&(t.removeEventListener(\"message\",n),r(Object(s.a)(i.data.error)))};t.addEventListener(\"message\",n)})}(t),r,`Timeout: Did not receive an init message from worker after ${r}ms. Make sure the worker calls expose().`)).exposed,{termination:i,terminate:u}=function(t){const[e,r]=Object(a.a)();return{terminate:()=>f(this,void 0,void 0,(function*(){p(\"Terminating worker\"),yield t.terminate(),r()})),termination:e}}(t),m=function(t,e){return new o.a(r=>{const n=t=>{const e={type:c.a.message,data:t.data};r.next(e)},i=t=>{p(\"Unhandled promise rejection event in thread:\",t);const e={type:c.a.internalError,error:Error(t.reason)};r.next(e)};t.addEventListener(\"message\",n),t.addEventListener(\"unhandledrejection\",i),e.then(()=>{const e={type:c.a.termination};t.removeEventListener(\"message\",n),t.removeEventListener(\"unhandledrejection\",i),r.next(e),r.complete()})})}(t,i);if(\"function\"===n.type){return g(Object(l.a)(t),t,m,u)}if(\"module\"===n.type){return g(Object(l.b)(t,n.methods),t,m,u)}{const t=n.type;throw Error(\"Worker init message states unexpected type of expose(): \"+t)}}))}}).call(this,r(8))},function(t,e,r){\"use strict\";r.d(e,\"a\",(function(){return g}));var n=r(12),i=r.n(n),o=r(103),s=r(201),a=r(26);function u(t){return Promise.all(t.map(t=>{const e=t=>({status:\"fulfilled\",value:t}),r=t=>({status:\"rejected\",reason:t}),n=Promise.resolve(t);try{return n.then(e,r)}catch(t){return Promise.reject(t)}}))}var c,l=r(19);!function(t){t.initialized=\"initialized\",t.taskCanceled=\"taskCanceled\",t.taskCompleted=\"taskCompleted\",t.taskFailed=\"taskFailed\",t.taskQueued=\"taskQueued\",t.taskQueueDrained=\"taskQueueDrained\",t.taskStart=\"taskStart\",t.terminated=\"terminated\"}(c||(c={}));var f=r(24),h=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))};let d=1;class p{constructor(t,e){this.eventSubject=new o.a,this.initErrors=[],this.isClosing=!1,this.nextTaskID=1,this.taskQueue=[];const r=\"number\"==typeof e?{size:e}:e||{},{size:n=l.a}=r;this.debug=i()(\"threads:pool:\"+(r.name||String(d++)).replace(/\\W/g,\" \").trim().replace(/\\s+/g,\"-\")),this.options=r,this.workers=function(t,e){return function(t){const e=[];for(let r=0;r({init:t(),runningTasks:[]}))}(t,n),this.eventObservable=Object(s.a)(a.a.from(this.eventSubject)),Promise.all(this.workers.map(t=>t.init)).then(()=>this.eventSubject.next({type:c.initialized,size:this.workers.length}),t=>{this.debug(\"Error while initializing pool worker:\",t),this.eventSubject.error(t),this.initErrors.push(t)})}findIdlingWorker(){const{concurrency:t=1}=this.options;return this.workers.find(e=>e.runningTasks.lengthh(this,void 0,void 0,(function*(){var n;yield(n=0,new Promise(t=>setTimeout(t,n)));try{yield this.runPoolTask(t,e)}finally{t.runningTasks=t.runningTasks.filter(t=>t!==r),this.isClosing||this.scheduleWork()}})))();t.runningTasks.push(r)}))}scheduleWork(){this.debug(\"Attempt de-queueing a task in order to run it...\");const t=this.findIdlingWorker();if(!t)return;const e=this.taskQueue.shift();if(!e)return this.debug(\"Task queue is empty\"),void this.eventSubject.next({type:c.taskQueueDrained});this.run(t,e)}taskCompletion(t){return new Promise((e,r)=>{const n=this.events().subscribe(i=>{i.type===c.taskCompleted&&i.taskID===t?(n.unsubscribe(),e(i.returnValue)):i.type===c.taskFailed&&i.taskID===t?(n.unsubscribe(),r(i.error)):i.type===c.terminated&&(n.unsubscribe(),r(Error(\"Pool has been terminated before task was run.\")))})})}settled(t=!1){return h(this,void 0,void 0,(function*(){const e=()=>{return t=this.workers,e=t=>t.runningTasks,t.reduce((t,r)=>[...t,...e(r)],[]);var t,e},r=[],n=this.eventObservable.subscribe(t=>{t.type===c.taskFailed&&r.push(t.error)});return this.initErrors.length>0?Promise.reject(this.initErrors[0]):t&&0===this.taskQueue.length?(yield u(e()),r):(yield new Promise((t,e)=>{const r=this.eventObservable.subscribe({next(e){e.type===c.taskQueueDrained&&(r.unsubscribe(),t(void 0))},error:e})}),yield u(e()),n.unsubscribe(),r)}))}completed(t=!1){return h(this,void 0,void 0,(function*(){const e=this.settled(t),r=new Promise((t,r)=>{const n=this.eventObservable.subscribe({next(i){i.type===c.taskQueueDrained?(n.unsubscribe(),t(e)):i.type===c.taskFailed&&(n.unsubscribe(),r(i.error))},error:r})}),n=yield Promise.race([e,r]);if(n.length>0)throw n[0]}))}events(){return this.eventObservable}queue(t){const{maxQueuedJobs:e=1/0}=this.options;if(this.isClosing)throw Error(\"Cannot schedule pool tasks after terminate() has been called.\");if(this.initErrors.length>0)throw this.initErrors[0];const r=this.nextTaskID++,n=this.taskCompletion(r);n.catch(t=>{this.debug(`Task #${r} errored:`,t)});const i={id:r,run:t,cancel:()=>{-1!==this.taskQueue.indexOf(i)&&(this.taskQueue=this.taskQueue.filter(t=>t!==i),this.eventSubject.next({type:c.taskCanceled,taskID:i.id}))},then:n.then.bind(n)};if(this.taskQueue.length>=e)throw Error(\"Maximum number of pool tasks queued. Refusing to queue another one.\\nThis usually happens for one of two reasons: We are either at peak workload right now or some tasks just won't finish, thus blocking the pool.\");return this.debug(`Queueing task #${i.id}...`),this.taskQueue.push(i),this.eventSubject.next({type:c.taskQueued,taskID:i.id}),this.scheduleWork(),i}terminate(t){return h(this,void 0,void 0,(function*(){this.isClosing=!0,t||(yield this.completed(!0)),this.eventSubject.next({type:c.terminated,remainingQueue:[...this.taskQueue]}),this.eventSubject.complete(),yield Promise.all(this.workers.map(t=>h(this,void 0,void 0,(function*(){return f.a.terminate(yield t.init)}))))}))}}function y(t,e){return new p(t,e)}p.EventType=c,y.EventType=c;const g=y},function(t,e,r){\"use strict\";r.d(e,\"a\",(function(){return b})),r.d(e,\"b\",(function(){return v}));var n=r(12),i=r.n(n),o=r(26),s=r(201),a=r(13);const u=()=>{},c=t=>t,l=t=>Promise.resolve().then(t);function f(t){throw t}class h extends o.a{constructor(t){super(e=>{const r=this,n=Object.assign(Object.assign({},e),{complete(){e.complete(),r.onCompletion()},error(t){e.error(t),r.onError(t)},next(t){e.next(t),r.onNext(t)}});try{return this.initHasRun=!0,t(n)}catch(t){n.error(t)}}),this.initHasRun=!1,this.fulfillmentCallbacks=[],this.rejectionCallbacks=[],this.firstValueSet=!1,this.state=\"pending\"}onNext(t){this.firstValueSet||(this.firstValue=t,this.firstValueSet=!0)}onError(t){this.state=\"rejected\",this.rejection=t;for(const e of this.rejectionCallbacks)l(()=>e(t))}onCompletion(){this.state=\"fulfilled\";for(const t of this.fulfillmentCallbacks)l(()=>t(this.firstValue))}then(t,e){const r=t||c,n=e||f;let i=!1;return new Promise((t,e)=>{const o=r=>{if(!i){i=!0;try{t(n(r))}catch(t){e(t)}}};return this.initHasRun||this.subscribe({error:o}),\"fulfilled\"===this.state?t(r(this.firstValue)):\"rejected\"===this.state?(i=!0,t(n(this.rejection))):(this.fulfillmentCallbacks.push(e=>{try{t(r(e))}catch(t){o(t)}}),void this.rejectionCallbacks.push(o))})}catch(t){return this.then(void 0,t)}finally(t){const e=t||u;return this.then(t=>(e(),t),()=>e())}static from(t){return function(t){return t&&\"function\"==typeof t.then}(t)?new h(e=>{t.then(t=>{e.next(t),e.complete()},t=>{e.error(t)})}):super.from(t)}}var d=r(105),p=r(20);const y=i()(\"threads:master:messages\");let g=1;function m(t,e){return new o.a(r=>{let n;const i=o=>{var s;if(y(\"Message from worker:\",o.data),o.data&&o.data.uid===e)if((s=o.data)&&s.type===p.b.running)n=o.data.resultType;else if((t=>t&&t.type===p.b.result)(o.data))\"promise\"===n?(void 0!==o.data.payload&&r.next(Object(a.a)(o.data.payload)),r.complete(),t.removeEventListener(\"message\",i)):(o.data.payload&&r.next(Object(a.a)(o.data.payload)),o.data.complete&&(r.complete(),t.removeEventListener(\"message\",i)));else if((t=>t&&t.type===p.b.error)(o.data)){const e=Object(a.a)(o.data.error);r.error(e),t.removeEventListener(\"message\",i)}};return t.addEventListener(\"message\",i),()=>{if(\"observable\"===n||!n){const r={type:p.a.cancel,uid:e};t.postMessage(r)}t.removeEventListener(\"message\",i)}})}function b(t,e){return(...r)=>{const n=g++,{args:i,transferables:o}=function(t){if(0===t.length)return{args:[],transferables:[]};const e=[],r=[];for(const n of t)Object(d.a)(n)?(e.push(Object(a.b)(n.send)),r.push(...n.transferables)):e.push(Object(a.b)(n));return{args:e,transferables:0===r.length?r:(n=r,Array.from(new Set(n)))};var n}(r),u={type:p.a.run,uid:n,method:e,args:i};y(\"Sending command to run function to worker:\",u);try{t.postMessage(u,o)}catch(t){return h.from(Promise.reject(t))}return h.from(Object(s.a)(m(t,n)))}}function v(t,e){const r={};for(const n of e)r[n]=b(t,n);return r}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return\"[object Array]\"==r.call(t)}},function(t,e,r){\"use strict\";(function(e,n){var i=r(28);t.exports=v;var o,s=r(60);v.ReadableState=b;r(62).EventEmitter;var a=function(t,e){return t.listeners(e).length},u=r(63),c=r(43).Buffer,l=(void 0!==e?e:\"undefined\"!=typeof window?window:\"undefined\"!=typeof self?self:{}).Uint8Array||function(){};var f=Object.create(r(21));f.inherits=r(10);var h=r(115),d=void 0;d=h&&h.debuglog?h.debuglog(\"stream\"):function(){};var p,y=r(116),g=r(64);f.inherits(v,u);var m=[\"error\",\"close\",\"destroy\",\"pause\",\"resume\"];function b(t,e){t=t||{};var n=e instanceof(o=o||r(14));this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var i=t.highWaterMark,s=t.readableHighWaterMark,a=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(s||0===s)?s:a,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new y,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||\"utf8\",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(p||(p=r(66).StringDecoder),this.decoder=new p(t.encoding),this.encoding=t.encoding)}function v(t){if(o=o||r(14),!(this instanceof v))return new v(t);this._readableState=new b(t,this),this.readable=!0,t&&(\"function\"==typeof t.read&&(this._read=t.read),\"function\"==typeof t.destroy&&(this._destroy=t.destroy)),u.call(this)}function w(t,e,r,n,i){var o,s=t._readableState;null===e?(s.reading=!1,function(t,e){if(e.ended)return;if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,S(t)}(t,s)):(i||(o=function(t,e){var r;n=e,c.isBuffer(n)||n instanceof l||\"string\"==typeof e||void 0===e||t.objectMode||(r=new TypeError(\"Invalid non-string/buffer chunk\"));var n;return r}(s,e)),o?t.emit(\"error\",o):s.objectMode||e&&e.length>0?(\"string\"==typeof e||s.objectMode||Object.getPrototypeOf(e)===c.prototype||(e=function(t){return c.from(t)}(e)),n?s.endEmitted?t.emit(\"error\",new Error(\"stream.unshift() after end event\")):x(t,s,e,!0):s.ended?t.emit(\"error\",new Error(\"stream.push() after EOF\")):(s.reading=!1,s.decoder&&!r?(e=s.decoder.write(e),s.objectMode||0!==e.length?x(t,s,e,!1):E(t,s)):x(t,s,e,!1))):n||(s.reading=!1));return function(t){return!t.ended&&(t.needReadable||t.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=8388608?t=8388608:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function S(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(d(\"emitReadable\",e.flowing),e.emittedReadable=!0,e.sync?i.nextTick(A,t):A(t))}function A(t){d(\"emit readable\"),t.emit(\"readable\"),C(t)}function E(t,e){e.readingMore||(e.readingMore=!0,i.nextTick(k,t,e))}function k(t,e){for(var r=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length=e.length?(r=e.decoder?e.buffer.join(\"\"):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):r=function(t,e,r){var n;to.length?o.length:t;if(s===o.length?i+=o:i+=o.slice(0,t),0===(t-=s)){s===o.length?(++n,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=o.slice(s));break}++n}return e.length-=n,i}(t,e):function(t,e){var r=c.allocUnsafe(t),n=e.head,i=1;n.data.copy(r),t-=n.data.length;for(;n=n.next;){var o=n.data,s=t>o.length?o.length:t;if(o.copy(r,r.length-t,0,s),0===(t-=s)){s===o.length?(++i,n.next?e.head=n.next:e.head=e.tail=null):(e.head=n,n.data=o.slice(s));break}++i}return e.length-=i,r}(t,e);return n}(t,e.buffer,e.decoder),r);var r}function I(t){var e=t._readableState;if(e.length>0)throw new Error('\"endReadable()\" called on non-empty stream');e.endEmitted||(e.ended=!0,i.nextTick(R,e,t))}function R(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit(\"end\"))}function j(t,e){for(var r=0,n=t.length;r=e.highWaterMark||e.ended))return d(\"read: emitReadable\",e.length,e.ended),0===e.length&&e.ended?I(this):S(this),null;if(0===(t=_(t,e))&&e.ended)return 0===e.length&&I(this),null;var n,i=e.needReadable;return d(\"need readable\",i),(0===e.length||e.length-t0?P(t,e):null)?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&I(this)),null!==n&&this.emit(\"data\",n),n},v.prototype._read=function(t){this.emit(\"error\",new Error(\"_read() is not implemented\"))},v.prototype.pipe=function(t,e){var r=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=t;break;case 1:o.pipes=[o.pipes,t];break;default:o.pipes.push(t)}o.pipesCount+=1,d(\"pipe count=%d opts=%j\",o.pipesCount,e);var u=(!e||!1!==e.end)&&t!==n.stdout&&t!==n.stderr?l:v;function c(e,n){d(\"onunpipe\"),e===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,d(\"cleanup\"),t.removeListener(\"close\",m),t.removeListener(\"finish\",b),t.removeListener(\"drain\",f),t.removeListener(\"error\",g),t.removeListener(\"unpipe\",c),r.removeListener(\"end\",l),r.removeListener(\"end\",v),r.removeListener(\"data\",y),h=!0,!o.awaitDrain||t._writableState&&!t._writableState.needDrain||f())}function l(){d(\"onend\"),t.end()}o.endEmitted?i.nextTick(u):r.once(\"end\",u),t.on(\"unpipe\",c);var f=function(t){return function(){var e=t._readableState;d(\"pipeOnDrain\",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&a(t,\"data\")&&(e.flowing=!0,C(t))}}(r);t.on(\"drain\",f);var h=!1;var p=!1;function y(e){d(\"ondata\"),p=!1,!1!==t.write(e)||p||((1===o.pipesCount&&o.pipes===t||o.pipesCount>1&&-1!==j(o.pipes,t))&&!h&&(d(\"false write response, pause\",o.awaitDrain),o.awaitDrain++,p=!0),r.pause())}function g(e){d(\"onerror\",e),v(),t.removeListener(\"error\",g),0===a(t,\"error\")&&t.emit(\"error\",e)}function m(){t.removeListener(\"finish\",b),v()}function b(){d(\"onfinish\"),t.removeListener(\"close\",m),v()}function v(){d(\"unpipe\"),r.unpipe(t)}return r.on(\"data\",y),function(t,e,r){if(\"function\"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?s(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,\"error\",g),t.once(\"close\",m),t.once(\"finish\",b),t.emit(\"pipe\",r),o.flowing||(d(\"pipe resume\"),r.resume()),t},v.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit(\"unpipe\",this,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o0&&s.length>i&&!s.warned){s.warned=!0;var u=new Error(\"Possible EventEmitter memory leak detected. \"+s.length+\" \"+String(e)+\" listeners added. Use emitter.setMaxListeners() to increase limit\");u.name=\"MaxListenersExceededWarning\",u.emitter=t,u.type=e,u.count=s.length,a=u,console&&console.warn&&console.warn(a)}return t}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=h.bind(n);return i.listener=r,n.wrapFn=i,i}function p(t,e,r){var n=t._events;if(void 0===n)return[];var i=n[e];return void 0===i?[]:\"function\"==typeof i?r?[i.listener||i]:[i]:r?function(t){for(var e=new Array(t.length),r=0;r0&&(s=e[0]),s instanceof Error)throw s;var a=new Error(\"Unhandled error.\"+(s?\" (\"+s.message+\")\":\"\"));throw a.context=s,a}var u=i[t];if(void 0===u)return!1;if(\"function\"==typeof u)o(u,this,e);else{var c=u.length,l=g(u,c);for(r=0;r=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1=0;n--)this.removeListener(t,e[n]);return this},a.prototype.listeners=function(t){return p(this,t,!0)},a.prototype.rawListeners=function(t){return p(this,t,!1)},a.listenerCount=function(t,e){return\"function\"==typeof t.listenerCount?t.listenerCount(e):y.call(t,e)},a.prototype.listenerCount=y,a.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},function(t,e,r){t.exports=r(62).EventEmitter},function(t,e,r){\"use strict\";var n=r(28);function i(t,e){t.emit(\"error\",e)}t.exports={destroy:function(t,e){var r=this,o=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return o||s?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,n.nextTick(i,this,t)):n.nextTick(i,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!e&&t?r._writableState?r._writableState.errorEmitted||(r._writableState.errorEmitted=!0,n.nextTick(i,r,t)):n.nextTick(i,r,t):e&&e(t)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},function(t,e,r){\"use strict\";(function(e,n,i){var o=r(28);function s(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,r){var n=t.entry;t.entry=null;for(;n;){var i=n.callback;e.pendingcb--,i(r),n=n.next}e.corkedRequestsFree.next=t}(e,t)}}t.exports=b;var a,u=!e.browser&&[\"v0.10\",\"v0.9.\"].indexOf(e.version.slice(0,5))>-1?n:o.nextTick;b.WritableState=m;var c=Object.create(r(21));c.inherits=r(10);var l={deprecate:r(120)},f=r(63),h=r(43).Buffer,d=(void 0!==i?i:\"undefined\"!=typeof window?window:\"undefined\"!=typeof self?self:{}).Uint8Array||function(){};var p,y=r(64);function g(){}function m(t,e){a=a||r(14),t=t||{};var n=e instanceof a;this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var i=t.highWaterMark,c=t.writableHighWaterMark,l=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(c||0===c)?c:l,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var f=!1===t.decodeStrings;this.decodeStrings=!f,this.defaultEncoding=t.defaultEncoding||\"utf8\",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,n=r.sync,i=r.writecb;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),e)!function(t,e,r,n,i){--e.pendingcb,r?(o.nextTick(i,n),o.nextTick(A,t,e),t._writableState.errorEmitted=!0,t.emit(\"error\",n)):(i(n),t._writableState.errorEmitted=!0,t.emit(\"error\",n),A(t,e))}(t,r,n,e,i);else{var s=_(r);s||r.corked||r.bufferProcessing||!r.bufferedRequest||x(t,r),n?u(w,t,r,s,i):w(t,r,s,i)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new s(this)}function b(t){if(a=a||r(14),!(p.call(b,this)||this instanceof a))return new b(t);this._writableState=new m(t,this),this.writable=!0,t&&(\"function\"==typeof t.write&&(this._write=t.write),\"function\"==typeof t.writev&&(this._writev=t.writev),\"function\"==typeof t.destroy&&(this._destroy=t.destroy),\"function\"==typeof t.final&&(this._final=t.final)),f.call(this)}function v(t,e,r,n,i,o,s){e.writelen=n,e.writecb=s,e.writing=!0,e.sync=!0,r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function w(t,e,r,n){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit(\"drain\"))}(t,e),e.pendingcb--,n(),A(t,e)}function x(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,i=new Array(n),o=e.corkedRequestsFree;o.entry=r;for(var a=0,u=!0;r;)i[a]=r,r.isBuf||(u=!1),r=r.next,a+=1;i.allBuffers=u,v(t,e,!0,e.length,i,\"\",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new s(e),e.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,l=r.encoding,f=r.callback;if(v(t,e,!1,e.objectMode?1:c.length,c,l,f),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function _(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function S(t,e){t._final((function(r){e.pendingcb--,r&&t.emit(\"error\",r),e.prefinished=!0,t.emit(\"prefinish\"),A(t,e)}))}function A(t,e){var r=_(e);return r&&(!function(t,e){e.prefinished||e.finalCalled||(\"function\"==typeof t._final?(e.pendingcb++,e.finalCalled=!0,o.nextTick(S,t,e)):(e.prefinished=!0,t.emit(\"prefinish\")))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit(\"finish\"))),r}c.inherits(b,f),m.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(m.prototype,\"buffer\",{get:l.deprecate((function(){return this.getBuffer()}),\"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.\",\"DEP0003\")})}catch(t){}}(),\"function\"==typeof Symbol&&Symbol.hasInstance&&\"function\"==typeof Function.prototype[Symbol.hasInstance]?(p=Function.prototype[Symbol.hasInstance],Object.defineProperty(b,Symbol.hasInstance,{value:function(t){return!!p.call(this,t)||this===b&&(t&&t._writableState instanceof m)}})):p=function(t){return t instanceof this},b.prototype.pipe=function(){this.emit(\"error\",new Error(\"Cannot pipe, not readable\"))},b.prototype.write=function(t,e,r){var n,i=this._writableState,s=!1,a=!i.objectMode&&(n=t,h.isBuffer(n)||n instanceof d);return a&&!h.isBuffer(t)&&(t=function(t){return h.from(t)}(t)),\"function\"==typeof e&&(r=e,e=null),a?e=\"buffer\":e||(e=i.defaultEncoding),\"function\"!=typeof r&&(r=g),i.ended?function(t,e){var r=new Error(\"write after end\");t.emit(\"error\",r),o.nextTick(e,r)}(this,r):(a||function(t,e,r,n){var i=!0,s=!1;return null===r?s=new TypeError(\"May not write null values to stream\"):\"string\"==typeof r||void 0===r||e.objectMode||(s=new TypeError(\"Invalid non-string/buffer chunk\")),s&&(t.emit(\"error\",s),o.nextTick(n,s),i=!1),i}(this,i,t,r))&&(i.pendingcb++,s=function(t,e,r,n,i,o){if(!r){var s=function(t,e,r){t.objectMode||!1===t.decodeStrings||\"string\"!=typeof e||(e=h.from(e,r));return e}(e,n,i);n!==s&&(r=!0,i=\"buffer\",n=s)}var a=e.objectMode?1:n.length;e.length+=a;var u=e.length-1))throw new TypeError(\"Unknown encoding: \"+t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(b.prototype,\"writableHighWaterMark\",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),b.prototype._write=function(t,e,r){r(new Error(\"_write() is not implemented\"))},b.prototype._writev=null,b.prototype.end=function(t,e,r){var n=this._writableState;\"function\"==typeof t?(r=t,t=null,e=null):\"function\"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||function(t,e,r){e.ending=!0,A(t,e),r&&(e.finished?o.nextTick(r):t.once(\"finish\",r));e.ended=!0,t.writable=!1}(this,n,r)},Object.defineProperty(b.prototype,\"destroyed\",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),b.prototype.destroy=y.destroy,b.prototype._undestroy=y.undestroy,b.prototype._destroy=function(t,e){this.end(),e(t)}}).call(this,r(8),r(118).setImmediate,r(3))},function(t,e,r){\"use strict\";var n=r(121).Buffer,i=n.isEncoding||function(t){switch((t=\"\"+t)&&t.toLowerCase()){case\"hex\":case\"utf8\":case\"utf-8\":case\"ascii\":case\"binary\":case\"base64\":case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":case\"raw\":return!0;default:return!1}};function o(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return\"utf8\";for(var e;;)switch(t){case\"utf8\":case\"utf-8\":return\"utf8\";case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return\"utf16le\";case\"latin1\":case\"binary\":return\"latin1\";case\"base64\":case\"ascii\":case\"hex\":return t;default:if(e)return;t=(\"\"+t).toLowerCase(),e=!0}}(t);if(\"string\"!=typeof e&&(n.isEncoding===i||!i(t)))throw new Error(\"Unknown encoding: \"+t);return e||t}(t),this.encoding){case\"utf16le\":this.text=u,this.end=c,e=4;break;case\"utf8\":this.fillLast=a,e=4;break;case\"base64\":this.text=l,this.end=f,e=3;break;default:return this.write=h,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(e)}function s(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:-1}function a(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!=(192&e[0]))return t.lastNeed=0,\"�\".repeat(r);if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,\"�\".repeat(r+1);if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,\"�\".repeat(r+2)}}(this,t,e);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function u(t,e){if((t.length-e)%2==0){var r=t.toString(\"utf16le\",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString(\"utf16le\",e,t.length-1)}function c(t){var e=t&&t.length?this.write(t):\"\";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString(\"utf16le\",0,r)}return e}function l(t,e){var r=(t.length-e)%3;return 0===r?t.toString(\"base64\",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString(\"base64\",e,t.length-r))}function f(t){var e=t&&t.length?this.write(t):\"\";return this.lastNeed?e+this.lastChar.toString(\"base64\",0,3-this.lastNeed):e}function h(t){return t.toString(this.encoding)}function d(t){return t&&t.length?this.write(t):\"\"}e.StringDecoder=o,o.prototype.write=function(t){if(0===t.length)return\"\";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return\"\";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0)return i>0&&(t.lastNeed=i-1),i;if(--n=0)return i>0&&(t.lastNeed=i-2),i;if(--n=0)return i>0&&(2===i?i=0:t.lastNeed=i-3),i;return 0}(this,t,e);if(!this.lastNeed)return t.toString(\"utf8\",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString(\"utf8\",e,n)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},function(t,e,r){\"use strict\";t.exports=s;var n=r(14),i=Object.create(r(21));function o(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(!n)return this.emit(\"error\",new Error(\"write callback called multiple times\"));r.writechunk=null,r.writecb=null,null!=e&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.lengthObject(o.a)(r),e)}async decode(t,e){return new Promise((r,n)=>{this.pool.queue(async i=>{try{const n=await i(t,e);r(n)}catch(t){n(t)}})})}destroy(){this.pool.terminate(!0)}}}).call(this,r(133))},function(t,e,r){(function(t){e.fetch=a(t.fetch)&&a(t.ReadableStream),e.writableStream=a(t.WritableStream),e.abortController=a(t.AbortController),e.blobConstructor=!1;try{new Blob([new ArrayBuffer(1)]),e.blobConstructor=!0}catch(t){}var r;function n(){if(void 0!==r)return r;if(t.XMLHttpRequest){r=new t.XMLHttpRequest;try{r.open(\"GET\",t.XDomainRequest?\"/\":\"https://example.com\")}catch(t){r=null}}else r=null;return r}function i(t){var e=n();if(!e)return!1;try{return e.responseType=t,e.responseType===t}catch(t){}return!1}var o=void 0!==t.ArrayBuffer,s=o&&a(t.ArrayBuffer.prototype.slice);function a(t){return\"function\"==typeof t}e.arraybuffer=e.fetch||o&&i(\"arraybuffer\"),e.msstream=!e.fetch&&s&&i(\"ms-stream\"),e.mozchunkedarraybuffer=!e.fetch&&o&&i(\"moz-chunked-arraybuffer\"),e.overrideMimeType=e.fetch||!!n()&&a(n().overrideMimeType),e.vbArray=a(t.VBArray),r=null}).call(this,r(3))},function(t,e,r){(function(t,n,i){var o=r(69),s=r(10),a=r(42),u=e.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},c=e.IncomingMessage=function(e,r,s,u){var c=this;if(a.Readable.call(c),c._mode=s,c.headers={},c.rawHeaders=[],c.trailers={},c.rawTrailers=[],c.on(\"end\",(function(){t.nextTick((function(){c.emit(\"close\")}))})),\"fetch\"===s){if(c._fetchResponse=r,c.url=r.url,c.statusCode=r.status,c.statusMessage=r.statusText,r.headers.forEach((function(t,e){c.headers[e.toLowerCase()]=t,c.rawHeaders.push(e,t)})),o.writableStream){var l=new WritableStream({write:function(t){return new Promise((function(e,r){c._destroyed?r():c.push(new n(t))?e():c._resumeFetch=e}))},close:function(){i.clearTimeout(u),c._destroyed||c.push(null)},abort:function(t){c._destroyed||c.emit(\"error\",t)}});try{return void r.body.pipeTo(l).catch((function(t){i.clearTimeout(u),c._destroyed||c.emit(\"error\",t)}))}catch(t){}}var f=r.body.getReader();!function t(){f.read().then((function(e){if(!c._destroyed){if(e.done)return i.clearTimeout(u),void c.push(null);c.push(new n(e.value)),t()}})).catch((function(t){i.clearTimeout(u),c._destroyed||c.emit(\"error\",t)}))}()}else{if(c._xhr=e,c._pos=0,c.url=e.responseURL,c.statusCode=e.status,c.statusMessage=e.statusText,e.getAllResponseHeaders().split(/\\r?\\n/).forEach((function(t){var e=t.match(/^([^:]+):\\s*(.*)/);if(e){var r=e[1].toLowerCase();\"set-cookie\"===r?(void 0===c.headers[r]&&(c.headers[r]=[]),c.headers[r].push(e[2])):void 0!==c.headers[r]?c.headers[r]+=\", \"+e[2]:c.headers[r]=e[2],c.rawHeaders.push(e[1],e[2])}})),c._charset=\"x-user-defined\",!o.overrideMimeType){var h=c.rawHeaders[\"mime-type\"];if(h){var d=h.match(/;\\s*charset=([^;])(;|$)/);d&&(c._charset=d[1].toLowerCase())}c._charset||(c._charset=\"utf-8\")}}};s(c,a.Readable),c.prototype._read=function(){var t=this._resumeFetch;t&&(this._resumeFetch=null,t())},c.prototype._onXHRProgress=function(){var t=this,e=t._xhr,r=null;switch(t._mode){case\"text:vbarray\":if(e.readyState!==u.DONE)break;try{r=new i.VBArray(e.responseBody).toArray()}catch(t){}if(null!==r){t.push(new n(r));break}case\"text\":try{r=e.responseText}catch(e){t._mode=\"text:vbarray\";break}if(r.length>t._pos){var o=r.substr(t._pos);if(\"x-user-defined\"===t._charset){for(var s=new n(o.length),a=0;at._pos&&(t.push(new n(new Uint8Array(c.result.slice(t._pos)))),t._pos=c.result.byteLength)},c.onload=function(){t.push(null)},c.readAsArrayBuffer(r)}t._xhr.readyState===u.DONE&&\"ms-stream\"!==t._mode&&t.push(null)}}).call(this,r(8),r(7).Buffer,r(3))},function(t,e,r){\"use strict\";var n=r(46),i=Object.prototype.hasOwnProperty,o=Array.isArray,s=function(){for(var t=[],e=0;e<256;++e)t.push(\"%\"+((e<16?\"0\":\"\")+e.toString(16)).toUpperCase());return t}(),a=function(t,e){for(var r=e&&e.plainObjects?Object.create(null):{},n=0;n1;){var e=t.pop(),r=e.obj[e.prop];if(o(r)){for(var n=[],i=0;i=48&&l<=57||l>=65&&l<=90||l>=97&&l<=122||o===n.RFC1738&&(40===l||41===l)?u+=a.charAt(c):l<128?u+=s[l]:l<2048?u+=s[192|l>>6]+s[128|63&l]:l<55296||l>=57344?u+=s[224|l>>12]+s[128|l>>6&63]+s[128|63&l]:(c+=1,l=65536+((1023&l)<<10|1023&a.charCodeAt(c)),u+=s[240|l>>18]+s[128|l>>12&63]+s[128|l>>6&63]+s[128|63&l])}return u},isBuffer:function(t){return!(!t||\"object\"!=typeof t)&&!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},isRegExp:function(t){return\"[object RegExp]\"===Object.prototype.toString.call(t)},maybeMap:function(t,e){if(o(t)){for(var r=[],n=0;ne++t.next());return e.every(({done:t})=>t)?{done:!0}:{done:!1,value:e.map(({value:t})=>t)}}))}}},function(t,e,r){\"use strict\";function n(t){\"+\"===t[0]&&(t=t.substring(1));const e=\"-\"===t[0]?\"-\":\"\";\"-\"===e&&(t=t.substring(1));const r=t.indexOf(\"e\");if(-1===r)return e+t;let n=t.indexOf(\".\");-1===n&&(n=r);const i=Number(t.substring(r+1)),o=t.substring(0,r).replace(\".\",\"\"),s=n+i,a=o.length;if(s>=a){const t=s-a;let r=o;for(let e=0;es;e--)t+=\"0\";return t+=o,e+t}return e+o.substring(0,s)+\".\"+o.substring(s)}t.exports=n,t.exports.default=n},function(t,e,r){\"use strict\";t.exports={MAX_SAFE_INTEGER:9007199254740991}},function(t,e,r){\"use strict\";const n=r(47);function i(t){return\"0\"===t?\"1\":n(\"1\",t)}t.exports=i,t.exports.default=i},function(t,e,r){\"use strict\";const n=r(4),i=r(0),o=r(9),s=r(22);function a(t){if(-1===(t=i(t)).indexOf(\".\"))return t;const e=s(t);return t=n(t).split(\".\")[0],\"+\"===e?o(t,\"1\"):\"-\"===e?\"0\"===t||\"\"===t?\"0\":\"-\"+t:void 0}t.exports=a,t.exports.default=a},function(t,e,r){\"use strict\";const n=r(51);function i(t){const e=n(t);return[t.replace(/\\./g,\"\").replace(/^0/,\"\"),1+\"0\".repeat(e)]}t.exports=i,t.exports.default=i},function(t,e,r){const n=r(0),i=r(16);function o(t){if(t=n(t),!i(t))throw new Error(\"can't call is_odd on decimal\");return[\"1\",\"3\",\"5\",\"7\",\"9\"].includes(t.charAt(t.length-1))}t.exports=o,t.exports.default=o},function(t,e,r){\"use strict\";const n=r(52),i=r(15),o=r(78),s=r(11),a=r(17),u=r(50);function c(t,{max_decimal_digits:e,infinity_times_zero:r=\"NaN\"}={}){const c=t.some(t=>i(t)),l=t.some(t=>s(t));if(c&&l)return r;if(c){return t.filter(t=>\"-\"===u(t)).length%2==0?\"Infinity\":\"-Infinity\"}if(l)return\"0\";const f=o(t.filter(t=>n(t)).length.toString());let h=a(t.map(t=>t.replace(/i$/,\"\")),{max_decimal_digits:e});return f&&(h+=\"i\"),h}t.exports=c,t.exports.default=c},function(t,e,r){\"use strict\";const n=r(0);function i(t){return\"-\"===(t=n(t))[0]}t.exports=i,t.exports.default=i},function(t,e,r){\"use strict\";const n=r(1),i=r(165),o=r(166);function s(t,{max_decimal_digits:e=100,fraction:r=!1}={}){if(i(t)){const[i,s]=o(t);return r?s+\"/\"+i:n(s,i,{max_decimal_digits:e})}return r?\"1/\"+t:n(\"1\",t,{max_decimal_digits:e})}t.exports=s,t.exports.default=s},function(t,e,r){\"use strict\";const n=r(0),i=r(16);function o(t){if(t=n(t),!i(t))throw new Error(\"can't call is_even on decimal\");return[\"0\",\"2\",\"4\",\"6\",\"8\"].includes(t.charAt(t.length-1))}t.exports=o,t.exports.default=o},function(t,e,r){\"use strict\";const n=r(76),i=r(84),o=r(1);function s(t,e){const r=i(t);return\"0\"===r?\"0\":n(o(r,e,{max_decimal_digits:1}))}t.exports=s,t.exports.default=s},function(t,e,r){\"use strict\";const n=r(4),i=r(0);function o(t){const e=(t=n(i(t))).indexOf(\".\");return(-1===e?t.length:e).toString()}t.exports=o,t.exports.default=o},function(t,e,r){\"use strict\";const n=r(1),i=r(82),o=r(86),s=r(87);function a(t,e){const r=s(\"2\",o([\"1000\",e,e]));for(;t.endsWith(\"0\")&&e.endsWith(\"0\");)t=t.substring(0,t.length-1),e=e.substring(0,e.length-1);for(;i(t)&&i(e);)t=n(t,\"2\"),e=n(e,\"2\");let a=!0;for(;a;){a=!1;for(let i=0;i\"<\"!==n(r,t)&&\">\"!==n(r,e));let a=\"13\";for(;\">\"!==n(a,e);)/^\\d+5/.test(a)||/^(\\d)\\1+/.test(a)||[\"9\",\"7\",\"3\"].every(t=>!o(i(a,t)))&&r.push(a),a=s(a,\"2\");return r}t.exports=a,t.exports.default=a},function(t,e,r){\"use strict\";const n=r(6),i=r(1);function o({max_decimal_digits:t=100,steps:e=100}={}){let r=\"1\",o=\"1\";for(let s=1;s\":return\"-\"+s(t,e)}else if(r&&!a)switch(e=e.substring(1),n(t,e)){case\"=\":return\"0\";case\"<\":return\"-\"+s(e,t);case\">\":return s(t,e)}}t.exports=a,t.exports.default=a},function(t,e,r){const{MAX_SAFE_INTEGER_LENGTH:n}=r(56);t.exports=function(t,e){const r=t.length,i=e.length,o=t.indexOf(\".\"),s=e.indexOf(\".\"),a=-1===o?r:o,u=-1===s?i:s;if(-1===o&&-1===s&&r0){for(;m>p-f;){const r=t[m-h]||\"0\",n=e[m-d]||\"0\";let i=Number(r)+Number(n)+g;i>=10?(i-=10,g=1):g=0,\"\"===y&&0===i||(y=i+y),m--}y&&(y=\".\"+y),m--}if(l>0)for(;m>=0;){const r=t[m-h]||\"0\",n=e[m-d]||\"0\";let i=Number(r)+Number(n)+g;i>=10?(i-=10,g=1):g=0,y=i+y,m--}return 1===g&&(y=g+y),\".\"===y[0]&&(y=\"0\"+y),y}},function(t,e,r){const{MAX_SAFE_INTEGER_LENGTH:n}=r(56);t.exports=function(t,e){const r=t.length,i=e.length,o=t.indexOf(\".\"),s=e.indexOf(\".\"),a=-1===o?r:o,u=-1===s?i:s;if(-1===o&&-1===s&&r0){for(;m>p-f;){let r=t[m-h]||\"0\",n=e[m-d]||\"0\";r-=g,g=0;let i=r-n;if(i<0)for(;i<0;)g++,i+=10;else g&&g--;\"\"===y&&0===i||(y=i+y),m--}\"\"!==y&&(y=\".\"+y),m--}if(l>0){for(;m>0;){let r=t[m-h]||\"0\",n=e[m-d]||\"0\";r-=g,g=0;let i=r-n;if(i<0)for(;i<0;)g++,i+=10;else g&&g--;y=i+y,m--}const r=t[0-h]||\"0\",n=e[0-d]||\"0\";let i=Number(r)-(g>0?1:0)-Number(n);0!==i&&(y=i+y),y=y.replace(/^0+/,\"\")}return\".\"===y[0]&&(y=\"0\"+y),y}},function(t,e,r){const n=r(18);function i(t){return\"-\"===(t=n(t))[0]?t.substring(1):t}t.exports=i,t.exports.default=i},function(t,e,r){\"use strict\";t.exports={countIn1D:function(t){return t.reduce((function(t,e){return void 0===t[e]?t[e]=1:t[e]++,t}),{})},countIn2D:function(t){return t.reduce((function(t,e){return e.forEach((function(e){void 0===t[e]?t[e]=1:t[e]++})),t}),{})},unflatten:function(t,e){for(var r=e.height,n=e.width,i=[],o=0;o>24)/500+a,c=a-(t[e+2]<<24>>24)/200;u=.95047*(u*u*u>.008856?u*u*u:(u-16/116)/7.787),a=1*(a*a*a>.008856?a*a*a:(a-16/116)/7.787),c=1.08883*(c*c*c>.008856?c*c*c:(c-16/116)/7.787),i=3.2406*u+-1.5372*a+-.4986*c,o=-.9689*u+1.8758*a+.0415*c,s=.0557*u+-.204*a+1.057*c,i=i>.0031308?1.055*i**(1/2.4)-.055:12.92*i,o=o>.0031308?1.055*o**(1/2.4)-.055:12.92*o,s=s>.0031308?1.055*s**(1/2.4)-.055:12.92*s,n[r]=255*Math.max(0,Math.min(1,i)),n[r+1]=255*Math.max(0,Math.min(1,o)),n[r+2]=255*Math.max(0,Math.min(1,s))}return n}function S(t,e){let r=t.length-e,n=0;do{for(let r=e;r>0;r--)t[n+e]+=t[n],n++;r-=e}while(r>0)}function A(t,e,r){let n=0,i=t.length;const o=i/r;for(;i>e;){for(let r=e;r>0;--r)t[n+e]+=t[n],++n;i-=e}const s=t.slice();for(let e=0;e=t.byteLength);++o){let n;if(2===e){switch(i[0]){case 8:n=new Uint8Array(t,o*a*r*s,a*r*s);break;case 16:n=new Uint16Array(t,o*a*r*s,a*r*s/2);break;case 32:n=new Uint32Array(t,o*a*r*s,a*r*s/4);break;default:throw new Error(`Predictor 2 not allowed with ${i[0]} bits per sample.`)}S(n,a)}else 3===e&&(n=new Uint8Array(t,o*a*r*s,a*r*s),A(n,a,s))}return t}(r,n,e?t.TileWidth:t.ImageWidth,e?t.TileLength:t.RowsPerStrip||t.ImageLength,t.BitsPerSample,t.PlanarConfiguration)}return r}}class k extends E{decodeBlock(t){return t}}function T(t,e){for(let r=e.length-1;r>=0;r--)t.push(e[r]);return t}function O(t){const e=new Uint16Array(4093),r=new Uint8Array(4093);for(let t=0;t<=257;t++)e[t]=4096,r[t]=t;let n=258,i=9,o=0;function s(){n=258,i=9}function a(t){const e=function(t,e,r){const n=e%8,i=Math.floor(e/8),o=8-n,s=e+r-8*(i+1);let a=8*(i+2)-(e+r);const u=8*(i+2)-e;if(a=Math.max(0,a),i>=t.length)return console.warn(\"ran off the end of the buffer before finding EOI_CODE (end on input code)\"),257;let c=t[i]&2**(8-n)-1;c<<=r-o;let l=c;if(i+1>>a;e<<=Math.max(0,r-u),l+=e}if(s>8&&i+2>>n}return l}(t,o,i);return o+=i,e}function u(t,i){return r[n]=i,e[n]=t,n++,n-1}function c(t){const n=[];for(let i=t;4096!==i;i=e[i])n.push(r[i]);return n}const l=[];s();const f=new Uint8Array(t);let h,d=a(f);for(;257!==d;){if(256===d){for(s(),d=a(f);256===d;)d=a(f);if(257===d)break;if(d>256)throw new Error(\"corrupted code at scanline \"+d);T(l,c(d)),h=d}else if(d=2**i&&(12===i?h=void 0:i++),d=a(f)}return new Uint8Array(l)}class C extends E{decodeBlock(t){return O(t).buffer}}const P=new Int32Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]);function I(t,e){let r=0;const n=[];let i=16;for(;i>0&&!t[i-1];)--i;n.push({children:[],index:0});let o,s=n[0];for(let a=0;a0;)s=n.pop();for(s.index++,n.push(s);n.length<=a;)n.push(o={children:[],index:0}),s.children[s.index]=o.children,s=o;r++}a+10)return p--,d>>p&1;if(d=t[h++],255===d){const e=t[h++];if(e)throw new Error(\"unexpected marker: \"+(d<<8|e).toString(16))}return p=7,d>>>7}function g(t){let e,r=t;for(;null!==(e=y());){if(r=r[e],\"number\"==typeof r)return r;if(\"object\"!=typeof r)throw new Error(\"invalid huffman sequence\")}return null}function m(t){let e=t,r=0;for(;e>0;){const t=y();if(null===t)return;r=r<<1|t,--e}return r}function b(t){const e=m(t);return e>=1<0)return void v--;let r=o;const n=s;for(;r<=n;){const n=g(t.huffmanTableAC),i=15&n,o=n>>4;if(0===i){if(o<15){v=m(o)+(1<>4,0===r)i<15?(v=m(i)+(1<>4;if(0===n){if(o<15)break;i+=16}else{i+=o;e[P[i]]=b(n),i++}}};let R,j,M=0;j=1===A?n[0].blocksPerLine*n[0].blocksPerColumn:c*r.mcusPerColumn;const L=i||j;for(;M=65488&&R<=65495))break;h+=2}return h-f}function j(t,e){const r=[],{blocksPerLine:n,blocksPerColumn:i}=e,o=n<<3,s=new Int32Array(64),a=new Uint8Array(64);function u(t,r,n){const i=e.quantizationTable;let o,s,a,u,c,l,f,h,d;const p=n;let y;for(y=0;y<64;y++)p[y]=t[y]*i[y];for(y=0;y<8;++y){const t=8*y;0!==p[1+t]||0!==p[2+t]||0!==p[3+t]||0!==p[4+t]||0!==p[5+t]||0!==p[6+t]||0!==p[7+t]?(o=5793*p[0+t]+128>>8,s=5793*p[4+t]+128>>8,a=p[2+t],u=p[6+t],c=2896*(p[1+t]-p[7+t])+128>>8,h=2896*(p[1+t]+p[7+t])+128>>8,l=p[3+t]<<4,f=p[5+t]<<4,d=o-s+1>>1,o=o+s+1>>1,s=d,d=3784*a+1567*u+128>>8,a=1567*a-3784*u+128>>8,u=d,d=c-f+1>>1,c=c+f+1>>1,f=d,d=h+l+1>>1,l=h-l+1>>1,h=d,d=o-u+1>>1,o=o+u+1>>1,u=d,d=s-a+1>>1,s=s+a+1>>1,a=d,d=2276*c+3406*h+2048>>12,c=3406*c-2276*h+2048>>12,h=d,d=799*l+4017*f+2048>>12,l=4017*l-799*f+2048>>12,f=d,p[0+t]=o+h,p[7+t]=o-h,p[1+t]=s+f,p[6+t]=s-f,p[2+t]=a+l,p[5+t]=a-l,p[3+t]=u+c,p[4+t]=u-c):(d=5793*p[0+t]+512>>10,p[0+t]=d,p[1+t]=d,p[2+t]=d,p[3+t]=d,p[4+t]=d,p[5+t]=d,p[6+t]=d,p[7+t]=d)}for(y=0;y<8;++y){const t=y;0!==p[8+t]||0!==p[16+t]||0!==p[24+t]||0!==p[32+t]||0!==p[40+t]||0!==p[48+t]||0!==p[56+t]?(o=5793*p[0+t]+2048>>12,s=5793*p[32+t]+2048>>12,a=p[16+t],u=p[48+t],c=2896*(p[8+t]-p[56+t])+2048>>12,h=2896*(p[8+t]+p[56+t])+2048>>12,l=p[24+t],f=p[40+t],d=o-s+1>>1,o=o+s+1>>1,s=d,d=3784*a+1567*u+2048>>12,a=1567*a-3784*u+2048>>12,u=d,d=c-f+1>>1,c=c+f+1>>1,f=d,d=h+l+1>>1,l=h-l+1>>1,h=d,d=o-u+1>>1,o=o+u+1>>1,u=d,d=s-a+1>>1,s=s+a+1>>1,a=d,d=2276*c+3406*h+2048>>12,c=3406*c-2276*h+2048>>12,h=d,d=799*l+4017*f+2048>>12,l=4017*l-799*f+2048>>12,f=d,p[0+t]=o+h,p[56+t]=o-h,p[8+t]=s+f,p[48+t]=s-f,p[16+t]=a+l,p[40+t]=a-l,p[24+t]=u+c,p[32+t]=u-c):(d=5793*n[y+0]+8192>>14,p[0+t]=d,p[8+t]=d,p[16+t]=d,p[24+t]=d,p[32+t]=d,p[40+t]=d,p[48+t]=d,p[56+t]=d)}for(y=0;y<64;++y){const t=128+(p[y]+8>>4);r[y]=t<0?0:t>255?255:t}}for(let t=0;t>4==0)for(let r=0;r<64;r++){i[P[r]]=t[e++]}else{if(n>>4!=1)throw new Error(\"DQT: invalid table spec\");for(let t=0;t<64;t++){i[P[t]]=r()}}this.quantizationTables[15&n]=i}break}case 65472:case 65473:case 65474:{r();const n={extended:65473===o,progressive:65474===o,precision:t[e++],scanLines:r(),samplesPerLine:r(),components:{},componentsOrder:[]},s=t[e++];let a;for(let r=0;r>4,i=15&t[e+1],o=t[e+2];n.componentsOrder.push(a),n.components[a]={h:r,v:i,quantizationIdx:o},e+=3}i(n),this.frames.push(n);break}case 65476:{const n=r();for(let r=2;r>4==0?this.huffmanTablesDC[15&n]=I(i,s):this.huffmanTablesAC[15&n]=I(i,s)}break}case 65501:r(),this.resetInterval=r();break;case 65498:{r();const n=t[e++],i=[],o=this.frames[0];for(let r=0;r>4],r.huffmanTableAC=this.huffmanTablesAC[15&n],i.push(r)}const s=t[e++],a=t[e++],u=t[e++],c=R(t,e,o,i,this.resetInterval,s,a,u>>4,15&u);e+=c;break}case 65535:255!==t[e]&&e--;break;default:if(255===t[e-3]&&t[e-2]>=192&&t[e-2]<=254){e-=3;break}throw new Error(\"unknown JPEG marker \"+o.toString(16))}o=r()}}getResult(){const{frames:t}=this;if(0===this.frames.length)throw new Error(\"no frames were decoded\");this.frames.length>1&&console.warn(\"more than one frame is not supported\");for(let t=0;t{const a=B(t,n,i);for(let u=0;u{const a=B(t,n,i);for(let u=0;u=this.fileDirectory.BitsPerSample.length)throw new RangeError(`Sample index ${t} is out of range.`);const e=this.fileDirectory.BitsPerSample[t];if(e%8!=0)throw new Error(`Sample bit-width of ${e} is not supported.`);return e/8}getReaderForSample(t){const e=this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[t]:1,r=this.fileDirectory.BitsPerSample[t];switch(e){case 1:switch(r){case 8:return DataView.prototype.getUint8;case 16:return DataView.prototype.getUint16;case 32:return DataView.prototype.getUint32}break;case 2:switch(r){case 8:return DataView.prototype.getInt8;case 16:return DataView.prototype.getInt16;case 32:return DataView.prototype.getInt32}break;case 3:switch(r){case 32:return DataView.prototype.getFloat32;case 64:return DataView.prototype.getFloat64}}throw Error(\"Unsupported data format/bitsPerSample\")}getArrayForSample(t,e){return W(this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[t]:1,this.fileDirectory.BitsPerSample[t],e)}async getTileOrStrip(t,e,r,n){const i=Math.ceil(this.getWidth()/this.getTileWidth()),o=Math.ceil(this.getHeight()/this.getTileHeight());let s;const{tiles:a}=this;let u,c;1===this.planarConfiguration?s=e*i+t:2===this.planarConfiguration&&(s=r*i*o+e*i+t),this.isTiled?(u=this.fileDirectory.TileOffsets[s],c=this.fileDirectory.TileByteCounts[s]):(u=this.fileDirectory.StripOffsets[s],c=this.fileDirectory.StripByteCounts[s]);const l=await this.source.fetch(u,c);let f;return null===a?f=n.decode(this.fileDirectory,l):a[s]||(f=n.decode(this.fileDirectory,l),a[s]=f),{x:t,y:e,sample:r,data:await f}}async _readRaster(t,e,r,n,i,o,s,a){const u=this.getTileWidth(),c=this.getTileHeight(),l=Math.max(Math.floor(t[0]/u),0),f=Math.min(Math.ceil(t[2]/u),Math.ceil(this.getWidth()/this.getTileWidth())),h=Math.max(Math.floor(t[1]/c),0),d=Math.min(Math.ceil(t[3]/c),Math.ceil(this.getHeight()/this.getTileHeight())),p=t[2]-t[0];let y=this.getBytesPerPixel();const g=[],m=[];for(let t=0;t{const o=i.data,s=new DataView(o),a=i.y*c,f=i.x*u,h=(i.y+1)*c,d=(i.x+1)*u,b=m[l],w=Math.min(c,c-(h-t[3])),x=Math.min(u,u-(d-t[2]));for(let i=Math.max(0,t[1]-a);iu[2]||u[1]>u[3])throw new Error(\"Invalid subsets\");const c=(u[2]-u[0])*(u[3]-u[1]);if(e&&e.length){for(let t=0;t=this.fileDirectory.SamplesPerPixel)return Promise.reject(new RangeError(`Invalid sample index '${e[t]}'.`))}else for(let t=0;ts[2]||s[1]>s[3])throw new Error(\"Invalid subsets\");const a=this.fileDirectory.PhotometricInterpretation;if(a===d.RGB){let i=[0,1,2];if(this.fileDirectory.ExtraSamples!==p.Unspecified&&o){i=[];for(let t=0;t\"Item\"===t.tagName);t&&(o=o.filter(e=>Number(e.attributes.sample)===t));for(let t=0;t0;let i=!0;for(let o=0;o<8;o++){let s=this._dataView.getUint8(t+(e?o:7-o));n&&(i?0!==s&&(s=255&~(s-1),i=!1):s=255&~s),r+=s*256**o}return n&&(r=-r),r}getUint8(t,e){return this._dataView.getUint8(t,e)}getInt8(t,e){return this._dataView.getInt8(t,e)}getUint16(t,e){return this._dataView.getUint16(t,e)}getInt16(t,e){return this._dataView.getInt16(t,e)}getUint32(t,e){return this._dataView.getUint32(t,e)}getInt32(t,e){return this._dataView.getInt32(t,e)}getFloat32(t,e){return this._dataView.getFloat32(t,e)}getFloat64(t,e){return this._dataView.getFloat64(t,e)}}class K{constructor(t,e,r,n){this._dataView=new DataView(t),this._sliceOffset=e,this._littleEndian=r,this._bigTiff=n}get sliceOffset(){return this._sliceOffset}get sliceTop(){return this._sliceOffset+this.buffer.byteLength}get littleEndian(){return this._littleEndian}get bigTiff(){return this._bigTiff}get buffer(){return this._dataView.buffer}covers(t,e){return this.sliceOffset<=t&&this.sliceTop>=t+e}readUint8(t){return this._dataView.getUint8(t-this._sliceOffset,this._littleEndian)}readInt8(t){return this._dataView.getInt8(t-this._sliceOffset,this._littleEndian)}readUint16(t){return this._dataView.getUint16(t-this._sliceOffset,this._littleEndian)}readInt16(t){return this._dataView.getInt16(t-this._sliceOffset,this._littleEndian)}readUint32(t){return this._dataView.getUint32(t-this._sliceOffset,this._littleEndian)}readInt32(t){return this._dataView.getInt32(t-this._sliceOffset,this._littleEndian)}readFloat32(t){return this._dataView.getFloat32(t-this._sliceOffset,this._littleEndian)}readFloat64(t){return this._dataView.getFloat64(t-this._sliceOffset,this._littleEndian)}readUint64(t){const e=this.readUint32(t),r=this.readUint32(t+4);let n;if(this._littleEndian){if(n=e+2**32*r,!Number.isSafeInteger(n))throw new Error(n+\" exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues\");return n}if(n=2**32*e+r,!Number.isSafeInteger(n))throw new Error(n+\" exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues\");return n}readInt64(t){let e=0;const r=(128&this._dataView.getUint8(t+(this._littleEndian?7:0)))>0;let n=!0;for(let i=0;i<8;i++){let o=this._dataView.getUint8(t+(this._littleEndian?i:7-i));r&&(n?0!==o&&(o=255&~(o-1),n=!1):o=255&~o),e+=o*256**i}return r&&(e=-e),e}readOffset(t){return this._bigTiff?this.readUint64(t):this.readUint32(t)}}var Y=r(68),Z=r(7),X=r(25),Q=r(40),J=r.n(Q),tt=r(106),et=r.n(tt),rt=r(39),nt=r.n(rt);class it{constructor(t,{blockSize:e=65536}={}){this.retrievalFunction=t,this.blockSize=e,this.blockRequests=new Map,this.blocks=new Map,this.blockIdsAwaitingRequest=null}async fetch(t,e,r=!1){const n=t+e,i=[],o=[],s=[];for(let e=Math.floor(t/this.blockSize)*this.blockSize;esetTimeout(e,t))}(),this.blockIdsAwaitingRequest){const t=function(t){if(0===t.length)return[];const e=[];let r=[];e.push(r);for(let n=0;n{const e=await t,i=r*this.blockSize,o=Math.min(i+this.blockSize,e.data.byteLength),s=e.data.slice(i,o);this.blockRequests.delete(n),this.blocks.set(n,{data:s,offset:e.offset+i,length:s.byteLength,top:e.offset+o})})())}}this.blockIdsAwaitingRequest=null}const a=[];for(const t of o)this.blockRequests.has(t)&&a.push(this.blockRequests.get(t));await Promise.all(a),await Promise.all(s);return function(t,e,r){const n=e+r,i=new ArrayBuffer(r),o=new Uint8Array(i);for(const r of t){const t=r.offset-e,i=r.top-n;let s,a=0,u=0;t<0?a=-t:t>0&&(u=t),s=i<0?r.length-a:n-r.offset-a;const c=new Uint8Array(r.data,a,s);o.set(c,u)}return i}(i.map(t=>this.blocks.get(t)),t,e)}async requestData(t,e){const r=await this.retrievalFunction(t,e);return r.length?r.length!==r.data.byteLength&&(r.data=r.data.slice(0,r.length)):r.length=r.data.byteLength,r.top=r.offset+r.length,r}}function ot(t,e){const{forceXHR:r}=e;if(\"function\"==typeof fetch&&!r)return function(t,{headers:e={},blockSize:r}={}){return new it(async(r,n)=>{const i=await fetch(t,{headers:{...e,Range:`bytes=${r}-${r+n-1}`}});if(i.ok){if(206===i.status){return{data:i.arrayBuffer?await i.arrayBuffer():(await i.buffer()).buffer,offset:r,length:n}}{const t=i.arrayBuffer?await i.arrayBuffer():(await i.buffer()).buffer;return{data:t,offset:0,length:t.byteLength}}}throw new Error(\"Error fetching data.\")},{blockSize:r})}(t,e);if(\"undefined\"!=typeof XMLHttpRequest)return function(t,{headers:e={},blockSize:r}={}){return new it(async(r,n)=>new Promise((i,o)=>{const s=new XMLHttpRequest;s.open(\"GET\",t),s.responseType=\"arraybuffer\";const a={...e,Range:`bytes=${r}-${r+n-1}`};for(const[t,e]of Object.entries(a))s.setRequestHeader(t,e);s.onload=()=>{const t=s.response;206===s.status?i({data:t,offset:r,length:n}):i({data:t,offset:0,length:t.byteLength})},s.onerror=o,s.send()}),{blockSize:r})}(t,e);if(J.a.get)return function(t,{headers:e={},blockSize:r}={}){return new it(async(r,n)=>new Promise((i,o)=>{const s=nt.a.parse(t);(\"http:\"===s.protocol?J.a:et.a).get({...s,headers:{...e,Range:`bytes=${r}-${r+n-1}`}},t=>{const e=[];t.on(\"data\",t=>{e.push(t)}),t.on(\"end\",()=>{const t=Z.Buffer.concat(e).buffer;i({data:t,offset:r,length:t.byteLength})})}).on(\"error\",o)}),{blockSize:r})}(t,e);throw new Error(\"No remote source available\")}function st(t){const e=function(t,e,r){return new Promise((n,i)=>{Object(X.open)(t,e,r,(t,e)=>{t?i(t):n(e)})})}(t,\"r\");return{async fetch(t,r){const n=await e,{buffer:i}=await function(...t){return new Promise((e,r)=>{Object(X.read)(...t,(t,n,i)=>{t?r(t):e({bytesRead:n,buffer:i})})})}(n,Z.Buffer.alloc(r),0,r,t);return i.buffer},async close(){const t=await e;return await function(t){return new Promise((e,r)=>{Object(X.close)(t,t=>{t?r(t):e()})})}(t)}}}function at(t,e){for(const r in e)e.hasOwnProperty(r)&&(t[r]=e[r])}function ut(t,e){if(t.length{let r=e;for(;0!==t[r];)r++;return r},readUshort:(t,e)=>t[e]<<8|t[e+1],readShort:(t,e)=>{const r=yt.ui8;return r[0]=t[e+1],r[1]=t[e+0],yt.i16[0]},readInt:(t,e)=>{const r=yt.ui8;return r[0]=t[e+3],r[1]=t[e+2],r[2]=t[e+1],r[3]=t[e+0],yt.i32[0]},readUint:(t,e)=>{const r=yt.ui8;return r[0]=t[e+3],r[1]=t[e+2],r[2]=t[e+1],r[3]=t[e+0],yt.ui32[0]},readASCII:(t,e,r)=>r.map(r=>String.fromCharCode(t[e+r])).join(\"\"),readFloat:(t,e)=>{const r=yt.ui8;return lt(4,n=>{r[n]=t[e+3-n]}),yt.fl32[0]},readDouble:(t,e)=>{const r=yt.ui8;return lt(8,n=>{r[n]=t[e+7-n]}),yt.fl64[0]},writeUshort:(t,e,r)=>{t[e]=r>>8&255,t[e+1]=255&r},writeUint:(t,e,r)=>{t[e]=r>>24&255,t[e+1]=r>>16&255,t[e+2]=r>>8&255,t[e+3]=r>>0&255},writeASCII:(t,e,r)=>{lt(r.length,n=>{t[e+n]=r.charCodeAt(n)})},ui8:new Uint8Array(8)};yt.fl64=new Float64Array(yt.ui8.buffer),yt.writeDouble=(t,e,r)=>{yt.fl64[0]=r,lt(8,r=>{t[e+r]=yt.ui8[7-r]})};const gt=t=>{const e=new Uint8Array(1e3);let r=4;const n=yt;e[0]=77,e[1]=77,e[3]=42;let i=8;if(n.writeUint(e,r,i),r+=4,t.forEach((r,o)=>{const s=((t,e,r,n)=>{let i=r;const o=Object.keys(n).filter(t=>null!=t&&\"undefined\"!==t);t.writeUshort(e,i,o.length),i+=2;let s=i+12*o.length+4;for(const r of o){let o=null;\"number\"==typeof r?o=r:\"string\"==typeof r&&(o=parseInt(r,10));const a=c[o],u=pt[a];if(null==a||void 0===a||void 0===a)throw new Error(\"unknown type of tag: \"+o);let l=n[r];if(void 0===l)throw new Error(\"failed to get value for key \"+r);\"ASCII\"===a&&\"string\"==typeof l&&!1===ut(l,\"\\0\")&&(l+=\"\\0\");const f=l.length;t.writeUshort(e,i,o),i+=2,t.writeUshort(e,i,u),i+=2,t.writeUint(e,i,f),i+=4;let h=[-1,1,1,2,4,8,0,0,0,0,0,0,8][u]*f,d=i;h>4&&(t.writeUint(e,i,s),d=s),\"ASCII\"===a?t.writeASCII(e,d,l):\"SHORT\"===a?lt(f,r=>{t.writeUshort(e,d+2*r,l[r])}):\"LONG\"===a?lt(f,r=>{t.writeUint(e,d+4*r,l[r])}):\"RATIONAL\"===a?lt(f,r=>{t.writeUint(e,d+8*r,Math.round(1e4*l[r])),t.writeUint(e,d+8*r+4,1e4)}):\"DOUBLE\"===a&<(f,r=>{t.writeDouble(e,d+8*r,l[r])}),h>4&&(h+=1&h,s+=h),i+=4}return[i,s]})(n,e,i,r);i=s[1],o{lt(i,r=>{lt(n,n=>{o.push(t[n][e][r])})})})),e.ImageLength=r,delete e.height,e.ImageWidth=i,delete e.width,e.BitsPerSample||(e.BitsPerSample=lt(n,()=>8)),mt.forEach(t=>{const r=t[0];if(!e[r]){const n=t[1];e[r]=n}}),e.PhotometricInterpretation||(e.PhotometricInterpretation=3===e.BitsPerSample.length?2:1),e.SamplesPerPixel||(e.SamplesPerPixel=[n]),e.StripByteCounts||(e.StripByteCounts=[n*r*i]),e.ModelPixelScale||(e.ModelPixelScale=[360/i,180/r,0]),e.SampleFormat||(e.SampleFormat=lt(n,()=>1));const s=Object.keys(e).filter(t=>ut(t,\"GeoKey\")).sort((t,e)=>dt[t]-dt[e]);if(!e.GeoKeyDirectory){const t=[1,1,0,s.length];s.forEach(r=>{const n=Number(dt[r]);let i,o,s;t.push(n),\"SHORT\"===c[n]?(i=1,o=0,s=e[r]):\"GeogCitationGeoKey\"===r?(i=e.GeoAsciiParams.length,o=Number(dt.GeoAsciiParams),s=0):console.log(\"[geotiff.js] couldn't get TIFFTagLocation for \"+r),t.push(o),t.push(i),t.push(s)}),e.GeoKeyDirectory=t}for(const t in s)s.hasOwnProperty(t)&&delete e[t];[\"Compression\",\"ExtraSamples\",\"GeographicTypeGeoKey\",\"GTModelTypeGeoKey\",\"GTRasterTypeGeoKey\",\"ImageLength\",\"ImageWidth\",\"PhotometricInterpretation\",\"PlanarConfiguration\",\"ResolutionUnit\",\"SamplesPerPixel\",\"XPosition\",\"YPosition\"].forEach(t=>{var r;e[t]&&(e[t]=(r=e[t],Array.isArray(r)?r:[r]))});const a=(t=>{const e={};for(const r in t)\"StripOffsets\"!==r&&(dt[r]||console.error(r,\"not in name2code:\",Object.keys(dt)),e[dt[r]]=t[r]);return e})(e);return((t,e,r,n)=>{if(null==r)throw new Error(\"you passed into encodeImage a width of type \"+r);if(null==e)throw new Error(\"you passed into encodeImage a width of type \"+e);const i={256:[e],257:[r],273:[1e3],278:[r],305:\"geotiff.js\"};if(n)for(const t in n)n.hasOwnProperty(t)&&(i[t]=n[t]);const o=new Uint8Array(gt([i])),s=new Uint8Array(t),a=i[277],u=new Uint8Array(1e3+e*r*a);return lt(o.length,t=>{u[t]=o[t]}),function(t,e){const{length:r}=t;for(let n=0;n{u[1e3+e]=t}),u.buffer})(o,i,r,a)}class vt{log(){}info(){}warn(){}error(){}time(){}timeEnd(){}}let wt=new vt;function xt(t=new vt){wt=t}function _t(t){switch(t){case h.BYTE:case h.ASCII:case h.SBYTE:case h.UNDEFINED:return 1;case h.SHORT:case h.SSHORT:return 2;case h.LONG:case h.SLONG:case h.FLOAT:case h.IFD:return 4;case h.RATIONAL:case h.SRATIONAL:case h.DOUBLE:case h.LONG8:case h.SLONG8:case h.IFD8:return 8;default:throw new RangeError(\"Invalid field type: \"+t)}}function St(t,e,r,n){let i=null,o=null;const s=_t(e);switch(e){case h.BYTE:case h.ASCII:case h.UNDEFINED:i=new Uint8Array(r),o=t.readUint8;break;case h.SBYTE:i=new Int8Array(r),o=t.readInt8;break;case h.SHORT:i=new Uint16Array(r),o=t.readUint16;break;case h.SSHORT:i=new Int16Array(r),o=t.readInt16;break;case h.LONG:case h.IFD:i=new Uint32Array(r),o=t.readUint32;break;case h.SLONG:i=new Int32Array(r),o=t.readInt32;break;case h.LONG8:case h.IFD8:i=new Array(r),o=t.readUint64;break;case h.SLONG8:i=new Array(r),o=t.readInt64;break;case h.RATIONAL:i=new Uint32Array(2*r),o=t.readUint32;break;case h.SRATIONAL:i=new Int32Array(2*r),o=t.readInt32;break;case h.FLOAT:i=new Float32Array(r),o=t.readFloat32;break;case h.DOUBLE:i=new Float64Array(r),o=t.readFloat64;break;default:throw new RangeError(\"Invalid field type: \"+e)}if(e!==h.RATIONAL&&e!==h.SRATIONAL)for(let e=0;et.getWidth()-e.getWidth());for(let e=0;en||o&&o>s)break}}let f=e;if(s){const[t,e]=a.getOrigin(),[r,n]=u.getResolution(a);f=[Math.round((s[0]-t)/r),Math.round((s[1]-e)/n),Math.round((s[2]-t)/r),Math.round((s[3]-e)/n)],f=[Math.min(f[0],f[2]),Math.min(f[1],f[3]),Math.max(f[0],f[2]),Math.max(f[1],f[3])]}return u.readRasters({...t,window:f})}}class Tt extends kt{constructor(t,e,r,n,i={}){super(),this.source=t,this.littleEndian=e,this.bigTiff=r,this.firstIFDOffset=n,this.cache=i.cache||!1,this.ifdRequests=[],this.ghostValues=null}async getSlice(t,e){const r=this.bigTiff?4048:1024;return new K(await this.source.fetch(t,void 0!==e?e:r),t,this.littleEndian,this.bigTiff)}async parseFileDirectoryAt(t){const e=this.bigTiff?20:12,r=this.bigTiff?8:2;let n=await this.getSlice(t);const i=this.bigTiff?n.readUint64(t):n.readUint16(t),o=i*e+(this.bigTiff?16:6);n.covers(t,o)||(n=await this.getSlice(t,o));const s={};let u=t+(this.bigTiff?8:2);for(let t=0;t{const e=await this.ifdRequests[t-1];if(0===e.nextIFDByteOffset)throw new Et(t);return this.parseFileDirectoryAt(e.nextIFDByteOffset)})(),this.ifdRequests[t]}async getImage(t=0){const e=await this.requestIFD(t);return new V(e.fileDirectory,e.geoKeyDirectory,this.dataView,this.littleEndian,this.cache,this.source)}async getImageCount(){let t=0,e=!0;for(;e;)try{await this.requestIFD(t),++t}catch(t){if(!(t instanceof Et))throw t;e=!1}return t}async getGhostValues(){const t=this.bigTiff?16:8;if(this.ghostValues)return this.ghostValues;const e=\"GDAL_STRUCTURAL_METADATA_SIZE=\",r=e.length+100;let n=await this.getSlice(t,r);if(e===St(n,h.ASCII,e.length,t)){const e=St(n,h.ASCII,r,t).split(\"\\n\")[0],i=Number(e.split(\"=\")[1].split(\" \")[0])+e.length;i>r&&(n=await this.getSlice(t,i));const o=St(n,h.ASCII,i,t);this.ghostValues={},o.split(\"\\n\").filter(t=>t.length>0).map(t=>t.split(\"=\")).forEach(([t,e])=>{this.ghostValues[t]=e})}return this.ghostValues}static async fromSource(t,e){const r=await t.fetch(0,1024),n=new $(r),i=n.getUint16(0,0);let o;if(18761===i)o=!0;else{if(19789!==i)throw new TypeError(\"Invalid byte order value.\");o=!1}const s=n.getUint16(2,o);let a;if(42===s)a=!1;else{if(43!==s)throw new TypeError(\"Invalid magic number.\");a=!0;if(8!==n.getUint16(4,o))throw new Error(\"Unsupported offset byte-size.\")}const u=a?n.getUint64(8,o):n.getUint32(4,o);return new Tt(t,o,a,u,e)}close(){return\"function\"==typeof this.source.close&&this.source.close()}}e.default=Tt;class Ot extends kt{constructor(t,e){super(),this.mainFile=t,this.overviewFiles=e,this.imageFiles=[t].concat(e),this.fileDirectoriesPerFile=null,this.fileDirectoriesPerFileParsing=null,this.imageCount=null}async parseFileDirectoriesPerFile(){const t=[this.mainFile.parseFileDirectoryAt(this.mainFile.firstIFDOffset)].concat(this.overviewFiles.map(t=>t.parseFileDirectoryAt(t.firstIFDOffset)));return this.fileDirectoriesPerFile=await Promise.all(t),this.fileDirectoriesPerFile}async getImage(t=0){await this.getImageCount(),await this.parseFileDirectoriesPerFile();let e=0,r=0;for(let n=0;nt.getImageCount()));return this.imageCounts=await Promise.all(t),this.imageCount=this.imageCounts.reduce((t,e)=>t+e,0),this.imageCount}}async function Ct(t,e={}){return Tt.fromSource(ot(t,e))}async function Pt(t){return Tt.fromSource(function(t){return{fetch:async(e,r)=>t.slice(e,e+r)}}(t))}async function It(t){return Tt.fromSource(st(t))}async function Rt(t){return Tt.fromSource((e=t,{fetch:async(t,r)=>new Promise((n,i)=>{const o=e.slice(t,t+r),s=new FileReader;s.onload=t=>n(t.target.result),s.onerror=i,s.readAsArrayBuffer(o)})}));var e}async function jt(t,e=[],r={}){const n=await Tt.fromSource(ot(t,r)),i=await Promise.all(e.map(t=>Tt.fromSource(ot(t,r))));return new Ot(n,i)}async function Mt(t,e){return bt(t,e)}},function(t,e,r){function n(t,e){\"use strict\";var r=(e=e||{}).pos||0,i=\"<\".charCodeAt(0),o=\">\".charCodeAt(0),s=\"-\".charCodeAt(0),a=\"/\".charCodeAt(0),u=\"!\".charCodeAt(0),c=\"'\".charCodeAt(0),l='\"'.charCodeAt(0);function f(){for(var e=[];t[r];)if(t.charCodeAt(r)==i){if(t.charCodeAt(r+1)===a)return(r=t.indexOf(\">\",r))+1&&(r+=1),e;if(t.charCodeAt(r+1)===u){if(t.charCodeAt(r+2)==s){for(;-1!==r&&(t.charCodeAt(r)!==o||t.charCodeAt(r-1)!=s||t.charCodeAt(r-2)!=s||-1==r);)r=t.indexOf(\">\",r+1);-1===r&&(r=t.length)}else for(r+=2;t.charCodeAt(r)!==o&&t[r];)r++;r++;continue}var n=y();e.push(n)}else{var c=h();c.trim().length>0&&e.push(c),r++}return e}function h(){var e=r;return-2===(r=t.indexOf(\"<\",r)-1)&&(r=t.length),t.slice(e,r+1)}function d(){for(var e=r;-1===\"\\n\\t>/= \".indexOf(t[r])&&t[r];)r++;return t.slice(e,r)}var p=e.noChildNodes||[\"img\",\"br\",\"input\",\"meta\",\"link\"];function y(){r++;const e=d(),n={};let i=[];for(;t.charCodeAt(r)!==o&&t[r];){var s=t.charCodeAt(r);if(s>64&&s<91||s>96&&s<123){for(var u=d(),h=t.charCodeAt(r);h&&h!==c&&h!==l&&!(h>64&&h<91||h>96&&h<123)&&h!==o;)r++,h=t.charCodeAt(r);if(h===c||h===l){var y=g();if(-1===r)return{tagName:e,attributes:n,children:i}}else y=null,r--;n[u]=y}r++}if(t.charCodeAt(r-1)!==a)if(\"script\"==e){var m=r+1;r=t.indexOf(\"<\\/script>\",r),i=[t.slice(m,r-1)],r+=9}else if(\"style\"==e){m=r+1;r=t.indexOf(\"\",r),i=[t.slice(m,r-1)],r+=8}else-1==p.indexOf(e)&&(r++,i=f());else r++;return{tagName:e,attributes:n,children:i}}function g(){var e=t[r],n=++r;return r=t.indexOf(e,n),t.slice(n,r)}var m,b=null;if(void 0!==e.attrValue){e.attrName=e.attrName||\"id\";for(b=[];-1!==(m=void 0,m=new RegExp(\"\\\\s\"+e.attrName+\"\\\\s*=['\\\"]\"+e.attrValue+\"['\\\"]\").exec(t),r=m?m.index:-1);)-1!==(r=t.lastIndexOf(\"<\",r))&&b.push(y()),t=t.substr(r),r=0}else b=e.parseNode?y():f();return e.filter&&(b=n.filter(b,e.filter)),e.setPos&&(b.pos=r),b}n.simplify=function(t){var e={};if(!t.length)return\"\";if(1===t.length&&\"string\"==typeof t[0])return t[0];for(var r in t.forEach((function(t){if(\"object\"==typeof t){e[t.tagName]||(e[t.tagName]=[]);var r=n.simplify(t.children||[]);e[t.tagName].push(r),t.attributes&&(r._attributes=t.attributes)}})),e)1==e[r].length&&(e[r]=e[r][0]);return e},n.filter=function(t,e){var r=[];return t.forEach((function(t){if(\"object\"==typeof t&&e(t)&&r.push(t),t.children){var i=n.filter(t.children,e);r=r.concat(i)}})),r},n.stringify=function(t){var e=\"\";function r(t){if(t)for(var r=0;r\",r(t.children),e+=\"\"}return r(t),e},n.toContentString=function(t){if(Array.isArray(t)){var e=\"\";return t.forEach((function(t){e=(e+=\" \"+n.toContentString(t)).trim()})),e}return\"object\"==typeof t?n.toContentString(t.children):\" \"+t},n.getElementById=function(t,e,r){var i=n(t,{attrValue:e});return r?n.simplify(i):i[0]},n.getElementsByClassName=function(t,e,r){const i=n(t,{attrName:\"class\",attrValue:\"[a-zA-Z0-9-s ]*\"+e+\"[a-zA-Z0-9-s ]*\"});return r?n.simplify(i):i},n.parseStream=function(t,e){if(\"string\"==typeof e&&(e=e.length+2),\"string\"==typeof t){var i=r(25);t=i.createReadStream(t,{start:e}),e=0}var o=e,s=\"\";return t.on(\"data\",(function(e){s+=e;for(var r=0;;){if(!(o=s.indexOf(\"<\",o)+1))return void(o=r);if(\"/\"!==s[o+1]){var i=n(s,{pos:o-1,parseNode:!0,setPos:!0});if((o=i.pos)>s.length-1||oo.length-1||i=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg=\"\",this.ended=!1,this.chunks=[],this.strm=new u,this.strm.avail_out=0;var r=n.inflateInit2(this.strm,e.windowBits);if(r!==s.Z_OK)throw new Error(a[r]);if(this.header=new c,n.inflateGetHeader(this.strm,this.header),e.dictionary&&(\"string\"==typeof e.dictionary?e.dictionary=o.string2buf(e.dictionary):\"[object ArrayBuffer]\"===l.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(r=n.inflateSetDictionary(this.strm,e.dictionary))!==s.Z_OK))throw new Error(a[r])}function h(t,e){var r=new f(e);if(r.push(t,!0),r.err)throw r.msg||a[r.err];return r.result}f.prototype.push=function(t,e){var r,a,u,c,f,h=this.strm,d=this.options.chunkSize,p=this.options.dictionary,y=!1;if(this.ended)return!1;a=e===~~e?e:!0===e?s.Z_FINISH:s.Z_NO_FLUSH,\"string\"==typeof t?h.input=o.binstring2buf(t):\"[object ArrayBuffer]\"===l.call(t)?h.input=new Uint8Array(t):h.input=t,h.next_in=0,h.avail_in=h.input.length;do{if(0===h.avail_out&&(h.output=new i.Buf8(d),h.next_out=0,h.avail_out=d),(r=n.inflate(h,s.Z_NO_FLUSH))===s.Z_NEED_DICT&&p&&(r=n.inflateSetDictionary(this.strm,p)),r===s.Z_BUF_ERROR&&!0===y&&(r=s.Z_OK,y=!1),r!==s.Z_STREAM_END&&r!==s.Z_OK)return this.onEnd(r),this.ended=!0,!1;h.next_out&&(0!==h.avail_out&&r!==s.Z_STREAM_END&&(0!==h.avail_in||a!==s.Z_FINISH&&a!==s.Z_SYNC_FLUSH)||(\"string\"===this.options.to?(u=o.utf8border(h.output,h.next_out),c=h.next_out-u,f=o.buf2string(h.output,u),h.next_out=c,h.avail_out=d-c,c&&i.arraySet(h.output,h.output,u,c,0),this.onData(f)):this.onData(i.shrinkBuf(h.output,h.next_out)))),0===h.avail_in&&0===h.avail_out&&(y=!0)}while((h.avail_in>0||0===h.avail_out)&&r!==s.Z_STREAM_END);return r===s.Z_STREAM_END&&(a=s.Z_FINISH),a===s.Z_FINISH?(r=n.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===s.Z_OK):a!==s.Z_SYNC_FLUSH||(this.onEnd(s.Z_OK),h.avail_out=0,!0)},f.prototype.onData=function(t){this.chunks.push(t)},f.prototype.onEnd=function(t){t===s.Z_OK&&(\"string\"===this.options.to?this.result=this.chunks.join(\"\"):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},e.Inflate=f,e.inflate=h,e.inflateRaw=function(t,e){return(e=e||{}).raw=!0,h(t,e)},e.ungzip=h},function(t,e,r){\"use strict\";var n=r(26);class i extends n.a{constructor(){super(t=>(this._observers.add(t),()=>this._observers.delete(t))),this._observers=new Set}next(t){for(const e of this._observers)e.next(t)}error(t){for(const e of this._observers)e.error(t)}complete(){for(const t of this._observers)t.complete()}}e.a=i},function(t,e,r){\"use strict\";r.d(e,\"a\",(function(){return i}));const n=()=>{};function i(){let t,e=!1,r=n;return[new Promise(n=>{e?n(t):r=n}),n=>{e=!0,t=n,r(t)}]}},function(t,e,r){\"use strict\";r.d(e,\"a\",(function(){return i}));var n=r(2);function i(t){return t&&\"object\"==typeof t&&t[n.d]}},function(t,e,r){var n=r(40),i=r(39),o=t.exports;for(var s in n)n.hasOwnProperty(s)&&(o[s]=n[s]);function a(t){if(\"string\"==typeof t&&(t=i.parse(t)),t.protocol||(t.protocol=\"https:\"),\"https:\"!==t.protocol)throw new Error('Protocol \"'+t.protocol+'\" not supported. Expected \"https:\"');return t}o.request=function(t,e){return t=a(t),n.request.call(this,t,e)},o.get=function(t,e){return t=a(t),n.get.call(this,t,e)}},function(t,e,r){\"use strict\";(function(e){var n=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t},i=function(){function t(t,e){for(var r=0;r0?s-4:s;for(r=0;r>16&255,u[l++]=e>>8&255,u[l++]=255&e;2===a&&(e=i[t.charCodeAt(r)]<<2|i[t.charCodeAt(r+1)]>>4,u[l++]=255&e);1===a&&(e=i[t.charCodeAt(r)]<<10|i[t.charCodeAt(r+1)]<<4|i[t.charCodeAt(r+2)]>>2,u[l++]=e>>8&255,u[l++]=255&e);return u},e.fromByteArray=function(t){for(var e,r=t.length,i=r%3,o=[],s=0,a=r-i;sa?a:s+16383));1===i?(e=t[r-1],o.push(n[e>>2]+n[e<<4&63]+\"==\")):2===i&&(e=(t[r-2]<<8)+t[r-1],o.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+\"=\"));return o.join(\"\")};for(var n=[],i=[],o=\"undefined\"!=typeof Uint8Array?Uint8Array:Array,s=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\",a=0,u=s.length;a0)throw new Error(\"Invalid string. Length must be a multiple of 4\");var r=t.indexOf(\"=\");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function l(t,e,r){for(var i,o,s=[],a=e;a>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return s.join(\"\")}i[\"-\".charCodeAt(0)]=62,i[\"_\".charCodeAt(0)]=63},function(t,e){\n/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */\ne.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,u=(1<>1,l=-7,f=r?i-1:0,h=r?-1:1,d=t[e+f];for(f+=h,o=d&(1<<-l)-1,d>>=-l,l+=a;l>0;o=256*o+t[e+f],f+=h,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=n;l>0;s=256*s+t[e+f],f+=h,l-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,n),o-=c}return(d?-1:1)*s*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var s,a,u,c=8*o-i-1,l=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=l):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+f>=1?h/u:h*Math.pow(2,1-f))*u>=2&&(s++,u/=2),s+f>=l?(a=0,s=l):s+f>=1?(a=(e*u-1)*Math.pow(2,i),s+=f):(a=e*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;t[r+d]=255&a,d+=p,a/=256,i-=8);for(s=s<0;t[r+d]=255&s,d+=p,s/=256,c-=8);t[r+d-p]|=128*y}},function(t,e){var r=\"undefined\"!=typeof self?self:this,n=function(){function t(){this.fetch=!1,this.DOMException=r.DOMException}return t.prototype=r,new t}();!function(t){!function(e){var r=\"URLSearchParams\"in t,n=\"Symbol\"in t&&\"iterator\"in Symbol,i=\"FileReader\"in t&&\"Blob\"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),o=\"FormData\"in t,s=\"ArrayBuffer\"in t;if(s)var a=[\"[object Int8Array]\",\"[object Uint8Array]\",\"[object Uint8ClampedArray]\",\"[object Int16Array]\",\"[object Uint16Array]\",\"[object Int32Array]\",\"[object Uint32Array]\",\"[object Float32Array]\",\"[object Float64Array]\"],u=ArrayBuffer.isView||function(t){return t&&a.indexOf(Object.prototype.toString.call(t))>-1};function c(t){if(\"string\"!=typeof t&&(t=String(t)),/[^a-z0-9\\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError(\"Invalid character in header field name\");return t.toLowerCase()}function l(t){return\"string\"!=typeof t&&(t=String(t)),t}function f(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return n&&(e[Symbol.iterator]=function(){return e}),e}function h(t){this.map={},t instanceof h?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function d(t){if(t.bodyUsed)return Promise.reject(new TypeError(\"Already read\"));t.bodyUsed=!0}function p(t){return new Promise((function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}}))}function y(t){var e=new FileReader,r=p(e);return e.readAsArrayBuffer(t),r}function g(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function m(){return this.bodyUsed=!1,this._initBody=function(t){var e;this._bodyInit=t,t?\"string\"==typeof t?this._bodyText=t:i&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:o&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:r&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():s&&i&&((e=t)&&DataView.prototype.isPrototypeOf(e))?(this._bodyArrayBuffer=g(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):s&&(ArrayBuffer.prototype.isPrototypeOf(t)||u(t))?this._bodyArrayBuffer=g(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText=\"\",this.headers.get(\"content-type\")||(\"string\"==typeof t?this.headers.set(\"content-type\",\"text/plain;charset=UTF-8\"):this._bodyBlob&&this._bodyBlob.type?this.headers.set(\"content-type\",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set(\"content-type\",\"application/x-www-form-urlencoded;charset=UTF-8\"))},i&&(this.blob=function(){var t=d(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error(\"could not read FormData body as blob\");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?d(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(y)}),this.text=function(){var t,e,r,n=d(this);if(n)return n;if(this._bodyBlob)return t=this._bodyBlob,e=new FileReader,r=p(e),e.readAsText(t),r;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=new Array(e.length),n=0;n-1?n:r),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,(\"GET\"===this.method||\"HEAD\"===this.method)&&i)throw new TypeError(\"Body not allowed for GET or HEAD requests\");this._initBody(i)}function w(t){var e=new FormData;return t.trim().split(\"&\").forEach((function(t){if(t){var r=t.split(\"=\"),n=r.shift().replace(/\\+/g,\" \"),i=r.join(\"=\").replace(/\\+/g,\" \");e.append(decodeURIComponent(n),decodeURIComponent(i))}})),e}function x(t,e){e||(e={}),this.type=\"default\",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText=\"statusText\"in e?e.statusText:\"OK\",this.headers=new h(e.headers),this.url=e.url||\"\",this._initBody(t)}v.prototype.clone=function(){return new v(this,{body:this._bodyInit})},m.call(v.prototype),m.call(x.prototype),x.prototype.clone=function(){return new x(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new h(this.headers),url:this.url})},x.error=function(){var t=new x(null,{status:0,statusText:\"\"});return t.type=\"error\",t};var _=[301,302,303,307,308];x.redirect=function(t,e){if(-1===_.indexOf(e))throw new RangeError(\"Invalid status code\");return new x(null,{status:e,headers:{location:t}})},e.DOMException=t.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(t,e){this.message=t,this.name=e;var r=Error(t);this.stack=r.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function S(t,r){return new Promise((function(n,o){var s=new v(t,r);if(s.signal&&s.signal.aborted)return o(new e.DOMException(\"Aborted\",\"AbortError\"));var a=new XMLHttpRequest;function u(){a.abort()}a.onload=function(){var t,e,r={status:a.status,statusText:a.statusText,headers:(t=a.getAllResponseHeaders()||\"\",e=new h,t.replace(/\\r?\\n[\\t ]+/g,\" \").split(/\\r?\\n/).forEach((function(t){var r=t.split(\":\"),n=r.shift().trim();if(n){var i=r.join(\":\").trim();e.append(n,i)}})),e)};r.url=\"responseURL\"in a?a.responseURL:r.headers.get(\"X-Request-URL\");var i=\"response\"in a?a.response:a.responseText;n(new x(i,r))},a.onerror=function(){o(new TypeError(\"Network request failed\"))},a.ontimeout=function(){o(new TypeError(\"Network request failed\"))},a.onabort=function(){o(new e.DOMException(\"Aborted\",\"AbortError\"))},a.open(s.method,s.url,!0),\"include\"===s.credentials?a.withCredentials=!0:\"omit\"===s.credentials&&(a.withCredentials=!1),\"responseType\"in a&&i&&(a.responseType=\"blob\"),s.headers.forEach((function(t,e){a.setRequestHeader(e,t)})),s.signal&&(s.signal.addEventListener(\"abort\",u),a.onreadystatechange=function(){4===a.readyState&&s.signal.removeEventListener(\"abort\",u)}),a.send(void 0===s._bodyInit?null:s._bodyInit)}))}S.polyfill=!0,t.fetch||(t.fetch=S,t.Headers=h,t.Request=v,t.Response=x),e.Headers=h,e.Request=v,e.Response=x,e.fetch=S,Object.defineProperty(e,\"__esModule\",{value:!0})}({})}(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var i=n;(e=i.fetch).default=i.fetch,e.fetch=i.fetch,e.Headers=i.Headers,e.Request=i.Request,e.Response=i.Response,t.exports=e},function(t,e,r){\"use strict\";t.exports=function(){return r(112)('!function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(t,\"__esModule\",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&\"object\"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,\"default\",{enumerable:!0,value:t}),2&e&&\"string\"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,\"a\",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p=\"\",r(r.s=106)}([function(t,e,r){\"use strict\";const n=r(73);t.exports=function(t){return\"+\"===t[0]&&(t=t.substring(1)),(t=(t=n(t)).replace(/^0+(?=\\\\d)/,\"\")).includes(\".\")&&(t=t.replace(/\\\\.?0+$/,\"\")),\"\"===t&&(t=\"0\"),\"-0\"===t&&(t=\"0\"),t}},function(t,e,r){\"use strict\";const n=r(4),i=r(0),o=r(15),s=r(32);function a(t,e,r){t=i(t),e=i(e);const a=\"-\"!==t[0],u=\"-\"!==e[0],c=o(t),l=o(e);if(c||l)return a==u?\"Infinity\":\"-Infinity\";if(\"0\"===e)throw new Error(\"[preciso] division by zero\");if(\"\"===t||\"0\"===t)return\"0\";const f=a!==u?\"-\":\"\";return a||(t=n(t)),u||(e=n(e)),f+s(t,e,r)}t.exports=a,t.exports.default=a},function(t,e,r){\"use strict\";r.d(e,\"a\",(function(){return n})),r.d(e,\"b\",(function(){return i})),r.d(e,\"c\",(function(){return o})),r.d(e,\"d\",(function(){return s})),r.d(e,\"e\",(function(){return a}));const n=Symbol(\"thread.errors\"),i=Symbol(\"thread.events\"),o=Symbol(\"thread.terminate\"),s=Symbol(\"thread.transferable\"),a=Symbol(\"thread.worker\")},function(t,e){var r;r=function(){return this}();try{r=r||new Function(\"return this\")()}catch(t){\"object\"==typeof window&&(r=window)}t.exports=r},function(t,e,r){\"use strict\";const n=r(0);function i(t){return\"-\"===(t=n(t))[0]?t.substring(1):t}t.exports=i,t.exports.default=i},function(t,e,r){\"use strict\";function n(t,e){const r=t.length,n=e.length,i=t.indexOf(\".\"),o=e.indexOf(\".\"),s=-1===i?r:i,a=-1===o?n:o,u=s-a;let c=u<0?-1*u:0,l=u<=0?0:u,f=Math.max(s,a)+1+Math.max(r-s,n-a)-1,h=0;for(;ho)return\">\";if(n\":return\"-\"+s(t,e)}else if(u&&!c)switch(e=e.substring(1),n(t,e)){case\"=\":return\"0\";case\"<\":return\"-\"+s(e,t);case\">\":return s(t,e)}}t.exports=u,t.exports.default=u},function(t,e){var r,n,i=t.exports={};function o(){throw new Error(\"setTimeout has not been defined\")}function s(){throw new Error(\"clearTimeout has not been defined\")}function a(t){if(r===setTimeout)return setTimeout(t,0);if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r=\"function\"==typeof setTimeout?setTimeout:o}catch(t){r=o}try{n=\"function\"==typeof clearTimeout?clearTimeout:s}catch(t){n=s}}();var u,c=[],l=!1,f=-1;function h(){l&&u&&(l=!1,u.length?c=u.concat(c):f=-1,c.length&&d())}function d(){if(!l){var t=a(h);l=!0;for(var e=c.length;e;){for(u=c,c=[];++f1)for(var r=1;r0){for(;m>p-f;){const r=t[m-h]||\"0\",n=e[m-d]||\"0\";let i=Number(r)+Number(n)+g;i>=10?(i-=10,g=1):g=0,\"\"===y&&0===i||(y=i+y),m--}y&&(y=\".\"+y),m--}if(l>0)for(;m>=0;){const r=t[m-h]||\"0\",n=e[m-d]||\"0\";let i=Number(r)+Number(n)+g;i>=10?(i-=10,g=1):g=0,y=i+y,m--}return 1===g&&(y=g+y),\".\"===y[0]&&(y=\"0\"+y),y}t.exports=i,t.exports.default=i},function(t,e,r){\"use strict\";(function(t){\\n/*!\\n * The buffer module from node.js, for the browser.\\n *\\n * @author Feross Aboukhadijeh \\n * @license MIT\\n */\\nvar n=r(108),i=r(109),o=r(61);function s(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,e){if(s()=s())throw new RangeError(\"Attempt to allocate Buffer larger than maximum size: 0x\"+s().toString(16)+\" bytes\");return 0|t}function p(t,e){if(u.isBuffer(t))return t.length;if(\"undefined\"!=typeof ArrayBuffer&&\"function\"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;\"string\"!=typeof t&&(t=\"\"+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case\"ascii\":case\"latin1\":case\"binary\":return r;case\"utf8\":case\"utf-8\":case void 0:return B(t).length;case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return 2*r;case\"hex\":return r>>>1;case\"base64\":return G(t).length;default:if(n)return B(t).length;e=(\"\"+e).toLowerCase(),n=!0}}function y(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return\"\";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return\"\";if((r>>>=0)<=(e>>>=0))return\"\";for(t||(t=\"utf8\");;)switch(t){case\"hex\":return O(this,e,r);case\"utf8\":case\"utf-8\":return k(this,e,r);case\"ascii\":return T(this,e,r);case\"latin1\":case\"binary\":return C(this,e,r);case\"base64\":return E(this,e,r);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return I(this,e,r);default:if(n)throw new TypeError(\"Unknown encoding: \"+t);t=(t+\"\").toLowerCase(),n=!0}}function g(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function m(t,e,r,n,i){if(0===t.length)return-1;if(\"string\"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if(\"string\"==typeof e&&(e=u.from(e,n)),u.isBuffer(e))return 0===e.length?-1:b(t,e,r,n,i);if(\"number\"==typeof e)return e&=255,u.TYPED_ARRAY_SUPPORT&&\"function\"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):b(t,[e],r,n,i);throw new TypeError(\"val must be string, number or Buffer\")}function b(t,e,r,n,i){var o,s=1,a=t.length,u=e.length;if(void 0!==n&&(\"ucs2\"===(n=String(n).toLowerCase())||\"ucs-2\"===n||\"utf16le\"===n||\"utf-16le\"===n)){if(t.length<2||e.length<2)return-1;s=2,a/=2,u/=2,r/=2}function c(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){var l=-1;for(o=r;oa&&(r=a-u),o=r;o>=0;o--){for(var f=!0,h=0;hi&&(n=i):n=i;var o=e.length;if(o%2!=0)throw new TypeError(\"Invalid hex string\");n>o/2&&(n=o/2);for(var s=0;s>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function E(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function k(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i239?4:c>223?3:c>191?2:1;if(i+f<=r)switch(f){case 1:c<128&&(l=c);break;case 2:128==(192&(o=t[i+1]))&&(u=(31&c)<<6|63&o)>127&&(l=u);break;case 3:o=t[i+1],s=t[i+2],128==(192&o)&&128==(192&s)&&(u=(15&c)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:o=t[i+1],s=t[i+2],a=t[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(u=(15&c)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(l=u)}null===l?(l=65533,f=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),i+=f}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var r=\"\",n=0;for(;n0&&(t=this.toString(\"hex\",0,r).match(/.{2}/g).join(\" \"),this.length>r&&(t+=\" ... \")),\"\"},u.prototype.compare=function(t,e,r,n,i){if(!u.isBuffer(t))throw new TypeError(\"Argument must be a Buffer\");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError(\"out of range index\");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),a=Math.min(o,s),c=this.slice(n,i),l=t.slice(e,r),f=0;fi)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError(\"Attempt to write outside buffer bounds\");n||(n=\"utf8\");for(var o=!1;;)switch(n){case\"hex\":return v(this,t,e,r);case\"utf8\":case\"utf-8\":return w(this,t,e,r);case\"ascii\":return x(this,t,e,r);case\"latin1\":case\"binary\":return _(this,t,e,r);case\"base64\":return S(this,t,e,r);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return A(this,t,e,r);default:if(o)throw new TypeError(\"Unknown encoding: \"+n);n=(\"\"+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:\"Buffer\",data:Array.prototype.slice.call(this._arr||this,0)}};function T(t,e,r){var n=\"\";r=Math.min(t.length,r);for(var i=e;in)&&(r=n);for(var i=\"\",o=e;or)throw new RangeError(\"Trying to access beyond buffer length\")}function R(t,e,r,n,i,o){if(!u.isBuffer(t))throw new TypeError(\\'\"buffer\" argument must be a Buffer instance\\');if(e>i||et.length)throw new RangeError(\"Index out of range\")}function j(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i>>8*(n?i:1-i)}function M(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i>>8*(n?i:3-i)&255}function L(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError(\"Index out of range\");if(r<0)throw new RangeError(\"Index out of range\")}function F(t,e,r,n,o){return o||L(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function N(t,e,r,n,o){return o||L(t,0,r,8),i.write(t,e,r,n,52,8),r+8}u.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e0&&(i*=256);)n+=this[t+--e]*i;return n},u.prototype.readUInt8=function(t,e){return e||P(t,1,this.length),this[t]},u.prototype.readUInt16LE=function(t,e){return e||P(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function(t,e){return e||P(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUInt32LE=function(t,e){return e||P(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUInt32BE=function(t,e){return e||P(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||P(t,e,this.length);for(var n=this[t],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*e)),n},u.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||P(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},u.prototype.readInt8=function(t,e){return e||P(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){e||P(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){e||P(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return e||P(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return e||P(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,e){return e||P(t,4,this.length),i.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return e||P(t,4,this.length),i.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return e||P(t,8,this.length),i.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return e||P(t,8,this.length),i.read(this,t,!1,52,8)},u.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||R(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o=0&&(o*=256);)this[e+i]=t/o&255;return e+r},u.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||R(this,t,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||R(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):j(this,t,e,!0),e+2},u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||R(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):j(this,t,e,!1),e+2},u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||R(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):M(this,t,e,!0),e+4},u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||R(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):M(this,t,e,!1),e+4},u.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);R(this,t,e,r,i-1,-i)}var o=0,s=1,a=0;for(this[e]=255&t;++o>0)-a&255;return e+r},u.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);R(this,t,e,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},u.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||R(this,t,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||R(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):j(this,t,e,!0),e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||R(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):j(this,t,e,!1),e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||R(this,t,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):M(this,t,e,!0),e+4},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||R(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):M(this,t,e,!1),e+4},u.prototype.writeFloatLE=function(t,e,r){return F(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return F(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return N(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return N(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError(\"sourceStart out of bounds\");if(n<0)throw new RangeError(\"sourceEnd out of bounds\");n>this.length&&(n=this.length),t.length-e=0;--i)t[i+e]=this[i+r];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),\"number\"==typeof t)for(o=e;o55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error(\"Invalid code point\");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function G(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\\\\s+|\\\\s+$/g,\"\")}(t).replace(D,\"\")).length<2)return\"\";for(;t.length%4!=0;)t+=\"=\";return t}(t))}function q(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}}).call(this,r(3))},function(t,e){\"function\"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},function(t,e,r){\"use strict\";function n(t){return/^[-+]?0(\\\\.0+)?(e[\\\\.\\\\d]+)?$/.test(t)}t.exports=n,t.exports.default=n},function(t,e,r){(function(n){e.formatArgs=function(e){if(e[0]=(this.useColors?\"%c\":\"\")+this.namespace+(this.useColors?\" %c\":\" \")+e[0]+(this.useColors?\"%c \":\" \")+\"+\"+t.exports.humanize(this.diff),!this.useColors)return;const r=\"color: \"+this.color;e.splice(1,0,r,\"color: inherit\");let n=0,i=0;e[0].replace(/%[a-zA-Z%]/g,t=>{\"%%\"!==t&&(n++,\"%c\"===t&&(i=n))}),e.splice(i,0,r)},e.save=function(t){try{t?e.storage.setItem(\"debug\",t):e.storage.removeItem(\"debug\")}catch(t){}},e.load=function(){let t;try{t=e.storage.getItem(\"debug\")}catch(t){}!t&&void 0!==n&&\"env\"in n&&(t=n.env.DEBUG);return t},e.useColors=function(){if(\"undefined\"!=typeof window&&window.process&&(\"renderer\"===window.process.type||window.process.__nwjs))return!0;if(\"undefined\"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\\\\/(\\\\d+)/))return!1;return\"undefined\"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||\"undefined\"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||\"undefined\"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\\\\/(\\\\d+)/)&&parseInt(RegExp.$1,10)>=31||\"undefined\"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\\\\/(\\\\d+)/)},e.storage=function(){try{return localStorage}catch(t){}}(),e.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn(\"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.\"))}})(),e.colors=[\"#0000CC\",\"#0000FF\",\"#0033CC\",\"#0033FF\",\"#0066CC\",\"#0066FF\",\"#0099CC\",\"#0099FF\",\"#00CC00\",\"#00CC33\",\"#00CC66\",\"#00CC99\",\"#00CCCC\",\"#00CCFF\",\"#3300CC\",\"#3300FF\",\"#3333CC\",\"#3333FF\",\"#3366CC\",\"#3366FF\",\"#3399CC\",\"#3399FF\",\"#33CC00\",\"#33CC33\",\"#33CC66\",\"#33CC99\",\"#33CCCC\",\"#33CCFF\",\"#6600CC\",\"#6600FF\",\"#6633CC\",\"#6633FF\",\"#66CC00\",\"#66CC33\",\"#9900CC\",\"#9900FF\",\"#9933CC\",\"#9933FF\",\"#99CC00\",\"#99CC33\",\"#CC0000\",\"#CC0033\",\"#CC0066\",\"#CC0099\",\"#CC00CC\",\"#CC00FF\",\"#CC3300\",\"#CC3333\",\"#CC3366\",\"#CC3399\",\"#CC33CC\",\"#CC33FF\",\"#CC6600\",\"#CC6633\",\"#CC9900\",\"#CC9933\",\"#CCCC00\",\"#CCCC33\",\"#FF0000\",\"#FF0033\",\"#FF0066\",\"#FF0099\",\"#FF00CC\",\"#FF00FF\",\"#FF3300\",\"#FF3333\",\"#FF3366\",\"#FF3399\",\"#FF33CC\",\"#FF33FF\",\"#FF6600\",\"#FF6633\",\"#FF9900\",\"#FF9933\",\"#FFCC00\",\"#FFCC33\"],e.log=console.debug||console.log||(()=>{}),t.exports=r(129)(e);const{formatters:i}=t.exports;i.j=function(t){try{return JSON.stringify(t)}catch(t){return\"[UnexpectedJSONParseError]: \"+t.message}}}).call(this,r(7))},function(t,e,r){\"use strict\";r.d(e,\"a\",(function(){return o})),r.d(e,\"b\",(function(){return s}));const n={deserialize:t=>Object.assign(Error(t.message),{name:t.name,stack:t.stack}),serialize:t=>({__error_marker:\"$$error\",message:t.message,name:t.name,stack:t.stack})};let i={deserialize(t){return(e=t)&&\"object\"==typeof e&&\"__error_marker\"in e&&\"$$error\"===e.__error_marker?n.deserialize(t):t;var e},serialize:t=>t instanceof Error?n.serialize(t):t};function o(t){return i.deserialize(t)}function s(t){return i.serialize(t)}},function(t,e,r){\"use strict\";var n=r(28),i=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=f;var o=Object.create(r(21));o.inherits=r(10);var s=r(60),a=r(65);o.inherits(f,s);for(var u=i(a.prototype),c=0;c/^[a-zA-Z][a-zA-Z\\\\d+\\\\-.]*:/.test(t);function a(t){const e=new Blob([t],{type:\"application/javascript\"});return URL.createObjectURL(e)}let u;function c(){return u||(u=function(){if(\"undefined\"==typeof Worker)return class{constructor(){throw Error(\"No web worker implementation available. You might have tried to spawn a worker within a worker in a browser that doesn\\'t support workers in workers.\")}};class t extends Worker{constructor(t,e){var r,n;\"string\"==typeof t&&e&&e._baseURL?t=new URL(t,e._baseURL):\"string\"==typeof t&&!s(t)&&i().match(/^file:\\\\/\\\\//i)&&(t=new URL(t,i().replace(/\\\\/[^\\\\/]+$/,\"/\")),(null===(r=null==e?void 0:e.CORSWorkaround)||void 0===r||r)&&(t=a(`importScripts(${JSON.stringify(t)});`))),\"string\"==typeof t&&s(t)&&(null===(n=null==e?void 0:e.CORSWorkaround)||void 0===n||n)&&(t=a(`importScripts(${JSON.stringify(t)});`)),super(t,e)}}class e extends t{constructor(t,e){super(window.URL.createObjectURL(t),e)}static fromText(t,r){const n=new window.Blob([t],{type:\"text/javascript\"});return new e(n,r)}}return{blob:e,default:t}}()),u}},function(t,e,r){\"use strict\";var n,i;r.d(e,\"a\",(function(){return n})),r.d(e,\"b\",(function(){return i})),function(t){t.cancel=\"cancel\",t.run=\"run\"}(n||(n={})),function(t){t.error=\"error\",t.init=\"init\",t.result=\"result\",t.running=\"running\",t.uncaughtError=\"uncaughtError\"}(i||(i={}))},function(t,e,r){function n(t){return Object.prototype.toString.call(t)}e.isArray=function(t){return Array.isArray?Array.isArray(t):\"[object Array]\"===n(t)},e.isBoolean=function(t){return\"boolean\"==typeof t},e.isNull=function(t){return null===t},e.isNullOrUndefined=function(t){return null==t},e.isNumber=function(t){return\"number\"==typeof t},e.isString=function(t){return\"string\"==typeof t},e.isSymbol=function(t){return\"symbol\"==typeof t},e.isUndefined=function(t){return void 0===t},e.isRegExp=function(t){return\"[object RegExp]\"===n(t)},e.isObject=function(t){return\"object\"==typeof t&&null!==t},e.isDate=function(t){return\"[object Date]\"===n(t)},e.isError=function(t){return\"[object Error]\"===n(t)||t instanceof Error},e.isFunction=function(t){return\"function\"==typeof t},e.isPrimitive=function(t){return null===t||\"boolean\"==typeof t||\"number\"==typeof t||\"string\"==typeof t||\"symbol\"==typeof t||void 0===t},e.isBuffer=r(9).Buffer.isBuffer},function(t,e,r){\"use strict\";const n=r(11),i=r(50);function o(t){return n(t)?\"\":i(t)}t.exports=o,t.exports.default=o},function(t,e,r){\"use strict\";const n=r(35);function i(t,e){return n(t,\"2\",e)}t.exports=i,t.exports.default=i},function(t,e,r){\"use strict\";r.d(e,\"a\",(function(){return o}));var n=r(2);function i(t){throw Error(t)}const o={errors:t=>t[n.a]||i(\"Error observable not found. Make sure to pass a thread instance as returned by the spawn() promise.\"),events:t=>t[n.b]||i(\"Events observable not found. Make sure to pass a thread instance as returned by the spawn() promise.\"),terminate:t=>t[n.c]()}},function(t,e){},function(t,e,r){\"use strict\";const n=()=>\"function\"==typeof Symbol,i=t=>n()&&Boolean(Symbol[t]),o=t=>i(t)?Symbol[t]:\"@@\"+t;i(\"asyncIterator\")||(Symbol.asyncIterator=Symbol.asyncIterator||Symbol.for(\"Symbol.asyncIterator\"));const s=o(\"iterator\"),a=o(\"observable\"),u=o(\"species\");function c(t,e){const r=t[e];if(null!=r){if(\"function\"!=typeof r)throw new TypeError(r+\" is not a function\");return r}}function l(t){let e=t.constructor;return void 0!==e&&(e=e[u],null===e&&(e=void 0)),void 0!==e?e:v}function f(t){f.log?f.log(t):setTimeout(()=>{throw t},0)}function h(t){Promise.resolve().then(()=>{try{t()}catch(t){f(t)}})}function d(t){const e=t._cleanup;if(void 0!==e&&(t._cleanup=void 0,e))try{if(\"function\"==typeof e)e();else{const t=c(e,\"unsubscribe\");t&&t.call(e)}}catch(t){f(t)}}function p(t){t._observer=void 0,t._queue=void 0,t._state=\"closed\"}function y(t,e,r){t._state=\"running\";const n=t._observer;try{const i=n?c(n,e):void 0;switch(e){case\"next\":i&&i.call(n,r);break;case\"error\":if(p(t),!i)throw r;i.call(n,r);break;case\"complete\":p(t),i&&i.call(n)}}catch(t){f(t)}\"closed\"===t._state?d(t):\"running\"===t._state&&(t._state=\"ready\")}function g(t,e,r){if(\"closed\"!==t._state)return\"buffering\"===t._state?(t._queue=t._queue||[],void t._queue.push({type:e,value:r})):\"ready\"!==t._state?(t._state=\"buffering\",t._queue=[{type:e,value:r}],void h(()=>function(t){const e=t._queue;if(e){t._queue=void 0,t._state=\"ready\";for(const r of e)if(y(t,r.type,r.value),\"closed\"===t._state)break}}(t))):void y(t,e,r)}class m{constructor(t,e){this._cleanup=void 0,this._observer=t,this._queue=void 0,this._state=\"initializing\";const r=new b(this);try{this._cleanup=e.call(void 0,r)}catch(t){r.error(t)}\"initializing\"===this._state&&(this._state=\"ready\")}get closed(){return\"closed\"===this._state}unsubscribe(){\"closed\"!==this._state&&(p(this),d(this))}}class b{constructor(t){this._subscription=t}get closed(){return\"closed\"===this._subscription._state}next(t){g(this._subscription,\"next\",t)}error(t){g(this._subscription,\"error\",t)}complete(){g(this._subscription,\"complete\")}}class v{constructor(t){if(!(this instanceof v))throw new TypeError(\"Observable cannot be called as a function\");if(\"function\"!=typeof t)throw new TypeError(\"Observable initializer must be a function\");this._subscriber=t}subscribe(t,e,r){return\"object\"==typeof t&&null!==t||(t={next:t,error:e,complete:r}),new m(t,this._subscriber)}pipe(t,...e){let r=this;for(const n of[t,...e])r=n(r);return r}tap(t,e,r){const n=\"object\"!=typeof t||null===t?{next:t,error:e,complete:r}:t;return new v(t=>this.subscribe({next(e){n.next&&n.next(e),t.next(e)},error(e){n.error&&n.error(e),t.error(e)},complete(){n.complete&&n.complete(),t.complete()},start(t){n.start&&n.start(t)}}))}forEach(t){return new Promise((e,r)=>{if(\"function\"!=typeof t)return void r(new TypeError(t+\" is not a function\"));function n(){i.unsubscribe(),e(void 0)}const i=this.subscribe({next(e){try{t(e,n)}catch(t){r(t),i.unsubscribe()}},error(t){r(t)},complete(){e(void 0)}})})}map(t){if(\"function\"!=typeof t)throw new TypeError(t+\" is not a function\");return new(l(this))(e=>this.subscribe({next(r){let n=r;try{n=t(r)}catch(t){return e.error(t)}e.next(n)},error(t){e.error(t)},complete(){e.complete()}}))}filter(t){if(\"function\"!=typeof t)throw new TypeError(t+\" is not a function\");return new(l(this))(e=>this.subscribe({next(r){try{if(!t(r))return}catch(t){return e.error(t)}e.next(r)},error(t){e.error(t)},complete(){e.complete()}}))}reduce(t,e){if(\"function\"!=typeof t)throw new TypeError(t+\" is not a function\");const r=l(this),n=arguments.length>1;let i=!1,o=e;return new r(e=>this.subscribe({next(r){const s=!i;if(i=!0,!s||n)try{o=t(o,r)}catch(t){return e.error(t)}else o=r},error(t){e.error(t)},complete(){if(!i&&!n)return e.error(new TypeError(\"Cannot reduce an empty sequence\"));e.next(o),e.complete()}}))}concat(...t){const e=l(this);return new e(r=>{let n,i=0;return function o(s){n=s.subscribe({next(t){r.next(t)},error(t){r.error(t)},complete(){i===t.length?(n=void 0,r.complete()):o(e.from(t[i++]))}})}(this),()=>{n&&(n.unsubscribe(),n=void 0)}})}flatMap(t){if(\"function\"!=typeof t)throw new TypeError(t+\" is not a function\");const e=l(this);return new e(r=>{const n=[],i=this.subscribe({next(i){let s;if(t)try{s=t(i)}catch(t){return r.error(t)}else s=i;const a=e.from(s).subscribe({next(t){r.next(t)},error(t){r.error(t)},complete(){const t=n.indexOf(a);t>=0&&n.splice(t,1),o()}});n.push(a)},error(t){r.error(t)},complete(){o()}});function o(){i.closed&&0===n.length&&r.complete()}return()=>{n.forEach(t=>t.unsubscribe()),i.unsubscribe()}})}[(Symbol.observable,a)](){return this}static from(t){const e=\"function\"==typeof this?this:v;if(null==t)throw new TypeError(t+\" is not an object\");const r=c(t,a);if(r){const n=r.call(t);if(Object(n)!==n)throw new TypeError(n+\" is not an object\");return function(t){return t instanceof v}(n)&&n.constructor===e?n:new e(t=>n.subscribe(t))}if(i(\"iterator\")){const r=c(t,s);if(r)return new e(e=>{h(()=>{if(!e.closed){for(const n of r.call(t))if(e.next(n),e.closed)return;e.complete()}})})}if(Array.isArray(t))return new e(e=>{h(()=>{if(!e.closed){for(const r of t)if(e.next(r),e.closed)return;e.complete()}})});throw new TypeError(t+\" is not observable\")}static of(...t){return new(\"function\"==typeof this?this:v)(e=>{h(()=>{if(!e.closed){for(const r of t)if(e.next(r),e.closed)return;e.complete()}})})}static get[u](){return this}}n()&&Object.defineProperty(v,Symbol(\"extensions\"),{value:{symbol:a,hostReportError:f},configurable:!0});e.a=v},function(t,e,r){\"use strict\";var n;r.d(e,\"a\",(function(){return n})),function(t){t.internalError=\"internalError\",t.message=\"message\",t.termination=\"termination\"}(n||(n={}))},function(t,e,r){\"use strict\";(function(e){void 0===e||!e.version||0===e.version.indexOf(\"v0.\")||0===e.version.indexOf(\"v1.\")&&0!==e.version.indexOf(\"v1.8.\")?t.exports={nextTick:function(t,r,n,i){if(\"function\"!=typeof t)throw new TypeError(\\'\"callback\" argument must be a function\\');var o,s,a=arguments.length;switch(a){case 0:case 1:return e.nextTick(t);case 2:return e.nextTick((function(){t.call(null,r)}));case 3:return e.nextTick((function(){t.call(null,r,n)}));case 4:return e.nextTick((function(){t.call(null,r,n,i)}));default:for(o=new Array(a-1),s=0;s0){for(;m>p-f;){let r=t[m-h]||\"0\",n=e[m-d]||\"0\";r-=g,g=0;let i=r-n;if(i<0)for(;i<0;)g++,i+=10;else g&&g--;\"\"===y&&0===i||(y=i+y),m--}\"\"!==y&&(y=\".\"+y),m--}if(l>0){for(;m>0;){let r=t[m-h]||\"0\",n=e[m-d]||\"0\";r-=g,g=0;let i=r-n;if(i<0)for(;i<0;)g++,i+=10;else g&&g--;y=i+y,m--}const r=t[0-h]||\"0\",n=e[0-d]||\"0\";let i=Number(r)-(g>0?1:0)-Number(n);0!==i&&(y=i+y),y=y.replace(/^0+/,\"\")}return\".\"===y[0]&&(y=\"0\"+y),y}t.exports=i,t.exports.default=i},function(t,e,r){\"use strict\";const n=r(5),i=r(6),o=r(33),s=r(49);function a(t,e,{format:r=\"string\",max_decimal_digits:a=100,ellipsis:u=!1}={}){\"0\"===t[0]&&(t=t.substring(1)),\"0\"===e[0]&&(e=e.substring(1));const c=t.indexOf(\".\"),l=e.indexOf(\".\"),f=-1===c?t.length:c,h=-1===l?0:e.length-1-l;let d=!1;t=t.replace(/\\\\./,\"\"),e=e.replace(/\\\\./,\"\");const p=t.length;let y,g=\"\",m=\"\",b=-1*h,v=0;for(let r=0;r\"===y){let t=1,r=i(e,e),s=e;for(;\">\"!==n(r,g);)t++,s=r,r=i(r,e);if(t=t.toString(),\"\"!==m)for(let e=t.length;e<=v;e++)m+=\"0\";m+=t,g=o(g,s),v=0}else{if(\"<\"===y){\"\"===m&&b++,v++;continue}if(\"=\"===y){if(\"\"!==m)for(let t=0;t3){m+=\"...\",d=!0;break}}else t[g]=1;const r=n(g,e);if(\">\"===r){let t=1,r=i(e,e),s=e;for(;\">\"!==n(r,g);)t++,s=r,r=i(r,e);t=t.toString();for(let e=t.length;e<=v;e++)m+=\"0\";if(m+=t,g=o(g,s),\"0\"===g)break;v=0}else{if(\"<\"===r){v++;continue}if(\"=\"===r){for(let t=0;tx){for(let t=x;t0&&(m=s(m.substring(0,m.length-S+1))),\".\"===m[0]&&(m=\"0\"+m),\"object\"===r?{quotient:m,extra_decimals:S}:m}t.exports=a,t.exports.default=a},function(t,e,r){\"use strict\";const n=r(0),i=r(5),o=r(15),s=r(8),a=r(31);function u(t,e,{infinity_minus_infinity:r=\"NaN\"}={}){t=n(t),e=n(e);const u=!(\"-\"===t[0]),c=!(\"-\"===e[0]),l=o(t),f=o(e);if(l&&f){if(u===c)return r;if(u)return\"Infinity\";if(c)return\"-Infinity\"}else{if(l)return t;if(f)return c?\"-Infinity\":\"Infinity\"}if(u){if(c){const r=i(t,e);return\">\"===r?a(t,e):\"<\"===r?\"-\"+a(e,t):\"0\"}return s(t,e.substring(1))}if(c)return\"-\"+s(t.substring(1),e);{t=t.substring(1),e=e.substring(1);const r=i(t,e);return\">\"===r?\"-\"+a(t,e):\"<\"===r?a(e,t):\"0\"}}t.exports=u,t.exports.default=u},function(t,e,r){\"use strict\";const n=r(0),i=r(5);function o(t,e){t=n(t),e=n(e);const r=\"-\"!==t[0],o=\"-\"!==e[0];return r?o?i(t,e):\">\":o?\"<\":i(e.substring(1),t.substring(1))}t.exports=o,t.exports.default=o},function(t,e,r){\"use strict\";const n=r(4),i=r(0),o=r(1),s=r(77),a=r(16),u=r(52),c=r(78),l=r(11),f=r(53),h=r(54),d=r(81),p=r(37),y=r(36),g=r(22),m=r(85);function b(t,e,{zero_to_the_power_of_zero:r=\"1\",ellipsis:b=!1,imaginary:v=!0,max_decimal_digits:w=100,fraction:x=!1}={}){t=i(t),e=i(e);const _=v&&u(t);_&&(t=t.replace(/i$/,\"\"));const S=l(t),A=l(e);if(S&&A)return r;if(A)return\"1\";const E=g(e);if(S){if(\"+\"===E)return\"0\";if(\"-\"===E)return\"Infinity\"}const k=a(e);if(\"+\"===E&&k){let r=h(t,e);return\"number\"==typeof w&&(r=y(r,{digits:w})),_&&c(e)&&(r+=\"i\"),r}if(\"-\"===E&&k){const r=\"1\",i=h(t,n(e));return o(r,i,{ellipsis:b,max_decimal_digits:w})}if(!k){e=n(e);let[r,i]=e.includes(\"/\")?e.split(\"/\"):s(e);[r,i]=m(r,i);let o=p(t,i,{imaginary:v}),a=f(r,o);return\"number\"==typeof w&&(a=y(a,{digits:w})),\"-\"===E&&(a=d(a,{fraction:x,max_decimal_digits:w})),a}}t.exports=b,t.exports.default=b},function(t,e,r){\"use strict\";const n=r(52),i=r(159);function o(t,{digits:e=0}={}){return n(t)?i(t.substring(0,t.length-1),{digits:e})+\"i\":i(t,{digits:e})}t.exports=o,t.exports.default=o},function(t,e,r){\"use strict\";const n=r(4),i=r(0),o=r(5),s=r(82),a=r(16),u=r(80),c=r(54),l=r(83);function f(t,e,{imaginary:r=!0,max_decimal_digits:f=100}={}){if(t=i(t),\"1\"===(e=i(e)))return t;if(\"1\"===t)return\"1\";if(!a(e))throw new Error(\"[preciso] can\\'t find fractional roots\");if(u(e))throw new Error(\"[preciso] can\\'t find root of negative indexes\");const h=n(t),d=u(t),p=s(e),y=d&&p;if(y&&!r)throw new Error(\"[preciso] root has an imaginary number\");const g=d&&!p?\"-\":\"\",m=l(h,e),b=[\"9\",\"8\",\"7\",\"6\",\"5\",\"4\",\"3\",\"2\",\"1\",\"0\"];let v=\"\";for(let t=0;to)return\">\";if(n\",\\'\"\\',\"`\",\" \",\"\\\\r\",\"\\\\n\",\"\\\\t\"]),c=[\"\\'\"].concat(u),l=[\"%\",\"/\",\"?\",\";\",\"#\"].concat(c),f=[\"/\",\"?\",\"#\"],h=/^[+a-z0-9A-Z_-]{0,63}$/,d=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,p={javascript:!0,\"javascript:\":!0},y={javascript:!0,\"javascript:\":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,\"http:\":!0,\"https:\":!0,\"ftp:\":!0,\"gopher:\":!0,\"file:\":!0},m=r(137);function b(t,e,r){if(t&&\"object\"==typeof t&&t instanceof i)return t;var n=new i;return n.parse(t,e,r),n}i.prototype.parse=function(t,e,r){if(\"string\"!=typeof t)throw new TypeError(\"Parameter \\'url\\' must be a string, not \"+typeof t);var i=t.indexOf(\"?\"),s=-1!==i&&i127?R+=\"x\":R+=P[j];if(!R.match(h)){var L=O.slice(0,k),F=O.slice(k+1),N=P.match(d);N&&(L.push(N[1]),F.unshift(N[2])),F.length&&(b=\"/\"+F.join(\".\")+b),this.hostname=L.join(\".\");break}}}this.hostname.length>255?this.hostname=\"\":this.hostname=this.hostname.toLowerCase(),C||(this.hostname=n.toASCII(this.hostname));var D=this.port?\":\"+this.port:\"\",U=this.hostname||\"\";this.host=U+D,this.href+=this.host,C&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),\"/\"!==b[0]&&(b=\"/\"+b))}if(!p[x])for(k=0,I=c.length;k0)&&r.host.split(\"@\"))&&(r.auth=C.shift(),r.hostname=C.shift(),r.host=r.hostname);return r.search=t.search,r.query=t.query,null===r.pathname&&null===r.search||(r.path=(r.pathname?r.pathname:\"\")+(r.search?r.search:\"\")),r.href=r.format(),r}if(!_.length)return r.pathname=null,r.search?r.path=\"/\"+r.search:r.path=null,r.href=r.format(),r;for(var A=_.slice(-1)[0],E=(r.host||t.host||_.length>1)&&(\".\"===A||\"..\"===A)||\"\"===A,k=0,T=_.length;T>=0;T--)\".\"===(A=_[T])?_.splice(T,1):\"..\"===A?(_.splice(T,1),k++):k&&(_.splice(T,1),k--);if(!w&&!x)for(;k--;k)_.unshift(\"..\");!w||\"\"===_[0]||_[0]&&\"/\"===_[0].charAt(0)||_.unshift(\"\"),E&&\"/\"!==_.join(\"/\").substr(-1)&&_.push(\"\");var C,O=\"\"===_[0]||_[0]&&\"/\"===_[0].charAt(0);S&&(r.hostname=O?\"\":_.length?_.shift():\"\",r.host=r.hostname,(C=!!(r.host&&r.host.indexOf(\"@\")>0)&&r.host.split(\"@\"))&&(r.auth=C.shift(),r.hostname=C.shift(),r.host=r.hostname));return(w=w||r.host&&_.length)&&!O&&_.unshift(\"\"),_.length>0?r.pathname=_.join(\"/\"):(r.pathname=null,r.path=null),null===r.pathname&&null===r.search||(r.path=(r.pathname?r.pathname:\"\")+(r.search?r.search:\"\")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},i.prototype.parseHost=function(){var t=this.host,e=s.exec(t);e&&(\":\"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)},e.parse=b,e.resolve=function(t,e){return b(t,!1,!0).resolve(e)},e.resolveObject=function(t,e){return t?b(t,!1,!0).resolveObject(e):e},e.format=function(t){return\"string\"==typeof t&&(t=b(t)),t instanceof i?t.format():i.prototype.format.call(t)},e.Url=i},function(t,e,r){(function(t){var n=r(131),i=r(70),o=r(133),s=r(134),a=r(39),u=e;u.request=function(e,r){e=\"string\"==typeof e?a.parse(e):o(e);var i=-1===t.location.protocol.search(/^https?:$/)?\"http:\":\"\",s=e.protocol||i,u=e.hostname||e.host,c=e.port,l=e.path||\"/\";u&&-1!==u.indexOf(\":\")&&(u=\"[\"+u+\"]\"),e.url=(u?s+\"//\"+u:\"\")+(c?\":\"+c:\"\")+l,e.method=(e.method||\"GET\").toUpperCase(),e.headers=e.headers||{};var f=new n(e);return r&&f.on(\"response\",r),f},u.get=function(t,e){var r=u.request(t,e);return r.end(),r},u.ClientRequest=n,u.IncomingMessage=i.IncomingMessage,u.Agent=function(){},u.Agent.defaultMaxSockets=4,u.globalAgent=new u.Agent,u.STATUS_CODES=s,u.METHODS=[\"CHECKOUT\",\"CONNECT\",\"COPY\",\"DELETE\",\"GET\",\"HEAD\",\"LOCK\",\"M-SEARCH\",\"MERGE\",\"MKACTIVITY\",\"MKCOL\",\"MOVE\",\"NOTIFY\",\"OPTIONS\",\"PATCH\",\"POST\",\"PROPFIND\",\"PROPPATCH\",\"PURGE\",\"PUT\",\"REPORT\",\"SEARCH\",\"SUBSCRIBE\",\"TRACE\",\"UNLOCK\",\"UNSUBSCRIBE\"]}).call(this,r(3))},,function(t,e,r){(e=t.exports=r(60)).Stream=e,e.Readable=e,e.Writable=r(65),e.Duplex=r(14),e.Transform=r(67),e.PassThrough=r(117)},function(t,e,r){var n=r(9),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(o(n,e),e.Buffer=s),o(i,s),s.from=function(t,e,r){if(\"number\"==typeof t)throw new TypeError(\"Argument must not be a number\");return i(t,e,r)},s.alloc=function(t,e,r){if(\"number\"!=typeof t)throw new TypeError(\"Argument must be a number\");var n=i(t);return void 0!==e?\"string\"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},s.allocUnsafe=function(t){if(\"number\"!=typeof t)throw new TypeError(\"Argument must be a number\");return i(t)},s.allocUnsafeSlow=function(t){if(\"number\"!=typeof t)throw new TypeError(\"Argument must be a number\");return n.SlowBuffer(t)}},function(t,e,r){\"use strict\";var n=SyntaxError,i=Function,o=TypeError,s=function(t){try{return i(\\'\"use strict\"; return (\\'+t+\").constructor;\")()}catch(t){}},a=Object.getOwnPropertyDescriptor;if(a)try{a({},\"\")}catch(t){a=null}var u=function(){throw new o},c=a?function(){try{return u}catch(t){try{return a(arguments,\"callee\").get}catch(t){return u}}}():u,l=r(140)(),f=r(142)(),h=Object.getPrototypeOf||(f?function(t){return t.__proto__}:null),d={},p=\"undefined\"!=typeof Uint8Array&&h?h(Uint8Array):void 0,y={\"%AggregateError%\":\"undefined\"==typeof AggregateError?void 0:AggregateError,\"%Array%\":Array,\"%ArrayBuffer%\":\"undefined\"==typeof ArrayBuffer?void 0:ArrayBuffer,\"%ArrayIteratorPrototype%\":l&&h?h([][Symbol.iterator]()):void 0,\"%AsyncFromSyncIteratorPrototype%\":void 0,\"%AsyncFunction%\":d,\"%AsyncGenerator%\":d,\"%AsyncGeneratorFunction%\":d,\"%AsyncIteratorPrototype%\":d,\"%Atomics%\":\"undefined\"==typeof Atomics?void 0:Atomics,\"%BigInt%\":\"undefined\"==typeof BigInt?void 0:BigInt,\"%BigInt64Array%\":\"undefined\"==typeof BigInt64Array?void 0:BigInt64Array,\"%BigUint64Array%\":\"undefined\"==typeof BigUint64Array?void 0:BigUint64Array,\"%Boolean%\":Boolean,\"%DataView%\":\"undefined\"==typeof DataView?void 0:DataView,\"%Date%\":Date,\"%decodeURI%\":decodeURI,\"%decodeURIComponent%\":decodeURIComponent,\"%encodeURI%\":encodeURI,\"%encodeURIComponent%\":encodeURIComponent,\"%Error%\":Error,\"%eval%\":eval,\"%EvalError%\":EvalError,\"%Float32Array%\":\"undefined\"==typeof Float32Array?void 0:Float32Array,\"%Float64Array%\":\"undefined\"==typeof Float64Array?void 0:Float64Array,\"%FinalizationRegistry%\":\"undefined\"==typeof FinalizationRegistry?void 0:FinalizationRegistry,\"%Function%\":i,\"%GeneratorFunction%\":d,\"%Int8Array%\":\"undefined\"==typeof Int8Array?void 0:Int8Array,\"%Int16Array%\":\"undefined\"==typeof Int16Array?void 0:Int16Array,\"%Int32Array%\":\"undefined\"==typeof Int32Array?void 0:Int32Array,\"%isFinite%\":isFinite,\"%isNaN%\":isNaN,\"%IteratorPrototype%\":l&&h?h(h([][Symbol.iterator]())):void 0,\"%JSON%\":\"object\"==typeof JSON?JSON:void 0,\"%Map%\":\"undefined\"==typeof Map?void 0:Map,\"%MapIteratorPrototype%\":\"undefined\"!=typeof Map&&l&&h?h((new Map)[Symbol.iterator]()):void 0,\"%Math%\":Math,\"%Number%\":Number,\"%Object%\":Object,\"%parseFloat%\":parseFloat,\"%parseInt%\":parseInt,\"%Promise%\":\"undefined\"==typeof Promise?void 0:Promise,\"%Proxy%\":\"undefined\"==typeof Proxy?void 0:Proxy,\"%RangeError%\":RangeError,\"%ReferenceError%\":ReferenceError,\"%Reflect%\":\"undefined\"==typeof Reflect?void 0:Reflect,\"%RegExp%\":RegExp,\"%Set%\":\"undefined\"==typeof Set?void 0:Set,\"%SetIteratorPrototype%\":\"undefined\"!=typeof Set&&l&&h?h((new Set)[Symbol.iterator]()):void 0,\"%SharedArrayBuffer%\":\"undefined\"==typeof SharedArrayBuffer?void 0:SharedArrayBuffer,\"%String%\":String,\"%StringIteratorPrototype%\":l&&h?h(\"\"[Symbol.iterator]()):void 0,\"%Symbol%\":l?Symbol:void 0,\"%SyntaxError%\":n,\"%ThrowTypeError%\":c,\"%TypedArray%\":p,\"%TypeError%\":o,\"%Uint8Array%\":\"undefined\"==typeof Uint8Array?void 0:Uint8Array,\"%Uint8ClampedArray%\":\"undefined\"==typeof Uint8ClampedArray?void 0:Uint8ClampedArray,\"%Uint16Array%\":\"undefined\"==typeof Uint16Array?void 0:Uint16Array,\"%Uint32Array%\":\"undefined\"==typeof Uint32Array?void 0:Uint32Array,\"%URIError%\":URIError,\"%WeakMap%\":\"undefined\"==typeof WeakMap?void 0:WeakMap,\"%WeakRef%\":\"undefined\"==typeof WeakRef?void 0:WeakRef,\"%WeakSet%\":\"undefined\"==typeof WeakSet?void 0:WeakSet};if(h)try{null.error}catch(t){var g=h(h(t));y[\"%Error.prototype%\"]=g}var m={\"%ArrayBufferPrototype%\":[\"ArrayBuffer\",\"prototype\"],\"%ArrayPrototype%\":[\"Array\",\"prototype\"],\"%ArrayProto_entries%\":[\"Array\",\"prototype\",\"entries\"],\"%ArrayProto_forEach%\":[\"Array\",\"prototype\",\"forEach\"],\"%ArrayProto_keys%\":[\"Array\",\"prototype\",\"keys\"],\"%ArrayProto_values%\":[\"Array\",\"prototype\",\"values\"],\"%AsyncFunctionPrototype%\":[\"AsyncFunction\",\"prototype\"],\"%AsyncGenerator%\":[\"AsyncGeneratorFunction\",\"prototype\"],\"%AsyncGeneratorPrototype%\":[\"AsyncGeneratorFunction\",\"prototype\",\"prototype\"],\"%BooleanPrototype%\":[\"Boolean\",\"prototype\"],\"%DataViewPrototype%\":[\"DataView\",\"prototype\"],\"%DatePrototype%\":[\"Date\",\"prototype\"],\"%ErrorPrototype%\":[\"Error\",\"prototype\"],\"%EvalErrorPrototype%\":[\"EvalError\",\"prototype\"],\"%Float32ArrayPrototype%\":[\"Float32Array\",\"prototype\"],\"%Float64ArrayPrototype%\":[\"Float64Array\",\"prototype\"],\"%FunctionPrototype%\":[\"Function\",\"prototype\"],\"%Generator%\":[\"GeneratorFunction\",\"prototype\"],\"%GeneratorPrototype%\":[\"GeneratorFunction\",\"prototype\",\"prototype\"],\"%Int8ArrayPrototype%\":[\"Int8Array\",\"prototype\"],\"%Int16ArrayPrototype%\":[\"Int16Array\",\"prototype\"],\"%Int32ArrayPrototype%\":[\"Int32Array\",\"prototype\"],\"%JSONParse%\":[\"JSON\",\"parse\"],\"%JSONStringify%\":[\"JSON\",\"stringify\"],\"%MapPrototype%\":[\"Map\",\"prototype\"],\"%NumberPrototype%\":[\"Number\",\"prototype\"],\"%ObjectPrototype%\":[\"Object\",\"prototype\"],\"%ObjProto_toString%\":[\"Object\",\"prototype\",\"toString\"],\"%ObjProto_valueOf%\":[\"Object\",\"prototype\",\"valueOf\"],\"%PromisePrototype%\":[\"Promise\",\"prototype\"],\"%PromiseProto_then%\":[\"Promise\",\"prototype\",\"then\"],\"%Promise_all%\":[\"Promise\",\"all\"],\"%Promise_reject%\":[\"Promise\",\"reject\"],\"%Promise_resolve%\":[\"Promise\",\"resolve\"],\"%RangeErrorPrototype%\":[\"RangeError\",\"prototype\"],\"%ReferenceErrorPrototype%\":[\"ReferenceError\",\"prototype\"],\"%RegExpPrototype%\":[\"RegExp\",\"prototype\"],\"%SetPrototype%\":[\"Set\",\"prototype\"],\"%SharedArrayBufferPrototype%\":[\"SharedArrayBuffer\",\"prototype\"],\"%StringPrototype%\":[\"String\",\"prototype\"],\"%SymbolPrototype%\":[\"Symbol\",\"prototype\"],\"%SyntaxErrorPrototype%\":[\"SyntaxError\",\"prototype\"],\"%TypedArrayPrototype%\":[\"TypedArray\",\"prototype\"],\"%TypeErrorPrototype%\":[\"TypeError\",\"prototype\"],\"%Uint8ArrayPrototype%\":[\"Uint8Array\",\"prototype\"],\"%Uint8ClampedArrayPrototype%\":[\"Uint8ClampedArray\",\"prototype\"],\"%Uint16ArrayPrototype%\":[\"Uint16Array\",\"prototype\"],\"%Uint32ArrayPrototype%\":[\"Uint32Array\",\"prototype\"],\"%URIErrorPrototype%\":[\"URIError\",\"prototype\"],\"%WeakMapPrototype%\":[\"WeakMap\",\"prototype\"],\"%WeakSetPrototype%\":[\"WeakSet\",\"prototype\"]},b=r(45),v=r(144),w=b.call(Function.call,Array.prototype.concat),x=b.call(Function.apply,Array.prototype.splice),_=b.call(Function.call,String.prototype.replace),S=b.call(Function.call,String.prototype.slice),A=b.call(Function.call,RegExp.prototype.exec),E=/[^%.[\\\\]]+|\\\\[(?:(-?\\\\d+(?:\\\\.\\\\d+)?)|([\"\\'])((?:(?!\\\\2)[^\\\\\\\\]|\\\\\\\\.)*?)\\\\2)\\\\]|(?=(?:\\\\.|\\\\[\\\\])(?:\\\\.|\\\\[\\\\]|%$))/g,k=/\\\\\\\\(\\\\\\\\)?/g,T=function(t){var e=S(t,0,1),r=S(t,-1);if(\"%\"===e&&\"%\"!==r)throw new n(\"invalid intrinsic syntax, expected closing `%`\");if(\"%\"===r&&\"%\"!==e)throw new n(\"invalid intrinsic syntax, expected opening `%`\");var i=[];return _(t,E,(function(t,e,r,n){i[i.length]=r?_(n,k,\"$1\"):e||t})),i},C=function(t,e){var r,i=t;if(v(m,i)&&(i=\"%\"+(r=m[i])[0]+\"%\"),v(y,i)){var a=y[i];if(a===d&&(a=function t(e){var r;if(\"%AsyncFunction%\"===e)r=s(\"async function () {}\");else if(\"%GeneratorFunction%\"===e)r=s(\"function* () {}\");else if(\"%AsyncGeneratorFunction%\"===e)r=s(\"async function* () {}\");else if(\"%AsyncGenerator%\"===e){var n=t(\"%AsyncGeneratorFunction%\");n&&(r=n.prototype)}else if(\"%AsyncIteratorPrototype%\"===e){var i=t(\"%AsyncGenerator%\");i&&h&&(r=h(i.prototype))}return y[e]=r,r}(i)),void 0===a&&!e)throw new o(\"intrinsic \"+t+\" exists, but is not available. Please file an issue!\");return{alias:r,name:i,value:a}}throw new n(\"intrinsic \"+t+\" does not exist!\")};t.exports=function(t,e){if(\"string\"!=typeof t||0===t.length)throw new o(\"intrinsic name must be a non-empty string\");if(arguments.length>1&&\"boolean\"!=typeof e)throw new o(\\'\"allowMissing\" argument must be a boolean\\');if(null===A(/^%?[^%]*%?$/,t))throw new n(\"`%` may not be present anywhere but at the beginning and end of the intrinsic name\");var r=T(t),i=r.length>0?r[0]:\"\",s=C(\"%\"+i+\"%\",e),u=s.name,c=s.value,l=!1,f=s.alias;f&&(i=f[0],x(r,w([0,1],f)));for(var h=1,d=!0;h=r.length){var b=a(c,p);c=(d=!!b)&&\"get\"in b&&!(\"originalValue\"in b.get)?b.get:c[p]}else d=v(c,p),c=c[p];d&&!l&&(y[u]=c)}}return c}},function(t,e,r){\"use strict\";var n=r(143);t.exports=Function.prototype.bind||n},function(t,e,r){\"use strict\";var n=String.prototype.replace,i=/%20/g,o=\"RFC1738\",s=\"RFC3986\";t.exports={default:s,formatters:{RFC1738:function(t){return n.call(t,i,\"+\")},RFC3986:function(t){return String(t)}},RFC1738:o,RFC3986:s}},function(t,e,r){\"use strict\";const n=r(5),i=r(11),o=r(48),s=r(8);function a(t,e,r=\"1\"){if(i(t))return\"0\";let a=t,u=t;for(;\"<\"===n(u,e);)u=s(u,r),a=o(a,u);return a}t.exports=a,t.exports.default=a},function(t,e,r){\"use strict\";const{MAX_SAFE_INTEGER_LENGTH:n}=r(30);function i(t,e){if(\"0\"===t||\"0\"===e)return\"0\";const r=t.indexOf(\".\"),i=e.indexOf(\".\"),o=(-1===r?t.length:r)+(-1===i?e.length:i),s=(-1===r?0:t.length-1-r)+(-1===i?0:e.length-1-i);if(0===s&&o=0;){const t=h,e=h-=15,r=a.substring(e,t);f.push([Number(r),r.length])}const d=[],p=[];for(let t=0,e=l-1;e>=0;e--,t++){const r=u[e],n=Number(r);let i=0,o=\"\";const s=f.length-1;f.forEach(([t,e],r)=>{let a=(i+n*t).toString();const u=a.length;if(u>e&&r!==s){const t=-1*e;o=a.slice(t)+o,i=Number(a.slice(0,t))}else{const t=e-u;for(let e=0;eNumber(t)),o.length])}const y=d.length,g=p[p.length-1][1]+y;let m=\"\",b=0;for(let t=0;t=0&&(e+=r[o])}e>=10?(e=e.toString(),m=e[e.length-1]+m,b=Number(e.slice(0,-1))):(m=e+m,b=0)}if(0===s)m=m.replace(/^0+/,\"\");else{const t=m.length-s;m=m.substring(0,t)+\".\"+m.substring(t),m=m.replace(/^0+/,\"\"),m=m.replace(/\\\\.?0+$/,\"\"),\".\"===m[0]&&(m=\"0\"+m)}return m}t.exports=i,t.exports.default=i},function(t,e,r){\"use strict\";const n=r(6),i=r(155),o=[\"5\",\"6\",\"7\",\"8\",\"9\"];function s(t){if(t.match(/\\\\.9+$/))return n(i(t),\"1\");\"+\"===t[0]&&(t=t.substring(1));const e=t.length;let r=\"\";const s=t[t.length-1];if(o.includes(s)){let n;for(n=e-2;n>=0;n--){const e=t[n];if(\".\"===e||\"-\"===e)continue;const i=Number(e)+1;if(10!==i){r=i+r;break}r=\"0\"+r}n>0&&(r=t.substring(0,n)+r)}else r=t.substring(0,e-1);return\".\"===r[r.length-1]&&(r=r.substring(0,r.length-1)),r.indexOf(\".\")>-1&&(r=r.replace(/0+$/,\"\")),r}t.exports=s,t.exports.default=s},function(t,e,r){\"use strict\";function n(t){return\"-\"===t[0]?\"-\":\"+\"}t.exports=n,t.exports.default=n},function(t,e,r){\"use strict\";const n=r(0);function i(t){const e=(t=n(t)).indexOf(\".\");return-1===e?\"0\":(t.length-e-1).toString()}t.exports=i,t.exports.default=i},function(t,e,r){\"use strict\";function n(t){return t.includes(\"i\")}t.exports=n,t.exports.default=n},function(t,e,r){\"use strict\";const n=r(79);function i(){const t=Array.from(arguments),e=\"object\"==typeof t[t.length-1]?t[t.length-1]:void 0,r=Array.isArray(t[0])?t[0]:e?t.slice(0,t.length-1):t;return n(r,e)}t.exports=i,t.exports.default=i},function(t,e,r){\"use strict\";const n=r(17);function i(t,e){const r=Number(e);let i=t;for(let e=1;et.type===c.a.internalError).map(t=>t.error);return Object.assign(t,{[u.a]:i,[u.b]:r,[u.c]:n,[u.e]:e})}function m(t,e){return f(this,void 0,void 0,(function*(){d(\"Initializing new thread\");const r=e&&e.timeout?e.timeout:y,n=(yield function(t,e,r){return f(this,void 0,void 0,(function*(){let n;const i=new Promise((t,i)=>{n=setTimeout(()=>i(Error(r)),e)}),o=yield Promise.race([t,i]);return clearTimeout(n),o}))}(function(t){return new Promise((e,r)=>{const n=i=>{var o;h(\"Message from worker before finishing initialization:\",i.data),(o=i.data)&&\"init\"===o.type?(t.removeEventListener(\"message\",n),e(i.data)):(t=>t&&\"uncaughtError\"===t.type)(i.data)&&(t.removeEventListener(\"message\",n),r(Object(s.a)(i.data.error)))};t.addEventListener(\"message\",n)})}(t),r,`Timeout: Did not receive an init message from worker after ${r}ms. Make sure the worker calls expose().`)).exposed,{termination:i,terminate:u}=function(t){const[e,r]=Object(a.a)();return{terminate:()=>f(this,void 0,void 0,(function*(){p(\"Terminating worker\"),yield t.terminate(),r()})),termination:e}}(t),m=function(t,e){return new o.a(r=>{const n=t=>{const e={type:c.a.message,data:t.data};r.next(e)},i=t=>{p(\"Unhandled promise rejection event in thread:\",t);const e={type:c.a.internalError,error:Error(t.reason)};r.next(e)};t.addEventListener(\"message\",n),t.addEventListener(\"unhandledrejection\",i),e.then(()=>{const e={type:c.a.termination};t.removeEventListener(\"message\",n),t.removeEventListener(\"unhandledrejection\",i),r.next(e),r.complete()})})}(t,i);if(\"function\"===n.type){return g(Object(l.a)(t),t,m,u)}if(\"module\"===n.type){return g(Object(l.b)(t,n.methods),t,m,u)}{const t=n.type;throw Error(\"Worker init message states unexpected type of expose(): \"+t)}}))}}).call(this,r(7))},function(t,e,r){\"use strict\";r.d(e,\"a\",(function(){return g}));var n=r(12),i=r.n(n),o=r(102),s=r(197),a=r(26);function u(t){return Promise.all(t.map(t=>{const e=t=>({status:\"fulfilled\",value:t}),r=t=>({status:\"rejected\",reason:t}),n=Promise.resolve(t);try{return n.then(e,r)}catch(t){return Promise.reject(t)}}))}var c,l=r(19);!function(t){t.initialized=\"initialized\",t.taskCanceled=\"taskCanceled\",t.taskCompleted=\"taskCompleted\",t.taskFailed=\"taskFailed\",t.taskQueued=\"taskQueued\",t.taskQueueDrained=\"taskQueueDrained\",t.taskStart=\"taskStart\",t.terminated=\"terminated\"}(c||(c={}));var f=r(24),h=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))};let d=1;class p{constructor(t,e){this.eventSubject=new o.a,this.initErrors=[],this.isClosing=!1,this.nextTaskID=1,this.taskQueue=[];const r=\"number\"==typeof e?{size:e}:e||{},{size:n=l.a}=r;this.debug=i()(\"threads:pool:\"+(r.name||String(d++)).replace(/\\\\W/g,\" \").trim().replace(/\\\\s+/g,\"-\")),this.options=r,this.workers=function(t,e){return function(t){const e=[];for(let r=0;r({init:t(),runningTasks:[]}))}(t,n),this.eventObservable=Object(s.a)(a.a.from(this.eventSubject)),Promise.all(this.workers.map(t=>t.init)).then(()=>this.eventSubject.next({type:c.initialized,size:this.workers.length}),t=>{this.debug(\"Error while initializing pool worker:\",t),this.eventSubject.error(t),this.initErrors.push(t)})}findIdlingWorker(){const{concurrency:t=1}=this.options;return this.workers.find(e=>e.runningTasks.lengthh(this,void 0,void 0,(function*(){var n;yield(n=0,new Promise(t=>setTimeout(t,n)));try{yield this.runPoolTask(t,e)}finally{t.runningTasks=t.runningTasks.filter(t=>t!==r),this.isClosing||this.scheduleWork()}})))();t.runningTasks.push(r)}))}scheduleWork(){this.debug(\"Attempt de-queueing a task in order to run it...\");const t=this.findIdlingWorker();if(!t)return;const e=this.taskQueue.shift();if(!e)return this.debug(\"Task queue is empty\"),void this.eventSubject.next({type:c.taskQueueDrained});this.run(t,e)}taskCompletion(t){return new Promise((e,r)=>{const n=this.events().subscribe(i=>{i.type===c.taskCompleted&&i.taskID===t?(n.unsubscribe(),e(i.returnValue)):i.type===c.taskFailed&&i.taskID===t?(n.unsubscribe(),r(i.error)):i.type===c.terminated&&(n.unsubscribe(),r(Error(\"Pool has been terminated before task was run.\")))})})}settled(t=!1){return h(this,void 0,void 0,(function*(){const e=()=>{return t=this.workers,e=t=>t.runningTasks,t.reduce((t,r)=>[...t,...e(r)],[]);var t,e},r=[],n=this.eventObservable.subscribe(t=>{t.type===c.taskFailed&&r.push(t.error)});return this.initErrors.length>0?Promise.reject(this.initErrors[0]):t&&0===this.taskQueue.length?(yield u(e()),r):(yield new Promise((t,e)=>{const r=this.eventObservable.subscribe({next(e){e.type===c.taskQueueDrained&&(r.unsubscribe(),t(void 0))},error:e})}),yield u(e()),n.unsubscribe(),r)}))}completed(t=!1){return h(this,void 0,void 0,(function*(){const e=this.settled(t),r=new Promise((t,r)=>{const n=this.eventObservable.subscribe({next(i){i.type===c.taskQueueDrained?(n.unsubscribe(),t(e)):i.type===c.taskFailed&&(n.unsubscribe(),r(i.error))},error:r})}),n=yield Promise.race([e,r]);if(n.length>0)throw n[0]}))}events(){return this.eventObservable}queue(t){const{maxQueuedJobs:e=1/0}=this.options;if(this.isClosing)throw Error(\"Cannot schedule pool tasks after terminate() has been called.\");if(this.initErrors.length>0)throw this.initErrors[0];const r=this.nextTaskID++,n=this.taskCompletion(r);n.catch(t=>{this.debug(`Task #${r} errored:`,t)});const i={id:r,run:t,cancel:()=>{-1!==this.taskQueue.indexOf(i)&&(this.taskQueue=this.taskQueue.filter(t=>t!==i),this.eventSubject.next({type:c.taskCanceled,taskID:i.id}))},then:n.then.bind(n)};if(this.taskQueue.length>=e)throw Error(\"Maximum number of pool tasks queued. Refusing to queue another one.\\\\nThis usually happens for one of two reasons: We are either at peak workload right now or some tasks just won\\'t finish, thus blocking the pool.\");return this.debug(`Queueing task #${i.id}...`),this.taskQueue.push(i),this.eventSubject.next({type:c.taskQueued,taskID:i.id}),this.scheduleWork(),i}terminate(t){return h(this,void 0,void 0,(function*(){this.isClosing=!0,t||(yield this.completed(!0)),this.eventSubject.next({type:c.terminated,remainingQueue:[...this.taskQueue]}),this.eventSubject.complete(),yield Promise.all(this.workers.map(t=>h(this,void 0,void 0,(function*(){return f.a.terminate(yield t.init)}))))}))}}function y(t,e){return new p(t,e)}p.EventType=c,y.EventType=c;const g=y},function(t,e,r){\"use strict\";r.d(e,\"a\",(function(){return b})),r.d(e,\"b\",(function(){return v}));var n=r(12),i=r.n(n),o=r(26),s=r(197),a=r(13);const u=()=>{},c=t=>t,l=t=>Promise.resolve().then(t);function f(t){throw t}class h extends o.a{constructor(t){super(e=>{const r=this,n=Object.assign(Object.assign({},e),{complete(){e.complete(),r.onCompletion()},error(t){e.error(t),r.onError(t)},next(t){e.next(t),r.onNext(t)}});try{return this.initHasRun=!0,t(n)}catch(t){n.error(t)}}),this.initHasRun=!1,this.fulfillmentCallbacks=[],this.rejectionCallbacks=[],this.firstValueSet=!1,this.state=\"pending\"}onNext(t){this.firstValueSet||(this.firstValue=t,this.firstValueSet=!0)}onError(t){this.state=\"rejected\",this.rejection=t;for(const e of this.rejectionCallbacks)l(()=>e(t))}onCompletion(){this.state=\"fulfilled\";for(const t of this.fulfillmentCallbacks)l(()=>t(this.firstValue))}then(t,e){const r=t||c,n=e||f;let i=!1;return new Promise((t,e)=>{const o=r=>{if(!i){i=!0;try{t(n(r))}catch(t){e(t)}}};return this.initHasRun||this.subscribe({error:o}),\"fulfilled\"===this.state?t(r(this.firstValue)):\"rejected\"===this.state?(i=!0,t(n(this.rejection))):(this.fulfillmentCallbacks.push(e=>{try{t(r(e))}catch(t){o(t)}}),void this.rejectionCallbacks.push(o))})}catch(t){return this.then(void 0,t)}finally(t){const e=t||u;return this.then(t=>(e(),t),()=>e())}static from(t){return function(t){return t&&\"function\"==typeof t.then}(t)?new h(e=>{t.then(t=>{e.next(t),e.complete()},t=>{e.error(t)})}):super.from(t)}}var d=r(104),p=r(20);const y=i()(\"threads:master:messages\");let g=1;function m(t,e){return new o.a(r=>{let n;const i=o=>{var s;if(y(\"Message from worker:\",o.data),o.data&&o.data.uid===e)if((s=o.data)&&s.type===p.b.running)n=o.data.resultType;else if((t=>t&&t.type===p.b.result)(o.data))\"promise\"===n?(void 0!==o.data.payload&&r.next(Object(a.a)(o.data.payload)),r.complete(),t.removeEventListener(\"message\",i)):(o.data.payload&&r.next(Object(a.a)(o.data.payload)),o.data.complete&&(r.complete(),t.removeEventListener(\"message\",i)));else if((t=>t&&t.type===p.b.error)(o.data)){const e=Object(a.a)(o.data.error);r.error(e),t.removeEventListener(\"message\",i)}};return t.addEventListener(\"message\",i),()=>{if(\"observable\"===n||!n){const r={type:p.a.cancel,uid:e};t.postMessage(r)}t.removeEventListener(\"message\",i)}})}function b(t,e){return(...r)=>{const n=g++,{args:i,transferables:o}=function(t){if(0===t.length)return{args:[],transferables:[]};const e=[],r=[];for(const n of t)Object(d.a)(n)?(e.push(Object(a.b)(n.send)),r.push(...n.transferables)):e.push(Object(a.b)(n));return{args:e,transferables:0===r.length?r:(n=r,Array.from(new Set(n)))};var n}(r),u={type:p.a.run,uid:n,method:e,args:i};y(\"Sending command to run function to worker:\",u);try{t.postMessage(u,o)}catch(t){return h.from(Promise.reject(t))}return h.from(Object(s.a)(m(t,n)))}}function v(t,e){const r={};for(const n of e)r[n]=b(t,n);return r}},function(t,e,r){\"use strict\";(function(e,n){var i=r(28);t.exports=v;var o,s=r(61);v.ReadableState=b;r(62).EventEmitter;var a=function(t,e){return t.listeners(e).length},u=r(63),c=r(43).Buffer,l=(void 0!==e?e:\"undefined\"!=typeof window?window:\"undefined\"!=typeof self?self:{}).Uint8Array||function(){};var f=Object.create(r(21));f.inherits=r(10);var h=r(110),d=void 0;d=h&&h.debuglog?h.debuglog(\"stream\"):function(){};var p,y=r(111),g=r(64);f.inherits(v,u);var m=[\"error\",\"close\",\"destroy\",\"pause\",\"resume\"];function b(t,e){t=t||{};var n=e instanceof(o=o||r(14));this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var i=t.highWaterMark,s=t.readableHighWaterMark,a=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(s||0===s)?s:a,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new y,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||\"utf8\",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(p||(p=r(66).StringDecoder),this.decoder=new p(t.encoding),this.encoding=t.encoding)}function v(t){if(o=o||r(14),!(this instanceof v))return new v(t);this._readableState=new b(t,this),this.readable=!0,t&&(\"function\"==typeof t.read&&(this._read=t.read),\"function\"==typeof t.destroy&&(this._destroy=t.destroy)),u.call(this)}function w(t,e,r,n,i){var o,s=t._readableState;null===e?(s.reading=!1,function(t,e){if(e.ended)return;if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,S(t)}(t,s)):(i||(o=function(t,e){var r;n=e,c.isBuffer(n)||n instanceof l||\"string\"==typeof e||void 0===e||t.objectMode||(r=new TypeError(\"Invalid non-string/buffer chunk\"));var n;return r}(s,e)),o?t.emit(\"error\",o):s.objectMode||e&&e.length>0?(\"string\"==typeof e||s.objectMode||Object.getPrototypeOf(e)===c.prototype||(e=function(t){return c.from(t)}(e)),n?s.endEmitted?t.emit(\"error\",new Error(\"stream.unshift() after end event\")):x(t,s,e,!0):s.ended?t.emit(\"error\",new Error(\"stream.push() after EOF\")):(s.reading=!1,s.decoder&&!r?(e=s.decoder.write(e),s.objectMode||0!==e.length?x(t,s,e,!1):E(t,s)):x(t,s,e,!1))):n||(s.reading=!1));return function(t){return!t.ended&&(t.needReadable||t.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=8388608?t=8388608:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function S(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(d(\"emitReadable\",e.flowing),e.emittedReadable=!0,e.sync?i.nextTick(A,t):A(t))}function A(t){d(\"emit readable\"),t.emit(\"readable\"),O(t)}function E(t,e){e.readingMore||(e.readingMore=!0,i.nextTick(k,t,e))}function k(t,e){for(var r=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length=e.length?(r=e.decoder?e.buffer.join(\"\"):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):r=function(t,e,r){var n;to.length?o.length:t;if(s===o.length?i+=o:i+=o.slice(0,t),0===(t-=s)){s===o.length?(++n,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=o.slice(s));break}++n}return e.length-=n,i}(t,e):function(t,e){var r=c.allocUnsafe(t),n=e.head,i=1;n.data.copy(r),t-=n.data.length;for(;n=n.next;){var o=n.data,s=t>o.length?o.length:t;if(o.copy(r,r.length-t,0,s),0===(t-=s)){s===o.length?(++i,n.next?e.head=n.next:e.head=e.tail=null):(e.head=n,n.data=o.slice(s));break}++i}return e.length-=i,r}(t,e);return n}(t,e.buffer,e.decoder),r);var r}function P(t){var e=t._readableState;if(e.length>0)throw new Error(\\'\"endReadable()\" called on non-empty stream\\');e.endEmitted||(e.ended=!0,i.nextTick(R,e,t))}function R(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit(\"end\"))}function j(t,e){for(var r=0,n=t.length;r=e.highWaterMark||e.ended))return d(\"read: emitReadable\",e.length,e.ended),0===e.length&&e.ended?P(this):S(this),null;if(0===(t=_(t,e))&&e.ended)return 0===e.length&&P(this),null;var n,i=e.needReadable;return d(\"need readable\",i),(0===e.length||e.length-t0?I(t,e):null)?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&P(this)),null!==n&&this.emit(\"data\",n),n},v.prototype._read=function(t){this.emit(\"error\",new Error(\"_read() is not implemented\"))},v.prototype.pipe=function(t,e){var r=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=t;break;case 1:o.pipes=[o.pipes,t];break;default:o.pipes.push(t)}o.pipesCount+=1,d(\"pipe count=%d opts=%j\",o.pipesCount,e);var u=(!e||!1!==e.end)&&t!==n.stdout&&t!==n.stderr?l:v;function c(e,n){d(\"onunpipe\"),e===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,d(\"cleanup\"),t.removeListener(\"close\",m),t.removeListener(\"finish\",b),t.removeListener(\"drain\",f),t.removeListener(\"error\",g),t.removeListener(\"unpipe\",c),r.removeListener(\"end\",l),r.removeListener(\"end\",v),r.removeListener(\"data\",y),h=!0,!o.awaitDrain||t._writableState&&!t._writableState.needDrain||f())}function l(){d(\"onend\"),t.end()}o.endEmitted?i.nextTick(u):r.once(\"end\",u),t.on(\"unpipe\",c);var f=function(t){return function(){var e=t._readableState;d(\"pipeOnDrain\",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&a(t,\"data\")&&(e.flowing=!0,O(t))}}(r);t.on(\"drain\",f);var h=!1;var p=!1;function y(e){d(\"ondata\"),p=!1,!1!==t.write(e)||p||((1===o.pipesCount&&o.pipes===t||o.pipesCount>1&&-1!==j(o.pipes,t))&&!h&&(d(\"false write response, pause\",o.awaitDrain),o.awaitDrain++,p=!0),r.pause())}function g(e){d(\"onerror\",e),v(),t.removeListener(\"error\",g),0===a(t,\"error\")&&t.emit(\"error\",e)}function m(){t.removeListener(\"finish\",b),v()}function b(){d(\"onfinish\"),t.removeListener(\"close\",m),v()}function v(){d(\"unpipe\"),r.unpipe(t)}return r.on(\"data\",y),function(t,e,r){if(\"function\"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?s(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,\"error\",g),t.once(\"close\",m),t.once(\"finish\",b),t.emit(\"pipe\",r),o.flowing||(d(\"pipe resume\"),r.resume()),t},v.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit(\"unpipe\",this,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o0&&s.length>i&&!s.warned){s.warned=!0;var u=new Error(\"Possible EventEmitter memory leak detected. \"+s.length+\" \"+String(e)+\" listeners added. Use emitter.setMaxListeners() to increase limit\");u.name=\"MaxListenersExceededWarning\",u.emitter=t,u.type=e,u.count=s.length,a=u,console&&console.warn&&console.warn(a)}return t}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=h.bind(n);return i.listener=r,n.wrapFn=i,i}function p(t,e,r){var n=t._events;if(void 0===n)return[];var i=n[e];return void 0===i?[]:\"function\"==typeof i?r?[i.listener||i]:[i]:r?function(t){for(var e=new Array(t.length),r=0;r0&&(s=e[0]),s instanceof Error)throw s;var a=new Error(\"Unhandled error.\"+(s?\" (\"+s.message+\")\":\"\"));throw a.context=s,a}var u=i[t];if(void 0===u)return!1;if(\"function\"==typeof u)o(u,this,e);else{var c=u.length,l=g(u,c);for(r=0;r=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1=0;n--)this.removeListener(t,e[n]);return this},a.prototype.listeners=function(t){return p(this,t,!0)},a.prototype.rawListeners=function(t){return p(this,t,!1)},a.listenerCount=function(t,e){return\"function\"==typeof t.listenerCount?t.listenerCount(e):y.call(t,e)},a.prototype.listenerCount=y,a.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},function(t,e,r){t.exports=r(62).EventEmitter},function(t,e,r){\"use strict\";var n=r(28);function i(t,e){t.emit(\"error\",e)}t.exports={destroy:function(t,e){var r=this,o=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return o||s?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,n.nextTick(i,this,t)):n.nextTick(i,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!e&&t?r._writableState?r._writableState.errorEmitted||(r._writableState.errorEmitted=!0,n.nextTick(i,r,t)):n.nextTick(i,r,t):e&&e(t)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},function(t,e,r){\"use strict\";(function(e,n,i){var o=r(28);function s(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,r){var n=t.entry;t.entry=null;for(;n;){var i=n.callback;e.pendingcb--,i(r),n=n.next}e.corkedRequestsFree.next=t}(e,t)}}t.exports=b;var a,u=!e.browser&&[\"v0.10\",\"v0.9.\"].indexOf(e.version.slice(0,5))>-1?n:o.nextTick;b.WritableState=m;var c=Object.create(r(21));c.inherits=r(10);var l={deprecate:r(115)},f=r(63),h=r(43).Buffer,d=(void 0!==i?i:\"undefined\"!=typeof window?window:\"undefined\"!=typeof self?self:{}).Uint8Array||function(){};var p,y=r(64);function g(){}function m(t,e){a=a||r(14),t=t||{};var n=e instanceof a;this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var i=t.highWaterMark,c=t.writableHighWaterMark,l=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(c||0===c)?c:l,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var f=!1===t.decodeStrings;this.decodeStrings=!f,this.defaultEncoding=t.defaultEncoding||\"utf8\",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,n=r.sync,i=r.writecb;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),e)!function(t,e,r,n,i){--e.pendingcb,r?(o.nextTick(i,n),o.nextTick(A,t,e),t._writableState.errorEmitted=!0,t.emit(\"error\",n)):(i(n),t._writableState.errorEmitted=!0,t.emit(\"error\",n),A(t,e))}(t,r,n,e,i);else{var s=_(r);s||r.corked||r.bufferProcessing||!r.bufferedRequest||x(t,r),n?u(w,t,r,s,i):w(t,r,s,i)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new s(this)}function b(t){if(a=a||r(14),!(p.call(b,this)||this instanceof a))return new b(t);this._writableState=new m(t,this),this.writable=!0,t&&(\"function\"==typeof t.write&&(this._write=t.write),\"function\"==typeof t.writev&&(this._writev=t.writev),\"function\"==typeof t.destroy&&(this._destroy=t.destroy),\"function\"==typeof t.final&&(this._final=t.final)),f.call(this)}function v(t,e,r,n,i,o,s){e.writelen=n,e.writecb=s,e.writing=!0,e.sync=!0,r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function w(t,e,r,n){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit(\"drain\"))}(t,e),e.pendingcb--,n(),A(t,e)}function x(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,i=new Array(n),o=e.corkedRequestsFree;o.entry=r;for(var a=0,u=!0;r;)i[a]=r,r.isBuf||(u=!1),r=r.next,a+=1;i.allBuffers=u,v(t,e,!0,e.length,i,\"\",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new s(e),e.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,l=r.encoding,f=r.callback;if(v(t,e,!1,e.objectMode?1:c.length,c,l,f),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function _(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function S(t,e){t._final((function(r){e.pendingcb--,r&&t.emit(\"error\",r),e.prefinished=!0,t.emit(\"prefinish\"),A(t,e)}))}function A(t,e){var r=_(e);return r&&(!function(t,e){e.prefinished||e.finalCalled||(\"function\"==typeof t._final?(e.pendingcb++,e.finalCalled=!0,o.nextTick(S,t,e)):(e.prefinished=!0,t.emit(\"prefinish\")))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit(\"finish\"))),r}c.inherits(b,f),m.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(m.prototype,\"buffer\",{get:l.deprecate((function(){return this.getBuffer()}),\"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.\",\"DEP0003\")})}catch(t){}}(),\"function\"==typeof Symbol&&Symbol.hasInstance&&\"function\"==typeof Function.prototype[Symbol.hasInstance]?(p=Function.prototype[Symbol.hasInstance],Object.defineProperty(b,Symbol.hasInstance,{value:function(t){return!!p.call(this,t)||this===b&&(t&&t._writableState instanceof m)}})):p=function(t){return t instanceof this},b.prototype.pipe=function(){this.emit(\"error\",new Error(\"Cannot pipe, not readable\"))},b.prototype.write=function(t,e,r){var n,i=this._writableState,s=!1,a=!i.objectMode&&(n=t,h.isBuffer(n)||n instanceof d);return a&&!h.isBuffer(t)&&(t=function(t){return h.from(t)}(t)),\"function\"==typeof e&&(r=e,e=null),a?e=\"buffer\":e||(e=i.defaultEncoding),\"function\"!=typeof r&&(r=g),i.ended?function(t,e){var r=new Error(\"write after end\");t.emit(\"error\",r),o.nextTick(e,r)}(this,r):(a||function(t,e,r,n){var i=!0,s=!1;return null===r?s=new TypeError(\"May not write null values to stream\"):\"string\"==typeof r||void 0===r||e.objectMode||(s=new TypeError(\"Invalid non-string/buffer chunk\")),s&&(t.emit(\"error\",s),o.nextTick(n,s),i=!1),i}(this,i,t,r))&&(i.pendingcb++,s=function(t,e,r,n,i,o){if(!r){var s=function(t,e,r){t.objectMode||!1===t.decodeStrings||\"string\"!=typeof e||(e=h.from(e,r));return e}(e,n,i);n!==s&&(r=!0,i=\"buffer\",n=s)}var a=e.objectMode?1:n.length;e.length+=a;var u=e.length-1))throw new TypeError(\"Unknown encoding: \"+t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(b.prototype,\"writableHighWaterMark\",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),b.prototype._write=function(t,e,r){r(new Error(\"_write() is not implemented\"))},b.prototype._writev=null,b.prototype.end=function(t,e,r){var n=this._writableState;\"function\"==typeof t?(r=t,t=null,e=null):\"function\"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||function(t,e,r){e.ending=!0,A(t,e),r&&(e.finished?o.nextTick(r):t.once(\"finish\",r));e.ended=!0,t.writable=!1}(this,n,r)},Object.defineProperty(b.prototype,\"destroyed\",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),b.prototype.destroy=y.destroy,b.prototype._undestroy=y.undestroy,b.prototype._destroy=function(t,e){this.end(),e(t)}}).call(this,r(7),r(113).setImmediate,r(3))},function(t,e,r){\"use strict\";var n=r(116).Buffer,i=n.isEncoding||function(t){switch((t=\"\"+t)&&t.toLowerCase()){case\"hex\":case\"utf8\":case\"utf-8\":case\"ascii\":case\"binary\":case\"base64\":case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":case\"raw\":return!0;default:return!1}};function o(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return\"utf8\";for(var e;;)switch(t){case\"utf8\":case\"utf-8\":return\"utf8\";case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return\"utf16le\";case\"latin1\":case\"binary\":return\"latin1\";case\"base64\":case\"ascii\":case\"hex\":return t;default:if(e)return;t=(\"\"+t).toLowerCase(),e=!0}}(t);if(\"string\"!=typeof e&&(n.isEncoding===i||!i(t)))throw new Error(\"Unknown encoding: \"+t);return e||t}(t),this.encoding){case\"utf16le\":this.text=u,this.end=c,e=4;break;case\"utf8\":this.fillLast=a,e=4;break;case\"base64\":this.text=l,this.end=f,e=3;break;default:return this.write=h,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(e)}function s(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:-1}function a(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!=(192&e[0]))return t.lastNeed=0,\"�\".repeat(r);if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,\"�\".repeat(r+1);if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,\"�\".repeat(r+2)}}(this,t,e);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function u(t,e){if((t.length-e)%2==0){var r=t.toString(\"utf16le\",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString(\"utf16le\",e,t.length-1)}function c(t){var e=t&&t.length?this.write(t):\"\";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString(\"utf16le\",0,r)}return e}function l(t,e){var r=(t.length-e)%3;return 0===r?t.toString(\"base64\",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString(\"base64\",e,t.length-r))}function f(t){var e=t&&t.length?this.write(t):\"\";return this.lastNeed?e+this.lastChar.toString(\"base64\",0,3-this.lastNeed):e}function h(t){return t.toString(this.encoding)}function d(t){return t&&t.length?this.write(t):\"\"}e.StringDecoder=o,o.prototype.write=function(t){if(0===t.length)return\"\";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return\"\";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0)return i>0&&(t.lastNeed=i-1),i;if(--n=0)return i>0&&(t.lastNeed=i-2),i;if(--n=0)return i>0&&(2===i?i=0:t.lastNeed=i-3),i;return 0}(this,t,e);if(!this.lastNeed)return t.toString(\"utf8\",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString(\"utf8\",e,n)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},function(t,e,r){\"use strict\";t.exports=s;var n=r(14),i=Object.create(r(21));function o(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(!n)return this.emit(\"error\",new Error(\"write callback called multiple times\"));r.writechunk=null,r.writecb=null,null!=e&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.lengthObject(o.a)(r),e)}async decode(t,e){return new Promise((r,n)=>{this.pool.queue(async i=>{try{const n=await i(t,e);r(n)}catch(t){n(t)}})})}destroy(){this.pool.terminate(!0)}}}).call(this,r(128))},function(t,e,r){(function(t){e.fetch=a(t.fetch)&&a(t.ReadableStream),e.writableStream=a(t.WritableStream),e.abortController=a(t.AbortController),e.blobConstructor=!1;try{new Blob([new ArrayBuffer(1)]),e.blobConstructor=!0}catch(t){}var r;function n(){if(void 0!==r)return r;if(t.XMLHttpRequest){r=new t.XMLHttpRequest;try{r.open(\"GET\",t.XDomainRequest?\"/\":\"https://example.com\")}catch(t){r=null}}else r=null;return r}function i(t){var e=n();if(!e)return!1;try{return e.responseType=t,e.responseType===t}catch(t){}return!1}var o=void 0!==t.ArrayBuffer,s=o&&a(t.ArrayBuffer.prototype.slice);function a(t){return\"function\"==typeof t}e.arraybuffer=e.fetch||o&&i(\"arraybuffer\"),e.msstream=!e.fetch&&s&&i(\"ms-stream\"),e.mozchunkedarraybuffer=!e.fetch&&o&&i(\"moz-chunked-arraybuffer\"),e.overrideMimeType=e.fetch||!!n()&&a(n().overrideMimeType),e.vbArray=a(t.VBArray),r=null}).call(this,r(3))},function(t,e,r){(function(t,n,i){var o=r(69),s=r(10),a=r(42),u=e.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},c=e.IncomingMessage=function(e,r,s,u){var c=this;if(a.Readable.call(c),c._mode=s,c.headers={},c.rawHeaders=[],c.trailers={},c.rawTrailers=[],c.on(\"end\",(function(){t.nextTick((function(){c.emit(\"close\")}))})),\"fetch\"===s){if(c._fetchResponse=r,c.url=r.url,c.statusCode=r.status,c.statusMessage=r.statusText,r.headers.forEach((function(t,e){c.headers[e.toLowerCase()]=t,c.rawHeaders.push(e,t)})),o.writableStream){var l=new WritableStream({write:function(t){return new Promise((function(e,r){c._destroyed?r():c.push(new n(t))?e():c._resumeFetch=e}))},close:function(){i.clearTimeout(u),c._destroyed||c.push(null)},abort:function(t){c._destroyed||c.emit(\"error\",t)}});try{return void r.body.pipeTo(l).catch((function(t){i.clearTimeout(u),c._destroyed||c.emit(\"error\",t)}))}catch(t){}}var f=r.body.getReader();!function t(){f.read().then((function(e){if(!c._destroyed){if(e.done)return i.clearTimeout(u),void c.push(null);c.push(new n(e.value)),t()}})).catch((function(t){i.clearTimeout(u),c._destroyed||c.emit(\"error\",t)}))}()}else{if(c._xhr=e,c._pos=0,c.url=e.responseURL,c.statusCode=e.status,c.statusMessage=e.statusText,e.getAllResponseHeaders().split(/\\\\r?\\\\n/).forEach((function(t){var e=t.match(/^([^:]+):\\\\s*(.*)/);if(e){var r=e[1].toLowerCase();\"set-cookie\"===r?(void 0===c.headers[r]&&(c.headers[r]=[]),c.headers[r].push(e[2])):void 0!==c.headers[r]?c.headers[r]+=\", \"+e[2]:c.headers[r]=e[2],c.rawHeaders.push(e[1],e[2])}})),c._charset=\"x-user-defined\",!o.overrideMimeType){var h=c.rawHeaders[\"mime-type\"];if(h){var d=h.match(/;\\\\s*charset=([^;])(;|$)/);d&&(c._charset=d[1].toLowerCase())}c._charset||(c._charset=\"utf-8\")}}};s(c,a.Readable),c.prototype._read=function(){var t=this._resumeFetch;t&&(this._resumeFetch=null,t())},c.prototype._onXHRProgress=function(){var t=this,e=t._xhr,r=null;switch(t._mode){case\"text:vbarray\":if(e.readyState!==u.DONE)break;try{r=new i.VBArray(e.responseBody).toArray()}catch(t){}if(null!==r){t.push(new n(r));break}case\"text\":try{r=e.responseText}catch(e){t._mode=\"text:vbarray\";break}if(r.length>t._pos){var o=r.substr(t._pos);if(\"x-user-defined\"===t._charset){for(var s=new n(o.length),a=0;at._pos&&(t.push(new n(new Uint8Array(c.result.slice(t._pos)))),t._pos=c.result.byteLength)},c.onload=function(){t.push(null)},c.readAsArrayBuffer(r)}t._xhr.readyState===u.DONE&&\"ms-stream\"!==t._mode&&t.push(null)}}).call(this,r(7),r(9).Buffer,r(3))},function(t,e,r){\"use strict\";var n=r(46),i=Object.prototype.hasOwnProperty,o=Array.isArray,s=function(){for(var t=[],e=0;e<256;++e)t.push(\"%\"+((e<16?\"0\":\"\")+e.toString(16)).toUpperCase());return t}(),a=function(t,e){for(var r=e&&e.plainObjects?Object.create(null):{},n=0;n1;){var e=t.pop(),r=e.obj[e.prop];if(o(r)){for(var n=[],i=0;i=48&&l<=57||l>=65&&l<=90||l>=97&&l<=122||o===n.RFC1738&&(40===l||41===l)?u+=a.charAt(c):l<128?u+=s[l]:l<2048?u+=s[192|l>>6]+s[128|63&l]:l<55296||l>=57344?u+=s[224|l>>12]+s[128|l>>6&63]+s[128|63&l]:(c+=1,l=65536+((1023&l)<<10|1023&a.charCodeAt(c)),u+=s[240|l>>18]+s[128|l>>12&63]+s[128|l>>6&63]+s[128|63&l])}return u},isBuffer:function(t){return!(!t||\"object\"!=typeof t)&&!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},isRegExp:function(t){return\"[object RegExp]\"===Object.prototype.toString.call(t)},maybeMap:function(t,e){if(o(t)){for(var r=[],n=0;ne++t.next());return e.every(({done:t})=>t)?{done:!0}:{done:!1,value:e.map(({value:t})=>t)}}))}}},function(t,e,r){\"use strict\";function n(t){\"+\"===t[0]&&(t=t.substring(1));const e=\"-\"===t[0]?\"-\":\"\";\"-\"===e&&(t=t.substring(1));const r=t.indexOf(\"e\");if(-1===r)return e+t;let n=t.indexOf(\".\");-1===n&&(n=r);const i=Number(t.substring(r+1)),o=t.substring(0,r).replace(\".\",\"\"),s=n+i,a=o.length;if(s>=a){const t=s-a;let r=o;for(let e=0;es;e--)t+=\"0\";return t+=o,e+t}return e+o.substring(0,s)+\".\"+o.substring(s)}t.exports=n,t.exports.default=n},function(t,e,r){\"use strict\";t.exports={MAX_SAFE_INTEGER:9007199254740991}},function(t,e,r){\"use strict\";const n=r(47);function i(t){return\"0\"===t?\"1\":n(\"1\",t)}t.exports=i,t.exports.default=i},function(t,e,r){\"use strict\";const n=r(4),i=r(0),o=r(8),s=r(22);function a(t){if(-1===(t=i(t)).indexOf(\".\"))return t;const e=s(t);return t=n(t).split(\".\")[0],\"+\"===e?o(t,\"1\"):\"-\"===e?\"0\"===t||\"\"===t?\"0\":\"-\"+t:void 0}t.exports=a,t.exports.default=a},function(t,e,r){\"use strict\";const n=r(51);function i(t){const e=n(t);return[t.replace(/\\\\./g,\"\").replace(/^0/,\"\"),1+\"0\".repeat(e)]}t.exports=i,t.exports.default=i},function(t,e,r){const n=r(0),i=r(16);function o(t){if(t=n(t),!i(t))throw new Error(\"can\\'t call is_odd on decimal\");return[\"1\",\"3\",\"5\",\"7\",\"9\"].includes(t.charAt(t.length-1))}t.exports=o,t.exports.default=o},function(t,e,r){\"use strict\";const n=r(52),i=r(15),o=r(78),s=r(11),a=r(17),u=r(50);function c(t,{max_decimal_digits:e,infinity_times_zero:r=\"NaN\"}={}){const c=t.some(t=>i(t)),l=t.some(t=>s(t));if(c&&l)return r;if(c){return t.filter(t=>\"-\"===u(t)).length%2==0?\"Infinity\":\"-Infinity\"}if(l)return\"0\";const f=o(t.filter(t=>n(t)).length.toString());let h=a(t.map(t=>t.replace(/i$/,\"\")),{max_decimal_digits:e});return f&&(h+=\"i\"),h}t.exports=c,t.exports.default=c},function(t,e,r){\"use strict\";const n=r(0);function i(t){return\"-\"===(t=n(t))[0]}t.exports=i,t.exports.default=i},function(t,e,r){\"use strict\";const n=r(1),i=r(160),o=r(161);function s(t,{max_decimal_digits:e=100,fraction:r=!1}={}){if(i(t)){const[i,s]=o(t);return r?s+\"/\"+i:n(s,i,{max_decimal_digits:e})}return r?\"1/\"+t:n(\"1\",t,{max_decimal_digits:e})}t.exports=s,t.exports.default=s},function(t,e,r){\"use strict\";const n=r(0),i=r(16);function o(t){if(t=n(t),!i(t))throw new Error(\"can\\'t call is_even on decimal\");return[\"0\",\"2\",\"4\",\"6\",\"8\"].includes(t.charAt(t.length-1))}t.exports=o,t.exports.default=o},function(t,e,r){\"use strict\";const n=r(76),i=r(84),o=r(1);function s(t,e){const r=i(t);return\"0\"===r?\"0\":n(o(r,e,{max_decimal_digits:1}))}t.exports=s,t.exports.default=s},function(t,e,r){\"use strict\";const n=r(4),i=r(0);function o(t){const e=(t=n(i(t))).indexOf(\".\");return(-1===e?t.length:e).toString()}t.exports=o,t.exports.default=o},function(t,e,r){\"use strict\";const n=r(1),i=r(82),o=r(86),s=r(87);function a(t,e){const r=s(\"2\",o([\"1000\",e,e]));for(;t.endsWith(\"0\")&&e.endsWith(\"0\");)t=t.substring(0,t.length-1),e=e.substring(0,e.length-1);for(;i(t)&&i(e);)t=n(t,\"2\"),e=n(e,\"2\");let a=!0;for(;a;){a=!1;for(let i=0;i\"<\"!==n(r,t)&&\">\"!==n(r,e));let a=\"13\";for(;\">\"!==n(a,e);)/^\\\\d+5/.test(a)||/^(\\\\d)\\\\1+/.test(a)||[\"9\",\"7\",\"3\"].every(t=>!o(i(a,t)))&&r.push(a),a=s(a,\"2\");return r}t.exports=a,t.exports.default=a},function(t,e,r){\"use strict\";const n=r(6),i=r(1);function o({max_decimal_digits:t=100,steps:e=100}={}){let r=\"1\",o=\"1\";for(let s=1;s\":return\"-\"+s(t,e)}else if(r&&!a)switch(e=e.substring(1),n(t,e)){case\"=\":return\"0\";case\"<\":return\"-\"+s(e,t);case\">\":return s(t,e)}}t.exports=a,t.exports.default=a},function(t,e,r){const{MAX_SAFE_INTEGER_LENGTH:n}=r(56);t.exports=function(t,e){const r=t.length,i=e.length,o=t.indexOf(\".\"),s=e.indexOf(\".\"),a=-1===o?r:o,u=-1===s?i:s;if(-1===o&&-1===s&&r0){for(;m>p-f;){const r=t[m-h]||\"0\",n=e[m-d]||\"0\";let i=Number(r)+Number(n)+g;i>=10?(i-=10,g=1):g=0,\"\"===y&&0===i||(y=i+y),m--}y&&(y=\".\"+y),m--}if(l>0)for(;m>=0;){const r=t[m-h]||\"0\",n=e[m-d]||\"0\";let i=Number(r)+Number(n)+g;i>=10?(i-=10,g=1):g=0,y=i+y,m--}return 1===g&&(y=g+y),\".\"===y[0]&&(y=\"0\"+y),y}},function(t,e,r){const{MAX_SAFE_INTEGER_LENGTH:n}=r(56);t.exports=function(t,e){const r=t.length,i=e.length,o=t.indexOf(\".\"),s=e.indexOf(\".\"),a=-1===o?r:o,u=-1===s?i:s;if(-1===o&&-1===s&&r0){for(;m>p-f;){let r=t[m-h]||\"0\",n=e[m-d]||\"0\";r-=g,g=0;let i=r-n;if(i<0)for(;i<0;)g++,i+=10;else g&&g--;\"\"===y&&0===i||(y=i+y),m--}\"\"!==y&&(y=\".\"+y),m--}if(l>0){for(;m>0;){let r=t[m-h]||\"0\",n=e[m-d]||\"0\";r-=g,g=0;let i=r-n;if(i<0)for(;i<0;)g++,i+=10;else g&&g--;y=i+y,m--}const r=t[0-h]||\"0\",n=e[0-d]||\"0\";let i=Number(r)-(g>0?1:0)-Number(n);0!==i&&(y=i+y),y=y.replace(/^0+/,\"\")}return\".\"===y[0]&&(y=\"0\"+y),y}},function(t,e,r){const n=r(18);function i(t){return\"-\"===(t=n(t))[0]?t.substring(1):t}t.exports=i,t.exports.default=i},function(t,e,r){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0});var n=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var r=[],n=!0,i=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(n=(s=a.next()).done)&&(r.push(s.value),!e||r.length!==e);n=!0);}catch(t){i=!0,o=t}finally{try{!n&&a.return&&a.return()}finally{if(i)throw o}}return r}(t,e);throw new TypeError(\"Invalid attempt to destructure non-iterable instance\")},i=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t};e.default=function(t,e){return new Promise((function(r,o){try{e&&console.log(\"starting parseData with\",t),e&&console.log(\"\\\\tGeoTIFF:\",\"undefined\"==typeof GeoTIFF?\"undefined\":i(GeoTIFF));var u={},c=void 0,h=void 0;if(\"object\"===t.rasterType)u.values=t.data,u.height=c=t.metadata.height||u.values[0].length,u.width=h=t.metadata.width||u.values[0][0].length,u.pixelHeight=t.metadata.pixelHeight,u.pixelWidth=t.metadata.pixelWidth,u.projection=t.metadata.projection,u.xmin=t.metadata.xmin,u.ymax=t.metadata.ymax,u.noDataValue=t.metadata.noDataValue,u.numberOfRasters=u.values.length,u.xmax=u.xmin+u.width*u.pixelWidth,u.ymin=u.ymax-u.height*u.pixelHeight,u._data=null,r(f(u));else if(\"geotiff\"===t.rasterType){u._data=t.data;var d=s.fromArrayBuffer;\"url\"===t.sourceType?d=s.fromUrl:\"Blob\"===t.sourceType&&(d=s.fromBlob),e&&console.log(\"data.rasterType is geotiff\"),r(d(t.data).then((function(r){return e&&console.log(\"geotiff:\",r),r.getImage().then((function(r){try{e&&console.log(\"image:\",r);var i=r.fileDirectory,s=r.getGeoKeys()||{},d=s.GeographicTypeGeoKey,p=s.ProjectedCSTypeGeoKey;u.projection=p||d||t.metadata.projection,e&&console.log(\"projection:\",u.projection),u.height=c=r.getHeight(),e&&console.log(\"result.height:\",u.height),u.width=h=r.getWidth(),e&&console.log(\"result.width:\",u.width);var y=r.getResolution(),g=n(y,2),m=g[0],b=g[1];u.pixelHeight=Math.abs(b),u.pixelWidth=Math.abs(m);var v=r.getOrigin(),w=n(v,2),x=w[0],_=w[1];return u.xmin=x,u.xmax=u.xmin+h*u.pixelWidth,u.ymax=_,u.ymin=u.ymax-c*u.pixelHeight,u.noDataValue=i.GDAL_NODATA?parseFloat(i.GDAL_NODATA):null,u.numberOfRasters=i.SamplesPerPixel,i.ColorMap&&(u.palette=(0,a.getPalette)(r)),\"url\"!==t.sourceType?r.readRasters().then((function(t){return u.values=t.map((function(t){return(0,l.unflatten)(t,{height:c,width:h})})),f(u)})):u}catch(t){o(t),console.error(\"[georaster] error parsing georaster:\",t)}}))})))}}catch(t){o(t),console.error(\"[georaster] error parsing georaster:\",t)}}))};var o,s=r(193),a=r(150),u=r(151),c=(o=u)&&o.__esModule?o:{default:o},l=r(192);function f(t){var e=(0,c.default)(t.values,{height:t.height,layout:\"[band][row][column]\",noData:t.noDataValue,precise:!1,stats:[\"max\",\"min\",\"range\"],width:t.width});return t.maxs=e.bands.map((function(t){return t.max})),t.mins=e.bands.map((function(t){return t.min})),t.ranges=e.bands.map((function(t){return t.range})),t}},function(t,e,r){function n(t,e){\"use strict\";var r=(e=e||{}).pos||0,i=\"<\".charCodeAt(0),o=\">\".charCodeAt(0),s=\"-\".charCodeAt(0),a=\"/\".charCodeAt(0),u=\"!\".charCodeAt(0),c=\"\\'\".charCodeAt(0),l=\\'\"\\'.charCodeAt(0);function f(){for(var e=[];t[r];)if(t.charCodeAt(r)==i){if(t.charCodeAt(r+1)===a)return(r=t.indexOf(\">\",r))+1&&(r+=1),e;if(t.charCodeAt(r+1)===u){if(t.charCodeAt(r+2)==s){for(;-1!==r&&(t.charCodeAt(r)!==o||t.charCodeAt(r-1)!=s||t.charCodeAt(r-2)!=s||-1==r);)r=t.indexOf(\">\",r+1);-1===r&&(r=t.length)}else for(r+=2;t.charCodeAt(r)!==o&&t[r];)r++;r++;continue}var n=y();e.push(n)}else{var c=h();c.trim().length>0&&e.push(c),r++}return e}function h(){var e=r;return-2===(r=t.indexOf(\"<\",r)-1)&&(r=t.length),t.slice(e,r+1)}function d(){for(var e=r;-1===\"\\\\n\\\\t>/= \".indexOf(t[r])&&t[r];)r++;return t.slice(e,r)}var p=e.noChildNodes||[\"img\",\"br\",\"input\",\"meta\",\"link\"];function y(){r++;const e=d(),n={};let i=[];for(;t.charCodeAt(r)!==o&&t[r];){var s=t.charCodeAt(r);if(s>64&&s<91||s>96&&s<123){for(var u=d(),h=t.charCodeAt(r);h&&h!==c&&h!==l&&!(h>64&&h<91||h>96&&h<123)&&h!==o;)r++,h=t.charCodeAt(r);if(h===c||h===l){var y=g();if(-1===r)return{tagName:e,attributes:n,children:i}}else y=null,r--;n[u]=y}r++}if(t.charCodeAt(r-1)!==a)if(\"script\"==e){var m=r+1;r=t.indexOf(\"<\\\\/script>\",r),i=[t.slice(m,r-1)],r+=9}else if(\"style\"==e){m=r+1;r=t.indexOf(\"\",r),i=[t.slice(m,r-1)],r+=8}else-1==p.indexOf(e)&&(r++,i=f());else r++;return{tagName:e,attributes:n,children:i}}function g(){var e=t[r],n=++r;return r=t.indexOf(e,n),t.slice(n,r)}var m,b=null;if(void 0!==e.attrValue){e.attrName=e.attrName||\"id\";for(b=[];-1!==(m=void 0,m=new RegExp(\"\\\\\\\\s\"+e.attrName+\"\\\\\\\\s*=[\\'\\\\\"]\"+e.attrValue+\"[\\'\\\\\"]\").exec(t),r=m?m.index:-1);)-1!==(r=t.lastIndexOf(\"<\",r))&&b.push(y()),t=t.substr(r),r=0}else b=e.parseNode?y():f();return e.filter&&(b=n.filter(b,e.filter)),e.setPos&&(b.pos=r),b}n.simplify=function(t){var e={};if(!t.length)return\"\";if(1===t.length&&\"string\"==typeof t[0])return t[0];for(var r in t.forEach((function(t){if(\"object\"==typeof t){e[t.tagName]||(e[t.tagName]=[]);var r=n.simplify(t.children||[]);e[t.tagName].push(r),t.attributes&&(r._attributes=t.attributes)}})),e)1==e[r].length&&(e[r]=e[r][0]);return e},n.filter=function(t,e){var r=[];return t.forEach((function(t){if(\"object\"==typeof t&&e(t)&&r.push(t),t.children){var i=n.filter(t.children,e);r=r.concat(i)}})),r},n.stringify=function(t){var e=\"\";function r(t){if(t)for(var r=0;r\",r(t.children),e+=\"\"}return r(t),e},n.toContentString=function(t){if(Array.isArray(t)){var e=\"\";return t.forEach((function(t){e=(e+=\" \"+n.toContentString(t)).trim()})),e}return\"object\"==typeof t?n.toContentString(t.children):\" \"+t},n.getElementById=function(t,e,r){var i=n(t,{attrValue:e});return r?n.simplify(i):i[0]},n.getElementsByClassName=function(t,e,r){const i=n(t,{attrName:\"class\",attrValue:\"[a-zA-Z0-9-s ]*\"+e+\"[a-zA-Z0-9-s ]*\"});return r?n.simplify(i):i},n.parseStream=function(t,e){if(\"string\"==typeof e&&(e=e.length+2),\"string\"==typeof t){var i=r(25);t=i.createReadStream(t,{start:e}),e=0}var o=e,s=\"\";return t.on(\"data\",(function(e){s+=e;for(var r=0;;){if(!(o=s.indexOf(\"<\",o)+1))return void(o=r);if(\"/\"!==s[o+1]){var i=n(s,{pos:o-1,parseNode:!0,setPos:!0});if((o=i.pos)>s.length-1||oo.length-1||i=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg=\"\",this.ended=!1,this.chunks=[],this.strm=new u,this.strm.avail_out=0;var r=n.inflateInit2(this.strm,e.windowBits);if(r!==s.Z_OK)throw new Error(a[r]);if(this.header=new c,n.inflateGetHeader(this.strm,this.header),e.dictionary&&(\"string\"==typeof e.dictionary?e.dictionary=o.string2buf(e.dictionary):\"[object ArrayBuffer]\"===l.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(r=n.inflateSetDictionary(this.strm,e.dictionary))!==s.Z_OK))throw new Error(a[r])}function h(t,e){var r=new f(e);if(r.push(t,!0),r.err)throw r.msg||a[r.err];return r.result}f.prototype.push=function(t,e){var r,a,u,c,f,h=this.strm,d=this.options.chunkSize,p=this.options.dictionary,y=!1;if(this.ended)return!1;a=e===~~e?e:!0===e?s.Z_FINISH:s.Z_NO_FLUSH,\"string\"==typeof t?h.input=o.binstring2buf(t):\"[object ArrayBuffer]\"===l.call(t)?h.input=new Uint8Array(t):h.input=t,h.next_in=0,h.avail_in=h.input.length;do{if(0===h.avail_out&&(h.output=new i.Buf8(d),h.next_out=0,h.avail_out=d),(r=n.inflate(h,s.Z_NO_FLUSH))===s.Z_NEED_DICT&&p&&(r=n.inflateSetDictionary(this.strm,p)),r===s.Z_BUF_ERROR&&!0===y&&(r=s.Z_OK,y=!1),r!==s.Z_STREAM_END&&r!==s.Z_OK)return this.onEnd(r),this.ended=!0,!1;h.next_out&&(0!==h.avail_out&&r!==s.Z_STREAM_END&&(0!==h.avail_in||a!==s.Z_FINISH&&a!==s.Z_SYNC_FLUSH)||(\"string\"===this.options.to?(u=o.utf8border(h.output,h.next_out),c=h.next_out-u,f=o.buf2string(h.output,u),h.next_out=c,h.avail_out=d-c,c&&i.arraySet(h.output,h.output,u,c,0),this.onData(f)):this.onData(i.shrinkBuf(h.output,h.next_out)))),0===h.avail_in&&0===h.avail_out&&(y=!0)}while((h.avail_in>0||0===h.avail_out)&&r!==s.Z_STREAM_END);return r===s.Z_STREAM_END&&(a=s.Z_FINISH),a===s.Z_FINISH?(r=n.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===s.Z_OK):a!==s.Z_SYNC_FLUSH||(this.onEnd(s.Z_OK),h.avail_out=0,!0)},f.prototype.onData=function(t){this.chunks.push(t)},f.prototype.onEnd=function(t){t===s.Z_OK&&(\"string\"===this.options.to?this.result=this.chunks.join(\"\"):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},e.Inflate=f,e.inflate=h,e.inflateRaw=function(t,e){return(e=e||{}).raw=!0,h(t,e)},e.ungzip=h},function(t,e,r){\"use strict\";var n=r(26);class i extends n.a{constructor(){super(t=>(this._observers.add(t),()=>this._observers.delete(t))),this._observers=new Set}next(t){for(const e of this._observers)e.next(t)}error(t){for(const e of this._observers)e.error(t)}complete(){for(const t of this._observers)t.complete()}}e.a=i},function(t,e,r){\"use strict\";r.d(e,\"a\",(function(){return i}));const n=()=>{};function i(){let t,e=!1,r=n;return[new Promise(n=>{e?n(t):r=n}),n=>{e=!0,t=n,r(t)}]}},function(t,e,r){\"use strict\";r.d(e,\"a\",(function(){return i}));var n=r(2);function i(t){return t&&\"object\"==typeof t&&t[n.d]}},function(t,e,r){var n=r(40),i=r(39),o=t.exports;for(var s in n)n.hasOwnProperty(s)&&(o[s]=n[s]);function a(t){if(\"string\"==typeof t&&(t=i.parse(t)),t.protocol||(t.protocol=\"https:\"),\"https:\"!==t.protocol)throw new Error(\\'Protocol \"\\'+t.protocol+\\'\" not supported. Expected \"https:\"\\');return t}o.request=function(t,e){return t=a(t),n.request.call(this,t,e)},o.get=function(t,e){return t=a(t),n.get.call(this,t,e)}},function(t,e,r){\"use strict\";r.r(e);var n=r(99),i=r.n(n);self;onmessage=t=>{const e=t.data;i()(e).then(t=>{const e=[];if(t.values){let r;t.values.forEach(t=>t.forEach(({buffer:t})=>{t instanceof ArrayBuffer&&t!==r&&(e.push(t),r=t)}))}t._data instanceof ArrayBuffer&&e.push(t._data),postMessage(t,e),close()})}},function(t,e,r){(function(e){var n=r(42).Transform,i=r(10);function o(t){n.call(this,t),this._destroyed=!1}function s(t,e,r){r(null,t)}function a(t){return function(e,r,n){return\"function\"==typeof e&&(n=r,r=e,e={}),\"function\"!=typeof r&&(r=s),\"function\"!=typeof n&&(n=null),t(e,r,n)}}i(o,n),o.prototype.destroy=function(t){if(!this._destroyed){this._destroyed=!0;var r=this;e.nextTick((function(){t&&r.emit(\"error\",t),r.emit(\"close\")}))}},t.exports=a((function(t,e,r){var n=new o(t);return n._transform=e,r&&(n._flush=r),n})),t.exports.ctor=a((function(t,e,r){function n(e){if(!(this instanceof n))return new n(e);this.options=Object.assign({},t,e),o.call(this,this.options)}return i(n,o),n.prototype._transform=e,r&&(n.prototype._flush=r),n})),t.exports.obj=a((function(t,e,r){var n=new o(Object.assign({objectMode:!0,highWaterMark:16},t));return n._transform=e,r&&(n._flush=r),n}))}).call(this,r(7))},function(t,e,r){\"use strict\";e.byteLength=function(t){var e=c(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,n=c(t),s=n[0],a=n[1],u=new o(function(t,e,r){return 3*(e+r)/4-r}(0,s,a)),l=0,f=a>0?s-4:s;for(r=0;r>16&255,u[l++]=e>>8&255,u[l++]=255&e;2===a&&(e=i[t.charCodeAt(r)]<<2|i[t.charCodeAt(r+1)]>>4,u[l++]=255&e);1===a&&(e=i[t.charCodeAt(r)]<<10|i[t.charCodeAt(r+1)]<<4|i[t.charCodeAt(r+2)]>>2,u[l++]=e>>8&255,u[l++]=255&e);return u},e.fromByteArray=function(t){for(var e,r=t.length,i=r%3,o=[],s=0,a=r-i;sa?a:s+16383));1===i?(e=t[r-1],o.push(n[e>>2]+n[e<<4&63]+\"==\")):2===i&&(e=(t[r-2]<<8)+t[r-1],o.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+\"=\"));return o.join(\"\")};for(var n=[],i=[],o=\"undefined\"!=typeof Uint8Array?Uint8Array:Array,s=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\",a=0,u=s.length;a0)throw new Error(\"Invalid string. Length must be a multiple of 4\");var r=t.indexOf(\"=\");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function l(t,e,r){for(var i,o,s=[],a=e;a>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return s.join(\"\")}i[\"-\".charCodeAt(0)]=62,i[\"_\".charCodeAt(0)]=63},function(t,e){\\n/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */\\ne.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,u=(1<>1,l=-7,f=r?i-1:0,h=r?-1:1,d=t[e+f];for(f+=h,o=d&(1<<-l)-1,d>>=-l,l+=a;l>0;o=256*o+t[e+f],f+=h,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=n;l>0;s=256*s+t[e+f],f+=h,l-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,n),o-=c}return(d?-1:1)*s*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var s,a,u,c=8*o-i-1,l=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=l):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+f>=1?h/u:h*Math.pow(2,1-f))*u>=2&&(s++,u/=2),s+f>=l?(a=0,s=l):s+f>=1?(a=(e*u-1)*Math.pow(2,i),s+=f):(a=e*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;t[r+d]=255&a,d+=p,a/=256,i-=8);for(s=s<0;t[r+d]=255&s,d+=p,s/=256,c-=8);t[r+d-p]|=128*y}},function(t,e){},function(t,e,r){\"use strict\";var n=r(43).Buffer,i=r(112);t.exports=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.head=null,this.tail=null,this.length=0}return t.prototype.push=function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length},t.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},t.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},t.prototype.clear=function(){this.head=this.tail=null,this.length=0},t.prototype.join=function(t){if(0===this.length)return\"\";for(var e=this.head,r=\"\"+e.data;e=e.next;)r+=t+e.data;return r},t.prototype.concat=function(t){if(0===this.length)return n.alloc(0);for(var e,r,i,o=n.allocUnsafe(t>>>0),s=this.head,a=0;s;)e=s.data,r=o,i=a,e.copy(r,i),a+=s.data.length,s=s.next;return o},t}(),i&&i.inspect&&i.inspect.custom&&(t.exports.prototype[i.inspect.custom]=function(){var t=i.inspect({length:this.length});return this.constructor.name+\" \"+t})},function(t,e){},function(t,e,r){(function(t){var n=void 0!==t&&t||\"undefined\"!=typeof self&&self||window,i=Function.prototype.apply;function o(t,e){this._id=t,this._clearFn=e}e.setTimeout=function(){return new o(i.call(setTimeout,n,arguments),clearTimeout)},e.setInterval=function(){return new o(i.call(setInterval,n,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(n,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},r(114),e.setImmediate=\"undefined\"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate=\"undefined\"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,r(3))},function(t,e,r){(function(t,e){!function(t,r){\"use strict\";if(!t.setImmediate){var n,i,o,s,a,u=1,c={},l=!1,f=t.document,h=Object.getPrototypeOf&&Object.getPrototypeOf(t);h=h&&h.setTimeout?h:t,\"[object process]\"==={}.toString.call(t.process)?n=function(t){e.nextTick((function(){p(t)}))}:!function(){if(t.postMessage&&!t.importScripts){var e=!0,r=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage(\"\",\"*\"),t.onmessage=r,e}}()?t.MessageChannel?((o=new MessageChannel).port1.onmessage=function(t){p(t.data)},n=function(t){o.port2.postMessage(t)}):f&&\"onreadystatechange\"in f.createElement(\"script\")?(i=f.documentElement,n=function(t){var e=f.createElement(\"script\");e.onreadystatechange=function(){p(t),e.onreadystatechange=null,i.removeChild(e),e=null},i.appendChild(e)}):n=function(t){setTimeout(p,0,t)}:(s=\"setImmediate$\"+Math.random()+\"$\",a=function(e){e.source===t&&\"string\"==typeof e.data&&0===e.data.indexOf(s)&&p(+e.data.slice(s.length))},t.addEventListener?t.addEventListener(\"message\",a,!1):t.attachEvent(\"onmessage\",a),n=function(e){t.postMessage(s+e,\"*\")}),h.setImmediate=function(t){\"function\"!=typeof t&&(t=new Function(\"\"+t));for(var e=new Array(arguments.length-1),r=0;r>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function c(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function l(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg=\"\",e.wrap&&(t.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new n.Buf32(852),e.distcode=e.distdyn=new n.Buf32(592),e.sane=1,e.back=-1,0):-2}function f(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,l(t)):-2}function h(t,e){var r,n;return t&&t.state?(n=t.state,e<0?(r=0,e=-e):(r=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?-2:(null!==n.window&&n.wbits!==e&&(n.window=null),n.wrap=r,n.wbits=e,f(t))):-2}function d(t,e){var r,n;return t?(n=new c,t.state=n,n.window=null,0!==(r=h(t,e))&&(t.state=null),r):-2}var p,y,g=!0;function m(t){if(g){var e;for(p=new n.Buf32(512),y=new n.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(a(1,t.lens,0,288,p,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;a(2,t.lens,0,32,y,0,t.work,{bits:5}),g=!1}t.lencode=p,t.lenbits=9,t.distcode=y,t.distbits=5}function b(t,e,r,i){var o,s=t.state;return null===s.window&&(s.wsize=1<=s.wsize?(n.arraySet(s.window,e,r-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):((o=s.wsize-s.wnext)>i&&(o=i),n.arraySet(s.window,e,r-i,o,s.wnext),(i-=o)?(n.arraySet(s.window,e,r-i,i,0),s.wnext=i,s.whave=s.wsize):(s.wnext+=o,s.wnext===s.wsize&&(s.wnext=0),s.whave>>8&255,r.check=o(r.check,L,2,0),y=0,g=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&y)<<8)+(y>>8))%31){t.msg=\"incorrect header check\",r.mode=30;break}if(8!=(15&y)){t.msg=\"unknown compression method\",r.mode=30;break}if(g-=4,I=8+(15&(y>>>=4)),0===r.wbits)r.wbits=I;else if(I>r.wbits){t.msg=\"invalid window size\",r.mode=30;break}r.dmax=1<>8&1),512&r.flags&&(L[0]=255&y,L[1]=y>>>8&255,r.check=o(r.check,L,2,0)),y=0,g=0,r.mode=3;case 3:for(;g<32;){if(0===d)break t;d--,y+=c[f++]<>>8&255,L[2]=y>>>16&255,L[3]=y>>>24&255,r.check=o(r.check,L,4,0)),y=0,g=0,r.mode=4;case 4:for(;g<16;){if(0===d)break t;d--,y+=c[f++]<>8),512&r.flags&&(L[0]=255&y,L[1]=y>>>8&255,r.check=o(r.check,L,2,0)),y=0,g=0,r.mode=5;case 5:if(1024&r.flags){for(;g<16;){if(0===d)break t;d--,y+=c[f++]<>>8&255,r.check=o(r.check,L,2,0)),y=0,g=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&((x=r.length)>d&&(x=d),x&&(r.head&&(I=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),n.arraySet(r.head.extra,c,f,x,I)),512&r.flags&&(r.check=o(r.check,c,x,f)),d-=x,f+=x,r.length-=x),r.length))break t;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===d)break t;x=0;do{I=c[f+x++],r.head&&I&&r.length<65536&&(r.head.name+=String.fromCharCode(I))}while(I&&x>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=12;break;case 10:for(;g<32;){if(0===d)break t;d--,y+=c[f++]<>>=7&g,g-=7&g,r.mode=27;break}for(;g<3;){if(0===d)break t;d--,y+=c[f++]<>>=1)){case 0:r.mode=14;break;case 1:if(m(r),r.mode=20,6===e){y>>>=2,g-=2;break t}break;case 2:r.mode=17;break;case 3:t.msg=\"invalid block type\",r.mode=30}y>>>=2,g-=2;break;case 14:for(y>>>=7&g,g-=7&g;g<32;){if(0===d)break t;d--,y+=c[f++]<>>16^65535)){t.msg=\"invalid stored block lengths\",r.mode=30;break}if(r.length=65535&y,y=0,g=0,r.mode=15,6===e)break t;case 15:r.mode=16;case 16:if(x=r.length){if(x>d&&(x=d),x>p&&(x=p),0===x)break t;n.arraySet(l,c,f,x,h),d-=x,f+=x,p-=x,h+=x,r.length-=x;break}r.mode=12;break;case 17:for(;g<14;){if(0===d)break t;d--,y+=c[f++]<>>=5,g-=5,r.ndist=1+(31&y),y>>>=5,g-=5,r.ncode=4+(15&y),y>>>=4,g-=4,r.nlen>286||r.ndist>30){t.msg=\"too many length or distance symbols\",r.mode=30;break}r.have=0,r.mode=18;case 18:for(;r.have>>=3,g-=3}for(;r.have<19;)r.lens[F[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,R={bits:r.lenbits},P=a(0,r.lens,0,19,r.lencode,0,r.work,R),r.lenbits=R.bits,P){t.msg=\"invalid code lengths set\",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have>>16&255,k=65535&M,!((A=M>>>24)<=g);){if(0===d)break t;d--,y+=c[f++]<>>=A,g-=A,r.lens[r.have++]=k;else{if(16===k){for(j=A+2;g>>=A,g-=A,0===r.have){t.msg=\"invalid bit length repeat\",r.mode=30;break}I=r.lens[r.have-1],x=3+(3&y),y>>>=2,g-=2}else if(17===k){for(j=A+3;g>>=A)),y>>>=3,g-=3}else{for(j=A+7;g>>=A)),y>>>=7,g-=7}if(r.have+x>r.nlen+r.ndist){t.msg=\"invalid bit length repeat\",r.mode=30;break}for(;x--;)r.lens[r.have++]=I}}if(30===r.mode)break;if(0===r.lens[256]){t.msg=\"invalid code -- missing end-of-block\",r.mode=30;break}if(r.lenbits=9,R={bits:r.lenbits},P=a(1,r.lens,0,r.nlen,r.lencode,0,r.work,R),r.lenbits=R.bits,P){t.msg=\"invalid literal/lengths set\",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,R={bits:r.distbits},P=a(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,R),r.distbits=R.bits,P){t.msg=\"invalid distances set\",r.mode=30;break}if(r.mode=20,6===e)break t;case 20:r.mode=21;case 21:if(d>=6&&p>=258){t.next_out=h,t.avail_out=p,t.next_in=f,t.avail_in=d,r.hold=y,r.bits=g,s(t,w),h=t.next_out,l=t.output,p=t.avail_out,f=t.next_in,c=t.input,d=t.avail_in,y=r.hold,g=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;E=(M=r.lencode[y&(1<>>16&255,k=65535&M,!((A=M>>>24)<=g);){if(0===d)break t;d--,y+=c[f++]<>T)])>>>16&255,k=65535&M,!(T+(A=M>>>24)<=g);){if(0===d)break t;d--,y+=c[f++]<>>=T,g-=T,r.back+=T}if(y>>>=A,g-=A,r.back+=A,r.length=k,0===E){r.mode=26;break}if(32&E){r.back=-1,r.mode=12;break}if(64&E){t.msg=\"invalid literal/length code\",r.mode=30;break}r.extra=15&E,r.mode=22;case 22:if(r.extra){for(j=r.extra;g>>=r.extra,g-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;E=(M=r.distcode[y&(1<>>16&255,k=65535&M,!((A=M>>>24)<=g);){if(0===d)break t;d--,y+=c[f++]<>T)])>>>16&255,k=65535&M,!(T+(A=M>>>24)<=g);){if(0===d)break t;d--,y+=c[f++]<>>=T,g-=T,r.back+=T}if(y>>>=A,g-=A,r.back+=A,64&E){t.msg=\"invalid distance code\",r.mode=30;break}r.offset=k,r.extra=15&E,r.mode=24;case 24:if(r.extra){for(j=r.extra;g>>=r.extra,g-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg=\"invalid distance too far back\",r.mode=30;break}r.mode=25;case 25:if(0===p)break t;if(x=w-p,r.offset>x){if((x=r.offset-x)>r.whave&&r.sane){t.msg=\"invalid distance too far back\",r.mode=30;break}x>r.wnext?(x-=r.wnext,_=r.wsize-x):_=r.wnext-x,x>r.length&&(x=r.length),S=r.window}else S=l,_=h-r.offset,x=r.length;x>p&&(x=p),p-=x,r.length-=x;do{l[h++]=S[_++]}while(--x);0===r.length&&(r.mode=21);break;case 26:if(0===p)break t;l[h++]=r.length,p--,r.mode=21;break;case 27:if(r.wrap){for(;g<32;){if(0===d)break t;d--,y|=c[f++]<>>16&65535|0,s=0;0!==r;){r-=s=r>2e3?2e3:r;do{o=o+(i=i+e[n++]|0)|0}while(--s);i%=65521,o%=65521}return i|o<<16|0}},function(t,e,r){\"use strict\";var n=function(){for(var t,e=[],r=0;r<256;r++){t=r;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[r]=t}return e}();t.exports=function(t,e,r,i){var o=n,s=i+r;t^=-1;for(var a=i;a>>8^o[255&(t^e[a])];return-1^t}},function(t,e,r){\"use strict\";t.exports=function(t,e){var r,n,i,o,s,a,u,c,l,f,h,d,p,y,g,m,b,v,w,x,_,S,A,E,k;r=t.state,n=t.next_in,E=t.input,i=n+(t.avail_in-5),o=t.next_out,k=t.output,s=o-(e-t.avail_out),a=o+(t.avail_out-257),u=r.dmax,c=r.wsize,l=r.whave,f=r.wnext,h=r.window,d=r.hold,p=r.bits,y=r.lencode,g=r.distcode,m=(1<>>=w=v>>>24,p-=w,0===(w=v>>>16&255))k[o++]=65535&v;else{if(!(16&w)){if(0==(64&w)){v=y[(65535&v)+(d&(1<>>=w,p-=w),p<15&&(d+=E[n++]<>>=w=v>>>24,p-=w,!(16&(w=v>>>16&255))){if(0==(64&w)){v=g[(65535&v)+(d&(1<u){t.msg=\"invalid distance too far back\",r.mode=30;break t}if(d>>>=w,p-=w,_>(w=o-s)){if((w=_-w)>l&&r.sane){t.msg=\"invalid distance too far back\",r.mode=30;break t}if(S=0,A=h,0===f){if(S+=c-w,w2;)k[o++]=A[S++],k[o++]=A[S++],k[o++]=A[S++],x-=3;x&&(k[o++]=A[S++],x>1&&(k[o++]=A[S++]))}else{S=o-_;do{k[o++]=k[S++],k[o++]=k[S++],k[o++]=k[S++],x-=3}while(x>2);x&&(k[o++]=k[S++],x>1&&(k[o++]=k[S++]))}break}}break}}while(n>3,d&=(1<<(p-=x<<3))-1,t.next_in=n,t.next_out=o,t.avail_in=n=1&&0===L[k];k--);if(T>k&&(T=k),0===k)return c[l++]=20971520,c[l++]=20971520,h.bits=1,0;for(E=1;E0&&(0===t||1!==k))return-1;for(F[1]=0,S=1;S<15;S++)F[S+1]=F[S]+L[S];for(A=0;A852||2===t&&P>592)return 1;for(;;){v=S-O,f[A]b?(w=N[D+f[A]],x=j[M+f[A]]):(w=96,x=0),d=1<>O)+(p-=d)]=v<<24|w<<16|x|0}while(0!==p);for(d=1<>=1;if(0!==d?(R&=d-1,R+=d):R=0,A++,0==--L[S]){if(S===k)break;S=e[r+f[A]]}if(S>T&&(R&g)!==y){for(0===O&&(O=T),m+=E,I=1<<(C=S-O);C+O852||2===t&&P>592)return 1;c[y=R&g]=T<<24|C<<16|m-l|0}}return 0!==R&&(c[m+R]=S-O<<24|64<<16|0),h.bits=T,0}},function(t,e,r){\"use strict\";var n=r(29),i=!0,o=!0;try{String.fromCharCode.apply(null,[0])}catch(t){i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){o=!1}for(var s=new n.Buf8(256),a=0;a<256;a++)s[a]=a>=252?6:a>=248?5:a>=240?4:a>=224?3:a>=192?2:1;function u(t,e){if(e<65534&&(t.subarray&&o||!t.subarray&&i))return String.fromCharCode.apply(null,n.shrinkBuf(t,e));for(var r=\"\",s=0;s>>6,e[s++]=128|63&r):r<65536?(e[s++]=224|r>>>12,e[s++]=128|r>>>6&63,e[s++]=128|63&r):(e[s++]=240|r>>>18,e[s++]=128|r>>>12&63,e[s++]=128|r>>>6&63,e[s++]=128|63&r);return e},e.buf2binstring=function(t){return u(t,t.length)},e.binstring2buf=function(t){for(var e=new n.Buf8(t.length),r=0,i=e.length;r4)c[n++]=65533,r+=o-1;else{for(i&=2===o?31:3===o?15:7;o>1&&r1?c[n++]=65533:i<65536?c[n++]=i:(i-=65536,c[n++]=55296|i>>10&1023,c[n++]=56320|1023&i)}return u(c,n)},e.utf8border=function(t,e){var r;for((e=e||t.length)>t.length&&(e=t.length),r=e-1;r>=0&&128==(192&t[r]);)r--;return r<0||0===r?e:r+s[t[r]]>e?r:e}},function(t,e,r){\"use strict\";t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},function(t,e,r){\"use strict\";t.exports={2:\"need dictionary\",1:\"stream end\",0:\"\",\"-1\":\"file error\",\"-2\":\"stream error\",\"-3\":\"data error\",\"-4\":\"insufficient memory\",\"-5\":\"buffer error\",\"-6\":\"incompatible version\"}},function(t,e,r){\"use strict\";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg=\"\",this.state=null,this.data_type=2,this.adler=0}},function(t,e,r){\"use strict\";t.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name=\"\",this.comment=\"\",this.hcrc=0,this.done=!1}},function(t,e,r){t.exports=r.p+\"0.bce5ef15ddaa1e171e9d.worker.worker.js\"},function(t,e,r){t.exports=function(t){function e(t){let r,i,o,s=null;function a(...t){if(!a.enabled)return;const n=a,i=Number(new Date),o=i-(r||i);n.diff=o,n.prev=r,n.curr=i,r=i,t[0]=e.coerce(t[0]),\"string\"!=typeof t[0]&&t.unshift(\"%O\");let s=0;t[0]=t[0].replace(/%([a-zA-Z%])/g,(r,i)=>{if(\"%%\"===r)return\"%\";s++;const o=e.formatters[i];if(\"function\"==typeof o){const e=t[s];r=o.call(n,e),t.splice(s,1),s--}return r}),e.formatArgs.call(n,t);(n.log||e.log).apply(n,t)}return a.namespace=t,a.useColors=e.useColors(),a.color=e.selectColor(t),a.extend=n,a.destroy=e.destroy,Object.defineProperty(a,\"enabled\",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(i!==e.namespaces&&(i=e.namespaces,o=e.enabled(t)),o),set:t=>{s=t}}),\"function\"==typeof e.init&&e.init(a),a}function n(t,r){const n=e(this.namespace+(void 0===r?\":\":r)+t);return n.log=this.log,n}function i(t){return t.toString().substring(2,t.toString().length-2).replace(/\\\\.\\\\*\\\\?$/,\"*\")}return e.debug=e,e.default=e,e.coerce=function(t){if(t instanceof Error)return t.stack||t.message;return t},e.disable=function(){const t=[...e.names.map(i),...e.skips.map(i).map(t=>\"-\"+t)].join(\",\");return e.enable(\"\"),t},e.enable=function(t){let r;e.save(t),e.namespaces=t,e.names=[],e.skips=[];const n=(\"string\"==typeof t?t:\"\").split(/[\\\\s,]+/),i=n.length;for(r=0;r{e[r]=t[r]}),e.names=[],e.skips=[],e.formatters={},e.selectColor=function(t){let r=0;for(let e=0;e=1.5*r;return Math.round(t/r)+\" \"+n+(i?\"s\":\"\")}t.exports=function(t,e){e=e||{};var a=typeof t;if(\"string\"===a&&t.length>0)return function(t){if((t=String(t)).length>100)return;var e=/^(-?(?:\\\\d+)?\\\\.?\\\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(!e)return;var s=parseFloat(e[1]);switch((e[2]||\"ms\").toLowerCase()){case\"years\":case\"year\":case\"yrs\":case\"yr\":case\"y\":return 315576e5*s;case\"weeks\":case\"week\":case\"w\":return 6048e5*s;case\"days\":case\"day\":case\"d\":return s*o;case\"hours\":case\"hour\":case\"hrs\":case\"hr\":case\"h\":return s*i;case\"minutes\":case\"minute\":case\"mins\":case\"min\":case\"m\":return s*n;case\"seconds\":case\"second\":case\"secs\":case\"sec\":case\"s\":return s*r;case\"milliseconds\":case\"millisecond\":case\"msecs\":case\"msec\":case\"ms\":return s;default:return}}(t);if(\"number\"===a&&isFinite(t))return e.long?function(t){var e=Math.abs(t);if(e>=o)return s(t,e,o,\"day\");if(e>=i)return s(t,e,i,\"hour\");if(e>=n)return s(t,e,n,\"minute\");if(e>=r)return s(t,e,r,\"second\");return t+\" ms\"}(t):function(t){var e=Math.abs(t);if(e>=o)return Math.round(t/o)+\"d\";if(e>=i)return Math.round(t/i)+\"h\";if(e>=n)return Math.round(t/n)+\"m\";if(e>=r)return Math.round(t/r)+\"s\";return t+\"ms\"}(t);throw new Error(\"val is not a non-empty string or a valid number. val=\"+JSON.stringify(t))}},function(t,e,r){(function(e,n,i){var o=r(69),s=r(10),a=r(70),u=r(42),c=r(132),l=a.IncomingMessage,f=a.readyStates;var h=t.exports=function(t){var r,n=this;u.Writable.call(n),n._opts=t,n._body=[],n._headers={},t.auth&&n.setHeader(\"Authorization\",\"Basic \"+new e(t.auth).toString(\"base64\")),Object.keys(t.headers).forEach((function(e){n.setHeader(e,t.headers[e])}));var i=!0;if(\"disable-fetch\"===t.mode||\"requestTimeout\"in t&&!o.abortController)i=!1,r=!0;else if(\"prefer-streaming\"===t.mode)r=!1;else if(\"allow-wrong-content-type\"===t.mode)r=!o.overrideMimeType;else{if(t.mode&&\"default\"!==t.mode&&\"prefer-fast\"!==t.mode)throw new Error(\"Invalid value for opts.mode\");r=!0}n._mode=function(t,e){return o.fetch&&e?\"fetch\":o.mozchunkedarraybuffer?\"moz-chunked-arraybuffer\":o.msstream?\"ms-stream\":o.arraybuffer&&t?\"arraybuffer\":o.vbArray&&t?\"text:vbarray\":\"text\"}(r,i),n._fetchTimer=null,n.on(\"finish\",(function(){n._onFinish()}))};s(h,u.Writable),h.prototype.setHeader=function(t,e){var r=t.toLowerCase();-1===d.indexOf(r)&&(this._headers[r]={name:t,value:e})},h.prototype.getHeader=function(t){var e=this._headers[t.toLowerCase()];return e?e.value:null},h.prototype.removeHeader=function(t){delete this._headers[t.toLowerCase()]},h.prototype._onFinish=function(){var t=this;if(!t._destroyed){var r=t._opts,s=t._headers,a=null;\"GET\"!==r.method&&\"HEAD\"!==r.method&&(a=o.arraybuffer?c(e.concat(t._body)):o.blobConstructor?new n.Blob(t._body.map((function(t){return c(t)})),{type:(s[\"content-type\"]||{}).value||\"\"}):e.concat(t._body).toString());var u=[];if(Object.keys(s).forEach((function(t){var e=s[t].name,r=s[t].value;Array.isArray(r)?r.forEach((function(t){u.push([e,t])})):u.push([e,r])})),\"fetch\"===t._mode){var l=null;if(o.abortController){var h=new AbortController;l=h.signal,t._fetchAbortController=h,\"requestTimeout\"in r&&0!==r.requestTimeout&&(t._fetchTimer=n.setTimeout((function(){t.emit(\"requestTimeout\"),t._fetchAbortController&&t._fetchAbortController.abort()}),r.requestTimeout))}n.fetch(t._opts.url,{method:t._opts.method,headers:u,body:a||void 0,mode:\"cors\",credentials:r.withCredentials?\"include\":\"same-origin\",signal:l}).then((function(e){t._fetchResponse=e,t._connect()}),(function(e){n.clearTimeout(t._fetchTimer),t._destroyed||t.emit(\"error\",e)}))}else{var d=t._xhr=new n.XMLHttpRequest;try{d.open(t._opts.method,t._opts.url,!0)}catch(e){return void i.nextTick((function(){t.emit(\"error\",e)}))}\"responseType\"in d&&(d.responseType=t._mode.split(\":\")[0]),\"withCredentials\"in d&&(d.withCredentials=!!r.withCredentials),\"text\"===t._mode&&\"overrideMimeType\"in d&&d.overrideMimeType(\"text/plain; charset=x-user-defined\"),\"requestTimeout\"in r&&(d.timeout=r.requestTimeout,d.ontimeout=function(){t.emit(\"requestTimeout\")}),u.forEach((function(t){d.setRequestHeader(t[0],t[1])})),t._response=null,d.onreadystatechange=function(){switch(d.readyState){case f.LOADING:case f.DONE:t._onXHRProgress()}},\"moz-chunked-arraybuffer\"===t._mode&&(d.onprogress=function(){t._onXHRProgress()}),d.onerror=function(){t._destroyed||t.emit(\"error\",new Error(\"XHR error\"))};try{d.send(a)}catch(e){return void i.nextTick((function(){t.emit(\"error\",e)}))}}}},h.prototype._onXHRProgress=function(){(function(t){try{var e=t.status;return null!==e&&0!==e}catch(t){return!1}})(this._xhr)&&!this._destroyed&&(this._response||this._connect(),this._response._onXHRProgress())},h.prototype._connect=function(){var t=this;t._destroyed||(t._response=new l(t._xhr,t._fetchResponse,t._mode,t._fetchTimer),t._response.on(\"error\",(function(e){t.emit(\"error\",e)})),t.emit(\"response\",t._response))},h.prototype._write=function(t,e,r){this._body.push(t),r()},h.prototype.abort=h.prototype.destroy=function(){this._destroyed=!0,n.clearTimeout(this._fetchTimer),this._response&&(this._response._destroyed=!0),this._xhr?this._xhr.abort():this._fetchAbortController&&this._fetchAbortController.abort()},h.prototype.end=function(t,e,r){\"function\"==typeof t&&(r=t,t=void 0),u.Writable.prototype.end.call(this,t,e,r)},h.prototype.flushHeaders=function(){},h.prototype.setTimeout=function(){},h.prototype.setNoDelay=function(){},h.prototype.setSocketKeepAlive=function(){};var d=[\"accept-charset\",\"accept-encoding\",\"access-control-request-headers\",\"access-control-request-method\",\"connection\",\"content-length\",\"cookie\",\"cookie2\",\"date\",\"dnt\",\"expect\",\"host\",\"keep-alive\",\"origin\",\"referer\",\"te\",\"trailer\",\"transfer-encoding\",\"upgrade\",\"via\"]}).call(this,r(9).Buffer,r(3),r(7))},function(t,e,r){var n=r(9).Buffer;t.exports=function(t){if(t instanceof Uint8Array){if(0===t.byteOffset&&t.byteLength===t.buffer.byteLength)return t.buffer;if(\"function\"==typeof t.buffer.slice)return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}if(n.isBuffer(t)){for(var e=new Uint8Array(t.length),r=t.length,i=0;i= 0x80 (not a basic code point)\",\"invalid-input\":\"Invalid input\"},d=Math.floor,p=String.fromCharCode;function y(t){throw new RangeError(h[t])}function g(t,e){for(var r=t.length,n=[];r--;)n[r]=e(t[r]);return n}function m(t,e){var r=t.split(\"@\"),n=\"\";return r.length>1&&(n=r[0]+\"@\",t=r[1]),n+g((t=t.replace(f,\".\")).split(\".\"),e).join(\".\")}function b(t){for(var e,r,n=[],i=0,o=t.length;i=55296&&e<=56319&&i65535&&(e+=p((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=p(t)})).join(\"\")}function w(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function x(t,e,r){var n=0;for(t=r?d(t/700):t>>1,t+=d(t/e);t>455;n+=36)t=d(t/35);return d(n+36*t/(t+38))}function _(t){var e,r,n,i,o,s,a,c,l,f,h,p=[],g=t.length,m=0,b=128,w=72;for((r=t.lastIndexOf(\"-\"))<0&&(r=0),n=0;n=128&&y(\"not-basic\"),p.push(t.charCodeAt(n));for(i=r>0?r+1:0;i=g&&y(\"invalid-input\"),((c=(h=t.charCodeAt(i++))-48<10?h-22:h-65<26?h-65:h-97<26?h-97:36)>=36||c>d((u-m)/s))&&y(\"overflow\"),m+=c*s,!(c<(l=a<=w?1:a>=w+26?26:a-w));a+=36)s>d(u/(f=36-l))&&y(\"overflow\"),s*=f;w=x(m-o,e=p.length+1,0==o),d(m/e)>u-b&&y(\"overflow\"),b+=d(m/e),m%=e,p.splice(m++,0,b)}return v(p)}function S(t){var e,r,n,i,o,s,a,c,l,f,h,g,m,v,_,S=[];for(g=(t=b(t)).length,e=128,r=0,o=72,s=0;s=e&&hd((u-r)/(m=n+1))&&y(\"overflow\"),r+=(a-e)*m,e=a,s=0;su&&y(\"overflow\"),h==e){for(c=r,l=36;!(c<(f=l<=o?1:l>=o+26?26:l-o));l+=36)_=c-f,v=36-f,S.push(p(w(f+_%v,0))),c=d(_/v);S.push(p(w(c,0))),o=x(r,m,n==i),r=0,++n}++r,++e}return S.join(\"\")}a={version:\"1.4.1\",ucs2:{decode:b,encode:v},decode:_,encode:S,toASCII:function(t){return m(t,(function(t){return l.test(t)?\"xn--\"+S(t):t}))},toUnicode:function(t){return m(t,(function(t){return c.test(t)?_(t.slice(4).toLowerCase()):t}))}},void 0===(i=function(){return a}.call(e,r,e,t))||(t.exports=i)}()}).call(this,r(136)(t),r(3))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,\"loaded\",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,\"id\",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,r){\"use strict\";var n=r(138),i=r(149),o=r(46);t.exports={formats:o,parse:i,stringify:n}},function(t,e,r){\"use strict\";var n=r(139),i=r(71),o=r(46),s=Object.prototype.hasOwnProperty,a={brackets:function(t){return t+\"[]\"},comma:\"comma\",indices:function(t,e){return t+\"[\"+e+\"]\"},repeat:function(t){return t}},u=Array.isArray,c=Array.prototype.push,l=function(t,e){c.apply(t,u(e)?e:[e])},f=Date.prototype.toISOString,h=o.default,d={addQueryPrefix:!1,allowDots:!1,charset:\"utf-8\",charsetSentinel:!1,delimiter:\"&\",encode:!0,encoder:i.encode,encodeValuesOnly:!1,format:h,formatter:o.formatters[h],indices:!1,serializeDate:function(t){return f.call(t)},skipNulls:!1,strictNullHandling:!1},p={},y=function t(e,r,o,s,a,c,f,h,y,g,m,b,v,w,x,_){for(var S,A=e,E=_,k=0,T=!1;void 0!==(E=E.get(p))&&!T;){var C=E.get(e);if(k+=1,void 0!==C){if(C===k)throw new RangeError(\"Cyclic object value\");T=!0}void 0===E.get(p)&&(k=0)}if(\"function\"==typeof h?A=h(r,A):A instanceof Date?A=m(A):\"comma\"===o&&u(A)&&(A=i.maybeMap(A,(function(t){return t instanceof Date?m(t):t}))),null===A){if(a)return f&&!w?f(r,d.encoder,x,\"key\",b):r;A=\"\"}if(\"string\"==typeof(S=A)||\"number\"==typeof S||\"boolean\"==typeof S||\"symbol\"==typeof S||\"bigint\"==typeof S||i.isBuffer(A))return f?[v(w?r:f(r,d.encoder,x,\"key\",b))+\"=\"+v(f(A,d.encoder,x,\"value\",b))]:[v(r)+\"=\"+v(String(A))];var O,I=[];if(void 0===A)return I;if(\"comma\"===o&&u(A))w&&f&&(A=i.maybeMap(A,f)),O=[{value:A.length>0?A.join(\",\")||null:void 0}];else if(u(h))O=h;else{var P=Object.keys(A);O=y?P.sort(y):P}for(var R=s&&u(A)&&1===A.length?r+\"[]\":r,j=0;j0?x+w:\"\"}},function(t,e,r){\"use strict\";var n=r(44),i=r(145),o=r(147),s=n(\"%TypeError%\"),a=n(\"%WeakMap%\",!0),u=n(\"%Map%\",!0),c=i(\"WeakMap.prototype.get\",!0),l=i(\"WeakMap.prototype.set\",!0),f=i(\"WeakMap.prototype.has\",!0),h=i(\"Map.prototype.get\",!0),d=i(\"Map.prototype.set\",!0),p=i(\"Map.prototype.has\",!0),y=function(t,e){for(var r,n=t;null!==(r=n.next);n=r)if(r.key===e)return n.next=r.next,r.next=t.next,t.next=r,r};t.exports=function(){var t,e,r,n={assert:function(t){if(!n.has(t))throw new s(\"Side channel does not contain \"+o(t))},get:function(n){if(a&&n&&(\"object\"==typeof n||\"function\"==typeof n)){if(t)return c(t,n)}else if(u){if(e)return h(e,n)}else if(r)return function(t,e){var r=y(t,e);return r&&r.value}(r,n)},has:function(n){if(a&&n&&(\"object\"==typeof n||\"function\"==typeof n)){if(t)return f(t,n)}else if(u){if(e)return p(e,n)}else if(r)return function(t,e){return!!y(t,e)}(r,n);return!1},set:function(n,i){a&&n&&(\"object\"==typeof n||\"function\"==typeof n)?(t||(t=new a),l(t,n,i)):u?(e||(e=new u),d(e,n,i)):(r||(r={key:{},next:null}),function(t,e,r){var n=y(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}}(r,n,i))}};return n}},function(t,e,r){\"use strict\";var n=\"undefined\"!=typeof Symbol&&Symbol,i=r(141);t.exports=function(){return\"function\"==typeof n&&(\"function\"==typeof Symbol&&(\"symbol\"==typeof n(\"foo\")&&(\"symbol\"==typeof Symbol(\"bar\")&&i())))}},function(t,e,r){\"use strict\";t.exports=function(){if(\"function\"!=typeof Symbol||\"function\"!=typeof Object.getOwnPropertySymbols)return!1;if(\"symbol\"==typeof Symbol.iterator)return!0;var t={},e=Symbol(\"test\"),r=Object(e);if(\"string\"==typeof e)return!1;if(\"[object Symbol]\"!==Object.prototype.toString.call(e))return!1;if(\"[object Symbol]\"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if(\"function\"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if(\"function\"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if(\"function\"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(t,e);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},function(t,e,r){\"use strict\";var n={foo:{}},i=Object;t.exports=function(){return{__proto__:n}.foo===n.foo&&!({__proto__:null}instanceof i)}},function(t,e,r){\"use strict\";var n=\"Function.prototype.bind called on incompatible \",i=Array.prototype.slice,o=Object.prototype.toString;t.exports=function(t){var e=this;if(\"function\"!=typeof e||\"[object Function]\"!==o.call(e))throw new TypeError(n+e);for(var r,s=i.call(arguments,1),a=function(){if(this instanceof r){var n=e.apply(this,s.concat(i.call(arguments)));return Object(n)===n?n:this}return e.apply(t,s.concat(i.call(arguments)))},u=Math.max(0,e.length-s.length),c=[],l=0;l-1?i(r):r}},function(t,e,r){\"use strict\";var n=r(45),i=r(44),o=i(\"%Function.prototype.apply%\"),s=i(\"%Function.prototype.call%\"),a=i(\"%Reflect.apply%\",!0)||n.call(s,o),u=i(\"%Object.getOwnPropertyDescriptor%\",!0),c=i(\"%Object.defineProperty%\",!0),l=i(\"%Math.max%\");if(c)try{c({},\"a\",{value:1})}catch(t){c=null}t.exports=function(t){var e=a(n,s,arguments);if(u&&c){var r=u(e,\"length\");r.configurable&&c(e,\"length\",{value:1+l(0,t.length-(arguments.length-1))})}return e};var f=function(){return a(n,o,arguments)};c?c(t.exports,\"apply\",{value:f}):t.exports.apply=f},function(t,e,r){var n=\"function\"==typeof Map&&Map.prototype,i=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,\"size\"):null,o=n&&i&&\"function\"==typeof i.get?i.get:null,s=n&&Map.prototype.forEach,a=\"function\"==typeof Set&&Set.prototype,u=Object.getOwnPropertyDescriptor&&a?Object.getOwnPropertyDescriptor(Set.prototype,\"size\"):null,c=a&&u&&\"function\"==typeof u.get?u.get:null,l=a&&Set.prototype.forEach,f=\"function\"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,h=\"function\"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,d=\"function\"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,p=Boolean.prototype.valueOf,y=Object.prototype.toString,g=Function.prototype.toString,m=String.prototype.match,b=String.prototype.slice,v=String.prototype.replace,w=String.prototype.toUpperCase,x=String.prototype.toLowerCase,_=RegExp.prototype.test,S=Array.prototype.concat,A=Array.prototype.join,E=Array.prototype.slice,k=Math.floor,T=\"function\"==typeof BigInt?BigInt.prototype.valueOf:null,C=Object.getOwnPropertySymbols,O=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?Symbol.prototype.toString:null,I=\"function\"==typeof Symbol&&\"object\"==typeof Symbol.iterator,P=\"function\"==typeof Symbol&&Symbol.toStringTag&&(typeof Symbol.toStringTag===I||\"symbol\")?Symbol.toStringTag:null,R=Object.prototype.propertyIsEnumerable,j=(\"function\"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function M(t,e){if(t===1/0||t===-1/0||t!=t||t&&t>-1e3&&t<1e3||_.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(\"number\"==typeof t){var n=t<0?-k(-t):k(t);if(n!==t){var i=String(n),o=b.call(e,i.length+1);return v.call(i,r,\"$&_\")+\".\"+v.call(v.call(o,/([0-9]{3})/g,\"$&_\"),/_$/,\"\")}}return v.call(e,r,\"$&_\")}var L=r(148),F=L.custom,N=q(F)?F:null;function D(t,e,r){var n=\"double\"===(r.quoteStyle||e)?\\'\"\\':\"\\'\";return n+t+n}function U(t){return v.call(String(t),/\"/g,\""\")}function B(t){return!(\"[object Array]\"!==W(t)||P&&\"object\"==typeof t&&P in t)}function G(t){return!(\"[object RegExp]\"!==W(t)||P&&\"object\"==typeof t&&P in t)}function q(t){if(I)return t&&\"object\"==typeof t&&t instanceof Symbol;if(\"symbol\"==typeof t)return!0;if(!t||\"object\"!=typeof t||!O)return!1;try{return O.call(t),!0}catch(t){}return!1}t.exports=function t(e,r,n,i){var a=r||{};if(H(a,\"quoteStyle\")&&\"single\"!==a.quoteStyle&&\"double\"!==a.quoteStyle)throw new TypeError(\\'option \"quoteStyle\" must be \"single\" or \"double\"\\');if(H(a,\"maxStringLength\")&&(\"number\"==typeof a.maxStringLength?a.maxStringLength<0&&a.maxStringLength!==1/0:null!==a.maxStringLength))throw new TypeError(\\'option \"maxStringLength\", if provided, must be a positive integer, Infinity, or `null`\\');var u=!H(a,\"customInspect\")||a.customInspect;if(\"boolean\"!=typeof u&&\"symbol\"!==u)throw new TypeError(\"option \\\\\"customInspect\\\\\", if provided, must be `true`, `false`, or `\\'symbol\\'`\");if(H(a,\"indent\")&&null!==a.indent&&\"\\\\t\"!==a.indent&&!(parseInt(a.indent,10)===a.indent&&a.indent>0))throw new TypeError(\\'option \"indent\" must be \"\\\\\\\\t\", an integer > 0, or `null`\\');if(H(a,\"numericSeparator\")&&\"boolean\"!=typeof a.numericSeparator)throw new TypeError(\\'option \"numericSeparator\", if provided, must be `true` or `false`\\');var y=a.numericSeparator;if(void 0===e)return\"undefined\";if(null===e)return\"null\";if(\"boolean\"==typeof e)return e?\"true\":\"false\";if(\"string\"==typeof e)return function t(e,r){if(e.length>r.maxStringLength){var n=e.length-r.maxStringLength,i=\"... \"+n+\" more character\"+(n>1?\"s\":\"\");return t(b.call(e,0,r.maxStringLength),r)+i}return D(v.call(v.call(e,/([\\'\\\\\\\\])/g,\"\\\\\\\\$1\"),/[\\\\x00-\\\\x1f]/g,K),\"single\",r)}(e,a);if(\"number\"==typeof e){if(0===e)return 1/0/e>0?\"0\":\"-0\";var w=String(e);return y?M(e,w):w}if(\"bigint\"==typeof e){var _=String(e)+\"n\";return y?M(e,_):_}var k=void 0===a.depth?5:a.depth;if(void 0===n&&(n=0),n>=k&&k>0&&\"object\"==typeof e)return B(e)?\"[Array]\":\"[Object]\";var C=function(t,e){var r;if(\"\\\\t\"===t.indent)r=\"\\\\t\";else{if(!(\"number\"==typeof t.indent&&t.indent>0))return null;r=A.call(Array(t.indent+1),\" \")}return{base:r,prev:A.call(Array(e+1),r)}}(a,n);if(void 0===i)i=[];else if(V(i,e)>=0)return\"[Circular]\";function F(e,r,o){if(r&&(i=E.call(i)).push(r),o){var s={depth:a.depth};return H(a,\"quoteStyle\")&&(s.quoteStyle=a.quoteStyle),t(e,s,n+1,i)}return t(e,a,n+1,i)}if(\"function\"==typeof e&&!G(e)){var z=function(t){if(t.name)return t.name;var e=m.call(g.call(t),/^function\\\\s*([\\\\w$]+)/);if(e)return e[1];return null}(e),J=Q(e,F);return\"[Function\"+(z?\": \"+z:\" (anonymous)\")+\"]\"+(J.length>0?\" { \"+A.call(J,\", \")+\" }\":\"\")}if(q(e)){var tt=I?v.call(String(e),/^(Symbol\\\\(.*\\\\))_[^)]*$/,\"$1\"):O.call(e);return\"object\"!=typeof e||I?tt:$(tt)}if(function(t){if(!t||\"object\"!=typeof t)return!1;if(\"undefined\"!=typeof HTMLElement&&t instanceof HTMLElement)return!0;return\"string\"==typeof t.nodeName&&\"function\"==typeof t.getAttribute}(e)){for(var et=\"<\"+x.call(String(e.nodeName)),rt=e.attributes||[],nt=0;nt\",e.childNodes&&e.childNodes.length&&(et+=\"...\"),et+=\"\"}if(B(e)){if(0===e.length)return\"[]\";var it=Q(e,F);return C&&!function(t){for(var e=0;e=0)return!1;return!0}(it)?\"[\"+X(it,C)+\"]\":\"[ \"+A.call(it,\", \")+\" ]\"}if(function(t){return!(\"[object Error]\"!==W(t)||P&&\"object\"==typeof t&&P in t)}(e)){var ot=Q(e,F);return\"cause\"in Error.prototype||!(\"cause\"in e)||R.call(e,\"cause\")?0===ot.length?\"[\"+String(e)+\"]\":\"{ [\"+String(e)+\"] \"+A.call(ot,\", \")+\" }\":\"{ [\"+String(e)+\"] \"+A.call(S.call(\"[cause]: \"+F(e.cause),ot),\", \")+\" }\"}if(\"object\"==typeof e&&u){if(N&&\"function\"==typeof e[N]&&L)return L(e,{depth:k-n});if(\"symbol\"!==u&&\"function\"==typeof e.inspect)return e.inspect()}if(function(t){if(!o||!t||\"object\"!=typeof t)return!1;try{o.call(t);try{c.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(e)){var st=[];return s&&s.call(e,(function(t,r){st.push(F(r,e,!0)+\" => \"+F(t,e))})),Z(\"Map\",o.call(e),st,C)}if(function(t){if(!c||!t||\"object\"!=typeof t)return!1;try{c.call(t);try{o.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(e)){var at=[];return l&&l.call(e,(function(t){at.push(F(t,e))})),Z(\"Set\",c.call(e),at,C)}if(function(t){if(!f||!t||\"object\"!=typeof t)return!1;try{f.call(t,f);try{h.call(t,h)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(e))return Y(\"WeakMap\");if(function(t){if(!h||!t||\"object\"!=typeof t)return!1;try{h.call(t,h);try{f.call(t,f)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(e))return Y(\"WeakSet\");if(function(t){if(!d||!t||\"object\"!=typeof t)return!1;try{return d.call(t),!0}catch(t){}return!1}(e))return Y(\"WeakRef\");if(function(t){return!(\"[object Number]\"!==W(t)||P&&\"object\"==typeof t&&P in t)}(e))return $(F(Number(e)));if(function(t){if(!t||\"object\"!=typeof t||!T)return!1;try{return T.call(t),!0}catch(t){}return!1}(e))return $(F(T.call(e)));if(function(t){return!(\"[object Boolean]\"!==W(t)||P&&\"object\"==typeof t&&P in t)}(e))return $(p.call(e));if(function(t){return!(\"[object String]\"!==W(t)||P&&\"object\"==typeof t&&P in t)}(e))return $(F(String(e)));if(!function(t){return!(\"[object Date]\"!==W(t)||P&&\"object\"==typeof t&&P in t)}(e)&&!G(e)){var ut=Q(e,F),ct=j?j(e)===Object.prototype:e instanceof Object||e.constructor===Object,lt=e instanceof Object?\"\":\"null prototype\",ft=!ct&&P&&Object(e)===e&&P in e?b.call(W(e),8,-1):lt?\"Object\":\"\",ht=(ct||\"function\"!=typeof e.constructor?\"\":e.constructor.name?e.constructor.name+\" \":\"\")+(ft||lt?\"[\"+A.call(S.call([],ft||[],lt||[]),\": \")+\"] \":\"\");return 0===ut.length?ht+\"{}\":C?ht+\"{\"+X(ut,C)+\"}\":ht+\"{ \"+A.call(ut,\", \")+\" }\"}return String(e)};var z=Object.prototype.hasOwnProperty||function(t){return t in this};function H(t,e){return z.call(t,e)}function W(t){return y.call(t)}function V(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;r-1?t.split(\",\"):t},c=function(t,e,r,n){if(t){var o=r.allowDots?t.replace(/\\\\.([^.[]+)/g,\"[$1]\"):t,s=/(\\\\[[^[\\\\]]*])/g,a=r.depth>0&&/(\\\\[[^[\\\\]]*])/.exec(o),c=a?o.slice(0,a.index):o,l=[];if(c){if(!r.plainObjects&&i.call(Object.prototype,c)&&!r.allowPrototypes)return;l.push(c)}for(var f=0;r.depth>0&&null!==(a=s.exec(o))&&f=0;--o){var s,a=t[o];if(\"[]\"===a&&r.parseArrays)s=[].concat(i);else{s=r.plainObjects?Object.create(null):{};var c=\"[\"===a.charAt(0)&&\"]\"===a.charAt(a.length-1)?a.slice(1,-1):a,l=parseInt(c,10);r.parseArrays||\"\"!==c?!isNaN(l)&&a!==c&&String(l)===c&&l>=0&&r.parseArrays&&l<=r.arrayLimit?(s=[])[l]=i:\"__proto__\"!==c&&(s[c]=i):s={0:i}}i=s}return i}(l,e,r,n)}};t.exports=function(t,e){var r=function(t){if(!t)return s;if(null!==t.decoder&&void 0!==t.decoder&&\"function\"!=typeof t.decoder)throw new TypeError(\"Decoder has to be a function.\");if(void 0!==t.charset&&\"utf-8\"!==t.charset&&\"iso-8859-1\"!==t.charset)throw new TypeError(\"The charset option must be either utf-8, iso-8859-1, or undefined\");var e=void 0===t.charset?s.charset:t.charset;return{allowDots:void 0===t.allowDots?s.allowDots:!!t.allowDots,allowPrototypes:\"boolean\"==typeof t.allowPrototypes?t.allowPrototypes:s.allowPrototypes,allowSparse:\"boolean\"==typeof t.allowSparse?t.allowSparse:s.allowSparse,arrayLimit:\"number\"==typeof t.arrayLimit?t.arrayLimit:s.arrayLimit,charset:e,charsetSentinel:\"boolean\"==typeof t.charsetSentinel?t.charsetSentinel:s.charsetSentinel,comma:\"boolean\"==typeof t.comma?t.comma:s.comma,decoder:\"function\"==typeof t.decoder?t.decoder:s.decoder,delimiter:\"string\"==typeof t.delimiter||n.isRegExp(t.delimiter)?t.delimiter:s.delimiter,depth:\"number\"==typeof t.depth||!1===t.depth?+t.depth:s.depth,ignoreQueryPrefix:!0===t.ignoreQueryPrefix,interpretNumericEntities:\"boolean\"==typeof t.interpretNumericEntities?t.interpretNumericEntities:s.interpretNumericEntities,parameterLimit:\"number\"==typeof t.parameterLimit?t.parameterLimit:s.parameterLimit,parseArrays:!1!==t.parseArrays,plainObjects:\"boolean\"==typeof t.plainObjects?t.plainObjects:s.plainObjects,strictNullHandling:\"boolean\"==typeof t.strictNullHandling?t.strictNullHandling:s.strictNullHandling}}(e);if(\"\"===t||null==t)return r.plainObjects?Object.create(null):{};for(var l=\"string\"==typeof t?function(t,e){var r,c={__proto__:null},l=e.ignoreQueryPrefix?t.replace(/^\\\\?/,\"\"):t,f=e.parameterLimit===1/0?void 0:e.parameterLimit,h=l.split(e.delimiter,f),d=-1,p=e.charset;if(e.charsetSentinel)for(r=0;r-1&&(g=o(g)?[g]:g),i.call(c,y)?c[y]=n.combine(c[y],g):c[y]=g}return c}(t,r):t,f=r.plainObjects?Object.create(null):{},h=Object.keys(l),d=0;d{e&&console.log(\"starting getPalette with image\",t);const{fileDirectory:r}=t,{BitsPerSample:n,ColorMap:i,ImageLength:o,ImageWidth:s,PhotometricInterpretation:a,SampleFormat:u,SamplesPerPixel:c}=r;if(!i)throw new Error(\"[geotiff-palette]: the image does not contain a color map, so we can\\'t make a palette.\");const l=Math.pow(2,n);e&&console.log(\"[geotiff-palette]: count:\",l);const f=i.length/3;if(e&&console.log(\"[geotiff-palette]: bandSize:\",f),f!==l)throw new Error(\"[geotiff-palette]: can\\'t handle situations where the color map has more or less values than the number of possible values in a raster\");const h=f,d=h+f,p=[];for(let t=0;te in t?i(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,c=(t,e)=>i(t,\"name\",{value:e,configurable:!0});const l=r(152),f=r(187),h=r(189),d=c(t=>new Array(t).fill(0).map((t,e)=>e),\"range\");function p(t,e={}){var r=e,{bands:n,height:i,precise:c=!1,stats:p,width:y,layout:g}=r,m=((t,e)=>{var r={};for(var n in t)s.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&o)for(var n of o(t))e.indexOf(n)<0&&a.call(t,n)&&(r[n]=t[n]);return r})(r,[\"bands\",\"height\",\"precise\",\"stats\",\"width\",\"layout\"]);if(\"function\"==typeof t.then)throw new Error(\"[calc-image-stats] you passed in a promise as the data values. please resolve the promise first before calling calcImageStats\");const b=f({bands:n,data:t,height:i,layout:g,width:y});null!=n||(n=b.bands),null!=i||(i=b.height),null!=g||(g=b.layout),null!=y||(y=b.width);const v=d(n).map(e=>{let r;const f=((t,e)=>{for(var r in e||(e={}))s.call(e,r)&&u(t,r,e[r]);if(o)for(var r of o(e))a.call(e,r)&&u(t,r,e[r]);return t})({precise:c,stats:p},m);if([\"[band][row,column]\",\"[band][column,row]\"].includes(g))r=t[e];else if([\"[band][row][column]\",\"[band][column][row]\"].includes(g))r=t[e],f.chunked=!0;else if(1===n&&[\"[band,row,column]\",\"[row,column,band]\",\"[column,band,row]\",\"[column,row,band]\"].includes(g))r=t;else{const o={band:[e,e]},s={band:n,column:y,row:i};r=h.iterClip({data:t,layout:g,rect:o,sizes:s})}return l(r,f)});return{depth:n,height:i,width:y,bands:v}}c(p,\"calcImageStats\"),void 0!==(n=function(){return p}.call(e,r,e,t))&&(t.exports=n),t.exports=p,t.exports.default=p,t.exports.calcImageStats=p,\"object\"==typeof self&&(self.calcImageStats=p),\"object\"==typeof window&&(self.calcImageStats=p)},function(t,e,r){var n;const{getOrCreateIterator:i}=r(72),{add:o,compare:s,divide:a,mean:u,multiply:c,pow:l,sort:f,subtract:h,sum:d}=r(153),p=r(176);function y(t,{async:e=!1,chunked:r=!1,noData:n,filter:d,calcCount:y=!0,calcHistogram:g=!0,calcInvalid:m=!0,calcMax:b=!0,calcMean:v=!0,calcMedian:w=!0,calcMin:x=!0,calcMode:_=!0,calcModes:S=!0,calcProduct:A=!0,calcRange:E=!0,calcStd:k=!0,calcSum:T=!0,calcValid:C=!0,calcVariance:O=!0,calcUniques:I=!0,precise:P=!1,precise_max_decimal_digits:R=100,stats:j}={debugLevel:0}){j&&(j.forEach(t=>{[\"count\",\"histogram\",\"invalid\",\"max\",\"mean\",\"median\",\"min\",\"mode\",\"modes\",\"product\",\"range\",\"sum\",\"std\",\"valid\",\"variance\",\"uniques\"].includes(t)||console.warn(`[calc-stats] skipping unknown stat \"${t}\"`)}),y=j.includes(\"count\"),g=j.includes(\"histogram\"),m=j.includes(\"invalid\"),b=j.includes(\"max\"),v=j.includes(\"mean\"),w=j.includes(\"median\"),x=j.includes(\"min\"),_=j.includes(\"mode\"),S=j.includes(\"modes\"),A=j.includes(\"product\"),E=j.includes(\"range\"),k=j.includes(\"std\"),T=j.includes(\"sum\"),C=j.includes(\"valid\"),O=j.includes(\"variance\"),I=j.includes(\"uniques\"));const M=i(t);let L,F,N,D=g||w||_||S||O||k||I,U=y||v||w||A||C||O||k||\"function\"==typeof d,B=y||m||\"function\"==typeof d,G=T||v||O||k,q=x||E,z=b||E,H=A,W=0,V=0,K=0,$=P?\"0\":0;const Y={};let Z,X;Z=P?t=>{t=t.toString(),U&&W++,!q||void 0!==L&&\"<\"!==s(t,L)||(L=t),!z||void 0!==F&&\">\"!==s(t,F)||(F=t),H&&(N=1===W?t:c(N,t)),G&&($=o($,t)),D&&(t in Y?Y[t].ct++:Y[t]={n:t.toString(),ct:1})}:t=>{U&&W++,q&&(void 0===L||tF)&&(F=t),H&&(N=1===W?t:N*t),G&&($+=t),D&&(t in Y?Y[t].ct++:Y[t]={n:t,ct:1})},X=\"number\"==typeof n&&\"function\"==typeof d?t=>{K++,\"number\"!=typeof t||isNaN(t)||t===n||!0!==d({valid:W,index:K,value:t})?B&&V++:Z(t)}:\"number\"==typeof n?t=>{\"number\"!=typeof t||isNaN(t)||t===n?B&&V++:Z(t)}:\"function\"==typeof d?t=>{K++,\"number\"!=typeof t||isNaN(t)||!0!==d({valid:W,index:K,value:t})?B&&V++:Z(t)}:t=>{\"number\"!=typeof t||isNaN(t)?B&&V++:Z(t)};const Q=()=>{const t={};if(y&&(t.count=P?o(V.toString(),W.toString()):V+W),C&&(t.valid=P?W.toString():W),m&&(t.invalid=P?V.toString():V),w&&(t.median=p.calculate({counts:Y,precise:P,total:W})),x&&(t.min=L),b&&(t.max=F),A&&(t.product=N),T&&(t.sum=$),E&&(t.range=P?h(F.toString(),L.toString()):F-L),v||O||k){const e=P?a($,W.toString(),{max_decimal_digits:R}):$/W;if(v&&(t.mean=e),O||k){const r=(({count:t,histogram:e,mean_value:r,precise:n=!1})=>{if(n){r=r.toString();const n=Object.values(e).reduce((t,{n:e,ct:n})=>{const i=h(e.toString(),r);return o(t,c(n.toString(),l(i,\"2\")))},\"0\");return a(n,t.toString())}return Object.values(e).reduce((t,{n:e,ct:n})=>t+n*Math.pow(e-r,2),0)/t})({count:W,histogram:Y,mean_value:e,precise:P});O&&(t.variance=r),k&&(t.std=P?Math.sqrt(Number(r)).toString():Math.sqrt(r))}}if(g&&(P&&Object.values(Y).forEach(t=>{t.ct=t.ct.toString()}),t.histogram=Y),_||S){let e=0,r=[];for(let t in Y){const{n:n,ct:i}=Y[t];i===e?r.push(P?n.toString():n):i>e&&(e=i,r=[P?n.toString():n])}S&&(t.modes=r),_&&(t.mode=P?u(r):r.reduce((t,e)=>t+e,0)/r.length)}return I&&(t.uniques=P?f(Object.keys(Y)):Object.values(Y).map(({n:t})=>t).sort((t,e)=>t-e)),t};if(r){if(e)return(async()=>{for await(let t of M)for(let e of t)X(e);return Q()})();for(let t of M)for(let e of t)X(e);return Q()}if(e)return(async()=>{for await(let t of M)X(t);return Q()})();for(let t of M)X(t);return Q()}void 0===(n=function(){return y}.call(e,r,e,t))||(t.exports=n),t.exports=y,t.exports.default=y,t.exports.calcStats=y,\"object\"==typeof self&&(self.calcStats=y),\"object\"==typeof window&&(window.calcStats=y)},function(t,e,r){\"use strict\";var n;const i=r(4),o=r(6),s=r(154),a=r(76),u=r(0),c=r(34),l=r(5),f=r(156),h=r(158),d=r(51),p=r(84),y=r(162),g=r(163),m=r(1),b=r(88),v=r(89),w=r(73),x=r(75),_=r(164),S=r(165),A=r(77),E=r(166),k=r(167),T=r(15),C=r(16),O=r(90),I=r(91),P=r(11),R=r(8),j=r(32),M=r(48),L=r(31),F=r(168),N={absolute:i,add:o,binomial_coefficient:s,ceil:a,clean:u,compare:c,compare_positive:l,constants:f,cosine_radians:h,count_decimal_digits:d,count_integer_digits:p,cube:y,cube_root:g,divide:m,eulers_number:b,exp:v,expand:w,factorial:x,flip_sign:_,floor:S,fraction:A,hypotenuse:E,is_infinity:T,is_integer:C,is_factorial:k,is_negative_infinity:O,is_positive_infinity:I,is_zero:P,long_addition:R,long_division:j,long_multiplication:M,long_subtraction:L,mean:r(169),max:F,min:r(86),multiply:r(53),multiply_array:r(79),multiply_range:r(47),nilakantha:r(170),ols:r(171),pow:r(35),pow_positive:r(54),primes:r(87),reciprocal:r(81),remainder:r(172),root:r(37),root_integer_digits:r(83),round:r(36),round_last_decimal:r(49),sign:r(22),sign_nonzero:r(50),simplify_fraction:r(85),sine_radians:r(173),softmax:r(174),sort:r(175),square:r(23),square_root:r(92),subtract:r(33),sum:r(55),truncate:r(93)};void 0===(n=function(){return N}.call(e,r,e,t))||(t.exports=n),t.exports=N,t.exports.default=N,\"object\"==typeof window&&(window.preciso=N),\"object\"==typeof self&&(self.preciso=N)},function(t,e,r){\"use strict\";const n=r(0),i=r(5),o=r(75),s=r(8),a=r(31),u=r(32),c=r(47);function l(t,e){switch(t=n(t),e=n(e),i(t,e)){case\"=\":return\"1\";case\">\":{const r=a(t,e),n=c(s(e,\"1\"),t),i=o(r);return u(n,i)}case\"<\":throw new Error(\"[binominal_coefficient] unsupported\")}}t.exports=l,t.exports.default=l},function(t,e,r){\"use strict\";function n(t){return t.substring(0,t.indexOf(\".\"))}t.exports=n,t.exports.default=n},function(t,e,r){\"use strict\";const{MAX_SAFE_INTEGER:n}=r(74),{MAX_SAFE_INTEGER_LENGTH:i}=r(30),{PI:o}=r(157);t.exports={MAX_SAFE_INTEGER:n,MAX_SAFE_INTEGER_LENGTH:i,PI:o}},function(t,e){t.exports={PI_100:\"3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679\"}},function(t,e,r){\"use strict\";const n=r(6),i=r(11),o=r(23),s=r(17),a=r(1);function u(t,{steps:e=100,max_decimal_digits:r=100}={}){if(i(t))return\"0\";let u,c=\"-\",l=\"1\",f=e,h=o(t),d=\"1\",p=\"1\",y=\"0\";for(let t=0;tn(t));return i(o(s),e)}t.exports=s,t.exports.default=s},function(t,e,r){\"use strict\";function n(t){return!!t.match(/^\\\\d+!$/i)}t.exports=n,t.exports.default=n},function(t,e,r){\"use strict\";const n=r(0),i=r(34);function o(t){\"string\"==typeof t&&(t=Array.prototype.slice.call(arguments));let e=n(t[0]);const r=t.length;for(let n=1;n\"===i(r,e)&&(e=r)}return e}t.exports=o,t.exports.default=o},function(t,e,r){\"use strict\";const n=r(6),i=r(1);function o(t,e){let r=0,o=\"0\";for(let e of t)r++,o=n(o,e);return i(o,r.toString(),e)}t.exports=o,t.exports.default=o},function(t,e,r){\"use strict\";const n=r(6),i=r(8),o=r(1),s=r(17);function a(t=100,{divide_options:e}={}){let r=\"+\",a=\"3\",u=\"2\",c=\"3\",l=\"4\";for(let f=1;fi(t,{max_decimal_digits:e}));const r=o(t);return t.map(t=>n(t,r,{max_decimal_digits:e,ellipsis:!1}))}t.exports=s,t.exports.default=s},function(t,e,r){\"use strict\";const n=r(34);function i(t,{direction:e=\"ascending\"}={direction:\"ascending\"}){const r=\"desc\"===e||\"descending\"===e?\"<\":\">\";return t.sort((t,e)=>n(t,e)===r?1:-1)}t.exports=i,t.exports.default=i},function(t,e,r){var n;const i=r(177),o=r(186);function s({counts:t,nums:e,no_data:r,precise:n,threshold:s=50,total:a}){return void 0!==t||void 0!==a||e.length>s?i({counts:t,no_data:r,nums:e,precise:n,total:a}):o({no_data:r,nums:e,precise:n})}const a={calculate:s};void 0===(n=function(){return a}.call(e,r,e,t))||(t.exports=n),t.exports=a,t.exports.default={calculate:s},\"object\"==typeof window&&(window.mediana=a),\"object\"==typeof self&&(self.mediana=a)},function(t,e,r){const n=r(178),i=r(94);function o({counts:t,nums:e,no_data:r,precise:o=!1,total:s}){void 0!==t&&void 0!==s||({counts:t,total:s}=n({nums:e,no_data:r}));const a=Object.values(t).sort((t,e)=>t.n-e.n),u=s/2,c=a.length;if(0!==c){if(1===c)return o?a[0].n.toString():a[0].n;{let t=0;if(s%2==0)for(let e=0;eu)return t-n===u?i(a[e-1].n,r,{precise:o}):o?r.toString():r}else for(let e=0;eu)return o?r.toString():r}}}}t.exports=o,t.exports.default=o},function(t,e){function r({nums:t,no_data:e}){let r=t.length;const n={};let i=0;if(void 0!==e)for(let o=0;o=a){const t=s-a;let r=o;for(let e=0;es;t--)result+=\"0\";return result+=o,e+result}return e+o.substring(0,s)+\".\"+o.substring(s)}t.exports=r,t.exports.default=r},function(t,e,r){const n=r(98),i=r(18),o=r(181);function s(t,e,r){if(t=i(t),\"0\"===(e=i(e)))throw new Error(\"[preciso] division by zero\");if(\"\"===t||\"0\"===t)return\"0\";const s=\"-\"!==t[0],a=\"-\"!==e[0],u=s!==a?\"-\":\"\";return s||(t=n(t)),a||(e=n(e)),u+o(t,e,r)}t.exports=s,t.exports.default=s},function(t,e,r){const n=r(38),i=r(95),o=(r(182),r(184)),s=r(185);t.exports=function(t,e,{max_decimal_digits:r=100,ellipsis:a=!1}={}){\"0\"===t[0]&&(t=t.substring(1)),\"0\"===e[0]&&(e=e.substring(1));const u=t.indexOf(\".\"),c=e.indexOf(\".\"),l=-1===u?t.length:u,f=-1===c?0:e.length-1-c;let h=!1;t=t.replace(/\\\\./,\"\"),e=e.replace(/\\\\./,\"\");const d=t.length;let p,y=\"\",g=\"\",m=-1*f,b=0;for(let r=0;r\"===p){let t=1,r=i(e,e),s=e;for(;\">\"!==n(r,y);)t++,s=r,r=i(r,e);if(t=t.toString(),\"\"!==g)for(let e=t.length;e<=b;e++)g+=\"0\";g+=t,y=o(y,s),b=0}else{if(\"<\"===p){\"\"===g&&m++,b++;continue}if(\"=\"===p){if(\"\"!==g)for(let t=0;t3){g+=\"...\",h=!0;break}}else t[y]=1;const r=n(y,e);if(\">\"===r){let t=1,r=i(e,e),s=e;for(;\">\"!==n(r,y);)t++,s=r,r=i(r,e);t=t.toString();for(let e=t.length;e<=b;e++)g+=\"0\";if(g+=t,y=o(y,s),\"0\"===y)break;b=0}else{if(\"<\"===r){b++;continue}if(\"=\"===r){for(let t=0;tw){for(let t=w;t0&&(g=s(g.substring(0,g.length-t+1)))}return\".\"===g[0]&&(g=\"0\"+g),g}},function(t,e,r){const n=r(98),i=r(18),o=r(38),s=r(183);function a(t,e){t=i(t),e=i(e);const r=\"-\"!==t[0]!==(\"-\"!==e[0])?\"-\":\"\";t=n(t),e=n(e);if(\"<\"===o(t,e)){const r=t;t=e,e=r}return r+s(t,e)}t.exports=a,t.exports.default=a},function(t,e,r){const{MAX_SAFE_INTEGER_LENGTH:n}=r(56);t.exports=function(t,e){if(\"0\"===t||\"0\"===e)return\"0\";const r=t.indexOf(\".\"),i=e.indexOf(\".\"),o=(-1===r?t.length:r)+(-1===i?e.length:i),s=(-1===r?0:t.length-1-r)+(-1===i?0:e.length-1-i);if(0===s&&o=0;){const t=h,e=h-=15,r=a.substring(e,t);f.push([Number(r),r.length])}const d=[],p=[];for(let t=0,e=l-1;e>=0;e--,t++){const r=u[e],n=Number(r);let i=0,o=\"\";const s=f.length-1;f.forEach(([t,e],r)=>{let a=(i+n*t).toString();const u=a.length;if(u>e&&r!==s){const t=-1*e;o=a.slice(t)+o,i=Number(a.slice(0,t))}else{const t=e-u;for(let e=0;eNumber(t)),o.length])}const y=d.length,g=p[p.length-1][1]+y;let m=\"\",b=0;for(let t=0;t=0&&(e+=r[o])}e>=10?(e=e.toString(),m=e[e.length-1]+m,b=Number(e.slice(0,-1))):(m=e+m,b=0)}if(0===s)m=m.replace(/^0+/,\"\");else{const t=m.length-s;m=m.substring(0,t)+\".\"+m.substring(t),m=m.replace(/^0+/,\"\"),m=m.replace(/\\\\.?0+$/,\"\"),\".\"===m[0]&&(m=\"0\"+m)}return m}},function(t,e,r){const n=r(18),i=r(38),o=r(96),s=r(97);function a(t,e){t=n(t),e=n(e);const r=\"-\"!==t[0],a=\"-\"!==e[0];if(r){if(a){const r=i(t,e);return\">\"===r?s(t,e):\"<\"===r?\"-\"+s(e,t):\"0\"}return o(t,e.substring(1))}if(a)return\"-\"+o(t.substring(1),e);{t=t.substring(1),e=e.substring(1);const r=i(t,e);return\">\"===r?\"-\"+s(t,e):\"<\"===r?s(e,t):\"0\"}}t.exports=a,t.exports.default=a},function(t,e){const r=[\"5\",\"6\",\"7\",\"8\",\"9\"];t.exports=function(t){\"+\"===t[0]&&(t=t.substring(1));const e=t.length;let n=\"\";const i=t[t.length-1];if(r.includes(i)){let r;for(r=e-2;r>=0;r--){const e=t[r];if(\".\"===e||\"-\"===e)continue;const i=Number(e)+1;if(10!==i){n=i+n;break}n=\"0\"+n}r>0&&(n=t.substring(0,r)+n)}else n=t.substring(0,e-1);return\".\"===n[n.length-1]&&(n=n.substring(0,n.length-1)),n.indexOf(\".\")>-1&&(n=n.replace(/0+$/,\"\")),n}},function(t,e,r){const n=r(94);function i({nums:t,no_data:e,precise:r=!1}){switch((t=t.filter(t=>t!==e).sort((t,e)=>t-e)).length){case 0:return;case 1:return r?t[0].toString():t[0];default:const e=t.length/2;if(t.length%2==0)return n(t[e-1],t[e],{precise:r});{const n=Math.floor(e);return r?t[n].toString():t[n]}}}t.exports=i,t.exports.default=i},function(t,e,r){var n;const i=r(188);function o({bands:t,data:e,height:r,layout:n,width:o}){const s=i(e);if(\"[row,column,band]\"===n||1===s)return{layout:\"[row,column,band]\",bands:t||(r&&o?e.length/(r*o):void 0),height:r||(t&&o?e.length/(t*o):void 0),width:o||(t&&r?e.length/(t*r):void 0)};if(2===s){if(!r||!o)return e.lengthArray.isArray(t)||t instanceof Int8Array||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array||t instanceof Float64Array||t instanceof BigInt64Array||t instanceof BigUint64Array;let r=0,n=t;for(;e(n);)r++,n=n[0];return r}},function(t,e,r){const n={},{wrapNextFunction:i}=r(72),o=r(190),s=r(191),a={Array:Array,Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:Uint8ClampedArray,Int16Array:Int16Array,Uint16Array:Uint16Array,Float32Array:Float32Array,Float64Array:Float64Array};try{a.BigInt64Array=BigInt64Array,a.BigUint64Array=BigUint64Array}catch(t){}const u=t=>t.match(/\\\\[[^\\\\]]+\\\\]/g),c=t=>t.startsWith(\"[\")&&t.endsWith(\"]\")?t.substring(1,t.length-1):t,l=t=>t.startsWith(\"(\")&&t.endsWith(\")\")?t.substring(1,t.length-1):t,f=t=>t.match(/(\\\\(.*?\\\\)|[^\\\\(,\\\\s]+)(?=\\\\s*,|\\\\s*$)/g),h=t=>{t=c(t),t=l(t);const e=f(t);return 1===e.length?{type:\"Vector\",dim:e[0]}:{type:\"Matrix\",parts:e.map(h)}};function d(t){const e=t.match(/[^ A-Za-z,\\\\[\\\\]]/g);if(e)throw new Error(\"The following invalid characters were used: \"+e.map(t=>`\"${t}\"`).join(\", \"));return!0}function p(t,{useLayoutCache:e=!0}={useLayoutCache:!0}){if(e&&t in n)return n[t];d(t);const r=u(t).map(h),i={type:\"Layout\",summary:r.map(t=>\"Matrix\"===t.type?t.parts.length:1),dims:r};return e&&(n[t]=i),i}function y({useLayoutCache:t=!0,data:e,layout:r,sizes:n={}}){\"string\"==typeof r&&(r=p(r,{useLayoutCache:t}));const{dims:i}=r,o=i.length,a=m({useLayoutCache:t,layout:r,sizes:n}),u=o-1,c=r.summary.toString();if(c in s){const t={data:e};return r.dims.map((e,r)=>{\"Vector\"===e.type?t[`d${r}v0`]=e.dim:\"Matrix\"===e.type&&e.parts.forEach((e,n)=>{t[`d${r}v${n}`]=e.dim,t[`m${r}v${n}`]=a[e.dim]})}),s[c].bind(t)}return({point:t,value:r})=>{let n=e;for(let e=0;ee+a[r]*t[r],0),o?n[c]=r:n=n[c]}}}function g({rect:t={}}){if(t)for(let e in t){const r=t[e];if(2!==r.length)throw new Error(\"[xdim] uh oh. invalid hyper-rectangle\");const[n,i]=r;if(n>i)throw new Error(`[xdim] uh oh. invalid range for \"${e}\". Start of ${n} can\\'t be greater than end of ${i}.`);if(n<0)throw new Error(\"[xdim] uh oh. invalid hyper-rectangle with start \"+n)}}function m({useLayoutCache:t=!0,layout:e,sizes:r}){\"string\"==typeof e&&(e=p(e,{useLayoutCache:t}));const{dims:n}=e,i=n.length;let o={};for(let t=0;t=0;e--){const{dim:i}=t[e];o[i]=n,n*=r[t[e].dim]}}}return o}function b({useLayoutCache:t=!0,data:e,layout:r,point:n,sizes:i={}}){let o,s;\"string\"==typeof r&&(r=p(r,{useLayoutCache:t}));let a=e;const{dims:u}=r,c=u.length;for(let t=0;t=0;e--){const o=t[e];if(\"Vector\"===o.type){const{dim:t}=o;if(r+=u*n[t],e>0){if(!(t in i))throw new Error(`you cannot calculate the location without knowing the size of the \"${t}\" dimension.`);u*=i[t]}}}o=a,s=r,a=a[r]}}return{index:s,value:a,parent:o}}function v({arr:t,fill:e,lens:r,arrayTypes:n}){if(0===r.length)return t;const i=r[0];if(1===r.length){const r=n?n[n.length-1]:\"Array\";for(let n=0;n\"Vector\"===t.type?n[t.dim]:\"Matrix\"===t.type?t.parts.reduce((t,e)=>{if(!(e.dim in n))throw new Error(`[xdim] could not find \"${e.dim}\" in sizes: { ${Object.keys(n).join(\", \")} }`);return t*n[e.dim]},1):void 0);return{data:w({fill:t,shape:o,arrayTypes:i}),shape:o,arrayTypes:i}}function _({start:t=0,end:e=100}){let r=t-1;return e+=1,i((function(){return r++,r===e?{done:!0}:{done:!1,value:r}}))}function S({order:t,sizes:e,rect:r={}}){const n=Array.isArray(t)?t:Object.keys(e).sort((t,r)=>e[t]-e[r]),o=new Array(n.length),s={};for(let t=0;t=0;t--){const{value:i,done:a}=o[t].next();if(!a){for(let i=t+1;i{\"Vector\"===e.type?t[`d${r}v0`]=e.dim:\"Matrix\"===e.type&&e.parts.forEach((e,n)=>{t[`d${r}v${n}`]=e.dim,t[`m${r}v${n}`]=a[e.dim]})}),o[c].bind(t)}return({point:t})=>{let r=e;for(let e=0;ee+a[r]*t[r],0),n)return{index:s,parent:r,value:r[s]};r=r[s]}}},prepareUpdate:y,removeBraces:c,removeParentheses:l,select:b,transform:function({data:t,fill:e,from:r,to:n,sizes:i,useLayoutCache:o=!0}){\"string\"==typeof r&&(r=p(r,{useLayoutCache:o})),\"string\"==typeof n&&(n=p(n,{useLayoutCache:o}));const{data:s}=x({fill:e,layout:n,sizes:i}),a=y({useLayoutCache:o,data:s,layout:n,sizes:i}),u=S({sizes:i});for(point of u){const{value:e}=b({data:t,layout:r,point:point,sizes:i});a({point:point,value:e})}return{data:s}},update:function({useLayoutCache:t=!0,data:e,layout:r,point:n,sizes:i={},value:o}){\"string\"==typeof r&&(r=p(r,{useLayoutCache:t}));const{dims:s}=r;for(let t=0;t=0;r--){const o=t[r],{dim:s}=o;if(u+=e*n[s],r>0){if(!(s in i))throw new Error(`you cannot calculate the location without knowing the size of the \"${s}\" dimension.`);e*=i[s]}}}r?e[u]=o:e=e[u]}},clip:function({useLayoutCache:t=!0,data:e,layout:r,rect:n,sizes:i={},flat:o=!1,validate:s=!0}){s&&g({rect:n}),\"string\"==typeof r&&(r=p(r,{useLayoutCache:t}));let a=[e];if(r.dims.forEach(t=>{let e=[];a.forEach(r=>{if(\"Vector\"===t.type){const[i,o]=n[t.dim];e=e.concat(r.slice(i,o+1))}else{const{parts:o}=t;let s=[0],a=1;for(let t=o.length-1;t>=0;t--){const e=o[t],{dim:r}=e,[u,c]=n[r],l=[];for(let t=u;t<=c;t++)s.forEach(e=>{l.push(e+a*t)});s=l,a*=i[r]}s.forEach(t=>{e.push(r[t])})}}),a=e}),o)return{data:a};const u=Object.fromEntries(Object.entries(n).map(([t,[e,r]])=>[t,r-e+1])),{data:c}=x({layout:r,sizes:u}),l=r.dims.length,f=(t,e)=>{if(e===l)for(let e=0;ef(t,e+1))};return f(c,1),{data:c}},validateRect:g}},function(t,e){t.exports={1:function({point:t}){const e=this.data,r=t[this.d0v0];return{parent:e,index:r,value:e[r]}},2:function({point:t}){const e=this.data,r=this.m0v0*t[this.d0v0]+this.m0v1*t[this.d0v1];return{parent:e,index:r,value:e[r]}},3:function({point:t}){const e=this.data,r=this.m0v0*t[this.d0v0]+this.m0v1*t[this.d0v1]+this.m0v2*t[this.d0v2];return{parent:e,index:r,value:e[r]}},4:function({point:t}){const e=this.data,r=this.m0v0*t[this.d0v0]+this.m0v1*t[this.d0v1]+this.m0v2*t[this.d0v2]+this.m0v3*t[this.d0v3];return{parent:e,index:r,value:e[r]}},5:function({point:t}){const e=this.data,r=this.m0v0*t[this.d0v0]+this.m0v1*t[this.d0v1]+this.m0v2*t[this.d0v2]+this.m0v3*t[this.d0v3]+this.m0v4*t[this.d0v4];return{parent:e,index:r,value:e[r]}},\"1,1\":function({point:t}){const e=this.data[t[this.d0v0]],r=t[this.d1v0];return{parent:e,index:r,value:e[r]}},\"1,2\":function({point:t}){const e=this.data[t[this.d0v0]],r=this.m1v0*t[this.d1v0]+this.m1v1*t[this.d1v1];return{parent:e,index:r,value:e[r]}},\"1,3\":function({point:t}){const e=this.data[t[this.d0v0]],r=this.m1v0*t[this.d1v0]+this.m1v1*t[this.d1v1]+this.m1v2*t[this.d1v2];return{parent:e,index:r,value:e[r]}},\"1,4\":function({point:t}){const e=this.data[t[this.d0v0]],r=this.m1v0*t[this.d1v0]+this.m1v1*t[this.d1v1]+this.m1v2*t[this.d1v2]+this.m1v3*t[this.d1v3];return{parent:e,index:r,value:e[r]}},\"1,5\":function({point:t}){const e=this.data[t[this.d0v0]],r=this.m1v0*t[this.d1v0]+this.m1v1*t[this.d1v1]+this.m1v2*t[this.d1v2]+this.m1v3*t[this.d1v3]+this.m1v4*t[this.d1v4];return{parent:e,index:r,value:e[r]}},\"1,1,1\":function({point:t}){const e=this.data[t[this.d0v0]][t[this.d1v0]],r=t[this.d2v0];return{parent:e,index:r,value:e[r]}},\"1,1,2\":function({point:t}){const e=this.data[t[this.d0v0]][t[this.d1v0]],r=this.m2v0*t[this.d2v0]+this.m2v1*t[this.d2v1];return{parent:e,index:r,value:e[r]}},\"1,1,3\":function({point:t}){const e=this.data[t[this.d0v0]][t[this.d1v0]],r=this.m2v0*t[this.d2v0]+this.m2v1*t[this.d2v1]+this.m2v2*t[this.d2v2];return{parent:e,index:r,value:e[r]}},\"1,1,4\":function({point:t}){const e=this.data[t[this.d0v0]][t[this.d1v0]],r=this.m2v0*t[this.d2v0]+this.m2v1*t[this.d2v1]+this.m2v2*t[this.d2v2]+this.m2v3*t[this.d2v3];return{parent:e,index:r,value:e[r]}},\"1,1,5\":function({point:t}){const e=this.data[t[this.d0v0]][t[this.d1v0]],r=this.m2v0*t[this.d2v0]+this.m2v1*t[this.d2v1]+this.m2v2*t[this.d2v2]+this.m2v3*t[this.d2v3]+this.m2v4*t[this.d2v4];return{parent:e,index:r,value:e[r]}},\"1,1,1,1\":function({point:t}){const e=this.data[t[this.d0v0]][t[this.d1v0]][t[this.d2v0]],r=t[this.d3v0];return{parent:e,index:r,value:e[r]}},\"1,1,1,2\":function({point:t}){const e=this.data[t[this.d0v0]][t[this.d1v0]][t[this.d2v0]],r=this.m3v0*t[this.d3v0]+this.m3v1*t[this.d3v1];return{parent:e,index:r,value:e[r]}},\"1,1,1,3\":function({point:t}){const e=this.data[t[this.d0v0]][t[this.d1v0]][t[this.d2v0]],r=this.m3v0*t[this.d3v0]+this.m3v1*t[this.d3v1]+this.m3v2*t[this.d3v2];return{parent:e,index:r,value:e[r]}},\"1,1,1,4\":function({point:t}){const e=this.data[t[this.d0v0]][t[this.d1v0]][t[this.d2v0]],r=this.m3v0*t[this.d3v0]+this.m3v1*t[this.d3v1]+this.m3v2*t[this.d3v2]+this.m3v3*t[this.d3v3];return{parent:e,index:r,value:e[r]}},\"1,1,1,5\":function({point:t}){const e=this.data[t[this.d0v0]][t[this.d1v0]][t[this.d2v0]],r=this.m3v0*t[this.d3v0]+this.m3v1*t[this.d3v1]+this.m3v2*t[this.d3v2]+this.m3v3*t[this.d3v3]+this.m3v4*t[this.d3v4];return{parent:e,index:r,value:e[r]}},\"1,1,1,1,1\":function({point:t}){const e=this.data[t[this.d0v0]][t[this.d1v0]][t[this.d2v0]][t[this.d3v0]],r=t[this.d4v0];return{parent:e,index:r,value:e[r]}},\"1,1,1,1,2\":function({point:t}){const e=this.data[t[this.d0v0]][t[this.d1v0]][t[this.d2v0]][t[this.d3v0]],r=this.m4v0*t[this.d4v0]+this.m4v1*t[this.d4v1];return{parent:e,index:r,value:e[r]}},\"1,1,1,1,3\":function({point:t}){const e=this.data[t[this.d0v0]][t[this.d1v0]][t[this.d2v0]][t[this.d3v0]],r=this.m4v0*t[this.d4v0]+this.m4v1*t[this.d4v1]+this.m4v2*t[this.d4v2];return{parent:e,index:r,value:e[r]}},\"1,1,1,1,4\":function({point:t}){const e=this.data[t[this.d0v0]][t[this.d1v0]][t[this.d2v0]][t[this.d3v0]],r=this.m4v0*t[this.d4v0]+this.m4v1*t[this.d4v1]+this.m4v2*t[this.d4v2]+this.m4v3*t[this.d4v3];return{parent:e,index:r,value:e[r]}},\"1,1,1,1,5\":function({point:t}){const e=this.data[t[this.d0v0]][t[this.d1v0]][t[this.d2v0]][t[this.d3v0]],r=this.m4v0*t[this.d4v0]+this.m4v1*t[this.d4v1]+this.m4v2*t[this.d4v2]+this.m4v3*t[this.d4v3]+this.m4v4*t[this.d4v4];return{parent:e,index:r,value:e[r]}}}},function(t,e){t.exports={1:function({point:t,value:e}){this.data[t[this.d0v0]]=e},2:function({point:t,value:e}){this.data[this.m0v0*t[this.d0v0]+this.m0v1*t[this.d0v1]]=e},3:function({point:t,value:e}){this.data[this.m0v0*t[this.d0v0]+this.m0v1*t[this.d0v1]+this.m0v2*t[this.d0v2]]=e},4:function({point:t,value:e}){this.data[this.m0v0*t[this.d0v0]+this.m0v1*t[this.d0v1]+this.m0v2*t[this.d0v2]+this.m0v3*t[this.d0v3]]=e},5:function({point:t,value:e}){this.data[this.m0v0*t[this.d0v0]+this.m0v1*t[this.d0v1]+this.m0v2*t[this.d0v2]+this.m0v3*t[this.d0v3]+this.m0v4*t[this.d0v4]]=e},\"1,1\":function({point:t,value:e}){this.data[t[this.d0v0]][t[this.d1v0]]=e},\"1,2\":function({point:t,value:e}){this.data[t[this.d0v0]][this.m1v0*t[this.d1v0]+this.m1v1*t[this.d1v1]]=e},\"1,3\":function({point:t,value:e}){this.data[t[this.d0v0]][this.m1v0*t[this.d1v0]+this.m1v1*t[this.d1v1]+this.m1v2*t[this.d1v2]]=e},\"1,4\":function({point:t,value:e}){this.data[t[this.d0v0]][this.m1v0*t[this.d1v0]+this.m1v1*t[this.d1v1]+this.m1v2*t[this.d1v2]+this.m1v3*t[this.d1v3]]=e},\"1,5\":function({point:t,value:e}){this.data[t[this.d0v0]][this.m1v0*t[this.d1v0]+this.m1v1*t[this.d1v1]+this.m1v2*t[this.d1v2]+this.m1v3*t[this.d1v3]+this.m1v4*t[this.d1v4]]=e},\"1,1,1\":function({point:t,value:e}){this.data[t[this.d0v0]][t[this.d1v0]][t[this.d2v0]]=e},\"1,1,2\":function({point:t,value:e}){this.data[t[this.d0v0]][t[this.d1v0]][this.m2v0*t[this.d2v0]+this.m2v1*t[this.d2v1]]=e},\"1,1,3\":function({point:t,value:e}){this.data[t[this.d0v0]][t[this.d1v0]][this.m2v0*t[this.d2v0]+this.m2v1*t[this.d2v1]+this.m2v2*t[this.d2v2]]=e},\"1,1,4\":function({point:t,value:e}){this.data[t[this.d0v0]][t[this.d1v0]][this.m2v0*t[this.d2v0]+this.m2v1*t[this.d2v1]+this.m2v2*t[this.d2v2]+this.m2v3*t[this.d2v3]]=e},\"1,1,5\":function({point:t,value:e}){this.data[t[this.d0v0]][t[this.d1v0]][this.m2v0*t[this.d2v0]+this.m2v1*t[this.d2v1]+this.m2v2*t[this.d2v2]+this.m2v3*t[this.d2v3]+this.m2v4*t[this.d2v4]]=e},\"1,1,1,1\":function({point:t,value:e}){this.data[t[this.d0v0]][t[this.d1v0]][t[this.d2v0]][t[this.d3v0]]=e},\"1,1,1,2\":function({point:t,value:e}){this.data[t[this.d0v0]][t[this.d1v0]][t[this.d2v0]][this.m3v0*t[this.d3v0]+this.m3v1*t[this.d3v1]]=e},\"1,1,1,3\":function({point:t,value:e}){this.data[t[this.d0v0]][t[this.d1v0]][t[this.d2v0]][this.m3v0*t[this.d3v0]+this.m3v1*t[this.d3v1]+this.m3v2*t[this.d3v2]]=e},\"1,1,1,4\":function({point:t,value:e}){this.data[t[this.d0v0]][t[this.d1v0]][t[this.d2v0]][this.m3v0*t[this.d3v0]+this.m3v1*t[this.d3v1]+this.m3v2*t[this.d3v2]+this.m3v3*t[this.d3v3]]=e},\"1,1,1,5\":function({point:t,value:e}){this.data[t[this.d0v0]][t[this.d1v0]][t[this.d2v0]][this.m3v0*t[this.d3v0]+this.m3v1*t[this.d3v1]+this.m3v2*t[this.d3v2]+this.m3v3*t[this.d3v3]+this.m3v4*t[this.d3v4]]=e},\"1,1,1,1,1\":function({point:t,value:e}){this.data[t[this.d0v0]][t[this.d1v0]][t[this.d2v0]][t[this.d3v0]][t[this.d4v0]]=e},\"1,1,1,1,2\":function({point:t,value:e}){this.data[t[this.d0v0]][t[this.d1v0]][t[this.d2v0]][t[this.d3v0]][this.m4v0*t[this.d4v0]+this.m4v1*t[this.d4v1]]=e},\"1,1,1,1,3\":function({point:t,value:e}){this.data[t[this.d0v0]][t[this.d1v0]][t[this.d2v0]][t[this.d3v0]][this.m4v0*t[this.d4v0]+this.m4v1*t[this.d4v1]+this.m4v2*t[this.d4v2]]=e},\"1,1,1,1,4\":function({point:t,value:e}){this.data[t[this.d0v0]][t[this.d1v0]][t[this.d2v0]][t[this.d3v0]][this.m4v0*t[this.d4v0]+this.m4v1*t[this.d4v1]+this.m4v2*t[this.d4v2]+this.m4v3*t[this.d4v3]]=e},\"1,1,1,1,5\":function({point:t,value:e}){this.data[t[this.d0v0]][t[this.d1v0]][t[this.d2v0]][t[this.d3v0]][this.m4v0*t[this.d4v0]+this.m4v1*t[this.d4v1]+this.m4v2*t[this.d4v2]+this.m4v3*t[this.d4v3]+this.m4v4*t[this.d4v4]]=e}}},function(t,e,r){\"use strict\";t.exports={countIn1D:function(t){return t.reduce((function(t,e){return void 0===t[e]?t[e]=1:t[e]++,t}),{})},countIn2D:function(t){return t.reduce((function(t,e){return e.forEach((function(e){void 0===t[e]?t[e]=1:t[e]++})),t}),{})},unflatten:function(t,e){for(var r=e.height,n=e.width,i=[],o=0;o>24)/500+a,c=a-(t[e+2]<<24>>24)/200;u=.95047*(u*u*u>.008856?u*u*u:(u-16/116)/7.787),a=1*(a*a*a>.008856?a*a*a:(a-16/116)/7.787),c=1.08883*(c*c*c>.008856?c*c*c:(c-16/116)/7.787),i=3.2406*u+-1.5372*a+-.4986*c,o=-.9689*u+1.8758*a+.0415*c,s=.0557*u+-.204*a+1.057*c,i=i>.0031308?1.055*i**(1/2.4)-.055:12.92*i,o=o>.0031308?1.055*o**(1/2.4)-.055:12.92*o,s=s>.0031308?1.055*s**(1/2.4)-.055:12.92*s,n[r]=255*Math.max(0,Math.min(1,i)),n[r+1]=255*Math.max(0,Math.min(1,o)),n[r+2]=255*Math.max(0,Math.min(1,s))}return n}function S(t,e){let r=t.length-e,n=0;do{for(let r=e;r>0;r--)t[n+e]+=t[n],n++;r-=e}while(r>0)}function A(t,e,r){let n=0,i=t.length;const o=i/r;for(;i>e;){for(let r=e;r>0;--r)t[n+e]+=t[n],++n;i-=e}const s=t.slice();for(let e=0;e=t.byteLength);++o){let n;if(2===e){switch(i[0]){case 8:n=new Uint8Array(t,o*a*r*s,a*r*s);break;case 16:n=new Uint16Array(t,o*a*r*s,a*r*s/2);break;case 32:n=new Uint32Array(t,o*a*r*s,a*r*s/4);break;default:throw new Error(`Predictor 2 not allowed with ${i[0]} bits per sample.`)}S(n,a)}else 3===e&&(n=new Uint8Array(t,o*a*r*s,a*r*s),A(n,a,s))}return t}(r,n,e?t.TileWidth:t.ImageWidth,e?t.TileLength:t.RowsPerStrip||t.ImageLength,t.BitsPerSample,t.PlanarConfiguration)}return r}}class k extends E{decodeBlock(t){return t}}function T(t,e){for(let r=e.length-1;r>=0;r--)t.push(e[r]);return t}function C(t){const e=new Uint16Array(4093),r=new Uint8Array(4093);for(let t=0;t<=257;t++)e[t]=4096,r[t]=t;let n=258,i=9,o=0;function s(){n=258,i=9}function a(t){const e=function(t,e,r){const n=e%8,i=Math.floor(e/8),o=8-n,s=e+r-8*(i+1);let a=8*(i+2)-(e+r);const u=8*(i+2)-e;if(a=Math.max(0,a),i>=t.length)return console.warn(\"ran off the end of the buffer before finding EOI_CODE (end on input code)\"),257;let c=t[i]&2**(8-n)-1;c<<=r-o;let l=c;if(i+1>>a;e<<=Math.max(0,r-u),l+=e}if(s>8&&i+2>>n}return l}(t,o,i);return o+=i,e}function u(t,i){return r[n]=i,e[n]=t,n++,n-1}function c(t){const n=[];for(let i=t;4096!==i;i=e[i])n.push(r[i]);return n}const l=[];s();const f=new Uint8Array(t);let h,d=a(f);for(;257!==d;){if(256===d){for(s(),d=a(f);256===d;)d=a(f);if(257===d)break;if(d>256)throw new Error(\"corrupted code at scanline \"+d);T(l,c(d)),h=d}else if(d=2**i&&(12===i?h=void 0:i++),d=a(f)}return new Uint8Array(l)}class O extends E{decodeBlock(t){return C(t).buffer}}const I=new Int32Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]);function P(t,e){let r=0;const n=[];let i=16;for(;i>0&&!t[i-1];)--i;n.push({children:[],index:0});let o,s=n[0];for(let a=0;a0;)s=n.pop();for(s.index++,n.push(s);n.length<=a;)n.push(o={children:[],index:0}),s.children[s.index]=o.children,s=o;r++}a+10)return p--,d>>p&1;if(d=t[h++],255===d){const e=t[h++];if(e)throw new Error(\"unexpected marker: \"+(d<<8|e).toString(16))}return p=7,d>>>7}function g(t){let e,r=t;for(;null!==(e=y());){if(r=r[e],\"number\"==typeof r)return r;if(\"object\"!=typeof r)throw new Error(\"invalid huffman sequence\")}return null}function m(t){let e=t,r=0;for(;e>0;){const t=y();if(null===t)return;r=r<<1|t,--e}return r}function b(t){const e=m(t);return e>=1<0)return void v--;let r=o;const n=s;for(;r<=n;){const n=g(t.huffmanTableAC),i=15&n,o=n>>4;if(0===i){if(o<15){v=m(o)+(1<>4,0===r)i<15?(v=m(i)+(1<>4;if(0===n){if(o<15)break;i+=16}else{i+=o;e[I[i]]=b(n),i++}}};let R,j,M=0;j=1===A?n[0].blocksPerLine*n[0].blocksPerColumn:c*r.mcusPerColumn;const L=i||j;for(;M=65488&&R<=65495))break;h+=2}return h-f}function j(t,e){const r=[],{blocksPerLine:n,blocksPerColumn:i}=e,o=n<<3,s=new Int32Array(64),a=new Uint8Array(64);function u(t,r,n){const i=e.quantizationTable;let o,s,a,u,c,l,f,h,d;const p=n;let y;for(y=0;y<64;y++)p[y]=t[y]*i[y];for(y=0;y<8;++y){const t=8*y;0!==p[1+t]||0!==p[2+t]||0!==p[3+t]||0!==p[4+t]||0!==p[5+t]||0!==p[6+t]||0!==p[7+t]?(o=5793*p[0+t]+128>>8,s=5793*p[4+t]+128>>8,a=p[2+t],u=p[6+t],c=2896*(p[1+t]-p[7+t])+128>>8,h=2896*(p[1+t]+p[7+t])+128>>8,l=p[3+t]<<4,f=p[5+t]<<4,d=o-s+1>>1,o=o+s+1>>1,s=d,d=3784*a+1567*u+128>>8,a=1567*a-3784*u+128>>8,u=d,d=c-f+1>>1,c=c+f+1>>1,f=d,d=h+l+1>>1,l=h-l+1>>1,h=d,d=o-u+1>>1,o=o+u+1>>1,u=d,d=s-a+1>>1,s=s+a+1>>1,a=d,d=2276*c+3406*h+2048>>12,c=3406*c-2276*h+2048>>12,h=d,d=799*l+4017*f+2048>>12,l=4017*l-799*f+2048>>12,f=d,p[0+t]=o+h,p[7+t]=o-h,p[1+t]=s+f,p[6+t]=s-f,p[2+t]=a+l,p[5+t]=a-l,p[3+t]=u+c,p[4+t]=u-c):(d=5793*p[0+t]+512>>10,p[0+t]=d,p[1+t]=d,p[2+t]=d,p[3+t]=d,p[4+t]=d,p[5+t]=d,p[6+t]=d,p[7+t]=d)}for(y=0;y<8;++y){const t=y;0!==p[8+t]||0!==p[16+t]||0!==p[24+t]||0!==p[32+t]||0!==p[40+t]||0!==p[48+t]||0!==p[56+t]?(o=5793*p[0+t]+2048>>12,s=5793*p[32+t]+2048>>12,a=p[16+t],u=p[48+t],c=2896*(p[8+t]-p[56+t])+2048>>12,h=2896*(p[8+t]+p[56+t])+2048>>12,l=p[24+t],f=p[40+t],d=o-s+1>>1,o=o+s+1>>1,s=d,d=3784*a+1567*u+2048>>12,a=1567*a-3784*u+2048>>12,u=d,d=c-f+1>>1,c=c+f+1>>1,f=d,d=h+l+1>>1,l=h-l+1>>1,h=d,d=o-u+1>>1,o=o+u+1>>1,u=d,d=s-a+1>>1,s=s+a+1>>1,a=d,d=2276*c+3406*h+2048>>12,c=3406*c-2276*h+2048>>12,h=d,d=799*l+4017*f+2048>>12,l=4017*l-799*f+2048>>12,f=d,p[0+t]=o+h,p[56+t]=o-h,p[8+t]=s+f,p[48+t]=s-f,p[16+t]=a+l,p[40+t]=a-l,p[24+t]=u+c,p[32+t]=u-c):(d=5793*n[y+0]+8192>>14,p[0+t]=d,p[8+t]=d,p[16+t]=d,p[24+t]=d,p[32+t]=d,p[40+t]=d,p[48+t]=d,p[56+t]=d)}for(y=0;y<64;++y){const t=128+(p[y]+8>>4);r[y]=t<0?0:t>255?255:t}}for(let t=0;t>4==0)for(let r=0;r<64;r++){i[I[r]]=t[e++]}else{if(n>>4!=1)throw new Error(\"DQT: invalid table spec\");for(let t=0;t<64;t++){i[I[t]]=r()}}this.quantizationTables[15&n]=i}break}case 65472:case 65473:case 65474:{r();const n={extended:65473===o,progressive:65474===o,precision:t[e++],scanLines:r(),samplesPerLine:r(),components:{},componentsOrder:[]},s=t[e++];let a;for(let r=0;r>4,i=15&t[e+1],o=t[e+2];n.componentsOrder.push(a),n.components[a]={h:r,v:i,quantizationIdx:o},e+=3}i(n),this.frames.push(n);break}case 65476:{const n=r();for(let r=2;r>4==0?this.huffmanTablesDC[15&n]=P(i,s):this.huffmanTablesAC[15&n]=P(i,s)}break}case 65501:r(),this.resetInterval=r();break;case 65498:{r();const n=t[e++],i=[],o=this.frames[0];for(let r=0;r>4],r.huffmanTableAC=this.huffmanTablesAC[15&n],i.push(r)}const s=t[e++],a=t[e++],u=t[e++],c=R(t,e,o,i,this.resetInterval,s,a,u>>4,15&u);e+=c;break}case 65535:255!==t[e]&&e--;break;default:if(255===t[e-3]&&t[e-2]>=192&&t[e-2]<=254){e-=3;break}throw new Error(\"unknown JPEG marker \"+o.toString(16))}o=r()}}getResult(){const{frames:t}=this;if(0===this.frames.length)throw new Error(\"no frames were decoded\");this.frames.length>1&&console.warn(\"more than one frame is not supported\");for(let t=0;t{const a=B(t,n,i);for(let u=0;u{const a=B(t,n,i);for(let u=0;u=this.fileDirectory.BitsPerSample.length)throw new RangeError(`Sample index ${t} is out of range.`);const e=this.fileDirectory.BitsPerSample[t];if(e%8!=0)throw new Error(`Sample bit-width of ${e} is not supported.`);return e/8}getReaderForSample(t){const e=this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[t]:1,r=this.fileDirectory.BitsPerSample[t];switch(e){case 1:switch(r){case 8:return DataView.prototype.getUint8;case 16:return DataView.prototype.getUint16;case 32:return DataView.prototype.getUint32}break;case 2:switch(r){case 8:return DataView.prototype.getInt8;case 16:return DataView.prototype.getInt16;case 32:return DataView.prototype.getInt32}break;case 3:switch(r){case 32:return DataView.prototype.getFloat32;case 64:return DataView.prototype.getFloat64}}throw Error(\"Unsupported data format/bitsPerSample\")}getArrayForSample(t,e){return W(this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[t]:1,this.fileDirectory.BitsPerSample[t],e)}async getTileOrStrip(t,e,r,n){const i=Math.ceil(this.getWidth()/this.getTileWidth()),o=Math.ceil(this.getHeight()/this.getTileHeight());let s;const{tiles:a}=this;let u,c;1===this.planarConfiguration?s=e*i+t:2===this.planarConfiguration&&(s=r*i*o+e*i+t),this.isTiled?(u=this.fileDirectory.TileOffsets[s],c=this.fileDirectory.TileByteCounts[s]):(u=this.fileDirectory.StripOffsets[s],c=this.fileDirectory.StripByteCounts[s]);const l=await this.source.fetch(u,c);let f;return null===a?f=n.decode(this.fileDirectory,l):a[s]||(f=n.decode(this.fileDirectory,l),a[s]=f),{x:t,y:e,sample:r,data:await f}}async _readRaster(t,e,r,n,i,o,s,a){const u=this.getTileWidth(),c=this.getTileHeight(),l=Math.max(Math.floor(t[0]/u),0),f=Math.min(Math.ceil(t[2]/u),Math.ceil(this.getWidth()/this.getTileWidth())),h=Math.max(Math.floor(t[1]/c),0),d=Math.min(Math.ceil(t[3]/c),Math.ceil(this.getHeight()/this.getTileHeight())),p=t[2]-t[0];let y=this.getBytesPerPixel();const g=[],m=[];for(let t=0;t{const o=i.data,s=new DataView(o),a=i.y*c,f=i.x*u,h=(i.y+1)*c,d=(i.x+1)*u,b=m[l],w=Math.min(c,c-(h-t[3])),x=Math.min(u,u-(d-t[2]));for(let i=Math.max(0,t[1]-a);iu[2]||u[1]>u[3])throw new Error(\"Invalid subsets\");const c=(u[2]-u[0])*(u[3]-u[1]);if(e&&e.length){for(let t=0;t=this.fileDirectory.SamplesPerPixel)return Promise.reject(new RangeError(`Invalid sample index \\'${e[t]}\\'.`))}else for(let t=0;ts[2]||s[1]>s[3])throw new Error(\"Invalid subsets\");const a=this.fileDirectory.PhotometricInterpretation;if(a===d.RGB){let i=[0,1,2];if(this.fileDirectory.ExtraSamples!==p.Unspecified&&o){i=[];for(let t=0;t\"Item\"===t.tagName);t&&(o=o.filter(e=>Number(e.attributes.sample)===t));for(let t=0;t0;let i=!0;for(let o=0;o<8;o++){let s=this._dataView.getUint8(t+(e?o:7-o));n&&(i?0!==s&&(s=255&~(s-1),i=!1):s=255&~s),r+=s*256**o}return n&&(r=-r),r}getUint8(t,e){return this._dataView.getUint8(t,e)}getInt8(t,e){return this._dataView.getInt8(t,e)}getUint16(t,e){return this._dataView.getUint16(t,e)}getInt16(t,e){return this._dataView.getInt16(t,e)}getUint32(t,e){return this._dataView.getUint32(t,e)}getInt32(t,e){return this._dataView.getInt32(t,e)}getFloat32(t,e){return this._dataView.getFloat32(t,e)}getFloat64(t,e){return this._dataView.getFloat64(t,e)}}class ${constructor(t,e,r,n){this._dataView=new DataView(t),this._sliceOffset=e,this._littleEndian=r,this._bigTiff=n}get sliceOffset(){return this._sliceOffset}get sliceTop(){return this._sliceOffset+this.buffer.byteLength}get littleEndian(){return this._littleEndian}get bigTiff(){return this._bigTiff}get buffer(){return this._dataView.buffer}covers(t,e){return this.sliceOffset<=t&&this.sliceTop>=t+e}readUint8(t){return this._dataView.getUint8(t-this._sliceOffset,this._littleEndian)}readInt8(t){return this._dataView.getInt8(t-this._sliceOffset,this._littleEndian)}readUint16(t){return this._dataView.getUint16(t-this._sliceOffset,this._littleEndian)}readInt16(t){return this._dataView.getInt16(t-this._sliceOffset,this._littleEndian)}readUint32(t){return this._dataView.getUint32(t-this._sliceOffset,this._littleEndian)}readInt32(t){return this._dataView.getInt32(t-this._sliceOffset,this._littleEndian)}readFloat32(t){return this._dataView.getFloat32(t-this._sliceOffset,this._littleEndian)}readFloat64(t){return this._dataView.getFloat64(t-this._sliceOffset,this._littleEndian)}readUint64(t){const e=this.readUint32(t),r=this.readUint32(t+4);let n;if(this._littleEndian){if(n=e+2**32*r,!Number.isSafeInteger(n))throw new Error(n+\" exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues\");return n}if(n=2**32*e+r,!Number.isSafeInteger(n))throw new Error(n+\" exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues\");return n}readInt64(t){let e=0;const r=(128&this._dataView.getUint8(t+(this._littleEndian?7:0)))>0;let n=!0;for(let i=0;i<8;i++){let o=this._dataView.getUint8(t+(this._littleEndian?i:7-i));r&&(n?0!==o&&(o=255&~(o-1),n=!1):o=255&~o),e+=o*256**i}return r&&(e=-e),e}readOffset(t){return this._bigTiff?this.readUint64(t):this.readUint32(t)}}var Y=r(68),Z=r(9),X=r(25),Q=r(40),J=r.n(Q),tt=r(105),et=r.n(tt),rt=r(39),nt=r.n(rt);class it{constructor(t,{blockSize:e=65536}={}){this.retrievalFunction=t,this.blockSize=e,this.blockRequests=new Map,this.blocks=new Map,this.blockIdsAwaitingRequest=null}async fetch(t,e,r=!1){const n=t+e,i=[],o=[],s=[];for(let e=Math.floor(t/this.blockSize)*this.blockSize;esetTimeout(e,t))}(),this.blockIdsAwaitingRequest){const t=function(t){if(0===t.length)return[];const e=[];let r=[];e.push(r);for(let n=0;n{const e=await t,i=r*this.blockSize,o=Math.min(i+this.blockSize,e.data.byteLength),s=e.data.slice(i,o);this.blockRequests.delete(n),this.blocks.set(n,{data:s,offset:e.offset+i,length:s.byteLength,top:e.offset+o})})())}}this.blockIdsAwaitingRequest=null}const a=[];for(const t of o)this.blockRequests.has(t)&&a.push(this.blockRequests.get(t));await Promise.all(a),await Promise.all(s);return function(t,e,r){const n=e+r,i=new ArrayBuffer(r),o=new Uint8Array(i);for(const r of t){const t=r.offset-e,i=r.top-n;let s,a=0,u=0;t<0?a=-t:t>0&&(u=t),s=i<0?r.length-a:n-r.offset-a;const c=new Uint8Array(r.data,a,s);o.set(c,u)}return i}(i.map(t=>this.blocks.get(t)),t,e)}async requestData(t,e){const r=await this.retrievalFunction(t,e);return r.length?r.length!==r.data.byteLength&&(r.data=r.data.slice(0,r.length)):r.length=r.data.byteLength,r.top=r.offset+r.length,r}}function ot(t,e){const{forceXHR:r}=e;if(\"function\"==typeof fetch&&!r)return function(t,{headers:e={},blockSize:r}={}){return new it(async(r,n)=>{const i=await fetch(t,{headers:{...e,Range:`bytes=${r}-${r+n-1}`}});if(i.ok){if(206===i.status){return{data:i.arrayBuffer?await i.arrayBuffer():(await i.buffer()).buffer,offset:r,length:n}}{const t=i.arrayBuffer?await i.arrayBuffer():(await i.buffer()).buffer;return{data:t,offset:0,length:t.byteLength}}}throw new Error(\"Error fetching data.\")},{blockSize:r})}(t,e);if(\"undefined\"!=typeof XMLHttpRequest)return function(t,{headers:e={},blockSize:r}={}){return new it(async(r,n)=>new Promise((i,o)=>{const s=new XMLHttpRequest;s.open(\"GET\",t),s.responseType=\"arraybuffer\";const a={...e,Range:`bytes=${r}-${r+n-1}`};for(const[t,e]of Object.entries(a))s.setRequestHeader(t,e);s.onload=()=>{const t=s.response;206===s.status?i({data:t,offset:r,length:n}):i({data:t,offset:0,length:t.byteLength})},s.onerror=o,s.send()}),{blockSize:r})}(t,e);if(J.a.get)return function(t,{headers:e={},blockSize:r}={}){return new it(async(r,n)=>new Promise((i,o)=>{const s=nt.a.parse(t);(\"http:\"===s.protocol?J.a:et.a).get({...s,headers:{...e,Range:`bytes=${r}-${r+n-1}`}},t=>{const e=[];t.on(\"data\",t=>{e.push(t)}),t.on(\"end\",()=>{const t=Z.Buffer.concat(e).buffer;i({data:t,offset:r,length:t.byteLength})})}).on(\"error\",o)}),{blockSize:r})}(t,e);throw new Error(\"No remote source available\")}function st(t){const e=function(t,e,r){return new Promise((n,i)=>{Object(X.open)(t,e,r,(t,e)=>{t?i(t):n(e)})})}(t,\"r\");return{async fetch(t,r){const n=await e,{buffer:i}=await function(...t){return new Promise((e,r)=>{Object(X.read)(...t,(t,n,i)=>{t?r(t):e({bytesRead:n,buffer:i})})})}(n,Z.Buffer.alloc(r),0,r,t);return i.buffer},async close(){const t=await e;return await function(t){return new Promise((e,r)=>{Object(X.close)(t,t=>{t?r(t):e()})})}(t)}}}function at(t,e){for(const r in e)e.hasOwnProperty(r)&&(t[r]=e[r])}function ut(t,e){if(t.length{let r=e;for(;0!==t[r];)r++;return r},readUshort:(t,e)=>t[e]<<8|t[e+1],readShort:(t,e)=>{const r=yt.ui8;return r[0]=t[e+1],r[1]=t[e+0],yt.i16[0]},readInt:(t,e)=>{const r=yt.ui8;return r[0]=t[e+3],r[1]=t[e+2],r[2]=t[e+1],r[3]=t[e+0],yt.i32[0]},readUint:(t,e)=>{const r=yt.ui8;return r[0]=t[e+3],r[1]=t[e+2],r[2]=t[e+1],r[3]=t[e+0],yt.ui32[0]},readASCII:(t,e,r)=>r.map(r=>String.fromCharCode(t[e+r])).join(\"\"),readFloat:(t,e)=>{const r=yt.ui8;return lt(4,n=>{r[n]=t[e+3-n]}),yt.fl32[0]},readDouble:(t,e)=>{const r=yt.ui8;return lt(8,n=>{r[n]=t[e+7-n]}),yt.fl64[0]},writeUshort:(t,e,r)=>{t[e]=r>>8&255,t[e+1]=255&r},writeUint:(t,e,r)=>{t[e]=r>>24&255,t[e+1]=r>>16&255,t[e+2]=r>>8&255,t[e+3]=r>>0&255},writeASCII:(t,e,r)=>{lt(r.length,n=>{t[e+n]=r.charCodeAt(n)})},ui8:new Uint8Array(8)};yt.fl64=new Float64Array(yt.ui8.buffer),yt.writeDouble=(t,e,r)=>{yt.fl64[0]=r,lt(8,r=>{t[e+r]=yt.ui8[7-r]})};const gt=t=>{const e=new Uint8Array(1e3);let r=4;const n=yt;e[0]=77,e[1]=77,e[3]=42;let i=8;if(n.writeUint(e,r,i),r+=4,t.forEach((r,o)=>{const s=((t,e,r,n)=>{let i=r;const o=Object.keys(n).filter(t=>null!=t&&\"undefined\"!==t);t.writeUshort(e,i,o.length),i+=2;let s=i+12*o.length+4;for(const r of o){let o=null;\"number\"==typeof r?o=r:\"string\"==typeof r&&(o=parseInt(r,10));const a=c[o],u=pt[a];if(null==a||void 0===a||void 0===a)throw new Error(\"unknown type of tag: \"+o);let l=n[r];if(void 0===l)throw new Error(\"failed to get value for key \"+r);\"ASCII\"===a&&\"string\"==typeof l&&!1===ut(l,\"\\\\0\")&&(l+=\"\\\\0\");const f=l.length;t.writeUshort(e,i,o),i+=2,t.writeUshort(e,i,u),i+=2,t.writeUint(e,i,f),i+=4;let h=[-1,1,1,2,4,8,0,0,0,0,0,0,8][u]*f,d=i;h>4&&(t.writeUint(e,i,s),d=s),\"ASCII\"===a?t.writeASCII(e,d,l):\"SHORT\"===a?lt(f,r=>{t.writeUshort(e,d+2*r,l[r])}):\"LONG\"===a?lt(f,r=>{t.writeUint(e,d+4*r,l[r])}):\"RATIONAL\"===a?lt(f,r=>{t.writeUint(e,d+8*r,Math.round(1e4*l[r])),t.writeUint(e,d+8*r+4,1e4)}):\"DOUBLE\"===a&<(f,r=>{t.writeDouble(e,d+8*r,l[r])}),h>4&&(h+=1&h,s+=h),i+=4}return[i,s]})(n,e,i,r);i=s[1],o{lt(i,r=>{lt(n,n=>{o.push(t[n][e][r])})})})),e.ImageLength=r,delete e.height,e.ImageWidth=i,delete e.width,e.BitsPerSample||(e.BitsPerSample=lt(n,()=>8)),mt.forEach(t=>{const r=t[0];if(!e[r]){const n=t[1];e[r]=n}}),e.PhotometricInterpretation||(e.PhotometricInterpretation=3===e.BitsPerSample.length?2:1),e.SamplesPerPixel||(e.SamplesPerPixel=[n]),e.StripByteCounts||(e.StripByteCounts=[n*r*i]),e.ModelPixelScale||(e.ModelPixelScale=[360/i,180/r,0]),e.SampleFormat||(e.SampleFormat=lt(n,()=>1));const s=Object.keys(e).filter(t=>ut(t,\"GeoKey\")).sort((t,e)=>dt[t]-dt[e]);if(!e.GeoKeyDirectory){const t=[1,1,0,s.length];s.forEach(r=>{const n=Number(dt[r]);let i,o,s;t.push(n),\"SHORT\"===c[n]?(i=1,o=0,s=e[r]):\"GeogCitationGeoKey\"===r?(i=e.GeoAsciiParams.length,o=Number(dt.GeoAsciiParams),s=0):console.log(\"[geotiff.js] couldn\\'t get TIFFTagLocation for \"+r),t.push(o),t.push(i),t.push(s)}),e.GeoKeyDirectory=t}for(const t in s)s.hasOwnProperty(t)&&delete e[t];[\"Compression\",\"ExtraSamples\",\"GeographicTypeGeoKey\",\"GTModelTypeGeoKey\",\"GTRasterTypeGeoKey\",\"ImageLength\",\"ImageWidth\",\"PhotometricInterpretation\",\"PlanarConfiguration\",\"ResolutionUnit\",\"SamplesPerPixel\",\"XPosition\",\"YPosition\"].forEach(t=>{var r;e[t]&&(e[t]=(r=e[t],Array.isArray(r)?r:[r]))});const a=(t=>{const e={};for(const r in t)\"StripOffsets\"!==r&&(dt[r]||console.error(r,\"not in name2code:\",Object.keys(dt)),e[dt[r]]=t[r]);return e})(e);return((t,e,r,n)=>{if(null==r)throw new Error(\"you passed into encodeImage a width of type \"+r);if(null==e)throw new Error(\"you passed into encodeImage a width of type \"+e);const i={256:[e],257:[r],273:[1e3],278:[r],305:\"geotiff.js\"};if(n)for(const t in n)n.hasOwnProperty(t)&&(i[t]=n[t]);const o=new Uint8Array(gt([i])),s=new Uint8Array(t),a=i[277],u=new Uint8Array(1e3+e*r*a);return lt(o.length,t=>{u[t]=o[t]}),function(t,e){const{length:r}=t;for(let n=0;n{u[1e3+e]=t}),u.buffer})(o,i,r,a)}class vt{log(){}info(){}warn(){}error(){}time(){}timeEnd(){}}let wt=new vt;function xt(t=new vt){wt=t}function _t(t){switch(t){case h.BYTE:case h.ASCII:case h.SBYTE:case h.UNDEFINED:return 1;case h.SHORT:case h.SSHORT:return 2;case h.LONG:case h.SLONG:case h.FLOAT:case h.IFD:return 4;case h.RATIONAL:case h.SRATIONAL:case h.DOUBLE:case h.LONG8:case h.SLONG8:case h.IFD8:return 8;default:throw new RangeError(\"Invalid field type: \"+t)}}function St(t,e,r,n){let i=null,o=null;const s=_t(e);switch(e){case h.BYTE:case h.ASCII:case h.UNDEFINED:i=new Uint8Array(r),o=t.readUint8;break;case h.SBYTE:i=new Int8Array(r),o=t.readInt8;break;case h.SHORT:i=new Uint16Array(r),o=t.readUint16;break;case h.SSHORT:i=new Int16Array(r),o=t.readInt16;break;case h.LONG:case h.IFD:i=new Uint32Array(r),o=t.readUint32;break;case h.SLONG:i=new Int32Array(r),o=t.readInt32;break;case h.LONG8:case h.IFD8:i=new Array(r),o=t.readUint64;break;case h.SLONG8:i=new Array(r),o=t.readInt64;break;case h.RATIONAL:i=new Uint32Array(2*r),o=t.readUint32;break;case h.SRATIONAL:i=new Int32Array(2*r),o=t.readInt32;break;case h.FLOAT:i=new Float32Array(r),o=t.readFloat32;break;case h.DOUBLE:i=new Float64Array(r),o=t.readFloat64;break;default:throw new RangeError(\"Invalid field type: \"+e)}if(e!==h.RATIONAL&&e!==h.SRATIONAL)for(let e=0;et.getWidth()-e.getWidth());for(let e=0;en||o&&o>s)break}}let f=e;if(s){const[t,e]=a.getOrigin(),[r,n]=u.getResolution(a);f=[Math.round((s[0]-t)/r),Math.round((s[1]-e)/n),Math.round((s[2]-t)/r),Math.round((s[3]-e)/n)],f=[Math.min(f[0],f[2]),Math.min(f[1],f[3]),Math.max(f[0],f[2]),Math.max(f[1],f[3])]}return u.readRasters({...t,window:f})}}class Tt extends kt{constructor(t,e,r,n,i={}){super(),this.source=t,this.littleEndian=e,this.bigTiff=r,this.firstIFDOffset=n,this.cache=i.cache||!1,this.ifdRequests=[],this.ghostValues=null}async getSlice(t,e){const r=this.bigTiff?4048:1024;return new $(await this.source.fetch(t,void 0!==e?e:r),t,this.littleEndian,this.bigTiff)}async parseFileDirectoryAt(t){const e=this.bigTiff?20:12,r=this.bigTiff?8:2;let n=await this.getSlice(t);const i=this.bigTiff?n.readUint64(t):n.readUint16(t),o=i*e+(this.bigTiff?16:6);n.covers(t,o)||(n=await this.getSlice(t,o));const s={};let u=t+(this.bigTiff?8:2);for(let t=0;t{const e=await this.ifdRequests[t-1];if(0===e.nextIFDByteOffset)throw new Et(t);return this.parseFileDirectoryAt(e.nextIFDByteOffset)})(),this.ifdRequests[t]}async getImage(t=0){const e=await this.requestIFD(t);return new V(e.fileDirectory,e.geoKeyDirectory,this.dataView,this.littleEndian,this.cache,this.source)}async getImageCount(){let t=0,e=!0;for(;e;)try{await this.requestIFD(t),++t}catch(t){if(!(t instanceof Et))throw t;e=!1}return t}async getGhostValues(){const t=this.bigTiff?16:8;if(this.ghostValues)return this.ghostValues;const e=\"GDAL_STRUCTURAL_METADATA_SIZE=\",r=e.length+100;let n=await this.getSlice(t,r);if(e===St(n,h.ASCII,e.length,t)){const e=St(n,h.ASCII,r,t).split(\"\\\\n\")[0],i=Number(e.split(\"=\")[1].split(\" \")[0])+e.length;i>r&&(n=await this.getSlice(t,i));const o=St(n,h.ASCII,i,t);this.ghostValues={},o.split(\"\\\\n\").filter(t=>t.length>0).map(t=>t.split(\"=\")).forEach(([t,e])=>{this.ghostValues[t]=e})}return this.ghostValues}static async fromSource(t,e){const r=await t.fetch(0,1024),n=new K(r),i=n.getUint16(0,0);let o;if(18761===i)o=!0;else{if(19789!==i)throw new TypeError(\"Invalid byte order value.\");o=!1}const s=n.getUint16(2,o);let a;if(42===s)a=!1;else{if(43!==s)throw new TypeError(\"Invalid magic number.\");a=!0;if(8!==n.getUint16(4,o))throw new Error(\"Unsupported offset byte-size.\")}const u=a?n.getUint64(8,o):n.getUint32(4,o);return new Tt(t,o,a,u,e)}close(){return\"function\"==typeof this.source.close&&this.source.close()}}e.default=Tt;class Ct extends kt{constructor(t,e){super(),this.mainFile=t,this.overviewFiles=e,this.imageFiles=[t].concat(e),this.fileDirectoriesPerFile=null,this.fileDirectoriesPerFileParsing=null,this.imageCount=null}async parseFileDirectoriesPerFile(){const t=[this.mainFile.parseFileDirectoryAt(this.mainFile.firstIFDOffset)].concat(this.overviewFiles.map(t=>t.parseFileDirectoryAt(t.firstIFDOffset)));return this.fileDirectoriesPerFile=await Promise.all(t),this.fileDirectoriesPerFile}async getImage(t=0){await this.getImageCount(),await this.parseFileDirectoriesPerFile();let e=0,r=0;for(let n=0;nt.getImageCount()));return this.imageCounts=await Promise.all(t),this.imageCount=this.imageCounts.reduce((t,e)=>t+e,0),this.imageCount}}async function Ot(t,e={}){return Tt.fromSource(ot(t,e))}async function It(t){return Tt.fromSource(function(t){return{fetch:async(e,r)=>t.slice(e,e+r)}}(t))}async function Pt(t){return Tt.fromSource(st(t))}async function Rt(t){return Tt.fromSource((e=t,{fetch:async(t,r)=>new Promise((n,i)=>{const o=e.slice(t,t+r),s=new FileReader;s.onload=t=>n(t.target.result),s.onerror=i,s.readAsArrayBuffer(o)})}));var e}async function jt(t,e=[],r={}){const n=await Tt.fromSource(ot(t,r)),i=await Promise.all(e.map(t=>Tt.fromSource(ot(t,r))));return new Ct(n,i)}async function Mt(t,e){return bt(t,e)}},function(t,e,r){\"use strict\";r.d(e,\"a\",(function(){return i}));var n=r(19);Object(n.b)().blob;const i=Object(n.b)().default},,,function(t,e,r){\"use strict\";var n=r(26),i=r(102);var o=function(t){\"function\"==typeof t?t():t&&\"function\"==typeof t.unsubscribe&&t.unsubscribe()};e.a=function(t){const e=new i.a;let r,s=0;return new n.a(n=>{r||(r=t.subscribe(e));const i=e.subscribe(n);return s++,()=>{s--,i.unsubscribe(),0===s&&(o(r),r=void 0)}})}}]);',null)}},function(t,e,r){\"use strict\";var n=window.URL||window.webkitURL;t.exports=function(t,e){try{try{var r;try{(r=new(window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder)).append(t),r=r.getBlob()}catch(e){r=new Blob([t])}return new Worker(n.createObjectURL(r))}catch(e){return new Worker(\"data:application/javascript,\"+encodeURIComponent(t))}}catch(t){if(!e)throw Error(\"Inline worker is not supported\");return new Worker(e)}}},function(t,e,r){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0});var n=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var r=[],n=!0,i=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(n=(s=a.next()).done)&&(r.push(s.value),!e||r.length!==e);n=!0);}catch(t){i=!0,o=t}finally{try{!n&&a.return&&a.return()}finally{if(i)throw o}}return r}(t,e);throw new TypeError(\"Invalid attempt to destructure non-iterable instance\")},i=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t};e.default=function(t,e){return new Promise((function(r,o){try{e&&console.log(\"starting parseData with\",t),e&&console.log(\"\\tGeoTIFF:\",\"undefined\"==typeof GeoTIFF?\"undefined\":i(GeoTIFF));var u={},c=void 0,h=void 0;if(\"object\"===t.rasterType)u.values=t.data,u.height=c=t.metadata.height||u.values[0].length,u.width=h=t.metadata.width||u.values[0][0].length,u.pixelHeight=t.metadata.pixelHeight,u.pixelWidth=t.metadata.pixelWidth,u.projection=t.metadata.projection,u.xmin=t.metadata.xmin,u.ymax=t.metadata.ymax,u.noDataValue=t.metadata.noDataValue,u.numberOfRasters=u.values.length,u.xmax=u.xmin+u.width*u.pixelWidth,u.ymin=u.ymax-u.height*u.pixelHeight,u._data=null,r(f(u));else if(\"geotiff\"===t.rasterType){u._data=t.data;var d=s.fromArrayBuffer;\"url\"===t.sourceType?d=s.fromUrl:\"Blob\"===t.sourceType&&(d=s.fromBlob),e&&console.log(\"data.rasterType is geotiff\"),r(d(t.data).then((function(r){return e&&console.log(\"geotiff:\",r),r.getImage().then((function(r){try{e&&console.log(\"image:\",r);var i=r.fileDirectory,s=r.getGeoKeys()||{},d=s.GeographicTypeGeoKey,p=s.ProjectedCSTypeGeoKey;u.projection=p||d||t.metadata.projection,e&&console.log(\"projection:\",u.projection),u.height=c=r.getHeight(),e&&console.log(\"result.height:\",u.height),u.width=h=r.getWidth(),e&&console.log(\"result.width:\",u.width);var y=r.getResolution(),g=n(y,2),m=g[0],b=g[1];u.pixelHeight=Math.abs(b),u.pixelWidth=Math.abs(m);var v=r.getOrigin(),w=n(v,2),x=w[0],_=w[1];return u.xmin=x,u.xmax=u.xmin+h*u.pixelWidth,u.ymax=_,u.ymin=u.ymax-c*u.pixelHeight,u.noDataValue=i.GDAL_NODATA?parseFloat(i.GDAL_NODATA):null,u.numberOfRasters=i.SamplesPerPixel,i.ColorMap&&(u.palette=(0,a.getPalette)(r)),\"url\"!==t.sourceType?r.readRasters().then((function(t){return u.values=t.map((function(t){return(0,l.unflatten)(t,{height:c,width:h})})),f(u)})):u}catch(t){o(t),console.error(\"[georaster] error parsing georaster:\",t)}}))})))}}catch(t){o(t),console.error(\"[georaster] error parsing georaster:\",t)}}))};var o,s=r(100),a=r(155),u=r(156),c=(o=u)&&o.__esModule?o:{default:o},l=r(99);function f(t){var e=(0,c.default)(t.values,{height:t.height,layout:\"[band][row][column]\",noData:t.noDataValue,precise:!1,stats:[\"max\",\"min\",\"range\"],width:t.width});return t.maxs=e.bands.map((function(t){return t.max})),t.mins=e.bands.map((function(t){return t.min})),t.ranges=e.bands.map((function(t){return t.range})),t}},function(t,e,r){(function(e){var n=r(42).Transform,i=r(10);function o(t){n.call(this,t),this._destroyed=!1}function s(t,e,r){r(null,t)}function a(t){return function(e,r,n){return\"function\"==typeof e&&(n=r,r=e,e={}),\"function\"!=typeof r&&(r=s),\"function\"!=typeof n&&(n=null),t(e,r,n)}}i(o,n),o.prototype.destroy=function(t){if(!this._destroyed){this._destroyed=!0;var r=this;e.nextTick((function(){t&&r.emit(\"error\",t),r.emit(\"close\")}))}},t.exports=a((function(t,e,r){var n=new o(t);return n._transform=e,r&&(n._flush=r),n})),t.exports.ctor=a((function(t,e,r){function n(e){if(!(this instanceof n))return new n(e);this.options=Object.assign({},t,e),o.call(this,this.options)}return i(n,o),n.prototype._transform=e,r&&(n.prototype._flush=r),n})),t.exports.obj=a((function(t,e,r){var n=new o(Object.assign({objectMode:!0,highWaterMark:16},t));return n._transform=e,r&&(n._flush=r),n}))}).call(this,r(8))},function(t,e){},function(t,e,r){\"use strict\";var n=r(43).Buffer,i=r(117);t.exports=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.head=null,this.tail=null,this.length=0}return t.prototype.push=function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length},t.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},t.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},t.prototype.clear=function(){this.head=this.tail=null,this.length=0},t.prototype.join=function(t){if(0===this.length)return\"\";for(var e=this.head,r=\"\"+e.data;e=e.next;)r+=t+e.data;return r},t.prototype.concat=function(t){if(0===this.length)return n.alloc(0);for(var e,r,i,o=n.allocUnsafe(t>>>0),s=this.head,a=0;s;)e=s.data,r=o,i=a,e.copy(r,i),a+=s.data.length,s=s.next;return o},t}(),i&&i.inspect&&i.inspect.custom&&(t.exports.prototype[i.inspect.custom]=function(){var t=i.inspect({length:this.length});return this.constructor.name+\" \"+t})},function(t,e){},function(t,e,r){(function(t){var n=void 0!==t&&t||\"undefined\"!=typeof self&&self||window,i=Function.prototype.apply;function o(t,e){this._id=t,this._clearFn=e}e.setTimeout=function(){return new o(i.call(setTimeout,n,arguments),clearTimeout)},e.setInterval=function(){return new o(i.call(setInterval,n,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(n,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},r(119),e.setImmediate=\"undefined\"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate=\"undefined\"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,r(3))},function(t,e,r){(function(t,e){!function(t,r){\"use strict\";if(!t.setImmediate){var n,i,o,s,a,u=1,c={},l=!1,f=t.document,h=Object.getPrototypeOf&&Object.getPrototypeOf(t);h=h&&h.setTimeout?h:t,\"[object process]\"==={}.toString.call(t.process)?n=function(t){e.nextTick((function(){p(t)}))}:!function(){if(t.postMessage&&!t.importScripts){var e=!0,r=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage(\"\",\"*\"),t.onmessage=r,e}}()?t.MessageChannel?((o=new MessageChannel).port1.onmessage=function(t){p(t.data)},n=function(t){o.port2.postMessage(t)}):f&&\"onreadystatechange\"in f.createElement(\"script\")?(i=f.documentElement,n=function(t){var e=f.createElement(\"script\");e.onreadystatechange=function(){p(t),e.onreadystatechange=null,i.removeChild(e),e=null},i.appendChild(e)}):n=function(t){setTimeout(p,0,t)}:(s=\"setImmediate$\"+Math.random()+\"$\",a=function(e){e.source===t&&\"string\"==typeof e.data&&0===e.data.indexOf(s)&&p(+e.data.slice(s.length))},t.addEventListener?t.addEventListener(\"message\",a,!1):t.attachEvent(\"onmessage\",a),n=function(e){t.postMessage(s+e,\"*\")}),h.setImmediate=function(t){\"function\"!=typeof t&&(t=new Function(\"\"+t));for(var e=new Array(arguments.length-1),r=0;r>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function c(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function l(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg=\"\",e.wrap&&(t.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new n.Buf32(852),e.distcode=e.distdyn=new n.Buf32(592),e.sane=1,e.back=-1,0):-2}function f(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,l(t)):-2}function h(t,e){var r,n;return t&&t.state?(n=t.state,e<0?(r=0,e=-e):(r=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?-2:(null!==n.window&&n.wbits!==e&&(n.window=null),n.wrap=r,n.wbits=e,f(t))):-2}function d(t,e){var r,n;return t?(n=new c,t.state=n,n.window=null,0!==(r=h(t,e))&&(t.state=null),r):-2}var p,y,g=!0;function m(t){if(g){var e;for(p=new n.Buf32(512),y=new n.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(a(1,t.lens,0,288,p,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;a(2,t.lens,0,32,y,0,t.work,{bits:5}),g=!1}t.lencode=p,t.lenbits=9,t.distcode=y,t.distbits=5}function b(t,e,r,i){var o,s=t.state;return null===s.window&&(s.wsize=1<=s.wsize?(n.arraySet(s.window,e,r-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):((o=s.wsize-s.wnext)>i&&(o=i),n.arraySet(s.window,e,r-i,o,s.wnext),(i-=o)?(n.arraySet(s.window,e,r-i,i,0),s.wnext=i,s.whave=s.wsize):(s.wnext+=o,s.wnext===s.wsize&&(s.wnext=0),s.whave>>8&255,r.check=o(r.check,L,2,0),y=0,g=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&y)<<8)+(y>>8))%31){t.msg=\"incorrect header check\",r.mode=30;break}if(8!=(15&y)){t.msg=\"unknown compression method\",r.mode=30;break}if(g-=4,P=8+(15&(y>>>=4)),0===r.wbits)r.wbits=P;else if(P>r.wbits){t.msg=\"invalid window size\",r.mode=30;break}r.dmax=1<>8&1),512&r.flags&&(L[0]=255&y,L[1]=y>>>8&255,r.check=o(r.check,L,2,0)),y=0,g=0,r.mode=3;case 3:for(;g<32;){if(0===d)break t;d--,y+=c[f++]<>>8&255,L[2]=y>>>16&255,L[3]=y>>>24&255,r.check=o(r.check,L,4,0)),y=0,g=0,r.mode=4;case 4:for(;g<16;){if(0===d)break t;d--,y+=c[f++]<>8),512&r.flags&&(L[0]=255&y,L[1]=y>>>8&255,r.check=o(r.check,L,2,0)),y=0,g=0,r.mode=5;case 5:if(1024&r.flags){for(;g<16;){if(0===d)break t;d--,y+=c[f++]<>>8&255,r.check=o(r.check,L,2,0)),y=0,g=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&((x=r.length)>d&&(x=d),x&&(r.head&&(P=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),n.arraySet(r.head.extra,c,f,x,P)),512&r.flags&&(r.check=o(r.check,c,x,f)),d-=x,f+=x,r.length-=x),r.length))break t;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===d)break t;x=0;do{P=c[f+x++],r.head&&P&&r.length<65536&&(r.head.name+=String.fromCharCode(P))}while(P&&x>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=12;break;case 10:for(;g<32;){if(0===d)break t;d--,y+=c[f++]<>>=7&g,g-=7&g,r.mode=27;break}for(;g<3;){if(0===d)break t;d--,y+=c[f++]<>>=1)){case 0:r.mode=14;break;case 1:if(m(r),r.mode=20,6===e){y>>>=2,g-=2;break t}break;case 2:r.mode=17;break;case 3:t.msg=\"invalid block type\",r.mode=30}y>>>=2,g-=2;break;case 14:for(y>>>=7&g,g-=7&g;g<32;){if(0===d)break t;d--,y+=c[f++]<>>16^65535)){t.msg=\"invalid stored block lengths\",r.mode=30;break}if(r.length=65535&y,y=0,g=0,r.mode=15,6===e)break t;case 15:r.mode=16;case 16:if(x=r.length){if(x>d&&(x=d),x>p&&(x=p),0===x)break t;n.arraySet(l,c,f,x,h),d-=x,f+=x,p-=x,h+=x,r.length-=x;break}r.mode=12;break;case 17:for(;g<14;){if(0===d)break t;d--,y+=c[f++]<>>=5,g-=5,r.ndist=1+(31&y),y>>>=5,g-=5,r.ncode=4+(15&y),y>>>=4,g-=4,r.nlen>286||r.ndist>30){t.msg=\"too many length or distance symbols\",r.mode=30;break}r.have=0,r.mode=18;case 18:for(;r.have>>=3,g-=3}for(;r.have<19;)r.lens[F[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,R={bits:r.lenbits},I=a(0,r.lens,0,19,r.lencode,0,r.work,R),r.lenbits=R.bits,I){t.msg=\"invalid code lengths set\",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have>>16&255,k=65535&M,!((A=M>>>24)<=g);){if(0===d)break t;d--,y+=c[f++]<>>=A,g-=A,r.lens[r.have++]=k;else{if(16===k){for(j=A+2;g>>=A,g-=A,0===r.have){t.msg=\"invalid bit length repeat\",r.mode=30;break}P=r.lens[r.have-1],x=3+(3&y),y>>>=2,g-=2}else if(17===k){for(j=A+3;g>>=A)),y>>>=3,g-=3}else{for(j=A+7;g>>=A)),y>>>=7,g-=7}if(r.have+x>r.nlen+r.ndist){t.msg=\"invalid bit length repeat\",r.mode=30;break}for(;x--;)r.lens[r.have++]=P}}if(30===r.mode)break;if(0===r.lens[256]){t.msg=\"invalid code -- missing end-of-block\",r.mode=30;break}if(r.lenbits=9,R={bits:r.lenbits},I=a(1,r.lens,0,r.nlen,r.lencode,0,r.work,R),r.lenbits=R.bits,I){t.msg=\"invalid literal/lengths set\",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,R={bits:r.distbits},I=a(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,R),r.distbits=R.bits,I){t.msg=\"invalid distances set\",r.mode=30;break}if(r.mode=20,6===e)break t;case 20:r.mode=21;case 21:if(d>=6&&p>=258){t.next_out=h,t.avail_out=p,t.next_in=f,t.avail_in=d,r.hold=y,r.bits=g,s(t,w),h=t.next_out,l=t.output,p=t.avail_out,f=t.next_in,c=t.input,d=t.avail_in,y=r.hold,g=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;E=(M=r.lencode[y&(1<>>16&255,k=65535&M,!((A=M>>>24)<=g);){if(0===d)break t;d--,y+=c[f++]<>T)])>>>16&255,k=65535&M,!(T+(A=M>>>24)<=g);){if(0===d)break t;d--,y+=c[f++]<>>=T,g-=T,r.back+=T}if(y>>>=A,g-=A,r.back+=A,r.length=k,0===E){r.mode=26;break}if(32&E){r.back=-1,r.mode=12;break}if(64&E){t.msg=\"invalid literal/length code\",r.mode=30;break}r.extra=15&E,r.mode=22;case 22:if(r.extra){for(j=r.extra;g>>=r.extra,g-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;E=(M=r.distcode[y&(1<>>16&255,k=65535&M,!((A=M>>>24)<=g);){if(0===d)break t;d--,y+=c[f++]<>T)])>>>16&255,k=65535&M,!(T+(A=M>>>24)<=g);){if(0===d)break t;d--,y+=c[f++]<>>=T,g-=T,r.back+=T}if(y>>>=A,g-=A,r.back+=A,64&E){t.msg=\"invalid distance code\",r.mode=30;break}r.offset=k,r.extra=15&E,r.mode=24;case 24:if(r.extra){for(j=r.extra;g>>=r.extra,g-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg=\"invalid distance too far back\",r.mode=30;break}r.mode=25;case 25:if(0===p)break t;if(x=w-p,r.offset>x){if((x=r.offset-x)>r.whave&&r.sane){t.msg=\"invalid distance too far back\",r.mode=30;break}x>r.wnext?(x-=r.wnext,_=r.wsize-x):_=r.wnext-x,x>r.length&&(x=r.length),S=r.window}else S=l,_=h-r.offset,x=r.length;x>p&&(x=p),p-=x,r.length-=x;do{l[h++]=S[_++]}while(--x);0===r.length&&(r.mode=21);break;case 26:if(0===p)break t;l[h++]=r.length,p--,r.mode=21;break;case 27:if(r.wrap){for(;g<32;){if(0===d)break t;d--,y|=c[f++]<>>16&65535|0,s=0;0!==r;){r-=s=r>2e3?2e3:r;do{o=o+(i=i+e[n++]|0)|0}while(--s);i%=65521,o%=65521}return i|o<<16|0}},function(t,e,r){\"use strict\";var n=function(){for(var t,e=[],r=0;r<256;r++){t=r;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[r]=t}return e}();t.exports=function(t,e,r,i){var o=n,s=i+r;t^=-1;for(var a=i;a>>8^o[255&(t^e[a])];return-1^t}},function(t,e,r){\"use strict\";t.exports=function(t,e){var r,n,i,o,s,a,u,c,l,f,h,d,p,y,g,m,b,v,w,x,_,S,A,E,k;r=t.state,n=t.next_in,E=t.input,i=n+(t.avail_in-5),o=t.next_out,k=t.output,s=o-(e-t.avail_out),a=o+(t.avail_out-257),u=r.dmax,c=r.wsize,l=r.whave,f=r.wnext,h=r.window,d=r.hold,p=r.bits,y=r.lencode,g=r.distcode,m=(1<>>=w=v>>>24,p-=w,0===(w=v>>>16&255))k[o++]=65535&v;else{if(!(16&w)){if(0==(64&w)){v=y[(65535&v)+(d&(1<>>=w,p-=w),p<15&&(d+=E[n++]<>>=w=v>>>24,p-=w,!(16&(w=v>>>16&255))){if(0==(64&w)){v=g[(65535&v)+(d&(1<u){t.msg=\"invalid distance too far back\",r.mode=30;break t}if(d>>>=w,p-=w,_>(w=o-s)){if((w=_-w)>l&&r.sane){t.msg=\"invalid distance too far back\",r.mode=30;break t}if(S=0,A=h,0===f){if(S+=c-w,w2;)k[o++]=A[S++],k[o++]=A[S++],k[o++]=A[S++],x-=3;x&&(k[o++]=A[S++],x>1&&(k[o++]=A[S++]))}else{S=o-_;do{k[o++]=k[S++],k[o++]=k[S++],k[o++]=k[S++],x-=3}while(x>2);x&&(k[o++]=k[S++],x>1&&(k[o++]=k[S++]))}break}}break}}while(n>3,d&=(1<<(p-=x<<3))-1,t.next_in=n,t.next_out=o,t.avail_in=n=1&&0===L[k];k--);if(T>k&&(T=k),0===k)return c[l++]=20971520,c[l++]=20971520,h.bits=1,0;for(E=1;E0&&(0===t||1!==k))return-1;for(F[1]=0,S=1;S<15;S++)F[S+1]=F[S]+L[S];for(A=0;A852||2===t&&I>592)return 1;for(;;){v=S-C,f[A]b?(w=N[D+f[A]],x=j[M+f[A]]):(w=96,x=0),d=1<>C)+(p-=d)]=v<<24|w<<16|x|0}while(0!==p);for(d=1<>=1;if(0!==d?(R&=d-1,R+=d):R=0,A++,0==--L[S]){if(S===k)break;S=e[r+f[A]]}if(S>T&&(R&g)!==y){for(0===C&&(C=T),m+=E,P=1<<(O=S-C);O+C852||2===t&&I>592)return 1;c[y=R&g]=T<<24|O<<16|m-l|0}}return 0!==R&&(c[m+R]=S-C<<24|64<<16|0),h.bits=T,0}},function(t,e,r){\"use strict\";var n=r(29),i=!0,o=!0;try{String.fromCharCode.apply(null,[0])}catch(t){i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){o=!1}for(var s=new n.Buf8(256),a=0;a<256;a++)s[a]=a>=252?6:a>=248?5:a>=240?4:a>=224?3:a>=192?2:1;function u(t,e){if(e<65534&&(t.subarray&&o||!t.subarray&&i))return String.fromCharCode.apply(null,n.shrinkBuf(t,e));for(var r=\"\",s=0;s>>6,e[s++]=128|63&r):r<65536?(e[s++]=224|r>>>12,e[s++]=128|r>>>6&63,e[s++]=128|63&r):(e[s++]=240|r>>>18,e[s++]=128|r>>>12&63,e[s++]=128|r>>>6&63,e[s++]=128|63&r);return e},e.buf2binstring=function(t){return u(t,t.length)},e.binstring2buf=function(t){for(var e=new n.Buf8(t.length),r=0,i=e.length;r4)c[n++]=65533,r+=o-1;else{for(i&=2===o?31:3===o?15:7;o>1&&r1?c[n++]=65533:i<65536?c[n++]=i:(i-=65536,c[n++]=55296|i>>10&1023,c[n++]=56320|1023&i)}return u(c,n)},e.utf8border=function(t,e){var r;for((e=e||t.length)>t.length&&(e=t.length),r=e-1;r>=0&&128==(192&t[r]);)r--;return r<0||0===r?e:r+s[t[r]]>e?r:e}},function(t,e,r){\"use strict\";t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},function(t,e,r){\"use strict\";t.exports={2:\"need dictionary\",1:\"stream end\",0:\"\",\"-1\":\"file error\",\"-2\":\"stream error\",\"-3\":\"data error\",\"-4\":\"insufficient memory\",\"-5\":\"buffer error\",\"-6\":\"incompatible version\"}},function(t,e,r){\"use strict\";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg=\"\",this.state=null,this.data_type=2,this.adler=0}},function(t,e,r){\"use strict\";t.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name=\"\",this.comment=\"\",this.hcrc=0,this.done=!1}},function(t,e,r){t.exports=r.p+\"0.georaster.browser.bundle.min.worker.js\"},function(t,e,r){t.exports=function(t){function e(t){let r,i,o,s=null;function a(...t){if(!a.enabled)return;const n=a,i=Number(new Date),o=i-(r||i);n.diff=o,n.prev=r,n.curr=i,r=i,t[0]=e.coerce(t[0]),\"string\"!=typeof t[0]&&t.unshift(\"%O\");let s=0;t[0]=t[0].replace(/%([a-zA-Z%])/g,(r,i)=>{if(\"%%\"===r)return\"%\";s++;const o=e.formatters[i];if(\"function\"==typeof o){const e=t[s];r=o.call(n,e),t.splice(s,1),s--}return r}),e.formatArgs.call(n,t);(n.log||e.log).apply(n,t)}return a.namespace=t,a.useColors=e.useColors(),a.color=e.selectColor(t),a.extend=n,a.destroy=e.destroy,Object.defineProperty(a,\"enabled\",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(i!==e.namespaces&&(i=e.namespaces,o=e.enabled(t)),o),set:t=>{s=t}}),\"function\"==typeof e.init&&e.init(a),a}function n(t,r){const n=e(this.namespace+(void 0===r?\":\":r)+t);return n.log=this.log,n}function i(t){return t.toString().substring(2,t.toString().length-2).replace(/\\.\\*\\?$/,\"*\")}return e.debug=e,e.default=e,e.coerce=function(t){if(t instanceof Error)return t.stack||t.message;return t},e.disable=function(){const t=[...e.names.map(i),...e.skips.map(i).map(t=>\"-\"+t)].join(\",\");return e.enable(\"\"),t},e.enable=function(t){let r;e.save(t),e.namespaces=t,e.names=[],e.skips=[];const n=(\"string\"==typeof t?t:\"\").split(/[\\s,]+/),i=n.length;for(r=0;r{e[r]=t[r]}),e.names=[],e.skips=[],e.formatters={},e.selectColor=function(t){let r=0;for(let e=0;e=1.5*r;return Math.round(t/r)+\" \"+n+(i?\"s\":\"\")}t.exports=function(t,e){e=e||{};var a=typeof t;if(\"string\"===a&&t.length>0)return function(t){if((t=String(t)).length>100)return;var e=/^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(!e)return;var s=parseFloat(e[1]);switch((e[2]||\"ms\").toLowerCase()){case\"years\":case\"year\":case\"yrs\":case\"yr\":case\"y\":return 315576e5*s;case\"weeks\":case\"week\":case\"w\":return 6048e5*s;case\"days\":case\"day\":case\"d\":return s*o;case\"hours\":case\"hour\":case\"hrs\":case\"hr\":case\"h\":return s*i;case\"minutes\":case\"minute\":case\"mins\":case\"min\":case\"m\":return s*n;case\"seconds\":case\"second\":case\"secs\":case\"sec\":case\"s\":return s*r;case\"milliseconds\":case\"millisecond\":case\"msecs\":case\"msec\":case\"ms\":return s;default:return}}(t);if(\"number\"===a&&isFinite(t))return e.long?function(t){var e=Math.abs(t);if(e>=o)return s(t,e,o,\"day\");if(e>=i)return s(t,e,i,\"hour\");if(e>=n)return s(t,e,n,\"minute\");if(e>=r)return s(t,e,r,\"second\");return t+\" ms\"}(t):function(t){var e=Math.abs(t);if(e>=o)return Math.round(t/o)+\"d\";if(e>=i)return Math.round(t/i)+\"h\";if(e>=n)return Math.round(t/n)+\"m\";if(e>=r)return Math.round(t/r)+\"s\";return t+\"ms\"}(t);throw new Error(\"val is not a non-empty string or a valid number. val=\"+JSON.stringify(t))}},function(t,e,r){(function(e,n,i){var o=r(69),s=r(10),a=r(70),u=r(42),c=r(137),l=a.IncomingMessage,f=a.readyStates;var h=t.exports=function(t){var r,n=this;u.Writable.call(n),n._opts=t,n._body=[],n._headers={},t.auth&&n.setHeader(\"Authorization\",\"Basic \"+new e(t.auth).toString(\"base64\")),Object.keys(t.headers).forEach((function(e){n.setHeader(e,t.headers[e])}));var i=!0;if(\"disable-fetch\"===t.mode||\"requestTimeout\"in t&&!o.abortController)i=!1,r=!0;else if(\"prefer-streaming\"===t.mode)r=!1;else if(\"allow-wrong-content-type\"===t.mode)r=!o.overrideMimeType;else{if(t.mode&&\"default\"!==t.mode&&\"prefer-fast\"!==t.mode)throw new Error(\"Invalid value for opts.mode\");r=!0}n._mode=function(t,e){return o.fetch&&e?\"fetch\":o.mozchunkedarraybuffer?\"moz-chunked-arraybuffer\":o.msstream?\"ms-stream\":o.arraybuffer&&t?\"arraybuffer\":o.vbArray&&t?\"text:vbarray\":\"text\"}(r,i),n._fetchTimer=null,n.on(\"finish\",(function(){n._onFinish()}))};s(h,u.Writable),h.prototype.setHeader=function(t,e){var r=t.toLowerCase();-1===d.indexOf(r)&&(this._headers[r]={name:t,value:e})},h.prototype.getHeader=function(t){var e=this._headers[t.toLowerCase()];return e?e.value:null},h.prototype.removeHeader=function(t){delete this._headers[t.toLowerCase()]},h.prototype._onFinish=function(){var t=this;if(!t._destroyed){var r=t._opts,s=t._headers,a=null;\"GET\"!==r.method&&\"HEAD\"!==r.method&&(a=o.arraybuffer?c(e.concat(t._body)):o.blobConstructor?new n.Blob(t._body.map((function(t){return c(t)})),{type:(s[\"content-type\"]||{}).value||\"\"}):e.concat(t._body).toString());var u=[];if(Object.keys(s).forEach((function(t){var e=s[t].name,r=s[t].value;Array.isArray(r)?r.forEach((function(t){u.push([e,t])})):u.push([e,r])})),\"fetch\"===t._mode){var l=null;if(o.abortController){var h=new AbortController;l=h.signal,t._fetchAbortController=h,\"requestTimeout\"in r&&0!==r.requestTimeout&&(t._fetchTimer=n.setTimeout((function(){t.emit(\"requestTimeout\"),t._fetchAbortController&&t._fetchAbortController.abort()}),r.requestTimeout))}n.fetch(t._opts.url,{method:t._opts.method,headers:u,body:a||void 0,mode:\"cors\",credentials:r.withCredentials?\"include\":\"same-origin\",signal:l}).then((function(e){t._fetchResponse=e,t._connect()}),(function(e){n.clearTimeout(t._fetchTimer),t._destroyed||t.emit(\"error\",e)}))}else{var d=t._xhr=new n.XMLHttpRequest;try{d.open(t._opts.method,t._opts.url,!0)}catch(e){return void i.nextTick((function(){t.emit(\"error\",e)}))}\"responseType\"in d&&(d.responseType=t._mode.split(\":\")[0]),\"withCredentials\"in d&&(d.withCredentials=!!r.withCredentials),\"text\"===t._mode&&\"overrideMimeType\"in d&&d.overrideMimeType(\"text/plain; charset=x-user-defined\"),\"requestTimeout\"in r&&(d.timeout=r.requestTimeout,d.ontimeout=function(){t.emit(\"requestTimeout\")}),u.forEach((function(t){d.setRequestHeader(t[0],t[1])})),t._response=null,d.onreadystatechange=function(){switch(d.readyState){case f.LOADING:case f.DONE:t._onXHRProgress()}},\"moz-chunked-arraybuffer\"===t._mode&&(d.onprogress=function(){t._onXHRProgress()}),d.onerror=function(){t._destroyed||t.emit(\"error\",new Error(\"XHR error\"))};try{d.send(a)}catch(e){return void i.nextTick((function(){t.emit(\"error\",e)}))}}}},h.prototype._onXHRProgress=function(){(function(t){try{var e=t.status;return null!==e&&0!==e}catch(t){return!1}})(this._xhr)&&!this._destroyed&&(this._response||this._connect(),this._response._onXHRProgress())},h.prototype._connect=function(){var t=this;t._destroyed||(t._response=new l(t._xhr,t._fetchResponse,t._mode,t._fetchTimer),t._response.on(\"error\",(function(e){t.emit(\"error\",e)})),t.emit(\"response\",t._response))},h.prototype._write=function(t,e,r){this._body.push(t),r()},h.prototype.abort=h.prototype.destroy=function(){this._destroyed=!0,n.clearTimeout(this._fetchTimer),this._response&&(this._response._destroyed=!0),this._xhr?this._xhr.abort():this._fetchAbortController&&this._fetchAbortController.abort()},h.prototype.end=function(t,e,r){\"function\"==typeof t&&(r=t,t=void 0),u.Writable.prototype.end.call(this,t,e,r)},h.prototype.flushHeaders=function(){},h.prototype.setTimeout=function(){},h.prototype.setNoDelay=function(){},h.prototype.setSocketKeepAlive=function(){};var d=[\"accept-charset\",\"accept-encoding\",\"access-control-request-headers\",\"access-control-request-method\",\"connection\",\"content-length\",\"cookie\",\"cookie2\",\"date\",\"dnt\",\"expect\",\"host\",\"keep-alive\",\"origin\",\"referer\",\"te\",\"trailer\",\"transfer-encoding\",\"upgrade\",\"via\"]}).call(this,r(7).Buffer,r(3),r(8))},function(t,e,r){var n=r(7).Buffer;t.exports=function(t){if(t instanceof Uint8Array){if(0===t.byteOffset&&t.byteLength===t.buffer.byteLength)return t.buffer;if(\"function\"==typeof t.buffer.slice)return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}if(n.isBuffer(t)){for(var e=new Uint8Array(t.length),r=t.length,i=0;i= 0x80 (not a basic code point)\",\"invalid-input\":\"Invalid input\"},d=Math.floor,p=String.fromCharCode;function y(t){throw new RangeError(h[t])}function g(t,e){for(var r=t.length,n=[];r--;)n[r]=e(t[r]);return n}function m(t,e){var r=t.split(\"@\"),n=\"\";return r.length>1&&(n=r[0]+\"@\",t=r[1]),n+g((t=t.replace(f,\".\")).split(\".\"),e).join(\".\")}function b(t){for(var e,r,n=[],i=0,o=t.length;i=55296&&e<=56319&&i65535&&(e+=p((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=p(t)})).join(\"\")}function w(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function x(t,e,r){var n=0;for(t=r?d(t/700):t>>1,t+=d(t/e);t>455;n+=36)t=d(t/35);return d(n+36*t/(t+38))}function _(t){var e,r,n,i,o,s,a,c,l,f,h,p=[],g=t.length,m=0,b=128,w=72;for((r=t.lastIndexOf(\"-\"))<0&&(r=0),n=0;n=128&&y(\"not-basic\"),p.push(t.charCodeAt(n));for(i=r>0?r+1:0;i=g&&y(\"invalid-input\"),((c=(h=t.charCodeAt(i++))-48<10?h-22:h-65<26?h-65:h-97<26?h-97:36)>=36||c>d((u-m)/s))&&y(\"overflow\"),m+=c*s,!(c<(l=a<=w?1:a>=w+26?26:a-w));a+=36)s>d(u/(f=36-l))&&y(\"overflow\"),s*=f;w=x(m-o,e=p.length+1,0==o),d(m/e)>u-b&&y(\"overflow\"),b+=d(m/e),m%=e,p.splice(m++,0,b)}return v(p)}function S(t){var e,r,n,i,o,s,a,c,l,f,h,g,m,v,_,S=[];for(g=(t=b(t)).length,e=128,r=0,o=72,s=0;s=e&&hd((u-r)/(m=n+1))&&y(\"overflow\"),r+=(a-e)*m,e=a,s=0;su&&y(\"overflow\"),h==e){for(c=r,l=36;!(c<(f=l<=o?1:l>=o+26?26:l-o));l+=36)_=c-f,v=36-f,S.push(p(w(f+_%v,0))),c=d(_/v);S.push(p(w(c,0))),o=x(r,m,n==i),r=0,++n}++r,++e}return S.join(\"\")}a={version:\"1.4.1\",ucs2:{decode:b,encode:v},decode:_,encode:S,toASCII:function(t){return m(t,(function(t){return l.test(t)?\"xn--\"+S(t):t}))},toUnicode:function(t){return m(t,(function(t){return c.test(t)?_(t.slice(4).toLowerCase()):t}))}},void 0===(i=function(){return a}.call(e,r,e,t))||(t.exports=i)}()}).call(this,r(141)(t),r(3))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,\"loaded\",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,\"id\",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,r){\"use strict\";var n=r(143),i=r(154),o=r(46);t.exports={formats:o,parse:i,stringify:n}},function(t,e,r){\"use strict\";var n=r(144),i=r(71),o=r(46),s=Object.prototype.hasOwnProperty,a={brackets:function(t){return t+\"[]\"},comma:\"comma\",indices:function(t,e){return t+\"[\"+e+\"]\"},repeat:function(t){return t}},u=Array.isArray,c=Array.prototype.push,l=function(t,e){c.apply(t,u(e)?e:[e])},f=Date.prototype.toISOString,h=o.default,d={addQueryPrefix:!1,allowDots:!1,charset:\"utf-8\",charsetSentinel:!1,delimiter:\"&\",encode:!0,encoder:i.encode,encodeValuesOnly:!1,format:h,formatter:o.formatters[h],indices:!1,serializeDate:function(t){return f.call(t)},skipNulls:!1,strictNullHandling:!1},p={},y=function t(e,r,o,s,a,c,f,h,y,g,m,b,v,w,x,_){for(var S,A=e,E=_,k=0,T=!1;void 0!==(E=E.get(p))&&!T;){var O=E.get(e);if(k+=1,void 0!==O){if(O===k)throw new RangeError(\"Cyclic object value\");T=!0}void 0===E.get(p)&&(k=0)}if(\"function\"==typeof h?A=h(r,A):A instanceof Date?A=m(A):\"comma\"===o&&u(A)&&(A=i.maybeMap(A,(function(t){return t instanceof Date?m(t):t}))),null===A){if(a)return f&&!w?f(r,d.encoder,x,\"key\",b):r;A=\"\"}if(\"string\"==typeof(S=A)||\"number\"==typeof S||\"boolean\"==typeof S||\"symbol\"==typeof S||\"bigint\"==typeof S||i.isBuffer(A))return f?[v(w?r:f(r,d.encoder,x,\"key\",b))+\"=\"+v(f(A,d.encoder,x,\"value\",b))]:[v(r)+\"=\"+v(String(A))];var C,P=[];if(void 0===A)return P;if(\"comma\"===o&&u(A))w&&f&&(A=i.maybeMap(A,f)),C=[{value:A.length>0?A.join(\",\")||null:void 0}];else if(u(h))C=h;else{var I=Object.keys(A);C=y?I.sort(y):I}for(var R=s&&u(A)&&1===A.length?r+\"[]\":r,j=0;j0?x+w:\"\"}},function(t,e,r){\"use strict\";var n=r(44),i=r(150),o=r(152),s=n(\"%TypeError%\"),a=n(\"%WeakMap%\",!0),u=n(\"%Map%\",!0),c=i(\"WeakMap.prototype.get\",!0),l=i(\"WeakMap.prototype.set\",!0),f=i(\"WeakMap.prototype.has\",!0),h=i(\"Map.prototype.get\",!0),d=i(\"Map.prototype.set\",!0),p=i(\"Map.prototype.has\",!0),y=function(t,e){for(var r,n=t;null!==(r=n.next);n=r)if(r.key===e)return n.next=r.next,r.next=t.next,t.next=r,r};t.exports=function(){var t,e,r,n={assert:function(t){if(!n.has(t))throw new s(\"Side channel does not contain \"+o(t))},get:function(n){if(a&&n&&(\"object\"==typeof n||\"function\"==typeof n)){if(t)return c(t,n)}else if(u){if(e)return h(e,n)}else if(r)return function(t,e){var r=y(t,e);return r&&r.value}(r,n)},has:function(n){if(a&&n&&(\"object\"==typeof n||\"function\"==typeof n)){if(t)return f(t,n)}else if(u){if(e)return p(e,n)}else if(r)return function(t,e){return!!y(t,e)}(r,n);return!1},set:function(n,i){a&&n&&(\"object\"==typeof n||\"function\"==typeof n)?(t||(t=new a),l(t,n,i)):u?(e||(e=new u),d(e,n,i)):(r||(r={key:{},next:null}),function(t,e,r){var n=y(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}}(r,n,i))}};return n}},function(t,e,r){\"use strict\";var n=\"undefined\"!=typeof Symbol&&Symbol,i=r(146);t.exports=function(){return\"function\"==typeof n&&(\"function\"==typeof Symbol&&(\"symbol\"==typeof n(\"foo\")&&(\"symbol\"==typeof Symbol(\"bar\")&&i())))}},function(t,e,r){\"use strict\";t.exports=function(){if(\"function\"!=typeof Symbol||\"function\"!=typeof Object.getOwnPropertySymbols)return!1;if(\"symbol\"==typeof Symbol.iterator)return!0;var t={},e=Symbol(\"test\"),r=Object(e);if(\"string\"==typeof e)return!1;if(\"[object Symbol]\"!==Object.prototype.toString.call(e))return!1;if(\"[object Symbol]\"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if(\"function\"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if(\"function\"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if(\"function\"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(t,e);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},function(t,e,r){\"use strict\";var n={foo:{}},i=Object;t.exports=function(){return{__proto__:n}.foo===n.foo&&!({__proto__:null}instanceof i)}},function(t,e,r){\"use strict\";var n=\"Function.prototype.bind called on incompatible \",i=Array.prototype.slice,o=Object.prototype.toString;t.exports=function(t){var e=this;if(\"function\"!=typeof e||\"[object Function]\"!==o.call(e))throw new TypeError(n+e);for(var r,s=i.call(arguments,1),a=function(){if(this instanceof r){var n=e.apply(this,s.concat(i.call(arguments)));return Object(n)===n?n:this}return e.apply(t,s.concat(i.call(arguments)))},u=Math.max(0,e.length-s.length),c=[],l=0;l-1?i(r):r}},function(t,e,r){\"use strict\";var n=r(45),i=r(44),o=i(\"%Function.prototype.apply%\"),s=i(\"%Function.prototype.call%\"),a=i(\"%Reflect.apply%\",!0)||n.call(s,o),u=i(\"%Object.getOwnPropertyDescriptor%\",!0),c=i(\"%Object.defineProperty%\",!0),l=i(\"%Math.max%\");if(c)try{c({},\"a\",{value:1})}catch(t){c=null}t.exports=function(t){var e=a(n,s,arguments);if(u&&c){var r=u(e,\"length\");r.configurable&&c(e,\"length\",{value:1+l(0,t.length-(arguments.length-1))})}return e};var f=function(){return a(n,o,arguments)};c?c(t.exports,\"apply\",{value:f}):t.exports.apply=f},function(t,e,r){var n=\"function\"==typeof Map&&Map.prototype,i=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,\"size\"):null,o=n&&i&&\"function\"==typeof i.get?i.get:null,s=n&&Map.prototype.forEach,a=\"function\"==typeof Set&&Set.prototype,u=Object.getOwnPropertyDescriptor&&a?Object.getOwnPropertyDescriptor(Set.prototype,\"size\"):null,c=a&&u&&\"function\"==typeof u.get?u.get:null,l=a&&Set.prototype.forEach,f=\"function\"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,h=\"function\"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,d=\"function\"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,p=Boolean.prototype.valueOf,y=Object.prototype.toString,g=Function.prototype.toString,m=String.prototype.match,b=String.prototype.slice,v=String.prototype.replace,w=String.prototype.toUpperCase,x=String.prototype.toLowerCase,_=RegExp.prototype.test,S=Array.prototype.concat,A=Array.prototype.join,E=Array.prototype.slice,k=Math.floor,T=\"function\"==typeof BigInt?BigInt.prototype.valueOf:null,O=Object.getOwnPropertySymbols,C=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?Symbol.prototype.toString:null,P=\"function\"==typeof Symbol&&\"object\"==typeof Symbol.iterator,I=\"function\"==typeof Symbol&&Symbol.toStringTag&&(typeof Symbol.toStringTag===P||\"symbol\")?Symbol.toStringTag:null,R=Object.prototype.propertyIsEnumerable,j=(\"function\"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function M(t,e){if(t===1/0||t===-1/0||t!=t||t&&t>-1e3&&t<1e3||_.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(\"number\"==typeof t){var n=t<0?-k(-t):k(t);if(n!==t){var i=String(n),o=b.call(e,i.length+1);return v.call(i,r,\"$&_\")+\".\"+v.call(v.call(o,/([0-9]{3})/g,\"$&_\"),/_$/,\"\")}}return v.call(e,r,\"$&_\")}var L=r(153),F=L.custom,N=q(F)?F:null;function D(t,e,r){var n=\"double\"===(r.quoteStyle||e)?'\"':\"'\";return n+t+n}function U(t){return v.call(String(t),/\"/g,\""\")}function B(t){return!(\"[object Array]\"!==W(t)||I&&\"object\"==typeof t&&I in t)}function G(t){return!(\"[object RegExp]\"!==W(t)||I&&\"object\"==typeof t&&I in t)}function q(t){if(P)return t&&\"object\"==typeof t&&t instanceof Symbol;if(\"symbol\"==typeof t)return!0;if(!t||\"object\"!=typeof t||!C)return!1;try{return C.call(t),!0}catch(t){}return!1}t.exports=function t(e,r,n,i){var a=r||{};if(H(a,\"quoteStyle\")&&\"single\"!==a.quoteStyle&&\"double\"!==a.quoteStyle)throw new TypeError('option \"quoteStyle\" must be \"single\" or \"double\"');if(H(a,\"maxStringLength\")&&(\"number\"==typeof a.maxStringLength?a.maxStringLength<0&&a.maxStringLength!==1/0:null!==a.maxStringLength))throw new TypeError('option \"maxStringLength\", if provided, must be a positive integer, Infinity, or `null`');var u=!H(a,\"customInspect\")||a.customInspect;if(\"boolean\"!=typeof u&&\"symbol\"!==u)throw new TypeError(\"option \\\"customInspect\\\", if provided, must be `true`, `false`, or `'symbol'`\");if(H(a,\"indent\")&&null!==a.indent&&\"\\t\"!==a.indent&&!(parseInt(a.indent,10)===a.indent&&a.indent>0))throw new TypeError('option \"indent\" must be \"\\\\t\", an integer > 0, or `null`');if(H(a,\"numericSeparator\")&&\"boolean\"!=typeof a.numericSeparator)throw new TypeError('option \"numericSeparator\", if provided, must be `true` or `false`');var y=a.numericSeparator;if(void 0===e)return\"undefined\";if(null===e)return\"null\";if(\"boolean\"==typeof e)return e?\"true\":\"false\";if(\"string\"==typeof e)return function t(e,r){if(e.length>r.maxStringLength){var n=e.length-r.maxStringLength,i=\"... \"+n+\" more character\"+(n>1?\"s\":\"\");return t(b.call(e,0,r.maxStringLength),r)+i}return D(v.call(v.call(e,/(['\\\\])/g,\"\\\\$1\"),/[\\x00-\\x1f]/g,$),\"single\",r)}(e,a);if(\"number\"==typeof e){if(0===e)return 1/0/e>0?\"0\":\"-0\";var w=String(e);return y?M(e,w):w}if(\"bigint\"==typeof e){var _=String(e)+\"n\";return y?M(e,_):_}var k=void 0===a.depth?5:a.depth;if(void 0===n&&(n=0),n>=k&&k>0&&\"object\"==typeof e)return B(e)?\"[Array]\":\"[Object]\";var O=function(t,e){var r;if(\"\\t\"===t.indent)r=\"\\t\";else{if(!(\"number\"==typeof t.indent&&t.indent>0))return null;r=A.call(Array(t.indent+1),\" \")}return{base:r,prev:A.call(Array(e+1),r)}}(a,n);if(void 0===i)i=[];else if(V(i,e)>=0)return\"[Circular]\";function F(e,r,o){if(r&&(i=E.call(i)).push(r),o){var s={depth:a.depth};return H(a,\"quoteStyle\")&&(s.quoteStyle=a.quoteStyle),t(e,s,n+1,i)}return t(e,a,n+1,i)}if(\"function\"==typeof e&&!G(e)){var z=function(t){if(t.name)return t.name;var e=m.call(g.call(t),/^function\\s*([\\w$]+)/);if(e)return e[1];return null}(e),J=Q(e,F);return\"[Function\"+(z?\": \"+z:\" (anonymous)\")+\"]\"+(J.length>0?\" { \"+A.call(J,\", \")+\" }\":\"\")}if(q(e)){var tt=P?v.call(String(e),/^(Symbol\\(.*\\))_[^)]*$/,\"$1\"):C.call(e);return\"object\"!=typeof e||P?tt:K(tt)}if(function(t){if(!t||\"object\"!=typeof t)return!1;if(\"undefined\"!=typeof HTMLElement&&t instanceof HTMLElement)return!0;return\"string\"==typeof t.nodeName&&\"function\"==typeof t.getAttribute}(e)){for(var et=\"<\"+x.call(String(e.nodeName)),rt=e.attributes||[],nt=0;nt\",e.childNodes&&e.childNodes.length&&(et+=\"...\"),et+=\"\"}if(B(e)){if(0===e.length)return\"[]\";var it=Q(e,F);return O&&!function(t){for(var e=0;e=0)return!1;return!0}(it)?\"[\"+X(it,O)+\"]\":\"[ \"+A.call(it,\", \")+\" ]\"}if(function(t){return!(\"[object Error]\"!==W(t)||I&&\"object\"==typeof t&&I in t)}(e)){var ot=Q(e,F);return\"cause\"in Error.prototype||!(\"cause\"in e)||R.call(e,\"cause\")?0===ot.length?\"[\"+String(e)+\"]\":\"{ [\"+String(e)+\"] \"+A.call(ot,\", \")+\" }\":\"{ [\"+String(e)+\"] \"+A.call(S.call(\"[cause]: \"+F(e.cause),ot),\", \")+\" }\"}if(\"object\"==typeof e&&u){if(N&&\"function\"==typeof e[N]&&L)return L(e,{depth:k-n});if(\"symbol\"!==u&&\"function\"==typeof e.inspect)return e.inspect()}if(function(t){if(!o||!t||\"object\"!=typeof t)return!1;try{o.call(t);try{c.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(e)){var st=[];return s&&s.call(e,(function(t,r){st.push(F(r,e,!0)+\" => \"+F(t,e))})),Z(\"Map\",o.call(e),st,O)}if(function(t){if(!c||!t||\"object\"!=typeof t)return!1;try{c.call(t);try{o.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(e)){var at=[];return l&&l.call(e,(function(t){at.push(F(t,e))})),Z(\"Set\",c.call(e),at,O)}if(function(t){if(!f||!t||\"object\"!=typeof t)return!1;try{f.call(t,f);try{h.call(t,h)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(e))return Y(\"WeakMap\");if(function(t){if(!h||!t||\"object\"!=typeof t)return!1;try{h.call(t,h);try{f.call(t,f)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(e))return Y(\"WeakSet\");if(function(t){if(!d||!t||\"object\"!=typeof t)return!1;try{return d.call(t),!0}catch(t){}return!1}(e))return Y(\"WeakRef\");if(function(t){return!(\"[object Number]\"!==W(t)||I&&\"object\"==typeof t&&I in t)}(e))return K(F(Number(e)));if(function(t){if(!t||\"object\"!=typeof t||!T)return!1;try{return T.call(t),!0}catch(t){}return!1}(e))return K(F(T.call(e)));if(function(t){return!(\"[object Boolean]\"!==W(t)||I&&\"object\"==typeof t&&I in t)}(e))return K(p.call(e));if(function(t){return!(\"[object String]\"!==W(t)||I&&\"object\"==typeof t&&I in t)}(e))return K(F(String(e)));if(!function(t){return!(\"[object Date]\"!==W(t)||I&&\"object\"==typeof t&&I in t)}(e)&&!G(e)){var ut=Q(e,F),ct=j?j(e)===Object.prototype:e instanceof Object||e.constructor===Object,lt=e instanceof Object?\"\":\"null prototype\",ft=!ct&&I&&Object(e)===e&&I in e?b.call(W(e),8,-1):lt?\"Object\":\"\",ht=(ct||\"function\"!=typeof e.constructor?\"\":e.constructor.name?e.constructor.name+\" \":\"\")+(ft||lt?\"[\"+A.call(S.call([],ft||[],lt||[]),\": \")+\"] \":\"\");return 0===ut.length?ht+\"{}\":O?ht+\"{\"+X(ut,O)+\"}\":ht+\"{ \"+A.call(ut,\", \")+\" }\"}return String(e)};var z=Object.prototype.hasOwnProperty||function(t){return t in this};function H(t,e){return z.call(t,e)}function W(t){return y.call(t)}function V(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;r-1?t.split(\",\"):t},c=function(t,e,r,n){if(t){var o=r.allowDots?t.replace(/\\.([^.[]+)/g,\"[$1]\"):t,s=/(\\[[^[\\]]*])/g,a=r.depth>0&&/(\\[[^[\\]]*])/.exec(o),c=a?o.slice(0,a.index):o,l=[];if(c){if(!r.plainObjects&&i.call(Object.prototype,c)&&!r.allowPrototypes)return;l.push(c)}for(var f=0;r.depth>0&&null!==(a=s.exec(o))&&f=0;--o){var s,a=t[o];if(\"[]\"===a&&r.parseArrays)s=[].concat(i);else{s=r.plainObjects?Object.create(null):{};var c=\"[\"===a.charAt(0)&&\"]\"===a.charAt(a.length-1)?a.slice(1,-1):a,l=parseInt(c,10);r.parseArrays||\"\"!==c?!isNaN(l)&&a!==c&&String(l)===c&&l>=0&&r.parseArrays&&l<=r.arrayLimit?(s=[])[l]=i:\"__proto__\"!==c&&(s[c]=i):s={0:i}}i=s}return i}(l,e,r,n)}};t.exports=function(t,e){var r=function(t){if(!t)return s;if(null!==t.decoder&&void 0!==t.decoder&&\"function\"!=typeof t.decoder)throw new TypeError(\"Decoder has to be a function.\");if(void 0!==t.charset&&\"utf-8\"!==t.charset&&\"iso-8859-1\"!==t.charset)throw new TypeError(\"The charset option must be either utf-8, iso-8859-1, or undefined\");var e=void 0===t.charset?s.charset:t.charset;return{allowDots:void 0===t.allowDots?s.allowDots:!!t.allowDots,allowPrototypes:\"boolean\"==typeof t.allowPrototypes?t.allowPrototypes:s.allowPrototypes,allowSparse:\"boolean\"==typeof t.allowSparse?t.allowSparse:s.allowSparse,arrayLimit:\"number\"==typeof t.arrayLimit?t.arrayLimit:s.arrayLimit,charset:e,charsetSentinel:\"boolean\"==typeof t.charsetSentinel?t.charsetSentinel:s.charsetSentinel,comma:\"boolean\"==typeof t.comma?t.comma:s.comma,decoder:\"function\"==typeof t.decoder?t.decoder:s.decoder,delimiter:\"string\"==typeof t.delimiter||n.isRegExp(t.delimiter)?t.delimiter:s.delimiter,depth:\"number\"==typeof t.depth||!1===t.depth?+t.depth:s.depth,ignoreQueryPrefix:!0===t.ignoreQueryPrefix,interpretNumericEntities:\"boolean\"==typeof t.interpretNumericEntities?t.interpretNumericEntities:s.interpretNumericEntities,parameterLimit:\"number\"==typeof t.parameterLimit?t.parameterLimit:s.parameterLimit,parseArrays:!1!==t.parseArrays,plainObjects:\"boolean\"==typeof t.plainObjects?t.plainObjects:s.plainObjects,strictNullHandling:\"boolean\"==typeof t.strictNullHandling?t.strictNullHandling:s.strictNullHandling}}(e);if(\"\"===t||null==t)return r.plainObjects?Object.create(null):{};for(var l=\"string\"==typeof t?function(t,e){var r,c={__proto__:null},l=e.ignoreQueryPrefix?t.replace(/^\\?/,\"\"):t,f=e.parameterLimit===1/0?void 0:e.parameterLimit,h=l.split(e.delimiter,f),d=-1,p=e.charset;if(e.charsetSentinel)for(r=0;r-1&&(g=o(g)?[g]:g),i.call(c,y)?c[y]=n.combine(c[y],g):c[y]=g}return c}(t,r):t,f=r.plainObjects?Object.create(null):{},h=Object.keys(l),d=0;d{e&&console.log(\"starting getPalette with image\",t);const{fileDirectory:r}=t,{BitsPerSample:n,ColorMap:i,ImageLength:o,ImageWidth:s,PhotometricInterpretation:a,SampleFormat:u,SamplesPerPixel:c}=r;if(!i)throw new Error(\"[geotiff-palette]: the image does not contain a color map, so we can't make a palette.\");const l=Math.pow(2,n);e&&console.log(\"[geotiff-palette]: count:\",l);const f=i.length/3;if(e&&console.log(\"[geotiff-palette]: bandSize:\",f),f!==l)throw new Error(\"[geotiff-palette]: can't handle situations where the color map has more or less values than the number of possible values in a raster\");const h=f,d=h+f,p=[];for(let t=0;te in t?i(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,c=(t,e)=>i(t,\"name\",{value:e,configurable:!0});const l=r(157),f=r(192),h=r(194),d=c(t=>new Array(t).fill(0).map((t,e)=>e),\"range\");function p(t,e={}){var r=e,{bands:n,height:i,precise:c=!1,stats:p,width:y,layout:g}=r,m=((t,e)=>{var r={};for(var n in t)s.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&o)for(var n of o(t))e.indexOf(n)<0&&a.call(t,n)&&(r[n]=t[n]);return r})(r,[\"bands\",\"height\",\"precise\",\"stats\",\"width\",\"layout\"]);if(\"function\"==typeof t.then)throw new Error(\"[calc-image-stats] you passed in a promise as the data values. please resolve the promise first before calling calcImageStats\");const b=f({bands:n,data:t,height:i,layout:g,width:y});null!=n||(n=b.bands),null!=i||(i=b.height),null!=g||(g=b.layout),null!=y||(y=b.width);const v=d(n).map(e=>{let r;const f=((t,e)=>{for(var r in e||(e={}))s.call(e,r)&&u(t,r,e[r]);if(o)for(var r of o(e))a.call(e,r)&&u(t,r,e[r]);return t})({precise:c,stats:p},m);if([\"[band][row,column]\",\"[band][column,row]\"].includes(g))r=t[e];else if([\"[band][row][column]\",\"[band][column][row]\"].includes(g))r=t[e],f.chunked=!0;else if(1===n&&[\"[band,row,column]\",\"[row,column,band]\",\"[column,band,row]\",\"[column,row,band]\"].includes(g))r=t;else{const o={band:[e,e]},s={band:n,column:y,row:i};r=h.iterClip({data:t,layout:g,rect:o,sizes:s})}return l(r,f)});return{depth:n,height:i,width:y,bands:v}}c(p,\"calcImageStats\"),void 0!==(n=function(){return p}.call(e,r,e,t))&&(t.exports=n),t.exports=p,t.exports.default=p,t.exports.calcImageStats=p,\"object\"==typeof self&&(self.calcImageStats=p),\"object\"==typeof window&&(self.calcImageStats=p)},function(t,e,r){var n;const{getOrCreateIterator:i}=r(72),{add:o,compare:s,divide:a,mean:u,multiply:c,pow:l,sort:f,subtract:h,sum:d}=r(158),p=r(181);function y(t,{async:e=!1,chunked:r=!1,noData:n,filter:d,calcCount:y=!0,calcHistogram:g=!0,calcInvalid:m=!0,calcMax:b=!0,calcMean:v=!0,calcMedian:w=!0,calcMin:x=!0,calcMode:_=!0,calcModes:S=!0,calcProduct:A=!0,calcRange:E=!0,calcStd:k=!0,calcSum:T=!0,calcValid:O=!0,calcVariance:C=!0,calcUniques:P=!0,precise:I=!1,precise_max_decimal_digits:R=100,stats:j}={debugLevel:0}){j&&(j.forEach(t=>{[\"count\",\"histogram\",\"invalid\",\"max\",\"mean\",\"median\",\"min\",\"mode\",\"modes\",\"product\",\"range\",\"sum\",\"std\",\"valid\",\"variance\",\"uniques\"].includes(t)||console.warn(`[calc-stats] skipping unknown stat \"${t}\"`)}),y=j.includes(\"count\"),g=j.includes(\"histogram\"),m=j.includes(\"invalid\"),b=j.includes(\"max\"),v=j.includes(\"mean\"),w=j.includes(\"median\"),x=j.includes(\"min\"),_=j.includes(\"mode\"),S=j.includes(\"modes\"),A=j.includes(\"product\"),E=j.includes(\"range\"),k=j.includes(\"std\"),T=j.includes(\"sum\"),O=j.includes(\"valid\"),C=j.includes(\"variance\"),P=j.includes(\"uniques\"));const M=i(t);let L,F,N,D=g||w||_||S||C||k||P,U=y||v||w||A||O||C||k||\"function\"==typeof d,B=y||m||\"function\"==typeof d,G=T||v||C||k,q=x||E,z=b||E,H=A,W=0,V=0,$=0,K=I?\"0\":0;const Y={};let Z,X;Z=I?t=>{t=t.toString(),U&&W++,!q||void 0!==L&&\"<\"!==s(t,L)||(L=t),!z||void 0!==F&&\">\"!==s(t,F)||(F=t),H&&(N=1===W?t:c(N,t)),G&&(K=o(K,t)),D&&(t in Y?Y[t].ct++:Y[t]={n:t.toString(),ct:1})}:t=>{U&&W++,q&&(void 0===L||tF)&&(F=t),H&&(N=1===W?t:N*t),G&&(K+=t),D&&(t in Y?Y[t].ct++:Y[t]={n:t,ct:1})},X=\"number\"==typeof n&&\"function\"==typeof d?t=>{$++,\"number\"!=typeof t||isNaN(t)||t===n||!0!==d({valid:W,index:$,value:t})?B&&V++:Z(t)}:\"number\"==typeof n?t=>{\"number\"!=typeof t||isNaN(t)||t===n?B&&V++:Z(t)}:\"function\"==typeof d?t=>{$++,\"number\"!=typeof t||isNaN(t)||!0!==d({valid:W,index:$,value:t})?B&&V++:Z(t)}:t=>{\"number\"!=typeof t||isNaN(t)?B&&V++:Z(t)};const Q=()=>{const t={};if(y&&(t.count=I?o(V.toString(),W.toString()):V+W),O&&(t.valid=I?W.toString():W),m&&(t.invalid=I?V.toString():V),w&&(t.median=p.calculate({counts:Y,precise:I,total:W})),x&&(t.min=L),b&&(t.max=F),A&&(t.product=N),T&&(t.sum=K),E&&(t.range=I?h(F.toString(),L.toString()):F-L),v||C||k){const e=I?a(K,W.toString(),{max_decimal_digits:R}):K/W;if(v&&(t.mean=e),C||k){const r=(({count:t,histogram:e,mean_value:r,precise:n=!1})=>{if(n){r=r.toString();const n=Object.values(e).reduce((t,{n:e,ct:n})=>{const i=h(e.toString(),r);return o(t,c(n.toString(),l(i,\"2\")))},\"0\");return a(n,t.toString())}return Object.values(e).reduce((t,{n:e,ct:n})=>t+n*Math.pow(e-r,2),0)/t})({count:W,histogram:Y,mean_value:e,precise:I});C&&(t.variance=r),k&&(t.std=I?Math.sqrt(Number(r)).toString():Math.sqrt(r))}}if(g&&(I&&Object.values(Y).forEach(t=>{t.ct=t.ct.toString()}),t.histogram=Y),_||S){let e=0,r=[];for(let t in Y){const{n:n,ct:i}=Y[t];i===e?r.push(I?n.toString():n):i>e&&(e=i,r=[I?n.toString():n])}S&&(t.modes=r),_&&(t.mode=I?u(r):r.reduce((t,e)=>t+e,0)/r.length)}return P&&(t.uniques=I?f(Object.keys(Y)):Object.values(Y).map(({n:t})=>t).sort((t,e)=>t-e)),t};if(r){if(e)return(async()=>{for await(let t of M)for(let e of t)X(e);return Q()})();for(let t of M)for(let e of t)X(e);return Q()}if(e)return(async()=>{for await(let t of M)X(t);return Q()})();for(let t of M)X(t);return Q()}void 0===(n=function(){return y}.call(e,r,e,t))||(t.exports=n),t.exports=y,t.exports.default=y,t.exports.calcStats=y,\"object\"==typeof self&&(self.calcStats=y),\"object\"==typeof window&&(window.calcStats=y)},function(t,e,r){\"use strict\";var n;const i=r(4),o=r(6),s=r(159),a=r(76),u=r(0),c=r(34),l=r(5),f=r(161),h=r(163),d=r(51),p=r(84),y=r(167),g=r(168),m=r(1),b=r(88),v=r(89),w=r(73),x=r(75),_=r(169),S=r(170),A=r(77),E=r(171),k=r(172),T=r(15),O=r(16),C=r(90),P=r(91),I=r(11),R=r(9),j=r(32),M=r(48),L=r(31),F=r(173),N={absolute:i,add:o,binomial_coefficient:s,ceil:a,clean:u,compare:c,compare_positive:l,constants:f,cosine_radians:h,count_decimal_digits:d,count_integer_digits:p,cube:y,cube_root:g,divide:m,eulers_number:b,exp:v,expand:w,factorial:x,flip_sign:_,floor:S,fraction:A,hypotenuse:E,is_infinity:T,is_integer:O,is_factorial:k,is_negative_infinity:C,is_positive_infinity:P,is_zero:I,long_addition:R,long_division:j,long_multiplication:M,long_subtraction:L,mean:r(174),max:F,min:r(86),multiply:r(53),multiply_array:r(79),multiply_range:r(47),nilakantha:r(175),ols:r(176),pow:r(35),pow_positive:r(54),primes:r(87),reciprocal:r(81),remainder:r(177),root:r(37),root_integer_digits:r(83),round:r(36),round_last_decimal:r(49),sign:r(22),sign_nonzero:r(50),simplify_fraction:r(85),sine_radians:r(178),softmax:r(179),sort:r(180),square:r(23),square_root:r(92),subtract:r(33),sum:r(55),truncate:r(93)};void 0===(n=function(){return N}.call(e,r,e,t))||(t.exports=n),t.exports=N,t.exports.default=N,\"object\"==typeof window&&(window.preciso=N),\"object\"==typeof self&&(self.preciso=N)},function(t,e,r){\"use strict\";const n=r(0),i=r(5),o=r(75),s=r(9),a=r(31),u=r(32),c=r(47);function l(t,e){switch(t=n(t),e=n(e),i(t,e)){case\"=\":return\"1\";case\">\":{const r=a(t,e),n=c(s(e,\"1\"),t),i=o(r);return u(n,i)}case\"<\":throw new Error(\"[binominal_coefficient] unsupported\")}}t.exports=l,t.exports.default=l},function(t,e,r){\"use strict\";function n(t){return t.substring(0,t.indexOf(\".\"))}t.exports=n,t.exports.default=n},function(t,e,r){\"use strict\";const{MAX_SAFE_INTEGER:n}=r(74),{MAX_SAFE_INTEGER_LENGTH:i}=r(30),{PI:o}=r(162);t.exports={MAX_SAFE_INTEGER:n,MAX_SAFE_INTEGER_LENGTH:i,PI:o}},function(t,e){t.exports={PI_100:\"3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679\"}},function(t,e,r){\"use strict\";const n=r(6),i=r(11),o=r(23),s=r(17),a=r(1);function u(t,{steps:e=100,max_decimal_digits:r=100}={}){if(i(t))return\"0\";let u,c=\"-\",l=\"1\",f=e,h=o(t),d=\"1\",p=\"1\",y=\"0\";for(let t=0;tn(t));return i(o(s),e)}t.exports=s,t.exports.default=s},function(t,e,r){\"use strict\";function n(t){return!!t.match(/^\\d+!$/i)}t.exports=n,t.exports.default=n},function(t,e,r){\"use strict\";const n=r(0),i=r(34);function o(t){\"string\"==typeof t&&(t=Array.prototype.slice.call(arguments));let e=n(t[0]);const r=t.length;for(let n=1;n\"===i(r,e)&&(e=r)}return e}t.exports=o,t.exports.default=o},function(t,e,r){\"use strict\";const n=r(6),i=r(1);function o(t,e){let r=0,o=\"0\";for(let e of t)r++,o=n(o,e);return i(o,r.toString(),e)}t.exports=o,t.exports.default=o},function(t,e,r){\"use strict\";const n=r(6),i=r(9),o=r(1),s=r(17);function a(t=100,{divide_options:e}={}){let r=\"+\",a=\"3\",u=\"2\",c=\"3\",l=\"4\";for(let f=1;fi(t,{max_decimal_digits:e}));const r=o(t);return t.map(t=>n(t,r,{max_decimal_digits:e,ellipsis:!1}))}t.exports=s,t.exports.default=s},function(t,e,r){\"use strict\";const n=r(34);function i(t,{direction:e=\"ascending\"}={direction:\"ascending\"}){const r=\"desc\"===e||\"descending\"===e?\"<\":\">\";return t.sort((t,e)=>n(t,e)===r?1:-1)}t.exports=i,t.exports.default=i},function(t,e,r){var n;const i=r(182),o=r(191);function s({counts:t,nums:e,no_data:r,precise:n,threshold:s=50,total:a}){return void 0!==t||void 0!==a||e.length>s?i({counts:t,no_data:r,nums:e,precise:n,total:a}):o({no_data:r,nums:e,precise:n})}const a={calculate:s};void 0===(n=function(){return a}.call(e,r,e,t))||(t.exports=n),t.exports=a,t.exports.default={calculate:s},\"object\"==typeof window&&(window.mediana=a),\"object\"==typeof self&&(self.mediana=a)},function(t,e,r){const n=r(183),i=r(94);function o({counts:t,nums:e,no_data:r,precise:o=!1,total:s}){void 0!==t&&void 0!==s||({counts:t,total:s}=n({nums:e,no_data:r}));const a=Object.values(t).sort((t,e)=>t.n-e.n),u=s/2,c=a.length;if(0!==c){if(1===c)return o?a[0].n.toString():a[0].n;{let t=0;if(s%2==0)for(let e=0;eu)return t-n===u?i(a[e-1].n,r,{precise:o}):o?r.toString():r}else for(let e=0;eu)return o?r.toString():r}}}}t.exports=o,t.exports.default=o},function(t,e){function r({nums:t,no_data:e}){let r=t.length;const n={};let i=0;if(void 0!==e)for(let o=0;o=a){const t=s-a;let r=o;for(let e=0;es;t--)result+=\"0\";return result+=o,e+result}return e+o.substring(0,s)+\".\"+o.substring(s)}t.exports=r,t.exports.default=r},function(t,e,r){const n=r(98),i=r(18),o=r(186);function s(t,e,r){if(t=i(t),\"0\"===(e=i(e)))throw new Error(\"[preciso] division by zero\");if(\"\"===t||\"0\"===t)return\"0\";const s=\"-\"!==t[0],a=\"-\"!==e[0],u=s!==a?\"-\":\"\";return s||(t=n(t)),a||(e=n(e)),u+o(t,e,r)}t.exports=s,t.exports.default=s},function(t,e,r){const n=r(38),i=r(95),o=(r(187),r(189)),s=r(190);t.exports=function(t,e,{max_decimal_digits:r=100,ellipsis:a=!1}={}){\"0\"===t[0]&&(t=t.substring(1)),\"0\"===e[0]&&(e=e.substring(1));const u=t.indexOf(\".\"),c=e.indexOf(\".\"),l=-1===u?t.length:u,f=-1===c?0:e.length-1-c;let h=!1;t=t.replace(/\\./,\"\"),e=e.replace(/\\./,\"\");const d=t.length;let p,y=\"\",g=\"\",m=-1*f,b=0;for(let r=0;r\"===p){let t=1,r=i(e,e),s=e;for(;\">\"!==n(r,y);)t++,s=r,r=i(r,e);if(t=t.toString(),\"\"!==g)for(let e=t.length;e<=b;e++)g+=\"0\";g+=t,y=o(y,s),b=0}else{if(\"<\"===p){\"\"===g&&m++,b++;continue}if(\"=\"===p){if(\"\"!==g)for(let t=0;t3){g+=\"...\",h=!0;break}}else t[y]=1;const r=n(y,e);if(\">\"===r){let t=1,r=i(e,e),s=e;for(;\">\"!==n(r,y);)t++,s=r,r=i(r,e);t=t.toString();for(let e=t.length;e<=b;e++)g+=\"0\";if(g+=t,y=o(y,s),\"0\"===y)break;b=0}else{if(\"<\"===r){b++;continue}if(\"=\"===r){for(let t=0;tw){for(let t=w;t0&&(g=s(g.substring(0,g.length-t+1)))}return\".\"===g[0]&&(g=\"0\"+g),g}},function(t,e,r){const n=r(98),i=r(18),o=r(38),s=r(188);function a(t,e){t=i(t),e=i(e);const r=\"-\"!==t[0]!==(\"-\"!==e[0])?\"-\":\"\";t=n(t),e=n(e);if(\"<\"===o(t,e)){const r=t;t=e,e=r}return r+s(t,e)}t.exports=a,t.exports.default=a},function(t,e,r){const{MAX_SAFE_INTEGER_LENGTH:n}=r(56);t.exports=function(t,e){if(\"0\"===t||\"0\"===e)return\"0\";const r=t.indexOf(\".\"),i=e.indexOf(\".\"),o=(-1===r?t.length:r)+(-1===i?e.length:i),s=(-1===r?0:t.length-1-r)+(-1===i?0:e.length-1-i);if(0===s&&o=0;){const t=h,e=h-=15,r=a.substring(e,t);f.push([Number(r),r.length])}const d=[],p=[];for(let t=0,e=l-1;e>=0;e--,t++){const r=u[e],n=Number(r);let i=0,o=\"\";const s=f.length-1;f.forEach(([t,e],r)=>{let a=(i+n*t).toString();const u=a.length;if(u>e&&r!==s){const t=-1*e;o=a.slice(t)+o,i=Number(a.slice(0,t))}else{const t=e-u;for(let e=0;eNumber(t)),o.length])}const y=d.length,g=p[p.length-1][1]+y;let m=\"\",b=0;for(let t=0;t=0&&(e+=r[o])}e>=10?(e=e.toString(),m=e[e.length-1]+m,b=Number(e.slice(0,-1))):(m=e+m,b=0)}if(0===s)m=m.replace(/^0+/,\"\");else{const t=m.length-s;m=m.substring(0,t)+\".\"+m.substring(t),m=m.replace(/^0+/,\"\"),m=m.replace(/\\.?0+$/,\"\"),\".\"===m[0]&&(m=\"0\"+m)}return m}},function(t,e,r){const n=r(18),i=r(38),o=r(96),s=r(97);function a(t,e){t=n(t),e=n(e);const r=\"-\"!==t[0],a=\"-\"!==e[0];if(r){if(a){const r=i(t,e);return\">\"===r?s(t,e):\"<\"===r?\"-\"+s(e,t):\"0\"}return o(t,e.substring(1))}if(a)return\"-\"+o(t.substring(1),e);{t=t.substring(1),e=e.substring(1);const r=i(t,e);return\">\"===r?\"-\"+s(t,e):\"<\"===r?s(e,t):\"0\"}}t.exports=a,t.exports.default=a},function(t,e){const r=[\"5\",\"6\",\"7\",\"8\",\"9\"];t.exports=function(t){\"+\"===t[0]&&(t=t.substring(1));const e=t.length;let n=\"\";const i=t[t.length-1];if(r.includes(i)){let r;for(r=e-2;r>=0;r--){const e=t[r];if(\".\"===e||\"-\"===e)continue;const i=Number(e)+1;if(10!==i){n=i+n;break}n=\"0\"+n}r>0&&(n=t.substring(0,r)+n)}else n=t.substring(0,e-1);return\".\"===n[n.length-1]&&(n=n.substring(0,n.length-1)),n.indexOf(\".\")>-1&&(n=n.replace(/0+$/,\"\")),n}},function(t,e,r){const n=r(94);function i({nums:t,no_data:e,precise:r=!1}){switch((t=t.filter(t=>t!==e).sort((t,e)=>t-e)).length){case 0:return;case 1:return r?t[0].toString():t[0];default:const e=t.length/2;if(t.length%2==0)return n(t[e-1],t[e],{precise:r});{const n=Math.floor(e);return r?t[n].toString():t[n]}}}t.exports=i,t.exports.default=i},function(t,e,r){var n;const i=r(193);function o({bands:t,data:e,height:r,layout:n,width:o}){const s=i(e);if(\"[row,column,band]\"===n||1===s)return{layout:\"[row,column,band]\",bands:t||(r&&o?e.length/(r*o):void 0),height:r||(t&&o?e.length/(t*o):void 0),width:o||(t&&r?e.length/(t*r):void 0)};if(2===s){if(!r||!o)return e.lengthArray.isArray(t)||t instanceof Int8Array||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array||t instanceof Float64Array||t instanceof BigInt64Array||t instanceof BigUint64Array;let r=0,n=t;for(;e(n);)r++,n=n[0];return r}},function(t,e,r){const n={},{wrapNextFunction:i}=r(72),o=r(195),s=r(196),a={Array:Array,Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:Uint8ClampedArray,Int16Array:Int16Array,Uint16Array:Uint16Array,Float32Array:Float32Array,Float64Array:Float64Array};try{a.BigInt64Array=BigInt64Array,a.BigUint64Array=BigUint64Array}catch(t){}const u=t=>t.match(/\\[[^\\]]+\\]/g),c=t=>t.startsWith(\"[\")&&t.endsWith(\"]\")?t.substring(1,t.length-1):t,l=t=>t.startsWith(\"(\")&&t.endsWith(\")\")?t.substring(1,t.length-1):t,f=t=>t.match(/(\\(.*?\\)|[^\\(,\\s]+)(?=\\s*,|\\s*$)/g),h=t=>{t=c(t),t=l(t);const e=f(t);return 1===e.length?{type:\"Vector\",dim:e[0]}:{type:\"Matrix\",parts:e.map(h)}};function d(t){const e=t.match(/[^ A-Za-z,\\[\\]]/g);if(e)throw new Error(\"The following invalid characters were used: \"+e.map(t=>`\"${t}\"`).join(\", \"));return!0}function p(t,{useLayoutCache:e=!0}={useLayoutCache:!0}){if(e&&t in n)return n[t];d(t);const r=u(t).map(h),i={type:\"Layout\",summary:r.map(t=>\"Matrix\"===t.type?t.parts.length:1),dims:r};return e&&(n[t]=i),i}function y({useLayoutCache:t=!0,data:e,layout:r,sizes:n={}}){\"string\"==typeof r&&(r=p(r,{useLayoutCache:t}));const{dims:i}=r,o=i.length,a=m({useLayoutCache:t,layout:r,sizes:n}),u=o-1,c=r.summary.toString();if(c in s){const t={data:e};return r.dims.map((e,r)=>{\"Vector\"===e.type?t[`d${r}v0`]=e.dim:\"Matrix\"===e.type&&e.parts.forEach((e,n)=>{t[`d${r}v${n}`]=e.dim,t[`m${r}v${n}`]=a[e.dim]})}),s[c].bind(t)}return({point:t,value:r})=>{let n=e;for(let e=0;ee+a[r]*t[r],0),o?n[c]=r:n=n[c]}}}function g({rect:t={}}){if(t)for(let e in t){const r=t[e];if(2!==r.length)throw new Error(\"[xdim] uh oh. invalid hyper-rectangle\");const[n,i]=r;if(n>i)throw new Error(`[xdim] uh oh. invalid range for \"${e}\". Start of ${n} can't be greater than end of ${i}.`);if(n<0)throw new Error(\"[xdim] uh oh. invalid hyper-rectangle with start \"+n)}}function m({useLayoutCache:t=!0,layout:e,sizes:r}){\"string\"==typeof e&&(e=p(e,{useLayoutCache:t}));const{dims:n}=e,i=n.length;let o={};for(let t=0;t=0;e--){const{dim:i}=t[e];o[i]=n,n*=r[t[e].dim]}}}return o}function b({useLayoutCache:t=!0,data:e,layout:r,point:n,sizes:i={}}){let o,s;\"string\"==typeof r&&(r=p(r,{useLayoutCache:t}));let a=e;const{dims:u}=r,c=u.length;for(let t=0;t=0;e--){const o=t[e];if(\"Vector\"===o.type){const{dim:t}=o;if(r+=u*n[t],e>0){if(!(t in i))throw new Error(`you cannot calculate the location without knowing the size of the \"${t}\" dimension.`);u*=i[t]}}}o=a,s=r,a=a[r]}}return{index:s,value:a,parent:o}}function v({arr:t,fill:e,lens:r,arrayTypes:n}){if(0===r.length)return t;const i=r[0];if(1===r.length){const r=n?n[n.length-1]:\"Array\";for(let n=0;n\"Vector\"===t.type?n[t.dim]:\"Matrix\"===t.type?t.parts.reduce((t,e)=>{if(!(e.dim in n))throw new Error(`[xdim] could not find \"${e.dim}\" in sizes: { ${Object.keys(n).join(\", \")} }`);return t*n[e.dim]},1):void 0);return{data:w({fill:t,shape:o,arrayTypes:i}),shape:o,arrayTypes:i}}function _({start:t=0,end:e=100}){let r=t-1;return e+=1,i((function(){return r++,r===e?{done:!0}:{done:!1,value:r}}))}function S({order:t,sizes:e,rect:r={}}){const n=Array.isArray(t)?t:Object.keys(e).sort((t,r)=>e[t]-e[r]),o=new Array(n.length),s={};for(let t=0;t=0;t--){const{value:i,done:a}=o[t].next();if(!a){for(let i=t+1;i{\"Vector\"===e.type?t[`d${r}v0`]=e.dim:\"Matrix\"===e.type&&e.parts.forEach((e,n)=>{t[`d${r}v${n}`]=e.dim,t[`m${r}v${n}`]=a[e.dim]})}),o[c].bind(t)}return({point:t})=>{let r=e;for(let e=0;ee+a[r]*t[r],0),n)return{index:s,parent:r,value:r[s]};r=r[s]}}},prepareUpdate:y,removeBraces:c,removeParentheses:l,select:b,transform:function({data:t,fill:e,from:r,to:n,sizes:i,useLayoutCache:o=!0}){\"string\"==typeof r&&(r=p(r,{useLayoutCache:o})),\"string\"==typeof n&&(n=p(n,{useLayoutCache:o}));const{data:s}=x({fill:e,layout:n,sizes:i}),a=y({useLayoutCache:o,data:s,layout:n,sizes:i}),u=S({sizes:i});for(point of u){const{value:e}=b({data:t,layout:r,point:point,sizes:i});a({point:point,value:e})}return{data:s}},update:function({useLayoutCache:t=!0,data:e,layout:r,point:n,sizes:i={},value:o}){\"string\"==typeof r&&(r=p(r,{useLayoutCache:t}));const{dims:s}=r;for(let t=0;t=0;r--){const o=t[r],{dim:s}=o;if(u+=e*n[s],r>0){if(!(s in i))throw new Error(`you cannot calculate the location without knowing the size of the \"${s}\" dimension.`);e*=i[s]}}}r?e[u]=o:e=e[u]}},clip:function({useLayoutCache:t=!0,data:e,layout:r,rect:n,sizes:i={},flat:o=!1,validate:s=!0}){s&&g({rect:n}),\"string\"==typeof r&&(r=p(r,{useLayoutCache:t}));let a=[e];if(r.dims.forEach(t=>{let e=[];a.forEach(r=>{if(\"Vector\"===t.type){const[i,o]=n[t.dim];e=e.concat(r.slice(i,o+1))}else{const{parts:o}=t;let s=[0],a=1;for(let t=o.length-1;t>=0;t--){const e=o[t],{dim:r}=e,[u,c]=n[r],l=[];for(let t=u;t<=c;t++)s.forEach(e=>{l.push(e+a*t)});s=l,a*=i[r]}s.forEach(t=>{e.push(r[t])})}}),a=e}),o)return{data:a};const u=Object.fromEntries(Object.entries(n).map(([t,[e,r]])=>[t,r-e+1])),{data:c}=x({layout:r,sizes:u}),l=r.dims.length,f=(t,e)=>{if(e===l)for(let e=0;ef(t,e+1))};return f(c,1),{data:c}},validateRect:g}},function(t,e){t.exports={1:function({point:t}){const e=this.data,r=t[this.d0v0];return{parent:e,index:r,value:e[r]}},2:function({point:t}){const e=this.data,r=this.m0v0*t[this.d0v0]+this.m0v1*t[this.d0v1];return{parent:e,index:r,value:e[r]}},3:function({point:t}){const e=this.data,r=this.m0v0*t[this.d0v0]+this.m0v1*t[this.d0v1]+this.m0v2*t[this.d0v2];return{parent:e,index:r,value:e[r]}},4:function({point:t}){const e=this.data,r=this.m0v0*t[this.d0v0]+this.m0v1*t[this.d0v1]+this.m0v2*t[this.d0v2]+this.m0v3*t[this.d0v3];return{parent:e,index:r,value:e[r]}},5:function({point:t}){const e=this.data,r=this.m0v0*t[this.d0v0]+this.m0v1*t[this.d0v1]+this.m0v2*t[this.d0v2]+this.m0v3*t[this.d0v3]+this.m0v4*t[this.d0v4];return{parent:e,index:r,value:e[r]}},\"1,1\":function({point:t}){const e=this.data[t[this.d0v0]],r=t[this.d1v0];return{parent:e,index:r,value:e[r]}},\"1,2\":function({point:t}){const e=this.data[t[this.d0v0]],r=this.m1v0*t[this.d1v0]+this.m1v1*t[this.d1v1];return{parent:e,index:r,value:e[r]}},\"1,3\":function({point:t}){const e=this.data[t[this.d0v0]],r=this.m1v0*t[this.d1v0]+this.m1v1*t[this.d1v1]+this.m1v2*t[this.d1v2];return{parent:e,index:r,value:e[r]}},\"1,4\":function({point:t}){const e=this.data[t[this.d0v0]],r=this.m1v0*t[this.d1v0]+this.m1v1*t[this.d1v1]+this.m1v2*t[this.d1v2]+this.m1v3*t[this.d1v3];return{parent:e,index:r,value:e[r]}},\"1,5\":function({point:t}){const e=this.data[t[this.d0v0]],r=this.m1v0*t[this.d1v0]+this.m1v1*t[this.d1v1]+this.m1v2*t[this.d1v2]+this.m1v3*t[this.d1v3]+this.m1v4*t[this.d1v4];return{parent:e,index:r,value:e[r]}},\"1,1,1\":function({point:t}){const e=this.data[t[this.d0v0]][t[this.d1v0]],r=t[this.d2v0];return{parent:e,index:r,value:e[r]}},\"1,1,2\":function({point:t}){const e=this.data[t[this.d0v0]][t[this.d1v0]],r=this.m2v0*t[this.d2v0]+this.m2v1*t[this.d2v1];return{parent:e,index:r,value:e[r]}},\"1,1,3\":function({point:t}){const e=this.data[t[this.d0v0]][t[this.d1v0]],r=this.m2v0*t[this.d2v0]+this.m2v1*t[this.d2v1]+this.m2v2*t[this.d2v2];return{parent:e,index:r,value:e[r]}},\"1,1,4\":function({point:t}){const e=this.data[t[this.d0v0]][t[this.d1v0]],r=this.m2v0*t[this.d2v0]+this.m2v1*t[this.d2v1]+this.m2v2*t[this.d2v2]+this.m2v3*t[this.d2v3];return{parent:e,index:r,value:e[r]}},\"1,1,5\":function({point:t}){const e=this.data[t[this.d0v0]][t[this.d1v0]],r=this.m2v0*t[this.d2v0]+this.m2v1*t[this.d2v1]+this.m2v2*t[this.d2v2]+this.m2v3*t[this.d2v3]+this.m2v4*t[this.d2v4];return{parent:e,index:r,value:e[r]}},\"1,1,1,1\":function({point:t}){const e=this.data[t[this.d0v0]][t[this.d1v0]][t[this.d2v0]],r=t[this.d3v0];return{parent:e,index:r,value:e[r]}},\"1,1,1,2\":function({point:t}){const e=this.data[t[this.d0v0]][t[this.d1v0]][t[this.d2v0]],r=this.m3v0*t[this.d3v0]+this.m3v1*t[this.d3v1];return{parent:e,index:r,value:e[r]}},\"1,1,1,3\":function({point:t}){const e=this.data[t[this.d0v0]][t[this.d1v0]][t[this.d2v0]],r=this.m3v0*t[this.d3v0]+this.m3v1*t[this.d3v1]+this.m3v2*t[this.d3v2];return{parent:e,index:r,value:e[r]}},\"1,1,1,4\":function({point:t}){const e=this.data[t[this.d0v0]][t[this.d1v0]][t[this.d2v0]],r=this.m3v0*t[this.d3v0]+this.m3v1*t[this.d3v1]+this.m3v2*t[this.d3v2]+this.m3v3*t[this.d3v3];return{parent:e,index:r,value:e[r]}},\"1,1,1,5\":function({point:t}){const e=this.data[t[this.d0v0]][t[this.d1v0]][t[this.d2v0]],r=this.m3v0*t[this.d3v0]+this.m3v1*t[this.d3v1]+this.m3v2*t[this.d3v2]+this.m3v3*t[this.d3v3]+this.m3v4*t[this.d3v4];return{parent:e,index:r,value:e[r]}},\"1,1,1,1,1\":function({point:t}){const e=this.data[t[this.d0v0]][t[this.d1v0]][t[this.d2v0]][t[this.d3v0]],r=t[this.d4v0];return{parent:e,index:r,value:e[r]}},\"1,1,1,1,2\":function({point:t}){const e=this.data[t[this.d0v0]][t[this.d1v0]][t[this.d2v0]][t[this.d3v0]],r=this.m4v0*t[this.d4v0]+this.m4v1*t[this.d4v1];return{parent:e,index:r,value:e[r]}},\"1,1,1,1,3\":function({point:t}){const e=this.data[t[this.d0v0]][t[this.d1v0]][t[this.d2v0]][t[this.d3v0]],r=this.m4v0*t[this.d4v0]+this.m4v1*t[this.d4v1]+this.m4v2*t[this.d4v2];return{parent:e,index:r,value:e[r]}},\"1,1,1,1,4\":function({point:t}){const e=this.data[t[this.d0v0]][t[this.d1v0]][t[this.d2v0]][t[this.d3v0]],r=this.m4v0*t[this.d4v0]+this.m4v1*t[this.d4v1]+this.m4v2*t[this.d4v2]+this.m4v3*t[this.d4v3];return{parent:e,index:r,value:e[r]}},\"1,1,1,1,5\":function({point:t}){const e=this.data[t[this.d0v0]][t[this.d1v0]][t[this.d2v0]][t[this.d3v0]],r=this.m4v0*t[this.d4v0]+this.m4v1*t[this.d4v1]+this.m4v2*t[this.d4v2]+this.m4v3*t[this.d4v3]+this.m4v4*t[this.d4v4];return{parent:e,index:r,value:e[r]}}}},function(t,e){t.exports={1:function({point:t,value:e}){this.data[t[this.d0v0]]=e},2:function({point:t,value:e}){this.data[this.m0v0*t[this.d0v0]+this.m0v1*t[this.d0v1]]=e},3:function({point:t,value:e}){this.data[this.m0v0*t[this.d0v0]+this.m0v1*t[this.d0v1]+this.m0v2*t[this.d0v2]]=e},4:function({point:t,value:e}){this.data[this.m0v0*t[this.d0v0]+this.m0v1*t[this.d0v1]+this.m0v2*t[this.d0v2]+this.m0v3*t[this.d0v3]]=e},5:function({point:t,value:e}){this.data[this.m0v0*t[this.d0v0]+this.m0v1*t[this.d0v1]+this.m0v2*t[this.d0v2]+this.m0v3*t[this.d0v3]+this.m0v4*t[this.d0v4]]=e},\"1,1\":function({point:t,value:e}){this.data[t[this.d0v0]][t[this.d1v0]]=e},\"1,2\":function({point:t,value:e}){this.data[t[this.d0v0]][this.m1v0*t[this.d1v0]+this.m1v1*t[this.d1v1]]=e},\"1,3\":function({point:t,value:e}){this.data[t[this.d0v0]][this.m1v0*t[this.d1v0]+this.m1v1*t[this.d1v1]+this.m1v2*t[this.d1v2]]=e},\"1,4\":function({point:t,value:e}){this.data[t[this.d0v0]][this.m1v0*t[this.d1v0]+this.m1v1*t[this.d1v1]+this.m1v2*t[this.d1v2]+this.m1v3*t[this.d1v3]]=e},\"1,5\":function({point:t,value:e}){this.data[t[this.d0v0]][this.m1v0*t[this.d1v0]+this.m1v1*t[this.d1v1]+this.m1v2*t[this.d1v2]+this.m1v3*t[this.d1v3]+this.m1v4*t[this.d1v4]]=e},\"1,1,1\":function({point:t,value:e}){this.data[t[this.d0v0]][t[this.d1v0]][t[this.d2v0]]=e},\"1,1,2\":function({point:t,value:e}){this.data[t[this.d0v0]][t[this.d1v0]][this.m2v0*t[this.d2v0]+this.m2v1*t[this.d2v1]]=e},\"1,1,3\":function({point:t,value:e}){this.data[t[this.d0v0]][t[this.d1v0]][this.m2v0*t[this.d2v0]+this.m2v1*t[this.d2v1]+this.m2v2*t[this.d2v2]]=e},\"1,1,4\":function({point:t,value:e}){this.data[t[this.d0v0]][t[this.d1v0]][this.m2v0*t[this.d2v0]+this.m2v1*t[this.d2v1]+this.m2v2*t[this.d2v2]+this.m2v3*t[this.d2v3]]=e},\"1,1,5\":function({point:t,value:e}){this.data[t[this.d0v0]][t[this.d1v0]][this.m2v0*t[this.d2v0]+this.m2v1*t[this.d2v1]+this.m2v2*t[this.d2v2]+this.m2v3*t[this.d2v3]+this.m2v4*t[this.d2v4]]=e},\"1,1,1,1\":function({point:t,value:e}){this.data[t[this.d0v0]][t[this.d1v0]][t[this.d2v0]][t[this.d3v0]]=e},\"1,1,1,2\":function({point:t,value:e}){this.data[t[this.d0v0]][t[this.d1v0]][t[this.d2v0]][this.m3v0*t[this.d3v0]+this.m3v1*t[this.d3v1]]=e},\"1,1,1,3\":function({point:t,value:e}){this.data[t[this.d0v0]][t[this.d1v0]][t[this.d2v0]][this.m3v0*t[this.d3v0]+this.m3v1*t[this.d3v1]+this.m3v2*t[this.d3v2]]=e},\"1,1,1,4\":function({point:t,value:e}){this.data[t[this.d0v0]][t[this.d1v0]][t[this.d2v0]][this.m3v0*t[this.d3v0]+this.m3v1*t[this.d3v1]+this.m3v2*t[this.d3v2]+this.m3v3*t[this.d3v3]]=e},\"1,1,1,5\":function({point:t,value:e}){this.data[t[this.d0v0]][t[this.d1v0]][t[this.d2v0]][this.m3v0*t[this.d3v0]+this.m3v1*t[this.d3v1]+this.m3v2*t[this.d3v2]+this.m3v3*t[this.d3v3]+this.m3v4*t[this.d3v4]]=e},\"1,1,1,1,1\":function({point:t,value:e}){this.data[t[this.d0v0]][t[this.d1v0]][t[this.d2v0]][t[this.d3v0]][t[this.d4v0]]=e},\"1,1,1,1,2\":function({point:t,value:e}){this.data[t[this.d0v0]][t[this.d1v0]][t[this.d2v0]][t[this.d3v0]][this.m4v0*t[this.d4v0]+this.m4v1*t[this.d4v1]]=e},\"1,1,1,1,3\":function({point:t,value:e}){this.data[t[this.d0v0]][t[this.d1v0]][t[this.d2v0]][t[this.d3v0]][this.m4v0*t[this.d4v0]+this.m4v1*t[this.d4v1]+this.m4v2*t[this.d4v2]]=e},\"1,1,1,1,4\":function({point:t,value:e}){this.data[t[this.d0v0]][t[this.d1v0]][t[this.d2v0]][t[this.d3v0]][this.m4v0*t[this.d4v0]+this.m4v1*t[this.d4v1]+this.m4v2*t[this.d4v2]+this.m4v3*t[this.d4v3]]=e},\"1,1,1,1,5\":function({point:t,value:e}){this.data[t[this.d0v0]][t[this.d1v0]][t[this.d2v0]][t[this.d3v0]][this.m4v0*t[this.d4v0]+this.m4v1*t[this.d4v1]+this.m4v2*t[this.d4v2]+this.m4v3*t[this.d4v3]+this.m4v4*t[this.d4v4]]=e}}},function(t,e,r){\"use strict\";function n(t,e){if(\"undefined\"==typeof ImageData)throw\"toCanvas is not supported in your environment\";{const r=document.createElement(\"CANVAS\"),n=e&&e.height?Math.min(t.height,e.height):Math.min(t.height,100),i=e&&e.width?Math.min(t.width,e.width):Math.min(t.width,100);r.height=n,r.width=i,r.style.minHeight=\"200px\",r.style.minWidth=\"400px\",r.style.maxWidth=\"100%\";const o=r.getContext(\"2d\"),s=function(t,e,r){if(t.values){const{noDataValue:n,mins:i,ranges:o,values:s}=t,a=s.length,u=t.width/e,c=t.height/r,l=new Uint8ClampedArray(e*r*4);for(let t=0;t{try{return t[f][h]}catch(t){console.error(t)}});if(d.every(t=>void 0!==t&&t!==n)){const n=t*(4*e)+4*r;if(1===a){const t=Math.round(d[0]),e=Math.round((t-i[0])/o[0]*255);l[n]=e,l[n+1]=e,l[n+2]=e,l[n+3]=255}else if(3===a)try{const[t,e,r]=d;l[n]=t,l[n+1]=e,l[n+2]=r,l[n+3]=255}catch(t){console.error(t)}else if(4===a)try{const[t,e,r,i]=d;l[n]=t,l[n+1]=e,l[n+2]=r,l[n+3]=i}catch(t){console.error(t)}}}return new ImageData(l,e,r)}}(t,i,n);return o.putImageData(s,0,0),r}}r.r(e),r.d(e,\"default\",(function(){return n}))},function(t,e,r){\"use strict\";r.d(e,\"a\",(function(){return i}));var n=r(19);Object(n.b)().blob;const i=Object(n.b)().default},,,function(t,e,r){\"use strict\";var n=r(26),i=r(103);var o=function(t){\"function\"==typeof t?t():t&&\"function\"==typeof t.unsubscribe&&t.unsubscribe()};e.a=function(t){const e=new i.a;let r,s=0;return new n.a(n=>{r||(r=t.subscribe(e));const i=e.subscribe(n);return s++,()=>{s--,i.unsubscribe(),0===s&&(o(r),r=void 0)}})}}])}));","module.exports = function getDepth(arr) {\n const isArray = (arr) =>\n Array.isArray(arr) ||\n arr instanceof Int8Array ||\n arr instanceof Uint8Array ||\n arr instanceof Uint8ClampedArray ||\n arr instanceof Int16Array ||\n arr instanceof Uint16Array ||\n arr instanceof Int32Array ||\n arr instanceof Uint32Array ||\n arr instanceof Float32Array ||\n arr instanceof Float64Array ||\n arr instanceof BigInt64Array ||\n arr instanceof BigUint64Array;\n\n let depth = 0;\n let part = arr;\n while (isArray(part)) {\n depth++;\n part = part[0];\n }\n return depth;\n};\n","!function(t,e){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=e():\"function\"==typeof define&&define.amd?define([],e):\"object\"==typeof exports?exports[\"get-epsg-code\"]=e():t[\"get-epsg-code\"]=e()}(\"undefined\"!=typeof self?self:this,(function(){return function(t){var e={};function o(r){if(e[r])return e[r].exports;var n=e[r]={i:r,l:!1,exports:{}};return t[r].call(n.exports,n,n.exports,o),n.l=!0,n.exports}return o.m=t,o.c=e,o.d=function(t,e,r){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},o.r=function(t){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(t,\"__esModule\",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&\"object\"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,\"default\",{enumerable:!0,value:t}),2&e&&\"string\"!=typeof t)for(var n in t)o.d(r,n,function(e){return t[e]}.bind(null,n));return r},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,\"a\",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p=\"\",o(o.s=1)}([function(t,e,o){const r=o(5);t.exports=function(t,e,o){const n=o&&o.debug||!1,a=o&&o.startIndex||0;n&&console.log(\"starting findTag with\",e,\" and \",o);const i=r(t,`<${e}[ >]`,a);if(n&&console.log(\"start:\",i),-1===i)return;const s=i+e.length+r(t.slice(i+e.length),\"[ /]\"+e+\">\",0)+1+e.length+1;if(n&&console.log(\"end:\",s),-1===s)return;const C=t.slice(i,s);return{inner:C.slice(C.indexOf(\">\")+1,C.lastIndexOf(\"<\")),outer:C,start:i,end:s}}},function(t,e,o){var r=o(2),n=o(0),a=o(6),i=o(12).default,s=o(7),C=o(8),E=(C.ARRAY_TYPE,C.EXCLUDED_FORMATS),d=C.BYTES_PER_VALUE,f=C.DATA_VIEW_READER_NAME,D=C.FORMATS,c=C.HASHED_FIELDS,g=C.NUM_FIELDS,l=(C.NUM_HASHED_FIELDS,C.UNSUPPORTED_MSG),p=D.ESRI_WKT,A=D.GEOSERVER,u=D.MAPFILE,Q=D.MAPNIK,h=D.OGC_GML,R=D.OGC_XML,G=D.OGC_WKT,I=D.POSTGIS,x=D.PROJ_4,w=D.PROJ_4_JS,M=o(9),m=new DataView(M),B=o(11).hash,F=[\"PROJECTEDCRS\",\"PROJCRS\",\"GEOGCS\",\"GEOCCS\",\"PROJCS\",\"LOCAL_CS\",\"GEODCRS\",\"GEODETICCRS\",\"GEODETICDATUM\",\"ENGCRS\",\"ENGINEERINGCRS\"];function O(t){return function(t){return!(!(t=t.trim()).startsWith(\"PROJCS[\")&&!t.startsWith(\"GEOGCS[\"))&&F.some((function(e){return t.includes(e)}))}(t)?t.includes(\"AUTHORITY\")?G:p:t.includes(\"gml:ProjectedCRS\")||t.includes(\"gml:GeodeticCRS\")||t.includes(\"gml:GeographicCRS\")?t.includes(\"gml:srsID\")?R:h:t.startsWith(\"+proj=\")?x:t.startsWith('proj4.defs(\"EPSG:')?w:/^\\d{1,6}\\=(PROJCS|GEOGCS)/.test(t)?A:t.startsWith(\"PROJECTION\")&&t.endsWith(\"END\")?u:t.endsWith(\"\")?Q:t.startsWith(\"INSERT\")?I:\"SOMETHING ELSE\"}function k(t,e,o){o&&console.log(\"looking up \"+e);var r=B(t);o&&console.log(\"hashed:\",r);var n=c.indexOf(e)+1;o&&console.log(\"offset:\",n);for(var a=n*d;a0){if(d.forEach(t=>{t.start+=E.start,t.end+=E.start}),a&&t===e.length-1)return[d[0]];s=s.concat(d)}}i=s}return i}},function(t,e,o){const r=o(0);t.exports=function(t,e,o){const n=[],a=o&&o.debug||!1;let i,s=o&&o.startIndex||0;for(;i=r(t,e,{debug:a,startIndex:s});)s=i.end,n.push(i);return n}},function(t,e){t.exports=function(t,e,o){const r=new RegExp(e).exec(t.slice(o));return r?o+r.index:-1}},function(t,e){t.exports=function(t,e,o){const r=o&&o.debug||!1;r&&console.log(\"getting \"+e+\" in \"+t);const n=\"object\"==typeof t?t.outer:t,a=`${e}\\\\=\"(.*)\"`;r&&console.log(\"pattern:\",a);const i=new RegExp(a).exec(n);if(i)return i[1]}},function(t,e){t.exports=function(t){return t=(t=t.replace('DATUM[\"D_','DATUM[\"')).replace(/\\.\\d{16,}/g,(function(t){return t.substr(0,16)}))}},function(t,e){var o=[\"esriwkt\",\"mapfile\",\"proj4\"],r=o;\"undefined\"!=typeof process&&process.env;var n=[];\"undefined\"!=typeof process&&process.env,r.includes(\"esriwkt\")||n.push(\"esriwkt\"),r.includes(\"mapfile\")||n.push(\"mapfile\"),r.includes(\"proj4\")||(n.push(\"mapnik\"),n.push(\"proj4\")),n.sort();var a=r.length,i=a+1,s=Int16Array;t.exports={ARRAY_TYPE:s,DATA_VIEW_READER_NAME:\"getInt16\",BYTES_PER_VALUE:2,DEFAULT_HASHED_FIELDS:o,EXCLUDED_FORMATS:n,FORMATS:{ESRI_WKT:\"esriwkt\",GEOSERVER:\"geoserver\",MAPFILE:\"mapfile\",MAPNIK:\"mapnik\",OGC_GML:\"gml\",OGC_XML:\"xml\",OGC_WKT:\"wkt\",POSTGIS:\"postgis\",PROJ_4:\"proj4\",PROJ_4_JS:\"js\"},HASHED_FIELDS:r,NUM_HASHED_FIELDS:a,NUM_FIELDS:i,UNSUPPORTED_MSG:\"[get-epsg-code] {} format not supported\"}},function(t,e,o){t.exports=o(10)(\"5hB9Zw2Ck9AKEi6BFEeSwwYeyJESZ7FwzRzIkWu2inbjG60iVH8SIO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nhG0/urdpX38IaTypCMZwlpOkHmTl3VlcCGU/0/ad7JADoB25S/UCcRecHcbsnlcFf5gdF1K1/BqPlBxrtMmpL5uQHTfxPcVsX4wcPMu9lQj7iB0Ozg8Qfw+EH6ecXI/xH4AfFJe9lQj7fB3Lyg8Qfw94HoWIXI/xHqk5DY8EHFN+pTuAeqsWF66hOToqSg/X3p07qRXtBZgTdB8/Sq4HZzNwHG0RLdsHz2wdJtN/UnnjaB3gkczN7/dkHw5UTKGIk1weOC9/jCQLWB7bLBHxNx9UHJqPjvMxj1Ad7sUR/E41ATmkHtKi1Yz9OReHhEbx5Pk6/Z9SuylnTB2DpAIG7ST1OfsTMgUxXPE5X3ZZH1/g7TjD2Xw1imjpO+MfcIw6GOU7R4KbpmSc4TpmyIwBFEzdOcsvsxdC0Nk5L5LWLW1Y1ThO2MqIHQjRO7M78Z5Lj0geB8V/xkpwzTqsr9DoU4TJOhES9AJ+CMU4pV9A+wKowToLZTVVsli9O7KIWG/c3Lk5FJZMxoiMtTq/uXfcuxSxOGrgmvblmK05zOqPTZVIqTt0DbJnw89EHhZM3v/AcKU4038C/qvIoTosYGMqZlSdO4lFx1Ik4Jk44siv69kAlTo/rhATl4yRO5Us9KlLs0Af8z0l4VZsDDlzt5hIbAMwSFXWqVou1NBEpKb+nTlp5EODsAFi0XQ==\")},function(t,e,o){\"use strict\";t.exports=function(t){for(var e=\"undefined\"!=typeof window&&\"function\"==typeof window.atob?window.atob(t):Buffer.from(t,\"base64\").toString(\"binary\"),o=new Uint8Array(e.length),r=0;r=this.text.length)return;t=this.text[this.place++]}switch(this.state){case 1:return this.neutral(t);case 2:return this.keyword(t);case 4:return this.quoted(t);case 5:return this.afterquote(t);case 3:return this.number(t);case-1:return}},E.prototype.afterquote=function(t){if('\"'===t)return this.word+='\"',void(this.state=4);if(s.test(t))return this.word=this.word.trim(),void this.afterItem(t);throw new Error(\"havn't handled \\\"\"+t+'\" in afterquote yet, index '+this.place)},E.prototype.afterItem=function(t){return\",\"===t?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=1)):\"]\"===t?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=1,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=-1))):void 0},E.prototype.number=function(t){if(!C.test(t)){if(s.test(t))return this.word=parseFloat(this.word),void this.afterItem(t);throw new Error(\"havn't handled \\\"\"+t+'\" in number yet, index '+this.place)}this.word+=t},E.prototype.quoted=function(t){'\"'!==t?this.word+=t:this.state=5},E.prototype.keyword=function(t){if(i.test(t))this.word+=t;else{if(\"[\"===t){var e=[];return e.push(this.word),this.level++,null===this.root?this.root=e:this.currentObject.push(e),this.stack.push(this.currentObject),this.currentObject=e,void(this.state=1)}if(!s.test(t))throw new Error(\"havn't handled \\\"\"+t+'\" in keyword yet, index '+this.place);this.afterItem(t)}},E.prototype.neutral=function(t){if(a.test(t))return this.word=t,void(this.state=2);if('\"'===t)return this.word=\"\",void(this.state=4);if(C.test(t))return this.word=t,void(this.state=3);if(!s.test(t))throw new Error(\"havn't handled \\\"\"+t+'\" in neutral yet, index '+this.place);this.afterItem(t)},E.prototype.output=function(){for(;this.place0?90:-90),t.lat_ts=t.lat1)}(a),a}}])}));\n//# sourceMappingURL=get-epsg-code-all.node.min.js.map","function addSymbolIterator(obj) {\n try {\n obj[Symbol.iterator] = function () {\n return this;\n };\n } catch (error) {\n // pass\n }\n}\n\nfunction addSymbolIteratorFallback(obj) {\n obj[\"@@iterator\"] = function () {\n return this;\n };\n}\n\nfunction wrapNextFunction(next) {\n const iter = { next };\n addSymbolIterator(iter);\n addSymbolIteratorFallback(iter);\n return iter;\n}\n\nfunction isArray(data) {\n try {\n return data.constructor.name.endsWith(\"Array\");\n } catch {\n return false;\n }\n}\n\nfunction hasNext(data) {\n try {\n return typeof data.next === \"function\";\n } catch {\n return false;\n }\n}\n\nfunction hasIterator(data) {\n try {\n return \"@@iterator\" in data;\n } catch {\n return false;\n }\n}\n\nfunction hasSymbolIterator(data) {\n try {\n return Symbol.iterator in data.constructor.prototype;\n } catch {\n return false;\n }\n}\n\nfunction isIterator(data) {\n try {\n return (\n Symbol.iterator in data &&\n typeof data.next === \"function\" &&\n data.propertyIsEnumerable(\"next\") === false\n );\n } catch {\n return false;\n }\n}\n\nfunction getIterator(data) {\n const iter = data[\"@@iterator\"];\n if (hasNext(iter)) {\n return iter;\n } else if (typeof iter === \"function\") {\n return iter();\n }\n}\n\nfunction createIterator(data) {\n let i = 0;\n let len = data.length;\n const next = () =>\n i++ < len ? { value: data[i], done: false } : { done: true };\n return wrapNextFunction(next);\n}\n\nfunction getOrCreateIterator(data) {\n if (isIterator(data)) {\n return data;\n } else if (hasSymbolIterator(data)) {\n return data[Symbol.iterator]();\n } else if (hasNext(data)) {\n return wrapNextFunction(data.next);\n } else if (hasIterator(data)) {\n return getIterator(data);\n } else if (typeof data === \"string\" || isArray(data)) {\n return createIterator(data);\n } else {\n throw \"[iter-fun] unable to determine iterator\";\n }\n}\n\nfunction zip(iters) {\n // convert input to iters just in case\n iters = iters.map(getOrCreateIterator);\n\n return wrapNextFunction(function next() {\n const values = iters.map(iter => iter.next());\n // if they are all done, stop\n if (values.every(({ done }) => done)) {\n return { done: true };\n } else {\n return {\n done: false,\n value: values.map(({ value }) => value)\n };\n }\n });\n}\n\nif (typeof module === \"object\") {\n module.exports = {\n addSymbolIterator,\n addSymbolIteratorFallback,\n isIterator,\n isArray,\n hasNext,\n hasSymbolIterator,\n hasIterator,\n getIterator,\n createIterator,\n getOrCreateIterator,\n wrapNextFunction,\n zip\n };\n}\n","L.Control.Fullscreen = L.Control.extend({\n options: {\n position: 'topleft',\n title: {\n 'false': 'View Fullscreen',\n 'true': 'Exit Fullscreen'\n }\n },\n\n onAdd: function (map) {\n var container = L.DomUtil.create('div', 'leaflet-control-fullscreen leaflet-bar leaflet-control');\n\n this.link = L.DomUtil.create('a', 'leaflet-control-fullscreen-button leaflet-bar-part', container);\n this.link.href = '#';\n\n this._map = map;\n this._map.on('fullscreenchange', this._toggleTitle, this);\n this._toggleTitle();\n\n L.DomEvent.on(this.link, 'click', this._click, this);\n\n return container;\n },\n\n _click: function (e) {\n L.DomEvent.stopPropagation(e);\n L.DomEvent.preventDefault(e);\n this._map.toggleFullscreen(this.options);\n },\n\n _toggleTitle: function() {\n this.link.title = this.options.title[this._map.isFullscreen()];\n }\n});\n\nL.Map.include({\n isFullscreen: function () {\n return this._isFullscreen || false;\n },\n\n toggleFullscreen: function (options) {\n var container = this.getContainer();\n if (this.isFullscreen()) {\n if (options && options.pseudoFullscreen) {\n this._disablePseudoFullscreen(container);\n } else if (document.exitFullscreen) {\n document.exitFullscreen();\n } else if (document.mozCancelFullScreen) {\n document.mozCancelFullScreen();\n } else if (document.webkitCancelFullScreen) {\n document.webkitCancelFullScreen();\n } else if (document.msExitFullscreen) {\n document.msExitFullscreen();\n } else {\n this._disablePseudoFullscreen(container);\n }\n } else {\n if (options && options.pseudoFullscreen) {\n this._enablePseudoFullscreen(container);\n } else if (container.requestFullscreen) {\n container.requestFullscreen();\n } else if (container.mozRequestFullScreen) {\n container.mozRequestFullScreen();\n } else if (container.webkitRequestFullscreen) {\n container.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);\n } else if (container.msRequestFullscreen) {\n container.msRequestFullscreen();\n } else {\n this._enablePseudoFullscreen(container);\n }\n }\n\n },\n\n _enablePseudoFullscreen: function (container) {\n L.DomUtil.addClass(container, 'leaflet-pseudo-fullscreen');\n this._setFullscreen(true);\n this.fire('fullscreenchange');\n },\n\n _disablePseudoFullscreen: function (container) {\n L.DomUtil.removeClass(container, 'leaflet-pseudo-fullscreen');\n this._setFullscreen(false);\n this.fire('fullscreenchange');\n },\n\n _setFullscreen: function(fullscreen) {\n this._isFullscreen = fullscreen;\n var container = this.getContainer();\n if (fullscreen) {\n L.DomUtil.addClass(container, 'leaflet-fullscreen-on');\n } else {\n L.DomUtil.removeClass(container, 'leaflet-fullscreen-on');\n }\n this.invalidateSize();\n },\n\n _onFullscreenChange: function (e) {\n var fullscreenElement =\n document.fullscreenElement ||\n document.mozFullScreenElement ||\n document.webkitFullscreenElement ||\n document.msFullscreenElement;\n\n if (fullscreenElement === this.getContainer() && !this._isFullscreen) {\n this._setFullscreen(true);\n this.fire('fullscreenchange');\n } else if (fullscreenElement !== this.getContainer() && this._isFullscreen) {\n this._setFullscreen(false);\n this.fire('fullscreenchange');\n }\n }\n});\n\nL.Map.mergeOptions({\n fullscreenControl: false\n});\n\nL.Map.addInitHook(function () {\n if (this.options.fullscreenControl) {\n this.fullscreenControl = new L.Control.Fullscreen(this.options.fullscreenControl);\n this.addControl(this.fullscreenControl);\n }\n\n var fullscreenchange;\n\n if ('onfullscreenchange' in document) {\n fullscreenchange = 'fullscreenchange';\n } else if ('onmozfullscreenchange' in document) {\n fullscreenchange = 'mozfullscreenchange';\n } else if ('onwebkitfullscreenchange' in document) {\n fullscreenchange = 'webkitfullscreenchange';\n } else if ('onmsfullscreenchange' in document) {\n fullscreenchange = 'MSFullscreenChange';\n }\n\n if (fullscreenchange) {\n var onFullscreenChange = L.bind(this._onFullscreenChange, this);\n\n this.whenReady(function () {\n L.DomEvent.on(document, fullscreenchange, onFullscreenChange);\n });\n\n this.on('unload', function () {\n L.DomEvent.off(document, fullscreenchange, onFullscreenChange);\n });\n }\n});\n\nL.control.fullscreen = function (options) {\n return new L.Control.Fullscreen(options);\n};\n","/* @preserve\n * Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com\n * (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade\n */\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\n typeof define === 'function' && define.amd ? define(['exports'], factory) :\n (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.leaflet = {}));\n})(this, (function (exports) { 'use strict';\n\n var version = \"1.9.4\";\n\n /*\r\n * @namespace Util\r\n *\r\n * Various utility functions, used by Leaflet internally.\r\n */\r\n\r\n // @function extend(dest: Object, src?: Object): Object\r\n // Merges the properties of the `src` object (or multiple objects) into `dest` object and returns the latter. Has an `L.extend` shortcut.\r\n function extend(dest) {\r\n \tvar i, j, len, src;\r\n\r\n \tfor (j = 1, len = arguments.length; j < len; j++) {\r\n \t\tsrc = arguments[j];\r\n \t\tfor (i in src) {\r\n \t\t\tdest[i] = src[i];\r\n \t\t}\r\n \t}\r\n \treturn dest;\r\n }\r\n\r\n // @function create(proto: Object, properties?: Object): Object\r\n // Compatibility polyfill for [Object.create](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/create)\r\n var create$2 = Object.create || (function () {\r\n \tfunction F() {}\r\n \treturn function (proto) {\r\n \t\tF.prototype = proto;\r\n \t\treturn new F();\r\n \t};\r\n })();\r\n\r\n // @function bind(fn: Function, …): Function\r\n // Returns a new function bound to the arguments passed, like [Function.prototype.bind](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/bind).\r\n // Has a `L.bind()` shortcut.\r\n function bind(fn, obj) {\r\n \tvar slice = Array.prototype.slice;\r\n\r\n \tif (fn.bind) {\r\n \t\treturn fn.bind.apply(fn, slice.call(arguments, 1));\r\n \t}\r\n\r\n \tvar args = slice.call(arguments, 2);\r\n\r\n \treturn function () {\r\n \t\treturn fn.apply(obj, args.length ? args.concat(slice.call(arguments)) : arguments);\r\n \t};\r\n }\r\n\r\n // @property lastId: Number\r\n // Last unique ID used by [`stamp()`](#util-stamp)\r\n var lastId = 0;\r\n\r\n // @function stamp(obj: Object): Number\r\n // Returns the unique ID of an object, assigning it one if it doesn't have it.\r\n function stamp(obj) {\r\n \tif (!('_leaflet_id' in obj)) {\r\n \t\tobj['_leaflet_id'] = ++lastId;\r\n \t}\r\n \treturn obj._leaflet_id;\r\n }\r\n\r\n // @function throttle(fn: Function, time: Number, context: Object): Function\r\n // Returns a function which executes function `fn` with the given scope `context`\r\n // (so that the `this` keyword refers to `context` inside `fn`'s code). The function\r\n // `fn` will be called no more than one time per given amount of `time`. The arguments\r\n // received by the bound function will be any arguments passed when binding the\r\n // function, followed by any arguments passed when invoking the bound function.\r\n // Has an `L.throttle` shortcut.\r\n function throttle(fn, time, context) {\r\n \tvar lock, args, wrapperFn, later;\r\n\r\n \tlater = function () {\r\n \t\t// reset lock and call if queued\r\n \t\tlock = false;\r\n \t\tif (args) {\r\n \t\t\twrapperFn.apply(context, args);\r\n \t\t\targs = false;\r\n \t\t}\r\n \t};\r\n\r\n \twrapperFn = function () {\r\n \t\tif (lock) {\r\n \t\t\t// called too soon, queue to call later\r\n \t\t\targs = arguments;\r\n\r\n \t\t} else {\r\n \t\t\t// call and lock until later\r\n \t\t\tfn.apply(context, arguments);\r\n \t\t\tsetTimeout(later, time);\r\n \t\t\tlock = true;\r\n \t\t}\r\n \t};\r\n\r\n \treturn wrapperFn;\r\n }\r\n\r\n // @function wrapNum(num: Number, range: Number[], includeMax?: Boolean): Number\r\n // Returns the number `num` modulo `range` in such a way so it lies within\r\n // `range[0]` and `range[1]`. The returned value will be always smaller than\r\n // `range[1]` unless `includeMax` is set to `true`.\r\n function wrapNum(x, range, includeMax) {\r\n \tvar max = range[1],\r\n \t min = range[0],\r\n \t d = max - min;\r\n \treturn x === max && includeMax ? x : ((x - min) % d + d) % d + min;\r\n }\r\n\r\n // @function falseFn(): Function\r\n // Returns a function which always returns `false`.\r\n function falseFn() { return false; }\r\n\r\n // @function formatNum(num: Number, precision?: Number|false): Number\r\n // Returns the number `num` rounded with specified `precision`.\r\n // The default `precision` value is 6 decimal places.\r\n // `false` can be passed to skip any processing (can be useful to avoid round-off errors).\r\n function formatNum(num, precision) {\r\n \tif (precision === false) { return num; }\r\n \tvar pow = Math.pow(10, precision === undefined ? 6 : precision);\r\n \treturn Math.round(num * pow) / pow;\r\n }\r\n\r\n // @function trim(str: String): String\r\n // Compatibility polyfill for [String.prototype.trim](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/Trim)\r\n function trim(str) {\r\n \treturn str.trim ? str.trim() : str.replace(/^\\s+|\\s+$/g, '');\r\n }\r\n\r\n // @function splitWords(str: String): String[]\r\n // Trims and splits the string on whitespace and returns the array of parts.\r\n function splitWords(str) {\r\n \treturn trim(str).split(/\\s+/);\r\n }\r\n\r\n // @function setOptions(obj: Object, options: Object): Object\r\n // Merges the given properties to the `options` of the `obj` object, returning the resulting options. See `Class options`. Has an `L.setOptions` shortcut.\r\n function setOptions(obj, options) {\r\n \tif (!Object.prototype.hasOwnProperty.call(obj, 'options')) {\r\n \t\tobj.options = obj.options ? create$2(obj.options) : {};\r\n \t}\r\n \tfor (var i in options) {\r\n \t\tobj.options[i] = options[i];\r\n \t}\r\n \treturn obj.options;\r\n }\r\n\r\n // @function getParamString(obj: Object, existingUrl?: String, uppercase?: Boolean): String\r\n // Converts an object into a parameter URL string, e.g. `{a: \"foo\", b: \"bar\"}`\r\n // translates to `'?a=foo&b=bar'`. If `existingUrl` is set, the parameters will\r\n // be appended at the end. If `uppercase` is `true`, the parameter names will\r\n // be uppercased (e.g. `'?A=foo&B=bar'`)\r\n function getParamString(obj, existingUrl, uppercase) {\r\n \tvar params = [];\r\n \tfor (var i in obj) {\r\n \t\tparams.push(encodeURIComponent(uppercase ? i.toUpperCase() : i) + '=' + encodeURIComponent(obj[i]));\r\n \t}\r\n \treturn ((!existingUrl || existingUrl.indexOf('?') === -1) ? '?' : '&') + params.join('&');\r\n }\r\n\r\n var templateRe = /\\{ *([\\w_ -]+) *\\}/g;\r\n\r\n // @function template(str: String, data: Object): String\r\n // Simple templating facility, accepts a template string of the form `'Hello {a}, {b}'`\r\n // and a data object like `{a: 'foo', b: 'bar'}`, returns evaluated string\r\n // `('Hello foo, bar')`. You can also specify functions instead of strings for\r\n // data values — they will be evaluated passing `data` as an argument.\r\n function template(str, data) {\r\n \treturn str.replace(templateRe, function (str, key) {\r\n \t\tvar value = data[key];\r\n\r\n \t\tif (value === undefined) {\r\n \t\t\tthrow new Error('No value provided for variable ' + str);\r\n\r\n \t\t} else if (typeof value === 'function') {\r\n \t\t\tvalue = value(data);\r\n \t\t}\r\n \t\treturn value;\r\n \t});\r\n }\r\n\r\n // @function isArray(obj): Boolean\r\n // Compatibility polyfill for [Array.isArray](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray)\r\n var isArray = Array.isArray || function (obj) {\r\n \treturn (Object.prototype.toString.call(obj) === '[object Array]');\r\n };\r\n\r\n // @function indexOf(array: Array, el: Object): Number\r\n // Compatibility polyfill for [Array.prototype.indexOf](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf)\r\n function indexOf(array, el) {\r\n \tfor (var i = 0; i < array.length; i++) {\r\n \t\tif (array[i] === el) { return i; }\r\n \t}\r\n \treturn -1;\r\n }\r\n\r\n // @property emptyImageUrl: String\r\n // Data URI string containing a base64-encoded empty GIF image.\r\n // Used as a hack to free memory from unused images on WebKit-powered\r\n // mobile devices (by setting image `src` to this string).\r\n var emptyImageUrl = 'data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=';\r\n\r\n // inspired by https://paulirish.com/2011/requestanimationframe-for-smart-animating/\r\n\r\n function getPrefixed(name) {\r\n \treturn window['webkit' + name] || window['moz' + name] || window['ms' + name];\r\n }\r\n\r\n var lastTime = 0;\r\n\r\n // fallback for IE 7-8\r\n function timeoutDefer(fn) {\r\n \tvar time = +new Date(),\r\n \t timeToCall = Math.max(0, 16 - (time - lastTime));\r\n\r\n \tlastTime = time + timeToCall;\r\n \treturn window.setTimeout(fn, timeToCall);\r\n }\r\n\r\n var requestFn = window.requestAnimationFrame || getPrefixed('RequestAnimationFrame') || timeoutDefer;\r\n var cancelFn = window.cancelAnimationFrame || getPrefixed('CancelAnimationFrame') ||\r\n \t\tgetPrefixed('CancelRequestAnimationFrame') || function (id) { window.clearTimeout(id); };\r\n\r\n // @function requestAnimFrame(fn: Function, context?: Object, immediate?: Boolean): Number\r\n // Schedules `fn` to be executed when the browser repaints. `fn` is bound to\r\n // `context` if given. When `immediate` is set, `fn` is called immediately if\r\n // the browser doesn't have native support for\r\n // [`window.requestAnimationFrame`](https://developer.mozilla.org/docs/Web/API/window/requestAnimationFrame),\r\n // otherwise it's delayed. Returns a request ID that can be used to cancel the request.\r\n function requestAnimFrame(fn, context, immediate) {\r\n \tif (immediate && requestFn === timeoutDefer) {\r\n \t\tfn.call(context);\r\n \t} else {\r\n \t\treturn requestFn.call(window, bind(fn, context));\r\n \t}\r\n }\r\n\r\n // @function cancelAnimFrame(id: Number): undefined\r\n // Cancels a previous `requestAnimFrame`. See also [window.cancelAnimationFrame](https://developer.mozilla.org/docs/Web/API/window/cancelAnimationFrame).\r\n function cancelAnimFrame(id) {\r\n \tif (id) {\r\n \t\tcancelFn.call(window, id);\r\n \t}\r\n }\n\n var Util = {\n __proto__: null,\n extend: extend,\n create: create$2,\n bind: bind,\n get lastId () { return lastId; },\n stamp: stamp,\n throttle: throttle,\n wrapNum: wrapNum,\n falseFn: falseFn,\n formatNum: formatNum,\n trim: trim,\n splitWords: splitWords,\n setOptions: setOptions,\n getParamString: getParamString,\n template: template,\n isArray: isArray,\n indexOf: indexOf,\n emptyImageUrl: emptyImageUrl,\n requestFn: requestFn,\n cancelFn: cancelFn,\n requestAnimFrame: requestAnimFrame,\n cancelAnimFrame: cancelAnimFrame\n };\n\n // @class Class\r\n // @aka L.Class\r\n\r\n // @section\r\n // @uninheritable\r\n\r\n // Thanks to John Resig and Dean Edwards for inspiration!\r\n\r\n function Class() {}\r\n\r\n Class.extend = function (props) {\r\n\r\n \t// @function extend(props: Object): Function\r\n \t// [Extends the current class](#class-inheritance) given the properties to be included.\r\n \t// Returns a Javascript function that is a class constructor (to be called with `new`).\r\n \tvar NewClass = function () {\r\n\r\n \t\tsetOptions(this);\r\n\r\n \t\t// call the constructor\r\n \t\tif (this.initialize) {\r\n \t\t\tthis.initialize.apply(this, arguments);\r\n \t\t}\r\n\r\n \t\t// call all constructor hooks\r\n \t\tthis.callInitHooks();\r\n \t};\r\n\r\n \tvar parentProto = NewClass.__super__ = this.prototype;\r\n\r\n \tvar proto = create$2(parentProto);\r\n \tproto.constructor = NewClass;\r\n\r\n \tNewClass.prototype = proto;\r\n\r\n \t// inherit parent's statics\r\n \tfor (var i in this) {\r\n \t\tif (Object.prototype.hasOwnProperty.call(this, i) && i !== 'prototype' && i !== '__super__') {\r\n \t\t\tNewClass[i] = this[i];\r\n \t\t}\r\n \t}\r\n\r\n \t// mix static properties into the class\r\n \tif (props.statics) {\r\n \t\textend(NewClass, props.statics);\r\n \t}\r\n\r\n \t// mix includes into the prototype\r\n \tif (props.includes) {\r\n \t\tcheckDeprecatedMixinEvents(props.includes);\r\n \t\textend.apply(null, [proto].concat(props.includes));\r\n \t}\r\n\r\n \t// mix given properties into the prototype\r\n \textend(proto, props);\r\n \tdelete proto.statics;\r\n \tdelete proto.includes;\r\n\r\n \t// merge options\r\n \tif (proto.options) {\r\n \t\tproto.options = parentProto.options ? create$2(parentProto.options) : {};\r\n \t\textend(proto.options, props.options);\r\n \t}\r\n\r\n \tproto._initHooks = [];\r\n\r\n \t// add method for calling all hooks\r\n \tproto.callInitHooks = function () {\r\n\r\n \t\tif (this._initHooksCalled) { return; }\r\n\r\n \t\tif (parentProto.callInitHooks) {\r\n \t\t\tparentProto.callInitHooks.call(this);\r\n \t\t}\r\n\r\n \t\tthis._initHooksCalled = true;\r\n\r\n \t\tfor (var i = 0, len = proto._initHooks.length; i < len; i++) {\r\n \t\t\tproto._initHooks[i].call(this);\r\n \t\t}\r\n \t};\r\n\r\n \treturn NewClass;\r\n };\r\n\r\n\r\n // @function include(properties: Object): this\r\n // [Includes a mixin](#class-includes) into the current class.\r\n Class.include = function (props) {\r\n \tvar parentOptions = this.prototype.options;\r\n \textend(this.prototype, props);\r\n \tif (props.options) {\r\n \t\tthis.prototype.options = parentOptions;\r\n \t\tthis.mergeOptions(props.options);\r\n \t}\r\n \treturn this;\r\n };\r\n\r\n // @function mergeOptions(options: Object): this\r\n // [Merges `options`](#class-options) into the defaults of the class.\r\n Class.mergeOptions = function (options) {\r\n \textend(this.prototype.options, options);\r\n \treturn this;\r\n };\r\n\r\n // @function addInitHook(fn: Function): this\r\n // Adds a [constructor hook](#class-constructor-hooks) to the class.\r\n Class.addInitHook = function (fn) { // (Function) || (String, args...)\r\n \tvar args = Array.prototype.slice.call(arguments, 1);\r\n\r\n \tvar init = typeof fn === 'function' ? fn : function () {\r\n \t\tthis[fn].apply(this, args);\r\n \t};\r\n\r\n \tthis.prototype._initHooks = this.prototype._initHooks || [];\r\n \tthis.prototype._initHooks.push(init);\r\n \treturn this;\r\n };\r\n\r\n function checkDeprecatedMixinEvents(includes) {\r\n \t/* global L: true */\r\n \tif (typeof L === 'undefined' || !L || !L.Mixin) { return; }\r\n\r\n \tincludes = isArray(includes) ? includes : [includes];\r\n\r\n \tfor (var i = 0; i < includes.length; i++) {\r\n \t\tif (includes[i] === L.Mixin.Events) {\r\n \t\t\tconsole.warn('Deprecated include of L.Mixin.Events: ' +\r\n \t\t\t\t'this property will be removed in future releases, ' +\r\n \t\t\t\t'please inherit from L.Evented instead.', new Error().stack);\r\n \t\t}\r\n \t}\r\n }\n\n /*\r\n * @class Evented\r\n * @aka L.Evented\r\n * @inherits Class\r\n *\r\n * A set of methods shared between event-powered classes (like `Map` and `Marker`). Generally, events allow you to execute some function when something happens with an object (e.g. the user clicks on the map, causing the map to fire `'click'` event).\r\n *\r\n * @example\r\n *\r\n * ```js\r\n * map.on('click', function(e) {\r\n * \talert(e.latlng);\r\n * } );\r\n * ```\r\n *\r\n * Leaflet deals with event listeners by reference, so if you want to add a listener and then remove it, define it as a function:\r\n *\r\n * ```js\r\n * function onClick(e) { ... }\r\n *\r\n * map.on('click', onClick);\r\n * map.off('click', onClick);\r\n * ```\r\n */\r\n\r\n var Events = {\r\n \t/* @method on(type: String, fn: Function, context?: Object): this\r\n \t * Adds a listener function (`fn`) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. `'click dblclick'`).\r\n \t *\r\n \t * @alternative\r\n \t * @method on(eventMap: Object): this\r\n \t * Adds a set of type/listener pairs, e.g. `{click: onClick, mousemove: onMouseMove}`\r\n \t */\r\n \ton: function (types, fn, context) {\r\n\r\n \t\t// types can be a map of types/handlers\r\n \t\tif (typeof types === 'object') {\r\n \t\t\tfor (var type in types) {\r\n \t\t\t\t// we don't process space-separated events here for performance;\r\n \t\t\t\t// it's a hot path since Layer uses the on(obj) syntax\r\n \t\t\t\tthis._on(type, types[type], fn);\r\n \t\t\t}\r\n\r\n \t\t} else {\r\n \t\t\t// types can be a string of space-separated words\r\n \t\t\ttypes = splitWords(types);\r\n\r\n \t\t\tfor (var i = 0, len = types.length; i < len; i++) {\r\n \t\t\t\tthis._on(types[i], fn, context);\r\n \t\t\t}\r\n \t\t}\r\n\r\n \t\treturn this;\r\n \t},\r\n\r\n \t/* @method off(type: String, fn?: Function, context?: Object): this\r\n \t * Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to `on`, you must pass the same context to `off` in order to remove the listener.\r\n \t *\r\n \t * @alternative\r\n \t * @method off(eventMap: Object): this\r\n \t * Removes a set of type/listener pairs.\r\n \t *\r\n \t * @alternative\r\n \t * @method off: this\r\n \t * Removes all listeners to all events on the object. This includes implicitly attached events.\r\n \t */\r\n \toff: function (types, fn, context) {\r\n\r\n \t\tif (!arguments.length) {\r\n \t\t\t// clear all listeners if called without arguments\r\n \t\t\tdelete this._events;\r\n\r\n \t\t} else if (typeof types === 'object') {\r\n \t\t\tfor (var type in types) {\r\n \t\t\t\tthis._off(type, types[type], fn);\r\n \t\t\t}\r\n\r\n \t\t} else {\r\n \t\t\ttypes = splitWords(types);\r\n\r\n \t\t\tvar removeAll = arguments.length === 1;\r\n \t\t\tfor (var i = 0, len = types.length; i < len; i++) {\r\n \t\t\t\tif (removeAll) {\r\n \t\t\t\t\tthis._off(types[i]);\r\n \t\t\t\t} else {\r\n \t\t\t\t\tthis._off(types[i], fn, context);\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t}\r\n\r\n \t\treturn this;\r\n \t},\r\n\r\n \t// attach listener (without syntactic sugar now)\r\n \t_on: function (type, fn, context, _once) {\r\n \t\tif (typeof fn !== 'function') {\r\n \t\t\tconsole.warn('wrong listener type: ' + typeof fn);\r\n \t\t\treturn;\r\n \t\t}\r\n\r\n \t\t// check if fn already there\r\n \t\tif (this._listens(type, fn, context) !== false) {\r\n \t\t\treturn;\r\n \t\t}\r\n\r\n \t\tif (context === this) {\r\n \t\t\t// Less memory footprint.\r\n \t\t\tcontext = undefined;\r\n \t\t}\r\n\r\n \t\tvar newListener = {fn: fn, ctx: context};\r\n \t\tif (_once) {\r\n \t\t\tnewListener.once = true;\r\n \t\t}\r\n\r\n \t\tthis._events = this._events || {};\r\n \t\tthis._events[type] = this._events[type] || [];\r\n \t\tthis._events[type].push(newListener);\r\n \t},\r\n\r\n \t_off: function (type, fn, context) {\r\n \t\tvar listeners,\r\n \t\t i,\r\n \t\t len;\r\n\r\n \t\tif (!this._events) {\r\n \t\t\treturn;\r\n \t\t}\r\n\r\n \t\tlisteners = this._events[type];\r\n \t\tif (!listeners) {\r\n \t\t\treturn;\r\n \t\t}\r\n\r\n \t\tif (arguments.length === 1) { // remove all\r\n \t\t\tif (this._firingCount) {\r\n \t\t\t\t// Set all removed listeners to noop\r\n \t\t\t\t// so they are not called if remove happens in fire\r\n \t\t\t\tfor (i = 0, len = listeners.length; i < len; i++) {\r\n \t\t\t\t\tlisteners[i].fn = falseFn;\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t\t// clear all listeners for a type if function isn't specified\r\n \t\t\tdelete this._events[type];\r\n \t\t\treturn;\r\n \t\t}\r\n\r\n \t\tif (typeof fn !== 'function') {\r\n \t\t\tconsole.warn('wrong listener type: ' + typeof fn);\r\n \t\t\treturn;\r\n \t\t}\r\n\r\n \t\t// find fn and remove it\r\n \t\tvar index = this._listens(type, fn, context);\r\n \t\tif (index !== false) {\r\n \t\t\tvar listener = listeners[index];\r\n \t\t\tif (this._firingCount) {\r\n \t\t\t\t// set the removed listener to noop so that's not called if remove happens in fire\r\n \t\t\t\tlistener.fn = falseFn;\r\n\r\n \t\t\t\t/* copy array in case events are being fired */\r\n \t\t\t\tthis._events[type] = listeners = listeners.slice();\r\n \t\t\t}\r\n \t\t\tlisteners.splice(index, 1);\r\n \t\t}\r\n \t},\r\n\r\n \t// @method fire(type: String, data?: Object, propagate?: Boolean): this\r\n \t// Fires an event of the specified type. You can optionally provide a data\r\n \t// object — the first argument of the listener function will contain its\r\n \t// properties. The event can optionally be propagated to event parents.\r\n \tfire: function (type, data, propagate) {\r\n \t\tif (!this.listens(type, propagate)) { return this; }\r\n\r\n \t\tvar event = extend({}, data, {\r\n \t\t\ttype: type,\r\n \t\t\ttarget: this,\r\n \t\t\tsourceTarget: data && data.sourceTarget || this\r\n \t\t});\r\n\r\n \t\tif (this._events) {\r\n \t\t\tvar listeners = this._events[type];\r\n \t\t\tif (listeners) {\r\n \t\t\t\tthis._firingCount = (this._firingCount + 1) || 1;\r\n \t\t\t\tfor (var i = 0, len = listeners.length; i < len; i++) {\r\n \t\t\t\t\tvar l = listeners[i];\r\n \t\t\t\t\t// off overwrites l.fn, so we need to copy fn to a var\r\n \t\t\t\t\tvar fn = l.fn;\r\n \t\t\t\t\tif (l.once) {\r\n \t\t\t\t\t\tthis.off(type, fn, l.ctx);\r\n \t\t\t\t\t}\r\n \t\t\t\t\tfn.call(l.ctx || this, event);\r\n \t\t\t\t}\r\n\r\n \t\t\t\tthis._firingCount--;\r\n \t\t\t}\r\n \t\t}\r\n\r\n \t\tif (propagate) {\r\n \t\t\t// propagate the event to parents (set with addEventParent)\r\n \t\t\tthis._propagateEvent(event);\r\n \t\t}\r\n\r\n \t\treturn this;\r\n \t},\r\n\r\n \t// @method listens(type: String, propagate?: Boolean): Boolean\r\n \t// @method listens(type: String, fn: Function, context?: Object, propagate?: Boolean): Boolean\r\n \t// Returns `true` if a particular event type has any listeners attached to it.\r\n \t// The verification can optionally be propagated, it will return `true` if parents have the listener attached to it.\r\n \tlistens: function (type, fn, context, propagate) {\r\n \t\tif (typeof type !== 'string') {\r\n \t\t\tconsole.warn('\"string\" type argument expected');\r\n \t\t}\r\n\r\n \t\t// we don't overwrite the input `fn` value, because we need to use it for propagation\r\n \t\tvar _fn = fn;\r\n \t\tif (typeof fn !== 'function') {\r\n \t\t\tpropagate = !!fn;\r\n \t\t\t_fn = undefined;\r\n \t\t\tcontext = undefined;\r\n \t\t}\r\n\r\n \t\tvar listeners = this._events && this._events[type];\r\n \t\tif (listeners && listeners.length) {\r\n \t\t\tif (this._listens(type, _fn, context) !== false) {\r\n \t\t\t\treturn true;\r\n \t\t\t}\r\n \t\t}\r\n\r\n \t\tif (propagate) {\r\n \t\t\t// also check parents for listeners if event propagates\r\n \t\t\tfor (var id in this._eventParents) {\r\n \t\t\t\tif (this._eventParents[id].listens(type, fn, context, propagate)) { return true; }\r\n \t\t\t}\r\n \t\t}\r\n \t\treturn false;\r\n \t},\r\n\r\n \t// returns the index (number) or false\r\n \t_listens: function (type, fn, context) {\r\n \t\tif (!this._events) {\r\n \t\t\treturn false;\r\n \t\t}\r\n\r\n \t\tvar listeners = this._events[type] || [];\r\n \t\tif (!fn) {\r\n \t\t\treturn !!listeners.length;\r\n \t\t}\r\n\r\n \t\tif (context === this) {\r\n \t\t\t// Less memory footprint.\r\n \t\t\tcontext = undefined;\r\n \t\t}\r\n\r\n \t\tfor (var i = 0, len = listeners.length; i < len; i++) {\r\n \t\t\tif (listeners[i].fn === fn && listeners[i].ctx === context) {\r\n \t\t\t\treturn i;\r\n \t\t\t}\r\n \t\t}\r\n \t\treturn false;\r\n\r\n \t},\r\n\r\n \t// @method once(…): this\r\n \t// Behaves as [`on(…)`](#evented-on), except the listener will only get fired once and then removed.\r\n \tonce: function (types, fn, context) {\r\n\r\n \t\t// types can be a map of types/handlers\r\n \t\tif (typeof types === 'object') {\r\n \t\t\tfor (var type in types) {\r\n \t\t\t\t// we don't process space-separated events here for performance;\r\n \t\t\t\t// it's a hot path since Layer uses the on(obj) syntax\r\n \t\t\t\tthis._on(type, types[type], fn, true);\r\n \t\t\t}\r\n\r\n \t\t} else {\r\n \t\t\t// types can be a string of space-separated words\r\n \t\t\ttypes = splitWords(types);\r\n\r\n \t\t\tfor (var i = 0, len = types.length; i < len; i++) {\r\n \t\t\t\tthis._on(types[i], fn, context, true);\r\n \t\t\t}\r\n \t\t}\r\n\r\n \t\treturn this;\r\n \t},\r\n\r\n \t// @method addEventParent(obj: Evented): this\r\n \t// Adds an event parent - an `Evented` that will receive propagated events\r\n \taddEventParent: function (obj) {\r\n \t\tthis._eventParents = this._eventParents || {};\r\n \t\tthis._eventParents[stamp(obj)] = obj;\r\n \t\treturn this;\r\n \t},\r\n\r\n \t// @method removeEventParent(obj: Evented): this\r\n \t// Removes an event parent, so it will stop receiving propagated events\r\n \tremoveEventParent: function (obj) {\r\n \t\tif (this._eventParents) {\r\n \t\t\tdelete this._eventParents[stamp(obj)];\r\n \t\t}\r\n \t\treturn this;\r\n \t},\r\n\r\n \t_propagateEvent: function (e) {\r\n \t\tfor (var id in this._eventParents) {\r\n \t\t\tthis._eventParents[id].fire(e.type, extend({\r\n \t\t\t\tlayer: e.target,\r\n \t\t\t\tpropagatedFrom: e.target\r\n \t\t\t}, e), true);\r\n \t\t}\r\n \t}\r\n };\r\n\r\n // aliases; we should ditch those eventually\r\n\r\n // @method addEventListener(…): this\r\n // Alias to [`on(…)`](#evented-on)\r\n Events.addEventListener = Events.on;\r\n\r\n // @method removeEventListener(…): this\r\n // Alias to [`off(…)`](#evented-off)\r\n\r\n // @method clearAllEventListeners(…): this\r\n // Alias to [`off()`](#evented-off)\r\n Events.removeEventListener = Events.clearAllEventListeners = Events.off;\r\n\r\n // @method addOneTimeEventListener(…): this\r\n // Alias to [`once(…)`](#evented-once)\r\n Events.addOneTimeEventListener = Events.once;\r\n\r\n // @method fireEvent(…): this\r\n // Alias to [`fire(…)`](#evented-fire)\r\n Events.fireEvent = Events.fire;\r\n\r\n // @method hasEventListeners(…): Boolean\r\n // Alias to [`listens(…)`](#evented-listens)\r\n Events.hasEventListeners = Events.listens;\r\n\r\n var Evented = Class.extend(Events);\n\n /*\r\n * @class Point\r\n * @aka L.Point\r\n *\r\n * Represents a point with `x` and `y` coordinates in pixels.\r\n *\r\n * @example\r\n *\r\n * ```js\r\n * var point = L.point(200, 300);\r\n * ```\r\n *\r\n * All Leaflet methods and options that accept `Point` objects also accept them in a simple Array form (unless noted otherwise), so these lines are equivalent:\r\n *\r\n * ```js\r\n * map.panBy([200, 300]);\r\n * map.panBy(L.point(200, 300));\r\n * ```\r\n *\r\n * Note that `Point` does not inherit from Leaflet's `Class` object,\r\n * which means new classes can't inherit from it, and new methods\r\n * can't be added to it with the `include` function.\r\n */\r\n\r\n function Point(x, y, round) {\r\n \t// @property x: Number; The `x` coordinate of the point\r\n \tthis.x = (round ? Math.round(x) : x);\r\n \t// @property y: Number; The `y` coordinate of the point\r\n \tthis.y = (round ? Math.round(y) : y);\r\n }\r\n\r\n var trunc = Math.trunc || function (v) {\r\n \treturn v > 0 ? Math.floor(v) : Math.ceil(v);\r\n };\r\n\r\n Point.prototype = {\r\n\r\n \t// @method clone(): Point\r\n \t// Returns a copy of the current point.\r\n \tclone: function () {\r\n \t\treturn new Point(this.x, this.y);\r\n \t},\r\n\r\n \t// @method add(otherPoint: Point): Point\r\n \t// Returns the result of addition of the current and the given points.\r\n \tadd: function (point) {\r\n \t\t// non-destructive, returns a new point\r\n \t\treturn this.clone()._add(toPoint(point));\r\n \t},\r\n\r\n \t_add: function (point) {\r\n \t\t// destructive, used directly for performance in situations where it's safe to modify existing point\r\n \t\tthis.x += point.x;\r\n \t\tthis.y += point.y;\r\n \t\treturn this;\r\n \t},\r\n\r\n \t// @method subtract(otherPoint: Point): Point\r\n \t// Returns the result of subtraction of the given point from the current.\r\n \tsubtract: function (point) {\r\n \t\treturn this.clone()._subtract(toPoint(point));\r\n \t},\r\n\r\n \t_subtract: function (point) {\r\n \t\tthis.x -= point.x;\r\n \t\tthis.y -= point.y;\r\n \t\treturn this;\r\n \t},\r\n\r\n \t// @method divideBy(num: Number): Point\r\n \t// Returns the result of division of the current point by the given number.\r\n \tdivideBy: function (num) {\r\n \t\treturn this.clone()._divideBy(num);\r\n \t},\r\n\r\n \t_divideBy: function (num) {\r\n \t\tthis.x /= num;\r\n \t\tthis.y /= num;\r\n \t\treturn this;\r\n \t},\r\n\r\n \t// @method multiplyBy(num: Number): Point\r\n \t// Returns the result of multiplication of the current point by the given number.\r\n \tmultiplyBy: function (num) {\r\n \t\treturn this.clone()._multiplyBy(num);\r\n \t},\r\n\r\n \t_multiplyBy: function (num) {\r\n \t\tthis.x *= num;\r\n \t\tthis.y *= num;\r\n \t\treturn this;\r\n \t},\r\n\r\n \t// @method scaleBy(scale: Point): Point\r\n \t// Multiply each coordinate of the current point by each coordinate of\r\n \t// `scale`. In linear algebra terms, multiply the point by the\r\n \t// [scaling matrix](https://en.wikipedia.org/wiki/Scaling_%28geometry%29#Matrix_representation)\r\n \t// defined by `scale`.\r\n \tscaleBy: function (point) {\r\n \t\treturn new Point(this.x * point.x, this.y * point.y);\r\n \t},\r\n\r\n \t// @method unscaleBy(scale: Point): Point\r\n \t// Inverse of `scaleBy`. Divide each coordinate of the current point by\r\n \t// each coordinate of `scale`.\r\n \tunscaleBy: function (point) {\r\n \t\treturn new Point(this.x / point.x, this.y / point.y);\r\n \t},\r\n\r\n \t// @method round(): Point\r\n \t// Returns a copy of the current point with rounded coordinates.\r\n \tround: function () {\r\n \t\treturn this.clone()._round();\r\n \t},\r\n\r\n \t_round: function () {\r\n \t\tthis.x = Math.round(this.x);\r\n \t\tthis.y = Math.round(this.y);\r\n \t\treturn this;\r\n \t},\r\n\r\n \t// @method floor(): Point\r\n \t// Returns a copy of the current point with floored coordinates (rounded down).\r\n \tfloor: function () {\r\n \t\treturn this.clone()._floor();\r\n \t},\r\n\r\n \t_floor: function () {\r\n \t\tthis.x = Math.floor(this.x);\r\n \t\tthis.y = Math.floor(this.y);\r\n \t\treturn this;\r\n \t},\r\n\r\n \t// @method ceil(): Point\r\n \t// Returns a copy of the current point with ceiled coordinates (rounded up).\r\n \tceil: function () {\r\n \t\treturn this.clone()._ceil();\r\n \t},\r\n\r\n \t_ceil: function () {\r\n \t\tthis.x = Math.ceil(this.x);\r\n \t\tthis.y = Math.ceil(this.y);\r\n \t\treturn this;\r\n \t},\r\n\r\n \t// @method trunc(): Point\r\n \t// Returns a copy of the current point with truncated coordinates (rounded towards zero).\r\n \ttrunc: function () {\r\n \t\treturn this.clone()._trunc();\r\n \t},\r\n\r\n \t_trunc: function () {\r\n \t\tthis.x = trunc(this.x);\r\n \t\tthis.y = trunc(this.y);\r\n \t\treturn this;\r\n \t},\r\n\r\n \t// @method distanceTo(otherPoint: Point): Number\r\n \t// Returns the cartesian distance between the current and the given points.\r\n \tdistanceTo: function (point) {\r\n \t\tpoint = toPoint(point);\r\n\r\n \t\tvar x = point.x - this.x,\r\n \t\t y = point.y - this.y;\r\n\r\n \t\treturn Math.sqrt(x * x + y * y);\r\n \t},\r\n\r\n \t// @method equals(otherPoint: Point): Boolean\r\n \t// Returns `true` if the given point has the same coordinates.\r\n \tequals: function (point) {\r\n \t\tpoint = toPoint(point);\r\n\r\n \t\treturn point.x === this.x &&\r\n \t\t point.y === this.y;\r\n \t},\r\n\r\n \t// @method contains(otherPoint: Point): Boolean\r\n \t// Returns `true` if both coordinates of the given point are less than the corresponding current point coordinates (in absolute values).\r\n \tcontains: function (point) {\r\n \t\tpoint = toPoint(point);\r\n\r\n \t\treturn Math.abs(point.x) <= Math.abs(this.x) &&\r\n \t\t Math.abs(point.y) <= Math.abs(this.y);\r\n \t},\r\n\r\n \t// @method toString(): String\r\n \t// Returns a string representation of the point for debugging purposes.\r\n \ttoString: function () {\r\n \t\treturn 'Point(' +\r\n \t\t formatNum(this.x) + ', ' +\r\n \t\t formatNum(this.y) + ')';\r\n \t}\r\n };\r\n\r\n // @factory L.point(x: Number, y: Number, round?: Boolean)\r\n // Creates a Point object with the given `x` and `y` coordinates. If optional `round` is set to true, rounds the `x` and `y` values.\r\n\r\n // @alternative\r\n // @factory L.point(coords: Number[])\r\n // Expects an array of the form `[x, y]` instead.\r\n\r\n // @alternative\r\n // @factory L.point(coords: Object)\r\n // Expects a plain object of the form `{x: Number, y: Number}` instead.\r\n function toPoint(x, y, round) {\r\n \tif (x instanceof Point) {\r\n \t\treturn x;\r\n \t}\r\n \tif (isArray(x)) {\r\n \t\treturn new Point(x[0], x[1]);\r\n \t}\r\n \tif (x === undefined || x === null) {\r\n \t\treturn x;\r\n \t}\r\n \tif (typeof x === 'object' && 'x' in x && 'y' in x) {\r\n \t\treturn new Point(x.x, x.y);\r\n \t}\r\n \treturn new Point(x, y, round);\r\n }\n\n /*\r\n * @class Bounds\r\n * @aka L.Bounds\r\n *\r\n * Represents a rectangular area in pixel coordinates.\r\n *\r\n * @example\r\n *\r\n * ```js\r\n * var p1 = L.point(10, 10),\r\n * p2 = L.point(40, 60),\r\n * bounds = L.bounds(p1, p2);\r\n * ```\r\n *\r\n * All Leaflet methods that accept `Bounds` objects also accept them in a simple Array form (unless noted otherwise), so the bounds example above can be passed like this:\r\n *\r\n * ```js\r\n * otherBounds.intersects([[10, 10], [40, 60]]);\r\n * ```\r\n *\r\n * Note that `Bounds` does not inherit from Leaflet's `Class` object,\r\n * which means new classes can't inherit from it, and new methods\r\n * can't be added to it with the `include` function.\r\n */\r\n\r\n function Bounds(a, b) {\r\n \tif (!a) { return; }\r\n\r\n \tvar points = b ? [a, b] : a;\r\n\r\n \tfor (var i = 0, len = points.length; i < len; i++) {\r\n \t\tthis.extend(points[i]);\r\n \t}\r\n }\r\n\r\n Bounds.prototype = {\r\n \t// @method extend(point: Point): this\r\n \t// Extends the bounds to contain the given point.\r\n\r\n \t// @alternative\r\n \t// @method extend(otherBounds: Bounds): this\r\n \t// Extend the bounds to contain the given bounds\r\n \textend: function (obj) {\r\n \t\tvar min2, max2;\r\n \t\tif (!obj) { return this; }\r\n\r\n \t\tif (obj instanceof Point || typeof obj[0] === 'number' || 'x' in obj) {\r\n \t\t\tmin2 = max2 = toPoint(obj);\r\n \t\t} else {\r\n \t\t\tobj = toBounds(obj);\r\n \t\t\tmin2 = obj.min;\r\n \t\t\tmax2 = obj.max;\r\n\r\n \t\t\tif (!min2 || !max2) { return this; }\r\n \t\t}\r\n\r\n \t\t// @property min: Point\r\n \t\t// The top left corner of the rectangle.\r\n \t\t// @property max: Point\r\n \t\t// The bottom right corner of the rectangle.\r\n \t\tif (!this.min && !this.max) {\r\n \t\t\tthis.min = min2.clone();\r\n \t\t\tthis.max = max2.clone();\r\n \t\t} else {\r\n \t\t\tthis.min.x = Math.min(min2.x, this.min.x);\r\n \t\t\tthis.max.x = Math.max(max2.x, this.max.x);\r\n \t\t\tthis.min.y = Math.min(min2.y, this.min.y);\r\n \t\t\tthis.max.y = Math.max(max2.y, this.max.y);\r\n \t\t}\r\n \t\treturn this;\r\n \t},\r\n\r\n \t// @method getCenter(round?: Boolean): Point\r\n \t// Returns the center point of the bounds.\r\n \tgetCenter: function (round) {\r\n \t\treturn toPoint(\r\n \t\t (this.min.x + this.max.x) / 2,\r\n \t\t (this.min.y + this.max.y) / 2, round);\r\n \t},\r\n\r\n \t// @method getBottomLeft(): Point\r\n \t// Returns the bottom-left point of the bounds.\r\n \tgetBottomLeft: function () {\r\n \t\treturn toPoint(this.min.x, this.max.y);\r\n \t},\r\n\r\n \t// @method getTopRight(): Point\r\n \t// Returns the top-right point of the bounds.\r\n \tgetTopRight: function () { // -> Point\r\n \t\treturn toPoint(this.max.x, this.min.y);\r\n \t},\r\n\r\n \t// @method getTopLeft(): Point\r\n \t// Returns the top-left point of the bounds (i.e. [`this.min`](#bounds-min)).\r\n \tgetTopLeft: function () {\r\n \t\treturn this.min; // left, top\r\n \t},\r\n\r\n \t// @method getBottomRight(): Point\r\n \t// Returns the bottom-right point of the bounds (i.e. [`this.max`](#bounds-max)).\r\n \tgetBottomRight: function () {\r\n \t\treturn this.max; // right, bottom\r\n \t},\r\n\r\n \t// @method getSize(): Point\r\n \t// Returns the size of the given bounds\r\n \tgetSize: function () {\r\n \t\treturn this.max.subtract(this.min);\r\n \t},\r\n\r\n \t// @method contains(otherBounds: Bounds): Boolean\r\n \t// Returns `true` if the rectangle contains the given one.\r\n \t// @alternative\r\n \t// @method contains(point: Point): Boolean\r\n \t// Returns `true` if the rectangle contains the given point.\r\n \tcontains: function (obj) {\r\n \t\tvar min, max;\r\n\r\n \t\tif (typeof obj[0] === 'number' || obj instanceof Point) {\r\n \t\t\tobj = toPoint(obj);\r\n \t\t} else {\r\n \t\t\tobj = toBounds(obj);\r\n \t\t}\r\n\r\n \t\tif (obj instanceof Bounds) {\r\n \t\t\tmin = obj.min;\r\n \t\t\tmax = obj.max;\r\n \t\t} else {\r\n \t\t\tmin = max = obj;\r\n \t\t}\r\n\r\n \t\treturn (min.x >= this.min.x) &&\r\n \t\t (max.x <= this.max.x) &&\r\n \t\t (min.y >= this.min.y) &&\r\n \t\t (max.y <= this.max.y);\r\n \t},\r\n\r\n \t// @method intersects(otherBounds: Bounds): Boolean\r\n \t// Returns `true` if the rectangle intersects the given bounds. Two bounds\r\n \t// intersect if they have at least one point in common.\r\n \tintersects: function (bounds) { // (Bounds) -> Boolean\r\n \t\tbounds = toBounds(bounds);\r\n\r\n \t\tvar min = this.min,\r\n \t\t max = this.max,\r\n \t\t min2 = bounds.min,\r\n \t\t max2 = bounds.max,\r\n \t\t xIntersects = (max2.x >= min.x) && (min2.x <= max.x),\r\n \t\t yIntersects = (max2.y >= min.y) && (min2.y <= max.y);\r\n\r\n \t\treturn xIntersects && yIntersects;\r\n \t},\r\n\r\n \t// @method overlaps(otherBounds: Bounds): Boolean\r\n \t// Returns `true` if the rectangle overlaps the given bounds. Two bounds\r\n \t// overlap if their intersection is an area.\r\n \toverlaps: function (bounds) { // (Bounds) -> Boolean\r\n \t\tbounds = toBounds(bounds);\r\n\r\n \t\tvar min = this.min,\r\n \t\t max = this.max,\r\n \t\t min2 = bounds.min,\r\n \t\t max2 = bounds.max,\r\n \t\t xOverlaps = (max2.x > min.x) && (min2.x < max.x),\r\n \t\t yOverlaps = (max2.y > min.y) && (min2.y < max.y);\r\n\r\n \t\treturn xOverlaps && yOverlaps;\r\n \t},\r\n\r\n \t// @method isValid(): Boolean\r\n \t// Returns `true` if the bounds are properly initialized.\r\n \tisValid: function () {\r\n \t\treturn !!(this.min && this.max);\r\n \t},\r\n\r\n\r\n \t// @method pad(bufferRatio: Number): Bounds\r\n \t// Returns bounds created by extending or retracting the current bounds by a given ratio in each direction.\r\n \t// For example, a ratio of 0.5 extends the bounds by 50% in each direction.\r\n \t// Negative values will retract the bounds.\r\n \tpad: function (bufferRatio) {\r\n \t\tvar min = this.min,\r\n \t\tmax = this.max,\r\n \t\theightBuffer = Math.abs(min.x - max.x) * bufferRatio,\r\n \t\twidthBuffer = Math.abs(min.y - max.y) * bufferRatio;\r\n\r\n\r\n \t\treturn toBounds(\r\n \t\t\ttoPoint(min.x - heightBuffer, min.y - widthBuffer),\r\n \t\t\ttoPoint(max.x + heightBuffer, max.y + widthBuffer));\r\n \t},\r\n\r\n\r\n \t// @method equals(otherBounds: Bounds): Boolean\r\n \t// Returns `true` if the rectangle is equivalent to the given bounds.\r\n \tequals: function (bounds) {\r\n \t\tif (!bounds) { return false; }\r\n\r\n \t\tbounds = toBounds(bounds);\r\n\r\n \t\treturn this.min.equals(bounds.getTopLeft()) &&\r\n \t\t\tthis.max.equals(bounds.getBottomRight());\r\n \t},\r\n };\r\n\r\n\r\n // @factory L.bounds(corner1: Point, corner2: Point)\r\n // Creates a Bounds object from two corners coordinate pairs.\r\n // @alternative\r\n // @factory L.bounds(points: Point[])\r\n // Creates a Bounds object from the given array of points.\r\n function toBounds(a, b) {\r\n \tif (!a || a instanceof Bounds) {\r\n \t\treturn a;\r\n \t}\r\n \treturn new Bounds(a, b);\r\n }\n\n /*\r\n * @class LatLngBounds\r\n * @aka L.LatLngBounds\r\n *\r\n * Represents a rectangular geographical area on a map.\r\n *\r\n * @example\r\n *\r\n * ```js\r\n * var corner1 = L.latLng(40.712, -74.227),\r\n * corner2 = L.latLng(40.774, -74.125),\r\n * bounds = L.latLngBounds(corner1, corner2);\r\n * ```\r\n *\r\n * All Leaflet methods that accept LatLngBounds objects also accept them in a simple Array form (unless noted otherwise), so the bounds example above can be passed like this:\r\n *\r\n * ```js\r\n * map.fitBounds([\r\n * \t[40.712, -74.227],\r\n * \t[40.774, -74.125]\r\n * ]);\r\n * ```\r\n *\r\n * Caution: if the area crosses the antimeridian (often confused with the International Date Line), you must specify corners _outside_ the [-180, 180] degrees longitude range.\r\n *\r\n * Note that `LatLngBounds` does not inherit from Leaflet's `Class` object,\r\n * which means new classes can't inherit from it, and new methods\r\n * can't be added to it with the `include` function.\r\n */\r\n\r\n function LatLngBounds(corner1, corner2) { // (LatLng, LatLng) or (LatLng[])\r\n \tif (!corner1) { return; }\r\n\r\n \tvar latlngs = corner2 ? [corner1, corner2] : corner1;\r\n\r\n \tfor (var i = 0, len = latlngs.length; i < len; i++) {\r\n \t\tthis.extend(latlngs[i]);\r\n \t}\r\n }\r\n\r\n LatLngBounds.prototype = {\r\n\r\n \t// @method extend(latlng: LatLng): this\r\n \t// Extend the bounds to contain the given point\r\n\r\n \t// @alternative\r\n \t// @method extend(otherBounds: LatLngBounds): this\r\n \t// Extend the bounds to contain the given bounds\r\n \textend: function (obj) {\r\n \t\tvar sw = this._southWest,\r\n \t\t ne = this._northEast,\r\n \t\t sw2, ne2;\r\n\r\n \t\tif (obj instanceof LatLng) {\r\n \t\t\tsw2 = obj;\r\n \t\t\tne2 = obj;\r\n\r\n \t\t} else if (obj instanceof LatLngBounds) {\r\n \t\t\tsw2 = obj._southWest;\r\n \t\t\tne2 = obj._northEast;\r\n\r\n \t\t\tif (!sw2 || !ne2) { return this; }\r\n\r\n \t\t} else {\r\n \t\t\treturn obj ? this.extend(toLatLng(obj) || toLatLngBounds(obj)) : this;\r\n \t\t}\r\n\r\n \t\tif (!sw && !ne) {\r\n \t\t\tthis._southWest = new LatLng(sw2.lat, sw2.lng);\r\n \t\t\tthis._northEast = new LatLng(ne2.lat, ne2.lng);\r\n \t\t} else {\r\n \t\t\tsw.lat = Math.min(sw2.lat, sw.lat);\r\n \t\t\tsw.lng = Math.min(sw2.lng, sw.lng);\r\n \t\t\tne.lat = Math.max(ne2.lat, ne.lat);\r\n \t\t\tne.lng = Math.max(ne2.lng, ne.lng);\r\n \t\t}\r\n\r\n \t\treturn this;\r\n \t},\r\n\r\n \t// @method pad(bufferRatio: Number): LatLngBounds\r\n \t// Returns bounds created by extending or retracting the current bounds by a given ratio in each direction.\r\n \t// For example, a ratio of 0.5 extends the bounds by 50% in each direction.\r\n \t// Negative values will retract the bounds.\r\n \tpad: function (bufferRatio) {\r\n \t\tvar sw = this._southWest,\r\n \t\t ne = this._northEast,\r\n \t\t heightBuffer = Math.abs(sw.lat - ne.lat) * bufferRatio,\r\n \t\t widthBuffer = Math.abs(sw.lng - ne.lng) * bufferRatio;\r\n\r\n \t\treturn new LatLngBounds(\r\n \t\t new LatLng(sw.lat - heightBuffer, sw.lng - widthBuffer),\r\n \t\t new LatLng(ne.lat + heightBuffer, ne.lng + widthBuffer));\r\n \t},\r\n\r\n \t// @method getCenter(): LatLng\r\n \t// Returns the center point of the bounds.\r\n \tgetCenter: function () {\r\n \t\treturn new LatLng(\r\n \t\t (this._southWest.lat + this._northEast.lat) / 2,\r\n \t\t (this._southWest.lng + this._northEast.lng) / 2);\r\n \t},\r\n\r\n \t// @method getSouthWest(): LatLng\r\n \t// Returns the south-west point of the bounds.\r\n \tgetSouthWest: function () {\r\n \t\treturn this._southWest;\r\n \t},\r\n\r\n \t// @method getNorthEast(): LatLng\r\n \t// Returns the north-east point of the bounds.\r\n \tgetNorthEast: function () {\r\n \t\treturn this._northEast;\r\n \t},\r\n\r\n \t// @method getNorthWest(): LatLng\r\n \t// Returns the north-west point of the bounds.\r\n \tgetNorthWest: function () {\r\n \t\treturn new LatLng(this.getNorth(), this.getWest());\r\n \t},\r\n\r\n \t// @method getSouthEast(): LatLng\r\n \t// Returns the south-east point of the bounds.\r\n \tgetSouthEast: function () {\r\n \t\treturn new LatLng(this.getSouth(), this.getEast());\r\n \t},\r\n\r\n \t// @method getWest(): Number\r\n \t// Returns the west longitude of the bounds\r\n \tgetWest: function () {\r\n \t\treturn this._southWest.lng;\r\n \t},\r\n\r\n \t// @method getSouth(): Number\r\n \t// Returns the south latitude of the bounds\r\n \tgetSouth: function () {\r\n \t\treturn this._southWest.lat;\r\n \t},\r\n\r\n \t// @method getEast(): Number\r\n \t// Returns the east longitude of the bounds\r\n \tgetEast: function () {\r\n \t\treturn this._northEast.lng;\r\n \t},\r\n\r\n \t// @method getNorth(): Number\r\n \t// Returns the north latitude of the bounds\r\n \tgetNorth: function () {\r\n \t\treturn this._northEast.lat;\r\n \t},\r\n\r\n \t// @method contains(otherBounds: LatLngBounds): Boolean\r\n \t// Returns `true` if the rectangle contains the given one.\r\n\r\n \t// @alternative\r\n \t// @method contains (latlng: LatLng): Boolean\r\n \t// Returns `true` if the rectangle contains the given point.\r\n \tcontains: function (obj) { // (LatLngBounds) or (LatLng) -> Boolean\r\n \t\tif (typeof obj[0] === 'number' || obj instanceof LatLng || 'lat' in obj) {\r\n \t\t\tobj = toLatLng(obj);\r\n \t\t} else {\r\n \t\t\tobj = toLatLngBounds(obj);\r\n \t\t}\r\n\r\n \t\tvar sw = this._southWest,\r\n \t\t ne = this._northEast,\r\n \t\t sw2, ne2;\r\n\r\n \t\tif (obj instanceof LatLngBounds) {\r\n \t\t\tsw2 = obj.getSouthWest();\r\n \t\t\tne2 = obj.getNorthEast();\r\n \t\t} else {\r\n \t\t\tsw2 = ne2 = obj;\r\n \t\t}\r\n\r\n \t\treturn (sw2.lat >= sw.lat) && (ne2.lat <= ne.lat) &&\r\n \t\t (sw2.lng >= sw.lng) && (ne2.lng <= ne.lng);\r\n \t},\r\n\r\n \t// @method intersects(otherBounds: LatLngBounds): Boolean\r\n \t// Returns `true` if the rectangle intersects the given bounds. Two bounds intersect if they have at least one point in common.\r\n \tintersects: function (bounds) {\r\n \t\tbounds = toLatLngBounds(bounds);\r\n\r\n \t\tvar sw = this._southWest,\r\n \t\t ne = this._northEast,\r\n \t\t sw2 = bounds.getSouthWest(),\r\n \t\t ne2 = bounds.getNorthEast(),\r\n\r\n \t\t latIntersects = (ne2.lat >= sw.lat) && (sw2.lat <= ne.lat),\r\n \t\t lngIntersects = (ne2.lng >= sw.lng) && (sw2.lng <= ne.lng);\r\n\r\n \t\treturn latIntersects && lngIntersects;\r\n \t},\r\n\r\n \t// @method overlaps(otherBounds: LatLngBounds): Boolean\r\n \t// Returns `true` if the rectangle overlaps the given bounds. Two bounds overlap if their intersection is an area.\r\n \toverlaps: function (bounds) {\r\n \t\tbounds = toLatLngBounds(bounds);\r\n\r\n \t\tvar sw = this._southWest,\r\n \t\t ne = this._northEast,\r\n \t\t sw2 = bounds.getSouthWest(),\r\n \t\t ne2 = bounds.getNorthEast(),\r\n\r\n \t\t latOverlaps = (ne2.lat > sw.lat) && (sw2.lat < ne.lat),\r\n \t\t lngOverlaps = (ne2.lng > sw.lng) && (sw2.lng < ne.lng);\r\n\r\n \t\treturn latOverlaps && lngOverlaps;\r\n \t},\r\n\r\n \t// @method toBBoxString(): String\r\n \t// Returns a string with bounding box coordinates in a 'southwest_lng,southwest_lat,northeast_lng,northeast_lat' format. Useful for sending requests to web services that return geo data.\r\n \ttoBBoxString: function () {\r\n \t\treturn [this.getWest(), this.getSouth(), this.getEast(), this.getNorth()].join(',');\r\n \t},\r\n\r\n \t// @method equals(otherBounds: LatLngBounds, maxMargin?: Number): Boolean\r\n \t// Returns `true` if the rectangle is equivalent (within a small margin of error) to the given bounds. The margin of error can be overridden by setting `maxMargin` to a small number.\r\n \tequals: function (bounds, maxMargin) {\r\n \t\tif (!bounds) { return false; }\r\n\r\n \t\tbounds = toLatLngBounds(bounds);\r\n\r\n \t\treturn this._southWest.equals(bounds.getSouthWest(), maxMargin) &&\r\n \t\t this._northEast.equals(bounds.getNorthEast(), maxMargin);\r\n \t},\r\n\r\n \t// @method isValid(): Boolean\r\n \t// Returns `true` if the bounds are properly initialized.\r\n \tisValid: function () {\r\n \t\treturn !!(this._southWest && this._northEast);\r\n \t}\r\n };\r\n\r\n // TODO International date line?\r\n\r\n // @factory L.latLngBounds(corner1: LatLng, corner2: LatLng)\r\n // Creates a `LatLngBounds` object by defining two diagonally opposite corners of the rectangle.\r\n\r\n // @alternative\r\n // @factory L.latLngBounds(latlngs: LatLng[])\r\n // Creates a `LatLngBounds` object defined by the geographical points it contains. Very useful for zooming the map to fit a particular set of locations with [`fitBounds`](#map-fitbounds).\r\n function toLatLngBounds(a, b) {\r\n \tif (a instanceof LatLngBounds) {\r\n \t\treturn a;\r\n \t}\r\n \treturn new LatLngBounds(a, b);\r\n }\n\n /* @class LatLng\r\n * @aka L.LatLng\r\n *\r\n * Represents a geographical point with a certain latitude and longitude.\r\n *\r\n * @example\r\n *\r\n * ```\r\n * var latlng = L.latLng(50.5, 30.5);\r\n * ```\r\n *\r\n * All Leaflet methods that accept LatLng objects also accept them in a simple Array form and simple object form (unless noted otherwise), so these lines are equivalent:\r\n *\r\n * ```\r\n * map.panTo([50, 30]);\r\n * map.panTo({lon: 30, lat: 50});\r\n * map.panTo({lat: 50, lng: 30});\r\n * map.panTo(L.latLng(50, 30));\r\n * ```\r\n *\r\n * Note that `LatLng` does not inherit from Leaflet's `Class` object,\r\n * which means new classes can't inherit from it, and new methods\r\n * can't be added to it with the `include` function.\r\n */\r\n\r\n function LatLng(lat, lng, alt) {\r\n \tif (isNaN(lat) || isNaN(lng)) {\r\n \t\tthrow new Error('Invalid LatLng object: (' + lat + ', ' + lng + ')');\r\n \t}\r\n\r\n \t// @property lat: Number\r\n \t// Latitude in degrees\r\n \tthis.lat = +lat;\r\n\r\n \t// @property lng: Number\r\n \t// Longitude in degrees\r\n \tthis.lng = +lng;\r\n\r\n \t// @property alt: Number\r\n \t// Altitude in meters (optional)\r\n \tif (alt !== undefined) {\r\n \t\tthis.alt = +alt;\r\n \t}\r\n }\r\n\r\n LatLng.prototype = {\r\n \t// @method equals(otherLatLng: LatLng, maxMargin?: Number): Boolean\r\n \t// Returns `true` if the given `LatLng` point is at the same position (within a small margin of error). The margin of error can be overridden by setting `maxMargin` to a small number.\r\n \tequals: function (obj, maxMargin) {\r\n \t\tif (!obj) { return false; }\r\n\r\n \t\tobj = toLatLng(obj);\r\n\r\n \t\tvar margin = Math.max(\r\n \t\t Math.abs(this.lat - obj.lat),\r\n \t\t Math.abs(this.lng - obj.lng));\r\n\r\n \t\treturn margin <= (maxMargin === undefined ? 1.0E-9 : maxMargin);\r\n \t},\r\n\r\n \t// @method toString(): String\r\n \t// Returns a string representation of the point (for debugging purposes).\r\n \ttoString: function (precision) {\r\n \t\treturn 'LatLng(' +\r\n \t\t formatNum(this.lat, precision) + ', ' +\r\n \t\t formatNum(this.lng, precision) + ')';\r\n \t},\r\n\r\n \t// @method distanceTo(otherLatLng: LatLng): Number\r\n \t// Returns the distance (in meters) to the given `LatLng` calculated using the [Spherical Law of Cosines](https://en.wikipedia.org/wiki/Spherical_law_of_cosines).\r\n \tdistanceTo: function (other) {\r\n \t\treturn Earth.distance(this, toLatLng(other));\r\n \t},\r\n\r\n \t// @method wrap(): LatLng\r\n \t// Returns a new `LatLng` object with the longitude wrapped so it's always between -180 and +180 degrees.\r\n \twrap: function () {\r\n \t\treturn Earth.wrapLatLng(this);\r\n \t},\r\n\r\n \t// @method toBounds(sizeInMeters: Number): LatLngBounds\r\n \t// Returns a new `LatLngBounds` object in which each boundary is `sizeInMeters/2` meters apart from the `LatLng`.\r\n \ttoBounds: function (sizeInMeters) {\r\n \t\tvar latAccuracy = 180 * sizeInMeters / 40075017,\r\n \t\t lngAccuracy = latAccuracy / Math.cos((Math.PI / 180) * this.lat);\r\n\r\n \t\treturn toLatLngBounds(\r\n \t\t [this.lat - latAccuracy, this.lng - lngAccuracy],\r\n \t\t [this.lat + latAccuracy, this.lng + lngAccuracy]);\r\n \t},\r\n\r\n \tclone: function () {\r\n \t\treturn new LatLng(this.lat, this.lng, this.alt);\r\n \t}\r\n };\r\n\r\n\r\n\r\n // @factory L.latLng(latitude: Number, longitude: Number, altitude?: Number): LatLng\r\n // Creates an object representing a geographical point with the given latitude and longitude (and optionally altitude).\r\n\r\n // @alternative\r\n // @factory L.latLng(coords: Array): LatLng\r\n // Expects an array of the form `[Number, Number]` or `[Number, Number, Number]` instead.\r\n\r\n // @alternative\r\n // @factory L.latLng(coords: Object): LatLng\r\n // Expects an plain object of the form `{lat: Number, lng: Number}` or `{lat: Number, lng: Number, alt: Number}` instead.\r\n\r\n function toLatLng(a, b, c) {\r\n \tif (a instanceof LatLng) {\r\n \t\treturn a;\r\n \t}\r\n \tif (isArray(a) && typeof a[0] !== 'object') {\r\n \t\tif (a.length === 3) {\r\n \t\t\treturn new LatLng(a[0], a[1], a[2]);\r\n \t\t}\r\n \t\tif (a.length === 2) {\r\n \t\t\treturn new LatLng(a[0], a[1]);\r\n \t\t}\r\n \t\treturn null;\r\n \t}\r\n \tif (a === undefined || a === null) {\r\n \t\treturn a;\r\n \t}\r\n \tif (typeof a === 'object' && 'lat' in a) {\r\n \t\treturn new LatLng(a.lat, 'lng' in a ? a.lng : a.lon, a.alt);\r\n \t}\r\n \tif (b === undefined) {\r\n \t\treturn null;\r\n \t}\r\n \treturn new LatLng(a, b, c);\r\n }\n\n /*\r\n * @namespace CRS\r\n * @crs L.CRS.Base\r\n * Object that defines coordinate reference systems for projecting\r\n * geographical points into pixel (screen) coordinates and back (and to\r\n * coordinates in other units for [WMS](https://en.wikipedia.org/wiki/Web_Map_Service) services). See\r\n * [spatial reference system](https://en.wikipedia.org/wiki/Spatial_reference_system).\r\n *\r\n * Leaflet defines the most usual CRSs by default. If you want to use a\r\n * CRS not defined by default, take a look at the\r\n * [Proj4Leaflet](https://github.com/kartena/Proj4Leaflet) plugin.\r\n *\r\n * Note that the CRS instances do not inherit from Leaflet's `Class` object,\r\n * and can't be instantiated. Also, new classes can't inherit from them,\r\n * and methods can't be added to them with the `include` function.\r\n */\r\n\r\n var CRS = {\r\n \t// @method latLngToPoint(latlng: LatLng, zoom: Number): Point\r\n \t// Projects geographical coordinates into pixel coordinates for a given zoom.\r\n \tlatLngToPoint: function (latlng, zoom) {\r\n \t\tvar projectedPoint = this.projection.project(latlng),\r\n \t\t scale = this.scale(zoom);\r\n\r\n \t\treturn this.transformation._transform(projectedPoint, scale);\r\n \t},\r\n\r\n \t// @method pointToLatLng(point: Point, zoom: Number): LatLng\r\n \t// The inverse of `latLngToPoint`. Projects pixel coordinates on a given\r\n \t// zoom into geographical coordinates.\r\n \tpointToLatLng: function (point, zoom) {\r\n \t\tvar scale = this.scale(zoom),\r\n \t\t untransformedPoint = this.transformation.untransform(point, scale);\r\n\r\n \t\treturn this.projection.unproject(untransformedPoint);\r\n \t},\r\n\r\n \t// @method project(latlng: LatLng): Point\r\n \t// Projects geographical coordinates into coordinates in units accepted for\r\n \t// this CRS (e.g. meters for EPSG:3857, for passing it to WMS services).\r\n \tproject: function (latlng) {\r\n \t\treturn this.projection.project(latlng);\r\n \t},\r\n\r\n \t// @method unproject(point: Point): LatLng\r\n \t// Given a projected coordinate returns the corresponding LatLng.\r\n \t// The inverse of `project`.\r\n \tunproject: function (point) {\r\n \t\treturn this.projection.unproject(point);\r\n \t},\r\n\r\n \t// @method scale(zoom: Number): Number\r\n \t// Returns the scale used when transforming projected coordinates into\r\n \t// pixel coordinates for a particular zoom. For example, it returns\r\n \t// `256 * 2^zoom` for Mercator-based CRS.\r\n \tscale: function (zoom) {\r\n \t\treturn 256 * Math.pow(2, zoom);\r\n \t},\r\n\r\n \t// @method zoom(scale: Number): Number\r\n \t// Inverse of `scale()`, returns the zoom level corresponding to a scale\r\n \t// factor of `scale`.\r\n \tzoom: function (scale) {\r\n \t\treturn Math.log(scale / 256) / Math.LN2;\r\n \t},\r\n\r\n \t// @method getProjectedBounds(zoom: Number): Bounds\r\n \t// Returns the projection's bounds scaled and transformed for the provided `zoom`.\r\n \tgetProjectedBounds: function (zoom) {\r\n \t\tif (this.infinite) { return null; }\r\n\r\n \t\tvar b = this.projection.bounds,\r\n \t\t s = this.scale(zoom),\r\n \t\t min = this.transformation.transform(b.min, s),\r\n \t\t max = this.transformation.transform(b.max, s);\r\n\r\n \t\treturn new Bounds(min, max);\r\n \t},\r\n\r\n \t// @method distance(latlng1: LatLng, latlng2: LatLng): Number\r\n \t// Returns the distance between two geographical coordinates.\r\n\r\n \t// @property code: String\r\n \t// Standard code name of the CRS passed into WMS services (e.g. `'EPSG:3857'`)\r\n \t//\r\n \t// @property wrapLng: Number[]\r\n \t// An array of two numbers defining whether the longitude (horizontal) coordinate\r\n \t// axis wraps around a given range and how. Defaults to `[-180, 180]` in most\r\n \t// geographical CRSs. If `undefined`, the longitude axis does not wrap around.\r\n \t//\r\n \t// @property wrapLat: Number[]\r\n \t// Like `wrapLng`, but for the latitude (vertical) axis.\r\n\r\n \t// wrapLng: [min, max],\r\n \t// wrapLat: [min, max],\r\n\r\n \t// @property infinite: Boolean\r\n \t// If true, the coordinate space will be unbounded (infinite in both axes)\r\n \tinfinite: false,\r\n\r\n \t// @method wrapLatLng(latlng: LatLng): LatLng\r\n \t// Returns a `LatLng` where lat and lng has been wrapped according to the\r\n \t// CRS's `wrapLat` and `wrapLng` properties, if they are outside the CRS's bounds.\r\n \twrapLatLng: function (latlng) {\r\n \t\tvar lng = this.wrapLng ? wrapNum(latlng.lng, this.wrapLng, true) : latlng.lng,\r\n \t\t lat = this.wrapLat ? wrapNum(latlng.lat, this.wrapLat, true) : latlng.lat,\r\n \t\t alt = latlng.alt;\r\n\r\n \t\treturn new LatLng(lat, lng, alt);\r\n \t},\r\n\r\n \t// @method wrapLatLngBounds(bounds: LatLngBounds): LatLngBounds\r\n \t// Returns a `LatLngBounds` with the same size as the given one, ensuring\r\n \t// that its center is within the CRS's bounds.\r\n \t// Only accepts actual `L.LatLngBounds` instances, not arrays.\r\n \twrapLatLngBounds: function (bounds) {\r\n \t\tvar center = bounds.getCenter(),\r\n \t\t newCenter = this.wrapLatLng(center),\r\n \t\t latShift = center.lat - newCenter.lat,\r\n \t\t lngShift = center.lng - newCenter.lng;\r\n\r\n \t\tif (latShift === 0 && lngShift === 0) {\r\n \t\t\treturn bounds;\r\n \t\t}\r\n\r\n \t\tvar sw = bounds.getSouthWest(),\r\n \t\t ne = bounds.getNorthEast(),\r\n \t\t newSw = new LatLng(sw.lat - latShift, sw.lng - lngShift),\r\n \t\t newNe = new LatLng(ne.lat - latShift, ne.lng - lngShift);\r\n\r\n \t\treturn new LatLngBounds(newSw, newNe);\r\n \t}\r\n };\n\n /*\n * @namespace CRS\n * @crs L.CRS.Earth\n *\n * Serves as the base for CRS that are global such that they cover the earth.\n * Can only be used as the base for other CRS and cannot be used directly,\n * since it does not have a `code`, `projection` or `transformation`. `distance()` returns\n * meters.\n */\n\n var Earth = extend({}, CRS, {\n \twrapLng: [-180, 180],\n\n \t// Mean Earth Radius, as recommended for use by\n \t// the International Union of Geodesy and Geophysics,\n \t// see https://rosettacode.org/wiki/Haversine_formula\n \tR: 6371000,\n\n \t// distance between two geographical points using spherical law of cosines approximation\n \tdistance: function (latlng1, latlng2) {\n \t\tvar rad = Math.PI / 180,\n \t\t lat1 = latlng1.lat * rad,\n \t\t lat2 = latlng2.lat * rad,\n \t\t sinDLat = Math.sin((latlng2.lat - latlng1.lat) * rad / 2),\n \t\t sinDLon = Math.sin((latlng2.lng - latlng1.lng) * rad / 2),\n \t\t a = sinDLat * sinDLat + Math.cos(lat1) * Math.cos(lat2) * sinDLon * sinDLon,\n \t\t c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n \t\treturn this.R * c;\n \t}\n });\n\n /*\r\n * @namespace Projection\r\n * @projection L.Projection.SphericalMercator\r\n *\r\n * Spherical Mercator projection — the most common projection for online maps,\r\n * used by almost all free and commercial tile providers. Assumes that Earth is\r\n * a sphere. Used by the `EPSG:3857` CRS.\r\n */\r\n\r\n var earthRadius = 6378137;\r\n\r\n var SphericalMercator = {\r\n\r\n \tR: earthRadius,\r\n \tMAX_LATITUDE: 85.0511287798,\r\n\r\n \tproject: function (latlng) {\r\n \t\tvar d = Math.PI / 180,\r\n \t\t max = this.MAX_LATITUDE,\r\n \t\t lat = Math.max(Math.min(max, latlng.lat), -max),\r\n \t\t sin = Math.sin(lat * d);\r\n\r\n \t\treturn new Point(\r\n \t\t\tthis.R * latlng.lng * d,\r\n \t\t\tthis.R * Math.log((1 + sin) / (1 - sin)) / 2);\r\n \t},\r\n\r\n \tunproject: function (point) {\r\n \t\tvar d = 180 / Math.PI;\r\n\r\n \t\treturn new LatLng(\r\n \t\t\t(2 * Math.atan(Math.exp(point.y / this.R)) - (Math.PI / 2)) * d,\r\n \t\t\tpoint.x * d / this.R);\r\n \t},\r\n\r\n \tbounds: (function () {\r\n \t\tvar d = earthRadius * Math.PI;\r\n \t\treturn new Bounds([-d, -d], [d, d]);\r\n \t})()\r\n };\n\n /*\r\n * @class Transformation\r\n * @aka L.Transformation\r\n *\r\n * Represents an affine transformation: a set of coefficients `a`, `b`, `c`, `d`\r\n * for transforming a point of a form `(x, y)` into `(a*x + b, c*y + d)` and doing\r\n * the reverse. Used by Leaflet in its projections code.\r\n *\r\n * @example\r\n *\r\n * ```js\r\n * var transformation = L.transformation(2, 5, -1, 10),\r\n * \tp = L.point(1, 2),\r\n * \tp2 = transformation.transform(p), // L.point(7, 8)\r\n * \tp3 = transformation.untransform(p2); // L.point(1, 2)\r\n * ```\r\n */\r\n\r\n\r\n // factory new L.Transformation(a: Number, b: Number, c: Number, d: Number)\r\n // Creates a `Transformation` object with the given coefficients.\r\n function Transformation(a, b, c, d) {\r\n \tif (isArray(a)) {\r\n \t\t// use array properties\r\n \t\tthis._a = a[0];\r\n \t\tthis._b = a[1];\r\n \t\tthis._c = a[2];\r\n \t\tthis._d = a[3];\r\n \t\treturn;\r\n \t}\r\n \tthis._a = a;\r\n \tthis._b = b;\r\n \tthis._c = c;\r\n \tthis._d = d;\r\n }\r\n\r\n Transformation.prototype = {\r\n \t// @method transform(point: Point, scale?: Number): Point\r\n \t// Returns a transformed point, optionally multiplied by the given scale.\r\n \t// Only accepts actual `L.Point` instances, not arrays.\r\n \ttransform: function (point, scale) { // (Point, Number) -> Point\r\n \t\treturn this._transform(point.clone(), scale);\r\n \t},\r\n\r\n \t// destructive transform (faster)\r\n \t_transform: function (point, scale) {\r\n \t\tscale = scale || 1;\r\n \t\tpoint.x = scale * (this._a * point.x + this._b);\r\n \t\tpoint.y = scale * (this._c * point.y + this._d);\r\n \t\treturn point;\r\n \t},\r\n\r\n \t// @method untransform(point: Point, scale?: Number): Point\r\n \t// Returns the reverse transformation of the given point, optionally divided\r\n \t// by the given scale. Only accepts actual `L.Point` instances, not arrays.\r\n \tuntransform: function (point, scale) {\r\n \t\tscale = scale || 1;\r\n \t\treturn new Point(\r\n \t\t (point.x / scale - this._b) / this._a,\r\n \t\t (point.y / scale - this._d) / this._c);\r\n \t}\r\n };\r\n\r\n // factory L.transformation(a: Number, b: Number, c: Number, d: Number)\r\n\r\n // @factory L.transformation(a: Number, b: Number, c: Number, d: Number)\r\n // Instantiates a Transformation object with the given coefficients.\r\n\r\n // @alternative\r\n // @factory L.transformation(coefficients: Array): Transformation\r\n // Expects an coefficients array of the form\r\n // `[a: Number, b: Number, c: Number, d: Number]`.\r\n\r\n function toTransformation(a, b, c, d) {\r\n \treturn new Transformation(a, b, c, d);\r\n }\n\n /*\r\n * @namespace CRS\r\n * @crs L.CRS.EPSG3857\r\n *\r\n * The most common CRS for online maps, used by almost all free and commercial\r\n * tile providers. Uses Spherical Mercator projection. Set in by default in\r\n * Map's `crs` option.\r\n */\r\n\r\n var EPSG3857 = extend({}, Earth, {\r\n \tcode: 'EPSG:3857',\r\n \tprojection: SphericalMercator,\r\n\r\n \ttransformation: (function () {\r\n \t\tvar scale = 0.5 / (Math.PI * SphericalMercator.R);\r\n \t\treturn toTransformation(scale, 0.5, -scale, 0.5);\r\n \t}())\r\n });\r\n\r\n var EPSG900913 = extend({}, EPSG3857, {\r\n \tcode: 'EPSG:900913'\r\n });\n\n // @namespace SVG; @section\n // There are several static functions which can be called without instantiating L.SVG:\n\n // @function create(name: String): SVGElement\n // Returns a instance of [SVGElement](https://developer.mozilla.org/docs/Web/API/SVGElement),\n // corresponding to the class name passed. For example, using 'line' will return\n // an instance of [SVGLineElement](https://developer.mozilla.org/docs/Web/API/SVGLineElement).\n function svgCreate(name) {\n \treturn document.createElementNS('http://www.w3.org/2000/svg', name);\n }\n\n // @function pointsToPath(rings: Point[], closed: Boolean): String\n // Generates a SVG path string for multiple rings, with each ring turning\n // into \"M..L..L..\" instructions\n function pointsToPath(rings, closed) {\n \tvar str = '',\n \ti, j, len, len2, points, p;\n\n \tfor (i = 0, len = rings.length; i < len; i++) {\n \t\tpoints = rings[i];\n\n \t\tfor (j = 0, len2 = points.length; j < len2; j++) {\n \t\t\tp = points[j];\n \t\t\tstr += (j ? 'L' : 'M') + p.x + ' ' + p.y;\n \t\t}\n\n \t\t// closes the ring for polygons; \"x\" is VML syntax\n \t\tstr += closed ? (Browser.svg ? 'z' : 'x') : '';\n \t}\n\n \t// SVG complains about empty path strings\n \treturn str || 'M0 0';\n }\n\n /*\r\n * @namespace Browser\r\n * @aka L.Browser\r\n *\r\n * A namespace with static properties for browser/feature detection used by Leaflet internally.\r\n *\r\n * @example\r\n *\r\n * ```js\r\n * if (L.Browser.ielt9) {\r\n * alert('Upgrade your browser, dude!');\r\n * }\r\n * ```\r\n */\r\n\r\n var style = document.documentElement.style;\r\n\r\n // @property ie: Boolean; `true` for all Internet Explorer versions (not Edge).\r\n var ie = 'ActiveXObject' in window;\r\n\r\n // @property ielt9: Boolean; `true` for Internet Explorer versions less than 9.\r\n var ielt9 = ie && !document.addEventListener;\r\n\r\n // @property edge: Boolean; `true` for the Edge web browser.\r\n var edge = 'msLaunchUri' in navigator && !('documentMode' in document);\r\n\r\n // @property webkit: Boolean;\r\n // `true` for webkit-based browsers like Chrome and Safari (including mobile versions).\r\n var webkit = userAgentContains('webkit');\r\n\r\n // @property android: Boolean\r\n // **Deprecated.** `true` for any browser running on an Android platform.\r\n var android = userAgentContains('android');\r\n\r\n // @property android23: Boolean; **Deprecated.** `true` for browsers running on Android 2 or Android 3.\r\n var android23 = userAgentContains('android 2') || userAgentContains('android 3');\r\n\r\n /* See https://stackoverflow.com/a/17961266 for details on detecting stock Android */\r\n var webkitVer = parseInt(/WebKit\\/([0-9]+)|$/.exec(navigator.userAgent)[1], 10); // also matches AppleWebKit\r\n // @property androidStock: Boolean; **Deprecated.** `true` for the Android stock browser (i.e. not Chrome)\r\n var androidStock = android && userAgentContains('Google') && webkitVer < 537 && !('AudioNode' in window);\r\n\r\n // @property opera: Boolean; `true` for the Opera browser\r\n var opera = !!window.opera;\r\n\r\n // @property chrome: Boolean; `true` for the Chrome browser.\r\n var chrome = !edge && userAgentContains('chrome');\r\n\r\n // @property gecko: Boolean; `true` for gecko-based browsers like Firefox.\r\n var gecko = userAgentContains('gecko') && !webkit && !opera && !ie;\r\n\r\n // @property safari: Boolean; `true` for the Safari browser.\r\n var safari = !chrome && userAgentContains('safari');\r\n\r\n var phantom = userAgentContains('phantom');\r\n\r\n // @property opera12: Boolean\r\n // `true` for the Opera browser supporting CSS transforms (version 12 or later).\r\n var opera12 = 'OTransition' in style;\r\n\r\n // @property win: Boolean; `true` when the browser is running in a Windows platform\r\n var win = navigator.platform.indexOf('Win') === 0;\r\n\r\n // @property ie3d: Boolean; `true` for all Internet Explorer versions supporting CSS transforms.\r\n var ie3d = ie && ('transition' in style);\r\n\r\n // @property webkit3d: Boolean; `true` for webkit-based browsers supporting CSS transforms.\r\n var webkit3d = ('WebKitCSSMatrix' in window) && ('m11' in new window.WebKitCSSMatrix()) && !android23;\r\n\r\n // @property gecko3d: Boolean; `true` for gecko-based browsers supporting CSS transforms.\r\n var gecko3d = 'MozPerspective' in style;\r\n\r\n // @property any3d: Boolean\r\n // `true` for all browsers supporting CSS transforms.\r\n var any3d = !window.L_DISABLE_3D && (ie3d || webkit3d || gecko3d) && !opera12 && !phantom;\r\n\r\n // @property mobile: Boolean; `true` for all browsers running in a mobile device.\r\n var mobile = typeof orientation !== 'undefined' || userAgentContains('mobile');\r\n\r\n // @property mobileWebkit: Boolean; `true` for all webkit-based browsers in a mobile device.\r\n var mobileWebkit = mobile && webkit;\r\n\r\n // @property mobileWebkit3d: Boolean\r\n // `true` for all webkit-based browsers in a mobile device supporting CSS transforms.\r\n var mobileWebkit3d = mobile && webkit3d;\r\n\r\n // @property msPointer: Boolean\r\n // `true` for browsers implementing the Microsoft touch events model (notably IE10).\r\n var msPointer = !window.PointerEvent && window.MSPointerEvent;\r\n\r\n // @property pointer: Boolean\r\n // `true` for all browsers supporting [pointer events](https://msdn.microsoft.com/en-us/library/dn433244%28v=vs.85%29.aspx).\r\n var pointer = !!(window.PointerEvent || msPointer);\r\n\r\n // @property touchNative: Boolean\r\n // `true` for all browsers supporting [touch events](https://developer.mozilla.org/docs/Web/API/Touch_events).\r\n // **This does not necessarily mean** that the browser is running in a computer with\r\n // a touchscreen, it only means that the browser is capable of understanding\r\n // touch events.\r\n var touchNative = 'ontouchstart' in window || !!window.TouchEvent;\r\n\r\n // @property touch: Boolean\r\n // `true` for all browsers supporting either [touch](#browser-touch) or [pointer](#browser-pointer) events.\r\n // Note: pointer events will be preferred (if available), and processed for all `touch*` listeners.\r\n var touch = !window.L_NO_TOUCH && (touchNative || pointer);\r\n\r\n // @property mobileOpera: Boolean; `true` for the Opera browser in a mobile device.\r\n var mobileOpera = mobile && opera;\r\n\r\n // @property mobileGecko: Boolean\r\n // `true` for gecko-based browsers running in a mobile device.\r\n var mobileGecko = mobile && gecko;\r\n\r\n // @property retina: Boolean\r\n // `true` for browsers on a high-resolution \"retina\" screen or on any screen when browser's display zoom is more than 100%.\r\n var retina = (window.devicePixelRatio || (window.screen.deviceXDPI / window.screen.logicalXDPI)) > 1;\r\n\r\n // @property passiveEvents: Boolean\r\n // `true` for browsers that support passive events.\r\n var passiveEvents = (function () {\r\n \tvar supportsPassiveOption = false;\r\n \ttry {\r\n \t\tvar opts = Object.defineProperty({}, 'passive', {\r\n \t\t\tget: function () { // eslint-disable-line getter-return\r\n \t\t\t\tsupportsPassiveOption = true;\r\n \t\t\t}\r\n \t\t});\r\n \t\twindow.addEventListener('testPassiveEventSupport', falseFn, opts);\r\n \t\twindow.removeEventListener('testPassiveEventSupport', falseFn, opts);\r\n \t} catch (e) {\r\n \t\t// Errors can safely be ignored since this is only a browser support test.\r\n \t}\r\n \treturn supportsPassiveOption;\r\n }());\r\n\r\n // @property canvas: Boolean\r\n // `true` when the browser supports [``](https://developer.mozilla.org/docs/Web/API/Canvas_API).\r\n var canvas$1 = (function () {\r\n \treturn !!document.createElement('canvas').getContext;\r\n }());\r\n\r\n // @property svg: Boolean\r\n // `true` when the browser supports [SVG](https://developer.mozilla.org/docs/Web/SVG).\r\n var svg$1 = !!(document.createElementNS && svgCreate('svg').createSVGRect);\r\n\r\n var inlineSvg = !!svg$1 && (function () {\r\n \tvar div = document.createElement('div');\r\n \tdiv.innerHTML = '';\r\n \treturn (div.firstChild && div.firstChild.namespaceURI) === 'http://www.w3.org/2000/svg';\r\n })();\r\n\r\n // @property vml: Boolean\r\n // `true` if the browser supports [VML](https://en.wikipedia.org/wiki/Vector_Markup_Language).\r\n var vml = !svg$1 && (function () {\r\n \ttry {\r\n \t\tvar div = document.createElement('div');\r\n \t\tdiv.innerHTML = '';\r\n\r\n \t\tvar shape = div.firstChild;\r\n \t\tshape.style.behavior = 'url(#default#VML)';\r\n\r\n \t\treturn shape && (typeof shape.adj === 'object');\r\n\r\n \t} catch (e) {\r\n \t\treturn false;\r\n \t}\r\n }());\r\n\r\n\r\n // @property mac: Boolean; `true` when the browser is running in a Mac platform\r\n var mac = navigator.platform.indexOf('Mac') === 0;\r\n\r\n // @property mac: Boolean; `true` when the browser is running in a Linux platform\r\n var linux = navigator.platform.indexOf('Linux') === 0;\r\n\r\n function userAgentContains(str) {\r\n \treturn navigator.userAgent.toLowerCase().indexOf(str) >= 0;\r\n }\r\n\r\n\r\n var Browser = {\r\n \tie: ie,\r\n \tielt9: ielt9,\r\n \tedge: edge,\r\n \twebkit: webkit,\r\n \tandroid: android,\r\n \tandroid23: android23,\r\n \tandroidStock: androidStock,\r\n \topera: opera,\r\n \tchrome: chrome,\r\n \tgecko: gecko,\r\n \tsafari: safari,\r\n \tphantom: phantom,\r\n \topera12: opera12,\r\n \twin: win,\r\n \tie3d: ie3d,\r\n \twebkit3d: webkit3d,\r\n \tgecko3d: gecko3d,\r\n \tany3d: any3d,\r\n \tmobile: mobile,\r\n \tmobileWebkit: mobileWebkit,\r\n \tmobileWebkit3d: mobileWebkit3d,\r\n \tmsPointer: msPointer,\r\n \tpointer: pointer,\r\n \ttouch: touch,\r\n \ttouchNative: touchNative,\r\n \tmobileOpera: mobileOpera,\r\n \tmobileGecko: mobileGecko,\r\n \tretina: retina,\r\n \tpassiveEvents: passiveEvents,\r\n \tcanvas: canvas$1,\r\n \tsvg: svg$1,\r\n \tvml: vml,\r\n \tinlineSvg: inlineSvg,\r\n \tmac: mac,\r\n \tlinux: linux\r\n };\n\n /*\n * Extends L.DomEvent to provide touch support for Internet Explorer and Windows-based devices.\n */\n\n var POINTER_DOWN = Browser.msPointer ? 'MSPointerDown' : 'pointerdown';\n var POINTER_MOVE = Browser.msPointer ? 'MSPointerMove' : 'pointermove';\n var POINTER_UP = Browser.msPointer ? 'MSPointerUp' : 'pointerup';\n var POINTER_CANCEL = Browser.msPointer ? 'MSPointerCancel' : 'pointercancel';\n var pEvent = {\n \ttouchstart : POINTER_DOWN,\n \ttouchmove : POINTER_MOVE,\n \ttouchend : POINTER_UP,\n \ttouchcancel : POINTER_CANCEL\n };\n var handle = {\n \ttouchstart : _onPointerStart,\n \ttouchmove : _handlePointer,\n \ttouchend : _handlePointer,\n \ttouchcancel : _handlePointer\n };\n var _pointers = {};\n var _pointerDocListener = false;\n\n // Provides a touch events wrapper for (ms)pointer events.\n // ref https://www.w3.org/TR/pointerevents/ https://www.w3.org/Bugs/Public/show_bug.cgi?id=22890\n\n function addPointerListener(obj, type, handler) {\n \tif (type === 'touchstart') {\n \t\t_addPointerDocListener();\n \t}\n \tif (!handle[type]) {\n \t\tconsole.warn('wrong event specified:', type);\n \t\treturn falseFn;\n \t}\n \thandler = handle[type].bind(this, handler);\n \tobj.addEventListener(pEvent[type], handler, false);\n \treturn handler;\n }\n\n function removePointerListener(obj, type, handler) {\n \tif (!pEvent[type]) {\n \t\tconsole.warn('wrong event specified:', type);\n \t\treturn;\n \t}\n \tobj.removeEventListener(pEvent[type], handler, false);\n }\n\n function _globalPointerDown(e) {\n \t_pointers[e.pointerId] = e;\n }\n\n function _globalPointerMove(e) {\n \tif (_pointers[e.pointerId]) {\n \t\t_pointers[e.pointerId] = e;\n \t}\n }\n\n function _globalPointerUp(e) {\n \tdelete _pointers[e.pointerId];\n }\n\n function _addPointerDocListener() {\n \t// need to keep track of what pointers and how many are active to provide e.touches emulation\n \tif (!_pointerDocListener) {\n \t\t// we listen document as any drags that end by moving the touch off the screen get fired there\n \t\tdocument.addEventListener(POINTER_DOWN, _globalPointerDown, true);\n \t\tdocument.addEventListener(POINTER_MOVE, _globalPointerMove, true);\n \t\tdocument.addEventListener(POINTER_UP, _globalPointerUp, true);\n \t\tdocument.addEventListener(POINTER_CANCEL, _globalPointerUp, true);\n\n \t\t_pointerDocListener = true;\n \t}\n }\n\n function _handlePointer(handler, e) {\n \tif (e.pointerType === (e.MSPOINTER_TYPE_MOUSE || 'mouse')) { return; }\n\n \te.touches = [];\n \tfor (var i in _pointers) {\n \t\te.touches.push(_pointers[i]);\n \t}\n \te.changedTouches = [e];\n\n \thandler(e);\n }\n\n function _onPointerStart(handler, e) {\n \t// IE10 specific: MsTouch needs preventDefault. See #2000\n \tif (e.MSPOINTER_TYPE_TOUCH && e.pointerType === e.MSPOINTER_TYPE_TOUCH) {\n \t\tpreventDefault(e);\n \t}\n \t_handlePointer(handler, e);\n }\n\n /*\r\n * Extends the event handling code with double tap support for mobile browsers.\r\n *\r\n * Note: currently most browsers fire native dblclick, with only a few exceptions\r\n * (see https://github.com/Leaflet/Leaflet/issues/7012#issuecomment-595087386)\r\n */\r\n\r\n function makeDblclick(event) {\r\n \t// in modern browsers `type` cannot be just overridden:\r\n \t// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Getter_only\r\n \tvar newEvent = {},\r\n \t prop, i;\r\n \tfor (i in event) {\r\n \t\tprop = event[i];\r\n \t\tnewEvent[i] = prop && prop.bind ? prop.bind(event) : prop;\r\n \t}\r\n \tevent = newEvent;\r\n \tnewEvent.type = 'dblclick';\r\n \tnewEvent.detail = 2;\r\n \tnewEvent.isTrusted = false;\r\n \tnewEvent._simulated = true; // for debug purposes\r\n \treturn newEvent;\r\n }\r\n\r\n var delay = 200;\r\n function addDoubleTapListener(obj, handler) {\r\n \t// Most browsers handle double tap natively\r\n \tobj.addEventListener('dblclick', handler);\r\n\r\n \t// On some platforms the browser doesn't fire native dblclicks for touch events.\r\n \t// It seems that in all such cases `detail` property of `click` event is always `1`.\r\n \t// So here we rely on that fact to avoid excessive 'dblclick' simulation when not needed.\r\n \tvar last = 0,\r\n \t detail;\r\n \tfunction simDblclick(e) {\r\n \t\tif (e.detail !== 1) {\r\n \t\t\tdetail = e.detail; // keep in sync to avoid false dblclick in some cases\r\n \t\t\treturn;\r\n \t\t}\r\n\r\n \t\tif (e.pointerType === 'mouse' ||\r\n \t\t\t(e.sourceCapabilities && !e.sourceCapabilities.firesTouchEvents)) {\r\n\r\n \t\t\treturn;\r\n \t\t}\r\n\r\n \t\t// When clicking on an , the browser generates a click on its\r\n \t\t//