WGDashboard/src/static/app/dist/assets/peerList-DZR5bxxl.js
Donald Zou eba5be010a Update
2024-12-18 17:45:22 +08:00

26 lines
228 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/deleteConfiguration-gjCTyT4T.js","assets/index-C7RZshvj.js","assets/index-Bj4AOr1K.css","assets/localeText-CtboAReP.js","assets/configurationBackupRestore-Dea4yoLF.js","assets/dayjs.min-Bc9ZgdwU.js","assets/configurationBackupRestore-BeBqyCqt.css","assets/selectPeers-C_VG2AGk.js","assets/selectPeers-Wjnh8YUZ.css","assets/editConfiguration-BbKPgegf.js","assets/editConfiguration-Oqrarw_V.css","assets/peerShareLinkModal-D23qHCPl.js","assets/vue-datepicker-QX0NLR-4.js","assets/peerJobsLogsModal-PbWxka5-.js","assets/peerJobsAllModal-roMAeqgA.js","assets/schedulePeerJob-DKrIJ91n.js","assets/schedulePeerJob--V7cpve7.css","assets/peerJobs-Cv4hhfes.js","assets/peerJobs-voXURBEt.css","assets/peerCreate-Cz6pOdlA.js","assets/peerCreate-BpTNoL68.css","assets/peerQRCode-7CQhcymP.js","assets/browser-CjSdxGTc.js","assets/peerConfigurationFile-UmU9dUY-.js","assets/peerConfigurationFile-CNB9RKjb.css","assets/peerSettings-CTAPAYhI.js","assets/peerSettings-DCod994Y.css"])))=>i.map(i=>d[i]);
import{_ as Dt,D as hi,W as Vi,G as bt,z as ie,g as oe,a as M,c as R,b as g,d as C,t as F,F as Xt,h as ii,e as B,j as $,J as Ko,K as Xo,A as Rn,H as An,r as st,n as ht,w as X,T as q,f as pt,i as N,L as In,M as En,N as Ci,O as Go,o as ji,P as Jo,Q as Di,R as qo,U as Fn,p as Bn,V as zn,m as Ui,x as Qo,X as Zo,q as Ot,C as tr,Y as er,Z as ir,$ as sr,s as nr,a0 as rt,v as or,k as rr,a1 as at}from"./index-C7RZshvj.js";import{L as ft}from"./localeText-CtboAReP.js";import{d as cs}from"./dayjs.min-Bc9ZgdwU.js";import{_ as ar}from"./protocolBadge-tjyiv7K1.js";const lr={name:"peerSearch",components:{LocaleText:ft},setup(){const i=hi(),t=Vi();return{store:i,wireguardConfigurationStore:t}},props:{configuration:Object},data(){return{sort:{status:bt("Status"),name:bt("Name"),allowed_ip:bt("Allowed IPs"),restricted:bt("Restricted")},interval:{5e3:bt("5 Seconds"),1e4:bt("10 Seconds"),3e4:bt("30 Seconds"),6e4:bt("1 Minutes")},searchString:"",searchStringTimeout:void 0,showDisplaySettings:!1,showMoreSettings:!1}},methods:{debounce(){this.searchStringTimeout?(clearTimeout(this.searchStringTimeout),this.searchStringTimeout=setTimeout(()=>{this.wireguardConfigurationStore.searchString=this.searchString},300)):this.searchStringTimeout=setTimeout(()=>{this.wireguardConfigurationStore.searchString=this.searchString},300)},updateSort(i){ie("/api/updateDashboardConfigurationItem",{section:"Server",key:"dashboard_sort",value:i},t=>{t.status&&this.store.getConfiguration()})},updateRefreshInterval(i){ie("/api/updateDashboardConfigurationItem",{section:"Server",key:"dashboard_refresh_interval",value:i},t=>{t.status&&this.store.getConfiguration()})},downloadAllPeer(){oe(`/api/downloadAllPeers/${this.configuration.Name}`,{},i=>{console.log(i),window.wireguard.generateZipFiles(i,this.configuration.Name)})}},computed:{searchBarPlaceholder(){return bt("Search Peers...")}}},cr={class:"d-flex flex-column gap-2 my-4"},hr={class:"d-flex gap-2 peerSearchContainer"},dr={class:"dropdown"},ur={"data-bs-toggle":"dropdown",class:"btn w-100 btn-sm text-primary-emphasis bg-primary-subtle rounded-3 border-1 border-primary-subtle position-relative"},fr={class:"badge text-bg-primary ms-2"},gr={class:"dropdown-menu rounded-3"},pr=["onClick"],mr={class:"ms-auto"},br={key:0,class:"bi bi-check-circle-fill"},_r={class:"dropdown"},xr={"data-bs-toggle":"dropdown",class:"btn btn-sm w-100 text-primary-emphasis bg-primary-subtle rounded-3 border-1 border-primary-subtle position-relative"},yr={class:"badge text-bg-primary ms-2"},vr={class:"dropdown-menu rounded-3"},Sr=["onClick"],wr={class:"ms-auto"},kr={key:0,class:"bi bi-check-circle-fill"};function Pr(i,t,e,s,n,o){const r=$("LocaleText");return M(),R("div",cr,[g("div",hr,[g("div",dr,[g("button",ur,[t[4]||(t[4]=g("i",{class:"bi bi-sort-up me-2"},null,-1)),C(r,{t:"Sort By"}),g("span",fr,F(this.sort[s.store.Configuration.Server.dashboard_sort]),1)]),g("ul",gr,[(M(!0),R(Xt,null,ii(this.sort,(a,l)=>(M(),R("li",null,[g("button",{class:"dropdown-item d-flex align-items-center",onClick:c=>this.updateSort(l)},[g("small",null,F(a),1),g("small",mr,[s.store.Configuration.Server.dashboard_sort===l?(M(),R("i",br)):B("",!0)])],8,pr)]))),256))])]),g("div",_r,[g("button",xr,[t[5]||(t[5]=g("i",{class:"bi bi-arrow-repeat me-2"},null,-1)),C(r,{t:"Refresh Interval"}),g("span",yr,F(this.interval[s.store.Configuration.Server.dashboard_refresh_interval]),1)]),g("ul",vr,[(M(!0),R(Xt,null,ii(this.interval,(a,l)=>(M(),R("li",null,[g("button",{class:"dropdown-item d-flex align-items-center",onClick:c=>this.updateRefreshInterval(l)},[g("small",null,F(a),1),g("small",wr,[s.store.Configuration.Server.dashboard_refresh_interval===l?(M(),R("i",kr)):B("",!0)])],8,Sr)]))),256))])]),g("button",{class:"btn btn-sm text-primary-emphasis bg-primary-subtle rounded-3 border-1 border-primary-subtle ms-lg-auto",onClick:t[0]||(t[0]=a=>this.$emit("search"))},[t[6]||(t[6]=g("i",{class:"bi bi-search me-2"},null,-1)),C(r,{t:"Search"})]),g("button",{class:"btn btn-sm text-primary-emphasis bg-primary-subtle rounded-3 border-1 border-primary-subtle",onClick:t[1]||(t[1]=a=>this.downloadAllPeer())},[t[7]||(t[7]=g("i",{class:"bi bi-download me-2 me-lg-0 me-xl-2"},null,-1)),C(r,{t:"Download All",class:"d-sm-block d-lg-none d-xl-block"})]),g("button",{class:"btn btn-sm text-primary-emphasis bg-primary-subtle rounded-3 border-1 border-primary-subtle",onClick:t[2]||(t[2]=a=>this.$emit("selectPeers"))},[t[8]||(t[8]=g("i",{class:"bi bi-check2-all me-2 me-lg-0 me-xl-2"},null,-1)),C(r,{t:"Select Peers",class:"d-sm-block d-lg-none d-xl-block"})]),g("button",{class:"btn btn-sm text-primary-emphasis bg-primary-subtle rounded-3 border-1 border-primary-subtle",onClick:t[3]||(t[3]=a=>this.$emit("jobsAll")),type:"button","aria-expanded":"false"},[t[9]||(t[9]=g("i",{class:"bi bi-person-walking me-2 me-lg-0 me-xl-2"},null,-1)),C(r,{t:"Active Jobs",class:"d-sm-block d-lg-none d-xl-block"})])])])}const Mr=Dt(lr,[["render",Pr],["__scopeId","data-v-2c7d446a"]]);function Cr(i){return Ko()?(Xo(i),!0):!1}function $n(i){return typeof i=="function"?i():Rn(i)}const Nn=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Dr=Object.prototype.toString,Or=i=>Dr.call(i)==="[object Object]",Ze=()=>{},Tr=Lr();function Lr(){var i,t;return Nn&&((i=window?.navigator)==null?void 0:i.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((t=window?.navigator)==null?void 0:t.maxTouchPoints)>2&&/iPad|Macintosh/.test(window?.navigator.userAgent))}function _e(i){var t;const e=$n(i);return(t=e?.$el)!=null?t:e}const Hn=Nn?window:void 0;function gi(...i){let t,e,s,n;if(typeof i[0]=="string"||Array.isArray(i[0])?([e,s,n]=i,t=Hn):[t,e,s,n]=i,!t)return Ze;Array.isArray(e)||(e=[e]),Array.isArray(s)||(s=[s]);const o=[],r=()=>{o.forEach(h=>h()),o.length=0},a=(h,d,u,f)=>(h.addEventListener(d,u,f),()=>h.removeEventListener(d,u,f)),l=An(()=>[_e(t),$n(n)],([h,d])=>{if(r(),!h)return;const u=Or(d)?{...d}:d;o.push(...e.flatMap(f=>s.map(p=>a(h,f,p,u))))},{immediate:!0,flush:"post"}),c=()=>{l(),r()};return Cr(c),c}let hs=!1;function Wn(i,t,e={}){const{window:s=Hn,ignore:n=[],capture:o=!0,detectIframe:r=!1}=e;if(!s)return Ze;Tr&&!hs&&(hs=!0,Array.from(s.document.body.children).forEach(u=>u.addEventListener("click",Ze)),s.document.documentElement.addEventListener("click",Ze));let a=!0;const l=u=>n.some(f=>{if(typeof f=="string")return Array.from(s.document.querySelectorAll(f)).some(p=>p===u.target||u.composedPath().includes(p));{const p=_e(f);return p&&(u.target===p||u.composedPath().includes(p))}}),h=[gi(s,"click",u=>{const f=_e(i);if(!(!f||f===u.target||u.composedPath().includes(f))){if(u.detail===0&&(a=!l(u)),!a){a=!0;return}t(u)}},{passive:!0,capture:o}),gi(s,"pointerdown",u=>{const f=_e(i);a=!l(u)&&!!(f&&!u.composedPath().includes(f))},{passive:!0}),r&&gi(s,"blur",u=>{setTimeout(()=>{var f;const p=_e(i);((f=s.document.activeElement)==null?void 0:f.tagName)==="IFRAME"&&!p?.contains(s.document.activeElement)&&t(u)},0)})].filter(Boolean);return()=>h.forEach(u=>u())}const Rr={key:0,class:"position-absolute d-block p-1 px-2 bg-body text-body rounded-3 border shadow"},Ar={__name:"peerSettingsDropdownTool",props:{icon:String,title:String},emits:["click"],setup(i,{emit:t}){const e=t,s=st(!1);return(n,o)=>(M(),R("a",{class:"dropdown-item text-center px-0 rounded-3 position-relative",role:"button",onMouseenter:o[0]||(o[0]=r=>s.value=!0),onMouseleave:o[1]||(o[1]=r=>s.value=!1),onClick:o[2]||(o[2]=r=>e("click"))},[g("i",{class:ht(["me-auto bi",i.icon])},null,2),C(q,{name:"zoomReversed"},{default:X(()=>[s.value?(M(),R("span",Rr,[g("small",null,F(i.title),1)])):B("",!0)]),_:1})],32))}},Ir=Dt(Ar,[["__scopeId","data-v-2d66aeb6"]]),Er={name:"peerSettingsDropdown",components:{PeerSettingsDropdownTool:Ir,LocaleText:ft},setup(){return{dashboardStore:hi()}},props:{Peer:Object},data(){return{deleteBtnDisabled:!1,restrictBtnDisabled:!1,allowAccessBtnDisabled:!1,confirmDelete:!1}},methods:{downloadPeer(){oe("/api/downloadPeer/"+this.$route.params.id,{id:this.Peer.id},i=>{if(i.status){const t=new Blob([i.data.file],{type:"text/plain"}),e=URL.createObjectURL(t),s=`${i.data.fileName}.conf`,n=document.createElement("a");n.href=e,n.download=s,n.click(),this.dashboardStore.newMessage("WGDashboard","Peer download started","success")}else this.dashboardStore.newMessage("Server",i.message,"danger")})},downloadQRCode(i){oe("/api/downloadPeer/"+this.$route.params.id,{id:this.Peer.id},t=>{t.status?this.$emit(i,t.data.file):this.dashboardStore.newMessage("Server",t.message,"danger")})},deletePeer(){this.deleteBtnDisabled=!0,ie(`/api/deletePeers/${this.$route.params.id}`,{peers:[this.Peer.id]},i=>{this.dashboardStore.newMessage("Server",i.message,i.status?"success":"danger"),this.$emit("refresh"),this.deleteBtnDisabled=!1})},restrictPeer(){this.restrictBtnDisabled=!0,ie(`/api/restrictPeers/${this.$route.params.id}`,{peers:[this.Peer.id]},i=>{this.dashboardStore.newMessage("Server",i.message,i.status?"success":"danger"),this.$emit("refresh"),this.restrictBtnDisabled=!1})},allowAccessPeer(){this.allowAccessBtnDisabled=!0,ie(`/api/allowAccessPeers/${this.$route.params.id}`,{peers:[this.Peer.id]},i=>{this.dashboardStore.newMessage("Server",i.message,i.status?"success":"danger"),this.$emit("refresh"),this.allowAccessBtnDisabled=!1})}}},Fr={class:"dropdown-menu mt-2 shadow-lg d-block rounded-3",style:{"max-width":"200px"}},Br={style:{"font-size":"0.8rem","padding-left":"var(--bs-dropdown-item-padding-x)","padding-right":"var(--bs-dropdown-item-padding-x)"}},zr={class:"text-body d-flex"},$r={class:"ms-auto"},Nr={key:1},Hr={class:"w-100 dropdown-item text-muted",style:{"white-space":"break-spaces","font-size":"0.7rem"}},Wr={key:2},Vr={class:"d-flex",style:{"padding-left":"var(--bs-dropdown-item-padding-x)","padding-right":"var(--bs-dropdown-item-padding-x)"}},jr={key:1,class:"confirmDelete"},Ur={style:{"white-space":"break-spaces"},class:"mb-2 d-block fw-bold"},Yr={class:"d-flex w-100 gap-2"},Kr=["disabled"],Xr=["disabled"],Gr={key:1};function Jr(i,t,e,s,n,o){const r=$("LocaleText"),a=$("PeerSettingsDropdownTool");return M(),R("ul",Fr,[this.Peer.restricted?(M(),R("li",Gr,[g("a",{class:ht(["dropdown-item d-flex text-warning",{disabled:this.allowAccessBtnDisabled}]),onClick:t[10]||(t[10]=l=>this.allowAccessPeer()),role:"button"},[t[22]||(t[22]=g("i",{class:"me-auto bi bi-unlock"},null,-1)),this.allowAccessBtnDisabled?(M(),N(r,{key:1,t:"Allowing Access..."})):(M(),N(r,{key:0,t:"Allow Access"}))],2)])):(M(),R(Xt,{key:0},[this.confirmDelete?(M(),R("li",jr,[g("p",Ur,[C(r,{t:"Are you sure to delete this peer?"})]),g("div",Yr,[g("button",{onClick:t[8]||(t[8]=l=>this.deletePeer()),disabled:this.deleteBtnDisabled,class:"flex-grow-1 ms-auto btn btn-sm bg-danger"},[C(r,{t:"Yes"})],8,Kr),g("button",{disabled:this.deleteBtnDisabled,onClick:t[9]||(t[9]=l=>this.confirmDelete=!1),class:"flex-grow-1 btn btn-sm bg-secondary-subtle text-secondary-emphasis border border-secondary-subtle"},[C(r,{t:"No"})],8,Xr)])])):(M(),R(Xt,{key:0},[this.Peer.status==="running"?(M(),R(Xt,{key:0},[g("li",Br,[g("span",zr,[t[11]||(t[11]=g("i",{class:"bi bi-box-arrow-in-right"},null,-1)),g("span",$r,F(this.Peer.endpoint),1)])]),t[12]||(t[12]=g("li",null,[g("hr",{class:"dropdown-divider"})],-1))],64)):B("",!0),this.Peer.private_key?(M(),R("li",Wr,[t[13]||(t[13]=g("div",{class:"text-center text-muted"},null,-1)),g("div",Vr,[C(a,{icon:"bi-download",title:"Download",onClick:t[0]||(t[0]=l=>this.downloadPeer())}),C(a,{icon:"bi-qr-code",title:"QR Code",onClick:t[1]||(t[1]=l=>this.downloadQRCode("qrcode"))}),C(a,{icon:"bi-body-text",title:"Configuration File",onClick:t[2]||(t[2]=l=>this.downloadQRCode("configurationFile"))}),C(a,{icon:"bi-share",title:"Share",onClick:t[3]||(t[3]=l=>this.$emit("share"))})])])):(M(),R("li",Nr,[g("small",Hr,[C(r,{t:"Download & QR Code is not available due to no private key set for this peer"})])])),t[20]||(t[20]=g("li",null,[g("hr",{class:"dropdown-divider"})],-1)),g("li",null,[g("a",{class:"dropdown-item d-flex",role:"button",onClick:t[4]||(t[4]=l=>this.$emit("setting"))},[t[14]||(t[14]=g("i",{class:"me-auto bi bi-pen"},null,-1)),t[15]||(t[15]=pt()),C(r,{t:"Peer Settings"})])]),g("li",null,[g("a",{class:"dropdown-item d-flex",role:"button",onClick:t[5]||(t[5]=l=>this.$emit("jobs"))},[t[16]||(t[16]=g("i",{class:"me-auto bi bi-app-indicator"},null,-1)),t[17]||(t[17]=pt()),C(r,{t:"Schedule Jobs"})])]),t[21]||(t[21]=g("li",null,[g("hr",{class:"dropdown-divider"})],-1)),g("li",null,[g("a",{class:ht(["dropdown-item d-flex text-warning",{disabled:this.restrictBtnDisabled}]),onClick:t[6]||(t[6]=l=>this.restrictPeer()),role:"button"},[t[18]||(t[18]=g("i",{class:"me-auto bi bi-lock"},null,-1)),this.restrictBtnDisabled?(M(),N(r,{key:1,t:"Restricting..."})):(M(),N(r,{key:0,t:"Restrict Access"}))],2)]),g("li",null,[g("a",{class:ht(["dropdown-item d-flex fw-bold text-danger",{disabled:this.deleteBtnDisabled}]),onClick:t[7]||(t[7]=l=>this.confirmDelete=!0),role:"button"},[t[19]||(t[19]=g("i",{class:"me-auto bi bi-trash"},null,-1)),this.deleteBtnDisabled?(M(),N(r,{key:1,t:"Deleting..."})):(M(),N(r,{key:0,t:"Delete"}))],2)])],64))],64))])}const Vn=Dt(Er,[["render",Jr],["__scopeId","data-v-c4e10919"]]),qr={name:"peer",components:{LocaleText:ft,PeerSettingsDropdown:Vn},props:{Peer:Object},data(){return{}},setup(){const i=st(null),t=st(!1);return Wn(i,e=>{t.value=!1}),{target:i,subMenuOpened:t}},computed:{getLatestHandshake(){return this.Peer.latest_handshake.includes(",")?this.Peer.latest_handshake.split(",")[0]:this.Peer.latest_handshake}}},Qr={key:0,class:"card-header bg-transparent d-flex align-items-center gap-2 border-0"},Zr={style:{"font-size":"0.8rem"},class:"ms-auto d-flex gap-2"},ta={class:"text-primary"},ea={class:"text-success"},ia={key:0,class:"text-secondary"},sa={key:1,class:"border-0 card-header bg-transparent text-warning fw-bold",style:{"font-size":"0.8rem"}},na={class:"card-body pt-1",style:{"font-size":"0.9rem"}},oa={class:"mb-1"},ra={class:"text-muted"},aa={class:"d-block"},la={class:"text-muted"},ca={class:"d-block"},ha={key:0},da={class:"text-muted"},ua={class:"d-block"},fa={class:"d-flex align-items-end"};function ga(i,t,e,s,n,o){const r=$("LocaleText"),a=$("PeerSettingsDropdown");return M(),R("div",{class:ht(["card shadow-sm rounded-3 peerCard bg-transparent",{"border-warning":e.Peer.restricted}])},[g("div",null,[e.Peer.restricted?(M(),R("div",sa,[t[12]||(t[12]=g("i",{class:"bi-lock-fill me-2"},null,-1)),C(r,{t:"Access Restricted"})])):(M(),R("div",Qr,[g("div",{class:ht(["dot ms-0",{active:e.Peer.status==="running"}])},null,2),g("div",Zr,[g("span",ta,[t[7]||(t[7]=g("i",{class:"bi bi-arrow-down"},null,-1)),g("strong",null,F((e.Peer.cumu_receive+e.Peer.total_receive).toFixed(4)),1),t[8]||(t[8]=pt(" GB "))]),g("span",ea,[t[9]||(t[9]=g("i",{class:"bi bi-arrow-up"},null,-1)),g("strong",null,F((e.Peer.cumu_sent+e.Peer.total_sent).toFixed(4)),1),t[10]||(t[10]=pt(" GB "))]),e.Peer.latest_handshake!=="No Handshake"?(M(),R("span",ia,[t[11]||(t[11]=g("i",{class:"bi bi-arrows-angle-contract"},null,-1)),pt(" "+F(o.getLatestHandshake)+" ago ",1)])):B("",!0)])]))]),g("div",na,[g("h6",null,F(e.Peer.name?e.Peer.name:"Untitled Peer"),1),g("div",oa,[g("small",ra,[C(r,{t:"Public Key"})]),g("small",aa,[g("samp",null,F(e.Peer.id),1)])]),g("div",null,[g("small",la,[C(r,{t:"Allowed IPs"})]),g("small",ca,[g("samp",null,F(e.Peer.allowed_ip),1)])]),e.Peer.advanced_security?(M(),R("div",ha,[g("small",da,[C(r,{t:"Advanced Security"})]),g("small",ua,[g("samp",null,F(e.Peer.advanced_security),1)])])):B("",!0),g("div",fa,[g("div",{class:ht(["ms-auto px-2 rounded-3 subMenuBtn",{active:this.subMenuOpened}])},[g("a",{role:"button",class:"text-body",onClick:t[0]||(t[0]=l=>this.subMenuOpened=!0)},t[13]||(t[13]=[g("h5",{class:"mb-0"},[g("i",{class:"bi bi-three-dots"})],-1)])),C(q,{name:"slide-fade"},{default:X(()=>[this.subMenuOpened?(M(),N(a,{key:0,onQrcode:t[1]||(t[1]=l=>this.$emit("qrcode",l)),onConfigurationFile:t[2]||(t[2]=l=>this.$emit("configurationFile",l)),onSetting:t[3]||(t[3]=l=>this.$emit("setting")),onJobs:t[4]||(t[4]=l=>this.$emit("jobs")),onRefresh:t[5]||(t[5]=l=>this.$emit("refresh")),onShare:t[6]||(t[6]=l=>this.$emit("share")),Peer:e.Peer,ref:"target"},null,8,["Peer"])):B("",!0)]),_:1})],2)])])],2)}const pa=Dt(qr,[["render",ga],["__scopeId","data-v-e00283b9"]]);/*!
* @kurkle/color v0.3.2
* https://github.com/kurkle/color#readme
* (c) 2023 Jukka Kurkela
* Released under the MIT License
*/function Ae(i){return i+.5|0}const Lt=(i,t,e)=>Math.max(Math.min(i,e),t);function xe(i){return Lt(Ae(i*2.55),0,255)}function At(i){return Lt(Ae(i*255),0,255)}function Mt(i){return Lt(Ae(i/2.55)/100,0,1)}function ds(i){return Lt(Ae(i*100),0,100)}const lt={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},Oi=[..."0123456789ABCDEF"],ma=i=>Oi[i&15],ba=i=>Oi[(i&240)>>4]+Oi[i&15],ze=i=>(i&240)>>4===(i&15),_a=i=>ze(i.r)&&ze(i.g)&&ze(i.b)&&ze(i.a);function xa(i){var t=i.length,e;return i[0]==="#"&&(t===4||t===5?e={r:255&lt[i[1]]*17,g:255&lt[i[2]]*17,b:255&lt[i[3]]*17,a:t===5?lt[i[4]]*17:255}:(t===7||t===9)&&(e={r:lt[i[1]]<<4|lt[i[2]],g:lt[i[3]]<<4|lt[i[4]],b:lt[i[5]]<<4|lt[i[6]],a:t===9?lt[i[7]]<<4|lt[i[8]]:255})),e}const ya=(i,t)=>i<255?t(i):"";function va(i){var t=_a(i)?ma:ba;return i?"#"+t(i.r)+t(i.g)+t(i.b)+ya(i.a,t):void 0}const Sa=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function jn(i,t,e){const s=t*Math.min(e,1-e),n=(o,r=(o+i/30)%12)=>e-s*Math.max(Math.min(r-3,9-r,1),-1);return[n(0),n(8),n(4)]}function wa(i,t,e){const s=(n,o=(n+i/60)%6)=>e-e*t*Math.max(Math.min(o,4-o,1),0);return[s(5),s(3),s(1)]}function ka(i,t,e){const s=jn(i,1,.5);let n;for(t+e>1&&(n=1/(t+e),t*=n,e*=n),n=0;n<3;n++)s[n]*=1-t-e,s[n]+=t;return s}function Pa(i,t,e,s,n){return i===n?(t-e)/s+(t<e?6:0):t===n?(e-i)/s+2:(i-t)/s+4}function Yi(i){const e=i.r/255,s=i.g/255,n=i.b/255,o=Math.max(e,s,n),r=Math.min(e,s,n),a=(o+r)/2;let l,c,h;return o!==r&&(h=o-r,c=a>.5?h/(2-o-r):h/(o+r),l=Pa(e,s,n,h,o),l=l*60+.5),[l|0,c||0,a]}function Ki(i,t,e,s){return(Array.isArray(t)?i(t[0],t[1],t[2]):i(t,e,s)).map(At)}function Xi(i,t,e){return Ki(jn,i,t,e)}function Ma(i,t,e){return Ki(ka,i,t,e)}function Ca(i,t,e){return Ki(wa,i,t,e)}function Un(i){return(i%360+360)%360}function Da(i){const t=Sa.exec(i);let e=255,s;if(!t)return;t[5]!==s&&(e=t[6]?xe(+t[5]):At(+t[5]));const n=Un(+t[2]),o=+t[3]/100,r=+t[4]/100;return t[1]==="hwb"?s=Ma(n,o,r):t[1]==="hsv"?s=Ca(n,o,r):s=Xi(n,o,r),{r:s[0],g:s[1],b:s[2],a:e}}function Oa(i,t){var e=Yi(i);e[0]=Un(e[0]+t),e=Xi(e),i.r=e[0],i.g=e[1],i.b=e[2]}function Ta(i){if(!i)return;const t=Yi(i),e=t[0],s=ds(t[1]),n=ds(t[2]);return i.a<255?`hsla(${e}, ${s}%, ${n}%, ${Mt(i.a)})`:`hsl(${e}, ${s}%, ${n}%)`}const us={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"},fs={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 La(){const i={},t=Object.keys(fs),e=Object.keys(us);let s,n,o,r,a;for(s=0;s<t.length;s++){for(r=a=t[s],n=0;n<e.length;n++)o=e[n],a=a.replace(o,us[o]);o=parseInt(fs[r],16),i[a]=[o>>16&255,o>>8&255,o&255]}return i}let $e;function Ra(i){$e||($e=La(),$e.transparent=[0,0,0,0]);const t=$e[i.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const Aa=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Ia(i){const t=Aa.exec(i);let e=255,s,n,o;if(t){if(t[7]!==s){const r=+t[7];e=t[8]?xe(r):Lt(r*255,0,255)}return s=+t[1],n=+t[3],o=+t[5],s=255&(t[2]?xe(s):Lt(s,0,255)),n=255&(t[4]?xe(n):Lt(n,0,255)),o=255&(t[6]?xe(o):Lt(o,0,255)),{r:s,g:n,b:o,a:e}}}function Ea(i){return i&&(i.a<255?`rgba(${i.r}, ${i.g}, ${i.b}, ${Mt(i.a)})`:`rgb(${i.r}, ${i.g}, ${i.b})`)}const pi=i=>i<=.0031308?i*12.92:Math.pow(i,1/2.4)*1.055-.055,te=i=>i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4);function Fa(i,t,e){const s=te(Mt(i.r)),n=te(Mt(i.g)),o=te(Mt(i.b));return{r:At(pi(s+e*(te(Mt(t.r))-s))),g:At(pi(n+e*(te(Mt(t.g))-n))),b:At(pi(o+e*(te(Mt(t.b))-o))),a:i.a+e*(t.a-i.a)}}function Ne(i,t,e){if(i){let s=Yi(i);s[t]=Math.max(0,Math.min(s[t]+s[t]*e,t===0?360:1)),s=Xi(s),i.r=s[0],i.g=s[1],i.b=s[2]}}function Yn(i,t){return i&&Object.assign(t||{},i)}function gs(i){var t={r:0,g:0,b:0,a:255};return Array.isArray(i)?i.length>=3&&(t={r:i[0],g:i[1],b:i[2],a:255},i.length>3&&(t.a=At(i[3]))):(t=Yn(i,{r:0,g:0,b:0,a:1}),t.a=At(t.a)),t}function Ba(i){return i.charAt(0)==="r"?Ia(i):Da(i)}class Me{constructor(t){if(t instanceof Me)return t;const e=typeof t;let s;e==="object"?s=gs(t):e==="string"&&(s=xa(t)||Ra(t)||Ba(t)),this._rgb=s,this._valid=!!s}get valid(){return this._valid}get rgb(){var t=Yn(this._rgb);return t&&(t.a=Mt(t.a)),t}set rgb(t){this._rgb=gs(t)}rgbString(){return this._valid?Ea(this._rgb):void 0}hexString(){return this._valid?va(this._rgb):void 0}hslString(){return this._valid?Ta(this._rgb):void 0}mix(t,e){if(t){const s=this.rgb,n=t.rgb;let o;const r=e===o?.5:e,a=2*r-1,l=s.a-n.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;o=1-c,s.r=255&c*s.r+o*n.r+.5,s.g=255&c*s.g+o*n.g+.5,s.b=255&c*s.b+o*n.b+.5,s.a=r*s.a+(1-r)*n.a,this.rgb=s}return this}interpolate(t,e){return t&&(this._rgb=Fa(this._rgb,t._rgb,e)),this}clone(){return new Me(this.rgb)}alpha(t){return this._rgb.a=At(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=Ae(t.r*.3+t.g*.59+t.b*.11);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 Ne(this._rgb,2,t),this}darken(t){return Ne(this._rgb,2,-t),this}saturate(t){return Ne(this._rgb,1,t),this}desaturate(t){return Ne(this._rgb,1,-t),this}rotate(t){return Oa(this._rgb,t),this}}/*!
* Chart.js v4.4.4
* https://www.chartjs.org
* (c) 2024 Chart.js Contributors
* Released under the MIT License
*/function wt(){}const za=(()=>{let i=0;return()=>i++})();function W(i){return i===null||typeof i>"u"}function G(i){if(Array.isArray&&Array.isArray(i))return!0;const t=Object.prototype.toString.call(i);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function E(i){return i!==null&&Object.prototype.toString.call(i)==="[object Object]"}function dt(i){return(typeof i=="number"||i instanceof Number)&&isFinite(+i)}function mt(i,t){return dt(i)?i:t}function I(i,t){return typeof i>"u"?t:i}const $a=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100*t:+i;function V(i,t,e){if(i&&typeof i.call=="function")return i.apply(e,t)}function z(i,t,e,s){let n,o,r;if(G(i))for(o=i.length,n=0;n<o;n++)t.call(e,i[n],n);else if(E(i))for(r=Object.keys(i),o=r.length,n=0;n<o;n++)t.call(e,i[r[n]],r[n])}function si(i,t){let e,s,n,o;if(!i||!t||i.length!==t.length)return!1;for(e=0,s=i.length;e<s;++e)if(n=i[e],o=t[e],n.datasetIndex!==o.datasetIndex||n.index!==o.index)return!1;return!0}function ni(i){if(G(i))return i.map(ni);if(E(i)){const t=Object.create(null),e=Object.keys(i),s=e.length;let n=0;for(;n<s;++n)t[e[n]]=ni(i[e[n]]);return t}return i}function Kn(i){return["__proto__","prototype","constructor"].indexOf(i)===-1}function Na(i,t,e,s){if(!Kn(i))return;const n=t[i],o=e[i];E(n)&&E(o)?Ce(n,o,s):t[i]=ni(o)}function Ce(i,t,e){const s=G(t)?t:[t],n=s.length;if(!E(i))return i;e=e||{};const o=e.merger||Na;let r;for(let a=0;a<n;++a){if(r=s[a],!E(r))continue;const l=Object.keys(r);for(let c=0,h=l.length;c<h;++c)o(l[c],i,r,e)}return i}function Se(i,t){return Ce(i,t,{merger:Ha})}function Ha(i,t,e){if(!Kn(i))return;const s=t[i],n=e[i];E(s)&&E(n)?Se(s,n):Object.prototype.hasOwnProperty.call(t,i)||(t[i]=ni(n))}const ps={"":i=>i,x:i=>i.x,y:i=>i.y};function Wa(i){const t=i.split("."),e=[];let s="";for(const n of t)s+=n,s.endsWith("\\")?s=s.slice(0,-1)+".":(e.push(s),s="");return e}function Va(i){const t=Wa(i);return e=>{for(const s of t){if(s==="")break;e=e&&e[s]}return e}}function re(i,t){return(ps[t]||(ps[t]=Va(t)))(i)}function Gi(i){return i.charAt(0).toUpperCase()+i.slice(1)}const De=i=>typeof i<"u",It=i=>typeof i=="function",ms=(i,t)=>{if(i.size!==t.size)return!1;for(const e of i)if(!t.has(e))return!1;return!0};function ja(i){return i.type==="mouseup"||i.type==="click"||i.type==="contextmenu"}const J=Math.PI,vt=2*J,Ua=vt+J,oi=Number.POSITIVE_INFINITY,Ya=J/180,gt=J/2,$t=J/4,bs=J*2/3,Ti=Math.log10,St=Math.sign;function we(i,t,e){return Math.abs(i-t)<e}function _s(i){const t=Math.round(i);i=we(i,t,i/1e3)?t:i;const e=Math.pow(10,Math.floor(Ti(i))),s=i/e;return(s<=1?1:s<=2?2:s<=5?5:10)*e}function Ka(i){const t=[],e=Math.sqrt(i);let s;for(s=1;s<e;s++)i%s===0&&(t.push(s),t.push(i/s));return e===(e|0)&&t.push(e),t.sort((n,o)=>n-o).pop(),t}function Oe(i){return!isNaN(parseFloat(i))&&isFinite(i)}function Xa(i,t){const e=Math.round(i);return e-t<=i&&e+t>=i}function Ga(i,t,e){let s,n,o;for(s=0,n=i.length;s<n;s++)o=i[s][e],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function Ut(i){return i*(J/180)}function Ja(i){return i*(180/J)}function xs(i){if(!dt(i))return;let t=1,e=0;for(;Math.round(i*t)/t!==i;)t*=10,e++;return e}function qa(i,t){const e=t.x-i.x,s=t.y-i.y,n=Math.sqrt(e*e+s*s);let o=Math.atan2(s,e);return o<-.5*J&&(o+=vt),{angle:o,distance:n}}function Li(i,t){return Math.sqrt(Math.pow(t.x-i.x,2)+Math.pow(t.y-i.y,2))}function Qa(i,t){return(i-t+Ua)%vt-J}function Tt(i){return(i%vt+vt)%vt}function Xn(i,t,e,s){const n=Tt(i),o=Tt(t),r=Tt(e),a=Tt(o-n),l=Tt(r-n),c=Tt(n-o),h=Tt(n-r);return n===o||n===r||s&&o===r||a>l&&c<h}function nt(i,t,e){return Math.max(t,Math.min(e,i))}function Za(i){return nt(i,-32768,32767)}function Yt(i,t,e,s=1e-6){return i>=Math.min(t,e)-s&&i<=Math.max(t,e)+s}function Ji(i,t,e){e=e||(r=>i[r]<t);let s=i.length-1,n=0,o;for(;s-n>1;)o=n+s>>1,e(o)?n=o:s=o;return{lo:n,hi:s}}const Kt=(i,t,e,s)=>Ji(i,e,s?n=>{const o=i[n][t];return o<e||o===e&&i[n+1][t]===e}:n=>i[n][t]<e),tl=(i,t,e)=>Ji(i,e,s=>i[s][t]>=e);function el(i,t,e){let s=0,n=i.length;for(;s<n&&i[s]<t;)s++;for(;n>s&&i[n-1]>e;)n--;return s>0||n<i.length?i.slice(s,n):i}const Gn=["push","pop","shift","splice","unshift"];function il(i,t){if(i._chartjs){i._chartjs.listeners.push(t);return}Object.defineProperty(i,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),Gn.forEach(e=>{const s="_onData"+Gi(e),n=i[e];Object.defineProperty(i,e,{configurable:!0,enumerable:!1,value(...o){const r=n.apply(this,o);return i._chartjs.listeners.forEach(a=>{typeof a[s]=="function"&&a[s](...o)}),r}})})}function ys(i,t){const e=i._chartjs;if(!e)return;const s=e.listeners,n=s.indexOf(t);n!==-1&&s.splice(n,1),!(s.length>0)&&(Gn.forEach(o=>{delete i[o]}),delete i._chartjs)}function Jn(i){const t=new Set(i);return t.size===i.length?i:Array.from(t)}const qn=function(){return typeof window>"u"?function(i){return i()}:window.requestAnimationFrame}();function Qn(i,t){let e=[],s=!1;return function(...n){e=n,s||(s=!0,qn.call(window,()=>{s=!1,i.apply(t,e)}))}}function sl(i,t){let e;return function(...s){return t?(clearTimeout(e),e=setTimeout(i,t,s)):i.apply(this,s),t}}const qi=i=>i==="start"?"left":i==="end"?"right":"center",Q=(i,t,e)=>i==="start"?t:i==="end"?e:(t+e)/2,nl=(i,t,e,s)=>i===(s?"left":"right")?e:i==="center"?(t+e)/2:t;function ol(i,t,e){const s=t.length;let n=0,o=s;if(i._sorted){const{iScale:r,_parsed:a}=i,l=r.axis,{min:c,max:h,minDefined:d,maxDefined:u}=r.getUserBounds();d&&(n=nt(Math.min(Kt(a,l,c).lo,e?s:Kt(t,l,r.getPixelForValue(c)).lo),0,s-1)),u?o=nt(Math.max(Kt(a,r.axis,h,!0).hi+1,e?0:Kt(t,l,r.getPixelForValue(h),!0).hi+1),n,s)-n:o=s-n}return{start:n,count:o}}function rl(i){const{xScale:t,yScale:e,_scaleRanges:s}=i,n={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!s)return i._scaleRanges=n,!0;const o=s.xmin!==t.min||s.xmax!==t.max||s.ymin!==e.min||s.ymax!==e.max;return Object.assign(s,n),o}const He=i=>i===0||i===1,vs=(i,t,e)=>-(Math.pow(2,10*(i-=1))*Math.sin((i-t)*vt/e)),Ss=(i,t,e)=>Math.pow(2,-10*i)*Math.sin((i-t)*vt/e)+1,ke={linear:i=>i,easeInQuad:i=>i*i,easeOutQuad:i=>-i*(i-2),easeInOutQuad:i=>(i/=.5)<1?.5*i*i:-.5*(--i*(i-2)-1),easeInCubic:i=>i*i*i,easeOutCubic:i=>(i-=1)*i*i+1,easeInOutCubic:i=>(i/=.5)<1?.5*i*i*i:.5*((i-=2)*i*i+2),easeInQuart:i=>i*i*i*i,easeOutQuart:i=>-((i-=1)*i*i*i-1),easeInOutQuart:i=>(i/=.5)<1?.5*i*i*i*i:-.5*((i-=2)*i*i*i-2),easeInQuint:i=>i*i*i*i*i,easeOutQuint:i=>(i-=1)*i*i*i*i+1,easeInOutQuint:i=>(i/=.5)<1?.5*i*i*i*i*i:.5*((i-=2)*i*i*i*i+2),easeInSine:i=>-Math.cos(i*gt)+1,easeOutSine:i=>Math.sin(i*gt),easeInOutSine:i=>-.5*(Math.cos(J*i)-1),easeInExpo:i=>i===0?0:Math.pow(2,10*(i-1)),easeOutExpo:i=>i===1?1:-Math.pow(2,-10*i)+1,easeInOutExpo:i=>He(i)?i:i<.5?.5*Math.pow(2,10*(i*2-1)):.5*(-Math.pow(2,-10*(i*2-1))+2),easeInCirc:i=>i>=1?i:-(Math.sqrt(1-i*i)-1),easeOutCirc:i=>Math.sqrt(1-(i-=1)*i),easeInOutCirc:i=>(i/=.5)<1?-.5*(Math.sqrt(1-i*i)-1):.5*(Math.sqrt(1-(i-=2)*i)+1),easeInElastic:i=>He(i)?i:vs(i,.075,.3),easeOutElastic:i=>He(i)?i:Ss(i,.075,.3),easeInOutElastic(i){return He(i)?i:i<.5?.5*vs(i*2,.1125,.45):.5+.5*Ss(i*2-1,.1125,.45)},easeInBack(i){return i*i*((1.70158+1)*i-1.70158)},easeOutBack(i){return(i-=1)*i*((1.70158+1)*i+1.70158)+1},easeInOutBack(i){let t=1.70158;return(i/=.5)<1?.5*(i*i*(((t*=1.525)+1)*i-t)):.5*((i-=2)*i*(((t*=1.525)+1)*i+t)+2)},easeInBounce:i=>1-ke.easeOutBounce(1-i),easeOutBounce(i){return i<1/2.75?7.5625*i*i:i<2/2.75?7.5625*(i-=1.5/2.75)*i+.75:i<2.5/2.75?7.5625*(i-=2.25/2.75)*i+.9375:7.5625*(i-=2.625/2.75)*i+.984375},easeInOutBounce:i=>i<.5?ke.easeInBounce(i*2)*.5:ke.easeOutBounce(i*2-1)*.5+.5};function Qi(i){if(i&&typeof i=="object"){const t=i.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function ws(i){return Qi(i)?i:new Me(i)}function mi(i){return Qi(i)?i:new Me(i).saturate(.5).darken(.1).hexString()}const al=["x","y","borderWidth","radius","tension"],ll=["color","borderColor","backgroundColor"];function cl(i){i.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),i.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),i.set("animations",{colors:{type:"color",properties:ll},numbers:{type:"number",properties:al}}),i.describe("animations",{_fallback:"animation"}),i.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=>t|0}}}})}function hl(i){i.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const ks=new Map;function dl(i,t){t=t||{};const e=i+JSON.stringify(t);let s=ks.get(e);return s||(s=new Intl.NumberFormat(i,t),ks.set(e,s)),s}function Zn(i,t,e){return dl(t,e).format(i)}const to={values(i){return G(i)?i:""+i},numeric(i,t,e){if(i===0)return"0";const s=this.chart.options.locale;let n,o=i;if(e.length>1){const c=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(c<1e-4||c>1e15)&&(n="scientific"),o=ul(i,e)}const r=Ti(Math.abs(o)),a=isNaN(r)?1:Math.max(Math.min(-1*Math.floor(r),20),0),l={notation:n,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),Zn(i,s,l)},logarithmic(i,t,e){if(i===0)return"0";const s=e[t].significand||i/Math.pow(10,Math.floor(Ti(i)));return[1,2,3,5,10,15].includes(s)||t>.8*e.length?to.numeric.call(this,i,t,e):""}};function ul(i,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&i!==Math.floor(i)&&(e=i-Math.floor(i)),e}var eo={formatters:to};function fl(i){i.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:eo.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),i.route("scale.ticks","color","","color"),i.route("scale.grid","color","","borderColor"),i.route("scale.border","color","","borderColor"),i.route("scale.title","color","","color"),i.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),i.describe("scales",{_fallback:"scale"}),i.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const Jt=Object.create(null),Ri=Object.create(null);function Pe(i,t){if(!t)return i;const e=t.split(".");for(let s=0,n=e.length;s<n;++s){const o=e[s];i=i[o]||(i[o]=Object.create(null))}return i}function bi(i,t,e){return typeof t=="string"?Ce(Pe(i,t),e):Ce(Pe(i,""),t)}class gl{constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=s=>s.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=(s,n)=>mi(n.backgroundColor),this.hoverBorderColor=(s,n)=>mi(n.borderColor),this.hoverColor=(s,n)=>mi(n.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 bi(this,t,e)}get(t){return Pe(this,t)}describe(t,e){return bi(Ri,t,e)}override(t,e){return bi(Jt,t,e)}route(t,e,s,n){const o=Pe(this,t),r=Pe(this,s),a="_"+e;Object.defineProperties(o,{[a]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[a],c=r[n];return E(l)?Object.assign({},c,l):I(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(e=>e(this))}}var U=new gl({_scriptable:i=>!i.startsWith("on"),_indexable:i=>i!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[cl,hl,fl]);function pl(i){return!i||W(i.size)||W(i.family)?null:(i.style?i.style+" ":"")+(i.weight?i.weight+" ":"")+i.size+"px "+i.family}function Ps(i,t,e,s,n){let o=t[n];return o||(o=t[n]=i.measureText(n).width,e.push(n)),o>s&&(s=o),s}function Nt(i,t,e){const s=i.currentDevicePixelRatio,n=e!==0?Math.max(e/2,.5):0;return Math.round((t-n)*s)/s+n}function Ms(i,t){!t&&!i||(t=t||i.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,i.width,i.height),t.restore())}function Ai(i,t,e,s){io(i,t,e,s,null)}function io(i,t,e,s,n){let o,r,a,l,c,h,d,u;const f=t.pointStyle,p=t.rotation,m=t.radius;let b=(p||0)*Ya;if(f&&typeof f=="object"&&(o=f.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){i.save(),i.translate(e,s),i.rotate(b),i.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),i.restore();return}if(!(isNaN(m)||m<=0)){switch(i.beginPath(),f){default:n?i.ellipse(e,s,n/2,m,0,0,vt):i.arc(e,s,m,0,vt),i.closePath();break;case"triangle":h=n?n/2:m,i.moveTo(e+Math.sin(b)*h,s-Math.cos(b)*m),b+=bs,i.lineTo(e+Math.sin(b)*h,s-Math.cos(b)*m),b+=bs,i.lineTo(e+Math.sin(b)*h,s-Math.cos(b)*m),i.closePath();break;case"rectRounded":c=m*.516,l=m-c,r=Math.cos(b+$t)*l,d=Math.cos(b+$t)*(n?n/2-c:l),a=Math.sin(b+$t)*l,u=Math.sin(b+$t)*(n?n/2-c:l),i.arc(e-d,s-a,c,b-J,b-gt),i.arc(e+u,s-r,c,b-gt,b),i.arc(e+d,s+a,c,b,b+gt),i.arc(e-u,s+r,c,b+gt,b+J),i.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*m,h=n?n/2:l,i.rect(e-h,s-l,2*h,2*l);break}b+=$t;case"rectRot":d=Math.cos(b)*(n?n/2:m),r=Math.cos(b)*m,a=Math.sin(b)*m,u=Math.sin(b)*(n?n/2:m),i.moveTo(e-d,s-a),i.lineTo(e+u,s-r),i.lineTo(e+d,s+a),i.lineTo(e-u,s+r),i.closePath();break;case"crossRot":b+=$t;case"cross":d=Math.cos(b)*(n?n/2:m),r=Math.cos(b)*m,a=Math.sin(b)*m,u=Math.sin(b)*(n?n/2:m),i.moveTo(e-d,s-a),i.lineTo(e+d,s+a),i.moveTo(e+u,s-r),i.lineTo(e-u,s+r);break;case"star":d=Math.cos(b)*(n?n/2:m),r=Math.cos(b)*m,a=Math.sin(b)*m,u=Math.sin(b)*(n?n/2:m),i.moveTo(e-d,s-a),i.lineTo(e+d,s+a),i.moveTo(e+u,s-r),i.lineTo(e-u,s+r),b+=$t,d=Math.cos(b)*(n?n/2:m),r=Math.cos(b)*m,a=Math.sin(b)*m,u=Math.sin(b)*(n?n/2:m),i.moveTo(e-d,s-a),i.lineTo(e+d,s+a),i.moveTo(e+u,s-r),i.lineTo(e-u,s+r);break;case"line":r=n?n/2:Math.cos(b)*m,a=Math.sin(b)*m,i.moveTo(e-r,s-a),i.lineTo(e+r,s+a);break;case"dash":i.moveTo(e,s),i.lineTo(e+Math.cos(b)*(n?n/2:m),s+Math.sin(b)*m);break;case!1:i.closePath();break}i.fill(),t.borderWidth>0&&i.stroke()}}function Te(i,t,e){return e=e||.5,!t||i&&i.x>t.left-e&&i.x<t.right+e&&i.y>t.top-e&&i.y<t.bottom+e}function Zi(i,t){i.save(),i.beginPath(),i.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),i.clip()}function ts(i){i.restore()}function ml(i,t,e,s,n){if(!t)return i.lineTo(e.x,e.y);if(n==="middle"){const o=(t.x+e.x)/2;i.lineTo(o,t.y),i.lineTo(o,e.y)}else n==="after"!=!!s?i.lineTo(t.x,e.y):i.lineTo(e.x,t.y);i.lineTo(e.x,e.y)}function bl(i,t,e,s){if(!t)return i.lineTo(e.x,e.y);i.bezierCurveTo(s?t.cp1x:t.cp2x,s?t.cp1y:t.cp2y,s?e.cp2x:e.cp1x,s?e.cp2y:e.cp1y,e.x,e.y)}function _l(i,t){t.translation&&i.translate(t.translation[0],t.translation[1]),W(t.rotation)||i.rotate(t.rotation),t.color&&(i.fillStyle=t.color),t.textAlign&&(i.textAlign=t.textAlign),t.textBaseline&&(i.textBaseline=t.textBaseline)}function xl(i,t,e,s,n){if(n.strikethrough||n.underline){const o=i.measureText(s),r=t-o.actualBoundingBoxLeft,a=t+o.actualBoundingBoxRight,l=e-o.actualBoundingBoxAscent,c=e+o.actualBoundingBoxDescent,h=n.strikethrough?(l+c)/2:c;i.strokeStyle=i.fillStyle,i.beginPath(),i.lineWidth=n.decorationWidth||2,i.moveTo(r,h),i.lineTo(a,h),i.stroke()}}function yl(i,t){const e=i.fillStyle;i.fillStyle=t.color,i.fillRect(t.left,t.top,t.width,t.height),i.fillStyle=e}function Le(i,t,e,s,n,o={}){const r=G(t)?t:[t],a=o.strokeWidth>0&&o.strokeColor!=="";let l,c;for(i.save(),i.font=n.string,_l(i,o),l=0;l<r.length;++l)c=r[l],o.backdrop&&yl(i,o.backdrop),a&&(o.strokeColor&&(i.strokeStyle=o.strokeColor),W(o.strokeWidth)||(i.lineWidth=o.strokeWidth),i.strokeText(c,e,s,o.maxWidth)),i.fillText(c,e,s,o.maxWidth),xl(i,e,s,c,o),s+=Number(n.lineHeight);i.restore()}function ri(i,t){const{x:e,y:s,w:n,h:o,radius:r}=t;i.arc(e+r.topLeft,s+r.topLeft,r.topLeft,1.5*J,J,!0),i.lineTo(e,s+o-r.bottomLeft),i.arc(e+r.bottomLeft,s+o-r.bottomLeft,r.bottomLeft,J,gt,!0),i.lineTo(e+n-r.bottomRight,s+o),i.arc(e+n-r.bottomRight,s+o-r.bottomRight,r.bottomRight,gt,0,!0),i.lineTo(e+n,s+r.topRight),i.arc(e+n-r.topRight,s+r.topRight,r.topRight,0,-gt,!0),i.lineTo(e+r.topLeft,s)}const vl=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Sl=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function wl(i,t){const e=(""+i).match(vl);if(!e||e[1]==="normal")return t*1.2;switch(i=+e[2],e[3]){case"px":return i;case"%":i/=100;break}return t*i}const kl=i=>+i||0;function so(i,t){const e={},s=E(t),n=s?Object.keys(t):t,o=E(i)?s?r=>I(i[r],i[t[r]]):r=>i[r]:()=>i;for(const r of n)e[r]=kl(o(r));return e}function no(i){return so(i,{top:"y",right:"x",bottom:"y",left:"x"})}function se(i){return so(i,["topLeft","topRight","bottomLeft","bottomRight"])}function ut(i){const t=no(i);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function Z(i,t){i=i||{},t=t||U.font;let e=I(i.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let s=I(i.style,t.style);s&&!(""+s).match(Sl)&&(console.warn('Invalid font style specified: "'+s+'"'),s=void 0);const n={family:I(i.family,t.family),lineHeight:wl(I(i.lineHeight,t.lineHeight),e),size:e,style:s,weight:I(i.weight,t.weight),string:""};return n.string=pl(n),n}function We(i,t,e,s){let n,o,r;for(n=0,o=i.length;n<o;++n)if(r=i[n],r!==void 0&&r!==void 0)return r}function Pl(i,t,e){const{min:s,max:n}=i,o=$a(t,(n-s)/2),r=(a,l)=>e&&a===0?0:a+l;return{min:r(s,-Math.abs(o)),max:r(n,o)}}function qt(i,t){return Object.assign(Object.create(i),t)}function es(i,t=[""],e,s,n=()=>i[0]){const o=e||i;typeof s>"u"&&(s=lo("_fallback",i));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:i,_rootScopes:o,_fallback:s,_getTarget:n,override:a=>es([a,...i],t,o,s)};return new Proxy(r,{deleteProperty(a,l){return delete a[l],delete a._keys,delete i[0][l],!0},get(a,l){return ro(a,l,()=>Al(l,t,i,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(i[0])},has(a,l){return Ds(a).includes(l)},ownKeys(a){return Ds(a)},set(a,l,c){const h=a._storage||(a._storage=n());return a[l]=h[l]=c,delete a._keys,!0}})}function ae(i,t,e,s){const n={_cacheable:!1,_proxy:i,_context:t,_subProxy:e,_stack:new Set,_descriptors:oo(i,s),setContext:o=>ae(i,o,e,s),override:o=>ae(i.override(o),t,e,s)};return new Proxy(n,{deleteProperty(o,r){return delete o[r],delete i[r],!0},get(o,r,a){return ro(o,r,()=>Cl(o,r,a))},getOwnPropertyDescriptor(o,r){return o._descriptors.allKeys?Reflect.has(i,r)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(i,r)},getPrototypeOf(){return Reflect.getPrototypeOf(i)},has(o,r){return Reflect.has(i,r)},ownKeys(){return Reflect.ownKeys(i)},set(o,r,a){return i[r]=a,delete o[r],!0}})}function oo(i,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:s=t.indexable,_allKeys:n=t.allKeys}=i;return{allKeys:n,scriptable:e,indexable:s,isScriptable:It(e)?e:()=>e,isIndexable:It(s)?s:()=>s}}const Ml=(i,t)=>i?i+Gi(t):t,is=(i,t)=>E(t)&&i!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function ro(i,t,e){if(Object.prototype.hasOwnProperty.call(i,t)||t==="constructor")return i[t];const s=e();return i[t]=s,s}function Cl(i,t,e){const{_proxy:s,_context:n,_subProxy:o,_descriptors:r}=i;let a=s[t];return It(a)&&r.isScriptable(t)&&(a=Dl(t,a,i,e)),G(a)&&a.length&&(a=Ol(t,a,i,r.isIndexable)),is(t,a)&&(a=ae(a,n,o&&o[t],r)),a}function Dl(i,t,e,s){const{_proxy:n,_context:o,_subProxy:r,_stack:a}=e;if(a.has(i))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+i);a.add(i);let l=t(o,r||s);return a.delete(i),is(i,l)&&(l=ss(n._scopes,n,i,l)),l}function Ol(i,t,e,s){const{_proxy:n,_context:o,_subProxy:r,_descriptors:a}=e;if(typeof o.index<"u"&&s(i))return t[o.index%t.length];if(E(t[0])){const l=t,c=n._scopes.filter(h=>h!==l);t=[];for(const h of l){const d=ss(c,n,i,h);t.push(ae(d,o,r&&r[i],a))}}return t}function ao(i,t,e){return It(i)?i(t,e):i}const Tl=(i,t)=>i===!0?t:typeof i=="string"?re(t,i):void 0;function Ll(i,t,e,s,n){for(const o of t){const r=Tl(e,o);if(r){i.add(r);const a=ao(r._fallback,e,n);if(typeof a<"u"&&a!==e&&a!==s)return a}else if(r===!1&&typeof s<"u"&&e!==s)return null}return!1}function ss(i,t,e,s){const n=t._rootScopes,o=ao(t._fallback,e,s),r=[...i,...n],a=new Set;a.add(s);let l=Cs(a,r,e,o||e,s);return l===null||typeof o<"u"&&o!==e&&(l=Cs(a,r,o,l,s),l===null)?!1:es(Array.from(a),[""],n,o,()=>Rl(t,e,s))}function Cs(i,t,e,s,n){for(;e;)e=Ll(i,t,e,s,n);return e}function Rl(i,t,e){const s=i._getTarget();t in s||(s[t]={});const n=s[t];return G(n)&&E(e)?e:n||{}}function Al(i,t,e,s){let n;for(const o of t)if(n=lo(Ml(o,i),e),typeof n<"u")return is(i,n)?ss(e,s,i,n):n}function lo(i,t){for(const e of t){if(!e)continue;const s=e[i];if(typeof s<"u")return s}}function Ds(i){let t=i._keys;return t||(t=i._keys=Il(i._scopes)),t}function Il(i){const t=new Set;for(const e of i)for(const s of Object.keys(e).filter(n=>!n.startsWith("_")))t.add(s);return Array.from(t)}const El=Number.EPSILON||1e-14,le=(i,t)=>t<i.length&&!i[t].skip&&i[t],co=i=>i==="x"?"y":"x";function Fl(i,t,e,s){const n=i.skip?t:i,o=t,r=e.skip?t:e,a=Li(o,n),l=Li(r,o);let c=a/(a+l),h=l/(a+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;const d=s*c,u=s*h;return{previous:{x:o.x-d*(r.x-n.x),y:o.y-d*(r.y-n.y)},next:{x:o.x+u*(r.x-n.x),y:o.y+u*(r.y-n.y)}}}function Bl(i,t,e){const s=i.length;let n,o,r,a,l,c=le(i,0);for(let h=0;h<s-1;++h)if(l=c,c=le(i,h+1),!(!l||!c)){if(we(t[h],0,El)){e[h]=e[h+1]=0;continue}n=e[h]/t[h],o=e[h+1]/t[h],a=Math.pow(n,2)+Math.pow(o,2),!(a<=9)&&(r=3/Math.sqrt(a),e[h]=n*r*t[h],e[h+1]=o*r*t[h])}}function zl(i,t,e="x"){const s=co(e),n=i.length;let o,r,a,l=le(i,0);for(let c=0;c<n;++c){if(r=a,a=l,l=le(i,c+1),!a)continue;const h=a[e],d=a[s];r&&(o=(h-r[e])/3,a[`cp1${e}`]=h-o,a[`cp1${s}`]=d-o*t[c]),l&&(o=(l[e]-h)/3,a[`cp2${e}`]=h+o,a[`cp2${s}`]=d+o*t[c])}}function $l(i,t="x"){const e=co(t),s=i.length,n=Array(s).fill(0),o=Array(s);let r,a,l,c=le(i,0);for(r=0;r<s;++r)if(a=l,l=c,c=le(i,r+1),!!l){if(c){const h=c[t]-l[t];n[r]=h!==0?(c[e]-l[e])/h:0}o[r]=a?c?St(n[r-1])!==St(n[r])?0:(n[r-1]+n[r])/2:n[r-1]:n[r]}Bl(i,n,o),zl(i,o,t)}function Ve(i,t,e){return Math.max(Math.min(i,e),t)}function Nl(i,t){let e,s,n,o,r,a=Te(i[0],t);for(e=0,s=i.length;e<s;++e)r=o,o=a,a=e<s-1&&Te(i[e+1],t),o&&(n=i[e],r&&(n.cp1x=Ve(n.cp1x,t.left,t.right),n.cp1y=Ve(n.cp1y,t.top,t.bottom)),a&&(n.cp2x=Ve(n.cp2x,t.left,t.right),n.cp2y=Ve(n.cp2y,t.top,t.bottom)))}function Hl(i,t,e,s,n){let o,r,a,l;if(t.spanGaps&&(i=i.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")$l(i,n);else{let c=s?i[i.length-1]:i[0];for(o=0,r=i.length;o<r;++o)a=i[o],l=Fl(c,a,i[Math.min(o+1,r-(s?0:1))%r],t.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,c=a}t.capBezierPoints&&Nl(i,e)}function ns(){return typeof window<"u"&&typeof document<"u"}function os(i){let t=i.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function ai(i,t,e){let s;return typeof i=="string"?(s=parseInt(i,10),i.indexOf("%")!==-1&&(s=s/100*t.parentNode[e])):s=i,s}const di=i=>i.ownerDocument.defaultView.getComputedStyle(i,null);function Wl(i,t){return di(i).getPropertyValue(t)}const Vl=["top","right","bottom","left"];function Gt(i,t,e){const s={};e=e?"-"+e:"";for(let n=0;n<4;n++){const o=Vl[n];s[o]=parseFloat(i[t+"-"+o+e])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}const jl=(i,t,e)=>(i>0||t>0)&&(!e||!e.shadowRoot);function Ul(i,t){const e=i.touches,s=e&&e.length?e[0]:i,{offsetX:n,offsetY:o}=s;let r=!1,a,l;if(jl(n,o,i.target))a=n,l=o;else{const c=t.getBoundingClientRect();a=s.clientX-c.left,l=s.clientY-c.top,r=!0}return{x:a,y:l,box:r}}function Wt(i,t){if("native"in i)return i;const{canvas:e,currentDevicePixelRatio:s}=t,n=di(e),o=n.boxSizing==="border-box",r=Gt(n,"padding"),a=Gt(n,"border","width"),{x:l,y:c,box:h}=Ul(i,e),d=r.left+(h&&a.left),u=r.top+(h&&a.top);let{width:f,height:p}=t;return o&&(f-=r.width+a.width,p-=r.height+a.height),{x:Math.round((l-d)/f*e.width/s),y:Math.round((c-u)/p*e.height/s)}}function Yl(i,t,e){let s,n;if(t===void 0||e===void 0){const o=i&&os(i);if(!o)t=i.clientWidth,e=i.clientHeight;else{const r=o.getBoundingClientRect(),a=di(o),l=Gt(a,"border","width"),c=Gt(a,"padding");t=r.width-c.width-l.width,e=r.height-c.height-l.height,s=ai(a.maxWidth,o,"clientWidth"),n=ai(a.maxHeight,o,"clientHeight")}}return{width:t,height:e,maxWidth:s||oi,maxHeight:n||oi}}const je=i=>Math.round(i*10)/10;function Kl(i,t,e,s){const n=di(i),o=Gt(n,"margin"),r=ai(n.maxWidth,i,"clientWidth")||oi,a=ai(n.maxHeight,i,"clientHeight")||oi,l=Yl(i,t,e);let{width:c,height:h}=l;if(n.boxSizing==="content-box"){const u=Gt(n,"border","width"),f=Gt(n,"padding");c-=f.width+u.width,h-=f.height+u.height}return c=Math.max(0,c-o.width),h=Math.max(0,s?c/s:h-o.height),c=je(Math.min(c,r,l.maxWidth)),h=je(Math.min(h,a,l.maxHeight)),c&&!h&&(h=je(c/2)),(t!==void 0||e!==void 0)&&s&&l.height&&h>l.height&&(h=l.height,c=je(Math.floor(h*s))),{width:c,height:h}}function Os(i,t,e){const s=t||1,n=Math.floor(i.height*s),o=Math.floor(i.width*s);i.height=Math.floor(i.height),i.width=Math.floor(i.width);const r=i.canvas;return r.style&&(e||!r.style.height&&!r.style.width)&&(r.style.height=`${i.height}px`,r.style.width=`${i.width}px`),i.currentDevicePixelRatio!==s||r.height!==n||r.width!==o?(i.currentDevicePixelRatio=s,r.height=n,r.width=o,i.ctx.setTransform(s,0,0,s,0,0),!0):!1}const Xl=function(){let i=!1;try{const t={get passive(){return i=!0,!1}};ns()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return i}();function Ts(i,t){const e=Wl(i,t),s=e&&e.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}function Vt(i,t,e,s){return{x:i.x+e*(t.x-i.x),y:i.y+e*(t.y-i.y)}}function Gl(i,t,e,s){return{x:i.x+e*(t.x-i.x),y:s==="middle"?e<.5?i.y:t.y:s==="after"?e<1?i.y:t.y:e>0?t.y:i.y}}function Jl(i,t,e,s){const n={x:i.cp2x,y:i.cp2y},o={x:t.cp1x,y:t.cp1y},r=Vt(i,n,e),a=Vt(n,o,e),l=Vt(o,t,e),c=Vt(r,a,e),h=Vt(a,l,e);return Vt(c,h,e)}const ql=function(i,t){return{x(e){return i+i+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,s){return e-s},leftForLtr(e,s){return e-s}}},Ql=function(){return{x(i){return i},setWidth(i){},textAlign(i){return i},xPlus(i,t){return i+t},leftForLtr(i,t){return i}}};function ne(i,t,e){return i?ql(t,e):Ql()}function ho(i,t){let e,s;(t==="ltr"||t==="rtl")&&(e=i.canvas.style,s=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),i.prevTextDirection=s)}function uo(i,t){t!==void 0&&(delete i.prevTextDirection,i.canvas.style.setProperty("direction",t[0],t[1]))}function fo(i){return i==="angle"?{between:Xn,compare:Qa,normalize:Tt}:{between:Yt,compare:(t,e)=>t-e,normalize:t=>t}}function Ls({start:i,end:t,count:e,loop:s,style:n}){return{start:i%e,end:t%e,loop:s&&(t-i+1)%e===0,style:n}}function Zl(i,t,e){const{property:s,start:n,end:o}=e,{between:r,normalize:a}=fo(s),l=t.length;let{start:c,end:h,loop:d}=i,u,f;if(d){for(c+=l,h+=l,u=0,f=l;u<f&&r(a(t[c%l][s]),n,o);++u)c--,h--;c%=l,h%=l}return h<c&&(h+=l),{start:c,end:h,loop:d,style:i.style}}function tc(i,t,e){if(!e)return[i];const{property:s,start:n,end:o}=e,r=t.length,{compare:a,between:l,normalize:c}=fo(s),{start:h,end:d,loop:u,style:f}=Zl(i,t,e),p=[];let m=!1,b=null,_,x,S;const P=()=>l(n,S,_)&&a(n,S)!==0,v=()=>a(o,_)===0||l(o,S,_),D=()=>m||P(),w=()=>!m||v();for(let k=h,O=h;k<=d;++k)x=t[k%r],!x.skip&&(_=c(x[s]),_!==S&&(m=l(_,n,o),b===null&&D()&&(b=a(_,n)===0?k:O),b!==null&&w()&&(p.push(Ls({start:b,end:k,loop:u,count:r,style:f})),b=null),O=k,S=_));return b!==null&&p.push(Ls({start:b,end:d,loop:u,count:r,style:f})),p}function ec(i,t){const e=[],s=i.segments;for(let n=0;n<s.length;n++){const o=tc(s[n],i.points,t);o.length&&e.push(...o)}return e}function ic(i,t,e,s){let n=0,o=t-1;if(e&&!s)for(;n<t&&!i[n].skip;)n++;for(;n<t&&i[n].skip;)n++;for(n%=t,e&&(o+=n);o>n&&i[o%t].skip;)o--;return o%=t,{start:n,end:o}}function sc(i,t,e,s){const n=i.length,o=[];let r=t,a=i[t],l;for(l=t+1;l<=e;++l){const c=i[l%n];c.skip||c.stop?a.skip||(s=!1,o.push({start:t%n,end:(l-1)%n,loop:s}),t=r=c.stop?l:null):(r=l,a.skip&&(t=l)),a=c}return r!==null&&o.push({start:t%n,end:r%n,loop:s}),o}function nc(i,t){const e=i.points,s=i.options.spanGaps,n=e.length;if(!n)return[];const o=!!i._loop,{start:r,end:a}=ic(e,n,o,s);if(s===!0)return Rs(i,[{start:r,end:a,loop:o}],e,t);const l=a<r?a+n:a,c=!!i._fullLoop&&r===0&&a===n-1;return Rs(i,sc(e,r,l,c),e,t)}function Rs(i,t,e,s){return!s||!s.setContext||!e?t:oc(i,t,e,s)}function oc(i,t,e,s){const n=i._chart.getContext(),o=As(i.options),{_datasetIndex:r,options:{spanGaps:a}}=i,l=e.length,c=[];let h=o,d=t[0].start,u=d;function f(p,m,b,_){const x=a?-1:1;if(p!==m){for(p+=l;e[p%l].skip;)p-=x;for(;e[m%l].skip;)m+=x;p%l!==m%l&&(c.push({start:p%l,end:m%l,loop:b,style:_}),h=_,d=m%l)}}for(const p of t){d=a?d:p.start;let m=e[d%l],b;for(u=d+1;u<=p.end;u++){const _=e[u%l];b=As(s.setContext(qt(n,{type:"segment",p0:m,p1:_,p0DataIndex:(u-1)%l,p1DataIndex:u%l,datasetIndex:r}))),rc(b,h)&&f(d,u-1,p.loop,h),m=_,h=b}d<u-1&&f(d,u-1,p.loop,h)}return c}function As(i){return{backgroundColor:i.backgroundColor,borderCapStyle:i.borderCapStyle,borderDash:i.borderDash,borderDashOffset:i.borderDashOffset,borderJoinStyle:i.borderJoinStyle,borderWidth:i.borderWidth,borderColor:i.borderColor}}function rc(i,t){if(!t)return!1;const e=[],s=function(n,o){return Qi(o)?(e.includes(o)||e.push(o),e.indexOf(o)):o};return JSON.stringify(i,s)!==JSON.stringify(t,s)}/*!
* Chart.js v4.4.4
* https://www.chartjs.org
* (c) 2024 Chart.js Contributors
* Released under the MIT License
*/class ac{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,s,n){const o=e.listeners[n],r=e.duration;o.forEach(a=>a({chart:t,initial:e.initial,numSteps:r,currentStep:Math.min(s-e.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=qn.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((s,n)=>{if(!s.running||!s.items.length)return;const o=s.items;let r=o.length-1,a=!1,l;for(;r>=0;--r)l=o[r],l._active?(l._total>s.duration&&(s.duration=l._total),l.tick(t),a=!0):(o[r]=o[o.length-1],o.pop());a&&(n.draw(),this._notify(n,s,t,"progress")),o.length||(s.running=!1,this._notify(n,s,t,"complete"),s.initial=!1),e+=o.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let s=e.get(t);return s||(s={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,s)),s}listen(t,e,s){this._getAnims(t).listeners[e].push(s)}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((s,n)=>Math.max(s,n._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 s=e.items;let n=s.length-1;for(;n>=0;--n)s[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var kt=new ac;const Is="transparent",lc={boolean(i,t,e){return e>.5?t:i},color(i,t,e){const s=ws(i||Is),n=s.valid&&ws(t||Is);return n&&n.valid?n.mix(s,e).hexString():t},number(i,t,e){return i+(t-i)*e}};class cc{constructor(t,e,s,n){const o=e[s];n=We([t.to,n,o,t.from]);const r=We([t.from,o,n]);this._active=!0,this._fn=t.fn||lc[t.type||typeof r],this._easing=ke[t.easing]||ke.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=s,this._from=r,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,s){if(this._active){this._notify(!1);const n=this._target[this._prop],o=s-this._start,r=this._duration-o;this._start=s,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=We([t.to,e,n,t.from]),this._from=We([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,s=this._duration,n=this._prop,o=this._from,r=this._loop,a=this._to;let l;if(this._active=o!==a&&(r||e<s),!this._active){this._target[n]=a,this._notify(!0);return}if(e<0){this._target[n]=o;return}l=e/s%2,l=r&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[n]=this._fn(o,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,s)=>{t.push({res:e,rej:s})})}_notify(t){const e=t?"res":"rej",s=this._promises||[];for(let n=0;n<s.length;n++)s[n][e]()}}class go{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!E(t))return;const e=Object.keys(U.animation),s=this._properties;Object.getOwnPropertyNames(t).forEach(n=>{const o=t[n];if(!E(o))return;const r={};for(const a of e)r[a]=o[a];(G(o.properties)&&o.properties||[n]).forEach(a=>{(a===n||!s.has(a))&&s.set(a,r)})})}_animateOptions(t,e){const s=e.options,n=dc(t,s);if(!n)return[];const o=this._createAnimations(n,s);return s.$shared&&hc(t.options.$animations,s).then(()=>{t.options=s},()=>{}),o}_createAnimations(t,e){const s=this._properties,n=[],o=t.$animations||(t.$animations={}),r=Object.keys(e),a=Date.now();let l;for(l=r.length-1;l>=0;--l){const c=r[l];if(c.charAt(0)==="$")continue;if(c==="options"){n.push(...this._animateOptions(t,e));continue}const h=e[c];let d=o[c];const u=s.get(c);if(d)if(u&&d.active()){d.update(u,h,a);continue}else d.cancel();if(!u||!u.duration){t[c]=h;continue}o[c]=d=new cc(u,t,c,h),n.push(d)}return n}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const s=this._createAnimations(t,e);if(s.length)return kt.add(this._chart,s),!0}}function hc(i,t){const e=[],s=Object.keys(t);for(let n=0;n<s.length;n++){const o=i[s[n]];o&&o.active()&&e.push(o.wait())}return Promise.all(e)}function dc(i,t){if(!t)return;let e=i.options;if(!e){i.options=t;return}return e.$shared&&(i.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e}function Es(i,t){const e=i&&i.options||{},s=e.reverse,n=e.min===void 0?t:0,o=e.max===void 0?t:0;return{start:s?o:n,end:s?n:o}}function uc(i,t,e){if(e===!1)return!1;const s=Es(i,e),n=Es(t,e);return{top:n.end,right:s.end,bottom:n.start,left:s.start}}function fc(i){let t,e,s,n;return E(i)?(t=i.top,e=i.right,s=i.bottom,n=i.left):t=e=s=n=i,{top:t,right:e,bottom:s,left:n,disabled:i===!1}}function po(i,t){const e=[],s=i._getSortedDatasetMetas(t);let n,o;for(n=0,o=s.length;n<o;++n)e.push(s[n].index);return e}function Fs(i,t,e,s={}){const n=i.keys,o=s.mode==="single";let r,a,l,c;if(t!==null){for(r=0,a=n.length;r<a;++r){if(l=+n[r],l===e){if(s.all)continue;break}c=i.values[l],dt(c)&&(o||t===0||St(t)===St(c))&&(t+=c)}return t}}function gc(i,t){const{iScale:e,vScale:s}=t,n=e.axis==="x"?"x":"y",o=s.axis==="x"?"x":"y",r=Object.keys(i),a=new Array(r.length);let l,c,h;for(l=0,c=r.length;l<c;++l)h=r[l],a[l]={[n]:h,[o]:i[h]};return a}function Bs(i,t){const e=i&&i.options.stacked;return e||e===void 0&&t.stack!==void 0}function pc(i,t,e){return`${i.id}.${t.id}.${e.stack||e.type}`}function mc(i){const{min:t,max:e,minDefined:s,maxDefined:n}=i.getUserBounds();return{min:s?t:Number.NEGATIVE_INFINITY,max:n?e:Number.POSITIVE_INFINITY}}function bc(i,t,e){const s=i[t]||(i[t]={});return s[e]||(s[e]={})}function zs(i,t,e,s){for(const n of t.getMatchingVisibleMetas(s).reverse()){const o=i[n.index];if(e&&o>0||!e&&o<0)return n.index}return null}function $s(i,t){const{chart:e,_cachedMeta:s}=i,n=e._stacks||(e._stacks={}),{iScale:o,vScale:r,index:a}=s,l=o.axis,c=r.axis,h=pc(o,r,s),d=t.length;let u;for(let f=0;f<d;++f){const p=t[f],{[l]:m,[c]:b}=p,_=p._stacks||(p._stacks={});u=_[c]=bc(n,h,m),u[a]=b,u._top=zs(u,r,!0,s.type),u._bottom=zs(u,r,!1,s.type);const x=u._visualValues||(u._visualValues={});x[a]=b}}function _i(i,t){const e=i.scales;return Object.keys(e).filter(s=>e[s].axis===t).shift()}function _c(i,t){return qt(i,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function xc(i,t,e){return qt(i,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function fe(i,t){const e=i.controller.index,s=i.vScale&&i.vScale.axis;if(s){t=t||i._parsed;for(const n of t){const o=n._stacks;if(!o||o[s]===void 0||o[s][e]===void 0)return;delete o[s][e],o[s]._visualValues!==void 0&&o[s]._visualValues[e]!==void 0&&delete o[s]._visualValues[e]}}}const xi=i=>i==="reset"||i==="none",Ns=(i,t)=>t?i:Object.assign({},i),yc=(i,t,e)=>i&&!t.hidden&&t._stacked&&{keys:po(e,!0),values:null};class rs{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=Bs(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&&fe(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,s=this.getDataset(),n=(d,u,f,p)=>d==="x"?u:d==="r"?p:f,o=e.xAxisID=I(s.xAxisID,_i(t,"x")),r=e.yAxisID=I(s.yAxisID,_i(t,"y")),a=e.rAxisID=I(s.rAxisID,_i(t,"r")),l=e.indexAxis,c=e.iAxisID=n(l,o,r,a),h=e.vAxisID=n(l,r,o,a);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(r),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(c),e.vScale=this.getScaleForId(h)}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&&ys(this._data,this),t._stacked&&fe(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),s=this._data;if(E(e)){const n=this._cachedMeta;this._data=gc(e,n)}else if(s!==e){if(s){ys(s,this);const n=this._cachedMeta;fe(n),n._parsed=[]}e&&Object.isExtensible(e)&&il(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,s=this.getDataset();let n=!1;this._dataCheck();const o=e._stacked;e._stacked=Bs(e.vScale,e),e.stack!==s.stack&&(n=!0,fe(e),e.stack=s.stack),this._resyncElements(t),(n||o!==e._stacked)&&$s(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),s=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(s,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:s,_data:n}=this,{iScale:o,_stacked:r}=s,a=o.axis;let l=t===0&&e===n.length?!0:s._sorted,c=t>0&&s._parsed[t-1],h,d,u;if(this._parsing===!1)s._parsed=n,s._sorted=!0,u=n;else{G(n[t])?u=this.parseArrayData(s,n,t,e):E(n[t])?u=this.parseObjectData(s,n,t,e):u=this.parsePrimitiveData(s,n,t,e);const f=()=>d[a]===null||c&&d[a]<c[a];for(h=0;h<e;++h)s._parsed[h+t]=d=u[h],l&&(f()&&(l=!1),c=d);s._sorted=l}r&&$s(this,u)}parsePrimitiveData(t,e,s,n){const{iScale:o,vScale:r}=t,a=o.axis,l=r.axis,c=o.getLabels(),h=o===r,d=new Array(n);let u,f,p;for(u=0,f=n;u<f;++u)p=u+s,d[u]={[a]:h||o.parse(c[p],p),[l]:r.parse(e[p],p)};return d}parseArrayData(t,e,s,n){const{xScale:o,yScale:r}=t,a=new Array(n);let l,c,h,d;for(l=0,c=n;l<c;++l)h=l+s,d=e[h],a[l]={x:o.parse(d[0],h),y:r.parse(d[1],h)};return a}parseObjectData(t,e,s,n){const{xScale:o,yScale:r}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(n);let h,d,u,f;for(h=0,d=n;h<d;++h)u=h+s,f=e[u],c[h]={x:o.parse(re(f,a),u),y:r.parse(re(f,l),u)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,s){const n=this.chart,o=this._cachedMeta,r=e[t.axis],a={keys:po(n,!0),values:e._stacks[t.axis]._visualValues};return Fs(a,r,o.index,{mode:s})}updateRangeFromParsed(t,e,s,n){const o=s[e.axis];let r=o===null?NaN:o;const a=n&&s._stacks[e.axis];n&&a&&(n.values=a,r=Fs(n,o,this._cachedMeta.index)),t.min=Math.min(t.min,r),t.max=Math.max(t.max,r)}getMinMax(t,e){const s=this._cachedMeta,n=s._parsed,o=s._sorted&&t===s.iScale,r=n.length,a=this._getOtherScale(t),l=yc(e,s,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:d}=mc(a);let u,f;function p(){f=n[u];const m=f[a.axis];return!dt(f[t.axis])||h>m||d<m}for(u=0;u<r&&!(!p()&&(this.updateRangeFromParsed(c,t,f,l),o));++u);if(o){for(u=r-1;u>=0;--u)if(!p()){this.updateRangeFromParsed(c,t,f,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,s=[];let n,o,r;for(n=0,o=e.length;n<o;++n)r=e[n][t.axis],dt(r)&&s.push(r);return s}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,s=e.iScale,n=e.vScale,o=this.getParsed(t);return{label:s?""+s.getLabelForValue(o[s.axis]):"",value:n?""+n.getLabelForValue(o[n.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=fc(I(this.options.clip,uc(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,s=this._cachedMeta,n=s.data||[],o=e.chartArea,r=[],a=this._drawStart||0,l=this._drawCount||n.length-a,c=this.options.drawActiveElementsOnTop;let h;for(s.dataset&&s.dataset.draw(t,o,a,l),h=a;h<a+l;++h){const d=n[h];d.hidden||(d.active&&c?r.push(d):d.draw(t,o))}for(h=0;h<r.length;++h)r[h].draw(t,o)}getStyle(t,e){const s=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(s):this.resolveDataElementOptions(t||0,s)}getContext(t,e,s){const n=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const r=this._cachedMeta.data[t];o=r.$context||(r.$context=xc(this.getContext(),t,r)),o.parsed=this.getParsed(t),o.raw=n.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=_c(this.chart.getContext(),this.index)),o.dataset=n,o.index=o.datasetIndex=this.index;return o.active=!!e,o.mode=s,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",s){const n=e==="active",o=this._cachedDataOpts,r=t+"-"+e,a=o[r],l=this.enableOptionSharing&&De(s);if(a)return Ns(a,l);const c=this.chart.config,h=c.datasetElementScopeKeys(this._type,t),d=n?[`${t}Hover`,"hover",t,""]:[t,""],u=c.getOptionScopes(this.getDataset(),h),f=Object.keys(U.elements[t]),p=()=>this.getContext(s,n,e),m=c.resolveNamedOptions(u,f,p,d);return m.$shared&&(m.$shared=l,o[r]=Object.freeze(Ns(m,l))),m}_resolveAnimations(t,e,s){const n=this.chart,o=this._cachedDataOpts,r=`animation-${e}`,a=o[r];if(a)return a;let l;if(n.options.animation!==!1){const h=this.chart.config,d=h.datasetAnimationScopeKeys(this._type,e),u=h.getOptionScopes(this.getDataset(),d);l=h.createResolver(u,this.getContext(t,s,e))}const c=new go(n,l&&l.animations);return l&&l._cacheable&&(o[r]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||xi(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const s=this.resolveDataElementOptions(t,e),n=this._sharedOptions,o=this.getSharedOptions(s),r=this.includeOptions(e,o)||o!==n;return this.updateSharedOptions(o,e,s),{sharedOptions:o,includeOptions:r}}updateElement(t,e,s,n){xi(n)?Object.assign(t,s):this._resolveAnimations(e,n).update(t,s)}updateSharedOptions(t,e,s){t&&!xi(e)&&this._resolveAnimations(void 0,e).update(t,s)}_setStyle(t,e,s,n){t.active=n;const o=this.getStyle(e,n);this._resolveAnimations(e,s,n).update(t,{options:!n&&this.getSharedOptions(o)||o})}removeHoverStyle(t,e,s){this._setStyle(t,s,"active",!1)}setHoverStyle(t,e,s){this._setStyle(t,s,"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,s=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const n=s.length,o=e.length,r=Math.min(o,n);r&&this.parse(0,r),o>n?this._insertElements(n,o-n,t):o<n&&this._removeElements(o,n-o)}_insertElements(t,e,s=!0){const n=this._cachedMeta,o=n.data,r=t+e;let a;const l=c=>{for(c.length+=e,a=c.length-1;a>=r;a--)c[a]=c[a-e]};for(l(o),a=t;a<r;++a)o[a]=new this.dataElementType;this._parsing&&l(n._parsed),this.parse(t,e),s&&this.updateElements(o,t,e,"reset")}updateElements(t,e,s,n){}_removeElements(t,e){const s=this._cachedMeta;if(this._parsing){const n=s._parsed.splice(t,e);s._stacked&&fe(s,n)}s.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,s,n]=t;this[e](s,n)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const s=arguments.length-2;s&&this._sync(["_insertElements",t,s])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function vc(i,t){if(!i._cache.$bar){const e=i.getMatchingVisibleMetas(t);let s=[];for(let n=0,o=e.length;n<o;n++)s=s.concat(e[n].controller.getAllParsedValues(i));i._cache.$bar=Jn(s.sort((n,o)=>n-o))}return i._cache.$bar}function Sc(i){const t=i.iScale,e=vc(t,i.type);let s=t._length,n,o,r,a;const l=()=>{r===32767||r===-32768||(De(a)&&(s=Math.min(s,Math.abs(r-a)||s)),a=r)};for(n=0,o=e.length;n<o;++n)r=t.getPixelForValue(e[n]),l();for(a=void 0,n=0,o=t.ticks.length;n<o;++n)r=t.getPixelForTick(n),l();return s}function wc(i,t,e,s){const n=e.barThickness;let o,r;return W(n)?(o=t.min*e.categoryPercentage,r=e.barPercentage):(o=n*s,r=1),{chunk:o/s,ratio:r,start:t.pixels[i]-o/2}}function kc(i,t,e,s){const n=t.pixels,o=n[i];let r=i>0?n[i-1]:null,a=i<n.length-1?n[i+1]:null;const l=e.categoryPercentage;r===null&&(r=o-(a===null?t.end-t.start:a-o)),a===null&&(a=o+o-r);const c=o-(o-Math.min(r,a))/2*l;return{chunk:Math.abs(a-r)/2*l/s,ratio:e.barPercentage,start:c}}function Pc(i,t,e,s){const n=e.parse(i[0],s),o=e.parse(i[1],s),r=Math.min(n,o),a=Math.max(n,o);let l=r,c=a;Math.abs(r)>Math.abs(a)&&(l=a,c=r),t[e.axis]=c,t._custom={barStart:l,barEnd:c,start:n,end:o,min:r,max:a}}function mo(i,t,e,s){return G(i)?Pc(i,t,e,s):t[e.axis]=e.parse(i,s),t}function Hs(i,t,e,s){const n=i.iScale,o=i.vScale,r=n.getLabels(),a=n===o,l=[];let c,h,d,u;for(c=e,h=e+s;c<h;++c)u=t[c],d={},d[n.axis]=a||n.parse(r[c],c),l.push(mo(u,d,o,c));return l}function yi(i){return i&&i.barStart!==void 0&&i.barEnd!==void 0}function Mc(i,t,e){return i!==0?St(i):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function Cc(i){let t,e,s,n,o;return i.horizontal?(t=i.base>i.x,e="left",s="right"):(t=i.base<i.y,e="bottom",s="top"),t?(n="end",o="start"):(n="start",o="end"),{start:e,end:s,reverse:t,top:n,bottom:o}}function Dc(i,t,e,s){let n=t.borderSkipped;const o={};if(!n){i.borderSkipped=o;return}if(n===!0){i.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:r,end:a,reverse:l,top:c,bottom:h}=Cc(i);n==="middle"&&e&&(i.enableBorderRadius=!0,(e._top||0)===s?n=c:(e._bottom||0)===s?n=h:(o[Ws(h,r,a,l)]=!0,n=c)),o[Ws(n,r,a,l)]=!0,i.borderSkipped=o}function Ws(i,t,e,s){return s?(i=Oc(i,t,e),i=Vs(i,e,t)):i=Vs(i,t,e),i}function Oc(i,t,e){return i===t?e:i===e?t:i}function Vs(i,t,e){return i==="start"?t:i==="end"?e:i}function Tc(i,{inflateAmount:t},e){i.inflateAmount=t==="auto"?e===1?.33:0:t}class bo extends rs{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(t,e,s,n){return Hs(t,e,s,n)}parseArrayData(t,e,s,n){return Hs(t,e,s,n)}parseObjectData(t,e,s,n){const{iScale:o,vScale:r}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=o.axis==="x"?a:l,h=r.axis==="x"?a:l,d=[];let u,f,p,m;for(u=s,f=s+n;u<f;++u)m=e[u],p={},p[o.axis]=o.parse(re(m,c),u),d.push(mo(re(m,h),p,r,u));return d}updateRangeFromParsed(t,e,s,n){super.updateRangeFromParsed(t,e,s,n);const o=s._custom;o&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,o.min),t.max=Math.max(t.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:s,vScale:n}=e,o=this.getParsed(t),r=o._custom,a=yi(r)?"["+r.start+", "+r.end+"]":""+n.getLabelForValue(o[n.axis]);return{label:""+s.getLabelForValue(o[s.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,s,n){const o=n==="reset",{index:r,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),c=a.isHorizontal(),h=this._getRuler(),{sharedOptions:d,includeOptions:u}=this._getSharedOptions(e,n);for(let f=e;f<e+s;f++){const p=this.getParsed(f),m=o||W(p[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(f),b=this._calculateBarIndexPixels(f,h),_=(p._stacks||{})[a.axis],x={horizontal:c,base:m.base,enableBorderRadius:!_||yi(p._custom)||r===_._top||r===_._bottom,x:c?m.head:b.center,y:c?b.center:m.head,height:c?b.size:Math.abs(m.size),width:c?Math.abs(m.size):b.size};u&&(x.options=d||this.resolveDataElementOptions(f,t[f].active?"active":n));const S=x.options||t[f].options;Dc(x,S,_,r),Tc(x,S,h.ratio),this.updateElement(t[f],f,x,n)}}_getStacks(t,e){const{iScale:s}=this._cachedMeta,n=s.getMatchingVisibleMetas(this._type).filter(h=>h.controller.options.grouped),o=s.options.stacked,r=[],a=this._cachedMeta.controller.getParsed(e),l=a&&a[s.axis],c=h=>{const d=h._parsed.find(f=>f[s.axis]===l),u=d&&d[h.vScale.axis];if(W(u)||isNaN(u))return!0};for(const h of n)if(!(e!==void 0&&c(h))&&((o===!1||r.indexOf(h.stack)===-1||o===void 0&&h.stack===void 0)&&r.push(h.stack),h.index===t))break;return r.length||r.push(void 0),r}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,s){const n=this._getStacks(t,s),o=e!==void 0?n.indexOf(e):-1;return o===-1?n.length-1:o}_getRuler(){const t=this.options,e=this._cachedMeta,s=e.iScale,n=[];let o,r;for(o=0,r=e.data.length;o<r;++o)n.push(s.getPixelForValue(this.getParsed(o)[s.axis],o));const a=t.barThickness;return{min:a||Sc(e),pixels:n,start:s._startPixel,end:s._endPixel,stackCount:this._getStackCount(),scale:s,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:s,index:n},options:{base:o,minBarLength:r}}=this,a=o||0,l=this.getParsed(t),c=l._custom,h=yi(c);let d=l[e.axis],u=0,f=s?this.applyStack(e,l,s):d,p,m;f!==d&&(u=f-d,f=d),h&&(d=c.barStart,f=c.barEnd-c.barStart,d!==0&&St(d)!==St(c.barEnd)&&(u=0),u+=d);const b=!W(o)&&!h?o:u;let _=e.getPixelForValue(b);if(this.chart.getDataVisibility(t)?p=e.getPixelForValue(u+f):p=_,m=p-_,Math.abs(m)<r){m=Mc(m,e,a)*r,d===a&&(_-=m/2);const x=e.getPixelForDecimal(0),S=e.getPixelForDecimal(1),P=Math.min(x,S),v=Math.max(x,S);_=Math.max(Math.min(_,v),P),p=_+m,s&&!h&&(l._stacks[e.axis]._visualValues[n]=e.getValueForPixel(p)-e.getValueForPixel(_))}if(_===e.getPixelForValue(a)){const x=St(m)*e.getLineWidthForValue(a)/2;_+=x,m-=x}return{size:m,base:_,head:p,center:p+m/2}}_calculateBarIndexPixels(t,e){const s=e.scale,n=this.options,o=n.skipNull,r=I(n.maxBarThickness,1/0);let a,l;if(e.grouped){const c=o?this._getStackCount(t):e.stackCount,h=n.barThickness==="flex"?kc(t,e,n,c):wc(t,e,n,c),d=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0);a=h.start+h.chunk*d+h.chunk/2,l=Math.min(r,h.chunk*h.ratio)}else a=s.getPixelForValue(this.getParsed(t)[s.axis],t),l=Math.min(r,e.min*e.ratio);return{base:a-l/2,head:a+l/2,center:a,size:l}}draw(){const t=this._cachedMeta,e=t.vScale,s=t.data,n=s.length;let o=0;for(;o<n;++o)this.getParsed(o)[e.axis]!==null&&!s[o].hidden&&s[o].draw(this._ctx)}}class _o extends rs{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:s,data:n=[],_dataset:o}=e,r=this.chart._animationsDisabled;let{start:a,count:l}=ol(e,n,r);this._drawStart=a,this._drawCount=l,rl(e)&&(a=0,l=n.length),s._chart=this.chart,s._datasetIndex=this.index,s._decimated=!!o._decimated,s.points=n;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(s,void 0,{animated:!r,options:c},t),this.updateElements(n,a,l,t)}updateElements(t,e,s,n){const o=n==="reset",{iScale:r,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:h,includeOptions:d}=this._getSharedOptions(e,n),u=r.axis,f=a.axis,{spanGaps:p,segment:m}=this.options,b=Oe(p)?p:Number.POSITIVE_INFINITY,_=this.chart._animationsDisabled||o||n==="none",x=e+s,S=t.length;let P=e>0&&this.getParsed(e-1);for(let v=0;v<S;++v){const D=t[v],w=_?D:{};if(v<e||v>=x){w.skip=!0;continue}const k=this.getParsed(v),O=W(k[f]),A=w[u]=r.getPixelForValue(k[u],v),y=w[f]=o||O?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,k,l):k[f],v);w.skip=isNaN(A)||isNaN(y)||O,w.stop=v>0&&Math.abs(k[u]-P[u])>b,m&&(w.parsed=k,w.raw=c.data[v]),d&&(w.options=h||this.resolveDataElementOptions(v,D.active?"active":n)),_||this.updateElement(D,v,w,n),P=k}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,s=e.options&&e.options.borderWidth||0,n=t.data||[];if(!n.length)return s;const o=n[0].size(this.resolveDataElementOptions(0)),r=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(s,o,r)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}function Ht(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class as{static override(t){Object.assign(as.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return Ht()}parse(){return Ht()}format(){return Ht()}add(){return Ht()}diff(){return Ht()}startOf(){return Ht()}endOf(){return Ht()}}var Lc={_date:as};function Rc(i,t,e,s){const{controller:n,data:o,_sorted:r}=i,a=n._cachedMeta.iScale;if(a&&t===a.axis&&t!=="r"&&r&&o.length){const l=a._reversePixels?tl:Kt;if(s){if(n._sharedOptions){const c=o[0],h=typeof c.getRange=="function"&&c.getRange(t);if(h){const d=l(o,t,e-h),u=l(o,t,e+h);return{lo:d.lo,hi:u.hi}}}}else return l(o,t,e)}return{lo:0,hi:o.length-1}}function Ie(i,t,e,s,n){const o=i.getSortedVisibleDatasetMetas(),r=e[t];for(let a=0,l=o.length;a<l;++a){const{index:c,data:h}=o[a],{lo:d,hi:u}=Rc(o[a],t,r,n);for(let f=d;f<=u;++f){const p=h[f];p.skip||s(p,c,f)}}}function Ac(i){const t=i.indexOf("x")!==-1,e=i.indexOf("y")!==-1;return function(s,n){const o=t?Math.abs(s.x-n.x):0,r=e?Math.abs(s.y-n.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(r,2))}}function vi(i,t,e,s,n){const o=[];return!n&&!i.isPointInArea(t)||Ie(i,e,t,function(a,l,c){!n&&!Te(a,i.chartArea,0)||a.inRange(t.x,t.y,s)&&o.push({element:a,datasetIndex:l,index:c})},!0),o}function Ic(i,t,e,s){let n=[];function o(r,a,l){const{startAngle:c,endAngle:h}=r.getProps(["startAngle","endAngle"],s),{angle:d}=qa(r,{x:t.x,y:t.y});Xn(d,c,h)&&n.push({element:r,datasetIndex:a,index:l})}return Ie(i,e,t,o),n}function Ec(i,t,e,s,n,o){let r=[];const a=Ac(e);let l=Number.POSITIVE_INFINITY;function c(h,d,u){const f=h.inRange(t.x,t.y,n);if(s&&!f)return;const p=h.getCenterPoint(n);if(!(!!o||i.isPointInArea(p))&&!f)return;const b=a(t,p);b<l?(r=[{element:h,datasetIndex:d,index:u}],l=b):b===l&&r.push({element:h,datasetIndex:d,index:u})}return Ie(i,e,t,c),r}function Si(i,t,e,s,n,o){return!o&&!i.isPointInArea(t)?[]:e==="r"&&!s?Ic(i,t,e,n):Ec(i,t,e,s,n,o)}function js(i,t,e,s,n){const o=[],r=e==="x"?"inXRange":"inYRange";let a=!1;return Ie(i,e,t,(l,c,h)=>{l[r]&&l[r](t[e],n)&&(o.push({element:l,datasetIndex:c,index:h}),a=a||l.inRange(t.x,t.y,n))}),s&&!a?[]:o}var Fc={evaluateInteractionItems:Ie,modes:{index(i,t,e,s){const n=Wt(t,i),o=e.axis||"x",r=e.includeInvisible||!1,a=e.intersect?vi(i,n,o,s,r):Si(i,n,o,!1,s,r),l=[];return a.length?(i.getSortedVisibleDatasetMetas().forEach(c=>{const h=a[0].index,d=c.data[h];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:h})}),l):[]},dataset(i,t,e,s){const n=Wt(t,i),o=e.axis||"xy",r=e.includeInvisible||!1;let a=e.intersect?vi(i,n,o,s,r):Si(i,n,o,!1,s,r);if(a.length>0){const l=a[0].datasetIndex,c=i.getDatasetMeta(l).data;a=[];for(let h=0;h<c.length;++h)a.push({element:c[h],datasetIndex:l,index:h})}return a},point(i,t,e,s){const n=Wt(t,i),o=e.axis||"xy",r=e.includeInvisible||!1;return vi(i,n,o,s,r)},nearest(i,t,e,s){const n=Wt(t,i),o=e.axis||"xy",r=e.includeInvisible||!1;return Si(i,n,o,e.intersect,s,r)},x(i,t,e,s){const n=Wt(t,i);return js(i,n,"x",e.intersect,s)},y(i,t,e,s){const n=Wt(t,i);return js(i,n,"y",e.intersect,s)}}};const xo=["left","top","right","bottom"];function ge(i,t){return i.filter(e=>e.pos===t)}function Us(i,t){return i.filter(e=>xo.indexOf(e.pos)===-1&&e.box.axis===t)}function pe(i,t){return i.sort((e,s)=>{const n=t?s:e,o=t?e:s;return n.weight===o.weight?n.index-o.index:n.weight-o.weight})}function Bc(i){const t=[];let e,s,n,o,r,a;for(e=0,s=(i||[]).length;e<s;++e)n=i[e],{position:o,options:{stack:r,stackWeight:a=1}}=n,t.push({index:e,box:n,pos:o,horizontal:n.isHorizontal(),weight:n.weight,stack:r&&o+r,stackWeight:a});return t}function zc(i){const t={};for(const e of i){const{stack:s,pos:n,stackWeight:o}=e;if(!s||!xo.includes(n))continue;const r=t[s]||(t[s]={count:0,placed:0,weight:0,size:0});r.count++,r.weight+=o}return t}function $c(i,t){const e=zc(i),{vBoxMaxWidth:s,hBoxMaxHeight:n}=t;let o,r,a;for(o=0,r=i.length;o<r;++o){a=i[o];const{fullSize:l}=a.box,c=e[a.stack],h=c&&a.stackWeight/c.weight;a.horizontal?(a.width=h?h*s:l&&t.availableWidth,a.height=n):(a.width=s,a.height=h?h*n:l&&t.availableHeight)}return e}function Nc(i){const t=Bc(i),e=pe(t.filter(c=>c.box.fullSize),!0),s=pe(ge(t,"left"),!0),n=pe(ge(t,"right")),o=pe(ge(t,"top"),!0),r=pe(ge(t,"bottom")),a=Us(t,"x"),l=Us(t,"y");return{fullSize:e,leftAndTop:s.concat(o),rightAndBottom:n.concat(l).concat(r).concat(a),chartArea:ge(t,"chartArea"),vertical:s.concat(n).concat(l),horizontal:o.concat(r).concat(a)}}function Ys(i,t,e,s){return Math.max(i[e],t[e])+Math.max(i[s],t[s])}function yo(i,t){i.top=Math.max(i.top,t.top),i.left=Math.max(i.left,t.left),i.bottom=Math.max(i.bottom,t.bottom),i.right=Math.max(i.right,t.right)}function Hc(i,t,e,s){const{pos:n,box:o}=e,r=i.maxPadding;if(!E(n)){e.size&&(i[n]-=e.size);const d=s[e.stack]||{size:0,count:1};d.size=Math.max(d.size,e.horizontal?o.height:o.width),e.size=d.size/d.count,i[n]+=e.size}o.getPadding&&yo(r,o.getPadding());const a=Math.max(0,t.outerWidth-Ys(r,i,"left","right")),l=Math.max(0,t.outerHeight-Ys(r,i,"top","bottom")),c=a!==i.w,h=l!==i.h;return i.w=a,i.h=l,e.horizontal?{same:c,other:h}:{same:h,other:c}}function Wc(i){const t=i.maxPadding;function e(s){const n=Math.max(t[s]-i[s],0);return i[s]+=n,n}i.y+=e("top"),i.x+=e("left"),e("right"),e("bottom")}function Vc(i,t){const e=t.maxPadding;function s(n){const o={left:0,top:0,right:0,bottom:0};return n.forEach(r=>{o[r]=Math.max(t[r],e[r])}),o}return s(i?["left","right"]:["top","bottom"])}function ye(i,t,e,s){const n=[];let o,r,a,l,c,h;for(o=0,r=i.length,c=0;o<r;++o){a=i[o],l=a.box,l.update(a.width||t.w,a.height||t.h,Vc(a.horizontal,t));const{same:d,other:u}=Hc(t,e,a,s);c|=d&&n.length,h=h||u,l.fullSize||n.push(a)}return c&&ye(n,t,e,s)||h}function Ue(i,t,e,s,n){i.top=e,i.left=t,i.right=t+s,i.bottom=e+n,i.width=s,i.height=n}function Ks(i,t,e,s){const n=e.padding;let{x:o,y:r}=t;for(const a of i){const l=a.box,c=s[a.stack]||{count:1,placed:0,weight:1},h=a.stackWeight/c.weight||1;if(a.horizontal){const d=t.w*h,u=c.size||l.height;De(c.start)&&(r=c.start),l.fullSize?Ue(l,n.left,r,e.outerWidth-n.right-n.left,u):Ue(l,t.left+c.placed,r,d,u),c.start=r,c.placed+=d,r=l.bottom}else{const d=t.h*h,u=c.size||l.width;De(c.start)&&(o=c.start),l.fullSize?Ue(l,o,n.top,u,e.outerHeight-n.bottom-n.top):Ue(l,o,t.top+c.placed,u,d),c.start=o,c.placed+=d,o=l.right}}t.x=o,t.y=r}var ct={addBox(i,t){i.boxes||(i.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},i.boxes.push(t)},removeBox(i,t){const e=i.boxes?i.boxes.indexOf(t):-1;e!==-1&&i.boxes.splice(e,1)},configure(i,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight},update(i,t,e,s){if(!i)return;const n=ut(i.options.layout.padding),o=Math.max(t-n.width,0),r=Math.max(e-n.height,0),a=Nc(i.boxes),l=a.vertical,c=a.horizontal;z(i.boxes,m=>{typeof m.beforeLayout=="function"&&m.beforeLayout()});const h=l.reduce((m,b)=>b.box.options&&b.box.options.display===!1?m:m+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:e,padding:n,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/h,hBoxMaxHeight:r/2}),u=Object.assign({},n);yo(u,ut(s));const f=Object.assign({maxPadding:u,w:o,h:r,x:n.left,y:n.top},n),p=$c(l.concat(c),d);ye(a.fullSize,f,d,p),ye(l,f,d,p),ye(c,f,d,p)&&ye(l,f,d,p),Wc(f),Ks(a.leftAndTop,f,d,p),f.x+=f.w,f.y+=f.h,Ks(a.rightAndBottom,f,d,p),i.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},z(a.chartArea,m=>{const b=m.box;Object.assign(b,i.chartArea),b.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class vo{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,s){}removeEventListener(t,e,s){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,s,n){return e=Math.max(0,e||t.width),s=s||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):s)}}isAttached(t){return!0}updateConfig(t){}}class jc extends vo{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const ti="$chartjs",Uc={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Xs=i=>i===null||i==="";function Yc(i,t){const e=i.style,s=i.getAttribute("height"),n=i.getAttribute("width");if(i[ti]={initial:{height:s,width:n,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",Xs(n)){const o=Ts(i,"width");o!==void 0&&(i.width=o)}if(Xs(s))if(i.style.height==="")i.height=i.width/(t||2);else{const o=Ts(i,"height");o!==void 0&&(i.height=o)}return i}const So=Xl?{passive:!0}:!1;function Kc(i,t,e){i&&i.addEventListener(t,e,So)}function Xc(i,t,e){i&&i.canvas&&i.canvas.removeEventListener(t,e,So)}function Gc(i,t){const e=Uc[i.type]||i.type,{x:s,y:n}=Wt(i,t);return{type:e,chart:t,native:i,x:s!==void 0?s:null,y:n!==void 0?n:null}}function li(i,t){for(const e of i)if(e===t||e.contains(t))return!0}function Jc(i,t,e){const s=i.canvas,n=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||li(a.addedNodes,s),r=r&&!li(a.removedNodes,s);r&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}function qc(i,t,e){const s=i.canvas,n=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||li(a.removedNodes,s),r=r&&!li(a.addedNodes,s);r&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}const Re=new Map;let Gs=0;function wo(){const i=window.devicePixelRatio;i!==Gs&&(Gs=i,Re.forEach((t,e)=>{e.currentDevicePixelRatio!==i&&t()}))}function Qc(i,t){Re.size||window.addEventListener("resize",wo),Re.set(i,t)}function Zc(i){Re.delete(i),Re.size||window.removeEventListener("resize",wo)}function th(i,t,e){const s=i.canvas,n=s&&os(s);if(!n)return;const o=Qn((a,l)=>{const c=n.clientWidth;e(a,l),c<n.clientWidth&&e()},window),r=new ResizeObserver(a=>{const l=a[0],c=l.contentRect.width,h=l.contentRect.height;c===0&&h===0||o(c,h)});return r.observe(n),Qc(i,o),r}function wi(i,t,e){e&&e.disconnect(),t==="resize"&&Zc(i)}function eh(i,t,e){const s=i.canvas,n=Qn(o=>{i.ctx!==null&&e(Gc(o,i))},i);return Kc(s,t,n),n}class ih extends vo{acquireContext(t,e){const s=t&&t.getContext&&t.getContext("2d");return s&&s.canvas===t?(Yc(t,e),s):null}releaseContext(t){const e=t.canvas;if(!e[ti])return!1;const s=e[ti].initial;["height","width"].forEach(o=>{const r=s[o];W(r)?e.removeAttribute(o):e.setAttribute(o,r)});const n=s.style||{};return Object.keys(n).forEach(o=>{e.style[o]=n[o]}),e.width=e.width,delete e[ti],!0}addEventListener(t,e,s){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),r={attach:Jc,detach:qc,resize:th}[e]||eh;n[e]=r(t,e,s)}removeEventListener(t,e){const s=t.$proxies||(t.$proxies={}),n=s[e];if(!n)return;({attach:wi,detach:wi,resize:wi}[e]||Xc)(t,e,n),s[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,s,n){return Kl(t,e,s,n)}isAttached(t){const e=t&&os(t);return!!(e&&e.isConnected)}}function sh(i){return!ns()||typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas?jc:ih}class Et{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:e,y:s}=this.getProps(["x","y"],t);return{x:e,y:s}}hasValue(){return Oe(this.x)&&Oe(this.y)}getProps(t,e){const s=this.$animations;if(!e||!s)return this;const n={};return t.forEach(o=>{n[o]=s[o]&&s[o].active()?s[o]._to:this[o]}),n}}function nh(i,t){const e=i.options.ticks,s=oh(i),n=Math.min(e.maxTicksLimit||s,s),o=e.major.enabled?ah(t):[],r=o.length,a=o[0],l=o[r-1],c=[];if(r>n)return lh(t,c,o,r/n),c;const h=rh(o,t,n);if(r>0){let d,u;const f=r>1?Math.round((l-a)/(r-1)):null;for(Ye(t,c,h,W(f)?0:a-f,a),d=0,u=r-1;d<u;d++)Ye(t,c,h,o[d],o[d+1]);return Ye(t,c,h,l,W(f)?t.length:l+f),c}return Ye(t,c,h),c}function oh(i){const t=i.options.offset,e=i._tickSize(),s=i._length/e+(t?0:1),n=i._maxLength/e;return Math.floor(Math.min(s,n))}function rh(i,t,e){const s=ch(i),n=t.length/e;if(!s)return Math.max(n,1);const o=Ka(s);for(let r=0,a=o.length-1;r<a;r++){const l=o[r];if(l>n)return l}return Math.max(n,1)}function ah(i){const t=[];let e,s;for(e=0,s=i.length;e<s;e++)i[e].major&&t.push(e);return t}function lh(i,t,e,s){let n=0,o=e[0],r;for(s=Math.ceil(s),r=0;r<i.length;r++)r===o&&(t.push(i[r]),n++,o=e[n*s])}function Ye(i,t,e,s,n){const o=I(s,0),r=Math.min(I(n,i.length),i.length);let a=0,l,c,h;for(e=Math.ceil(e),n&&(l=n-s,e=l/Math.floor(l/e)),h=o;h<0;)a++,h=Math.round(o+a*e);for(c=Math.max(o,0);c<r;c++)c===h&&(t.push(i[c]),a++,h=Math.round(o+a*e))}function ch(i){const t=i.length;let e,s;if(t<2)return!1;for(s=i[0],e=1;e<t;++e)if(i[e]-i[e-1]!==s)return!1;return s}const hh=i=>i==="left"?"right":i==="right"?"left":i,Js=(i,t,e)=>t==="top"||t==="left"?i[t]+e:i[t]-e,qs=(i,t)=>Math.min(t||i,i);function Qs(i,t){const e=[],s=i.length/t,n=i.length;let o=0;for(;o<n;o+=s)e.push(i[Math.floor(o)]);return e}function dh(i,t,e){const s=i.ticks.length,n=Math.min(t,s-1),o=i._startPixel,r=i._endPixel,a=1e-6;let l=i.getPixelForTick(n),c;if(!(e&&(s===1?c=Math.max(l-o,r-l):t===0?c=(i.getPixelForTick(1)-l)/2:c=(l-i.getPixelForTick(n-1))/2,l+=n<t?c:-c,l<o-a||l>r+a)))return l}function uh(i,t){z(i,e=>{const s=e.gc,n=s.length/2;let o;if(n>t){for(o=0;o<n;++o)delete e.data[s[o]];s.splice(0,n)}})}function me(i){return i.drawTicks?i.tickLength:0}function Zs(i,t){if(!i.display)return 0;const e=Z(i.font,t),s=ut(i.padding);return(G(i.text)?i.text.length:1)*e.lineHeight+s.height}function fh(i,t){return qt(i,{scale:t,type:"scale"})}function gh(i,t,e){return qt(i,{tick:e,index:t,type:"tick"})}function ph(i,t,e){let s=qi(i);return(e&&t!=="right"||!e&&t==="right")&&(s=hh(s)),s}function mh(i,t,e,s){const{top:n,left:o,bottom:r,right:a,chart:l}=i,{chartArea:c,scales:h}=l;let d=0,u,f,p;const m=r-n,b=a-o;if(i.isHorizontal()){if(f=Q(s,o,a),E(e)){const _=Object.keys(e)[0],x=e[_];p=h[_].getPixelForValue(x)+m-t}else e==="center"?p=(c.bottom+c.top)/2+m-t:p=Js(i,e,t);u=a-o}else{if(E(e)){const _=Object.keys(e)[0],x=e[_];f=h[_].getPixelForValue(x)-b+t}else e==="center"?f=(c.left+c.right)/2-b+t:f=Js(i,e,t);p=Q(s,r,n),d=e==="left"?-gt:gt}return{titleX:f,titleY:p,maxWidth:u,rotation:d}}class ce extends Et{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:s,_suggestedMax:n}=this;return t=mt(t,Number.POSITIVE_INFINITY),e=mt(e,Number.NEGATIVE_INFINITY),s=mt(s,Number.POSITIVE_INFINITY),n=mt(n,Number.NEGATIVE_INFINITY),{min:mt(t,s),max:mt(e,n),minDefined:dt(t),maxDefined:dt(e)}}getMinMax(t){let{min:e,max:s,minDefined:n,maxDefined:o}=this.getUserBounds(),r;if(n&&o)return{min:e,max:s};const a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)r=a[l].controller.getMinMax(this,t),n||(e=Math.min(e,r.min)),o||(s=Math.max(s,r.max));return e=o&&e>s?s:e,s=n&&e>s?e:s,{min:mt(e,mt(s,e)),max:mt(s,mt(e,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){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){V(this.options.beforeUpdate,[this])}update(t,e,s){const{beginAtZero:n,grace:o,ticks:r}=this.options,a=r.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=s=Object.assign({left:0,right:0,top:0,bottom:0},s),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+s.left+s.right:this.height+s.top+s.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Pl(this,o,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?Qs(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||r.source==="auto")&&(this.ticks=nh(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,e,s;this.isHorizontal()?(e=this.left,s=this.right):(e=this.top,s=this.bottom,t=!t),this._startPixel=e,this._endPixel=s,this._reversePixels=t,this._length=s-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){V(this.options.afterUpdate,[this])}beforeSetDimensions(){V(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){V(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),V(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){V(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let s,n,o;for(s=0,n=t.length;s<n;s++)o=t[s],o.label=V(e.callback,[o.value,s,t],this)}afterTickToLabelConversion(){V(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){V(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,s=qs(this.ticks.length,t.ticks.maxTicksLimit),n=e.minRotation||0,o=e.maxRotation;let r=n,a,l,c;if(!this._isVisible()||!e.display||n>=o||s<=1||!this.isHorizontal()){this.labelRotation=n;return}const h=this._getLabelSizes(),d=h.widest.width,u=h.highest.height,f=nt(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/s:f/(s-1),d+6>a&&(a=f/(s-(t.offset?.5:1)),l=this.maxHeight-me(t.grid)-e.padding-Zs(t.title,this.chart.options.font),c=Math.sqrt(d*d+u*u),r=Ja(Math.min(Math.asin(nt((h.highest.height+6)/a,-1,1)),Math.asin(nt(l/c,-1,1))-Math.asin(nt(u/c,-1,1)))),r=Math.max(n,Math.min(o,r))),this.labelRotation=r}afterCalculateLabelRotation(){V(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){V(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:s,title:n,grid:o}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){const l=Zs(n,e.options.font);if(a?(t.width=this.maxWidth,t.height=me(o)+l):(t.height=this.maxHeight,t.width=me(o)+l),s.display&&this.ticks.length){const{first:c,last:h,widest:d,highest:u}=this._getLabelSizes(),f=s.padding*2,p=Ut(this.labelRotation),m=Math.cos(p),b=Math.sin(p);if(a){const _=s.mirror?0:b*d.width+m*u.height;t.height=Math.min(this.maxHeight,t.height+_+f)}else{const _=s.mirror?0:m*d.width+b*u.height;t.width=Math.min(this.maxWidth,t.width+_+f)}this._calculatePadding(c,h,b,m)}}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,s,n){const{ticks:{align:o,padding:r},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const h=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let u=0,f=0;l?c?(u=n*t.width,f=s*e.height):(u=s*t.height,f=n*e.width):o==="start"?f=e.width:o==="end"?u=t.width:o!=="inner"&&(u=t.width/2,f=e.width/2),this.paddingLeft=Math.max((u-h+r)*this.width/(this.width-h),0),this.paddingRight=Math.max((f-d+r)*this.width/(this.width-d),0)}else{let h=e.height/2,d=t.height/2;o==="start"?(h=0,d=t.height):o==="end"&&(h=e.height,d=0),this.paddingTop=h+r,this.paddingBottom=d+r}}_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(){V(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,s;for(e=0,s=t.length;e<s;e++)W(t[e].label)&&(t.splice(e,1),s--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let s=this.ticks;e<s.length&&(s=Qs(s,e)),this._labelSizes=t=this._computeLabelSizes(s,s.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,s){const{ctx:n,_longestTextCache:o}=this,r=[],a=[],l=Math.floor(e/qs(e,s));let c=0,h=0,d,u,f,p,m,b,_,x,S,P,v;for(d=0;d<e;d+=l){if(p=t[d].label,m=this._resolveTickFontOptions(d),n.font=b=m.string,_=o[b]=o[b]||{data:{},gc:[]},x=m.lineHeight,S=P=0,!W(p)&&!G(p))S=Ps(n,_.data,_.gc,S,p),P=x;else if(G(p))for(u=0,f=p.length;u<f;++u)v=p[u],!W(v)&&!G(v)&&(S=Ps(n,_.data,_.gc,S,v),P+=x);r.push(S),a.push(P),c=Math.max(S,c),h=Math.max(P,h)}uh(o,e);const D=r.indexOf(c),w=a.indexOf(h),k=O=>({width:r[O]||0,height:a[O]||0});return{first:k(0),last:k(e-1),widest:k(D),highest:k(w),widths:r,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 Za(this._alignToPixels?Nt(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&&t<e.length){const s=e[t];return s.$context||(s.$context=gh(this.getContext(),t,s))}return this.$context||(this.$context=fh(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=Ut(this.labelRotation),s=Math.abs(Math.cos(e)),n=Math.abs(Math.sin(e)),o=this._getLabelSizes(),r=t.autoSkipPadding||0,a=o?o.widest.width+r:0,l=o?o.highest.height+r:0;return this.isHorizontal()?l*s>a*n?a/s:l/n:l*n<a*s?l/s:a/n}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,s=this.chart,n=this.options,{grid:o,position:r,border:a}=n,l=o.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),u=me(o),f=[],p=a.setContext(this.getContext()),m=p.display?p.width:0,b=m/2,_=function(Y){return Nt(s,Y,m)};let x,S,P,v,D,w,k,O,A,y,T,K;if(r==="top")x=_(this.bottom),w=this.bottom-u,O=x-b,y=_(t.top)+b,K=t.bottom;else if(r==="bottom")x=_(this.top),y=t.top,K=_(t.bottom)-b,w=x+b,O=this.top+u;else if(r==="left")x=_(this.right),D=this.right-u,k=x-b,A=_(t.left)+b,T=t.right;else if(r==="right")x=_(this.left),A=t.left,T=_(t.right)-b,D=x+b,k=this.left+u;else if(e==="x"){if(r==="center")x=_((t.top+t.bottom)/2+.5);else if(E(r)){const Y=Object.keys(r)[0],ot=r[Y];x=_(this.chart.scales[Y].getPixelForValue(ot))}y=t.top,K=t.bottom,w=x+b,O=w+u}else if(e==="y"){if(r==="center")x=_((t.left+t.right)/2);else if(E(r)){const Y=Object.keys(r)[0],ot=r[Y];x=_(this.chart.scales[Y].getPixelForValue(ot))}D=x-b,k=D-u,A=t.left,T=t.right}const j=I(n.ticks.maxTicksLimit,d),H=Math.max(1,Math.ceil(d/j));for(S=0;S<d;S+=H){const Y=this.getContext(S),ot=o.setContext(Y),Ee=a.setContext(Y),Fe=ot.lineWidth,Qt=ot.color,Be=Ee.dash||[],Zt=Ee.dashOffset,de=ot.tickWidth,Bt=ot.tickColor,ue=ot.tickBorderDash||[],zt=ot.tickBorderDashOffset;P=dh(this,S,l),P!==void 0&&(v=Nt(s,P,Fe),c?D=k=A=T=v:w=O=y=K=v,f.push({tx1:D,ty1:w,tx2:k,ty2:O,x1:A,y1:y,x2:T,y2:K,width:Fe,color:Qt,borderDash:Be,borderDashOffset:Zt,tickWidth:de,tickColor:Bt,tickBorderDash:ue,tickBorderDashOffset:zt}))}return this._ticksLength=d,this._borderValue=x,f}_computeLabelItems(t){const e=this.axis,s=this.options,{position:n,ticks:o}=s,r=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:h,mirror:d}=o,u=me(s.grid),f=u+h,p=d?-h:f,m=-Ut(this.labelRotation),b=[];let _,x,S,P,v,D,w,k,O,A,y,T,K="middle";if(n==="top")D=this.bottom-p,w=this._getXAxisLabelAlignment();else if(n==="bottom")D=this.top+p,w=this._getXAxisLabelAlignment();else if(n==="left"){const H=this._getYAxisLabelAlignment(u);w=H.textAlign,v=H.x}else if(n==="right"){const H=this._getYAxisLabelAlignment(u);w=H.textAlign,v=H.x}else if(e==="x"){if(n==="center")D=(t.top+t.bottom)/2+f;else if(E(n)){const H=Object.keys(n)[0],Y=n[H];D=this.chart.scales[H].getPixelForValue(Y)+f}w=this._getXAxisLabelAlignment()}else if(e==="y"){if(n==="center")v=(t.left+t.right)/2-f;else if(E(n)){const H=Object.keys(n)[0],Y=n[H];v=this.chart.scales[H].getPixelForValue(Y)}w=this._getYAxisLabelAlignment(u).textAlign}e==="y"&&(l==="start"?K="top":l==="end"&&(K="bottom"));const j=this._getLabelSizes();for(_=0,x=a.length;_<x;++_){S=a[_],P=S.label;const H=o.setContext(this.getContext(_));k=this.getPixelForTick(_)+o.labelOffset,O=this._resolveTickFontOptions(_),A=O.lineHeight,y=G(P)?P.length:1;const Y=y/2,ot=H.color,Ee=H.textStrokeColor,Fe=H.textStrokeWidth;let Qt=w;r?(v=k,w==="inner"&&(_===x-1?Qt=this.options.reverse?"left":"right":_===0?Qt=this.options.reverse?"right":"left":Qt="center"),n==="top"?c==="near"||m!==0?T=-y*A+A/2:c==="center"?T=-j.highest.height/2-Y*A+A:T=-j.highest.height+A/2:c==="near"||m!==0?T=A/2:c==="center"?T=j.highest.height/2-Y*A:T=j.highest.height-y*A,d&&(T*=-1),m!==0&&!H.showLabelBackdrop&&(v+=A/2*Math.sin(m))):(D=k,T=(1-y)*A/2);let Be;if(H.showLabelBackdrop){const Zt=ut(H.backdropPadding),de=j.heights[_],Bt=j.widths[_];let ue=T-Zt.top,zt=0-Zt.left;switch(K){case"middle":ue-=de/2;break;case"bottom":ue-=de;break}switch(w){case"center":zt-=Bt/2;break;case"right":zt-=Bt;break;case"inner":_===x-1?zt-=Bt:_>0&&(zt-=Bt/2);break}Be={left:zt,top:ue,width:Bt+Zt.width,height:de+Zt.height,color:H.backdropColor}}b.push({label:P,font:O,textOffset:T,options:{rotation:m,color:ot,strokeColor:Ee,strokeWidth:Fe,textAlign:Qt,textBaseline:K,translation:[v,D],backdrop:Be}})}return b}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-Ut(this.labelRotation))return t==="top"?"left":"right";let n="center";return e.align==="start"?n="left":e.align==="end"?n="right":e.align==="inner"&&(n="inner"),n}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:s,mirror:n,padding:o}}=this.options,r=this._getLabelSizes(),a=t+o,l=r.widest.width;let c,h;return e==="left"?n?(h=this.right+o,s==="near"?c="left":s==="center"?(c="center",h+=l/2):(c="right",h+=l)):(h=this.right-a,s==="near"?c="right":s==="center"?(c="center",h-=l/2):(c="left",h=this.left)):e==="right"?n?(h=this.left+o,s==="near"?c="right":s==="center"?(c="center",h-=l/2):(c="left",h-=l)):(h=this.left+a,s==="near"?c="left":s==="center"?(c="center",h+=l/2):(c="right",h=this.right)):c="right",{textAlign:c,x:h}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:s,top:n,width:o,height:r}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(s,n,o,r),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const n=this.ticks.findIndex(o=>o.value===t);return n>=0?e.setContext(this.getContext(n)).lineWidth:0}drawGrid(t){const e=this.options.grid,s=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,r;const a=(l,c,h)=>{!h.width||!h.color||(s.save(),s.lineWidth=h.width,s.strokeStyle=h.color,s.setLineDash(h.borderDash||[]),s.lineDashOffset=h.borderDashOffset,s.beginPath(),s.moveTo(l.x,l.y),s.lineTo(c.x,c.y),s.stroke(),s.restore())};if(e.display)for(o=0,r=n.length;o<r;++o){const l=n[o];e.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),e.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:s,grid:n}}=this,o=s.setContext(this.getContext()),r=s.display?o.width:0;if(!r)return;const a=n.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,h,d,u;this.isHorizontal()?(c=Nt(t,this.left,r)-r/2,h=Nt(t,this.right,a)+a/2,d=u=l):(d=Nt(t,this.top,r)-r/2,u=Nt(t,this.bottom,a)+a/2,c=h=l),e.save(),e.lineWidth=o.width,e.strokeStyle=o.color,e.beginPath(),e.moveTo(c,d),e.lineTo(h,u),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const s=this.ctx,n=this._computeLabelArea();n&&Zi(s,n);const o=this.getLabelItems(t);for(const r of o){const a=r.options,l=r.font,c=r.label,h=r.textOffset;Le(s,c,0,h,l,a)}n&&ts(s)}drawTitle(){const{ctx:t,options:{position:e,title:s,reverse:n}}=this;if(!s.display)return;const o=Z(s.font),r=ut(s.padding),a=s.align;let l=o.lineHeight/2;e==="bottom"||e==="center"||E(e)?(l+=r.bottom,G(s.text)&&(l+=o.lineHeight*(s.text.length-1))):l+=r.top;const{titleX:c,titleY:h,maxWidth:d,rotation:u}=mh(this,l,e,a);Le(t,s.text,0,0,o,{color:s.color,maxWidth:d,rotation:u,textAlign:ph(a,e,n),textBaseline:"middle",translation:[c,h]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,s=I(t.grid&&t.grid.z,-1),n=I(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==ce.prototype.draw?[{z:e,draw:o=>{this.draw(o)}}]:[{z:s,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:n,draw:()=>{this.drawBorder()}},{z:e,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),s=this.axis+"AxisID",n=[];let o,r;for(o=0,r=e.length;o<r;++o){const a=e[o];a[s]===this.id&&(!t||a.type===t)&&n.push(a)}return n}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return Z(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Ke{constructor(t,e,s){this.type=t,this.scope=e,this.override=s,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let s;xh(e)&&(s=this.register(e));const n=this.items,o=t.id,r=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in n||(n[o]=t,bh(t,r,s),this.override&&U.override(t.id,t.overrides)),r}get(t){return this.items[t]}unregister(t){const e=this.items,s=t.id,n=this.scope;s in e&&delete e[s],n&&s in U[n]&&(delete U[n][s],this.override&&delete Jt[s])}}function bh(i,t,e){const s=Ce(Object.create(null),[e?U.get(e):{},U.get(t),i.defaults]);U.set(t,s),i.defaultRoutes&&_h(t,i.defaultRoutes),i.descriptors&&U.describe(t,i.descriptors)}function _h(i,t){Object.keys(t).forEach(e=>{const s=e.split("."),n=s.pop(),o=[i].concat(s).join("."),r=t[e].split("."),a=r.pop(),l=r.join(".");U.route(o,n,l,a)})}function xh(i){return"id"in i&&"defaults"in i}class yh{constructor(){this.controllers=new Ke(rs,"datasets",!0),this.elements=new Ke(Et,"elements"),this.plugins=new Ke(Object,"plugins"),this.scales=new Ke(ce,"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,s){[...e].forEach(n=>{const o=s||this._getRegistryForType(n);s||o.isForType(n)||o===this.plugins&&n.id?this._exec(t,o,n):z(n,r=>{const a=s||this._getRegistryForType(r);this._exec(t,a,r)})})}_exec(t,e,s){const n=Gi(t);V(s["before"+n],[],s),e[t](s),V(s["after"+n],[],s)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const s=this._typedRegistries[e];if(s.isForType(t))return s}return this.plugins}_get(t,e,s){const n=e.get(t);if(n===void 0)throw new Error('"'+t+'" is not a registered '+s+".");return n}}var xt=new yh;class vh{constructor(){this._init=[]}notify(t,e,s,n){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const o=n?this._descriptors(t).filter(n):this._descriptors(t),r=this._notify(o,t,e,s);return e==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall")),r}_notify(t,e,s,n){n=n||{};for(const o of t){const r=o.plugin,a=r[s],l=[e,n,o.options];if(V(a,l,r)===!1&&n.cancelable)return!1}return!0}invalidate(){W(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const s=t&&t.config,n=I(s.options&&s.options.plugins,{}),o=Sh(s);return n===!1&&!e?[]:kh(t,o,n,e)}_notifyStateChanges(t){const e=this._oldCache||[],s=this._cache,n=(o,r)=>o.filter(a=>!r.some(l=>a.plugin.id===l.plugin.id));this._notify(n(e,s),t,"stop"),this._notify(n(s,e),t,"start")}}function Sh(i){const t={},e=[],s=Object.keys(xt.plugins.items);for(let o=0;o<s.length;o++)e.push(xt.getPlugin(s[o]));const n=i.plugins||[];for(let o=0;o<n.length;o++){const r=n[o];e.indexOf(r)===-1&&(e.push(r),t[r.id]=!0)}return{plugins:e,localIds:t}}function wh(i,t){return!t&&i===!1?null:i===!0?{}:i}function kh(i,{plugins:t,localIds:e},s,n){const o=[],r=i.getContext();for(const a of t){const l=a.id,c=wh(s[l],n);c!==null&&o.push({plugin:a,options:Ph(i.config,{plugin:a,local:e[l]},c,r)})}return o}function Ph(i,{plugin:t,local:e},s,n){const o=i.pluginScopeKeys(t),r=i.getOptionScopes(s,o);return e&&t.defaults&&r.push(t.defaults),i.createResolver(r,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Ii(i,t){const e=U.datasets[i]||{};return((t.datasets||{})[i]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function Mh(i,t){let e=i;return i==="_index_"?e=t:i==="_value_"&&(e=t==="x"?"y":"x"),e}function Ch(i,t){return i===t?"_index_":"_value_"}function tn(i){if(i==="x"||i==="y"||i==="r")return i}function Dh(i){if(i==="top"||i==="bottom")return"x";if(i==="left"||i==="right")return"y"}function Ei(i,...t){if(tn(i))return i;for(const e of t){const s=e.axis||Dh(e.position)||i.length>1&&tn(i[0].toLowerCase());if(s)return s}throw new Error(`Cannot determine type of '${i}' axis. Please provide 'axis' or 'position' option.`)}function en(i,t,e){if(e[t+"AxisID"]===i)return{axis:t}}function Oh(i,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(s=>s.xAxisID===i||s.yAxisID===i);if(e.length)return en(i,"x",e[0])||en(i,"y",e[0])}return{}}function Th(i,t){const e=Jt[i.type]||{scales:{}},s=t.scales||{},n=Ii(i.type,t),o=Object.create(null);return Object.keys(s).forEach(r=>{const a=s[r];if(!E(a))return console.error(`Invalid scale configuration for scale: ${r}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${r}`);const l=Ei(r,a,Oh(r,i),U.scales[a.type]),c=Ch(l,n),h=e.scales||{};o[r]=Se(Object.create(null),[{axis:l},a,h[l],h[c]])}),i.data.datasets.forEach(r=>{const a=r.type||i.type,l=r.indexAxis||Ii(a,t),h=(Jt[a]||{}).scales||{};Object.keys(h).forEach(d=>{const u=Mh(d,l),f=r[u+"AxisID"]||u;o[f]=o[f]||Object.create(null),Se(o[f],[{axis:u},s[f],h[d]])})}),Object.keys(o).forEach(r=>{const a=o[r];Se(a,[U.scales[a.type],U.scale])}),o}function ko(i){const t=i.options||(i.options={});t.plugins=I(t.plugins,{}),t.scales=Th(i,t)}function Po(i){return i=i||{},i.datasets=i.datasets||[],i.labels=i.labels||[],i}function Lh(i){return i=i||{},i.data=Po(i.data),ko(i),i}const sn=new Map,Mo=new Set;function Xe(i,t){let e=sn.get(i);return e||(e=t(),sn.set(i,e),Mo.add(e)),e}const be=(i,t,e)=>{const s=re(t,e);s!==void 0&&i.add(s)};let Rh=class{constructor(t){this._config=Lh(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=Po(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 Xe(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return Xe(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return Xe(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,s=this.type;return Xe(`${s}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const s=this._scopeCache;let n=s.get(t);return(!n||e)&&(n=new Map,s.set(t,n)),n}getOptionScopes(t,e,s){const{options:n,type:o}=this,r=this._cachedScopes(t,s),a=r.get(e);if(a)return a;const l=new Set;e.forEach(h=>{t&&(l.add(t),h.forEach(d=>be(l,t,d))),h.forEach(d=>be(l,n,d)),h.forEach(d=>be(l,Jt[o]||{},d)),h.forEach(d=>be(l,U,d)),h.forEach(d=>be(l,Ri,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Mo.has(e)&&r.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,Jt[e]||{},U.datasets[e]||{},{type:e},U,Ri]}resolveNamedOptions(t,e,s,n=[""]){const o={$shared:!0},{resolver:r,subPrefixes:a}=nn(this._resolverCache,t,n);let l=r;if(Ih(r,e)){o.$shared=!1,s=It(s)?s():s;const c=this.createResolver(t,s,a);l=ae(r,s,c)}for(const c of e)o[c]=l[c];return o}createResolver(t,e,s=[""],n){const{resolver:o}=nn(this._resolverCache,t,s);return E(e)?ae(o,e,void 0,n):o}};function nn(i,t,e){let s=i.get(t);s||(s=new Map,i.set(t,s));const n=e.join();let o=s.get(n);return o||(o={resolver:es(t,e),subPrefixes:e.filter(a=>!a.toLowerCase().includes("hover"))},s.set(n,o)),o}const Ah=i=>E(i)&&Object.getOwnPropertyNames(i).some(t=>It(i[t]));function Ih(i,t){const{isScriptable:e,isIndexable:s}=oo(i);for(const n of t){const o=e(n),r=s(n),a=(r||o)&&i[n];if(o&&(It(a)||Ah(a))||r&&G(a))return!0}return!1}var Eh="4.4.4";const Fh=["top","bottom","left","right","chartArea"];function on(i,t){return i==="top"||i==="bottom"||Fh.indexOf(i)===-1&&t==="x"}function rn(i,t){return function(e,s){return e[i]===s[i]?e[t]-s[t]:e[i]-s[i]}}function an(i){const t=i.chart,e=t.options.animation;t.notifyPlugins("afterRender"),V(e&&e.onComplete,[i],t)}function Bh(i){const t=i.chart,e=t.options.animation;V(e&&e.onProgress,[i],t)}function Co(i){return ns()&&typeof i=="string"?i=document.getElementById(i):i&&i.length&&(i=i[0]),i&&i.canvas&&(i=i.canvas),i}const ei={},ln=i=>{const t=Co(i);return Object.values(ei).filter(e=>e.canvas===t).pop()};function zh(i,t,e){const s=Object.keys(i);for(const n of s){const o=+n;if(o>=t){const r=i[n];delete i[n],(e>0||o>t)&&(i[o+e]=r)}}}function $h(i,t,e,s){return!e||i.type==="mouseout"?null:s?t:i}function Ge(i,t,e){return i.options.clip?i[e]:t[e]}function Nh(i,t){const{xScale:e,yScale:s}=i;return e&&s?{left:Ge(e,t,"left"),right:Ge(e,t,"right"),top:Ge(s,t,"top"),bottom:Ge(s,t,"bottom")}:t}let ui=class{static defaults=U;static instances=ei;static overrides=Jt;static registry=xt;static version=Eh;static getChart=ln;static register(...t){xt.add(...t),cn()}static unregister(...t){xt.remove(...t),cn()}constructor(t,e){const s=this.config=new Rh(e),n=Co(t),o=ln(n);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const r=s.createResolver(s.chartOptionScopes(),this.getContext());this.platform=new(s.platform||sh(n)),this.platform.updateConfig(s);const a=this.platform.acquireContext(n,r.aspectRatio),l=a&&a.canvas,c=l&&l.height,h=l&&l.width;if(this.id=za(),this.ctx=a,this.canvas=l,this.width=h,this.height=c,this._options=r,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 vh,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=sl(d=>this.update(d),r.resizeDelay||0),this._dataChanges=[],ei[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}kt.listen(this,"complete",an),kt.listen(this,"progress",Bh),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:s,height:n,_aspectRatio:o}=this;return W(t)?e&&o?o:n?s/n: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 xt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Os(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Ms(this.canvas,this.ctx),this}stop(){return kt.stop(this),this}resize(t,e){kt.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const s=this.options,n=this.canvas,o=s.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(n,t,e,o),a=s.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,Os(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),V(s.onResize,[this,r],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};z(e,(s,n)=>{s.id=n})}buildOrUpdateScales(){const t=this.options,e=t.scales,s=this.scales,n=Object.keys(s).reduce((r,a)=>(r[a]=!1,r),{});let o=[];e&&(o=o.concat(Object.keys(e).map(r=>{const a=e[r],l=Ei(r,a),c=l==="r",h=l==="x";return{options:a,dposition:c?"chartArea":h?"bottom":"left",dtype:c?"radialLinear":h?"category":"linear"}}))),z(o,r=>{const a=r.options,l=a.id,c=Ei(l,a),h=I(a.type,r.dtype);(a.position===void 0||on(a.position,c)!==on(r.dposition))&&(a.position=r.dposition),n[l]=!0;let d=null;if(l in s&&s[l].type===h)d=s[l];else{const u=xt.getScale(h);d=new u({id:l,type:h,ctx:this.ctx,chart:this}),s[d.id]=d}d.init(a,t)}),z(n,(r,a)=>{r||delete s[a]}),z(s,r=>{ct.configure(this,r,r.options),ct.addBox(this,r)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,s=t.length;if(t.sort((n,o)=>n.index-o.index),s>e){for(let n=e;n<s;++n)this._destroyDatasetMeta(n);t.splice(e,s-e)}this._sortedMetasets=t.slice(0).sort(rn("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((s,n)=>{e.filter(o=>o===s._dataset).length===0&&this._destroyDatasetMeta(n)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let s,n;for(this._removeUnreferencedMetasets(),s=0,n=e.length;s<n;s++){const o=e[s];let r=this.getDatasetMeta(s);const a=o.type||this.config.type;if(r.type&&r.type!==a&&(this._destroyDatasetMeta(s),r=this.getDatasetMeta(s)),r.type=a,r.indexAxis=o.indexAxis||Ii(a,this.options),r.order=o.order||0,r.index=s,r.label=""+o.label,r.visible=this.isDatasetVisible(s),r.controller)r.controller.updateIndex(s),r.controller.linkScales();else{const l=xt.getController(a),{datasetElementType:c,dataElementType:h}=U.datasets[a];Object.assign(l,{dataElementType:xt.getElement(h),datasetElementType:c&&xt.getElement(c)}),r.controller=new l(this,s),t.push(r.controller)}}return this._updateMetasets(),t}_resetElements(){z(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const s=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!s.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let c=0,h=this.data.datasets.length;c<h;c++){const{controller:d}=this.getDatasetMeta(c),u=!n&&o.indexOf(d)===-1;d.buildOrUpdateElements(u),r=Math.max(+d.getMaxOverflow(),r)}r=this._minPadding=s.layout.autoPadding?r:0,this._updateLayout(r),n||z(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(rn("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){z(this.scales,t=>{ct.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),s=new Set(t.events);(!ms(e,s)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:s,start:n,count:o}of e){const r=s==="_removeElements"?-o:o;zh(t,n,r)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,s=o=>new Set(t.filter(r=>r[0]===o).map((r,a)=>a+","+r.splice(1).join(","))),n=s(0);for(let o=1;o<e;o++)if(!ms(n,s(o)))return;return Array.from(n).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;ct.update(this,this.width,this.height,t);const e=this.chartArea,s=e.width<=0||e.height<=0;this._layers=[],z(this.boxes,n=>{s&&n.position==="chartArea"||(n.configure&&n.configure(),this._layers.push(...n._layers()))},this),this._layers.forEach((n,o)=>{n._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,s=this.data.datasets.length;e<s;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,s=this.data.datasets.length;e<s;++e)this._updateDataset(e,It(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const s=this.getDatasetMeta(t),n={meta:s,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",n)!==!1&&(s.controller._update(e),n.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",n))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(kt.has(this)?this.attached&&!kt.running(this)&&kt.start(this):(this.draw(),an({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:s,height:n}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(s,n)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,s=[];let n,o;for(n=0,o=e.length;n<o;++n){const r=e[n];(!t||r.visible)&&s.push(r)}return s}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,s=t._clip,n=!s.disabled,o=Nh(t,this.chartArea),r={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(n&&Zi(e,{left:s.left===!1?0:o.left-s.left,right:s.right===!1?this.width:o.right+s.right,top:s.top===!1?0:o.top-s.top,bottom:s.bottom===!1?this.height:o.bottom+s.bottom}),t.controller.draw(),n&&ts(e),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return Te(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,s,n){const o=Fc.modes[e];return typeof o=="function"?o(this,t,s,n):[]}getDatasetMeta(t){const e=this.data.datasets[t],s=this._metasets;let n=s.filter(o=>o&&o._dataset===e).pop();return n||(n={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},s.push(n)),n}getContext(){return this.$context||(this.$context=qt(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const s=this.getDatasetMeta(t);return typeof s.hidden=="boolean"?!s.hidden:!e.hidden}setDatasetVisibility(t,e){const s=this.getDatasetMeta(t);s.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,s){const n=s?"show":"hide",o=this.getDatasetMeta(t),r=o.controller._resolveAnimations(void 0,n);De(e)?(o.data[e].hidden=!s,this.update()):(this.setDatasetVisibility(t,s),r.update(o,{visible:s}),this.update(a=>a.datasetIndex===t?n: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(),kt.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),Ms(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete ei[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,s=(o,r)=>{e.addEventListener(this,o,r),t[o]=r},n=(o,r,a)=>{o.offsetX=r,o.offsetY=a,this._eventHandler(o)};z(this.options.events,o=>s(o,n))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,s=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},n=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let r;const a=()=>{n("attach",a),this.attached=!0,this.resize(),s("resize",o),s("detach",r)};r=()=>{this.attached=!1,n("resize",o),this._stop(),this._resize(0,0),s("attach",a)},e.isAttached(this.canvas)?a():r()}unbindEvents(){z(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},z(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,s){const n=s?"set":"remove";let o,r,a,l;for(e==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+n+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){r=t[a];const c=r&&this.getDatasetMeta(r.datasetIndex).controller;c&&c[n+"HoverStyle"](r.element,r.datasetIndex,r.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],s=t.map(({datasetIndex:o,index:r})=>{const a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[r],index:r}});!si(s,e)&&(this._active=s,this._lastEvent=null,this._updateHoverStyles(s,e))}notifyPlugins(t,e,s){return this._plugins.notify(this,t,e,s)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,s){const n=this.options.hover,o=(l,c)=>l.filter(h=>!c.some(d=>h.datasetIndex===d.datasetIndex&&h.index===d.index)),r=o(e,t),a=s?t:o(t,e);r.length&&this.updateHoverStyle(r,n.mode,!1),a.length&&n.mode&&this.updateHoverStyle(a,n.mode,!0)}_eventHandler(t,e){const s={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},n=r=>(r.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",s,n)===!1)return;const o=this._handleEvent(t,e,s.inChartArea);return s.cancelable=!1,this.notifyPlugins("afterEvent",s,n),(o||s.changed)&&this.render(),this}_handleEvent(t,e,s){const{_active:n=[],options:o}=this,r=e,a=this._getActiveElements(t,n,s,r),l=ja(t),c=$h(t,this._lastEvent,s,l);s&&(this._lastEvent=null,V(o.onHover,[t,a,this],this),l&&V(o.onClick,[t,a,this],this));const h=!si(a,n);return(h||e)&&(this._active=a,this._updateHoverStyles(a,n,e)),this._lastEvent=c,h}_getActiveElements(t,e,s,n){if(t.type==="mouseout")return[];if(!s)return e;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,n)}};function cn(){return z(ui.instances,i=>i._plugins.invalidate())}function Do(i,t,e=t){i.lineCap=I(e.borderCapStyle,t.borderCapStyle),i.setLineDash(I(e.borderDash,t.borderDash)),i.lineDashOffset=I(e.borderDashOffset,t.borderDashOffset),i.lineJoin=I(e.borderJoinStyle,t.borderJoinStyle),i.lineWidth=I(e.borderWidth,t.borderWidth),i.strokeStyle=I(e.borderColor,t.borderColor)}function Hh(i,t,e){i.lineTo(e.x,e.y)}function Wh(i){return i.stepped?ml:i.tension||i.cubicInterpolationMode==="monotone"?bl:Hh}function Oo(i,t,e={}){const s=i.length,{start:n=0,end:o=s-1}=e,{start:r,end:a}=t,l=Math.max(n,r),c=Math.min(o,a),h=n<r&&o<r||n>a&&o>a;return{count:s,start:l,loop:t.loop,ilen:c<l&&!h?s+c-l:c-l}}function Vh(i,t,e,s){const{points:n,options:o}=t,{count:r,start:a,loop:l,ilen:c}=Oo(n,e,s),h=Wh(o);let{move:d=!0,reverse:u}=s||{},f,p,m;for(f=0;f<=c;++f)p=n[(a+(u?c-f:f))%r],!p.skip&&(d?(i.moveTo(p.x,p.y),d=!1):h(i,m,p,u,o.stepped),m=p);return l&&(p=n[(a+(u?c:0))%r],h(i,m,p,u,o.stepped)),!!l}function jh(i,t,e,s){const n=t.points,{count:o,start:r,ilen:a}=Oo(n,e,s),{move:l=!0,reverse:c}=s||{};let h=0,d=0,u,f,p,m,b,_;const x=P=>(r+(c?a-P:P))%o,S=()=>{m!==b&&(i.lineTo(h,b),i.lineTo(h,m),i.lineTo(h,_))};for(l&&(f=n[x(0)],i.moveTo(f.x,f.y)),u=0;u<=a;++u){if(f=n[x(u)],f.skip)continue;const P=f.x,v=f.y,D=P|0;D===p?(v<m?m=v:v>b&&(b=v),h=(d*h+P)/++d):(S(),i.lineTo(P,v),p=D,d=0,m=b=v),_=v}S()}function Fi(i){const t=i.options,e=t.borderDash&&t.borderDash.length;return!i._decimated&&!i._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?jh:Vh}function Uh(i){return i.stepped?Gl:i.tension||i.cubicInterpolationMode==="monotone"?Jl:Vt}function Yh(i,t,e,s){let n=t._path;n||(n=t._path=new Path2D,t.path(n,e,s)&&n.closePath()),Do(i,t.options),i.stroke(n)}function Kh(i,t,e,s){const{segments:n,options:o}=t,r=Fi(t);for(const a of n)Do(i,o,a.style),i.beginPath(),r(i,t,a,{start:e,end:e+s-1})&&i.closePath(),i.stroke()}const Xh=typeof Path2D=="function";function Gh(i,t,e,s){Xh&&!t.options.segment?Yh(i,t,e,s):Kh(i,t,e,s)}class Jh extends Et{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"};constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const s=this.options;if((s.tension||s.cubicInterpolationMode==="monotone")&&!s.stepped&&!this._pointsUpdated){const n=s.spanGaps?this._loop:this._fullLoop;Hl(this._points,s,t,n,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=nc(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,s=t.length;return s&&e[t[s-1].end]}interpolate(t,e){const s=this.options,n=t[e],o=this.points,r=ec(this,{property:e,start:n,end:n});if(!r.length)return;const a=[],l=Uh(s);let c,h;for(c=0,h=r.length;c<h;++c){const{start:d,end:u}=r[c],f=o[d],p=o[u];if(f===p){a.push(f);continue}const m=Math.abs((n-f[e])/(p[e]-f[e])),b=l(f,p,m,s.stepped);b[e]=t[e],a.push(b)}return a.length===1?a[0]:a}pathSegment(t,e,s){return Fi(this)(t,this,e,s)}path(t,e,s){const n=this.segments,o=Fi(this);let r=this._loop;e=e||0,s=s||this.points.length-e;for(const a of n)r&=o(t,this,a,{start:e,end:e+s-1});return!!r}draw(t,e,s,n){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),Gh(t,this,s,n),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function hn(i,t,e,s){const n=i.options,{[e]:o}=i.getProps([e],s);return Math.abs(t-o)<n.radius+n.hitRadius}class qh extends Et{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,s){const n=this.options,{x:o,y:r}=this.getProps(["x","y"],s);return Math.pow(t-o,2)+Math.pow(e-r,2)<Math.pow(n.hitRadius+n.radius,2)}inXRange(t,e){return hn(this,t,"x",e)}inYRange(t,e){return hn(this,t,"y",e)}getCenterPoint(t){const{x:e,y:s}=this.getProps(["x","y"],t);return{x:e,y:s}}size(t){t=t||this.options||{};let e=t.radius||0;e=Math.max(e,e&&t.hoverRadius||0);const s=e&&t.borderWidth||0;return(e+s)*2}draw(t,e){const s=this.options;this.skip||s.radius<.1||!Te(this,e,this.size(s)/2)||(t.strokeStyle=s.borderColor,t.lineWidth=s.borderWidth,t.fillStyle=s.backgroundColor,Ai(t,s,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function To(i,t){const{x:e,y:s,base:n,width:o,height:r}=i.getProps(["x","y","base","width","height"],t);let a,l,c,h,d;return i.horizontal?(d=r/2,a=Math.min(e,n),l=Math.max(e,n),c=s-d,h=s+d):(d=o/2,a=e-d,l=e+d,c=Math.min(s,n),h=Math.max(s,n)),{left:a,top:c,right:l,bottom:h}}function Rt(i,t,e,s){return i?0:nt(t,e,s)}function Qh(i,t,e){const s=i.options.borderWidth,n=i.borderSkipped,o=no(s);return{t:Rt(n.top,o.top,0,e),r:Rt(n.right,o.right,0,t),b:Rt(n.bottom,o.bottom,0,e),l:Rt(n.left,o.left,0,t)}}function Zh(i,t,e){const{enableBorderRadius:s}=i.getProps(["enableBorderRadius"]),n=i.options.borderRadius,o=se(n),r=Math.min(t,e),a=i.borderSkipped,l=s||E(n);return{topLeft:Rt(!l||a.top||a.left,o.topLeft,0,r),topRight:Rt(!l||a.top||a.right,o.topRight,0,r),bottomLeft:Rt(!l||a.bottom||a.left,o.bottomLeft,0,r),bottomRight:Rt(!l||a.bottom||a.right,o.bottomRight,0,r)}}function td(i){const t=To(i),e=t.right-t.left,s=t.bottom-t.top,n=Qh(i,e/2,s/2),o=Zh(i,e/2,s/2);return{outer:{x:t.left,y:t.top,w:e,h:s,radius:o},inner:{x:t.left+n.l,y:t.top+n.t,w:e-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 ki(i,t,e,s){const n=t===null,o=e===null,a=i&&!(n&&o)&&To(i,s);return a&&(n||Yt(t,a.left,a.right))&&(o||Yt(e,a.top,a.bottom))}function ed(i){return i.topLeft||i.topRight||i.bottomLeft||i.bottomRight}function id(i,t){i.rect(t.x,t.y,t.w,t.h)}function Pi(i,t,e={}){const s=i.x!==e.x?-t:0,n=i.y!==e.y?-t:0,o=(i.x+i.w!==e.x+e.w?t:0)-s,r=(i.y+i.h!==e.y+e.h?t:0)-n;return{x:i.x+s,y:i.y+n,w:i.w+o,h:i.h+r,radius:i.radius}}class sd extends Et{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:s,backgroundColor:n}}=this,{inner:o,outer:r}=td(this),a=ed(r.radius)?ri:id;t.save(),(r.w!==o.w||r.h!==o.h)&&(t.beginPath(),a(t,Pi(r,e,o)),t.clip(),a(t,Pi(o,-e,r)),t.fillStyle=s,t.fill("evenodd")),t.beginPath(),a(t,Pi(o,e)),t.fillStyle=n,t.fill(),t.restore()}inRange(t,e,s){return ki(this,t,e,s)}inXRange(t,e){return ki(this,t,null,e)}inYRange(t,e){return ki(this,null,t,e)}getCenterPoint(t){const{x:e,y:s,base:n,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(e+n)/2:e,y:o?s:(s+n)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}const dn=(i,t)=>{let{boxHeight:e=t,boxWidth:s=t}=i;return i.usePointStyle&&(e=Math.min(e,t),s=i.pointStyleWidth||Math.min(s,t)),{boxWidth:s,boxHeight:e,itemHeight:Math.max(t,e)}},nd=(i,t)=>i!==null&&t!==null&&i.datasetIndex===t.datasetIndex&&i.index===t.index;class un extends Et{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,s){this.maxWidth=t,this.maxHeight=e,this._margins=s,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=V(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(s=>t.filter(s,this.chart.data))),t.sort&&(e=e.sort((s,n)=>t.sort(s,n,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const s=t.labels,n=Z(s.font),o=n.size,r=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=dn(s,o);let c,h;e.font=n.string,this.isHorizontal()?(c=this.maxWidth,h=this._fitRows(r,o,a,l)+10):(h=this.maxHeight,c=this._fitCols(r,n,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,s,n){const{ctx:o,maxWidth:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],h=n+a;let d=t;o.textAlign="left",o.textBaseline="middle";let u=-1,f=-h;return this.legendItems.forEach((p,m)=>{const b=s+e/2+o.measureText(p.text).width;(m===0||c[c.length-1]+b+2*a>r)&&(d+=h,c[c.length-(m>0?0:1)]=0,f+=h,u++),l[m]={left:0,top:f,row:u,width:b,height:n},c[c.length-1]+=b+a}),d}_fitCols(t,e,s,n){const{ctx:o,maxHeight:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],h=r-t;let d=a,u=0,f=0,p=0,m=0;return this.legendItems.forEach((b,_)=>{const{itemWidth:x,itemHeight:S}=od(s,e,o,b,n);_>0&&f+S+2*a>h&&(d+=u+a,c.push({width:u,height:f}),p+=u+a,m++,u=f=0),l[_]={left:p,top:f,col:m,width:x,height:S},u=Math.max(u,x),f+=S+a}),d+=u,c.push({width:u,height:f}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:s,labels:{padding:n},rtl:o}}=this,r=ne(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=Q(s,this.left+n,this.right-this.lineWidths[a]);for(const c of e)a!==c.row&&(a=c.row,l=Q(s,this.left+n,this.right-this.lineWidths[a])),c.top+=this.top+t+n,c.left=r.leftForLtr(r.x(l),c.width),l+=c.width+n}else{let a=0,l=Q(s,this.top+t+n,this.bottom-this.columnSizes[a].height);for(const c of e)c.col!==a&&(a=c.col,l=Q(s,this.top+t+n,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+n,c.left=r.leftForLtr(r.x(c.left),c.width),l+=c.height+n}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Zi(t,this),this._draw(),ts(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:s,ctx:n}=this,{align:o,labels:r}=t,a=U.color,l=ne(t.rtl,this.left,this.width),c=Z(r.font),{padding:h}=r,d=c.size,u=d/2;let f;this.drawTitle(),n.textAlign=l.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=c.string;const{boxWidth:p,boxHeight:m,itemHeight:b}=dn(r,d),_=function(D,w,k){if(isNaN(p)||p<=0||isNaN(m)||m<0)return;n.save();const O=I(k.lineWidth,1);if(n.fillStyle=I(k.fillStyle,a),n.lineCap=I(k.lineCap,"butt"),n.lineDashOffset=I(k.lineDashOffset,0),n.lineJoin=I(k.lineJoin,"miter"),n.lineWidth=O,n.strokeStyle=I(k.strokeStyle,a),n.setLineDash(I(k.lineDash,[])),r.usePointStyle){const A={radius:m*Math.SQRT2/2,pointStyle:k.pointStyle,rotation:k.rotation,borderWidth:O},y=l.xPlus(D,p/2),T=w+u;io(n,A,y,T,r.pointStyleWidth&&p)}else{const A=w+Math.max((d-m)/2,0),y=l.leftForLtr(D,p),T=se(k.borderRadius);n.beginPath(),Object.values(T).some(K=>K!==0)?ri(n,{x:y,y:A,w:p,h:m,radius:T}):n.rect(y,A,p,m),n.fill(),O!==0&&n.stroke()}n.restore()},x=function(D,w,k){Le(n,k.text,D,w+b/2,c,{strikethrough:k.hidden,textAlign:l.textAlign(k.textAlign)})},S=this.isHorizontal(),P=this._computeTitleHeight();S?f={x:Q(o,this.left+h,this.right-s[0]),y:this.top+h+P,line:0}:f={x:this.left+h,y:Q(o,this.top+P+h,this.bottom-e[0].height),line:0},ho(this.ctx,t.textDirection);const v=b+h;this.legendItems.forEach((D,w)=>{n.strokeStyle=D.fontColor,n.fillStyle=D.fontColor;const k=n.measureText(D.text).width,O=l.textAlign(D.textAlign||(D.textAlign=r.textAlign)),A=p+u+k;let y=f.x,T=f.y;l.setWidth(this.width),S?w>0&&y+A+h>this.right&&(T=f.y+=v,f.line++,y=f.x=Q(o,this.left+h,this.right-s[f.line])):w>0&&T+v>this.bottom&&(y=f.x=y+e[f.line].width+h,f.line++,T=f.y=Q(o,this.top+P+h,this.bottom-e[f.line].height));const K=l.x(y);if(_(K,T,D),y=nl(O,y+p+u,S?y+A:this.right,t.rtl),x(l.x(y),T,D),S)f.x+=A+h;else if(typeof D.text!="string"){const j=c.lineHeight;f.y+=Lo(D,j)+h}else f.y+=v}),uo(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,s=Z(e.font),n=ut(e.padding);if(!e.display)return;const o=ne(t.rtl,this.left,this.width),r=this.ctx,a=e.position,l=s.size/2,c=n.top+l;let h,d=this.left,u=this.width;if(this.isHorizontal())u=Math.max(...this.lineWidths),h=this.top+c,d=Q(t.align,d,this.right-u);else{const p=this.columnSizes.reduce((m,b)=>Math.max(m,b.height),0);h=c+Q(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const f=Q(a,d,d+u);r.textAlign=o.textAlign(qi(a)),r.textBaseline="middle",r.strokeStyle=e.color,r.fillStyle=e.color,r.font=s.string,Le(r,e.text,f,h,s)}_computeTitleHeight(){const t=this.options.title,e=Z(t.font),s=ut(t.padding);return t.display?e.lineHeight+s.height:0}_getLegendItemAt(t,e){let s,n,o;if(Yt(t,this.left,this.right)&&Yt(e,this.top,this.bottom)){for(o=this.legendHitBoxes,s=0;s<o.length;++s)if(n=o[s],Yt(t,n.left,n.left+n.width)&&Yt(e,n.top,n.top+n.height))return this.legendItems[s]}return null}handleEvent(t){const e=this.options;if(!ld(t.type,e))return;const s=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const n=this._hoveredItem,o=nd(n,s);n&&!o&&V(e.onLeave,[t,n,this],this),this._hoveredItem=s,s&&!o&&V(e.onHover,[t,s,this],this)}else s&&V(e.onClick,[t,s,this],this)}}function od(i,t,e,s,n){const o=rd(s,i,t,e),r=ad(n,s,t.lineHeight);return{itemWidth:o,itemHeight:r}}function rd(i,t,e,s){let n=i.text;return n&&typeof n!="string"&&(n=n.reduce((o,r)=>o.length>r.length?o:r)),t+e.size/2+s.measureText(n).width}function ad(i,t,e){let s=i;return typeof t.text!="string"&&(s=Lo(t,e)),s}function Lo(i,t){const e=i.text?i.text.length:0;return t*e}function ld(i,t){return!!((i==="mousemove"||i==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(i==="click"||i==="mouseup"))}var cd={id:"legend",_element:un,start(i,t,e){const s=i.legend=new un({ctx:i.ctx,options:e,chart:i});ct.configure(i,s,e),ct.addBox(i,s)},stop(i){ct.removeBox(i,i.legend),delete i.legend},beforeUpdate(i,t,e){const s=i.legend;ct.configure(i,s,e),s.options=e},afterUpdate(i){const t=i.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(i,t){t.replay||i.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(i,t,e){const s=t.datasetIndex,n=e.chart;n.isDatasetVisible(s)?(n.hide(s),t.hidden=!0):(n.show(s),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:i=>i.chart.options.color,boxWidth:40,padding:10,generateLabels(i){const t=i.data.datasets,{labels:{usePointStyle:e,pointStyle:s,textAlign:n,color:o,useBorderRadius:r,borderRadius:a}}=i.legend.options;return i._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(e?0:void 0),h=ut(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(h.width+h.height)/4,strokeStyle:c.borderColor,pointStyle:s||c.pointStyle,rotation:c.rotation,textAlign:n||c.textAlign,borderRadius:r&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:i=>i.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:i=>!i.startsWith("on"),labels:{_scriptable:i=>!["generateLabels","filter","sort"].includes(i)}}};class Ro extends Et{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 s=this.options;if(this.left=0,this.top=0,!s.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const n=G(s.text)?s.text.length:1;this._padding=ut(s.padding);const o=n*Z(s.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:s,bottom:n,right:o,options:r}=this,a=r.align;let l=0,c,h,d;return this.isHorizontal()?(h=Q(a,s,o),d=e+t,c=o-s):(r.position==="left"?(h=s+t,d=Q(a,n,e),l=J*-.5):(h=o-t,d=Q(a,e,n),l=J*.5),c=n-e),{titleX:h,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const s=Z(e.font),o=s.lineHeight/2+this._padding.top,{titleX:r,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(o);Le(t,e.text,0,0,s,{color:e.color,maxWidth:l,rotation:c,textAlign:qi(e.align),textBaseline:"middle",translation:[r,a]})}}function hd(i,t){const e=new Ro({ctx:i.ctx,options:t,chart:i});ct.configure(i,e,t),ct.addBox(i,e),i.titleBlock=e}var dd={id:"title",_element:Ro,start(i,t,e){hd(i,e)},stop(i){const t=i.titleBlock;ct.removeBox(i,t),delete i.titleBlock},beforeUpdate(i,t,e){const s=i.titleBlock;ct.configure(i,s,e),s.options=e},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}};const ve={average(i){if(!i.length)return!1;let t,e,s=new Set,n=0,o=0;for(t=0,e=i.length;t<e;++t){const a=i[t].element;if(a&&a.hasValue()){const l=a.tooltipPosition();s.add(l.x),n+=l.y,++o}}return o===0||s.size===0?!1:{x:[...s].reduce((a,l)=>a+l)/s.size,y:n/o}},nearest(i,t){if(!i.length)return!1;let e=t.x,s=t.y,n=Number.POSITIVE_INFINITY,o,r,a;for(o=0,r=i.length;o<r;++o){const l=i[o].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),h=Li(t,c);h<n&&(n=h,a=l)}}if(a){const l=a.tooltipPosition();e=l.x,s=l.y}return{x:e,y:s}}};function _t(i,t){return t&&(G(t)?Array.prototype.push.apply(i,t):i.push(t)),i}function Pt(i){return(typeof i=="string"||i instanceof String)&&i.indexOf(`
`)>-1?i.split(`
`):i}function ud(i,t){const{element:e,datasetIndex:s,index:n}=t,o=i.getDatasetMeta(s).controller,{label:r,value:a}=o.getLabelAndValue(n);return{chart:i,label:r,parsed:o.getParsed(n),raw:i.data.datasets[s].data[n],formattedValue:a,dataset:o.getDataset(),dataIndex:n,datasetIndex:s,element:e}}function fn(i,t){const e=i.chart.ctx,{body:s,footer:n,title:o}=i,{boxWidth:r,boxHeight:a}=t,l=Z(t.bodyFont),c=Z(t.titleFont),h=Z(t.footerFont),d=o.length,u=n.length,f=s.length,p=ut(t.padding);let m=p.height,b=0,_=s.reduce((P,v)=>P+v.before.length+v.lines.length+v.after.length,0);if(_+=i.beforeBody.length+i.afterBody.length,d&&(m+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),_){const P=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;m+=f*P+(_-f)*l.lineHeight+(_-1)*t.bodySpacing}u&&(m+=t.footerMarginTop+u*h.lineHeight+(u-1)*t.footerSpacing);let x=0;const S=function(P){b=Math.max(b,e.measureText(P).width+x)};return e.save(),e.font=c.string,z(i.title,S),e.font=l.string,z(i.beforeBody.concat(i.afterBody),S),x=t.displayColors?r+2+t.boxPadding:0,z(s,P=>{z(P.before,S),z(P.lines,S),z(P.after,S)}),x=0,e.font=h.string,z(i.footer,S),e.restore(),b+=p.width,{width:b,height:m}}function fd(i,t){const{y:e,height:s}=t;return e<s/2?"top":e>i.height-s/2?"bottom":"center"}function gd(i,t,e,s){const{x:n,width:o}=s,r=e.caretSize+e.caretPadding;if(i==="left"&&n+o+r>t.width||i==="right"&&n-o-r<0)return!0}function pd(i,t,e,s){const{x:n,width:o}=e,{width:r,chartArea:{left:a,right:l}}=i;let c="center";return s==="center"?c=n<=(a+l)/2?"left":"right":n<=o/2?c="left":n>=r-o/2&&(c="right"),gd(c,i,t,e)&&(c="center"),c}function gn(i,t,e){const s=e.yAlign||t.yAlign||fd(i,e);return{xAlign:e.xAlign||t.xAlign||pd(i,t,e,s),yAlign:s}}function md(i,t){let{x:e,width:s}=i;return t==="right"?e-=s:t==="center"&&(e-=s/2),e}function bd(i,t,e){let{y:s,height:n}=i;return t==="top"?s+=e:t==="bottom"?s-=n+e:s-=n/2,s}function pn(i,t,e,s){const{caretSize:n,caretPadding:o,cornerRadius:r}=i,{xAlign:a,yAlign:l}=e,c=n+o,{topLeft:h,topRight:d,bottomLeft:u,bottomRight:f}=se(r);let p=md(t,a);const m=bd(t,l,c);return l==="center"?a==="left"?p+=c:a==="right"&&(p-=c):a==="left"?p-=Math.max(h,u)+n:a==="right"&&(p+=Math.max(d,f)+n),{x:nt(p,0,s.width-t.width),y:nt(m,0,s.height-t.height)}}function Je(i,t,e){const s=ut(e.padding);return t==="center"?i.x+i.width/2:t==="right"?i.x+i.width-s.right:i.x+s.left}function mn(i){return _t([],Pt(i))}function _d(i,t,e){return qt(i,{tooltip:t,tooltipItems:e,type:"tooltip"})}function bn(i,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?i.override(e):i}const Ao={beforeTitle:wt,title(i){if(i.length>0){const t=i[0],e=t.chart.data.labels,s=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(s>0&&t.dataIndex<s)return e[t.dataIndex]}return""},afterTitle:wt,beforeBody:wt,beforeLabel:wt,label(i){if(this&&this.options&&this.options.mode==="dataset")return i.label+": "+i.formattedValue||i.formattedValue;let t=i.dataset.label||"";t&&(t+=": ");const e=i.formattedValue;return W(e)||(t+=e),t},labelColor(i){const e=i.chart.getDatasetMeta(i.datasetIndex).controller.getStyle(i.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(i){const e=i.chart.getDatasetMeta(i.datasetIndex).controller.getStyle(i.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:wt,afterBody:wt,beforeFooter:wt,footer:wt,afterFooter:wt};function tt(i,t,e,s){const n=i[t].call(e,s);return typeof n>"u"?Ao[t].call(e,s):n}class _n extends Et{static positioners=ve;constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,s=this.options.setContext(this.getContext()),n=s.enabled&&e.options.animation&&s.animations,o=new go(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=_d(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:s}=e,n=tt(s,"beforeTitle",this,t),o=tt(s,"title",this,t),r=tt(s,"afterTitle",this,t);let a=[];return a=_t(a,Pt(n)),a=_t(a,Pt(o)),a=_t(a,Pt(r)),a}getBeforeBody(t,e){return mn(tt(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:s}=e,n=[];return z(t,o=>{const r={before:[],lines:[],after:[]},a=bn(s,o);_t(r.before,Pt(tt(a,"beforeLabel",this,o))),_t(r.lines,tt(a,"label",this,o)),_t(r.after,Pt(tt(a,"afterLabel",this,o))),n.push(r)}),n}getAfterBody(t,e){return mn(tt(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:s}=e,n=tt(s,"beforeFooter",this,t),o=tt(s,"footer",this,t),r=tt(s,"afterFooter",this,t);let a=[];return a=_t(a,Pt(n)),a=_t(a,Pt(o)),a=_t(a,Pt(r)),a}_createItems(t){const e=this._active,s=this.chart.data,n=[],o=[],r=[];let a=[],l,c;for(l=0,c=e.length;l<c;++l)a.push(ud(this.chart,e[l]));return t.filter&&(a=a.filter((h,d,u)=>t.filter(h,d,u,s))),t.itemSort&&(a=a.sort((h,d)=>t.itemSort(h,d,s))),z(a,h=>{const d=bn(t.callbacks,h);n.push(tt(d,"labelColor",this,h)),o.push(tt(d,"labelPointStyle",this,h)),r.push(tt(d,"labelTextColor",this,h))}),this.labelColors=n,this.labelPointStyles=o,this.labelTextColors=r,this.dataPoints=a,a}update(t,e){const s=this.options.setContext(this.getContext()),n=this._active;let o,r=[];if(!n.length)this.opacity!==0&&(o={opacity:0});else{const a=ve[s.position].call(this,n,this._eventPosition);r=this._createItems(s),this.title=this.getTitle(r,s),this.beforeBody=this.getBeforeBody(r,s),this.body=this.getBody(r,s),this.afterBody=this.getAfterBody(r,s),this.footer=this.getFooter(r,s);const l=this._size=fn(this,s),c=Object.assign({},a,l),h=gn(this.chart,s,c),d=pn(s,c,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,o={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=r,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&s.external&&s.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,s,n){const o=this.getCaretPosition(t,s,n);e.lineTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.lineTo(o.x3,o.y3)}getCaretPosition(t,e,s){const{xAlign:n,yAlign:o}=this,{caretSize:r,cornerRadius:a}=s,{topLeft:l,topRight:c,bottomLeft:h,bottomRight:d}=se(a),{x:u,y:f}=t,{width:p,height:m}=e;let b,_,x,S,P,v;return o==="center"?(P=f+m/2,n==="left"?(b=u,_=b-r,S=P+r,v=P-r):(b=u+p,_=b+r,S=P-r,v=P+r),x=b):(n==="left"?_=u+Math.max(l,h)+r:n==="right"?_=u+p-Math.max(c,d)-r:_=this.caretX,o==="top"?(S=f,P=S-r,b=_-r,x=_+r):(S=f+m,P=S+r,b=_+r,x=_-r),v=S),{x1:b,x2:_,x3:x,y1:S,y2:P,y3:v}}drawTitle(t,e,s){const n=this.title,o=n.length;let r,a,l;if(o){const c=ne(s.rtl,this.x,this.width);for(t.x=Je(this,s.titleAlign,s),e.textAlign=c.textAlign(s.titleAlign),e.textBaseline="middle",r=Z(s.titleFont),a=s.titleSpacing,e.fillStyle=s.titleColor,e.font=r.string,l=0;l<o;++l)e.fillText(n[l],c.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+a,l+1===o&&(t.y+=s.titleMarginBottom-a)}}_drawColorBox(t,e,s,n,o){const r=this.labelColors[s],a=this.labelPointStyles[s],{boxHeight:l,boxWidth:c}=o,h=Z(o.bodyFont),d=Je(this,"left",o),u=n.x(d),f=l<h.lineHeight?(h.lineHeight-l)/2:0,p=e.y+f;if(o.usePointStyle){const m={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},b=n.leftForLtr(u,c)+c/2,_=p+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,Ai(t,m,b,_),t.strokeStyle=r.borderColor,t.fillStyle=r.backgroundColor,Ai(t,m,b,_)}else{t.lineWidth=E(r.borderWidth)?Math.max(...Object.values(r.borderWidth)):r.borderWidth||1,t.strokeStyle=r.borderColor,t.setLineDash(r.borderDash||[]),t.lineDashOffset=r.borderDashOffset||0;const m=n.leftForLtr(u,c),b=n.leftForLtr(n.xPlus(u,1),c-2),_=se(r.borderRadius);Object.values(_).some(x=>x!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,ri(t,{x:m,y:p,w:c,h:l,radius:_}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),ri(t,{x:b,y:p+1,w:c-2,h:l-2,radius:_}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(m,p,c,l),t.strokeRect(m,p,c,l),t.fillStyle=r.backgroundColor,t.fillRect(b,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[s]}drawBody(t,e,s){const{body:n}=this,{bodySpacing:o,bodyAlign:r,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:h}=s,d=Z(s.bodyFont);let u=d.lineHeight,f=0;const p=ne(s.rtl,this.x,this.width),m=function(k){e.fillText(k,p.x(t.x+f),t.y+u/2),t.y+=u+o},b=p.textAlign(r);let _,x,S,P,v,D,w;for(e.textAlign=r,e.textBaseline="middle",e.font=d.string,t.x=Je(this,b,s),e.fillStyle=s.bodyColor,z(this.beforeBody,m),f=a&&b!=="right"?r==="center"?c/2+h:c+2+h:0,P=0,D=n.length;P<D;++P){for(_=n[P],x=this.labelTextColors[P],e.fillStyle=x,z(_.before,m),S=_.lines,a&&S.length&&(this._drawColorBox(e,t,P,p,s),u=Math.max(d.lineHeight,l)),v=0,w=S.length;v<w;++v)m(S[v]),u=d.lineHeight;z(_.after,m)}f=0,u=d.lineHeight,z(this.afterBody,m),t.y-=o}drawFooter(t,e,s){const n=this.footer,o=n.length;let r,a;if(o){const l=ne(s.rtl,this.x,this.width);for(t.x=Je(this,s.footerAlign,s),t.y+=s.footerMarginTop,e.textAlign=l.textAlign(s.footerAlign),e.textBaseline="middle",r=Z(s.footerFont),e.fillStyle=s.footerColor,e.font=r.string,a=0;a<o;++a)e.fillText(n[a],l.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+s.footerSpacing}}drawBackground(t,e,s,n){const{xAlign:o,yAlign:r}=this,{x:a,y:l}=t,{width:c,height:h}=s,{topLeft:d,topRight:u,bottomLeft:f,bottomRight:p}=se(n.cornerRadius);e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.beginPath(),e.moveTo(a+d,l),r==="top"&&this.drawCaret(t,e,s,n),e.lineTo(a+c-u,l),e.quadraticCurveTo(a+c,l,a+c,l+u),r==="center"&&o==="right"&&this.drawCaret(t,e,s,n),e.lineTo(a+c,l+h-p),e.quadraticCurveTo(a+c,l+h,a+c-p,l+h),r==="bottom"&&this.drawCaret(t,e,s,n),e.lineTo(a+f,l+h),e.quadraticCurveTo(a,l+h,a,l+h-f),r==="center"&&o==="left"&&this.drawCaret(t,e,s,n),e.lineTo(a,l+d),e.quadraticCurveTo(a,l,a+d,l),e.closePath(),e.fill(),n.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,s=this.$animations,n=s&&s.x,o=s&&s.y;if(n||o){const r=ve[t.position].call(this,this._active,this._eventPosition);if(!r)return;const a=this._size=fn(this,t),l=Object.assign({},r,this._size),c=gn(e,t,l),h=pn(t,l,c,e);(n._to!==h.x||o._to!==h.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=r.x,this.caretY=r.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let s=this.opacity;if(!s)return;this._updateAnimationTarget(e);const n={width:this.width,height:this.height},o={x:this.x,y:this.y};s=Math.abs(s)<.001?0:s;const r=ut(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=s,this.drawBackground(o,t,n,e),ho(t,e.textDirection),o.y+=r.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),uo(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const s=this._active,n=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),o=!si(s,n),r=this._positionChanged(n,e);(o||r)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,s=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const n=this.options,o=this._active||[],r=this._getActiveElements(t,o,e,s),a=this._positionChanged(r,t),l=e||!si(r,o)||a;return l&&(this._active=r,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,s,n){const o=this.options;if(t.type==="mouseout")return[];if(!n)return e.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const r=this.chart.getElementsAtEventForMode(t,o.mode,o,s);return o.reverse&&r.reverse(),r}_positionChanged(t,e){const{caretX:s,caretY:n,options:o}=this,r=ve[o.position].call(this,t,e);return r!==!1&&(s!==r.x||n!==r.y)}}var xd={id:"tooltip",_element:_n,positioners:ve,afterInit(i,t,e){e&&(i.tooltip=new _n({chart:i,options:e}))},beforeUpdate(i,t,e){i.tooltip&&i.tooltip.initialize(e)},reset(i,t,e){i.tooltip&&i.tooltip.initialize(e)},afterDraw(i){const t=i.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(i.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(i.ctx),i.notifyPlugins("afterTooltipDraw",e)}},afterEvent(i,t){if(i.tooltip){const e=t.replay;i.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.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:(i,t)=>t.bodyFont.size,boxWidth:(i,t)=>t.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:Ao},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:i=>i!=="filter"&&i!=="itemSort"&&i!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const yd=(i,t,e,s)=>(typeof t=="string"?(e=i.push(t)-1,s.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function vd(i,t,e,s){const n=i.indexOf(t);if(n===-1)return yd(i,t,e,s);const o=i.lastIndexOf(t);return n!==o?e:n}const Sd=(i,t)=>i===null?null:nt(Math.round(i),0,t);function xn(i){const t=this.getLabels();return i>=0&&i<t.length?t[i]:i}class wd extends ce{static id="category";static defaults={ticks:{callback:xn}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const s=this.getLabels();for(const{index:n,label:o}of e)s[n]===o&&s.splice(n,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(W(t))return null;const s=this.getLabels();return e=isFinite(e)&&s[e]===t?e:vd(s,t,I(e,t),this._addedLabels),Sd(e,s.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:s,max:n}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(s=0),e||(n=this.getLabels().length-1)),this.min=s,this.max=n}buildTicks(){const t=this.min,e=this.max,s=this.options.offset,n=[];let o=this.getLabels();o=t===0&&e===o.length-1?o:o.slice(t,e+1),this._valueRange=Math.max(o.length-(s?0:1),1),this._startValue=this.min-(s?.5:0);for(let r=t;r<=e;r++)n.push({value:r});return n}getLabelForValue(t){return xn.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.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 kd(i,t){const e=[],{bounds:n,step:o,min:r,max:a,precision:l,count:c,maxTicks:h,maxDigits:d,includeBounds:u}=i,f=o||1,p=h-1,{min:m,max:b}=t,_=!W(r),x=!W(a),S=!W(c),P=(b-m)/(d+1);let v=_s((b-m)/p/f)*f,D,w,k,O;if(v<1e-14&&!_&&!x)return[{value:m},{value:b}];O=Math.ceil(b/v)-Math.floor(m/v),O>p&&(v=_s(O*v/p/f)*f),W(l)||(D=Math.pow(10,l),v=Math.ceil(v*D)/D),n==="ticks"?(w=Math.floor(m/v)*v,k=Math.ceil(b/v)*v):(w=m,k=b),_&&x&&o&&Xa((a-r)/o,v/1e3)?(O=Math.round(Math.min((a-r)/v,h)),v=(a-r)/O,w=r,k=a):S?(w=_?r:w,k=x?a:k,O=c-1,v=(k-w)/O):(O=(k-w)/v,we(O,Math.round(O),v/1e3)?O=Math.round(O):O=Math.ceil(O));const A=Math.max(xs(v),xs(w));D=Math.pow(10,W(l)?A:l),w=Math.round(w*D)/D,k=Math.round(k*D)/D;let y=0;for(_&&(u&&w!==r?(e.push({value:r}),w<r&&y++,we(Math.round((w+y*v)*D)/D,r,yn(r,P,i))&&y++):w<r&&y++);y<O;++y){const T=Math.round((w+y*v)*D)/D;if(x&&T>a)break;e.push({value:T})}return x&&u&&k!==a?e.length&&we(e[e.length-1].value,a,yn(a,P,i))?e[e.length-1].value=a:e.push({value:a}):(!x||k===a)&&e.push({value:k}),e}function yn(i,t,{horizontal:e,minRotation:s}){const n=Ut(s),o=(e?Math.sin(n):Math.cos(n))||.001,r=.75*t*(""+i).length;return Math.min(t/o,r)}class Pd extends ce{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 W(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:s}=this.getUserBounds();let{min:n,max:o}=this;const r=l=>n=e?n:l,a=l=>o=s?o:l;if(t){const l=St(n),c=St(o);l<0&&c<0?a(0):l>0&&c>0&&r(0)}if(n===o){let l=o===0?1:Math.abs(o*.05);a(o+l),t||r(n-l)}this.min=n,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:s}=t,n;return s?(n=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,n>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${n} ticks. Limiting to 1000.`),n=1e3)):(n=this.computeTickLimit(),e=e||11),e&&(n=Math.min(e,n)),n}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let s=this.getTickLimit();s=Math.max(2,s);const n={maxTicks:s,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:e.includeBounds!==!1},o=this._range||this,r=kd(n,o);return t.bounds==="ticks"&&Ga(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){const t=this.ticks;let e=this.min,s=this.max;if(super.configure(),this.options.offset&&t.length){const n=(s-e)/Math.max(t.length-1,1)/2;e-=n,s+=n}this._startValue=e,this._endValue=s,this._valueRange=s-e}getLabelForValue(t){return Zn(t,this.chart.options.locale,this.options.ticks.format)}}class Md extends Pd{static id="linear";static defaults={ticks:{callback:eo.formatters.numeric}};determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=dt(t)?t:0,this.max=dt(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,s=Ut(this.options.ticks.minRotation),n=(t?Math.sin(s):Math.cos(s))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,o.lineHeight/n))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}const fi={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}},et=Object.keys(fi);function vn(i,t){return i-t}function Sn(i,t){if(W(t))return null;const e=i._adapter,{parser:s,round:n,isoWeekday:o}=i._parseOpts;let r=t;return typeof s=="function"&&(r=s(r)),dt(r)||(r=typeof s=="string"?e.parse(r,s):e.parse(r)),r===null?null:(n&&(r=n==="week"&&(Oe(o)||o===!0)?e.startOf(r,"isoWeek",o):e.startOf(r,n)),+r)}function wn(i,t,e,s){const n=et.length;for(let o=et.indexOf(i);o<n-1;++o){const r=fi[et[o]],a=r.steps?r.steps:Number.MAX_SAFE_INTEGER;if(r.common&&Math.ceil((e-t)/(a*r.size))<=s)return et[o]}return et[n-1]}function Cd(i,t,e,s,n){for(let o=et.length-1;o>=et.indexOf(e);o--){const r=et[o];if(fi[r].common&&i._adapter.diff(n,s,r)>=t-1)return r}return et[e?et.indexOf(e):0]}function Dd(i){for(let t=et.indexOf(i)+1,e=et.length;t<e;++t)if(fi[et[t]].common)return et[t]}function kn(i,t,e){if(!e)i[t]=!0;else if(e.length){const{lo:s,hi:n}=Ji(e,t),o=e[s]>=t?e[s]:e[n];i[o]=!0}}function Od(i,t,e,s){const n=i._adapter,o=+n.startOf(t[0].value,s),r=t[t.length-1].value;let a,l;for(a=o;a<=r;a=+n.add(a,1,s))l=e[a],l>=0&&(t[l].major=!0);return t}function Pn(i,t,e){const s=[],n={},o=t.length;let r,a;for(r=0;r<o;++r)a=t[r],n[a]=r,s.push({value:a,major:!1});return o===0||!e?s:Od(i,s,n,e)}class Mn extends ce{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const s=t.time||(t.time={}),n=this._adapter=new Lc._date(t.adapters.date);n.init(e),Se(s.displayFormats,n.formats()),this._parseOpts={parser:s.parser,round:s.round,isoWeekday:s.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:Sn(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,s=t.time.unit||"day";let{min:n,max:o,minDefined:r,maxDefined:a}=this.getUserBounds();function l(c){!r&&!isNaN(c.min)&&(n=Math.min(n,c.min)),!a&&!isNaN(c.max)&&(o=Math.max(o,c.max))}(!r||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),n=dt(n)&&!isNaN(n)?n:+e.startOf(Date.now(),s),o=dt(o)&&!isNaN(o)?o:+e.endOf(Date.now(),s)+1,this.min=Math.min(n,o-1),this.max=Math.max(n+1,o)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],s=t[t.length-1]),{min:e,max:s}}buildTicks(){const t=this.options,e=t.time,s=t.ticks,n=s.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&n.length&&(this.min=this._userMin||n[0],this.max=this._userMax||n[n.length-1]);const o=this.min,r=this.max,a=el(n,o,r);return this._unit=e.unit||(s.autoSkip?wn(e.minUnit,this.min,this.max,this._getLabelCapacity(o)):Cd(this,a.length,e.minUnit,this.min,this.max)),this._majorUnit=!s.major.enabled||this._unit==="year"?void 0:Dd(this._unit),this.initOffsets(n),t.reverse&&a.reverse(),Pn(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,s=0,n,o;this.options.offset&&t.length&&(n=this.getDecimalForValue(t[0]),t.length===1?e=1-n:e=(this.getDecimalForValue(t[1])-n)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?s=o:s=(o-this.getDecimalForValue(t[t.length-2]))/2);const r=t.length<3?.5:.25;e=nt(e,0,r),s=nt(s,0,r),this._offsets={start:e,end:s,factor:1/(e+1+s)}}_generate(){const t=this._adapter,e=this.min,s=this.max,n=this.options,o=n.time,r=o.unit||wn(o.minUnit,e,s,this._getLabelCapacity(e)),a=I(n.ticks.stepSize,1),l=r==="week"?o.isoWeekday:!1,c=Oe(l)||l===!0,h={};let d=e,u,f;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":r),t.diff(s,e,r)>1e5*a)throw new Error(e+" and "+s+" are too far apart with stepSize of "+a+" "+r);const p=n.ticks.source==="data"&&this.getDataTimestamps();for(u=d,f=0;u<s;u=+t.add(u,a,r),f++)kn(h,u,p);return(u===s||n.bounds==="ticks"||f===1)&&kn(h,u,p),Object.keys(h).sort(vn).map(m=>+m)}getLabelForValue(t){const e=this._adapter,s=this.options.time;return s.tooltipFormat?e.format(t,s.tooltipFormat):e.format(t,s.displayFormats.datetime)}format(t,e){const n=this.options.time.displayFormats,o=this._unit,r=e||n[o];return this._adapter.format(t,r)}_tickFormatFunction(t,e,s,n){const o=this.options,r=o.ticks.callback;if(r)return V(r,[t,e,s],this);const a=o.time.displayFormats,l=this._unit,c=this._majorUnit,h=l&&a[l],d=c&&a[c],u=s[e],f=c&&d&&u&&u.major;return this._adapter.format(t,n||(f?d:h))}generateTickLabels(t){let e,s,n;for(e=0,s=t.length;e<s;++e)n=t[e],n.label=this._tickFormatFunction(n.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,s=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+s)*e.factor)}getValueForPixel(t){const e=this._offsets,s=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+s*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,s=this.ctx.measureText(t).width,n=Ut(this.isHorizontal()?e.maxRotation:e.minRotation),o=Math.cos(n),r=Math.sin(n),a=this._resolveTickFontOptions(0).size;return{w:s*o+a*r,h:s*r+a*o}}_getLabelCapacity(t){const e=this.options.time,s=e.displayFormats,n=s[e.unit]||s.millisecond,o=this._tickFormatFunction(t,0,Pn(this,[t],this._majorUnit),n),r=this._getLabelSize(o),a=Math.floor(this.isHorizontal()?this.width/r.w:this.height/r.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],e,s;if(t.length)return t;const n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(e=0,s=n.length;e<s;++e)t=t.concat(n[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,s;if(t.length)return t;const n=this.getLabels();for(e=0,s=n.length;e<s;++e)t.push(Sn(this,n[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Jn(t.sort(vn))}}function qe(i,t,e){let s=0,n=i.length-1,o,r,a,l;e?(t>=i[s].pos&&t<=i[n].pos&&({lo:s,hi:n}=Kt(i,"pos",t)),{pos:o,time:a}=i[s],{pos:r,time:l}=i[n]):(t>=i[s].time&&t<=i[n].time&&({lo:s,hi:n}=Kt(i,"time",t)),{time:o,pos:a}=i[s],{time:r,pos:l}=i[n]);const c=r-o;return c?a+(l-a)*(t-o)/c:a}class Ig extends Mn{static id="timeseries";static defaults=Mn.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=qe(e,this.min),this._tableRange=qe(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:s}=this,n=[],o=[];let r,a,l,c,h;for(r=0,a=t.length;r<a;++r)c=t[r],c>=e&&c<=s&&n.push(c);if(n.length<2)return[{time:e,pos:0},{time:s,pos:1}];for(r=0,a=n.length;r<a;++r)h=n[r+1],l=n[r-1],c=n[r],Math.round((h+l)/2)!==c&&o.push({time:c,pos:r/(a-1)});return o}_generate(){const t=this.min,e=this.max;let s=super.getDataTimestamps();return(!s.includes(t)||!s.length)&&s.splice(0,0,t),(!s.includes(e)||s.length===1)&&s.push(e),s.sort((n,o)=>n-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),s=this.getLabelTimestamps();return e.length&&s.length?t=this.normalize(e.concat(s)):t=e.length?e:s,t=this._cache.all=t,t}getDecimalForValue(t){return(qe(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,s=this.getDecimalForPixel(t)/e.factor-e.end;return qe(this._table,s*this._tableRange+this._minPos,!0)}}const Io={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},Td={ariaLabel:{type:String},ariaDescribedby:{type:String}},Ld={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...Io,...Td},Rd=Go[0]==="2"?(i,t)=>Object.assign(i,{attrs:t}):(i,t)=>Object.assign(i,t);function ee(i){return Fn(i)?Di(i):i}function Ad(i){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:i;return Fn(t)?new Proxy(i,{}):i}function Id(i,t){const e=i.options;e&&t&&Object.assign(e,t)}function Eo(i,t){i.labels=t}function Fo(i,t,e){const s=[];i.datasets=t.map(n=>{const o=i.datasets.find(r=>r[e]===n[e]);return!o||!n.data||s.includes(o)?{...n}:(s.push(o),Object.assign(o,n),o)})}function Ed(i,t){const e={labels:[],datasets:[]};return Eo(e,i.labels),Fo(e,i.datasets,t),e}const Fd=In({props:Ld,setup(i,t){let{expose:e,slots:s}=t;const n=st(null),o=En(null);e({chart:o});const r=()=>{if(!n.value)return;const{type:c,data:h,options:d,plugins:u,datasetIdKey:f}=i,p=Ed(h,f),m=Ad(p,h);o.value=new ui(n.value,{type:c,data:m,options:{...d},plugins:u})},a=()=>{const c=Di(o.value);c&&(i.destroyDelay>0?setTimeout(()=>{c.destroy(),o.value=null},i.destroyDelay):(c.destroy(),o.value=null))},l=c=>{c.update(i.updateMode)};return ji(r),Jo(a),An([()=>i.options,()=>i.data],(c,h)=>{let[d,u]=c,[f,p]=h;const m=Di(o.value);if(!m)return;let b=!1;if(d){const _=ee(d),x=ee(f);_&&_!==x&&(Id(m,_),b=!0)}if(u){const _=ee(u.labels),x=ee(p.labels),S=ee(u.datasets),P=ee(p.datasets);_!==x&&(Eo(m.config.data,_),b=!0),S&&S!==P&&(Fo(m.config.data,S,i.datasetIdKey),b=!0)}b&&qo(()=>{l(m)})},{deep:!0}),()=>Ci("canvas",{role:"img",ariaLabel:i.ariaLabel,ariaDescribedby:i.ariaDescribedby,ref:n},[Ci("p",{},[s.default?s.default():""])])}});function Bo(i,t){return ui.register(t),In({props:Io,setup(e,s){let{expose:n}=s;const o=En(null),r=a=>{o.value=a?.chart};return n({chart:o}),()=>Ci(Fd,Rd({ref:r},{type:i,...e}))}})}const Bd=Bo("bar",bo),zd=Bo("line",_o);function Ct(i){return Array.isArray?Array.isArray(i):No(i)==="[object Array]"}const $d=1/0;function Nd(i){if(typeof i=="string")return i;let t=i+"";return t=="0"&&1/i==-$d?"-0":t}function Hd(i){return i==null?"":Nd(i)}function yt(i){return typeof i=="string"}function zo(i){return typeof i=="number"}function Wd(i){return i===!0||i===!1||Vd(i)&&No(i)=="[object Boolean]"}function $o(i){return typeof i=="object"}function Vd(i){return $o(i)&&i!==null}function it(i){return i!=null}function Mi(i){return!i.trim().length}function No(i){return i==null?i===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(i)}const jd="Incorrect 'index' type",Ud=i=>`Invalid value for key ${i}`,Yd=i=>`Pattern length exceeds max of ${i}.`,Kd=i=>`Missing ${i} property in key`,Xd=i=>`Property 'weight' in key '${i}' must be a positive integer`,Cn=Object.prototype.hasOwnProperty;class Gd{constructor(t){this._keys=[],this._keyMap={};let e=0;t.forEach(s=>{let n=Ho(s);this._keys.push(n),this._keyMap[n.id]=n,e+=n.weight}),this._keys.forEach(s=>{s.weight/=e})}get(t){return this._keyMap[t]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function Ho(i){let t=null,e=null,s=null,n=1,o=null;if(yt(i)||Ct(i))s=i,t=Dn(i),e=Bi(i);else{if(!Cn.call(i,"name"))throw new Error(Kd("name"));const r=i.name;if(s=r,Cn.call(i,"weight")&&(n=i.weight,n<=0))throw new Error(Xd(r));t=Dn(r),e=Bi(r),o=i.getFn}return{path:t,id:e,weight:n,src:s,getFn:o}}function Dn(i){return Ct(i)?i:i.split(".")}function Bi(i){return Ct(i)?i.join("."):i}function Jd(i,t){let e=[],s=!1;const n=(o,r,a)=>{if(it(o))if(!r[a])e.push(o);else{let l=r[a];const c=o[l];if(!it(c))return;if(a===r.length-1&&(yt(c)||zo(c)||Wd(c)))e.push(Hd(c));else if(Ct(c)){s=!0;for(let h=0,d=c.length;h<d;h+=1)n(c[h],r,a+1)}else r.length&&n(c,r,a+1)}};return n(i,yt(t)?t.split("."):t,0),s?e:e[0]}const qd={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},Qd={isCaseSensitive:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(i,t)=>i.score===t.score?i.idx<t.idx?-1:1:i.score<t.score?-1:1},Zd={location:0,threshold:.6,distance:100},tu={useExtendedSearch:!1,getFn:Jd,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1};var L={...Qd,...qd,...Zd,...tu};const eu=/[^ ]+/g;function iu(i=1,t=3){const e=new Map,s=Math.pow(10,t);return{get(n){const o=n.match(eu).length;if(e.has(o))return e.get(o);const r=1/Math.pow(o,.5*i),a=parseFloat(Math.round(r*s)/s);return e.set(o,a),a},clear(){e.clear()}}}class ls{constructor({getFn:t=L.getFn,fieldNormWeight:e=L.fieldNormWeight}={}){this.norm=iu(e,3),this.getFn=t,this.isCreated=!1,this.setIndexRecords()}setSources(t=[]){this.docs=t}setIndexRecords(t=[]){this.records=t}setKeys(t=[]){this.keys=t,this._keysMap={},t.forEach((e,s)=>{this._keysMap[e.id]=s})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,yt(this.docs[0])?this.docs.forEach((t,e)=>{this._addString(t,e)}):this.docs.forEach((t,e)=>{this._addObject(t,e)}),this.norm.clear())}add(t){const e=this.size();yt(t)?this._addString(t,e):this._addObject(t,e)}removeAt(t){this.records.splice(t,1);for(let e=t,s=this.size();e<s;e+=1)this.records[e].i-=1}getValueForItemAtKeyId(t,e){return t[this._keysMap[e]]}size(){return this.records.length}_addString(t,e){if(!it(t)||Mi(t))return;let s={v:t,i:e,n:this.norm.get(t)};this.records.push(s)}_addObject(t,e){let s={i:e,$:{}};this.keys.forEach((n,o)=>{let r=n.getFn?n.getFn(t):this.getFn(t,n.path);if(it(r)){if(Ct(r)){let a=[];const l=[{nestedArrIndex:-1,value:r}];for(;l.length;){const{nestedArrIndex:c,value:h}=l.pop();if(it(h))if(yt(h)&&!Mi(h)){let d={v:h,i:c,n:this.norm.get(h)};a.push(d)}else Ct(h)&&h.forEach((d,u)=>{l.push({nestedArrIndex:u,value:d})})}s.$[o]=a}else if(yt(r)&&!Mi(r)){let a={v:r,n:this.norm.get(r)};s.$[o]=a}}}),this.records.push(s)}toJSON(){return{keys:this.keys,records:this.records}}}function Wo(i,t,{getFn:e=L.getFn,fieldNormWeight:s=L.fieldNormWeight}={}){const n=new ls({getFn:e,fieldNormWeight:s});return n.setKeys(i.map(Ho)),n.setSources(t),n.create(),n}function su(i,{getFn:t=L.getFn,fieldNormWeight:e=L.fieldNormWeight}={}){const{keys:s,records:n}=i,o=new ls({getFn:t,fieldNormWeight:e});return o.setKeys(s),o.setIndexRecords(n),o}function Qe(i,{errors:t=0,currentLocation:e=0,expectedLocation:s=0,distance:n=L.distance,ignoreLocation:o=L.ignoreLocation}={}){const r=t/i.length;if(o)return r;const a=Math.abs(s-e);return n?r+a/n:a?1:r}function nu(i=[],t=L.minMatchCharLength){let e=[],s=-1,n=-1,o=0;for(let r=i.length;o<r;o+=1){let a=i[o];a&&s===-1?s=o:!a&&s!==-1&&(n=o-1,n-s+1>=t&&e.push([s,n]),s=-1)}return i[o-1]&&o-s>=t&&e.push([s,o-1]),e}const jt=32;function ou(i,t,e,{location:s=L.location,distance:n=L.distance,threshold:o=L.threshold,findAllMatches:r=L.findAllMatches,minMatchCharLength:a=L.minMatchCharLength,includeMatches:l=L.includeMatches,ignoreLocation:c=L.ignoreLocation}={}){if(t.length>jt)throw new Error(Yd(jt));const h=t.length,d=i.length,u=Math.max(0,Math.min(s,d));let f=o,p=u;const m=a>1||l,b=m?Array(d):[];let _;for(;(_=i.indexOf(t,p))>-1;){let w=Qe(t,{currentLocation:_,expectedLocation:u,distance:n,ignoreLocation:c});if(f=Math.min(w,f),p=_+h,m){let k=0;for(;k<h;)b[_+k]=1,k+=1}}p=-1;let x=[],S=1,P=h+d;const v=1<<h-1;for(let w=0;w<h;w+=1){let k=0,O=P;for(;k<O;)Qe(t,{errors:w,currentLocation:u+O,expectedLocation:u,distance:n,ignoreLocation:c})<=f?k=O:P=O,O=Math.floor((P-k)/2+k);P=O;let A=Math.max(1,u-O+1),y=r?d:Math.min(u+O,d)+h,T=Array(y+2);T[y+1]=(1<<w)-1;for(let j=y;j>=A;j-=1){let H=j-1,Y=e[i.charAt(H)];if(m&&(b[H]=+!!Y),T[j]=(T[j+1]<<1|1)&Y,w&&(T[j]|=(x[j+1]|x[j])<<1|1|x[j+1]),T[j]&v&&(S=Qe(t,{errors:w,currentLocation:H,expectedLocation:u,distance:n,ignoreLocation:c}),S<=f)){if(f=S,p=H,p<=u)break;A=Math.max(1,2*u-p)}}if(Qe(t,{errors:w+1,currentLocation:u,expectedLocation:u,distance:n,ignoreLocation:c})>f)break;x=T}const D={isMatch:p>=0,score:Math.max(.001,S)};if(m){const w=nu(b,a);w.length?l&&(D.indices=w):D.isMatch=!1}return D}function ru(i){let t={};for(let e=0,s=i.length;e<s;e+=1){const n=i.charAt(e);t[n]=(t[n]||0)|1<<s-e-1}return t}class Vo{constructor(t,{location:e=L.location,threshold:s=L.threshold,distance:n=L.distance,includeMatches:o=L.includeMatches,findAllMatches:r=L.findAllMatches,minMatchCharLength:a=L.minMatchCharLength,isCaseSensitive:l=L.isCaseSensitive,ignoreLocation:c=L.ignoreLocation}={}){if(this.options={location:e,threshold:s,distance:n,includeMatches:o,findAllMatches:r,minMatchCharLength:a,isCaseSensitive:l,ignoreLocation:c},this.pattern=l?t:t.toLowerCase(),this.chunks=[],!this.pattern.length)return;const h=(u,f)=>{this.chunks.push({pattern:u,alphabet:ru(u),startIndex:f})},d=this.pattern.length;if(d>jt){let u=0;const f=d%jt,p=d-f;for(;u<p;)h(this.pattern.substr(u,jt),u),u+=jt;if(f){const m=d-jt;h(this.pattern.substr(m),m)}}else h(this.pattern,0)}searchIn(t){const{isCaseSensitive:e,includeMatches:s}=this.options;if(e||(t=t.toLowerCase()),this.pattern===t){let p={isMatch:!0,score:0};return s&&(p.indices=[[0,t.length-1]]),p}const{location:n,distance:o,threshold:r,findAllMatches:a,minMatchCharLength:l,ignoreLocation:c}=this.options;let h=[],d=0,u=!1;this.chunks.forEach(({pattern:p,alphabet:m,startIndex:b})=>{const{isMatch:_,score:x,indices:S}=ou(t,p,m,{location:n+b,distance:o,threshold:r,findAllMatches:a,minMatchCharLength:l,includeMatches:s,ignoreLocation:c});_&&(u=!0),d+=x,_&&S&&(h=[...h,...S])});let f={isMatch:u,score:u?d/this.chunks.length:1};return u&&s&&(f.indices=h),f}}class Ft{constructor(t){this.pattern=t}static isMultiMatch(t){return On(t,this.multiRegex)}static isSingleMatch(t){return On(t,this.singleRegex)}search(){}}function On(i,t){const e=i.match(t);return e?e[1]:null}class au extends Ft{constructor(t){super(t)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(t){const e=t===this.pattern;return{isMatch:e,score:e?0:1,indices:[0,this.pattern.length-1]}}}class lu extends Ft{constructor(t){super(t)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(t){const s=t.indexOf(this.pattern)===-1;return{isMatch:s,score:s?0:1,indices:[0,t.length-1]}}}class cu extends Ft{constructor(t){super(t)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(t){const e=t.startsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,this.pattern.length-1]}}}class hu extends Ft{constructor(t){super(t)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(t){const e=!t.startsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,t.length-1]}}}class du extends Ft{constructor(t){super(t)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(t){const e=t.endsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[t.length-this.pattern.length,t.length-1]}}}class uu extends Ft{constructor(t){super(t)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(t){const e=!t.endsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,t.length-1]}}}class jo extends Ft{constructor(t,{location:e=L.location,threshold:s=L.threshold,distance:n=L.distance,includeMatches:o=L.includeMatches,findAllMatches:r=L.findAllMatches,minMatchCharLength:a=L.minMatchCharLength,isCaseSensitive:l=L.isCaseSensitive,ignoreLocation:c=L.ignoreLocation}={}){super(t),this._bitapSearch=new Vo(t,{location:e,threshold:s,distance:n,includeMatches:o,findAllMatches:r,minMatchCharLength:a,isCaseSensitive:l,ignoreLocation:c})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(t){return this._bitapSearch.searchIn(t)}}class Uo extends Ft{constructor(t){super(t)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(t){let e=0,s;const n=[],o=this.pattern.length;for(;(s=t.indexOf(this.pattern,e))>-1;)e=s+o,n.push([s,e-1]);const r=!!n.length;return{isMatch:r,score:r?0:1,indices:n}}}const zi=[au,Uo,cu,hu,uu,du,lu,jo],Tn=zi.length,fu=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,gu="|";function pu(i,t={}){return i.split(gu).map(e=>{let s=e.trim().split(fu).filter(o=>o&&!!o.trim()),n=[];for(let o=0,r=s.length;o<r;o+=1){const a=s[o];let l=!1,c=-1;for(;!l&&++c<Tn;){const h=zi[c];let d=h.isMultiMatch(a);d&&(n.push(new h(d,t)),l=!0)}if(!l)for(c=-1;++c<Tn;){const h=zi[c];let d=h.isSingleMatch(a);if(d){n.push(new h(d,t));break}}}return n})}const mu=new Set([jo.type,Uo.type]);class bu{constructor(t,{isCaseSensitive:e=L.isCaseSensitive,includeMatches:s=L.includeMatches,minMatchCharLength:n=L.minMatchCharLength,ignoreLocation:o=L.ignoreLocation,findAllMatches:r=L.findAllMatches,location:a=L.location,threshold:l=L.threshold,distance:c=L.distance}={}){this.query=null,this.options={isCaseSensitive:e,includeMatches:s,minMatchCharLength:n,findAllMatches:r,ignoreLocation:o,location:a,threshold:l,distance:c},this.pattern=e?t:t.toLowerCase(),this.query=pu(this.pattern,this.options)}static condition(t,e){return e.useExtendedSearch}searchIn(t){const e=this.query;if(!e)return{isMatch:!1,score:1};const{includeMatches:s,isCaseSensitive:n}=this.options;t=n?t:t.toLowerCase();let o=0,r=[],a=0;for(let l=0,c=e.length;l<c;l+=1){const h=e[l];r.length=0,o=0;for(let d=0,u=h.length;d<u;d+=1){const f=h[d],{isMatch:p,indices:m,score:b}=f.search(t);if(p){if(o+=1,a+=b,s){const _=f.constructor.type;mu.has(_)?r=[...r,...m]:r.push(m)}}else{a=0,o=0,r.length=0;break}}if(o){let d={isMatch:!0,score:a/o};return s&&(d.indices=r),d}}return{isMatch:!1,score:1}}}const $i=[];function _u(...i){$i.push(...i)}function Ni(i,t){for(let e=0,s=$i.length;e<s;e+=1){let n=$i[e];if(n.condition(i,t))return new n(i,t)}return new Vo(i,t)}const ci={AND:"$and",OR:"$or"},Hi={PATH:"$path",PATTERN:"$val"},Wi=i=>!!(i[ci.AND]||i[ci.OR]),xu=i=>!!i[Hi.PATH],yu=i=>!Ct(i)&&$o(i)&&!Wi(i),Ln=i=>({[ci.AND]:Object.keys(i).map(t=>({[t]:i[t]}))});function Yo(i,t,{auto:e=!0}={}){const s=n=>{let o=Object.keys(n);const r=xu(n);if(!r&&o.length>1&&!Wi(n))return s(Ln(n));if(yu(n)){const l=r?n[Hi.PATH]:o[0],c=r?n[Hi.PATTERN]:n[l];if(!yt(c))throw new Error(Ud(l));const h={keyId:Bi(l),pattern:c};return e&&(h.searcher=Ni(c,t)),h}let a={children:[],operator:o[0]};return o.forEach(l=>{const c=n[l];Ct(c)&&c.forEach(h=>{a.children.push(s(h))})}),a};return Wi(i)||(i=Ln(i)),s(i)}function vu(i,{ignoreFieldNorm:t=L.ignoreFieldNorm}){i.forEach(e=>{let s=1;e.matches.forEach(({key:n,norm:o,score:r})=>{const a=n?n.weight:null;s*=Math.pow(r===0&&a?Number.EPSILON:r,(a||1)*(t?1:o))}),e.score=s})}function Su(i,t){const e=i.matches;t.matches=[],it(e)&&e.forEach(s=>{if(!it(s.indices)||!s.indices.length)return;const{indices:n,value:o}=s;let r={indices:n,value:o};s.key&&(r.key=s.key.src),s.idx>-1&&(r.refIndex=s.idx),t.matches.push(r)})}function wu(i,t){t.score=i.score}function ku(i,t,{includeMatches:e=L.includeMatches,includeScore:s=L.includeScore}={}){const n=[];return e&&n.push(Su),s&&n.push(wu),i.map(o=>{const{idx:r}=o,a={item:t[r],refIndex:r};return n.length&&n.forEach(l=>{l(o,a)}),a})}class he{constructor(t,e={},s){this.options={...L,...e},this.options.useExtendedSearch,this._keyStore=new Gd(this.options.keys),this.setCollection(t,s)}setCollection(t,e){if(this._docs=t,e&&!(e instanceof ls))throw new Error(jd);this._myIndex=e||Wo(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(t){it(t)&&(this._docs.push(t),this._myIndex.add(t))}remove(t=()=>!1){const e=[];for(let s=0,n=this._docs.length;s<n;s+=1){const o=this._docs[s];t(o,s)&&(this.removeAt(s),s-=1,n-=1,e.push(o))}return e}removeAt(t){this._docs.splice(t,1),this._myIndex.removeAt(t)}getIndex(){return this._myIndex}search(t,{limit:e=-1}={}){const{includeMatches:s,includeScore:n,shouldSort:o,sortFn:r,ignoreFieldNorm:a}=this.options;let l=yt(t)?yt(this._docs[0])?this._searchStringList(t):this._searchObjectList(t):this._searchLogical(t);return vu(l,{ignoreFieldNorm:a}),o&&l.sort(r),zo(e)&&e>-1&&(l=l.slice(0,e)),ku(l,this._docs,{includeMatches:s,includeScore:n})}_searchStringList(t){const e=Ni(t,this.options),{records:s}=this._myIndex,n=[];return s.forEach(({v:o,i:r,n:a})=>{if(!it(o))return;const{isMatch:l,score:c,indices:h}=e.searchIn(o);l&&n.push({item:o,idx:r,matches:[{score:c,value:o,norm:a,indices:h}]})}),n}_searchLogical(t){const e=Yo(t,this.options),s=(a,l,c)=>{if(!a.children){const{keyId:d,searcher:u}=a,f=this._findMatches({key:this._keyStore.get(d),value:this._myIndex.getValueForItemAtKeyId(l,d),searcher:u});return f&&f.length?[{idx:c,item:l,matches:f}]:[]}const h=[];for(let d=0,u=a.children.length;d<u;d+=1){const f=a.children[d],p=s(f,l,c);if(p.length)h.push(...p);else if(a.operator===ci.AND)return[]}return h},n=this._myIndex.records,o={},r=[];return n.forEach(({$:a,i:l})=>{if(it(a)){let c=s(e,a,l);c.length&&(o[l]||(o[l]={idx:l,item:a,matches:[]},r.push(o[l])),c.forEach(({matches:h})=>{o[l].matches.push(...h)}))}}),r}_searchObjectList(t){const e=Ni(t,this.options),{keys:s,records:n}=this._myIndex,o=[];return n.forEach(({$:r,i:a})=>{if(!it(r))return;let l=[];s.forEach((c,h)=>{l.push(...this._findMatches({key:c,value:r[h],searcher:e}))}),l.length&&o.push({idx:a,item:r,matches:l})}),o}_findMatches({key:t,value:e,searcher:s}){if(!it(e))return[];let n=[];if(Ct(e))e.forEach(({v:o,i:r,n:a})=>{if(!it(o))return;const{isMatch:l,score:c,indices:h}=s.searchIn(o);l&&n.push({score:c,key:t,value:o,idx:r,norm:a,indices:h})});else{const{v:o,n:r}=e,{isMatch:a,score:l,indices:c}=s.searchIn(o);a&&n.push({score:l,key:t,value:o,norm:r,indices:c})}return n}}he.version="7.0.0";he.createIndex=Wo;he.parseIndex=su;he.config=L;he.parseQuery=Yo;_u(bu);const Pu={class:"text-primary"},Mu={class:"text-success"},Cu={key:0,class:"text-secondary"},Du={key:1},Ou={__name:"peerRow",props:["Peer"],emits:["qrcode","configurationFile","setting","jobs","refresh","share"],setup(i,{emit:t}){const e=i,s=st(!1),n=Bn(()=>e.Peer.latest_handshake.includes(",")?e.Peer.latest_handshake.split(",")[0]:e.Peer.latest_handshake),o=zn("target");Wn(o,a=>{s.value=!1});const r=t;return(a,l)=>(M(),R("tr",null,[g("td",null,[g("small",null,F(i.Peer.name?i.Peer.name:"Untitled Peer"),1)]),g("td",null,[g("small",null,F(i.Peer.id),1)]),g("td",null,[g("small",null,F(i.Peer.allowed_ip),1)]),g("td",null,[g("small",Pu,F((i.Peer.cumu_receive+i.Peer.total_receive).toFixed(4))+" GB ",1)]),g("td",null,[g("small",Mu,F((i.Peer.cumu_sent+i.Peer.total_sent).toFixed(4))+" GB ",1)]),g("td",null,[i.Peer.latest_handshake!=="No Handshake"?(M(),R("small",Cu,[l[7]||(l[7]=g("i",{class:"bi bi-arrows-angle-contract"},null,-1)),pt(" "+F(n.value)+" ago ",1)])):(M(),R("small",Du,"N/A"))]),g("td",null,[g("a",{role:"button",class:"text-body",onClick:l[0]||(l[0]=c=>s.value=!0)},l[8]||(l[8]=[g("h5",{class:"mb-0"},[g("i",{class:"bi bi-three-dots"})],-1)])),C(q,{name:"slide-fade"},{default:X(()=>[s.value?(M(),N(Vn,{key:0,onQrcode:l[1]||(l[1]=c=>r("qrcode",c)),onConfigurationFile:l[2]||(l[2]=c=>r("configurationFile",c)),onSetting:l[3]||(l[3]=c=>r("setting")),onJobs:l[4]||(l[4]=c=>r("jobs")),onRefresh:l[5]||(l[5]=c=>r("refresh")),onShare:l[6]||(l[6]=c=>r("share")),Peer:i.Peer,ref_key:"target",ref:o},null,8,["Peer"])):B("",!0)]),_:1})])]))}},Tu=Dt(Ou,[["__scopeId","data-v-1bcea9a9"]]),Lu={class:"fixed-bottom w-100 bottom-0 z-2",style:{"z-index":"1"}},Ru={class:"container-fluid"},Au={class:"row g-0"},Iu={class:"col-md-9 col-lg-10 d-flex justify-content-center py-2"},Eu={class:"rounded-3 p-2 border shadow searchPeersContainer bg-body-tertiary"},Fu={class:"d-flex gap-1 align-items-center px-2"},Bu=["placeholder"],zu={__name:"peerSearchBar",emits:["close"],setup(i,{emit:t}){const e=Bn(()=>bt("Search Peers..."));let s;const n=st(""),o=Vi(),r=()=>{s?(clearTimeout(s),s=setTimeout(()=>{o.searchString=n.value},300)):s=setTimeout(()=>{o.searchString=n.value},300)},a=t,l=zn("searchBar");return ji(()=>{l.value.focus()}),(c,h)=>(M(),N(q,{name:"slideUp",appear:"",type:"animation",style:{"animation-delay":"1s"}},{default:X(()=>[g("div",Lu,[g("div",Ru,[g("div",Au,[h[5]||(h[5]=g("div",{class:"col-md-3 col-lg-2"},null,-1)),g("div",Iu,[g("div",Eu,[g("div",Fu,[h[4]||(h[4]=g("h6",{class:"mb-0 me-2"},[g("label",{for:"searchPeers"},[g("i",{class:"bi bi-search"})])],-1)),Ui(g("input",{ref:"searchBar",class:"form-control rounded-3 bg-secondary-subtle border-1 border-secondary-subtle",placeholder:e.value,id:"searchPeers",onKeyup:h[0]||(h[0]=d=>r()),"onUpdate:modelValue":h[1]||(h[1]=d=>n.value=d)},null,40,Bu),[[Qo,n.value]]),g("button",{onClick:h[2]||(h[2]=d=>a("close")),class:"btn bg-secondary-subtle text-secondary-emphasis border-secondary-subtle rounded-3 d-flex align-items-center"},[h[3]||(h[3]=g("i",{class:"bi bi-x-circle-fill me-2"},null,-1)),C(ft,{t:"Done"})])])])])])])])]),_:1}))}},$u=Dt(zu,[["__scopeId","data-v-a7208321"]]),Nu={name:"Dropdown",props:{width:{type:String,default:"80px"},height:{type:String,default:"auto"},title:{type:String,default:""},disabled:{type:Boolean,default:!1},defaultDisplay:{type:Boolean,default:!1}}},Hu={class:"title"};function Wu(i,t,e,s,n,o){return M(),R("div",{class:ht(["dropdown",{disabled:e.disabled}]),onClick:t[0]||(t[0]=(...r)=>i.toggleDropdown&&i.toggleDropdown(...r)),onFocusout:t[1]||(t[1]=(...r)=>i.hideDropdown&&i.hideDropdown(...r)),tabindex:"0"},[g("div",Hu,[g("div",null,F(e.title),1)])],34)}const Vu=Dt(Nu,[["render",Wu]]),ju={components:{Dropdown:Vu},name:"CodeEditor",props:{lineNums:{type:Boolean,default:!1},modelValue:{type:String},value:{type:String},theme:{type:String,default:"github-dark"},tabSpaces:{type:Number,default:2},wrap:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},autofocus:{type:Boolean,default:!1},header:{type:Boolean,default:!0},width:{type:String,default:"540px"},height:{type:String,default:"auto"},maxWidth:{type:String},minWidth:{type:String},maxHeight:{type:String},minHeight:{type:String},borderRadius:{type:String,default:"12px"},languages:{type:Array,default:function(){return[["javascript","JS"]]}},langListWidth:{type:String,default:"110px"},langListHeight:{type:String,default:"auto"},langListDisplay:{type:Boolean,default:!1},displayLanguage:{type:Boolean,default:!0},zIndex:{type:String,default:"0"},fontSize:{type:String,default:"17px"},padding:{type:String,default:"20px"}},directives:{highlight:{mounted(i,t){i.textContent=t.value},updated(i,t){i.scrolling?i.scrolling=!1:i.textContent=t.value}}},data(){return{scrollBarWidth:0,scrollBarHeight:0,top:0,left:0,languageClass:"hljs language-"+this.languages[0][0],languageTitle:this.languages[0][1]?this.languages[0][1]:this.languages[0][0],content:this.value,cursorPosition:0,insertTab:!1,lineNum:0,lineNumsWidth:0,scrolling:!1,textareaHeight:0,showLineNums:this.wrap?!1:this.lineNums}},computed:{tabWidth(){let i="";for(let t=0;t<this.tabSpaces;t++)i+=" ";return i},contentValue(){return this.modelValue==null?this.content+`
`:this.modelValue+`
`},scroll(){return this.height!="auto"}},methods:{updateValue(i){this.modelValue==null?this.content=i.target.value:this.$emit("update:modelValue",i.target.value)},changeLang(i){this.languageTitle=i[1]?i[1]:i[0],this.languageClass="language-"+i[0],this.$emit("lang",i[0])},tab(){if(document.execCommand("insertText"))document.execCommand("insertText",!1,this.tabWidth);else{const i=this.$refs.textarea.selectionStart;this.content=this.content.substring(0,i)+this.tabWidth+this.content.substring(i),this.cursorPosition=i+this.tabWidth.length,this.insertTab=!0}},calcScrollDistance(i){this.$refs.code.scrolling=!0,this.scrolling=!0,this.top=-i.target.scrollTop,this.left=-i.target.scrollLeft},resizer(){new ResizeObserver(e=>{this.scrollBarWidth=e[0].target.offsetWidth-e[0].target.clientWidth,this.scrollBarHeight=e[0].target.offsetHeight-e[0].target.clientHeight,this.textareaHeight=e[0].target.offsetHeight}).observe(this.$refs.textarea);const t=new ResizeObserver(e=>{this.lineNumsWidth=e[0].target.offsetWidth});this.$refs.lineNums&&t.observe(this.$refs.lineNums)},copy(){document.execCommand("copy")?(this.$refs.textarea.select(),document.execCommand("copy"),window.getSelection().removeAllRanges()):navigator.clipboard.writeText(this.$refs.textarea.value)},getLineNum(){const i=this.$refs.textarea.value;let t=0,e=i.indexOf(`
`);for(;e!==-1;)t++,e=i.indexOf(`
`,e+1);const s=this.$refs.lineNums.firstChild.offsetHeight,n=parseInt(this.textareaHeight/s)-1;this.lineNum=this.height=="auto"||t>n?t:n}},mounted(){this.$emit("lang",this.languages[0][0]),this.$emit("content",this.content),this.$emit("textarea",this.$refs.textarea),this.resizer()},updated(){this.insertTab&&(this.$refs.textarea.setSelectionRange(this.cursorPosition,this.cursorPosition),this.insertTab=!1),this.lineNums&&(this.scrolling?this.scrolling=!1:this.getLineNum())}},Uu=["theme"],Yu=["readOnly","autofocus","value"];function Ku(i,t,e,s,n,o){const r=$("Dropdown"),a=Zo("highlight");return M(),R("div",{theme:e.theme,class:ht(["code-editor",{"hide-header":!e.header,scroll:o.scroll,"read-only":e.readOnly,wrap:e.wrap}]),style:Ot({width:e.width,height:e.height,zIndex:e.zIndex,maxWidth:e.maxWidth,minWidth:e.minWidth,maxHeight:e.maxHeight,minHeight:e.minHeight})},[g("div",{class:"hljs",style:Ot({borderRadius:e.borderRadius})},[e.header?(M(),R("div",{key:0,class:ht(["header",{border:n.showLineNums}]),style:Ot({borderRadius:e.borderRadius+" "+e.borderRadius+" 0 0"})},[e.displayLanguage?(M(),N(r,{key:0,width:e.langListWidth,title:n.languageTitle,disabled:e.languages.length<=1,defaultDisplay:e.langListDisplay},null,8,["width","title","disabled","defaultDisplay"])):B("",!0)],6)):B("",!0),g("div",{class:"code-area",style:Ot({borderRadius:e.header?"0 0 "+e.borderRadius+" "+e.borderRadius:e.borderRadius})},[n.showLineNums?(M(),R("div",{key:0,ref:"lineNums",class:"line-nums hljs",style:Ot({fontSize:e.fontSize,paddingTop:e.header?"10px":e.padding,paddingBottom:e.padding,top:n.top+"px"})},[t[3]||(t[3]=g("div",null,"1",-1)),(M(!0),R(Xt,null,ii(n.lineNum,l=>(M(),R("div",null,F(l+1),1))),256)),t[4]||(t[4]=g("div",null," ",-1))],4)):B("",!0),g("textarea",{title:"textarea",readOnly:e.readOnly,style:Ot({fontSize:e.fontSize,padding:e.header?e.lineNums?"10px "+e.padding+" "+e.padding:"0 "+e.padding+" "+e.padding:e.padding,marginLeft:n.showLineNums?n.lineNumsWidth+"px":"0",width:n.showLineNums?"calc(100% - "+n.lineNumsWidth+"px)":"100%"}),ref:"textarea",autofocus:e.autofocus,spellcheck:"false",onKeydown:t[0]||(t[0]=tr(er((...l)=>o.tab&&o.tab(...l),["prevent","stop"]),["tab"])),onScroll:t[1]||(t[1]=(...l)=>o.calcScrollDistance&&o.calcScrollDistance(...l)),value:e.modelValue==null?n.content:e.modelValue,onInput:t[2]||(t[2]=(...l)=>o.updateValue&&o.updateValue(...l))},null,44,Yu),g("pre",{style:Ot({paddingRight:n.scrollBarWidth+"px",paddingBottom:n.scrollBarHeight+"px",marginLeft:n.showLineNums?n.lineNumsWidth+"px":"0",width:n.showLineNums?"calc(100% - "+n.lineNumsWidth+"px)":"100%"})},[t[6]||(t[6]=pt(" ")),Ui((M(),R("code",{ref:"code",class:ht(n.languageClass),style:Ot({top:n.top+"px",left:n.left+"px",fontSize:e.fontSize,padding:e.header?e.lineNums?"10px "+e.padding+" "+e.padding:"0 "+e.padding+" "+e.padding:e.padding})},t[5]||(t[5]=[pt(`
`)]),6)),[[a,o.contentValue]]),t[7]||(t[7]=pt(`
`))],4)],4)],4)],14,Uu)}const Xu=Dt(ju,[["render",Ku]]),Gu={class:"peerSettingContainer w-100 h-100 position-absolute top-0 start-0 overflow-y-scroll"},Ju={class:"container d-flex h-100 w-100"},qu={class:"m-auto modal-dialog-centered dashboardModal",style:{width:"1000px"}},Qu={class:"card rounded-3 shadow flex-grow-1",id:"deleteConfigurationContainer"},Zu={class:"card-header bg-transparent d-flex align-items-center gap-2 border-0 p-4 pb-0"},tf={class:"mb-0"},ef={class:"card-body px-4 d-flex flex-column gap-3"},sf={class:"alert alert-warning rounded-3 mb-0"},nf={key:0,class:"alert alert-danger rounded-3 mb-0"},of={class:"mb-2"},rf={class:"bg-body w-100 p-2 rounded-3"},af={class:"d-flex gap-2"},lf=["disabled"],cf=["disabled"],hf={__name:"editRawConfigurationFile",emits:["close"],async setup(i,{emit:t}){let e,s;const n=t,o=sr(),r=st(""),a=st(""),l=st(!1),c=st(""),h=async()=>{await oe("/api/getWireguardConfigurationRawFile",{configurationName:o.params.id},p=>{r.value=p.data.content,a.value=p.data.path})};[e,s]=ir(()=>h()),await e,s();const d=hi(),u=st(!1),f=async()=>{u.value=!0,await ie("/api/updateWireguardConfigurationRawFile",{configurationName:o.params.id,rawConfiguration:r.value},p=>{p.status?(l.value=!1,d.newMessage("Server","Configuration saved","success")):(l.value=!0,c.value=p.message),u.value=!1})};return(p,m)=>(M(),R("div",Gu,[g("div",Ju,[g("div",qu,[g("div",Qu,[g("div",Zu,[g("h5",tf,[C(ft,{t:"Edit Raw Configuration File"})]),g("button",{type:"button",class:"btn-close ms-auto",onClick:m[0]||(m[0]=b=>n("close"))})]),g("div",ef,[g("div",sf,[m[4]||(m[4]=g("i",{class:"bi-exclamation-triangle-fill me-2"},null,-1)),C(ft,{t:"Please be careful when editing the raw file"})]),l.value?(M(),R("div",nf,[g("div",of,[g("strong",null,[C(ft,{t:"Failed to save configuration. Please see the following error message:"})])]),g("div",rf,[g("pre",null,F(c.value),1)])])):B("",!0),C(Xu,{disabled:!0,"read-only":u.value,modelValue:r.value,"onUpdate:modelValue":m[1]||(m[1]=b=>r.value=b),theme:Rn(d).Configuration.Server.dashboard_theme==="dark"?"github-dark":"github",languages:[["ini",a.value]],width:"100%",height:"600px"},null,8,["read-only","modelValue","theme","languages"]),g("div",af,[g("button",{class:"btn bg-secondary-subtle border-secondary-subtle text-secondary-emphasis rounded-3 shadow ms-auto px-3 py-2",disabled:u.value,onClick:m[2]||(m[2]=b=>h())},[m[5]||(m[5]=g("i",{class:"bi bi-arrow-clockwise me-2"},null,-1)),C(ft,{t:"Reset"})],8,lf),g("button",{onClick:m[3]||(m[3]=b=>f()),disabled:u.value,class:"btn bg-danger-subtle border-danger-subtle text-danger-emphasis rounded-3 px-3 py-2 shadow"},[m[6]||(m[6]=g("i",{class:"bi bi-save-fill me-2"},null,-1)),u.value?(M(),N(ft,{key:1,t:"Saving..."})):(M(),N(ft,{key:0,t:"Save"}))],8,cf)])])])])])]))}},df={class:"text-center"},uf={key:0,class:"text-muted"},ff={__name:"peerIntersectionObserver",props:["peerListLength","showPeersCount"],emits:["loadMore"],setup(i,{emit:t}){const e=st(void 0),s=t;return ji(()=>{e.value=new IntersectionObserver(n=>{n.forEach(o=>{o.isIntersecting&&s("loadMore")})},{rootMargin:"20px",threshold:1}),e.value.observe(document.querySelector("#loadMore"))}),nr(()=>{e.value.disconnect()}),(n,o)=>(M(),R("div",df,[i.peerListLength<i.showPeersCount?(M(),R("small",uf," That's it, no more peers ")):B("",!0),o[0]||(o[0]=g("div",{style:{"margin-bottom":"20px",height:"1px"},id:"loadMore"},null,-1))]))}};ui.register(Jh,sd,bo,_o,Md,cd,dd,xd,wd,qh);const gf={name:"peerList",components:{PeerIntersectionObserver:ff,EditRawConfigurationFile:hf,ProtocolBadge:ar,PeerSearchBar:$u,PeerRow:Tu,DeleteConfiguration:rt(()=>at(()=>import("./deleteConfiguration-gjCTyT4T.js"),__vite__mapDeps([0,1,2,3]))),ConfigurationBackupRestore:rt(()=>at(()=>import("./configurationBackupRestore-Dea4yoLF.js"),__vite__mapDeps([4,1,2,5,3,6]))),SelectPeers:rt(()=>at(()=>import("./selectPeers-C_VG2AGk.js"),__vite__mapDeps([7,1,2,3,8]))),EditConfiguration:rt(()=>at(()=>import("./editConfiguration-BbKPgegf.js"),__vite__mapDeps([9,1,2,3,10]))),LocaleText:ft,PeerShareLinkModal:rt(()=>at(()=>import("./peerShareLinkModal-D23qHCPl.js"),__vite__mapDeps([11,1,2,5,12,3]))),PeerJobsLogsModal:rt(()=>at(()=>import("./peerJobsLogsModal-PbWxka5-.js"),__vite__mapDeps([13,5,1,2,3]))),PeerJobsAllModal:rt(()=>at(()=>import("./peerJobsAllModal-roMAeqgA.js"),__vite__mapDeps([14,15,1,2,12,5,3,16]))),PeerJobs:rt(()=>at(()=>import("./peerJobs-Cv4hhfes.js"),__vite__mapDeps([17,15,1,2,12,5,3,16,18]))),PeerCreate:rt(()=>at(()=>import("./peerCreate-Cz6pOdlA.js"),__vite__mapDeps([19,1,2,3,20]))),PeerQRCode:rt(()=>at(()=>import("./peerQRCode-7CQhcymP.js"),__vite__mapDeps([21,22,3,1,2]))),PeerConfigurationFile:rt(()=>at(()=>import("./peerConfigurationFile-UmU9dUY-.js"),__vite__mapDeps([23,1,2,3,24]))),PeerSettings:rt(()=>at(()=>import("./peerSettings-CTAPAYhI.js"),__vite__mapDeps([25,1,2,3,26]))),PeerSearch:Mr,Peer:pa,Line:zd,Bar:Bd},setup(){const i=hi(),t=Vi(),e=st(void 0);return{dashboardConfigurationStore:i,wireguardConfigurationStore:t,interval:e}},data(){return{configurationToggling:!1,loading:!1,error:null,configurationInfo:[],configurationPeers:[],historyDataSentDifference:[],historyDataReceivedDifference:[],historySentData:{labels:[],datasets:[{label:"Data Sent",data:[],fill:!1,borderColor:"#198754",tension:0}]},historyReceiveData:{labels:[],datasets:[{label:"Data Received",data:[],fill:!1,borderColor:"#0d6efd",tension:0}]},peerSetting:{modalOpen:!1,selectedPeer:void 0},peerScheduleJobs:{modalOpen:!1,selectedPeer:void 0},peerQRCode:{modalOpen:!1,peerConfigData:void 0},peerConfigurationFile:{modalOpen:!1,peerConfigData:void 0},peerCreate:{modalOpen:!1},peerScheduleJobsAll:{modalOpen:!1},peerScheduleJobsLogs:{modalOpen:!1},peerShare:{modalOpen:!1,selectedPeer:void 0},editConfiguration:{modalOpen:!1},selectPeers:{modalOpen:!1},backupRestore:{modalOpen:!1},deleteConfiguration:{modalOpen:!1},editRawConfigurationFile:{modalOpen:!1},peerSearchBarShow:!1,searchStringTimeout:void 0,searchString:"",showPeersCount:0,showPeersThreshold:10,observer:void 0}},watch:{$route:{immediate:!0,handler(){this.showPeersCount=20,clearInterval(this.dashboardConfigurationStore.Peers.RefreshInterval),this.loading=!0;let i=this.$route.params.id;this.configurationInfo=[],this.configurationPeers=[],i&&(this.getPeers(i),this.setPeerInterval())}},"dashboardConfigurationStore.Configuration.Server.dashboard_refresh_interval"(){clearInterval(this.dashboardConfigurationStore.Peers.RefreshInterval),this.setPeerInterval()}},beforeRouteLeave(){clearInterval(this.dashboardConfigurationStore.Peers.RefreshInterval)},methods:{toggle(){this.configurationToggling=!0,oe("/api/toggleWireguardConfiguration/",{configurationName:this.configurationInfo.Name},i=>{i.status?this.dashboardConfigurationStore.newMessage("Server",`${this.configurationInfo.Name} ${i.data?"is on":"is off"}`,"success"):this.dashboardConfigurationStore.newMessage("Server",i.message,"danger"),this.wireguardConfigurationStore.Configurations.find(t=>t.Name===this.configurationInfo.Name).Status=i.data,console.log(this.wireguardConfigurationStore.Configurations.find(t=>t.Name===this.configurationInfo.Name).Status),this.configurationInfo.Status=i.data,this.configurationToggling=!1})},getPeers(i=this.$route.params.id){oe("/api/getWireguardConfigurationInfo",{configurationName:i},t=>{if(this.configurationInfo=t.data.configurationInfo,this.configurationPeers=t.data.configurationPeers,this.configurationPeers.forEach(e=>{e.restricted=!1}),t.data.configurationRestrictedPeers.forEach(e=>{e.restricted=!0,this.configurationPeers.push(e)}),this.loading=!1,this.configurationPeers.length>0){const e=this.configurationPeers.map(n=>n.total_sent+n.cumu_sent).reduce((n,o)=>n+o).toFixed(4),s=this.configurationPeers.map(n=>n.total_receive+n.cumu_receive).reduce((n,o)=>n+o).toFixed(4);this.historyDataSentDifference[this.historyDataSentDifference.length-1]!==e&&(this.historyDataSentDifference.length>0&&(this.historySentData={labels:[...this.historySentData.labels,cs().format("HH:mm:ss A")],datasets:[{label:"Data Sent",data:[...this.historySentData.datasets[0].data,((e-this.historyDataSentDifference[this.historyDataSentDifference.length-1])*1e3).toFixed(4)],fill:!1,borderColor:"#198754",tension:0}]}),this.historyDataSentDifference.push(e)),this.historyDataReceivedDifference[this.historyDataReceivedDifference.length-1]!==s&&(this.historyDataReceivedDifference.length>0&&(this.historyReceiveData={labels:[...this.historyReceiveData.labels,cs().format("HH:mm:ss A")],datasets:[{label:"Data Received",data:[...this.historyReceiveData.datasets[0].data,((s-this.historyDataReceivedDifference[this.historyDataReceivedDifference.length-1])*1e3).toFixed(4)],fill:!1,borderColor:"#0d6efd",tension:0}]}),this.historyDataReceivedDifference.push(s))}})},setPeerInterval(){this.dashboardConfigurationStore.Peers.RefreshInterval=setInterval(()=>{this.getPeers()},parseInt(this.dashboardConfigurationStore.Configuration.Server.dashboard_refresh_interval))},disableMutationObserver(){}},computed:{configurationSummary(){return{connectedPeers:this.configurationPeers.filter(i=>i.status==="running").length,totalUsage:this.configurationPeers.length>0?this.configurationPeers.filter(i=>!i.restricted).map(i=>i.total_data+i.cumu_data).reduce((i,t)=>i+t,0).toFixed(4):0,totalReceive:this.configurationPeers.length>0?this.configurationPeers.filter(i=>!i.restricted).map(i=>i.total_receive+i.cumu_receive).reduce((i,t)=>i+t,0).toFixed(4):0,totalSent:this.configurationPeers.length>0?this.configurationPeers.filter(i=>!i.restricted).map(i=>i.total_sent+i.cumu_sent).reduce((i,t)=>i+t,0).toFixed(4):0}},receiveData(){return this.historyReceiveData},sentData(){return this.historySentData},individualDataUsage(){return{labels:this.configurationPeers.map(i=>i.name?i.name:`Untitled Peer - ${i.id}`),datasets:[{label:"Total Data Usage",data:this.configurationPeers.map(i=>i.cumu_data+i.total_data),backgroundColor:this.configurationPeers.map(i=>"#0dcaf0"),tooltip:{callbacks:{label:i=>`${i.formattedValue} GB`}}}]}},individualDataUsageChartOption(){return{responsive:!0,plugins:{legend:{display:!1}},scales:{x:{ticks:{display:!1},grid:{display:!1}},y:{ticks:{callback:(i,t)=>`${i} GB`},grid:{display:!1}}}}},chartOptions(){return{responsive:!0,plugins:{legend:{display:!1},tooltip:{callbacks:{label:i=>`${i.formattedValue} MB/s`}}},scales:{x:{ticks:{display:!1},grid:{display:!1}},y:{ticks:{callback:(i,t)=>`${i} MB/s`},grid:{display:!1}}}}},searchPeers(){new he(this.configurationPeers,{keys:["name","id","allowed_ip"]});const i=this.wireguardConfigurationStore.searchString?this.configurationPeers.filter(t=>t.name.includes(this.wireguardConfigurationStore.searchString)||t.id.includes(this.wireguardConfigurationStore.searchString)||t.allowed_ip.includes(this.wireguardConfigurationStore.searchString)):this.configurationPeers;return this.dashboardConfigurationStore.Configuration.Server.dashboard_sort==="restricted"?i.sort((t,e)=>t[this.dashboardConfigurationStore.Configuration.Server.dashboard_sort]<e[this.dashboardConfigurationStore.Configuration.Server.dashboard_sort]?1:t[this.dashboardConfigurationStore.Configuration.Server.dashboard_sort]>e[this.dashboardConfigurationStore.Configuration.Server.dashboard_sort]?-1:0).slice(0,this.showPeersCount):i.sort((t,e)=>t[this.dashboardConfigurationStore.Configuration.Server.dashboard_sort]<e[this.dashboardConfigurationStore.Configuration.Server.dashboard_sort]?-1:t[this.dashboardConfigurationStore.Configuration.Server.dashboard_sort]>e[this.dashboardConfigurationStore.Configuration.Server.dashboard_sort]?1:0).slice(0,this.showPeersCount)}}},pf={key:0,class:"container-md",id:"peerList"},mf={class:"d-flex align-items-sm-center flex-column flex-sm-row gap-3"},bf={class:"text-muted d-flex align-items-center gap-2"},_f={class:"mb-0"},xf={class:"d-flex align-items-center gap-3"},yf={class:"mb-0 display-4"},vf={class:"ms-sm-auto d-flex gap-2 flex-column"},Sf={class:"card rounded-3 bg-transparent"},wf={class:"card-body py-2 d-flex align-items-center"},kf={class:"text-muted"},Pf={class:"form-check form-switch mb-0 ms-auto pe-0 me-0"},Mf=["for"],Cf={key:2,class:"spinner-border spinner-border-sm ms-2","aria-hidden":"true"},Df=["disabled","id"],Of={class:"d-flex gap-2"},Tf={class:"row mt-3 gy-2 gx-2 mb-2"},Lf={class:"col-12 col-lg-3"},Rf={class:"card rounded-3 bg-transparent h-100"},Af={class:"card-body py-2 d-flex flex-column justify-content-center"},If={class:"mb-0 text-muted"},Ef={class:"col-12 col-lg-3"},Ff={class:"card rounded-3 bg-transparent h-100"},Bf={class:"card-body py-2 d-flex flex-column justify-content-center"},zf={class:"mb-0 text-muted"},$f={style:{"word-break":"break-all"},class:"col-12 col-lg-6"},Nf={class:"card rounded-3 bg-transparent h-100"},Hf={class:"card-body py-2 d-flex flex-column justify-content-center"},Wf={class:"mb-0 text-muted"},Vf={class:"row gx-2 gy-2 mb-2"},jf={class:"col-12 col-lg-3"},Uf={class:"card rounded-3 bg-transparent h-100"},Yf={class:"card-body d-flex"},Kf={class:"mb-0 text-muted"},Xf={class:"h4"},Gf={class:"col-12 col-lg-3"},Jf={class:"card rounded-3 bg-transparent h-100"},qf={class:"card-body d-flex"},Qf={class:"mb-0 text-muted"},Zf={class:"h4"},tg={class:"col-12 col-lg-3"},eg={class:"card rounded-3 bg-transparent h-100"},ig={class:"card-body d-flex"},sg={class:"mb-0 text-muted"},ng={class:"h4 text-primary"},og={class:"col-12 col-lg-3"},rg={class:"card rounded-3 bg-transparent h-100"},ag={class:"card-body d-flex"},lg={class:"mb-0 text-muted"},cg={class:"h4 text-success"},hg={class:"row gx-2 gy-2 mb-3"},dg={class:"col-12 col-lg-6"},ug={class:"card rounded-3 bg-transparent",style:{height:"270px"}},fg={class:"card-header bg-transparent border-0"},gg={class:"text-muted"},pg={class:"card-body pt-1"},mg={class:"col-sm col-lg-3"},bg={class:"card rounded-3 bg-transparent",style:{height:"270px"}},_g={class:"card-header bg-transparent border-0"},xg={class:"text-muted"},yg={class:"card-body pt-1"},vg={class:"col-sm col-lg-3"},Sg={class:"card rounded-3 bg-transparent",style:{height:"270px"}},wg={class:"card-header bg-transparent border-0"},kg={class:"text-muted"},Pg={class:"card-body pt-1"},Mg={style:{"margin-bottom":"80px"}};function Cg(i,t,e,s,n,o){const r=$("ProtocolBadge"),a=$("LocaleText"),l=$("RouterLink"),c=$("Bar"),h=$("Line"),d=$("PeerSearch"),u=$("Peer"),f=$("PeerSearchBar"),p=$("PeerSettings"),m=$("PeerQRCode"),b=$("PeerJobs"),_=$("PeerJobsAllModal"),x=$("PeerJobsLogsModal"),S=$("PeerShareLinkModal"),P=$("EditConfiguration"),v=$("SelectPeers"),D=$("DeleteConfiguration"),w=$("EditRawConfigurationFile"),k=$("ConfigurationBackupRestore"),O=$("PeerConfigurationFile"),A=$("PeerIntersectionObserver");return M(),R("div",null,[this.loading?B("",!0):(M(),R("div",pf,[g("div",mf,[g("div",null,[g("div",bf,[g("h5",_f,[C(r,{protocol:this.configurationInfo.Protocol},null,8,["protocol"])])]),g("div",xf,[g("h1",yf,[g("samp",null,F(this.configurationInfo.Name),1)])])]),g("div",vf,[g("div",Sf,[g("div",wf,[g("small",kf,[C(a,{t:"Status"})]),g("div",{class:ht(["dot ms-2",{active:this.configurationInfo.Status}])},null,2),g("div",Pf,[g("label",{class:"form-check-label",style:{cursor:"pointer"},for:"switch"+this.configurationInfo.id},[this.configurationInfo.Status&&!this.configurationToggling?(M(),N(a,{key:0,t:"On"})):!this.configurationInfo.Status&&!this.configurationToggling?(M(),N(a,{key:1,t:"Off"})):B("",!0),this.configurationToggling?(M(),R("span",Cf)):B("",!0)],8,Mf),Ui(g("input",{class:"form-check-input",style:{cursor:"pointer"},disabled:this.configurationToggling,type:"checkbox",role:"switch",id:"switch"+this.configurationInfo.id,onChange:t[0]||(t[0]=y=>this.toggle()),"onUpdate:modelValue":t[1]||(t[1]=y=>this.configurationInfo.Status=y)},null,40,Df),[[or,this.configurationInfo.Status]])])])]),g("div",Of,[C(l,{to:"create",class:"titleBtn py-2 text-decoration-none btn text-primary-emphasis bg-primary-subtle rounded-3 border-1 border-primary-subtle"},{default:X(()=>[t[38]||(t[38]=g("i",{class:"bi bi-plus-lg me-2"},null,-1)),C(a,{t:"Peer"})]),_:1}),g("button",{class:"titleBtn py-2 text-decoration-none btn text-primary-emphasis bg-primary-subtle rounded-3 border-1 border-primary-subtle",onClick:t[2]||(t[2]=y=>n.editConfiguration.modalOpen=!0),type:"button","aria-expanded":"false"},[t[39]||(t[39]=g("i",{class:"bi bi-gear-fill me-2"},null,-1)),C(a,{t:"Configuration Settings"})])])])]),t[44]||(t[44]=g("hr",null,null,-1)),g("div",Tf,[g("div",Lf,[g("div",Rf,[g("div",Af,[g("p",If,[g("small",null,[C(a,{t:"Address"})])]),pt(" "+F(this.configurationInfo.Address),1)])])]),g("div",Ef,[g("div",Ff,[g("div",Bf,[g("p",zf,[g("small",null,[C(a,{t:"Listen Port"})])]),pt(" "+F(this.configurationInfo.ListenPort),1)])])]),g("div",$f,[g("div",Nf,[g("div",Hf,[g("p",Wf,[g("small",null,[C(a,{t:"Public Key"})])]),g("samp",null,F(this.configurationInfo.PublicKey),1)])])])]),g("div",Vf,[g("div",jf,[g("div",Uf,[g("div",Yf,[g("div",null,[g("p",Kf,[g("small",null,[C(a,{t:"Connected Peers"})])]),g("strong",Xf,F(o.configurationSummary.connectedPeers)+" / "+F(n.configurationPeers.length),1)]),t[40]||(t[40]=g("i",{class:"bi bi-ethernet ms-auto h2 text-muted"},null,-1))])])]),g("div",Gf,[g("div",Jf,[g("div",qf,[g("div",null,[g("p",Qf,[g("small",null,[C(a,{t:"Total Usage"})])]),g("strong",Zf,F(o.configurationSummary.totalUsage)+" GB",1)]),t[41]||(t[41]=g("i",{class:"bi bi-arrow-down-up ms-auto h2 text-muted"},null,-1))])])]),g("div",tg,[g("div",eg,[g("div",ig,[g("div",null,[g("p",sg,[g("small",null,[C(a,{t:"Total Received"})])]),g("strong",ng,F(o.configurationSummary.totalReceive)+" GB",1)]),t[42]||(t[42]=g("i",{class:"bi bi-arrow-down ms-auto h2 text-muted"},null,-1))])])]),g("div",og,[g("div",rg,[g("div",ag,[g("div",null,[g("p",lg,[g("small",null,[C(a,{t:"Total Sent"})])]),g("strong",cg,F(o.configurationSummary.totalSent)+" GB",1)]),t[43]||(t[43]=g("i",{class:"bi bi-arrow-up ms-auto h2 text-muted"},null,-1))])])])]),g("div",hg,[g("div",dg,[g("div",ug,[g("div",fg,[g("small",gg,[C(a,{t:"Peers Data Usage"})])]),g("div",pg,[C(c,{data:o.individualDataUsage,options:o.individualDataUsageChartOption,style:{width:"100%",height:"200px","max-height":"200px"}},null,8,["data","options"])])])]),g("div",mg,[g("div",bg,[g("div",_g,[g("small",xg,[C(a,{t:"Real Time Received Data Usage"})])]),g("div",yg,[C(h,{options:o.chartOptions,data:o.receiveData,style:{width:"100%",height:"200px","max-height":"200px"}},null,8,["options","data"])])])]),g("div",vg,[g("div",Sg,[g("div",wg,[g("small",kg,[C(a,{t:"Real Time Sent Data Usage"})])]),g("div",Pg,[C(h,{options:o.chartOptions,data:o.sentData,style:{width:"100%",height:"200px","max-height":"200px"}},null,8,["options","data"])])])])]),t[45]||(t[45]=g("hr",null,null,-1)),g("div",Mg,[C(d,{onSearch:t[3]||(t[3]=y=>this.peerSearchBarShow=!0),onJobsAll:t[4]||(t[4]=y=>this.peerScheduleJobsAll.modalOpen=!0),onJobLogs:t[5]||(t[5]=y=>this.peerScheduleJobsLogs.modalOpen=!0),onEditConfiguration:t[6]||(t[6]=y=>this.editConfiguration.modalOpen=!0),onSelectPeers:t[7]||(t[7]=y=>this.selectPeers.modalOpen=!0),onBackupRestore:t[8]||(t[8]=y=>this.backupRestore.modalOpen=!0),onDeleteConfiguration:t[9]||(t[9]=y=>this.deleteConfiguration.modalOpen=!0),configuration:this.configurationInfo},null,8,["configuration"]),C(rr,{name:"list",tag:"div",class:"row gx-2 gy-2 z-0"},{default:X(()=>[(M(!0),R(Xt,null,ii(this.searchPeers,y=>(M(),R("div",{class:"col-12 col-lg-6 col-xl-4",key:y.id},[C(u,{Peer:y,onShare:T=>{this.peerShare.selectedPeer=y.id,this.peerShare.modalOpen=!0},onRefresh:t[10]||(t[10]=T=>this.getPeers()),onJobs:T=>{n.peerScheduleJobs.modalOpen=!0,n.peerScheduleJobs.selectedPeer=this.configurationPeers.find(K=>K.id===y.id)},onSetting:T=>{n.peerSetting.modalOpen=!0,n.peerSetting.selectedPeer=this.configurationPeers.find(K=>K.id===y.id)},onQrcode:t[11]||(t[11]=T=>{this.peerQRCode.peerConfigData=T,this.peerQRCode.modalOpen=!0}),onConfigurationFile:t[12]||(t[12]=T=>{this.peerConfigurationFile.peerConfigData=T,this.peerConfigurationFile.modalOpen=!0})},null,8,["Peer","onShare","onJobs","onSetting"])]))),128))]),_:1})]),C(q,{name:"slideUp"},{default:X(()=>[this.peerSearchBarShow?(M(),N(f,{key:0,onClose:t[13]||(t[13]=y=>n.peerSearchBarShow=!1)})):B("",!0)]),_:1}),C(q,{name:"zoom"},{default:X(()=>[this.peerSetting.modalOpen?(M(),N(p,{key:"settings",selectedPeer:this.peerSetting.selectedPeer,onRefresh:t[14]||(t[14]=y=>this.getPeers()),onClose:t[15]||(t[15]=y=>this.peerSetting.modalOpen=!1)},null,8,["selectedPeer"])):B("",!0)]),_:1}),C(q,{name:"zoom"},{default:X(()=>[n.peerQRCode.modalOpen?(M(),N(m,{peerConfigData:this.peerQRCode.peerConfigData,key:"qrcode",onClose:t[16]||(t[16]=y=>this.peerQRCode.modalOpen=!1)},null,8,["peerConfigData"])):B("",!0)]),_:1}),C(q,{name:"zoom"},{default:X(()=>[this.peerScheduleJobs.modalOpen?(M(),N(b,{key:0,onRefresh:t[17]||(t[17]=y=>this.getPeers()),selectedPeer:this.peerScheduleJobs.selectedPeer,onClose:t[18]||(t[18]=y=>this.peerScheduleJobs.modalOpen=!1)},null,8,["selectedPeer"])):B("",!0)]),_:1}),C(q,{name:"zoom"},{default:X(()=>[this.peerScheduleJobsAll.modalOpen?(M(),N(_,{key:0,onRefresh:t[19]||(t[19]=y=>this.getPeers()),onAllLogs:t[20]||(t[20]=y=>n.peerScheduleJobsLogs.modalOpen=!0),onClose:t[21]||(t[21]=y=>this.peerScheduleJobsAll.modalOpen=!1),configurationPeers:this.configurationPeers},null,8,["configurationPeers"])):B("",!0)]),_:1}),C(q,{name:"zoom"},{default:X(()=>[this.peerScheduleJobsLogs.modalOpen?(M(),N(x,{key:0,onClose:t[22]||(t[22]=y=>this.peerScheduleJobsLogs.modalOpen=!1),configurationInfo:this.configurationInfo},null,8,["configurationInfo"])):B("",!0)]),_:1}),C(q,{name:"zoom"},{default:X(()=>[this.peerShare.modalOpen?(M(),N(S,{key:0,onClose:t[23]||(t[23]=y=>{this.peerShare.modalOpen=!1,this.peerShare.selectedPeer=void 0}),peer:this.configurationPeers.find(y=>y.id===this.peerShare.selectedPeer)},null,8,["peer"])):B("",!0)]),_:1}),C(q,{name:"zoom"},{default:X(()=>[this.editConfiguration.modalOpen?(M(),N(P,{key:0,onEditRaw:t[24]||(t[24]=y=>this.editRawConfigurationFile.modalOpen=!0),onClose:t[25]||(t[25]=y=>this.editConfiguration.modalOpen=!1),onDataChanged:t[26]||(t[26]=y=>this.configurationInfo=y),onBackupRestore:t[27]||(t[27]=y=>this.backupRestore.modalOpen=!0),onDeleteConfiguration:t[28]||(t[28]=y=>this.deleteConfiguration.modalOpen=!0),configurationInfo:this.configurationInfo},null,8,["configurationInfo"])):B("",!0)]),_:1}),C(q,{name:"zoom"},{default:X(()=>[this.selectPeers.modalOpen?(M(),N(v,{key:0,onRefresh:t[29]||(t[29]=y=>this.getPeers()),configurationPeers:this.configurationPeers,onClose:t[30]||(t[30]=y=>this.selectPeers.modalOpen=!1)},null,8,["configurationPeers"])):B("",!0)]),_:1}),C(q,{name:"zoom"},{default:X(()=>[n.deleteConfiguration.modalOpen?(M(),N(D,{key:0,onBackup:t[31]||(t[31]=y=>n.backupRestore.modalOpen=!0),onClose:t[32]||(t[32]=y=>n.deleteConfiguration.modalOpen=!1)})):B("",!0)]),_:1}),C(q,{name:"zoom"},{default:X(()=>[n.editRawConfigurationFile.modalOpen?(M(),N(w,{key:0,onClose:t[33]||(t[33]=y=>n.editRawConfigurationFile.modalOpen=!1)})):B("",!0)]),_:1}),C(q,{name:"zoom"},{default:X(()=>[n.backupRestore.modalOpen?(M(),N(k,{key:0,onClose:t[34]||(t[34]=y=>n.backupRestore.modalOpen=!1),onRefreshPeersList:t[35]||(t[35]=y=>this.getPeers())})):B("",!0)]),_:1}),C(q,{name:"zoom"},{default:X(()=>[n.peerConfigurationFile.modalOpen?(M(),N(O,{key:0,onClose:t[36]||(t[36]=y=>n.peerConfigurationFile.modalOpen=!1),configurationFile:n.peerConfigurationFile.peerConfigData},null,8,["configurationFile"])):B("",!0)]),_:1})])),C(A,{showPeersCount:this.showPeersCount,peerListLength:this.searchPeers.length,onLoadMore:t[37]||(t[37]=y=>this.showPeersCount+=this.showPeersThreshold)},null,8,["showPeersCount","peerListLength"])])}const Eg=Dt(gf,[["render",Cg],["__scopeId","data-v-697667bd"]]);export{Eg as default};